@univerjs/preset-sheets-node-core 0.6.1 → 0.6.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/umd/index.js +10 -10
- package/package.json +19 -19
package/lib/umd/index.js
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
// @univerjs/sheets/index
|
|
10
|
-
(function(g,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@univerjs/core"),require("@univerjs/engine-formula"),require("@univerjs/rpc"),require("rxjs"),require("@univerjs/engine-numfmt"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-formula","@univerjs/rpc","rxjs","@univerjs/engine-numfmt","rxjs/operators"],i):(g=typeof globalThis<"u"?globalThis:g||self,i(g.UniverSheets={},g.UniverCore,g.UniverEngineFormula,g.UniverRpc,g.rxjs,g.UniverEngineNumfmt,g.rxjs.operators))})(this,function(g,i,z,mi,A,Un,yt){"use strict";var Zu=Object.defineProperty;var Qu=(g,i,z)=>i in g?Zu(g,i,{enumerable:!0,configurable:!0,writable:!0,value:z}):g[i]=z;var f=(g,i,z)=>Qu(g,typeof i!="symbol"?i+"":i,z);var qs=(s=>(s.OthersCanView="othersCanView",s.NoOneElseCanView="noOneElseCanView",s))(qs||{}),Ks=(s=>(s.DesignedUserCanEdit="designedUserCanEdit",s.OnlyMe="onlyMe",s))(Ks||{});class K{constructor(){f(this,"_model",new Map);f(this,"_ruleChange$",new A.Subject);f(this,"ruleChange$",this._ruleChange$.asObservable());f(this,"_ruleRefresh$",new A.Subject);f(this,"ruleRefresh$",this._ruleRefresh$.asObservable());f(this,"_rangeRuleInitStateChange",new A.BehaviorSubject(!1));f(this,"rangeRuleInitStateChange$",this._rangeRuleInitStateChange.asObservable())}dispose(){this._ruleChange$.complete(),this._ruleRefresh$.complete()}ruleRefresh(e){this._ruleRefresh$.next(e)}getRangeRuleInitState(){return this._rangeRuleInitStateChange.value}changeRuleInitState(e){this._rangeRuleInitStateChange.next(e)}addRule(e,t,n){this._ensureRuleMap(e,t).set(n.id,n),this._ruleChange$.next({unitId:e,subUnitId:t,rule:n,type:"add"})}deleteRule(e,t,n){var r,a,l,u;const o=(a=(r=this._model.get(e))==null?void 0:r.get(t))==null?void 0:a.get(n);o&&((u=(l=this._model.get(e))==null?void 0:l.get(t))==null||u.delete(n),this._ruleChange$.next({unitId:e,subUnitId:t,rule:o,type:"delete"}))}setRule(e,t,n,o){var a,l;const r=this.getRule(e,t,n);r&&((l=(a=this._model.get(e))==null?void 0:a.get(t))==null||l.set(n,o),this._ruleChange$.next({unitId:e,subUnitId:t,oldRule:r,rule:o,type:"set"}))}getRule(e,t,n){var o,r;return(r=(o=this._model.get(e))==null?void 0:o.get(t))==null?void 0:r.get(n)}getSubunitRuleList(e,t){var o;return[...(((o=this._model.get(e))==null?void 0:o.get(t))||new Map).values()]}getSubunitRuleListLength(e,t){var o;const n=(o=this._model.get(e))==null?void 0:o.get(t);return n?n.size:0}_ensureRuleMap(e,t){let n=this._model.get(e);n||(n=new Map,this._model.set(e,n));let o=n.get(t);return o||(o=new Map,n.set(t,o)),o}toObject(){const e={};return[...this._model.keys()].forEach(n=>{const o=this._model.get(n),r=[...o.keys()];e[n]={},r.forEach(a=>{const l=o.get(a);e[n][a]=[...l.values()]})}),e}fromObject(e){const t=new Map;Object.keys(e).forEach(n=>{const o=e[n],r=new Map;Object.keys(o).forEach(a=>{const l=o[a].reduce((u,d)=>(u.set(d.id,d),u),new Map);r.set(a,l)}),t.set(n,r)}),this._model=t}deleteUnitModel(e){this._model.delete(e)}createRuleId(e,t){let n=i.Tools.generateRandomId(4);const o=this._ensureRuleMap(e,t);for(;o.has(n);)n=i.Tools.generateRandomId(4);return n}getTargetByPermissionId(e,t){const n=this._model.get(e);if(!n)return null;for(const[o,r]of n)for(const a of r.values())if(a.permissionId===t)return[e,o];return null}}const hi=(s,e)=>{const t=s.get(K),n=e.ruleIds.map(r=>t.getRule(e.unitId,e.subUnitId,r)).filter(r=>!!r);return{id:ae.id,params:{subUnitId:e.subUnitId,unitId:e.unitId,rules:n}}},Ie={id:"sheet.mutation.delete-range-protection",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,ruleIds:o}=e,r=s.get(K);return o.forEach(a=>{r.deleteRule(t,n,a)}),!0}},gi=s=>{const e={...s,ruleIds:s.rules.map(t=>t.id)};return{id:Ie.id,params:e}},ae={id:"sheet.mutation.add-range-protection",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,rules:o}=e,r=s.get(K);return o.forEach(a=>{r.addRule(t,n,a)}),!0}},Js={type:i.CommandType.COMMAND,id:"sheet.command.add-range-protection",async handler(s,e){if(!e)return!1;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(K),{rule:r,permissionId:a}=e,{unitId:l,subUnitId:u,ranges:d,description:c,viewState:m,editState:h}=r,R=[{ranges:d,permissionId:a,id:o.createRuleId(l,u),description:c,unitType:r.unitType,unitId:l,subUnitId:u,viewState:m,editState:h}];if(await t.executeCommand(ae.id,{unitId:l,subUnitId:u,rules:R})){const C=[{id:ae.id,params:{unitId:l,subUnitId:u,rules:R}}],v=[{id:Ie.id,params:{unitId:l,subUnitId:u,ruleIds:R.map(I=>I.id)}}];n.pushUndoRedo({unitID:l,redoMutations:C,undoMutations:v})}return!0}};class pe{constructor(){f(this,"_model",new Map);f(this,"_ruleChange",new A.Subject);f(this,"_ruleRefresh",new A.Subject);f(this,"_resetOrder",new A.Subject);f(this,"ruleChange$",this._ruleChange.asObservable());f(this,"ruleRefresh$",this._ruleRefresh.asObservable());f(this,"resetOrder$",this._resetOrder.asObservable());f(this,"_worksheetRuleInitStateChange",new A.BehaviorSubject(!1));f(this,"worksheetRuleInitStateChange$",this._worksheetRuleInitStateChange.asObservable())}changeRuleInitState(e){this._worksheetRuleInitStateChange.next(e)}getSheetRuleInitState(){return this._worksheetRuleInitStateChange.value}addRule(e,t){this._ensureSubUnitMap(e).set(t.subUnitId,t),this._ruleChange.next({unitId:e,rule:t,type:"add",subUnitId:t.subUnitId})}deleteRule(e,t){var o,r,a;const n=(r=(o=this._model)==null?void 0:o.get(e))==null?void 0:r.get(t);n&&((a=this._model.get(e))==null||a.delete(t),this._ruleChange.next({unitId:e,rule:n,type:"delete",subUnitId:t}))}setRule(e,t,n){var r,a;const o=this.getRule(e,t);o&&((a=(r=this._model)==null?void 0:r.get(e))==null||a.set(t,n),this._ruleChange.next({unitId:e,oldRule:o,rule:n,type:"set",subUnitId:t}))}getRule(e,t){var n,o;return(o=(n=this._model)==null?void 0:n.get(e))==null?void 0:o.get(t)}toObject(){const e={};return[...this._model.keys()].forEach(n=>{const o=this._model.get(n);o!=null&&o.size&&(e[n]=[],[...o.keys()].forEach(a=>{const l=o.get(a);l&&e[n].push(l)}))}),e}fromObject(e){const t=new Map;Object.keys(e).forEach(n=>{const o=e[n];if(o!=null&&o.length){const r=new Map;o.forEach(a=>{r.set(a.subUnitId,a)}),t.set(n,r)}}),this._model=t}deleteUnitModel(e){this._model.delete(e)}_ensureSubUnitMap(e){let t=this._model.get(e);return t||(t=new Map,this._model.set(e,t)),t}ruleRefresh(e){this._ruleRefresh.next(e)}resetOrder(){this._resetOrder.next(Math.random())}getTargetByPermissionId(e,t){const n=this._model.get(e);if(!n)return null;for(const[o,r]of n)if(r.permissionId===t)return[e,o]}}const Oe={id:"sheet.mutation.add-worksheet-protection",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,rule:n}=e;return s.get(pe).addRule(t,n),!0}},Fe={id:"sheet.mutation.delete-worksheet-protection",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n}=e;return s.get(pe).deleteRule(t,n),!0}},xs={type:i.CommandType.COMMAND,id:"sheet.command.add-worksheet-protection",async handler(s,e){if(!e)return!1;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),{rule:o,unitId:r}=e,a=o.subUnitId;if(await t.executeCommand(Oe.id,{unitId:r,rule:o,subUnitId:o.subUnitId})){const u=[{id:Oe.id,params:{unitId:r,rule:o,subUnitId:o.subUnitId}}],d=[{id:Fe.id,params:{unitId:r,subUnitId:a}}];n.pushUndoRedo({unitID:r,redoMutations:u,undoMutations:d})}return!0}},Ri=i.createInterceptorKey("CELL_CONTENT"),Si=i.createInterceptorKey("ROW_FILTERED"),Ee={CELL_CONTENT:Ri,ROW_FILTERED:Si};var Xs=(s=>(s[s.DATA_VALIDATION=9]="DATA_VALIDATION",s[s.NUMFMT=10]="NUMFMT",s[s.CELL_IMAGE=11]="CELL_IMAGE",s))(Xs||{});const Zs="sheet.interceptor.range-theme-id",Qs="sheet.interceptor.ignore-range-theme";var Ci=Object.getOwnPropertyDescriptor,fi=(s,e,t,n)=>{for(var o=n>1?void 0:n?Ci(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},vi=(s,e)=>(t,n)=>e(t,n,s);const Pn=i.createInterceptorKey("BEFORE_CELL_EDIT"),zt=i.createInterceptorKey("AFTER_CELL_EDIT"),Yt=i.createInterceptorKey("AFTER_CELL_EDIT_ASYNC");g.SheetInterceptorService=class extends i.Disposable{constructor(t){super();f(this,"_interceptorsByName",new Map);f(this,"_commandInterceptors",[]);f(this,"_rangeInterceptors",[]);f(this,"_beforeCommandInterceptor",[]);f(this,"_afterCommandInterceptors",[]);f(this,"_workbookDisposables",new Map);f(this,"_worksheetDisposables",new Map);f(this,"_interceptorsDirty",!1);f(this,"_composedInterceptorByKey",new Map);f(this,"writeCellInterceptor",new i.InterceptorManager({BEFORE_CELL_EDIT:Pn,AFTER_CELL_EDIT:zt,AFTER_CELL_EDIT_ASYNC:Yt}));this._univerInstanceService=t,this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(i.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{this._interceptWorkbook(n)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(i.UniverInstanceType.UNIVER_SHEET).subscribe(n=>this._disposeWorkbookInterceptor(n))),this.intercept(Ee.CELL_CONTENT,{priority:-1,effect:i.InterceptorEffectEnum.Style|i.InterceptorEffectEnum.Value,handler(n,o){const r=o.worksheet.getCellRaw(o.row,o.col);return n?{...r,...n}:r}}),this.disposeWithMe(this.writeCellInterceptor.intercept(zt,{priority:-1,handler:n=>n})),this.disposeWithMe(this.writeCellInterceptor.intercept(Pn,{priority:-1,handler:n=>n})),this.disposeWithMe(this.writeCellInterceptor.intercept(Yt,{priority:-1,handler:n=>n}))}dispose(){super.dispose(),this._workbookDisposables.forEach(t=>t.dispose()),this._workbookDisposables.clear(),this._worksheetDisposables.clear(),this._interceptorsByName.clear()}interceptCommand(t){if(this._commandInterceptors.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._commandInterceptors.push(t),this._commandInterceptors.sort((n,o)=>{var r,a;return((r=o.priority)!=null?r:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(i.toDisposable(()=>i.remove(this._commandInterceptors,t)))}onCommandExecute(t){const n=this._commandInterceptors.map(o=>o.getMutations(t));return{preUndos:n.map(o=>{var r;return(r=o.preUndos)!=null?r:[]}).flat(),undos:n.map(o=>o.undos).flat(),preRedos:n.map(o=>{var r;return(r=o.preRedos)!=null?r:[]}).flat(),redos:n.map(o=>o.redos).flat()}}interceptAfterCommand(t){if(this._afterCommandInterceptors.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._afterCommandInterceptors.push(t),this._afterCommandInterceptors.sort((n,o)=>{var r,a;return((r=o.priority)!=null?r:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(i.toDisposable(()=>i.remove(this._afterCommandInterceptors,t)))}afterCommandExecute(t){const n=this._afterCommandInterceptors.map(o=>o.getMutations(t));return{undos:n.map(o=>o.undos).flat(),redos:n.map(o=>o.redos).flat()}}interceptBeforeCommand(t){if(this._beforeCommandInterceptor.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._beforeCommandInterceptor.push(t),this._beforeCommandInterceptor.sort((n,o)=>{var r,a;return((r=o.priority)!=null?r:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(i.toDisposable(()=>i.remove(this._beforeCommandInterceptor,t)))}async beforeCommandExecute(t){return(await Promise.all(this._beforeCommandInterceptor.map(o=>o.performCheck(t)))).every(o=>o)}interceptRanges(t){if(this._rangeInterceptors.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._rangeInterceptors.push(t),this._rangeInterceptors.sort((n,o)=>{var r,a;return((r=o.priority)!=null?r:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(i.toDisposable(()=>i.remove(this._rangeInterceptors,t)))}generateMutationsByRanges(t){const n=this._rangeInterceptors.map(o=>o.getMutations(t));return{preUndos:n.map(o=>{var r;return(r=o.preUndos)!=null?r:[]}).flat(),undos:n.map(o=>o.undos).flat(),preRedos:n.map(o=>{var r;return(r=o.preRedos)!=null?r:[]}).flat(),redos:n.map(o=>o.redos).flat()}}async onWriteCell(t,n,o,r,a){const l={subUnitId:n.getSheetId(),unitId:t.getUnitId(),workbook:t,worksheet:n,row:o,col:r,origin:i.Tools.deepClone(a)},u=this.writeCellInterceptor.fetchThroughInterceptors(zt)(a,l);return await this.writeCellInterceptor.fetchThroughInterceptors(Yt)(Promise.resolve(u),l)}intercept(t,n){const o=t;this._interceptorsByName.has(o)||this._interceptorsByName.set(o,[]);const r=this._interceptorsByName.get(o);r.push(n);const a=r.sort((l,u)=>{var d,c;return((d=u.priority)!=null?d:0)-((c=l.priority)!=null?c:0)});if(this._interceptorsDirty=!0,o===Ee.CELL_CONTENT){const l=i.InterceptorEffectEnum.Style|i.InterceptorEffectEnum.Value;this._interceptorsByName.set(`${o}-${l}`,a);const u=i.InterceptorEffectEnum.Style|i.InterceptorEffectEnum.Value;return this._interceptorsByName.set(`${o}-${i.InterceptorEffectEnum.Style}`,a.filter(d=>((d.effect||u)&i.InterceptorEffectEnum.Style)>0)),this._interceptorsByName.set(`${o}-${i.InterceptorEffectEnum.Value}`,a.filter(d=>((d.effect||u)&i.InterceptorEffectEnum.Value)>0)),this.disposeWithMe(i.toDisposable(()=>{i.remove(this._interceptorsByName.get(o),n),i.remove(this._interceptorsByName.get(`${o}-${l}`),n),i.remove(this._interceptorsByName.get(`${o}-${i.InterceptorEffectEnum.Style}`),n),i.remove(this._interceptorsByName.get(`${o}-${i.InterceptorEffectEnum.Value}`),n)}))}else return this._interceptorsByName.set(o,a),this.disposeWithMe(i.toDisposable(()=>i.remove(this._interceptorsByName.get(o),n)))}fetchThroughInterceptors(t,n,o,r){const a=n===void 0?t:`${t}-${n}`,l=o!=null?o:a;let u=this._composedInterceptorByKey.get(l);if(!u||this._interceptorsDirty){let d=this._interceptorsByName.get(a);d&&r&&(d=d.filter(r)),u=i.composeInterceptors(d||[]),this._composedInterceptorByKey.set(l,u)}return u}_interceptWorkbook(t){const n=new i.DisposableCollection,o=t.getUnitId(),r=this,a=l=>{const u=l.getSheetId();l.__interceptViewModel(d=>{const c=new i.DisposableCollection;r._worksheetDisposables.set(eo(o,l),c),c.add(d.registerCellContentInterceptor({getCell(m,h,R,S,C){const v=l.getCellRaw(m,h);return r.fetchThroughInterceptors(Ee.CELL_CONTENT,R,S,C)(v,{unitId:o,subUnitId:u,row:m,col:h,worksheet:l,workbook:t,rawData:v})}})),c.add(d.registerRowFilteredInterceptor({getRowFiltered(m){return!!r.fetchThroughInterceptors(Ee.ROW_FILTERED)(!1,{unitId:o,subUnitId:u,row:m,workbook:t,worksheet:l})}}))})};t.getSheets().forEach(l=>a(l)),n.add(t.sheetCreated$.subscribe(l=>a(l))),n.add(i.toDisposable(()=>t.getSheets().forEach(l=>this._disposeSheetInterceptor(o,l)))),n.add(t.sheetDisposed$.subscribe(l=>this._disposeSheetInterceptor(o,l))),this._workbookDisposables.set(o,n)}_disposeWorkbookInterceptor(t){const n=t.getUnitId(),o=this._workbookDisposables.get(n);o&&(o.dispose(),this._workbookDisposables.delete(n))}_disposeSheetInterceptor(t,n){const o=eo(t,n),r=this._worksheetDisposables.get(o);r&&(r.dispose(),this._worksheetDisposables.delete(o))}},g.SheetInterceptorService=fi([vi(0,i.IUniverInstanceService)],g.SheetInterceptorService);function eo(s,e){return`${s}|${e.getSheetId()}`}const J=s=>{const e={};return s.bg&&(e.bg={...s.bg}),s.ol&&(e.ol={...s.ol}),s.bd&&(e.bd={...s.bd}),s.cl&&(e.cl={...s.cl}),s.ht&&(e.ht=s.ht),s.vt&&(e.vt=s.vt),s.bl!==void 0&&(e.bl=s.bl),e};function Ii(s){const e={};if(s.length===1)return s[0];for(const t of s)t.bg&&(e.bg=t.bg),t.ol&&(e.ol=t.ol),t.bd&&(e.bd={...e.bd,...t.bd}),t.cl&&(e.cl=t.cl),t.ht&&(e.ht=t.ht),t.vt&&(e.vt=t.vt),t.bl!==void 0&&(e.bl=t.bl);return e}const x={wholeStyle:1,headerRowStyle:2,headerColumnStyle:4,firstRowStyle:8,secondRowStyle:16,lastRowStyle:32,firstColumnStyle:128,secondColumnStyle:256,lastColumnStyle:512};class De{constructor(e,t){f(this,"_name");f(this,"wholeStyle",null);f(this,"headerRowStyle",null);f(this,"headerColumnStyle",null);f(this,"firstRowStyle",null);f(this,"secondRowStyle",null);f(this,"lastRowStyle",null);f(this,"firstColumnStyle",null);f(this,"secondColumnStyle",null);f(this,"lastColumnStyle",null);f(this,"_mergeCacheMap",new Map);t&&this.fromJson({...t,name:e}),this._name=e}getName(){return this._name}getWholeStyle(){return this.wholeStyle}setWholeStyle(e){this.wholeStyle=e}getFirstRowStyle(){return this.firstRowStyle}setFirstRowStyle(e){this.firstRowStyle=e}getSecondRowStyle(){return this.secondRowStyle}setSecondRowStyle(e){this.secondRowStyle=e}getLastRowStyle(){return this.lastRowStyle}setLastRowStyle(e){this.lastRowStyle=e}getFirstColumnStyle(){return this.firstColumnStyle}setFirstColumnStyle(e){this.firstColumnStyle=e}getSecondColumnStyle(){return this.secondColumnStyle}setSecondColumnStyle(e){this.secondColumnStyle=e}getLastColumnStyle(){return this.lastColumnStyle}setLastColumnStyle(e){this.lastColumnStyle=e}getHeaderRowStyle(){return this.headerRowStyle}setHeaderRowStyle(e){this.headerRowStyle=e}getHeaderColumnStyle(){return this.headerColumnStyle}setHeaderColumnStyle(e){this.headerColumnStyle=e}getStyle(e,t,n,o){let r=0;return n&&(r=r|x.lastRowStyle),o&&(r=r|x.lastColumnStyle),e>=0&&t>=0&&(r=r|x.wholeStyle),e%2===1&&(r=r|x.firstRowStyle),e%2===0&&(r=r|x.secondRowStyle),e===0&&(r=r|x.headerRowStyle),t===0&&(r=r|x.headerColumnStyle),t%2===1&&(r=r|x.firstColumnStyle),t%2===0&&(r=r|x.secondColumnStyle),r===0?null:this._getMergeStyle(r)}_getMergeStyle(e){let t=this._mergeCacheMap.get(e);return t||(t=this._mergeStyle(e),this._mergeCacheMap.set(e,t)),t}_mergeStyle(e){const t=[];return this.wholeStyle&&e&x.wholeStyle&&t.push(this.wholeStyle),this.firstColumnStyle&&e&x.firstColumnStyle&&t.push(this.firstColumnStyle),this.secondColumnStyle&&e&x.secondColumnStyle&&t.push(this.secondColumnStyle),this.firstRowStyle&&e&x.firstRowStyle&&t.push(this.firstRowStyle),this.secondRowStyle&&e&x.secondRowStyle&&t.push(this.secondRowStyle),this.headerColumnStyle&&e&x.headerColumnStyle&&t.push(this.headerColumnStyle),this.lastColumnStyle&&e&x.lastColumnStyle&&t.push(this.lastColumnStyle),this.headerRowStyle&&e&x.headerRowStyle&&t.push(this.headerRowStyle),this.lastRowStyle&&e&x.lastRowStyle&&t.push(this.lastRowStyle),Ii(t)}toJson(){const e={name:this._name};return this.wholeStyle&&(e.wholeStyle=J(this.wholeStyle)),this.headerRowStyle&&(e.headerRowStyle=J(this.headerRowStyle)),this.headerColumnStyle&&(e.headerColumnStyle=J(this.headerColumnStyle)),this.firstRowStyle&&(e.firstRowStyle=J(this.firstRowStyle)),this.secondRowStyle&&(e.secondRowStyle=J(this.secondRowStyle)),this.lastRowStyle&&(e.lastRowStyle=J(this.lastRowStyle)),this.firstColumnStyle&&(e.firstColumnStyle=J(this.firstColumnStyle)),this.secondColumnStyle&&(e.secondColumnStyle=J(this.secondColumnStyle)),this.lastColumnStyle&&(e.lastColumnStyle=J(this.lastColumnStyle)),e}fromJson(e){this._name=e.name,e.wholeStyle&&(this.wholeStyle=J(e.wholeStyle)),e.headerRowStyle&&(this.headerRowStyle=J(e.headerRowStyle)),e.headerColumnStyle&&(this.headerColumnStyle=J(e.headerColumnStyle)),e.firstRowStyle&&(this.firstRowStyle=J(e.firstRowStyle)),e.secondRowStyle&&(this.secondRowStyle=J(e.secondRowStyle)),e.lastRowStyle&&(this.lastRowStyle=J(e.lastRowStyle)),e.firstColumnStyle&&(this.firstColumnStyle=J(e.firstColumnStyle)),e.secondColumnStyle&&(this.secondColumnStyle=J(e.secondColumnStyle)),e.lastColumnStyle&&(this.lastColumnStyle=J(e.lastColumnStyle))}dispose(){this._mergeCacheMap.clear()}}const pi=(s,e,t)=>new De(`light-${s}`,{headerRowStyle:{bg:{rgb:e}},firstColumnStyle:{bg:{rgb:"rgb(255, 255, 255)"}},secondColumnStyle:{bg:{rgb:t}},lastRowStyle:{bg:{rgb:e}}}),wi=(s,e,t)=>new De(`middle-${s}`,{headerRowStyle:{bg:{rgb:e}},headerColumnStyle:{bg:{rgb:t}},secondRowStyle:{bg:{rgb:t}},lastRowStyle:{bg:{rgb:e}},lastColumnStyle:{bg:{rgb:t}}}),Mi=(s,e,t,n)=>new De(`dark-${s}`,{headerRowStyle:{bg:{rgb:e},cl:{rgb:"rgb(255, 255, 255)"},ht:i.HorizontalAlign.CENTER,bl:i.BooleanNumber.TRUE},firstRowStyle:{bg:{rgb:t}},secondRowStyle:{bg:{rgb:n}},lastRowStyle:{bg:{rgb:e}}}),yi=[{baseName:"blue",header:"rgb(164, 202, 254)",color:"rgb(225, 239, 254)"},{baseName:"grey",header:"rgb(205, 208, 216)",color:"rgb(238, 239, 241)"},{baseName:"red",header:"rgb(248, 180, 180)",color:"rgb(253, 232, 232)"},{baseName:"orange",header:"rgb(253, 186, 140)",color:"rgb(254, 236, 220)"},{baseName:"yellow",header:"rgb(250, 200, 21)",color:"rgb(255, 244, 185)"},{baseName:"green",header:"rgb(132, 225, 188)",color:"rgb(222, 247, 236)"},{baseName:"azure",header:"rgb(126, 220, 226)",color:"rgb(213, 245, 246)"},{baseName:"indigo",header:"rgb(186, 198, 248)",color:"rgb(233, 237, 255)"},{baseName:"purple",header:"rgb(202, 191, 253)",color:"rgb(237, 235, 254)"},{baseName:"magenta",header:"rgb(248, 180, 217)",color:"rgb(252, 232, 243)"}],_i=[{baseName:"blue",rowHeader:"rgb(63, 131, 248)",colHeader:"rgb(195, 221, 253)"},{baseName:"grey",rowHeader:"rgb(95, 101, 116)",colHeader:"rgb(227, 229, 234)"},{baseName:"red",rowHeader:"rgb(240, 82, 82)",colHeader:"rgb(251, 213, 213)"},{baseName:"orange",rowHeader:"rgb(255, 90, 31)",colHeader:"rgb(252, 217, 189)"},{baseName:"yellow",rowHeader:"rgb(212, 157, 15)",colHeader:"rgb(252, 220, 106)"},{baseName:"green",rowHeader:"rgb(13, 164, 113)",colHeader:"rgb(188, 240, 218)"},{baseName:"azure",rowHeader:"rgb(6, 148, 162)",colHeader:"rgb(175, 236, 239)"},{baseName:"indigo",rowHeader:"rgb(70, 106, 247)",colHeader:"rgb(210, 218, 250)"},{baseName:"purple",rowHeader:"rgb(144, 97, 249)",colHeader:"rgb(220, 215, 254)"},{baseName:"magenta",rowHeader:"rgb(231, 70, 148)",colHeader:"rgb(250, 209, 232)"}],bi=[{baseName:"blue",rowHeader:"rgb(30, 66, 159)",firstRow:"rgb(195, 221, 253)",secondRow:"rgb(118, 169, 250)"},{baseName:"grey",rowHeader:"rgb(44, 48, 64)",firstRow:"rgb(227, 229, 234)",secondRow:"rgb(151, 157, 172)"},{baseName:"red",rowHeader:"rgb(155, 28, 28)",firstRow:"rgb(251, 213, 213)",secondRow:"rgb(249, 128, 128)"},{baseName:"orange",rowHeader:"rgb(180, 52, 3)",firstRow:"rgb(252, 217, 189)",secondRow:"rgb(255, 138, 76)"},{baseName:"yellow",rowHeader:"rgb(154, 109, 21)",firstRow:"rgb(252, 220, 106)",secondRow:"rgb(212, 157, 15)"},{baseName:"green",rowHeader:"rgb(4, 108, 78)",firstRow:"rgb(188, 240, 218)",secondRow:"rgb(49, 196, 141)"},{baseName:"azure",rowHeader:"rgb(3, 102, 114)",firstRow:"rgb(175, 236, 239)",secondRow:"rgb(22, 189, 202)"},{baseName:"indigo",rowHeader:"rgb(16, 51, 191)",firstRow:"rgb(210, 218, 250)",secondRow:"rgb(98, 128, 249)"},{baseName:"purple",rowHeader:"rgb(74, 29, 150)",firstRow:"rgb(220, 215, 254)",secondRow:"rgb(172, 148, 250)"},{baseName:"magenta",rowHeader:"rgb(153, 21, 75)",firstRow:"rgb(250, 209, 232)",secondRow:"rgb(241, 126, 184)"}],Ti=yi.map(({baseName:s,header:e,color:t})=>pi(s,e,t)),Ei=_i.map(({baseName:s,rowHeader:e,colHeader:t})=>wi(s,e,t)),Ui=bi.map(({baseName:s,rowHeader:e,firstRow:t,secondRow:n})=>Mi(s,e,t,n)),Pi=[...Ti,...Ei,...Ui],to={headerRowStyle:{bg:{rgb:"rgb(68,114,196)"},cl:{rgb:"rgb(255,255,255)"},ht:i.HorizontalAlign.CENTER,bl:i.BooleanNumber.TRUE},firstRowStyle:{bg:{rgb:"rgb(217,225,242)"}}},ki=new De("default",to),Ni=new De("default-last-row",{...to,lastRowStyle:{bd:{t:{s:i.BorderStyleTypes.THIN,cl:{rgb:"rgb(68,114,196)"}}},ht:i.HorizontalAlign.CENTER,bl:i.BooleanNumber.TRUE}});var Oi=Object.getOwnPropertyDescriptor,Di=(s,e,t,n)=>{for(var o=n>1?void 0:n?Oi(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},no=(s,e)=>(t,n)=>e(t,n,s);const Ai="SHEET_RANGE_THEME_MODEL_PLUGIN";let we=class extends i.Disposable{constructor(e,t){super();f(this,"_rangeThemeStyleMap",new Map);f(this,"_rangeThemeStyleRuleMap",new Map);f(this,"_rTreeCollection",new Map);f(this,"_defaultRangeThemeMap",new Map);this._sheetInterceptorService=e,this._resourceManagerService=t,this._registerIntercept(),this._initSnapshot(),this._initDefaultTheme()}_initDefaultTheme(){this.registerDefaultRangeTheme(ki),this.registerDefaultRangeTheme(Ni);for(const e of Pi)this.registerDefaultRangeTheme(e)}_ensureRangeThemeStyleMap(e){return this._rangeThemeStyleMap.has(e)||this._rangeThemeStyleMap.set(e,new Map),this._rangeThemeStyleMap.get(e)}_ensureRangeThemeStyleRuleMap(e){return this._rangeThemeStyleRuleMap.has(e)||this._rangeThemeStyleRuleMap.set(e,new Map),this._rangeThemeStyleRuleMap.get(e)}_ensureRTreeCollection(e){return this._rTreeCollection.has(e)||this._rTreeCollection.set(e,new i.RTree),this._rTreeCollection.get(e)}getDefaultRangeThemeStyle(e){return this._defaultRangeThemeMap.get(e)}registerRangeThemeRule(e,t){const{unitId:n,subUnitId:o,range:r}=t,a=i.generateRandomId(),l=this._ensureRangeThemeStyleRuleMap(n),u=this._ensureRTreeCollection(n);l.set(a,{rangeInfo:t,themeName:e}),u.insert({unitId:n,sheetId:o,range:r,id:a})}getRegisteredRangeThemeStyle(e){const{unitId:t,subUnitId:n,range:o}=e,r=this._ensureRTreeCollection(t),a=Array.from(r.bulkSearch([{unitId:t,sheetId:n,range:o}]));if(a[0]){const u=this._ensureRangeThemeStyleRuleMap(t).get(a[0]);if(u)return u.themeName}}removeRangeThemeRule(e,t){const{unitId:n,subUnitId:o,range:r}=t,a=this._ensureRTreeCollection(n),l=Array.from(a.bulkSearch([{unitId:n,sheetId:o,range:r}]));if(l[0]){const u=this._ensureRangeThemeStyleRuleMap(n),d=u.get(l[0]);d&&d.themeName===e&&(u.delete(l[0]),a.remove({unitId:n,sheetId:o,range:r,id:l[0]}))}}registerDefaultRangeTheme(e){this._defaultRangeThemeMap.set(e.getName(),e)}getRegisteredRangeThemes(){return Array.from(this._defaultRangeThemeMap.keys())}registerRangeThemeStyle(e,t){this._ensureRangeThemeStyleMap(e).set(t.getName(),t)}unregisterRangeThemeStyle(e,t){this._ensureRangeThemeStyleMap(e).delete(t)}getALLRegisteredTheme(){return Array.from(this._rangeThemeStyleMap.keys())}getRangeThemeStyle(e,t){return this._defaultRangeThemeMap.has(t)?this._defaultRangeThemeMap.get(t):this._ensureRangeThemeStyleMap(e).get(t)}getCellStyle(e,t,n,o){const r={startRow:n,startColumn:o,endRow:n,endColumn:o},a=this._ensureRTreeCollection(e),l=Array.from(a.bulkSearch([{unitId:e,sheetId:t,range:r}]));if(l[0]){const d=this._ensureRangeThemeStyleRuleMap(e).get(l[0]);if(d){const{rangeInfo:c,themeName:m}=d,h=n-c.range.startRow,R=o-c.range.startColumn;return this.getRangeThemeStyle(e,m).getStyle(h,R,n===c.range.endRow,o===c.range.endColumn)}}}_registerIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(Ee.CELL_CONTENT,{id:Zs,effect:i.InterceptorEffectEnum.Style,handler:(e,t,n)=>{const{row:o,col:r,unitId:a,subUnitId:l}=t,u=this.getCellStyle(a,l,o,r);if(u){const d={...e};return d.themeStyle=u,n(d)}return n(e)}}))}toJson(e){const t=this._ensureRangeThemeStyleRuleMap(e),n=this._ensureRangeThemeStyleMap(e);if(n.size===0&&t.size===0)return"{}";const o={};t.forEach((a,l)=>{o[l]=a});const r={};return n.forEach((a,l)=>{r[l]=a.toJson()}),JSON.stringify({rangeThemeStyleRuleMap:o,rangeThemeStyleMapJson:r})}fromJSON(e){const{rangeThemeStyleRuleMap:t,rangeThemeStyleMapJson:n}=e;this._rangeThemeStyleMap.clear(),this._rangeThemeStyleRuleMap.clear(),this._rTreeCollection.clear(),!(!t||!n)&&(Object.keys(t).forEach(o=>{const r=t[o],{themeName:a,rangeInfo:l}=r;this.registerRangeThemeRule(a,l),this._ensureRTreeCollection(l.unitId).insert({unitId:o,sheetId:l.subUnitId,range:l.range,id:o})}),Object.keys(n).forEach(o=>{const r=n[o],a=new De(r.name);a.fromJson(r),this._ensureRangeThemeStyleMap(o).set(a.getName(),a)}))}deleteUnitId(e){this._rangeThemeStyleMap.delete(e),this._rangeThemeStyleRuleMap.delete(e),this._rTreeCollection.delete(e)}_initSnapshot(){this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e=>this.toJson(e),parseJson:e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}},businesses:[i.UniverInstanceType.UNIVER_SHEET],pluginName:Ai,onLoad:(e,t)=>{this.fromJSON(t)},onUnLoad:e=>{this.deleteUnitId(e)}}))}dispose(){super.dispose(),this._rangeThemeStyleMap.clear(),this._rangeThemeStyleRuleMap.clear(),this._defaultRangeThemeMap.clear(),this._rTreeCollection.clear()}};we=Di([no(0,i.Inject(g.SheetInterceptorService)),no(1,i.Inject(i.IResourceManagerService))],we);function so(s,e){const{unitId:t}=e,n=t?s.getUniverSheetInstance(t):s.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);return n?{workbook:n,unitId:n.getUnitId()}:null}function U(s,e={}){const{unitId:t,subUnitId:n}=e,o=t?s.getUniverSheetInstance(t):s.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!o)return null;const r=n?o.getSheetBySheetId(n):o.getActiveSheet(!0);return r?{worksheet:r,workbook:o,unitId:o.getUnitId(),subUnitId:r.getSheetId()}:null}function Ge(s,e){const{unitId:t,subUnitId:n}=e,o=s.getUniverSheetInstance(t);if(!o)return null;const r=o.getSheetBySheetId(n);return r?{worksheet:r,workbook:o}:null}const tt={id:"sheet.mutation.set-worksheet-range-theme-style",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,range:o,themeName:r}=e,a=s.get(i.IUniverInstanceService),l=U(a),u=s.get(we);return l?(u.registerRangeThemeRule(r,{range:o,unitId:t,subUnitId:n}),!0):!1}},oo=(s,e)=>{const t=Ge(s.get(i.IUniverInstanceService),e);if(!t)throw new Error("[SetWorksheetRangeThemeStyleMutation]: worksheet is null error!");const{worksheet:n}=t;return{unitId:e.unitId,subUnitId:n.getSheetId(),range:e.range,themeName:e.themeName}},nt={id:"sheet.mutation.remove-worksheet-range-theme-style",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,range:o,themeName:r}=e,a=s.get(i.IUniverInstanceService),l=U(a),u=s.get(we);return l?(u.removeRangeThemeRule(r,{range:o,unitId:t,subUnitId:n}),!0):!1}},ro=(s,e)=>{const t=Ge(s.get(i.IUniverInstanceService),e);if(!t)throw new Error("[DeleteWorksheetRangeThemeStyleMutationFactory]: worksheet is null error!");const{worksheet:n}=t;return{unitId:e.unitId,subUnitId:n.getSheetId(),range:e.range,themeName:e.themeName}},io={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-range-theme-style",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),{unitId:o}=e,r=oo(s,e);return t.syncExecuteCommand(tt.id,e)?(n.pushUndoRedo({unitID:o,undoMutations:[{id:nt.id,params:r}],redoMutations:[{id:tt.id,params:e}]}),!0):!1}},Wi=(s,e,t="")=>s.reduce((n,o)=>{const r=o&&o[e];return typeof r!="string"?(console.warn(o,`${e} is not string`),n):(r?(n[r]||(n[r]=[]),n[r].push(o)):n[t].push(o),n)},{}),Li=(s=0)=>{let e=s;return function(){return e++}};function kn(s){const e=new i.ObjectMatrix;return s.forEach(t=>{const{startRow:n,startColumn:o,endRow:r,endColumn:a}=t;for(let l=n;l<=r;l++)for(let u=o;u<=a;u++)e.setValue(l,u,null)}),e.clone()}function ao(s){const e=new i.ObjectMatrix;return s.forEach(t=>{const{startRow:n,startColumn:o,endRow:r,endColumn:a}=t;for(let l=n;l<=r;l++)for(let u=o;u<=a;u++)e.setValue(l,u,{v:null,p:null,f:null,si:null,custom:null})}),e.clone()}function Vi(s){const e=new i.ObjectMatrix;return s.forEach(t=>{const{startRow:n,startColumn:o,endRow:r,endColumn:a}=t;for(let l=n;l<=r;l++)for(let u=o;u<=a;u++)e.setValue(l,u,{s:null})}),e.clone()}var Q=(s=>(s[s.MOVE_START=0]="MOVE_START",s[s.MOVING=1]="MOVING",s[s.MOVE_END=2]="MOVE_END",s[s.ONLY_SET=3]="ONLY_SET",s))(Q||{});class lo extends i.Disposable{constructor(t){super();f(this,"_worksheetSelections",new Map);f(this,"_selectionMoveStart$",new A.Subject);f(this,"selectionMoveStart$",this._selectionMoveStart$.asObservable());f(this,"_selectionMoving$",new A.Subject);f(this,"selectionMoving$",this._selectionMoving$.asObservable());f(this,"_selectionMoveEnd$",new A.BehaviorSubject([]));f(this,"selectionMoveEnd$",this._selectionMoveEnd$.asObservable());f(this,"_selectionSet$",new A.BehaviorSubject([]));f(this,"selectionSet$",this._selectionSet$.asObservable());f(this,"selectionChanged$");f(this,"_beforeSelectionMoveEnd$",new A.BehaviorSubject([]));f(this,"beforeSelectionMoveEnd$",this._beforeSelectionMoveEnd$.asObservable());this._workbook=t,this.selectionChanged$=A.merge(this._selectionMoveEnd$,this._selectionSet$)}dispose(){super.dispose(),this._beforeSelectionMoveEnd$.complete(),this._selectionMoveEnd$.complete(),this._selectionMoving$.complete(),this._selectionMoveStart$.complete(),this._selectionSet$.complete()}addSelections(t,n){const o=this.getSelectionsOfWorksheet(t);o.push(...n),this._selectionSet$.next(o)}setSelections(t,n=[],o){switch(this.setSelectionsOfWorksheet(t,n),o){case Q.MOVE_START:this._selectionMoveStart$.next(n);break;case Q.MOVING:this._selectionMoving$.next(n);break;case Q.MOVE_END:this._beforeSelectionMoveEnd$.next(n),this._selectionMoveEnd$.next(n);break;case Q.ONLY_SET:{this._selectionSet$.next(n);break}default:this._selectionSet$.next(n);break}}getCurrentSelections(){return this._getCurrentSelections()}getSelectionOfWorksheet(t){return this.getSelectionsOfWorksheet(t)}getSelectionsOfWorksheet(t){return this._worksheetSelections.has(t)||this._worksheetSelections.set(t,[]),this._worksheetSelections.get(t)}setSelectionsOfWorksheet(t,n){this._worksheetSelections.set(t,[...n])}deleteSheetSelection(t){this._worksheetSelections.set(t,[])}clear(){this._worksheetSelections.clear(),this._selectionSet$.next([])}_getCurrentSelections(){return this.getSelectionsOfWorksheet(this._workbook.getActiveSheet().getSheetId())}getCurrentLastSelection(){const t=this._getCurrentSelections();return t[t.length-1]}}var $i=Object.getOwnPropertyDescriptor,Bi=(s,e,t,n)=>{for(var o=n>1?void 0:n?$i(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Hi=(s,e)=>(t,n)=>e(t,n,s);g.SheetsSelectionsService=class extends i.RxDisposable{constructor(t){super();f(this,"selectionMoveStart$");f(this,"selectionMoving$");f(this,"selectionMoveEnd$");f(this,"selectionSet$");f(this,"selectionChanged$");f(this,"_workbookSelections",new Map);this._instanceSrv=t,this._init()}get _currentSelectionPos(){const t=this._instanceSrv.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!t)return null;const n=t.getActiveSheet();return{unitId:t.getUnitId(),sheetId:n.getSheetId()}}get currentSelectionParam(){return this._currentSelectionPos}_init(){const t=this._instanceSrv.getCurrentTypeOfUnit$(i.UniverInstanceType.UNIVER_SHEET).pipe(A.shareReplay(1),A.takeUntil(this.dispose$));this.selectionMoveStart$=t.pipe(A.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionMoveStart$:A.of())),this.selectionMoving$=t.pipe(A.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionMoving$:A.of())),this.selectionMoveEnd$=t.pipe(A.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionMoveEnd$:A.of([]))),this.selectionSet$=t.pipe(A.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionSet$:A.of([]))),this.selectionChanged$=t.pipe(A.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionChanged$:A.of([]))).pipe(A.distinctUntilChanged((n,o)=>n.length!==o.length?!1:n.length===0&&o.length===0?!0:n.every((r,a)=>JSON.stringify(r)===JSON.stringify(o[a]))),A.skip(1)),this._instanceSrv.getTypeOfUnitDisposed$(i.UniverInstanceType.UNIVER_SHEET).pipe(A.takeUntil(this.dispose$)).subscribe(n=>{this._removeWorkbookSelection(n.getUnitId())})}clear(){this._workbookSelections.forEach(t=>t.clear())}getCurrentSelections(){return this._getCurrentSelections()}getCurrentLastSelection(){const t=this._getCurrentSelections();return t==null?void 0:t[t.length-1]}addSelections(t,n,o){if(typeof t=="string"){this._ensureWorkbookSelection(t).addSelections(n,o);return}const r=this._currentSelectionPos;if(!r)throw new Error("[SheetsSelectionsService]: cannot find current selection position!");const{unitId:a,sheetId:l}=r;this._ensureWorkbookSelection(a).addSelections(l,t)}setSelections(t,n,o,r){if(typeof t=="string"&&typeof n=="string"){const d=t;this._ensureWorkbookSelection(d).setSelections(n,o||[],r!=null?r:Q.ONLY_SET);return}const a=this._currentSelectionPos;if(!a)throw new Error("[SheetsSelectionsService]: cannot find current selection position!");const{unitId:l,sheetId:u}=a;if(typeof t=="object"){const d=t!=null?t:o,c=n!=null?n:Q.ONLY_SET;this._ensureWorkbookSelection(l).setSelections(u,d,c)}}clearCurrentSelections(){this._getCurrentSelections().splice(0)}isOverlapping(){const t=this.getCurrentSelections();return t==null?!1:t.some(({range:n},o)=>t.some(({range:r},a)=>o===a?!1:n.startRow<=r.endRow&&n.endRow>=r.startRow&&n.startColumn<=r.endColumn&&n.endColumn>=r.startColumn))}_getCurrentSelections(){const t=this._currentSelectionPos;if(!t)return[];const{unitId:n,sheetId:o}=t;return this._ensureWorkbookSelection(n).getSelectionsOfWorksheet(o)}getWorkbookSelections(t){return this._ensureWorkbookSelection(t)}_ensureWorkbookSelection(t){let n=this._workbookSelections.get(t);if(!n){const o=this._instanceSrv.getUnit(t);if(!o)throw new Error(`[SheetsSelectionsService]: cannot resolve unit with id "${t}"!`);n=new lo(o),this._workbookSelections.set(t,n)}return n}_removeWorkbookSelection(t){this._workbookSelections.delete(t)}},g.SheetsSelectionsService=Bi([Hi(0,i.IUniverInstanceService)],g.SheetsSelectionsService);const ji="DISABLE_NORMAL_SELECTIONS",Fi="SELECTIONS_ENABLED",uo="REF_SELECTIONS_ENABLED";function Gi(s,e,t){var a;const n=s.getStyleByCell(e);n==null&&delete e.s,typeof t.s=="string"&&(t.s=s.get(t.s));const o=qt(n,t.s?t.s:null);o&&(i.Tools.removeNull(o),Object.entries(o).forEach(([l,u])=>{typeof u=="object"&&u!==null&&Object.keys(u).length===0&&delete o[l]})),i.Tools.isEmptyObject(o)?delete e.s:e.s=s.setValue(o);const r=t.v?`${t.v}\r
|
|
11
|
-
`:"";!t.p&&e.p&&(r&&r!==((a=e.p.body)==null?void 0:a.dataStream)?delete e.p:
|
|
12
|
-
`)?s.body.dataStream.length-2:s.body.dataStream.length;if(t<r){const l={st:t,ed:r},u=qt({},e,!0);u&&i.Tools.removeNull(u),i.Tools.isEmptyObject(u)||(l.ts=u),n.push(l)}s.body.textRuns=i.normalizeTextRuns(n)}function Ki(s,e,t){var r,a,l;if(e.t)return e.t;if(e.v===null)return null;const n=s.getStyleByCell(e),o=s.getStyleByCell(t);if(t.t===i.CellValueType.FORCE_STRING){if(!Un.isTextFormat((r=o==null?void 0:o.n)==null?void 0:r.pattern)&&e.v!==void 0){if(i.isRealNum(e.v))return i.CellValueType.NUMBER;if(i.isBooleanString(`${e.v}`))return i.CellValueType.BOOLEAN}return i.CellValueType.FORCE_STRING}return Ji(n)?Un.isTextFormat((a=n==null?void 0:n.n)==null?void 0:a.pattern)?i.CellValueType.STRING:mo(e,t):Un.isTextFormat((l=o==null?void 0:o.n)==null?void 0:l.pattern)?i.CellValueType.STRING:mo(e,t)}function mo(s,e){return s.v!==void 0?Nn(s.v,s.t):Nn(e.v,e.t)}function Ji(s){var e;return!!((e=s==null?void 0:s.n)!=null&&e.pattern)}function Nn(s,e){return s===null?null:typeof s=="string"?i.isRealNum(s)?(+s==0||+s==1)&&e===i.CellValueType.BOOLEAN?i.CellValueType.BOOLEAN:i.CellValueType.NUMBER:i.isBooleanString(s)?i.CellValueType.BOOLEAN:i.CellValueType.STRING:typeof s=="number"?(s===0||s===1)&&e===i.CellValueType.BOOLEAN?i.CellValueType.BOOLEAN:i.CellValueType.NUMBER:typeof s=="boolean"?i.CellValueType.BOOLEAN:i.CellValueType.FORCE_STRING}function ho(s,e){return s===i.CellValueType.NUMBER?Number(e.v):s===i.CellValueType.BOOLEAN?xi(e.v)?1:0:s===i.CellValueType.STRING||s===i.CellValueType.FORCE_STRING?`${e.v}`:e.v}function xi(s){if(typeof s=="string"){if(s.toUpperCase()==="TRUE")return!0;if(s.toUpperCase()==="FALSE")return!1;if(i.isSafeNumeric(s)){if(Number(s)===0)return!1;if(Number(s)===1)return!0}}if(typeof s=="number"){if(s===0)return!1;if(s===1)return!0}return typeof s=="boolean"?s:null}function Xi(s){return s==null?null:(s.f===void 0&&(s.f=null),s.si===void 0&&(s.si=null),s.p===void 0&&(s.p=null),s.v===void 0&&(s.v=null),s.t===void 0&&(s.t=null),s.s===void 0&&(s.s=null),s.custom===void 0&&(s.custom=null),s)}const le=(s,e)=>{const{unitId:t,subUnitId:n,cellValue:o}=e,a=s.get(i.IUniverInstanceService).getUniverSheetInstance(t);if(a==null)throw new Error("workbook is null error!");const l=a.getSheetBySheetId(n);if(l==null)throw new Error("worksheet is null error!");const u=l.getCellMatrix(),d=a.getStyles(),c=new i.ObjectMatrix;return new i.ObjectMatrix(o).forValue((h,R,S)=>{const C=i.Tools.deepClone(u==null?void 0:u.getValue(h,R))||{},v=d.getStyleByCell(C),I=d.getStyleByCell(S);C.s=zi(v,I),c.setValue(h,R,Xi(C))}),{...e,options:{},cellValue:c.getMatrix()}},H={id:"sheet.mutation.set-range-values",type:i.CommandType.MUTATION,handler:(s,e)=>{const{cellValue:t,subUnitId:n,unitId:o}=e,a=s.get(i.IUniverInstanceService).getUnit(o);if(!a)return!1;const l=a.getSheetBySheetId(n);if(!l)return!1;const u=l.getCellMatrix(),d=a.getStyles();return new i.ObjectMatrix(t).forValue((m,h,R)=>{if(!R)u==null||u.setValue(m,h,{});else{const S=u.getValue(m,h)||{},C=Ki(d,R,S);R.f!==void 0&&(S.f=R.f),R.si!==void 0&&(S.si=R.si),R.p!==void 0&&(S.p=R.p),R.v!==void 0&&(S.v=ho(C,R)),S.v!==void 0&&(S.t=C,S.v=ho(C,S)),R.s!==void 0&&Gi(d,S,R),R.custom!==void 0&&(S.custom=R.custom),u.setValue(m,h,i.Tools.removeNull(S))}}),!0}},Kt={id:"sheet.command.clear-selection-all",type:i.CommandType.COMMAND,handler:(s,e)=>{var p;const t=s.get(i.IUniverInstanceService),n=s.get(i.ICommandService),o=s.get(g.SheetsSelectionsService),r=s.get(i.IUndoRedoService),a=s.get(g.SheetInterceptorService),l=t.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!l)return!1;const u=(e==null?void 0:e.unitId)||l.getUnitId(),d=l.getActiveSheet();if(!d)return!1;const c=(e==null?void 0:e.subUnitId)||d.getSheetId(),m=(e==null?void 0:e.ranges)||((p=o.getCurrentSelections())==null?void 0:p.map(w=>w.range));if(!(m!=null&&m.length))return!1;const h=[],R=[],S={subUnitId:c,unitId:u,cellValue:kn(m)},C=le(s,S);h.push({id:H.id,params:S}),R.push({id:H.id,params:C});const v=a.onCommandExecute({id:Kt.id});return h.push(...v.redos),R.unshift(...v.undos),i.sequenceExecute(h,n)?(r.pushUndoRedo({unitID:u,undoMutations:R,redoMutations:h}),!0):!1}},Jt={id:"sheet.command.clear-selection-content",type:i.CommandType.COMMAND,handler:(s,e)=>{var p;const t=s.get(i.IUniverInstanceService),n=s.get(i.ICommandService),o=s.get(g.SheetsSelectionsService),r=s.get(i.IUndoRedoService),a=s.get(g.SheetInterceptorService),l=t.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!l)return!1;const u=(e==null?void 0:e.unitId)||l.getUnitId(),d=l.getActiveSheet();if(!d)return!1;const c=(e==null?void 0:e.subUnitId)||d.getSheetId(),m=(e==null?void 0:e.ranges)||((p=o.getCurrentSelections())==null?void 0:p.map(w=>w.range));if(!(m!=null&&m.length))return!1;const h={subUnitId:c,unitId:u,cellValue:ao(m)},R=le(s,h),S=a.onCommandExecute({id:Jt.id}),C=[{id:H.id,params:h},...S.redos],v=[...S.undos,{id:H.id,params:R}];return i.sequenceExecute(C,n).result?(r.pushUndoRedo({unitID:u,undoMutations:v,redoMutations:C}),!0):!1}},xt={id:"sheet.command.clear-selection-format",type:i.CommandType.COMMAND,handler:(s,e)=>{var p;const t=s.get(i.IUniverInstanceService),n=s.get(i.ICommandService),o=s.get(g.SheetsSelectionsService),r=s.get(i.IUndoRedoService),a=s.get(g.SheetInterceptorService),l=t.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!l)return!1;const u=(e==null?void 0:e.unitId)||l.getUnitId(),d=l.getActiveSheet();if(!d)return!1;const c=(e==null?void 0:e.subUnitId)||d.getSheetId(),m=(e==null?void 0:e.ranges)||((p=o.getCurrentSelections())==null?void 0:p.map(w=>w.range));if(!(m!=null&&m.length))return!1;const h=[],R=[],S={subUnitId:c,unitId:u,cellValue:Vi(m)},C=le(s,S);h.push({id:H.id,params:S}),R.push({id:H.id,params:C});const v=a.onCommandExecute({id:xt.id});return h.push(...v.redos),R.unshift(...v.undos),i.sequenceExecute(h,n)?(r.pushUndoRedo({unitID:u,undoMutations:R,redoMutations:h}),!0):!1}},On=(s,e)=>({subUnitId:e.sheet.id,unitId:e.unitId,subUnitName:e.sheet.name}),st={id:"sheet.mutation.insert-sheet",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService),{sheet:n,index:o,unitId:r}=e,a=t.getUniverSheetInstance(r);return a?a.addWorksheet(n.id,o,n):!1}},go=(s,e)=>{const t=s.get(i.IUniverInstanceService),{subUnitId:n,unitId:o}=e,r=Ge(t,e);if(!r)throw new Error("[RemoveSheetUndoMutationFactory]: Worksheet is null error!");const{workbook:a,worksheet:l}=r,u=l.getConfig();return{index:a.getConfig().sheetOrder.findIndex(m=>m===n),sheet:u,unitId:o}},ze={id:"sheet.mutation.remove-sheet",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService),{subUnitId:n,unitId:o}=e,r=t.getUniverSheetInstance(o);return r?r.removeSheet(n):!1}},Dn={type:i.CommandType.COMMAND,id:"sheet.command.copy-sheet",handler:(s,e)=>{var M,y;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetInterceptorService),a=s.get(i.LocaleService),l=U(o,e);if(!l)return!1;const{workbook:u,worksheet:d,unitId:c,subUnitId:m}=l,h=i.Tools.deepClone(d.getConfig());h.name=Zi(u,a,h.name),h.id=i.Tools.generateRandomId();const S={index:u.getSheetIndex(d)+1,sheet:h,unitId:c},C=On(s,S),v=r.onCommandExecute({id:Dn.id,params:{unitId:c,subUnitId:m,targetSubUnitId:h.id}}),I=[...(M=v.preRedos)!=null?M:[],{id:st.id,params:S},...v.redos],p=[...(y=v.preUndos)!=null?y:[],{id:ze.id,params:C},...v.undos];return i.sequenceExecute(I,t).result?(n.pushUndoRedo({unitID:c,undoMutations:p,redoMutations:I}),!0):!1}};function Zi(s,e,t){let n=t+e.t("sheets.tabs.sheetCopy",""),o=2;for(;s.checkSheetName(n);)n=t+e.t("sheets.tabs.sheetCopy",`${o}`),o++;return n}const Ae={id:"sheet.mutation.move-range",type:i.CommandType.MUTATION,handler:(s,e)=>{const{from:t,to:n}=e;if(!t||!n)return!1;const r=s.get(i.IUniverInstanceService).getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const a=r.getSheetBySheetId(e.from.subUnitId),l=r.getSheetBySheetId(e.to.subUnitId);if(!a||!l)return!1;const u=a.getCellMatrix(),d=l.getCellMatrix();return new i.ObjectMatrix(t.value).forValue((c,m,h)=>{u.setValue(c,m,h)}),new i.ObjectMatrix(n.value).forValue((c,m,h)=>{d.setValue(c,m,h)}),!0}};var Qi=Object.getOwnPropertyDescriptor,ea=(s,e,t,n)=>{for(var o=n>1?void 0:n?Qi(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},ta=(s,e)=>(t,n)=>e(t,n,s);const Ro=i.createIdentifier("sheets-formula.ref-selections.service");g.RefSelectionsService=class extends g.SheetsSelectionsService{constructor(e){super(e)}_init(){const e=this._getAliveWorkbooks$().pipe(A.takeUntil(this.dispose$));this.selectionMoveStart$=e.pipe(A.switchMap(t=>A.merge(...t.map(n=>n.selectionMoveStart$)))),this.selectionMoving$=e.pipe(A.switchMap(t=>A.merge(...t.map(n=>n.selectionMoving$)))),this.selectionMoveEnd$=e.pipe(A.switchMap(t=>A.merge(...t.map(n=>n.selectionMoveEnd$)))),this.selectionSet$=e.pipe(A.switchMap(t=>A.merge(...t.map(n=>n.selectionSet$))))}_getAliveWorkbooks$(){const e=this._instanceSrv.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET);e.forEach(n=>this._ensureWorkbookSelection(n.getUnitId()));const t=new A.BehaviorSubject(e);return this.disposeWithMe(this._instanceSrv.getTypeOfUnitAdded$(i.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{this._ensureWorkbookSelection(n.getUnitId()),t.next([...t.getValue(),n])})),this.disposeWithMe(this._instanceSrv.getTypeOfUnitDisposed$(i.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{this._removeWorkbookSelection(n.getUnitId()),t.next(t.getValue().filter(o=>o!==n))})),t.pipe(A.map(n=>n.map(o=>this._ensureWorkbookSelection(o.getUnitId()))))}},g.RefSelectionsService=ea([ta(0,i.IUniverInstanceService)],g.RefSelectionsService);function So(s,e){const n=s.get(i.IContextService).getContextValue(uo);return s.get(n&&!e?Ro:g.SheetsSelectionsService)}const Y={id:"sheet.operation.set-selections",type:i.CommandType.OPERATION,handler:(s,e)=>{if(!e)return!1;const{selections:t,type:n,unitId:o,subUnitId:r}=e;return So(s).setSelections(o,r,[...t],n),!0}};function _t(s,e,t=!0){const n=e.getMatrixWithMergedCells(...i.selectionToArray(s)),o=[];if(n.forValue((a,l,u)=>{if(u.colSpan!==void 0&&u.rowSpan!==void 0){const d={startRow:a,startColumn:l,endRow:a+u.rowSpan-1,endColumn:l+u.colSpan-1};i.Rectangle.contains(s,d)||o.push(d)}}),o.length===0)return s;const r=i.Rectangle.union(s,...o);return t?_t(r,e,t):r}function na(s,e,t){let n=null;return t.getMatrixWithMergedCells(s,e,s,e).forValue((r,a,l)=>(n={actualRow:r,actualColumn:a,startRow:r,startColumn:a,isMerged:l.rowSpan!==void 0||l.colSpan!==void 0,isMergedMainCell:l.rowSpan!==void 0&&l.colSpan!==void 0,endRow:r+(l.rowSpan!==void 0?l.rowSpan-1:0),endColumn:a+(l.colSpan!==void 0?l.colSpan-1:0),rangeType:i.RANGE_TYPE.NORMAL},!1)),n||{actualColumn:e,actualRow:s,startRow:s,startColumn:e,endRow:s,endColumn:e,isMerged:!1,isMergedMainCell:!1,rangeType:i.RANGE_TYPE.NORMAL}}function sa(s,e,t){const{startRow:n,startColumn:o,endRow:r,endColumn:a}=s;return Number.isNaN(n)&&(s.startRow=0),Number.isNaN(r)&&(s.endRow=e-1),Number.isNaN(o)&&(s.startColumn=0),Number.isNaN(a)&&(s.endColumn=t-1),s}function te(s,e){const t=Number.isNaN(s.startRow)?0:s.startRow,n=Number.isNaN(s.startColumn)?0:s.startColumn,o=e.getMergedCell(t,n);return o?{...o,actualRow:t,actualColumn:n,rangeType:i.RANGE_TYPE.NORMAL,isMerged:!0,isMergedMainCell:!0}:{startRow:t,startColumn:n,endRow:s.startRow,endColumn:s.startColumn,actualRow:t,actualColumn:n,rangeType:i.RANGE_TYPE.NORMAL,isMerged:!1,isMergedMainCell:!1}}const Me=(s,e,t)=>({id:Y.id,params:{unitId:e.getUnitId(),subUnitId:t.getSheetId(),reveal:!0,selections:[{range:s,primary:te(s,t)}]}});function oa(s){if(!s)return!1;const{range:e,primary:t}=s;return i.Rectangle.equals(e,t)}function ra(s){function e(t,n){function o(r){for(let a=r.startRow;a<=r.endRow;a++)if(!s.getRowFiltered(a))for(let l=r.startColumn;l<=r.endColumn;l++)n(a,l,r)}o(t)}return{forOperableEach:e}}const Co=s=>s.id!==Zs;function bt(s,e,t,n,o,r,a){const l={};for(let u=e;u<=t;u++)for(let d=n;d<=o;d++){const c=r?s.getCellWithFilteredInterceptors(a,d,Qs,Co):s.getCellWithFilteredInterceptors(u,a,Qs,Co);!c||!c.s||(l[u]||(l[u]={}),l[u][d]={s:c.s})}return l}const fo="sheet.command.move-range",Ye={type:i.CommandType.COMMAND,id:fo,handler:async(s,e)=>{var w,M;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(i.ErrorService),a=s.get(i.LocaleService),l=s.get(g.SheetInterceptorService),u=U(o);if(!u||!await l.beforeCommandExecute({id:Ye.id,params:e}))return!1;const{worksheet:c,subUnitId:m,unitId:h}=u,R=Xt(s,{unitId:h,subUnitId:m,range:e.fromRange},{subUnitId:m,range:e.toRange});if(R===null)return r.emit(a.t("sheets.info.acrossMergedCell")),!1;const S=l.onCommandExecute({id:Ye.id,params:{...e}}),C=[...(w=S.preRedos)!=null?w:[],...R.redos,...S.redos,{id:Y.id,params:{unitId:h,subUnitId:m,selections:[{range:e.toRange,primary:ia(e.fromRange,e.toRange,c)}],type:Q.MOVE_END}}],v=[...(M=S.preUndos)!=null?M:[],...R.undos,...S.undos,{id:Y.id,params:{unitId:h,subUnitId:m,selections:[{range:e.fromRange,primary:te(e.fromRange,c)}],type:Q.MOVE_END}}],I=i.sequenceExecute(C,t).result,p=l.afterCommandExecute({id:Ye.id,params:{...e}});return I?(i.sequenceExecute(p.redos,t),n.pushUndoRedo({unitID:h,undoMutations:[...v,...p.undos],redoMutations:[...C,...p.redos]}),!0):!1}};function Xt(s,e,t,n=!1){const o=[],r=[],{range:a,subUnitId:l,unitId:u}=e,{range:d,subUnitId:c}=t,h=s.get(i.IUniverInstanceService).getUniverSheetInstance(u),R=h==null?void 0:h.getSheetBySheetId(c),S=h==null?void 0:h.getSheetBySheetId(l),C=R==null?void 0:R.getCellMatrix(),v=S==null?void 0:S.getCellMatrix();if(R&&S&&C&&v){const I=_t(d,R,!1);if(!i.Rectangle.equals(d,I)&&!n)return null;const p=new i.ObjectMatrix,w=new i.ObjectMatrix,M=new i.ObjectMatrix;i.Range.foreach(a,(T,P)=>{const N=v.getValue(T,P);if(p.setValue(T,P,i.Tools.deepClone(N)),N){const W=h==null?void 0:h.getStyles().get(N.s);M.setValue(T,P,i.Tools.deepClone(W))}w.setValue(T,P,null)});const y=new i.ObjectMatrix,b=new i.ObjectMatrix;i.Range.foreach(d,(T,P)=>{y.setValue(T,P,i.Tools.deepClone(C.getValue(T,P)))}),i.Range.foreach(a,(T,P)=>{const N=i.cellToRange(T,P),W=i.Rectangle.getRelativeRange(N,a),V=i.Rectangle.getPositionRange(W,d),$=i.Tools.deepClone(M.getValue(T,P)),j=i.Tools.deepClone(p.getValue(T,P));j&&$&&(j.s=$),b.setValue(V.startRow,V.startColumn,j)});const k={fromRange:e.range,toRange:t.range,from:{value:w.getMatrix(),subUnitId:l},to:{value:b.getMatrix(),subUnitId:c},unitId:u},E={fromRange:t.range,toRange:e.range,from:{value:p.getMatrix(),subUnitId:l},to:{value:y.getMatrix(),subUnitId:c},unitId:u};o.push({id:Ae.id,params:k}),r.push({id:Ae.id,params:E})}return{redos:o,undos:r}}function ia(s,e,t){const n=s.startRow,o=s.startColumn,r=t.getMergedCell(n,o),a=te(e,t);if(r){const l=r.endRow-r.startRow+1,u=r.endColumn-r.startColumn+1;a.endRow=a.startRow+l-1,a.endColumn=a.startColumn+u-1,a.actualRow=a.startRow,a.actualColumn=a.startColumn,a.isMerged=!1,a.isMergedMainCell=!0}return a}var Zt=(s=>(s[s.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",s[s.UNIVER_DOC=1]="UNIVER_DOC",s[s.UNIVER_SHEET=2]="UNIVER_SHEET",s[s.UNIVER_SLIDE=3]="UNIVER_SLIDE",s[s.UNIVER_PROJECT=4]="UNIVER_PROJECT",s[s.UNRECOGNIZED=-1]="UNRECOGNIZED",s))(Zt||{}),_=(s=>(s[s.View=0]="View",s[s.Edit=1]="Edit",s[s.ManageCollaborator=2]="ManageCollaborator",s[s.Print=3]="Print",s[s.Duplicate=4]="Duplicate",s[s.Comment=5]="Comment",s[s.Copy=6]="Copy",s[s.Share=7]="Share",s[s.Export=8]="Export",s[s.MoveWorksheet=9]="MoveWorksheet",s[s.DeleteWorksheet=10]="DeleteWorksheet",s[s.HideWorksheet=11]="HideWorksheet",s[s.RenameWorksheet=12]="RenameWorksheet",s[s.CreateWorksheet=13]="CreateWorksheet",s[s.SetWorksheetStyle=14]="SetWorksheetStyle",s[s.EditWorksheetCell=15]="EditWorksheetCell",s[s.InsertHyperlink=16]="InsertHyperlink",s[s.Sort=17]="Sort",s[s.Filter=18]="Filter",s[s.PivotTable=19]="PivotTable",s[s.FloatImg=20]="FloatImg",s[s.History=21]="History",s[s.RwHgtClWdt=22]="RwHgtClWdt",s[s.ViemRwHgtClWdt=23]="ViemRwHgtClWdt",s[s.ViewFilter=24]="ViewFilter",s[s.MoveSheet=25]="MoveSheet",s[s.DeleteSheet=26]="DeleteSheet",s[s.HideSheet=27]="HideSheet",s[s.CopySheet=28]="CopySheet",s[s.RenameSheet=29]="RenameSheet",s[s.CreateSheet=30]="CreateSheet",s[s.SelectProtectedCells=31]="SelectProtectedCells",s[s.SelectUnProtectedCells=32]="SelectUnProtectedCells",s[s.SetCellStyle=33]="SetCellStyle",s[s.SetCellValue=34]="SetCellValue",s[s.SetRowStyle=35]="SetRowStyle",s[s.SetColumnStyle=36]="SetColumnStyle",s[s.InsertRow=37]="InsertRow",s[s.InsertColumn=38]="InsertColumn",s[s.DeleteRow=39]="DeleteRow",s[s.DeleteColumn=40]="DeleteColumn",s[s.EditExtraObject=41]="EditExtraObject",s[s.Delete=42]="Delete",s[s.RecoverHistory=43]="RecoverHistory",s[s.ViewHistory=44]="ViewHistory",s[s.CreatePermissionObject=45]="CreatePermissionObject",s[s.UNRECOGNIZED=-1]="UNRECOGNIZED",s))(_||{}),O=(s=>(s[s.Unkonwn=0]="Unkonwn",s[s.Workbook=1]="Workbook",s[s.Worksheet=2]="Worksheet",s[s.SelectRange=3]="SelectRange",s[s.Document=4]="Document",s[s.Slide=5]="Slide",s[s.UNRECOGNIZED=-1]="UNRECOGNIZED",s))(O||{});class ue{constructor(e,t,n){f(this,"type",O.SelectRange);f(this,"subType",_.Edit);f(this,"status",i.PermissionStatus.INIT);f(this,"value",!0);f(this,"id");f(this,"unitId");f(this,"subUnitId");f(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${O.SelectRange}.${_.Edit}.${n}`}}class Qt{constructor(e,t,n){f(this,"type",O.SelectRange);f(this,"subType",_.View);f(this,"status",i.PermissionStatus.INIT);f(this,"value",!0);f(this,"id");f(this,"unitId");f(this,"subUnitId");f(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${O.SelectRange}.${_.View}.${n}`}}class An{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Comment);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Comment}_${e}`}}class Wn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Copy);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Copy}_${e}`}}class vo{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"subType",_.CopySheet);f(this,"status",i.PermissionStatus.INIT);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.CopySheet}_${e}`}}class Ln{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.CreatePermissionObject);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.CreatePermissionObject}_${e}`}}class Vn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.CreateSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.CreateSheet}_${e}`}}class $n{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.DeleteSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.DeleteSheet}_${e}`}}class Bn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Duplicate);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Duplicate}_${e}`}}class re{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Edit);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Edit}_${e}`}}class Hn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Export);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Export}_${e}`}}class en{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.HideSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.HideSheet}_${e}`}}class Io{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.History);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.History}_${e}`}}class tn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.ManageCollaborator);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.ManageCollaborator}_${e}`}}class nn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.MoveSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.MoveSheet}_${e}`}}class jn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Print);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Print}_${e}`}}class Fn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.RecoverHistory);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.RecoverHistory}_${e}`}}class sn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.RenameSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.RenameSheet}_${e}`}}class Gn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Share);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Share}_${e}`}}class zn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.View);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.View}_${e}`}}class Yn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.ViewHistory);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.ViewHistory}_${e}`}}class qn{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.Copy);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.Copy}_${e}_${t}`}}class Kn{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.DeleteColumn);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.DeleteColumn}_${e}_${t}`}}class Jn{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.Delete);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.Delete}_${e}_${t}`}}class xn{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.DeleteRow);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.DeleteRow}_${e}_${t}`}}class de{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.Edit);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.Edit}_${e}_${t}`}}class Xn{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.EditExtraObject);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.EditExtraObject}_${e}_${t}`}}class Zn{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.Filter);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.Filter}_${e}_${t}`}}class Qn{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.InsertColumn);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.InsertColumn}_${e}_${t}`}}class es{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.InsertHyperlink);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.InsertHyperlink}_${e}_${t}`}}class ts{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.InsertRow);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.InsertRow}_${e}_${t}`}}class ns{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.ManageCollaborator);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.ManageCollaborator}_${e}_${t}`}}class ss{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.PivotTable);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.PivotTable}_${e}_${t}`}}class aa{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SelectProtectedCells);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SelectProtectedCells}_${e}_${t}`}}class la{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SelectUnProtectedCells);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SelectUnProtectedCells}_${e}_${t}`}}class os{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SetCellStyle);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SetCellStyle}_${e}_${t}`}}class Tt{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SetCellValue);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SetCellValue}_${e}_${t}`}}class ot{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SetColumnStyle);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SetColumnStyle}_${e}_${t}`}}class rt{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SetRowStyle);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SetRowStyle}_${e}_${t}`}}class rs{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.Sort);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.Sort}_${e}_${t}`}}class Et{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.View);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.View}_${e}_${t}`}}const it={id:"sheet.command.set-range-values",type:i.CommandType.COMMAND,handler:(s,e)=>{var E;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetsSelectionsService),a=s.get(g.SheetInterceptorService),l=s.get(i.IPermissionService),u=U(o,e);if(!u)return!1;const{subUnitId:d,unitId:c,workbook:m,worksheet:h}=u,{value:R,range:S}=e,C=S?[S]:(E=r.getCurrentSelections())==null?void 0:E.map(T=>T.range);if(!C||!C.length||!l.getPermissionPoint(new de(c,d).id))return!1;const v=new i.ObjectMatrix;let I;if(i.Tools.isArray(R))for(let T=0;T<C.length;T++){const{startRow:P,startColumn:N,endRow:W,endColumn:V}=C[T];for(let $=0;$<=W-P;$++)for(let j=0;j<=V-N;j++)v.setValue($+P,j+N,R[$][j])}else if(i.isICellData(R))for(let T=0;T<C.length;T++){const{startRow:P,startColumn:N,endRow:W,endColumn:V}=C[T];for(let $=P;$<=W;$++)for(let j=N;j<=V;j++)v.setValue($,j,R)}else I=R;const p={subUnitId:d,unitId:c,cellValue:I!=null?I:v.getMatrix()},w=le(s,p);if(!t.syncExecuteCommand(H.id,p))return!1;const{undos:y,redos:b}=a.onCommandExecute({id:it.id,params:{...p,range:C}});if(i.sequenceExecute([...b],t).result){const T=Me(S!=null?S:v.getRange(),m,h);return n.pushUndoRedo({unitID:c,undoMutations:[{id:H.id,params:w},...y,T],redoMutations:[{id:H.id,params:p},...b,i.Tools.deepClone(T)]}),!0}return!1}};function is(s,e){const t=[],n=[],{unitId:o,subUnitId:r,range:a,shiftDimension:l,cellValue:u={}}=e,d=s.get(i.IUniverInstanceService),c=s.get(g.SheetInterceptorService),m=d.getUniverSheetInstance(o),h=m==null?void 0:m.getSheetBySheetId(r);if(h){const R=h.getCellMatrix(),S=R.getDataRange();if(a.startColumn<=S.endColumn||a.startRow<=S.endRow){let w,M;if(l===i.Dimension.COLUMNS){const b=Math.min(a.endRow,S.endRow);let k=0;for(let T=a.startRow;T<=b;T++){const P=R.getRow(T),N=P?i.getArrayLength(P)-1:0;k=Math.max(k,N)}w={startRow:a.startRow,startColumn:a.startColumn,endRow:b,endColumn:k};const E=a.endColumn-a.startColumn+1;M={startRow:a.startRow,startColumn:w.startColumn+E,endRow:b,endColumn:w.endColumn+E}}else{const b=Math.min(a.endColumn,S.endColumn),k=S.endRow;w={startRow:a.startRow,startColumn:a.startColumn,endRow:k,endColumn:b};const E=a.endRow-a.startRow+1;M={startRow:w.startRow+E,startColumn:a.startColumn,endRow:w.endRow+E,endColumn:b}}const y=Xt(s,{unitId:o,subUnitId:r,range:w},{subUnitId:r,range:M},!0);y&&(t.push(...y.redos),n.push(...y.undos))}if(Object.entries(u).length===0)for(let w=a.startRow;w<=a.endRow;w++){u[w]||(u[w]={});for(let M=a.startColumn;M<=a.endColumn;M++)u[w][M]=null}const C={subUnitId:r,unitId:o,cellValue:u},v=le(s,C),{undos:I,redos:p}=c.onCommandExecute({id:it.id,params:{...C,range:a}});t.push({id:H.id,params:C},...p),n.push({id:H.id,params:v},...I)}return{redo:t,undo:n}}function as(s,e){const t=[],n=[],{unitId:o,subUnitId:r,range:a,shiftDimension:l}=e,u=s.get(i.IUniverInstanceService),d=s.get(g.SheetInterceptorService),c=u.getUniverSheetInstance(o),m=c==null?void 0:c.getSheetBySheetId(r);if(m){const h=m.getCellMatrix(),R=h.getDataRange(),S={subUnitId:r,unitId:o,cellValue:kn([a])},C=le(s,S),v=d.onCommandExecute({id:it.id,params:S});if(t.push({id:H.id,params:S},...v.redos),n.push(...v.undos,{id:H.id,params:C}),a.startColumn<=R.endColumn||a.startRow<=R.endRow){let I=null,p=null;if(l===i.Dimension.COLUMNS&&a.endColumn<R.endColumn){const w=Math.min(a.endRow,R.endRow);let M=0;for(let b=a.startRow;b<=w;b++){const k=h.getRow(b),E=k?i.getArrayLength(k)-1:0;M=Math.max(M,E)}I={startRow:a.startRow,startColumn:a.endColumn+1,endRow:w,endColumn:M};const y=a.endColumn-a.startColumn+1;p={startRow:a.startRow,startColumn:I.startColumn-y,endRow:w,endColumn:I.endColumn-y}}if(l===i.Dimension.ROWS&&a.endRow<R.endRow){const w=Math.min(a.endColumn,R.endColumn),M=R.endRow;I={startRow:a.endRow+1,startColumn:a.startColumn,endRow:M,endColumn:w};const y=a.endRow-a.startRow+1;p={startRow:I.startRow-y,startColumn:a.startColumn,endRow:I.endRow-y,endColumn:w}}if(I&&p){const w=Xt(s,{unitId:o,subUnitId:r,range:I},{subUnitId:r,range:p},!0);w&&(t.push(...w.redos),n.push(...w.undos))}}}return{redo:t,undo:n}}function ua(s,e,t,n,o,r){const{startRow:a,endRow:l,startColumn:u,endColumn:d}=e;if(o===i.Dimension.ROWS){const c=l-a+1;for(let m=t;m>=a;m--)for(let h=u;h<=d;h++){const R=s.getValue(m,h);R==null?s.realDeleteValue(m+c,h):s.setValue(m+c,h,R)}for(let m=l;m>=a;m--)for(let h=u;h<=d;h++)r&&r[m]&&r[m][h]?s.setValue(m,h,r[m][h]):s.realDeleteValue(m,h)}else if(o===i.Dimension.COLUMNS){const c=d-u+1;for(let m=a;m<=l;m++)for(let h=n;h>=u;h--){const R=s.getValue(m,h);R==null?s.realDeleteValue(m,h+c):s.setValue(m,h+c,R)}for(let m=a;m<=l;m++)for(let h=d;h>=u;h--)r&&r[m]&&r[m][h]?s.setValue(m,h,r[m][h]):s.realDeleteValue(m,h)}}function da(s,e,t,n,o){const{startRow:r,endRow:a,startColumn:l,endColumn:u}=e,d=a-r+1,c=u-l+1;if(o===i.Dimension.ROWS)for(let m=r;m<=t;m++)for(let h=l;h<=u;h++){const R=s.getValue(m+d,h);R==null?s.realDeleteValue(m,h):s.setValue(m,h,R)}else if(o===i.Dimension.COLUMNS)for(let m=r;m<=a;m++)for(let h=l;h<=n;h++){const R=s.getValue(m,h+c);R==null?s.realDeleteValue(m,h):s.setValue(m,h,R)}}const po="sheet.command.delete-range-move-left",qe={type:i.CommandType.COMMAND,id:po,handler:async(s,e)=>{var M,y,b;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetsSelectionsService),a=s.get(g.SheetInterceptorService),l=U(o);if(!l)return!1;const{worksheet:u,workbook:d,subUnitId:c,unitId:m}=l;let h=e==null?void 0:e.range;if(h||(h=(M=r.getCurrentLastSelection())==null?void 0:M.range),!h)return!1;const R={range:h,subUnitId:c,unitId:m,shiftDimension:i.Dimension.COLUMNS},S=a.onCommandExecute({id:qe.id,params:{range:h}}),{redo:C,undo:v}=as(s,R),I=[...(y=S.preRedos)!=null?y:[],...C],p=[...S.undos,...v];return I.push(...S.redos),I.push(Me(h,d,u)),p.push(...(b=S.preUndos)!=null?b:[]),i.sequenceExecute(I,t).result?(n.pushUndoRedo({unitID:m,undoMutations:p.reverse(),redoMutations:I}),!0):!1}},wo="sheet.command.delete-range-move-up",Ke={type:i.CommandType.COMMAND,id:wo,handler:async(s,e)=>{var M,y,b;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetsSelectionsService),a=s.get(g.SheetInterceptorService),l=U(o);if(!l)return!1;const{unitId:u,subUnitId:d,workbook:c,worksheet:m}=l;let h=e==null?void 0:e.range;if(h||(h=(M=r.getCurrentLastSelection())==null?void 0:M.range),!h)return!1;const R={range:h,subUnitId:d,unitId:u,shiftDimension:i.Dimension.ROWS},S=a.onCommandExecute({id:Ke.id,params:{range:h}}),{redo:C,undo:v}=as(s,R),I=[...(y=S.preRedos)!=null?y:[],...C],p=[...S.undos,...v];return I.push(...S.redos),I.push(Me(h,c,m)),p.push(...(b=S.preUndos)!=null?b:[]),i.sequenceExecute(I,t).result?(n.pushUndoRedo({unitID:u,undoMutations:p.reverse(),redoMutations:I}),!0):!1}},Mo={type:i.CommandType.COMMAND,id:"sheet.command.delete-range-protection",async handler(s,e){if(!e)return!1;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),{unitId:o,subUnitId:r,rule:a}=e,l={unitId:o,subUnitId:r,ruleIds:[a.id]};return await t.executeCommand(Ie.id,l)&&n.pushUndoRedo({unitID:o,redoMutations:[{id:Ie.id,params:l}],undoMutations:[{id:ae.id,params:{unitId:o,subUnitId:r,rules:[a]}}]}),!0}},yo={type:i.CommandType.COMMAND,id:"sheet.command.delete-worksheet-protection",handler(s,e){if(!e)return!1;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),{rule:o,unitId:r,subUnitId:a}=e;t.executeCommand(Fe.id,{unitId:r,subUnitId:a});const l=[{id:Fe.id,params:{unitId:r,subUnitId:a}}],u=[{id:Oe.id,params:{unitId:r,rule:o,subUnitId:a}}];return n.pushUndoRedo({unitID:r,redoMutations:l,undoMutations:u}),!0}},_o={type:i.CommandType.COMMAND,id:"sheet.command.remove-worksheet-range-theme-style",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),{unitId:o}=e,r=ro(s,e);return t.syncExecuteCommand(nt.id,e)?(n.pushUndoRedo({unitID:o,undoMutations:[{id:tt.id,params:r}],redoMutations:[{id:nt.id,params:e}]}),!0):!1}},bo={id:"sheet.command.insert-defined-name",type:i.CommandType.COMMAND,handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService);if(!e)return!1;const o={...e};return t.syncExecuteCommand(z.SetDefinedNameMutation.id,o)?(n.pushUndoRedo({unitID:e.unitId,undoMutations:[{id:z.RemoveDefinedNameMutation.id,params:o}],redoMutations:[{id:z.SetDefinedNameMutation.id,params:o}]}),!0):!1}},ls=(s,e)=>{if(s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range}},ye={id:"sheet.mutation.insert-row",type:i.CommandType.MUTATION,handler:(s,e)=>{var S;const{unitId:t,subUnitId:n,range:o,rowInfo:r}=e,l=s.get(i.IUniverInstanceService).getUniverSheetInstance(t);if(l==null)throw new Error("universheet is null error!");const u=l.getSheetBySheetId(n);if(u==null)throw new Error("worksheet is null error!");const d=u.getRowManager().getRowData(),c={h:u.getConfig().defaultRowHeight,hd:0},m=o.startRow,h=o.endRow-o.startRow+1;for(let C=m;C<m+h;C++)r?i.insertMatrixArray(C,(S=r[C-o.startRow])!=null?S:c,d):i.insertMatrixArray(C,c,d);return u.setRowCount(u.getRowCount()+o.endRow-o.startRow+1),u.getCellMatrix().insertRows(o.startRow,h),!0}},on=(s,e)=>{if(s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range}},Re={id:"sheet.mutation.insert-col",type:i.CommandType.MUTATION,handler:(s,e)=>{var S;const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(!o)return!1;const r=o.getColumnManager(),{range:a,colInfo:l}=e,d=r.getColumnData(),c=a.startColumn,m=a.endColumn-a.startColumn+1,h=o.getConfig().defaultColumnWidth;for(let C=c;C<c+m;C++){const v={w:h,hd:0};l?i.insertMatrixArray(C,(S=l[C-a.startColumn])!=null?S:v,d):i.insertMatrixArray(C,v,d)}return o.setColumnCount(o.getColumnCount()+a.endColumn-a.startColumn+1),o.getCellMatrix().insertColumns(a.startColumn,m),!0}},ca=(s,e)=>{const o=e.getRowManager().getRowData(),r={},a=s.range,l=i.sliceMatrixArray(a.startRow,a.endRow,o),u=i.concatMatrixArray(r,l);return{unitId:s.unitId,subUnitId:s.subUnitId,range:s.range,rowInfo:u}},Se={id:"sheet.mutation.remove-rows",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(!o)return!1;const r=e.range,l=o.getRowManager().getRowData();for(let c=r.startRow;c<=r.endRow;c++)o.getRowFiltered(c);const u=r.endRow-r.startRow+1;return i.spliceArray(r.startRow,u,l),o.getCellMatrix().removeRows(r.startRow,u),o.setRowCount(o.getRowCount()-u),!0}},ma=(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(o==null)throw new Error("worksheet is null error!");const l=o.getColumnManager().getColumnData(),u={},d=e.range,c=i.sliceMatrixArray(d.startColumn,d.endColumn,l),m=i.concatMatrixArray(u,c);return{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,colInfo:m}},ce={id:"sheet.mutation.remove-col",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(!o)return!1;const r=e.range,l=o.getColumnManager().getColumnData(),u=r.endColumn-r.startColumn+1;return i.spliceArray(r.startColumn,u,l),o.setColumnCount(o.getColumnCount()-u),o.getCellMatrix().removeColumns(r.startColumn,u),!0}},ha="sheet.command.insert-range-move-down",at={type:i.CommandType.COMMAND,id:"sheet.command.insert-range-move-down",handler:async(s,e)=>{var W,V,$;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetsSelectionsService),a=s.get(g.SheetInterceptorService),l=s.get(i.ErrorService),u=s.get(i.LocaleService);if(r.isOverlapping())return l.emit(u.t("sheets.info.overlappingSelections")),!1;const d=U(o);if(!d)return!1;const{unitId:c,subUnitId:m,worksheet:h,workbook:R}=d;let S=e==null?void 0:e.range;if(S||(S=(W=r.getCurrentLastSelection())==null?void 0:W.range),!S)return!1;const C=[],v=[],I=h.getCellMatrix(),p=I.getDataRange(),M=I.getSlice(p.startRow,p.endRow,S.startColumn,S.endColumn).getDataRange().endRow,y=Math.max(M+(S.endRow-S.startRow+1)-p.endRow,0);if(y>0){const j=S.startRow-1,ee=h.getRowHeight(j),q={unitId:c,subUnitId:m,range:{startRow:p.endRow+1,endRow:p.endRow+y,startColumn:p.startColumn,endColumn:p.endColumn},rowInfo:new Array(y).fill(void 0).map(()=>({h:ee,hd:i.BooleanNumber.FALSE}))};C.push({id:ye.id,params:q});const Te=ls(s,q);v.push({id:Se.id,params:Te})}const b={};i.Range.foreach(S,(j,ee)=>{const q=h.getCell(j,ee);q&&(b[j]||(b[j]={}),b[j][ee]={s:q.s})});const k={range:S,subUnitId:m,unitId:c,shiftDimension:i.Dimension.ROWS,cellValue:b},{redo:E,undo:T}=is(s,k);C.push(...E),v.push(...T);const P=a.onCommandExecute({id:at.id,params:{range:S}});return C.push(...P.redos),C.push(Me(S,R,h)),v.push(...(V=P.preUndos)!=null?V:[]),C.unshift(...($=P.preRedos)!=null?$:[]),v.unshift(...P.undos),i.sequenceExecute(C,t)?(n.pushUndoRedo({unitID:c,undoMutations:v.reverse(),redoMutations:C}),!0):!1}},us="sheet.command.insert-range-move-right",Ut={type:i.CommandType.COMMAND,id:us,handler:async(s,e)=>{var W,V,$;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetsSelectionsService),a=s.get(g.SheetInterceptorService),l=s.get(i.ErrorService),u=s.get(i.LocaleService);if(r.isOverlapping())return l.emit(u.t("sheets.info.overlappingSelections")),!1;const d=U(o);if(!d)return!1;const{workbook:c,worksheet:m,unitId:h,subUnitId:R}=d;let S=e==null?void 0:e.range;if(S||(S=(W=r.getCurrentLastSelection())==null?void 0:W.range),!S)return!1;const C=[],v=[],I=m.getCellMatrix(),p=I.getDataRange(),M=I.getSlice(S.startRow,S.endRow,p.startColumn,p.endColumn).getDataRange().endColumn,y=Math.max(M+(S.endColumn-S.startColumn+1)-p.endColumn,0);if(y>0){const j=S.startColumn-1,ee=m.getColumnWidth(j),q={unitId:h,subUnitId:R,range:{startRow:p.startRow+1,endRow:p.endRow,startColumn:p.endColumn+1,endColumn:p.endColumn+y},colInfo:new Array(y).fill(void 0).map(()=>({w:ee,hd:i.BooleanNumber.FALSE}))};C.push({id:Re.id,params:q});const Te=on(s,q);v.push({id:ce.id,params:Te})}const b={};i.Range.foreach(S,(j,ee)=>{const q=m.getCell(j,ee);!q||!q.s||(b[j]||(b[j]={}),b[j][ee]={s:q.s})});const k={range:S,subUnitId:R,unitId:h,shiftDimension:i.Dimension.COLUMNS,cellValue:b},{redo:E,undo:T}=is(s,k);C.push(...E),v.push(...T);const P=a.onCommandExecute({id:Ut.id,params:{range:S}});return C.push(...P.redos),C.push(Me(S,c,m)),v.push(...(V=P.preUndos)!=null?V:[]),C.unshift(...($=P.preRedos)!=null?$:[]),v.unshift(...P.undos),i.sequenceExecute(C,t).result?(n.pushUndoRedo({unitID:h,undoMutations:v.reverse(),redoMutations:C}),!0):!1}},To="sheet.command.insert-row",We={type:i.CommandType.COMMAND,id:To,handler:async(s,e)=>{const t=s.get(i.ICommandService),n=s.get(g.SheetInterceptorService),{range:o,direction:r,unitId:a,subUnitId:l,cellValue:u}=e;return await n.beforeCommandExecute({id:We.id,params:e})?t.syncExecuteCommand(ds.id,{range:o,direction:r,unitId:a,subUnitId:l,cellValue:u}):!1}},ds={type:i.CommandType.COMMAND,id:"sheet.command.insert-row-by-range",handler:(s,e)=>{var E,T,P,N;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetInterceptorService),a=U(o,e);if(!a)return!1;const{workbook:l,worksheet:u}=a,{range:d,direction:c,unitId:m,subUnitId:h,cellValue:R}=e,{startRow:S,endRow:C}=d;d.rangeType=i.RANGE_TYPE.ROW;const v=c===i.Direction.UP?S:S-1,I=u.getRowHeight(v),p={unitId:m,subUnitId:h,range:d,rowInfo:new Array(C-S+1).fill(void 0).map(()=>({h:I,hd:i.BooleanNumber.FALSE}))},w=ls(s,p),M=[{id:ye.id,params:p}],y=[{id:Se.id,params:w}];R&&M.push({id:H.id,params:{unitId:m,subUnitId:h,cellValue:R}});const b=r.onCommandExecute({id:We.id,params:e});return M.unshift(...(E=b.preRedos)!=null?E:[]),M.push(...(T=b.redos)!=null?T:[]),M.push(Me(d,l,u)),y.unshift(...(P=b.preUndos)!=null?P:[]),y.push(...(N=b.undos)!=null?N:[]),i.sequenceExecute(M,t).result?(n.pushUndoRedo({unitID:e.unitId,undoMutations:y,redoMutations:M}),!0):!1}},Eo={type:i.CommandType.COMMAND,id:"sheet.command.insert-row-before",handler:async s=>{var S;const t=(S=s.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:S.map(C=>C.range);let n;if((t==null?void 0:t.length)===1)n=t[0];else return!1;const o=s.get(i.IUniverInstanceService),r=U(o);if(!r)return!1;const{worksheet:a,subUnitId:l,unitId:u}=r,{startRow:d,endRow:c}=n,m=0,h=a.getColumnCount()-1,R={unitId:u,subUnitId:l,direction:i.Direction.UP,range:{startRow:d,endRow:c,startColumn:m,endColumn:h},cellValue:bt(a,d,c,m,h,!0,d-1)};return s.get(i.ICommandService).executeCommand(We.id,R)}},Uo={type:i.CommandType.COMMAND,id:"sheet.command.insert-row-after",handler:async s=>{var C;const t=(C=s.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:C.map(v=>v.range);let n;if((t==null?void 0:t.length)===1)n=t[0];else return!1;const o=s.get(i.IUniverInstanceService),r=U(o);if(!r)return!1;const{worksheet:a,unitId:l,subUnitId:u}=r,d=n.endRow-n.startRow+1,c=n.endRow+1,m=n.endRow+d,h=0,R=a.getColumnCount()-1,S={unitId:l,subUnitId:u,direction:i.Direction.DOWN,range:{startRow:c,endRow:m,startColumn:h,endColumn:R,rangeType:i.RANGE_TYPE.ROW},cellValue:bt(a,c,m,h,R,!0,n.endRow)};return s.get(i.ICommandService).executeCommand(We.id,S)}},Po="sheet.command.insert-col",Le={type:i.CommandType.COMMAND,id:Po,handler:async(s,e)=>{const t=s.get(i.ICommandService),n=s.get(g.SheetInterceptorService),{range:o,direction:r,subUnitId:a,unitId:l,cellValue:u}=e;return await n.beforeCommandExecute({id:Le.id,params:e})?t.syncExecuteCommand(cs.id,{range:o,direction:r,unitId:l,subUnitId:a,cellValue:u}):!1}},cs={type:i.CommandType.COMMAND,id:"sheet.command.insert-col-by-range",handler:(s,e)=>{var k,E,T,P;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetInterceptorService),{range:a,direction:l,subUnitId:u,unitId:d,cellValue:c}=e,{startColumn:m,endColumn:h}=e.range;a.rangeType=i.RANGE_TYPE.COLUMN;const R=o.getUniverSheetInstance(e.unitId),S=R.getSheetBySheetId(e.subUnitId),C=l===i.Direction.LEFT?m:m-1,v=S.getColumnWidth(C),I={unitId:d,subUnitId:u,range:a,colInfo:new Array(h-m+1).fill(void 0).map(()=>({w:v,hd:i.BooleanNumber.FALSE}))},p=on(s,I),w=[{id:Re.id,params:I}],M=[{id:ce.id,params:p}];c&&w.push({id:H.id,params:{unitId:d,subUnitId:u,cellValue:c}});const y=r.onCommandExecute({id:Le.id,params:e});return w.unshift(...(k=y.preRedos)!=null?k:[]),w.push(...(E=y.redos)!=null?E:[]),w.push(Me(a,R,S)),M.unshift(...(T=y.preUndos)!=null?T:[]),M.push(...(P=y.undos)!=null?P:[]),i.sequenceExecute(w,t).result?(n.pushUndoRedo({unitID:e.unitId,undoMutations:M.filter(Boolean),redoMutations:w.filter(Boolean)}),!0):!1}},ko={type:i.CommandType.COMMAND,id:"sheet.command.insert-col-before",handler:async s=>{const t=s.get(g.SheetsSelectionsService).getCurrentSelections();let n;if((t==null?void 0:t.length)===1)n=t[0].range;else return!1;const o=s.get(i.IUniverInstanceService),r=U(o);if(!r)return!1;const{worksheet:a,unitId:l,subUnitId:u}=r,{startColumn:d,endColumn:c}=n,m=0,h=a.getRowCount()-1,R={unitId:l,subUnitId:u,direction:i.Direction.LEFT,range:{startColumn:d,endColumn:c,startRow:m,endRow:h,rangeType:i.RANGE_TYPE.COLUMN},cellValue:bt(a,m,h,d,c,!1,d-1)};return s.get(i.ICommandService).executeCommand(Le.id,R)}},No={type:i.CommandType.COMMAND,id:"sheet.command.insert-col-after",handler:async s=>{const t=s.get(g.SheetsSelectionsService).getCurrentSelections();let n;if((t==null?void 0:t.length)===1)n=t[0].range;else return!1;const o=s.get(i.IUniverInstanceService),r=U(o);if(!r)return!1;const{worksheet:a,unitId:l,subUnitId:u}=r,d=n.endColumn-n.startColumn+1,c=n.endColumn+1,m=n.endColumn+d,h=0,R=a.getRowCount()-1,S={unitId:l,subUnitId:u,direction:i.Direction.RIGHT,range:{startColumn:c,endColumn:m,startRow:h,endRow:R},cellValue:bt(a,h,R,c,m,!1,n.endColumn)};return s.get(i.ICommandService).executeCommand(Le.id,S)}},Oo={id:"sheet.command.insert-sheet",type:i.CommandType.COMMAND,handler:(s,e)=>{var v;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(i.LocaleService),a=so(o,{unitId:e==null?void 0:e.unitId});if(!a)return!1;const{unitId:l,workbook:u}=a;let d=u.getSheets().length;const c=e==null?void 0:e.sheet,m=c==null?void 0:c.id,h=i.mergeWorksheetSnapshotWithDefault(c||{});e?(d=(v=e.index)!=null?v:d,h.id=m||i.Tools.generateRandomId(),h.name=(c==null?void 0:c.name)||u.generateNewSheetName(`${r.t("sheets.tabs.sheet")}`)):(h.id=i.Tools.generateRandomId(),h.name=u.generateNewSheetName(`${r.t("sheets.tabs.sheet")}`));const R={index:d,sheet:h,unitId:l},S=On(s,R);return t.syncExecuteCommand(st.id,R)?(n.pushUndoRedo({unitID:l,undoMutations:[{id:ze.id,params:S}],redoMutations:[{id:st.id,params:R}]}),!0):!1}};function Do(s,e){const{unitId:t,subUnitId:n,sourceRange:o,targetRange:r}=e,a=o.startRow>r.startRow,l=o.endRow-o.startRow+1;return a?{unitId:t,subUnitId:n,sourceRange:i.Rectangle.clone(r),targetRange:{...o,endRow:o.endRow+l,startRow:o.startRow+l}}:{unitId:t,subUnitId:n,targetRange:i.Rectangle.clone(o),sourceRange:{...r,endRow:r.endRow-l,startRow:r.startRow-l}}}const Ue={id:"sheet.mutation.move-rows",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,sourceRange:o,targetRange:r}=e,l=s.get(i.IUniverInstanceService).getUniverSheetInstance(t);if(!l)throw new Error("[MoveRowMutation] univerSheet is null!");const u=l.getSheetBySheetId(n);if(!u)throw new Error("[MoveRowMutation] worksheet is null!");const d=o.startRow,c=o.endRow-o.startRow+1,m=r.startRow,h=u.getRowManager().getRowData();return i.moveMatrixArray(d,c,m,h),u.getCellMatrix().moveRows(d,c,m),!0}};function Ao(s,e){const{unitId:t,subUnitId:n,sourceRange:o,targetRange:r}=e,a=o.startColumn>r.startColumn,l=o.endColumn-o.startColumn+1;return a?{unitId:t,subUnitId:n,sourceRange:i.Rectangle.clone(r),targetRange:{...o,endColumn:o.endColumn+l,startColumn:o.startColumn+l}}:{unitId:t,subUnitId:n,targetRange:i.Rectangle.clone(o),sourceRange:{...r,startColumn:r.startColumn-l,endColumn:r.endColumn-l}}}const Pe={id:"sheet.mutation.move-columns",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,sourceRange:o,targetRange:r}=e,l=s.get(i.IUniverInstanceService).getUniverSheetInstance(t);if(!l)throw new Error("[MoveColumnMutation] univerSheet is null!");const u=l.getSheetBySheetId(n);if(!u)throw new Error("[MoveColumnMutation] worksheet is null!");const d=o.startColumn,c=o.endColumn-o.startColumn+1,m=r.startColumn,h=u.getColumnManager().getColumnData();return i.moveMatrixArray(d,c,m,h),u.getCellMatrix().moveColumns(d,c,m),!0}};function ga(s,e){return e.getMergeData().some(t=>t.startRow<s&&s<=t.endRow)}function Ra(s,e){return e.getMergeData().some(t=>t.startColumn<s&&s<=t.endColumn)}const Wo="sheet.command.move-rows",Pt={id:Wo,type:i.CommandType.COMMAND,handler:(s,e)=>{var W,V;const t=s.get(g.SheetsSelectionsService),{fromRange:{startRow:n},toRange:{startRow:o},range:r}=e,a=r?[Vo(r)]:t.getCurrentSelections(),l=a==null?void 0:a.filter($=>$.range.rangeType===i.RANGE_TYPE.ROW&&$.range.startRow<=n&&n<=$.range.endRow);if((l==null?void 0:l.length)!==1)return!1;const u=s.get(g.SheetInterceptorService),d=s.get(i.IUniverInstanceService),c=U(d,e);if(!c)return!1;const{workbook:m,worksheet:h}=c,R=m.getUnitId(),S=h.getSheetId(),C=s.get(i.ErrorService),v=s.get(i.LocaleService),I=l[0].range,p=l[0].primary,w=_t(I,h,!1);if(!i.Rectangle.equals(I,w))return C.emit(v.t("sheets.info.partOfCell")),!1;if(ga(o,h))return C.emit(v.t("sheets.info.acrossMergedCell")),!1;const M={...I,startRow:o,endRow:o+I.endRow-I.startRow},y={unitId:R,subUnitId:S,sourceRange:I,targetRange:M},b=Do(s,y),k=s.get(i.ICommandService),E=u.onCommandExecute({id:Pt.id,params:e}),T=[...(W=E.preRedos)!=null?W:[],{id:Ue.id,params:y}],P=[...(V=E.preUndos)!=null?V:[],{id:Ue.id,params:b}];if(p){const j=o-n<0,ee=I.endRow-I.startRow+1,q=j?M:{...M,startRow:M.startRow-ee,endRow:M.endRow-ee},Te={unitId:R,subUnitId:S,type:Q.MOVE_END,selections:[{range:q,primary:te(q,h),style:null}]},Mt={unitId:R,subUnitId:S,type:Q.MOVE_END,selections:[{range:I,primary:p,style:null}]};T.push({id:Y.id,params:Te}),P.push({id:Y.id,params:Mt})}return T.push(...E.redos),P.push(...E.undos),i.sequenceExecute(T,k).result?(s.get(i.IUndoRedoService).pushUndoRedo({unitID:R,undoMutations:P,redoMutations:T}),!0):!1}},Lo="sheet.command.move-cols",kt={id:Lo,type:i.CommandType.COMMAND,handler:(s,e)=>{var W,V;const t=s.get(g.SheetsSelectionsService),{fromRange:{startColumn:n},toRange:{startColumn:o},range:r}=e,a=r?[Vo(r)]:t.getCurrentSelections(),l=a==null?void 0:a.filter($=>$.range.rangeType===i.RANGE_TYPE.COLUMN&&$.range.startColumn<=n&&n<=$.range.endColumn);if((l==null?void 0:l.length)!==1)return!1;const u=s.get(g.SheetInterceptorService),d=s.get(i.IUniverInstanceService),c=U(d,e);if(!c)return!1;const{workbook:m,worksheet:h}=c,R=m.getUnitId(),S=h.getSheetId(),C=s.get(i.ErrorService),v=s.get(i.LocaleService),I=l[0].range,p=l[0].primary,w=_t(I,h,!1);if(!i.Rectangle.equals(I,w))return C.emit(v.t("sheets.info.partOfCell")),!1;if(Ra(o,h))return C.emit(v.t("sheets.info.acrossMergedCell")),!1;const M={...I,startColumn:o,endColumn:o+I.endColumn-I.startColumn},y={unitId:R,subUnitId:S,sourceRange:I,targetRange:M},b=Ao(s,y),k=s.get(i.ICommandService),E=u.onCommandExecute({id:kt.id,params:e}),T=[...(W=E.preRedos)!=null?W:[],{id:Pe.id,params:y}],P=[...(V=E.preUndos)!=null?V:[],{id:Pe.id,params:b}];if(p){const $=I.endColumn-I.startColumn+1,q=o-n<0?M:{...M,startColumn:M.startColumn-$,endColumn:M.endColumn-$},Te={unitId:R,subUnitId:S,type:Q.MOVE_END,selections:[{range:q,primary:te(q,h),style:null}]},Mt={unitId:R,subUnitId:S,type:Q.MOVE_END,selections:[{range:I,primary:p,style:null}]};T.push({id:Y.id,params:Te}),P.push({id:Y.id,params:Mt})}return T.push(...E.redos),P.push(...E.undos),i.sequenceExecute(T,k).result&&s.get(i.IUndoRedoService).pushUndoRedo({unitID:R,undoMutations:P,redoMutations:T}),!0}};function Vo(s){return{range:s,primary:null,style:null}}const lt={id:"sheet.mutation.register-worksheet-range-theme-style",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,rangeThemeStyleJson:n,themeName:o}=e,r=s.get(i.IUniverInstanceService),a=U(r),l=s.get(we);if(!a)return!1;const u=new De(o,n);return l.registerRangeThemeStyle(t,u),!0}},rn={id:"sheet.mutation.unregister-worksheet-range-theme-style",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,themeName:n}=e,o=s.get(i.IUniverInstanceService),r=U(o),a=s.get(we);return r?(a.unregisterRangeThemeStyle(t,n),!0):!1}},$o={id:"sheet.command.register-worksheet-range-theme-style",type:i.CommandType.COMMAND,handler:(s,e)=>{if(!e)return!1;const{unitId:t,rangeThemeStyle:n}=e,o=s.get(i.IUniverInstanceService),r=s.get(i.ICommandService),a=s.get(i.IUndoRedoService);if(!U(o))return!1;const u={unitId:t,themeName:n.getName(),rangeThemeStyleJson:n.toJson()},d={unitId:t,themeName:n.getName()};return r.syncExecuteCommand(lt.id,u)&&a.pushUndoRedo({unitID:t,undoMutations:[{id:rn.id,params:d}],redoMutations:[{id:lt.id,params:u}]}),!0}},ms={id:"sheet.command.remove-defined-name",type:i.CommandType.COMMAND,handler:(s,e)=>{var c,m;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(g.SheetInterceptorService);if(!e)return!1;const r={...e},a=o.onCommandExecute({id:ms.id,params:e}),l=[...(c=a.preRedos)!=null?c:[],{id:z.RemoveDefinedNameMutation.id,params:r},...a.redos],u=[...(m=a.preUndos)!=null?m:[],{id:z.SetDefinedNameMutation.id,params:r},...a.undos];return i.sequenceExecute(l,t)?(n.pushUndoRedo({unitID:e.unitId,undoMutations:u.filter(Boolean),redoMutations:l.filter(Boolean)}),!0):!1}},hs="sheet.command.remove-row",gs={type:i.CommandType.COMMAND,id:"sheet.command.remove-row-by-range",handler:(s,e)=>{var I,p,w;if(!e)return!1;const t=s.get(i.IUniverInstanceService),n=U(t,e);if(!n)return!1;const{workbook:o,worksheet:r}=n,a=s.get(g.SheetInterceptorService),{range:l,unitId:u,subUnitId:d}=e,c={unitId:u,subUnitId:d,range:l},m=ca(c,r),h=r.getCellMatrix().getSlice(l.startRow,l.endRow,0,r.getColumnCount()-1),R={unitId:u,subUnitId:d,cellValue:h.getMatrix()},S=a.onCommandExecute({id:hs,params:{range:l}}),C=s.get(i.ICommandService);return i.sequenceExecute([...(I=S.preRedos)!=null?I:[],{id:Se.id,params:c},...S.redos,Me(l,o,r)],C).result?(s.get(i.IUndoRedoService).pushUndoRedo({unitID:u,undoMutations:[...(p=S.preUndos)!=null?p:[],{id:ye.id,params:m},{id:H.id,params:R},...S.undos],redoMutations:[...(w=S.preRedos)!=null?w:[],{id:Se.id,params:c},...S.redos]}),!0):!1}},Nt={type:i.CommandType.COMMAND,id:hs,handler:async(s,e)=>{var h;const t=s.get(g.SheetsSelectionsService),n=s.get(g.SheetInterceptorService),o=s.get(i.ICommandService);let r=e==null?void 0:e.range;if(r||(r=(h=t.getCurrentLastSelection())==null?void 0:h.range),!r)return!1;const a=s.get(i.IUniverInstanceService),l=U(a);if(!l)return!1;const{worksheet:u,subUnitId:d,unitId:c}=l;return r={...r,startColumn:0,endColumn:Math.max(u.getMaxColumns()-1,0)},await n.beforeCommandExecute({id:Nt.id,params:{range:r}})?o.syncExecuteCommand(gs.id,{range:r,unitId:c,subUnitId:d}):!1}},Rs="sheet.command.remove-col",Ss={type:i.CommandType.COMMAND,id:"sheet.command.remove-col-by-range",handler:(s,e)=>{var I,p,w;if(!e)return!1;const t=s.get(i.IUniverInstanceService),n=U(t,e);if(!n)return!1;const{workbook:o,worksheet:r}=n,a=s.get(g.SheetInterceptorService),{range:l,unitId:u,subUnitId:d}=e,c={unitId:u,subUnitId:d,range:l},m=ma(s,c),h=r.getCellMatrix().getSlice(0,r.getRowCount()-1,l.startColumn,l.endColumn),R={unitId:u,subUnitId:d,cellValue:h.getMatrix()},S=a.onCommandExecute({id:Rs,params:{range:l}}),C=s.get(i.ICommandService);return i.sequenceExecute([...(I=S.preRedos)!=null?I:[],{id:ce.id,params:c},...S.redos,Me(l,o,r)],C).result?(s.get(i.IUndoRedoService).pushUndoRedo({unitID:u,undoMutations:[...(p=S.preUndos)!=null?p:[],{id:Re.id,params:m},{id:H.id,params:R},...S.undos],redoMutations:[...(w=S.preRedos)!=null?w:[],{id:ce.id,params:c},...S.redos]}),!0):!1}},Ot={type:i.CommandType.COMMAND,id:Rs,handler:async(s,e)=>{var h;const t=s.get(g.SheetsSelectionsService),n=s.get(g.SheetInterceptorService),o=s.get(i.ICommandService);let r=e==null?void 0:e.range;if(r||(r=(h=t.getCurrentLastSelection())==null?void 0:h.range),!r)return!1;const a=s.get(i.IUniverInstanceService),l=U(a);if(!l)return!1;const{worksheet:u,subUnitId:d,unitId:c}=l;return r={...r,startRow:0,endRow:Math.max(u.getMaxRows()-1,0)},await n.beforeCommandExecute({id:Ot.id,params:{range:r}})?o.syncExecuteCommand(Ss.id,{range:r,unitId:c,subUnitId:d}):!1}},an={id:"sheet.command.remove-sheet",type:i.CommandType.COMMAND,handler:(s,e)=>{var I,p;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetInterceptorService),a=U(o,e);if(!a)return!1;const{unitId:l,subUnitId:u,workbook:d,worksheet:c}=a;if(d.getSheets().length<=1)return!1;const m={subUnitId:u,unitId:l,subUnitName:c.getName()},h=go(s,m),R=r.onCommandExecute({id:an.id,params:{unitId:l,subUnitId:u}}),S=[...(I=R.preRedos)!=null?I:[],{id:ze.id,params:m},...R.redos],C=[...(p=R.preUndos)!=null?p:[],{id:st.id,params:h},...R.undos];return i.sequenceExecute(S,t).result?(n.pushUndoRedo({unitID:l,undoMutations:C,redoMutations:S}),!0):!1}},me=(s,e)=>{if(s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:i.Tools.deepClone(e.ranges)}},F={id:"sheet.mutation.add-worksheet-merge",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(!o)return!1;const a=o.getConfig().mergeData,l=e.ranges;for(let u=0;u<l.length;u++)a.push(l[u]);return o.getSpanModel().rebuild(a),!0}},ne=(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(o==null)throw new Error("worksheet is null error!");const a=o.getConfig().mergeData,l=e.ranges,u=[];for(let d=0;d<l.length;d++)for(let c=a.length-1;c>=0;c--){const m=a[c],h=l[d];i.Rectangle.intersects(m,h)&&u.push(a[c])}return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:u}},G={id:"sheet.mutation.remove-worksheet-merge",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(!o)return!1;const a=o.getConfig().mergeData,l=e.ranges;for(let u=0;u<l.length;u++)for(let d=a.length-1;d>=0;d--){const c=a[d],m=l[u];i.Rectangle.intersects(c,m)&&a.splice(d,1)}return o.getSpanModel().rebuild(a),!0}},Bo={type:i.CommandType.COMMAND,id:"sheet.command.remove-worksheet-merge",handler:(s,e)=>{var N;const t=s.get(g.SheetsSelectionsService),n=s.get(i.ICommandService),o=s.get(i.IUndoRedoService),r=s.get(i.IUniverInstanceService),a=(e==null?void 0:e.ranges)||((N=t.getCurrentSelections())==null?void 0:N.map(W=>W.range));if(!(a!=null&&a.length))return!1;const l=U(r);if(!l)return!1;const{subUnitId:u,unitId:d,worksheet:c}=l,m={unitId:d,subUnitId:u,ranges:a},R=c.getConfig().mergeData.filter(W=>a.some(V=>i.Rectangle.intersects(V,W)));if(!R.length)return!1;const S=ne(s,m),C=t.getCurrentSelections();if(!(C!=null&&C.length))return!1;const v=i.Tools.deepClone(C),I=i.Tools.deepClone(C),p=I[I.length-1],{startRow:w,startColumn:M}=p.range;p.primary={startRow:w,startColumn:M,endRow:w,endColumn:M,actualRow:w,actualColumn:M,isMerged:!1,isMergedMainCell:!1};const y=Sa(c,R),b={unitId:d,subUnitId:u,cellValue:y.redoParams.getMatrix()},k={unitId:d,subUnitId:u,cellValue:y.undoParams.getMatrix()},E=[{id:G.id,params:S},{id:H.id,params:b},{id:Y.id,params:{selections:I}}],T=[{id:F.id,params:S},{id:H.id,params:k},{id:Y.id,params:{selections:v}}];return i.sequenceExecute(E,n)?(o.pushUndoRedo({unitID:d,undoMutations:T,redoMutations:E}),!0):!1}};function Sa(s,e){const t=new i.ObjectMatrix,n=new i.ObjectMatrix;return e.forEach(o=>{const{startRow:r,startColumn:a,endColumn:l,endRow:u}=o,d=s.getCellMatrix().getValue(r,a);if(d!=null&&d.s)for(let c=r;c<=u;c++)for(let m=a;m<=l;m++)(c!==r||m!==a)&&(t.setValue(c,m,{s:d.s}),n.setValue(c,m,null))}),{redoParams:t,undoParams:n}}const Ho=s=>{const{order:e}=s,t={};return Object.keys(e).forEach(n=>{t[e[Number(n)]]=Number(n)}),{...s,order:t}},Dt={id:"sheet.mutation.reorder-range",type:i.CommandType.MUTATION,handler:(s,e)=>{const{subUnitId:t,unitId:n,range:o,order:r}=e,u=s.get(i.IUniverInstanceService).getUnit(n).getSheetBySheetId(t);if(!u)return!1;const d=new i.ObjectMatrix;i.Range.foreach(o,(m,h)=>{if(r.hasOwnProperty(m)){const R=r[m],S=i.Tools.deepClone(u.getCellRaw(R,h));d.setValue(m,h,S)}});const c=u.getCellMatrix();return d.forValue((m,h,R)=>{c.setValue(m,h,R)}),!0}},jo="sheet.command.reorder-range",ln={id:jo,type:i.CommandType.COMMAND,handler:(s,e)=>{var C,v;const{subUnitId:t,unitId:n,range:o,order:r}=e,a=s.get(i.ICommandService),l={id:Dt.id,params:{unitId:n,subUnitId:t,order:r,range:o}},u={id:Dt.id,params:Ho(l.params)},d=s.get(g.SheetInterceptorService),c=d.onCommandExecute({id:ln.id,params:e}),m=[...(C=c.preRedos)!=null?C:[],l,...c.redos],h=[...(v=c.preUndos)!=null?v:[],u,...c.undos],R=i.sequenceExecute(m,a),S=d.afterCommandExecute({id:ln.id,params:e});return R.result?(i.sequenceExecute(S.redos,a),s.get(i.IUndoRedoService).pushUndoRedo({unitID:n,undoMutations:[...h,...S.undos],redoMutations:[...m,...S.redos]}),!0):!1}};class Je{constructor(){f(this,"_borderInfo",{type:i.BorderType.ALL,color:"#000000",style:i.BorderStyleTypes.THIN,activeBorderType:!1});f(this,"_borderInfo$",new A.BehaviorSubject(this._borderInfo));f(this,"borderInfo$",this._borderInfo$.asObservable())}dispose(){this._borderInfo$.complete()}setType(e){this._borderInfo.type=e,this.setActiveBorderType(!0),this._refresh()}setColor(e){this._borderInfo.color=e,this._refresh()}setStyle(e){this._borderInfo.style=e,this._refresh()}setActiveBorderType(e){this._borderInfo.activeBorderType=e}getBorderInfo(){return this._borderInfo}_refresh(){this._borderInfo$.next(this._borderInfo)}}function un(s,e){const{startRow:t,startColumn:n,endRow:o,endColumn:r}=s;for(let a=t;a<=o;a++)for(let l=n;l<=r;l++)e(a,l)}const Cs=(s,e,t,n)=>{const{mr:o,worksheet:r}=s;e.startRow<0||e.startColumn<0||un(e,(a,l)=>{var c,m;const u=r.getMergedCell(a,l);let d=t;if(u&&(t.bc_tr||t.ml_tr||t.bl_tr||t.tl_mr||t.tl_bc||t.tl_br)){if(n){const h=i.Tools.deepClone((c=o.getValue(u.startRow,u.startColumn))==null?void 0:c.s);d=h!=null&&h.bd?Object.assign(h.bd,t):t}o.setValue(u.startRow,u.startColumn,{s:{bd:d}})}else{if(n){const h=i.Tools.deepClone((m=o.getValue(a,l))==null?void 0:m.s);d=h!=null&&h.bd?Object.assign(h.bd,t):t}o.setValue(a,l,{s:{bd:d}})}})},Ca=s=>{const e={startRow:s.startRow-1,startColumn:s.startColumn,endRow:s.startRow-1,endColumn:s.endColumn},t={startRow:s.startRow,startColumn:s.startColumn-1,endRow:s.endRow,endColumn:s.startColumn-1},n={startRow:s.endRow+1,startColumn:s.startColumn,endRow:s.endRow+1,endColumn:s.endColumn},o={startRow:s.startRow,startColumn:s.endColumn+1,endRow:s.endRow,endColumn:s.endColumn+1},r={startRow:s.startRow,startColumn:s.startColumn,endRow:s.startRow,endColumn:s.endColumn},a={startRow:s.startRow,startColumn:s.startColumn,endRow:s.endRow,endColumn:s.startColumn},l={startRow:s.endRow,startColumn:s.startColumn,endRow:s.endRow,endColumn:s.endColumn},u={startRow:s.startRow,startColumn:s.endColumn,endRow:s.endRow,endColumn:s.endColumn};return{topRangeOut:e,leftRangeOut:t,bottomRangeOut:n,rightRangeOut:o,topRange:r,leftRange:a,bottomRange:l,rightRange:u}};function fa(s,e,t){const{style:n,color:o,type:r}=s.getBorderInfo(),a=r===i.BorderType.TOP||r===i.BorderType.ALL||r===i.BorderType.OUTSIDE,l=r===i.BorderType.LEFT||r===i.BorderType.ALL||r===i.BorderType.OUTSIDE,u=r===i.BorderType.BOTTOM||r===i.BorderType.ALL||r===i.BorderType.OUTSIDE,d=r===i.BorderType.RIGHT||r===i.BorderType.ALL||r===i.BorderType.OUTSIDE,c=r===i.BorderType.VERTICAL||r===i.BorderType.ALL||r===i.BorderType.INSIDE,m=r===i.BorderType.HORIZONTAL||r===i.BorderType.ALL||r===i.BorderType.INSIDE,h=r.indexOf("tlbr")>-1,R=r.indexOf("tlbc")>-1,S=r.indexOf("tlmr")>-1,C=r.indexOf("bltr")>-1,v=r.indexOf("mltr")>-1,I=r.indexOf("bctr")>-1,p=t[0],{topRangeOut:w,leftRangeOut:M,bottomRangeOut:y,rightRangeOut:b,topRange:k,leftRange:E,bottomRange:T,rightRange:P}=Ca(p),N=new i.ObjectMatrix,{worksheet:W,unitId:V,subUnitId:$}=e;return{worksheet:W,unitId:V,subUnitId:$,style:n,color:o,type:r,top:a,left:l,right:d,bottom:u,vertical:c,horizontal:m,tl_br:h,tl_bc:R,tl_mr:S,bl_tr:C,ml_tr:v,bc_tr:I,topRangeOut:w,leftRangeOut:M,bottomRangeOut:y,rightRangeOut:b,topRange:k,leftRange:E,bottomRange:T,rightRange:P,range:p,mr:N,borderStyle:{s:n,cl:{rgb:o}}}}const va=s=>{const{range:e,mr:t,borderStyle:n,vertical:o,horizontal:r,worksheet:a}=s;o&&un(e,(l,u)=>{var c,m,h;const d=a.getMergedCell(l,u);if(d){const R=(c=t.getValue(d.startRow,d.startColumn))==null?void 0:c.s;d.startColumn!==e.startColumn&&t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{l:i.Tools.deepClone(n)}):{l:i.Tools.deepClone(n)}}})}else{if(u!==e.endColumn){const R=(m=t.getValue(l,u))==null?void 0:m.s;t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{r:i.Tools.deepClone(n)}):{r:i.Tools.deepClone(n)}}})}if(u!==e.startColumn){const R=(h=t.getValue(l,u))==null?void 0:h.s;t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{l:i.Tools.deepClone(n)}):{l:i.Tools.deepClone(n)}}})}}}),r&&un(e,(l,u)=>{var c,m,h;const d=a.getMergedCell(l,u);if(d){const R=(c=t.getValue(d.startRow,d.startColumn))==null?void 0:c.s;d.startRow!==e.startRow&&t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{t:i.Tools.deepClone(n)}):{t:i.Tools.deepClone(n)}}})}else{if(l!==e.endRow){const R=(m=t.getValue(l,u))==null?void 0:m.s;t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{b:i.Tools.deepClone(n)}):{b:i.Tools.deepClone(n)}}})}if(l!==e.startRow){const R=(h=t.getValue(l,u))==null?void 0:h.s;t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{t:i.Tools.deepClone(n)}):{t:i.Tools.deepClone(n)}}})}}})};function Ia(s){const{borderStyle:e,tl_br:t,tl_bc:n,tl_mr:o,bl_tr:r,ml_tr:a,bc_tr:l}=s,u=(d,c,m)=>{Cs(s,d,c,m)};t&&u(s.range,{tl_br:i.Tools.deepClone(e)},!0),n&&u(s.range,{tl_bc:i.Tools.deepClone(e)},!0),o&&u(s.range,{tl_mr:i.Tools.deepClone(e)},!0),r&&u(s.range,{bl_tr:i.Tools.deepClone(e)},!0),a&&u(s.range,{ml_tr:i.Tools.deepClone(e)},!0),l&&u(s.range,{bc_tr:i.Tools.deepClone(e)},!0)}const pa=s=>{const{top:e,left:t,right:n,bottom:o,borderStyle:r,bottomRange:a,topRange:l,leftRange:u,rightRange:d,bottomRangeOut:c,topRangeOut:m,leftRangeOut:h,rightRangeOut:R}=s,S=(C,v,I)=>{Cs(s,C,v,I)};e&&(S(m,{b:null}),S(l,{t:i.Tools.deepClone(r)},!0)),o&&(S(c,{t:null}),S(a,{b:i.Tools.deepClone(r)},!0)),t&&(S(h,{r:null}),S(u,{l:i.Tools.deepClone(r)},!0)),n&&(S(R,{l:null}),S(d,{r:i.Tools.deepClone(r)},!0))},wa=s=>{const{range:e,worksheet:t,mr:n,top:o,bottom:r,left:a,right:l,vertical:u,horizontal:d,tl_br:c,tl_bc:m,tl_mr:h,bl_tr:R,ml_tr:S,bc_tr:C,topRange:v,bottomRange:I,leftRange:p,rightRange:w,topRangeOut:M,bottomRangeOut:y,leftRangeOut:b,rightRangeOut:k}=s,E=(T,P,N)=>{Cs(s,T,P,N)};!o&&!r&&!a&&!l&&!u&&!d&&!c&&!m&&!h&&!R&&!S&&!C&&(un(e,(T,P)=>{var W,V,$,j,ee,q,Te,Mt;const N=t.getMergedCell(T,P);if(N){if(N.endColumn!==e.endColumn){const B=(W=n.getValue(N.startRow,N.startColumn))==null?void 0:W.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{r:null}):{r:null}}})}if(N.startColumn!==e.startColumn){const B=(V=n.getValue(N.startRow,N.startColumn))==null?void 0:V.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{l:null}):{l:null}}})}if(N.endRow!==e.endRow){const B=($=n.getValue(N.startRow,N.startColumn))==null?void 0:$.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{b:null}):{b:null}}})}if(N.startRow!==e.startRow){const B=(j=n.getValue(N.startRow,N.startColumn))==null?void 0:j.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{t:null}):{t:null}}})}}else{if(P!==e.endColumn){const B=(ee=n.getValue(T,P))==null?void 0:ee.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{r:null}):{r:null}}})}if(P!==e.startColumn){const B=(q=n.getValue(T,P))==null?void 0:q.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{l:null}):{l:null}}})}if(T!==e.endRow){const B=(Te=n.getValue(T,P))==null?void 0:Te.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{b:null}):{b:null}}})}if(T!==e.startRow){const B=(Mt=n.getValue(T,P))==null?void 0:Mt.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{t:null}):{t:null}}})}}}),E(M,{b:null}),E(v,{t:null},!0),E(y,{t:null}),E(I,{b:null},!0),E(b,{r:null}),E(p,{l:null},!0),E(k,{l:null}),E(w,{r:null},!0),E(e,{tl_br:null},!0),E(e,{tl_bc:null},!0),E(e,{tl_mr:null},!0),E(e,{bl_tr:null},!0),E(e,{ml_tr:null},!0),E(e,{bc_tr:null},!0))},ut={id:"sheet.command.set-border",type:i.CommandType.COMMAND,handler:(s,e)=>{var I;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetsSelectionsService),a=s.get(Je),l=U(o,e);if(!l)return!1;const u=(e==null?void 0:e.ranges)||((I=r.getCurrentSelections())==null?void 0:I.map(p=>p.range));if(!(u!=null&&u.length))return!1;const{activeBorderType:d}=a.getBorderInfo();if(!d)return!1;const c=fa(a,l,u);va(c),pa(c),Ia(c),wa(c);const{unitId:m,subUnitId:h,mr:R}=c,S={unitId:m,subUnitId:h,cellValue:R.getData()},C=le(s,S);return t.syncExecuteCommand(H.id,S)?(n.pushUndoRedo({unitID:m,undoMutations:[{id:H.id,params:C}],redoMutations:[{id:H.id,params:S}]}),!0):!1}},Fo={id:"sheet.command.set-border-position",type:i.CommandType.COMMAND,handler:(s,e)=>{if(!e.value)return!1;const t=s.get(i.ICommandService);return s.get(Je).setType(e.value),t.syncExecuteCommand(ut.id)}},Go={id:"sheet.command.set-border-style",type:i.CommandType.COMMAND,handler:(s,e)=>{const t=s.get(i.ICommandService);return s.get(Je).setStyle(e.value),t.syncExecuteCommand(ut.id)}},zo={id:"sheet.command.set-border-color",type:i.CommandType.COMMAND,handler:(s,e)=>{const t=s.get(i.ICommandService);return s.get(Je).setColor(e.value),t.syncExecuteCommand(ut.id)}},Yo={id:"sheet.command.set-border-basic",type:i.CommandType.COMMAND,handler:(s,e)=>{const{unitId:t,subUnitId:n,value:o,ranges:r}=e,{type:a,color:l,style:u}=o,d=s.get(i.ICommandService),c=s.get(Je);return c.setType(a),l&&c.setColor(l),c.setStyle(u),d.syncExecuteCommand(ut.id,{unitId:t,subUnitId:n,ranges:r})}};function Ma(s,e){if(s==null)return s;const t=i.Tools.deepClone(s);if(e==null)return t;const n={};return"h"in e&&(n.h=t.h),"ia"in e&&(n.ia=t.ia),"ah"in e&&(n.ah=t.ah),"hd"in e&&(n.hd=t.hd),"s"in e&&(n.s=t.s),"custom"in e&&(n.custom=t.custom),n}function ya(s,e){if(s==null)return s;const t=i.Tools.deepClone(s);if(e==null)return t;const n={};return"w"in e&&(n.w=t.w),"hd"in e&&(n.hd=t.hd),"s"in e&&(n.s=t.s),"custom"in e&&(n.custom=t.custom),n}const qo=(s,e)=>{const{unitId:t,subUnitId:n,columnData:o}=s,r={},a=e.getColumnManager();for(const l in o){const u=o[l],d=a.getColumn(Number(l));r[l]=ya(d,u)}return{unitId:t,subUnitId:n,columnData:r}},dt={id:"sheet.mutation.set-col-data",type:i.CommandType.MUTATION,handler:(s,e)=>{const{columnData:t}=e,n=s.get(i.IUniverInstanceService),o=U(n,e);if(!o)return!1;const{worksheet:r}=o,a=r.getColumnManager();for(const l in t){const u=t[l];if(u==null){a.removeColumn(Number(l));continue}const d=a.getColumnOrCreate(Number(l));Object.assign(d,u)}return!0}},Ko={type:i.CommandType.COMMAND,id:"sheet.command.set-col-data",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=U(o,e);if(!r)return!1;const{columnData:a}=e,{unitId:l,subUnitId:u,worksheet:d}=r,c={subUnitId:u,unitId:l,columnData:a},m=qo(c,d);return t.syncExecuteCommand(dt.id,c)?(n.pushUndoRedo({unitID:l,undoMutations:[{id:dt.id,params:m}],redoMutations:[{id:dt.id,params:c}]}),!0):!1}},_a=(s,e)=>{if(s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},ct={id:"sheet.mutation.set-col-hidden",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!n)return!1;const o=n.getSheetBySheetId(e.subUnitId).getColumnManager();for(let r=0;r<e.ranges.length;r++){const a=e.ranges[r];for(let l=a.startColumn;l<a.endColumn+1;l++){const u=o.getColumnOrCreate(l);u!=null&&(u.hd=i.BooleanNumber.TRUE)}}return!0}},ba=(s,e)=>{if(s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},mt={id:"sheet.mutation.set-col-visible",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!n)return!1;const o=n.getSheetBySheetId(e.subUnitId).getColumnManager();for(let r=0;r<e.ranges.length;r++){const a=e.ranges[r];for(let l=a.startColumn;l<a.endColumn+1;l++){const u=o.getColumnOrCreate(l);u!=null&&(u.hd=i.BooleanNumber.FALSE)}}return!0}},At={type:i.CommandType.COMMAND,id:"sheet.command.set-col-visible-on-cols",handler:(s,e)=>{var I,p;const{unitId:t,subUnitId:n,ranges:o}=e,r=s.get(g.SheetInterceptorService),a=s.get(i.ICommandService),l=s.get(i.IUniverInstanceService),u=U(l,{unitId:t,subUnitId:n});if(!u)return!1;const{worksheet:d}=u,c={unitId:t,subUnitId:n,ranges:o},m={unitId:t,subUnitId:n,reveal:!0,selections:o.map(w=>({range:w,primary:te(w,d),style:null}))},h=ba(s,c),R={unitId:t,subUnitId:n,selections:Jo(o).map(w=>({range:w,primary:te(w,d),style:null}))},S=i.sequenceExecute([{id:mt.id,params:c},{id:Y.id,params:m}],a),C=r.onCommandExecute({id:At.id,params:e}),v=i.sequenceExecute([...C.redos],a);return S.result&&v.result&&s.get(i.IUndoRedoService).pushUndoRedo({unitID:t,undoMutations:[{id:ct.id,params:h},{id:Y.id,params:R},...(I=C.undos)!=null?I:[]],redoMutations:[...(p=C.preRedos)!=null?p:[],{id:mt.id,params:c},{id:Y.id,params:m},...C.redos]}),!0}},fs={type:i.CommandType.COMMAND,id:"sheet.command.set-selected-cols-visible",handler:s=>{var d;const e=s.get(g.SheetsSelectionsService),t=s.get(i.ICommandService),n=(d=e.getCurrentSelections())==null?void 0:d.map(c=>c.range).filter(c=>c.rangeType===i.RANGE_TYPE.COLUMN);if(!(n!=null&&n.length))return!1;const o=U(s.get(i.IUniverInstanceService));if(!o)return!1;const{worksheet:r,unitId:a,subUnitId:l}=o,u=n.map(c=>r.getHiddenCols(c.startColumn,c.endColumn)).flat();return t.executeCommand(At.id,{unitId:a,subUnitId:l,ranges:u})}},vs={type:i.CommandType.COMMAND,id:"sheet.command.set-col-hidden",handler:(s,e)=>{var p,w,M,y;const t=s.get(g.SheetsSelectionsService),n=s.get(g.SheetInterceptorService),o=s.get(i.IUniverInstanceService),r=s.get(i.ICommandService);let a=(p=e==null?void 0:e.ranges)!=null&&p.length?e.ranges:(w=t.getCurrentSelections())==null?void 0:w.map(b=>b.range).filter(b=>b.rangeType===i.RANGE_TYPE.COLUMN);if(!(a!=null&&a.length))return!1;const l=U(o,e);if(!l)return!1;const{worksheet:u,unitId:d,subUnitId:c}=l;a=Ta(l.worksheet,a);const m={unitId:d,subUnitId:c,ranges:a},h={unitId:d,subUnitId:c,selections:Jo(a).map(b=>({range:b,primary:te(b,u),style:null}))},R=_a(s,m),S={unitId:d,subUnitId:c,reveal:!0,selections:a.map(b=>({range:b,primary:te(b,u),style:null}))},C=i.sequenceExecute([{id:ct.id,params:m},{id:Y.id,params:h}],r),v=n.onCommandExecute({id:vs.id,params:m}),I=i.sequenceExecute([...v.redos],r);return C.result&&I.result?(s.get(i.IUndoRedoService).pushUndoRedo({unitID:d,undoMutations:[{id:mt.id,params:R},{id:Y.id,params:S},...(M=v.undos)!=null?M:[]],redoMutations:[...(y=v.preRedos)!=null?y:[],{id:ct.id,params:m},{id:Y.id,params:h},...v.redos]}),!0):!1}};function Ta(s,e){const t=s.getRowCount()-1,n=s.getHiddenCols(),o=[];return e.forEach(r=>{const a=n.filter(l=>l.startColumn>=r.startColumn&&l.endColumn<=r.endColumn);if(a.length){let l=r.startColumn;a.forEach(u=>{u.startColumn>l&&(o.push({startColumn:l,endColumn:u.startColumn-1,startRow:0,endRow:t}),l=u.endColumn+1)}),l<=r.endColumn&&o.push({startColumn:l,endColumn:r.endColumn,startRow:0,endRow:t})}else o.push(r)}),o}function Jo(s){return Ea(s).map(t=>{const n=t.startColumn===0?t.endColumn+1:t.startColumn-1;return{...t,startColumn:n,endColumn:n}})}function Ea(s){const e=[];let t;return s.sort((n,o)=>n.startColumn-o.startColumn).forEach(n=>{if(!t){t=n;return}t.endColumn===n.startColumn-1?t.endColumn=n.endColumn:(e.push(t),t=n)}),e.push(t),e}const Is={id:"sheet.command.set-defined-name",type:i.CommandType.COMMAND,handler:(s,e)=>{var m,h;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(g.SheetInterceptorService);if(!e)return!1;const r={...e},a=z.SetDefinedNameMutationFactory(s,e),l=o.onCommandExecute({id:Is.id,params:e}),u=[...(m=l.preRedos)!=null?m:[],{id:z.RemoveDefinedNameMutation.id,params:a},{id:z.SetDefinedNameMutation.id,params:r},...l.redos],d=[...(h=l.preUndos)!=null?h:[],{id:z.RemoveDefinedNameMutation.id,params:r},{id:z.SetDefinedNameMutation.id,params:a},...l.undos];return i.sequenceExecute(u,t)?(n.pushUndoRedo({unitID:e.unitId,undoMutations:d.filter(Boolean),redoMutations:u.filter(Boolean)}),!0):!1}},ps=(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(o==null)throw new Error("worksheet is null error!");const a=o.getConfig().freeze;return{unitId:e.unitId,subUnitId:e.subUnitId,...a}},Ve={id:"sheet.mutation.set-frozen",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(!o)return!1;const r=o.getConfig(),{startRow:a,startColumn:l,ySplit:u,xSplit:d}=e;return r.freeze={startRow:a,startColumn:l,ySplit:u,xSplit:d},!0}},xo={type:i.CommandType.COMMAND,id:"sheet.command.set-frozen",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=U(o,{unitId:e.unitId,subUnitId:e.subUnitId});if(!r)return!1;const{unitId:a,subUnitId:l,worksheet:u}=r,{startColumn:d,startRow:c,xSplit:m,ySplit:h}=e;if(c>=u.getRowCount()||d>=u.getColumnCount()||m>=u.getColumnCount()||h>=u.getRowCount())return!1;const R={unitId:a,subUnitId:l,...e},S=ps(s,R);return t.syncExecuteCommand(Ve.id,R)?(n.pushUndoRedo({unitID:a,undoMutations:[{id:Ve.id,params:S}],redoMutations:[{id:Ve.id,params:R}]}),!0):!1}},Xo={type:i.CommandType.COMMAND,id:"sheet.command.cancel-frozen",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUniverInstanceService),o=s.get(i.IUndoRedoService),r=U(n,{unitId:e==null?void 0:e.unitId,subUnitId:e==null?void 0:e.subUnitId});if(!r)return!1;const{unitId:a,subUnitId:l}=r,u={unitId:a,subUnitId:l,startRow:-1,startColumn:-1,xSplit:0,ySplit:0},d=ps(s,u);return t.syncExecuteCommand(Ve.id,u)&&o.pushUndoRedo({unitID:a,undoMutations:[{id:Ve.id,params:d}],redoMutations:[{id:Ve.id,params:u}]}),!0}},ht={id:"sheet.mutation.set-gridlines-color",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=U(s.get(i.IUniverInstanceService),e);if(!t)return!1;const{worksheet:n}=t,o=n.getConfig();return o.gridlinesColor=e.color,!0}},Zo={type:i.CommandType.COMMAND,id:"sheet.command.set-gridlines-color",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=U(o);if(!r)return!1;const{worksheet:a}=r,l=a.getConfig().gridlinesColor;if(l===(e==null?void 0:e.color))return!1;const{unitId:u,subUnitId:d}=r,c={color:e==null?void 0:e.color,unitId:u,subUnitId:d},m={color:l,unitId:u,subUnitId:d};return t.syncExecuteCommand(ht.id,c)?(n.pushUndoRedo({unitID:u,undoMutations:[{id:ht.id,params:m}],redoMutations:[{id:ht.id,params:c}]}),!0):!1}},X={id:"sheet.mutation.set-range-protection",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,rule:o,ruleId:r}=e;return s.get(K).setRule(t,n,r,o),!0}},Ua=(s,e)=>{const{unitId:t,subUnitId:n,ruleId:o}=e,a=s.get(K).getRule(t,n,o);return a?{id:X.id,params:{...e,rule:a}}:null},xe={id:"sheet.mutation.set-worksheet-protection",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,rule:o}=e;return s.get(pe).setRule(t,n,o),!0}},Qo={type:i.CommandType.COMMAND,id:"sheet.command.set-protection",async handler(s,e){if(!e)return!1;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(K),{rule:r,oldRule:a}=e,{unitId:l,subUnitId:u}=r,d=[],c=[];return(a==null?void 0:a.unitType)===r.unitType?r.unitType===O.Worksheet?(d.push({id:xe.id,params:{unitId:l,subUnitId:u,rule:r}}),c.push({id:xe.id,params:{unitId:l,subUnitId:u,rule:a}})):(d.push({id:X.id,params:{unitId:l,subUnitId:u,rule:r,ruleId:r.id}}),c.push({id:X.id,params:{unitId:l,subUnitId:u,ruleId:a.id,rule:a}})):(a&&(a.unitType===O.Worksheet?(d.push({id:Fe.id,params:{unitId:l,subUnitId:u}}),c.push({id:Oe.id,params:{unitId:l,rule:a,subUnitId:a.subUnitId}})):a.unitType===O.SelectRange&&(d.push({id:Ie.id,params:{unitId:l,subUnitId:u,ruleIds:[a.id]}}),c.push({id:ae.id,params:{unitId:l,subUnitId:u,rules:[a]}}))),r.unitType===O.Worksheet?(d.push({id:Oe.id,params:{unitId:l,rule:r,subUnitId:r.subUnitId}}),c.unshift({id:Fe.id,params:{unitId:l,subUnitId:u}})):r.unitType===O.SelectRange&&(r.id=o.createRuleId(l,u),d.push({id:ae.id,params:{unitId:l,subUnitId:u,rules:[r]}}),c.unshift({id:Ie.id,params:{unitId:l,subUnitId:u,ruleIds:[r.id]}}))),i.sequenceExecute(d,t)&&n.pushUndoRedo({unitID:l,undoMutations:c,redoMutations:d}),!0}},er=(s,e)=>{const{unitId:t,subUnitId:n,rowData:o}=s,r={},a=e.getRowManager();for(const l in o){const u=o[l],d=a.getRow(Number(l));r[l]=Ma(d,u)}return{unitId:t,subUnitId:n,rowData:r}},gt={id:"sheet.mutation.set-row-data",type:i.CommandType.MUTATION,handler:(s,e)=>{const{rowData:t}=e,n=s.get(i.IUniverInstanceService),o=U(n,e);if(!o)return!1;const{worksheet:r}=o,a=r.getRowManager();for(const l in t){const u=t[l];if(u==null){a.removeRow(Number(l));continue}const d=a.getRowOrCreate(Number(l));Object.assign(d,u)}return!0}},tr={type:i.CommandType.COMMAND,id:"sheet.command.set-row-data",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=U(o,e);if(!r)return!1;const{rowData:a}=e,{unitId:l,subUnitId:u,worksheet:d}=r,c={subUnitId:u,unitId:l,rowData:a},m=er(c,d);return t.syncExecuteCommand(gt.id,c)?(n.pushUndoRedo({unitID:l,undoMutations:[{id:gt.id,params:m}],redoMutations:[{id:gt.id,params:c}]}),!0):!1}},Pa=(s,e)=>{if(s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},Rt={id:"sheet.mutation.set-row-visible",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId).getRowManager();for(let r=0;r<e.ranges.length;r++){const a=e.ranges[r];for(let l=a.startRow;l<a.endRow+1;l++){const u=o.getRowOrCreate(l);u!=null&&(u.hd=0)}}return!0}},ka=(s,e)=>{if(s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},St={id:"sheet.mutation.set-row-hidden",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId).getRowManager();for(let r=0;r<e.ranges.length;r++){const a=e.ranges[r];for(let l=a.startRow;l<a.endRow+1;l++){const u=o.getRowOrCreate(l);u!=null&&(u.hd=1)}}return!0}},Wt={type:i.CommandType.COMMAND,id:"sheet.command.set-specific-rows-visible",handler:(s,e)=>{var I,p,w;const{unitId:t,subUnitId:n,ranges:o}=e,r=s.get(i.ICommandService),a=s.get(i.IUndoRedoService),l=s.get(g.SheetInterceptorService),u=U(s.get(i.IUniverInstanceService),{unitId:t,subUnitId:n});if(!u)return!1;const{worksheet:d}=u,c={unitId:t,subUnitId:n,ranges:o},m={unitId:t,subUnitId:n,reveal:!0,selections:o.map(M=>({range:M,primary:te(M,d),style:null}))},h=Pa(s,c),R={unitId:t,subUnitId:n,selections:nr(o).map(M=>({range:M,primary:te(M,d),style:null}))},S=i.sequenceExecute([{id:Rt.id,params:c},{id:Y.id,params:m}],r),C=l.onCommandExecute({id:Wt.id,params:e}),v=i.sequenceExecute([...C.redos],r);return S.result&&v.result&&a.pushUndoRedo({unitID:t,undoMutations:[...(I=C.preUndos)!=null?I:[],{id:St.id,params:h},{id:Y.id,params:R},...(p=C.undos)!=null?p:[]],redoMutations:[...(w=C.preRedos)!=null?w:[],{id:Rt.id,params:c},{id:Y.id,params:m},...C.redos]}),!0}},ws={type:i.CommandType.COMMAND,id:"sheet.command.set-selected-rows-visible",handler:async s=>{var c;const e=s.get(g.SheetsSelectionsService),t=s.get(i.IUniverInstanceService),n=s.get(i.ICommandService),o=(c=e.getCurrentSelections())==null?void 0:c.map(m=>m.range).filter(m=>m.rangeType===i.RANGE_TYPE.ROW);if(!(o!=null&&o.length))return!1;const r=U(t);if(!r)return!1;const{worksheet:a,unitId:l,subUnitId:u}=r,d=o.map(m=>a.getHiddenRows(m.startRow,m.endRow)).flat();return n.executeCommand(Wt.id,{unitId:l,subUnitId:u,ranges:d})}},Ms={type:i.CommandType.COMMAND,id:"sheet.command.set-rows-hidden",handler:(s,e)=>{var p,w,M,y,b,k;const t=s.get(g.SheetsSelectionsService),n=s.get(i.ICommandService),o=s.get(i.IUndoRedoService),r=s.get(i.IUniverInstanceService),a=s.get(g.SheetInterceptorService);let l=(p=e==null?void 0:e.ranges)!=null&&p.length?e.ranges:(w=t.getCurrentSelections())==null?void 0:w.map(E=>E.range).filter(E=>E.rangeType===i.RANGE_TYPE.ROW);if(!(l!=null&&l.length))return!1;const u=U(r,e);if(!u)return!1;l=Na(u.worksheet,l);const{unitId:d,subUnitId:c,worksheet:m}=u,h={unitId:d,subUnitId:c,ranges:l},R={unitId:d,subUnitId:c,selections:nr(l).map(E=>({range:E,primary:te(E,m),style:null}))},S=ka(s,h),C={unitId:d,subUnitId:c,reveal:!0,selections:l.map(E=>({range:E,primary:te(E,m),style:null}))},v=a.onCommandExecute({id:Ms.id,params:h});return i.sequenceExecute([...(M=v.preRedos)!=null?M:[],{id:St.id,params:h},{id:Y.id,params:R},...v.redos],n).result&&o.pushUndoRedo({unitID:d,undoMutations:[...(y=v.preUndos)!=null?y:[],{id:Rt.id,params:S},{id:Y.id,params:C},...(b=v.undos)!=null?b:[]],redoMutations:[...(k=v.preRedos)!=null?k:[],{id:St.id,params:h},{id:Y.id,params:R},...v.redos]}),!0}};function Na(s,e){const t=s.getMaxColumns()-1,n=s.getHiddenRows(),o=[];return e.forEach(r=>{const a=n.filter(l=>l.startRow>=r.startRow&&l.endRow<=r.endRow);if(a.length){let l=r.startRow;a.forEach(u=>{u.startRow>l&&(o.push({startRow:l,endRow:u.startRow-1,startColumn:0,endColumn:t}),l=u.endRow+1)}),l<=r.endRow&&o.push({startRow:l,endRow:r.endRow,startColumn:0,endColumn:t})}else o.push(r)}),o}function nr(s){return Oa(s).map(t=>{const n=t.startRow===0?t.endRow+1:t.startRow-1;return{...t,startRow:n,endRow:n}})}function Oa(s){const e=[];let t;return s.sort((n,o)=>n.startRow-o.startRow).forEach(n=>{if(!t){t=n;return}n.startRow===t.endRow+1?t.endRow=n.endRow:(e.push(t),t=n)}),e.push(t),e}const Z={type:i.CommandType.COMMAND,id:"sheet.command.set-style",handler:(s,e)=>{var y;const t=s.get(i.IUniverInstanceService),n=U(t,e);if(!n)return!1;const{unitId:o,subUnitId:r,worksheet:a}=n,{range:l,style:u}=e,d=s.get(i.ICommandService),c=s.get(i.IUndoRedoService),m=s.get(g.SheetsSelectionsService),h=l?[l]:(y=m.getCurrentSelections())==null?void 0:y.map(b=>b.range);if(!(h!=null&&h.length))return!1;const R=new i.ObjectMatrix,S=ra(a);if(i.Tools.isArray(u.value))for(let b=0;b<h.length;b++)S.forOperableEach(h[b],(k,E,T)=>{R.setValue(k,E,{s:{[u.type]:u.value[k-T.startRow][E-T.startColumn]}})});else for(let b=0;b<h.length;b++){const k={s:{[u.type]:u.value}};S.forOperableEach(h[b],(E,T)=>R.setValue(E,T,k))}const C={subUnitId:r,unitId:o,cellValue:R.getMatrix()},v=le(s,C),I=d.syncExecuteCommand(H.id,C),{undos:p,redos:w}=s.get(g.SheetInterceptorService).onCommandExecute({id:Z.id,params:e}),M=i.sequenceExecute([...w],d);return I&&M.result?(c.pushUndoRedo({unitID:C.unitId,undoMutations:[{id:H.id,params:v},...p],redoMutations:[{id:H.id,params:C},...w]}),!0):!1}},Da={type:i.CommandType.COMMAND,id:"sheet.command.set-bold",handler:s=>{const e=s.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=U(s.get(i.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t,{actualRow:o,actualColumn:r}=e.primary,l={style:{type:"bl",value:n.getRange(o,r).getFontWeight()===i.FontWeight.BOLD?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE}};return s.get(i.ICommandService).syncExecuteCommand(Z.id,l)}},Aa={type:i.CommandType.COMMAND,id:"sheet.command.set-italic",handler:s=>{const e=s.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=U(s.get(i.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let o=!0;if(e.primary){const{startRow:a,startColumn:l}=e.primary;o=n.getRange(a,l).getFontStyle()===i.FontItalic.ITALIC}const r={style:{type:"it",value:o?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE}};return s.get(i.ICommandService).syncExecuteCommand(Z.id,r)}},Wa={type:i.CommandType.COMMAND,id:"sheet.command.set-underline",handler:s=>{const e=s.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=U(s.get(i.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let o=!0;e.primary&&(o=!!n.getRange(e.primary.startRow,e.primary.startColumn).getUnderline().s);const r={style:{type:"ul",value:{s:o?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE}}};return s.get(i.ICommandService).syncExecuteCommand(Z.id,r)}},La={type:i.CommandType.COMMAND,id:"sheet.command.set-stroke",handler:s=>{const e=s.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=U(s.get(i.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let o=!0;e.primary&&(o=!!n.getRange(e.primary.actualRow,e.primary.actualColumn).getStrikeThrough().s);const r={style:{type:"st",value:{s:o?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE}}};return s.get(i.ICommandService).syncExecuteCommand(Z.id,r)}},Va={type:i.CommandType.COMMAND,id:"sheet.command.set-overline",handler:s=>{const e=s.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=U(s.get(i.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let o=!0;e.primary&&(o=!!n.getRange(e.primary.startRow,e.primary.startColumn).getOverline().s);const r={style:{type:"ol",value:{s:o?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE}}};return s.get(i.ICommandService).syncExecuteCommand(Z.id,r)}},$a={type:i.CommandType.COMMAND,id:"sheet.command.set-font-family",handler:(s,e)=>{if(!e)return!1;const t=s.get(i.ICommandService),n={style:{type:"ff",value:e.value}};return t.syncExecuteCommand(Z.id,n)}},Ba={type:i.CommandType.COMMAND,id:"sheet.command.set-font-size",handler:(s,e)=>{if(!e)return!1;const t=s.get(i.ICommandService),n={style:{type:"fs",value:e.value}};return t.syncExecuteCommand(Z.id,n)}},sr={type:i.CommandType.COMMAND,id:"sheet.command.set-text-color",handler:(s,e)=>{if(!e)return!1;const t=s.get(i.ICommandService),n={style:{type:"cl",value:{rgb:e.value}}};return t.syncExecuteCommand(Z.id,n)}},or={type:i.CommandType.COMMAND,id:"sheet.command.reset-text-color",handler:s=>{const e=s.get(i.ICommandService),t={style:{type:"cl",value:{rgb:null}}};return e.syncExecuteCommand(Z.id,t)}},rr={type:i.CommandType.COMMAND,id:"sheet.command.set-background-color",handler:(s,e)=>{if(!e||!e.value)return!1;const t=s.get(i.ICommandService),n={style:{type:"bg",value:{rgb:e.value}}};return t.syncExecuteCommand(Z.id,n)}},ir={type:i.CommandType.COMMAND,id:"sheet.command.reset-background-color",handler:s=>{const e=s.get(i.ICommandService),t={style:{type:"bg",value:{rgb:null}}};return e.syncExecuteCommand(Z.id,t)}},ar={type:i.CommandType.COMMAND,id:"sheet.command.set-vertical-text-align",handler:(s,e)=>{if(!e)return!1;const t=s.get(i.ICommandService),n={unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,style:{type:"vt",value:e.value}};return t.syncExecuteCommand(Z.id,n)}},lr={type:i.CommandType.COMMAND,id:"sheet.command.set-horizontal-text-align",handler:(s,e)=>{if(!e)return!1;const t=s.get(i.ICommandService),n={unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,style:{type:"ht",value:e.value}};return t.syncExecuteCommand(Z.id,n)}},ur={type:i.CommandType.COMMAND,id:"sheet.command.set-text-wrap",handler:(s,e)=>{if(!e)return!1;const t=s.get(i.ICommandService),n={unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,style:{type:"tb",value:e.value}};return t.syncExecuteCommand(Z.id,n)}},dr={type:i.CommandType.COMMAND,id:"sheet.command.set-text-rotation",handler:(s,e)=>{if(!e)return!1;const t=typeof e.value=="number"?{a:e.value}:{a:0,v:i.BooleanNumber.TRUE},n=s.get(i.ICommandService),o={style:{type:"tr",value:t}};return n.syncExecuteCommand(Z.id,o)}},Ha=(s,e)=>{const r=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId).getSheetBySheetId(e.subUnitId).getConfig().tabColor;return{...i.Tools.deepClone(e),color:r}},Lt={id:"sheet.mutation.set-tab-color",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getSheetBySheetId(e.subUnitId);return n?(n.getConfig().tabColor=e.color,!0):!1}},cr={type:i.CommandType.COMMAND,id:"sheet.command.set-tab-color",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=U(s.get(i.IUniverInstanceService));if(!o)return!1;const{unitId:r,subUnitId:a}=o,l={color:e.value,unitId:r,subUnitId:a},u=Ha(s,l);return t.syncExecuteCommand(Lt.id,l)?(n.pushUndoRedo({unitID:r,undoMutations:[{id:Lt.id,params:u}],redoMutations:[{id:Lt.id,params:l}]}),!0):!1}},ys={id:"sheet.mutation.set-workbook-name",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService).getUnit(e.unitId,i.UniverInstanceType.UNIVER_SHEET);return t?(t.setName(e.name),!0):!1}},_s={type:i.CommandType.COMMAND,id:"sheet.command.set-workbook-name",handler:async(s,e)=>{var d;if(!s.get(i.IUniverInstanceService).getUnit(e.unitId,i.UniverInstanceType.UNIVER_SHEET))return!1;const r=s.get(g.SheetInterceptorService).onCommandExecute({id:_s.id,params:e}),a={name:e.name,unitId:e.unitId},l=[...(d=r.preRedos)!=null?d:[],{id:ys.id,params:a},...r.redos],u=s.get(i.ICommandService);return i.sequenceExecute(l,u).result}},Ct={id:"sheet.operation.set-worksheet-active",type:i.CommandType.OPERATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getWorksheets();for(const[,o]of n)if(o.getSheetId()===e.subUnitId)return t.setActiveSheet(o),!0;return!1}},ja=4,bs={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-activate",handler:(s,e,t)=>{const n=s.get(i.ICommandService),o=U(s.get(i.IUniverInstanceService),e);if(!o)return!1;const{unitId:r,subUnitId:a}=o;return new Promise(l=>{setTimeout(()=>{const u=n.syncExecuteCommand(Ct.id,{unitId:r,subUnitId:a},t);l(u)},ja)})}},Ts=(s,e)=>{const{unitId:t,subUnitId:n,ranges:o}=s,r={},a=e.getColumnManager();for(let l=0;l<o.length;l++){const u=o[l];for(let d=u.startColumn;d<u.endColumn+1;d++){const c=a.getColumnOrCreate(d);r[d]=c.w}}return{unitId:t,subUnitId:n,ranges:o,colWidth:r}},ke={id:"sheet.mutation.set-worksheet-col-width",type:i.CommandType.MUTATION,handler:(s,e)=>{var u;const t=s.get(i.IUniverInstanceService),n=U(t,e);if(!n)return!1;const{worksheet:o}=n,r=o.getConfig().defaultColumnWidth,a=o.getColumnManager(),l=e.ranges;for(let d=0;d<l.length;d++){const c=l[d];for(let m=c.startColumn;m<c.endColumn+1;m++){if(!o.getColVisible(m))continue;const R=a.getColumnOrCreate(m);typeof e.colWidth=="number"?R.w=e.colWidth:R.w=(u=e.colWidth[m])!=null?u:r}}return!0}},dn={type:i.CommandType.COMMAND,id:"sheet.command.delta-column-width",handler:async(s,e)=>{const n=s.get(g.SheetsSelectionsService).getCurrentSelections();if(!(n!=null&&n.length))return!1;const o=s.get(i.ICommandService),r=s.get(i.IUndoRedoService),a=U(s.get(i.IUniverInstanceService));if(!a)return!1;const{worksheet:l,unitId:u,subUnitId:d}=a,{anchorCol:c,deltaX:m}=e,R=l.getColumnWidth(c)+m,S=n.length===1&&n[0].range.rangeType===i.RANGE_TYPE.ALL,C=n.filter(k=>k.range.rangeType===i.RANGE_TYPE.COLUMN),v=S?i.RANGE_TYPE.ALL:C.some(({range:k})=>{const{startColumn:E,endColumn:T}=k;return E<=c&&c<=T})?i.RANGE_TYPE.COLUMN:i.RANGE_TYPE.NORMAL;let I;if(v===i.RANGE_TYPE.ALL){const k=l.getRowCount(),E=new Array(l.getColumnCount()).fill(void 0).map((T,P)=>({startRow:0,endRow:k-1,startColumn:P,endColumn:P}));I={subUnitId:d,unitId:u,colWidth:R,ranges:E}}else v===i.RANGE_TYPE.COLUMN?I={subUnitId:d,unitId:u,ranges:C.map(k=>i.Rectangle.clone(k.range)),colWidth:R}:I={subUnitId:d,unitId:u,colWidth:R,ranges:[{startRow:0,endRow:l.getMaxRows()-1,startColumn:c,endColumn:c}]};const{undos:p,redos:w}=s.get(g.SheetInterceptorService).onCommandExecute({id:dn.id,params:I}),M=Ts(I,l),y=o.syncExecuteCommand(ke.id,I),b=i.sequenceExecute([...w],o);return y&&b.result&&r.pushUndoRedo({unitID:u,undoMutations:[{id:ke.id,params:M},...p],redoMutations:[{id:ke.id,params:I},...w]}),!0}},Vt={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-col-width",handler:(s,e)=>{var p,w,M,y;const t=s.get(g.SheetsSelectionsService),n=s.get(i.ICommandService),o=s.get(i.IUndoRedoService),r=s.get(g.SheetInterceptorService),a=(p=e==null?void 0:e.ranges)!=null&&p.length?e.ranges:(w=t.getCurrentSelections())==null?void 0:w.map(b=>b.range);if(!(a!=null&&a.length))return!1;const l=U(s.get(i.IUniverInstanceService),e);if(!l)return!1;const{subUnitId:u,unitId:d,worksheet:c}=l,m={subUnitId:u,unitId:d,ranges:a,colWidth:e.value},h=Ts(m,c),R=n.syncExecuteCommand(ke.id,m),{undos:S,redos:C}=s.get(g.SheetInterceptorService).onCommandExecute({id:Vt.id,params:m}),v=r.onCommandExecute({id:Vt.id,params:m}),I=i.sequenceExecute([...C,...v.redos],n);return R&&I.result?(o.pushUndoRedo({unitID:d,undoMutations:[...(M=v.preUndos)!=null?M:[],{id:ke.id,params:h},...S],redoMutations:[...(y=v.preRedos)!=null?y:[],{id:ke.id,params:m},...C]}),!0):!1}};i.CommandType.COMMAND;const ft={id:"sheet.mutation.set-worksheet-default-style",type:i.CommandType.MUTATION,handler:(s,e)=>{const{defaultStyle:t}=e,n=s.get(i.IUniverInstanceService),o=U(n);if(!o)return!1;const{worksheet:r}=o;return r?(r.setDefaultCellStyle(t),!0):!1}},mr=(s,e)=>{const t=Ge(s.get(i.IUniverInstanceService),e);if(!t)throw new Error("[SetWorksheetDefaultStyleMutationFactory]: worksheet is null error!");const{worksheet:n}=t;return{unitId:e.unitId,subUnitId:n.getSheetId(),defaultStyle:n.getDefaultCellStyle()}},hr={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-default-style",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),{unitId:o}=e,r=mr(s,e);return t.syncExecuteCommand(ft.id,e)?(n.pushUndoRedo({unitID:o,undoMutations:[{id:ft.id,params:r}],redoMutations:[{id:ft.id,params:e}]}),!0):!1}},gr=(s,e)=>{const t=Ge(s.get(i.IUniverInstanceService),e);if(!t)throw new Error("[SetWorksheetHideMutationFactory]: worksheet is null error!");const{worksheet:n}=t;return{hidden:n.isSheetHidden(),unitId:e.unitId,subUnitId:n.getSheetId()}},$e={id:"sheet.mutation.set-worksheet-hidden",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(t==null)return!1;const n=t.getSheetBySheetId(e.subUnitId);return n?(n.getConfig().hidden=e.hidden,!0):!1}},Rr={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-hidden",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.ErrorService),r=s.get(i.LocaleService),a=U(s.get(i.IUniverInstanceService),e);if(!a)return!1;const{workbook:l,worksheet:u,unitId:d,subUnitId:c}=a;if(u.getConfig().hidden===i.BooleanNumber.TRUE)return!1;const h={unitId:d,subUnitId:c,hidden:i.BooleanNumber.TRUE},R=gr(s,h);return l.getSheets().filter(I=>I.getConfig().hidden===i.BooleanNumber.FALSE).length===1?(o.emit(r.t("sheets.info.hideSheet")),!1):t.syncExecuteCommand($e.id,h)?(n.pushUndoRedo({unitID:d,undoMutations:[{id:$e.id,params:R}],redoMutations:[{id:$e.id,params:h}]}),!0):!1}},Fa=(s,e)=>{const t=Ge(s.get(i.IUniverInstanceService),e);if(!t)throw new Error("[SetWorksheetNameMutationFactory]: worksheet is null error!");const{worksheet:n}=t;return{unitId:e.unitId,name:n.getName(),subUnitId:n.getSheetId()}},$t={id:"sheet.mutation.set-worksheet-name",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(t==null)return!1;const n=t.getSheetBySheetId(e.subUnitId);return n?(n.getConfig().name=e.name,!0):!1}},cn={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-name",handler:(s,e)=>{var S,C;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(g.SheetInterceptorService),r=U(s.get(i.IUniverInstanceService),e);if(!r)return!1;const{unitId:a,subUnitId:l}=r,u={subUnitId:l,name:e.name,unitId:a},d=Fa(s,u),c=o.onCommandExecute({id:cn.id,params:e}),m=[...(S=c.preRedos)!=null?S:[],{id:$t.id,params:u},...c.redos],h=[...(C=c.preUndos)!=null?C:[],{id:$t.id,params:d},...c.undos];return i.sequenceExecute(m,t).result?(n.pushUndoRedo({unitID:a,undoMutations:h,redoMutations:m}),!0):!1}},Ga=(s,e)=>({...i.Tools.deepClone(e),toOrder:e.fromOrder,fromOrder:e.toOrder}),Bt={id:"sheet.mutation.set-worksheet-order",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getConfig();return n.sheetOrder.splice(e.fromOrder,1),n.sheetOrder.splice(e.toOrder,0,e.subUnitId),!0}},Es={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-order",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=U(s.get(i.IUniverInstanceService),e);if(!o)return!1;const{workbook:r,unitId:a,subUnitId:l}=o,d={fromOrder:r.getConfig().sheetOrder.indexOf(l),toOrder:e.order,unitId:a,subUnitId:l},c=Ga(s,d);return t.syncExecuteCommand(Bt.id,d)?(n.pushUndoRedo({unitID:a,undoMutations:[{id:Bt.id,params:c}],redoMutations:[{id:Bt.id,params:d}]}),!0):!1}};class vt{constructor(){f(this,"_model",new Map);f(this,"_pointChange",new A.Subject);f(this,"pointChange$",this._pointChange.asObservable())}addRule(e){this._ensureSubUnitMap(e.unitId).set(e.subUnitId,e),this._pointChange.next(e)}deleteRule(e,t){var o,r,a;const n=(o=this._model.get(e))==null?void 0:o.get(t);n&&((a=(r=this._model)==null?void 0:r.get(e))==null||a.delete(t),this._pointChange.next(n))}getRule(e,t){var n,o;return(o=(n=this._model)==null?void 0:n.get(e))==null?void 0:o.get(t)}toObject(){const e={};return[...this._model.keys()].forEach(n=>{const o=this._model.get(n);o!=null&&o.size&&(e[n]=[],[...o.keys()].forEach(a=>{const l=o.get(a);l&&e[n].push(l)}))}),e}fromObject(e){const t=new Map;Object.keys(e).forEach(n=>{const o=e[n];if(o!=null&&o.length){const r=new Map;o.forEach(a=>{r.set(a.subUnitId,a)}),t.set(n,r)}}),this._model=t}deleteUnitModel(e){this._model.delete(e)}_ensureSubUnitMap(e){let t=this._model.get(e);return t||(t=new Map,this._model.set(e,t)),t}getTargetByPermissionId(e,t){const n=this._model.get(e);if(!n)return null;for(const[o,r]of n)if(r.permissionId===t)return[e,o]}}class Us{constructor(e,t,n){f(this,"type",O.SelectRange);f(this,"subType",_.Delete);f(this,"status",i.PermissionStatus.INIT);f(this,"value",!0);f(this,"id");f(this,"unitId");f(this,"subUnitId");f(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${O.SelectRange}.${_.Delete}.${n}`}}class Ps{constructor(e,t,n){f(this,"type",O.SelectRange);f(this,"subType",_.ManageCollaborator);f(this,"status",i.PermissionStatus.INIT);f(this,"value",!0);f(this,"id");f(this,"unitId");f(this,"subUnitId");f(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${O.SelectRange}.${_.ManageCollaborator}.${n}`}}const se=()=>[Qt,ue,Ps,Us],Be=[_.Edit,_.View,_.ManageCollaborator,_.Delete],za=(s="unitId",e="subUnitId",t="permissionId")=>se().reduce((n,o)=>{const r=new o(s,e,t);return n[r.subType]=r.value,n},{}),It=()=>[re,jn,An,zn,Wn,Hn,tn,Vn,$n,sn,en,Bn,Gn,nn,vo,Yn,Fn,Ln],Sr=[_.Edit,_.Print,_.Comment,_.View,_.Copy,_.Export,_.ManageCollaborator,_.CreateSheet,_.DeleteSheet,_.RenameSheet,_.HideSheet,_.Duplicate,_.Share,_.MoveSheet,_.CopySheet,_.RecoverHistory,_.ViewHistory,_.CreatePermissionObject],oe=()=>[de,Et,ns,Jn],he=()=>[qn,Kn,xn,Xn,Zn,Qn,ts,es,ss,os,Tt,ot,rt,rs],mn=[_.Copy,_.DeleteColumn,_.DeleteRow,_.EditExtraObject,_.Filter,_.InsertColumn,_.InsertRow,_.InsertHyperlink,_.PivotTable,_.SetCellStyle,_.SetCellValue,_.SetColumnStyle,_.SetRowStyle,_.Sort];var Ya=Object.getOwnPropertyDescriptor,qa=(s,e,t,n)=>{for(var o=n>1?void 0:n?Ya(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},He=(s,e)=>(t,n)=>e(t,n,s);const Ka="SHEET_WORKSHEET_PROTECTION_PLUGIN",Ja="SHEET_WORKSHEET_PROTECTION_POINT_PLUGIN";g.WorksheetPermissionService=class extends i.RxDisposable{constructor(e,t,n,o,r,a,l,u){super(),this._permissionService=e,this._univerInstanceService=t,this._injector=n,this._worksheetProtectionRuleModel=o,this._worksheetProtectionPointRuleModel=r,this._resourceManagerService=a,this._rangeProtectionRuleModel=l,this._logService=u,this._init(),this._initRuleChange(),this._initRuleSnapshot(),this._initPointSnapshot()}_init(){const e=t=>{const n=t.getUnitId(),o=r=>{const a=r.getSheetId();[...oe(),...he()].forEach(l=>{const u=new l(n,a);this._permissionService.addPermissionPoint(u)}),this._logService.debug("[WorksheetPermissionService]","Initialization completed",n,a)};t.getSheets().forEach(r=>{o(r)}),t.sheetCreated$.subscribe(r=>{o(r)}),t.sheetDisposed$.subscribe(r=>{const a=r.getSheetId();this._rangeProtectionRuleModel.getSubunitRuleList(n,a).forEach(u=>{[...se()].forEach(d=>{const c=new d(n,a,u.permissionId);this._permissionService.deletePermissionPoint(c.id)})}),[...oe(),...he()].forEach(u=>{const d=new u(n,a);this._permissionService.deletePermissionPoint(d.id)})})};this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).forEach(t=>{e(t)}),this._univerInstanceService.getTypeOfUnitAdded$(i.UniverInstanceType.UNIVER_SHEET).pipe(yt.takeUntil(this.dispose$)).subscribe(e),this._univerInstanceService.getTypeOfUnitDisposed$(i.UniverInstanceType.UNIVER_SHEET).pipe(yt.takeUntil(this.dispose$)).subscribe(t=>{t.getSheets().forEach(n=>{const o=t.getUnitId(),r=n.getSheetId();oe().forEach(a=>{const l=new a(o,r);this._permissionService.deletePermissionPoint(l.id)})})})}_initRuleChange(){this.disposeWithMe(this._worksheetProtectionRuleModel.ruleChange$.subscribe(e=>{switch(e.type){case"add":break;case"delete":{oe().forEach(t=>{const n=new t(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(n.id,!0)});break}case"set":{oe().forEach(t=>{const n=new t(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(n.id,e.rule)});break}}}))}_initRuleSnapshot(){const e=()=>{const n=this._worksheetProtectionRuleModel.toObject();return JSON.stringify(n)},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e,parseJson:t,pluginName:Ka,businesses:[Zt.UNIVER_SHEET],onLoad:(n,o)=>{this._worksheetProtectionRuleModel.fromObject(o),Object.keys(o).forEach(r=>{oe().forEach(a=>{const l=new a(n,r);l.value=!1,this._permissionService.addPermissionPoint(l)})}),this._worksheetProtectionRuleModel.changeRuleInitState(!0)},onUnLoad:n=>{const o=this._univerInstanceService.getUnit(n);o&&(o.getSheets().forEach(r=>{const a=r.getSheetId();[...oe(),...he()].forEach(l=>{const u=new l(n,a);this._permissionService.deletePermissionPoint(u.id)})}),It().forEach(r=>{const a=new r(n);this._permissionService.deletePermissionPoint(a.id)})),this._worksheetProtectionRuleModel.deleteUnitModel(n)}}))}_initPointSnapshot(){const e=()=>{const n=this._worksheetProtectionPointRuleModel.toObject();return JSON.stringify(n)},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e,parseJson:t,pluginName:Ja,businesses:[Zt.UNIVER_SHEET],onLoad:(n,o)=>{this._worksheetProtectionPointRuleModel.fromObject(o),Object.keys(o).forEach(r=>{he().forEach(a=>{const l=new a(n,r);this._permissionService.addPermissionPoint(l)})})},onUnLoad:n=>{this._worksheetProtectionPointRuleModel.deleteUnitModel(n)}}))}},g.WorksheetPermissionService=qa([He(0,i.Inject(i.IPermissionService)),He(1,i.Inject(i.IUniverInstanceService)),He(2,i.Inject(i.Injector)),He(3,i.Inject(pe)),He(4,i.Inject(vt)),He(5,i.Inject(i.IResourceManagerService)),He(6,i.Inject(K)),He(7,i.Inject(i.ILogService))],g.WorksheetPermissionService);const hn={id:"sheet.mutation.set-worksheet-permission-points",type:i.CommandType.MUTATION,handler:(s,e)=>{const{rule:t}=e;return s.get(vt).addRule(t),!0}},Cr={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-permission-points",async handler(s,e){if(!e)return!1;const t=s.get(i.ICommandService),{rule:n}=e;return t.executeCommand(hn.id,{rule:n,unitId:n.unitId,subUnitId:n.subUnitId}),!0}},fr={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-protection",async handler(s,e){if(!e)return!1;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),{rule:o,permissionId:r,oldRule:a}=e,{unitId:l,subUnitId:u}=o,d={...o,permissionId:r};if(await t.executeCommand(xe.id,{unitId:l,subUnitId:u,newRule:d})){const m=[{id:xe.id,params:{unitId:l,subUnitId:u,newRule:d}}],h=[{id:xe.id,params:{unitId:l,subUnitId:u,rule:a}}];n.pushUndoRedo({unitID:l,redoMutations:m,undoMutations:h})}return!0}},xa=2e3,vr=(s,e)=>{const{unitId:t,subUnitId:n,ranges:o}=s,r={},a=e.getRowManager();for(const{startRow:l,endRow:u}of o)for(let d=l;d<u+1;d++){const c=a.getRowOrCreate(d);r[d]=c.h}return{unitId:t,subUnitId:n,ranges:o,rowHeight:r}},ks=(s,e)=>{const{unitId:t,subUnitId:n,ranges:o}=s,r={},a=e.getRowManager();for(const{startRow:l,endRow:u}of o)for(let d=l;d<=u;d++){const c=a.getRowOrCreate(d);r[d]=c.ia}return{unitId:t,subUnitId:n,ranges:o,autoHeightInfo:r}},Xa=(s,e)=>{const{unitId:t,subUnitId:n,rowsAutoHeightInfo:o}=s,r=[],a=e.getRowManager();for(const l of o){const{row:u}=l,{ah:d}=a.getRowOrCreate(u);r.push({row:u,autoHeight:d})}return{unitId:t,subUnitId:n,rowsAutoHeightInfo:r}},Ne={id:"sheet.mutation.set-worksheet-row-height",type:i.CommandType.MUTATION,handler:(s,e)=>{var d;const{ranges:t,rowHeight:n}=e,o=s.get(i.IUniverInstanceService),r=U(o,e);if(!r)return!1;const{worksheet:a}=r,l=a.getRowManager(),u=a.getConfig().defaultRowHeight;for(const{startRow:c,endRow:m}of t)for(let h=c;h<=m;h++){const R=l.getRowOrCreate(h);typeof n=="number"?R.h=n:R.h=(d=n[h])!=null?d:u,R.h=Math.min(xa,R.h)}return!0}},ge={id:"sheet.mutation.set-worksheet-row-is-auto-height",type:i.CommandType.MUTATION,handler:(s,e)=>{var l;const{ranges:t,autoHeightInfo:n}=e,o=s.get(i.IUniverInstanceService),r=U(o,e);if(!r)return!1;const a=r.worksheet.getRowManager();for(const{startRow:u,endRow:d}of t)for(let c=u;c<=d;c++){const m=a.getRowOrCreate(c);typeof n=="number"?m.ia=n:m.ia=(l=n[c])!=null?l:void 0}return!0}},Ns={id:"sheet.mutation.set-worksheet-row-auto-height",type:i.CommandType.MUTATION,handler:(s,e)=>{const{rowsAutoHeightInfo:t}=e,n=s.get(i.IUniverInstanceService),o=U(n,e);if(!o)return!1;const r=o.worksheet.getRowManager();for(const{row:a,autoHeight:l}of t){const u=r.getRowOrCreate(a);u.ah=l}return!0}},gn={type:i.CommandType.COMMAND,id:"sheet.command.delta-row-height",handler:async(s,e)=>{var T,P;const n=s.get(g.SheetsSelectionsService).getCurrentSelections(),o=s.get(g.SheetInterceptorService);if(!(n!=null&&n.length))return!1;const r=U(s.get(i.IUniverInstanceService));if(!r)return!1;const{worksheet:a,subUnitId:l,unitId:u}=r,{anchorRow:d,deltaY:c}=e,h=a.getRowHeight(d)+c,R=n.length===1&&n[0].range.rangeType===i.RANGE_TYPE.ALL,S=n.filter(N=>N.range.rangeType===i.RANGE_TYPE.ROW),C=R?i.RANGE_TYPE.ALL:S.some(({range:N})=>{const{startRow:W,endRow:V}=N;return W<=d&&d<=V})?i.RANGE_TYPE.ROW:i.RANGE_TYPE.NORMAL;let v;if(C===i.RANGE_TYPE.ALL){const N=a.getColumnCount(),W=new Array(a.getRowCount()).fill(void 0).map((V,$)=>({startRow:$,endRow:$,startColumn:0,endColumn:N-1}));v={subUnitId:l,unitId:u,rowHeight:h,ranges:W}}else C===i.RANGE_TYPE.ROW?v={subUnitId:l,unitId:u,ranges:S.map(N=>i.Rectangle.clone(N.range)),rowHeight:h}:v={subUnitId:l,unitId:u,rowHeight:h,ranges:[{startRow:d,endRow:d,startColumn:0,endColumn:a.getMaxColumns()-1}]};const I=vr(v,a),p={unitId:u,subUnitId:l,ranges:v.ranges,autoHeightInfo:i.BooleanNumber.FALSE},w=ks(p,a),M=s.get(i.ICommandService),y=s.get(i.IUndoRedoService),b=o.onCommandExecute({id:gn.id,params:v}),k=i.sequenceExecute([{id:Ne.id,params:v},{id:ge.id,params:p}],M),E=i.sequenceExecute([...b.redos],M);return k.result&&E.result?(y.pushUndoRedo({unitID:u,undoMutations:[...(T=b.preUndos)!=null?T:[],{id:Ne.id,params:I},{id:ge.id,params:w},...b.undos],redoMutations:[...(P=b.preRedos)!=null?P:[],{id:Ne.id,params:v},{id:ge.id,params:p},...b.redos]}),!0):!1}},Rn={type:i.CommandType.COMMAND,id:"sheet.command.set-row-height",handler:(s,e)=>{var w,M,y,b;const t=s.get(g.SheetsSelectionsService),n=s.get(i.ICommandService),o=s.get(i.IUndoRedoService),r=s.get(i.IUniverInstanceService),a=s.get(g.SheetInterceptorService),l=(w=e==null?void 0:e.ranges)!=null&&w.length?e.ranges:(M=t.getCurrentSelections())==null?void 0:M.map(k=>k.range);if(!(l!=null&&l.length))return!1;const u=U(r,e);if(!u)return!1;const{unitId:d,subUnitId:c,worksheet:m}=u,h={subUnitId:c,unitId:d,ranges:l,rowHeight:e.value},R=vr(h,m),S={unitId:d,subUnitId:c,ranges:h.ranges,autoHeightInfo:i.BooleanNumber.FALSE},C=ks(S,m),v=i.sequenceExecute([{id:Ne.id,params:h},{id:ge.id,params:S}],n),I=a.onCommandExecute({id:Rn.id,params:h}),p=i.sequenceExecute([...I.redos],n);return v.result&&p.result?(o.pushUndoRedo({unitID:d,undoMutations:[...(y=I.preRedos)!=null?y:[],{id:Ne.id,params:R},{id:ge.id,params:C},...I.undos],redoMutations:[...(b=I.preRedos)!=null?b:[],{id:Ne.id,params:h},{id:ge.id,params:S},...I.redos]}),!0):!1}},Sn={type:i.CommandType.COMMAND,id:"sheet.command.set-row-is-auto-height",handler:(s,e)=>{var I,p;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(g.SheetsSelectionsService),r=s.get(i.IUniverInstanceService),a=U(r,e);if(!a)return!1;const{unitId:l,subUnitId:u,worksheet:d}=a,c=(I=e==null?void 0:e.ranges)!=null&&I.length?e.ranges:(p=o.getCurrentSelections())==null?void 0:p.map(w=>w.range);if(!(c!=null&&c.length))return!1;const m={unitId:l,subUnitId:u,ranges:c,autoHeightInfo:i.BooleanNumber.TRUE},h=ks(m,d),R=t.syncExecuteCommand(ge.id,m),{undos:S,redos:C}=s.get(g.SheetInterceptorService).onCommandExecute({id:Sn.id,params:m}),v=i.sequenceExecute([...C],t);return R&&v.result?(n.pushUndoRedo({unitID:l,undoMutations:[{id:ge.id,params:h},...S],redoMutations:[{id:ge.id,params:m},...C]}),!0):!1}},Os={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-show",handler:(s,e)=>{const{unitId:t,subUnitId:n}=e,o=s.get(i.ICommandService),r=s.get(i.IUndoRedoService),a=s.get(i.IUniverInstanceService);if(!U(s.get(i.IUniverInstanceService)))return!1;const u=a.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!u)return!1;const d=u.getSheetBySheetId(n);if(!d||d.getConfig().hidden===i.BooleanNumber.FALSE)return!1;const m={unitId:t,subUnitId:n,hidden:i.BooleanNumber.FALSE},h=gr(s,m),R=o.syncExecuteCommand($e.id,m),S={unitId:t,subUnitId:n},C=o.syncExecuteCommand(Ct.id,S);return R&&C?(r.pushUndoRedo({unitID:t,undoMutations:[{id:$e.id,params:h}],redoMutations:[{id:$e.id,params:m}]}),!0):!1}};var Ir=(s=>(s[s.Tab=1]="Tab",s[s.Comma=2]="Comma",s[s.Semicolon=4]="Semicolon",s[s.Space=8]="Space",s[s.Custom=16]="Custom",s))(Ir||{});class Za{constructor(){f(this,"_tabCount",0);f(this,"_commaCount",0);f(this,"_semicolonCount",0);f(this,"_spaceCount",0)}add(e){switch(e){case" ":this._tabCount++;break;case",":this._commaCount++;break;case";":this._semicolonCount++;break;case" ":this._spaceCount++;break}}update(e){e&&typeof e=="string"&&(e.includes(" ")&&this._tabCount++,e.includes(",")&&this._commaCount++,e.includes(";")&&this._semicolonCount++,e.trim().includes(" ")&&this._spaceCount++)}getDelimiter(){const e=Math.max(this._tabCount,this._commaCount,this._semicolonCount,this._spaceCount);return e===0||e===this._tabCount?1:e===this._commaCount?2:e===this._semicolonCount?4:e===this._spaceCount?8:1}}function Qa(s,e,t){const n=[];t!==void 0&&(s&16)>0&&n.push(t),(s&1)>0&&n.push(" "),(s&2)>0&&n.push(","),(s&4)>0&&n.push(";"),(s&8)>0&&n.push(" ");let o="";for(const a of n)o+=el(a);let r="[".concat(o,"]");return e&&(r+="+"),new RegExp(r)}function el(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const tl=s=>{var t;return((t=s.body)==null?void 0:t.dataStream.replace(/\r\n$/,""))||""};function nl(s){if(s!=null){if(s.p)return tl(s.p);if(s.v&&typeof s.v=="string")return s.v;if(s.t&&(s.t===i.CellValueType.FORCE_STRING||s.t===i.CellValueType.STRING))return String(s.v)}}function pr(s,e,t,n,o=!1){const r=i.Range.transformRange(e,s),{startColumn:a,startRow:l,endColumn:u,endRow:d}=r;if(a!==u)throw new Error("The range must be in the same column.");if(t&&(t&16)>0&&(n===void 0||n.length!==1))throw new Error("The custom delimiter must a character.");const c=t===void 0,m=c?new Za:null,h=[];for(let w=l;w<=d;w++){const M=s.getCell(w,a),y=nl(M);h.push(y),m&&m.update(y)}const R=c?m.getDelimiter():t,S=Qa(R,o,n);let C=-1,v=0,I=0;const p=[];for(const w of h){if(w!==void 0){const M=String(w).split(S);C<0?C=M.length:C=Math.max(C,M.length),p.push(M),v=I}else p.push(void 0);I++}return{rs:p,maxLength:C===-1?0:C,lastRow:v}}const wr={type:i.CommandType.COMMAND,id:"sheet.command.split-text-to-columns",handler:(s,e)=>{const{unitId:t,subUnitId:n,range:o,delimiter:r,customDelimiter:a,treatMultipleDelimitersAsOne:l}=e,u=s.get(i.ICommandService),d=s.get(i.IUniverInstanceService),c=s.get(i.IUndoRedoService);if(!U(s.get(i.IUniverInstanceService)))return!1;const h=d.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!h)return!1;const R=h.getSheetBySheetId(n);if(!R)return!1;const{lastRow:S,rs:C,maxLength:v}=pr(R,o,r,a,l),I=R.getColumnCount(),{startColumn:p}=i.Range.transformRange(o,R);if(o.startColumn!==o.endColumn)return!1;const w=[],M=[],y=p+v+1-I;if(y>0){const N={unitId:t,subUnitId:n,range:{startRow:0,endRow:R.getRowCount()-1,startColumn:I-1,endColumn:I-1+y}};w.push({id:Re.id,params:N});const W=on(s,N);M.push({id:ce.id,params:W})}const b={startRow:o.startRow,endRow:S,startColumn:p,endColumn:p+v},k=new i.ObjectMatrix;for(let N=b.startRow;N<=b.endRow;N++)for(let W=b.startColumn;W<=b.endColumn;W++){const V=C[N-b.startRow];W===0&&(V==null?void 0:V.length)===1?k.setValue(N,W,R.getCell(N,W)):k.setValue(N,W,{v:(V==null?void 0:V[W-b.startColumn])||null,p:null,f:null,si:null,custom:null})}const E={unitId:t,subUnitId:n,cellValue:k.clone()},T=le(s,E);return w.push({id:H.id,params:E}),M.unshift({id:H.id,params:T}),i.sequenceExecute(w,u).result?(c.pushUndoRedo({unitID:t,undoMutations:M,redoMutations:w}),!0):!1}},Mr={id:"sheet.command.toggle-cell-checkbox",type:i.CommandType.COMMAND,handler:(s,e)=>{if(!e)return!1;const{unitId:t,subUnitId:n,row:o,col:r,paragraphIndex:a}=e,u=s.get(i.IUniverInstanceService).getUnit(t,i.UniverInstanceType.UNIVER_SHEET),d=u==null?void 0:u.getSheetBySheetId(n),c=s.get(i.IUndoRedoService),m=s.get(i.ICommandService);if(!d)return!1;const h=d.getCell(o,r);if(!(h!=null&&h.p))return!1;const R=i.Tools.deepClone(h.p),S=new i.DocumentDataModel(R),C=i.BuildTextUtils.paragraph.bullet.toggleChecklist({document:S,paragraphIndex:a});if(!C)return!1;i.TextX.apply(S.getBody(),C.serialize());const v={unitId:t,subUnitId:n,cellValue:{[o]:{[r]:{p:R,t:i.CellValueType.STRING}}}},I={id:H.id,params:v},p=le(s,v),w={id:H.id,params:p},M=[I],y=[w];return c.pushUndoRedo({redoMutations:M,undoMutations:y,unitID:t}),m.syncExecuteCommand(I.id,I.params)}},pt={id:"sheet.mutation.toggle-gridlines",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=U(s.get(i.IUniverInstanceService),e);if(!t)return!1;const{worksheet:n}=t,o=n.getConfig();return o.showGridlines=e.showGridlines,!0}},yr={type:i.CommandType.COMMAND,id:"sheet.command.toggle-gridlines",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=U(o);if(!r)return!1;const{worksheet:a}=r,l=a.getConfig().showGridlines;if(l===(e==null?void 0:e.showGridlines))return!1;const{unitId:u,subUnitId:d}=r,c={showGridlines:l===i.BooleanNumber.TRUE?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE,unitId:u,subUnitId:d},m={showGridlines:l,unitId:u,subUnitId:d};return t.syncExecuteCommand(pt.id,c)?(n.pushUndoRedo({unitID:u,undoMutations:[{id:pt.id,params:m}],redoMutations:[{id:pt.id,params:c}]}),!0):!1}},_r={id:"sheet.command.unregister-worksheet-range-theme-style",type:i.CommandType.COMMAND,handler:(s,e)=>{var h;if(!e)return!1;const{unitId:t,themeName:n}=e,o=s.get(i.IUniverInstanceService),r=s.get(i.ICommandService),a=s.get(i.IUndoRedoService),l=s.get(we);if(!U(o))return!1;const d={unitId:t,themeName:n},c={unitId:t,themeName:n,rangeThemeStyleJson:(h=l.getRangeThemeStyle(t,n))==null?void 0:h.toJson()};return r.syncExecuteCommand(lt.id,e)&&a.pushUndoRedo({unitID:t,undoMutations:[{id:lt.id,params:c}],redoMutations:[{id:rn.id,params:d}]}),!0}},br={id:"sheet.mutation.empty",type:i.CommandType.MUTATION,handler:()=>!0},Tr=s=>{const e=new i.ObjectMatrix;return s.forEach(t=>{i.Range.foreach(t,(n,o)=>{e.setValue(n,o,1)})}),e.forValue((t,n)=>{const o=e.getValue(t-1,n);o&&e.setValue(t,n,o+1)}),e},Er=s=>{const e=s;return e.forValue((t,n)=>{const o=s.getValue(t-1,n);o&&e.setValue(t,n,o+1)}),e},Ur=s=>{const e={area:0},t=(n,o)=>e.area<n?(e.area=n,e.range=o,!0):!1;return s.forValue((n,o,r)=>{let a=1,l=r;t(a*l,{startRow:n-l+1,endRow:n,startColumn:o,endColumn:o});const u={startRow:n-l+1,endRow:n,startColumn:0,endColumn:o};for(let d=o-1;d>=0&&s.getValue(n,d);d--){l=Math.min(s.getValue(n,d)||0,l),a++;const c=l*a;u.startColumn=d,u.startRow=n-l+1,t(c,u)}}),e},sl=(s,e)=>{i.Range.foreach(e,(t,n)=>{s.realDeleteValue(t,n)});for(let t=e.startColumn;t<=e.endColumn;t++){const n=e.endRow+1;if(s.getValue(n,t)>0){s.setValue(n,t,1);let r=n+1;for(;s.getValue(r,t)>0;)s.setValue(r,t,s.getValue(r-1,t)+1),r++}}return s},Ds=s=>{const e=[];let t=Ur(s);for(;t.area>0;)t.range&&(e.push(t.range),sl(s,t.range)),t=Ur(s);return e},As=s=>{const e=Tr(s);return Ds(e)};class ol{constructor(){f(this,"_matrix",new i.ObjectMatrix)}add(...e){return e.forEach(t=>{i.Range.foreach(t,(n,o)=>{this._matrix.setValue(n,o,1)})}),this}subtract(...e){return e.forEach(t=>{i.Range.foreach(t,(n,o)=>{this._matrix.realDeleteValue(n,o)})}),this}merge(){const e=Er(this._matrix);return Ds(e)}}const Xe=i.createIdentifier("INumfmtService"),rl=(s,e)=>{const t=s.get(Xe),{values:n,unitId:o,subUnitId:r}=e,a=[],l=[];Object.keys(n).forEach(d=>{n[d].ranges.forEach(m=>{i.Range.foreach(m,(h,R)=>{const S=t.getValue(o,r,h,R);S?a.push({pattern:S.pattern,row:h,col:R}):l.push({startColumn:R,endColumn:R,startRow:h,endRow:h})})})});const u=[];if(a.length){const d=fn(o,r,a);Object.keys(d.values).forEach(c=>{const m=d.values[c];m.ranges=As(m.ranges)}),u.push({id:Cn.id,params:fn(o,r,a)})}return l.length&&u.push({id:Ws.id,params:{unitId:o,subUnitId:r,ranges:l}}),u},Cn={id:"sheet.mutation.set.numfmt",type:i.CommandType.MUTATION,handler:(s,e)=>{if(!e)return!1;const{values:t,refMap:n}=e,o=s.get(Xe),r=e.unitId,a=e.subUnitId,l=Object.keys(t).reduce((u,d)=>{const c=n[d],m=t[d].ranges;return c&&u.push({...c,ranges:m}),u},[]);return o.setValues(r,a,l),!0}},Ws={id:"sheet.mutation.remove.numfmt",type:i.CommandType.MUTATION,handler:(s,e)=>{if(!e)return!1;const{unitId:t,subUnitId:n,ranges:o}=e;return s.get(Xe).deleteValues(t,n,o),!0}},il=(s,e)=>{const t=s.get(Xe),{ranges:n,unitId:o,subUnitId:r}=e,a=[];if(n.forEach(u=>{i.Range.foreach(u,(d,c)=>{const m=t.getValue(o,r,d,c);m&&a.push({pattern:m.pattern,row:d,col:c})})}),!a.length)return[];const l=fn(o,r,a);return Object.keys(l.values).forEach(u=>{const d=l.values[u];d.ranges=As(d.ranges)}),[{id:Cn.id,params:l}]},fn=(s,e,t)=>{const n=Wi(t,"pattern"),o={},r={},a=Li();return Object.keys(n).forEach(l=>{const u=n[l],d=a();o[d]={pattern:l},u.forEach(c=>{r[d]||(r[d]={ranges:[]}),r[d].ranges.push(i.cellToRange(c.row,c.col))})}),{unitId:s,subUnitId:e,refMap:o,values:r}},Pr={id:"sheet.operation.scroll-to-cell",type:i.CommandType.OPERATION,handler:()=>!0},kr="ONLY_REGISTER_FORMULA_RELATED_MUTATIONS_KEY",Nr="maxCellsPerSheet",al=3e6;var ll=Object.getOwnPropertyDescriptor,ul=(s,e,t,n)=>{for(var o=n>1?void 0:n?ll(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Ls=(s,e)=>(t,n)=>e(t,n,s);let vn=class extends i.Disposable{constructor(s,e,t){var o;super(),this._commandService=s,this._configService=e,this._dataSyncPrimaryController=t,[H,Re,ye,st,Ae,Ue,Pe,ce,Se,ze,G,Ws,F,ys,$t,Cn,Dt,br,St,Rt,ct,mt].forEach(r=>{var a;this._commandService.registerCommand(r),(a=this._dataSyncPrimaryController)==null||a.registerSyncingMutations(r)}),((o=this._configService.getConfig(kr))!=null?o:!1)||[Kt,Jt,xt,Dn,qe,Ke,dn,gn,No,ko,cs,Le,at,Ut,Uo,Eo,ds,We,Oo,kt,Ye,Pt,gs,Ot,Ss,Nt,an,ln,Bo,ir,or,rr,Yo,zo,ut,Fo,Go,vs,Vt,Ko,dt,xo,Ve,Xo,lr,it,Rn,Ms,tr,gt,fs,ws,At,Wt,Z,cr,Lt,sr,dr,ur,ar,_s,bs,Ct,Rr,$e,cn,Es,Bt,Ns,Ne,Sn,ge,ke,Y,Pr,bo,ms,Is,Os,yr,pt,Zo,ht,Cr,Oe,xe,Fe,hn,Js,Qo,Mo,xs,yo,fr,ae,Ie,X,Mr,ft,hr,wr,nt,tt,rn,lt,_r,$o,io,_o].forEach(r=>this.disposeWithMe(this._commandService.registerCommand(r))),this._configService.setConfig(Nr,al)}};vn=ul([Ls(0,i.ICommandService),Ls(1,i.IConfigService),Ls(2,i.Optional(mi.DataSyncPrimaryController))],vn);var dl=Object.getOwnPropertyDescriptor,cl=(s,e,t,n)=>{for(var o=n>1?void 0:n?dl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Or=(s,e)=>(t,n)=>e(t,n,s);let In=class extends i.Disposable{constructor(s,e){super(),this._univerInstanceService=s,this._commandService=e,this._initialize()}_initialize(){this.disposeWithMe(this._commandService.onCommandExecuted(s=>{if(s.id!==z.SetFormulaCalculationResultMutation.id)return;const e=s.params,{unitData:t}=e,n=Object.keys(t),o=[];for(let a=0;a<n.length;a++){const l=n[a],u=t[l];if(u==null)continue;const d=Object.keys(u);for(let c=0;c<d.length;c++){const m=d[c],h=u[m];if(h==null)continue;const R=this._getMergedCellData(l,m,h),S={subUnitId:m,unitId:l,cellValue:R};o.push({id:H.id,params:S})}}return o.every(a=>this._commandService.executeCommand(a.id,a.params,{onlyLocal:!0}))}))}_getMergedCellData(s,e,t){const n=this._univerInstanceService.getUniverSheetInstance(s),o=n==null?void 0:n.getStyles(),r=n==null?void 0:n.getSheetBySheetId(e),a=r==null?void 0:r.getCellMatrix(),l=new i.ObjectMatrix(t);return l.forValue((u,d,c)=>{const m=a==null?void 0:a.getValue(u,d),h=z.handleNumfmtInCell(m,c,o);l.setValue(u,d,h)}),l.getMatrix()}};In=cl([Or(0,i.Inject(i.IUniverInstanceService)),Or(1,i.ICommandService)],In);const ml="sheets.config",Dr={};var hl=Object.getOwnPropertyDescriptor,gl=(s,e,t,n)=>{for(var o=n>1?void 0:n?hl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Ar=(s,e)=>(t,n)=>e(t,n,s);const Rl="SHEET_DEFINED_NAME_PLUGIN",Sl="AllDefaultWorkbook";g.DefinedNameDataController=class extends i.Disposable{constructor(e,t){super(),this._definedNamesService=e,this._resourceManagerService=t,this._initialize()}_initialize(){this._initSnapshot()}_initSnapshot(){const e=n=>{const o=this._definedNamesService.getDefinedNameMap(n);return o?JSON.stringify(o):""},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:Rl,businesses:[i.UniverInstanceType.UNIVER_SHEET],toJson:n=>e(n),parseJson:n=>t(n),onUnLoad:n=>{this._definedNamesService.removeUnitDefinedName(n)},onLoad:(n,o)=>{this._definedNamesService.registerDefinedNames(n,o)}}))}},g.DefinedNameDataController=gl([Ar(0,z.IDefinedNamesService),Ar(1,i.IResourceManagerService)],g.DefinedNameDataController);const D={MoveRangeCommandId:fo,InsertRowCommandId:To,InsertColCommandId:Po,RemoveColCommandId:Rs,RemoveRowCommandId:hs,DeleteRangeMoveLeftCommandId:po,DeleteRangeMoveUpCommandId:wo,InsertRangeMoveDownCommandId:ha,InsertRangeMoveRightCommandId:us,MoveColsCommandId:Lo,MoveRowsCommandId:Wo,ReorderRangeCommandId:jo};var L=(s=>(s[s.Set=0]="Set",s[s.Delete=1]="Delete",s[s.HorizontalMove=2]="HorizontalMove",s[s.VerticalMove=3]="VerticalMove",s[s.Unknown=4]="Unknown",s))(L||{});const pn=Number.MAX_SAFE_INTEGER,_e=s=>{const e={...s},t=Number.isNaN(e.startRow)&&Number.isNaN(e.endRow)&&!Number.isNaN(e.startColumn)&&!Number.isNaN(e.endColumn),n=Number.isNaN(e.startColumn)&&Number.isNaN(e.endColumn)&&!Number.isNaN(e.startRow)&&!Number.isNaN(e.endRow);return(e.rangeType===i.RANGE_TYPE.COLUMN||t)&&(e.startRow=0,e.endRow=pn),(e.rangeType===i.RANGE_TYPE.ROW||n)&&(e.startColumn=0,e.endColumn=pn),e.rangeType===i.RANGE_TYPE.ALL&&(e.startColumn=0,e.endColumn=pn,e.startRow=0,e.endRow=pn),e},ie=s=>{let e=s.rangeType;return s.rangeType===i.RANGE_TYPE.COLUMN?e=i.RANGE_TYPE.ROW:s.rangeType===i.RANGE_TYPE.ROW&&(e=i.RANGE_TYPE.COLUMN),{startRow:s.startColumn,endRow:s.endColumn,startColumn:s.startRow,endColumn:s.endRow,rangeType:e}},Ht=(s,e,t)=>{const n={...t},o={...e},r=(C,v)=>{const I=Math.max(C.start,v.start),p=Math.min(C.end,v.end);return p<I?null:{start:I,end:p}},a=C=>C.end-C.start+1,l=(C,v)=>({start:C.start-v.start,end:C.start-v.start+C.end-C.start}),u=(C,v)=>({start:v.start+C.start,end:v.start+C.start+C.end-C.start}),d=e.start>s.start;if(d){const C=Math.min(s.end,e.start)-s.start+1;o.start-=C,o.end-=C}const c=a(s),m=c,h=r(s,n),R=h&&a(h)>=a(n);if(s.end<n.start)n.start-=c,n.end-=c;else if(h){const C=a(h);if(R){const v=l(n,s),I=u(v,o);n.start=I.start,n.end=I.end}else h.start>s.start?d?(n.end-=C+c,n.start-=c):n.end-=C:d?n.end-=C:n.start>s.start&&n.end>s.end?(n.start-=c,n.end-=c+C):n.end-=C}const S=r(o,n);return R||(o.start<=n.start?(n.start+=m,n.end+=m):S&&(d?o.end<=n.start||o.start<=n.start&&o.end>=n.start?(n.start+=m,n.end+=m):o.start>=n.start&&o.start<=n.end&&(n.end+=m):n.start<o.start&&n.end>o.start?n.end+=m:(n.start>=o.end||n.start>=o.start&&n.start<=o.end)&&(n.end+=m,n.start+=m))),{step:n.start-t.start,length:a(n)-a(t)}},Vs=(s,e)=>{const{fromRange:t,toRange:n}=s.params||{};if(!n||!t)return[];const o=_e(t),r=_e(n),a=_e(e),l=Ht({start:o.startRow,end:o.endRow},{start:r.startRow,end:r.endRow},{start:a.startRow,end:a.endRow});return l===null?[{type:L.Delete}]:[{type:L.VerticalMove,step:l.step||0,length:l.length||0}]},Cl=(s,e)=>{const{fromRange:t,toRange:n}=s.params||{};if(!t||!n)return[e];const o=t.startRow,r=t.endRow-t.startRow+1,a=n.startRow,l=new i.ObjectMatrix;return i.Range.foreach(e,(d,c)=>{l.setValue(d,c,1)}),l.moveRows(o,r,a),i.queryObjectMatrix(l,d=>d===1)},fl=(s,e)=>{const{range:t,order:n}=s.params||{};if(!t||!n)return[e];const o=new i.ObjectMatrix;i.Range.foreach(e,(l,u)=>{o.setValue(l,u,1)});const r=new i.ObjectMatrix;return i.Range.foreach(t,(l,u)=>{var d;if(n.hasOwnProperty(l)){const c=n[l],m=(d=o.getValue(c,u))!=null?d:0;r.setValue(l,u,m)}}),r.forValue((l,u,d)=>{o.setValue(l,u,d)}),i.queryObjectMatrix(o,l=>l===1)},$s=(s,e)=>{const{fromRange:t,toRange:n}=s.params||{};if(!n||!t)return[];const o=_e(t),r=_e(n),a=_e(e),l=Ht({start:o.startColumn,end:o.endColumn},{start:r.startColumn,end:r.endColumn},{start:a.startColumn,end:a.endColumn});return l===null?[{type:L.Delete}]:[{type:L.HorizontalMove,step:l.step||0,length:l.length||0}]},vl=(s,e)=>{const{fromRange:t,toRange:n}=s.params||{};if(!t||!n)return[e];const o=t.startColumn,r=t.endColumn-t.startColumn+1,a=n.startColumn,l=new i.ObjectMatrix;return i.Range.foreach(e,(u,d)=>{l.setValue(u,d,1)}),l.moveColumns(o,r,a),i.queryObjectMatrix(l,u=>u===1)},Wr=(s,e)=>{var r,a;const t=(r=s.params)==null?void 0:r.toRange,n=(a=s.params)==null?void 0:a.fromRange;if(!t||!n)return[];const o=[];if(i.Rectangle.contains(t,e)&&o.push({type:L.Delete}),i.Rectangle.contains(n,e)){o.push({type:L.Delete});const l=i.Rectangle.getRelativeRange(e,n),u=i.Rectangle.getPositionRange(l,t);return[{type:L.Set,range:u}]}return o},Il=(s,e)=>{var m,h;const t=(m=s.params)==null?void 0:m.toRange,n=(h=s.params)==null?void 0:h.fromRange;if(!t||!n)return[e];if(!i.Rectangle.intersects(n,e)&&!i.Rectangle.intersects(t,e))return[e];if(i.Rectangle.contains(n,e)){const R=i.Rectangle.getRelativeRange(e,n);return[i.Rectangle.getPositionRange(R,t)]}const o=new i.ObjectMatrix;i.Range.foreach(e,(R,S)=>{o.setValue(R,S,1)});const r=new i.ObjectMatrix,a=i.Rectangle.getIntersects(n,e);a&&i.Range.foreach(a,(R,S)=>{o.getValue(R,S)&&(o.setValue(R,S,void 0),r.setValue(R,S,1))});const l=t.startColumn-n.startColumn,u=t.startRow-n.startRow,d={startColumn:t.startColumn-l,endColumn:t.endColumn-l,startRow:t.startRow-u,endRow:t.endRow-u};return d&&i.Range.foreach(d,(R,S)=>{var I;const C=R+u,v=S+l;o.setValue(C,v,(I=r.getValue(R,S))!=null?I:0)}),i.queryObjectMatrix(o,R=>R===1)},Ze=(s,e)=>{const t=_e(s),n=_e(e),o=a=>a.endColumn-a.startColumn+1,r=a=>a.endRow-a.startRow+1;if(t.startRow<=n.startRow&&t.endRow>=n.endRow){if(n.startColumn<t.startColumn&&n.endColumn>=t.startColumn&&n.endColumn<=t.endColumn||n.startColumn<t.startColumn&&n.endColumn>=t.endColumn){const a=i.Rectangle.getIntersects(n,t);if(a)return{step:0,length:-o(a)}}if(n.startColumn>=t.startColumn&&n.endColumn<=t.endColumn&&r(t)>=r(n))return null;if(n.startColumn>=t.startColumn&&n.startColumn<=t.endColumn&&n.endColumn>t.endColumn){const a=i.Rectangle.getIntersects(n,t);if(a){const l=-o(a);return{step:-(o(t)-o(a)),length:l}}}if(n.startColumn>t.endColumn)return{step:-o(t),length:0}}return{step:0,length:0}},Bs=(s,e)=>{var r;const t=(r=s.params)==null?void 0:r.range;if(!t)return[];const n=[],o=Ze(t,e);if(!o)n.push({type:L.Delete});else{const{step:a,length:l}=o;n.push({type:L.HorizontalMove,step:a,length:l})}return n},Lr=(s,e)=>{var r;const t=(r=s.params)==null?void 0:r.range;if(!t)return[];const n=[],o=Ze(ie(t),ie(e));if(!o)n.push({type:L.Delete});else{const{step:a,length:l}=o;n.push({type:L.VerticalMove,step:a,length:l})}return n},pl=(s,e)=>{const{range:t,order:n}=s.params||{};if(!t||!n)return[];if(i.Rectangle.contains(t,e)&&e.endRow===e.startRow){const o=[],r=e.startRow;for(const a in n)if(n[a]===r){const l=Number(a);return o.push({type:L.VerticalMove,step:l-r,length:0}),o}return[]}return[]},Qe=(s,e)=>{const t=_e(s),n=_e(e),o=r=>r.endColumn-r.startColumn+1;if(t.startRow<=n.startRow&&t.endRow>=n.endRow){if(n.startColumn<t.startColumn&&n.endColumn>=t.startColumn&&n.endColumn<=t.endColumn||n.startColumn<t.startColumn&&n.endColumn>=t.endColumn)return{step:0,length:o(t)};if(n.startColumn>=t.startColumn&&n.endColumn<=t.endColumn||n.startColumn>t.startColumn&&n.startColumn<=t.endColumn&&n.endColumn>t.endColumn||n.startColumn>=t.endColumn)return{step:o(t),length:0}}return{step:0,length:0}};function wl(s,e,t){const n=[];if(i.Rectangle.contains(e,t)&&n.push({type:L.Delete}),i.Rectangle.contains(s,t)){n.push({type:L.Delete});const o=i.Rectangle.getRelativeRange(t,s),r=i.Rectangle.getPositionRange(o,e);return[{type:L.Set,range:r}]}return n}const Vr=(s,e)=>{var l;const t=(l=s.params)==null?void 0:l.range;if(!t)return[];const n=[],o=Qe(ie(t),ie(e)),{step:r,length:a}=o;return n.push({type:L.VerticalMove,step:r,length:a}),n},$r=(s,e)=>{var l;const t=(l=s.params)==null?void 0:l.range;if(!t)return[];const n=[],o=Qe(t,e),{step:r,length:a}=o;return n.push({type:L.HorizontalMove,step:r,length:a}),n},Br=(s,e)=>{var l;const t=(l=s.params)==null?void 0:l.range;if(!t)return[];const n=[],o=Qe(ie(t),ie(e)),{step:r,length:a}=o;return n.push({type:L.VerticalMove,step:r,length:a}),n},Ml=(s,e)=>{var u;const t=(u=s.params)==null?void 0:u.range;if(!t)return[e];const n=t.endRow-t.startRow+1,o={...t,startRow:t.startRow,endRow:Number.POSITIVE_INFINITY},r=i.Rectangle.subtract(e,o),a=i.Rectangle.getIntersects(o,e);if(!a)return[e];const l=new i.ObjectMatrix;return r.forEach(d=>{i.Range.foreach(d,(c,m)=>{l.setValue(c,m,1)})}),a&&i.Range.foreach(a,(d,c)=>{l.setValue(d+n,c,1)}),i.queryObjectMatrix(l,d=>d===1)},Hr=(s,e)=>{var l;const t=(l=s.params)==null?void 0:l.range;if(!t)return[];const n=[],o=Qe(t,e),{step:r,length:a}=o;return n.push({type:L.HorizontalMove,step:r,length:a}),n},yl=(s,e)=>{var u;const t=(u=s.params)==null?void 0:u.range;if(!t)return[e];const n=t.endColumn-t.startColumn+1,o={...t,startColumn:t.startColumn,endColumn:Number.POSITIVE_INFINITY},r=i.Rectangle.subtract(e,o),a=i.Rectangle.getIntersects(o,e);if(!a)return[e];const l=new i.ObjectMatrix;return r.forEach(d=>{i.Range.foreach(d,(c,m)=>{l.setValue(c,m,1)})}),a&&i.Range.foreach(a,(d,c)=>{l.setValue(d,c+n,1)}),i.queryObjectMatrix(l,d=>d===1)},jr=(s,e)=>{var r;const t=(r=s.params)==null?void 0:r.range;if(!t)return[];const n=[],o=Ze(t,e);if(!o)n.push({type:L.Delete});else{const{step:a,length:l}=o;n.push({type:L.HorizontalMove,step:a,length:l})}return n},_l=(s,e)=>{var d;const t=(d=s.params)==null?void 0:d.range;if(!t)return[e];const n={startRow:t.startRow,endRow:t.endRow,startColumn:t.startColumn,endColumn:Number.POSITIVE_INFINITY},o=t.endColumn-t.startColumn+1,r=i.Rectangle.getIntersects(t,e),a=i.Rectangle.subtract(e,n),l=i.Rectangle.getIntersects(n,e);if(!r&&!l)return[e];const u=new i.ObjectMatrix;return l&&i.Range.foreach(l,(c,m)=>{u.setValue(c,m-o,1)}),r&&i.Range.foreach(r,(c,m)=>{u.setValue(c,m-o,0)}),a.forEach(c=>{i.Range.foreach(c,(m,h)=>{u.setValue(m,h,1)})}),i.queryObjectMatrix(u,c=>c===1)},Fr=(s,e)=>{var r;const t=(r=s.params)==null?void 0:r.range;if(!t)return[];const n=[],o=Ze(ie(t),ie(e));if(!o)n.push({type:L.Delete});else{const{step:a,length:l}=o;n.push({type:L.VerticalMove,step:a,length:l})}return n},bl=(s,e)=>{var d;const t=(d=s.params)==null?void 0:d.range;if(!t)return[e];const n={...t,startRow:t.startRow,endRow:Number.POSITIVE_INFINITY},o=t.endRow-t.startRow+1,r=i.Rectangle.getIntersects(t,e),a=i.Rectangle.subtract(e,n),l=i.Rectangle.getIntersects(n,e);if(!r&&!l)return[e];const u=new i.ObjectMatrix;return l&&i.Range.foreach(l,(c,m)=>{u.setValue(c-o,m,1)}),r&&i.Range.foreach(r,(c,m)=>{u.setValue(c-o,m,0)}),a.forEach(c=>{i.Range.foreach(c,(m,h)=>{u.setValue(m,h,1)})}),i.queryObjectMatrix(u,c=>c===1)},Tl=(s,e)=>{var o;const t=(o=s.ranges)!=null?o:[s.range],n=new i.ObjectMatrix;return i.Range.foreach(e,(r,a)=>{n.setValue(r,a,1)}),t.forEach(r=>{const a=r.startRow,u=r.endRow-a+1;n.removeRows(a,u)}),i.queryObjectMatrix(n,r=>r===1)},El=(s,e)=>{const t=s.params,n=t.range.startRow,o=t.range.endRow-t.range.startRow+1,r=t.direction;return r===i.Direction.UP&&n===e.startRow||r===i.Direction.DOWN&&n-1===e.endRow?[{startRow:e.startRow,endRow:e.endRow+o,startColumn:e.startColumn,endColumn:e.endColumn}]:e.startRow>=n?[{startRow:e.startRow+o,endRow:e.endRow+o,startColumn:e.startColumn,endColumn:e.endColumn}]:e.endRow<=n?[e]:[{startRow:e.startRow,endRow:e.endRow+o,startColumn:e.startColumn,endColumn:e.endColumn}]},Ul=(s,e)=>{const t=s.params,n=t.range.startColumn,o=t.range.endColumn-t.range.startColumn+1,r=t.direction;return r===i.Direction.LEFT&&n===e.startColumn||r===i.Direction.RIGHT&&n-1===e.endColumn?[{startRow:e.startRow,endRow:e.endRow,startColumn:e.startColumn,endColumn:e.endColumn+o}]:e.startColumn>=n?[{startRow:e.startRow,endRow:e.endRow,startColumn:e.startColumn+o,endColumn:e.endColumn+o}]:e.endColumn<=n?[e]:[{startRow:e.startRow,endRow:e.endRow,startColumn:e.startColumn,endColumn:e.endColumn+o}]},et=(s,e)=>{let t={...e};return s.forEach(n=>{switch(n.type){case L.Delete:{t=null;break}case L.HorizontalMove:{if(!t)return;t.startColumn+=n.step,t.endColumn+=n.step+(n.length||0);break}case L.VerticalMove:{if(!t)return;t.startRow+=n.step,t.endRow+=n.step+(n.length||0);break}case L.Set:{t=n.range;break}}}),t&&(t.endColumn<t.startColumn||t.endRow<t.startRow)?null:t},Hs=(s,e)=>{let t=[];switch(e.id){case D.DeleteRangeMoveLeftCommandId:{t=jr(e,s);break}case D.DeleteRangeMoveUpCommandId:{t=Fr(e,s);break}case D.InsertColCommandId:{t=$r(e,s);break}case D.InsertRangeMoveDownCommandId:{t=Br(e,s);break}case D.InsertRangeMoveRightCommandId:{t=Hr(e,s);break}case D.InsertRowCommandId:{t=Vr(e,s);break}case D.MoveColsCommandId:{t=$s(e,s);break}case D.MoveRangeCommandId:{t=Wr(e,s);break}case D.MoveRowsCommandId:{t=Vs(e,s);break}case D.RemoveColCommandId:{t=Bs(e,s);break}case D.RemoveRowCommandId:{t=Lr(e,s);break}case D.ReorderRangeCommandId:{t=pl(e,s);break}}return et(t,s)},Pl=(s,e,t)=>[qe.id,Ke.id].includes(e.id)||zr(e,t).some(r=>i.Rectangle.intersects(r,s))?Hs(s,e):s,js=(s,e)=>{let t=[];switch(e.id){case D.DeleteRangeMoveLeftCommandId:return _l(e,s);case D.DeleteRangeMoveUpCommandId:return bl(e,s);case D.InsertRangeMoveDownCommandId:return Ml(e,s);case D.InsertRangeMoveRightCommandId:return yl(e,s);case D.InsertColCommandId:return Ul(e,s);case D.InsertRowCommandId:return El(e,s);case D.MoveColsCommandId:return vl(e,s);case D.MoveRangeCommandId:return Il(e,s);case D.MoveRowsCommandId:return Cl(e,s);case D.ReorderRangeCommandId:return fl(e,s);case D.RemoveColCommandId:{t=Bs(e,s);break}case D.RemoveRowCommandId:return Tl(e.params,s)}const n=et(t,s);return n?[n]:[]},kl=(s,e,t)=>[qe.id,Ke.id,at.id,us].includes(e.id)||zr(e,t).some(r=>i.Rectangle.intersects(r,s))?js(s,e):s;function Gr(s,e){const{id:t,params:n}=e;let o={length:0,step:0,type:L.Unknown};switch(t){case ze.id:o.type=L.Delete;break;case Ue.id:o=Ht({start:n.sourceRange.startRow,end:n.sourceRange.endRow},{start:n.targetRange.startRow,end:n.targetRange.endRow},{start:s.startRow,end:s.endRow}),o.type=L.VerticalMove;break;case Pe.id:o=Ht({start:n.sourceRange.startColumn,end:n.sourceRange.endColumn},{start:n.targetRange.startColumn,end:n.targetRange.endColumn},{start:s.startColumn,end:s.endColumn}),o.type=L.HorizontalMove;break;case ce.id:o=Ze(n.range,s),o?o.type=L.HorizontalMove:o={step:0,length:0,type:L.Delete};break;case Se.id:o=Ze(ie(n.range),ie(s)),o?o.type=L.VerticalMove:o={step:0,length:0,type:L.Delete};break;case ye.id:o=Qe(ie(n.range),ie(s)),o.type=L.VerticalMove;break;case Re.id:o=Qe(n.range,s),o.type=L.HorizontalMove;break;case Ae.id:{const r=n.fromRange||new i.ObjectMatrix(n.from).getRange(),a=n.toRange||new i.ObjectMatrix(n.to).getRange();o=wl(r,a,s)}break}return o?Array.isArray(o)?et(o,s):et([o],s):s}function zr(s,e){var n,o,r,a,l,u;const{selectionManagerService:t}=e;switch(s.id){case D.MoveColsCommandId:{const d=s.params;return[d.fromRange,{...d.toRange,startColumn:d.toRange.startColumn-.5,endColumn:d.toRange.endColumn-.5}]}case D.MoveRowsCommandId:{const d=s.params;return[d.fromRange,{...d.toRange,startRow:d.toRange.startRow-.5,endRow:d.toRange.startRow-.5}]}case D.MoveRangeCommandId:{const d=s;return[d.params.fromRange,d.params.toRange]}case D.InsertRowCommandId:{const c=s.params.range;return[{...c,startRow:c.startRow-.5,endRow:c.endRow-.5}]}case D.InsertColCommandId:{const c=s.params.range;return[{...c,startColumn:c.startColumn-.5,endColumn:c.endColumn-.5}]}case D.RemoveRowCommandId:return[s.params.range];case D.RemoveColCommandId:return[s.params.range];case D.DeleteRangeMoveUpCommandId:case D.InsertRangeMoveDownCommandId:{const c=((n=s.params)==null?void 0:n.range)||((r=(o=t.getCurrentSelections())==null?void 0:o.map(m=>m.range))==null?void 0:r[0]);return c?[c]:[]}case D.DeleteRangeMoveLeftCommandId:case D.InsertRangeMoveRightCommandId:{const c=((a=s.params)==null?void 0:a.range)||((u=(l=t.getCurrentSelections())==null?void 0:l.map(m=>m.range))==null?void 0:u[0]);return c?[c]:[]}case D.ReorderRangeCommandId:{const d=s,{range:c,order:m}=d.params,h=[];for(let R=c.startRow;R<=c.endRow;R++)R in m&&h.push({startRow:R,endRow:R,startColumn:c.startColumn,endColumn:c.endColumn});return h}}}function Nl(s){switch(s.id){case Pe.id:{const e=s.params;return[e.sourceRange,{...e.targetRange,startColumn:e.targetRange.startColumn-.5,endColumn:e.targetRange.startColumn-.5}]}case Ue.id:{const e=s.params;return[e.sourceRange,{...e.targetRange,startRow:e.targetRange.startRow-.5,endRow:e.targetRange.startRow-.5}]}case Ae.id:{const e=s.params;return[new i.ObjectMatrix(e.from.value).getRange(),new i.ObjectMatrix(e.to.value).getRange()]}case Re.id:{const t=s.params.range;return[{...t,startColumn:t.startColumn-.5,endColumn:t.startColumn-.5}]}case ye.id:{const t=s.params.range;return[{...t,startRow:t.startRow-.5,endRow:t.startRow-.5}]}case ce.id:return[s.params.range];case Se.id:return[s.params.range]}}function Ol(s,e){var o,r,a,l,u,d;const t=s.get(i.IUniverInstanceService),n=s.get(g.SheetsSelectionsService);switch(e.id){case D.MoveColsCommandId:{const c=e.params,m=U(t,{unitId:c.unitId,subUnitId:c.subUnitId});return{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[c.fromRange,{...c.toRange,startColumn:c.fromRange.startColumn<c.toRange.startColumn?c.fromRange.endColumn+1:c.toRange.startColumn,endColumn:c.fromRange.startColumn<c.toRange.startColumn?c.toRange.endColumn-1:c.fromRange.startColumn-1}]}}case D.MoveRowsCommandId:{const c=e.params,m=U(t,{unitId:c.unitId,subUnitId:c.subUnitId});return{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[c.fromRange,{...c.toRange,startRow:c.fromRange.startRow<c.toRange.startRow?c.fromRange.endRow+1:c.toRange.startRow,endRow:c.fromRange.startRow<c.toRange.startRow?c.toRange.endRow-1:c.fromRange.startRow-1}]}}case D.MoveRangeCommandId:{const c=e.params,m=U(t);return{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[c.fromRange,c.toRange]}}case D.InsertRowCommandId:{const c=e.params,m=c.range;return{unitId:c.unitId,subUnitId:c.subUnitId,ranges:[...m.startRow>0?[{...m,startRow:m.startRow-1,endRow:m.endRow-1}]:[],{...m,startRow:m.startRow,endRow:Number.MAX_SAFE_INTEGER}]}}case D.InsertColCommandId:{const c=e.params,m=c.range;return{unitId:c.unitId,subUnitId:c.subUnitId,ranges:[...m.startColumn>0?[{...m,startColumn:m.startColumn-1,endColumn:m.endColumn-1}]:[],{...m,startColumn:m.startColumn,endColumn:Number.MAX_SAFE_INTEGER}]}}case D.RemoveRowCommandId:{const m=e.params.range,h=U(t);return{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[m,{...m,startRow:m.endRow+1,endRow:Number.MAX_SAFE_INTEGER}]}}case D.RemoveColCommandId:{const m=e.params.range,h=U(t);return{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[m,{...m,startColumn:m.endColumn+1,endColumn:Number.MAX_SAFE_INTEGER}]}}case D.DeleteRangeMoveUpCommandId:case D.InsertRangeMoveDownCommandId:{const c=e,m=U(t),h=((o=c.params)==null?void 0:o.range)||((a=(r=n.getCurrentSelections())==null?void 0:r.map(R=>R.range))==null?void 0:a[0]);return h?{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[h,{...h,startRow:h.endRow+1,endRow:Number.MAX_SAFE_INTEGER}]}:{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[]}}case D.DeleteRangeMoveLeftCommandId:case D.InsertRangeMoveRightCommandId:{const m=((l=e.params)==null?void 0:l.range)||((d=(u=n.getCurrentSelections())==null?void 0:u.map(R=>R.range))==null?void 0:d[0]),h=U(t);return m?{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[m,{...m,startColumn:m.endColumn+1,endColumn:Number.MAX_SAFE_INTEGER}]}:{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[]}}case D.ReorderRangeCommandId:{const c=e,{range:m,order:h}=c.params,R=[];for(let C=m.startRow;C<=m.endRow;C++)C in h&&R.push({startRow:C,endRow:C,startColumn:m.startColumn,endColumn:m.endColumn});const S=U(t);return{unitId:S.unitId,subUnitId:S.subUnitId,ranges:R}}}}var Dl=Object.getOwnPropertyDescriptor,Al=(s,e,t,n)=>{for(var o=n>1?void 0:n?Dl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},wn=(s,e)=>(t,n)=>e(t,n,s);const Wl=i.createInterceptorKey("MERGE_REDO"),Ll=i.createInterceptorKey("MERGE_UNDO"),Yr=Math.floor(Number.MAX_SAFE_INTEGER/10);class Vl extends i.Disposable{constructor(e,t,n,o,r=!1){super(),this._unitId=e,this._subUnitId=t,this._range=n,this._callback=o,this._skipIntersects=r}onMutation(e){var o,r;if(((o=e.params)==null?void 0:o.unitId)!==this._unitId)return;if(e.id===Ae.id){const a=e.params;if(a.from.subUnitId!==this._subUnitId||a.to.subUnitId!==this._subUnitId)return}else if(((r=e.params)==null?void 0:r.subUnitId)!==this._subUnitId)return;if(!this._range)return;if(this._skipIntersects){if(e.id===ze.id)return;const a=Nl(e);if(a!=null&&a.some(l=>i.Rectangle.intersects(l,this._range)))return}const t=Gr(this._range,e);if(t&&i.Rectangle.equals(t,this._range))return!1;const n=this._range;this._range=t,this._callback(n,t)}}g.RefRangeService=class extends i.Disposable{constructor(t,n,o,r){super();f(this,"interceptor",new i.InterceptorManager({MERGE_REDO:Wl,MERGE_UNDO:Ll}));f(this,"_watchRanges",new Set);f(this,"_refRangeManagerMap",new Map);f(this,"_serializer",$l());f(this,"_onRefRangeChange",()=>{this._sheetInterceptorService.interceptCommand({getMutations:t=>{const n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet(),o=qr(this._univerInstanceService),r=Kr(this._univerInstanceService);if(!n||!o||!r)return{redos:[],undos:[],preRedos:[],preUndos:[]};const u=((()=>{switch(t.id){case D.MoveColsCommandId:{const R=t.params,S=Math.min(R.fromRange.startColumn,R.toRange.startColumn);return this._checkRange([{...R.fromRange,startColumn:S,endColumn:n.getColumnCount()-1}],o,r)}case D.MoveRowsCommandId:{const R=t.params,S=Math.min(R.fromRange.startRow,R.toRange.startRow);return this._checkRange([{...R.fromRange,startRow:S,endRow:n.getRowCount()-1}],o,r)}case D.MoveRangeCommandId:{const R=t;return this._checkRange([R.params.fromRange,R.params.toRange],o,r)}case D.InsertRowCommandId:{const C={startRow:t.params.range.startRow,endRow:n.getRowCount()-1,startColumn:0,endColumn:n.getColumnCount()-1,rangeType:i.RANGE_TYPE.ROW};return this._checkRange([C],o,r)}case D.InsertColCommandId:{const S=t.params.range.startColumn,C={startRow:0,endRow:n.getRowCount()-1,startColumn:S,endColumn:n.getColumnCount()-1,rangeType:i.RANGE_TYPE.COLUMN};return this._checkRange([C],o,r)}case D.RemoveRowCommandId:{const C={startRow:t.params.range.startRow,endRow:n.getRowCount()-1,startColumn:0,endColumn:n.getColumnCount()-1,rangeType:i.RANGE_TYPE.ROW};return this._checkRange([C],o,r)}case D.RemoveColCommandId:{const S=t.params.range.startColumn,C={startRow:0,endRow:n.getRowCount()-1,startColumn:S,endColumn:n.getColumnCount()-1,rangeType:i.RANGE_TYPE.COLUMN};return this._checkRange([C],o,r)}case D.DeleteRangeMoveUpCommandId:case D.InsertRangeMoveDownCommandId:{const S=t.params.range||Jr(this._selectionManagerService)[0],C={startRow:S.startRow,startColumn:S.startColumn,endColumn:S.endColumn,endRow:Yr};return this._checkRange([C],o,r)}case D.DeleteRangeMoveLeftCommandId:case D.InsertRangeMoveRightCommandId:{const S=t.params.range||Jr(this._selectionManagerService)[0],C={startRow:S.startRow,startColumn:S.startColumn,endColumn:Yr,endRow:S.endRow};return this._checkRange([C],o,r)}case D.ReorderRangeCommandId:{const R=t,{range:S,order:C}=R.params,v=[];for(let I=S.startRow;I<=S.endRow;I++)I in C&&v.push({startRow:I,endRow:I,startColumn:S.startColumn,endColumn:S.endColumn});return this._checkRange(v,o,r)}}})()||[]).reduce((R,S)=>{const C=S(t);return R.push(C),R},[]).reduce((R,S)=>{var C,v;return R.redos.push(...S.redos),R.undos.push(...S.undos),R.preRedos.push(...(C=S.preRedos)!=null?C:[]),R.preUndos.push(...(v=S.preUndos)!=null?v:[]),R},{redos:[],undos:[],preUndos:[],preRedos:[]}),d=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_REDO)(u.preRedos,null)||[],c=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_REDO)(u.redos,null)||[],m=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_UNDO)(u.preUndos,null)||[],h=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_UNDO)(u.undos,null)||[];return{redos:c,undos:h,preRedos:d,preUndos:m}}})});f(this,"_checkRange",(t,n,o)=>{const r=xr(n,o),a=this._refRangeManagerMap.get(r);if(a){const l=new Set;return[...a.keys()].forEach(d=>{const c=a.get(d),m=this._serializer.deserialize(d),h={...m,startRow:+m.startRow,endRow:+m.endRow,startColumn:+m.startColumn,endColumn:+m.endColumn,rangeType:m.rangeType&&+m.rangeType};t.some(R=>i.Rectangle.intersects(R,h))&&c&&c.forEach(R=>{l.add(R)})}),[...l]}return[]});f(this,"registerRefRange",(t,n,o,r)=>{const a=o||qr(this._univerInstanceService),l=r||Kr(this._univerInstanceService);if(!a||!l)return i.toDisposable(()=>{});const u=xr(a,l),d=this._serializer.serialize(t);let c=this._refRangeManagerMap.get(u);c||(c=new Map,this._refRangeManagerMap.set(u,c));const m=c.get(d);return m?m.add(n):c.set(d,new Set([n])),i.toDisposable(()=>{const h=c.get(d);h&&(h.delete(n),h.size||(c.delete(d),c.size||this._refRangeManagerMap.delete(u)))})});this._commandService=t,this._sheetInterceptorService=n,this._univerInstanceService=o,this._selectionManagerService=r,this._onRefRangeChange(),this.interceptor.intercept(this.interceptor.getInterceptPoints().MERGE_REDO,{priority:-1,handler:a=>a}),this.interceptor.intercept(this.interceptor.getInterceptPoints().MERGE_UNDO,{priority:-1,handler:a=>a})}watchRange(t,n,o,r,a){let l;this._watchRanges.size===0&&(l=this._commandService.onCommandExecuted(m=>{if(m.type!==i.CommandType.MUTATION)return!1;for(const h of this._watchRanges)h.onMutation(m)}));const u=new Vl(t,n,o,r,a);this._watchRanges.add(u);const d=i.toDisposable(()=>{this._watchRanges.delete(u),this._watchRanges.size===0&&(l==null||l.dispose(),l=null)}),c=this.disposeWithMe(d);return i.toDisposable(()=>{c.dispose(),d.dispose()})}},g.RefRangeService=Al([wn(0,i.ICommandService),wn(1,i.Inject(g.SheetInterceptorService)),wn(2,i.Inject(i.IUniverInstanceService)),wn(3,i.Inject(g.SheetsSelectionsService))],g.RefRangeService);function qr(s){return s.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getUnitId()}function Kr(s){var e;return(e=s.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()}function Jr(s){var e;return((e=s.getCurrentSelections())==null?void 0:e.map(t=>t.range))||[]}function xr(s,e){return`${s}_${e}`}function $l(){const s=["startRow","startColumn","endRow","endColumn","rangeType"],e="_";return{deserialize:t=>{const n=s.reduce((r,a,l)=>(r[String(l)]=a,r),{});return t.split(e).reduce((r,a,l)=>{const u=String(l);return a&&n[u]&&(r[n[u]]=a),r},{})},serialize:t=>s.reduce((n,o,r)=>{const a=t[o];return a!==void 0?`${n}${r>0?e:""}${a}`:`${n}`},"")}}var Bl=Object.getOwnPropertyDescriptor,Hl=(s,e,t,n)=>{for(var o=n>1?void 0:n?Bl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},wt=(s,e)=>(t,n)=>e(t,n,s);const jl=[Re.id,ye.id,ce.id,Se.id],Fl=[Ue.id,Pe.id];function Fs(s,e){let t=s;if(e!==void 0){const n=[];for(let o=0;o<t.length;o++){const{startRow:r,endRow:a,startColumn:l,endColumn:u}=t[o];if(e===i.Dimension.ROWS)for(let d=r;d<=a;d++){const c={startRow:d,endRow:d,startColumn:l,endColumn:u};n.push(c)}else if(e===i.Dimension.COLUMNS)for(let d=l;d<=u;d++){const c={startRow:r,endRow:a,startColumn:d,endColumn:d};n.push(c)}}t=n}return t}const Xr=i.createInterceptorKey("mergeCellPermissionCheck");g.MergeCellController=class extends i.Disposable{constructor(t,n,o,r,a,l){super();f(this,"disposableCollection",new i.DisposableCollection);f(this,"interceptor",new i.InterceptorManager({MERGE_CELL_INTERCEPTOR_CHECK:Xr}));this._commandService=t,this._refRangeService=n,this._univerInstanceService=o,this._injector=r,this._sheetInterceptorService=a,this._selectionManagerService=l,this._onRefRangeChange(),this._initCommandInterceptor(),this._commandExecutedListener()}_initCommandInterceptor(){const t=this;this._sheetInterceptorService.interceptCommand({getMutations(n){var o;switch(n.id){case Kt.id:case xt.id:{const r=t._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),a=r.getUnitId(),l=r==null?void 0:r.getActiveSheet();if(!l)return{redos:[],undos:[]};const u=l.getSheetId(),d=l.getConfig().mergeData,c=(o=t._selectionManagerService.getCurrentSelections())==null?void 0:o.map(m=>m.range);if(c&&c.length>0&&c.some(h=>d.some(R=>i.Rectangle.intersects(R,h)))){const h={unitId:a,subUnitId:u,ranges:c},R=ne(t._injector,h),S=[{id:G.id,params:h}],C=[{id:F.id,params:R}];return{redos:S,undos:C}}}}return{redos:[],undos:[]}}}),this._sheetInterceptorService.interceptRanges({getMutations:({unitId:n,subUnitId:o,ranges:r})=>{const a=[],l=[],u={redos:a,undos:l};if(!r||!r.length)return u;const d=U(this._univerInstanceService,{unitId:n,subUnitId:o});if(!d)return u;const{worksheet:c}=d,h=c.getMergeData().filter(R=>r.some(S=>i.Rectangle.intersects(R,S)));return h.length?(a.push({id:G.id,params:{unitId:n,subUnitId:o,ranges:h}}),l.push({id:F.id,params:{unitId:n,subUnitId:o,ranges:h}}),{undos:l,redos:a}):u}})}refRangeHandle(t,n,o){switch(t.id){case D.MoveColsCommandId:{const r=t.params;return this._handleMoveColsCommand(r,n,o)}case D.MoveRowsCommandId:{const r=t.params;return this._handleMoveRowsCommand(r,n,o)}case We.id:{const r=t.params,a=r.unitId||n,l=r.subUnitId||o;return this._handleInsertRowCommand(r,a,l)}case Le.id:{const r=t.params,a=r.unitId||n,l=r.subUnitId||o;return this._handleInsertColCommand(r,a,l)}case Ot.id:{const r=t.params;return this._handleRemoveColCommand(r,n,o)}case Nt.id:{const r=t.params;return this._handleRemoveRowCommand(r,n,o)}case Ye.id:{const r=t.params;return this._handleMoveRangeCommand(r,n,o)}case Ut.id:{const r=t.params;return this._handleInsertRangeMoveRightCommand(r,n,o)}case at.id:{const r=t.params;return this._handleInsertRangeMoveDownCommand(r,n,o)}case Ke.id:{const r=t.params;return this._handleDeleteRangeMoveUpCommand(r,n,o)}case qe.id:{const r=t.params;return this._handleDeleteRangeMoveLeftCommand(r,n,o)}}return{redos:[],undos:[]}}_onRefRangeChange(){const t=(n,o)=>{const r=this._univerInstanceService.getUniverSheetInstance(n);if(!r)return;const a=r==null?void 0:r.getSheetBySheetId(o);if(!a)return;this.disposableCollection.dispose();const l=a.getMergeData(),u=d=>this.refRangeHandle(d,n,o);l.forEach(d=>{this.disposableCollection.add(this._refRangeService.registerRefRange(d,u,n,o))})};this.disposeWithMe(this._commandService.onCommandExecuted(n=>{if(n.id===Ct.id){const o=n.params,r=o.subUnitId,a=o.unitId;if(!r||!a)return;t(a,r)}if(n.id===F.id){const o=n.params,r=o.subUnitId,a=o.unitId;if(!r||!a)return;t(o.unitId,o.subUnitId)}})),this._univerInstanceService.getCurrentTypeOfUnit$(i.UniverInstanceType.UNIVER_SHEET).pipe(A.first(n=>!!n)).subscribe(n=>{const o=n.getActiveSheet();o&&t(n.getUnitId(),o.getSheetId())})}_handleMoveRowsCommand(t,n,o){const r=Ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=fe(r,o);if(!a)return this._handleNull();const l=[...a.getMergeData()],u={unitId:n,subUnitId:o,ranges:[]},d={unitId:n,subUnitId:o,ranges:[]},{fromRange:c}=t,{startRow:m,endRow:h}=c;if(l.forEach(C=>{if(m<=C.startRow&&h>=C.endRow){u.ranges.push(C);const v=Vs({id:D.MoveRowsCommandId,params:t},C),I=et(v,C);I&&d.ranges.push(I)}}),u.ranges.length===0)return this._handleNull();const R=ne(this._injector,u),S=me(this._injector,d);return{preRedos:[{id:G.id,params:u}],redos:[{id:F.id,params:d}],preUndos:[{id:G.id,params:S}],undos:[{id:F.id,params:R}]}}_handleMoveColsCommand(t,n,o){const r=Ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=fe(r,o);if(!a)return this._handleNull();const l=[...a.getMergeData()],u={unitId:n,subUnitId:o,ranges:[]},d={unitId:n,subUnitId:o,ranges:[]},{fromRange:c}=t,{startColumn:m,endColumn:h}=c;if(l.forEach(C=>{if(m<=C.startColumn&&h>=C.endColumn){u.ranges.push(C);const v=$s({id:D.MoveColsCommandId,params:t},C),I=et(v,C);I&&d.ranges.push(I)}}),u.ranges.length===0)return this._handleNull();const R=ne(this._injector,u),S=me(this._injector,d);return{preRedos:[{id:G.id,params:u}],redos:[{id:F.id,params:d}],preUndos:[{id:G.id,params:S}],undos:[{id:F.id,params:R}]}}_handleMoveRangeCommand(t,n,o){const r=Ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=fe(r,o);if(!a)return this._handleNull();const l=a.getMergeData(),u=l.filter(S=>i.Rectangle.intersects(S,t.fromRange)),d=l.filter(S=>i.Rectangle.intersects(S,t.toRange)),c=u.map(S=>i.Rectangle.getRelativeRange(S,t.fromRange)).map(S=>i.Rectangle.getPositionRange(S,t.toRange)),m=Fs(c).filter(S=>!l.some(C=>i.Rectangle.equals(S,C))),h=[{id:G.id,params:{unitId:n,subUnitId:o,ranges:u}},{id:G.id,params:{unitId:n,subUnitId:o,ranges:d}},{id:F.id,params:{unitId:n,subUnitId:o,ranges:m}}],R=[{id:G.id,params:{unitId:n,subUnitId:o,ranges:m}},{id:F.id,params:{unitId:n,subUnitId:o,ranges:d}},{id:F.id,params:{unitId:n,subUnitId:o,ranges:u}}];return{redos:h,undos:R}}_handleInsertRowCommand(t,n,o){const r=Ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=fe(r,o);if(!a)return this._handleNull();const{range:l}=t,{startRow:u,endRow:d}=l,c=i.Tools.deepClone(a.getMergeData()).reduce((p,w)=>(u>w.startRow&&u<=w.endRow&&p.push(w),p),[]);if(c.length===0)return this._handleNull();const m=i.Tools.deepClone(a.getMergeData()).reduce((p,w)=>{if(u>w.startRow&&u<=w.endRow){const M=d-u+1;w.endRow+=M,this._checkIsMergeCell(w)&&p.push(w)}return p},[]),h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=me(this._injector,S),v=[{id:G.id,params:h},{id:F.id,params:S}],I=[{id:G.id,params:C},{id:F.id,params:R}];return{redos:v,undos:I}}_handleInsertColCommand(t,n,o){const{range:r}=t,a=Ce(this._univerInstanceService,n);if(!a)return this._handleNull();const l=fe(a,o);if(!l)return this._handleNull();const{startColumn:u,endColumn:d}=r,c=i.Tools.deepClone(l.getMergeData()).reduce((p,w)=>(u>w.startColumn&&u<=w.endColumn&&p.push(w),p),[]);if(c.length===0)return this._handleNull();const m=i.Tools.deepClone(l.getMergeData()).reduce((p,w)=>{if(u>w.startColumn&&u<=w.endColumn){const M=d-u+1;w.endColumn+=M,this._checkIsMergeCell(w)&&p.push(w)}return p},[]),h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=me(this._injector,S),v=[{id:G.id,params:h},{id:F.id,params:S}],I=[{id:G.id,params:C},{id:F.id,params:R}];return{redos:v,undos:I}}_handleRemoveColCommand(t,n,o){const r=Ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=fe(r,o);if(!a)return this._handleNull();const{range:l}=t,{startColumn:u,endColumn:d}=l,c=i.Tools.deepClone(a.getMergeData()).reduce((M,y)=>(i.Rectangle.intersects(l,y)&&M.push(y),M),[]);if(c.length===0)return this._handleNull();const m=i.Tools.deepClone(a.getMergeData()).reduce((M,y)=>{if(i.Rectangle.intersects(l,y)){if(u<=y.startColumn&&d>=y.endColumn)return M;u>=y.startColumn&&d<=y.endColumn?y.endColumn-=d-u+1:u<y.startColumn?(y.startColumn=u,y.endColumn-=d-u+1):d>y.endColumn&&(y.endColumn=u-1),this._checkIsMergeCell(y)&&M.push(y)}return M},[]),h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=me(this._injector,S),v=[{id:G.id,params:h}],I=[{id:F.id,params:S}],p=[{id:G.id,params:C}],w=[{id:F.id,params:R}];return{preUndos:p,undos:w,preRedos:v,redos:I}}_handleRemoveRowCommand(t,n,o){const{range:r}=t,a=Ce(this._univerInstanceService,n);if(!a)return this._handleNull();const l=fe(a,o);if(!l)return this._handleNull();const{startRow:u,endRow:d}=r,c=i.Tools.deepClone(l.getMergeData()).reduce((M,y)=>(i.Rectangle.intersects(r,y)&&M.push(y),M),[]);if(c.length===0)return this._handleNull();const m=i.Tools.deepClone(l.getMergeData()).reduce((M,y)=>{if(i.Rectangle.intersects(r,y)){if(u<=y.startRow&&d>=y.endRow)return M;u>=y.startRow&&d<=y.endRow?y.endRow-=d-u+1:u<y.startRow?(y.startRow=u,y.endRow-=d-u+1):d>y.endRow&&(y.endRow=u-1),this._checkIsMergeCell(y)&&M.push(y)}return M},[]),h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=me(this._injector,S),v=[{id:G.id,params:h}],I=[{id:F.id,params:S}],p=[{id:G.id,params:C}],w=[{id:F.id,params:R}];return{preUndos:p,undos:w,preRedos:v,redos:I}}_handleInsertRangeMoveRightCommand(t,n,o){const r=Ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=fe(r,o);if(!a)return this._handleNull();const l=t.range,u=a.getMaxColumns()-1,d=a.getMergeData(),c=[],m=[];d.forEach(v=>{const{startRow:I,endRow:p,startColumn:w,endColumn:M}=l;if(i.Rectangle.intersects({startRow:I,startColumn:w,endRow:p,endColumn:u},v)&&(c.push(v),i.Rectangle.contains({startRow:I,startColumn:w,endRow:p,endColumn:u},v))){const k=M-w+1;m.push({startRow:v.startRow,startColumn:v.startColumn+k,endRow:v.endRow,endColumn:v.endColumn+k})}});const h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=me(this._injector,S);return{preRedos:[{id:G.id,params:h}],redos:[{id:F.id,params:S}],preUndos:[{id:G.id,params:C}],undos:[{id:F.id,params:R}]}}_handleInsertRangeMoveDownCommand(t,n,o){const r=Ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=fe(r,o);if(!a)return this._handleNull();const l=t.range,u=a.getMaxRows()-1,d=a.getMergeData(),c=[],m=[];d.forEach(M=>{const{startRow:y,startColumn:b,endColumn:k,endRow:E}=l;if(i.Rectangle.intersects({startRow:y,startColumn:b,endRow:u,endColumn:k},M)&&(c.push(M),i.Rectangle.contains({startRow:y,startColumn:b,endRow:u,endColumn:k},M))){const N=E-y+1;m.push({startRow:M.startRow+N,startColumn:M.startColumn,endRow:M.endRow+N,endColumn:M.endColumn})}});const h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=me(this._injector,S),v=[{id:G.id,params:h}],I=[{id:F.id,params:S}],p=[{id:G.id,params:C}],w=[{id:F.id,params:R}];return{redos:I,undos:w,preRedos:v,preUndos:p}}_handleDeleteRangeMoveUpCommand(t,n,o){const r=Ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=fe(r,o);if(!a)return this._handleNull();const l=t.range,u=a.getMaxRows()-1,d=a.getMergeData(),c=[],m=[];d.forEach(M=>{const{startRow:y,startColumn:b,endColumn:k,endRow:E}=l;if(i.Rectangle.intersects({startRow:y,startColumn:b,endRow:u,endColumn:k},M)&&(c.push(M),i.Rectangle.contains({startRow:y,startColumn:b,endRow:u,endColumn:k},M))){const N=E-y+1,W=i.Rectangle.moveVertical(M,-N);m.push(W)}});const h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=me(this._injector,S),v=[{id:G.id,params:h}],I=[{id:F.id,params:S}],p=[{id:G.id,params:C}],w=[{id:F.id,params:R}];return{redos:I,undos:w,preRedos:v,preUndos:p}}_handleDeleteRangeMoveLeftCommand(t,n,o){const r=Ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=fe(r,o);if(!a)return this._handleNull();const l=t.range,u=a.getMaxColumns()-1,d=a.getMergeData(),c=[],m=[];d.forEach(v=>{const{startRow:I,endRow:p,startColumn:w,endColumn:M}=l;if(i.Rectangle.intersects({startRow:I,startColumn:w,endRow:p,endColumn:u},v)&&(c.push(v),i.Rectangle.contains({startRow:I,startColumn:w,endRow:p,endColumn:u},v))){const k=M-w+1;m.push({startRow:v.startRow,startColumn:v.startColumn-k,endRow:v.endRow,endColumn:v.endColumn-k})}});const h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=me(this._injector,S);return{preRedos:[{id:G.id,params:h}],redos:[{id:F.id,params:S}],undos:[{id:F.id,params:R}],preUndos:[{id:G.id,params:C}]}}_checkIsMergeCell(t){return!(t.startRow===t.endRow&&t.startColumn===t.endColumn)}_handleNull(){return{redos:[],undos:[]}}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(Fl.includes(t.id)){if(!t.params)return;const n=this._univerInstanceService.getUniverSheetInstance(t.params.unitId);if(!n)return;const o=n.getSheetBySheetId(t.params.subUnitId);if(!o)return;const{sourceRange:r,targetRange:a}=t.params,l=r.startColumn===a.startColumn&&r.endColumn===a.endColumn,u=l?r.endRow-r.startRow+1:r.endColumn-r.startColumn+1,d=l?r.startRow:r.startColumn,c=l?a.startRow:a.startColumn,m=o.getConfig().mergeData,h=[];m.forEach(v=>{let{startRow:I,endRow:p,startColumn:w,endColumn:M,rangeType:y}=v;i.Rectangle.intersects(v,r)||(l?d<I&&c>p?(I-=u,p-=u):d>p&&c<=I&&(I+=u,p+=u):d<w&&c>M?(w-=u,M-=u):d>M&&c<=w&&(w+=u,M+=u)),v.startRow===v.endRow&&v.startColumn===v.endColumn||h.push({startRow:I,endRow:p,startColumn:w,endColumn:M,rangeType:y})}),o.setMergeData(h),this.disposableCollection.dispose();const{unitId:R,subUnitId:S}=t.params,C=v=>this.refRangeHandle(v,R,S);h.forEach(v=>{this.disposableCollection.add(this._refRangeService.registerRefRange(v,C,R,S))})}if(jl.includes(t.id)){const n=this._univerInstanceService.getUniverSheetInstance(t.params.unitId);if(!n)return;const o=n.getSheetBySheetId(t.params.subUnitId);if(!o)return;const r=o.getConfig().mergeData,a=t.params;if(!a)return;const{range:l}=a,u=t.id.includes("row"),d=t.id.includes("insert"),c=u?l.startRow:l.startColumn,m=u?l.endRow:l.endColumn,h=m-c+1,R=[];r.forEach(I=>{let{startRow:p,endRow:w,startColumn:M,endColumn:y,rangeType:b}=I;d?u?c<=p&&(p+=h,w+=h):c<=M&&(M+=h,y+=h):u?m<p&&(p-=h,w-=h):m<M&&(M-=h,y-=h),I.startRow===I.endRow&&I.startColumn===I.endColumn||R.push({startRow:p,endRow:w,startColumn:M,endColumn:y,rangeType:b})}),o.setMergeData(R),this.disposableCollection.dispose();const{unitId:S,subUnitId:C}=t.params,v=I=>this.refRangeHandle(I,S,C);R.forEach(I=>{this.disposableCollection.add(this._refRangeService.registerRefRange(I,v,S,C))})}}))}},g.MergeCellController=Hl([wt(0,i.Inject(i.ICommandService)),wt(1,i.Inject(g.RefRangeService)),wt(2,i.Inject(i.IUniverInstanceService)),wt(3,i.Inject(i.Injector)),wt(4,i.Inject(g.SheetInterceptorService)),wt(5,i.Inject(g.SheetsSelectionsService))],g.MergeCellController);function Ce(s,e){return e?s.getUniverSheetInstance(e):s.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET)}function fe(s,e){return e?s.getSheetBySheetId(e):s.getActiveSheet()}var Gl=Object.getOwnPropertyDescriptor,zl=(s,e,t,n)=>{for(var o=n>1?void 0:n?Gl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Yl=(s,e)=>(t,n)=>e(t,n,s);let Mn=class extends i.Disposable{constructor(s){super(),this._sheetInterceptorService=s,this._initialize()}_initialize(){this._initInterceptorCellContent()}_initInterceptorCellContent(){this.disposeWithMe(this._sheetInterceptorService.intercept(Ee.CELL_CONTENT,{priority:11,effect:i.InterceptorEffectEnum.Value|i.InterceptorEffectEnum.Style,handler:(s,e,t)=>{var o;const n=e.workbook.getStyles().getStyleByCell(s);return(o=n==null?void 0:n.n)!=null&&o.pattern?t({...s}):(s==null?void 0:s.t)===i.CellValueType.NUMBER&&s.v!==void 0&&s.v!==null&&i.isRealNum(s.v)?t({...s,v:z.stripErrorMargin(Number(s.v))}):t({...s})}}))}};Mn=zl([Yl(0,i.Inject(g.SheetInterceptorService))],Mn);var ql=Object.getOwnPropertyDescriptor,Kl=(s,e,t,n)=>{for(var o=n>1?void 0:n?ql(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},be=(s,e)=>(t,n)=>e(t,n,s);g.SheetPermissionCheckController=class extends i.Disposable{constructor(t,n,o,r,a,l,u,d,c,m){super();f(this,"disposableCollection",new i.DisposableCollection);f(this,"_triggerPermissionUIEvent$",new A.Subject);f(this,"triggerPermissionUIEvent$",this._triggerPermissionUIEvent$.asObservable());this._commandService=t,this._univerInstanceService=n,this._permissionService=o,this._selectionManagerService=r,this._rangeProtectionRuleModel=a,this._worksheetProtectionRuleModel=l,this._localeService=u,this._lexerTreeBuilder=d,this._contextService=c,this._definedNamesService=m,this._initialize()}blockExecuteWithoutPermission(t){throw this._triggerPermissionUIEvent$.next(t),new i.CustomCommandExecutionError("have no permission")}_getPermissionCheck(t,n){let o=!0,r="";switch(t){case it.id:i.isICellData(n.value)&&n.value.f?(o=this._permissionCheckWithFormula(n),r=this._localeService.t("permission.dialog.formulaErr")):o=this._permissionCheckBySetRangeValue({workbookTypes:[re],rangeTypes:[ue],worksheetTypes:[Tt,de]},n);break;case Jt.id:o=this.permissionCheckWithRanges({workbookTypes:[re],rangeTypes:[ue],worksheetTypes:[Tt,de]}),r=this._localeService.t("permission.dialog.editErr");break;case dn.id:case Vt.id:o=this.permissionCheckWithoutRange({worksheetTypes:[ot]}),r=this._localeService.t("permission.dialog.setRowColStyleErr");break;case gn.id:case Rn.id:case Sn.id:o=this.permissionCheckWithoutRange({worksheetTypes:[rt]}),r=this._localeService.t("permission.dialog.setRowColStyleErr");break;case kt.id:case Pt.id:o=this._permissionCheckByMoveCommand(n),r=this._localeService.t("permission.dialog.moveRowColErr");break;case Ye.id:o=this._permissionCheckByMoveRangeCommand(n),r=this._localeService.t("permission.dialog.moveRangeErr");break;case Es.id:o=this._permissionCheckByWorksheetCommand([re,nn]),r=this._localeService.t("permission.dialog.operatorSheetErr"),o===!1&&this._worksheetProtectionRuleModel.resetOrder();break;case cn.id:o=this._permissionCheckByWorksheetCommand([re,sn]),r=this._localeService.t("permission.dialog.operatorSheetErr"),o===!1&&this._worksheetProtectionRuleModel.resetOrder();break;case Os.id:{const{unitId:a,subUnitId:l}=n;o=this._permissionCheckByWorksheetCommand([re,en],a,l),r=this._localeService.t("permission.dialog.operatorSheetErr"),o===!1&&this._worksheetProtectionRuleModel.resetOrder()}break;case At.id:o=this.permissionCheckWithRanges({workbookTypes:[re],rangeTypes:[ue],worksheetTypes:[de,ot]},n.ranges),r=this._localeService.t("permission.dialog.setRowColStyleErr");break;case Wt.id:o=this.permissionCheckWithRanges({workbookTypes:[re],rangeTypes:[ue],worksheetTypes:[de,rt]},n.ranges),r=this._localeService.t("permission.dialog.setRowColStyleErr");break;case fs.id:o=this.permissionCheckWithRanges({workbookTypes:[re],rangeTypes:[ue],worksheetTypes:[de,ot]}),r=this._localeService.t("permission.dialog.setRowColStyleErr");break;case ws.id:o=this.permissionCheckWithRanges({workbookTypes:[re],rangeTypes:[ue],worksheetTypes:[de,rt]}),r=this._localeService.t("permission.dialog.setRowColStyleErr");break;case Ut.id:o=this._permissionCheckWithInsertRangeMove("right"),r=this._localeService.t("permission.dialog.insertOrDeleteMoveRangeErr");break;case at.id:o=this._permissionCheckWithInsertRangeMove("bottom"),r=this._localeService.t("permission.dialog.insertOrDeleteMoveRangeErr");break;case qe.id:o=this._permissionCheckWithInsertRangeMove("left"),r=this._localeService.t("permission.dialog.insertOrDeleteMoveRangeErr");break;case Ke.id:o=this._permissionCheckWithInsertRangeMove("top"),r=this._localeService.t("permission.dialog.insertOrDeleteMoveRangeErr");break}o||this.blockExecuteWithoutPermission(r)}_initialize(){this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{this._getPermissionCheck(t.id,t==null?void 0:t.params)})),this.disposeWithMe(this._commandService.onCommandExecuted(t=>{var n;if(t.id===$t.id){const o=t.params,{unitId:r=(n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:n.getUnitId(),subUnitId:a}=o;if(!r||!a)return;const l=this._worksheetProtectionRuleModel.getRule(r,a),u=this._rangeProtectionRuleModel.getSubunitRuleList(r,a);l&&this._worksheetProtectionRuleModel.ruleRefresh(l.permissionId),u.length&&this._rangeProtectionRuleModel.ruleRefresh(a)}}))}_permissionCheckWithInsertRangeMove(t){var c;const n=U(this._univerInstanceService);if(!n)return!1;const{worksheet:o,unitId:r,subUnitId:a}=n,l=i.Tools.deepClone((c=this._selectionManagerService.getCurrentLastSelection())==null?void 0:c.range);return!(!l||(t==="top"||t==="bottom"?l.endRow=o.getRowCount()-1:(t==="left"||t==="right")&&(l.endColumn=o.getColumnCount()-1),this._rangeProtectionRuleModel.getSubunitRuleList(r,a).map(m=>m.ranges).flat().some(m=>i.Rectangle.getIntersects(l,m))))}_permissionCheckByWorksheetCommand(t,n,o){var c,m;const r=U(this._univerInstanceService,{unitId:n,subUnitId:o});if(!r)return!1;const{unitId:a,subUnitId:l}=r,u=this._worksheetProtectionRuleModel.getRule(a,l),d=this._rangeProtectionRuleModel.getSubunitRuleList(a,l).length>0;return u||d?(m=(c=this._permissionService.getPermissionPoint(new tn(a).id))==null?void 0:c.value)!=null?m:!1:this._permissionService.composePermission(t.map(h=>new h(a).id)).every(h=>h.value)}permissionCheckWithoutRange(t){var R,S,C,v;const n=U(this._univerInstanceService);if(!n)return!1;const{worksheet:o,unitId:r,subUnitId:a}=n,l=this._selectionManagerService.getCurrentLastSelection();if(!l)return!0;const u=(S=(R=l==null?void 0:l.primary)==null?void 0:R.actualRow)!=null?S:0,d=(v=(C=l==null?void 0:l.primary)==null?void 0:C.actualColumn)!=null?v:0,{workbookTypes:c,worksheetTypes:m,rangeTypes:h}=t;return!(c&&c.some(p=>{var y,b;const w=new p(r);return((b=(y=this._permissionService.getPermissionPoint(w.id))==null?void 0:y.value)!=null?b:!1)===!1})===!0||m&&m.some(p=>{var y,b;const w=new p(r,a);return((b=(y=this._permissionService.getPermissionPoint(w.id))==null?void 0:y.value)!=null?b:!1)===!1})===!0||h&&h.some(p=>{var k,E,T,P,N;const w=(E=(k=o.getCell(u,d))==null?void 0:k.selectionProtection)==null?void 0:E[0];if(!(w!=null&&w.ruleId))return!1;const M=(T=this._rangeProtectionRuleModel.getRule(r,a,w.ruleId))==null?void 0:T.permissionId;if(!M)return!1;const y=new p(r,a,M);return((N=(P=this._permissionService.getPermissionPoint(y.id))==null?void 0:P.value)!=null?N:!1)===!1})===!0)}permissionCheckWithRanges(t,n,o,r){var S;const a=U(this._univerInstanceService);if(!a)return!1;const{workbook:l,worksheet:u}=a;o||(o=l.getUnitId()),r||(r=u.getSheetId());const d=n!=null?n:(S=this._selectionManagerService.getCurrentSelections())==null?void 0:S.map(C=>C.range);if(!d)return!1;const{workbookTypes:c,worksheetTypes:m,rangeTypes:h}=t,R=[];return c&&R.push(...c.map(C=>new C(o).id)),m&&R.push(...m.map(C=>new C(o,r).id)),h&&this._rangeProtectionRuleModel.getSubunitRuleList(o,r).forEach(C=>{d.some(I=>C.ranges.some(p=>i.Rectangle.intersects(p,I)))&&R.push(...h.map(I=>new I(o,r,C.permissionId).id))}),R.length?this._permissionService.composePermission(R).every(C=>C.value):!0}_permissionCheckByMoveCommand(t){const n=U(this._univerInstanceService);if(!n)return!1;const{worksheet:o,unitId:r,subUnitId:a}=n,l=t.toRange;l.endRow===o.getRowCount()-1?l.endColumn=l.startColumn:l.endRow=l.startRow;const u=this._rangeProtectionRuleModel.getSubunitRuleList(r,a).reduce((d,c)=>[...d,...c.ranges],[]).filter(d=>i.Rectangle.intersects(d,l));return u.length>0?!1:(u.forEach(d=>{var c,m;for(let h=d.startRow;h<=d.endRow;h++)for(let R=d.startColumn;R<=d.endColumn;R++){const S=(m=(c=o.getCell(h,R))==null?void 0:c.selectionProtection)==null?void 0:m[0];if((S==null?void 0:S[_.Edit])===!1)return!1}}),!0)}_permissionCheckByMoveRangeCommand(t){const n=U(this._univerInstanceService);if(!n)return!1;const{worksheet:o,unitId:r,subUnitId:a}=n,l=t.toRange,u=this._rangeProtectionRuleModel.getSubunitRuleList(r,a).reduce((d,c)=>[...d,...c.ranges],[]).filter(d=>i.Rectangle.intersects(d,l));return u.length>0?!1:(u.forEach(d=>{var c,m;for(let h=d.startRow;h<=d.endRow;h++)for(let R=d.startColumn;R<=d.endColumn;R++){const S=(m=(c=o.getCell(h,R))==null?void 0:c.selectionProtection)==null?void 0:m[0];if((S==null?void 0:S[_.Edit])===!1)return!1}}),!0)}_permissionCheckBySetRangeValue(t,n){let o=[];n.range?o=[n.range]:o=[new i.ObjectMatrix(n.value).getDataRange()];const{unitId:r,subUnitId:a}=n;return this.permissionCheckWithRanges(t,o,r,a)}_permissionCheckWithFormula(t){var a,l,u,d,c;const n=t.value,o=t.range,r=n.f;if(r){const m=r.substring(1),h=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),R=(a=t.unitId)!=null?a:h.getUnitId(),S=this._definedNamesService.getValueByName(R,m);if(S){let C=S.formulaOrRefString;C.startsWith(z.operatorToken.EQUALS)&&(C=C.slice(1));const v=C.split(",");for(let I=0;I<v.length;I++){const p=v[I],w=z.deserializeRangeWithSheet(p);if(w.sheetName){const M=h.getSheetBySheetName(w.sheetName);if(!M)return!0;const{startRow:y,endRow:b,startColumn:k,endColumn:E}=w.range;for(let T=y;T<=b;T++)for(let P=k;P<=E;P++){const N=(u=(l=M.getCell(T,P))==null?void 0:l.selectionProtection)==null?void 0:u[0];if((N==null?void 0:N[_.View])===!1)return!1}}}return!0}else{const C=this._lexerTreeBuilder.sequenceNodesBuilder(r);if(!C)return!0;for(let v=0;v<C.length;v++){const I=C[v];if(typeof I=="string"||I.nodeType!==z.sequenceNodeType.REFERENCE)continue;const{token:p}=I,w=z.deserializeRangeWithSheetWithCache(p),M=w.unitId?this._univerInstanceService.getUnit(w.unitId):this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!M)return!0;let y=w.sheetName?M.getSheetBySheetName(w.sheetName):M.getActiveSheet();const b=M.getUnitId();if(w.sheetName){if(y=M.getSheetBySheetName(w.sheetName),!y)return!0;const N=y==null?void 0:y.getSheetId();if(!this._permissionService.getPermissionPoint(new Et(b,N).id))return!1}if(!y)return!0;const{startRow:k,endRow:E,startColumn:T,endColumn:P}=w.range;for(let N=k;N<=E;N++)for(let W=T;W<=P;W++){const V=(c=(d=y.getCell(N,W))==null?void 0:d.selectionProtection)==null?void 0:c[0];if((V==null?void 0:V[_.View])===!1)return!1}}return!0}}if(o){const m=U(this._univerInstanceService);if(!m)return!1;const h=t.unitId||m.unitId,R=t.subUnitId||m.subUnitId,C=this._rangeProtectionRuleModel.getSubunitRuleList(h,R).filter(I=>I.ranges.some(p=>i.Rectangle.intersects(p,o))).map(I=>new ue(h,R,I.permissionId).id);if(!this._permissionService.composePermission(C).every(I=>I.value))return!1}return!0}},g.SheetPermissionCheckController=Kl([be(0,i.ICommandService),be(1,i.IUniverInstanceService),be(2,i.IPermissionService),be(3,i.Inject(g.SheetsSelectionsService)),be(4,i.Inject(K)),be(5,i.Inject(pe)),be(6,i.Inject(i.LocaleService)),be(7,i.Inject(z.LexerTreeBuilder)),be(8,i.IContextService),be(9,z.IDefinedNamesService)],g.SheetPermissionCheckController);var Jl=Object.getOwnPropertyDescriptor,xl=(s,e,t,n)=>{for(var o=n>1?void 0:n?Jl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Gs=(s,e)=>(t,n)=>e(t,n,s);g.RangeProtectionCache=class extends i.Disposable{constructor(t,n,o){super();f(this,"_cellRuleCache",new Map);f(this,"_permissionIdCache",new Map);f(this,"_cellInfoCache",new Map);f(this,"_rowInfoCache",new Map);f(this,"_colInfoCache",new Map);this._ruleModel=t,this._permissionService=n,this._univerInstanceService=o,this._initUpdateCellRuleCache(),this._initUpdateCellInfoCache(),this._initUpdateRowColInfoCache(),this._initCache()}_initCache(){this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).forEach(t=>{t.getSheets().forEach(n=>{const o=t.getUnitId(),r=n.getSheetId();this.reBuildCache(o,r)})})}_initUpdateCellInfoCache(){this._permissionService.permissionPointUpdate$.pipe(A.filter(t=>t.type===O.SelectRange),A.map(t=>t)).subscribe(t=>{const{subUnitId:n,unitId:o,permissionId:r}=t,a=this._permissionIdCache.get(r);if(!a)return;const l=this._ruleModel.getRule(o,n,a);if(!l)return;const u=this._ensureCellInfoMap(o,n);l.ranges.forEach(d=>{const{startRow:c,endRow:m,startColumn:h,endColumn:R}=d;for(let S=c;S<=m;S++)for(let C=h;C<=R;C++)u.delete(`${S}-${C}`)})}),this._ruleModel.ruleChange$.subscribe(t=>{var a;const{unitId:n,subUnitId:o}=t,r=this._ensureCellInfoMap(n,o);t.rule.ranges.forEach(l=>{i.Range.foreach(l,(u,d)=>{r.delete(`${u}-${d}`)})}),t.type==="set"&&((a=t.oldRule)==null||a.ranges.forEach(l=>{i.Range.foreach(l,(u,d)=>{this._cellInfoCache.delete(`${u}-${d}`)})}))})}_initUpdateCellRuleCache(){this._ruleModel.ruleChange$.subscribe(t=>{const{type:n}=t;n==="add"?this._addCellRuleCache(t):n==="delete"?this._deleteCellRuleCache(t):(this._deleteCellRuleCache({...t,rule:t.oldRule}),this._addCellRuleCache(t))})}_ensureRuleMap(t,n){let o=this._cellRuleCache.get(t);o||(o=new Map,this._cellRuleCache.set(t,o));let r=o.get(n);return r||(r=new Map,o.set(n,r)),r}_ensureCellInfoMap(t,n){let o=this._cellInfoCache.get(t);o||(o=new Map,this._cellInfoCache.set(t,o));let r=o.get(n);return r||(r=new Map,o.set(n,r)),r}_ensureRowColInfoMap(t,n,o){let r=o==="row"?this._rowInfoCache.get(t):this._colInfoCache.get(t);r||(r=new Map,o==="row"?this._rowInfoCache.set(t,r):this._colInfoCache.set(t,r));let a=r.get(n);return a||(a=new Map,r.set(n,a)),a}_addCellRuleCache(t){const{subUnitId:n,unitId:o,rule:r}=t,a=this._ensureRuleMap(o,n);r.ranges.forEach(l=>{const{startRow:u,endRow:d,startColumn:c,endColumn:m}=l;for(let h=u;h<=d;h++)for(let R=c;R<=m;R++)a.set(`${h}-${R}`,r.id)}),this._permissionIdCache.set(r.permissionId,r.id)}_deleteCellRuleCache(t){const{subUnitId:n,unitId:o,rule:r}=t,a=this._ensureRuleMap(o,n),l=this._ensureCellInfoMap(o,n);r.ranges.forEach(u=>{const{startRow:d,endRow:c,startColumn:m,endColumn:h}=u;for(let R=d;R<=c;R++)for(let S=m;S<=h;S++)a.delete(`${R}-${S}`),l.delete(`${R}-${S}`)}),this._permissionIdCache.delete(r.permissionId)}_getSelectionActions(t,n,o){var c,m,h,R,S,C,v,I,p,w,M,y;const r=(h=(m=this._permissionService.getPermissionPoint((c=new ue(t,n,o.permissionId))==null?void 0:c.id))==null?void 0:m.value)!=null?h:!0,a=(C=(S=this._permissionService.getPermissionPoint((R=new Qt(t,n,o.permissionId))==null?void 0:R.id))==null?void 0:S.value)!=null?C:!0,l=(p=(I=this._permissionService.getPermissionPoint((v=new Ps(t,n,o.permissionId))==null?void 0:v.id))==null?void 0:I.value)!=null?p:!1,u=(y=(M=this._permissionService.getPermissionPoint((w=new Us(t,n,o.permissionId))==null?void 0:w.id))==null?void 0:M.value)!=null?y:!1;return{[_.Edit]:r,[_.View]:a,[_.ManageCollaborator]:l,[_.Delete]:u}}reBuildCache(t,n){const o=this._ensureRuleMap(t,n),r=this._ensureCellInfoMap(t,n);o.clear(),r.clear();const a=this._ensureRowColInfoMap(t,n,"row"),l=this._ensureRowColInfoMap(t,n,"col");a.clear(),l.clear(),this._ruleModel.getSubunitRuleList(t,n).forEach(u=>{const d=this._getSelectionActions(t,n,u),c={...d,ruleId:u.id,ranges:u.ranges};u.ranges.forEach(m=>{const{startRow:h,endRow:R,startColumn:S,endColumn:C}=m;for(let v=h;v<=R;v++){const I=a.get(`${v}`);I?I.set(u.id,d):a.set(`${v}`,new Map([[u.id,d]]));for(let p=S;p<=C;p++){o.set(`${v}-${p}`,u.id),r.set(`${v}-${p}`,c);const w=l.get(`${p}`);w?w.set(u.id,d):l.set(`${p}`,new Map([[u.id,d]]))}}}),this._permissionIdCache.set(u.permissionId,u.id)})}getRowPermissionInfo(t,n,o,r){var u;const a=(u=this._rowInfoCache.get(t))==null?void 0:u.get(n);if(!a)return!0;const l=a.get(`${o}`);return l?r.every(d=>{for(const c of l.values())if(c[d]===!1)return!1;return!0}):!0}getColPermissionInfo(t,n,o,r){var u;const a=(u=this._colInfoCache.get(t))==null?void 0:u.get(n);if(!a)return!0;const l=a.get(`${o}`);return l?r.every(d=>{for(const c of l.values())if(c[d]===!1)return!1;return!0}):!0}_initUpdateRowColInfoCache(){this._permissionService.permissionPointUpdate$.pipe(A.filter(t=>t.type===O.SelectRange),A.map(t=>t)).subscribe({next:t=>{const{subUnitId:n,unitId:o,permissionId:r}=t,a=this._permissionIdCache.get(r);if(!a)return;const l=this._ruleModel.getRule(o,n,a);if(!l)return;const u=this._ensureRowColInfoMap(o,n,"row"),d=this._ensureRowColInfoMap(o,n,"col"),c=this._getSelectionActions(o,n,l);l.ranges.forEach(m=>{const{startRow:h,endRow:R,startColumn:S,endColumn:C}=m;for(let v=h;v<=R;v++){const I=u.get(`${v}`);I?I.set(a,c):u.set(`${v}`,new Map([[a,c]]));for(let p=S;p<=C;p++){const w=d.get(`${p}`);w?w.set(a,c):d.set(`${p}`,new Map([[a,c]]))}}})}}),this._ruleModel.ruleChange$.subscribe(t=>{if(t.type==="delete"){const{unitId:n,subUnitId:o,rule:r}=t,a=this._ensureRowColInfoMap(n,o,"row"),l=this._ensureRowColInfoMap(n,o,"col");r.ranges.forEach(u=>{const{startRow:d,endRow:c,startColumn:m,endColumn:h}=u;for(let R=d;R<=c;R++){const S=a.get(`${R}`);S==null||S.delete(r.id);for(let C=m;C<=h;C++){const v=l.get(`${C}`);v==null||v.delete(r.id)}}})}})}getCellInfo(t,n,o,r){var c,m;const a=this._ensureCellInfoMap(t,n),l=a.get(`${o}-${r}`);if(l)return l;const u=(m=(c=this._cellRuleCache.get(t))==null?void 0:c.get(n))==null?void 0:m.get(`${o}-${r}`);if(!u)return;const d=this._ruleModel.getRule(t,n,u);if(d){const R={...this._getSelectionActions(t,n,d),ruleId:u,ranges:d.ranges};return a.set(`${o}-${r}`,R),R}}deleteUnit(t){this._cellRuleCache.delete(t),this._cellInfoCache.delete(t),this._rowInfoCache.delete(t),this._colInfoCache.delete(t);const n=this._univerInstanceService.getUnit(t);n==null||n.getSheets().forEach(o=>{const r=o.getSheetId();this._ruleModel.getSubunitRuleList(t,r).forEach(a=>{this._permissionIdCache.delete(a.permissionId)})})}},g.RangeProtectionCache=xl([Gs(0,i.Inject(K)),Gs(1,i.Inject(i.IPermissionService)),Gs(2,i.Inject(i.IUniverInstanceService))],g.RangeProtectionCache);var Xl=Object.getOwnPropertyDescriptor,Zl=(s,e,t,n)=>{for(var o=n>1?void 0:n?Xl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},ve=(s,e)=>(t,n)=>e(t,n,s);g.SheetPermissionInitController=class extends i.Disposable{constructor(e,t,n,o,r,a,l,u,d,c,m){super(),this._univerInstanceService=e,this._permissionService=t,this._authzIoService=n,this._rangeProtectionRuleModel=o,this._worksheetProtectionRuleModel=r,this._userManagerService=a,this._worksheetProtectionPointRuleModel=l,this._sheetInterceptorService=u,this._undoRedoService=d,this._commandService=c,this._rangeProtectionCache=m}initPermission(){this._initRangePermissionFromSnapshot(),this._initRangePermissionChange(),this._initWorksheetPermissionFromSnapshot(),this._initWorksheetPermissionChange(),this._initWorksheetPermissionPointsChange(),this._initWorkbookPermissionFromSnapshot(),this._initUserChange(),this._refreshPermissionByCollaCreate()}async _initRangePermissionFromSnapshot(){const e=async t=>{const n=[],o=t.getUnitId(),r=t.getSheets(),a=new Map;if(r.forEach(l=>{const u=l.getSheetId();this._rangeProtectionRuleModel.getSubunitRuleList(o,u).forEach(d=>{a.set(d.permissionId,d),n.push({objectID:d.permissionId,unitID:o,objectType:O.SelectRange,actions:Be})})}),!n.length){this._rangeProtectionRuleModel.changeRuleInitState(!0);return}this._authzIoService.batchAllowed(n).then(l=>{l.forEach(u=>{const d=a.get(u.objectID);d&&se().forEach(c=>{const m=new c(o,d.subUnitId,u.objectID),h=m.subType,R=u.actions.find(S=>S.action===h);(R==null?void 0:R.allowed)!==void 0&&this._permissionService.updatePermissionPoint(m.id,R.allowed)})}),this._rangeProtectionRuleModel.changeRuleInitState(!0)})};await Promise.all(this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).map(t=>e(t))),this._rangeProtectionRuleModel.changeRuleInitState(!0)}_initRangePermissionChange(){this.disposeWithMe(this._rangeProtectionRuleModel.ruleChange$.subscribe(e=>{e.type!=="delete"?this._authzIoService.allowed({objectID:e.rule.permissionId,unitID:e.unitId,objectType:O.SelectRange,actions:Be}).then(t=>{se().forEach(n=>{if(e.type==="set"){const{rule:u,oldRule:d}=e;if(u.permissionId===(d==null?void 0:d.permissionId))return}const o=e.rule,r=new n(o.unitId,o.subUnitId,o.permissionId),a=r.subType,l=t.find(u=>u.action===a);l&&this._permissionService.updatePermissionPoint(r.id,l.allowed)}),this._rangeProtectionRuleModel.ruleRefresh(e.rule.permissionId)}):this._rangeProtectionRuleModel.getSubunitRuleList(e.unitId,e.subUnitId).length===0&&(this._worksheetProtectionPointRuleModel.deleteRule(e.unitId,e.subUnitId),[...he()].forEach(n=>{const o=new n(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(o.id,o.value)}))}))}async initWorkbookPermissionChange(e){var n;const t=e||((n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:n.getUnitId());t&&this._authzIoService.allowed({objectID:t,objectType:O.Workbook,unitID:t,actions:Sr}).then(o=>{It().forEach(r=>{const a=new r(t),l=a.subType,u=o.find(d=>d.action===l);u&&this._permissionService.updatePermissionPoint(a.id,u.allowed)})})}async _initWorkbookPermissionFromSnapshot(){await Promise.all(this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).map(e=>this.initWorkbookPermissionChange(e.getUnitId())))}_initWorksheetPermissionChange(){this.disposeWithMe(this._worksheetProtectionRuleModel.ruleChange$.subscribe(e=>{e.type!=="delete"?this._authzIoService.allowed({objectID:e.rule.permissionId,unitID:e.unitId,objectType:O.Worksheet,actions:Be}).then(t=>{oe().forEach(n=>{const o=new n(e.unitId,e.subUnitId),r=o.subType,a=t.find(l=>l.action===r);a&&this._permissionService.updatePermissionPoint(o.id,a.allowed)}),this._worksheetProtectionRuleModel.ruleRefresh(e.rule.permissionId)}):([...oe(),...he()].forEach(t=>{const n=new t(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(n.id,!0)}),this._worksheetProtectionPointRuleModel.deleteRule(e.unitId,e.subUnitId))}))}_initWorksheetPermissionPointsChange(){this.disposeWithMe(this._worksheetProtectionPointRuleModel.pointChange$.subscribe(e=>{this._authzIoService.allowed({objectID:e.permissionId,unitID:e.unitId,objectType:O.Worksheet,actions:mn}).then(t=>{he().forEach(n=>{const o=new n(e.unitId,e.subUnitId),r=o.subType,a=t.find(l=>l.action===r);a&&this._permissionService.updatePermissionPoint(o.id,a.allowed)})})}))}async _initWorksheetPermissionFromSnapshot(){const e=async t=>{const n=[],o=t.getUnitId(),r=t.getSheets(),a=new Map;if(r.forEach(l=>{const u=l.getSheetId(),d=this._worksheetProtectionRuleModel.getRule(o,u);d&&(a.set(d.permissionId,d),n.push({objectID:d.permissionId,unitID:o,objectType:O.Worksheet,actions:Be}));const c=this._worksheetProtectionPointRuleModel.getRule(o,u);c&&(a.set(c.permissionId,c),n.push({objectID:c.permissionId,unitID:o,objectType:O.Worksheet,actions:mn}))}),!n.length){this._worksheetProtectionRuleModel.changeRuleInitState(!0);return}this._authzIoService.batchAllowed(n).then(l=>{l.forEach(u=>{const d=a.get(u.objectID);d&&[...oe(),...he()].forEach(c=>{const m=new c(o,d.subUnitId),h=m.subType,R=u.actions.find(S=>S.action===h);(R==null?void 0:R.allowed)!==void 0&&this._permissionService.updatePermissionPoint(m.id,R.allowed)})}),this._worksheetProtectionRuleModel.changeRuleInitState(!0)})};await Promise.all(this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).map(t=>e(t))),this._worksheetProtectionRuleModel.changeRuleInitState(!0)}_initUserChange(){this.disposeWithMe(this._userManagerService.currentUser$.pipe(A.skip(1)).subscribe(()=>{const e=this._permissionService.getAllPermissionPoint();this._permissionService.clearPermissionMap(),this._worksheetProtectionRuleModel.changeRuleInitState(!1),this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).forEach(n=>{const o=n.getUnitId();It().forEach(r=>{let a=new r(o);e.has(a.id)&&(a=e.get(a.id)),this._permissionService.addPermissionPoint(a)}),n.getSheets().forEach(r=>{const a=r.getSheetId();[...oe(),...he()].forEach(u=>{let d=new u(o,a);e.has(d.id)&&(d=e.get(d.id)),this._permissionService.addPermissionPoint(d)}),this._rangeProtectionRuleModel.getSubunitRuleList(o,a).forEach(u=>{se().forEach(d=>{let c=new d(o,a,u.permissionId);e.has(c.id)&&(c=e.get(c.id)),this._permissionService.addPermissionPoint(c)})})}),this._initWorkbookPermissionFromSnapshot(),this._initWorksheetPermissionFromSnapshot(),this._initRangePermissionFromSnapshot()})}))}refreshPermission(e,t){const n=this._worksheetProtectionRuleModel.getTargetByPermissionId(e,t);let o=!1;if(n){const[l,u]=n;this._authzIoService.allowed({objectID:t,unitID:e,objectType:O.Worksheet,actions:Be}).then(d=>{let c="";oe().forEach(m=>{var C;const h=new m(e,u),R=h.subType,S=d.find(v=>v.action===R);S&&(((C=this._permissionService.getPermissionPoint(h.id))==null?void 0:C.value)!==S.allowed&&(o=!0),this._permissionService.updatePermissionPoint(h.id,S.allowed),c+=`${S.action}_${S.allowed}`)}),this._worksheetProtectionRuleModel.ruleRefresh(`${t}_${c}`),o&&this._undoRedoService.clearUndoRedo(e)})}const r=this._worksheetProtectionPointRuleModel.getTargetByPermissionId(e,t);if(r){const[l,u]=r;this._authzIoService.allowed({objectID:t,unitID:e,objectType:O.Worksheet,actions:mn}).then(d=>{he().forEach(c=>{var S;const m=new c(e,u),h=m.subType,R=d.find(C=>C.action===h);R&&(((S=this._permissionService.getPermissionPoint(m.id))==null?void 0:S.value)!==R.allowed&&(o=!0),this._permissionService.updatePermissionPoint(m.id,R.allowed))}),o&&this._undoRedoService.clearUndoRedo(e)})}const a=this._rangeProtectionRuleModel.getTargetByPermissionId(e,t);if(a){const[l,u]=a;this._authzIoService.allowed({objectID:t,unitID:e,objectType:O.SelectRange,actions:Be}).then(d=>{let c="";se().forEach(m=>{var C;const h=new m(e,u,t),R=h.subType,S=d.find(v=>v.action===R);S&&(((C=this._permissionService.getPermissionPoint(h.id))==null?void 0:C.value)!==S.allowed&&(o=!0),this._permissionService.updatePermissionPoint(h.id,S.allowed),c+=`${S.action}_${S.allowed}`)}),this._rangeProtectionRuleModel.ruleRefresh(`${t}_${c}`),o&&this._undoRedoService.clearUndoRedo(e)})}}_refreshPermissionByCollaCreate(){this.disposeWithMe(this._commandService.onCommandExecuted((e,t)=>{if(t!=null&&t.fromCollab&&(e.id===ae.id||e.id===Oe.id||e.id===hn.id)){const n=e.params;this._undoRedoService.clearUndoRedo(n.unitId)}}))}},g.SheetPermissionInitController=Zl([ve(0,i.IUniverInstanceService),ve(1,i.IPermissionService),ve(2,i.IAuthzIoService),ve(3,i.Inject(K)),ve(4,i.Inject(pe)),ve(5,i.Inject(i.UserManagerService)),ve(6,i.Inject(vt)),ve(7,i.Inject(g.SheetInterceptorService)),ve(8,i.Inject(i.IUndoRedoService)),ve(9,i.Inject(i.ICommandService)),ve(10,i.Inject(g.RangeProtectionCache))],g.SheetPermissionInitController);var Ql=Object.getOwnPropertyDescriptor,eu=(s,e,t,n)=>{for(var o=n>1?void 0:n?Ql(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},yn=(s,e)=>(t,n)=>e(t,n,s);let _n=class extends i.Disposable{constructor(s,e,t,n){super(),this._permissionService=s,this._worksheetProtectionRuleModel=e,this._sheetInterceptorService=t,this._rangeProtectionCache=n,this._initViewModelByRangeInterceptor(),this._initViewModelBySheetInterceptor()}_initViewModelByRangeInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(Ee.CELL_CONTENT,{priority:999,effect:i.InterceptorEffectEnum.Value|i.InterceptorEffectEnum.Style,handler:(s={},e,t)=>{const{unitId:n,subUnitId:o,row:r,col:a}=e,l=this._rangeProtectionCache.getCellInfo(n,o,r,a);if(l){const u=l[_.View]===!1,d={...s,selectionProtection:[l]};return u?(delete d.s,delete d.v,delete d.p,d):t(d)}return t(s)}}))}_initViewModelBySheetInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(Ee.CELL_CONTENT,{priority:999,effect:i.InterceptorEffectEnum.Value|i.InterceptorEffectEnum.Style,handler:(s={},e,t)=>{var a,l,u,d,c;const{unitId:n,subUnitId:o}=e,r=this._worksheetProtectionRuleModel.getRule(n,o);if(r!=null&&r.permissionId){const m=[{[_.View]:(l=(a=this._permissionService.getPermissionPoint(new Et(n,o).id))==null?void 0:a.value)!=null?l:!1,[_.Edit]:(d=(u=this._permissionService.getPermissionPoint(new de(n,o).id))==null?void 0:u.value)!=null?d:!1}],h=!((c=m[0])!=null&&c[_.View]),R={...s,hasWorksheetRule:!0,selectionProtection:m};return h?(delete R.s,delete R.v,delete R.p,R):t(R)}return t(s)}}))}};_n=eu([yn(0,i.IPermissionService),yn(1,i.Inject(pe)),yn(2,i.Inject(g.SheetInterceptorService)),yn(3,i.Inject(g.RangeProtectionCache))],_n);var tu=Object.getOwnPropertyDescriptor,nu=(s,e,t,n)=>{for(var o=n>1?void 0:n?tu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Zr=(s,e)=>(t,n)=>e(t,n,s);g.RangeProtectionRenderModel=class{constructor(e,t){f(this,"_cache",new i.LRUMap(1e4));this._selectionProtectionRuleModel=e,this._permissionService=t,this._init()}_init(){this._permissionService.permissionPointUpdate$.pipe(yt.filter(e=>e.type===O.SelectRange),yt.filter(e=>se().some(t=>e instanceof t)),yt.map(e=>e)).subscribe(e=>{const t=this._selectionProtectionRuleModel.getSubunitRuleList(e.unitId,e.subUnitId);for(const n of t)n.permissionId===e.permissionId&&n.ranges.forEach(o=>{i.Range.foreach(o,(r,a)=>{const l=this._createKey(e.unitId,e.subUnitId,r,a);this._cache.delete(l)})})}),this._selectionProtectionRuleModel.ruleChange$.subscribe(e=>{var t;e.rule.ranges.forEach(n=>{i.Range.foreach(n,(o,r)=>{const a=this._createKey(e.unitId,e.subUnitId,o,r);this._cache.delete(a)})}),e.type==="set"&&((t=e.oldRule)==null||t.ranges.forEach(n=>{i.Range.foreach(n,(o,r)=>{const a=this._createKey(e.unitId,e.subUnitId,o,r);this._cache.delete(a)})}))})}_createKey(e,t,n,o){return`${e}_${t}_${n}_${o}`}getCellInfo(e,t,n,o){const r=this._selectionProtectionRuleModel.getSubunitRuleList(e,t),a=[];if(!r||!r.length)return a;const l=this._createKey(e,t,n,o),u=this._cache.get(l);if(u)return u;const d=[];for(const c of r)if(c.ranges.some(m=>m.startRow<=n&&m.endRow>=n&&m.startColumn<=o&&m.endColumn>=o)){const m=se().reduce((h,R)=>{var v;const S=new R(e,t,c.permissionId),C=this._permissionService.getPermissionPoint(S.id);return h[S.subType]=(v=C==null?void 0:C.value)!=null?v:S.value,h},{});d.push({...m,ruleId:c.id,ranges:c.ranges})}return this._cache.set(l,d),d}clear(){this._cache.clear()}},g.RangeProtectionRenderModel=nu([Zr(0,i.Inject(K)),Zr(1,i.Inject(i.IPermissionService))],g.RangeProtectionRenderModel);const zs=i.createIdentifier("univer.exclusive-range-service");class Qr extends i.Disposable{constructor(){super(...arguments);f(this,"_exclusiveRanges",new Map);f(this,"_exclusiveRangesChange$",new A.Subject);f(this,"exclusiveRangesChange$",this._exclusiveRangesChange$.asObservable())}_ensureUnitMap(t){return this._exclusiveRanges.has(t)||this._exclusiveRanges.set(t,new Map),this._exclusiveRanges.get(t)}_ensureSubunitMap(t,n){const o=this._ensureUnitMap(t);return o.has(n)||o.set(n,new Map),o.get(n)}_ensureFeature(t,n,o){const r=this._ensureSubunitMap(t,n);return r.has(o)||r.set(o,[]),r.get(o)}addExclusiveRange(t,n,o,r){const a=this._ensureFeature(t,n,o);a.push(...r),this._exclusiveRangesChange$.next({unitId:t,subUnitId:n,ranges:a.map(l=>l.range)})}getExclusiveRanges(t,n,o){var r,a;return(a=(r=this._exclusiveRanges.get(t))==null?void 0:r.get(n))==null?void 0:a.get(o)}clearExclusiveRanges(t,n,o){const r=this.getExclusiveRanges(t,n,o);this._exclusiveRangesChange$.next({unitId:t,subUnitId:n,ranges:(r==null?void 0:r.map(a=>a.range))||[]}),this._ensureFeature(t,n,o),this._exclusiveRanges.get(t).get(n).set(o,[])}clearExclusiveRangesByGroupId(t,n,o,r){const a=this.getExclusiveRanges(t,n,o);this._exclusiveRangesChange$.next({unitId:t,subUnitId:n,ranges:(a==null?void 0:a.map(u=>u.range))||[]});const l=this.getExclusiveRanges(t,n,o);if(l){const u=l.filter(d=>d.groupId!==r);this._exclusiveRanges.get(t).get(n).set(o,u)}}getInterestGroupId(t){const n=[];return t.forEach(o=>{var d;const r=o.range,{unitId:a,sheetId:l}=r;if(!a||!l)return;const u=(d=this._exclusiveRanges.get(a))==null?void 0:d.get(l);if(u)for(const c of u.keys()){const m=u.get(c);if(m){for(const h of m)if(i.Rectangle.intersects(r,h.range)){n.push(c);break}}}}),n}}var su=Object.getOwnPropertyDescriptor,ou=(s,e,t,n)=>{for(var o=n>1?void 0:n?su(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Ys=(s,e)=>(t,n)=>e(t,n,s);g.NumfmtService=class extends i.Disposable{constructor(e,t,n){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._logService=n}getValue(e,t,n,o){const r=this._univerInstanceService.getUniverSheetInstance(e);if(!r)return;const a=r==null?void 0:r.getSheetBySheetId(t);if(!a)return;const l=r.getStyles(),u=a.getCellRaw(n,o);if(u!=null&&u.s){const d=l.get(u.s);if(d!=null&&d.n)return d.n}return null}deleteValues(e,t,n){const o=this._univerInstanceService.getUniverSheetInstance(e);if(!o)return;const r=o==null?void 0:o.getSheetBySheetId(t);if(!r)return;const a=o.getStyles();n.forEach(l=>{i.Range.foreach(l,(u,d)=>{const c=r.getCellRaw(u,d);if(!c)return;const m=c==null?void 0:c.s,R={...m&&a.get(m)||{}};delete R.n;const S=a.setValue(R);c.s=S})})}setValues(e,t,n){const o=this._univerInstanceService.getUniverSheetInstance(e);if(!o)return;const r=o==null?void 0:o.getSheetBySheetId(t);if(!r)return;const a=o.getStyles(),l=r.getCellMatrix();n.forEach(u=>{u.ranges.forEach(d=>{i.Range.foreach(d,(c,m)=>{const h=r.getCellRaw(c,m);if(h){const S={...a.getStyleByCell(h)||{},n:{pattern:u.pattern}},C=a.setValue(S);h.s=C}else{const R={n:{pattern:u.pattern}},S=a.setValue(R);S&&l.setValue(c,m,{s:S})}})})})}},g.NumfmtService=ou([Ys(0,i.IResourceManagerService),Ys(1,i.IUniverInstanceService),Ys(2,i.ILogService)],g.NumfmtService);var ru=Object.getOwnPropertyDescriptor,iu=(s,e,t,n)=>{for(var o=n>1?void 0:n?ru(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},je=(s,e)=>(t,n)=>e(t,n,s);const ei=[Re.id,ye.id,ce.id,Se.id],ti=[Ue.id,Pe.id];g.RangeProtectionRefRangeService=class extends i.Disposable{constructor(t,n,o,r,a,l,u,d){super();f(this,"disposableCollection",new i.DisposableCollection);this._selectionProtectionRuleModel=t,this._univerInstanceService=n,this._commandService=o,this._refRangeService=r,this._selectionProtectionRenderModel=a,this._rangeProtectionCache=l,this._sheetInterceptorService=u,this._rangeProtectionRuleModel=d,this._onRefRangeChange(),this._correctPermissionRange(),this._initReBuildCache(),this._initRemoveSheet()}_onRefRangeChange(){const t=(o,r)=>{const a=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!a||!(a==null?void 0:a.getSheetBySheetId(r)))return;this.disposableCollection.dispose();const u=c=>this.refRangeHandle(c,o,r);this._selectionProtectionRuleModel.getSubunitRuleList(o,r).reduce((c,m)=>[...c,...m.ranges],[]).forEach(c=>{this.disposableCollection.add(this._refRangeService.registerRefRange(c,u,o,r))})};this.disposeWithMe(this._commandService.onCommandExecuted(o=>{if(o.id===bs.id){const r=o.params,a=r.subUnitId,l=r.unitId;if(!a||!l)return;t(l,a)}if(o.id===X.id||o.id===ae.id){const r=o.params,a=r.subUnitId,l=r.unitId;if(!a||!l)return;t(l,a)}}));const n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(n){const o=n.getActiveSheet();if(!o)return;t(n.getUnitId(),o.getSheetId())}}refRangeHandle(t,n,o){switch(t.id){case Pt.id:return this._getRefRangeMutationsByMoveRows(t.params,n,o);case kt.id:return this._getRefRangeMutationsByMoveCols(t.params,n,o);case We.id:return this._getRefRangeMutationsByInsertRows(t.params,n,o);case Le.id:return this._getRefRangeMutationsByInsertCols(t.params,n,o);case Ot.id:return this._getRefRangeMutationsByDeleteCols(t.params,n,o);case Nt.id:return this._getRefRangeMutationsByDeleteRows(t.params,n,o)}return{redos:[],undos:[]}}_getRefRangeMutationsByDeleteCols(t,n,o){const r=this._selectionProtectionRuleModel.getSubunitRuleList(n,o).filter(l=>l.ranges.some(u=>i.Rectangle.intersects(u,t.range))),a=t.range;if(r.length){const l=[],u=[];return r.forEach(d=>{const c=i.Tools.deepClone(d),m=c.ranges.reduce((h,R)=>{if(i.Rectangle.intersects(R,a)){const S=i.Tools.deepClone(R),{startColumn:C,endColumn:v}=a;if(C<=S.startColumn&&v>=S.endColumn)return h;C>=S.startColumn&&v<=S.endColumn?S.endColumn-=v-C+1:C<S.startColumn?(S.startColumn=C,S.endColumn-=v-C+1):v>S.endColumn&&(S.endColumn=C-1),this._checkIsRightRange(S)&&h.push(S)}return h},[]);c.ranges=m,c.ranges.length?(l.push({id:X.id,params:{unitId:n,subUnitId:o,rule:c,ruleId:d.id}}),u.push({id:X.id,params:{unitId:n,subUnitId:o,rule:d,ruleId:d.id}})):(l.push({id:Ie.id,params:{unitId:n,subUnitId:o,ruleIds:[d.id]}}),u.push({id:ae.id,params:{unitId:n,subUnitId:o,name:"",rules:[d]}}))}),{redos:l,undos:u}}return{undos:[],redos:[]}}_getRefRangeMutationsByDeleteRows(t,n,o){const r=this._selectionProtectionRuleModel.getSubunitRuleList(n,o).filter(l=>l.ranges.some(u=>i.Rectangle.intersects(u,t.range))),a=t.range;if(r.length){const l=[],u=[];return r.forEach(d=>{const c=i.Tools.deepClone(d),m=c.ranges.reduce((h,R)=>{if(i.Rectangle.intersects(R,a)){const S=i.Tools.deepClone(R),{startRow:C,endRow:v}=a;if(C<=S.startRow&&v>=S.endRow)return h;C>=S.startRow&&v<=S.endRow?S.endRow-=v-C+1:C<S.startRow?(S.startRow=C,S.endRow-=v-C+1):v>S.endRow&&(S.endRow=C-1),this._checkIsRightRange(S)&&h.push(S)}return h},[]);c.ranges=m,l.push({id:X.id,params:{unitId:n,subUnitId:o,rule:c,ruleId:d.id}}),u.push({id:X.id,params:{unitId:n,subUnitId:o,rule:d,ruleId:d.id}})}),{redos:l,undos:u}}return{undos:[],redos:[]}}_getRefRangeMutationsByInsertCols(t,n,o){const r=t.range.startColumn,a=t.range.endColumn-t.range.startColumn+1,l=this._selectionProtectionRuleModel.getSubunitRuleList(n,o).filter(u=>u.ranges.some(d=>r>d.startColumn&&r<=d.endColumn));if(l.length){const u=[],d=[];return l.forEach(c=>{const m=i.Tools.deepClone(c);let h=!1;m.ranges.forEach(R=>{r>R.startColumn&&r<=R.endColumn&&(R.endColumn+=a,h=!0)}),h&&(u.push({id:X.id,params:{unitId:n,subUnitId:o,rule:m,ruleId:c.id}}),d.push({id:X.id,params:{unitId:n,subUnitId:o,rule:c,ruleId:c.id}}))}),{redos:u,undos:d}}return{undos:[],redos:[]}}_getRefRangeMutationsByInsertRows(t,n,o){const r=t.range.startRow,a=t.range.endRow-t.range.startRow+1,l=this._selectionProtectionRuleModel.getSubunitRuleList(n,o).filter(u=>u.ranges.some(d=>r>d.startRow&&r<=d.endRow));if(l.length){const u=[],d=[];return l.forEach(c=>{const m=i.Tools.deepClone(c);let h=!1;m.ranges.forEach(R=>{r>R.startRow&&r<=R.endRow&&(R.endRow+=a,h=!0)}),h&&(u.push({id:X.id,params:{unitId:n,subUnitId:o,rule:m,ruleId:c.id}}),d.push({id:X.id,params:{unitId:n,subUnitId:o,rule:c,ruleId:c.id}}))}),{redos:u,undos:d}}return{undos:[],redos:[]}}_getRefRangeMutationsByMoveRows(t,n,o){const r=t.toRange,a=r.startRow,l=r.endRow-r.startRow+1,u=this._selectionProtectionRuleModel.getSubunitRuleList(n,o).filter(d=>d.ranges.some(c=>a>c.startRow&&a<=c.endRow));if(u.length){const d=[],c=[];return u.forEach(m=>{const h=i.Tools.deepClone(m),S=t.fromRange.startRow;let C=!1;h.ranges.forEach(v=>{a>v.startRow&&a<=v.endRow&&(S<v.startRow&&(v.startRow=v.startRow-l,v.endRow=v.endRow-l),v.endRow+=l,C=!0)}),C&&(d.push({id:X.id,params:{unitId:n,subUnitId:o,rule:h,ruleId:m.id}}),c.push({id:X.id,params:{unitId:n,subUnitId:o,rule:m,ruleId:m.id}}))}),{redos:d,undos:c}}return{undos:[],redos:[]}}_getRefRangeMutationsByMoveCols(t,n,o){const r=t.toRange,a=r.startColumn,l=r.endColumn-r.startColumn+1,u=this._selectionProtectionRuleModel.getSubunitRuleList(n,o).filter(d=>d.ranges.some(c=>a>c.startColumn&&a<=c.endColumn));if(u.length){const d=[],c=[];return u.forEach(m=>{const h=i.Tools.deepClone(m),S=t.fromRange.startColumn;let C=!1;h.ranges.forEach(v=>{a>v.startColumn&&a<=v.endColumn&&(S<v.startColumn&&(v.startColumn=v.startColumn-l,v.endColumn=v.endColumn-l),v.endColumn+=l,C=!0)}),C&&(d.push({id:X.id,params:{unitId:n,subUnitId:o,rule:h,ruleId:m.id}}),c.push({id:X.id,params:{unitId:n,subUnitId:o,rule:m,ruleId:m.id}}))}),{redos:d,undos:c}}return{undos:[],redos:[]}}_correctPermissionRange(){this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(ti.includes(t.id)){if(!t.params)return;const n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!n)return;const o=n.getSheetBySheetId(t.params.subUnitId);if(!o)return;const{sourceRange:r,targetRange:a}=t.params,l=r.startColumn===a.startColumn&&r.endColumn===a.endColumn,u=l?r.endRow-r.startRow+1:r.endColumn-r.startColumn+1,d=l?r.startRow:r.startColumn,c=l?a.startRow:a.startColumn;this._selectionProtectionRuleModel.getSubunitRuleList(n.getUnitId(),o.getSheetId()).forEach(v=>{v.ranges.forEach(p=>{let{startRow:w,endRow:M,startColumn:y,endColumn:b}=p;i.Rectangle.intersects(p,r)||(l?d<w&&c>M?(w-=u,M-=u):d>M&&c<=w&&(w+=u,M+=u):d<y&&c>b?(y-=u,b-=u):d>b&&c<=y&&(y+=u,b+=u)),this._checkIsRightRange({startRow:w,endRow:M,startColumn:y,endColumn:b})&&(p.startColumn=y,p.endColumn=b,p.startRow=w,p.endRow=M)})}),this.disposableCollection.dispose();const{unitId:h,subUnitId:R}=t.params,S=v=>this.refRangeHandle(v,h,R);this._selectionProtectionRuleModel.getSubunitRuleList(h,R).reduce((v,I)=>[...v,...I.ranges],[]).forEach(v=>{this.disposableCollection.add(this._refRangeService.registerRefRange(v,S,h,R))}),this._selectionProtectionRenderModel.clear()}if(ei.includes(t.id)){const n=this._univerInstanceService.getUniverSheetInstance(t.params.unitId);if(!n)return;const o=n.getSheetBySheetId(t.params.subUnitId);if(!o)return;const r=t.params;if(!r)return;const{range:a}=r,l=t.id.includes("row"),u=t.id.includes("insert"),d=l?a.startRow:a.startColumn,c=l?a.endRow:a.endColumn,m=c-d+1;this._selectionProtectionRuleModel.getSubunitRuleList(n.getUnitId(),o.getSheetId()).forEach(I=>{I.ranges.forEach(w=>{let{startRow:M,endRow:y,startColumn:b,endColumn:k}=w;u?l?d<=M&&(M+=m,y+=m):d<=b&&(b+=m,k+=m):l?c<M&&(M-=m,y-=m):c<b&&(b-=m,k-=m),this._checkIsRightRange({startRow:M,endRow:y,startColumn:b,endColumn:k})&&(w.startColumn=b,w.endColumn=k,w.startRow=M,w.endRow=y)})}),this.disposableCollection.dispose();const{unitId:R,subUnitId:S}=t.params,C=I=>this.refRangeHandle(I,R,S);this._selectionProtectionRuleModel.getSubunitRuleList(R,S).reduce((I,p)=>[...I,...p.ranges],[]).forEach(I=>{this.disposableCollection.add(this._refRangeService.registerRefRange(I,C,R,S))}),this._selectionProtectionRenderModel.clear()}}))}_checkIsRightRange(t){return t.startRow<=t.endRow&&t.startColumn<=t.endColumn}_initReBuildCache(){this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(ei.includes(t.id)||ti.includes(t.id)){const{unitId:n,subUnitId:o}=t.params;this._rangeProtectionCache.reBuildCache(n,o)}}))}_initRemoveSheet(){this._sheetInterceptorService.interceptCommand({getMutations:t=>{const n=[],o=[],r=[],a=[];if(t.id===an.id){const l=t.params,u=[],d=[];this._rangeProtectionRuleModel.getSubunitRuleList(l.unitId,l.subUnitId).forEach(c=>{u.push(c.id),d.push(c)}),u.length&&d.length&&(r.push({id:Ie.id,params:{unitId:l.unitId,subUnitId:l.subUnitId,ruleIds:u}}),n.push({id:ae.id,params:{unitId:l.unitId,subUnitId:l.subUnitId,name:"",rules:d}}))}return{redos:o,undos:n,preRedos:r,preUndos:a}}})}},g.RangeProtectionRefRangeService=iu([je(0,i.Inject(K)),je(1,i.Inject(i.IUniverInstanceService)),je(2,i.ICommandService),je(3,i.Inject(g.RefRangeService)),je(4,i.Inject(g.RangeProtectionRenderModel)),je(5,i.Inject(g.RangeProtectionCache)),je(6,i.Inject(g.SheetInterceptorService)),je(7,i.Inject(K))],g.RangeProtectionRefRangeService);var au=Object.getOwnPropertyDescriptor,lu=(s,e,t,n)=>{for(var o=n>1?void 0:n?au(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},jt=(s,e)=>(t,n)=>e(t,n,s);const uu="SHEET_RANGE_PROTECTION_PLUGIN";g.RangeProtectionService=class extends i.Disposable{constructor(e,t,n,o,r){super(),this._selectionProtectionRuleModel=e,this._permissionService=t,this._resourceManagerService=n,this._selectionProtectionCache=o,this._univerInstanceService=r,this._initSnapshot(),this._initRuleChange()}_initRuleChange(){this.disposeWithMe(this._selectionProtectionRuleModel.ruleChange$.subscribe(e=>{switch(e.type){case"add":{se().forEach(t=>{const n=new t(e.unitId,e.subUnitId,e.rule.permissionId);this._permissionService.addPermissionPoint(n)});break}case"delete":{se().forEach(t=>{const n=new t(e.unitId,e.subUnitId,e.rule.permissionId);this._permissionService.deletePermissionPoint(n.id)});break}case"set":{e.oldRule.permissionId!==e.rule.permissionId&&se().forEach(t=>{const n=new t(e.unitId,e.subUnitId,e.oldRule.permissionId);this._permissionService.deletePermissionPoint(n.id);const o=new t(e.unitId,e.subUnitId,e.rule.permissionId);this._permissionService.addPermissionPoint(o)});break}}}))}_initSnapshot(){const e=n=>{const r=this._selectionProtectionRuleModel.toObject()[n];return r?JSON.stringify(r):""},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e,parseJson:t,pluginName:uu,businesses:[Zt.UNIVER_SHEET],onLoad:(n,o)=>{const r=this._selectionProtectionRuleModel.toObject();r[n]=o,this._selectionProtectionRuleModel.fromObject(r);const a=[];Object.keys(o).forEach(l=>{const u=o[l];this._selectionProtectionRuleModel.getSubunitRuleList(n,l).forEach(d=>{a.push({objectID:d.permissionId,unitID:n,objectType:O.SelectRange,actions:Be})}),u.forEach(d=>{se().forEach(c=>{const m=new c(n,l,d.permissionId);m.value=!1,this._permissionService.addPermissionPoint(m)})}),this._selectionProtectionCache.reBuildCache(n,l)})},onUnLoad:n=>{this._selectionProtectionCache.deleteUnit(n)}}))}},g.RangeProtectionService=lu([jt(0,i.Inject(K)),jt(1,i.Inject(i.IPermissionService)),jt(2,i.Inject(i.IResourceManagerService)),jt(3,i.Inject(g.RangeProtectionCache)),jt(4,i.Inject(i.IUniverInstanceService))],g.RangeProtectionService);var du=Object.getOwnPropertyDescriptor,cu=(s,e,t,n)=>{for(var o=n>1?void 0:n?du(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Ft=(s,e)=>(t,n)=>e(t,n,s);g.WorkbookPermissionService=class extends i.Disposable{constructor(e,t,n,o,r){super(),this._permissionService=e,this._univerInstanceService=t,this._rangeProtectionRuleModel=n,this._worksheetProtectionRuleModel=o,this._worksheetProtectionPointModel=r,this._init()}_init(){const e=t=>{const n=t.getUnitId();It().forEach(o=>{const r=new o(n);this._permissionService.addPermissionPoint(r)})};this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).forEach(t=>{e(t)}),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(i.UniverInstanceType.UNIVER_SHEET).subscribe(t=>{e(t)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(i.UniverInstanceType.UNIVER_SHEET).subscribe(t=>{const n=t.getUnitId();t.getSheets().forEach(o=>{const r=o.getSheetId();this._rangeProtectionRuleModel.getSubunitRuleList(n,r).forEach(l=>{[...se()].forEach(u=>{const d=new u(n,r,l.permissionId);this._permissionService.deletePermissionPoint(d.id)})}),[...oe(),...he()].forEach(l=>{const u=new l(n,r);this._permissionService.deletePermissionPoint(u.id)})}),It().forEach(o=>{const r=new o(n);this._permissionService.deletePermissionPoint(r.id)}),this._rangeProtectionRuleModel.deleteUnitModel(n),this._worksheetProtectionPointModel.deleteUnitModel(n),this._worksheetProtectionRuleModel.deleteUnitModel(n)}))}},g.WorkbookPermissionService=cu([Ft(0,i.Inject(i.IPermissionService)),Ft(1,i.Inject(i.IUniverInstanceService)),Ft(2,i.Inject(K)),Ft(3,i.Inject(pe)),Ft(4,i.Inject(vt))],g.WorkbookPermissionService);var mu=Object.getOwnPropertyDescriptor,hu=(s,e,t,n)=>{for(var o=n>1?void 0:n?mu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},gu=(s,e)=>(t,n)=>e(t,n,s);g.SheetRangeThemeService=class extends i.Disposable{constructor(e){super(),this._sheetRangeThemeModel=e}registerRangeTheme(e,t){this._sheetRangeThemeModel.registerRangeThemeStyle(e,t)}removeRangeThemeRule(e,t){this._sheetRangeThemeModel.removeRangeThemeRule(e,t)}getALLRegisterThemes(){return this._sheetRangeThemeModel.getALLRegisteredTheme()}registerRangeThemeStyle(e,t){this._sheetRangeThemeModel.registerRangeThemeRule(e,t)}getAppliedRangeThemeStyle(e){return this._sheetRangeThemeModel.getRegisteredRangeThemeStyle(e)}getRegisteredRangeThemes(){return this._sheetRangeThemeModel.getRegisteredRangeThemes()}},g.SheetRangeThemeService=hu([gu(0,i.Inject(we))],g.SheetRangeThemeService);var Ru=Object.getOwnPropertyDescriptor,Su=(s,e,t,n)=>{for(var o=n>1?void 0:n?Ru(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Cu=(s,e)=>(t,n)=>e(t,n,s);g.SheetSkeletonService=class extends i.Disposable{constructor(t){super();f(this,"_sheetSkeletonStore",new Map);this._injector=t,this.disposeWithMe(()=>{this._sheetSkeletonStore=new Map})}getSkeleton(t,n){if(this._sheetSkeletonStore.has(t))return this._sheetSkeletonStore.get(t).get(n)}setSkeleton(t,n,o){this._sheetSkeletonStore.has(t)||this._sheetSkeletonStore.set(t,new Map),this._sheetSkeletonStore.get(t).set(n,o)}deleteSkeleton(t,n){this._sheetSkeletonStore.has(t)&&this._sheetSkeletonStore.get(t).delete(n)}},g.SheetSkeletonService=Su([Cu(0,i.Inject(i.Injector))],g.SheetSkeletonService);var fu=Object.defineProperty,vu=Object.getOwnPropertyDescriptor,Iu=(s,e,t)=>e in s?fu(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,pu=(s,e,t,n)=>{for(var o=n>1?void 0:n?vu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},ni=(s,e)=>(t,n)=>e(t,n,s),si=(s,e,t)=>Iu(s,typeof e!="symbol"?e+"":e,t);const wu="SHEET_PLUGIN";g.UniverSheetsPlugin=class extends i.Plugin{constructor(e=Dr,t,n){super(),this._config=e,this._injector=t,this._configService=n;const{...o}=i.merge({},Dr,this._config);this._configService.setConfig(ml,o),this._initConfig(),this._initDependencies()}_initConfig(){var e,t,n;(e=this._config)!=null&&e.onlyRegisterFormulaRelatedMutations&&this._configService.setConfig(kr,!0),(t=this._config)!=null&&t.isRowStylePrecedeColumnStyle&&this._configService.setConfig(i.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE,!0),(n=this._config)!=null&&n.autoHeightForMergedCells&&this._configService.setConfig(i.AUTO_HEIGHT_FOR_MERGED_CELLS,!0)}_initDependencies(){var t;const e=[[Je],[g.SheetsSelectionsService],[g.RefRangeService],[g.WorkbookPermissionService],[Xe,{useClass:g.NumfmtService}],[g.SheetInterceptorService],[g.SheetRangeThemeService],[g.SheetSkeletonService],[vn],[g.MergeCellController],[Mn],[g.DefinedNameDataController],[g.WorksheetPermissionService],[pe],[vt],[_n],[g.SheetPermissionInitController],[g.SheetPermissionCheckController],[we],[g.RangeProtectionRenderModel],[K],[g.RangeProtectionCache],[g.RangeProtectionRefRangeService],[g.RangeProtectionService],[zs,{useClass:Qr,deps:[g.SheetsSelectionsService]}]];(t=this._config)!=null&&t.notExecuteFormula||e.push([In]),i.registerDependencies(this._injector,i.mergeOverrideWithDependencies(e,this._config.override)),i.touchDependencies(this._injector,[[g.SheetInterceptorService],[g.RangeProtectionService],[zs],[g.SheetPermissionInitController]])}onStarting(){i.touchDependencies(this._injector,[[vn],[g.MergeCellController],[g.WorkbookPermissionService],[g.WorksheetPermissionService],[_n],[g.SheetSkeletonService]])}onRendered(){i.touchDependencies(this._injector,[[Xe]])}onReady(){i.touchDependencies(this._injector,[[In],[g.DefinedNameDataController],[we],[Mn],[g.RangeProtectionRenderModel],[g.RangeProtectionRefRangeService],[g.RefRangeService],[g.SheetPermissionCheckController]])}},si(g.UniverSheetsPlugin,"pluginName",wu),si(g.UniverSheetsPlugin,"type",i.UniverInstanceType.UNIVER_SHEET),g.UniverSheetsPlugin=pu([i.DependentOn(z.UniverFormulaEnginePlugin),ni(1,i.Inject(i.Injector)),ni(2,i.IConfigService)],g.UniverSheetsPlugin);var oi=(s=>(s.SET_WORKSHEET_ROW_HEIGHT="sheet.mutation.set-worksheet-row-height",s.SET_WORKSHEET_ROW_IS_AUTO_HEIGHT="sheet.mutation.set-worksheet-row-is-auto-height",s.SET_WORKSHEET_ROW_AUTO_HEIGHT="sheet.mutation.set-worksheet-row-auto-height",s.SET_WORKSHEET_COL_WIDTH="sheet.mutation.set-worksheet-col-width",s.SET_WORKSHEET_ACTIVE="sheet.operation.set-worksheet-active",s.MOVE_ROWS="sheet.mutation.move-rows",s.MOVE_COLUMNS="sheet.mutation.move-columns",s.SET_COL_HIDDEN="sheet.mutation.set-col-hidden",s.SET_COL_VISIBLE="sheet.mutation.set-col-visible",s.SET_ROW_HIDDEN="sheet.mutation.set-row-hidden",s.SET_ROW_VISIBLE="sheet.mutation.set-row-visible",s.INSERT_COL="sheet.mutation.insert-col",s.INSERT_ROW="sheet.mutation.insert-row",s.REMOVE_COL="sheet.mutation.remove-col",s.REMOVE_ROW="sheet.mutation.remove-row",s.TOGGLE_GRIDLINES="sheet.mutation.toggle-gridlines",s.SET_GRIDLINES_COLOR="sheet.mutation.set-gridlines-color",s))(oi||{}),ri=(s=>(s.SET_RANGE_VALUES="sheet.mutation.set-range-values",s.MOVE_RANGE="sheet.mutation.move-range",s.REMOVE_WORKSHEET_MERGE="sheet.mutation.remove-worksheet-merge",s.ADD_WORKSHEET_MERGE="sheet.mutation.add-worksheet-merge",s.REORDER_RANGE="sheet.mutation.reorder-range",s.SET_WORKSHEET_DEFAULT_STYLE="sheet.mutation.set-worksheet-default-style",s.SET_ROW_DATA="sheet.mutation.set-row-data",s.SET_COL_DATA="sheet.mutation.set-col-data",s.SET_WORKSHEET_RANGE_THEME_STYLE="sheet.mutation.set-worksheet-range-theme-style",s.DELETE_WORKSHEET_RANGE_THEME_STYLE="sheet.mutation.delete-worksheet-range-theme-style",s))(ri||{});const Mu=[Ne.id,ge.id,Ns.id,ke.id,Ct.id,Ue.id,Pe.id,ct.id,mt.id,St.id,Rt.id,Re.id,ye.id,ce.id,Se.id,pt.id,ht.id],yu=[H.id,Ae.id,G.id,F.id,Dt.id,ft.id,gt.id,dt.id,tt.id,nt.id];function _u(s){switch(s.id){case"sheet.mutation.set-range-values":{const e=s.params,t=new i.ObjectMatrix(e.cellValue).getDataRange();return t.endRow===-1?[]:e.cellValue?[{unitId:e.unitId,subUnitId:e.subUnitId,range:t}]:[]}case"sheet.mutation.move-range":{const e=s.params;return[{unitId:e.unitId,subUnitId:e.from.subUnitId,range:new i.ObjectMatrix(e.from.value).getRange()},{unitId:e.unitId,subUnitId:e.to.subUnitId,range:new i.ObjectMatrix(e.to.value).getRange()}]}case"sheet.mutation.remove-worksheet-merge":{const e=s.params;return e.ranges.map(t=>({unitId:e.unitId,subUnitId:e.subUnitId,range:t}))}case"sheet.mutation.add-worksheet-merge":{const e=s.params;return e.ranges.map(t=>({unitId:e.unitId,subUnitId:e.subUnitId,range:t}))}case"sheet.mutation.reorder-range":{const e=s.params;return[{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range}]}case"sheet.mutation.set-worksheet-default-style":{const e=s.params;return[{unitId:e.unitId,subUnitId:e.subUnitId,range:{startRow:0,endRow:Number.MAX_SAFE_INTEGER,startColumn:0,endColumn:Number.MAX_SAFE_INTEGER}}]}case"sheet.mutation.set-row-data":{const e=s.params,t=Object.keys(e.rowData).map(Number);return t.length===0?[]:[{unitId:e.unitId,subUnitId:e.subUnitId,range:{startRow:Math.min(...t),endRow:Math.max(...t),startColumn:0,endColumn:Number.MAX_SAFE_INTEGER}}]}case"sheet.mutation.set-col-data":{const e=s.params,t=Object.keys(e.columnData).map(Number);return t.length===0?[]:[{unitId:e.unitId,subUnitId:e.subUnitId,range:{startRow:0,endRow:Number.MAX_SAFE_INTEGER,startColumn:Math.min(...t),endColumn:Math.max(...t)}}]}case"sheet.mutation.set-worksheet-range-theme-style":case"sheet.mutation.delete-worksheet-range-theme-style":{const e=s.params;return[{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range}]}default:return[]}}function bu(s,e){switch(s.id){case"sheet.mutation.set-worksheet-row-height":case"sheet.mutation.set-worksheet-row-is-auto-height":{const t=s.params;return t.ranges.map(n=>({unitId:t.unitId,subUnitId:t.subUnitId,range:{...n,rangeType:i.RANGE_TYPE.ROW}}))}case"sheet.mutation.set-worksheet-row-auto-height":{const t=s.params;return t.rowsAutoHeightInfo.map(n=>({unitId:t.unitId,subUnitId:t.subUnitId,range:{startRow:n.row,endRow:n.row,startColumn:0,endColumn:e-1,rangeType:i.RANGE_TYPE.ROW}}))}case"sheet.mutation.set-worksheet-col-width":{const t=s.params;return t.ranges.map(n=>({unitId:t.unitId,subUnitId:t.subUnitId,range:{...n,rangeType:i.RANGE_TYPE.COLUMN}}))}case"sheet.mutation.move-rows":case"sheet.mutation.move-columns":{const t=s.params;return[{unitId:t.unitId,subUnitId:t.subUnitId,range:t.targetRange},{unitId:t.unitId,subUnitId:t.subUnitId,range:t.sourceRange}]}case"sheet.mutation.set-col-hidden":case"sheet.mutation.set-col-visible":{const t=s.params;return t.ranges.map(n=>({unitId:t.unitId,subUnitId:t.subUnitId,range:{...n,rangeType:i.RANGE_TYPE.COLUMN}}))}case"sheet.mutation.set-row-hidden":case"sheet.mutation.set-row-visible":{const t=s.params;return t.ranges.map(n=>({unitId:t.unitId,subUnitId:t.subUnitId,range:{...n,rangeType:i.RANGE_TYPE.ROW}}))}case"sheet.mutation.insert-col":{const t=s.params;return[{unitId:t.unitId,subUnitId:t.subUnitId,range:{...t.range,rangeType:i.RANGE_TYPE.COLUMN}}]}case"sheet.mutation.insert-row":{const t=s.params;return[{unitId:t.unitId,subUnitId:t.subUnitId,range:{...t.range,rangeType:i.RANGE_TYPE.ROW}}]}case"sheet.mutation.remove-col":{const t=s.params;return[{unitId:t.unitId,subUnitId:t.subUnitId,range:{...t.range,rangeType:i.RANGE_TYPE.COLUMN}}]}case"sheet.mutation.remove-row":{const t=s.params;return[{unitId:t.unitId,subUnitId:t.subUnitId,range:{...t.range,rangeType:i.RANGE_TYPE.ROW}}]}case"sheet.mutation.toggle-gridlines":case"sheet.mutation.set-gridlines-color":return[];default:return[]}}const Tu=1.5,Eu="rgba(255, 255, 255, 0.01)";function Uu(s){const{rangeWithCoord:e,primaryWithCoord:t,style:n}=s,o={range:{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn,rangeType:e.rangeType,unitId:e.unitId,sheetId:e.sheetId},primary:null,style:n};return t!=null&&(o.primary=ii(t)),o}function ii(s){const{actualRow:e,actualColumn:t,isMerged:n,isMergedMainCell:o}=s,{startRow:r,startColumn:a,endRow:l,endColumn:u}=s.mergeInfo;return{actualRow:e,actualColumn:t,isMerged:n,isMergedMainCell:o,startRow:r,startColumn:a,endRow:l,endColumn:u}}const Pu=(s,e,t)=>{const o=s.get(g.SheetsSelectionsService).getCurrentSelections(),{value:r,selections:a,unitId:l,subUnitId:u}=e;if(o){const c=o[(o==null?void 0:o.length)-1].primary;if(c){const{actualColumn:m,actualRow:h}=c;let{startRow:R,startColumn:S,endRow:C,endColumn:v}=a[a.length-1];if(r===i.Dimension.COLUMNS){const M=t.find(y=>y.startColumn===m&&y.endColumn===m&&h===y.startRow);M&&(v=M.endColumn,R=M.startRow,C=M.endRow)}else if(r===i.Dimension.ROWS){const M=t.find(y=>y.startRow===h&&y.endRow===h&&m===y.startColumn);M&&(C=M.endRow,S=M.startColumn,v=M.endColumn)}const I={startRow:R,startColumn:S,endRow:C,endColumn:v,actualRow:h,actualColumn:m,isMerged:!0,isMergedMainCell:R===h&&S===m},p=o.map((M,y,b)=>({range:M.range,style:null,primary:y===b.length-1?I:null})),w={unitId:l,subUnitId:u,type:Q.ONLY_SET,selections:p};return{id:Y.id,params:w}}return null}return null},ku=(s,e)=>{const n=s.get(g.SheetsSelectionsService).getCurrentSelections(),{unitId:o,subUnitId:r}=e;if(n&&n[(n==null?void 0:n.length)-1].primary){const u={unitId:o,subUnitId:r,type:Q.ONLY_SET,selections:[...n]};return{id:Y.id,params:u}}return null};function ai(s){return s==null?!1:s.v!==void 0&&s.v!==null&&s.v!==""||s.p!==void 0}function bn(s,e){return s&&s.spanAnchor?ai(e.getValue(s.spanAnchor.startRow,s.spanAnchor.startColumn)):ai(s)}function Nu(s,e,t,n,o){const r=s.getCellMatrix(),a=s.getSpanModel().getMergedCellRange(e,t,n,o),l=new i.ObjectMatrix;return r.forValue((u,d)=>{const c=r.getValue(u,d);c&&l.setValue(u,d,c)}),a.forEach(u=>{const{startColumn:d,startRow:c,endColumn:m,endRow:h}=u;i.createRowColIter(c,h,d,m).forEach((R,S)=>{R===c&&S===d&&l.setValue(R,S,{...r.getValue(R,S),spanAnchor:{startRow:c,endRow:h,startColumn:d,endColumn:m}}),(R!==c||S!==d)&&(l.realDeleteValue(R,S),l.setValue(R,S,{spanAnchor:{startRow:c,endRow:h,startColumn:d,endColumn:m}}))})}),l}function Ou(s,e,t,n){const{startRow:o,startColumn:r,endRow:a}=s;let l=null,u=!1;for(let d=o;d<=a;d++){const c=e.getValue(d,r-t);if(u=u||bn(c,e),!n&&u)break;c&&c.spanAnchor&&(l?l={startRow:Math.min(c.spanAnchor.startRow,l.startRow),startColumn:Math.min(c.spanAnchor.startColumn,l.startColumn),endRow:Math.max(c.spanAnchor.endRow,l.endRow),endColumn:Math.max(c.spanAnchor.endColumn,l.endColumn)}:l={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return u?(s.startColumn=s.startColumn-t,{spanAnchor:l,hasValue:!0,range:s}):{spanAnchor:null,hasValue:!1,range:s}}function Du(s,e,t,n){const{startRow:o,endColumn:r,endRow:a}=s;let l=null,u=!1;for(let d=o;d<=a;d++){const c=e.getValue(d,r+t);if(u=u||bn(c,e),!n&&u)break;c&&c.spanAnchor&&(l?l={startRow:Math.min(c.spanAnchor.startRow,l.startRow),startColumn:Math.min(c.spanAnchor.startColumn,l.startColumn),endRow:Math.max(c.spanAnchor.endRow,l.endRow),endColumn:Math.max(c.spanAnchor.endColumn,l.endColumn)}:l={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return u?(s.endColumn=s.endColumn+t,{spanAnchor:l,hasValue:!0,range:s}):{spanAnchor:null,hasValue:!1,range:s}}function Au(s,e,t,n){const{startRow:o,startColumn:r,endColumn:a}=s;let l=null,u=!1;for(let d=r;d<=a;d++){const c=e.getValue(o-t,d);if(u=u||bn(c,e),!n&&u)break;c&&c.spanAnchor&&(l?l={startRow:Math.min(c.spanAnchor.startRow,l.startRow),startColumn:Math.min(c.spanAnchor.startColumn,l.startColumn),endRow:Math.max(c.spanAnchor.endRow,l.endRow),endColumn:Math.max(c.spanAnchor.endColumn,l.endColumn)}:l={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return u?(s.startRow=s.startRow-t,{spanAnchor:l,hasValue:!0,range:s}):{spanAnchor:null,hasValue:!1,range:s}}function Wu(s,e,t,n){const{startColumn:o,endColumn:r,endRow:a}=s;let l=null,u=!1;for(let d=o;d<=r;d++){const c=e.getValue(a+t,d);if(u=u||bn(c,e),!n&&u)break;c&&c.spanAnchor&&(l?l={startRow:Math.min(c.spanAnchor.startRow,l.startRow),startColumn:Math.min(c.spanAnchor.startColumn,l.startColumn),endRow:Math.max(c.spanAnchor.endRow,l.endRow),endColumn:Math.max(c.spanAnchor.endColumn,l.endColumn)}:l={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return u?(s.endRow=s.endRow+t,{spanAnchor:l,hasValue:!0,range:s}):{spanAnchor:null,hasValue:!1,range:s}}function Lu(s,e,t){const n=t.getMaxRows(),o=t.getMaxColumns(),r=Nu(t,0,0,n-1,o-1),a=t.getSnapshot().mergeData.length>0,{left:l,right:u,up:d,down:c}=e;let m=!0,h={...s};const R=[];for(;m;){if(m=!1,d&&h.startRow!==0){const{hasValue:S,range:C,spanAnchor:v}=Au(h,r,1,a);if(v&&R.push(v),S){h=C,m=!0;continue}}if(c&&h.endRow!==n-1){const{hasValue:S,range:C,spanAnchor:v}=Wu(h,r,1,a);if(v&&R.push(v),S){h=C,m=!0;continue}}if(l&&h.startColumn!==0){const{hasValue:S,range:C,spanAnchor:v}=Ou(h,r,1,a);if(v&&R.push(v),S){h=C,m=!0;continue}}if(u&&h.endColumn!==o-1){const{hasValue:S,range:C,spanAnchor:v}=Du(h,r,1,a);if(v&&R.push(v),S){h=C,m=!0;continue}}}return R.length>0&&(h=i.Rectangle.union(h,...R)),h}const li=(s,e,t,n=1,o=!0,r=!0)=>{const a=i.Range.transformRange(s,e),{startRow:l,endRow:u}=a;let d=t.startRow-n,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;for(;!e.getRowVisible(d)||!m;)d--,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;if(d>=l)return{...t,startRow:d,endRow:d};if(r){const h={...t,startRow:u,endRow:u};return di(s,e,h,n,o,!1)}},ui=(s,e,t,n=1,o=!0,r=!0)=>{const a=i.Range.transformRange(s,e),{startRow:l,endRow:u}=a;let d=t.endRow+n,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;for(;!e.getRowVisible(d)||!m;)d++,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;if(d<=u)return{...t,startRow:d,endRow:d};if(r){const h={...t,startRow:l,endRow:l};return ci(s,e,h,n,o,!1)}},di=(s,e,t,n=1,o=!0,r=!0)=>{const a=i.Range.transformRange(s,e),{startColumn:l,endColumn:u}=a;let d=t.startColumn-n,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;for(;!e.getColVisible(d)||!m;)d--,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;if(d>=l)return{...t,startColumn:d,endColumn:d};if(r){const h={...t,startColumn:u,endColumn:u};return li(s,e,h,n,o,!1)}},ci=(s,e,t,n=1,o=!0,r=!0)=>{const a=i.Range.transformRange(s,e),{startColumn:l,endColumn:u}=a;let d=t.endColumn+n,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;for(;!e.getColVisible(d)||!m;)d++,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;if(d<=u)return{...t,endColumn:d,startColumn:d};if(r){const h={...t,startColumn:l,endColumn:l};return ui(s,e,h,n,o,!1)}};function Tn(s,e,t){let n=null;return t.getMatrixWithMergedCells(s,e,s,e).forValue((r,a,l)=>(n={actualRow:r,actualColumn:a,startRow:r,startColumn:a,isMerged:l.rowSpan!==void 0||l.colSpan!==void 0,isMergedMainCell:l.rowSpan!==void 0&&l.colSpan!==void 0,endRow:r+(l.rowSpan!==void 0?l.rowSpan-1:0),endColumn:a+(l.colSpan!==void 0?l.colSpan-1:0),rangeType:i.RANGE_TYPE.NORMAL},!1)),n||{actualColumn:e,actualRow:s,startRow:s,startColumn:e,endRow:s,endColumn:e,isMerged:!1,isMergedMainCell:!1,rangeType:i.RANGE_TYPE.NORMAL}}const Vu=(s,e,t,n,o=1)=>{switch(n){case i.Direction.UP:return li(s,e,t,o);case i.Direction.DOWN:return ui(s,e,t,o);case i.Direction.LEFT:return di(s,e,t,o);case i.Direction.RIGHT:return ci(s,e,t,o)}},$u=(s,e,t)=>{let n,o=-1,r;for(let I=0;I<s.length;I++)if(s[I].primary){n=s[I],o=I,r=n.primary;break}if(o===-1)return null;const a=e===i.Direction.LEFT||e===i.Direction.UP,l=a?o-1>=0?o-1:s.length-1:o+1<s.length?o+1:0,u=s[l];if(!n||!r)return null;const d={...r},{startRow:c,startColumn:m,endRow:h,endColumn:R}=n.range,S=a?d.startRow===c&&d.startColumn===m:d.endRow===h&&d.endColumn===R,C=S&&a;if(!i.Rectangle.equals(n.range,d)){const I=S?u.range:Vu(n.range,t,d,e);if(!I)return null;const p=C?Tn(I.endRow,I.endColumn,t):Tn(I.startRow,I.startColumn,t);return{startRow:p.startRow,startColumn:p.startColumn,endRow:p.endRow,endColumn:p.endColumn}}const v=C?Tn(u.range.endRow,u.range.endColumn,t):Tn(u.range.startRow,u.range.startColumn,t);return{startRow:v.startRow,startColumn:v.startColumn,endRow:v.endRow,endColumn:v.endColumn}},Bu={WorkbookCommentPermission:An,WorkbookCopyPermission:Wn,WorkbookCreateProtectPermission:Ln,WorkbookCreateSheetPermission:Vn,WorkbookDeleteSheetPermission:$n,WorkbookDuplicatePermission:Bn,WorkbookEditablePermission:re,WorkbookExportPermission:Hn,WorkbookHideSheetPermission:en,WorkbookHistoryPermission:Io,WorkbookManageCollaboratorPermission:tn,WorkbookMoveSheetPermission:nn,WorkbookPrintPermission:jn,WorkbookRecoverHistoryPermission:Fn,WorkbookRenameSheetPermission:sn,WorkbookSharePermission:Gn,WorkbookViewHistoryPermission:Yn,WorkbookViewPermission:zn,WorksheetCopyPermission:qn,WorksheetDeleteColumnPermission:Kn,WorksheetDeleteProtectionPermission:Jn,WorksheetDeleteRowPermission:xn,WorksheetEditExtraObjectPermission:Xn,WorksheetEditPermission:de,WorksheetFilterPermission:Zn,WorksheetInsertColumnPermission:Qn,WorksheetInsertHyperlinkPermission:es,WorksheetInsertRowPermission:ts,WorksheetManageCollaboratorPermission:ns,WorksheetPivotTablePermission:ss,WorksheetSetCellStylePermission:os,WorksheetSetCellValuePermission:Tt,WorksheetSetColumnStylePermission:ot,WorksheetSetRowStylePermission:rt,WorksheetSortPermission:rs,WorksheetViewPermission:Et,RangeProtectionPermissionEditPoint:ue,RangeProtectionPermissionViewPoint:Qt},Hu=(s,e,t,n)=>{const o=s.get(i.IPermissionService),r=s.get(K),a=o.getPermissionPoint(new re(e).id);if(!(a!=null&&a.value))return!1;const l=o.getPermissionPoint(new de(e,t).id);if(!(l!=null&&l.value))return!1;const d=r.getSubunitRuleList(e,t).filter(c=>c.ranges.some(m=>n.some(h=>i.Rectangle.intersects(m,h))));return d.length?d.every(c=>{const m=c.permissionId,h=o.getPermissionPoint(new ue(e,t,m).id);return!!(h!=null&&h.value)}):!0};function ju(s,e){return e.some(t=>Fu(s,t))}function Fu(s,e){const{startRow:t,startColumn:n,endColumn:o,endRow:r}=e,a=s.getMatrixWithMergedCells(t,n,r,o);let l=!1;return a.forValue((u,d,c)=>{if(c&&(u!==t||d!==n)&&s.cellHasValue(c))return l=!0,!1}),l}function Gu(s,e,t,n){const o=[],r=[],a=t.getSheetId();return n.forEach(l=>{const u=zu(t,l),d={unitId:e,subUnitId:a,cellValue:u.getData()},c=le(s,d);o.push({id:H.id,params:c}),r.push({id:H.id,params:d})}),{undos:o,redos:r}}function zu(s,e){const{startRow:t,startColumn:n,endColumn:o,endRow:r}=e,a=s.getMatrixWithMergedCells(t,n,r,o,i.CellModeEnum.Intercepted),l=new i.ObjectMatrix;return a.forValue((u,d,c)=>{c&&(u!==t||d!==n)&&l.setValue(u,d,null)}),l}const Gt={type:i.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=e.unitId,a=e.subUnitId,l=e.selections,u=Fs(l,e.value),d=o.getUniverSheetInstance(r).getSheetBySheetId(a),c=[],m=[],h=ju(d,u),R={unitId:r,subUnitId:a,ranges:u},S={unitId:r,subUnitId:a,ranges:u};c.push({id:G.id,params:R}),c.push({id:F.id,params:S});const C=ne(s,R),v=me(s,S);if(m.push({id:G.id,params:v}),m.push({id:F.id,params:C}),h){const p=Gu(s,r,d,u);c.unshift(...p.redos),m.push(...p.undos)}return i.sequenceExecute(c,t).result?(n.pushUndoRedo({unitID:r,undoMutations:m,redoMutations:c}),!0):!1}},Yu={type:i.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge-all",handler:async s=>{var d;const e=s.get(i.ICommandService),n=(d=s.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:d.map(c=>c.range);if(!(n!=null&&n.length))return!1;const r=s.get(i.IUniverInstanceService).getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const a=r.getActiveSheet();if(!a)return!1;const l=r.getUnitId(),u=a.getSheetId();return e.executeCommand(Gt.id,{selections:n,unitId:l,subUnitId:u})}},qu={type:i.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge-vertical",handler:async s=>{var d;const e=s.get(i.ICommandService),n=(d=s.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:d.map(c=>c.range);if(!(n!=null&&n.length))return!1;const r=s.get(i.IUniverInstanceService).getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const a=r.getActiveSheet();if(!a)return!1;const l=r.getUnitId(),u=a.getSheetId();return e.executeCommand(Gt.id,{value:i.Dimension.COLUMNS,selections:n,unitId:l,subUnitId:u})}},Ku={type:i.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge-horizontal",handler:async s=>{var d;const e=s.get(i.ICommandService),n=(d=s.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:d.map(c=>c.range);if(!(n!=null&&n.length))return!1;const r=s.get(i.IUniverInstanceService).getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const a=r.getActiveSheet();if(!a)return!1;const l=r.getUnitId(),u=a.getSheetId();return e.executeCommand(Gt.id,{value:i.Dimension.ROWS,selections:n,unitId:l,subUnitId:u})}};function Ju(s,e,t,n,o){const r=s.get(i.IUniverInstanceService),a=U(r,{unitId:e,subUnitId:t});if(!a)return;const{worksheet:l}=a;if(l.getMergeData().some(m=>n.some(h=>i.Rectangle.intersects(h,m))))throw new Error("The ranges to be merged overlap with the existing merged cells");s.get(i.ICommandService).executeCommand(Gt.id,{unitId:e,subUnitId:t,selections:n,defaultMerge:o})}const xu=(s,e)=>{const r=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId).getSheetBySheetId(e.subUnitId).getConfig().rightToLeft;return{...i.Tools.deepClone(e),rightToLeft:r}},En={id:"sheet.mutation.set-worksheet-right-to-left",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getSheetBySheetId(e.subUnitId);if(!n)return!1;const o=n.getConfig();return o.rightToLeft=e.rightToLeft,!0}},Xu={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-right-to-left",handler:async(s,e)=>{var m;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=U(s.get(i.IUniverInstanceService),e);if(!o)return!1;const{unitId:r,subUnitId:a}=o;let l=i.BooleanNumber.FALSE;e&&(l=(m=e.rightToLeft)!=null?m:i.BooleanNumber.FALSE);const u={rightToLeft:l,unitId:r,subUnitId:a},d=xu(s,u);return t.syncExecuteCommand(En.id,u)?(n.pushUndoRedo({unitID:r,undoMutations:[{id:En.id,params:d}],redoMutations:[{id:En.id,params:u}]}),!0):!1}};g.AFTER_CELL_EDIT=zt,g.AFTER_CELL_EDIT_ASYNC=Yt,g.AddMergeRedoSelectionsOperationFactory=Pu,g.AddMergeUndoMutationFactory=me,g.AddMergeUndoSelectionsOperationFactory=ku,g.AddRangeProtectionCommand=Js,g.AddRangeProtectionMutation=ae,g.AddWorksheetMergeAllCommand=Yu,g.AddWorksheetMergeCommand=Gt,g.AddWorksheetMergeHorizontalCommand=Ku,g.AddWorksheetMergeMutation=F,g.AddWorksheetMergeVerticalCommand=qu,g.AddWorksheetProtectionCommand=xs,g.AddWorksheetProtectionMutation=Oe,g.BEFORE_CELL_EDIT=Pn,g.BorderStyleManagerService=Je,g.COMMAND_LISTENER_SKELETON_CHANGE=Mu,g.COMMAND_LISTENER_VALUE_CHANGE=yu,g.CancelFrozenCommand=Xo,g.ClearSelectionAllCommand=Kt,g.ClearSelectionContentCommand=Jt,g.ClearSelectionFormatCommand=xt,g.CopySheetCommand=Dn,g.DISABLE_NORMAL_SELECTIONS=ji,g.DeleteRangeMoveLeftCommand=qe,g.DeleteRangeMoveUpCommand=Ke,g.DeleteRangeProtectionCommand=Mo,g.DeleteRangeProtectionMutation=Ie,g.DeleteWorksheetProtectionCommand=yo,g.DeleteWorksheetProtectionMutation=Fe,g.DeleteWorksheetRangeThemeStyleCommand=_o,g.DeleteWorksheetRangeThemeStyleMutation=nt,g.DeleteWorksheetRangeThemeStyleMutationFactory=ro,g.DeltaColumnWidthCommand=dn,g.DeltaRowHeightCommand=gn,g.EditStateEnum=Ks,g.EffectRefRangId=D,g.EmptyMutation=br,g.ExclusiveRangeService=Qr,g.FactoryAddRangeProtectionMutation=gi,g.FactoryDeleteRangeProtectionMutation=hi,g.FactorySetRangeProtectionMutation=Ua,g.IExclusiveRangeService=zs,g.INTERCEPTOR_POINT=Ee,g.INumfmtService=Xe,g.IRefSelectionsService=Ro,g.InsertColAfterCommand=No,g.InsertColBeforeCommand=ko,g.InsertColByRangeCommand=cs,g.InsertColCommand=Le,g.InsertColMutation=Re,g.InsertColMutationUndoFactory=on,g.InsertDefinedNameCommand=bo,g.InsertRangeMoveDownCommand=at,g.InsertRangeMoveRightCommand=Ut,g.InsertRowAfterCommand=Uo,g.InsertRowBeforeCommand=Eo,g.InsertRowByRangeCommand=ds,g.InsertRowCommand=We,g.InsertRowMutation=ye,g.InsertRowMutationUndoFactory=ls,g.InsertSheetCommand=Oo,g.InsertSheetMutation=st,g.InsertSheetUndoMutationFactory=On,g.InterceptCellContentPriority=Xs,g.MAX_CELL_PER_SHEET_KEY=Nr,g.MERGE_CELL_INTERCEPTOR_CHECK=Xr,g.MoveColsCommand=kt,g.MoveColsMutation=Pe,g.MoveColsMutationUndoFactory=Ao,g.MoveRangeCommand=Ye,g.MoveRangeMutation=Ae,g.MoveRowsCommand=Pt,g.MoveRowsMutation=Ue,g.MoveRowsMutationUndoFactory=Do,g.OperatorType=L,g.PermissionPointsDefinitions=Bu,g.REF_SELECTIONS_ENABLED=uo,g.RangeMergeUtil=ol,g.RangeProtectionPermissionDeleteProtectionPoint=Us,g.RangeProtectionPermissionEditPoint=ue,g.RangeProtectionPermissionManageCollaPoint=Ps,g.RangeProtectionPermissionViewPoint=Qt,g.RangeProtectionRuleModel=K,g.RangeThemeStyle=De,g.RegisterWorksheetRangeThemeStyleCommand=$o,g.RegisterWorksheetRangeThemeStyleMutation=lt,g.RemoveColByRangeCommand=Ss,g.RemoveColCommand=Ot,g.RemoveColMutation=ce,g.RemoveDefinedNameCommand=ms,g.RemoveMergeUndoMutationFactory=ne,g.RemoveNumfmtMutation=Ws,g.RemoveRowByRangeCommand=gs,g.RemoveRowCommand=Nt,g.RemoveRowMutation=Se,g.RemoveSheetCommand=an,g.RemoveSheetMutation=ze,g.RemoveSheetUndoMutationFactory=go,g.RemoveWorksheetMergeCommand=Bo,g.RemoveWorksheetMergeMutation=G,g.ReorderRangeCommand=ln,g.ReorderRangeMutation=Dt,g.ReorderRangeUndoMutationFactory=Ho,g.ResetBackgroundColorCommand=ir,g.ResetTextColorCommand=or,g.SCOPE_WORKBOOK_VALUE_DEFINED_NAME=Sl,g.SELECTIONS_ENABLED=Fi,g.SELECTION_CONTROL_BORDER_BUFFER_COLOR=Eu,g.SELECTION_CONTROL_BORDER_BUFFER_WIDTH=Tu,g.ScrollToCellOperation=Pr,g.SelectionMoveType=Q,g.SetBackgroundColorCommand=rr,g.SetBoldCommand=Da,g.SetBorderBasicCommand=Yo,g.SetBorderColorCommand=zo,g.SetBorderCommand=ut,g.SetBorderPositionCommand=Fo,g.SetBorderStyleCommand=Go,g.SetColDataCommand=Ko,g.SetColDataMutation=dt,g.SetColDataMutationFactory=qo,g.SetColHiddenCommand=vs,g.SetColHiddenMutation=ct,g.SetColVisibleMutation=mt,g.SetColWidthCommand=Vt,g.SetDefinedNameCommand=Is,g.SetFontFamilyCommand=$a,g.SetFontSizeCommand=Ba,g.SetFrozenCommand=xo,g.SetFrozenMutation=Ve,g.SetFrozenMutationFactory=ps,g.SetGridlinesColorCommand=Zo,g.SetGridlinesColorMutation=ht,g.SetHorizontalTextAlignCommand=lr,g.SetItalicCommand=Aa,g.SetNumfmtMutation=Cn,g.SetOverlineCommand=Va,g.SetProtectionCommand=Qo,g.SetRangeProtectionMutation=X,g.SetRangeValuesCommand=it,g.SetRangeValuesMutation=H,g.SetRangeValuesUndoMutationFactory=le,g.SetRowDataCommand=tr,g.SetRowDataMutation=gt,g.SetRowDataMutationFactory=er,g.SetRowHeightCommand=Rn,g.SetRowHiddenCommand=Ms,g.SetRowHiddenMutation=St,g.SetRowVisibleMutation=Rt,g.SetSelectedColsVisibleCommand=fs,g.SetSelectedRowsVisibleCommand=ws,g.SetSelectionsOperation=Y,g.SetSpecificColsVisibleCommand=At,g.SetSpecificRowsVisibleCommand=Wt,g.SetStrikeThroughCommand=La,g.SetStyleCommand=Z,g.SetTabColorCommand=cr,g.SetTabColorMutation=Lt,g.SetTextColorCommand=sr,g.SetTextRotationCommand=dr,g.SetTextWrapCommand=ur,g.SetUnderlineCommand=Wa,g.SetVerticalTextAlignCommand=ar,g.SetWorkbookNameCommand=_s,g.SetWorkbookNameMutation=ys,g.SetWorksheetActivateCommand=bs,g.SetWorksheetActiveOperation=Ct,g.SetWorksheetColWidthMutation=ke,g.SetWorksheetColWidthMutationFactory=Ts,g.SetWorksheetDefaultStyleCommand=hr,g.SetWorksheetDefaultStyleMutation=ft,g.SetWorksheetDefaultStyleMutationFactory=mr,g.SetWorksheetHideCommand=Rr,g.SetWorksheetHideMutation=$e,g.SetWorksheetNameCommand=cn,g.SetWorksheetNameMutation=$t,g.SetWorksheetOrderCommand=Es,g.SetWorksheetOrderMutation=Bt,g.SetWorksheetPermissionPointsCommand=Cr,g.SetWorksheetPermissionPointsMutation=hn,g.SetWorksheetProtectionCommand=fr,g.SetWorksheetProtectionMutation=xe,g.SetWorksheetRangeThemeStyleCommand=io,g.SetWorksheetRangeThemeStyleMutation=tt,g.SetWorksheetRangeThemeStyleMutationFactory=oo,g.SetWorksheetRightToLeftCommand=Xu,g.SetWorksheetRightToLeftMutation=En,g.SetWorksheetRowAutoHeightMutation=Ns,g.SetWorksheetRowAutoHeightMutationFactory=Xa,g.SetWorksheetRowHeightMutation=Ne,g.SetWorksheetRowIsAutoHeightCommand=Sn,g.SetWorksheetRowIsAutoHeightMutation=ge,g.SetWorksheetShowCommand=Os,g.SheetSkeletonChangeType=oi,g.SheetValueChangeType=ri,g.SplitDelimiterEnum=Ir,g.SplitTextToColumnsCommand=wr,g.ToggleCellCheckboxCommand=Mr,g.ToggleGridlinesCommand=yr,g.ToggleGridlinesMutation=pt,g.UnitAction=_,g.UnitObject=O,g.UnregisterWorksheetRangeThemeStyleCommand=_r,g.UnregisterWorksheetRangeThemeStyleMutation=rn,g.ViewStateEnum=qs,g.WorkbookCommentPermission=An,g.WorkbookCopyPermission=Wn,g.WorkbookCopySheetPermission=vo,g.WorkbookCreateProtectPermission=Ln,g.WorkbookCreateSheetPermission=Vn,g.WorkbookDeleteSheetPermission=$n,g.WorkbookDuplicatePermission=Bn,g.WorkbookEditablePermission=re,g.WorkbookExportPermission=Hn,g.WorkbookHideSheetPermission=en,g.WorkbookHistoryPermission=Io,g.WorkbookManageCollaboratorPermission=tn,g.WorkbookMoveSheetPermission=nn,g.WorkbookPrintPermission=jn,g.WorkbookRecoverHistoryPermission=Fn,g.WorkbookRenameSheetPermission=sn,g.WorkbookSelectionModel=lo,g.WorkbookSharePermission=Gn,g.WorkbookViewHistoryPermission=Yn,g.WorkbookViewPermission=zn,g.WorksheetCopyPermission=qn,g.WorksheetDeleteColumnPermission=Kn,g.WorksheetDeleteProtectionPermission=Jn,g.WorksheetDeleteRowPermission=xn,g.WorksheetEditExtraObjectPermission=Xn,g.WorksheetEditPermission=de,g.WorksheetFilterPermission=Zn,g.WorksheetInsertColumnPermission=Qn,g.WorksheetInsertHyperlinkPermission=es,g.WorksheetInsertRowPermission=ts,g.WorksheetManageCollaboratorPermission=ns,g.WorksheetPivotTablePermission=ss,g.WorksheetProtectionPointModel=vt,g.WorksheetProtectionRuleModel=pe,g.WorksheetSelectProtectedCellsPermission=aa,g.WorksheetSelectUnProtectedCellsPermission=la,g.WorksheetSetCellStylePermission=os,g.WorksheetSetCellValuePermission=Tt,g.WorksheetSetColumnStylePermission=ot,g.WorksheetSetRowStylePermission=rt,g.WorksheetSortPermission=rs,g.WorksheetViewPermission=Et,g.addMergeCellsUtil=Ju,g.adjustRangeOnMutation=Gr,g.alignToMergedCellsBorders=_t,g.baseProtectionActions=Be,g.checkCellValueType=Nn,g.checkRangesEditablePermission=Hu,g.convertPrimaryWithCoordToPrimary=ii,g.convertSelectionDataToRange=Uu,g.copyRangeStyles=bt,g.createTopMatrixFromMatrix=Er,g.createTopMatrixFromRanges=Tr,g.defaultWorkbookPermissionPoints=Sr,g.defaultWorksheetPermissionPoint=mn,g.expandToContinuousRange=Lu,g.factoryRemoveNumfmtUndoMutation=il,g.factorySetNumfmtUndoMutation=rl,g.findAllRectangle=Ds,g.followSelectionOperation=Me,g.generateNullCell=kn,g.generateNullCellValue=ao,g.getAddMergeMutationRangeByType=Fs,g.getAllRangePermissionPoint=se,g.getAllWorkbookPermissionPoint=It,g.getAllWorksheetPermissionPoint=oe,g.getAllWorksheetPermissionPointByPointPanel=he,g.getCellAtRowCol=na,g.getDefaultRangePermission=za,g.getInsertRangeMutations=is,g.getMoveRangeUndoRedoMutations=Xt,g.getNextPrimaryCell=$u,g.getPrimaryForRange=te,g.getRemoveRangeMutations=as,g.getSelectionsService=So,g.getSeparateEffectedRangesOnCommand=Ol,g.getSheetCommandTarget=U,g.getSheetCommandTargetWorkbook=so,g.getSheetMutationTarget=Ge,g.getSkeletonChangedEffectedRange=bu,g.getValueChangedEffectedRange=_u,g.handleBaseInsertRange=Qe,g.handleBaseMoveRowsCols=Ht,g.handleBaseRemoveRange=Ze,g.handleCommonDefaultRangeChangeWithEffectRefCommands=js,g.handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests=kl,g.handleDefaultRangeChangeWithEffectRefCommands=Hs,g.handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests=Pl,g.handleDeleteRangeMoveLeft=jr,g.handleDeleteRangeMoveUp=Fr,g.handleDeleteRangeMutation=da,g.handleIRemoveCol=Bs,g.handleIRemoveRow=Lr,g.handleInsertCol=$r,g.handleInsertRangeMoveDown=Br,g.handleInsertRangeMoveRight=Hr,g.handleInsertRangeMutation=ua,g.handleInsertRow=Vr,g.handleMoveCols=$s,g.handleMoveRange=Wr,g.handleMoveRows=Vs,g.isSingleCellSelection=oa,g.rangeMerge=As,g.rotateRange=ie,g.runRefRangeMutations=et,g.setEndForRange=sa,g.splitRangeText=pr,g.transformCellsToRange=fn,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
10
|
+
(function(g,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@univerjs/core"),require("@univerjs/engine-formula"),require("@univerjs/rpc"),require("rxjs"),require("@univerjs/engine-numfmt"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-formula","@univerjs/rpc","rxjs","@univerjs/engine-numfmt","rxjs/operators"],i):(g=typeof globalThis<"u"?globalThis:g||self,i(g.UniverSheets={},g.UniverCore,g.UniverEngineFormula,g.UniverRpc,g.rxjs,g.UniverEngineNumfmt,g.rxjs.operators))})(this,function(g,i,z,Si,A,kn,yt){"use strict";var nd=Object.defineProperty;var sd=(g,i,z)=>i in g?nd(g,i,{enumerable:!0,configurable:!0,writable:!0,value:z}):g[i]=z;var f=(g,i,z)=>sd(g,typeof i!="symbol"?i+"":i,z);var Ks=(s=>(s.OthersCanView="othersCanView",s.NoOneElseCanView="noOneElseCanView",s))(Ks||{}),Js=(s=>(s.DesignedUserCanEdit="designedUserCanEdit",s.OnlyMe="onlyMe",s))(Js||{});class K{constructor(){f(this,"_model",new Map);f(this,"_ruleChange$",new A.Subject);f(this,"ruleChange$",this._ruleChange$.asObservable());f(this,"_ruleRefresh$",new A.Subject);f(this,"ruleRefresh$",this._ruleRefresh$.asObservable());f(this,"_rangeRuleInitStateChange",new A.BehaviorSubject(!1));f(this,"rangeRuleInitStateChange$",this._rangeRuleInitStateChange.asObservable())}dispose(){this._ruleChange$.complete(),this._ruleRefresh$.complete()}ruleRefresh(e){this._ruleRefresh$.next(e)}getRangeRuleInitState(){return this._rangeRuleInitStateChange.value}changeRuleInitState(e){this._rangeRuleInitStateChange.next(e)}addRule(e,t,n){this._ensureRuleMap(e,t).set(n.id,n),this._ruleChange$.next({unitId:e,subUnitId:t,rule:n,type:"add"})}deleteRule(e,t,n){var r,a,l,u;const o=(a=(r=this._model.get(e))==null?void 0:r.get(t))==null?void 0:a.get(n);o&&((u=(l=this._model.get(e))==null?void 0:l.get(t))==null||u.delete(n),this._ruleChange$.next({unitId:e,subUnitId:t,rule:o,type:"delete"}))}setRule(e,t,n,o){var a,l;const r=this.getRule(e,t,n);r&&((l=(a=this._model.get(e))==null?void 0:a.get(t))==null||l.set(n,o),this._ruleChange$.next({unitId:e,subUnitId:t,oldRule:r,rule:o,type:"set"}))}getRule(e,t,n){var o,r;return(r=(o=this._model.get(e))==null?void 0:o.get(t))==null?void 0:r.get(n)}getSubunitRuleList(e,t){var o;return[...(((o=this._model.get(e))==null?void 0:o.get(t))||new Map).values()]}getSubunitRuleListLength(e,t){var o;const n=(o=this._model.get(e))==null?void 0:o.get(t);return n?n.size:0}_ensureRuleMap(e,t){let n=this._model.get(e);n||(n=new Map,this._model.set(e,n));let o=n.get(t);return o||(o=new Map,n.set(t,o)),o}toObject(){const e={};return[...this._model.keys()].forEach(n=>{const o=this._model.get(n),r=[...o.keys()];e[n]={},r.forEach(a=>{const l=o.get(a);e[n][a]=[...l.values()]})}),e}fromObject(e){const t=new Map;Object.keys(e).forEach(n=>{const o=e[n],r=new Map;Object.keys(o).forEach(a=>{const l=o[a].reduce((u,d)=>(u.set(d.id,d),u),new Map);r.set(a,l)}),t.set(n,r)}),this._model=t}deleteUnitModel(e){this._model.delete(e)}createRuleId(e,t){let n=i.Tools.generateRandomId(4);const o=this._ensureRuleMap(e,t);for(;o.has(n);)n=i.Tools.generateRandomId(4);return n}getTargetByPermissionId(e,t){const n=this._model.get(e);if(!n)return null;for(const[o,r]of n)for(const a of r.values())if(a.permissionId===t)return[e,o];return null}}const Ci=(s,e)=>{const t=s.get(K),n=e.ruleIds.map(r=>t.getRule(e.unitId,e.subUnitId,r)).filter(r=>!!r);return{id:ue.id,params:{subUnitId:e.subUnitId,unitId:e.unitId,rules:n}}},pe={id:"sheet.mutation.delete-range-protection",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,ruleIds:o}=e,r=s.get(K);return o.forEach(a=>{r.deleteRule(t,n,a)}),!0}},fi=s=>{const e={...s,ruleIds:s.rules.map(t=>t.id)};return{id:pe.id,params:e}},ue={id:"sheet.mutation.add-range-protection",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,rules:o}=e,r=s.get(K);return o.forEach(a=>{r.addRule(t,n,a)}),!0}},xs={type:i.CommandType.COMMAND,id:"sheet.command.add-range-protection",async handler(s,e){if(!e)return!1;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(K),{rule:r,permissionId:a}=e,{unitId:l,subUnitId:u,ranges:d,description:c,viewState:m,editState:h}=r,R=[{ranges:d,permissionId:a,id:o.createRuleId(l,u),description:c,unitType:r.unitType,unitId:l,subUnitId:u,viewState:m,editState:h}];if(await t.executeCommand(ue.id,{unitId:l,subUnitId:u,rules:R})){const C=[{id:ue.id,params:{unitId:l,subUnitId:u,rules:R}}],v=[{id:pe.id,params:{unitId:l,subUnitId:u,ruleIds:R.map(I=>I.id)}}];n.pushUndoRedo({unitID:l,redoMutations:C,undoMutations:v})}return!0}};class we{constructor(){f(this,"_model",new Map);f(this,"_ruleChange",new A.Subject);f(this,"_ruleRefresh",new A.Subject);f(this,"_resetOrder",new A.Subject);f(this,"ruleChange$",this._ruleChange.asObservable());f(this,"ruleRefresh$",this._ruleRefresh.asObservable());f(this,"resetOrder$",this._resetOrder.asObservable());f(this,"_worksheetRuleInitStateChange",new A.BehaviorSubject(!1));f(this,"worksheetRuleInitStateChange$",this._worksheetRuleInitStateChange.asObservable())}changeRuleInitState(e){this._worksheetRuleInitStateChange.next(e)}getSheetRuleInitState(){return this._worksheetRuleInitStateChange.value}addRule(e,t){this._ensureSubUnitMap(e).set(t.subUnitId,t),this._ruleChange.next({unitId:e,rule:t,type:"add",subUnitId:t.subUnitId})}deleteRule(e,t){var o,r,a;const n=(r=(o=this._model)==null?void 0:o.get(e))==null?void 0:r.get(t);n&&((a=this._model.get(e))==null||a.delete(t),this._ruleChange.next({unitId:e,rule:n,type:"delete",subUnitId:t}))}setRule(e,t,n){var r,a;const o=this.getRule(e,t);o&&((a=(r=this._model)==null?void 0:r.get(e))==null||a.set(t,n),this._ruleChange.next({unitId:e,oldRule:o,rule:n,type:"set",subUnitId:t}))}getRule(e,t){var n,o;return(o=(n=this._model)==null?void 0:n.get(e))==null?void 0:o.get(t)}toObject(){const e={};return[...this._model.keys()].forEach(n=>{const o=this._model.get(n);o!=null&&o.size&&(e[n]=[],[...o.keys()].forEach(a=>{const l=o.get(a);l&&e[n].push(l)}))}),e}fromObject(e){const t=new Map;Object.keys(e).forEach(n=>{const o=e[n];if(o!=null&&o.length){const r=new Map;o.forEach(a=>{r.set(a.subUnitId,a)}),t.set(n,r)}}),this._model=t}deleteUnitModel(e){this._model.delete(e)}_ensureSubUnitMap(e){let t=this._model.get(e);return t||(t=new Map,this._model.set(e,t)),t}ruleRefresh(e){this._ruleRefresh.next(e)}resetOrder(){this._resetOrder.next(Math.random())}getTargetByPermissionId(e,t){const n=this._model.get(e);if(!n)return null;for(const[o,r]of n)if(r.permissionId===t)return[e,o]}}const Oe={id:"sheet.mutation.add-worksheet-protection",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,rule:n}=e;return s.get(we).addRule(t,n),!0}},Fe={id:"sheet.mutation.delete-worksheet-protection",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n}=e;return s.get(we).deleteRule(t,n),!0}},Xs={type:i.CommandType.COMMAND,id:"sheet.command.add-worksheet-protection",async handler(s,e){if(!e)return!1;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),{rule:o,unitId:r}=e,a=o.subUnitId;if(await t.executeCommand(Oe.id,{unitId:r,rule:o,subUnitId:o.subUnitId})){const u=[{id:Oe.id,params:{unitId:r,rule:o,subUnitId:o.subUnitId}}],d=[{id:Fe.id,params:{unitId:r,subUnitId:a}}];n.pushUndoRedo({unitID:r,redoMutations:u,undoMutations:d})}return!0}},vi=i.createInterceptorKey("CELL_CONTENT"),Ii=i.createInterceptorKey("ROW_FILTERED"),Ee={CELL_CONTENT:vi,ROW_FILTERED:Ii};var Zs=(s=>(s[s.DATA_VALIDATION=9]="DATA_VALIDATION",s[s.NUMFMT=10]="NUMFMT",s[s.CELL_IMAGE=11]="CELL_IMAGE",s))(Zs||{});const Qs="sheet.interceptor.range-theme-id",eo="sheet.interceptor.ignore-range-theme";var pi=Object.getOwnPropertyDescriptor,wi=(s,e,t,n)=>{for(var o=n>1?void 0:n?pi(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Mi=(s,e)=>(t,n)=>e(t,n,s);const Nn=i.createInterceptorKey("BEFORE_CELL_EDIT"),Yt=i.createInterceptorKey("AFTER_CELL_EDIT"),Kt=i.createInterceptorKey("AFTER_CELL_EDIT_ASYNC");g.SheetInterceptorService=class extends i.Disposable{constructor(t){super();f(this,"_interceptorsByName",new Map);f(this,"_commandInterceptors",[]);f(this,"_rangeInterceptors",[]);f(this,"_beforeCommandInterceptor",[]);f(this,"_afterCommandInterceptors",[]);f(this,"_workbookDisposables",new Map);f(this,"_worksheetDisposables",new Map);f(this,"_interceptorsDirty",!1);f(this,"_composedInterceptorByKey",new Map);f(this,"writeCellInterceptor",new i.InterceptorManager({BEFORE_CELL_EDIT:Nn,AFTER_CELL_EDIT:Yt,AFTER_CELL_EDIT_ASYNC:Kt}));this._univerInstanceService=t,this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(i.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{this._interceptWorkbook(n)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(i.UniverInstanceType.UNIVER_SHEET).subscribe(n=>this._disposeWorkbookInterceptor(n))),this.intercept(Ee.CELL_CONTENT,{priority:-1,effect:i.InterceptorEffectEnum.Style|i.InterceptorEffectEnum.Value,handler(n,o){const r=o.worksheet.getCellRaw(o.row,o.col);return n?{...r,...n}:r}}),this.disposeWithMe(this.writeCellInterceptor.intercept(Yt,{priority:-1,handler:n=>n})),this.disposeWithMe(this.writeCellInterceptor.intercept(Nn,{priority:-1,handler:n=>n})),this.disposeWithMe(this.writeCellInterceptor.intercept(Kt,{priority:-1,handler:n=>n}))}dispose(){super.dispose(),this._workbookDisposables.forEach(t=>t.dispose()),this._workbookDisposables.clear(),this._worksheetDisposables.clear(),this._interceptorsByName.clear()}interceptCommand(t){if(this._commandInterceptors.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._commandInterceptors.push(t),this._commandInterceptors.sort((n,o)=>{var r,a;return((r=o.priority)!=null?r:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(i.toDisposable(()=>i.remove(this._commandInterceptors,t)))}onCommandExecute(t){const n=this._commandInterceptors.map(o=>o.getMutations(t));return{preUndos:n.map(o=>{var r;return(r=o.preUndos)!=null?r:[]}).flat(),undos:n.map(o=>o.undos).flat(),preRedos:n.map(o=>{var r;return(r=o.preRedos)!=null?r:[]}).flat(),redos:n.map(o=>o.redos).flat()}}interceptAfterCommand(t){if(this._afterCommandInterceptors.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._afterCommandInterceptors.push(t),this._afterCommandInterceptors.sort((n,o)=>{var r,a;return((r=o.priority)!=null?r:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(i.toDisposable(()=>i.remove(this._afterCommandInterceptors,t)))}afterCommandExecute(t){const n=this._afterCommandInterceptors.map(o=>o.getMutations(t));return{undos:n.map(o=>o.undos).flat(),redos:n.map(o=>o.redos).flat()}}interceptBeforeCommand(t){if(this._beforeCommandInterceptor.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._beforeCommandInterceptor.push(t),this._beforeCommandInterceptor.sort((n,o)=>{var r,a;return((r=o.priority)!=null?r:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(i.toDisposable(()=>i.remove(this._beforeCommandInterceptor,t)))}async beforeCommandExecute(t){return(await Promise.all(this._beforeCommandInterceptor.map(o=>o.performCheck(t)))).every(o=>o)}interceptRanges(t){if(this._rangeInterceptors.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._rangeInterceptors.push(t),this._rangeInterceptors.sort((n,o)=>{var r,a;return((r=o.priority)!=null?r:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(i.toDisposable(()=>i.remove(this._rangeInterceptors,t)))}generateMutationsByRanges(t){const n=this._rangeInterceptors.map(o=>o.getMutations(t));return{preUndos:n.map(o=>{var r;return(r=o.preUndos)!=null?r:[]}).flat(),undos:n.map(o=>o.undos).flat(),preRedos:n.map(o=>{var r;return(r=o.preRedos)!=null?r:[]}).flat(),redos:n.map(o=>o.redos).flat()}}async onWriteCell(t,n,o,r,a){const l={subUnitId:n.getSheetId(),unitId:t.getUnitId(),workbook:t,worksheet:n,row:o,col:r,origin:i.Tools.deepClone(a)},u=this.writeCellInterceptor.fetchThroughInterceptors(Yt)(a,l);return await this.writeCellInterceptor.fetchThroughInterceptors(Kt)(Promise.resolve(u),l)}intercept(t,n){const o=t;this._interceptorsByName.has(o)||this._interceptorsByName.set(o,[]);const r=this._interceptorsByName.get(o);r.push(n);const a=r.sort((l,u)=>{var d,c;return((d=u.priority)!=null?d:0)-((c=l.priority)!=null?c:0)});if(this._interceptorsDirty=!0,o===Ee.CELL_CONTENT){const l=i.InterceptorEffectEnum.Style|i.InterceptorEffectEnum.Value;this._interceptorsByName.set(`${o}-${l}`,a);const u=i.InterceptorEffectEnum.Style|i.InterceptorEffectEnum.Value;return this._interceptorsByName.set(`${o}-${i.InterceptorEffectEnum.Style}`,a.filter(d=>((d.effect||u)&i.InterceptorEffectEnum.Style)>0)),this._interceptorsByName.set(`${o}-${i.InterceptorEffectEnum.Value}`,a.filter(d=>((d.effect||u)&i.InterceptorEffectEnum.Value)>0)),this.disposeWithMe(i.toDisposable(()=>{i.remove(this._interceptorsByName.get(o),n),i.remove(this._interceptorsByName.get(`${o}-${l}`),n),i.remove(this._interceptorsByName.get(`${o}-${i.InterceptorEffectEnum.Style}`),n),i.remove(this._interceptorsByName.get(`${o}-${i.InterceptorEffectEnum.Value}`),n)}))}else return this._interceptorsByName.set(o,a),this.disposeWithMe(i.toDisposable(()=>i.remove(this._interceptorsByName.get(o),n)))}fetchThroughInterceptors(t,n,o,r){const a=n===void 0?t:`${t}-${n}`,l=o!=null?o:a;let u=this._composedInterceptorByKey.get(l);if(!u||this._interceptorsDirty){let d=this._interceptorsByName.get(a);d&&r&&(d=d.filter(r)),u=i.composeInterceptors(d||[]),this._composedInterceptorByKey.set(l,u)}return u}_interceptWorkbook(t){const n=new i.DisposableCollection,o=t.getUnitId(),r=this,a=l=>{const u=l.getSheetId();l.__interceptViewModel(d=>{const c=new i.DisposableCollection;r._worksheetDisposables.set(to(o,l),c),c.add(d.registerCellContentInterceptor({getCell(m,h,R,S,C){const v=l.getCellRaw(m,h);return r.fetchThroughInterceptors(Ee.CELL_CONTENT,R,S,C)(v,{unitId:o,subUnitId:u,row:m,col:h,worksheet:l,workbook:t,rawData:v})}})),c.add(d.registerRowFilteredInterceptor({getRowFiltered(m){return!!r.fetchThroughInterceptors(Ee.ROW_FILTERED)(!1,{unitId:o,subUnitId:u,row:m,workbook:t,worksheet:l})}}))})};t.getSheets().forEach(l=>a(l)),n.add(t.sheetCreated$.subscribe(l=>a(l))),n.add(i.toDisposable(()=>t.getSheets().forEach(l=>this._disposeSheetInterceptor(o,l)))),n.add(t.sheetDisposed$.subscribe(l=>this._disposeSheetInterceptor(o,l))),this._workbookDisposables.set(o,n)}_disposeWorkbookInterceptor(t){const n=t.getUnitId(),o=this._workbookDisposables.get(n);o&&(o.dispose(),this._workbookDisposables.delete(n))}_disposeSheetInterceptor(t,n){const o=to(t,n),r=this._worksheetDisposables.get(o);r&&(r.dispose(),this._worksheetDisposables.delete(o))}},g.SheetInterceptorService=wi([Mi(0,i.IUniverInstanceService)],g.SheetInterceptorService);function to(s,e){return`${s}|${e.getSheetId()}`}const J=s=>{const e={};return s.bg&&(e.bg={...s.bg}),s.ol&&(e.ol={...s.ol}),s.bd&&(e.bd={...s.bd}),s.cl&&(e.cl={...s.cl}),s.ht&&(e.ht=s.ht),s.vt&&(e.vt=s.vt),s.bl!==void 0&&(e.bl=s.bl),e};function yi(s){const e={};if(s.length===1)return s[0];for(const t of s)t.bg&&(e.bg=t.bg),t.ol&&(e.ol=t.ol),t.bd&&(e.bd={...e.bd,...t.bd}),t.cl&&(e.cl=t.cl),t.ht&&(e.ht=t.ht),t.vt&&(e.vt=t.vt),t.bl!==void 0&&(e.bl=t.bl);return e}const x={wholeStyle:1,headerRowStyle:2,headerColumnStyle:4,firstRowStyle:8,secondRowStyle:16,lastRowStyle:32,firstColumnStyle:128,secondColumnStyle:256,lastColumnStyle:512};class De{constructor(e,t){f(this,"_name");f(this,"wholeStyle",null);f(this,"headerRowStyle",null);f(this,"headerColumnStyle",null);f(this,"firstRowStyle",null);f(this,"secondRowStyle",null);f(this,"lastRowStyle",null);f(this,"firstColumnStyle",null);f(this,"secondColumnStyle",null);f(this,"lastColumnStyle",null);f(this,"_mergeCacheMap",new Map);t&&this.fromJson({...t,name:e}),this._name=e}getName(){return this._name}getWholeStyle(){return this.wholeStyle}setWholeStyle(e){this.wholeStyle=e}getFirstRowStyle(){return this.firstRowStyle}setFirstRowStyle(e){this.firstRowStyle=e}getSecondRowStyle(){return this.secondRowStyle}setSecondRowStyle(e){this.secondRowStyle=e}getLastRowStyle(){return this.lastRowStyle}setLastRowStyle(e){this.lastRowStyle=e}getFirstColumnStyle(){return this.firstColumnStyle}setFirstColumnStyle(e){this.firstColumnStyle=e}getSecondColumnStyle(){return this.secondColumnStyle}setSecondColumnStyle(e){this.secondColumnStyle=e}getLastColumnStyle(){return this.lastColumnStyle}setLastColumnStyle(e){this.lastColumnStyle=e}getHeaderRowStyle(){return this.headerRowStyle}setHeaderRowStyle(e){this.headerRowStyle=e}getHeaderColumnStyle(){return this.headerColumnStyle}setHeaderColumnStyle(e){this.headerColumnStyle=e}getStyle(e,t,n,o){let r=0;return n&&(r=r|x.lastRowStyle),o&&(r=r|x.lastColumnStyle),e>=0&&t>=0&&(r=r|x.wholeStyle),e%2===1&&(r=r|x.firstRowStyle),e%2===0&&(r=r|x.secondRowStyle),e===0&&(r=r|x.headerRowStyle),t===0&&(r=r|x.headerColumnStyle),t%2===1&&(r=r|x.firstColumnStyle),t%2===0&&(r=r|x.secondColumnStyle),r===0?null:this._getMergeStyle(r)}_getMergeStyle(e){let t=this._mergeCacheMap.get(e);return t||(t=this._mergeStyle(e),this._mergeCacheMap.set(e,t)),t}_mergeStyle(e){const t=[];return this.wholeStyle&&e&x.wholeStyle&&t.push(this.wholeStyle),this.firstColumnStyle&&e&x.firstColumnStyle&&t.push(this.firstColumnStyle),this.secondColumnStyle&&e&x.secondColumnStyle&&t.push(this.secondColumnStyle),this.firstRowStyle&&e&x.firstRowStyle&&t.push(this.firstRowStyle),this.secondRowStyle&&e&x.secondRowStyle&&t.push(this.secondRowStyle),this.headerColumnStyle&&e&x.headerColumnStyle&&t.push(this.headerColumnStyle),this.lastColumnStyle&&e&x.lastColumnStyle&&t.push(this.lastColumnStyle),this.headerRowStyle&&e&x.headerRowStyle&&t.push(this.headerRowStyle),this.lastRowStyle&&e&x.lastRowStyle&&t.push(this.lastRowStyle),yi(t)}toJson(){const e={name:this._name};return this.wholeStyle&&(e.wholeStyle=J(this.wholeStyle)),this.headerRowStyle&&(e.headerRowStyle=J(this.headerRowStyle)),this.headerColumnStyle&&(e.headerColumnStyle=J(this.headerColumnStyle)),this.firstRowStyle&&(e.firstRowStyle=J(this.firstRowStyle)),this.secondRowStyle&&(e.secondRowStyle=J(this.secondRowStyle)),this.lastRowStyle&&(e.lastRowStyle=J(this.lastRowStyle)),this.firstColumnStyle&&(e.firstColumnStyle=J(this.firstColumnStyle)),this.secondColumnStyle&&(e.secondColumnStyle=J(this.secondColumnStyle)),this.lastColumnStyle&&(e.lastColumnStyle=J(this.lastColumnStyle)),e}fromJson(e){this._name=e.name,e.wholeStyle&&(this.wholeStyle=J(e.wholeStyle)),e.headerRowStyle&&(this.headerRowStyle=J(e.headerRowStyle)),e.headerColumnStyle&&(this.headerColumnStyle=J(e.headerColumnStyle)),e.firstRowStyle&&(this.firstRowStyle=J(e.firstRowStyle)),e.secondRowStyle&&(this.secondRowStyle=J(e.secondRowStyle)),e.lastRowStyle&&(this.lastRowStyle=J(e.lastRowStyle)),e.firstColumnStyle&&(this.firstColumnStyle=J(e.firstColumnStyle)),e.secondColumnStyle&&(this.secondColumnStyle=J(e.secondColumnStyle)),e.lastColumnStyle&&(this.lastColumnStyle=J(e.lastColumnStyle))}dispose(){this._mergeCacheMap.clear()}}const _i=(s,e,t)=>new De(`light-${s}`,{headerRowStyle:{bg:{rgb:e}},firstColumnStyle:{bg:{rgb:"rgb(255, 255, 255)"}},secondColumnStyle:{bg:{rgb:t}},lastRowStyle:{bg:{rgb:e}}}),bi=(s,e,t)=>new De(`middle-${s}`,{headerRowStyle:{bg:{rgb:e}},headerColumnStyle:{bg:{rgb:t}},secondRowStyle:{bg:{rgb:t}},lastRowStyle:{bg:{rgb:e}},lastColumnStyle:{bg:{rgb:t}}}),Ti=(s,e,t,n)=>new De(`dark-${s}`,{headerRowStyle:{bg:{rgb:e},cl:{rgb:"rgb(255, 255, 255)"},ht:i.HorizontalAlign.CENTER,bl:i.BooleanNumber.TRUE},firstRowStyle:{bg:{rgb:t}},secondRowStyle:{bg:{rgb:n}},lastRowStyle:{bg:{rgb:e}}}),Ei=[{baseName:"blue",header:"rgb(164, 202, 254)",color:"rgb(225, 239, 254)"},{baseName:"grey",header:"rgb(205, 208, 216)",color:"rgb(238, 239, 241)"},{baseName:"red",header:"rgb(248, 180, 180)",color:"rgb(253, 232, 232)"},{baseName:"orange",header:"rgb(253, 186, 140)",color:"rgb(254, 236, 220)"},{baseName:"yellow",header:"rgb(250, 200, 21)",color:"rgb(255, 244, 185)"},{baseName:"green",header:"rgb(132, 225, 188)",color:"rgb(222, 247, 236)"},{baseName:"azure",header:"rgb(126, 220, 226)",color:"rgb(213, 245, 246)"},{baseName:"indigo",header:"rgb(186, 198, 248)",color:"rgb(233, 237, 255)"},{baseName:"purple",header:"rgb(202, 191, 253)",color:"rgb(237, 235, 254)"},{baseName:"magenta",header:"rgb(248, 180, 217)",color:"rgb(252, 232, 243)"}],Ui=[{baseName:"blue",rowHeader:"rgb(63, 131, 248)",colHeader:"rgb(195, 221, 253)"},{baseName:"grey",rowHeader:"rgb(95, 101, 116)",colHeader:"rgb(227, 229, 234)"},{baseName:"red",rowHeader:"rgb(240, 82, 82)",colHeader:"rgb(251, 213, 213)"},{baseName:"orange",rowHeader:"rgb(255, 90, 31)",colHeader:"rgb(252, 217, 189)"},{baseName:"yellow",rowHeader:"rgb(212, 157, 15)",colHeader:"rgb(252, 220, 106)"},{baseName:"green",rowHeader:"rgb(13, 164, 113)",colHeader:"rgb(188, 240, 218)"},{baseName:"azure",rowHeader:"rgb(6, 148, 162)",colHeader:"rgb(175, 236, 239)"},{baseName:"indigo",rowHeader:"rgb(70, 106, 247)",colHeader:"rgb(210, 218, 250)"},{baseName:"purple",rowHeader:"rgb(144, 97, 249)",colHeader:"rgb(220, 215, 254)"},{baseName:"magenta",rowHeader:"rgb(231, 70, 148)",colHeader:"rgb(250, 209, 232)"}],Pi=[{baseName:"blue",rowHeader:"rgb(30, 66, 159)",firstRow:"rgb(195, 221, 253)",secondRow:"rgb(118, 169, 250)"},{baseName:"grey",rowHeader:"rgb(44, 48, 64)",firstRow:"rgb(227, 229, 234)",secondRow:"rgb(151, 157, 172)"},{baseName:"red",rowHeader:"rgb(155, 28, 28)",firstRow:"rgb(251, 213, 213)",secondRow:"rgb(249, 128, 128)"},{baseName:"orange",rowHeader:"rgb(180, 52, 3)",firstRow:"rgb(252, 217, 189)",secondRow:"rgb(255, 138, 76)"},{baseName:"yellow",rowHeader:"rgb(154, 109, 21)",firstRow:"rgb(252, 220, 106)",secondRow:"rgb(212, 157, 15)"},{baseName:"green",rowHeader:"rgb(4, 108, 78)",firstRow:"rgb(188, 240, 218)",secondRow:"rgb(49, 196, 141)"},{baseName:"azure",rowHeader:"rgb(3, 102, 114)",firstRow:"rgb(175, 236, 239)",secondRow:"rgb(22, 189, 202)"},{baseName:"indigo",rowHeader:"rgb(16, 51, 191)",firstRow:"rgb(210, 218, 250)",secondRow:"rgb(98, 128, 249)"},{baseName:"purple",rowHeader:"rgb(74, 29, 150)",firstRow:"rgb(220, 215, 254)",secondRow:"rgb(172, 148, 250)"},{baseName:"magenta",rowHeader:"rgb(153, 21, 75)",firstRow:"rgb(250, 209, 232)",secondRow:"rgb(241, 126, 184)"}],ki=Ei.map(({baseName:s,header:e,color:t})=>_i(s,e,t)),Ni=Ui.map(({baseName:s,rowHeader:e,colHeader:t})=>bi(s,e,t)),Oi=Pi.map(({baseName:s,rowHeader:e,firstRow:t,secondRow:n})=>Ti(s,e,t,n)),Di=[...ki,...Ni,...Oi],no={headerRowStyle:{bg:{rgb:"rgb(68,114,196)"},cl:{rgb:"rgb(255,255,255)"},ht:i.HorizontalAlign.CENTER,bl:i.BooleanNumber.TRUE},firstRowStyle:{bg:{rgb:"rgb(217,225,242)"}}},Ai=new De("default",no),Wi=new De("default-last-row",{...no,lastRowStyle:{bd:{t:{s:i.BorderStyleTypes.THIN,cl:{rgb:"rgb(68,114,196)"}}},ht:i.HorizontalAlign.CENTER,bl:i.BooleanNumber.TRUE}});var Vi=Object.getOwnPropertyDescriptor,Li=(s,e,t,n)=>{for(var o=n>1?void 0:n?Vi(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},so=(s,e)=>(t,n)=>e(t,n,s);const $i="SHEET_RANGE_THEME_MODEL_PLUGIN";let Me=class extends i.Disposable{constructor(e,t){super();f(this,"_rangeThemeStyleMap",new Map);f(this,"_rangeThemeStyleRuleMap",new Map);f(this,"_rTreeCollection",new Map);f(this,"_defaultRangeThemeMap",new Map);this._sheetInterceptorService=e,this._resourceManagerService=t,this._registerIntercept(),this._initSnapshot(),this._initDefaultTheme()}_initDefaultTheme(){this.registerDefaultRangeTheme(Ai),this.registerDefaultRangeTheme(Wi);for(const e of Di)this.registerDefaultRangeTheme(e)}_ensureRangeThemeStyleMap(e){return this._rangeThemeStyleMap.has(e)||this._rangeThemeStyleMap.set(e,new Map),this._rangeThemeStyleMap.get(e)}_ensureRangeThemeStyleRuleMap(e){return this._rangeThemeStyleRuleMap.has(e)||this._rangeThemeStyleRuleMap.set(e,new Map),this._rangeThemeStyleRuleMap.get(e)}_ensureRTreeCollection(e){return this._rTreeCollection.has(e)||this._rTreeCollection.set(e,new i.RTree),this._rTreeCollection.get(e)}getDefaultRangeThemeStyle(e){return this._defaultRangeThemeMap.get(e)}registerRangeThemeRule(e,t){const{unitId:n,subUnitId:o,range:r}=t,a=i.generateRandomId(),l=this._ensureRangeThemeStyleRuleMap(n),u=this._ensureRTreeCollection(n);l.set(a,{rangeInfo:t,themeName:e}),u.insert({unitId:n,sheetId:o,range:r,id:a})}getRegisteredRangeThemeStyle(e){const{unitId:t,subUnitId:n,range:o}=e,r=this._ensureRTreeCollection(t),a=Array.from(r.bulkSearch([{unitId:t,sheetId:n,range:o}]));if(a[0]){const u=this._ensureRangeThemeStyleRuleMap(t).get(a[0]);if(u)return u.themeName}}removeRangeThemeRule(e,t){const{unitId:n,subUnitId:o,range:r}=t,a=this._ensureRTreeCollection(n),l=Array.from(a.bulkSearch([{unitId:n,sheetId:o,range:r}]));if(l[0]){const u=this._ensureRangeThemeStyleRuleMap(n),d=u.get(l[0]);d&&d.themeName===e&&(u.delete(l[0]),a.remove({unitId:n,sheetId:o,range:r,id:l[0]}))}}registerDefaultRangeTheme(e){this._defaultRangeThemeMap.set(e.getName(),e)}getRegisteredRangeThemes(){return Array.from(this._defaultRangeThemeMap.keys())}registerRangeThemeStyle(e,t){this._ensureRangeThemeStyleMap(e).set(t.getName(),t)}unregisterRangeThemeStyle(e,t){this._ensureRangeThemeStyleMap(e).delete(t)}getALLRegisteredTheme(){return Array.from(this._rangeThemeStyleMap.keys())}getRangeThemeStyle(e,t){return this._defaultRangeThemeMap.has(t)?this._defaultRangeThemeMap.get(t):this._ensureRangeThemeStyleMap(e).get(t)}getCellStyle(e,t,n,o){const r={startRow:n,startColumn:o,endRow:n,endColumn:o},a=this._ensureRTreeCollection(e),l=Array.from(a.bulkSearch([{unitId:e,sheetId:t,range:r}]));if(l[0]){const d=this._ensureRangeThemeStyleRuleMap(e).get(l[0]);if(d){const{rangeInfo:c,themeName:m}=d,h=n-c.range.startRow,R=o-c.range.startColumn;return this.getRangeThemeStyle(e,m).getStyle(h,R,n===c.range.endRow,o===c.range.endColumn)}}}_registerIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(Ee.CELL_CONTENT,{id:Qs,effect:i.InterceptorEffectEnum.Style,handler:(e,t,n)=>{const{row:o,col:r,unitId:a,subUnitId:l}=t,u=this.getCellStyle(a,l,o,r);if(u){const d={...e};return d.themeStyle=u,n(d)}return n(e)}}))}toJson(e){const t=this._ensureRangeThemeStyleRuleMap(e),n=this._ensureRangeThemeStyleMap(e);if(n.size===0&&t.size===0)return"{}";const o={};t.forEach((a,l)=>{o[l]=a});const r={};return n.forEach((a,l)=>{r[l]=a.toJson()}),JSON.stringify({rangeThemeStyleRuleMap:o,rangeThemeStyleMapJson:r})}fromJSON(e){const{rangeThemeStyleRuleMap:t,rangeThemeStyleMapJson:n}=e;this._rangeThemeStyleMap.clear(),this._rangeThemeStyleRuleMap.clear(),this._rTreeCollection.clear(),!(!t||!n)&&(Object.keys(t).forEach(o=>{const r=t[o],{themeName:a,rangeInfo:l}=r;this.registerRangeThemeRule(a,l),this._ensureRTreeCollection(l.unitId).insert({unitId:o,sheetId:l.subUnitId,range:l.range,id:o})}),Object.keys(n).forEach(o=>{const r=n[o],a=new De(r.name);a.fromJson(r),this._ensureRangeThemeStyleMap(o).set(a.getName(),a)}))}deleteUnitId(e){this._rangeThemeStyleMap.delete(e),this._rangeThemeStyleRuleMap.delete(e),this._rTreeCollection.delete(e)}_initSnapshot(){this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e=>this.toJson(e),parseJson:e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}},businesses:[i.UniverInstanceType.UNIVER_SHEET],pluginName:$i,onLoad:(e,t)=>{this.fromJSON(t)},onUnLoad:e=>{this.deleteUnitId(e)}}))}dispose(){super.dispose(),this._rangeThemeStyleMap.clear(),this._rangeThemeStyleRuleMap.clear(),this._defaultRangeThemeMap.clear(),this._rTreeCollection.clear()}};Me=Li([so(0,i.Inject(g.SheetInterceptorService)),so(1,i.Inject(i.IResourceManagerService))],Me);function oo(s,e){const{unitId:t}=e,n=t?s.getUniverSheetInstance(t):s.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);return n?{workbook:n,unitId:n.getUnitId()}:null}function U(s,e={}){const{unitId:t,subUnitId:n}=e,o=t?s.getUniverSheetInstance(t):s.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!o)return null;const r=n?o.getSheetBySheetId(n):o.getActiveSheet(!0);return r?{worksheet:r,workbook:o,unitId:o.getUnitId(),subUnitId:r.getSheetId()}:null}function Ge(s,e){const{unitId:t,subUnitId:n}=e,o=s.getUniverSheetInstance(t);if(!o)return null;const r=o.getSheetBySheetId(n);return r?{worksheet:r,workbook:o}:null}const tt={id:"sheet.mutation.set-worksheet-range-theme-style",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,range:o,themeName:r}=e,a=s.get(i.IUniverInstanceService),l=U(a),u=s.get(Me);return l?(u.registerRangeThemeRule(r,{range:o,unitId:t,subUnitId:n}),!0):!1}},ro=(s,e)=>{const t=Ge(s.get(i.IUniverInstanceService),e);if(!t)throw new Error("[SetWorksheetRangeThemeStyleMutation]: worksheet is null error!");const{worksheet:n}=t;return{unitId:e.unitId,subUnitId:n.getSheetId(),range:e.range,themeName:e.themeName}},nt={id:"sheet.mutation.remove-worksheet-range-theme-style",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,range:o,themeName:r}=e,a=s.get(i.IUniverInstanceService),l=U(a),u=s.get(Me);return l?(u.removeRangeThemeRule(r,{range:o,unitId:t,subUnitId:n}),!0):!1}},io=(s,e)=>{const t=Ge(s.get(i.IUniverInstanceService),e);if(!t)throw new Error("[DeleteWorksheetRangeThemeStyleMutationFactory]: worksheet is null error!");const{worksheet:n}=t;return{unitId:e.unitId,subUnitId:n.getSheetId(),range:e.range,themeName:e.themeName}},ao={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-range-theme-style",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),{unitId:o}=e,r=ro(s,e);return t.syncExecuteCommand(tt.id,e)?(n.pushUndoRedo({unitID:o,undoMutations:[{id:nt.id,params:r}],redoMutations:[{id:tt.id,params:e}]}),!0):!1}},Jt=(s,e)=>{if(s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range}},Se={id:"sheet.mutation.insert-row",type:i.CommandType.MUTATION,handler:(s,e)=>{var S;const{unitId:t,subUnitId:n,range:o,rowInfo:r}=e,l=s.get(i.IUniverInstanceService).getUniverSheetInstance(t);if(l==null)throw new Error("universheet is null error!");const u=l.getSheetBySheetId(n);if(u==null)throw new Error("worksheet is null error!");const d=u.getRowManager().getRowData(),c={h:u.getConfig().defaultRowHeight,hd:0},m=o.startRow,h=o.endRow-o.startRow+1;for(let C=m;C<m+h;C++)r?i.insertMatrixArray(C,(S=r[C-o.startRow])!=null?S:c,d):i.insertMatrixArray(C,c,d);return u.setRowCount(u.getRowCount()+o.endRow-o.startRow+1),u.getCellMatrix().insertRows(o.startRow,h),!0}},_t=(s,e)=>{if(s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range}},de={id:"sheet.mutation.insert-col",type:i.CommandType.MUTATION,handler:(s,e)=>{var S;const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(!o)return!1;const r=o.getColumnManager(),{range:a,colInfo:l}=e,d=r.getColumnData(),c=a.startColumn,m=a.endColumn-a.startColumn+1,h=o.getConfig().defaultColumnWidth;for(let C=c;C<c+m;C++){const v={w:h,hd:0};l?i.insertMatrixArray(C,(S=l[C-a.startColumn])!=null?S:v,d):i.insertMatrixArray(C,v,d)}return o.setColumnCount(o.getColumnCount()+a.endColumn-a.startColumn+1),o.getCellMatrix().insertColumns(a.startColumn,m),!0}},Bi=(s,e)=>{const o=e.getRowManager().getRowData(),r={},a=s.range,l=i.sliceMatrixArray(a.startRow,a.endRow,o),u=i.concatMatrixArray(r,l);return{unitId:s.unitId,subUnitId:s.subUnitId,range:s.range,rowInfo:u}},Ce={id:"sheet.mutation.remove-rows",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(!o)return!1;const r=e.range,l=o.getRowManager().getRowData();for(let c=r.startRow;c<=r.endRow;c++)o.getRowFiltered(c);const u=r.endRow-r.startRow+1;return i.spliceArray(r.startRow,u,l),o.getCellMatrix().removeRows(r.startRow,u),o.setRowCount(o.getRowCount()-u),!0}},Hi=(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(o==null)throw new Error("worksheet is null error!");const l=o.getColumnManager().getColumnData(),u={},d=e.range,c=i.sliceMatrixArray(d.startColumn,d.endColumn,l),m=i.concatMatrixArray(u,c);return{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,colInfo:m}},re={id:"sheet.mutation.remove-col",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(!o)return!1;const r=e.range,l=o.getColumnManager().getColumnData(),u=r.endColumn-r.startColumn+1;return i.spliceArray(r.startColumn,u,l),o.setColumnCount(o.getColumnCount()-u),o.getCellMatrix().removeColumns(r.startColumn,u),!0}};function ji(s,e,t){var a;const n=s.getStyleByCell(e);n==null&&delete e.s,typeof t.s=="string"&&(t.s=s.get(t.s));const o=xt(n,t.s?t.s:null);o&&(i.Tools.removeNull(o),Object.entries(o).forEach(([l,u])=>{typeof u=="object"&&u!==null&&Object.keys(u).length===0&&delete o[l]})),i.Tools.isEmptyObject(o)?delete e.s:e.s=s.setValue(o);const r=t.v?`${t.v}\r
|
|
11
|
+
`:"";!t.p&&e.p&&(r&&r!==((a=e.p.body)==null?void 0:a.dataStream)?delete e.p:zi(e.p,t.s?t.s:null))}function Fi(s,e){if(!e||!Object.keys(e).length)return s;const t=s||{};for(const n in e)n==="bd"?t[n]=Gi(t[n]||{},e[n]):n in t||(t[n]=null);return t}function Gi(s,e){if(!e||!Object.keys(e).length)return s;for(const t in e)t in s||(s[t]=null);return s}function xt(s,e,t=!1){if(e===null)return e;if(e===void 0)return s;const n=i.Tools.deepClone(s)||{};for(const o in e)t&&["bd","tr","td","ht","vt","tb","pd","bg"].includes(o)||(o in n&&o==="bd"?n[o]=Object.assign(n[o],e[o]):n[o]=e[o]);return"cl"in n&&("ul"in n&&n.ul&&(n.ul.cl=n.cl),"ol"in n&&n.ol&&(n.ol.cl=n.cl),"st"in n&&n.st&&(n.st.cl=n.cl)),n}function lo(s,e){return s.some(t=>t.startIndex===e)?lo(s,e+1):e}function zi(s,e){var a;if(s.body==null)return;Array.isArray(s.body.textRuns)||(s.body.textRuns=[]);let t=0;const n=[],o=((a=s.body)==null?void 0:a.paragraphs)||[];for(const l of s.body.textRuns){const{st:u,ed:d,ts:c={}}=l;if(t<u){const h={st:t,ed:u},R=xt({},e,!0);R&&i.Tools.removeNull(R),i.Tools.isEmptyObject(R)||(h.ts=R),n.push(h)}const m=xt(c,e,!0);m&&i.Tools.removeNull(m),i.Tools.isEmptyObject(m)?delete l.ts:l.ts=m,n.push(l),t=lo(o,d)}const r=s.body.dataStream.endsWith(`\r
|
|
12
|
+
`)?s.body.dataStream.length-2:s.body.dataStream.length;if(t<r){const l={st:t,ed:r},u=xt({},e,!0);u&&i.Tools.removeNull(u),i.Tools.isEmptyObject(u)||(l.ts=u),n.push(l)}s.body.textRuns=i.normalizeTextRuns(n)}function qi(s,e,t){var r,a,l;if(e.t)return e.t;if(e.v===null)return null;const n=s.getStyleByCell(e),o=s.getStyleByCell(t);if(t.t===i.CellValueType.FORCE_STRING){if(!kn.isTextFormat((r=o==null?void 0:o.n)==null?void 0:r.pattern)&&e.v!==void 0){if(i.isRealNum(e.v))return i.CellValueType.NUMBER;if(i.isBooleanString(`${e.v}`))return i.CellValueType.BOOLEAN}return i.CellValueType.FORCE_STRING}return Yi(n)?kn.isTextFormat((a=n==null?void 0:n.n)==null?void 0:a.pattern)?i.CellValueType.STRING:uo(e,t):kn.isTextFormat((l=o==null?void 0:o.n)==null?void 0:l.pattern)?i.CellValueType.STRING:uo(e,t)}function uo(s,e){return s.v!==void 0?On(s.v,s.t):On(e.v,e.t)}function Yi(s){var e;return!!((e=s==null?void 0:s.n)!=null&&e.pattern)}function On(s,e){return s===null?null:typeof s=="string"?i.isRealNum(s)?(+s==0||+s==1)&&e===i.CellValueType.BOOLEAN?i.CellValueType.BOOLEAN:i.CellValueType.NUMBER:i.isBooleanString(s)?i.CellValueType.BOOLEAN:i.CellValueType.STRING:typeof s=="number"?(s===0||s===1)&&e===i.CellValueType.BOOLEAN?i.CellValueType.BOOLEAN:i.CellValueType.NUMBER:typeof s=="boolean"?i.CellValueType.BOOLEAN:i.CellValueType.FORCE_STRING}function co(s,e){return s===i.CellValueType.NUMBER?Number(e.v):s===i.CellValueType.BOOLEAN?Ki(e.v)?1:0:s===i.CellValueType.STRING||s===i.CellValueType.FORCE_STRING?`${e.v}`:e.v}function Ki(s){if(typeof s=="string"){if(s.toUpperCase()==="TRUE")return!0;if(s.toUpperCase()==="FALSE")return!1;if(i.isSafeNumeric(s)){if(Number(s)===0)return!1;if(Number(s)===1)return!0}}if(typeof s=="number"){if(s===0)return!1;if(s===1)return!0}return typeof s=="boolean"?s:null}function Ji(s){return s==null?null:(s.f===void 0&&(s.f=null),s.si===void 0&&(s.si=null),s.p===void 0&&(s.p=null),s.v===void 0&&(s.v=null),s.t===void 0&&(s.t=null),s.s===void 0&&(s.s=null),s.custom===void 0&&(s.custom=null),s)}const ie=(s,e)=>{const{unitId:t,subUnitId:n,cellValue:o}=e,a=s.get(i.IUniverInstanceService).getUniverSheetInstance(t);if(a==null)throw new Error("workbook is null error!");const l=a.getSheetBySheetId(n);if(l==null)throw new Error("worksheet is null error!");const u=l.getCellMatrix(),d=a.getStyles(),c=new i.ObjectMatrix;return new i.ObjectMatrix(o).forValue((h,R,S)=>{const C=i.Tools.deepClone(u==null?void 0:u.getValue(h,R))||{},v=d.getStyleByCell(C),I=d.getStyleByCell(S);C.s=Fi(v,I),c.setValue(h,R,Ji(C))}),{...e,options:{},cellValue:c.getMatrix()}},H={id:"sheet.mutation.set-range-values",type:i.CommandType.MUTATION,handler:(s,e)=>{const{cellValue:t,subUnitId:n,unitId:o}=e,a=s.get(i.IUniverInstanceService).getUnit(o);if(!a)return!1;const l=a.getSheetBySheetId(n);if(!l)return!1;const u=l.getCellMatrix(),d=a.getStyles();return new i.ObjectMatrix(t).forValue((m,h,R)=>{if(!R)u==null||u.setValue(m,h,{});else{const S=u.getValue(m,h)||{},C=qi(d,R,S);R.f!==void 0&&(S.f=R.f),R.si!==void 0&&(S.si=R.si),R.p!==void 0&&(S.p=R.p),R.v!==void 0&&(S.v=co(C,R)),S.v!==void 0&&(S.t=C,S.v=co(C,S)),R.s!==void 0&&ji(d,S,R),R.custom!==void 0&&(S.custom=R.custom),u.setValue(m,h,i.Tools.removeNull(S))}}),!0}},mo={type:i.CommandType.COMMAND,id:"sheet.command.append-row",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),{unitId:o,subUnitId:r,cellValue:a,insertRowNums:l,insertColumnNums:u,maxRows:d,maxColumns:c}=e,m={unitId:o,subUnitId:r,cellValue:a},h=ie(s,m),R=[{id:H.id,params:m}],S=[{id:H.id,params:h}];if(l){const v={unitId:o,subUnitId:r,range:{startRow:d,endRow:d,startColumn:0,endColumn:c-1}},I=Jt(s,v);R.unshift({id:Se.id,params:v}),S.push({id:Ce.id,params:I})}if(u){const v={unitId:o,subUnitId:r,range:{startRow:0,endRow:d-1,startColumn:c,endColumn:c-1+u}},I=_t(s,v);R.unshift({id:de.id,params:v}),S.push({id:re.id,params:I})}return i.sequenceExecute(R,t).result?(n.pushUndoRedo({unitID:o,undoMutations:S,redoMutations:R}),!0):!1}},xi=(s,e,t="")=>s.reduce((n,o)=>{const r=o&&o[e];return typeof r!="string"?(console.warn(o,`${e} is not string`),n):(r?(n[r]||(n[r]=[]),n[r].push(o)):n[t].push(o),n)},{}),Xi=(s=0)=>{let e=s;return function(){return e++}};function Dn(s){const e=new i.ObjectMatrix;return s.forEach(t=>{const{startRow:n,startColumn:o,endRow:r,endColumn:a}=t;for(let l=n;l<=r;l++)for(let u=o;u<=a;u++)e.setValue(l,u,null)}),e.clone()}function ho(s){const e=new i.ObjectMatrix;return s.forEach(t=>{const{startRow:n,startColumn:o,endRow:r,endColumn:a}=t;for(let l=n;l<=r;l++)for(let u=o;u<=a;u++)e.setValue(l,u,{v:null,p:null,f:null,si:null,custom:null})}),e.clone()}function Zi(s){const e=new i.ObjectMatrix;return s.forEach(t=>{const{startRow:n,startColumn:o,endRow:r,endColumn:a}=t;for(let l=n;l<=r;l++)for(let u=o;u<=a;u++)e.setValue(l,u,{s:null})}),e.clone()}function go(s,e,t,n,o){const r=e.get(i.IUniverInstanceService),a=t?r.getUnit(t,i.UniverInstanceType.UNIVER_SHEET):r.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),l=n?a==null?void 0:a.getSheetBySheetId(n):a==null?void 0:a.getActiveSheet();if(!l)return null;const{startRow:u,endRow:d,startColumn:c,endColumn:m}=s,h=[],R=[];for(let S=u;S<=d;S++)l.getRowFiltered(S)||(o?l.getRowRawVisible(S)&&h.push(S):h.push(S));for(let S=c;S<=m;S++)o?l.getColVisible(S)&&R.push(S):R.push(S);return{rows:h,cols:R}}function bt(s,e,t,n){const o=[],r=[];for(const h of s){const R=go(h,e,t,n,!0);R&&(o.push(...R.rows),r.push(...R.cols))}const a=Array.from(new Set(o)).sort((h,R)=>h-R),l=Array.from(new Set(r)).sort((h,R)=>h-R),u=[];function d(h){const R=[];let S=h[0];for(let C=1;C<h.length;C++)h[C]!==h[C-1]+1&&(R.push([S,h[C-1]]),S=h[C]);return R.push([S,h[h.length-1]]),R}const c=d(a),m=d(l);for(const[h,R]of c)for(const[S,C]of m)u.push({startRow:h,endRow:R,startColumn:S,endColumn:C});return u}var Q=(s=>(s[s.MOVE_START=0]="MOVE_START",s[s.MOVING=1]="MOVING",s[s.MOVE_END=2]="MOVE_END",s[s.ONLY_SET=3]="ONLY_SET",s))(Q||{});class Ro extends i.Disposable{constructor(t){super();f(this,"_worksheetSelections",new Map);f(this,"_selectionMoveStart$",new A.Subject);f(this,"selectionMoveStart$",this._selectionMoveStart$.asObservable());f(this,"_selectionMoving$",new A.Subject);f(this,"selectionMoving$",this._selectionMoving$.asObservable());f(this,"_selectionMoveEnd$",new A.BehaviorSubject([]));f(this,"selectionMoveEnd$",this._selectionMoveEnd$.asObservable());f(this,"_selectionSet$",new A.BehaviorSubject([]));f(this,"selectionSet$",this._selectionSet$.asObservable());f(this,"selectionChanged$");f(this,"_beforeSelectionMoveEnd$",new A.BehaviorSubject([]));f(this,"beforeSelectionMoveEnd$",this._beforeSelectionMoveEnd$.asObservable());this._workbook=t,this.selectionChanged$=A.merge(this._selectionMoveEnd$,this._selectionSet$)}dispose(){super.dispose(),this._beforeSelectionMoveEnd$.complete(),this._selectionMoveEnd$.complete(),this._selectionMoving$.complete(),this._selectionMoveStart$.complete(),this._selectionSet$.complete()}addSelections(t,n){const o=this.getSelectionsOfWorksheet(t);o.push(...n),this._selectionSet$.next(o)}setSelections(t,n=[],o){switch(this.setSelectionsOfWorksheet(t,n),o){case Q.MOVE_START:this._selectionMoveStart$.next(n);break;case Q.MOVING:this._selectionMoving$.next(n);break;case Q.MOVE_END:this._beforeSelectionMoveEnd$.next(n),this._selectionMoveEnd$.next(n);break;case Q.ONLY_SET:{this._selectionSet$.next(n);break}default:this._selectionSet$.next(n);break}}getCurrentSelections(){return this._getCurrentSelections()}getSelectionOfWorksheet(t){return this.getSelectionsOfWorksheet(t)}getSelectionsOfWorksheet(t){return this._worksheetSelections.has(t)||this._worksheetSelections.set(t,[]),this._worksheetSelections.get(t)}setSelectionsOfWorksheet(t,n){this._worksheetSelections.set(t,[...n])}deleteSheetSelection(t){this._worksheetSelections.set(t,[])}clear(){this._worksheetSelections.clear(),this._selectionSet$.next([])}_getCurrentSelections(){return this.getSelectionsOfWorksheet(this._workbook.getActiveSheet().getSheetId())}getCurrentLastSelection(){const t=this._getCurrentSelections();return t[t.length-1]}}var Qi=Object.getOwnPropertyDescriptor,ea=(s,e,t,n)=>{for(var o=n>1?void 0:n?Qi(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},ta=(s,e)=>(t,n)=>e(t,n,s);g.SheetsSelectionsService=class extends i.RxDisposable{constructor(t){super();f(this,"selectionMoveStart$");f(this,"selectionMoving$");f(this,"selectionMoveEnd$");f(this,"selectionSet$");f(this,"selectionChanged$");f(this,"_workbookSelections",new Map);this._instanceSrv=t,this._init()}get _currentSelectionPos(){const t=this._instanceSrv.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!t)return null;const n=t.getActiveSheet();return{unitId:t.getUnitId(),sheetId:n.getSheetId()}}get currentSelectionParam(){return this._currentSelectionPos}_init(){const t=this._instanceSrv.getCurrentTypeOfUnit$(i.UniverInstanceType.UNIVER_SHEET).pipe(A.shareReplay(1),A.takeUntil(this.dispose$));this.selectionMoveStart$=t.pipe(A.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionMoveStart$:A.of())),this.selectionMoving$=t.pipe(A.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionMoving$:A.of())),this.selectionMoveEnd$=t.pipe(A.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionMoveEnd$:A.of([]))),this.selectionSet$=t.pipe(A.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionSet$:A.of([]))),this.selectionChanged$=t.pipe(A.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionChanged$:A.of([]))).pipe(A.distinctUntilChanged((n,o)=>n.length!==o.length?!1:n.length===0&&o.length===0?!0:n.every((r,a)=>JSON.stringify(r)===JSON.stringify(o[a]))),A.skip(1)),this._instanceSrv.getTypeOfUnitDisposed$(i.UniverInstanceType.UNIVER_SHEET).pipe(A.takeUntil(this.dispose$)).subscribe(n=>{this._removeWorkbookSelection(n.getUnitId())})}clear(){this._workbookSelections.forEach(t=>t.clear())}getCurrentSelections(){return this._getCurrentSelections()}getCurrentLastSelection(){const t=this._getCurrentSelections();return t==null?void 0:t[t.length-1]}addSelections(t,n,o){if(typeof t=="string"){this._ensureWorkbookSelection(t).addSelections(n,o);return}const r=this._currentSelectionPos;if(!r)throw new Error("[SheetsSelectionsService]: cannot find current selection position!");const{unitId:a,sheetId:l}=r;this._ensureWorkbookSelection(a).addSelections(l,t)}setSelections(t,n,o,r){if(typeof t=="string"&&typeof n=="string"){const d=t;this._ensureWorkbookSelection(d).setSelections(n,o||[],r!=null?r:Q.ONLY_SET);return}const a=this._currentSelectionPos;if(!a)throw new Error("[SheetsSelectionsService]: cannot find current selection position!");const{unitId:l,sheetId:u}=a;if(typeof t=="object"){const d=t!=null?t:o,c=n!=null?n:Q.ONLY_SET;this._ensureWorkbookSelection(l).setSelections(u,d,c)}}clearCurrentSelections(){this._getCurrentSelections().splice(0)}isOverlapping(){const t=this.getCurrentSelections();return t==null?!1:t.some(({range:n},o)=>t.some(({range:r},a)=>o===a?!1:n.startRow<=r.endRow&&n.endRow>=r.startRow&&n.startColumn<=r.endColumn&&n.endColumn>=r.startColumn))}_getCurrentSelections(){const t=this._currentSelectionPos;if(!t)return[];const{unitId:n,sheetId:o}=t;return this._ensureWorkbookSelection(n).getSelectionsOfWorksheet(o)}getWorkbookSelections(t){return this._ensureWorkbookSelection(t)}_ensureWorkbookSelection(t){let n=this._workbookSelections.get(t);if(!n){const o=this._instanceSrv.getUnit(t);if(!o)throw new Error(`[SheetsSelectionsService]: cannot resolve unit with id "${t}"!`);n=new Ro(o),this._workbookSelections.set(t,n)}return n}_removeWorkbookSelection(t){this._workbookSelections.delete(t)}},g.SheetsSelectionsService=ea([ta(0,i.IUniverInstanceService)],g.SheetsSelectionsService);const na="DISABLE_NORMAL_SELECTIONS",sa="SELECTIONS_ENABLED",So="REF_SELECTIONS_ENABLED",Xt={id:"sheet.command.clear-selection-all",type:i.CommandType.COMMAND,handler:(s,e)=>{var p;const t=s.get(i.IUniverInstanceService),n=s.get(i.ICommandService),o=s.get(g.SheetsSelectionsService),r=s.get(i.IUndoRedoService),a=s.get(g.SheetInterceptorService),l=t.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!l)return!1;const u=(e==null?void 0:e.unitId)||l.getUnitId(),d=l.getActiveSheet();if(!d)return!1;const c=(e==null?void 0:e.subUnitId)||d.getSheetId(),m=(e==null?void 0:e.ranges)||((p=o.getCurrentSelections())==null?void 0:p.map(M=>M.range));if(!(m!=null&&m.length))return!1;const h=bt(m,s,u,c),R=[],S=[],C={subUnitId:c,unitId:u,cellValue:Dn(h)},v=ie(s,C);R.push({id:H.id,params:C}),S.push({id:H.id,params:v});const I=a.onCommandExecute({id:Xt.id});return R.push(...I.redos),S.unshift(...I.undos),i.sequenceExecute(R,n)?(r.pushUndoRedo({unitID:u,undoMutations:S,redoMutations:R}),!0):!1}},Zt={id:"sheet.command.clear-selection-content",type:i.CommandType.COMMAND,handler:(s,e)=>{var p;const t=s.get(i.IUniverInstanceService),n=s.get(i.ICommandService),o=s.get(g.SheetsSelectionsService),r=s.get(i.IUndoRedoService),a=s.get(g.SheetInterceptorService),l=t.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!l)return!1;const u=(e==null?void 0:e.unitId)||l.getUnitId(),d=l.getActiveSheet();if(!d)return!1;const c=(e==null?void 0:e.subUnitId)||d.getSheetId(),m=(e==null?void 0:e.ranges)||((p=o.getCurrentSelections())==null?void 0:p.map(M=>M.range));if(!(m!=null&&m.length))return!1;const h=bt(m,s,u,c),R={subUnitId:c,unitId:u,cellValue:ho(h)},S=ie(s,R),C=a.onCommandExecute({id:Zt.id}),v=[{id:H.id,params:R},...C.redos],I=[...C.undos,{id:H.id,params:S}];return i.sequenceExecute(v,n).result?(r.pushUndoRedo({unitID:u,undoMutations:I,redoMutations:v}),!0):!1}},Qt={id:"sheet.command.clear-selection-format",type:i.CommandType.COMMAND,handler:(s,e)=>{var p;const t=s.get(i.IUniverInstanceService),n=s.get(i.ICommandService),o=s.get(g.SheetsSelectionsService),r=s.get(i.IUndoRedoService),a=s.get(g.SheetInterceptorService),l=t.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!l)return!1;const u=(e==null?void 0:e.unitId)||l.getUnitId(),d=l.getActiveSheet();if(!d)return!1;const c=(e==null?void 0:e.subUnitId)||d.getSheetId(),m=(e==null?void 0:e.ranges)||((p=o.getCurrentSelections())==null?void 0:p.map(M=>M.range));if(!(m!=null&&m.length))return!1;const h=bt(m,s,u,c),R=[],S=[],C={subUnitId:c,unitId:u,cellValue:Zi(h)},v=ie(s,C);R.push({id:H.id,params:C}),S.push({id:H.id,params:v});const I=a.onCommandExecute({id:Qt.id});return R.push(...I.redos),S.unshift(...I.undos),i.sequenceExecute(R,n)?(r.pushUndoRedo({unitID:u,undoMutations:S,redoMutations:R}),!0):!1}},An=(s,e)=>({subUnitId:e.sheet.id,unitId:e.unitId,subUnitName:e.sheet.name}),st={id:"sheet.mutation.insert-sheet",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService),{sheet:n,index:o,unitId:r}=e,a=t.getUniverSheetInstance(r);return a?a.addWorksheet(n.id,o,n):!1}},Co=(s,e)=>{const t=s.get(i.IUniverInstanceService),{subUnitId:n,unitId:o}=e,r=Ge(t,e);if(!r)throw new Error("[RemoveSheetUndoMutationFactory]: Worksheet is null error!");const{workbook:a,worksheet:l}=r,u=l.getConfig();return{index:a.getConfig().sheetOrder.findIndex(m=>m===n),sheet:u,unitId:o}},ze={id:"sheet.mutation.remove-sheet",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService),{subUnitId:n,unitId:o}=e,r=t.getUniverSheetInstance(o);return r?r.removeSheet(n):!1}},Wn={type:i.CommandType.COMMAND,id:"sheet.command.copy-sheet",handler:(s,e)=>{var M,y;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetInterceptorService),a=s.get(i.LocaleService),l=U(o,e);if(!l)return!1;const{workbook:u,worksheet:d,unitId:c,subUnitId:m}=l,h=i.Tools.deepClone(d.getConfig());h.name=oa(u,a,h.name),h.id=i.Tools.generateRandomId();const S={index:u.getSheetIndex(d)+1,sheet:h,unitId:c},C=An(s,S),v=r.onCommandExecute({id:Wn.id,params:{unitId:c,subUnitId:m,targetSubUnitId:h.id}}),I=[...(M=v.preRedos)!=null?M:[],{id:st.id,params:S},...v.redos],w=[...(y=v.preUndos)!=null?y:[],{id:ze.id,params:C},...v.undos];return i.sequenceExecute(I,t).result?(n.pushUndoRedo({unitID:c,undoMutations:w,redoMutations:I}),!0):!1}};function oa(s,e,t){let n=t+e.t("sheets.tabs.sheetCopy",""),o=2;for(;s.checkSheetName(n);)n=t+e.t("sheets.tabs.sheetCopy",`${o}`),o++;return n}const Ae={id:"sheet.mutation.move-range",type:i.CommandType.MUTATION,handler:(s,e)=>{const{from:t,to:n}=e;if(!t||!n)return!1;const r=s.get(i.IUniverInstanceService).getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const a=r.getSheetBySheetId(e.from.subUnitId),l=r.getSheetBySheetId(e.to.subUnitId);if(!a||!l)return!1;const u=a.getCellMatrix(),d=l.getCellMatrix();return new i.ObjectMatrix(t.value).forValue((c,m,h)=>{u.setValue(c,m,h)}),new i.ObjectMatrix(n.value).forValue((c,m,h)=>{d.setValue(c,m,h)}),!0}};function Tt(s,e,t=!0){const n=e.getMatrixWithMergedCells(...i.selectionToArray(s)),o=[];if(n.forValue((a,l,u)=>{if(u.colSpan!==void 0&&u.rowSpan!==void 0){const d={startRow:a,startColumn:l,endRow:a+u.rowSpan-1,endColumn:l+u.colSpan-1};i.Rectangle.contains(s,d)||o.push(d)}}),o.length===0)return s;const r=i.Rectangle.union(s,...o);return t?Tt(r,e,t):r}function ra(s,e,t){let n=null;return t.getMatrixWithMergedCells(s,e,s,e).forValue((r,a,l)=>(n={actualRow:r,actualColumn:a,startRow:r,startColumn:a,isMerged:l.rowSpan!==void 0||l.colSpan!==void 0,isMergedMainCell:l.rowSpan!==void 0&&l.colSpan!==void 0,endRow:r+(l.rowSpan!==void 0?l.rowSpan-1:0),endColumn:a+(l.colSpan!==void 0?l.colSpan-1:0),rangeType:i.RANGE_TYPE.NORMAL},!1)),n||{actualColumn:e,actualRow:s,startRow:s,startColumn:e,endRow:s,endColumn:e,isMerged:!1,isMergedMainCell:!1,rangeType:i.RANGE_TYPE.NORMAL}}function ia(s,e,t){const{startRow:n,startColumn:o,endRow:r,endColumn:a}=s;return Number.isNaN(n)&&(s.startRow=0),Number.isNaN(r)&&(s.endRow=e-1),Number.isNaN(o)&&(s.startColumn=0),Number.isNaN(a)&&(s.endColumn=t-1),s}function te(s,e){const t=Number.isNaN(s.startRow)?0:s.startRow,n=Number.isNaN(s.startColumn)?0:s.startColumn,o=e.getMergedCell(t,n);return o?{...o,actualRow:t,actualColumn:n,rangeType:i.RANGE_TYPE.NORMAL,isMerged:!0,isMergedMainCell:!0}:{startRow:t,startColumn:n,endRow:s.startRow,endColumn:s.startColumn,actualRow:t,actualColumn:n,rangeType:i.RANGE_TYPE.NORMAL,isMerged:!1,isMergedMainCell:!1}}const ye=(s,e,t)=>({id:q.id,params:{unitId:e.getUnitId(),subUnitId:t.getSheetId(),reveal:!0,selections:[{range:s,primary:te(s,t)}]}});function aa(s){if(!s)return!1;const{range:e,primary:t}=s;return i.Rectangle.equals(e,t)}function la(s){function e(t,n){function o(r){for(let a=r.startRow;a<=r.endRow;a++)if(!s.getRowFiltered(a))for(let l=r.startColumn;l<=r.endColumn;l++)n(a,l,r)}o(t)}return{forOperableEach:e}}const fo=s=>s.id!==Qs;function Et(s,e,t,n,o,r,a){const l={};for(let u=e;u<=t;u++)for(let d=n;d<=o;d++){const c=r?s.getCellWithFilteredInterceptors(a,d,eo,fo):s.getCellWithFilteredInterceptors(u,a,eo,fo);!c||!c.s||(l[u]||(l[u]={}),l[u][d]={s:c.s})}return l}var ua=Object.getOwnPropertyDescriptor,da=(s,e,t,n)=>{for(var o=n>1?void 0:n?ua(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},ca=(s,e)=>(t,n)=>e(t,n,s);const vo=i.createIdentifier("sheets-formula.ref-selections.service");g.RefSelectionsService=class extends g.SheetsSelectionsService{constructor(e){super(e)}_init(){const e=this._getAliveWorkbooks$().pipe(A.takeUntil(this.dispose$));this.selectionMoveStart$=e.pipe(A.switchMap(t=>A.merge(...t.map(n=>n.selectionMoveStart$)))),this.selectionMoving$=e.pipe(A.switchMap(t=>A.merge(...t.map(n=>n.selectionMoving$)))),this.selectionMoveEnd$=e.pipe(A.switchMap(t=>A.merge(...t.map(n=>n.selectionMoveEnd$)))),this.selectionSet$=e.pipe(A.switchMap(t=>A.merge(...t.map(n=>n.selectionSet$))))}_getAliveWorkbooks$(){const e=this._instanceSrv.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET);e.forEach(n=>this._ensureWorkbookSelection(n.getUnitId()));const t=new A.BehaviorSubject(e);return this.disposeWithMe(this._instanceSrv.getTypeOfUnitAdded$(i.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{this._ensureWorkbookSelection(n.getUnitId()),t.next([...t.getValue(),n])})),this.disposeWithMe(this._instanceSrv.getTypeOfUnitDisposed$(i.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{this._removeWorkbookSelection(n.getUnitId()),t.next(t.getValue().filter(o=>o!==n))})),t.pipe(A.map(n=>n.map(o=>this._ensureWorkbookSelection(o.getUnitId()))))}},g.RefSelectionsService=da([ca(0,i.IUniverInstanceService)],g.RefSelectionsService);function Io(s,e){const n=s.get(i.IContextService).getContextValue(So);return s.get(n&&!e?vo:g.SheetsSelectionsService)}const q={id:"sheet.operation.set-selections",type:i.CommandType.OPERATION,handler:(s,e)=>{if(!e)return!1;const{selections:t,type:n,unitId:o,subUnitId:r}=e;return Io(s).setSelections(o,r,[...t],n),!0}},po={id:"sheet.command.select-range",type:i.CommandType.COMMAND,handler:(s,e)=>{if(!e)return!1;const{unitId:t,subUnit:n,range:o}=e,r=s.get(i.ICommandService),a=U(s.get(i.IUniverInstanceService),e);if(!a)return!1;const l=[{range:o,primary:te(o,a.worksheet),style:null}];return r.syncExecuteCommand(q.id,{unitId:t,subUnitId:n,selections:l})}},wo="sheet.command.move-range",qe={type:i.CommandType.COMMAND,id:wo,handler:async(s,e)=>{var p,M;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(i.ErrorService),a=s.get(i.LocaleService),l=s.get(g.SheetInterceptorService),u=U(o);if(!u||!await l.beforeCommandExecute({id:qe.id,params:e}))return!1;const{worksheet:c,subUnitId:m,unitId:h}=u,R=en(s,{unitId:h,subUnitId:m,range:e.fromRange},{subUnitId:m,range:e.toRange});if(R===null)return r.emit(a.t("sheets.info.acrossMergedCell")),!1;const S=l.onCommandExecute({id:qe.id,params:{...e}}),C=[...(p=S.preRedos)!=null?p:[],...R.redos,...S.redos,{id:q.id,params:{unitId:h,subUnitId:m,selections:[{range:e.toRange,primary:ma(e.fromRange,e.toRange,c)}],type:Q.MOVE_END}}],v=[...(M=S.preUndos)!=null?M:[],...R.undos,...S.undos,{id:q.id,params:{unitId:h,subUnitId:m,selections:[{range:e.fromRange,primary:te(e.fromRange,c)}],type:Q.MOVE_END}}],I=i.sequenceExecute(C,t).result,w=l.afterCommandExecute({id:qe.id,params:{...e}});return I?(i.sequenceExecute(w.redos,t),n.pushUndoRedo({unitID:h,undoMutations:[...v,...w.undos],redoMutations:[...C,...w.redos]}),!0):!1}};function en(s,e,t,n=!1){const o=[],r=[],{range:a,subUnitId:l,unitId:u}=e,{range:d,subUnitId:c}=t,h=s.get(i.IUniverInstanceService).getUniverSheetInstance(u),R=h==null?void 0:h.getSheetBySheetId(c),S=h==null?void 0:h.getSheetBySheetId(l),C=R==null?void 0:R.getCellMatrix(),v=S==null?void 0:S.getCellMatrix();if(R&&S&&C&&v){const I=Tt(d,R,!1);if(!i.Rectangle.equals(d,I)&&!n)return null;const w=new i.ObjectMatrix,p=new i.ObjectMatrix,M=new i.ObjectMatrix;i.Range.foreach(a,(T,P)=>{const N=v.getValue(T,P);if(w.setValue(T,P,i.Tools.deepClone(N)),N){const W=h==null?void 0:h.getStyles().get(N.s);M.setValue(T,P,i.Tools.deepClone(W))}p.setValue(T,P,null)});const y=new i.ObjectMatrix,b=new i.ObjectMatrix;i.Range.foreach(d,(T,P)=>{y.setValue(T,P,i.Tools.deepClone(C.getValue(T,P)))}),i.Range.foreach(a,(T,P)=>{const N=i.cellToRange(T,P),W=i.Rectangle.getRelativeRange(N,a),L=i.Rectangle.getPositionRange(W,d),$=i.Tools.deepClone(M.getValue(T,P)),j=i.Tools.deepClone(w.getValue(T,P));j&&$&&(j.s=$),b.setValue(L.startRow,L.startColumn,j)});const k={fromRange:e.range,toRange:t.range,from:{value:p.getMatrix(),subUnitId:l},to:{value:b.getMatrix(),subUnitId:c},unitId:u},E={fromRange:t.range,toRange:e.range,from:{value:w.getMatrix(),subUnitId:l},to:{value:y.getMatrix(),subUnitId:c},unitId:u};o.push({id:Ae.id,params:k}),r.push({id:Ae.id,params:E})}return{redos:o,undos:r}}function ma(s,e,t){const n=s.startRow,o=s.startColumn,r=t.getMergedCell(n,o),a=te(e,t);if(r){const l=r.endRow-r.startRow+1,u=r.endColumn-r.startColumn+1;a.endRow=a.startRow+l-1,a.endColumn=a.startColumn+u-1,a.actualRow=a.startRow,a.actualColumn=a.startColumn,a.isMerged=!1,a.isMergedMainCell=!0}return a}var tn=(s=>(s[s.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",s[s.UNIVER_DOC=1]="UNIVER_DOC",s[s.UNIVER_SHEET=2]="UNIVER_SHEET",s[s.UNIVER_SLIDE=3]="UNIVER_SLIDE",s[s.UNIVER_PROJECT=4]="UNIVER_PROJECT",s[s.UNRECOGNIZED=-1]="UNRECOGNIZED",s))(tn||{}),_=(s=>(s[s.View=0]="View",s[s.Edit=1]="Edit",s[s.ManageCollaborator=2]="ManageCollaborator",s[s.Print=3]="Print",s[s.Duplicate=4]="Duplicate",s[s.Comment=5]="Comment",s[s.Copy=6]="Copy",s[s.Share=7]="Share",s[s.Export=8]="Export",s[s.MoveWorksheet=9]="MoveWorksheet",s[s.DeleteWorksheet=10]="DeleteWorksheet",s[s.HideWorksheet=11]="HideWorksheet",s[s.RenameWorksheet=12]="RenameWorksheet",s[s.CreateWorksheet=13]="CreateWorksheet",s[s.SetWorksheetStyle=14]="SetWorksheetStyle",s[s.EditWorksheetCell=15]="EditWorksheetCell",s[s.InsertHyperlink=16]="InsertHyperlink",s[s.Sort=17]="Sort",s[s.Filter=18]="Filter",s[s.PivotTable=19]="PivotTable",s[s.FloatImg=20]="FloatImg",s[s.History=21]="History",s[s.RwHgtClWdt=22]="RwHgtClWdt",s[s.ViemRwHgtClWdt=23]="ViemRwHgtClWdt",s[s.ViewFilter=24]="ViewFilter",s[s.MoveSheet=25]="MoveSheet",s[s.DeleteSheet=26]="DeleteSheet",s[s.HideSheet=27]="HideSheet",s[s.CopySheet=28]="CopySheet",s[s.RenameSheet=29]="RenameSheet",s[s.CreateSheet=30]="CreateSheet",s[s.SelectProtectedCells=31]="SelectProtectedCells",s[s.SelectUnProtectedCells=32]="SelectUnProtectedCells",s[s.SetCellStyle=33]="SetCellStyle",s[s.SetCellValue=34]="SetCellValue",s[s.SetRowStyle=35]="SetRowStyle",s[s.SetColumnStyle=36]="SetColumnStyle",s[s.InsertRow=37]="InsertRow",s[s.InsertColumn=38]="InsertColumn",s[s.DeleteRow=39]="DeleteRow",s[s.DeleteColumn=40]="DeleteColumn",s[s.EditExtraObject=41]="EditExtraObject",s[s.Delete=42]="Delete",s[s.RecoverHistory=43]="RecoverHistory",s[s.ViewHistory=44]="ViewHistory",s[s.CreatePermissionObject=45]="CreatePermissionObject",s[s.UNRECOGNIZED=-1]="UNRECOGNIZED",s))(_||{}),O=(s=>(s[s.Unkonwn=0]="Unkonwn",s[s.Workbook=1]="Workbook",s[s.Worksheet=2]="Worksheet",s[s.SelectRange=3]="SelectRange",s[s.Document=4]="Document",s[s.Slide=5]="Slide",s[s.UNRECOGNIZED=-1]="UNRECOGNIZED",s))(O||{});class ce{constructor(e,t,n){f(this,"type",O.SelectRange);f(this,"subType",_.Edit);f(this,"status",i.PermissionStatus.INIT);f(this,"value",!0);f(this,"id");f(this,"unitId");f(this,"subUnitId");f(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${O.SelectRange}.${_.Edit}.${n}`}}class nn{constructor(e,t,n){f(this,"type",O.SelectRange);f(this,"subType",_.View);f(this,"status",i.PermissionStatus.INIT);f(this,"value",!0);f(this,"id");f(this,"unitId");f(this,"subUnitId");f(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${O.SelectRange}.${_.View}.${n}`}}class Vn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Comment);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Comment}_${e}`}}class Ln{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Copy);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Copy}_${e}`}}class Mo{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"subType",_.CopySheet);f(this,"status",i.PermissionStatus.INIT);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.CopySheet}_${e}`}}class $n{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.CreatePermissionObject);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.CreatePermissionObject}_${e}`}}class Bn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.CreateSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.CreateSheet}_${e}`}}class Hn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.DeleteSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.DeleteSheet}_${e}`}}class jn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Duplicate);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Duplicate}_${e}`}}class ae{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Edit);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Edit}_${e}`}}class Fn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Export);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Export}_${e}`}}class sn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.HideSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.HideSheet}_${e}`}}class yo{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.History);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.History}_${e}`}}class on{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.ManageCollaborator);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.ManageCollaborator}_${e}`}}class rn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.MoveSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.MoveSheet}_${e}`}}class Gn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Print);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Print}_${e}`}}class zn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.RecoverHistory);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.RecoverHistory}_${e}`}}class an{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.RenameSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.RenameSheet}_${e}`}}class qn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Share);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Share}_${e}`}}class Yn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.View);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.View}_${e}`}}class Kn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",O.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.ViewHistory);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.ViewHistory}_${e}`}}class Jn{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.Copy);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.Copy}_${e}_${t}`}}class xn{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.DeleteColumn);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.DeleteColumn}_${e}_${t}`}}class Xn{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.Delete);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.Delete}_${e}_${t}`}}class Zn{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.DeleteRow);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.DeleteRow}_${e}_${t}`}}class me{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.Edit);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.Edit}_${e}_${t}`}}class Qn{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.EditExtraObject);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.EditExtraObject}_${e}_${t}`}}class es{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.Filter);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.Filter}_${e}_${t}`}}class ts{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.InsertColumn);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.InsertColumn}_${e}_${t}`}}class ns{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.InsertHyperlink);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.InsertHyperlink}_${e}_${t}`}}class ss{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.InsertRow);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.InsertRow}_${e}_${t}`}}class os{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.ManageCollaborator);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.ManageCollaborator}_${e}_${t}`}}class rs{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.PivotTable);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.PivotTable}_${e}_${t}`}}class ha{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SelectProtectedCells);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SelectProtectedCells}_${e}_${t}`}}class ga{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SelectUnProtectedCells);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SelectUnProtectedCells}_${e}_${t}`}}class is{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SetCellStyle);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SetCellStyle}_${e}_${t}`}}class Ut{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SetCellValue);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SetCellValue}_${e}_${t}`}}class ot{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SetColumnStyle);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SetColumnStyle}_${e}_${t}`}}class rt{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SetRowStyle);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SetRowStyle}_${e}_${t}`}}class as{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.Sort);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.Sort}_${e}_${t}`}}class Pt{constructor(e,t){f(this,"value",!0);f(this,"type",O.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.View);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.View}_${e}_${t}`}}const it={id:"sheet.command.set-range-values",type:i.CommandType.COMMAND,handler:(s,e)=>{var E;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetsSelectionsService),a=s.get(g.SheetInterceptorService),l=s.get(i.IPermissionService),u=U(o,e);if(!u)return!1;const{subUnitId:d,unitId:c,workbook:m,worksheet:h}=u,{value:R,range:S}=e,C=S?[S]:(E=r.getCurrentSelections())==null?void 0:E.map(T=>T.range);if(!C||!C.length||!l.getPermissionPoint(new me(c,d).id))return!1;const v=new i.ObjectMatrix;let I;if(i.Tools.isArray(R))for(let T=0;T<C.length;T++){const{startRow:P,startColumn:N,endRow:W,endColumn:L}=C[T];for(let $=0;$<=W-P;$++)for(let j=0;j<=L-N;j++)v.setValue($+P,j+N,R[$][j])}else if(i.isICellData(R))for(let T=0;T<C.length;T++){const{startRow:P,startColumn:N,endRow:W,endColumn:L}=C[T];for(let $=P;$<=W;$++)for(let j=N;j<=L;j++)v.setValue($,j,R)}else I=R;const w={subUnitId:d,unitId:c,cellValue:I!=null?I:v.getMatrix()},p=ie(s,w);if(!t.syncExecuteCommand(H.id,w))return!1;const{undos:y,redos:b}=a.onCommandExecute({id:it.id,params:{...w,range:C}});if(i.sequenceExecute([...b],t).result){const T=ye(S!=null?S:v.getRange(),m,h);return n.pushUndoRedo({unitID:c,undoMutations:[{id:H.id,params:p},...y,T],redoMutations:[{id:H.id,params:w},...b,i.Tools.deepClone(T)]}),!0}return!1}};function ls(s,e){const t=[],n=[],{unitId:o,subUnitId:r,range:a,shiftDimension:l,cellValue:u={}}=e,d=s.get(i.IUniverInstanceService),c=s.get(g.SheetInterceptorService),m=d.getUniverSheetInstance(o),h=m==null?void 0:m.getSheetBySheetId(r);if(h){const R=h.getCellMatrix(),S=R.getDataRange();if(a.startColumn<=S.endColumn||a.startRow<=S.endRow){let p,M;if(l===i.Dimension.COLUMNS){const b=Math.min(a.endRow,S.endRow);let k=0;for(let T=a.startRow;T<=b;T++){const P=R.getRow(T),N=P?i.getArrayLength(P)-1:0;k=Math.max(k,N)}p={startRow:a.startRow,startColumn:a.startColumn,endRow:b,endColumn:k};const E=a.endColumn-a.startColumn+1;M={startRow:a.startRow,startColumn:p.startColumn+E,endRow:b,endColumn:p.endColumn+E}}else{const b=Math.min(a.endColumn,S.endColumn),k=S.endRow;p={startRow:a.startRow,startColumn:a.startColumn,endRow:k,endColumn:b};const E=a.endRow-a.startRow+1;M={startRow:p.startRow+E,startColumn:a.startColumn,endRow:p.endRow+E,endColumn:b}}const y=en(s,{unitId:o,subUnitId:r,range:p},{subUnitId:r,range:M},!0);y&&(t.push(...y.redos),n.push(...y.undos))}if(Object.entries(u).length===0)for(let p=a.startRow;p<=a.endRow;p++){u[p]||(u[p]={});for(let M=a.startColumn;M<=a.endColumn;M++)u[p][M]=null}const C={subUnitId:r,unitId:o,cellValue:u},v=ie(s,C),{undos:I,redos:w}=c.onCommandExecute({id:it.id,params:{...C,range:a}});t.push({id:H.id,params:C},...w),n.push({id:H.id,params:v},...I)}return{redo:t,undo:n}}function us(s,e){const t=[],n=[],{unitId:o,subUnitId:r,range:a,shiftDimension:l}=e,u=s.get(i.IUniverInstanceService),d=s.get(g.SheetInterceptorService),c=u.getUniverSheetInstance(o),m=c==null?void 0:c.getSheetBySheetId(r);if(m){const h=m.getCellMatrix(),R=h.getDataRange(),S={subUnitId:r,unitId:o,cellValue:Dn([a])},C=ie(s,S),v=d.onCommandExecute({id:it.id,params:S});if(t.push({id:H.id,params:S},...v.redos),n.push(...v.undos,{id:H.id,params:C}),a.startColumn<=R.endColumn||a.startRow<=R.endRow){let I=null,w=null;if(l===i.Dimension.COLUMNS&&a.endColumn<R.endColumn){const p=Math.min(a.endRow,R.endRow);let M=0;for(let b=a.startRow;b<=p;b++){const k=h.getRow(b),E=k?i.getArrayLength(k)-1:0;M=Math.max(M,E)}I={startRow:a.startRow,startColumn:a.endColumn+1,endRow:p,endColumn:M};const y=a.endColumn-a.startColumn+1;w={startRow:a.startRow,startColumn:I.startColumn-y,endRow:p,endColumn:I.endColumn-y}}if(l===i.Dimension.ROWS&&a.endRow<R.endRow){const p=Math.min(a.endColumn,R.endColumn),M=R.endRow;I={startRow:a.endRow+1,startColumn:a.startColumn,endRow:M,endColumn:p};const y=a.endRow-a.startRow+1;w={startRow:I.startRow-y,startColumn:a.startColumn,endRow:I.endRow-y,endColumn:p}}if(I&&w){const p=en(s,{unitId:o,subUnitId:r,range:I},{subUnitId:r,range:w},!0);p&&(t.push(...p.redos),n.push(...p.undos))}}}return{redo:t,undo:n}}function Ra(s,e,t,n,o,r){const{startRow:a,endRow:l,startColumn:u,endColumn:d}=e;if(o===i.Dimension.ROWS){const c=l-a+1;for(let m=t;m>=a;m--)for(let h=u;h<=d;h++){const R=s.getValue(m,h);R==null?s.realDeleteValue(m+c,h):s.setValue(m+c,h,R)}for(let m=l;m>=a;m--)for(let h=u;h<=d;h++)r&&r[m]&&r[m][h]?s.setValue(m,h,r[m][h]):s.realDeleteValue(m,h)}else if(o===i.Dimension.COLUMNS){const c=d-u+1;for(let m=a;m<=l;m++)for(let h=n;h>=u;h--){const R=s.getValue(m,h);R==null?s.realDeleteValue(m,h+c):s.setValue(m,h+c,R)}for(let m=a;m<=l;m++)for(let h=d;h>=u;h--)r&&r[m]&&r[m][h]?s.setValue(m,h,r[m][h]):s.realDeleteValue(m,h)}}function Sa(s,e,t,n,o){const{startRow:r,endRow:a,startColumn:l,endColumn:u}=e,d=a-r+1,c=u-l+1;if(o===i.Dimension.ROWS)for(let m=r;m<=t;m++)for(let h=l;h<=u;h++){const R=s.getValue(m+d,h);R==null?s.realDeleteValue(m,h):s.setValue(m,h,R)}else if(o===i.Dimension.COLUMNS)for(let m=r;m<=a;m++)for(let h=l;h<=n;h++){const R=s.getValue(m,h+c);R==null?s.realDeleteValue(m,h):s.setValue(m,h,R)}}const _o="sheet.command.delete-range-move-left",Ye={type:i.CommandType.COMMAND,id:_o,handler:async(s,e)=>{var M,y,b;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetsSelectionsService),a=s.get(g.SheetInterceptorService),l=U(o);if(!l)return!1;const{worksheet:u,workbook:d,subUnitId:c,unitId:m}=l;let h=e==null?void 0:e.range;if(h||(h=(M=r.getCurrentLastSelection())==null?void 0:M.range),!h)return!1;const R={range:h,subUnitId:c,unitId:m,shiftDimension:i.Dimension.COLUMNS},S=a.onCommandExecute({id:Ye.id,params:{range:h}}),{redo:C,undo:v}=us(s,R),I=[...(y=S.preRedos)!=null?y:[],...C],w=[...S.undos,...v];return I.push(...S.redos),I.push(ye(h,d,u)),w.push(...(b=S.preUndos)!=null?b:[]),i.sequenceExecute(I,t).result?(n.pushUndoRedo({unitID:m,undoMutations:w.reverse(),redoMutations:I}),!0):!1}},bo="sheet.command.delete-range-move-up",Ke={type:i.CommandType.COMMAND,id:bo,handler:async(s,e)=>{var M,y,b;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetsSelectionsService),a=s.get(g.SheetInterceptorService),l=U(o);if(!l)return!1;const{unitId:u,subUnitId:d,workbook:c,worksheet:m}=l;let h=e==null?void 0:e.range;if(h||(h=(M=r.getCurrentLastSelection())==null?void 0:M.range),!h)return!1;const R={range:h,subUnitId:d,unitId:u,shiftDimension:i.Dimension.ROWS},S=a.onCommandExecute({id:Ke.id,params:{range:h}}),{redo:C,undo:v}=us(s,R),I=[...(y=S.preRedos)!=null?y:[],...C],w=[...S.undos,...v];return I.push(...S.redos),I.push(ye(h,c,m)),w.push(...(b=S.preUndos)!=null?b:[]),i.sequenceExecute(I,t).result?(n.pushUndoRedo({unitID:u,undoMutations:w.reverse(),redoMutations:I}),!0):!1}},To={type:i.CommandType.COMMAND,id:"sheet.command.delete-range-protection",async handler(s,e){if(!e)return!1;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),{unitId:o,subUnitId:r,rule:a}=e,l={unitId:o,subUnitId:r,ruleIds:[a.id]};return await t.executeCommand(pe.id,l)&&n.pushUndoRedo({unitID:o,redoMutations:[{id:pe.id,params:l}],undoMutations:[{id:ue.id,params:{unitId:o,subUnitId:r,rules:[a]}}]}),!0}},Eo={type:i.CommandType.COMMAND,id:"sheet.command.delete-worksheet-protection",handler(s,e){if(!e)return!1;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),{rule:o,unitId:r,subUnitId:a}=e;t.executeCommand(Fe.id,{unitId:r,subUnitId:a});const l=[{id:Fe.id,params:{unitId:r,subUnitId:a}}],u=[{id:Oe.id,params:{unitId:r,rule:o,subUnitId:a}}];return n.pushUndoRedo({unitID:r,redoMutations:l,undoMutations:u}),!0}},Uo={type:i.CommandType.COMMAND,id:"sheet.command.remove-worksheet-range-theme-style",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),{unitId:o}=e,r=io(s,e);return t.syncExecuteCommand(nt.id,e)?(n.pushUndoRedo({unitID:o,undoMutations:[{id:tt.id,params:r}],redoMutations:[{id:nt.id,params:e}]}),!0):!1}},Po={id:"sheet.command.insert-defined-name",type:i.CommandType.COMMAND,handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService);if(!e)return!1;const o={...e};return t.syncExecuteCommand(z.SetDefinedNameMutation.id,o)?(n.pushUndoRedo({unitID:e.unitId,undoMutations:[{id:z.RemoveDefinedNameMutation.id,params:o}],redoMutations:[{id:z.SetDefinedNameMutation.id,params:o}]}),!0):!1}},Ca="sheet.command.insert-range-move-down",at={type:i.CommandType.COMMAND,id:"sheet.command.insert-range-move-down",handler:async(s,e)=>{var W,L,$;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetsSelectionsService),a=s.get(g.SheetInterceptorService),l=s.get(i.ErrorService),u=s.get(i.LocaleService);if(r.isOverlapping())return l.emit(u.t("sheets.info.overlappingSelections")),!1;const d=U(o);if(!d)return!1;const{unitId:c,subUnitId:m,worksheet:h,workbook:R}=d;let S=e==null?void 0:e.range;if(S||(S=(W=r.getCurrentLastSelection())==null?void 0:W.range),!S)return!1;const C=[],v=[],I=h.getCellMatrix(),w=I.getDataRange(),M=I.getSlice(w.startRow,w.endRow,S.startColumn,S.endColumn).getDataRange().endRow,y=Math.max(M+(S.endRow-S.startRow+1)-w.endRow,0);if(y>0){const j=S.startRow-1,ee=h.getRowHeight(j),Y={unitId:c,subUnitId:m,range:{startRow:w.endRow+1,endRow:w.endRow+y,startColumn:w.startColumn,endColumn:w.endColumn},rowInfo:new Array(y).fill(void 0).map(()=>({h:ee,hd:i.BooleanNumber.FALSE}))};C.push({id:Se.id,params:Y});const Te=Jt(s,Y);v.push({id:Ce.id,params:Te})}const b={};i.Range.foreach(S,(j,ee)=>{const Y=h.getCell(j,ee);Y&&(b[j]||(b[j]={}),b[j][ee]={s:Y.s})});const k={range:S,subUnitId:m,unitId:c,shiftDimension:i.Dimension.ROWS,cellValue:b},{redo:E,undo:T}=ls(s,k);C.push(...E),v.push(...T);const P=a.onCommandExecute({id:at.id,params:{range:S}});return C.push(...P.redos),C.push(ye(S,R,h)),v.push(...(L=P.preUndos)!=null?L:[]),C.unshift(...($=P.preRedos)!=null?$:[]),v.unshift(...P.undos),i.sequenceExecute(C,t)?(n.pushUndoRedo({unitID:c,undoMutations:v.reverse(),redoMutations:C}),!0):!1}},ds="sheet.command.insert-range-move-right",kt={type:i.CommandType.COMMAND,id:ds,handler:async(s,e)=>{var W,L,$;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetsSelectionsService),a=s.get(g.SheetInterceptorService),l=s.get(i.ErrorService),u=s.get(i.LocaleService);if(r.isOverlapping())return l.emit(u.t("sheets.info.overlappingSelections")),!1;const d=U(o);if(!d)return!1;const{workbook:c,worksheet:m,unitId:h,subUnitId:R}=d;let S=e==null?void 0:e.range;if(S||(S=(W=r.getCurrentLastSelection())==null?void 0:W.range),!S)return!1;const C=[],v=[],I=m.getCellMatrix(),w=I.getDataRange(),M=I.getSlice(S.startRow,S.endRow,w.startColumn,w.endColumn).getDataRange().endColumn,y=Math.max(M+(S.endColumn-S.startColumn+1)-w.endColumn,0);if(y>0){const j=S.startColumn-1,ee=m.getColumnWidth(j),Y={unitId:h,subUnitId:R,range:{startRow:w.startRow+1,endRow:w.endRow,startColumn:w.endColumn+1,endColumn:w.endColumn+y},colInfo:new Array(y).fill(void 0).map(()=>({w:ee,hd:i.BooleanNumber.FALSE}))};C.push({id:de.id,params:Y});const Te=_t(s,Y);v.push({id:re.id,params:Te})}const b={};i.Range.foreach(S,(j,ee)=>{const Y=m.getCell(j,ee);!Y||!Y.s||(b[j]||(b[j]={}),b[j][ee]={s:Y.s})});const k={range:S,subUnitId:R,unitId:h,shiftDimension:i.Dimension.COLUMNS,cellValue:b},{redo:E,undo:T}=ls(s,k);C.push(...E),v.push(...T);const P=a.onCommandExecute({id:kt.id,params:{range:S}});return C.push(...P.redos),C.push(ye(S,c,m)),v.push(...(L=P.preUndos)!=null?L:[]),C.unshift(...($=P.preRedos)!=null?$:[]),v.unshift(...P.undos),i.sequenceExecute(C,t).result?(n.pushUndoRedo({unitID:h,undoMutations:v.reverse(),redoMutations:C}),!0):!1}},ko="sheet.command.insert-row",We={type:i.CommandType.COMMAND,id:ko,handler:async(s,e)=>{const t=s.get(i.ICommandService),n=s.get(g.SheetInterceptorService),{range:o,direction:r,unitId:a,subUnitId:l,cellValue:u}=e;return await n.beforeCommandExecute({id:We.id,params:e})?t.syncExecuteCommand(cs.id,{range:o,direction:r,unitId:a,subUnitId:l,cellValue:u}):!1}},cs={type:i.CommandType.COMMAND,id:"sheet.command.insert-row-by-range",handler:(s,e)=>{var E,T,P,N;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetInterceptorService),a=U(o,e);if(!a)return!1;const{workbook:l,worksheet:u}=a,{range:d,direction:c,unitId:m,subUnitId:h,cellValue:R}=e,{startRow:S,endRow:C}=d;d.rangeType=i.RANGE_TYPE.ROW;const v=c===i.Direction.UP?S:S-1,I=u.getRowHeight(v),w={unitId:m,subUnitId:h,range:d,rowInfo:new Array(C-S+1).fill(void 0).map(()=>({h:I,hd:i.BooleanNumber.FALSE}))},p=Jt(s,w),M=[{id:Se.id,params:w}],y=[{id:Ce.id,params:p}];R&&M.push({id:H.id,params:{unitId:m,subUnitId:h,cellValue:R}});const b=r.onCommandExecute({id:We.id,params:e});return M.unshift(...(E=b.preRedos)!=null?E:[]),M.push(...(T=b.redos)!=null?T:[]),M.push(ye(d,l,u)),y.unshift(...(P=b.preUndos)!=null?P:[]),y.push(...(N=b.undos)!=null?N:[]),i.sequenceExecute(M,t).result?(n.pushUndoRedo({unitID:e.unitId,undoMutations:y,redoMutations:M}),!0):!1}},No={type:i.CommandType.COMMAND,id:"sheet.command.insert-row-before",handler:async s=>{var S;const t=(S=s.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:S.map(C=>C.range);let n;if((t==null?void 0:t.length)===1)n=t[0];else return!1;const o=s.get(i.IUniverInstanceService),r=U(o);if(!r)return!1;const{worksheet:a,subUnitId:l,unitId:u}=r,{startRow:d,endRow:c}=n,m=0,h=a.getColumnCount()-1,R={unitId:u,subUnitId:l,direction:i.Direction.UP,range:{startRow:d,endRow:c,startColumn:m,endColumn:h},cellValue:Et(a,d,c,m,h,!0,d-1)};return s.get(i.ICommandService).executeCommand(We.id,R)}},Oo={type:i.CommandType.COMMAND,id:"sheet.command.insert-row-after",handler:async s=>{var C;const t=(C=s.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:C.map(v=>v.range);let n;if((t==null?void 0:t.length)===1)n=t[0];else return!1;const o=s.get(i.IUniverInstanceService),r=U(o);if(!r)return!1;const{worksheet:a,unitId:l,subUnitId:u}=r,d=n.endRow-n.startRow+1,c=n.endRow+1,m=n.endRow+d,h=0,R=a.getColumnCount()-1,S={unitId:l,subUnitId:u,direction:i.Direction.DOWN,range:{startRow:c,endRow:m,startColumn:h,endColumn:R,rangeType:i.RANGE_TYPE.ROW},cellValue:Et(a,c,m,h,R,!0,n.endRow)};return s.get(i.ICommandService).executeCommand(We.id,S)}},Do="sheet.command.insert-col",Ve={type:i.CommandType.COMMAND,id:Do,handler:async(s,e)=>{const t=s.get(i.ICommandService),n=s.get(g.SheetInterceptorService),{range:o,direction:r,subUnitId:a,unitId:l,cellValue:u}=e;return await n.beforeCommandExecute({id:Ve.id,params:e})?t.syncExecuteCommand(ms.id,{range:o,direction:r,unitId:l,subUnitId:a,cellValue:u}):!1}},ms={type:i.CommandType.COMMAND,id:"sheet.command.insert-col-by-range",handler:(s,e)=>{var k,E,T,P;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetInterceptorService),{range:a,direction:l,subUnitId:u,unitId:d,cellValue:c}=e,{startColumn:m,endColumn:h}=e.range;a.rangeType=i.RANGE_TYPE.COLUMN;const R=o.getUniverSheetInstance(e.unitId),S=R.getSheetBySheetId(e.subUnitId),C=l===i.Direction.LEFT?m:m-1,v=S.getColumnWidth(C),I={unitId:d,subUnitId:u,range:a,colInfo:new Array(h-m+1).fill(void 0).map(()=>({w:v,hd:i.BooleanNumber.FALSE}))},w=_t(s,I),p=[{id:de.id,params:I}],M=[{id:re.id,params:w}];c&&p.push({id:H.id,params:{unitId:d,subUnitId:u,cellValue:c}});const y=r.onCommandExecute({id:Ve.id,params:e});return p.unshift(...(k=y.preRedos)!=null?k:[]),p.push(...(E=y.redos)!=null?E:[]),p.push(ye(a,R,S)),M.unshift(...(T=y.preUndos)!=null?T:[]),M.push(...(P=y.undos)!=null?P:[]),i.sequenceExecute(p,t).result?(n.pushUndoRedo({unitID:e.unitId,undoMutations:M.filter(Boolean),redoMutations:p.filter(Boolean)}),!0):!1}},Ao={type:i.CommandType.COMMAND,id:"sheet.command.insert-col-before",handler:async s=>{const t=s.get(g.SheetsSelectionsService).getCurrentSelections();let n;if((t==null?void 0:t.length)===1)n=t[0].range;else return!1;const o=s.get(i.IUniverInstanceService),r=U(o);if(!r)return!1;const{worksheet:a,unitId:l,subUnitId:u}=r,{startColumn:d,endColumn:c}=n,m=0,h=a.getRowCount()-1,R={unitId:l,subUnitId:u,direction:i.Direction.LEFT,range:{startColumn:d,endColumn:c,startRow:m,endRow:h,rangeType:i.RANGE_TYPE.COLUMN},cellValue:Et(a,m,h,d,c,!1,d-1)};return s.get(i.ICommandService).executeCommand(Ve.id,R)}},Wo={type:i.CommandType.COMMAND,id:"sheet.command.insert-col-after",handler:async s=>{const t=s.get(g.SheetsSelectionsService).getCurrentSelections();let n;if((t==null?void 0:t.length)===1)n=t[0].range;else return!1;const o=s.get(i.IUniverInstanceService),r=U(o);if(!r)return!1;const{worksheet:a,unitId:l,subUnitId:u}=r,d=n.endColumn-n.startColumn+1,c=n.endColumn+1,m=n.endColumn+d,h=0,R=a.getRowCount()-1,S={unitId:l,subUnitId:u,direction:i.Direction.RIGHT,range:{startColumn:c,endColumn:m,startRow:h,endRow:R},cellValue:Et(a,h,R,c,m,!1,n.endColumn)};return s.get(i.ICommandService).executeCommand(Ve.id,S)}},Vo={id:"sheet.command.insert-sheet",type:i.CommandType.COMMAND,handler:(s,e)=>{var v;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(i.LocaleService),a=oo(o,{unitId:e==null?void 0:e.unitId});if(!a)return!1;const{unitId:l,workbook:u}=a;let d=u.getSheets().length;const c=e==null?void 0:e.sheet,m=c==null?void 0:c.id,h=i.mergeWorksheetSnapshotWithDefault(c||{});e?(d=(v=e.index)!=null?v:d,h.id=m||i.Tools.generateRandomId(),h.name=(c==null?void 0:c.name)||u.generateNewSheetName(`${r.t("sheets.tabs.sheet")}`)):(h.id=i.Tools.generateRandomId(),h.name=u.generateNewSheetName(`${r.t("sheets.tabs.sheet")}`));const R={index:d,sheet:h,unitId:l},S=An(s,R);return t.syncExecuteCommand(st.id,R)?(n.pushUndoRedo({unitID:l,undoMutations:[{id:ze.id,params:S}],redoMutations:[{id:st.id,params:R}]}),!0):!1}};function Lo(s,e){const{unitId:t,subUnitId:n,sourceRange:o,targetRange:r}=e,a=o.startRow>r.startRow,l=o.endRow-o.startRow+1;return a?{unitId:t,subUnitId:n,sourceRange:i.Rectangle.clone(r),targetRange:{...o,endRow:o.endRow+l,startRow:o.startRow+l}}:{unitId:t,subUnitId:n,targetRange:i.Rectangle.clone(o),sourceRange:{...r,endRow:r.endRow-l,startRow:r.startRow-l}}}const Ue={id:"sheet.mutation.move-rows",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,sourceRange:o,targetRange:r}=e,l=s.get(i.IUniverInstanceService).getUniverSheetInstance(t);if(!l)throw new Error("[MoveRowMutation] univerSheet is null!");const u=l.getSheetBySheetId(n);if(!u)throw new Error("[MoveRowMutation] worksheet is null!");const d=o.startRow,c=o.endRow-o.startRow+1,m=r.startRow,h=u.getRowManager().getRowData();return i.moveMatrixArray(d,c,m,h),u.getCellMatrix().moveRows(d,c,m),!0}};function $o(s,e){const{unitId:t,subUnitId:n,sourceRange:o,targetRange:r}=e,a=o.startColumn>r.startColumn,l=o.endColumn-o.startColumn+1;return a?{unitId:t,subUnitId:n,sourceRange:i.Rectangle.clone(r),targetRange:{...o,endColumn:o.endColumn+l,startColumn:o.startColumn+l}}:{unitId:t,subUnitId:n,targetRange:i.Rectangle.clone(o),sourceRange:{...r,startColumn:r.startColumn-l,endColumn:r.endColumn-l}}}const Pe={id:"sheet.mutation.move-columns",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,sourceRange:o,targetRange:r}=e,l=s.get(i.IUniverInstanceService).getUniverSheetInstance(t);if(!l)throw new Error("[MoveColumnMutation] univerSheet is null!");const u=l.getSheetBySheetId(n);if(!u)throw new Error("[MoveColumnMutation] worksheet is null!");const d=o.startColumn,c=o.endColumn-o.startColumn+1,m=r.startColumn,h=u.getColumnManager().getColumnData();return i.moveMatrixArray(d,c,m,h),u.getCellMatrix().moveColumns(d,c,m),!0}};function fa(s,e){return e.getMergeData().some(t=>t.startRow<s&&s<=t.endRow)}function va(s,e){return e.getMergeData().some(t=>t.startColumn<s&&s<=t.endColumn)}const Bo="sheet.command.move-rows",Nt={id:Bo,type:i.CommandType.COMMAND,handler:(s,e)=>{var W,L;const t=s.get(g.SheetsSelectionsService),{fromRange:{startRow:n},toRange:{startRow:o},range:r}=e,a=r?[jo(r)]:t.getCurrentSelections(),l=a==null?void 0:a.filter($=>$.range.rangeType===i.RANGE_TYPE.ROW&&$.range.startRow<=n&&n<=$.range.endRow);if((l==null?void 0:l.length)!==1)return!1;const u=s.get(g.SheetInterceptorService),d=s.get(i.IUniverInstanceService),c=U(d,e);if(!c)return!1;const{workbook:m,worksheet:h}=c,R=m.getUnitId(),S=h.getSheetId(),C=s.get(i.ErrorService),v=s.get(i.LocaleService),I=l[0].range,w=l[0].primary,p=Tt(I,h,!1);if(!i.Rectangle.equals(I,p))return C.emit(v.t("sheets.info.partOfCell")),!1;if(fa(o,h))return C.emit(v.t("sheets.info.acrossMergedCell")),!1;const M={...I,startRow:o,endRow:o+I.endRow-I.startRow},y={unitId:R,subUnitId:S,sourceRange:I,targetRange:M},b=Lo(s,y),k=s.get(i.ICommandService),E=u.onCommandExecute({id:Nt.id,params:e}),T=[...(W=E.preRedos)!=null?W:[],{id:Ue.id,params:y}],P=[...(L=E.preUndos)!=null?L:[],{id:Ue.id,params:b}];if(w){const j=o-n<0,ee=I.endRow-I.startRow+1,Y=j?M:{...M,startRow:M.startRow-ee,endRow:M.endRow-ee},Te={unitId:R,subUnitId:S,type:Q.MOVE_END,selections:[{range:Y,primary:te(Y,h),style:null}]},Mt={unitId:R,subUnitId:S,type:Q.MOVE_END,selections:[{range:I,primary:w,style:null}]};T.push({id:q.id,params:Te}),P.push({id:q.id,params:Mt})}return T.push(...E.redos),P.push(...E.undos),i.sequenceExecute(T,k).result?(s.get(i.IUndoRedoService).pushUndoRedo({unitID:R,undoMutations:P,redoMutations:T}),!0):!1}},Ho="sheet.command.move-cols",Ot={id:Ho,type:i.CommandType.COMMAND,handler:(s,e)=>{var W,L;const t=s.get(g.SheetsSelectionsService),{fromRange:{startColumn:n},toRange:{startColumn:o},range:r}=e,a=r?[jo(r)]:t.getCurrentSelections(),l=a==null?void 0:a.filter($=>$.range.rangeType===i.RANGE_TYPE.COLUMN&&$.range.startColumn<=n&&n<=$.range.endColumn);if((l==null?void 0:l.length)!==1)return!1;const u=s.get(g.SheetInterceptorService),d=s.get(i.IUniverInstanceService),c=U(d,e);if(!c)return!1;const{workbook:m,worksheet:h}=c,R=m.getUnitId(),S=h.getSheetId(),C=s.get(i.ErrorService),v=s.get(i.LocaleService),I=l[0].range,w=l[0].primary,p=Tt(I,h,!1);if(!i.Rectangle.equals(I,p))return C.emit(v.t("sheets.info.partOfCell")),!1;if(va(o,h))return C.emit(v.t("sheets.info.acrossMergedCell")),!1;const M={...I,startColumn:o,endColumn:o+I.endColumn-I.startColumn},y={unitId:R,subUnitId:S,sourceRange:I,targetRange:M},b=$o(s,y),k=s.get(i.ICommandService),E=u.onCommandExecute({id:Ot.id,params:e}),T=[...(W=E.preRedos)!=null?W:[],{id:Pe.id,params:y}],P=[...(L=E.preUndos)!=null?L:[],{id:Pe.id,params:b}];if(w){const $=I.endColumn-I.startColumn+1,Y=o-n<0?M:{...M,startColumn:M.startColumn-$,endColumn:M.endColumn-$},Te={unitId:R,subUnitId:S,type:Q.MOVE_END,selections:[{range:Y,primary:te(Y,h),style:null}]},Mt={unitId:R,subUnitId:S,type:Q.MOVE_END,selections:[{range:I,primary:w,style:null}]};T.push({id:q.id,params:Te}),P.push({id:q.id,params:Mt})}return T.push(...E.redos),P.push(...E.undos),i.sequenceExecute(T,k).result&&s.get(i.IUndoRedoService).pushUndoRedo({unitID:R,undoMutations:P,redoMutations:T}),!0}};function jo(s){return{range:s,primary:null,style:null}}const lt={id:"sheet.mutation.register-worksheet-range-theme-style",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,rangeThemeStyleJson:n,themeName:o}=e,r=s.get(i.IUniverInstanceService),a=U(r),l=s.get(Me);if(!a)return!1;const u=new De(o,n);return l.registerRangeThemeStyle(t,u),!0}},ln={id:"sheet.mutation.unregister-worksheet-range-theme-style",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,themeName:n}=e,o=s.get(i.IUniverInstanceService),r=U(o),a=s.get(Me);return r?(a.unregisterRangeThemeStyle(t,n),!0):!1}},Fo={id:"sheet.command.register-worksheet-range-theme-style",type:i.CommandType.COMMAND,handler:(s,e)=>{if(!e)return!1;const{unitId:t,rangeThemeStyle:n}=e,o=s.get(i.IUniverInstanceService),r=s.get(i.ICommandService),a=s.get(i.IUndoRedoService);if(!U(o))return!1;const u={unitId:t,themeName:n.getName(),rangeThemeStyleJson:n.toJson()},d={unitId:t,themeName:n.getName()};return r.syncExecuteCommand(lt.id,u)&&a.pushUndoRedo({unitID:t,undoMutations:[{id:ln.id,params:d}],redoMutations:[{id:lt.id,params:u}]}),!0}},hs={id:"sheet.command.remove-defined-name",type:i.CommandType.COMMAND,handler:(s,e)=>{var c,m;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(g.SheetInterceptorService);if(!e)return!1;const r={...e},a=o.onCommandExecute({id:hs.id,params:e}),l=[...(c=a.preRedos)!=null?c:[],{id:z.RemoveDefinedNameMutation.id,params:r},...a.redos],u=[...(m=a.preUndos)!=null?m:[],{id:z.SetDefinedNameMutation.id,params:r},...a.undos];return i.sequenceExecute(l,t)?(n.pushUndoRedo({unitID:e.unitId,undoMutations:u.filter(Boolean),redoMutations:l.filter(Boolean)}),!0):!1}},gs="sheet.command.remove-row",Rs={type:i.CommandType.COMMAND,id:"sheet.command.remove-row-by-range",handler:(s,e)=>{if(!e)return!1;const t=s.get(i.IUniverInstanceService),n=U(t,e);if(!n)return!1;const{workbook:o,worksheet:r}=n,a=s.get(g.SheetInterceptorService),{range:l,unitId:u,subUnitId:d}=e,c=bt([l],s,u,d).reverse(),m=[],h=[];c.forEach(C=>{var k,E,T,P;const v=[],I=[],w={unitId:u,subUnitId:d,range:C},p=Bi(w,r),M=r.getCellMatrix().getSlice(C.startRow,C.endRow,0,r.getColumnCount()-1),y={unitId:u,subUnitId:d,cellValue:M.getMatrix()},b=a.onCommandExecute({id:gs,params:{range:C}});I.push(...(k=b.preRedos)!=null?k:[]),I.push({id:Ce.id,params:w}),I.push(...(E=b.redos)!=null?E:[]),v.push(...(T=b.preUndos)!=null?T:[]),v.push({id:Se.id,params:p}),v.push({id:H.id,params:y}),v.push(...(P=b.undos)!=null?P:[]),h.push(...I),m.unshift(...v)}),h.push(ye(l,o,r));const R=s.get(i.ICommandService);return i.sequenceExecute(h,R).result?(s.get(i.IUndoRedoService).pushUndoRedo({unitID:u,undoMutations:m,redoMutations:h}),!0):!1}},Dt={type:i.CommandType.COMMAND,id:gs,handler:async(s,e)=>{var h;const t=s.get(g.SheetsSelectionsService),n=s.get(g.SheetInterceptorService),o=s.get(i.ICommandService);let r=e==null?void 0:e.range;if(r||(r=(h=t.getCurrentLastSelection())==null?void 0:h.range),!r)return!1;const a=s.get(i.IUniverInstanceService),l=U(a);if(!l)return!1;const{worksheet:u,subUnitId:d,unitId:c}=l;return r={...r,startColumn:0,endColumn:Math.max(u.getMaxColumns()-1,0)},await n.beforeCommandExecute({id:Dt.id,params:{range:r}})?o.syncExecuteCommand(Rs.id,{range:r,unitId:c,subUnitId:d}):!1}},Ss="sheet.command.remove-col",Cs={type:i.CommandType.COMMAND,id:"sheet.command.remove-col-by-range",handler:(s,e)=>{var I,w,p;if(!e)return!1;const t=s.get(i.IUniverInstanceService),n=U(t,e);if(!n)return!1;const{workbook:o,worksheet:r}=n,a=s.get(g.SheetInterceptorService),{range:l,unitId:u,subUnitId:d}=e,c={unitId:u,subUnitId:d,range:l},m=Hi(s,c),h=r.getCellMatrix().getSlice(0,r.getRowCount()-1,l.startColumn,l.endColumn),R={unitId:u,subUnitId:d,cellValue:h.getMatrix()},S=a.onCommandExecute({id:Ss,params:{range:l}}),C=s.get(i.ICommandService);return i.sequenceExecute([...(I=S.preRedos)!=null?I:[],{id:re.id,params:c},...S.redos,ye(l,o,r)],C).result?(s.get(i.IUndoRedoService).pushUndoRedo({unitID:u,undoMutations:[...(w=S.preUndos)!=null?w:[],{id:de.id,params:m},{id:H.id,params:R},...S.undos],redoMutations:[...(p=S.preRedos)!=null?p:[],{id:re.id,params:c},...S.redos]}),!0):!1}},At={type:i.CommandType.COMMAND,id:Ss,handler:async(s,e)=>{var h;const t=s.get(g.SheetsSelectionsService),n=s.get(g.SheetInterceptorService),o=s.get(i.ICommandService);let r=e==null?void 0:e.range;if(r||(r=(h=t.getCurrentLastSelection())==null?void 0:h.range),!r)return!1;const a=s.get(i.IUniverInstanceService),l=U(a);if(!l)return!1;const{worksheet:u,subUnitId:d,unitId:c}=l;return r={...r,startRow:0,endRow:Math.max(u.getMaxRows()-1,0)},await n.beforeCommandExecute({id:At.id,params:{range:r}})?o.syncExecuteCommand(Cs.id,{range:r,unitId:c,subUnitId:d}):!1}},un={id:"sheet.command.remove-sheet",type:i.CommandType.COMMAND,handler:(s,e)=>{var I,w;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetInterceptorService),a=U(o,e);if(!a)return!1;const{unitId:l,subUnitId:u,workbook:d,worksheet:c}=a;if(d.getSheets().length<=1)return!1;const m={subUnitId:u,unitId:l,subUnitName:c.getName()},h=Co(s,m),R=r.onCommandExecute({id:un.id,params:{unitId:l,subUnitId:u}}),S=[...(I=R.preRedos)!=null?I:[],{id:ze.id,params:m},...R.redos],C=[...(w=R.preUndos)!=null?w:[],{id:st.id,params:h},...R.undos];return i.sequenceExecute(S,t).result?(n.pushUndoRedo({unitID:l,undoMutations:C,redoMutations:S}),!0):!1}},he=(s,e)=>{if(s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:i.Tools.deepClone(e.ranges)}},F={id:"sheet.mutation.add-worksheet-merge",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(!o)return!1;const a=o.getConfig().mergeData,l=e.ranges;for(let u=0;u<l.length;u++)a.push(l[u]);return o.getSpanModel().rebuild(a),!0}},ne=(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(o==null)throw new Error("worksheet is null error!");const a=o.getConfig().mergeData,l=e.ranges,u=[];for(let d=0;d<l.length;d++)for(let c=a.length-1;c>=0;c--){const m=a[c],h=l[d];i.Rectangle.intersects(m,h)&&u.push(a[c])}return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:u}},G={id:"sheet.mutation.remove-worksheet-merge",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(!o)return!1;const a=o.getConfig().mergeData,l=e.ranges;for(let u=0;u<l.length;u++)for(let d=a.length-1;d>=0;d--){const c=a[d],m=l[u];i.Rectangle.intersects(c,m)&&a.splice(d,1)}return o.getSpanModel().rebuild(a),!0}},Go={type:i.CommandType.COMMAND,id:"sheet.command.remove-worksheet-merge",handler:(s,e)=>{var N;const t=s.get(g.SheetsSelectionsService),n=s.get(i.ICommandService),o=s.get(i.IUndoRedoService),r=s.get(i.IUniverInstanceService),a=(e==null?void 0:e.ranges)||((N=t.getCurrentSelections())==null?void 0:N.map(W=>W.range));if(!(a!=null&&a.length))return!1;const l=U(r);if(!l)return!1;const{subUnitId:u,unitId:d,worksheet:c}=l,m={unitId:d,subUnitId:u,ranges:a},R=c.getConfig().mergeData.filter(W=>a.some(L=>i.Rectangle.intersects(L,W)));if(!R.length)return!1;const S=ne(s,m),C=t.getCurrentSelections();if(!(C!=null&&C.length))return!1;const v=i.Tools.deepClone(C),I=i.Tools.deepClone(C),w=I[I.length-1],{startRow:p,startColumn:M}=w.range;w.primary={startRow:p,startColumn:M,endRow:p,endColumn:M,actualRow:p,actualColumn:M,isMerged:!1,isMergedMainCell:!1};const y=Ia(c,R),b={unitId:d,subUnitId:u,cellValue:y.redoParams.getMatrix()},k={unitId:d,subUnitId:u,cellValue:y.undoParams.getMatrix()},E=[{id:G.id,params:S},{id:H.id,params:b},{id:q.id,params:{selections:I}}],T=[{id:F.id,params:S},{id:H.id,params:k},{id:q.id,params:{selections:v}}];return i.sequenceExecute(E,n)?(o.pushUndoRedo({unitID:d,undoMutations:T,redoMutations:E}),!0):!1}};function Ia(s,e){const t=new i.ObjectMatrix,n=new i.ObjectMatrix;return e.forEach(o=>{const{startRow:r,startColumn:a,endColumn:l,endRow:u}=o,d=s.getCellMatrix().getValue(r,a);if(d!=null&&d.s)for(let c=r;c<=u;c++)for(let m=a;m<=l;m++)(c!==r||m!==a)&&(t.setValue(c,m,{s:d.s}),n.setValue(c,m,null))}),{redoParams:t,undoParams:n}}const zo=s=>{const{order:e}=s,t={};return Object.keys(e).forEach(n=>{t[e[Number(n)]]=Number(n)}),{...s,order:t}},Wt={id:"sheet.mutation.reorder-range",type:i.CommandType.MUTATION,handler:(s,e)=>{const{subUnitId:t,unitId:n,range:o,order:r}=e,u=s.get(i.IUniverInstanceService).getUnit(n).getSheetBySheetId(t);if(!u)return!1;const d=new i.ObjectMatrix;i.Range.foreach(o,(m,h)=>{if(r.hasOwnProperty(m)){const R=r[m],S=i.Tools.deepClone(u.getCellRaw(R,h));d.setValue(m,h,S)}});const c=u.getCellMatrix();return d.forValue((m,h,R)=>{c.setValue(m,h,R)}),!0}},qo="sheet.command.reorder-range",dn={id:qo,type:i.CommandType.COMMAND,handler:(s,e)=>{var C,v;const{subUnitId:t,unitId:n,range:o,order:r}=e,a=s.get(i.ICommandService),l={id:Wt.id,params:{unitId:n,subUnitId:t,order:r,range:o}},u={id:Wt.id,params:zo(l.params)},d=s.get(g.SheetInterceptorService),c=d.onCommandExecute({id:dn.id,params:e}),m=[...(C=c.preRedos)!=null?C:[],l,...c.redos],h=[...(v=c.preUndos)!=null?v:[],u,...c.undos],R=i.sequenceExecute(m,a),S=d.afterCommandExecute({id:dn.id,params:e});return R.result?(i.sequenceExecute(S.redos,a),s.get(i.IUndoRedoService).pushUndoRedo({unitID:n,undoMutations:[...h,...S.undos],redoMutations:[...m,...S.redos]}),!0):!1}};class Je{constructor(){f(this,"_borderInfo",{type:i.BorderType.ALL,color:"#000000",style:i.BorderStyleTypes.THIN,activeBorderType:!1});f(this,"_borderInfo$",new A.BehaviorSubject(this._borderInfo));f(this,"borderInfo$",this._borderInfo$.asObservable())}dispose(){this._borderInfo$.complete()}setType(e){this._borderInfo.type=e,this.setActiveBorderType(!0),this._refresh()}setColor(e){this._borderInfo.color=e,this._refresh()}setStyle(e){this._borderInfo.style=e,this._refresh()}setActiveBorderType(e){this._borderInfo.activeBorderType=e}getBorderInfo(){return this._borderInfo}_refresh(){this._borderInfo$.next(this._borderInfo)}}function cn(s,e){const{startRow:t,startColumn:n,endRow:o,endColumn:r}=s;for(let a=t;a<=o;a++)for(let l=n;l<=r;l++)e(a,l)}const fs=(s,e,t,n)=>{const{mr:o,worksheet:r}=s;e.startRow<0||e.startColumn<0||cn(e,(a,l)=>{var c,m;const u=r.getMergedCell(a,l);let d=t;if(u&&(t.bc_tr||t.ml_tr||t.bl_tr||t.tl_mr||t.tl_bc||t.tl_br)){if(n){const h=i.Tools.deepClone((c=o.getValue(u.startRow,u.startColumn))==null?void 0:c.s);d=h!=null&&h.bd?Object.assign(h.bd,t):t}o.setValue(u.startRow,u.startColumn,{s:{bd:d}})}else{if(n){const h=i.Tools.deepClone((m=o.getValue(a,l))==null?void 0:m.s);d=h!=null&&h.bd?Object.assign(h.bd,t):t}o.setValue(a,l,{s:{bd:d}})}})},pa=s=>{const e={startRow:s.startRow-1,startColumn:s.startColumn,endRow:s.startRow-1,endColumn:s.endColumn},t={startRow:s.startRow,startColumn:s.startColumn-1,endRow:s.endRow,endColumn:s.startColumn-1},n={startRow:s.endRow+1,startColumn:s.startColumn,endRow:s.endRow+1,endColumn:s.endColumn},o={startRow:s.startRow,startColumn:s.endColumn+1,endRow:s.endRow,endColumn:s.endColumn+1},r={startRow:s.startRow,startColumn:s.startColumn,endRow:s.startRow,endColumn:s.endColumn},a={startRow:s.startRow,startColumn:s.startColumn,endRow:s.endRow,endColumn:s.startColumn},l={startRow:s.endRow,startColumn:s.startColumn,endRow:s.endRow,endColumn:s.endColumn},u={startRow:s.startRow,startColumn:s.endColumn,endRow:s.endRow,endColumn:s.endColumn};return{topRangeOut:e,leftRangeOut:t,bottomRangeOut:n,rightRangeOut:o,topRange:r,leftRange:a,bottomRange:l,rightRange:u}};function wa(s,e,t){const{style:n,color:o,type:r}=s.getBorderInfo(),a=r===i.BorderType.TOP||r===i.BorderType.ALL||r===i.BorderType.OUTSIDE,l=r===i.BorderType.LEFT||r===i.BorderType.ALL||r===i.BorderType.OUTSIDE,u=r===i.BorderType.BOTTOM||r===i.BorderType.ALL||r===i.BorderType.OUTSIDE,d=r===i.BorderType.RIGHT||r===i.BorderType.ALL||r===i.BorderType.OUTSIDE,c=r===i.BorderType.VERTICAL||r===i.BorderType.ALL||r===i.BorderType.INSIDE,m=r===i.BorderType.HORIZONTAL||r===i.BorderType.ALL||r===i.BorderType.INSIDE,h=r.indexOf("tlbr")>-1,R=r.indexOf("tlbc")>-1,S=r.indexOf("tlmr")>-1,C=r.indexOf("bltr")>-1,v=r.indexOf("mltr")>-1,I=r.indexOf("bctr")>-1,w=t[0],{topRangeOut:p,leftRangeOut:M,bottomRangeOut:y,rightRangeOut:b,topRange:k,leftRange:E,bottomRange:T,rightRange:P}=pa(w),N=new i.ObjectMatrix,{worksheet:W,unitId:L,subUnitId:$}=e;return{worksheet:W,unitId:L,subUnitId:$,style:n,color:o,type:r,top:a,left:l,right:d,bottom:u,vertical:c,horizontal:m,tl_br:h,tl_bc:R,tl_mr:S,bl_tr:C,ml_tr:v,bc_tr:I,topRangeOut:p,leftRangeOut:M,bottomRangeOut:y,rightRangeOut:b,topRange:k,leftRange:E,bottomRange:T,rightRange:P,range:w,mr:N,borderStyle:{s:n,cl:{rgb:o}}}}const Ma=s=>{const{range:e,mr:t,borderStyle:n,vertical:o,horizontal:r,worksheet:a}=s;o&&cn(e,(l,u)=>{var c,m,h;const d=a.getMergedCell(l,u);if(d){const R=(c=t.getValue(d.startRow,d.startColumn))==null?void 0:c.s;d.startColumn!==e.startColumn&&t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{l:i.Tools.deepClone(n)}):{l:i.Tools.deepClone(n)}}})}else{if(u!==e.endColumn){const R=(m=t.getValue(l,u))==null?void 0:m.s;t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{r:i.Tools.deepClone(n)}):{r:i.Tools.deepClone(n)}}})}if(u!==e.startColumn){const R=(h=t.getValue(l,u))==null?void 0:h.s;t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{l:i.Tools.deepClone(n)}):{l:i.Tools.deepClone(n)}}})}}}),r&&cn(e,(l,u)=>{var c,m,h;const d=a.getMergedCell(l,u);if(d){const R=(c=t.getValue(d.startRow,d.startColumn))==null?void 0:c.s;d.startRow!==e.startRow&&t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{t:i.Tools.deepClone(n)}):{t:i.Tools.deepClone(n)}}})}else{if(l!==e.endRow){const R=(m=t.getValue(l,u))==null?void 0:m.s;t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{b:i.Tools.deepClone(n)}):{b:i.Tools.deepClone(n)}}})}if(l!==e.startRow){const R=(h=t.getValue(l,u))==null?void 0:h.s;t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{t:i.Tools.deepClone(n)}):{t:i.Tools.deepClone(n)}}})}}})};function ya(s){const{borderStyle:e,tl_br:t,tl_bc:n,tl_mr:o,bl_tr:r,ml_tr:a,bc_tr:l}=s,u=(d,c,m)=>{fs(s,d,c,m)};t&&u(s.range,{tl_br:i.Tools.deepClone(e)},!0),n&&u(s.range,{tl_bc:i.Tools.deepClone(e)},!0),o&&u(s.range,{tl_mr:i.Tools.deepClone(e)},!0),r&&u(s.range,{bl_tr:i.Tools.deepClone(e)},!0),a&&u(s.range,{ml_tr:i.Tools.deepClone(e)},!0),l&&u(s.range,{bc_tr:i.Tools.deepClone(e)},!0)}const _a=s=>{const{top:e,left:t,right:n,bottom:o,borderStyle:r,bottomRange:a,topRange:l,leftRange:u,rightRange:d,bottomRangeOut:c,topRangeOut:m,leftRangeOut:h,rightRangeOut:R}=s,S=(C,v,I)=>{fs(s,C,v,I)};e&&(S(m,{b:null}),S(l,{t:i.Tools.deepClone(r)},!0)),o&&(S(c,{t:null}),S(a,{b:i.Tools.deepClone(r)},!0)),t&&(S(h,{r:null}),S(u,{l:i.Tools.deepClone(r)},!0)),n&&(S(R,{l:null}),S(d,{r:i.Tools.deepClone(r)},!0))},ba=s=>{const{range:e,worksheet:t,mr:n,top:o,bottom:r,left:a,right:l,vertical:u,horizontal:d,tl_br:c,tl_bc:m,tl_mr:h,bl_tr:R,ml_tr:S,bc_tr:C,topRange:v,bottomRange:I,leftRange:w,rightRange:p,topRangeOut:M,bottomRangeOut:y,leftRangeOut:b,rightRangeOut:k}=s,E=(T,P,N)=>{fs(s,T,P,N)};!o&&!r&&!a&&!l&&!u&&!d&&!c&&!m&&!h&&!R&&!S&&!C&&(cn(e,(T,P)=>{var W,L,$,j,ee,Y,Te,Mt;const N=t.getMergedCell(T,P);if(N){if(N.endColumn!==e.endColumn){const B=(W=n.getValue(N.startRow,N.startColumn))==null?void 0:W.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{r:null}):{r:null}}})}if(N.startColumn!==e.startColumn){const B=(L=n.getValue(N.startRow,N.startColumn))==null?void 0:L.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{l:null}):{l:null}}})}if(N.endRow!==e.endRow){const B=($=n.getValue(N.startRow,N.startColumn))==null?void 0:$.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{b:null}):{b:null}}})}if(N.startRow!==e.startRow){const B=(j=n.getValue(N.startRow,N.startColumn))==null?void 0:j.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{t:null}):{t:null}}})}}else{if(P!==e.endColumn){const B=(ee=n.getValue(T,P))==null?void 0:ee.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{r:null}):{r:null}}})}if(P!==e.startColumn){const B=(Y=n.getValue(T,P))==null?void 0:Y.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{l:null}):{l:null}}})}if(T!==e.endRow){const B=(Te=n.getValue(T,P))==null?void 0:Te.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{b:null}):{b:null}}})}if(T!==e.startRow){const B=(Mt=n.getValue(T,P))==null?void 0:Mt.s;n.setValue(T,P,{s:{bd:B!=null&&B.bd?Object.assign(B.bd,{t:null}):{t:null}}})}}}),E(M,{b:null}),E(v,{t:null},!0),E(y,{t:null}),E(I,{b:null},!0),E(b,{r:null}),E(w,{l:null},!0),E(k,{l:null}),E(p,{r:null},!0),E(e,{tl_br:null},!0),E(e,{tl_bc:null},!0),E(e,{tl_mr:null},!0),E(e,{bl_tr:null},!0),E(e,{ml_tr:null},!0),E(e,{bc_tr:null},!0))},ut={id:"sheet.command.set-border",type:i.CommandType.COMMAND,handler:(s,e)=>{var I;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=s.get(g.SheetsSelectionsService),a=s.get(Je),l=U(o,e);if(!l)return!1;const u=(e==null?void 0:e.ranges)||((I=r.getCurrentSelections())==null?void 0:I.map(w=>w.range));if(!(u!=null&&u.length))return!1;const{activeBorderType:d}=a.getBorderInfo();if(!d)return!1;const c=wa(a,l,u);Ma(c),_a(c),ya(c),ba(c);const{unitId:m,subUnitId:h,mr:R}=c,S={unitId:m,subUnitId:h,cellValue:R.getData()},C=ie(s,S);return t.syncExecuteCommand(H.id,S)?(n.pushUndoRedo({unitID:m,undoMutations:[{id:H.id,params:C}],redoMutations:[{id:H.id,params:S}]}),!0):!1}},Yo={id:"sheet.command.set-border-position",type:i.CommandType.COMMAND,handler:(s,e)=>{if(!e.value)return!1;const t=s.get(i.ICommandService);return s.get(Je).setType(e.value),t.syncExecuteCommand(ut.id)}},Ko={id:"sheet.command.set-border-style",type:i.CommandType.COMMAND,handler:(s,e)=>{const t=s.get(i.ICommandService);return s.get(Je).setStyle(e.value),t.syncExecuteCommand(ut.id)}},Jo={id:"sheet.command.set-border-color",type:i.CommandType.COMMAND,handler:(s,e)=>{const t=s.get(i.ICommandService);return s.get(Je).setColor(e.value),t.syncExecuteCommand(ut.id)}},xo={id:"sheet.command.set-border-basic",type:i.CommandType.COMMAND,handler:(s,e)=>{const{unitId:t,subUnitId:n,value:o,ranges:r}=e,{type:a,color:l,style:u}=o,d=s.get(i.ICommandService),c=s.get(Je);return c.setType(a),l&&c.setColor(l),c.setStyle(u),d.syncExecuteCommand(ut.id,{unitId:t,subUnitId:n,ranges:r})}};function Ta(s,e){if(s==null)return s;const t=i.Tools.deepClone(s);if(e==null)return t;const n={};return"h"in e&&(n.h=t.h),"ia"in e&&(n.ia=t.ia),"ah"in e&&(n.ah=t.ah),"hd"in e&&(n.hd=t.hd),"s"in e&&(n.s=t.s),"custom"in e&&(n.custom=t.custom),n}function Ea(s,e){if(s==null)return s;const t=i.Tools.deepClone(s);if(e==null)return t;const n={};return"w"in e&&(n.w=t.w),"hd"in e&&(n.hd=t.hd),"s"in e&&(n.s=t.s),"custom"in e&&(n.custom=t.custom),n}const Xo=(s,e)=>{const{unitId:t,subUnitId:n,columnData:o}=s,r={},a=e.getColumnManager();for(const l in o){const u=o[l],d=a.getColumn(Number(l));r[l]=Ea(d,u)}return{unitId:t,subUnitId:n,columnData:r}},dt={id:"sheet.mutation.set-col-data",type:i.CommandType.MUTATION,handler:(s,e)=>{const{columnData:t}=e,n=s.get(i.IUniverInstanceService),o=U(n,e);if(!o)return!1;const{worksheet:r}=o,a=r.getColumnManager();for(const l in t){const u=t[l];if(u==null){a.removeColumn(Number(l));continue}const d=a.getColumnOrCreate(Number(l));Object.assign(d,u)}return!0}},Zo={type:i.CommandType.COMMAND,id:"sheet.command.set-col-data",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=U(o,e);if(!r)return!1;const{columnData:a}=e,{unitId:l,subUnitId:u,worksheet:d}=r,c={subUnitId:u,unitId:l,columnData:a},m=Xo(c,d);return t.syncExecuteCommand(dt.id,c)?(n.pushUndoRedo({unitID:l,undoMutations:[{id:dt.id,params:m}],redoMutations:[{id:dt.id,params:c}]}),!0):!1}},Ua=(s,e)=>{if(s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},ct={id:"sheet.mutation.set-col-hidden",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!n)return!1;const o=n.getSheetBySheetId(e.subUnitId).getColumnManager();for(let r=0;r<e.ranges.length;r++){const a=e.ranges[r];for(let l=a.startColumn;l<a.endColumn+1;l++){const u=o.getColumnOrCreate(l);u!=null&&(u.hd=i.BooleanNumber.TRUE)}}return!0}},Pa=(s,e)=>{if(s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},mt={id:"sheet.mutation.set-col-visible",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!n)return!1;const o=n.getSheetBySheetId(e.subUnitId).getColumnManager();for(let r=0;r<e.ranges.length;r++){const a=e.ranges[r];for(let l=a.startColumn;l<a.endColumn+1;l++){const u=o.getColumnOrCreate(l);u!=null&&(u.hd=i.BooleanNumber.FALSE)}}return!0}},Vt={type:i.CommandType.COMMAND,id:"sheet.command.set-col-visible-on-cols",handler:(s,e)=>{var I,w;const{unitId:t,subUnitId:n,ranges:o}=e,r=s.get(g.SheetInterceptorService),a=s.get(i.ICommandService),l=s.get(i.IUniverInstanceService),u=U(l,{unitId:t,subUnitId:n});if(!u)return!1;const{worksheet:d}=u,c={unitId:t,subUnitId:n,ranges:o},m={unitId:t,subUnitId:n,reveal:!0,selections:o.map(p=>({range:p,primary:te(p,d),style:null}))},h=Pa(s,c),R={unitId:t,subUnitId:n,selections:Qo(o).map(p=>({range:p,primary:te(p,d),style:null}))},S=i.sequenceExecute([{id:mt.id,params:c},{id:q.id,params:m}],a),C=r.onCommandExecute({id:Vt.id,params:e}),v=i.sequenceExecute([...C.redos],a);return S.result&&v.result&&s.get(i.IUndoRedoService).pushUndoRedo({unitID:t,undoMutations:[{id:ct.id,params:h},{id:q.id,params:R},...(I=C.undos)!=null?I:[]],redoMutations:[...(w=C.preRedos)!=null?w:[],{id:mt.id,params:c},{id:q.id,params:m},...C.redos]}),!0}},vs={type:i.CommandType.COMMAND,id:"sheet.command.set-selected-cols-visible",handler:s=>{var d;const e=s.get(g.SheetsSelectionsService),t=s.get(i.ICommandService),n=(d=e.getCurrentSelections())==null?void 0:d.map(c=>c.range).filter(c=>c.rangeType===i.RANGE_TYPE.COLUMN);if(!(n!=null&&n.length))return!1;const o=U(s.get(i.IUniverInstanceService));if(!o)return!1;const{worksheet:r,unitId:a,subUnitId:l}=o,u=n.map(c=>r.getHiddenCols(c.startColumn,c.endColumn)).flat();return t.executeCommand(Vt.id,{unitId:a,subUnitId:l,ranges:u})}},Is={type:i.CommandType.COMMAND,id:"sheet.command.set-col-hidden",handler:(s,e)=>{var w,p,M,y;const t=s.get(g.SheetsSelectionsService),n=s.get(g.SheetInterceptorService),o=s.get(i.IUniverInstanceService),r=s.get(i.ICommandService);let a=(w=e==null?void 0:e.ranges)!=null&&w.length?e.ranges:(p=t.getCurrentSelections())==null?void 0:p.map(b=>b.range).filter(b=>b.rangeType===i.RANGE_TYPE.COLUMN);if(!(a!=null&&a.length))return!1;const l=U(o,e);if(!l)return!1;const{worksheet:u,unitId:d,subUnitId:c}=l;a=ka(l.worksheet,a);const m={unitId:d,subUnitId:c,ranges:a},h={unitId:d,subUnitId:c,selections:Qo(a).map(b=>({range:b,primary:te(b,u),style:null}))},R=Ua(s,m),S={unitId:d,subUnitId:c,reveal:!0,selections:a.map(b=>({range:b,primary:te(b,u),style:null}))},C=i.sequenceExecute([{id:ct.id,params:m},{id:q.id,params:h}],r),v=n.onCommandExecute({id:Is.id,params:m}),I=i.sequenceExecute([...v.redos],r);return C.result&&I.result?(s.get(i.IUndoRedoService).pushUndoRedo({unitID:d,undoMutations:[{id:mt.id,params:R},{id:q.id,params:S},...(M=v.undos)!=null?M:[]],redoMutations:[...(y=v.preRedos)!=null?y:[],{id:ct.id,params:m},{id:q.id,params:h},...v.redos]}),!0):!1}};function ka(s,e){const t=s.getRowCount()-1,n=s.getHiddenCols(),o=[];return e.forEach(r=>{const a=n.filter(l=>l.startColumn>=r.startColumn&&l.endColumn<=r.endColumn);if(a.length){let l=r.startColumn;a.forEach(u=>{u.startColumn>l&&(o.push({startColumn:l,endColumn:u.startColumn-1,startRow:0,endRow:t}),l=u.endColumn+1)}),l<=r.endColumn&&o.push({startColumn:l,endColumn:r.endColumn,startRow:0,endRow:t})}else o.push(r)}),o}function Qo(s){return Na(s).map(t=>{const n=t.startColumn===0?t.endColumn+1:t.startColumn-1;return{...t,startColumn:n,endColumn:n}})}function Na(s){const e=[];let t;return s.sort((n,o)=>n.startColumn-o.startColumn).forEach(n=>{if(!t){t=n;return}t.endColumn===n.startColumn-1?t.endColumn=n.endColumn:(e.push(t),t=n)}),e.push(t),e}const ps={id:"sheet.command.set-defined-name",type:i.CommandType.COMMAND,handler:(s,e)=>{var m,h;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(g.SheetInterceptorService);if(!e)return!1;const r={...e},a=z.SetDefinedNameMutationFactory(s,e),l=o.onCommandExecute({id:ps.id,params:e}),u=[...(m=l.preRedos)!=null?m:[],{id:z.RemoveDefinedNameMutation.id,params:a},{id:z.SetDefinedNameMutation.id,params:r},...l.redos],d=[...(h=l.preUndos)!=null?h:[],{id:z.RemoveDefinedNameMutation.id,params:r},{id:z.SetDefinedNameMutation.id,params:a},...l.undos];return i.sequenceExecute(u,t)?(n.pushUndoRedo({unitID:e.unitId,undoMutations:d.filter(Boolean),redoMutations:u.filter(Boolean)}),!0):!1}},ws=(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(o==null)throw new Error("worksheet is null error!");const a=o.getConfig().freeze;return{unitId:e.unitId,subUnitId:e.subUnitId,...a}},Le={id:"sheet.mutation.set-frozen",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId);if(!o)return!1;const r=o.getConfig(),{startRow:a,startColumn:l,ySplit:u,xSplit:d}=e;return r.freeze={startRow:a,startColumn:l,ySplit:u,xSplit:d},!0}},er={type:i.CommandType.COMMAND,id:"sheet.command.set-frozen",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=U(o,{unitId:e.unitId,subUnitId:e.subUnitId});if(!r)return!1;const{unitId:a,subUnitId:l,worksheet:u}=r,{startColumn:d,startRow:c,xSplit:m,ySplit:h}=e;if(c>=u.getRowCount()||d>=u.getColumnCount()||m>=u.getColumnCount()||h>=u.getRowCount())return!1;const R={unitId:a,subUnitId:l,...e},S=ws(s,R);return t.syncExecuteCommand(Le.id,R)?(n.pushUndoRedo({unitID:a,undoMutations:[{id:Le.id,params:S}],redoMutations:[{id:Le.id,params:R}]}),!0):!1}},tr={type:i.CommandType.COMMAND,id:"sheet.command.cancel-frozen",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUniverInstanceService),o=s.get(i.IUndoRedoService),r=U(n,{unitId:e==null?void 0:e.unitId,subUnitId:e==null?void 0:e.subUnitId});if(!r)return!1;const{unitId:a,subUnitId:l}=r,u={unitId:a,subUnitId:l,startRow:-1,startColumn:-1,xSplit:0,ySplit:0},d=ws(s,u);return t.syncExecuteCommand(Le.id,u)&&o.pushUndoRedo({unitID:a,undoMutations:[{id:Le.id,params:d}],redoMutations:[{id:Le.id,params:u}]}),!0}},ht={id:"sheet.mutation.set-gridlines-color",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=U(s.get(i.IUniverInstanceService),e);if(!t)return!1;const{worksheet:n}=t,o=n.getConfig();return o.gridlinesColor=e.color,!0}},nr={type:i.CommandType.COMMAND,id:"sheet.command.set-gridlines-color",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=U(o);if(!r)return!1;const{worksheet:a}=r,l=a.getConfig().gridlinesColor;if(l===(e==null?void 0:e.color))return!1;const{unitId:u,subUnitId:d}=r,c={color:e==null?void 0:e.color,unitId:u,subUnitId:d},m={color:l,unitId:u,subUnitId:d};return t.syncExecuteCommand(ht.id,c)?(n.pushUndoRedo({unitID:u,undoMutations:[{id:ht.id,params:m}],redoMutations:[{id:ht.id,params:c}]}),!0):!1}},X={id:"sheet.mutation.set-range-protection",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,rule:o,ruleId:r}=e;return s.get(K).setRule(t,n,r,o),!0}},Oa=(s,e)=>{const{unitId:t,subUnitId:n,ruleId:o}=e,a=s.get(K).getRule(t,n,o);return a?{id:X.id,params:{...e,rule:a}}:null},xe={id:"sheet.mutation.set-worksheet-protection",type:i.CommandType.MUTATION,handler:(s,e)=>{const{unitId:t,subUnitId:n,rule:o}=e;return s.get(we).setRule(t,n,o),!0}},sr={type:i.CommandType.COMMAND,id:"sheet.command.set-protection",async handler(s,e){if(!e)return!1;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(K),{rule:r,oldRule:a}=e,{unitId:l,subUnitId:u}=r,d=[],c=[];return(a==null?void 0:a.unitType)===r.unitType?r.unitType===O.Worksheet?(d.push({id:xe.id,params:{unitId:l,subUnitId:u,rule:r}}),c.push({id:xe.id,params:{unitId:l,subUnitId:u,rule:a}})):(d.push({id:X.id,params:{unitId:l,subUnitId:u,rule:r,ruleId:r.id}}),c.push({id:X.id,params:{unitId:l,subUnitId:u,ruleId:a.id,rule:a}})):(a&&(a.unitType===O.Worksheet?(d.push({id:Fe.id,params:{unitId:l,subUnitId:u}}),c.push({id:Oe.id,params:{unitId:l,rule:a,subUnitId:a.subUnitId}})):a.unitType===O.SelectRange&&(d.push({id:pe.id,params:{unitId:l,subUnitId:u,ruleIds:[a.id]}}),c.push({id:ue.id,params:{unitId:l,subUnitId:u,rules:[a]}}))),r.unitType===O.Worksheet?(d.push({id:Oe.id,params:{unitId:l,rule:r,subUnitId:r.subUnitId}}),c.unshift({id:Fe.id,params:{unitId:l,subUnitId:u}})):r.unitType===O.SelectRange&&(r.id=o.createRuleId(l,u),d.push({id:ue.id,params:{unitId:l,subUnitId:u,rules:[r]}}),c.unshift({id:pe.id,params:{unitId:l,subUnitId:u,ruleIds:[r.id]}}))),i.sequenceExecute(d,t)&&n.pushUndoRedo({unitID:l,undoMutations:c,redoMutations:d}),!0}},or=(s,e)=>{const{unitId:t,subUnitId:n,rowData:o}=s,r={},a=e.getRowManager();for(const l in o){const u=o[l],d=a.getRow(Number(l));r[l]=Ta(d,u)}return{unitId:t,subUnitId:n,rowData:r}},gt={id:"sheet.mutation.set-row-data",type:i.CommandType.MUTATION,handler:(s,e)=>{const{rowData:t}=e,n=s.get(i.IUniverInstanceService),o=U(n,e);if(!o)return!1;const{worksheet:r}=o,a=r.getRowManager();for(const l in t){const u=t[l];if(u==null){a.removeRow(Number(l));continue}const d=a.getRowOrCreate(Number(l));Object.assign(d,u)}return!0}},rr={type:i.CommandType.COMMAND,id:"sheet.command.set-row-data",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=U(o,e);if(!r)return!1;const{rowData:a}=e,{unitId:l,subUnitId:u,worksheet:d}=r,c={subUnitId:u,unitId:l,rowData:a},m=or(c,d);return t.syncExecuteCommand(gt.id,c)?(n.pushUndoRedo({unitID:l,undoMutations:[{id:gt.id,params:m}],redoMutations:[{id:gt.id,params:c}]}),!0):!1}},Da=(s,e)=>{if(s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},Rt={id:"sheet.mutation.set-row-visible",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId).getRowManager();for(let r=0;r<e.ranges.length;r++){const a=e.ranges[r];for(let l=a.startRow;l<a.endRow+1;l++){const u=o.getRowOrCreate(l);u!=null&&(u.hd=0)}}return!0}},Aa=(s,e)=>{if(s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},St={id:"sheet.mutation.set-row-hidden",type:i.CommandType.MUTATION,handler:(s,e)=>{const n=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const o=n.getSheetBySheetId(e.subUnitId).getRowManager();for(let r=0;r<e.ranges.length;r++){const a=e.ranges[r];for(let l=a.startRow;l<a.endRow+1;l++){const u=o.getRowOrCreate(l);u!=null&&(u.hd=1)}}return!0}},Lt={type:i.CommandType.COMMAND,id:"sheet.command.set-specific-rows-visible",handler:(s,e)=>{var I,w,p;const{unitId:t,subUnitId:n,ranges:o}=e,r=s.get(i.ICommandService),a=s.get(i.IUndoRedoService),l=s.get(g.SheetInterceptorService),u=U(s.get(i.IUniverInstanceService),{unitId:t,subUnitId:n});if(!u)return!1;const{worksheet:d}=u,c={unitId:t,subUnitId:n,ranges:o},m={unitId:t,subUnitId:n,reveal:!0,selections:o.map(M=>({range:M,primary:te(M,d),style:null}))},h=Da(s,c),R={unitId:t,subUnitId:n,selections:ir(o).map(M=>({range:M,primary:te(M,d),style:null}))},S=i.sequenceExecute([{id:Rt.id,params:c},{id:q.id,params:m}],r),C=l.onCommandExecute({id:Lt.id,params:e}),v=i.sequenceExecute([...C.redos],r);return S.result&&v.result&&a.pushUndoRedo({unitID:t,undoMutations:[...(I=C.preUndos)!=null?I:[],{id:St.id,params:h},{id:q.id,params:R},...(w=C.undos)!=null?w:[]],redoMutations:[...(p=C.preRedos)!=null?p:[],{id:Rt.id,params:c},{id:q.id,params:m},...C.redos]}),!0}},Ms={type:i.CommandType.COMMAND,id:"sheet.command.set-selected-rows-visible",handler:async s=>{var c;const e=s.get(g.SheetsSelectionsService),t=s.get(i.IUniverInstanceService),n=s.get(i.ICommandService),o=(c=e.getCurrentSelections())==null?void 0:c.map(m=>m.range).filter(m=>m.rangeType===i.RANGE_TYPE.ROW);if(!(o!=null&&o.length))return!1;const r=U(t);if(!r)return!1;const{worksheet:a,unitId:l,subUnitId:u}=r,d=o.map(m=>a.getHiddenRows(m.startRow,m.endRow)).flat();return n.executeCommand(Lt.id,{unitId:l,subUnitId:u,ranges:d})}},ys={type:i.CommandType.COMMAND,id:"sheet.command.set-rows-hidden",handler:(s,e)=>{var w,p,M,y,b,k;const t=s.get(g.SheetsSelectionsService),n=s.get(i.ICommandService),o=s.get(i.IUndoRedoService),r=s.get(i.IUniverInstanceService),a=s.get(g.SheetInterceptorService);let l=(w=e==null?void 0:e.ranges)!=null&&w.length?e.ranges:(p=t.getCurrentSelections())==null?void 0:p.map(E=>E.range).filter(E=>E.rangeType===i.RANGE_TYPE.ROW);if(!(l!=null&&l.length))return!1;const u=U(r,e);if(!u)return!1;l=Wa(u.worksheet,l);const{unitId:d,subUnitId:c,worksheet:m}=u,h={unitId:d,subUnitId:c,ranges:l},R={unitId:d,subUnitId:c,selections:ir(l).map(E=>({range:E,primary:te(E,m),style:null}))},S=Aa(s,h),C={unitId:d,subUnitId:c,reveal:!0,selections:l.map(E=>({range:E,primary:te(E,m),style:null}))},v=a.onCommandExecute({id:ys.id,params:h});return i.sequenceExecute([...(M=v.preRedos)!=null?M:[],{id:St.id,params:h},{id:q.id,params:R},...v.redos],n).result&&o.pushUndoRedo({unitID:d,undoMutations:[...(y=v.preUndos)!=null?y:[],{id:Rt.id,params:S},{id:q.id,params:C},...(b=v.undos)!=null?b:[]],redoMutations:[...(k=v.preRedos)!=null?k:[],{id:St.id,params:h},{id:q.id,params:R},...v.redos]}),!0}};function Wa(s,e){const t=s.getMaxColumns()-1,n=s.getHiddenRows(),o=[];return e.forEach(r=>{const a=n.filter(l=>l.startRow>=r.startRow&&l.endRow<=r.endRow);if(a.length){let l=r.startRow;a.forEach(u=>{u.startRow>l&&(o.push({startRow:l,endRow:u.startRow-1,startColumn:0,endColumn:t}),l=u.endRow+1)}),l<=r.endRow&&o.push({startRow:l,endRow:r.endRow,startColumn:0,endColumn:t})}else o.push(r)}),o}function ir(s){return Va(s).map(t=>{const n=t.startRow===0?t.endRow+1:t.startRow-1;return{...t,startRow:n,endRow:n}})}function Va(s){const e=[];let t;return s.sort((n,o)=>n.startRow-o.startRow).forEach(n=>{if(!t){t=n;return}n.startRow===t.endRow+1?t.endRow=n.endRow:(e.push(t),t=n)}),e.push(t),e}const Z={type:i.CommandType.COMMAND,id:"sheet.command.set-style",handler:(s,e)=>{var y;const t=s.get(i.IUniverInstanceService),n=U(t,e);if(!n)return!1;const{unitId:o,subUnitId:r,worksheet:a}=n,{range:l,style:u}=e,d=s.get(i.ICommandService),c=s.get(i.IUndoRedoService),m=s.get(g.SheetsSelectionsService),h=l?[l]:(y=m.getCurrentSelections())==null?void 0:y.map(b=>b.range);if(!(h!=null&&h.length))return!1;const R=new i.ObjectMatrix,S=la(a);if(i.Tools.isArray(u.value))for(let b=0;b<h.length;b++)S.forOperableEach(h[b],(k,E,T)=>{R.setValue(k,E,{s:{[u.type]:u.value[k-T.startRow][E-T.startColumn]}})});else for(let b=0;b<h.length;b++){const k={s:{[u.type]:u.value}};S.forOperableEach(h[b],(E,T)=>R.setValue(E,T,k))}const C={subUnitId:r,unitId:o,cellValue:R.getMatrix()},v=ie(s,C),I=d.syncExecuteCommand(H.id,C),{undos:w,redos:p}=s.get(g.SheetInterceptorService).onCommandExecute({id:Z.id,params:e}),M=i.sequenceExecute([...p],d);return I&&M.result?(c.pushUndoRedo({unitID:C.unitId,undoMutations:[{id:H.id,params:v},...w],redoMutations:[{id:H.id,params:C},...p]}),!0):!1}},La={type:i.CommandType.COMMAND,id:"sheet.command.set-bold",handler:s=>{const e=s.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=U(s.get(i.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t,{actualRow:o,actualColumn:r}=e.primary,l={style:{type:"bl",value:n.getRange(o,r).getFontWeight()===i.FontWeight.BOLD?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE}};return s.get(i.ICommandService).syncExecuteCommand(Z.id,l)}},$a={type:i.CommandType.COMMAND,id:"sheet.command.set-italic",handler:s=>{const e=s.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=U(s.get(i.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let o=!0;if(e.primary){const{startRow:a,startColumn:l}=e.primary;o=n.getRange(a,l).getFontStyle()===i.FontItalic.ITALIC}const r={style:{type:"it",value:o?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE}};return s.get(i.ICommandService).syncExecuteCommand(Z.id,r)}},Ba={type:i.CommandType.COMMAND,id:"sheet.command.set-underline",handler:s=>{const e=s.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=U(s.get(i.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let o=!0;e.primary&&(o=!!n.getRange(e.primary.startRow,e.primary.startColumn).getUnderline().s);const r={style:{type:"ul",value:{s:o?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE}}};return s.get(i.ICommandService).syncExecuteCommand(Z.id,r)}},Ha={type:i.CommandType.COMMAND,id:"sheet.command.set-stroke",handler:s=>{const e=s.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=U(s.get(i.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let o=!0;e.primary&&(o=!!n.getRange(e.primary.actualRow,e.primary.actualColumn).getStrikeThrough().s);const r={style:{type:"st",value:{s:o?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE}}};return s.get(i.ICommandService).syncExecuteCommand(Z.id,r)}},ja={type:i.CommandType.COMMAND,id:"sheet.command.set-overline",handler:s=>{const e=s.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=U(s.get(i.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let o=!0;e.primary&&(o=!!n.getRange(e.primary.startRow,e.primary.startColumn).getOverline().s);const r={style:{type:"ol",value:{s:o?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE}}};return s.get(i.ICommandService).syncExecuteCommand(Z.id,r)}},Fa={type:i.CommandType.COMMAND,id:"sheet.command.set-font-family",handler:(s,e)=>{if(!e)return!1;const t=s.get(i.ICommandService),n={style:{type:"ff",value:e.value}};return t.syncExecuteCommand(Z.id,n)}},Ga={type:i.CommandType.COMMAND,id:"sheet.command.set-font-size",handler:(s,e)=>{if(!e)return!1;const t=s.get(i.ICommandService),n={style:{type:"fs",value:e.value}};return t.syncExecuteCommand(Z.id,n)}},ar={type:i.CommandType.COMMAND,id:"sheet.command.set-text-color",handler:(s,e)=>{if(!e)return!1;const t=s.get(i.ICommandService),n={style:{type:"cl",value:{rgb:e.value}}};return t.syncExecuteCommand(Z.id,n)}},lr={type:i.CommandType.COMMAND,id:"sheet.command.reset-text-color",handler:s=>{const e=s.get(i.ICommandService),t={style:{type:"cl",value:{rgb:null}}};return e.syncExecuteCommand(Z.id,t)}},ur={type:i.CommandType.COMMAND,id:"sheet.command.set-background-color",handler:(s,e)=>{if(!e||!e.value)return!1;const t=s.get(i.ICommandService),n={style:{type:"bg",value:{rgb:e.value}}};return t.syncExecuteCommand(Z.id,n)}},dr={type:i.CommandType.COMMAND,id:"sheet.command.reset-background-color",handler:s=>{const e=s.get(i.ICommandService),t={style:{type:"bg",value:{rgb:null}}};return e.syncExecuteCommand(Z.id,t)}},cr={type:i.CommandType.COMMAND,id:"sheet.command.set-vertical-text-align",handler:(s,e)=>{if(!e)return!1;const t=s.get(i.ICommandService),n={unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,style:{type:"vt",value:e.value}};return t.syncExecuteCommand(Z.id,n)}},mr={type:i.CommandType.COMMAND,id:"sheet.command.set-horizontal-text-align",handler:(s,e)=>{if(!e)return!1;const t=s.get(i.ICommandService),n={unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,style:{type:"ht",value:e.value}};return t.syncExecuteCommand(Z.id,n)}},hr={type:i.CommandType.COMMAND,id:"sheet.command.set-text-wrap",handler:(s,e)=>{if(!e)return!1;const t=s.get(i.ICommandService),n={unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,style:{type:"tb",value:e.value}};return t.syncExecuteCommand(Z.id,n)}},gr={type:i.CommandType.COMMAND,id:"sheet.command.set-text-rotation",handler:(s,e)=>{if(!e)return!1;const t=typeof e.value=="number"?{a:e.value}:{a:0,v:i.BooleanNumber.TRUE},n=s.get(i.ICommandService),o={unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,style:{type:"tr",value:t}};return n.syncExecuteCommand(Z.id,o)}},za=(s,e)=>{const r=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId).getSheetBySheetId(e.subUnitId).getConfig().tabColor;return{...i.Tools.deepClone(e),color:r}},$t={id:"sheet.mutation.set-tab-color",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getSheetBySheetId(e.subUnitId);return n?(n.getConfig().tabColor=e.color,!0):!1}},Rr={type:i.CommandType.COMMAND,id:"sheet.command.set-tab-color",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=U(s.get(i.IUniverInstanceService));if(!o)return!1;const{unitId:r,subUnitId:a}=o,l={color:e.value,unitId:r,subUnitId:a},u=za(s,l);return t.syncExecuteCommand($t.id,l)?(n.pushUndoRedo({unitID:r,undoMutations:[{id:$t.id,params:u}],redoMutations:[{id:$t.id,params:l}]}),!0):!1}},_s={id:"sheet.mutation.set-workbook-name",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService).getUnit(e.unitId,i.UniverInstanceType.UNIVER_SHEET);return t?(t.setName(e.name),!0):!1}},bs={type:i.CommandType.COMMAND,id:"sheet.command.set-workbook-name",handler:async(s,e)=>{var d;if(!s.get(i.IUniverInstanceService).getUnit(e.unitId,i.UniverInstanceType.UNIVER_SHEET))return!1;const r=s.get(g.SheetInterceptorService).onCommandExecute({id:bs.id,params:e}),a={name:e.name,unitId:e.unitId},l=[...(d=r.preRedos)!=null?d:[],{id:_s.id,params:a},...r.redos],u=s.get(i.ICommandService);return i.sequenceExecute(l,u).result}},Ct={id:"sheet.operation.set-worksheet-active",type:i.CommandType.OPERATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getWorksheets();for(const[,o]of n)if(o.getSheetId()===e.subUnitId)return t.setActiveSheet(o),!0;return!1}},qa=4,Ts={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-activate",handler:(s,e,t)=>{const n=s.get(i.ICommandService),o=U(s.get(i.IUniverInstanceService),e);if(!o)return!1;const{unitId:r,subUnitId:a}=o;return new Promise(l=>{setTimeout(()=>{const u=n.syncExecuteCommand(Ct.id,{unitId:r,subUnitId:a},t);l(u)},qa)})}},Es=(s,e)=>{const{unitId:t,subUnitId:n,ranges:o}=s,r={},a=e.getColumnManager();for(let l=0;l<o.length;l++){const u=o[l];for(let d=u.startColumn;d<u.endColumn+1;d++){const c=a.getColumnOrCreate(d);r[d]=c.w}}return{unitId:t,subUnitId:n,ranges:o,colWidth:r}},ke={id:"sheet.mutation.set-worksheet-col-width",type:i.CommandType.MUTATION,handler:(s,e)=>{var u;const t=s.get(i.IUniverInstanceService),n=U(t,e);if(!n)return!1;const{worksheet:o}=n,r=o.getConfig().defaultColumnWidth,a=o.getColumnManager(),l=e.ranges;for(let d=0;d<l.length;d++){const c=l[d];for(let m=c.startColumn;m<c.endColumn+1;m++){if(!o.getColVisible(m))continue;const R=a.getColumnOrCreate(m);typeof e.colWidth=="number"?R.w=e.colWidth:R.w=(u=e.colWidth[m])!=null?u:r}}return!0}},mn={type:i.CommandType.COMMAND,id:"sheet.command.delta-column-width",handler:async(s,e)=>{const n=s.get(g.SheetsSelectionsService).getCurrentSelections();if(!(n!=null&&n.length))return!1;const o=s.get(i.ICommandService),r=s.get(i.IUndoRedoService),a=U(s.get(i.IUniverInstanceService));if(!a)return!1;const{worksheet:l,unitId:u,subUnitId:d}=a,{anchorCol:c,deltaX:m}=e,R=l.getColumnWidth(c)+m,S=n.length===1&&n[0].range.rangeType===i.RANGE_TYPE.ALL,C=n.filter(k=>k.range.rangeType===i.RANGE_TYPE.COLUMN),v=S?i.RANGE_TYPE.ALL:C.some(({range:k})=>{const{startColumn:E,endColumn:T}=k;return E<=c&&c<=T})?i.RANGE_TYPE.COLUMN:i.RANGE_TYPE.NORMAL;let I;if(v===i.RANGE_TYPE.ALL){const k=l.getRowCount(),E=new Array(l.getColumnCount()).fill(void 0).map((T,P)=>({startRow:0,endRow:k-1,startColumn:P,endColumn:P}));I={subUnitId:d,unitId:u,colWidth:R,ranges:E}}else v===i.RANGE_TYPE.COLUMN?I={subUnitId:d,unitId:u,ranges:C.map(k=>i.Rectangle.clone(k.range)),colWidth:R}:I={subUnitId:d,unitId:u,colWidth:R,ranges:[{startRow:0,endRow:l.getMaxRows()-1,startColumn:c,endColumn:c}]};const{undos:w,redos:p}=s.get(g.SheetInterceptorService).onCommandExecute({id:mn.id,params:I}),M=Es(I,l),y=o.syncExecuteCommand(ke.id,I),b=i.sequenceExecute([...p],o);return y&&b.result&&r.pushUndoRedo({unitID:u,undoMutations:[{id:ke.id,params:M},...w],redoMutations:[{id:ke.id,params:I},...p]}),!0}},Bt={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-col-width",handler:(s,e)=>{var w,p,M,y;const t=s.get(g.SheetsSelectionsService),n=s.get(i.ICommandService),o=s.get(i.IUndoRedoService),r=s.get(g.SheetInterceptorService),a=(w=e==null?void 0:e.ranges)!=null&&w.length?e.ranges:(p=t.getCurrentSelections())==null?void 0:p.map(b=>b.range);if(!(a!=null&&a.length))return!1;const l=U(s.get(i.IUniverInstanceService),e);if(!l)return!1;const{subUnitId:u,unitId:d,worksheet:c}=l,m={subUnitId:u,unitId:d,ranges:a,colWidth:e.value},h=Es(m,c),R=n.syncExecuteCommand(ke.id,m),{undos:S,redos:C}=s.get(g.SheetInterceptorService).onCommandExecute({id:Bt.id,params:m}),v=r.onCommandExecute({id:Bt.id,params:m}),I=i.sequenceExecute([...C,...v.redos],n);return R&&I.result?(o.pushUndoRedo({unitID:d,undoMutations:[...(M=v.preUndos)!=null?M:[],{id:ke.id,params:h},...S],redoMutations:[...(y=v.preRedos)!=null?y:[],{id:ke.id,params:m},...C]}),!0):!1}};i.CommandType.COMMAND;const ft={id:"sheet.mutation.set-worksheet-default-style",type:i.CommandType.MUTATION,handler:(s,e)=>{const{defaultStyle:t}=e,n=s.get(i.IUniverInstanceService),o=U(n);if(!o)return!1;const{worksheet:r}=o;return r?(r.setDefaultCellStyle(t),!0):!1}},Sr=(s,e)=>{const t=Ge(s.get(i.IUniverInstanceService),e);if(!t)throw new Error("[SetWorksheetDefaultStyleMutationFactory]: worksheet is null error!");const{worksheet:n}=t;return{unitId:e.unitId,subUnitId:n.getSheetId(),defaultStyle:n.getDefaultCellStyle()}},Cr={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-default-style",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),{unitId:o}=e,r=Sr(s,e);return t.syncExecuteCommand(ft.id,e)?(n.pushUndoRedo({unitID:o,undoMutations:[{id:ft.id,params:r}],redoMutations:[{id:ft.id,params:e}]}),!0):!1}},fr=(s,e)=>{const t=Ge(s.get(i.IUniverInstanceService),e);if(!t)throw new Error("[SetWorksheetHideMutationFactory]: worksheet is null error!");const{worksheet:n}=t;return{hidden:n.isSheetHidden(),unitId:e.unitId,subUnitId:n.getSheetId()}},$e={id:"sheet.mutation.set-worksheet-hidden",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(t==null)return!1;const n=t.getSheetBySheetId(e.subUnitId);return n?(n.getConfig().hidden=e.hidden,!0):!1}},vr={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-hidden",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.ErrorService),r=s.get(i.LocaleService),a=U(s.get(i.IUniverInstanceService),e);if(!a)return!1;const{workbook:l,worksheet:u,unitId:d,subUnitId:c}=a;if(u.getConfig().hidden===i.BooleanNumber.TRUE)return!1;const h={unitId:d,subUnitId:c,hidden:i.BooleanNumber.TRUE},R=fr(s,h);return l.getSheets().filter(I=>I.getConfig().hidden===i.BooleanNumber.FALSE).length===1?(o.emit(r.t("sheets.info.hideSheet")),!1):t.syncExecuteCommand($e.id,h)?(n.pushUndoRedo({unitID:d,undoMutations:[{id:$e.id,params:R}],redoMutations:[{id:$e.id,params:h}]}),!0):!1}},Ya=(s,e)=>{const t=Ge(s.get(i.IUniverInstanceService),e);if(!t)throw new Error("[SetWorksheetNameMutationFactory]: worksheet is null error!");const{worksheet:n}=t;return{unitId:e.unitId,name:n.getName(),subUnitId:n.getSheetId()}},Ht={id:"sheet.mutation.set-worksheet-name",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(t==null)return!1;const n=t.getSheetBySheetId(e.subUnitId);return n?(n.getConfig().name=e.name,!0):!1}},hn={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-name",handler:(s,e)=>{var S,C;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(g.SheetInterceptorService),r=U(s.get(i.IUniverInstanceService),e);if(!r)return!1;const{unitId:a,subUnitId:l}=r,u={subUnitId:l,name:e.name,unitId:a},d=Ya(s,u),c=o.onCommandExecute({id:hn.id,params:e}),m=[...(S=c.preRedos)!=null?S:[],{id:Ht.id,params:u},...c.redos],h=[...(C=c.preUndos)!=null?C:[],{id:Ht.id,params:d},...c.undos];return i.sequenceExecute(m,t).result?(n.pushUndoRedo({unitID:a,undoMutations:h,redoMutations:m}),!0):!1}},Ka=(s,e)=>({...i.Tools.deepClone(e),toOrder:e.fromOrder,fromOrder:e.toOrder}),jt={id:"sheet.mutation.set-worksheet-order",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getConfig();return n.sheetOrder.splice(e.fromOrder,1),n.sheetOrder.splice(e.toOrder,0,e.subUnitId),!0}},Us={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-order",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=U(s.get(i.IUniverInstanceService),e);if(!o)return!1;const{workbook:r,unitId:a,subUnitId:l}=o,d={fromOrder:r.getConfig().sheetOrder.indexOf(l),toOrder:e.order,unitId:a,subUnitId:l},c=Ka(s,d);return t.syncExecuteCommand(jt.id,d)?(n.pushUndoRedo({unitID:a,undoMutations:[{id:jt.id,params:c}],redoMutations:[{id:jt.id,params:d}]}),!0):!1}};class vt{constructor(){f(this,"_model",new Map);f(this,"_pointChange",new A.Subject);f(this,"pointChange$",this._pointChange.asObservable())}addRule(e){this._ensureSubUnitMap(e.unitId).set(e.subUnitId,e),this._pointChange.next(e)}deleteRule(e,t){var o,r,a;const n=(o=this._model.get(e))==null?void 0:o.get(t);n&&((a=(r=this._model)==null?void 0:r.get(e))==null||a.delete(t),this._pointChange.next(n))}getRule(e,t){var n,o;return(o=(n=this._model)==null?void 0:n.get(e))==null?void 0:o.get(t)}toObject(){const e={};return[...this._model.keys()].forEach(n=>{const o=this._model.get(n);o!=null&&o.size&&(e[n]=[],[...o.keys()].forEach(a=>{const l=o.get(a);l&&e[n].push(l)}))}),e}fromObject(e){const t=new Map;Object.keys(e).forEach(n=>{const o=e[n];if(o!=null&&o.length){const r=new Map;o.forEach(a=>{r.set(a.subUnitId,a)}),t.set(n,r)}}),this._model=t}deleteUnitModel(e){this._model.delete(e)}_ensureSubUnitMap(e){let t=this._model.get(e);return t||(t=new Map,this._model.set(e,t)),t}getTargetByPermissionId(e,t){const n=this._model.get(e);if(!n)return null;for(const[o,r]of n)if(r.permissionId===t)return[e,o]}}class Ps{constructor(e,t,n){f(this,"type",O.SelectRange);f(this,"subType",_.Delete);f(this,"status",i.PermissionStatus.INIT);f(this,"value",!0);f(this,"id");f(this,"unitId");f(this,"subUnitId");f(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${O.SelectRange}.${_.Delete}.${n}`}}class ks{constructor(e,t,n){f(this,"type",O.SelectRange);f(this,"subType",_.ManageCollaborator);f(this,"status",i.PermissionStatus.INIT);f(this,"value",!0);f(this,"id");f(this,"unitId");f(this,"subUnitId");f(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${O.SelectRange}.${_.ManageCollaborator}.${n}`}}const se=()=>[nn,ce,ks,Ps],Be=[_.Edit,_.View,_.ManageCollaborator,_.Delete],Ja=(s="unitId",e="subUnitId",t="permissionId")=>se().reduce((n,o)=>{const r=new o(s,e,t);return n[r.subType]=r.value,n},{}),It=()=>[ae,Gn,Vn,Yn,Ln,Fn,on,Bn,Hn,an,sn,jn,qn,rn,Mo,Kn,zn,$n],Ir=[_.Edit,_.Print,_.Comment,_.View,_.Copy,_.Export,_.ManageCollaborator,_.CreateSheet,_.DeleteSheet,_.RenameSheet,_.HideSheet,_.Duplicate,_.Share,_.MoveSheet,_.CopySheet,_.RecoverHistory,_.ViewHistory,_.CreatePermissionObject],oe=()=>[me,Pt,os,Xn],ge=()=>[Jn,xn,Zn,Qn,es,ts,ss,ns,rs,is,Ut,ot,rt,as],gn=[_.Copy,_.DeleteColumn,_.DeleteRow,_.EditExtraObject,_.Filter,_.InsertColumn,_.InsertRow,_.InsertHyperlink,_.PivotTable,_.SetCellStyle,_.SetCellValue,_.SetColumnStyle,_.SetRowStyle,_.Sort];var xa=Object.getOwnPropertyDescriptor,Xa=(s,e,t,n)=>{for(var o=n>1?void 0:n?xa(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},He=(s,e)=>(t,n)=>e(t,n,s);const Za="SHEET_WORKSHEET_PROTECTION_PLUGIN",Qa="SHEET_WORKSHEET_PROTECTION_POINT_PLUGIN";g.WorksheetPermissionService=class extends i.RxDisposable{constructor(e,t,n,o,r,a,l,u){super(),this._permissionService=e,this._univerInstanceService=t,this._injector=n,this._worksheetProtectionRuleModel=o,this._worksheetProtectionPointRuleModel=r,this._resourceManagerService=a,this._rangeProtectionRuleModel=l,this._logService=u,this._init(),this._initRuleChange(),this._initRuleSnapshot(),this._initPointSnapshot()}_init(){const e=t=>{const n=t.getUnitId(),o=r=>{const a=r.getSheetId();[...oe(),...ge()].forEach(l=>{const u=new l(n,a);this._permissionService.addPermissionPoint(u)}),this._logService.debug("[WorksheetPermissionService]","Initialization completed",n,a)};t.getSheets().forEach(r=>{o(r)}),t.sheetCreated$.subscribe(r=>{o(r)}),t.sheetDisposed$.subscribe(r=>{const a=r.getSheetId();this._rangeProtectionRuleModel.getSubunitRuleList(n,a).forEach(u=>{[...se()].forEach(d=>{const c=new d(n,a,u.permissionId);this._permissionService.deletePermissionPoint(c.id)})}),[...oe(),...ge()].forEach(u=>{const d=new u(n,a);this._permissionService.deletePermissionPoint(d.id)})})};this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).forEach(t=>{e(t)}),this._univerInstanceService.getTypeOfUnitAdded$(i.UniverInstanceType.UNIVER_SHEET).pipe(yt.takeUntil(this.dispose$)).subscribe(e),this._univerInstanceService.getTypeOfUnitDisposed$(i.UniverInstanceType.UNIVER_SHEET).pipe(yt.takeUntil(this.dispose$)).subscribe(t=>{t.getSheets().forEach(n=>{const o=t.getUnitId(),r=n.getSheetId();oe().forEach(a=>{const l=new a(o,r);this._permissionService.deletePermissionPoint(l.id)})})})}_initRuleChange(){this.disposeWithMe(this._worksheetProtectionRuleModel.ruleChange$.subscribe(e=>{switch(e.type){case"add":break;case"delete":{oe().forEach(t=>{const n=new t(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(n.id,!0)});break}case"set":{oe().forEach(t=>{const n=new t(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(n.id,e.rule)});break}}}))}_initRuleSnapshot(){const e=()=>{const n=this._worksheetProtectionRuleModel.toObject();return JSON.stringify(n)},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e,parseJson:t,pluginName:Za,businesses:[tn.UNIVER_SHEET],onLoad:(n,o)=>{this._worksheetProtectionRuleModel.fromObject(o),Object.keys(o).forEach(r=>{oe().forEach(a=>{const l=new a(n,r);l.value=!1,this._permissionService.addPermissionPoint(l)})}),this._worksheetProtectionRuleModel.changeRuleInitState(!0)},onUnLoad:n=>{const o=this._univerInstanceService.getUnit(n);o&&(o.getSheets().forEach(r=>{const a=r.getSheetId();[...oe(),...ge()].forEach(l=>{const u=new l(n,a);this._permissionService.deletePermissionPoint(u.id)})}),It().forEach(r=>{const a=new r(n);this._permissionService.deletePermissionPoint(a.id)})),this._worksheetProtectionRuleModel.deleteUnitModel(n)}}))}_initPointSnapshot(){const e=()=>{const n=this._worksheetProtectionPointRuleModel.toObject();return JSON.stringify(n)},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e,parseJson:t,pluginName:Qa,businesses:[tn.UNIVER_SHEET],onLoad:(n,o)=>{this._worksheetProtectionPointRuleModel.fromObject(o),Object.keys(o).forEach(r=>{ge().forEach(a=>{const l=new a(n,r);this._permissionService.addPermissionPoint(l)})})},onUnLoad:n=>{this._worksheetProtectionPointRuleModel.deleteUnitModel(n)}}))}},g.WorksheetPermissionService=Xa([He(0,i.Inject(i.IPermissionService)),He(1,i.Inject(i.IUniverInstanceService)),He(2,i.Inject(i.Injector)),He(3,i.Inject(we)),He(4,i.Inject(vt)),He(5,i.Inject(i.IResourceManagerService)),He(6,i.Inject(K)),He(7,i.Inject(i.ILogService))],g.WorksheetPermissionService);const Rn={id:"sheet.mutation.set-worksheet-permission-points",type:i.CommandType.MUTATION,handler:(s,e)=>{const{rule:t}=e;return s.get(vt).addRule(t),!0}},pr={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-permission-points",async handler(s,e){if(!e)return!1;const t=s.get(i.ICommandService),{rule:n}=e;return t.executeCommand(Rn.id,{rule:n,unitId:n.unitId,subUnitId:n.subUnitId}),!0}},wr={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-protection",async handler(s,e){if(!e)return!1;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),{rule:o,permissionId:r,oldRule:a}=e,{unitId:l,subUnitId:u}=o,d={...o,permissionId:r};if(await t.executeCommand(xe.id,{unitId:l,subUnitId:u,newRule:d})){const m=[{id:xe.id,params:{unitId:l,subUnitId:u,newRule:d}}],h=[{id:xe.id,params:{unitId:l,subUnitId:u,rule:a}}];n.pushUndoRedo({unitID:l,redoMutations:m,undoMutations:h})}return!0}},el=2e3,Mr=(s,e)=>{const{unitId:t,subUnitId:n,ranges:o}=s,r={},a=e.getRowManager();for(const{startRow:l,endRow:u}of o)for(let d=l;d<u+1;d++){const c=a.getRowOrCreate(d);r[d]=c.h}return{unitId:t,subUnitId:n,ranges:o,rowHeight:r}},Ns=(s,e)=>{const{unitId:t,subUnitId:n,ranges:o}=s,r={},a=e.getRowManager();for(const{startRow:l,endRow:u}of o)for(let d=l;d<=u;d++){const c=a.getRowOrCreate(d);r[d]=c.ia}return{unitId:t,subUnitId:n,ranges:o,autoHeightInfo:r}},tl=(s,e)=>{const{unitId:t,subUnitId:n,rowsAutoHeightInfo:o}=s,r=[],a=e.getRowManager();for(const l of o){const{row:u}=l,{ah:d}=a.getRowOrCreate(u);r.push({row:u,autoHeight:d})}return{unitId:t,subUnitId:n,rowsAutoHeightInfo:r}},Ne={id:"sheet.mutation.set-worksheet-row-height",type:i.CommandType.MUTATION,handler:(s,e)=>{var d;const{ranges:t,rowHeight:n}=e,o=s.get(i.IUniverInstanceService),r=U(o,e);if(!r)return!1;const{worksheet:a}=r,l=a.getRowManager(),u=a.getConfig().defaultRowHeight;for(const{startRow:c,endRow:m}of t)for(let h=c;h<=m;h++){const R=l.getRowOrCreate(h);typeof n=="number"?R.h=n:R.h=(d=n[h])!=null?d:u,R.h=Math.min(el,R.h)}return!0}},Re={id:"sheet.mutation.set-worksheet-row-is-auto-height",type:i.CommandType.MUTATION,handler:(s,e)=>{var l;const{ranges:t,autoHeightInfo:n}=e,o=s.get(i.IUniverInstanceService),r=U(o,e);if(!r)return!1;const a=r.worksheet.getRowManager();for(const{startRow:u,endRow:d}of t)for(let c=u;c<=d;c++){const m=a.getRowOrCreate(c);typeof n=="number"?m.ia=n:m.ia=(l=n[c])!=null?l:void 0}return!0}},Os={id:"sheet.mutation.set-worksheet-row-auto-height",type:i.CommandType.MUTATION,handler:(s,e)=>{const{rowsAutoHeightInfo:t}=e,n=s.get(i.IUniverInstanceService),o=U(n,e);if(!o)return!1;const r=o.worksheet.getRowManager();for(const{row:a,autoHeight:l}of t){const u=r.getRowOrCreate(a);u.ah=l}return!0}},Sn={type:i.CommandType.COMMAND,id:"sheet.command.delta-row-height",handler:async(s,e)=>{var T,P;const n=s.get(g.SheetsSelectionsService).getCurrentSelections(),o=s.get(g.SheetInterceptorService);if(!(n!=null&&n.length))return!1;const r=U(s.get(i.IUniverInstanceService));if(!r)return!1;const{worksheet:a,subUnitId:l,unitId:u}=r,{anchorRow:d,deltaY:c}=e,h=a.getRowHeight(d)+c,R=n.length===1&&n[0].range.rangeType===i.RANGE_TYPE.ALL,S=n.filter(N=>N.range.rangeType===i.RANGE_TYPE.ROW),C=R?i.RANGE_TYPE.ALL:S.some(({range:N})=>{const{startRow:W,endRow:L}=N;return W<=d&&d<=L})?i.RANGE_TYPE.ROW:i.RANGE_TYPE.NORMAL;let v;if(C===i.RANGE_TYPE.ALL){const N=a.getColumnCount(),W=new Array(a.getRowCount()).fill(void 0).map((L,$)=>({startRow:$,endRow:$,startColumn:0,endColumn:N-1}));v={subUnitId:l,unitId:u,rowHeight:h,ranges:W}}else C===i.RANGE_TYPE.ROW?v={subUnitId:l,unitId:u,ranges:S.map(N=>i.Rectangle.clone(N.range)),rowHeight:h}:v={subUnitId:l,unitId:u,rowHeight:h,ranges:[{startRow:d,endRow:d,startColumn:0,endColumn:a.getMaxColumns()-1}]};const I=Mr(v,a),w={unitId:u,subUnitId:l,ranges:v.ranges,autoHeightInfo:i.BooleanNumber.FALSE},p=Ns(w,a),M=s.get(i.ICommandService),y=s.get(i.IUndoRedoService),b=o.onCommandExecute({id:Sn.id,params:v}),k=i.sequenceExecute([{id:Ne.id,params:v},{id:Re.id,params:w}],M),E=i.sequenceExecute([...b.redos],M);return k.result&&E.result?(y.pushUndoRedo({unitID:u,undoMutations:[...(T=b.preUndos)!=null?T:[],{id:Ne.id,params:I},{id:Re.id,params:p},...b.undos],redoMutations:[...(P=b.preRedos)!=null?P:[],{id:Ne.id,params:v},{id:Re.id,params:w},...b.redos]}),!0):!1}},Cn={type:i.CommandType.COMMAND,id:"sheet.command.set-row-height",handler:(s,e)=>{var p,M,y,b;const t=s.get(g.SheetsSelectionsService),n=s.get(i.ICommandService),o=s.get(i.IUndoRedoService),r=s.get(i.IUniverInstanceService),a=s.get(g.SheetInterceptorService),l=(p=e==null?void 0:e.ranges)!=null&&p.length?e.ranges:(M=t.getCurrentSelections())==null?void 0:M.map(k=>k.range);if(!(l!=null&&l.length))return!1;const u=U(r,e);if(!u)return!1;const{unitId:d,subUnitId:c,worksheet:m}=u,h={subUnitId:c,unitId:d,ranges:l,rowHeight:e.value},R=Mr(h,m),S={unitId:d,subUnitId:c,ranges:h.ranges,autoHeightInfo:i.BooleanNumber.FALSE},C=Ns(S,m),v=i.sequenceExecute([{id:Ne.id,params:h},{id:Re.id,params:S}],n),I=a.onCommandExecute({id:Cn.id,params:h}),w=i.sequenceExecute([...I.redos],n);return v.result&&w.result?(o.pushUndoRedo({unitID:d,undoMutations:[...(y=I.preRedos)!=null?y:[],{id:Ne.id,params:R},{id:Re.id,params:C},...I.undos],redoMutations:[...(b=I.preRedos)!=null?b:[],{id:Ne.id,params:h},{id:Re.id,params:S},...I.redos]}),!0):!1}},fn={type:i.CommandType.COMMAND,id:"sheet.command.set-row-is-auto-height",handler:(s,e)=>{var I,w;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(g.SheetsSelectionsService),r=s.get(i.IUniverInstanceService),a=U(r,e);if(!a)return!1;const{unitId:l,subUnitId:u,worksheet:d}=a,c=(I=e==null?void 0:e.ranges)!=null&&I.length?e.ranges:(w=o.getCurrentSelections())==null?void 0:w.map(p=>p.range);if(!(c!=null&&c.length))return!1;const m={unitId:l,subUnitId:u,ranges:c,autoHeightInfo:i.BooleanNumber.TRUE},h=Ns(m,d),R=t.syncExecuteCommand(Re.id,m),{undos:S,redos:C}=s.get(g.SheetInterceptorService).onCommandExecute({id:fn.id,params:m}),v=i.sequenceExecute([...C],t);return R&&v.result?(n.pushUndoRedo({unitID:l,undoMutations:[{id:Re.id,params:h},...S],redoMutations:[{id:Re.id,params:m},...C]}),!0):!1}},Ds={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-show",handler:(s,e)=>{const{unitId:t,subUnitId:n}=e,o=s.get(i.ICommandService),r=s.get(i.IUndoRedoService),a=s.get(i.IUniverInstanceService);if(!U(s.get(i.IUniverInstanceService)))return!1;const u=a.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!u)return!1;const d=u.getSheetBySheetId(n);if(!d||d.getConfig().hidden===i.BooleanNumber.FALSE)return!1;const m={unitId:t,subUnitId:n,hidden:i.BooleanNumber.FALSE},h=fr(s,m),R=o.syncExecuteCommand($e.id,m),S={unitId:t,subUnitId:n},C=o.syncExecuteCommand(Ct.id,S);return R&&C?(r.pushUndoRedo({unitID:t,undoMutations:[{id:$e.id,params:h}],redoMutations:[{id:$e.id,params:m}]}),!0):!1}};var yr=(s=>(s[s.Tab=1]="Tab",s[s.Comma=2]="Comma",s[s.Semicolon=4]="Semicolon",s[s.Space=8]="Space",s[s.Custom=16]="Custom",s))(yr||{});class nl{constructor(){f(this,"_tabCount",0);f(this,"_commaCount",0);f(this,"_semicolonCount",0);f(this,"_spaceCount",0)}add(e){switch(e){case" ":this._tabCount++;break;case",":this._commaCount++;break;case";":this._semicolonCount++;break;case" ":this._spaceCount++;break}}update(e){e&&typeof e=="string"&&(e.includes(" ")&&this._tabCount++,e.includes(",")&&this._commaCount++,e.includes(";")&&this._semicolonCount++,e.trim().includes(" ")&&this._spaceCount++)}getDelimiter(){const e=Math.max(this._tabCount,this._commaCount,this._semicolonCount,this._spaceCount);return e===0||e===this._tabCount?1:e===this._commaCount?2:e===this._semicolonCount?4:e===this._spaceCount?8:1}}function sl(s,e,t){const n=[];t!==void 0&&(s&16)>0&&n.push(t),(s&1)>0&&n.push(" "),(s&2)>0&&n.push(","),(s&4)>0&&n.push(";"),(s&8)>0&&n.push(" ");let o="";for(const a of n)o+=ol(a);let r="[".concat(o,"]");return e&&(r+="+"),new RegExp(r)}function ol(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const rl=s=>{var t;return((t=s.body)==null?void 0:t.dataStream.replace(/\r\n$/,""))||""};function il(s){if(s!=null){if(s.p)return rl(s.p);if(s.v&&typeof s.v=="string")return s.v;if(s.t&&(s.t===i.CellValueType.FORCE_STRING||s.t===i.CellValueType.STRING))return String(s.v)}}function _r(s,e,t,n,o=!1){const r=i.Range.transformRange(e,s),{startColumn:a,startRow:l,endColumn:u,endRow:d}=r;if(a!==u)throw new Error("The range must be in the same column.");if(t&&(t&16)>0&&(n===void 0||n.length!==1))throw new Error("The custom delimiter must a character.");const c=t===void 0,m=c?new nl:null,h=[];for(let p=l;p<=d;p++){const M=s.getCell(p,a),y=il(M);h.push(y),m&&m.update(y)}const R=c?m.getDelimiter():t,S=sl(R,o,n);let C=-1,v=0,I=0;const w=[];for(const p of h){if(p!==void 0){const M=String(p).split(S);C<0?C=M.length:C=Math.max(C,M.length),w.push(M),v=I}else w.push(void 0);I++}return{rs:w,maxLength:C===-1?0:C,lastRow:v}}const br={type:i.CommandType.COMMAND,id:"sheet.command.split-text-to-columns",handler:(s,e)=>{const{unitId:t,subUnitId:n,range:o,delimiter:r,customDelimiter:a,treatMultipleDelimitersAsOne:l}=e,u=s.get(i.ICommandService),d=s.get(i.IUniverInstanceService),c=s.get(i.IUndoRedoService);if(!U(s.get(i.IUniverInstanceService)))return!1;const h=d.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!h)return!1;const R=h.getSheetBySheetId(n);if(!R)return!1;const{lastRow:S,rs:C,maxLength:v}=_r(R,o,r,a,l),I=R.getColumnCount(),{startColumn:w}=i.Range.transformRange(o,R);if(o.startColumn!==o.endColumn)return!1;const p=[],M=[],y=w+v+1-I;if(y>0){const N={unitId:t,subUnitId:n,range:{startRow:0,endRow:R.getRowCount()-1,startColumn:I-1,endColumn:I-1+y}};p.push({id:de.id,params:N});const W=_t(s,N);M.push({id:re.id,params:W})}const b={startRow:o.startRow,endRow:S,startColumn:w,endColumn:w+v},k=new i.ObjectMatrix;for(let N=b.startRow;N<=b.endRow;N++)for(let W=b.startColumn;W<=b.endColumn;W++){const L=C[N-b.startRow];W===0&&(L==null?void 0:L.length)===1?k.setValue(N,W,R.getCell(N,W)):k.setValue(N,W,{v:(L==null?void 0:L[W-b.startColumn])||null,p:null,f:null,si:null,custom:null})}const E={unitId:t,subUnitId:n,cellValue:k.clone()},T=ie(s,E);return p.push({id:H.id,params:E}),M.unshift({id:H.id,params:T}),i.sequenceExecute(p,u).result?(c.pushUndoRedo({unitID:t,undoMutations:M,redoMutations:p}),!0):!1}},Tr={id:"sheet.command.toggle-cell-checkbox",type:i.CommandType.COMMAND,handler:(s,e)=>{if(!e)return!1;const{unitId:t,subUnitId:n,row:o,col:r,paragraphIndex:a}=e,u=s.get(i.IUniverInstanceService).getUnit(t,i.UniverInstanceType.UNIVER_SHEET),d=u==null?void 0:u.getSheetBySheetId(n),c=s.get(i.IUndoRedoService),m=s.get(i.ICommandService);if(!d)return!1;const h=d.getCell(o,r);if(!(h!=null&&h.p))return!1;const R=i.Tools.deepClone(h.p),S=new i.DocumentDataModel(R),C=i.BuildTextUtils.paragraph.bullet.toggleChecklist({document:S,paragraphIndex:a});if(!C)return!1;i.TextX.apply(S.getBody(),C.serialize());const v={unitId:t,subUnitId:n,cellValue:{[o]:{[r]:{p:R,t:i.CellValueType.STRING}}}},I={id:H.id,params:v},w=ie(s,v),p={id:H.id,params:w},M=[I],y=[p];return c.pushUndoRedo({redoMutations:M,undoMutations:y,unitID:t}),m.syncExecuteCommand(I.id,I.params)}},pt={id:"sheet.mutation.toggle-gridlines",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=U(s.get(i.IUniverInstanceService),e);if(!t)return!1;const{worksheet:n}=t,o=n.getConfig();return o.showGridlines=e.showGridlines,!0}},Er={type:i.CommandType.COMMAND,id:"sheet.command.toggle-gridlines",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=U(o);if(!r)return!1;const{worksheet:a}=r,l=a.getConfig().showGridlines;if(l===(e==null?void 0:e.showGridlines))return!1;const{unitId:u,subUnitId:d}=r,c={showGridlines:l===i.BooleanNumber.TRUE?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE,unitId:u,subUnitId:d},m={showGridlines:l,unitId:u,subUnitId:d};return t.syncExecuteCommand(pt.id,c)?(n.pushUndoRedo({unitID:u,undoMutations:[{id:pt.id,params:m}],redoMutations:[{id:pt.id,params:c}]}),!0):!1}},Ur={id:"sheet.command.unregister-worksheet-range-theme-style",type:i.CommandType.COMMAND,handler:(s,e)=>{var h;if(!e)return!1;const{unitId:t,themeName:n}=e,o=s.get(i.IUniverInstanceService),r=s.get(i.ICommandService),a=s.get(i.IUndoRedoService),l=s.get(Me);if(!U(o))return!1;const d={unitId:t,themeName:n},c={unitId:t,themeName:n,rangeThemeStyleJson:(h=l.getRangeThemeStyle(t,n))==null?void 0:h.toJson()};return r.syncExecuteCommand(lt.id,e)&&a.pushUndoRedo({unitID:t,undoMutations:[{id:lt.id,params:c}],redoMutations:[{id:ln.id,params:d}]}),!0}},Pr={id:"sheet.mutation.empty",type:i.CommandType.MUTATION,handler:()=>!0},kr=s=>{const e=new i.ObjectMatrix;return s.forEach(t=>{i.Range.foreach(t,(n,o)=>{e.setValue(n,o,1)})}),e.forValue((t,n)=>{const o=e.getValue(t-1,n);o&&e.setValue(t,n,o+1)}),e},Nr=s=>{const e=s;return e.forValue((t,n)=>{const o=s.getValue(t-1,n);o&&e.setValue(t,n,o+1)}),e},Or=s=>{const e={area:0},t=(n,o)=>e.area<n?(e.area=n,e.range=o,!0):!1;return s.forValue((n,o,r)=>{let a=1,l=r;t(a*l,{startRow:n-l+1,endRow:n,startColumn:o,endColumn:o});const u={startRow:n-l+1,endRow:n,startColumn:0,endColumn:o};for(let d=o-1;d>=0&&s.getValue(n,d);d--){l=Math.min(s.getValue(n,d)||0,l),a++;const c=l*a;u.startColumn=d,u.startRow=n-l+1,t(c,u)}}),e},al=(s,e)=>{i.Range.foreach(e,(t,n)=>{s.realDeleteValue(t,n)});for(let t=e.startColumn;t<=e.endColumn;t++){const n=e.endRow+1;if(s.getValue(n,t)>0){s.setValue(n,t,1);let r=n+1;for(;s.getValue(r,t)>0;)s.setValue(r,t,s.getValue(r-1,t)+1),r++}}return s},As=s=>{const e=[];let t=Or(s);for(;t.area>0;)t.range&&(e.push(t.range),al(s,t.range)),t=Or(s);return e},Ws=s=>{const e=kr(s);return As(e)};class ll{constructor(){f(this,"_matrix",new i.ObjectMatrix)}add(...e){return e.forEach(t=>{i.Range.foreach(t,(n,o)=>{this._matrix.setValue(n,o,1)})}),this}subtract(...e){return e.forEach(t=>{i.Range.foreach(t,(n,o)=>{this._matrix.realDeleteValue(n,o)})}),this}merge(){const e=Nr(this._matrix);return As(e)}}const Xe=i.createIdentifier("INumfmtService"),ul=(s,e)=>{const t=s.get(Xe),{values:n,unitId:o,subUnitId:r}=e,a=[],l=[];Object.keys(n).forEach(d=>{n[d].ranges.forEach(m=>{i.Range.foreach(m,(h,R)=>{const S=t.getValue(o,r,h,R);S?a.push({pattern:S.pattern,row:h,col:R}):l.push({startColumn:R,endColumn:R,startRow:h,endRow:h})})})});const u=[];if(a.length){const d=In(o,r,a);Object.keys(d.values).forEach(c=>{const m=d.values[c];m.ranges=Ws(m.ranges)}),u.push({id:vn.id,params:In(o,r,a)})}return l.length&&u.push({id:Vs.id,params:{unitId:o,subUnitId:r,ranges:l}}),u},vn={id:"sheet.mutation.set.numfmt",type:i.CommandType.MUTATION,handler:(s,e)=>{if(!e)return!1;const{values:t,refMap:n}=e,o=s.get(Xe),r=e.unitId,a=e.subUnitId,l=Object.keys(t).reduce((u,d)=>{const c=n[d],m=t[d].ranges;return c&&u.push({...c,ranges:m}),u},[]);return o.setValues(r,a,l),!0}},Vs={id:"sheet.mutation.remove.numfmt",type:i.CommandType.MUTATION,handler:(s,e)=>{if(!e)return!1;const{unitId:t,subUnitId:n,ranges:o}=e;return s.get(Xe).deleteValues(t,n,o),!0}},dl=(s,e)=>{const t=s.get(Xe),{ranges:n,unitId:o,subUnitId:r}=e,a=[];if(n.forEach(u=>{i.Range.foreach(u,(d,c)=>{const m=t.getValue(o,r,d,c);m&&a.push({pattern:m.pattern,row:d,col:c})})}),!a.length)return[];const l=In(o,r,a);return Object.keys(l.values).forEach(u=>{const d=l.values[u];d.ranges=Ws(d.ranges)}),[{id:vn.id,params:l}]},In=(s,e,t)=>{const n=xi(t,"pattern"),o={},r={},a=Xi();return Object.keys(n).forEach(l=>{const u=n[l],d=a();o[d]={pattern:l},u.forEach(c=>{r[d]||(r[d]={ranges:[]}),r[d].ranges.push(i.cellToRange(c.row,c.col))})}),{unitId:s,subUnitId:e,refMap:o,values:r}},Dr={id:"sheet.operation.scroll-to-cell",type:i.CommandType.OPERATION,handler:()=>!0},Ar="ONLY_REGISTER_FORMULA_RELATED_MUTATIONS_KEY",Wr="maxCellsPerSheet",cl=3e6;var ml=Object.getOwnPropertyDescriptor,hl=(s,e,t,n)=>{for(var o=n>1?void 0:n?ml(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Ls=(s,e)=>(t,n)=>e(t,n,s);let pn=class extends i.Disposable{constructor(s,e,t){var o;super(),this._commandService=s,this._configService=e,this._dataSyncPrimaryController=t,[H,de,Se,st,Ae,Ue,Pe,re,Ce,ze,G,Vs,F,_s,Ht,vn,Wt,Pr,St,Rt,ct,mt].forEach(r=>{var a;this._commandService.registerCommand(r),(a=this._dataSyncPrimaryController)==null||a.registerSyncingMutations(r)}),((o=this._configService.getConfig(Ar))!=null?o:!1)||[mo,Xt,Zt,Qt,Wn,Ye,Ke,mn,Sn,Wo,Ao,ms,Ve,at,kt,Oo,No,cs,We,Vo,Ot,qe,Nt,Rs,At,Cs,Dt,un,dn,Go,dr,lr,ur,xo,Jo,ut,Yo,Ko,Is,Bt,Zo,dt,er,Le,tr,mr,it,Cn,ys,rr,gt,vs,Ms,Vt,Lt,Z,Rr,$t,ar,gr,hr,cr,bs,Ts,Ct,vr,$e,hn,Us,jt,Os,Ne,fn,Re,ke,po,q,Dr,Po,hs,ps,Ds,Er,pt,nr,ht,pr,Oe,xe,Fe,Rn,xs,sr,To,Xs,Eo,wr,ue,pe,X,Tr,ft,Cr,br,nt,tt,ln,lt,Ur,Fo,ao,Uo].forEach(r=>this.disposeWithMe(this._commandService.registerCommand(r))),this._configService.setConfig(Wr,cl)}};pn=hl([Ls(0,i.ICommandService),Ls(1,i.IConfigService),Ls(2,i.Optional(Si.DataSyncPrimaryController))],pn);var gl=Object.getOwnPropertyDescriptor,Rl=(s,e,t,n)=>{for(var o=n>1?void 0:n?gl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Vr=(s,e)=>(t,n)=>e(t,n,s);let wn=class extends i.Disposable{constructor(s,e){super(),this._univerInstanceService=s,this._commandService=e,this._initialize()}_initialize(){this.disposeWithMe(this._commandService.onCommandExecuted(s=>{if(s.id!==z.SetFormulaCalculationResultMutation.id)return;const e=s.params,{unitData:t}=e,n=Object.keys(t),o=[];for(let a=0;a<n.length;a++){const l=n[a],u=t[l];if(u==null)continue;const d=Object.keys(u);for(let c=0;c<d.length;c++){const m=d[c],h=u[m];if(h==null)continue;const R=this._getMergedCellData(l,m,h),S={subUnitId:m,unitId:l,cellValue:R};o.push({id:H.id,params:S})}}return o.every(a=>this._commandService.executeCommand(a.id,a.params,{onlyLocal:!0}))}))}_getMergedCellData(s,e,t){const n=this._univerInstanceService.getUniverSheetInstance(s),o=n==null?void 0:n.getStyles(),r=n==null?void 0:n.getSheetBySheetId(e),a=r==null?void 0:r.getCellMatrix(),l=new i.ObjectMatrix(t);return l.forValue((u,d,c)=>{const m=a==null?void 0:a.getValue(u,d),h=z.handleNumfmtInCell(m,c,o);l.setValue(u,d,h)}),l.getMatrix()}};wn=Rl([Vr(0,i.Inject(i.IUniverInstanceService)),Vr(1,i.ICommandService)],wn);const Sl="sheets.config",Lr={};var Cl=Object.getOwnPropertyDescriptor,fl=(s,e,t,n)=>{for(var o=n>1?void 0:n?Cl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},$r=(s,e)=>(t,n)=>e(t,n,s);const vl="SHEET_DEFINED_NAME_PLUGIN",Il="AllDefaultWorkbook";g.DefinedNameDataController=class extends i.Disposable{constructor(e,t){super(),this._definedNamesService=e,this._resourceManagerService=t,this._initialize()}_initialize(){this._initSnapshot()}_initSnapshot(){const e=n=>{const o=this._definedNamesService.getDefinedNameMap(n);return o?JSON.stringify(o):""},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:vl,businesses:[i.UniverInstanceType.UNIVER_SHEET],toJson:n=>e(n),parseJson:n=>t(n),onUnLoad:n=>{this._definedNamesService.removeUnitDefinedName(n)},onLoad:(n,o)=>{this._definedNamesService.registerDefinedNames(n,o)}}))}},g.DefinedNameDataController=fl([$r(0,z.IDefinedNamesService),$r(1,i.IResourceManagerService)],g.DefinedNameDataController);const D={MoveRangeCommandId:wo,InsertRowCommandId:ko,InsertColCommandId:Do,RemoveColCommandId:Ss,RemoveRowCommandId:gs,DeleteRangeMoveLeftCommandId:_o,DeleteRangeMoveUpCommandId:bo,InsertRangeMoveDownCommandId:Ca,InsertRangeMoveRightCommandId:ds,MoveColsCommandId:Ho,MoveRowsCommandId:Bo,ReorderRangeCommandId:qo};var V=(s=>(s[s.Set=0]="Set",s[s.Delete=1]="Delete",s[s.HorizontalMove=2]="HorizontalMove",s[s.VerticalMove=3]="VerticalMove",s[s.Unknown=4]="Unknown",s))(V||{});const Mn=Number.MAX_SAFE_INTEGER,_e=s=>{const e={...s},t=Number.isNaN(e.startRow)&&Number.isNaN(e.endRow)&&!Number.isNaN(e.startColumn)&&!Number.isNaN(e.endColumn),n=Number.isNaN(e.startColumn)&&Number.isNaN(e.endColumn)&&!Number.isNaN(e.startRow)&&!Number.isNaN(e.endRow);return(e.rangeType===i.RANGE_TYPE.COLUMN||t)&&(e.startRow=0,e.endRow=Mn),(e.rangeType===i.RANGE_TYPE.ROW||n)&&(e.startColumn=0,e.endColumn=Mn),e.rangeType===i.RANGE_TYPE.ALL&&(e.startColumn=0,e.endColumn=Mn,e.startRow=0,e.endRow=Mn),e},le=s=>{let e=s.rangeType;return s.rangeType===i.RANGE_TYPE.COLUMN?e=i.RANGE_TYPE.ROW:s.rangeType===i.RANGE_TYPE.ROW&&(e=i.RANGE_TYPE.COLUMN),{startRow:s.startColumn,endRow:s.endColumn,startColumn:s.startRow,endColumn:s.endRow,rangeType:e}},Ft=(s,e,t)=>{const n={...t},o={...e},r=(C,v)=>{const I=Math.max(C.start,v.start),w=Math.min(C.end,v.end);return w<I?null:{start:I,end:w}},a=C=>C.end-C.start+1,l=(C,v)=>({start:C.start-v.start,end:C.start-v.start+C.end-C.start}),u=(C,v)=>({start:v.start+C.start,end:v.start+C.start+C.end-C.start}),d=e.start>s.start;if(d){const C=Math.min(s.end,e.start)-s.start+1;o.start-=C,o.end-=C}const c=a(s),m=c,h=r(s,n),R=h&&a(h)>=a(n);if(s.end<n.start)n.start-=c,n.end-=c;else if(h){const C=a(h);if(R){const v=l(n,s),I=u(v,o);n.start=I.start,n.end=I.end}else h.start>s.start?d?(n.end-=C+c,n.start-=c):n.end-=C:d?n.end-=C:n.start>s.start&&n.end>s.end?(n.start-=c,n.end-=c+C):n.end-=C}const S=r(o,n);return R||(o.start<=n.start?(n.start+=m,n.end+=m):S&&(d?o.end<=n.start||o.start<=n.start&&o.end>=n.start?(n.start+=m,n.end+=m):o.start>=n.start&&o.start<=n.end&&(n.end+=m):n.start<o.start&&n.end>o.start?n.end+=m:(n.start>=o.end||n.start>=o.start&&n.start<=o.end)&&(n.end+=m,n.start+=m))),{step:n.start-t.start,length:a(n)-a(t)}},$s=(s,e)=>{const{fromRange:t,toRange:n}=s.params||{};if(!n||!t)return[];const o=_e(t),r=_e(n),a=_e(e),l=Ft({start:o.startRow,end:o.endRow},{start:r.startRow,end:r.endRow},{start:a.startRow,end:a.endRow});return l===null?[{type:V.Delete}]:[{type:V.VerticalMove,step:l.step||0,length:l.length||0}]},pl=(s,e)=>{const{fromRange:t,toRange:n}=s.params||{};if(!t||!n)return[e];const o=t.startRow,r=t.endRow-t.startRow+1,a=n.startRow,l=new i.ObjectMatrix;return i.Range.foreach(e,(d,c)=>{l.setValue(d,c,1)}),l.moveRows(o,r,a),i.queryObjectMatrix(l,d=>d===1)},wl=(s,e)=>{const{range:t,order:n}=s.params||{};if(!t||!n)return[e];const o=new i.ObjectMatrix;i.Range.foreach(e,(l,u)=>{o.setValue(l,u,1)});const r=new i.ObjectMatrix;return i.Range.foreach(t,(l,u)=>{var d;if(n.hasOwnProperty(l)){const c=n[l],m=(d=o.getValue(c,u))!=null?d:0;r.setValue(l,u,m)}}),r.forValue((l,u,d)=>{o.setValue(l,u,d)}),i.queryObjectMatrix(o,l=>l===1)},Bs=(s,e)=>{const{fromRange:t,toRange:n}=s.params||{};if(!n||!t)return[];const o=_e(t),r=_e(n),a=_e(e),l=Ft({start:o.startColumn,end:o.endColumn},{start:r.startColumn,end:r.endColumn},{start:a.startColumn,end:a.endColumn});return l===null?[{type:V.Delete}]:[{type:V.HorizontalMove,step:l.step||0,length:l.length||0}]},Ml=(s,e)=>{const{fromRange:t,toRange:n}=s.params||{};if(!t||!n)return[e];const o=t.startColumn,r=t.endColumn-t.startColumn+1,a=n.startColumn,l=new i.ObjectMatrix;return i.Range.foreach(e,(u,d)=>{l.setValue(u,d,1)}),l.moveColumns(o,r,a),i.queryObjectMatrix(l,u=>u===1)},Br=(s,e)=>{var r,a;const t=(r=s.params)==null?void 0:r.toRange,n=(a=s.params)==null?void 0:a.fromRange;if(!t||!n)return[];const o=[];if(i.Rectangle.contains(t,e)&&o.push({type:V.Delete}),i.Rectangle.contains(n,e)){o.push({type:V.Delete});const l=i.Rectangle.getRelativeRange(e,n),u=i.Rectangle.getPositionRange(l,t);return[{type:V.Set,range:u}]}return o},yl=(s,e)=>{var m,h;const t=(m=s.params)==null?void 0:m.toRange,n=(h=s.params)==null?void 0:h.fromRange;if(!t||!n)return[e];if(!i.Rectangle.intersects(n,e)&&!i.Rectangle.intersects(t,e))return[e];if(i.Rectangle.contains(n,e)){const R=i.Rectangle.getRelativeRange(e,n);return[i.Rectangle.getPositionRange(R,t)]}const o=new i.ObjectMatrix;i.Range.foreach(e,(R,S)=>{o.setValue(R,S,1)});const r=new i.ObjectMatrix,a=i.Rectangle.getIntersects(n,e);a&&i.Range.foreach(a,(R,S)=>{o.getValue(R,S)&&(o.setValue(R,S,void 0),r.setValue(R,S,1))});const l=t.startColumn-n.startColumn,u=t.startRow-n.startRow,d={startColumn:t.startColumn-l,endColumn:t.endColumn-l,startRow:t.startRow-u,endRow:t.endRow-u};return d&&i.Range.foreach(d,(R,S)=>{var I;const C=R+u,v=S+l;o.setValue(C,v,(I=r.getValue(R,S))!=null?I:0)}),i.queryObjectMatrix(o,R=>R===1)},Ze=(s,e)=>{const t=_e(s),n=_e(e),o=a=>a.endColumn-a.startColumn+1,r=a=>a.endRow-a.startRow+1;if(t.startRow<=n.startRow&&t.endRow>=n.endRow){if(n.startColumn<t.startColumn&&n.endColumn>=t.startColumn&&n.endColumn<=t.endColumn||n.startColumn<t.startColumn&&n.endColumn>=t.endColumn){const a=i.Rectangle.getIntersects(n,t);if(a)return{step:0,length:-o(a)}}if(n.startColumn>=t.startColumn&&n.endColumn<=t.endColumn&&r(t)>=r(n))return null;if(n.startColumn>=t.startColumn&&n.startColumn<=t.endColumn&&n.endColumn>t.endColumn){const a=i.Rectangle.getIntersects(n,t);if(a){const l=-o(a);return{step:-(o(t)-o(a)),length:l}}}if(n.startColumn>t.endColumn)return{step:-o(t),length:0}}return{step:0,length:0}},Hs=(s,e)=>{var r;const t=(r=s.params)==null?void 0:r.range;if(!t)return[];const n=[],o=Ze(t,e);if(!o)n.push({type:V.Delete});else{const{step:a,length:l}=o;n.push({type:V.HorizontalMove,step:a,length:l})}return n},Hr=(s,e)=>{var r;const t=(r=s.params)==null?void 0:r.range;if(!t)return[];const n=[],o=Ze(le(t),le(e));if(!o)n.push({type:V.Delete});else{const{step:a,length:l}=o;n.push({type:V.VerticalMove,step:a,length:l})}return n},_l=(s,e)=>{const{range:t,order:n}=s.params||{};if(!t||!n)return[];if(i.Rectangle.contains(t,e)&&e.endRow===e.startRow){const o=[],r=e.startRow;for(const a in n)if(n[a]===r){const l=Number(a);return o.push({type:V.VerticalMove,step:l-r,length:0}),o}return[]}return[]},Qe=(s,e)=>{const t=_e(s),n=_e(e),o=r=>r.endColumn-r.startColumn+1;if(t.startRow<=n.startRow&&t.endRow>=n.endRow){if(n.startColumn<t.startColumn&&n.endColumn>=t.startColumn&&n.endColumn<=t.endColumn||n.startColumn<t.startColumn&&n.endColumn>=t.endColumn)return{step:0,length:o(t)};if(n.startColumn>=t.startColumn&&n.endColumn<=t.endColumn||n.startColumn>t.startColumn&&n.startColumn<=t.endColumn&&n.endColumn>t.endColumn||n.startColumn>=t.endColumn)return{step:o(t),length:0}}return{step:0,length:0}};function bl(s,e,t){const n=[];if(i.Rectangle.contains(e,t)&&n.push({type:V.Delete}),i.Rectangle.contains(s,t)){n.push({type:V.Delete});const o=i.Rectangle.getRelativeRange(t,s),r=i.Rectangle.getPositionRange(o,e);return[{type:V.Set,range:r}]}return n}const jr=(s,e)=>{var l;const t=(l=s.params)==null?void 0:l.range;if(!t)return[];const n=[],o=Qe(le(t),le(e)),{step:r,length:a}=o;return n.push({type:V.VerticalMove,step:r,length:a}),n},Fr=(s,e)=>{var l;const t=(l=s.params)==null?void 0:l.range;if(!t)return[];const n=[],o=Qe(t,e),{step:r,length:a}=o;return n.push({type:V.HorizontalMove,step:r,length:a}),n},Gr=(s,e)=>{var l;const t=(l=s.params)==null?void 0:l.range;if(!t)return[];const n=[],o=Qe(le(t),le(e)),{step:r,length:a}=o;return n.push({type:V.VerticalMove,step:r,length:a}),n},Tl=(s,e)=>{var u;const t=(u=s.params)==null?void 0:u.range;if(!t)return[e];const n=t.endRow-t.startRow+1,o={...t,startRow:t.startRow,endRow:Number.POSITIVE_INFINITY},r=i.Rectangle.subtract(e,o),a=i.Rectangle.getIntersects(o,e);if(!a)return[e];const l=new i.ObjectMatrix;return r.forEach(d=>{i.Range.foreach(d,(c,m)=>{l.setValue(c,m,1)})}),a&&i.Range.foreach(a,(d,c)=>{l.setValue(d+n,c,1)}),i.queryObjectMatrix(l,d=>d===1)},zr=(s,e)=>{var l;const t=(l=s.params)==null?void 0:l.range;if(!t)return[];const n=[],o=Qe(t,e),{step:r,length:a}=o;return n.push({type:V.HorizontalMove,step:r,length:a}),n},El=(s,e)=>{var u;const t=(u=s.params)==null?void 0:u.range;if(!t)return[e];const n=t.endColumn-t.startColumn+1,o={...t,startColumn:t.startColumn,endColumn:Number.POSITIVE_INFINITY},r=i.Rectangle.subtract(e,o),a=i.Rectangle.getIntersects(o,e);if(!a)return[e];const l=new i.ObjectMatrix;return r.forEach(d=>{i.Range.foreach(d,(c,m)=>{l.setValue(c,m,1)})}),a&&i.Range.foreach(a,(d,c)=>{l.setValue(d,c+n,1)}),i.queryObjectMatrix(l,d=>d===1)},qr=(s,e)=>{var r;const t=(r=s.params)==null?void 0:r.range;if(!t)return[];const n=[],o=Ze(t,e);if(!o)n.push({type:V.Delete});else{const{step:a,length:l}=o;n.push({type:V.HorizontalMove,step:a,length:l})}return n},Ul=(s,e)=>{var d;const t=(d=s.params)==null?void 0:d.range;if(!t)return[e];const n={startRow:t.startRow,endRow:t.endRow,startColumn:t.startColumn,endColumn:Number.POSITIVE_INFINITY},o=t.endColumn-t.startColumn+1,r=i.Rectangle.getIntersects(t,e),a=i.Rectangle.subtract(e,n),l=i.Rectangle.getIntersects(n,e);if(!r&&!l)return[e];const u=new i.ObjectMatrix;return l&&i.Range.foreach(l,(c,m)=>{u.setValue(c,m-o,1)}),r&&i.Range.foreach(r,(c,m)=>{u.setValue(c,m-o,0)}),a.forEach(c=>{i.Range.foreach(c,(m,h)=>{u.setValue(m,h,1)})}),i.queryObjectMatrix(u,c=>c===1)},Yr=(s,e)=>{var r;const t=(r=s.params)==null?void 0:r.range;if(!t)return[];const n=[],o=Ze(le(t),le(e));if(!o)n.push({type:V.Delete});else{const{step:a,length:l}=o;n.push({type:V.VerticalMove,step:a,length:l})}return n},Pl=(s,e)=>{var d;const t=(d=s.params)==null?void 0:d.range;if(!t)return[e];const n={...t,startRow:t.startRow,endRow:Number.POSITIVE_INFINITY},o=t.endRow-t.startRow+1,r=i.Rectangle.getIntersects(t,e),a=i.Rectangle.subtract(e,n),l=i.Rectangle.getIntersects(n,e);if(!r&&!l)return[e];const u=new i.ObjectMatrix;return l&&i.Range.foreach(l,(c,m)=>{u.setValue(c-o,m,1)}),r&&i.Range.foreach(r,(c,m)=>{u.setValue(c-o,m,0)}),a.forEach(c=>{i.Range.foreach(c,(m,h)=>{u.setValue(m,h,1)})}),i.queryObjectMatrix(u,c=>c===1)},kl=(s,e)=>{var o;const t=(o=s.ranges)!=null?o:[s.range],n=new i.ObjectMatrix;return i.Range.foreach(e,(r,a)=>{n.setValue(r,a,1)}),t.forEach(r=>{const a=r.startRow,u=r.endRow-a+1;n.removeRows(a,u)}),i.queryObjectMatrix(n,r=>r===1)},Nl=(s,e)=>{const t=s.params,n=t.range.startRow,o=t.range.endRow-t.range.startRow+1,r=t.direction;return r===i.Direction.UP&&n===e.startRow||r===i.Direction.DOWN&&n-1===e.endRow?[{startRow:e.startRow,endRow:e.endRow+o,startColumn:e.startColumn,endColumn:e.endColumn}]:e.startRow>=n?[{startRow:e.startRow+o,endRow:e.endRow+o,startColumn:e.startColumn,endColumn:e.endColumn}]:e.endRow<=n?[e]:[{startRow:e.startRow,endRow:e.endRow+o,startColumn:e.startColumn,endColumn:e.endColumn}]},Ol=(s,e)=>{const t=s.params,n=t.range.startColumn,o=t.range.endColumn-t.range.startColumn+1,r=t.direction;return r===i.Direction.LEFT&&n===e.startColumn||r===i.Direction.RIGHT&&n-1===e.endColumn?[{startRow:e.startRow,endRow:e.endRow,startColumn:e.startColumn,endColumn:e.endColumn+o}]:e.startColumn>=n?[{startRow:e.startRow,endRow:e.endRow,startColumn:e.startColumn+o,endColumn:e.endColumn+o}]:e.endColumn<=n?[e]:[{startRow:e.startRow,endRow:e.endRow,startColumn:e.startColumn,endColumn:e.endColumn+o}]},et=(s,e)=>{let t={...e};return s.forEach(n=>{switch(n.type){case V.Delete:{t=null;break}case V.HorizontalMove:{if(!t)return;t.startColumn+=n.step,t.endColumn+=n.step+(n.length||0);break}case V.VerticalMove:{if(!t)return;t.startRow+=n.step,t.endRow+=n.step+(n.length||0);break}case V.Set:{t=n.range;break}}}),t&&(t.endColumn<t.startColumn||t.endRow<t.startRow)?null:t},js=(s,e)=>{let t=[];switch(e.id){case D.DeleteRangeMoveLeftCommandId:{t=qr(e,s);break}case D.DeleteRangeMoveUpCommandId:{t=Yr(e,s);break}case D.InsertColCommandId:{t=Fr(e,s);break}case D.InsertRangeMoveDownCommandId:{t=Gr(e,s);break}case D.InsertRangeMoveRightCommandId:{t=zr(e,s);break}case D.InsertRowCommandId:{t=jr(e,s);break}case D.MoveColsCommandId:{t=Bs(e,s);break}case D.MoveRangeCommandId:{t=Br(e,s);break}case D.MoveRowsCommandId:{t=$s(e,s);break}case D.RemoveColCommandId:{t=Hs(e,s);break}case D.RemoveRowCommandId:{t=Hr(e,s);break}case D.ReorderRangeCommandId:{t=_l(e,s);break}}return et(t,s)},Dl=(s,e,t)=>[Ye.id,Ke.id].includes(e.id)||Jr(e,t).some(r=>i.Rectangle.intersects(r,s))?js(s,e):s,Fs=(s,e)=>{let t=[];switch(e.id){case D.DeleteRangeMoveLeftCommandId:return Ul(e,s);case D.DeleteRangeMoveUpCommandId:return Pl(e,s);case D.InsertRangeMoveDownCommandId:return Tl(e,s);case D.InsertRangeMoveRightCommandId:return El(e,s);case D.InsertColCommandId:return Ol(e,s);case D.InsertRowCommandId:return Nl(e,s);case D.MoveColsCommandId:return Ml(e,s);case D.MoveRangeCommandId:return yl(e,s);case D.MoveRowsCommandId:return pl(e,s);case D.ReorderRangeCommandId:return wl(e,s);case D.RemoveColCommandId:{t=Hs(e,s);break}case D.RemoveRowCommandId:return kl(e.params,s)}const n=et(t,s);return n?[n]:[]},Al=(s,e,t)=>[Ye.id,Ke.id,at.id,ds].includes(e.id)||Jr(e,t).some(r=>i.Rectangle.intersects(r,s))?Fs(s,e):s;function Kr(s,e){const{id:t,params:n}=e;let o={length:0,step:0,type:V.Unknown};switch(t){case ze.id:o.type=V.Delete;break;case Ue.id:o=Ft({start:n.sourceRange.startRow,end:n.sourceRange.endRow},{start:n.targetRange.startRow,end:n.targetRange.endRow},{start:s.startRow,end:s.endRow}),o.type=V.VerticalMove;break;case Pe.id:o=Ft({start:n.sourceRange.startColumn,end:n.sourceRange.endColumn},{start:n.targetRange.startColumn,end:n.targetRange.endColumn},{start:s.startColumn,end:s.endColumn}),o.type=V.HorizontalMove;break;case re.id:o=Ze(n.range,s),o?o.type=V.HorizontalMove:o={step:0,length:0,type:V.Delete};break;case Ce.id:o=Ze(le(n.range),le(s)),o?o.type=V.VerticalMove:o={step:0,length:0,type:V.Delete};break;case Se.id:o=Qe(le(n.range),le(s)),o.type=V.VerticalMove;break;case de.id:o=Qe(n.range,s),o.type=V.HorizontalMove;break;case Ae.id:{const r=n.fromRange||new i.ObjectMatrix(n.from).getRange(),a=n.toRange||new i.ObjectMatrix(n.to).getRange();o=bl(r,a,s)}break}return o?Array.isArray(o)?et(o,s):et([o],s):s}function Jr(s,e){var n,o,r,a,l,u;const{selectionManagerService:t}=e;switch(s.id){case D.MoveColsCommandId:{const d=s.params;return[d.fromRange,{...d.toRange,startColumn:d.toRange.startColumn-.5,endColumn:d.toRange.endColumn-.5}]}case D.MoveRowsCommandId:{const d=s.params;return[d.fromRange,{...d.toRange,startRow:d.toRange.startRow-.5,endRow:d.toRange.startRow-.5}]}case D.MoveRangeCommandId:{const d=s;return[d.params.fromRange,d.params.toRange]}case D.InsertRowCommandId:{const c=s.params.range;return[{...c,startRow:c.startRow-.5,endRow:c.endRow-.5}]}case D.InsertColCommandId:{const c=s.params.range;return[{...c,startColumn:c.startColumn-.5,endColumn:c.endColumn-.5}]}case D.RemoveRowCommandId:return[s.params.range];case D.RemoveColCommandId:return[s.params.range];case D.DeleteRangeMoveUpCommandId:case D.InsertRangeMoveDownCommandId:{const c=((n=s.params)==null?void 0:n.range)||((r=(o=t.getCurrentSelections())==null?void 0:o.map(m=>m.range))==null?void 0:r[0]);return c?[c]:[]}case D.DeleteRangeMoveLeftCommandId:case D.InsertRangeMoveRightCommandId:{const c=((a=s.params)==null?void 0:a.range)||((u=(l=t.getCurrentSelections())==null?void 0:l.map(m=>m.range))==null?void 0:u[0]);return c?[c]:[]}case D.ReorderRangeCommandId:{const d=s,{range:c,order:m}=d.params,h=[];for(let R=c.startRow;R<=c.endRow;R++)R in m&&h.push({startRow:R,endRow:R,startColumn:c.startColumn,endColumn:c.endColumn});return h}}}function Wl(s){switch(s.id){case Pe.id:{const e=s.params;return[e.sourceRange,{...e.targetRange,startColumn:e.targetRange.startColumn-.5,endColumn:e.targetRange.startColumn-.5}]}case Ue.id:{const e=s.params;return[e.sourceRange,{...e.targetRange,startRow:e.targetRange.startRow-.5,endRow:e.targetRange.startRow-.5}]}case Ae.id:{const e=s.params;return[new i.ObjectMatrix(e.from.value).getRange(),new i.ObjectMatrix(e.to.value).getRange()]}case de.id:{const t=s.params.range;return[{...t,startColumn:t.startColumn-.5,endColumn:t.startColumn-.5}]}case Se.id:{const t=s.params.range;return[{...t,startRow:t.startRow-.5,endRow:t.startRow-.5}]}case re.id:return[s.params.range];case Ce.id:return[s.params.range]}}function Vl(s,e){var o,r,a,l,u,d;const t=s.get(i.IUniverInstanceService),n=s.get(g.SheetsSelectionsService);switch(e.id){case D.MoveColsCommandId:{const c=e.params,m=U(t,{unitId:c.unitId,subUnitId:c.subUnitId});return{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[c.fromRange,{...c.toRange,startColumn:c.fromRange.startColumn<c.toRange.startColumn?c.fromRange.endColumn+1:c.toRange.startColumn,endColumn:c.fromRange.startColumn<c.toRange.startColumn?c.toRange.endColumn-1:c.fromRange.startColumn-1}]}}case D.MoveRowsCommandId:{const c=e.params,m=U(t,{unitId:c.unitId,subUnitId:c.subUnitId});return{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[c.fromRange,{...c.toRange,startRow:c.fromRange.startRow<c.toRange.startRow?c.fromRange.endRow+1:c.toRange.startRow,endRow:c.fromRange.startRow<c.toRange.startRow?c.toRange.endRow-1:c.fromRange.startRow-1}]}}case D.MoveRangeCommandId:{const c=e.params,m=U(t);return{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[c.fromRange,c.toRange]}}case D.InsertRowCommandId:{const c=e.params,m=c.range;return{unitId:c.unitId,subUnitId:c.subUnitId,ranges:[...m.startRow>0?[{...m,startRow:m.startRow-1,endRow:m.endRow-1}]:[],{...m,startRow:m.startRow,endRow:Number.MAX_SAFE_INTEGER}]}}case D.InsertColCommandId:{const c=e.params,m=c.range;return{unitId:c.unitId,subUnitId:c.subUnitId,ranges:[...m.startColumn>0?[{...m,startColumn:m.startColumn-1,endColumn:m.endColumn-1}]:[],{...m,startColumn:m.startColumn,endColumn:Number.MAX_SAFE_INTEGER}]}}case D.RemoveRowCommandId:{const m=e.params.range,h=U(t);return{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[m,{...m,startRow:m.endRow+1,endRow:Number.MAX_SAFE_INTEGER}]}}case D.RemoveColCommandId:{const m=e.params.range,h=U(t);return{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[m,{...m,startColumn:m.endColumn+1,endColumn:Number.MAX_SAFE_INTEGER}]}}case D.DeleteRangeMoveUpCommandId:case D.InsertRangeMoveDownCommandId:{const c=e,m=U(t),h=((o=c.params)==null?void 0:o.range)||((a=(r=n.getCurrentSelections())==null?void 0:r.map(R=>R.range))==null?void 0:a[0]);return h?{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[h,{...h,startRow:h.endRow+1,endRow:Number.MAX_SAFE_INTEGER}]}:{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[]}}case D.DeleteRangeMoveLeftCommandId:case D.InsertRangeMoveRightCommandId:{const m=((l=e.params)==null?void 0:l.range)||((d=(u=n.getCurrentSelections())==null?void 0:u.map(R=>R.range))==null?void 0:d[0]),h=U(t);return m?{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[m,{...m,startColumn:m.endColumn+1,endColumn:Number.MAX_SAFE_INTEGER}]}:{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[]}}case D.ReorderRangeCommandId:{const c=e,{range:m,order:h}=c.params,R=[];for(let C=m.startRow;C<=m.endRow;C++)C in h&&R.push({startRow:C,endRow:C,startColumn:m.startColumn,endColumn:m.endColumn});const S=U(t);return{unitId:S.unitId,subUnitId:S.subUnitId,ranges:R}}}}var Ll=Object.getOwnPropertyDescriptor,$l=(s,e,t,n)=>{for(var o=n>1?void 0:n?Ll(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},yn=(s,e)=>(t,n)=>e(t,n,s);const Bl=i.createInterceptorKey("MERGE_REDO"),Hl=i.createInterceptorKey("MERGE_UNDO"),xr=Math.floor(Number.MAX_SAFE_INTEGER/10);class jl extends i.Disposable{constructor(e,t,n,o,r=!1){super(),this._unitId=e,this._subUnitId=t,this._range=n,this._callback=o,this._skipIntersects=r}onMutation(e){var o,r;if(((o=e.params)==null?void 0:o.unitId)!==this._unitId)return;if(e.id===Ae.id){const a=e.params;if(a.from.subUnitId!==this._subUnitId||a.to.subUnitId!==this._subUnitId)return}else if(((r=e.params)==null?void 0:r.subUnitId)!==this._subUnitId)return;if(!this._range)return;if(this._skipIntersects){if(e.id===ze.id)return;const a=Wl(e);if(a!=null&&a.some(l=>i.Rectangle.intersects(l,this._range)))return}const t=Kr(this._range,e);if(t&&i.Rectangle.equals(t,this._range))return!1;const n=this._range;this._range=t,this._callback(n,t)}}g.RefRangeService=class extends i.Disposable{constructor(t,n,o,r){super();f(this,"interceptor",new i.InterceptorManager({MERGE_REDO:Bl,MERGE_UNDO:Hl}));f(this,"_watchRanges",new Set);f(this,"_refRangeManagerMap",new Map);f(this,"_serializer",Fl());f(this,"_onRefRangeChange",()=>{this._sheetInterceptorService.interceptCommand({getMutations:t=>{const n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet(),o=Xr(this._univerInstanceService),r=Zr(this._univerInstanceService);if(!n||!o||!r)return{redos:[],undos:[],preRedos:[],preUndos:[]};const u=((()=>{switch(t.id){case D.MoveColsCommandId:{const R=t.params,S=Math.min(R.fromRange.startColumn,R.toRange.startColumn);return this._checkRange([{...R.fromRange,startColumn:S,endColumn:n.getColumnCount()-1}],o,r)}case D.MoveRowsCommandId:{const R=t.params,S=Math.min(R.fromRange.startRow,R.toRange.startRow);return this._checkRange([{...R.fromRange,startRow:S,endRow:n.getRowCount()-1}],o,r)}case D.MoveRangeCommandId:{const R=t;return this._checkRange([R.params.fromRange,R.params.toRange],o,r)}case D.InsertRowCommandId:{const C={startRow:t.params.range.startRow,endRow:n.getRowCount()-1,startColumn:0,endColumn:n.getColumnCount()-1,rangeType:i.RANGE_TYPE.ROW};return this._checkRange([C],o,r)}case D.InsertColCommandId:{const S=t.params.range.startColumn,C={startRow:0,endRow:n.getRowCount()-1,startColumn:S,endColumn:n.getColumnCount()-1,rangeType:i.RANGE_TYPE.COLUMN};return this._checkRange([C],o,r)}case D.RemoveRowCommandId:{const C={startRow:t.params.range.startRow,endRow:n.getRowCount()-1,startColumn:0,endColumn:n.getColumnCount()-1,rangeType:i.RANGE_TYPE.ROW};return this._checkRange([C],o,r)}case D.RemoveColCommandId:{const S=t.params.range.startColumn,C={startRow:0,endRow:n.getRowCount()-1,startColumn:S,endColumn:n.getColumnCount()-1,rangeType:i.RANGE_TYPE.COLUMN};return this._checkRange([C],o,r)}case D.DeleteRangeMoveUpCommandId:case D.InsertRangeMoveDownCommandId:{const S=t.params.range||Qr(this._selectionManagerService)[0],C={startRow:S.startRow,startColumn:S.startColumn,endColumn:S.endColumn,endRow:xr};return this._checkRange([C],o,r)}case D.DeleteRangeMoveLeftCommandId:case D.InsertRangeMoveRightCommandId:{const S=t.params.range||Qr(this._selectionManagerService)[0],C={startRow:S.startRow,startColumn:S.startColumn,endColumn:xr,endRow:S.endRow};return this._checkRange([C],o,r)}case D.ReorderRangeCommandId:{const R=t,{range:S,order:C}=R.params,v=[];for(let I=S.startRow;I<=S.endRow;I++)I in C&&v.push({startRow:I,endRow:I,startColumn:S.startColumn,endColumn:S.endColumn});return this._checkRange(v,o,r)}}})()||[]).reduce((R,S)=>{const C=S(t);return R.push(C),R},[]).reduce((R,S)=>{var C,v;return R.redos.push(...S.redos),R.undos.push(...S.undos),R.preRedos.push(...(C=S.preRedos)!=null?C:[]),R.preUndos.push(...(v=S.preUndos)!=null?v:[]),R},{redos:[],undos:[],preUndos:[],preRedos:[]}),d=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_REDO)(u.preRedos,null)||[],c=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_REDO)(u.redos,null)||[],m=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_UNDO)(u.preUndos,null)||[],h=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_UNDO)(u.undos,null)||[];return{redos:c,undos:h,preRedos:d,preUndos:m}}})});f(this,"_checkRange",(t,n,o)=>{const r=ei(n,o),a=this._refRangeManagerMap.get(r);if(a){const l=new Set;return[...a.keys()].forEach(d=>{const c=a.get(d),m=this._serializer.deserialize(d),h={...m,startRow:+m.startRow,endRow:+m.endRow,startColumn:+m.startColumn,endColumn:+m.endColumn,rangeType:m.rangeType&&+m.rangeType};t.some(R=>i.Rectangle.intersects(R,h))&&c&&c.forEach(R=>{l.add(R)})}),[...l]}return[]});f(this,"registerRefRange",(t,n,o,r)=>{const a=o||Xr(this._univerInstanceService),l=r||Zr(this._univerInstanceService);if(!a||!l)return i.toDisposable(()=>{});const u=ei(a,l),d=this._serializer.serialize(t);let c=this._refRangeManagerMap.get(u);c||(c=new Map,this._refRangeManagerMap.set(u,c));const m=c.get(d);return m?m.add(n):c.set(d,new Set([n])),i.toDisposable(()=>{const h=c.get(d);h&&(h.delete(n),h.size||(c.delete(d),c.size||this._refRangeManagerMap.delete(u)))})});this._commandService=t,this._sheetInterceptorService=n,this._univerInstanceService=o,this._selectionManagerService=r,this._onRefRangeChange(),this.interceptor.intercept(this.interceptor.getInterceptPoints().MERGE_REDO,{priority:-1,handler:a=>a}),this.interceptor.intercept(this.interceptor.getInterceptPoints().MERGE_UNDO,{priority:-1,handler:a=>a})}watchRange(t,n,o,r,a){let l;this._watchRanges.size===0&&(l=this._commandService.onCommandExecuted(m=>{if(m.type!==i.CommandType.MUTATION)return!1;for(const h of this._watchRanges)h.onMutation(m)}));const u=new jl(t,n,o,r,a);this._watchRanges.add(u);const d=i.toDisposable(()=>{this._watchRanges.delete(u),this._watchRanges.size===0&&(l==null||l.dispose(),l=null)}),c=this.disposeWithMe(d);return i.toDisposable(()=>{c.dispose(),d.dispose()})}},g.RefRangeService=$l([yn(0,i.ICommandService),yn(1,i.Inject(g.SheetInterceptorService)),yn(2,i.Inject(i.IUniverInstanceService)),yn(3,i.Inject(g.SheetsSelectionsService))],g.RefRangeService);function Xr(s){return s.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getUnitId()}function Zr(s){var e;return(e=s.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()}function Qr(s){var e;return((e=s.getCurrentSelections())==null?void 0:e.map(t=>t.range))||[]}function ei(s,e){return`${s}_${e}`}function Fl(){const s=["startRow","startColumn","endRow","endColumn","rangeType"],e="_";return{deserialize:t=>{const n=s.reduce((r,a,l)=>(r[String(l)]=a,r),{});return t.split(e).reduce((r,a,l)=>{const u=String(l);return a&&n[u]&&(r[n[u]]=a),r},{})},serialize:t=>s.reduce((n,o,r)=>{const a=t[o];return a!==void 0?`${n}${r>0?e:""}${a}`:`${n}`},"")}}var Gl=Object.getOwnPropertyDescriptor,zl=(s,e,t,n)=>{for(var o=n>1?void 0:n?Gl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},wt=(s,e)=>(t,n)=>e(t,n,s);const ql=[de.id,Se.id,re.id,Ce.id],Yl=[Ue.id,Pe.id];function Gs(s,e){let t=s;if(e!==void 0){const n=[];for(let o=0;o<t.length;o++){const{startRow:r,endRow:a,startColumn:l,endColumn:u}=t[o];if(e===i.Dimension.ROWS)for(let d=r;d<=a;d++){const c={startRow:d,endRow:d,startColumn:l,endColumn:u};n.push(c)}else if(e===i.Dimension.COLUMNS)for(let d=l;d<=u;d++){const c={startRow:r,endRow:a,startColumn:d,endColumn:d};n.push(c)}}t=n}return t}const ti=i.createInterceptorKey("mergeCellPermissionCheck");g.MergeCellController=class extends i.Disposable{constructor(t,n,o,r,a,l){super();f(this,"disposableCollection",new i.DisposableCollection);f(this,"interceptor",new i.InterceptorManager({MERGE_CELL_INTERCEPTOR_CHECK:ti}));this._commandService=t,this._refRangeService=n,this._univerInstanceService=o,this._injector=r,this._sheetInterceptorService=a,this._selectionManagerService=l,this._onRefRangeChange(),this._initCommandInterceptor(),this._commandExecutedListener()}_initCommandInterceptor(){const t=this;this._sheetInterceptorService.interceptCommand({getMutations(n){var o;switch(n.id){case Xt.id:case Qt.id:{const r=t._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),a=r.getUnitId(),l=r==null?void 0:r.getActiveSheet();if(!l)return{redos:[],undos:[]};const u=l.getSheetId(),d=l.getConfig().mergeData,c=(o=t._selectionManagerService.getCurrentSelections())==null?void 0:o.map(m=>m.range);if(c&&c.length>0&&c.some(h=>d.some(R=>i.Rectangle.intersects(R,h)))){const h={unitId:a,subUnitId:u,ranges:c},R=ne(t._injector,h),S=[{id:G.id,params:h}],C=[{id:F.id,params:R}];return{redos:S,undos:C}}}}return{redos:[],undos:[]}}}),this._sheetInterceptorService.interceptRanges({getMutations:({unitId:n,subUnitId:o,ranges:r})=>{const a=[],l=[],u={redos:a,undos:l};if(!r||!r.length)return u;const d=U(this._univerInstanceService,{unitId:n,subUnitId:o});if(!d)return u;const{worksheet:c}=d,h=c.getMergeData().filter(R=>r.some(S=>i.Rectangle.intersects(R,S)));return h.length?(a.push({id:G.id,params:{unitId:n,subUnitId:o,ranges:h}}),l.push({id:F.id,params:{unitId:n,subUnitId:o,ranges:h}}),{undos:l,redos:a}):u}})}refRangeHandle(t,n,o){switch(t.id){case D.MoveColsCommandId:{const r=t.params;return this._handleMoveColsCommand(r,n,o)}case D.MoveRowsCommandId:{const r=t.params;return this._handleMoveRowsCommand(r,n,o)}case We.id:{const r=t.params,a=r.unitId||n,l=r.subUnitId||o;return this._handleInsertRowCommand(r,a,l)}case Ve.id:{const r=t.params,a=r.unitId||n,l=r.subUnitId||o;return this._handleInsertColCommand(r,a,l)}case At.id:{const r=t.params;return this._handleRemoveColCommand(r,n,o)}case Dt.id:{const r=t.params;return this._handleRemoveRowCommand(r,n,o)}case qe.id:{const r=t.params;return this._handleMoveRangeCommand(r,n,o)}case kt.id:{const r=t.params;return this._handleInsertRangeMoveRightCommand(r,n,o)}case at.id:{const r=t.params;return this._handleInsertRangeMoveDownCommand(r,n,o)}case Ke.id:{const r=t.params;return this._handleDeleteRangeMoveUpCommand(r,n,o)}case Ye.id:{const r=t.params;return this._handleDeleteRangeMoveLeftCommand(r,n,o)}}return{redos:[],undos:[]}}_onRefRangeChange(){const t=(n,o)=>{const r=this._univerInstanceService.getUniverSheetInstance(n);if(!r)return;const a=r==null?void 0:r.getSheetBySheetId(o);if(!a)return;this.disposableCollection.dispose();const l=a.getMergeData(),u=d=>this.refRangeHandle(d,n,o);l.forEach(d=>{this.disposableCollection.add(this._refRangeService.registerRefRange(d,u,n,o))})};this.disposeWithMe(this._commandService.onCommandExecuted(n=>{if(n.id===Ct.id){const o=n.params,r=o.subUnitId,a=o.unitId;if(!r||!a)return;t(a,r)}if(n.id===F.id){const o=n.params,r=o.subUnitId,a=o.unitId;if(!r||!a)return;t(o.unitId,o.subUnitId)}})),this._univerInstanceService.getCurrentTypeOfUnit$(i.UniverInstanceType.UNIVER_SHEET).pipe(A.first(n=>!!n)).subscribe(n=>{const o=n.getActiveSheet();o&&t(n.getUnitId(),o.getSheetId())})}_handleMoveRowsCommand(t,n,o){const r=fe(this._univerInstanceService,n);if(!r)return this._handleNull();const a=ve(r,o);if(!a)return this._handleNull();const l=[...a.getMergeData()],u={unitId:n,subUnitId:o,ranges:[]},d={unitId:n,subUnitId:o,ranges:[]},{fromRange:c}=t,{startRow:m,endRow:h}=c;if(l.forEach(C=>{if(m<=C.startRow&&h>=C.endRow){u.ranges.push(C);const v=$s({id:D.MoveRowsCommandId,params:t},C),I=et(v,C);I&&d.ranges.push(I)}}),u.ranges.length===0)return this._handleNull();const R=ne(this._injector,u),S=he(this._injector,d);return{preRedos:[{id:G.id,params:u}],redos:[{id:F.id,params:d}],preUndos:[{id:G.id,params:S}],undos:[{id:F.id,params:R}]}}_handleMoveColsCommand(t,n,o){const r=fe(this._univerInstanceService,n);if(!r)return this._handleNull();const a=ve(r,o);if(!a)return this._handleNull();const l=[...a.getMergeData()],u={unitId:n,subUnitId:o,ranges:[]},d={unitId:n,subUnitId:o,ranges:[]},{fromRange:c}=t,{startColumn:m,endColumn:h}=c;if(l.forEach(C=>{if(m<=C.startColumn&&h>=C.endColumn){u.ranges.push(C);const v=Bs({id:D.MoveColsCommandId,params:t},C),I=et(v,C);I&&d.ranges.push(I)}}),u.ranges.length===0)return this._handleNull();const R=ne(this._injector,u),S=he(this._injector,d);return{preRedos:[{id:G.id,params:u}],redos:[{id:F.id,params:d}],preUndos:[{id:G.id,params:S}],undos:[{id:F.id,params:R}]}}_handleMoveRangeCommand(t,n,o){const r=fe(this._univerInstanceService,n);if(!r)return this._handleNull();const a=ve(r,o);if(!a)return this._handleNull();const l=a.getMergeData(),u=l.filter(S=>i.Rectangle.intersects(S,t.fromRange)),d=l.filter(S=>i.Rectangle.intersects(S,t.toRange)),c=u.map(S=>i.Rectangle.getRelativeRange(S,t.fromRange)).map(S=>i.Rectangle.getPositionRange(S,t.toRange)),m=Gs(c).filter(S=>!l.some(C=>i.Rectangle.equals(S,C))),h=[{id:G.id,params:{unitId:n,subUnitId:o,ranges:u}},{id:G.id,params:{unitId:n,subUnitId:o,ranges:d}},{id:F.id,params:{unitId:n,subUnitId:o,ranges:m}}],R=[{id:G.id,params:{unitId:n,subUnitId:o,ranges:m}},{id:F.id,params:{unitId:n,subUnitId:o,ranges:d}},{id:F.id,params:{unitId:n,subUnitId:o,ranges:u}}];return{redos:h,undos:R}}_handleInsertRowCommand(t,n,o){const r=fe(this._univerInstanceService,n);if(!r)return this._handleNull();const a=ve(r,o);if(!a)return this._handleNull();const{range:l}=t,{startRow:u,endRow:d}=l,c=i.Tools.deepClone(a.getMergeData()).reduce((w,p)=>(u>p.startRow&&u<=p.endRow&&w.push(p),w),[]);if(c.length===0)return this._handleNull();const m=i.Tools.deepClone(a.getMergeData()).reduce((w,p)=>{if(u>p.startRow&&u<=p.endRow){const M=d-u+1;p.endRow+=M,this._checkIsMergeCell(p)&&w.push(p)}return w},[]),h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=he(this._injector,S),v=[{id:G.id,params:h},{id:F.id,params:S}],I=[{id:G.id,params:C},{id:F.id,params:R}];return{redos:v,undos:I}}_handleInsertColCommand(t,n,o){const{range:r}=t,a=fe(this._univerInstanceService,n);if(!a)return this._handleNull();const l=ve(a,o);if(!l)return this._handleNull();const{startColumn:u,endColumn:d}=r,c=i.Tools.deepClone(l.getMergeData()).reduce((w,p)=>(u>p.startColumn&&u<=p.endColumn&&w.push(p),w),[]);if(c.length===0)return this._handleNull();const m=i.Tools.deepClone(l.getMergeData()).reduce((w,p)=>{if(u>p.startColumn&&u<=p.endColumn){const M=d-u+1;p.endColumn+=M,this._checkIsMergeCell(p)&&w.push(p)}return w},[]),h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=he(this._injector,S),v=[{id:G.id,params:h},{id:F.id,params:S}],I=[{id:G.id,params:C},{id:F.id,params:R}];return{redos:v,undos:I}}_handleRemoveColCommand(t,n,o){const r=fe(this._univerInstanceService,n);if(!r)return this._handleNull();const a=ve(r,o);if(!a)return this._handleNull();const{range:l}=t,{startColumn:u,endColumn:d}=l,c=i.Tools.deepClone(a.getMergeData()).reduce((M,y)=>(i.Rectangle.intersects(l,y)&&M.push(y),M),[]);if(c.length===0)return this._handleNull();const m=i.Tools.deepClone(a.getMergeData()).reduce((M,y)=>{if(i.Rectangle.intersects(l,y)){if(u<=y.startColumn&&d>=y.endColumn)return M;u>=y.startColumn&&d<=y.endColumn?y.endColumn-=d-u+1:u<y.startColumn?(y.startColumn=u,y.endColumn-=d-u+1):d>y.endColumn&&(y.endColumn=u-1),this._checkIsMergeCell(y)&&M.push(y)}return M},[]),h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=he(this._injector,S),v=[{id:G.id,params:h}],I=[{id:F.id,params:S}],w=[{id:G.id,params:C}],p=[{id:F.id,params:R}];return{preUndos:w,undos:p,preRedos:v,redos:I}}_handleRemoveRowCommand(t,n,o){const{range:r}=t,a=fe(this._univerInstanceService,n);if(!a)return this._handleNull();const l=ve(a,o);if(!l)return this._handleNull();const{startRow:u,endRow:d}=r,c=i.Tools.deepClone(l.getMergeData()).reduce((M,y)=>(i.Rectangle.intersects(r,y)&&M.push(y),M),[]);if(c.length===0)return this._handleNull();const m=i.Tools.deepClone(l.getMergeData()).reduce((M,y)=>{if(i.Rectangle.intersects(r,y)){if(u<=y.startRow&&d>=y.endRow)return M;u>=y.startRow&&d<=y.endRow?y.endRow-=d-u+1:u<y.startRow?(y.startRow=u,y.endRow-=d-u+1):d>y.endRow&&(y.endRow=u-1),this._checkIsMergeCell(y)&&M.push(y)}return M},[]),h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=he(this._injector,S),v=[{id:G.id,params:h}],I=[{id:F.id,params:S}],w=[{id:G.id,params:C}],p=[{id:F.id,params:R}];return{preUndos:w,undos:p,preRedos:v,redos:I}}_handleInsertRangeMoveRightCommand(t,n,o){const r=fe(this._univerInstanceService,n);if(!r)return this._handleNull();const a=ve(r,o);if(!a)return this._handleNull();const l=t.range,u=a.getMaxColumns()-1,d=a.getMergeData(),c=[],m=[];d.forEach(v=>{const{startRow:I,endRow:w,startColumn:p,endColumn:M}=l;if(i.Rectangle.intersects({startRow:I,startColumn:p,endRow:w,endColumn:u},v)&&(c.push(v),i.Rectangle.contains({startRow:I,startColumn:p,endRow:w,endColumn:u},v))){const k=M-p+1;m.push({startRow:v.startRow,startColumn:v.startColumn+k,endRow:v.endRow,endColumn:v.endColumn+k})}});const h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=he(this._injector,S);return{preRedos:[{id:G.id,params:h}],redos:[{id:F.id,params:S}],preUndos:[{id:G.id,params:C}],undos:[{id:F.id,params:R}]}}_handleInsertRangeMoveDownCommand(t,n,o){const r=fe(this._univerInstanceService,n);if(!r)return this._handleNull();const a=ve(r,o);if(!a)return this._handleNull();const l=t.range,u=a.getMaxRows()-1,d=a.getMergeData(),c=[],m=[];d.forEach(M=>{const{startRow:y,startColumn:b,endColumn:k,endRow:E}=l;if(i.Rectangle.intersects({startRow:y,startColumn:b,endRow:u,endColumn:k},M)&&(c.push(M),i.Rectangle.contains({startRow:y,startColumn:b,endRow:u,endColumn:k},M))){const N=E-y+1;m.push({startRow:M.startRow+N,startColumn:M.startColumn,endRow:M.endRow+N,endColumn:M.endColumn})}});const h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=he(this._injector,S),v=[{id:G.id,params:h}],I=[{id:F.id,params:S}],w=[{id:G.id,params:C}],p=[{id:F.id,params:R}];return{redos:I,undos:p,preRedos:v,preUndos:w}}_handleDeleteRangeMoveUpCommand(t,n,o){const r=fe(this._univerInstanceService,n);if(!r)return this._handleNull();const a=ve(r,o);if(!a)return this._handleNull();const l=t.range,u=a.getMaxRows()-1,d=a.getMergeData(),c=[],m=[];d.forEach(M=>{const{startRow:y,startColumn:b,endColumn:k,endRow:E}=l;if(i.Rectangle.intersects({startRow:y,startColumn:b,endRow:u,endColumn:k},M)&&(c.push(M),i.Rectangle.contains({startRow:y,startColumn:b,endRow:u,endColumn:k},M))){const N=E-y+1,W=i.Rectangle.moveVertical(M,-N);m.push(W)}});const h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=he(this._injector,S),v=[{id:G.id,params:h}],I=[{id:F.id,params:S}],w=[{id:G.id,params:C}],p=[{id:F.id,params:R}];return{redos:I,undos:p,preRedos:v,preUndos:w}}_handleDeleteRangeMoveLeftCommand(t,n,o){const r=fe(this._univerInstanceService,n);if(!r)return this._handleNull();const a=ve(r,o);if(!a)return this._handleNull();const l=t.range,u=a.getMaxColumns()-1,d=a.getMergeData(),c=[],m=[];d.forEach(v=>{const{startRow:I,endRow:w,startColumn:p,endColumn:M}=l;if(i.Rectangle.intersects({startRow:I,startColumn:p,endRow:w,endColumn:u},v)&&(c.push(v),i.Rectangle.contains({startRow:I,startColumn:p,endRow:w,endColumn:u},v))){const k=M-p+1;m.push({startRow:v.startRow,startColumn:v.startColumn-k,endRow:v.endRow,endColumn:v.endColumn-k})}});const h={unitId:n,subUnitId:o,ranges:c},R=ne(this._injector,h),S={unitId:n,subUnitId:o,ranges:m},C=he(this._injector,S);return{preRedos:[{id:G.id,params:h}],redos:[{id:F.id,params:S}],undos:[{id:F.id,params:R}],preUndos:[{id:G.id,params:C}]}}_checkIsMergeCell(t){return!(t.startRow===t.endRow&&t.startColumn===t.endColumn)}_handleNull(){return{redos:[],undos:[]}}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(Yl.includes(t.id)){if(!t.params)return;const n=this._univerInstanceService.getUniverSheetInstance(t.params.unitId);if(!n)return;const o=n.getSheetBySheetId(t.params.subUnitId);if(!o)return;const{sourceRange:r,targetRange:a}=t.params,l=r.startColumn===a.startColumn&&r.endColumn===a.endColumn,u=l?r.endRow-r.startRow+1:r.endColumn-r.startColumn+1,d=l?r.startRow:r.startColumn,c=l?a.startRow:a.startColumn,m=o.getConfig().mergeData,h=[];m.forEach(v=>{let{startRow:I,endRow:w,startColumn:p,endColumn:M,rangeType:y}=v;i.Rectangle.intersects(v,r)||(l?d<I&&c>w?(I-=u,w-=u):d>w&&c<=I&&(I+=u,w+=u):d<p&&c>M?(p-=u,M-=u):d>M&&c<=p&&(p+=u,M+=u)),v.startRow===v.endRow&&v.startColumn===v.endColumn||h.push({startRow:I,endRow:w,startColumn:p,endColumn:M,rangeType:y})}),o.setMergeData(h),this.disposableCollection.dispose();const{unitId:R,subUnitId:S}=t.params,C=v=>this.refRangeHandle(v,R,S);h.forEach(v=>{this.disposableCollection.add(this._refRangeService.registerRefRange(v,C,R,S))})}if(ql.includes(t.id)){const n=this._univerInstanceService.getUniverSheetInstance(t.params.unitId);if(!n)return;const o=n.getSheetBySheetId(t.params.subUnitId);if(!o)return;const r=o.getConfig().mergeData,a=t.params;if(!a)return;const{range:l}=a,u=t.id.includes("row"),d=t.id.includes("insert"),c=u?l.startRow:l.startColumn,m=u?l.endRow:l.endColumn,h=m-c+1,R=[];r.forEach(I=>{let{startRow:w,endRow:p,startColumn:M,endColumn:y,rangeType:b}=I;d?u?c<=w&&(w+=h,p+=h):c<=M&&(M+=h,y+=h):u?m<w&&(w-=h,p-=h):m<M&&(M-=h,y-=h),I.startRow===I.endRow&&I.startColumn===I.endColumn||R.push({startRow:w,endRow:p,startColumn:M,endColumn:y,rangeType:b})}),o.setMergeData(R),this.disposableCollection.dispose();const{unitId:S,subUnitId:C}=t.params,v=I=>this.refRangeHandle(I,S,C);R.forEach(I=>{this.disposableCollection.add(this._refRangeService.registerRefRange(I,v,S,C))})}}))}},g.MergeCellController=zl([wt(0,i.Inject(i.ICommandService)),wt(1,i.Inject(g.RefRangeService)),wt(2,i.Inject(i.IUniverInstanceService)),wt(3,i.Inject(i.Injector)),wt(4,i.Inject(g.SheetInterceptorService)),wt(5,i.Inject(g.SheetsSelectionsService))],g.MergeCellController);function fe(s,e){return e?s.getUniverSheetInstance(e):s.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET)}function ve(s,e){return e?s.getSheetBySheetId(e):s.getActiveSheet()}var Kl=Object.getOwnPropertyDescriptor,Jl=(s,e,t,n)=>{for(var o=n>1?void 0:n?Kl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},xl=(s,e)=>(t,n)=>e(t,n,s);let _n=class extends i.Disposable{constructor(s){super(),this._sheetInterceptorService=s,this._initialize()}_initialize(){this._initInterceptorCellContent()}_initInterceptorCellContent(){this.disposeWithMe(this._sheetInterceptorService.intercept(Ee.CELL_CONTENT,{priority:11,effect:i.InterceptorEffectEnum.Value|i.InterceptorEffectEnum.Style,handler:(s,e,t)=>{var o;const n=e.workbook.getStyles().getStyleByCell(s);return(o=n==null?void 0:n.n)!=null&&o.pattern?t({...s}):(s==null?void 0:s.t)===i.CellValueType.NUMBER&&s.v!==void 0&&s.v!==null&&i.isRealNum(s.v)?t({...s,v:z.stripErrorMargin(Number(s.v))}):t({...s})}}))}};_n=Jl([xl(0,i.Inject(g.SheetInterceptorService))],_n);var Xl=Object.getOwnPropertyDescriptor,Zl=(s,e,t,n)=>{for(var o=n>1?void 0:n?Xl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},be=(s,e)=>(t,n)=>e(t,n,s);g.SheetPermissionCheckController=class extends i.Disposable{constructor(t,n,o,r,a,l,u,d,c,m){super();f(this,"disposableCollection",new i.DisposableCollection);f(this,"_triggerPermissionUIEvent$",new A.Subject);f(this,"triggerPermissionUIEvent$",this._triggerPermissionUIEvent$.asObservable());this._commandService=t,this._univerInstanceService=n,this._permissionService=o,this._selectionManagerService=r,this._rangeProtectionRuleModel=a,this._worksheetProtectionRuleModel=l,this._localeService=u,this._lexerTreeBuilder=d,this._contextService=c,this._definedNamesService=m,this._initialize()}blockExecuteWithoutPermission(t){throw this._triggerPermissionUIEvent$.next(t),new i.CustomCommandExecutionError("have no permission")}_getPermissionCheck(t,n){let o=!0,r="";switch(t){case it.id:i.isICellData(n.value)&&n.value.f?(o=this._permissionCheckWithFormula(n),r=this._localeService.t("permission.dialog.formulaErr")):o=this._permissionCheckBySetRangeValue({workbookTypes:[ae],rangeTypes:[ce],worksheetTypes:[Ut,me]},n);break;case Zt.id:o=this.permissionCheckWithRanges({workbookTypes:[ae],rangeTypes:[ce],worksheetTypes:[Ut,me]}),r=this._localeService.t("permission.dialog.editErr");break;case mn.id:case Bt.id:o=this.permissionCheckWithoutRange({worksheetTypes:[ot]}),r=this._localeService.t("permission.dialog.setRowColStyleErr");break;case Sn.id:case Cn.id:case fn.id:o=this.permissionCheckWithoutRange({worksheetTypes:[rt]}),r=this._localeService.t("permission.dialog.setRowColStyleErr");break;case Ot.id:case Nt.id:o=this._permissionCheckByMoveCommand(n),r=this._localeService.t("permission.dialog.moveRowColErr");break;case qe.id:o=this._permissionCheckByMoveRangeCommand(n),r=this._localeService.t("permission.dialog.moveRangeErr");break;case Us.id:o=this._permissionCheckByWorksheetCommand([ae,rn]),r=this._localeService.t("permission.dialog.operatorSheetErr"),o===!1&&this._worksheetProtectionRuleModel.resetOrder();break;case hn.id:o=this._permissionCheckByWorksheetCommand([ae,an]),r=this._localeService.t("permission.dialog.operatorSheetErr"),o===!1&&this._worksheetProtectionRuleModel.resetOrder();break;case Ds.id:{const{unitId:a,subUnitId:l}=n;o=this._permissionCheckByWorksheetCommand([ae,sn],a,l),r=this._localeService.t("permission.dialog.operatorSheetErr"),o===!1&&this._worksheetProtectionRuleModel.resetOrder()}break;case Vt.id:o=this.permissionCheckWithRanges({workbookTypes:[ae],rangeTypes:[ce],worksheetTypes:[me,ot]},n.ranges),r=this._localeService.t("permission.dialog.setRowColStyleErr");break;case Lt.id:o=this.permissionCheckWithRanges({workbookTypes:[ae],rangeTypes:[ce],worksheetTypes:[me,rt]},n.ranges),r=this._localeService.t("permission.dialog.setRowColStyleErr");break;case vs.id:o=this.permissionCheckWithRanges({workbookTypes:[ae],rangeTypes:[ce],worksheetTypes:[me,ot]}),r=this._localeService.t("permission.dialog.setRowColStyleErr");break;case Ms.id:o=this.permissionCheckWithRanges({workbookTypes:[ae],rangeTypes:[ce],worksheetTypes:[me,rt]}),r=this._localeService.t("permission.dialog.setRowColStyleErr");break;case kt.id:o=this._permissionCheckWithInsertRangeMove("right"),r=this._localeService.t("permission.dialog.insertOrDeleteMoveRangeErr");break;case at.id:o=this._permissionCheckWithInsertRangeMove("bottom"),r=this._localeService.t("permission.dialog.insertOrDeleteMoveRangeErr");break;case Ye.id:o=this._permissionCheckWithInsertRangeMove("left"),r=this._localeService.t("permission.dialog.insertOrDeleteMoveRangeErr");break;case Ke.id:o=this._permissionCheckWithInsertRangeMove("top"),r=this._localeService.t("permission.dialog.insertOrDeleteMoveRangeErr");break}o||this.blockExecuteWithoutPermission(r)}_initialize(){this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{this._getPermissionCheck(t.id,t==null?void 0:t.params)})),this.disposeWithMe(this._commandService.onCommandExecuted(t=>{var n;if(t.id===Ht.id){const o=t.params,{unitId:r=(n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:n.getUnitId(),subUnitId:a}=o;if(!r||!a)return;const l=this._worksheetProtectionRuleModel.getRule(r,a),u=this._rangeProtectionRuleModel.getSubunitRuleList(r,a);l&&this._worksheetProtectionRuleModel.ruleRefresh(l.permissionId),u.length&&this._rangeProtectionRuleModel.ruleRefresh(a)}}))}_permissionCheckWithInsertRangeMove(t){var c;const n=U(this._univerInstanceService);if(!n)return!1;const{worksheet:o,unitId:r,subUnitId:a}=n,l=i.Tools.deepClone((c=this._selectionManagerService.getCurrentLastSelection())==null?void 0:c.range);return!(!l||(t==="top"||t==="bottom"?l.endRow=o.getRowCount()-1:(t==="left"||t==="right")&&(l.endColumn=o.getColumnCount()-1),this._rangeProtectionRuleModel.getSubunitRuleList(r,a).map(m=>m.ranges).flat().some(m=>i.Rectangle.getIntersects(l,m))))}_permissionCheckByWorksheetCommand(t,n,o){var c,m;const r=U(this._univerInstanceService,{unitId:n,subUnitId:o});if(!r)return!1;const{unitId:a,subUnitId:l}=r,u=this._worksheetProtectionRuleModel.getRule(a,l),d=this._rangeProtectionRuleModel.getSubunitRuleList(a,l).length>0;return u||d?(m=(c=this._permissionService.getPermissionPoint(new on(a).id))==null?void 0:c.value)!=null?m:!1:this._permissionService.composePermission(t.map(h=>new h(a).id)).every(h=>h.value)}permissionCheckWithoutRange(t){var R,S,C,v;const n=U(this._univerInstanceService);if(!n)return!1;const{worksheet:o,unitId:r,subUnitId:a}=n,l=this._selectionManagerService.getCurrentLastSelection();if(!l)return!0;const u=(S=(R=l==null?void 0:l.primary)==null?void 0:R.actualRow)!=null?S:0,d=(v=(C=l==null?void 0:l.primary)==null?void 0:C.actualColumn)!=null?v:0,{workbookTypes:c,worksheetTypes:m,rangeTypes:h}=t;return!(c&&c.some(w=>{var y,b;const p=new w(r);return((b=(y=this._permissionService.getPermissionPoint(p.id))==null?void 0:y.value)!=null?b:!1)===!1})===!0||m&&m.some(w=>{var y,b;const p=new w(r,a);return((b=(y=this._permissionService.getPermissionPoint(p.id))==null?void 0:y.value)!=null?b:!1)===!1})===!0||h&&h.some(w=>{var k,E,T,P,N;const p=(E=(k=o.getCell(u,d))==null?void 0:k.selectionProtection)==null?void 0:E[0];if(!(p!=null&&p.ruleId))return!1;const M=(T=this._rangeProtectionRuleModel.getRule(r,a,p.ruleId))==null?void 0:T.permissionId;if(!M)return!1;const y=new w(r,a,M);return((N=(P=this._permissionService.getPermissionPoint(y.id))==null?void 0:P.value)!=null?N:!1)===!1})===!0)}permissionCheckWithRanges(t,n,o,r){var S;const a=U(this._univerInstanceService);if(!a)return!1;const{workbook:l,worksheet:u}=a;o||(o=l.getUnitId()),r||(r=u.getSheetId());const d=n!=null?n:(S=this._selectionManagerService.getCurrentSelections())==null?void 0:S.map(C=>C.range);if(!d)return!1;const{workbookTypes:c,worksheetTypes:m,rangeTypes:h}=t,R=[];return c&&R.push(...c.map(C=>new C(o).id)),m&&R.push(...m.map(C=>new C(o,r).id)),h&&this._rangeProtectionRuleModel.getSubunitRuleList(o,r).forEach(C=>{d.some(I=>C.ranges.some(w=>i.Rectangle.intersects(w,I)))&&R.push(...h.map(I=>new I(o,r,C.permissionId).id))}),R.length?this._permissionService.composePermission(R).every(C=>C.value):!0}_permissionCheckByMoveCommand(t){const n=U(this._univerInstanceService);if(!n)return!1;const{worksheet:o,unitId:r,subUnitId:a}=n,l=t.toRange;l.endRow===o.getRowCount()-1?l.endColumn=l.startColumn:l.endRow=l.startRow;const u=this._rangeProtectionRuleModel.getSubunitRuleList(r,a).reduce((d,c)=>[...d,...c.ranges],[]).filter(d=>i.Rectangle.intersects(d,l));return u.length>0?!1:(u.forEach(d=>{var c,m;for(let h=d.startRow;h<=d.endRow;h++)for(let R=d.startColumn;R<=d.endColumn;R++){const S=(m=(c=o.getCell(h,R))==null?void 0:c.selectionProtection)==null?void 0:m[0];if((S==null?void 0:S[_.Edit])===!1)return!1}}),!0)}_permissionCheckByMoveRangeCommand(t){const n=U(this._univerInstanceService);if(!n)return!1;const{worksheet:o,unitId:r,subUnitId:a}=n,l=t.toRange,u=this._rangeProtectionRuleModel.getSubunitRuleList(r,a).reduce((d,c)=>[...d,...c.ranges],[]).filter(d=>i.Rectangle.intersects(d,l));return u.length>0?!1:(u.forEach(d=>{var c,m;for(let h=d.startRow;h<=d.endRow;h++)for(let R=d.startColumn;R<=d.endColumn;R++){const S=(m=(c=o.getCell(h,R))==null?void 0:c.selectionProtection)==null?void 0:m[0];if((S==null?void 0:S[_.Edit])===!1)return!1}}),!0)}_permissionCheckBySetRangeValue(t,n){let o=[];n.range?o=[n.range]:o=[new i.ObjectMatrix(n.value).getDataRange()];const{unitId:r,subUnitId:a}=n;return this.permissionCheckWithRanges(t,o,r,a)}_permissionCheckWithFormula(t){var a,l,u,d,c;const n=t.value,o=t.range,r=n.f;if(r){const m=r.substring(1),h=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),R=(a=t.unitId)!=null?a:h.getUnitId(),S=this._definedNamesService.getValueByName(R,m);if(S){let C=S.formulaOrRefString;C.startsWith(z.operatorToken.EQUALS)&&(C=C.slice(1));const v=C.split(",");for(let I=0;I<v.length;I++){const w=v[I],p=z.deserializeRangeWithSheet(w);if(p.sheetName){const M=h.getSheetBySheetName(p.sheetName);if(!M)return!0;const{startRow:y,endRow:b,startColumn:k,endColumn:E}=p.range;for(let T=y;T<=b;T++)for(let P=k;P<=E;P++){const N=(u=(l=M.getCell(T,P))==null?void 0:l.selectionProtection)==null?void 0:u[0];if((N==null?void 0:N[_.View])===!1)return!1}}}return!0}else{const C=this._lexerTreeBuilder.sequenceNodesBuilder(r);if(!C)return!0;for(let v=0;v<C.length;v++){const I=C[v];if(typeof I=="string"||I.nodeType!==z.sequenceNodeType.REFERENCE)continue;const{token:w}=I,p=z.deserializeRangeWithSheetWithCache(w),M=p.unitId?this._univerInstanceService.getUnit(p.unitId):this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!M)return!0;let y=p.sheetName?M.getSheetBySheetName(p.sheetName):M.getActiveSheet();const b=M.getUnitId();if(p.sheetName){if(y=M.getSheetBySheetName(p.sheetName),!y)return!0;const N=y==null?void 0:y.getSheetId();if(!this._permissionService.getPermissionPoint(new Pt(b,N).id))return!1}if(!y)return!0;const{startRow:k,endRow:E,startColumn:T,endColumn:P}=p.range;for(let N=k;N<=E;N++)for(let W=T;W<=P;W++){const L=(c=(d=y.getCell(N,W))==null?void 0:d.selectionProtection)==null?void 0:c[0];if((L==null?void 0:L[_.View])===!1)return!1}}return!0}}if(o){const m=U(this._univerInstanceService);if(!m)return!1;const h=t.unitId||m.unitId,R=t.subUnitId||m.subUnitId,C=this._rangeProtectionRuleModel.getSubunitRuleList(h,R).filter(I=>I.ranges.some(w=>i.Rectangle.intersects(w,o))).map(I=>new ce(h,R,I.permissionId).id);if(!this._permissionService.composePermission(C).every(I=>I.value))return!1}return!0}},g.SheetPermissionCheckController=Zl([be(0,i.ICommandService),be(1,i.IUniverInstanceService),be(2,i.IPermissionService),be(3,i.Inject(g.SheetsSelectionsService)),be(4,i.Inject(K)),be(5,i.Inject(we)),be(6,i.Inject(i.LocaleService)),be(7,i.Inject(z.LexerTreeBuilder)),be(8,i.IContextService),be(9,z.IDefinedNamesService)],g.SheetPermissionCheckController);var Ql=Object.getOwnPropertyDescriptor,eu=(s,e,t,n)=>{for(var o=n>1?void 0:n?Ql(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},zs=(s,e)=>(t,n)=>e(t,n,s);g.RangeProtectionCache=class extends i.Disposable{constructor(t,n,o){super();f(this,"_cellRuleCache",new Map);f(this,"_permissionIdCache",new Map);f(this,"_cellInfoCache",new Map);f(this,"_rowInfoCache",new Map);f(this,"_colInfoCache",new Map);this._ruleModel=t,this._permissionService=n,this._univerInstanceService=o,this._initUpdateCellRuleCache(),this._initUpdateCellInfoCache(),this._initUpdateRowColInfoCache(),this._initCache()}_initCache(){this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).forEach(t=>{t.getSheets().forEach(n=>{const o=t.getUnitId(),r=n.getSheetId();this.reBuildCache(o,r)})})}_initUpdateCellInfoCache(){this._permissionService.permissionPointUpdate$.pipe(A.filter(t=>t.type===O.SelectRange),A.map(t=>t)).subscribe(t=>{const{subUnitId:n,unitId:o,permissionId:r}=t,a=this._permissionIdCache.get(r);if(!a)return;const l=this._ruleModel.getRule(o,n,a);if(!l)return;const u=this._ensureCellInfoMap(o,n);l.ranges.forEach(d=>{const{startRow:c,endRow:m,startColumn:h,endColumn:R}=d;for(let S=c;S<=m;S++)for(let C=h;C<=R;C++)u.delete(`${S}-${C}`)})}),this._ruleModel.ruleChange$.subscribe(t=>{var a;const{unitId:n,subUnitId:o}=t,r=this._ensureCellInfoMap(n,o);t.rule.ranges.forEach(l=>{i.Range.foreach(l,(u,d)=>{r.delete(`${u}-${d}`)})}),t.type==="set"&&((a=t.oldRule)==null||a.ranges.forEach(l=>{i.Range.foreach(l,(u,d)=>{this._cellInfoCache.delete(`${u}-${d}`)})}))})}_initUpdateCellRuleCache(){this._ruleModel.ruleChange$.subscribe(t=>{const{type:n}=t;n==="add"?this._addCellRuleCache(t):n==="delete"?this._deleteCellRuleCache(t):(this._deleteCellRuleCache({...t,rule:t.oldRule}),this._addCellRuleCache(t))})}_ensureRuleMap(t,n){let o=this._cellRuleCache.get(t);o||(o=new Map,this._cellRuleCache.set(t,o));let r=o.get(n);return r||(r=new Map,o.set(n,r)),r}_ensureCellInfoMap(t,n){let o=this._cellInfoCache.get(t);o||(o=new Map,this._cellInfoCache.set(t,o));let r=o.get(n);return r||(r=new Map,o.set(n,r)),r}_ensureRowColInfoMap(t,n,o){let r=o==="row"?this._rowInfoCache.get(t):this._colInfoCache.get(t);r||(r=new Map,o==="row"?this._rowInfoCache.set(t,r):this._colInfoCache.set(t,r));let a=r.get(n);return a||(a=new Map,r.set(n,a)),a}_addCellRuleCache(t){const{subUnitId:n,unitId:o,rule:r}=t,a=this._ensureRuleMap(o,n);r.ranges.forEach(l=>{const{startRow:u,endRow:d,startColumn:c,endColumn:m}=l;for(let h=u;h<=d;h++)for(let R=c;R<=m;R++)a.set(`${h}-${R}`,r.id)}),this._permissionIdCache.set(r.permissionId,r.id)}_deleteCellRuleCache(t){const{subUnitId:n,unitId:o,rule:r}=t,a=this._ensureRuleMap(o,n),l=this._ensureCellInfoMap(o,n);r.ranges.forEach(u=>{const{startRow:d,endRow:c,startColumn:m,endColumn:h}=u;for(let R=d;R<=c;R++)for(let S=m;S<=h;S++)a.delete(`${R}-${S}`),l.delete(`${R}-${S}`)}),this._permissionIdCache.delete(r.permissionId)}_getSelectionActions(t,n,o){var c,m,h,R,S,C,v,I,w,p,M,y;const r=(h=(m=this._permissionService.getPermissionPoint((c=new ce(t,n,o.permissionId))==null?void 0:c.id))==null?void 0:m.value)!=null?h:!0,a=(C=(S=this._permissionService.getPermissionPoint((R=new nn(t,n,o.permissionId))==null?void 0:R.id))==null?void 0:S.value)!=null?C:!0,l=(w=(I=this._permissionService.getPermissionPoint((v=new ks(t,n,o.permissionId))==null?void 0:v.id))==null?void 0:I.value)!=null?w:!1,u=(y=(M=this._permissionService.getPermissionPoint((p=new Ps(t,n,o.permissionId))==null?void 0:p.id))==null?void 0:M.value)!=null?y:!1;return{[_.Edit]:r,[_.View]:a,[_.ManageCollaborator]:l,[_.Delete]:u}}reBuildCache(t,n){const o=this._ensureRuleMap(t,n),r=this._ensureCellInfoMap(t,n);o.clear(),r.clear();const a=this._ensureRowColInfoMap(t,n,"row"),l=this._ensureRowColInfoMap(t,n,"col");a.clear(),l.clear(),this._ruleModel.getSubunitRuleList(t,n).forEach(u=>{const d=this._getSelectionActions(t,n,u),c={...d,ruleId:u.id,ranges:u.ranges};u.ranges.forEach(m=>{const{startRow:h,endRow:R,startColumn:S,endColumn:C}=m;for(let v=h;v<=R;v++){const I=a.get(`${v}`);I?I.set(u.id,d):a.set(`${v}`,new Map([[u.id,d]]));for(let w=S;w<=C;w++){o.set(`${v}-${w}`,u.id),r.set(`${v}-${w}`,c);const p=l.get(`${w}`);p?p.set(u.id,d):l.set(`${w}`,new Map([[u.id,d]]))}}}),this._permissionIdCache.set(u.permissionId,u.id)})}getRowPermissionInfo(t,n,o,r){var u;const a=(u=this._rowInfoCache.get(t))==null?void 0:u.get(n);if(!a)return!0;const l=a.get(`${o}`);return l?r.every(d=>{for(const c of l.values())if(c[d]===!1)return!1;return!0}):!0}getColPermissionInfo(t,n,o,r){var u;const a=(u=this._colInfoCache.get(t))==null?void 0:u.get(n);if(!a)return!0;const l=a.get(`${o}`);return l?r.every(d=>{for(const c of l.values())if(c[d]===!1)return!1;return!0}):!0}_initUpdateRowColInfoCache(){this._permissionService.permissionPointUpdate$.pipe(A.filter(t=>t.type===O.SelectRange),A.map(t=>t)).subscribe({next:t=>{const{subUnitId:n,unitId:o,permissionId:r}=t,a=this._permissionIdCache.get(r);if(!a)return;const l=this._ruleModel.getRule(o,n,a);if(!l)return;const u=this._ensureRowColInfoMap(o,n,"row"),d=this._ensureRowColInfoMap(o,n,"col"),c=this._getSelectionActions(o,n,l);l.ranges.forEach(m=>{const{startRow:h,endRow:R,startColumn:S,endColumn:C}=m;for(let v=h;v<=R;v++){const I=u.get(`${v}`);I?I.set(a,c):u.set(`${v}`,new Map([[a,c]]));for(let w=S;w<=C;w++){const p=d.get(`${w}`);p?p.set(a,c):d.set(`${w}`,new Map([[a,c]]))}}})}}),this._ruleModel.ruleChange$.subscribe(t=>{if(t.type==="delete"){const{unitId:n,subUnitId:o,rule:r}=t,a=this._ensureRowColInfoMap(n,o,"row"),l=this._ensureRowColInfoMap(n,o,"col");r.ranges.forEach(u=>{const{startRow:d,endRow:c,startColumn:m,endColumn:h}=u;for(let R=d;R<=c;R++){const S=a.get(`${R}`);S==null||S.delete(r.id);for(let C=m;C<=h;C++){const v=l.get(`${C}`);v==null||v.delete(r.id)}}})}})}getCellInfo(t,n,o,r){var c,m;const a=this._ensureCellInfoMap(t,n),l=a.get(`${o}-${r}`);if(l)return l;const u=(m=(c=this._cellRuleCache.get(t))==null?void 0:c.get(n))==null?void 0:m.get(`${o}-${r}`);if(!u)return;const d=this._ruleModel.getRule(t,n,u);if(d){const R={...this._getSelectionActions(t,n,d),ruleId:u,ranges:d.ranges};return a.set(`${o}-${r}`,R),R}}deleteUnit(t){this._cellRuleCache.delete(t),this._cellInfoCache.delete(t),this._rowInfoCache.delete(t),this._colInfoCache.delete(t);const n=this._univerInstanceService.getUnit(t);n==null||n.getSheets().forEach(o=>{const r=o.getSheetId();this._ruleModel.getSubunitRuleList(t,r).forEach(a=>{this._permissionIdCache.delete(a.permissionId)})})}},g.RangeProtectionCache=eu([zs(0,i.Inject(K)),zs(1,i.Inject(i.IPermissionService)),zs(2,i.Inject(i.IUniverInstanceService))],g.RangeProtectionCache);var tu=Object.getOwnPropertyDescriptor,nu=(s,e,t,n)=>{for(var o=n>1?void 0:n?tu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Ie=(s,e)=>(t,n)=>e(t,n,s);g.SheetPermissionInitController=class extends i.Disposable{constructor(e,t,n,o,r,a,l,u,d,c,m){super(),this._univerInstanceService=e,this._permissionService=t,this._authzIoService=n,this._rangeProtectionRuleModel=o,this._worksheetProtectionRuleModel=r,this._userManagerService=a,this._worksheetProtectionPointRuleModel=l,this._sheetInterceptorService=u,this._undoRedoService=d,this._commandService=c,this._rangeProtectionCache=m}initPermission(){this._initRangePermissionFromSnapshot(),this._initRangePermissionChange(),this._initWorksheetPermissionFromSnapshot(),this._initWorksheetPermissionChange(),this._initWorksheetPermissionPointsChange(),this._initWorkbookPermissionFromSnapshot(),this._initUserChange(),this._refreshPermissionByCollaCreate()}async _initRangePermissionFromSnapshot(){const e=async t=>{const n=[],o=t.getUnitId(),r=t.getSheets(),a=new Map;if(r.forEach(l=>{const u=l.getSheetId();this._rangeProtectionRuleModel.getSubunitRuleList(o,u).forEach(d=>{a.set(d.permissionId,d),n.push({objectID:d.permissionId,unitID:o,objectType:O.SelectRange,actions:Be})})}),!n.length){this._rangeProtectionRuleModel.changeRuleInitState(!0);return}this._authzIoService.batchAllowed(n).then(l=>{l.forEach(u=>{const d=a.get(u.objectID);d&&se().forEach(c=>{const m=new c(o,d.subUnitId,u.objectID),h=m.subType,R=u.actions.find(S=>S.action===h);(R==null?void 0:R.allowed)!==void 0&&this._permissionService.updatePermissionPoint(m.id,R.allowed)})}),this._rangeProtectionRuleModel.changeRuleInitState(!0)})};await Promise.all(this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).map(t=>e(t))),this._rangeProtectionRuleModel.changeRuleInitState(!0)}_initRangePermissionChange(){this.disposeWithMe(this._rangeProtectionRuleModel.ruleChange$.subscribe(e=>{e.type!=="delete"?this._authzIoService.allowed({objectID:e.rule.permissionId,unitID:e.unitId,objectType:O.SelectRange,actions:Be}).then(t=>{se().forEach(n=>{if(e.type==="set"){const{rule:u,oldRule:d}=e;if(u.permissionId===(d==null?void 0:d.permissionId))return}const o=e.rule,r=new n(o.unitId,o.subUnitId,o.permissionId),a=r.subType,l=t.find(u=>u.action===a);l&&this._permissionService.updatePermissionPoint(r.id,l.allowed)}),this._rangeProtectionRuleModel.ruleRefresh(e.rule.permissionId)}):this._rangeProtectionRuleModel.getSubunitRuleList(e.unitId,e.subUnitId).length===0&&(this._worksheetProtectionPointRuleModel.deleteRule(e.unitId,e.subUnitId),[...ge()].forEach(n=>{const o=new n(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(o.id,o.value)}))}))}async initWorkbookPermissionChange(e){var n;const t=e||((n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:n.getUnitId());t&&this._authzIoService.allowed({objectID:t,objectType:O.Workbook,unitID:t,actions:Ir}).then(o=>{It().forEach(r=>{const a=new r(t),l=a.subType,u=o.find(d=>d.action===l);u&&this._permissionService.updatePermissionPoint(a.id,u.allowed)})})}async _initWorkbookPermissionFromSnapshot(){await Promise.all(this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).map(e=>this.initWorkbookPermissionChange(e.getUnitId())))}_initWorksheetPermissionChange(){this.disposeWithMe(this._worksheetProtectionRuleModel.ruleChange$.subscribe(e=>{e.type!=="delete"?this._authzIoService.allowed({objectID:e.rule.permissionId,unitID:e.unitId,objectType:O.Worksheet,actions:Be}).then(t=>{oe().forEach(n=>{const o=new n(e.unitId,e.subUnitId),r=o.subType,a=t.find(l=>l.action===r);a&&this._permissionService.updatePermissionPoint(o.id,a.allowed)}),this._worksheetProtectionRuleModel.ruleRefresh(e.rule.permissionId)}):([...oe(),...ge()].forEach(t=>{const n=new t(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(n.id,!0)}),this._worksheetProtectionPointRuleModel.deleteRule(e.unitId,e.subUnitId))}))}_initWorksheetPermissionPointsChange(){this.disposeWithMe(this._worksheetProtectionPointRuleModel.pointChange$.subscribe(e=>{this._authzIoService.allowed({objectID:e.permissionId,unitID:e.unitId,objectType:O.Worksheet,actions:gn}).then(t=>{ge().forEach(n=>{const o=new n(e.unitId,e.subUnitId),r=o.subType,a=t.find(l=>l.action===r);a&&this._permissionService.updatePermissionPoint(o.id,a.allowed)})})}))}async _initWorksheetPermissionFromSnapshot(){const e=async t=>{const n=[],o=t.getUnitId(),r=t.getSheets(),a=new Map;if(r.forEach(l=>{const u=l.getSheetId(),d=this._worksheetProtectionRuleModel.getRule(o,u);d&&(a.set(d.permissionId,d),n.push({objectID:d.permissionId,unitID:o,objectType:O.Worksheet,actions:Be}));const c=this._worksheetProtectionPointRuleModel.getRule(o,u);c&&(a.set(c.permissionId,c),n.push({objectID:c.permissionId,unitID:o,objectType:O.Worksheet,actions:gn}))}),!n.length){this._worksheetProtectionRuleModel.changeRuleInitState(!0);return}this._authzIoService.batchAllowed(n).then(l=>{l.forEach(u=>{const d=a.get(u.objectID);d&&[...oe(),...ge()].forEach(c=>{const m=new c(o,d.subUnitId),h=m.subType,R=u.actions.find(S=>S.action===h);(R==null?void 0:R.allowed)!==void 0&&this._permissionService.updatePermissionPoint(m.id,R.allowed)})}),this._worksheetProtectionRuleModel.changeRuleInitState(!0)})};await Promise.all(this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).map(t=>e(t))),this._worksheetProtectionRuleModel.changeRuleInitState(!0)}_initUserChange(){this.disposeWithMe(this._userManagerService.currentUser$.pipe(A.skip(1)).subscribe(()=>{const e=this._permissionService.getAllPermissionPoint();this._permissionService.clearPermissionMap(),this._worksheetProtectionRuleModel.changeRuleInitState(!1),this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).forEach(n=>{const o=n.getUnitId();It().forEach(r=>{let a=new r(o);e.has(a.id)&&(a=e.get(a.id)),this._permissionService.addPermissionPoint(a)}),n.getSheets().forEach(r=>{const a=r.getSheetId();[...oe(),...ge()].forEach(u=>{let d=new u(o,a);e.has(d.id)&&(d=e.get(d.id)),this._permissionService.addPermissionPoint(d)}),this._rangeProtectionRuleModel.getSubunitRuleList(o,a).forEach(u=>{se().forEach(d=>{let c=new d(o,a,u.permissionId);e.has(c.id)&&(c=e.get(c.id)),this._permissionService.addPermissionPoint(c)})})}),this._initWorkbookPermissionFromSnapshot(),this._initWorksheetPermissionFromSnapshot(),this._initRangePermissionFromSnapshot()})}))}refreshPermission(e,t){const n=this._worksheetProtectionRuleModel.getTargetByPermissionId(e,t);let o=!1;if(n){const[l,u]=n;this._authzIoService.allowed({objectID:t,unitID:e,objectType:O.Worksheet,actions:Be}).then(d=>{let c="";oe().forEach(m=>{var C;const h=new m(e,u),R=h.subType,S=d.find(v=>v.action===R);S&&(((C=this._permissionService.getPermissionPoint(h.id))==null?void 0:C.value)!==S.allowed&&(o=!0),this._permissionService.updatePermissionPoint(h.id,S.allowed),c+=`${S.action}_${S.allowed}`)}),this._worksheetProtectionRuleModel.ruleRefresh(`${t}_${c}`),o&&this._undoRedoService.clearUndoRedo(e)})}const r=this._worksheetProtectionPointRuleModel.getTargetByPermissionId(e,t);if(r){const[l,u]=r;this._authzIoService.allowed({objectID:t,unitID:e,objectType:O.Worksheet,actions:gn}).then(d=>{ge().forEach(c=>{var S;const m=new c(e,u),h=m.subType,R=d.find(C=>C.action===h);R&&(((S=this._permissionService.getPermissionPoint(m.id))==null?void 0:S.value)!==R.allowed&&(o=!0),this._permissionService.updatePermissionPoint(m.id,R.allowed))}),o&&this._undoRedoService.clearUndoRedo(e)})}const a=this._rangeProtectionRuleModel.getTargetByPermissionId(e,t);if(a){const[l,u]=a;this._authzIoService.allowed({objectID:t,unitID:e,objectType:O.SelectRange,actions:Be}).then(d=>{let c="";se().forEach(m=>{var C;const h=new m(e,u,t),R=h.subType,S=d.find(v=>v.action===R);S&&(((C=this._permissionService.getPermissionPoint(h.id))==null?void 0:C.value)!==S.allowed&&(o=!0),this._permissionService.updatePermissionPoint(h.id,S.allowed),c+=`${S.action}_${S.allowed}`)}),this._rangeProtectionRuleModel.ruleRefresh(`${t}_${c}`),o&&this._undoRedoService.clearUndoRedo(e)})}}_refreshPermissionByCollaCreate(){this.disposeWithMe(this._commandService.onCommandExecuted((e,t)=>{if(t!=null&&t.fromCollab&&(e.id===ue.id||e.id===Oe.id||e.id===Rn.id)){const n=e.params;this._undoRedoService.clearUndoRedo(n.unitId)}}))}},g.SheetPermissionInitController=nu([Ie(0,i.IUniverInstanceService),Ie(1,i.IPermissionService),Ie(2,i.IAuthzIoService),Ie(3,i.Inject(K)),Ie(4,i.Inject(we)),Ie(5,i.Inject(i.UserManagerService)),Ie(6,i.Inject(vt)),Ie(7,i.Inject(g.SheetInterceptorService)),Ie(8,i.Inject(i.IUndoRedoService)),Ie(9,i.Inject(i.ICommandService)),Ie(10,i.Inject(g.RangeProtectionCache))],g.SheetPermissionInitController);var su=Object.getOwnPropertyDescriptor,ou=(s,e,t,n)=>{for(var o=n>1?void 0:n?su(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},bn=(s,e)=>(t,n)=>e(t,n,s);let Tn=class extends i.Disposable{constructor(s,e,t,n){super(),this._permissionService=s,this._worksheetProtectionRuleModel=e,this._sheetInterceptorService=t,this._rangeProtectionCache=n,this._initViewModelByRangeInterceptor(),this._initViewModelBySheetInterceptor()}_initViewModelByRangeInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(Ee.CELL_CONTENT,{priority:999,effect:i.InterceptorEffectEnum.Value|i.InterceptorEffectEnum.Style,handler:(s={},e,t)=>{const{unitId:n,subUnitId:o,row:r,col:a}=e,l=this._rangeProtectionCache.getCellInfo(n,o,r,a);if(l){const u=l[_.View]===!1,d={...s,selectionProtection:[l]};return u?(delete d.s,delete d.v,delete d.p,d):t(d)}return t(s)}}))}_initViewModelBySheetInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(Ee.CELL_CONTENT,{priority:999,effect:i.InterceptorEffectEnum.Value|i.InterceptorEffectEnum.Style,handler:(s={},e,t)=>{var a,l,u,d,c;const{unitId:n,subUnitId:o}=e,r=this._worksheetProtectionRuleModel.getRule(n,o);if(r!=null&&r.permissionId){const m=[{[_.View]:(l=(a=this._permissionService.getPermissionPoint(new Pt(n,o).id))==null?void 0:a.value)!=null?l:!1,[_.Edit]:(d=(u=this._permissionService.getPermissionPoint(new me(n,o).id))==null?void 0:u.value)!=null?d:!1}],h=!((c=m[0])!=null&&c[_.View]),R={...s,hasWorksheetRule:!0,selectionProtection:m};return h?(delete R.s,delete R.v,delete R.p,R):t(R)}return t(s)}}))}};Tn=ou([bn(0,i.IPermissionService),bn(1,i.Inject(we)),bn(2,i.Inject(g.SheetInterceptorService)),bn(3,i.Inject(g.RangeProtectionCache))],Tn);var ru=Object.getOwnPropertyDescriptor,iu=(s,e,t,n)=>{for(var o=n>1?void 0:n?ru(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},ni=(s,e)=>(t,n)=>e(t,n,s);g.RangeProtectionRenderModel=class{constructor(e,t){f(this,"_cache",new i.LRUMap(1e4));this._selectionProtectionRuleModel=e,this._permissionService=t,this._init()}_init(){this._permissionService.permissionPointUpdate$.pipe(yt.filter(e=>e.type===O.SelectRange),yt.filter(e=>se().some(t=>e instanceof t)),yt.map(e=>e)).subscribe(e=>{const t=this._selectionProtectionRuleModel.getSubunitRuleList(e.unitId,e.subUnitId);for(const n of t)n.permissionId===e.permissionId&&n.ranges.forEach(o=>{i.Range.foreach(o,(r,a)=>{const l=this._createKey(e.unitId,e.subUnitId,r,a);this._cache.delete(l)})})}),this._selectionProtectionRuleModel.ruleChange$.subscribe(e=>{var t;e.rule.ranges.forEach(n=>{i.Range.foreach(n,(o,r)=>{const a=this._createKey(e.unitId,e.subUnitId,o,r);this._cache.delete(a)})}),e.type==="set"&&((t=e.oldRule)==null||t.ranges.forEach(n=>{i.Range.foreach(n,(o,r)=>{const a=this._createKey(e.unitId,e.subUnitId,o,r);this._cache.delete(a)})}))})}_createKey(e,t,n,o){return`${e}_${t}_${n}_${o}`}getCellInfo(e,t,n,o){const r=this._selectionProtectionRuleModel.getSubunitRuleList(e,t),a=[];if(!r||!r.length)return a;const l=this._createKey(e,t,n,o),u=this._cache.get(l);if(u)return u;const d=[];for(const c of r)if(c.ranges.some(m=>m.startRow<=n&&m.endRow>=n&&m.startColumn<=o&&m.endColumn>=o)){const m=se().reduce((h,R)=>{var v;const S=new R(e,t,c.permissionId),C=this._permissionService.getPermissionPoint(S.id);return h[S.subType]=(v=C==null?void 0:C.value)!=null?v:S.value,h},{});d.push({...m,ruleId:c.id,ranges:c.ranges})}return this._cache.set(l,d),d}clear(){this._cache.clear()}},g.RangeProtectionRenderModel=iu([ni(0,i.Inject(K)),ni(1,i.Inject(i.IPermissionService))],g.RangeProtectionRenderModel);const qs=i.createIdentifier("univer.exclusive-range-service");class si extends i.Disposable{constructor(){super(...arguments);f(this,"_exclusiveRanges",new Map);f(this,"_exclusiveRangesChange$",new A.Subject);f(this,"exclusiveRangesChange$",this._exclusiveRangesChange$.asObservable())}_ensureUnitMap(t){return this._exclusiveRanges.has(t)||this._exclusiveRanges.set(t,new Map),this._exclusiveRanges.get(t)}_ensureSubunitMap(t,n){const o=this._ensureUnitMap(t);return o.has(n)||o.set(n,new Map),o.get(n)}_ensureFeature(t,n,o){const r=this._ensureSubunitMap(t,n);return r.has(o)||r.set(o,[]),r.get(o)}addExclusiveRange(t,n,o,r){const a=this._ensureFeature(t,n,o);a.push(...r),this._exclusiveRangesChange$.next({unitId:t,subUnitId:n,ranges:a.map(l=>l.range)})}getExclusiveRanges(t,n,o){var r,a;return(a=(r=this._exclusiveRanges.get(t))==null?void 0:r.get(n))==null?void 0:a.get(o)}clearExclusiveRanges(t,n,o){const r=this.getExclusiveRanges(t,n,o);this._exclusiveRangesChange$.next({unitId:t,subUnitId:n,ranges:(r==null?void 0:r.map(a=>a.range))||[]}),this._ensureFeature(t,n,o),this._exclusiveRanges.get(t).get(n).set(o,[])}clearExclusiveRangesByGroupId(t,n,o,r){const a=this.getExclusiveRanges(t,n,o);this._exclusiveRangesChange$.next({unitId:t,subUnitId:n,ranges:(a==null?void 0:a.map(u=>u.range))||[]});const l=this.getExclusiveRanges(t,n,o);if(l){const u=l.filter(d=>d.groupId!==r);this._exclusiveRanges.get(t).get(n).set(o,u)}}getInterestGroupId(t){const n=[];return t.forEach(o=>{var d;const r=o.range,{unitId:a,sheetId:l}=r;if(!a||!l)return;const u=(d=this._exclusiveRanges.get(a))==null?void 0:d.get(l);if(u)for(const c of u.keys()){const m=u.get(c);if(m){for(const h of m)if(i.Rectangle.intersects(r,h.range)){n.push(c);break}}}}),n}}var au=Object.getOwnPropertyDescriptor,lu=(s,e,t,n)=>{for(var o=n>1?void 0:n?au(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Ys=(s,e)=>(t,n)=>e(t,n,s);g.NumfmtService=class extends i.Disposable{constructor(e,t,n){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._logService=n}getValue(e,t,n,o){const r=this._univerInstanceService.getUniverSheetInstance(e);if(!r)return;const a=r==null?void 0:r.getSheetBySheetId(t);if(!a)return;const l=r.getStyles(),u=a.getCellRaw(n,o);if(u!=null&&u.s){const d=l.get(u.s);if(d!=null&&d.n)return d.n}return null}deleteValues(e,t,n){const o=this._univerInstanceService.getUniverSheetInstance(e);if(!o)return;const r=o==null?void 0:o.getSheetBySheetId(t);if(!r)return;const a=o.getStyles();n.forEach(l=>{i.Range.foreach(l,(u,d)=>{const c=r.getCellRaw(u,d);if(!c)return;const m=c==null?void 0:c.s,R={...m&&a.get(m)||{}};delete R.n;const S=a.setValue(R);c.s=S})})}setValues(e,t,n){const o=this._univerInstanceService.getUniverSheetInstance(e);if(!o)return;const r=o==null?void 0:o.getSheetBySheetId(t);if(!r)return;const a=o.getStyles(),l=r.getCellMatrix();n.forEach(u=>{u.ranges.forEach(d=>{i.Range.foreach(d,(c,m)=>{const h=r.getCellRaw(c,m);if(h){const S={...a.getStyleByCell(h)||{},n:{pattern:u.pattern}},C=a.setValue(S);h.s=C}else{const R={n:{pattern:u.pattern}},S=a.setValue(R);S&&l.setValue(c,m,{s:S})}})})})}},g.NumfmtService=lu([Ys(0,i.IResourceManagerService),Ys(1,i.IUniverInstanceService),Ys(2,i.ILogService)],g.NumfmtService);var uu=Object.getOwnPropertyDescriptor,du=(s,e,t,n)=>{for(var o=n>1?void 0:n?uu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},je=(s,e)=>(t,n)=>e(t,n,s);const oi=[de.id,Se.id,re.id,Ce.id],ri=[Ue.id,Pe.id];g.RangeProtectionRefRangeService=class extends i.Disposable{constructor(t,n,o,r,a,l,u,d){super();f(this,"disposableCollection",new i.DisposableCollection);this._selectionProtectionRuleModel=t,this._univerInstanceService=n,this._commandService=o,this._refRangeService=r,this._selectionProtectionRenderModel=a,this._rangeProtectionCache=l,this._sheetInterceptorService=u,this._rangeProtectionRuleModel=d,this._onRefRangeChange(),this._correctPermissionRange(),this._initReBuildCache(),this._initRemoveSheet()}_onRefRangeChange(){const t=(o,r)=>{const a=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!a||!(a==null?void 0:a.getSheetBySheetId(r)))return;this.disposableCollection.dispose();const u=c=>this.refRangeHandle(c,o,r);this._selectionProtectionRuleModel.getSubunitRuleList(o,r).reduce((c,m)=>[...c,...m.ranges],[]).forEach(c=>{this.disposableCollection.add(this._refRangeService.registerRefRange(c,u,o,r))})};this.disposeWithMe(this._commandService.onCommandExecuted(o=>{if(o.id===Ts.id){const r=o.params,a=r.subUnitId,l=r.unitId;if(!a||!l)return;t(l,a)}if(o.id===X.id||o.id===ue.id){const r=o.params,a=r.subUnitId,l=r.unitId;if(!a||!l)return;t(l,a)}}));const n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(n){const o=n.getActiveSheet();if(!o)return;t(n.getUnitId(),o.getSheetId())}}refRangeHandle(t,n,o){switch(t.id){case Nt.id:return this._getRefRangeMutationsByMoveRows(t.params,n,o);case Ot.id:return this._getRefRangeMutationsByMoveCols(t.params,n,o);case We.id:return this._getRefRangeMutationsByInsertRows(t.params,n,o);case Ve.id:return this._getRefRangeMutationsByInsertCols(t.params,n,o);case At.id:return this._getRefRangeMutationsByDeleteCols(t.params,n,o);case Dt.id:return this._getRefRangeMutationsByDeleteRows(t.params,n,o)}return{redos:[],undos:[]}}_getRefRangeMutationsByDeleteCols(t,n,o){const r=this._selectionProtectionRuleModel.getSubunitRuleList(n,o).filter(l=>l.ranges.some(u=>i.Rectangle.intersects(u,t.range))),a=t.range;if(r.length){const l=[],u=[];return r.forEach(d=>{const c=i.Tools.deepClone(d),m=c.ranges.reduce((h,R)=>{if(i.Rectangle.intersects(R,a)){const S=i.Tools.deepClone(R),{startColumn:C,endColumn:v}=a;if(C<=S.startColumn&&v>=S.endColumn)return h;C>=S.startColumn&&v<=S.endColumn?S.endColumn-=v-C+1:C<S.startColumn?(S.startColumn=C,S.endColumn-=v-C+1):v>S.endColumn&&(S.endColumn=C-1),this._checkIsRightRange(S)&&h.push(S)}return h},[]);c.ranges=m,c.ranges.length?(l.push({id:X.id,params:{unitId:n,subUnitId:o,rule:c,ruleId:d.id}}),u.push({id:X.id,params:{unitId:n,subUnitId:o,rule:d,ruleId:d.id}})):(l.push({id:pe.id,params:{unitId:n,subUnitId:o,ruleIds:[d.id]}}),u.push({id:ue.id,params:{unitId:n,subUnitId:o,name:"",rules:[d]}}))}),{redos:l,undos:u}}return{undos:[],redos:[]}}_getRefRangeMutationsByDeleteRows(t,n,o){const r=this._selectionProtectionRuleModel.getSubunitRuleList(n,o).filter(l=>l.ranges.some(u=>i.Rectangle.intersects(u,t.range))),a=t.range;if(r.length){const l=[],u=[];return r.forEach(d=>{const c=i.Tools.deepClone(d),m=c.ranges.reduce((h,R)=>{if(i.Rectangle.intersects(R,a)){const S=i.Tools.deepClone(R),{startRow:C,endRow:v}=a;if(C<=S.startRow&&v>=S.endRow)return h;C>=S.startRow&&v<=S.endRow?S.endRow-=v-C+1:C<S.startRow?(S.startRow=C,S.endRow-=v-C+1):v>S.endRow&&(S.endRow=C-1),this._checkIsRightRange(S)&&h.push(S)}return h},[]);c.ranges=m,l.push({id:X.id,params:{unitId:n,subUnitId:o,rule:c,ruleId:d.id}}),u.push({id:X.id,params:{unitId:n,subUnitId:o,rule:d,ruleId:d.id}})}),{redos:l,undos:u}}return{undos:[],redos:[]}}_getRefRangeMutationsByInsertCols(t,n,o){const r=t.range.startColumn,a=t.range.endColumn-t.range.startColumn+1,l=this._selectionProtectionRuleModel.getSubunitRuleList(n,o).filter(u=>u.ranges.some(d=>r>d.startColumn&&r<=d.endColumn));if(l.length){const u=[],d=[];return l.forEach(c=>{const m=i.Tools.deepClone(c);let h=!1;m.ranges.forEach(R=>{r>R.startColumn&&r<=R.endColumn&&(R.endColumn+=a,h=!0)}),h&&(u.push({id:X.id,params:{unitId:n,subUnitId:o,rule:m,ruleId:c.id}}),d.push({id:X.id,params:{unitId:n,subUnitId:o,rule:c,ruleId:c.id}}))}),{redos:u,undos:d}}return{undos:[],redos:[]}}_getRefRangeMutationsByInsertRows(t,n,o){const r=t.range.startRow,a=t.range.endRow-t.range.startRow+1,l=this._selectionProtectionRuleModel.getSubunitRuleList(n,o).filter(u=>u.ranges.some(d=>r>d.startRow&&r<=d.endRow));if(l.length){const u=[],d=[];return l.forEach(c=>{const m=i.Tools.deepClone(c);let h=!1;m.ranges.forEach(R=>{r>R.startRow&&r<=R.endRow&&(R.endRow+=a,h=!0)}),h&&(u.push({id:X.id,params:{unitId:n,subUnitId:o,rule:m,ruleId:c.id}}),d.push({id:X.id,params:{unitId:n,subUnitId:o,rule:c,ruleId:c.id}}))}),{redos:u,undos:d}}return{undos:[],redos:[]}}_getRefRangeMutationsByMoveRows(t,n,o){const r=t.toRange,a=r.startRow,l=r.endRow-r.startRow+1,u=this._selectionProtectionRuleModel.getSubunitRuleList(n,o).filter(d=>d.ranges.some(c=>a>c.startRow&&a<=c.endRow));if(u.length){const d=[],c=[];return u.forEach(m=>{const h=i.Tools.deepClone(m),S=t.fromRange.startRow;let C=!1;h.ranges.forEach(v=>{a>v.startRow&&a<=v.endRow&&(S<v.startRow&&(v.startRow=v.startRow-l,v.endRow=v.endRow-l),v.endRow+=l,C=!0)}),C&&(d.push({id:X.id,params:{unitId:n,subUnitId:o,rule:h,ruleId:m.id}}),c.push({id:X.id,params:{unitId:n,subUnitId:o,rule:m,ruleId:m.id}}))}),{redos:d,undos:c}}return{undos:[],redos:[]}}_getRefRangeMutationsByMoveCols(t,n,o){const r=t.toRange,a=r.startColumn,l=r.endColumn-r.startColumn+1,u=this._selectionProtectionRuleModel.getSubunitRuleList(n,o).filter(d=>d.ranges.some(c=>a>c.startColumn&&a<=c.endColumn));if(u.length){const d=[],c=[];return u.forEach(m=>{const h=i.Tools.deepClone(m),S=t.fromRange.startColumn;let C=!1;h.ranges.forEach(v=>{a>v.startColumn&&a<=v.endColumn&&(S<v.startColumn&&(v.startColumn=v.startColumn-l,v.endColumn=v.endColumn-l),v.endColumn+=l,C=!0)}),C&&(d.push({id:X.id,params:{unitId:n,subUnitId:o,rule:h,ruleId:m.id}}),c.push({id:X.id,params:{unitId:n,subUnitId:o,rule:m,ruleId:m.id}}))}),{redos:d,undos:c}}return{undos:[],redos:[]}}_correctPermissionRange(){this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(ri.includes(t.id)){if(!t.params)return;const n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!n)return;const o=n.getSheetBySheetId(t.params.subUnitId);if(!o)return;const{sourceRange:r,targetRange:a}=t.params,l=r.startColumn===a.startColumn&&r.endColumn===a.endColumn,u=l?r.endRow-r.startRow+1:r.endColumn-r.startColumn+1,d=l?r.startRow:r.startColumn,c=l?a.startRow:a.startColumn;this._selectionProtectionRuleModel.getSubunitRuleList(n.getUnitId(),o.getSheetId()).forEach(v=>{v.ranges.forEach(w=>{let{startRow:p,endRow:M,startColumn:y,endColumn:b}=w;i.Rectangle.intersects(w,r)||(l?d<p&&c>M?(p-=u,M-=u):d>M&&c<=p&&(p+=u,M+=u):d<y&&c>b?(y-=u,b-=u):d>b&&c<=y&&(y+=u,b+=u)),this._checkIsRightRange({startRow:p,endRow:M,startColumn:y,endColumn:b})&&(w.startColumn=y,w.endColumn=b,w.startRow=p,w.endRow=M)})}),this.disposableCollection.dispose();const{unitId:h,subUnitId:R}=t.params,S=v=>this.refRangeHandle(v,h,R);this._selectionProtectionRuleModel.getSubunitRuleList(h,R).reduce((v,I)=>[...v,...I.ranges],[]).forEach(v=>{this.disposableCollection.add(this._refRangeService.registerRefRange(v,S,h,R))}),this._selectionProtectionRenderModel.clear()}if(oi.includes(t.id)){const n=this._univerInstanceService.getUniverSheetInstance(t.params.unitId);if(!n)return;const o=n.getSheetBySheetId(t.params.subUnitId);if(!o)return;const r=t.params;if(!r)return;const{range:a}=r,l=t.id.includes("row"),u=t.id.includes("insert"),d=l?a.startRow:a.startColumn,c=l?a.endRow:a.endColumn,m=c-d+1;this._selectionProtectionRuleModel.getSubunitRuleList(n.getUnitId(),o.getSheetId()).forEach(I=>{I.ranges.forEach(p=>{let{startRow:M,endRow:y,startColumn:b,endColumn:k}=p;u?l?d<=M&&(M+=m,y+=m):d<=b&&(b+=m,k+=m):l?c<M&&(M-=m,y-=m):c<b&&(b-=m,k-=m),this._checkIsRightRange({startRow:M,endRow:y,startColumn:b,endColumn:k})&&(p.startColumn=b,p.endColumn=k,p.startRow=M,p.endRow=y)})}),this.disposableCollection.dispose();const{unitId:R,subUnitId:S}=t.params,C=I=>this.refRangeHandle(I,R,S);this._selectionProtectionRuleModel.getSubunitRuleList(R,S).reduce((I,w)=>[...I,...w.ranges],[]).forEach(I=>{this.disposableCollection.add(this._refRangeService.registerRefRange(I,C,R,S))}),this._selectionProtectionRenderModel.clear()}}))}_checkIsRightRange(t){return t.startRow<=t.endRow&&t.startColumn<=t.endColumn}_initReBuildCache(){this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(oi.includes(t.id)||ri.includes(t.id)){const{unitId:n,subUnitId:o}=t.params;this._rangeProtectionCache.reBuildCache(n,o)}}))}_initRemoveSheet(){this._sheetInterceptorService.interceptCommand({getMutations:t=>{const n=[],o=[],r=[],a=[];if(t.id===un.id){const l=t.params,u=[],d=[];this._rangeProtectionRuleModel.getSubunitRuleList(l.unitId,l.subUnitId).forEach(c=>{u.push(c.id),d.push(c)}),u.length&&d.length&&(r.push({id:pe.id,params:{unitId:l.unitId,subUnitId:l.subUnitId,ruleIds:u}}),n.push({id:ue.id,params:{unitId:l.unitId,subUnitId:l.subUnitId,name:"",rules:d}}))}return{redos:o,undos:n,preRedos:r,preUndos:a}}})}},g.RangeProtectionRefRangeService=du([je(0,i.Inject(K)),je(1,i.Inject(i.IUniverInstanceService)),je(2,i.ICommandService),je(3,i.Inject(g.RefRangeService)),je(4,i.Inject(g.RangeProtectionRenderModel)),je(5,i.Inject(g.RangeProtectionCache)),je(6,i.Inject(g.SheetInterceptorService)),je(7,i.Inject(K))],g.RangeProtectionRefRangeService);var cu=Object.getOwnPropertyDescriptor,mu=(s,e,t,n)=>{for(var o=n>1?void 0:n?cu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},Gt=(s,e)=>(t,n)=>e(t,n,s);const hu="SHEET_RANGE_PROTECTION_PLUGIN";g.RangeProtectionService=class extends i.Disposable{constructor(e,t,n,o,r){super(),this._selectionProtectionRuleModel=e,this._permissionService=t,this._resourceManagerService=n,this._selectionProtectionCache=o,this._univerInstanceService=r,this._initSnapshot(),this._initRuleChange()}_initRuleChange(){this.disposeWithMe(this._selectionProtectionRuleModel.ruleChange$.subscribe(e=>{switch(e.type){case"add":{se().forEach(t=>{const n=new t(e.unitId,e.subUnitId,e.rule.permissionId);this._permissionService.addPermissionPoint(n)});break}case"delete":{se().forEach(t=>{const n=new t(e.unitId,e.subUnitId,e.rule.permissionId);this._permissionService.deletePermissionPoint(n.id)});break}case"set":{e.oldRule.permissionId!==e.rule.permissionId&&se().forEach(t=>{const n=new t(e.unitId,e.subUnitId,e.oldRule.permissionId);this._permissionService.deletePermissionPoint(n.id);const o=new t(e.unitId,e.subUnitId,e.rule.permissionId);this._permissionService.addPermissionPoint(o)});break}}}))}_initSnapshot(){const e=n=>{const r=this._selectionProtectionRuleModel.toObject()[n];return r?JSON.stringify(r):""},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e,parseJson:t,pluginName:hu,businesses:[tn.UNIVER_SHEET],onLoad:(n,o)=>{const r=this._selectionProtectionRuleModel.toObject();r[n]=o,this._selectionProtectionRuleModel.fromObject(r);const a=[];Object.keys(o).forEach(l=>{const u=o[l];this._selectionProtectionRuleModel.getSubunitRuleList(n,l).forEach(d=>{a.push({objectID:d.permissionId,unitID:n,objectType:O.SelectRange,actions:Be})}),u.forEach(d=>{se().forEach(c=>{const m=new c(n,l,d.permissionId);m.value=!1,this._permissionService.addPermissionPoint(m)})}),this._selectionProtectionCache.reBuildCache(n,l)})},onUnLoad:n=>{this._selectionProtectionCache.deleteUnit(n)}}))}},g.RangeProtectionService=mu([Gt(0,i.Inject(K)),Gt(1,i.Inject(i.IPermissionService)),Gt(2,i.Inject(i.IResourceManagerService)),Gt(3,i.Inject(g.RangeProtectionCache)),Gt(4,i.Inject(i.IUniverInstanceService))],g.RangeProtectionService);var gu=Object.getOwnPropertyDescriptor,Ru=(s,e,t,n)=>{for(var o=n>1?void 0:n?gu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},zt=(s,e)=>(t,n)=>e(t,n,s);g.WorkbookPermissionService=class extends i.Disposable{constructor(e,t,n,o,r){super(),this._permissionService=e,this._univerInstanceService=t,this._rangeProtectionRuleModel=n,this._worksheetProtectionRuleModel=o,this._worksheetProtectionPointModel=r,this._init()}_init(){const e=t=>{const n=t.getUnitId();It().forEach(o=>{const r=new o(n);this._permissionService.addPermissionPoint(r)})};this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).forEach(t=>{e(t)}),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(i.UniverInstanceType.UNIVER_SHEET).subscribe(t=>{e(t)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(i.UniverInstanceType.UNIVER_SHEET).subscribe(t=>{const n=t.getUnitId();t.getSheets().forEach(o=>{const r=o.getSheetId();this._rangeProtectionRuleModel.getSubunitRuleList(n,r).forEach(l=>{[...se()].forEach(u=>{const d=new u(n,r,l.permissionId);this._permissionService.deletePermissionPoint(d.id)})}),[...oe(),...ge()].forEach(l=>{const u=new l(n,r);this._permissionService.deletePermissionPoint(u.id)})}),It().forEach(o=>{const r=new o(n);this._permissionService.deletePermissionPoint(r.id)}),this._rangeProtectionRuleModel.deleteUnitModel(n),this._worksheetProtectionPointModel.deleteUnitModel(n),this._worksheetProtectionRuleModel.deleteUnitModel(n)}))}},g.WorkbookPermissionService=Ru([zt(0,i.Inject(i.IPermissionService)),zt(1,i.Inject(i.IUniverInstanceService)),zt(2,i.Inject(K)),zt(3,i.Inject(we)),zt(4,i.Inject(vt))],g.WorkbookPermissionService);var Su=Object.getOwnPropertyDescriptor,Cu=(s,e,t,n)=>{for(var o=n>1?void 0:n?Su(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},fu=(s,e)=>(t,n)=>e(t,n,s);g.SheetRangeThemeService=class extends i.Disposable{constructor(e){super(),this._sheetRangeThemeModel=e}registerRangeTheme(e,t){this._sheetRangeThemeModel.registerRangeThemeStyle(e,t)}removeRangeThemeRule(e,t){this._sheetRangeThemeModel.removeRangeThemeRule(e,t)}getALLRegisterThemes(){return this._sheetRangeThemeModel.getALLRegisteredTheme()}registerRangeThemeStyle(e,t){this._sheetRangeThemeModel.registerRangeThemeRule(e,t)}getAppliedRangeThemeStyle(e){return this._sheetRangeThemeModel.getRegisteredRangeThemeStyle(e)}getRegisteredRangeThemes(){return this._sheetRangeThemeModel.getRegisteredRangeThemes()}},g.SheetRangeThemeService=Cu([fu(0,i.Inject(Me))],g.SheetRangeThemeService);var vu=Object.getOwnPropertyDescriptor,Iu=(s,e,t,n)=>{for(var o=n>1?void 0:n?vu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},pu=(s,e)=>(t,n)=>e(t,n,s);g.SheetSkeletonService=class extends i.Disposable{constructor(t){super();f(this,"_sheetSkeletonStore",new Map);this._injector=t,this.disposeWithMe(()=>{this._sheetSkeletonStore=new Map})}getSkeleton(t,n){if(this._sheetSkeletonStore.has(t))return this._sheetSkeletonStore.get(t).get(n)}setSkeleton(t,n,o){this._sheetSkeletonStore.has(t)||this._sheetSkeletonStore.set(t,new Map),this._sheetSkeletonStore.get(t).set(n,o)}deleteSkeleton(t,n){this._sheetSkeletonStore.has(t)&&this._sheetSkeletonStore.get(t).delete(n)}},g.SheetSkeletonService=Iu([pu(0,i.Inject(i.Injector))],g.SheetSkeletonService);var wu=Object.defineProperty,Mu=Object.getOwnPropertyDescriptor,yu=(s,e,t)=>e in s?wu(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,_u=(s,e,t,n)=>{for(var o=n>1?void 0:n?Mu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(o=a(o)||o);return o},ii=(s,e)=>(t,n)=>e(t,n,s),ai=(s,e,t)=>yu(s,typeof e!="symbol"?e+"":e,t);const bu="SHEET_PLUGIN";g.UniverSheetsPlugin=class extends i.Plugin{constructor(e=Lr,t,n){super(),this._config=e,this._injector=t,this._configService=n;const{...o}=i.merge({},Lr,this._config);this._configService.setConfig(Sl,o),this._initConfig(),this._initDependencies()}_initConfig(){var e,t,n;(e=this._config)!=null&&e.onlyRegisterFormulaRelatedMutations&&this._configService.setConfig(Ar,!0),(t=this._config)!=null&&t.isRowStylePrecedeColumnStyle&&this._configService.setConfig(i.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE,!0),(n=this._config)!=null&&n.autoHeightForMergedCells&&this._configService.setConfig(i.AUTO_HEIGHT_FOR_MERGED_CELLS,!0)}_initDependencies(){var t;const e=[[Je],[g.SheetsSelectionsService],[g.RefRangeService],[g.WorkbookPermissionService],[Xe,{useClass:g.NumfmtService}],[g.SheetInterceptorService],[g.SheetRangeThemeService],[g.SheetSkeletonService],[pn],[g.MergeCellController],[_n],[g.DefinedNameDataController],[g.WorksheetPermissionService],[we],[vt],[Tn],[g.SheetPermissionInitController],[g.SheetPermissionCheckController],[Me],[g.RangeProtectionRenderModel],[K],[g.RangeProtectionCache],[g.RangeProtectionRefRangeService],[g.RangeProtectionService],[qs,{useClass:si,deps:[g.SheetsSelectionsService]}]];(t=this._config)!=null&&t.notExecuteFormula||e.push([wn]),i.registerDependencies(this._injector,i.mergeOverrideWithDependencies(e,this._config.override)),i.touchDependencies(this._injector,[[g.SheetInterceptorService],[g.RangeProtectionService],[qs],[g.SheetPermissionInitController]])}onStarting(){i.touchDependencies(this._injector,[[pn],[g.MergeCellController],[g.WorkbookPermissionService],[g.WorksheetPermissionService],[Tn],[g.SheetSkeletonService]])}onRendered(){i.touchDependencies(this._injector,[[Xe]])}onReady(){i.touchDependencies(this._injector,[[wn],[g.DefinedNameDataController],[Me],[_n],[g.RangeProtectionRenderModel],[g.RangeProtectionRefRangeService],[g.RefRangeService],[g.SheetPermissionCheckController]])}},ai(g.UniverSheetsPlugin,"pluginName",bu),ai(g.UniverSheetsPlugin,"type",i.UniverInstanceType.UNIVER_SHEET),g.UniverSheetsPlugin=_u([i.DependentOn(z.UniverFormulaEnginePlugin),ii(1,i.Inject(i.Injector)),ii(2,i.IConfigService)],g.UniverSheetsPlugin);var li=(s=>(s.SET_WORKSHEET_ROW_HEIGHT="sheet.mutation.set-worksheet-row-height",s.SET_WORKSHEET_ROW_IS_AUTO_HEIGHT="sheet.mutation.set-worksheet-row-is-auto-height",s.SET_WORKSHEET_ROW_AUTO_HEIGHT="sheet.mutation.set-worksheet-row-auto-height",s.SET_WORKSHEET_COL_WIDTH="sheet.mutation.set-worksheet-col-width",s.SET_WORKSHEET_ACTIVE="sheet.operation.set-worksheet-active",s.MOVE_ROWS="sheet.mutation.move-rows",s.MOVE_COLUMNS="sheet.mutation.move-columns",s.SET_COL_HIDDEN="sheet.mutation.set-col-hidden",s.SET_COL_VISIBLE="sheet.mutation.set-col-visible",s.SET_ROW_HIDDEN="sheet.mutation.set-row-hidden",s.SET_ROW_VISIBLE="sheet.mutation.set-row-visible",s.INSERT_COL="sheet.mutation.insert-col",s.INSERT_ROW="sheet.mutation.insert-row",s.REMOVE_COL="sheet.mutation.remove-col",s.REMOVE_ROW="sheet.mutation.remove-row",s.TOGGLE_GRIDLINES="sheet.mutation.toggle-gridlines",s.SET_GRIDLINES_COLOR="sheet.mutation.set-gridlines-color",s))(li||{}),ui=(s=>(s.SET_RANGE_VALUES="sheet.mutation.set-range-values",s.MOVE_RANGE="sheet.mutation.move-range",s.REMOVE_WORKSHEET_MERGE="sheet.mutation.remove-worksheet-merge",s.ADD_WORKSHEET_MERGE="sheet.mutation.add-worksheet-merge",s.REORDER_RANGE="sheet.mutation.reorder-range",s.SET_WORKSHEET_DEFAULT_STYLE="sheet.mutation.set-worksheet-default-style",s.SET_ROW_DATA="sheet.mutation.set-row-data",s.SET_COL_DATA="sheet.mutation.set-col-data",s.SET_WORKSHEET_RANGE_THEME_STYLE="sheet.mutation.set-worksheet-range-theme-style",s.DELETE_WORKSHEET_RANGE_THEME_STYLE="sheet.mutation.delete-worksheet-range-theme-style",s))(ui||{});const Tu=[Ne.id,Re.id,Os.id,ke.id,Ct.id,Ue.id,Pe.id,ct.id,mt.id,St.id,Rt.id,de.id,Se.id,re.id,Ce.id,pt.id,ht.id],Eu=[H.id,Ae.id,G.id,F.id,Wt.id,ft.id,gt.id,dt.id,tt.id,nt.id];function Uu(s){switch(s.id){case"sheet.mutation.set-range-values":{const e=s.params,t=new i.ObjectMatrix(e.cellValue).getDataRange();return t.endRow===-1?[]:e.cellValue?[{unitId:e.unitId,subUnitId:e.subUnitId,range:t}]:[]}case"sheet.mutation.move-range":{const e=s.params;return[{unitId:e.unitId,subUnitId:e.from.subUnitId,range:new i.ObjectMatrix(e.from.value).getRange()},{unitId:e.unitId,subUnitId:e.to.subUnitId,range:new i.ObjectMatrix(e.to.value).getRange()}]}case"sheet.mutation.remove-worksheet-merge":{const e=s.params;return e.ranges.map(t=>({unitId:e.unitId,subUnitId:e.subUnitId,range:t}))}case"sheet.mutation.add-worksheet-merge":{const e=s.params;return e.ranges.map(t=>({unitId:e.unitId,subUnitId:e.subUnitId,range:t}))}case"sheet.mutation.reorder-range":{const e=s.params;return[{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range}]}case"sheet.mutation.set-worksheet-default-style":{const e=s.params;return[{unitId:e.unitId,subUnitId:e.subUnitId,range:{startRow:0,endRow:Number.MAX_SAFE_INTEGER,startColumn:0,endColumn:Number.MAX_SAFE_INTEGER}}]}case"sheet.mutation.set-row-data":{const e=s.params,t=Object.keys(e.rowData).map(Number);return t.length===0?[]:[{unitId:e.unitId,subUnitId:e.subUnitId,range:{startRow:Math.min(...t),endRow:Math.max(...t),startColumn:0,endColumn:Number.MAX_SAFE_INTEGER}}]}case"sheet.mutation.set-col-data":{const e=s.params,t=Object.keys(e.columnData).map(Number);return t.length===0?[]:[{unitId:e.unitId,subUnitId:e.subUnitId,range:{startRow:0,endRow:Number.MAX_SAFE_INTEGER,startColumn:Math.min(...t),endColumn:Math.max(...t)}}]}case"sheet.mutation.set-worksheet-range-theme-style":case"sheet.mutation.delete-worksheet-range-theme-style":{const e=s.params;return[{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range}]}default:return[]}}function Pu(s,e){switch(s.id){case"sheet.mutation.set-worksheet-row-height":case"sheet.mutation.set-worksheet-row-is-auto-height":{const t=s.params;return t.ranges.map(n=>({unitId:t.unitId,subUnitId:t.subUnitId,range:{...n,rangeType:i.RANGE_TYPE.ROW}}))}case"sheet.mutation.set-worksheet-row-auto-height":{const t=s.params;return t.rowsAutoHeightInfo.map(n=>({unitId:t.unitId,subUnitId:t.subUnitId,range:{startRow:n.row,endRow:n.row,startColumn:0,endColumn:e-1,rangeType:i.RANGE_TYPE.ROW}}))}case"sheet.mutation.set-worksheet-col-width":{const t=s.params;return t.ranges.map(n=>({unitId:t.unitId,subUnitId:t.subUnitId,range:{...n,rangeType:i.RANGE_TYPE.COLUMN}}))}case"sheet.mutation.move-rows":case"sheet.mutation.move-columns":{const t=s.params;return[{unitId:t.unitId,subUnitId:t.subUnitId,range:t.targetRange},{unitId:t.unitId,subUnitId:t.subUnitId,range:t.sourceRange}]}case"sheet.mutation.set-col-hidden":case"sheet.mutation.set-col-visible":{const t=s.params;return t.ranges.map(n=>({unitId:t.unitId,subUnitId:t.subUnitId,range:{...n,rangeType:i.RANGE_TYPE.COLUMN}}))}case"sheet.mutation.set-row-hidden":case"sheet.mutation.set-row-visible":{const t=s.params;return t.ranges.map(n=>({unitId:t.unitId,subUnitId:t.subUnitId,range:{...n,rangeType:i.RANGE_TYPE.ROW}}))}case"sheet.mutation.insert-col":{const t=s.params;return[{unitId:t.unitId,subUnitId:t.subUnitId,range:{...t.range,rangeType:i.RANGE_TYPE.COLUMN}}]}case"sheet.mutation.insert-row":{const t=s.params;return[{unitId:t.unitId,subUnitId:t.subUnitId,range:{...t.range,rangeType:i.RANGE_TYPE.ROW}}]}case"sheet.mutation.remove-col":{const t=s.params;return[{unitId:t.unitId,subUnitId:t.subUnitId,range:{...t.range,rangeType:i.RANGE_TYPE.COLUMN}}]}case"sheet.mutation.remove-row":{const t=s.params;return[{unitId:t.unitId,subUnitId:t.subUnitId,range:{...t.range,rangeType:i.RANGE_TYPE.ROW}}]}case"sheet.mutation.toggle-gridlines":case"sheet.mutation.set-gridlines-color":return[];default:return[]}}const ku=1.5,Nu="rgba(255, 255, 255, 0.01)";function Ou(s){const{rangeWithCoord:e,primaryWithCoord:t,style:n}=s,o={range:{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn,rangeType:e.rangeType,unitId:e.unitId,sheetId:e.sheetId},primary:null,style:n};return t!=null&&(o.primary=di(t)),o}function di(s){const{actualRow:e,actualColumn:t,isMerged:n,isMergedMainCell:o}=s,{startRow:r,startColumn:a,endRow:l,endColumn:u}=s.mergeInfo;return{actualRow:e,actualColumn:t,isMerged:n,isMergedMainCell:o,startRow:r,startColumn:a,endRow:l,endColumn:u}}const Du=(s,e,t)=>{const o=s.get(g.SheetsSelectionsService).getCurrentSelections(),{value:r,selections:a,unitId:l,subUnitId:u}=e;if(o){const c=o[(o==null?void 0:o.length)-1].primary;if(c){const{actualColumn:m,actualRow:h}=c;let{startRow:R,startColumn:S,endRow:C,endColumn:v}=a[a.length-1];if(r===i.Dimension.COLUMNS){const M=t.find(y=>y.startColumn===m&&y.endColumn===m&&h===y.startRow);M&&(v=M.endColumn,R=M.startRow,C=M.endRow)}else if(r===i.Dimension.ROWS){const M=t.find(y=>y.startRow===h&&y.endRow===h&&m===y.startColumn);M&&(C=M.endRow,S=M.startColumn,v=M.endColumn)}const I={startRow:R,startColumn:S,endRow:C,endColumn:v,actualRow:h,actualColumn:m,isMerged:!0,isMergedMainCell:R===h&&S===m},w=o.map((M,y,b)=>({range:M.range,style:null,primary:y===b.length-1?I:null})),p={unitId:l,subUnitId:u,type:Q.ONLY_SET,selections:w};return{id:q.id,params:p}}return null}return null},Au=(s,e)=>{const n=s.get(g.SheetsSelectionsService).getCurrentSelections(),{unitId:o,subUnitId:r}=e;if(n&&n[(n==null?void 0:n.length)-1].primary){const u={unitId:o,subUnitId:r,type:Q.ONLY_SET,selections:[...n]};return{id:q.id,params:u}}return null};function ci(s){return s==null?!1:s.v!==void 0&&s.v!==null&&s.v!==""||s.p!==void 0}function En(s,e){return s&&s.spanAnchor?ci(e.getValue(s.spanAnchor.startRow,s.spanAnchor.startColumn)):ci(s)}function Wu(s,e,t,n,o){const r=s.getCellMatrix(),a=s.getSpanModel().getMergedCellRange(e,t,n,o),l=new i.ObjectMatrix;return r.forValue((u,d)=>{const c=r.getValue(u,d);c&&l.setValue(u,d,c)}),a.forEach(u=>{const{startColumn:d,startRow:c,endColumn:m,endRow:h}=u;i.createRowColIter(c,h,d,m).forEach((R,S)=>{R===c&&S===d&&l.setValue(R,S,{...r.getValue(R,S),spanAnchor:{startRow:c,endRow:h,startColumn:d,endColumn:m}}),(R!==c||S!==d)&&(l.realDeleteValue(R,S),l.setValue(R,S,{spanAnchor:{startRow:c,endRow:h,startColumn:d,endColumn:m}}))})}),l}function Vu(s,e,t,n){const{startRow:o,startColumn:r,endRow:a}=s;let l=null,u=!1;for(let d=o;d<=a;d++){const c=e.getValue(d,r-t);if(u=u||En(c,e),!n&&u)break;c&&c.spanAnchor&&(l?l={startRow:Math.min(c.spanAnchor.startRow,l.startRow),startColumn:Math.min(c.spanAnchor.startColumn,l.startColumn),endRow:Math.max(c.spanAnchor.endRow,l.endRow),endColumn:Math.max(c.spanAnchor.endColumn,l.endColumn)}:l={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return u?(s.startColumn=s.startColumn-t,{spanAnchor:l,hasValue:!0,range:s}):{spanAnchor:null,hasValue:!1,range:s}}function Lu(s,e,t,n){const{startRow:o,endColumn:r,endRow:a}=s;let l=null,u=!1;for(let d=o;d<=a;d++){const c=e.getValue(d,r+t);if(u=u||En(c,e),!n&&u)break;c&&c.spanAnchor&&(l?l={startRow:Math.min(c.spanAnchor.startRow,l.startRow),startColumn:Math.min(c.spanAnchor.startColumn,l.startColumn),endRow:Math.max(c.spanAnchor.endRow,l.endRow),endColumn:Math.max(c.spanAnchor.endColumn,l.endColumn)}:l={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return u?(s.endColumn=s.endColumn+t,{spanAnchor:l,hasValue:!0,range:s}):{spanAnchor:null,hasValue:!1,range:s}}function $u(s,e,t,n){const{startRow:o,startColumn:r,endColumn:a}=s;let l=null,u=!1;for(let d=r;d<=a;d++){const c=e.getValue(o-t,d);if(u=u||En(c,e),!n&&u)break;c&&c.spanAnchor&&(l?l={startRow:Math.min(c.spanAnchor.startRow,l.startRow),startColumn:Math.min(c.spanAnchor.startColumn,l.startColumn),endRow:Math.max(c.spanAnchor.endRow,l.endRow),endColumn:Math.max(c.spanAnchor.endColumn,l.endColumn)}:l={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return u?(s.startRow=s.startRow-t,{spanAnchor:l,hasValue:!0,range:s}):{spanAnchor:null,hasValue:!1,range:s}}function Bu(s,e,t,n){const{startColumn:o,endColumn:r,endRow:a}=s;let l=null,u=!1;for(let d=o;d<=r;d++){const c=e.getValue(a+t,d);if(u=u||En(c,e),!n&&u)break;c&&c.spanAnchor&&(l?l={startRow:Math.min(c.spanAnchor.startRow,l.startRow),startColumn:Math.min(c.spanAnchor.startColumn,l.startColumn),endRow:Math.max(c.spanAnchor.endRow,l.endRow),endColumn:Math.max(c.spanAnchor.endColumn,l.endColumn)}:l={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return u?(s.endRow=s.endRow+t,{spanAnchor:l,hasValue:!0,range:s}):{spanAnchor:null,hasValue:!1,range:s}}function Hu(s,e,t){const n=t.getMaxRows(),o=t.getMaxColumns(),r=Wu(t,0,0,n-1,o-1),a=t.getSnapshot().mergeData.length>0,{left:l,right:u,up:d,down:c}=e;let m=!0,h={...s};const R=[];for(;m;){if(m=!1,d&&h.startRow!==0){const{hasValue:S,range:C,spanAnchor:v}=$u(h,r,1,a);if(v&&R.push(v),S){h=C,m=!0;continue}}if(c&&h.endRow!==n-1){const{hasValue:S,range:C,spanAnchor:v}=Bu(h,r,1,a);if(v&&R.push(v),S){h=C,m=!0;continue}}if(l&&h.startColumn!==0){const{hasValue:S,range:C,spanAnchor:v}=Vu(h,r,1,a);if(v&&R.push(v),S){h=C,m=!0;continue}}if(u&&h.endColumn!==o-1){const{hasValue:S,range:C,spanAnchor:v}=Lu(h,r,1,a);if(v&&R.push(v),S){h=C,m=!0;continue}}}return R.length>0&&(h=i.Rectangle.union(h,...R)),h}const mi=(s,e,t,n=1,o=!0,r=!0)=>{const a=i.Range.transformRange(s,e),{startRow:l,endRow:u}=a;let d=t.startRow-n,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;for(;!e.getRowVisible(d)||!m;)d--,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;if(d>=l)return{...t,startRow:d,endRow:d};if(r){const h={...t,startRow:u,endRow:u};return gi(s,e,h,n,o,!1)}},hi=(s,e,t,n=1,o=!0,r=!0)=>{const a=i.Range.transformRange(s,e),{startRow:l,endRow:u}=a;let d=t.endRow+n,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;for(;!e.getRowVisible(d)||!m;)d++,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;if(d<=u)return{...t,startRow:d,endRow:d};if(r){const h={...t,startRow:l,endRow:l};return Ri(s,e,h,n,o,!1)}},gi=(s,e,t,n=1,o=!0,r=!0)=>{const a=i.Range.transformRange(s,e),{startColumn:l,endColumn:u}=a;let d=t.startColumn-n,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;for(;!e.getColVisible(d)||!m;)d--,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;if(d>=l)return{...t,startColumn:d,endColumn:d};if(r){const h={...t,startColumn:u,endColumn:u};return mi(s,e,h,n,o,!1)}},Ri=(s,e,t,n=1,o=!0,r=!0)=>{const a=i.Range.transformRange(s,e),{startColumn:l,endColumn:u}=a;let d=t.endColumn+n,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;for(;!e.getColVisible(d)||!m;)d++,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;if(d<=u)return{...t,endColumn:d,startColumn:d};if(r){const h={...t,startColumn:l,endColumn:l};return hi(s,e,h,n,o,!1)}};function Un(s,e,t){let n=null;return t.getMatrixWithMergedCells(s,e,s,e).forValue((r,a,l)=>(n={actualRow:r,actualColumn:a,startRow:r,startColumn:a,isMerged:l.rowSpan!==void 0||l.colSpan!==void 0,isMergedMainCell:l.rowSpan!==void 0&&l.colSpan!==void 0,endRow:r+(l.rowSpan!==void 0?l.rowSpan-1:0),endColumn:a+(l.colSpan!==void 0?l.colSpan-1:0),rangeType:i.RANGE_TYPE.NORMAL},!1)),n||{actualColumn:e,actualRow:s,startRow:s,startColumn:e,endRow:s,endColumn:e,isMerged:!1,isMergedMainCell:!1,rangeType:i.RANGE_TYPE.NORMAL}}const ju=(s,e,t,n,o=1)=>{switch(n){case i.Direction.UP:return mi(s,e,t,o);case i.Direction.DOWN:return hi(s,e,t,o);case i.Direction.LEFT:return gi(s,e,t,o);case i.Direction.RIGHT:return Ri(s,e,t,o)}},Fu=(s,e,t)=>{let n,o=-1,r;for(let I=0;I<s.length;I++)if(s[I].primary){n=s[I],o=I,r=n.primary;break}if(o===-1)return null;const a=e===i.Direction.LEFT||e===i.Direction.UP,l=a?o-1>=0?o-1:s.length-1:o+1<s.length?o+1:0,u=s[l];if(!n||!r)return null;const d={...r},{startRow:c,startColumn:m,endRow:h,endColumn:R}=n.range,S=a?d.startRow===c&&d.startColumn===m:d.endRow===h&&d.endColumn===R,C=S&&a;if(!i.Rectangle.equals(n.range,d)){const I=S?u.range:ju(n.range,t,d,e);if(!I)return null;const w=C?Un(I.endRow,I.endColumn,t):Un(I.startRow,I.startColumn,t);return{startRow:w.startRow,startColumn:w.startColumn,endRow:w.endRow,endColumn:w.endColumn}}const v=C?Un(u.range.endRow,u.range.endColumn,t):Un(u.range.startRow,u.range.startColumn,t);return{startRow:v.startRow,startColumn:v.startColumn,endRow:v.endRow,endColumn:v.endColumn}},Gu={WorkbookCommentPermission:Vn,WorkbookCopyPermission:Ln,WorkbookCreateProtectPermission:$n,WorkbookCreateSheetPermission:Bn,WorkbookDeleteSheetPermission:Hn,WorkbookDuplicatePermission:jn,WorkbookEditablePermission:ae,WorkbookExportPermission:Fn,WorkbookHideSheetPermission:sn,WorkbookHistoryPermission:yo,WorkbookManageCollaboratorPermission:on,WorkbookMoveSheetPermission:rn,WorkbookPrintPermission:Gn,WorkbookRecoverHistoryPermission:zn,WorkbookRenameSheetPermission:an,WorkbookSharePermission:qn,WorkbookViewHistoryPermission:Kn,WorkbookViewPermission:Yn,WorksheetCopyPermission:Jn,WorksheetDeleteColumnPermission:xn,WorksheetDeleteProtectionPermission:Xn,WorksheetDeleteRowPermission:Zn,WorksheetEditExtraObjectPermission:Qn,WorksheetEditPermission:me,WorksheetFilterPermission:es,WorksheetInsertColumnPermission:ts,WorksheetInsertHyperlinkPermission:ns,WorksheetInsertRowPermission:ss,WorksheetManageCollaboratorPermission:os,WorksheetPivotTablePermission:rs,WorksheetSetCellStylePermission:is,WorksheetSetCellValuePermission:Ut,WorksheetSetColumnStylePermission:ot,WorksheetSetRowStylePermission:rt,WorksheetSortPermission:as,WorksheetViewPermission:Pt,RangeProtectionPermissionEditPoint:ce,RangeProtectionPermissionViewPoint:nn},zu=(s,e,t,n)=>{const o=s.get(i.IPermissionService),r=s.get(K),a=o.getPermissionPoint(new ae(e).id);if(!(a!=null&&a.value))return!1;const l=o.getPermissionPoint(new me(e,t).id);if(!(l!=null&&l.value))return!1;const d=r.getSubunitRuleList(e,t).filter(c=>c.ranges.some(m=>n.some(h=>i.Rectangle.intersects(m,h))));return d.length?d.every(c=>{const m=c.permissionId,h=o.getPermissionPoint(new ce(e,t,m).id);return!!(h!=null&&h.value)}):!0};function qu(s,e){return e.some(t=>Yu(s,t))}function Yu(s,e){const{startRow:t,startColumn:n,endColumn:o,endRow:r}=e,a=s.getMatrixWithMergedCells(t,n,r,o);let l=!1;return a.forValue((u,d,c)=>{if(c&&(u!==t||d!==n)&&s.cellHasValue(c))return l=!0,!1}),l}function Ku(s,e,t,n){const o=[],r=[],a=t.getSheetId();return n.forEach(l=>{const u=Ju(t,l),d={unitId:e,subUnitId:a,cellValue:u.getData()},c=ie(s,d);o.push({id:H.id,params:c}),r.push({id:H.id,params:d})}),{undos:o,redos:r}}function Ju(s,e){const{startRow:t,startColumn:n,endColumn:o,endRow:r}=e,a=s.getMatrixWithMergedCells(t,n,r,o,i.CellModeEnum.Intercepted),l=new i.ObjectMatrix;return a.forValue((u,d,c)=>{c&&(u!==t||d!==n)&&l.setValue(u,d,null)}),l}const qt={type:i.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge",handler:(s,e)=>{const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=s.get(i.IUniverInstanceService),r=e.unitId,a=e.subUnitId,l=e.selections,u=Gs(l,e.value),d=o.getUniverSheetInstance(r).getSheetBySheetId(a),c=[],m=[],h=qu(d,u),R={unitId:r,subUnitId:a,ranges:u},S={unitId:r,subUnitId:a,ranges:u};c.push({id:G.id,params:R}),c.push({id:F.id,params:S});const C=ne(s,R),v=he(s,S);if(m.push({id:G.id,params:v}),m.push({id:F.id,params:C}),h){const w=Ku(s,r,d,u);c.unshift(...w.redos),m.push(...w.undos)}return i.sequenceExecute(c,t).result?(n.pushUndoRedo({unitID:r,undoMutations:m,redoMutations:c}),!0):!1}},xu={type:i.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge-all",handler:async s=>{var d;const e=s.get(i.ICommandService),n=(d=s.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:d.map(c=>c.range);if(!(n!=null&&n.length))return!1;const r=s.get(i.IUniverInstanceService).getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const a=r.getActiveSheet();if(!a)return!1;const l=r.getUnitId(),u=a.getSheetId();return e.executeCommand(qt.id,{selections:n,unitId:l,subUnitId:u})}},Xu={type:i.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge-vertical",handler:async s=>{var d;const e=s.get(i.ICommandService),n=(d=s.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:d.map(c=>c.range);if(!(n!=null&&n.length))return!1;const r=s.get(i.IUniverInstanceService).getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const a=r.getActiveSheet();if(!a)return!1;const l=r.getUnitId(),u=a.getSheetId();return e.executeCommand(qt.id,{value:i.Dimension.COLUMNS,selections:n,unitId:l,subUnitId:u})}},Zu={type:i.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge-horizontal",handler:async s=>{var d;const e=s.get(i.ICommandService),n=(d=s.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:d.map(c=>c.range);if(!(n!=null&&n.length))return!1;const r=s.get(i.IUniverInstanceService).getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const a=r.getActiveSheet();if(!a)return!1;const l=r.getUnitId(),u=a.getSheetId();return e.executeCommand(qt.id,{value:i.Dimension.ROWS,selections:n,unitId:l,subUnitId:u})}};function Qu(s,e,t,n,o){const r=s.get(i.IUniverInstanceService),a=U(r,{unitId:e,subUnitId:t});if(!a)return;const{worksheet:l}=a;if(l.getMergeData().some(m=>n.some(h=>i.Rectangle.intersects(h,m))))throw new Error("The ranges to be merged overlap with the existing merged cells");s.get(i.ICommandService).executeCommand(qt.id,{unitId:e,subUnitId:t,selections:n,defaultMerge:o})}const ed=(s,e)=>{const r=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId).getSheetBySheetId(e.subUnitId).getConfig().rightToLeft;return{...i.Tools.deepClone(e),rightToLeft:r}},Pn={id:"sheet.mutation.set-worksheet-right-to-left",type:i.CommandType.MUTATION,handler:(s,e)=>{const t=s.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getSheetBySheetId(e.subUnitId);if(!n)return!1;const o=n.getConfig();return o.rightToLeft=e.rightToLeft,!0}},td={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-right-to-left",handler:async(s,e)=>{var m;const t=s.get(i.ICommandService),n=s.get(i.IUndoRedoService),o=U(s.get(i.IUniverInstanceService),e);if(!o)return!1;const{unitId:r,subUnitId:a}=o;let l=i.BooleanNumber.FALSE;e&&(l=(m=e.rightToLeft)!=null?m:i.BooleanNumber.FALSE);const u={rightToLeft:l,unitId:r,subUnitId:a},d=ed(s,u);return t.syncExecuteCommand(Pn.id,u)?(n.pushUndoRedo({unitID:r,undoMutations:[{id:Pn.id,params:d}],redoMutations:[{id:Pn.id,params:u}]}),!0):!1}};g.AFTER_CELL_EDIT=Yt,g.AFTER_CELL_EDIT_ASYNC=Kt,g.AddMergeRedoSelectionsOperationFactory=Du,g.AddMergeUndoMutationFactory=he,g.AddMergeUndoSelectionsOperationFactory=Au,g.AddRangeProtectionCommand=xs,g.AddRangeProtectionMutation=ue,g.AddWorksheetMergeAllCommand=xu,g.AddWorksheetMergeCommand=qt,g.AddWorksheetMergeHorizontalCommand=Zu,g.AddWorksheetMergeMutation=F,g.AddWorksheetMergeVerticalCommand=Xu,g.AddWorksheetProtectionCommand=Xs,g.AddWorksheetProtectionMutation=Oe,g.AppendRowCommand=mo,g.BEFORE_CELL_EDIT=Nn,g.BorderStyleManagerService=Je,g.COMMAND_LISTENER_SKELETON_CHANGE=Tu,g.COMMAND_LISTENER_VALUE_CHANGE=Eu,g.CancelFrozenCommand=tr,g.ClearSelectionAllCommand=Xt,g.ClearSelectionContentCommand=Zt,g.ClearSelectionFormatCommand=Qt,g.CopySheetCommand=Wn,g.DISABLE_NORMAL_SELECTIONS=na,g.DeleteRangeMoveLeftCommand=Ye,g.DeleteRangeMoveUpCommand=Ke,g.DeleteRangeProtectionCommand=To,g.DeleteRangeProtectionMutation=pe,g.DeleteWorksheetProtectionCommand=Eo,g.DeleteWorksheetProtectionMutation=Fe,g.DeleteWorksheetRangeThemeStyleCommand=Uo,g.DeleteWorksheetRangeThemeStyleMutation=nt,g.DeleteWorksheetRangeThemeStyleMutationFactory=io,g.DeltaColumnWidthCommand=mn,g.DeltaRowHeightCommand=Sn,g.EditStateEnum=Js,g.EffectRefRangId=D,g.EmptyMutation=Pr,g.ExclusiveRangeService=si,g.FactoryAddRangeProtectionMutation=fi,g.FactoryDeleteRangeProtectionMutation=Ci,g.FactorySetRangeProtectionMutation=Oa,g.IExclusiveRangeService=qs,g.INTERCEPTOR_POINT=Ee,g.INumfmtService=Xe,g.IRefSelectionsService=vo,g.InsertColAfterCommand=Wo,g.InsertColBeforeCommand=Ao,g.InsertColByRangeCommand=ms,g.InsertColCommand=Ve,g.InsertColMutation=de,g.InsertColMutationUndoFactory=_t,g.InsertDefinedNameCommand=Po,g.InsertRangeMoveDownCommand=at,g.InsertRangeMoveRightCommand=kt,g.InsertRowAfterCommand=Oo,g.InsertRowBeforeCommand=No,g.InsertRowByRangeCommand=cs,g.InsertRowCommand=We,g.InsertRowMutation=Se,g.InsertRowMutationUndoFactory=Jt,g.InsertSheetCommand=Vo,g.InsertSheetMutation=st,g.InsertSheetUndoMutationFactory=An,g.InterceptCellContentPriority=Zs,g.MAX_CELL_PER_SHEET_KEY=Wr,g.MERGE_CELL_INTERCEPTOR_CHECK=ti,g.MoveColsCommand=Ot,g.MoveColsMutation=Pe,g.MoveColsMutationUndoFactory=$o,g.MoveRangeCommand=qe,g.MoveRangeMutation=Ae,g.MoveRowsCommand=Nt,g.MoveRowsMutation=Ue,g.MoveRowsMutationUndoFactory=Lo,g.OperatorType=V,g.PermissionPointsDefinitions=Gu,g.REF_SELECTIONS_ENABLED=So,g.RangeMergeUtil=ll,g.RangeProtectionPermissionDeleteProtectionPoint=Ps,g.RangeProtectionPermissionEditPoint=ce,g.RangeProtectionPermissionManageCollaPoint=ks,g.RangeProtectionPermissionViewPoint=nn,g.RangeProtectionRuleModel=K,g.RangeThemeStyle=De,g.RegisterWorksheetRangeThemeStyleCommand=Fo,g.RegisterWorksheetRangeThemeStyleMutation=lt,g.RemoveColByRangeCommand=Cs,g.RemoveColCommand=At,g.RemoveColMutation=re,g.RemoveDefinedNameCommand=hs,g.RemoveMergeUndoMutationFactory=ne,g.RemoveNumfmtMutation=Vs,g.RemoveRowByRangeCommand=Rs,g.RemoveRowCommand=Dt,g.RemoveRowMutation=Ce,g.RemoveSheetCommand=un,g.RemoveSheetMutation=ze,g.RemoveSheetUndoMutationFactory=Co,g.RemoveWorksheetMergeCommand=Go,g.RemoveWorksheetMergeMutation=G,g.ReorderRangeCommand=dn,g.ReorderRangeMutation=Wt,g.ReorderRangeUndoMutationFactory=zo,g.ResetBackgroundColorCommand=dr,g.ResetTextColorCommand=lr,g.SCOPE_WORKBOOK_VALUE_DEFINED_NAME=Il,g.SELECTIONS_ENABLED=sa,g.SELECTION_CONTROL_BORDER_BUFFER_COLOR=Nu,g.SELECTION_CONTROL_BORDER_BUFFER_WIDTH=ku,g.ScrollToCellOperation=Dr,g.SelectRangeCommand=po,g.SelectionMoveType=Q,g.SetBackgroundColorCommand=ur,g.SetBoldCommand=La,g.SetBorderBasicCommand=xo,g.SetBorderColorCommand=Jo,g.SetBorderCommand=ut,g.SetBorderPositionCommand=Yo,g.SetBorderStyleCommand=Ko,g.SetColDataCommand=Zo,g.SetColDataMutation=dt,g.SetColDataMutationFactory=Xo,g.SetColHiddenCommand=Is,g.SetColHiddenMutation=ct,g.SetColVisibleMutation=mt,g.SetColWidthCommand=Bt,g.SetDefinedNameCommand=ps,g.SetFontFamilyCommand=Fa,g.SetFontSizeCommand=Ga,g.SetFrozenCommand=er,g.SetFrozenMutation=Le,g.SetFrozenMutationFactory=ws,g.SetGridlinesColorCommand=nr,g.SetGridlinesColorMutation=ht,g.SetHorizontalTextAlignCommand=mr,g.SetItalicCommand=$a,g.SetNumfmtMutation=vn,g.SetOverlineCommand=ja,g.SetProtectionCommand=sr,g.SetRangeProtectionMutation=X,g.SetRangeValuesCommand=it,g.SetRangeValuesMutation=H,g.SetRangeValuesUndoMutationFactory=ie,g.SetRowDataCommand=rr,g.SetRowDataMutation=gt,g.SetRowDataMutationFactory=or,g.SetRowHeightCommand=Cn,g.SetRowHiddenCommand=ys,g.SetRowHiddenMutation=St,g.SetRowVisibleMutation=Rt,g.SetSelectedColsVisibleCommand=vs,g.SetSelectedRowsVisibleCommand=Ms,g.SetSelectionsOperation=q,g.SetSpecificColsVisibleCommand=Vt,g.SetSpecificRowsVisibleCommand=Lt,g.SetStrikeThroughCommand=Ha,g.SetStyleCommand=Z,g.SetTabColorCommand=Rr,g.SetTabColorMutation=$t,g.SetTextColorCommand=ar,g.SetTextRotationCommand=gr,g.SetTextWrapCommand=hr,g.SetUnderlineCommand=Ba,g.SetVerticalTextAlignCommand=cr,g.SetWorkbookNameCommand=bs,g.SetWorkbookNameMutation=_s,g.SetWorksheetActivateCommand=Ts,g.SetWorksheetActiveOperation=Ct,g.SetWorksheetColWidthMutation=ke,g.SetWorksheetColWidthMutationFactory=Es,g.SetWorksheetDefaultStyleCommand=Cr,g.SetWorksheetDefaultStyleMutation=ft,g.SetWorksheetDefaultStyleMutationFactory=Sr,g.SetWorksheetHideCommand=vr,g.SetWorksheetHideMutation=$e,g.SetWorksheetNameCommand=hn,g.SetWorksheetNameMutation=Ht,g.SetWorksheetOrderCommand=Us,g.SetWorksheetOrderMutation=jt,g.SetWorksheetPermissionPointsCommand=pr,g.SetWorksheetPermissionPointsMutation=Rn,g.SetWorksheetProtectionCommand=wr,g.SetWorksheetProtectionMutation=xe,g.SetWorksheetRangeThemeStyleCommand=ao,g.SetWorksheetRangeThemeStyleMutation=tt,g.SetWorksheetRangeThemeStyleMutationFactory=ro,g.SetWorksheetRightToLeftCommand=td,g.SetWorksheetRightToLeftMutation=Pn,g.SetWorksheetRowAutoHeightMutation=Os,g.SetWorksheetRowAutoHeightMutationFactory=tl,g.SetWorksheetRowHeightMutation=Ne,g.SetWorksheetRowIsAutoHeightCommand=fn,g.SetWorksheetRowIsAutoHeightMutation=Re,g.SetWorksheetShowCommand=Ds,g.SheetSkeletonChangeType=li,g.SheetValueChangeType=ui,g.SplitDelimiterEnum=yr,g.SplitTextToColumnsCommand=br,g.ToggleCellCheckboxCommand=Tr,g.ToggleGridlinesCommand=Er,g.ToggleGridlinesMutation=pt,g.UnitAction=_,g.UnitObject=O,g.UnregisterWorksheetRangeThemeStyleCommand=Ur,g.UnregisterWorksheetRangeThemeStyleMutation=ln,g.ViewStateEnum=Ks,g.WorkbookCommentPermission=Vn,g.WorkbookCopyPermission=Ln,g.WorkbookCopySheetPermission=Mo,g.WorkbookCreateProtectPermission=$n,g.WorkbookCreateSheetPermission=Bn,g.WorkbookDeleteSheetPermission=Hn,g.WorkbookDuplicatePermission=jn,g.WorkbookEditablePermission=ae,g.WorkbookExportPermission=Fn,g.WorkbookHideSheetPermission=sn,g.WorkbookHistoryPermission=yo,g.WorkbookManageCollaboratorPermission=on,g.WorkbookMoveSheetPermission=rn,g.WorkbookPrintPermission=Gn,g.WorkbookRecoverHistoryPermission=zn,g.WorkbookRenameSheetPermission=an,g.WorkbookSelectionModel=Ro,g.WorkbookSharePermission=qn,g.WorkbookViewHistoryPermission=Kn,g.WorkbookViewPermission=Yn,g.WorksheetCopyPermission=Jn,g.WorksheetDeleteColumnPermission=xn,g.WorksheetDeleteProtectionPermission=Xn,g.WorksheetDeleteRowPermission=Zn,g.WorksheetEditExtraObjectPermission=Qn,g.WorksheetEditPermission=me,g.WorksheetFilterPermission=es,g.WorksheetInsertColumnPermission=ts,g.WorksheetInsertHyperlinkPermission=ns,g.WorksheetInsertRowPermission=ss,g.WorksheetManageCollaboratorPermission=os,g.WorksheetPivotTablePermission=rs,g.WorksheetProtectionPointModel=vt,g.WorksheetProtectionRuleModel=we,g.WorksheetSelectProtectedCellsPermission=ha,g.WorksheetSelectUnProtectedCellsPermission=ga,g.WorksheetSetCellStylePermission=is,g.WorksheetSetCellValuePermission=Ut,g.WorksheetSetColumnStylePermission=ot,g.WorksheetSetRowStylePermission=rt,g.WorksheetSortPermission=as,g.WorksheetViewPermission=Pt,g.addMergeCellsUtil=Qu,g.adjustRangeOnMutation=Kr,g.alignToMergedCellsBorders=Tt,g.baseProtectionActions=Be,g.checkCellValueType=On,g.checkRangesEditablePermission=zu,g.convertPrimaryWithCoordToPrimary=di,g.convertSelectionDataToRange=Ou,g.copyRangeStyles=Et,g.createTopMatrixFromMatrix=Nr,g.createTopMatrixFromRanges=kr,g.defaultWorkbookPermissionPoints=Ir,g.defaultWorksheetPermissionPoint=gn,g.expandToContinuousRange=Hu,g.factoryRemoveNumfmtUndoMutation=dl,g.factorySetNumfmtUndoMutation=ul,g.findAllRectangle=As,g.followSelectionOperation=ye,g.generateNullCell=Dn,g.generateNullCellValue=ho,g.getAddMergeMutationRangeByType=Gs,g.getAllRangePermissionPoint=se,g.getAllWorkbookPermissionPoint=It,g.getAllWorksheetPermissionPoint=oe,g.getAllWorksheetPermissionPointByPointPanel=ge,g.getCellAtRowCol=ra,g.getDefaultRangePermission=Ja,g.getInsertRangeMutations=ls,g.getMoveRangeUndoRedoMutations=en,g.getNextPrimaryCell=Fu,g.getPrimaryForRange=te,g.getRemoveRangeMutations=us,g.getSelectionsService=Io,g.getSeparateEffectedRangesOnCommand=Vl,g.getSheetCommandTarget=U,g.getSheetCommandTargetWorkbook=oo,g.getSheetMutationTarget=Ge,g.getSkeletonChangedEffectedRange=Pu,g.getValueChangedEffectedRange=Uu,g.getVisibleRanges=bt,g.handleBaseInsertRange=Qe,g.handleBaseMoveRowsCols=Ft,g.handleBaseRemoveRange=Ze,g.handleCommonDefaultRangeChangeWithEffectRefCommands=Fs,g.handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests=Al,g.handleDefaultRangeChangeWithEffectRefCommands=js,g.handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests=Dl,g.handleDeleteRangeMoveLeft=qr,g.handleDeleteRangeMoveUp=Yr,g.handleDeleteRangeMutation=Sa,g.handleIRemoveCol=Hs,g.handleIRemoveRow=Hr,g.handleInsertCol=Fr,g.handleInsertRangeMoveDown=Gr,g.handleInsertRangeMoveRight=zr,g.handleInsertRangeMutation=Ra,g.handleInsertRow=jr,g.handleMoveCols=Bs,g.handleMoveRange=Br,g.handleMoveRows=$s,g.isSingleCellSelection=aa,g.rangeMerge=Ws,g.rangeToDiscreteRange=go,g.rotateRange=le,g.runRefRangeMutations=et,g.setEndForRange=ia,g.splitRangeText=_r,g.transformCellsToRange=In,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
// @univerjs/sheets/facade
|
|
16
|
-
(function(m,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/core/facade"),require("@univerjs/sheets"),require("@univerjs/engine-formula")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/core/facade","@univerjs/sheets","@univerjs/engine-formula"],s):(m=typeof globalThis<"u"?globalThis:m||self,s(m.UniverSheetsFacade={},m.UniverCore,m.UniverCoreFacade,m.UniverSheets,m.UniverEngineFormula))})(this,function(m,s,S,a,w){"use strict";var te=Object.defineProperty;var ne=(m,s,S)=>s in m?te(m,s,{enumerable:!0,configurable:!0,writable:!0,value:S}):m[s]=S;var v=(m,s,S)=>ne(m,typeof s!="symbol"?s+"":s,S);var W=Object.getOwnPropertyDescriptor,F=(d,i,e,t)=>{for(var n=t>1?void 0:t?W(i,e):i,r=d.length-1,o;r>=0;r--)(o=d[r])&&(n=o(n)||n);return n},_=(d,i)=>(e,t)=>i(e,t,d);function M(d,i,e){const t=e.getDefinedNameMap(d);if(t==null)return i.t("definedName.defaultName")+1;const r=Array.from(Object.values(t)).length+1,o=i.t("definedName.defaultName")+r;if(e.getValueByName(d,o)==null)return o;let h=r+1;for(;;){const c=i.t("definedName.defaultName")+h;if(e.getValueByName(d,c)==null)return c;h++}}class I{constructor(){v(this,"_definedNameParam");this._definedNameParam={id:s.generateRandomId(10),unitId:"",name:"",formulaOrRefString:""}}setName(i){return this._definedNameParam.name=i,this}setFormula(i){return this._definedNameParam.formulaOrRefString=`=${i}`,this}setRef(i){return this._definedNameParam.formulaOrRefString=i,this}setRefByRange(i,e,t,n){return this._definedNameParam.formulaOrRefString=w.serializeRange({startRow:i,endRow:i+(t!=null?t:1)-1,startColumn:e,endColumn:e+(n!=null?n:1)-1}),this}setComment(i){return this._definedNameParam.comment=i,this}setHidden(i){return this._definedNameParam.hidden=i,this}build(){return this._definedNameParam}load(i){return this._definedNameParam=i,this}}let f=class extends S.FBase{constructor(d,i,e,t,n,r,o,h,c,u){super(),this._definedNameParam=d,this._injector=i,this._commandService=e,this._permissionService=t,this._worksheetProtectionRuleModel=n,this._rangeProtectionRuleModel=r,this._worksheetProtectionPointRuleModel=o,this._authzIoService=h,this._localeService=c,this._definedNamesService=u}_apply(){this._definedNameParam.name===""&&(this._definedNameParam.name=M(this._definedNameParam.unitId,this._localeService,this._definedNamesService)),this._commandService.syncExecuteCommand(a.SetDefinedNameCommand.id,this._definedNameParam)}getName(){return this._definedNameParam.name}setName(d){this._definedNameParam.name=d,this._apply()}setFormula(d){this._definedNameParam.formulaOrRefString=`=${d}`,this._apply()}setRef(d){this._definedNameParam.formulaOrRefString=d,this._apply()}getFormulaOrRefString(){return this._definedNameParam.formulaOrRefString}setRefByRange(d,i,e,t){this._definedNameParam.formulaOrRefString=w.serializeRange({startRow:d,endRow:d+(e!=null?e:1)-1,startColumn:i,endColumn:i+(t!=null?t:1)-1}),this._apply()}getComment(){return this._definedNameParam.comment}setComment(d){this._definedNameParam.comment=d,this._apply()}setScopeToWorksheet(d){this._definedNameParam.localSheetId=d.getSheetId(),this._apply()}setScopeToWorkbook(){this._definedNameParam.localSheetId=a.SCOPE_WORKBOOK_VALUE_DEFINED_NAME,this._apply()}setHidden(d){this._definedNameParam.hidden=d,this._apply()}delete(){this._commandService.syncExecuteCommand(a.RemoveDefinedNameCommand.id,this._definedNameParam)}getLocalSheetId(){return this._definedNameParam.localSheetId}isWorkbookScope(){return this._definedNameParam.localSheetId===a.SCOPE_WORKBOOK_VALUE_DEFINED_NAME}toBuilder(){const d=this._injector.createInstance(I);return d.load(this._definedNameParam),d}};f=F([_(1,s.Inject(s.Injector)),_(2,s.ICommandService),_(3,s.IPermissionService),_(4,s.Inject(a.WorksheetProtectionRuleModel)),_(5,s.Inject(a.RangeProtectionRuleModel)),_(6,s.Inject(a.WorksheetProtectionPointModel)),_(7,s.Inject(s.IAuthzIoService)),_(8,s.Inject(s.LocaleService)),_(9,w.IDefinedNamesService)],f);var D=Object.getOwnPropertyDescriptor,x=(d,i,e,t)=>{for(var n=t>1?void 0:t?D(i,e):i,r=d.length-1,o;r>=0;r--)(o=d[r])&&(n=o(n)||n);return n},C=(d,i)=>(e,t)=>i(e,t,d);m.FPermission=class extends S.FBase{constructor(e,t,n,r,o,h,c){super();v(this,"permissionPointsDefinition",a.PermissionPointsDefinitions);v(this,"rangeRuleChangedAfterAuth$");v(this,"sheetRuleChangedAfterAuth$");this._injector=e,this._commandService=t,this._permissionService=n,this._worksheetProtectionRuleModel=r,this._rangeProtectionRuleModel=o,this._worksheetProtectionPointRuleModel=h,this._authzIoService=c,this.rangeRuleChangedAfterAuth$=this._rangeProtectionRuleModel.ruleRefresh$,this.sheetRuleChangedAfterAuth$=this._worksheetProtectionRuleModel.ruleRefresh$}setWorkbookPermissionPoint(e,t,n){const r=new t(e);this._permissionService.getPermissionPoint(r.id)||this._permissionService.addPermissionPoint(r),this._permissionService.updatePermissionPoint(r.id,n)}setWorkbookEditPermission(e,t){this.setWorkbookPermissionPoint(e,a.WorkbookEditablePermission,t)}async addWorksheetBasePermission(e,t){if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).length>0)throw new Error("sheet protection cannot intersect with range protection");const r=await this._authzIoService.create({objectType:a.UnitObject.Worksheet,worksheetObject:{collaborators:[],unitID:e,strategies:[],name:"",scope:void 0}});if(this._commandService.syncExecuteCommand(a.AddWorksheetProtectionMutation.id,{unitId:e,subUnitId:t,rule:{permissionId:r,unitType:a.UnitObject.Worksheet,unitId:e,subUnitId:t}}))return r}removeWorksheetPermission(e,t){this._commandService.syncExecuteCommand(a.DeleteWorksheetProtectionMutation.id,{unitId:e,subUnitId:t}),[...a.getAllWorksheetPermissionPoint(),...a.getAllWorksheetPermissionPointByPointPanel()].forEach(n=>{const r=new n(e,t);this._permissionService.updatePermissionPoint(r.id,!0)}),this._worksheetProtectionPointRuleModel.deleteRule(e,t)}async setWorksheetPermissionPoint(e,t,n,r){const o=this._worksheetProtectionRuleModel.getRule(e,t);let h;if(n===a.WorksheetEditPermission||n===a.WorksheetViewPermission)if(o)h=o.permissionId;else{if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).length>0)throw new Error("sheet protection cannot intersect with range protection");h=await this.addWorksheetBasePermission(e,t)}else{const g=this._worksheetProtectionPointRuleModel.getRule(e,t);g?h=g.permissionId:(h=await this._authzIoService.create({objectType:a.UnitObject.Worksheet,worksheetObject:{collaborators:[],unitID:e,strategies:[],name:"",scope:void 0}}),this._commandService.syncExecuteCommand(a.SetWorksheetPermissionPointsMutation.id,{unitId:e,subUnitId:t,rule:{unitId:e,subUnitId:t,permissionId:h}}))}const u=new n(e,t);return this._permissionService.getPermissionPoint(u.id)||this._permissionService.addPermissionPoint(u),this._permissionService.updatePermissionPoint(u.id,r),h}async addRangeBaseProtection(e,t,n){const r=await this._authzIoService.create({objectType:a.UnitObject.SelectRange,selectRangeObject:{collaborators:[],unitID:e,name:"",scope:void 0}}),o=`ruleId_${s.generateRandomId(6)}`;if(this._worksheetProtectionRuleModel.getRule(e,t))throw new Error("sheet protection cannot intersect with range protection");if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).some(g=>g.ranges.some(P=>n.some(E=>s.Rectangle.intersects(E.getRange(),P)))))throw new Error("range protection cannot intersect");if(this._commandService.syncExecuteCommand(a.AddRangeProtectionMutation.id,{unitId:e,subUnitId:t,rules:[{permissionId:r,unitType:a.UnitObject.SelectRange,unitId:e,subUnitId:t,ranges:n.map(g=>g.getRange()),id:o}]}))return{permissionId:r,ruleId:o}}removeRangeProtection(e,t,n){this._commandService.syncExecuteCommand(a.DeleteRangeProtectionMutation.id,{unitId:e,subUnitId:t,ruleIds:n})&&this._rangeProtectionRuleModel.getSubunitRuleList(e,t).length===0&&(this._worksheetProtectionPointRuleModel.deleteRule(e,t),[...a.getAllWorksheetPermissionPointByPointPanel()].forEach(h=>{const c=new h(e,t);this._permissionService.updatePermissionPoint(c.id,c.value)}))}setRangeProtectionPermissionPoint(e,t,n,r,o){const h=new r(e,t,n);this._permissionService.getPermissionPoint(h.id)||this._permissionService.addPermissionPoint(h),this._permissionService.updatePermissionPoint(h.id,o)}setRangeProtectionRanges(e,t,n,r){const o=this._rangeProtectionRuleModel.getRule(e,t,n);if(o){if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).filter(u=>u.id!==n).some(u=>u.ranges.some(l=>r.some(g=>s.Rectangle.intersects(g.getRange(),l)))))throw new Error("range protection cannot intersect");this._commandService.syncExecuteCommand(a.SetRangeProtectionMutation.id,{unitId:e,subUnitId:t,ruleId:n,rule:{...o,ranges:r.map(u=>u.getRange())}})}}},m.FPermission=x([C(0,s.Inject(s.Injector)),C(1,s.ICommandService),C(2,s.IPermissionService),C(3,s.Inject(a.WorksheetProtectionRuleModel)),C(4,s.Inject(a.RangeProtectionRuleModel)),C(5,s.Inject(a.WorksheetProtectionPointModel)),C(6,s.Inject(s.IAuthzIoService))],m.FPermission);function B(d){switch(d){case"left":return s.HorizontalAlign.LEFT;case"center":return s.HorizontalAlign.CENTER;case"normal":return s.HorizontalAlign.RIGHT;default:throw new Error(`Invalid horizontal alignment: ${d}`)}}function j(d){switch(d){case s.HorizontalAlign.LEFT:return"left";case s.HorizontalAlign.CENTER:return"center";case s.HorizontalAlign.RIGHT:return"normal";default:throw new Error(`Invalid horizontal alignment: ${d}`)}}function O(d){switch(d){case"top":return s.VerticalAlign.TOP;case"middle":return s.VerticalAlign.MIDDLE;case"bottom":return s.VerticalAlign.BOTTOM;default:throw new Error(`Invalid vertical alignment: ${d}`)}}function V(d){switch(d){case s.VerticalAlign.TOP:return"top";case s.VerticalAlign.MIDDLE:return"middle";case s.VerticalAlign.BOTTOM:return"bottom";default:throw new Error(`Invalid vertical alignment: ${d}`)}}function R(d){return s.isFormulaString(d)?{f:d,v:null,p:null}:s.isCellV(d)?{v:d,p:null,f:null}:(s.isICellData(d),d)}function N(d,i){const e=new s.ObjectMatrix,{startRow:t,startColumn:n,endRow:r,endColumn:o}=i;if(s.Tools.isArray(d))for(let h=0;h<=r-t;h++)for(let c=0;c<=o-n;c++)e.setValue(h+t,c+n,R(d[h][c]));else new s.ObjectMatrix(d).forValue((c,u,l)=>{e.setValue(c,u,R(l))});return e.getMatrix()}function y(d,i){return{startRow:d.startRow,endRow:d.endRow,startColumn:0,endColumn:i.getColumnCount()-1,rangeType:s.RANGE_TYPE.ROW}}function p(d,i){return{startRow:0,endRow:i.getRowCount()-1,startColumn:d.startColumn,endColumn:d.endColumn,rangeType:s.RANGE_TYPE.COLUMN}}var H=Object.getOwnPropertyDescriptor,L=(d,i,e,t)=>{for(var n=t>1?void 0:t?H(i,e):i,r=d.length-1,o;r>=0;r--)(o=d[r])&&(n=o(n)||n);return n},U=(d,i)=>(e,t)=>i(e,t,d);m.FRange=class extends S.FBaseInitialable{constructor(i,e,t,n,r,o){super(n),this._workbook=i,this._worksheet=e,this._range=t,this._injector=n,this._commandService=r,this._formulaDataModel=o}getUnitId(){return this._workbook.getUnitId()}getSheetName(){return this._worksheet.getName()}getSheetId(){return this._worksheet.getSheetId()}getRange(){return this._range}getRow(){return this._range.startRow}getColumn(){return this._range.startColumn}getWidth(){return this._range.endColumn-this._range.startColumn+1}getHeight(){return this._range.endRow-this._range.startRow+1}isMerged(){const{startColumn:i,startRow:e,endColumn:t,endRow:n}=this._range;return this._worksheet.getMergedCellRange(e,i,n,t).some(o=>s.Rectangle.equals(o,this._range))}getCellStyleData(){var t;const i=this.getCellData(),e=this._workbook.getStyles();return i&&e&&(t=e.getStyleByCell(i))!=null?t:null}getCellStyle(){const i=this.getCellStyleData();return i?s.TextStyleValue.create(i):null}getCellStyles(){const i=this.getCellDatas(),e=this._workbook.getStyles();return i.map(t=>t.map(n=>{if(!n)return null;const r=e.getStyleByCell(n);return r?s.TextStyleValue.create(r):null}))}getValue(i){var e,t;return i?this.getValueAndRichTextValue():(t=(e=this._worksheet.getCell(this._range.startRow,this._range.startColumn))==null?void 0:e.v)!=null?t:null}getValues(i){var h,c;if(i)return this.getValueAndRichTextValues();const{startRow:e,endRow:t,startColumn:n,endColumn:r}=this._range,o=[];for(let u=e;u<=t;u++){const l=[];for(let g=n;g<=r;g++)l.push((c=(h=this._worksheet.getCell(u,g))==null?void 0:h.v)!=null?c:null);o.push(l)}return o}getCellData(){var i;return(i=this._worksheet.getCell(this._range.startRow,this._range.startColumn))!=null?i:null}getCellDatas(){return this.getCellDataGrid()}getCellDataGrid(){const{startRow:i,endRow:e,startColumn:t,endColumn:n}=this._range,r=[];for(let o=i;o<=e;o++){const h=[];for(let c=t;c<=n;c++)h.push(this._worksheet.getCellRaw(o,c));r.push(h)}return r}getRichTextValue(){const i=this.getCellData();return i!=null&&i.p?new s.RichTextValue(i.p):null}getRichTextValues(){return this.getCellDataGrid().map(e=>e.map(t=>t!=null&&t.p?new s.RichTextValue(t.p):null))}getValueAndRichTextValue(){const i=this.getCellData();return i!=null&&i.p?new s.RichTextValue(i.p):i==null?void 0:i.v}getValueAndRichTextValues(){return this.getCellDatas().map(e=>e.map(t=>t!=null&&t.p?new s.RichTextValue(t.p):t==null?void 0:t.v))}getFormulas(){const i=[],{startRow:e,endRow:t,startColumn:n,endColumn:r}=this._range,o=this._worksheet.getSheetId(),h=this._workbook.getUnitId();for(let c=e;c<=t;c++){const u=[];for(let l=n;l<=r;l++){const g=this._formulaDataModel.getFormulaStringByCell(c,l,o,h);u.push(g||"")}i.push(u)}return i}getWrap(){return this._worksheet.getRange(this._range).getWrap()===s.BooleanNumber.TRUE}getWrapStrategy(){return this._worksheet.getRange(this._range).getWrapStrategy()}getHorizontalAlignment(){return j(this._worksheet.getRange(this._range).getHorizontalAlignment())}getVerticalAlignment(){return V(this._worksheet.getRange(this._range).getVerticalAlignment())}setCustomMetaData(i){return this.setValue({custom:i})}setCustomMetaDatas(i){return this.setValues(i.map(e=>e.map(t=>({custom:t}))))}getCustomMetaData(){var e;const i=this.getCellData();return(e=i==null?void 0:i.custom)!=null?e:null}getCustomMetaDatas(){return this.getCellDataGrid().map(e=>e.map(t=>{var n;return(n=t==null?void 0:t.custom)!=null?n:null}))}setBorder(i,e,t){return this._commandService.syncExecuteCommand(a.SetBorderBasicCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),ranges:[this._range],value:{type:i,style:e,color:t}}),this}setBackgroundColor(i){return this._commandService.syncExecuteCommand(a.SetStyleCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:{type:"bg",value:{rgb:i}}}),this}setBackground(i){return this.setBackgroundColor(i),this}setValue(i){const e=R(i);if(!e)throw new Error("Invalid value");return this._commandService.syncExecuteCommand(a.SetRangeValuesCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:e}),this}setValueForCell(i){const e=R(i);if(!e)throw new Error("Invalid value");return this._commandService.syncExecuteCommand(a.SetRangeValuesCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:{startColumn:this._range.startColumn,startRow:this._range.startRow,endColumn:this._range.startColumn,endRow:this._range.startRow},value:e}),this}setRichTextValueForCell(i){const e=i instanceof s.RichTextValue?i.getData():i,t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:{startColumn:this._range.startColumn,startRow:this._range.startRow,endColumn:this._range.startColumn,endRow:this._range.startRow},value:{p:e}};return this._commandService.syncExecuteCommand(a.SetRangeValuesCommand.id,t),this}setRichTextValues(i){const e=i.map(r=>r.map(o=>o&&{p:o instanceof s.RichTextValue?o.getData():o})),t=N(e,this._range),n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:t};return this._commandService.syncExecuteCommand(a.SetRangeValuesCommand.id,n),this}setWrap(i){return this._commandService.syncExecuteCommand(a.SetTextWrapCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:i?s.WrapStrategy.WRAP:s.WrapStrategy.UNSPECIFIED}),this}setWrapStrategy(i){return this._commandService.syncExecuteCommand(a.SetTextWrapCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:i}),this}setVerticalAlignment(i){return this._commandService.syncExecuteCommand(a.SetVerticalTextAlignCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:O(i)}),this}setHorizontalAlignment(i){return this._commandService.syncExecuteCommand(a.SetHorizontalTextAlignCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:B(i)}),this}setValues(i){const e=N(i,this._range);return this._commandService.syncExecuteCommand(a.SetRangeValuesCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:e}),this}setFontWeight(i){let e;if(i==="bold")e=s.BooleanNumber.TRUE;else if(i==="normal")e=s.BooleanNumber.FALSE;else if(i===null)e=null;else throw new Error("Invalid fontWeight");const t={type:"bl",value:e},n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:t};return this._commandService.syncExecuteCommand(a.SetStyleCommand.id,n),this}setFontStyle(i){let e;if(i==="italic")e=s.BooleanNumber.TRUE;else if(i==="normal")e=s.BooleanNumber.FALSE;else if(i===null)e=null;else throw new Error("Invalid fontStyle");const t={type:"it",value:e},n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:t};return this._commandService.syncExecuteCommand(a.SetStyleCommand.id,n),this}setFontLine(i){if(i==="underline")this._setFontUnderline({s:s.BooleanNumber.TRUE});else if(i==="line-through")this._setFontStrikethrough({s:s.BooleanNumber.TRUE});else if(i==="none")this._setFontUnderline({s:s.BooleanNumber.FALSE}),this._setFontStrikethrough({s:s.BooleanNumber.FALSE});else if(i===null)this._setFontUnderline(null),this._setFontStrikethrough(null);else throw new Error("Invalid fontLine");return this}_setFontUnderline(i){const e={type:"ul",value:i},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};this._commandService.syncExecuteCommand(a.SetStyleCommand.id,t)}_setFontStrikethrough(i){const e={type:"st",value:i},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};this._commandService.syncExecuteCommand(a.SetStyleCommand.id,t)}setFontFamily(i){const e={type:"ff",value:i},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};return this._commandService.syncExecuteCommand(a.SetStyleCommand.id,t),this}setFontSize(i){const e={type:"fs",value:i},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};return this._commandService.syncExecuteCommand(a.SetStyleCommand.id,t),this}setFontColor(i){const t={type:"cl",value:i===null?null:{rgb:i}},n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:t};return this._commandService.syncExecuteCommand(a.SetStyleCommand.id,n),this}merge(i=!0){const e=this._workbook.getUnitId(),t=this._worksheet.getSheetId();return a.addMergeCellsUtil(this._injector,e,t,[this._range],i),this}mergeAcross(i=!0){const e=a.getAddMergeMutationRangeByType([this._range],s.Dimension.ROWS),t=this._workbook.getUnitId(),n=this._worksheet.getSheetId();return a.addMergeCellsUtil(this._injector,t,n,e,i),this}mergeVertically(i=!0){const e=a.getAddMergeMutationRangeByType([this._range],s.Dimension.COLUMNS),t=this._workbook.getUnitId(),n=this._worksheet.getSheetId();return a.addMergeCellsUtil(this._injector,t,n,e,i),this}isPartOfMerge(){const{startRow:i,startColumn:e,endRow:t,endColumn:n}=this._range;return this._worksheet.getMergedCellRange(i,e,t,n).length>0}breakApart(){return this._commandService.syncExecuteCommand(a.RemoveWorksheetMergeCommand.id,{ranges:[this._range]}),this}forEach(i){const{startColumn:e,startRow:t,endColumn:n,endRow:r}=this._range;this._worksheet.getMatrixWithMergedCells(t,e,r,n).forValue((o,h,c)=>{i(o,h,c)})}getA1Notation(i){return i?w.serializeRangeWithSheet(this._worksheet.getName(),this._range):w.serializeRange(this._range)}activate(){return this._injector.createInstance(m.FWorkbook,this._workbook).setActiveRange(this),this}activateAsCurrentCell(){const i=this._worksheet.getMergedCell(this._range.startRow,this._range.startColumn);if(i&&s.Rectangle.equals(i,this._range)||!i&&this._range.startRow===this._range.endRow&&this._range.startColumn===this._range.endColumn)return this.activate();throw new Error("The range is not a single cell")}splitTextToColumns(i,e,t){this._commandService.syncExecuteCommand(a.SplitTextToColumnsCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,delimiter:e,customDelimiter:t,treatMultipleDelimitersAsOne:i})}useThemeStyle(i){if(i==null){const e=this.getUsedThemeStyle();e&&this.removeThemeStyle(e)}else this._commandService.syncExecuteCommand(a.SetWorksheetRangeThemeStyleCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,themeName:i})}removeThemeStyle(i){this._commandService.syncExecuteCommand(a.DeleteWorksheetRangeThemeStyleCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,themeName:i})}getUsedThemeStyle(){return this._injector.get(a.SheetRangeThemeService).getAppliedRangeThemeStyle({unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range})}},m.FRange=L([U(3,s.Inject(s.Injector)),U(4,s.ICommandService),U(5,s.Inject(w.FormulaDataModel))],m.FRange);var z=Object.getOwnPropertyDescriptor,G=(d,i,e,t)=>{for(var n=t>1?void 0:t?z(i,e):i,r=d.length-1,o;r>=0;r--)(o=d[r])&&(n=o(n)||n);return n},$=(d,i)=>(e,t)=>i(e,t,d);m.FSelection=class{constructor(i,e,t,n){this._workbook=i,this._worksheet=e,this._selections=t,this._injector=n}getActiveRange(){const i=this._selections.find(e=>!!e.primary);return i?this._injector.createInstance(m.FRange,this._workbook,this._worksheet,i.range):null}getActiveRangeList(){return this._selections.map(i=>this._injector.createInstance(m.FRange,this._workbook,this._worksheet,i.range))}getCurrentCell(){const i=this._selections.find(e=>!!e.primary);return i?i.primary:null}getActiveSheet(){const i=this._injector.createInstance(m.FWorkbook,this._workbook);return this._injector.createInstance(m.FWorksheet,i,this._workbook,this._worksheet)}updatePrimaryCell(i){const e=this._injector.get(s.ICommandService);let t=[],n=!1;for(const{range:o,style:h}of this._selections)s.Rectangle.contains(o,i.getRange())?(t.push({range:o,primary:a.getPrimaryForRange(i.getRange(),this._worksheet),style:h}),n=!0):t.push({range:o,primary:null,style:h});n||(t=[{range:i.getRange(),primary:a.getPrimaryForRange(i.getRange(),this._worksheet)}]);const r={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),selections:t};return e.syncExecuteCommand(a.SetSelectionsOperation.id,r),new m.FSelection(this._workbook,this._worksheet,t,this._injector)}getNextDataRange(i){if(!this._selections.find(n=>!!n.primary))return null;const t=a.getNextPrimaryCell(this._selections.concat(),i,this._worksheet);return t?this._injector.createInstance(m.FRange,this._workbook,this._worksheet,t):null}},m.FSelection=G([$(3,s.Inject(s.Injector))],m.FSelection);var Y=Object.getOwnPropertyDescriptor,q=(d,i,e,t)=>{for(var n=t>1?void 0:t?Y(i,e):i,r=d.length-1,o;r>=0;r--)(o=d[r])&&(n=o(n)||n);return n},b=(d,i)=>(e,t)=>i(e,t,d);m.FWorksheet=class extends S.FBaseInitialable{constructor(e,t,n,r,o,h,c){super(r);v(this,"setActiveSelection",this.setActiveRange);this._fWorkbook=e,this._workbook=t,this._worksheet=n,this._injector=r,this._selectionManagerService=o,this._logService=h,this._commandService=c}getSheet(){return this._worksheet}getInject(){return this._injector}getWorkbook(){return this._workbook}getSheetId(){return this._worksheet.getSheetId()}getSheetName(){return this._worksheet.getName()}getSelection(){const e=this._selectionManagerService.getCurrentSelections();return e?this._injector.createInstance(m.FSelection,this._workbook,this._worksheet,e):null}getDefaultStyle(){return this._worksheet.getDefaultCellStyle()}getRowDefaultStyle(e,t=!1){return this._worksheet.getRowStyle(e,t)}getColumnDefaultStyle(e,t=!1){return this._worksheet.getColumnStyle(e,t)}setDefaultStyle(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId();return this._commandService.syncExecuteCommand(a.SetWorksheetDefaultStyleMutation.id,{unitId:t,subUnitId:n,defaultStyle:e}),this._worksheet.setDefaultCellStyle(e),this}setColumnDefaultStyle(e,t){const n=this._workbook.getUnitId(),r=this._worksheet.getSheetId(),o={unitId:n,subUnitId:r,columnData:{[e]:{s:t}}};return this._commandService.syncExecuteCommand(a.SetColDataCommand.id,o),this}setRowDefaultStyle(e,t){const n=this._workbook.getUnitId(),r=this._worksheet.getSheetId(),o={unitId:n,subUnitId:r,rowData:{[e]:{s:t}}};return this._commandService.syncExecuteCommand(a.SetRowDataCommand.id,o),this}getRange(e,t,n,r){let o,h;if(typeof e=="object")o=e,h=this._worksheet;else if(typeof e=="string"){const{range:c,sheetName:u}=w.deserializeRangeWithSheet(e),l=u?this._workbook.getSheetBySheetName(u):this._worksheet;if(!l)throw new Error("Range not found");h=l,o={...c,unitId:this._workbook.getUnitId(),sheetId:h.getSheetId(),rangeType:s.RANGE_TYPE.NORMAL,startRow:c.rangeType===s.RANGE_TYPE.COLUMN?0:c.startRow,endRow:c.rangeType===s.RANGE_TYPE.COLUMN?h.getMaxRows()-1:c.endRow,startColumn:c.rangeType===s.RANGE_TYPE.ROW?0:c.startColumn,endColumn:c.rangeType===s.RANGE_TYPE.ROW?h.getMaxColumns()-1:c.endColumn}}else if(typeof e=="number"&&t!==void 0)h=this._worksheet,o={startRow:e,endRow:e+(n!=null?n:1)-1,startColumn:t,endColumn:t+(r!=null?r:1)-1,unitId:this._workbook.getUnitId(),sheetId:this._worksheet.getSheetId()};else throw new Error("Invalid range specification");return this._injector.createInstance(m.FRange,this._workbook,h,o)}getMaxColumns(){return this._worksheet.getMaxColumns()}getMaxRows(){return this._worksheet.getMaxRows()}insertRowAfter(e){return this.insertRowsAfter(e,1)}insertRowBefore(e){return this.insertRowsBefore(e,1)}insertRows(e,t=1){return this.insertRowsBefore(e,t)}insertRowsAfter(e,t){const n=this._workbook.getUnitId(),r=this._worksheet.getSheetId(),o=s.Direction.DOWN,h=e+1,c=e+t,u=0,l=this._worksheet.getColumnCount()-1,g=a.copyRangeStyles(this._worksheet,h,c,u,l,!0,e);return this._commandService.syncExecuteCommand(a.InsertRowByRangeCommand.id,{unitId:n,subUnitId:r,direction:o,range:{startRow:h,endRow:c,startColumn:u,endColumn:l},cellValue:g}),this}insertRowsBefore(e,t){const n=this._workbook.getUnitId(),r=this._worksheet.getSheetId(),o=s.Direction.UP,h=e,c=e+t-1,u=0,l=this._worksheet.getColumnCount()-1,g=a.copyRangeStyles(this._worksheet,h,c,u,l,!0,e-1);return this._commandService.syncExecuteCommand(a.InsertRowByRangeCommand.id,{unitId:n,subUnitId:r,direction:o,range:{startRow:h,endRow:c,startColumn:u,endColumn:l},cellValue:g}),this}deleteRow(e){return this.deleteRows(e,1)}deleteRows(e,t){const n={startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return this._commandService.syncExecuteCommand(a.RemoveRowByRangeCommand.id,{range:n,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}moveRows(e,t){const n=this._workbook.getUnitId(),r=this._worksheet.getSheetId(),o=y(e.getRange(),this._worksheet),h=o,c={startRow:t,endRow:t,startColumn:o.startColumn,endColumn:o.endColumn};return this._commandService.syncExecuteCommand(a.MoveRowsCommand.id,{unitId:n,subUnitId:r,range:o,fromRange:h,toRange:c}),this}hideRow(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),r=y(e.getRange(),this._worksheet);return this._commandService.syncExecuteCommand(a.SetRowHiddenCommand.id,{unitId:t,subUnitId:n,ranges:[r]}),this}hideRows(e,t=1){const n=this._workbook.getUnitId(),r=this._worksheet.getSheetId(),o={startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1,rangeType:s.RANGE_TYPE.ROW};return this._commandService.syncExecuteCommand(a.SetRowHiddenCommand.id,{unitId:n,subUnitId:r,ranges:[o]}),this}unhideRow(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),r=y(e.getRange(),this._worksheet);return this._commandService.syncExecuteCommand(a.SetSpecificRowsVisibleCommand.id,{unitId:t,subUnitId:n,ranges:[r]}),this}showRows(e,t=1){const n=this._workbook.getUnitId(),r=this._worksheet.getSheetId(),o={startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1,rangeType:s.RANGE_TYPE.ROW};return this._commandService.syncExecuteCommand(a.SetSpecificRowsVisibleCommand.id,{unitId:n,subUnitId:r,ranges:[o]}),this}setRowHeight(e,t){return this.setRowHeights(e,1,t)}autoFitRow(e,t=s.BooleanNumber.TRUE){const n=this._workbook.getUnitId(),r=this._worksheet.getSheetId(),o=[{startRow:e,endRow:e,startColumn:0,endColumn:this._worksheet.getColumnCount()-1}];return this._commandService.syncExecuteCommand(a.SetTextWrapCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:o[0],value:s.WrapStrategy.WRAP}),this._commandService.syncExecuteCommand(a.SetWorksheetRowIsAutoHeightMutation.id,{unitId:n,subUnitId:r,ranges:o,autoHeightInfo:t}),this}setRowHeights(e,t,n){var l;const r=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),h=this._worksheet.getRowManager(),c=[],u=[];for(let g=e;g<e+t;g++){const P=((l=h.getRow(g))==null?void 0:l.ah)||this._worksheet.getConfig().defaultRowHeight,E={startRow:g,endRow:g,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};n<=P?c.push(E):u.push(E)}return u.length>0&&this._commandService.syncExecuteCommand(a.SetRowHeightCommand.id,{unitId:r,subUnitId:o,ranges:u,value:n}),c.length>0&&this._commandService.syncExecuteCommand(a.SetWorksheetRowIsAutoHeightCommand.id,{unitId:r,subUnitId:o,ranges:c}),this}setRowAutoHeight(e,t){const n=this._workbook.getUnitId(),r=this._worksheet.getSheetId(),o=[{startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1}];return this._commandService.syncExecuteCommand(a.SetWorksheetRowIsAutoHeightCommand.id,{unitId:n,subUnitId:r,ranges:o}),this}setRowHeightsForced(e,t,n){const r=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),h=[{startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1}];return this._commandService.syncExecuteCommand(a.SetRowHeightCommand.id,{unitId:r,subUnitId:o,ranges:h,value:n}),this}setRowCustom(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),r={};for(const[h,c]of Object.entries(e))r[Number(h)]={custom:c};const o={unitId:t,subUnitId:n,rowData:r};return this._commandService.syncExecuteCommand(a.SetRowDataCommand.id,o),this}insertColumnAfter(e){return this.insertColumnsAfter(e,1)}insertColumnBefore(e){return this.insertColumnsBefore(e,1)}insertColumns(e,t=1){return this.insertColumnsBefore(e,t)}insertColumnsAfter(e,t){const n=this._workbook.getUnitId(),r=this._worksheet.getSheetId(),o=s.Direction.RIGHT,h=0,c=this._worksheet.getRowCount()-1,u=e+1,l=e+t,g=a.copyRangeStyles(this._worksheet,h,c,u,l,!1,e);return this._commandService.syncExecuteCommand(a.InsertColByRangeCommand.id,{unitId:n,subUnitId:r,direction:o,range:{startRow:h,endRow:c,startColumn:u,endColumn:l},cellValue:g}),this}insertColumnsBefore(e,t){const n=this._workbook.getUnitId(),r=this._worksheet.getSheetId(),o=s.Direction.LEFT,h=0,c=this._worksheet.getRowCount()-1,u=e,l=e+t-1,g=a.copyRangeStyles(this._worksheet,h,c,u,l,!1,e-1);return this._commandService.syncExecuteCommand(a.InsertColByRangeCommand.id,{unitId:n,subUnitId:r,direction:o,range:{startRow:h,endRow:c,startColumn:u,endColumn:l},cellValue:g}),this}deleteColumn(e){return this.deleteColumns(e,1)}deleteColumns(e,t){const n={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:e,endColumn:e+t-1};return this._commandService.syncExecuteCommand(a.RemoveColByRangeCommand.id,{range:n,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}moveColumns(e,t){const n=this._workbook.getUnitId(),r=this._worksheet.getSheetId(),o=p(e.getRange(),this._worksheet),h=o,c={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:t,endColumn:t};return this._commandService.syncExecuteCommand(a.MoveColsCommand.id,{unitId:n,subUnitId:r,range:o,fromRange:h,toRange:c}),this}hideColumn(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),r=p(e.getRange(),this._worksheet);return this._commandService.syncExecuteCommand(a.SetColHiddenCommand.id,{unitId:t,subUnitId:n,ranges:[r]}),this}hideColumns(e,t=1){const n=this._workbook.getUnitId(),r=this._worksheet.getSheetId(),o={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:e,endColumn:e+t-1,rangeType:s.RANGE_TYPE.COLUMN};return this._commandService.syncExecuteCommand(a.SetColHiddenCommand.id,{unitId:n,subUnitId:r,ranges:[o]}),this}unhideColumn(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),r=p(e.getRange(),this._worksheet);return this._commandService.syncExecuteCommand(a.SetSpecificColsVisibleCommand.id,{unitId:t,subUnitId:n,ranges:[r]}),this}showColumns(e,t=1){const n=this._workbook.getUnitId(),r=this._worksheet.getSheetId(),o={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:e,endColumn:e+t-1,rangeType:s.RANGE_TYPE.COLUMN};return this._commandService.syncExecuteCommand(a.SetSpecificColsVisibleCommand.id,{unitId:n,subUnitId:r,ranges:[o]}),this}setColumnWidth(e,t){return this.setColumnWidths(e,1,t)}setColumnWidths(e,t,n){const r=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),h=[{startColumn:e,endColumn:e+t-1,startRow:0,endRow:this._worksheet.getRowCount()-1}];return this._commandService.syncExecuteCommand(a.SetColWidthCommand.id,{unitId:r,subUnitId:o,ranges:h,value:n}),this}setColumnCustom(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),r={};for(const[h,c]of Object.entries(e))r[Number(h)]={custom:c};const o={unitId:t,subUnitId:n,columnData:r};return this._commandService.syncExecuteCommand(a.SetColDataCommand.id,o),this}getMergeData(){return this._worksheet.getMergeData().map(e=>this._injector.createInstance(m.FRange,this._workbook,this._worksheet,e))}getMergedRanges(){return this._worksheet.getSnapshot().mergeData.map(t=>this._injector.createInstance(m.FRange,this._workbook,this._worksheet,t))}getCellMergeData(e,t){const r=this._worksheet.getMergedCell(e,t);if(r)return this._injector.createInstance(m.FRange,this._workbook,this._worksheet,r)}getActiveRange(){return this._fWorkbook.getActiveRange()}setActiveRange(e){const{unitId:t,sheetId:n}=e.getRange();if(t!==this._workbook.getUnitId()||n!==this._worksheet.getSheetId())throw new Error("Specified range must be part of the sheet.");return this._fWorkbook.setActiveRange(e),this}setFreeze(e){return this._logService.warn("setFreeze is deprecated, use setFrozenRows and setFrozenColumns instead"),this._commandService.syncExecuteCommand(a.SetFrozenCommand.id,{...e,unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()}),this}cancelFreeze(){return this._commandService.syncExecuteCommand(a.CancelFrozenCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()}),this}getFreeze(){return this._worksheet.getFreeze()}setFrozenColumns(...e){const t=this.getFreeze();if(arguments.length===1){const n=e[0];this.setFreeze({...t,startColumn:n>0?n:-1,xSplit:n})}else if(arguments.length===2){let[n=0,r=0]=e;n>r&&([n,r]=[r,n]),this._commandService.syncExecuteCommand(a.SetFrozenCommand.id,{startColumn:r+1,xSplit:r-n+1,startRow:t.startRow,ySplit:t.ySplit,unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()})}return this}setFrozenRows(...e){const t=this.getFreeze();if(arguments.length===1){const n=e[0];this.setFreeze({...t,startRow:n>0?n:-1,ySplit:n})}else if(arguments.length===2){let[n=0,r=0]=e;n>r&&([n,r]=[r,n]),this._commandService.syncExecuteCommand(a.SetFrozenCommand.id,{startRow:r+1,ySplit:r-n+1,startColumn:t.startColumn,xSplit:t.xSplit,unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()})}return this}getFrozenColumns(){const e=this.getFreeze();return e.startColumn===-1?0:e.startColumn}getFrozenRows(){const e=this.getFreeze();return e.startRow===-1?0:e.startRow}getFrozenRowRange(){const e=this._worksheet.getFreeze();return{startRow:e.startRow-e.ySplit,endRow:e.startRow-1}}getFrozenColumnRange(){const e=this._worksheet.getFreeze();return{startColumn:e.startColumn-e.xSplit,endColumn:e.startColumn-1}}hasHiddenGridLines(){return this._worksheet.getConfig().showGridlines===s.BooleanNumber.FALSE}setHiddenGridlines(e){return this._commandService.syncExecuteCommand(a.ToggleGridlinesCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),showGridlines:e?s.BooleanNumber.FALSE:s.BooleanNumber.TRUE}),this}setGridLinesColor(e){return this._commandService.syncExecuteCommand(a.SetGridlinesColorCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),color:e}),this}getGridLinesColor(){return this._worksheet.getGridlinesColor()}setTabColor(e){return this._commandService.syncExecuteCommand(a.SetTabColorCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),value:e}),this}getTabColor(){return this._worksheet.getTabColor()}onCellDataChange(e){return this._injector.get(s.ICommandService).onCommandExecuted(n=>{if(n.id===a.SetRangeValuesMutation.id){const r=n.params;r.unitId===this._workbook.getUnitId()&&r.subUnitId===this._worksheet.getSheetId()&&r.cellValue&&e(new s.ObjectMatrix(r.cellValue))}})}onBeforeCellDataChange(e){return this._injector.get(s.ICommandService).beforeCommandExecuted(n=>{if(n.id===a.SetRangeValuesMutation.id){const r=n.params;r.unitId===this._workbook.getUnitId()&&r.subUnitId===this._worksheet.getSheetId()&&r.cellValue&&e(new s.ObjectMatrix(r.cellValue))}})}hideSheet(){const e=this._injector.get(s.ICommandService);if(this._workbook.getSheets().filter(o=>o.isSheetHidden()!==s.BooleanNumber.TRUE).length<=1)throw new Error("Cannot hide the only visible sheet");return e.syncExecuteCommand(a.SetWorksheetHideCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}showSheet(){return this._injector.get(s.ICommandService).syncExecuteCommand(a.SetWorksheetShowCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}isSheetHidden(){return this._worksheet.isSheetHidden()===s.BooleanNumber.TRUE}setName(e){return this._commandService.syncExecuteCommand(a.SetWorksheetNameCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),name:e}),this}activate(){return this._fWorkbook.setActiveSheet(this),this}getIndex(){return this._workbook.getSheetIndex(this._worksheet)}clear(e){if(e&&e.contentsOnly&&!e.formatOnly)return this.clearContents();if(e&&e.formatOnly&&!e.contentsOnly)return this.clearFormats();const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),r=this._injector.get(s.ICommandService),o={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return r.syncExecuteCommand(a.ClearSelectionAllCommand.id,{unitId:t,subUnitId:n,ranges:[o],options:e}),this}clearContents(){const e=this._workbook.getUnitId(),t=this._worksheet.getSheetId(),n=this._injector.get(s.ICommandService),r={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return n.syncExecuteCommand(a.ClearSelectionContentCommand.id,{unitId:e,subUnitId:t,ranges:[r]}),this}clearFormats(){const e=this._workbook.getUnitId(),t=this._worksheet.getSheetId(),n=this._injector.get(s.ICommandService),r={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return n.syncExecuteCommand(a.ClearSelectionFormatCommand.id,{unitId:e,subUnitId:t,ranges:[r]}),this}getDataRange(){const e=this.getLastRows(),t=this.getLastColumns();return this.getRange(0,0,e+1,t+1)}getLastColumns(){return this._worksheet.getLastColumnWithContent()}getLastColumn(){return this._worksheet.getLastColumnWithContent()}getLastRows(){return this._worksheet.getLastRowWithContent()}getLastRow(){return this._worksheet.getLastRowWithContent()}equalTo(e){return e instanceof m.FWorksheet?this._worksheet.getSheetId()===e.getSheetId()&&this._workbook.getUnitId()===e.getWorkbook().getUnitId():!1}insertDefinedName(e,t){const r=this._injector.createInstance(I).setName(e).setRef(t).build();r.localSheetId=this.getSheetId(),this._fWorkbook.insertDefinedNameBuilder(r)}getDefinedNames(){return this._fWorkbook.getDefinedNames().filter(t=>t.getLocalSheetId()===this.getSheetId())}setCustomMetadata(e){return this._worksheet.setCustomMetadata(e),this}setRowCustomMetadata(e,t){return this._worksheet.getRowManager().setCustomMetadata(e,t),this}setColumnCustomMetadata(e,t){return this._worksheet.getColumnManager().setCustomMetadata(e,t),this}getRowCustomMetadata(e){return this._worksheet.getRowManager().getCustomMetadata(e)}getColumnCustomMetadata(e){return this._worksheet.getColumnManager().getCustomMetadata(e)}},m.FWorksheet=q([b(3,s.Inject(s.Injector)),b(4,s.Inject(a.SheetsSelectionsService)),b(5,s.Inject(s.ILogService)),b(6,s.ICommandService)],m.FWorksheet);var K=Object.getOwnPropertyDescriptor,J=(d,i,e,t)=>{for(var n=t>1?void 0:t?K(i,e):i,r=d.length-1,o;r>=0;r--)(o=d[r])&&(n=o(n)||n);return n},k=(d,i)=>(e,t)=>i(e,t,d);m.FWorkbook=class extends S.FBaseInitialable{constructor(e,t,n,r,o,h,c,u,l,g){super(t);v(this,"id");this._workbook=e,this._injector=t,this._resourceLoaderService=n,this._selectionManagerService=r,this._univerInstanceService=o,this._commandService=h,this._permissionService=c,this._logService=u,this._localeService=l,this._definedNamesService=g,this.id=this._workbook.getUnitId()}getWorkbook(){return this._workbook}getId(){return this.id}getName(){return this._workbook.name}setName(e){this._workbook.setName(e)}save(){return this._resourceLoaderService.saveUnit(this._workbook.getUnitId())}getSnapshot(){return this._logService.warn("use 'save' instead of 'getSnapshot'"),this.save()}getActiveSheet(){const e=this._workbook.getActiveSheet();return this._injector.createInstance(m.FWorksheet,this,this._workbook,e)}getSheets(){return this._workbook.getSheets().map(e=>this._injector.createInstance(m.FWorksheet,this,this._workbook,e))}create(e,t,n){const r=s.mergeWorksheetSnapshotWithDefault({});r.rowCount=t,r.columnCount=n,r.name=e,r.id=e.toLowerCase().replace(/ /g,"-"),this._commandService.syncExecuteCommand(a.InsertSheetCommand.id,{unitId:this.id,index:this._workbook.getSheets().length,sheet:r}),this._commandService.syncExecuteCommand(a.SetWorksheetActiveOperation.id,{unitId:this.id,subUnitId:this._workbook.getSheets()[this._workbook.getSheets().length-1].getSheetId()});const o=this._workbook.getActiveSheet();if(!o)throw new Error("No active sheet found");return this._injector.createInstance(m.FWorksheet,this,this._workbook,o)}getSheetBySheetId(e){const t=this._workbook.getSheetBySheetId(e);return t?this._injector.createInstance(m.FWorksheet,this,this._workbook,t):null}getSheetByName(e){const t=this._workbook.getSheetBySheetName(e);return t?this._injector.createInstance(m.FWorksheet,this,this._workbook,t):null}setActiveSheet(e){return this._commandService.syncExecuteCommand(a.SetWorksheetActiveOperation.id,{unitId:this.id,subUnitId:typeof e=="string"?e:e.getSheetId()}),typeof e=="string"?this.getSheetBySheetId(e):e}insertSheet(e){e!=null?this._commandService.syncExecuteCommand(a.InsertSheetCommand.id,{sheet:{name:e}}):this._commandService.syncExecuteCommand(a.InsertSheetCommand.id);const t=this.id,n=this._workbook.getSheets()[this._workbook.getSheets().length-1].getSheetId();this._commandService.syncExecuteCommand(a.SetWorksheetActiveOperation.id,{unitId:t,subUnitId:n});const r=this._workbook.getActiveSheet();if(!r)throw new Error("No active sheet found");return this._injector.createInstance(m.FWorksheet,this,this._workbook,r)}deleteSheet(e){const t=this.id,n=typeof e=="string"?e:e.getSheetId();return this._commandService.syncExecuteCommand(a.RemoveSheetCommand.id,{unitId:t,subUnitId:n})}undo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.syncExecuteCommand(s.UndoCommand.id),this}redo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.syncExecuteCommand(s.RedoCommand.id),this}onBeforeCommandExecute(e){return this._commandService.beforeCommandExecuted(t=>{var n;((n=t.params)==null?void 0:n.unitId)===this.id&&e(t)})}onCommandExecuted(e){return this._commandService.onCommandExecuted(t=>{var n;((n=t.params)==null?void 0:n.unitId)===this.id&&e(t)})}onSelectionChange(e){return s.toDisposable(this._selectionManagerService.selectionMoveEnd$.subscribe(t=>{this._univerInstanceService.getCurrentUnitForType(s.UniverInstanceType.UNIVER_SHEET).getUnitId()===this.id&&(t!=null&&t.length?e(t.map(n=>n.range)):e([]))}))}setEditable(e){const t=new a.WorkbookEditablePermission(this._workbook.getUnitId());return this._permissionService.getPermissionPoint(t.id)||this._permissionService.addPermissionPoint(t),this._permissionService.updatePermissionPoint(t.id,e),this}setActiveRange(e){const t=this.getActiveSheet(),n=e.getRange().sheetId||t.getSheetId(),r=n?this._workbook.getSheetBySheetId(n):this._workbook.getActiveSheet(!0);if(!r)throw new Error("No active sheet found");r.getSheetId()!==t.getSheetId()&&this.setActiveSheet(this._injector.createInstance(m.FWorksheet,this,this._workbook,r));const o={unitId:this.getId(),subUnitId:n,selections:[e].map(h=>({range:h.getRange(),primary:a.getPrimaryForRange(h.getRange(),r),style:null}))};return this._commandService.syncExecuteCommand(a.SetSelectionsOperation.id,o),this}getActiveRange(){const e=this._workbook.getActiveSheet(),n=this._selectionManagerService.getCurrentSelections().find(r=>!!r.primary);return n?this._injector.createInstance(m.FRange,this._workbook,e,n.range):null}deleteActiveSheet(){const e=this.getActiveSheet();return this.deleteSheet(e)}duplicateSheet(e){return this._commandService.syncExecuteCommand(a.CopySheetCommand.id,{unitId:e.getWorkbook().getUnitId(),subUnitId:e.getSheetId()}),this._injector.createInstance(m.FWorksheet,this,this._workbook,this._workbook.getActiveSheet())}duplicateActiveSheet(){const e=this.getActiveSheet();return this.duplicateSheet(e)}getNumSheets(){return this._workbook.getSheets().length}getLocale(){return this._localeService.getCurrentLocale()}setLocale(e){this._localeService.setLocale(e)}setSpreadsheetLocale(e){return this._localeService.setLocale(e),this}getUrl(){return location.href}moveSheet(e,t){let n=t;return n<0?n=0:n>this._workbook.getSheets().length-1&&(n=this._workbook.getSheets().length-1),this._commandService.syncExecuteCommand(a.SetWorksheetOrderCommand.id,{unitId:e.getWorkbook().getUnitId(),order:n,subUnitId:e.getSheetId()}),this}moveActiveSheet(e){const t=this.getActiveSheet();return this.moveSheet(t,e)}getPermission(){return this._injector.createInstance(m.FPermission)}getDefinedName(e){const t=this._definedNamesService.getValueByName(this.id,e);return t?this._injector.createInstance(f,{...t,unitId:this.id}):null}getDefinedNames(){const e=this._definedNamesService.getDefinedNameMap(this.id);return e?Object.values(e).map(t=>this._injector.createInstance(f,{...t,unitId:this.id})):[]}insertDefinedName(e,t){const r=this._injector.createInstance(I).setName(e).setRef(t).build();return r.localSheetId=a.SCOPE_WORKBOOK_VALUE_DEFINED_NAME,this.insertDefinedNameBuilder(r),this}deleteDefinedName(e){const t=this.getDefinedName(e);return t?(t.delete(),!0):!1}insertDefinedNameBuilder(e){e.unitId=this.getId(),this._commandService.syncExecuteCommand(a.SetDefinedNameCommand.id,e)}updateDefinedNameBuilder(e){this._commandService.syncExecuteCommand(a.SetDefinedNameCommand.id,e)}getRegisteredRangeThemes(){return this._injector.get(a.SheetRangeThemeService).getRegisteredRangeThemes()}registerRangeTheme(e){this._commandService.syncExecuteCommand(a.RegisterWorksheetRangeThemeStyleCommand.id,{unitId:this.getId(),rangeThemeStyle:e})}unregisterRangeTheme(e){this._commandService.syncExecuteCommand(a.UnregisterWorksheetRangeThemeStyleCommand.id,{unitId:this.getId(),themeName:e})}createRangeThemeStyle(e,t){return new a.RangeThemeStyle(e,t)}setCustomMetadata(e){return this._workbook.setCustomMetadata(e),this}getCustomMetadata(){return this._workbook.getCustomMetadata()}},m.FWorkbook=J([k(1,s.Inject(s.Injector)),k(2,s.Inject(s.IResourceLoaderService)),k(3,s.Inject(a.SheetsSelectionsService)),k(4,s.IUniverInstanceService),k(5,s.ICommandService),k(6,s.IPermissionService),k(7,s.ILogService),k(8,s.Inject(s.LocaleService)),k(9,w.IDefinedNamesService)],m.FWorkbook);class Q extends S.FUniver{getCommandSheetTarget(i){var r;const e=i.params;if(!e)return this.getActiveSheet();const t=e.unitId?this.getUniverSheet(e.unitId):(r=this.getActiveWorkbook)==null?void 0:r.call(this);if(!t)return;const n=t.getSheetBySheetId(e.subUnitId||e.sheetId)||t.getActiveSheet();if(n)return{workbook:t,worksheet:n}}getSheetTarget(i,e){const t=this.getUniverSheet(i);if(!t)return;const n=t.getSheetBySheetId(e);if(n)return{workbook:t,worksheet:n}}_initWorkbookEvent(i){const e=i.get(s.IUniverInstanceService);this.registerEventHandler(this.Event.WorkbookDisposed,()=>e.unitDisposed$.subscribe(t=>{t.type===s.UniverInstanceType.UNIVER_SHEET&&this.fireEvent(this.Event.WorkbookDisposed,{unitId:t.getUnitId(),unitType:t.type,snapshot:t.getSnapshot()})})),this.registerEventHandler(this.Event.WorkbookCreated,()=>e.unitAdded$.subscribe(t=>{if(t.type===s.UniverInstanceType.UNIVER_SHEET){const n=t,r=i.createInstance(m.FWorkbook,n);this.fireEvent(this.Event.WorkbookCreated,{unitId:t.getUnitId(),type:t.type,workbook:r,unit:r})}}))}_initialize(i){const e=i.get(s.ICommandService);this.registerEventHandler(this.Event.BeforeSheetCreate,()=>e.beforeCommandExecuted(t=>{var n;if(t.id===a.InsertSheetCommand.id){const r=t.params,{unitId:o,index:h,sheet:c}=r||{},u=o?this.getUniverSheet(o):(n=this.getActiveWorkbook)==null?void 0:n.call(this);if(!u)return;const l={workbook:u,index:h,sheet:c};if(this.fireEvent(this.Event.BeforeSheetCreate,l),l.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeActiveSheetChange,()=>e.beforeCommandExecuted(t=>{var n;if(t.id===a.SetWorksheetActiveOperation.id){const{subUnitId:r,unitId:o}=t.params,h=o?this.getUniverSheet(o):(n=this.getActiveWorkbook)==null?void 0:n.call(this);if(!h||!r)return;const c=h.getSheetBySheetId(r),u=h.getActiveSheet();if(!c||!u)return;const l={workbook:h,activeSheet:c,oldActiveSheet:u};if(this.fireEvent(this.Event.BeforeActiveSheetChange,l),l.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeSheetDelete,()=>e.beforeCommandExecuted(t=>{if(t.id===a.RemoveSheetCommand.id){const n=this.getCommandSheetTarget(t);if(!n)return;const{workbook:r,worksheet:o}=n,h={workbook:r,worksheet:o};if(this.fireEvent(this.Event.BeforeSheetDelete,h),h.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeSheetMove,()=>e.beforeCommandExecuted(t=>{if(t.id===a.SetWorksheetOrderMutation.id){const{fromOrder:n,toOrder:r}=t.params,o=this.getCommandSheetTarget(t);if(!o)return;const h={workbook:o.workbook,worksheet:o.worksheet,newIndex:r,oldIndex:n};if(this.fireEvent(this.Event.BeforeSheetMove,h),h.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeSheetNameChange,()=>e.beforeCommandExecuted(t=>{if(t.id===a.SetWorksheetNameCommand.id){const{name:n}=t.params,r=this.getCommandSheetTarget(t);if(!r)return;const o={workbook:r.workbook,worksheet:r.worksheet,newName:n,oldName:r.worksheet.getSheetName()};if(this.fireEvent(this.Event.BeforeSheetNameChange,o),o.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeSheetTabColorChange,()=>e.beforeCommandExecuted(t=>{if(t.id===a.SetTabColorMutation.id){const{color:n}=t.params,r=this.getCommandSheetTarget(t);if(!r)return;const o={workbook:r.workbook,worksheet:r.worksheet,newColor:n,oldColor:r.worksheet.getTabColor()};if(this.fireEvent(this.Event.BeforeSheetTabColorChange,o),o.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeSheetHideChange,()=>e.beforeCommandExecuted(t=>{if(t.id===a.SetWorksheetHideMutation.id){const{hidden:n}=t.params,r=this.getCommandSheetTarget(t);if(!r)return;const o={workbook:r.workbook,worksheet:r.worksheet,hidden:!!n};if(this.fireEvent(this.Event.BeforeSheetHideChange,o),o.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeGridlineColorChange,()=>e.beforeCommandExecuted(t=>{var n;if(t.id===a.SetGridlinesColorCommand.id){const r=this.getCommandSheetTarget(t);if(!r)return;const o={...r,color:(n=t.params)==null?void 0:n.color};if(this.fireEvent(this.Event.BeforeGridlineColorChange,o),o.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeGridlineEnableChange,()=>e.beforeCommandExecuted(t=>{var n;if(t.id===a.ToggleGridlinesCommand.id){const r=this.getCommandSheetTarget(t);if(!r)return;const o={...r,enabled:!!((n=t.params)!=null&&n.showGridlines)};if(this.fireEvent(this.Event.BeforeGridlineEnableChange,o),o.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.SheetValueChanged,()=>e.onCommandExecuted(t=>{if(a.COMMAND_LISTENER_VALUE_CHANGE.indexOf(t.id)>-1){if(!this.getActiveSheet())return;const r=a.getValueChangedEffectedRange(t).map(o=>{var h,c;return(c=(h=this.getWorkbook(o.unitId))==null?void 0:h.getSheetBySheetId(o.subUnitId))==null?void 0:c.getRange(o.range)}).filter(Boolean);if(!r.length)return;this.fireEvent(this.Event.SheetValueChanged,{payload:t,effectedRanges:r})}})),this.registerEventHandler(this.Event.SheetCreated,()=>e.onCommandExecuted(t=>{var n;if(t.id===a.InsertSheetCommand.id){const r=t.params,{unitId:o}=r||{},h=o?this.getUniverSheet(o):(n=this.getActiveWorkbook)==null?void 0:n.call(this);if(!h)return;const c=h.getActiveSheet();if(!c)return;const u={workbook:h,worksheet:c};this.fireEvent(this.Event.SheetCreated,u)}})),this.registerEventHandler(this.Event.ActiveSheetChanged,()=>e.onCommandExecuted(t=>{if(t.id===a.SetWorksheetActiveOperation.id){const n=this.getActiveSheet();if(!n)return;const{workbook:r,worksheet:o}=n;this._fireActiveSheetChanged(r,o)}})),this.registerEventHandler(this.Event.SheetDeleted,()=>e.onCommandExecuted(t=>{var n;if(t.id===a.RemoveSheetCommand.id){const{subUnitId:r,unitId:o}=t.params,h=o?this.getUniverSheet(o):(n=this.getActiveWorkbook)==null?void 0:n.call(this);if(!h||!r)return;this._fireSheetDeleted(h,r)}})),this.registerEventHandler(this.Event.SheetMoved,()=>e.onCommandExecuted(t=>{if(t.id===a.SetWorksheetOrderMutation.id){const{toOrder:n}=t.params,r=this.getCommandSheetTarget(t);if(!r)return;this._fireSheetMoved(r.workbook,r.worksheet,n)}})),this.registerEventHandler(this.Event.SheetNameChanged,()=>e.onCommandExecuted(t=>{if(t.id===a.SetWorksheetNameCommand.id){const{name:n}=t.params,r=this.getCommandSheetTarget(t);if(!r)return;this._fireSheetNameChanged(r.workbook,r.worksheet,n)}})),this.registerEventHandler(this.Event.SheetTabColorChanged,()=>e.onCommandExecuted(t=>{if(t.id===a.SetTabColorMutation.id){const{color:n}=t.params,r=this.getCommandSheetTarget(t);if(!r)return;this._fireSheetTabColorChanged(r.workbook,r.worksheet,n)}})),this.registerEventHandler(this.Event.SheetHideChanged,()=>e.onCommandExecuted(t=>{if(t.id===a.SetWorksheetHideMutation.id){const{hidden:n}=t.params,r=this.getCommandSheetTarget(t);if(!r)return;this._fireSheetHideChanged(r.workbook,r.worksheet,!!n)}})),this.registerEventHandler(this.Event.GridlineChanged,()=>e.onCommandExecuted(t=>{if(t.id===a.SetGridlinesColorCommand.id||t.id===a.ToggleGridlinesCommand.id){const n=this.getCommandSheetTarget(t);if(!n)return;this.fireEvent(this.Event.GridlineChanged,{...n,enabled:!n.worksheet.hasHiddenGridLines(),color:n.worksheet.getGridLinesColor()})}})),this._initWorkbookEvent(i)}createUniverSheet(i,e){const n=this._injector.get(s.IUniverInstanceService).createUnit(s.UniverInstanceType.UNIVER_SHEET,i,e);return this._injector.createInstance(m.FWorkbook,n)}createWorkbook(i,e){return this.createUniverSheet(i,e)}getActiveWorkbook(){const i=this._univerInstanceService.getCurrentUnitForType(s.UniverInstanceType.UNIVER_SHEET);return i?this._injector.createInstance(m.FWorkbook,i):null}getActiveUniverSheet(){return this.getActiveWorkbook()}getUniverSheet(i){const e=this._univerInstanceService.getUnit(i,s.UniverInstanceType.UNIVER_SHEET);return e?this._injector.createInstance(m.FWorkbook,e):null}getWorkbook(i){return this.getUniverSheet(i)}getPermission(){return this._injector.createInstance(m.FPermission)}onUniverSheetCreated(i){const e=this._univerInstanceService.getTypeOfUnitAdded$(s.UniverInstanceType.UNIVER_SHEET).subscribe(t=>{const n=this._injector.createInstance(m.FWorkbook,t);i(n)});return s.toDisposable(e)}newDefinedName(){return this._injector.createInstance(I)}getActiveSheet(){const i=this.getActiveWorkbook();if(!i)return null;const e=i.getActiveSheet();return e?{workbook:i,worksheet:e}:null}_fireActiveSheetChanged(i,e){this.fireEvent(this.Event.ActiveSheetChanged,{workbook:i,activeSheet:e})}_fireSheetDeleted(i,e){this.fireEvent(this.Event.SheetDeleted,{workbook:i,sheetId:e})}_fireSheetMoved(i,e,t){this.fireEvent(this.Event.SheetMoved,{workbook:i,worksheet:e,newIndex:t})}_fireSheetNameChanged(i,e,t){this.fireEvent(this.Event.SheetNameChanged,{workbook:i,worksheet:e,newName:t})}_fireSheetTabColorChanged(i,e,t){this.fireEvent(this.Event.SheetTabColorChanged,{workbook:i,worksheet:e,newColor:t})}_fireSheetHideChanged(i,e,t){this.fireEvent(this.Event.SheetHideChanged,{workbook:i,worksheet:e,hidden:t})}}S.FUniver.extend(Q);class T{get SheetValueChangeType(){return a.SheetValueChangeType}get SheetSkeletonChangeType(){return a.SheetSkeletonChangeType}get SplitDelimiterType(){return a.SplitDelimiterEnum}}S.FEnum.extend(T);class A{get SheetCreated(){return"SheetCreated"}get BeforeSheetCreate(){return"BeforeSheetCreate"}get WorkbookCreated(){return"WorkbookCreated"}get WorkbookDisposed(){return"WorkbookDisposed"}get GridlineChanged(){return"GridlineChanged"}get BeforeGridlineEnableChange(){return"BeforeGridlineEnableChange"}get BeforeGridlineColorChange(){return"BeforeGridlineColorChange"}get BeforeActiveSheetChange(){return"BeforeActiveSheetChange"}get ActiveSheetChanged(){return"ActiveSheetChanged"}get SheetDeleted(){return"SheetDeleted"}get BeforeSheetDelete(){return"BeforeSheetDelete"}get SheetMoved(){return"SheetMoved"}get BeforeSheetMove(){return"BeforeSheetMove"}get SheetNameChanged(){return"SheetNameChanged"}get BeforeSheetNameChange(){return"BeforeSheetNameChange"}get SheetTabColorChanged(){return"SheetTabColorChanged"}get BeforeSheetTabColorChange(){return"BeforeSheetTabColorChange"}get SheetHideChanged(){return"SheetHideChanged"}get BeforeSheetHideChange(){return"BeforeSheetHideChange"}get SheetValueChanged(){return"SheetValueChanged"}}S.FEventName.extend(A);var X=Object.getOwnPropertyDescriptor,Z=(d,i,e,t)=>{for(var n=t>1?void 0:t?X(i,e):i,r=d.length-1,o;r>=0;r--)(o=d[r])&&(n=o(n)||n);return n},ee=(d,i)=>(e,t)=>i(e,t,d);m.FSheetHooks=class extends S.FBase{constructor(i){super(),this._injector=i}},m.FSheetHooks=Z([ee(0,s.Inject(s.Injector))],m.FSheetHooks),m.FSheetEventName=A,m.FSheetsEnum=T,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
16
|
+
(function(u,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/core/facade"),require("@univerjs/sheets"),require("@univerjs/engine-formula")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/core/facade","@univerjs/sheets","@univerjs/engine-formula"],s):(u=typeof globalThis<"u"?globalThis:u||self,s(u.UniverSheetsFacade={},u.UniverCore,u.UniverCoreFacade,u.UniverSheets,u.UniverEngineFormula))})(this,function(u,s,_,a,I){"use strict";var re=Object.defineProperty;var ie=(u,s,_)=>s in u?re(u,s,{enumerable:!0,configurable:!0,writable:!0,value:_}):u[s]=_;var b=(u,s,_)=>ie(u,typeof s!="symbol"?s+"":s,_);var D=Object.getOwnPropertyDescriptor,B=(c,r,e,t)=>{for(var n=t>1?void 0:t?D(r,e):r,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},k=(c,r)=>(e,t)=>r(e,t,c);function j(c,r,e){const t=e.getDefinedNameMap(c);if(t==null)return r.t("definedName.defaultName")+1;const i=Array.from(Object.values(t)).length+1,o=r.t("definedName.defaultName")+i;if(e.getValueByName(c,o)==null)return o;let h=i+1;for(;;){const d=r.t("definedName.defaultName")+h;if(e.getValueByName(c,d)==null)return d;h++}}class y{constructor(){b(this,"_definedNameParam");this._definedNameParam={id:s.generateRandomId(10),unitId:"",name:"",formulaOrRefString:""}}setName(r){return this._definedNameParam.name=r,this}setFormula(r){return this._definedNameParam.formulaOrRefString=`=${r}`,this}setRef(r){return this._definedNameParam.formulaOrRefString=r,this}setRefByRange(r,e,t,n){return this._definedNameParam.formulaOrRefString=I.serializeRange({startRow:r,endRow:r+(t!=null?t:1)-1,startColumn:e,endColumn:e+(n!=null?n:1)-1}),this}setComment(r){return this._definedNameParam.comment=r,this}setHidden(r){return this._definedNameParam.hidden=r,this}build(){return this._definedNameParam}load(r){return this._definedNameParam=r,this}}let p=class extends _.FBase{constructor(c,r,e,t,n,i,o,h,d,l){super(),this._definedNameParam=c,this._injector=r,this._commandService=e,this._permissionService=t,this._worksheetProtectionRuleModel=n,this._rangeProtectionRuleModel=i,this._worksheetProtectionPointRuleModel=o,this._authzIoService=h,this._localeService=d,this._definedNamesService=l}_apply(){this._definedNameParam.name===""&&(this._definedNameParam.name=j(this._definedNameParam.unitId,this._localeService,this._definedNamesService)),this._commandService.syncExecuteCommand(a.SetDefinedNameCommand.id,this._definedNameParam)}getName(){return this._definedNameParam.name}setName(c){this._definedNameParam.name=c,this._apply()}setFormula(c){this._definedNameParam.formulaOrRefString=`=${c}`,this._apply()}setRef(c){this._definedNameParam.formulaOrRefString=c,this._apply()}getFormulaOrRefString(){return this._definedNameParam.formulaOrRefString}setRefByRange(c,r,e,t){this._definedNameParam.formulaOrRefString=I.serializeRange({startRow:c,endRow:c+(e!=null?e:1)-1,startColumn:r,endColumn:r+(t!=null?t:1)-1}),this._apply()}getComment(){return this._definedNameParam.comment}setComment(c){this._definedNameParam.comment=c,this._apply()}setScopeToWorksheet(c){this._definedNameParam.localSheetId=c.getSheetId(),this._apply()}setScopeToWorkbook(){this._definedNameParam.localSheetId=a.SCOPE_WORKBOOK_VALUE_DEFINED_NAME,this._apply()}setHidden(c){this._definedNameParam.hidden=c,this._apply()}delete(){this._commandService.syncExecuteCommand(a.RemoveDefinedNameCommand.id,this._definedNameParam)}getLocalSheetId(){return this._definedNameParam.localSheetId}isWorkbookScope(){return this._definedNameParam.localSheetId===a.SCOPE_WORKBOOK_VALUE_DEFINED_NAME}toBuilder(){const c=this._injector.createInstance(y);return c.load(this._definedNameParam),c}};p=B([k(1,s.Inject(s.Injector)),k(2,s.ICommandService),k(3,s.IPermissionService),k(4,s.Inject(a.WorksheetProtectionRuleModel)),k(5,s.Inject(a.RangeProtectionRuleModel)),k(6,s.Inject(a.WorksheetProtectionPointModel)),k(7,s.Inject(s.IAuthzIoService)),k(8,s.Inject(s.LocaleService)),k(9,I.IDefinedNamesService)],p);var V=Object.getOwnPropertyDescriptor,O=(c,r,e,t)=>{for(var n=t>1?void 0:t?V(r,e):r,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},f=(c,r)=>(e,t)=>r(e,t,c);u.FPermission=class extends _.FBase{constructor(e,t,n,i,o,h,d){super();b(this,"permissionPointsDefinition",a.PermissionPointsDefinitions);b(this,"rangeRuleChangedAfterAuth$");b(this,"sheetRuleChangedAfterAuth$");this._injector=e,this._commandService=t,this._permissionService=n,this._worksheetProtectionRuleModel=i,this._rangeProtectionRuleModel=o,this._worksheetProtectionPointRuleModel=h,this._authzIoService=d,this.rangeRuleChangedAfterAuth$=this._rangeProtectionRuleModel.ruleRefresh$,this.sheetRuleChangedAfterAuth$=this._worksheetProtectionRuleModel.ruleRefresh$}setWorkbookPermissionPoint(e,t,n){const i=new t(e);this._permissionService.getPermissionPoint(i.id)||this._permissionService.addPermissionPoint(i),this._permissionService.updatePermissionPoint(i.id,n)}setWorkbookEditPermission(e,t){this.setWorkbookPermissionPoint(e,a.WorkbookEditablePermission,t)}async addWorksheetBasePermission(e,t){if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).length>0)throw new Error("sheet protection cannot intersect with range protection");const i=await this._authzIoService.create({objectType:a.UnitObject.Worksheet,worksheetObject:{collaborators:[],unitID:e,strategies:[],name:"",scope:void 0}});if(this._commandService.syncExecuteCommand(a.AddWorksheetProtectionMutation.id,{unitId:e,subUnitId:t,rule:{permissionId:i,unitType:a.UnitObject.Worksheet,unitId:e,subUnitId:t}}))return i}removeWorksheetPermission(e,t){this._commandService.syncExecuteCommand(a.DeleteWorksheetProtectionMutation.id,{unitId:e,subUnitId:t}),[...a.getAllWorksheetPermissionPoint(),...a.getAllWorksheetPermissionPointByPointPanel()].forEach(n=>{const i=new n(e,t);this._permissionService.updatePermissionPoint(i.id,!0)}),this._worksheetProtectionPointRuleModel.deleteRule(e,t)}async setWorksheetPermissionPoint(e,t,n,i){const o=this._worksheetProtectionRuleModel.getRule(e,t);let h;if(n===a.WorksheetEditPermission||n===a.WorksheetViewPermission)if(o)h=o.permissionId;else{if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).length>0)throw new Error("sheet protection cannot intersect with range protection");h=await this.addWorksheetBasePermission(e,t)}else{const g=this._worksheetProtectionPointRuleModel.getRule(e,t);g?h=g.permissionId:(h=await this._authzIoService.create({objectType:a.UnitObject.Worksheet,worksheetObject:{collaborators:[],unitID:e,strategies:[],name:"",scope:void 0}}),this._commandService.syncExecuteCommand(a.SetWorksheetPermissionPointsMutation.id,{unitId:e,subUnitId:t,rule:{unitId:e,subUnitId:t,permissionId:h}}))}const l=new n(e,t);return this._permissionService.getPermissionPoint(l.id)||this._permissionService.addPermissionPoint(l),this._permissionService.updatePermissionPoint(l.id,i),h}async addRangeBaseProtection(e,t,n){const i=await this._authzIoService.create({objectType:a.UnitObject.SelectRange,selectRangeObject:{collaborators:[],unitID:e,name:"",scope:void 0}}),o=`ruleId_${s.generateRandomId(6)}`;if(this._worksheetProtectionRuleModel.getRule(e,t))throw new Error("sheet protection cannot intersect with range protection");if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).some(g=>g.ranges.some(C=>n.some(S=>s.Rectangle.intersects(S.getRange(),C)))))throw new Error("range protection cannot intersect");if(this._commandService.syncExecuteCommand(a.AddRangeProtectionMutation.id,{unitId:e,subUnitId:t,rules:[{permissionId:i,unitType:a.UnitObject.SelectRange,unitId:e,subUnitId:t,ranges:n.map(g=>g.getRange()),id:o}]}))return{permissionId:i,ruleId:o}}removeRangeProtection(e,t,n){this._commandService.syncExecuteCommand(a.DeleteRangeProtectionMutation.id,{unitId:e,subUnitId:t,ruleIds:n})&&this._rangeProtectionRuleModel.getSubunitRuleList(e,t).length===0&&(this._worksheetProtectionPointRuleModel.deleteRule(e,t),[...a.getAllWorksheetPermissionPointByPointPanel()].forEach(h=>{const d=new h(e,t);this._permissionService.updatePermissionPoint(d.id,d.value)}))}setRangeProtectionPermissionPoint(e,t,n,i,o){const h=new i(e,t,n);this._permissionService.getPermissionPoint(h.id)||this._permissionService.addPermissionPoint(h),this._permissionService.updatePermissionPoint(h.id,o)}setRangeProtectionRanges(e,t,n,i){const o=this._rangeProtectionRuleModel.getRule(e,t,n);if(o){if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).filter(l=>l.id!==n).some(l=>l.ranges.some(m=>i.some(g=>s.Rectangle.intersects(g.getRange(),m)))))throw new Error("range protection cannot intersect");this._commandService.syncExecuteCommand(a.SetRangeProtectionMutation.id,{unitId:e,subUnitId:t,ruleId:n,rule:{...o,ranges:i.map(l=>l.getRange())}})}}},u.FPermission=O([f(0,s.Inject(s.Injector)),f(1,s.ICommandService),f(2,s.IPermissionService),f(3,s.Inject(a.WorksheetProtectionRuleModel)),f(4,s.Inject(a.RangeProtectionRuleModel)),f(5,s.Inject(a.WorksheetProtectionPointModel)),f(6,s.Inject(s.IAuthzIoService))],u.FPermission);function H(c){switch(c){case"left":return s.HorizontalAlign.LEFT;case"center":return s.HorizontalAlign.CENTER;case"normal":return s.HorizontalAlign.RIGHT;default:throw new Error(`Invalid horizontal alignment: ${c}`)}}function T(c){switch(c){case s.HorizontalAlign.LEFT:return"left";case s.HorizontalAlign.CENTER:return"center";case s.HorizontalAlign.RIGHT:return"normal";default:return"general"}}function L(c){switch(c){case"top":return s.VerticalAlign.TOP;case"middle":return s.VerticalAlign.MIDDLE;case"bottom":return s.VerticalAlign.BOTTOM;default:throw new Error(`Invalid vertical alignment: ${c}`)}}function W(c){switch(c){case s.VerticalAlign.TOP:return"top";case s.VerticalAlign.MIDDLE:return"middle";case s.VerticalAlign.BOTTOM:return"bottom";default:return"general"}}function E(c){return s.isFormulaString(c)?{f:c,v:null,p:null}:s.isCellV(c)?{v:c,p:null,f:null}:(s.isICellData(c),c)}function M(c,r){const e=new s.ObjectMatrix,{startRow:t,startColumn:n,endRow:i,endColumn:o}=r;if(s.Tools.isArray(c))for(let h=0;h<=i-t;h++)for(let d=0;d<=o-n;d++)e.setValue(h+t,d+n,E(c[h][d]));else new s.ObjectMatrix(c).forValue((d,l,m)=>{e.setValue(d,l,E(m))});return e.getMatrix()}function P(c,r){return{startRow:c.startRow,endRow:c.endRow,startColumn:0,endColumn:r.getColumnCount()-1,rangeType:s.RANGE_TYPE.ROW}}function N(c,r){return{startRow:0,endRow:r.getRowCount()-1,startColumn:c.startColumn,endColumn:c.endColumn,rangeType:s.RANGE_TYPE.COLUMN}}var z=Object.getOwnPropertyDescriptor,G=(c,r,e,t)=>{for(var n=t>1?void 0:t?z(r,e):r,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},A=(c,r)=>(e,t)=>r(e,t,c);u.FRange=class extends _.FBaseInitialable{constructor(r,e,t,n,i,o){super(n),this._workbook=r,this._worksheet=e,this._range=t,this._injector=n,this._commandService=i,this._formulaDataModel=o}getUnitId(){return this._workbook.getUnitId()}getSheetName(){return this._worksheet.getName()}getSheetId(){return this._worksheet.getSheetId()}getRange(){return this._range}getRow(){return this._range.startRow}getLastRow(){return this._range.endRow}getColumn(){return this._range.startColumn}getLastColumn(){return this._range.endColumn}getWidth(){return this._range.endColumn-this._range.startColumn+1}getHeight(){return this._range.endRow-this._range.startRow+1}isMerged(){const{startColumn:r,startRow:e,endColumn:t,endRow:n}=this._range;return this._worksheet.getMergedCellRange(e,r,n,t).some(o=>s.Rectangle.equals(o,this._range))}getCellStyleData(){var t;const r=this.getCellData(),e=this._workbook.getStyles();return r&&e&&(t=e.getStyleByCell(r))!=null?t:null}getCellStyle(){const r=this.getCellStyleData();return r?s.TextStyleValue.create(r):null}getCellStyles(){const r=this.getCellDatas(),e=this._workbook.getStyles();return r.map(t=>t.map(n=>{if(!n)return null;const i=e.getStyleByCell(n);return i?s.TextStyleValue.create(i):null}))}getValue(r){var e,t;return r?this.getValueAndRichTextValue():(t=(e=this._worksheet.getCell(this._range.startRow,this._range.startColumn))==null?void 0:e.v)!=null?t:null}getRawValue(){var e;const r=this._worksheet.getCellMatrix().getValue(this._range.startRow,this._range.startColumn);return r!=null&&r.p&&((e=r.p.body)!=null&&e.dataStream)?r.p.body.dataStream:r!=null&&r.v?r.v:null}getDisplayValue(){var e;const r=this._worksheet.getCell(this._range.startRow,this._range.startColumn);return r!=null&&r.p&&((e=r.p.body)!=null&&e.dataStream)?r.p.body.dataStream:r!=null&&r.v?String(r.v):""}getValues(r){var h,d;if(r)return this.getValueAndRichTextValues();const{startRow:e,endRow:t,startColumn:n,endColumn:i}=this._range,o=[];for(let l=e;l<=t;l++){const m=[];for(let g=n;g<=i;g++)m.push((d=(h=this._worksheet.getCell(l,g))==null?void 0:h.v)!=null?d:null);o.push(m)}return o}getRawValues(){var h;const r=this._worksheet.getCellMatrix(),{startRow:e,endRow:t,startColumn:n,endColumn:i}=this._range,o=[];for(let d=e;d<=t;d++){const l=[];for(let m=n;m<=i;m++){const g=r.getValue(d,m);g!=null&&g.p&&((h=g.p.body)!=null&&h.dataStream)?l.push(g.p.body.dataStream):g!=null&&g.v?l.push(g.v):l.push(null)}o.push(l)}return o}getDisplayValues(){var o;const{startRow:r,endRow:e,startColumn:t,endColumn:n}=this._range,i=[];for(let h=r;h<=e;h++){const d=[];for(let l=t;l<=n;l++){const m=this._worksheet.getCell(h,l);m!=null&&m.p&&((o=m.p.body)!=null&&o.dataStream)?d.push(m.p.body.dataStream):m!=null&&m.v?d.push(String(m.v)):d.push("")}i.push(d)}return i}getCellData(){var r;return(r=this._worksheet.getCell(this._range.startRow,this._range.startColumn))!=null?r:null}getCellDatas(){return this.getCellDataGrid()}getCellDataGrid(){const{startRow:r,endRow:e,startColumn:t,endColumn:n}=this._range,i=[];for(let o=r;o<=e;o++){const h=[];for(let d=t;d<=n;d++)h.push(this._worksheet.getCellRaw(o,d));i.push(h)}return i}getRichTextValue(){const r=this.getCellData();return r!=null&&r.p?new s.RichTextValue(r.p):null}getRichTextValues(){return this.getCellDataGrid().map(e=>e.map(t=>t!=null&&t.p?new s.RichTextValue(t.p):null))}getValueAndRichTextValue(){const r=this.getCellData();return r!=null&&r.p?new s.RichTextValue(r.p):r==null?void 0:r.v}getValueAndRichTextValues(){return this.getCellDatas().map(e=>e.map(t=>t!=null&&t.p?new s.RichTextValue(t.p):t==null?void 0:t.v))}getFormula(){var r;return(r=this._formulaDataModel.getFormulaStringByCell(this._range.startRow,this._range.startColumn,this._worksheet.getSheetId(),this._workbook.getUnitId()))!=null?r:""}getFormulas(){const r=[],{startRow:e,endRow:t,startColumn:n,endColumn:i}=this._range,o=this._worksheet.getSheetId(),h=this._workbook.getUnitId();for(let d=e;d<=t;d++){const l=[];for(let m=n;m<=i;m++){const g=this._formulaDataModel.getFormulaStringByCell(d,m,o,h);l.push(g||"")}r.push(l)}return r}getWrap(){return this._worksheet.getRange(this._range).getWrap()===s.BooleanNumber.TRUE}getWraps(){const r=this.getCellDatas(),e=this._workbook.getStyles();return r.map(t=>t.map(n=>{var i;return((i=e.getStyleByCell(n))==null?void 0:i.tb)===s.WrapStrategy.WRAP}))}getWrapStrategy(){return this._worksheet.getRange(this._range).getWrapStrategy()}getHorizontalAlignment(){const r=this._worksheet.getRange(this._range).getHorizontalAlignment();return T(r)}getHorizontalAlignments(){return this._worksheet.getRange(this._range).getHorizontalAlignments().map(e=>e.map(t=>T(t)))}getVerticalAlignment(){return W(this._worksheet.getRange(this._range).getVerticalAlignment())}getVerticalAlignments(){return this._worksheet.getRange(this._range).getVerticalAlignments().map(e=>e.map(t=>W(t)))}setCustomMetaData(r){return this.setValue({custom:r})}setCustomMetaDatas(r){return this.setValues(r.map(e=>e.map(t=>({custom:t}))))}getCustomMetaData(){var e;const r=this.getCellData();return(e=r==null?void 0:r.custom)!=null?e:null}getCustomMetaDatas(){return this.getCellDataGrid().map(e=>e.map(t=>{var n;return(n=t==null?void 0:t.custom)!=null?n:null}))}setBorder(r,e,t){return this._commandService.syncExecuteCommand(a.SetBorderBasicCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),ranges:[this._range],value:{type:r,style:e,color:t}}),this}getBackground(){var e,t;const r=this.getCellStyle();return(t=(e=r==null?void 0:r.background)==null?void 0:e.rgb)!=null?t:s.DEFAULT_STYLES.bg.rgb}getBackgrounds(){return this.getCellStyles().map(e=>e.map(t=>{var n,i;return(i=(n=t==null?void 0:t.background)==null?void 0:n.rgb)!=null?i:s.DEFAULT_STYLES.bg.rgb}))}setBackgroundColor(r){return this._commandService.syncExecuteCommand(a.SetStyleCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:{type:"bg",value:{rgb:r}}}),this}setBackground(r){return this.setBackgroundColor(r),this}setTextRotation(r){return this._commandService.syncExecuteCommand(a.SetTextRotationCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:r}),this}setValue(r){const e=E(r);if(!e)throw new Error("Invalid value");return this._commandService.syncExecuteCommand(a.SetRangeValuesCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:e}),this}setValueForCell(r){const e=E(r);if(!e)throw new Error("Invalid value");return this._commandService.syncExecuteCommand(a.SetRangeValuesCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:{startColumn:this._range.startColumn,startRow:this._range.startRow,endColumn:this._range.startColumn,endRow:this._range.startRow},value:e}),this}setRichTextValueForCell(r){const e=r instanceof s.RichTextValue?r.getData():r,t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:{startColumn:this._range.startColumn,startRow:this._range.startRow,endColumn:this._range.startColumn,endRow:this._range.startRow},value:{p:e}};return this._commandService.syncExecuteCommand(a.SetRangeValuesCommand.id,t),this}setRichTextValues(r){const e=r.map(i=>i.map(o=>o&&{p:o instanceof s.RichTextValue?o.getData():o})),t=M(e,this._range),n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:t};return this._commandService.syncExecuteCommand(a.SetRangeValuesCommand.id,n),this}setWrap(r){return this._commandService.syncExecuteCommand(a.SetTextWrapCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:r?s.WrapStrategy.WRAP:s.WrapStrategy.UNSPECIFIED}),this}setWrapStrategy(r){return this._commandService.syncExecuteCommand(a.SetTextWrapCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:r}),this}setVerticalAlignment(r){return this._commandService.syncExecuteCommand(a.SetVerticalTextAlignCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:L(r)}),this}setHorizontalAlignment(r){return this._commandService.syncExecuteCommand(a.SetHorizontalTextAlignCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:H(r)}),this}setValues(r){const e=M(r,this._range);return this._commandService.syncExecuteCommand(a.SetRangeValuesCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:e}),this}setFontWeight(r){let e;if(r==="bold")e=s.BooleanNumber.TRUE;else if(r==="normal")e=s.BooleanNumber.FALSE;else if(r===null)e=null;else throw new Error("Invalid fontWeight");const t={type:"bl",value:e},n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:t};return this._commandService.syncExecuteCommand(a.SetStyleCommand.id,n),this}setFontStyle(r){let e;if(r==="italic")e=s.BooleanNumber.TRUE;else if(r==="normal")e=s.BooleanNumber.FALSE;else if(r===null)e=null;else throw new Error("Invalid fontStyle");const t={type:"it",value:e},n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:t};return this._commandService.syncExecuteCommand(a.SetStyleCommand.id,n),this}setFontLine(r){if(r==="underline")this._setFontUnderline({s:s.BooleanNumber.TRUE});else if(r==="line-through")this._setFontStrikethrough({s:s.BooleanNumber.TRUE});else if(r==="none")this._setFontUnderline({s:s.BooleanNumber.FALSE}),this._setFontStrikethrough({s:s.BooleanNumber.FALSE});else if(r===null)this._setFontUnderline(null),this._setFontStrikethrough(null);else throw new Error("Invalid fontLine");return this}_setFontUnderline(r){const e={type:"ul",value:r},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};this._commandService.syncExecuteCommand(a.SetStyleCommand.id,t)}_setFontStrikethrough(r){const e={type:"st",value:r},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};this._commandService.syncExecuteCommand(a.SetStyleCommand.id,t)}setFontFamily(r){const e={type:"ff",value:r},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};return this._commandService.syncExecuteCommand(a.SetStyleCommand.id,t),this}setFontSize(r){const e={type:"fs",value:r},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};return this._commandService.syncExecuteCommand(a.SetStyleCommand.id,t),this}setFontColor(r){const t={type:"cl",value:r===null?null:{rgb:r}},n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:t};return this._commandService.syncExecuteCommand(a.SetStyleCommand.id,n),this}merge(r=!0){const e=this._workbook.getUnitId(),t=this._worksheet.getSheetId();return a.addMergeCellsUtil(this._injector,e,t,[this._range],r),this}mergeAcross(r=!0){const e=a.getAddMergeMutationRangeByType([this._range],s.Dimension.ROWS),t=this._workbook.getUnitId(),n=this._worksheet.getSheetId();return a.addMergeCellsUtil(this._injector,t,n,e,r),this}mergeVertically(r=!0){const e=a.getAddMergeMutationRangeByType([this._range],s.Dimension.COLUMNS),t=this._workbook.getUnitId(),n=this._worksheet.getSheetId();return a.addMergeCellsUtil(this._injector,t,n,e,r),this}isPartOfMerge(){const{startRow:r,startColumn:e,endRow:t,endColumn:n}=this._range;return this._worksheet.getMergedCellRange(r,e,t,n).length>0}breakApart(){return this._commandService.syncExecuteCommand(a.RemoveWorksheetMergeCommand.id,{ranges:[this._range]}),this}forEach(r){const{startColumn:e,startRow:t,endColumn:n,endRow:i}=this._range;this._worksheet.getMatrixWithMergedCells(t,e,i,n).forValue((o,h,d)=>{r(o,h,d)})}getA1Notation(r){return r?I.serializeRangeWithSheet(this._worksheet.getName(),this._range):I.serializeRange(this._range)}activate(){return this._injector.createInstance(u.FWorkbook,this._workbook).setActiveRange(this),this}activateAsCurrentCell(){const r=this._worksheet.getMergedCell(this._range.startRow,this._range.startColumn);if(r&&s.Rectangle.equals(r,this._range)||!r&&this._range.startRow===this._range.endRow&&this._range.startColumn===this._range.endColumn){const n=this._injector.createInstance(u.FWorkbook,this._workbook).getActiveRange();if(!n||n.getUnitId()!==this.getUnitId()||n.getSheetId()!==this.getSheetId())return this.activate();if(s.Rectangle.contains(n.getRange(),this._range)){const i={unitId:this.getUnitId(),subUnitId:this.getSheetId(),selections:[{range:n.getRange(),primary:a.getPrimaryForRange(this.getRange(),this._worksheet),style:null}]};return this._commandService.syncExecuteCommand(a.SetSelectionsOperation.id,i),this}return this.activate()}else throw new Error("The range is not a single cell")}splitTextToColumns(r,e,t){this._commandService.syncExecuteCommand(a.SplitTextToColumnsCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,delimiter:e,customDelimiter:t,treatMultipleDelimitersAsOne:r})}useThemeStyle(r){if(r==null){const e=this.getUsedThemeStyle();e&&this.removeThemeStyle(e)}else this._commandService.syncExecuteCommand(a.SetWorksheetRangeThemeStyleCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,themeName:r})}removeThemeStyle(r){this._commandService.syncExecuteCommand(a.DeleteWorksheetRangeThemeStyleCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,themeName:r})}getUsedThemeStyle(){return this._injector.get(a.SheetRangeThemeService).getAppliedRangeThemeStyle({unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range})}clear(r){return r&&r.contentsOnly&&!r.formatOnly?this.clearContent():r&&r.formatOnly&&!r.contentsOnly?this.clearFormat():(this._commandService.syncExecuteCommand(a.ClearSelectionAllCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),ranges:[this._range],options:r}),this)}clearContent(){return this._commandService.syncExecuteCommand(a.ClearSelectionContentCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),ranges:[this._range]}),this}clearFormat(){return this._commandService.syncExecuteCommand(a.ClearSelectionFormatCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),ranges:[this._range]}),this}insertCells(r){r===s.Dimension.ROWS?this._commandService.executeCommand(a.InsertRangeMoveDownCommand.id,{range:this._range}):this._commandService.executeCommand(a.InsertRangeMoveRightCommand.id,{range:this._range})}deleteCells(r){r===s.Dimension.ROWS?this._commandService.executeCommand(a.DeleteRangeMoveUpCommand.id,{range:this._range}):this._commandService.executeCommand(a.DeleteRangeMoveLeftCommand.id,{range:this._range})}getDataRegion(r){const{startRow:e,startColumn:t,endRow:n,endColumn:i}=this._range,o=this._worksheet.getMaxRows(),h=this._worksheet.getMaxColumns(),d=this._worksheet.getCellMatrix();let l=e,m=t,g=n,C=i;if(r!==s.Dimension.COLUMNS){let S=!1,R=!1;for(let v=t;v<=i&&(e>0&&!s.isNullCell(d.getValue(e-1,v))&&(S=!0),n<o-1&&!s.isNullCell(d.getValue(n+1,v))&&(R=!0),!(S&&R));v++);S&&(l=e-1),R&&(g=n+1)}if(r!==s.Dimension.ROWS){let S=!1,R=!1;for(let v=e;v<=n&&(t>0&&!s.isNullCell(d.getValue(v,t-1))&&(S=!0),i<h-1&&!s.isNullCell(d.getValue(v,i+1))&&(R=!0),!(S&&R));v++);S&&(m=t-1),R&&(C=i+1)}return this._injector.createInstance(u.FRange,this._workbook,this._worksheet,{startRow:l,startColumn:m,endRow:g,endColumn:C})}isBlank(){const r=this._worksheet.getCellMatrix(),{startRow:e,startColumn:t,endRow:n,endColumn:i}=this._range;let o=!0;for(let h=e;h<=n;h++){for(let d=t;d<=i;d++)if(!s.isNullCell(r.getValue(h,d))){o=!1;break}if(!o)break}return o}offset(r,e,t,n){const{startRow:i,startColumn:o,endRow:h,endColumn:d}=this._range,l=i+r,m=o+e,g=t?l+t-1:h+r,C=n?m+n-1:d+e;if(l<0||m<0||g<0||C<0)throw new Error("The row or column index is out of range");return this._injector.createInstance(u.FRange,this._workbook,this._worksheet,{startRow:l,startColumn:m,endRow:g,endColumn:C})}setFormula(r){return this.setValue({f:r})}setFormulas(r){return this.setValues(r.map(e=>e.map(t=>({f:t}))))}},u.FRange=G([A(3,s.Inject(s.Injector)),A(4,s.ICommandService),A(5,s.Inject(I.FormulaDataModel))],u.FRange);var $=Object.getOwnPropertyDescriptor,Y=(c,r,e,t)=>{for(var n=t>1?void 0:t?$(r,e):r,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},q=(c,r)=>(e,t)=>r(e,t,c);u.FSelection=class{constructor(r,e,t,n){this._workbook=r,this._worksheet=e,this._selections=t,this._injector=n}getActiveRange(){const r=this._selections.find(e=>!!e.primary);return r?this._injector.createInstance(u.FRange,this._workbook,this._worksheet,r.range):null}getActiveRangeList(){return this._selections.map(r=>this._injector.createInstance(u.FRange,this._workbook,this._worksheet,r.range))}getCurrentCell(){const r=this._selections.find(e=>!!e.primary);return r?r.primary:null}getActiveSheet(){const r=this._injector.createInstance(u.FWorkbook,this._workbook);return this._injector.createInstance(u.FWorksheet,r,this._workbook,this._worksheet)}updatePrimaryCell(r){const e=this._injector.get(s.ICommandService);let t=[],n=!1;for(const{range:o,style:h}of this._selections)s.Rectangle.contains(o,r.getRange())?(t.push({range:o,primary:a.getPrimaryForRange(r.getRange(),this._worksheet),style:h}),n=!0):t.push({range:o,primary:null,style:h});n||(t=[{range:r.getRange(),primary:a.getPrimaryForRange(r.getRange(),this._worksheet)}]);const i={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),selections:t};return e.syncExecuteCommand(a.SetSelectionsOperation.id,i),new u.FSelection(this._workbook,this._worksheet,t,this._injector)}getNextDataRange(r){if(!this._selections.find(n=>!!n.primary))return null;const t=a.getNextPrimaryCell(this._selections.concat(),r,this._worksheet);return t?this._injector.createInstance(u.FRange,this._workbook,this._worksheet,t):null}},u.FSelection=Y([q(3,s.Inject(s.Injector))],u.FSelection);var K=Object.getOwnPropertyDescriptor,J=(c,r,e,t)=>{for(var n=t>1?void 0:t?K(r,e):r,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},U=(c,r)=>(e,t)=>r(e,t,c);u.FWorksheet=class extends _.FBaseInitialable{constructor(e,t,n,i,o,h,d){super(i);b(this,"setActiveSelection",this.setActiveRange);this._fWorkbook=e,this._workbook=t,this._worksheet=n,this._injector=i,this._selectionManagerService=o,this._logService=h,this._commandService=d}getSheet(){return this._worksheet}getInject(){return this._injector}getWorkbook(){return this._workbook}getSheetId(){return this._worksheet.getSheetId()}getSheetName(){return this._worksheet.getName()}getSelection(){const e=this._selectionManagerService.getCurrentSelections();return e?this._injector.createInstance(u.FSelection,this._workbook,this._worksheet,e):null}getDefaultStyle(){return this._worksheet.getDefaultCellStyle()}getRowDefaultStyle(e,t=!1){return this._worksheet.getRowStyle(e,t)}getColumnDefaultStyle(e,t=!1){return this._worksheet.getColumnStyle(e,t)}setDefaultStyle(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId();return this._commandService.syncExecuteCommand(a.SetWorksheetDefaultStyleMutation.id,{unitId:t,subUnitId:n,defaultStyle:e}),this._worksheet.setDefaultCellStyle(e),this}setColumnDefaultStyle(e,t){const n=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o={unitId:n,subUnitId:i,columnData:{[e]:{s:t}}};return this._commandService.syncExecuteCommand(a.SetColDataCommand.id,o),this}setRowDefaultStyle(e,t){const n=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o={unitId:n,subUnitId:i,rowData:{[e]:{s:t}}};return this._commandService.syncExecuteCommand(a.SetRowDataCommand.id,o),this}getRange(e,t,n,i){let o,h;if(typeof e=="object")o=e,h=this._worksheet;else if(typeof e=="string"){const{range:d,sheetName:l}=I.deserializeRangeWithSheet(e),m=l?this._workbook.getSheetBySheetName(l):this._worksheet;if(!m)throw new Error("Range not found");h=m,o={...d,unitId:this._workbook.getUnitId(),sheetId:h.getSheetId(),rangeType:s.RANGE_TYPE.NORMAL,startRow:d.rangeType===s.RANGE_TYPE.COLUMN?0:d.startRow,endRow:d.rangeType===s.RANGE_TYPE.COLUMN?h.getMaxRows()-1:d.endRow,startColumn:d.rangeType===s.RANGE_TYPE.ROW?0:d.startColumn,endColumn:d.rangeType===s.RANGE_TYPE.ROW?h.getMaxColumns()-1:d.endColumn}}else if(typeof e=="number"&&t!==void 0)h=this._worksheet,o={startRow:e,endRow:e+(n!=null?n:1)-1,startColumn:t,endColumn:t+(i!=null?i:1)-1,unitId:this._workbook.getUnitId(),sheetId:this._worksheet.getSheetId()};else throw new Error("Invalid range specification");return this._injector.createInstance(u.FRange,this._workbook,h,o)}getMaxColumns(){return this._worksheet.getMaxColumns()}getMaxRows(){return this._worksheet.getMaxRows()}insertRowAfter(e){return this.insertRowsAfter(e,1)}insertRowBefore(e){return this.insertRowsBefore(e,1)}insertRows(e,t=1){return this.insertRowsBefore(e,t)}insertRowsAfter(e,t){const n=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o=s.Direction.DOWN,h=e+1,d=e+t,l=0,m=this._worksheet.getColumnCount()-1,g=a.copyRangeStyles(this._worksheet,h,d,l,m,!0,e);return this._commandService.syncExecuteCommand(a.InsertRowByRangeCommand.id,{unitId:n,subUnitId:i,direction:o,range:{startRow:h,endRow:d,startColumn:l,endColumn:m},cellValue:g}),this}insertRowsBefore(e,t){const n=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o=s.Direction.UP,h=e,d=e+t-1,l=0,m=this._worksheet.getColumnCount()-1,g=a.copyRangeStyles(this._worksheet,h,d,l,m,!0,e-1);return this._commandService.syncExecuteCommand(a.InsertRowByRangeCommand.id,{unitId:n,subUnitId:i,direction:o,range:{startRow:h,endRow:d,startColumn:l,endColumn:m},cellValue:g}),this}deleteRow(e){return this.deleteRows(e,1)}deleteRows(e,t){const n={startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return this._commandService.syncExecuteCommand(a.RemoveRowByRangeCommand.id,{range:n,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}moveRows(e,t){const n=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o=P(e.getRange(),this._worksheet),h=o,d={startRow:t,endRow:t,startColumn:o.startColumn,endColumn:o.endColumn};return this._commandService.syncExecuteCommand(a.MoveRowsCommand.id,{unitId:n,subUnitId:i,range:o,fromRange:h,toRange:d}),this}hideRow(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),i=P(e.getRange(),this._worksheet);return this._commandService.syncExecuteCommand(a.SetRowHiddenCommand.id,{unitId:t,subUnitId:n,ranges:[i]}),this}hideRows(e,t=1){const n=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o={startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1,rangeType:s.RANGE_TYPE.ROW};return this._commandService.syncExecuteCommand(a.SetRowHiddenCommand.id,{unitId:n,subUnitId:i,ranges:[o]}),this}unhideRow(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),i=P(e.getRange(),this._worksheet);return this._commandService.syncExecuteCommand(a.SetSpecificRowsVisibleCommand.id,{unitId:t,subUnitId:n,ranges:[i]}),this}showRows(e,t=1){const n=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o={startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1,rangeType:s.RANGE_TYPE.ROW};return this._commandService.syncExecuteCommand(a.SetSpecificRowsVisibleCommand.id,{unitId:n,subUnitId:i,ranges:[o]}),this}setRowHeight(e,t){return this.setRowHeights(e,1,t)}autoFitRow(e,t=s.BooleanNumber.TRUE){const n=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o=[{startRow:e,endRow:e,startColumn:0,endColumn:this._worksheet.getColumnCount()-1}];return this._commandService.syncExecuteCommand(a.SetTextWrapCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:o[0],value:s.WrapStrategy.WRAP}),this._commandService.syncExecuteCommand(a.SetWorksheetRowIsAutoHeightMutation.id,{unitId:n,subUnitId:i,ranges:o,autoHeightInfo:t}),this}setRowHeights(e,t,n){var m;const i=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),h=this._worksheet.getRowManager(),d=[],l=[];for(let g=e;g<e+t;g++){const C=((m=h.getRow(g))==null?void 0:m.ah)||this._worksheet.getConfig().defaultRowHeight,S={startRow:g,endRow:g,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};n<=C?d.push(S):l.push(S)}return l.length>0&&this._commandService.syncExecuteCommand(a.SetRowHeightCommand.id,{unitId:i,subUnitId:o,ranges:l,value:n}),d.length>0&&this._commandService.syncExecuteCommand(a.SetWorksheetRowIsAutoHeightCommand.id,{unitId:i,subUnitId:o,ranges:d}),this}getRowHeight(e){return this._worksheet.getRowHeight(e)}setRowAutoHeight(e,t){const n=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o=[{startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1}];return this._commandService.syncExecuteCommand(a.SetWorksheetRowIsAutoHeightCommand.id,{unitId:n,subUnitId:i,ranges:o}),this}setRangesAutoHeight(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId();return this._commandService.syncExecuteCommand(a.SetWorksheetRowIsAutoHeightCommand.id,{unitId:t,subUnitId:n,ranges:e}),this}setRowHeightsForced(e,t,n){const i=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),h=[{startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1}];return this._commandService.syncExecuteCommand(a.SetRowHeightCommand.id,{unitId:i,subUnitId:o,ranges:h,value:n}),this}setRowCustom(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),i={};for(const[h,d]of Object.entries(e))i[Number(h)]={custom:d};const o={unitId:t,subUnitId:n,rowData:i};return this._commandService.syncExecuteCommand(a.SetRowDataCommand.id,o),this}insertColumnAfter(e){return this.insertColumnsAfter(e,1)}insertColumnBefore(e){return this.insertColumnsBefore(e,1)}insertColumns(e,t=1){return this.insertColumnsBefore(e,t)}insertColumnsAfter(e,t){const n=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o=s.Direction.RIGHT,h=0,d=this._worksheet.getRowCount()-1,l=e+1,m=e+t,g=a.copyRangeStyles(this._worksheet,h,d,l,m,!1,e);return this._commandService.syncExecuteCommand(a.InsertColByRangeCommand.id,{unitId:n,subUnitId:i,direction:o,range:{startRow:h,endRow:d,startColumn:l,endColumn:m},cellValue:g}),this}insertColumnsBefore(e,t){const n=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o=s.Direction.LEFT,h=0,d=this._worksheet.getRowCount()-1,l=e,m=e+t-1,g=a.copyRangeStyles(this._worksheet,h,d,l,m,!1,e-1);return this._commandService.syncExecuteCommand(a.InsertColByRangeCommand.id,{unitId:n,subUnitId:i,direction:o,range:{startRow:h,endRow:d,startColumn:l,endColumn:m},cellValue:g}),this}deleteColumn(e){return this.deleteColumns(e,1)}deleteColumns(e,t){const n={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:e,endColumn:e+t-1};return this._commandService.syncExecuteCommand(a.RemoveColByRangeCommand.id,{range:n,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}moveColumns(e,t){const n=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o=N(e.getRange(),this._worksheet),h=o,d={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:t,endColumn:t};return this._commandService.syncExecuteCommand(a.MoveColsCommand.id,{unitId:n,subUnitId:i,range:o,fromRange:h,toRange:d}),this}hideColumn(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),i=N(e.getRange(),this._worksheet);return this._commandService.syncExecuteCommand(a.SetColHiddenCommand.id,{unitId:t,subUnitId:n,ranges:[i]}),this}hideColumns(e,t=1){const n=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:e,endColumn:e+t-1,rangeType:s.RANGE_TYPE.COLUMN};return this._commandService.syncExecuteCommand(a.SetColHiddenCommand.id,{unitId:n,subUnitId:i,ranges:[o]}),this}unhideColumn(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),i=N(e.getRange(),this._worksheet);return this._commandService.syncExecuteCommand(a.SetSpecificColsVisibleCommand.id,{unitId:t,subUnitId:n,ranges:[i]}),this}showColumns(e,t=1){const n=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:e,endColumn:e+t-1,rangeType:s.RANGE_TYPE.COLUMN};return this._commandService.syncExecuteCommand(a.SetSpecificColsVisibleCommand.id,{unitId:n,subUnitId:i,ranges:[o]}),this}setColumnWidth(e,t){return this.setColumnWidths(e,1,t)}setColumnWidths(e,t,n){const i=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),h=[{startColumn:e,endColumn:e+t-1,startRow:0,endRow:this._worksheet.getRowCount()-1}];return this._commandService.syncExecuteCommand(a.SetColWidthCommand.id,{unitId:i,subUnitId:o,ranges:h,value:n}),this}getColumnWidth(e){return this._worksheet.getColumnWidth(e)}setColumnCustom(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),i={};for(const[h,d]of Object.entries(e))i[Number(h)]={custom:d};const o={unitId:t,subUnitId:n,columnData:i};return this._commandService.syncExecuteCommand(a.SetColDataCommand.id,o),this}getMergeData(){return this._worksheet.getMergeData().map(e=>this._injector.createInstance(u.FRange,this._workbook,this._worksheet,e))}getMergedRanges(){return this._worksheet.getSnapshot().mergeData.map(t=>this._injector.createInstance(u.FRange,this._workbook,this._worksheet,t))}getCellMergeData(e,t){const i=this._worksheet.getMergedCell(e,t);if(i)return this._injector.createInstance(u.FRange,this._workbook,this._worksheet,i)}getActiveRange(){return this._fWorkbook.getActiveRange()}setActiveRange(e){const{unitId:t,sheetId:n}=e.getRange();if(t!==this._workbook.getUnitId()||n!==this._worksheet.getSheetId())throw new Error("Specified range must be part of the sheet.");return this._fWorkbook.setActiveRange(e),this}getActiveCell(){return this._fWorkbook.getActiveCell()}setFreeze(e){return this._logService.warn("setFreeze is deprecated, use setFrozenRows and setFrozenColumns instead"),this._commandService.syncExecuteCommand(a.SetFrozenCommand.id,{...e,unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()}),this}cancelFreeze(){return this._commandService.syncExecuteCommand(a.CancelFrozenCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()}),this}getFreeze(){return this._worksheet.getFreeze()}setFrozenColumns(...e){const t=this.getFreeze();if(arguments.length===1){const n=e[0];this.setFreeze({...t,startColumn:n>0?n:-1,xSplit:n})}else if(arguments.length===2){let[n=0,i=0]=e;n>i&&([n,i]=[i,n]),this._commandService.syncExecuteCommand(a.SetFrozenCommand.id,{startColumn:i+1,xSplit:i-n+1,startRow:t.startRow,ySplit:t.ySplit,unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()})}return this}setFrozenRows(...e){const t=this.getFreeze();if(arguments.length===1){const n=e[0];this.setFreeze({...t,startRow:n>0?n:-1,ySplit:n})}else if(arguments.length===2){let[n=0,i=0]=e;n>i&&([n,i]=[i,n]),this._commandService.syncExecuteCommand(a.SetFrozenCommand.id,{startRow:i+1,ySplit:i-n+1,startColumn:t.startColumn,xSplit:t.xSplit,unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()})}return this}getFrozenColumns(){const e=this.getFreeze();return e.startColumn===-1?0:e.startColumn}getFrozenRows(){const e=this.getFreeze();return e.startRow===-1?0:e.startRow}getFrozenRowRange(){const e=this._worksheet.getFreeze();return{startRow:e.startRow-e.ySplit,endRow:e.startRow-1}}getFrozenColumnRange(){const e=this._worksheet.getFreeze();return{startColumn:e.startColumn-e.xSplit,endColumn:e.startColumn-1}}hasHiddenGridLines(){return this._worksheet.getConfig().showGridlines===s.BooleanNumber.FALSE}setHiddenGridlines(e){return this._commandService.syncExecuteCommand(a.ToggleGridlinesCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),showGridlines:e?s.BooleanNumber.FALSE:s.BooleanNumber.TRUE}),this}setGridLinesColor(e){return this._commandService.syncExecuteCommand(a.SetGridlinesColorCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),color:e}),this}getGridLinesColor(){return this._worksheet.getGridlinesColor()}setTabColor(e){return this._commandService.syncExecuteCommand(a.SetTabColorCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),value:e}),this}getTabColor(){return this._worksheet.getTabColor()}onCellDataChange(e){return this._injector.get(s.ICommandService).onCommandExecuted(n=>{if(n.id===a.SetRangeValuesMutation.id){const i=n.params;i.unitId===this._workbook.getUnitId()&&i.subUnitId===this._worksheet.getSheetId()&&i.cellValue&&e(new s.ObjectMatrix(i.cellValue))}})}onBeforeCellDataChange(e){return this._injector.get(s.ICommandService).beforeCommandExecuted(n=>{if(n.id===a.SetRangeValuesMutation.id){const i=n.params;i.unitId===this._workbook.getUnitId()&&i.subUnitId===this._worksheet.getSheetId()&&i.cellValue&&e(new s.ObjectMatrix(i.cellValue))}})}hideSheet(){const e=this._injector.get(s.ICommandService);if(this._workbook.getSheets().filter(o=>o.isSheetHidden()!==s.BooleanNumber.TRUE).length<=1)throw new Error("Cannot hide the only visible sheet");return e.syncExecuteCommand(a.SetWorksheetHideCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}showSheet(){return this._injector.get(s.ICommandService).syncExecuteCommand(a.SetWorksheetShowCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}isSheetHidden(){return this._worksheet.isSheetHidden()===s.BooleanNumber.TRUE}setName(e){return this._commandService.syncExecuteCommand(a.SetWorksheetNameCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),name:e}),this}activate(){return this._fWorkbook.setActiveSheet(this),this}getIndex(){return this._workbook.getSheetIndex(this._worksheet)}clear(e){if(e&&e.contentsOnly&&!e.formatOnly)return this.clearContents();if(e&&e.formatOnly&&!e.contentsOnly)return this.clearFormats();const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),i=this._injector.get(s.ICommandService),o={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return i.syncExecuteCommand(a.ClearSelectionAllCommand.id,{unitId:t,subUnitId:n,ranges:[o],options:e}),this}clearContents(){const e=this._workbook.getUnitId(),t=this._worksheet.getSheetId(),n=this._injector.get(s.ICommandService),i={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return n.syncExecuteCommand(a.ClearSelectionContentCommand.id,{unitId:e,subUnitId:t,ranges:[i]}),this}clearFormats(){const e=this._workbook.getUnitId(),t=this._worksheet.getSheetId(),n=this._injector.get(s.ICommandService),i={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return n.syncExecuteCommand(a.ClearSelectionFormatCommand.id,{unitId:e,subUnitId:t,ranges:[i]}),this}getDataRange(){const e=this.getLastRows(),t=this.getLastColumns();return this.getRange(0,0,e+1,t+1)}getLastColumns(){return this._worksheet.getLastColumnWithContent()}getLastColumn(){return this._worksheet.getLastColumnWithContent()}getLastRows(){return this._worksheet.getLastRowWithContent()}getLastRow(){return this._worksheet.getLastRowWithContent()}equalTo(e){return e instanceof u.FWorksheet?this._worksheet.getSheetId()===e.getSheetId()&&this._workbook.getUnitId()===e.getWorkbook().getUnitId():!1}insertDefinedName(e,t){const i=this._injector.createInstance(y).setName(e).setRef(t).build();i.localSheetId=this.getSheetId(),this._fWorkbook.insertDefinedNameBuilder(i)}getDefinedNames(){return this._fWorkbook.getDefinedNames().filter(t=>t.getLocalSheetId()===this.getSheetId())}setCustomMetadata(e){return this._worksheet.setCustomMetadata(e),this}setRowCustomMetadata(e,t){return this._worksheet.getRowManager().setCustomMetadata(e,t),this}setColumnCustomMetadata(e,t){return this._worksheet.getColumnManager().setCustomMetadata(e,t),this}getRowCustomMetadata(e){return this._worksheet.getRowManager().getCustomMetadata(e)}getColumnCustomMetadata(e){return this._worksheet.getColumnManager().getCustomMetadata(e)}appendRow(e){const t=this._worksheet.getCellMatrix().hasValue(),n=this._worksheet.getLastRowWithContent(),i=this._worksheet.getRowCount(),o=this._worksheet.getColumnCount(),h=t?n+1:n,d=new s.ObjectMatrix;for(let l=0;l<e.length;l++)d.setValue(h,l,E(e[l]));return this._commandService.syncExecuteCommand(a.AppendRowCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),cellValue:d.getMatrix(),insertRowNums:h>i-1?1:0,insertColumnNums:e.length>o?e.length-o:0,maxRows:i,maxColumns:o}),this}},u.FWorksheet=J([U(3,s.Inject(s.Injector)),U(4,s.Inject(a.SheetsSelectionsService)),U(5,s.Inject(s.ILogService)),U(6,s.ICommandService)],u.FWorksheet);var Q=Object.getOwnPropertyDescriptor,X=(c,r,e,t)=>{for(var n=t>1?void 0:t?Q(r,e):r,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},w=(c,r)=>(e,t)=>r(e,t,c);u.FWorkbook=class extends _.FBaseInitialable{constructor(e,t,n,i,o,h,d,l,m,g){super(t);b(this,"id");this._workbook=e,this._injector=t,this._resourceLoaderService=n,this._selectionManagerService=i,this._univerInstanceService=o,this._commandService=h,this._permissionService=d,this._logService=l,this._localeService=m,this._definedNamesService=g,this.id=this._workbook.getUnitId()}getWorkbook(){return this._workbook}getId(){return this.id}getName(){return this._workbook.name}setName(e){this._workbook.setName(e)}save(){return this._resourceLoaderService.saveUnit(this._workbook.getUnitId())}getSnapshot(){return this._logService.warn("use 'save' instead of 'getSnapshot'"),this.save()}getActiveSheet(){const e=this._workbook.getActiveSheet();return this._injector.createInstance(u.FWorksheet,this,this._workbook,e)}getSheets(){return this._workbook.getSheets().map(e=>this._injector.createInstance(u.FWorksheet,this,this._workbook,e))}create(e,t,n){const i=s.mergeWorksheetSnapshotWithDefault({});i.rowCount=t,i.columnCount=n,i.name=e,i.id=e.toLowerCase().replace(/ /g,"-"),this._commandService.syncExecuteCommand(a.InsertSheetCommand.id,{unitId:this.id,index:this._workbook.getSheets().length,sheet:i}),this._commandService.syncExecuteCommand(a.SetWorksheetActiveOperation.id,{unitId:this.id,subUnitId:this._workbook.getSheets()[this._workbook.getSheets().length-1].getSheetId()});const o=this._workbook.getActiveSheet();if(!o)throw new Error("No active sheet found");return this._injector.createInstance(u.FWorksheet,this,this._workbook,o)}getSheetBySheetId(e){const t=this._workbook.getSheetBySheetId(e);return t?this._injector.createInstance(u.FWorksheet,this,this._workbook,t):null}getSheetByName(e){const t=this._workbook.getSheetBySheetName(e);return t?this._injector.createInstance(u.FWorksheet,this,this._workbook,t):null}setActiveSheet(e){return this._commandService.syncExecuteCommand(a.SetWorksheetActiveOperation.id,{unitId:this.id,subUnitId:typeof e=="string"?e:e.getSheetId()}),typeof e=="string"?this.getSheetBySheetId(e):e}insertSheet(e){e!=null?this._commandService.syncExecuteCommand(a.InsertSheetCommand.id,{sheet:{name:e}}):this._commandService.syncExecuteCommand(a.InsertSheetCommand.id);const t=this.id,n=this._workbook.getSheets()[this._workbook.getSheets().length-1].getSheetId();this._commandService.syncExecuteCommand(a.SetWorksheetActiveOperation.id,{unitId:t,subUnitId:n});const i=this._workbook.getActiveSheet();if(!i)throw new Error("No active sheet found");return this._injector.createInstance(u.FWorksheet,this,this._workbook,i)}deleteSheet(e){const t=this.id,n=typeof e=="string"?e:e.getSheetId();return this._commandService.syncExecuteCommand(a.RemoveSheetCommand.id,{unitId:t,subUnitId:n})}undo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.syncExecuteCommand(s.UndoCommand.id),this}redo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.syncExecuteCommand(s.RedoCommand.id),this}onBeforeCommandExecute(e){return this._commandService.beforeCommandExecuted(t=>{var n;((n=t.params)==null?void 0:n.unitId)===this.id&&e(t)})}onCommandExecuted(e){return this._commandService.onCommandExecuted(t=>{var n;((n=t.params)==null?void 0:n.unitId)===this.id&&e(t)})}onSelectionChange(e){return s.toDisposable(this._selectionManagerService.selectionMoveEnd$.subscribe(t=>{this._univerInstanceService.getCurrentUnitForType(s.UniverInstanceType.UNIVER_SHEET).getUnitId()===this.id&&(t!=null&&t.length?e(t.map(n=>n.range)):e([]))}))}setEditable(e){const t=new a.WorkbookEditablePermission(this._workbook.getUnitId());return this._permissionService.getPermissionPoint(t.id)||this._permissionService.addPermissionPoint(t),this._permissionService.updatePermissionPoint(t.id,e),this}setActiveRange(e){const t=this.getActiveSheet(),n=e.getRange().sheetId||t.getSheetId(),i=n?this._workbook.getSheetBySheetId(n):this._workbook.getActiveSheet(!0);if(!i)throw new Error("No active sheet found");i.getSheetId()!==t.getSheetId()&&this.setActiveSheet(this._injector.createInstance(u.FWorksheet,this,this._workbook,i));const o={unitId:this.getId(),subUnitId:n,selections:[e].map(h=>({range:h.getRange(),primary:a.getPrimaryForRange(h.getRange(),i),style:null}))};return this._commandService.syncExecuteCommand(a.SetSelectionsOperation.id,o),this}getActiveRange(){const e=this._workbook.getActiveSheet(),n=this._selectionManagerService.getCurrentSelections().find(i=>!!i.primary);return n?this._injector.createInstance(u.FRange,this._workbook,e,n.range):null}getActiveCell(){const e=this._workbook.getActiveSheet(),n=this._selectionManagerService.getCurrentSelections().find(o=>!!o.primary);if(!n)return null;const i={...n.primary,rangeType:s.RANGE_TYPE.NORMAL};return this._injector.createInstance(u.FRange,this._workbook,e,i)}deleteActiveSheet(){const e=this.getActiveSheet();return this.deleteSheet(e)}duplicateSheet(e){return this._commandService.syncExecuteCommand(a.CopySheetCommand.id,{unitId:e.getWorkbook().getUnitId(),subUnitId:e.getSheetId()}),this._injector.createInstance(u.FWorksheet,this,this._workbook,this._workbook.getActiveSheet())}duplicateActiveSheet(){const e=this.getActiveSheet();return this.duplicateSheet(e)}getNumSheets(){return this._workbook.getSheets().length}getLocale(){return this._localeService.getCurrentLocale()}setLocale(e){this._localeService.setLocale(e)}setSpreadsheetLocale(e){return this._localeService.setLocale(e),this}getUrl(){return location.href}moveSheet(e,t){let n=t;return n<0?n=0:n>this._workbook.getSheets().length-1&&(n=this._workbook.getSheets().length-1),this._commandService.syncExecuteCommand(a.SetWorksheetOrderCommand.id,{unitId:e.getWorkbook().getUnitId(),order:n,subUnitId:e.getSheetId()}),this}moveActiveSheet(e){const t=this.getActiveSheet();return this.moveSheet(t,e)}getPermission(){return this._injector.createInstance(u.FPermission)}getDefinedName(e){const t=this._definedNamesService.getValueByName(this.id,e);return t?this._injector.createInstance(p,{...t,unitId:this.id}):null}getDefinedNames(){const e=this._definedNamesService.getDefinedNameMap(this.id);return e?Object.values(e).map(t=>this._injector.createInstance(p,{...t,unitId:this.id})):[]}insertDefinedName(e,t){const i=this._injector.createInstance(y).setName(e).setRef(t).build();return i.localSheetId=a.SCOPE_WORKBOOK_VALUE_DEFINED_NAME,this.insertDefinedNameBuilder(i),this}deleteDefinedName(e){const t=this.getDefinedName(e);return t?(t.delete(),!0):!1}insertDefinedNameBuilder(e){e.unitId=this.getId(),this._commandService.syncExecuteCommand(a.SetDefinedNameCommand.id,e)}updateDefinedNameBuilder(e){this._commandService.syncExecuteCommand(a.SetDefinedNameCommand.id,e)}getRegisteredRangeThemes(){return this._injector.get(a.SheetRangeThemeService).getRegisteredRangeThemes()}registerRangeTheme(e){this._commandService.syncExecuteCommand(a.RegisterWorksheetRangeThemeStyleCommand.id,{unitId:this.getId(),rangeThemeStyle:e})}unregisterRangeTheme(e){this._commandService.syncExecuteCommand(a.UnregisterWorksheetRangeThemeStyleCommand.id,{unitId:this.getId(),themeName:e})}createRangeThemeStyle(e,t){return new a.RangeThemeStyle(e,t)}setCustomMetadata(e){return this._workbook.setCustomMetadata(e),this}getCustomMetadata(){return this._workbook.getCustomMetadata()}},u.FWorkbook=X([w(1,s.Inject(s.Injector)),w(2,s.Inject(s.IResourceLoaderService)),w(3,s.Inject(a.SheetsSelectionsService)),w(4,s.IUniverInstanceService),w(5,s.ICommandService),w(6,s.IPermissionService),w(7,s.ILogService),w(8,s.Inject(s.LocaleService)),w(9,I.IDefinedNamesService)],u.FWorkbook);class Z extends _.FUniver{getCommandSheetTarget(r){var i;const e=r.params;if(!e)return this.getActiveSheet();const t=e.unitId?this.getUniverSheet(e.unitId):(i=this.getActiveWorkbook)==null?void 0:i.call(this);if(!t)return;const n=t.getSheetBySheetId(e.subUnitId||e.sheetId)||t.getActiveSheet();if(n)return{workbook:t,worksheet:n}}getSheetTarget(r,e){const t=this.getUniverSheet(r);if(!t)return;const n=t.getSheetBySheetId(e);if(n)return{workbook:t,worksheet:n}}_initWorkbookEvent(r){const e=r.get(s.IUniverInstanceService);this.registerEventHandler(this.Event.WorkbookDisposed,()=>e.unitDisposed$.subscribe(t=>{t.type===s.UniverInstanceType.UNIVER_SHEET&&this.fireEvent(this.Event.WorkbookDisposed,{unitId:t.getUnitId(),unitType:t.type,snapshot:t.getSnapshot()})})),this.registerEventHandler(this.Event.WorkbookCreated,()=>e.unitAdded$.subscribe(t=>{if(t.type===s.UniverInstanceType.UNIVER_SHEET){const n=t,i=r.createInstance(u.FWorkbook,n);this.fireEvent(this.Event.WorkbookCreated,{unitId:t.getUnitId(),type:t.type,workbook:i,unit:i})}}))}_initialize(r){const e=r.get(s.ICommandService);this.registerEventHandler(this.Event.BeforeSheetCreate,()=>e.beforeCommandExecuted(t=>{var n;if(t.id===a.InsertSheetCommand.id){const i=t.params,{unitId:o,index:h,sheet:d}=i||{},l=o?this.getUniverSheet(o):(n=this.getActiveWorkbook)==null?void 0:n.call(this);if(!l)return;const m={workbook:l,index:h,sheet:d};if(this.fireEvent(this.Event.BeforeSheetCreate,m),m.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeActiveSheetChange,()=>e.beforeCommandExecuted(t=>{var n;if(t.id===a.SetWorksheetActiveOperation.id){const{subUnitId:i,unitId:o}=t.params,h=o?this.getUniverSheet(o):(n=this.getActiveWorkbook)==null?void 0:n.call(this);if(!h||!i)return;const d=h.getSheetBySheetId(i),l=h.getActiveSheet();if(!d||!l)return;const m={workbook:h,activeSheet:d,oldActiveSheet:l};if(this.fireEvent(this.Event.BeforeActiveSheetChange,m),m.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeSheetDelete,()=>e.beforeCommandExecuted(t=>{if(t.id===a.RemoveSheetCommand.id){const n=this.getCommandSheetTarget(t);if(!n)return;const{workbook:i,worksheet:o}=n,h={workbook:i,worksheet:o};if(this.fireEvent(this.Event.BeforeSheetDelete,h),h.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeSheetMove,()=>e.beforeCommandExecuted(t=>{if(t.id===a.SetWorksheetOrderMutation.id){const{fromOrder:n,toOrder:i}=t.params,o=this.getCommandSheetTarget(t);if(!o)return;const h={workbook:o.workbook,worksheet:o.worksheet,newIndex:i,oldIndex:n};if(this.fireEvent(this.Event.BeforeSheetMove,h),h.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeSheetNameChange,()=>e.beforeCommandExecuted(t=>{if(t.id===a.SetWorksheetNameCommand.id){const{name:n}=t.params,i=this.getCommandSheetTarget(t);if(!i)return;const o={workbook:i.workbook,worksheet:i.worksheet,newName:n,oldName:i.worksheet.getSheetName()};if(this.fireEvent(this.Event.BeforeSheetNameChange,o),o.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeSheetTabColorChange,()=>e.beforeCommandExecuted(t=>{if(t.id===a.SetTabColorMutation.id){const{color:n}=t.params,i=this.getCommandSheetTarget(t);if(!i)return;const o={workbook:i.workbook,worksheet:i.worksheet,newColor:n,oldColor:i.worksheet.getTabColor()};if(this.fireEvent(this.Event.BeforeSheetTabColorChange,o),o.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeSheetHideChange,()=>e.beforeCommandExecuted(t=>{if(t.id===a.SetWorksheetHideMutation.id){const{hidden:n}=t.params,i=this.getCommandSheetTarget(t);if(!i)return;const o={workbook:i.workbook,worksheet:i.worksheet,hidden:!!n};if(this.fireEvent(this.Event.BeforeSheetHideChange,o),o.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeGridlineColorChange,()=>e.beforeCommandExecuted(t=>{var n;if(t.id===a.SetGridlinesColorCommand.id){const i=this.getCommandSheetTarget(t);if(!i)return;const o={...i,color:(n=t.params)==null?void 0:n.color};if(this.fireEvent(this.Event.BeforeGridlineColorChange,o),o.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeGridlineEnableChange,()=>e.beforeCommandExecuted(t=>{var n;if(t.id===a.ToggleGridlinesCommand.id){const i=this.getCommandSheetTarget(t);if(!i)return;const o={...i,enabled:!!((n=t.params)!=null&&n.showGridlines)};if(this.fireEvent(this.Event.BeforeGridlineEnableChange,o),o.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.SheetValueChanged,()=>e.onCommandExecuted(t=>{if(a.COMMAND_LISTENER_VALUE_CHANGE.indexOf(t.id)>-1){if(!this.getActiveSheet())return;const i=a.getValueChangedEffectedRange(t).map(o=>{var h,d;return(d=(h=this.getWorkbook(o.unitId))==null?void 0:h.getSheetBySheetId(o.subUnitId))==null?void 0:d.getRange(o.range)}).filter(Boolean);if(!i.length)return;this.fireEvent(this.Event.SheetValueChanged,{payload:t,effectedRanges:i})}})),this.registerEventHandler(this.Event.SheetCreated,()=>e.onCommandExecuted(t=>{var n;if(t.id===a.InsertSheetCommand.id){const i=t.params,{unitId:o}=i||{},h=o?this.getUniverSheet(o):(n=this.getActiveWorkbook)==null?void 0:n.call(this);if(!h)return;const d=h.getActiveSheet();if(!d)return;const l={workbook:h,worksheet:d};this.fireEvent(this.Event.SheetCreated,l)}})),this.registerEventHandler(this.Event.ActiveSheetChanged,()=>e.onCommandExecuted(t=>{if(t.id===a.SetWorksheetActiveOperation.id){const n=this.getActiveSheet();if(!n)return;const{workbook:i,worksheet:o}=n;this._fireActiveSheetChanged(i,o)}})),this.registerEventHandler(this.Event.SheetDeleted,()=>e.onCommandExecuted(t=>{var n;if(t.id===a.RemoveSheetCommand.id){const{subUnitId:i,unitId:o}=t.params,h=o?this.getUniverSheet(o):(n=this.getActiveWorkbook)==null?void 0:n.call(this);if(!h||!i)return;this._fireSheetDeleted(h,i)}})),this.registerEventHandler(this.Event.SheetMoved,()=>e.onCommandExecuted(t=>{if(t.id===a.SetWorksheetOrderMutation.id){const{toOrder:n}=t.params,i=this.getCommandSheetTarget(t);if(!i)return;this._fireSheetMoved(i.workbook,i.worksheet,n)}})),this.registerEventHandler(this.Event.SheetNameChanged,()=>e.onCommandExecuted(t=>{if(t.id===a.SetWorksheetNameCommand.id){const{name:n}=t.params,i=this.getCommandSheetTarget(t);if(!i)return;this._fireSheetNameChanged(i.workbook,i.worksheet,n)}})),this.registerEventHandler(this.Event.SheetTabColorChanged,()=>e.onCommandExecuted(t=>{if(t.id===a.SetTabColorMutation.id){const{color:n}=t.params,i=this.getCommandSheetTarget(t);if(!i)return;this._fireSheetTabColorChanged(i.workbook,i.worksheet,n)}})),this.registerEventHandler(this.Event.SheetHideChanged,()=>e.onCommandExecuted(t=>{if(t.id===a.SetWorksheetHideMutation.id){const{hidden:n}=t.params,i=this.getCommandSheetTarget(t);if(!i)return;this._fireSheetHideChanged(i.workbook,i.worksheet,!!n)}})),this.registerEventHandler(this.Event.GridlineChanged,()=>e.onCommandExecuted(t=>{if(t.id===a.SetGridlinesColorCommand.id||t.id===a.ToggleGridlinesCommand.id){const n=this.getCommandSheetTarget(t);if(!n)return;this.fireEvent(this.Event.GridlineChanged,{...n,enabled:!n.worksheet.hasHiddenGridLines(),color:n.worksheet.getGridLinesColor()})}})),this._initWorkbookEvent(r)}createUniverSheet(r,e){const n=this._injector.get(s.IUniverInstanceService).createUnit(s.UniverInstanceType.UNIVER_SHEET,r,e);return this._injector.createInstance(u.FWorkbook,n)}createWorkbook(r,e){return this.createUniverSheet(r,e)}getActiveWorkbook(){const r=this._univerInstanceService.getCurrentUnitForType(s.UniverInstanceType.UNIVER_SHEET);return r?this._injector.createInstance(u.FWorkbook,r):null}getActiveUniverSheet(){return this.getActiveWorkbook()}getUniverSheet(r){const e=this._univerInstanceService.getUnit(r,s.UniverInstanceType.UNIVER_SHEET);return e?this._injector.createInstance(u.FWorkbook,e):null}getWorkbook(r){return this.getUniverSheet(r)}getPermission(){return this._injector.createInstance(u.FPermission)}onUniverSheetCreated(r){const e=this._univerInstanceService.getTypeOfUnitAdded$(s.UniverInstanceType.UNIVER_SHEET).subscribe(t=>{const n=this._injector.createInstance(u.FWorkbook,t);r(n)});return s.toDisposable(e)}newDefinedName(){return this._injector.createInstance(y)}getActiveSheet(){const r=this.getActiveWorkbook();if(!r)return null;const e=r.getActiveSheet();return e?{workbook:r,worksheet:e}:null}_fireActiveSheetChanged(r,e){this.fireEvent(this.Event.ActiveSheetChanged,{workbook:r,activeSheet:e})}_fireSheetDeleted(r,e){this.fireEvent(this.Event.SheetDeleted,{workbook:r,sheetId:e})}_fireSheetMoved(r,e,t){this.fireEvent(this.Event.SheetMoved,{workbook:r,worksheet:e,newIndex:t})}_fireSheetNameChanged(r,e,t){this.fireEvent(this.Event.SheetNameChanged,{workbook:r,worksheet:e,newName:t})}_fireSheetTabColorChanged(r,e,t){this.fireEvent(this.Event.SheetTabColorChanged,{workbook:r,worksheet:e,newColor:t})}_fireSheetHideChanged(r,e,t){this.fireEvent(this.Event.SheetHideChanged,{workbook:r,worksheet:e,hidden:t})}}_.FUniver.extend(Z);class x{get SheetValueChangeType(){return a.SheetValueChangeType}get SheetSkeletonChangeType(){return a.SheetSkeletonChangeType}get SplitDelimiterType(){return a.SplitDelimiterEnum}}_.FEnum.extend(x);class F{get SheetCreated(){return"SheetCreated"}get BeforeSheetCreate(){return"BeforeSheetCreate"}get WorkbookCreated(){return"WorkbookCreated"}get WorkbookDisposed(){return"WorkbookDisposed"}get GridlineChanged(){return"GridlineChanged"}get BeforeGridlineEnableChange(){return"BeforeGridlineEnableChange"}get BeforeGridlineColorChange(){return"BeforeGridlineColorChange"}get BeforeActiveSheetChange(){return"BeforeActiveSheetChange"}get ActiveSheetChanged(){return"ActiveSheetChanged"}get SheetDeleted(){return"SheetDeleted"}get BeforeSheetDelete(){return"BeforeSheetDelete"}get SheetMoved(){return"SheetMoved"}get BeforeSheetMove(){return"BeforeSheetMove"}get SheetNameChanged(){return"SheetNameChanged"}get BeforeSheetNameChange(){return"BeforeSheetNameChange"}get SheetTabColorChanged(){return"SheetTabColorChanged"}get BeforeSheetTabColorChange(){return"BeforeSheetTabColorChange"}get SheetHideChanged(){return"SheetHideChanged"}get BeforeSheetHideChange(){return"BeforeSheetHideChange"}get SheetValueChanged(){return"SheetValueChanged"}}_.FEventName.extend(F);var ee=Object.getOwnPropertyDescriptor,te=(c,r,e,t)=>{for(var n=t>1?void 0:t?ee(r,e):r,i=c.length-1,o;i>=0;i--)(o=c[i])&&(n=o(n)||n);return n},ne=(c,r)=>(e,t)=>r(e,t,c);u.FSheetHooks=class extends _.FBase{constructor(r){super(),this._injector=r}},u.FSheetHooks=te([ne(0,s.Inject(s.Injector))],u.FSheetHooks),u.FSheetEventName=F,u.FSheetsEnum=x,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
// @univerjs/sheets-numfmt/index
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
// @univerjs/sheets-numfmt/facade
|
|
24
|
-
(function(
|
|
24
|
+
(function(s,o){typeof exports=="object"&&typeof module<"u"?o(require("@univerjs/sheets-numfmt"),require("@univerjs/sheets/facade")):typeof define=="function"&&define.amd?define(["@univerjs/sheets-numfmt","@univerjs/sheets/facade"],o):(s=typeof globalThis<"u"?globalThis:s||self,o(s.UniverSheetsNumfmt,s.UniverSheetsFacade))})(this,function(s,o){"use strict";class u extends o.FRange{setNumberFormat(n){const e=[];return this.forEach((t,r)=>e.push({row:t,col:r,pattern:n})),this._commandService.syncExecuteCommand(s.SetNumfmtCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),values:e}),this}setNumberFormats(n){const e=[];return this.forEach((t,r)=>{var m;const i=(m=n[t])==null?void 0:m[r];e.push({row:t,col:r,pattern:i})}),this._commandService.syncExecuteCommand(s.SetNumfmtCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),values:e}),this}getNumberFormat(){var e,t;const n=this.getCellStyle();return(t=(e=n==null?void 0:n.numberFormat)==null?void 0:e.pattern)!=null?t:""}getNumberFormats(){return this.getCellStyles().map(e=>e.map(t=>{var r,i;return(i=(r=t==null?void 0:t.numberFormat)==null?void 0:r.pattern)!=null?i:""}))}}o.FRange.extend(u);class h extends o.FWorkbook{setNumfmtLocal(n){return this._injector.get(s.SheetsNumfmtCellContentController).setNumfmtLocal(n),this}}o.FWorkbook.extend(h)});
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
// @univerjs/sheets-data-validation/index
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
// @univerjs/sheets-drawing/index
|
|
36
|
-
(function(n,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/drawing")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/drawing"],a):(n=typeof globalThis<"u"?globalThis:n||self,a(n.UniverSheetsDrawing={},n.UniverCore,n.UniverDrawing))})(this,function(n,a,u){"use strict";const w="sheets-drawing.config",_={};var f=(e=>(e.Position="0",e.Both="1",e.None="2",e))(f||{});class l extends u.UnitDrawingService{}const v=a.createIdentifier("sheets-drawing.sheet-drawing.service");var U=(e=>(e[e.INSERT=0]="INSERT",e[e.REMOVE=1]="REMOVE",e[e.UPDATE=2]="UPDATE",e[e.ARRANGE=3]="ARRANGE",e[e.GROUP=4]="GROUP",e[e.UNGROUP=5]="UNGROUP",e))(U||{});const D={id:"sheet.mutation.set-drawing-apply",type:a.CommandType.MUTATION,handler:(e,
|
|
36
|
+
(function(n,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/drawing")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/drawing"],a):(n=typeof globalThis<"u"?globalThis:n||self,a(n.UniverSheetsDrawing={},n.UniverCore,n.UniverDrawing))})(this,function(n,a,u){"use strict";const w="sheets-drawing.config",_={};var f=(e=>(e.Position="0",e.Both="1",e.None="2",e))(f||{});class l extends u.UnitDrawingService{}const v=a.createIdentifier("sheets-drawing.sheet-drawing.service");var U=(e=>(e[e.INSERT=0]="INSERT",e[e.REMOVE=1]="REMOVE",e[e.UPDATE=2]="UPDATE",e[e.ARRANGE=3]="ARRANGE",e[e.GROUP=4]="GROUP",e[e.UNGROUP=5]="UNGROUP",e))(U||{});const D={id:"sheet.mutation.set-drawing-apply",type:a.CommandType.MUTATION,handler:(e,t)=>{const i=e.get(u.IDrawingManagerService),r=e.get(v),{op:s,unitId:o,subUnitId:g,type:M,objects:c}=t;switch(i.applyJson1(o,g,s),r.applyJson1(o,g,s),M){case 0:i.addNotification(c),r.addNotification(c);break;case 1:i.removeNotification(c),r.removeNotification(c);break;case 2:i.updateNotification(c),r.updateNotification(c);break;case 3:i.orderNotification(c),r.orderNotification(c);break;case 4:i.groupUpdateNotification(c);break;case 5:i.ungroupUpdateNotification(c);break}return!0}};var m=Object.getOwnPropertyDescriptor,E=(e,t,i,r)=>{for(var s=r>1?void 0:r?m(t,i):t,o=e.length-1,g;o>=0;o--)(g=e[o])&&(s=g(s)||s);return s},h=(e,t)=>(i,r)=>t(i,r,e);const S="SHEET_DRAWING_PLUGIN";let d=class extends a.Disposable{constructor(e,t,i,r){super(),this._commandService=e,this._sheetDrawingService=t,this._drawingManagerService=i,this._resourceManagerService=r,this._initSnapshot(),this.disposeWithMe(this._commandService.registerCommand(D))}_initSnapshot(){const e=(i,r)=>{const s=r||this._sheetDrawingService.getDrawingDataForUnit(i);return s?JSON.stringify(s):""},t=i=>{if(!i)return{};try{return JSON.parse(i)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:S,businesses:[a.UniverInstanceType.UNIVER_SHEET],toJson:(i,r)=>e(i,r),parseJson:i=>t(i),onUnLoad:i=>{this._sheetDrawingService.removeDrawingDataForUnit(i),this._drawingManagerService.removeDrawingDataForUnit(i)},onLoad:(i,r)=>{this._sheetDrawingService.registerDrawingData(i,r),this._drawingManagerService.registerDrawingData(i,r)}}))}};d=E([h(0,a.ICommandService),h(1,v),h(2,u.IDrawingManagerService),h(3,a.IResourceManagerService)],d);var I=Object.defineProperty,R=Object.getOwnPropertyDescriptor,O=(e,t,i)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,b=(e,t,i,r)=>{for(var s=r>1?void 0:r?R(t,i):t,o=e.length-1,g;o>=0;o--)(g=e[o])&&(s=g(s)||s);return s},N=(e,t)=>(i,r)=>t(i,r,e),P=(e,t,i)=>O(e,typeof t!="symbol"?t+"":t,i);n.UniverSheetsDrawingPlugin=class extends a.Plugin{constructor(t=_,i,r){super(),this._config=t,this._injector=i,this._configService=r;const{...s}=a.merge({},_,this._config);this._configService.setConfig(w,s)}onStarting(){[[d],[v,{useClass:l}]].forEach(t=>this._injector.add(t)),this._injector.get(d)}},P(n.UniverSheetsDrawingPlugin,"pluginName",S),P(n.UniverSheetsDrawingPlugin,"type",a.UniverInstanceType.UNIVER_SHEET),n.UniverSheetsDrawingPlugin=b([a.DependentOn(u.UniverDrawingPlugin),N(1,a.Inject(a.Injector)),N(2,a.IConfigService)],n.UniverSheetsDrawingPlugin),n.DrawingApplyType=U,n.ISheetDrawingService=v,n.SHEET_DRAWING_PLUGIN=S,n.SetDrawingApplyMutation=D,n.SheetDrawingAnchorType=f,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
// @univerjs/sheets-filter/index
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
// @univerjs/sheets-formula/index
|
|
48
|
-
(function(E,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/engine-formula"),require("rxjs"),require("@univerjs/rpc")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/engine-formula","rxjs","@univerjs/rpc"],f):(E=typeof globalThis<"u"?globalThis:E||self,f(E.UniverSheetsFormula={},E.UniverCore,E.UniverSheets,E.UniverEngineFormula,E.rxjs,E.UniverRpc))})(this,function(E,f,m,t,Y,it){"use strict";var Aa=Object.defineProperty;var Sa=(E,f,m)=>f in E?Aa(E,f,{enumerable:!0,configurable:!0,writable:!0,value:m}):E[f]=m;var h=(E,f,m)=>Sa(E,typeof f!="symbol"?f+"":f,m);const Dt={id:"formula.command.insert-function",type:f.CommandType.COMMAND,handler:async(r,e)=>{const{list:a,listOfRangeHasNumber:n}=e,i=r.get(f.ICommandService),o=new f.ObjectMatrix;a.forEach(c=>{const{range:s,primary:l,formula:d}=c,{row:T,column:N}=l,A=f.Tools.generateRandomId(6);o.setValue(T,N,{f:d,si:A});const{startRow:S,startColumn:C,endRow:p,endColumn:P}=s;for(let I=S;I<=p;I++)for(let L=C;L<=P;L++)(I!==T||L!==N)&&o.setValue(I,L,{si:A})}),n&&n.length>0&&n.forEach(c=>{const{primary:s,formula:l}=c;o.setValue(s.row,s.column,{f:l})});const u={value:o.getData()};return i.executeCommand(m.SetRangeValuesCommand.id,u)}},tt={type:f.CommandType.MUTATION,id:"sheet.mutation.data-validation-formula-mark-dirty",handler(){return!0}};function Ht(r,e,a){var n;return r==null||r[e]==null||((n=r[e])==null?void 0:n[a])==null}function Pt(r,e,a){var n;if(a){if(r&&r[e]&&((n=r[e])!=null&&n[a]))return delete r[e][a],{[e]:{[a]:null}}}else if(r&&r[e])return delete r[e],{[e]:null}}var b=(r=>(r[r.MoveRange=0]="MoveRange",r[r.MoveRows=1]="MoveRows",r[r.MoveCols=2]="MoveCols",r[r.InsertRow=3]="InsertRow",r[r.InsertColumn=4]="InsertColumn",r[r.RemoveRow=5]="RemoveRow",r[r.RemoveColumn=6]="RemoveColumn",r[r.DeleteMoveLeft=7]="DeleteMoveLeft",r[r.DeleteMoveUp=8]="DeleteMoveUp",r[r.InsertMoveDown=9]="InsertMoveDown",r[r.InsertMoveRight=10]="InsertMoveRight",r[r.SetName=11]="SetName",r[r.RemoveSheet=12]="RemoveSheet",r[r.SetDefinedName=13]="SetDefinedName",r[r.RemoveDefinedName=14]="RemoveDefinedName",r))(b||{});const Yt=[11,12,13,14];function Xt(r,e,a){const{type:n}=a;return Yt.includes(n)?wt(r,e):Wt(r,e,a)}function wt(r,e){const a=[],n=[];return Object.keys(e).forEach(i=>{const o=e[i],u=r[i];if(o==null||u==null)return!0;Object.keys(o).forEach(c=>{const s=new f.ObjectMatrix(o[c]||{}),l=new f.ObjectMatrix(u[c]||{}),d=new f.ObjectMatrix,T=new f.ObjectMatrix;if(s.forValue((p,P,I)=>{if(I==null)return!0;const L=rt(I);L!==null&&(d.setValue(p,P,L),T.setValue(p,P,l.getValue(p,P)))}),d.getSizeOf()===0)return;const N={subUnitId:c,unitId:i,cellValue:d.getMatrix()},A={id:m.SetRangeValuesMutation.id,params:N};n.push(A);const S={subUnitId:c,unitId:i,cellValue:T.getMatrix()},C={id:m.SetRangeValuesMutation.id,params:S};a.push(C)})}),{undos:a,redos:n}}function Wt(r,e,a){const{redoFormulaData:n,undoFormulaData:i}=Kt(r,e,a);if(f.Tools.diffValue(n,i))return{undos:[],redos:[]};const o=[],u=[];return Object.keys(n).forEach(c=>{Object.keys(n[c]).forEach(s=>{if(Object.keys(n[c][s]).length!==0){const l={subUnitId:s,unitId:c,cellValue:n[c][s]},d={id:m.SetRangeValuesMutation.id,params:l};o.push(d)}})}),Object.keys(i).forEach(c=>{Object.keys(i[c]).forEach(s=>{if(Object.keys(i[c][s]).length!==0){const l={subUnitId:s,unitId:c,cellValue:i[c][s]},d={id:m.SetRangeValuesMutation.id,params:l};u.push(d)}})}),{undos:u,redos:o}}function Kt(r,e,a){const n={},i={},{type:o,unitId:u,sheetId:c,range:s,from:l,to:d}=a;return new Set([...Object.keys(r),...Object.keys(e)]).forEach(N=>{if(Ht(r,N,c))return;new Set([...Object.keys(r[N]||{}),...Object.keys(e[N]||{})]).forEach(S=>{var x,q;const C=(x=r[N])==null?void 0:x[S],p=(q=e[N])==null?void 0:q[S],P=new f.ObjectMatrix(C||{}),I=new f.ObjectMatrix(p||{});let L=[];N!==u||S!==c?L=gt(I):L=kt(P,o,l,d,s);const _=ue(L,P,I),R=ce(L,P);n[N]||(n[N]={}),i[N]||(i[N]={}),n[N][S]={...n[N][S],..._},i[N][S]={...i[N][S],...R}})}),{redoFormulaData:n,undoFormulaData:i}}function kt(r,e,a,n,i){const o=[];return r.forValue((u,c,s)=>{if(s==null||!bt(s))return!0;const l=f.cellToRange(u,c);let d=null,T=!1;if([0,1,2].includes(e))d=Qt(e,a,n,l);else if(i!=null){const N=jt(e,i,l);d=N.newCell,T=N.isReverse}T?o.unshift({oldCell:l,newCell:d}):o.push({oldCell:l,newCell:d})}),o}function gt(r){const e=[];return r.forValue((a,n,i)=>{if(i==null||!bt(i))return!0;const o=f.cellToRange(a,n);e.push({oldCell:o,newCell:o})}),e}function Qt(r,e,a,n){if(e==null||a==null)return null;switch(r){case 0:return $t(e,a,n);case 1:return zt(e,a,n);case 2:return Zt(e,a,n);default:return null}}function jt(r,e,a){let n=null,i=!1;switch(r){case 3:n=Jt(e,a),i=!0;break;case 4:n=te(e,a),i=!0;break;case 5:n=ee(e,a);break;case 6:n=ae(e,a);break;case 7:n=ne(e,a);break;case 8:n=ie(e,a);break;case 9:n=re(e,a),i=!0;break;case 10:n=oe(e,a),i=!0;break}return{newCell:n,isReverse:i}}function $t(r,e,a){const n=m.handleMoveRange({id:m.EffectRefRangId.MoveRangeCommandId,params:{toRange:e,fromRange:r}},a);return m.runRefRangeMutations(n,a)}function zt(r,e,a){const n=m.handleMoveRows({id:m.EffectRefRangId.MoveRowsCommandId,params:{toRange:e,fromRange:r}},a);return m.runRefRangeMutations(n,a)}function Zt(r,e,a){const n=m.handleMoveCols({id:m.EffectRefRangId.MoveColsCommandId,params:{toRange:e,fromRange:r}},a);return m.runRefRangeMutations(n,a)}function Jt(r,e){const a=m.handleInsertRow({id:m.EffectRefRangId.InsertRowCommandId,params:{range:r,unitId:"",subUnitId:"",direction:f.Direction.DOWN}},e);return m.runRefRangeMutations(a,e)}function te(r,e){const a=m.handleInsertCol({id:m.EffectRefRangId.InsertColCommandId,params:{range:r,unitId:"",subUnitId:"",direction:f.Direction.RIGHT}},e);return m.runRefRangeMutations(a,e)}function ee(r,e){const a=m.handleIRemoveRow({id:m.EffectRefRangId.RemoveRowCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ae(r,e){const a=m.handleIRemoveCol({id:m.EffectRefRangId.RemoveColCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ne(r,e){const a=m.handleDeleteRangeMoveLeft({id:m.EffectRefRangId.DeleteRangeMoveLeftCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ie(r,e){const a=m.handleDeleteRangeMoveUp({id:m.EffectRefRangId.DeleteRangeMoveUpCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function re(r,e){const a=m.handleInsertRangeMoveDown({id:m.EffectRefRangId.InsertRangeMoveDownCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function oe(r,e){const a=m.handleInsertRangeMoveRight({id:m.EffectRefRangId.InsertRangeMoveRightCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ue(r,e,a){const n=new f.ObjectMatrix({});return r.forEach(i=>{const{oldCell:o,newCell:u}=i,{startRow:c,startColumn:s}=o,l=a.getValue(c,s)||e.getValue(c,s),d=rt(l);if(n.setValue(c,s,{f:null,si:null}),u){const{startRow:T,startColumn:N}=u;n.setValue(T,N,d)}}),n.getMatrix()}function ce(r,e){const a=new f.ObjectMatrix({});return r.reverse().forEach(n=>{const{oldCell:i,newCell:o}=n,{startRow:u,startColumn:c}=i,s=e.getValue(u,c),l=rt(s);if(o){const{startRow:d,startColumn:T}=o;a.setValue(d,T,{f:null,si:null})}a.setValue(u,c,l)}),a.getMatrix()}function rt(r){if(r==null)return;const{f:e,si:a,x:n=0,y:i=0}=r,o=f.isFormulaString(e),u=f.isFormulaId(a);if(!o&&!u)return{f:null,si:null};const c={};return u&&(c.si=a),o&&n===0&&i===0&&(c.f=e),c.f===void 0&&(c.f=null),c.si===void 0&&(c.si=null),c}function fe(r){const e=new f.ObjectMatrix({});return new f.ObjectMatrix(r).forValue((n,i,o)=>{const u=rt(o);u&&e.setValue(n,i,u)}),e.getMatrix()}function bt(r){const e=(r==null?void 0:r.f)||"",a=(r==null?void 0:r.si)||"",n=f.isFormulaString(e),i=f.isFormulaId(a);return!!(n||i)}function yt(r,e,a,n,i,o){if((i==null||i.length===0)&&(o==null||o.length===0)){if(r===a&&e===n)return!0}else if((r===i||i==null||i.length===0)&&e===o)return!0;return!1}function xt(r,e,a=0,n=0){const i=[];for(let o=0,u=r.length;o<u;o++){const c=r[o];if(typeof c=="string"||c.nodeType!==t.sequenceNodeType.REFERENCE||e.includes(o)){i.push(c);continue}const{token:s}=c,l=t.deserializeRangeWithSheetWithCache(s),{range:d,sheetName:T,unitId:N}=l,A=f.Rectangle.moveOffset(d,a,n);i.push({...c,token:t.serializeRangeToRefString({range:A,unitId:N,sheetName:T})})}return i}function Ut(r,e,a,n){const{type:i,unitId:o,sheetId:u,range:c,from:s,to:l}=e,{range:d,sheetId:T,unitId:N,sheetName:A,refOffsetX:S,refOffsetY:C}=r;if(!yt(o,u,a,n,N,T))return;const p=f.Rectangle.moveOffset(d,S,C);let P=null;if(i===b.MoveRange){if(s==null||l==null)return;const I=It(p,s),L=f.getIntersectRange(p,s);if(L==null||I!==4)return;const _=m.handleMoveRange({id:m.EffectRefRangId.MoveRangeCommandId,params:{toRange:l,fromRange:s}},L),R=m.runRefRangeMutations(_,L);if(R==null)return t.ErrorType.REF;P=Et(I,R,s,l,p,L)}else if(i===b.MoveRows){if(s==null||l==null)return;const I=It(p,s);let L=f.getIntersectRange(p,s);if(L==null&&(s.endRow<p.startRow&&l.endRow<p.startRow||s.startRow>p.endRow&&l.startRow>p.endRow))return;L==null&&(L={startRow:p.startRow,endRow:p.endRow,startColumn:p.startColumn,endColumn:p.endColumn,rangeType:f.RANGE_TYPE.NORMAL});const _=m.handleMoveRows({id:m.EffectRefRangId.MoveRowsCommandId,params:{toRange:l,fromRange:s}},L),R=m.runRefRangeMutations(_,L);if(R==null)return t.ErrorType.REF;P=Et(I,R,s,l,p,L)}else if(i===b.MoveCols){if(s==null||l==null)return;const I=It(p,s);let L=f.getIntersectRange(p,s);if(L==null&&(s.endColumn<p.startColumn&&l.endColumn<p.startColumn||s.startColumn>p.endColumn&&l.startColumn>p.endColumn))return;L==null&&(L={startRow:p.startRow,endRow:p.endRow,startColumn:p.startColumn,endColumn:p.endColumn,rangeType:f.RANGE_TYPE.NORMAL});const _=m.handleMoveCols({id:m.EffectRefRangId.MoveColsCommandId,params:{toRange:l,fromRange:s}},L),R=m.runRefRangeMutations(_,L);if(R==null)return t.ErrorType.REF;P=Et(I,R,s,l,p,L)}if(c!=null){if(i===b.InsertRow){const I=m.handleInsertRow({id:m.EffectRefRangId.InsertRowCommandId,params:{range:c,unitId:"",subUnitId:"",direction:f.Direction.DOWN}},p),L=m.runRefRangeMutations(I,p);if(L==null)return;P={...p,...L}}else if(i===b.InsertColumn){const I=m.handleInsertCol({id:m.EffectRefRangId.InsertColCommandId,params:{range:c,unitId:"",subUnitId:"",direction:f.Direction.RIGHT}},p),L=m.runRefRangeMutations(I,p);if(L==null)return;P={...p,...L}}else if(i===b.RemoveRow){const I=m.handleIRemoveRow({id:m.EffectRefRangId.RemoveRowCommandId,params:{range:c}},p),L=m.runRefRangeMutations(I,p);if(L==null)return t.ErrorType.REF;P={...p,...L}}else if(i===b.RemoveColumn){const I=m.handleIRemoveCol({id:m.EffectRefRangId.RemoveColCommandId,params:{range:c}},p),L=m.runRefRangeMutations(I,p);if(L==null)return t.ErrorType.REF;P={...p,...L}}else if(i===b.DeleteMoveLeft){const I=m.handleDeleteRangeMoveLeft({id:m.EffectRefRangId.DeleteRangeMoveLeftCommandId,params:{range:c}},p),L=m.runRefRangeMutations(I,p);if(L==null)return t.ErrorType.REF;P={...p,...L}}else if(i===b.DeleteMoveUp){const I=m.handleDeleteRangeMoveUp({id:m.EffectRefRangId.DeleteRangeMoveUpCommandId,params:{range:c}},p),L=m.runRefRangeMutations(I,p);if(L==null)return t.ErrorType.REF;P={...p,...L}}else if(i===b.InsertMoveDown){const I=m.handleInsertRangeMoveDown({id:m.EffectRefRangId.InsertRangeMoveDownCommandId,params:{range:c}},p),L=m.runRefRangeMutations(I,p);if(L==null)return;P={...p,...L}}else if(i===b.InsertMoveRight){const I=m.handleInsertRangeMoveRight({id:m.EffectRefRangId.InsertRangeMoveRightCommandId,params:{range:c}},p),L=m.runRefRangeMutations(I,p);if(L==null)return;P={...p,...L}}}if(P!=null)return t.serializeRangeToRefString({range:P,sheetName:A,unitId:N})}function Et(r,e,a,n,i,o){const{startRow:u,endRow:c,startColumn:s,endColumn:l,rangeType:d}=et(e),{startRow:T,startColumn:N,endRow:A,endColumn:S,rangeType:C=f.RANGE_TYPE.NORMAL}=et(a),{startRow:p,startColumn:P,endRow:I,endColumn:L}=et(n),{startRow:_,endRow:R,startColumn:x,endColumn:q}=et(o),{startRow:D,endRow:y,startColumn:M,endColumn:U,rangeType:F=f.RANGE_TYPE.NORMAL}=et(i),O={...i};function v(){return d===f.RANGE_TYPE.COLUMN&&F===f.RANGE_TYPE.COLUMN?!0:s>=M&&l<=U}function $(){return d===f.RANGE_TYPE.ROW&&F===f.RANGE_TYPE.ROW?!0:u>=D&&c<=y}if(r===0)if(v())if(u<D)O.startRow=u;else if(u>=y)O.endRow-=A+1-D;else return;else return;else if(r===1)if(v())if(c>y)O.endRow=c;else if(c<=D)O.startRow+=y-T+1;else return;else return;else if(r===2)if($())if(s<M)O.startColumn=s;else if(s>=U)O.endColumn-=S+1-M;else return;else return;else if(r===3)if($())if(l>U)O.endColumn=l;else if(l<=M)O.startColumn+=U-N+1;else return;else return;else r===4?(O.startRow=u,O.startColumn=s,O.endRow=c,O.endColumn=l):N<=M&&S>=U||C===f.RANGE_TYPE.ROW&&F===f.RANGE_TYPE.ROW?a.endRow<D?(p>=D&&(O.startRow-=A-T+1),p>=y&&(O.endRow-=A-T+1)):a.startRow>y?(I<=y&&(O.endRow+=A-T+1),I<=D&&(O.startRow+=A-T+1)):a.startRow>=D&&a.endRow<=y&&(p<=D?O.startRow+=A-T+1:p>=y&&(O.endRow-=A-T+1)):T<=D&&A>=y||C===f.RANGE_TYPE.COLUMN&&F===f.RANGE_TYPE.COLUMN?a.endColumn<M?(P>=M&&(O.startColumn-=S-N+1),P>=U&&(O.endColumn-=S-N+1)):a.startColumn>U?(L<=U&&(O.endColumn+=S-N+1),L<=M&&(O.startColumn+=S-N+1)):a.startColumn>=M&&a.endColumn<=U&&(P<=M?O.startColumn+=S-N+1:P>=U&&(O.endColumn-=S-N+1)):((P<=q+1&&L>=U||P<=M&&L>=x-1)&&p<=D&&I>=y||(p<=R+1&&I>=y||p<=D&&I>=_-1)&&P<=M&&L>=U,O.startRow=u,O.startColumn=s,O.endRow=c,O.endColumn=l);return O}function It(r,e){const a=Q(r.startRow),n=j(r.endRow),i=Q(r.startColumn),o=j(r.endColumn),u=Q(e.startRow),c=j(e.endRow),s=Q(e.startColumn),l=j(e.endColumn);function d(){return r.rangeType===f.RANGE_TYPE.COLUMN&&e.rangeType===f.RANGE_TYPE.COLUMN?!0:a>=u&&n<=c}function T(){return r.rangeType===f.RANGE_TYPE.ROW&&e.rangeType===f.RANGE_TYPE.ROW?!0:i>=s&&o<=l}function N(){return r.rangeType===f.RANGE_TYPE.ALL&&e.rangeType===f.RANGE_TYPE.ALL}return d()&&T()||N()?4:T()&&a>=u&&a<=c&&n>c?0:T()&&n>=u&&n<=c&&a<u?1:d()&&i>=s&&i<=l&&o>l?2:d()&&o>=s&&o<=l&&i<s?3:null}function Q(r){return isNaN(r)?-1/0:r}function j(r){return isNaN(r)?1/0:r}function et(r){const{startRow:e,endRow:a,startColumn:n,endColumn:i}=r;return{...r,startRow:Q(e),endRow:j(a),startColumn:Q(n),endColumn:j(i)}}function qt(r,e){const{id:a}=e;let n=null;switch(a){case m.MoveRangeCommand.id:n=me(e,r);break;case m.MoveRowsCommand.id:n=se(e,r);break;case m.MoveColsCommand.id:n=le(e,r);break;case m.InsertRowCommand.id:n=pe(e);break;case m.InsertColCommand.id:n=de(e);break;case m.InsertRangeMoveRightCommand.id:n=Le(e,r);break;case m.InsertRangeMoveDownCommand.id:n=Te(e,r);break;case m.RemoveRowCommand.id:n=Ne(e,r);break;case m.RemoveColCommand.id:n=Pe(e,r);break;case m.DeleteRangeMoveUpCommand.id:n=Ee(e,r);break;case m.DeleteRangeMoveLeftCommand.id:n=Ie(e,r);break;case m.SetWorksheetNameCommand.id:n=Ae(e,r);break;case m.RemoveSheetCommand.id:n=Se(e,r);break;case m.SetDefinedNameCommand.id:n=Ce(e,r);break;case m.RemoveDefinedNameCommand.id:n=Re(e,r);break}return n}function V(r){var n;const e=r.getUnitId(),a=((n=r.getActiveSheet())==null?void 0:n.getSheetId())||"";return{unitId:e,sheetId:a}}function me(r,e){const{params:a}=r;if(!a)return null;const{fromRange:n,toRange:i}=a;if(!n||!i)return null;const{unitId:o,sheetId:u}=V(e);return{type:b.MoveRange,from:n,to:i,unitId:o,sheetId:u}}function se(r,e){const{params:a}=r;if(!a)return null;const{fromRange:{startRow:n,endRow:i},toRange:{startRow:o,endRow:u}}=a,c=e.getUnitId(),s=e.getActiveSheet();if(!s)return null;const l=s.getSheetId(),d={startRow:n,startColumn:0,endRow:i,endColumn:s.getColumnCount()-1,rangeType:f.RANGE_TYPE.ROW},T={startRow:o,startColumn:0,endRow:u,endColumn:s.getColumnCount()-1,rangeType:f.RANGE_TYPE.ROW};return{type:b.MoveRows,from:d,to:T,unitId:c,sheetId:l}}function le(r,e){const{params:a}=r;if(!a)return null;const{fromRange:{startColumn:n,endColumn:i},toRange:{startColumn:o,endColumn:u}}=a,c=e.getUnitId(),s=e.getActiveSheet();if(!s)return null;const l=s.getSheetId(),d={startRow:0,startColumn:n,endRow:s.getRowCount()-1,endColumn:i,rangeType:f.RANGE_TYPE.COLUMN},T={startRow:0,startColumn:o,endRow:s.getRowCount()-1,endColumn:u,rangeType:f.RANGE_TYPE.COLUMN};return{type:b.MoveCols,from:d,to:T,unitId:c,sheetId:l}}function pe(r){const{params:e}=r;if(!e)return null;const{range:a,unitId:n,subUnitId:i}=e;return{type:b.InsertRow,range:a,unitId:n,sheetId:i}}function de(r){const{params:e}=r;if(!e)return null;const{range:a,unitId:n,subUnitId:i}=e;return{type:b.InsertColumn,range:a,unitId:n,sheetId:i}}function Le(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.InsertMoveRight,range:n,unitId:i,sheetId:o}}function Te(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.InsertMoveDown,range:n,unitId:i,sheetId:o}}function Ne(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.RemoveRow,range:n,unitId:i,sheetId:o}}function Pe(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.RemoveColumn,range:n,unitId:i,sheetId:o}}function Ee(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.DeleteMoveUp,range:n,unitId:i,sheetId:o}}function Ie(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.DeleteMoveLeft,range:n,unitId:i,sheetId:o}}function Ae(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,subUnitId:i,name:o}=a,{unitId:u,sheetId:c}=V(e);return{type:b.SetName,unitId:n||u,sheetId:i||c,sheetName:o}}function Se(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,subUnitId:i}=a,{unitId:o,sheetId:u}=V(e);return{type:b.RemoveSheet,unitId:n||o,sheetId:i||u}}function Ce(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,name:i,id:o}=a,{sheetId:u}=V(e);return{type:b.SetDefinedName,unitId:n,sheetId:u,definedName:i,definedNameId:o}}function Re(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,name:i,id:o}=a,{sheetId:u}=V(e);return{type:b.RemoveDefinedName,unitId:n,sheetId:u,definedName:i,definedNameId:o}}var Oe=Object.getOwnPropertyDescriptor,Me=(r,e,a,n)=>{for(var i=n>1?void 0:n?Oe(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},ot=(r,e)=>(a,n)=>e(a,n,r);E.UpdateDefinedNameController=class extends f.Disposable{constructor(e,a,n,i){super(),this._definedNamesService=e,this._univerInstanceService=a,this._sheetInterceptorService=n,this._lexerTreeBuilder=i,this._initialize()}_initialize(){this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{if(e.id===m.SetDefinedNameCommand.id||e.id===m.RemoveDefinedNameCommand.id)return{redos:[],undos:[]};const a=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET);if(a==null)return{redos:[],undos:[]};const n=qt(a,e);return n?this._getUpdateDefinedNameMutations(a,n):{redos:[],undos:[]}}}))}_getUpdateDefinedNameMutations(e,a){const{type:n,unitId:i,sheetId:o}=a,u=this._definedNamesService.getDefinedNameMap(i);if(!u)return{redos:[],undos:[]};const c=[],s=[];return Object.values(u).forEach(l=>{var P;const{formulaOrRefString:d}=l,T=this._lexerTreeBuilder.sequenceNodesBuilder(d);if(T==null)return!0;let N=!1;const A=[];for(let I=0,L=T.length;I<L;I++){const _=T[I];if(typeof _=="string"||_.nodeType!==t.sequenceNodeType.REFERENCE)continue;const{token:R}=_,x=t.deserializeRangeWithSheetWithCache(R),{range:q,sheetName:D,unitId:y}=x,M=((P=e.getSheetBySheetName(D))==null?void 0:P.getSheetId())||"",U={range:q,sheetId:M,unitId:y,sheetName:D,refOffsetX:0,refOffsetY:0};let F=null;if(n===b.RemoveSheet)F=this._removeSheet(l,i,o);else if(n===b.SetName){const{sheetId:O,sheetName:v}=a;if(v==null||M==null||M.length===0||O!==M)continue;F=t.serializeRangeToRefString({range:q,sheetName:v,unitId:y})}else F=Ut(U,a,i,o);F!=null&&(T[I]={..._,token:F},N=!0,A.push(I))}if(!N)return!0;const S=t.generateStringWithSequence(xt(T,A)),C={id:t.SetDefinedNameMutation.id,params:{unitId:i,...l,formulaOrRefString:S}};c.push(C);const p={id:t.SetDefinedNameMutation.id,params:{unitId:i,...l}};s.push(p)}),{redos:c,undos:s}}_removeSheet(e,a,n){var u;const{formulaOrRefString:i}=e;return((u=this._definedNamesService.getWorksheetByRef(a,i))==null?void 0:u.getSheetId())===n?t.ErrorType.REF:null}},E.UpdateDefinedNameController=Me([ot(0,t.IDefinedNamesService),ot(1,f.IUniverInstanceService),ot(2,f.Inject(m.SheetInterceptorService)),ot(3,f.Inject(t.LexerTreeBuilder))],E.UpdateDefinedNameController);var at=(r=>(r[r.NOT_REGISTER=1]="NOT_REGISTER",r[r.SUCCESS=2]="SUCCESS",r[r.WAIT=3]="WAIT",r[r.ERROR=4]="ERROR",r))(at||{}),_e=Object.getOwnPropertyDescriptor,De=(r,e,a,n)=>{for(var i=n>1?void 0:n?_e(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},At=(r,e)=>(a,n)=>e(a,n,r);E.RegisterOtherFormulaService=class extends f.Disposable{constructor(a,n,i){super();h(this,"_formulaCacheMap",new Map);h(this,"_formulaChangeWithRange$",new Y.Subject);h(this,"formulaChangeWithRange$",this._formulaChangeWithRange$.asObservable());h(this,"_formulaResult$",new Y.Subject);h(this,"formulaResult$",this._formulaResult$.asObservable());h(this,"calculateStarted$",new Y.BehaviorSubject(!1));this._commandService=a,this._activeDirtyManagerService=n,this._lifecycleService=i,this._initFormulaRegister(),this._initFormulaCalculationResultChange()}dispose(){super.dispose(),this._formulaChangeWithRange$.complete(),this._formulaResult$.complete(),this.calculateStarted$.complete()}_ensureCacheMap(a,n){let i=this._formulaCacheMap.get(a);i||(i=new Map,this._formulaCacheMap.set(a,i));let o=i.get(n);return o||(o=new Map,i.set(n,o)),o}_createFormulaId(a,n){return`formula.${a}_${n}_${f.Tools.generateRandomId(8)}`}_initFormulaRegister(){this._activeDirtyManagerService.register(tt.id,{commandId:tt.id,getDirtyData(n){return{dirtyUnitOtherFormulaMap:n.params}}});const a=n=>{const{unitId:i,subUnitId:o,formulaText:u,formulaId:c,ranges:s}=n;if(!this._ensureCacheMap(i,o).has(c))return;const d={unitId:i,subUnitId:o,formulaMap:{[c]:{f:u,ranges:s}}};this._commandService.executeCommand(t.SetOtherFormulaMutation.id,d).then(()=>{this._commandService.executeCommand(tt.id,{[i]:{[o]:{[c]:!0}}})})};this.disposeWithMe(this._formulaChangeWithRange$.pipe(Y.bufferWhen(()=>this.calculateStarted$.pipe(Y.filter(n=>n)))).subscribe(n=>n.forEach(a))),this.disposeWithMe(this._formulaChangeWithRange$.pipe(Y.filter(()=>this.calculateStarted$.getValue())).subscribe(a))}_initFormulaCalculationResultChange(){this.disposeWithMe(this._commandService.onCommandExecuted(a=>{if(a.id===t.SetFormulaCalculationResultMutation.id){const n=a.params,{unitOtherData:i}=n,o={};for(const u in i){const c=i[u],s={};o[u]=s;for(const l in c){const d=this._ensureCacheMap(u,l),T=c[l],N=[];s[l]=N;for(const A in T){const S=T[A];if(d.has(A)){const C=d.get(A);if(!C)continue;C.result||(C.result={});const p=new f.ObjectMatrix(S),P=new f.ObjectMatrix(C.result);p.forValue((I,L,_)=>{P.setValue(I,L,_)}),C.status=at.SUCCESS,C.callbacks.forEach(I=>{I(S)}),C.callbacks.clear(),N.push(C)}}}}this._formulaResult$.next(o)}}))}registerFormulaWithRange(a,n,i,o=[{startRow:0,endRow:0,startColumn:0,endColumn:0}],u){const c=this._createFormulaId(a,n);return this._ensureCacheMap(a,n).set(c,{result:void 0,status:at.WAIT,formulaId:c,callbacks:new Set,extra:u}),this._formulaChangeWithRange$.next({unitId:a,subUnitId:n,formulaText:i,formulaId:c,ranges:o}),c}deleteFormula(a,n,i){const o={unitId:a,subUnitId:n,formulaIdList:i};this._commandService.executeCommand(t.RemoveOtherFormulaMutation.id,o);const u=this._ensureCacheMap(a,n);i.forEach(c=>u.delete(c))}getFormulaValue(a,n,i){const o=this._ensureCacheMap(a,n),u=o.get(i);return u?u.status===at.SUCCESS||u.status===at.ERROR?Promise.resolve(u):new Promise(c=>{u.callbacks.add(()=>{c(o.get(i))})}):Promise.resolve(null)}getFormulaValueSync(a,n,i){return this._ensureCacheMap(a,n).get(i)}},E.RegisterOtherFormulaService=De([At(0,f.ICommandService),At(1,t.IActiveDirtyManagerService),At(2,f.Inject(f.LifecycleService))],E.RegisterOtherFormulaService);const nt="sheets-formula.base.config";var H=(r=>(r[r.FORCED=0]="FORCED",r[r.WHEN_EMPTY=1]="WHEN_EMPTY",r[r.NO_CALCULATION=2]="NO_CALCULATION",r))(H||{});const ht={},be="sheets-formula.remote.config",Ft={};var ye=Object.getOwnPropertyDescriptor,xe=(r,e,a,n)=>{for(var i=n>1?void 0:n?ye(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},k=(r,e)=>(a,n)=>e(a,n,r);const Bt={done:0,count:0},St={onlyLocal:!0};E.TriggerCalculationController=class extends f.Disposable{constructor(a,n,i,o,u,c,s){var d;super();h(this,"_waitingCommandQueue",[]);h(this,"_executingDirtyData",{forceCalculation:!1,dirtyRanges:[],dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},clearDependencyTreeCache:{}});h(this,"_setTimeoutKey",-1);h(this,"_startExecutionTime",0);h(this,"_totalCalculationTaskCount",0);h(this,"_doneCalculationTaskCount",0);h(this,"_executionInProgressParams",null);h(this,"_restartCalculation",!1);h(this,"_calculationMode",H.WHEN_EMPTY);h(this,"_forceCalculating",!1);h(this,"_progress$",new Y.BehaviorSubject(Bt));h(this,"progress$",this._progress$.asObservable());this._commandService=a,this._activeDirtyManagerService=n,this._logService=i,this._configService=o,this._formulaDataModel=u,this._localeService=c,this._registerOtherFormulaService=s;const l=this._configService.getConfig(nt);this._calculationMode=(d=l==null?void 0:l.initialFormulaComputing)!=null?d:H.WHEN_EMPTY,this._commandExecutedListener(),this._initialExecuteFormulaProcessListener(),this._initialExecuteFormula()}_emitProgress(a){this._progress$.next({done:this._doneCalculationTaskCount,count:this._totalCalculationTaskCount,label:a})}_startProgress(){this._doneCalculationTaskCount=0,this._totalCalculationTaskCount=1;const a=this._localeService.t("formula.progress.analyzing");this._emitProgress(a)}_calculateProgress(a){if(this._executionInProgressParams){const{totalFormulasToCalculate:n,completedFormulasCount:i,totalArrayFormulasToCalculate:o,completedArrayFormulasCount:u}=this._executionInProgressParams;if(this._doneCalculationTaskCount=i+u,this._totalCalculationTaskCount=n+o,this._totalCalculationTaskCount===0)return;this._emitProgress(a)}}_completeProgress(){this._doneCalculationTaskCount=this._totalCalculationTaskCount=1;const a=this._localeService.t("formula.progress.done");this._emitProgress(a)}clearProgress(){this._doneCalculationTaskCount=0,this._totalCalculationTaskCount=0,this._emitProgress()}dispose(){super.dispose(),this._progress$.next(Bt),this._progress$.complete(),clearTimeout(this._setTimeoutKey)}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted((a,n)=>{if(this._activeDirtyManagerService.get(a.id)){if(a.id===m.SetRangeValuesMutation.id){const i=a.params;if(n&&n.onlyLocal===!0||i.trigger===m.SetStyleCommand.id||i.trigger===m.SetBorderCommand.id||i.trigger===m.ClearSelectionFormatCommand.id)return}this._waitingCommandQueue.push(a),clearTimeout(this._setTimeoutKey),this._setTimeoutKey=setTimeout(()=>{const i=this._generateDirty(this._waitingCommandQueue);this._executingDirtyData=this._mergeDirty(this._executingDirtyData,i),this._executionInProgressParams==null?this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,{...this._executingDirtyData},St):(this._restartCalculation=!0,this._commandService.executeCommand(t.SetFormulaCalculationStopMutation.id,{})),this._waitingCommandQueue=[]},100)}}))}_generateDirty(a){const n=[],i={},o={},u={},c={},s={};for(const l of a){const d=this._activeDirtyManagerService.get(l.id);if(d==null)continue;const T=d.getDirtyData(l),{dirtyRanges:N,dirtyNameMap:A,dirtyDefinedNameMap:S,dirtyUnitFeatureMap:C,dirtyUnitOtherFormulaMap:p,clearDependencyTreeCache:P}=T;N!=null&&this._mergeDirtyRanges(n,N),A!=null&&this._mergeDirtyNameMap(i,A),S!=null&&this._mergeDirtyNameMap(o,S),C!=null&&this._mergeDirtyUnitFeatureOrOtherFormulaMap(u,C),p!=null&&this._mergeDirtyUnitFeatureOrOtherFormulaMap(c,p),P!=null&&this._mergeDirtyNameMap(s,P)}return{dirtyRanges:n,dirtyNameMap:i,dirtyDefinedNameMap:o,dirtyUnitFeatureMap:u,dirtyUnitOtherFormulaMap:c,forceCalculation:!1,clearDependencyTreeCache:s,maxIteration:this._configService.getConfig(t.ENGINE_FORMULA_CYCLE_REFERENCE_COUNT)}}_mergeDirty(a,n){const i=[...a.dirtyRanges,...n.dirtyRanges],o={...a.dirtyNameMap},u={...a.dirtyDefinedNameMap},c={...a.dirtyUnitFeatureMap},s={...a.dirtyUnitOtherFormulaMap},l={...a.clearDependencyTreeCache};this._mergeDirtyNameMap(o,n.dirtyNameMap),this._mergeDirtyNameMap(u,n.dirtyDefinedNameMap),this._mergeDirtyUnitFeatureOrOtherFormulaMap(c,n.dirtyUnitFeatureMap),this._mergeDirtyUnitFeatureOrOtherFormulaMap(s,n.dirtyUnitOtherFormulaMap),this._mergeDirtyNameMap(l,n.clearDependencyTreeCache);const d=a.maxIteration||n.maxIteration;return{dirtyRanges:i,dirtyNameMap:o,dirtyDefinedNameMap:u,dirtyUnitFeatureMap:c,dirtyUnitOtherFormulaMap:s,forceCalculation:!!this._forceCalculating,clearDependencyTreeCache:l,maxIteration:d}}_mergeDirtyRanges(a,n){for(const i of n){let o=!1;for(const u of a)if(i.unitId===u.unitId&&i.sheetId===u.sheetId){const{startRow:c,startColumn:s,endRow:l,endColumn:d}=i.range,{startRow:T,startColumn:N,endRow:A,endColumn:S}=u.range;if(c===T&&s===N&&l===A&&d===S){o=!0;break}}o||a.push(i)}}_mergeDirtyNameMap(a,n){Object.keys(n).forEach(i=>{a[i]==null&&(a[i]={}),Object.keys(n[i]).forEach(o=>{var u;(u=n[i])!=null&&u[o]&&(a[i][o]=n[i][o])})})}_mergeDirtyUnitFeatureOrOtherFormulaMap(a,n){Object.keys(n).forEach(i=>{a[i]==null&&(a[i]={}),Object.keys(n[i]).forEach(o=>{a[i][o]==null&&(a[i][o]={}),Object.keys(n[i][o]).forEach(u=>{a[i][o][u]=n[i][o][u]||!1})})})}_initialExecuteFormulaProcessListener(){let a=null,n=0;this.disposeWithMe(this._commandService.onCommandExecuted(i=>{if(i.id===t.SetFormulaCalculationStartMutation.id){const{forceCalculation:u=!1}=i.params;u&&(this._forceCalculating=!0)}else i.id===t.SetFormulaCalculationStopMutation.id&&this.clearProgress();if(i.id!==t.SetFormulaCalculationNotificationMutation.id)return;const o=i.params;if(o.stageInfo!=null){const{stage:u}=o.stageInfo;if(u===t.FormulaExecuteStageType.START){if(this._calculationMode===H.NO_CALCULATION)return;n===0&&(this._startExecutionTime=performance.now()),n++,a!==null&&(clearTimeout(a),a=null),a=setTimeout(()=>{a=null,this._startProgress()},1e3)}else if(u===t.FormulaExecuteStageType.CURRENTLY_CALCULATING){if(this._executionInProgressParams=o.stageInfo,a===null){const c=this._localeService.t("formula.progress.calculating");this._calculateProgress(c)}}else if(u===t.FormulaExecuteStageType.START_DEPENDENCY_ARRAY_FORMULA){if(this._executionInProgressParams=o.stageInfo,a===null){const c=this._localeService.t("formula.progress.array-analysis");this._calculateProgress(c)}}else if(u===t.FormulaExecuteStageType.CURRENTLY_CALCULATING_ARRAY_FORMULA&&(this._executionInProgressParams=o.stageInfo,a===null)){const c=this._localeService.t("formula.progress.array-calculation");this._calculateProgress(c)}}else{const u=o.functionsExecutedState;let c="";switch(n--,u){case t.FormulaExecutedStateType.NOT_EXECUTED:c="No tasks are being executed anymore",this._resetExecutingDirtyData();break;case t.FormulaExecutedStateType.STOP_EXECUTION:c="The execution of the formula has been stopped",n=0;break;case t.FormulaExecutedStateType.SUCCESS:c="Formula calculation succeeded",(n===0||n===-1)&&(c+=`. Total time consumed: ${performance.now()-this._startExecutionTime} ms`),this._resetExecutingDirtyData();break;case t.FormulaExecutedStateType.INITIAL:c="Waiting for calculation",this._resetExecutingDirtyData();break}(n===0||n===-1)&&(a?(clearTimeout(a),a=null,this.clearProgress()):this._completeProgress(),n=0,this._doneCalculationTaskCount=0,this._totalCalculationTaskCount=0,this._forceCalculating=!1),u===t.FormulaExecutedStateType.STOP_EXECUTION&&this._restartCalculation?(this._restartCalculation=!1,this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,{...this._executingDirtyData},St)):this._executionInProgressParams=null,this._logService.debug("[TriggerCalculationController]",c)}}))}_resetExecutingDirtyData(){this._executingDirtyData={dirtyRanges:[],dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},forceCalculation:!1,clearDependencyTreeCache:{}}}_initialExecuteFormula(){const a=this._getDirtyDataByCalculationMode(this._calculationMode);this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,a,St),this._registerOtherFormulaService.calculateStarted$.next(!0)}_getDirtyDataByCalculationMode(a){const n=a===H.FORCED,i=a===H.WHEN_EMPTY?this._formulaDataModel.getFormulaDirtyRanges():[];return{forceCalculation:n,dirtyRanges:i,dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},clearDependencyTreeCache:{},maxIteration:this._configService.getConfig(t.ENGINE_FORMULA_CYCLE_REFERENCE_COUNT)}}},E.TriggerCalculationController=xe([k(0,f.ICommandService),k(1,t.IActiveDirtyManagerService),k(2,f.ILogService),k(3,f.IConfigService),k(4,f.Inject(t.FormulaDataModel)),k(5,f.Inject(f.LocaleService)),k(6,f.Inject(E.RegisterOtherFormulaService))],E.TriggerCalculationController);var Ue=Object.getOwnPropertyDescriptor,qe=(r,e,a,n)=>{for(var i=n>1?void 0:n?Ue(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},X=(r,e)=>(a,n)=>e(a,n,r);E.UpdateFormulaController=class extends f.Disposable{constructor(e,a,n,i,o,u,c,s){super(),this._univerInstanceService=e,this._commandService=a,this._lexerTreeBuilder=n,this._formulaDataModel=i,this._sheetInterceptorService=o,this._definedNamesService=u,this._configService=c,this._injector=s,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>this._getUpdateFormula(e)})),this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.params)if(e.id===m.RemoveSheetMutation.id){const{subUnitId:a,unitId:n}=e.params;this._handleWorkbookDisposed(n,a)}else e.id===m.InsertSheetMutation.id&&this._handleInsertSheetMutation(e.params)})),this.disposeWithMe(this._commandService.beforeCommandExecuted((e,a)=>{if(e.id===m.SetRangeValuesMutation.id){const n=e.params;if(a&&a.onlyLocal===!0||n.trigger===m.SetStyleCommand.id||n.trigger===m.SetBorderCommand.id||n.trigger===m.ClearSelectionFormatCommand.id)return;this._handleSetRangeValuesMutation(n)}})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(f.UniverInstanceType.UNIVER_SHEET).subscribe(e=>this._handleWorkbookAdded(e))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(f.UniverInstanceType.UNIVER_SHEET).pipe(Y.map(e=>e.getUnitId())).subscribe(e=>this._handleWorkbookDisposed(e)))}_handleSetRangeValuesMutation(e){const{subUnitId:a,unitId:n,cellValue:i}=e;if(i==null)return;const o=this._formulaDataModel.updateFormulaData(n,a,i),u={[n]:{[a]:o}};this._commandService.executeCommand(m.SetRangeValuesMutation.id,{unitId:n,subUnitId:a,cellValue:fe(o)},{onlyLocal:!0,fromFormula:!0}),this._formulaDataModel.updateArrayFormulaCellData(n,a,i),this._formulaDataModel.updateArrayFormulaRange(n,a,i),this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:u},{onlyLocal:!0}),this._commandService.executeCommand(t.SetArrayFormulaDataMutation.id,{arrayFormulaRange:this._formulaDataModel.getArrayFormulaRange(),arrayFormulaCellData:this._formulaDataModel.getArrayFormulaCellData()},{onlyLocal:!0,remove:!0})}_handleWorkbookDisposed(e,a){const n=this._formulaDataModel.getFormulaData(),i=Pt(n,e,a),o=this._formulaDataModel.getArrayFormulaRange(),u=Pt(o,e,a),c=this._formulaDataModel.getArrayFormulaCellData(),s=Pt(c,e,a);i&&this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:i},{onlyLocal:!0}),u&&s&&this._commandService.executeCommand(t.SetArrayFormulaDataMutation.id,{arrayFormulaRange:o,arrayFormulaCellData:c},{onlyLocal:!0})}_handleInsertSheetMutation(e){const{sheet:a,unitId:n}=e,i=this._formulaDataModel.getFormulaData(),{id:o,cellData:u}=a,c=new f.ObjectMatrix(u),s=t.initSheetFormulaData(i,n,o,c);this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:s},{onlyLocal:!0})}_handleWorkbookAdded(e){var l;const a={},n=e.getUnitId(),i={[n]:{}};e.getSheets().forEach(d=>{var S;const T=d.getCellMatrix(),N=d.getSheetId(),A=t.initSheetFormulaData(a,n,N,T);i[n][N]=(S=A[n])==null?void 0:S[N]}),this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:i},{onlyLocal:!0});const u=this._configService.getConfig(nt),c=(l=u==null?void 0:u.initialFormulaComputing)!=null?l:H.WHEN_EMPTY,s=this._getDiryDataByCalculationMode(c);this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,s,{onlyLocal:!0})}_getDiryDataByCalculationMode(e){const a=e===H.FORCED,n=e===H.WHEN_EMPTY?this._formulaDataModel.getFormulaDirtyRanges():[];return{forceCalculation:a,dirtyRanges:n,dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},clearDependencyTreeCache:{}}}_getUpdateFormula(e){const a=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET);if(!a)return{undos:[],redos:[]};const n=qt(a,e);if(n){const{unitSheetNameMap:i}=this._formulaDataModel.getCalculateData(),o=this._formulaDataModel.getFormulaData(),{newFormulaData:u}=this._getFormulaReferenceMoveInfo(o,i,n),{undos:c,redos:s}=Xt(o,u,n);return{undos:c,redos:s}}return{undos:[],redos:[]}}_getFormulaReferenceMoveInfo(e,a,n){if(!f.Tools.isDefine(e))return{newFormulaData:{},oldFormulaData:{}};const i=Object.keys(e);if(i.length===0)return{newFormulaData:{},oldFormulaData:{}};const o={},u={};for(const c of i){const s=e[c];if(s==null)continue;const l=Object.keys(s);f.Tools.isDefine(o[c])||(o[c]={}),f.Tools.isDefine(u[c])||(u[c]={});for(const d of l){const T=new f.ObjectMatrix(s[d]||{}),N=new f.ObjectMatrix;T.forValue((A,S,C)=>{var D;if(!C)return!0;const{f:p,x:P,y:I,si:L}=C,_=this._lexerTreeBuilder.sequenceNodesBuilder(p);if(_==null)return!0;let R=!1;const x=[];for(let y=0,M=_.length;y<M;y++){const U=_[y];if(typeof U=="string")continue;const{token:F,nodeType:O}=U,{type:v}=n;if((v===b.SetDefinedName||v===b.RemoveDefinedName)&&(O===t.sequenceNodeType.DEFINED_NAME||O===t.sequenceNodeType.FUNCTION)){const{definedNameId:Z,definedName:J}=n;if(Z===void 0||J===void 0)continue;const g=this._definedNamesService.getValueById(c,Z);if(g==null||g.name!==F)continue;_[y]={...U,token:v===b.SetDefinedName?J:t.ErrorType.REF},R=!0,x.push(y);continue}else if(O!==t.sequenceNodeType.REFERENCE)continue;const $=t.deserializeRangeWithSheetWithCache(F),{range:z,sheetName:w,unitId:B}=$,W=B==null||B.length===0?c:B,G=((D=a==null?void 0:a[W])==null?void 0:D[w])||"";if(!yt(n.unitId,n.sheetId,c,d,B,G))continue;const Nt={range:z,sheetId:G,unitId:B,sheetName:w,refOffsetX:P||0,refOffsetY:I||0};let K=null;if(v===b.SetName){const{unitId:Z,sheetId:J,sheetName:g}=n;if(g==null||G==null||G.length===0||J!==G)continue;K=t.serializeRangeToRefString({range:z,sheetName:g,unitId:B})}else if(v===b.RemoveSheet){const{unitId:Z,sheetId:J,sheetName:g}=n;if(G==null||G.length===0||J!==G)continue;K=t.ErrorType.REF}else v!==b.SetDefinedName&&(K=Ut(Nt,n,c,d));K!=null&&(_[y]={...U,token:K},R=!0,x.push(y))}if(!R)return!0;const q=xt(_,x,P,I);N.setValue(A,S,{f:`=${t.generateStringWithSequence(q)}`})}),u[c]&&(u[c][d]=N.getData())}}return{newFormulaData:u}}},E.UpdateFormulaController=qe([X(0,f.IUniverInstanceService),X(1,f.ICommandService),X(2,f.Inject(t.LexerTreeBuilder)),X(3,f.Inject(t.FormulaDataModel)),X(4,f.Inject(m.SheetInterceptorService)),X(5,t.IDefinedNamesService),X(6,f.IConfigService),X(7,f.Inject(f.Injector))],E.UpdateFormulaController);const he=[{functionName:t.FUNCTION_NAMES_ARRAY.ARRAY_CONSTRAIN,functionType:t.FunctionType.Array,description:"formula.functionList.ARRAY_CONSTRAIN.description",abstract:"formula.functionList.ARRAY_CONSTRAIN.abstract",functionParameter:[{name:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.inputRange.name",detail:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.inputRange.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numRows.name",detail:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numRows.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numCols.name",detail:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numCols.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ARRAY.FLATTEN,functionType:t.FunctionType.Array,description:"formula.functionList.FLATTEN.description",abstract:"formula.functionList.FLATTEN.abstract",functionParameter:[{name:"formula.functionList.FLATTEN.functionParameter.range1.name",detail:"formula.functionList.FLATTEN.functionParameter.range1.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.FLATTEN.functionParameter.range2.name",detail:"formula.functionList.FLATTEN.functionParameter.range2.detail",example:"D1:F3",require:0,repeat:1}]}],Fe=[{functionName:t.FUNCTION_NAMES_COMPATIBILITY.BETADIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.BETADIST.description",abstract:"formula.functionList.BETADIST.abstract",functionParameter:[{name:"formula.functionList.BETADIST.functionParameter.x.name",detail:"formula.functionList.BETADIST.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.alpha.name",detail:"formula.functionList.BETADIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.beta.name",detail:"formula.functionList.BETADIST.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.A.name",detail:"formula.functionList.BETADIST.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.B.name",detail:"formula.functionList.BETADIST.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.BETAINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.BETAINV.description",abstract:"formula.functionList.BETAINV.abstract",functionParameter:[{name:"formula.functionList.BETAINV.functionParameter.probability.name",detail:"formula.functionList.BETAINV.functionParameter.probability.detail",example:"0.685470581",require:1,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.alpha.name",detail:"formula.functionList.BETAINV.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.beta.name",detail:"formula.functionList.BETAINV.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.A.name",detail:"formula.functionList.BETAINV.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.B.name",detail:"formula.functionList.BETAINV.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.BINOMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.BINOMDIST.description",abstract:"formula.functionList.BINOMDIST.abstract",functionParameter:[{name:"formula.functionList.BINOMDIST.functionParameter.numberS.name",detail:"formula.functionList.BINOMDIST.functionParameter.numberS.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.BINOMDIST.functionParameter.trials.name",detail:"formula.functionList.BINOMDIST.functionParameter.trials.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BINOMDIST.functionParameter.probabilityS.name",detail:"formula.functionList.BINOMDIST.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.BINOMDIST.functionParameter.cumulative.name",detail:"formula.functionList.BINOMDIST.functionParameter.cumulative.detail",example:"false",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CHIDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CHIDIST.description",abstract:"formula.functionList.CHIDIST.abstract",functionParameter:[{name:"formula.functionList.CHIDIST.functionParameter.x.name",detail:"formula.functionList.CHIDIST.functionParameter.x.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CHIDIST.functionParameter.degFreedom.name",detail:"formula.functionList.CHIDIST.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CHIINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CHIINV.description",abstract:"formula.functionList.CHIINV.abstract",functionParameter:[{name:"formula.functionList.CHIINV.functionParameter.probability.name",detail:"formula.functionList.CHIINV.functionParameter.probability.detail",example:"0.93",require:1,repeat:0},{name:"formula.functionList.CHIINV.functionParameter.degFreedom.name",detail:"formula.functionList.CHIINV.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CHITEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CHITEST.description",abstract:"formula.functionList.CHITEST.abstract",functionParameter:[{name:"formula.functionList.CHITEST.functionParameter.actualRange.name",detail:"formula.functionList.CHITEST.functionParameter.actualRange.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.CHITEST.functionParameter.expectedRange.name",detail:"formula.functionList.CHITEST.functionParameter.expectedRange.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CONFIDENCE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CONFIDENCE.description",abstract:"formula.functionList.CONFIDENCE.abstract",functionParameter:[{name:"formula.functionList.CONFIDENCE.functionParameter.alpha.name",detail:"formula.functionList.CONFIDENCE.functionParameter.alpha.detail",example:"0.05",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE.functionParameter.standardDev.name",detail:"formula.functionList.CONFIDENCE.functionParameter.standardDev.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE.functionParameter.size.name",detail:"formula.functionList.CONFIDENCE.functionParameter.size.detail",example:"50",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.COVAR,functionType:t.FunctionType.Compatibility,description:"formula.functionList.COVAR.description",abstract:"formula.functionList.COVAR.abstract",functionParameter:[{name:"formula.functionList.COVAR.functionParameter.array1.name",detail:"formula.functionList.COVAR.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.COVAR.functionParameter.array2.name",detail:"formula.functionList.COVAR.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CRITBINOM,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CRITBINOM.description",abstract:"formula.functionList.CRITBINOM.abstract",functionParameter:[{name:"formula.functionList.CRITBINOM.functionParameter.trials.name",detail:"formula.functionList.CRITBINOM.functionParameter.trials.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.CRITBINOM.functionParameter.probabilityS.name",detail:"formula.functionList.CRITBINOM.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CRITBINOM.functionParameter.alpha.name",detail:"formula.functionList.CRITBINOM.functionParameter.alpha.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.EXPONDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.EXPONDIST.description",abstract:"formula.functionList.EXPONDIST.abstract",functionParameter:[{name:"formula.functionList.EXPONDIST.functionParameter.x.name",detail:"formula.functionList.EXPONDIST.functionParameter.x.detail",example:"0.2",require:1,repeat:0},{name:"formula.functionList.EXPONDIST.functionParameter.lambda.name",detail:"formula.functionList.EXPONDIST.functionParameter.lambda.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.EXPONDIST.functionParameter.cumulative.name",detail:"formula.functionList.EXPONDIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.FDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.FDIST.description",abstract:"formula.functionList.FDIST.abstract",functionParameter:[{name:"formula.functionList.FDIST.functionParameter.x.name",detail:"formula.functionList.FDIST.functionParameter.x.detail",example:"15.2069",require:1,repeat:0},{name:"formula.functionList.FDIST.functionParameter.degFreedom1.name",detail:"formula.functionList.FDIST.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.FDIST.functionParameter.degFreedom2.name",detail:"formula.functionList.FDIST.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.FINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.FINV.description",abstract:"formula.functionList.FINV.abstract",functionParameter:[{name:"formula.functionList.FINV.functionParameter.probability.name",detail:"formula.functionList.FINV.functionParameter.probability.detail",example:"0.01",require:1,repeat:0},{name:"formula.functionList.FINV.functionParameter.degFreedom1.name",detail:"formula.functionList.FINV.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.FINV.functionParameter.degFreedom2.name",detail:"formula.functionList.FINV.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.FTEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.FTEST.description",abstract:"formula.functionList.FTEST.abstract",functionParameter:[{name:"formula.functionList.FTEST.functionParameter.array1.name",detail:"formula.functionList.FTEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.FTEST.functionParameter.array2.name",detail:"formula.functionList.FTEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.GAMMADIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.GAMMADIST.description",abstract:"formula.functionList.GAMMADIST.abstract",functionParameter:[{name:"formula.functionList.GAMMADIST.functionParameter.x.name",detail:"formula.functionList.GAMMADIST.functionParameter.x.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.GAMMADIST.functionParameter.alpha.name",detail:"formula.functionList.GAMMADIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.GAMMADIST.functionParameter.beta.name",detail:"formula.functionList.GAMMADIST.functionParameter.beta.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.GAMMADIST.functionParameter.cumulative.name",detail:"formula.functionList.GAMMADIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.GAMMAINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.GAMMAINV.description",abstract:"formula.functionList.GAMMAINV.abstract",functionParameter:[{name:"formula.functionList.GAMMAINV.functionParameter.probability.name",detail:"formula.functionList.GAMMAINV.functionParameter.probability.detail",example:"0.068094",require:1,repeat:0},{name:"formula.functionList.GAMMAINV.functionParameter.alpha.name",detail:"formula.functionList.GAMMAINV.functionParameter.alpha.detail",example:"9",require:1,repeat:0},{name:"formula.functionList.GAMMAINV.functionParameter.beta.name",detail:"formula.functionList.GAMMAINV.functionParameter.beta.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.HYPGEOMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.HYPGEOMDIST.description",abstract:"formula.functionList.HYPGEOMDIST.abstract",functionParameter:[{name:"formula.functionList.HYPGEOMDIST.functionParameter.sampleS.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.sampleS.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HYPGEOMDIST.functionParameter.numberSample.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.numberSample.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.HYPGEOMDIST.functionParameter.populationS.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.populationS.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.HYPGEOMDIST.functionParameter.numberPop.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.numberPop.detail",example:"20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.LOGINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.LOGINV.description",abstract:"formula.functionList.LOGINV.abstract",functionParameter:[{name:"formula.functionList.LOGINV.functionParameter.probability.name",detail:"formula.functionList.LOGINV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.LOGINV.functionParameter.mean.name",detail:"formula.functionList.LOGINV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGINV.functionParameter.standardDev.name",detail:"formula.functionList.LOGINV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.LOGNORMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.LOGNORMDIST.description",abstract:"formula.functionList.LOGNORMDIST.abstract",functionParameter:[{name:"formula.functionList.LOGNORMDIST.functionParameter.x.name",detail:"formula.functionList.LOGNORMDIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.LOGNORMDIST.functionParameter.mean.name",detail:"formula.functionList.LOGNORMDIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGNORMDIST.functionParameter.standardDev.name",detail:"formula.functionList.LOGNORMDIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.MODE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.MODE.description",abstract:"formula.functionList.MODE.abstract",functionParameter:[{name:"formula.functionList.MODE.functionParameter.number1.name",detail:"formula.functionList.MODE.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MODE.functionParameter.number2.name",detail:"formula.functionList.MODE.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NEGBINOMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NEGBINOMDIST.description",abstract:"formula.functionList.NEGBINOMDIST.abstract",functionParameter:[{name:"formula.functionList.NEGBINOMDIST.functionParameter.numberF.name",detail:"formula.functionList.NEGBINOMDIST.functionParameter.numberF.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.NEGBINOMDIST.functionParameter.numberS.name",detail:"formula.functionList.NEGBINOMDIST.functionParameter.numberS.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.NEGBINOMDIST.functionParameter.probabilityS.name",detail:"formula.functionList.NEGBINOMDIST.functionParameter.probabilityS.detail",example:"0.25",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMDIST.description",abstract:"formula.functionList.NORMDIST.abstract",functionParameter:[{name:"formula.functionList.NORMDIST.functionParameter.x.name",detail:"formula.functionList.NORMDIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.NORMDIST.functionParameter.mean.name",detail:"formula.functionList.NORMDIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORMDIST.functionParameter.standardDev.name",detail:"formula.functionList.NORMDIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.NORMDIST.functionParameter.cumulative.name",detail:"formula.functionList.NORMDIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMINV.description",abstract:"formula.functionList.NORMINV.abstract",functionParameter:[{name:"formula.functionList.NORMINV.functionParameter.probability.name",detail:"formula.functionList.NORMINV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.NORMINV.functionParameter.mean.name",detail:"formula.functionList.NORMINV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORMINV.functionParameter.standardDev.name",detail:"formula.functionList.NORMINV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMSDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMSDIST.description",abstract:"formula.functionList.NORMSDIST.abstract",functionParameter:[{name:"formula.functionList.NORMSDIST.functionParameter.z.name",detail:"formula.functionList.NORMSDIST.functionParameter.z.detail",example:"1.333333",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMSINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMSINV.description",abstract:"formula.functionList.NORMSINV.abstract",functionParameter:[{name:"formula.functionList.NORMSINV.functionParameter.probability.name",detail:"formula.functionList.NORMSINV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.PERCENTILE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.PERCENTILE.description",abstract:"formula.functionList.PERCENTILE.abstract",functionParameter:[{name:"formula.functionList.PERCENTILE.functionParameter.array.name",detail:"formula.functionList.PERCENTILE.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTILE.functionParameter.k.name",detail:"formula.functionList.PERCENTILE.functionParameter.k.detail",example:"0.3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.PERCENTRANK,functionType:t.FunctionType.Compatibility,description:"formula.functionList.PERCENTRANK.description",abstract:"formula.functionList.PERCENTRANK.abstract",functionParameter:[{name:"formula.functionList.PERCENTRANK.functionParameter.array.name",detail:"formula.functionList.PERCENTRANK.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK.functionParameter.x.name",detail:"formula.functionList.PERCENTRANK.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK.functionParameter.significance.name",detail:"formula.functionList.PERCENTRANK.functionParameter.significance.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.POISSON,functionType:t.FunctionType.Compatibility,description:"formula.functionList.POISSON.description",abstract:"formula.functionList.POISSON.abstract",functionParameter:[{name:"formula.functionList.POISSON.functionParameter.x.name",detail:"formula.functionList.POISSON.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.POISSON.functionParameter.mean.name",detail:"formula.functionList.POISSON.functionParameter.mean.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.POISSON.functionParameter.cumulative.name",detail:"formula.functionList.POISSON.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.QUARTILE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.QUARTILE.description",abstract:"formula.functionList.QUARTILE.abstract",functionParameter:[{name:"formula.functionList.QUARTILE.functionParameter.array.name",detail:"formula.functionList.QUARTILE.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.QUARTILE.functionParameter.quart.name",detail:"formula.functionList.QUARTILE.functionParameter.quart.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.RANK,functionType:t.FunctionType.Compatibility,description:"formula.functionList.RANK.description",abstract:"formula.functionList.RANK.abstract",functionParameter:[{name:"formula.functionList.RANK.functionParameter.number.name",detail:"formula.functionList.RANK.functionParameter.number.detail",example:"A3",require:1,repeat:0},{name:"formula.functionList.RANK.functionParameter.ref.name",detail:"formula.functionList.RANK.functionParameter.ref.detail",example:"A2:A6",require:1,repeat:0},{name:"formula.functionList.RANK.functionParameter.order.name",detail:"formula.functionList.RANK.functionParameter.order.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.STDEV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.STDEV.description",abstract:"formula.functionList.STDEV.abstract",functionParameter:[{name:"formula.functionList.STDEV.functionParameter.number1.name",detail:"formula.functionList.STDEV.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEV.functionParameter.number2.name",detail:"formula.functionList.STDEV.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.STDEVP,functionType:t.FunctionType.Compatibility,description:"formula.functionList.STDEVP.description",abstract:"formula.functionList.STDEVP.abstract",functionParameter:[{name:"formula.functionList.STDEVP.functionParameter.number1.name",detail:"formula.functionList.STDEVP.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEVP.functionParameter.number2.name",detail:"formula.functionList.STDEVP.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.TDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.TDIST.description",abstract:"formula.functionList.TDIST.abstract",functionParameter:[{name:"formula.functionList.TDIST.functionParameter.x.name",detail:"formula.functionList.TDIST.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.TDIST.functionParameter.degFreedom.name",detail:"formula.functionList.TDIST.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.TDIST.functionParameter.tails.name",detail:"formula.functionList.TDIST.functionParameter.tails.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.TINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.TINV.description",abstract:"formula.functionList.TINV.abstract",functionParameter:[{name:"formula.functionList.TINV.functionParameter.probability.name",detail:"formula.functionList.TINV.functionParameter.probability.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.TINV.functionParameter.degFreedom.name",detail:"formula.functionList.TINV.functionParameter.degFreedom.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.TTEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.TTEST.description",abstract:"formula.functionList.TTEST.abstract",functionParameter:[{name:"formula.functionList.TTEST.functionParameter.array1.name",detail:"formula.functionList.TTEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.TTEST.functionParameter.array2.name",detail:"formula.functionList.TTEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.TTEST.functionParameter.tails.name",detail:"formula.functionList.TTEST.functionParameter.tails.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.TTEST.functionParameter.type.name",detail:"formula.functionList.TTEST.functionParameter.type.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.VAR,functionType:t.FunctionType.Compatibility,description:"formula.functionList.VAR.description",abstract:"formula.functionList.VAR.abstract",functionParameter:[{name:"formula.functionList.VAR.functionParameter.number1.name",detail:"formula.functionList.VAR.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VAR.functionParameter.number2.name",detail:"formula.functionList.VAR.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.VARP,functionType:t.FunctionType.Compatibility,description:"formula.functionList.VARP.description",abstract:"formula.functionList.VARP.abstract",functionParameter:[{name:"formula.functionList.VARP.functionParameter.number1.name",detail:"formula.functionList.VARP.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VARP.functionParameter.number2.name",detail:"formula.functionList.VARP.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.WEIBULL,functionType:t.FunctionType.Compatibility,description:"formula.functionList.WEIBULL.description",abstract:"formula.functionList.WEIBULL.abstract",functionParameter:[{name:"formula.functionList.WEIBULL.functionParameter.x.name",detail:"formula.functionList.WEIBULL.functionParameter.x.detail",example:"105",require:1,repeat:0},{name:"formula.functionList.WEIBULL.functionParameter.alpha.name",detail:"formula.functionList.WEIBULL.functionParameter.alpha.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.WEIBULL.functionParameter.beta.name",detail:"formula.functionList.WEIBULL.functionParameter.beta.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.WEIBULL.functionParameter.cumulative.name",detail:"formula.functionList.WEIBULL.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.ZTEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.ZTEST.description",abstract:"formula.functionList.ZTEST.abstract",functionParameter:[{name:"formula.functionList.ZTEST.functionParameter.array.name",detail:"formula.functionList.ZTEST.functionParameter.array.detail",example:"A2:A11",require:1,repeat:0},{name:"formula.functionList.ZTEST.functionParameter.x.name",detail:"formula.functionList.ZTEST.functionParameter.x.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.ZTEST.functionParameter.sigma.name",detail:"formula.functionList.ZTEST.functionParameter.sigma.detail",example:"10",require:0,repeat:0}]}],Be=[{functionName:t.FUNCTION_NAMES_CUBE.CUBEKPIMEMBER,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEKPIMEMBER.description",abstract:"formula.functionList.CUBEKPIMEMBER.abstract",functionParameter:[{name:"formula.functionList.CUBEKPIMEMBER.functionParameter.number1.name",detail:"formula.functionList.CUBEKPIMEMBER.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEKPIMEMBER.functionParameter.number2.name",detail:"formula.functionList.CUBEKPIMEMBER.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBEMEMBER,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEMEMBER.description",abstract:"formula.functionList.CUBEMEMBER.abstract",functionParameter:[{name:"formula.functionList.CUBEMEMBER.functionParameter.number1.name",detail:"formula.functionList.CUBEMEMBER.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEMEMBER.functionParameter.number2.name",detail:"formula.functionList.CUBEMEMBER.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBEMEMBERPROPERTY,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEMEMBERPROPERTY.description",abstract:"formula.functionList.CUBEMEMBERPROPERTY.abstract",functionParameter:[{name:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number1.name",detail:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number2.name",detail:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBERANKEDMEMBER,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBERANKEDMEMBER.description",abstract:"formula.functionList.CUBERANKEDMEMBER.abstract",functionParameter:[{name:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number1.name",detail:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number2.name",detail:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBESET,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBESET.description",abstract:"formula.functionList.CUBESET.abstract",functionParameter:[{name:"formula.functionList.CUBESET.functionParameter.number1.name",detail:"formula.functionList.CUBESET.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBESET.functionParameter.number2.name",detail:"formula.functionList.CUBESET.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBESETCOUNT,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBESETCOUNT.description",abstract:"formula.functionList.CUBESETCOUNT.abstract",functionParameter:[{name:"formula.functionList.CUBESETCOUNT.functionParameter.number1.name",detail:"formula.functionList.CUBESETCOUNT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBESETCOUNT.functionParameter.number2.name",detail:"formula.functionList.CUBESETCOUNT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBEVALUE,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEVALUE.description",abstract:"formula.functionList.CUBEVALUE.abstract",functionParameter:[{name:"formula.functionList.CUBEVALUE.functionParameter.number1.name",detail:"formula.functionList.CUBEVALUE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEVALUE.functionParameter.number2.name",detail:"formula.functionList.CUBEVALUE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]}],ve=[{functionName:t.FUNCTION_NAMES_DATABASE.DAVERAGE,functionType:t.FunctionType.Database,description:"formula.functionList.DAVERAGE.description",abstract:"formula.functionList.DAVERAGE.abstract",functionParameter:[{name:"formula.functionList.DAVERAGE.functionParameter.database.name",detail:"formula.functionList.DAVERAGE.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DAVERAGE.functionParameter.field.name",detail:"formula.functionList.DAVERAGE.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DAVERAGE.functionParameter.criteria.name",detail:"formula.functionList.DAVERAGE.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DCOUNT,functionType:t.FunctionType.Database,description:"formula.functionList.DCOUNT.description",abstract:"formula.functionList.DCOUNT.abstract",functionParameter:[{name:"formula.functionList.DCOUNT.functionParameter.database.name",detail:"formula.functionList.DCOUNT.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DCOUNT.functionParameter.field.name",detail:"formula.functionList.DCOUNT.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DCOUNT.functionParameter.criteria.name",detail:"formula.functionList.DCOUNT.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DCOUNTA,functionType:t.FunctionType.Database,description:"formula.functionList.DCOUNTA.description",abstract:"formula.functionList.DCOUNTA.abstract",functionParameter:[{name:"formula.functionList.DCOUNTA.functionParameter.database.name",detail:"formula.functionList.DCOUNTA.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DCOUNTA.functionParameter.field.name",detail:"formula.functionList.DCOUNTA.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DCOUNTA.functionParameter.criteria.name",detail:"formula.functionList.DCOUNTA.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DGET,functionType:t.FunctionType.Database,description:"formula.functionList.DGET.description",abstract:"formula.functionList.DGET.abstract",functionParameter:[{name:"formula.functionList.DGET.functionParameter.database.name",detail:"formula.functionList.DGET.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DGET.functionParameter.field.name",detail:"formula.functionList.DGET.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DGET.functionParameter.criteria.name",detail:"formula.functionList.DGET.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DMAX,functionType:t.FunctionType.Database,description:"formula.functionList.DMAX.description",abstract:"formula.functionList.DMAX.abstract",functionParameter:[{name:"formula.functionList.DMAX.functionParameter.database.name",detail:"formula.functionList.DMAX.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DMAX.functionParameter.field.name",detail:"formula.functionList.DMAX.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DMAX.functionParameter.criteria.name",detail:"formula.functionList.DMAX.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DMIN,functionType:t.FunctionType.Database,description:"formula.functionList.DMIN.description",abstract:"formula.functionList.DMIN.abstract",functionParameter:[{name:"formula.functionList.DMIN.functionParameter.database.name",detail:"formula.functionList.DMIN.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DMIN.functionParameter.field.name",detail:"formula.functionList.DMIN.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DMIN.functionParameter.criteria.name",detail:"formula.functionList.DMIN.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DPRODUCT,functionType:t.FunctionType.Database,description:"formula.functionList.DPRODUCT.description",abstract:"formula.functionList.DPRODUCT.abstract",functionParameter:[{name:"formula.functionList.DPRODUCT.functionParameter.database.name",detail:"formula.functionList.DPRODUCT.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DPRODUCT.functionParameter.field.name",detail:"formula.functionList.DPRODUCT.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DPRODUCT.functionParameter.criteria.name",detail:"formula.functionList.DPRODUCT.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DSTDEV,functionType:t.FunctionType.Database,description:"formula.functionList.DSTDEV.description",abstract:"formula.functionList.DSTDEV.abstract",functionParameter:[{name:"formula.functionList.DSTDEV.functionParameter.database.name",detail:"formula.functionList.DSTDEV.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DSTDEV.functionParameter.field.name",detail:"formula.functionList.DSTDEV.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DSTDEV.functionParameter.criteria.name",detail:"formula.functionList.DSTDEV.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DSTDEVP,functionType:t.FunctionType.Database,description:"formula.functionList.DSTDEVP.description",abstract:"formula.functionList.DSTDEVP.abstract",functionParameter:[{name:"formula.functionList.DSTDEVP.functionParameter.database.name",detail:"formula.functionList.DSTDEVP.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DSTDEVP.functionParameter.field.name",detail:"formula.functionList.DSTDEVP.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DSTDEVP.functionParameter.criteria.name",detail:"formula.functionList.DSTDEVP.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DSUM,functionType:t.FunctionType.Database,description:"formula.functionList.DSUM.description",abstract:"formula.functionList.DSUM.abstract",functionParameter:[{name:"formula.functionList.DSUM.functionParameter.database.name",detail:"formula.functionList.DSUM.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DSUM.functionParameter.field.name",detail:"formula.functionList.DSUM.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DSUM.functionParameter.criteria.name",detail:"formula.functionList.DSUM.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DVAR,functionType:t.FunctionType.Database,description:"formula.functionList.DVAR.description",abstract:"formula.functionList.DVAR.abstract",functionParameter:[{name:"formula.functionList.DVAR.functionParameter.database.name",detail:"formula.functionList.DVAR.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DVAR.functionParameter.field.name",detail:"formula.functionList.DVAR.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DVAR.functionParameter.criteria.name",detail:"formula.functionList.DVAR.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DVARP,functionType:t.FunctionType.Database,description:"formula.functionList.DVARP.description",abstract:"formula.functionList.DVARP.abstract",functionParameter:[{name:"formula.functionList.DVARP.functionParameter.database.name",detail:"formula.functionList.DVARP.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DVARP.functionParameter.field.name",detail:"formula.functionList.DVARP.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DVARP.functionParameter.criteria.name",detail:"formula.functionList.DVARP.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]}],Ve=[{functionName:t.FUNCTION_NAMES_DATE.DATE,functionType:t.FunctionType.Date,description:"formula.functionList.DATE.description",abstract:"formula.functionList.DATE.abstract",functionParameter:[{name:"formula.functionList.DATE.functionParameter.year.name",detail:"formula.functionList.DATE.functionParameter.year.detail",example:"2024",require:1,repeat:0},{name:"formula.functionList.DATE.functionParameter.month.name",detail:"formula.functionList.DATE.functionParameter.month.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DATE.functionParameter.day.name",detail:"formula.functionList.DATE.functionParameter.day.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DATEDIF,functionType:t.FunctionType.Date,description:"formula.functionList.DATEDIF.description",abstract:"formula.functionList.DATEDIF.abstract",functionParameter:[{name:"formula.functionList.DATEDIF.functionParameter.startDate.name",detail:"formula.functionList.DATEDIF.functionParameter.startDate.detail",example:'"2001-6-1"',require:1,repeat:0},{name:"formula.functionList.DATEDIF.functionParameter.endDate.name",detail:"formula.functionList.DATEDIF.functionParameter.endDate.detail",example:'"2002-8-15"',require:1,repeat:0},{name:"formula.functionList.DATEDIF.functionParameter.method.name",detail:"formula.functionList.DATEDIF.functionParameter.method.detail",example:'"D"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DATEVALUE,functionType:t.FunctionType.Date,description:"formula.functionList.DATEVALUE.description",abstract:"formula.functionList.DATEVALUE.abstract",functionParameter:[{name:"formula.functionList.DATEVALUE.functionParameter.dateText.name",detail:"formula.functionList.DATEVALUE.functionParameter.dateText.detail",example:'"2024-8-8"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DAY,functionType:t.FunctionType.Date,description:"formula.functionList.DAY.description",abstract:"formula.functionList.DAY.abstract",functionParameter:[{name:"formula.functionList.DAY.functionParameter.serialNumber.name",detail:"formula.functionList.DAY.functionParameter.serialNumber.detail",example:'"1969-7-20"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DAYS,functionType:t.FunctionType.Date,description:"formula.functionList.DAYS.description",abstract:"formula.functionList.DAYS.abstract",functionParameter:[{name:"formula.functionList.DAYS.functionParameter.endDate.name",detail:"formula.functionList.DAYS.functionParameter.endDate.detail",example:'"2021-12-31"',require:1,repeat:0},{name:"formula.functionList.DAYS.functionParameter.startDate.name",detail:"formula.functionList.DAYS.functionParameter.startDate.detail",example:'"2021-1-1"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DAYS360,functionType:t.FunctionType.Date,description:"formula.functionList.DAYS360.description",abstract:"formula.functionList.DAYS360.abstract",functionParameter:[{name:"formula.functionList.DAYS360.functionParameter.startDate.name",detail:"formula.functionList.DAYS360.functionParameter.startDate.detail",example:'"2021-1-29"',require:1,repeat:0},{name:"formula.functionList.DAYS360.functionParameter.endDate.name",detail:"formula.functionList.DAYS360.functionParameter.endDate.detail",example:'"2021-3-31"',require:1,repeat:0},{name:"formula.functionList.DAYS360.functionParameter.method.name",detail:"formula.functionList.DAYS360.functionParameter.method.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.EDATE,functionType:t.FunctionType.Date,description:"formula.functionList.EDATE.description",abstract:"formula.functionList.EDATE.abstract",functionParameter:[{name:"formula.functionList.EDATE.functionParameter.startDate.name",detail:"formula.functionList.EDATE.functionParameter.startDate.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.EDATE.functionParameter.months.name",detail:"formula.functionList.EDATE.functionParameter.months.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.EOMONTH,functionType:t.FunctionType.Date,description:"formula.functionList.EOMONTH.description",abstract:"formula.functionList.EOMONTH.abstract",functionParameter:[{name:"formula.functionList.EOMONTH.functionParameter.startDate.name",detail:"formula.functionList.EOMONTH.functionParameter.startDate.detail",example:'"2011-1-1"',require:1,repeat:0},{name:"formula.functionList.EOMONTH.functionParameter.months.name",detail:"formula.functionList.EOMONTH.functionParameter.months.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.EPOCHTODATE,functionType:t.FunctionType.Date,description:"formula.functionList.EPOCHTODATE.description",abstract:"formula.functionList.EPOCHTODATE.abstract",functionParameter:[{name:"formula.functionList.EPOCHTODATE.functionParameter.timestamp.name",detail:"formula.functionList.EPOCHTODATE.functionParameter.timestamp.detail",example:"1655906710",require:1,repeat:0},{name:"formula.functionList.EPOCHTODATE.functionParameter.unit.name",detail:"formula.functionList.EPOCHTODATE.functionParameter.unit.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.HOUR,functionType:t.FunctionType.Date,description:"formula.functionList.HOUR.description",abstract:"formula.functionList.HOUR.abstract",functionParameter:[{name:"formula.functionList.HOUR.functionParameter.serialNumber.name",detail:"formula.functionList.HOUR.functionParameter.serialNumber.detail",example:'"2011-7-18 7:45"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.ISOWEEKNUM,functionType:t.FunctionType.Date,description:"formula.functionList.ISOWEEKNUM.description",abstract:"formula.functionList.ISOWEEKNUM.abstract",functionParameter:[{name:"formula.functionList.ISOWEEKNUM.functionParameter.date.name",detail:"formula.functionList.ISOWEEKNUM.functionParameter.date.detail",example:'"2012-3-9"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.MINUTE,functionType:t.FunctionType.Date,description:"formula.functionList.MINUTE.description",abstract:"formula.functionList.MINUTE.abstract",functionParameter:[{name:"formula.functionList.MINUTE.functionParameter.serialNumber.name",detail:"formula.functionList.MINUTE.functionParameter.serialNumber.detail",example:'"12:45"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.MONTH,functionType:t.FunctionType.Date,description:"formula.functionList.MONTH.description",abstract:"formula.functionList.MONTH.abstract",functionParameter:[{name:"formula.functionList.MONTH.functionParameter.serialNumber.name",detail:"formula.functionList.MONTH.functionParameter.serialNumber.detail",example:'"1969-7-20"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.NETWORKDAYS,functionType:t.FunctionType.Date,description:"formula.functionList.NETWORKDAYS.description",abstract:"formula.functionList.NETWORKDAYS.abstract",functionParameter:[{name:"formula.functionList.NETWORKDAYS.functionParameter.startDate.name",detail:"formula.functionList.NETWORKDAYS.functionParameter.startDate.detail",example:'"2012-10-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS.functionParameter.endDate.name",detail:"formula.functionList.NETWORKDAYS.functionParameter.endDate.detail",example:'"2013-3-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS.functionParameter.holidays.name",detail:"formula.functionList.NETWORKDAYS.functionParameter.holidays.detail",example:'"2012-11-22"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.NETWORKDAYS_INTL,functionType:t.FunctionType.Date,description:"formula.functionList.NETWORKDAYS_INTL.description",abstract:"formula.functionList.NETWORKDAYS_INTL.abstract",functionParameter:[{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.startDate.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.startDate.detail",example:'"2012-10-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.endDate.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.endDate.detail",example:'"2013-3-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.weekend.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.weekend.detail",example:"6",require:0,repeat:0},{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.holidays.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.holidays.detail",example:'"2012-11-22"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.NOW,functionType:t.FunctionType.Date,description:"formula.functionList.NOW.description",abstract:"formula.functionList.NOW.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_DATE.SECOND,functionType:t.FunctionType.Date,description:"formula.functionList.SECOND.description",abstract:"formula.functionList.SECOND.abstract",functionParameter:[{name:"formula.functionList.SECOND.functionParameter.serialNumber.name",detail:"formula.functionList.SECOND.functionParameter.serialNumber.detail",example:'"4:48:18"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TIME,functionType:t.FunctionType.Date,description:"formula.functionList.TIME.description",abstract:"formula.functionList.TIME.abstract",functionParameter:[{name:"formula.functionList.TIME.functionParameter.hour.name",detail:"formula.functionList.TIME.functionParameter.hour.detail",example:"15",require:1,repeat:0},{name:"formula.functionList.TIME.functionParameter.minute.name",detail:"formula.functionList.TIME.functionParameter.minute.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.TIME.functionParameter.second.name",detail:"formula.functionList.TIME.functionParameter.second.detail",example:"59",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TIMEVALUE,functionType:t.FunctionType.Date,description:"formula.functionList.TIMEVALUE.description",abstract:"formula.functionList.TIMEVALUE.abstract",functionParameter:[{name:"formula.functionList.TIMEVALUE.functionParameter.timeText.name",detail:"formula.functionList.TIMEVALUE.functionParameter.timeText.detail",example:'"15:20:59"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TO_DATE,functionType:t.FunctionType.Date,description:"formula.functionList.TO_DATE.description",abstract:"formula.functionList.TO_DATE.abstract",functionParameter:[{name:"formula.functionList.TO_DATE.functionParameter.value.name",detail:"formula.functionList.TO_DATE.functionParameter.value.detail",example:"40826.4375",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TODAY,functionType:t.FunctionType.Date,description:"formula.functionList.TODAY.description",abstract:"formula.functionList.TODAY.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_DATE.WEEKDAY,functionType:t.FunctionType.Date,description:"formula.functionList.WEEKDAY.description",abstract:"formula.functionList.WEEKDAY.abstract",functionParameter:[{name:"formula.functionList.WEEKDAY.functionParameter.serialNumber.name",detail:"formula.functionList.WEEKDAY.functionParameter.serialNumber.detail",example:'"2008-2-14"',require:1,repeat:0},{name:"formula.functionList.WEEKDAY.functionParameter.returnType.name",detail:"formula.functionList.WEEKDAY.functionParameter.returnType.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.WEEKNUM,functionType:t.FunctionType.Date,description:"formula.functionList.WEEKNUM.description",abstract:"formula.functionList.WEEKNUM.abstract",functionParameter:[{name:"formula.functionList.WEEKNUM.functionParameter.serialNumber.name",detail:"formula.functionList.WEEKNUM.functionParameter.serialNumber.detail",example:'"2012-3-9"',require:1,repeat:0},{name:"formula.functionList.WEEKNUM.functionParameter.returnType.name",detail:"formula.functionList.WEEKNUM.functionParameter.returnType.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.WORKDAY,functionType:t.FunctionType.Date,description:"formula.functionList.WORKDAY.description",abstract:"formula.functionList.WORKDAY.abstract",functionParameter:[{name:"formula.functionList.WORKDAY.functionParameter.startDate.name",detail:"formula.functionList.WORKDAY.functionParameter.startDate.detail",example:'"2008-10-1"',require:1,repeat:0},{name:"formula.functionList.WORKDAY.functionParameter.days.name",detail:"formula.functionList.WORKDAY.functionParameter.days.detail",example:"151",require:1,repeat:0},{name:"formula.functionList.WORKDAY.functionParameter.holidays.name",detail:"formula.functionList.WORKDAY.functionParameter.holidays.detail",example:'"2008-11-26"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.WORKDAY_INTL,functionType:t.FunctionType.Date,description:"formula.functionList.WORKDAY_INTL.description",abstract:"formula.functionList.WORKDAY_INTL.abstract",functionParameter:[{name:"formula.functionList.WORKDAY_INTL.functionParameter.startDate.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.startDate.detail",example:'"2008-10-1"',require:1,repeat:0},{name:"formula.functionList.WORKDAY_INTL.functionParameter.days.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.days.detail",example:"151",require:1,repeat:0},{name:"formula.functionList.WORKDAY_INTL.functionParameter.weekend.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.weekend.detail",example:"6",require:0,repeat:0},{name:"formula.functionList.WORKDAY_INTL.functionParameter.holidays.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.holidays.detail",example:'"2008-11-26"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.YEAR,functionType:t.FunctionType.Date,description:"formula.functionList.YEAR.description",abstract:"formula.functionList.YEAR.abstract",functionParameter:[{name:"formula.functionList.YEAR.functionParameter.serialNumber.name",detail:"formula.functionList.YEAR.functionParameter.serialNumber.detail",example:'"1969-7-20"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.YEARFRAC,functionType:t.FunctionType.Date,description:"formula.functionList.YEARFRAC.description",abstract:"formula.functionList.YEARFRAC.abstract",functionParameter:[{name:"formula.functionList.YEARFRAC.functionParameter.startDate.name",detail:"formula.functionList.YEARFRAC.functionParameter.startDate.detail",example:'"2012-1-1"',require:1,repeat:0},{name:"formula.functionList.YEARFRAC.functionParameter.endDate.name",detail:"formula.functionList.YEARFRAC.functionParameter.endDate.detail",example:'"2012-7-30"',require:1,repeat:0},{name:"formula.functionList.YEARFRAC.functionParameter.basis.name",detail:"formula.functionList.YEARFRAC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]}],Ge=[{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELI,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELI.description",abstract:"formula.functionList.BESSELI.abstract",functionParameter:[{name:"formula.functionList.BESSELI.functionParameter.x.name",detail:"formula.functionList.BESSELI.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELI.functionParameter.n.name",detail:"formula.functionList.BESSELI.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELJ,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELJ.description",abstract:"formula.functionList.BESSELJ.abstract",functionParameter:[{name:"formula.functionList.BESSELJ.functionParameter.x.name",detail:"formula.functionList.BESSELJ.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELJ.functionParameter.n.name",detail:"formula.functionList.BESSELJ.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELK,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELK.description",abstract:"formula.functionList.BESSELK.abstract",functionParameter:[{name:"formula.functionList.BESSELK.functionParameter.x.name",detail:"formula.functionList.BESSELK.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELK.functionParameter.n.name",detail:"formula.functionList.BESSELK.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELY,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELY.description",abstract:"formula.functionList.BESSELY.abstract",functionParameter:[{name:"formula.functionList.BESSELY.functionParameter.x.name",detail:"formula.functionList.BESSELY.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELY.functionParameter.n.name",detail:"formula.functionList.BESSELY.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BIN2DEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.BIN2DEC.description",abstract:"formula.functionList.BIN2DEC.abstract",functionParameter:[{name:"formula.functionList.BIN2DEC.functionParameter.number.name",detail:"formula.functionList.BIN2DEC.functionParameter.number.detail",example:"1100100",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BIN2HEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.BIN2HEX.description",abstract:"formula.functionList.BIN2HEX.abstract",functionParameter:[{name:"formula.functionList.BIN2HEX.functionParameter.number.name",detail:"formula.functionList.BIN2HEX.functionParameter.number.detail",example:"11111011",require:1,repeat:0},{name:"formula.functionList.BIN2HEX.functionParameter.places.name",detail:"formula.functionList.BIN2HEX.functionParameter.places.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BIN2OCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.BIN2OCT.description",abstract:"formula.functionList.BIN2OCT.abstract",functionParameter:[{name:"formula.functionList.BIN2OCT.functionParameter.number.name",detail:"formula.functionList.BIN2OCT.functionParameter.number.detail",example:"1001",require:1,repeat:0},{name:"formula.functionList.BIN2OCT.functionParameter.places.name",detail:"formula.functionList.BIN2OCT.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITAND,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITAND.description",abstract:"formula.functionList.BITAND.abstract",functionParameter:[{name:"formula.functionList.BITAND.functionParameter.number1.name",detail:"formula.functionList.BITAND.functionParameter.number1.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.BITAND.functionParameter.number2.name",detail:"formula.functionList.BITAND.functionParameter.number2.detail",example:"25",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITLSHIFT,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITLSHIFT.description",abstract:"formula.functionList.BITLSHIFT.abstract",functionParameter:[{name:"formula.functionList.BITLSHIFT.functionParameter.number.name",detail:"formula.functionList.BITLSHIFT.functionParameter.number.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.BITLSHIFT.functionParameter.shiftAmount.name",detail:"formula.functionList.BITLSHIFT.functionParameter.shiftAmount.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITOR,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITOR.description",abstract:"formula.functionList.BITOR.abstract",functionParameter:[{name:"formula.functionList.BITOR.functionParameter.number1.name",detail:"formula.functionList.BITOR.functionParameter.number1.detail",example:"23",require:1,repeat:0},{name:"formula.functionList.BITOR.functionParameter.number2.name",detail:"formula.functionList.BITOR.functionParameter.number2.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITRSHIFT,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITRSHIFT.description",abstract:"formula.functionList.BITRSHIFT.abstract",functionParameter:[{name:"formula.functionList.BITRSHIFT.functionParameter.number.name",detail:"formula.functionList.BITRSHIFT.functionParameter.number.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.BITRSHIFT.functionParameter.shiftAmount.name",detail:"formula.functionList.BITRSHIFT.functionParameter.shiftAmount.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITXOR,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITXOR.description",abstract:"formula.functionList.BITXOR.abstract",functionParameter:[{name:"formula.functionList.BITXOR.functionParameter.number1.name",detail:"formula.functionList.BITXOR.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.BITXOR.functionParameter.number2.name",detail:"formula.functionList.BITXOR.functionParameter.number2.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.COMPLEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.COMPLEX.description",abstract:"formula.functionList.COMPLEX.abstract",functionParameter:[{name:"formula.functionList.COMPLEX.functionParameter.realNum.name",detail:"formula.functionList.COMPLEX.functionParameter.realNum.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.COMPLEX.functionParameter.iNum.name",detail:"formula.functionList.COMPLEX.functionParameter.iNum.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.COMPLEX.functionParameter.suffix.name",detail:"formula.functionList.COMPLEX.functionParameter.suffix.detail",example:'"i"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.CONVERT,functionType:t.FunctionType.Engineering,description:"formula.functionList.CONVERT.description",abstract:"formula.functionList.CONVERT.abstract",functionParameter:[{name:"formula.functionList.CONVERT.functionParameter.number.name",detail:"formula.functionList.CONVERT.functionParameter.number.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CONVERT.functionParameter.fromUnit.name",detail:"formula.functionList.CONVERT.functionParameter.fromUnit.detail",example:'"lbm"',require:1,repeat:0},{name:"formula.functionList.CONVERT.functionParameter.toUnit.name",detail:"formula.functionList.CONVERT.functionParameter.toUnit.detail",example:'"kg"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DEC2BIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.DEC2BIN.description",abstract:"formula.functionList.DEC2BIN.abstract",functionParameter:[{name:"formula.functionList.DEC2BIN.functionParameter.number.name",detail:"formula.functionList.DEC2BIN.functionParameter.number.detail",example:"9",require:1,repeat:0},{name:"formula.functionList.DEC2BIN.functionParameter.places.name",detail:"formula.functionList.DEC2BIN.functionParameter.places.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DEC2HEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.DEC2HEX.description",abstract:"formula.functionList.DEC2HEX.abstract",functionParameter:[{name:"formula.functionList.DEC2HEX.functionParameter.number.name",detail:"formula.functionList.DEC2HEX.functionParameter.number.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.DEC2HEX.functionParameter.places.name",detail:"formula.functionList.DEC2HEX.functionParameter.places.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DEC2OCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.DEC2OCT.description",abstract:"formula.functionList.DEC2OCT.abstract",functionParameter:[{name:"formula.functionList.DEC2OCT.functionParameter.number.name",detail:"formula.functionList.DEC2OCT.functionParameter.number.detail",example:"58",require:1,repeat:0},{name:"formula.functionList.DEC2OCT.functionParameter.places.name",detail:"formula.functionList.DEC2OCT.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DELTA,functionType:t.FunctionType.Engineering,description:"formula.functionList.DELTA.description",abstract:"formula.functionList.DELTA.abstract",functionParameter:[{name:"formula.functionList.DELTA.functionParameter.number1.name",detail:"formula.functionList.DELTA.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.DELTA.functionParameter.number2.name",detail:"formula.functionList.DELTA.functionParameter.number2.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERF,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERF.description",abstract:"formula.functionList.ERF.abstract",functionParameter:[{name:"formula.functionList.ERF.functionParameter.lowerLimit.name",detail:"formula.functionList.ERF.functionParameter.lowerLimit.detail",example:"0.745",require:1,repeat:0},{name:"formula.functionList.ERF.functionParameter.upperLimit.name",detail:"formula.functionList.ERF.functionParameter.upperLimit.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERF_PRECISE,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERF_PRECISE.description",abstract:"formula.functionList.ERF_PRECISE.abstract",functionParameter:[{name:"formula.functionList.ERF_PRECISE.functionParameter.x.name",detail:"formula.functionList.ERF_PRECISE.functionParameter.x.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERFC,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERFC.description",abstract:"formula.functionList.ERFC.abstract",functionParameter:[{name:"formula.functionList.ERFC.functionParameter.x.name",detail:"formula.functionList.ERFC.functionParameter.x.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERFC_PRECISE,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERFC_PRECISE.description",abstract:"formula.functionList.ERFC_PRECISE.abstract",functionParameter:[{name:"formula.functionList.ERFC_PRECISE.functionParameter.x.name",detail:"formula.functionList.ERFC_PRECISE.functionParameter.x.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.GESTEP,functionType:t.FunctionType.Engineering,description:"formula.functionList.GESTEP.description",abstract:"formula.functionList.GESTEP.abstract",functionParameter:[{name:"formula.functionList.GESTEP.functionParameter.number.name",detail:"formula.functionList.GESTEP.functionParameter.number.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.GESTEP.functionParameter.step.name",detail:"formula.functionList.GESTEP.functionParameter.step.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.HEX2BIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.HEX2BIN.description",abstract:"formula.functionList.HEX2BIN.abstract",functionParameter:[{name:"formula.functionList.HEX2BIN.functionParameter.number.name",detail:"formula.functionList.HEX2BIN.functionParameter.number.detail",example:'"F"',require:1,repeat:0},{name:"formula.functionList.HEX2BIN.functionParameter.places.name",detail:"formula.functionList.HEX2BIN.functionParameter.places.detail",example:"8",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.HEX2DEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.HEX2DEC.description",abstract:"formula.functionList.HEX2DEC.abstract",functionParameter:[{name:"formula.functionList.HEX2DEC.functionParameter.number.name",detail:"formula.functionList.HEX2DEC.functionParameter.number.detail",example:'"A5"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.HEX2OCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.HEX2OCT.description",abstract:"formula.functionList.HEX2OCT.abstract",functionParameter:[{name:"formula.functionList.HEX2OCT.functionParameter.number.name",detail:"formula.functionList.HEX2OCT.functionParameter.number.detail",example:'"F"',require:1,repeat:0},{name:"formula.functionList.HEX2OCT.functionParameter.places.name",detail:"formula.functionList.HEX2OCT.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMABS,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMABS.description",abstract:"formula.functionList.IMABS.abstract",functionParameter:[{name:"formula.functionList.IMABS.functionParameter.inumber.name",detail:"formula.functionList.IMABS.functionParameter.inumber.detail",example:'"5+12i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMAGINARY,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMAGINARY.description",abstract:"formula.functionList.IMAGINARY.abstract",functionParameter:[{name:"formula.functionList.IMAGINARY.functionParameter.inumber.name",detail:"formula.functionList.IMAGINARY.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMARGUMENT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMARGUMENT.description",abstract:"formula.functionList.IMARGUMENT.abstract",functionParameter:[{name:"formula.functionList.IMARGUMENT.functionParameter.inumber.name",detail:"formula.functionList.IMARGUMENT.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCONJUGATE,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCONJUGATE.description",abstract:"formula.functionList.IMCONJUGATE.abstract",functionParameter:[{name:"formula.functionList.IMCONJUGATE.functionParameter.inumber.name",detail:"formula.functionList.IMCONJUGATE.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOS,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOS.description",abstract:"formula.functionList.IMCOS.abstract",functionParameter:[{name:"formula.functionList.IMCOS.functionParameter.inumber.name",detail:"formula.functionList.IMCOS.functionParameter.inumber.detail",example:'"1+i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOSH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOSH.description",abstract:"formula.functionList.IMCOSH.abstract",functionParameter:[{name:"formula.functionList.IMCOSH.functionParameter.inumber.name",detail:"formula.functionList.IMCOSH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOT.description",abstract:"formula.functionList.IMCOT.abstract",functionParameter:[{name:"formula.functionList.IMCOT.functionParameter.inumber.name",detail:"formula.functionList.IMCOT.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOTH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOTH.description",abstract:"formula.functionList.IMCOTH.abstract",functionParameter:[{name:"formula.functionList.IMCOTH.functionParameter.inumber.name",detail:"formula.functionList.IMCOTH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCSC,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCSC.description",abstract:"formula.functionList.IMCSC.abstract",functionParameter:[{name:"formula.functionList.IMCSC.functionParameter.inumber.name",detail:"formula.functionList.IMCSC.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCSCH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCSCH.description",abstract:"formula.functionList.IMCSCH.abstract",functionParameter:[{name:"formula.functionList.IMCSCH.functionParameter.inumber.name",detail:"formula.functionList.IMCSCH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMDIV,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMDIV.description",abstract:"formula.functionList.IMDIV.abstract",functionParameter:[{name:"formula.functionList.IMDIV.functionParameter.inumber1.name",detail:"formula.functionList.IMDIV.functionParameter.inumber1.detail",example:'"-238+240i"',require:1,repeat:0},{name:"formula.functionList.IMDIV.functionParameter.inumber2.name",detail:"formula.functionList.IMDIV.functionParameter.inumber2.detail",example:'"10+24i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMEXP,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMEXP.description",abstract:"formula.functionList.IMEXP.abstract",functionParameter:[{name:"formula.functionList.IMEXP.functionParameter.inumber.name",detail:"formula.functionList.IMEXP.functionParameter.inumber.detail",example:'"1+i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLN,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLN.description",abstract:"formula.functionList.IMLN.abstract",functionParameter:[{name:"formula.functionList.IMLN.functionParameter.inumber.name",detail:"formula.functionList.IMLN.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLOG,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLOG.description",abstract:"formula.functionList.IMLOG.abstract",functionParameter:[{name:"formula.functionList.IMLOG.functionParameter.inumber.name",detail:"formula.functionList.IMLOG.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0},{name:"formula.functionList.IMLOG.functionParameter.base.name",detail:"formula.functionList.IMLOG.functionParameter.base.detail",example:"10",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLOG10,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLOG10.description",abstract:"formula.functionList.IMLOG10.abstract",functionParameter:[{name:"formula.functionList.IMLOG10.functionParameter.inumber.name",detail:"formula.functionList.IMLOG10.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLOG2,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLOG2.description",abstract:"formula.functionList.IMLOG2.abstract",functionParameter:[{name:"formula.functionList.IMLOG2.functionParameter.inumber.name",detail:"formula.functionList.IMLOG2.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMPOWER,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMPOWER.description",abstract:"formula.functionList.IMPOWER.abstract",functionParameter:[{name:"formula.functionList.IMPOWER.functionParameter.inumber.name",detail:"formula.functionList.IMPOWER.functionParameter.inumber.detail",example:'"2+3i"',require:1,repeat:0},{name:"formula.functionList.IMPOWER.functionParameter.number.name",detail:"formula.functionList.IMPOWER.functionParameter.number.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMPRODUCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMPRODUCT.description",abstract:"formula.functionList.IMPRODUCT.abstract",functionParameter:[{name:"formula.functionList.IMPRODUCT.functionParameter.inumber1.name",detail:"formula.functionList.IMPRODUCT.functionParameter.inumber1.detail",example:'"3+4i"',require:1,repeat:0},{name:"formula.functionList.IMPRODUCT.functionParameter.inumber2.name",detail:"formula.functionList.IMPRODUCT.functionParameter.inumber2.detail",example:'"5-3i"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMREAL,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMREAL.description",abstract:"formula.functionList.IMREAL.abstract",functionParameter:[{name:"formula.functionList.IMREAL.functionParameter.inumber.name",detail:"formula.functionList.IMREAL.functionParameter.inumber.detail",example:'"6-9i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSEC.description",abstract:"formula.functionList.IMSEC.abstract",functionParameter:[{name:"formula.functionList.IMSEC.functionParameter.inumber.name",detail:"formula.functionList.IMSEC.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSECH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSECH.description",abstract:"formula.functionList.IMSECH.abstract",functionParameter:[{name:"formula.functionList.IMSECH.functionParameter.inumber.name",detail:"formula.functionList.IMSECH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSIN.description",abstract:"formula.functionList.IMSIN.abstract",functionParameter:[{name:"formula.functionList.IMSIN.functionParameter.inumber.name",detail:"formula.functionList.IMSIN.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSINH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSINH.description",abstract:"formula.functionList.IMSINH.abstract",functionParameter:[{name:"formula.functionList.IMSINH.functionParameter.inumber.name",detail:"formula.functionList.IMSINH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSQRT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSQRT.description",abstract:"formula.functionList.IMSQRT.abstract",functionParameter:[{name:"formula.functionList.IMSQRT.functionParameter.inumber.name",detail:"formula.functionList.IMSQRT.functionParameter.inumber.detail",example:'"1+i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSUB,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSUB.description",abstract:"formula.functionList.IMSUB.abstract",functionParameter:[{name:"formula.functionList.IMSUB.functionParameter.inumber1.name",detail:"formula.functionList.IMSUB.functionParameter.inumber1.detail",example:'"13+4i"',require:1,repeat:0},{name:"formula.functionList.IMSUB.functionParameter.inumber2.name",detail:"formula.functionList.IMSUB.functionParameter.inumber2.detail",example:'"5+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSUM,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSUM.description",abstract:"formula.functionList.IMSUM.abstract",functionParameter:[{name:"formula.functionList.IMSUM.functionParameter.inumber1.name",detail:"formula.functionList.IMSUM.functionParameter.inumber1.detail",example:'"3+4i"',require:1,repeat:0},{name:"formula.functionList.IMSUM.functionParameter.inumber2.name",detail:"formula.functionList.IMSUM.functionParameter.inumber2.detail",example:'"5-3i"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMTAN,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMTAN.description",abstract:"formula.functionList.IMTAN.abstract",functionParameter:[{name:"formula.functionList.IMTAN.functionParameter.inumber.name",detail:"formula.functionList.IMTAN.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMTANH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMTANH.description",abstract:"formula.functionList.IMTANH.abstract",functionParameter:[{name:"formula.functionList.IMTANH.functionParameter.inumber.name",detail:"formula.functionList.IMTANH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.OCT2BIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.OCT2BIN.description",abstract:"formula.functionList.OCT2BIN.abstract",functionParameter:[{name:"formula.functionList.OCT2BIN.functionParameter.number.name",detail:"formula.functionList.OCT2BIN.functionParameter.number.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.OCT2BIN.functionParameter.places.name",detail:"formula.functionList.OCT2BIN.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.OCT2DEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.OCT2DEC.description",abstract:"formula.functionList.OCT2DEC.abstract",functionParameter:[{name:"formula.functionList.OCT2DEC.functionParameter.number.name",detail:"formula.functionList.OCT2DEC.functionParameter.number.detail",example:"54",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.OCT2HEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.OCT2HEX.description",abstract:"formula.functionList.OCT2HEX.abstract",functionParameter:[{name:"formula.functionList.OCT2HEX.functionParameter.number.name",detail:"formula.functionList.OCT2HEX.functionParameter.number.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.OCT2HEX.functionParameter.places.name",detail:"formula.functionList.OCT2HEX.functionParameter.places.detail",example:"4",require:0,repeat:0}]}],He=[{functionName:t.FUNCTION_NAMES_FINANCIAL.ACCRINT,functionType:t.FunctionType.Financial,description:"formula.functionList.ACCRINT.description",abstract:"formula.functionList.ACCRINT.abstract",functionParameter:[{name:"formula.functionList.ACCRINT.functionParameter.issue.name",detail:"formula.functionList.ACCRINT.functionParameter.issue.detail",example:"39508",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.firstInterest.name",detail:"formula.functionList.ACCRINT.functionParameter.firstInterest.detail",example:"39691",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.settlement.name",detail:"formula.functionList.ACCRINT.functionParameter.settlement.detail",example:"39569",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.rate.name",detail:"formula.functionList.ACCRINT.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.par.name",detail:"formula.functionList.ACCRINT.functionParameter.par.detail",example:"1000",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.frequency.name",detail:"formula.functionList.ACCRINT.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.basis.name",detail:"formula.functionList.ACCRINT.functionParameter.basis.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.calcMethod.name",detail:"formula.functionList.ACCRINT.functionParameter.calcMethod.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ACCRINTM,functionType:t.FunctionType.Financial,description:"formula.functionList.ACCRINTM.description",abstract:"formula.functionList.ACCRINTM.abstract",functionParameter:[{name:"formula.functionList.ACCRINTM.functionParameter.issue.name",detail:"formula.functionList.ACCRINTM.functionParameter.issue.detail",example:'"2008-4-1"',require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.settlement.name",detail:"formula.functionList.ACCRINTM.functionParameter.settlement.detail",example:'"2008-6-15"',require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.rate.name",detail:"formula.functionList.ACCRINTM.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.par.name",detail:"formula.functionList.ACCRINTM.functionParameter.par.detail",example:"1000",require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.basis.name",detail:"formula.functionList.ACCRINTM.functionParameter.basis.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.AMORDEGRC,functionType:t.FunctionType.Financial,description:"formula.functionList.AMORDEGRC.description",abstract:"formula.functionList.AMORDEGRC.abstract",functionParameter:[{name:"formula.functionList.AMORDEGRC.functionParameter.number1.name",detail:"formula.functionList.AMORDEGRC.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AMORDEGRC.functionParameter.number2.name",detail:"formula.functionList.AMORDEGRC.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.AMORLINC,functionType:t.FunctionType.Financial,description:"formula.functionList.AMORLINC.description",abstract:"formula.functionList.AMORLINC.abstract",functionParameter:[{name:"formula.functionList.AMORLINC.functionParameter.cost.name",detail:"formula.functionList.AMORLINC.functionParameter.cost.detail",example:"2400",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.datePurchased.name",detail:"formula.functionList.AMORLINC.functionParameter.datePurchased.detail",example:"39679",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.firstPeriod.name",detail:"formula.functionList.AMORLINC.functionParameter.firstPeriod.detail",example:"39813",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.salvage.name",detail:"formula.functionList.AMORLINC.functionParameter.salvage.detail",example:"300",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.period.name",detail:"formula.functionList.AMORLINC.functionParameter.period.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.rate.name",detail:"formula.functionList.AMORLINC.functionParameter.rate.detail",example:"0.15",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.basis.name",detail:"formula.functionList.AMORLINC.functionParameter.basis.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPDAYBS,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPDAYBS.description",abstract:"formula.functionList.COUPDAYBS.abstract",functionParameter:[{name:"formula.functionList.COUPDAYBS.functionParameter.settlement.name",detail:"formula.functionList.COUPDAYBS.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPDAYBS.functionParameter.maturity.name",detail:"formula.functionList.COUPDAYBS.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPDAYBS.functionParameter.frequency.name",detail:"formula.functionList.COUPDAYBS.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPDAYBS.functionParameter.basis.name",detail:"formula.functionList.COUPDAYBS.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPDAYS,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPDAYS.description",abstract:"formula.functionList.COUPDAYS.abstract",functionParameter:[{name:"formula.functionList.COUPDAYS.functionParameter.settlement.name",detail:"formula.functionList.COUPDAYS.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPDAYS.functionParameter.maturity.name",detail:"formula.functionList.COUPDAYS.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPDAYS.functionParameter.frequency.name",detail:"formula.functionList.COUPDAYS.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPDAYS.functionParameter.basis.name",detail:"formula.functionList.COUPDAYS.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPDAYSNC,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPDAYSNC.description",abstract:"formula.functionList.COUPDAYSNC.abstract",functionParameter:[{name:"formula.functionList.COUPDAYSNC.functionParameter.settlement.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPDAYSNC.functionParameter.maturity.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPDAYSNC.functionParameter.frequency.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPDAYSNC.functionParameter.basis.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPNCD,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPNCD.description",abstract:"formula.functionList.COUPNCD.abstract",functionParameter:[{name:"formula.functionList.COUPNCD.functionParameter.settlement.name",detail:"formula.functionList.COUPNCD.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPNCD.functionParameter.maturity.name",detail:"formula.functionList.COUPNCD.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPNCD.functionParameter.frequency.name",detail:"formula.functionList.COUPNCD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPNCD.functionParameter.basis.name",detail:"formula.functionList.COUPNCD.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPNUM,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPNUM.description",abstract:"formula.functionList.COUPNUM.abstract",functionParameter:[{name:"formula.functionList.COUPNUM.functionParameter.settlement.name",detail:"formula.functionList.COUPNUM.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPNUM.functionParameter.maturity.name",detail:"formula.functionList.COUPNUM.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPNUM.functionParameter.frequency.name",detail:"formula.functionList.COUPNUM.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPNUM.functionParameter.basis.name",detail:"formula.functionList.COUPNUM.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPPCD,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPPCD.description",abstract:"formula.functionList.COUPPCD.abstract",functionParameter:[{name:"formula.functionList.COUPPCD.functionParameter.settlement.name",detail:"formula.functionList.COUPPCD.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPPCD.functionParameter.maturity.name",detail:"formula.functionList.COUPPCD.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPPCD.functionParameter.frequency.name",detail:"formula.functionList.COUPPCD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPPCD.functionParameter.basis.name",detail:"formula.functionList.COUPPCD.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.CUMIPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.CUMIPMT.description",abstract:"formula.functionList.CUMIPMT.abstract",functionParameter:[{name:"formula.functionList.CUMIPMT.functionParameter.rate.name",detail:"formula.functionList.CUMIPMT.functionParameter.rate.detail",example:"0.09/12",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.nper.name",detail:"formula.functionList.CUMIPMT.functionParameter.nper.detail",example:"30*12",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.pv.name",detail:"formula.functionList.CUMIPMT.functionParameter.pv.detail",example:"125000",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.startPeriod.name",detail:"formula.functionList.CUMIPMT.functionParameter.startPeriod.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.endPeriod.name",detail:"formula.functionList.CUMIPMT.functionParameter.endPeriod.detail",example:"24",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.type.name",detail:"formula.functionList.CUMIPMT.functionParameter.type.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.CUMPRINC,functionType:t.FunctionType.Financial,description:"formula.functionList.CUMPRINC.description",abstract:"formula.functionList.CUMPRINC.abstract",functionParameter:[{name:"formula.functionList.CUMPRINC.functionParameter.rate.name",detail:"formula.functionList.CUMPRINC.functionParameter.rate.detail",example:"0.09/12",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.nper.name",detail:"formula.functionList.CUMPRINC.functionParameter.nper.detail",example:"30*12",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.pv.name",detail:"formula.functionList.CUMPRINC.functionParameter.pv.detail",example:"125000",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.startPeriod.name",detail:"formula.functionList.CUMPRINC.functionParameter.startPeriod.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.endPeriod.name",detail:"formula.functionList.CUMPRINC.functionParameter.endPeriod.detail",example:"24",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.type.name",detail:"formula.functionList.CUMPRINC.functionParameter.type.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DB,functionType:t.FunctionType.Financial,description:"formula.functionList.DB.description",abstract:"formula.functionList.DB.abstract",functionParameter:[{name:"formula.functionList.DB.functionParameter.cost.name",detail:"formula.functionList.DB.functionParameter.cost.detail",example:"10000000",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.salvage.name",detail:"formula.functionList.DB.functionParameter.salvage.detail",example:"1000000",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.life.name",detail:"formula.functionList.DB.functionParameter.life.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.period.name",detail:"formula.functionList.DB.functionParameter.period.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.month.name",detail:"formula.functionList.DB.functionParameter.month.detail",example:"7",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DDB,functionType:t.FunctionType.Financial,description:"formula.functionList.DDB.description",abstract:"formula.functionList.DDB.abstract",functionParameter:[{name:"formula.functionList.DDB.functionParameter.cost.name",detail:"formula.functionList.DDB.functionParameter.cost.detail",example:"24000",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.salvage.name",detail:"formula.functionList.DDB.functionParameter.salvage.detail",example:"3000",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.life.name",detail:"formula.functionList.DDB.functionParameter.life.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.period.name",detail:"formula.functionList.DDB.functionParameter.period.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.factor.name",detail:"formula.functionList.DDB.functionParameter.factor.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DISC,functionType:t.FunctionType.Financial,description:"formula.functionList.DISC.description",abstract:"formula.functionList.DISC.abstract",functionParameter:[{name:"formula.functionList.DISC.functionParameter.settlement.name",detail:"formula.functionList.DISC.functionParameter.settlement.detail",example:'"2018-7-1"',require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.maturity.name",detail:"formula.functionList.DISC.functionParameter.maturity.detail",example:'"2048-1-1"',require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.pr.name",detail:"formula.functionList.DISC.functionParameter.pr.detail",example:"97.975",require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.redemption.name",detail:"formula.functionList.DISC.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.basis.name",detail:"formula.functionList.DISC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DOLLARDE,functionType:t.FunctionType.Financial,description:"formula.functionList.DOLLARDE.description",abstract:"formula.functionList.DOLLARDE.abstract",functionParameter:[{name:"formula.functionList.DOLLARDE.functionParameter.fractionalDollar.name",detail:"formula.functionList.DOLLARDE.functionParameter.fractionalDollar.detail",example:"1.02",require:1,repeat:0},{name:"formula.functionList.DOLLARDE.functionParameter.fraction.name",detail:"formula.functionList.DOLLARDE.functionParameter.fraction.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DOLLARFR,functionType:t.FunctionType.Financial,description:"formula.functionList.DOLLARFR.description",abstract:"formula.functionList.DOLLARFR.abstract",functionParameter:[{name:"formula.functionList.DOLLARFR.functionParameter.decimalDollar.name",detail:"formula.functionList.DOLLARFR.functionParameter.decimalDollar.detail",example:"1.125",require:1,repeat:0},{name:"formula.functionList.DOLLARFR.functionParameter.fraction.name",detail:"formula.functionList.DOLLARFR.functionParameter.fraction.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DURATION,functionType:t.FunctionType.Financial,description:"formula.functionList.DURATION.description",abstract:"formula.functionList.DURATION.abstract",functionParameter:[{name:"formula.functionList.DURATION.functionParameter.settlement.name",detail:"formula.functionList.DURATION.functionParameter.settlement.detail",example:'"2018-7-1"',require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.maturity.name",detail:"formula.functionList.DURATION.functionParameter.maturity.detail",example:'"2048-1-1"',require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.coupon.name",detail:"formula.functionList.DURATION.functionParameter.coupon.detail",example:"0.08",require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.yld.name",detail:"formula.functionList.DURATION.functionParameter.yld.detail",example:"0.09",require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.frequency.name",detail:"formula.functionList.DURATION.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.basis.name",detail:"formula.functionList.DURATION.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.EFFECT,functionType:t.FunctionType.Financial,description:"formula.functionList.EFFECT.description",abstract:"formula.functionList.EFFECT.abstract",functionParameter:[{name:"formula.functionList.EFFECT.functionParameter.nominalRate.name",detail:"formula.functionList.EFFECT.functionParameter.nominalRate.detail",example:"0.0525",require:1,repeat:0},{name:"formula.functionList.EFFECT.functionParameter.npery.name",detail:"formula.functionList.EFFECT.functionParameter.npery.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.FV,functionType:t.FunctionType.Financial,description:"formula.functionList.FV.description",abstract:"formula.functionList.FV.abstract",functionParameter:[{name:"formula.functionList.FV.functionParameter.rate.name",detail:"formula.functionList.FV.functionParameter.rate.detail",example:"0.06/12",require:1,repeat:0},{name:"formula.functionList.FV.functionParameter.nper.name",detail:"formula.functionList.FV.functionParameter.nper.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.FV.functionParameter.pmt.name",detail:"formula.functionList.FV.functionParameter.pmt.detail",example:"-200",require:1,repeat:0},{name:"formula.functionList.FV.functionParameter.pv.name",detail:"formula.functionList.FV.functionParameter.pv.detail",example:"-500",require:0,repeat:0},{name:"formula.functionList.FV.functionParameter.type.name",detail:"formula.functionList.FV.functionParameter.type.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.FVSCHEDULE,functionType:t.FunctionType.Financial,description:"formula.functionList.FVSCHEDULE.description",abstract:"formula.functionList.FVSCHEDULE.abstract",functionParameter:[{name:"formula.functionList.FVSCHEDULE.functionParameter.principal.name",detail:"formula.functionList.FVSCHEDULE.functionParameter.principal.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.FVSCHEDULE.functionParameter.schedule.name",detail:"formula.functionList.FVSCHEDULE.functionParameter.schedule.detail",example:"A1:A4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.INTRATE,functionType:t.FunctionType.Financial,description:"formula.functionList.INTRATE.description",abstract:"formula.functionList.INTRATE.abstract",functionParameter:[{name:"formula.functionList.INTRATE.functionParameter.settlement.name",detail:"formula.functionList.INTRATE.functionParameter.settlement.detail",example:'"2008-2-15"',require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.maturity.name",detail:"formula.functionList.INTRATE.functionParameter.maturity.detail",example:'"2008-5-15"',require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.investment.name",detail:"formula.functionList.INTRATE.functionParameter.investment.detail",example:"10000000",require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.redemption.name",detail:"formula.functionList.INTRATE.functionParameter.redemption.detail",example:"10144200",require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.basis.name",detail:"formula.functionList.INTRATE.functionParameter.basis.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.IPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.IPMT.description",abstract:"formula.functionList.IPMT.abstract",functionParameter:[{name:"formula.functionList.IPMT.functionParameter.rate.name",detail:"formula.functionList.IPMT.functionParameter.rate.detail",example:"0.1/12",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.per.name",detail:"formula.functionList.IPMT.functionParameter.per.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.nper.name",detail:"formula.functionList.IPMT.functionParameter.nper.detail",example:"3*12",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.pv.name",detail:"formula.functionList.IPMT.functionParameter.pv.detail",example:"80000",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.fv.name",detail:"formula.functionList.IPMT.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.IPMT.functionParameter.type.name",detail:"formula.functionList.IPMT.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.IRR,functionType:t.FunctionType.Financial,description:"formula.functionList.IRR.description",abstract:"formula.functionList.IRR.abstract",functionParameter:[{name:"formula.functionList.IRR.functionParameter.values.name",detail:"formula.functionList.IRR.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.IRR.functionParameter.guess.name",detail:"formula.functionList.IRR.functionParameter.guess.detail",example:"0.1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ISPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.ISPMT.description",abstract:"formula.functionList.ISPMT.abstract",functionParameter:[{name:"formula.functionList.ISPMT.functionParameter.rate.name",detail:"formula.functionList.ISPMT.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.ISPMT.functionParameter.per.name",detail:"formula.functionList.ISPMT.functionParameter.per.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ISPMT.functionParameter.nper.name",detail:"formula.functionList.ISPMT.functionParameter.nper.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.ISPMT.functionParameter.pv.name",detail:"formula.functionList.ISPMT.functionParameter.pv.detail",example:"1000",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.MDURATION,functionType:t.FunctionType.Financial,description:"formula.functionList.MDURATION.description",abstract:"formula.functionList.MDURATION.abstract",functionParameter:[{name:"formula.functionList.MDURATION.functionParameter.settlement.name",detail:"formula.functionList.MDURATION.functionParameter.settlement.detail",example:'"2018-7-1"',require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.maturity.name",detail:"formula.functionList.MDURATION.functionParameter.maturity.detail",example:'"2048-1-1"',require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.coupon.name",detail:"formula.functionList.MDURATION.functionParameter.coupon.detail",example:"0.08",require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.yld.name",detail:"formula.functionList.MDURATION.functionParameter.yld.detail",example:"0.09",require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.frequency.name",detail:"formula.functionList.MDURATION.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.basis.name",detail:"formula.functionList.MDURATION.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.MIRR,functionType:t.FunctionType.Financial,description:"formula.functionList.MIRR.description",abstract:"formula.functionList.MIRR.abstract",functionParameter:[{name:"formula.functionList.MIRR.functionParameter.values.name",detail:"formula.functionList.MIRR.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MIRR.functionParameter.financeRate.name",detail:"formula.functionList.MIRR.functionParameter.financeRate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.MIRR.functionParameter.reinvestRate.name",detail:"formula.functionList.MIRR.functionParameter.reinvestRate.detail",example:"0.12",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.NOMINAL,functionType:t.FunctionType.Financial,description:"formula.functionList.NOMINAL.description",abstract:"formula.functionList.NOMINAL.abstract",functionParameter:[{name:"formula.functionList.NOMINAL.functionParameter.effectRate.name",detail:"formula.functionList.NOMINAL.functionParameter.effectRate.detail",example:"0.053543",require:1,repeat:0},{name:"formula.functionList.NOMINAL.functionParameter.npery.name",detail:"formula.functionList.NOMINAL.functionParameter.npery.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.NPER,functionType:t.FunctionType.Financial,description:"formula.functionList.NPER.description",abstract:"formula.functionList.NPER.abstract",functionParameter:[{name:"formula.functionList.NPER.functionParameter.rate.name",detail:"formula.functionList.NPER.functionParameter.rate.detail",example:"0.12/12",require:1,repeat:0},{name:"formula.functionList.NPER.functionParameter.pmt.name",detail:"formula.functionList.NPER.functionParameter.pmt.detail",example:"-100",require:1,repeat:0},{name:"formula.functionList.NPER.functionParameter.pv.name",detail:"formula.functionList.NPER.functionParameter.pv.detail",example:"-1000",require:1,repeat:0},{name:"formula.functionList.NPER.functionParameter.fv.name",detail:"formula.functionList.NPER.functionParameter.fv.detail",example:"10000",require:0,repeat:0},{name:"formula.functionList.NPER.functionParameter.type.name",detail:"formula.functionList.NPER.functionParameter.type.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.NPV,functionType:t.FunctionType.Financial,description:"formula.functionList.NPV.description",abstract:"formula.functionList.NPV.abstract",functionParameter:[{name:"formula.functionList.NPV.functionParameter.rate.name",detail:"formula.functionList.NPV.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.NPV.functionParameter.value1.name",detail:"formula.functionList.NPV.functionParameter.value1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.NPV.functionParameter.value2.name",detail:"formula.functionList.NPV.functionParameter.value2.detail",example:"-9000",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDFPRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDFPRICE.description",abstract:"formula.functionList.ODDFPRICE.abstract",functionParameter:[{name:"formula.functionList.ODDFPRICE.functionParameter.settlement.name",detail:"formula.functionList.ODDFPRICE.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.maturity.name",detail:"formula.functionList.ODDFPRICE.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.issue.name",detail:"formula.functionList.ODDFPRICE.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.firstCoupon.name",detail:"formula.functionList.ODDFPRICE.functionParameter.firstCoupon.detail",example:'"2009-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.rate.name",detail:"formula.functionList.ODDFPRICE.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.yld.name",detail:"formula.functionList.ODDFPRICE.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.redemption.name",detail:"formula.functionList.ODDFPRICE.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.frequency.name",detail:"formula.functionList.ODDFPRICE.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.basis.name",detail:"formula.functionList.ODDFPRICE.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDFYIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDFYIELD.description",abstract:"formula.functionList.ODDFYIELD.abstract",functionParameter:[{name:"formula.functionList.ODDFYIELD.functionParameter.settlement.name",detail:"formula.functionList.ODDFYIELD.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.maturity.name",detail:"formula.functionList.ODDFYIELD.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.issue.name",detail:"formula.functionList.ODDFYIELD.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.firstCoupon.name",detail:"formula.functionList.ODDFYIELD.functionParameter.firstCoupon.detail",example:'"2009-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.rate.name",detail:"formula.functionList.ODDFYIELD.functionParameter.rate.detail",example:"0.0575",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.pr.name",detail:"formula.functionList.ODDFYIELD.functionParameter.pr.detail",example:"84.5",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.redemption.name",detail:"formula.functionList.ODDFYIELD.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.frequency.name",detail:"formula.functionList.ODDFYIELD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.basis.name",detail:"formula.functionList.ODDFYIELD.functionParameter.basis.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDLPRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDLPRICE.description",abstract:"formula.functionList.ODDLPRICE.abstract",functionParameter:[{name:"formula.functionList.ODDLPRICE.functionParameter.settlement.name",detail:"formula.functionList.ODDLPRICE.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.maturity.name",detail:"formula.functionList.ODDLPRICE.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.lastInterest.name",detail:"formula.functionList.ODDLPRICE.functionParameter.lastInterest.detail",example:'"2009-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.rate.name",detail:"formula.functionList.ODDLPRICE.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.yld.name",detail:"formula.functionList.ODDLPRICE.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.redemption.name",detail:"formula.functionList.ODDLPRICE.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.frequency.name",detail:"formula.functionList.ODDLPRICE.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.basis.name",detail:"formula.functionList.ODDLPRICE.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDLYIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDLYIELD.description",abstract:"formula.functionList.ODDLYIELD.abstract",functionParameter:[{name:"formula.functionList.ODDLYIELD.functionParameter.settlement.name",detail:"formula.functionList.ODDLYIELD.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.maturity.name",detail:"formula.functionList.ODDLYIELD.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.lastInterest.name",detail:"formula.functionList.ODDLYIELD.functionParameter.lastInterest.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.rate.name",detail:"formula.functionList.ODDLYIELD.functionParameter.rate.detail",example:"0.0575",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.pr.name",detail:"formula.functionList.ODDLYIELD.functionParameter.pr.detail",example:"84.5",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.redemption.name",detail:"formula.functionList.ODDLYIELD.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.frequency.name",detail:"formula.functionList.ODDLYIELD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.basis.name",detail:"formula.functionList.ODDLYIELD.functionParameter.basis.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PDURATION,functionType:t.FunctionType.Financial,description:"formula.functionList.PDURATION.description",abstract:"formula.functionList.PDURATION.abstract",functionParameter:[{name:"formula.functionList.PDURATION.functionParameter.rate.name",detail:"formula.functionList.PDURATION.functionParameter.rate.detail",example:"0.025",require:1,repeat:0},{name:"formula.functionList.PDURATION.functionParameter.pv.name",detail:"formula.functionList.PDURATION.functionParameter.pv.detail",example:"2000",require:1,repeat:0},{name:"formula.functionList.PDURATION.functionParameter.fv.name",detail:"formula.functionList.PDURATION.functionParameter.fv.detail",example:"2200",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PMT,functionType:t.FunctionType.Financial,description:"formula.functionList.PMT.description",abstract:"formula.functionList.PMT.abstract",functionParameter:[{name:"formula.functionList.PMT.functionParameter.rate.name",detail:"formula.functionList.PMT.functionParameter.rate.detail",example:"0.08/12",require:1,repeat:0},{name:"formula.functionList.PMT.functionParameter.nper.name",detail:"formula.functionList.PMT.functionParameter.nper.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.PMT.functionParameter.pv.name",detail:"formula.functionList.PMT.functionParameter.pv.detail",example:"10000",require:1,repeat:0},{name:"formula.functionList.PMT.functionParameter.fv.name",detail:"formula.functionList.PMT.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.PMT.functionParameter.type.name",detail:"formula.functionList.PMT.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.PPMT.description",abstract:"formula.functionList.PPMT.abstract",functionParameter:[{name:"formula.functionList.PPMT.functionParameter.rate.name",detail:"formula.functionList.PPMT.functionParameter.rate.detail",example:"0.1/12",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.per.name",detail:"formula.functionList.PPMT.functionParameter.per.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.nper.name",detail:"formula.functionList.PPMT.functionParameter.nper.detail",example:"3*12",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.pv.name",detail:"formula.functionList.PPMT.functionParameter.pv.detail",example:"80000",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.fv.name",detail:"formula.functionList.PPMT.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.PPMT.functionParameter.type.name",detail:"formula.functionList.PPMT.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.PRICE.description",abstract:"formula.functionList.PRICE.abstract",functionParameter:[{name:"formula.functionList.PRICE.functionParameter.settlement.name",detail:"formula.functionList.PRICE.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.maturity.name",detail:"formula.functionList.PRICE.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.rate.name",detail:"formula.functionList.PRICE.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.yld.name",detail:"formula.functionList.PRICE.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.redemption.name",detail:"formula.functionList.PRICE.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.frequency.name",detail:"formula.functionList.PRICE.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.basis.name",detail:"formula.functionList.PRICE.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PRICEDISC,functionType:t.FunctionType.Financial,description:"formula.functionList.PRICEDISC.description",abstract:"formula.functionList.PRICEDISC.abstract",functionParameter:[{name:"formula.functionList.PRICEDISC.functionParameter.settlement.name",detail:"formula.functionList.PRICEDISC.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.maturity.name",detail:"formula.functionList.PRICEDISC.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.discount.name",detail:"formula.functionList.PRICEDISC.functionParameter.discount.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.redemption.name",detail:"formula.functionList.PRICEDISC.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.basis.name",detail:"formula.functionList.PRICEDISC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PRICEMAT,functionType:t.FunctionType.Financial,description:"formula.functionList.PRICEMAT.description",abstract:"formula.functionList.PRICEMAT.abstract",functionParameter:[{name:"formula.functionList.PRICEMAT.functionParameter.settlement.name",detail:"formula.functionList.PRICEMAT.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.maturity.name",detail:"formula.functionList.PRICEMAT.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.issue.name",detail:"formula.functionList.PRICEMAT.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.rate.name",detail:"formula.functionList.PRICEMAT.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.yld.name",detail:"formula.functionList.PRICEMAT.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.basis.name",detail:"formula.functionList.PRICEMAT.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PV,functionType:t.FunctionType.Financial,description:"formula.functionList.PV.description",abstract:"formula.functionList.PV.abstract",functionParameter:[{name:"formula.functionList.PV.functionParameter.rate.name",detail:"formula.functionList.PV.functionParameter.rate.detail",example:"0.02",require:1,repeat:0},{name:"formula.functionList.PV.functionParameter.nper.name",detail:"formula.functionList.PV.functionParameter.nper.detail",example:"12",require:1,repeat:0},{name:"formula.functionList.PV.functionParameter.pmt.name",detail:"formula.functionList.PV.functionParameter.pmt.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.PV.functionParameter.fv.name",detail:"formula.functionList.PV.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.PV.functionParameter.type.name",detail:"formula.functionList.PV.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.RATE,functionType:t.FunctionType.Financial,description:"formula.functionList.RATE.description",abstract:"formula.functionList.RATE.abstract",functionParameter:[{name:"formula.functionList.RATE.functionParameter.nper.name",detail:"formula.functionList.RATE.functionParameter.nper.detail",example:"4*12",require:1,repeat:0},{name:"formula.functionList.RATE.functionParameter.pmt.name",detail:"formula.functionList.RATE.functionParameter.pmt.detail",example:"-200",require:1,repeat:0},{name:"formula.functionList.RATE.functionParameter.pv.name",detail:"formula.functionList.RATE.functionParameter.pv.detail",example:"8000",require:1,repeat:0},{name:"formula.functionList.RATE.functionParameter.fv.name",detail:"formula.functionList.RATE.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.RATE.functionParameter.type.name",detail:"formula.functionList.RATE.functionParameter.type.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.RATE.functionParameter.guess.name",detail:"formula.functionList.RATE.functionParameter.guess.detail",example:"0.1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.RECEIVED,functionType:t.FunctionType.Financial,description:"formula.functionList.RECEIVED.description",abstract:"formula.functionList.RECEIVED.abstract",functionParameter:[{name:"formula.functionList.RECEIVED.functionParameter.settlement.name",detail:"formula.functionList.RECEIVED.functionParameter.settlement.detail",example:'"2008-2-15"',require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.maturity.name",detail:"formula.functionList.RECEIVED.functionParameter.maturity.detail",example:'"2008-3-15"',require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.investment.name",detail:"formula.functionList.RECEIVED.functionParameter.investment.detail",example:"10000000",require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.discount.name",detail:"formula.functionList.RECEIVED.functionParameter.discount.detail",example:"0.0575",require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.basis.name",detail:"formula.functionList.RECEIVED.functionParameter.basis.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.RRI,functionType:t.FunctionType.Financial,description:"formula.functionList.RRI.description",abstract:"formula.functionList.RRI.abstract",functionParameter:[{name:"formula.functionList.RRI.functionParameter.nper.name",detail:"formula.functionList.RRI.functionParameter.nper.detail",example:"96",require:1,repeat:0},{name:"formula.functionList.RRI.functionParameter.pv.name",detail:"formula.functionList.RRI.functionParameter.pv.detail",example:"10000",require:1,repeat:0},{name:"formula.functionList.RRI.functionParameter.fv.name",detail:"formula.functionList.RRI.functionParameter.fv.detail",example:"11000",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.SLN,functionType:t.FunctionType.Financial,description:"formula.functionList.SLN.description",abstract:"formula.functionList.SLN.abstract",functionParameter:[{name:"formula.functionList.SLN.functionParameter.cost.name",detail:"formula.functionList.SLN.functionParameter.cost.detail",example:"300000",require:1,repeat:0},{name:"formula.functionList.SLN.functionParameter.salvage.name",detail:"formula.functionList.SLN.functionParameter.salvage.detail",example:"75000",require:1,repeat:0},{name:"formula.functionList.SLN.functionParameter.life.name",detail:"formula.functionList.SLN.functionParameter.life.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.SYD,functionType:t.FunctionType.Financial,description:"formula.functionList.SYD.description",abstract:"formula.functionList.SYD.abstract",functionParameter:[{name:"formula.functionList.SYD.functionParameter.cost.name",detail:"formula.functionList.SYD.functionParameter.cost.detail",example:"300000",require:1,repeat:0},{name:"formula.functionList.SYD.functionParameter.salvage.name",detail:"formula.functionList.SYD.functionParameter.salvage.detail",example:"75000",require:1,repeat:0},{name:"formula.functionList.SYD.functionParameter.life.name",detail:"formula.functionList.SYD.functionParameter.life.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.SYD.functionParameter.per.name",detail:"formula.functionList.SYD.functionParameter.per.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.TBILLEQ,functionType:t.FunctionType.Financial,description:"formula.functionList.TBILLEQ.description",abstract:"formula.functionList.TBILLEQ.abstract",functionParameter:[{name:"formula.functionList.TBILLEQ.functionParameter.settlement.name",detail:"formula.functionList.TBILLEQ.functionParameter.settlement.detail",example:'"2008-3-31"',require:1,repeat:0},{name:"formula.functionList.TBILLEQ.functionParameter.maturity.name",detail:"formula.functionList.TBILLEQ.functionParameter.maturity.detail",example:'"2008-6-1"',require:1,repeat:0},{name:"formula.functionList.TBILLEQ.functionParameter.discount.name",detail:"formula.functionList.TBILLEQ.functionParameter.discount.detail",example:"0.0914",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.TBILLPRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.TBILLPRICE.description",abstract:"formula.functionList.TBILLPRICE.abstract",functionParameter:[{name:"formula.functionList.TBILLPRICE.functionParameter.settlement.name",detail:"formula.functionList.TBILLPRICE.functionParameter.settlement.detail",example:'"2008-3-31"',require:1,repeat:0},{name:"formula.functionList.TBILLPRICE.functionParameter.maturity.name",detail:"formula.functionList.TBILLPRICE.functionParameter.maturity.detail",example:'"2008-6-1"',require:1,repeat:0},{name:"formula.functionList.TBILLPRICE.functionParameter.discount.name",detail:"formula.functionList.TBILLPRICE.functionParameter.discount.detail",example:"0.0914",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.TBILLYIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.TBILLYIELD.description",abstract:"formula.functionList.TBILLYIELD.abstract",functionParameter:[{name:"formula.functionList.TBILLYIELD.functionParameter.settlement.name",detail:"formula.functionList.TBILLYIELD.functionParameter.settlement.detail",example:'"2008-3-31"',require:1,repeat:0},{name:"formula.functionList.TBILLYIELD.functionParameter.maturity.name",detail:"formula.functionList.TBILLYIELD.functionParameter.maturity.detail",example:'"2008-6-1"',require:1,repeat:0},{name:"formula.functionList.TBILLYIELD.functionParameter.pr.name",detail:"formula.functionList.TBILLYIELD.functionParameter.pr.detail",example:"98.45",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.VDB,functionType:t.FunctionType.Financial,description:"formula.functionList.VDB.description",abstract:"formula.functionList.VDB.abstract",functionParameter:[{name:"formula.functionList.VDB.functionParameter.cost.name",detail:"formula.functionList.VDB.functionParameter.cost.detail",example:"2400",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.salvage.name",detail:"formula.functionList.VDB.functionParameter.salvage.detail",example:"300",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.life.name",detail:"formula.functionList.VDB.functionParameter.life.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.startPeriod.name",detail:"formula.functionList.VDB.functionParameter.startPeriod.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.endPeriod.name",detail:"formula.functionList.VDB.functionParameter.endPeriod.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.factor.name",detail:"formula.functionList.VDB.functionParameter.factor.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.VDB.functionParameter.noSwitch.name",detail:"formula.functionList.VDB.functionParameter.noSwitch.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.XIRR,functionType:t.FunctionType.Financial,description:"formula.functionList.XIRR.description",abstract:"formula.functionList.XIRR.abstract",functionParameter:[{name:"formula.functionList.XIRR.functionParameter.values.name",detail:"formula.functionList.XIRR.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.XIRR.functionParameter.dates.name",detail:"formula.functionList.XIRR.functionParameter.dates.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.XIRR.functionParameter.guess.name",detail:"formula.functionList.XIRR.functionParameter.guess.detail",example:"0.1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.XNPV,functionType:t.FunctionType.Financial,description:"formula.functionList.XNPV.description",abstract:"formula.functionList.XNPV.abstract",functionParameter:[{name:"formula.functionList.XNPV.functionParameter.rate.name",detail:"formula.functionList.XNPV.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.XNPV.functionParameter.values.name",detail:"formula.functionList.XNPV.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.XNPV.functionParameter.dates.name",detail:"formula.functionList.XNPV.functionParameter.dates.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.YIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.YIELD.description",abstract:"formula.functionList.YIELD.abstract",functionParameter:[{name:"formula.functionList.YIELD.functionParameter.settlement.name",detail:"formula.functionList.YIELD.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.maturity.name",detail:"formula.functionList.YIELD.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.rate.name",detail:"formula.functionList.YIELD.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.pr.name",detail:"formula.functionList.YIELD.functionParameter.pr.detail",example:"98.45",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.redemption.name",detail:"formula.functionList.YIELD.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.frequency.name",detail:"formula.functionList.YIELD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.basis.name",detail:"formula.functionList.YIELD.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.YIELDDISC,functionType:t.FunctionType.Financial,description:"formula.functionList.YIELDDISC.description",abstract:"formula.functionList.YIELDDISC.abstract",functionParameter:[{name:"formula.functionList.YIELDDISC.functionParameter.settlement.name",detail:"formula.functionList.YIELDDISC.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.maturity.name",detail:"formula.functionList.YIELDDISC.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.pr.name",detail:"formula.functionList.YIELDDISC.functionParameter.pr.detail",example:"98.45",require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.redemption.name",detail:"formula.functionList.YIELDDISC.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.basis.name",detail:"formula.functionList.YIELDDISC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.YIELDMAT,functionType:t.FunctionType.Financial,description:"formula.functionList.YIELDMAT.description",abstract:"formula.functionList.YIELDMAT.abstract",functionParameter:[{name:"formula.functionList.YIELDMAT.functionParameter.settlement.name",detail:"formula.functionList.YIELDMAT.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.maturity.name",detail:"formula.functionList.YIELDMAT.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.issue.name",detail:"formula.functionList.YIELDMAT.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.rate.name",detail:"formula.functionList.YIELDMAT.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.pr.name",detail:"formula.functionList.YIELDMAT.functionParameter.pr.detail",example:"98.45",require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.basis.name",detail:"formula.functionList.YIELDMAT.functionParameter.basis.detail",example:"1",require:0,repeat:0}]}],Ye=[{functionName:t.FUNCTION_NAMES_INFORMATION.CELL,functionType:t.FunctionType.Information,description:"formula.functionList.CELL.description",abstract:"formula.functionList.CELL.abstract",functionParameter:[{name:"formula.functionList.CELL.functionParameter.infoType.name",detail:"formula.functionList.CELL.functionParameter.infoType.detail",example:'"type"',require:1,repeat:0},{name:"formula.functionList.CELL.functionParameter.reference.name",detail:"formula.functionList.CELL.functionParameter.reference.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ERROR_TYPE,functionType:t.FunctionType.Information,description:"formula.functionList.ERROR_TYPE.description",abstract:"formula.functionList.ERROR_TYPE.abstract",functionParameter:[{name:"formula.functionList.ERROR_TYPE.functionParameter.errorVal.name",detail:"formula.functionList.ERROR_TYPE.functionParameter.errorVal.detail",example:'"#NULL!"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.INFO,functionType:t.FunctionType.Information,description:"formula.functionList.INFO.description",abstract:"formula.functionList.INFO.abstract",functionParameter:[{name:"formula.functionList.INFO.functionParameter.number1.name",detail:"formula.functionList.INFO.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.INFO.functionParameter.number2.name",detail:"formula.functionList.INFO.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISBETWEEN,functionType:t.FunctionType.Information,description:"formula.functionList.ISBETWEEN.description",abstract:"formula.functionList.ISBETWEEN.abstract",functionParameter:[{name:"formula.functionList.ISBETWEEN.functionParameter.valueToCompare.name",detail:"formula.functionList.ISBETWEEN.functionParameter.valueToCompare.detail",example:"7.9",require:1,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.lowerValue.name",detail:"formula.functionList.ISBETWEEN.functionParameter.lowerValue.detail",example:"1.2",require:1,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.upperValue.name",detail:"formula.functionList.ISBETWEEN.functionParameter.upperValue.detail",example:"12.45",require:1,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.lowerValueIsInclusive.name",detail:"formula.functionList.ISBETWEEN.functionParameter.lowerValueIsInclusive.detail",example:"true",require:0,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.upperValueIsInclusive.name",detail:"formula.functionList.ISBETWEEN.functionParameter.upperValueIsInclusive.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISBLANK,functionType:t.FunctionType.Information,description:"formula.functionList.ISBLANK.description",abstract:"formula.functionList.ISBLANK.abstract",functionParameter:[{name:"formula.functionList.ISBLANK.functionParameter.value.name",detail:"formula.functionList.ISBLANK.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISDATE,functionType:t.FunctionType.Information,description:"formula.functionList.ISDATE.description",abstract:"formula.functionList.ISDATE.abstract",functionParameter:[{name:"formula.functionList.ISDATE.functionParameter.value.name",detail:"formula.functionList.ISDATE.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISEMAIL,functionType:t.FunctionType.Information,description:"formula.functionList.ISEMAIL.description",abstract:"formula.functionList.ISEMAIL.abstract",functionParameter:[{name:"formula.functionList.ISEMAIL.functionParameter.value.name",detail:"formula.functionList.ISEMAIL.functionParameter.value.detail",example:'"developer@univer.ai"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISERR,functionType:t.FunctionType.Information,description:"formula.functionList.ISERR.description",abstract:"formula.functionList.ISERR.abstract",functionParameter:[{name:"formula.functionList.ISERR.functionParameter.value.name",detail:"formula.functionList.ISERR.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISERROR,functionType:t.FunctionType.Information,description:"formula.functionList.ISERROR.description",abstract:"formula.functionList.ISERROR.abstract",functionParameter:[{name:"formula.functionList.ISERROR.functionParameter.value.name",detail:"formula.functionList.ISERROR.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISEVEN,functionType:t.FunctionType.Information,description:"formula.functionList.ISEVEN.description",abstract:"formula.functionList.ISEVEN.abstract",functionParameter:[{name:"formula.functionList.ISEVEN.functionParameter.value.name",detail:"formula.functionList.ISEVEN.functionParameter.value.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISFORMULA,functionType:t.FunctionType.Information,description:"formula.functionList.ISFORMULA.description",abstract:"formula.functionList.ISFORMULA.abstract",functionParameter:[{name:"formula.functionList.ISFORMULA.functionParameter.reference.name",detail:"formula.functionList.ISFORMULA.functionParameter.reference.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISLOGICAL,functionType:t.FunctionType.Information,description:"formula.functionList.ISLOGICAL.description",abstract:"formula.functionList.ISLOGICAL.abstract",functionParameter:[{name:"formula.functionList.ISLOGICAL.functionParameter.value.name",detail:"formula.functionList.ISLOGICAL.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISNA,functionType:t.FunctionType.Information,description:"formula.functionList.ISNA.description",abstract:"formula.functionList.ISNA.abstract",functionParameter:[{name:"formula.functionList.ISNA.functionParameter.value.name",detail:"formula.functionList.ISNA.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISNONTEXT,functionType:t.FunctionType.Information,description:"formula.functionList.ISNONTEXT.description",abstract:"formula.functionList.ISNONTEXT.abstract",functionParameter:[{name:"formula.functionList.ISNONTEXT.functionParameter.value.name",detail:"formula.functionList.ISNONTEXT.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISNUMBER,functionType:t.FunctionType.Information,description:"formula.functionList.ISNUMBER.description",abstract:"formula.functionList.ISNUMBER.abstract",functionParameter:[{name:"formula.functionList.ISNUMBER.functionParameter.value.name",detail:"formula.functionList.ISNUMBER.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISODD,functionType:t.FunctionType.Information,description:"formula.functionList.ISODD.description",abstract:"formula.functionList.ISODD.abstract",functionParameter:[{name:"formula.functionList.ISODD.functionParameter.value.name",detail:"formula.functionList.ISODD.functionParameter.value.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISOMITTED,functionType:t.FunctionType.Information,description:"formula.functionList.ISOMITTED.description",abstract:"formula.functionList.ISOMITTED.abstract",functionParameter:[{name:"formula.functionList.ISOMITTED.functionParameter.number1.name",detail:"formula.functionList.ISOMITTED.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.ISOMITTED.functionParameter.number2.name",detail:"formula.functionList.ISOMITTED.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISREF,functionType:t.FunctionType.Information,description:"formula.functionList.ISREF.description",abstract:"formula.functionList.ISREF.abstract",functionParameter:[{name:"formula.functionList.ISREF.functionParameter.value.name",detail:"formula.functionList.ISREF.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISTEXT,functionType:t.FunctionType.Information,description:"formula.functionList.ISTEXT.description",abstract:"formula.functionList.ISTEXT.abstract",functionParameter:[{name:"formula.functionList.ISTEXT.functionParameter.value.name",detail:"formula.functionList.ISTEXT.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISURL,functionType:t.FunctionType.Information,description:"formula.functionList.ISURL.description",abstract:"formula.functionList.ISURL.abstract",functionParameter:[{name:"formula.functionList.ISURL.functionParameter.value.name",detail:"formula.functionList.ISURL.functionParameter.value.detail",example:'"univer.ai"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.N,functionType:t.FunctionType.Information,description:"formula.functionList.N.description",abstract:"formula.functionList.N.abstract",functionParameter:[{name:"formula.functionList.N.functionParameter.value.name",detail:"formula.functionList.N.functionParameter.value.detail",example:"7",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.NA,functionType:t.FunctionType.Information,description:"formula.functionList.NA.description",abstract:"formula.functionList.NA.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_INFORMATION.SHEET,functionType:t.FunctionType.Information,description:"formula.functionList.SHEET.description",abstract:"formula.functionList.SHEET.abstract",functionParameter:[{name:"formula.functionList.SHEET.functionParameter.value.name",detail:"formula.functionList.SHEET.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.SHEETS,functionType:t.FunctionType.Information,description:"formula.functionList.SHEETS.description",abstract:"formula.functionList.SHEETS.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_INFORMATION.TYPE,functionType:t.FunctionType.Information,description:"formula.functionList.TYPE.description",abstract:"formula.functionList.TYPE.abstract",functionParameter:[{name:"formula.functionList.TYPE.functionParameter.value.name",detail:"formula.functionList.TYPE.functionParameter.value.detail",example:"A2",require:1,repeat:0}]}],Xe=[{functionName:t.FUNCTION_NAMES_LOGICAL.AND,functionType:t.FunctionType.Logical,description:"formula.functionList.AND.description",abstract:"formula.functionList.AND.abstract",functionParameter:[{name:"formula.functionList.AND.functionParameter.logical1.name",detail:"formula.functionList.AND.functionParameter.logical1.detail",example:"A1=1",require:1,repeat:0},{name:"formula.functionList.AND.functionParameter.logical2.name",detail:"formula.functionList.AND.functionParameter.logical2.detail",example:"A2=2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.BYCOL,functionType:t.FunctionType.Logical,description:"formula.functionList.BYCOL.description",abstract:"formula.functionList.BYCOL.abstract",functionParameter:[{name:"formula.functionList.BYCOL.functionParameter.array.name",detail:"formula.functionList.BYCOL.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.BYCOL.functionParameter.lambda.name",detail:"formula.functionList.BYCOL.functionParameter.lambda.detail",example:"LAMBDA(array, MAX(array))",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.BYROW,functionType:t.FunctionType.Logical,description:"formula.functionList.BYROW.description",abstract:"formula.functionList.BYROW.abstract",functionParameter:[{name:"formula.functionList.BYROW.functionParameter.array.name",detail:"formula.functionList.BYROW.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.BYROW.functionParameter.lambda.name",detail:"formula.functionList.BYROW.functionParameter.lambda.detail",example:"LAMBDA(array, MAX(array))",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.FALSE,functionType:t.FunctionType.Logical,description:"formula.functionList.FALSE.description",abstract:"formula.functionList.FALSE.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_LOGICAL.IF,functionType:t.FunctionType.Logical,description:"formula.functionList.IF.description",abstract:"formula.functionList.IF.abstract",functionParameter:[{name:"formula.functionList.IF.functionParameter.logicalTest.name",detail:"formula.functionList.IF.functionParameter.logicalTest.detail",example:'A2 = "foo"',require:1,repeat:0},{name:"formula.functionList.IF.functionParameter.valueIfTrue.name",detail:"formula.functionList.IF.functionParameter.valueIfTrue.detail",example:'"A2 is foo"',require:1,repeat:0},{name:"formula.functionList.IF.functionParameter.valueIfFalse.name",detail:"formula.functionList.IF.functionParameter.valueIfFalse.detail",example:'"A2 is not foo"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.IFERROR,functionType:t.FunctionType.Logical,description:"formula.functionList.IFERROR.description",abstract:"formula.functionList.IFERROR.abstract",functionParameter:[{name:"formula.functionList.IFERROR.functionParameter.value.name",detail:"formula.functionList.IFERROR.functionParameter.value.detail",example:"A2/B2",require:1,repeat:0},{name:"formula.functionList.IFERROR.functionParameter.valueIfError.name",detail:"formula.functionList.IFERROR.functionParameter.valueIfError.detail",example:"Error in calculation",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.IFNA,functionType:t.FunctionType.Logical,description:"formula.functionList.IFNA.description",abstract:"formula.functionList.IFNA.abstract",functionParameter:[{name:"formula.functionList.IFNA.functionParameter.value.name",detail:"formula.functionList.IFNA.functionParameter.value.detail",example:"VLOOKUP(C3,C6:D11,2,FALSE)",require:1,repeat:0},{name:"formula.functionList.IFNA.functionParameter.valueIfNa.name",detail:"formula.functionList.IFNA.functionParameter.valueIfNa.detail",example:'"Not Found"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.IFS,functionType:t.FunctionType.Logical,description:"formula.functionList.IFS.description",abstract:"formula.functionList.IFS.abstract",functionParameter:[{name:"formula.functionList.IFS.functionParameter.logicalTest1.name",detail:"formula.functionList.IFS.functionParameter.logicalTest1.detail",example:'A2 = "foo"',require:1,repeat:0},{name:"formula.functionList.IFS.functionParameter.valueIfTrue1.name",detail:"formula.functionList.IFS.functionParameter.valueIfTrue1.detail",example:'"A2 is foo"',require:1,repeat:0},{name:"formula.functionList.IFS.functionParameter.logicalTest2.name",detail:"formula.functionList.IFS.functionParameter.logicalTest2.detail",example:"F2=1",require:0,repeat:1},{name:"formula.functionList.IFS.functionParameter.valueIfTrue2.name",detail:"formula.functionList.IFS.functionParameter.valueIfTrue2.detail",example:"D2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.LAMBDA,functionType:t.FunctionType.Logical,description:"formula.functionList.LAMBDA.description",abstract:"formula.functionList.LAMBDA.abstract",functionParameter:[{name:"formula.functionList.LAMBDA.functionParameter.parameter.name",detail:"formula.functionList.LAMBDA.functionParameter.parameter.detail",example:"[x, y, …,]",require:0,repeat:1},{name:"formula.functionList.LAMBDA.functionParameter.calculation.name",detail:"formula.functionList.LAMBDA.functionParameter.calculation.detail",example:"x+y",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.LET,functionType:t.FunctionType.Logical,description:"formula.functionList.LET.description",abstract:"formula.functionList.LET.abstract",functionParameter:[{name:"formula.functionList.LET.functionParameter.name1.name",detail:"formula.functionList.LET.functionParameter.name1.detail",example:"x",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.nameValue1.name",detail:"formula.functionList.LET.functionParameter.nameValue1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.calculationOrName2.name",detail:"formula.functionList.LET.functionParameter.calculationOrName2.detail",example:"y",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.nameValue2.name",detail:"formula.functionList.LET.functionParameter.nameValue2.detail",example:"6",require:0,repeat:1},{name:"formula.functionList.LET.functionParameter.calculationOrName3.name",detail:"formula.functionList.LET.functionParameter.calculationOrName3.detail",example:"SUM(x,y)",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.MAKEARRAY,aliasFunctionName:"formula.functionList.MAKEARRAY.aliasFunctionName",functionType:t.FunctionType.Logical,description:"formula.functionList.MAKEARRAY.description",abstract:"formula.functionList.MAKEARRAY.abstract",functionParameter:[{name:"formula.functionList.MAKEARRAY.functionParameter.number1.name",detail:"formula.functionList.MAKEARRAY.functionParameter.number1.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.MAKEARRAY.functionParameter.number2.name",detail:"formula.functionList.MAKEARRAY.functionParameter.number2.detail",example:"7",require:1,repeat:0},{name:"formula.functionList.MAKEARRAY.functionParameter.value3.name",detail:"formula.functionList.MAKEARRAY.functionParameter.value3.detail",example:"LAMBDA(r,c, r*c)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.MAP,functionType:t.FunctionType.Logical,description:"formula.functionList.MAP.description",abstract:"formula.functionList.MAP.abstract",functionParameter:[{name:"formula.functionList.MAP.functionParameter.array1.name",detail:"formula.functionList.MAP.functionParameter.array1.detail",example:"D2:D11",require:1,repeat:0},{name:"formula.functionList.MAP.functionParameter.array2.name",detail:"formula.functionList.MAP.functionParameter.array2.detail",example:"E2:E11",require:0,repeat:1},{name:"formula.functionList.MAP.functionParameter.lambda.name",detail:"formula.functionList.MAP.functionParameter.lambda.detail",example:'LAMBDA(s,c,AND(s="Large",c="Red"))',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.NOT,functionType:t.FunctionType.Logical,description:"formula.functionList.NOT.description",abstract:"formula.functionList.NOT.abstract",functionParameter:[{name:"formula.functionList.NOT.functionParameter.logical.name",detail:"formula.functionList.NOT.functionParameter.logical.detail",example:"A2>100",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.OR,functionType:t.FunctionType.Logical,description:"formula.functionList.OR.description",abstract:"formula.functionList.OR.abstract",functionParameter:[{name:"formula.functionList.OR.functionParameter.logical1.name",detail:"formula.functionList.OR.functionParameter.logical1.detail",example:"A1=1",require:1,repeat:0},{name:"formula.functionList.OR.functionParameter.logical2.name",detail:"formula.functionList.OR.functionParameter.logical2.detail",example:"A2=2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.REDUCE,functionType:t.FunctionType.Logical,description:"formula.functionList.REDUCE.description",abstract:"formula.functionList.REDUCE.abstract",functionParameter:[{name:"formula.functionList.REDUCE.functionParameter.initialValue.name",detail:"formula.functionList.REDUCE.functionParameter.initialValue.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.REDUCE.functionParameter.array.name",detail:"formula.functionList.REDUCE.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.REDUCE.functionParameter.lambda.name",detail:"formula.functionList.REDUCE.functionParameter.lambda.detail",example:"LAMBDA(a,b,a+b^2)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.SCAN,functionType:t.FunctionType.Logical,description:"formula.functionList.SCAN.description",abstract:"formula.functionList.SCAN.abstract",functionParameter:[{name:"formula.functionList.SCAN.functionParameter.initialValue.name",detail:"formula.functionList.SCAN.functionParameter.initialValue.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SCAN.functionParameter.array.name",detail:"formula.functionList.SCAN.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.SCAN.functionParameter.lambda.name",detail:"formula.functionList.SCAN.functionParameter.lambda.detail",example:"LAMBDA(a,b,a+b^2)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.SWITCH,functionType:t.FunctionType.Logical,description:"formula.functionList.SWITCH.description",abstract:"formula.functionList.SWITCH.abstract",functionParameter:[{name:"formula.functionList.SWITCH.functionParameter.expression.name",detail:"formula.functionList.SWITCH.functionParameter.expression.detail",example:"WEEKDAY(A2)",require:1,repeat:0},{name:"formula.functionList.SWITCH.functionParameter.value1.name",detail:"formula.functionList.SWITCH.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SWITCH.functionParameter.result1.name",detail:"formula.functionList.SWITCH.functionParameter.result1.detail",example:'"Sunday"',require:1,repeat:0},{name:"formula.functionList.SWITCH.functionParameter.defaultOrValue2.name",detail:"formula.functionList.SWITCH.functionParameter.defaultOrValue2.detail",example:"2",require:0,repeat:1},{name:"formula.functionList.SWITCH.functionParameter.result2.name",detail:"formula.functionList.SWITCH.functionParameter.result2.detail",example:'"Monday"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.TRUE,functionType:t.FunctionType.Logical,description:"formula.functionList.TRUE.description",abstract:"formula.functionList.TRUE.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_LOGICAL.XOR,functionType:t.FunctionType.Logical,description:"formula.functionList.XOR.description",abstract:"formula.functionList.XOR.abstract",functionParameter:[{name:"formula.functionList.XOR.functionParameter.logical1.name",detail:"formula.functionList.XOR.functionParameter.logical1.detail",example:"3>0",require:1,repeat:0},{name:"formula.functionList.XOR.functionParameter.logical2.name",detail:"formula.functionList.XOR.functionParameter.logical2.detail",example:"2<9",require:0,repeat:1}]}],we=[{functionName:t.FUNCTION_NAMES_LOOKUP.ADDRESS,functionType:t.FunctionType.Lookup,description:"formula.functionList.ADDRESS.description",abstract:"formula.functionList.ADDRESS.abstract",functionParameter:[{name:"formula.functionList.ADDRESS.functionParameter.row_num.name",detail:"formula.functionList.ADDRESS.functionParameter.row_num.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.column_num.name",detail:"formula.functionList.ADDRESS.functionParameter.column_num.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.abs_num.name",detail:"formula.functionList.ADDRESS.functionParameter.abs_num.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.a1.name",detail:"formula.functionList.ADDRESS.functionParameter.a1.detail",example:"TRUE",require:0,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.sheet_text.name",detail:"formula.functionList.ADDRESS.functionParameter.sheet_text.detail",example:'"Sheet2"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.AREAS,functionType:t.FunctionType.Lookup,description:"formula.functionList.AREAS.description",abstract:"formula.functionList.AREAS.abstract",functionParameter:[{name:"formula.functionList.AREAS.functionParameter.reference.name",detail:"formula.functionList.AREAS.functionParameter.reference.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.CHOOSE,functionType:t.FunctionType.Lookup,description:"formula.functionList.CHOOSE.description",abstract:"formula.functionList.CHOOSE.abstract",functionParameter:[{name:"formula.functionList.CHOOSE.functionParameter.indexNum.name",detail:"formula.functionList.CHOOSE.functionParameter.indexNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHOOSE.functionParameter.value1.name",detail:"formula.functionList.CHOOSE.functionParameter.value1.detail",example:'"Hello"',require:1,repeat:0},{name:"formula.functionList.CHOOSE.functionParameter.value2.name",detail:"formula.functionList.CHOOSE.functionParameter.value2.detail",example:'"Univer"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.CHOOSECOLS,functionType:t.FunctionType.Lookup,description:"formula.functionList.CHOOSECOLS.description",abstract:"formula.functionList.CHOOSECOLS.abstract",functionParameter:[{name:"formula.functionList.CHOOSECOLS.functionParameter.array.name",detail:"formula.functionList.CHOOSECOLS.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.CHOOSECOLS.functionParameter.colNum1.name",detail:"formula.functionList.CHOOSECOLS.functionParameter.colNum1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHOOSECOLS.functionParameter.colNum2.name",detail:"formula.functionList.CHOOSECOLS.functionParameter.colNum2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.CHOOSEROWS,functionType:t.FunctionType.Lookup,description:"formula.functionList.CHOOSEROWS.description",abstract:"formula.functionList.CHOOSEROWS.abstract",functionParameter:[{name:"formula.functionList.CHOOSEROWS.functionParameter.array.name",detail:"formula.functionList.CHOOSEROWS.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.CHOOSEROWS.functionParameter.rowNum1.name",detail:"formula.functionList.CHOOSEROWS.functionParameter.rowNum1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHOOSEROWS.functionParameter.rowNum2.name",detail:"formula.functionList.CHOOSEROWS.functionParameter.rowNum2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.COLUMN,functionType:t.FunctionType.Lookup,description:"formula.functionList.COLUMN.description",abstract:"formula.functionList.COLUMN.abstract",functionParameter:[{name:"formula.functionList.COLUMN.functionParameter.reference.name",detail:"formula.functionList.COLUMN.functionParameter.reference.detail",example:"A1:A20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.COLUMNS,functionType:t.FunctionType.Lookup,description:"formula.functionList.COLUMNS.description",abstract:"formula.functionList.COLUMNS.abstract",functionParameter:[{name:"formula.functionList.COLUMNS.functionParameter.array.name",detail:"formula.functionList.COLUMNS.functionParameter.array.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.DROP,functionType:t.FunctionType.Lookup,description:"formula.functionList.DROP.description",abstract:"formula.functionList.DROP.abstract",functionParameter:[{name:"formula.functionList.DROP.functionParameter.array.name",detail:"formula.functionList.DROP.functionParameter.array.detail",example:"A2:C4",require:1,repeat:0},{name:"formula.functionList.DROP.functionParameter.rows.name",detail:"formula.functionList.DROP.functionParameter.rows.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.DROP.functionParameter.columns.name",detail:"formula.functionList.DROP.functionParameter.columns.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.EXPAND,functionType:t.FunctionType.Lookup,description:"formula.functionList.EXPAND.description",abstract:"formula.functionList.EXPAND.abstract",functionParameter:[{name:"formula.functionList.EXPAND.functionParameter.array.name",detail:"formula.functionList.EXPAND.functionParameter.array.detail",example:"A2",require:1,repeat:0},{name:"formula.functionList.EXPAND.functionParameter.rows.name",detail:"formula.functionList.EXPAND.functionParameter.rows.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.EXPAND.functionParameter.columns.name",detail:"formula.functionList.EXPAND.functionParameter.columns.detail",example:"3",require:0,repeat:0},{name:"formula.functionList.EXPAND.functionParameter.padWith.name",detail:"formula.functionList.EXPAND.functionParameter.padWith.detail",example:'"-"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.FILTER,functionType:t.FunctionType.Lookup,description:"formula.functionList.FILTER.description",abstract:"formula.functionList.FILTER.abstract",functionParameter:[{name:"formula.functionList.FILTER.functionParameter.array.name",detail:"formula.functionList.FILTER.functionParameter.array.detail",example:"A5:D20",require:1,repeat:0},{name:"formula.functionList.FILTER.functionParameter.include.name",detail:"formula.functionList.FILTER.functionParameter.include.detail",example:'(C5:C20="Apple")*(A5:A20="East")',require:1,repeat:0},{name:"formula.functionList.FILTER.functionParameter.ifEmpty.name",detail:"formula.functionList.FILTER.functionParameter.ifEmpty.detail",example:'""',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.FORMULATEXT,functionType:t.FunctionType.Lookup,description:"formula.functionList.FORMULATEXT.description",abstract:"formula.functionList.FORMULATEXT.abstract",functionParameter:[{name:"formula.functionList.FORMULATEXT.functionParameter.reference.name",detail:"formula.functionList.FORMULATEXT.functionParameter.reference.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.GETPIVOTDATA,functionType:t.FunctionType.Lookup,description:"formula.functionList.GETPIVOTDATA.description",abstract:"formula.functionList.GETPIVOTDATA.abstract",functionParameter:[{name:"formula.functionList.GETPIVOTDATA.functionParameter.number1.name",detail:"formula.functionList.GETPIVOTDATA.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.GETPIVOTDATA.functionParameter.number2.name",detail:"formula.functionList.GETPIVOTDATA.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.HLOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.HLOOKUP.description",abstract:"formula.functionList.HLOOKUP.abstract",functionParameter:[{name:"formula.functionList.HLOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.HLOOKUP.functionParameter.lookupValue.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.HLOOKUP.functionParameter.tableArray.name",detail:"formula.functionList.HLOOKUP.functionParameter.tableArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.HLOOKUP.functionParameter.rowIndexNum.name",detail:"formula.functionList.HLOOKUP.functionParameter.rowIndexNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HLOOKUP.functionParameter.rangeLookup.name",detail:"formula.functionList.HLOOKUP.functionParameter.rangeLookup.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.HSTACK,functionType:t.FunctionType.Lookup,description:"formula.functionList.HSTACK.description",abstract:"formula.functionList.HSTACK.abstract",functionParameter:[{name:"formula.functionList.HSTACK.functionParameter.array1.name",detail:"formula.functionList.HSTACK.functionParameter.array1.detail",example:"A2:C3",require:1,repeat:0},{name:"formula.functionList.HSTACK.functionParameter.array2.name",detail:"formula.functionList.HSTACK.functionParameter.array2.detail",example:"E2:G3",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.HYPERLINK,functionType:t.FunctionType.Lookup,description:"formula.functionList.HYPERLINK.description",abstract:"formula.functionList.HYPERLINK.abstract",functionParameter:[{name:"formula.functionList.HYPERLINK.functionParameter.number1.name",detail:"formula.functionList.HYPERLINK.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.HYPERLINK.functionParameter.number2.name",detail:"formula.functionList.HYPERLINK.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.IMAGE,functionType:t.FunctionType.Lookup,description:"formula.functionList.IMAGE.description",abstract:"formula.functionList.IMAGE.abstract",functionParameter:[{name:"formula.functionList.IMAGE.functionParameter.number1.name",detail:"formula.functionList.IMAGE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.IMAGE.functionParameter.number2.name",detail:"formula.functionList.IMAGE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.INDEX,functionType:t.FunctionType.Lookup,description:"formula.functionList.INDEX.description",abstract:"formula.functionList.INDEX.abstract",functionParameter:[{name:"formula.functionList.INDEX.functionParameter.reference.name",detail:"formula.functionList.INDEX.functionParameter.reference.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.INDEX.functionParameter.rowNum.name",detail:"formula.functionList.INDEX.functionParameter.rowNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.INDEX.functionParameter.columnNum.name",detail:"formula.functionList.INDEX.functionParameter.columnNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.INDEX.functionParameter.areaNum.name",detail:"formula.functionList.INDEX.functionParameter.areaNum.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.INDIRECT,functionType:t.FunctionType.Lookup,description:"formula.functionList.INDIRECT.description",abstract:"formula.functionList.INDIRECT.abstract",functionParameter:[{name:"formula.functionList.INDIRECT.functionParameter.refText.name",detail:"formula.functionList.INDIRECT.functionParameter.refText.detail",example:'"A1"',require:1,repeat:0},{name:"formula.functionList.INDIRECT.functionParameter.a1.name",detail:"formula.functionList.INDIRECT.functionParameter.a1.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.LOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.LOOKUP.description",abstract:"formula.functionList.LOOKUP.abstract",functionParameter:[{name:"formula.functionList.LOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.LOOKUP.functionParameter.lookupValue.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.LOOKUP.functionParameter.lookupVectorOrArray.name",detail:"formula.functionList.LOOKUP.functionParameter.lookupVectorOrArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.LOOKUP.functionParameter.resultVector.name",detail:"formula.functionList.LOOKUP.functionParameter.resultVector.detail",example:"A1:A20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.MATCH,functionType:t.FunctionType.Lookup,description:"formula.functionList.MATCH.description",abstract:"formula.functionList.MATCH.abstract",functionParameter:[{name:"formula.functionList.MATCH.functionParameter.lookupValue.name",detail:"formula.functionList.MATCH.functionParameter.lookupValue.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.MATCH.functionParameter.lookupArray.name",detail:"formula.functionList.MATCH.functionParameter.lookupArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MATCH.functionParameter.matchType.name",detail:"formula.functionList.MATCH.functionParameter.matchType.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.OFFSET,functionType:t.FunctionType.Lookup,description:"formula.functionList.OFFSET.description",abstract:"formula.functionList.OFFSET.abstract",functionParameter:[{name:"formula.functionList.OFFSET.functionParameter.reference.name",detail:"formula.functionList.OFFSET.functionParameter.reference.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.rows.name",detail:"formula.functionList.OFFSET.functionParameter.rows.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.cols.name",detail:"formula.functionList.OFFSET.functionParameter.cols.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.height.name",detail:"formula.functionList.OFFSET.functionParameter.height.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.width.name",detail:"formula.functionList.OFFSET.functionParameter.width.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.ROW,functionType:t.FunctionType.Lookup,description:"formula.functionList.ROW.description",abstract:"formula.functionList.ROW.abstract",functionParameter:[{name:"formula.functionList.ROW.functionParameter.reference.name",detail:"formula.functionList.ROW.functionParameter.reference.detail",example:"A1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.ROWS,functionType:t.FunctionType.Lookup,description:"formula.functionList.ROWS.description",abstract:"formula.functionList.ROWS.abstract",functionParameter:[{name:"formula.functionList.ROWS.functionParameter.array.name",detail:"formula.functionList.ROWS.functionParameter.array.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.RTD,functionType:t.FunctionType.Lookup,description:"formula.functionList.RTD.description",abstract:"formula.functionList.RTD.abstract",functionParameter:[{name:"formula.functionList.RTD.functionParameter.number1.name",detail:"formula.functionList.RTD.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.RTD.functionParameter.number2.name",detail:"formula.functionList.RTD.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.SORT,functionType:t.FunctionType.Lookup,description:"formula.functionList.SORT.description",abstract:"formula.functionList.SORT.abstract",functionParameter:[{name:"formula.functionList.SORT.functionParameter.array.name",detail:"formula.functionList.SORT.functionParameter.array.detail",example:"A2:A17",require:1,repeat:0},{name:"formula.functionList.SORT.functionParameter.sortIndex.name",detail:"formula.functionList.SORT.functionParameter.sortIndex.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.SORT.functionParameter.sortOrder.name",detail:"formula.functionList.SORT.functionParameter.sortOrder.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.SORT.functionParameter.byCol.name",detail:"formula.functionList.SORT.functionParameter.byCol.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.SORTBY,functionType:t.FunctionType.Lookup,description:"formula.functionList.SORTBY.description",abstract:"formula.functionList.SORTBY.abstract",functionParameter:[{name:"formula.functionList.SORTBY.functionParameter.array.name",detail:"formula.functionList.SORTBY.functionParameter.array.detail",example:"D2:D9",require:1,repeat:0},{name:"formula.functionList.SORTBY.functionParameter.byArray1.name",detail:"formula.functionList.SORTBY.functionParameter.byArray1.detail",example:"E2:E9",require:1,repeat:0},{name:"formula.functionList.SORTBY.functionParameter.sortOrder1.name",detail:"formula.functionList.SORTBY.functionParameter.sortOrder1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SORTBY.functionParameter.byArray2.name",detail:"formula.functionList.SORTBY.functionParameter.byArray2.detail",example:"E2:E9",require:0,repeat:1},{name:"formula.functionList.SORTBY.functionParameter.sortOrder2.name",detail:"formula.functionList.SORTBY.functionParameter.sortOrder2.detail",example:"1",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TAKE,functionType:t.FunctionType.Lookup,description:"formula.functionList.TAKE.description",abstract:"formula.functionList.TAKE.abstract",functionParameter:[{name:"formula.functionList.TAKE.functionParameter.array.name",detail:"formula.functionList.TAKE.functionParameter.array.detail",example:"A2:C4",require:1,repeat:0},{name:"formula.functionList.TAKE.functionParameter.rows.name",detail:"formula.functionList.TAKE.functionParameter.rows.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.TAKE.functionParameter.columns.name",detail:"formula.functionList.TAKE.functionParameter.columns.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TOCOL,functionType:t.FunctionType.Lookup,description:"formula.functionList.TOCOL.description",abstract:"formula.functionList.TOCOL.abstract",functionParameter:[{name:"formula.functionList.TOCOL.functionParameter.array.name",detail:"formula.functionList.TOCOL.functionParameter.array.detail",example:"A2:D4",require:1,repeat:0},{name:"formula.functionList.TOCOL.functionParameter.ignore.name",detail:"formula.functionList.TOCOL.functionParameter.ignore.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TOCOL.functionParameter.scanByColumn.name",detail:"formula.functionList.TOCOL.functionParameter.scanByColumn.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TOROW,functionType:t.FunctionType.Lookup,description:"formula.functionList.TOROW.description",abstract:"formula.functionList.TOROW.abstract",functionParameter:[{name:"formula.functionList.TOROW.functionParameter.array.name",detail:"formula.functionList.TOROW.functionParameter.array.detail",example:"A2:D4",require:1,repeat:0},{name:"formula.functionList.TOROW.functionParameter.ignore.name",detail:"formula.functionList.TOROW.functionParameter.ignore.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TOROW.functionParameter.scanByColumn.name",detail:"formula.functionList.TOROW.functionParameter.scanByColumn.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TRANSPOSE,functionType:t.FunctionType.Lookup,description:"formula.functionList.TRANSPOSE.description",abstract:"formula.functionList.TRANSPOSE.abstract",functionParameter:[{name:"formula.functionList.TRANSPOSE.functionParameter.array.name",detail:"formula.functionList.TRANSPOSE.functionParameter.array.detail",example:"A2:F9",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.UNIQUE,functionType:t.FunctionType.Lookup,description:"formula.functionList.UNIQUE.description",abstract:"formula.functionList.UNIQUE.abstract",functionParameter:[{name:"formula.functionList.UNIQUE.functionParameter.array.name",detail:"formula.functionList.UNIQUE.functionParameter.array.detail",example:"A2:A12",require:1,repeat:0},{name:"formula.functionList.UNIQUE.functionParameter.byCol.name",detail:"formula.functionList.UNIQUE.functionParameter.byCol.detail",example:"false",require:0,repeat:0},{name:"formula.functionList.UNIQUE.functionParameter.exactlyOnce.name",detail:"formula.functionList.UNIQUE.functionParameter.exactlyOnce.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.VLOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.VLOOKUP.description",abstract:"formula.functionList.VLOOKUP.abstract",functionParameter:[{name:"formula.functionList.VLOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.VLOOKUP.functionParameter.lookupValue.detail",example:"B2",require:1,repeat:0},{name:"formula.functionList.VLOOKUP.functionParameter.tableArray.name",detail:"formula.functionList.VLOOKUP.functionParameter.tableArray.detail",example:"C2:E7",require:1,repeat:0},{name:"formula.functionList.VLOOKUP.functionParameter.colIndexNum.name",detail:"formula.functionList.VLOOKUP.functionParameter.colIndexNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VLOOKUP.functionParameter.rangeLookup.name",detail:"formula.functionList.VLOOKUP.functionParameter.rangeLookup.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.VSTACK,functionType:t.FunctionType.Lookup,description:"formula.functionList.VSTACK.description",abstract:"formula.functionList.VSTACK.abstract",functionParameter:[{name:"formula.functionList.VSTACK.functionParameter.array1.name",detail:"formula.functionList.VSTACK.functionParameter.array1.detail",example:"A2:C3",require:1,repeat:0},{name:"formula.functionList.VSTACK.functionParameter.array2.name",detail:"formula.functionList.VSTACK.functionParameter.array2.detail",example:"E2:G3",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.WRAPCOLS,functionType:t.FunctionType.Lookup,description:"formula.functionList.WRAPCOLS.description",abstract:"formula.functionList.WRAPCOLS.abstract",functionParameter:[{name:"formula.functionList.WRAPCOLS.functionParameter.vector.name",detail:"formula.functionList.WRAPCOLS.functionParameter.vector.detail",example:"A2:G2",require:1,repeat:0},{name:"formula.functionList.WRAPCOLS.functionParameter.wrapCount.name",detail:"formula.functionList.WRAPCOLS.functionParameter.wrapCount.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.WRAPCOLS.functionParameter.padWith.name",detail:"formula.functionList.WRAPCOLS.functionParameter.padWith.detail",example:'"x"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.WRAPROWS,functionType:t.FunctionType.Lookup,description:"formula.functionList.WRAPROWS.description",abstract:"formula.functionList.WRAPROWS.abstract",functionParameter:[{name:"formula.functionList.WRAPROWS.functionParameter.vector.name",detail:"formula.functionList.WRAPROWS.functionParameter.vector.detail",example:"A2:G2",require:1,repeat:0},{name:"formula.functionList.WRAPROWS.functionParameter.wrapCount.name",detail:"formula.functionList.WRAPROWS.functionParameter.wrapCount.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.WRAPROWS.functionParameter.padWith.name",detail:"formula.functionList.WRAPROWS.functionParameter.padWith.detail",example:'"x"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.XLOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.XLOOKUP.description",abstract:"formula.functionList.XLOOKUP.abstract",functionParameter:[{name:"formula.functionList.XLOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.XLOOKUP.functionParameter.lookupValue.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.lookupArray.name",detail:"formula.functionList.XLOOKUP.functionParameter.lookupArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.returnArray.name",detail:"formula.functionList.XLOOKUP.functionParameter.returnArray.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.ifNotFound.name",detail:"formula.functionList.XLOOKUP.functionParameter.ifNotFound.detail",example:"default",require:0,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.matchMode.name",detail:"formula.functionList.XLOOKUP.functionParameter.matchMode.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.searchMode.name",detail:"formula.functionList.XLOOKUP.functionParameter.searchMode.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.XMATCH,functionType:t.FunctionType.Lookup,description:"formula.functionList.XMATCH.description",abstract:"formula.functionList.XMATCH.abstract",functionParameter:[{name:"formula.functionList.XMATCH.functionParameter.lookupValue.name",detail:"formula.functionList.XMATCH.functionParameter.lookupValue.detail",example:"B1",require:1,repeat:0},{name:"formula.functionList.XMATCH.functionParameter.lookupArray.name",detail:"formula.functionList.XMATCH.functionParameter.lookupArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.XMATCH.functionParameter.matchMode.name",detail:"formula.functionList.XMATCH.functionParameter.matchMode.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.XMATCH.functionParameter.searchMode.name",detail:"formula.functionList.XMATCH.functionParameter.searchMode.detail",example:"1",require:0,repeat:0}]}],We=[{functionName:t.FUNCTION_NAMES_MATH.ABS,functionType:t.FunctionType.Math,description:"formula.functionList.ABS.description",abstract:"formula.functionList.ABS.abstract",functionParameter:[{name:"formula.functionList.ABS.functionParameter.number.name",detail:"formula.functionList.ABS.functionParameter.number.detail",example:"-2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOS,functionType:t.FunctionType.Math,description:"formula.functionList.ACOS.description",abstract:"formula.functionList.ACOS.abstract",functionParameter:[{name:"formula.functionList.ACOS.functionParameter.number.name",detail:"formula.functionList.ACOS.functionParameter.number.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOSH,functionType:t.FunctionType.Math,description:"formula.functionList.ACOSH.description",abstract:"formula.functionList.ACOSH.abstract",functionParameter:[{name:"formula.functionList.ACOSH.functionParameter.number.name",detail:"formula.functionList.ACOSH.functionParameter.number.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOT,functionType:t.FunctionType.Math,description:"formula.functionList.ACOT.description",abstract:"formula.functionList.ACOT.abstract",functionParameter:[{name:"formula.functionList.ACOT.functionParameter.number.name",detail:"formula.functionList.ACOT.functionParameter.number.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOTH,functionType:t.FunctionType.Math,description:"formula.functionList.ACOTH.description",abstract:"formula.functionList.ACOTH.abstract",functionParameter:[{name:"formula.functionList.ACOTH.functionParameter.number.name",detail:"formula.functionList.ACOTH.functionParameter.number.detail",example:"6",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.AGGREGATE,functionType:t.FunctionType.Math,description:"formula.functionList.AGGREGATE.description",abstract:"formula.functionList.AGGREGATE.abstract",functionParameter:[{name:"formula.functionList.AGGREGATE.functionParameter.number1.name",detail:"formula.functionList.AGGREGATE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AGGREGATE.functionParameter.number2.name",detail:"formula.functionList.AGGREGATE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ARABIC,functionType:t.FunctionType.Math,description:"formula.functionList.ARABIC.description",abstract:"formula.functionList.ARABIC.abstract",functionParameter:[{name:"formula.functionList.ARABIC.functionParameter.text.name",detail:"formula.functionList.ARABIC.functionParameter.text.detail",example:'"LVII"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ASIN,functionType:t.FunctionType.Math,description:"formula.functionList.ASIN.description",abstract:"formula.functionList.ASIN.abstract",functionParameter:[{name:"formula.functionList.ASIN.functionParameter.number.name",detail:"formula.functionList.ASIN.functionParameter.number.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ASINH,functionType:t.FunctionType.Math,description:"formula.functionList.ASINH.description",abstract:"formula.functionList.ASINH.abstract",functionParameter:[{name:"formula.functionList.ASINH.functionParameter.number.name",detail:"formula.functionList.ASINH.functionParameter.number.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ATAN,functionType:t.FunctionType.Math,description:"formula.functionList.ATAN.description",abstract:"formula.functionList.ATAN.abstract",functionParameter:[{name:"formula.functionList.ATAN.functionParameter.number.name",detail:"formula.functionList.ATAN.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ATAN2,functionType:t.FunctionType.Math,description:"formula.functionList.ATAN2.description",abstract:"formula.functionList.ATAN2.abstract",functionParameter:[{name:"formula.functionList.ATAN2.functionParameter.xNum.name",detail:"formula.functionList.ATAN2.functionParameter.xNum.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.ATAN2.functionParameter.yNum.name",detail:"formula.functionList.ATAN2.functionParameter.yNum.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ATANH,functionType:t.FunctionType.Math,description:"formula.functionList.ATANH.description",abstract:"formula.functionList.ATANH.abstract",functionParameter:[{name:"formula.functionList.ATANH.functionParameter.number.name",detail:"formula.functionList.ATANH.functionParameter.number.detail",example:"0.1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.BASE,functionType:t.FunctionType.Math,description:"formula.functionList.BASE.description",abstract:"formula.functionList.BASE.abstract",functionParameter:[{name:"formula.functionList.BASE.functionParameter.number.name",detail:"formula.functionList.BASE.functionParameter.number.detail",example:"15",require:1,repeat:0},{name:"formula.functionList.BASE.functionParameter.radix.name",detail:"formula.functionList.BASE.functionParameter.radix.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.BASE.functionParameter.minLength.name",detail:"formula.functionList.BASE.functionParameter.minLength.detail",example:"10",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CEILING,functionType:t.FunctionType.Math,description:"formula.functionList.CEILING.description",abstract:"formula.functionList.CEILING.abstract",functionParameter:[{name:"formula.functionList.CEILING.functionParameter.number.name",detail:"formula.functionList.CEILING.functionParameter.number.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CEILING.functionParameter.significance.name",detail:"formula.functionList.CEILING.functionParameter.significance.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CEILING_MATH,functionType:t.FunctionType.Math,description:"formula.functionList.CEILING_MATH.description",abstract:"formula.functionList.CEILING_MATH.abstract",functionParameter:[{name:"formula.functionList.CEILING_MATH.functionParameter.number.name",detail:"formula.functionList.CEILING_MATH.functionParameter.number.detail",example:"-5.5",require:1,repeat:0},{name:"formula.functionList.CEILING_MATH.functionParameter.significance.name",detail:"formula.functionList.CEILING_MATH.functionParameter.significance.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.CEILING_MATH.functionParameter.mode.name",detail:"formula.functionList.CEILING_MATH.functionParameter.mode.detail",example:"-1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CEILING_PRECISE,functionType:t.FunctionType.Math,description:"formula.functionList.CEILING_PRECISE.description",abstract:"formula.functionList.CEILING_PRECISE.abstract",functionParameter:[{name:"formula.functionList.CEILING_PRECISE.functionParameter.number.name",detail:"formula.functionList.CEILING_PRECISE.functionParameter.number.detail",example:"4.3",require:1,repeat:0},{name:"formula.functionList.CEILING_PRECISE.functionParameter.significance.name",detail:"formula.functionList.CEILING_PRECISE.functionParameter.significance.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COMBIN,functionType:t.FunctionType.Math,description:"formula.functionList.COMBIN.description",abstract:"formula.functionList.COMBIN.abstract",functionParameter:[{name:"formula.functionList.COMBIN.functionParameter.number.name",detail:"formula.functionList.COMBIN.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.COMBIN.functionParameter.numberChosen.name",detail:"formula.functionList.COMBIN.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COMBINA,functionType:t.FunctionType.Math,description:"formula.functionList.COMBINA.description",abstract:"formula.functionList.COMBINA.abstract",functionParameter:[{name:"formula.functionList.COMBINA.functionParameter.number.name",detail:"formula.functionList.COMBINA.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.COMBINA.functionParameter.numberChosen.name",detail:"formula.functionList.COMBINA.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COS,functionType:t.FunctionType.Math,description:"formula.functionList.COS.description",abstract:"formula.functionList.COS.abstract",functionParameter:[{name:"formula.functionList.COS.functionParameter.number.name",detail:"formula.functionList.COS.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COSH,functionType:t.FunctionType.Math,description:"formula.functionList.COSH.description",abstract:"formula.functionList.COSH.abstract",functionParameter:[{name:"formula.functionList.COSH.functionParameter.number.name",detail:"formula.functionList.COSH.functionParameter.number.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COT,functionType:t.FunctionType.Math,description:"formula.functionList.COT.description",abstract:"formula.functionList.COT.abstract",functionParameter:[{name:"formula.functionList.COT.functionParameter.number.name",detail:"formula.functionList.COT.functionParameter.number.detail",example:"30",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COTH,functionType:t.FunctionType.Math,description:"formula.functionList.COTH.description",abstract:"formula.functionList.COTH.abstract",functionParameter:[{name:"formula.functionList.COTH.functionParameter.number.name",detail:"formula.functionList.COTH.functionParameter.number.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CSC,functionType:t.FunctionType.Math,description:"formula.functionList.CSC.description",abstract:"formula.functionList.CSC.abstract",functionParameter:[{name:"formula.functionList.CSC.functionParameter.number.name",detail:"formula.functionList.CSC.functionParameter.number.detail",example:"15",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CSCH,functionType:t.FunctionType.Math,description:"formula.functionList.CSCH.description",abstract:"formula.functionList.CSCH.abstract",functionParameter:[{name:"formula.functionList.CSCH.functionParameter.number.name",detail:"formula.functionList.CSCH.functionParameter.number.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.DECIMAL,functionType:t.FunctionType.Math,description:"formula.functionList.DECIMAL.description",abstract:"formula.functionList.DECIMAL.abstract",functionParameter:[{name:"formula.functionList.DECIMAL.functionParameter.text.name",detail:"formula.functionList.DECIMAL.functionParameter.text.detail",example:'"FF"',require:1,repeat:0},{name:"formula.functionList.DECIMAL.functionParameter.radix.name",detail:"formula.functionList.DECIMAL.functionParameter.radix.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.DEGREES,functionType:t.FunctionType.Math,description:"formula.functionList.DEGREES.description",abstract:"formula.functionList.DEGREES.abstract",functionParameter:[{name:"formula.functionList.DEGREES.functionParameter.angle.name",detail:"formula.functionList.DEGREES.functionParameter.angle.detail",example:"PI()",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.EVEN,functionType:t.FunctionType.Math,description:"formula.functionList.EVEN.description",abstract:"formula.functionList.EVEN.abstract",functionParameter:[{name:"formula.functionList.EVEN.functionParameter.number.name",detail:"formula.functionList.EVEN.functionParameter.number.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.EXP,functionType:t.FunctionType.Math,description:"formula.functionList.EXP.description",abstract:"formula.functionList.EXP.abstract",functionParameter:[{name:"formula.functionList.EXP.functionParameter.number.name",detail:"formula.functionList.EXP.functionParameter.number.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FACT,functionType:t.FunctionType.Math,description:"formula.functionList.FACT.description",abstract:"formula.functionList.FACT.abstract",functionParameter:[{name:"formula.functionList.FACT.functionParameter.number.name",detail:"formula.functionList.FACT.functionParameter.number.detail",example:"5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FACTDOUBLE,functionType:t.FunctionType.Math,description:"formula.functionList.FACTDOUBLE.description",abstract:"formula.functionList.FACTDOUBLE.abstract",functionParameter:[{name:"formula.functionList.FACTDOUBLE.functionParameter.number.name",detail:"formula.functionList.FACTDOUBLE.functionParameter.number.detail",example:"6",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FLOOR,functionType:t.FunctionType.Math,description:"formula.functionList.FLOOR.description",abstract:"formula.functionList.FLOOR.abstract",functionParameter:[{name:"formula.functionList.FLOOR.functionParameter.number.name",detail:"formula.functionList.FLOOR.functionParameter.number.detail",example:"3.7",require:1,repeat:0},{name:"formula.functionList.FLOOR.functionParameter.significance.name",detail:"formula.functionList.FLOOR.functionParameter.significance.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FLOOR_MATH,functionType:t.FunctionType.Math,description:"formula.functionList.FLOOR_MATH.description",abstract:"formula.functionList.FLOOR_MATH.abstract",functionParameter:[{name:"formula.functionList.FLOOR_MATH.functionParameter.number.name",detail:"formula.functionList.FLOOR_MATH.functionParameter.number.detail",example:"-5.5",require:1,repeat:0},{name:"formula.functionList.FLOOR_MATH.functionParameter.significance.name",detail:"formula.functionList.FLOOR_MATH.functionParameter.significance.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.FLOOR_MATH.functionParameter.mode.name",detail:"formula.functionList.FLOOR_MATH.functionParameter.mode.detail",example:"-1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FLOOR_PRECISE,functionType:t.FunctionType.Math,description:"formula.functionList.FLOOR_PRECISE.description",abstract:"formula.functionList.FLOOR_PRECISE.abstract",functionParameter:[{name:"formula.functionList.FLOOR_PRECISE.functionParameter.number.name",detail:"formula.functionList.FLOOR_PRECISE.functionParameter.number.detail",example:"-3.2",require:1,repeat:0},{name:"formula.functionList.FLOOR_PRECISE.functionParameter.significance.name",detail:"formula.functionList.FLOOR_PRECISE.functionParameter.significance.detail",example:"-1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.GCD,functionType:t.FunctionType.Math,description:"formula.functionList.GCD.description",abstract:"formula.functionList.GCD.abstract",functionParameter:[{name:"formula.functionList.GCD.functionParameter.number1.name",detail:"formula.functionList.GCD.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.GCD.functionParameter.number2.name",detail:"formula.functionList.GCD.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.INT,functionType:t.FunctionType.Math,description:"formula.functionList.INT.description",abstract:"formula.functionList.INT.abstract",functionParameter:[{name:"formula.functionList.INT.functionParameter.number.name",detail:"formula.functionList.INT.functionParameter.number.detail",example:"8.9",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ISO_CEILING,functionType:t.FunctionType.Math,description:"formula.functionList.ISO_CEILING.description",abstract:"formula.functionList.ISO_CEILING.abstract",functionParameter:[{name:"formula.functionList.ISO_CEILING.functionParameter.number1.name",detail:"formula.functionList.ISO_CEILING.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.ISO_CEILING.functionParameter.number2.name",detail:"formula.functionList.ISO_CEILING.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LCM,functionType:t.FunctionType.Math,description:"formula.functionList.LCM.description",abstract:"formula.functionList.LCM.abstract",functionParameter:[{name:"formula.functionList.LCM.functionParameter.number1.name",detail:"formula.functionList.LCM.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.LCM.functionParameter.number2.name",detail:"formula.functionList.LCM.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.LET,functionType:t.FunctionType.Math,description:"formula.functionList.LET.description",abstract:"formula.functionList.LET.abstract",functionParameter:[{name:"formula.functionList.LET.functionParameter.number1.name",detail:"formula.functionList.LET.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.number2.name",detail:"formula.functionList.LET.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LN,functionType:t.FunctionType.Math,description:"formula.functionList.LN.description",abstract:"formula.functionList.LN.abstract",functionParameter:[{name:"formula.functionList.LN.functionParameter.number.name",detail:"formula.functionList.LN.functionParameter.number.detail",example:"EXP(3)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LOG,functionType:t.FunctionType.Math,description:"formula.functionList.LOG.description",abstract:"formula.functionList.LOG.abstract",functionParameter:[{name:"formula.functionList.LOG.functionParameter.number.name",detail:"formula.functionList.LOG.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.LOG.functionParameter.base.name",detail:"formula.functionList.LOG.functionParameter.base.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LOG10,functionType:t.FunctionType.Math,description:"formula.functionList.LOG10.description",abstract:"formula.functionList.LOG10.abstract",functionParameter:[{name:"formula.functionList.LOG10.functionParameter.number.name",detail:"formula.functionList.LOG10.functionParameter.number.detail",example:"100000",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MDETERM,functionType:t.FunctionType.Math,description:"formula.functionList.MDETERM.description",abstract:"formula.functionList.MDETERM.abstract",functionParameter:[{name:"formula.functionList.MDETERM.functionParameter.array.name",detail:"formula.functionList.MDETERM.functionParameter.array.detail",example:"A1:C3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MINVERSE,functionType:t.FunctionType.Math,description:"formula.functionList.MINVERSE.description",abstract:"formula.functionList.MINVERSE.abstract",functionParameter:[{name:"formula.functionList.MINVERSE.functionParameter.array.name",detail:"formula.functionList.MINVERSE.functionParameter.array.detail",example:"A1:C3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MMULT,functionType:t.FunctionType.Math,description:"formula.functionList.MMULT.description",abstract:"formula.functionList.MMULT.abstract",functionParameter:[{name:"formula.functionList.MMULT.functionParameter.array1.name",detail:"formula.functionList.MMULT.functionParameter.array1.detail",example:"A2:B3",require:1,repeat:0},{name:"formula.functionList.MMULT.functionParameter.array2.name",detail:"formula.functionList.MMULT.functionParameter.array2.detail",example:"A5:B6",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MOD,functionType:t.FunctionType.Math,description:"formula.functionList.MOD.description",abstract:"formula.functionList.MOD.abstract",functionParameter:[{name:"formula.functionList.MOD.functionParameter.number.name",detail:"formula.functionList.MOD.functionParameter.number.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.MOD.functionParameter.divisor.name",detail:"formula.functionList.MOD.functionParameter.divisor.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MROUND,functionType:t.FunctionType.Math,description:"formula.functionList.MROUND.description",abstract:"formula.functionList.MROUND.abstract",functionParameter:[{name:"formula.functionList.MROUND.functionParameter.number.name",detail:"formula.functionList.MROUND.functionParameter.number.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.MROUND.functionParameter.multiple.name",detail:"formula.functionList.MROUND.functionParameter.multiple.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MULTINOMIAL,functionType:t.FunctionType.Math,description:"formula.functionList.MULTINOMIAL.description",abstract:"formula.functionList.MULTINOMIAL.abstract",functionParameter:[{name:"formula.functionList.MULTINOMIAL.functionParameter.number1.name",detail:"formula.functionList.MULTINOMIAL.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.MULTINOMIAL.functionParameter.number2.name",detail:"formula.functionList.MULTINOMIAL.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.MUNIT,functionType:t.FunctionType.Math,description:"formula.functionList.MUNIT.description",abstract:"formula.functionList.MUNIT.abstract",functionParameter:[{name:"formula.functionList.MUNIT.functionParameter.dimension.name",detail:"formula.functionList.MUNIT.functionParameter.dimension.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ODD,functionType:t.FunctionType.Math,description:"formula.functionList.ODD.description",abstract:"formula.functionList.ODD.abstract",functionParameter:[{name:"formula.functionList.ODD.functionParameter.number.name",detail:"formula.functionList.ODD.functionParameter.number.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.PI,functionType:t.FunctionType.Math,description:"formula.functionList.PI.description",abstract:"formula.functionList.PI.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_MATH.POWER,functionType:t.FunctionType.Math,description:"formula.functionList.POWER.description",abstract:"formula.functionList.POWER.abstract",functionParameter:[{name:"formula.functionList.POWER.functionParameter.number.name",detail:"formula.functionList.POWER.functionParameter.number.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.POWER.functionParameter.power.name",detail:"formula.functionList.POWER.functionParameter.power.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.PRODUCT,functionType:t.FunctionType.Math,description:"formula.functionList.PRODUCT.description",abstract:"formula.functionList.PRODUCT.abstract",functionParameter:[{name:"formula.functionList.PRODUCT.functionParameter.number1.name",detail:"formula.functionList.PRODUCT.functionParameter.number1.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.PRODUCT.functionParameter.number2.name",detail:"formula.functionList.PRODUCT.functionParameter.number2.detail",example:"A2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.QUOTIENT,functionType:t.FunctionType.Math,description:"formula.functionList.QUOTIENT.description",abstract:"formula.functionList.QUOTIENT.abstract",functionParameter:[{name:"formula.functionList.QUOTIENT.functionParameter.numerator.name",detail:"formula.functionList.QUOTIENT.functionParameter.numerator.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.QUOTIENT.functionParameter.denominator.name",detail:"formula.functionList.QUOTIENT.functionParameter.denominator.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.RADIANS,functionType:t.FunctionType.Math,description:"formula.functionList.RADIANS.description",abstract:"formula.functionList.RADIANS.abstract",functionParameter:[{name:"formula.functionList.RADIANS.functionParameter.angle.name",detail:"formula.functionList.RADIANS.functionParameter.angle.detail",example:"270",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.RAND,functionType:t.FunctionType.Math,description:"formula.functionList.RAND.description",abstract:"formula.functionList.RAND.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_MATH.RANDARRAY,functionType:t.FunctionType.Math,description:"formula.functionList.RANDARRAY.description",abstract:"formula.functionList.RANDARRAY.abstract",functionParameter:[{name:"formula.functionList.RANDARRAY.functionParameter.rows.name",detail:"formula.functionList.RANDARRAY.functionParameter.rows.detail",example:"5",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.columns.name",detail:"formula.functionList.RANDARRAY.functionParameter.columns.detail",example:"3",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.min.name",detail:"formula.functionList.RANDARRAY.functionParameter.min.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.max.name",detail:"formula.functionList.RANDARRAY.functionParameter.max.detail",example:"100",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.wholeNumber.name",detail:"formula.functionList.RANDARRAY.functionParameter.wholeNumber.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.RANDBETWEEN,functionType:t.FunctionType.Math,description:"formula.functionList.RANDBETWEEN.description",abstract:"formula.functionList.RANDBETWEEN.abstract",functionParameter:[{name:"formula.functionList.RANDBETWEEN.functionParameter.bottom.name",detail:"formula.functionList.RANDBETWEEN.functionParameter.bottom.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.RANDBETWEEN.functionParameter.top.name",detail:"formula.functionList.RANDBETWEEN.functionParameter.top.detail",example:"100",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROMAN,functionType:t.FunctionType.Math,description:"formula.functionList.ROMAN.description",abstract:"formula.functionList.ROMAN.abstract",functionParameter:[{name:"formula.functionList.ROMAN.functionParameter.number.name",detail:"formula.functionList.ROMAN.functionParameter.number.detail",example:"499",require:1,repeat:0},{name:"formula.functionList.ROMAN.functionParameter.form.name",detail:"formula.functionList.ROMAN.functionParameter.form.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUND,functionType:t.FunctionType.Math,description:"formula.functionList.ROUND.description",abstract:"formula.functionList.ROUND.abstract",functionParameter:[{name:"formula.functionList.ROUND.functionParameter.number.name",detail:"formula.functionList.ROUND.functionParameter.number.detail",example:"2.15",require:1,repeat:0},{name:"formula.functionList.ROUND.functionParameter.numDigits.name",detail:"formula.functionList.ROUND.functionParameter.numDigits.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUNDBANK,functionType:t.FunctionType.Math,description:"formula.functionList.ROUNDBANK.description",abstract:"formula.functionList.ROUNDBANK.abstract",functionParameter:[{name:"formula.functionList.ROUNDBANK.functionParameter.number.name",detail:"formula.functionList.ROUNDBANK.functionParameter.number.detail",example:"2.345",require:1,repeat:0},{name:"formula.functionList.ROUNDBANK.functionParameter.numDigits.name",detail:"formula.functionList.ROUNDBANK.functionParameter.numDigits.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUNDDOWN,functionType:t.FunctionType.Math,description:"formula.functionList.ROUNDDOWN.description",abstract:"formula.functionList.ROUNDDOWN.abstract",functionParameter:[{name:"formula.functionList.ROUNDDOWN.functionParameter.number.name",detail:"formula.functionList.ROUNDDOWN.functionParameter.number.detail",example:"3.2",require:1,repeat:0},{name:"formula.functionList.ROUNDDOWN.functionParameter.numDigits.name",detail:"formula.functionList.ROUNDDOWN.functionParameter.numDigits.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUNDUP,functionType:t.FunctionType.Math,description:"formula.functionList.ROUNDUP.description",abstract:"formula.functionList.ROUNDUP.abstract",functionParameter:[{name:"formula.functionList.ROUNDUP.functionParameter.number.name",detail:"formula.functionList.ROUNDUP.functionParameter.number.detail",example:"3.2",require:1,repeat:0},{name:"formula.functionList.ROUNDUP.functionParameter.numDigits.name",detail:"formula.functionList.ROUNDUP.functionParameter.numDigits.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SEC,functionType:t.FunctionType.Math,description:"formula.functionList.SEC.description",abstract:"formula.functionList.SEC.abstract",functionParameter:[{name:"formula.functionList.SEC.functionParameter.number.name",detail:"formula.functionList.SEC.functionParameter.number.detail",example:"30",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SECH,functionType:t.FunctionType.Math,description:"formula.functionList.SECH.description",abstract:"formula.functionList.SECH.abstract",functionParameter:[{name:"formula.functionList.SECH.functionParameter.number.name",detail:"formula.functionList.SECH.functionParameter.number.detail",example:"30",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SERIESSUM,functionType:t.FunctionType.Math,description:"formula.functionList.SERIESSUM.description",abstract:"formula.functionList.SERIESSUM.abstract",functionParameter:[{name:"formula.functionList.SERIESSUM.functionParameter.x.name",detail:"formula.functionList.SERIESSUM.functionParameter.x.detail",example:"0.785398163",require:1,repeat:0},{name:"formula.functionList.SERIESSUM.functionParameter.n.name",detail:"formula.functionList.SERIESSUM.functionParameter.n.detail",example:"0",require:1,repeat:0},{name:"formula.functionList.SERIESSUM.functionParameter.m.name",detail:"formula.functionList.SERIESSUM.functionParameter.m.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.SERIESSUM.functionParameter.coefficients.name",detail:"formula.functionList.SERIESSUM.functionParameter.coefficients.detail",example:"A1:A4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SEQUENCE,functionType:t.FunctionType.Math,description:"formula.functionList.SEQUENCE.description",abstract:"formula.functionList.SEQUENCE.abstract",functionParameter:[{name:"formula.functionList.SEQUENCE.functionParameter.rows.name",detail:"formula.functionList.SEQUENCE.functionParameter.rows.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.SEQUENCE.functionParameter.columns.name",detail:"formula.functionList.SEQUENCE.functionParameter.columns.detail",example:"5",require:0,repeat:0},{name:"formula.functionList.SEQUENCE.functionParameter.start.name",detail:"formula.functionList.SEQUENCE.functionParameter.start.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.SEQUENCE.functionParameter.step.name",detail:"formula.functionList.SEQUENCE.functionParameter.step.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SIGN,functionType:t.FunctionType.Math,description:"formula.functionList.SIGN.description",abstract:"formula.functionList.SIGN.abstract",functionParameter:[{name:"formula.functionList.SIGN.functionParameter.number.name",detail:"formula.functionList.SIGN.functionParameter.number.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SIN,functionType:t.FunctionType.Math,description:"formula.functionList.SIN.description",abstract:"formula.functionList.SIN.abstract",functionParameter:[{name:"formula.functionList.SIN.functionParameter.number.name",detail:"formula.functionList.SIN.functionParameter.number.detail",example:"30*PI()/180",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SINH,functionType:t.FunctionType.Math,description:"formula.functionList.SINH.description",abstract:"formula.functionList.SINH.abstract",functionParameter:[{name:"formula.functionList.SINH.functionParameter.number.name",detail:"formula.functionList.SINH.functionParameter.number.detail",example:"0.0342*1.03",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SQRT,functionType:t.FunctionType.Math,description:"formula.functionList.SQRT.description",abstract:"formula.functionList.SQRT.abstract",functionParameter:[{name:"formula.functionList.SQRT.functionParameter.number.name",detail:"formula.functionList.SQRT.functionParameter.number.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SQRTPI,functionType:t.FunctionType.Math,description:"formula.functionList.SQRTPI.description",abstract:"formula.functionList.SQRTPI.abstract",functionParameter:[{name:"formula.functionList.SQRTPI.functionParameter.number.name",detail:"formula.functionList.SQRTPI.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUBTOTAL,functionType:t.FunctionType.Math,description:"formula.functionList.SUBTOTAL.description",abstract:"formula.functionList.SUBTOTAL.abstract",functionParameter:[{name:"formula.functionList.SUBTOTAL.functionParameter.functionNum.name",detail:"formula.functionList.SUBTOTAL.functionParameter.functionNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SUBTOTAL.functionParameter.ref1.name",detail:"formula.functionList.SUBTOTAL.functionParameter.ref1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUBTOTAL.functionParameter.ref2.name",detail:"formula.functionList.SUBTOTAL.functionParameter.ref2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUM,aliasFunctionName:"formula.functionList.SUM.aliasFunctionName",functionType:t.FunctionType.Math,description:"formula.functionList.SUM.description",abstract:"formula.functionList.SUM.abstract",functionParameter:[{name:"formula.functionList.SUM.functionParameter.number1.name",detail:"formula.functionList.SUM.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUM.functionParameter.number2.name",detail:"formula.functionList.SUM.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMIF,aliasFunctionName:"formula.functionList.SUMIF.aliasFunctionName",functionType:t.FunctionType.Math,description:"formula.functionList.SUMIF.description",abstract:"formula.functionList.SUMIF.abstract",functionParameter:[{name:"formula.functionList.SUMIF.functionParameter.range.name",detail:"formula.functionList.SUMIF.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUMIF.functionParameter.criteria.name",detail:"formula.functionList.SUMIF.functionParameter.criteria.detail",example:'">5"',require:1,repeat:0},{name:"formula.functionList.SUMIF.functionParameter.sumRange.name",detail:"formula.functionList.SUMIF.functionParameter.sumRange.detail",example:"B1:B20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUMIFS,functionType:t.FunctionType.Math,description:"formula.functionList.SUMIFS.description",abstract:"formula.functionList.SUMIFS.abstract",functionParameter:[{name:"formula.functionList.SUMIFS.functionParameter.sumRange.name",detail:"formula.functionList.SUMIFS.functionParameter.sumRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUMIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.SUMIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.SUMIFS.functionParameter.criteria1.name",detail:"formula.functionList.SUMIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.SUMIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.SUMIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.SUMIFS.functionParameter.criteria2.name",detail:"formula.functionList.SUMIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMPRODUCT,functionType:t.FunctionType.Math,description:"formula.functionList.SUMPRODUCT.description",abstract:"formula.functionList.SUMPRODUCT.abstract",functionParameter:[{name:"formula.functionList.SUMPRODUCT.functionParameter.array1.name",detail:"formula.functionList.SUMPRODUCT.functionParameter.array1.detail",example:"C2:C5",require:1,repeat:0},{name:"formula.functionList.SUMPRODUCT.functionParameter.array2.name",detail:"formula.functionList.SUMPRODUCT.functionParameter.array2.detail",example:"D2:D5",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMSQ,functionType:t.FunctionType.Math,description:"formula.functionList.SUMSQ.description",abstract:"formula.functionList.SUMSQ.abstract",functionParameter:[{name:"formula.functionList.SUMSQ.functionParameter.number1.name",detail:"formula.functionList.SUMSQ.functionParameter.number1.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.SUMSQ.functionParameter.number2.name",detail:"formula.functionList.SUMSQ.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMX2MY2,functionType:t.FunctionType.Math,description:"formula.functionList.SUMX2MY2.description",abstract:"formula.functionList.SUMX2MY2.abstract",functionParameter:[{name:"formula.functionList.SUMX2MY2.functionParameter.arrayX.name",detail:"formula.functionList.SUMX2MY2.functionParameter.arrayX.detail",example:"A2:A8",require:1,repeat:0},{name:"formula.functionList.SUMX2MY2.functionParameter.arrayY.name",detail:"formula.functionList.SUMX2MY2.functionParameter.arrayY.detail",example:"B2:B8",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUMX2PY2,functionType:t.FunctionType.Math,description:"formula.functionList.SUMX2PY2.description",abstract:"formula.functionList.SUMX2PY2.abstract",functionParameter:[{name:"formula.functionList.SUMX2PY2.functionParameter.arrayX.name",detail:"formula.functionList.SUMX2PY2.functionParameter.arrayX.detail",example:"A2:A8",require:1,repeat:0},{name:"formula.functionList.SUMX2PY2.functionParameter.arrayY.name",detail:"formula.functionList.SUMX2PY2.functionParameter.arrayY.detail",example:"B2:B8",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUMXMY2,functionType:t.FunctionType.Math,description:"formula.functionList.SUMXMY2.description",abstract:"formula.functionList.SUMXMY2.abstract",functionParameter:[{name:"formula.functionList.SUMXMY2.functionParameter.arrayX.name",detail:"formula.functionList.SUMXMY2.functionParameter.arrayX.detail",example:"A2:A8",require:1,repeat:0},{name:"formula.functionList.SUMXMY2.functionParameter.arrayY.name",detail:"formula.functionList.SUMXMY2.functionParameter.arrayY.detail",example:"B2:B8",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.TAN,functionType:t.FunctionType.Math,description:"formula.functionList.TAN.description",abstract:"formula.functionList.TAN.abstract",functionParameter:[{name:"formula.functionList.TAN.functionParameter.number.name",detail:"formula.functionList.TAN.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.TANH,functionType:t.FunctionType.Math,description:"formula.functionList.TANH.description",abstract:"formula.functionList.TANH.abstract",functionParameter:[{name:"formula.functionList.TANH.functionParameter.number.name",detail:"formula.functionList.TANH.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.TRUNC,functionType:t.FunctionType.Math,description:"formula.functionList.TRUNC.description",abstract:"formula.functionList.TRUNC.abstract",functionParameter:[{name:"formula.functionList.TRUNC.functionParameter.number.name",detail:"formula.functionList.TRUNC.functionParameter.number.detail",example:"0.45",require:1,repeat:0},{name:"formula.functionList.TRUNC.functionParameter.numDigits.name",detail:"formula.functionList.TRUNC.functionParameter.numDigits.detail",example:"1",require:0,repeat:0}]}],Ke=[{functionName:t.FUNCTION_NAMES_STATISTICAL.AVEDEV,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVEDEV.description",abstract:"formula.functionList.AVEDEV.abstract",functionParameter:[{name:"formula.functionList.AVEDEV.functionParameter.number1.name",detail:"formula.functionList.AVEDEV.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVEDEV.functionParameter.number2.name",detail:"formula.functionList.AVEDEV.functionParameter.number2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGE,aliasFunctionName:"formula.functionList.AVERAGE.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGE.description",abstract:"formula.functionList.AVERAGE.abstract",functionParameter:[{name:"formula.functionList.AVERAGE.functionParameter.number1.name",detail:"formula.functionList.AVERAGE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGE.functionParameter.number2.name",detail:"formula.functionList.AVERAGE.functionParameter.number2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGE_WEIGHTED,aliasFunctionName:"formula.functionList.AVERAGE_WEIGHTED.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGE_WEIGHTED.description",abstract:"formula.functionList.AVERAGE_WEIGHTED.abstract",functionParameter:[{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.values.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.values.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.weights.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.weights.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalValues.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalValues.detail",example:"20",require:0,repeat:1},{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalWeights.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalWeights.detail",example:"3",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGEA,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGEA.description",abstract:"formula.functionList.AVERAGEA.abstract",functionParameter:[{name:"formula.functionList.AVERAGEA.functionParameter.value1.name",detail:"formula.functionList.AVERAGEA.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGEA.functionParameter.value2.name",detail:"formula.functionList.AVERAGEA.functionParameter.value2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGEIF,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGEIF.description",abstract:"formula.functionList.AVERAGEIF.abstract",functionParameter:[{name:"formula.functionList.AVERAGEIF.functionParameter.range.name",detail:"formula.functionList.AVERAGEIF.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGEIF.functionParameter.criteria.name",detail:"formula.functionList.AVERAGEIF.functionParameter.criteria.detail",example:'">5"',require:1,repeat:0},{name:"formula.functionList.AVERAGEIF.functionParameter.averageRange.name",detail:"formula.functionList.AVERAGEIF.functionParameter.averageRange.detail",example:"B1:B20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGEIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGEIFS.description",abstract:"formula.functionList.AVERAGEIFS.abstract",functionParameter:[{name:"formula.functionList.AVERAGEIFS.functionParameter.averageRange.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.averageRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteria1.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteria2.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BETA_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.BETA_DIST.description",abstract:"formula.functionList.BETA_DIST.abstract",functionParameter:[{name:"formula.functionList.BETA_DIST.functionParameter.x.name",detail:"formula.functionList.BETA_DIST.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.alpha.name",detail:"formula.functionList.BETA_DIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.beta.name",detail:"formula.functionList.BETA_DIST.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.cumulative.name",detail:"formula.functionList.BETA_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.A.name",detail:"formula.functionList.BETA_DIST.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.B.name",detail:"formula.functionList.BETA_DIST.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BETA_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.BETA_INV.description",abstract:"formula.functionList.BETA_INV.abstract",functionParameter:[{name:"formula.functionList.BETA_INV.functionParameter.probability.name",detail:"formula.functionList.BETA_INV.functionParameter.probability.detail",example:"0.685470581",require:1,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.alpha.name",detail:"formula.functionList.BETA_INV.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.beta.name",detail:"formula.functionList.BETA_INV.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.A.name",detail:"formula.functionList.BETA_INV.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.B.name",detail:"formula.functionList.BETA_INV.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BINOM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.BINOM_DIST.description",abstract:"formula.functionList.BINOM_DIST.abstract",functionParameter:[{name:"formula.functionList.BINOM_DIST.functionParameter.numberS.name",detail:"formula.functionList.BINOM_DIST.functionParameter.numberS.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST.functionParameter.trials.name",detail:"formula.functionList.BINOM_DIST.functionParameter.trials.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST.functionParameter.probabilityS.name",detail:"formula.functionList.BINOM_DIST.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.BINOM_DIST.functionParameter.cumulative.detail",example:"false",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BINOM_DIST_RANGE,functionType:t.FunctionType.Statistical,description:"formula.functionList.BINOM_DIST_RANGE.description",abstract:"formula.functionList.BINOM_DIST_RANGE.abstract",functionParameter:[{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.trials.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.trials.detail",example:"60",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.probabilityS.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.probabilityS.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS.detail",example:"45",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS2.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS2.detail",example:"50",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BINOM_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.BINOM_INV.description",abstract:"formula.functionList.BINOM_INV.abstract",functionParameter:[{name:"formula.functionList.BINOM_INV.functionParameter.trials.name",detail:"formula.functionList.BINOM_INV.functionParameter.trials.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.BINOM_INV.functionParameter.probabilityS.name",detail:"formula.functionList.BINOM_INV.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.BINOM_INV.functionParameter.alpha.name",detail:"formula.functionList.BINOM_INV.functionParameter.alpha.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_DIST.description",abstract:"formula.functionList.CHISQ_DIST.abstract",functionParameter:[{name:"formula.functionList.CHISQ_DIST.functionParameter.x.name",detail:"formula.functionList.CHISQ_DIST.functionParameter.x.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CHISQ_DIST.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_DIST.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHISQ_DIST.functionParameter.cumulative.name",detail:"formula.functionList.CHISQ_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_DIST_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_DIST_RT.description",abstract:"formula.functionList.CHISQ_DIST_RT.abstract",functionParameter:[{name:"formula.functionList.CHISQ_DIST_RT.functionParameter.x.name",detail:"formula.functionList.CHISQ_DIST_RT.functionParameter.x.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CHISQ_DIST_RT.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_DIST_RT.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_INV.description",abstract:"formula.functionList.CHISQ_INV.abstract",functionParameter:[{name:"formula.functionList.CHISQ_INV.functionParameter.probability.name",detail:"formula.functionList.CHISQ_INV.functionParameter.probability.detail",example:"0.93",require:1,repeat:0},{name:"formula.functionList.CHISQ_INV.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_INV.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_INV_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_INV_RT.description",abstract:"formula.functionList.CHISQ_INV_RT.abstract",functionParameter:[{name:"formula.functionList.CHISQ_INV_RT.functionParameter.probability.name",detail:"formula.functionList.CHISQ_INV_RT.functionParameter.probability.detail",example:"0.93",require:1,repeat:0},{name:"formula.functionList.CHISQ_INV_RT.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_INV_RT.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_TEST.description",abstract:"formula.functionList.CHISQ_TEST.abstract",functionParameter:[{name:"formula.functionList.CHISQ_TEST.functionParameter.actualRange.name",detail:"formula.functionList.CHISQ_TEST.functionParameter.actualRange.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.CHISQ_TEST.functionParameter.expectedRange.name",detail:"formula.functionList.CHISQ_TEST.functionParameter.expectedRange.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CONFIDENCE_NORM,functionType:t.FunctionType.Statistical,description:"formula.functionList.CONFIDENCE_NORM.description",abstract:"formula.functionList.CONFIDENCE_NORM.abstract",functionParameter:[{name:"formula.functionList.CONFIDENCE_NORM.functionParameter.alpha.name",detail:"formula.functionList.CONFIDENCE_NORM.functionParameter.alpha.detail",example:"0.05",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_NORM.functionParameter.standardDev.name",detail:"formula.functionList.CONFIDENCE_NORM.functionParameter.standardDev.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_NORM.functionParameter.size.name",detail:"formula.functionList.CONFIDENCE_NORM.functionParameter.size.detail",example:"50",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CONFIDENCE_T,functionType:t.FunctionType.Statistical,description:"formula.functionList.CONFIDENCE_T.description",abstract:"formula.functionList.CONFIDENCE_T.abstract",functionParameter:[{name:"formula.functionList.CONFIDENCE_T.functionParameter.alpha.name",detail:"formula.functionList.CONFIDENCE_T.functionParameter.alpha.detail",example:"0.05",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_T.functionParameter.standardDev.name",detail:"formula.functionList.CONFIDENCE_T.functionParameter.standardDev.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_T.functionParameter.size.name",detail:"formula.functionList.CONFIDENCE_T.functionParameter.size.detail",example:"50",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CORREL,functionType:t.FunctionType.Statistical,description:"formula.functionList.CORREL.description",abstract:"formula.functionList.CORREL.abstract",functionParameter:[{name:"formula.functionList.CORREL.functionParameter.array1.name",detail:"formula.functionList.CORREL.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.CORREL.functionParameter.array2.name",detail:"formula.functionList.CORREL.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNT,aliasFunctionName:"formula.functionList.COUNT.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNT.description",abstract:"formula.functionList.COUNT.abstract",functionParameter:[{name:"formula.functionList.COUNT.functionParameter.value1.name",detail:"formula.functionList.COUNT.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNT.functionParameter.value2.name",detail:"formula.functionList.COUNT.functionParameter.value2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTA,aliasFunctionName:"formula.functionList.COUNTA.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTA.description",abstract:"formula.functionList.COUNTA.abstract",functionParameter:[{name:"formula.functionList.COUNTA.functionParameter.number1.name",detail:"formula.functionList.COUNTA.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNTA.functionParameter.number2.name",detail:"formula.functionList.COUNTA.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTBLANK,functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTBLANK.description",abstract:"formula.functionList.COUNTBLANK.abstract",functionParameter:[{name:"formula.functionList.COUNTBLANK.functionParameter.range.name",detail:"formula.functionList.COUNTBLANK.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTIF,functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTIF.description",abstract:"formula.functionList.COUNTIF.abstract",functionParameter:[{name:"formula.functionList.COUNTIF.functionParameter.range.name",detail:"formula.functionList.COUNTIF.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNTIF.functionParameter.criteria.name",detail:"formula.functionList.COUNTIF.functionParameter.criteria.detail",example:'">5"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTIFS.description",abstract:"formula.functionList.COUNTIFS.abstract",functionParameter:[{name:"formula.functionList.COUNTIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteriaRange1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNTIFS.functionParameter.criteria1.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.COUNTIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteriaRange2.detail",example:"B1:B20",require:0,repeat:1},{name:"formula.functionList.COUNTIFS.functionParameter.criteria2.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COVARIANCE_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.COVARIANCE_P.description",abstract:"formula.functionList.COVARIANCE_P.abstract",functionParameter:[{name:"formula.functionList.COVARIANCE_P.functionParameter.array1.name",detail:"formula.functionList.COVARIANCE_P.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.COVARIANCE_P.functionParameter.array2.name",detail:"formula.functionList.COVARIANCE_P.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COVARIANCE_S,functionType:t.FunctionType.Statistical,description:"formula.functionList.COVARIANCE_S.description",abstract:"formula.functionList.COVARIANCE_S.abstract",functionParameter:[{name:"formula.functionList.COVARIANCE_S.functionParameter.array1.name",detail:"formula.functionList.COVARIANCE_S.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.COVARIANCE_S.functionParameter.array2.name",detail:"formula.functionList.COVARIANCE_S.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.DEVSQ,functionType:t.FunctionType.Statistical,description:"formula.functionList.DEVSQ.description",abstract:"formula.functionList.DEVSQ.abstract",functionParameter:[{name:"formula.functionList.DEVSQ.functionParameter.number1.name",detail:"formula.functionList.DEVSQ.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DEVSQ.functionParameter.number2.name",detail:"formula.functionList.DEVSQ.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.EXPON_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.EXPON_DIST.description",abstract:"formula.functionList.EXPON_DIST.abstract",functionParameter:[{name:"formula.functionList.EXPON_DIST.functionParameter.x.name",detail:"formula.functionList.EXPON_DIST.functionParameter.x.detail",example:"0.2",require:1,repeat:0},{name:"formula.functionList.EXPON_DIST.functionParameter.lambda.name",detail:"formula.functionList.EXPON_DIST.functionParameter.lambda.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.EXPON_DIST.functionParameter.cumulative.name",detail:"formula.functionList.EXPON_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_DIST.description",abstract:"formula.functionList.F_DIST.abstract",functionParameter:[{name:"formula.functionList.F_DIST.functionParameter.x.name",detail:"formula.functionList.F_DIST.functionParameter.x.detail",example:"15.2069",require:1,repeat:0},{name:"formula.functionList.F_DIST.functionParameter.degFreedom1.name",detail:"formula.functionList.F_DIST.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_DIST.functionParameter.degFreedom2.name",detail:"formula.functionList.F_DIST.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.F_DIST.functionParameter.cumulative.name",detail:"formula.functionList.F_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_DIST_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_DIST_RT.description",abstract:"formula.functionList.F_DIST_RT.abstract",functionParameter:[{name:"formula.functionList.F_DIST_RT.functionParameter.x.name",detail:"formula.functionList.F_DIST_RT.functionParameter.x.detail",example:"15.2069",require:1,repeat:0},{name:"formula.functionList.F_DIST_RT.functionParameter.degFreedom1.name",detail:"formula.functionList.F_DIST_RT.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_DIST_RT.functionParameter.degFreedom2.name",detail:"formula.functionList.F_DIST_RT.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_INV.description",abstract:"formula.functionList.F_INV.abstract",functionParameter:[{name:"formula.functionList.F_INV.functionParameter.probability.name",detail:"formula.functionList.F_INV.functionParameter.probability.detail",example:"0.01",require:1,repeat:0},{name:"formula.functionList.F_INV.functionParameter.degFreedom1.name",detail:"formula.functionList.F_INV.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_INV.functionParameter.degFreedom2.name",detail:"formula.functionList.F_INV.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_INV_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_INV_RT.description",abstract:"formula.functionList.F_INV_RT.abstract",functionParameter:[{name:"formula.functionList.F_INV_RT.functionParameter.probability.name",detail:"formula.functionList.F_INV_RT.functionParameter.probability.detail",example:"0.01",require:1,repeat:0},{name:"formula.functionList.F_INV_RT.functionParameter.degFreedom1.name",detail:"formula.functionList.F_INV_RT.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_INV_RT.functionParameter.degFreedom2.name",detail:"formula.functionList.F_INV_RT.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_TEST.description",abstract:"formula.functionList.F_TEST.abstract",functionParameter:[{name:"formula.functionList.F_TEST.functionParameter.array1.name",detail:"formula.functionList.F_TEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.F_TEST.functionParameter.array2.name",detail:"formula.functionList.F_TEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FISHER,functionType:t.FunctionType.Statistical,description:"formula.functionList.FISHER.description",abstract:"formula.functionList.FISHER.abstract",functionParameter:[{name:"formula.functionList.FISHER.functionParameter.x.name",detail:"formula.functionList.FISHER.functionParameter.x.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FISHERINV,functionType:t.FunctionType.Statistical,description:"formula.functionList.FISHERINV.description",abstract:"formula.functionList.FISHERINV.abstract",functionParameter:[{name:"formula.functionList.FISHERINV.functionParameter.y.name",detail:"formula.functionList.FISHERINV.functionParameter.y.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST.description",abstract:"formula.functionList.FORECAST.abstract",functionParameter:[{name:"formula.functionList.FORECAST.functionParameter.x.name",detail:"formula.functionList.FORECAST.functionParameter.x.detail",example:"30",require:1,repeat:0},{name:"formula.functionList.FORECAST.functionParameter.knownYs.name",detail:"formula.functionList.FORECAST.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.FORECAST.functionParameter.knownXs.name",detail:"formula.functionList.FORECAST.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS.description",abstract:"formula.functionList.FORECAST_ETS.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS_CONFINT,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS_CONFINT.description",abstract:"formula.functionList.FORECAST_ETS_CONFINT.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS_SEASONALITY,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS_SEASONALITY.description",abstract:"formula.functionList.FORECAST_ETS_SEASONALITY.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS_STAT,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS_STAT.description",abstract:"formula.functionList.FORECAST_ETS_STAT.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_LINEAR,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_LINEAR.description",abstract:"formula.functionList.FORECAST_LINEAR.abstract",functionParameter:[{name:"formula.functionList.FORECAST_LINEAR.functionParameter.x.name",detail:"formula.functionList.FORECAST_LINEAR.functionParameter.x.detail",example:"30",require:1,repeat:0},{name:"formula.functionList.FORECAST_LINEAR.functionParameter.knownYs.name",detail:"formula.functionList.FORECAST_LINEAR.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.FORECAST_LINEAR.functionParameter.knownXs.name",detail:"formula.functionList.FORECAST_LINEAR.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FREQUENCY,functionType:t.FunctionType.Statistical,description:"formula.functionList.FREQUENCY.description",abstract:"formula.functionList.FREQUENCY.abstract",functionParameter:[{name:"formula.functionList.FREQUENCY.functionParameter.dataArray.name",detail:"formula.functionList.FREQUENCY.functionParameter.dataArray.detail",example:"A2:A10",require:1,repeat:0},{name:"formula.functionList.FREQUENCY.functionParameter.binsArray.name",detail:"formula.functionList.FREQUENCY.functionParameter.binsArray.detail",example:"B2:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMA,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMA.description",abstract:"formula.functionList.GAMMA.abstract",functionParameter:[{name:"formula.functionList.GAMMA.functionParameter.number.name",detail:"formula.functionList.GAMMA.functionParameter.number.detail",example:"2.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMA_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMA_DIST.description",abstract:"formula.functionList.GAMMA_DIST.abstract",functionParameter:[{name:"formula.functionList.GAMMA_DIST.functionParameter.x.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.x.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.GAMMA_DIST.functionParameter.alpha.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.GAMMA_DIST.functionParameter.beta.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.beta.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.GAMMA_DIST.functionParameter.cumulative.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMA_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMA_INV.description",abstract:"formula.functionList.GAMMA_INV.abstract",functionParameter:[{name:"formula.functionList.GAMMA_INV.functionParameter.probability.name",detail:"formula.functionList.GAMMA_INV.functionParameter.probability.detail",example:"0.068094",require:1,repeat:0},{name:"formula.functionList.GAMMA_INV.functionParameter.alpha.name",detail:"formula.functionList.GAMMA_INV.functionParameter.alpha.detail",example:"9",require:1,repeat:0},{name:"formula.functionList.GAMMA_INV.functionParameter.beta.name",detail:"formula.functionList.GAMMA_INV.functionParameter.beta.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMALN,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMALN.description",abstract:"formula.functionList.GAMMALN.abstract",functionParameter:[{name:"formula.functionList.GAMMALN.functionParameter.x.name",detail:"formula.functionList.GAMMALN.functionParameter.x.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMALN_PRECISE,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMALN_PRECISE.description",abstract:"formula.functionList.GAMMALN_PRECISE.abstract",functionParameter:[{name:"formula.functionList.GAMMALN_PRECISE.functionParameter.x.name",detail:"formula.functionList.GAMMALN_PRECISE.functionParameter.x.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAUSS,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAUSS.description",abstract:"formula.functionList.GAUSS.abstract",functionParameter:[{name:"formula.functionList.GAUSS.functionParameter.z.name",detail:"formula.functionList.GAUSS.functionParameter.z.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GEOMEAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.GEOMEAN.description",abstract:"formula.functionList.GEOMEAN.abstract",functionParameter:[{name:"formula.functionList.GEOMEAN.functionParameter.number1.name",detail:"formula.functionList.GEOMEAN.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.GEOMEAN.functionParameter.number2.name",detail:"formula.functionList.GEOMEAN.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GROWTH,functionType:t.FunctionType.Statistical,description:"formula.functionList.GROWTH.description",abstract:"formula.functionList.GROWTH.abstract",functionParameter:[{name:"formula.functionList.GROWTH.functionParameter.knownYs.name",detail:"formula.functionList.GROWTH.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.GROWTH.functionParameter.knownXs.name",detail:"formula.functionList.GROWTH.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.GROWTH.functionParameter.newXs.name",detail:"formula.functionList.GROWTH.functionParameter.newXs.detail",example:"A9:A10",require:0,repeat:0},{name:"formula.functionList.GROWTH.functionParameter.constb.name",detail:"formula.functionList.GROWTH.functionParameter.constb.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.HARMEAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.HARMEAN.description",abstract:"formula.functionList.HARMEAN.abstract",functionParameter:[{name:"formula.functionList.HARMEAN.functionParameter.number1.name",detail:"formula.functionList.HARMEAN.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HARMEAN.functionParameter.number2.name",detail:"formula.functionList.HARMEAN.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.HYPGEOM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.HYPGEOM_DIST.description",abstract:"formula.functionList.HYPGEOM_DIST.abstract",functionParameter:[{name:"formula.functionList.HYPGEOM_DIST.functionParameter.sampleS.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.sampleS.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.numberSample.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.numberSample.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.populationS.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.populationS.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.numberPop.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.numberPop.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.INTERCEPT,functionType:t.FunctionType.Statistical,description:"formula.functionList.INTERCEPT.description",abstract:"formula.functionList.INTERCEPT.abstract",functionParameter:[{name:"formula.functionList.INTERCEPT.functionParameter.knownYs.name",detail:"formula.functionList.INTERCEPT.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.INTERCEPT.functionParameter.knownXs.name",detail:"formula.functionList.INTERCEPT.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.KURT,functionType:t.FunctionType.Statistical,description:"formula.functionList.KURT.description",abstract:"formula.functionList.KURT.abstract",functionParameter:[{name:"formula.functionList.KURT.functionParameter.number1.name",detail:"formula.functionList.KURT.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.KURT.functionParameter.number2.name",detail:"formula.functionList.KURT.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LARGE,functionType:t.FunctionType.Statistical,description:"formula.functionList.LARGE.description",abstract:"formula.functionList.LARGE.abstract",functionParameter:[{name:"formula.functionList.LARGE.functionParameter.array.name",detail:"formula.functionList.LARGE.functionParameter.array.detail",example:"A2:B6",require:1,repeat:0},{name:"formula.functionList.LARGE.functionParameter.k.name",detail:"formula.functionList.LARGE.functionParameter.k.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LINEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.LINEST.description",abstract:"formula.functionList.LINEST.abstract",functionParameter:[{name:"formula.functionList.LINEST.functionParameter.knownYs.name",detail:"formula.functionList.LINEST.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.LINEST.functionParameter.knownXs.name",detail:"formula.functionList.LINEST.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.LINEST.functionParameter.constb.name",detail:"formula.functionList.LINEST.functionParameter.constb.detail",example:"true",require:0,repeat:0},{name:"formula.functionList.LINEST.functionParameter.stats.name",detail:"formula.functionList.LINEST.functionParameter.stats.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LOGEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.LOGEST.description",abstract:"formula.functionList.LOGEST.abstract",functionParameter:[{name:"formula.functionList.LOGEST.functionParameter.knownYs.name",detail:"formula.functionList.LOGEST.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.LOGEST.functionParameter.knownXs.name",detail:"formula.functionList.LOGEST.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.LOGEST.functionParameter.constb.name",detail:"formula.functionList.LOGEST.functionParameter.constb.detail",example:"true",require:0,repeat:0},{name:"formula.functionList.LOGEST.functionParameter.stats.name",detail:"formula.functionList.LOGEST.functionParameter.stats.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LOGNORM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.LOGNORM_DIST.description",abstract:"formula.functionList.LOGNORM_DIST.abstract",functionParameter:[{name:"formula.functionList.LOGNORM_DIST.functionParameter.x.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.LOGNORM_DIST.functionParameter.mean.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGNORM_DIST.functionParameter.standardDev.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.LOGNORM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LOGNORM_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.LOGNORM_INV.description",abstract:"formula.functionList.LOGNORM_INV.abstract",functionParameter:[{name:"formula.functionList.LOGNORM_INV.functionParameter.probability.name",detail:"formula.functionList.LOGNORM_INV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.LOGNORM_INV.functionParameter.mean.name",detail:"formula.functionList.LOGNORM_INV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGNORM_INV.functionParameter.standardDev.name",detail:"formula.functionList.LOGNORM_INV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MARGINOFERROR,aliasFunctionName:"formula.functionList.MARGINOFERROR.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.MARGINOFERROR.description",abstract:"formula.functionList.MARGINOFERROR.abstract",functionParameter:[{name:"formula.functionList.MARGINOFERROR.functionParameter.range.name",detail:"formula.functionList.MARGINOFERROR.functionParameter.range.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MARGINOFERROR.functionParameter.confidence.name",detail:"formula.functionList.MARGINOFERROR.functionParameter.confidence.detail",example:"0.95",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MAX,aliasFunctionName:"formula.functionList.MAX.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.MAX.description",abstract:"formula.functionList.MAX.abstract",functionParameter:[{name:"formula.functionList.MAX.functionParameter.number1.name",detail:"formula.functionList.MAX.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MAX.functionParameter.number2.name",detail:"formula.functionList.MAX.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MAXA,functionType:t.FunctionType.Statistical,description:"formula.functionList.MAXA.description",abstract:"formula.functionList.MAXA.abstract",functionParameter:[{name:"formula.functionList.MAXA.functionParameter.value1.name",detail:"formula.functionList.MAXA.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MAXA.functionParameter.value2.name",detail:"formula.functionList.MAXA.functionParameter.value2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MAXIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.MAXIFS.description",abstract:"formula.functionList.MAXIFS.abstract",functionParameter:[{name:"formula.functionList.MAXIFS.functionParameter.maxRange.name",detail:"formula.functionList.MAXIFS.functionParameter.maxRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MAXIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.MAXIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.MAXIFS.functionParameter.criteria1.name",detail:"formula.functionList.MAXIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.MAXIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.MAXIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.MAXIFS.functionParameter.criteria2.name",detail:"formula.functionList.MAXIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MEDIAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.MEDIAN.description",abstract:"formula.functionList.MEDIAN.abstract",functionParameter:[{name:"formula.functionList.MEDIAN.functionParameter.number1.name",detail:"formula.functionList.MEDIAN.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.MEDIAN.functionParameter.number2.name",detail:"formula.functionList.MEDIAN.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MIN,aliasFunctionName:"formula.functionList.MIN.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.MIN.description",abstract:"formula.functionList.MIN.abstract",functionParameter:[{name:"formula.functionList.MIN.functionParameter.number1.name",detail:"formula.functionList.MIN.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MIN.functionParameter.number2.name",detail:"formula.functionList.MIN.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MINA,functionType:t.FunctionType.Statistical,description:"formula.functionList.MINA.description",abstract:"formula.functionList.MINA.abstract",functionParameter:[{name:"formula.functionList.MINA.functionParameter.value1.name",detail:"formula.functionList.MINA.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MINA.functionParameter.value2.name",detail:"formula.functionList.MINA.functionParameter.value2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MINIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.MINIFS.description",abstract:"formula.functionList.MINIFS.abstract",functionParameter:[{name:"formula.functionList.MINIFS.functionParameter.minRange.name",detail:"formula.functionList.MINIFS.functionParameter.minRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MINIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.MINIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.MINIFS.functionParameter.criteria1.name",detail:"formula.functionList.MINIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.MINIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.MINIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.MINIFS.functionParameter.criteria2.name",detail:"formula.functionList.MINIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MODE_MULT,functionType:t.FunctionType.Statistical,description:"formula.functionList.MODE_MULT.description",abstract:"formula.functionList.MODE_MULT.abstract",functionParameter:[{name:"formula.functionList.MODE_MULT.functionParameter.number1.name",detail:"formula.functionList.MODE_MULT.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MODE_MULT.functionParameter.number2.name",detail:"formula.functionList.MODE_MULT.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MODE_SNGL,functionType:t.FunctionType.Statistical,description:"formula.functionList.MODE_SNGL.description",abstract:"formula.functionList.MODE_SNGL.abstract",functionParameter:[{name:"formula.functionList.MODE_SNGL.functionParameter.number1.name",detail:"formula.functionList.MODE_SNGL.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MODE_SNGL.functionParameter.number2.name",detail:"formula.functionList.MODE_SNGL.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NEGBINOM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.NEGBINOM_DIST.description",abstract:"formula.functionList.NEGBINOM_DIST.abstract",functionParameter:[{name:"formula.functionList.NEGBINOM_DIST.functionParameter.numberF.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.numberF.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.NEGBINOM_DIST.functionParameter.numberS.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.numberS.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.NEGBINOM_DIST.functionParameter.probabilityS.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.probabilityS.detail",example:"0.25",require:1,repeat:0},{name:"formula.functionList.NEGBINOM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_DIST.description",abstract:"formula.functionList.NORM_DIST.abstract",functionParameter:[{name:"formula.functionList.NORM_DIST.functionParameter.x.name",detail:"formula.functionList.NORM_DIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.NORM_DIST.functionParameter.mean.name",detail:"formula.functionList.NORM_DIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORM_DIST.functionParameter.standardDev.name",detail:"formula.functionList.NORM_DIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.NORM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.NORM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_INV.description",abstract:"formula.functionList.NORM_INV.abstract",functionParameter:[{name:"formula.functionList.NORM_INV.functionParameter.probability.name",detail:"formula.functionList.NORM_INV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.NORM_INV.functionParameter.mean.name",detail:"formula.functionList.NORM_INV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORM_INV.functionParameter.standardDev.name",detail:"formula.functionList.NORM_INV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_S_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_S_DIST.description",abstract:"formula.functionList.NORM_S_DIST.abstract",functionParameter:[{name:"formula.functionList.NORM_S_DIST.functionParameter.z.name",detail:"formula.functionList.NORM_S_DIST.functionParameter.z.detail",example:"1.333333",require:1,repeat:0},{name:"formula.functionList.NORM_S_DIST.functionParameter.cumulative.name",detail:"formula.functionList.NORM_S_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_S_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_S_INV.description",abstract:"formula.functionList.NORM_S_INV.abstract",functionParameter:[{name:"formula.functionList.NORM_S_INV.functionParameter.probability.name",detail:"formula.functionList.NORM_S_INV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PEARSON,functionType:t.FunctionType.Statistical,description:"formula.functionList.PEARSON.description",abstract:"formula.functionList.PEARSON.abstract",functionParameter:[{name:"formula.functionList.PEARSON.functionParameter.array1.name",detail:"formula.functionList.PEARSON.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PEARSON.functionParameter.array2.name",detail:"formula.functionList.PEARSON.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTILE_EXC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTILE_EXC.description",abstract:"formula.functionList.PERCENTILE_EXC.abstract",functionParameter:[{name:"formula.functionList.PERCENTILE_EXC.functionParameter.array.name",detail:"formula.functionList.PERCENTILE_EXC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTILE_EXC.functionParameter.k.name",detail:"formula.functionList.PERCENTILE_EXC.functionParameter.k.detail",example:"0.3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTILE_INC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTILE_INC.description",abstract:"formula.functionList.PERCENTILE_INC.abstract",functionParameter:[{name:"formula.functionList.PERCENTILE_INC.functionParameter.array.name",detail:"formula.functionList.PERCENTILE_INC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTILE_INC.functionParameter.k.name",detail:"formula.functionList.PERCENTILE_INC.functionParameter.k.detail",example:"0.3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTRANK_EXC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTRANK_EXC.description",abstract:"formula.functionList.PERCENTRANK_EXC.abstract",functionParameter:[{name:"formula.functionList.PERCENTRANK_EXC.functionParameter.array.name",detail:"formula.functionList.PERCENTRANK_EXC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_EXC.functionParameter.x.name",detail:"formula.functionList.PERCENTRANK_EXC.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_EXC.functionParameter.significance.name",detail:"formula.functionList.PERCENTRANK_EXC.functionParameter.significance.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTRANK_INC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTRANK_INC.description",abstract:"formula.functionList.PERCENTRANK_INC.abstract",functionParameter:[{name:"formula.functionList.PERCENTRANK_INC.functionParameter.array.name",detail:"formula.functionList.PERCENTRANK_INC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_INC.functionParameter.x.name",detail:"formula.functionList.PERCENTRANK_INC.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_INC.functionParameter.significance.name",detail:"formula.functionList.PERCENTRANK_INC.functionParameter.significance.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERMUT,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERMUT.description",abstract:"formula.functionList.PERMUT.abstract",functionParameter:[{name:"formula.functionList.PERMUT.functionParameter.number.name",detail:"formula.functionList.PERMUT.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.PERMUT.functionParameter.numberChosen.name",detail:"formula.functionList.PERMUT.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERMUTATIONA,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERMUTATIONA.description",abstract:"formula.functionList.PERMUTATIONA.abstract",functionParameter:[{name:"formula.functionList.PERMUT.functionParameter.number.name",detail:"formula.functionList.PERMUT.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.PERMUT.functionParameter.numberChosen.name",detail:"formula.functionList.PERMUT.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PHI,functionType:t.FunctionType.Statistical,description:"formula.functionList.PHI.description",abstract:"formula.functionList.PHI.abstract",functionParameter:[{name:"formula.functionList.PHI.functionParameter.x.name",detail:"formula.functionList.PHI.functionParameter.x.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.POISSON_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.POISSON_DIST.description",abstract:"formula.functionList.POISSON_DIST.abstract",functionParameter:[{name:"formula.functionList.POISSON_DIST.functionParameter.x.name",detail:"formula.functionList.POISSON_DIST.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.POISSON_DIST.functionParameter.mean.name",detail:"formula.functionList.POISSON_DIST.functionParameter.mean.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.POISSON_DIST.functionParameter.cumulative.name",detail:"formula.functionList.POISSON_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PROB,functionType:t.FunctionType.Statistical,description:"formula.functionList.PROB.description",abstract:"formula.functionList.PROB.abstract",functionParameter:[{name:"formula.functionList.PROB.functionParameter.xRange.name",detail:"formula.functionList.PROB.functionParameter.xRange.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PROB.functionParameter.probRange.name",detail:"formula.functionList.PROB.functionParameter.probRange.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.PROB.functionParameter.lowerLimit.name",detail:"formula.functionList.PROB.functionParameter.lowerLimit.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.PROB.functionParameter.upperLimit.name",detail:"formula.functionList.PROB.functionParameter.upperLimit.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.QUARTILE_EXC,functionType:t.FunctionType.Statistical,description:"formula.functionList.QUARTILE_EXC.description",abstract:"formula.functionList.QUARTILE_EXC.abstract",functionParameter:[{name:"formula.functionList.QUARTILE_EXC.functionParameter.array.name",detail:"formula.functionList.QUARTILE_EXC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.QUARTILE_EXC.functionParameter.quart.name",detail:"formula.functionList.QUARTILE_EXC.functionParameter.quart.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.QUARTILE_INC,functionType:t.FunctionType.Statistical,description:"formula.functionList.QUARTILE_INC.description",abstract:"formula.functionList.QUARTILE_INC.abstract",functionParameter:[{name:"formula.functionList.QUARTILE_INC.functionParameter.array.name",detail:"formula.functionList.QUARTILE_INC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.QUARTILE_INC.functionParameter.quart.name",detail:"formula.functionList.QUARTILE_INC.functionParameter.quart.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.RANK_AVG,functionType:t.FunctionType.Statistical,description:"formula.functionList.RANK_AVG.description",abstract:"formula.functionList.RANK_AVG.abstract",functionParameter:[{name:"formula.functionList.RANK_AVG.functionParameter.number.name",detail:"formula.functionList.RANK_AVG.functionParameter.number.detail",example:"A3",require:1,repeat:0},{name:"formula.functionList.RANK_AVG.functionParameter.ref.name",detail:"formula.functionList.RANK_AVG.functionParameter.ref.detail",example:"A2:A6",require:1,repeat:0},{name:"formula.functionList.RANK_AVG.functionParameter.order.name",detail:"formula.functionList.RANK_AVG.functionParameter.order.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.RANK_EQ,functionType:t.FunctionType.Statistical,description:"formula.functionList.RANK_EQ.description",abstract:"formula.functionList.RANK_EQ.abstract",functionParameter:[{name:"formula.functionList.RANK_EQ.functionParameter.number.name",detail:"formula.functionList.RANK_EQ.functionParameter.number.detail",example:"A3",require:1,repeat:0},{name:"formula.functionList.RANK_EQ.functionParameter.ref.name",detail:"formula.functionList.RANK_EQ.functionParameter.ref.detail",example:"A2:A6",require:1,repeat:0},{name:"formula.functionList.RANK_EQ.functionParameter.order.name",detail:"formula.functionList.RANK_EQ.functionParameter.order.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.RSQ,functionType:t.FunctionType.Statistical,description:"formula.functionList.RSQ.description",abstract:"formula.functionList.RSQ.abstract",functionParameter:[{name:"formula.functionList.RSQ.functionParameter.array1.name",detail:"formula.functionList.RSQ.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.RSQ.functionParameter.array2.name",detail:"formula.functionList.RSQ.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SKEW,functionType:t.FunctionType.Statistical,description:"formula.functionList.SKEW.description",abstract:"formula.functionList.SKEW.abstract",functionParameter:[{name:"formula.functionList.SKEW.functionParameter.number1.name",detail:"formula.functionList.SKEW.functionParameter.number1.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.SKEW.functionParameter.number2.name",detail:"formula.functionList.SKEW.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SKEW_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.SKEW_P.description",abstract:"formula.functionList.SKEW_P.abstract",functionParameter:[{name:"formula.functionList.SKEW_P.functionParameter.number1.name",detail:"formula.functionList.SKEW_P.functionParameter.number1.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.SKEW_P.functionParameter.number2.name",detail:"formula.functionList.SKEW_P.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SLOPE,functionType:t.FunctionType.Statistical,description:"formula.functionList.SLOPE.description",abstract:"formula.functionList.SLOPE.abstract",functionParameter:[{name:"formula.functionList.SLOPE.functionParameter.knownYs.name",detail:"formula.functionList.SLOPE.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.SLOPE.functionParameter.knownXs.name",detail:"formula.functionList.SLOPE.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SMALL,functionType:t.FunctionType.Statistical,description:"formula.functionList.SMALL.description",abstract:"formula.functionList.SMALL.abstract",functionParameter:[{name:"formula.functionList.SMALL.functionParameter.array.name",detail:"formula.functionList.SMALL.functionParameter.array.detail",example:"A2:B6",require:1,repeat:0},{name:"formula.functionList.SMALL.functionParameter.k.name",detail:"formula.functionList.SMALL.functionParameter.k.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STANDARDIZE,functionType:t.FunctionType.Statistical,description:"formula.functionList.STANDARDIZE.description",abstract:"formula.functionList.STANDARDIZE.abstract",functionParameter:[{name:"formula.functionList.STANDARDIZE.functionParameter.x.name",detail:"formula.functionList.STANDARDIZE.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.STANDARDIZE.functionParameter.mean.name",detail:"formula.functionList.STANDARDIZE.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.STANDARDIZE.functionParameter.standardDev.name",detail:"formula.functionList.STANDARDIZE.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEV_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEV_P.description",abstract:"formula.functionList.STDEV_P.abstract",functionParameter:[{name:"formula.functionList.STDEV_P.functionParameter.number1.name",detail:"formula.functionList.STDEV_P.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEV_P.functionParameter.number2.name",detail:"formula.functionList.STDEV_P.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEV_S,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEV_S.description",abstract:"formula.functionList.STDEV_S.abstract",functionParameter:[{name:"formula.functionList.STDEV_S.functionParameter.number1.name",detail:"formula.functionList.STDEV_S.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEV_S.functionParameter.number2.name",detail:"formula.functionList.STDEV_S.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEVA,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEVA.description",abstract:"formula.functionList.STDEVA.abstract",functionParameter:[{name:"formula.functionList.STDEVA.functionParameter.value1.name",detail:"formula.functionList.STDEVA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEVA.functionParameter.value2.name",detail:"formula.functionList.STDEVA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEVPA,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEVPA.description",abstract:"formula.functionList.STDEVPA.abstract",functionParameter:[{name:"formula.functionList.STDEVPA.functionParameter.value1.name",detail:"formula.functionList.STDEVPA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEVPA.functionParameter.value2.name",detail:"formula.functionList.STDEVPA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STEYX,functionType:t.FunctionType.Statistical,description:"formula.functionList.STEYX.description",abstract:"formula.functionList.STEYX.abstract",functionParameter:[{name:"formula.functionList.STEYX.functionParameter.knownYs.name",detail:"formula.functionList.STEYX.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.STEYX.functionParameter.knownXs.name",detail:"formula.functionList.STEYX.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_DIST.description",abstract:"formula.functionList.T_DIST.abstract",functionParameter:[{name:"formula.functionList.T_DIST.functionParameter.x.name",detail:"formula.functionList.T_DIST.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.T_DIST.functionParameter.degFreedom.name",detail:"formula.functionList.T_DIST.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.T_DIST.functionParameter.cumulative.name",detail:"formula.functionList.T_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_DIST_2T,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_DIST_2T.description",abstract:"formula.functionList.T_DIST_2T.abstract",functionParameter:[{name:"formula.functionList.T_DIST_2T.functionParameter.x.name",detail:"formula.functionList.T_DIST_2T.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.T_DIST_2T.functionParameter.degFreedom.name",detail:"formula.functionList.T_DIST_2T.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_DIST_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_DIST_RT.description",abstract:"formula.functionList.T_DIST_RT.abstract",functionParameter:[{name:"formula.functionList.T_DIST_RT.functionParameter.x.name",detail:"formula.functionList.T_DIST_RT.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.T_DIST_RT.functionParameter.degFreedom.name",detail:"formula.functionList.T_DIST_RT.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_INV.description",abstract:"formula.functionList.T_INV.abstract",functionParameter:[{name:"formula.functionList.T_INV.functionParameter.probability.name",detail:"formula.functionList.T_INV.functionParameter.probability.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.T_INV.functionParameter.degFreedom.name",detail:"formula.functionList.T_INV.functionParameter.degFreedom.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_INV_2T,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_INV_2T.description",abstract:"formula.functionList.T_INV_2T.abstract",functionParameter:[{name:"formula.functionList.T_INV_2T.functionParameter.probability.name",detail:"formula.functionList.T_INV_2T.functionParameter.probability.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.T_INV_2T.functionParameter.degFreedom.name",detail:"formula.functionList.T_INV_2T.functionParameter.degFreedom.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_TEST.description",abstract:"formula.functionList.T_TEST.abstract",functionParameter:[{name:"formula.functionList.T_TEST.functionParameter.array1.name",detail:"formula.functionList.T_TEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.T_TEST.functionParameter.array2.name",detail:"formula.functionList.T_TEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.T_TEST.functionParameter.tails.name",detail:"formula.functionList.T_TEST.functionParameter.tails.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.T_TEST.functionParameter.type.name",detail:"formula.functionList.T_TEST.functionParameter.type.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.TREND,functionType:t.FunctionType.Statistical,description:"formula.functionList.TREND.description",abstract:"formula.functionList.TREND.abstract",functionParameter:[{name:"formula.functionList.TREND.functionParameter.knownYs.name",detail:"formula.functionList.TREND.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.TREND.functionParameter.knownXs.name",detail:"formula.functionList.TREND.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.TREND.functionParameter.newXs.name",detail:"formula.functionList.TREND.functionParameter.newXs.detail",example:"A9:A10",require:0,repeat:0},{name:"formula.functionList.TREND.functionParameter.constb.name",detail:"formula.functionList.TREND.functionParameter.constb.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.TRIMMEAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.TRIMMEAN.description",abstract:"formula.functionList.TRIMMEAN.abstract",functionParameter:[{name:"formula.functionList.TRIMMEAN.functionParameter.array.name",detail:"formula.functionList.TRIMMEAN.functionParameter.array.detail",example:"A2:A12",require:1,repeat:0},{name:"formula.functionList.TRIMMEAN.functionParameter.percent.name",detail:"formula.functionList.TRIMMEAN.functionParameter.percent.detail",example:"0.2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VAR_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.VAR_P.description",abstract:"formula.functionList.VAR_P.abstract",functionParameter:[{name:"formula.functionList.VAR_P.functionParameter.number1.name",detail:"formula.functionList.VAR_P.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VAR_P.functionParameter.number2.name",detail:"formula.functionList.VAR_P.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VAR_S,functionType:t.FunctionType.Statistical,description:"formula.functionList.VAR_S.description",abstract:"formula.functionList.VAR_S.abstract",functionParameter:[{name:"formula.functionList.VAR_S.functionParameter.number1.name",detail:"formula.functionList.VAR_S.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VAR_S.functionParameter.number2.name",detail:"formula.functionList.VAR_S.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VARA,functionType:t.FunctionType.Statistical,description:"formula.functionList.VARA.description",abstract:"formula.functionList.VARA.abstract",functionParameter:[{name:"formula.functionList.VARA.functionParameter.value1.name",detail:"formula.functionList.VARA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VARA.functionParameter.value2.name",detail:"formula.functionList.VARA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VARPA,functionType:t.FunctionType.Statistical,description:"formula.functionList.VARPA.description",abstract:"formula.functionList.VARPA.abstract",functionParameter:[{name:"formula.functionList.VARPA.functionParameter.value1.name",detail:"formula.functionList.VARPA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VARPA.functionParameter.value2.name",detail:"formula.functionList.VARPA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.WEIBULL_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.WEIBULL_DIST.description",abstract:"formula.functionList.WEIBULL_DIST.abstract",functionParameter:[{name:"formula.functionList.WEIBULL_DIST.functionParameter.x.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.x.detail",example:"105",require:1,repeat:0},{name:"formula.functionList.WEIBULL_DIST.functionParameter.alpha.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.alpha.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.WEIBULL_DIST.functionParameter.beta.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.beta.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.WEIBULL_DIST.functionParameter.cumulative.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.Z_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.Z_TEST.description",abstract:"formula.functionList.Z_TEST.abstract",functionParameter:[{name:"formula.functionList.Z_TEST.functionParameter.array.name",detail:"formula.functionList.Z_TEST.functionParameter.array.detail",example:"A2:A11",require:1,repeat:0},{name:"formula.functionList.Z_TEST.functionParameter.x.name",detail:"formula.functionList.Z_TEST.functionParameter.x.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.Z_TEST.functionParameter.sigma.name",detail:"formula.functionList.Z_TEST.functionParameter.sigma.detail",example:"10",require:0,repeat:0}]}],ke=[{functionName:t.FUNCTION_NAMES_TEXT.ASC,functionType:t.FunctionType.Text,description:"formula.functionList.ASC.description",abstract:"formula.functionList.ASC.abstract",functionParameter:[{name:"formula.functionList.ASC.functionParameter.text.name",detail:"formula.functionList.ASC.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.ARRAYTOTEXT,functionType:t.FunctionType.Text,description:"formula.functionList.ARRAYTOTEXT.description",abstract:"formula.functionList.ARRAYTOTEXT.abstract",functionParameter:[{name:"formula.functionList.ARRAYTOTEXT.functionParameter.array.name",detail:"formula.functionList.ARRAYTOTEXT.functionParameter.array.detail",example:"A2:B4",require:1,repeat:0},{name:"formula.functionList.ARRAYTOTEXT.functionParameter.format.name",detail:"formula.functionList.ARRAYTOTEXT.functionParameter.format.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.BAHTTEXT,functionType:t.FunctionType.Text,description:"formula.functionList.BAHTTEXT.description",abstract:"formula.functionList.BAHTTEXT.abstract",functionParameter:[{name:"formula.functionList.BAHTTEXT.functionParameter.number.name",detail:"formula.functionList.BAHTTEXT.functionParameter.number.detail",example:"1234",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CHAR,functionType:t.FunctionType.Text,description:"formula.functionList.CHAR.description",abstract:"formula.functionList.CHAR.abstract",functionParameter:[{name:"formula.functionList.CHAR.functionParameter.number.name",detail:"formula.functionList.CHAR.functionParameter.number.detail",example:"65",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CLEAN,functionType:t.FunctionType.Text,description:"formula.functionList.CLEAN.description",abstract:"formula.functionList.CLEAN.abstract",functionParameter:[{name:"formula.functionList.CLEAN.functionParameter.text.name",detail:"formula.functionList.CLEAN.functionParameter.text.detail",example:'CHAR(1)&"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CODE,functionType:t.FunctionType.Text,description:"formula.functionList.CODE.description",abstract:"formula.functionList.CODE.abstract",functionParameter:[{name:"formula.functionList.CODE.functionParameter.text.name",detail:"formula.functionList.CODE.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CONCAT,functionType:t.FunctionType.Text,description:"formula.functionList.CONCAT.description",abstract:"formula.functionList.CONCAT.abstract",functionParameter:[{name:"formula.functionList.CONCAT.functionParameter.text1.name",detail:"formula.functionList.CONCAT.functionParameter.text1.detail",example:'"Hello"',require:1,repeat:0},{name:"formula.functionList.CONCAT.functionParameter.text2.name",detail:"formula.functionList.CONCAT.functionParameter.text2.detail",example:'"Univer"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_TEXT.CONCATENATE,functionType:t.FunctionType.Text,description:"formula.functionList.CONCATENATE.description",abstract:"formula.functionList.CONCATENATE.abstract",functionParameter:[{name:"formula.functionList.CONCATENATE.functionParameter.text1.name",detail:"formula.functionList.CONCATENATE.functionParameter.text1.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.CONCATENATE.functionParameter.text2.name",detail:"formula.functionList.CONCATENATE.functionParameter.text2.detail",example:"A2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_TEXT.DBCS,functionType:t.FunctionType.Text,description:"formula.functionList.DBCS.description",abstract:"formula.functionList.DBCS.abstract",functionParameter:[{name:"formula.functionList.DBCS.functionParameter.text.name",detail:"formula.functionList.DBCS.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.DOLLAR,functionType:t.FunctionType.Text,description:"formula.functionList.DOLLAR.description",abstract:"formula.functionList.DOLLAR.abstract",functionParameter:[{name:"formula.functionList.DOLLAR.functionParameter.number.name",detail:"formula.functionList.DOLLAR.functionParameter.number.detail",example:"1234.567",require:1,repeat:0},{name:"formula.functionList.DOLLAR.functionParameter.decimals.name",detail:"formula.functionList.DOLLAR.functionParameter.decimals.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.EXACT,functionType:t.FunctionType.Text,description:"formula.functionList.EXACT.description",abstract:"formula.functionList.EXACT.abstract",functionParameter:[{name:"formula.functionList.EXACT.functionParameter.text1.name",detail:"formula.functionList.EXACT.functionParameter.text1.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.EXACT.functionParameter.text2.name",detail:"formula.functionList.EXACT.functionParameter.text2.detail",example:'"univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.FIND,functionType:t.FunctionType.Text,description:"formula.functionList.FIND.description",abstract:"formula.functionList.FIND.abstract",functionParameter:[{name:"formula.functionList.FIND.functionParameter.findText.name",detail:"formula.functionList.FIND.functionParameter.findText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.FIND.functionParameter.withinText.name",detail:"formula.functionList.FIND.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.FIND.functionParameter.startNum.name",detail:"formula.functionList.FIND.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.FINDB,functionType:t.FunctionType.Text,description:"formula.functionList.FINDB.description",abstract:"formula.functionList.FINDB.abstract",functionParameter:[{name:"formula.functionList.FINDB.functionParameter.findText.name",detail:"formula.functionList.FINDB.functionParameter.findText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.FINDB.functionParameter.withinText.name",detail:"formula.functionList.FINDB.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.FINDB.functionParameter.startNum.name",detail:"formula.functionList.FINDB.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.FIXED,functionType:t.FunctionType.Text,description:"formula.functionList.FIXED.description",abstract:"formula.functionList.FIXED.abstract",functionParameter:[{name:"formula.functionList.FIXED.functionParameter.number.name",detail:"formula.functionList.FIXED.functionParameter.number.detail",example:"1234.567",require:1,repeat:0},{name:"formula.functionList.FIXED.functionParameter.decimals.name",detail:"formula.functionList.FIXED.functionParameter.decimals.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.FIXED.functionParameter.noCommas.name",detail:"formula.functionList.FIXED.functionParameter.noCommas.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LEFT,functionType:t.FunctionType.Text,description:"formula.functionList.LEFT.description",abstract:"formula.functionList.LEFT.abstract",functionParameter:[{name:"formula.functionList.LEFT.functionParameter.text.name",detail:"formula.functionList.LEFT.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.LEFT.functionParameter.numChars.name",detail:"formula.functionList.LEFT.functionParameter.numChars.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LEFTB,functionType:t.FunctionType.Text,description:"formula.functionList.LEFTB.description",abstract:"formula.functionList.LEFTB.abstract",functionParameter:[{name:"formula.functionList.LEFTB.functionParameter.text.name",detail:"formula.functionList.LEFTB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.LEFTB.functionParameter.numBytes.name",detail:"formula.functionList.LEFTB.functionParameter.numBytes.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LEN,functionType:t.FunctionType.Text,description:"formula.functionList.LEN.description",abstract:"formula.functionList.LEN.abstract",functionParameter:[{name:"formula.functionList.LEN.functionParameter.text.name",detail:"formula.functionList.LEN.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LENB,functionType:t.FunctionType.Text,description:"formula.functionList.LENB.description",abstract:"formula.functionList.LENB.abstract",functionParameter:[{name:"formula.functionList.LENB.functionParameter.text.name",detail:"formula.functionList.LENB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LOWER,functionType:t.FunctionType.Text,description:"formula.functionList.LOWER.description",abstract:"formula.functionList.LOWER.abstract",functionParameter:[{name:"formula.functionList.LOWER.functionParameter.text.name",detail:"formula.functionList.LOWER.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.MID,functionType:t.FunctionType.Text,description:"formula.functionList.MID.description",abstract:"formula.functionList.MID.abstract",functionParameter:[{name:"formula.functionList.MID.functionParameter.text.name",detail:"formula.functionList.MID.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.MID.functionParameter.startNum.name",detail:"formula.functionList.MID.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.MID.functionParameter.numChars.name",detail:"formula.functionList.MID.functionParameter.numChars.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.MIDB,functionType:t.FunctionType.Text,description:"formula.functionList.MIDB.description",abstract:"formula.functionList.MIDB.abstract",functionParameter:[{name:"formula.functionList.MIDB.functionParameter.text.name",detail:"formula.functionList.MIDB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.MIDB.functionParameter.startNum.name",detail:"formula.functionList.MIDB.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.MIDB.functionParameter.numBytes.name",detail:"formula.functionList.MIDB.functionParameter.numBytes.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.NUMBERSTRING,functionType:t.FunctionType.Text,description:"formula.functionList.NUMBERSTRING.description",abstract:"formula.functionList.NUMBERSTRING.abstract",functionParameter:[{name:"formula.functionList.NUMBERSTRING.functionParameter.number.name",detail:"formula.functionList.NUMBERSTRING.functionParameter.number.detail",example:"123",require:1,repeat:0},{name:"formula.functionList.NUMBERSTRING.functionParameter.type.name",detail:"formula.functionList.NUMBERSTRING.functionParameter.type.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.NUMBERVALUE,functionType:t.FunctionType.Text,description:"formula.functionList.NUMBERVALUE.description",abstract:"formula.functionList.NUMBERVALUE.abstract",functionParameter:[{name:"formula.functionList.NUMBERVALUE.functionParameter.text.name",detail:"formula.functionList.NUMBERVALUE.functionParameter.text.detail",example:'"2.500,27"',require:1,repeat:0},{name:"formula.functionList.NUMBERVALUE.functionParameter.decimalSeparator.name",detail:"formula.functionList.NUMBERVALUE.functionParameter.decimalSeparator.detail",example:'","',require:0,repeat:0},{name:"formula.functionList.NUMBERVALUE.functionParameter.groupSeparator.name",detail:"formula.functionList.NUMBERVALUE.functionParameter.groupSeparator.detail",example:'"."',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.PHONETIC,functionType:t.FunctionType.Text,description:"formula.functionList.PHONETIC.description",abstract:"formula.functionList.PHONETIC.abstract",functionParameter:[{name:"formula.functionList.PHONETIC.functionParameter.number1.name",detail:"formula.functionList.PHONETIC.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.PHONETIC.functionParameter.number2.name",detail:"formula.functionList.PHONETIC.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.PROPER,functionType:t.FunctionType.Text,description:"formula.functionList.PROPER.description",abstract:"formula.functionList.PROPER.abstract",functionParameter:[{name:"formula.functionList.PROPER.functionParameter.text.name",detail:"formula.functionList.PROPER.functionParameter.text.detail",example:'"hello univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGEXEXTRACT,functionType:t.FunctionType.Text,description:"formula.functionList.REGEXEXTRACT.description",abstract:"formula.functionList.REGEXEXTRACT.abstract",functionParameter:[{name:"formula.functionList.REGEXEXTRACT.functionParameter.text.name",detail:"formula.functionList.REGEXEXTRACT.functionParameter.text.detail",example:'"abcdefg"',require:1,repeat:0},{name:"formula.functionList.REGEXEXTRACT.functionParameter.regularExpression.name",detail:"formula.functionList.REGEXEXTRACT.functionParameter.regularExpression.detail",example:'"c.*f"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGEXMATCH,functionType:t.FunctionType.Text,description:"formula.functionList.REGEXMATCH.description",abstract:"formula.functionList.REGEXMATCH.abstract",functionParameter:[{name:"formula.functionList.REGEXMATCH.functionParameter.text.name",detail:"formula.functionList.REGEXMATCH.functionParameter.text.detail",example:'"Spreadsheets"',require:1,repeat:0},{name:"formula.functionList.REGEXMATCH.functionParameter.regularExpression.name",detail:"formula.functionList.REGEXMATCH.functionParameter.regularExpression.detail",example:'"S.r"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGEXREPLACE,functionType:t.FunctionType.Text,description:"formula.functionList.REGEXREPLACE.description",abstract:"formula.functionList.REGEXREPLACE.abstract",functionParameter:[{name:"formula.functionList.REGEXREPLACE.functionParameter.text.name",detail:"formula.functionList.REGEXREPLACE.functionParameter.text.detail",example:'"abcedfg"',require:1,repeat:0},{name:"formula.functionList.REGEXREPLACE.functionParameter.regularExpression.name",detail:"formula.functionList.REGEXREPLACE.functionParameter.regularExpression.detail",example:'"a.*d"',require:1,repeat:0},{name:"formula.functionList.REGEXREPLACE.functionParameter.replacement.name",detail:"formula.functionList.REGEXREPLACE.functionParameter.replacement.detail",example:'"xyz"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REPLACE,functionType:t.FunctionType.Text,description:"formula.functionList.REPLACE.description",abstract:"formula.functionList.REPLACE.abstract",functionParameter:[{name:"formula.functionList.REPLACE.functionParameter.oldText.name",detail:"formula.functionList.REPLACE.functionParameter.oldText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.REPLACE.functionParameter.startNum.name",detail:"formula.functionList.REPLACE.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.REPLACE.functionParameter.numChars.name",detail:"formula.functionList.REPLACE.functionParameter.numChars.detail",example:"0",require:1,repeat:0},{name:"formula.functionList.REPLACE.functionParameter.newText.name",detail:"formula.functionList.REPLACE.functionParameter.newText.detail",example:'"Hello "',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REPLACEB,functionType:t.FunctionType.Text,description:"formula.functionList.REPLACEB.description",abstract:"formula.functionList.REPLACEB.abstract",functionParameter:[{name:"formula.functionList.REPLACEB.functionParameter.oldText.name",detail:"formula.functionList.REPLACEB.functionParameter.oldText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.REPLACEB.functionParameter.startNum.name",detail:"formula.functionList.REPLACEB.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.REPLACEB.functionParameter.numBytes.name",detail:"formula.functionList.REPLACEB.functionParameter.numBytes.detail",example:"0",require:1,repeat:0},{name:"formula.functionList.REPLACEB.functionParameter.newText.name",detail:"formula.functionList.REPLACEB.functionParameter.newText.detail",example:'"Hello "',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REPT,functionType:t.FunctionType.Text,description:"formula.functionList.REPT.description",abstract:"formula.functionList.REPT.abstract",functionParameter:[{name:"formula.functionList.REPT.functionParameter.text.name",detail:"formula.functionList.REPT.functionParameter.text.detail",example:'"*-"',require:1,repeat:0},{name:"formula.functionList.REPT.functionParameter.numberTimes.name",detail:"formula.functionList.REPT.functionParameter.numberTimes.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.RIGHT,functionType:t.FunctionType.Text,description:"formula.functionList.RIGHT.description",abstract:"formula.functionList.RIGHT.abstract",functionParameter:[{name:"formula.functionList.RIGHT.functionParameter.text.name",detail:"formula.functionList.RIGHT.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.RIGHT.functionParameter.numChars.name",detail:"formula.functionList.RIGHT.functionParameter.numChars.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.RIGHTB,functionType:t.FunctionType.Text,description:"formula.functionList.RIGHTB.description",abstract:"formula.functionList.RIGHTB.abstract",functionParameter:[{name:"formula.functionList.RIGHTB.functionParameter.text.name",detail:"formula.functionList.RIGHTB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.RIGHTB.functionParameter.numBytes.name",detail:"formula.functionList.RIGHTB.functionParameter.numBytes.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.SEARCH,functionType:t.FunctionType.Text,description:"formula.functionList.SEARCH.description",abstract:"formula.functionList.SEARCH.abstract",functionParameter:[{name:"formula.functionList.SEARCH.functionParameter.findText.name",detail:"formula.functionList.SEARCH.functionParameter.findText.detail",example:'"univer"',require:1,repeat:0},{name:"formula.functionList.SEARCH.functionParameter.withinText.name",detail:"formula.functionList.SEARCH.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.SEARCH.functionParameter.startNum.name",detail:"formula.functionList.SEARCH.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.SEARCHB,functionType:t.FunctionType.Text,description:"formula.functionList.SEARCHB.description",abstract:"formula.functionList.SEARCHB.abstract",functionParameter:[{name:"formula.functionList.SEARCHB.functionParameter.findText.name",detail:"formula.functionList.SEARCHB.functionParameter.findText.detail",example:'"univer"',require:1,repeat:0},{name:"formula.functionList.SEARCHB.functionParameter.withinText.name",detail:"formula.functionList.SEARCHB.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.SEARCHB.functionParameter.startNum.name",detail:"formula.functionList.SEARCHB.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.SUBSTITUTE,functionType:t.FunctionType.Text,description:"formula.functionList.SUBSTITUTE.description",abstract:"formula.functionList.SUBSTITUTE.abstract",functionParameter:[{name:"formula.functionList.SUBSTITUTE.functionParameter.text.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.text.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.SUBSTITUTE.functionParameter.oldText.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.oldText.detail",example:'"Hello"',require:1,repeat:0},{name:"formula.functionList.SUBSTITUTE.functionParameter.newText.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.newText.detail",example:'"Hi"',require:1,repeat:0},{name:"formula.functionList.SUBSTITUTE.functionParameter.instanceNum.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.instanceNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.T,functionType:t.FunctionType.Text,description:"formula.functionList.T.description",abstract:"formula.functionList.T.abstract",functionParameter:[{name:"formula.functionList.T.functionParameter.value.name",detail:"formula.functionList.T.functionParameter.value.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXT,functionType:t.FunctionType.Text,description:"formula.functionList.TEXT.description",abstract:"formula.functionList.TEXT.abstract",functionParameter:[{name:"formula.functionList.TEXT.functionParameter.value.name",detail:"formula.functionList.TEXT.functionParameter.value.detail",example:"1.23",require:1,repeat:0},{name:"formula.functionList.TEXT.functionParameter.formatText.name",detail:"formula.functionList.TEXT.functionParameter.formatText.detail",example:'"$0.00"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTAFTER,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTAFTER.description",abstract:"formula.functionList.TEXTAFTER.abstract",functionParameter:[{name:"formula.functionList.TEXTAFTER.functionParameter.text.name",detail:"formula.functionList.TEXTAFTER.functionParameter.text.detail",example:'"Red riding hood’s, red hood"',require:1,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.delimiter.name",detail:"formula.functionList.TEXTAFTER.functionParameter.delimiter.detail",example:'"hood"',require:1,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.instanceNum.name",detail:"formula.functionList.TEXTAFTER.functionParameter.instanceNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.matchMode.name",detail:"formula.functionList.TEXTAFTER.functionParameter.matchMode.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.matchEnd.name",detail:"formula.functionList.TEXTAFTER.functionParameter.matchEnd.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.ifNotFound.name",detail:"formula.functionList.TEXTAFTER.functionParameter.ifNotFound.detail",example:'"not found"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTBEFORE,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTBEFORE.description",abstract:"formula.functionList.TEXTBEFORE.abstract",functionParameter:[{name:"formula.functionList.TEXTBEFORE.functionParameter.text.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.text.detail",example:'"Red riding hood’s, red hood"',require:1,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.delimiter.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.delimiter.detail",example:'"hood"',require:1,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.instanceNum.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.instanceNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.matchMode.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.matchMode.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.matchEnd.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.matchEnd.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.ifNotFound.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.ifNotFound.detail",example:'"not found"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTJOIN,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTJOIN.description",abstract:"formula.functionList.TEXTJOIN.abstract",functionParameter:[{name:"formula.functionList.TEXTJOIN.functionParameter.delimiter.name",detail:"formula.functionList.TEXTJOIN.functionParameter.delimiter.detail",example:'", "',require:1,repeat:0},{name:"formula.functionList.TEXTJOIN.functionParameter.ignoreEmpty.name",detail:"formula.functionList.TEXTJOIN.functionParameter.ignoreEmpty.detail",example:"true",require:1,repeat:0},{name:"formula.functionList.TEXTJOIN.functionParameter.text1.name",detail:"formula.functionList.TEXTJOIN.functionParameter.text1.detail",example:'"Hi"',require:1,repeat:0},{name:"formula.functionList.TEXTJOIN.functionParameter.text2.name",detail:"formula.functionList.TEXTJOIN.functionParameter.text2.detail",example:'"Univer"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTSPLIT,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTSPLIT.description",abstract:"formula.functionList.TEXTSPLIT.abstract",functionParameter:[{name:"formula.functionList.TEXTSPLIT.functionParameter.text.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.text.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.colDelimiter.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.colDelimiter.detail",example:'","',require:1,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.rowDelimiter.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.rowDelimiter.detail",example:'";"',require:0,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.ignoreEmpty.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.ignoreEmpty.detail",example:"",require:0,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.matchMode.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.matchMode.detail",example:"",require:0,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.padWith.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.padWith.detail",example:"",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TRIM,functionType:t.FunctionType.Text,description:"formula.functionList.TRIM.description",abstract:"formula.functionList.TRIM.abstract",functionParameter:[{name:"formula.functionList.TRIM.functionParameter.text.name",detail:"formula.functionList.TRIM.functionParameter.text.detail",example:'" Hello Univer "',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.UNICHAR,functionType:t.FunctionType.Text,description:"formula.functionList.UNICHAR.description",abstract:"formula.functionList.UNICHAR.abstract",functionParameter:[{name:"formula.functionList.UNICHAR.functionParameter.number.name",detail:"formula.functionList.UNICHAR.functionParameter.number.detail",example:"65",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.UNICODE,functionType:t.FunctionType.Text,description:"formula.functionList.UNICODE.description",abstract:"formula.functionList.UNICODE.abstract",functionParameter:[{name:"formula.functionList.UNICODE.functionParameter.text.name",detail:"formula.functionList.UNICODE.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.UPPER,functionType:t.FunctionType.Text,description:"formula.functionList.UPPER.description",abstract:"formula.functionList.UPPER.abstract",functionParameter:[{name:"formula.functionList.UPPER.functionParameter.text.name",detail:"formula.functionList.UPPER.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.VALUE,functionType:t.FunctionType.Text,description:"formula.functionList.VALUE.description",abstract:"formula.functionList.VALUE.abstract",functionParameter:[{name:"formula.functionList.VALUE.functionParameter.text.name",detail:"formula.functionList.VALUE.functionParameter.text.detail",example:'"123"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.VALUETOTEXT,functionType:t.FunctionType.Text,description:"formula.functionList.VALUETOTEXT.description",abstract:"formula.functionList.VALUETOTEXT.abstract",functionParameter:[{name:"formula.functionList.VALUETOTEXT.functionParameter.value.name",detail:"formula.functionList.VALUETOTEXT.functionParameter.value.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.VALUETOTEXT.functionParameter.format.name",detail:"formula.functionList.VALUETOTEXT.functionParameter.format.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CALL,functionType:t.FunctionType.Text,description:"formula.functionList.CALL.description",abstract:"formula.functionList.CALL.abstract",functionParameter:[{name:"formula.functionList.CALL.functionParameter.number1.name",detail:"formula.functionList.CALL.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CALL.functionParameter.number2.name",detail:"formula.functionList.CALL.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.EUROCONVERT,functionType:t.FunctionType.Text,description:"formula.functionList.EUROCONVERT.description",abstract:"formula.functionList.EUROCONVERT.abstract",functionParameter:[{name:"formula.functionList.EUROCONVERT.functionParameter.number1.name",detail:"formula.functionList.EUROCONVERT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.EUROCONVERT.functionParameter.number2.name",detail:"formula.functionList.EUROCONVERT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGISTER_ID,functionType:t.FunctionType.Text,description:"formula.functionList.REGISTER_ID.description",abstract:"formula.functionList.REGISTER_ID.abstract",functionParameter:[{name:"formula.functionList.REGISTER_ID.functionParameter.number1.name",detail:"formula.functionList.REGISTER_ID.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.REGISTER_ID.functionParameter.number2.name",detail:"formula.functionList.REGISTER_ID.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]}],ge=[],Qe=[{functionName:t.FUNCTION_NAMES_WEB.ENCODEURL,functionType:t.FunctionType.Web,description:"formula.functionList.ENCODEURL.description",abstract:"formula.functionList.ENCODEURL.abstract",functionParameter:[{name:"formula.functionList.ENCODEURL.functionParameter.text.name",detail:"formula.functionList.ENCODEURL.functionParameter.text.detail",example:'"https://univer.ai/"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_WEB.FILTERXML,functionType:t.FunctionType.Web,description:"formula.functionList.FILTERXML.description",abstract:"formula.functionList.FILTERXML.abstract",functionParameter:[{name:"formula.functionList.FILTERXML.functionParameter.number1.name",detail:"formula.functionList.FILTERXML.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FILTERXML.functionParameter.number2.name",detail:"formula.functionList.FILTERXML.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_WEB.WEBSERVICE,functionType:t.FunctionType.Web,description:"formula.functionList.WEBSERVICE.description",abstract:"formula.functionList.WEBSERVICE.abstract",functionParameter:[{name:"formula.functionList.WEBSERVICE.functionParameter.number1.name",detail:"formula.functionList.WEBSERVICE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.WEBSERVICE.functionParameter.number2.name",detail:"formula.functionList.WEBSERVICE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]}],je=[...He,...Ve,...We,...Ke,...we,...ve,...ke,...Xe,...Ye,...Ge,...Be,...Fe,...Qe,...he,...ge];function $e(r,e){let a="";return r.aliasFunctionName?(a=e.t(r.aliasFunctionName),a===r.aliasFunctionName&&(a=r.functionName)):a=r.functionName,a}var ze=Object.getOwnPropertyDescriptor,Ze=(r,e,a,n)=>{for(var i=n>1?void 0:n?ze(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},Ct=(r,e)=>(a,n)=>e(a,n,r);const ut=f.createIdentifier("formula.description-service");E.DescriptionService=class{constructor(e,a,n){h(this,"_descriptions",[]);this._functionService=e,this._localeService=a,this._configService=n,this._initialize()}dispose(){this._localeService.localeChanged$.complete()}getDescriptions(){return this._functionService.getDescriptions()}hasFunction(e){return this._functionService.getDescriptions().get(e.toLocaleUpperCase())!==void 0}getFunctionInfo(e){return this._functionService.getDescriptions().get(e.toLocaleUpperCase())}getSearchListByName(e){const a=[],n=this._functionService.getDescriptions(),i=e.toLocaleUpperCase().trim();return n.forEach(o=>{const{functionName:u,abstract:c,functionType:s}=o;u.toLocaleUpperCase().indexOf(i)>-1&&s!==t.FunctionType.DefinedName&&a.push({name:u,desc:c})}),a}getSearchListByNameFirstLetter(e){const a=[],n=this._functionService.getDescriptions(),i=e.toLocaleUpperCase().trim();return n.forEach(o=>{const{functionName:u,abstract:c}=o;u.toLocaleUpperCase().indexOf(i)===0&&a.push({name:u,desc:c})}),a}getSearchListByType(e){const a=[];return this._functionService.getDescriptions().forEach(i=>{const{functionName:o,functionType:u,abstract:c}=i;(u===e||e===-1)&&u!==t.FunctionType.DefinedName&&a.push({name:o,desc:c})}),a}registerDescriptions(e){return this._descriptions=this._descriptions.concat(e),this._registerDescriptions(),f.toDisposable(()=>{const a=e.map(n=>n.functionName);this.unregisterDescriptions(a)})}unregisterDescriptions(e){this._descriptions=this._descriptions.filter(a=>!e.includes(a.functionName)),this._functionService.unregisterDescriptions(...e)}hasDescription(e){return this._descriptions.some(a=>a.functionName===e)}hasDefinedNameDescription(e){return this._descriptions.some(a=>a.functionName===e&&a.functionType===t.FunctionType.DefinedName)}isFormulaDefinedName(e){const a=this._descriptions.filter(i=>i.functionName===e&&i.functionType===t.FunctionType.DefinedName);if(a.length===0)return!1;const n=a[0].description;return!t.isReferenceStrings(n)}_initialize(){this._localeService.localeChanged$.subscribe(()=>{this._registerDescriptions()}),this._initDescription(),this._registerDescriptions()}_initDescription(){var i;const e=[...t.functionArray,...t.functionCompatibility,...t.functionCube,...t.functionDatabase,...t.functionDate,...t.functionEngineering,...t.functionFinancial,...t.functionInformation,...t.functionLogical,...t.functionLookup,...t.functionMath,...t.functionMeta,...t.functionStatistical,...t.functionText,...t.functionUniver,...t.functionWeb].map(o=>o[1]),a=je.filter(o=>e.includes(o.functionName)),n=this._configService.getConfig(nt);this._descriptions=a.concat((i=n==null?void 0:n.description)!=null?i:[])}_registerDescriptions(){const e=this._localeService,a=this._descriptions.map(n=>({functionName:$e(n,e),functionType:n.functionType,description:e.t(n.description),abstract:e.t(n.abstract),functionParameter:n.functionParameter.map(i=>({name:e.t(i.name),detail:e.t(i.detail),example:i.example,require:i.require,repeat:i.repeat}))}));this._functionService.registerDescriptions(...a)}},E.DescriptionService=Ze([Ct(0,t.IFunctionService),Ct(1,f.Inject(f.LocaleService)),Ct(2,f.IConfigService)],E.DescriptionService);var Je=Object.getOwnPropertyDescriptor,ta=(r,e,a,n)=>{for(var i=n>1?void 0:n?Je(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},ct=(r,e)=>(a,n)=>e(a,n,r);function vt(r,e,a,n){const i=r.sequenceNodesBuilder(e);if(i==null)return e;const o=[];for(let u=0,c=i.length;u<c;u++){const s=i[u];if(typeof s=="string"||s.nodeType!==t.sequenceNodeType.REFERENCE)continue;const{token:l}=s,d=t.deserializeRangeWithSheetWithCache(l),{sheetName:T,unitId:N}=d;let A=d.range;A.startAbsoluteRefType===f.AbsoluteRefType.ALL&&A.endAbsoluteRefType===f.AbsoluteRefType.ALL||(A=f.moveRangeByOffset(A,a,n),o.push({unitId:N,sheetName:T,range:A}))}return o.map(u=>`${u.unitId}!${u.sheetName}!${u.range.startRow}!${u.range.endRow}!${u.range.startColumn}!${u.range.endColumn}`).join("|")}E.FormulaRefRangeService=class extends f.Disposable{constructor(e,a,n,i){super(),this._refRangeService=e,this._lexerTreeBuilder=a,this._univerInstanceService=n,this._injector=i}transformFormulaByEffectCommand(e,a,n,i){const o=this._lexerTreeBuilder.sequenceNodesBuilder(n),u=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET),c=u.getActiveSheet(),s=u.getUnitId(),l=c.getSheetId(),d=o==null?void 0:o.map(T=>{if(typeof T=="object"&&T.nodeType===t.sequenceNodeType.REFERENCE){const N=t.deserializeRangeWithSheetWithCache(T.token),{range:A,unitId:S,sheetName:C}=N,p=this._univerInstanceService.getUnit(S||e),P=C?p==null?void 0:p.getSheetBySheetName(C):p==null?void 0:p.getSheetBySheetId(a);if(!P)throw new Error("Sheet not found");const I=p.getUnitId(),L=P.getSheetId();if(I!==s||L!==l)return T;const _=m.handleDefaultRangeChangeWithEffectRefCommands(A,i);let R="";if(_){const x=_.startColumn-A.startColumn,q=_.startRow-A.startRow,D=f.moveRangeByOffset(A,x,q);S&&C?R=t.serializeRangeWithSpreadsheet(S,C,D):C?R=t.serializeRangeWithSheet(C,D):R=t.serializeRange(D)}else R=t.ErrorType.REF;return{...T,token:R}}else return T});return d?`=${t.generateStringWithSequence(d)}`:""}registerFormula(e,a,n,i){const o=new Map,u=this._lexerTreeBuilder.sequenceNodesBuilder(n),c=new f.DisposableCollection,s=l=>{const d=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET),T=d.getActiveSheet(),N=d.getUnitId(),A=T.getSheetId(),S=u==null?void 0:u.map(p=>{if(typeof p=="object"&&p.nodeType===t.sequenceNodeType.REFERENCE){const P=o.get(p.token);if(P.unitId!==N||P.subUnitId!==A)return p;const I=m.handleDefaultRangeChangeWithEffectRefCommands(P.range,l);let L="";if(I){const _=I.startColumn-P.range.startColumn,R=I.startRow-P.range.startRow,x=f.moveRangeByOffset(P.range,_,R);P.unitId&&P.sheetName?L=t.serializeRangeWithSpreadsheet(P.unitId,P.sheetName,x):P.sheetName?L=t.serializeRangeWithSheet(P.sheetName,x):L=t.serializeRange(x)}else L=t.ErrorType.REF;return{...p,token:L}}else return p}),C=S&&t.generateStringWithSequence(S);return i(`=${C}`)};return u==null||u.forEach(l=>{if(typeof l=="object"&&l.nodeType===t.sequenceNodeType.REFERENCE){const d=t.deserializeRangeWithSheetWithCache(l.token),{range:T,unitId:N,sheetName:A}=d,S=this._univerInstanceService.getUnit(N||e),C=A?S==null?void 0:S.getSheetBySheetName(A):S==null?void 0:S.getSheetBySheetId(a);if(!C)return;const p=S.getUnitId(),P=C.getSheetId(),I={unitId:p,subUnitId:P,range:T,sheetName:A};o.set(l.token,I),c.add(this._refRangeService.registerRefRange(T,s,p,P))}}),c}_getFormulaDependcy(e,a,n,i){const o=f.isFormulaString(n)?this._lexerTreeBuilder.sequenceNodesBuilder(n):null,u=[];return o==null||o.forEach(c=>{if(typeof c=="object"&&c.nodeType===t.sequenceNodeType.REFERENCE){const s=t.deserializeRangeWithSheetWithCache(c.token),{range:l,unitId:d,sheetName:T}=s;if(l.startAbsoluteRefType===f.AbsoluteRefType.ALL&&l.endAbsoluteRefType===f.AbsoluteRefType.ALL)return;const N=this._univerInstanceService.getUnit(d||e),A=T?N==null?void 0:N.getSheetBySheetName(T):N==null?void 0:N.getSheetBySheetId(a);if(!A)return;const S=N.getUnitId(),C=A.getSheetId(),p=i[0].startRow,P=i[0].startColumn,I=l.startRow,L=l.startColumn,_=i.map(R=>({startRow:R.startRow-p+I,endRow:R.endRow-p+I,startColumn:R.startColumn-P+L,endColumn:R.endColumn-P+L}));u.push({unitId:S,subUnitId:C,ranges:_})}}),u}registerRangeFormula(e,a,n,i,o){const u=new f.DisposableCollection,c=i.map(l=>this._getFormulaDependcy(e,a,l,n)),s=l=>{const d=n[0].startRow,T=n[0].startColumn,N=[{unitId:e,subUnitId:a,ranges:n},...c.flat()],A=[],S=m.getSeparateEffectedRangesOnCommand(this._injector,l);for(const{unitId:C,subUnitId:p,ranges:P}of N)if(C===S.unitId&&p===S.subUnitId){const I=[],L=P[0].startRow,_=P[0].startColumn,R=L-d,x=_-T;for(const q of S.ranges){const D=P.map(y=>f.getIntersectRange(q,y)).filter(Boolean);D.length>0&&I.push(...D)}I.length>0&&A.push(I.map(q=>({startRow:q.startRow-R,endRow:q.endRow-R,startColumn:q.startColumn-x,endColumn:q.endColumn-x})))}if(A.length>0){const C=f.Rectangle.splitIntoGrid([...A.flat()]),p=f.Rectangle.subtractMulti(n,C);p.sort((R,x)=>R.startRow-x.startRow||R.startColumn-x.startColumn);const P=new Map;for(let R=0;R<C.length;R++){const x=C[R],q=x.startRow,D=x.startColumn,y=q-d,M=D-T,U=m.handleCommonDefaultRangeChangeWithEffectRefCommands(x,l).sort((B,W)=>B.startRow-W.startRow||B.startColumn-W.startColumn);if(!U.length)continue;const F=U[0].startRow,O=U[0].startColumn,v=F-d,$=O-T,z=[];for(let B=0;B<i.length;B++){const W=i[B],G=f.isFormulaString(W),Nt=G?this._lexerTreeBuilder.moveFormulaRefOffset(W,M,y):W,K=G?this.transformFormulaByEffectCommand(e,a,Nt,l):Nt,Z=vt(this._lexerTreeBuilder,K,-$,-v);z.push({newFormula:K,orginFormula:Z})}const w={formulas:z,ranges:U,key:z.map(B=>B.orginFormula).join("_")};P.has(w.key)?P.get(w.key).push(w):P.set(w.key,[w])}const I=i.map(R=>vt(this._lexerTreeBuilder,R,0,0)).join("_");if(p.length>0){const R=p[0].startRow,x=p[0].startColumn,q=[];for(let y=0;y<i.length;y++){const M=i[y];q.push({newFormula:f.isFormulaString(M)?this._lexerTreeBuilder.moveFormulaRefOffset(M,x-T,R-d):M,orginFormula:M})}const D={formulas:q,ranges:p,key:I};P.has(D.key)?P.get(D.key).push(D):P.set(D.key,[D])}const L=[],_=Array.from(P.keys());for(let R=_.length-1;R>=0;R--){const x=_[R],q=P.get(x).sort((M,U)=>M.ranges[0].startRow-U.ranges[0].startRow||M.ranges[0].startColumn-U.ranges[0].startColumn),D=[];for(let M=0;M<q[0].formulas.length;M++)D.push(q[0].formulas[M].newFormula);const y=f.Rectangle.mergeRanges(q.map(M=>M.ranges).flat());y.sort((M,U)=>M.startRow-U.startRow||M.startColumn-U.startColumn),L.push({formulas:D,ranges:y})}return o(L)}return{undos:[],redos:[]}};return n.forEach(l=>{const d=this._refRangeService.registerRefRange(l,s,e,a);u.add(d)}),[...c.flat()].forEach(({unitId:l,subUnitId:d,ranges:T})=>{T.forEach(N=>{const A=this._refRangeService.registerRefRange(N,s,l,d);u.add(A)})}),u}},E.FormulaRefRangeService=ta([ct(0,f.Inject(m.RefRangeService)),ct(1,f.Inject(t.LexerTreeBuilder)),ct(2,f.IUniverInstanceService),ct(3,f.Inject(f.Injector))],E.FormulaRefRangeService);var ea=Object.getOwnPropertyDescriptor,aa=(r,e,a,n)=>{for(var i=n>1?void 0:n?ea(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},na=(r,e)=>(a,n)=>e(a,n,r);const Rt="sheets-formula.remote-register-function.service",Ot=f.createIdentifier(Rt);E.RemoteRegisterFunctionService=class{constructor(e){this._functionService=e}async registerFunctions(e){const a=e.map(([n,i])=>ia(n,i));this._functionService.registerExecutors(...a)}async registerAsyncFunctions(e){const a=e.map(([n,i])=>ra(n,i));this._functionService.registerExecutors(...a)}async unregisterFunctions(e){this._functionService.unregisterDescriptions(...e)}},E.RemoteRegisterFunctionService=aa([na(0,t.IFunctionService)],E.RemoteRegisterFunctionService);function ia(r,e){const a=new t.CustomFunction(e),n=new Function(`return ${r}`)();return a.calculateCustom=n,a}function ra(r,e){const a=new t.AsyncCustomFunction(e),n=new Function(`return ${r}`)();return a.calculateCustom=n,a}var oa=Object.getOwnPropertyDescriptor,ua=(r,e,a,n)=>{for(var i=n>1?void 0:n?oa(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},ft=(r,e)=>(a,n)=>e(a,n,r);const Vt=f.createIdentifier("sheets-formula.register-function-service");E.RegisterFunctionService=class extends f.Disposable{constructor(e,a,n,i){super(),this._localeService=e,this._descriptionService=a,this._functionService=n,this._remoteRegisterFunctionService=i}registerFunction(e){return this._registerSingleFunction(e)}registerAsyncFunction(e){return this._registerSingleFunction({...e,async:!0})}registerFunctions(e){const{locales:a,description:n,calculate:i}=e;a&&this._localeService.load(a);const o=new f.DisposableCollection;if(n)o.add(this._descriptionService.registerDescriptions(n));else{const u=i.map(([c,s,l])=>({functionName:s,functionType:t.FunctionType.User,description:"",abstract:l||"",functionParameter:[]}));o.add(this._functionService.registerDescriptions(...u))}return o.add(this._registerLocalExecutors(i)),this._remoteRegisterFunctionService&&o.add(this._registerRemoteExecutors(i)),o}_registerSingleFunction(e){const{name:a,func:n,description:i,locales:o,async:u=!1}=e,c=new f.DisposableCollection;if(o&&this._localeService.load(o),typeof i=="string"){const l={functionName:a,functionType:t.FunctionType.User,description:i,abstract:i||"",functionParameter:[]};c.add(this._descriptionService.registerDescriptions([l]))}else c.add(this._descriptionService.registerDescriptions([i]));const s=u?new t.AsyncCustomFunction(a):new t.CustomFunction(a);return s.calculateCustom=n,this._functionService.registerExecutors(s),c.add(f.toDisposable(()=>this._functionService.unregisterExecutors(a))),this._remoteRegisterFunctionService&&(this._remoteRegisterFunctionService.registerAsyncFunctions([[n.toString(),a]]),c.add(f.toDisposable(()=>this._remoteRegisterFunctionService.unregisterFunctions([a])))),c}_registerLocalExecutors(e){const a=e.map(([i,o])=>o),n=e.map(([i,o])=>{const u=new t.CustomFunction(o);return u.calculateCustom=i,u});return this._functionService.registerExecutors(...n),f.toDisposable(()=>this._functionService.unregisterExecutors(...a))}_registerRemoteExecutors(e){const a=[],n=e.map(([i,o])=>(a.push(o),[i.toString(),o]));return this._remoteRegisterFunctionService.registerFunctions(n),f.toDisposable(()=>this._remoteRegisterFunctionService.unregisterFunctions(a))}},E.RegisterFunctionService=ua([ft(0,f.Inject(f.LocaleService)),ft(1,f.Inject(ut)),ft(2,t.IFunctionService),ft(3,f.Optional(Ot))],E.RegisterFunctionService);const ca="SHEETS_FORMULA_PLUGIN";var fa=Object.getOwnPropertyDescriptor,ma=(r,e,a,n)=>{for(var i=n>1?void 0:n?fa(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},Mt=(r,e)=>(a,n)=>e(a,n,r);let mt=class extends f.Disposable{constructor(r,e,a){super(),this._activeDirtyManagerService=r,this._univerInstanceService=e,this._formulaDataModel=a,this._initialize()}_initialize(){this._initialConversion()}_initialConversion(){this._activeDirtyManagerService.register(m.SetRangeValuesMutation.id,{commandId:m.SetRangeValuesMutation.id,getDirtyData:r=>{const e=r.params;return e.trigger===m.SetStyleCommand.id?{}:{dirtyRanges:this._getSetRangeValuesMutationDirtyRange(e)}}}),this._initialMove(),this._initialRowAndColumn(),this._initialSheet(),this._initialDefinedName()}_initialMove(){this._activeDirtyManagerService.register(m.MoveRangeMutation.id,{commandId:m.MoveRangeMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getMoveRangeMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.to.subUnitId]:"1",[e.from.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.MoveRowsMutation.id,{commandId:m.MoveRowsMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getMoveRowsMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.MoveColsMutation.id,{commandId:m.MoveColsMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getMoveRowsMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.ReorderRangeMutation.id,{commandId:m.ReorderRangeMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getReorderRangeMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}})}_initialRowAndColumn(){this._activeDirtyManagerService.register(m.RemoveRowMutation.id,{commandId:m.RemoveRowMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getRemoveRowOrColumnMutation(e,!0),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.RemoveColMutation.id,{commandId:m.RemoveColMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getRemoveRowOrColumnMutation(e,!1),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.InsertColMutation.id,{commandId:m.InsertColMutation.id,getDirtyData:r=>{const e=r.params;return{clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.InsertRowMutation.id,{commandId:m.InsertRowMutation.id,getDirtyData:r=>{const e=r.params;return{clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}})}_initialSheet(){this._activeDirtyManagerService.register(m.RemoveSheetMutation.id,{commandId:m.RemoveSheetMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyNameMap:this._getRemoveSheetMutation(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.InsertSheetMutation.id,{commandId:m.InsertSheetMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyNameMap:this._getInsertSheetMutation(e)}}})}_initialDefinedName(){this._activeDirtyManagerService.register(t.SetDefinedNameMutation.id,{commandId:t.SetDefinedNameMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyDefinedNameMap:this._getDefinedNameMutation(e)}}}),this._activeDirtyManagerService.register(t.RemoveDefinedNameMutation.id,{commandId:t.RemoveDefinedNameMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyDefinedNameMap:this._getDefinedNameMutation(e)}}})}_getDefinedNameMutation(r){const{unitId:e,name:a,formulaOrRefString:n}=r,i={};return r==null?{}:(i[e]={},i[e][a]=n,i)}_getSetRangeValuesMutationDirtyRange(r){const{subUnitId:e,unitId:a,cellValue:n}=r,i=[];return n==null||(i.push(...this._getDirtyRangesByCellValue(a,e,n)),i.push(...this._getDirtyRangesForArrayFormula(a,e,n))),i}_getMoveRangeMutationDirtyRange(r){const{unitId:e,from:a,to:n}=r,i=[];return i.push(...this._getDirtyRangesByCellValue(e,a.subUnitId,a.value)),i.push(...this._getDirtyRangesByCellValue(e,n.subUnitId,n.value)),i.push(...this._getDirtyRangesForArrayFormula(e,n.subUnitId,n.value)),i}_getMoveRowsMutationDirtyRange(r){const{subUnitId:e,unitId:a,sourceRange:n,targetRange:i}=r,o=[],u=this._rangeToMatrix(n).getData(),c=this._rangeToMatrix(i).getData();return o.push(...this._getDirtyRangesByCellValue(a,e,u)),o.push(...this._getDirtyRangesByCellValue(a,e,c)),o.push(...this._getDirtyRangesForArrayFormula(a,e,c)),o}_getReorderRangeMutationDirtyRange(r){const{unitId:e,subUnitId:a,range:n}=r,i=this._rangeToMatrix(n).getData(),o=[];return o.push(...this._getDirtyRangesByCellValue(e,a,i)),o.push(...this._getDirtyRangesForArrayFormula(e,a,i)),o}_getRemoveRowOrColumnMutation(r,e=!0){const{subUnitId:a,unitId:n,range:i}=r,o=[],u=this._univerInstanceService.getUniverSheetInstance(n),c=u==null?void 0:u.getSheetBySheetId(a),s=(c==null?void 0:c.getRowCount())||0,l=(c==null?void 0:c.getColumnCount())||0;let d=null;const{startRow:T,endRow:N,startColumn:A,endColumn:S}=i;e===!0?d=this._rangeToMatrix({startRow:T,startColumn:0,endRow:N,endColumn:l-1}):d=this._rangeToMatrix({startRow:0,startColumn:A,endRow:s,endColumn:S});const C=d.getData();return o.push(...this._getDirtyRangesByCellValue(n,a,C)),o.push(...this._getDirtyRangesForArrayFormula(n,a,C)),o}_getRemoveSheetMutation(r){const e={},{subUnitId:a,unitId:n,subUnitName:i}=r;return e[n]==null&&(e[n]={}),e[n][a]=i,e}_getInsertSheetMutation(r){const e={},{sheet:a,unitId:n}=r;return e[n]==null&&(e[n]={}),e[n][a.id]=a.name,e}_rangeToMatrix(r){const e=new f.ObjectMatrix,{startRow:a,startColumn:n,endRow:i,endColumn:o}=r;for(let u=a;u<=i;u++)for(let c=n;c<=o;c++)e.setValue(u,c,{});return e}_getDirtyRangesByCellValue(r,e,a){const n=[];return a==null||new f.ObjectMatrix(a).getDiscreteRanges().forEach(u=>{n.push({unitId:r,sheetId:e,range:u})}),n}_getDirtyRangesForArrayFormula(r,e,a){var u,c;const n=[];if(a==null)return n;const i=new f.ObjectMatrix(a),o=this._formulaDataModel.getArrayFormulaRange();if((u=o==null?void 0:o[r])!=null&&u[e]){const s=new f.ObjectMatrix((c=o==null?void 0:o[r])==null?void 0:c[e]);i.forValue((l,d)=>{s.forValue((T,N,A)=>{if(A==null)return!0;const{startRow:S,startColumn:C,endRow:p,endColumn:P}=A;l>=S&&l<=p&&d>=C&&d<=P&&n.push({unitId:r,sheetId:e,range:{startRow:S,startColumn:C,endRow:S,endColumn:C}})})})}return n}};mt=ma([Mt(0,t.IActiveDirtyManagerService),Mt(1,f.IUniverInstanceService),Mt(2,f.Inject(t.FormulaDataModel))],mt);var sa=Object.getOwnPropertyDescriptor,la=(r,e,a,n)=>{for(var i=n>1?void 0:n?sa(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},_t=(r,e)=>(a,n)=>e(a,n,r);let st=class extends f.Disposable{constructor(r,e,a){super(),this._commandService=r,this._sheetInterceptorService=e,this._formulaDataModel=a,this._initialize()}_initialize(){this._commandExecutedListener(),this._initInterceptorCellContent()}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted(r=>{if(r.id!==t.SetArrayFormulaDataMutation.id)return;const e=r.params;if(e==null)return;const{arrayFormulaRange:a,arrayFormulaCellData:n}=e;this._formulaDataModel.setArrayFormulaRange(a),this._formulaDataModel.setArrayFormulaCellData(n)}))}_initInterceptorCellContent(){this.disposeWithMe(this._sheetInterceptorService.intercept(m.INTERCEPTOR_POINT.CELL_CONTENT,{priority:100,effect:f.InterceptorEffectEnum.Value,handler:(r,e,a)=>{var l,d,T;const{unitId:n,subUnitId:i,row:o,col:u}=e,c=this._formulaDataModel.getArrayFormulaCellData(),s=(T=(d=(l=c==null?void 0:c[n])==null?void 0:l[i])==null?void 0:d[o])==null?void 0:T[u];return s==null?a(r):s.v==null&&s.t==null?a({...r,v:0,t:f.CellValueType.NUMBER}):(r==null?void 0:r.t)===f.CellValueType.NUMBER&&r.v!==void 0&&r.v!==null&&f.isRealNum(r.v)?a({...r,v:t.stripErrorMargin(Number(r.v))}):a({...r,v:s.v,t:s.t})}}))}};st=la([_t(0,f.ICommandService),_t(1,f.Inject(m.SheetInterceptorService)),_t(2,f.Inject(t.FormulaDataModel))],st);var pa=Object.getOwnPropertyDescriptor,da=(r,e,a,n)=>{for(var i=n>1?void 0:n?pa(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},lt=(r,e)=>(a,n)=>e(a,n,r);let pt=class extends f.Disposable{constructor(e,a,n,i){super();h(this,"_preUnitId",null);this._descriptionService=e,this._definedNamesService=a,this._univerInstanceService=n,this._commandService=i,this._initialize()}_initialize(){this._descriptionListener(),this._changeUnitListener(),this._changeSheetListener()}_descriptionListener(){f.toDisposable(this._definedNamesService.update$.subscribe(()=>{this._registerDescriptions()}))}_changeUnitListener(){f.toDisposable(this._univerInstanceService.getCurrentTypeOfUnit$(f.UniverInstanceType.UNIVER_SHEET).subscribe(()=>{this._unRegisterDescriptions(),this._registerDescriptions()}))}_changeSheetListener(){this.disposeWithMe(this._commandService.onCommandExecuted((e,a)=>{if(!(a!=null&&a.fromCollab)){if(e.id===m.SetWorksheetActiveOperation.id)this._unregisterDescriptionsForNotInSheetId(),this._registerDescriptions();else if(e.id===t.SetDefinedNameMutation.id){const n=e.params;this._registerDescription(n)}else if(e.id===t.RemoveDefinedNameMutation.id){const n=e.params;this._unregisterDescription(n)}}}))}_registerDescription(e){const{unitId:a,sheetId:n}=this._getUnitIdAndSheetId();if(a==null||n==null)return;const{name:i,comment:o,formulaOrRefString:u,localSheetId:c}=e;!this._descriptionService.hasDescription(i)&&(c==null||c===m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME||c===n)&&this._descriptionService.registerDescriptions([{functionName:i,description:u+(o||""),abstract:u,functionType:t.FunctionType.DefinedName,functionParameter:[]}])}_unregisterDescription(e){const{name:a}=e;this._descriptionService.unregisterDescriptions([a])}_unRegisterDescriptions(){if(this._preUnitId==null)return;const e=this._definedNamesService.getDefinedNameMap(this._preUnitId);if(e==null)return;const a=[];Array.from(Object.values(e)).forEach(n=>{const{name:i}=n;a.push(i)}),this._descriptionService.unregisterDescriptions(a),this._preUnitId=null}_getUnitIdAndSheetId(){const e=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET);if(e==null)return{};const a=e.getActiveSheet();return a==null?{}:{unitId:e.getUnitId(),sheetId:a.getSheetId()}}_registerDescriptions(){const{unitId:e,sheetId:a}=this._getUnitIdAndSheetId();if(e==null||a==null)return;const n=this._definedNamesService.getDefinedNameMap(e);if(!n)return;const i=[];this._preUnitId=e,Array.from(Object.values(n)).forEach(o=>{const{name:u,comment:c,formulaOrRefString:s,localSheetId:l}=o;!this._descriptionService.hasDescription(u)&&(l==null||l===m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME||l===a)&&i.push({functionName:u,description:s+(c||""),abstract:s,functionType:t.FunctionType.DefinedName,functionParameter:[]})}),this._descriptionService.registerDescriptions(i)}_unregisterDescriptionsForNotInSheetId(){const{unitId:e,sheetId:a}=this._getUnitIdAndSheetId();if(e==null||a==null)return;const n=this._definedNamesService.getDefinedNameMap(e);if(!n)return;const i=[];Array.from(Object.values(n)).forEach(o=>{const{name:u,localSheetId:c}=o;c!==m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME&&c!==a&&i.push(u)}),this._descriptionService.unregisterDescriptions(i)}};pt=da([lt(0,ut),lt(1,t.IDefinedNamesService),lt(2,f.IUniverInstanceService),lt(3,f.ICommandService)],pt);var La=Object.getOwnPropertyDescriptor,Ta=(r,e,a,n)=>{for(var i=n>1?void 0:n?La(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},Na=(r,e)=>(a,n)=>e(a,n,r);let dt=class extends f.Disposable{constructor(r){super(),this._commandService=r,[Dt,tt].forEach(e=>this._commandService.registerCommand(e))}};dt=Ta([Na(0,f.ICommandService)],dt);var Pa=Object.defineProperty,Ea=Object.getOwnPropertyDescriptor,Ia=(r,e,a)=>e in r?Pa(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,Gt=(r,e,a,n)=>{for(var i=n>1?void 0:n?Ea(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},Lt=(r,e)=>(a,n)=>e(a,n,r),Tt=(r,e,a)=>Ia(r,typeof e!="symbol"?e+"":e,a);E.UniverRemoteSheetsFormulaPlugin=class extends f.Plugin{constructor(e=Ft,a,n){super(),this._config=e,this._injector=a,this._configService=n;const{...i}=f.merge({},Ft,this._config);this._configService.setConfig(be,i)}onStarting(){this._injector.add([E.RemoteRegisterFunctionService]),this._injector.get(it.IRPCChannelService).registerChannel(Rt,it.fromModule(this._injector.get(E.RemoteRegisterFunctionService)))}},Tt(E.UniverRemoteSheetsFormulaPlugin,"pluginName","SHEET_FORMULA_REMOTE_PLUGIN"),Tt(E.UniverRemoteSheetsFormulaPlugin,"type",f.UniverInstanceType.UNIVER_SHEET),E.UniverRemoteSheetsFormulaPlugin=Gt([f.DependentOn(t.UniverFormulaEnginePlugin),Lt(1,f.Inject(f.Injector)),Lt(2,f.IConfigService)],E.UniverRemoteSheetsFormulaPlugin),E.UniverSheetsFormulaPlugin=class extends f.Plugin{constructor(e=ht,a,n){super(),this._config=e,this._injector=a,this._configService=n;const{...i}=f.merge({},ht,this._config);this._configService.setConfig(nt,i)}onStarting(){const e=this._injector,a=[[Vt,{useClass:E.RegisterFunctionService}],[ut,{useClass:E.DescriptionService}],[dt],[E.FormulaRefRangeService],[E.RegisterOtherFormulaService],[st],[E.TriggerCalculationController],[E.UpdateFormulaController],[mt],[pt],[E.UpdateDefinedNameController]];if(this._config.notExecuteFormula){const n=e.get(it.IRPCChannelService);a.push([Ot,{useFactory:()=>it.toModule(n.requestChannel(Rt))}])}a.forEach(n=>e.add(n))}onReady(){f.touchDependencies(this._injector,[[dt],[mt],[st],[E.UpdateFormulaController],[E.UpdateDefinedNameController]]),f.isNodeEnv()&&f.touchDependencies(this._injector,[[E.TriggerCalculationController]])}onRendered(){f.touchDependencies(this._injector,[[pt]]),f.isNodeEnv()||f.touchDependencies(this._injector,[[E.TriggerCalculationController]])}},Tt(E.UniverSheetsFormulaPlugin,"pluginName",ca),Tt(E.UniverSheetsFormulaPlugin,"type",f.UniverInstanceType.UNIVER_SHEET),E.UniverSheetsFormulaPlugin=Gt([f.DependentOn(t.UniverFormulaEnginePlugin,m.UniverSheetsPlugin),Lt(1,f.Inject(f.Injector)),Lt(2,f.IConfigService)],E.UniverSheetsFormulaPlugin),E.CalculationMode=H,E.IDescriptionService=ut,E.IRegisterFunctionService=Vt,E.IRemoteRegisterFunctionService=Ot,E.InsertFunctionCommand=Dt,E.OtherFormulaMarkDirty=tt,E.PLUGIN_CONFIG_KEY_BASE=nt,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
48
|
+
(function(E,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/engine-formula"),require("rxjs"),require("@univerjs/rpc")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/engine-formula","rxjs","@univerjs/rpc"],f):(E=typeof globalThis<"u"?globalThis:E||self,f(E.UniverSheetsFormula={},E.UniverCore,E.UniverSheets,E.UniverEngineFormula,E.rxjs,E.UniverRpc))})(this,function(E,f,m,t,H,it){"use strict";var Sa=Object.defineProperty;var Ca=(E,f,m)=>f in E?Sa(E,f,{enumerable:!0,configurable:!0,writable:!0,value:m}):E[f]=m;var h=(E,f,m)=>Ca(E,typeof f!="symbol"?f+"":f,m);const Dt={id:"formula.command.insert-function",type:f.CommandType.COMMAND,handler:async(r,e)=>{const{list:a,listOfRangeHasNumber:n}=e,i=r.get(f.ICommandService),o=new f.ObjectMatrix;a.forEach(c=>{const{range:s,primary:l,formula:d}=c,{row:T,column:N}=l,A=f.Tools.generateRandomId(6);o.setValue(T,N,{f:d,si:A});const{startRow:S,startColumn:C,endRow:p,endColumn:P}=s;for(let I=S;I<=p;I++)for(let L=C;L<=P;L++)(I!==T||L!==N)&&o.setValue(I,L,{si:A})}),n&&n.length>0&&n.forEach(c=>{const{primary:s,formula:l}=c;o.setValue(s.row,s.column,{f:l})});const u={value:o.getData()};return i.executeCommand(m.SetRangeValuesCommand.id,u)}},tt={type:f.CommandType.MUTATION,id:"sheet.mutation.data-validation-formula-mark-dirty",handler(){return!0}};function Ht(r,e,a){var n;return r==null||r[e]==null||((n=r[e])==null?void 0:n[a])==null}function Pt(r,e,a){var n;if(a){if(r&&r[e]&&((n=r[e])!=null&&n[a]))return delete r[e][a],{[e]:{[a]:null}}}else if(r&&r[e])return delete r[e],{[e]:null}}var b=(r=>(r[r.MoveRange=0]="MoveRange",r[r.MoveRows=1]="MoveRows",r[r.MoveCols=2]="MoveCols",r[r.InsertRow=3]="InsertRow",r[r.InsertColumn=4]="InsertColumn",r[r.RemoveRow=5]="RemoveRow",r[r.RemoveColumn=6]="RemoveColumn",r[r.DeleteMoveLeft=7]="DeleteMoveLeft",r[r.DeleteMoveUp=8]="DeleteMoveUp",r[r.InsertMoveDown=9]="InsertMoveDown",r[r.InsertMoveRight=10]="InsertMoveRight",r[r.SetName=11]="SetName",r[r.RemoveSheet=12]="RemoveSheet",r[r.SetDefinedName=13]="SetDefinedName",r[r.RemoveDefinedName=14]="RemoveDefinedName",r))(b||{});const Yt=[11,12,13,14];function Xt(r,e,a){const{type:n}=a;return Yt.includes(n)?wt(r,e):Wt(r,e,a)}function wt(r,e){const a=[],n=[];return Object.keys(e).forEach(i=>{const o=e[i],u=r[i];if(o==null||u==null)return!0;Object.keys(o).forEach(c=>{const s=new f.ObjectMatrix(o[c]||{}),l=new f.ObjectMatrix(u[c]||{}),d=new f.ObjectMatrix,T=new f.ObjectMatrix;if(s.forValue((p,P,I)=>{if(I==null)return!0;const L=rt(I);L!==null&&(d.setValue(p,P,L),T.setValue(p,P,l.getValue(p,P)))}),d.getSizeOf()===0)return;const N={subUnitId:c,unitId:i,cellValue:d.getMatrix()},A={id:m.SetRangeValuesMutation.id,params:N};n.push(A);const S={subUnitId:c,unitId:i,cellValue:T.getMatrix()},C={id:m.SetRangeValuesMutation.id,params:S};a.push(C)})}),{undos:a,redos:n}}function Wt(r,e,a){const{redoFormulaData:n,undoFormulaData:i}=Kt(r,e,a);if(f.Tools.diffValue(n,i))return{undos:[],redos:[]};const o=[],u=[];return Object.keys(n).forEach(c=>{Object.keys(n[c]).forEach(s=>{if(Object.keys(n[c][s]).length!==0){const l={subUnitId:s,unitId:c,cellValue:n[c][s]},d={id:m.SetRangeValuesMutation.id,params:l};o.push(d)}})}),Object.keys(i).forEach(c=>{Object.keys(i[c]).forEach(s=>{if(Object.keys(i[c][s]).length!==0){const l={subUnitId:s,unitId:c,cellValue:i[c][s]},d={id:m.SetRangeValuesMutation.id,params:l};u.push(d)}})}),{undos:u,redos:o}}function Kt(r,e,a){const n={},i={},{type:o,unitId:u,sheetId:c,range:s,from:l,to:d}=a;return new Set([...Object.keys(r),...Object.keys(e)]).forEach(N=>{if(Ht(r,N,c))return;new Set([...Object.keys(r[N]||{}),...Object.keys(e[N]||{})]).forEach(S=>{var x,q;const C=(x=r[N])==null?void 0:x[S],p=(q=e[N])==null?void 0:q[S],P=new f.ObjectMatrix(C||{}),I=new f.ObjectMatrix(p||{});let L=[];N!==u||S!==c?L=kt(I):L=gt(P,o,l,d,s);const _=ue(L,P,I),R=ce(L,P);n[N]||(n[N]={}),i[N]||(i[N]={}),n[N][S]={...n[N][S],..._},i[N][S]={...i[N][S],...R}})}),{redoFormulaData:n,undoFormulaData:i}}function gt(r,e,a,n,i){const o=[];return r.forValue((u,c,s)=>{if(s==null||!bt(s))return!0;const l=f.cellToRange(u,c);let d=null,T=!1;if([0,1,2].includes(e))d=Qt(e,a,n,l);else if(i!=null){const N=jt(e,i,l);d=N.newCell,T=N.isReverse}T?o.unshift({oldCell:l,newCell:d}):o.push({oldCell:l,newCell:d})}),o}function kt(r){const e=[];return r.forValue((a,n,i)=>{if(i==null||!bt(i))return!0;const o=f.cellToRange(a,n);e.push({oldCell:o,newCell:o})}),e}function Qt(r,e,a,n){if(e==null||a==null)return null;switch(r){case 0:return $t(e,a,n);case 1:return zt(e,a,n);case 2:return Zt(e,a,n);default:return null}}function jt(r,e,a){let n=null,i=!1;switch(r){case 3:n=Jt(e,a),i=!0;break;case 4:n=te(e,a),i=!0;break;case 5:n=ee(e,a);break;case 6:n=ae(e,a);break;case 7:n=ne(e,a);break;case 8:n=ie(e,a);break;case 9:n=re(e,a),i=!0;break;case 10:n=oe(e,a),i=!0;break}return{newCell:n,isReverse:i}}function $t(r,e,a){const n=m.handleMoveRange({id:m.EffectRefRangId.MoveRangeCommandId,params:{toRange:e,fromRange:r}},a);return m.runRefRangeMutations(n,a)}function zt(r,e,a){const n=m.handleMoveRows({id:m.EffectRefRangId.MoveRowsCommandId,params:{toRange:e,fromRange:r}},a);return m.runRefRangeMutations(n,a)}function Zt(r,e,a){const n=m.handleMoveCols({id:m.EffectRefRangId.MoveColsCommandId,params:{toRange:e,fromRange:r}},a);return m.runRefRangeMutations(n,a)}function Jt(r,e){const a=m.handleInsertRow({id:m.EffectRefRangId.InsertRowCommandId,params:{range:r,unitId:"",subUnitId:"",direction:f.Direction.DOWN}},e);return m.runRefRangeMutations(a,e)}function te(r,e){const a=m.handleInsertCol({id:m.EffectRefRangId.InsertColCommandId,params:{range:r,unitId:"",subUnitId:"",direction:f.Direction.RIGHT}},e);return m.runRefRangeMutations(a,e)}function ee(r,e){const a=m.handleIRemoveRow({id:m.EffectRefRangId.RemoveRowCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ae(r,e){const a=m.handleIRemoveCol({id:m.EffectRefRangId.RemoveColCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ne(r,e){const a=m.handleDeleteRangeMoveLeft({id:m.EffectRefRangId.DeleteRangeMoveLeftCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ie(r,e){const a=m.handleDeleteRangeMoveUp({id:m.EffectRefRangId.DeleteRangeMoveUpCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function re(r,e){const a=m.handleInsertRangeMoveDown({id:m.EffectRefRangId.InsertRangeMoveDownCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function oe(r,e){const a=m.handleInsertRangeMoveRight({id:m.EffectRefRangId.InsertRangeMoveRightCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ue(r,e,a){const n=new f.ObjectMatrix({});return r.forEach(i=>{const{oldCell:o,newCell:u}=i,{startRow:c,startColumn:s}=o,l=a.getValue(c,s)||e.getValue(c,s),d=rt(l);if(n.setValue(c,s,{f:null,si:null}),u){const{startRow:T,startColumn:N}=u;n.setValue(T,N,d)}}),n.getMatrix()}function ce(r,e){const a=new f.ObjectMatrix({});return r.reverse().forEach(n=>{const{oldCell:i,newCell:o}=n,{startRow:u,startColumn:c}=i,s=e.getValue(u,c),l=rt(s);if(o){const{startRow:d,startColumn:T}=o;a.setValue(d,T,{f:null,si:null})}a.setValue(u,c,l)}),a.getMatrix()}function rt(r){if(r==null)return;const{f:e,si:a,x:n=0,y:i=0}=r,o=f.isFormulaString(e),u=f.isFormulaId(a);if(!o&&!u)return{f:null,si:null};const c={};return u&&(c.si=a),o&&n===0&&i===0&&(c.f=e),c.f===void 0&&(c.f=null),c.si===void 0&&(c.si=null),c}function fe(r){const e=new f.ObjectMatrix({});return new f.ObjectMatrix(r).forValue((n,i,o)=>{const u=rt(o);u&&e.setValue(n,i,u)}),e.getMatrix()}function bt(r){const e=(r==null?void 0:r.f)||"",a=(r==null?void 0:r.si)||"",n=f.isFormulaString(e),i=f.isFormulaId(a);return!!(n||i)}function yt(r,e,a,n,i,o){if((i==null||i.length===0)&&(o==null||o.length===0)){if(r===a&&e===n)return!0}else if((r===i||i==null||i.length===0)&&e===o)return!0;return!1}function xt(r,e,a=0,n=0){const i=[];for(let o=0,u=r.length;o<u;o++){const c=r[o];if(typeof c=="string"||c.nodeType!==t.sequenceNodeType.REFERENCE||e.includes(o)){i.push(c);continue}const{token:s}=c,l=t.deserializeRangeWithSheetWithCache(s),{range:d,sheetName:T,unitId:N}=l,A=f.Rectangle.moveOffset(d,a,n);i.push({...c,token:t.serializeRangeToRefString({range:A,unitId:N,sheetName:T})})}return i}function Ut(r,e,a,n){const{type:i,unitId:o,sheetId:u,range:c,from:s,to:l}=e,{range:d,sheetId:T,unitId:N,sheetName:A,refOffsetX:S,refOffsetY:C}=r;if(!yt(o,u,a,n,N,T))return;const p=f.Rectangle.moveOffset(d,S,C);let P=null;if(i===b.MoveRange){if(s==null||l==null)return;const I=It(p,s),L=f.getIntersectRange(p,s);if(L==null||I!==4)return;const _=m.handleMoveRange({id:m.EffectRefRangId.MoveRangeCommandId,params:{toRange:l,fromRange:s}},L),R=m.runRefRangeMutations(_,L);if(R==null)return t.ErrorType.REF;P=Et(I,R,s,l,p,L)}else if(i===b.MoveRows){if(s==null||l==null)return;const I=It(p,s);let L=f.getIntersectRange(p,s);if(L==null&&(s.endRow<p.startRow&&l.endRow<p.startRow||s.startRow>p.endRow&&l.startRow>p.endRow))return;L==null&&(L={startRow:p.startRow,endRow:p.endRow,startColumn:p.startColumn,endColumn:p.endColumn,rangeType:f.RANGE_TYPE.NORMAL});const _=m.handleMoveRows({id:m.EffectRefRangId.MoveRowsCommandId,params:{toRange:l,fromRange:s}},L),R=m.runRefRangeMutations(_,L);if(R==null)return t.ErrorType.REF;P=Et(I,R,s,l,p,L)}else if(i===b.MoveCols){if(s==null||l==null)return;const I=It(p,s);let L=f.getIntersectRange(p,s);if(L==null&&(s.endColumn<p.startColumn&&l.endColumn<p.startColumn||s.startColumn>p.endColumn&&l.startColumn>p.endColumn))return;L==null&&(L={startRow:p.startRow,endRow:p.endRow,startColumn:p.startColumn,endColumn:p.endColumn,rangeType:f.RANGE_TYPE.NORMAL});const _=m.handleMoveCols({id:m.EffectRefRangId.MoveColsCommandId,params:{toRange:l,fromRange:s}},L),R=m.runRefRangeMutations(_,L);if(R==null)return t.ErrorType.REF;P=Et(I,R,s,l,p,L)}if(c!=null){if(i===b.InsertRow){const I=m.handleInsertRow({id:m.EffectRefRangId.InsertRowCommandId,params:{range:c,unitId:"",subUnitId:"",direction:f.Direction.DOWN}},p),L=m.runRefRangeMutations(I,p);if(L==null)return;P={...p,...L}}else if(i===b.InsertColumn){const I=m.handleInsertCol({id:m.EffectRefRangId.InsertColCommandId,params:{range:c,unitId:"",subUnitId:"",direction:f.Direction.RIGHT}},p),L=m.runRefRangeMutations(I,p);if(L==null)return;P={...p,...L}}else if(i===b.RemoveRow){const I=m.handleIRemoveRow({id:m.EffectRefRangId.RemoveRowCommandId,params:{range:c}},p),L=m.runRefRangeMutations(I,p);if(L==null)return t.ErrorType.REF;P={...p,...L}}else if(i===b.RemoveColumn){const I=m.handleIRemoveCol({id:m.EffectRefRangId.RemoveColCommandId,params:{range:c}},p),L=m.runRefRangeMutations(I,p);if(L==null)return t.ErrorType.REF;P={...p,...L}}else if(i===b.DeleteMoveLeft){const I=m.handleDeleteRangeMoveLeft({id:m.EffectRefRangId.DeleteRangeMoveLeftCommandId,params:{range:c}},p),L=m.runRefRangeMutations(I,p);if(L==null)return t.ErrorType.REF;P={...p,...L}}else if(i===b.DeleteMoveUp){const I=m.handleDeleteRangeMoveUp({id:m.EffectRefRangId.DeleteRangeMoveUpCommandId,params:{range:c}},p),L=m.runRefRangeMutations(I,p);if(L==null)return t.ErrorType.REF;P={...p,...L}}else if(i===b.InsertMoveDown){const I=m.handleInsertRangeMoveDown({id:m.EffectRefRangId.InsertRangeMoveDownCommandId,params:{range:c}},p),L=m.runRefRangeMutations(I,p);if(L==null)return;P={...p,...L}}else if(i===b.InsertMoveRight){const I=m.handleInsertRangeMoveRight({id:m.EffectRefRangId.InsertRangeMoveRightCommandId,params:{range:c}},p),L=m.runRefRangeMutations(I,p);if(L==null)return;P={...p,...L}}}if(P!=null)return t.serializeRangeToRefString({range:P,sheetName:A,unitId:N})}function Et(r,e,a,n,i,o){const{startRow:u,endRow:c,startColumn:s,endColumn:l,rangeType:d}=et(e),{startRow:T,startColumn:N,endRow:A,endColumn:S,rangeType:C=f.RANGE_TYPE.NORMAL}=et(a),{startRow:p,startColumn:P,endRow:I,endColumn:L}=et(n),{startRow:_,endRow:R,startColumn:x,endColumn:q}=et(o),{startRow:D,endRow:y,startColumn:M,endColumn:U,rangeType:F=f.RANGE_TYPE.NORMAL}=et(i),O={...i};function v(){return d===f.RANGE_TYPE.COLUMN&&F===f.RANGE_TYPE.COLUMN?!0:s>=M&&l<=U}function $(){return d===f.RANGE_TYPE.ROW&&F===f.RANGE_TYPE.ROW?!0:u>=D&&c<=y}if(r===0)if(v())if(u<D)O.startRow=u;else if(u>=y)O.endRow-=A+1-D;else return;else return;else if(r===1)if(v())if(c>y)O.endRow=c;else if(c<=D)O.startRow+=y-T+1;else return;else return;else if(r===2)if($())if(s<M)O.startColumn=s;else if(s>=U)O.endColumn-=S+1-M;else return;else return;else if(r===3)if($())if(l>U)O.endColumn=l;else if(l<=M)O.startColumn+=U-N+1;else return;else return;else r===4?(O.startRow=u,O.startColumn=s,O.endRow=c,O.endColumn=l):N<=M&&S>=U||C===f.RANGE_TYPE.ROW&&F===f.RANGE_TYPE.ROW?a.endRow<D?(p>=D&&(O.startRow-=A-T+1),p>=y&&(O.endRow-=A-T+1)):a.startRow>y?(I<=y&&(O.endRow+=A-T+1),I<=D&&(O.startRow+=A-T+1)):a.startRow>=D&&a.endRow<=y&&(p<=D?O.startRow+=A-T+1:p>=y&&(O.endRow-=A-T+1)):T<=D&&A>=y||C===f.RANGE_TYPE.COLUMN&&F===f.RANGE_TYPE.COLUMN?a.endColumn<M?(P>=M&&(O.startColumn-=S-N+1),P>=U&&(O.endColumn-=S-N+1)):a.startColumn>U?(L<=U&&(O.endColumn+=S-N+1),L<=M&&(O.startColumn+=S-N+1)):a.startColumn>=M&&a.endColumn<=U&&(P<=M?O.startColumn+=S-N+1:P>=U&&(O.endColumn-=S-N+1)):((P<=q+1&&L>=U||P<=M&&L>=x-1)&&p<=D&&I>=y||(p<=R+1&&I>=y||p<=D&&I>=_-1)&&P<=M&&L>=U,O.startRow=u,O.startColumn=s,O.endRow=c,O.endColumn=l);return O}function It(r,e){const a=Q(r.startRow),n=j(r.endRow),i=Q(r.startColumn),o=j(r.endColumn),u=Q(e.startRow),c=j(e.endRow),s=Q(e.startColumn),l=j(e.endColumn);function d(){return r.rangeType===f.RANGE_TYPE.COLUMN&&e.rangeType===f.RANGE_TYPE.COLUMN?!0:a>=u&&n<=c}function T(){return r.rangeType===f.RANGE_TYPE.ROW&&e.rangeType===f.RANGE_TYPE.ROW?!0:i>=s&&o<=l}function N(){return r.rangeType===f.RANGE_TYPE.ALL&&e.rangeType===f.RANGE_TYPE.ALL}return d()&&T()||N()?4:T()&&a>=u&&a<=c&&n>c?0:T()&&n>=u&&n<=c&&a<u?1:d()&&i>=s&&i<=l&&o>l?2:d()&&o>=s&&o<=l&&i<s?3:null}function Q(r){return isNaN(r)?-1/0:r}function j(r){return isNaN(r)?1/0:r}function et(r){const{startRow:e,endRow:a,startColumn:n,endColumn:i}=r;return{...r,startRow:Q(e),endRow:j(a),startColumn:Q(n),endColumn:j(i)}}function qt(r,e){const{id:a}=e;let n=null;switch(a){case m.MoveRangeCommand.id:n=me(e,r);break;case m.MoveRowsCommand.id:n=se(e,r);break;case m.MoveColsCommand.id:n=le(e,r);break;case m.InsertRowCommand.id:n=pe(e);break;case m.InsertColCommand.id:n=de(e);break;case m.InsertRangeMoveRightCommand.id:n=Le(e,r);break;case m.InsertRangeMoveDownCommand.id:n=Te(e,r);break;case m.RemoveRowCommand.id:n=Ne(e,r);break;case m.RemoveColCommand.id:n=Pe(e,r);break;case m.DeleteRangeMoveUpCommand.id:n=Ee(e,r);break;case m.DeleteRangeMoveLeftCommand.id:n=Ie(e,r);break;case m.SetWorksheetNameCommand.id:n=Ae(e,r);break;case m.RemoveSheetCommand.id:n=Se(e,r);break;case m.SetDefinedNameCommand.id:n=Ce(e,r);break;case m.RemoveDefinedNameCommand.id:n=Re(e,r);break}return n}function V(r){var n;const e=r.getUnitId(),a=((n=r.getActiveSheet())==null?void 0:n.getSheetId())||"";return{unitId:e,sheetId:a}}function me(r,e){const{params:a}=r;if(!a)return null;const{fromRange:n,toRange:i}=a;if(!n||!i)return null;const{unitId:o,sheetId:u}=V(e);return{type:b.MoveRange,from:n,to:i,unitId:o,sheetId:u}}function se(r,e){const{params:a}=r;if(!a)return null;const{fromRange:{startRow:n,endRow:i},toRange:{startRow:o,endRow:u}}=a,c=e.getUnitId(),s=e.getActiveSheet();if(!s)return null;const l=s.getSheetId(),d={startRow:n,startColumn:0,endRow:i,endColumn:s.getColumnCount()-1,rangeType:f.RANGE_TYPE.ROW},T={startRow:o,startColumn:0,endRow:u,endColumn:s.getColumnCount()-1,rangeType:f.RANGE_TYPE.ROW};return{type:b.MoveRows,from:d,to:T,unitId:c,sheetId:l}}function le(r,e){const{params:a}=r;if(!a)return null;const{fromRange:{startColumn:n,endColumn:i},toRange:{startColumn:o,endColumn:u}}=a,c=e.getUnitId(),s=e.getActiveSheet();if(!s)return null;const l=s.getSheetId(),d={startRow:0,startColumn:n,endRow:s.getRowCount()-1,endColumn:i,rangeType:f.RANGE_TYPE.COLUMN},T={startRow:0,startColumn:o,endRow:s.getRowCount()-1,endColumn:u,rangeType:f.RANGE_TYPE.COLUMN};return{type:b.MoveCols,from:d,to:T,unitId:c,sheetId:l}}function pe(r){const{params:e}=r;if(!e)return null;const{range:a,unitId:n,subUnitId:i}=e;return{type:b.InsertRow,range:a,unitId:n,sheetId:i}}function de(r){const{params:e}=r;if(!e)return null;const{range:a,unitId:n,subUnitId:i}=e;return{type:b.InsertColumn,range:a,unitId:n,sheetId:i}}function Le(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.InsertMoveRight,range:n,unitId:i,sheetId:o}}function Te(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.InsertMoveDown,range:n,unitId:i,sheetId:o}}function Ne(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.RemoveRow,range:n,unitId:i,sheetId:o}}function Pe(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.RemoveColumn,range:n,unitId:i,sheetId:o}}function Ee(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.DeleteMoveUp,range:n,unitId:i,sheetId:o}}function Ie(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.DeleteMoveLeft,range:n,unitId:i,sheetId:o}}function Ae(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,subUnitId:i,name:o}=a,{unitId:u,sheetId:c}=V(e);return{type:b.SetName,unitId:n||u,sheetId:i||c,sheetName:o}}function Se(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,subUnitId:i}=a,{unitId:o,sheetId:u}=V(e);return{type:b.RemoveSheet,unitId:n||o,sheetId:i||u}}function Ce(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,name:i,id:o}=a,{sheetId:u}=V(e);return{type:b.SetDefinedName,unitId:n,sheetId:u,definedName:i,definedNameId:o}}function Re(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,name:i,id:o}=a,{sheetId:u}=V(e);return{type:b.RemoveDefinedName,unitId:n,sheetId:u,definedName:i,definedNameId:o}}var Oe=Object.getOwnPropertyDescriptor,Me=(r,e,a,n)=>{for(var i=n>1?void 0:n?Oe(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},ot=(r,e)=>(a,n)=>e(a,n,r);E.UpdateDefinedNameController=class extends f.Disposable{constructor(e,a,n,i){super(),this._definedNamesService=e,this._univerInstanceService=a,this._sheetInterceptorService=n,this._lexerTreeBuilder=i,this._initialize()}_initialize(){this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{if(e.id===m.SetDefinedNameCommand.id||e.id===m.RemoveDefinedNameCommand.id)return{redos:[],undos:[]};const a=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET);if(a==null)return{redos:[],undos:[]};const n=qt(a,e);return n?this._getUpdateDefinedNameMutations(a,n):{redos:[],undos:[]}}}))}_getUpdateDefinedNameMutations(e,a){const{type:n,unitId:i,sheetId:o}=a,u=this._definedNamesService.getDefinedNameMap(i);if(!u)return{redos:[],undos:[]};const c=[],s=[];return Object.values(u).forEach(l=>{var P;const{formulaOrRefString:d}=l,T=this._lexerTreeBuilder.sequenceNodesBuilder(d);if(T==null)return!0;let N=!1;const A=[];for(let I=0,L=T.length;I<L;I++){const _=T[I];if(typeof _=="string"||_.nodeType!==t.sequenceNodeType.REFERENCE)continue;const{token:R}=_,x=t.deserializeRangeWithSheetWithCache(R),{range:q,sheetName:D,unitId:y}=x,M=((P=e.getSheetBySheetName(D))==null?void 0:P.getSheetId())||"",U={range:q,sheetId:M,unitId:y,sheetName:D,refOffsetX:0,refOffsetY:0};let F=null;if(n===b.RemoveSheet)F=this._removeSheet(l,i,o);else if(n===b.SetName){const{sheetId:O,sheetName:v}=a;if(v==null||M==null||M.length===0||O!==M)continue;F=t.serializeRangeToRefString({range:q,sheetName:v,unitId:y})}else F=Ut(U,a,i,o);F!=null&&(T[I]={..._,token:F},N=!0,A.push(I))}if(!N)return!0;const S=t.generateStringWithSequence(xt(T,A)),C={id:t.SetDefinedNameMutation.id,params:{unitId:i,...l,formulaOrRefString:S}};c.push(C);const p={id:t.SetDefinedNameMutation.id,params:{unitId:i,...l}};s.push(p)}),{redos:c,undos:s}}_removeSheet(e,a,n){var u;const{formulaOrRefString:i}=e;return((u=this._definedNamesService.getWorksheetByRef(a,i))==null?void 0:u.getSheetId())===n?t.ErrorType.REF:null}},E.UpdateDefinedNameController=Me([ot(0,t.IDefinedNamesService),ot(1,f.IUniverInstanceService),ot(2,f.Inject(m.SheetInterceptorService)),ot(3,f.Inject(t.LexerTreeBuilder))],E.UpdateDefinedNameController);var at=(r=>(r[r.NOT_REGISTER=1]="NOT_REGISTER",r[r.SUCCESS=2]="SUCCESS",r[r.WAIT=3]="WAIT",r[r.ERROR=4]="ERROR",r))(at||{}),_e=Object.getOwnPropertyDescriptor,De=(r,e,a,n)=>{for(var i=n>1?void 0:n?_e(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},At=(r,e)=>(a,n)=>e(a,n,r);E.RegisterOtherFormulaService=class extends f.Disposable{constructor(a,n,i){super();h(this,"_formulaCacheMap",new Map);h(this,"_formulaChangeWithRange$",new H.Subject);h(this,"formulaChangeWithRange$",this._formulaChangeWithRange$.asObservable());h(this,"_formulaResult$",new H.Subject);h(this,"formulaResult$",this._formulaResult$.asObservable());h(this,"calculateStarted$",new H.BehaviorSubject(!1));this._commandService=a,this._activeDirtyManagerService=n,this._lifecycleService=i,this._initFormulaRegister(),this._initFormulaCalculationResultChange()}dispose(){super.dispose(),this._formulaChangeWithRange$.complete(),this._formulaResult$.complete(),this.calculateStarted$.complete()}_ensureCacheMap(a,n){let i=this._formulaCacheMap.get(a);i||(i=new Map,this._formulaCacheMap.set(a,i));let o=i.get(n);return o||(o=new Map,i.set(n,o)),o}_createFormulaId(a,n){return`formula.${a}_${n}_${f.Tools.generateRandomId(8)}`}_initFormulaRegister(){this._activeDirtyManagerService.register(tt.id,{commandId:tt.id,getDirtyData(n){return{dirtyUnitOtherFormulaMap:n.params}}});const a=n=>{const{unitId:i,subUnitId:o,formulaText:u,formulaId:c,ranges:s}=n;if(!this._ensureCacheMap(i,o).has(c))return;const d={unitId:i,subUnitId:o,formulaMap:{[c]:{f:u,ranges:s}}};this._commandService.executeCommand(t.SetOtherFormulaMutation.id,d).then(()=>{this._commandService.executeCommand(tt.id,{[i]:{[o]:{[c]:!0}}})})};this.disposeWithMe(this._formulaChangeWithRange$.pipe(H.bufferWhen(()=>this.calculateStarted$.pipe(H.filter(n=>n)))).subscribe(n=>n.forEach(a))),this.disposeWithMe(this._formulaChangeWithRange$.pipe(H.filter(()=>this.calculateStarted$.getValue())).subscribe(a))}_initFormulaCalculationResultChange(){this.disposeWithMe(this._commandService.onCommandExecuted(a=>{if(a.id===t.SetFormulaCalculationResultMutation.id){const n=a.params,{unitOtherData:i}=n,o={};for(const u in i){const c=i[u],s={};o[u]=s;for(const l in c){const d=this._ensureCacheMap(u,l),T=c[l],N=[];s[l]=N;for(const A in T){const S=T[A];if(d.has(A)){const C=d.get(A);if(!C)continue;C.result||(C.result={});const p=new f.ObjectMatrix(S),P=new f.ObjectMatrix(C.result);p.forValue((I,L,_)=>{P.setValue(I,L,_)}),C.status=at.SUCCESS,C.callbacks.forEach(I=>{I(S)}),C.callbacks.clear(),N.push(C)}}}}this._formulaResult$.next(o)}}))}registerFormulaWithRange(a,n,i,o=[{startRow:0,endRow:0,startColumn:0,endColumn:0}],u){const c=this._createFormulaId(a,n);return this._ensureCacheMap(a,n).set(c,{result:void 0,status:at.WAIT,formulaId:c,callbacks:new Set,extra:u}),this._formulaChangeWithRange$.next({unitId:a,subUnitId:n,formulaText:i,formulaId:c,ranges:o}),c}deleteFormula(a,n,i){const o={unitId:a,subUnitId:n,formulaIdList:i};this._commandService.executeCommand(t.RemoveOtherFormulaMutation.id,o);const u=this._ensureCacheMap(a,n);i.forEach(c=>u.delete(c))}getFormulaValue(a,n,i){const o=this._ensureCacheMap(a,n),u=o.get(i);return u?u.status===at.SUCCESS||u.status===at.ERROR?Promise.resolve(u):new Promise(c=>{u.callbacks.add(()=>{c(o.get(i))})}):Promise.resolve(null)}getFormulaValueSync(a,n,i){return this._ensureCacheMap(a,n).get(i)}},E.RegisterOtherFormulaService=De([At(0,f.ICommandService),At(1,t.IActiveDirtyManagerService),At(2,f.Inject(f.LifecycleService))],E.RegisterOtherFormulaService);const nt="sheets-formula.base.config";var Y=(r=>(r[r.FORCED=0]="FORCED",r[r.WHEN_EMPTY=1]="WHEN_EMPTY",r[r.NO_CALCULATION=2]="NO_CALCULATION",r))(Y||{});const ht={},be="sheets-formula.remote.config",Ft={};var ye=Object.getOwnPropertyDescriptor,xe=(r,e,a,n)=>{for(var i=n>1?void 0:n?ye(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},g=(r,e)=>(a,n)=>e(a,n,r);const Bt={done:0,count:0},St={onlyLocal:!0};E.TriggerCalculationController=class extends f.Disposable{constructor(a,n,i,o,u,c,s){super();h(this,"_waitingCommandQueue",[]);h(this,"_executingDirtyData",{forceCalculation:!1,dirtyRanges:[],dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},clearDependencyTreeCache:{}});h(this,"_setTimeoutKey",-1);h(this,"_startExecutionTime",0);h(this,"_totalCalculationTaskCount",0);h(this,"_doneCalculationTaskCount",0);h(this,"_executionInProgressParams",null);h(this,"_restartCalculation",!1);h(this,"_forceCalculating",!1);h(this,"_progress$",new H.BehaviorSubject(Bt));h(this,"progress$",this._progress$.asObservable());this._commandService=a,this._activeDirtyManagerService=n,this._logService=i,this._configService=o,this._formulaDataModel=u,this._localeService=c,this._registerOtherFormulaService=s,this._commandExecutedListener(),this._initialExecuteFormulaProcessListener(),this._initialExecuteFormula()}_emitProgress(a){this._progress$.next({done:this._doneCalculationTaskCount,count:this._totalCalculationTaskCount,label:a})}_startProgress(){this._doneCalculationTaskCount=0,this._totalCalculationTaskCount=1;const a=this._localeService.t("formula.progress.analyzing");this._emitProgress(a)}_calculateProgress(a){if(this._executionInProgressParams){const{totalFormulasToCalculate:n,completedFormulasCount:i,totalArrayFormulasToCalculate:o,completedArrayFormulasCount:u}=this._executionInProgressParams;if(this._doneCalculationTaskCount=i+u,this._totalCalculationTaskCount=n+o,this._totalCalculationTaskCount===0)return;this._emitProgress(a)}}_completeProgress(){this._doneCalculationTaskCount=this._totalCalculationTaskCount=1;const a=this._localeService.t("formula.progress.done");this._emitProgress(a)}clearProgress(){this._doneCalculationTaskCount=0,this._totalCalculationTaskCount=0,this._emitProgress()}dispose(){super.dispose(),this._progress$.next(Bt),this._progress$.complete(),clearTimeout(this._setTimeoutKey)}_getCalculationMode(){var n;const a=this._configService.getConfig(nt);return(n=a==null?void 0:a.initialFormulaComputing)!=null?n:Y.WHEN_EMPTY}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted((a,n)=>{if(this._activeDirtyManagerService.get(a.id)){if(a.id===m.SetRangeValuesMutation.id){const i=a.params;if(n&&n.onlyLocal===!0||i.trigger===m.SetStyleCommand.id||i.trigger===m.SetBorderCommand.id||i.trigger===m.ClearSelectionFormatCommand.id)return}this._waitingCommandQueue.push(a),clearTimeout(this._setTimeoutKey),this._setTimeoutKey=setTimeout(()=>{const i=this._generateDirty(this._waitingCommandQueue);this._executingDirtyData=this._mergeDirty(this._executingDirtyData,i),this._executionInProgressParams==null?this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,{...this._executingDirtyData},St):(this._restartCalculation=!0,this._commandService.executeCommand(t.SetFormulaCalculationStopMutation.id,{})),this._waitingCommandQueue=[]},100)}}))}_generateDirty(a){const n=[],i={},o={},u={},c={},s={};for(const l of a){const d=this._activeDirtyManagerService.get(l.id);if(d==null)continue;const T=d.getDirtyData(l),{dirtyRanges:N,dirtyNameMap:A,dirtyDefinedNameMap:S,dirtyUnitFeatureMap:C,dirtyUnitOtherFormulaMap:p,clearDependencyTreeCache:P}=T;N!=null&&this._mergeDirtyRanges(n,N),A!=null&&this._mergeDirtyNameMap(i,A),S!=null&&this._mergeDirtyNameMap(o,S),C!=null&&this._mergeDirtyUnitFeatureOrOtherFormulaMap(u,C),p!=null&&this._mergeDirtyUnitFeatureOrOtherFormulaMap(c,p),P!=null&&this._mergeDirtyNameMap(s,P)}return{dirtyRanges:n,dirtyNameMap:i,dirtyDefinedNameMap:o,dirtyUnitFeatureMap:u,dirtyUnitOtherFormulaMap:c,forceCalculation:!1,clearDependencyTreeCache:s,maxIteration:this._configService.getConfig(t.ENGINE_FORMULA_CYCLE_REFERENCE_COUNT)}}_mergeDirty(a,n){const i=[...a.dirtyRanges,...n.dirtyRanges],o={...a.dirtyNameMap},u={...a.dirtyDefinedNameMap},c={...a.dirtyUnitFeatureMap},s={...a.dirtyUnitOtherFormulaMap},l={...a.clearDependencyTreeCache};this._mergeDirtyNameMap(o,n.dirtyNameMap),this._mergeDirtyNameMap(u,n.dirtyDefinedNameMap),this._mergeDirtyUnitFeatureOrOtherFormulaMap(c,n.dirtyUnitFeatureMap),this._mergeDirtyUnitFeatureOrOtherFormulaMap(s,n.dirtyUnitOtherFormulaMap),this._mergeDirtyNameMap(l,n.clearDependencyTreeCache);const d=a.maxIteration||n.maxIteration;return{dirtyRanges:i,dirtyNameMap:o,dirtyDefinedNameMap:u,dirtyUnitFeatureMap:c,dirtyUnitOtherFormulaMap:s,forceCalculation:!!this._forceCalculating,clearDependencyTreeCache:l,maxIteration:d}}_mergeDirtyRanges(a,n){for(const i of n){let o=!1;for(const u of a)if(i.unitId===u.unitId&&i.sheetId===u.sheetId){const{startRow:c,startColumn:s,endRow:l,endColumn:d}=i.range,{startRow:T,startColumn:N,endRow:A,endColumn:S}=u.range;if(c===T&&s===N&&l===A&&d===S){o=!0;break}}o||a.push(i)}}_mergeDirtyNameMap(a,n){Object.keys(n).forEach(i=>{a[i]==null&&(a[i]={}),Object.keys(n[i]).forEach(o=>{var u;(u=n[i])!=null&&u[o]&&(a[i][o]=n[i][o])})})}_mergeDirtyUnitFeatureOrOtherFormulaMap(a,n){Object.keys(n).forEach(i=>{a[i]==null&&(a[i]={}),Object.keys(n[i]).forEach(o=>{a[i][o]==null&&(a[i][o]={}),Object.keys(n[i][o]).forEach(u=>{a[i][o][u]=n[i][o][u]||!1})})})}_initialExecuteFormulaProcessListener(){let a=null,n=0;this.disposeWithMe(this._commandService.onCommandExecuted(i=>{if(i.id===t.SetFormulaCalculationStartMutation.id){const{forceCalculation:u=!1}=i.params;u&&(this._forceCalculating=!0)}else i.id===t.SetFormulaCalculationStopMutation.id&&this.clearProgress();if(i.id!==t.SetFormulaCalculationNotificationMutation.id)return;const o=i.params;if(o.stageInfo!=null){const{stage:u}=o.stageInfo;if(u===t.FormulaExecuteStageType.START)n===0&&(this._startExecutionTime=performance.now()),n++,a!==null&&(clearTimeout(a),a=null),a=setTimeout(()=>{a=null,this._startProgress()},1e3);else if(u===t.FormulaExecuteStageType.CURRENTLY_CALCULATING){if(this._executionInProgressParams=o.stageInfo,a===null){const c=this._localeService.t("formula.progress.calculating");this._calculateProgress(c)}}else if(u===t.FormulaExecuteStageType.START_DEPENDENCY_ARRAY_FORMULA){if(this._executionInProgressParams=o.stageInfo,a===null){const c=this._localeService.t("formula.progress.array-analysis");this._calculateProgress(c)}}else if(u===t.FormulaExecuteStageType.CURRENTLY_CALCULATING_ARRAY_FORMULA&&(this._executionInProgressParams=o.stageInfo,a===null)){const c=this._localeService.t("formula.progress.array-calculation");this._calculateProgress(c)}}else{const u=o.functionsExecutedState;let c="";switch(n--,u){case t.FormulaExecutedStateType.NOT_EXECUTED:c="No tasks are being executed anymore",this._resetExecutingDirtyData();break;case t.FormulaExecutedStateType.STOP_EXECUTION:c="The execution of the formula has been stopped",n=0;break;case t.FormulaExecutedStateType.SUCCESS:c="Formula calculation succeeded",(n===0||n===-1)&&(c+=`. Total time consumed: ${performance.now()-this._startExecutionTime} ms`),this._resetExecutingDirtyData();break;case t.FormulaExecutedStateType.INITIAL:c="Waiting for calculation",this._resetExecutingDirtyData();break}(n===0||n===-1)&&(a?(clearTimeout(a),a=null,this.clearProgress()):this._completeProgress(),n=0,this._doneCalculationTaskCount=0,this._totalCalculationTaskCount=0,this._forceCalculating=!1),u===t.FormulaExecutedStateType.STOP_EXECUTION&&this._restartCalculation?(this._restartCalculation=!1,this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,{...this._executingDirtyData},St)):this._executionInProgressParams=null,this._logService.debug("[TriggerCalculationController]",c)}}))}_resetExecutingDirtyData(){this._executingDirtyData={dirtyRanges:[],dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},forceCalculation:!1,clearDependencyTreeCache:{}}}_initialExecuteFormula(){const a=this._getCalculationMode(),n=this._getDirtyDataByCalculationMode(a);this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,n,St),this._registerOtherFormulaService.calculateStarted$.next(!0)}_getDirtyDataByCalculationMode(a){const n=a===Y.FORCED,i=a===Y.WHEN_EMPTY?this._formulaDataModel.getFormulaDirtyRanges():[];return{forceCalculation:n,dirtyRanges:i,dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},clearDependencyTreeCache:{},maxIteration:this._configService.getConfig(t.ENGINE_FORMULA_CYCLE_REFERENCE_COUNT)}}},E.TriggerCalculationController=xe([g(0,f.ICommandService),g(1,t.IActiveDirtyManagerService),g(2,f.ILogService),g(3,f.IConfigService),g(4,f.Inject(t.FormulaDataModel)),g(5,f.Inject(f.LocaleService)),g(6,f.Inject(E.RegisterOtherFormulaService))],E.TriggerCalculationController);function Ue(r,e,a,n){const i=r.get(t.IFormulaCurrentConfigService),o=r.get(t.Lexer),u=r.get(t.AstTreeBuilder),c=r.get(t.Interpreter);i.load({formulaData:{},arrayFormulaCellData:{},arrayFormulaRange:{},forceCalculate:!1,dirtyRanges:[],dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},excludedCell:{},allUnitData:{[a]:n},dirtyUnitOtherFormulaMap:{}});const s=o.treeBuilder(e),l=u.parse(s),d=c.execute(t.generateExecuteAstNodeData(l));return t.getObjectValue(d)}var qe=Object.getOwnPropertyDescriptor,he=(r,e,a,n)=>{for(var i=n>1?void 0:n?qe(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},X=(r,e)=>(a,n)=>e(a,n,r);E.UpdateFormulaController=class extends f.Disposable{constructor(e,a,n,i,o,u,c,s){super(),this._univerInstanceService=e,this._commandService=a,this._lexerTreeBuilder=n,this._formulaDataModel=i,this._sheetInterceptorService=o,this._definedNamesService=u,this._configService=c,this._injector=s,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>this._getUpdateFormula(e)})),this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.params)if(e.id===m.RemoveSheetMutation.id){const{subUnitId:a,unitId:n}=e.params;this._handleWorkbookDisposed(n,a)}else e.id===m.InsertSheetMutation.id&&this._handleInsertSheetMutation(e.params)})),this.disposeWithMe(this._commandService.beforeCommandExecuted((e,a)=>{if(e.id===m.SetRangeValuesMutation.id){const n=e.params;if(a&&a.onlyLocal===!0||n.trigger===m.SetStyleCommand.id||n.trigger===m.SetBorderCommand.id||n.trigger===m.ClearSelectionFormatCommand.id)return;this._handleSetRangeValuesMutation(n)}})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(f.UniverInstanceType.UNIVER_SHEET).subscribe(e=>this._handleWorkbookAdded(e))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(f.UniverInstanceType.UNIVER_SHEET).pipe(H.map(e=>e.getUnitId())).subscribe(e=>this._handleWorkbookDisposed(e)))}_handleSetRangeValuesMutation(e){const{subUnitId:a,unitId:n,cellValue:i}=e;if(i==null)return;const o=this._formulaDataModel.updateFormulaData(n,a,i),u={[n]:{[a]:o}};this._commandService.executeCommand(m.SetRangeValuesMutation.id,{unitId:n,subUnitId:a,cellValue:fe(o)},{onlyLocal:!0,fromFormula:!0}),this._formulaDataModel.updateArrayFormulaCellData(n,a,i),this._formulaDataModel.updateArrayFormulaRange(n,a,i),this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:u},{onlyLocal:!0}),this._commandService.executeCommand(t.SetArrayFormulaDataMutation.id,{arrayFormulaRange:this._formulaDataModel.getArrayFormulaRange(),arrayFormulaCellData:this._formulaDataModel.getArrayFormulaCellData()},{onlyLocal:!0,remove:!0})}_handleWorkbookDisposed(e,a){const n=this._formulaDataModel.getFormulaData(),i=Pt(n,e,a),o=this._formulaDataModel.getArrayFormulaRange(),u=Pt(o,e,a),c=this._formulaDataModel.getArrayFormulaCellData(),s=Pt(c,e,a);i&&this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:i},{onlyLocal:!0}),u&&s&&this._commandService.executeCommand(t.SetArrayFormulaDataMutation.id,{arrayFormulaRange:o,arrayFormulaCellData:c},{onlyLocal:!0})}_handleInsertSheetMutation(e){const{sheet:a,unitId:n}=e,i=this._formulaDataModel.getFormulaData(),{id:o,cellData:u}=a,c=new f.ObjectMatrix(u),s=t.initSheetFormulaData(i,n,o,c);this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:s},{onlyLocal:!0})}_handleWorkbookAdded(e){var l;const a={},n=e.getUnitId(),i={[n]:{}};e.getSheets().forEach(d=>{var S;const T=d.getCellMatrix(),N=d.getSheetId(),A=t.initSheetFormulaData(a,n,N,T);i[n][N]=(S=A[n])==null?void 0:S[N]}),this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:i},{onlyLocal:!0});const u=this._configService.getConfig(nt),c=(l=u==null?void 0:u.initialFormulaComputing)!=null?l:Y.WHEN_EMPTY,s=this._getDiryDataByCalculationMode(c);this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,s,{onlyLocal:!0})}_getDiryDataByCalculationMode(e){const a=e===Y.FORCED,n=e===Y.WHEN_EMPTY?this._formulaDataModel.getFormulaDirtyRanges():[];return{forceCalculation:a,dirtyRanges:n,dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},clearDependencyTreeCache:{}}}_getUpdateFormula(e){const a=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET);if(!a)return{undos:[],redos:[]};const n=qt(a,e);if(n){const{unitSheetNameMap:i}=this._formulaDataModel.getCalculateData(),o=this._formulaDataModel.getFormulaData(),{newFormulaData:u}=this._getFormulaReferenceMoveInfo(o,i,n),{undos:c,redos:s}=Xt(o,u,n);return{undos:c,redos:s}}return{undos:[],redos:[]}}_getFormulaReferenceMoveInfo(e,a,n){if(!f.Tools.isDefine(e))return{newFormulaData:{},oldFormulaData:{}};const i=Object.keys(e);if(i.length===0)return{newFormulaData:{},oldFormulaData:{}};const o={},u={};for(const c of i){const s=e[c];if(s==null)continue;const l=Object.keys(s);f.Tools.isDefine(o[c])||(o[c]={}),f.Tools.isDefine(u[c])||(u[c]={});for(const d of l){const T=new f.ObjectMatrix(s[d]||{}),N=new f.ObjectMatrix;T.forValue((A,S,C)=>{var D;if(!C)return!0;const{f:p,x:P,y:I,si:L}=C,_=this._lexerTreeBuilder.sequenceNodesBuilder(p);if(_==null)return!0;let R=!1;const x=[];for(let y=0,M=_.length;y<M;y++){const U=_[y];if(typeof U=="string")continue;const{token:F,nodeType:O}=U,{type:v}=n;if((v===b.SetDefinedName||v===b.RemoveDefinedName)&&(O===t.sequenceNodeType.DEFINED_NAME||O===t.sequenceNodeType.FUNCTION)){const{definedNameId:Z,definedName:J}=n;if(Z===void 0||J===void 0)continue;const k=this._definedNamesService.getValueById(c,Z);if(k==null||k.name!==F)continue;_[y]={...U,token:v===b.SetDefinedName?J:t.ErrorType.REF},R=!0,x.push(y);continue}else if(O!==t.sequenceNodeType.REFERENCE)continue;const $=t.deserializeRangeWithSheetWithCache(F),{range:z,sheetName:w,unitId:B}=$,W=B==null||B.length===0?c:B,G=((D=a==null?void 0:a[W])==null?void 0:D[w])||"";if(!yt(n.unitId,n.sheetId,c,d,B,G))continue;const Nt={range:z,sheetId:G,unitId:B,sheetName:w,refOffsetX:P||0,refOffsetY:I||0};let K=null;if(v===b.SetName){const{unitId:Z,sheetId:J,sheetName:k}=n;if(k==null||G==null||G.length===0||J!==G)continue;K=t.serializeRangeToRefString({range:z,sheetName:k,unitId:B})}else if(v===b.RemoveSheet){const{unitId:Z,sheetId:J,sheetName:k}=n;if(G==null||G.length===0||J!==G)continue;K=t.ErrorType.REF}else v!==b.SetDefinedName&&(K=Ut(Nt,n,c,d));K!=null&&(_[y]={...U,token:K},R=!0,x.push(y))}if(!R)return!0;const q=xt(_,x,P,I);N.setValue(A,S,{f:`=${t.generateStringWithSequence(q)}`})}),u[c]&&(u[c][d]=N.getData())}}return{newFormulaData:u}}},E.UpdateFormulaController=he([X(0,f.IUniverInstanceService),X(1,f.ICommandService),X(2,f.Inject(t.LexerTreeBuilder)),X(3,f.Inject(t.FormulaDataModel)),X(4,f.Inject(m.SheetInterceptorService)),X(5,t.IDefinedNamesService),X(6,f.IConfigService),X(7,f.Inject(f.Injector))],E.UpdateFormulaController);const Fe=[{functionName:t.FUNCTION_NAMES_ARRAY.ARRAY_CONSTRAIN,functionType:t.FunctionType.Array,description:"formula.functionList.ARRAY_CONSTRAIN.description",abstract:"formula.functionList.ARRAY_CONSTRAIN.abstract",functionParameter:[{name:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.inputRange.name",detail:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.inputRange.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numRows.name",detail:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numRows.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numCols.name",detail:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numCols.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ARRAY.FLATTEN,functionType:t.FunctionType.Array,description:"formula.functionList.FLATTEN.description",abstract:"formula.functionList.FLATTEN.abstract",functionParameter:[{name:"formula.functionList.FLATTEN.functionParameter.range1.name",detail:"formula.functionList.FLATTEN.functionParameter.range1.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.FLATTEN.functionParameter.range2.name",detail:"formula.functionList.FLATTEN.functionParameter.range2.detail",example:"D1:F3",require:0,repeat:1}]}],Be=[{functionName:t.FUNCTION_NAMES_COMPATIBILITY.BETADIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.BETADIST.description",abstract:"formula.functionList.BETADIST.abstract",functionParameter:[{name:"formula.functionList.BETADIST.functionParameter.x.name",detail:"formula.functionList.BETADIST.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.alpha.name",detail:"formula.functionList.BETADIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.beta.name",detail:"formula.functionList.BETADIST.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.A.name",detail:"formula.functionList.BETADIST.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.B.name",detail:"formula.functionList.BETADIST.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.BETAINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.BETAINV.description",abstract:"formula.functionList.BETAINV.abstract",functionParameter:[{name:"formula.functionList.BETAINV.functionParameter.probability.name",detail:"formula.functionList.BETAINV.functionParameter.probability.detail",example:"0.685470581",require:1,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.alpha.name",detail:"formula.functionList.BETAINV.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.beta.name",detail:"formula.functionList.BETAINV.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.A.name",detail:"formula.functionList.BETAINV.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.B.name",detail:"formula.functionList.BETAINV.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.BINOMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.BINOMDIST.description",abstract:"formula.functionList.BINOMDIST.abstract",functionParameter:[{name:"formula.functionList.BINOMDIST.functionParameter.numberS.name",detail:"formula.functionList.BINOMDIST.functionParameter.numberS.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.BINOMDIST.functionParameter.trials.name",detail:"formula.functionList.BINOMDIST.functionParameter.trials.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BINOMDIST.functionParameter.probabilityS.name",detail:"formula.functionList.BINOMDIST.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.BINOMDIST.functionParameter.cumulative.name",detail:"formula.functionList.BINOMDIST.functionParameter.cumulative.detail",example:"false",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CHIDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CHIDIST.description",abstract:"formula.functionList.CHIDIST.abstract",functionParameter:[{name:"formula.functionList.CHIDIST.functionParameter.x.name",detail:"formula.functionList.CHIDIST.functionParameter.x.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CHIDIST.functionParameter.degFreedom.name",detail:"formula.functionList.CHIDIST.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CHIINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CHIINV.description",abstract:"formula.functionList.CHIINV.abstract",functionParameter:[{name:"formula.functionList.CHIINV.functionParameter.probability.name",detail:"formula.functionList.CHIINV.functionParameter.probability.detail",example:"0.93",require:1,repeat:0},{name:"formula.functionList.CHIINV.functionParameter.degFreedom.name",detail:"formula.functionList.CHIINV.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CHITEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CHITEST.description",abstract:"formula.functionList.CHITEST.abstract",functionParameter:[{name:"formula.functionList.CHITEST.functionParameter.actualRange.name",detail:"formula.functionList.CHITEST.functionParameter.actualRange.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.CHITEST.functionParameter.expectedRange.name",detail:"formula.functionList.CHITEST.functionParameter.expectedRange.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CONFIDENCE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CONFIDENCE.description",abstract:"formula.functionList.CONFIDENCE.abstract",functionParameter:[{name:"formula.functionList.CONFIDENCE.functionParameter.alpha.name",detail:"formula.functionList.CONFIDENCE.functionParameter.alpha.detail",example:"0.05",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE.functionParameter.standardDev.name",detail:"formula.functionList.CONFIDENCE.functionParameter.standardDev.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE.functionParameter.size.name",detail:"formula.functionList.CONFIDENCE.functionParameter.size.detail",example:"50",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.COVAR,functionType:t.FunctionType.Compatibility,description:"formula.functionList.COVAR.description",abstract:"formula.functionList.COVAR.abstract",functionParameter:[{name:"formula.functionList.COVAR.functionParameter.array1.name",detail:"formula.functionList.COVAR.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.COVAR.functionParameter.array2.name",detail:"formula.functionList.COVAR.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CRITBINOM,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CRITBINOM.description",abstract:"formula.functionList.CRITBINOM.abstract",functionParameter:[{name:"formula.functionList.CRITBINOM.functionParameter.trials.name",detail:"formula.functionList.CRITBINOM.functionParameter.trials.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.CRITBINOM.functionParameter.probabilityS.name",detail:"formula.functionList.CRITBINOM.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CRITBINOM.functionParameter.alpha.name",detail:"formula.functionList.CRITBINOM.functionParameter.alpha.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.EXPONDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.EXPONDIST.description",abstract:"formula.functionList.EXPONDIST.abstract",functionParameter:[{name:"formula.functionList.EXPONDIST.functionParameter.x.name",detail:"formula.functionList.EXPONDIST.functionParameter.x.detail",example:"0.2",require:1,repeat:0},{name:"formula.functionList.EXPONDIST.functionParameter.lambda.name",detail:"formula.functionList.EXPONDIST.functionParameter.lambda.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.EXPONDIST.functionParameter.cumulative.name",detail:"formula.functionList.EXPONDIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.FDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.FDIST.description",abstract:"formula.functionList.FDIST.abstract",functionParameter:[{name:"formula.functionList.FDIST.functionParameter.x.name",detail:"formula.functionList.FDIST.functionParameter.x.detail",example:"15.2069",require:1,repeat:0},{name:"formula.functionList.FDIST.functionParameter.degFreedom1.name",detail:"formula.functionList.FDIST.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.FDIST.functionParameter.degFreedom2.name",detail:"formula.functionList.FDIST.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.FINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.FINV.description",abstract:"formula.functionList.FINV.abstract",functionParameter:[{name:"formula.functionList.FINV.functionParameter.probability.name",detail:"formula.functionList.FINV.functionParameter.probability.detail",example:"0.01",require:1,repeat:0},{name:"formula.functionList.FINV.functionParameter.degFreedom1.name",detail:"formula.functionList.FINV.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.FINV.functionParameter.degFreedom2.name",detail:"formula.functionList.FINV.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.FTEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.FTEST.description",abstract:"formula.functionList.FTEST.abstract",functionParameter:[{name:"formula.functionList.FTEST.functionParameter.array1.name",detail:"formula.functionList.FTEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.FTEST.functionParameter.array2.name",detail:"formula.functionList.FTEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.GAMMADIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.GAMMADIST.description",abstract:"formula.functionList.GAMMADIST.abstract",functionParameter:[{name:"formula.functionList.GAMMADIST.functionParameter.x.name",detail:"formula.functionList.GAMMADIST.functionParameter.x.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.GAMMADIST.functionParameter.alpha.name",detail:"formula.functionList.GAMMADIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.GAMMADIST.functionParameter.beta.name",detail:"formula.functionList.GAMMADIST.functionParameter.beta.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.GAMMADIST.functionParameter.cumulative.name",detail:"formula.functionList.GAMMADIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.GAMMAINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.GAMMAINV.description",abstract:"formula.functionList.GAMMAINV.abstract",functionParameter:[{name:"formula.functionList.GAMMAINV.functionParameter.probability.name",detail:"formula.functionList.GAMMAINV.functionParameter.probability.detail",example:"0.068094",require:1,repeat:0},{name:"formula.functionList.GAMMAINV.functionParameter.alpha.name",detail:"formula.functionList.GAMMAINV.functionParameter.alpha.detail",example:"9",require:1,repeat:0},{name:"formula.functionList.GAMMAINV.functionParameter.beta.name",detail:"formula.functionList.GAMMAINV.functionParameter.beta.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.HYPGEOMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.HYPGEOMDIST.description",abstract:"formula.functionList.HYPGEOMDIST.abstract",functionParameter:[{name:"formula.functionList.HYPGEOMDIST.functionParameter.sampleS.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.sampleS.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HYPGEOMDIST.functionParameter.numberSample.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.numberSample.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.HYPGEOMDIST.functionParameter.populationS.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.populationS.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.HYPGEOMDIST.functionParameter.numberPop.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.numberPop.detail",example:"20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.LOGINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.LOGINV.description",abstract:"formula.functionList.LOGINV.abstract",functionParameter:[{name:"formula.functionList.LOGINV.functionParameter.probability.name",detail:"formula.functionList.LOGINV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.LOGINV.functionParameter.mean.name",detail:"formula.functionList.LOGINV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGINV.functionParameter.standardDev.name",detail:"formula.functionList.LOGINV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.LOGNORMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.LOGNORMDIST.description",abstract:"formula.functionList.LOGNORMDIST.abstract",functionParameter:[{name:"formula.functionList.LOGNORMDIST.functionParameter.x.name",detail:"formula.functionList.LOGNORMDIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.LOGNORMDIST.functionParameter.mean.name",detail:"formula.functionList.LOGNORMDIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGNORMDIST.functionParameter.standardDev.name",detail:"formula.functionList.LOGNORMDIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.MODE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.MODE.description",abstract:"formula.functionList.MODE.abstract",functionParameter:[{name:"formula.functionList.MODE.functionParameter.number1.name",detail:"formula.functionList.MODE.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MODE.functionParameter.number2.name",detail:"formula.functionList.MODE.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NEGBINOMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NEGBINOMDIST.description",abstract:"formula.functionList.NEGBINOMDIST.abstract",functionParameter:[{name:"formula.functionList.NEGBINOMDIST.functionParameter.numberF.name",detail:"formula.functionList.NEGBINOMDIST.functionParameter.numberF.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.NEGBINOMDIST.functionParameter.numberS.name",detail:"formula.functionList.NEGBINOMDIST.functionParameter.numberS.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.NEGBINOMDIST.functionParameter.probabilityS.name",detail:"formula.functionList.NEGBINOMDIST.functionParameter.probabilityS.detail",example:"0.25",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMDIST.description",abstract:"formula.functionList.NORMDIST.abstract",functionParameter:[{name:"formula.functionList.NORMDIST.functionParameter.x.name",detail:"formula.functionList.NORMDIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.NORMDIST.functionParameter.mean.name",detail:"formula.functionList.NORMDIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORMDIST.functionParameter.standardDev.name",detail:"formula.functionList.NORMDIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.NORMDIST.functionParameter.cumulative.name",detail:"formula.functionList.NORMDIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMINV.description",abstract:"formula.functionList.NORMINV.abstract",functionParameter:[{name:"formula.functionList.NORMINV.functionParameter.probability.name",detail:"formula.functionList.NORMINV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.NORMINV.functionParameter.mean.name",detail:"formula.functionList.NORMINV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORMINV.functionParameter.standardDev.name",detail:"formula.functionList.NORMINV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMSDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMSDIST.description",abstract:"formula.functionList.NORMSDIST.abstract",functionParameter:[{name:"formula.functionList.NORMSDIST.functionParameter.z.name",detail:"formula.functionList.NORMSDIST.functionParameter.z.detail",example:"1.333333",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMSINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMSINV.description",abstract:"formula.functionList.NORMSINV.abstract",functionParameter:[{name:"formula.functionList.NORMSINV.functionParameter.probability.name",detail:"formula.functionList.NORMSINV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.PERCENTILE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.PERCENTILE.description",abstract:"formula.functionList.PERCENTILE.abstract",functionParameter:[{name:"formula.functionList.PERCENTILE.functionParameter.array.name",detail:"formula.functionList.PERCENTILE.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTILE.functionParameter.k.name",detail:"formula.functionList.PERCENTILE.functionParameter.k.detail",example:"0.3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.PERCENTRANK,functionType:t.FunctionType.Compatibility,description:"formula.functionList.PERCENTRANK.description",abstract:"formula.functionList.PERCENTRANK.abstract",functionParameter:[{name:"formula.functionList.PERCENTRANK.functionParameter.array.name",detail:"formula.functionList.PERCENTRANK.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK.functionParameter.x.name",detail:"formula.functionList.PERCENTRANK.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK.functionParameter.significance.name",detail:"formula.functionList.PERCENTRANK.functionParameter.significance.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.POISSON,functionType:t.FunctionType.Compatibility,description:"formula.functionList.POISSON.description",abstract:"formula.functionList.POISSON.abstract",functionParameter:[{name:"formula.functionList.POISSON.functionParameter.x.name",detail:"formula.functionList.POISSON.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.POISSON.functionParameter.mean.name",detail:"formula.functionList.POISSON.functionParameter.mean.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.POISSON.functionParameter.cumulative.name",detail:"formula.functionList.POISSON.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.QUARTILE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.QUARTILE.description",abstract:"formula.functionList.QUARTILE.abstract",functionParameter:[{name:"formula.functionList.QUARTILE.functionParameter.array.name",detail:"formula.functionList.QUARTILE.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.QUARTILE.functionParameter.quart.name",detail:"formula.functionList.QUARTILE.functionParameter.quart.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.RANK,functionType:t.FunctionType.Compatibility,description:"formula.functionList.RANK.description",abstract:"formula.functionList.RANK.abstract",functionParameter:[{name:"formula.functionList.RANK.functionParameter.number.name",detail:"formula.functionList.RANK.functionParameter.number.detail",example:"A3",require:1,repeat:0},{name:"formula.functionList.RANK.functionParameter.ref.name",detail:"formula.functionList.RANK.functionParameter.ref.detail",example:"A2:A6",require:1,repeat:0},{name:"formula.functionList.RANK.functionParameter.order.name",detail:"formula.functionList.RANK.functionParameter.order.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.STDEV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.STDEV.description",abstract:"formula.functionList.STDEV.abstract",functionParameter:[{name:"formula.functionList.STDEV.functionParameter.number1.name",detail:"formula.functionList.STDEV.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEV.functionParameter.number2.name",detail:"formula.functionList.STDEV.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.STDEVP,functionType:t.FunctionType.Compatibility,description:"formula.functionList.STDEVP.description",abstract:"formula.functionList.STDEVP.abstract",functionParameter:[{name:"formula.functionList.STDEVP.functionParameter.number1.name",detail:"formula.functionList.STDEVP.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEVP.functionParameter.number2.name",detail:"formula.functionList.STDEVP.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.TDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.TDIST.description",abstract:"formula.functionList.TDIST.abstract",functionParameter:[{name:"formula.functionList.TDIST.functionParameter.x.name",detail:"formula.functionList.TDIST.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.TDIST.functionParameter.degFreedom.name",detail:"formula.functionList.TDIST.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.TDIST.functionParameter.tails.name",detail:"formula.functionList.TDIST.functionParameter.tails.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.TINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.TINV.description",abstract:"formula.functionList.TINV.abstract",functionParameter:[{name:"formula.functionList.TINV.functionParameter.probability.name",detail:"formula.functionList.TINV.functionParameter.probability.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.TINV.functionParameter.degFreedom.name",detail:"formula.functionList.TINV.functionParameter.degFreedom.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.TTEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.TTEST.description",abstract:"formula.functionList.TTEST.abstract",functionParameter:[{name:"formula.functionList.TTEST.functionParameter.array1.name",detail:"formula.functionList.TTEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.TTEST.functionParameter.array2.name",detail:"formula.functionList.TTEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.TTEST.functionParameter.tails.name",detail:"formula.functionList.TTEST.functionParameter.tails.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.TTEST.functionParameter.type.name",detail:"formula.functionList.TTEST.functionParameter.type.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.VAR,functionType:t.FunctionType.Compatibility,description:"formula.functionList.VAR.description",abstract:"formula.functionList.VAR.abstract",functionParameter:[{name:"formula.functionList.VAR.functionParameter.number1.name",detail:"formula.functionList.VAR.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VAR.functionParameter.number2.name",detail:"formula.functionList.VAR.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.VARP,functionType:t.FunctionType.Compatibility,description:"formula.functionList.VARP.description",abstract:"formula.functionList.VARP.abstract",functionParameter:[{name:"formula.functionList.VARP.functionParameter.number1.name",detail:"formula.functionList.VARP.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VARP.functionParameter.number2.name",detail:"formula.functionList.VARP.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.WEIBULL,functionType:t.FunctionType.Compatibility,description:"formula.functionList.WEIBULL.description",abstract:"formula.functionList.WEIBULL.abstract",functionParameter:[{name:"formula.functionList.WEIBULL.functionParameter.x.name",detail:"formula.functionList.WEIBULL.functionParameter.x.detail",example:"105",require:1,repeat:0},{name:"formula.functionList.WEIBULL.functionParameter.alpha.name",detail:"formula.functionList.WEIBULL.functionParameter.alpha.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.WEIBULL.functionParameter.beta.name",detail:"formula.functionList.WEIBULL.functionParameter.beta.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.WEIBULL.functionParameter.cumulative.name",detail:"formula.functionList.WEIBULL.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.ZTEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.ZTEST.description",abstract:"formula.functionList.ZTEST.abstract",functionParameter:[{name:"formula.functionList.ZTEST.functionParameter.array.name",detail:"formula.functionList.ZTEST.functionParameter.array.detail",example:"A2:A11",require:1,repeat:0},{name:"formula.functionList.ZTEST.functionParameter.x.name",detail:"formula.functionList.ZTEST.functionParameter.x.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.ZTEST.functionParameter.sigma.name",detail:"formula.functionList.ZTEST.functionParameter.sigma.detail",example:"10",require:0,repeat:0}]}],ve=[{functionName:t.FUNCTION_NAMES_CUBE.CUBEKPIMEMBER,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEKPIMEMBER.description",abstract:"formula.functionList.CUBEKPIMEMBER.abstract",functionParameter:[{name:"formula.functionList.CUBEKPIMEMBER.functionParameter.number1.name",detail:"formula.functionList.CUBEKPIMEMBER.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEKPIMEMBER.functionParameter.number2.name",detail:"formula.functionList.CUBEKPIMEMBER.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBEMEMBER,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEMEMBER.description",abstract:"formula.functionList.CUBEMEMBER.abstract",functionParameter:[{name:"formula.functionList.CUBEMEMBER.functionParameter.number1.name",detail:"formula.functionList.CUBEMEMBER.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEMEMBER.functionParameter.number2.name",detail:"formula.functionList.CUBEMEMBER.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBEMEMBERPROPERTY,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEMEMBERPROPERTY.description",abstract:"formula.functionList.CUBEMEMBERPROPERTY.abstract",functionParameter:[{name:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number1.name",detail:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number2.name",detail:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBERANKEDMEMBER,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBERANKEDMEMBER.description",abstract:"formula.functionList.CUBERANKEDMEMBER.abstract",functionParameter:[{name:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number1.name",detail:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number2.name",detail:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBESET,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBESET.description",abstract:"formula.functionList.CUBESET.abstract",functionParameter:[{name:"formula.functionList.CUBESET.functionParameter.number1.name",detail:"formula.functionList.CUBESET.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBESET.functionParameter.number2.name",detail:"formula.functionList.CUBESET.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBESETCOUNT,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBESETCOUNT.description",abstract:"formula.functionList.CUBESETCOUNT.abstract",functionParameter:[{name:"formula.functionList.CUBESETCOUNT.functionParameter.number1.name",detail:"formula.functionList.CUBESETCOUNT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBESETCOUNT.functionParameter.number2.name",detail:"formula.functionList.CUBESETCOUNT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBEVALUE,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEVALUE.description",abstract:"formula.functionList.CUBEVALUE.abstract",functionParameter:[{name:"formula.functionList.CUBEVALUE.functionParameter.number1.name",detail:"formula.functionList.CUBEVALUE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEVALUE.functionParameter.number2.name",detail:"formula.functionList.CUBEVALUE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]}],Ve=[{functionName:t.FUNCTION_NAMES_DATABASE.DAVERAGE,functionType:t.FunctionType.Database,description:"formula.functionList.DAVERAGE.description",abstract:"formula.functionList.DAVERAGE.abstract",functionParameter:[{name:"formula.functionList.DAVERAGE.functionParameter.database.name",detail:"formula.functionList.DAVERAGE.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DAVERAGE.functionParameter.field.name",detail:"formula.functionList.DAVERAGE.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DAVERAGE.functionParameter.criteria.name",detail:"formula.functionList.DAVERAGE.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DCOUNT,functionType:t.FunctionType.Database,description:"formula.functionList.DCOUNT.description",abstract:"formula.functionList.DCOUNT.abstract",functionParameter:[{name:"formula.functionList.DCOUNT.functionParameter.database.name",detail:"formula.functionList.DCOUNT.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DCOUNT.functionParameter.field.name",detail:"formula.functionList.DCOUNT.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DCOUNT.functionParameter.criteria.name",detail:"formula.functionList.DCOUNT.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DCOUNTA,functionType:t.FunctionType.Database,description:"formula.functionList.DCOUNTA.description",abstract:"formula.functionList.DCOUNTA.abstract",functionParameter:[{name:"formula.functionList.DCOUNTA.functionParameter.database.name",detail:"formula.functionList.DCOUNTA.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DCOUNTA.functionParameter.field.name",detail:"formula.functionList.DCOUNTA.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DCOUNTA.functionParameter.criteria.name",detail:"formula.functionList.DCOUNTA.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DGET,functionType:t.FunctionType.Database,description:"formula.functionList.DGET.description",abstract:"formula.functionList.DGET.abstract",functionParameter:[{name:"formula.functionList.DGET.functionParameter.database.name",detail:"formula.functionList.DGET.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DGET.functionParameter.field.name",detail:"formula.functionList.DGET.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DGET.functionParameter.criteria.name",detail:"formula.functionList.DGET.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DMAX,functionType:t.FunctionType.Database,description:"formula.functionList.DMAX.description",abstract:"formula.functionList.DMAX.abstract",functionParameter:[{name:"formula.functionList.DMAX.functionParameter.database.name",detail:"formula.functionList.DMAX.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DMAX.functionParameter.field.name",detail:"formula.functionList.DMAX.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DMAX.functionParameter.criteria.name",detail:"formula.functionList.DMAX.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DMIN,functionType:t.FunctionType.Database,description:"formula.functionList.DMIN.description",abstract:"formula.functionList.DMIN.abstract",functionParameter:[{name:"formula.functionList.DMIN.functionParameter.database.name",detail:"formula.functionList.DMIN.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DMIN.functionParameter.field.name",detail:"formula.functionList.DMIN.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DMIN.functionParameter.criteria.name",detail:"formula.functionList.DMIN.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DPRODUCT,functionType:t.FunctionType.Database,description:"formula.functionList.DPRODUCT.description",abstract:"formula.functionList.DPRODUCT.abstract",functionParameter:[{name:"formula.functionList.DPRODUCT.functionParameter.database.name",detail:"formula.functionList.DPRODUCT.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DPRODUCT.functionParameter.field.name",detail:"formula.functionList.DPRODUCT.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DPRODUCT.functionParameter.criteria.name",detail:"formula.functionList.DPRODUCT.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DSTDEV,functionType:t.FunctionType.Database,description:"formula.functionList.DSTDEV.description",abstract:"formula.functionList.DSTDEV.abstract",functionParameter:[{name:"formula.functionList.DSTDEV.functionParameter.database.name",detail:"formula.functionList.DSTDEV.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DSTDEV.functionParameter.field.name",detail:"formula.functionList.DSTDEV.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DSTDEV.functionParameter.criteria.name",detail:"formula.functionList.DSTDEV.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DSTDEVP,functionType:t.FunctionType.Database,description:"formula.functionList.DSTDEVP.description",abstract:"formula.functionList.DSTDEVP.abstract",functionParameter:[{name:"formula.functionList.DSTDEVP.functionParameter.database.name",detail:"formula.functionList.DSTDEVP.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DSTDEVP.functionParameter.field.name",detail:"formula.functionList.DSTDEVP.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DSTDEVP.functionParameter.criteria.name",detail:"formula.functionList.DSTDEVP.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DSUM,functionType:t.FunctionType.Database,description:"formula.functionList.DSUM.description",abstract:"formula.functionList.DSUM.abstract",functionParameter:[{name:"formula.functionList.DSUM.functionParameter.database.name",detail:"formula.functionList.DSUM.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DSUM.functionParameter.field.name",detail:"formula.functionList.DSUM.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DSUM.functionParameter.criteria.name",detail:"formula.functionList.DSUM.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DVAR,functionType:t.FunctionType.Database,description:"formula.functionList.DVAR.description",abstract:"formula.functionList.DVAR.abstract",functionParameter:[{name:"formula.functionList.DVAR.functionParameter.database.name",detail:"formula.functionList.DVAR.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DVAR.functionParameter.field.name",detail:"formula.functionList.DVAR.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DVAR.functionParameter.criteria.name",detail:"formula.functionList.DVAR.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DVARP,functionType:t.FunctionType.Database,description:"formula.functionList.DVARP.description",abstract:"formula.functionList.DVARP.abstract",functionParameter:[{name:"formula.functionList.DVARP.functionParameter.database.name",detail:"formula.functionList.DVARP.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DVARP.functionParameter.field.name",detail:"formula.functionList.DVARP.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DVARP.functionParameter.criteria.name",detail:"formula.functionList.DVARP.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]}],Ge=[{functionName:t.FUNCTION_NAMES_DATE.DATE,functionType:t.FunctionType.Date,description:"formula.functionList.DATE.description",abstract:"formula.functionList.DATE.abstract",functionParameter:[{name:"formula.functionList.DATE.functionParameter.year.name",detail:"formula.functionList.DATE.functionParameter.year.detail",example:"2024",require:1,repeat:0},{name:"formula.functionList.DATE.functionParameter.month.name",detail:"formula.functionList.DATE.functionParameter.month.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DATE.functionParameter.day.name",detail:"formula.functionList.DATE.functionParameter.day.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DATEDIF,functionType:t.FunctionType.Date,description:"formula.functionList.DATEDIF.description",abstract:"formula.functionList.DATEDIF.abstract",functionParameter:[{name:"formula.functionList.DATEDIF.functionParameter.startDate.name",detail:"formula.functionList.DATEDIF.functionParameter.startDate.detail",example:'"2001-6-1"',require:1,repeat:0},{name:"formula.functionList.DATEDIF.functionParameter.endDate.name",detail:"formula.functionList.DATEDIF.functionParameter.endDate.detail",example:'"2002-8-15"',require:1,repeat:0},{name:"formula.functionList.DATEDIF.functionParameter.method.name",detail:"formula.functionList.DATEDIF.functionParameter.method.detail",example:'"D"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DATEVALUE,functionType:t.FunctionType.Date,description:"formula.functionList.DATEVALUE.description",abstract:"formula.functionList.DATEVALUE.abstract",functionParameter:[{name:"formula.functionList.DATEVALUE.functionParameter.dateText.name",detail:"formula.functionList.DATEVALUE.functionParameter.dateText.detail",example:'"2024-8-8"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DAY,functionType:t.FunctionType.Date,description:"formula.functionList.DAY.description",abstract:"formula.functionList.DAY.abstract",functionParameter:[{name:"formula.functionList.DAY.functionParameter.serialNumber.name",detail:"formula.functionList.DAY.functionParameter.serialNumber.detail",example:'"1969-7-20"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DAYS,functionType:t.FunctionType.Date,description:"formula.functionList.DAYS.description",abstract:"formula.functionList.DAYS.abstract",functionParameter:[{name:"formula.functionList.DAYS.functionParameter.endDate.name",detail:"formula.functionList.DAYS.functionParameter.endDate.detail",example:'"2021-12-31"',require:1,repeat:0},{name:"formula.functionList.DAYS.functionParameter.startDate.name",detail:"formula.functionList.DAYS.functionParameter.startDate.detail",example:'"2021-1-1"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DAYS360,functionType:t.FunctionType.Date,description:"formula.functionList.DAYS360.description",abstract:"formula.functionList.DAYS360.abstract",functionParameter:[{name:"formula.functionList.DAYS360.functionParameter.startDate.name",detail:"formula.functionList.DAYS360.functionParameter.startDate.detail",example:'"2021-1-29"',require:1,repeat:0},{name:"formula.functionList.DAYS360.functionParameter.endDate.name",detail:"formula.functionList.DAYS360.functionParameter.endDate.detail",example:'"2021-3-31"',require:1,repeat:0},{name:"formula.functionList.DAYS360.functionParameter.method.name",detail:"formula.functionList.DAYS360.functionParameter.method.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.EDATE,functionType:t.FunctionType.Date,description:"formula.functionList.EDATE.description",abstract:"formula.functionList.EDATE.abstract",functionParameter:[{name:"formula.functionList.EDATE.functionParameter.startDate.name",detail:"formula.functionList.EDATE.functionParameter.startDate.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.EDATE.functionParameter.months.name",detail:"formula.functionList.EDATE.functionParameter.months.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.EOMONTH,functionType:t.FunctionType.Date,description:"formula.functionList.EOMONTH.description",abstract:"formula.functionList.EOMONTH.abstract",functionParameter:[{name:"formula.functionList.EOMONTH.functionParameter.startDate.name",detail:"formula.functionList.EOMONTH.functionParameter.startDate.detail",example:'"2011-1-1"',require:1,repeat:0},{name:"formula.functionList.EOMONTH.functionParameter.months.name",detail:"formula.functionList.EOMONTH.functionParameter.months.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.EPOCHTODATE,functionType:t.FunctionType.Date,description:"formula.functionList.EPOCHTODATE.description",abstract:"formula.functionList.EPOCHTODATE.abstract",functionParameter:[{name:"formula.functionList.EPOCHTODATE.functionParameter.timestamp.name",detail:"formula.functionList.EPOCHTODATE.functionParameter.timestamp.detail",example:"1655906710",require:1,repeat:0},{name:"formula.functionList.EPOCHTODATE.functionParameter.unit.name",detail:"formula.functionList.EPOCHTODATE.functionParameter.unit.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.HOUR,functionType:t.FunctionType.Date,description:"formula.functionList.HOUR.description",abstract:"formula.functionList.HOUR.abstract",functionParameter:[{name:"formula.functionList.HOUR.functionParameter.serialNumber.name",detail:"formula.functionList.HOUR.functionParameter.serialNumber.detail",example:'"2011-7-18 7:45"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.ISOWEEKNUM,functionType:t.FunctionType.Date,description:"formula.functionList.ISOWEEKNUM.description",abstract:"formula.functionList.ISOWEEKNUM.abstract",functionParameter:[{name:"formula.functionList.ISOWEEKNUM.functionParameter.date.name",detail:"formula.functionList.ISOWEEKNUM.functionParameter.date.detail",example:'"2012-3-9"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.MINUTE,functionType:t.FunctionType.Date,description:"formula.functionList.MINUTE.description",abstract:"formula.functionList.MINUTE.abstract",functionParameter:[{name:"formula.functionList.MINUTE.functionParameter.serialNumber.name",detail:"formula.functionList.MINUTE.functionParameter.serialNumber.detail",example:'"12:45"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.MONTH,functionType:t.FunctionType.Date,description:"formula.functionList.MONTH.description",abstract:"formula.functionList.MONTH.abstract",functionParameter:[{name:"formula.functionList.MONTH.functionParameter.serialNumber.name",detail:"formula.functionList.MONTH.functionParameter.serialNumber.detail",example:'"1969-7-20"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.NETWORKDAYS,functionType:t.FunctionType.Date,description:"formula.functionList.NETWORKDAYS.description",abstract:"formula.functionList.NETWORKDAYS.abstract",functionParameter:[{name:"formula.functionList.NETWORKDAYS.functionParameter.startDate.name",detail:"formula.functionList.NETWORKDAYS.functionParameter.startDate.detail",example:'"2012-10-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS.functionParameter.endDate.name",detail:"formula.functionList.NETWORKDAYS.functionParameter.endDate.detail",example:'"2013-3-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS.functionParameter.holidays.name",detail:"formula.functionList.NETWORKDAYS.functionParameter.holidays.detail",example:'"2012-11-22"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.NETWORKDAYS_INTL,functionType:t.FunctionType.Date,description:"formula.functionList.NETWORKDAYS_INTL.description",abstract:"formula.functionList.NETWORKDAYS_INTL.abstract",functionParameter:[{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.startDate.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.startDate.detail",example:'"2012-10-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.endDate.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.endDate.detail",example:'"2013-3-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.weekend.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.weekend.detail",example:"6",require:0,repeat:0},{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.holidays.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.holidays.detail",example:'"2012-11-22"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.NOW,functionType:t.FunctionType.Date,description:"formula.functionList.NOW.description",abstract:"formula.functionList.NOW.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_DATE.SECOND,functionType:t.FunctionType.Date,description:"formula.functionList.SECOND.description",abstract:"formula.functionList.SECOND.abstract",functionParameter:[{name:"formula.functionList.SECOND.functionParameter.serialNumber.name",detail:"formula.functionList.SECOND.functionParameter.serialNumber.detail",example:'"4:48:18"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TIME,functionType:t.FunctionType.Date,description:"formula.functionList.TIME.description",abstract:"formula.functionList.TIME.abstract",functionParameter:[{name:"formula.functionList.TIME.functionParameter.hour.name",detail:"formula.functionList.TIME.functionParameter.hour.detail",example:"15",require:1,repeat:0},{name:"formula.functionList.TIME.functionParameter.minute.name",detail:"formula.functionList.TIME.functionParameter.minute.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.TIME.functionParameter.second.name",detail:"formula.functionList.TIME.functionParameter.second.detail",example:"59",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TIMEVALUE,functionType:t.FunctionType.Date,description:"formula.functionList.TIMEVALUE.description",abstract:"formula.functionList.TIMEVALUE.abstract",functionParameter:[{name:"formula.functionList.TIMEVALUE.functionParameter.timeText.name",detail:"formula.functionList.TIMEVALUE.functionParameter.timeText.detail",example:'"15:20:59"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TO_DATE,functionType:t.FunctionType.Date,description:"formula.functionList.TO_DATE.description",abstract:"formula.functionList.TO_DATE.abstract",functionParameter:[{name:"formula.functionList.TO_DATE.functionParameter.value.name",detail:"formula.functionList.TO_DATE.functionParameter.value.detail",example:"40826.4375",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TODAY,functionType:t.FunctionType.Date,description:"formula.functionList.TODAY.description",abstract:"formula.functionList.TODAY.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_DATE.WEEKDAY,functionType:t.FunctionType.Date,description:"formula.functionList.WEEKDAY.description",abstract:"formula.functionList.WEEKDAY.abstract",functionParameter:[{name:"formula.functionList.WEEKDAY.functionParameter.serialNumber.name",detail:"formula.functionList.WEEKDAY.functionParameter.serialNumber.detail",example:'"2008-2-14"',require:1,repeat:0},{name:"formula.functionList.WEEKDAY.functionParameter.returnType.name",detail:"formula.functionList.WEEKDAY.functionParameter.returnType.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.WEEKNUM,functionType:t.FunctionType.Date,description:"formula.functionList.WEEKNUM.description",abstract:"formula.functionList.WEEKNUM.abstract",functionParameter:[{name:"formula.functionList.WEEKNUM.functionParameter.serialNumber.name",detail:"formula.functionList.WEEKNUM.functionParameter.serialNumber.detail",example:'"2012-3-9"',require:1,repeat:0},{name:"formula.functionList.WEEKNUM.functionParameter.returnType.name",detail:"formula.functionList.WEEKNUM.functionParameter.returnType.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.WORKDAY,functionType:t.FunctionType.Date,description:"formula.functionList.WORKDAY.description",abstract:"formula.functionList.WORKDAY.abstract",functionParameter:[{name:"formula.functionList.WORKDAY.functionParameter.startDate.name",detail:"formula.functionList.WORKDAY.functionParameter.startDate.detail",example:'"2008-10-1"',require:1,repeat:0},{name:"formula.functionList.WORKDAY.functionParameter.days.name",detail:"formula.functionList.WORKDAY.functionParameter.days.detail",example:"151",require:1,repeat:0},{name:"formula.functionList.WORKDAY.functionParameter.holidays.name",detail:"formula.functionList.WORKDAY.functionParameter.holidays.detail",example:'"2008-11-26"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.WORKDAY_INTL,functionType:t.FunctionType.Date,description:"formula.functionList.WORKDAY_INTL.description",abstract:"formula.functionList.WORKDAY_INTL.abstract",functionParameter:[{name:"formula.functionList.WORKDAY_INTL.functionParameter.startDate.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.startDate.detail",example:'"2008-10-1"',require:1,repeat:0},{name:"formula.functionList.WORKDAY_INTL.functionParameter.days.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.days.detail",example:"151",require:1,repeat:0},{name:"formula.functionList.WORKDAY_INTL.functionParameter.weekend.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.weekend.detail",example:"6",require:0,repeat:0},{name:"formula.functionList.WORKDAY_INTL.functionParameter.holidays.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.holidays.detail",example:'"2008-11-26"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.YEAR,functionType:t.FunctionType.Date,description:"formula.functionList.YEAR.description",abstract:"formula.functionList.YEAR.abstract",functionParameter:[{name:"formula.functionList.YEAR.functionParameter.serialNumber.name",detail:"formula.functionList.YEAR.functionParameter.serialNumber.detail",example:'"1969-7-20"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.YEARFRAC,functionType:t.FunctionType.Date,description:"formula.functionList.YEARFRAC.description",abstract:"formula.functionList.YEARFRAC.abstract",functionParameter:[{name:"formula.functionList.YEARFRAC.functionParameter.startDate.name",detail:"formula.functionList.YEARFRAC.functionParameter.startDate.detail",example:'"2012-1-1"',require:1,repeat:0},{name:"formula.functionList.YEARFRAC.functionParameter.endDate.name",detail:"formula.functionList.YEARFRAC.functionParameter.endDate.detail",example:'"2012-7-30"',require:1,repeat:0},{name:"formula.functionList.YEARFRAC.functionParameter.basis.name",detail:"formula.functionList.YEARFRAC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]}],He=[{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELI,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELI.description",abstract:"formula.functionList.BESSELI.abstract",functionParameter:[{name:"formula.functionList.BESSELI.functionParameter.x.name",detail:"formula.functionList.BESSELI.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELI.functionParameter.n.name",detail:"formula.functionList.BESSELI.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELJ,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELJ.description",abstract:"formula.functionList.BESSELJ.abstract",functionParameter:[{name:"formula.functionList.BESSELJ.functionParameter.x.name",detail:"formula.functionList.BESSELJ.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELJ.functionParameter.n.name",detail:"formula.functionList.BESSELJ.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELK,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELK.description",abstract:"formula.functionList.BESSELK.abstract",functionParameter:[{name:"formula.functionList.BESSELK.functionParameter.x.name",detail:"formula.functionList.BESSELK.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELK.functionParameter.n.name",detail:"formula.functionList.BESSELK.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELY,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELY.description",abstract:"formula.functionList.BESSELY.abstract",functionParameter:[{name:"formula.functionList.BESSELY.functionParameter.x.name",detail:"formula.functionList.BESSELY.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELY.functionParameter.n.name",detail:"formula.functionList.BESSELY.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BIN2DEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.BIN2DEC.description",abstract:"formula.functionList.BIN2DEC.abstract",functionParameter:[{name:"formula.functionList.BIN2DEC.functionParameter.number.name",detail:"formula.functionList.BIN2DEC.functionParameter.number.detail",example:"1100100",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BIN2HEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.BIN2HEX.description",abstract:"formula.functionList.BIN2HEX.abstract",functionParameter:[{name:"formula.functionList.BIN2HEX.functionParameter.number.name",detail:"formula.functionList.BIN2HEX.functionParameter.number.detail",example:"11111011",require:1,repeat:0},{name:"formula.functionList.BIN2HEX.functionParameter.places.name",detail:"formula.functionList.BIN2HEX.functionParameter.places.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BIN2OCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.BIN2OCT.description",abstract:"formula.functionList.BIN2OCT.abstract",functionParameter:[{name:"formula.functionList.BIN2OCT.functionParameter.number.name",detail:"formula.functionList.BIN2OCT.functionParameter.number.detail",example:"1001",require:1,repeat:0},{name:"formula.functionList.BIN2OCT.functionParameter.places.name",detail:"formula.functionList.BIN2OCT.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITAND,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITAND.description",abstract:"formula.functionList.BITAND.abstract",functionParameter:[{name:"formula.functionList.BITAND.functionParameter.number1.name",detail:"formula.functionList.BITAND.functionParameter.number1.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.BITAND.functionParameter.number2.name",detail:"formula.functionList.BITAND.functionParameter.number2.detail",example:"25",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITLSHIFT,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITLSHIFT.description",abstract:"formula.functionList.BITLSHIFT.abstract",functionParameter:[{name:"formula.functionList.BITLSHIFT.functionParameter.number.name",detail:"formula.functionList.BITLSHIFT.functionParameter.number.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.BITLSHIFT.functionParameter.shiftAmount.name",detail:"formula.functionList.BITLSHIFT.functionParameter.shiftAmount.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITOR,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITOR.description",abstract:"formula.functionList.BITOR.abstract",functionParameter:[{name:"formula.functionList.BITOR.functionParameter.number1.name",detail:"formula.functionList.BITOR.functionParameter.number1.detail",example:"23",require:1,repeat:0},{name:"formula.functionList.BITOR.functionParameter.number2.name",detail:"formula.functionList.BITOR.functionParameter.number2.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITRSHIFT,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITRSHIFT.description",abstract:"formula.functionList.BITRSHIFT.abstract",functionParameter:[{name:"formula.functionList.BITRSHIFT.functionParameter.number.name",detail:"formula.functionList.BITRSHIFT.functionParameter.number.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.BITRSHIFT.functionParameter.shiftAmount.name",detail:"formula.functionList.BITRSHIFT.functionParameter.shiftAmount.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITXOR,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITXOR.description",abstract:"formula.functionList.BITXOR.abstract",functionParameter:[{name:"formula.functionList.BITXOR.functionParameter.number1.name",detail:"formula.functionList.BITXOR.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.BITXOR.functionParameter.number2.name",detail:"formula.functionList.BITXOR.functionParameter.number2.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.COMPLEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.COMPLEX.description",abstract:"formula.functionList.COMPLEX.abstract",functionParameter:[{name:"formula.functionList.COMPLEX.functionParameter.realNum.name",detail:"formula.functionList.COMPLEX.functionParameter.realNum.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.COMPLEX.functionParameter.iNum.name",detail:"formula.functionList.COMPLEX.functionParameter.iNum.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.COMPLEX.functionParameter.suffix.name",detail:"formula.functionList.COMPLEX.functionParameter.suffix.detail",example:'"i"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.CONVERT,functionType:t.FunctionType.Engineering,description:"formula.functionList.CONVERT.description",abstract:"formula.functionList.CONVERT.abstract",functionParameter:[{name:"formula.functionList.CONVERT.functionParameter.number.name",detail:"formula.functionList.CONVERT.functionParameter.number.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CONVERT.functionParameter.fromUnit.name",detail:"formula.functionList.CONVERT.functionParameter.fromUnit.detail",example:'"lbm"',require:1,repeat:0},{name:"formula.functionList.CONVERT.functionParameter.toUnit.name",detail:"formula.functionList.CONVERT.functionParameter.toUnit.detail",example:'"kg"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DEC2BIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.DEC2BIN.description",abstract:"formula.functionList.DEC2BIN.abstract",functionParameter:[{name:"formula.functionList.DEC2BIN.functionParameter.number.name",detail:"formula.functionList.DEC2BIN.functionParameter.number.detail",example:"9",require:1,repeat:0},{name:"formula.functionList.DEC2BIN.functionParameter.places.name",detail:"formula.functionList.DEC2BIN.functionParameter.places.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DEC2HEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.DEC2HEX.description",abstract:"formula.functionList.DEC2HEX.abstract",functionParameter:[{name:"formula.functionList.DEC2HEX.functionParameter.number.name",detail:"formula.functionList.DEC2HEX.functionParameter.number.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.DEC2HEX.functionParameter.places.name",detail:"formula.functionList.DEC2HEX.functionParameter.places.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DEC2OCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.DEC2OCT.description",abstract:"formula.functionList.DEC2OCT.abstract",functionParameter:[{name:"formula.functionList.DEC2OCT.functionParameter.number.name",detail:"formula.functionList.DEC2OCT.functionParameter.number.detail",example:"58",require:1,repeat:0},{name:"formula.functionList.DEC2OCT.functionParameter.places.name",detail:"formula.functionList.DEC2OCT.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DELTA,functionType:t.FunctionType.Engineering,description:"formula.functionList.DELTA.description",abstract:"formula.functionList.DELTA.abstract",functionParameter:[{name:"formula.functionList.DELTA.functionParameter.number1.name",detail:"formula.functionList.DELTA.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.DELTA.functionParameter.number2.name",detail:"formula.functionList.DELTA.functionParameter.number2.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERF,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERF.description",abstract:"formula.functionList.ERF.abstract",functionParameter:[{name:"formula.functionList.ERF.functionParameter.lowerLimit.name",detail:"formula.functionList.ERF.functionParameter.lowerLimit.detail",example:"0.745",require:1,repeat:0},{name:"formula.functionList.ERF.functionParameter.upperLimit.name",detail:"formula.functionList.ERF.functionParameter.upperLimit.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERF_PRECISE,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERF_PRECISE.description",abstract:"formula.functionList.ERF_PRECISE.abstract",functionParameter:[{name:"formula.functionList.ERF_PRECISE.functionParameter.x.name",detail:"formula.functionList.ERF_PRECISE.functionParameter.x.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERFC,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERFC.description",abstract:"formula.functionList.ERFC.abstract",functionParameter:[{name:"formula.functionList.ERFC.functionParameter.x.name",detail:"formula.functionList.ERFC.functionParameter.x.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERFC_PRECISE,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERFC_PRECISE.description",abstract:"formula.functionList.ERFC_PRECISE.abstract",functionParameter:[{name:"formula.functionList.ERFC_PRECISE.functionParameter.x.name",detail:"formula.functionList.ERFC_PRECISE.functionParameter.x.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.GESTEP,functionType:t.FunctionType.Engineering,description:"formula.functionList.GESTEP.description",abstract:"formula.functionList.GESTEP.abstract",functionParameter:[{name:"formula.functionList.GESTEP.functionParameter.number.name",detail:"formula.functionList.GESTEP.functionParameter.number.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.GESTEP.functionParameter.step.name",detail:"formula.functionList.GESTEP.functionParameter.step.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.HEX2BIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.HEX2BIN.description",abstract:"formula.functionList.HEX2BIN.abstract",functionParameter:[{name:"formula.functionList.HEX2BIN.functionParameter.number.name",detail:"formula.functionList.HEX2BIN.functionParameter.number.detail",example:'"F"',require:1,repeat:0},{name:"formula.functionList.HEX2BIN.functionParameter.places.name",detail:"formula.functionList.HEX2BIN.functionParameter.places.detail",example:"8",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.HEX2DEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.HEX2DEC.description",abstract:"formula.functionList.HEX2DEC.abstract",functionParameter:[{name:"formula.functionList.HEX2DEC.functionParameter.number.name",detail:"formula.functionList.HEX2DEC.functionParameter.number.detail",example:'"A5"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.HEX2OCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.HEX2OCT.description",abstract:"formula.functionList.HEX2OCT.abstract",functionParameter:[{name:"formula.functionList.HEX2OCT.functionParameter.number.name",detail:"formula.functionList.HEX2OCT.functionParameter.number.detail",example:'"F"',require:1,repeat:0},{name:"formula.functionList.HEX2OCT.functionParameter.places.name",detail:"formula.functionList.HEX2OCT.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMABS,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMABS.description",abstract:"formula.functionList.IMABS.abstract",functionParameter:[{name:"formula.functionList.IMABS.functionParameter.inumber.name",detail:"formula.functionList.IMABS.functionParameter.inumber.detail",example:'"5+12i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMAGINARY,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMAGINARY.description",abstract:"formula.functionList.IMAGINARY.abstract",functionParameter:[{name:"formula.functionList.IMAGINARY.functionParameter.inumber.name",detail:"formula.functionList.IMAGINARY.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMARGUMENT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMARGUMENT.description",abstract:"formula.functionList.IMARGUMENT.abstract",functionParameter:[{name:"formula.functionList.IMARGUMENT.functionParameter.inumber.name",detail:"formula.functionList.IMARGUMENT.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCONJUGATE,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCONJUGATE.description",abstract:"formula.functionList.IMCONJUGATE.abstract",functionParameter:[{name:"formula.functionList.IMCONJUGATE.functionParameter.inumber.name",detail:"formula.functionList.IMCONJUGATE.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOS,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOS.description",abstract:"formula.functionList.IMCOS.abstract",functionParameter:[{name:"formula.functionList.IMCOS.functionParameter.inumber.name",detail:"formula.functionList.IMCOS.functionParameter.inumber.detail",example:'"1+i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOSH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOSH.description",abstract:"formula.functionList.IMCOSH.abstract",functionParameter:[{name:"formula.functionList.IMCOSH.functionParameter.inumber.name",detail:"formula.functionList.IMCOSH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOT.description",abstract:"formula.functionList.IMCOT.abstract",functionParameter:[{name:"formula.functionList.IMCOT.functionParameter.inumber.name",detail:"formula.functionList.IMCOT.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOTH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOTH.description",abstract:"formula.functionList.IMCOTH.abstract",functionParameter:[{name:"formula.functionList.IMCOTH.functionParameter.inumber.name",detail:"formula.functionList.IMCOTH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCSC,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCSC.description",abstract:"formula.functionList.IMCSC.abstract",functionParameter:[{name:"formula.functionList.IMCSC.functionParameter.inumber.name",detail:"formula.functionList.IMCSC.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCSCH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCSCH.description",abstract:"formula.functionList.IMCSCH.abstract",functionParameter:[{name:"formula.functionList.IMCSCH.functionParameter.inumber.name",detail:"formula.functionList.IMCSCH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMDIV,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMDIV.description",abstract:"formula.functionList.IMDIV.abstract",functionParameter:[{name:"formula.functionList.IMDIV.functionParameter.inumber1.name",detail:"formula.functionList.IMDIV.functionParameter.inumber1.detail",example:'"-238+240i"',require:1,repeat:0},{name:"formula.functionList.IMDIV.functionParameter.inumber2.name",detail:"formula.functionList.IMDIV.functionParameter.inumber2.detail",example:'"10+24i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMEXP,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMEXP.description",abstract:"formula.functionList.IMEXP.abstract",functionParameter:[{name:"formula.functionList.IMEXP.functionParameter.inumber.name",detail:"formula.functionList.IMEXP.functionParameter.inumber.detail",example:'"1+i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLN,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLN.description",abstract:"formula.functionList.IMLN.abstract",functionParameter:[{name:"formula.functionList.IMLN.functionParameter.inumber.name",detail:"formula.functionList.IMLN.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLOG,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLOG.description",abstract:"formula.functionList.IMLOG.abstract",functionParameter:[{name:"formula.functionList.IMLOG.functionParameter.inumber.name",detail:"formula.functionList.IMLOG.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0},{name:"formula.functionList.IMLOG.functionParameter.base.name",detail:"formula.functionList.IMLOG.functionParameter.base.detail",example:"10",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLOG10,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLOG10.description",abstract:"formula.functionList.IMLOG10.abstract",functionParameter:[{name:"formula.functionList.IMLOG10.functionParameter.inumber.name",detail:"formula.functionList.IMLOG10.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLOG2,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLOG2.description",abstract:"formula.functionList.IMLOG2.abstract",functionParameter:[{name:"formula.functionList.IMLOG2.functionParameter.inumber.name",detail:"formula.functionList.IMLOG2.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMPOWER,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMPOWER.description",abstract:"formula.functionList.IMPOWER.abstract",functionParameter:[{name:"formula.functionList.IMPOWER.functionParameter.inumber.name",detail:"formula.functionList.IMPOWER.functionParameter.inumber.detail",example:'"2+3i"',require:1,repeat:0},{name:"formula.functionList.IMPOWER.functionParameter.number.name",detail:"formula.functionList.IMPOWER.functionParameter.number.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMPRODUCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMPRODUCT.description",abstract:"formula.functionList.IMPRODUCT.abstract",functionParameter:[{name:"formula.functionList.IMPRODUCT.functionParameter.inumber1.name",detail:"formula.functionList.IMPRODUCT.functionParameter.inumber1.detail",example:'"3+4i"',require:1,repeat:0},{name:"formula.functionList.IMPRODUCT.functionParameter.inumber2.name",detail:"formula.functionList.IMPRODUCT.functionParameter.inumber2.detail",example:'"5-3i"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMREAL,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMREAL.description",abstract:"formula.functionList.IMREAL.abstract",functionParameter:[{name:"formula.functionList.IMREAL.functionParameter.inumber.name",detail:"formula.functionList.IMREAL.functionParameter.inumber.detail",example:'"6-9i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSEC.description",abstract:"formula.functionList.IMSEC.abstract",functionParameter:[{name:"formula.functionList.IMSEC.functionParameter.inumber.name",detail:"formula.functionList.IMSEC.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSECH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSECH.description",abstract:"formula.functionList.IMSECH.abstract",functionParameter:[{name:"formula.functionList.IMSECH.functionParameter.inumber.name",detail:"formula.functionList.IMSECH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSIN.description",abstract:"formula.functionList.IMSIN.abstract",functionParameter:[{name:"formula.functionList.IMSIN.functionParameter.inumber.name",detail:"formula.functionList.IMSIN.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSINH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSINH.description",abstract:"formula.functionList.IMSINH.abstract",functionParameter:[{name:"formula.functionList.IMSINH.functionParameter.inumber.name",detail:"formula.functionList.IMSINH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSQRT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSQRT.description",abstract:"formula.functionList.IMSQRT.abstract",functionParameter:[{name:"formula.functionList.IMSQRT.functionParameter.inumber.name",detail:"formula.functionList.IMSQRT.functionParameter.inumber.detail",example:'"1+i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSUB,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSUB.description",abstract:"formula.functionList.IMSUB.abstract",functionParameter:[{name:"formula.functionList.IMSUB.functionParameter.inumber1.name",detail:"formula.functionList.IMSUB.functionParameter.inumber1.detail",example:'"13+4i"',require:1,repeat:0},{name:"formula.functionList.IMSUB.functionParameter.inumber2.name",detail:"formula.functionList.IMSUB.functionParameter.inumber2.detail",example:'"5+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSUM,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSUM.description",abstract:"formula.functionList.IMSUM.abstract",functionParameter:[{name:"formula.functionList.IMSUM.functionParameter.inumber1.name",detail:"formula.functionList.IMSUM.functionParameter.inumber1.detail",example:'"3+4i"',require:1,repeat:0},{name:"formula.functionList.IMSUM.functionParameter.inumber2.name",detail:"formula.functionList.IMSUM.functionParameter.inumber2.detail",example:'"5-3i"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMTAN,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMTAN.description",abstract:"formula.functionList.IMTAN.abstract",functionParameter:[{name:"formula.functionList.IMTAN.functionParameter.inumber.name",detail:"formula.functionList.IMTAN.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMTANH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMTANH.description",abstract:"formula.functionList.IMTANH.abstract",functionParameter:[{name:"formula.functionList.IMTANH.functionParameter.inumber.name",detail:"formula.functionList.IMTANH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.OCT2BIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.OCT2BIN.description",abstract:"formula.functionList.OCT2BIN.abstract",functionParameter:[{name:"formula.functionList.OCT2BIN.functionParameter.number.name",detail:"formula.functionList.OCT2BIN.functionParameter.number.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.OCT2BIN.functionParameter.places.name",detail:"formula.functionList.OCT2BIN.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.OCT2DEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.OCT2DEC.description",abstract:"formula.functionList.OCT2DEC.abstract",functionParameter:[{name:"formula.functionList.OCT2DEC.functionParameter.number.name",detail:"formula.functionList.OCT2DEC.functionParameter.number.detail",example:"54",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.OCT2HEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.OCT2HEX.description",abstract:"formula.functionList.OCT2HEX.abstract",functionParameter:[{name:"formula.functionList.OCT2HEX.functionParameter.number.name",detail:"formula.functionList.OCT2HEX.functionParameter.number.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.OCT2HEX.functionParameter.places.name",detail:"formula.functionList.OCT2HEX.functionParameter.places.detail",example:"4",require:0,repeat:0}]}],Ye=[{functionName:t.FUNCTION_NAMES_FINANCIAL.ACCRINT,functionType:t.FunctionType.Financial,description:"formula.functionList.ACCRINT.description",abstract:"formula.functionList.ACCRINT.abstract",functionParameter:[{name:"formula.functionList.ACCRINT.functionParameter.issue.name",detail:"formula.functionList.ACCRINT.functionParameter.issue.detail",example:"39508",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.firstInterest.name",detail:"formula.functionList.ACCRINT.functionParameter.firstInterest.detail",example:"39691",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.settlement.name",detail:"formula.functionList.ACCRINT.functionParameter.settlement.detail",example:"39569",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.rate.name",detail:"formula.functionList.ACCRINT.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.par.name",detail:"formula.functionList.ACCRINT.functionParameter.par.detail",example:"1000",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.frequency.name",detail:"formula.functionList.ACCRINT.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.basis.name",detail:"formula.functionList.ACCRINT.functionParameter.basis.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.calcMethod.name",detail:"formula.functionList.ACCRINT.functionParameter.calcMethod.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ACCRINTM,functionType:t.FunctionType.Financial,description:"formula.functionList.ACCRINTM.description",abstract:"formula.functionList.ACCRINTM.abstract",functionParameter:[{name:"formula.functionList.ACCRINTM.functionParameter.issue.name",detail:"formula.functionList.ACCRINTM.functionParameter.issue.detail",example:'"2008-4-1"',require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.settlement.name",detail:"formula.functionList.ACCRINTM.functionParameter.settlement.detail",example:'"2008-6-15"',require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.rate.name",detail:"formula.functionList.ACCRINTM.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.par.name",detail:"formula.functionList.ACCRINTM.functionParameter.par.detail",example:"1000",require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.basis.name",detail:"formula.functionList.ACCRINTM.functionParameter.basis.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.AMORDEGRC,functionType:t.FunctionType.Financial,description:"formula.functionList.AMORDEGRC.description",abstract:"formula.functionList.AMORDEGRC.abstract",functionParameter:[{name:"formula.functionList.AMORDEGRC.functionParameter.number1.name",detail:"formula.functionList.AMORDEGRC.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AMORDEGRC.functionParameter.number2.name",detail:"formula.functionList.AMORDEGRC.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.AMORLINC,functionType:t.FunctionType.Financial,description:"formula.functionList.AMORLINC.description",abstract:"formula.functionList.AMORLINC.abstract",functionParameter:[{name:"formula.functionList.AMORLINC.functionParameter.cost.name",detail:"formula.functionList.AMORLINC.functionParameter.cost.detail",example:"2400",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.datePurchased.name",detail:"formula.functionList.AMORLINC.functionParameter.datePurchased.detail",example:"39679",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.firstPeriod.name",detail:"formula.functionList.AMORLINC.functionParameter.firstPeriod.detail",example:"39813",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.salvage.name",detail:"formula.functionList.AMORLINC.functionParameter.salvage.detail",example:"300",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.period.name",detail:"formula.functionList.AMORLINC.functionParameter.period.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.rate.name",detail:"formula.functionList.AMORLINC.functionParameter.rate.detail",example:"0.15",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.basis.name",detail:"formula.functionList.AMORLINC.functionParameter.basis.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPDAYBS,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPDAYBS.description",abstract:"formula.functionList.COUPDAYBS.abstract",functionParameter:[{name:"formula.functionList.COUPDAYBS.functionParameter.settlement.name",detail:"formula.functionList.COUPDAYBS.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPDAYBS.functionParameter.maturity.name",detail:"formula.functionList.COUPDAYBS.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPDAYBS.functionParameter.frequency.name",detail:"formula.functionList.COUPDAYBS.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPDAYBS.functionParameter.basis.name",detail:"formula.functionList.COUPDAYBS.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPDAYS,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPDAYS.description",abstract:"formula.functionList.COUPDAYS.abstract",functionParameter:[{name:"formula.functionList.COUPDAYS.functionParameter.settlement.name",detail:"formula.functionList.COUPDAYS.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPDAYS.functionParameter.maturity.name",detail:"formula.functionList.COUPDAYS.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPDAYS.functionParameter.frequency.name",detail:"formula.functionList.COUPDAYS.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPDAYS.functionParameter.basis.name",detail:"formula.functionList.COUPDAYS.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPDAYSNC,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPDAYSNC.description",abstract:"formula.functionList.COUPDAYSNC.abstract",functionParameter:[{name:"formula.functionList.COUPDAYSNC.functionParameter.settlement.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPDAYSNC.functionParameter.maturity.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPDAYSNC.functionParameter.frequency.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPDAYSNC.functionParameter.basis.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPNCD,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPNCD.description",abstract:"formula.functionList.COUPNCD.abstract",functionParameter:[{name:"formula.functionList.COUPNCD.functionParameter.settlement.name",detail:"formula.functionList.COUPNCD.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPNCD.functionParameter.maturity.name",detail:"formula.functionList.COUPNCD.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPNCD.functionParameter.frequency.name",detail:"formula.functionList.COUPNCD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPNCD.functionParameter.basis.name",detail:"formula.functionList.COUPNCD.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPNUM,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPNUM.description",abstract:"formula.functionList.COUPNUM.abstract",functionParameter:[{name:"formula.functionList.COUPNUM.functionParameter.settlement.name",detail:"formula.functionList.COUPNUM.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPNUM.functionParameter.maturity.name",detail:"formula.functionList.COUPNUM.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPNUM.functionParameter.frequency.name",detail:"formula.functionList.COUPNUM.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPNUM.functionParameter.basis.name",detail:"formula.functionList.COUPNUM.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPPCD,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPPCD.description",abstract:"formula.functionList.COUPPCD.abstract",functionParameter:[{name:"formula.functionList.COUPPCD.functionParameter.settlement.name",detail:"formula.functionList.COUPPCD.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPPCD.functionParameter.maturity.name",detail:"formula.functionList.COUPPCD.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPPCD.functionParameter.frequency.name",detail:"formula.functionList.COUPPCD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPPCD.functionParameter.basis.name",detail:"formula.functionList.COUPPCD.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.CUMIPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.CUMIPMT.description",abstract:"formula.functionList.CUMIPMT.abstract",functionParameter:[{name:"formula.functionList.CUMIPMT.functionParameter.rate.name",detail:"formula.functionList.CUMIPMT.functionParameter.rate.detail",example:"0.09/12",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.nper.name",detail:"formula.functionList.CUMIPMT.functionParameter.nper.detail",example:"30*12",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.pv.name",detail:"formula.functionList.CUMIPMT.functionParameter.pv.detail",example:"125000",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.startPeriod.name",detail:"formula.functionList.CUMIPMT.functionParameter.startPeriod.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.endPeriod.name",detail:"formula.functionList.CUMIPMT.functionParameter.endPeriod.detail",example:"24",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.type.name",detail:"formula.functionList.CUMIPMT.functionParameter.type.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.CUMPRINC,functionType:t.FunctionType.Financial,description:"formula.functionList.CUMPRINC.description",abstract:"formula.functionList.CUMPRINC.abstract",functionParameter:[{name:"formula.functionList.CUMPRINC.functionParameter.rate.name",detail:"formula.functionList.CUMPRINC.functionParameter.rate.detail",example:"0.09/12",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.nper.name",detail:"formula.functionList.CUMPRINC.functionParameter.nper.detail",example:"30*12",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.pv.name",detail:"formula.functionList.CUMPRINC.functionParameter.pv.detail",example:"125000",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.startPeriod.name",detail:"formula.functionList.CUMPRINC.functionParameter.startPeriod.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.endPeriod.name",detail:"formula.functionList.CUMPRINC.functionParameter.endPeriod.detail",example:"24",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.type.name",detail:"formula.functionList.CUMPRINC.functionParameter.type.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DB,functionType:t.FunctionType.Financial,description:"formula.functionList.DB.description",abstract:"formula.functionList.DB.abstract",functionParameter:[{name:"formula.functionList.DB.functionParameter.cost.name",detail:"formula.functionList.DB.functionParameter.cost.detail",example:"10000000",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.salvage.name",detail:"formula.functionList.DB.functionParameter.salvage.detail",example:"1000000",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.life.name",detail:"formula.functionList.DB.functionParameter.life.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.period.name",detail:"formula.functionList.DB.functionParameter.period.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.month.name",detail:"formula.functionList.DB.functionParameter.month.detail",example:"7",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DDB,functionType:t.FunctionType.Financial,description:"formula.functionList.DDB.description",abstract:"formula.functionList.DDB.abstract",functionParameter:[{name:"formula.functionList.DDB.functionParameter.cost.name",detail:"formula.functionList.DDB.functionParameter.cost.detail",example:"24000",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.salvage.name",detail:"formula.functionList.DDB.functionParameter.salvage.detail",example:"3000",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.life.name",detail:"formula.functionList.DDB.functionParameter.life.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.period.name",detail:"formula.functionList.DDB.functionParameter.period.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.factor.name",detail:"formula.functionList.DDB.functionParameter.factor.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DISC,functionType:t.FunctionType.Financial,description:"formula.functionList.DISC.description",abstract:"formula.functionList.DISC.abstract",functionParameter:[{name:"formula.functionList.DISC.functionParameter.settlement.name",detail:"formula.functionList.DISC.functionParameter.settlement.detail",example:'"2018-7-1"',require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.maturity.name",detail:"formula.functionList.DISC.functionParameter.maturity.detail",example:'"2048-1-1"',require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.pr.name",detail:"formula.functionList.DISC.functionParameter.pr.detail",example:"97.975",require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.redemption.name",detail:"formula.functionList.DISC.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.basis.name",detail:"formula.functionList.DISC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DOLLARDE,functionType:t.FunctionType.Financial,description:"formula.functionList.DOLLARDE.description",abstract:"formula.functionList.DOLLARDE.abstract",functionParameter:[{name:"formula.functionList.DOLLARDE.functionParameter.fractionalDollar.name",detail:"formula.functionList.DOLLARDE.functionParameter.fractionalDollar.detail",example:"1.02",require:1,repeat:0},{name:"formula.functionList.DOLLARDE.functionParameter.fraction.name",detail:"formula.functionList.DOLLARDE.functionParameter.fraction.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DOLLARFR,functionType:t.FunctionType.Financial,description:"formula.functionList.DOLLARFR.description",abstract:"formula.functionList.DOLLARFR.abstract",functionParameter:[{name:"formula.functionList.DOLLARFR.functionParameter.decimalDollar.name",detail:"formula.functionList.DOLLARFR.functionParameter.decimalDollar.detail",example:"1.125",require:1,repeat:0},{name:"formula.functionList.DOLLARFR.functionParameter.fraction.name",detail:"formula.functionList.DOLLARFR.functionParameter.fraction.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DURATION,functionType:t.FunctionType.Financial,description:"formula.functionList.DURATION.description",abstract:"formula.functionList.DURATION.abstract",functionParameter:[{name:"formula.functionList.DURATION.functionParameter.settlement.name",detail:"formula.functionList.DURATION.functionParameter.settlement.detail",example:'"2018-7-1"',require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.maturity.name",detail:"formula.functionList.DURATION.functionParameter.maturity.detail",example:'"2048-1-1"',require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.coupon.name",detail:"formula.functionList.DURATION.functionParameter.coupon.detail",example:"0.08",require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.yld.name",detail:"formula.functionList.DURATION.functionParameter.yld.detail",example:"0.09",require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.frequency.name",detail:"formula.functionList.DURATION.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.basis.name",detail:"formula.functionList.DURATION.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.EFFECT,functionType:t.FunctionType.Financial,description:"formula.functionList.EFFECT.description",abstract:"formula.functionList.EFFECT.abstract",functionParameter:[{name:"formula.functionList.EFFECT.functionParameter.nominalRate.name",detail:"formula.functionList.EFFECT.functionParameter.nominalRate.detail",example:"0.0525",require:1,repeat:0},{name:"formula.functionList.EFFECT.functionParameter.npery.name",detail:"formula.functionList.EFFECT.functionParameter.npery.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.FV,functionType:t.FunctionType.Financial,description:"formula.functionList.FV.description",abstract:"formula.functionList.FV.abstract",functionParameter:[{name:"formula.functionList.FV.functionParameter.rate.name",detail:"formula.functionList.FV.functionParameter.rate.detail",example:"0.06/12",require:1,repeat:0},{name:"formula.functionList.FV.functionParameter.nper.name",detail:"formula.functionList.FV.functionParameter.nper.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.FV.functionParameter.pmt.name",detail:"formula.functionList.FV.functionParameter.pmt.detail",example:"-200",require:1,repeat:0},{name:"formula.functionList.FV.functionParameter.pv.name",detail:"formula.functionList.FV.functionParameter.pv.detail",example:"-500",require:0,repeat:0},{name:"formula.functionList.FV.functionParameter.type.name",detail:"formula.functionList.FV.functionParameter.type.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.FVSCHEDULE,functionType:t.FunctionType.Financial,description:"formula.functionList.FVSCHEDULE.description",abstract:"formula.functionList.FVSCHEDULE.abstract",functionParameter:[{name:"formula.functionList.FVSCHEDULE.functionParameter.principal.name",detail:"formula.functionList.FVSCHEDULE.functionParameter.principal.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.FVSCHEDULE.functionParameter.schedule.name",detail:"formula.functionList.FVSCHEDULE.functionParameter.schedule.detail",example:"A1:A4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.INTRATE,functionType:t.FunctionType.Financial,description:"formula.functionList.INTRATE.description",abstract:"formula.functionList.INTRATE.abstract",functionParameter:[{name:"formula.functionList.INTRATE.functionParameter.settlement.name",detail:"formula.functionList.INTRATE.functionParameter.settlement.detail",example:'"2008-2-15"',require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.maturity.name",detail:"formula.functionList.INTRATE.functionParameter.maturity.detail",example:'"2008-5-15"',require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.investment.name",detail:"formula.functionList.INTRATE.functionParameter.investment.detail",example:"10000000",require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.redemption.name",detail:"formula.functionList.INTRATE.functionParameter.redemption.detail",example:"10144200",require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.basis.name",detail:"formula.functionList.INTRATE.functionParameter.basis.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.IPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.IPMT.description",abstract:"formula.functionList.IPMT.abstract",functionParameter:[{name:"formula.functionList.IPMT.functionParameter.rate.name",detail:"formula.functionList.IPMT.functionParameter.rate.detail",example:"0.1/12",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.per.name",detail:"formula.functionList.IPMT.functionParameter.per.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.nper.name",detail:"formula.functionList.IPMT.functionParameter.nper.detail",example:"3*12",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.pv.name",detail:"formula.functionList.IPMT.functionParameter.pv.detail",example:"80000",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.fv.name",detail:"formula.functionList.IPMT.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.IPMT.functionParameter.type.name",detail:"formula.functionList.IPMT.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.IRR,functionType:t.FunctionType.Financial,description:"formula.functionList.IRR.description",abstract:"formula.functionList.IRR.abstract",functionParameter:[{name:"formula.functionList.IRR.functionParameter.values.name",detail:"formula.functionList.IRR.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.IRR.functionParameter.guess.name",detail:"formula.functionList.IRR.functionParameter.guess.detail",example:"0.1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ISPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.ISPMT.description",abstract:"formula.functionList.ISPMT.abstract",functionParameter:[{name:"formula.functionList.ISPMT.functionParameter.rate.name",detail:"formula.functionList.ISPMT.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.ISPMT.functionParameter.per.name",detail:"formula.functionList.ISPMT.functionParameter.per.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ISPMT.functionParameter.nper.name",detail:"formula.functionList.ISPMT.functionParameter.nper.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.ISPMT.functionParameter.pv.name",detail:"formula.functionList.ISPMT.functionParameter.pv.detail",example:"1000",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.MDURATION,functionType:t.FunctionType.Financial,description:"formula.functionList.MDURATION.description",abstract:"formula.functionList.MDURATION.abstract",functionParameter:[{name:"formula.functionList.MDURATION.functionParameter.settlement.name",detail:"formula.functionList.MDURATION.functionParameter.settlement.detail",example:'"2018-7-1"',require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.maturity.name",detail:"formula.functionList.MDURATION.functionParameter.maturity.detail",example:'"2048-1-1"',require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.coupon.name",detail:"formula.functionList.MDURATION.functionParameter.coupon.detail",example:"0.08",require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.yld.name",detail:"formula.functionList.MDURATION.functionParameter.yld.detail",example:"0.09",require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.frequency.name",detail:"formula.functionList.MDURATION.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.basis.name",detail:"formula.functionList.MDURATION.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.MIRR,functionType:t.FunctionType.Financial,description:"formula.functionList.MIRR.description",abstract:"formula.functionList.MIRR.abstract",functionParameter:[{name:"formula.functionList.MIRR.functionParameter.values.name",detail:"formula.functionList.MIRR.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MIRR.functionParameter.financeRate.name",detail:"formula.functionList.MIRR.functionParameter.financeRate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.MIRR.functionParameter.reinvestRate.name",detail:"formula.functionList.MIRR.functionParameter.reinvestRate.detail",example:"0.12",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.NOMINAL,functionType:t.FunctionType.Financial,description:"formula.functionList.NOMINAL.description",abstract:"formula.functionList.NOMINAL.abstract",functionParameter:[{name:"formula.functionList.NOMINAL.functionParameter.effectRate.name",detail:"formula.functionList.NOMINAL.functionParameter.effectRate.detail",example:"0.053543",require:1,repeat:0},{name:"formula.functionList.NOMINAL.functionParameter.npery.name",detail:"formula.functionList.NOMINAL.functionParameter.npery.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.NPER,functionType:t.FunctionType.Financial,description:"formula.functionList.NPER.description",abstract:"formula.functionList.NPER.abstract",functionParameter:[{name:"formula.functionList.NPER.functionParameter.rate.name",detail:"formula.functionList.NPER.functionParameter.rate.detail",example:"0.12/12",require:1,repeat:0},{name:"formula.functionList.NPER.functionParameter.pmt.name",detail:"formula.functionList.NPER.functionParameter.pmt.detail",example:"-100",require:1,repeat:0},{name:"formula.functionList.NPER.functionParameter.pv.name",detail:"formula.functionList.NPER.functionParameter.pv.detail",example:"-1000",require:1,repeat:0},{name:"formula.functionList.NPER.functionParameter.fv.name",detail:"formula.functionList.NPER.functionParameter.fv.detail",example:"10000",require:0,repeat:0},{name:"formula.functionList.NPER.functionParameter.type.name",detail:"formula.functionList.NPER.functionParameter.type.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.NPV,functionType:t.FunctionType.Financial,description:"formula.functionList.NPV.description",abstract:"formula.functionList.NPV.abstract",functionParameter:[{name:"formula.functionList.NPV.functionParameter.rate.name",detail:"formula.functionList.NPV.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.NPV.functionParameter.value1.name",detail:"formula.functionList.NPV.functionParameter.value1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.NPV.functionParameter.value2.name",detail:"formula.functionList.NPV.functionParameter.value2.detail",example:"-9000",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDFPRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDFPRICE.description",abstract:"formula.functionList.ODDFPRICE.abstract",functionParameter:[{name:"formula.functionList.ODDFPRICE.functionParameter.settlement.name",detail:"formula.functionList.ODDFPRICE.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.maturity.name",detail:"formula.functionList.ODDFPRICE.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.issue.name",detail:"formula.functionList.ODDFPRICE.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.firstCoupon.name",detail:"formula.functionList.ODDFPRICE.functionParameter.firstCoupon.detail",example:'"2009-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.rate.name",detail:"formula.functionList.ODDFPRICE.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.yld.name",detail:"formula.functionList.ODDFPRICE.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.redemption.name",detail:"formula.functionList.ODDFPRICE.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.frequency.name",detail:"formula.functionList.ODDFPRICE.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.basis.name",detail:"formula.functionList.ODDFPRICE.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDFYIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDFYIELD.description",abstract:"formula.functionList.ODDFYIELD.abstract",functionParameter:[{name:"formula.functionList.ODDFYIELD.functionParameter.settlement.name",detail:"formula.functionList.ODDFYIELD.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.maturity.name",detail:"formula.functionList.ODDFYIELD.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.issue.name",detail:"formula.functionList.ODDFYIELD.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.firstCoupon.name",detail:"formula.functionList.ODDFYIELD.functionParameter.firstCoupon.detail",example:'"2009-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.rate.name",detail:"formula.functionList.ODDFYIELD.functionParameter.rate.detail",example:"0.0575",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.pr.name",detail:"formula.functionList.ODDFYIELD.functionParameter.pr.detail",example:"84.5",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.redemption.name",detail:"formula.functionList.ODDFYIELD.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.frequency.name",detail:"formula.functionList.ODDFYIELD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.basis.name",detail:"formula.functionList.ODDFYIELD.functionParameter.basis.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDLPRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDLPRICE.description",abstract:"formula.functionList.ODDLPRICE.abstract",functionParameter:[{name:"formula.functionList.ODDLPRICE.functionParameter.settlement.name",detail:"formula.functionList.ODDLPRICE.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.maturity.name",detail:"formula.functionList.ODDLPRICE.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.lastInterest.name",detail:"formula.functionList.ODDLPRICE.functionParameter.lastInterest.detail",example:'"2009-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.rate.name",detail:"formula.functionList.ODDLPRICE.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.yld.name",detail:"formula.functionList.ODDLPRICE.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.redemption.name",detail:"formula.functionList.ODDLPRICE.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.frequency.name",detail:"formula.functionList.ODDLPRICE.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.basis.name",detail:"formula.functionList.ODDLPRICE.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDLYIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDLYIELD.description",abstract:"formula.functionList.ODDLYIELD.abstract",functionParameter:[{name:"formula.functionList.ODDLYIELD.functionParameter.settlement.name",detail:"formula.functionList.ODDLYIELD.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.maturity.name",detail:"formula.functionList.ODDLYIELD.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.lastInterest.name",detail:"formula.functionList.ODDLYIELD.functionParameter.lastInterest.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.rate.name",detail:"formula.functionList.ODDLYIELD.functionParameter.rate.detail",example:"0.0575",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.pr.name",detail:"formula.functionList.ODDLYIELD.functionParameter.pr.detail",example:"84.5",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.redemption.name",detail:"formula.functionList.ODDLYIELD.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.frequency.name",detail:"formula.functionList.ODDLYIELD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.basis.name",detail:"formula.functionList.ODDLYIELD.functionParameter.basis.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PDURATION,functionType:t.FunctionType.Financial,description:"formula.functionList.PDURATION.description",abstract:"formula.functionList.PDURATION.abstract",functionParameter:[{name:"formula.functionList.PDURATION.functionParameter.rate.name",detail:"formula.functionList.PDURATION.functionParameter.rate.detail",example:"0.025",require:1,repeat:0},{name:"formula.functionList.PDURATION.functionParameter.pv.name",detail:"formula.functionList.PDURATION.functionParameter.pv.detail",example:"2000",require:1,repeat:0},{name:"formula.functionList.PDURATION.functionParameter.fv.name",detail:"formula.functionList.PDURATION.functionParameter.fv.detail",example:"2200",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PMT,functionType:t.FunctionType.Financial,description:"formula.functionList.PMT.description",abstract:"formula.functionList.PMT.abstract",functionParameter:[{name:"formula.functionList.PMT.functionParameter.rate.name",detail:"formula.functionList.PMT.functionParameter.rate.detail",example:"0.08/12",require:1,repeat:0},{name:"formula.functionList.PMT.functionParameter.nper.name",detail:"formula.functionList.PMT.functionParameter.nper.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.PMT.functionParameter.pv.name",detail:"formula.functionList.PMT.functionParameter.pv.detail",example:"10000",require:1,repeat:0},{name:"formula.functionList.PMT.functionParameter.fv.name",detail:"formula.functionList.PMT.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.PMT.functionParameter.type.name",detail:"formula.functionList.PMT.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.PPMT.description",abstract:"formula.functionList.PPMT.abstract",functionParameter:[{name:"formula.functionList.PPMT.functionParameter.rate.name",detail:"formula.functionList.PPMT.functionParameter.rate.detail",example:"0.1/12",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.per.name",detail:"formula.functionList.PPMT.functionParameter.per.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.nper.name",detail:"formula.functionList.PPMT.functionParameter.nper.detail",example:"3*12",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.pv.name",detail:"formula.functionList.PPMT.functionParameter.pv.detail",example:"80000",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.fv.name",detail:"formula.functionList.PPMT.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.PPMT.functionParameter.type.name",detail:"formula.functionList.PPMT.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.PRICE.description",abstract:"formula.functionList.PRICE.abstract",functionParameter:[{name:"formula.functionList.PRICE.functionParameter.settlement.name",detail:"formula.functionList.PRICE.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.maturity.name",detail:"formula.functionList.PRICE.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.rate.name",detail:"formula.functionList.PRICE.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.yld.name",detail:"formula.functionList.PRICE.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.redemption.name",detail:"formula.functionList.PRICE.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.frequency.name",detail:"formula.functionList.PRICE.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.basis.name",detail:"formula.functionList.PRICE.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PRICEDISC,functionType:t.FunctionType.Financial,description:"formula.functionList.PRICEDISC.description",abstract:"formula.functionList.PRICEDISC.abstract",functionParameter:[{name:"formula.functionList.PRICEDISC.functionParameter.settlement.name",detail:"formula.functionList.PRICEDISC.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.maturity.name",detail:"formula.functionList.PRICEDISC.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.discount.name",detail:"formula.functionList.PRICEDISC.functionParameter.discount.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.redemption.name",detail:"formula.functionList.PRICEDISC.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.basis.name",detail:"formula.functionList.PRICEDISC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PRICEMAT,functionType:t.FunctionType.Financial,description:"formula.functionList.PRICEMAT.description",abstract:"formula.functionList.PRICEMAT.abstract",functionParameter:[{name:"formula.functionList.PRICEMAT.functionParameter.settlement.name",detail:"formula.functionList.PRICEMAT.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.maturity.name",detail:"formula.functionList.PRICEMAT.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.issue.name",detail:"formula.functionList.PRICEMAT.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.rate.name",detail:"formula.functionList.PRICEMAT.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.yld.name",detail:"formula.functionList.PRICEMAT.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.basis.name",detail:"formula.functionList.PRICEMAT.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PV,functionType:t.FunctionType.Financial,description:"formula.functionList.PV.description",abstract:"formula.functionList.PV.abstract",functionParameter:[{name:"formula.functionList.PV.functionParameter.rate.name",detail:"formula.functionList.PV.functionParameter.rate.detail",example:"0.02",require:1,repeat:0},{name:"formula.functionList.PV.functionParameter.nper.name",detail:"formula.functionList.PV.functionParameter.nper.detail",example:"12",require:1,repeat:0},{name:"formula.functionList.PV.functionParameter.pmt.name",detail:"formula.functionList.PV.functionParameter.pmt.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.PV.functionParameter.fv.name",detail:"formula.functionList.PV.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.PV.functionParameter.type.name",detail:"formula.functionList.PV.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.RATE,functionType:t.FunctionType.Financial,description:"formula.functionList.RATE.description",abstract:"formula.functionList.RATE.abstract",functionParameter:[{name:"formula.functionList.RATE.functionParameter.nper.name",detail:"formula.functionList.RATE.functionParameter.nper.detail",example:"4*12",require:1,repeat:0},{name:"formula.functionList.RATE.functionParameter.pmt.name",detail:"formula.functionList.RATE.functionParameter.pmt.detail",example:"-200",require:1,repeat:0},{name:"formula.functionList.RATE.functionParameter.pv.name",detail:"formula.functionList.RATE.functionParameter.pv.detail",example:"8000",require:1,repeat:0},{name:"formula.functionList.RATE.functionParameter.fv.name",detail:"formula.functionList.RATE.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.RATE.functionParameter.type.name",detail:"formula.functionList.RATE.functionParameter.type.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.RATE.functionParameter.guess.name",detail:"formula.functionList.RATE.functionParameter.guess.detail",example:"0.1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.RECEIVED,functionType:t.FunctionType.Financial,description:"formula.functionList.RECEIVED.description",abstract:"formula.functionList.RECEIVED.abstract",functionParameter:[{name:"formula.functionList.RECEIVED.functionParameter.settlement.name",detail:"formula.functionList.RECEIVED.functionParameter.settlement.detail",example:'"2008-2-15"',require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.maturity.name",detail:"formula.functionList.RECEIVED.functionParameter.maturity.detail",example:'"2008-3-15"',require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.investment.name",detail:"formula.functionList.RECEIVED.functionParameter.investment.detail",example:"10000000",require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.discount.name",detail:"formula.functionList.RECEIVED.functionParameter.discount.detail",example:"0.0575",require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.basis.name",detail:"formula.functionList.RECEIVED.functionParameter.basis.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.RRI,functionType:t.FunctionType.Financial,description:"formula.functionList.RRI.description",abstract:"formula.functionList.RRI.abstract",functionParameter:[{name:"formula.functionList.RRI.functionParameter.nper.name",detail:"formula.functionList.RRI.functionParameter.nper.detail",example:"96",require:1,repeat:0},{name:"formula.functionList.RRI.functionParameter.pv.name",detail:"formula.functionList.RRI.functionParameter.pv.detail",example:"10000",require:1,repeat:0},{name:"formula.functionList.RRI.functionParameter.fv.name",detail:"formula.functionList.RRI.functionParameter.fv.detail",example:"11000",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.SLN,functionType:t.FunctionType.Financial,description:"formula.functionList.SLN.description",abstract:"formula.functionList.SLN.abstract",functionParameter:[{name:"formula.functionList.SLN.functionParameter.cost.name",detail:"formula.functionList.SLN.functionParameter.cost.detail",example:"300000",require:1,repeat:0},{name:"formula.functionList.SLN.functionParameter.salvage.name",detail:"formula.functionList.SLN.functionParameter.salvage.detail",example:"75000",require:1,repeat:0},{name:"formula.functionList.SLN.functionParameter.life.name",detail:"formula.functionList.SLN.functionParameter.life.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.SYD,functionType:t.FunctionType.Financial,description:"formula.functionList.SYD.description",abstract:"formula.functionList.SYD.abstract",functionParameter:[{name:"formula.functionList.SYD.functionParameter.cost.name",detail:"formula.functionList.SYD.functionParameter.cost.detail",example:"300000",require:1,repeat:0},{name:"formula.functionList.SYD.functionParameter.salvage.name",detail:"formula.functionList.SYD.functionParameter.salvage.detail",example:"75000",require:1,repeat:0},{name:"formula.functionList.SYD.functionParameter.life.name",detail:"formula.functionList.SYD.functionParameter.life.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.SYD.functionParameter.per.name",detail:"formula.functionList.SYD.functionParameter.per.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.TBILLEQ,functionType:t.FunctionType.Financial,description:"formula.functionList.TBILLEQ.description",abstract:"formula.functionList.TBILLEQ.abstract",functionParameter:[{name:"formula.functionList.TBILLEQ.functionParameter.settlement.name",detail:"formula.functionList.TBILLEQ.functionParameter.settlement.detail",example:'"2008-3-31"',require:1,repeat:0},{name:"formula.functionList.TBILLEQ.functionParameter.maturity.name",detail:"formula.functionList.TBILLEQ.functionParameter.maturity.detail",example:'"2008-6-1"',require:1,repeat:0},{name:"formula.functionList.TBILLEQ.functionParameter.discount.name",detail:"formula.functionList.TBILLEQ.functionParameter.discount.detail",example:"0.0914",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.TBILLPRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.TBILLPRICE.description",abstract:"formula.functionList.TBILLPRICE.abstract",functionParameter:[{name:"formula.functionList.TBILLPRICE.functionParameter.settlement.name",detail:"formula.functionList.TBILLPRICE.functionParameter.settlement.detail",example:'"2008-3-31"',require:1,repeat:0},{name:"formula.functionList.TBILLPRICE.functionParameter.maturity.name",detail:"formula.functionList.TBILLPRICE.functionParameter.maturity.detail",example:'"2008-6-1"',require:1,repeat:0},{name:"formula.functionList.TBILLPRICE.functionParameter.discount.name",detail:"formula.functionList.TBILLPRICE.functionParameter.discount.detail",example:"0.0914",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.TBILLYIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.TBILLYIELD.description",abstract:"formula.functionList.TBILLYIELD.abstract",functionParameter:[{name:"formula.functionList.TBILLYIELD.functionParameter.settlement.name",detail:"formula.functionList.TBILLYIELD.functionParameter.settlement.detail",example:'"2008-3-31"',require:1,repeat:0},{name:"formula.functionList.TBILLYIELD.functionParameter.maturity.name",detail:"formula.functionList.TBILLYIELD.functionParameter.maturity.detail",example:'"2008-6-1"',require:1,repeat:0},{name:"formula.functionList.TBILLYIELD.functionParameter.pr.name",detail:"formula.functionList.TBILLYIELD.functionParameter.pr.detail",example:"98.45",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.VDB,functionType:t.FunctionType.Financial,description:"formula.functionList.VDB.description",abstract:"formula.functionList.VDB.abstract",functionParameter:[{name:"formula.functionList.VDB.functionParameter.cost.name",detail:"formula.functionList.VDB.functionParameter.cost.detail",example:"2400",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.salvage.name",detail:"formula.functionList.VDB.functionParameter.salvage.detail",example:"300",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.life.name",detail:"formula.functionList.VDB.functionParameter.life.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.startPeriod.name",detail:"formula.functionList.VDB.functionParameter.startPeriod.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.endPeriod.name",detail:"formula.functionList.VDB.functionParameter.endPeriod.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.factor.name",detail:"formula.functionList.VDB.functionParameter.factor.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.VDB.functionParameter.noSwitch.name",detail:"formula.functionList.VDB.functionParameter.noSwitch.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.XIRR,functionType:t.FunctionType.Financial,description:"formula.functionList.XIRR.description",abstract:"formula.functionList.XIRR.abstract",functionParameter:[{name:"formula.functionList.XIRR.functionParameter.values.name",detail:"formula.functionList.XIRR.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.XIRR.functionParameter.dates.name",detail:"formula.functionList.XIRR.functionParameter.dates.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.XIRR.functionParameter.guess.name",detail:"formula.functionList.XIRR.functionParameter.guess.detail",example:"0.1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.XNPV,functionType:t.FunctionType.Financial,description:"formula.functionList.XNPV.description",abstract:"formula.functionList.XNPV.abstract",functionParameter:[{name:"formula.functionList.XNPV.functionParameter.rate.name",detail:"formula.functionList.XNPV.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.XNPV.functionParameter.values.name",detail:"formula.functionList.XNPV.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.XNPV.functionParameter.dates.name",detail:"formula.functionList.XNPV.functionParameter.dates.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.YIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.YIELD.description",abstract:"formula.functionList.YIELD.abstract",functionParameter:[{name:"formula.functionList.YIELD.functionParameter.settlement.name",detail:"formula.functionList.YIELD.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.maturity.name",detail:"formula.functionList.YIELD.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.rate.name",detail:"formula.functionList.YIELD.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.pr.name",detail:"formula.functionList.YIELD.functionParameter.pr.detail",example:"98.45",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.redemption.name",detail:"formula.functionList.YIELD.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.frequency.name",detail:"formula.functionList.YIELD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.basis.name",detail:"formula.functionList.YIELD.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.YIELDDISC,functionType:t.FunctionType.Financial,description:"formula.functionList.YIELDDISC.description",abstract:"formula.functionList.YIELDDISC.abstract",functionParameter:[{name:"formula.functionList.YIELDDISC.functionParameter.settlement.name",detail:"formula.functionList.YIELDDISC.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.maturity.name",detail:"formula.functionList.YIELDDISC.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.pr.name",detail:"formula.functionList.YIELDDISC.functionParameter.pr.detail",example:"98.45",require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.redemption.name",detail:"formula.functionList.YIELDDISC.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.basis.name",detail:"formula.functionList.YIELDDISC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.YIELDMAT,functionType:t.FunctionType.Financial,description:"formula.functionList.YIELDMAT.description",abstract:"formula.functionList.YIELDMAT.abstract",functionParameter:[{name:"formula.functionList.YIELDMAT.functionParameter.settlement.name",detail:"formula.functionList.YIELDMAT.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.maturity.name",detail:"formula.functionList.YIELDMAT.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.issue.name",detail:"formula.functionList.YIELDMAT.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.rate.name",detail:"formula.functionList.YIELDMAT.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.pr.name",detail:"formula.functionList.YIELDMAT.functionParameter.pr.detail",example:"98.45",require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.basis.name",detail:"formula.functionList.YIELDMAT.functionParameter.basis.detail",example:"1",require:0,repeat:0}]}],Xe=[{functionName:t.FUNCTION_NAMES_INFORMATION.CELL,functionType:t.FunctionType.Information,description:"formula.functionList.CELL.description",abstract:"formula.functionList.CELL.abstract",functionParameter:[{name:"formula.functionList.CELL.functionParameter.infoType.name",detail:"formula.functionList.CELL.functionParameter.infoType.detail",example:'"type"',require:1,repeat:0},{name:"formula.functionList.CELL.functionParameter.reference.name",detail:"formula.functionList.CELL.functionParameter.reference.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ERROR_TYPE,functionType:t.FunctionType.Information,description:"formula.functionList.ERROR_TYPE.description",abstract:"formula.functionList.ERROR_TYPE.abstract",functionParameter:[{name:"formula.functionList.ERROR_TYPE.functionParameter.errorVal.name",detail:"formula.functionList.ERROR_TYPE.functionParameter.errorVal.detail",example:'"#NULL!"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.INFO,functionType:t.FunctionType.Information,description:"formula.functionList.INFO.description",abstract:"formula.functionList.INFO.abstract",functionParameter:[{name:"formula.functionList.INFO.functionParameter.number1.name",detail:"formula.functionList.INFO.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.INFO.functionParameter.number2.name",detail:"formula.functionList.INFO.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISBETWEEN,functionType:t.FunctionType.Information,description:"formula.functionList.ISBETWEEN.description",abstract:"formula.functionList.ISBETWEEN.abstract",functionParameter:[{name:"formula.functionList.ISBETWEEN.functionParameter.valueToCompare.name",detail:"formula.functionList.ISBETWEEN.functionParameter.valueToCompare.detail",example:"7.9",require:1,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.lowerValue.name",detail:"formula.functionList.ISBETWEEN.functionParameter.lowerValue.detail",example:"1.2",require:1,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.upperValue.name",detail:"formula.functionList.ISBETWEEN.functionParameter.upperValue.detail",example:"12.45",require:1,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.lowerValueIsInclusive.name",detail:"formula.functionList.ISBETWEEN.functionParameter.lowerValueIsInclusive.detail",example:"true",require:0,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.upperValueIsInclusive.name",detail:"formula.functionList.ISBETWEEN.functionParameter.upperValueIsInclusive.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISBLANK,functionType:t.FunctionType.Information,description:"formula.functionList.ISBLANK.description",abstract:"formula.functionList.ISBLANK.abstract",functionParameter:[{name:"formula.functionList.ISBLANK.functionParameter.value.name",detail:"formula.functionList.ISBLANK.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISDATE,functionType:t.FunctionType.Information,description:"formula.functionList.ISDATE.description",abstract:"formula.functionList.ISDATE.abstract",functionParameter:[{name:"formula.functionList.ISDATE.functionParameter.value.name",detail:"formula.functionList.ISDATE.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISEMAIL,functionType:t.FunctionType.Information,description:"formula.functionList.ISEMAIL.description",abstract:"formula.functionList.ISEMAIL.abstract",functionParameter:[{name:"formula.functionList.ISEMAIL.functionParameter.value.name",detail:"formula.functionList.ISEMAIL.functionParameter.value.detail",example:'"developer@univer.ai"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISERR,functionType:t.FunctionType.Information,description:"formula.functionList.ISERR.description",abstract:"formula.functionList.ISERR.abstract",functionParameter:[{name:"formula.functionList.ISERR.functionParameter.value.name",detail:"formula.functionList.ISERR.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISERROR,functionType:t.FunctionType.Information,description:"formula.functionList.ISERROR.description",abstract:"formula.functionList.ISERROR.abstract",functionParameter:[{name:"formula.functionList.ISERROR.functionParameter.value.name",detail:"formula.functionList.ISERROR.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISEVEN,functionType:t.FunctionType.Information,description:"formula.functionList.ISEVEN.description",abstract:"formula.functionList.ISEVEN.abstract",functionParameter:[{name:"formula.functionList.ISEVEN.functionParameter.value.name",detail:"formula.functionList.ISEVEN.functionParameter.value.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISFORMULA,functionType:t.FunctionType.Information,description:"formula.functionList.ISFORMULA.description",abstract:"formula.functionList.ISFORMULA.abstract",functionParameter:[{name:"formula.functionList.ISFORMULA.functionParameter.reference.name",detail:"formula.functionList.ISFORMULA.functionParameter.reference.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISLOGICAL,functionType:t.FunctionType.Information,description:"formula.functionList.ISLOGICAL.description",abstract:"formula.functionList.ISLOGICAL.abstract",functionParameter:[{name:"formula.functionList.ISLOGICAL.functionParameter.value.name",detail:"formula.functionList.ISLOGICAL.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISNA,functionType:t.FunctionType.Information,description:"formula.functionList.ISNA.description",abstract:"formula.functionList.ISNA.abstract",functionParameter:[{name:"formula.functionList.ISNA.functionParameter.value.name",detail:"formula.functionList.ISNA.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISNONTEXT,functionType:t.FunctionType.Information,description:"formula.functionList.ISNONTEXT.description",abstract:"formula.functionList.ISNONTEXT.abstract",functionParameter:[{name:"formula.functionList.ISNONTEXT.functionParameter.value.name",detail:"formula.functionList.ISNONTEXT.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISNUMBER,functionType:t.FunctionType.Information,description:"formula.functionList.ISNUMBER.description",abstract:"formula.functionList.ISNUMBER.abstract",functionParameter:[{name:"formula.functionList.ISNUMBER.functionParameter.value.name",detail:"formula.functionList.ISNUMBER.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISODD,functionType:t.FunctionType.Information,description:"formula.functionList.ISODD.description",abstract:"formula.functionList.ISODD.abstract",functionParameter:[{name:"formula.functionList.ISODD.functionParameter.value.name",detail:"formula.functionList.ISODD.functionParameter.value.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISOMITTED,functionType:t.FunctionType.Information,description:"formula.functionList.ISOMITTED.description",abstract:"formula.functionList.ISOMITTED.abstract",functionParameter:[{name:"formula.functionList.ISOMITTED.functionParameter.number1.name",detail:"formula.functionList.ISOMITTED.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.ISOMITTED.functionParameter.number2.name",detail:"formula.functionList.ISOMITTED.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISREF,functionType:t.FunctionType.Information,description:"formula.functionList.ISREF.description",abstract:"formula.functionList.ISREF.abstract",functionParameter:[{name:"formula.functionList.ISREF.functionParameter.value.name",detail:"formula.functionList.ISREF.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISTEXT,functionType:t.FunctionType.Information,description:"formula.functionList.ISTEXT.description",abstract:"formula.functionList.ISTEXT.abstract",functionParameter:[{name:"formula.functionList.ISTEXT.functionParameter.value.name",detail:"formula.functionList.ISTEXT.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISURL,functionType:t.FunctionType.Information,description:"formula.functionList.ISURL.description",abstract:"formula.functionList.ISURL.abstract",functionParameter:[{name:"formula.functionList.ISURL.functionParameter.value.name",detail:"formula.functionList.ISURL.functionParameter.value.detail",example:'"univer.ai"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.N,functionType:t.FunctionType.Information,description:"formula.functionList.N.description",abstract:"formula.functionList.N.abstract",functionParameter:[{name:"formula.functionList.N.functionParameter.value.name",detail:"formula.functionList.N.functionParameter.value.detail",example:"7",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.NA,functionType:t.FunctionType.Information,description:"formula.functionList.NA.description",abstract:"formula.functionList.NA.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_INFORMATION.SHEET,functionType:t.FunctionType.Information,description:"formula.functionList.SHEET.description",abstract:"formula.functionList.SHEET.abstract",functionParameter:[{name:"formula.functionList.SHEET.functionParameter.value.name",detail:"formula.functionList.SHEET.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.SHEETS,functionType:t.FunctionType.Information,description:"formula.functionList.SHEETS.description",abstract:"formula.functionList.SHEETS.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_INFORMATION.TYPE,functionType:t.FunctionType.Information,description:"formula.functionList.TYPE.description",abstract:"formula.functionList.TYPE.abstract",functionParameter:[{name:"formula.functionList.TYPE.functionParameter.value.name",detail:"formula.functionList.TYPE.functionParameter.value.detail",example:"A2",require:1,repeat:0}]}],we=[{functionName:t.FUNCTION_NAMES_LOGICAL.AND,functionType:t.FunctionType.Logical,description:"formula.functionList.AND.description",abstract:"formula.functionList.AND.abstract",functionParameter:[{name:"formula.functionList.AND.functionParameter.logical1.name",detail:"formula.functionList.AND.functionParameter.logical1.detail",example:"A1=1",require:1,repeat:0},{name:"formula.functionList.AND.functionParameter.logical2.name",detail:"formula.functionList.AND.functionParameter.logical2.detail",example:"A2=2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.BYCOL,functionType:t.FunctionType.Logical,description:"formula.functionList.BYCOL.description",abstract:"formula.functionList.BYCOL.abstract",functionParameter:[{name:"formula.functionList.BYCOL.functionParameter.array.name",detail:"formula.functionList.BYCOL.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.BYCOL.functionParameter.lambda.name",detail:"formula.functionList.BYCOL.functionParameter.lambda.detail",example:"LAMBDA(array, MAX(array))",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.BYROW,functionType:t.FunctionType.Logical,description:"formula.functionList.BYROW.description",abstract:"formula.functionList.BYROW.abstract",functionParameter:[{name:"formula.functionList.BYROW.functionParameter.array.name",detail:"formula.functionList.BYROW.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.BYROW.functionParameter.lambda.name",detail:"formula.functionList.BYROW.functionParameter.lambda.detail",example:"LAMBDA(array, MAX(array))",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.FALSE,functionType:t.FunctionType.Logical,description:"formula.functionList.FALSE.description",abstract:"formula.functionList.FALSE.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_LOGICAL.IF,functionType:t.FunctionType.Logical,description:"formula.functionList.IF.description",abstract:"formula.functionList.IF.abstract",functionParameter:[{name:"formula.functionList.IF.functionParameter.logicalTest.name",detail:"formula.functionList.IF.functionParameter.logicalTest.detail",example:'A2 = "foo"',require:1,repeat:0},{name:"formula.functionList.IF.functionParameter.valueIfTrue.name",detail:"formula.functionList.IF.functionParameter.valueIfTrue.detail",example:'"A2 is foo"',require:1,repeat:0},{name:"formula.functionList.IF.functionParameter.valueIfFalse.name",detail:"formula.functionList.IF.functionParameter.valueIfFalse.detail",example:'"A2 is not foo"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.IFERROR,functionType:t.FunctionType.Logical,description:"formula.functionList.IFERROR.description",abstract:"formula.functionList.IFERROR.abstract",functionParameter:[{name:"formula.functionList.IFERROR.functionParameter.value.name",detail:"formula.functionList.IFERROR.functionParameter.value.detail",example:"A2/B2",require:1,repeat:0},{name:"formula.functionList.IFERROR.functionParameter.valueIfError.name",detail:"formula.functionList.IFERROR.functionParameter.valueIfError.detail",example:"Error in calculation",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.IFNA,functionType:t.FunctionType.Logical,description:"formula.functionList.IFNA.description",abstract:"formula.functionList.IFNA.abstract",functionParameter:[{name:"formula.functionList.IFNA.functionParameter.value.name",detail:"formula.functionList.IFNA.functionParameter.value.detail",example:"VLOOKUP(C3,C6:D11,2,FALSE)",require:1,repeat:0},{name:"formula.functionList.IFNA.functionParameter.valueIfNa.name",detail:"formula.functionList.IFNA.functionParameter.valueIfNa.detail",example:'"Not Found"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.IFS,functionType:t.FunctionType.Logical,description:"formula.functionList.IFS.description",abstract:"formula.functionList.IFS.abstract",functionParameter:[{name:"formula.functionList.IFS.functionParameter.logicalTest1.name",detail:"formula.functionList.IFS.functionParameter.logicalTest1.detail",example:'A2 = "foo"',require:1,repeat:0},{name:"formula.functionList.IFS.functionParameter.valueIfTrue1.name",detail:"formula.functionList.IFS.functionParameter.valueIfTrue1.detail",example:'"A2 is foo"',require:1,repeat:0},{name:"formula.functionList.IFS.functionParameter.logicalTest2.name",detail:"formula.functionList.IFS.functionParameter.logicalTest2.detail",example:"F2=1",require:0,repeat:1},{name:"formula.functionList.IFS.functionParameter.valueIfTrue2.name",detail:"formula.functionList.IFS.functionParameter.valueIfTrue2.detail",example:"D2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.LAMBDA,functionType:t.FunctionType.Logical,description:"formula.functionList.LAMBDA.description",abstract:"formula.functionList.LAMBDA.abstract",functionParameter:[{name:"formula.functionList.LAMBDA.functionParameter.parameter.name",detail:"formula.functionList.LAMBDA.functionParameter.parameter.detail",example:"[x, y, …,]",require:0,repeat:1},{name:"formula.functionList.LAMBDA.functionParameter.calculation.name",detail:"formula.functionList.LAMBDA.functionParameter.calculation.detail",example:"x+y",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.LET,functionType:t.FunctionType.Logical,description:"formula.functionList.LET.description",abstract:"formula.functionList.LET.abstract",functionParameter:[{name:"formula.functionList.LET.functionParameter.name1.name",detail:"formula.functionList.LET.functionParameter.name1.detail",example:"x",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.nameValue1.name",detail:"formula.functionList.LET.functionParameter.nameValue1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.calculationOrName2.name",detail:"formula.functionList.LET.functionParameter.calculationOrName2.detail",example:"y",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.nameValue2.name",detail:"formula.functionList.LET.functionParameter.nameValue2.detail",example:"6",require:0,repeat:1},{name:"formula.functionList.LET.functionParameter.calculationOrName3.name",detail:"formula.functionList.LET.functionParameter.calculationOrName3.detail",example:"SUM(x,y)",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.MAKEARRAY,aliasFunctionName:"formula.functionList.MAKEARRAY.aliasFunctionName",functionType:t.FunctionType.Logical,description:"formula.functionList.MAKEARRAY.description",abstract:"formula.functionList.MAKEARRAY.abstract",functionParameter:[{name:"formula.functionList.MAKEARRAY.functionParameter.number1.name",detail:"formula.functionList.MAKEARRAY.functionParameter.number1.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.MAKEARRAY.functionParameter.number2.name",detail:"formula.functionList.MAKEARRAY.functionParameter.number2.detail",example:"7",require:1,repeat:0},{name:"formula.functionList.MAKEARRAY.functionParameter.value3.name",detail:"formula.functionList.MAKEARRAY.functionParameter.value3.detail",example:"LAMBDA(r,c, r*c)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.MAP,functionType:t.FunctionType.Logical,description:"formula.functionList.MAP.description",abstract:"formula.functionList.MAP.abstract",functionParameter:[{name:"formula.functionList.MAP.functionParameter.array1.name",detail:"formula.functionList.MAP.functionParameter.array1.detail",example:"D2:D11",require:1,repeat:0},{name:"formula.functionList.MAP.functionParameter.array2.name",detail:"formula.functionList.MAP.functionParameter.array2.detail",example:"E2:E11",require:0,repeat:1},{name:"formula.functionList.MAP.functionParameter.lambda.name",detail:"formula.functionList.MAP.functionParameter.lambda.detail",example:'LAMBDA(s,c,AND(s="Large",c="Red"))',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.NOT,functionType:t.FunctionType.Logical,description:"formula.functionList.NOT.description",abstract:"formula.functionList.NOT.abstract",functionParameter:[{name:"formula.functionList.NOT.functionParameter.logical.name",detail:"formula.functionList.NOT.functionParameter.logical.detail",example:"A2>100",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.OR,functionType:t.FunctionType.Logical,description:"formula.functionList.OR.description",abstract:"formula.functionList.OR.abstract",functionParameter:[{name:"formula.functionList.OR.functionParameter.logical1.name",detail:"formula.functionList.OR.functionParameter.logical1.detail",example:"A1=1",require:1,repeat:0},{name:"formula.functionList.OR.functionParameter.logical2.name",detail:"formula.functionList.OR.functionParameter.logical2.detail",example:"A2=2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.REDUCE,functionType:t.FunctionType.Logical,description:"formula.functionList.REDUCE.description",abstract:"formula.functionList.REDUCE.abstract",functionParameter:[{name:"formula.functionList.REDUCE.functionParameter.initialValue.name",detail:"formula.functionList.REDUCE.functionParameter.initialValue.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.REDUCE.functionParameter.array.name",detail:"formula.functionList.REDUCE.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.REDUCE.functionParameter.lambda.name",detail:"formula.functionList.REDUCE.functionParameter.lambda.detail",example:"LAMBDA(a,b,a+b^2)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.SCAN,functionType:t.FunctionType.Logical,description:"formula.functionList.SCAN.description",abstract:"formula.functionList.SCAN.abstract",functionParameter:[{name:"formula.functionList.SCAN.functionParameter.initialValue.name",detail:"formula.functionList.SCAN.functionParameter.initialValue.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SCAN.functionParameter.array.name",detail:"formula.functionList.SCAN.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.SCAN.functionParameter.lambda.name",detail:"formula.functionList.SCAN.functionParameter.lambda.detail",example:"LAMBDA(a,b,a+b^2)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.SWITCH,functionType:t.FunctionType.Logical,description:"formula.functionList.SWITCH.description",abstract:"formula.functionList.SWITCH.abstract",functionParameter:[{name:"formula.functionList.SWITCH.functionParameter.expression.name",detail:"formula.functionList.SWITCH.functionParameter.expression.detail",example:"WEEKDAY(A2)",require:1,repeat:0},{name:"formula.functionList.SWITCH.functionParameter.value1.name",detail:"formula.functionList.SWITCH.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SWITCH.functionParameter.result1.name",detail:"formula.functionList.SWITCH.functionParameter.result1.detail",example:'"Sunday"',require:1,repeat:0},{name:"formula.functionList.SWITCH.functionParameter.defaultOrValue2.name",detail:"formula.functionList.SWITCH.functionParameter.defaultOrValue2.detail",example:"2",require:0,repeat:1},{name:"formula.functionList.SWITCH.functionParameter.result2.name",detail:"formula.functionList.SWITCH.functionParameter.result2.detail",example:'"Monday"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.TRUE,functionType:t.FunctionType.Logical,description:"formula.functionList.TRUE.description",abstract:"formula.functionList.TRUE.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_LOGICAL.XOR,functionType:t.FunctionType.Logical,description:"formula.functionList.XOR.description",abstract:"formula.functionList.XOR.abstract",functionParameter:[{name:"formula.functionList.XOR.functionParameter.logical1.name",detail:"formula.functionList.XOR.functionParameter.logical1.detail",example:"3>0",require:1,repeat:0},{name:"formula.functionList.XOR.functionParameter.logical2.name",detail:"formula.functionList.XOR.functionParameter.logical2.detail",example:"2<9",require:0,repeat:1}]}],We=[{functionName:t.FUNCTION_NAMES_LOOKUP.ADDRESS,functionType:t.FunctionType.Lookup,description:"formula.functionList.ADDRESS.description",abstract:"formula.functionList.ADDRESS.abstract",functionParameter:[{name:"formula.functionList.ADDRESS.functionParameter.row_num.name",detail:"formula.functionList.ADDRESS.functionParameter.row_num.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.column_num.name",detail:"formula.functionList.ADDRESS.functionParameter.column_num.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.abs_num.name",detail:"formula.functionList.ADDRESS.functionParameter.abs_num.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.a1.name",detail:"formula.functionList.ADDRESS.functionParameter.a1.detail",example:"TRUE",require:0,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.sheet_text.name",detail:"formula.functionList.ADDRESS.functionParameter.sheet_text.detail",example:'"Sheet2"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.AREAS,functionType:t.FunctionType.Lookup,description:"formula.functionList.AREAS.description",abstract:"formula.functionList.AREAS.abstract",functionParameter:[{name:"formula.functionList.AREAS.functionParameter.reference.name",detail:"formula.functionList.AREAS.functionParameter.reference.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.CHOOSE,functionType:t.FunctionType.Lookup,description:"formula.functionList.CHOOSE.description",abstract:"formula.functionList.CHOOSE.abstract",functionParameter:[{name:"formula.functionList.CHOOSE.functionParameter.indexNum.name",detail:"formula.functionList.CHOOSE.functionParameter.indexNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHOOSE.functionParameter.value1.name",detail:"formula.functionList.CHOOSE.functionParameter.value1.detail",example:'"Hello"',require:1,repeat:0},{name:"formula.functionList.CHOOSE.functionParameter.value2.name",detail:"formula.functionList.CHOOSE.functionParameter.value2.detail",example:'"Univer"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.CHOOSECOLS,functionType:t.FunctionType.Lookup,description:"formula.functionList.CHOOSECOLS.description",abstract:"formula.functionList.CHOOSECOLS.abstract",functionParameter:[{name:"formula.functionList.CHOOSECOLS.functionParameter.array.name",detail:"formula.functionList.CHOOSECOLS.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.CHOOSECOLS.functionParameter.colNum1.name",detail:"formula.functionList.CHOOSECOLS.functionParameter.colNum1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHOOSECOLS.functionParameter.colNum2.name",detail:"formula.functionList.CHOOSECOLS.functionParameter.colNum2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.CHOOSEROWS,functionType:t.FunctionType.Lookup,description:"formula.functionList.CHOOSEROWS.description",abstract:"formula.functionList.CHOOSEROWS.abstract",functionParameter:[{name:"formula.functionList.CHOOSEROWS.functionParameter.array.name",detail:"formula.functionList.CHOOSEROWS.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.CHOOSEROWS.functionParameter.rowNum1.name",detail:"formula.functionList.CHOOSEROWS.functionParameter.rowNum1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHOOSEROWS.functionParameter.rowNum2.name",detail:"formula.functionList.CHOOSEROWS.functionParameter.rowNum2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.COLUMN,functionType:t.FunctionType.Lookup,description:"formula.functionList.COLUMN.description",abstract:"formula.functionList.COLUMN.abstract",functionParameter:[{name:"formula.functionList.COLUMN.functionParameter.reference.name",detail:"formula.functionList.COLUMN.functionParameter.reference.detail",example:"A1:A20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.COLUMNS,functionType:t.FunctionType.Lookup,description:"formula.functionList.COLUMNS.description",abstract:"formula.functionList.COLUMNS.abstract",functionParameter:[{name:"formula.functionList.COLUMNS.functionParameter.array.name",detail:"formula.functionList.COLUMNS.functionParameter.array.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.DROP,functionType:t.FunctionType.Lookup,description:"formula.functionList.DROP.description",abstract:"formula.functionList.DROP.abstract",functionParameter:[{name:"formula.functionList.DROP.functionParameter.array.name",detail:"formula.functionList.DROP.functionParameter.array.detail",example:"A2:C4",require:1,repeat:0},{name:"formula.functionList.DROP.functionParameter.rows.name",detail:"formula.functionList.DROP.functionParameter.rows.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.DROP.functionParameter.columns.name",detail:"formula.functionList.DROP.functionParameter.columns.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.EXPAND,functionType:t.FunctionType.Lookup,description:"formula.functionList.EXPAND.description",abstract:"formula.functionList.EXPAND.abstract",functionParameter:[{name:"formula.functionList.EXPAND.functionParameter.array.name",detail:"formula.functionList.EXPAND.functionParameter.array.detail",example:"A2",require:1,repeat:0},{name:"formula.functionList.EXPAND.functionParameter.rows.name",detail:"formula.functionList.EXPAND.functionParameter.rows.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.EXPAND.functionParameter.columns.name",detail:"formula.functionList.EXPAND.functionParameter.columns.detail",example:"3",require:0,repeat:0},{name:"formula.functionList.EXPAND.functionParameter.padWith.name",detail:"formula.functionList.EXPAND.functionParameter.padWith.detail",example:'"-"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.FILTER,functionType:t.FunctionType.Lookup,description:"formula.functionList.FILTER.description",abstract:"formula.functionList.FILTER.abstract",functionParameter:[{name:"formula.functionList.FILTER.functionParameter.array.name",detail:"formula.functionList.FILTER.functionParameter.array.detail",example:"A5:D20",require:1,repeat:0},{name:"formula.functionList.FILTER.functionParameter.include.name",detail:"formula.functionList.FILTER.functionParameter.include.detail",example:'(C5:C20="Apple")*(A5:A20="East")',require:1,repeat:0},{name:"formula.functionList.FILTER.functionParameter.ifEmpty.name",detail:"formula.functionList.FILTER.functionParameter.ifEmpty.detail",example:'""',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.FORMULATEXT,functionType:t.FunctionType.Lookup,description:"formula.functionList.FORMULATEXT.description",abstract:"formula.functionList.FORMULATEXT.abstract",functionParameter:[{name:"formula.functionList.FORMULATEXT.functionParameter.reference.name",detail:"formula.functionList.FORMULATEXT.functionParameter.reference.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.GETPIVOTDATA,functionType:t.FunctionType.Lookup,description:"formula.functionList.GETPIVOTDATA.description",abstract:"formula.functionList.GETPIVOTDATA.abstract",functionParameter:[{name:"formula.functionList.GETPIVOTDATA.functionParameter.number1.name",detail:"formula.functionList.GETPIVOTDATA.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.GETPIVOTDATA.functionParameter.number2.name",detail:"formula.functionList.GETPIVOTDATA.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.HLOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.HLOOKUP.description",abstract:"formula.functionList.HLOOKUP.abstract",functionParameter:[{name:"formula.functionList.HLOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.HLOOKUP.functionParameter.lookupValue.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.HLOOKUP.functionParameter.tableArray.name",detail:"formula.functionList.HLOOKUP.functionParameter.tableArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.HLOOKUP.functionParameter.rowIndexNum.name",detail:"formula.functionList.HLOOKUP.functionParameter.rowIndexNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HLOOKUP.functionParameter.rangeLookup.name",detail:"formula.functionList.HLOOKUP.functionParameter.rangeLookup.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.HSTACK,functionType:t.FunctionType.Lookup,description:"formula.functionList.HSTACK.description",abstract:"formula.functionList.HSTACK.abstract",functionParameter:[{name:"formula.functionList.HSTACK.functionParameter.array1.name",detail:"formula.functionList.HSTACK.functionParameter.array1.detail",example:"A2:C3",require:1,repeat:0},{name:"formula.functionList.HSTACK.functionParameter.array2.name",detail:"formula.functionList.HSTACK.functionParameter.array2.detail",example:"E2:G3",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.HYPERLINK,functionType:t.FunctionType.Lookup,description:"formula.functionList.HYPERLINK.description",abstract:"formula.functionList.HYPERLINK.abstract",functionParameter:[{name:"formula.functionList.HYPERLINK.functionParameter.number1.name",detail:"formula.functionList.HYPERLINK.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.HYPERLINK.functionParameter.number2.name",detail:"formula.functionList.HYPERLINK.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.IMAGE,functionType:t.FunctionType.Lookup,description:"formula.functionList.IMAGE.description",abstract:"formula.functionList.IMAGE.abstract",functionParameter:[{name:"formula.functionList.IMAGE.functionParameter.number1.name",detail:"formula.functionList.IMAGE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.IMAGE.functionParameter.number2.name",detail:"formula.functionList.IMAGE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.INDEX,functionType:t.FunctionType.Lookup,description:"formula.functionList.INDEX.description",abstract:"formula.functionList.INDEX.abstract",functionParameter:[{name:"formula.functionList.INDEX.functionParameter.reference.name",detail:"formula.functionList.INDEX.functionParameter.reference.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.INDEX.functionParameter.rowNum.name",detail:"formula.functionList.INDEX.functionParameter.rowNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.INDEX.functionParameter.columnNum.name",detail:"formula.functionList.INDEX.functionParameter.columnNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.INDEX.functionParameter.areaNum.name",detail:"formula.functionList.INDEX.functionParameter.areaNum.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.INDIRECT,functionType:t.FunctionType.Lookup,description:"formula.functionList.INDIRECT.description",abstract:"formula.functionList.INDIRECT.abstract",functionParameter:[{name:"formula.functionList.INDIRECT.functionParameter.refText.name",detail:"formula.functionList.INDIRECT.functionParameter.refText.detail",example:'"A1"',require:1,repeat:0},{name:"formula.functionList.INDIRECT.functionParameter.a1.name",detail:"formula.functionList.INDIRECT.functionParameter.a1.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.LOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.LOOKUP.description",abstract:"formula.functionList.LOOKUP.abstract",functionParameter:[{name:"formula.functionList.LOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.LOOKUP.functionParameter.lookupValue.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.LOOKUP.functionParameter.lookupVectorOrArray.name",detail:"formula.functionList.LOOKUP.functionParameter.lookupVectorOrArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.LOOKUP.functionParameter.resultVector.name",detail:"formula.functionList.LOOKUP.functionParameter.resultVector.detail",example:"A1:A20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.MATCH,functionType:t.FunctionType.Lookup,description:"formula.functionList.MATCH.description",abstract:"formula.functionList.MATCH.abstract",functionParameter:[{name:"formula.functionList.MATCH.functionParameter.lookupValue.name",detail:"formula.functionList.MATCH.functionParameter.lookupValue.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.MATCH.functionParameter.lookupArray.name",detail:"formula.functionList.MATCH.functionParameter.lookupArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MATCH.functionParameter.matchType.name",detail:"formula.functionList.MATCH.functionParameter.matchType.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.OFFSET,functionType:t.FunctionType.Lookup,description:"formula.functionList.OFFSET.description",abstract:"formula.functionList.OFFSET.abstract",functionParameter:[{name:"formula.functionList.OFFSET.functionParameter.reference.name",detail:"formula.functionList.OFFSET.functionParameter.reference.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.rows.name",detail:"formula.functionList.OFFSET.functionParameter.rows.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.cols.name",detail:"formula.functionList.OFFSET.functionParameter.cols.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.height.name",detail:"formula.functionList.OFFSET.functionParameter.height.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.width.name",detail:"formula.functionList.OFFSET.functionParameter.width.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.ROW,functionType:t.FunctionType.Lookup,description:"formula.functionList.ROW.description",abstract:"formula.functionList.ROW.abstract",functionParameter:[{name:"formula.functionList.ROW.functionParameter.reference.name",detail:"formula.functionList.ROW.functionParameter.reference.detail",example:"A1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.ROWS,functionType:t.FunctionType.Lookup,description:"formula.functionList.ROWS.description",abstract:"formula.functionList.ROWS.abstract",functionParameter:[{name:"formula.functionList.ROWS.functionParameter.array.name",detail:"formula.functionList.ROWS.functionParameter.array.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.RTD,functionType:t.FunctionType.Lookup,description:"formula.functionList.RTD.description",abstract:"formula.functionList.RTD.abstract",functionParameter:[{name:"formula.functionList.RTD.functionParameter.number1.name",detail:"formula.functionList.RTD.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.RTD.functionParameter.number2.name",detail:"formula.functionList.RTD.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.SORT,functionType:t.FunctionType.Lookup,description:"formula.functionList.SORT.description",abstract:"formula.functionList.SORT.abstract",functionParameter:[{name:"formula.functionList.SORT.functionParameter.array.name",detail:"formula.functionList.SORT.functionParameter.array.detail",example:"A2:A17",require:1,repeat:0},{name:"formula.functionList.SORT.functionParameter.sortIndex.name",detail:"formula.functionList.SORT.functionParameter.sortIndex.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.SORT.functionParameter.sortOrder.name",detail:"formula.functionList.SORT.functionParameter.sortOrder.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.SORT.functionParameter.byCol.name",detail:"formula.functionList.SORT.functionParameter.byCol.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.SORTBY,functionType:t.FunctionType.Lookup,description:"formula.functionList.SORTBY.description",abstract:"formula.functionList.SORTBY.abstract",functionParameter:[{name:"formula.functionList.SORTBY.functionParameter.array.name",detail:"formula.functionList.SORTBY.functionParameter.array.detail",example:"D2:D9",require:1,repeat:0},{name:"formula.functionList.SORTBY.functionParameter.byArray1.name",detail:"formula.functionList.SORTBY.functionParameter.byArray1.detail",example:"E2:E9",require:1,repeat:0},{name:"formula.functionList.SORTBY.functionParameter.sortOrder1.name",detail:"formula.functionList.SORTBY.functionParameter.sortOrder1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SORTBY.functionParameter.byArray2.name",detail:"formula.functionList.SORTBY.functionParameter.byArray2.detail",example:"E2:E9",require:0,repeat:1},{name:"formula.functionList.SORTBY.functionParameter.sortOrder2.name",detail:"formula.functionList.SORTBY.functionParameter.sortOrder2.detail",example:"1",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TAKE,functionType:t.FunctionType.Lookup,description:"formula.functionList.TAKE.description",abstract:"formula.functionList.TAKE.abstract",functionParameter:[{name:"formula.functionList.TAKE.functionParameter.array.name",detail:"formula.functionList.TAKE.functionParameter.array.detail",example:"A2:C4",require:1,repeat:0},{name:"formula.functionList.TAKE.functionParameter.rows.name",detail:"formula.functionList.TAKE.functionParameter.rows.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.TAKE.functionParameter.columns.name",detail:"formula.functionList.TAKE.functionParameter.columns.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TOCOL,functionType:t.FunctionType.Lookup,description:"formula.functionList.TOCOL.description",abstract:"formula.functionList.TOCOL.abstract",functionParameter:[{name:"formula.functionList.TOCOL.functionParameter.array.name",detail:"formula.functionList.TOCOL.functionParameter.array.detail",example:"A2:D4",require:1,repeat:0},{name:"formula.functionList.TOCOL.functionParameter.ignore.name",detail:"formula.functionList.TOCOL.functionParameter.ignore.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TOCOL.functionParameter.scanByColumn.name",detail:"formula.functionList.TOCOL.functionParameter.scanByColumn.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TOROW,functionType:t.FunctionType.Lookup,description:"formula.functionList.TOROW.description",abstract:"formula.functionList.TOROW.abstract",functionParameter:[{name:"formula.functionList.TOROW.functionParameter.array.name",detail:"formula.functionList.TOROW.functionParameter.array.detail",example:"A2:D4",require:1,repeat:0},{name:"formula.functionList.TOROW.functionParameter.ignore.name",detail:"formula.functionList.TOROW.functionParameter.ignore.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TOROW.functionParameter.scanByColumn.name",detail:"formula.functionList.TOROW.functionParameter.scanByColumn.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TRANSPOSE,functionType:t.FunctionType.Lookup,description:"formula.functionList.TRANSPOSE.description",abstract:"formula.functionList.TRANSPOSE.abstract",functionParameter:[{name:"formula.functionList.TRANSPOSE.functionParameter.array.name",detail:"formula.functionList.TRANSPOSE.functionParameter.array.detail",example:"A2:F9",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.UNIQUE,functionType:t.FunctionType.Lookup,description:"formula.functionList.UNIQUE.description",abstract:"formula.functionList.UNIQUE.abstract",functionParameter:[{name:"formula.functionList.UNIQUE.functionParameter.array.name",detail:"formula.functionList.UNIQUE.functionParameter.array.detail",example:"A2:A12",require:1,repeat:0},{name:"formula.functionList.UNIQUE.functionParameter.byCol.name",detail:"formula.functionList.UNIQUE.functionParameter.byCol.detail",example:"false",require:0,repeat:0},{name:"formula.functionList.UNIQUE.functionParameter.exactlyOnce.name",detail:"formula.functionList.UNIQUE.functionParameter.exactlyOnce.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.VLOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.VLOOKUP.description",abstract:"formula.functionList.VLOOKUP.abstract",functionParameter:[{name:"formula.functionList.VLOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.VLOOKUP.functionParameter.lookupValue.detail",example:"B2",require:1,repeat:0},{name:"formula.functionList.VLOOKUP.functionParameter.tableArray.name",detail:"formula.functionList.VLOOKUP.functionParameter.tableArray.detail",example:"C2:E7",require:1,repeat:0},{name:"formula.functionList.VLOOKUP.functionParameter.colIndexNum.name",detail:"formula.functionList.VLOOKUP.functionParameter.colIndexNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VLOOKUP.functionParameter.rangeLookup.name",detail:"formula.functionList.VLOOKUP.functionParameter.rangeLookup.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.VSTACK,functionType:t.FunctionType.Lookup,description:"formula.functionList.VSTACK.description",abstract:"formula.functionList.VSTACK.abstract",functionParameter:[{name:"formula.functionList.VSTACK.functionParameter.array1.name",detail:"formula.functionList.VSTACK.functionParameter.array1.detail",example:"A2:C3",require:1,repeat:0},{name:"formula.functionList.VSTACK.functionParameter.array2.name",detail:"formula.functionList.VSTACK.functionParameter.array2.detail",example:"E2:G3",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.WRAPCOLS,functionType:t.FunctionType.Lookup,description:"formula.functionList.WRAPCOLS.description",abstract:"formula.functionList.WRAPCOLS.abstract",functionParameter:[{name:"formula.functionList.WRAPCOLS.functionParameter.vector.name",detail:"formula.functionList.WRAPCOLS.functionParameter.vector.detail",example:"A2:G2",require:1,repeat:0},{name:"formula.functionList.WRAPCOLS.functionParameter.wrapCount.name",detail:"formula.functionList.WRAPCOLS.functionParameter.wrapCount.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.WRAPCOLS.functionParameter.padWith.name",detail:"formula.functionList.WRAPCOLS.functionParameter.padWith.detail",example:'"x"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.WRAPROWS,functionType:t.FunctionType.Lookup,description:"formula.functionList.WRAPROWS.description",abstract:"formula.functionList.WRAPROWS.abstract",functionParameter:[{name:"formula.functionList.WRAPROWS.functionParameter.vector.name",detail:"formula.functionList.WRAPROWS.functionParameter.vector.detail",example:"A2:G2",require:1,repeat:0},{name:"formula.functionList.WRAPROWS.functionParameter.wrapCount.name",detail:"formula.functionList.WRAPROWS.functionParameter.wrapCount.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.WRAPROWS.functionParameter.padWith.name",detail:"formula.functionList.WRAPROWS.functionParameter.padWith.detail",example:'"x"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.XLOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.XLOOKUP.description",abstract:"formula.functionList.XLOOKUP.abstract",functionParameter:[{name:"formula.functionList.XLOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.XLOOKUP.functionParameter.lookupValue.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.lookupArray.name",detail:"formula.functionList.XLOOKUP.functionParameter.lookupArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.returnArray.name",detail:"formula.functionList.XLOOKUP.functionParameter.returnArray.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.ifNotFound.name",detail:"formula.functionList.XLOOKUP.functionParameter.ifNotFound.detail",example:"default",require:0,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.matchMode.name",detail:"formula.functionList.XLOOKUP.functionParameter.matchMode.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.searchMode.name",detail:"formula.functionList.XLOOKUP.functionParameter.searchMode.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.XMATCH,functionType:t.FunctionType.Lookup,description:"formula.functionList.XMATCH.description",abstract:"formula.functionList.XMATCH.abstract",functionParameter:[{name:"formula.functionList.XMATCH.functionParameter.lookupValue.name",detail:"formula.functionList.XMATCH.functionParameter.lookupValue.detail",example:"B1",require:1,repeat:0},{name:"formula.functionList.XMATCH.functionParameter.lookupArray.name",detail:"formula.functionList.XMATCH.functionParameter.lookupArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.XMATCH.functionParameter.matchMode.name",detail:"formula.functionList.XMATCH.functionParameter.matchMode.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.XMATCH.functionParameter.searchMode.name",detail:"formula.functionList.XMATCH.functionParameter.searchMode.detail",example:"1",require:0,repeat:0}]}],Ke=[{functionName:t.FUNCTION_NAMES_MATH.ABS,functionType:t.FunctionType.Math,description:"formula.functionList.ABS.description",abstract:"formula.functionList.ABS.abstract",functionParameter:[{name:"formula.functionList.ABS.functionParameter.number.name",detail:"formula.functionList.ABS.functionParameter.number.detail",example:"-2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOS,functionType:t.FunctionType.Math,description:"formula.functionList.ACOS.description",abstract:"formula.functionList.ACOS.abstract",functionParameter:[{name:"formula.functionList.ACOS.functionParameter.number.name",detail:"formula.functionList.ACOS.functionParameter.number.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOSH,functionType:t.FunctionType.Math,description:"formula.functionList.ACOSH.description",abstract:"formula.functionList.ACOSH.abstract",functionParameter:[{name:"formula.functionList.ACOSH.functionParameter.number.name",detail:"formula.functionList.ACOSH.functionParameter.number.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOT,functionType:t.FunctionType.Math,description:"formula.functionList.ACOT.description",abstract:"formula.functionList.ACOT.abstract",functionParameter:[{name:"formula.functionList.ACOT.functionParameter.number.name",detail:"formula.functionList.ACOT.functionParameter.number.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOTH,functionType:t.FunctionType.Math,description:"formula.functionList.ACOTH.description",abstract:"formula.functionList.ACOTH.abstract",functionParameter:[{name:"formula.functionList.ACOTH.functionParameter.number.name",detail:"formula.functionList.ACOTH.functionParameter.number.detail",example:"6",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.AGGREGATE,functionType:t.FunctionType.Math,description:"formula.functionList.AGGREGATE.description",abstract:"formula.functionList.AGGREGATE.abstract",functionParameter:[{name:"formula.functionList.AGGREGATE.functionParameter.number1.name",detail:"formula.functionList.AGGREGATE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AGGREGATE.functionParameter.number2.name",detail:"formula.functionList.AGGREGATE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ARABIC,functionType:t.FunctionType.Math,description:"formula.functionList.ARABIC.description",abstract:"formula.functionList.ARABIC.abstract",functionParameter:[{name:"formula.functionList.ARABIC.functionParameter.text.name",detail:"formula.functionList.ARABIC.functionParameter.text.detail",example:'"LVII"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ASIN,functionType:t.FunctionType.Math,description:"formula.functionList.ASIN.description",abstract:"formula.functionList.ASIN.abstract",functionParameter:[{name:"formula.functionList.ASIN.functionParameter.number.name",detail:"formula.functionList.ASIN.functionParameter.number.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ASINH,functionType:t.FunctionType.Math,description:"formula.functionList.ASINH.description",abstract:"formula.functionList.ASINH.abstract",functionParameter:[{name:"formula.functionList.ASINH.functionParameter.number.name",detail:"formula.functionList.ASINH.functionParameter.number.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ATAN,functionType:t.FunctionType.Math,description:"formula.functionList.ATAN.description",abstract:"formula.functionList.ATAN.abstract",functionParameter:[{name:"formula.functionList.ATAN.functionParameter.number.name",detail:"formula.functionList.ATAN.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ATAN2,functionType:t.FunctionType.Math,description:"formula.functionList.ATAN2.description",abstract:"formula.functionList.ATAN2.abstract",functionParameter:[{name:"formula.functionList.ATAN2.functionParameter.xNum.name",detail:"formula.functionList.ATAN2.functionParameter.xNum.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.ATAN2.functionParameter.yNum.name",detail:"formula.functionList.ATAN2.functionParameter.yNum.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ATANH,functionType:t.FunctionType.Math,description:"formula.functionList.ATANH.description",abstract:"formula.functionList.ATANH.abstract",functionParameter:[{name:"formula.functionList.ATANH.functionParameter.number.name",detail:"formula.functionList.ATANH.functionParameter.number.detail",example:"0.1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.BASE,functionType:t.FunctionType.Math,description:"formula.functionList.BASE.description",abstract:"formula.functionList.BASE.abstract",functionParameter:[{name:"formula.functionList.BASE.functionParameter.number.name",detail:"formula.functionList.BASE.functionParameter.number.detail",example:"15",require:1,repeat:0},{name:"formula.functionList.BASE.functionParameter.radix.name",detail:"formula.functionList.BASE.functionParameter.radix.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.BASE.functionParameter.minLength.name",detail:"formula.functionList.BASE.functionParameter.minLength.detail",example:"10",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CEILING,functionType:t.FunctionType.Math,description:"formula.functionList.CEILING.description",abstract:"formula.functionList.CEILING.abstract",functionParameter:[{name:"formula.functionList.CEILING.functionParameter.number.name",detail:"formula.functionList.CEILING.functionParameter.number.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CEILING.functionParameter.significance.name",detail:"formula.functionList.CEILING.functionParameter.significance.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CEILING_MATH,functionType:t.FunctionType.Math,description:"formula.functionList.CEILING_MATH.description",abstract:"formula.functionList.CEILING_MATH.abstract",functionParameter:[{name:"formula.functionList.CEILING_MATH.functionParameter.number.name",detail:"formula.functionList.CEILING_MATH.functionParameter.number.detail",example:"-5.5",require:1,repeat:0},{name:"formula.functionList.CEILING_MATH.functionParameter.significance.name",detail:"formula.functionList.CEILING_MATH.functionParameter.significance.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.CEILING_MATH.functionParameter.mode.name",detail:"formula.functionList.CEILING_MATH.functionParameter.mode.detail",example:"-1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CEILING_PRECISE,functionType:t.FunctionType.Math,description:"formula.functionList.CEILING_PRECISE.description",abstract:"formula.functionList.CEILING_PRECISE.abstract",functionParameter:[{name:"formula.functionList.CEILING_PRECISE.functionParameter.number.name",detail:"formula.functionList.CEILING_PRECISE.functionParameter.number.detail",example:"4.3",require:1,repeat:0},{name:"formula.functionList.CEILING_PRECISE.functionParameter.significance.name",detail:"formula.functionList.CEILING_PRECISE.functionParameter.significance.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COMBIN,functionType:t.FunctionType.Math,description:"formula.functionList.COMBIN.description",abstract:"formula.functionList.COMBIN.abstract",functionParameter:[{name:"formula.functionList.COMBIN.functionParameter.number.name",detail:"formula.functionList.COMBIN.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.COMBIN.functionParameter.numberChosen.name",detail:"formula.functionList.COMBIN.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COMBINA,functionType:t.FunctionType.Math,description:"formula.functionList.COMBINA.description",abstract:"formula.functionList.COMBINA.abstract",functionParameter:[{name:"formula.functionList.COMBINA.functionParameter.number.name",detail:"formula.functionList.COMBINA.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.COMBINA.functionParameter.numberChosen.name",detail:"formula.functionList.COMBINA.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COS,functionType:t.FunctionType.Math,description:"formula.functionList.COS.description",abstract:"formula.functionList.COS.abstract",functionParameter:[{name:"formula.functionList.COS.functionParameter.number.name",detail:"formula.functionList.COS.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COSH,functionType:t.FunctionType.Math,description:"formula.functionList.COSH.description",abstract:"formula.functionList.COSH.abstract",functionParameter:[{name:"formula.functionList.COSH.functionParameter.number.name",detail:"formula.functionList.COSH.functionParameter.number.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COT,functionType:t.FunctionType.Math,description:"formula.functionList.COT.description",abstract:"formula.functionList.COT.abstract",functionParameter:[{name:"formula.functionList.COT.functionParameter.number.name",detail:"formula.functionList.COT.functionParameter.number.detail",example:"30",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COTH,functionType:t.FunctionType.Math,description:"formula.functionList.COTH.description",abstract:"formula.functionList.COTH.abstract",functionParameter:[{name:"formula.functionList.COTH.functionParameter.number.name",detail:"formula.functionList.COTH.functionParameter.number.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CSC,functionType:t.FunctionType.Math,description:"formula.functionList.CSC.description",abstract:"formula.functionList.CSC.abstract",functionParameter:[{name:"formula.functionList.CSC.functionParameter.number.name",detail:"formula.functionList.CSC.functionParameter.number.detail",example:"15",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CSCH,functionType:t.FunctionType.Math,description:"formula.functionList.CSCH.description",abstract:"formula.functionList.CSCH.abstract",functionParameter:[{name:"formula.functionList.CSCH.functionParameter.number.name",detail:"formula.functionList.CSCH.functionParameter.number.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.DECIMAL,functionType:t.FunctionType.Math,description:"formula.functionList.DECIMAL.description",abstract:"formula.functionList.DECIMAL.abstract",functionParameter:[{name:"formula.functionList.DECIMAL.functionParameter.text.name",detail:"formula.functionList.DECIMAL.functionParameter.text.detail",example:'"FF"',require:1,repeat:0},{name:"formula.functionList.DECIMAL.functionParameter.radix.name",detail:"formula.functionList.DECIMAL.functionParameter.radix.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.DEGREES,functionType:t.FunctionType.Math,description:"formula.functionList.DEGREES.description",abstract:"formula.functionList.DEGREES.abstract",functionParameter:[{name:"formula.functionList.DEGREES.functionParameter.angle.name",detail:"formula.functionList.DEGREES.functionParameter.angle.detail",example:"PI()",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.EVEN,functionType:t.FunctionType.Math,description:"formula.functionList.EVEN.description",abstract:"formula.functionList.EVEN.abstract",functionParameter:[{name:"formula.functionList.EVEN.functionParameter.number.name",detail:"formula.functionList.EVEN.functionParameter.number.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.EXP,functionType:t.FunctionType.Math,description:"formula.functionList.EXP.description",abstract:"formula.functionList.EXP.abstract",functionParameter:[{name:"formula.functionList.EXP.functionParameter.number.name",detail:"formula.functionList.EXP.functionParameter.number.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FACT,functionType:t.FunctionType.Math,description:"formula.functionList.FACT.description",abstract:"formula.functionList.FACT.abstract",functionParameter:[{name:"formula.functionList.FACT.functionParameter.number.name",detail:"formula.functionList.FACT.functionParameter.number.detail",example:"5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FACTDOUBLE,functionType:t.FunctionType.Math,description:"formula.functionList.FACTDOUBLE.description",abstract:"formula.functionList.FACTDOUBLE.abstract",functionParameter:[{name:"formula.functionList.FACTDOUBLE.functionParameter.number.name",detail:"formula.functionList.FACTDOUBLE.functionParameter.number.detail",example:"6",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FLOOR,functionType:t.FunctionType.Math,description:"formula.functionList.FLOOR.description",abstract:"formula.functionList.FLOOR.abstract",functionParameter:[{name:"formula.functionList.FLOOR.functionParameter.number.name",detail:"formula.functionList.FLOOR.functionParameter.number.detail",example:"3.7",require:1,repeat:0},{name:"formula.functionList.FLOOR.functionParameter.significance.name",detail:"formula.functionList.FLOOR.functionParameter.significance.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FLOOR_MATH,functionType:t.FunctionType.Math,description:"formula.functionList.FLOOR_MATH.description",abstract:"formula.functionList.FLOOR_MATH.abstract",functionParameter:[{name:"formula.functionList.FLOOR_MATH.functionParameter.number.name",detail:"formula.functionList.FLOOR_MATH.functionParameter.number.detail",example:"-5.5",require:1,repeat:0},{name:"formula.functionList.FLOOR_MATH.functionParameter.significance.name",detail:"formula.functionList.FLOOR_MATH.functionParameter.significance.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.FLOOR_MATH.functionParameter.mode.name",detail:"formula.functionList.FLOOR_MATH.functionParameter.mode.detail",example:"-1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FLOOR_PRECISE,functionType:t.FunctionType.Math,description:"formula.functionList.FLOOR_PRECISE.description",abstract:"formula.functionList.FLOOR_PRECISE.abstract",functionParameter:[{name:"formula.functionList.FLOOR_PRECISE.functionParameter.number.name",detail:"formula.functionList.FLOOR_PRECISE.functionParameter.number.detail",example:"-3.2",require:1,repeat:0},{name:"formula.functionList.FLOOR_PRECISE.functionParameter.significance.name",detail:"formula.functionList.FLOOR_PRECISE.functionParameter.significance.detail",example:"-1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.GCD,functionType:t.FunctionType.Math,description:"formula.functionList.GCD.description",abstract:"formula.functionList.GCD.abstract",functionParameter:[{name:"formula.functionList.GCD.functionParameter.number1.name",detail:"formula.functionList.GCD.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.GCD.functionParameter.number2.name",detail:"formula.functionList.GCD.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.INT,functionType:t.FunctionType.Math,description:"formula.functionList.INT.description",abstract:"formula.functionList.INT.abstract",functionParameter:[{name:"formula.functionList.INT.functionParameter.number.name",detail:"formula.functionList.INT.functionParameter.number.detail",example:"8.9",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ISO_CEILING,functionType:t.FunctionType.Math,description:"formula.functionList.ISO_CEILING.description",abstract:"formula.functionList.ISO_CEILING.abstract",functionParameter:[{name:"formula.functionList.ISO_CEILING.functionParameter.number1.name",detail:"formula.functionList.ISO_CEILING.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.ISO_CEILING.functionParameter.number2.name",detail:"formula.functionList.ISO_CEILING.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LCM,functionType:t.FunctionType.Math,description:"formula.functionList.LCM.description",abstract:"formula.functionList.LCM.abstract",functionParameter:[{name:"formula.functionList.LCM.functionParameter.number1.name",detail:"formula.functionList.LCM.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.LCM.functionParameter.number2.name",detail:"formula.functionList.LCM.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.LET,functionType:t.FunctionType.Math,description:"formula.functionList.LET.description",abstract:"formula.functionList.LET.abstract",functionParameter:[{name:"formula.functionList.LET.functionParameter.number1.name",detail:"formula.functionList.LET.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.number2.name",detail:"formula.functionList.LET.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LN,functionType:t.FunctionType.Math,description:"formula.functionList.LN.description",abstract:"formula.functionList.LN.abstract",functionParameter:[{name:"formula.functionList.LN.functionParameter.number.name",detail:"formula.functionList.LN.functionParameter.number.detail",example:"EXP(3)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LOG,functionType:t.FunctionType.Math,description:"formula.functionList.LOG.description",abstract:"formula.functionList.LOG.abstract",functionParameter:[{name:"formula.functionList.LOG.functionParameter.number.name",detail:"formula.functionList.LOG.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.LOG.functionParameter.base.name",detail:"formula.functionList.LOG.functionParameter.base.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LOG10,functionType:t.FunctionType.Math,description:"formula.functionList.LOG10.description",abstract:"formula.functionList.LOG10.abstract",functionParameter:[{name:"formula.functionList.LOG10.functionParameter.number.name",detail:"formula.functionList.LOG10.functionParameter.number.detail",example:"100000",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MDETERM,functionType:t.FunctionType.Math,description:"formula.functionList.MDETERM.description",abstract:"formula.functionList.MDETERM.abstract",functionParameter:[{name:"formula.functionList.MDETERM.functionParameter.array.name",detail:"formula.functionList.MDETERM.functionParameter.array.detail",example:"A1:C3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MINVERSE,functionType:t.FunctionType.Math,description:"formula.functionList.MINVERSE.description",abstract:"formula.functionList.MINVERSE.abstract",functionParameter:[{name:"formula.functionList.MINVERSE.functionParameter.array.name",detail:"formula.functionList.MINVERSE.functionParameter.array.detail",example:"A1:C3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MMULT,functionType:t.FunctionType.Math,description:"formula.functionList.MMULT.description",abstract:"formula.functionList.MMULT.abstract",functionParameter:[{name:"formula.functionList.MMULT.functionParameter.array1.name",detail:"formula.functionList.MMULT.functionParameter.array1.detail",example:"A2:B3",require:1,repeat:0},{name:"formula.functionList.MMULT.functionParameter.array2.name",detail:"formula.functionList.MMULT.functionParameter.array2.detail",example:"A5:B6",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MOD,functionType:t.FunctionType.Math,description:"formula.functionList.MOD.description",abstract:"formula.functionList.MOD.abstract",functionParameter:[{name:"formula.functionList.MOD.functionParameter.number.name",detail:"formula.functionList.MOD.functionParameter.number.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.MOD.functionParameter.divisor.name",detail:"formula.functionList.MOD.functionParameter.divisor.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MROUND,functionType:t.FunctionType.Math,description:"formula.functionList.MROUND.description",abstract:"formula.functionList.MROUND.abstract",functionParameter:[{name:"formula.functionList.MROUND.functionParameter.number.name",detail:"formula.functionList.MROUND.functionParameter.number.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.MROUND.functionParameter.multiple.name",detail:"formula.functionList.MROUND.functionParameter.multiple.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MULTINOMIAL,functionType:t.FunctionType.Math,description:"formula.functionList.MULTINOMIAL.description",abstract:"formula.functionList.MULTINOMIAL.abstract",functionParameter:[{name:"formula.functionList.MULTINOMIAL.functionParameter.number1.name",detail:"formula.functionList.MULTINOMIAL.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.MULTINOMIAL.functionParameter.number2.name",detail:"formula.functionList.MULTINOMIAL.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.MUNIT,functionType:t.FunctionType.Math,description:"formula.functionList.MUNIT.description",abstract:"formula.functionList.MUNIT.abstract",functionParameter:[{name:"formula.functionList.MUNIT.functionParameter.dimension.name",detail:"formula.functionList.MUNIT.functionParameter.dimension.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ODD,functionType:t.FunctionType.Math,description:"formula.functionList.ODD.description",abstract:"formula.functionList.ODD.abstract",functionParameter:[{name:"formula.functionList.ODD.functionParameter.number.name",detail:"formula.functionList.ODD.functionParameter.number.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.PI,functionType:t.FunctionType.Math,description:"formula.functionList.PI.description",abstract:"formula.functionList.PI.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_MATH.POWER,functionType:t.FunctionType.Math,description:"formula.functionList.POWER.description",abstract:"formula.functionList.POWER.abstract",functionParameter:[{name:"formula.functionList.POWER.functionParameter.number.name",detail:"formula.functionList.POWER.functionParameter.number.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.POWER.functionParameter.power.name",detail:"formula.functionList.POWER.functionParameter.power.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.PRODUCT,functionType:t.FunctionType.Math,description:"formula.functionList.PRODUCT.description",abstract:"formula.functionList.PRODUCT.abstract",functionParameter:[{name:"formula.functionList.PRODUCT.functionParameter.number1.name",detail:"formula.functionList.PRODUCT.functionParameter.number1.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.PRODUCT.functionParameter.number2.name",detail:"formula.functionList.PRODUCT.functionParameter.number2.detail",example:"A2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.QUOTIENT,functionType:t.FunctionType.Math,description:"formula.functionList.QUOTIENT.description",abstract:"formula.functionList.QUOTIENT.abstract",functionParameter:[{name:"formula.functionList.QUOTIENT.functionParameter.numerator.name",detail:"formula.functionList.QUOTIENT.functionParameter.numerator.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.QUOTIENT.functionParameter.denominator.name",detail:"formula.functionList.QUOTIENT.functionParameter.denominator.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.RADIANS,functionType:t.FunctionType.Math,description:"formula.functionList.RADIANS.description",abstract:"formula.functionList.RADIANS.abstract",functionParameter:[{name:"formula.functionList.RADIANS.functionParameter.angle.name",detail:"formula.functionList.RADIANS.functionParameter.angle.detail",example:"270",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.RAND,functionType:t.FunctionType.Math,description:"formula.functionList.RAND.description",abstract:"formula.functionList.RAND.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_MATH.RANDARRAY,functionType:t.FunctionType.Math,description:"formula.functionList.RANDARRAY.description",abstract:"formula.functionList.RANDARRAY.abstract",functionParameter:[{name:"formula.functionList.RANDARRAY.functionParameter.rows.name",detail:"formula.functionList.RANDARRAY.functionParameter.rows.detail",example:"5",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.columns.name",detail:"formula.functionList.RANDARRAY.functionParameter.columns.detail",example:"3",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.min.name",detail:"formula.functionList.RANDARRAY.functionParameter.min.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.max.name",detail:"formula.functionList.RANDARRAY.functionParameter.max.detail",example:"100",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.wholeNumber.name",detail:"formula.functionList.RANDARRAY.functionParameter.wholeNumber.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.RANDBETWEEN,functionType:t.FunctionType.Math,description:"formula.functionList.RANDBETWEEN.description",abstract:"formula.functionList.RANDBETWEEN.abstract",functionParameter:[{name:"formula.functionList.RANDBETWEEN.functionParameter.bottom.name",detail:"formula.functionList.RANDBETWEEN.functionParameter.bottom.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.RANDBETWEEN.functionParameter.top.name",detail:"formula.functionList.RANDBETWEEN.functionParameter.top.detail",example:"100",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROMAN,functionType:t.FunctionType.Math,description:"formula.functionList.ROMAN.description",abstract:"formula.functionList.ROMAN.abstract",functionParameter:[{name:"formula.functionList.ROMAN.functionParameter.number.name",detail:"formula.functionList.ROMAN.functionParameter.number.detail",example:"499",require:1,repeat:0},{name:"formula.functionList.ROMAN.functionParameter.form.name",detail:"formula.functionList.ROMAN.functionParameter.form.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUND,functionType:t.FunctionType.Math,description:"formula.functionList.ROUND.description",abstract:"formula.functionList.ROUND.abstract",functionParameter:[{name:"formula.functionList.ROUND.functionParameter.number.name",detail:"formula.functionList.ROUND.functionParameter.number.detail",example:"2.15",require:1,repeat:0},{name:"formula.functionList.ROUND.functionParameter.numDigits.name",detail:"formula.functionList.ROUND.functionParameter.numDigits.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUNDBANK,functionType:t.FunctionType.Math,description:"formula.functionList.ROUNDBANK.description",abstract:"formula.functionList.ROUNDBANK.abstract",functionParameter:[{name:"formula.functionList.ROUNDBANK.functionParameter.number.name",detail:"formula.functionList.ROUNDBANK.functionParameter.number.detail",example:"2.345",require:1,repeat:0},{name:"formula.functionList.ROUNDBANK.functionParameter.numDigits.name",detail:"formula.functionList.ROUNDBANK.functionParameter.numDigits.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUNDDOWN,functionType:t.FunctionType.Math,description:"formula.functionList.ROUNDDOWN.description",abstract:"formula.functionList.ROUNDDOWN.abstract",functionParameter:[{name:"formula.functionList.ROUNDDOWN.functionParameter.number.name",detail:"formula.functionList.ROUNDDOWN.functionParameter.number.detail",example:"3.2",require:1,repeat:0},{name:"formula.functionList.ROUNDDOWN.functionParameter.numDigits.name",detail:"formula.functionList.ROUNDDOWN.functionParameter.numDigits.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUNDUP,functionType:t.FunctionType.Math,description:"formula.functionList.ROUNDUP.description",abstract:"formula.functionList.ROUNDUP.abstract",functionParameter:[{name:"formula.functionList.ROUNDUP.functionParameter.number.name",detail:"formula.functionList.ROUNDUP.functionParameter.number.detail",example:"3.2",require:1,repeat:0},{name:"formula.functionList.ROUNDUP.functionParameter.numDigits.name",detail:"formula.functionList.ROUNDUP.functionParameter.numDigits.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SEC,functionType:t.FunctionType.Math,description:"formula.functionList.SEC.description",abstract:"formula.functionList.SEC.abstract",functionParameter:[{name:"formula.functionList.SEC.functionParameter.number.name",detail:"formula.functionList.SEC.functionParameter.number.detail",example:"30",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SECH,functionType:t.FunctionType.Math,description:"formula.functionList.SECH.description",abstract:"formula.functionList.SECH.abstract",functionParameter:[{name:"formula.functionList.SECH.functionParameter.number.name",detail:"formula.functionList.SECH.functionParameter.number.detail",example:"30",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SERIESSUM,functionType:t.FunctionType.Math,description:"formula.functionList.SERIESSUM.description",abstract:"formula.functionList.SERIESSUM.abstract",functionParameter:[{name:"formula.functionList.SERIESSUM.functionParameter.x.name",detail:"formula.functionList.SERIESSUM.functionParameter.x.detail",example:"0.785398163",require:1,repeat:0},{name:"formula.functionList.SERIESSUM.functionParameter.n.name",detail:"formula.functionList.SERIESSUM.functionParameter.n.detail",example:"0",require:1,repeat:0},{name:"formula.functionList.SERIESSUM.functionParameter.m.name",detail:"formula.functionList.SERIESSUM.functionParameter.m.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.SERIESSUM.functionParameter.coefficients.name",detail:"formula.functionList.SERIESSUM.functionParameter.coefficients.detail",example:"A1:A4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SEQUENCE,functionType:t.FunctionType.Math,description:"formula.functionList.SEQUENCE.description",abstract:"formula.functionList.SEQUENCE.abstract",functionParameter:[{name:"formula.functionList.SEQUENCE.functionParameter.rows.name",detail:"formula.functionList.SEQUENCE.functionParameter.rows.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.SEQUENCE.functionParameter.columns.name",detail:"formula.functionList.SEQUENCE.functionParameter.columns.detail",example:"5",require:0,repeat:0},{name:"formula.functionList.SEQUENCE.functionParameter.start.name",detail:"formula.functionList.SEQUENCE.functionParameter.start.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.SEQUENCE.functionParameter.step.name",detail:"formula.functionList.SEQUENCE.functionParameter.step.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SIGN,functionType:t.FunctionType.Math,description:"formula.functionList.SIGN.description",abstract:"formula.functionList.SIGN.abstract",functionParameter:[{name:"formula.functionList.SIGN.functionParameter.number.name",detail:"formula.functionList.SIGN.functionParameter.number.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SIN,functionType:t.FunctionType.Math,description:"formula.functionList.SIN.description",abstract:"formula.functionList.SIN.abstract",functionParameter:[{name:"formula.functionList.SIN.functionParameter.number.name",detail:"formula.functionList.SIN.functionParameter.number.detail",example:"30*PI()/180",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SINH,functionType:t.FunctionType.Math,description:"formula.functionList.SINH.description",abstract:"formula.functionList.SINH.abstract",functionParameter:[{name:"formula.functionList.SINH.functionParameter.number.name",detail:"formula.functionList.SINH.functionParameter.number.detail",example:"0.0342*1.03",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SQRT,functionType:t.FunctionType.Math,description:"formula.functionList.SQRT.description",abstract:"formula.functionList.SQRT.abstract",functionParameter:[{name:"formula.functionList.SQRT.functionParameter.number.name",detail:"formula.functionList.SQRT.functionParameter.number.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SQRTPI,functionType:t.FunctionType.Math,description:"formula.functionList.SQRTPI.description",abstract:"formula.functionList.SQRTPI.abstract",functionParameter:[{name:"formula.functionList.SQRTPI.functionParameter.number.name",detail:"formula.functionList.SQRTPI.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUBTOTAL,functionType:t.FunctionType.Math,description:"formula.functionList.SUBTOTAL.description",abstract:"formula.functionList.SUBTOTAL.abstract",functionParameter:[{name:"formula.functionList.SUBTOTAL.functionParameter.functionNum.name",detail:"formula.functionList.SUBTOTAL.functionParameter.functionNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SUBTOTAL.functionParameter.ref1.name",detail:"formula.functionList.SUBTOTAL.functionParameter.ref1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUBTOTAL.functionParameter.ref2.name",detail:"formula.functionList.SUBTOTAL.functionParameter.ref2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUM,aliasFunctionName:"formula.functionList.SUM.aliasFunctionName",functionType:t.FunctionType.Math,description:"formula.functionList.SUM.description",abstract:"formula.functionList.SUM.abstract",functionParameter:[{name:"formula.functionList.SUM.functionParameter.number1.name",detail:"formula.functionList.SUM.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUM.functionParameter.number2.name",detail:"formula.functionList.SUM.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMIF,aliasFunctionName:"formula.functionList.SUMIF.aliasFunctionName",functionType:t.FunctionType.Math,description:"formula.functionList.SUMIF.description",abstract:"formula.functionList.SUMIF.abstract",functionParameter:[{name:"formula.functionList.SUMIF.functionParameter.range.name",detail:"formula.functionList.SUMIF.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUMIF.functionParameter.criteria.name",detail:"formula.functionList.SUMIF.functionParameter.criteria.detail",example:'">5"',require:1,repeat:0},{name:"formula.functionList.SUMIF.functionParameter.sumRange.name",detail:"formula.functionList.SUMIF.functionParameter.sumRange.detail",example:"B1:B20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUMIFS,functionType:t.FunctionType.Math,description:"formula.functionList.SUMIFS.description",abstract:"formula.functionList.SUMIFS.abstract",functionParameter:[{name:"formula.functionList.SUMIFS.functionParameter.sumRange.name",detail:"formula.functionList.SUMIFS.functionParameter.sumRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUMIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.SUMIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.SUMIFS.functionParameter.criteria1.name",detail:"formula.functionList.SUMIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.SUMIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.SUMIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.SUMIFS.functionParameter.criteria2.name",detail:"formula.functionList.SUMIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMPRODUCT,functionType:t.FunctionType.Math,description:"formula.functionList.SUMPRODUCT.description",abstract:"formula.functionList.SUMPRODUCT.abstract",functionParameter:[{name:"formula.functionList.SUMPRODUCT.functionParameter.array1.name",detail:"formula.functionList.SUMPRODUCT.functionParameter.array1.detail",example:"C2:C5",require:1,repeat:0},{name:"formula.functionList.SUMPRODUCT.functionParameter.array2.name",detail:"formula.functionList.SUMPRODUCT.functionParameter.array2.detail",example:"D2:D5",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMSQ,functionType:t.FunctionType.Math,description:"formula.functionList.SUMSQ.description",abstract:"formula.functionList.SUMSQ.abstract",functionParameter:[{name:"formula.functionList.SUMSQ.functionParameter.number1.name",detail:"formula.functionList.SUMSQ.functionParameter.number1.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.SUMSQ.functionParameter.number2.name",detail:"formula.functionList.SUMSQ.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMX2MY2,functionType:t.FunctionType.Math,description:"formula.functionList.SUMX2MY2.description",abstract:"formula.functionList.SUMX2MY2.abstract",functionParameter:[{name:"formula.functionList.SUMX2MY2.functionParameter.arrayX.name",detail:"formula.functionList.SUMX2MY2.functionParameter.arrayX.detail",example:"A2:A8",require:1,repeat:0},{name:"formula.functionList.SUMX2MY2.functionParameter.arrayY.name",detail:"formula.functionList.SUMX2MY2.functionParameter.arrayY.detail",example:"B2:B8",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUMX2PY2,functionType:t.FunctionType.Math,description:"formula.functionList.SUMX2PY2.description",abstract:"formula.functionList.SUMX2PY2.abstract",functionParameter:[{name:"formula.functionList.SUMX2PY2.functionParameter.arrayX.name",detail:"formula.functionList.SUMX2PY2.functionParameter.arrayX.detail",example:"A2:A8",require:1,repeat:0},{name:"formula.functionList.SUMX2PY2.functionParameter.arrayY.name",detail:"formula.functionList.SUMX2PY2.functionParameter.arrayY.detail",example:"B2:B8",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUMXMY2,functionType:t.FunctionType.Math,description:"formula.functionList.SUMXMY2.description",abstract:"formula.functionList.SUMXMY2.abstract",functionParameter:[{name:"formula.functionList.SUMXMY2.functionParameter.arrayX.name",detail:"formula.functionList.SUMXMY2.functionParameter.arrayX.detail",example:"A2:A8",require:1,repeat:0},{name:"formula.functionList.SUMXMY2.functionParameter.arrayY.name",detail:"formula.functionList.SUMXMY2.functionParameter.arrayY.detail",example:"B2:B8",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.TAN,functionType:t.FunctionType.Math,description:"formula.functionList.TAN.description",abstract:"formula.functionList.TAN.abstract",functionParameter:[{name:"formula.functionList.TAN.functionParameter.number.name",detail:"formula.functionList.TAN.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.TANH,functionType:t.FunctionType.Math,description:"formula.functionList.TANH.description",abstract:"formula.functionList.TANH.abstract",functionParameter:[{name:"formula.functionList.TANH.functionParameter.number.name",detail:"formula.functionList.TANH.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.TRUNC,functionType:t.FunctionType.Math,description:"formula.functionList.TRUNC.description",abstract:"formula.functionList.TRUNC.abstract",functionParameter:[{name:"formula.functionList.TRUNC.functionParameter.number.name",detail:"formula.functionList.TRUNC.functionParameter.number.detail",example:"0.45",require:1,repeat:0},{name:"formula.functionList.TRUNC.functionParameter.numDigits.name",detail:"formula.functionList.TRUNC.functionParameter.numDigits.detail",example:"1",require:0,repeat:0}]}],ge=[{functionName:t.FUNCTION_NAMES_STATISTICAL.AVEDEV,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVEDEV.description",abstract:"formula.functionList.AVEDEV.abstract",functionParameter:[{name:"formula.functionList.AVEDEV.functionParameter.number1.name",detail:"formula.functionList.AVEDEV.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVEDEV.functionParameter.number2.name",detail:"formula.functionList.AVEDEV.functionParameter.number2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGE,aliasFunctionName:"formula.functionList.AVERAGE.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGE.description",abstract:"formula.functionList.AVERAGE.abstract",functionParameter:[{name:"formula.functionList.AVERAGE.functionParameter.number1.name",detail:"formula.functionList.AVERAGE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGE.functionParameter.number2.name",detail:"formula.functionList.AVERAGE.functionParameter.number2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGE_WEIGHTED,aliasFunctionName:"formula.functionList.AVERAGE_WEIGHTED.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGE_WEIGHTED.description",abstract:"formula.functionList.AVERAGE_WEIGHTED.abstract",functionParameter:[{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.values.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.values.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.weights.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.weights.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalValues.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalValues.detail",example:"20",require:0,repeat:1},{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalWeights.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalWeights.detail",example:"3",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGEA,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGEA.description",abstract:"formula.functionList.AVERAGEA.abstract",functionParameter:[{name:"formula.functionList.AVERAGEA.functionParameter.value1.name",detail:"formula.functionList.AVERAGEA.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGEA.functionParameter.value2.name",detail:"formula.functionList.AVERAGEA.functionParameter.value2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGEIF,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGEIF.description",abstract:"formula.functionList.AVERAGEIF.abstract",functionParameter:[{name:"formula.functionList.AVERAGEIF.functionParameter.range.name",detail:"formula.functionList.AVERAGEIF.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGEIF.functionParameter.criteria.name",detail:"formula.functionList.AVERAGEIF.functionParameter.criteria.detail",example:'">5"',require:1,repeat:0},{name:"formula.functionList.AVERAGEIF.functionParameter.averageRange.name",detail:"formula.functionList.AVERAGEIF.functionParameter.averageRange.detail",example:"B1:B20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGEIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGEIFS.description",abstract:"formula.functionList.AVERAGEIFS.abstract",functionParameter:[{name:"formula.functionList.AVERAGEIFS.functionParameter.averageRange.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.averageRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteria1.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteria2.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BETA_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.BETA_DIST.description",abstract:"formula.functionList.BETA_DIST.abstract",functionParameter:[{name:"formula.functionList.BETA_DIST.functionParameter.x.name",detail:"formula.functionList.BETA_DIST.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.alpha.name",detail:"formula.functionList.BETA_DIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.beta.name",detail:"formula.functionList.BETA_DIST.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.cumulative.name",detail:"formula.functionList.BETA_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.A.name",detail:"formula.functionList.BETA_DIST.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.B.name",detail:"formula.functionList.BETA_DIST.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BETA_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.BETA_INV.description",abstract:"formula.functionList.BETA_INV.abstract",functionParameter:[{name:"formula.functionList.BETA_INV.functionParameter.probability.name",detail:"formula.functionList.BETA_INV.functionParameter.probability.detail",example:"0.685470581",require:1,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.alpha.name",detail:"formula.functionList.BETA_INV.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.beta.name",detail:"formula.functionList.BETA_INV.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.A.name",detail:"formula.functionList.BETA_INV.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.B.name",detail:"formula.functionList.BETA_INV.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BINOM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.BINOM_DIST.description",abstract:"formula.functionList.BINOM_DIST.abstract",functionParameter:[{name:"formula.functionList.BINOM_DIST.functionParameter.numberS.name",detail:"formula.functionList.BINOM_DIST.functionParameter.numberS.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST.functionParameter.trials.name",detail:"formula.functionList.BINOM_DIST.functionParameter.trials.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST.functionParameter.probabilityS.name",detail:"formula.functionList.BINOM_DIST.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.BINOM_DIST.functionParameter.cumulative.detail",example:"false",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BINOM_DIST_RANGE,functionType:t.FunctionType.Statistical,description:"formula.functionList.BINOM_DIST_RANGE.description",abstract:"formula.functionList.BINOM_DIST_RANGE.abstract",functionParameter:[{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.trials.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.trials.detail",example:"60",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.probabilityS.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.probabilityS.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS.detail",example:"45",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS2.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS2.detail",example:"50",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BINOM_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.BINOM_INV.description",abstract:"formula.functionList.BINOM_INV.abstract",functionParameter:[{name:"formula.functionList.BINOM_INV.functionParameter.trials.name",detail:"formula.functionList.BINOM_INV.functionParameter.trials.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.BINOM_INV.functionParameter.probabilityS.name",detail:"formula.functionList.BINOM_INV.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.BINOM_INV.functionParameter.alpha.name",detail:"formula.functionList.BINOM_INV.functionParameter.alpha.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_DIST.description",abstract:"formula.functionList.CHISQ_DIST.abstract",functionParameter:[{name:"formula.functionList.CHISQ_DIST.functionParameter.x.name",detail:"formula.functionList.CHISQ_DIST.functionParameter.x.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CHISQ_DIST.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_DIST.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHISQ_DIST.functionParameter.cumulative.name",detail:"formula.functionList.CHISQ_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_DIST_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_DIST_RT.description",abstract:"formula.functionList.CHISQ_DIST_RT.abstract",functionParameter:[{name:"formula.functionList.CHISQ_DIST_RT.functionParameter.x.name",detail:"formula.functionList.CHISQ_DIST_RT.functionParameter.x.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CHISQ_DIST_RT.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_DIST_RT.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_INV.description",abstract:"formula.functionList.CHISQ_INV.abstract",functionParameter:[{name:"formula.functionList.CHISQ_INV.functionParameter.probability.name",detail:"formula.functionList.CHISQ_INV.functionParameter.probability.detail",example:"0.93",require:1,repeat:0},{name:"formula.functionList.CHISQ_INV.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_INV.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_INV_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_INV_RT.description",abstract:"formula.functionList.CHISQ_INV_RT.abstract",functionParameter:[{name:"formula.functionList.CHISQ_INV_RT.functionParameter.probability.name",detail:"formula.functionList.CHISQ_INV_RT.functionParameter.probability.detail",example:"0.93",require:1,repeat:0},{name:"formula.functionList.CHISQ_INV_RT.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_INV_RT.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_TEST.description",abstract:"formula.functionList.CHISQ_TEST.abstract",functionParameter:[{name:"formula.functionList.CHISQ_TEST.functionParameter.actualRange.name",detail:"formula.functionList.CHISQ_TEST.functionParameter.actualRange.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.CHISQ_TEST.functionParameter.expectedRange.name",detail:"formula.functionList.CHISQ_TEST.functionParameter.expectedRange.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CONFIDENCE_NORM,functionType:t.FunctionType.Statistical,description:"formula.functionList.CONFIDENCE_NORM.description",abstract:"formula.functionList.CONFIDENCE_NORM.abstract",functionParameter:[{name:"formula.functionList.CONFIDENCE_NORM.functionParameter.alpha.name",detail:"formula.functionList.CONFIDENCE_NORM.functionParameter.alpha.detail",example:"0.05",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_NORM.functionParameter.standardDev.name",detail:"formula.functionList.CONFIDENCE_NORM.functionParameter.standardDev.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_NORM.functionParameter.size.name",detail:"formula.functionList.CONFIDENCE_NORM.functionParameter.size.detail",example:"50",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CONFIDENCE_T,functionType:t.FunctionType.Statistical,description:"formula.functionList.CONFIDENCE_T.description",abstract:"formula.functionList.CONFIDENCE_T.abstract",functionParameter:[{name:"formula.functionList.CONFIDENCE_T.functionParameter.alpha.name",detail:"formula.functionList.CONFIDENCE_T.functionParameter.alpha.detail",example:"0.05",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_T.functionParameter.standardDev.name",detail:"formula.functionList.CONFIDENCE_T.functionParameter.standardDev.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_T.functionParameter.size.name",detail:"formula.functionList.CONFIDENCE_T.functionParameter.size.detail",example:"50",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CORREL,functionType:t.FunctionType.Statistical,description:"formula.functionList.CORREL.description",abstract:"formula.functionList.CORREL.abstract",functionParameter:[{name:"formula.functionList.CORREL.functionParameter.array1.name",detail:"formula.functionList.CORREL.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.CORREL.functionParameter.array2.name",detail:"formula.functionList.CORREL.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNT,aliasFunctionName:"formula.functionList.COUNT.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNT.description",abstract:"formula.functionList.COUNT.abstract",functionParameter:[{name:"formula.functionList.COUNT.functionParameter.value1.name",detail:"formula.functionList.COUNT.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNT.functionParameter.value2.name",detail:"formula.functionList.COUNT.functionParameter.value2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTA,aliasFunctionName:"formula.functionList.COUNTA.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTA.description",abstract:"formula.functionList.COUNTA.abstract",functionParameter:[{name:"formula.functionList.COUNTA.functionParameter.number1.name",detail:"formula.functionList.COUNTA.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNTA.functionParameter.number2.name",detail:"formula.functionList.COUNTA.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTBLANK,functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTBLANK.description",abstract:"formula.functionList.COUNTBLANK.abstract",functionParameter:[{name:"formula.functionList.COUNTBLANK.functionParameter.range.name",detail:"formula.functionList.COUNTBLANK.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTIF,functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTIF.description",abstract:"formula.functionList.COUNTIF.abstract",functionParameter:[{name:"formula.functionList.COUNTIF.functionParameter.range.name",detail:"formula.functionList.COUNTIF.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNTIF.functionParameter.criteria.name",detail:"formula.functionList.COUNTIF.functionParameter.criteria.detail",example:'">5"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTIFS.description",abstract:"formula.functionList.COUNTIFS.abstract",functionParameter:[{name:"formula.functionList.COUNTIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteriaRange1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNTIFS.functionParameter.criteria1.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.COUNTIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteriaRange2.detail",example:"B1:B20",require:0,repeat:1},{name:"formula.functionList.COUNTIFS.functionParameter.criteria2.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COVARIANCE_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.COVARIANCE_P.description",abstract:"formula.functionList.COVARIANCE_P.abstract",functionParameter:[{name:"formula.functionList.COVARIANCE_P.functionParameter.array1.name",detail:"formula.functionList.COVARIANCE_P.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.COVARIANCE_P.functionParameter.array2.name",detail:"formula.functionList.COVARIANCE_P.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COVARIANCE_S,functionType:t.FunctionType.Statistical,description:"formula.functionList.COVARIANCE_S.description",abstract:"formula.functionList.COVARIANCE_S.abstract",functionParameter:[{name:"formula.functionList.COVARIANCE_S.functionParameter.array1.name",detail:"formula.functionList.COVARIANCE_S.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.COVARIANCE_S.functionParameter.array2.name",detail:"formula.functionList.COVARIANCE_S.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.DEVSQ,functionType:t.FunctionType.Statistical,description:"formula.functionList.DEVSQ.description",abstract:"formula.functionList.DEVSQ.abstract",functionParameter:[{name:"formula.functionList.DEVSQ.functionParameter.number1.name",detail:"formula.functionList.DEVSQ.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DEVSQ.functionParameter.number2.name",detail:"formula.functionList.DEVSQ.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.EXPON_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.EXPON_DIST.description",abstract:"formula.functionList.EXPON_DIST.abstract",functionParameter:[{name:"formula.functionList.EXPON_DIST.functionParameter.x.name",detail:"formula.functionList.EXPON_DIST.functionParameter.x.detail",example:"0.2",require:1,repeat:0},{name:"formula.functionList.EXPON_DIST.functionParameter.lambda.name",detail:"formula.functionList.EXPON_DIST.functionParameter.lambda.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.EXPON_DIST.functionParameter.cumulative.name",detail:"formula.functionList.EXPON_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_DIST.description",abstract:"formula.functionList.F_DIST.abstract",functionParameter:[{name:"formula.functionList.F_DIST.functionParameter.x.name",detail:"formula.functionList.F_DIST.functionParameter.x.detail",example:"15.2069",require:1,repeat:0},{name:"formula.functionList.F_DIST.functionParameter.degFreedom1.name",detail:"formula.functionList.F_DIST.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_DIST.functionParameter.degFreedom2.name",detail:"formula.functionList.F_DIST.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.F_DIST.functionParameter.cumulative.name",detail:"formula.functionList.F_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_DIST_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_DIST_RT.description",abstract:"formula.functionList.F_DIST_RT.abstract",functionParameter:[{name:"formula.functionList.F_DIST_RT.functionParameter.x.name",detail:"formula.functionList.F_DIST_RT.functionParameter.x.detail",example:"15.2069",require:1,repeat:0},{name:"formula.functionList.F_DIST_RT.functionParameter.degFreedom1.name",detail:"formula.functionList.F_DIST_RT.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_DIST_RT.functionParameter.degFreedom2.name",detail:"formula.functionList.F_DIST_RT.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_INV.description",abstract:"formula.functionList.F_INV.abstract",functionParameter:[{name:"formula.functionList.F_INV.functionParameter.probability.name",detail:"formula.functionList.F_INV.functionParameter.probability.detail",example:"0.01",require:1,repeat:0},{name:"formula.functionList.F_INV.functionParameter.degFreedom1.name",detail:"formula.functionList.F_INV.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_INV.functionParameter.degFreedom2.name",detail:"formula.functionList.F_INV.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_INV_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_INV_RT.description",abstract:"formula.functionList.F_INV_RT.abstract",functionParameter:[{name:"formula.functionList.F_INV_RT.functionParameter.probability.name",detail:"formula.functionList.F_INV_RT.functionParameter.probability.detail",example:"0.01",require:1,repeat:0},{name:"formula.functionList.F_INV_RT.functionParameter.degFreedom1.name",detail:"formula.functionList.F_INV_RT.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_INV_RT.functionParameter.degFreedom2.name",detail:"formula.functionList.F_INV_RT.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_TEST.description",abstract:"formula.functionList.F_TEST.abstract",functionParameter:[{name:"formula.functionList.F_TEST.functionParameter.array1.name",detail:"formula.functionList.F_TEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.F_TEST.functionParameter.array2.name",detail:"formula.functionList.F_TEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FISHER,functionType:t.FunctionType.Statistical,description:"formula.functionList.FISHER.description",abstract:"formula.functionList.FISHER.abstract",functionParameter:[{name:"formula.functionList.FISHER.functionParameter.x.name",detail:"formula.functionList.FISHER.functionParameter.x.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FISHERINV,functionType:t.FunctionType.Statistical,description:"formula.functionList.FISHERINV.description",abstract:"formula.functionList.FISHERINV.abstract",functionParameter:[{name:"formula.functionList.FISHERINV.functionParameter.y.name",detail:"formula.functionList.FISHERINV.functionParameter.y.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST.description",abstract:"formula.functionList.FORECAST.abstract",functionParameter:[{name:"formula.functionList.FORECAST.functionParameter.x.name",detail:"formula.functionList.FORECAST.functionParameter.x.detail",example:"30",require:1,repeat:0},{name:"formula.functionList.FORECAST.functionParameter.knownYs.name",detail:"formula.functionList.FORECAST.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.FORECAST.functionParameter.knownXs.name",detail:"formula.functionList.FORECAST.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS.description",abstract:"formula.functionList.FORECAST_ETS.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS_CONFINT,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS_CONFINT.description",abstract:"formula.functionList.FORECAST_ETS_CONFINT.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS_SEASONALITY,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS_SEASONALITY.description",abstract:"formula.functionList.FORECAST_ETS_SEASONALITY.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS_STAT,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS_STAT.description",abstract:"formula.functionList.FORECAST_ETS_STAT.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_LINEAR,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_LINEAR.description",abstract:"formula.functionList.FORECAST_LINEAR.abstract",functionParameter:[{name:"formula.functionList.FORECAST_LINEAR.functionParameter.x.name",detail:"formula.functionList.FORECAST_LINEAR.functionParameter.x.detail",example:"30",require:1,repeat:0},{name:"formula.functionList.FORECAST_LINEAR.functionParameter.knownYs.name",detail:"formula.functionList.FORECAST_LINEAR.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.FORECAST_LINEAR.functionParameter.knownXs.name",detail:"formula.functionList.FORECAST_LINEAR.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FREQUENCY,functionType:t.FunctionType.Statistical,description:"formula.functionList.FREQUENCY.description",abstract:"formula.functionList.FREQUENCY.abstract",functionParameter:[{name:"formula.functionList.FREQUENCY.functionParameter.dataArray.name",detail:"formula.functionList.FREQUENCY.functionParameter.dataArray.detail",example:"A2:A10",require:1,repeat:0},{name:"formula.functionList.FREQUENCY.functionParameter.binsArray.name",detail:"formula.functionList.FREQUENCY.functionParameter.binsArray.detail",example:"B2:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMA,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMA.description",abstract:"formula.functionList.GAMMA.abstract",functionParameter:[{name:"formula.functionList.GAMMA.functionParameter.number.name",detail:"formula.functionList.GAMMA.functionParameter.number.detail",example:"2.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMA_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMA_DIST.description",abstract:"formula.functionList.GAMMA_DIST.abstract",functionParameter:[{name:"formula.functionList.GAMMA_DIST.functionParameter.x.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.x.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.GAMMA_DIST.functionParameter.alpha.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.GAMMA_DIST.functionParameter.beta.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.beta.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.GAMMA_DIST.functionParameter.cumulative.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMA_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMA_INV.description",abstract:"formula.functionList.GAMMA_INV.abstract",functionParameter:[{name:"formula.functionList.GAMMA_INV.functionParameter.probability.name",detail:"formula.functionList.GAMMA_INV.functionParameter.probability.detail",example:"0.068094",require:1,repeat:0},{name:"formula.functionList.GAMMA_INV.functionParameter.alpha.name",detail:"formula.functionList.GAMMA_INV.functionParameter.alpha.detail",example:"9",require:1,repeat:0},{name:"formula.functionList.GAMMA_INV.functionParameter.beta.name",detail:"formula.functionList.GAMMA_INV.functionParameter.beta.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMALN,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMALN.description",abstract:"formula.functionList.GAMMALN.abstract",functionParameter:[{name:"formula.functionList.GAMMALN.functionParameter.x.name",detail:"formula.functionList.GAMMALN.functionParameter.x.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMALN_PRECISE,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMALN_PRECISE.description",abstract:"formula.functionList.GAMMALN_PRECISE.abstract",functionParameter:[{name:"formula.functionList.GAMMALN_PRECISE.functionParameter.x.name",detail:"formula.functionList.GAMMALN_PRECISE.functionParameter.x.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAUSS,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAUSS.description",abstract:"formula.functionList.GAUSS.abstract",functionParameter:[{name:"formula.functionList.GAUSS.functionParameter.z.name",detail:"formula.functionList.GAUSS.functionParameter.z.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GEOMEAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.GEOMEAN.description",abstract:"formula.functionList.GEOMEAN.abstract",functionParameter:[{name:"formula.functionList.GEOMEAN.functionParameter.number1.name",detail:"formula.functionList.GEOMEAN.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.GEOMEAN.functionParameter.number2.name",detail:"formula.functionList.GEOMEAN.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GROWTH,functionType:t.FunctionType.Statistical,description:"formula.functionList.GROWTH.description",abstract:"formula.functionList.GROWTH.abstract",functionParameter:[{name:"formula.functionList.GROWTH.functionParameter.knownYs.name",detail:"formula.functionList.GROWTH.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.GROWTH.functionParameter.knownXs.name",detail:"formula.functionList.GROWTH.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.GROWTH.functionParameter.newXs.name",detail:"formula.functionList.GROWTH.functionParameter.newXs.detail",example:"A9:A10",require:0,repeat:0},{name:"formula.functionList.GROWTH.functionParameter.constb.name",detail:"formula.functionList.GROWTH.functionParameter.constb.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.HARMEAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.HARMEAN.description",abstract:"formula.functionList.HARMEAN.abstract",functionParameter:[{name:"formula.functionList.HARMEAN.functionParameter.number1.name",detail:"formula.functionList.HARMEAN.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HARMEAN.functionParameter.number2.name",detail:"formula.functionList.HARMEAN.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.HYPGEOM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.HYPGEOM_DIST.description",abstract:"formula.functionList.HYPGEOM_DIST.abstract",functionParameter:[{name:"formula.functionList.HYPGEOM_DIST.functionParameter.sampleS.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.sampleS.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.numberSample.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.numberSample.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.populationS.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.populationS.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.numberPop.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.numberPop.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.INTERCEPT,functionType:t.FunctionType.Statistical,description:"formula.functionList.INTERCEPT.description",abstract:"formula.functionList.INTERCEPT.abstract",functionParameter:[{name:"formula.functionList.INTERCEPT.functionParameter.knownYs.name",detail:"formula.functionList.INTERCEPT.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.INTERCEPT.functionParameter.knownXs.name",detail:"formula.functionList.INTERCEPT.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.KURT,functionType:t.FunctionType.Statistical,description:"formula.functionList.KURT.description",abstract:"formula.functionList.KURT.abstract",functionParameter:[{name:"formula.functionList.KURT.functionParameter.number1.name",detail:"formula.functionList.KURT.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.KURT.functionParameter.number2.name",detail:"formula.functionList.KURT.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LARGE,functionType:t.FunctionType.Statistical,description:"formula.functionList.LARGE.description",abstract:"formula.functionList.LARGE.abstract",functionParameter:[{name:"formula.functionList.LARGE.functionParameter.array.name",detail:"formula.functionList.LARGE.functionParameter.array.detail",example:"A2:B6",require:1,repeat:0},{name:"formula.functionList.LARGE.functionParameter.k.name",detail:"formula.functionList.LARGE.functionParameter.k.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LINEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.LINEST.description",abstract:"formula.functionList.LINEST.abstract",functionParameter:[{name:"formula.functionList.LINEST.functionParameter.knownYs.name",detail:"formula.functionList.LINEST.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.LINEST.functionParameter.knownXs.name",detail:"formula.functionList.LINEST.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.LINEST.functionParameter.constb.name",detail:"formula.functionList.LINEST.functionParameter.constb.detail",example:"true",require:0,repeat:0},{name:"formula.functionList.LINEST.functionParameter.stats.name",detail:"formula.functionList.LINEST.functionParameter.stats.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LOGEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.LOGEST.description",abstract:"formula.functionList.LOGEST.abstract",functionParameter:[{name:"formula.functionList.LOGEST.functionParameter.knownYs.name",detail:"formula.functionList.LOGEST.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.LOGEST.functionParameter.knownXs.name",detail:"formula.functionList.LOGEST.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.LOGEST.functionParameter.constb.name",detail:"formula.functionList.LOGEST.functionParameter.constb.detail",example:"true",require:0,repeat:0},{name:"formula.functionList.LOGEST.functionParameter.stats.name",detail:"formula.functionList.LOGEST.functionParameter.stats.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LOGNORM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.LOGNORM_DIST.description",abstract:"formula.functionList.LOGNORM_DIST.abstract",functionParameter:[{name:"formula.functionList.LOGNORM_DIST.functionParameter.x.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.LOGNORM_DIST.functionParameter.mean.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGNORM_DIST.functionParameter.standardDev.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.LOGNORM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LOGNORM_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.LOGNORM_INV.description",abstract:"formula.functionList.LOGNORM_INV.abstract",functionParameter:[{name:"formula.functionList.LOGNORM_INV.functionParameter.probability.name",detail:"formula.functionList.LOGNORM_INV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.LOGNORM_INV.functionParameter.mean.name",detail:"formula.functionList.LOGNORM_INV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGNORM_INV.functionParameter.standardDev.name",detail:"formula.functionList.LOGNORM_INV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MARGINOFERROR,aliasFunctionName:"formula.functionList.MARGINOFERROR.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.MARGINOFERROR.description",abstract:"formula.functionList.MARGINOFERROR.abstract",functionParameter:[{name:"formula.functionList.MARGINOFERROR.functionParameter.range.name",detail:"formula.functionList.MARGINOFERROR.functionParameter.range.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MARGINOFERROR.functionParameter.confidence.name",detail:"formula.functionList.MARGINOFERROR.functionParameter.confidence.detail",example:"0.95",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MAX,aliasFunctionName:"formula.functionList.MAX.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.MAX.description",abstract:"formula.functionList.MAX.abstract",functionParameter:[{name:"formula.functionList.MAX.functionParameter.number1.name",detail:"formula.functionList.MAX.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MAX.functionParameter.number2.name",detail:"formula.functionList.MAX.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MAXA,functionType:t.FunctionType.Statistical,description:"formula.functionList.MAXA.description",abstract:"formula.functionList.MAXA.abstract",functionParameter:[{name:"formula.functionList.MAXA.functionParameter.value1.name",detail:"formula.functionList.MAXA.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MAXA.functionParameter.value2.name",detail:"formula.functionList.MAXA.functionParameter.value2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MAXIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.MAXIFS.description",abstract:"formula.functionList.MAXIFS.abstract",functionParameter:[{name:"formula.functionList.MAXIFS.functionParameter.maxRange.name",detail:"formula.functionList.MAXIFS.functionParameter.maxRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MAXIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.MAXIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.MAXIFS.functionParameter.criteria1.name",detail:"formula.functionList.MAXIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.MAXIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.MAXIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.MAXIFS.functionParameter.criteria2.name",detail:"formula.functionList.MAXIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MEDIAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.MEDIAN.description",abstract:"formula.functionList.MEDIAN.abstract",functionParameter:[{name:"formula.functionList.MEDIAN.functionParameter.number1.name",detail:"formula.functionList.MEDIAN.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.MEDIAN.functionParameter.number2.name",detail:"formula.functionList.MEDIAN.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MIN,aliasFunctionName:"formula.functionList.MIN.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.MIN.description",abstract:"formula.functionList.MIN.abstract",functionParameter:[{name:"formula.functionList.MIN.functionParameter.number1.name",detail:"formula.functionList.MIN.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MIN.functionParameter.number2.name",detail:"formula.functionList.MIN.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MINA,functionType:t.FunctionType.Statistical,description:"formula.functionList.MINA.description",abstract:"formula.functionList.MINA.abstract",functionParameter:[{name:"formula.functionList.MINA.functionParameter.value1.name",detail:"formula.functionList.MINA.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MINA.functionParameter.value2.name",detail:"formula.functionList.MINA.functionParameter.value2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MINIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.MINIFS.description",abstract:"formula.functionList.MINIFS.abstract",functionParameter:[{name:"formula.functionList.MINIFS.functionParameter.minRange.name",detail:"formula.functionList.MINIFS.functionParameter.minRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MINIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.MINIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.MINIFS.functionParameter.criteria1.name",detail:"formula.functionList.MINIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.MINIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.MINIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.MINIFS.functionParameter.criteria2.name",detail:"formula.functionList.MINIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MODE_MULT,functionType:t.FunctionType.Statistical,description:"formula.functionList.MODE_MULT.description",abstract:"formula.functionList.MODE_MULT.abstract",functionParameter:[{name:"formula.functionList.MODE_MULT.functionParameter.number1.name",detail:"formula.functionList.MODE_MULT.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MODE_MULT.functionParameter.number2.name",detail:"formula.functionList.MODE_MULT.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MODE_SNGL,functionType:t.FunctionType.Statistical,description:"formula.functionList.MODE_SNGL.description",abstract:"formula.functionList.MODE_SNGL.abstract",functionParameter:[{name:"formula.functionList.MODE_SNGL.functionParameter.number1.name",detail:"formula.functionList.MODE_SNGL.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MODE_SNGL.functionParameter.number2.name",detail:"formula.functionList.MODE_SNGL.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NEGBINOM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.NEGBINOM_DIST.description",abstract:"formula.functionList.NEGBINOM_DIST.abstract",functionParameter:[{name:"formula.functionList.NEGBINOM_DIST.functionParameter.numberF.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.numberF.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.NEGBINOM_DIST.functionParameter.numberS.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.numberS.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.NEGBINOM_DIST.functionParameter.probabilityS.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.probabilityS.detail",example:"0.25",require:1,repeat:0},{name:"formula.functionList.NEGBINOM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_DIST.description",abstract:"formula.functionList.NORM_DIST.abstract",functionParameter:[{name:"formula.functionList.NORM_DIST.functionParameter.x.name",detail:"formula.functionList.NORM_DIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.NORM_DIST.functionParameter.mean.name",detail:"formula.functionList.NORM_DIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORM_DIST.functionParameter.standardDev.name",detail:"formula.functionList.NORM_DIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.NORM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.NORM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_INV.description",abstract:"formula.functionList.NORM_INV.abstract",functionParameter:[{name:"formula.functionList.NORM_INV.functionParameter.probability.name",detail:"formula.functionList.NORM_INV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.NORM_INV.functionParameter.mean.name",detail:"formula.functionList.NORM_INV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORM_INV.functionParameter.standardDev.name",detail:"formula.functionList.NORM_INV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_S_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_S_DIST.description",abstract:"formula.functionList.NORM_S_DIST.abstract",functionParameter:[{name:"formula.functionList.NORM_S_DIST.functionParameter.z.name",detail:"formula.functionList.NORM_S_DIST.functionParameter.z.detail",example:"1.333333",require:1,repeat:0},{name:"formula.functionList.NORM_S_DIST.functionParameter.cumulative.name",detail:"formula.functionList.NORM_S_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_S_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_S_INV.description",abstract:"formula.functionList.NORM_S_INV.abstract",functionParameter:[{name:"formula.functionList.NORM_S_INV.functionParameter.probability.name",detail:"formula.functionList.NORM_S_INV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PEARSON,functionType:t.FunctionType.Statistical,description:"formula.functionList.PEARSON.description",abstract:"formula.functionList.PEARSON.abstract",functionParameter:[{name:"formula.functionList.PEARSON.functionParameter.array1.name",detail:"formula.functionList.PEARSON.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PEARSON.functionParameter.array2.name",detail:"formula.functionList.PEARSON.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTILE_EXC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTILE_EXC.description",abstract:"formula.functionList.PERCENTILE_EXC.abstract",functionParameter:[{name:"formula.functionList.PERCENTILE_EXC.functionParameter.array.name",detail:"formula.functionList.PERCENTILE_EXC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTILE_EXC.functionParameter.k.name",detail:"formula.functionList.PERCENTILE_EXC.functionParameter.k.detail",example:"0.3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTILE_INC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTILE_INC.description",abstract:"formula.functionList.PERCENTILE_INC.abstract",functionParameter:[{name:"formula.functionList.PERCENTILE_INC.functionParameter.array.name",detail:"formula.functionList.PERCENTILE_INC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTILE_INC.functionParameter.k.name",detail:"formula.functionList.PERCENTILE_INC.functionParameter.k.detail",example:"0.3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTRANK_EXC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTRANK_EXC.description",abstract:"formula.functionList.PERCENTRANK_EXC.abstract",functionParameter:[{name:"formula.functionList.PERCENTRANK_EXC.functionParameter.array.name",detail:"formula.functionList.PERCENTRANK_EXC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_EXC.functionParameter.x.name",detail:"formula.functionList.PERCENTRANK_EXC.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_EXC.functionParameter.significance.name",detail:"formula.functionList.PERCENTRANK_EXC.functionParameter.significance.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTRANK_INC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTRANK_INC.description",abstract:"formula.functionList.PERCENTRANK_INC.abstract",functionParameter:[{name:"formula.functionList.PERCENTRANK_INC.functionParameter.array.name",detail:"formula.functionList.PERCENTRANK_INC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_INC.functionParameter.x.name",detail:"formula.functionList.PERCENTRANK_INC.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_INC.functionParameter.significance.name",detail:"formula.functionList.PERCENTRANK_INC.functionParameter.significance.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERMUT,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERMUT.description",abstract:"formula.functionList.PERMUT.abstract",functionParameter:[{name:"formula.functionList.PERMUT.functionParameter.number.name",detail:"formula.functionList.PERMUT.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.PERMUT.functionParameter.numberChosen.name",detail:"formula.functionList.PERMUT.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERMUTATIONA,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERMUTATIONA.description",abstract:"formula.functionList.PERMUTATIONA.abstract",functionParameter:[{name:"formula.functionList.PERMUT.functionParameter.number.name",detail:"formula.functionList.PERMUT.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.PERMUT.functionParameter.numberChosen.name",detail:"formula.functionList.PERMUT.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PHI,functionType:t.FunctionType.Statistical,description:"formula.functionList.PHI.description",abstract:"formula.functionList.PHI.abstract",functionParameter:[{name:"formula.functionList.PHI.functionParameter.x.name",detail:"formula.functionList.PHI.functionParameter.x.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.POISSON_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.POISSON_DIST.description",abstract:"formula.functionList.POISSON_DIST.abstract",functionParameter:[{name:"formula.functionList.POISSON_DIST.functionParameter.x.name",detail:"formula.functionList.POISSON_DIST.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.POISSON_DIST.functionParameter.mean.name",detail:"formula.functionList.POISSON_DIST.functionParameter.mean.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.POISSON_DIST.functionParameter.cumulative.name",detail:"formula.functionList.POISSON_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PROB,functionType:t.FunctionType.Statistical,description:"formula.functionList.PROB.description",abstract:"formula.functionList.PROB.abstract",functionParameter:[{name:"formula.functionList.PROB.functionParameter.xRange.name",detail:"formula.functionList.PROB.functionParameter.xRange.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PROB.functionParameter.probRange.name",detail:"formula.functionList.PROB.functionParameter.probRange.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.PROB.functionParameter.lowerLimit.name",detail:"formula.functionList.PROB.functionParameter.lowerLimit.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.PROB.functionParameter.upperLimit.name",detail:"formula.functionList.PROB.functionParameter.upperLimit.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.QUARTILE_EXC,functionType:t.FunctionType.Statistical,description:"formula.functionList.QUARTILE_EXC.description",abstract:"formula.functionList.QUARTILE_EXC.abstract",functionParameter:[{name:"formula.functionList.QUARTILE_EXC.functionParameter.array.name",detail:"formula.functionList.QUARTILE_EXC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.QUARTILE_EXC.functionParameter.quart.name",detail:"formula.functionList.QUARTILE_EXC.functionParameter.quart.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.QUARTILE_INC,functionType:t.FunctionType.Statistical,description:"formula.functionList.QUARTILE_INC.description",abstract:"formula.functionList.QUARTILE_INC.abstract",functionParameter:[{name:"formula.functionList.QUARTILE_INC.functionParameter.array.name",detail:"formula.functionList.QUARTILE_INC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.QUARTILE_INC.functionParameter.quart.name",detail:"formula.functionList.QUARTILE_INC.functionParameter.quart.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.RANK_AVG,functionType:t.FunctionType.Statistical,description:"formula.functionList.RANK_AVG.description",abstract:"formula.functionList.RANK_AVG.abstract",functionParameter:[{name:"formula.functionList.RANK_AVG.functionParameter.number.name",detail:"formula.functionList.RANK_AVG.functionParameter.number.detail",example:"A3",require:1,repeat:0},{name:"formula.functionList.RANK_AVG.functionParameter.ref.name",detail:"formula.functionList.RANK_AVG.functionParameter.ref.detail",example:"A2:A6",require:1,repeat:0},{name:"formula.functionList.RANK_AVG.functionParameter.order.name",detail:"formula.functionList.RANK_AVG.functionParameter.order.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.RANK_EQ,functionType:t.FunctionType.Statistical,description:"formula.functionList.RANK_EQ.description",abstract:"formula.functionList.RANK_EQ.abstract",functionParameter:[{name:"formula.functionList.RANK_EQ.functionParameter.number.name",detail:"formula.functionList.RANK_EQ.functionParameter.number.detail",example:"A3",require:1,repeat:0},{name:"formula.functionList.RANK_EQ.functionParameter.ref.name",detail:"formula.functionList.RANK_EQ.functionParameter.ref.detail",example:"A2:A6",require:1,repeat:0},{name:"formula.functionList.RANK_EQ.functionParameter.order.name",detail:"formula.functionList.RANK_EQ.functionParameter.order.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.RSQ,functionType:t.FunctionType.Statistical,description:"formula.functionList.RSQ.description",abstract:"formula.functionList.RSQ.abstract",functionParameter:[{name:"formula.functionList.RSQ.functionParameter.array1.name",detail:"formula.functionList.RSQ.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.RSQ.functionParameter.array2.name",detail:"formula.functionList.RSQ.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SKEW,functionType:t.FunctionType.Statistical,description:"formula.functionList.SKEW.description",abstract:"formula.functionList.SKEW.abstract",functionParameter:[{name:"formula.functionList.SKEW.functionParameter.number1.name",detail:"formula.functionList.SKEW.functionParameter.number1.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.SKEW.functionParameter.number2.name",detail:"formula.functionList.SKEW.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SKEW_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.SKEW_P.description",abstract:"formula.functionList.SKEW_P.abstract",functionParameter:[{name:"formula.functionList.SKEW_P.functionParameter.number1.name",detail:"formula.functionList.SKEW_P.functionParameter.number1.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.SKEW_P.functionParameter.number2.name",detail:"formula.functionList.SKEW_P.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SLOPE,functionType:t.FunctionType.Statistical,description:"formula.functionList.SLOPE.description",abstract:"formula.functionList.SLOPE.abstract",functionParameter:[{name:"formula.functionList.SLOPE.functionParameter.knownYs.name",detail:"formula.functionList.SLOPE.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.SLOPE.functionParameter.knownXs.name",detail:"formula.functionList.SLOPE.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SMALL,functionType:t.FunctionType.Statistical,description:"formula.functionList.SMALL.description",abstract:"formula.functionList.SMALL.abstract",functionParameter:[{name:"formula.functionList.SMALL.functionParameter.array.name",detail:"formula.functionList.SMALL.functionParameter.array.detail",example:"A2:B6",require:1,repeat:0},{name:"formula.functionList.SMALL.functionParameter.k.name",detail:"formula.functionList.SMALL.functionParameter.k.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STANDARDIZE,functionType:t.FunctionType.Statistical,description:"formula.functionList.STANDARDIZE.description",abstract:"formula.functionList.STANDARDIZE.abstract",functionParameter:[{name:"formula.functionList.STANDARDIZE.functionParameter.x.name",detail:"formula.functionList.STANDARDIZE.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.STANDARDIZE.functionParameter.mean.name",detail:"formula.functionList.STANDARDIZE.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.STANDARDIZE.functionParameter.standardDev.name",detail:"formula.functionList.STANDARDIZE.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEV_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEV_P.description",abstract:"formula.functionList.STDEV_P.abstract",functionParameter:[{name:"formula.functionList.STDEV_P.functionParameter.number1.name",detail:"formula.functionList.STDEV_P.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEV_P.functionParameter.number2.name",detail:"formula.functionList.STDEV_P.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEV_S,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEV_S.description",abstract:"formula.functionList.STDEV_S.abstract",functionParameter:[{name:"formula.functionList.STDEV_S.functionParameter.number1.name",detail:"formula.functionList.STDEV_S.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEV_S.functionParameter.number2.name",detail:"formula.functionList.STDEV_S.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEVA,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEVA.description",abstract:"formula.functionList.STDEVA.abstract",functionParameter:[{name:"formula.functionList.STDEVA.functionParameter.value1.name",detail:"formula.functionList.STDEVA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEVA.functionParameter.value2.name",detail:"formula.functionList.STDEVA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEVPA,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEVPA.description",abstract:"formula.functionList.STDEVPA.abstract",functionParameter:[{name:"formula.functionList.STDEVPA.functionParameter.value1.name",detail:"formula.functionList.STDEVPA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEVPA.functionParameter.value2.name",detail:"formula.functionList.STDEVPA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STEYX,functionType:t.FunctionType.Statistical,description:"formula.functionList.STEYX.description",abstract:"formula.functionList.STEYX.abstract",functionParameter:[{name:"formula.functionList.STEYX.functionParameter.knownYs.name",detail:"formula.functionList.STEYX.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.STEYX.functionParameter.knownXs.name",detail:"formula.functionList.STEYX.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_DIST.description",abstract:"formula.functionList.T_DIST.abstract",functionParameter:[{name:"formula.functionList.T_DIST.functionParameter.x.name",detail:"formula.functionList.T_DIST.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.T_DIST.functionParameter.degFreedom.name",detail:"formula.functionList.T_DIST.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.T_DIST.functionParameter.cumulative.name",detail:"formula.functionList.T_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_DIST_2T,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_DIST_2T.description",abstract:"formula.functionList.T_DIST_2T.abstract",functionParameter:[{name:"formula.functionList.T_DIST_2T.functionParameter.x.name",detail:"formula.functionList.T_DIST_2T.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.T_DIST_2T.functionParameter.degFreedom.name",detail:"formula.functionList.T_DIST_2T.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_DIST_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_DIST_RT.description",abstract:"formula.functionList.T_DIST_RT.abstract",functionParameter:[{name:"formula.functionList.T_DIST_RT.functionParameter.x.name",detail:"formula.functionList.T_DIST_RT.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.T_DIST_RT.functionParameter.degFreedom.name",detail:"formula.functionList.T_DIST_RT.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_INV.description",abstract:"formula.functionList.T_INV.abstract",functionParameter:[{name:"formula.functionList.T_INV.functionParameter.probability.name",detail:"formula.functionList.T_INV.functionParameter.probability.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.T_INV.functionParameter.degFreedom.name",detail:"formula.functionList.T_INV.functionParameter.degFreedom.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_INV_2T,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_INV_2T.description",abstract:"formula.functionList.T_INV_2T.abstract",functionParameter:[{name:"formula.functionList.T_INV_2T.functionParameter.probability.name",detail:"formula.functionList.T_INV_2T.functionParameter.probability.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.T_INV_2T.functionParameter.degFreedom.name",detail:"formula.functionList.T_INV_2T.functionParameter.degFreedom.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_TEST.description",abstract:"formula.functionList.T_TEST.abstract",functionParameter:[{name:"formula.functionList.T_TEST.functionParameter.array1.name",detail:"formula.functionList.T_TEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.T_TEST.functionParameter.array2.name",detail:"formula.functionList.T_TEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.T_TEST.functionParameter.tails.name",detail:"formula.functionList.T_TEST.functionParameter.tails.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.T_TEST.functionParameter.type.name",detail:"formula.functionList.T_TEST.functionParameter.type.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.TREND,functionType:t.FunctionType.Statistical,description:"formula.functionList.TREND.description",abstract:"formula.functionList.TREND.abstract",functionParameter:[{name:"formula.functionList.TREND.functionParameter.knownYs.name",detail:"formula.functionList.TREND.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.TREND.functionParameter.knownXs.name",detail:"formula.functionList.TREND.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.TREND.functionParameter.newXs.name",detail:"formula.functionList.TREND.functionParameter.newXs.detail",example:"A9:A10",require:0,repeat:0},{name:"formula.functionList.TREND.functionParameter.constb.name",detail:"formula.functionList.TREND.functionParameter.constb.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.TRIMMEAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.TRIMMEAN.description",abstract:"formula.functionList.TRIMMEAN.abstract",functionParameter:[{name:"formula.functionList.TRIMMEAN.functionParameter.array.name",detail:"formula.functionList.TRIMMEAN.functionParameter.array.detail",example:"A2:A12",require:1,repeat:0},{name:"formula.functionList.TRIMMEAN.functionParameter.percent.name",detail:"formula.functionList.TRIMMEAN.functionParameter.percent.detail",example:"0.2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VAR_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.VAR_P.description",abstract:"formula.functionList.VAR_P.abstract",functionParameter:[{name:"formula.functionList.VAR_P.functionParameter.number1.name",detail:"formula.functionList.VAR_P.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VAR_P.functionParameter.number2.name",detail:"formula.functionList.VAR_P.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VAR_S,functionType:t.FunctionType.Statistical,description:"formula.functionList.VAR_S.description",abstract:"formula.functionList.VAR_S.abstract",functionParameter:[{name:"formula.functionList.VAR_S.functionParameter.number1.name",detail:"formula.functionList.VAR_S.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VAR_S.functionParameter.number2.name",detail:"formula.functionList.VAR_S.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VARA,functionType:t.FunctionType.Statistical,description:"formula.functionList.VARA.description",abstract:"formula.functionList.VARA.abstract",functionParameter:[{name:"formula.functionList.VARA.functionParameter.value1.name",detail:"formula.functionList.VARA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VARA.functionParameter.value2.name",detail:"formula.functionList.VARA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VARPA,functionType:t.FunctionType.Statistical,description:"formula.functionList.VARPA.description",abstract:"formula.functionList.VARPA.abstract",functionParameter:[{name:"formula.functionList.VARPA.functionParameter.value1.name",detail:"formula.functionList.VARPA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VARPA.functionParameter.value2.name",detail:"formula.functionList.VARPA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.WEIBULL_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.WEIBULL_DIST.description",abstract:"formula.functionList.WEIBULL_DIST.abstract",functionParameter:[{name:"formula.functionList.WEIBULL_DIST.functionParameter.x.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.x.detail",example:"105",require:1,repeat:0},{name:"formula.functionList.WEIBULL_DIST.functionParameter.alpha.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.alpha.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.WEIBULL_DIST.functionParameter.beta.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.beta.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.WEIBULL_DIST.functionParameter.cumulative.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.Z_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.Z_TEST.description",abstract:"formula.functionList.Z_TEST.abstract",functionParameter:[{name:"formula.functionList.Z_TEST.functionParameter.array.name",detail:"formula.functionList.Z_TEST.functionParameter.array.detail",example:"A2:A11",require:1,repeat:0},{name:"formula.functionList.Z_TEST.functionParameter.x.name",detail:"formula.functionList.Z_TEST.functionParameter.x.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.Z_TEST.functionParameter.sigma.name",detail:"formula.functionList.Z_TEST.functionParameter.sigma.detail",example:"10",require:0,repeat:0}]}],ke=[{functionName:t.FUNCTION_NAMES_TEXT.ASC,functionType:t.FunctionType.Text,description:"formula.functionList.ASC.description",abstract:"formula.functionList.ASC.abstract",functionParameter:[{name:"formula.functionList.ASC.functionParameter.text.name",detail:"formula.functionList.ASC.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.ARRAYTOTEXT,functionType:t.FunctionType.Text,description:"formula.functionList.ARRAYTOTEXT.description",abstract:"formula.functionList.ARRAYTOTEXT.abstract",functionParameter:[{name:"formula.functionList.ARRAYTOTEXT.functionParameter.array.name",detail:"formula.functionList.ARRAYTOTEXT.functionParameter.array.detail",example:"A2:B4",require:1,repeat:0},{name:"formula.functionList.ARRAYTOTEXT.functionParameter.format.name",detail:"formula.functionList.ARRAYTOTEXT.functionParameter.format.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.BAHTTEXT,functionType:t.FunctionType.Text,description:"formula.functionList.BAHTTEXT.description",abstract:"formula.functionList.BAHTTEXT.abstract",functionParameter:[{name:"formula.functionList.BAHTTEXT.functionParameter.number.name",detail:"formula.functionList.BAHTTEXT.functionParameter.number.detail",example:"1234",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CHAR,functionType:t.FunctionType.Text,description:"formula.functionList.CHAR.description",abstract:"formula.functionList.CHAR.abstract",functionParameter:[{name:"formula.functionList.CHAR.functionParameter.number.name",detail:"formula.functionList.CHAR.functionParameter.number.detail",example:"65",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CLEAN,functionType:t.FunctionType.Text,description:"formula.functionList.CLEAN.description",abstract:"formula.functionList.CLEAN.abstract",functionParameter:[{name:"formula.functionList.CLEAN.functionParameter.text.name",detail:"formula.functionList.CLEAN.functionParameter.text.detail",example:'CHAR(1)&"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CODE,functionType:t.FunctionType.Text,description:"formula.functionList.CODE.description",abstract:"formula.functionList.CODE.abstract",functionParameter:[{name:"formula.functionList.CODE.functionParameter.text.name",detail:"formula.functionList.CODE.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CONCAT,functionType:t.FunctionType.Text,description:"formula.functionList.CONCAT.description",abstract:"formula.functionList.CONCAT.abstract",functionParameter:[{name:"formula.functionList.CONCAT.functionParameter.text1.name",detail:"formula.functionList.CONCAT.functionParameter.text1.detail",example:'"Hello"',require:1,repeat:0},{name:"formula.functionList.CONCAT.functionParameter.text2.name",detail:"formula.functionList.CONCAT.functionParameter.text2.detail",example:'"Univer"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_TEXT.CONCATENATE,functionType:t.FunctionType.Text,description:"formula.functionList.CONCATENATE.description",abstract:"formula.functionList.CONCATENATE.abstract",functionParameter:[{name:"formula.functionList.CONCATENATE.functionParameter.text1.name",detail:"formula.functionList.CONCATENATE.functionParameter.text1.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.CONCATENATE.functionParameter.text2.name",detail:"formula.functionList.CONCATENATE.functionParameter.text2.detail",example:"A2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_TEXT.DBCS,functionType:t.FunctionType.Text,description:"formula.functionList.DBCS.description",abstract:"formula.functionList.DBCS.abstract",functionParameter:[{name:"formula.functionList.DBCS.functionParameter.text.name",detail:"formula.functionList.DBCS.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.DOLLAR,functionType:t.FunctionType.Text,description:"formula.functionList.DOLLAR.description",abstract:"formula.functionList.DOLLAR.abstract",functionParameter:[{name:"formula.functionList.DOLLAR.functionParameter.number.name",detail:"formula.functionList.DOLLAR.functionParameter.number.detail",example:"1234.567",require:1,repeat:0},{name:"formula.functionList.DOLLAR.functionParameter.decimals.name",detail:"formula.functionList.DOLLAR.functionParameter.decimals.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.EXACT,functionType:t.FunctionType.Text,description:"formula.functionList.EXACT.description",abstract:"formula.functionList.EXACT.abstract",functionParameter:[{name:"formula.functionList.EXACT.functionParameter.text1.name",detail:"formula.functionList.EXACT.functionParameter.text1.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.EXACT.functionParameter.text2.name",detail:"formula.functionList.EXACT.functionParameter.text2.detail",example:'"univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.FIND,functionType:t.FunctionType.Text,description:"formula.functionList.FIND.description",abstract:"formula.functionList.FIND.abstract",functionParameter:[{name:"formula.functionList.FIND.functionParameter.findText.name",detail:"formula.functionList.FIND.functionParameter.findText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.FIND.functionParameter.withinText.name",detail:"formula.functionList.FIND.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.FIND.functionParameter.startNum.name",detail:"formula.functionList.FIND.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.FINDB,functionType:t.FunctionType.Text,description:"formula.functionList.FINDB.description",abstract:"formula.functionList.FINDB.abstract",functionParameter:[{name:"formula.functionList.FINDB.functionParameter.findText.name",detail:"formula.functionList.FINDB.functionParameter.findText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.FINDB.functionParameter.withinText.name",detail:"formula.functionList.FINDB.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.FINDB.functionParameter.startNum.name",detail:"formula.functionList.FINDB.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.FIXED,functionType:t.FunctionType.Text,description:"formula.functionList.FIXED.description",abstract:"formula.functionList.FIXED.abstract",functionParameter:[{name:"formula.functionList.FIXED.functionParameter.number.name",detail:"formula.functionList.FIXED.functionParameter.number.detail",example:"1234.567",require:1,repeat:0},{name:"formula.functionList.FIXED.functionParameter.decimals.name",detail:"formula.functionList.FIXED.functionParameter.decimals.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.FIXED.functionParameter.noCommas.name",detail:"formula.functionList.FIXED.functionParameter.noCommas.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LEFT,functionType:t.FunctionType.Text,description:"formula.functionList.LEFT.description",abstract:"formula.functionList.LEFT.abstract",functionParameter:[{name:"formula.functionList.LEFT.functionParameter.text.name",detail:"formula.functionList.LEFT.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.LEFT.functionParameter.numChars.name",detail:"formula.functionList.LEFT.functionParameter.numChars.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LEFTB,functionType:t.FunctionType.Text,description:"formula.functionList.LEFTB.description",abstract:"formula.functionList.LEFTB.abstract",functionParameter:[{name:"formula.functionList.LEFTB.functionParameter.text.name",detail:"formula.functionList.LEFTB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.LEFTB.functionParameter.numBytes.name",detail:"formula.functionList.LEFTB.functionParameter.numBytes.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LEN,functionType:t.FunctionType.Text,description:"formula.functionList.LEN.description",abstract:"formula.functionList.LEN.abstract",functionParameter:[{name:"formula.functionList.LEN.functionParameter.text.name",detail:"formula.functionList.LEN.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LENB,functionType:t.FunctionType.Text,description:"formula.functionList.LENB.description",abstract:"formula.functionList.LENB.abstract",functionParameter:[{name:"formula.functionList.LENB.functionParameter.text.name",detail:"formula.functionList.LENB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LOWER,functionType:t.FunctionType.Text,description:"formula.functionList.LOWER.description",abstract:"formula.functionList.LOWER.abstract",functionParameter:[{name:"formula.functionList.LOWER.functionParameter.text.name",detail:"formula.functionList.LOWER.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.MID,functionType:t.FunctionType.Text,description:"formula.functionList.MID.description",abstract:"formula.functionList.MID.abstract",functionParameter:[{name:"formula.functionList.MID.functionParameter.text.name",detail:"formula.functionList.MID.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.MID.functionParameter.startNum.name",detail:"formula.functionList.MID.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.MID.functionParameter.numChars.name",detail:"formula.functionList.MID.functionParameter.numChars.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.MIDB,functionType:t.FunctionType.Text,description:"formula.functionList.MIDB.description",abstract:"formula.functionList.MIDB.abstract",functionParameter:[{name:"formula.functionList.MIDB.functionParameter.text.name",detail:"formula.functionList.MIDB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.MIDB.functionParameter.startNum.name",detail:"formula.functionList.MIDB.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.MIDB.functionParameter.numBytes.name",detail:"formula.functionList.MIDB.functionParameter.numBytes.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.NUMBERSTRING,functionType:t.FunctionType.Text,description:"formula.functionList.NUMBERSTRING.description",abstract:"formula.functionList.NUMBERSTRING.abstract",functionParameter:[{name:"formula.functionList.NUMBERSTRING.functionParameter.number.name",detail:"formula.functionList.NUMBERSTRING.functionParameter.number.detail",example:"123",require:1,repeat:0},{name:"formula.functionList.NUMBERSTRING.functionParameter.type.name",detail:"formula.functionList.NUMBERSTRING.functionParameter.type.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.NUMBERVALUE,functionType:t.FunctionType.Text,description:"formula.functionList.NUMBERVALUE.description",abstract:"formula.functionList.NUMBERVALUE.abstract",functionParameter:[{name:"formula.functionList.NUMBERVALUE.functionParameter.text.name",detail:"formula.functionList.NUMBERVALUE.functionParameter.text.detail",example:'"2.500,27"',require:1,repeat:0},{name:"formula.functionList.NUMBERVALUE.functionParameter.decimalSeparator.name",detail:"formula.functionList.NUMBERVALUE.functionParameter.decimalSeparator.detail",example:'","',require:0,repeat:0},{name:"formula.functionList.NUMBERVALUE.functionParameter.groupSeparator.name",detail:"formula.functionList.NUMBERVALUE.functionParameter.groupSeparator.detail",example:'"."',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.PHONETIC,functionType:t.FunctionType.Text,description:"formula.functionList.PHONETIC.description",abstract:"formula.functionList.PHONETIC.abstract",functionParameter:[{name:"formula.functionList.PHONETIC.functionParameter.number1.name",detail:"formula.functionList.PHONETIC.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.PHONETIC.functionParameter.number2.name",detail:"formula.functionList.PHONETIC.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.PROPER,functionType:t.FunctionType.Text,description:"formula.functionList.PROPER.description",abstract:"formula.functionList.PROPER.abstract",functionParameter:[{name:"formula.functionList.PROPER.functionParameter.text.name",detail:"formula.functionList.PROPER.functionParameter.text.detail",example:'"hello univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGEXEXTRACT,functionType:t.FunctionType.Text,description:"formula.functionList.REGEXEXTRACT.description",abstract:"formula.functionList.REGEXEXTRACT.abstract",functionParameter:[{name:"formula.functionList.REGEXEXTRACT.functionParameter.text.name",detail:"formula.functionList.REGEXEXTRACT.functionParameter.text.detail",example:'"abcdefg"',require:1,repeat:0},{name:"formula.functionList.REGEXEXTRACT.functionParameter.regularExpression.name",detail:"formula.functionList.REGEXEXTRACT.functionParameter.regularExpression.detail",example:'"c.*f"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGEXMATCH,functionType:t.FunctionType.Text,description:"formula.functionList.REGEXMATCH.description",abstract:"formula.functionList.REGEXMATCH.abstract",functionParameter:[{name:"formula.functionList.REGEXMATCH.functionParameter.text.name",detail:"formula.functionList.REGEXMATCH.functionParameter.text.detail",example:'"Spreadsheets"',require:1,repeat:0},{name:"formula.functionList.REGEXMATCH.functionParameter.regularExpression.name",detail:"formula.functionList.REGEXMATCH.functionParameter.regularExpression.detail",example:'"S.r"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGEXREPLACE,functionType:t.FunctionType.Text,description:"formula.functionList.REGEXREPLACE.description",abstract:"formula.functionList.REGEXREPLACE.abstract",functionParameter:[{name:"formula.functionList.REGEXREPLACE.functionParameter.text.name",detail:"formula.functionList.REGEXREPLACE.functionParameter.text.detail",example:'"abcedfg"',require:1,repeat:0},{name:"formula.functionList.REGEXREPLACE.functionParameter.regularExpression.name",detail:"formula.functionList.REGEXREPLACE.functionParameter.regularExpression.detail",example:'"a.*d"',require:1,repeat:0},{name:"formula.functionList.REGEXREPLACE.functionParameter.replacement.name",detail:"formula.functionList.REGEXREPLACE.functionParameter.replacement.detail",example:'"xyz"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REPLACE,functionType:t.FunctionType.Text,description:"formula.functionList.REPLACE.description",abstract:"formula.functionList.REPLACE.abstract",functionParameter:[{name:"formula.functionList.REPLACE.functionParameter.oldText.name",detail:"formula.functionList.REPLACE.functionParameter.oldText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.REPLACE.functionParameter.startNum.name",detail:"formula.functionList.REPLACE.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.REPLACE.functionParameter.numChars.name",detail:"formula.functionList.REPLACE.functionParameter.numChars.detail",example:"0",require:1,repeat:0},{name:"formula.functionList.REPLACE.functionParameter.newText.name",detail:"formula.functionList.REPLACE.functionParameter.newText.detail",example:'"Hello "',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REPLACEB,functionType:t.FunctionType.Text,description:"formula.functionList.REPLACEB.description",abstract:"formula.functionList.REPLACEB.abstract",functionParameter:[{name:"formula.functionList.REPLACEB.functionParameter.oldText.name",detail:"formula.functionList.REPLACEB.functionParameter.oldText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.REPLACEB.functionParameter.startNum.name",detail:"formula.functionList.REPLACEB.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.REPLACEB.functionParameter.numBytes.name",detail:"formula.functionList.REPLACEB.functionParameter.numBytes.detail",example:"0",require:1,repeat:0},{name:"formula.functionList.REPLACEB.functionParameter.newText.name",detail:"formula.functionList.REPLACEB.functionParameter.newText.detail",example:'"Hello "',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REPT,functionType:t.FunctionType.Text,description:"formula.functionList.REPT.description",abstract:"formula.functionList.REPT.abstract",functionParameter:[{name:"formula.functionList.REPT.functionParameter.text.name",detail:"formula.functionList.REPT.functionParameter.text.detail",example:'"*-"',require:1,repeat:0},{name:"formula.functionList.REPT.functionParameter.numberTimes.name",detail:"formula.functionList.REPT.functionParameter.numberTimes.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.RIGHT,functionType:t.FunctionType.Text,description:"formula.functionList.RIGHT.description",abstract:"formula.functionList.RIGHT.abstract",functionParameter:[{name:"formula.functionList.RIGHT.functionParameter.text.name",detail:"formula.functionList.RIGHT.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.RIGHT.functionParameter.numChars.name",detail:"formula.functionList.RIGHT.functionParameter.numChars.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.RIGHTB,functionType:t.FunctionType.Text,description:"formula.functionList.RIGHTB.description",abstract:"formula.functionList.RIGHTB.abstract",functionParameter:[{name:"formula.functionList.RIGHTB.functionParameter.text.name",detail:"formula.functionList.RIGHTB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.RIGHTB.functionParameter.numBytes.name",detail:"formula.functionList.RIGHTB.functionParameter.numBytes.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.SEARCH,functionType:t.FunctionType.Text,description:"formula.functionList.SEARCH.description",abstract:"formula.functionList.SEARCH.abstract",functionParameter:[{name:"formula.functionList.SEARCH.functionParameter.findText.name",detail:"formula.functionList.SEARCH.functionParameter.findText.detail",example:'"univer"',require:1,repeat:0},{name:"formula.functionList.SEARCH.functionParameter.withinText.name",detail:"formula.functionList.SEARCH.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.SEARCH.functionParameter.startNum.name",detail:"formula.functionList.SEARCH.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.SEARCHB,functionType:t.FunctionType.Text,description:"formula.functionList.SEARCHB.description",abstract:"formula.functionList.SEARCHB.abstract",functionParameter:[{name:"formula.functionList.SEARCHB.functionParameter.findText.name",detail:"formula.functionList.SEARCHB.functionParameter.findText.detail",example:'"univer"',require:1,repeat:0},{name:"formula.functionList.SEARCHB.functionParameter.withinText.name",detail:"formula.functionList.SEARCHB.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.SEARCHB.functionParameter.startNum.name",detail:"formula.functionList.SEARCHB.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.SUBSTITUTE,functionType:t.FunctionType.Text,description:"formula.functionList.SUBSTITUTE.description",abstract:"formula.functionList.SUBSTITUTE.abstract",functionParameter:[{name:"formula.functionList.SUBSTITUTE.functionParameter.text.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.text.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.SUBSTITUTE.functionParameter.oldText.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.oldText.detail",example:'"Hello"',require:1,repeat:0},{name:"formula.functionList.SUBSTITUTE.functionParameter.newText.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.newText.detail",example:'"Hi"',require:1,repeat:0},{name:"formula.functionList.SUBSTITUTE.functionParameter.instanceNum.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.instanceNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.T,functionType:t.FunctionType.Text,description:"formula.functionList.T.description",abstract:"formula.functionList.T.abstract",functionParameter:[{name:"formula.functionList.T.functionParameter.value.name",detail:"formula.functionList.T.functionParameter.value.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXT,functionType:t.FunctionType.Text,description:"formula.functionList.TEXT.description",abstract:"formula.functionList.TEXT.abstract",functionParameter:[{name:"formula.functionList.TEXT.functionParameter.value.name",detail:"formula.functionList.TEXT.functionParameter.value.detail",example:"1.23",require:1,repeat:0},{name:"formula.functionList.TEXT.functionParameter.formatText.name",detail:"formula.functionList.TEXT.functionParameter.formatText.detail",example:'"$0.00"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTAFTER,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTAFTER.description",abstract:"formula.functionList.TEXTAFTER.abstract",functionParameter:[{name:"formula.functionList.TEXTAFTER.functionParameter.text.name",detail:"formula.functionList.TEXTAFTER.functionParameter.text.detail",example:'"Red riding hood’s, red hood"',require:1,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.delimiter.name",detail:"formula.functionList.TEXTAFTER.functionParameter.delimiter.detail",example:'"hood"',require:1,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.instanceNum.name",detail:"formula.functionList.TEXTAFTER.functionParameter.instanceNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.matchMode.name",detail:"formula.functionList.TEXTAFTER.functionParameter.matchMode.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.matchEnd.name",detail:"formula.functionList.TEXTAFTER.functionParameter.matchEnd.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.ifNotFound.name",detail:"formula.functionList.TEXTAFTER.functionParameter.ifNotFound.detail",example:'"not found"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTBEFORE,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTBEFORE.description",abstract:"formula.functionList.TEXTBEFORE.abstract",functionParameter:[{name:"formula.functionList.TEXTBEFORE.functionParameter.text.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.text.detail",example:'"Red riding hood’s, red hood"',require:1,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.delimiter.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.delimiter.detail",example:'"hood"',require:1,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.instanceNum.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.instanceNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.matchMode.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.matchMode.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.matchEnd.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.matchEnd.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.ifNotFound.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.ifNotFound.detail",example:'"not found"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTJOIN,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTJOIN.description",abstract:"formula.functionList.TEXTJOIN.abstract",functionParameter:[{name:"formula.functionList.TEXTJOIN.functionParameter.delimiter.name",detail:"formula.functionList.TEXTJOIN.functionParameter.delimiter.detail",example:'", "',require:1,repeat:0},{name:"formula.functionList.TEXTJOIN.functionParameter.ignoreEmpty.name",detail:"formula.functionList.TEXTJOIN.functionParameter.ignoreEmpty.detail",example:"true",require:1,repeat:0},{name:"formula.functionList.TEXTJOIN.functionParameter.text1.name",detail:"formula.functionList.TEXTJOIN.functionParameter.text1.detail",example:'"Hi"',require:1,repeat:0},{name:"formula.functionList.TEXTJOIN.functionParameter.text2.name",detail:"formula.functionList.TEXTJOIN.functionParameter.text2.detail",example:'"Univer"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTSPLIT,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTSPLIT.description",abstract:"formula.functionList.TEXTSPLIT.abstract",functionParameter:[{name:"formula.functionList.TEXTSPLIT.functionParameter.text.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.text.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.colDelimiter.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.colDelimiter.detail",example:'","',require:1,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.rowDelimiter.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.rowDelimiter.detail",example:'";"',require:0,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.ignoreEmpty.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.ignoreEmpty.detail",example:"",require:0,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.matchMode.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.matchMode.detail",example:"",require:0,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.padWith.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.padWith.detail",example:"",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TRIM,functionType:t.FunctionType.Text,description:"formula.functionList.TRIM.description",abstract:"formula.functionList.TRIM.abstract",functionParameter:[{name:"formula.functionList.TRIM.functionParameter.text.name",detail:"formula.functionList.TRIM.functionParameter.text.detail",example:'" Hello Univer "',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.UNICHAR,functionType:t.FunctionType.Text,description:"formula.functionList.UNICHAR.description",abstract:"formula.functionList.UNICHAR.abstract",functionParameter:[{name:"formula.functionList.UNICHAR.functionParameter.number.name",detail:"formula.functionList.UNICHAR.functionParameter.number.detail",example:"65",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.UNICODE,functionType:t.FunctionType.Text,description:"formula.functionList.UNICODE.description",abstract:"formula.functionList.UNICODE.abstract",functionParameter:[{name:"formula.functionList.UNICODE.functionParameter.text.name",detail:"formula.functionList.UNICODE.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.UPPER,functionType:t.FunctionType.Text,description:"formula.functionList.UPPER.description",abstract:"formula.functionList.UPPER.abstract",functionParameter:[{name:"formula.functionList.UPPER.functionParameter.text.name",detail:"formula.functionList.UPPER.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.VALUE,functionType:t.FunctionType.Text,description:"formula.functionList.VALUE.description",abstract:"formula.functionList.VALUE.abstract",functionParameter:[{name:"formula.functionList.VALUE.functionParameter.text.name",detail:"formula.functionList.VALUE.functionParameter.text.detail",example:'"123"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.VALUETOTEXT,functionType:t.FunctionType.Text,description:"formula.functionList.VALUETOTEXT.description",abstract:"formula.functionList.VALUETOTEXT.abstract",functionParameter:[{name:"formula.functionList.VALUETOTEXT.functionParameter.value.name",detail:"formula.functionList.VALUETOTEXT.functionParameter.value.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.VALUETOTEXT.functionParameter.format.name",detail:"formula.functionList.VALUETOTEXT.functionParameter.format.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CALL,functionType:t.FunctionType.Text,description:"formula.functionList.CALL.description",abstract:"formula.functionList.CALL.abstract",functionParameter:[{name:"formula.functionList.CALL.functionParameter.number1.name",detail:"formula.functionList.CALL.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CALL.functionParameter.number2.name",detail:"formula.functionList.CALL.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.EUROCONVERT,functionType:t.FunctionType.Text,description:"formula.functionList.EUROCONVERT.description",abstract:"formula.functionList.EUROCONVERT.abstract",functionParameter:[{name:"formula.functionList.EUROCONVERT.functionParameter.number1.name",detail:"formula.functionList.EUROCONVERT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.EUROCONVERT.functionParameter.number2.name",detail:"formula.functionList.EUROCONVERT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGISTER_ID,functionType:t.FunctionType.Text,description:"formula.functionList.REGISTER_ID.description",abstract:"formula.functionList.REGISTER_ID.abstract",functionParameter:[{name:"formula.functionList.REGISTER_ID.functionParameter.number1.name",detail:"formula.functionList.REGISTER_ID.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.REGISTER_ID.functionParameter.number2.name",detail:"formula.functionList.REGISTER_ID.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]}],Qe=[],je=[{functionName:t.FUNCTION_NAMES_WEB.ENCODEURL,functionType:t.FunctionType.Web,description:"formula.functionList.ENCODEURL.description",abstract:"formula.functionList.ENCODEURL.abstract",functionParameter:[{name:"formula.functionList.ENCODEURL.functionParameter.text.name",detail:"formula.functionList.ENCODEURL.functionParameter.text.detail",example:'"https://univer.ai/"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_WEB.FILTERXML,functionType:t.FunctionType.Web,description:"formula.functionList.FILTERXML.description",abstract:"formula.functionList.FILTERXML.abstract",functionParameter:[{name:"formula.functionList.FILTERXML.functionParameter.number1.name",detail:"formula.functionList.FILTERXML.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FILTERXML.functionParameter.number2.name",detail:"formula.functionList.FILTERXML.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_WEB.WEBSERVICE,functionType:t.FunctionType.Web,description:"formula.functionList.WEBSERVICE.description",abstract:"formula.functionList.WEBSERVICE.abstract",functionParameter:[{name:"formula.functionList.WEBSERVICE.functionParameter.number1.name",detail:"formula.functionList.WEBSERVICE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.WEBSERVICE.functionParameter.number2.name",detail:"formula.functionList.WEBSERVICE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]}],$e=[...Ye,...Ge,...Ke,...ge,...We,...Ve,...ke,...we,...Xe,...He,...ve,...Be,...je,...Fe,...Qe];function ze(r,e){let a="";return r.aliasFunctionName?(a=e.t(r.aliasFunctionName),a===r.aliasFunctionName&&(a=r.functionName)):a=r.functionName,a}var Ze=Object.getOwnPropertyDescriptor,Je=(r,e,a,n)=>{for(var i=n>1?void 0:n?Ze(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},Ct=(r,e)=>(a,n)=>e(a,n,r);const ut=f.createIdentifier("formula.description-service");E.DescriptionService=class{constructor(e,a,n){h(this,"_descriptions",[]);this._functionService=e,this._localeService=a,this._configService=n,this._initialize()}dispose(){this._localeService.localeChanged$.complete()}getDescriptions(){return this._functionService.getDescriptions()}hasFunction(e){return this._functionService.getDescriptions().get(e.toLocaleUpperCase())!==void 0}getFunctionInfo(e){return this._functionService.getDescriptions().get(e.toLocaleUpperCase())}getSearchListByName(e){const a=[],n=this._functionService.getDescriptions(),i=e.toLocaleUpperCase().trim();return n.forEach(o=>{const{functionName:u,abstract:c,functionType:s}=o;u.toLocaleUpperCase().indexOf(i)>-1&&s!==t.FunctionType.DefinedName&&a.push({name:u,desc:c})}),a}getSearchListByNameFirstLetter(e){const a=[],n=this._functionService.getDescriptions(),i=e.toLocaleUpperCase().trim();return n.forEach(o=>{const{functionName:u,abstract:c}=o;u.toLocaleUpperCase().indexOf(i)===0&&a.push({name:u,desc:c})}),a}getSearchListByType(e){const a=[];return this._functionService.getDescriptions().forEach(i=>{const{functionName:o,functionType:u,abstract:c}=i;(u===e||e===-1)&&u!==t.FunctionType.DefinedName&&a.push({name:o,desc:c})}),a}registerDescriptions(e){return this._descriptions=this._descriptions.concat(e),this._registerDescriptions(),f.toDisposable(()=>{const a=e.map(n=>n.functionName);this.unregisterDescriptions(a)})}unregisterDescriptions(e){this._descriptions=this._descriptions.filter(a=>!e.includes(a.functionName)),this._functionService.unregisterDescriptions(...e)}hasDescription(e){return this._descriptions.some(a=>a.functionName===e)}hasDefinedNameDescription(e){return this._descriptions.some(a=>a.functionName===e&&a.functionType===t.FunctionType.DefinedName)}isFormulaDefinedName(e){const a=this._descriptions.filter(i=>i.functionName===e&&i.functionType===t.FunctionType.DefinedName);if(a.length===0)return!1;const n=a[0].description;return!t.isReferenceStrings(n)}_initialize(){this._localeService.localeChanged$.subscribe(()=>{this._registerDescriptions()}),this._initDescription(),this._registerDescriptions()}_initDescription(){var i;const e=[...t.functionArray,...t.functionCompatibility,...t.functionCube,...t.functionDatabase,...t.functionDate,...t.functionEngineering,...t.functionFinancial,...t.functionInformation,...t.functionLogical,...t.functionLookup,...t.functionMath,...t.functionMeta,...t.functionStatistical,...t.functionText,...t.functionUniver,...t.functionWeb].map(o=>o[1]),a=$e.filter(o=>e.includes(o.functionName)),n=this._configService.getConfig(nt);this._descriptions=a.concat((i=n==null?void 0:n.description)!=null?i:[])}_registerDescriptions(){const e=this._localeService,a=this._descriptions.map(n=>({functionName:ze(n,e),functionType:n.functionType,description:e.t(n.description),abstract:e.t(n.abstract),functionParameter:n.functionParameter.map(i=>({name:e.t(i.name),detail:e.t(i.detail),example:i.example,require:i.require,repeat:i.repeat}))}));this._functionService.registerDescriptions(...a)}},E.DescriptionService=Je([Ct(0,t.IFunctionService),Ct(1,f.Inject(f.LocaleService)),Ct(2,f.IConfigService)],E.DescriptionService);var ta=Object.getOwnPropertyDescriptor,ea=(r,e,a,n)=>{for(var i=n>1?void 0:n?ta(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},ct=(r,e)=>(a,n)=>e(a,n,r);function vt(r,e,a,n){const i=r.sequenceNodesBuilder(e);if(i==null)return e;const o=[];for(let u=0,c=i.length;u<c;u++){const s=i[u];if(typeof s=="string"||s.nodeType!==t.sequenceNodeType.REFERENCE)continue;const{token:l}=s,d=t.deserializeRangeWithSheetWithCache(l),{sheetName:T,unitId:N}=d;let A=d.range;A.startAbsoluteRefType===f.AbsoluteRefType.ALL&&A.endAbsoluteRefType===f.AbsoluteRefType.ALL||(A=f.moveRangeByOffset(A,a,n),o.push({unitId:N,sheetName:T,range:A}))}return o.map(u=>`${u.unitId}!${u.sheetName}!${u.range.startRow}!${u.range.endRow}!${u.range.startColumn}!${u.range.endColumn}`).join("|")}E.FormulaRefRangeService=class extends f.Disposable{constructor(e,a,n,i){super(),this._refRangeService=e,this._lexerTreeBuilder=a,this._univerInstanceService=n,this._injector=i}transformFormulaByEffectCommand(e,a,n,i){const o=this._lexerTreeBuilder.sequenceNodesBuilder(n),u=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET),c=u.getActiveSheet(),s=u.getUnitId(),l=c.getSheetId(),d=o==null?void 0:o.map(T=>{if(typeof T=="object"&&T.nodeType===t.sequenceNodeType.REFERENCE){const N=t.deserializeRangeWithSheetWithCache(T.token),{range:A,unitId:S,sheetName:C}=N,p=this._univerInstanceService.getUnit(S||e),P=C?p==null?void 0:p.getSheetBySheetName(C):p==null?void 0:p.getSheetBySheetId(a);if(!P)throw new Error("Sheet not found");const I=p.getUnitId(),L=P.getSheetId();if(I!==s||L!==l)return T;const _=m.handleDefaultRangeChangeWithEffectRefCommands(A,i);let R="";if(_){const x=_.startColumn-A.startColumn,q=_.startRow-A.startRow,D=f.moveRangeByOffset(A,x,q);S&&C?R=t.serializeRangeWithSpreadsheet(S,C,D):C?R=t.serializeRangeWithSheet(C,D):R=t.serializeRange(D)}else R=t.ErrorType.REF;return{...T,token:R}}else return T});return d?`=${t.generateStringWithSequence(d)}`:""}registerFormula(e,a,n,i){const o=new Map,u=this._lexerTreeBuilder.sequenceNodesBuilder(n),c=new f.DisposableCollection,s=l=>{const d=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET),T=d.getActiveSheet(),N=d.getUnitId(),A=T.getSheetId(),S=u==null?void 0:u.map(p=>{if(typeof p=="object"&&p.nodeType===t.sequenceNodeType.REFERENCE){const P=o.get(p.token);if(P.unitId!==N||P.subUnitId!==A)return p;const I=m.handleDefaultRangeChangeWithEffectRefCommands(P.range,l);let L="";if(I){const _=I.startColumn-P.range.startColumn,R=I.startRow-P.range.startRow,x=f.moveRangeByOffset(P.range,_,R);P.unitId&&P.sheetName?L=t.serializeRangeWithSpreadsheet(P.unitId,P.sheetName,x):P.sheetName?L=t.serializeRangeWithSheet(P.sheetName,x):L=t.serializeRange(x)}else L=t.ErrorType.REF;return{...p,token:L}}else return p}),C=S&&t.generateStringWithSequence(S);return i(`=${C}`)};return u==null||u.forEach(l=>{if(typeof l=="object"&&l.nodeType===t.sequenceNodeType.REFERENCE){const d=t.deserializeRangeWithSheetWithCache(l.token),{range:T,unitId:N,sheetName:A}=d,S=this._univerInstanceService.getUnit(N||e),C=A?S==null?void 0:S.getSheetBySheetName(A):S==null?void 0:S.getSheetBySheetId(a);if(!C)return;const p=S.getUnitId(),P=C.getSheetId(),I={unitId:p,subUnitId:P,range:T,sheetName:A};o.set(l.token,I),c.add(this._refRangeService.registerRefRange(T,s,p,P))}}),c}_getFormulaDependcy(e,a,n,i){const o=f.isFormulaString(n)?this._lexerTreeBuilder.sequenceNodesBuilder(n):null,u=[];return o==null||o.forEach(c=>{if(typeof c=="object"&&c.nodeType===t.sequenceNodeType.REFERENCE){const s=t.deserializeRangeWithSheetWithCache(c.token),{range:l,unitId:d,sheetName:T}=s;if(l.startAbsoluteRefType===f.AbsoluteRefType.ALL&&l.endAbsoluteRefType===f.AbsoluteRefType.ALL)return;const N=this._univerInstanceService.getUnit(d||e),A=T?N==null?void 0:N.getSheetBySheetName(T):N==null?void 0:N.getSheetBySheetId(a);if(!A)return;const S=N.getUnitId(),C=A.getSheetId(),p=i[0].startRow,P=i[0].startColumn,I=l.startRow,L=l.startColumn,_=i.map(R=>({startRow:R.startRow-p+I,endRow:R.endRow-p+I,startColumn:R.startColumn-P+L,endColumn:R.endColumn-P+L}));u.push({unitId:S,subUnitId:C,ranges:_})}}),u}registerRangeFormula(e,a,n,i,o){const u=new f.DisposableCollection,c=i.map(l=>this._getFormulaDependcy(e,a,l,n)),s=l=>{const d=n[0].startRow,T=n[0].startColumn,N=[{unitId:e,subUnitId:a,ranges:n},...c.flat()],A=[],S=m.getSeparateEffectedRangesOnCommand(this._injector,l);for(const{unitId:C,subUnitId:p,ranges:P}of N)if(C===S.unitId&&p===S.subUnitId){const I=[],L=P[0].startRow,_=P[0].startColumn,R=L-d,x=_-T;for(const q of S.ranges){const D=P.map(y=>f.getIntersectRange(q,y)).filter(Boolean);D.length>0&&I.push(...D)}I.length>0&&A.push(I.map(q=>({startRow:q.startRow-R,endRow:q.endRow-R,startColumn:q.startColumn-x,endColumn:q.endColumn-x})))}if(A.length>0){const C=f.Rectangle.splitIntoGrid([...A.flat()]),p=f.Rectangle.subtractMulti(n,C);p.sort((R,x)=>R.startRow-x.startRow||R.startColumn-x.startColumn);const P=new Map;for(let R=0;R<C.length;R++){const x=C[R],q=x.startRow,D=x.startColumn,y=q-d,M=D-T,U=m.handleCommonDefaultRangeChangeWithEffectRefCommands(x,l).sort((B,W)=>B.startRow-W.startRow||B.startColumn-W.startColumn);if(!U.length)continue;const F=U[0].startRow,O=U[0].startColumn,v=F-d,$=O-T,z=[];for(let B=0;B<i.length;B++){const W=i[B],G=f.isFormulaString(W),Nt=G?this._lexerTreeBuilder.moveFormulaRefOffset(W,M,y):W,K=G?this.transformFormulaByEffectCommand(e,a,Nt,l):Nt,Z=vt(this._lexerTreeBuilder,K,-$,-v);z.push({newFormula:K,orginFormula:Z})}const w={formulas:z,ranges:U,key:z.map(B=>B.orginFormula).join("_")};P.has(w.key)?P.get(w.key).push(w):P.set(w.key,[w])}const I=i.map(R=>vt(this._lexerTreeBuilder,R,0,0)).join("_");if(p.length>0){const R=p[0].startRow,x=p[0].startColumn,q=[];for(let y=0;y<i.length;y++){const M=i[y];q.push({newFormula:f.isFormulaString(M)?this._lexerTreeBuilder.moveFormulaRefOffset(M,x-T,R-d):M,orginFormula:M})}const D={formulas:q,ranges:p,key:I};P.has(D.key)?P.get(D.key).push(D):P.set(D.key,[D])}const L=[],_=Array.from(P.keys());for(let R=_.length-1;R>=0;R--){const x=_[R],q=P.get(x).sort((M,U)=>M.ranges[0].startRow-U.ranges[0].startRow||M.ranges[0].startColumn-U.ranges[0].startColumn),D=[];for(let M=0;M<q[0].formulas.length;M++)D.push(q[0].formulas[M].newFormula);const y=f.Rectangle.mergeRanges(q.map(M=>M.ranges).flat());y.sort((M,U)=>M.startRow-U.startRow||M.startColumn-U.startColumn),L.push({formulas:D,ranges:y})}return o(L)}return{undos:[],redos:[]}};return n.forEach(l=>{const d=this._refRangeService.registerRefRange(l,s,e,a);u.add(d)}),[...c.flat()].forEach(({unitId:l,subUnitId:d,ranges:T})=>{T.forEach(N=>{const A=this._refRangeService.registerRefRange(N,s,l,d);u.add(A)})}),u}},E.FormulaRefRangeService=ea([ct(0,f.Inject(m.RefRangeService)),ct(1,f.Inject(t.LexerTreeBuilder)),ct(2,f.IUniverInstanceService),ct(3,f.Inject(f.Injector))],E.FormulaRefRangeService);var aa=Object.getOwnPropertyDescriptor,na=(r,e,a,n)=>{for(var i=n>1?void 0:n?aa(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},ia=(r,e)=>(a,n)=>e(a,n,r);const Rt="sheets-formula.remote-register-function.service",Ot=f.createIdentifier(Rt);E.RemoteRegisterFunctionService=class{constructor(e){this._functionService=e}async registerFunctions(e){const a=e.map(([n,i])=>ra(n,i));this._functionService.registerExecutors(...a)}async registerAsyncFunctions(e){const a=e.map(([n,i])=>oa(n,i));this._functionService.registerExecutors(...a)}async unregisterFunctions(e){this._functionService.unregisterDescriptions(...e)}},E.RemoteRegisterFunctionService=na([ia(0,t.IFunctionService)],E.RemoteRegisterFunctionService);function ra(r,e){const a=new t.CustomFunction(e),n=new Function(`return ${r}`)();return a.calculateCustom=n,a}function oa(r,e){const a=new t.AsyncCustomFunction(e),n=new Function(`return ${r}`)();return a.calculateCustom=n,a}var ua=Object.getOwnPropertyDescriptor,ca=(r,e,a,n)=>{for(var i=n>1?void 0:n?ua(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},ft=(r,e)=>(a,n)=>e(a,n,r);const Vt=f.createIdentifier("sheets-formula.register-function-service");E.RegisterFunctionService=class extends f.Disposable{constructor(e,a,n,i){super(),this._localeService=e,this._descriptionService=a,this._functionService=n,this._remoteRegisterFunctionService=i}registerFunction(e){return this._registerSingleFunction(e)}registerAsyncFunction(e){return this._registerSingleFunction({...e,async:!0})}registerFunctions(e){const{locales:a,description:n,calculate:i}=e;a&&this._localeService.load(a);const o=new f.DisposableCollection;if(n)o.add(this._descriptionService.registerDescriptions(n));else{const u=i.map(([c,s,l])=>({functionName:s,functionType:t.FunctionType.User,description:"",abstract:l||"",functionParameter:[]}));o.add(this._functionService.registerDescriptions(...u))}return o.add(this._registerLocalExecutors(i)),this._remoteRegisterFunctionService&&o.add(this._registerRemoteExecutors(i)),o}_registerSingleFunction(e){const{name:a,func:n,description:i,locales:o,async:u=!1}=e,c=new f.DisposableCollection;if(o&&this._localeService.load(o),typeof i=="string"){const l={functionName:a,functionType:t.FunctionType.User,description:i,abstract:i||"",functionParameter:[]};c.add(this._descriptionService.registerDescriptions([l]))}else c.add(this._descriptionService.registerDescriptions([i]));const s=u?new t.AsyncCustomFunction(a):new t.CustomFunction(a);return s.calculateCustom=n,this._functionService.registerExecutors(s),c.add(f.toDisposable(()=>this._functionService.unregisterExecutors(a))),this._remoteRegisterFunctionService&&(this._remoteRegisterFunctionService.registerAsyncFunctions([[n.toString(),a]]),c.add(f.toDisposable(()=>this._remoteRegisterFunctionService.unregisterFunctions([a])))),c}_registerLocalExecutors(e){const a=e.map(([i,o])=>o),n=e.map(([i,o])=>{const u=new t.CustomFunction(o);return u.calculateCustom=i,u});return this._functionService.registerExecutors(...n),f.toDisposable(()=>this._functionService.unregisterExecutors(...a))}_registerRemoteExecutors(e){const a=[],n=e.map(([i,o])=>(a.push(o),[i.toString(),o]));return this._remoteRegisterFunctionService.registerFunctions(n),f.toDisposable(()=>this._remoteRegisterFunctionService.unregisterFunctions(a))}},E.RegisterFunctionService=ca([ft(0,f.Inject(f.LocaleService)),ft(1,f.Inject(ut)),ft(2,t.IFunctionService),ft(3,f.Optional(Ot))],E.RegisterFunctionService);const fa="SHEETS_FORMULA_PLUGIN";var ma=Object.getOwnPropertyDescriptor,sa=(r,e,a,n)=>{for(var i=n>1?void 0:n?ma(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},Mt=(r,e)=>(a,n)=>e(a,n,r);let mt=class extends f.Disposable{constructor(r,e,a){super(),this._activeDirtyManagerService=r,this._univerInstanceService=e,this._formulaDataModel=a,this._initialize()}_initialize(){this._initialConversion()}_initialConversion(){this._activeDirtyManagerService.register(m.SetRangeValuesMutation.id,{commandId:m.SetRangeValuesMutation.id,getDirtyData:r=>{const e=r.params;return e.trigger===m.SetStyleCommand.id?{}:{dirtyRanges:this._getSetRangeValuesMutationDirtyRange(e)}}}),this._initialMove(),this._initialRowAndColumn(),this._initialSheet(),this._initialDefinedName()}_initialMove(){this._activeDirtyManagerService.register(m.MoveRangeMutation.id,{commandId:m.MoveRangeMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getMoveRangeMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.to.subUnitId]:"1",[e.from.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.MoveRowsMutation.id,{commandId:m.MoveRowsMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getMoveRowsMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.MoveColsMutation.id,{commandId:m.MoveColsMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getMoveRowsMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.ReorderRangeMutation.id,{commandId:m.ReorderRangeMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getReorderRangeMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}})}_initialRowAndColumn(){this._activeDirtyManagerService.register(m.RemoveRowMutation.id,{commandId:m.RemoveRowMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getRemoveRowOrColumnMutation(e,!0),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.RemoveColMutation.id,{commandId:m.RemoveColMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getRemoveRowOrColumnMutation(e,!1),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.InsertColMutation.id,{commandId:m.InsertColMutation.id,getDirtyData:r=>{const e=r.params;return{clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.InsertRowMutation.id,{commandId:m.InsertRowMutation.id,getDirtyData:r=>{const e=r.params;return{clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}})}_initialSheet(){this._activeDirtyManagerService.register(m.RemoveSheetMutation.id,{commandId:m.RemoveSheetMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyNameMap:this._getRemoveSheetMutation(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.InsertSheetMutation.id,{commandId:m.InsertSheetMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyNameMap:this._getInsertSheetMutation(e)}}})}_initialDefinedName(){this._activeDirtyManagerService.register(t.SetDefinedNameMutation.id,{commandId:t.SetDefinedNameMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyDefinedNameMap:this._getDefinedNameMutation(e)}}}),this._activeDirtyManagerService.register(t.RemoveDefinedNameMutation.id,{commandId:t.RemoveDefinedNameMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyDefinedNameMap:this._getDefinedNameMutation(e)}}})}_getDefinedNameMutation(r){const{unitId:e,name:a,formulaOrRefString:n}=r,i={};return r==null?{}:(i[e]={},i[e][a]=n,i)}_getSetRangeValuesMutationDirtyRange(r){const{subUnitId:e,unitId:a,cellValue:n}=r,i=[];return n==null||(i.push(...this._getDirtyRangesByCellValue(a,e,n)),i.push(...this._getDirtyRangesForArrayFormula(a,e,n))),i}_getMoveRangeMutationDirtyRange(r){const{unitId:e,from:a,to:n}=r,i=[];return i.push(...this._getDirtyRangesByCellValue(e,a.subUnitId,a.value)),i.push(...this._getDirtyRangesByCellValue(e,n.subUnitId,n.value)),i.push(...this._getDirtyRangesForArrayFormula(e,n.subUnitId,n.value)),i}_getMoveRowsMutationDirtyRange(r){const{subUnitId:e,unitId:a,sourceRange:n,targetRange:i}=r,o=[],u=this._rangeToMatrix(n).getData(),c=this._rangeToMatrix(i).getData();return o.push(...this._getDirtyRangesByCellValue(a,e,u)),o.push(...this._getDirtyRangesByCellValue(a,e,c)),o.push(...this._getDirtyRangesForArrayFormula(a,e,c)),o}_getReorderRangeMutationDirtyRange(r){const{unitId:e,subUnitId:a,range:n}=r,i=this._rangeToMatrix(n).getData(),o=[];return o.push(...this._getDirtyRangesByCellValue(e,a,i)),o.push(...this._getDirtyRangesForArrayFormula(e,a,i)),o}_getRemoveRowOrColumnMutation(r,e=!0){const{subUnitId:a,unitId:n,range:i}=r,o=[],u=this._univerInstanceService.getUniverSheetInstance(n),c=u==null?void 0:u.getSheetBySheetId(a),s=(c==null?void 0:c.getRowCount())||0,l=(c==null?void 0:c.getColumnCount())||0;let d=null;const{startRow:T,endRow:N,startColumn:A,endColumn:S}=i;e===!0?d=this._rangeToMatrix({startRow:T,startColumn:0,endRow:N,endColumn:l-1}):d=this._rangeToMatrix({startRow:0,startColumn:A,endRow:s,endColumn:S});const C=d.getData();return o.push(...this._getDirtyRangesByCellValue(n,a,C)),o.push(...this._getDirtyRangesForArrayFormula(n,a,C)),o}_getRemoveSheetMutation(r){const e={},{subUnitId:a,unitId:n,subUnitName:i}=r;return e[n]==null&&(e[n]={}),e[n][a]=i,e}_getInsertSheetMutation(r){const e={},{sheet:a,unitId:n}=r;return e[n]==null&&(e[n]={}),e[n][a.id]=a.name,e}_rangeToMatrix(r){const e=new f.ObjectMatrix,{startRow:a,startColumn:n,endRow:i,endColumn:o}=r;for(let u=a;u<=i;u++)for(let c=n;c<=o;c++)e.setValue(u,c,{});return e}_getDirtyRangesByCellValue(r,e,a){const n=[];return a==null||new f.ObjectMatrix(a).getDiscreteRanges().forEach(u=>{n.push({unitId:r,sheetId:e,range:u})}),n}_getDirtyRangesForArrayFormula(r,e,a){var u,c;const n=[];if(a==null)return n;const i=new f.ObjectMatrix(a),o=this._formulaDataModel.getArrayFormulaRange();if((u=o==null?void 0:o[r])!=null&&u[e]){const s=new f.ObjectMatrix((c=o==null?void 0:o[r])==null?void 0:c[e]);i.forValue((l,d)=>{s.forValue((T,N,A)=>{if(A==null)return!0;const{startRow:S,startColumn:C,endRow:p,endColumn:P}=A;l>=S&&l<=p&&d>=C&&d<=P&&n.push({unitId:r,sheetId:e,range:{startRow:S,startColumn:C,endRow:S,endColumn:C}})})})}return n}};mt=sa([Mt(0,t.IActiveDirtyManagerService),Mt(1,f.IUniverInstanceService),Mt(2,f.Inject(t.FormulaDataModel))],mt);var la=Object.getOwnPropertyDescriptor,pa=(r,e,a,n)=>{for(var i=n>1?void 0:n?la(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},_t=(r,e)=>(a,n)=>e(a,n,r);let st=class extends f.Disposable{constructor(r,e,a){super(),this._commandService=r,this._sheetInterceptorService=e,this._formulaDataModel=a,this._initialize()}_initialize(){this._commandExecutedListener(),this._initInterceptorCellContent()}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted(r=>{if(r.id!==t.SetArrayFormulaDataMutation.id)return;const e=r.params;if(e==null)return;const{arrayFormulaRange:a,arrayFormulaCellData:n}=e;this._formulaDataModel.setArrayFormulaRange(a),this._formulaDataModel.setArrayFormulaCellData(n)}))}_initInterceptorCellContent(){this.disposeWithMe(this._sheetInterceptorService.intercept(m.INTERCEPTOR_POINT.CELL_CONTENT,{priority:100,effect:f.InterceptorEffectEnum.Value,handler:(r,e,a)=>{var l,d,T;const{unitId:n,subUnitId:i,row:o,col:u}=e,c=this._formulaDataModel.getArrayFormulaCellData(),s=(T=(d=(l=c==null?void 0:c[n])==null?void 0:l[i])==null?void 0:d[o])==null?void 0:T[u];return s==null?a(r):s.v==null&&s.t==null?a({...r,v:0,t:f.CellValueType.NUMBER}):(r==null?void 0:r.t)===f.CellValueType.NUMBER&&r.v!==void 0&&r.v!==null&&f.isRealNum(r.v)?a({...r,v:t.stripErrorMargin(Number(r.v))}):a({...r,v:s.v,t:s.t})}}))}};st=pa([_t(0,f.ICommandService),_t(1,f.Inject(m.SheetInterceptorService)),_t(2,f.Inject(t.FormulaDataModel))],st);var da=Object.getOwnPropertyDescriptor,La=(r,e,a,n)=>{for(var i=n>1?void 0:n?da(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},lt=(r,e)=>(a,n)=>e(a,n,r);let pt=class extends f.Disposable{constructor(e,a,n,i){super();h(this,"_preUnitId",null);this._descriptionService=e,this._definedNamesService=a,this._univerInstanceService=n,this._commandService=i,this._initialize()}_initialize(){this._descriptionListener(),this._changeUnitListener(),this._changeSheetListener()}_descriptionListener(){f.toDisposable(this._definedNamesService.update$.subscribe(()=>{this._registerDescriptions()}))}_changeUnitListener(){f.toDisposable(this._univerInstanceService.getCurrentTypeOfUnit$(f.UniverInstanceType.UNIVER_SHEET).subscribe(()=>{this._unRegisterDescriptions(),this._registerDescriptions()}))}_changeSheetListener(){this.disposeWithMe(this._commandService.onCommandExecuted((e,a)=>{if(!(a!=null&&a.fromCollab)){if(e.id===m.SetWorksheetActiveOperation.id)this._unregisterDescriptionsForNotInSheetId(),this._registerDescriptions();else if(e.id===t.SetDefinedNameMutation.id){const n=e.params;this._registerDescription(n)}else if(e.id===t.RemoveDefinedNameMutation.id){const n=e.params;this._unregisterDescription(n)}}}))}_registerDescription(e){const{unitId:a,sheetId:n}=this._getUnitIdAndSheetId();if(a==null||n==null)return;const{name:i,comment:o,formulaOrRefString:u,localSheetId:c}=e;!this._descriptionService.hasDescription(i)&&(c==null||c===m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME||c===n)&&this._descriptionService.registerDescriptions([{functionName:i,description:u+(o||""),abstract:u,functionType:t.FunctionType.DefinedName,functionParameter:[]}])}_unregisterDescription(e){const{name:a}=e;this._descriptionService.unregisterDescriptions([a])}_unRegisterDescriptions(){if(this._preUnitId==null)return;const e=this._definedNamesService.getDefinedNameMap(this._preUnitId);if(e==null)return;const a=[];Array.from(Object.values(e)).forEach(n=>{const{name:i}=n;a.push(i)}),this._descriptionService.unregisterDescriptions(a),this._preUnitId=null}_getUnitIdAndSheetId(){const e=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET);if(e==null)return{};const a=e.getActiveSheet();return a==null?{}:{unitId:e.getUnitId(),sheetId:a.getSheetId()}}_registerDescriptions(){const{unitId:e,sheetId:a}=this._getUnitIdAndSheetId();if(e==null||a==null)return;const n=this._definedNamesService.getDefinedNameMap(e);if(!n)return;const i=[];this._preUnitId=e,Array.from(Object.values(n)).forEach(o=>{const{name:u,comment:c,formulaOrRefString:s,localSheetId:l}=o;!this._descriptionService.hasDescription(u)&&(l==null||l===m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME||l===a)&&i.push({functionName:u,description:s+(c||""),abstract:s,functionType:t.FunctionType.DefinedName,functionParameter:[]})}),this._descriptionService.registerDescriptions(i)}_unregisterDescriptionsForNotInSheetId(){const{unitId:e,sheetId:a}=this._getUnitIdAndSheetId();if(e==null||a==null)return;const n=this._definedNamesService.getDefinedNameMap(e);if(!n)return;const i=[];Array.from(Object.values(n)).forEach(o=>{const{name:u,localSheetId:c}=o;c!==m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME&&c!==a&&i.push(u)}),this._descriptionService.unregisterDescriptions(i)}};pt=La([lt(0,ut),lt(1,t.IDefinedNamesService),lt(2,f.IUniverInstanceService),lt(3,f.ICommandService)],pt);var Ta=Object.getOwnPropertyDescriptor,Na=(r,e,a,n)=>{for(var i=n>1?void 0:n?Ta(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},Pa=(r,e)=>(a,n)=>e(a,n,r);let dt=class extends f.Disposable{constructor(r){super(),this._commandService=r,[Dt,tt].forEach(e=>this._commandService.registerCommand(e))}};dt=Na([Pa(0,f.ICommandService)],dt);var Ea=Object.defineProperty,Ia=Object.getOwnPropertyDescriptor,Aa=(r,e,a)=>e in r?Ea(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,Gt=(r,e,a,n)=>{for(var i=n>1?void 0:n?Ia(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=u(i)||i);return i},Lt=(r,e)=>(a,n)=>e(a,n,r),Tt=(r,e,a)=>Aa(r,typeof e!="symbol"?e+"":e,a);E.UniverRemoteSheetsFormulaPlugin=class extends f.Plugin{constructor(e=Ft,a,n){super(),this._config=e,this._injector=a,this._configService=n;const{...i}=f.merge({},Ft,this._config);this._configService.setConfig(be,i)}onStarting(){this._injector.add([E.RemoteRegisterFunctionService]),this._injector.get(it.IRPCChannelService).registerChannel(Rt,it.fromModule(this._injector.get(E.RemoteRegisterFunctionService)))}},Tt(E.UniverRemoteSheetsFormulaPlugin,"pluginName","SHEET_FORMULA_REMOTE_PLUGIN"),Tt(E.UniverRemoteSheetsFormulaPlugin,"type",f.UniverInstanceType.UNIVER_SHEET),E.UniverRemoteSheetsFormulaPlugin=Gt([f.DependentOn(t.UniverFormulaEnginePlugin),Lt(1,f.Inject(f.Injector)),Lt(2,f.IConfigService)],E.UniverRemoteSheetsFormulaPlugin),E.UniverSheetsFormulaPlugin=class extends f.Plugin{constructor(e=ht,a,n){super(),this._config=e,this._injector=a,this._configService=n;const{...i}=f.merge({},ht,this._config);this._configService.setConfig(nt,i,{merge:!0})}onStarting(){const e=this._injector,a=[[Vt,{useClass:E.RegisterFunctionService}],[ut,{useClass:E.DescriptionService}],[dt],[E.FormulaRefRangeService],[E.RegisterOtherFormulaService],[st],[E.TriggerCalculationController],[E.UpdateFormulaController],[mt],[pt],[E.UpdateDefinedNameController]];if(this._config.notExecuteFormula){const n=e.get(it.IRPCChannelService);a.push([Ot,{useFactory:()=>it.toModule(n.requestChannel(Rt))}])}a.forEach(n=>e.add(n))}onReady(){f.touchDependencies(this._injector,[[dt],[mt],[st],[E.UpdateFormulaController],[E.UpdateDefinedNameController]]),f.isNodeEnv()&&f.touchDependencies(this._injector,[[E.TriggerCalculationController]])}onRendered(){f.touchDependencies(this._injector,[[pt]]),f.isNodeEnv()||f.touchDependencies(this._injector,[[E.TriggerCalculationController]])}},Tt(E.UniverSheetsFormulaPlugin,"pluginName",fa),Tt(E.UniverSheetsFormulaPlugin,"type",f.UniverInstanceType.UNIVER_SHEET),E.UniverSheetsFormulaPlugin=Gt([f.DependentOn(t.UniverFormulaEnginePlugin,m.UniverSheetsPlugin),Lt(1,f.Inject(f.Injector)),Lt(2,f.IConfigService)],E.UniverSheetsFormulaPlugin),E.CalculationMode=Y,E.IDescriptionService=ut,E.IRegisterFunctionService=Vt,E.IRemoteRegisterFunctionService=Ot,E.InsertFunctionCommand=Dt,E.OtherFormulaMarkDirty=tt,E.PLUGIN_CONFIG_KEY_BASE=nt,E.calculateFormula=Ue,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
// @univerjs/sheets-formula/facade
|
|
52
|
-
(function(i,o){typeof exports=="object"&&typeof module<"u"?o(require("@univerjs/core"),require("@univerjs/core/facade"),require("@univerjs/engine-formula"),require("@univerjs/sheets-formula"),require("@univerjs/engine-formula/facade")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/core/facade","@univerjs/engine-formula","@univerjs/sheets-formula","@univerjs/engine-formula/facade"],o):(i=typeof globalThis<"u"?globalThis:i||self,o(i.UniverCore,i.UniverCoreFacade,i.UniverEngineFormula,i.UniverSheetsFormula,i.UniverEngineFormulaFacade))})(this,function(i,o,l,t,d){"use strict";class f extends o.FUniver{_initialize(){this._debouncedFormulaCalculation=i.debounce(()=>{this._commandService.executeCommand(l.SetFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})},10)}registerFunction(r){let c=this._injector.get(t.IRegisterFunctionService);c||(this._injector.add([t.IRegisterFunctionService,{useClass:t.RegisterFunctionService}]),c=this._injector.get(t.IRegisterFunctionService));const e=c.registerFunctions(r);return this._debouncedFormulaCalculation(),e}}o.FUniver.extend(f);class g extends d.FFormula{_initialize(){this._debouncedFormulaCalculation=i.debounce(()=>{this._commandService.executeCommand(l.SetFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})},10)}setInitialFormulaComputing(r){const e=this._injector.get(i.LifecycleService).stage,n=this._injector.get(i.ILogService),
|
|
52
|
+
(function(i,o){typeof exports=="object"&&typeof module<"u"?o(require("@univerjs/core"),require("@univerjs/core/facade"),require("@univerjs/engine-formula"),require("@univerjs/sheets-formula"),require("@univerjs/engine-formula/facade")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/core/facade","@univerjs/engine-formula","@univerjs/sheets-formula","@univerjs/engine-formula/facade"],o):(i=typeof globalThis<"u"?globalThis:i||self,o(i.UniverCore,i.UniverCoreFacade,i.UniverEngineFormula,i.UniverSheetsFormula,i.UniverEngineFormulaFacade))})(this,function(i,o,l,t,d){"use strict";class f extends o.FUniver{_initialize(){this._debouncedFormulaCalculation=i.debounce(()=>{this._commandService.executeCommand(l.SetFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})},10)}registerFunction(r){let c=this._injector.get(t.IRegisterFunctionService);c||(this._injector.add([t.IRegisterFunctionService,{useClass:t.RegisterFunctionService}]),c=this._injector.get(t.IRegisterFunctionService));const e=c.registerFunctions(r);return this._debouncedFormulaCalculation(),e}}o.FUniver.extend(f);class g extends d.FFormula{_initialize(){this._debouncedFormulaCalculation=i.debounce(()=>{this._commandService.executeCommand(l.SetFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})},10)}setInitialFormulaComputing(r){const e=this._injector.get(i.LifecycleService).stage,n=this._injector.get(i.ILogService),u=this._injector.get(i.IConfigService);e>i.LifecycleStages.Starting&&n.warn("[FFormula]","CalculationMode is called after the Starting lifecycle and will take effect the next time the Univer Sheet is constructed. If you want it to take effect when the Univer Sheet is initialized this time, consider calling it before the Ready lifecycle or using configuration.");const s=u.getConfig(t.PLUGIN_CONFIG_KEY_BASE);if(!s){u.setConfig(t.PLUGIN_CONFIG_KEY_BASE,{initialFormulaComputing:r});return}s.initialFormulaComputing=r}registerFunction(r,c,e){var a;let n=this._injector.get(t.IRegisterFunctionService);n||(this._injector.add([t.IRegisterFunctionService,{useClass:t.RegisterFunctionService}]),n=this._injector.get(t.IRegisterFunctionService));const u={name:r,func:c,description:typeof e=="string"?e:(a=e==null?void 0:e.description)!=null?a:"",locales:typeof e=="object"?e.locales:void 0},s=n.registerFunction(u);return this._debouncedFormulaCalculation(),s}registerAsyncFunction(r,c,e){var a;let n=this._injector.get(t.IRegisterFunctionService);n||(this._injector.add([t.IRegisterFunctionService,{useClass:t.RegisterFunctionService}]),n=this._injector.get(t.IRegisterFunctionService));const u={name:r,func:c,description:typeof e=="string"?e:(a=e==null?void 0:e.description)!=null?a:"",locales:typeof e=="object"?e.locales:void 0},s=n.registerAsyncFunction(u);return this._debouncedFormulaCalculation(),s}}d.FFormula.extend(g)});
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
// @univerjs/sheets-hyper-link/index
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
// @univerjs/thread-comment/index
|
|
72
|
-
(function(s,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("@univerjs/core"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","rxjs"],c):(s=typeof globalThis<"u"?globalThis:s||self,c(s.UniverThreadComment={},s.UniverCore,s.rxjs))})(this,function(s,c,M){"use strict";var K=Object.defineProperty;var B=(s,c,M)=>c in s?K(s,c,{enumerable:!0,configurable:!0,writable:!0,value:M}):s[c]=M;var u=(s,c,M)=>B(s,typeof c!="symbol"?c+"":c,M);var T;class E extends c.Disposable{constructor(){super();u(this,"_dataSource",null);u(this,"syncUpdateMutationToColla",!0)}set dataSource(e){this._dataSource=e}get dataSource(){return this._dataSource}async getThreadComment(e,t,n){return this._dataSource?(await this._dataSource.listComments(e,t,[n]))[0]:null}async addComment(e){var t;return this._dataSource?this._dataSource.addComment(e):{...e,threadId:(t=e.threadId)!=null?t:e.id}}async updateComment(e){return this._dataSource?this._dataSource.updateComment(e):!0}async resolveComment(e){return this._dataSource?this._dataSource.resolveComment(e):!0}async deleteComment(e,t,n,o){return this._dataSource?this._dataSource.deleteComment(e,t,n,o):!0}async listThreadComments(e,t,n){return this.dataSource?this.dataSource.listComments(e,t,n):!1}saveToSnapshot(e,t){if(this._dataSource){const n={};return Object.keys(e).forEach(o=>{const a=e[o];n[o]=a.map(this.dataSource.saveCommentToSnapshot)}),n}return e}}const C=c.createIdentifier("univer.thread-comment.data-source-service");var V=Object.getOwnPropertyDescriptor,W=(m,r,e,t)=>{for(var n=t>1?void 0:t?V(r,e):r,o=m.length-1,a;o>=0;o--)(a=m[o])&&(n=a(n)||n);return n},R=(m,r)=>(e,t)=>r(e,t,m);s.ThreadCommentModel=class extends c.Disposable{constructor(e,t){super();u(this,"_commentsMap",new Map);u(this,"_threadMap",new Map);u(this,"_commentUpdate$",new M.Subject);u(this,"commentUpdate$",this._commentUpdate$.asObservable());u(this,"_tasks",[]);this._dataSourceService=e,this._lifecycleService=t,this.disposeWithMe(()=>{this._commentUpdate$.complete()}),this.disposeWithMe(this._lifecycleService.lifecycle$.subscribe(n=>{const o=new Map;n===c.LifecycleStages.Rendered&&(this._tasks.forEach(({unitId:a,subUnitId:d,threadIds:i})=>{let h=o.get(a);h||(h=new Map,o.set(a,h));let l=h.get(d);l||(l=new Set,h.set(d,l));for(const p of i)l.add(p)}),this._tasks=[],o.forEach((a,d)=>{a.forEach((i,h)=>{this.syncThreadComments(d,h,Array.from(i))})}))}))}_ensureCommentMap(e,t){let n=this._commentsMap.get(e);n||(n=new Map,this._commentsMap.set(e,n));let o=n.get(t);return o||(o=new Map,n.set(t,o)),o}ensureMap(e,t){return this._ensureCommentMap(e,t)}_ensureThreadMap(e,t){let n=this._threadMap.get(e);n||(n=new Map,this._threadMap.set(e,n));let o=n.get(t);return o||(o=new Map,n.set(t,o)),o}_replaceComment(e,t,n){const o=this._ensureCommentMap(e,t),a=o.get(n.id);if(a){const{children:d,...i}=n,h={...i,ref:a.ref};o.set(n.id,h),d==null||d.forEach(l=>{o.set(l.id,{...l,ref:""})}),this._commentUpdate$.next({unitId:e,subUnitId:t,type:"syncUpdate",payload:h}),!!n.resolved!=!!a.resolved&&this._commentUpdate$.next({unitId:e,subUnitId:t,type:"resolve",payload:{commentId:n.id,resolved:!!n.resolved}})}}async syncThreadComments(e,t,n){if(this._lifecycleService.stage<c.LifecycleStages.Rendered){this._tasks.push({unitId:e,subUnitId:t,threadIds:n});return}const o=this._ensureThreadMap(e,t),a=this._ensureCommentMap(e,t),d=await this._dataSourceService.listThreadComments(e,t,n);if(!d)return;const i=new Set(n);d.forEach(h=>{this._replaceComment(e,t,h),i.delete(h.threadId)}),i.forEach(h=>{o.delete(h),a.forEach((l,p)=>{l.threadId===h&&a.delete(p)})})}addComment(e,t,n,o){const a=this._ensureCommentMap(e,t),{parentId:d,children:i=[],...h}=n,l={...h,parentId:d===n.id?void 0:d};l.threadId||(l.threadId=l.parentId||l.id);const p=f=>{a.set(f.id,f),this._commentUpdate$.next({unitId:e,subUnitId:t,type:"add",payload:f,isRoot:!f.parentId})};p(l);const L=this._ensureThreadMap(e,t);if(!l.parentId){L.set(l.threadId,l);for(const f of i)p(f)}return o&&this.syncThreadComments(e,t,[l.threadId]),!0}updateComment(e,t,n,o){const d=this._ensureCommentMap(e,t).get(n.commentId);return d&&(d.updated=!0,d.text=n.text,d.attachments=n.attachments,d.updateT=n.updateT,this._commentUpdate$.next({unitId:e,subUnitId:t,type:"update",payload:n,silent:o})),!0}updateCommentRef(e,t,n,o){const d=this._ensureCommentMap(e,t).get(n.commentId);return d?(d.ref=n.ref,this._commentUpdate$.next({unitId:e,subUnitId:t,type:"updateRef",payload:n,silent:o,threadId:d.threadId}),!0):!1}resolveComment(e,t,n,o){const d=this._ensureCommentMap(e,t).get(n);return d?(d.resolved=o,this._commentUpdate$.next({unitId:e,subUnitId:t,type:"resolve",payload:{commentId:n,resolved:o}}),!0):!1}getComment(e,t,n){return this._ensureCommentMap(e,t).get(n)}getRootComment(e,t,n){return this._ensureThreadMap(e,t).get(n)}getThread(e,t,n){const o=this._ensureCommentMap(e,t),a=Array.from(o.values()).filter(l=>l.threadId===n);let d;const i=[],h=new Set;for(const l of a)l.parentId?i.push(l):d=l,h.add(l.personId);if(d)return{root:d,children:i,relativeUsers:h,unitId:e,subUnitId:t,threadId:n}}getCommentWithChildren(e,t,n){const o=this.getComment(e,t,n);if(o)return this.getThread(e,t,o.threadId)}_deleteComment(e,t,n){const o=this._ensureCommentMap(e,t),a=o.get(n);a&&(o.delete(n),this._commentUpdate$.next({unitId:e,subUnitId:t,type:"delete",payload:{commentId:n,isRoot:!a.parentId,comment:a}}))}deleteThread(e,t,n){this._ensureThreadMap(e,t).delete(n),this._ensureCommentMap(e,t).forEach(d=>{d.threadId===n&&this._deleteComment(e,t,d.id)})}deleteComment(e,t,n){const a=this._ensureCommentMap(e,t).get(n);return a&&(a.parentId?this._deleteComment(e,t,n):this.deleteThread(e,t,a.threadId)),!0}deleteUnit(e){const t=this._commentsMap.get(e);t&&t.forEach((n,o)=>{n.forEach(a=>{this.deleteComment(e,o,a.id)})})}getUnit(e){const t=this._threadMap.get(e);if(!t)return[];const n=[];return t.forEach((o,a)=>{o.forEach((d,i)=>{const h=this.getThread(e,a,i);h&&n.push(h)})}),n}getAll(){const e=[];return this._commentsMap.forEach((t,n)=>{e.push({unitId:n,threads:this.getUnit(n)})}),e}},s.ThreadCommentModel=W([R(0,c.Inject(C)),R(1,c.Inject(c.LifecycleService))],s.ThreadCommentModel);var v=(m=>(m[m.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",m[m.UNIVER_DOC=1]="UNIVER_DOC",m[m.UNIVER_SHEET=2]="UNIVER_SHEET",m[m.UNIVER_SLIDE=3]="UNIVER_SLIDE",m[m.UNIVER_PROJECT=4]="UNIVER_PROJECT",m[m.UNRECOGNIZED=-1]="UNRECOGNIZED",m))(v||{});const g="UNIVER_THREAD_COMMENT_PLUGIN";var H=Object.getOwnPropertyDescriptor,J=(m,r,e,t)=>{for(var n=t>1?void 0:t?H(r,e):r,o=m.length-1,a;o>=0;o--)(a=m[o])&&(n=a(n)||n);return n},S=(m,r)=>(e,t)=>r(e,t,m);s.ThreadCommentResourceController=class extends c.Disposable{constructor(r,e,t){super(),this._resourceManagerService=r,this._threadCommentModel=e,this._threadCommentDataSourceService=t,this._initSnapshot()}_initSnapshot(){const r=t=>{const n=this._threadCommentModel.getUnit(t),o={};return n?(n.forEach(a=>{var i;const d=(i=o[a.subUnitId])!=null?i:[];d.push({...a.root,children:a.children}),o[a.subUnitId]=d}),JSON.stringify(this._threadCommentDataSourceService.saveToSnapshot(o,t))):""},e=t=>{if(!t)return{};try{return JSON.parse(t)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:`SHEET_${g}`,businesses:[v.UNIVER_SHEET,v.UNIVER_DOC],toJson:t=>r(t),parseJson:t=>e(t),onUnLoad:t=>{this._threadCommentModel.deleteUnit(t)},onLoad:async(t,n)=>{Object.keys(n).forEach(o=>{const a=n[o];a.forEach(d=>{this._threadCommentModel.addComment(t,o,d)}),this._threadCommentModel.syncThreadComments(t,o,a.map(d=>d.threadId))})}}))}},s.ThreadCommentResourceController=J([S(0,c.IResourceManagerService),S(1,c.Inject(s.ThreadCommentModel)),S(2,C)],s.ThreadCommentResourceController);const y={id:"thread-comment.mutation.add-comment",type:c.CommandType.MUTATION,handler(m,r,e){if(!r)return!1;const t=m.get(s.ThreadCommentModel),{unitId:n,subUnitId:o,comment:a,sync:d}=r,i=d||(e==null?void 0:e.fromChangeset)&&!a.parentId;return t.addComment(n,o,a,i)}},U={id:"thread-comment.mutation.update-comment",type:c.CommandType.MUTATION,handler(m,r){if(!r)return!1;const e=m.get(s.ThreadCommentModel),{unitId:t,subUnitId:n,payload:o,silent:a}=r;return e.updateComment(t,n,o,a)}},O={id:"thread-comment.mutation.update-comment-ref",type:c.CommandType.MUTATION,handler(m,r){if(!r)return!1;const e=m.get(s.ThreadCommentModel),{unitId:t,subUnitId:n,payload:o,silent:a}=r;return e.updateCommentRef(t,n,o,a)}},N={id:"thread-comment.mutation.resolve-comment",type:c.CommandType.MUTATION,handler(m,r){if(!r)return!1;const e=m.get(s.ThreadCommentModel),{unitId:t,subUnitId:n,resolved:o,commentId:a}=r;return e.resolveComment(t,n,a,o)}},_={id:"thread-comment.mutation.delete-comment",type:c.CommandType.MUTATION,handler(m,r){if(!r)return!1;const e=m.get(s.ThreadCommentModel),{unitId:t,subUnitId:n,commentId:o}=r;return e.deleteComment(t,n,o)}},D={id:"thread-comment.command.add-comment",type:c.CommandType.COMMAND,async handler(m,r){if(!r)return!1;const e=m.get(c.ICommandService),t=m.get(C),{comment:n}=r,o=await t.addComment(n),a=t.syncUpdateMutationToColla,d=!n.parentId,i={id:y.id,params:{...r,comment:o}};return d?await e.executeCommand(i.id,i.params):e.executeCommand(i.id,i.params,{onlyLocal:!a})}},w={id:"thread-comment.command.update-comment",type:c.CommandType.COMMAND,async handler(m,r){if(!r)return!1;const{unitId:e,subUnitId:t,payload:n}=r,o=m.get(c.ICommandService),a=m.get(s.ThreadCommentModel),d=m.get(C),i=d.syncUpdateMutationToColla,h=a.getComment(e,t,n.commentId);if(!h)return!1;const{children:l,...p}=h;if(!await d.updateComment({...p,...n}))return!1;const f={id:U.id,params:r};return o.executeCommand(f.id,f.params,{onlyLocal:!i}),!0}},P={id:"thread-comment.command.resolve-comment",type:c.CommandType.COMMAND,async handler(m,r){if(!r)return!1;const{unitId:e,subUnitId:t,resolved:n,commentId:o}=r,a=m.get(C),i=m.get(s.ThreadCommentModel).getComment(e,t,o),h=a.syncUpdateMutationToColla;return!i||!await a.resolveComment({...i,resolved:n})?!1:m.get(c.ICommandService).executeCommand(N.id,r,{onlyLocal:!h})}},j={id:"thread-comment.command.delete-comment",type:c.CommandType.COMMAND,async handler(m,r){if(!r)return!1;const e=m.get(s.ThreadCommentModel),t=m.get(C),n=m.get(c.ICommandService),{unitId:o,subUnitId:a,commentId:d}=r,i=t.syncUpdateMutationToColla,h=e.getComment(o,a,d);if(!h||!await t.deleteComment(o,a,h.threadId,d))return!1;const l={id:_.id,params:r};return n.executeCommand(l.id,l.params,{onlyLocal:!i})}},A={id:"thread-comment.command.delete-comment-tree",type:c.CommandType.COMMAND,async handler(m,r){if(!r)return!1;const e=m.get(s.ThreadCommentModel),t=m.get(c.ICommandService),n=m.get(C),{unitId:o,subUnitId:a,commentId:d}=r,i=e.getCommentWithChildren(o,a,d);return!i||!await n.deleteComment(o,a,i.root.threadId,d)?!1:await t.executeCommand(_.id,{unitId:o,subUnitId:a,commentId:i.root.id})}},G="thread-comment.config",$={};var b=Object.getOwnPropertyDescriptor,Y=(m,r,e,t)=>{for(var n=t>1?void 0:t?b(r,e):r,o=m.length-1,a;o>=0;o--)(a=m[o])&&(n=a(n)||n);return n},I=(m,r)=>(e,t)=>r(e,t,m);s.UniverThreadCommentPlugin=(T=class extends c.Plugin{constructor(r=$,e,t,n){super(),this._config=r,this._injector=e,this._commandService=t,this._configService=n;const{...o}=c.merge({},$,this._config);this._configService.setConfig(G,o)}onStarting(){var r;c.mergeOverrideWithDependencies([[C,{useClass:E}],[s.ThreadCommentModel],[s.ThreadCommentResourceController]],(r=this._config)==null?void 0:r.overrides).forEach(e=>{this._injector.add(e)}),[D,w,j,P,A,y,U,O,_,N].forEach(e=>{this._commandService.registerCommand(e)}),this._injector.get(s.ThreadCommentResourceController)}},u(T,"pluginName",g),u(T,"type",c.UniverInstanceType.UNIVER_UNKNOWN),T),s.UniverThreadCommentPlugin=Y([I(1,c.Inject(c.Injector)),I(2,c.ICommandService),I(3,c.IConfigService)],s.UniverThreadCommentPlugin);function k(m){return c.dayjs(m).format("YYYY/MM/DD HH:mm")}s.AddCommentCommand=D,s.AddCommentMutation=y,s.DeleteCommentCommand=j,s.DeleteCommentMutation=_,s.DeleteCommentTreeCommand=A,s.IThreadCommentDataSourceService=C,s.ResolveCommentCommand=P,s.ResolveCommentMutation=N,s.TC_PLUGIN_NAME=g,s.ThreadCommentDataSourceService=E,s.UpdateCommentCommand=w,s.UpdateCommentMutation=U,s.UpdateCommentRefMutation=O,s.getDT=k,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|
|
72
|
+
(function(s,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("@univerjs/core"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","rxjs"],c):(s=typeof globalThis<"u"?globalThis:s||self,c(s.UniverThreadComment={},s.UniverCore,s.rxjs))})(this,function(s,c,M){"use strict";var B=Object.defineProperty;var q=(s,c,M)=>c in s?B(s,c,{enumerable:!0,configurable:!0,writable:!0,value:M}):s[c]=M;var u=(s,c,M)=>q(s,typeof c!="symbol"?c+"":c,M);var T;class I extends c.Disposable{constructor(){super();u(this,"_dataSource",null);u(this,"syncUpdateMutationToColla",!0)}set dataSource(e){this._dataSource=e}get dataSource(){return this._dataSource}async getThreadComment(e,t,n){return this._dataSource?(await this._dataSource.listComments(e,t,[n]))[0]:null}async addComment(e){var t;return this._dataSource?this._dataSource.addComment(e):{...e,threadId:(t=e.threadId)!=null?t:e.id}}async updateComment(e){return this._dataSource?this._dataSource.updateComment(e):!0}async resolveComment(e){return this._dataSource?this._dataSource.resolveComment(e):!0}async deleteComment(e,t,n,o){return this._dataSource?this._dataSource.deleteComment(e,t,n,o):!0}async listThreadComments(e,t,n){return this.dataSource?this.dataSource.listComments(e,t,n):!1}saveToSnapshot(e,t){if(this._dataSource){const n={};return Object.keys(e).forEach(o=>{const a=e[o];n[o]=a.map(this.dataSource.saveCommentToSnapshot)}),n}return e}}const C=c.createIdentifier("univer.thread-comment.data-source-service");var H=Object.getOwnPropertyDescriptor,W=(m,r,e,t)=>{for(var n=t>1?void 0:t?H(r,e):r,o=m.length-1,a;o>=0;o--)(a=m[o])&&(n=a(n)||n);return n},R=(m,r)=>(e,t)=>r(e,t,m);s.ThreadCommentModel=class extends c.Disposable{constructor(e,t){super();u(this,"_commentsMap",new Map);u(this,"_threadMap",new Map);u(this,"_commentUpdate$",new M.Subject);u(this,"commentUpdate$",this._commentUpdate$.asObservable());u(this,"_tasks",[]);this._dataSourceService=e,this._lifecycleService=t,this.disposeWithMe(()=>{this._commentUpdate$.complete()}),this.disposeWithMe(this._lifecycleService.lifecycle$.subscribe(n=>{const o=new Map;n===c.LifecycleStages.Rendered&&(this._tasks.forEach(({unitId:a,subUnitId:d,threadIds:i})=>{let h=o.get(a);h||(h=new Map,o.set(a,h));let l=h.get(d);l||(l=new Set,h.set(d,l));for(const p of i)l.add(p)}),this._tasks=[],o.forEach((a,d)=>{a.forEach((i,h)=>{this.syncThreadComments(d,h,Array.from(i))})}))}))}_ensureCommentMap(e,t){let n=this._commentsMap.get(e);n||(n=new Map,this._commentsMap.set(e,n));let o=n.get(t);return o||(o=new Map,n.set(t,o)),o}ensureMap(e,t){return this._ensureCommentMap(e,t)}_ensureThreadMap(e,t){let n=this._threadMap.get(e);n||(n=new Map,this._threadMap.set(e,n));let o=n.get(t);return o||(o=new Map,n.set(t,o)),o}_replaceComment(e,t,n){const o=this._ensureCommentMap(e,t),a=o.get(n.id);if(a){const{children:d,...i}=n,h={...i,ref:a.ref};o.set(n.id,h),d==null||d.forEach(l=>{o.set(l.id,{...l,ref:""})}),this._commentUpdate$.next({unitId:e,subUnitId:t,type:"syncUpdate",payload:h}),!!n.resolved!=!!a.resolved&&this._commentUpdate$.next({unitId:e,subUnitId:t,type:"resolve",payload:{commentId:n.id,resolved:!!n.resolved}})}}async syncThreadComments(e,t,n){if(this._lifecycleService.stage<c.LifecycleStages.Rendered){this._tasks.push({unitId:e,subUnitId:t,threadIds:n});return}const o=this._ensureThreadMap(e,t),a=this._ensureCommentMap(e,t),d=await this._dataSourceService.listThreadComments(e,t,n);if(!d)return;const i=new Set(n);d.forEach(h=>{this._replaceComment(e,t,h),i.delete(h.threadId)}),i.forEach(h=>{o.delete(h),a.forEach((l,p)=>{l.threadId===h&&a.delete(p)})})}addComment(e,t,n,o){const a=this._ensureCommentMap(e,t),{parentId:d,children:i=[],...h}=n,l={...h,parentId:d===n.id?void 0:d};l.threadId||(l.threadId=l.parentId||l.id);const p=f=>{a.set(f.id,f),this._commentUpdate$.next({unitId:e,subUnitId:t,type:"add",payload:f,isRoot:!f.parentId})};p(l);const V=this._ensureThreadMap(e,t);if(!l.parentId){V.set(l.threadId,l);for(const f of i)p(f)}return o&&this.syncThreadComments(e,t,[l.threadId]),!0}updateComment(e,t,n,o){const d=this._ensureCommentMap(e,t).get(n.commentId);return d&&(d.updated=!0,d.text=n.text,d.attachments=n.attachments,d.updateT=n.updateT,this._commentUpdate$.next({unitId:e,subUnitId:t,type:"update",payload:n,silent:o})),!0}updateCommentRef(e,t,n,o){const d=this._ensureCommentMap(e,t).get(n.commentId);return d?(d.ref=n.ref,this._commentUpdate$.next({unitId:e,subUnitId:t,type:"updateRef",payload:n,silent:o,threadId:d.threadId}),!0):!1}resolveComment(e,t,n,o){const d=this._ensureCommentMap(e,t).get(n);return d?(d.resolved=o,this._commentUpdate$.next({unitId:e,subUnitId:t,type:"resolve",payload:{commentId:n,resolved:o}}),!0):!1}getComment(e,t,n){return this._ensureCommentMap(e,t).get(n)}getRootComment(e,t,n){return this._ensureThreadMap(e,t).get(n)}getThread(e,t,n){const o=this._ensureCommentMap(e,t),a=Array.from(o.values()).filter(l=>l.threadId===n);let d;const i=[],h=new Set;for(const l of a)l.parentId?i.push(l):d=l,h.add(l.personId);if(d)return{root:d,children:i,relativeUsers:h,unitId:e,subUnitId:t,threadId:n}}getCommentWithChildren(e,t,n){const o=this.getComment(e,t,n);if(o)return this.getThread(e,t,o.threadId)}_deleteComment(e,t,n){const o=this._ensureCommentMap(e,t),a=o.get(n);a&&(o.delete(n),this._commentUpdate$.next({unitId:e,subUnitId:t,type:"delete",payload:{commentId:n,isRoot:!a.parentId,comment:a}}))}deleteThread(e,t,n){this._ensureThreadMap(e,t).delete(n),this._ensureCommentMap(e,t).forEach(d=>{d.threadId===n&&this._deleteComment(e,t,d.id)})}deleteComment(e,t,n){const a=this._ensureCommentMap(e,t).get(n);return a&&(a.parentId?this._deleteComment(e,t,n):this.deleteThread(e,t,a.threadId)),!0}deleteUnit(e){const t=this._commentsMap.get(e);t&&t.forEach((n,o)=>{n.forEach(a=>{this.deleteComment(e,o,a.id)})})}getUnit(e){const t=this._threadMap.get(e);if(!t)return[];const n=[];return t.forEach((o,a)=>{o.forEach((d,i)=>{const h=this.getThread(e,a,i);h&&n.push(h)})}),n}getAll(){const e=[];return this._commentsMap.forEach((t,n)=>{e.push({unitId:n,threads:this.getUnit(n)})}),e}},s.ThreadCommentModel=W([R(0,c.Inject(C)),R(1,c.Inject(c.LifecycleService))],s.ThreadCommentModel);var v=(m=>(m[m.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",m[m.UNIVER_DOC=1]="UNIVER_DOC",m[m.UNIVER_SHEET=2]="UNIVER_SHEET",m[m.UNIVER_SLIDE=3]="UNIVER_SLIDE",m[m.UNIVER_PROJECT=4]="UNIVER_PROJECT",m[m.UNRECOGNIZED=-1]="UNRECOGNIZED",m))(v||{});const S="UNIVER_THREAD_COMMENT_PLUGIN";var G=Object.getOwnPropertyDescriptor,J=(m,r,e,t)=>{for(var n=t>1?void 0:t?G(r,e):r,o=m.length-1,a;o>=0;o--)(a=m[o])&&(n=a(n)||n);return n},g=(m,r)=>(e,t)=>r(e,t,m);const O=`SHEET_${S}`;s.ThreadCommentResourceController=class extends c.Disposable{constructor(r,e,t){super(),this._resourceManagerService=r,this._threadCommentModel=e,this._threadCommentDataSourceService=t,this._initSnapshot()}_initSnapshot(){const r=t=>{const n=this._threadCommentModel.getUnit(t),o={};return n?(n.forEach(a=>{var i;const d=(i=o[a.subUnitId])!=null?i:[];d.push({...a.root,children:a.children}),o[a.subUnitId]=d}),JSON.stringify(this._threadCommentDataSourceService.saveToSnapshot(o,t))):""},e=t=>{if(!t)return{};try{return JSON.parse(t)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:O,businesses:[v.UNIVER_SHEET,v.UNIVER_DOC],toJson:t=>r(t),parseJson:t=>e(t),onUnLoad:t=>{this._threadCommentModel.deleteUnit(t)},onLoad:async(t,n)=>{Object.keys(n).forEach(o=>{const a=n[o];a.forEach(d=>{this._threadCommentModel.addComment(t,o,d)}),this._threadCommentModel.syncThreadComments(t,o,a.map(d=>d.threadId))})}}))}},s.ThreadCommentResourceController=J([g(0,c.IResourceManagerService),g(1,c.Inject(s.ThreadCommentModel)),g(2,C)],s.ThreadCommentResourceController);const y={id:"thread-comment.mutation.add-comment",type:c.CommandType.MUTATION,handler(m,r,e){if(!r)return!1;const t=m.get(s.ThreadCommentModel),{unitId:n,subUnitId:o,comment:a,sync:d}=r,i=d||(e==null?void 0:e.fromChangeset)&&!a.parentId;return t.addComment(n,o,a,i)}},U={id:"thread-comment.mutation.update-comment",type:c.CommandType.MUTATION,handler(m,r){if(!r)return!1;const e=m.get(s.ThreadCommentModel),{unitId:t,subUnitId:n,payload:o,silent:a}=r;return e.updateComment(t,n,o,a)}},D={id:"thread-comment.mutation.update-comment-ref",type:c.CommandType.MUTATION,handler(m,r){if(!r)return!1;const e=m.get(s.ThreadCommentModel),{unitId:t,subUnitId:n,payload:o,silent:a}=r;return e.updateCommentRef(t,n,o,a)}},N={id:"thread-comment.mutation.resolve-comment",type:c.CommandType.MUTATION,handler(m,r){if(!r)return!1;const e=m.get(s.ThreadCommentModel),{unitId:t,subUnitId:n,resolved:o,commentId:a}=r;return e.resolveComment(t,n,a,o)}},_={id:"thread-comment.mutation.delete-comment",type:c.CommandType.MUTATION,handler(m,r){if(!r)return!1;const e=m.get(s.ThreadCommentModel),{unitId:t,subUnitId:n,commentId:o}=r;return e.deleteComment(t,n,o)}},w={id:"thread-comment.command.add-comment",type:c.CommandType.COMMAND,async handler(m,r){if(!r)return!1;const e=m.get(c.ICommandService),t=m.get(C),{comment:n}=r,o=await t.addComment(n),a=t.syncUpdateMutationToColla,d=!n.parentId,i={id:y.id,params:{...r,comment:o}};return d?await e.executeCommand(i.id,i.params):e.executeCommand(i.id,i.params,{onlyLocal:!a})}},P={id:"thread-comment.command.update-comment",type:c.CommandType.COMMAND,async handler(m,r){if(!r)return!1;const{unitId:e,subUnitId:t,payload:n}=r,o=m.get(c.ICommandService),a=m.get(s.ThreadCommentModel),d=m.get(C),i=d.syncUpdateMutationToColla,h=a.getComment(e,t,n.commentId);if(!h)return!1;const{children:l,...p}=h;if(!await d.updateComment({...p,...n}))return!1;const f={id:U.id,params:r};return o.executeCommand(f.id,f.params,{onlyLocal:!i}),!0}},A={id:"thread-comment.command.resolve-comment",type:c.CommandType.COMMAND,async handler(m,r){if(!r)return!1;const{unitId:e,subUnitId:t,resolved:n,commentId:o}=r,a=m.get(C),i=m.get(s.ThreadCommentModel).getComment(e,t,o),h=a.syncUpdateMutationToColla;return!i||!await a.resolveComment({...i,resolved:n})?!1:m.get(c.ICommandService).executeCommand(N.id,r,{onlyLocal:!h})}},j={id:"thread-comment.command.delete-comment",type:c.CommandType.COMMAND,async handler(m,r){if(!r)return!1;const e=m.get(s.ThreadCommentModel),t=m.get(C),n=m.get(c.ICommandService),{unitId:o,subUnitId:a,commentId:d}=r,i=t.syncUpdateMutationToColla,h=e.getComment(o,a,d);if(!h||!await t.deleteComment(o,a,h.threadId,d))return!1;const l={id:_.id,params:r};return n.executeCommand(l.id,l.params,{onlyLocal:!i})}},$={id:"thread-comment.command.delete-comment-tree",type:c.CommandType.COMMAND,async handler(m,r){if(!r)return!1;const e=m.get(s.ThreadCommentModel),t=m.get(c.ICommandService),n=m.get(C),{unitId:o,subUnitId:a,commentId:d}=r,i=e.getCommentWithChildren(o,a,d);return!i||!await n.deleteComment(o,a,i.root.threadId,d)?!1:await t.executeCommand(_.id,{unitId:o,subUnitId:a,commentId:i.root.id})}},b="thread-comment.config",L={};var Y=Object.getOwnPropertyDescriptor,k=(m,r,e,t)=>{for(var n=t>1?void 0:t?Y(r,e):r,o=m.length-1,a;o>=0;o--)(a=m[o])&&(n=a(n)||n);return n},E=(m,r)=>(e,t)=>r(e,t,m);s.UniverThreadCommentPlugin=(T=class extends c.Plugin{constructor(r=L,e,t,n){super(),this._config=r,this._injector=e,this._commandService=t,this._configService=n;const{...o}=c.merge({},L,this._config);this._configService.setConfig(b,o)}onStarting(){var r;c.mergeOverrideWithDependencies([[C,{useClass:I}],[s.ThreadCommentModel],[s.ThreadCommentResourceController]],(r=this._config)==null?void 0:r.overrides).forEach(e=>{this._injector.add(e)}),[w,P,j,A,$,y,U,D,_,N].forEach(e=>{this._commandService.registerCommand(e)}),this._injector.get(s.ThreadCommentResourceController)}},u(T,"pluginName",S),u(T,"type",c.UniverInstanceType.UNIVER_UNKNOWN),T),s.UniverThreadCommentPlugin=k([E(1,c.Inject(c.Injector)),E(2,c.ICommandService),E(3,c.IConfigService)],s.UniverThreadCommentPlugin);function K(m){return c.dayjs(m).format("YYYY/MM/DD HH:mm")}s.AddCommentCommand=w,s.AddCommentMutation=y,s.DeleteCommentCommand=j,s.DeleteCommentMutation=_,s.DeleteCommentTreeCommand=$,s.IThreadCommentDataSourceService=C,s.ResolveCommentCommand=A,s.ResolveCommentMutation=N,s.SHEET_UNIVER_THREAD_COMMENT_PLUGIN=O,s.TC_PLUGIN_NAME=S,s.ThreadCommentDataSourceService=I,s.UpdateCommentCommand=P,s.UpdateCommentMutation=U,s.UpdateCommentRefMutation=D,s.getDT=K,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|
|
73
73
|
|
|
74
74
|
|
|
75
75
|
// @univerjs/sheets-thread-comment/index
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
// @univerjs/sheets-thread-comment/facade
|
|
80
|
-
(function(a,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/sheets-thread-comment"),require("@univerjs/sheets/facade"),require("@univerjs/thread-comment"),require("@univerjs/engine-formula"),require("rxjs"),require("@univerjs/core/facade")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-thread-comment","@univerjs/sheets/facade","@univerjs/thread-comment","@univerjs/engine-formula","rxjs","@univerjs/core/facade"],s):(a=typeof globalThis<"u"?globalThis:a||self,s(a.UniverSheetsThreadCommentFacade={},a.UniverCore,a.UniverSheetsThreadComment,a.UniverSheetsFacade,a.UniverThreadComment,a.UniverEngineFormula,a.rxjs,a.UniverCoreFacade))})(this,function(a,s,I,p,h,E,y,b){"use strict";var P=Object.defineProperty;var W=(a,s,I)=>s in a?P(a,s,{enumerable:!0,configurable:!0,writable:!0,value:I}):a[s]=I;var T=(a,s,I)=>W(a,typeof s!="symbol"?s+"":s,I);var A=Object.getOwnPropertyDescriptor,B=(f,t,r,e)=>{for(var n=e>1?void 0:e?A(t,r):t,o=f.length-1,i;o>=0;o--)(i=f[o])&&(n=i(n)||n);return n},U=(f,t)=>(r,e)=>t(r,e,f);class w{constructor(t){T(this,"_comment",{id:s.generateRandomId(),ref:"",threadId:"",dT:"",personId:"",text:s.RichTextBuilder.newEmptyData().body,attachments:[],unitId:"",subUnitId:""});t&&(this._comment=t)}static create(t){return new w(t)}get personId(){return this._comment.personId}get dateTime(){return this._comment.dT}get content(){return s.RichTextValue.createByBody(this._comment.text)}get id(){return this._comment.id}get threadId(){return this._comment.threadId}copy(){return k.create(s.Tools.deepClone(this._comment))}}class k extends w{static create(t){return new k(t)}setContent(t){return t instanceof s.RichTextValue?this._comment.text=t.getData().body:this._comment.text=t,this}setPersonId(t){return this._comment.personId=t,this}setDateTime(t){return this._comment.dT=h.getDT(t),this}setId(t){return this._comment.id=t,this}setThreadId(t){return this._comment.threadId=t,this}build(){return this._comment}}a.FThreadComment=class{constructor(t,r,e,n,o,i,u){this._thread=t,this._parent=r,this._injector=e,this._commandService=n,this._univerInstanceService=o,this._threadCommentModel=i,this._userManagerService=u}_getRef(){var e;const t=((e=this._parent)==null?void 0:e.ref)||this._thread.ref;return E.deserializeRangeWithSheet(t).range}getIsRoot(){return!this._parent}getCommentData(){const{children:t,...r}=this._thread;return r}getReplies(){var e;const t=this._getRef(),r=this._threadCommentModel.getCommentWithChildren(this._thread.unitId,this._thread.subUnitId,t.startRow,t.startColumn);return(e=r==null?void 0:r.children)==null?void 0:e.map(n=>this._injector.createInstance(a.FThreadComment,n))}getRange(){const t=this._univerInstanceService.getUnit(this._thread.unitId,s.UniverInstanceType.UNIVER_SHEET);if(!t)return null;const r=t.getSheetBySheetId(this._thread.subUnitId);if(!r)return null;const e=this._getRef();return this._injector.createInstance(p.FRange,t,r,e)}getContent(){return this._thread.text}getRichText(){const t=this._thread.text;return s.RichTextValue.create({body:t,documentStyle:{},id:"d"})}deleteAsync(){return this._commandService.executeCommand(this.getIsRoot()?h.DeleteCommentTreeCommand.id:h.DeleteCommentCommand.id,{commentId:this._thread.id,unitId:this._thread.unitId,subUnitId:this._thread.subUnitId})}delete(){return this.deleteAsync()}async update(t){return this.updateAsync(t)}async updateAsync(t){const r=t instanceof s.RichTextValue?t.getData().body:t,e=h.getDT();return await this._commandService.executeCommand(h.UpdateCommentCommand.id,{unitId:this._thread.unitId,subUnitId:this._thread.subUnitId,payload:{commentId:this._thread.id,text:r,updated:!0,updateT:e}})}resolve(t){return this.resolveAsync(t)}resolveAsync(t){return this._commandService.executeCommand(h.ResolveCommentCommand.id,{unitId:this._thread.unitId,subUnitId:this._thread.subUnitId,commentId:this._thread.id,resolved:t!=null?t:!this._thread.resolved})}async replyAsync(t){var e;const r=t.build();return this._commandService.executeCommand(h.AddCommentCommand.id,{unitId:this._thread.unitId,subUnitId:this._thread.subUnitId,comment:{id:s.generateRandomId(),parentId:this._thread.id,threadId:this._thread.threadId,ref:(e=this._parent)==null?void 0:e.ref,unitId:this._thread.unitId,subUnitId:this._thread.subUnitId,text:r.text,attachments:r.attachments,dT:r.dT||h.getDT(),personId:r.personId||this._userManagerService.getCurrentUser().userID}})}},a.FThreadComment=B([U(2,s.Inject(s.Injector)),U(3,s.ICommandService),U(4,s.IUniverInstanceService),U(5,s.Inject(I.SheetsThreadCommentModel)),U(6,s.Inject(s.UserManagerService))],a.FThreadComment);class x extends p.FRange{getComment(){const r=this._injector.get(I.SheetsThreadCommentModel),e=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o=r.getByLocation(e,n,this._range.startRow,this._range.startColumn);if(!o)return null;const i=r.getComment(e,n,o);return i?this._injector.createInstance(a.FThreadComment,i):null}getComments(){const r=this._injector.get(I.SheetsThreadCommentModel),e=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o=[];return s.Range.foreach(this._range,(i,u)=>{const C=r.getByLocation(e,n,i,u);if(C){const m=r.getComment(e,n,C);m&&o.push(this._injector.createInstance(a.FThreadComment,m))}}),o}addComment(t){var c;const r=this._injector,e=(c=this.getComment())==null?void 0:c.getCommentData(),n=r.get(s.ICommandService),o=r.get(s.UserManagerService),i=this._workbook.getUnitId(),u=this._worksheet.getSheetId(),C=`${s.Tools.chatAtABC(this._range.startColumn)}${this._range.startRow+1}`,m=o.getCurrentUser(),d=t instanceof k?t.build():{text:t};return n.executeCommand(h.AddCommentCommand.id,{unitId:i,subUnitId:u,comment:{text:d.text,dT:d.dT||h.getDT(),attachments:[],id:d.id||s.generateRandomId(),ref:C,personId:d.personId||m.userID,parentId:e==null?void 0:e.id,unitId:i,subUnitId:u,threadId:(e==null?void 0:e.threadId)||s.generateRandomId()}})}clearComment(){var i;const t=this._injector,r=(i=this.getComment())==null?void 0:i.getCommentData(),e=t.get(s.ICommandService),n=this._workbook.getUnitId(),o=this._worksheet.getSheetId();return r?e.executeCommand(h.DeleteCommentTreeCommand.id,{unitId:n,subUnitId:o,threadId:r.threadId,commentId:r.id}):Promise.resolve(!0)}clearComments(){const r=this.getComments().map(e=>e.deleteAsync());return Promise.all(r).then(()=>!0)}addCommentAsync(t){return this.addComment(t)}clearCommentAsync(){return this.clearComment()}clearCommentsAsync(){return this.clearComments()}}p.FRange.extend(x);class D extends p.FWorkbook{_initialize(){Object.defineProperty(this,"_threadCommentModel",{get(){return this._injector.get(h.ThreadCommentModel)}})}getComments(){return this._threadCommentModel.getUnit(this._workbook.getUnitId()).map(t=>this._injector.createInstance(a.FThreadComment,t.root))}clearComments(){const r=this.getComments().map(e=>e.deleteAsync());return Promise.all(r).then(()=>!0)}onThreadCommentChange(t){return s.toDisposable(this._threadCommentModel.commentUpdate$.pipe(y.filter(r=>r.unitId===this._workbook.getUnitId())).subscribe(t))}onBeforeAddThreadComment(t){return s.toDisposable(this._commandService.beforeCommandExecuted((r,e)=>{const n=r.params;if(r.id===h.AddCommentCommand.id){if(n.unitId!==this._workbook.getUnitId())return;if(t(n,e)===!1)throw new Error("Command is stopped by the hook onBeforeAddThreadComment")}}))}onBeforeUpdateThreadComment(t){return s.toDisposable(this._commandService.beforeCommandExecuted((r,e)=>{const n=r.params;if(r.id===h.UpdateCommentCommand.id){if(n.unitId!==this._workbook.getUnitId())return;if(t(n,e)===!1)throw new Error("Command is stopped by the hook onBeforeUpdateThreadComment")}}))}onBeforeDeleteThreadComment(t){return s.toDisposable(this._commandService.beforeCommandExecuted((r,e)=>{const n=r.params;if(r.id===h.DeleteCommentCommand.id||r.id===h.DeleteCommentTreeCommand.id){if(n.unitId!==this._workbook.getUnitId())return;if(t(n,e)===!1)throw new Error("Command is stopped by the hook onBeforeDeleteThreadComment")}}))}}p.FWorkbook.extend(D);class j extends p.FWorksheet{getComments(){return this._injector.get(I.SheetsThreadCommentModel).getSubUnitAll(this._workbook.getUnitId(),this._worksheet.getSheetId()).map(e=>this._injector.createInstance(a.FThreadComment,e))}clearComments(){const r=this.getComments().map(e=>e.deleteAsync());return Promise.all(r).then(()=>!0)}onCommented(t){return this._injector.get(s.ICommandService).onCommandExecuted(e=>{if(e.id===h.AddCommentCommand.id){const n=e.params;t(n)}})}getCommentById(t){const e=this._injector.get(I.SheetsThreadCommentModel).getComment(this._workbook.getUnitId(),this._worksheet.getSheetId(),t);if(e)return this._injector.createInstance(a.FThreadComment,e)}}p.FWorksheet.extend(j);const _={CommentAdded:"CommentAdded",BeforeCommentAdd:"BeforeCommentAdd",CommentUpdated:"CommentUpdated",BeforeCommentUpdate:"BeforeCommentUpdate",CommentDeleted:"CommentDeleted",BeforeCommentDeleted:"BeforeCommentDeleted",CommentResolved:"CommentResolved",BeforeCommentResolve:"BeforeCommentResolve"};class F extends b.FEventName{get CommentAdded(){return _.CommentAdded}get BeforeCommentAdd(){return _.BeforeCommentAdd}get CommentUpdated(){return _.CommentUpdated}get BeforeCommentUpdate(){return _.BeforeCommentUpdate}get CommentDeleted(){return _.CommentDeleted}get BeforeCommentDeleted(){return _.BeforeCommentDeleted}get CommentResolved(){return _.CommentResolved}get BeforeCommentResolve(){return _.BeforeCommentResolve}}b.FEventName.extend(F);class M extends b.FUniver{_initialize(t){const r=t.get(s.ICommandService);this.registerEventHandler(this.Event.CommentAdded,()=>r.onCommandExecuted(e=>{var d,c,g,l,v;if(e.id!==h.AddCommentCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(d=this.getActiveWorkbook)==null?void 0:d.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{comment:C}=u,m=i.getRange(C.ref).getComment();m&&this.fireEvent(this.Event.CommentAdded,{workbook:o,worksheet:i,row:(g=(c=m.getRange())==null?void 0:c.getRow())!=null?g:0,col:(v=(l=m.getRange())==null?void 0:l.getColumn())!=null?v:0,comment:m})})),this.registerEventHandler(this.Event.CommentUpdated,()=>r.onCommandExecuted(e=>{var d,c,g,l,v;if(e.id!==h.UpdateCommentCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(d=this.getActiveWorkbook)==null?void 0:d.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{commentId:C}=u.payload,m=i.getCommentById(C);m&&this.fireEvent(this.Event.CommentUpdated,{workbook:o,worksheet:i,row:(g=(c=m.getRange())==null?void 0:c.getRow())!=null?g:0,col:(v=(l=m.getRange())==null?void 0:l.getColumn())!=null?v:0,comment:m})})),this.registerEventHandler(this.Event.CommentDeleted,()=>r.onCommandExecuted(e=>{var m;if(e.id!==h.DeleteCommentCommand.id&&e.id!==h.DeleteCommentTreeCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(m=this.getActiveWorkbook)==null?void 0:m.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{commentId:C}=u;this.fireEvent(this.Event.CommentDeleted,{workbook:o,worksheet:i,commentId:C})})),this.registerEventHandler(this.Event.CommentResolved,()=>r.onCommandExecuted(e=>{var c,g,l;if(e.id!==h.ResolveCommentCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(c=this.getActiveWorkbook)==null?void 0:c.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{commentId:C,resolved:m}=u,d=i.getComments().find(v=>v.getCommentData().id===C);d&&this.fireEvent(this.Event.CommentResolved,{workbook:o,worksheet:i,row:(g=d.getRange().getRow())!=null?g:0,col:(l=d.getRange().getColumn())!=null?l:0,comment:d,resolved:m})})),this.registerEventHandler(this.Event.BeforeCommentAdd,()=>r.beforeCommandExecuted(e=>{var c,g,l;if(e.id!==h.AddCommentCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(c=this.getActiveWorkbook)==null?void 0:c.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{comment:C}=u,m=i.getActiveRange();if(!m)return;const d={workbook:o,worksheet:i,row:(g=m.getRow())!=null?g:0,col:(l=m.getColumn())!=null?l:0,comment:w.create(C)};if(this.fireEvent(this.Event.BeforeCommentAdd,d),d.cancel)throw new s.CanceledError})),this.registerEventHandler(this.Event.BeforeCommentUpdate,()=>r.beforeCommandExecuted(e=>{var c,g,l,v,S;if(e.id!==h.UpdateCommentCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(c=this.getActiveWorkbook)==null?void 0:c.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{commentId:C,text:m}=u.payload,d=i.getCommentById(C);if(d){const R={workbook:o,worksheet:i,row:(l=(g=d.getRange())==null?void 0:g.getRow())!=null?l:0,col:(S=(v=d.getRange())==null?void 0:v.getColumn())!=null?S:0,comment:d,newContent:s.RichTextValue.createByBody(m)};if(this.fireEvent(this.Event.BeforeCommentUpdate,R),R.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeCommentDeleted,()=>r.beforeCommandExecuted(e=>{var d,c,g,l,v;if(e.id!==h.DeleteCommentCommand.id&&e.id!==h.DeleteCommentTreeCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(d=this.getActiveWorkbook)==null?void 0:d.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{commentId:C}=u,m=i.getCommentById(C);if(m){const S={workbook:o,worksheet:i,row:(g=(c=m.getRange())==null?void 0:c.getRow())!=null?g:0,col:(v=(l=m.getRange())==null?void 0:l.getColumn())!=null?v:0,comment:m};if(this.fireEvent(this.Event.BeforeCommentDeleted,S),S.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeCommentResolve,()=>r.beforeCommandExecuted(e=>{var c,g,l;if(e.id!==h.ResolveCommentCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(c=this.getActiveWorkbook)==null?void 0:c.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{commentId:C,resolved:m}=u,d=i.getComments().find(v=>v.getCommentData().id===C);if(d){const v={workbook:o,worksheet:i,row:(g=d.getRange().getRow())!=null?g:0,col:(l=d.getRange().getColumn())!=null?l:0,comment:d,resolved:m};if(this.fireEvent(this.Event.BeforeCommentResolve,v),v.cancel)throw new s.CanceledError}}))}newTheadComment(t){return new k(t)}}b.FUniver.extend(M),Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
|
80
|
+
(function(a,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/sheets-thread-comment"),require("@univerjs/sheets/facade"),require("@univerjs/thread-comment"),require("@univerjs/engine-formula"),require("rxjs"),require("@univerjs/core/facade")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-thread-comment","@univerjs/sheets/facade","@univerjs/thread-comment","@univerjs/engine-formula","rxjs","@univerjs/core/facade"],s):(a=typeof globalThis<"u"?globalThis:a||self,s(a.UniverSheetsThreadCommentFacade={},a.UniverCore,a.UniverSheetsThreadComment,a.UniverSheetsFacade,a.UniverThreadComment,a.UniverEngineFormula,a.rxjs,a.UniverCoreFacade))})(this,function(a,s,I,p,h,E,y,b){"use strict";var P=Object.defineProperty;var W=(a,s,I)=>s in a?P(a,s,{enumerable:!0,configurable:!0,writable:!0,value:I}):a[s]=I;var T=(a,s,I)=>W(a,typeof s!="symbol"?s+"":s,I);var A=Object.getOwnPropertyDescriptor,B=(f,t,r,e)=>{for(var n=e>1?void 0:e?A(t,r):t,o=f.length-1,i;o>=0;o--)(i=f[o])&&(n=i(n)||n);return n},U=(f,t)=>(r,e)=>t(r,e,f);class w{constructor(t){T(this,"_comment",{id:s.generateRandomId(),ref:"",threadId:"",dT:"",personId:"",text:s.RichTextBuilder.newEmptyData().body,attachments:[],unitId:"",subUnitId:""});t&&(this._comment=t)}static create(t){return new w(t)}get personId(){return this._comment.personId}get dateTime(){return this._comment.dT}get content(){return s.RichTextValue.createByBody(this._comment.text)}get id(){return this._comment.id}get threadId(){return this._comment.threadId}copy(){return k.create(s.Tools.deepClone(this._comment))}}class k extends w{static create(t){return new k(t)}setContent(t){return t instanceof s.RichTextValue?this._comment.text=t.getData().body:this._comment.text=t,this}setPersonId(t){return this._comment.personId=t,this}setDateTime(t){return this._comment.dT=h.getDT(t),this}setId(t){return this._comment.id=t,this}setThreadId(t){return this._comment.threadId=t,this}build(){return this._comment}}a.FThreadComment=class{constructor(t,r,e,n,o,i,u){this._thread=t,this._parent=r,this._injector=e,this._commandService=n,this._univerInstanceService=o,this._threadCommentModel=i,this._userManagerService=u}_getRef(){var e;const t=((e=this._parent)==null?void 0:e.ref)||this._thread.ref;return E.deserializeRangeWithSheet(t).range}getIsRoot(){return!this._parent}getCommentData(){const{children:t,...r}=this._thread;return r}getReplies(){var e;const t=this._getRef(),r=this._threadCommentModel.getCommentWithChildren(this._thread.unitId,this._thread.subUnitId,t.startRow,t.startColumn);return(e=r==null?void 0:r.children)==null?void 0:e.map(n=>this._injector.createInstance(a.FThreadComment,n))}getRange(){const t=this._univerInstanceService.getUnit(this._thread.unitId,s.UniverInstanceType.UNIVER_SHEET);if(!t)return null;const r=t.getSheetBySheetId(this._thread.subUnitId);if(!r)return null;const e=this._getRef();return this._injector.createInstance(p.FRange,t,r,e)}getContent(){return this._thread.text}getRichText(){const t=this._thread.text;return s.RichTextValue.create({body:t,documentStyle:{},id:"d"})}deleteAsync(){return this._commandService.executeCommand(this.getIsRoot()?h.DeleteCommentTreeCommand.id:h.DeleteCommentCommand.id,{commentId:this._thread.id,unitId:this._thread.unitId,subUnitId:this._thread.subUnitId})}delete(){return this.deleteAsync()}async update(t){return this.updateAsync(t)}async updateAsync(t){const r=t instanceof s.RichTextValue?t.getData().body:t,e=h.getDT();return await this._commandService.executeCommand(h.UpdateCommentCommand.id,{unitId:this._thread.unitId,subUnitId:this._thread.subUnitId,payload:{commentId:this._thread.id,text:r,updated:!0,updateT:e}})}resolve(t){return this.resolveAsync(t)}resolveAsync(t){return this._commandService.executeCommand(h.ResolveCommentCommand.id,{unitId:this._thread.unitId,subUnitId:this._thread.subUnitId,commentId:this._thread.id,resolved:t!=null?t:!this._thread.resolved})}replyAsync(t){var e;const r=t.build();return this._commandService.executeCommand(h.AddCommentCommand.id,{unitId:this._thread.unitId,subUnitId:this._thread.subUnitId,comment:{id:s.generateRandomId(),parentId:this._thread.id,threadId:this._thread.threadId,ref:((e=this._parent)==null?void 0:e.ref)||this._thread.ref,unitId:this._thread.unitId,subUnitId:this._thread.subUnitId,text:r.text,attachments:r.attachments,dT:r.dT||h.getDT(),personId:r.personId||this._userManagerService.getCurrentUser().userID}})}},a.FThreadComment=B([U(2,s.Inject(s.Injector)),U(3,s.ICommandService),U(4,s.IUniverInstanceService),U(5,s.Inject(I.SheetsThreadCommentModel)),U(6,s.Inject(s.UserManagerService))],a.FThreadComment);class x extends p.FRange{getComment(){const r=this._injector.get(I.SheetsThreadCommentModel),e=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o=r.getByLocation(e,n,this._range.startRow,this._range.startColumn);if(!o)return null;const i=r.getComment(e,n,o);return i?this._injector.createInstance(a.FThreadComment,i):null}getComments(){const r=this._injector.get(I.SheetsThreadCommentModel),e=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o=[];return s.Range.foreach(this._range,(i,u)=>{const C=r.getByLocation(e,n,i,u);if(C){const m=r.getComment(e,n,C);m&&o.push(this._injector.createInstance(a.FThreadComment,m))}}),o}addComment(t){var c;const r=this._injector,e=(c=this.getComment())==null?void 0:c.getCommentData(),n=r.get(s.ICommandService),o=r.get(s.UserManagerService),i=this._workbook.getUnitId(),u=this._worksheet.getSheetId(),C=`${s.Tools.chatAtABC(this._range.startColumn)}${this._range.startRow+1}`,m=o.getCurrentUser(),d=t instanceof k?t.build():{text:t};return n.executeCommand(h.AddCommentCommand.id,{unitId:i,subUnitId:u,comment:{text:d.text,dT:d.dT||h.getDT(),attachments:[],id:d.id||s.generateRandomId(),ref:C,personId:d.personId||m.userID,parentId:e==null?void 0:e.id,unitId:i,subUnitId:u,threadId:(e==null?void 0:e.threadId)||s.generateRandomId()}})}clearComment(){var i;const t=this._injector,r=(i=this.getComment())==null?void 0:i.getCommentData(),e=t.get(s.ICommandService),n=this._workbook.getUnitId(),o=this._worksheet.getSheetId();return r?e.executeCommand(h.DeleteCommentTreeCommand.id,{unitId:n,subUnitId:o,threadId:r.threadId,commentId:r.id}):Promise.resolve(!0)}clearComments(){const r=this.getComments().map(e=>e.deleteAsync());return Promise.all(r).then(()=>!0)}addCommentAsync(t){return this.addComment(t)}clearCommentAsync(){return this.clearComment()}clearCommentsAsync(){return this.clearComments()}}p.FRange.extend(x);class D extends p.FWorkbook{_initialize(){Object.defineProperty(this,"_threadCommentModel",{get(){return this._injector.get(h.ThreadCommentModel)}})}getComments(){return this._threadCommentModel.getUnit(this._workbook.getUnitId()).map(t=>this._injector.createInstance(a.FThreadComment,t.root))}clearComments(){const r=this.getComments().map(e=>e.deleteAsync());return Promise.all(r).then(()=>!0)}onThreadCommentChange(t){return s.toDisposable(this._threadCommentModel.commentUpdate$.pipe(y.filter(r=>r.unitId===this._workbook.getUnitId())).subscribe(t))}onBeforeAddThreadComment(t){return s.toDisposable(this._commandService.beforeCommandExecuted((r,e)=>{const n=r.params;if(r.id===h.AddCommentCommand.id){if(n.unitId!==this._workbook.getUnitId())return;if(t(n,e)===!1)throw new Error("Command is stopped by the hook onBeforeAddThreadComment")}}))}onBeforeUpdateThreadComment(t){return s.toDisposable(this._commandService.beforeCommandExecuted((r,e)=>{const n=r.params;if(r.id===h.UpdateCommentCommand.id){if(n.unitId!==this._workbook.getUnitId())return;if(t(n,e)===!1)throw new Error("Command is stopped by the hook onBeforeUpdateThreadComment")}}))}onBeforeDeleteThreadComment(t){return s.toDisposable(this._commandService.beforeCommandExecuted((r,e)=>{const n=r.params;if(r.id===h.DeleteCommentCommand.id||r.id===h.DeleteCommentTreeCommand.id){if(n.unitId!==this._workbook.getUnitId())return;if(t(n,e)===!1)throw new Error("Command is stopped by the hook onBeforeDeleteThreadComment")}}))}}p.FWorkbook.extend(D);class j extends p.FWorksheet{getComments(){return this._injector.get(I.SheetsThreadCommentModel).getSubUnitAll(this._workbook.getUnitId(),this._worksheet.getSheetId()).map(e=>this._injector.createInstance(a.FThreadComment,e))}clearComments(){const r=this.getComments().map(e=>e.deleteAsync());return Promise.all(r).then(()=>!0)}onCommented(t){return this._injector.get(s.ICommandService).onCommandExecuted(e=>{if(e.id===h.AddCommentCommand.id){const n=e.params;t(n)}})}getCommentById(t){const e=this._injector.get(I.SheetsThreadCommentModel).getComment(this._workbook.getUnitId(),this._worksheet.getSheetId(),t);if(e)return this._injector.createInstance(a.FThreadComment,e)}}p.FWorksheet.extend(j);const _={CommentAdded:"CommentAdded",BeforeCommentAdd:"BeforeCommentAdd",CommentUpdated:"CommentUpdated",BeforeCommentUpdate:"BeforeCommentUpdate",CommentDeleted:"CommentDeleted",BeforeCommentDelete:"BeforeCommentDelete",CommentResolved:"CommentResolved",BeforeCommentResolve:"BeforeCommentResolve"};class F extends b.FEventName{get CommentAdded(){return _.CommentAdded}get BeforeCommentAdd(){return _.BeforeCommentAdd}get CommentUpdated(){return _.CommentUpdated}get BeforeCommentUpdate(){return _.BeforeCommentUpdate}get CommentDeleted(){return _.CommentDeleted}get BeforeCommentDelete(){return _.BeforeCommentDelete}get CommentResolved(){return _.CommentResolved}get BeforeCommentResolve(){return _.BeforeCommentResolve}}b.FEventName.extend(F);class M extends b.FUniver{_initialize(t){const r=t.get(s.ICommandService);this.registerEventHandler(this.Event.CommentAdded,()=>r.onCommandExecuted(e=>{var d,c,g,l,v;if(e.id!==h.AddCommentCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(d=this.getActiveWorkbook)==null?void 0:d.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{comment:C}=u,m=i.getRange(C.ref).getComment();m&&this.fireEvent(this.Event.CommentAdded,{workbook:o,worksheet:i,row:(g=(c=m.getRange())==null?void 0:c.getRow())!=null?g:0,col:(v=(l=m.getRange())==null?void 0:l.getColumn())!=null?v:0,comment:m})})),this.registerEventHandler(this.Event.CommentUpdated,()=>r.onCommandExecuted(e=>{var d,c,g,l,v;if(e.id!==h.UpdateCommentCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(d=this.getActiveWorkbook)==null?void 0:d.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{commentId:C}=u.payload,m=i.getCommentById(C);m&&this.fireEvent(this.Event.CommentUpdated,{workbook:o,worksheet:i,row:(g=(c=m.getRange())==null?void 0:c.getRow())!=null?g:0,col:(v=(l=m.getRange())==null?void 0:l.getColumn())!=null?v:0,comment:m})})),this.registerEventHandler(this.Event.CommentDeleted,()=>r.onCommandExecuted(e=>{var m;if(e.id!==h.DeleteCommentCommand.id&&e.id!==h.DeleteCommentTreeCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(m=this.getActiveWorkbook)==null?void 0:m.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{commentId:C}=u;this.fireEvent(this.Event.CommentDeleted,{workbook:o,worksheet:i,commentId:C})})),this.registerEventHandler(this.Event.CommentResolved,()=>r.onCommandExecuted(e=>{var c,g,l;if(e.id!==h.ResolveCommentCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(c=this.getActiveWorkbook)==null?void 0:c.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{commentId:C,resolved:m}=u,d=i.getComments().find(v=>v.getCommentData().id===C);d&&this.fireEvent(this.Event.CommentResolved,{workbook:o,worksheet:i,row:(g=d.getRange().getRow())!=null?g:0,col:(l=d.getRange().getColumn())!=null?l:0,comment:d,resolved:m})})),this.registerEventHandler(this.Event.BeforeCommentAdd,()=>r.beforeCommandExecuted(e=>{var c,g,l;if(e.id!==h.AddCommentCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(c=this.getActiveWorkbook)==null?void 0:c.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{comment:C}=u,m=i.getActiveRange();if(!m)return;const d={workbook:o,worksheet:i,row:(g=m.getRow())!=null?g:0,col:(l=m.getColumn())!=null?l:0,comment:w.create(C)};if(this.fireEvent(this.Event.BeforeCommentAdd,d),d.cancel)throw new s.CanceledError})),this.registerEventHandler(this.Event.BeforeCommentUpdate,()=>r.beforeCommandExecuted(e=>{var c,g,l,v,S;if(e.id!==h.UpdateCommentCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(c=this.getActiveWorkbook)==null?void 0:c.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{commentId:C,text:m}=u.payload,d=i.getCommentById(C);if(d){const R={workbook:o,worksheet:i,row:(l=(g=d.getRange())==null?void 0:g.getRow())!=null?l:0,col:(S=(v=d.getRange())==null?void 0:v.getColumn())!=null?S:0,comment:d,newContent:s.RichTextValue.createByBody(m)};if(this.fireEvent(this.Event.BeforeCommentUpdate,R),R.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeCommentDelete,()=>r.beforeCommandExecuted(e=>{var d,c,g,l,v;if(e.id!==h.DeleteCommentCommand.id&&e.id!==h.DeleteCommentTreeCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(d=this.getActiveWorkbook)==null?void 0:d.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{commentId:C}=u,m=i.getCommentById(C);if(m){const S={workbook:o,worksheet:i,row:(g=(c=m.getRange())==null?void 0:c.getRow())!=null?g:0,col:(v=(l=m.getRange())==null?void 0:l.getColumn())!=null?v:0,comment:m};if(this.fireEvent(this.Event.BeforeCommentDelete,S),S.cancel)throw new s.CanceledError}})),this.registerEventHandler(this.Event.BeforeCommentResolve,()=>r.beforeCommandExecuted(e=>{var c,g,l;if(e.id!==h.ResolveCommentCommand.id)return;const n=e.params;if(!n)return;const o=n.unitId?this.getUniverSheet(n.unitId):(c=this.getActiveWorkbook)==null?void 0:c.call(this);if(!o)return;const i=o.getSheetBySheetId(n.subUnitId||n.sheetId)||o.getActiveSheet();if(!i)return;const u=e.params,{commentId:C,resolved:m}=u,d=i.getComments().find(v=>v.getCommentData().id===C);if(d){const v={workbook:o,worksheet:i,row:(g=d.getRange().getRow())!=null?g:0,col:(l=d.getRange().getColumn())!=null?l:0,comment:d,resolved:m};if(this.fireEvent(this.Event.BeforeCommentResolve,v),v.cancel)throw new s.CanceledError}}))}newTheadComment(t){return new k(t)}}b.FUniver.extend(M),Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
// index
|