@grapecity-software/spread-sheets-designer 19.0.2 → 19.0.3
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
*
|
|
3
|
-
* SpreadJS Designer Library 19.0.
|
|
3
|
+
* SpreadJS Designer Library 19.0.3
|
|
4
4
|
*
|
|
5
5
|
* Copyright(c) GrapeCity Software inc. All rights reserved.
|
|
6
6
|
*
|
|
@@ -344,7 +344,7 @@ e.repeatRowStart(x)}else b.repeatRowAvailable=!1;return aoe(b.headerAndFooter),b
|
|
|
344
344
|
`,columnDelimiter:h.exportCsvSetting_columnDelimiter||","},fe=h.exportPdfSetting_sheetToExport&&h.exportPdfSetting_sheetToExport.selectedValue||void 0,J={title:h.exportPdfSetting_title||"",author:h.exportPdfSetting_author||"",creator:h.exportPdfSetting_application||"",subject:h.exportPdfSetting_subject||"",keywords:h.exportPdfSetting_keywords||"",sheetToExport:{selectedValue:fe,items:At.getSheetNameItems(t)}},V,Z=h.printSetting||{};if(GC.Spread.Sheets.Print){let $=C.getCurrentPrintSheet(t),ee=$&&$.printInfo&&$.printInfo(),ae=C.getDefaultPrintPaperKinds();if(ee){let de=Zo.custom,he=ee.margin();ee.zoomFactor()===1&&(ee.fitPagesTall()===-1&&ee.fitPagesWide()===-1?de=Zo.noScaling:ee.fitPagesTall()===1&&ee.fitPagesWide()===-1?de=Zo.fitAllRowsOnOnePage:ee.fitPagesTall()===-1&&ee.fitPagesWide()===1?de=Zo.fitAllColumnsOnOnePage:ee.fitPagesTall()===1&&ee.fitPagesWide()===1&&(de=Zo.fitSheetOnOnePage));let be=hR(t,he);V={...Z,orientation:ee.orientation(),paperType:ee.paperSize().kind(),marginType:be,scaling:de,activeCategoryIsPrint:g===na.Print,allowPrintCurrentSheet:!0,paperKindItems:ae,reportSheetPreviewState:t!=null&&t.getData(m.ReportSheetIsPaginatedPreviewMode)?"Paginated":t!=null&&t.getData(m.ReportSheetIsPreviewMode)?"Preview":"",canPrintSheetSelection:!(t!=null&&t.getData(m.ReportSheetActive))}}else V={...Z,activeCategoryIsPrint:g===na.Print,allowPrintCurrentSheet:!1,paperKindItems:ae}}let Y=(H=h.saveFileName)!=null?H:t.getData(m.SaveFileName);const W=Coe(i,t);return{activeCategory_hide:na.Hide,activeCategory_main:g,activeCategory_open:f,activeCategory_import:b,activeCategory_export:S,templateSetting:mne,recentWorkbookFiles_open:v,currentFolderFiles_open:x,recentFolderFiles_open:M,currentFolderFiles_save:L,recentFolderFiles_save:D,importExcelSetting:P,importCsvSetting:K,exportJsonSetting:X,exportExcelSetting:ne,exportCsvSetting:ce,exportPdfSetting:J,printSetting:V,openOptions:I,saveOptions:R,importXlsxOptions:F,exportXlsxOptions:j,saveFileName:Y,docProps:W}}static processPropertyChanged(t,i,n){if(i){let o=t.getData(re.fileMenuSetting)||{};if(o[i.replace(".","_")]=n,i.endsWith(".calcOnDemand")&&n?o[i.replace(".calcOnDemand","_incrementalCalculation")]=!1:i.endsWith(".incrementalCalculation")&&n&&(o[i.replace(".incrementalCalculation","_calcOnDemand")]=!1),i==="printSetting"&&n&&t.setData(m.PrintPreviewFileMenuUpdateCache,!0),t.setData(re.fileMenuSetting,o),["activeCategory_main","activeCategory_export","activeCategory_import"].indexOf(i)>-1){let c=document.querySelector(`.category-content-container [data-${i}="${n}]"`);if(c){for(let d=0;d<c.children.length;d++)c.children[d].setAttribute("aria-hidden","true");t.getWorkbook().options.enableAccessibility&&c.focus(),setTimeout(()=>{for(let d=0;d<c.children.length;d++)c.children[d].removeAttribute("aria-hidden")},500)}}}let a=At.getFileMenuOption(t);const r=t.getData(m.SaveFileName);switch(i){case"activeCategory_hide":At.hideFileMenu(t);break;case"templateSetting":At.processNewTemplate(t),At.hideFileMenu(t);break;case"button_import_ssjson":At.importJson_online(t);break;case"button_import_excel":At.importExcelSJSFormat(t,a);break;case"button_import_excel_io":At.importExcel_online(t,a);break;case"button_import_csv":At.importCsv_online(t,a);break;case"button_export_ssjson":At.exportJson_online(t,a,void 0,r);break;case"button_export_javascript":At.exportJavascript_online(t,a,r);break;case"button_export_excel":let l=gR(Number(t.getData(m.SaveFileType)))||t.getData(re.saveFileType);At.exportExcelSJSFormat(t,a,r||"",fR(l));break;case"button_export_io_excel":At.exportExcel_online(t,a,r);break;case"button_export_csv":At.exportCsv_online(t,At.getFileMenuOption(t),r);break;case"button_export_pdf":At.exportPdf_online(t,a,r);break;case"exportExcelSetting.exportRowAndColumnHeaders":At.exportExcelRowAndColumnHandler(t,a);break;case"exportExcelSetting.exportRowHeaders":case"exportExcelSetting.exportColumnHeaders":At.exportExcelRowOrColumnHandler(t,a);break;case"importExcelSetting.importRowAndColumnHeaders":At.importExcelRowAndColumnHandler(t,a);break;case"importExcelSetting.importRowHeaders":case"importExcelSetting.importColumnHeaders":At.importExcelRowOrColumnHandler(t,a);break;case"button_open_sjs":At.openSJS(t,a);break;case"button_save_sjs":At.saveSJS(t,a);break;case"docProps":At.updateDocProps(t,n);break}}static async processNewTemplate(t){await At.openTemplate(t,"Blank")}static async openTemplate(t,i){(!i||i==="Blank")&&At.onNewFile(t)}static async onNewFile(t){if(t.getData(re.isFileModified))switch(await At.showUnsavedWarning(t)){case Si.yes:await At.save(t,!1)&&await At.resetCore(t);break;case Si.no:At.resetCore(t);break;case Si.cancel:return}else At.resetCore(t)}static initTableTotalRowList(t){t.getWorkbook().sheets.forEach(i=>{i.tables.all().forEach(n=>{if(n.showFooter()){n.useFooterDropDownList(!0);let a=t.getData(re.tableFooterCommands);p_(n,a)}})})}static async save(t,i,n){t.getWorkbook().focus(!1);let a=await At.saveAs(t,void 0,i,n);return t.getWorkbook().focus(!0),Promise.resolve(a)}static async saveAs(t,i,n,a){let r=At.getFileMenuOption(t),o=t.getData(m.SaveFileName),c=gR(Number(t.getData(m.SaveFileType)))||t.getData(re.saveFileType);switch(c){case zi.Excel:case zi.XLSM:case zi.XLTM:return At.exportExcelSJSFormat(t,r,o,fR(c));case zi.Csv:return At.exportCsv_online(t,r,o);case zi.SJS:return At.saveSJS_online(t,r,o);default:return At.exportJson_online(t,r,a,o)}}static async saveModifyFile(t){let i=await At.showUnsavedWarning(t),n=Promise.resolve(!0),a=Promise.resolve(!1);switch(i){case Si.yes:return await At.save(t,!1,!1)?n:a;case Si.no:return n;case Si.cancel:return a}}static async importJson_online(t){let i=await ro(".ssjson, .json");if(!i)return;let n=!0;if(t.getData(re.isFileModified)&&(n=!!await At.saveModifyFile(t)),!!n)return new Promise((a,r)=>{if(i){let o=new FileReader,l=t.getData(re.container);Sa.show(l),o.onload=function(){var h;let c=o.result,d=t._getGlobalEvent(),u={designer:t,fileType:zi.Json,fileName:(h=i.name)!=null?h:"",data:c,cancel:!1};if(d&&d.fire(jt.fileLoading,{type:jt.fileLoading},u),c=u.data,!u.cancel)try{let g=c[0],b=JSON.parse(g==="\uFEFF"||g===""?c.substr(1):c);b.designerBindingPathSchema&&(t.setData(re.treeNodeFromJson,JSON.stringify(b.designerBindingPathSchema)),delete b.designerBindingPathSchema),t.getWorkbook().fromJSON(b),t.setData(m.DocPropAccessDate,new Date),t.setData(re.hasSortHeaderRowMap,void 0),At.initTableTotalRowList(t),At.setStateNames(t),At.updatePanel(t),a(),d&&d.fire(jt.fileLoaded,{type:jt.fileLoaded},{designer:t,fileType:zi.Json}),t.setData(re.saveFileType,zi.Json)}catch(g){r(g)}Sa.hide(l)},o.readAsText(i)}}).catch(()=>{t._showMessageBox(s.openFileFormatError,s.title,Re.warning)})}static sheetProtectOptionHandler(t){t.sheets.forEach(n=>{let a=n.options.protectionOptions;a&&(a.formatRows&&(a.allowOutlineRows=!0),a.formatColumns&&(a.allowOutlineColumns=!0),n.options.protectionOptions=a)})}static async importExcelSJSFormat(t,i){var d;let n=await ro(".xlsx,.xlsm,.xltm");if(!n)return;let a=!0;if(t.getData(re.isFileModified)&&(a=!!await At.saveModifyFile(t)),!a)return;let r=t._getGlobalEvent(),o={designer:t,fileType:zi.Excel,fileName:(d=n.name)!=null?d:"",data:n,cancel:!1};if(r&&r.fire(jt.fileLoading,{type:jt.fileLoading},o),o.cancel)return;let l=t.getWorkbook(),c=t.getData(re.container);Sa.show(c),delete i.importXlsxOptions.lazyLoad,i.importXlsxOptions||(i.importXlsxOptions={}),i.importXlsxOptions.openMode!==0&&(i.importXlsxOptions.progress=u=>{u.progress>0&&t.getData(m.FileMenu_show)&&(At.hideFileMenu(t),Sa.hide(c))}),l.import(o.data,()=>{r&&r.fire(jt.fileLoaded,{type:jt.fileLoaded},{designer:t,fileType:zi.Excel});const u=g=>{var b;if(!g)return"";const f=g.lastIndexOf(".");return f===-1?"":(b=g.slice(f+1))==null?void 0:b.toUpperCase()},h=g=>{switch(u(g.name)){case"XLSX":return zi.Excel;case"XLSM":return zi.XLSM;case"XLTM":return zi.XLTM}switch(g.type){case"application/vnd.ms-excel.sheet.macroEnabled.12":return zi.XLSM;case"application/vnd.ms-excel.template.macroEnabled.12":return zi.XLTM}return zi.Excel};t.setData(re.saveFileType,h(n)),Sa.hide(c),At.updateBuildInStyleNameMap(t),At.initTableTotalRowList(t),At.setStateNames(t),At.updatePanel(t)},async u=>{Sa.hide(c),await t._showMessageBox(u.errorMessage,s.title,Re.warning)},{...i.importXlsxOptions,fileType:GC.Spread.Sheets.FileType.excel}),t.setData(m.DocPropAccessDate,new Date),t.setData(re.hasSortHeaderRowMap,void 0)}static async importExcel_online(t,i,n){let a=await ro(n?".sjs":".xlsx");if(!a)return;let r=!0;if(t.getData(re.isFileModified)&&(r=!!await At.saveModifyFile(t)),!!r)return new Promise((o,l)=>{if(a){let c=new FileReader,d=t.getData(re.container);Sa.show(d),c.onload=function(u){new GC.Spread.Excel.IO().open(c.result,function(g){var S;let f=t._getGlobalEvent(),b={designer:t,fileType:zi.Excel,fileName:(S=a.name)!=null?S:"",data:g,cancel:!1};f&&f.fire(jt.fileLoading,{type:jt.fileLoading},b),b.cancel||(t.getWorkbook().fromJSON(g,{doNotRecalculateAfterLoad:i.importExcelSetting&&i.importExcelSetting.importDoNotRecalculateAfterLoad,frozenColumnsAsRowHeaders:i.importExcelSetting&&i.importExcelSetting.importColumnHeaders,frozenRowsAsColumnHeaders:i.importExcelSetting&&i.importExcelSetting.importRowHeaders,ignoreFormula:i.importExcelSetting&&i.importExcelSetting.ignoreFormula,ignoreStyle:i.importExcelSetting&&i.importExcelSetting.ignoreStyle,incrementalLoading:i.importExcelSetting&&i.importExcelSetting.incrementalLoading}),At.updateBuildInStyleNameMap(t),At.initTableTotalRowList(t),At.setStateNames(t),At.updatePanel(t),o(),At.sheetProtectOptionHandler(t.getWorkbook()),f&&f.fire(jt.fileLoaded,{type:jt.fileLoaded},{designer:t,fileType:zi.Excel}),t.setData(re.saveFileType,zi.Excel)),Sa.hide(d)},async function(g){Sa.hide(d),await t._showMessageBox(g.errorMessage,s.title,Re.warning),l()},i.importExcelSetting)},c.readAsArrayBuffer(a),t.setData(m.DocPropAccessDate,new Date),t.setData(re.hasSortHeaderRowMap,void 0)}})}static async importCsv_online(t,i){let n=await ro(".csv");if(!n)return;let a=!0;if(t.getData(re.isFileModified)&&(a=!!await At.saveModifyFile(t)),!!a)return new Promise((r,o)=>{if(n){let l=t.getData(re.container);Sa.show(l);let c=new FileReader;c.onload=function(d){var b;let u=c.result,h=i.importCsvSetting,g=t._getGlobalEvent(),f={designer:t,fileType:zi.Csv,fileName:(b=n.name)!=null?b:"",data:u,cancel:!1};if(g&&g.fire(jt.fileLoading,{type:jt.fileLoading},f),u=f.data,h&&!f.cancel){let S=h.rowDelimiter||"\\r\\n",y=h.columnDelimiter||",",v=t.getWorkbook().getActiveSheet();v&&(v.reset(),S=S.replace("\\n",`
|
|
345
345
|
`).replace("\\r","\r"),v.setCsv(0,0,u,S,y)),At.setStateNames(t),At.updatePanel(t),r(),g&&g.fire(jt.fileLoaded,{type:jt.fileLoaded},{designer:t,fileType:zi.Csv}),t.setData(re.saveFileType,zi.Csv)}Sa.hide(l)},c.readAsText(n,i.importCsvSetting&&i.importCsvSetting.encoding||uR),t.setData(m.DocPropAccessDate,new Date),t.setData(re.hasSortHeaderRowMap,void 0)}})}static async openSJS(t,i){var u;let n=await ro(".sjs");if(!n)return;let a=!0;if(t.getData(re.isFileModified)&&(a=!!await At.saveModifyFile(t)),!a)return;let r=t._getGlobalEvent(),o={designer:t,fileType:zi.SJS,fileName:(u=n.name)!=null?u:"",data:n,cancel:!1};if(r&&r.fire(jt.fileLoading,{type:jt.fileLoading},o),o.cancel)return;let l=t.getWorkbook(),c=t.getData(re.container);Sa.show(c),delete i.openOptions.lazyLoad;let d={...i.openOptions};d.openMode!==0&&(d.progress=h=>{h.progress>0&&t.getData(m.FileMenu_show)&&(At.hideFileMenu(t),Sa.hide(c))}),l.open(o.data,h=>{var f;r&&r.fire(jt.fileLoaded,{type:jt.fileLoaded},{designer:t,fileType:zi.SJS}),t.setData(re.saveFileType,zi.SJS);let g=(f=h==null?void 0:h.customData)==null?void 0:f.designerBindingPathSchema;g&&t.setData(re.treeNodeFromJson,JSON.stringify(g)),Sa.hide(c),At.initTableTotalRowList(t),At.setStateNames(t),At.updatePanel(t)},async h=>{Sa.hide(c),await t._showMessageBox(h.errorMessage,s.title,Re.warning),At.hideFileMenu(t)},d),t.setData(m.DocPropAccessDate,new Date),t.setData(re.hasSortHeaderRowMap,void 0)}static setStateNames(t){t.setData(re.isFileModified,!0),t.setData(m.FieldListVisible,!1),t.setData(m.SelectionPane,!1),t.setData(m.IsInParameterPanelDesignMode,!1),t.setData(m.ReportCellPanelVisible,!0),S_(t),t.setData(m.ParameterPanelHasBeenRefreshed,!1),At.hideFileMenu(t)}static updatePanel(t){Ae.attachPivotPanel(t)}static updateBuildInStyleNameMap(t){const i=t.getData(re.buildCellStyleList)||t.getData(re.buildInCustomCellStyle),n=["colorPicker-cellbutton","datetimepicker-cellbutton","dateRangePicker-cellbutton","timepicker-cellbutton","calculator-cellbutton","monthpicker-cellbutton","slider-cellbutton","sliderRange-cellbutton","okcancel-cellbutton","clear-cellbutton"],a={};if(i)for(let r of n)a[r]=voe(t.getWorkbook(),r),i[r].name=a[r];t.setData(re.buildInCustomCellStyleNameMap,a)}static async exportJson_online(t,i,n,a){let r=await t._showDialog(G.SaveFileDialogTemplate,{extName:".ssjson",fileName:a||""});if(r){Ld(t.getWorkbook(),new Date);let o=t.getWorkbook(),l=i.exportJsonSetting;if(l&&l.sheetToExport&&l.sheetToExport.selectedValue!==void 0&&l.sheetToExport.selectedValue!==null){let f=+l.sheetToExport.selectedValue;o=At.cloneSpreadBySheetIndex(t.getWorkbook(),f)}let c=r.fileName||"export",d=r.extName||"",u=At.spreadToJSON(t,o),h=t.getData(re.treeNodeFromJson);h&&(u.designerBindingPathSchema=typeof h=="string"?JSON.parse(h):h),u=JSON.stringify(u);let g=new Blob([u],{type:Hx});cs.saveAs(g,c+d),n!==!1&&At.hideFileMenu(t)}return Promise.resolve(r)}static async exportJavascript_online(t,i,n){let a=await t._showDialog(G.SaveFileDialogTemplate,{extName:".js",fileName:n||""});if(a){Ld(t.getWorkbook(),new Date);let r=t.getWorkbook(),o=i.exportJsonSetting;if(o&&o.sheetToExport&&o.sheetToExport.selectedValue!==void 0&&o.sheetToExport.selectedValue!==null){let h=+o.sheetToExport.selectedValue;r=At.cloneSpreadBySheetIndex(t.getWorkbook(),h)}let l=a.fileName||"export",c=a.extName||"",d=JSON.stringify(r&&r.toJSON({includeBindingSource:!0}));d="var "+At.getVariableName(l+c)+" = "+d+";";let u=new Blob([d],{type:Hx});cs.saveAs(u,l+c),At.hideFileMenu(t)}}static async exportExcel_online(t,i,n){let a=await t._showDialog(G.SaveFileDialogTemplate,{extName:".xlsx",fileName:n||""}),r=i.exportExcelSetting;if(a&&r){Ld(t.getWorkbook(),new Date);let o=a.fileName||"export",l=a.extName||"",c=JSON.stringify(t.getWorkbook()&&t.getWorkbook().toJSON({includeBindingSource:r.includeBindingSource,saveAsView:r.saveAsView,columnHeadersAsFrozenRows:r.exportColumnHeaders,ignoreFormula:r.ignoreFormula,ignoreStyle:r.ignoreStyle,rowHeadersAsFrozenColumns:r.exportRowHeaders}));new GC.Spread.Excel.IO().save(c,function(u){let h=new Blob([u],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});cs.saveAs(h,o+l),At.hideFileMenu(t)},async function(u){await t._showMessageBox(u.errorMessage,s.title,Re.warning)},r)}return Promise.resolve(a)}static async exportCsv_online(t,i,n){let a=await t._showDialog(G.SaveFileDialogTemplate,{extName:".csv",fileName:n||""}),r=i.exportCsvSetting;if(a&&r){Ld(t.getWorkbook(),new Date);let o=a.fileName||"export",l=a.extName||"";try{let c=xoe(t.getWorkbook(),r.sheetIndex);if(c){let d=c.getCsv(r.row,r.column,r.rowCount,r.columnCount,r.rowDelimiter,r.columnDelimiter);const u=new Uint8Array([239,187,191]);let h=new Blob([u,d],{type:Hx});cs.saveAs(h,o+l)}At.hideFileMenu(t)}catch(c){t._showMessageBox(c.message,s.title,Re.error,vt.ok)}}return Promise.resolve(a)}static async exportExcelSJSFormat(t,i,n,a){let r=i.exportExcelSetting,o=await t._showDialog(UM(gne),{extName:a||".xlsx",fileName:n||"",showExtNameList:!0});if(o&&r){Ld(t.getWorkbook(),new Date);let l=o.fileName||"export",c=o.extName||"";return new Promise((d,u)=>{t.getWorkbook().export(h=>{cs.saveAs(h,l+c),At.hideFileMenu(t),d(!0)},h=>{t._showMessageBox(h.message||h,s.title,Re.error,vt.ok),u(!1)},{fileType:GC.Spread.Sheets.FileType.excel,...i.exportXlsxOptions,excelFileType:fne(c)})})}return Promise.resolve(!1)}static async saveSJS_online(t,i,n){let a=await t._showDialog(G.SaveFileDialogTemplate,{extName:".sjs",fileName:n||""}),r=i.saveOptions;if(a&&r){let o=a.fileName||"export",l=a.extName||"",c=t.getData(re.treeNodeFromJson);c&&(r.customData={designerBindingPathSchema:typeof c=="string"?JSON.parse(c):c}),t.getWorkbook().save(d=>{cs.saveAs(d,o+l),At.hideFileMenu(t)},d=>{t._showMessageBox(d.message,s.title,Re.error,vt.ok)},{...r})}return Promise.resolve(a)}static async saveSJS(t,i){let n=i.saveOptions;if(n){Ld(t.getWorkbook(),new Date);let a=i.saveFileName||"export",r=".sjs",o=t.getData(re.treeNodeFromJson);o&&(n.customData={designerBindingPathSchema:typeof o=="string"?JSON.parse(o):o}),t.getWorkbook().save(l=>{cs.saveAs(l,a+r),At.hideFileMenu(t)},l=>{t._showMessageBox(l.message,s.title,Re.error,vt.ok)},{...n})}}static async exportPdf_online(t,i,n){let a=await t._showDialog(G.SaveFileDialogTemplate,{extName:".pdf",fileName:n||""}),r=i.exportPdfSetting;if(a&&r){Ld(t.getWorkbook(),new Date);let o;r.sheetToExport&&r.sheetToExport.selectedValue!==void 0&&(o=+r.sheetToExport.selectedValue);let l=a.fileName||"export",c=a.extName||"";t.getWorkbook().savePDF(function(d){cs.saveAs(d,l+c),At.hideFileMenu(t)},async function(d){await t._showMessageBox(d.errorMessage,s.title,Re.warning)},r,o)}}static async resetCore(t){t.setData(m.IsInParameterPanelDesignMode,!1),t.setData(re.reportSheetDesignParameterPanelHeight,void 0);let i=t._getGlobalEvent();i&&i.fire(jt.DesignerReset)}static async showUnsavedWarning(t){return new Promise((i,n)=>{t.showMessageBox(s.closingNotification,s.title,Re.warning,i,n,vt.yesNoCancel)})}static ajax(t){if(typeof t.url>"u")try{t.url=location.href}catch{let a;a=document.createElement("a"),a.href="",t.url=a.href}if(typeof t.type>"u"&&(t.type="GET"),typeof t.data>"u")t.data=null;else{let n="";for(let a of Object.keys(t.data))n!==""&&(n+="&"),n+=encodeURIComponent(a)+"="+encodeURIComponent(t.data[a]);t.data=n}typeof t.statusCode>"u"&&(t.statusCode={}),typeof t.beforeSend>"u"&&(t.beforeSend=function(){}),typeof t.success>"u"&&(t.success=function(){}),typeof t.error>"u"&&(t.error=function(){}),typeof t.complete>"u"&&(t.complete=function(){});let i=new XMLHttpRequest;i.onreadystatechange=function(){i.readyState===1&&t.beforeSend(),i.readyState===4&&(t.complete(i,i.status),i.status===200||i.status===0?t.success(i.responseText):(t.error(i.status),typeof t.statusCode[i.status]<"u"&&t.statusCode[i.status]()))},t.type==="POST"?(i.open(t.type,t.url,!0),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),i.send(t.data)):(i.open(t.type,t.url+t.data,!0),i.send(null))}static getFileExtension(t){return t.substring(t.lastIndexOf(".")+1).toLowerCase()}static spreadToJSON(t,i,n){n||(n={});let a=t.getData(re.fileMenuSetting)||{},r=!!a.exportXlsxOptions_includeBindingSource||!!a.saveOptions_includeBindingSource;return n.includeBindingSource=r||!1,i.toJSON(n)}static getExtension(t,i){let n=t.lastIndexOf(".");return i&&(i.pos=n,i.name=t.substr(0,n)),n===-1?"":t.substring(n+1).toLowerCase()}static getVariableName(t){let i={};At.getExtension(t,i);let n=i.name;return/^[_a-zA-Z\$]{1}[_a-zA-Z0-9\$]*$/.test(n)?n:"_"+n.replace(/[ \.]/g,"_")}static getSheetNameItems(t){var o;const i=t.getWorkbook(),n=i.getSheetTabCount(),a=i.sheets.map(l=>l.name());for(let l=0;l<n;l++){let c=i.getSheetTab(l);(o=c.getSheet)!=null&&o.call(c)&&a.push(c.name())}const r=a.map(l=>({text:l,value:i.getSheetPosition(l).toString()}));return r.sort((l,c)=>+l.value-+c.value),r.splice(0,0,{text:s.fileMenu.allSheet,value:void 0}),r}static cloneSpreadBySheetIndex(t,i){if(i<0||i>=t.getSheetCount())return t;let n=t.getSheet(i).toJSON({includeBindingSource:!0}),a=new GC.Spread.Sheets.Workbook(document.createElement("div"),{enableAccessibility:t.options.enableAccessibility});a.suspendPaint(),a.setSheetCount(1),a.getSheet(0).fromJSON(n);let r=t.getNamedStyles();if(r)for(let o=0;o<r.length;o++)a.addNamedStyle(r[o]);return a.resumePaint(),a}static exportExcelRowAndColumnHandler(t,i){let n=i.exportExcelSetting;if(!n)return;let a=t.getData(re.fileMenuSetting),r="exportExcelSetting_exportRowHeaders",o="exportExcelSetting_exportColumnHeaders";n.exportRowAndColumnHeaders?(n.exportColumnHeaders=!0,n.exportRowHeaders=!0,a[r]=!0,a[o]=!0):(n.exportColumnHeaders=!1,n.exportRowHeaders=!1,a[r]=!1,a[o]=!1)}static exportExcelRowOrColumnHandler(t,i){let n=i.exportExcelSetting;if(!n)return;let a=t.getData(re.fileMenuSetting),r="exportExcelSetting_exportRowAndColumnHeaders";n.exportRowHeaders&&n.exportColumnHeaders?(n.exportRowAndColumnHeaders=!0,a[r]=!0):(!n.exportRowHeaders||!n.exportColumnHeaders)&&(n.exportRowAndColumnHeaders=!1,a[r]=!1)}static importExcelRowAndColumnHandler(t,i){let n=i.importExcelSetting;if(!n)return;let a=t.getData(re.fileMenuSetting),r="importExcelSetting_importRowHeaders",o="importExcelSetting_importColumnHeaders";n.importRowAndColumnHeaders?(n.importColumnHeaders=!0,n.importRowHeaders=!0,a[r]=!0,a[o]=!0):(n.importRowHeaders=!1,n.importColumnHeaders=!1,a[r]=!1,a[o]=!1)}static importExcelRowOrColumnHandler(t,i){let n=i.importExcelSetting;if(!n)return;let a=t.getData(re.fileMenuSetting);const r="importExcelSetting_importRowAndColumnHeaders";!n.importColumnHeaders||!n.importRowHeaders?(n.importRowAndColumnHeaders=!1,a[r]=!1):n.importColumnHeaders&&n.importRowHeaders&&(n.importRowAndColumnHeaders=!0,a[r]=!0)}static updateDocProps(t,i){if(mR(i==null?void 0:i.appDocProps),mR(i==null?void 0:i.coreDocProps),Object.keys(i.appDocProps).length===0?delete t.getWorkbook().docProps.appDocProps:t.getWorkbook().docProps.appDocProps=i.appDocProps,Object.keys(i.coreDocProps).length===0)delete t.getWorkbook().docProps.coreDocProps;else{let o=t.getWorkbook().docProps.coreDocProps;i.coreDocProps.created&&o&&(i.coreDocProps.created=o.created),i.coreDocProps.modified&&o&&(i.coreDocProps.modified=o.modified),i.coreDocProps.lastPrinted&&o&&(i.coreDocProps.lastPrinted=o.lastPrinted),t.getWorkbook().docProps.coreDocProps=i.coreDocProps}const n=t.getWorkbook().docProps.customDocPropsManager,a=i.customDocProps,r=n.all();a&&(a.length>0||r&&r.length>0)&&n.all(a),t.getData(re.isFileModified)||t.setData(re.isFileModified,!0)}};At.updateWindowTitle=t=>{};let lc=At,yoe=function(){return{templateName:G.PasswordDialog,title:s.passwordDialog.title,content:[{type:"FlexContainer",className:"gc-password-dialog",children:[{type:"TextBlock",text:s.passwordDialog.passwordLabel},{type:"TextEditor",editorType:"password",bindingPath:"password",margin:"10px 0 10px 0"}]}]}};function bR(e,t){let i=e.getSheetTabCount(),n;for(let a=0;a<i;a++)n=e.getSheetTab(a),C._isReportSheet(n)&&n.togglePaginatedPreviewCache(t)}function voe(e,t){if(!e.getNamedStyle(t))return t;let i=1;for(;e.getNamedStyle(t+i);)i++;return t+i}function xoe(e,t){var a,r;const i=e.sheets;for(let o of i)if(e.getSheetPosition(o.name())===t)return o;const n=e.getSheetTabCount();for(let o=0;o<n;o++)if(e.getSheetPosition(e.getSheetTab(o).name())===t)return(r=(a=e.getSheetTab(o)).getSheet)==null?void 0:r.call(a)}_e(G.PasswordDialog,yoe);var Ci=(e=>(e.checkbox="checkbox",e.hyperlink="hyperlink",e.combox="combox",e.button="button",e.text="text",e.table="table",e))(Ci||{}),Db=(e=>(e[e.insertBefore=0]="insertBefore",e[e.insertAfter=1]="insertAfter",e[e.insertAsChild=2]="insertAsChild",e))(Db||{});const gm=".gc-tree-node";let Ab="gc-tree-node-self",Loe=`.${Ab}`,Pb="gc-tree-node-child-container",Toe=`.${Pb}`;class Jo{constructor(){this.expanded=!0,this.draggable=!0,this.__level=0,this.__id=""}get id(){return this.__id}getData(){let t={iconClass:this.iconClass,name:this.name};for(let i of Object.keys(this)){let n=typeof this[i];(n==="number"||n==="string")&&(t[i]=this[i])}if(this.children){t.children=[];for(let i=0;i<this.children.length;i++)t.children[i]=this.children[i].getData()}return t}get isRoot(){return!this.parent}get isFirst(){return this.parent&&this.parent.children&&this.parent.children.indexOf(this)===0}get isLast(){return this.parent&&this.parent.children&&this.parent.children.indexOf(this)===this.parent.children.length-1}get isLeaf(){return!(this.children&&this.children.length>0)}get previousSibling(){if(this.parent&&this.parent.children){let t=this.parent.children.indexOf(this);if(t>0)return this.parent.children[t-1]}return null}get nextSibling(){if(this.parent&&this.parent.children){let t=this.parent.children.indexOf(this);if(t<this.parent.children.length-1)return this.parent.children[t+1]}return null}get hasBigUncle(){return this.parent&&this.parent.children&&this.parent.parent&&this.parent.parent.children?this.parent.parent.children.indexOf(this.parent)>0:!1}get hasSmallUncle(){return this.parent&&this.parent.children&&this.parent.parent&&this.parent.parent.children?this.parent.parent.children.indexOf(this.parent)<this.parent.parent.children.length-1:!1}get parent(){return this.__parent}get level(){return this.__level}__innerSetParent(t){this.__parent=t}__innerSetLevel(t){this.__level=t}__innerSetId(t){this.__id=t}}class SR{constructor(){}changeRoot(t){this.RootNode=t,this.RootNode.__innerSetParent(void 0),this.RootNode.__innerSetLevel(0),this.updateTreeStructure(this.RootNode)}updateTreeStructure(t){if(t.children)for(let i=0;i<t.children.length;i++)t.children[i].__innerSetParent(t),t.children[i].__innerSetLevel(t.level+1),this.updateTreeStructure(t.children[i])}addNode(t,i){if(!this.RootNode)return;let n=this.findNodeFromId(this.RootNode,t);if(n)return n.children||(n.children=[]),n.children.push(i),i.__innerSetParent(n),i.__innerSetLevel(n.level+1),this.updateTreeStructure(i),n.children.length-1}insertNode(t,i,n){if(!this.RootNode)return;const a=this.findNodeFromId(this.RootNode,t);let r=a==null?void 0:a.parent;if(r){r.children||(r.children=[]);let o=r.children.findIndex(l=>l.id===t)+1;n&&(o-=1),r.children.splice(o,0,i),i.__innerSetParent(r),i.__innerSetLevel(r.level+1),this.updateTreeStructure(i)}}removeNode(t){if(!this.RootNode)return;let i=this.findNodeFromId(this.RootNode,t);if(i&&i.parent){let n=i.parent.children;if(n){for(let a=0;a<n.length;a++)if(n[a].id===t){let r=n.splice(a,1);return i.__innerSetLevel(0),i.__innerSetParent(void 0),r}}}}findNodeFromId(t,i){if(t.id===i)return t;{let n=t.children;if(n)for(let a=0;a<n.length;a++){let r=this.findNodeFromId(n[a],i);if(r)return r}return null}}}class CR extends yt{constructor(){super(...arguments),this._selectedNode=null,this._ignoreContextMenu=!1,this._logicTree=new SR,this._onContainerClick=t=>{let i=t.target;if(i){let n=C.FindSelfOrParent(i,gm);if(!n)return;if(this._options.disableSelect||this.setSelected(n.id,t.ctrlKey||t.metaKey),i.classList.contains("gc-tree-node-expand-button")){let a=n.id;this.toggleExpanded(a)}}},this._onContainerDblClick=t=>{let i=t.target;if(i){let n=C.FindSelfOrParent(i,".gc-tree-node-content"),a=C.FindSelfOrParent(i,gm);a&&n&&this._options.dblclick&&this._options.dblclick(a.id,this)}},this._onContainerMouseDown=t=>{let i=t.target;if(i&&t.button===0){this._ignoreContextMenu=!0;let n=C.FindSelfOrParent(i,gm);n&&this.setSelected(n.id,t.ctrlKey||t.metaKey,t.shiftKey)}},this._onContextmenu=t=>{this._ignoreContextMenu&&(t.preventDefault(),this._ignoreContextMenu=!1)},this._dragStartId="",this._onDragStart=t=>{if(document.ondragover=i=>{i.preventDefault(),this._options.dragover&&this._dragStartId&&this._options.dragover(i)},document.ondrop=i=>{i.preventDefault(),this._options.drop&&this._dragStartId&&this._options.drop(i)},document.ondragend=i=>{var n;i.preventDefault(),this._dragStartId="",this._options.onDragEnd&&((n=i.dataTransfer)==null?void 0:n.dropEffect)==="none"&&this._options.onDragEnd(i)},t.dataTransfer){let i=this.getSelectedNode();i&&(i.id&&(t.dataTransfer.setData(this._getBrowserDataTransferType(),i.id),this._dragStartId=i.id),i.expanded&&!this._options.notExpandWhenDrag&&this.toggleExpanded(i.id),this.options.onDragStart&&this.options.onDragStart(i,t))}},this._onDragOver=t=>{let i=t.relatedTarget||t.toElement,n=C.FindSelfOrParent(i,gm),a=C.FindSelfOrParent(i,".gc-tree-node-self");if(!a)return;let r=a.querySelector(".gc-tree-node-content"),o=this.host.querySelector(".insertCurrent");if(o&&(o.classList.remove("insertCurrent"),o.classList.remove("insertBefore"),o.classList.remove("insertAfter")),!t.dataTransfer||!n||t.offsetX>r.clientWidth||t.offsetX<0)return;let l=this._dragStartId,c=n.id,d=a.clientHeight,u=2;if(t.offsetY<=4?u=0:d-t.offsetY<=4&&(u=1),this.canDragDrop(l,c,u))switch(u){case 2:n.classList.add("insertCurrent");break;case 0:n.classList.add("insertCurrent"),n.classList.add("insertBefore");break;case 1:n.classList.add("insertCurrent"),n.classList.add("insertAfter");break}this._selectedNode=null},this._onDrop=t=>{this._dragStartId="";let i=this.host.querySelector(".insertCurrent");if(!i)return;let n=C.FindSelfOrParent(i,gm);if(!n||!t.dataTransfer)return;let a=n.id,r=t.dataTransfer.getData("text"),o=2;i.classList.contains("insertBefore")?o=0:i.classList.contains("insertAfter")&&(o=1),i&&(i.classList.remove("insertCurrent"),i.classList.remove("insertBefore"),i.classList.remove("insertAfter")),this.onTreeDragDrop(r,a,o)}}getTemplate(){return""}beforeRender(){this._updateOption()}_updateOption(){let t=this._options;t.rootNodeClass&&Ab.indexOf(t.rootNodeClass)===-1&&(Ab+=` ${t.rootNodeClass}`,Loe+=` .${t.rootNodeClass}`),t.childNodeClass&&Pb.indexOf(t.childNodeClass)===-1&&(Pb+=` ${t.childNodeClass}`,Toe+=` .${t.childNodeClass}`)}setOption(t){this._options=t,this._updateOption()}getData(){let t=this._logicTree.RootNode&&this._logicTree.RootNode.getData();return t||(t={}),t}toggleExpanded(t){if(!this._logicTree.RootNode)return;let i=this._logicTree.findNodeFromId(this._logicTree.RootNode,t);if(i){i.expanded=!i.expanded;let n=this.host.querySelector(`[id='${t}']`);if(n){let a=n.querySelector("[role=treeitem]");i.expanded?(n.classList.remove("collapsed"),a.setAttribute("aria-expanded","true")):(n.classList.add("collapsed"),a.setAttribute("aria-expanded","false"))}this.updateExpandedButtonState(i)}}_getBrowserDataTransferType(){return navigator.userAgent.toLowerCase().indexOf("firefox")!==-1?"text/plain":"text"}onTreeDragDrop(t,i,n){this._options.treeDragDrop&&this._options.treeDragDrop(t,i,n)}canDragDrop(t,i,n){if(t===i)return!1;let a=this.getNodeFromId(t),r=this.getNodeFromId(i);return!a||!r||n===0&&r.previousSibling===a||n===2&&a.parent===r||n===1&&r.nextSibling===a?!1:this._options.beforeDragDrop?this._options.beforeDragDrop(t,i,n):!0}realRender(){if(this._options&&this._logicTree.RootNode){let t=this.getSelectedNode(),i="";t&&(i=t.id||""),this.host.innerHTML="";let n=document.createElement("div");this.host.appendChild(n),n.classList.add("gc-tree"),n.setAttribute("role","tree");let a=this.createTreeNode(0,this._logicTree.RootNode,0);n.appendChild(a),n.removeEventListener("click",this._onContainerClick),n.addEventListener("click",this._onContainerClick),n.removeEventListener("dblclick",this._onContainerDblClick),n.addEventListener("dblclick",this._onContainerDblClick),n.removeEventListener("mousedown",this._onContainerMouseDown),n.addEventListener("mousedown",this._onContainerMouseDown),n.removeEventListener("contextmenu",this._onContextmenu),n.addEventListener("contextmenu",this._onContextmenu),n.removeEventListener("dragstart",this._onDragStart),n.addEventListener("dragstart",this._onDragStart),this._options.allowDragDropInTree&&(n.removeEventListener("dragover",this._onDragOver),n.addEventListener("dragover",this._onDragOver),n.removeEventListener("drop",this._onDrop),n.addEventListener("drop",this._onDrop)),i&&this.setSelected(i)}}updateExpandedButtonState(t,i){let n=this._options.expandOpenIconClass?this._options.expandOpenIconClass:"root_open",a=this._options.expandCloseIconClass?this._options.expandCloseIconClass:"root_close",r=this._options.expandOpenIconClass?this._options.expandOpenIconClass:"center_open",o=this._options.expandCloseIconClass?this._options.expandCloseIconClass:"center_close",l=[n,a,"roots_open","roots_close",r,o,"bottom_open","bottom_close","noline_open","noline_close","root_docu","roots_docu","center_docu","bottom_docu","noline_docu"];i||(i=this.host.querySelector(`#${t.id} > .gc-tree-node-self .gc-tree-node-expand-button`));let c=i.className;l.forEach(d=>{c=c.replace(d,"")}),i.className=c,t.isRoot?t.isLeaf?i.classList.add("root_docu"):t.expanded?i.classList.add(n):i.classList.add(a):t.isLeaf?t.isLast?i.classList.add("bottom_docu"):i.classList.add("center_docu"):t.isLast?t.expanded?i.classList.add("bottom_open"):i.classList.add("bottom_close"):t.expanded?i.classList.add(r):i.classList.add(o)}updateExtraSpaceStateRecursion(t){this.updateExtraSpaceState(t),t.children&&t.children.forEach(i=>{this.updateExtraSpaceStateRecursion(i)})}updateExtraSpaceState(t,i){i||(i=this.host.querySelector(`#${t.id} > .gc-tree-node-self .gc-tree-node-expand-button-container`));let n=[],a=t;for(;a;)n.push(a.hasSmallUncle),a=a.parent;n.reverse();let r=t.level;for(let o=0;o<r;o++)n[o+1]?i.children[o].classList.add("connected"):i.children[o].classList.remove("connected")}_createSelf(t,i,n){var u;let a=document.createElement("div");for(let h of Ab.split(" "))a.classList.add(h);this.options.rootNodeVisible===!1&&t===0&&(a.style.display="none");let r=document.createElement("div");r.classList.add("gc-tree-node-expand-button-container");let o;t=this.options.rootNodeVisible===!1?--t:t;for(let h=0;h<=t;h++){let g=document.createElement("div");r.appendChild(g),h===t?(g.classList.add("gc-tree-node-expand-button"),o=g):g.classList.add("gc-tree-node-extra-space-button")}this.updateExtraSpaceState(i,r),a.appendChild(r);let l=document.createElement("div");l.classList.add("gc-tree-node-contentContainer"),a.appendChild(l);let c=document.createElement("div");c.classList.add("gc-tree-node-content"),c.draggable=i.draggable,a.setAttribute("role","treeitem"),a.setAttribute("tabindex","-1"),i.children&&a.setAttribute("aria-expanded",""+i.expanded),a.setAttribute("aria-level",""+(t+1)),a.setAttribute("aria-posinset",""+(n+1)),i.name&&(c.title=(u=i.title)!=null?u:i.name,a.setAttribute("aria-label",i.name)),l.appendChild(c);let d=document.createElement("div");if(i.iconClass?d.className=i.iconClass:d.style.display="none",d.classList.add("gc-tree-node-icon"),c.appendChild(d),i.name){let h=document.createElement("div");h.classList.add("gc-tree-node-text"),h.textContent=i.name,c.appendChild(h)}return this._options&&this._options.buttons&&l.appendChild(this.createButtons(this._options.buttons,i)),o&&this.updateExpandedButtonState(i,o),a}createButtons(t,i){let n=document.createElement("div");n.classList.add("gc-tree-node-button-container");let a=[];return this._options.showButtons&&(a=this._options.showButtons(i)),t.forEach((r,o)=>{if(a[o]){let l=document.createElement("div");if(l.setAttribute("role","button"),l.setAttribute("tabindex","0"),r.title&&(l.title=r.title,l.setAttribute("aria-label",r.title)),r.iconClass&&(l.className=r.iconClass),l.classList.add("gc-tree-node-button"),l.addEventListener("click",c=>{c.stopPropagation(),r.action(i.id,c.target)}),r.attributes)for(let c=0;c<r.attributes.length;c++){let d=r.attributes[c];l.setAttribute(d.key,d.value)}n.appendChild(l)}}),n}_createChildren(t,i){let n=document.createElement("div");for(let a of Pb.split(" "))n.classList.add(a);return i.children&&i.children.forEach((a,r)=>{let o=this.createTreeNode(t+1,a,r);n.appendChild(o)}),n}createTreeNode(t,i,n){let a=document.createElement("div");a.classList.add("gc-tree-node"),i.expanded||a.classList.add("collapsed"),a.id=this.generateId(i),i.__innerSetId(a.id);let r=this._createSelf(t,i,n);a.appendChild(r);let o=this._createChildren(t,i);return a.appendChild(o),a.setAttribute("level",t.toString()),a}generateId(t){let i=woe().toString();return i[0]>"0"&&i[0]<"9"&&(i="_"+i),i}getSelectedNode(){let t=this.host.querySelector(".selected");return t&&t.parentElement&&t.parentElement.id?this.getNodeFromId(t.parentElement.id):this._selectedNode}setSelected(t,i,n){let a=this.host.querySelector(".selected"),r=this.host.querySelector(`#${t}>.gc-tree-node-self`);if(a!==r&&a&&!this._options.disableSelect){a.classList.remove("selected");let o=a;o.setAttribute("aria-selected","false"),o.setAttribute("tabindex","-1")}if(r){r.parentElement&&r.parentElement.id&&(this._selectedNode=this.getNodeFromId(r.parentElement.id)),this._options.onSelected&&this._options.onSelected(this._selectedNode,this,r,i,n),this._options.disableSelect||r.classList.add("selected");let o=r;o.setAttribute("aria-selected","true"),o.setAttribute("tabindex","0")}}getNodeFromId(t){return this._logicTree.RootNode?this._logicTree.findNodeFromId(this._logicTree.RootNode,t):null}addChildNode(t,i){let n=this._logicTree.addNode(t,i)||0,a=this.createTreeNode(i.level,i,n);this.host.querySelector(`#${t} > .gc-tree-node-child-container`).appendChild(a),this.updateExpandedButtonState(i.parent),i.parent&&i.parent.children&&(i.parent.expanded||(this.updateExpandedButtonState(i.parent),this.toggleExpanded(i.parent.id)),i.parent.children.forEach(o=>{this.updateExpandedButtonState(o)})),this._logicTree&&this._logicTree.RootNode&&this.updateExtraSpaceStateRecursion(this._logicTree.RootNode)}insertChildNode(t,i,n){t.children||(t.children=[]),t.children.splice(n,0,i),this._logicTree.RootNode&&this._logicTree.updateTreeStructure(this._logicTree.RootNode);let a=this.createTreeNode(t.level+1,i,n),r=this.host.querySelector(`#${t.id} > .gc-tree-node-child-container`);r.insertBefore(a,r.children[n]),this._logicTree.RootNode&&this.updateExtraSpaceStateRecursion(this._logicTree.RootNode)}removeNode(t){this._logicTree.removeNode(t);let i=this.host.querySelector(`#${t}`);i&&i.parentElement&&(i.parentElement.removeChild(i),this._logicTree.RootNode&&this.updateExtraSpaceStateRecursion(this._logicTree.RootNode))}isVisible(t){let i=t.parent,n=!0;for(;i;){if(!i.expanded){n=!1;break}i=i.parent}return n}editNodeText(t,i){return new Promise((n,a)=>{let r=this.host.querySelector(`[id='${t}'] > .gc-tree-node-self .gc-tree-node-contentContainer`),o=this.host.querySelector(`[id='${t}'] > .gc-tree-node-self`);if(!this._logicTree.RootNode){n();return}let l=this._logicTree.findNodeFromId(this._logicTree.RootNode,t);if(r&&l&&o){let c=document.createElement("input");c.classList.add("gc-tree-node-editor"),r.appendChild(c),o.classList.add("editing"),c.value=l.name||"",c.select();let d=async()=>{o.classList.remove("editing");let u=c.value;if(!i||await i(l,u)){l.name=u;let f=this.host.querySelector(`[id='${t}'] > .gc-tree-node-self .gc-tree-node-text`);f.textContent=u}try{r.removeChild(c)}catch{}let g=this.host.querySelector(`[id='${t}'] > .gc-tree-node-self .gc-tree-node-content`);g.title=u,n()};c.addEventListener("blur",()=>{d()}),c.addEventListener("keyup",u=>{u.keyCode===C.Keys.enter&&d()})}})}setTreeNodeIconClass(t,i){if(!this._logicTree.RootNode)return;let n=this._logicTree.findNodeFromId(this._logicTree.RootNode,t);if(n){let a=n.iconClass;n.iconClass=i;let r=this.host.querySelector(`[id='${t}'] > .gc-tree-node-self .gc-tree-node-icon`);a&&r.classList.remove(a),r.style.display="",r.classList.add(i)}}getRoots(){return this._logicTree.RootNode?[this._logicTree.RootNode]:[]}update(t){if(t&&t[0]){let i=t[0];this._logicTree.changeRoot(i),this.RenderAll()}}getNodeIndex(t){return t&&t.parent&&t.parent.children?t.parent.children.indexOf(t):-1}}let Ib=0;function woe(){let e=Date.now();return e<=Ib?(Ib+=1,e=Ib):Ib=e,e}var Doe=Object.getOwnPropertyDescriptor,Aoe=(e,t,i,n)=>{for(var a=n>1?void 0:n?Doe(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};let yR=class extends yt{constructor(){super(...arguments),this._listEditors=[],this._handlers=[],this._detachEvents=()=>{this._listEditors.forEach((e,t)=>{e.off(lt.ValueChanged,this._handlers[t])})},this._createListComboEditorValueChangeHandler=e=>()=>{this._value[e].listData=this._listEditors[e].value,this.raiseValueChanged()}}getTemplate(){return Poe}updateValue(){this._value||(this._value=[]);for(let e=0;e<this._listEditors.length;e++)this._value[e].listData=this._listEditors[e].value}onValueChanged(e,t){t&&(this.c_Container.innerHTML="",this._detachEvents(),this._listEditors=[],this._handlers=[],t.forEach((i,n)=>{let a=document.createElement("div");a.classList.add("dylist-item-container");let r=document.createElement("div");r.className="label",r.textContent=`${i.label}`,a.appendChild(r);let o=document.createElement("div"),l=new zt(o,{type:"ListComboEditor",valueAsTitle:i.valueAsTitle});l.RenderAll(),l.value=i.listData,this._listEditors.push(l);const c=this._createListComboEditorValueChangeHandler(n);this._handlers.push(c),l.on(lt.ValueChanged,c),o.classList.add("dylist-item"),a.appendChild(o),this.c_Container.appendChild(a)}))}beforeDestroy(){this._detachEvents()}get c_Container(){return this.host.querySelector(".gc-dListComboEditorItems_container")}};yR=Aoe([Ue.Register("ListComboEditorItems")],yR);const Poe=`
|
|
346
346
|
<div class="gc-dListComboEditorItems_container"></div>
|
|
347
|
-
`,zx="(empty)";class vR{constructor(t,i){this._designer=t,this.designerContainer=i,this._bindingIndicator=null,this._tree=null,this._addedFieldCombos=[],this.spread=t.Spread}get Tree(){return this._tree||this._designer.getData(m.FiledListValue).Tree}set Tree(t){this._tree=t}refreshBindingPathIndicator(t){if(!this.spread)return;let i=this.spread.getActiveSheet();if(!i)return;let n=Ae.getCanvas(this.spread),a=Ae.getOffset(n),r=i.getActiveRowIndex(),o=i.getActiveColumnIndex(),l=i.tables.find(r,o),c=!!(t!=null&&t.getData(m.FileMenu_show));if(l&&!c){let d=l.bindingPath();if(d!=null&&d!==""){let u=l.range(),h=Ae.getSpecifiedRect(this.spread,u,a),g=new GC.Spread.Sheets.Range(u.row,u.col+u.colCount-1,1,1),f=Ae.getSpecifiedRect(this.spread,g,a);if(h.length===0&&this.hideDataBindingSettingIndicator(),f.length===0){this.hideDataBindingSettingIndicator();return}let b=f[0],S=0,y=0;if(this.designerContainer&&this.designerContainer.style){let x=C.getOffsetFromBody(this.designerContainer);S=x.offsetLeft,y=x.offsetTop}if(a.left<=b.x&&a.top<=b.y&&b.y+b.height<=a.top+n.offsetHeight&&b.x+b.width<=a.left+n.offsetWidth){this.showDataBidingSettingIndicator(b.x+b.width-16-S,b.y-y,t);return}}}this.hideDataBindingSettingIndicator()}hideDataBindingSettingIndicator(){this._bindingIndicator!==null&&this._clickEventHandler&&(this._bindingIndicator.removeEventListener("click",this._clickEventHandler),this._bindingIndicator.parentElement&&this._bindingIndicator.parentElement===this.designerContainer&&this.designerContainer.removeChild(this._bindingIndicator)),this._bindingIndicator=null,this._clickEventHandler=null}showDataBidingSettingIndicator(t,i,n){if(this._bindingIndicator===null){this._bindingIndicator=document.createElement("div"),this._bindingIndicator.classList.add("gc-data-binding-setting-indicator"),this._bindingIndicator.classList.add("gc-designer-root"),this._bindingIndicator.classList.add(wn);let a=r=>{this.showDataBindingSetting(r.target,n)};this._clickEventHandler=a.bind(this),this._bindingIndicator.addEventListener("click",this._clickEventHandler),this.designerContainer.appendChild(this._bindingIndicator)}this._bindingIndicator.style.left=t+"px",this._bindingIndicator.style.top=i+"px"}async showDataBindingSetting(t,i){var f;let n=(f=this.spread)==null?void 0:f.getActiveSheet();if(!n)return;let a=n.tables.find(n.getActiveRowIndex(),n.getActiveColumnIndex());if(!a)return;let r=a.bindingPath();if(r||(r=null),!this.Tree)return;let o=0,l=xR(this.Tree,r);l&&l.children&&l.dataFieldType===Ci.table&&(o=l.children.length);let c=[];for(let b=0;b<=o;b++){if(l&&l.children){let S=l.children[b];S&&S.name&&c.push({name:S.name,value:S.name})}b===o&&c.push({name:zx,value:""})}let d=a.range(),u=[];if(d){let b=d.colCount;for(let S=0;S<b;S++){let y=a.getColumnDataField(S),v="Column"+S+": ";u.push({name:v,value:y})}}let h=c.map(b=>({text:b.name,value:b.value})),g={bindingPath:r,autoGenerateColumns:a.autoGenerateColumns(),dataFields:u.map(b=>({label:b.name,valueAsTitle:!0,listData:{selectedValue:b.value,items:h}}))};try{let b=await(i==null?void 0:i._showDialog(G.BindingIndicator,g,void 0,{showHeader:!1,positionElement:t,bindingValueChangedCallback:this.bindingValueChangedCallback.bind(this)}));b?this.updateTableBinding(a,b,i):this.resetFieldCombos()}catch{}}resetFieldCombos(){this._addedFieldCombos=[]}bindingValueChangedCallback(t,i,n){var a,r,o;if(t==="addColumn"){let l=(a=this.spread)==null?void 0:a.getActiveSheet();l&&l.tables.find(l.getActiveRowIndex(),l.getActiveColumnIndex())&&this.handleAddColumnBtnClick(n.dataFields.length,(o=(r=n.dataFields[0])==null?void 0:r.listData)==null?void 0:o.items)}return!1}async updateTableBinding(t,i,n){var u,h,g;if(!i||!t)return;let a=(u=this.spread)==null?void 0:u.getActiveSheet();if(!a)return;let r=[],o,l;if(!i.dataFields)return;let c=[];for(o=0;o<i.dataFields.length;o++){l=new GC.Spread.Sheets.Tables.TableColumn(o);let f=i.dataFields[o].listData.selectedValue;c.push(f),l.dataField(f),t.getColumnDataField(o)===f&&(f=t.getColumnName(o)),l.name(f),r.push(l)}t.bind(r);let d=i.autoGenerateColumns;if(d){if(!this.Tree)return;if(await(n==null?void 0:n._showMessageBox(s.ribbon.data.warningTable,s.title,Re.warning,vt.okCancel))===Si.ok){(h=this.spread)==null||h.commandManager().execute({cmd:"tableAutoBind",sheetName:a.name(),tableName:t.name()}),this.refreshBindingPathIndicator(),a.repaint();return}}else{let f=t.endRow()-t.startRow()+1,b=t.endColumn()-t.startColumn()+1,S=Ioe(this._addedFieldCombos);this.resetFieldCombos();let y=c.concat(S),v=y.length;if(v!==b){let x=[];for(o=0;o<v;o++)l=new GC.Spread.Sheets.Tables.TableColumn(o),l.dataField(y[o]),t.getColumnDataField(o)===y[o]?l.name(t.getColumnName(o)):l.name(y[o]),x.push(l);(g=this.spread)==null||g.commandManager().execute({cmd:"bindingTableAddColumn",sheetName:a.name(),tableName:t.name(),isAuto:d,resizeToRange:new GC.Spread.Sheets.Range(t.startRow(),t.startColumn(),f,v),columns:x}),t.endColumn()-t.startColumn()+1===v&&this.refreshBindingPathIndicator()}}a.repaint()}handleAddColumnBtnClick(t,i){this.createDataField(document.querySelector("div.gc-dListComboEditorItems_container"),"Column"+(t+this._addedFieldCombos.length)+": ",i)}createDataField(t,i,n){if(!t)return;let a=document.createElement("div");a.classList.add("dylist-item-container"),t.appendChild(a);let r=document.createElement("div");r.classList.add("label"),r.innerText=i,a.appendChild(r);let o=document.createElement("div");o.classList.add("dylist-item"),a.appendChild(o);let l=new zt(o,{type:"ListComboEditor",items:n});l.value=zx,l.RenderAll(),this._addedFieldCombos.push(l)}}function Ioe(e){let t=[];return!e||e.length===0||e.forEach(i=>{i.value!==null&&i.value!==void 0&&i.value!==zx&&t.push(i.value)}),t}function xR(e,t,i){if(e.name===t&&!i)return e;let n=t.split("."),a=n[0];if(a==="")return e;if(e.children)for(let r of e.children){if(r.name===t&&!i)return r;if(r.name===a)return xR(r,n.slice(1).join("."),!0)}return null}function Moe(){return{templateName:G.BindingIndicator,content:[{type:"FlexContainer",className:"gc-data-binding-setting-content",children:[{type:"ColumnSet",children:[{type:"Column",children:[{className:"cls-bindingpath-label",type:"TextBlock",text:s.ribbon.data.bindingPath+":"}],width:"stretch"},{type:"Column",children:[{id:"binindPath-value",className:"gc-binindPath-value",type:"TextEditor",bindingPath:"bindingPath",enableWhen:"false"}],width:"stretch"}]},{type:"CheckBox",id:"autoGennerateColumns",text:s.ribbon.data.autoGenerateColumns,bindingPath:"autoGenerateColumns"},{type:"LabelContainer",children:[{type:"Container",id:"data-field-container",className:"data-field-container",children:[{type:"ListComboEditorItems",bindingPath:"dataFields",enableWhen:"autoGenerateColumns=false"},{type:"Button",text:s.ribbon.data.addColumn,className:"add-column",bindingPath:"addColumn",enableWhen:"autoGenerateColumns=false"}]}],text:s.ribbon.data.dataField}]}]}}_e(G.BindingIndicator,Moe);const pu=class pu{static GetComponent(t){return pu.CustomComponents[t]}static GetComponentInstance(t,i,n){let a=pu.GetComponent(t);return a?new a(n,i):null}static RegisterComponent(t,i){return pu.CustomComponents[t]?!1:(pu.CustomComponents[t]=i,ht(t,eM(i,void 0,void 0,{renderTextOnRibbon:!0})),!0)}};pu.CustomComponents={};let jx=pu;const LR=C.isNullOrUndefined,koe="TRUE",Wx="UNDEFINED",TR=(e,t)=>{e&&(e.docProps||(e.docProps={}),e.docProps.coreDocProps||(e.docProps.coreDocProps={}),e.docProps.coreDocProps.created||(e.docProps.coreDocProps.created=new Date),t.setData(m.DocPropAccessDate,new Date))};function fm(e,t){try{let i="",n=e.indexOf("("),a=e.indexOf(")");if(n>=0&&n===e.lastIndexOf("(")&&a>0){let r=e.substring(0,n),o=e.substring(n+1,a),l=e.substring(a+1),c=koe;o&&(c=fm(o,t)),e=`${r}${Wx}${l}`,i=fm(e,t).replace(new RegExp(Wx,"g"),c)}else if(e.indexOf("||")>=0){let r=e.split("||");r=r.map(o=>o.trim()).filter(o=>o.length>0),i+="OR(",r.forEach((o,l)=>{i+=fm(o,t)+(l===r.length-1?"":", ")}),i+=")"}else if(e.indexOf("&&")>=0){let r=e.split("&&");r=r.map(o=>o.trim()).filter(o=>o.length>0),i+="AND(",r.forEach((o,l)=>{i+=fm(o,t)+(l===r.length-1?"":", ")}),i+=")"}else{if(e.trim()[0]==="!")return i+="NOT(IFERROR("+e.trim().substr(1)+", FALSE))",i;if(e.indexOf("==")>=1){let r=e.split("==");if(r.length>2)i="=false";else{let o=r[0].trim(),l=r[1].trim();l[0]==="'"&&l[l.length-1]==="'"&&(l=l.substr(1,l.length-2)),l[0]==='"'&&l[l.length-1]==='"'&&(l=l.substr(1,l.length-2)),i=String(o)+"="+String(l)}}else i=t.getData(e),(LR(i)||!LR(i._error))&&(i=Wx)}return i}catch{return""}}class mo extends oe.DesignerActionBase{undoImp(t,i,n){t.suspendPaint();try{return GC.Spread.Sheets.Commands.undoTransaction(t,i),!0}finally{t.resumePaint()}}isSendEvent(t,i,n){return!0}changeSelectionInCommandExecuting(t,i,n){if(n){let a=n.startRow&&n.startRow(),r=n.startColumn&&n.startColumn();t.changeSelectionInCommandExecuting(i,a,r,null,[n])}}}function Roe(e,t){let i="Designer."+t;e.commandManager().register(i,wR,void 0,!1,!1,!1,!1)}function ji(e,t){let i=C.getActiveSheet(e);oe.runCommand(e,"updateChartSeries",wR,{selections:i.getSelections(),sheetName:i.name(),chartName:t.options.chart.name(),series:t.options.element})}class _oe extends mo{executeImp(t,i,n){let r=this.sheet().charts.get(i.chartName);this.changeSelectionInCommandExecuting(t,i,r);let o=r.series(),l=i.series;r&&(l.value?o.set(l.index,l.value):o.set(l.index,l))}}let wR={canUndo:!0,execute:function(e,t,i){return new _oe(e,t).execute(e,t,i)}};function Ooe(e,t){let i="Designer."+t;e.commandManager().register(i,DR,void 0,!1,!1,!1,!1)}function dn(e,t){let i=C.getActiveSheet(e),n=pe.getSelectedChart(i);if(n){let a=n.name();oe.runCommand(e,"changeChartElement",DR,{chartName:a,elementObj:t.options,selections:t.selections,sheetName:t.sheetName})}}class Eoe extends mo{executeImp(t,i,n){let r=this.sheet().charts.get(i.chartName),o=i.elementObj;if(r){this.changeSelectionInCommandExecuting(t,i,r);for(let l in o)o.hasOwnProperty(l)&&r[l](o[l])}}}let DR={canUndo:!0,execute:function(e,t,i){return new Eoe(e,t).execute(e,t,i)}};var yn=(e=>(e[e.PrimaryHorizontal=0]="PrimaryHorizontal",e[e.PrimaryVertical=1]="PrimaryVertical",e[e.SecondaryHorizontal=2]="SecondaryHorizontal",e[e.SecondaryVertical=3]="SecondaryVertical",e))(yn||{});function Mb(e,t){let i=kb(e,t);return i.visible!==null&&i.visible!==void 0?(i.visible=!i.visible,{options:{axes:AR(e,t,i)}}):null}function AR(e,t,i){let n=e.axes();switch(PR(e,t)){case Va.primaryValue:n.primaryValue=i;break;case Va.primaryCategory:n.primaryCategory=i;break;case Va.secondaryCategory:n.secondaryCategory=i;break;case Va.secondaryValue:n.secondaryValue=i;break}return n}function ja(e){let t=e.chartType(),i=!1,n=pe.getChartGroup(t);if(n===Se.BarGroup&&(i=!0),n===Se.FunnelGroup&&(i=!0),n===Se.ComboGroup){let a=e.series().get();for(let r=0;r<a.length;r++){let o=a[r];if(pe.getChartGroup(o.chartType)!==Se.BarGroup){i=!1;break}i=!0}}return i}function kb(e,t){let i=PR(e,t),n=e.axes();switch(i){case Va.primaryValue:return n.primaryValue;case Va.primaryCategory:return n.primaryCategory;case Va.secondaryValue:return n.secondaryValue;case Va.secondaryCategory:return n.secondaryCategory}}function PR(e,t){if(ja(e))switch(t){case 0:return Va.primaryValue;case 1:return Va.primaryCategory;case 2:return Va.secondaryValue;case 3:return Va.secondaryCategory}else switch(t){case 0:return Va.primaryCategory;case 1:return Va.primaryValue;case 2:return Va.secondaryCategory;case 3:return Va.secondaryValue}}function Rb(e,t){let i=e.axes(),n=s.addChartElement.axisTitles.axisTitles;i.primaryCategory&&i.primaryCategory.title&&i.primaryCategory.title.text?n=i.primaryCategory.title.text:i.primaryValue&&i.primaryValue.title&&i.primaryValue.title.text&&(n=i.primaryValue.title.text);let a=kb(e,t);return a.title.text!==""?a.title.text="":a.title.text=n,a.title.fontSize="14",i=AR(e,t,a),{options:{axes:i}}}function Wa(e){let t,i,n=e.getSelectedSeries();return n?(t=n.getDataLabels(),i=n.ChartType):(t=e.dataLabels(),i=e.chartType()),{dataLabels:t,chartType:i}}function _b(e,t,i){for(let n=0;n<e.length;n++)if(C.isEmpty(i)||n===i){let a=e[n];a.errorBars=t}}function Yr(e){let t=e.getData(m.ChartSelectedSeriesIndex);return t>=0?t:void 0}function Pn(e,t,i){let n=e.Spread;const a=GC.Spread.Sheets.Charts.ChartType;let r=pe.getActiveChart(n);if(!r)return;let o=Yr(e),l=r.series().get(o||0);if(l){let c=l.dataLabels||{};C.isNullOrUndefined(i)?r.chartType()===a.treemap||r.chartType()===a.sunburst?(c.showValue=!1,c.showCategoryName=!0):!c.showValue&&!c.showCategoryName&&!c.showPercentage&&!c.showSeriesName&&!c.showDataLabelsRange&&(c.showValue=!0):(c.showValue=i,c.showCategoryName=i,c.showPercentage=i,c.showSeriesName=i,c.showDataLabelsRange=i),C.isNullOrUndefined(t)||(c.position=t),o===void 0?dn(n,{options:{dataLabels:c}}):(l.dataLabels=c,ji(e.Spread,{options:{chart:r,element:{index:o,value:l}}}))}}const IR=C.isNullOrUndefined,Zx="setPivotTableOptions";function Noe(e,t){let i="Designer."+t;e.commandManager().register(i,MR,void 0,!1,!1,!1,!1)}function Boe(e,t,i,n){oe.runCommand(e,"setPivotTableOption",MR,{optionName:i,value:n,pivotTableName:t})}let MR={canUndo:!0,execute:function(e,t,i){return new Foe(e,t).execute(e,t,i)}};class Foe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this,r=a.sheet();if(r.pivotTables){let o=r.pivotTables.get(i.pivotTableName);o instanceof GC.Spread.Pivot.PivotTable&&(o.options[i.optionName]=i.value,Ws(r,o))}}}function kR(e,t){let i="Designer."+t;e.commandManager().register(i,RR,void 0,!1,!1,!1,!1)}function Ob(e,t,i){oe.runCommand(e,Zx,RR,{options:i,pivotTableName:t})}let RR={canUndo:!0,execute:function(e,t,i){return new Goe(e,t).execute(e,t,i)}};class Goe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this,r=a.sheet();if(!r.pivotTables)return;let o=r.pivotTables.get(i.pivotTableName);if(o instanceof GC.Spread.Pivot.PivotTable&&i&&i.options){let l=i.options,c;for(let d of Object.keys(l))if(d==="showGrandForRow"||d==="showGrandForColumn"){c=o.options.grandTotalPosition;let u=IR(l.showGrandForRow)?!!(c&GC.Spread.Pivot.GrandTotalPosition.row):l.showGrandForRow,h=IR(l.showGrandForColumn)?!!(c&GC.Spread.Pivot.GrandTotalPosition.col):l.showGrandForColumn;o.options.grandTotalPosition=u?h?GC.Spread.Pivot.GrandTotalPosition.both:GC.Spread.Pivot.GrandTotalPosition.row:h?GC.Spread.Pivot.GrandTotalPosition.col:GC.Spread.Pivot.GrandTotalPosition.none}else if(d==="name")o.name(l.name);else if(d==="calcItemAggregation")o.options[d]=l[d]?GC.Spread.Pivot.CalcItemAggregation.include:GC.Spread.Pivot.CalcItemAggregation.exclude;else if(d==="missingCaption"){let u=+l[d];isNaN(u)?o.options[d]=l[d]:o.options[d]=u}else o.options[d]!==l[d]&&(o.options[d]=l[d]);Ws(r,o)}}}function Mt(e){let i=e.Spread.getActiveSheet();if(!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex();return i.pivotTables.findPivotTable(n,a)}function Sr(e,t,i){let n=Mt(e);n&&(Boe(e.Spread,n.name(),t,i),e.setData(re.isFileModified,!0))}function sc(e,t){let i=Mt(e);if(i)return i.options[t]}function Voe(e,t){let i="Designer."+t;e.commandManager().register(i,_R,void 0,!1,!1,!1,!1)}function Hoe(e,t,i){oe.runCommand(e,"setPivotTableFieldName",_R,{oldPivotFieldName:t,newPivotFieldName:i})}let _R={canUndo:!0,execute:function(e,t,i){return new zoe(e,t).execute(e,t,i)}},zoe=class extends oe.DesignerActionBase{executeImp(t,i,n){let a=t.getActiveSheet();if(!a.pivotTables)return;let r=a.getActiveRowIndex(),o=a.getActiveColumnIndex();a.pivotTables.findPivotTable(r,o).updateFieldName(i.oldPivotFieldName,i.newPivotFieldName)}};function OR(e){let t=Mt(e);if(t){let n=e.Spread.getActiveSheet(),a=n.getActiveRowIndex(),r=n.getActiveColumnIndex();return joe(a,r,t)}else return null}function joe(e,t,i){let n=i.getPivotInfoImp(e,t);return n?n.menuArea===5?n.valueFieldName:n.menuArea===3?null:n.activeColFieldInfo?n.activeColFieldInfo.name:n.activeRowFieldInfo?n.activeRowFieldInfo.name:n.pageFieldInfo?n.pageFieldInfo.fieldName:n.colHeadFieldInfo?n.colHeadFieldInfo.fieldName:n.cornerFieldInfo?n.cornerFieldInfo.fieldName:n.valueFieldName:null}const Jl=class Jl{};Jl.SheetOptionsChangedInternal="SheetOptionsChangedInternal",Jl.WorksheetDataChanged="WorksheetDataChanged",Jl.ActiveSheetChangedInternal="ActiveSheetChangedInternal",Jl.WorkbookOptionsChangedInternal="WorkbookOptionsChangedInternal",Jl.EnterCellInternal="EnterCellInternal",Jl.SheetBackgroundChangedInternal="SheetBackgroundChangedInternal",Jl.PivotTableAdded="PivotTableAdded",Jl.ReportSheetTemplateRangeChanged="ReportSheetTemplateRangeChanged";let _t=Jl;function Woe(e){return!isNaN(parseFloat(e))&&isFinite(e)}class cc extends oe.DesignerActionBase{getNewTableName(){let t=0;for(let i=0;i<this.spread().sheets.length;i++){let n=this.spread().sheets[i].tables.all();for(let a=0;a<n.length;a++){let r=n[a].name();if(r&&r.length>5&&r.substring(0,5).toLowerCase()==="table"){let o=r.substring(5,r.length);Woe(o)&&Number(o)>=t&&(t=Number(o))}}}return"Table"+(t+1).toString()}clearMergeInRange(t){let i=this.sheet(),n=t.col===-1?0:t.col,a=t.row===-1?0:t.row;for(let r=0;r<t.rowCount;r++)for(let o=0;o<t.colCount;o++)i.removeSpan(a+r,n+o)}}function Zoe(e,t){let i="Designer."+t;e.commandManager().register(i,ER,void 0,!1,!1,!1,!1)}function Uoe(e,t){var a,r;let i=t.sheet,n=i.tables.find(i.getActiveRowIndex(),i.getActiveColumnIndex());return oe.runCommand(e,"createDefaultTableFromDataTable",ER,{range:(a=t.options)!=null&&a.bindingSource?t.options.range:t.options,bindingSource:(r=t.options)==null?void 0:r.bindingSource,activeTable:n,selections:t.selections,sheetName:t.options.sheetName})}function Eb(e){let i=(e.Spread||e).getActiveSheet().getSelections(),n=i[0];return!n||i.length>1||!(n.row>-1&&n.col>-1&&n.rowCount===1&&n.colCount===1)}class Joe extends cc{executeImp(t,i,n){var l;let a=i.range,r=a.row===-1?0:a.row,o=a.col===-1?0:a.col;if(a&&t.getActiveSheet().isIntersectWithArrayFormula(a)){(l=t._designer)==null||l._showMessageBox(s.tableErrDialog.hasArrayFormula,s.title,Re.error);return}if(Eb(t))return!1;this.clearMergeInRange(a),this.sheet().tables.addFromDataSource(this.getNewTableName(),r,o,i.bindingSource,void 0)}}let ER={canUndo:!0,execute:function(e,t,i){return new Joe(e,t).execute(e,t,i)}};var Yoe=Object.defineProperty,qoe=Object.getOwnPropertyDescriptor,ze=(e,t,i,n)=>{for(var a=qoe(t,i),r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(t,i,a)||a);return a&&Yoe(t,i,a),a};const Ux="Design",Jx="PaginatedPreview",dc="Preview",Yx=[];function je(...e){return function(t,i,n){Yx.push({events:e,handler:n.value})}}function an(e,t){Yx.forEach(i=>{i.events.includes(e)&&i.handler(t)})}function Ll(e){Yx.forEach(t=>{t.handler(e)})}const We=(Tn=class{static initActiveSheetState(t){t.setData(m.WorksheetActive,!!t.Spread.getActiveSheet())}static hasIndent(t){let i=C.getActiveSheet(t.Spread),n=i&&i.getCompositeStyle(i.getActiveRowIndex(),i.getActiveColumnIndex()),a=n&&n.textIndent!==void 0&&n.textIndent>0;t.setData(m.HasIndent,a)}static allowInsertTable(t){let i=t.Spread.getActiveSheet();if(i){let n=i.getSelections()[0],a=i.tables.all(),r=!0;for(let o=0;o<a.length;o++){let l=a[o].range();if(n&&(n.containsRange(l)||l.containsRange(n)||n.intersect(l.row,l.col,l.rowCount,l.colCount))){t.setData(m.AllowInsertTable,!1),r=!1;break}}r&&t.setData(m.AllowInsertTable,!0)}else t.setData(m.AllowInsertTable,!1)}static allowInsertPivotTable(t){let i=t.Spread,n=i.getActiveSheet();if(!n){let l=i.getActiveSheetTab();if(C._isTableSheet(l)&&l.getSheet().pivotTables){t.setData(m.AllowInsertPivotTable,!0);return}t.setData(m.AllowInsertPivotTable,!1);return}if(!n.pivotTables)return;let a=n.getSelections()[0],r=n.pivotTables.all(),o=!0;for(let l=0;l<r.length;l++){let{page:c,content:d}=r[l].getRange();if(a){if(c&&(a.containsRange(c)||c.containsRange(a)||a.intersect(c.row,c.col,c.rowCount,c.colCount))){t.setData(m.AllowInsertTable,!1),t.setData(m.AllowInsertPivotTable,!1),o=!1;break}if(a.containsRange(d)||d.containsRange(a)||a.intersect(d.row,d.col,d.rowCount,d.colCount)){t.setData(m.AllowInsertTable,!1),t.setData(m.AllowInsertPivotTable,!1),o=!1;break}}}o&&t.setData(m.AllowInsertPivotTable,!0)}static allowInsertShape(t){t.setData(m.AllowInsertShape,GC.Spread.Sheets.Shapes&&Xoe(t.Spread))}static setCustomTableTheme(t){var i,n;t.setData(re.tableStyleKey,(n=(i=t.Spread)==null?void 0:i.customTableThemes)==null?void 0:n.all())}static allowInsertChart(t){t.setData(m.AllowInsertChart,GC.Spread.Sheets.Charts&&ele(t.Spread))}static allowInsertBarCode(t){t.setData(m.AllowInsertBarCode,GC.Spread.Sheets.Barcode&&Qoe(t.Spread))}static setAccessBarItemsState(t){let i=t.getData(re.osEnv),n=!t.getData(re.needActive)||i._ms[2]()===rs.Trial;t.setData(m.AllowAccessBarOpen,n),t.setData(m.AllowAccessBarSave,n),t.setData(m.AllowAccessBarReset,n)}static setHyperlinkItemsState(t){let i=t.Spread.getActiveSheet();if(i&&!t.getData(m.ShapeSelected)){let{withSingleHyperlink:n,withSingleHyperlinkFormulas:a}=Ae.getHyperlinkSelectionInformation(i),r=Ae.getRangeHasHyperLink(i);t.setData(m.AllowInsertHyperlink,!0),t.setData(m.WithHyperlink,r),t.setData(m.WithSingleHyperlink,n),t.setData(m.WithSingleHyperlinkFormulas,a)}else t.setData(m.AllowInsertHyperlink,!1),t.setData(m.WithHyperlink,!1),t.setData(m.WithSingleHyperlink,!1),t.setData(m.WithSingleHyperlinkFormulas,!1)}static needCheckProtectionOptions(t){return t?t.isActualProtected()&&!!t.options.protectionOptions:!1}static needShowInsertCellCopyCut(t,i){let n=t.getSelections();if(n.length!==1||!i.showInsertCopyPasteCells)return!1;let a=t.getActiveRowIndex(),r=t.getActiveColumnIndex(),o=n[0];return!(o.row!==-1&&o.col!==-1&&o.rowCount!==t.getRowCount()&&o.colCount!==t.getColumnCount()&&t.tables&&t.tables.find(a,r)||t.pivotTables&&t.pivotTables.findPivotTable(a,r)||t.getSpan(a,r))}static setInsertCopiedCutCellsState(t){let i=C.getActiveSheet(t.Spread);if(i){let n=i.getClipboardHelperObj(),{isCutting:a,ranges:r}=n,o=r&&r.length===1;if(!Tn.needShowInsertCellCopyCut(i,n)||!o){t.setData(m.AllowInsertCopiedCutCells,!1);return}t.setData(m.AllowInsertCopiedCutCells,!0),t.setData(m.ClipboardCutting,a);let l=r[0];t.setData(m.WholeRowSelection,l.rowCount===i.getRowCount()),t.setData(m.WholeColumnSelection,l.colCount===i.getColumnCount())}}static selectFullColumn(t){let i=C.getActiveSheet(t.Spread);t.setData(m.IsSelectFullColumns,Ae.isFullCol(i))}static selectFullRow(t){let i=C.getActiveSheet(t.Spread);t.setData(m.IsSelectFullRows,Ae.isFullRow(i)),i&&t.setData(re.isMultiSelection,i.getSelections().length>1)}static sheetFreezed(t){let i=C.getActiveSheet(t.Spread);if(!i){t.setData(m.Freezed,!1);return}let n=i.frozenRowCount(),a=i.frozenColumnCount();t.setData(m.Freezed,n>0&&a>0)}static allowFilter(t){let i=C.getActiveSheet(t.Spread);if(i){let n=!0;Tn.needCheckProtectionOptions(i)&&(i.options.protectionOptions.allowFilter||(n=!1)),t.setData(m.AllowFilter,n)}else t.setData(m.AllowFilter,!1)}static allowRichText(t){let i=t.Spread.getActiveSheet(),n=!0;if(i){const a=i.getActiveRowIndex(),r=i.getActiveColumnIndex();i.getFormula(a,r)?n=!1:n=!i.getCell(a,r).locked()||!i.isActualProtected()}t.setData(m.AllowRichText,n)}static hasSlicerSelected(t){t.setData(m.HasSlicerSelected,$oe(t.Spread))}static hasHiddenSheet(t){let i=t.Spread,n=i.sheets.some(a=>a.visible()===GC.Spread.Sheets.SheetTabVisible.hidden);if(!n){for(let a=0,r=i.getSheetTabCount();a<r;a++)if(i.getSheetTab(a).visible()===GC.Spread.Sheets.SheetTabVisible.hidden){n=!0;break}}t.setData(m.HasHiddenSheet,n)}static allowResizeRows(t){let i=C.getActiveSheet(t.Spread),n=!0;i&&Tn.needCheckProtectionOptions(i)&&(i.options.protectionOptions.allowResizeRows||(n=!1)),t.setData(m.AllowResizeRows,n)}static AllowInsertCell(t){let i=C.getActiveSheet(t.Spread),n=!1;i&&(i.isActualProtected()||(n=!0),i.options.protectionOptions.allowInsertColumns&&Ae.isFullCol(i)&&(n=!0),i.options.protectionOptions.allowInsertRows&&Ae.isFullRow(i)&&(n=!0)),t.setData(m.AllowInsertCell,n)}static allowDeleteCell(t){let i=C.getActiveSheet(t.Spread),n=!1;i&&(i.isActualProtected()||(n=!0),i.options.protectionOptions.allowDeleteColumns&&Ae.isFullCol(i)&&(n=!0),i.options.protectionOptions.allowDeleteRows&&Ae.isFullRow(i)&&(n=!0)),t.setData(m.AllowDeleteCell,n)}static isIncludeLockedCell(t){let i=C.getActiveSheet(t.Spread),n=!1;if(i&&i.isActualProtected()){let a=i.getSelections();for(let r of a){let o=r.row,l=r.rowCount,c=r.col,d=r.colCount;for(let u=0;u<l;u++)for(let h=0;h<d;h++)if(i.getCell(o+u,c+h).locked()){n=!0,t.setData(m.IsIncludeLockedCell,n);return}}}t.setData(m.IsIncludeLockedCell,n)}static allowInsertRows(t){let i=C.getActiveSheet(t.Spread),n=!0,a=!0;if(i){Ae.isFullCol(i)&&(n=!1);let r=i.options.protectionOptions;Tn.needCheckProtectionOptions(i)&&(r.allowInsertRows||(n=!1,a=!1),Ae.isFullCol(i)&&(n=!1),Ae.isFullRow(i)||(a=!1))}t.setData(m.AllowInsertRows,n),t.setData(m.AllowInsertRowsContextMenu,a)}static allowDeleteRows(t){let i=C.getActiveSheet(t.Spread),n=!0;if(i){Ae.isFullCol(i)&&(n=!1);let a=i.tables,r=i.options.protectionOptions;Tn.needCheckProtectionOptions(i)&&(r.allowDeleteRows||(n=!1),Ae.isFullRow(i)||(n=!1)),a!=null&&a.containTableHeaderTotalRowForSheet()&&(n=!1)}t.setData(m.AllowDeleteRows,n)}static allowInsertColumns(t){let i=C.getActiveSheet(t.Spread),n=!0,a=!0;if(i){Ae.isFullRow(i)&&(n=!1);let r=i.options.protectionOptions;Tn.needCheckProtectionOptions(i)&&(r.allowInsertColumns||(n=!1,a=!1),Ae.isFullRow(i)&&(n=!1),Ae.isFullCol(i)||(a=!1))}t.setData(m.AllowInsertColumns,n),t.setData(m.AllowInsertColumnsContextMenu,a)}static allowDeleteColumns(t){let i=C.getActiveSheet(t.Spread),n=!0;if(i){Ae.isFullRow(i)&&(n=!1);let a=i.options.protectionOptions;Tn.needCheckProtectionOptions(i)&&(a.allowDeleteColumns||(n=!1),Ae.isFullCol(i)||(n=!1))}t.setData(m.AllowDeleteColumns,n)}static allowFormatCells(t){let i=C.getActiveSheet(t.Spread),n=!0;i&&Tn.needCheckProtectionOptions(i)&&(i.options.protectionOptions.formatCells||(n=!1)),t.getData(m.IsInTableSheetDesignMode)&&(n=!0),t.setData(m.AllowFormatCells,n)}static allowFormatRows(t){let i=C.getActiveSheet(t.Spread),n=!0;i&&Tn.needCheckProtectionOptions(i)&&(i.options.protectionOptions.formatRows||(n=!1)),t.setData(m.AllowFormatRows,n)}static allowFormatColumns(t){let i=C.getActiveSheet(t.Spread),n=!0;i&&Tn.needCheckProtectionOptions(i)&&(i.options.protectionOptions.formatColumns||(n=!1)),t.setData(m.AllowFormatColumns,n)}static allowOutlineRows(t){let i=t.Spread.getActiveSheet(),n=!1;i&&Tn.needCheckProtectionOptions(i)&&i.options.protectionOptions.allowOutlineRows&&(n=!0),t.setData(m.AllowOutlineRows,n)}static allowOutlineColumns(t){let i=t.Spread.getActiveSheet(),n=!1;i&&Tn.needCheckProtectionOptions(i)&&i.options.protectionOptions.allowOutlineColumns&&(n=!0),t.setData(m.allowOutlineColumns,n)}static chartAllSeriesList(t){let i=[];if(C.getActiveSheet(t.Spread)){let a=pe.getActiveChart(t.Spread);a&&(i=pe.getSeriesList(t.Spread,a))}t.setData(m.ChartAllSeriesList,i)}static haveChartLegend(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].seriesType===te.Legend){t.setData(m.ChartLegend,!0);return}else t.setData(m.ChartLegend,!1)}static haveCharTitle(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].seriesType===te.ChartTitle){t.setData(m.ChartTitle,!0);return}else t.setData(m.ChartTitle,!1)}static haveCharErroeBar(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].seriesType===te.ErrorBar){t.setData(m.ErrorBar,!0);return}else t.setData(m.ErrorBar,!1)}static haveCharTrendline(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].seriesType===te.Trendline){t.setData(m.Trendline,!0);return}else t.setData(m.Trendline,!1)}static haveCharDataLabels(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].seriesType===te.DataLabels){t.setData(m.DataLabels,!0);return}else t.setData(m.DataLabels,!1)}static haveCharPrimaryValue(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].seriesType===te.PrimaryValue){t.setData(m.PrimaryValue,!0);return}else t.setData(m.PrimaryValue,!1)}static haveCharPrimaryCategory(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].seriesType===te.PrimaryCategory){t.setData(m.PrimaryCategory,!0);return}else t.setData(m.PrimaryCategory,!1)}static haveCharAxisTypeTitle(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].axisType===Oe.Title){t.setData(m.AxisTypeTitle,!0);return}else t.setData(m.AxisTypeTitle,!1)}static haveCharAxisTypeMajorGridLineMinorGridLine(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++){const a=i[n];if(a.axisType===Oe.MajorGridLine||a.axisType===Oe.MinorGridLine){t.setData(m.AxisTypeMajorGridLineMinorGridLine,!0);return}else t.setData(m.AxisTypeMajorGridLineMinorGridLine,!1)}}static haveCharAxisTypeNone(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].axisType===Oe.None){t.setData(m.AxisTypeNone,!0);return}else t.setData(m.AxisTypeNone,!1)}static haveCharAxesAxesPrimaryVertical(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.PrimaryVertical)){let o=i.filter(l=>l.seriesType===te.PrimaryValue&&l.axisType===Oe.None);t.setData(m.AxesPrimaryVertical,!!o.length)}else t.setData(m.AxesPrimaryVertical,!1)}}static haveCharAxesPrimaryHorizontal(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.PrimaryHorizontal)){let o=i.filter(l=>l.seriesType===te.PrimaryValue&&l.axisType===Oe.None);t.setData(m.AxesPrimaryHorizontal,!!o.length)}else t.setData(m.AxesPrimaryHorizontal,!1)}}static haveCharAxesAxesSecondaryHorizontal(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.SecondaryHorizontal)){let o=i.filter(l=>l.seriesType===te.SecondaryCategory&&l.axisType===Oe.None);t.setData(m.AxesSecondaryHorizontal,!!o.length)}else t.setData(m.AxesSecondaryHorizontal,!1)}}static haveCharAxesAxesSecondaryVertical(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.SecondaryVertical)){let o=i.filter(l=>l.seriesType===te.SecondaryValue&&l.axisType===Oe.None);t.setData(m.AxesSecondaryVertical,!!o.length)}else t.setData(m.AxesSecondaryVertical,!1)}}static haveCharAxisTitlesPrimaryHorizontal(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.PrimaryHorizontal)){let o=i.filter(l=>l.seriesType===te.PrimaryCategory&&l.axisType===Oe.Title);t.setData(m.AxisTitlesPrimaryHorizontal,!!o.length)}else t.setData(m.AxisTitlesPrimaryHorizontal,!1)}}static haveCharAxisTitlesPrimaryVertical(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.PrimaryVertical)){let o=i.filter(l=>l.seriesType===te.PrimaryValue&&l.axisType===Oe.Title);t.setData(m.AxisTitlesPrimaryVertical,!!o.length)}else t.setData(m.AxisTitlesPrimaryVertical,!1)}}static haveCharAxisTitlesSecondaryHorizontal(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.SecondaryHorizontal)){let o=i.filter(l=>l.seriesType===te.SecondaryCategory&&l.axisType===Oe.Title);t.setData(m.AxisTitlesSecondaryHorizontal,!!o.length)}else t.setData(m.AxisTitlesSecondaryHorizontal,!1)}}static haveCharAxisTitlesSecondaryVertical(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.SecondaryVertical)){let o=i.filter(l=>l.seriesType===te.SecondaryValue&&l.axisType===Oe.Title);t.setData(m.AxisTitlesSecondaryVertical,!!o.length)}else t.setData(m.AxisTitlesSecondaryVertical,!1)}}static haveCharGridlinesPrimaryMajorHorizontal(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(a.axes().primaryCategory){let o=i.filter(l=>l.seriesType===te.PrimaryCategory&&l.axisType===Oe.MajorGridLine);t.setData(m.GridLinesPrimaryMajorHorizontal,!!o.length),o=i.filter(l=>l.seriesType===te.PrimaryCategory&&l.axisType===Oe.MinorGridLine),t.setData(m.GridLinesPrimaryMinorHorizontal,!!o.length)}else t.setData(m.GridLinesPrimaryMajorHorizontal,!1),t.setData(m.GridLinesPrimaryMinorHorizontal,!1)}}static haveCharGridlinesPrimaryMinorVertical(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(a.axes().primaryValue){let o=i.filter(l=>l.seriesType===te.PrimaryValue&&l.axisType===Oe.MajorGridLine);t.setData(m.GridLinesPrimaryMajorVertical,!!o.length),o=i.filter(l=>l.seriesType===te.PrimaryValue&&l.axisType===Oe.MinorGridLine),t.setData(m.GridLinesPrimaryMinorVertical,!!o.length)}else t.setData(m.GridLinesPrimaryMajorVertical,!1),t.setData(m.GridLinesPrimaryMajorVertical,!1)}}static haveCharGridlinesSecondaryMinorHorizontal(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(a.axes().secondaryCategory){let o=i.filter(l=>l.seriesType===te.SecondaryCategory&&l.axisType===Oe.MajorGridLine);t.setData(m.GridLinesSecondaryMajorHorizontal,!!o.length),o=i.filter(l=>l.seriesType===te.SecondaryCategory&&l.axisType===Oe.MinorGridLine),t.setData(m.GridLinesSecondaryMinorHorizontal,!!o.length)}else t.setData(m.GridLinesSecondaryMajorHorizontal,!1),t.setData(m.GridLinesSecondaryMinorHorizontal,!1)}}static haveCharGridlinesSecondaryMinorVertical(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(a.axes().secondaryValue){let o=i.filter(l=>l.seriesType===te.SecondaryValue&&l.axisType===Oe.MajorGridLine);t.setData(m.GridLinesSecondaryMajorVertical,!!o.length),o=i.filter(l=>l.seriesType===te.SecondaryValue&&l.axisType===Oe.MinorGridLine),t.setData(m.GridLinesSecondaryMinorVertical,!!o.length)}else t.setData(m.GridLinesSecondaryMajorVertical,!1),t.setData(m.GridLinesSecondaryMinorVertical,!1)}}static haveCharDataLabelsShow(t){let i=t.Spread,n=pe.getActiveChart(i);if(n){let a,r=n.getSelectedSeries();r?a=r.ChartType:a=n.chartType();let o=pe.getChartGroup(a),l=rle(),c={};l.forEach(d=>{let{type:u,items:h}=d,g=u===o;h.forEach(f=>{c[f]||(g&&(c[f]=!0),t.setData(f,g))})})}}static allowResizeColumns(t){let i=C.getActiveSheet(t.Spread),n=!0;i&&Tn.needCheckProtectionOptions(i)&&(i.options.protectionOptions.allowResizeColumns||(n=!1)),t.setData(m.AllowResizeColumns,n)}static needActive(t){let i=t.getData(re.osEnv);i&&t.setData(re.needActive,i.needActive())}static chartGroup(t){if(!GC.Spread.Sheets.Charts)t.setData(m.ChartGroup,Se.None);else{let i=pe.getChartGroup(pe.chartType(t.Spread));t.setData(m.ChartGroup,i)}}static hasCellTypes(t){let i=C.getActiveSheet(t.Spread);if(i){let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.getStyle(n,a),o=r&&r.cellType&&r.cellType.typeName!=="1"&&r.cellType.typeName!=="18";t.setData(m.HasCellTypes,o);let l=[GC.Spread.Sheets.CellTypes.Button,GC.Spread.Sheets.CellTypes.ButtonList,GC.Spread.Sheets.CellTypes.CheckBox,GC.Spread.Sheets.CellTypes.CheckBoxList,GC.Spread.Sheets.CellTypes.ComboBox,GC.Spread.Sheets.CellTypes.DataObject,GC.Spread.Sheets.CellTypes.RadioButtonList,GC.Spread.Sheets.CellTypes.RangeTemplate,GC.Spread.Sheets.CellTypes.FileUpload];if(o){for(let c=0;c<l.length;c++){let d=l[c];if(r.cellType instanceof d){t.setData(m.HasEditableCellTypes,!1);return}}t.setData(m.HasEditableCellTypes,!0)}else t.setData(m.HasEditableCellTypes,!1)}}static hasCellButtons(t){let i=C.getActiveSheet(t.Spread);if(i){let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.getStyle(n,a),o=r&&r.cellType&&r.cellType.typeName==="18",l=r&&r.cellButtons&&r.cellButtons.length>0;t.setData(m.HasCellButtons,!o&&l)}}static isProtected(t){let i=C.getActiveSheet(t.Spread),n=t.getData(m.IsInTableSheetDesignMode);t.setData(m.IsProtected,!n&&i&&i.options.isProtected)}static isActualProtected(t){let i=C.getActiveSheet(t.Spread),n=t.getData(m.IsInTableSheetDesignMode);t.setData(m.IsActualProtected,!n&&i&&i.isActualProtected())}static enableAccessibility(t){t.setData(m.EnableAccessibility,t.Spread.options.enableAccessibility)}static cellLocked(t){let i=C.getActiveSheet(t.Spread),n=!1;if(i){let a=i.getActiveRowIndex(),r=i.getActiveColumnIndex();Ae.isFullCol(i)?n=i.getCell(-1,r).locked():Ae.isFullRow(i)?n=i.getCell(a,-1).locked():n=i.getCell(a,r).locked()}t.setData(m.CellLocked,n)}static _isAcrossTables(t){try{if(t)return t.isAcrossTables&&t.isAcrossTables()}catch{}return!1}static tableInsertRowAbove(t){let i=t.Spread.getActiveSheet(),n=i&&i.tables,a=!0;n&&(n.isAcrossTables&&n.isAcrossTables()||n.containTableHeader()||n.noRoomToInsertRow())&&(a=!1),t.setData(m.TableInsertRowAbove,a)}static tableInsertRowBelow(t){let i=t.Spread.getActiveSheet(),n=i&&i.tables,a=!0;n&&(n.isAcrossTables&&n.isAcrossTables()||n.noRoomToInsertRow())&&(a=!1),t.setData(m.TableInsertRowBelow,a)}static tableInsertColumnLeftRight(t){let i=t.Spread.getActiveSheet(),n=i&&i.tables,a=!0;n&&(n.isAcrossTables&&n.isAcrossTables()||n.noRoomToInsertColumn())&&(a=!1),t.setData(m.TableInsertColumnLeft,a),t.setData(m.TableInsertColumnRight,a)}static checkTableLastCol(t){let i=!1,n=t.Spread.getActiveSheet();if(n){let a=n.getSelections(),r=bm(n,a[0]),o=n.getActiveColumnIndex();r&&(i=!r.checkTableLastCol(o))}t.setData(m.IsLastTableCol,i)}static checkTableLastRow(t){let i=!1,n=t.Spread.getActiveSheet();if(n){let a=n.getSelections(),r=bm(n,a[0]),o=n.getActiveRowIndex();r&&(i=!r.checkTableLastRow(o))}t.setData(m.IsLastTableRow,i)}static hasComments(t){let i=t.Spread.getActiveSheet();if(i){let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.comments.get(n,a);t.setData(m.HasComments,!!r)}else t.setData(m.HasComments,!1)}static hasThreadedComments(t){var o,l;let i=t.Spread.getActiveSheet(),n=!1,a=!1,r=!1;if(i){let c=i.getActiveRowIndex(),d=i.getActiveColumnIndex();try{let u=(o=i.threadedComments)==null?void 0:o.get(c,d);if(n=!!u,n)a=!0,r=u?u.resolved():!1;else if(((l=i.threadedComments)==null?void 0:l.size())>0){const h=i.getSelections();a=i.threadedComments.hasComments(h)}}catch{n=!1,r=!1}}t.setData(m.HasThreadedComments,a),t.setData(m.ActiveCellHasThreadedComment,n),t.setData(m.ActiveCellHasResolvedThreadedComment,r)}static allSheetsHaveThreadedComments(t){const n=t.Spread.sheets.some(a=>{var r;return((r=a.threadedComments)==null?void 0:r.size())>0});t.setData(m.AllSheetsHaveThreadedComments,n)}static selectedOrEditComments(t){let i=t.Spread.getActiveSheet();if(t.setData(m.SelectedOrEditComments,!1),i){let n=i.comments.all();for(let a=0;a<n.length;a++)if(n[a].commentState()!==GC.Spread.Sheets.Comments.CommentState.normal){t.setData(m.SelectedOrEditComments,!0);return}}}static clickTable(t){let n=t.Spread.getActiveSheet();if(n){let a=n.getActiveRowIndex(),r=n.getActiveColumnIndex(),o=!!n.tables.find(a,r);t.setData(m.TableClicked,!!o),t.setData(m.TableAllowResize,!!n.tables.allowResize(n.tables.find(a,r)))}}static toggleBetweenConvertTableAndDataTable(t){let i=t.Spread,n=i==null?void 0:i.getActiveSheet(),a=!1;if(n){let r=n.getActiveRowIndex(),o=n.getActiveColumnIndex(),l=n.tables.find(r,o);if(l){let c=l.getBindingSource(),d;typeof c=="string"?d=c:c&&c.name&&(d=c.name),a=!!i.dataManager().tables[d]}}t.setData(m.TableBindingDataTable,a)}static allowAddTableFromDataTable(t){let i=t.Spread,n=i==null?void 0:i.getActiveSheet(),a=i==null?void 0:i.dataManager().tables,r=n&&!Eb(t)&&a&&Object.keys(a).length>0;t.setData(m.TableAllowAddFromDataTable,r)}static tableSelected(t){let i=C.getActiveSheet(t.Spread);if(!i){t.setData(m.TableSelected,!1);return}let n=vi.getSelectedSlicers(i)[0],a=n&&n.isSelected(),r=pe.getSelectedChart(i),o;r&&r.isSelected()?o=r:o=void 0;let l=ut.getSelectedShapes(i)[0],c;l&&l.isSelected()?c=l:c=void 0;let d=a||o!=null||c!=null,h=i.tables.find(i.getActiveRowIndex(),i.getActiveColumnIndex())||void 0,g=!d&&h!==null&&h!==void 0;g!==t.getData(m.TableSelected)&&(t.setData(m.TableSelected,g),g&&t.activeRibbonTab("tableDesign"))}static pivotTableSelected(t){if(t._disposed)return;let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables){t.setData(m.PivotTableSelected,!1);return}let n=vi.getSelectedSlicers(i)[0],a=n&&n.isSelected(),r=pe.getSelectedChart(i),o;r&&r.isSelected()?o=r:o=void 0;let l=ut.getSelectedShapes(i)[0],c;l&&l.isSelected()?c=l:c=void 0;let d=a||o!=null||c!=null,h=i.pivotTables.findPivotTable(i.getActiveRowIndex(),i.getActiveColumnIndex())||void 0,g=!d&&h!==null&&h!==void 0;t.setData(m.PivotTableSelected,g)}static pivotSlicerSelected(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=vi.getSelectedSlicers(i,!0),a=vi.getSelectedPivotSlicers(i),r=vi.getSelectedPivotTimelines(i);t.setData(m.TimelineSelected,r.length>0),t.setData(m.OnlyOnePivotSlicerSelected,n.length===a.length&&a.length+r.length===1)}static pivotProtection(t){let i=C.getActiveSheet(t.Spread);!i||!i.pivotTables||(t.setData(m.ProtectedPivotTable,!1),t.setData(m.ProtectedPivotTableStyle,!1),i.options.isProtected&&(i.options.protectionOptions.allowUsePivotTable?i.options.protectionOptions.formatCells||t.setData(m.ProtectedPivotTableStyle,!0):(t.setData(m.ProtectedPivotTable,!0),t.setData(m.ProtectedPivotTableStyle,!0))))}static filterSelected(t){let i=C.getActiveSheet(t.Spread),n=i&&i.rowFilter&&i.rowFilter();if(t.setData(m.FilterSelected,!1),C.isNullOrUndefined(n))return!1;let a=n.range,r=i.getSelections();for(let o=0;o<r.length;o++){let l=r[o];if(a!=null&&a.intersect(l.row,l.col,l.rowCount,l.colCount)){t.setData(m.FilterSelected,!0);return}}}static chartSelected(t){let i=C.getActiveSheet(t.Spread);if(!i){t.setData(m.ChartSelected,!1),t.setData(m.CanFormatChart,!1);return}let n=i.options,a=pe.getSelectedChart(i),r;a&&a.isSelected()?r=a:r=void 0;let o=r!==void 0&&(n.protectionOptions.allowEditObjects||!(i.isActualProtected()&&r.isLocked()));t.setData(m.ChartSelected,o),o||t.setData(m.ChartAltTextPanelVisible,!1),t.setData(m.CanFormatChart,pe.canFormatChart(i))}static shapeSelected(t){var g;let i=C.getActiveSheet(t.Spread);if(!i){t.setData(m.ShapeSelected,!1),t.setData(m.SelectedShapesAllowShowRibbon,!1),t.setData(m.PictureShapeSelected,!1);return}let n=(g=i.dataCharts)==null?void 0:g.all().some(f=>f.isSelected()),a=!1;if(GC.Spread.Report&&i instanceof GC.Spread.Report.TemplateSheet){let f=i.getTemplateCell(i.getActiveRowIndex(),i.getActiveColumnIndex());a=f&&f.type==="Chart"&&!!f.dataChartName}t.setData(m.DataChartSelected,n),t.setData(m.CellBindingDataChartSelected,a),t.setData(m.DataChartSelectedForReportCellPanelVisible,!n||a);let r=ut.getSelectedShapes(i),o=r[0],l;o&&o.isSelected()?l=o:l=void 0;let c=l!==void 0&&(i.options.protectionOptions.allowEditObjects||!(i.isActualProtected()&&l.isLocked()));t.setData(m.ShapeSelected,c);const d=f=>{!f&&!t._disposed&&(t.setData(m.ShowShapePropertyPanel,!1),t.setData(m.ShapeAltTextPanelVisible,!1))};Tn._setShapePanelStateHandler&&window.clearTimeout(Tn._setShapePanelStateHandler),Tn._setShapePanelStateHandler=window.setTimeout(()=>{d(c)});let[u,h]=ut.getShapeHyperlinkInfo(i);t.setData(m.WithShapeHyperlink,h),t.setData(m.OnlyOneShapeSelected,u),t.setData(m.OnlyOneShapeTypeShapeSelected,u&&l instanceof GC.Spread.Sheets.Shapes.Shape),t.setData(m.PictureShapeSelected,ole(r)),t.setData(m.CanChangeShapeType,lle(r)),t.setData(m.SelectedShapesAllowShowRibbon,sle(r)),t.setData(m.CanEditTextShape,u&&ut.isSupportEditTextShape(l)),t.setData(m.CanRotateShape,dle(r)),t.setData(m.SupportHyperLinkShape,cle(r)),t.setData(m.HaveMultipleShapes,i.shapes.all().length>1),t.setData(m.CanFormatChart,pe.canFormatChart(i))}static floatingObjectSelected(t){let i=C.getActiveSheet(t.Spread);if(!i){t.setData(m.FloatingObjectSelected,!1);return}let n=i.floatingObjects.all().filter(a=>a.isSelected());t.setData(m.FloatingObjectSelected,n.length>0)}static pictureSelected(t){let i=C.getActiveSheet(t.Spread);if(t.setData(m.AllowEditObject,!0),!i){t.setData(m.AllowEditObject,!1);return}i.pictures.all().filter(a=>a.isSelected()).length>0?(t.setData(m.hideContextMenu,!0),t.setData(m.pictureSelected,!0)):(t.setData(m.PictureAltTextPanelVisible,!1),t.setData(m.hideContextMenu,!1),t.setData(m.pictureSelected,!1))}static allowEditObject(t){let i=C.getActiveSheet(t.Spread);if(!i)return;let n=i.isActualProtected(),a=i.options.protectionOptions,r=!0;n&&a&&(a.allowEditObjects||(r=!1)),t.setData(m.AllowEditObject,r)}static allowUndoListDropdown(t){const i=t.Spread.undoManager();t.setData(m.AllowAccessBarRedo,i&&i.canRedo()),t.setData(m.AllowAccessBarUndo,i&&i.canUndo());let n=i&&i.getUndoStack()||[],a=i&&i.getRedoStack()||[];t.setData(m.allowShowUndoList,n.length!==0),t.setData(m.allowShowRedoList,a.length!==0)}static slicerSelected(t){var l;let i=C.getActiveSheet(t.Spread);if(!i)return;let n=t.getData(re.selectedSlicer);n&&!((l=i.slicers)!=null&&l.get(n.name()))&&(n=null);let a=n&&(i.options.protectionOptions.allowEditObjects||!i.isActualProtected())||!1;t.setData(m.SlicerSelected,a);let r=!i.isActualProtected()||i.isActualProtected()&&i.options.protectionOptions.allowEditObjects,o=ut.getSelectedShapes(i);t.setData(m.CanFormatSlicer,r&&o.length>0&&o.every(c=>vi.isItemSlicerShape(c)))}static formulaSparklineSelected(t){let i=t.Spread,n=C.getActiveSheet(i);if(!n)return;let a=vi.getSelectedSlicers(n)[0],r=pe.getSelectedChart(n),o=ut.getSelectedShapes(n)[0],l=a||r||o,c=n.getActiveRowIndex(),d=n.getActiveColumnIndex(),u=n.getSelections(),h=!1;if(u&&u.length>=1){let g=!1,f=Ae.parseFormulaSparkline(i,c,d);f&&["BC_QRCODE","BC_EAN13","BC_EAN8","BC_CODABAR","BC_CODE39","BC_CODE93","BC_CODE128","BC_GS1_128","BC_CODE49","BC_PDF417","BC_DATAMATRIX"].indexOf(f.functionName)===-1&&(g=!0),h=g&&!l}t.setData(m.FormulaSparklineSelected,h)}static sparklineSelected(t){let i=t.Spread,n=C.getActiveSheet(i);if(t.setData(m.AllowSparklineGallery,!0),!n){t.setData(m.AllowSparklineGallery,!1);return}let a=vi.getSelectedSlicers(n)[0],r=pe.getSelectedChart(n),o=ut.getSelectedShapes(n)[0],l=a||r||o,d=n.getSparkline(n.getActiveRowIndex(),n.getActiveColumnIndex())instanceof GC.Spread.Sheets.Sparklines.Sparkline&&!l;t.setData(m.SparklineSelected,d),t.setData(m.UpdateSparkLine,!1)}static barCodeSelected(t){let i=C.getActiveSheet(t.Spread);if(!i)return;let n=t.Spread,a=i.getActiveRowIndex(),r=i.getActiveColumnIndex(),o=i.getSelections(),l=!1,c=vi.getSelectedSlicers(i)[0],d=pe.getSelectedChart(i),u=ut.getSelectedShapes(i)[0],h=c||d||u;if(o&&o.length>=1){let g=!1,f=Ae.parseFormulaSparkline(n,a,r);f&&["BC_QRCODE","BC_EAN13","BC_EAN8","BC_CODABAR","BC_CODE39","BC_CODE93","BC_CODE128","BC_GS1_128","BC_CODE49","BC_PDF417","BC_DATAMATRIX"].indexOf(f.functionName)!==-1&&(g=!0),l=g&&!h}t.setData(m.BarCodeSelected,l),l&&t.activeRibbonTab("barcodeDesignId")}static TableHasStyle(t){let i=C.getActiveSheet(t.Spread);if(!i)return;let n=i.getSelections(),a=bm(i,n[0]),r=!1;a&&(r=!!a.style()),t.setData(m.TableHasStyle,r)}static ActivePivotTableProps(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.pivotTables.findPivotTable(i.getActiveRowIndex(),i.getActiveColumnIndex()),a=!1,r=!1;if(n){let o=n.theme();o&&o.name()!=="light0"&&(a=!0);let l=n.getAllSlicers&&n.getAllSlicers();l&&l.length>0&&(r=!0)}t.setData(m.PivotTableHasStyle,a),t.setData(m.ActivePivotTableHasSlicer,r)}static PivotTableClearFilter(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.pivotTables.findPivotTable(i.getActiveRowIndex(),i.getActiveColumnIndex());if(n){let a=n.getFieldsByArea(GC.Spread.Pivot.PivotTableFieldType.filterField),r=n.getFieldsByArea(GC.Spread.Pivot.PivotTableFieldType.rowField),o=n.getFieldsByArea(GC.Spread.Pivot.PivotTableFieldType.columnField);if(a.length){t.setData(m.PivotTableClearFilter,!0);return}let l=r.concat(o),c=l.length,d;for(let u=0;u<c;u++)if(d=l[u].fieldName,n.labelFilter(d)||n.valueFilter(d)){t.setData(m.PivotTableClearFilter,!0);return}t.setData(m.PivotTableClearFilter,!1)}}static PivotTableCalcItem(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.pivotTables.findPivotTable(i.getActiveRowIndex(),i.getActiveColumnIndex());if(n){let a=n.getPivotInfoImp(i.getActiveRowIndex(),i.getActiveColumnIndex());if(a&&a.menuArea!==5&&(!C.isNullOrUndefined(a.activeRowFieldInfo)||!C.isNullOrUndefined(a.cornerFieldInfo)||!C.isNullOrUndefined(a.activeColFieldInfo)||!C.isNullOrUndefined(a.colHeadFieldInfo))){t.setData(m.PivotTableCalcItem,!0);return}}t.setData(m.PivotTableCalcItem,!1)}static PivotTableFieldSetting(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a);if(r){let o=r.getPivotInfoImp(n,a),l=o.area===4||!!o.activeRowFieldInfo||!!o.activeColFieldInfo||!!o.pageFieldInfo||!!o.colHeadFieldInfo||!!o.cornerFieldInfo||o.menuArea===5,c=o.menuArea===3,d=o.colHeadFieldInfo&&o.colHeadFieldInfo.fieldName===s.contextMenu.sigmaValueTemp;t.setData(m.PivotTableFieldSetting,l&&!c&&!d)}}static PivotTableGroupSelectionAndUnGroup(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a);if(r){let o=r.getPivotInfoImp(n,a,!0);if(o){let{activeColFieldInfo:l,colHeadFieldInfo:c,cornerFieldInfo:d,activeRowFieldInfo:u}=o;l||c||d||u||o.area===3&&o.menuArea===2?(t.setData(m.PivotTableGroupSelection,!0),t.setData(m.PivotTableUnGroupField,!0)):(t.setData(m.PivotTableGroupSelection,!1),t.setData(m.PivotTableUnGroupField,!1))}}}static pivotTableCollapseField(t){kt.queueMacroTask(()=>{if(t._disposed)return;let i=C.getActiveSheet(t.Spread);if(t.setData(m.PivotTableCollapseField,!1),!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a);t.setData(m.PivotTableCollapseField,NR(r,n,a))})}static PivotTableGroupField(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a);if(r){let o=r.getPivotInfoImp(n,a,!0),l=GC.Pivot.PivotDataType.number,c=GC.Pivot.PivotDataType.date,d;if(o){let{activeColFieldInfo:u,colHeadFieldInfo:h,cornerFieldInfo:g,activeRowFieldInfo:f}=o;if(u?d=u.name:f?d=f.name:h?d=h.fieldName:g&&(d=g.fieldName),!C.isNullOrUndefined(d)){let b=r.getField(d);if(!C.isNullOrUndefined(b)){let S=b.dataType;if(d&&(S===l||S===c)){t.setData(m.PivotTableGroupField,!0),t.setData(m.PivotTableCurrentFieldName,d);return}}}}t.setData(m.PivotTableGroupField,!1),t.setData(m.PivotTableCurrentFieldName,"")}}static PivotTableShowFilterPage(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.pivotTables.findPivotTable(i.getActiveRowIndex(),i.getActiveColumnIndex());if(n){let a=n.getFieldsByArea(GC.Spread.Pivot.PivotTableFieldType.filterField);if(a&&a.length>0){t.setData(m.PivotTableShowFilterPage,!0);return}}t.setData(m.PivotTableShowFilterPage,!1)}static rowOrColIncludeSpanOrTable(t){let i=t.Spread.getActiveSheet();if(!i)return;let n=i.getActiveColumnIndex(),a=i.getActiveRowIndex(),r=!0,o=!0,l=i.getSelections()[0];if(l&&l.row!==-1&&l.col!==-1&&l.rowCount!==i.getRowCount()&&l.colCount!==i.getColumnCount()&&i.tables){let d=i.tables.all();for(let u=0;u<d.length;u++){let h=d[u].range();n>h.col&&n<h.col+h.colCount&&o&&(t.setData(re.colIncludeTableSpan,!0),o=!1),a>h.row&&a<h.row+h.rowCount&&r&&(t.setData(re.rowIncludeTableSpan,!0),r=!1)}}let c=i.getSpans();for(let d=0;d<c.length;d++){let u=c[d];n>u.col&&n<u.col+u.colCount&&o&&(t.setData(re.rowIncludeTableSpan,!0),o=!1),a>u.row&&a<u.row+u.rowCount&&r&&(t.setData(re.colIncludeTableSpan,!0),r=!1)}r&&t.setData(re.rowIncludeTableSpan,!1),o&&t.setData(re.colIncludeTableSpan,!1)}static GroupShapeSelected(t){let i=C.getActiveSheet(t.Spread);if(!i)return;let n=i.shapes.all(),a=!1,r=0,o=0;for(let l=0;l<n.length;l++)if(n[l].isSelected()){r++,n[l]instanceof GC.Spread.Sheets.Shapes.GroupShape&&(a=!0);let c=GC.Spread.Sheets.Shapes.ConnectorShape;n[l]instanceof c?n[l].startConnector()===null&&n[l].endConnector()===null&&o++:o++}if(t.setData(m.GroupShapeSelected,a),t.setData(m.OnlyOneShapeSelected,r===1),t.setData(m.ShapeDistributeEnabled,o>2),r===1){let l=ut.getSelectedShapes(i)[0];t.setData(m.OnlyOneShapeTypeShapeSelected,l instanceof GC.Spread.Sheets.Shapes.Shape)}}static CanDoSort(t){let i=C.getActiveSheet(t.Spread);if(!i){t.setData(m.CanDoSort,!1);return}let n=!0;Tn.needCheckProtectionOptions(i)&&(i.options.protectionOptions.allowSort||(n=!1)),t.setData(m.CanDoSort,n)}static AutomaticCalc(t){t.setData(m.AutomaticCalc,t.Spread.options.calculationMode===0)}static CanDeleteTableRowsColumns(t){let i=t.Spread.getActiveSheet();if(!i)return;let n=i.tables,a=!0,r=!0;n&&(n.checkTableRow()||Tn._isAcrossTables(n)||n.containTableHeaderTotalRow()&&!n.isWholeTableRow())&&(r=!1),n&&(n.checkTableCol()||Tn._isAcrossTables(n))&&(a=!1),t.setData(m.CanDeleteTableColumns,a),t.setData(m.CanDeleteTableRows,r)}static IsConvertEntireSheetRows(t){let i=t.Spread.getActiveSheet();if(!i)return;let n=!1,a=i&&i.getSelections()[0];if(a){let r=i.tables.find(a.row,a.col);if(r){let o=r.rowFilter();o&&o.isFiltered()&&(n=!0)}}t.setData(m.IsConvertEntireSheetRows,n)}static isInPivotPageFilterArea(t){let i=C.getActiveSheet(t.Spread);if(t.setData(m.InPivotPageFilterArea,!1),!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a),o=r&&r.getPivotInfoImp(n,a,!1,!1,!0),l=o&&o.menuArea===0;t.setData(m.InPivotPageFilterArea,l)}static isInPivotCornerArea(t){let i=C.getActiveSheet(t.Spread);if(t.setData(m.InPivotCornerArea,!1),!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a),o=r&&r.getPivotInfoImp(n,a,!1,!1,!0),l=o&&o.menuArea===1;t.setData(m.InPivotCornerArea,l)}static isInPivotEmptyLabelArea(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a),o=r&&r.getPivotInfoImp(n,a,!1,!1,!0),l=o&&o.menuArea===3;t.setData(m.InPivotEmptyLabelArea,l)}static isInPivotHeaderArea(t){let i=C.getActiveSheet(t.Spread);if(t.setData(m.InPivotHeaderArea,!1),!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a),o=r&&r.getPivotInfoImp(n,a,!1,!1,!0),l=o&&o.menuArea===2||!1;t.setData(m.InPivotHeaderArea,l)}static isInPivotGrandTotalArea(t){let i=C.getActiveSheet(t.Spread);if(t.setData(m.InPivotGrandTotalArea,!1),!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a),o=r&&r.getPivotInfoImp(n,a,!1,!1,!0),l=o&&o.menuArea===5;t.setData(m.InPivotGrandTotalArea,l)}static isInPivotContentArea(t){let i=C.getActiveSheet(t.Spread);if(t.setData(m.InPivotContentArea,!1),!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a),o=r&&r.getPivotInfoImp(n,a,!1,!1,!0),l=o&&o.menuArea===4;t.setData(m.InPivotContentArea,l)}static isPivotContextMenuCornerShouldShow(t){let i=C.getActiveSheet(t.Spread);if(t.setData(m.PivotContextMenuCornerShouldShow,!1),!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a);t.setData(m.PivotContextMenuCornerShouldShow,NR(r,n,a))}static isPivotContextMenuGroupShouldShow(t){let i=!0,n=C.getActiveSheet(t.Spread);if(!n||!n.pivotTables)return;let a=n.getActiveRowIndex(),r=n.getActiveColumnIndex(),o=n.pivotTables.findPivotTable(a,r);t.setData(m.PivotContextMenuGroupShouldShow,!1);let l=o&&o.getPivotInfoImp(a,r,!1,!1,!0);if(l){let{cornerFieldInfo:c,colHeadFieldInfo:d}=l;(c||d)&&(i=!1),t.setData(m.PivotContextMenuGroupShouldShow,i)}}static isPivotContextMenuSubtotalShouldShow(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;t.setData(m.PivotContextMenuSubtotalShouldShow,!1);let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a),o=r&&r.getPivotInfoImp(n,a,!1,!1,!0);(o==null?void 0:o.menuArea)===2&&t.setData(m.PivotContextMenuSubtotalShouldShow,!0)}static isPivotContextEmptyValueFieldShouldShow(t){let i=!0,n=C.getActiveSheet(t.Spread);if(t.setData(m.PivotContextMenuEmptyValueFieldShouldShow,!1),t.setData(m.PivotContextMenuHasValueField,!1),!n||!n.pivotTables)return;let a=!0,r=n.getActiveRowIndex(),o=n.getActiveColumnIndex(),l=n.pivotTables.findPivotTable(r,o),c=l&&l.getPivotInfoImp(r,o,!1,!1,!0);if(c){let{valueFieldName:d,menuArea:u,area:h}=c;!d&&u===4&&h===4&&(i=!1);let g=l.getFieldsByArea(GC.Spread.Pivot.PivotTableFieldType.valueField);(!g||g.length===0)&&(a=!1),t.setData(m.PivotContextMenuEmptyValueFieldShouldShow,i),t.setData(m.PivotContextMenuHasValueField,a)}}static pivotTableHasSettingFieldName(t){let i=OR(t),n=i&&i!==s.contextMenu.sigmaValueTemp;t.getData(m.PivotTableHasSettingName)!==n&&t.setData(m.PivotTableHasSettingName,n)}static pivotTableFieldHeaders(t){let i=Mt(t);i&&i.options.showHeaders?t.setData(m.PivotTableFieldHeaders,!0):t.setData(m.PivotTableFieldHeaders,!1)}static sheetSelectionIntersectPivotTable(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.pivotTables.all(),a=i.getSelections();for(let r=0;r<n.length;r++){let o=n[r],{page:l,content:c}=o.getRange();for(let d=0;d<a.length;d++){let u=a[d],{row:h,col:g,rowCount:f,colCount:b}=u;if(c.intersect(h,g,f,b)||l&&l.intersect(h,g,f,b)){t.setData(m.SheetSelectionIntersectPivotTable,!0);return}}}t.setData(m.SheetSelectionIntersectPivotTable,!1)}static shouldClearFilterFromShow(t){let i=!0,n=!0,a=C.getActiveSheet(t.Spread);if(!a||!a.pivotTables)return;let r=a.getActiveRowIndex(),o=a.getActiveColumnIndex(),l=a.pivotTables.findPivotTable(r,o),c=l&&l.getPivotInfoImp(r,o,!1,!1,!0);if(c){let{activeRowFieldInfo:d,activeColFieldInfo:u,cornerFieldInfo:h,colHeadFieldInfo:g}=c,f=d&&d.name||u&&u.name||g&&g.fieldName||h&&h.fieldName,b=f&&l.labelFilter(f),S=!1,y=!1;b&&(b.condition&&(S=!0),b.textItem&&!b.textItem.isAll&&(S=!0)),y=!!(f&&l.valueFilter(f)),!S&&!y&&(i=!1),(h||g)&&(n=!1),t.setData(m.PivotContextMenuClearFilterFromShow,i),t.setData(m.PivotContextMenuKeepOrHideSelectedItems,n)}}static tableSheetActive(t){let i=t.Spread.getActiveSheetTab(),n=C._isTableSheet(i);if(t.setData(m.TableSheetActive,n),!n)t.setData(re.tableSheetUpdatedIsPrimaryKey,!0),t.setData(re.tableSheetSelectedExcludeGroupColumn,!0),t.setData(re.tableSheetSelectedCalcColumn,!0),t.setData(re.tableSheetSelectedExcludeGroupSliceColumn,!0),t.setData(re.tableSheetGrouped,!1);else{t.setData(re.tableSheetUpdatedIsPrimaryKey,!i.isHierarchyParent());let a=!!i.groupBy();t.setData(re.tableSheetGrouped,a)}if(t.getData(m.IsToggleTableSheetPanel)){t.setData(m.IsToggleTableSheetPanel,!1);return}i!==t.getData(re.tableSheet)&&t.setData(re.tableSheet,i)}static tableSheetDefineColumnActive(t){let i=Nb(t)&&t.Spread.getActiveSheetTab().options.enableDefineColumn;t.setData(m.TableSheetDefineColumnActive,i)}static tableSheetHierarchyActive(t){let i=Nb(t)&&t.Spread.getActiveSheetTab().isShowHierarchyOutlineColumn();t.setData(m.TableSheetHierarchyActive,i)}static tableSheetRowActionActive(t){let i=t.Spread.getActiveSheetTab(),n=Nb(t)&&!C._isGanttSheet(i);t.setData(m.TableSheetRowActionActive,n)}static tableSheetBatchActive(t){var n;let i=Nb(t);if(i){let a=t.Spread,r=a.getActiveSheetTab();if(C._isTableSheet(r)){let o=a.dataManager().tables[r.getDataView().tableName];i=Koe(o);let l=r.rowActionOptions(),c="saveRow",d=l.findIndex(u=>u.name===c);if(i)d>-1&&(r._lastRowActionSaveRowIndex=d,l.splice(d,1),a.suspendPaint(),r.rowActionOptions(l),a.resumePaint());else{const u=(n=t.getData(m.TableSheetRowActionVisible))==null?void 0:n[r&&r.name()];if(d===-1&&u){let h=GC.Spread.Sheets.TableSheet.BuiltInRowActions;d=r._lastRowActionSaveRowIndex,C.isNullOrUndefined(d)||l.splice(d,0,h.saveRow),a.suspendPaint(),r.rowActionOptions(l),a.resumePaint()}}}}t.setData(m.TableSheetBatchActive,i)}static tableSheetColumnSelected(t){let i=t.Spread.getActiveSheetTab(),n=C._isTableSheet(i),a=!1;if(n){let r=i.getSelections();a=r[0]&&r[0].row===-1&&r[0].col!==-1}a&&!t.getData(m.TableSheetColumnSelected)&&t.activeRibbonTab()!=="tableSheetColumnSetting"&&t.activeRibbonTab("tableSheetColumnSetting"),t.setData(m.TableSheetColumnSelected,a)}static dataManagerActive(t){let i=t.Spread.getActiveSheetTab(),n=i&&!C._isTableSheet(i)&&!C._isReportSheet(i);t.setData(m.DataManagerActive,n)}static isZoomFactor(t){pb(t)}static hasBackground(t){t.Spread.options.backgroundImage?t.setData(m.HasBackground,!0):t.setData(m.HasBackground,!1);let n=C.getActiveSheet(t.Spread);n&&n.backgroundImage()?t.setData(m.HasWorksheetBackgroundImage,!0):t.setData(m.HasWorksheetBackgroundImage,!1)}static horizontalAlignment(t){let i=C.getActiveSheet(t.Spread);if(i){let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.getCell(n,a).hAlign();t.setData(m.IsCenterAcrossSelection,r===4)}}static selectRangeHasTable(t){t.setData(m.SelectRangeHasTable,tle(t.Spread)),t.setData(m.SelectRangeInTable,ile(t.Spread))}static allowFilterAndSort(t){let i=C.getActiveSheet(t.Spread);if(i&&i.isActualProtected()){let n=i.options.protectionOptions.allowSort;t.setData(m.AllowFilterAndSort,n===!0)}else{let n=t.getData(m.SelectRangeHasTable),a=t.getData(m.IsInTableSheetDesignMode),r=t.getData(m.ChartSelected),o=t.getData(m.pictureSelected),l=t.getData(m.ShapeSelected);t.setData(m.AllowFilterAndSort,!n&&!a&&!r&&!o&&!l)}}static allowDataValidation(t){let i=C.getActiveSheet(t.Spread);t.setData(m.AllowDataValidation,!!i)}static allowRemoveDuplicate(t){let i=C.getActiveSheet(t.Spread),n=i&&!t.getData(m.SelectRangeHasTable),a=i&&i.getSelections()[0];if(a){let r=i.tables.find(a.row,a.col);C.isNullOrUndefined(r)||(n=r.range().containsRange(a))}t.setData(m.AllowRemoveDuplicate,n)}static allowEditLinks(t){let i=C.getActiveSheet(t.Spread);t.setData(m.AllowEditLinks,!!i)}static allowTextToColumn(t){let i=C.getActiveSheet(t.Spread);t.setData(m.AllowTextToColumn,!!i&&!i.isActualProtected())}static allowOutline(t){let i=C.getActiveSheet(t.Spread);t.setData(m.AllowOutline,!!i)}static allowAutoGenerateLabel(t){let i=t.Spread.getActiveSheet();t.setData(m.AllowAutoGenerateLabel,!!i)}static allowDataBinding(t){let i=C.getActiveSheet(t.Spread),n=t.getData(m.AllowAccessBarOpen);t.setData(m.AllowDataBinding,!!i&&n!==!1)}static allowSheetBinding(t){let i=C.getActiveSheet(t.Spread);t.setData(m.AllowSheetBinding,!!i)}static allowSheetSettings(t){const i=C.getActiveSheetOrSheetTab(t.Spread);t.setData(m.AllowSheetSettings,!!i)}static allowGridLinesAndHeadersSetting(t){const i=C.getActiveSheetOrSheetTab(t.Spread),n=C._isGanttSheet(i)||C._isTableSheet(i);t.setData(m.AllowGridLinesAndHeadersSetting,!n)}static allowPrintCurrentSheet(t){let i=t.Spread,n=i.getActiveSheet()||i.getActiveSheetTab();t.setData(m.AllowPrintCurrentSheet,!!(n&&n.printInfo||C._isReportSheet(n)))}static ganttSheetActive(t){const i=t.Spread.getActiveSheetTab();let n=C._isGanttSheet(i);if(t.setData(m.GanttSheetActive,n),n){const a=i.project.sortState;a&&!a.keepStructure?t.setData(m.GanttSheetHasSortWithoutStructure,!0):t.setData(m.GanttSheetHasSortWithoutStructure,!1)}i!==t.getData(re.ganttSheet)&&t.setData(re.ganttSheet,i)}static ganttSheetTaskSelected(t){const i=t.Spread.getActiveSheetTab(),n=a=>!!a.getTaskByRow(a.getActiveRowIndex());t.setData(m.GanttSheetTaskSelected,C._isGanttSheet(i)&&n(i))}static ganttSheetHasPrimaryKeyField(t){const i=t.Spread.getActiveSheetTab(),a=C._isGanttSheet(i)&&i.project.taskManager.getPrimaryKeyField();t.setData(m.GanttSheetTaskHasPrimaryKeyField,a)}static isGanttSheetAllSelectionInCol(t){const i=t.Spread.getActiveSheetTab(),n=a=>{const r=a.getSelections();for(let o of r)if(o.row!==-1)return!1;return!0};t.setData(m.isGanttSheetAllSelectionInCol,C._isGanttSheet(i)&&n(i))}static isGanttSheetAllSelectionInRow(t){const i=t.Spread.getActiveSheetTab(),n=a=>{const r=a.getSelections();for(let o of r)if(o.col!==-1)return!1;return!0};t.setData(m.isGanttSheetAllSelectionInRow,C._isGanttSheet(i)&&n(i))}static isSelectGanttSheetGanttChartColumn(t){const i=t.Spread.getActiveSheetTab(),n=a=>{const r=a.getSelections(),o=a.getGanttColumnIndex();for(let l of r)if(l.col===o)return!0;return!1};t.setData(m.SelectGanttColumn,C._isGanttSheet(i)&&n(i))}static isGanttSheetHasComplete(t){const i=t.Spread.getActiveSheetTab(),n=a=>{var o;let r=(o=i.getDataView())==null?void 0:o.getColumnInfos();if(r){for(let l=0;l<r.length;l++)if(r[l].value==="complete")return!0}return!1};t.setData(m.GanttSheetHasComplete,C._isGanttSheet(i)&&n())}static tableSheetHasMultipleHeaderRows(t){let n=t.Spread.getActiveSheetTab();n&&C._isTableSheet(n)&&n.getRowCount(GC.Spread.Sheets.SheetArea.colHeader)>1?t.setData(m.TableSheetHasMultipleHeaderRows,!0):t.setData(m.TableSheetHasMultipleHeaderRows,!1)}static refreshBindingPathTableIndicator(t){let i=t.getData(re.bindingIndicatorManager),n=!!t.getData(m.FieldListVisible),a=t.getData(m.FileMenu_show);i&&(n||a)&&i.refreshBindingPathIndicator(t)}static enableClearFormat(t){let i=t.getData(m.AllowFormatCells),n=t.getData(m.ChartSelected),a=t.getData(m.ShapeSelected),r=t.getData(m.pictureSelected),o=t.getData(m.SlicerSelected),l=t.getData(m.SelectedOrEditComments),c=i&&!n&&!a&&!r&&!o&&!l;t.setData(m.EnableClearFormat,c)}static reportSheetMode(t){let i=t.Spread.getActiveSheetTab(),n,a=C._isReportSheet(i);t.setData(m.ReportSheetActive,a),a&&(n=i.renderMode()),t.setData(m.ParameterPanelVisible,n===dc||n===Jx),t.setData(m.ReportSheetIsDesignMode,n===Ux),t.setData(m.ReportSheetIsDataEntryPreviewMode,n===dc),t.setData(m.ReportSheetIsPaginatedPreviewMode,n===Jx),t.setData(m.ReportSheetIsPreviewMode,n===dc||n===Jx);let r=!1,o=!1,l=!0,c=!1;if(n===Ux){let d=i.getTemplate(),u=d.getActiveRowIndex(),h=d.getActiveColumnIndex(),g=C._getReportActiveContainerInfo(i),f=Math.min(8,d.getRowCount()-u),b=Math.min(5,d.getColumnCount()-h),S=d.containers();if(f>=2&&b>=2){let y=new GC.Spread.Sheets.Range(u,h,f,b);if(!g){r=!0;for(let v of S)if(y.intersect(v.ranges[1].row,v.ranges[1].col,v.ranges[1].rowCount,v.ranges[1].colCount+v.ranges[2].colCount)){r=!1;break}}}if(o=!!g,g){let y=d.getTemplateCell(u,h);if(!y||y.type==="Static"){let v=g.activeContainer.ranges.find(x=>x.contains(u,h));if(v){let{row:x,col:L,rowCount:T,colCount:w}=v,M=!1;for(let D=0;D<T&&!M;D++)for(let P=0;P<w;P++){let A=d.getTemplateCell(x+D,L+P);if(d.getValue(x+D,L+P)||A&&A.type!=="Static"){M=!0;break}}l=M}}c=!0}if(!c){let y=d.getSelections()[0];for(let v of S)if(y!=null&&y.intersect(v.ranges[1].row,v.ranges[1].col,v.ranges[1].rowCount,v.ranges[1].colCount+v.ranges[2].colCount)){c=!0;break}}}t.setData(m.ReportCellBindingSmartTagTemplateVisible,!1),t.setData(m.ParameterUISmartTagTemplateVisible,!1),t.setData(m.AllowChangeTemplateCellType,l),t.setData(m.AllowReportSheetInsertContainer,r),t.setData(m.AllowReportSheetDeleteContainer,o),t.setData(m.ReportSheetRangeContainsContainer,c)}static reportSheetActiveCellIsExpandable(t){let i=t.Spread.getActiveSheetTab(),n=!1;if(C._isReportSheet(i)&&i.renderMode()===dc){const a=i.getSheet().getActiveRowIndex(),r=i.getSheet().getActiveColumnIndex();n=i.isExpandable(a,r)}t.setData(m.ReportSheetActiveCellIsExpandable,n)}static reportSheetSelectionContainsCanCollapseCell(t){let i=t.Spread.getActiveSheetTab(),n=!1;C._isReportSheet(i)&&i.renderMode()===dc&&(n=(i.getSheet().getSelections()||[]).some(r=>{const{row:o,rowCount:l,col:c,colCount:d}=r,u=o+l-1,h=c+d-1;for(let g=o;g<=u;g++)for(let f=c;f<=h;f++){const b=i.getSpan(g,f);if(!(b&&(b.row!==g||b.col!==f))&&i.internalCanCollapse(g,f))return!0}return!1})),t.setData(m.ReportSheetSelectionContainsCanCollapseCell,n)}static reportSheetActiveCellSmartTagVisible(t){let i=t.Spread.getActiveSheetTab(),n=!1;if(C._isReportSheet(i)&&i.renderMode()===Ux){let a=i.getSheet();const r=a.getActiveRowIndex(),o=a.getActiveColumnIndex();let l=a.getTemplateCell(r,o);n=!C.isNullOrUndefined(l)}t.setData(m.ReportSheetActiveCellSmartTagVisible,n)}static reportSheetParameterUI(t){let i=t.Spread.getActiveSheetTab(),n=!1;if(C._isReportSheet(i)){let a=i.internalParameterUI();if(n=!(C.isNullOrUndefined(a)||JSON.stringify(a)==="{}"||a.data&&a.data.dataTable===void 0),n){let r=a.data.dataTable,o=!1;for(let l in r)if(r.hasOwnProperty(l)&&!o){let c=r[l];for(let d in c)if(c.hasOwnProperty(d)&&!o){let u=c[d],{value:h,style:g}=u;if(!C.isNullOrUndefined(h)&&h!==""||g&&!hle(g)){o=!0;break}}}n=o}}t.setData(m.ParameterPanelHasUIValue,n)}static reportSheetHasDataEntrySetting(t){let i=t.Spread.getActiveSheetTab(),n=!1;if(C._isReportSheet(i)){const a=i.getTemplate().getDataEntrySetting();n=a&&a.length}t.setData(m.ReportSheetCellHasDataEntrySetting,n)}static reportSheetCellIsDirty(t){let i=t.Spread.getActiveSheetTab(),n=!1;if(C._isReportSheet(i)&&i.renderMode()===dc){const r=i.getSheet().getSelections();for(let o of r){if(n)break;const{row:l,col:c,rowCount:d,colCount:u}=o,h=l+d-1,g=c+u-1;for(let f=l;f<=h&&!n;f++)for(let b=c;b<=g&&(n=i.internalIsDirtyCell(f,b),!n);b++);}}t.setData(m.ReportSheetCellsHasDirty,n)}static reportSheetCellIsProtected(t){let i=t.Spread.getActiveSheetTab();if(C._isReportSheet(i)&&i.renderMode()===dc){const n=i.getSheet(),a=n.getActiveRowIndex(),r=n.getActiveColumnIndex();t.setData(m.ReportSheetCellsIsProtected,i.internalCellIsProtected(a,r));return}t.setData(m.ReportSheetCellsIsProtected,!1)}static reportSheetHasDirtyCell(t){let i=t.Spread.getActiveSheetTab();if(C._isReportSheet(i)&&i.renderMode()===dc){t.setData(m.ReportSheetHasDirtyCell,i.isDirty());return}t.setData(m.ReportSheetHasDirtyCell,!1)}static activeSpreadIsDesignSpread(t){let i=t.Spread,n=!1;C.FindSelfOrParent(i.getHost(),".gc-report-design-parameter-ui")&&(n=!0),t.setData(m.ActiveSpreadIsDesignSpread,n)}static allowSelectChartData(t){let i=t.Spread,n=pe.getActiveChart(i);if(n){let a=n.getDataSetting();if(a!=null&&a.tableName){t.setData(m.AllowChartSelectData,!1);return}t.setData(m.AllowChartSelectData,!0)}}static allowBindChartData(t){let i=t.Spread,n=pe.getActiveChart(i);if(n){let a=n.getDataSetting();if(a!=null&&a.tableName){t.setData(m.AllowChartBindData,!0);return}else if(n.series().Count){t.setData(m.AllowChartBindData,!1);return}t.setData(m.AllowChartBindData,!0)}}static activeChartHasSeries(t){let i=t.Spread,n=pe.getActiveChart(i);if(n&&n.series().Count){t.setData(m.ActiveChartHasSeries,!0);return}t.setData(m.ActiveChartHasSeries,!1)}static allowPasteSpecial(t){let i=C.getActiveSheet(t.Spread);i?C._isTableSheet(i)||!i.getClipboardHelperObj().ranges||i.getClipboardHelperObj().isCutting||i.isPasteShapes&&i.isPasteShapes()||i.isPasteFloatingObject&&i.isPasteFloatingObject()?t.setData(m.AllowPasteSpecial,!1):t.setData(m.AllowPasteSpecial,!0):t.setData(m.AllowPasteSpecial,!1)}static updateActiveSlicer(t){let i=C.getActiveSheet(t.Spread),n=vi.getSelectedSlicers(i,!0),a=vi.getSelectedPivotTimelines(i);n.length===1&&a.length===0?(t.setData(re.selectedSlicer,n[0]),t.setData(re.selectedTimeline,null)):a.length===1&&n.length===0&&(t.setData(re.selectedTimeline,a[0]),t.setData(re.selectedSlicer,null))}static updateActiveSheetTab(t){const i=t.Spread.getActiveSheetTab();if(!i)return;const n=C._getSheetTabType(i);if(n===t.getData(re.activeSheetTabType))return;const a=()=>{switch(n){case GC.Spread.Sheets.SheetType.tableSheet:return"tableSheetDesign";case GC.Spread.Sheets.SheetType.ganttSheet:return"ganttSheetChartFormat";case GC.Spread.Sheets.SheetType.reportSheet:return"reportSheetDesign"}return""};t.setData(re.activeSheetTabType,n);const r=a();r&&t.activeRibbonTab(r)}static updateTableSheetPanel(t){const i=t.Spread.getActiveSheetTab();if(!i){t.setData(m.TableSheetPanelVisible,!1);return}const n=C._getSheetTabType(i);if(n===GC.Spread.Sheets.SheetType.tableSheet){let a=t.getData(m.IsInTableSheetDesignMode);t.setData(m.TableSheetPanelVisible,!a)}else n===GC.Spread.Sheets.SheetType.ganttSheet?t.setData(m.TableSheetPanelVisible,!0):t.setData(m.TableSheetPanelVisible,!1)}static updateFieldListPanel(t){t.getData(m.FieldListVisible)&&t.Spread.getActiveSheetTab()&&t.setData(m.FieldListVisible,!1)}static updateActiveChartState(t){let i=t.Spread,n=pe.getActiveChart(i);n&&t.setData(m.FunnelChartClicked,n.chartType()===GC.Spread.Sheets.Charts.ChartType.funnel)}static autoSwitchRibbonTab(t){sne(t)}static updateDataChartLic(t){setTimeout(()=>{ax(t,t.Spread)})}static isTableTotalRowEnabled(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.tables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.tables.find(n,a);if(t.setData(m.TableDisableShowTotalRow,!1),r&&!r.showFooter()){let o=r.dataRange();if(o.row+o.rowCount>=i.getRowCount()){t.setData(m.TableDisableShowTotalRow,!0);return}}}static reportSheetTemplateRange(t){var n,a,r,o,l,c,d;let i=(n=t.Spread.getActiveSheetTab())==null?void 0:n.templateSheet;if(i){const u=i==null?void 0:i.templateRange();if(u){const h=i.getActiveRowIndex(),g=i.getActiveColumnIndex(),f=Object.keys(u).some(P=>{var A,E;return!!((E=(A=u[P])==null?void 0:A.range)!=null&&E.contains(h,g))});t.setData(re.reportSheetTemplateRangeActive,!!f);const b=i.getSelections(),S=(P,A)=>{var k,N,B,F;const{row:E,col:O,rowCount:I,colCount:R}=A;return!!((N=(k=u[P])==null?void 0:k.range)!=null&&N.intersect(E,O,I,R))&&!((F=(B=u[P])==null?void 0:B.range)!=null&&F.containsRange(A))},y=Object.keys(u).some(P=>b.some(A=>S(P,A)));t.setData(re.hasReportSheetTemplateRange,y);const v=b[0],x=b.length===1&&v,L=u.detail,T=u.header,w=u.footer,M=(a=u.detail)==null?void 0:a.groups,D=(r=u.detail)==null?void 0:r.children;t.setData(re.canInsertReportSheetTemplateRangeHeader,x&&!(T!=null&&T.range)&&(L==null?void 0:L.range)&&!L.range.intersect(v.row,v.col,v.rowCount,v.colCount)&&(!(w!=null&&w.range)||!((o=w==null?void 0:w.range)!=null&&o.intersect(v.row,v.col,v.rowCount,v.colCount)))),t.setData(re.canInsertReportSheetTemplateRangeFooter,x&&!(w!=null&&w.range)&&(L==null?void 0:L.range)&&!L.range.intersect(v.row,v.col,v.rowCount,v.colCount)&&(!(T!=null&&T.range)||!((l=T==null?void 0:T.range)!=null&&l.intersect(v.row,v.col,v.rowCount,v.colCount)))),t.setData(re.canInsertReportSheetTemplateRangeDetail,!(L!=null&&L.range)||!M||(M==null?void 0:M.every(P=>!P))),t.setData(re.canInsertReportSheetTemplateRangeGroupHeader,x&&(L==null?void 0:L.range)&&!(D!=null&&D.length)&&L.range.containsRange(v)&&!(M!=null&&M[0])&&(!(M!=null&&M[1])||!((c=M==null?void 0:M[1])!=null&&c.intersect(v.row,v.col,v.rowCount,v.colCount)))),t.setData(re.canInsertReportSheetTemplateRangeGroupFooter,x&&(L==null?void 0:L.range)&&!(D!=null&&D.length)&&L.range.containsRange(v)&&!(M!=null&&M[1])&&(!(M!=null&&M[0])||!((d=M==null?void 0:M[0])!=null&&d.intersect(v.row,v.col,v.rowCount,v.colCount))))}}}},Tn._setShapePanelStateHandler=0,Tn);ze([je(_t.PivotTableAdded)],We,"initActiveSheetState"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.DataManagerActive,m.GanttSheetActive)],We,"hasIndent"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.DataManagerActive,m.GanttSheetActive)],We,"allowInsertTable"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.DataManagerActive)],We,"allowInsertPivotTable"),ze([je(m.DataManagerActive)],We,"allowInsertShape"),ze([je()],We,"setCustomTableTheme"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"allowInsertChart"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.DataManagerActive,m.GanttSheetActive)],We,"allowInsertBarCode"),ze([je(re.osEnv)],We,"setAccessBarItemsState"),ze([je(m.DataManagerActive,m.GanttSheetActive,GC.Spread.Sheets.Events.SelectionChanged)],We,"setHyperlinkItemsState"),ze([je(GC.Spread.Sheets.Events.ClipboardChanged,GC.Spread.Sheets.Events.ClipboardPasted,GC.Spread.Sheets.Events.SelectionChanged)],We,"setInsertCopiedCutCellsState"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.DataManagerActive)],We,"selectFullColumn"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.DataManagerActive)],We,"selectFullRow"),ze([je()],We,"sheetFreezed"),ze([je(_t.SheetOptionsChangedInternal,m.DataManagerActive)],We,"allowFilter"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,_t.SheetOptionsChangedInternal)],We,"allowRichText"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.SlicerChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged)],We,"hasSlicerSelected"),ze([je(GC.Spread.Sheets.Events.SheetChanged)],We,"hasHiddenSheet"),ze([je(_t.SheetOptionsChangedInternal)],We,"allowResizeRows"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.EnterCell,_t.SheetOptionsChangedInternal)],We,"AllowInsertCell"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.EnterCell,_t.SheetOptionsChangedInternal)],We,"allowDeleteCell"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,_t.SheetOptionsChangedInternal,m.DataManagerActive)],We,"isIncludeLockedCell"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.EnterCell,_t.SheetOptionsChangedInternal)],We,"allowInsertRows"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.EnterCell,_t.SheetOptionsChangedInternal)],We,"allowDeleteRows"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.EnterCell,_t.SheetOptionsChangedInternal)],We,"allowInsertColumns"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.EnterCell,_t.SheetOptionsChangedInternal)],We,"allowDeleteColumns"),ze([je(GC.Spread.Sheets.Events.EnterCell,_t.SheetOptionsChangedInternal,m.IsInTableSheetDesignMode)],We,"allowFormatCells"),ze([je(_t.SheetOptionsChangedInternal)],We,"allowFormatRows"),ze([je(_t.SheetOptionsChangedInternal)],We,"allowFormatColumns"),ze([je()],We,"allowOutlineRows"),ze([je()],We,"allowOutlineColumns"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged)],We,"chartAllSeriesList"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveChartLegend"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharTitle"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharErroeBar"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharTrendline"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharDataLabels"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharPrimaryValue"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharPrimaryCategory"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxisTypeTitle"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxisTypeMajorGridLineMinorGridLine"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxisTypeNone"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxesAxesPrimaryVertical"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxesPrimaryHorizontal"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxesAxesSecondaryHorizontal"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxesAxesSecondaryVertical"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxisTitlesPrimaryHorizontal"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxisTitlesPrimaryVertical"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxisTitlesSecondaryHorizontal"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxisTitlesSecondaryVertical"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharGridlinesPrimaryMajorHorizontal"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharGridlinesPrimaryMinorVertical"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharGridlinesSecondaryMinorHorizontal"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharGridlinesSecondaryMinorVertical"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartCommandExecuted)],We,"haveCharDataLabelsShow"),ze([je(_t.SheetOptionsChangedInternal)],We,"allowResizeColumns"),ze([je(re.osEnv)],We,"needActive"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.ChartClicked,m.ChartCommandExecuted)],We,"chartGroup"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ValueChanged)],We,"hasCellTypes"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"hasCellButtons"),ze([je(_t.SheetOptionsChangedInternal,m.IsInTableSheetDesignMode)],We,"isProtected"),ze([je(_t.SheetOptionsChangedInternal,m.IsInTableSheetDesignMode)],We,"isActualProtected"),ze([je()],We,"enableAccessibility"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,_t.WorksheetDataChanged)],We,"cellLocked"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"tableInsertRowAbove"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"tableInsertRowBelow"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"tableInsertColumnLeftRight"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"checkTableLastCol"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"checkTableLastRow"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"hasComments"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.CellChanged,GC.Spread.Sheets.Events.ThreadedCommentChanged)],We,"hasThreadedComments"),ze([je(GC.Spread.Sheets.Events.CellChanged,GC.Spread.Sheets.Events.ThreadedCommentChanged)],We,"allSheetsHaveThreadedComments"),ze([je(GC.Spread.Sheets.Events.CommentChanged,GC.Spread.Sheets.Events.SheetChanged,GC.Spread.Sheets.Events.SelectionChanged)],We,"selectedOrEditComments"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.RangeChanged)],We,"clickTable"),ze([je(m.TableClicked)],We,"toggleBetweenConvertTableAndDataTable"),ze([je(m.AllowInsertTable,m.DataManagerActive,m.GanttSheetActive,GC.Spread.Sheets.Events.RangeChanged,GC.Spread.Sheets.Events.SelectionChanged,GC.Data.Events.TableAdded,GC.Data.Events.TableRemoved)],We,"allowAddTableFromDataTable"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.RangeChanged,_t.WorksheetDataChanged,GC.Spread.Sheets.Events.CellChanged,m.DataManagerActive)],We,"tableSelected"),ze([je(GC.Spread.Sheets.Events.PivotTableChanged,GC.Spread.Sheets.Events.ActiveCellChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged,_t.WorksheetDataChanged,_t.PivotTableAdded,GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.RangeChanged)],We,"pivotTableSelected"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.SlicerChanged)],We,"pivotSlicerSelected"),ze([je(_t.SheetOptionsChangedInternal)],We,"pivotProtection"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"filterSelected"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.SheetChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.ShapeChanged,m.DataManagerActive,_t.SheetOptionsChangedInternal,GC.Spread.Sheets.Events.ShapeRemoved)],We,"chartSelected"),ze([je(GC.Spread.Sheets.Events.SheetChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.ShapeChanged,GC.Spread.Sheets.Events.ShapeRemoved,_t.WorksheetDataChanged,GC.Spread.Sheets.Events.ActiveCellChanged)],We,"shapeSelected"),ze([je(GC.Spread.Sheets.Events.SheetChanged,_t.WorksheetDataChanged,GC.Spread.Sheets.Events.ActiveCellChanged,GC.Spread.Sheets.Events.FloatingObjectSelectionChanged,GC.Spread.Sheets.Events.FloatingObjectLoaded,GC.Spread.Sheets.Events.FloatingObjectChanged)],We,"floatingObjectSelected"),ze([je(GC.Spread.Sheets.Events.SheetChanged,GC.Spread.Sheets.Events.PictureSelectionChanged,GC.Spread.Sheets.Events.PictureChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged,m.DataManagerActive,m.GanttSheetActive)],We,"pictureSelected"),ze([je(_t.SheetOptionsChangedInternal,m.DataManagerActive,m.GanttSheetActive)],We,"allowEditObject"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,_t.WorksheetDataChanged,m.AfterCommandExecute)],We,"allowUndoListDropdown"),ze([je(GC.Spread.Sheets.Events.SheetChanged,GC.Spread.Sheets.Events.SlicerChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged,_t.SheetOptionsChangedInternal,GC.Spread.Sheets.Events.ShapeChanged)],We,"slicerSelected"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.EditEnded,GC.Spread.Sheets.Events.ClipboardPasted,GC.Spread.Sheets.Events.RangeChanged)],We,"formulaSparklineSelected"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ActiveCellChanged,GC.Spread.Sheets.Events.EditEnded,GC.Spread.Sheets.Events.RangeChanged,GC.Spread.Sheets.Events.ValueChanged,m.DataManagerActive,m.GanttSheetActive,m.UpdateSparkLine)],We,"sparklineSelected"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.BarCodeSelected)],We,"barCodeSelected"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"TableHasStyle"),ze([je(GC.Spread.Sheets.Events.SlicerChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.SelectionChanged)],We,"ActivePivotTableProps"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.PivotTableChanged)],We,"PivotTableClearFilter"),ze([je(GC.Spread.Sheets.Events.PivotTableChanged,GC.Spread.Sheets.Events.ActiveCellChanged,_t.WorksheetDataChanged)],We,"PivotTableCalcItem"),ze([je(_t.WorksheetDataChanged,GC.Spread.Sheets.Events.SelectionChanged)],We,"PivotTableFieldSetting"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"PivotTableGroupSelectionAndUnGroup"),ze([je(_t.WorksheetDataChanged,GC.Spread.Sheets.Events.PivotTableChanged,GC.Spread.Sheets.Events.SelectionChanged)],We,"pivotTableCollapseField"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ActiveCellChanged)],We,"PivotTableGroupField"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"PivotTableShowFilterPage"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"rowOrColIncludeSpanOrTable"),ze([je(_t.SheetOptionsChangedInternal,m.ShapeSelected)],We,"GroupShapeSelected"),ze([je(_t.SheetOptionsChangedInternal,m.DataManagerActive)],We,"CanDoSort"),ze([je(_t.SheetOptionsChangedInternal)],We,"AutomaticCalc"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"CanDeleteTableRowsColumns"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"IsConvertEntireSheetRows"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isInPivotPageFilterArea"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isInPivotCornerArea"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isInPivotEmptyLabelArea"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ActiveCellChanged)],We,"isInPivotHeaderArea"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isInPivotGrandTotalArea"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isInPivotContentArea"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ActiveCellChanged)],We,"isPivotContextMenuCornerShouldShow"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ActiveCellChanged)],We,"isPivotContextMenuGroupShouldShow"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isPivotContextMenuSubtotalShouldShow"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isPivotContextEmptyValueFieldShouldShow"),ze([je(_t.WorksheetDataChanged,GC.Spread.Sheets.Events.SelectionChanged)],We,"pivotTableHasSettingFieldName"),ze([je(_t.WorksheetDataChanged,GC.Spread.Sheets.Events.SelectionChanged)],We,"pivotTableFieldHeaders"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"sheetSelectionIntersectPivotTable"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"shouldClearFilterFromShow"),ze([je(m.TableSheetPanelVisible,m.IsToggleTableSheetPanel,re.tableSheet,m.IsInTableSheetDesignMode,_t.WorksheetDataChanged)],We,"tableSheetActive"),ze([je(_t.SheetOptionsChangedInternal)],We,"tableSheetDefineColumnActive"),ze([je(_t.SheetOptionsChangedInternal,_t.WorksheetDataChanged)],We,"tableSheetHierarchyActive"),ze([je(GC.Spread.Sheets.Events.SheetChanged,_t.WorksheetDataChanged)],We,"tableSheetRowActionActive"),ze([je(m.TableSheetRowActionVisible,_t.WorksheetDataChanged)],We,"tableSheetBatchActive"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,_t.WorksheetDataChanged)],We,"tableSheetColumnSelected"),ze([je()],We,"dataManagerActive"),ze([je(_t.SheetOptionsChangedInternal)],We,"isZoomFactor"),ze([je(_t.EnterCellInternal,_t.SheetOptionsChangedInternal,_t.SheetBackgroundChangedInternal)],We,"hasBackground"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.AfterCommandExecute)],We,"horizontalAlignment"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"selectRangeHasTable"),ze([je(m.SelectRangeHasTable,m.IsInTableSheetDesignMode,m.ChartSelected,m.pictureSelected,m.ShapeSelected,_t.SheetOptionsChangedInternal,m.DataManagerActive)],We,"allowFilterAndSort"),ze([je(m.DataManagerActive)],We,"allowDataValidation"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.DataManagerActive)],We,"allowRemoveDuplicate"),ze([je(m.DataManagerActive)],We,"allowEditLinks"),ze([je(_t.SheetOptionsChangedInternal,m.DataManagerActive)],We,"allowTextToColumn"),ze([je(m.DataManagerActive)],We,"allowOutline"),ze([je()],We,"allowAutoGenerateLabel"),ze([je()],We,"allowDataBinding"),ze([je(m.DataManagerActive)],We,"allowSheetBinding"),ze([je()],We,"allowSheetSettings"),ze([je(m.GanttSheetActive)],We,"allowGridLinesAndHeadersSetting"),ze([je(GC.Spread.Sheets.Events.SheetChanged,m.DataManagerActive)],We,"allowPrintCurrentSheet"),ze([je(re.ganttSheet,_t.WorksheetDataChanged,m.TableSheetPanelVisible,m.GanttSheetActive)],We,"ganttSheetActive"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"ganttSheetTaskSelected"),ze([je(GC.Spread.Sheets.Events.SheetChanged,_t.WorksheetDataChanged)],We,"ganttSheetHasPrimaryKeyField"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isGanttSheetAllSelectionInCol"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isGanttSheetAllSelectionInRow"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isSelectGanttSheetGanttChartColumn"),ze([je()],We,"isGanttSheetHasComplete"),ze([je()],We,"tableSheetHasMultipleHeaderRows"),ze([je(re.bindingIndicatorManager,m.FieldListVisible,m.FiledListValue)],We,"refreshBindingPathTableIndicator"),ze([je(m.AllowFormatCells,m.ChartSelected,m.ShapeSelected,m.pictureSelected,m.SlicerSelected,m.SelectedOrEditComments)],We,"enableClearFormat"),ze([je(GC.Spread.Sheets.Events.SheetChanged,GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ActiveCellChanged)],We,"reportSheetMode"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"reportSheetActiveCellIsExpandable"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"reportSheetSelectionContainsCanCollapseCell"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"reportSheetActiveCellSmartTagVisible"),ze([je()],We,"reportSheetParameterUI"),ze([je()],We,"reportSheetHasDataEntrySetting"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"reportSheetCellIsDirty"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"reportSheetCellIsProtected"),ze([je()],We,"reportSheetHasDirtyCell"),ze([je(m.OriginSpread)],We,"activeSpreadIsDesignSpread"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged)],We,"allowSelectChartData"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged)],We,"allowBindChartData"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged)],We,"activeChartHasSeries"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ClipboardChanged,GC.Spread.Sheets.Events.ClipboardPasted)],We,"allowPasteSpecial"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.SlicerChanged)],We,"updateActiveSlicer"),ze([je()],We,"updateActiveSheetTab"),ze([je(m.TableSheetActive,m.GanttSheetActive)],We,"updateTableSheetPanel"),ze([je()],We,"updateFieldListPanel"),ze([je()],We,"updateActiveChartState"),ze([je(m.ShapeSelected,m.PictureShapeSelected,m.ChartSelected,m.SlicerSelected,m.TimelineSelected)],We,"autoSwitchRibbonTab"),ze([je(m.DataChartEnabled,_t.WorksheetDataChanged)],We,"updateDataChartLic"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ActiveCellChanged)],We,"isTableTotalRowEnabled"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.RangeChanged,_t.ReportSheetTemplateRangeChanged)],We,"reportSheetTemplateRange");function Koe(e){return(e.options.batch||!1)&&!C.isNullOrUndefined(e.options.remote)}function Nb(e){let t=e.Spread.getActiveSheetTab();return C._isTableSheet(t)&&!!t.getDataView()}function Qoe(e){let t=C.getActiveSheet(e);return!!(t&&t.getSelections()[0])}function Xoe(e){return!!C.getActiveSheet(e)}function $oe(e){let t=e.getActiveSheet(),i=t&&Ae.getActiveSlicer(t);return!(!i||i.length===0)}function ele(e){let t=C.getActiveSheet(e);if(!t)return!1;let i=t&&t.getSelections()[0];return!(!i||i.rowCount===1&&i.colCount===1&&typeof t.getValue(i.row,i.col)=="object"&&!C._isReportSheet(e.getActiveSheetTab()))}function tle(e){let t=C.getActiveSheet(e);if(C.isNullOrUndefined(t))return!1;let i=t.getSelections()[0];if(C.isNullOrUndefined(i))return!1;if(nle(t,i))return!0;let n=t.tables.find(i.row,i.col);return C.isNullOrUndefined(n)?!!bm(t,i):!(n.range().containsRange(i)&&t.getSelections().length===1)}function ile(e){var a;let t=C.getActiveSheet(e),i=t==null?void 0:t.getSelections()[0],n=(a=bm(t,i))==null?void 0:a.range();return!!(n!=null&&n.containsRange(i)&&t.getSelections().length===1)}function bm(e,t){if(!t)return null;let i=e.tables;if(C.isNullOrUndefined(i))return null;let n=i.all();for(let a=0;a<n.length;a++){let{row:r,col:o,rowCount:l,colCount:c}=n[a].range();if(t.intersect(r,o,l,c))return n[a]}return null}function nle(e,t){if(!t)return null;let i=e.pivotTables;if(C.isNullOrUndefined(i))return null;let n=i.all();for(let a=0;a<n.length;a++){let{row:r,col:o,rowCount:l,colCount:c}=n[a].getRange().content;if(t.intersect(r,o,l,c))return n[a]}return null}function NR(e,t,i){let n=e&&e.getPivotInfoImp(t,i,!1,!1,!0);if(n){let{value:a,area:r,menuArea:o,cornerFieldInfo:l,colHeadFieldInfo:c,activeRowFieldInfo:d,activeColFieldInfo:u,rowInfos:h,colInfos:g}=n,f=(r===2||r===3)&&o===4,b=(!l||!c)&&a===s.sigmaValue,S=r===3&&d&&h[d.index].isSubtotal&&h[d.index].collapseIndex===void 0||r===2&&u&&g[u.index].isSubtotal&&g[u.index].collapseIndex===void 0;if(f||b||S){let y=d==null?void 0:d.name;return!!(y&&e.subtotalPosition(y)===1)}return!0}return!1}function uc(e,t){let i=ale(e),n=e.axes();if(i)switch(t){case 0:return n.primaryValue;case 1:return n.primaryCategory;case 2:return n.secondaryValue;case 3:return n.secondaryCategory}else switch(t){case 0:return n.primaryCategory;case 1:return n.primaryValue;case 2:return n.secondaryCategory;case 3:return n.secondaryValue}}function ale(e){let t=e.chartType(),i=!1,n=pe.getChartGroup(t);if(n===Se.BarGroup&&(i=!0),(n===Se.FunnelGroup||n===Se.WaterfallGroup)&&(i=!0),n===Se.ComboGroup){let a=e.series().get();for(let r=0;r<a.length;r++){let o=a[r];if(pe.getChartGroup(o.chartType)!==Se.BarGroup){i=!1;break}i=!0}}return i}function rle(){return[{type:Se.ColumnGroup,items:[m.DataLabelsNone,m.DataLabelsCenter,m.DataLabelsInsideEnd,m.DataLabelsInsideBase,m.DataLabelsOutsideEnd]},{type:Se.LineGroup,items:[m.DataLabelsNoneLineGroup,m.DataLabelsCenterLineGroup,m.DataLabelsLeftGroup,m.DataLabelsRightGroup,m.DataLabelsAboveGroup,m.DataLabelsBelowGroup]},{type:Se.PieGroup,items:[m.DataLabelsNonePieGroup,m.DataLabelsCenterPieGroup,m.DataLabelsInsideEndPieGroup,m.DataLabelsOutsideEndPieGroup,m.DataLabelBestFitPieGroup]},{type:Se.DoughnutGroup,items:[m.DataLabelsNoneDoughnutGroup,m.DataLabelsShow]},{type:Se.BarGroup,items:[m.DataLabelsNone,m.DataLabelsCenter,m.DataLabelsInsideEnd,m.DataLabelsInsideBase,m.DataLabelsOutsideEnd]},{type:Se.AreaGroup,items:[m.DataLabelsNone,m.DataLabelsShow]},{type:Se.ScatterGroup,items:[m.DataLabelsNoneScatterGroup,m.DataLabelsCenterScatterGroup,m.DataLabelsLeftGroup,m.DataLabelsRightGroup,m.DataLabelsAboveGroup,m.DataLabelsBelowGroup]},{type:Se.RadarGroup,items:[m.DataLabelsNone,m.DataLabelsShow]},{type:Se.SunburstGroup,items:[m.DataLabelsNoneSunburstGroup,m.DataLabelsCenterSunburstGroup]},{type:Se.TreemapGroup,items:[m.DataLabelsNoneTreeMapGroup,m.DataLabelsShow]},{type:Se.WaterfallGroup,items:[m.DataLabelsNone,m.DataLabelsCenter,m.DataLabelsInsideEnd,m.DataLabelsInsideBase,m.DataLabelsOutsideEnd]},{type:Se.ComboGroup,items:[m.DataLabelsNone,m.DataLabelsCenter,m.DataLabelsInsideEnd,m.DataLabelsOutsideEnd]}]}function ole(e){return e.some(t=>t instanceof GC.Spread.Sheets.Shapes.PictureShape)}function lle(e){return ut.getShapes(e,[]).some(t=>ut.isSupportChangeShapeType(t))}function sle(e){return e.some(t=>!(t instanceof GC.Spread.Sheets.Shapes.PictureShape)&&!vi.isSlicerShape(t))}function cle(e){return e.length===0?!1:e.every(t=>ut.isSupportedHyperlinkShape(t))}function dle(e){return e.some(t=>t.allowRotate())}const ule=oe.DesignerActionBase._generateNullValueStyle();function hle(e){if(e){for(let t in e)if(e.hasOwnProperty(t)){let i=e[t];if(!(C.isNullOrUndefined(i)||Array.isArray(i)&&i.length===0)&&i!==ule[t])return!1}}return!0}var In={exports:{}},ple=In.exports,BR;(function(){var e={"./src/common/util.ts":(function(a,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.Util=void 0;var l=o("sjs-spread-sheets"),c=(function(){function d(){}return d.parseFont=function(u){for(var h="",g="normal",f="normal",b=u.split(/\s+/),S=0,y=b;S<y.length;S++){var v=y[S];switch(v){case"normal":break;case"italic":h.indexOf("bold")!==-1?h="bold italic":h=v;break;case"bold":h.indexOf("italic")!==-1?h="bold italic":h=v,g="bold";break;case"100":case"200":case"300":case"400":case"500":case"600":case"700":case"800":case"900":g=v;break;case"lighter":g="lighter";break}}return h||(h="normal"),{fontStyle:h,fontWeight:g,lineHeight:f}},d._isMacOS=function(){var u=navigator.platform;return u&&u.indexOf("Mac")>-1},d.getActiveCellStyle=function(u,h,g){return u.getActualStyle(h,g)},d.getInvisibleInfo=function(u){for(var h=[],g=0;g<u.length;g++){var f=u[g];f&&h.push(g)}return h},d.getNextStartIndex=function(u,h){var g=u[h];do h++,g++;while(g===u[h]);return g},d.getContinuousVisibleInterval=function(u,h){var g=[];h=h.sort(function(y,v){return y-v});for(var f=0,b=0;b<u;)if(h.indexOf(b)>-1){g.push({startIndex:f,endIndex:b-1});var S=d.getNextStartIndex(h,h.indexOf(b));f=b=S}else b++;return f<b&&g.push({startIndex:f,endIndex:b-1}),g},d.removeHiddenRegions=function(u,h,g){var f=this,b=[];return u.forEach(function(S){var y=S.row,v=S.rowCount,x=S.col,L=S.colCount;x===-1&&(x=0),y===-1&&(y=0);for(var T=[],w=x;w<x+L;w++)h[w]||T.push(w);for(var M=[],D=y;D<y+v;D++)g[D]||M.push(D);if(M.length>0&&T.length>0){for(var P=M[0],A=1,E=1;E<M.length;E++)M[E]===M[E-1]+1?A++:(f.addVisibleRegions(b,P,A,T),P=M[E],A=1);f.addVisibleRegions(b,P,A,T)}}),b},d.addVisibleRegions=function(u,h,g,f){for(var b=f[0],S=1,y=1;y<f.length;y++)f[y]===f[y-1]+1?S++:(u.push({row:h,rowCount:g,col:b,colCount:S}),b=f[y],S=1);u.push({row:h,rowCount:g,col:b,colCount:S})},d.hasHiddenRowsOrCols=function(u,h,g){for(var f=0,b=u;f<b.length;f++){for(var S=b[f],y=S.row,v=S.rowCount,x=S.col,L=S.colCount,T=x;T<x+L;T++)if(h[T])return!0;for(var w=y;w<y+v;w++)if(g[w])return!0}return!1},d.getInvisibleRange=function(u){var h=[],g=this.getAxisInfo(u,!0),f=this.getAxisInfo(u,!1),b=u.getSelections();if(this.hasHiddenRowsOrCols(b,f,g))h=this.removeHiddenRegions(u.getSelections(),f,g);else if(b.length===1&&b[0].rowCount===1&&b[0].colCount===1){var S=this.getInvisibleInfo(f),y=this.getInvisibleInfo(g);if(S.length!==0||y.length!==0){var v=this.getContinuousVisibleInterval(u.getRowCount(),y),x=this.getContinuousVisibleInterval(u.getColumnCount(),S);v.forEach(function(L){x.forEach(function(T){var w=L.startIndex,M=L.endIndex-w+1,D=T.startIndex,P=T.endIndex-D+1,A=new l.Spread.Sheets.Range(w,D,M,P);h.push(A)})})}}return h},d.getRangeType=function(u){var h=u.row,g=u.col;return h===-1?g===-1?3:2:g===-1?1:0},d.getAxisInfo=function(u,h){var g=[];if(h)for(var f=u.getRowCount(),b=0;b<f;b++){var S=u.getRowHeight(b);g.push(S===0)}else for(var y=u.getColumnCount(),b=0;b<y;b++){var v=u.getColumnWidth(b);g.push(v===0)}return g},d.isFirefox=function(){return!!navigator.userAgent.match(/Firefox/g)},d.getBrowserCulture=function(){return navigator.language},d.getNeedAdjustSelection=function(u,h,g){for(var f=null,b=0,S=u;b<S.length;b++){var y=S[b];y.contains(h,g,1,1)&&(f=new l.Spread.Sheets.Range(y.row,y.col,y.rowCount,y.colCount))}return f},d.getCellPositionInRangeByCol=function(u,h){var g;return h===u.col||u.col===-1&&h===0?g=0:h===u.col+u.colCount-1||u.col===-1&&h===u.colCount-1?g=2:g=1,g},d.getCellPositionInRangeByRow=function(u,h){var g;return h===u.row||u.row===-1&&h===0?g=0:h===u.row+u.rowCount-1||u.row===-1&&h===u.rowCount-1?g=2:g=1,g},d.hasValue=function(u,h,g){return u.getValue(h,g)!==null||u.isReportTemplateSheet&&!!u.getTemplateCell(h,g)},d.findPreviousNotNullColIndex=function(u,h,g){for(var f=g,b=0;g>=b&&!(u.getColumnVisible(g)&&(f=g,this.hasValue(u,h,g)));)g--;return g<b&&(g=b),u.getColumnVisible(g)?g:f},d.findNextNotNullColIndex=function(u,h,g){for(var f=g,b=u.getColumnCount();g<b&&!(u.getColumnVisible(g)&&(f=g,this.hasValue(u,h,g)));)g++;return g>=b&&(g=b-1),u.getColumnVisible(g)?g:f},d.findPreviousNotNullRowIndex=function(u,h,g){for(var f=g,b=0;g>=b&&!(u.getRowVisible(g)&&(f=g,this.hasValue(u,g,h)));)g--;return g<b&&(g=b),u.getRowVisible(g)?g:f},d.findNextNotNullRowIndex=function(u,h,g){for(var f=g,b=u.getRowCount();g<b&&!(u.getRowVisible(g)&&(f=g,this.hasValue(u,g,h)));)g++;return g>=b&&(g=b-1),u.getRowVisible(g)?g:f},d.findLastNotNullColIndexInRange=function(u,h,g){for(var f=g,b=u.getColumnCount();g<b;){if(u.getColumnVisible(g))if(this.hasValue(u,h,g))f=g;else{g--;break}g++}return g>=b&&(g=b-1),u.getColumnVisible(g)?g:f},d.findFirstNotNullColIndexInRange=function(u,h,g){for(var f=g,b=0;g>=b;){if(u.getColumnVisible(g))if(this.hasValue(u,h,g))f=g;else{g++;break}g--}return g<b&&(g=b),u.getColumnVisible(g)?g:f},d.findLastNotNullRowIndexInRange=function(u,h,g){for(var f=g,b=u.getRowCount();g<b;){if(u.getRowVisible(g))if(this.hasValue(u,g,h))f=g;else{g--;break}g++}return g>=b&&(g=b-1),u.getRowVisible(g)?g:f},d.findFirstNotNullRowIndexInRange=function(u,h,g){for(var f=g,b=0;g>=b;){if(u.getRowVisible(g))if(this.hasValue(u,g,h))f=g;else{g++;break}g--}return g<b&&(g=b),u.getRowVisible(g)?g:f},d.getSheet=function(u,h){var g=u.getSheetFromName(h.sheetName);if(g===void 0){var f=u.getActiveSheetTab();if(f&&typeof f.renderMode=="function"&&f.renderMode()==="Design")return f.getTemplate()}return g},d.isRangeHasValue=function(u,h){for(var g=h.row;g<h.row+h.rowCount;g++)for(var f=h.col;f<h.col+h.colCount;f++){var b=u.getCell(g,f);if(b.text())return!0}return!1},d.getActiveSelectedRange=function(u,h,g){for(var f=0,b=u;f<b.length;f++){var S=b[f];if(S.contains(h,g))return S}},d.hasSelectedShape=function(u){if(!u.shapes)return!1;for(var h=u.shapes&&u.shapes.all(),g=h.length,f=0;f<g;f++)if(h[f]&&h[f].isSelected())return!0},d.hasSelectedChart=function(u){if(!u.charts)return!1;for(var h=u.charts&&u.charts.all(),g=h.length,f=0;f<g;f++)if(h[f]&&h[f].isSelected())return!0},d.hasSelectedPicture=function(u){if(!u.pictures)return!1;for(var h=u.pictures&&u.pictures.all(),g=h.length,f=0;f<g;f++)if(h[f]&&h[f].isSelected())return!0},d.hasSelectedSlicer=function(u){if(!u.slicers)return!1;for(var h=u.slicers&&u.slicers.all(),g=h.length,f=0;f<g;f++)if(h[f]&&h[f].isSelected())return!0},d.hasSelectedComment=function(u){if(!u.comments)return!1;for(var h=u.comments&&u.comments.all(),g=0,f=h;g<f.length;g++){var b=f[g],S=b.commentState();if(S===l.Spread.Sheets.Comments.CommentState.active||S===l.Spread.Sheets.Comments.CommentState.edit)return!0}},d.hasSelectedFloatingObject=function(u){if(!u.floatingObjects)return!1;for(var h=u.floatingObjects&&u.floatingObjects.all(),g=h.length,f=0;f<g;f++)if(h[f]&&h[f].isSelected())return!0},d.hasSelectedShapeOrFloatingObject=function(u){return!!(this.hasSelectedShape(u)||this.hasSelectedFloatingObject(u)||this.hasSelectedChart(u)||this.hasSelectedPicture(u)||this.hasSelectedSlicer(u)||this.hasSelectedComment(u))},d.needCheckProtectionOptions=function(u){return u?u.isActualProtected()&&!!u.options.protectionOptions:!1},d.containLockedCellsInSelections=function(u){for(var h=u.getSelections(),g=!1,f=u.getRowCount(),b=u.getColumnCount(),S=0;S<h.length;S++){var y=h[S],v=y.row,x=y.col,L=this.adjustSelection(u,h[S],f,b),T=L.rowCount,w=L.colCount;this.containsLockedCellsInSelection(u,v,x,T,w)&&(g=!0)}return g},d.adjustSelection=function(u,h,g,f){var b=h.row,S=h.col,y=h.rowCount,v=h.colCount;return g=g!=null?g:u.getRowCount(),f=f!=null?f:u.getColumnCount(),b===-1&&(b=0,y=g),S===-1&&(S=0,v=f),y=b+y>g?g-b:y,v=S+v>f?f-S:v,new l.Spread.Sheets.Range(b,S,y,v)},d.containsLockedCellsInSelection=function(u,h,g,f,b){h=h<0?0:h,g=g<0?0:g;for(var S=h;S<h+f;S++)for(var y=g;y<g+b;y++)if(u.getCell(S,y).locked())return!0},d})();r.Util=c}),"./src/shell/action.base.ts":(function(a,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.executeCommand=r.ShortcutActionBase=r.Commands=void 0;var l=o("sjs-spread-sheets"),c=o("./src/common/util.ts");r.Commands={};var d=(function(){function h(g,f){this._spread=g,this._options=f}return h.prototype.canExecute=function(){return!0},h.prototype.canUndo=function(){return!0},h.prototype.undoImp=function(g,f,b){return g.suspendPaint(),l.Spread.Sheets.Commands.undoTransaction(g,f),g.resumePaint(),!0},h.prototype.execute=function(g,f,b){var S=this,y=!1;if(b)y=S.undoImp.call(S,g,f,b);else if(S.canExecute()){var v=l.Spread.Sheets.Commands;v.startTransaction(g,f),g.suspendPaint();try{y=S.executeImp()}finally{g.resumePaint(),v.endTransaction(g,f)}}return y},h.prototype.getSheet=function(){return c.Util.getSheet(this._spread,this._options)},h.prototype.getSpread=function(){return this._spread},h.prototype.setCellStyle=function(g){var f=this,b=f.getSheet(),S=f._options.selections;b.suspendPaint(),S.forEach(function(y){var v=y.row,x=y.col,L=y.rowCount,T=y.colCount,w=b.getRange(v,x,L,T);g(w)}),b.resumePaint()},h.prototype.getFontStyle=function(g,f,b){var S=document.createElement("span");if(g)S.style.font=g;else return b;return S.style[f]=b,S.style.font},h.prototype._canEditInActiveCell=function(){var g=this,f=g._options,b=f.activeRowIndex,S=f.activeColIndex,y=g.getSheet();return g._isProtectCell(y,b,S)||g._isReadonlyCellType(y,b,S)?!1:g._isAllowEditInCell(y,b,S)},h.prototype._isProtectCell=function(g,f,b){if(g.isActualProtected()){var S=g.getActualStyle(f,b);if(S)return S.locked!==!1}return!1},h.prototype._isReadonlyCellType=function(g,f,b){var S=g.getCellType(f,b);if(S){var y={sheet:g,sheetName:g.name(),sheetArea:l.Spread.Sheets.SheetArea.viewport,readonly:!1,row:f,col:b};return S.isReadonly(y)}return!1},h.prototype._isAllowEditInCell=function(g,f,b){var S=g.getActualStyle(f,b);return S?S.allowEditInCell!==!1:!0},h})();r.ShortcutActionBase=d;function u(h,g,f,b){var S=c.Util.getSheet(h,f);f.selections||(f.selections=S.getSelections()),f.activeRowIndex===void 0&&(f.activeRowIndex=S.getActiveRowIndex()),f.activeColIndex===void 0&&(f.activeColIndex=S.getActiveColumnIndex());var y=new g(h,f);return y.execute(h,f,!!b)}r.executeCommand=u}),"./src/shortcut/action.calc.ts":(function(a,r,o){var l=this&&this.__extends||(function(){var x=function(L,T){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,M){w.__proto__=M}||function(w,M){for(var D in M)Object.prototype.hasOwnProperty.call(M,D)&&(w[D]=M[D])},x(L,T)};return function(L,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");x(L,T);function w(){this.constructor=L}L.prototype=T===null?Object.create(T):(w.prototype=T.prototype,new w)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.initShortcutAboutCalc=void 0;var c=o("./src/shell/action.base.ts"),d=o("sjs-spread-sheets"),u=o("./src/common/util.ts"),h=d.Spread.Sheets.VerticalPosition,g=d.Spread.Sheets.HorizontalPosition,f=d.Spread.Sheets.CalcEngine.rangeToFormula,b=d.Spread.Sheets.CalcEngine.RangeReferenceRelative.allRelative,S="insertSumFunction",y=(function(x){l(L,x);function L(){return x!==null&&x.apply(this,arguments)||this}return L.prototype.canExecute=function(){return x.prototype._canEditInActiveCell.call(this)},L.prototype.executeImp=function(){var T,w,M=this,D=M.getSheet(),P=!1;if(D.editorStatus()===d.Spread.Sheets.EditorStatus.enter||D.editorStatus()===d.Spread.Sheets.EditorStatus.edit)return D.endEdit(),!1;var A=M._options,E=A.selections,O=(T=A.activeRowIndex)!==null&&T!==void 0?T:D.getActiveRowIndex(),I=(w=A.activeColIndex)!==null&&w!==void 0?w:D.getActiveColumnIndex(),R=new d.Spread.Sheets.Range(O,I,1,1),k=E,N="SUM",B=!0;D.suspendCalcService();var F=!0,j;if(M.getSelectionTypeWithSelection(E)===3){P=E.length===1&&(E[0].rowCount===1&&E[0].colCount===1||E[0].rowCount!==1&&E[0].colCount!==1);for(var K=0,Q=E;K<Q.length;K++){var X=Q[K],ne=D.tables.find(E[0].row,E[0].col);if(ne){var ce=ne.dataRange();X.row===ce.row&&X.rowCount===ce.rowCount&&X.col+X.colCount<=ce.col+ce.colCount&&(ne.showFooter()||ne.showFooter(!0))}try{j=M.setFormulaForSingleRange(X,N,O,I,P,B)}catch{F=!1;break}}}if(D.resumeCalcService(),F){if(j){var fe=j.editingRowIndex,J=j.editingColIndex;(O!==fe||I!==J)&&D.setActiveCell(fe,J)}if(!P){var V=k,Z=[];D.suspendPaint();for(var Y in V)if(V.hasOwnProperty(Y)){var W=D.expandSelection(D,V[Y]);V[Y].row=W.row,V[Y].col=W.col,V[Y].rowCount=W.rowCount,V[Y].colCount=W.colCount,V[Y].containsRange(R)?D.setSelection(W.row,W.col,W.rowCount,W.colCount):Z.push(V[Y])}if(Z.length>0)for(var H=0,$=Z;H<$.length;H++){var ee=$[H];D.addSelection(ee.row,ee.col,ee.rowCount,ee.colCount)}D.resumePaint()}}else if(E.length===1&&E[0].rowCount===1&&E[0].colCount===1){var ae="=SUM()";D.inputFormulaAndSelectFormulaRange(E[0].row,E[0].col,!1,ae)}return F},L.prototype.getSelectionTypeWithSelection=function(T){for(var w,M=0,D=T;M<D.length;M++){var P=D[M];if(P.col===-1&&P.row===-1)return 0;if(P.row===-1){if(w===void 0)w=2;else if(w!==2)return 4}else if(P.col===-1){if(w===void 0)w=1;else if(w!==1)return 4}else if(w===void 0)w=3;else if(w!==3)return 4}return w},L.prototype._noNeedSetFormula=function(T,w){var M=this.getSheet(),D=M.getStyle(T,w);return!!(D&&(D.cellType||D.cellButtons))},L.prototype.calculateValidRange=function(T,w,M,D){var P=T,A=w,E=M,O=D;if(P!==-1&&A!==-1){var I=this.getSheet().getSpans();if(I&&I.length>0){var R=this.cellRangeInflate(I,new d.Spread.Sheets.Range(T,w,M,D));P=R.row,A=R.col,E=R.rowCount,O=R.colCount}}return{row:P,col:A,rowCount:E,colCount:O}},L.prototype.cellRangeInflate=function(T,w){for(var M=T&&T.length,D=0;D<M;D++){var P=T[D];if(w.intersect(P.row,P.col,P.rowCount,P.colCount))return T.splice(D,1),this.cellRangeInflate(T,w.union(P))}return w},L.prototype.getFormulaRange=function(T){var w=this,M=w.getSheet(),D=M.getValue(T.row,T.col-1),P=M.getValue(T.row-1,T.col),A=!1;A=w.getStartRangeDirection(T,M,D,P);var E=w.calculateRange(A,T),O=E.row,I=E.col,R=E.rowCount,k=E.colCount;if(I===void 0&&O===void 0)return T;if(I===void 0){var N=O;return w.calculateValidRange(N,T.col,T.row-N,k)}return w.calculateValidRange(T.row,I,R,T.col-I)},L.prototype.calculateRange=function(T,w){var M,D,P=1,A=1,E=this.getSheet(),O=!1;if(T===!1)for(var I=w.row-1;I>=0;I--){var R=E.getValue(I,w.col);if(this.valueIsNumber(R)&&E.getFormula(I,w.col)!==null){O=!0,M=I;break}if(this.valueIsNumber(R))O=!0,I===0&&(M=0);else if(O===!0&&!this.valueIsNumber(R)){M=I+1;break}}if(!O)for(var I=w.col-1;I>=0;I--){var R=E.getValue(w.row,I);if(this.valueIsNumber(R))O=!0,I===0&&(D=0);else if(O===!0&&!this.valueIsNumber(R)){D=I+1;break}}return{row:M,col:D,rowCount:P,colCount:A}},L.prototype.getStartRangeDirection=function(T,w,M,D){for(var P=!1,A=!1,E=!1,O=T.col-1;O>=0;O--){var I=w.getValue(T.row,O),R=w.getFormula(T.row,O);if(R)break;if(this.valueIsNumber(I)){P=!0;break}}for(var O=T.row-1;O>=0;O--){var I=w.getValue(O,T.col),R=w.getFormula(O,T.col);if(R){A=!0;break}if(this.valueIsNumber(I))break}return(this.valueIsNumber(M)&&!this.valueIsNumber(D)||P&&A)&&(E=!0),E},L.prototype.valueIsNumber=function(T){return typeof T=="number"},L.prototype.getSpan=function(T,w){return new d.Spread.Sheets.Range(T,w,1,1)},L.prototype.setFormulaForSingleRange=function(T,w,M,D,P,A){var E=this,O=E.getSheet(),I=O.getParent(),R=T.row,k=T.col,N=E.getSpan(R,k),B=!1;N&&N.equals(T)&&(B=!0);var F=I.options.referenceStyle===1,j=T.row,K=T.col;if(T.colCount===1&&T.rowCount===1||B)E.setFormulaToSingleCell(T,w,F,P,A);else if(T.colCount===1){var Q=R+T.rowCount-1,X=k;if(O.getText(R,X))if(O.getText(Q,X)){for(;Q<O.getRowCount()&&O.getText(Q,X);)Q++;j=Math.min(Q,O.getRowCount()-1);var J=f(T,j,X,b,F);E.setFormulaToSheet(O,j,X,w,J,P,A)}else{var fe={row:R,col:X,colCount:T.colCount,rowCount:T.rowCount-1};j=Q;var J=f(fe,Q,X,b,I.options.referenceStyle===1);E.setFormulaToSheet(O,Q,X,w,J,P,A)}else{var ne=new d.Spread.Sheets.Range(R,X,1,1);E.setFormulaToSingleCell(ne,w,F,P,A);for(var ce=1;ce<T.rowCount;ce++)O.copyTo(R,X,R+ce,X,1,1,d.Spread.Sheets.CopyToOptions.formula)}}else if(T.rowCount===1){var V=R,Z=k+T.colCount-1;if(O.getText(V,k))if(O.getText(V,Z)){for(;Z<O.getColumnCount()&&O.getText(V,Z);)Z++;K=Math.min(Z,O.getColumnCount()-1);var J=f(T,V,Z,b,F);E.setFormulaToSheet(O,V,Z,w,J,P,A)}else{var fe={row:V,col:k,colCount:T.colCount-1,rowCount:T.rowCount};K=Z;var J=f(fe,V,Z,b,F);E.setFormulaToSheet(O,V,Z,w,J,P,A)}else{var ne=new d.Spread.Sheets.Range(V,k,1,1);E.setFormulaToSingleCell(ne,w,F,P,A);for(var Y=1;Y<T.colCount;Y++)O.copyTo(V,k,V,k+Y,1,1,d.Spread.Sheets.CopyToOptions.formula)}}else{var W=T.row<=M&&M<=T.row+T.rowCount&&T.col<=D&&D<=T.col+T.colCount,H=W?M:T.row,$=W?D:T.col,ee=!!O.getText(H,$);if(ee)E.setMultiRowColRangeFormula(T,w);else if(P)E.setFormulaToSingleCell(new d.Spread.Sheets.Range(H,$,1,1),w,F,P,A);else{var ne=new d.Spread.Sheets.Range(H,$,1,1);E.setFormulaToSingleCell(ne,w,F,P,A);for(var ce=0;ce<T.rowCount;ce++)for(var Y=0;Y<T.colCount;Y++){var ae=T.row+ce,de=T.col+Y;(ae!==H||de!==$)&&O.copyTo(H,$,ae,de,1,1,d.Spread.Sheets.CopyToOptions.formula)}}}return{editingRowIndex:j,editingColIndex:K}},L.prototype.setFormulaToSingleCell=function(T,w,M,D,P){var A=this,E=A.getSheet(),O=T.row,I=T.col;if(!A._noNeedSetFormula(O,I)){var R=A.getFormulaRange(T);if(R){var k=void 0;R.rowCount!==1||R.colCount!==1||R.row!==O||R.col!==I?k=f(R,O,I,b,M):k="",A.setFormulaToSheet(E,O,I,w,k,D,P)}}},L.prototype.setFormulaToSheet=function(T,w,M,D,P,A,E){for(var O=E&&A?"="+D+"()":"="+D+"("+P+")",I=T.getSpans(this.getSpan(w,M)),R=0,k=I;R<k.length;R++){var N=k[R];if(N.row!==w||N.col!==M)throw new Error("can't insert formula in span")}A?(T.inputFormulaAndSelectFormulaRange(w,M,!1,O,P,E),T.setEditorStatus(d.Spread.Sheets.EditorStatus.enter)):T.setFormula(w,M,O),T.showCell(w,M,h.nearest,g.nearest)},L.prototype.setMultiRowColRangeFormula=function(T,w){for(var M=this,D=T.row+T.rowCount-1,P=T.col+T.colCount-1,A=M.getSheet(),E=!0,O=!0,I=T.col;I<T.col+T.colCount;I++)if(A.getValue(D,I)){E=!1;break}for(var I=T.row;I<T.row+T.rowCount;I++)if(A.getValue(I,P)){O=!1;break}O?(!E&&O||M.setWholeRowFormula(E,D,T,w),M.setWholeColFormula(P,T,w)):M.setWholeRowFormula(E,D,T,w)},L.prototype.setWholeRowFormula=function(T,w,M,D){for(var P=T?w:w+1,A=this,E=M.col;E<M.col+M.colCount;E++){for(var O=!0,I=M.row;I<M.row+M.rowCount;I++)if(A.getSheet().getCell(I,E).value()!==null){O=!1;break}if(!O){if(A._noNeedSetFormula(P,E))break;var R={col:E,colCount:1,row:M.row,rowCount:M.rowCount+(T?-1:0)},k=f(R,P,E,b,A.getSpread().options.referenceStyle===1);k="="+D+"("+k+")",A.getSheet().setFormula(P,E,k),A.getSheet().showCell(P,E,h.nearest,g.nearest)}}},L.prototype.setWholeColFormula=function(T,w,M){for(var D=this,P=w.row;P<w.row+w.rowCount;P++){for(var A=!0,E=w.col;E<w.col+w.colCount;E++)if(D.getSheet().getCell(P,E).value()!==null){A=!1;break}if(!A){if(D._noNeedSetFormula(P,T))break;var O={col:w.col,colCount:w.colCount-1,row:P,rowCount:1},I=f(O,P,T-1,b,D.getSpread().options.referenceStyle===1);I="="+M+"("+I+")",D.getSheet().setFormula(P,T,I),D.getSheet().showCell(P,T,h.nearest,g.nearest)}}},L})(c.ShortcutActionBase);c.Commands[S]={canUndo:!0,execute:function(x,L,T){return L.cmd=S,(0,c.executeCommand)(x,y,L,T)}};function v(x){u.Util.isFirefox()?x.register(S,c.Commands[S],61,!1,!1,!0,!1):x.register(S,c.Commands[S],187,!1,!1,!0,!1)}r.initShortcutAboutCalc=v}),"./src/shortcut/action.cell.ts":(function(a,r,o){var l=this&&this.__extends||(function(){var L=function(T,w){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,D){M.__proto__=D}||function(M,D){for(var P in D)Object.prototype.hasOwnProperty.call(D,P)&&(M[P]=D[P])},L(T,w)};return function(T,w){if(typeof w!="function"&&w!==null)throw new TypeError("Class extends value "+String(w)+" is not a constructor or null");L(T,w);function M(){this.constructor=T}T.prototype=w===null?Object.create(w):(M.prototype=w.prototype,new M)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.initShortcutAboutCell=void 0;var c=o("./src/shell/action.base.ts"),d=o("sjs-spread-sheets"),u=o("./src/common/util.ts"),h="setDate",g="copyCellDown",f="copyCellRight",b=d.Spread.Sheets.VerticalPosition,S=d.Spread.Sheets.HorizontalPosition,y=(function(L){l(T,L);function T(){return L!==null&&L.apply(this,arguments)||this}return T.prototype.canExecute=function(){return L.prototype._canEditInActiveCell.call(this)},T.prototype.executeImp=function(){var w=this,M=w.getSheet(),D=w._options;M.suspendPaint();var P=D.activeRowIndex,A=D.activeColIndex,E=D.date;M.startEdit();var O=M.getCellType(P,A);if(O&&O.setEditorValue){var I=M.getCellTypeEditElement(P,A);O.setEditorValue(I,E==null?void 0:E.toLocaleDateString()),O.focus(I)}return M.showCell(P,A,b.nearest,S.nearest),M.resumePaint(),!0},T.prototype.canUndo=function(){return!0},T})(c.ShortcutActionBase);c.Commands[h]={canUndo:!1,execute:function(L,T,w){var M,D,P=u.Util.getSheet(L,T);if(!w&&!T.cmd){T.cmd=h;var A=(M=T.activeRowIndex)!==null&&M!==void 0?M:P.getActiveRowIndex(),E=(D=T.activeColIndex)!==null&&D!==void 0?D:P.getActiveColumnIndex(),O=new Date;O.setHours(0,0,0,0);var I=P.getValue(A,E);if(I instanceof Date&&I.getTime()===O.getTime())return!1;T.date=O}return(0,c.executeCommand)(L,y,T,w)}};var v=(function(L){l(T,L);function T(){return L!==null&&L.apply(this,arguments)||this}return T.prototype.executeImp=function(){var w=this,M=w.getSheet(),D=w._options.selections,P=w._options;if(D.length===1){var A=D[0],E=A.row,O=A.col;if(P.direction===d.Spread.Sheets.Fill.FillDirection.right&&A.colCount===1){var I=A;if(I.col===0)return!0;var R=M.tables.find(I.row,I.col-1);if(R){var k=u.Util.isRangeHasValue(M,new d.Spread.Sheets.Range(I.row,I.col-1,I.rowCount,1));return k&&(R.range().intersect(I.row,I.col,1,1)||R.insertColumns(R.dataRange().colCount-1,1,!0),A.rowCount>1&&I.row===R.range().row?M.copyTo(I.row+1,I.col-1,I.row+1,I.col,I.rowCount-1,1,d.Spread.Sheets.CopyToOptions.value):M.copyTo(I.row,I.col-1,I.row,I.col,I.rowCount,1,d.Spread.Sheets.CopyToOptions.value)),!0}return M.copyTo(I.row,I.col-1,I.row,I.col,I.rowCount,1,d.Spread.Sheets.CopyToOptions.all),!0}else if(P.direction===d.Spread.Sheets.Fill.FillDirection.down&&A.rowCount===1){var I=A;if(I.row===0)return!0;var R=M.tables.find(I.row-1,I.col);return R?(R.range().intersect(I.row,I.col,1,1)||R.insertRows(R.dataRange().rowCount-1,1,!0),M.copyTo(I.row-1,I.col,I.row,I.col,1,I.colCount,d.Spread.Sheets.CopyToOptions.value),!0):(M.copyTo(I.row-1,I.col,I.row,I.col,1,I.colCount,d.Spread.Sheets.CopyToOptions.all),!0)}var N=null,B=void 0;switch(P.direction){case d.Spread.Sheets.Fill.FillDirection.down:E>0&&(N=new d.Spread.Sheets.Range(E,O,1,A.colCount),B=new d.Spread.Sheets.Range(E,O,A.rowCount,A.colCount));break;case d.Spread.Sheets.Fill.FillDirection.right:O>0&&(N=new d.Spread.Sheets.Range(E,O,A.rowCount,1),B=new d.Spread.Sheets.Range(E,O,A.rowCount,A.colCount));break}if(N&&B){try{M.fillAuto(N,B,{fillType:d.Spread.Sheets.Fill.FillType.direction,direction:P.direction})}catch{}M.showCell(N.row,N.col,b.nearest,S.nearest)}}return!0},T})(c.ShortcutActionBase);c.Commands[g]={canUndo:!0,execute:function(L,T,w){T.cmd=g;var M=u.Util.getSheet(L,T);if(M.isActualProtected())return!0;var D=T.selections||M.getSelections();return D.length>0?(T.direction=d.Spread.Sheets.Fill.FillDirection.down,(0,c.executeCommand)(L,v,T,w)):!0}},c.Commands[f]={canUndo:!0,execute:function(L,T,w){T.cmd=f;var M=u.Util.getSheet(L,T);if(M.isActualProtected()||u.Util.hasSelectedShapeOrFloatingObject(M))return!0;var D=T.selections||M.getSelections();return D.length>0?(T.direction=d.Spread.Sheets.Fill.FillDirection.right,(0,c.executeCommand)(L,v,T,w)):!0}};function x(L){var T=u.Util._isMacOS(),w=!T,M=T;u.Util.isFirefox()?L.register(h,c.Commands[h],59,w,!1,!1,M):L.register(h,c.Commands[h],186,w,!1,!1,M),L.register(g,c.Commands[g],68,w,!1,!1,M),L.register(f,c.Commands[f],82,w,!1,!1,M)}r.initShortcutAboutCell=x}),"./src/shortcut/action.row.column.ts":(function(a,r,o){var l=this&&this.__extends||(function(){var D=function(P,A){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,O){E.__proto__=O}||function(E,O){for(var I in O)Object.prototype.hasOwnProperty.call(O,I)&&(E[I]=O[I])},D(P,A)};return function(P,A){if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");D(P,A);function E(){this.constructor=P}P.prototype=A===null?Object.create(A):(E.prototype=A.prototype,new E)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.initShortcutAboutRowsAndColumns=void 0;var c=o("sjs-spread-sheets"),d=o("./src/shell/action.base.ts"),u=o("./src/common/util.ts"),h=c.Spread.Sheets.VerticalPosition,g=c.Spread.Sheets.HorizontalPosition,f="deleteEntireRowOrColumn",b="hideSelectRows",S="groupSelectRange",y="ungroupSelectRange",v="InsertRowOrColumn",x=(function(D){l(P,D);function P(){return D!==null&&D.apply(this,arguments)||this}return P.prototype.executeImp=function(){var A,E,O=this,I=O.getSheet(),R=O._options,k=(A=R.activeRowIndex)!==null&&A!==void 0?A:I.getActiveRowIndex(),N=(E=R.activeColIndex)!==null&&E!==void 0?E:I.getActiveColumnIndex(),B=R.isDelete,F=0;if(R.isRow){var j=R.rowInfos;if(j)if(B){if(I.isActualProtected())return!0;for(F=j.length-1;F>=0;F--){var K=j[F];I.deleteRows(K.startRowIndex,K.rowCount)}}else{if(I&&u.Util.needCheckProtectionOptions(I)&&!I.options.protectionOptions.allowInsertRows)return!0;for(F=0;F<j.length;F++){var K=j[F];I.addRows(K.startRowIndex,K.rowCount)}}}else{var Q=R.colInfos;if(Q)if(B){if(I.isActualProtected())return!0;for(F=Q.length-1;F>=0;F--){var X=Q[F];I.deleteColumns(X.startColIndex,X.colCount)}}else{if(I&&u.Util.needCheckProtectionOptions(I)&&!I.options.protectionOptions.allowInsertColumns)return!0;for(F=0;F<Q.length;F++){var X=Q[F];I.addColumns(X.startColIndex,X.colCount)}}}return I.showCell(k,N,h.nearest,g.nearest),!0},P})(d.ShortcutActionBase);function L(D,P){if(D.length===0)return!1;if(D.length===1){var A=D[0],E=u.Util.getRangeType(A);if(E===3)return!0;if(E===2)P.isRow=!1,P.colInfos=[{startColIndex:A.col,colCount:A.colCount}];else if(E===1)P.isRow=!0,P.rowInfos=[{startRowIndex:A.row,rowCount:A.rowCount}];else return!0}else{var O=u.Util.getRangeType(D[0]);if(O===0||O===3)return!0;O===2?P.isRow=!1:O===1&&(P.isRow=!0),P.rowInfos=[],P.colInfos=[];for(var I=0,R=D;I<R.length;I++){var A=R[I],E=u.Util.getRangeType(A);if(E!==O)return!0}D.forEach(function(k){var N=u.Util.getRangeType(k);N===1?P.rowInfos&&P.rowInfos.push({startRowIndex:k.row,rowCount:k.rowCount}):N===2&&P.colInfos&&P.colInfos.push({startColIndex:k.col,colCount:k.colCount})})}}d.Commands[f]={canUndo:!0,execute:function(D,P,A){var E=u.Util.getSheet(D,P);if(E.isActualProtected())return!0;if(P.cmd=f,!A){P.isDelete=!0;var O=P.selections||E.getSelections(),I=O.filter(function(R){return!(R.colCount===1&&R.rowCount===1)});L(I,P)}return(0,d.executeCommand)(D,x,P,A)}},d.Commands[v]={canUndo:!0,execute:function(D,P,A){var E=u.Util.getSheet(D,P);if(P.cmd=v,!A){P.isDelete=!1;var O=P.selections||E.getSelections();L(O,P)}return(0,d.executeCommand)(D,x,P,A)}};var T=(function(D){l(P,D);function P(){return D!==null&&D.apply(this,arguments)||this}return P.prototype.executeImp=function(){var A,E,O=this,I=O.getSheet(),R=O._options,k=R.rowInfo;if(k.length>0){I.suspendPaint(),I.suspendEvent();var N=(A=R.activeRowIndex)!==null&&A!==void 0?A:I.getActiveRowIndex(),B=(E=R.activeColIndex)!==null&&E!==void 0?E:I.getActiveColumnIndex();return k.forEach(function(F){for(var j=F.startRowIndex<0?0:F.startRowIndex,K=F.rowCount,Q=j+K,X=j;X<Q;X++)I.setRowVisible(X,!1)}),I.showCell(N,B,h.nearest,g.nearest),I.resumeEvent(),I.resumePaint(),!0}return!1},P})(d.ShortcutActionBase);d.Commands[b]={canUndo:!0,execute:function(D,P,A){P.cmd=b;var E=u.Util.getSheet(D,P);if(E&&u.Util.needCheckProtectionOptions(E)&&!E.options.protectionOptions.allowResizeRows)return!0;var O=P.selections||E.getSelections(),I=[];return!A&&O.length>0&&(O.forEach(function(R){var k=R.row,N=R.rowCount;I.push({startRowIndex:k,rowCount:N})}),P.rowInfo=I),(0,d.executeCommand)(D,T,P,A)}};var w=(function(D){l(P,D);function P(){return D!==null&&D.apply(this,arguments)||this}return P.prototype.executeImp=function(){var A=this,E=A._options,O=A.getSheet(),I=E.selection,R=E.isGroup;if(!I)return!1;var k=u.Util.getRangeType(I);try{if(O.suspendPaint(),k===2){var N=I.col,B=I.colCount;R?O.columnOutlines.group(N,B):O.columnOutlines.ungroupRange(N,B),O.showCell(0,N,h.nearest,g.nearest)}else if(k===1){var F=I.row,j=I.rowCount;R?O.rowOutlines.group(F,j):O.rowOutlines.ungroupRange(F,j),O.showCell(F,0,h.nearest,g.nearest)}}finally{O.resumePaint()}return!0},P.prototype.canUndo=function(){return!0},P})(d.ShortcutActionBase);d.Commands[S]={canUndo:!0,execute:function(D,P,A){var E=u.Util.getSheet(D,P);if(P.cmd=S,!A){var O=P.selections||E.getSelections();if(P.isGroup=!0,O.length===1){var I=O[0],R=u.Util.getRangeType(I);if((R===1||R===2)&&(P.selection=I),R===1&&E.rowOutlines.getMaxLevel()>=6)return!1;if(R===2&&E.columnOutlines.getMaxLevel()>=6)return!1}}return P.selection?(0,d.executeCommand)(D,w,P,A):!1}},d.Commands[y]={canUndo:!0,execute:function(D,P,A){var E=u.Util.getSheet(D,P);if(P.cmd=y,!A){var O=P.selections||E.getSelections();if(P.isGroup=!1,O.length===1){var I=O[0],R=u.Util.getRangeType(I);(R===1||R===2)&&(P.selection=I)}}return P.selection?(0,d.executeCommand)(D,w,P,A):!1}};function M(D){var P=u.Util._isMacOS(),A=!P,E=P;D.register(b,d.Commands[b],57,A,!1,!1,E),D.register(b,d.Commands[b],105,A,!1,!1,E),D.register(S,d.Commands[S],39,!1,!0,!0,!1),D.register(y,d.Commands[y],37,!1,!0,!0,!1),D.register(f,d.Commands[f],109,A,!1,!1,E),D.register(v,d.Commands[v],107,A,!0,!1,E),u.Util.isFirefox()?(D.register(f,d.Commands[f],173,A,!1,!1,E),D.register(v,d.Commands[v],61,A,!0,!1,E)):(D.register(f,d.Commands[f],189,A,!1,!1,E),D.register(v,d.Commands[v],187,A,!0,!1,E))}r.initShortcutAboutRowsAndColumns=M}),"./src/shortcut/action.selection.ts":(function(a,r,o){var l=this&&this.__assign||function(){return l=Object.assign||function(J){for(var V,Z=1,Y=arguments.length;Z<Y;Z++){V=arguments[Z];for(var W in V)Object.prototype.hasOwnProperty.call(V,W)&&(J[W]=V[W])}return J},l.apply(this,arguments)};Object.defineProperty(r,"__esModule",{value:!0}),r.initShortcutAboutSelection=void 0;var c=o("./src/shell/action.base.ts"),d=o("sjs-spread-sheets"),u=o("./src/common/util.ts"),h="selectEntireRow",g="goToSheetBeginning",f="selectEntireColumn",b="goToSheetBottomRight",S="goToPrecedent",y="selectVisibleCells",v="goToDependents",x="SelectAll",L="selectionHome",T="selectionEnd",w="selectionTop",M="selectionBottom",D="gotoNextTopNonNullCell",P="gotoNextBottomNonNullCell",A="gotoNextLeftNonNullCell",E="gotoNextRightNonNullCell",O=d.Spread.Sheets.VerticalPosition,I=d.Spread.Sheets.HorizontalPosition;c.Commands[h]={canUndo:!1,execute:function(J,V){var Z=u.Util.getSheet(J,V);if(V.cmd=h,Z.editorStatus()===d.Spread.Sheets.EditorStatus.ready){var Y=Z.getSelections(),W=Y.length-1,H=Y[W];return H&&(H.col=-1,H.colCount=Z.getColumnCount(),Z.repaint()),!0}return!1}},c.Commands[f]={canUndo:!1,execute:function(J,V){var Z=u.Util.getSheet(J,V);if(V.cmd=f,Z.editorStatus()===d.Spread.Sheets.EditorStatus.ready){var Y=Z.getSelections(),W=Y.length-1,H=Y[W];return H&&(H.row=-1,H.rowCount=Z.getRowCount(),Z.repaint()),!0}return!1}},c.Commands[g]={canUndo:!1,execute:function(J,V){var Z=u.Util.getSheet(J,V);return V.cmd=g,Z.editorStatus()===d.Spread.Sheets.EditorStatus.ready&&Z.canSelect(0,0)?(Z.suspendPaint(),Z.showCell(0,0,d.Spread.Sheets.VerticalPosition.nearest,d.Spread.Sheets.HorizontalPosition.nearest),Z.setSelection(0,0,1,1),Z.resumePaint(),!0):!1}},c.Commands[b]={canUndo:!1,execute:function(J,V){var Z=u.Util.getSheet(J,V);if(V.cmd=b,Z.editorStatus()===d.Spread.Sheets.EditorStatus.ready){var Y=Z.getLastNonNullRow(),W=Z.getLastNonNullColumn();return Z.canSelect(Y,W)?(Z.showCell(Y,W,O.nearest,I.nearest),Z.setSelection(Y,W,1,1),!0):!1}return!1}};function R(J,V,Z){var Y=Z.selections||J.getSelections(),W=[];return Y.forEach(function(H){var $=H.row,ee=H.col,ae=H.rowCount,de=H.colCount;ae===-1&&(ae=1),de===-1&&(de=1);for(var he=$;he<$+ae;he++)for(var be=ee;be<ee+de;be++)V?W=W.concat(J.getPrecedents(he,be)):W=W.concat(J.getDependents(he,be))}),W}function k(J,V,Z){var Y,W;if(Z){if(J.row===V.row&&J.rowCount===V.rowCount){var H=J.col<V.col?[J,V]:[V,J],$=H[0],ee=H[1],ae=$.col+((Y=$.colCount)!==null&&Y!==void 0?Y:1),de=$.col;return ee.col>=de&&ee.col<=ae}}else if(J.col===V.col&&J.colCount===V.colCount){var he=J.row<V.row?[J,V]:[V,J],be=he[0],Le=he[1],Fe=be.row+((W=be.rowCount)!==null&&W!==void 0?W:1),q=be.row;return Le.row>=q&&Le.row<=Fe}return!1}function N(J){var V,Z,Y,W,H=J.length;if(H===1)return J;if(H===0)return[];for(var $=0;$<H;$++)for(var ee=$+1;ee<H;ee++){var ae=J[$],de=J[ee];if(!de||ae.sheetName!==de.sheetName)break;if(k(ae,de,!0)){var he=Math.min(ae.col,de.col),be=Math.max(ae.col+((V=ae.colCount)!==null&&V!==void 0?V:1),de.col+((Z=de.colCount)!==null&&Z!==void 0?Z:1)),Le=be-he,Fe={sheetName:ae.sheetName,row:ae.row,rowCount:ae.rowCount,col:he,colCount:Le};J.splice(ee,1),J.splice($,1,Fe);break}else if(k(ae,de,!1)){var q=Math.min(ae.row,de.row),se=Math.max(ae.row+((Y=ae.rowCount)!==null&&Y!==void 0?Y:1),de.row+((W=de.rowCount)!==null&&W!==void 0?W:1)),ue=se-q,Fe={sheetName:ae.sheetName,row:q,rowCount:ue,col:ae.col,colCount:ae.colCount};J.splice(ee,1),J.splice($,1,Fe);break}}return J.length===H?J:N(J)}function B(J,V){for(var Z=0;Z<V.length;Z++){var Y=V[Z],W=Y.row,H=Y.col,$=Y.rowCount,ee=Y.colCount;Z===0?$===1&&ee===1?(J.setActiveCell(W,H),J.showCell(W,H,O.nearest,I.nearest)):J.setSelection(W,H,$,ee):J.addSelection(W,H,$,ee)}}function F(J,V,Z){var Y=V.sheetName,W=u.Util.getSheet(J,V);if(W.isActualProtected()&&u.Util.containLockedCellsInSelections(W)){var H=d.Spread.Sheets.Designer.getResources();return d.Spread.Sheets.Designer.showMessageBox(H.isProtected,H.title,d.Spread.Sheets.Designer.MessageBoxIcon.warning),!1}var $=R(W,Z,V);if($.sort(function(Fe,q){return Fe.sheetName===Y&&q.sheetName!==Y?-1:Fe.sheetName!==Y&&q.sheetName===Y?1:0}),$.length>0&&W.editorStatus()===d.Spread.Sheets.EditorStatus.ready){W.suspendPaint(),$=N($);for(var ee=Y,ae=[],de=0;de<$.length;de++){var he=$[de],be=he.sheetName;if(de===0)ee=be;else if(be!==ee)continue;ae.push(he)}var Le=W;return ee!==Y&&(Le=u.Util.getSheet(J,l(l({},V),{sheetName:ee})),Le instanceof d.Spread.Sheets.Worksheet?J.setActiveSheet(ee):d.Spread.Report&&Le instanceof d.Spread.Report.ReportSheet&&Le.renderMode()==="Design"&&J.setActiveSheetTab(ee)),B(Le,ae),W.resumePaint(),!0}return!1}c.Commands[v]={canUndo:!1,execute:function(J,V,Z){return F(J,V,!1)}},c.Commands[S]={canUndo:!1,execute:function(J,V,Z){return F(J,V,!0)}},c.Commands[y]={canUndo:!1,execute:function(J,V,Z){var Y=function(){var ee=J.getSheetFromName(V.sheetName);if(ee===void 0){var ae=J.getActiveSheetTab();if(ae&&typeof ae.renderMode=="function")return ae.getTemplate()}return ee},W=Y();V.cmd=y;var H=u.Util.getInvisibleRange(W);if(H.length>0&&W.editorStatus()===d.Spread.Sheets.EditorStatus.ready){W.suspendPaint(),W.clearSelection();var $=H.shift();W.setSelection($.row,$.col,$.rowCount,$.colCount),H.forEach(function(ee){W.addSelection(ee.row,ee.col,ee.rowCount,ee.colCount)}),W.resumePaint()}return!0}};function j(J,V){if(!J.pivotTables)return!1;var Z=V.selections||J.getSelections(),Y=J.pivotTables.all();if(Y.length===0)return!1;for(var W=0,H=Z;W<H.length;W++)for(var $=H[W],ee=0;ee<Y.length;ee++){var ae=Y[ee],de=ae.getRange(),he=de.page,be=de.content;if(he&&he.equals($)||be&&be.equals($))return!1;if(!(he&&he.containsRange($)||be&&be.containsRange($)))return!1}return!0}c.Commands[x]={canUndo:!1,execute:function(J,V,Z){var Y,W,H=u.Util.getSheet(J,V);if(u.Util.hasSelectedShapeOrFloatingObject(H)||H.editorStatus()===d.Spread.Sheets.EditorStatus.enter||H.editorStatus()===d.Spread.Sheets.EditorStatus.edit||j(H,V))return!1;V.cmd=x;var $=V.selections||H.getSelections(),ee=-1,ae=-1,de=H.getRowCount(),he=H.getColumnCount(),be=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),Le=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex(),Fe=u.Util.getNeedAdjustSelection($,be,Le);if(!Fe)return!1;var q;q=H.expandSelection(H,new d.Spread.Sheets.Range(be,Le,1,1)),ee=q.row,ae=q.col,de=q.rowCount,he=q.colCount;var se=H.tables.find(be,Le);if(se&&(q=se.range(),q.rowCount>1)){var ue=u.Util.getActiveSelectedRange($,be,Le);if(!ue)return!1;var ge=new d.Spread.Sheets.Range(q.row+1,q.col,q.rowCount-1,q.colCount);ue.equals(ge)||ue.intersect(q.row,q.col,1,q.colCount)?(ee=q.row,ae=q.col,de=q.rowCount,he=q.colCount):(ee=ge.row,ae=ge.col,de=ge.rowCount,he=ge.colCount)}for(var xe=0,ke=$;xe<ke.length;xe++){var ue=ke[xe];if(q&&q.equals(ue)){ee=-1,ae=-1,de=H.getRowCount(),he=H.getColumnCount();break}}return H.editorStatus()===d.Spread.Sheets.EditorStatus.ready?(H.suspendPaint(),H.setSelection(ee,ae,de,he),H.setRangeActiveCells(be,Le),H.resumePaint(),!0):!1}};function K(J,V){for(var Z=J.getSpans(V),Y=V,W=0,H=Z;W<H.length;W++){var $=H[W];Y=Y.union($)}V.row=Y.row,V.col=Y.col,V.rowCount=Y.rowCount,V.colCount=Y.colCount}function Q(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=V.selections||H.getSelections(),ee=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),ae=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaTextCtrlShift(H,3);var de=u.Util.getNeedAdjustSelection($,ee,ae);if(de!==null){var he=u.Util.getCellPositionInRangeByCol(de,ae);if(he===1&&de.col===-1)return!0;var be=void 0,Le=void 0,Fe=void 0;he===2?Le=de.col:he===0?Le=de.col+de.colCount-1:Le=de.col;var q=he===0?de.col+de.colCount-1-1:de.col-1;for(Fe=Le-1;Fe>=0&&!H.getColumnVisible(Fe);)Fe--;var se=u.Util.hasValue(H,ee,Le),ue=u.Util.hasValue(H,ee,Fe),ge=se&&ue;ge?be=u.Util.findFirstNotNullColIndexInRange(H,ee,q):be=u.Util.findPreviousNotNullColIndex(H,ee,q),he===2?de.colCount=ae-be+1:he===0?de.colCount=Math.abs(be-ae)+1:de.colCount=de.col+de.colCount-be,be<ae?de.col=be:he!==1&&(de.col=ae),K(H,de);for(var xe=de.row;xe<de.row+de.rowCount;xe++)for(var ke=de.col;ke<de.col+de.colCount;ke++)if(!H.canSelect(xe,ke))return!1;H.suspendPaint(),H.showCell(ee,de.col,O.nearest,I.nearest),H.setSelection(de.row,de.col,de.rowCount,de.colCount),H.setRangeActiveCells(ee,ae),H.resumePaint()}return!0}function X(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=H.getColumnCount(),ee=V.selections||H.getSelections(),ae=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),de=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaTextCtrlShift(H,4);var he=u.Util.getNeedAdjustSelection(ee,ae,de);if(he!==null){var be=u.Util.getCellPositionInRangeByCol(he,de);if(be===1&&he.col===-1)return!0;var Le=void 0,Fe=void 0,q=void 0;be===2?Fe=he.col:Fe=he.col+he.colCount-1;var se=be===2?he.col+1:he.col+he.colCount;for(q=Fe+1;q<$&&!H.getColumnVisible(q);)q++;var ue=u.Util.hasValue(H,ae,Fe),ge=u.Util.hasValue(H,ae,q),xe=ue&≥xe?Le=u.Util.findLastNotNullColIndexInRange(H,ae,se):Le=u.Util.findNextNotNullColIndex(H,ae,se),be===2?he.colCount=Math.abs(Le-de)+1:be===0?he.colCount=Le-de+1:he.colCount=Le-he.col+1,Le<de?he.col=Le:be!==1&&(he.col=de),K(H,he);for(var ke=he.row;ke<he.row+he.rowCount;ke++)for(var Je=he.col;Je<he.col+he.colCount;Je++)if(!H.canSelect(ke,Je))return!1;H.suspendPaint(),H.showCell(ae,he.col+he.colCount-1,O.nearest,I.nearest),H.setSelection(he.row,he.col,he.rowCount,he.colCount),H.setRangeActiveCells(ae,de),H.resumePaint()}return!0}c.Commands[L]={canUndo:!1,execute:function(J,V,Z){var Y=u.Util.getSheet(J,V);return Y.options.rightToLeft?X(J,V):Q(J,V)}},c.Commands[T]={canUndo:!1,execute:function(J,V,Z){var Y=u.Util.getSheet(J,V);return Y.options.rightToLeft?Q(J,V):X(J,V)}},c.Commands[w]={canUndo:!1,execute:function(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=V.selections||H.getSelections(),ee=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),ae=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaTextCtrlShift(H,1);var de=u.Util.getNeedAdjustSelection($,ee,ae);if(de!==null){var he=u.Util.getCellPositionInRangeByRow(de,ee);if(he===1&&de.row===-1)return!0;var be=void 0,Le=void 0,Fe=void 0;he===2?Le=de.row:he===0?Le=de.row+de.rowCount-1:Le=de.row;var q=he===0?de.row+de.rowCount-1-1:de.row-1;for(Fe=Le-1;Fe>=0&&!H.getRowVisible(Fe);)Fe--;var se=u.Util.hasValue(H,Le,ae),ue=u.Util.hasValue(H,Fe,ae),ge=se&&ue;ge?be=u.Util.findFirstNotNullRowIndexInRange(H,ae,q):be=u.Util.findPreviousNotNullRowIndex(H,ae,q),he===2?de.rowCount=ee-be+1:he===0?de.rowCount=Math.abs(be-ee)+1:de.rowCount=de.row+de.rowCount-be,be<ee?de.row=be:he!==1&&(de.row=ee),K(H,de);for(var xe=de.row;xe<de.row+de.rowCount;xe++)for(var ke=de.col;ke<de.col+de.colCount;ke++)if(!H.canSelect(xe,ke))return!1;H.suspendPaint(),H.showCell(de.row,ae,O.nearest,I.nearest),H.setSelection(de.row,de.col,de.rowCount,de.colCount),H.setRangeActiveCells(ee,ae),H.resumePaint()}return!0}},c.Commands[M]={canUndo:!1,execute:function(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=H.getRowCount(),ee=V.selections||H.getSelections(),ae=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),de=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaTextCtrlShift(H,2);var he=u.Util.getNeedAdjustSelection(ee,ae,de);if(he){var be=u.Util.getCellPositionInRangeByRow(he,ae);if(be===1&&he.row===-1)return!0;var Le=void 0,Fe=void 0,q=void 0;be===2?Fe=he.row:Fe=he.row+he.rowCount-1;var se=be===2?he.row+1:he.row+he.rowCount;for(q=Fe+1;q<$&&!H.getRowVisible(q);)q++;var ue=u.Util.hasValue(H,Fe,de),ge=u.Util.hasValue(H,q,de),xe=ue&≥xe?Le=u.Util.findLastNotNullRowIndexInRange(H,de,se):Le=u.Util.findNextNotNullRowIndex(H,de,se),be===2?he.rowCount=Math.abs(Le-ae)+1:be===0?he.rowCount=Le-ae+1:he.rowCount=Le-he.row+1,Le<ae?he.row=Le:be!==1&&(he.row=ae),K(H,he);for(var ke=he.row;ke<he.row+he.rowCount;ke++)for(var Je=he.col;Je<he.col+he.colCount;Je++)if(!H.canSelect(ke,Je))return!1;H.suspendPaint(),H.showCell(he.row+he.rowCount-1,de,O.nearest,I.nearest),H.setSelection(he.row,he.col,he.rowCount,he.colCount),H.setRangeActiveCells(ae,de),H.resumePaint()}return!0}},c.Commands[D]={canUndo:!1,execute:function(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),ee=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaText(H,1);var ae=0,de=u.Util.hasValue(H,$,ee),he=$,be=ee;if(he-1<ae)return!0;for(he--;he>=ae&&!H.getRowVisible(he);)he--;if(he<0)return!0;var Le=de&&u.Util.hasValue(H,he,be);return Le?he=u.Util.findFirstNotNullRowIndexInRange(H,be,he):he=u.Util.findPreviousNotNullRowIndex(H,be,he),H.canSelect(he,be)?(H.suspendPaint(),H.setActiveCell(he,be),H.showCell(he,be,O.nearest,I.nearest),H.resumePaint(),!0):!1}},c.Commands[P]={canUndo:!1,execute:function(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=H.getRowCount(),ee=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),ae=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaText(H,2);var de=H.getRowCount(),he=u.Util.hasValue(H,ee,ae),be=ee,Le=ae;if(be+1>=de)return!0;for(be++;be<de&&!H.getRowVisible(be);)be++;if(be>=$)return!0;var Fe=he&&u.Util.hasValue(H,be,Le);return Fe?be=u.Util.findLastNotNullRowIndexInRange(H,Le,be):be=u.Util.findNextNotNullRowIndex(H,Le,be),H.canSelect(be,Le)?(H.suspendPaint(),H.setActiveCell(be,Le),H.showCell(be,Le,O.nearest,I.nearest),H.resumePaint(),!0):!1}};function ne(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),ee=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaText(H,3);var ae=0,de=u.Util.hasValue(H,$,ee),he=$,be=ee;if(be-1<ae)return!0;for(be--;be>=ae&&!H.getColumnVisible(be);)be--;if(be<0)return!0;var Le=de&&u.Util.hasValue(H,he,be);return Le?be=u.Util.findFirstNotNullColIndexInRange(H,he,be):be=u.Util.findPreviousNotNullColIndex(H,he,be),H.canSelect(he,be)?(H.suspendPaint(),H.setActiveCell(he,be),H.showCell(he,be,O.nearest,I.nearest),H.resumePaint(),!0):!1}function ce(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=H.getColumnCount(),ee=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),ae=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaText(H,4);var de=$,he=u.Util.hasValue(H,ee,ae),be=ee,Le=ae;if(Le+1>=de)return!0;for(Le++;Le<de&&!H.getColumnVisible(Le);)Le++;if(Le>=$)return!0;var Fe=he&&u.Util.hasValue(H,be,Le);return Fe?Le=u.Util.findLastNotNullColIndexInRange(H,be,Le):Le=u.Util.findNextNotNullColIndex(H,be,Le),H.canSelect(be,Le)?(H.suspendPaint(),H.setActiveCell(be,Le),H.showCell(be,Le,O.nearest,I.nearest),H.resumePaint(),!0):!1}c.Commands[A]={canUndo:!1,execute:function(J,V,Z){var Y=u.Util.getSheet(J,V);return Y.options.rightToLeft?ce(J,V):ne(J,V)}},c.Commands[E]={canUndo:!1,execute:function(J,V,Z){var Y=u.Util.getSheet(J,V);return Y.options.rightToLeft?ne(J,V):ce(J,V)}};function fe(J){var V=u.Util._isMacOS(),Z=!V,Y=V;J.register(h,c.Commands[h],32,!1,!0,!1,!1),J.register(f,c.Commands[f],32,Z,!1,!1,Y),J.register(g,c.Commands[g],36,Z,!1,!1,Y),J.register(b,c.Commands[b],35,Z,!1,!1,Y),J.register(v,c.Commands[v],221,Z,!1,!1,Y),J.register(S,c.Commands[S],219,Z,!1,!1,Y),J.register(x,c.Commands[x],65,Z,!1,!1,Y),u.Util.isFirefox()?J.register(y,c.Commands[y],59,!1,!1,!0,!1):J.register(y,c.Commands[y],186,!1,!1,!0,!1),J.register(L,c.Commands[L],37,Z,!0,!1,Y),J.register(T,c.Commands[T],39,Z,!0,!1,Y),J.register(w,c.Commands[w],38,Z,!0,!1,Y),J.register(M,c.Commands[M],40,Z,!0,!1,Y),J.navigationTop&&J.setShortcutKey("navigationTop"),J.register(D,c.Commands[D],38,Z,!1,!1,Y),J.navigationBottom&&J.setShortcutKey("navigationBottom"),J.register(P,c.Commands[P],40,Z,!1,!1,Y),J.navigationHome2&&J.setShortcutKey("navigationHome2"),J.register(A,c.Commands[A],37,Z,!1,!1,Y),J.navigationEnd2&&J.setShortcutKey("navigationEnd2"),J.register(E,c.Commands[E],39,Z,!1,!1,Y)}r.initShortcutAboutSelection=fe}),"./src/shortcut/action.style.ts":(function(a,r,o){var l=this&&this.__extends||(function(){var P=function(A,E){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,I){O.__proto__=I}||function(O,I){for(var R in I)Object.prototype.hasOwnProperty.call(I,R)&&(O[R]=I[R])},P(A,E)};return function(A,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");P(A,E);function O(){this.constructor=A}A.prototype=E===null?Object.create(E):(O.prototype=E.prototype,new O)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.initShortcutAboutStyle=void 0;var c=o("./src/shell/action.base.ts"),d=o("sjs-spread-sheets"),u=o("./src/common/util.ts"),h="setCellBold",g="setCellItalicize",f="setCellUnderline",b="setNumberToPercent",S="font-weight",y="bold",v="font-style",x="normal",L="italic",T=d.Spread.Sheets.VerticalPosition,w=d.Spread.Sheets.HorizontalPosition,M=(function(P){l(A,P);function A(){return P!==null&&P.apply(this,arguments)||this}return A.prototype.executeImp=function(){var E,O,I=this,R=I.getSheet(),k=I._options,N=k.handler&&k.handler.bind(I),B=(E=k.activeRowIndex)!==null&&E!==void 0?E:R.getActiveRowIndex(),F=(O=k.activeColIndex)!==null&&O!==void 0?O:R.getActiveColumnIndex();return N&&this.setCellStyle(N),R.showCell(B,F,T.nearest,w.nearest),!0},A})(c.ShortcutActionBase);c.Commands[h]={canUndo:!0,execute:function(P,A,E){var O,I,R=u.Util.getSheet(P,A);if(R&&u.Util.needCheckProtectionOptions(R)&&!R.options.protectionOptions.formatCells)return!1;A.cmd=h;var k=A.selections||R.getSelections(),N=(O=A.activeRowIndex)!==null&&O!==void 0?O:R.getActiveRowIndex(),B=(I=A.activeColIndex)!==null&&I!==void 0?I:R.getActiveColumnIndex();if(k.length>0){var F=u.Util.getActiveCellStyle(R,N,B).font,j=!1;if(F){var K=u.Util.parseFont(F).fontWeight;K!=="normal"&&(j=!0)}return A.boldState=j,A.handler=function(Q){var X=this._options.boldState,ne;if(Q.row===-1||Q.col===-1){if(Q.row===-1&&Q.col===-1)for(var ce=0;ce<R.getColumnCount();ce++){var fe=R.getStyle(-1,ce);fe&&(fe.fontWeight=void 0,R.setStyle(-1,ce,fe))}var J=R.getUsedRange(d.Spread.Sheets.UsedRangeType.style);if(J){var V=new d.Spread.Sheets.Range(Q.row,Q.col,Q.rowCount,Q.colCount),Z=J.getIntersect(V,Q.sheet.getRowCount(),Q.sheet.getColumnCount());Z&&(ne=R.getRange(Z.row,Z.col,Z.rowCount,Z.colCount))}}var Y=X?x:y;if(Q.fontWeight)Q.fontWeight(Y),ne&&ne.fontWeight&&ne.fontWeight(Y);else for(var W=Q.row;W<Q.row+Q.rowCount;W++)for(var ce=Q.col;ce<Q.col+Q.colCount;ce++){var H=R.getActualStyle(W,ce),$=H.font;$=this.getFontStyle($,S,Y),H.font=$,R.setStyle(W,ce,H)}},(0,c.executeCommand)(P,M,A,E)}return!1}},c.Commands[g]={canUndo:!0,execute:function(P,A,E){var O,I,R=u.Util.getSheet(P,A);if(R&&u.Util.needCheckProtectionOptions(R)&&!R.options.protectionOptions.formatCells)return!1;A.cmd=g;var k=A.selections||R.getSelections(),N=(O=A.activeRowIndex)!==null&&O!==void 0?O:R.getActiveRowIndex(),B=(I=A.activeColIndex)!==null&&I!==void 0?I:R.getActiveColumnIndex();if(k.length>0){var F=u.Util.getActiveCellStyle(R,N,B),j=F&&F.font,K=!1;if(j){var Q=u.Util.parseFont(j).fontStyle;Q.indexOf(L)!==-1&&(K=!0)}return A.italicizeState=K,A.handler=function(X){var ne=this._options.italicizeState,ce;if(X.row===-1||X.col===-1){if(X.row===-1&&X.col===-1)for(var fe=0;fe<R.getColumnCount();fe++){var J=R.getStyle(-1,fe);J&&(J.fontStyle=void 0,R.setStyle(-1,fe,J))}var V=R.getUsedRange(d.Spread.Sheets.UsedRangeType.style);if(V){var Z=new d.Spread.Sheets.Range(X.row,X.col,X.rowCount,X.colCount),Y=V.getIntersect(Z,X.sheet.getRowCount(),X.sheet.getColumnCount());Y&&(ce=R.getRange(Y.row,Y.col,Y.rowCount,Y.colCount))}}var W=ne?x:L;if(X.fontStyle)X.fontStyle(W),ce&&ce.fontStyle&&ce.fontStyle(W);else for(var H=X.row;H<X.row+X.rowCount;H++)for(var fe=X.col;fe<X.col+X.colCount;fe++){var $=R.getActualStyle(H,fe),ee=$.font;ee=this.getFontStyle(ee,v,W),$.font=ee,R.setStyle(H,fe,$)}},(0,c.executeCommand)(P,M,A,E)}return!1}},c.Commands[f]={canUndo:!0,execute:function(P,A,E){var O,I,R=u.Util.getSheet(P,A);if(R&&u.Util.needCheckProtectionOptions(R)&&!R.options.protectionOptions.formatCells)return!1;A.cmd=f;var k=A.selections||R.getSelections(),N=(O=A.activeRowIndex)!==null&&O!==void 0?O:R.getActiveRowIndex(),B=(I=A.activeColIndex)!==null&&I!==void 0?I:R.getActiveColumnIndex();if(k.length>0){var F=u.Util.getActiveCellStyle(R,N,B),j=F&&F.textDecoration,K=d.Spread.Sheets.TextDecorationType;return j?A.underlineType=K.none:A.underlineType=K.underline,A.handler=function(Q){var X=this._options.underlineType,ne;if(Q.row===-1||Q.col===-1){var ce=R.getUsedRange(d.Spread.Sheets.UsedRangeType.style);if(ce){var fe=new d.Spread.Sheets.Range(Q.row,Q.col,Q.rowCount,Q.colCount),J=ce.getIntersect(fe,Q.sheet.getRowCount(),Q.sheet.getColumnCount());J&&(ne=R.getRange(J.row,J.col,J.rowCount,J.colCount))}}Q.textDecoration(X),ne&&ne.textDecoration&&ne.textDecoration(X)},(0,c.executeCommand)(P,M,A,E)}return!1}},c.Commands[b]={canUndo:!0,execute:function(P,A,E){var O=u.Util.getSheet(P,A);if(O&&u.Util.needCheckProtectionOptions(O)&&!O.options.protectionOptions.formatCells)return!1;A.cmd=b;var I=A.selections||O.getSelections();return I.length?(A.handler=function(R){R.formatter("0%")},(0,c.executeCommand)(P,M,A,E)):!1}};function D(P){var A=u.Util._isMacOS(),E=!A,O=A;P.register(h,c.Commands[h],66,E,!1,!1,O),P.register(g,c.Commands[g],73,E,!1,!1,O),P.register(f,c.Commands[f],85,E,!1,!1,O),P.register(b,c.Commands[b],53,!0,!0,!1,!1)}r.initShortcutAboutStyle=D}),"sjs-spread-sheets":(function(a){a.exports=GC})},t={};function i(a){var r=t[a];if(r!==void 0)return r.exports;var o=t[a]={exports:{}};return e[a].call(o.exports,o,o.exports,i),o.exports}var n={};(function(){var a=n;/*!**********************!*\
|
|
347
|
+
`,zx="(empty)";class vR{constructor(t,i){this._designer=t,this.designerContainer=i,this._bindingIndicator=null,this._tree=null,this._addedFieldCombos=[],this.spread=t.Spread}get Tree(){return this._tree||this._designer.getData(m.FiledListValue).Tree}set Tree(t){this._tree=t}refreshBindingPathIndicator(t){if(!this.spread)return;let i=this.spread.getActiveSheet();if(!i)return;let n=Ae.getCanvas(this.spread),a=Ae.getOffset(n),r=i.getActiveRowIndex(),o=i.getActiveColumnIndex(),l=i.tables.find(r,o),c=!!(t!=null&&t.getData(m.FileMenu_show));if(l&&!c){let d=l.bindingPath();if(d!=null&&d!==""){let u=l.range(),h=Ae.getSpecifiedRect(this.spread,u,a),g=new GC.Spread.Sheets.Range(u.row,u.col+u.colCount-1,1,1),f=Ae.getSpecifiedRect(this.spread,g,a);if(h.length===0&&this.hideDataBindingSettingIndicator(),f.length===0){this.hideDataBindingSettingIndicator();return}let b=f[0],S=0,y=0;if(this.designerContainer&&this.designerContainer.style){let x=C.getOffsetFromBody(this.designerContainer);S=x.offsetLeft,y=x.offsetTop}if(a.left<=b.x&&a.top<=b.y&&b.y+b.height<=a.top+n.offsetHeight&&b.x+b.width<=a.left+n.offsetWidth){this.showDataBidingSettingIndicator(b.x+b.width-16-S,b.y-y,t);return}}}this.hideDataBindingSettingIndicator()}hideDataBindingSettingIndicator(){this._bindingIndicator!==null&&this._clickEventHandler&&(this._bindingIndicator.removeEventListener("click",this._clickEventHandler),this._bindingIndicator.parentElement&&this._bindingIndicator.parentElement===this.designerContainer&&this.designerContainer.removeChild(this._bindingIndicator)),this._bindingIndicator=null,this._clickEventHandler=null}showDataBidingSettingIndicator(t,i,n){if(this._bindingIndicator===null){this._bindingIndicator=document.createElement("div"),this._bindingIndicator.classList.add("gc-data-binding-setting-indicator"),this._bindingIndicator.classList.add("gc-designer-root"),this._bindingIndicator.classList.add(wn);let a=r=>{this.showDataBindingSetting(r.target,n)};this._clickEventHandler=a.bind(this),this._bindingIndicator.addEventListener("click",this._clickEventHandler),this.designerContainer.appendChild(this._bindingIndicator)}this._bindingIndicator.style.left=t+"px",this._bindingIndicator.style.top=i+"px"}async showDataBindingSetting(t,i){var f;let n=(f=this.spread)==null?void 0:f.getActiveSheet();if(!n)return;let a=n.tables.find(n.getActiveRowIndex(),n.getActiveColumnIndex());if(!a)return;let r=a.bindingPath();if(r||(r=null),!this.Tree)return;let o=0,l=xR(this.Tree,r);l&&l.children&&l.dataFieldType===Ci.table&&(o=l.children.length);let c=[];for(let b=0;b<=o;b++){if(l&&l.children){let S=l.children[b];S&&S.name&&c.push({name:S.name,value:S.name})}b===o&&c.push({name:zx,value:""})}let d=a.range(),u=[];if(d){let b=d.colCount;for(let S=0;S<b;S++){let y=a.getColumnDataField(S),v="Column"+S+": ";u.push({name:v,value:y})}}let h=c.map(b=>({text:b.name,value:b.value})),g={bindingPath:r,autoGenerateColumns:a.autoGenerateColumns(),dataFields:u.map(b=>({label:b.name,valueAsTitle:!0,listData:{selectedValue:b.value,items:h}}))};try{let b=await(i==null?void 0:i._showDialog(G.BindingIndicator,g,void 0,{showHeader:!1,positionElement:t,bindingValueChangedCallback:this.bindingValueChangedCallback.bind(this)}));b?this.updateTableBinding(a,b,i):this.resetFieldCombos()}catch{}}resetFieldCombos(){this._addedFieldCombos=[]}bindingValueChangedCallback(t,i,n){var a,r,o;if(t==="addColumn"){let l=(a=this.spread)==null?void 0:a.getActiveSheet();l&&l.tables.find(l.getActiveRowIndex(),l.getActiveColumnIndex())&&this.handleAddColumnBtnClick(n.dataFields.length,(o=(r=n.dataFields[0])==null?void 0:r.listData)==null?void 0:o.items)}return!1}async updateTableBinding(t,i,n){var u,h,g;if(!i||!t)return;let a=(u=this.spread)==null?void 0:u.getActiveSheet();if(!a)return;let r=[],o,l;if(!i.dataFields)return;let c=[];for(o=0;o<i.dataFields.length;o++){l=new GC.Spread.Sheets.Tables.TableColumn(o);let f=i.dataFields[o].listData.selectedValue;c.push(f),l.dataField(f),t.getColumnDataField(o)===f&&(f=t.getColumnName(o)),l.name(f),r.push(l)}t.bind(r);let d=i.autoGenerateColumns;if(d){if(!this.Tree)return;if(await(n==null?void 0:n._showMessageBox(s.ribbon.data.warningTable,s.title,Re.warning,vt.okCancel))===Si.ok){(h=this.spread)==null||h.commandManager().execute({cmd:"tableAutoBind",sheetName:a.name(),tableName:t.name()}),this.refreshBindingPathIndicator(),a.repaint();return}}else{let f=t.endRow()-t.startRow()+1,b=t.endColumn()-t.startColumn()+1,S=Ioe(this._addedFieldCombos);this.resetFieldCombos();let y=c.concat(S),v=y.length;if(v!==b){let x=[];for(o=0;o<v;o++)l=new GC.Spread.Sheets.Tables.TableColumn(o),l.dataField(y[o]),t.getColumnDataField(o)===y[o]?l.name(t.getColumnName(o)):l.name(y[o]),x.push(l);(g=this.spread)==null||g.commandManager().execute({cmd:"bindingTableAddColumn",sheetName:a.name(),tableName:t.name(),isAuto:d,resizeToRange:new GC.Spread.Sheets.Range(t.startRow(),t.startColumn(),f,v),columns:x}),t.endColumn()-t.startColumn()+1===v&&this.refreshBindingPathIndicator()}}a.repaint()}handleAddColumnBtnClick(t,i){this.createDataField(document.querySelector("div.gc-dListComboEditorItems_container"),"Column"+(t+this._addedFieldCombos.length)+": ",i)}createDataField(t,i,n){if(!t)return;let a=document.createElement("div");a.classList.add("dylist-item-container"),t.appendChild(a);let r=document.createElement("div");r.classList.add("label"),r.innerText=i,a.appendChild(r);let o=document.createElement("div");o.classList.add("dylist-item"),a.appendChild(o);let l=new zt(o,{type:"ListComboEditor",items:n});l.value=zx,l.RenderAll(),this._addedFieldCombos.push(l)}}function Ioe(e){let t=[];return!e||e.length===0||e.forEach(i=>{i.value!==null&&i.value!==void 0&&i.value!==zx&&t.push(i.value)}),t}function xR(e,t,i){if(e.name===t&&!i)return e;let n=t.split("."),a=n[0];if(a==="")return e;if(e.children)for(let r of e.children){if(r.name===t&&!i)return r;if(r.name===a)return xR(r,n.slice(1).join("."),!0)}return null}function Moe(){return{templateName:G.BindingIndicator,content:[{type:"FlexContainer",className:"gc-data-binding-setting-content",children:[{type:"ColumnSet",children:[{type:"Column",children:[{className:"cls-bindingpath-label",type:"TextBlock",text:s.ribbon.data.bindingPath+":"}],width:"stretch"},{type:"Column",children:[{id:"binindPath-value",className:"gc-binindPath-value",type:"TextEditor",bindingPath:"bindingPath",enableWhen:"false"}],width:"stretch"}]},{type:"CheckBox",id:"autoGennerateColumns",text:s.ribbon.data.autoGenerateColumns,bindingPath:"autoGenerateColumns"},{type:"LabelContainer",children:[{type:"Container",id:"data-field-container",className:"data-field-container",children:[{type:"ListComboEditorItems",bindingPath:"dataFields",enableWhen:"autoGenerateColumns=false"},{type:"Button",text:s.ribbon.data.addColumn,className:"add-column",bindingPath:"addColumn",enableWhen:"autoGenerateColumns=false"}]}],text:s.ribbon.data.dataField}]}]}}_e(G.BindingIndicator,Moe);const pu=class pu{static GetComponent(t){return pu.CustomComponents[t]}static GetComponentInstance(t,i,n){let a=pu.GetComponent(t);return a?new a(n,i):null}static RegisterComponent(t,i){return pu.CustomComponents[t]?!1:(pu.CustomComponents[t]=i,ht(t,eM(i,void 0,void 0,{renderTextOnRibbon:!0})),!0)}};pu.CustomComponents={};let jx=pu;const LR=C.isNullOrUndefined,koe="TRUE",Wx="UNDEFINED",TR=(e,t)=>{e&&(e.docProps||(e.docProps={}),e.docProps.coreDocProps||(e.docProps.coreDocProps={}),e.docProps.coreDocProps.created||(e.docProps.coreDocProps.created=new Date),t.setData(m.DocPropAccessDate,new Date))};function fm(e,t){try{let i="",n=e.indexOf("("),a=e.indexOf(")");if(n>=0&&n===e.lastIndexOf("(")&&a>0){let r=e.substring(0,n),o=e.substring(n+1,a),l=e.substring(a+1),c=koe;o&&(c=fm(o,t)),e=`${r}${Wx}${l}`,i=fm(e,t).replace(new RegExp(Wx,"g"),c)}else if(e.indexOf("||")>=0){let r=e.split("||");r=r.map(o=>o.trim()).filter(o=>o.length>0),i+="OR(",r.forEach((o,l)=>{i+=fm(o,t)+(l===r.length-1?"":", ")}),i+=")"}else if(e.indexOf("&&")>=0){let r=e.split("&&");r=r.map(o=>o.trim()).filter(o=>o.length>0),i+="AND(",r.forEach((o,l)=>{i+=fm(o,t)+(l===r.length-1?"":", ")}),i+=")"}else{if(e.trim()[0]==="!")return i+="NOT(IFERROR("+e.trim().substr(1)+", FALSE))",i;if(e.indexOf("==")>=1){let r=e.split("==");if(r.length>2)i="=false";else{let o=r[0].trim(),l=r[1].trim();l[0]==="'"&&l[l.length-1]==="'"&&(l=l.substr(1,l.length-2)),l[0]==='"'&&l[l.length-1]==='"'&&(l=l.substr(1,l.length-2)),i=String(o)+"="+String(l)}}else i=t.getData(e),(LR(i)||!LR(i._error))&&(i=Wx)}return i}catch{return""}}class mo extends oe.DesignerActionBase{undoImp(t,i,n){t.suspendPaint();try{return GC.Spread.Sheets.Commands.undoTransaction(t,i),!0}finally{t.resumePaint()}}isSendEvent(t,i,n){return!0}changeSelectionInCommandExecuting(t,i,n){if(n){let a=n.startRow&&n.startRow(),r=n.startColumn&&n.startColumn();t.changeSelectionInCommandExecuting(i,a,r,null,[n])}}}function Roe(e,t){let i="Designer."+t;e.commandManager().register(i,wR,void 0,!1,!1,!1,!1)}function ji(e,t){let i=C.getActiveSheet(e);oe.runCommand(e,"updateChartSeries",wR,{selections:i.getSelections(),sheetName:i.name(),chartName:t.options.chart.name(),series:t.options.element})}class _oe extends mo{executeImp(t,i,n){let r=this.sheet().charts.get(i.chartName);this.changeSelectionInCommandExecuting(t,i,r);let o=r.series(),l=i.series;r&&(l.value?o.set(l.index,l.value):o.set(l.index,l))}}let wR={canUndo:!0,execute:function(e,t,i){return new _oe(e,t).execute(e,t,i)}};function Ooe(e,t){let i="Designer."+t;e.commandManager().register(i,DR,void 0,!1,!1,!1,!1)}function dn(e,t){let i=C.getActiveSheet(e),n=pe.getSelectedChart(i);if(n){let a=n.name();oe.runCommand(e,"changeChartElement",DR,{chartName:a,elementObj:t.options,selections:t.selections,sheetName:t.sheetName})}}class Eoe extends mo{executeImp(t,i,n){let r=this.sheet().charts.get(i.chartName),o=i.elementObj;if(r){this.changeSelectionInCommandExecuting(t,i,r);for(let l in o)o.hasOwnProperty(l)&&r[l](o[l])}}}let DR={canUndo:!0,execute:function(e,t,i){return new Eoe(e,t).execute(e,t,i)}};var yn=(e=>(e[e.PrimaryHorizontal=0]="PrimaryHorizontal",e[e.PrimaryVertical=1]="PrimaryVertical",e[e.SecondaryHorizontal=2]="SecondaryHorizontal",e[e.SecondaryVertical=3]="SecondaryVertical",e))(yn||{});function Mb(e,t){let i=kb(e,t);return i.visible!==null&&i.visible!==void 0?(i.visible=!i.visible,{options:{axes:AR(e,t,i)}}):null}function AR(e,t,i){let n=e.axes();switch(PR(e,t)){case Va.primaryValue:n.primaryValue=i;break;case Va.primaryCategory:n.primaryCategory=i;break;case Va.secondaryCategory:n.secondaryCategory=i;break;case Va.secondaryValue:n.secondaryValue=i;break}return n}function ja(e){let t=e.chartType(),i=!1,n=pe.getChartGroup(t);if(n===Se.BarGroup&&(i=!0),n===Se.FunnelGroup&&(i=!0),n===Se.ComboGroup){let a=e.series().get();for(let r=0;r<a.length;r++){let o=a[r];if(pe.getChartGroup(o.chartType)!==Se.BarGroup){i=!1;break}i=!0}}return i}function kb(e,t){let i=PR(e,t),n=e.axes();switch(i){case Va.primaryValue:return n.primaryValue;case Va.primaryCategory:return n.primaryCategory;case Va.secondaryValue:return n.secondaryValue;case Va.secondaryCategory:return n.secondaryCategory}}function PR(e,t){if(ja(e))switch(t){case 0:return Va.primaryValue;case 1:return Va.primaryCategory;case 2:return Va.secondaryValue;case 3:return Va.secondaryCategory}else switch(t){case 0:return Va.primaryCategory;case 1:return Va.primaryValue;case 2:return Va.secondaryCategory;case 3:return Va.secondaryValue}}function Rb(e,t){let i=e.axes(),n=s.addChartElement.axisTitles.axisTitles;i.primaryCategory&&i.primaryCategory.title&&i.primaryCategory.title.text?n=i.primaryCategory.title.text:i.primaryValue&&i.primaryValue.title&&i.primaryValue.title.text&&(n=i.primaryValue.title.text);let a=kb(e,t);return a.title.text!==""?a.title.text="":a.title.text=n,a.title.fontSize="14",i=AR(e,t,a),{options:{axes:i}}}function Wa(e){let t,i,n=e.getSelectedSeries();return n?(t=n.getDataLabels(),i=n.ChartType):(t=e.dataLabels(),i=e.chartType()),{dataLabels:t,chartType:i}}function _b(e,t,i){for(let n=0;n<e.length;n++)if(C.isEmpty(i)||n===i){let a=e[n];a.errorBars=t}}function Yr(e){let t=e.getData(m.ChartSelectedSeriesIndex);return t>=0?t:void 0}function Pn(e,t,i){let n=e.Spread;const a=GC.Spread.Sheets.Charts.ChartType;let r=pe.getActiveChart(n);if(!r)return;let o=Yr(e),l=r.series().get(o||0);if(l){let c=l.dataLabels||{};C.isNullOrUndefined(i)?r.chartType()===a.treemap||r.chartType()===a.sunburst?(c.showValue=!1,c.showCategoryName=!0):!c.showValue&&!c.showCategoryName&&!c.showPercentage&&!c.showSeriesName&&!c.showDataLabelsRange&&(c.showValue=!0):(c.showValue=i,c.showCategoryName=i,c.showPercentage=i,c.showSeriesName=i,c.showDataLabelsRange=i),C.isNullOrUndefined(t)||(c.position=t),o===void 0?dn(n,{options:{dataLabels:c}}):(l.dataLabels=c,ji(e.Spread,{options:{chart:r,element:{index:o,value:l}}}))}}const IR=C.isNullOrUndefined,Zx="setPivotTableOptions";function Noe(e,t){let i="Designer."+t;e.commandManager().register(i,MR,void 0,!1,!1,!1,!1)}function Boe(e,t,i,n){oe.runCommand(e,"setPivotTableOption",MR,{optionName:i,value:n,pivotTableName:t})}let MR={canUndo:!0,execute:function(e,t,i){return new Foe(e,t).execute(e,t,i)}};class Foe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this,r=a.sheet();if(r.pivotTables){let o=r.pivotTables.get(i.pivotTableName);o instanceof GC.Spread.Pivot.PivotTable&&(o.options[i.optionName]=i.value,Ws(r,o))}}}function kR(e,t){let i="Designer."+t;e.commandManager().register(i,RR,void 0,!1,!1,!1,!1)}function Ob(e,t,i){oe.runCommand(e,Zx,RR,{options:i,pivotTableName:t})}let RR={canUndo:!0,execute:function(e,t,i){return new Goe(e,t).execute(e,t,i)}};class Goe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this,r=a.sheet();if(!r.pivotTables)return;let o=r.pivotTables.get(i.pivotTableName);if(o instanceof GC.Spread.Pivot.PivotTable&&i&&i.options){let l=i.options,c;for(let d of Object.keys(l))if(d==="showGrandForRow"||d==="showGrandForColumn"){c=o.options.grandTotalPosition;let u=IR(l.showGrandForRow)?!!(c&GC.Spread.Pivot.GrandTotalPosition.row):l.showGrandForRow,h=IR(l.showGrandForColumn)?!!(c&GC.Spread.Pivot.GrandTotalPosition.col):l.showGrandForColumn;o.options.grandTotalPosition=u?h?GC.Spread.Pivot.GrandTotalPosition.both:GC.Spread.Pivot.GrandTotalPosition.row:h?GC.Spread.Pivot.GrandTotalPosition.col:GC.Spread.Pivot.GrandTotalPosition.none}else if(d==="name")o.name(l.name);else if(d==="calcItemAggregation")o.options[d]=l[d]?GC.Spread.Pivot.CalcItemAggregation.include:GC.Spread.Pivot.CalcItemAggregation.exclude;else if(d==="missingCaption"){let u=+l[d];isNaN(u)?o.options[d]=l[d]:o.options[d]=u}else o.options[d]!==l[d]&&(o.options[d]=l[d]);Ws(r,o)}}}function Mt(e){let i=e.Spread.getActiveSheet();if(!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex();return i.pivotTables.findPivotTable(n,a)}function Sr(e,t,i){let n=Mt(e);n&&(Boe(e.Spread,n.name(),t,i),e.setData(re.isFileModified,!0))}function sc(e,t){let i=Mt(e);if(i)return i.options[t]}function Voe(e,t){let i="Designer."+t;e.commandManager().register(i,_R,void 0,!1,!1,!1,!1)}function Hoe(e,t,i){oe.runCommand(e,"setPivotTableFieldName",_R,{oldPivotFieldName:t,newPivotFieldName:i})}let _R={canUndo:!0,execute:function(e,t,i){return new zoe(e,t).execute(e,t,i)}},zoe=class extends oe.DesignerActionBase{executeImp(t,i,n){let a=t.getActiveSheet();if(!a.pivotTables)return;let r=a.getActiveRowIndex(),o=a.getActiveColumnIndex();a.pivotTables.findPivotTable(r,o).updateFieldName(i.oldPivotFieldName,i.newPivotFieldName)}};function OR(e){let t=Mt(e);if(t){let n=e.Spread.getActiveSheet(),a=n.getActiveRowIndex(),r=n.getActiveColumnIndex();return joe(a,r,t)}else return null}function joe(e,t,i){let n=i.getPivotInfoImp(e,t);return n?n.menuArea===5?n.valueFieldName:n.menuArea===3?null:n.activeColFieldInfo?n.activeColFieldInfo.name:n.activeRowFieldInfo?n.activeRowFieldInfo.name:n.pageFieldInfo?n.pageFieldInfo.fieldName:n.colHeadFieldInfo?n.colHeadFieldInfo.fieldName:n.cornerFieldInfo?n.cornerFieldInfo.fieldName:n.valueFieldName:null}const Jl=class Jl{};Jl.SheetOptionsChangedInternal="SheetOptionsChangedInternal",Jl.WorksheetDataChanged="WorksheetDataChanged",Jl.ActiveSheetChangedInternal="ActiveSheetChangedInternal",Jl.WorkbookOptionsChangedInternal="WorkbookOptionsChangedInternal",Jl.EnterCellInternal="EnterCellInternal",Jl.SheetBackgroundChangedInternal="SheetBackgroundChangedInternal",Jl.PivotTableAdded="PivotTableAdded",Jl.ReportSheetTemplateRangeChanged="ReportSheetTemplateRangeChanged";let _t=Jl;function Woe(e){return!isNaN(parseFloat(e))&&isFinite(e)}class cc extends oe.DesignerActionBase{getNewTableName(){let t=0;for(let i=0;i<this.spread().sheets.length;i++){let n=this.spread().sheets[i].tables.all();for(let a=0;a<n.length;a++){let r=n[a].name();if(r&&r.length>5&&r.substring(0,5).toLowerCase()==="table"){let o=r.substring(5,r.length);Woe(o)&&Number(o)>=t&&(t=Number(o))}}}return"Table"+(t+1).toString()}clearMergeInRange(t){let i=this.sheet(),n=t.col===-1?0:t.col,a=t.row===-1?0:t.row;for(let r=0;r<t.rowCount;r++)for(let o=0;o<t.colCount;o++)i.removeSpan(a+r,n+o)}}function Zoe(e,t){let i="Designer."+t;e.commandManager().register(i,ER,void 0,!1,!1,!1,!1)}function Uoe(e,t){var a,r;let i=t.sheet,n=i.tables.find(i.getActiveRowIndex(),i.getActiveColumnIndex());return oe.runCommand(e,"createDefaultTableFromDataTable",ER,{range:(a=t.options)!=null&&a.bindingSource?t.options.range:t.options,bindingSource:(r=t.options)==null?void 0:r.bindingSource,activeTable:n,selections:t.selections,sheetName:t.options.sheetName})}function Eb(e){let i=(e.Spread||e).getActiveSheet().getSelections(),n=i[0];return!n||i.length>1||!(n.row>-1&&n.col>-1&&n.rowCount===1&&n.colCount===1)}class Joe extends cc{executeImp(t,i,n){var l;let a=i.range,r=a.row===-1?0:a.row,o=a.col===-1?0:a.col;if(a&&t.getActiveSheet().isIntersectWithArrayFormula(a)){(l=t._designer)==null||l._showMessageBox(s.tableErrDialog.hasArrayFormula,s.title,Re.error);return}if(Eb(t))return!1;this.clearMergeInRange(a),this.sheet().tables.addFromDataSource(this.getNewTableName(),r,o,i.bindingSource,void 0)}}let ER={canUndo:!0,execute:function(e,t,i){return new Joe(e,t).execute(e,t,i)}};var Yoe=Object.defineProperty,qoe=Object.getOwnPropertyDescriptor,ze=(e,t,i,n)=>{for(var a=qoe(t,i),r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(t,i,a)||a);return a&&Yoe(t,i,a),a};const Ux="Design",Jx="PaginatedPreview",dc="Preview",Yx=[];function je(...e){return function(t,i,n){Yx.push({events:e,handler:n.value})}}function an(e,t){Yx.forEach(i=>{i.events.includes(e)&&i.handler(t)})}function Ll(e){Yx.forEach(t=>{t.handler(e)})}const We=(Tn=class{static initActiveSheetState(t){t.setData(m.WorksheetActive,!!t.Spread.getActiveSheet())}static hasIndent(t){let i=C.getActiveSheet(t.Spread),n=i&&i.getCompositeStyle(i.getActiveRowIndex(),i.getActiveColumnIndex()),a=n&&n.textIndent!==void 0&&n.textIndent>0;t.setData(m.HasIndent,a)}static allowInsertTable(t){let i=t.Spread.getActiveSheet();if(i){let n=i.getSelections()[0],a=i.tables.all(),r=!0;for(let o=0;o<a.length;o++){let l=a[o].range();if(n&&(n.containsRange(l)||l.containsRange(n)||n.intersect(l.row,l.col,l.rowCount,l.colCount))){t.setData(m.AllowInsertTable,!1),r=!1;break}}r&&t.setData(m.AllowInsertTable,!0)}else t.setData(m.AllowInsertTable,!1)}static allowInsertPivotTable(t){let i=t.Spread,n=i.getActiveSheet();if(!n){let l=i.getActiveSheetTab();if(C._isTableSheet(l)&&l.getSheet().pivotTables){t.setData(m.AllowInsertPivotTable,!0);return}t.setData(m.AllowInsertPivotTable,!1);return}if(!n.pivotTables)return;let a=n.getSelections()[0],r=n.pivotTables.all(),o=!0;for(let l=0;l<r.length;l++){let{page:c,content:d}=r[l].getRange();if(a){if(c&&(a.containsRange(c)||c.containsRange(a)||a.intersect(c.row,c.col,c.rowCount,c.colCount))){t.setData(m.AllowInsertTable,!1),t.setData(m.AllowInsertPivotTable,!1),o=!1;break}if(a.containsRange(d)||d.containsRange(a)||a.intersect(d.row,d.col,d.rowCount,d.colCount)){t.setData(m.AllowInsertTable,!1),t.setData(m.AllowInsertPivotTable,!1),o=!1;break}}}o&&t.setData(m.AllowInsertPivotTable,!0)}static allowInsertShape(t){t.setData(m.AllowInsertShape,GC.Spread.Sheets.Shapes&&Xoe(t.Spread))}static setCustomTableTheme(t){var i,n;t.setData(re.tableStyleKey,(n=(i=t.Spread)==null?void 0:i.customTableThemes)==null?void 0:n.all())}static allowInsertChart(t){t.setData(m.AllowInsertChart,GC.Spread.Sheets.Charts&&ele(t.Spread))}static allowInsertBarCode(t){t.setData(m.AllowInsertBarCode,GC.Spread.Sheets.Barcode&&Qoe(t.Spread))}static setAccessBarItemsState(t){let i=t.getData(re.osEnv),n=!t.getData(re.needActive)||i._ms[2]()===rs.Trial;t.setData(m.AllowAccessBarOpen,n),t.setData(m.AllowAccessBarSave,n),t.setData(m.AllowAccessBarReset,n)}static setHyperlinkItemsState(t){let i=t.Spread.getActiveSheet();if(i&&!t.getData(m.ShapeSelected)){let{withSingleHyperlink:n,withSingleHyperlinkFormulas:a}=Ae.getHyperlinkSelectionInformation(i),r=Ae.getRangeHasHyperLink(i);t.setData(m.AllowInsertHyperlink,!0),t.setData(m.WithHyperlink,r),t.setData(m.WithSingleHyperlink,n),t.setData(m.WithSingleHyperlinkFormulas,a)}else t.setData(m.AllowInsertHyperlink,!1),t.setData(m.WithHyperlink,!1),t.setData(m.WithSingleHyperlink,!1),t.setData(m.WithSingleHyperlinkFormulas,!1)}static needCheckProtectionOptions(t){return t?t.isActualProtected()&&!!t.options.protectionOptions:!1}static needShowInsertCellCopyCut(t,i){let n=t.getSelections();if(n.length!==1||!i.showInsertCopyPasteCells)return!1;let a=t.getActiveRowIndex(),r=t.getActiveColumnIndex(),o=n[0];return!(o.row!==-1&&o.col!==-1&&o.rowCount!==t.getRowCount()&&o.colCount!==t.getColumnCount()&&t.tables&&t.tables.find(a,r)||t.pivotTables&&t.pivotTables.findPivotTable(a,r)||t.getSpan(a,r))}static setInsertCopiedCutCellsState(t){let i=C.getActiveSheet(t.Spread);if(i){let n=i.getClipboardHelperObj(),{isCutting:a,ranges:r}=n,o=r&&r.length===1;if(!Tn.needShowInsertCellCopyCut(i,n)||!o){t.setData(m.AllowInsertCopiedCutCells,!1);return}t.setData(m.AllowInsertCopiedCutCells,!0),t.setData(m.ClipboardCutting,a);let l=r[0];t.setData(m.WholeRowSelection,l.rowCount===i.getRowCount()),t.setData(m.WholeColumnSelection,l.colCount===i.getColumnCount())}}static selectFullColumn(t){let i=C.getActiveSheet(t.Spread);t.setData(m.IsSelectFullColumns,Ae.isFullCol(i))}static selectFullRow(t){let i=C.getActiveSheet(t.Spread);t.setData(m.IsSelectFullRows,Ae.isFullRow(i)),i&&t.setData(re.isMultiSelection,i.getSelections().length>1)}static sheetFreezed(t){let i=C.getActiveSheet(t.Spread);if(!i){t.setData(m.Freezed,!1);return}let n=i.frozenRowCount(),a=i.frozenColumnCount();t.setData(m.Freezed,n>0&&a>0)}static allowFilter(t){let i=C.getActiveSheet(t.Spread);if(i){let n=!0;Tn.needCheckProtectionOptions(i)&&(i.options.protectionOptions.allowFilter||(n=!1)),t.setData(m.AllowFilter,n)}else t.setData(m.AllowFilter,!1)}static allowRichText(t){let i=t.Spread.getActiveSheet(),n=!0;if(i){const a=i.getActiveRowIndex(),r=i.getActiveColumnIndex();i.getFormula(a,r)?n=!1:n=!i.getCell(a,r).locked()||!i.isActualProtected()}t.setData(m.AllowRichText,n)}static hasSlicerSelected(t){t.setData(m.HasSlicerSelected,$oe(t.Spread))}static hasHiddenSheet(t){let i=t.Spread,n=i.sheets.some(a=>a.visible()===GC.Spread.Sheets.SheetTabVisible.hidden);if(!n){for(let a=0,r=i.getSheetTabCount();a<r;a++)if(i.getSheetTab(a).visible()===GC.Spread.Sheets.SheetTabVisible.hidden){n=!0;break}}t.setData(m.HasHiddenSheet,n)}static allowResizeRows(t){let i=C.getActiveSheet(t.Spread),n=!0;i&&Tn.needCheckProtectionOptions(i)&&(i.options.protectionOptions.allowResizeRows||(n=!1)),t.setData(m.AllowResizeRows,n)}static AllowInsertCell(t){let i=C.getActiveSheet(t.Spread),n=!1;i&&(i.isActualProtected()||(n=!0),i.options.protectionOptions.allowInsertColumns&&Ae.isFullCol(i)&&(n=!0),i.options.protectionOptions.allowInsertRows&&Ae.isFullRow(i)&&(n=!0)),t.setData(m.AllowInsertCell,n)}static allowDeleteCell(t){let i=C.getActiveSheet(t.Spread),n=!1;i&&(i.isActualProtected()||(n=!0),i.options.protectionOptions.allowDeleteColumns&&Ae.isFullCol(i)&&(n=!0),i.options.protectionOptions.allowDeleteRows&&Ae.isFullRow(i)&&(n=!0)),t.setData(m.AllowDeleteCell,n)}static isIncludeLockedCell(t){let i=C.getActiveSheet(t.Spread),n=!1;if(i&&i.isActualProtected()){let a=i.getSelections();for(let r of a){let o=r.row,l=r.rowCount,c=r.col,d=r.colCount;for(let u=0;u<l;u++)for(let h=0;h<d;h++)if(i.getCell(o+u,c+h).locked()){n=!0,t.setData(m.IsIncludeLockedCell,n);return}}}t.setData(m.IsIncludeLockedCell,n)}static allowInsertRows(t){let i=C.getActiveSheet(t.Spread),n=!0,a=!0;if(i){Ae.isFullCol(i)&&(n=!1);let r=i.options.protectionOptions;Tn.needCheckProtectionOptions(i)&&(r.allowInsertRows||(n=!1,a=!1),Ae.isFullCol(i)&&(n=!1),Ae.isFullRow(i)||(a=!1))}t.setData(m.AllowInsertRows,n),t.setData(m.AllowInsertRowsContextMenu,a)}static allowDeleteRows(t){let i=C.getActiveSheet(t.Spread),n=!0;if(i){Ae.isFullCol(i)&&(n=!1);let a=i.tables,r=i.options.protectionOptions;Tn.needCheckProtectionOptions(i)&&(r.allowDeleteRows||(n=!1),Ae.isFullRow(i)||(n=!1)),a!=null&&a.containTableHeaderTotalRowForSheet()&&(n=!1)}t.setData(m.AllowDeleteRows,n)}static allowInsertColumns(t){let i=C.getActiveSheet(t.Spread),n=!0,a=!0;if(i){Ae.isFullRow(i)&&(n=!1);let r=i.options.protectionOptions;Tn.needCheckProtectionOptions(i)&&(r.allowInsertColumns||(n=!1,a=!1),Ae.isFullRow(i)&&(n=!1),Ae.isFullCol(i)||(a=!1))}t.setData(m.AllowInsertColumns,n),t.setData(m.AllowInsertColumnsContextMenu,a)}static allowDeleteColumns(t){let i=C.getActiveSheet(t.Spread),n=!0;if(i){Ae.isFullRow(i)&&(n=!1);let a=i.options.protectionOptions;Tn.needCheckProtectionOptions(i)&&(a.allowDeleteColumns||(n=!1),Ae.isFullCol(i)||(n=!1))}t.setData(m.AllowDeleteColumns,n)}static allowFormatCells(t){let i=C.getActiveSheet(t.Spread),n=!0;i&&Tn.needCheckProtectionOptions(i)&&(i.options.protectionOptions.formatCells||(n=!1)),t.getData(m.IsInTableSheetDesignMode)&&(n=!0),t.setData(m.AllowFormatCells,n)}static allowFormatRows(t){let i=C.getActiveSheet(t.Spread),n=!0;i&&Tn.needCheckProtectionOptions(i)&&(i.options.protectionOptions.formatRows||(n=!1)),t.setData(m.AllowFormatRows,n)}static allowFormatColumns(t){let i=C.getActiveSheet(t.Spread),n=!0;i&&Tn.needCheckProtectionOptions(i)&&(i.options.protectionOptions.formatColumns||(n=!1)),t.setData(m.AllowFormatColumns,n)}static allowOutlineRows(t){let i=t.Spread.getActiveSheet(),n=!1;i&&Tn.needCheckProtectionOptions(i)&&i.options.protectionOptions.allowOutlineRows&&(n=!0),t.setData(m.AllowOutlineRows,n)}static allowOutlineColumns(t){let i=t.Spread.getActiveSheet(),n=!1;i&&Tn.needCheckProtectionOptions(i)&&i.options.protectionOptions.allowOutlineColumns&&(n=!0),t.setData(m.allowOutlineColumns,n)}static chartAllSeriesList(t){let i=[];if(C.getActiveSheet(t.Spread)){let a=pe.getActiveChart(t.Spread);a&&(i=pe.getSeriesList(t.Spread,a))}t.setData(m.ChartAllSeriesList,i)}static haveChartLegend(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].seriesType===te.Legend){t.setData(m.ChartLegend,!0);return}else t.setData(m.ChartLegend,!1)}static haveCharTitle(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].seriesType===te.ChartTitle){t.setData(m.ChartTitle,!0);return}else t.setData(m.ChartTitle,!1)}static haveCharErroeBar(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].seriesType===te.ErrorBar){t.setData(m.ErrorBar,!0);return}else t.setData(m.ErrorBar,!1)}static haveCharTrendline(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].seriesType===te.Trendline){t.setData(m.Trendline,!0);return}else t.setData(m.Trendline,!1)}static haveCharDataLabels(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].seriesType===te.DataLabels){t.setData(m.DataLabels,!0);return}else t.setData(m.DataLabels,!1)}static haveCharPrimaryValue(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].seriesType===te.PrimaryValue){t.setData(m.PrimaryValue,!0);return}else t.setData(m.PrimaryValue,!1)}static haveCharPrimaryCategory(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].seriesType===te.PrimaryCategory){t.setData(m.PrimaryCategory,!0);return}else t.setData(m.PrimaryCategory,!1)}static haveCharAxisTypeTitle(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].axisType===Oe.Title){t.setData(m.AxisTypeTitle,!0);return}else t.setData(m.AxisTypeTitle,!1)}static haveCharAxisTypeMajorGridLineMinorGridLine(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++){const a=i[n];if(a.axisType===Oe.MajorGridLine||a.axisType===Oe.MinorGridLine){t.setData(m.AxisTypeMajorGridLineMinorGridLine,!0);return}else t.setData(m.AxisTypeMajorGridLineMinorGridLine,!1)}}static haveCharAxisTypeNone(t){let i=t.getData(m.ChartAllSeriesList);if(i)for(let n=0;n<i.length;n++)if(i[n].axisType===Oe.None){t.setData(m.AxisTypeNone,!0);return}else t.setData(m.AxisTypeNone,!1)}static haveCharAxesAxesPrimaryVertical(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.PrimaryVertical)){let o=i.filter(l=>l.seriesType===te.PrimaryValue&&l.axisType===Oe.None);t.setData(m.AxesPrimaryVertical,!!o.length)}else t.setData(m.AxesPrimaryVertical,!1)}}static haveCharAxesPrimaryHorizontal(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.PrimaryHorizontal)){let o=i.filter(l=>l.seriesType===te.PrimaryValue&&l.axisType===Oe.None);t.setData(m.AxesPrimaryHorizontal,!!o.length)}else t.setData(m.AxesPrimaryHorizontal,!1)}}static haveCharAxesAxesSecondaryHorizontal(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.SecondaryHorizontal)){let o=i.filter(l=>l.seriesType===te.SecondaryCategory&&l.axisType===Oe.None);t.setData(m.AxesSecondaryHorizontal,!!o.length)}else t.setData(m.AxesSecondaryHorizontal,!1)}}static haveCharAxesAxesSecondaryVertical(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.SecondaryVertical)){let o=i.filter(l=>l.seriesType===te.SecondaryValue&&l.axisType===Oe.None);t.setData(m.AxesSecondaryVertical,!!o.length)}else t.setData(m.AxesSecondaryVertical,!1)}}static haveCharAxisTitlesPrimaryHorizontal(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.PrimaryHorizontal)){let o=i.filter(l=>l.seriesType===te.PrimaryCategory&&l.axisType===Oe.Title);t.setData(m.AxisTitlesPrimaryHorizontal,!!o.length)}else t.setData(m.AxisTitlesPrimaryHorizontal,!1)}}static haveCharAxisTitlesPrimaryVertical(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.PrimaryVertical)){let o=i.filter(l=>l.seriesType===te.PrimaryValue&&l.axisType===Oe.Title);t.setData(m.AxisTitlesPrimaryVertical,!!o.length)}else t.setData(m.AxisTitlesPrimaryVertical,!1)}}static haveCharAxisTitlesSecondaryHorizontal(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.SecondaryHorizontal)){let o=i.filter(l=>l.seriesType===te.SecondaryCategory&&l.axisType===Oe.Title);t.setData(m.AxisTitlesSecondaryHorizontal,!!o.length)}else t.setData(m.AxisTitlesSecondaryHorizontal,!1)}}static haveCharAxisTitlesSecondaryVertical(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(uc(a,yn.SecondaryVertical)){let o=i.filter(l=>l.seriesType===te.SecondaryValue&&l.axisType===Oe.Title);t.setData(m.AxisTitlesSecondaryVertical,!!o.length)}else t.setData(m.AxisTitlesSecondaryVertical,!1)}}static haveCharGridlinesPrimaryMajorHorizontal(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(a.axes().primaryCategory){let o=i.filter(l=>l.seriesType===te.PrimaryCategory&&l.axisType===Oe.MajorGridLine);t.setData(m.GridLinesPrimaryMajorHorizontal,!!o.length),o=i.filter(l=>l.seriesType===te.PrimaryCategory&&l.axisType===Oe.MinorGridLine),t.setData(m.GridLinesPrimaryMinorHorizontal,!!o.length)}else t.setData(m.GridLinesPrimaryMajorHorizontal,!1),t.setData(m.GridLinesPrimaryMinorHorizontal,!1)}}static haveCharGridlinesPrimaryMinorVertical(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(a.axes().primaryValue){let o=i.filter(l=>l.seriesType===te.PrimaryValue&&l.axisType===Oe.MajorGridLine);t.setData(m.GridLinesPrimaryMajorVertical,!!o.length),o=i.filter(l=>l.seriesType===te.PrimaryValue&&l.axisType===Oe.MinorGridLine),t.setData(m.GridLinesPrimaryMinorVertical,!!o.length)}else t.setData(m.GridLinesPrimaryMajorVertical,!1),t.setData(m.GridLinesPrimaryMajorVertical,!1)}}static haveCharGridlinesSecondaryMinorHorizontal(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(a.axes().secondaryCategory){let o=i.filter(l=>l.seriesType===te.SecondaryCategory&&l.axisType===Oe.MajorGridLine);t.setData(m.GridLinesSecondaryMajorHorizontal,!!o.length),o=i.filter(l=>l.seriesType===te.SecondaryCategory&&l.axisType===Oe.MinorGridLine),t.setData(m.GridLinesSecondaryMinorHorizontal,!!o.length)}else t.setData(m.GridLinesSecondaryMajorHorizontal,!1),t.setData(m.GridLinesSecondaryMinorHorizontal,!1)}}static haveCharGridlinesSecondaryMinorVertical(t){let i=t.getData(m.ChartAllSeriesList),n=t.Spread,a=pe.getActiveChart(n);if(a){if(!i)return;if(a.axes().secondaryValue){let o=i.filter(l=>l.seriesType===te.SecondaryValue&&l.axisType===Oe.MajorGridLine);t.setData(m.GridLinesSecondaryMajorVertical,!!o.length),o=i.filter(l=>l.seriesType===te.SecondaryValue&&l.axisType===Oe.MinorGridLine),t.setData(m.GridLinesSecondaryMinorVertical,!!o.length)}else t.setData(m.GridLinesSecondaryMajorVertical,!1),t.setData(m.GridLinesSecondaryMinorVertical,!1)}}static haveCharDataLabelsShow(t){let i=t.Spread,n=pe.getActiveChart(i);if(n){let a,r=n.getSelectedSeries();r?a=r.ChartType:a=n.chartType();let o=pe.getChartGroup(a),l=rle(),c={};l.forEach(d=>{let{type:u,items:h}=d,g=u===o;h.forEach(f=>{c[f]||(g&&(c[f]=!0),t.setData(f,g))})})}}static allowResizeColumns(t){let i=C.getActiveSheet(t.Spread),n=!0;i&&Tn.needCheckProtectionOptions(i)&&(i.options.protectionOptions.allowResizeColumns||(n=!1)),t.setData(m.AllowResizeColumns,n)}static needActive(t){let i=t.getData(re.osEnv);i&&t.setData(re.needActive,i.needActive())}static chartGroup(t){if(!GC.Spread.Sheets.Charts)t.setData(m.ChartGroup,Se.None);else{let i=pe.getChartGroup(pe.chartType(t.Spread));t.setData(m.ChartGroup,i)}}static hasCellTypes(t){let i=C.getActiveSheet(t.Spread);if(i){let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.getStyle(n,a),o=r&&r.cellType&&r.cellType.typeName!=="1"&&r.cellType.typeName!=="18";t.setData(m.HasCellTypes,o);let l=[GC.Spread.Sheets.CellTypes.Button,GC.Spread.Sheets.CellTypes.ButtonList,GC.Spread.Sheets.CellTypes.CheckBox,GC.Spread.Sheets.CellTypes.CheckBoxList,GC.Spread.Sheets.CellTypes.ComboBox,GC.Spread.Sheets.CellTypes.DataObject,GC.Spread.Sheets.CellTypes.RadioButtonList,GC.Spread.Sheets.CellTypes.RangeTemplate,GC.Spread.Sheets.CellTypes.FileUpload];if(o){for(let c=0;c<l.length;c++){let d=l[c];if(r.cellType instanceof d){t.setData(m.HasEditableCellTypes,!1);return}}t.setData(m.HasEditableCellTypes,!0)}else t.setData(m.HasEditableCellTypes,!1)}}static hasCellButtons(t){let i=C.getActiveSheet(t.Spread);if(i){let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.getStyle(n,a),o=r&&r.cellType&&r.cellType.typeName==="18",l=r&&r.cellButtons&&r.cellButtons.length>0;t.setData(m.HasCellButtons,!o&&l)}}static isProtected(t){let i=C.getActiveSheet(t.Spread),n=t.getData(m.IsInTableSheetDesignMode);t.setData(m.IsProtected,!n&&i&&i.options.isProtected)}static isActualProtected(t){let i=C.getActiveSheet(t.Spread),n=t.getData(m.IsInTableSheetDesignMode);t.setData(m.IsActualProtected,!n&&i&&i.isActualProtected())}static enableAccessibility(t){t.setData(m.EnableAccessibility,t.Spread.options.enableAccessibility)}static cellLocked(t){let i=C.getActiveSheet(t.Spread),n=!1;if(i){let a=i.getActiveRowIndex(),r=i.getActiveColumnIndex();Ae.isFullCol(i)?n=i.getCell(-1,r).locked():Ae.isFullRow(i)?n=i.getCell(a,-1).locked():n=i.getCell(a,r).locked()}t.setData(m.CellLocked,n)}static _isAcrossTables(t){try{if(t)return t.isAcrossTables&&t.isAcrossTables()}catch{}return!1}static tableInsertRowAbove(t){let i=t.Spread.getActiveSheet(),n=i&&i.tables,a=!0;n&&(n.isAcrossTables&&n.isAcrossTables()||n.containTableHeader()||n.noRoomToInsertRow())&&(a=!1),t.setData(m.TableInsertRowAbove,a)}static tableInsertRowBelow(t){let i=t.Spread.getActiveSheet(),n=i&&i.tables,a=!0;n&&(n.isAcrossTables&&n.isAcrossTables()||n.noRoomToInsertRow())&&(a=!1),t.setData(m.TableInsertRowBelow,a)}static tableInsertColumnLeftRight(t){let i=t.Spread.getActiveSheet(),n=i&&i.tables,a=!0;n&&(n.isAcrossTables&&n.isAcrossTables()||n.noRoomToInsertColumn())&&(a=!1),t.setData(m.TableInsertColumnLeft,a),t.setData(m.TableInsertColumnRight,a)}static checkTableLastCol(t){let i=!1,n=t.Spread.getActiveSheet();if(n){let a=n.getSelections(),r=bm(n,a[0]),o=n.getActiveColumnIndex();r&&(i=!r.checkTableLastCol(o))}t.setData(m.IsLastTableCol,i)}static checkTableLastRow(t){let i=!1,n=t.Spread.getActiveSheet();if(n){let a=n.getSelections(),r=bm(n,a[0]),o=n.getActiveRowIndex();r&&(i=!r.checkTableLastRow(o))}t.setData(m.IsLastTableRow,i)}static hasComments(t){let i=t.Spread.getActiveSheet();if(i){let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.comments.get(n,a);t.setData(m.HasComments,!!r)}else t.setData(m.HasComments,!1)}static hasThreadedComments(t){var o,l;let i=t.Spread.getActiveSheet(),n=!1,a=!1,r=!1;if(i){let c=i.getActiveRowIndex(),d=i.getActiveColumnIndex();try{let u=(o=i.threadedComments)==null?void 0:o.get(c,d);if(n=!!u,n)a=!0,r=u?u.resolved():!1;else if(((l=i.threadedComments)==null?void 0:l.size())>0){const h=i.getSelections();a=i.threadedComments.hasComments(h)}}catch{n=!1,r=!1}}t.setData(m.HasThreadedComments,a),t.setData(m.ActiveCellHasThreadedComment,n),t.setData(m.ActiveCellHasResolvedThreadedComment,r)}static allSheetsHaveThreadedComments(t){const n=t.Spread.sheets.some(a=>{var r;return((r=a.threadedComments)==null?void 0:r.size())>0});t.setData(m.AllSheetsHaveThreadedComments,n)}static selectedOrEditComments(t){let i=t.Spread.getActiveSheet();if(t.setData(m.SelectedOrEditComments,!1),i){let n=i.comments.all();for(let a=0;a<n.length;a++)if(n[a].commentState()!==GC.Spread.Sheets.Comments.CommentState.normal){t.setData(m.SelectedOrEditComments,!0);return}}}static clickTable(t){let n=t.Spread.getActiveSheet();if(n){let a=n.getActiveRowIndex(),r=n.getActiveColumnIndex(),o=!!n.tables.find(a,r);t.setData(m.TableClicked,!!o),t.setData(m.TableAllowResize,!!n.tables.allowResize(n.tables.find(a,r)))}}static toggleBetweenConvertTableAndDataTable(t){let i=t.Spread,n=i==null?void 0:i.getActiveSheet(),a=!1;if(n){let r=n.getActiveRowIndex(),o=n.getActiveColumnIndex(),l=n.tables.find(r,o);if(l){let c=l.getBindingSource(),d;typeof c=="string"?d=c:c&&c.name&&(d=c.name),a=!!i.dataManager().tables[d]}}t.setData(m.TableBindingDataTable,a)}static allowAddTableFromDataTable(t){let i=t.Spread,n=i==null?void 0:i.getActiveSheet(),a=i==null?void 0:i.dataManager().tables,r=n&&!Eb(t)&&a&&Object.keys(a).length>0;t.setData(m.TableAllowAddFromDataTable,r)}static tableSelected(t){let i=C.getActiveSheet(t.Spread);if(!i){t.setData(m.TableSelected,!1);return}let n=vi.getSelectedSlicers(i)[0],a=n&&n.isSelected(),r=pe.getSelectedChart(i),o;r&&r.isSelected()?o=r:o=void 0;let l=ut.getSelectedShapes(i)[0],c;l&&l.isSelected()?c=l:c=void 0;let d=a||o!=null||c!=null,h=i.tables.find(i.getActiveRowIndex(),i.getActiveColumnIndex())||void 0,g=!d&&h!==null&&h!==void 0;g!==t.getData(m.TableSelected)&&(t.setData(m.TableSelected,g),g&&t.activeRibbonTab("tableDesign"))}static pivotTableSelected(t){if(t._disposed)return;let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables){t.setData(m.PivotTableSelected,!1);return}let n=vi.getSelectedSlicers(i)[0],a=n&&n.isSelected(),r=pe.getSelectedChart(i),o;r&&r.isSelected()?o=r:o=void 0;let l=ut.getSelectedShapes(i)[0],c;l&&l.isSelected()?c=l:c=void 0;let d=a||o!=null||c!=null,h=i.pivotTables.findPivotTable(i.getActiveRowIndex(),i.getActiveColumnIndex())||void 0,g=!d&&h!==null&&h!==void 0;t.setData(m.PivotTableSelected,g)}static pivotSlicerSelected(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=vi.getSelectedSlicers(i,!0),a=vi.getSelectedPivotSlicers(i),r=vi.getSelectedPivotTimelines(i);t.setData(m.TimelineSelected,r.length>0),t.setData(m.OnlyOnePivotSlicerSelected,n.length===a.length&&a.length+r.length===1)}static pivotProtection(t){let i=C.getActiveSheet(t.Spread);!i||!i.pivotTables||(t.setData(m.ProtectedPivotTable,!1),t.setData(m.ProtectedPivotTableStyle,!1),i.options.isProtected&&(i.options.protectionOptions.allowUsePivotTable?i.options.protectionOptions.formatCells||t.setData(m.ProtectedPivotTableStyle,!0):(t.setData(m.ProtectedPivotTable,!0),t.setData(m.ProtectedPivotTableStyle,!0))))}static filterSelected(t){let i=C.getActiveSheet(t.Spread),n=i&&i.rowFilter&&i.rowFilter();if(t.setData(m.FilterSelected,!1),C.isNullOrUndefined(n))return!1;let a=n.range,r=i.getSelections();for(let o=0;o<r.length;o++){let l=r[o];if(a!=null&&a.intersect(l.row,l.col,l.rowCount,l.colCount)){t.setData(m.FilterSelected,!0);return}}}static chartSelected(t){let i=C.getActiveSheet(t.Spread);if(!i){t.setData(m.ChartSelected,!1),t.setData(m.CanFormatChart,!1);return}let n=i.options,a=pe.getSelectedChart(i),r;a&&a.isSelected()?r=a:r=void 0;let o=r!==void 0&&(n.protectionOptions.allowEditObjects||!(i.isActualProtected()&&r.isLocked()));t.setData(m.ChartSelected,o),o||t.setData(m.ChartAltTextPanelVisible,!1),t.setData(m.CanFormatChart,pe.canFormatChart(i))}static shapeSelected(t){var g;let i=C.getActiveSheet(t.Spread);if(!i){t.setData(m.ShapeSelected,!1),t.setData(m.SelectedShapesAllowShowRibbon,!1),t.setData(m.PictureShapeSelected,!1);return}let n=(g=i.dataCharts)==null?void 0:g.all().some(f=>f.isSelected()),a=!1;if(GC.Spread.Report&&i instanceof GC.Spread.Report.TemplateSheet){let f=i.getTemplateCell(i.getActiveRowIndex(),i.getActiveColumnIndex());a=f&&f.type==="Chart"&&!!f.dataChartName}t.setData(m.DataChartSelected,n),t.setData(m.CellBindingDataChartSelected,a),t.setData(m.DataChartSelectedForReportCellPanelVisible,!n||a);let r=ut.getSelectedShapes(i),o=r[0],l;o&&o.isSelected()?l=o:l=void 0;let c=l!==void 0&&(i.options.protectionOptions.allowEditObjects||!(i.isActualProtected()&&l.isLocked()));t.setData(m.ShapeSelected,c);const d=f=>{!f&&!t._disposed&&(t.setData(m.ShowShapePropertyPanel,!1),t.setData(m.ShapeAltTextPanelVisible,!1))};Tn._setShapePanelStateHandler&&window.clearTimeout(Tn._setShapePanelStateHandler),Tn._setShapePanelStateHandler=window.setTimeout(()=>{d(c)});let[u,h]=ut.getShapeHyperlinkInfo(i);t.setData(m.WithShapeHyperlink,h),t.setData(m.OnlyOneShapeSelected,u),t.setData(m.OnlyOneShapeTypeShapeSelected,u&&l instanceof GC.Spread.Sheets.Shapes.Shape),t.setData(m.PictureShapeSelected,ole(r)),t.setData(m.CanChangeShapeType,lle(r)),t.setData(m.SelectedShapesAllowShowRibbon,sle(r)),t.setData(m.CanEditTextShape,u&&ut.isSupportEditTextShape(l)),t.setData(m.CanRotateShape,dle(r)),t.setData(m.SupportHyperLinkShape,cle(r)),t.setData(m.HaveMultipleShapes,i.shapes.all().length>1),t.setData(m.CanFormatChart,pe.canFormatChart(i))}static floatingObjectSelected(t){let i=C.getActiveSheet(t.Spread);if(!i){t.setData(m.FloatingObjectSelected,!1);return}let n=i.floatingObjects.all().filter(a=>a.isSelected());t.setData(m.FloatingObjectSelected,n.length>0)}static pictureSelected(t){let i=C.getActiveSheet(t.Spread);if(t.setData(m.AllowEditObject,!0),!i){t.setData(m.AllowEditObject,!1);return}i.pictures.all().filter(a=>a.isSelected()).length>0?(t.setData(m.hideContextMenu,!0),t.setData(m.pictureSelected,!0)):(t.setData(m.PictureAltTextPanelVisible,!1),t.setData(m.hideContextMenu,!1),t.setData(m.pictureSelected,!1))}static allowEditObject(t){let i=C.getActiveSheet(t.Spread);if(!i)return;let n=i.isActualProtected(),a=i.options.protectionOptions,r=!0;n&&a&&(a.allowEditObjects||(r=!1)),t.setData(m.AllowEditObject,r)}static allowUndoListDropdown(t){const i=t.Spread.undoManager();t.setData(m.AllowAccessBarRedo,i&&i.canRedo()),t.setData(m.AllowAccessBarUndo,i&&i.canUndo());let n=i&&i.getUndoStack()||[],a=i&&i.getRedoStack()||[];t.setData(m.allowShowUndoList,n.length!==0),t.setData(m.allowShowRedoList,a.length!==0)}static slicerSelected(t){var l;let i=C.getActiveSheet(t.Spread);if(!i)return;let n=t.getData(re.selectedSlicer);n&&!((l=i.slicers)!=null&&l.get(n.name()))&&(n=null);let a=n&&(i.options.protectionOptions.allowEditObjects||!i.isActualProtected())||!1;t.setData(m.SlicerSelected,a);let r=!i.isActualProtected()||i.isActualProtected()&&i.options.protectionOptions.allowEditObjects,o=ut.getSelectedShapes(i);t.setData(m.CanFormatSlicer,r&&o.length>0&&o.every(c=>vi.isItemSlicerShape(c)))}static formulaSparklineSelected(t){let i=t.Spread,n=C.getActiveSheet(i);if(!n)return;let a=vi.getSelectedSlicers(n)[0],r=pe.getSelectedChart(n),o=ut.getSelectedShapes(n)[0],l=a||r||o,c=n.getActiveRowIndex(),d=n.getActiveColumnIndex(),u=n.getSelections(),h=!1;if(u&&u.length>=1){let g=!1,f=Ae.parseFormulaSparkline(i,c,d);f&&["BC_QRCODE","BC_EAN13","BC_EAN8","BC_CODABAR","BC_CODE39","BC_CODE93","BC_CODE128","BC_GS1_128","BC_CODE49","BC_PDF417","BC_DATAMATRIX"].indexOf(f.functionName)===-1&&(g=!0),h=g&&!l}t.setData(m.FormulaSparklineSelected,h)}static sparklineSelected(t){let i=t.Spread,n=C.getActiveSheet(i);if(t.setData(m.AllowSparklineGallery,!0),!n){t.setData(m.AllowSparklineGallery,!1);return}let a=vi.getSelectedSlicers(n)[0],r=pe.getSelectedChart(n),o=ut.getSelectedShapes(n)[0],l=a||r||o,d=n.getSparkline(n.getActiveRowIndex(),n.getActiveColumnIndex())instanceof GC.Spread.Sheets.Sparklines.Sparkline&&!l;t.setData(m.SparklineSelected,d),t.setData(m.UpdateSparkLine,!1)}static barCodeSelected(t){let i=C.getActiveSheet(t.Spread);if(!i)return;let n=t.Spread,a=i.getActiveRowIndex(),r=i.getActiveColumnIndex(),o=i.getSelections(),l=!1,c=vi.getSelectedSlicers(i)[0],d=pe.getSelectedChart(i),u=ut.getSelectedShapes(i)[0],h=c||d||u;if(o&&o.length>=1){let g=!1,f=Ae.parseFormulaSparkline(n,a,r);f&&["BC_QRCODE","BC_EAN13","BC_EAN8","BC_CODABAR","BC_CODE39","BC_CODE93","BC_CODE128","BC_GS1_128","BC_CODE49","BC_PDF417","BC_DATAMATRIX"].indexOf(f.functionName)!==-1&&(g=!0),l=g&&!h}t.setData(m.BarCodeSelected,l),l&&t.activeRibbonTab("barcodeDesignId")}static TableHasStyle(t){let i=C.getActiveSheet(t.Spread);if(!i)return;let n=i.getSelections(),a=bm(i,n[0]),r=!1;a&&(r=!!a.style()),t.setData(m.TableHasStyle,r)}static ActivePivotTableProps(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.pivotTables.findPivotTable(i.getActiveRowIndex(),i.getActiveColumnIndex()),a=!1,r=!1;if(n){let o=n.theme();o&&o.name()!=="light0"&&(a=!0);let l=n.getAllSlicers&&n.getAllSlicers();l&&l.length>0&&(r=!0)}t.setData(m.PivotTableHasStyle,a),t.setData(m.ActivePivotTableHasSlicer,r)}static PivotTableClearFilter(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.pivotTables.findPivotTable(i.getActiveRowIndex(),i.getActiveColumnIndex());if(n){let a=n.getFieldsByArea(GC.Spread.Pivot.PivotTableFieldType.filterField),r=n.getFieldsByArea(GC.Spread.Pivot.PivotTableFieldType.rowField),o=n.getFieldsByArea(GC.Spread.Pivot.PivotTableFieldType.columnField);if(a.length){t.setData(m.PivotTableClearFilter,!0);return}let l=r.concat(o),c=l.length,d;for(let u=0;u<c;u++)if(d=l[u].fieldName,n.labelFilter(d)||n.valueFilter(d)){t.setData(m.PivotTableClearFilter,!0);return}t.setData(m.PivotTableClearFilter,!1)}}static PivotTableCalcItem(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.pivotTables.findPivotTable(i.getActiveRowIndex(),i.getActiveColumnIndex());if(n){let a=n.getPivotInfoImp(i.getActiveRowIndex(),i.getActiveColumnIndex());if(a&&a.menuArea!==5&&(!C.isNullOrUndefined(a.activeRowFieldInfo)||!C.isNullOrUndefined(a.cornerFieldInfo)||!C.isNullOrUndefined(a.activeColFieldInfo)||!C.isNullOrUndefined(a.colHeadFieldInfo))){t.setData(m.PivotTableCalcItem,!0);return}}t.setData(m.PivotTableCalcItem,!1)}static PivotTableFieldSetting(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a);if(r){let o=r.getPivotInfoImp(n,a),l=o.area===4||!!o.activeRowFieldInfo||!!o.activeColFieldInfo||!!o.pageFieldInfo||!!o.colHeadFieldInfo||!!o.cornerFieldInfo||o.menuArea===5,c=o.menuArea===3,d=o.colHeadFieldInfo&&o.colHeadFieldInfo.fieldName===s.contextMenu.sigmaValueTemp;t.setData(m.PivotTableFieldSetting,l&&!c&&!d)}}static PivotTableGroupSelectionAndUnGroup(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a);if(r){let o=r.getPivotInfoImp(n,a,!0);if(o){let{activeColFieldInfo:l,colHeadFieldInfo:c,cornerFieldInfo:d,activeRowFieldInfo:u}=o;l||c||d||u||o.area===3&&o.menuArea===2?(t.setData(m.PivotTableGroupSelection,!0),t.setData(m.PivotTableUnGroupField,!0)):(t.setData(m.PivotTableGroupSelection,!1),t.setData(m.PivotTableUnGroupField,!1))}}}static pivotTableCollapseField(t){kt.queueMacroTask(()=>{if(t._disposed)return;let i=C.getActiveSheet(t.Spread);if(t.setData(m.PivotTableCollapseField,!1),!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a);t.setData(m.PivotTableCollapseField,NR(r,n,a))})}static PivotTableGroupField(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a);if(r){let o=r.getPivotInfoImp(n,a,!0),l=GC.Pivot.PivotDataType.number,c=GC.Pivot.PivotDataType.date,d;if(o){let{activeColFieldInfo:u,colHeadFieldInfo:h,cornerFieldInfo:g,activeRowFieldInfo:f}=o;if(u?d=u.name:f?d=f.name:h?d=h.fieldName:g&&(d=g.fieldName),!C.isNullOrUndefined(d)){let b=r.getField(d);if(!C.isNullOrUndefined(b)){let S=b.dataType;if(d&&(S===l||S===c)){t.setData(m.PivotTableGroupField,!0),t.setData(m.PivotTableCurrentFieldName,d);return}}}}t.setData(m.PivotTableGroupField,!1),t.setData(m.PivotTableCurrentFieldName,"")}}static PivotTableShowFilterPage(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.pivotTables.findPivotTable(i.getActiveRowIndex(),i.getActiveColumnIndex());if(n){let a=n.getFieldsByArea(GC.Spread.Pivot.PivotTableFieldType.filterField);if(a&&a.length>0){t.setData(m.PivotTableShowFilterPage,!0);return}}t.setData(m.PivotTableShowFilterPage,!1)}static rowOrColIncludeSpanOrTable(t){let i=t.Spread.getActiveSheet();if(!i)return;let n=i.getActiveColumnIndex(),a=i.getActiveRowIndex(),r=!0,o=!0,l=i.getSelections()[0];if(l&&l.row!==-1&&l.col!==-1&&l.rowCount!==i.getRowCount()&&l.colCount!==i.getColumnCount()&&i.tables){let d=i.tables.all();for(let u=0;u<d.length;u++){let h=d[u].range();n>h.col&&n<h.col+h.colCount&&o&&(t.setData(re.colIncludeTableSpan,!0),o=!1),a>h.row&&a<h.row+h.rowCount&&r&&(t.setData(re.rowIncludeTableSpan,!0),r=!1)}}let c=i.getSpans();for(let d=0;d<c.length;d++){let u=c[d];n>u.col&&n<u.col+u.colCount&&o&&(t.setData(re.rowIncludeTableSpan,!0),o=!1),a>u.row&&a<u.row+u.rowCount&&r&&(t.setData(re.colIncludeTableSpan,!0),r=!1)}r&&t.setData(re.rowIncludeTableSpan,!1),o&&t.setData(re.colIncludeTableSpan,!1)}static GroupShapeSelected(t){let i=C.getActiveSheet(t.Spread);if(!i)return;let n=i.shapes.all(),a=!1,r=0,o=0;for(let l=0;l<n.length;l++)if(n[l].isSelected()){r++,n[l]instanceof GC.Spread.Sheets.Shapes.GroupShape&&(a=!0);let c=GC.Spread.Sheets.Shapes.ConnectorShape;n[l]instanceof c?n[l].startConnector()===null&&n[l].endConnector()===null&&o++:o++}if(t.setData(m.GroupShapeSelected,a),t.setData(m.OnlyOneShapeSelected,r===1),t.setData(m.ShapeDistributeEnabled,o>2),r===1){let l=ut.getSelectedShapes(i)[0];t.setData(m.OnlyOneShapeTypeShapeSelected,l instanceof GC.Spread.Sheets.Shapes.Shape)}}static CanDoSort(t){let i=C.getActiveSheet(t.Spread);if(!i){t.setData(m.CanDoSort,!1);return}let n=!0;Tn.needCheckProtectionOptions(i)&&(i.options.protectionOptions.allowSort||(n=!1)),t.setData(m.CanDoSort,n)}static AutomaticCalc(t){t.setData(m.AutomaticCalc,t.Spread.options.calculationMode===0)}static CanDeleteTableRowsColumns(t){let i=t.Spread.getActiveSheet();if(!i)return;let n=i.tables,a=!0,r=!0;n&&(n.checkTableRow()||Tn._isAcrossTables(n)||n.containTableHeaderTotalRow()&&!n.isWholeTableRow())&&(r=!1),n&&(n.checkTableCol()||Tn._isAcrossTables(n))&&(a=!1),t.setData(m.CanDeleteTableColumns,a),t.setData(m.CanDeleteTableRows,r)}static IsConvertEntireSheetRows(t){let i=t.Spread.getActiveSheet();if(!i)return;let n=!1,a=i&&i.getSelections()[0];if(a){let r=i.tables.find(a.row,a.col);if(r){let o=r.rowFilter();o&&o.isFiltered()&&(n=!0)}}t.setData(m.IsConvertEntireSheetRows,n)}static isInPivotPageFilterArea(t){let i=C.getActiveSheet(t.Spread);if(t.setData(m.InPivotPageFilterArea,!1),!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a),o=r&&r.getPivotInfoImp(n,a,!1,!1,!0),l=o&&o.menuArea===0;t.setData(m.InPivotPageFilterArea,l)}static isInPivotCornerArea(t){let i=C.getActiveSheet(t.Spread);if(t.setData(m.InPivotCornerArea,!1),!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a),o=r&&r.getPivotInfoImp(n,a,!1,!1,!0),l=o&&o.menuArea===1;t.setData(m.InPivotCornerArea,l)}static isInPivotEmptyLabelArea(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a),o=r&&r.getPivotInfoImp(n,a,!1,!1,!0),l=o&&o.menuArea===3;t.setData(m.InPivotEmptyLabelArea,l)}static isInPivotHeaderArea(t){let i=C.getActiveSheet(t.Spread);if(t.setData(m.InPivotHeaderArea,!1),!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a),o=r&&r.getPivotInfoImp(n,a,!1,!1,!0),l=o&&o.menuArea===2||!1;t.setData(m.InPivotHeaderArea,l)}static isInPivotGrandTotalArea(t){let i=C.getActiveSheet(t.Spread);if(t.setData(m.InPivotGrandTotalArea,!1),!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a),o=r&&r.getPivotInfoImp(n,a,!1,!1,!0),l=o&&o.menuArea===5;t.setData(m.InPivotGrandTotalArea,l)}static isInPivotContentArea(t){let i=C.getActiveSheet(t.Spread);if(t.setData(m.InPivotContentArea,!1),!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a),o=r&&r.getPivotInfoImp(n,a,!1,!1,!0),l=o&&o.menuArea===4;t.setData(m.InPivotContentArea,l)}static isPivotContextMenuCornerShouldShow(t){let i=C.getActiveSheet(t.Spread);if(t.setData(m.PivotContextMenuCornerShouldShow,!1),!i||!i.pivotTables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a);t.setData(m.PivotContextMenuCornerShouldShow,NR(r,n,a))}static isPivotContextMenuGroupShouldShow(t){let i=!0,n=C.getActiveSheet(t.Spread);if(!n||!n.pivotTables)return;let a=n.getActiveRowIndex(),r=n.getActiveColumnIndex(),o=n.pivotTables.findPivotTable(a,r);t.setData(m.PivotContextMenuGroupShouldShow,!1);let l=o&&o.getPivotInfoImp(a,r,!1,!1,!0);if(l){let{cornerFieldInfo:c,colHeadFieldInfo:d}=l;(c||d)&&(i=!1),t.setData(m.PivotContextMenuGroupShouldShow,i)}}static isPivotContextMenuSubtotalShouldShow(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;t.setData(m.PivotContextMenuSubtotalShouldShow,!1);let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.pivotTables.findPivotTable(n,a),o=r&&r.getPivotInfoImp(n,a,!1,!1,!0);(o==null?void 0:o.menuArea)===2&&t.setData(m.PivotContextMenuSubtotalShouldShow,!0)}static isPivotContextEmptyValueFieldShouldShow(t){let i=!0,n=C.getActiveSheet(t.Spread);if(t.setData(m.PivotContextMenuEmptyValueFieldShouldShow,!1),t.setData(m.PivotContextMenuHasValueField,!1),!n||!n.pivotTables)return;let a=!0,r=n.getActiveRowIndex(),o=n.getActiveColumnIndex(),l=n.pivotTables.findPivotTable(r,o),c=l&&l.getPivotInfoImp(r,o,!1,!1,!0);if(c){let{valueFieldName:d,menuArea:u,area:h}=c;!d&&u===4&&h===4&&(i=!1);let g=l.getFieldsByArea(GC.Spread.Pivot.PivotTableFieldType.valueField);(!g||g.length===0)&&(a=!1),t.setData(m.PivotContextMenuEmptyValueFieldShouldShow,i),t.setData(m.PivotContextMenuHasValueField,a)}}static pivotTableHasSettingFieldName(t){let i=OR(t),n=i&&i!==s.contextMenu.sigmaValueTemp;t.getData(m.PivotTableHasSettingName)!==n&&t.setData(m.PivotTableHasSettingName,n)}static pivotTableFieldHeaders(t){let i=Mt(t);i&&i.options.showHeaders?t.setData(m.PivotTableFieldHeaders,!0):t.setData(m.PivotTableFieldHeaders,!1)}static sheetSelectionIntersectPivotTable(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.pivotTables)return;let n=i.pivotTables.all(),a=i.getSelections();for(let r=0;r<n.length;r++){let o=n[r],{page:l,content:c}=o.getRange();for(let d=0;d<a.length;d++){let u=a[d],{row:h,col:g,rowCount:f,colCount:b}=u;if(c.intersect(h,g,f,b)||l&&l.intersect(h,g,f,b)){t.setData(m.SheetSelectionIntersectPivotTable,!0);return}}}t.setData(m.SheetSelectionIntersectPivotTable,!1)}static shouldClearFilterFromShow(t){let i=!0,n=!0,a=C.getActiveSheet(t.Spread);if(!a||!a.pivotTables)return;let r=a.getActiveRowIndex(),o=a.getActiveColumnIndex(),l=a.pivotTables.findPivotTable(r,o),c=l&&l.getPivotInfoImp(r,o,!1,!1,!0);if(c){let{activeRowFieldInfo:d,activeColFieldInfo:u,cornerFieldInfo:h,colHeadFieldInfo:g}=c,f=d&&d.name||u&&u.name||g&&g.fieldName||h&&h.fieldName,b=f&&l.labelFilter(f),S=!1,y=!1;b&&(b.condition&&(S=!0),b.textItem&&!b.textItem.isAll&&(S=!0)),y=!!(f&&l.valueFilter(f)),!S&&!y&&(i=!1),(h||g)&&(n=!1),t.setData(m.PivotContextMenuClearFilterFromShow,i),t.setData(m.PivotContextMenuKeepOrHideSelectedItems,n)}}static tableSheetActive(t){let i=t.Spread.getActiveSheetTab(),n=C._isTableSheet(i);if(t.setData(m.TableSheetActive,n),!n)t.setData(re.tableSheetUpdatedIsPrimaryKey,!0),t.setData(re.tableSheetSelectedExcludeGroupColumn,!0),t.setData(re.tableSheetSelectedCalcColumn,!0),t.setData(re.tableSheetSelectedExcludeGroupSliceColumn,!0),t.setData(re.tableSheetGrouped,!1);else{t.setData(re.tableSheetUpdatedIsPrimaryKey,!i.isHierarchyParent());let a=!!i.groupBy();t.setData(re.tableSheetGrouped,a)}if(t.getData(m.IsToggleTableSheetPanel)){t.setData(m.IsToggleTableSheetPanel,!1);return}i!==t.getData(re.tableSheet)&&t.setData(re.tableSheet,i)}static tableSheetDefineColumnActive(t){let i=Nb(t)&&t.Spread.getActiveSheetTab().options.enableDefineColumn;t.setData(m.TableSheetDefineColumnActive,i)}static tableSheetHierarchyActive(t){let i=Nb(t)&&t.Spread.getActiveSheetTab().isShowHierarchyOutlineColumn();t.setData(m.TableSheetHierarchyActive,i)}static tableSheetRowActionActive(t){let i=t.Spread.getActiveSheetTab(),n=Nb(t)&&!C._isGanttSheet(i);t.setData(m.TableSheetRowActionActive,n)}static tableSheetBatchActive(t){var n;let i=Nb(t);if(i){let a=t.Spread,r=a.getActiveSheetTab();if(C._isTableSheet(r)){let o=a.dataManager().tables[r.getDataView().tableName];i=Koe(o);let l=r.rowActionOptions(),c="saveRow",d=l.findIndex(u=>u.name===c);if(i)d>-1&&(r._lastRowActionSaveRowIndex=d,l.splice(d,1),a.suspendPaint(),r.rowActionOptions(l),a.resumePaint());else{const u=(n=t.getData(m.TableSheetRowActionVisible))==null?void 0:n[r&&r.name()];if(d===-1&&u){let h=GC.Spread.Sheets.TableSheet.BuiltInRowActions;d=r._lastRowActionSaveRowIndex,C.isNullOrUndefined(d)||l.splice(d,0,h.saveRow),a.suspendPaint(),r.rowActionOptions(l),a.resumePaint()}}}}t.setData(m.TableSheetBatchActive,i)}static tableSheetColumnSelected(t){let i=t.Spread.getActiveSheetTab(),n=C._isTableSheet(i),a=!1;if(n){let r=i.getSelections();a=r[0]&&r[0].row===-1&&r[0].col!==-1}a&&!t.getData(m.TableSheetColumnSelected)&&t.activeRibbonTab()!=="tableSheetColumnSetting"&&t.activeRibbonTab("tableSheetColumnSetting"),t.setData(m.TableSheetColumnSelected,a)}static dataManagerActive(t){let i=t.Spread.getActiveSheetTab(),n=i&&!C._isTableSheet(i)&&!C._isReportSheet(i);t.setData(m.DataManagerActive,n)}static isZoomFactor(t){pb(t)}static hasBackground(t){t.Spread.options.backgroundImage?t.setData(m.HasBackground,!0):t.setData(m.HasBackground,!1);let n=C.getActiveSheet(t.Spread);n&&n.backgroundImage()?t.setData(m.HasWorksheetBackgroundImage,!0):t.setData(m.HasWorksheetBackgroundImage,!1)}static horizontalAlignment(t){let i=C.getActiveSheet(t.Spread);if(i){let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.getCell(n,a).hAlign();t.setData(m.IsCenterAcrossSelection,r===4)}}static selectRangeHasTable(t){t.setData(m.SelectRangeHasTable,tle(t.Spread)),t.setData(m.SelectRangeInTable,ile(t.Spread))}static allowFilterAndSort(t){let i=C.getActiveSheet(t.Spread);if(i&&i.isActualProtected()){let n=i.options.protectionOptions.allowSort;t.setData(m.AllowFilterAndSort,n===!0)}else{let n=t.getData(m.SelectRangeHasTable),a=t.getData(m.IsInTableSheetDesignMode),r=t.getData(m.ChartSelected),o=t.getData(m.pictureSelected),l=t.getData(m.ShapeSelected);t.setData(m.AllowFilterAndSort,!n&&!a&&!r&&!o&&!l)}}static allowDataValidation(t){let i=C.getActiveSheet(t.Spread);t.setData(m.AllowDataValidation,!!i)}static allowRemoveDuplicate(t){let i=C.getActiveSheet(t.Spread),n=i&&!t.getData(m.SelectRangeHasTable),a=i&&i.getSelections()[0];if(a){let r=i.tables.find(a.row,a.col);C.isNullOrUndefined(r)||(n=r.range().containsRange(a))}t.setData(m.AllowRemoveDuplicate,n)}static allowEditLinks(t){let i=C.getActiveSheet(t.Spread);t.setData(m.AllowEditLinks,!!i)}static allowTextToColumn(t){let i=C.getActiveSheet(t.Spread);t.setData(m.AllowTextToColumn,!!i&&!i.isActualProtected())}static allowOutline(t){let i=C.getActiveSheet(t.Spread);t.setData(m.AllowOutline,!!i)}static allowAutoGenerateLabel(t){let i=t.Spread.getActiveSheet();t.setData(m.AllowAutoGenerateLabel,!!i)}static allowDataBinding(t){let i=C.getActiveSheet(t.Spread),n=t.getData(m.AllowAccessBarOpen);t.setData(m.AllowDataBinding,!!i&&n!==!1)}static allowSheetBinding(t){let i=C.getActiveSheet(t.Spread);t.setData(m.AllowSheetBinding,!!i)}static allowSheetSettings(t){const i=C.getActiveSheetOrSheetTab(t.Spread);t.setData(m.AllowSheetSettings,!!i)}static allowGridLinesAndHeadersSetting(t){const i=C.getActiveSheetOrSheetTab(t.Spread),n=C._isGanttSheet(i)||C._isTableSheet(i);t.setData(m.AllowGridLinesAndHeadersSetting,!n)}static allowPrintCurrentSheet(t){let i=t.Spread,n=i.getActiveSheet()||i.getActiveSheetTab();t.setData(m.AllowPrintCurrentSheet,!!(n&&n.printInfo||C._isReportSheet(n)))}static ganttSheetActive(t){const i=t.Spread.getActiveSheetTab();let n=C._isGanttSheet(i);if(t.setData(m.GanttSheetActive,n),n){const a=i.project.sortState;a&&!a.keepStructure?t.setData(m.GanttSheetHasSortWithoutStructure,!0):t.setData(m.GanttSheetHasSortWithoutStructure,!1)}i!==t.getData(re.ganttSheet)&&t.setData(re.ganttSheet,i)}static ganttSheetTaskSelected(t){const i=t.Spread.getActiveSheetTab(),n=a=>!!a.getTaskByRow(a.getActiveRowIndex());t.setData(m.GanttSheetTaskSelected,C._isGanttSheet(i)&&n(i))}static ganttSheetHasPrimaryKeyField(t){const i=t.Spread.getActiveSheetTab(),a=C._isGanttSheet(i)&&i.project.taskManager.getPrimaryKeyField();t.setData(m.GanttSheetTaskHasPrimaryKeyField,a)}static isGanttSheetAllSelectionInCol(t){const i=t.Spread.getActiveSheetTab(),n=a=>{const r=a.getSelections();for(let o of r)if(o.row!==-1)return!1;return!0};t.setData(m.isGanttSheetAllSelectionInCol,C._isGanttSheet(i)&&n(i))}static isGanttSheetAllSelectionInRow(t){const i=t.Spread.getActiveSheetTab(),n=a=>{const r=a.getSelections();for(let o of r)if(o.col!==-1)return!1;return!0};t.setData(m.isGanttSheetAllSelectionInRow,C._isGanttSheet(i)&&n(i))}static isSelectGanttSheetGanttChartColumn(t){const i=t.Spread.getActiveSheetTab(),n=a=>{const r=a.getSelections(),o=a.getGanttColumnIndex();for(let l of r)if(l.col===o)return!0;return!1};t.setData(m.SelectGanttColumn,C._isGanttSheet(i)&&n(i))}static isGanttSheetHasComplete(t){const i=t.Spread.getActiveSheetTab(),n=a=>{var o;let r=(o=i.getDataView())==null?void 0:o.getColumnInfos();if(r){for(let l=0;l<r.length;l++)if(r[l].value==="complete")return!0}return!1};t.setData(m.GanttSheetHasComplete,C._isGanttSheet(i)&&n())}static tableSheetHasMultipleHeaderRows(t){let n=t.Spread.getActiveSheetTab();n&&C._isTableSheet(n)&&n.getRowCount(GC.Spread.Sheets.SheetArea.colHeader)>1?t.setData(m.TableSheetHasMultipleHeaderRows,!0):t.setData(m.TableSheetHasMultipleHeaderRows,!1)}static refreshBindingPathTableIndicator(t){let i=t.getData(re.bindingIndicatorManager),n=!!t.getData(m.FieldListVisible),a=t.getData(m.FileMenu_show);i&&(n||a)&&i.refreshBindingPathIndicator(t)}static enableClearFormat(t){let i=t.getData(m.AllowFormatCells),n=t.getData(m.ChartSelected),a=t.getData(m.ShapeSelected),r=t.getData(m.pictureSelected),o=t.getData(m.SlicerSelected),l=t.getData(m.SelectedOrEditComments),c=i&&!n&&!a&&!r&&!o&&!l;t.setData(m.EnableClearFormat,c)}static reportSheetMode(t){let i=t.Spread.getActiveSheetTab(),n,a=C._isReportSheet(i);t.setData(m.ReportSheetActive,a),a&&(n=i.renderMode()),t.setData(m.ParameterPanelVisible,n===dc||n===Jx),t.setData(m.ReportSheetIsDesignMode,n===Ux),t.setData(m.ReportSheetIsDataEntryPreviewMode,n===dc),t.setData(m.ReportSheetIsPaginatedPreviewMode,n===Jx),t.setData(m.ReportSheetIsPreviewMode,n===dc||n===Jx);let r=!1,o=!1,l=!0,c=!1;if(n===Ux){let d=i.getTemplate(),u=d.getActiveRowIndex(),h=d.getActiveColumnIndex(),g=C._getReportActiveContainerInfo(i),f=Math.min(8,d.getRowCount()-u),b=Math.min(5,d.getColumnCount()-h),S=d.containers();if(f>=2&&b>=2){let y=new GC.Spread.Sheets.Range(u,h,f,b);if(!g){r=!0;for(let v of S)if(y.intersect(v.ranges[1].row,v.ranges[1].col,v.ranges[1].rowCount,v.ranges[1].colCount+v.ranges[2].colCount)){r=!1;break}}}if(o=!!g,g){let y=d.getTemplateCell(u,h);if(!y||y.type==="Static"){let v=g.activeContainer.ranges.find(x=>x.contains(u,h));if(v){let{row:x,col:L,rowCount:T,colCount:w}=v,M=!1;for(let D=0;D<T&&!M;D++)for(let P=0;P<w;P++){let A=d.getTemplateCell(x+D,L+P);if(d.getValue(x+D,L+P)||A&&A.type!=="Static"){M=!0;break}}l=M}}c=!0}if(!c){let y=d.getSelections()[0];for(let v of S)if(y!=null&&y.intersect(v.ranges[1].row,v.ranges[1].col,v.ranges[1].rowCount,v.ranges[1].colCount+v.ranges[2].colCount)){c=!0;break}}}t.setData(m.ReportCellBindingSmartTagTemplateVisible,!1),t.setData(m.ParameterUISmartTagTemplateVisible,!1),t.setData(m.AllowChangeTemplateCellType,l),t.setData(m.AllowReportSheetInsertContainer,r),t.setData(m.AllowReportSheetDeleteContainer,o),t.setData(m.ReportSheetRangeContainsContainer,c)}static reportSheetActiveCellIsExpandable(t){let i=t.Spread.getActiveSheetTab(),n=!1;if(C._isReportSheet(i)&&i.renderMode()===dc){const a=i.getSheet().getActiveRowIndex(),r=i.getSheet().getActiveColumnIndex();n=i.isExpandable(a,r)}t.setData(m.ReportSheetActiveCellIsExpandable,n)}static reportSheetSelectionContainsCanCollapseCell(t){let i=t.Spread.getActiveSheetTab(),n=!1;C._isReportSheet(i)&&i.renderMode()===dc&&(n=(i.getSheet().getSelections()||[]).some(r=>{const{row:o,rowCount:l,col:c,colCount:d}=r,u=o+l-1,h=c+d-1;for(let g=o;g<=u;g++)for(let f=c;f<=h;f++){const b=i.getSpan(g,f);if(!(b&&(b.row!==g||b.col!==f))&&i.internalCanCollapse(g,f))return!0}return!1})),t.setData(m.ReportSheetSelectionContainsCanCollapseCell,n)}static reportSheetActiveCellSmartTagVisible(t){let i=t.Spread.getActiveSheetTab(),n=!1;if(C._isReportSheet(i)&&i.renderMode()===Ux){let a=i.getSheet();const r=a.getActiveRowIndex(),o=a.getActiveColumnIndex();let l=a.getTemplateCell(r,o);n=!C.isNullOrUndefined(l)}t.setData(m.ReportSheetActiveCellSmartTagVisible,n)}static reportSheetParameterUI(t){let i=t.Spread.getActiveSheetTab(),n=!1;if(C._isReportSheet(i)){let a=i.internalParameterUI();if(n=!(C.isNullOrUndefined(a)||JSON.stringify(a)==="{}"||a.data&&a.data.dataTable===void 0),n){let r=a.data.dataTable,o=!1;for(let l in r)if(r.hasOwnProperty(l)&&!o){let c=r[l];for(let d in c)if(c.hasOwnProperty(d)&&!o){let u=c[d],{value:h,style:g}=u;if(!C.isNullOrUndefined(h)&&h!==""||g&&!hle(g)){o=!0;break}}}n=o}}t.setData(m.ParameterPanelHasUIValue,n)}static reportSheetHasDataEntrySetting(t){let i=t.Spread.getActiveSheetTab(),n=!1;if(C._isReportSheet(i)){const a=i.getTemplate().getDataEntrySetting();n=a&&a.length}t.setData(m.ReportSheetCellHasDataEntrySetting,n)}static reportSheetCellIsDirty(t){let i=t.Spread.getActiveSheetTab(),n=!1;if(C._isReportSheet(i)&&i.renderMode()===dc){const r=i.getSheet().getSelections();for(let o of r){if(n)break;const{row:l,col:c,rowCount:d,colCount:u}=o,h=l+d-1,g=c+u-1;for(let f=l;f<=h&&!n;f++)for(let b=c;b<=g&&(n=i.internalIsDirtyCell(f,b),!n);b++);}}t.setData(m.ReportSheetCellsHasDirty,n)}static reportSheetCellIsProtected(t){let i=t.Spread.getActiveSheetTab();if(C._isReportSheet(i)&&i.renderMode()===dc){const n=i.getSheet(),a=n.getActiveRowIndex(),r=n.getActiveColumnIndex();t.setData(m.ReportSheetCellsIsProtected,i.internalCellIsProtected(a,r));return}t.setData(m.ReportSheetCellsIsProtected,!1)}static reportSheetHasDirtyCell(t){let i=t.Spread.getActiveSheetTab();if(C._isReportSheet(i)&&i.renderMode()===dc){t.setData(m.ReportSheetHasDirtyCell,i.isDirty());return}t.setData(m.ReportSheetHasDirtyCell,!1)}static activeSpreadIsDesignSpread(t){let i=t.Spread,n=!1;C.FindSelfOrParent(i.getHost(),".gc-report-design-parameter-ui")&&(n=!0),t.setData(m.ActiveSpreadIsDesignSpread,n)}static allowSelectChartData(t){let i=t.Spread,n=pe.getActiveChart(i);if(n){let a=n.getDataSetting();if(a!=null&&a.tableName){t.setData(m.AllowChartSelectData,!1);return}t.setData(m.AllowChartSelectData,!0)}}static allowBindChartData(t){let i=t.Spread,n=pe.getActiveChart(i);if(n){let a=n.getDataSetting();if(a!=null&&a.tableName){t.setData(m.AllowChartBindData,!0);return}else if(n.series().Count){t.setData(m.AllowChartBindData,!1);return}t.setData(m.AllowChartBindData,!0)}}static activeChartHasSeries(t){let i=t.Spread,n=pe.getActiveChart(i);if(n&&n.series().Count){t.setData(m.ActiveChartHasSeries,!0);return}t.setData(m.ActiveChartHasSeries,!1)}static allowPasteSpecial(t){let i=C.getActiveSheet(t.Spread);i?C._isTableSheet(i)||!i.getClipboardHelperObj().ranges||i.getClipboardHelperObj().isCutting||i.isPasteShapes&&i.isPasteShapes()||i.isPasteFloatingObject&&i.isPasteFloatingObject()?t.setData(m.AllowPasteSpecial,!1):t.setData(m.AllowPasteSpecial,!0):t.setData(m.AllowPasteSpecial,!1)}static updateActiveSlicer(t){let i=C.getActiveSheet(t.Spread),n=vi.getSelectedSlicers(i,!0),a=vi.getSelectedPivotTimelines(i);n.length===1&&a.length===0?(t.setData(re.selectedSlicer,n[0]),t.setData(re.selectedTimeline,null)):a.length===1&&n.length===0&&(t.setData(re.selectedTimeline,a[0]),t.setData(re.selectedSlicer,null))}static updateActiveSheetTab(t){const i=t.Spread.getActiveSheetTab();if(!i)return;const n=C._getSheetTabType(i);if(n===t.getData(re.activeSheetTabType))return;const a=()=>{switch(n){case GC.Spread.Sheets.SheetType.tableSheet:return"tableSheetDesign";case GC.Spread.Sheets.SheetType.ganttSheet:return"ganttSheetChartFormat";case GC.Spread.Sheets.SheetType.reportSheet:return"reportSheetDesign"}return""};t.setData(re.activeSheetTabType,n);const r=a();r&&t.activeRibbonTab(r)}static updateTableSheetPanel(t){const i=t.Spread.getActiveSheetTab();if(!i){t.setData(m.TableSheetPanelVisible,!1);return}const n=C._getSheetTabType(i);if(n===GC.Spread.Sheets.SheetType.tableSheet){let a=t.getData(m.IsInTableSheetDesignMode);t.setData(m.TableSheetPanelVisible,!a)}else n===GC.Spread.Sheets.SheetType.ganttSheet?t.setData(m.TableSheetPanelVisible,!0):t.setData(m.TableSheetPanelVisible,!1)}static updateFieldListPanel(t){t.getData(m.FieldListVisible)&&t.Spread.getActiveSheetTab()&&t.setData(m.FieldListVisible,!1)}static updateActiveChartState(t){let i=t.Spread,n=pe.getActiveChart(i);n&&t.setData(m.FunnelChartClicked,n.chartType()===GC.Spread.Sheets.Charts.ChartType.funnel)}static autoSwitchRibbonTab(t){sne(t)}static updateDataChartLic(t){setTimeout(()=>{ax(t,t.Spread)})}static isTableTotalRowEnabled(t){let i=C.getActiveSheet(t.Spread);if(!i||!i.tables)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.tables.find(n,a);if(t.setData(m.TableDisableShowTotalRow,!1),r&&!r.showFooter()){let o=r.dataRange();if(o.row+o.rowCount>=i.getRowCount()){t.setData(m.TableDisableShowTotalRow,!0);return}}}static reportSheetTemplateRange(t){var n,a,r,o,l,c,d;let i=(n=t.Spread.getActiveSheetTab())==null?void 0:n.templateSheet;if(i){const u=i==null?void 0:i.templateRange();if(u){const h=i.getActiveRowIndex(),g=i.getActiveColumnIndex(),f=Object.keys(u).some(P=>{var A,E;return!!((E=(A=u[P])==null?void 0:A.range)!=null&&E.contains(h,g))});t.setData(re.reportSheetTemplateRangeActive,!!f);const b=i.getSelections(),S=(P,A)=>{var k,N,B,F;const{row:E,col:O,rowCount:I,colCount:R}=A;return!!((N=(k=u[P])==null?void 0:k.range)!=null&&N.intersect(E,O,I,R))&&!((F=(B=u[P])==null?void 0:B.range)!=null&&F.containsRange(A))},y=Object.keys(u).some(P=>b.some(A=>S(P,A)));t.setData(re.hasReportSheetTemplateRange,y);const v=b[0],x=b.length===1&&v,L=u.detail,T=u.header,w=u.footer,M=(a=u.detail)==null?void 0:a.groups,D=(r=u.detail)==null?void 0:r.children;t.setData(re.canInsertReportSheetTemplateRangeHeader,x&&!(T!=null&&T.range)&&(L==null?void 0:L.range)&&!L.range.intersect(v.row,v.col,v.rowCount,v.colCount)&&(!(w!=null&&w.range)||!((o=w==null?void 0:w.range)!=null&&o.intersect(v.row,v.col,v.rowCount,v.colCount)))),t.setData(re.canInsertReportSheetTemplateRangeFooter,x&&!(w!=null&&w.range)&&(L==null?void 0:L.range)&&!L.range.intersect(v.row,v.col,v.rowCount,v.colCount)&&(!(T!=null&&T.range)||!((l=T==null?void 0:T.range)!=null&&l.intersect(v.row,v.col,v.rowCount,v.colCount)))),t.setData(re.canInsertReportSheetTemplateRangeDetail,!(L!=null&&L.range)||!M||(M==null?void 0:M.every(P=>!P))),t.setData(re.canInsertReportSheetTemplateRangeGroupHeader,x&&(L==null?void 0:L.range)&&!(D!=null&&D.length)&&L.range.containsRange(v)&&!(M!=null&&M[0])&&(!(M!=null&&M[1])||!((c=M==null?void 0:M[1])!=null&&c.intersect(v.row,v.col,v.rowCount,v.colCount)))),t.setData(re.canInsertReportSheetTemplateRangeGroupFooter,x&&(L==null?void 0:L.range)&&!(D!=null&&D.length)&&L.range.containsRange(v)&&!(M!=null&&M[1])&&(!(M!=null&&M[0])||!((d=M==null?void 0:M[0])!=null&&d.intersect(v.row,v.col,v.rowCount,v.colCount))))}}}},Tn._setShapePanelStateHandler=0,Tn);ze([je(_t.PivotTableAdded)],We,"initActiveSheetState"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.DataManagerActive,m.GanttSheetActive)],We,"hasIndent"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.DataManagerActive,m.GanttSheetActive)],We,"allowInsertTable"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.DataManagerActive)],We,"allowInsertPivotTable"),ze([je(m.DataManagerActive)],We,"allowInsertShape"),ze([je()],We,"setCustomTableTheme"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"allowInsertChart"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.DataManagerActive,m.GanttSheetActive)],We,"allowInsertBarCode"),ze([je(re.osEnv)],We,"setAccessBarItemsState"),ze([je(m.DataManagerActive,m.GanttSheetActive,GC.Spread.Sheets.Events.SelectionChanged)],We,"setHyperlinkItemsState"),ze([je(GC.Spread.Sheets.Events.ClipboardChanged,GC.Spread.Sheets.Events.ClipboardPasted,GC.Spread.Sheets.Events.SelectionChanged)],We,"setInsertCopiedCutCellsState"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.DataManagerActive)],We,"selectFullColumn"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.DataManagerActive)],We,"selectFullRow"),ze([je()],We,"sheetFreezed"),ze([je(_t.SheetOptionsChangedInternal,m.DataManagerActive)],We,"allowFilter"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,_t.SheetOptionsChangedInternal)],We,"allowRichText"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.SlicerChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged)],We,"hasSlicerSelected"),ze([je(GC.Spread.Sheets.Events.SheetChanged)],We,"hasHiddenSheet"),ze([je(_t.SheetOptionsChangedInternal)],We,"allowResizeRows"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.EnterCell,_t.SheetOptionsChangedInternal)],We,"AllowInsertCell"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.EnterCell,_t.SheetOptionsChangedInternal)],We,"allowDeleteCell"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,_t.SheetOptionsChangedInternal,m.DataManagerActive)],We,"isIncludeLockedCell"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.EnterCell,_t.SheetOptionsChangedInternal)],We,"allowInsertRows"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.EnterCell,_t.SheetOptionsChangedInternal)],We,"allowDeleteRows"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.EnterCell,_t.SheetOptionsChangedInternal)],We,"allowInsertColumns"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.EnterCell,_t.SheetOptionsChangedInternal)],We,"allowDeleteColumns"),ze([je(GC.Spread.Sheets.Events.EnterCell,_t.SheetOptionsChangedInternal,m.IsInTableSheetDesignMode)],We,"allowFormatCells"),ze([je(_t.SheetOptionsChangedInternal)],We,"allowFormatRows"),ze([je(_t.SheetOptionsChangedInternal)],We,"allowFormatColumns"),ze([je()],We,"allowOutlineRows"),ze([je()],We,"allowOutlineColumns"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged)],We,"chartAllSeriesList"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveChartLegend"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharTitle"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharErroeBar"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharTrendline"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharDataLabels"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharPrimaryValue"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharPrimaryCategory"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxisTypeTitle"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxisTypeMajorGridLineMinorGridLine"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxisTypeNone"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxesAxesPrimaryVertical"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxesPrimaryHorizontal"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxesAxesSecondaryHorizontal"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxesAxesSecondaryVertical"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxisTitlesPrimaryHorizontal"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxisTitlesPrimaryVertical"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxisTitlesSecondaryHorizontal"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharAxisTitlesSecondaryVertical"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharGridlinesPrimaryMajorHorizontal"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharGridlinesPrimaryMinorVertical"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharGridlinesSecondaryMinorHorizontal"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartAllSeriesList,m.ChartCommandExecuted)],We,"haveCharGridlinesSecondaryMinorVertical"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,m.ChartCommandExecuted)],We,"haveCharDataLabelsShow"),ze([je(_t.SheetOptionsChangedInternal)],We,"allowResizeColumns"),ze([je(re.osEnv)],We,"needActive"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.ChartClicked,m.ChartCommandExecuted)],We,"chartGroup"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ValueChanged)],We,"hasCellTypes"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"hasCellButtons"),ze([je(_t.SheetOptionsChangedInternal,m.IsInTableSheetDesignMode)],We,"isProtected"),ze([je(_t.SheetOptionsChangedInternal,m.IsInTableSheetDesignMode)],We,"isActualProtected"),ze([je()],We,"enableAccessibility"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,_t.WorksheetDataChanged)],We,"cellLocked"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"tableInsertRowAbove"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"tableInsertRowBelow"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"tableInsertColumnLeftRight"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"checkTableLastCol"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"checkTableLastRow"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"hasComments"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.CellChanged,GC.Spread.Sheets.Events.ThreadedCommentChanged)],We,"hasThreadedComments"),ze([je(GC.Spread.Sheets.Events.CellChanged,GC.Spread.Sheets.Events.ThreadedCommentChanged)],We,"allSheetsHaveThreadedComments"),ze([je(GC.Spread.Sheets.Events.CommentChanged,GC.Spread.Sheets.Events.SheetChanged,GC.Spread.Sheets.Events.SelectionChanged)],We,"selectedOrEditComments"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.RangeChanged)],We,"clickTable"),ze([je(m.TableClicked)],We,"toggleBetweenConvertTableAndDataTable"),ze([je(m.AllowInsertTable,m.DataManagerActive,m.GanttSheetActive,GC.Spread.Sheets.Events.RangeChanged,GC.Spread.Sheets.Events.SelectionChanged,GC.Data.Events.TableAdded,GC.Data.Events.TableRemoved)],We,"allowAddTableFromDataTable"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.RangeChanged,_t.WorksheetDataChanged,GC.Spread.Sheets.Events.CellChanged,m.DataManagerActive)],We,"tableSelected"),ze([je(GC.Spread.Sheets.Events.PivotTableChanged,GC.Spread.Sheets.Events.ActiveCellChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged,_t.WorksheetDataChanged,_t.PivotTableAdded,GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.RangeChanged)],We,"pivotTableSelected"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.SlicerChanged)],We,"pivotSlicerSelected"),ze([je(_t.SheetOptionsChangedInternal)],We,"pivotProtection"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"filterSelected"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.SheetChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.ShapeChanged,m.DataManagerActive,_t.SheetOptionsChangedInternal,GC.Spread.Sheets.Events.ShapeRemoved)],We,"chartSelected"),ze([je(GC.Spread.Sheets.Events.SheetChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.ShapeChanged,GC.Spread.Sheets.Events.ShapeRemoved,_t.WorksheetDataChanged,GC.Spread.Sheets.Events.ActiveCellChanged)],We,"shapeSelected"),ze([je(GC.Spread.Sheets.Events.SheetChanged,_t.WorksheetDataChanged,GC.Spread.Sheets.Events.ActiveCellChanged,GC.Spread.Sheets.Events.FloatingObjectSelectionChanged,GC.Spread.Sheets.Events.FloatingObjectLoaded,GC.Spread.Sheets.Events.FloatingObjectChanged)],We,"floatingObjectSelected"),ze([je(GC.Spread.Sheets.Events.SheetChanged,GC.Spread.Sheets.Events.PictureSelectionChanged,GC.Spread.Sheets.Events.PictureChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged,m.DataManagerActive,m.GanttSheetActive)],We,"pictureSelected"),ze([je(_t.SheetOptionsChangedInternal,m.DataManagerActive,m.GanttSheetActive)],We,"allowEditObject"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,_t.WorksheetDataChanged,m.AfterCommandExecute)],We,"allowUndoListDropdown"),ze([je(GC.Spread.Sheets.Events.SheetChanged,GC.Spread.Sheets.Events.SlicerChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged,_t.SheetOptionsChangedInternal,GC.Spread.Sheets.Events.ShapeChanged)],We,"slicerSelected"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.EditEnded,GC.Spread.Sheets.Events.ClipboardPasted,GC.Spread.Sheets.Events.RangeChanged)],We,"formulaSparklineSelected"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ActiveCellChanged,GC.Spread.Sheets.Events.EditEnded,GC.Spread.Sheets.Events.RangeChanged,GC.Spread.Sheets.Events.ValueChanged,m.DataManagerActive,m.GanttSheetActive,m.UpdateSparkLine)],We,"sparklineSelected"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.BarCodeSelected)],We,"barCodeSelected"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"TableHasStyle"),ze([je(GC.Spread.Sheets.Events.SlicerChanged,GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.SelectionChanged)],We,"ActivePivotTableProps"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.PivotTableChanged)],We,"PivotTableClearFilter"),ze([je(GC.Spread.Sheets.Events.PivotTableChanged,GC.Spread.Sheets.Events.ActiveCellChanged,_t.WorksheetDataChanged)],We,"PivotTableCalcItem"),ze([je(_t.WorksheetDataChanged,GC.Spread.Sheets.Events.SelectionChanged)],We,"PivotTableFieldSetting"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"PivotTableGroupSelectionAndUnGroup"),ze([je(_t.WorksheetDataChanged,GC.Spread.Sheets.Events.PivotTableChanged,GC.Spread.Sheets.Events.SelectionChanged)],We,"pivotTableCollapseField"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ActiveCellChanged)],We,"PivotTableGroupField"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"PivotTableShowFilterPage"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"rowOrColIncludeSpanOrTable"),ze([je(_t.SheetOptionsChangedInternal,m.ShapeSelected)],We,"GroupShapeSelected"),ze([je(_t.SheetOptionsChangedInternal,m.DataManagerActive)],We,"CanDoSort"),ze([je(_t.SheetOptionsChangedInternal)],We,"AutomaticCalc"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"CanDeleteTableRowsColumns"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"IsConvertEntireSheetRows"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isInPivotPageFilterArea"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isInPivotCornerArea"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isInPivotEmptyLabelArea"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ActiveCellChanged)],We,"isInPivotHeaderArea"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isInPivotGrandTotalArea"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isInPivotContentArea"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ActiveCellChanged)],We,"isPivotContextMenuCornerShouldShow"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ActiveCellChanged)],We,"isPivotContextMenuGroupShouldShow"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isPivotContextMenuSubtotalShouldShow"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isPivotContextEmptyValueFieldShouldShow"),ze([je(_t.WorksheetDataChanged,GC.Spread.Sheets.Events.SelectionChanged)],We,"pivotTableHasSettingFieldName"),ze([je(_t.WorksheetDataChanged,GC.Spread.Sheets.Events.SelectionChanged)],We,"pivotTableFieldHeaders"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"sheetSelectionIntersectPivotTable"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"shouldClearFilterFromShow"),ze([je(m.TableSheetPanelVisible,m.IsToggleTableSheetPanel,re.tableSheet,m.IsInTableSheetDesignMode,_t.WorksheetDataChanged)],We,"tableSheetActive"),ze([je(_t.SheetOptionsChangedInternal)],We,"tableSheetDefineColumnActive"),ze([je(_t.SheetOptionsChangedInternal,_t.WorksheetDataChanged)],We,"tableSheetHierarchyActive"),ze([je(GC.Spread.Sheets.Events.SheetChanged,_t.WorksheetDataChanged)],We,"tableSheetRowActionActive"),ze([je(m.TableSheetRowActionVisible,_t.WorksheetDataChanged)],We,"tableSheetBatchActive"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,_t.WorksheetDataChanged)],We,"tableSheetColumnSelected"),ze([je()],We,"dataManagerActive"),ze([je(_t.SheetOptionsChangedInternal)],We,"isZoomFactor"),ze([je(_t.EnterCellInternal,_t.SheetOptionsChangedInternal,_t.SheetBackgroundChangedInternal)],We,"hasBackground"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.AfterCommandExecute)],We,"horizontalAlignment"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"selectRangeHasTable"),ze([je(m.SelectRangeHasTable,m.IsInTableSheetDesignMode,m.ChartSelected,m.pictureSelected,m.ShapeSelected,_t.SheetOptionsChangedInternal,m.DataManagerActive)],We,"allowFilterAndSort"),ze([je(m.DataManagerActive)],We,"allowDataValidation"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,m.DataManagerActive)],We,"allowRemoveDuplicate"),ze([je(m.DataManagerActive)],We,"allowEditLinks"),ze([je(_t.SheetOptionsChangedInternal,m.DataManagerActive)],We,"allowTextToColumn"),ze([je(m.DataManagerActive)],We,"allowOutline"),ze([je()],We,"allowAutoGenerateLabel"),ze([je()],We,"allowDataBinding"),ze([je(m.DataManagerActive)],We,"allowSheetBinding"),ze([je()],We,"allowSheetSettings"),ze([je(m.GanttSheetActive)],We,"allowGridLinesAndHeadersSetting"),ze([je(GC.Spread.Sheets.Events.SheetChanged,m.DataManagerActive)],We,"allowPrintCurrentSheet"),ze([je(re.ganttSheet,_t.WorksheetDataChanged,m.TableSheetPanelVisible,m.GanttSheetActive)],We,"ganttSheetActive"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"ganttSheetTaskSelected"),ze([je(GC.Spread.Sheets.Events.SheetChanged,_t.WorksheetDataChanged)],We,"ganttSheetHasPrimaryKeyField"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isGanttSheetAllSelectionInCol"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isGanttSheetAllSelectionInRow"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"isSelectGanttSheetGanttChartColumn"),ze([je()],We,"isGanttSheetHasComplete"),ze([je()],We,"tableSheetHasMultipleHeaderRows"),ze([je(re.bindingIndicatorManager,m.FieldListVisible,m.FiledListValue)],We,"refreshBindingPathTableIndicator"),ze([je(m.AllowFormatCells,m.ChartSelected,m.ShapeSelected,m.pictureSelected,m.SlicerSelected,m.SelectedOrEditComments)],We,"enableClearFormat"),ze([je(GC.Spread.Sheets.Events.SheetChanged,GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ActiveCellChanged)],We,"reportSheetMode"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"reportSheetActiveCellIsExpandable"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"reportSheetSelectionContainsCanCollapseCell"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"reportSheetActiveCellSmartTagVisible"),ze([je()],We,"reportSheetParameterUI"),ze([je()],We,"reportSheetHasDataEntrySetting"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"reportSheetCellIsDirty"),ze([je(GC.Spread.Sheets.Events.SelectionChanged)],We,"reportSheetCellIsProtected"),ze([je()],We,"reportSheetHasDirtyCell"),ze([je(m.OriginSpread)],We,"activeSpreadIsDesignSpread"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged)],We,"allowSelectChartData"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged)],We,"allowBindChartData"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged)],We,"activeChartHasSeries"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ClipboardChanged,GC.Spread.Sheets.Events.ClipboardPasted)],We,"allowPasteSpecial"),ze([je(GC.Spread.Sheets.Events.ShapeSelectionChanged,GC.Spread.Sheets.Events.SlicerChanged)],We,"updateActiveSlicer"),ze([je()],We,"updateActiveSheetTab"),ze([je(m.TableSheetActive,m.GanttSheetActive)],We,"updateTableSheetPanel"),ze([je()],We,"updateFieldListPanel"),ze([je()],We,"updateActiveChartState"),ze([je(m.ShapeSelected,m.PictureShapeSelected,m.ChartSelected,m.SlicerSelected,m.TimelineSelected)],We,"autoSwitchRibbonTab"),ze([je(m.DataChartEnabled,_t.WorksheetDataChanged)],We,"updateDataChartLic"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.ActiveCellChanged)],We,"isTableTotalRowEnabled"),ze([je(GC.Spread.Sheets.Events.SelectionChanged,GC.Spread.Sheets.Events.RangeChanged,_t.ReportSheetTemplateRangeChanged)],We,"reportSheetTemplateRange");function Koe(e){return(e.options.batch||!1)&&!C.isNullOrUndefined(e.options.remote)}function Nb(e){let t=e.Spread.getActiveSheetTab();return C._isTableSheet(t)&&!!t.getDataView()}function Qoe(e){let t=C.getActiveSheet(e);return!!(t&&t.getSelections()[0])}function Xoe(e){return!!C.getActiveSheet(e)}function $oe(e){let t=e.getActiveSheet(),i=t&&Ae.getActiveSlicer(t);return!(!i||i.length===0)}function ele(e){let t=C.getActiveSheet(e);if(!t)return!1;let i=t&&t.getSelections()[0];return!(!i||i.rowCount===1&&i.colCount===1&&typeof t.getValue(i.row,i.col)=="object"&&!C._isReportSheet(e.getActiveSheetTab()))}function tle(e){let t=C.getActiveSheet(e);if(C.isNullOrUndefined(t))return!1;let i=t.getSelections()[0];if(C.isNullOrUndefined(i))return!1;if(nle(t,i))return!0;let n=t.tables.find(i.row,i.col);return C.isNullOrUndefined(n)?!!bm(t,i):!(n.range().containsRange(i)&&t.getSelections().length===1)}function ile(e){var a;let t=C.getActiveSheet(e),i=t==null?void 0:t.getSelections()[0],n=(a=bm(t,i))==null?void 0:a.range();return!!(n!=null&&n.containsRange(i)&&t.getSelections().length===1)}function bm(e,t){if(!t)return null;let i=e.tables;if(C.isNullOrUndefined(i))return null;let n=i.all();for(let a=0;a<n.length;a++){let{row:r,col:o,rowCount:l,colCount:c}=n[a].range();if(t.intersect(r,o,l,c))return n[a]}return null}function nle(e,t){if(!t)return null;let i=e.pivotTables;if(C.isNullOrUndefined(i))return null;let n=i.all();for(let a=0;a<n.length;a++){let{row:r,col:o,rowCount:l,colCount:c}=n[a].getRange().content;if(t.intersect(r,o,l,c))return n[a]}return null}function NR(e,t,i){let n=e&&e.getPivotInfoImp(t,i,!1,!1,!0);if(n){let{value:a,area:r,menuArea:o,cornerFieldInfo:l,colHeadFieldInfo:c,activeRowFieldInfo:d,activeColFieldInfo:u,rowInfos:h,colInfos:g}=n,f=(r===2||r===3)&&o===4,b=(!l||!c)&&a===s.sigmaValue,S=r===3&&d&&h[d.index].isSubtotal&&h[d.index].collapseIndex===void 0||r===2&&u&&g[u.index].isSubtotal&&g[u.index].collapseIndex===void 0;if(f||b||S){let y=d==null?void 0:d.name;return!!(y&&e.subtotalPosition(y)===1)}return!0}return!1}function uc(e,t){let i=ale(e),n=e.axes();if(i)switch(t){case 0:return n.primaryValue;case 1:return n.primaryCategory;case 2:return n.secondaryValue;case 3:return n.secondaryCategory}else switch(t){case 0:return n.primaryCategory;case 1:return n.primaryValue;case 2:return n.secondaryCategory;case 3:return n.secondaryValue}}function ale(e){let t=e.chartType(),i=!1,n=pe.getChartGroup(t);if(n===Se.BarGroup&&(i=!0),(n===Se.FunnelGroup||n===Se.WaterfallGroup)&&(i=!0),n===Se.ComboGroup){let a=e.series().get();for(let r=0;r<a.length;r++){let o=a[r];if(pe.getChartGroup(o.chartType)!==Se.BarGroup){i=!1;break}i=!0}}return i}function rle(){return[{type:Se.ColumnGroup,items:[m.DataLabelsNone,m.DataLabelsCenter,m.DataLabelsInsideEnd,m.DataLabelsInsideBase,m.DataLabelsOutsideEnd]},{type:Se.LineGroup,items:[m.DataLabelsNoneLineGroup,m.DataLabelsCenterLineGroup,m.DataLabelsLeftGroup,m.DataLabelsRightGroup,m.DataLabelsAboveGroup,m.DataLabelsBelowGroup]},{type:Se.PieGroup,items:[m.DataLabelsNonePieGroup,m.DataLabelsCenterPieGroup,m.DataLabelsInsideEndPieGroup,m.DataLabelsOutsideEndPieGroup,m.DataLabelBestFitPieGroup]},{type:Se.DoughnutGroup,items:[m.DataLabelsNoneDoughnutGroup,m.DataLabelsShow]},{type:Se.BarGroup,items:[m.DataLabelsNone,m.DataLabelsCenter,m.DataLabelsInsideEnd,m.DataLabelsInsideBase,m.DataLabelsOutsideEnd]},{type:Se.AreaGroup,items:[m.DataLabelsNone,m.DataLabelsShow]},{type:Se.ScatterGroup,items:[m.DataLabelsNoneScatterGroup,m.DataLabelsCenterScatterGroup,m.DataLabelsLeftGroup,m.DataLabelsRightGroup,m.DataLabelsAboveGroup,m.DataLabelsBelowGroup]},{type:Se.RadarGroup,items:[m.DataLabelsNone,m.DataLabelsShow]},{type:Se.SunburstGroup,items:[m.DataLabelsNoneSunburstGroup,m.DataLabelsCenterSunburstGroup]},{type:Se.TreemapGroup,items:[m.DataLabelsNoneTreeMapGroup,m.DataLabelsShow]},{type:Se.WaterfallGroup,items:[m.DataLabelsNone,m.DataLabelsCenter,m.DataLabelsInsideEnd,m.DataLabelsInsideBase,m.DataLabelsOutsideEnd]},{type:Se.ComboGroup,items:[m.DataLabelsNone,m.DataLabelsCenter,m.DataLabelsInsideEnd,m.DataLabelsOutsideEnd]}]}function ole(e){return e.some(t=>t instanceof GC.Spread.Sheets.Shapes.PictureShape)}function lle(e){return ut.getShapes(e,[]).some(t=>ut.isSupportChangeShapeType(t))}function sle(e){return e.some(t=>!(t instanceof GC.Spread.Sheets.Shapes.PictureShape)&&!vi.isSlicerShape(t))}function cle(e){return e.length===0?!1:e.every(t=>ut.isSupportedHyperlinkShape(t))}function dle(e){return e.some(t=>t.allowRotate())}const ule=oe.DesignerActionBase._generateNullValueStyle();function hle(e){if(e){for(let t in e)if(e.hasOwnProperty(t)){let i=e[t];if(!(C.isNullOrUndefined(i)||Array.isArray(i)&&i.length===0)&&i!==ule[t])return!1}}return!0}var In={exports:{}},ple=In.exports,BR;(function(){var e={"./src/common/util.ts":(function(a,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.Util=void 0;var l=o("sjs-spread-sheets"),c=(function(){function d(){}return d.parseFont=function(u){for(var h="",g="normal",f="normal",b=u.split(/\s+/),S=0,y=b;S<y.length;S++){var v=y[S];switch(v){case"normal":break;case"italic":h.indexOf("bold")!==-1?h="bold italic":h=v;break;case"bold":h.indexOf("italic")!==-1?h="bold italic":h=v,g="bold";break;case"100":case"200":case"300":case"400":case"500":case"600":case"700":case"800":case"900":g=v;break;case"lighter":g="lighter";break}}return h||(h="normal"),{fontStyle:h,fontWeight:g,lineHeight:f}},d._isMacOS=function(){var u=navigator.platform;return u&&u.indexOf("Mac")>-1},d.getActiveCellStyle=function(u,h,g){return u.getActualStyle(h,g)},d.getInvisibleInfo=function(u){for(var h=[],g=0;g<u.length;g++){var f=u[g];f&&h.push(g)}return h},d.getNextStartIndex=function(u,h){var g=u[h];do h++,g++;while(g===u[h]);return g},d.getContinuousVisibleInterval=function(u,h){var g=[];h=h.sort(function(y,v){return y-v});for(var f=0,b=0;b<u;)if(h.indexOf(b)>-1){g.push({startIndex:f,endIndex:b-1});var S=d.getNextStartIndex(h,h.indexOf(b));f=b=S}else b++;return f<b&&g.push({startIndex:f,endIndex:b-1}),g},d.removeHiddenRegions=function(u,h,g){var f=this,b=[];return u.forEach(function(S){var y=S.row,v=S.rowCount,x=S.col,L=S.colCount;x===-1&&(x=0),y===-1&&(y=0);for(var T=[],w=x;w<x+L;w++)h[w]||T.push(w);for(var M=[],D=y;D<y+v;D++)g[D]||M.push(D);if(M.length>0&&T.length>0){for(var P=M[0],A=1,E=1;E<M.length;E++)M[E]===M[E-1]+1?A++:(f.addVisibleRegions(b,P,A,T),P=M[E],A=1);f.addVisibleRegions(b,P,A,T)}}),b},d.addVisibleRegions=function(u,h,g,f){for(var b=f[0],S=1,y=1;y<f.length;y++)f[y]===f[y-1]+1?S++:(u.push({row:h,rowCount:g,col:b,colCount:S}),b=f[y],S=1);u.push({row:h,rowCount:g,col:b,colCount:S})},d.hasHiddenRowsOrCols=function(u,h,g){for(var f=0,b=u;f<b.length;f++){for(var S=b[f],y=S.row,v=S.rowCount,x=S.col,L=S.colCount,T=x;T<x+L;T++)if(h[T])return!0;for(var w=y;w<y+v;w++)if(g[w])return!0}return!1},d.getInvisibleRange=function(u){var h=[],g=this.getAxisInfo(u,!0),f=this.getAxisInfo(u,!1),b=u.getSelections();if(this.hasHiddenRowsOrCols(b,f,g))h=this.removeHiddenRegions(u.getSelections(),f,g);else if(b.length===1&&b[0].rowCount===1&&b[0].colCount===1){var S=this.getInvisibleInfo(f),y=this.getInvisibleInfo(g);if(S.length!==0||y.length!==0){var v=this.getContinuousVisibleInterval(u.getRowCount(),y),x=this.getContinuousVisibleInterval(u.getColumnCount(),S);v.forEach(function(L){x.forEach(function(T){var w=L.startIndex,M=L.endIndex-w+1,D=T.startIndex,P=T.endIndex-D+1,A=new l.Spread.Sheets.Range(w,D,M,P);h.push(A)})})}}return h},d.getRangeType=function(u){var h=u.row,g=u.col;return h===-1?g===-1?3:2:g===-1?1:0},d.getAxisInfo=function(u,h){var g=[];if(h)for(var f=u.getRowCount(),b=0;b<f;b++){var S=u.getRowHeight(b);g.push(S===0)}else for(var y=u.getColumnCount(),b=0;b<y;b++){var v=u.getColumnWidth(b);g.push(v===0)}return g},d.isFirefox=function(){return!!navigator.userAgent.match(/Firefox/g)},d.getBrowserCulture=function(){return navigator.language},d.getNeedAdjustSelection=function(u,h,g){for(var f=null,b=0,S=u;b<S.length;b++){var y=S[b];y.contains(h,g,1,1)&&(f=new l.Spread.Sheets.Range(y.row,y.col,y.rowCount,y.colCount))}return f},d.getCellPositionInRangeByCol=function(u,h){var g;return h===u.col||u.col===-1&&h===0?g=0:h===u.col+u.colCount-1||u.col===-1&&h===u.colCount-1?g=2:g=1,g},d.getCellPositionInRangeByRow=function(u,h){var g;return h===u.row||u.row===-1&&h===0?g=0:h===u.row+u.rowCount-1||u.row===-1&&h===u.rowCount-1?g=2:g=1,g},d.hasValue=function(u,h,g){return u.getValue(h,g)!==null||u.isReportTemplateSheet&&!!u.getTemplateCell(h,g)},d.findPreviousNotNullColIndex=function(u,h,g){for(var f=g,b=0;g>=b&&!(u.getColumnVisible(g)&&(f=g,this.hasValue(u,h,g)));)g--;return g<b&&(g=b),u.getColumnVisible(g)?g:f},d.findNextNotNullColIndex=function(u,h,g){for(var f=g,b=u.getColumnCount();g<b&&!(u.getColumnVisible(g)&&(f=g,this.hasValue(u,h,g)));)g++;return g>=b&&(g=b-1),u.getColumnVisible(g)?g:f},d.findPreviousNotNullRowIndex=function(u,h,g){for(var f=g,b=0;g>=b&&!(u.getRowVisible(g)&&(f=g,this.hasValue(u,g,h)));)g--;return g<b&&(g=b),u.getRowVisible(g)?g:f},d.findNextNotNullRowIndex=function(u,h,g){for(var f=g,b=u.getRowCount();g<b&&!(u.getRowVisible(g)&&(f=g,this.hasValue(u,g,h)));)g++;return g>=b&&(g=b-1),u.getRowVisible(g)?g:f},d.findLastNotNullColIndexInRange=function(u,h,g){for(var f=g,b=u.getColumnCount();g<b;){if(u.getColumnVisible(g))if(this.hasValue(u,h,g))f=g;else{g--;break}g++}return g>=b&&(g=b-1),u.getColumnVisible(g)?g:f},d.findFirstNotNullColIndexInRange=function(u,h,g){for(var f=g,b=0;g>=b;){if(u.getColumnVisible(g))if(this.hasValue(u,h,g))f=g;else{g++;break}g--}return g<b&&(g=b),u.getColumnVisible(g)?g:f},d.findLastNotNullRowIndexInRange=function(u,h,g){for(var f=g,b=u.getRowCount();g<b;){if(u.getRowVisible(g))if(this.hasValue(u,g,h))f=g;else{g--;break}g++}return g>=b&&(g=b-1),u.getRowVisible(g)?g:f},d.findFirstNotNullRowIndexInRange=function(u,h,g){for(var f=g,b=0;g>=b;){if(u.getRowVisible(g))if(this.hasValue(u,g,h))f=g;else{g++;break}g--}return g<b&&(g=b),u.getRowVisible(g)?g:f},d.getSheet=function(u,h){var g=u.getSheetFromName(h.sheetName);if(g===void 0){var f=u.getActiveSheetTab();if(f&&typeof f.renderMode=="function"&&f.renderMode()==="Design")return f.getTemplate()}return g},d.isRangeHasValue=function(u,h){for(var g=h.row;g<h.row+h.rowCount;g++)for(var f=h.col;f<h.col+h.colCount;f++){var b=u.getCell(g,f);if(b.text())return!0}return!1},d.getActiveSelectedRange=function(u,h,g){for(var f=0,b=u;f<b.length;f++){var S=b[f];if(S.contains(h,g))return S}},d.hasSelectedShape=function(u){if(!u.shapes)return!1;for(var h=u.shapes&&u.shapes.all(),g=h.length,f=0;f<g;f++)if(h[f]&&h[f].isSelected())return!0},d.hasSelectedChart=function(u){if(!u.charts)return!1;for(var h=u.charts&&u.charts.all(),g=h.length,f=0;f<g;f++)if(h[f]&&h[f].isSelected())return!0},d.hasSelectedPicture=function(u){if(!u.pictures)return!1;for(var h=u.pictures&&u.pictures.all(),g=h.length,f=0;f<g;f++)if(h[f]&&h[f].isSelected())return!0},d.hasSelectedSlicer=function(u){if(!u.slicers)return!1;for(var h=u.slicers&&u.slicers.all(),g=h.length,f=0;f<g;f++)if(h[f]&&h[f].isSelected())return!0},d.hasSelectedComment=function(u){if(!u.comments)return!1;for(var h=u.comments&&u.comments.all(),g=0,f=h;g<f.length;g++){var b=f[g],S=b.commentState();if(S===l.Spread.Sheets.Comments.CommentState.active||S===l.Spread.Sheets.Comments.CommentState.edit)return!0}},d.hasSelectedFloatingObject=function(u){if(!u.floatingObjects)return!1;for(var h=u.floatingObjects&&u.floatingObjects.all(),g=h.length,f=0;f<g;f++)if(h[f]&&h[f].isSelected())return!0},d.hasSelectedShapeOrFloatingObject=function(u){return!!(this.hasSelectedShape(u)||this.hasSelectedFloatingObject(u)||this.hasSelectedChart(u)||this.hasSelectedPicture(u)||this.hasSelectedSlicer(u)||this.hasSelectedComment(u))},d.needCheckProtectionOptions=function(u){return u?u.isActualProtected()&&!!u.options.protectionOptions:!1},d.containLockedCellsInSelections=function(u){for(var h=u.getSelections(),g=!1,f=u.getRowCount(),b=u.getColumnCount(),S=0;S<h.length;S++){var y=h[S],v=y.row,x=y.col,L=this.adjustSelection(u,h[S],f,b),T=L.rowCount,w=L.colCount;this.containsLockedCellsInSelection(u,v,x,T,w)&&(g=!0)}return g},d.adjustSelection=function(u,h,g,f){var b=h.row,S=h.col,y=h.rowCount,v=h.colCount;return g=g!=null?g:u.getRowCount(),f=f!=null?f:u.getColumnCount(),b===-1&&(b=0,y=g),S===-1&&(S=0,v=f),y=b+y>g?g-b:y,v=S+v>f?f-S:v,new l.Spread.Sheets.Range(b,S,y,v)},d.containsLockedCellsInSelection=function(u,h,g,f,b){h=h<0?0:h,g=g<0?0:g;for(var S=h;S<h+f;S++)for(var y=g;y<g+b;y++)if(u.getCell(S,y).locked())return!0},d})();r.Util=c}),"./src/shell/action.base.ts":(function(a,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.executeCommand=r.ShortcutActionBase=r.Commands=void 0;var l=o("sjs-spread-sheets"),c=o("./src/common/util.ts");r.Commands={};var d=(function(){function h(g,f){this._spread=g,this._options=f}return h.prototype.canExecute=function(){return!0},h.prototype.canUndo=function(){return!0},h.prototype.undoImp=function(g,f,b){return g.suspendPaint(),l.Spread.Sheets.Commands.undoTransaction(g,f),g.resumePaint(),!0},h.prototype.execute=function(g,f,b){var S=this,y=!1;if(b)y=S.undoImp.call(S,g,f,b);else if(S.canExecute()){var v=l.Spread.Sheets.Commands;v.startTransaction(g,f),g.suspendPaint();try{y=S.executeImp()}finally{g.resumePaint(),v.endTransaction(g,f)}}return y},h.prototype.getSheet=function(){return c.Util.getSheet(this._spread,this._options)},h.prototype.getSpread=function(){return this._spread},h.prototype.setCellStyle=function(g){var f=this,b=f.getSheet(),S=f._options.selections;b.suspendPaint(),S.forEach(function(y){var v=y.row,x=y.col,L=y.rowCount,T=y.colCount,w=b.getRange(v,x,L,T);g(w)}),b.resumePaint()},h.prototype.getFontStyle=function(g,f,b){var S=document.createElement("span");if(g)S.style.font=g;else return b;return S.style[f]=b,S.style.font},h.prototype._canEditInActiveCell=function(){var g=this,f=g._options,b=f.activeRowIndex,S=f.activeColIndex,y=g.getSheet();return g._isProtectCell(y,b,S)||g._isReadonlyCellType(y,b,S)?!1:g._isAllowEditInCell(y,b,S)},h.prototype._isProtectCell=function(g,f,b){if(g.isActualProtected()){var S=g.getActualStyle(f,b);if(S)return S.locked!==!1}return!1},h.prototype._isReadonlyCellType=function(g,f,b){var S=g.getCellType(f,b);if(S){var y={sheet:g,sheetName:g.name(),sheetArea:l.Spread.Sheets.SheetArea.viewport,readonly:!1,row:f,col:b};return S.isReadonly(y)}return!1},h.prototype._isAllowEditInCell=function(g,f,b){var S=g.getActualStyle(f,b);return S?S.allowEditInCell!==!1:!0},h})();r.ShortcutActionBase=d;function u(h,g,f,b){var S=c.Util.getSheet(h,f);f.selections||(f.selections=S.getSelections()),f.activeRowIndex===void 0&&(f.activeRowIndex=S.getActiveRowIndex()),f.activeColIndex===void 0&&(f.activeColIndex=S.getActiveColumnIndex());var y=new g(h,f);return y.execute(h,f,!!b)}r.executeCommand=u}),"./src/shortcut/action.calc.ts":(function(a,r,o){var l=this&&this.__extends||(function(){var x=function(L,T){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,M){w.__proto__=M}||function(w,M){for(var D in M)Object.prototype.hasOwnProperty.call(M,D)&&(w[D]=M[D])},x(L,T)};return function(L,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");x(L,T);function w(){this.constructor=L}L.prototype=T===null?Object.create(T):(w.prototype=T.prototype,new w)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.initShortcutAboutCalc=void 0;var c=o("./src/shell/action.base.ts"),d=o("sjs-spread-sheets"),u=o("./src/common/util.ts"),h=d.Spread.Sheets.VerticalPosition,g=d.Spread.Sheets.HorizontalPosition,f=d.Spread.Sheets.CalcEngine.rangeToFormula,b=d.Spread.Sheets.CalcEngine.RangeReferenceRelative.allRelative,S="insertSumFunction",y=(function(x){l(L,x);function L(){return x!==null&&x.apply(this,arguments)||this}return L.prototype.canExecute=function(){return x.prototype._canEditInActiveCell.call(this)},L.prototype.executeImp=function(){var T,w,M=this,D=M.getSheet(),P=!1;if(D.editorStatus()===d.Spread.Sheets.EditorStatus.enter||D.editorStatus()===d.Spread.Sheets.EditorStatus.edit)return D.endEdit(),!1;var A=M._options,E=A.selections,O=(T=A.activeRowIndex)!==null&&T!==void 0?T:D.getActiveRowIndex(),I=(w=A.activeColIndex)!==null&&w!==void 0?w:D.getActiveColumnIndex(),R=new d.Spread.Sheets.Range(O,I,1,1),k=E,N="SUM",B=!0;D.suspendCalcService();var F=!0,j;if(M.getSelectionTypeWithSelection(E)===3){P=E.length===1&&(E[0].rowCount===1&&E[0].colCount===1||E[0].rowCount!==1&&E[0].colCount!==1);for(var K=0,Q=E;K<Q.length;K++){var X=Q[K],ne=D.tables.find(E[0].row,E[0].col);if(ne){var ce=ne.dataRange();X.row===ce.row&&X.rowCount===ce.rowCount&&X.col+X.colCount<=ce.col+ce.colCount&&(ne.showFooter()||ne.showFooter(!0))}try{j=M.setFormulaForSingleRange(X,N,O,I,P,B)}catch{F=!1;break}}}if(D.resumeCalcService(),F){if(j){var fe=j.editingRowIndex,J=j.editingColIndex;(O!==fe||I!==J)&&D.setActiveCell(fe,J)}if(!P){var V=k,Z=[];D.suspendPaint();for(var Y in V)if(V.hasOwnProperty(Y)){var W=D.expandSelection(D,V[Y]);V[Y].row=W.row,V[Y].col=W.col,V[Y].rowCount=W.rowCount,V[Y].colCount=W.colCount,V[Y].containsRange(R)?D.setSelection(W.row,W.col,W.rowCount,W.colCount):Z.push(V[Y])}if(Z.length>0)for(var H=0,$=Z;H<$.length;H++){var ee=$[H];D.addSelection(ee.row,ee.col,ee.rowCount,ee.colCount)}D.resumePaint()}}else if(E.length===1&&E[0].rowCount===1&&E[0].colCount===1){var ae="=SUM()";D.inputFormulaAndSelectFormulaRange(E[0].row,E[0].col,!1,ae)}return F},L.prototype.getSelectionTypeWithSelection=function(T){for(var w,M=0,D=T;M<D.length;M++){var P=D[M];if(P.col===-1&&P.row===-1)return 0;if(P.row===-1){if(w===void 0)w=2;else if(w!==2)return 4}else if(P.col===-1){if(w===void 0)w=1;else if(w!==1)return 4}else if(w===void 0)w=3;else if(w!==3)return 4}return w},L.prototype._noNeedSetFormula=function(T,w){var M=this.getSheet(),D=M.getStyle(T,w);return!!(D&&(D.cellType||D.cellButtons))},L.prototype.calculateValidRange=function(T,w,M,D){var P=T,A=w,E=M,O=D;if(P!==-1&&A!==-1){var I=this.getSheet().getSpans();if(I&&I.length>0){var R=this.cellRangeInflate(I,new d.Spread.Sheets.Range(T,w,M,D));P=R.row,A=R.col,E=R.rowCount,O=R.colCount}}return{row:P,col:A,rowCount:E,colCount:O}},L.prototype.cellRangeInflate=function(T,w){for(var M=T&&T.length,D=0;D<M;D++){var P=T[D];if(w.intersect(P.row,P.col,P.rowCount,P.colCount))return T.splice(D,1),this.cellRangeInflate(T,w.union(P))}return w},L.prototype.getFormulaRange=function(T){var w=this,M=w.getSheet(),D=M.getValue(T.row,T.col-1),P=M.getValue(T.row-1,T.col),A=!1;A=w.getStartRangeDirection(T,M,D,P);var E=w.calculateRange(A,T),O=E.row,I=E.col,R=E.rowCount,k=E.colCount;if(I===void 0&&O===void 0)return T;if(I===void 0){var N=O;return w.calculateValidRange(N,T.col,T.row-N,k)}return w.calculateValidRange(T.row,I,R,T.col-I)},L.prototype.calculateRange=function(T,w){var M,D,P=1,A=1,E=this.getSheet(),O=!1;if(T===!1)for(var I=w.row-1;I>=0;I--){var R=E.getValue(I,w.col);if(this.valueIsNumber(R)&&E.getFormula(I,w.col)!==null){O=!0,M=I;break}if(this.valueIsNumber(R))O=!0,I===0&&(M=0);else if(O===!0&&!this.valueIsNumber(R)){M=I+1;break}}if(!O)for(var I=w.col-1;I>=0;I--){var R=E.getValue(w.row,I);if(this.valueIsNumber(R))O=!0,I===0&&(D=0);else if(O===!0&&!this.valueIsNumber(R)){D=I+1;break}}return{row:M,col:D,rowCount:P,colCount:A}},L.prototype.getStartRangeDirection=function(T,w,M,D){for(var P=!1,A=!1,E=!1,O=T.col-1;O>=0;O--){var I=w.getValue(T.row,O),R=w.getFormula(T.row,O);if(R)break;if(this.valueIsNumber(I)){P=!0;break}}for(var O=T.row-1;O>=0;O--){var I=w.getValue(O,T.col),R=w.getFormula(O,T.col);if(R){A=!0;break}if(this.valueIsNumber(I))break}return(this.valueIsNumber(M)&&!this.valueIsNumber(D)||P&&A)&&(E=!0),E},L.prototype.valueIsNumber=function(T){return typeof T=="number"},L.prototype.getSpan=function(T,w){return new d.Spread.Sheets.Range(T,w,1,1)},L.prototype.setFormulaForSingleRange=function(T,w,M,D,P,A){var E=this,O=E.getSheet(),I=O.getParent(),R=T.row,k=T.col,N=E.getSpan(R,k),B=!1;N&&N.equals(T)&&(B=!0);var F=I.options.referenceStyle===1,j=T.row,K=T.col;if(T.colCount===1&&T.rowCount===1||B)E.setFormulaToSingleCell(T,w,F,P,A);else if(T.colCount===1){var Q=R+T.rowCount-1,X=k;if(O.getText(R,X))if(O.getText(Q,X)){for(;Q<O.getRowCount()&&O.getText(Q,X);)Q++;j=Math.min(Q,O.getRowCount()-1);var J=f(T,j,X,b,F);E.setFormulaToSheet(O,j,X,w,J,P,A)}else{var fe={row:R,col:X,colCount:T.colCount,rowCount:T.rowCount-1};j=Q;var J=f(fe,Q,X,b,I.options.referenceStyle===1);E.setFormulaToSheet(O,Q,X,w,J,P,A)}else{var ne=new d.Spread.Sheets.Range(R,X,1,1);E.setFormulaToSingleCell(ne,w,F,P,A);for(var ce=1;ce<T.rowCount;ce++)O.copyTo(R,X,R+ce,X,1,1,d.Spread.Sheets.CopyToOptions.formula)}}else if(T.rowCount===1){var V=R,Z=k+T.colCount-1;if(O.getText(V,k))if(O.getText(V,Z)){for(;Z<O.getColumnCount()&&O.getText(V,Z);)Z++;K=Math.min(Z,O.getColumnCount()-1);var J=f(T,V,Z,b,F);E.setFormulaToSheet(O,V,Z,w,J,P,A)}else{var fe={row:V,col:k,colCount:T.colCount-1,rowCount:T.rowCount};K=Z;var J=f(fe,V,Z,b,F);E.setFormulaToSheet(O,V,Z,w,J,P,A)}else{var ne=new d.Spread.Sheets.Range(V,k,1,1);E.setFormulaToSingleCell(ne,w,F,P,A);for(var Y=1;Y<T.colCount;Y++)O.copyTo(V,k,V,k+Y,1,1,d.Spread.Sheets.CopyToOptions.formula)}}else{var W=T.row<=M&&M<=T.row+T.rowCount&&T.col<=D&&D<=T.col+T.colCount,H=W?M:T.row,$=W?D:T.col,ee=!!O.getText(H,$);if(ee)E.setMultiRowColRangeFormula(T,w);else if(P)E.setFormulaToSingleCell(new d.Spread.Sheets.Range(H,$,1,1),w,F,P,A);else{var ne=new d.Spread.Sheets.Range(H,$,1,1);E.setFormulaToSingleCell(ne,w,F,P,A);for(var ce=0;ce<T.rowCount;ce++)for(var Y=0;Y<T.colCount;Y++){var ae=T.row+ce,de=T.col+Y;(ae!==H||de!==$)&&O.copyTo(H,$,ae,de,1,1,d.Spread.Sheets.CopyToOptions.formula)}}}return{editingRowIndex:j,editingColIndex:K}},L.prototype.setFormulaToSingleCell=function(T,w,M,D,P){var A=this,E=A.getSheet(),O=T.row,I=T.col;if(!A._noNeedSetFormula(O,I)){var R=A.getFormulaRange(T);if(R){var k=void 0;R.rowCount!==1||R.colCount!==1||R.row!==O||R.col!==I?k=f(R,O,I,b,M):k="",A.setFormulaToSheet(E,O,I,w,k,D,P)}}},L.prototype.setFormulaToSheet=function(T,w,M,D,P,A,E){for(var O=E&&A?"="+D+"()":"="+D+"("+P+")",I=T.getSpans(this.getSpan(w,M)),R=0,k=I;R<k.length;R++){var N=k[R];if(N.row!==w||N.col!==M)throw new Error("can't insert formula in span")}A?(T.inputFormulaAndSelectFormulaRange(w,M,!1,O,P,E),T.setEditorStatus(d.Spread.Sheets.EditorStatus.enter)):T.setFormula(w,M,O),T.showCell(w,M,h.nearest,g.nearest)},L.prototype.setMultiRowColRangeFormula=function(T,w){for(var M=this,D=T.row+T.rowCount-1,P=T.col+T.colCount-1,A=M.getSheet(),E=!0,O=!0,I=T.col;I<T.col+T.colCount;I++)if(A.getValue(D,I)){E=!1;break}for(var I=T.row;I<T.row+T.rowCount;I++)if(A.getValue(I,P)){O=!1;break}O?(!E&&O||M.setWholeRowFormula(E,D,T,w),M.setWholeColFormula(P,T,w)):M.setWholeRowFormula(E,D,T,w)},L.prototype.setWholeRowFormula=function(T,w,M,D){for(var P=T?w:w+1,A=this,E=M.col;E<M.col+M.colCount;E++){for(var O=!0,I=M.row;I<M.row+M.rowCount;I++)if(A.getSheet().getCell(I,E).value()!==null){O=!1;break}if(!O){if(A._noNeedSetFormula(P,E))break;var R={col:E,colCount:1,row:M.row,rowCount:M.rowCount+(T?-1:0)},k=f(R,P,E,b,A.getSpread().options.referenceStyle===1);k="="+D+"("+k+")",A.getSheet().setFormula(P,E,k),A.getSheet().showCell(P,E,h.nearest,g.nearest)}}},L.prototype.setWholeColFormula=function(T,w,M){for(var D=this,P=w.row;P<w.row+w.rowCount;P++){for(var A=!0,E=w.col;E<w.col+w.colCount;E++)if(D.getSheet().getCell(P,E).value()!==null){A=!1;break}if(!A){if(D._noNeedSetFormula(P,T))break;var O={col:w.col,colCount:w.colCount-1,row:P,rowCount:1},I=f(O,P,T-1,b,D.getSpread().options.referenceStyle===1);I="="+M+"("+I+")",D.getSheet().setFormula(P,T,I),D.getSheet().showCell(P,T,h.nearest,g.nearest)}}},L})(c.ShortcutActionBase);c.Commands[S]={canUndo:!0,execute:function(x,L,T){return L.cmd=S,(0,c.executeCommand)(x,y,L,T)}};function v(x){u.Util.isFirefox()?x.register(S,c.Commands[S],61,!1,!1,!0,!1):x.register(S,c.Commands[S],187,!1,!1,!0,!1)}r.initShortcutAboutCalc=v}),"./src/shortcut/action.cell.ts":(function(a,r,o){var l=this&&this.__extends||(function(){var L=function(T,w){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,D){M.__proto__=D}||function(M,D){for(var P in D)Object.prototype.hasOwnProperty.call(D,P)&&(M[P]=D[P])},L(T,w)};return function(T,w){if(typeof w!="function"&&w!==null)throw new TypeError("Class extends value "+String(w)+" is not a constructor or null");L(T,w);function M(){this.constructor=T}T.prototype=w===null?Object.create(w):(M.prototype=w.prototype,new M)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.initShortcutAboutCell=void 0;var c=o("./src/shell/action.base.ts"),d=o("sjs-spread-sheets"),u=o("./src/common/util.ts"),h="setDate",g="copyCellDown",f="copyCellRight",b=d.Spread.Sheets.VerticalPosition,S=d.Spread.Sheets.HorizontalPosition,y=(function(L){l(T,L);function T(){return L!==null&&L.apply(this,arguments)||this}return T.prototype.canExecute=function(){return L.prototype._canEditInActiveCell.call(this)},T.prototype.executeImp=function(){var w=this,M=w.getSheet(),D=w._options;M.suspendPaint();var P=D.activeRowIndex,A=D.activeColIndex,E=D.date;M.startEdit();var O=M.getCellType(P,A);if(O&&O.setEditorValue){var I=M.getCellTypeEditElement(P,A);O.setEditorValue(I,E==null?void 0:E.toLocaleDateString()),O.focus(I)}return M.showCell(P,A,b.nearest,S.nearest),M.resumePaint(),!0},T.prototype.canUndo=function(){return!0},T})(c.ShortcutActionBase);c.Commands[h]={canUndo:!1,execute:function(L,T,w){var M,D,P=u.Util.getSheet(L,T);if(!w&&!T.cmd){T.cmd=h;var A=(M=T.activeRowIndex)!==null&&M!==void 0?M:P.getActiveRowIndex(),E=(D=T.activeColIndex)!==null&&D!==void 0?D:P.getActiveColumnIndex(),O=new Date;O.setHours(0,0,0,0);var I=P.getValue(A,E);if(I instanceof Date&&I.getTime()===O.getTime())return!1;T.date=O}return(0,c.executeCommand)(L,y,T,w)}};var v=(function(L){l(T,L);function T(){return L!==null&&L.apply(this,arguments)||this}return T.prototype.executeImp=function(){var w=this,M=w.getSheet(),D=w._options.selections,P=w._options;if(D.length===1){var A=D[0],E=A.row,O=A.col;if(P.direction===d.Spread.Sheets.Fill.FillDirection.right&&A.colCount===1){var I=A;if(I.col===0)return!0;var R=M.tables.find(I.row,I.col-1);if(R){var k=u.Util.isRangeHasValue(M,new d.Spread.Sheets.Range(I.row,I.col-1,I.rowCount,1));return k&&(R.range().intersect(I.row,I.col,1,1)||R.insertColumns(R.dataRange().colCount-1,1,!0),A.rowCount>1&&I.row===R.range().row?M.copyTo(I.row+1,I.col-1,I.row+1,I.col,I.rowCount-1,1,d.Spread.Sheets.CopyToOptions.value):M.copyTo(I.row,I.col-1,I.row,I.col,I.rowCount,1,d.Spread.Sheets.CopyToOptions.value)),!0}return M.copyTo(I.row,I.col-1,I.row,I.col,I.rowCount,1,d.Spread.Sheets.CopyToOptions.all),!0}else if(P.direction===d.Spread.Sheets.Fill.FillDirection.down&&A.rowCount===1){var I=A;if(I.row===0)return!0;var R=M.tables.find(I.row-1,I.col);return R?(R.range().intersect(I.row,I.col,1,1)||R.insertRows(R.dataRange().rowCount-1,1,!0),M.copyTo(I.row-1,I.col,I.row,I.col,1,I.colCount,d.Spread.Sheets.CopyToOptions.value),!0):(M.copyTo(I.row-1,I.col,I.row,I.col,1,I.colCount,d.Spread.Sheets.CopyToOptions.all),!0)}var N=null,B=void 0;switch(P.direction){case d.Spread.Sheets.Fill.FillDirection.down:N=new d.Spread.Sheets.Range(Math.max(0,E),O,1,A.colCount),B=new d.Spread.Sheets.Range(E,O,A.rowCount,A.colCount);break;case d.Spread.Sheets.Fill.FillDirection.right:N=new d.Spread.Sheets.Range(E,Math.max(0,O),A.rowCount,1),B=new d.Spread.Sheets.Range(E,O,A.rowCount,A.colCount);break}if(N&&B){try{M.fillAuto(N,B,{fillType:d.Spread.Sheets.Fill.FillType.direction,direction:P.direction})}catch{}M.showCell(N.row,N.col,b.nearest,S.nearest)}}return!0},T})(c.ShortcutActionBase);c.Commands[g]={canUndo:!0,execute:function(L,T,w){T.cmd=g;var M=u.Util.getSheet(L,T);if(M.isActualProtected())return!0;var D=T.selections||M.getSelections();return D.length>0?(T.direction=d.Spread.Sheets.Fill.FillDirection.down,(0,c.executeCommand)(L,v,T,w)):!0}},c.Commands[f]={canUndo:!0,execute:function(L,T,w){T.cmd=f;var M=u.Util.getSheet(L,T);if(M.isActualProtected()||u.Util.hasSelectedShapeOrFloatingObject(M))return!0;var D=T.selections||M.getSelections();return D.length>0?(T.direction=d.Spread.Sheets.Fill.FillDirection.right,(0,c.executeCommand)(L,v,T,w)):!0}};function x(L){var T=u.Util._isMacOS(),w=!T,M=T;u.Util.isFirefox()?L.register(h,c.Commands[h],59,w,!1,!1,M):L.register(h,c.Commands[h],186,w,!1,!1,M),L.register(g,c.Commands[g],68,w,!1,!1,M),L.register(f,c.Commands[f],82,w,!1,!1,M)}r.initShortcutAboutCell=x}),"./src/shortcut/action.row.column.ts":(function(a,r,o){var l=this&&this.__extends||(function(){var D=function(P,A){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,O){E.__proto__=O}||function(E,O){for(var I in O)Object.prototype.hasOwnProperty.call(O,I)&&(E[I]=O[I])},D(P,A)};return function(P,A){if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");D(P,A);function E(){this.constructor=P}P.prototype=A===null?Object.create(A):(E.prototype=A.prototype,new E)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.initShortcutAboutRowsAndColumns=void 0;var c=o("sjs-spread-sheets"),d=o("./src/shell/action.base.ts"),u=o("./src/common/util.ts"),h=c.Spread.Sheets.VerticalPosition,g=c.Spread.Sheets.HorizontalPosition,f="deleteEntireRowOrColumn",b="hideSelectRows",S="groupSelectRange",y="ungroupSelectRange",v="InsertRowOrColumn",x=(function(D){l(P,D);function P(){return D!==null&&D.apply(this,arguments)||this}return P.prototype.executeImp=function(){var A,E,O=this,I=O.getSheet(),R=O._options,k=(A=R.activeRowIndex)!==null&&A!==void 0?A:I.getActiveRowIndex(),N=(E=R.activeColIndex)!==null&&E!==void 0?E:I.getActiveColumnIndex(),B=R.isDelete,F=0;if(R.isRow){var j=R.rowInfos;if(j)if(B){if(I.isActualProtected())return!0;for(F=j.length-1;F>=0;F--){var K=j[F];I.deleteRows(K.startRowIndex,K.rowCount)}}else{if(I&&u.Util.needCheckProtectionOptions(I)&&!I.options.protectionOptions.allowInsertRows)return!0;for(F=0;F<j.length;F++){var K=j[F];I.addRows(K.startRowIndex,K.rowCount)}}}else{var Q=R.colInfos;if(Q)if(B){if(I.isActualProtected())return!0;for(F=Q.length-1;F>=0;F--){var X=Q[F];I.deleteColumns(X.startColIndex,X.colCount)}}else{if(I&&u.Util.needCheckProtectionOptions(I)&&!I.options.protectionOptions.allowInsertColumns)return!0;for(F=0;F<Q.length;F++){var X=Q[F];I.addColumns(X.startColIndex,X.colCount)}}}return I.showCell(k,N,h.nearest,g.nearest),!0},P})(d.ShortcutActionBase);function L(D,P){if(D.length===0)return!1;if(D.length===1){var A=D[0],E=u.Util.getRangeType(A);if(E===3)return!0;if(E===2)P.isRow=!1,P.colInfos=[{startColIndex:A.col,colCount:A.colCount}];else if(E===1)P.isRow=!0,P.rowInfos=[{startRowIndex:A.row,rowCount:A.rowCount}];else return!0}else{var O=u.Util.getRangeType(D[0]);if(O===0||O===3)return!0;O===2?P.isRow=!1:O===1&&(P.isRow=!0),P.rowInfos=[],P.colInfos=[];for(var I=0,R=D;I<R.length;I++){var A=R[I],E=u.Util.getRangeType(A);if(E!==O)return!0}D.forEach(function(k){var N=u.Util.getRangeType(k);N===1?P.rowInfos&&P.rowInfos.push({startRowIndex:k.row,rowCount:k.rowCount}):N===2&&P.colInfos&&P.colInfos.push({startColIndex:k.col,colCount:k.colCount})})}}d.Commands[f]={canUndo:!0,execute:function(D,P,A){var E=u.Util.getSheet(D,P);if(E.isActualProtected())return!0;if(P.cmd=f,!A){P.isDelete=!0;var O=P.selections||E.getSelections(),I=O.filter(function(R){return!(R.colCount===1&&R.rowCount===1)});L(I,P)}return(0,d.executeCommand)(D,x,P,A)}},d.Commands[v]={canUndo:!0,execute:function(D,P,A){var E=u.Util.getSheet(D,P);if(P.cmd=v,!A){P.isDelete=!1;var O=P.selections||E.getSelections();L(O,P)}return(0,d.executeCommand)(D,x,P,A)}};var T=(function(D){l(P,D);function P(){return D!==null&&D.apply(this,arguments)||this}return P.prototype.executeImp=function(){var A,E,O=this,I=O.getSheet(),R=O._options,k=R.rowInfo;if(k.length>0){I.suspendPaint(),I.suspendEvent();var N=(A=R.activeRowIndex)!==null&&A!==void 0?A:I.getActiveRowIndex(),B=(E=R.activeColIndex)!==null&&E!==void 0?E:I.getActiveColumnIndex();return k.forEach(function(F){for(var j=F.startRowIndex<0?0:F.startRowIndex,K=F.rowCount,Q=j+K,X=j;X<Q;X++)I.setRowVisible(X,!1)}),I.showCell(N,B,h.nearest,g.nearest),I.resumeEvent(),I.resumePaint(),!0}return!1},P})(d.ShortcutActionBase);d.Commands[b]={canUndo:!0,execute:function(D,P,A){P.cmd=b;var E=u.Util.getSheet(D,P);if(E&&u.Util.needCheckProtectionOptions(E)&&!E.options.protectionOptions.allowResizeRows)return!0;var O=P.selections||E.getSelections(),I=[];return!A&&O.length>0&&(O.forEach(function(R){var k=R.row,N=R.rowCount;I.push({startRowIndex:k,rowCount:N})}),P.rowInfo=I),(0,d.executeCommand)(D,T,P,A)}};var w=(function(D){l(P,D);function P(){return D!==null&&D.apply(this,arguments)||this}return P.prototype.executeImp=function(){var A=this,E=A._options,O=A.getSheet(),I=E.selection,R=E.isGroup;if(!I)return!1;var k=u.Util.getRangeType(I);try{if(O.suspendPaint(),k===2){var N=I.col,B=I.colCount;R?O.columnOutlines.group(N,B):O.columnOutlines.ungroupRange(N,B),O.showCell(0,N,h.nearest,g.nearest)}else if(k===1){var F=I.row,j=I.rowCount;R?O.rowOutlines.group(F,j):O.rowOutlines.ungroupRange(F,j),O.showCell(F,0,h.nearest,g.nearest)}}finally{O.resumePaint()}return!0},P.prototype.canUndo=function(){return!0},P})(d.ShortcutActionBase);d.Commands[S]={canUndo:!0,execute:function(D,P,A){var E=u.Util.getSheet(D,P);if(P.cmd=S,!A){var O=P.selections||E.getSelections();if(P.isGroup=!0,O.length===1){var I=O[0],R=u.Util.getRangeType(I);if((R===1||R===2)&&(P.selection=I),R===1&&E.rowOutlines.getMaxLevel()>=6)return!1;if(R===2&&E.columnOutlines.getMaxLevel()>=6)return!1}}return P.selection?(0,d.executeCommand)(D,w,P,A):!1}},d.Commands[y]={canUndo:!0,execute:function(D,P,A){var E=u.Util.getSheet(D,P);if(P.cmd=y,!A){var O=P.selections||E.getSelections();if(P.isGroup=!1,O.length===1){var I=O[0],R=u.Util.getRangeType(I);(R===1||R===2)&&(P.selection=I)}}return P.selection?(0,d.executeCommand)(D,w,P,A):!1}};function M(D){var P=u.Util._isMacOS(),A=!P,E=P;D.register(b,d.Commands[b],57,A,!1,!1,E),D.register(b,d.Commands[b],105,A,!1,!1,E),D.register(S,d.Commands[S],39,!1,!0,!0,!1),D.register(y,d.Commands[y],37,!1,!0,!0,!1),D.register(f,d.Commands[f],109,A,!1,!1,E),D.register(v,d.Commands[v],107,A,!0,!1,E),u.Util.isFirefox()?(D.register(f,d.Commands[f],173,A,!1,!1,E),D.register(v,d.Commands[v],61,A,!0,!1,E)):(D.register(f,d.Commands[f],189,A,!1,!1,E),D.register(v,d.Commands[v],187,A,!0,!1,E))}r.initShortcutAboutRowsAndColumns=M}),"./src/shortcut/action.selection.ts":(function(a,r,o){var l=this&&this.__assign||function(){return l=Object.assign||function(J){for(var V,Z=1,Y=arguments.length;Z<Y;Z++){V=arguments[Z];for(var W in V)Object.prototype.hasOwnProperty.call(V,W)&&(J[W]=V[W])}return J},l.apply(this,arguments)};Object.defineProperty(r,"__esModule",{value:!0}),r.initShortcutAboutSelection=void 0;var c=o("./src/shell/action.base.ts"),d=o("sjs-spread-sheets"),u=o("./src/common/util.ts"),h="selectEntireRow",g="goToSheetBeginning",f="selectEntireColumn",b="goToSheetBottomRight",S="goToPrecedent",y="selectVisibleCells",v="goToDependents",x="SelectAll",L="selectionHome",T="selectionEnd",w="selectionTop",M="selectionBottom",D="gotoNextTopNonNullCell",P="gotoNextBottomNonNullCell",A="gotoNextLeftNonNullCell",E="gotoNextRightNonNullCell",O=d.Spread.Sheets.VerticalPosition,I=d.Spread.Sheets.HorizontalPosition;c.Commands[h]={canUndo:!1,execute:function(J,V){var Z=u.Util.getSheet(J,V);if(V.cmd=h,Z.editorStatus()===d.Spread.Sheets.EditorStatus.ready){var Y=Z.getSelections(),W=Y.length-1,H=Y[W];return H&&(H.col=-1,H.colCount=Z.getColumnCount(),Z.repaint()),!0}return!1}},c.Commands[f]={canUndo:!1,execute:function(J,V){var Z=u.Util.getSheet(J,V);if(V.cmd=f,Z.editorStatus()===d.Spread.Sheets.EditorStatus.ready){var Y=Z.getSelections(),W=Y.length-1,H=Y[W];return H&&(H.row=-1,H.rowCount=Z.getRowCount(),Z.repaint()),!0}return!1}},c.Commands[g]={canUndo:!1,execute:function(J,V){var Z=u.Util.getSheet(J,V);return V.cmd=g,Z.editorStatus()===d.Spread.Sheets.EditorStatus.ready&&Z.canSelect(0,0)?(Z.suspendPaint(),Z.showCell(0,0,d.Spread.Sheets.VerticalPosition.nearest,d.Spread.Sheets.HorizontalPosition.nearest),Z.setSelection(0,0,1,1),Z.resumePaint(),!0):!1}},c.Commands[b]={canUndo:!1,execute:function(J,V){var Z=u.Util.getSheet(J,V);if(V.cmd=b,Z.editorStatus()===d.Spread.Sheets.EditorStatus.ready){var Y=Z.getLastNonNullRow(),W=Z.getLastNonNullColumn();return Z.canSelect(Y,W)?(Z.showCell(Y,W,O.nearest,I.nearest),Z.setSelection(Y,W,1,1),!0):!1}return!1}};function R(J,V,Z){var Y=Z.selections||J.getSelections(),W=[];return Y.forEach(function(H){var $=H.row,ee=H.col,ae=H.rowCount,de=H.colCount;ae===-1&&(ae=1),de===-1&&(de=1);for(var he=$;he<$+ae;he++)for(var be=ee;be<ee+de;be++)V?W=W.concat(J.getPrecedents(he,be)):W=W.concat(J.getDependents(he,be))}),W}function k(J,V,Z){var Y,W;if(Z){if(J.row===V.row&&J.rowCount===V.rowCount){var H=J.col<V.col?[J,V]:[V,J],$=H[0],ee=H[1],ae=$.col+((Y=$.colCount)!==null&&Y!==void 0?Y:1),de=$.col;return ee.col>=de&&ee.col<=ae}}else if(J.col===V.col&&J.colCount===V.colCount){var he=J.row<V.row?[J,V]:[V,J],be=he[0],Le=he[1],Fe=be.row+((W=be.rowCount)!==null&&W!==void 0?W:1),q=be.row;return Le.row>=q&&Le.row<=Fe}return!1}function N(J){var V,Z,Y,W,H=J.length;if(H===1)return J;if(H===0)return[];for(var $=0;$<H;$++)for(var ee=$+1;ee<H;ee++){var ae=J[$],de=J[ee];if(!de||ae.sheetName!==de.sheetName)break;if(k(ae,de,!0)){var he=Math.min(ae.col,de.col),be=Math.max(ae.col+((V=ae.colCount)!==null&&V!==void 0?V:1),de.col+((Z=de.colCount)!==null&&Z!==void 0?Z:1)),Le=be-he,Fe={sheetName:ae.sheetName,row:ae.row,rowCount:ae.rowCount,col:he,colCount:Le};J.splice(ee,1),J.splice($,1,Fe);break}else if(k(ae,de,!1)){var q=Math.min(ae.row,de.row),se=Math.max(ae.row+((Y=ae.rowCount)!==null&&Y!==void 0?Y:1),de.row+((W=de.rowCount)!==null&&W!==void 0?W:1)),ue=se-q,Fe={sheetName:ae.sheetName,row:q,rowCount:ue,col:ae.col,colCount:ae.colCount};J.splice(ee,1),J.splice($,1,Fe);break}}return J.length===H?J:N(J)}function B(J,V){for(var Z=0;Z<V.length;Z++){var Y=V[Z],W=Y.row,H=Y.col,$=Y.rowCount,ee=Y.colCount;Z===0?$===1&&ee===1?(J.setActiveCell(W,H),J.showCell(W,H,O.nearest,I.nearest)):J.setSelection(W,H,$,ee):J.addSelection(W,H,$,ee)}}function F(J,V,Z){var Y=V.sheetName,W=u.Util.getSheet(J,V);if(W.isActualProtected()&&u.Util.containLockedCellsInSelections(W)){var H=d.Spread.Sheets.Designer.getResources();return d.Spread.Sheets.Designer.showMessageBox(H.isProtected,H.title,d.Spread.Sheets.Designer.MessageBoxIcon.warning),!1}var $=R(W,Z,V);if($.sort(function(Fe,q){return Fe.sheetName===Y&&q.sheetName!==Y?-1:Fe.sheetName!==Y&&q.sheetName===Y?1:0}),$.length>0&&W.editorStatus()===d.Spread.Sheets.EditorStatus.ready){W.suspendPaint(),$=N($);for(var ee=Y,ae=[],de=0;de<$.length;de++){var he=$[de],be=he.sheetName;if(de===0)ee=be;else if(be!==ee)continue;ae.push(he)}var Le=W;return ee!==Y&&(Le=u.Util.getSheet(J,l(l({},V),{sheetName:ee})),Le instanceof d.Spread.Sheets.Worksheet?J.setActiveSheet(ee):d.Spread.Report&&Le instanceof d.Spread.Report.ReportSheet&&Le.renderMode()==="Design"&&J.setActiveSheetTab(ee)),B(Le,ae),W.resumePaint(),!0}return!1}c.Commands[v]={canUndo:!1,execute:function(J,V,Z){return F(J,V,!1)}},c.Commands[S]={canUndo:!1,execute:function(J,V,Z){return F(J,V,!0)}},c.Commands[y]={canUndo:!1,execute:function(J,V,Z){var Y=function(){var ee=J.getSheetFromName(V.sheetName);if(ee===void 0){var ae=J.getActiveSheetTab();if(ae&&typeof ae.renderMode=="function")return ae.getTemplate()}return ee},W=Y();V.cmd=y;var H=u.Util.getInvisibleRange(W);if(H.length>0&&W.editorStatus()===d.Spread.Sheets.EditorStatus.ready){W.suspendPaint(),W.clearSelection();var $=H.shift();W.setSelection($.row,$.col,$.rowCount,$.colCount),H.forEach(function(ee){W.addSelection(ee.row,ee.col,ee.rowCount,ee.colCount)}),W.resumePaint()}return!0}};function j(J,V){if(!J.pivotTables)return!1;var Z=V.selections||J.getSelections(),Y=J.pivotTables.all();if(Y.length===0)return!1;for(var W=0,H=Z;W<H.length;W++)for(var $=H[W],ee=0;ee<Y.length;ee++){var ae=Y[ee],de=ae.getRange(),he=de.page,be=de.content;if(he&&he.equals($)||be&&be.equals($))return!1;if(!(he&&he.containsRange($)||be&&be.containsRange($)))return!1}return!0}c.Commands[x]={canUndo:!1,execute:function(J,V,Z){var Y,W,H=u.Util.getSheet(J,V);if(u.Util.hasSelectedShapeOrFloatingObject(H)||H.editorStatus()===d.Spread.Sheets.EditorStatus.enter||H.editorStatus()===d.Spread.Sheets.EditorStatus.edit||j(H,V))return!1;V.cmd=x;var $=V.selections||H.getSelections(),ee=-1,ae=-1,de=H.getRowCount(),he=H.getColumnCount(),be=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),Le=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex(),Fe=u.Util.getNeedAdjustSelection($,be,Le);if(!Fe)return!1;var q;q=H.expandSelection(H,new d.Spread.Sheets.Range(be,Le,1,1)),ee=q.row,ae=q.col,de=q.rowCount,he=q.colCount;var se=H.tables.find(be,Le);if(se&&(q=se.range(),q.rowCount>1)){var ue=u.Util.getActiveSelectedRange($,be,Le);if(!ue)return!1;var ge=new d.Spread.Sheets.Range(q.row+1,q.col,q.rowCount-1,q.colCount);ue.equals(ge)||ue.intersect(q.row,q.col,1,q.colCount)?(ee=q.row,ae=q.col,de=q.rowCount,he=q.colCount):(ee=ge.row,ae=ge.col,de=ge.rowCount,he=ge.colCount)}for(var xe=0,ke=$;xe<ke.length;xe++){var ue=ke[xe];if(q&&q.equals(ue)){ee=-1,ae=-1,de=H.getRowCount(),he=H.getColumnCount();break}}return H.editorStatus()===d.Spread.Sheets.EditorStatus.ready?(H.suspendPaint(),H.setSelection(ee,ae,de,he),H.setRangeActiveCells(be,Le),H.resumePaint(),!0):!1}};function K(J,V){for(var Z=J.getSpans(V),Y=V,W=0,H=Z;W<H.length;W++){var $=H[W];Y=Y.union($)}V.row=Y.row,V.col=Y.col,V.rowCount=Y.rowCount,V.colCount=Y.colCount}function Q(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=V.selections||H.getSelections(),ee=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),ae=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaTextCtrlShift(H,3);var de=u.Util.getNeedAdjustSelection($,ee,ae);if(de!==null){var he=u.Util.getCellPositionInRangeByCol(de,ae);if(he===1&&de.col===-1)return!0;var be=void 0,Le=void 0,Fe=void 0;he===2?Le=de.col:he===0?Le=de.col+de.colCount-1:Le=de.col;var q=he===0?de.col+de.colCount-1-1:de.col-1;for(Fe=Le-1;Fe>=0&&!H.getColumnVisible(Fe);)Fe--;var se=u.Util.hasValue(H,ee,Le),ue=u.Util.hasValue(H,ee,Fe),ge=se&&ue;ge?be=u.Util.findFirstNotNullColIndexInRange(H,ee,q):be=u.Util.findPreviousNotNullColIndex(H,ee,q),he===2?de.colCount=ae-be+1:he===0?de.colCount=Math.abs(be-ae)+1:de.colCount=de.col+de.colCount-be,be<ae?de.col=be:he!==1&&(de.col=ae),K(H,de);for(var xe=de.row;xe<de.row+de.rowCount;xe++)for(var ke=de.col;ke<de.col+de.colCount;ke++)if(!H.canSelect(xe,ke))return!1;H.suspendPaint(),H.showCell(ee,de.col,O.nearest,I.nearest),H.setSelection(de.row,de.col,de.rowCount,de.colCount),H.setRangeActiveCells(ee,ae),H.resumePaint()}return!0}function X(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=H.getColumnCount(),ee=V.selections||H.getSelections(),ae=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),de=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaTextCtrlShift(H,4);var he=u.Util.getNeedAdjustSelection(ee,ae,de);if(he!==null){var be=u.Util.getCellPositionInRangeByCol(he,de);if(be===1&&he.col===-1)return!0;var Le=void 0,Fe=void 0,q=void 0;be===2?Fe=he.col:Fe=he.col+he.colCount-1;var se=be===2?he.col+1:he.col+he.colCount;for(q=Fe+1;q<$&&!H.getColumnVisible(q);)q++;var ue=u.Util.hasValue(H,ae,Fe),ge=u.Util.hasValue(H,ae,q),xe=ue&≥xe?Le=u.Util.findLastNotNullColIndexInRange(H,ae,se):Le=u.Util.findNextNotNullColIndex(H,ae,se),be===2?he.colCount=Math.abs(Le-de)+1:be===0?he.colCount=Le-de+1:he.colCount=Le-he.col+1,Le<de?he.col=Le:be!==1&&(he.col=de),K(H,he);for(var ke=he.row;ke<he.row+he.rowCount;ke++)for(var Je=he.col;Je<he.col+he.colCount;Je++)if(!H.canSelect(ke,Je))return!1;H.suspendPaint(),H.showCell(ae,he.col+he.colCount-1,O.nearest,I.nearest),H.setSelection(he.row,he.col,he.rowCount,he.colCount),H.setRangeActiveCells(ae,de),H.resumePaint()}return!0}c.Commands[L]={canUndo:!1,execute:function(J,V,Z){var Y=u.Util.getSheet(J,V);return Y.options.rightToLeft?X(J,V):Q(J,V)}},c.Commands[T]={canUndo:!1,execute:function(J,V,Z){var Y=u.Util.getSheet(J,V);return Y.options.rightToLeft?Q(J,V):X(J,V)}},c.Commands[w]={canUndo:!1,execute:function(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=V.selections||H.getSelections(),ee=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),ae=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaTextCtrlShift(H,1);var de=u.Util.getNeedAdjustSelection($,ee,ae);if(de!==null){var he=u.Util.getCellPositionInRangeByRow(de,ee);if(he===1&&de.row===-1)return!0;var be=void 0,Le=void 0,Fe=void 0;he===2?Le=de.row:he===0?Le=de.row+de.rowCount-1:Le=de.row;var q=he===0?de.row+de.rowCount-1-1:de.row-1;for(Fe=Le-1;Fe>=0&&!H.getRowVisible(Fe);)Fe--;var se=u.Util.hasValue(H,Le,ae),ue=u.Util.hasValue(H,Fe,ae),ge=se&&ue;ge?be=u.Util.findFirstNotNullRowIndexInRange(H,ae,q):be=u.Util.findPreviousNotNullRowIndex(H,ae,q),he===2?de.rowCount=ee-be+1:he===0?de.rowCount=Math.abs(be-ee)+1:de.rowCount=de.row+de.rowCount-be,be<ee?de.row=be:he!==1&&(de.row=ee),K(H,de);for(var xe=de.row;xe<de.row+de.rowCount;xe++)for(var ke=de.col;ke<de.col+de.colCount;ke++)if(!H.canSelect(xe,ke))return!1;H.suspendPaint(),H.showCell(de.row,ae,O.nearest,I.nearest),H.setSelection(de.row,de.col,de.rowCount,de.colCount),H.setRangeActiveCells(ee,ae),H.resumePaint()}return!0}},c.Commands[M]={canUndo:!1,execute:function(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=H.getRowCount(),ee=V.selections||H.getSelections(),ae=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),de=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaTextCtrlShift(H,2);var he=u.Util.getNeedAdjustSelection(ee,ae,de);if(he){var be=u.Util.getCellPositionInRangeByRow(he,ae);if(be===1&&he.row===-1)return!0;var Le=void 0,Fe=void 0,q=void 0;be===2?Fe=he.row:Fe=he.row+he.rowCount-1;var se=be===2?he.row+1:he.row+he.rowCount;for(q=Fe+1;q<$&&!H.getRowVisible(q);)q++;var ue=u.Util.hasValue(H,Fe,de),ge=u.Util.hasValue(H,q,de),xe=ue&≥xe?Le=u.Util.findLastNotNullRowIndexInRange(H,de,se):Le=u.Util.findNextNotNullRowIndex(H,de,se),be===2?he.rowCount=Math.abs(Le-ae)+1:be===0?he.rowCount=Le-ae+1:he.rowCount=Le-he.row+1,Le<ae?he.row=Le:be!==1&&(he.row=ae),K(H,he);for(var ke=he.row;ke<he.row+he.rowCount;ke++)for(var Je=he.col;Je<he.col+he.colCount;Je++)if(!H.canSelect(ke,Je))return!1;H.suspendPaint(),H.showCell(he.row+he.rowCount-1,de,O.nearest,I.nearest),H.setSelection(he.row,he.col,he.rowCount,he.colCount),H.setRangeActiveCells(ae,de),H.resumePaint()}return!0}},c.Commands[D]={canUndo:!1,execute:function(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),ee=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaText(H,1);var ae=0,de=u.Util.hasValue(H,$,ee),he=$,be=ee;if(he-1<ae)return!0;for(he--;he>=ae&&!H.getRowVisible(he);)he--;if(he<0)return!0;var Le=de&&u.Util.hasValue(H,he,be);return Le?he=u.Util.findFirstNotNullRowIndexInRange(H,be,he):he=u.Util.findPreviousNotNullRowIndex(H,be,he),H.canSelect(he,be)?(H.suspendPaint(),H.setActiveCell(he,be),H.showCell(he,be,O.nearest,I.nearest),H.resumePaint(),!0):!1}},c.Commands[P]={canUndo:!1,execute:function(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=H.getRowCount(),ee=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),ae=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaText(H,2);var de=H.getRowCount(),he=u.Util.hasValue(H,ee,ae),be=ee,Le=ae;if(be+1>=de)return!0;for(be++;be<de&&!H.getRowVisible(be);)be++;if(be>=$)return!0;var Fe=he&&u.Util.hasValue(H,be,Le);return Fe?be=u.Util.findLastNotNullRowIndexInRange(H,Le,be):be=u.Util.findNextNotNullRowIndex(H,Le,be),H.canSelect(be,Le)?(H.suspendPaint(),H.setActiveCell(be,Le),H.showCell(be,Le,O.nearest,I.nearest),H.resumePaint(),!0):!1}};function ne(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),ee=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaText(H,3);var ae=0,de=u.Util.hasValue(H,$,ee),he=$,be=ee;if(be-1<ae)return!0;for(be--;be>=ae&&!H.getColumnVisible(be);)be--;if(be<0)return!0;var Le=de&&u.Util.hasValue(H,he,be);return Le?be=u.Util.findFirstNotNullColIndexInRange(H,he,be):be=u.Util.findPreviousNotNullColIndex(H,he,be),H.canSelect(he,be)?(H.suspendPaint(),H.setActiveCell(he,be),H.showCell(he,be,O.nearest,I.nearest),H.resumePaint(),!0):!1}function ce(J,V,Z){var Y,W,H=u.Util.getSheet(J,V),$=H.getColumnCount(),ee=(Y=V.activeRowIndex)!==null&&Y!==void 0?Y:H.getActiveRowIndex(),ae=(W=V.activeColIndex)!==null&&W!==void 0?W:H.getActiveColumnIndex();if(u.Util.hasSelectedShapeOrFloatingObject(H))return!1;if(H.editorStatus()!==0)return H.changeFormulaText(H,4);var de=$,he=u.Util.hasValue(H,ee,ae),be=ee,Le=ae;if(Le+1>=de)return!0;for(Le++;Le<de&&!H.getColumnVisible(Le);)Le++;if(Le>=$)return!0;var Fe=he&&u.Util.hasValue(H,be,Le);return Fe?Le=u.Util.findLastNotNullColIndexInRange(H,be,Le):Le=u.Util.findNextNotNullColIndex(H,be,Le),H.canSelect(be,Le)?(H.suspendPaint(),H.setActiveCell(be,Le),H.showCell(be,Le,O.nearest,I.nearest),H.resumePaint(),!0):!1}c.Commands[A]={canUndo:!1,execute:function(J,V,Z){var Y=u.Util.getSheet(J,V);return Y.options.rightToLeft?ce(J,V):ne(J,V)}},c.Commands[E]={canUndo:!1,execute:function(J,V,Z){var Y=u.Util.getSheet(J,V);return Y.options.rightToLeft?ne(J,V):ce(J,V)}};function fe(J){var V=u.Util._isMacOS(),Z=!V,Y=V;J.register(h,c.Commands[h],32,!1,!0,!1,!1),J.register(f,c.Commands[f],32,Z,!1,!1,Y),J.register(g,c.Commands[g],36,Z,!1,!1,Y),J.register(b,c.Commands[b],35,Z,!1,!1,Y),J.register(v,c.Commands[v],221,Z,!1,!1,Y),J.register(S,c.Commands[S],219,Z,!1,!1,Y),J.register(x,c.Commands[x],65,Z,!1,!1,Y),u.Util.isFirefox()?J.register(y,c.Commands[y],59,!1,!1,!0,!1):J.register(y,c.Commands[y],186,!1,!1,!0,!1),J.register(L,c.Commands[L],37,Z,!0,!1,Y),J.register(T,c.Commands[T],39,Z,!0,!1,Y),J.register(w,c.Commands[w],38,Z,!0,!1,Y),J.register(M,c.Commands[M],40,Z,!0,!1,Y),J.navigationTop&&J.setShortcutKey("navigationTop"),J.register(D,c.Commands[D],38,Z,!1,!1,Y),J.navigationBottom&&J.setShortcutKey("navigationBottom"),J.register(P,c.Commands[P],40,Z,!1,!1,Y),J.navigationHome2&&J.setShortcutKey("navigationHome2"),J.register(A,c.Commands[A],37,Z,!1,!1,Y),J.navigationEnd2&&J.setShortcutKey("navigationEnd2"),J.register(E,c.Commands[E],39,Z,!1,!1,Y)}r.initShortcutAboutSelection=fe}),"./src/shortcut/action.style.ts":(function(a,r,o){var l=this&&this.__extends||(function(){var P=function(A,E){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,I){O.__proto__=I}||function(O,I){for(var R in I)Object.prototype.hasOwnProperty.call(I,R)&&(O[R]=I[R])},P(A,E)};return function(A,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");P(A,E);function O(){this.constructor=A}A.prototype=E===null?Object.create(E):(O.prototype=E.prototype,new O)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.initShortcutAboutStyle=void 0;var c=o("./src/shell/action.base.ts"),d=o("sjs-spread-sheets"),u=o("./src/common/util.ts"),h="setCellBold",g="setCellItalicize",f="setCellUnderline",b="setNumberToPercent",S="font-weight",y="bold",v="font-style",x="normal",L="italic",T=d.Spread.Sheets.VerticalPosition,w=d.Spread.Sheets.HorizontalPosition,M=(function(P){l(A,P);function A(){return P!==null&&P.apply(this,arguments)||this}return A.prototype.executeImp=function(){var E,O,I=this,R=I.getSheet(),k=I._options,N=k.handler&&k.handler.bind(I),B=(E=k.activeRowIndex)!==null&&E!==void 0?E:R.getActiveRowIndex(),F=(O=k.activeColIndex)!==null&&O!==void 0?O:R.getActiveColumnIndex();return N&&this.setCellStyle(N),R.showCell(B,F,T.nearest,w.nearest),!0},A})(c.ShortcutActionBase);c.Commands[h]={canUndo:!0,execute:function(P,A,E){var O,I,R=u.Util.getSheet(P,A);if(R&&u.Util.needCheckProtectionOptions(R)&&!R.options.protectionOptions.formatCells)return!1;A.cmd=h;var k=A.selections||R.getSelections(),N=(O=A.activeRowIndex)!==null&&O!==void 0?O:R.getActiveRowIndex(),B=(I=A.activeColIndex)!==null&&I!==void 0?I:R.getActiveColumnIndex();if(k.length>0){var F=u.Util.getActiveCellStyle(R,N,B).font,j=!1;if(F){var K=u.Util.parseFont(F).fontWeight;K!=="normal"&&(j=!0)}return A.boldState=j,A.handler=function(Q){var X=this._options.boldState,ne;if(Q.row===-1||Q.col===-1){if(Q.row===-1&&Q.col===-1)for(var ce=0;ce<R.getColumnCount();ce++){var fe=R.getStyle(-1,ce);fe&&(fe.fontWeight=void 0,R.setStyle(-1,ce,fe))}var J=R.getUsedRange(d.Spread.Sheets.UsedRangeType.style);if(J){var V=new d.Spread.Sheets.Range(Q.row,Q.col,Q.rowCount,Q.colCount),Z=J.getIntersect(V,Q.sheet.getRowCount(),Q.sheet.getColumnCount());Z&&(ne=R.getRange(Z.row,Z.col,Z.rowCount,Z.colCount))}}var Y=X?x:y;if(Q.fontWeight)Q.fontWeight(Y),ne&&ne.fontWeight&&ne.fontWeight(Y);else for(var W=Q.row;W<Q.row+Q.rowCount;W++)for(var ce=Q.col;ce<Q.col+Q.colCount;ce++){var H=R.getActualStyle(W,ce),$=H.font;$=this.getFontStyle($,S,Y),H.font=$,R.setStyle(W,ce,H)}},(0,c.executeCommand)(P,M,A,E)}return!1}},c.Commands[g]={canUndo:!0,execute:function(P,A,E){var O,I,R=u.Util.getSheet(P,A);if(R&&u.Util.needCheckProtectionOptions(R)&&!R.options.protectionOptions.formatCells)return!1;A.cmd=g;var k=A.selections||R.getSelections(),N=(O=A.activeRowIndex)!==null&&O!==void 0?O:R.getActiveRowIndex(),B=(I=A.activeColIndex)!==null&&I!==void 0?I:R.getActiveColumnIndex();if(k.length>0){var F=u.Util.getActiveCellStyle(R,N,B),j=F&&F.font,K=!1;if(j){var Q=u.Util.parseFont(j).fontStyle;Q.indexOf(L)!==-1&&(K=!0)}return A.italicizeState=K,A.handler=function(X){var ne=this._options.italicizeState,ce;if(X.row===-1||X.col===-1){if(X.row===-1&&X.col===-1)for(var fe=0;fe<R.getColumnCount();fe++){var J=R.getStyle(-1,fe);J&&(J.fontStyle=void 0,R.setStyle(-1,fe,J))}var V=R.getUsedRange(d.Spread.Sheets.UsedRangeType.style);if(V){var Z=new d.Spread.Sheets.Range(X.row,X.col,X.rowCount,X.colCount),Y=V.getIntersect(Z,X.sheet.getRowCount(),X.sheet.getColumnCount());Y&&(ce=R.getRange(Y.row,Y.col,Y.rowCount,Y.colCount))}}var W=ne?x:L;if(X.fontStyle)X.fontStyle(W),ce&&ce.fontStyle&&ce.fontStyle(W);else for(var H=X.row;H<X.row+X.rowCount;H++)for(var fe=X.col;fe<X.col+X.colCount;fe++){var $=R.getActualStyle(H,fe),ee=$.font;ee=this.getFontStyle(ee,v,W),$.font=ee,R.setStyle(H,fe,$)}},(0,c.executeCommand)(P,M,A,E)}return!1}},c.Commands[f]={canUndo:!0,execute:function(P,A,E){var O,I,R=u.Util.getSheet(P,A);if(R&&u.Util.needCheckProtectionOptions(R)&&!R.options.protectionOptions.formatCells)return!1;A.cmd=f;var k=A.selections||R.getSelections(),N=(O=A.activeRowIndex)!==null&&O!==void 0?O:R.getActiveRowIndex(),B=(I=A.activeColIndex)!==null&&I!==void 0?I:R.getActiveColumnIndex();if(k.length>0){var F=u.Util.getActiveCellStyle(R,N,B),j=F&&F.textDecoration,K=d.Spread.Sheets.TextDecorationType;return j?A.underlineType=K.none:A.underlineType=K.underline,A.handler=function(Q){var X=this._options.underlineType,ne;if(Q.row===-1||Q.col===-1){var ce=R.getUsedRange(d.Spread.Sheets.UsedRangeType.style);if(ce){var fe=new d.Spread.Sheets.Range(Q.row,Q.col,Q.rowCount,Q.colCount),J=ce.getIntersect(fe,Q.sheet.getRowCount(),Q.sheet.getColumnCount());J&&(ne=R.getRange(J.row,J.col,J.rowCount,J.colCount))}}Q.textDecoration(X),ne&&ne.textDecoration&&ne.textDecoration(X)},(0,c.executeCommand)(P,M,A,E)}return!1}},c.Commands[b]={canUndo:!0,execute:function(P,A,E){var O=u.Util.getSheet(P,A);if(O&&u.Util.needCheckProtectionOptions(O)&&!O.options.protectionOptions.formatCells)return!1;A.cmd=b;var I=A.selections||O.getSelections();return I.length?(A.handler=function(R){R.formatter("0%")},(0,c.executeCommand)(P,M,A,E)):!1}};function D(P){var A=u.Util._isMacOS(),E=!A,O=A;P.register(h,c.Commands[h],66,E,!1,!1,O),P.register(g,c.Commands[g],73,E,!1,!1,O),P.register(f,c.Commands[f],85,E,!1,!1,O),P.register(b,c.Commands[b],53,!0,!0,!1,!1)}r.initShortcutAboutStyle=D}),"sjs-spread-sheets":(function(a){a.exports=GC})},t={};function i(a){var r=t[a];if(r!==void 0)return r.exports;var o=t[a]={exports:{}};return e[a].call(o.exports,o,o.exports,i),o.exports}var n={};(function(){var a=n;/*!**********************!*\
|
|
348
348
|
!*** ./src/entry.ts ***!
|
|
349
349
|
\**********************/Object.defineProperty(a,"__esModule",{value:!0}),a.addSpreadShortcut=void 0;var r=i("./src/shortcut/action.calc.ts"),o=i("./src/shortcut/action.cell.ts"),l=i("./src/shortcut/action.row.column.ts"),c=i("./src/shortcut/action.selection.ts"),d=i("./src/shortcut/action.style.ts");function u(h){var g=h.commandManager();g&&((0,l.initShortcutAboutRowsAndColumns)(g),(0,c.initShortcutAboutSelection)(g),(0,r.initShortcutAboutCalc)(g),(0,o.initShortcutAboutCell)(g),(0,d.initShortcutAboutStyle)(g))}a.addSpreadShortcut=u})(),BR=n})(),ple.addSpreadShortcut=BR.addSpreadShortcut;const FR=(In.exports==null?{}:In.exports).default||In.exports,mle=(In.exports==null?{}:In.exports).Util,gle=(In.exports==null?{}:In.exports).Commands,fle=(In.exports==null?{}:In.exports).ShortcutActionBase,ble=(In.exports==null?{}:In.exports).executeCommand,Sle=(In.exports==null?{}:In.exports).initShortcutAboutCalc,Cle=(In.exports==null?{}:In.exports).initShortcutAboutCell,yle=(In.exports==null?{}:In.exports).initShortcutAboutRowsAndColumns,vle=(In.exports==null?{}:In.exports).initShortcutAboutSelection,xle=(In.exports==null?{}:In.exports).initShortcutAboutStyle,Lle=(In.exports==null?{}:In.exports).addSpreadShortcut,Tle=Object.freeze(Object.defineProperty({__proto__:null,Commands:gle,ShortcutActionBase:fle,Util:mle,addSpreadShortcut:Lle,default:FR,executeCommand:ble,initShortcutAboutCalc:Sle,initShortcutAboutCell:Cle,initShortcutAboutRowsAndColumns:yle,initShortcutAboutSelection:vle,initShortcutAboutStyle:xle},Symbol.toStringTag,{value:"Module"})),Sm="separator",wle="FieldName",Dle="SortType";class Ale extends GC.Spread.Sheets.ContextMenu.ContextMenu{constructor(t,i,n,a){super(),this.context=t,this.evalContext=n,this.update=a,this.commandMap={},i.forEach(r=>{r.commandName&&(this.commandMap[r.commandName]=r)})}onOpenMenu(t,i,n,a){var y,v;Ll(this.context);let r=[].concat(JSON.parse(JSON.stringify(t)));if(this.context.getData(m.hideContextMenu)||this.context.getData("dispose"))return!1;let o=n.worksheetHitInfo;if(o&&o.commentHitInfo)return!1;let l=GR(o),c=o&&n.worksheetHitInfo.shapeHitInfo&&n.worksheetHitInfo.shapeHitInfo.shape.drawingType==="Slicer",d=o&&n.worksheetHitInfo.shapeHitInfo&&n.worksheetHitInfo.shapeHitInfo.shape.drawingType==="Timeline",u=this.context.getData(m.pictureSelected)&&!n.tabStripHitInfo,h=this.context.getData(m.FloatingObjectSelected)&&!n.tabStripHitInfo,g=n.tabStripHitInfo&&n.tabStripHitInfo.sheetTab&&n.tabStripHitInfo.sheetTab.sheetType===2;if(o&&(o.row===void 0||o.col===void 0)||n.tabStripHitInfo&&n.tabStripHitInfo.blank||n.tabStripHitInfo&&n.tabStripHitInfo.resize||n.tabStripHitInfo&&n.tabStripHitInfo.sheetTab&&n.tabStripHitInfo.sheetTab.sheetName==="newSheet"&&n.tabStripHitInfo.sheetTab.sheetIndex===-1||n.tabStripHitInfo&&n.tabStripHitInfo.sheetTab&&n.tabStripHitInfo.sheetTab.sheetName==="allSheets"&&n.tabStripHitInfo.sheetTab.sheetIndex===-1||n.tabStripHitInfo&&n.tabStripHitInfo.navButton||g||u||h)return this.context.setData(m.hideContextMenu,!0),!1;this.context.setData(m.hideContextMenu,!1),this.update&&this.update();const f=o==null?void 0:o.dataRange,b=this.context.Spread.getActiveSheet();let S=o;if(f){const x=f.convertContext({sheet:b,row:o.row,col:o.col,sheetArea:o.hitTestType});if(x&&x.sheet!==b&&(S.row=x.row,S.col=x.col,S.hitTestType=x.sheetArea,S.sheet=x.sheet),(y=f==null?void 0:f.dataProvider)!=null&&y.getSource){const L=f==null?void 0:f.dataProvider.getSource();C._isTableSheet(L)&&this.context.setData(m.TableSheetActive,!0)}}try{i.length=0;let x=this.context.getData(m.TableSheetActive),L=this.context.getData(m.GanttSheetActive),T=this.context.getData(m.ReportSheetIsPreviewMode);if(x&&!L){if(n.tabStripHitInfo)this.context.setData(m.TableSheetTabStripSelected,!0);else if(S){let M;(v=f==null?void 0:f.dataProvider)!=null&&v.getSource?M=f==null?void 0:f.dataProvider.getSource():M=this.context.Spread.getActiveSheetTab();let D=C._isTableSheet(M);switch(S.hitTestType){case GC.Spread.Sheets.SheetArea.corner:this.context.setData(m.TableSheetClickCorner,!0);break;case GC.Spread.Sheets.SheetArea.colHeader:if(M&&D){let P=M.applyFreeHeaderArea(),A=P&&P.rowCount||0,E=(S.row||0)<A;if(this.context.setData(m.TableSheetClickColHeader,!E),this.context.setData(m.TableSheetPinColumnsDisable,!M.enablePinColumn()),this.context.setData(m.TableSheetDefineColumnDisable,M.isDisableDefineColumn(S.col)),M.isShowHierarchyOutlineColumn()){let I=M.options.menuItemVisibility;if(this.context.setData(m.TableSheetExpandAllLevelMenuItemVisible,I.expandAllLevelMenuItemVisible),this.context.setData(m.TableSheetCollapseAllLevelMenuItemVisible,I.collapseAllLevelMenuItemVisible),I.expandToLevelMenuItemVisible){let R=9,k=M.getHierarchyMaxLevel()+1;k=Math.min(R,k);let N=m.TableSheetExpandLevelMenuItemVisible1.slice(0,-1);for(let B=1;B<=k;B++)this.context.setData(N+B,!0)}}}break;case GC.Spread.Sheets.SheetArea.rowHeader:if(this.context.setData(m.TableSheetClickRowHeader,!0),M&&D){this.context.setData(m.TableSheetPinRowsDisable,!M.enablePinRow());let P=M.isShowHierarchyOutlineColumn();if(P){let A=M.options.menuItemVisibility;this.context.setData(m.TableSheetPromoteMenuItemVisible,A.promoteMenuItemVisible),this.context.setData(m.TableSheetDemoteMenuItemVisible,A.demoteMenuItemVisible),P=M.hasHierarchyRowOrder(),P&&(this.context.setData(m.TableSheetMoveUpMenuItemVisible,A.moveUpMenuItemVisible),this.context.setData(m.TableSheetMoveDownMenuItemVisible,A.moveDownMenuItemVisible),this.context.setData(m.TableSheetAddBeforeMenuItemVisible,A.addBeforeMenuItemVisible),this.context.setData(m.TableSheetAddAfterMenuItemVisible,A.addAfterMenuItemVisible),this.context.setData(m.TableSheetAddAboveMenuItemVisible,A.addAboveMenuItemVisible),this.context.setData(m.TableSheetAddBelowMenuItemVisible,A.addBelowMenuItemVisible))}}break;case GC.Spread.Sheets.SheetArea.viewport:this.context.setData(m.TableSheetClickViewport,!0);break}}}else if(L)n.tabStripHitInfo&&this.context.setData(m.TableSheetTabStripSelected,!0),Mle(this.context,n);else if(n.tabStripHitInfo)this.context.setData(m.TabStripSelected,!0),this.context.setData(m.CanShowChartContextMenu,!1),this.context.setData(m.ShapeSelected,!1),this.context.setData(m.SlicerSelected,!1),this.context.setData(m.TimelineSelected,!1);else if(l&&GC.Spread.Sheets.Charts){if(T)return!1;this.context.setData(m.CanShowChartContextMenu,!0),this.context.setData(m.ShapeSelected,pe.isShapeBasedCharts()),this.context.setData(m.SlicerSelected,!1),this.context.setData(m.TimelineSelected,!1)}else if(n.worksheetHitInfo&&n.worksheetHitInfo.shapeHitInfo&&!(c||d))i.length=0,this.context.setData(m.ShapeSelected,!0),this.context.setData(m.CanShowChartContextMenu,!1),this.context.setData(m.SlicerSelected,!1),this.context.setData(m.TimelineSelected,!1);else if(c)this.context.setData(m.SlicerSelected,!0),this.context.setData(m.CanShowChartContextMenu,!1),this.context.setData(m.TimelineSelected,!1);else if(d)this.context.setData(m.SlicerSelected,!0),this.context.setData(m.TimelineSelected,!0),this.context.setData(m.CanShowChartContextMenu,!1);else if(n.worksheetHitInfo){switch(n.worksheetHitInfo.hitTestType){case GC.Spread.Sheets.SheetArea.corner:this.context.setData(m.ClickCorner,!0);break;case GC.Spread.Sheets.SheetArea.colHeader:this.context.setData(m.ClickColHeader,!0);break;case GC.Spread.Sheets.SheetArea.rowHeader:this.context.setData(m.ClickRowHeader,!0);break;case GC.Spread.Sheets.SheetArea.viewport:this.context.setData(m.ClickViewport,!0);break}let M=!1;b&&(M=b.getSelections().reduce((P,A)=>{const E=b.dataRanges.getByRange(A.row,A.col,A.rowCount,A.colCount);return P||!!E&&E.length>0},!1)),this.context.setData(m.SelectionsHasDataRange,M),this.context.setData(m.DataRangeSelected,!!n.worksheetHitInfo.dataRange)}this._updateTemplateSheet();const w=this.context.getData(m.InViewMode);r.forEach(M=>{if(!M.name)i.push(M);else{let D=this.commandMap[M.name]||this.commandMap[M.command],P=!0;if(this._changePivotItemInfo(o,M),(D.visibleContext&&typeof this.evalContext=="function"&&!this.evalContext(D.visibleContext)&&D.commandName||w&&(typeof this.evalContext!="function"||!D.viewModeVisibleContext||!this.evalContext(D.viewModeVisibleContext)))&&(P=!1),P){if(P=this._changePivotItemInfo(o,M),!P)return;if(i.push(M),D.subCommands&&D.subCommands.length>0){D.execute&&D.execute(this.context);let A=[];M.subMenu&&M.subMenu.forEach((E,O)=>{if(D.subCommands&&M.subMenu){let I=D.subCommands[O],R=M.subMenu[O],k=I.visibleContext,N=I.enableContext;this._changePivotItemInfo(o,E),C.isNullOrUndefined(k)?A.push(R):typeof this.evalContext=="function"&&this.evalContext(k)?(A.push(R),delete R.type):R.type="separator",N&&(typeof this.evalContext=="function"&&!this.evalContext(N)&&R?R.disable=!0:R&&delete R.disable)}}),M.subMenu=A}if(D.enableContext){let A=typeof this.evalContext=="function"&&this.evalContext(D.enableContext);M.disable=!A}this.handlerCheckBoxItem(D,M),D.keepFocusOnContextMenuClosed===!0&&(M.needKeepFocus=!0)}}})}finally{this.context.setData(m.TabStripSelected,!1),this.context.setData(m.TableSheetTabStripSelected,!1),this.context.setData(m.ShapeSelected,!1),this.context.setData(m.SlicerSelected,!1),this.context.setData(m.TimelineSelected,!1),this.context.setData(m.CanShowChartContextMenu,!1),this.context.setData(m.ChartAltTextPanelVisible,!1),this.context.setData(m.PictureAltTextPanelVisible,!1),this.context.setData(m.ShapeAltTextPanelVisible,!1),this.context.setData(m.ClickCorner,!1),this.context.setData(m.ClickColHeader,!1),this.context.setData(m.ClickRowHeader,!1),this.context.setData(m.ClickViewport,!1),this.context.setData(m.TableSheetClickCorner,!1),this.context.setData(m.TableSheetClickColHeader,!1),this.context.setData(m.TableSheetClickRowHeader,!1),this.context.setData(m.TableSheetClickViewport,!1),kle(this.context),this.context.setData(m.TableSheetDefineColumnDisable,!1),this.context.setData(m.TableSheetPinColumnsDisable,!1),this.context.setData(m.TableSheetPinRowsDisable,!1),this.context.setData(m.TableSheetPromoteMenuItemVisible,!1),this.context.setData(m.TableSheetDemoteMenuItemVisible,!1),this.context.setData(m.TableSheetMoveUpMenuItemVisible,!1),this.context.setData(m.TableSheetMoveDownMenuItemVisible,!1),this.context.setData(m.TableSheetAddBeforeMenuItemVisible,!1),this.context.setData(m.TableSheetAddAfterMenuItemVisible,!1),this.context.setData(m.TableSheetAddAboveMenuItemVisible,!1),this.context.setData(m.TableSheetAddBelowMenuItemVisible,!1),this.context.setData(m.TableSheetExpandAllLevelMenuItemVisible,!1),this.context.setData(m.TableSheetCollapseAllLevelMenuItemVisible,!1),this.context.setData(m.TableSheetExpandLevelMenuItemVisible1,!1),this.context.setData(m.TableSheetExpandLevelMenuItemVisible2,!1),this.context.setData(m.TableSheetExpandLevelMenuItemVisible3,!1),this.context.setData(m.TableSheetExpandLevelMenuItemVisible4,!1),this.context.setData(m.TableSheetExpandLevelMenuItemVisible5,!1),this.context.setData(m.TableSheetExpandLevelMenuItemVisible6,!1),this.context.setData(m.TableSheetExpandLevelMenuItemVisible7,!1),this.context.setData(m.TableSheetExpandLevelMenuItemVisible8,!1),this.context.setData(m.TableSheetExpandLevelMenuItemVisible9,!1),Ll(this.context)}return this.supportChartFormatType(n,i),this.trimNullObject(i),this.trimSeparatorLine(i),!1}onMenuOpened(){this.context.setData(m.hideContextMenu,!1)}_updateTemplateSheet(){let t=this.context,i=t.Spread.getActiveSheetTab();if(t.setData(m.TemplateSheetCancelRepeatHeader,""),C._isReportSheet(i)&&i.renderMode()==="Design"){let n=i.getSheet(),a=n.getPaginationSetting(),r=n.getSelections()[0];if(r){let{row:o,col:l,rowCount:c,colCount:d}=r;if(a){let{titleRow:u,endRow:h,titleCol:g,endCol:f}=a;if(t.getData(m.ClickColHeader)){if(g&&g.start===l&&g.end===l+d-1||f&&f.start===l&&f.end===l+d-1){t.setData(m.TemplateSheetCancelRepeatHeader,"col");return}}else if(t.getData(m.ClickRowHeader)&&(u&&u.start===o&&u.end===o+c-1||h&&h.start===o&&h.end===o+c-1)){t.setData(m.TemplateSheetCancelRepeatHeader,"row");return}}}}}_changePivotItemInfo(t,i){var a;let n=t&&t.pivotTableCellInfo;if(n){let{area:r,value:o,menuArea:l,colHeadFieldInfo:c,cornerFieldInfo:d,activeRowFieldInfo:u,activeColFieldInfo:h,valueFieldName:g}=n,f=t.pivotTableInfo;if(i.commandOptions){let{placeholder:b,showValueAsType:S,subTotalType:y}=i.commandOptions;if(f&&g!==void 0&&(S!==void 0&&(f.showDataAs(g)&&f.showDataAs(g).showDataAs||0)===S&&(i.iconClass="gc-spread-pivot-selected"),y!==void 0&&f.subTotalType(g)===y&&(i.iconClass="gc-spread-pivot-selected")),b&&b===wle){let v;if(l===0?v=n.pageFieldInfo.fieldName:r===2&&l===2?c?v=c.fieldName:v=h&&h.name:r===3&&l===2?v=u&&u.name:r===1?l===1?v=n.value:l===2&&d&&(v=d.fieldName):l===4&&(v=n.valueFieldName,r===2?v=h&&h.name||o:r===3&&(v=u&&u.name||o)),v===void 0)return!1;if(i.text=i.text.replace("{0}",'"'+v+'"'),i.name==="pivotShowSubtotal"){if(v===s.contextMenu.sigmaValueTemp||((a=f.getField(v))==null?void 0:a.pivotArea)===3||r===0)return!1;f.subtotalVisible(v)&&(i.iconClass="gc-spread-pivotShowSubtotal")}}else if(b&&b===Dle&&l===4){let v,x=i.commandOptions.subType;x===0?v=s.contextMenu.pivotTableSortAscend:x===1&&(v=s.contextMenu.pivotTableSortDescend),i.text=v}}if(i.name==="createDialogForLabelFilter"){let b=u&&u.name||h&&h.name||c&&c.fieldName||d&&d.fieldName;b&&f.getField(b)&&f.getField(b).dataType===2&&(i.text=s.contextMenu.pivotTableLabelFilters_Date)}}return!0}supportChartFormatType(t,i){let n=t.worksheetHitInfo;if(n&&GC.Spread.Sheets.Charts){let a=GR(n);if(a instanceof GC.Spread.Sheets.Charts.Chart){let r=a.hitTest(t.x,t.y);r&&i.forEach(o=>{o.type==="chartFormat"&&(o.text=s.contextMenu.formatChart[Ile[r.elementType]],o.options=r)})}}}trimNullObject(t){let i=this,n,a=t.length;for(n=a-1;n>0;n--){let r=t[n].subMenu;t[n]?r&&i.trimNullObject(r):t.splice(n,1)}return t}trimSeparatorLine(t){let i=[],n=t.length;for(let c=0;c<n;c++)t[c]&&t[c].type===Sm&&t[c+1]&&t[c+1].type===Sm||i.push(t[c]);n=i.length;let a=0,r=0,o=!0,l=!0;for(let c=0;c<n&&(o&&i[c].type===Sm?a++:o=!1,l&&i[n-1-c].type===Sm?r++:l=!1,!(!o&&!l));c++);i.splice(n-r,r),i.splice(0,a),t.splice(0,t.length);for(let c=0;c<i.length;c++)if(i[c].name===Sm){let d=Object.assign({},i[c]);delete d.name,t.push(d)}else t.push(i[c]);return t}handlerCheckBoxItem(t,i){if(t.type==="checkbox"){const n=t.getState?t.getState(this.context):!1;i.iconClass=n?t.iconClass+" gc-ui-contextmenu-selected-item":t.iconClass}}dispose(){delete this.update,delete this.evalContext,this.context=void 0}}class Ple extends GC.Spread.Sheets.ContextMenu.MenuView{constructor(t,i,n){super(),this._spread=t,this.commands=i,this.callBack=n}createMenuItemElement(t){let i=this;if(t.type==="colorPickerContainer"){let n=GC.Spread.Sheets.ContextMenu.MenuView.prototype.createMenuItemElement.call(i,t),a=n[0];a.innerHTML="";let r=new Sl(a,{type:"ColorPicker",showNoColor:!0,showMoreColor:!0,isThemeColor:!0},this._spread);return r.RenderAll(),r.on(Sl.ValueChanged,o=>{let l=this.commands&&this.commands.find(c=>c.commandName===t.menuContent);l&&this.callBack&&this.callBack(l,o)}),a.classList.add("gc-tabColor-container"),n}return super.createMenuItemElement(t)}getCommandOptions(t,i){if(t.type==="chartFormat")return t.options}dispose(){delete this.commands,delete this.callBack,delete this._spread}}const Ile=["series","axis","dataPoint","legend","dataLabels","chartTitle",void 0,"chartArea","chartArea","errorBar","trendline","unitsLabel"];function Mle(e,t){if(!t.worksheetHitInfo)return;const i=e.Spread.getActiveSheetTab(),n=t.worksheetHitInfo,a=n.hitTestType,r={x:n.x,y:n.y,row:n.row,col:n.col,sheet:i.getSheet(),cellRect:n.cellTypeHitInfo?n.cellTypeHitInfo.cellRect:void 0};if(a===GC.Spread.Sheets.SheetArea.rowHeader){e.setData(m.GanttSheetClickRowHeader,!0);return}const o=r.col===i.getGanttColumnIndex();if(a===GC.Spread.Sheets.SheetArea.colHeader){o?e.setData(m.GanttSheetClickTimescale,!0):e.setData(m.GanttSheetClickColHeader,!0);return}if(a===GC.Spread.Sheets.SheetArea.viewport)if(o)e.setData(m.GanttSheetClickBarColumn,!0);else{e.setData(m.GanttSheetClickFields,!0);return}}function kle(e){e.setData(m.GanttSheetClickRowHeader,!1),e.setData(m.GanttSheetClickColHeader,!1),e.setData(m.GanttSheetClickFields,!1),e.setData(m.GanttSheetClickTimescale,!1),e.setData(m.GanttSheetClickBarColumn,!1),e.setData(m.GanttSheetClickBar,!1)}function GR(e){if(!e)return;let t=e.shapeHitInfo;if(t){let n=t.shape;if(pe.isChart(n))return n}let i=e.floatingObjectHitInfo;if(i){let n=i.floatingObject;if(pe.isChart(n))return n}}let Rle=(FR||Tle).addSpreadShortcut;const di=".GC_Designer_Imp_Events";class qx{constructor(t,i,n){this.id=nx(),this._designer=t,this._spread=i,this._spread&&(this._spread._designer=t),this._spreadOptions=n}onInit(t){var a,r;const i=this._designer,n=this._spread?this._spread.getHost():t;n.removeAttribute("style"),n.classList.add("spreadWrapper"),n.classList.add("ss"),n.style.height="100%",n.style.width="unset",this._host=n,this._spread?((r=t.parentNode)==null||r.replaceChild(this._spread.getHost(),t),this._spreadOptions&&this._spread&&Object.getOwnPropertyNames(this._spread.options).forEach(o=>{var l;(l=this._spreadOptions)!=null&&l.hasOwnProperty(o)&&(this._spread.options[o]=this._spreadOptions[o])})):(this._spread=new GC.Spread.Sheets.Workbook(t,(a=this._spreadOptions)!=null?a:i.getData(m.WorkbookDefaultOptions)),this._spread._designer=i),Ele(i,this._spread),kt.queueMacroTask(()=>{var o;(o=this.Spread)==null||o.focus(!0)}),HR(i,this._spread),Gle(this._spread),Tse(i,this._spread)}onDestroy(){var t,i,n,a,r;this.Spread&&this.Spread.contextMenu&&this.Spread.contextMenu.dispose&&(this.Spread.contextMenu.menuView.dispose(),this.Spread.contextMenu.dispose()),(t=this._spread)==null||t.unbind(di),(n=(i=this._spread)==null?void 0:i.dataManager())==null||n.unbind(di),u0(this._designer,this._spread),Nle(this.Spread),(a=this._spread)==null||delete a._designer,(r=this._spread)==null||r.destroy(),this._spread=void 0,this._designer=void 0}onRefresh(){this._spread&&(this._spread.suspendPaint(),this._spread.suspendEvent(),this._spread.refresh(),this._spread.getTab().scrollTabToActive(0,this._spread.getActiveSheetOrSheetTabIndex()),this._spread.resumeEvent(),this._spread.resumePaint())}get Spread(){return this._spread}onCommandResolved(){const t=this.Spread;t&&t.getActiveSheetOrSheetTab()&&t.focus(!0)}getContext(){return this._designer}getHost(){return this._host}}class VR{constructor(t,i,n,a){this._spreadContexts=[],this._onSetConfig=!1,this._divList=[],this._designer=t;const r=Math.max(1,i);for(let o=0;o<r;o++){const l=new qx(t,n&&n[o],a);this._spreadContexts.push(l),o===0&&(this._primarySpreadContext=l)}}get Spread(){var i,n;let t=(i=this._spreadContexts.find(a=>a.id===this._activeSpreadId))==null?void 0:i.Spread;if(t){if(!t.isFocus()){let a=this._spreadContexts.find(r=>{var o;return(o=r.Spread)==null?void 0:o.isFocus()});if(a){this._activeSpreadId=a.id;let r=this._designer._designerContext.useSpread()[1];r(a.Spread),Ll(this._designer)}else return t;return a==null?void 0:a.Spread}return t}return(n=this._spreadContexts[0])==null?void 0:n.Spread}get PrimarySpread(){var t,i;return(t=this._primarySpreadContext)!=null&&t.Spread?this._primarySpreadContext.Spread:(i=this._spreadContexts[0])==null?void 0:i.Spread}registerSpreadContext(t,i){const n=i!=null?i:this._spreadContexts.length;this._spreadContexts.splice(n,0,t),(this._spreadContexts.length===1||!this._primarySpreadContext||n===0)&&(this._primarySpreadContext=t)}removeSpreadContext(t,i=!1){let n=this._spreadContexts.find(a=>a.Spread===t);if(n)return n===this._primarySpreadContext&&!i?void 0:(this._spreadContexts=this._spreadContexts.filter(a=>a.Spread!==t),n===this._primarySpreadContext&&(this._primarySpreadContext=this._spreadContexts[0]),n)}getContext(){return this._designer}onDestroy(){this._onSetConfig||(this._spreadContexts.forEach(t=>{t.onDestroy()}),this._designer=null)}onInit(t){var r;let i=this._designer;if(this._host=t,this._onSetConfig){this._spreadContexts.forEach(o=>{HR(i,o.Spread)});return}let n=[];for(let o=0;o<this._spreadContexts.length;o++){let l=document.createElement("div");t.appendChild(l),n.push(l)}this._divList=n,this._spreadContexts.forEach((o,l)=>{var d;const c=(d=o.Spread)==null?void 0:d.getHost();o.onInit(n[l]),c&&(n[l]=c)}),this._activeSpreadId=(r=this._spreadContexts[0])==null?void 0:r.id;let a=this._designer._designerContext.useSpread()[1];a(this._spreadContexts[0].Spread),Ll(i),setTimeout(()=>{this.onRefresh()})}onRefresh(){this._spreadContexts.forEach(t=>{this._host&&t.Spread&&t.onRefresh()})}onCommandResolved(){var i;const t=this.Spread;t&&t.getActiveSheetOrSheetTab()&&t.focus(!0),this._designer&&(this._designer.setData(m.AfterCommandExecute,!0),(i=this._designer._getGlobalEvent())==null||i.fire(jt.DesignerCommandExecuted))}endSetConfig(){this._onSetConfig=!1,this._divList.forEach(t=>{var i;(i=this._host)==null||i.appendChild(t)}),this.onRefresh()}startSetConfig(){this._onSetConfig=!0}getSpreadContextsIndexBySpread(t){return this._spreadContexts.findIndex(i=>i.Spread===t)}get Host(){return this._host}getHost(){return this._host}_clear(){this._spreadContexts=[],this._divList=[]}}let Td;const _le=(e,t,i)=>{fte(e,t)&&i()};let Bb;const Ole=async(e,t,i)=>{gte(e,t)&&(await C.sleep(100),i())};function Ele(e,t){const i=()=>{e._refresh(!0)};t.bind(GC.Spread.Sheets.Events.EnterCell+di,(r,o)=>{an(GC.Spread.Sheets.Events.EnterCell,e),i();let l=t.getActiveSheet();if(l){let c=l.tables.find(o.row,o.col);if(c){let d=e.getData(re.tableFooterCommands);p_(c,d)}Ae.attachPivotPanel(e)}}),t.bind("DrawingElementZIndexChanged"+di,i),t.bind(GC.Spread.Sheets.Events.ShapeChanged+di,(r,o)=>{let l=o.shape;if(l&&l instanceof GC.Spread.Sheets.Shapes.ShapeBase){let c=o.propertyName;(c==="isSelected"||c==="rotate"||c==="style"||c==="src"||c==="width"||c==="height"||e.getData(m.SelectionPane))&&i()}an(GC.Spread.Sheets.Events.ShapeChanged,e)}),t.bind(GC.Spread.Sheets.Events.ShapeSelectionChanged+di,(r,o)=>{an(GC.Spread.Sheets.Events.ShapeSelectionChanged,e),i()}),t.bind(GC.Spread.Sheets.Events.FloatingObjectChanged+di,(r,o)=>{let l=o.floatingObject;l&&l instanceof GC.Spread.Sheets.Charts.Chart&&(o.propertyName==="isSelected"&&i(),(o.propertyName==="height"||o.propertyName==="width")&&i())}),t.bind(GC.Spread.Sheets.Events.SlicerChanged+di,(r,o)=>{let{slicer:l,propertyName:c}=o;(c==="isSelected"||c==="width"||c==="height")&&(c==="isSelected"&&(GC.Spread.Pivot&&l instanceof GC.Spread.Pivot.PivotTableTimelineSlicer?e.setData(re.selectedTimeline,l.isSelected()?l:null):e.setData(re.selectedSlicer,l.isSelected()?l:null)),i())}),t.bind(GC.Spread.Sheets.Events.FloatingObjectRemoved+di,(r,o)=>{o.floatingObject instanceof GC.Spread.Sheets.Charts.Chart&&i()}),t.bind(GC.Spread.Sheets.Events.ShapeRemoved+di,i),t.bind(GC.Spread.Sheets.Events.SheetChanged+di,(r,o)=>{const l=e.getData(re.hasSortHeaderRowMap);l&&o.propertyName==="deleteSheet"&&l[o.sheetName]&&delete l[o.sheetName],an(GC.Spread.Sheets.Events.SheetChanged,e)}),t.bind(GC.Spread.Sheets.Events.ActiveSheetChanged+di,()=>{Ll(e),i()}),t.bind(GC.Spread.Sheets.Events.SheetNameChanged+di,(r,o)=>{const l=e.getData(re.hasSortHeaderRowMap);l&&!C.isNullOrUndefined(l[o.oldValue])&&(l[o.newValue]=l[o.oldValue],delete l[o.oldValue]),an(GC.Spread.Sheets.Events.SheetChanged,e)}),t.bind(GC.Spread.Sheets.Events.RangeChanged+di,(r,o)=>{an(GC.Spread.Sheets.Events.RangeChanged,e)}),t.bind(GC.Spread.Sheets.Events.SelectionChanged+di,()=>{an(GC.Spread.Sheets.Events.SelectionChanged,e),i()}),t.bind(GC.Spread.Sheets.Events.ChartClicked+di,i),t.bind(GC.Spread.Sheets.Events.ColumnWidthChanged+di,()=>{}),t.bind(GC.Spread.Sheets.Events.RowHeightChanged+di,()=>{}),t.bind(GC.Spread.Sheets.Events.LeftColumnChanged+di,()=>{}),t.bind(GC.Spread.Sheets.Events.TopRowChanged+di,()=>{}),t.bind(GC.Spread.Sheets.Events.ViewZoomed+di,()=>{}),t.bind(_t.SheetOptionsChangedInternal+di,()=>{an(_t.SheetOptionsChangedInternal,e)}),t.bind(_t.SheetBackgroundChangedInternal+di,()=>{an(_t.SheetBackgroundChangedInternal,e)}),t.bind(_t.WorksheetDataChanged+di,C.debounce(()=>{!e._disposed&&an(_t.WorksheetDataChanged,e),i()},0)),t.bind(_t.ActiveSheetChangedInternal+di,()=>{Ll(e)}),t.bind(_t.EnterCellInternal+di,()=>{an(_t.EnterCellInternal,e),i()}),t.bind(_t.PivotTableAdded+di,()=>{an(_t.PivotTableAdded,e)}),t.bind(GC.Spread.Sheets.Events.ShapeRemoved+di,()=>{an(GC.Spread.Sheets.Events.ShapeRemoved,e)}),t.bind(GC.Spread.Sheets.Events.ActiveSheetChanged+di,(r,o)=>{t.getActiveSheet()&&Ae.attachPivotPanel(e),an(GC.Spread.Sheets.Events.ActiveSheetChanged,e)}),t.bind(GC.Spread.Sheets.Events.PivotTableChanged+di,(r,o)=>{const l=t.getActiveSheet();if(l){const c=l.pivotTables.get(o.pivotTableName);Ws(l,c),i()}an(GC.Spread.Sheets.Events.PivotTableChanged,e)}),t.bind("PivotTableFormatClick"+di,async(r,o)=>{o.handled=!0;let l=o.formatter||"General",c="General";if(l instanceof GC.Spread.Formatter.GeneralFormatter&&(l=l.formatString()),typeof l=="string"){let h=C.parseFormat(l);c=C.transToCategoryStr(h.category)}let d={numberTabOption:{cellValue:12345,formatter:l,category:{activeTab:c.toLowerCase()}},dialogOption:{activeTab:"Number",showTabList:["Number"]}},u=await e._getDialogOwner()._showDialog("formatDialogTemplate",d);o.formatter=u?u.numberTabOption.formatter:o.formatter,o.updateFormatCallBack()}),t.bind(GC.Spread.Sheets.Events.CellChanged+di,()=>{an(GC.Spread.Sheets.Events.CellChanged,e)}),t.bind(GC.Spread.Sheets.Events.EditEnded+di,()=>{an(GC.Spread.Sheets.Events.EditEnded,e)}),t.bind(GC.Spread.Sheets.Events.ActiveCellChanged+di,()=>{an(GC.Spread.Sheets.Events.ActiveCellChanged,e)}),t.bind(GC.Spread.Sheets.Events.RowChanged+di,()=>{i()}),t.bind(GC.Spread.Sheets.Events.ColumnChanged+di,()=>{i()}),t.bind(GC.Spread.Sheets.Events.ClipboardChanged+di,()=>{an(GC.Spread.Sheets.Events.ClipboardChanged,e)}),t.bind(GC.Spread.Sheets.Events.ClipboardPasted+di,()=>{an(GC.Spread.Sheets.Events.ClipboardPasted,e),i()}),t.bind(GC.Spread.Sheets.Events.FloatingObjectSelectionChanged+di,()=>{an(GC.Spread.Sheets.Events.FloatingObjectSelectionChanged,e)}),t.bind(GC.Spread.Sheets.Events.FloatingObjectChanged+di,()=>{an(GC.Spread.Sheets.Events.FloatingObjectChanged,e)}),t.bind(GC.Spread.Sheets.Events.FloatingObjectLoaded+di,()=>{an(GC.Spread.Sheets.Events.FloatingObjectLoaded,e)}),t.bind(_t.ReportSheetTemplateRangeChanged+di,()=>{an(_t.ReportSheetTemplateRangeChanged,e)}),t.bind(GC.Spread.Sheets.Events.ThreadedCommentChanged+di,()=>{an(GC.Spread.Sheets.Events.ThreadedCommentChanged,e)});const n=t.dataManager();n.bind(GC.Data.Events.TableAdded+di,()=>{an(GC.Data.Events.TableAdded,e)}),n.bind(GC.Data.Events.TableRemoved+di,()=>{an(GC.Data.Events.TableRemoved,e)});let a=t.getHost();Td=r=>{_le(r,t,i)},a.removeEventListener("click",Td),a.addEventListener("click",Td),Bb=r=>{Ole(r,t,i)},a.removeEventListener("touchstart",Bb,!0),a.addEventListener("touchstart",Bb,!0),a.removeEventListener("dblclick",Td),a.addEventListener("dblclick",Td)}function Nle(e){let t=e.getHost();t.removeEventListener("click",Td),t.removeEventListener("dblclick",Td),t.removeEventListener("touchstart",Bb,!0)}async function Fb(e,t,i,n){var a;if(i.execute){i.keepFocusInSpread!==!1&&t.focus(!1);try{e.setData(re.currentCommand,i),await i.execute.call(e,e,"",n),e.setData(m.AfterCommandExecute,!0),(a=e._getGlobalEvent())==null||a.fire(jt.DesignerCommandExecuted)}catch{}finally{e.setData(re.currentCommand,null),i.keepFocusInSpread!==!1&&t.focus(!0)}}}function Ble(e,t,i){if(!t.notWorking){let n=t.commandManager();if(!n)return;i.forEach(a=>{a.commandName&&a.execute&&n.register(a.commandName,{execute:async(r,o)=>{Fb(e,t,a,o)},metaData:a.metaData,canUndo:!1},void 0,!1,!1,!1,!1),a.dropdownList&&a.dropdownList.forEach(r=>{n.register(r.value,{metaData:a.metaData,execute:async(o,l,c)=>{Fb(e,t,a,r.value)}},void 0,!1,!1,!1,!1)}),a.subCommands&&a.subCommands.forEach(r=>{r.execute&&n.register(r.commandName,{metaData:a.metaData,execute:async(o,l,c)=>{Fb(e,t,r,r.commandName)}},void 0,!1,!1,!1,!1)})})}}function HR(e,t){const i=a=>a.map(r=>{if(typeof r=="string"){let o=e._designerCore.getCommand(r);if(o)return o.subCommands&&(o.subCommands=i(o.subCommands)),o}return r});let n=i(e._config.contextMenu||[]);Fle(e,t,n)}function Fle(e,t,i){if(i.length===0)return;let n=i.filter(a=>a.type==="tableFooter");if(n&&e.setData(re.tableFooterCommands,n),i=i.filter(a=>a.type!=="tableFooter"),!t.notWorking){let a=i&&i.map(l=>{let c={text:C.parseResourcesText(l.text),type:l.type,name:l.contextMenuCommandName||l.commandName,command:l.commandName,commandOptions:l.commandOptions,iconClass:l.iconClass,group:l.group,needKeepFocus:l.needKeepFocus,subMenu:l.subMenu,metaData:l.metaData};return l.type==="colorPicker"?c.subMenu=[{text:C.uniqueNumber().toString(),name:C.uniqueNumber().toString(),type:"colorPickerContainer",menuContent:l.commandName}]:l.subCommands&&(c.subMenu=l.subCommands.map(d=>({text:C.parseResourcesText(d.text),iconClass:d.iconClass,name:d.commandName,command:d.commandName,commandOptions:d.commandOptions,visibleContext:d.visibleContext,enableContext:d.enableContext}))),c}),r=l=>e._designerCore.evalContext(l),o=()=>{};t.contextMenu=new Ale(e,i,r,o),a&&(t.contextMenu.menuData=a),t.contextMenu.menuView=new Ple(t,i,async(l,c)=>{Fb(e,t,l,c)}),Ble(e,t,i.concat(n))}}function Gle(e){e!=null&&e.commandManager()&&(e!=null&&e.commandManager().hasOwnProperty("copyCellRight"))||Rle(e)}const zR=C.isNullOrUndefined,Vle=C.throttle,Hle="UNDEFINED",hc=".bindingPath";let Kx=1;class jR{constructor(t,i,n,a,r){this._updateTask=0,this.isRefreshingSpread=!1,this._globalEvent=new jt,this._designerContext=new vee(this._globalEvent),this._doWindowResize=Vle(()=>{this._u()},100),this._handleKeydown=o=>{var y,v,x;let l=C.isMacOS(),c=o.keyCode,d=o.key,u=o.ctrlKey,h=o.altKey,g=o.shiftKey,f=o.metaKey;const b=document.querySelector(".gc-command-palette-search-container input");if(c===70&&!h&&!g&&(l?!u&&f:u&&!f)&&((y=this.Spread)!=null&&y.isFocus())){let L={buttonType:void 0,name:"editingFind",selectValue:"find",target:null,value:"find",hasFocusElement:!1};this._allowShortCut()&&this._runRibbonCommand(L),o.preventDefault()}else if(c===27&&!h&&!g&&!u&&!f){if(!this.getData(m.CommandPaletteVisible)||!this._containerDom.contains(document.activeElement))return;if(document.activeElement!==b){this.Spread.focus(!1),b.focus();return}this.setData(m.CommandPaletteVisible,!1),this.Spread.focus(!0),o.preventDefault()}const S=(x=(v=this.getWorkbook().commandManager())==null?void 0:v.getCommand("Designer.openCommandPalette"))==null?void 0:x.shortcutKey;if(S){const{key:L,ctrl:T,shift:w,alt:M,meta:D}=Ste(S);L===(d==null?void 0:d.toLowerCase())&&w===g&&M===h&&T===u&&D===f&&document.activeElement===b&&(o.preventDefault(),this.getData(m.CommandPaletteVisible)&&(this.setData(m.CommandPaletteVisible,!1),this.Spread.focus(!0)))}},this._resetSpread=()=>{const o=this.getWorkbook(),l=this._spreadContext;let c=l.removeSpreadContext(o,!0);c&&c.onDestroy(),l._clear();const d=new qx(this);l.registerSpreadContext(d,0);const u=l.Host;u.innerHTML="",l.onInit(u),this._designerCore.setState(re.currentFilePath,""),this._designerCore.setState(re.isExcel,!1),this._designerCore.setState(re.isFileModified,!1),this._designerCore.setState(re.treeNodeFromJson,null),this._designerCore.setData(re.hasSortHeaderRowMap,void 0),this._commandInitHook(this._designerCore.getCommands()),TR(this.Spread,this),requestAnimationFrame(()=>{this._designerCore._resetRenderState()})},this.suspendUpdateState=0,this._container=bte(t),this._container.setAttribute("tabindex","-1"),this._container.classList.add("gc-designer-container"),this._container.classList.add(wn),this._containerDom=this._container,this._licenseCheck(n),this._config=Object.assign({},i||C.defaultConfig||{}),i=this._config,this._spreadOptions=Object.assign({},a),this._spreadContext=new VR(this,r!=null?r:1,n&&[n],this._spreadOptions),this._designerContext.useSpreadContext()[1](this._spreadContext),this._designerContext.useDesigner()[1](this),this._designerCore=new RI(this._container,this._config,this._spreadContext,bM(this._designerContext)),Object.values(C.buildInCommands).forEach(o=>{this._designerCore.registerCommand(o,!1)}),this._designerCore._init(),this._afterDesignerCoreInit(),this._init(),this.setData(re.spread,null),GC.Spread.Sheets.Designer.sd(this,i)}_licenseCheck(t){let i=t;i||(i=new GC.Spread.Sheets.Workbook);let n=!!GC.Spread.Pivot&&!!GC.Pivot,a=!!GC.Data&&!!GC.Spread.Sheets.TableSheet&&!!GC.Spread.Sheets.GanttSheet,r=!!GC.Spread.Report,o=!!GC.Spread.Sheets.DataCharts;if(i){let l=!n||i.ls&&i.ls.pte===0,c=!a||i.ls&&i.ls.gte===0,d=!r||i.ls&&i.ls.rpe===0,u=(!o||i.ls&&i.ls.dce===0)&&d;YD(!l,!c,!d,!u)}setTimeout(()=>{ax(this,i)}),t||i.destroy()}_init(){var i,n,a;this._attachEvent(),this._u(),this._checkSystemFont();const t={};C.getFontItems(s.ribbon.fontFamilies).forEach(r=>t[r.value]=r.text),(a=(n=(i=GC.Spread.Sheets)==null?void 0:i.Components)==null?void 0:n.FontFamilySelector)==null||a.setAvailableFontFamily(t)}_afterDesignerCoreInit(){TR(this.Spread,this),ox(this._designerCore._getDialogOwner()),this.setData(re.container,this._container),this.setData(m.DataChartEnabled,!!GC.Spread.Sheets.DataCharts),this.setData(m.ReportCellPanelVisible,!!GC.Spread.Report),this.setData(re.hasSortHeaderRowMap,void 0)}_detachGlobalEvent(){let t=this._getGlobalEvent();t&&t.offAll(!0)}_moveFocusToSpread(t){t&&t.getActiveSheetOrSheetTab()&&t.focus(!0)}async _checkSystemFont(){if(!C.getSystemFonts()){let t=0;for(;!C.getSystemFonts()&&!this._disposed;){let n=Ka.getSystemFonts();if(n&&n.length>0||(await C.sleep(500),t++,t>40))break}let i=Ka.getSystemFonts();i&&C.setSystemFonts(i)}}_allowShortCut(){return!(this.getData(m.FileMenu_show)||this._containerDom.querySelector(".ribbon-control-dropdown")||this.Spread.contextMenu.menuView.getHost()||C._hasDesignerDialog()||fM(this.Spread))}_attachEvent(){window.addEventListener("resize",this._doWindowResize),window.addEventListener("keydown",this._handleKeydown);const t=this._getGlobalEvent();t.on(jt.DesignerReset+za,this._resetSpread),t.on(jt.fileLoaded+za,()=>{this.refresh()})}_commandInitHook(t){t.forEach(i=>{i.init&&i.init(this)})}_detachEvent(){window.removeEventListener("resize",this._doWindowResize),window.removeEventListener("keydown",this._handleKeydown);let t=this.getData(re.bindingIndicatorManager);t&&t.hideDataBindingSettingIndicator(),this.Spread&&this.Spread.unbind(hc)}_u(){let t=document.querySelector(".NLT");t==null&&(t=document.createElement("span"),t.classList.add("NLT"));let i=Ka._ms[2],n=window.gc_native_app&&i&&i();if(window.gc_native_app&&n!==rs.Valid){let a="",r=s.l;switch(n){case rs.Unlicensed:a=r.n;break;case rs.Trial:let o=Ka._ms[3];o&&(a=C.format(Ka.needActive()?r.t:r.T,o()));break;case rs.Expired:a=r.e;break;case rs.Invalid:a=r.i;break}t.textContent=a,document.body.insertBefore(t,this._containerDom),this._containerDom.style.height="calc(100% - 26px)"}}async _runRibbonCommand(t){const i=t.name;let n=this._designerCore.getCommand(i);const a=!zR(t.selectValue)&&this._designerCore.getCommand(t.selectValue);if(a&&(n=a),n)try{this.Spread.focus(!1);const r=n.execute;r&&await r.call(n,this,t.selectValue,t.value)}finally{t.hasFocusElement||this._moveFocusToSpread(this.Spread),this._designerCore.refresh(!0)}}_getGlobalEvent(){return this._globalEvent}activeRibbonTab(t){return zR(t)||this._designerContext.useSelectedTabContext()[1](t),this._designerContext.useActiveRibbonTabContext()[0]()}get Spread(){var t;return(t=this._spreadContext)==null?void 0:t.Spread}getData(t){if(!this._disposed)return t==="isRibbonCollapse"?!!this._designerContext.useRibbonTabsCollapsedContext()[0]():this._designerCore.getState(t)}evaluate(t){return this._designerCore.evaluate(t)}_evalContext(t){try{if(t){let i="=";return i+=fm(t,this),i=i.replace(new RegExp(Hle,"g"),""),this.evaluate(i)}}catch{}}setData(t,i){if(!this._disposed&&(this._designerCore.setState(t,i),this.suspendUpdateState===0&&(this.suspendUpdateState++,an(t,this),this.suspendUpdateState--),typeof i=="boolean"&&t==="isRibbonCollapse")){let[n,a]=this._designerContext.useRibbonTabsCollapsedContext();if(i!==!!n()){let[r,o]=this._designerContext.useSelectedTabContext();i?(a(r()),o("")):(o(n()),a(""))}}}getWorkbook(){return this._spreadContext.PrimarySpread}destroy(){rx()===this._designerCore._getDialogOwner()&&ox(void 0),C.disposeMeasureSpan(),this._detachEvent(),this._detachGlobalEvent(),clearTimeout(this._updateTask),this._disposed=!0,this._designerCore.destroy(),this._spreadContext=void 0,this._designerCore=void 0,this._designerContext.destroy(),this._designerContext=void 0,this._globalEvent.offAll(),this._globalEvent=null}refresh(t){let i=this._designerCore;if(t===!1){i.refresh(!0);return}Ll(this),i&&i.refresh(),ox(this._designerCore._getDialogOwner())}setConfig(t){this._resetContext(),this._licenseCheck(this.Spread),this._designerCore.clearCommands(),Object.values(C.buildInCommands).forEach(n=>{this._designerCore.registerCommand(n)}),Ae.SetConfig=!0,this._spreadContext.startSetConfig(),this._config=t;let i=this._designerCore;i==null||i.setConfig(t),GC.Spread.Sheets.Designer.sd(this,t),Ae.SetConfig=!1,this._spreadContext.endSetConfig()}_resetContext(){const[t,i]=this._designerContext.useSelectedTabContext();i(void 0)}offAll(){}setWorkbook(t){this._designerCore.destroy(),this._spreadContext=new VR(this,1,[t]),this._designerCore=new RI(this._container,this._config,this._spreadContext,bM(this._designerContext)),Object.values(C.buildInCommands).forEach(i=>{this._designerCore.registerCommand(i)}),this._designerContext.useSpread()[1](t),this._designerContext.useSpreadContext()[1](this._spreadContext),Ll(this),this._designerCore._init(),GC.Spread.Sheets.Designer.sd(this,this._config),this._afterDesignerCoreInit()}__setWorkbook(t){var n;Ae.SetConfig=!0,this._designerCore&&t!==this.Spread&&(this.Spread.focus(!1),u0(this,this.Spread),(n=this._getGlobalEvent())==null||n.offAll(),t.resumePaint(),t.focus(!0),this.refresh()),Ae.SetConfig=!1}bind(t,i){var n;(n=this._globalEvent)==null||n.on(t,i)}unbind(t,i){var n;(n=this._globalEvent)==null||n.off(t,i)}unbindAll(){var t;(t=this._globalEvent)==null||t.offAll()}static RegisterComponent(t,i){return jx.RegisterComponent(t,i)}_refresh(t){this._disposed||this._designerCore.refresh(t)}_getDialogOwner(){return this._designerCore._getDialogOwner()}showDialog(t,i,n,a,r,o){let l=u1(t);l&&this._showDialog(l,i,r,{positionElement:o}).then(c=>{n(c)}).catch(c=>{a&&a(c)})}async _showDialog(t,i,n,a){return this._designerCore._showDialog(t,i,n,a)}showMessageBox(t,i,n,a,r,o){this._showMessageBox(t,i,n,o).then(l=>{a&&a(l)}).catch(l=>{r&&r(l)})}async _showMessageBox(t,i,n,a,r,o,l){return this._designerCore._showMessageBox(t,i,n,a,r,o,l)}}class zle{constructor(t,i,n,a){this.__=Kx,this.__=Kx,Kx+=1;const r=new jR(t,i,n,a);r.__=this.__,Mi[this.__]||(Mi[this.__]={host:r._container,imp:r}),Mi[this.__].designer=this}activeRibbonTab(t){var i;return(i=Mi[this.__].imp)==null?void 0:i.activeRibbonTab(t)}bind(t,i){var n;(n=Mi[this.__].imp)==null||n.bind(t,i)}destroy(){const t=Mi[this.__].imp;t==null||t.destroy(),Mi[this.__]={host:void 0,designer:void 0,imp:void 0}}getData(t){var i;return(i=Mi[this.__].imp)==null?void 0:i.getData(t)}getWorkbook(){var t;return(t=Mi[this.__].imp)==null?void 0:t.getWorkbook()}refresh(t){var i;(i=Mi[this.__].imp)==null||i.refresh(t)}setConfig(t){var i;(i=Mi[this.__].imp)==null||i.setConfig(t)}setData(t,i){var n;(n=Mi[this.__].imp)==null||n.setData(t,i)}setWorkbook(t){var i;(i=Mi[this.__].imp)==null||i.setWorkbook(t)}unbind(t,i){var n;(n=Mi[this.__].imp)==null||n.unbind(t,i)}unbindAll(){var t;(t=Mi[this.__].imp)==null||t.unbindAll()}static RegisterComponent(t,i){return jR.RegisterComponent(t,i)}showDialog(t,i,n,a,r,o){var l;(l=Mi[this.__].imp)==null||l.showDialog(t,i,n,a,r,o)}showMessageBox(t,i,n,a,r,o){var l;(l=Mi[this.__].imp)==null||l.showMessageBox(t,i,n,a,r,o)}get Spread(){var t;return(t=Mi[this.__].imp)==null?void 0:t.Spread}get _container(){var t;return(t=Mi[this.__].imp)==null?void 0:t._container}get _config(){var t;return(t=Mi[this.__].imp)==null?void 0:t._config}_getGlobalEvent(){var t;return(t=Mi[this.__].imp)==null?void 0:t._getGlobalEvent()}__setWorkbook(t){var i;(i=Mi[this.__].imp)==null||i._getGlobalEvent()}_getDialogOwner(){var t;return(t=Mi[this.__].imp)==null?void 0:t._getDialogOwner()}_showDialog(t,i,n,a){return Mi[this.__].imp._showDialog(t,i,n,a)}_showMessageBox(t,i,n,a,r,o){return Mi[this.__].imp._showMessageBox(t,i,n,a,r,o)}_runRibbonCommand(t){var i;(i=Mi[this.__].imp)==null||i._runRibbonCommand(t)}evaluate(t){var i;return(i=Mi[this.__].imp)==null?void 0:i.evaluate(t)}get _designerContext(){var t;return(t=Mi[this.__].imp)==null?void 0:t._designerContext}get _designerCore(){var t;return(t=Mi[this.__].imp)==null?void 0:t._designerCore}_refresh(){var t;(t=Mi[this.__].imp)==null||t.refresh()}}async function jle(e){!!e.getData(m.FieldListVisible)&&await Qx(e)}async function Qx(e){let t=!!e.getData(m.FieldListVisible),i,n=GC.Spread.Sheets.Events.SelectionChanged+hc,a=GC.Spread.Sheets.Events.TopRowChanged+hc,r=GC.Spread.Sheets.Events.LeftColumnChanged+hc,o=GC.Spread.Sheets.Events.ActiveSheetChanged+hc,l=GC.Spread.Sheets.Events.ColumnWidthChanged+hc,c=GC.Spread.Sheets.Events.RowHeightChanged+hc;if(e.setData(m.FieldListVisible,!t),t){KR(),e.Spread.unbind(hc),i=e.getData(re.bindingIndicatorManager),i.hideDataBindingSettingIndicator();let d=e.getData(re.originalDataSource);d&&e.Spread.getActiveSheet().setDataSource(d)}else{if(e.setData(m.ShowShapePropertyPanel,t),e.setData(m.ChartAltTextPanelVisible,t),e.setData(m.ShapeAltTextPanelVisible,t),e.setData(m.PictureAltTextPanelVisible,t),e.setData(m.ChartElementContext,t),e.setData(m.SelectionPane,t),qR(e.__),i=e.getData(re.bindingIndicatorManager),!i){let d=e.getData(re.container);i=new vR(e,d),e.setData(re.bindingIndicatorManager,i)}e.Spread.bind(n,()=>{i.refreshBindingPathIndicator(e)}),e.Spread.bind(a,()=>{i.refreshBindingPathIndicator(e)}),e.Spread.bind(r,()=>{i.refreshBindingPathIndicator(e)}),e.Spread.bind(o,()=>{i.refreshBindingPathIndicator(e)}),e.Spread.bind(l,()=>{i.refreshBindingPathIndicator(e)}),e.Spread.bind(c,()=>{i.refreshBindingPathIndicator(e)})}t||i.refreshBindingPathIndicator(e)}let Cr=GC.Spread.Sheets.CellTypes,WR=Cr.Text.prototype.getText,ZR=Cr.CheckBox.prototype.getText,UR=Cr.Button.prototype.getText,JR=Cr.HyperLink.prototype.getText,YR=Cr.ComboBox.prototype.getText;function Cm(e,t){var a;let i=wte(e),n=(a=t==null?void 0:t.sheet)==null?void 0:a.parent;return i&&n?i.Spread===n:!1}function qR(e){Cr.Text.prototype.getText=function(t,i){let n=i.sheet.getBindingPath(i.row,i.col);return n&&Cm(e,i)?"["+n+"]":WR.apply(this,arguments)},Cr.CheckBox.prototype.getText=function(t,i){let n=i.sheet.getBindingPath(i.row,i.col);return n&&Cm(e,i)?"["+n+"]":ZR.apply(this,arguments)},Cr.Button.prototype.getText=function(t,i){let n=i.sheet.getBindingPath(i.row,i.col);return n&&Cm(e,i)?"["+n+"]":UR.apply(this,arguments)},Cr.HyperLink.prototype.getText=function(t,i){let n=i.sheet.getBindingPath(i.row,i.col);return n&&Cm(e,i)?"["+n+"]":JR.apply(this,arguments)},Cr.ComboBox.prototype.getText=function(t,i){let n=i.sheet.getBindingPath(i.row,i.col);return n&&Cm(e,i)?"["+n+"]":YR.apply(this,arguments)}}function KR(){Cr.Text.prototype.getText=WR,Cr.CheckBox.prototype.getText=ZR,Cr.Button.prototype.getText=UR,Cr.HyperLink.prototype.getText=JR,Cr.ComboBox.prototype.getText=YR}async function Wle(e,t,i,n,a){let r=i.getPivotInfoImp(n,a,!1),o=Ule(r),l=t.getParent();if(r){if(r.menuArea===4)r.area===4?l.commandManager().execute({cmd:"pivotShowDetails",sheetName:t.name(),selections:t.getSelections(),commandOptions:{pivotTableCellInfo:i.getPivotInfoImp(n,a,!1,!1,!0),pivotTableName:i==null?void 0:i.name()}}):l.commandManager().execute({cmd:"openValueFieldSettingDialogCmd",sheetName:t.name(),cmdOption:{pivotTable:i,fieldName:o,pivotName:i==null?void 0:i.name()}});else if(Zle(i,r,o)){let d=QR(i,r);if(!(d!=null&&d.items.length))return;let u=await e._showDialog(G.PivotTableExpandFieldTemplate,{listItems:d}),h;u!=null&&(u.listItems&&(o=u.listItems.selectedValue),r.area===3?h=GC.Spread.Pivot.PivotTableFieldType.rowField:r.area===2&&(h=GC.Spread.Pivot.PivotTableFieldType.columnField),t.getParent().commandManager().execute({cmd:"AddField",sheetName:t.name(),cmdOption:{fieldName:o,pivotName:i==null?void 0:i.name(),targetArea:h}}))}}}function QR(e,t){if(e){let i=e.getSourceFields(),n,a,r=[];if(t.area===3?n=e.getFieldsByArea(GC.Spread.Pivot.PivotTableFieldType.rowField):t.area===2&&(n=e.getFieldsByArea(GC.Spread.Pivot.PivotTableFieldType.columnField)),n)for(let o=i.length-1;o>=0;o--){a=i[o].name;for(let l of n)if(l.sourceName===a){i.splice(o,1);break}}for(let o=0;o<i.length;o++)r.push({text:i[o].name,value:i[o].name,selected:!1});return{items:r,selectedValue:""}}}function Zle(e,t,i){let n;if(t&&e){if(t.area===3)n=e.getFieldsByArea(GC.Spread.Pivot.PivotTableFieldType.rowField);else if(t.area===2)n=e.getFieldsByArea(GC.Spread.Pivot.PivotTableFieldType.columnField);else return!1;return i===n[n.length-1].fieldName}}function Ule(e){if(e){let t="",{activeColFieldInfo:i,colHeadFieldInfo:n,cornerFieldInfo:a,activeRowFieldInfo:r}=e;return i?t=i.name:r?t=r.name:n?t=n.fieldName:a&&(t=a.fieldName),t}}class Jle extends oe.DesignerActionBase{executeImp(t,i,n){let a=this.spread();a.suspendPaint();let r=a.getActiveSheetTab();C._isTableSheet(r)&&r.setDefaultRowHeight(i.rowHeight,i.sheetArea),a.resumePaint()}}let XR={canUndo:!0,execute:function(e,t,i){return new Jle(e,t).execute(e,t,i)}};function Yle(e,t){let i="Designer."+t;e.commandManager().register(i,XR,void 0,!1,!1,!1,!1)}function $R(e,t,i){oe.runCommand(e,"setTableSheetRowHeight",XR,{rowHeight:t,sheetArea:i})}class qle extends oe.DesignerActionBase{executeImp(t,i,n){let a=this.spread();a.suspendPaint();let r=a.getActiveSheetTab();C._isTableSheet(r)&&r.rowActionOptions(i.options),a.resumePaint()}}let e_={canUndo:!0,execute:function(e,t,i){return new qle(e,t).execute(e,t,i)}};function Kle(e,t){let i="Designer."+t;e.commandManager().register(i,e_,void 0,!1,!1,!1,!1)}function t_(e,t){oe.runCommand(e,"setTableSheetRowActionOptions",e_,{options:t})}class Qle extends oe.DesignerActionBase{executeImp(t,i,n){const{sheetName:a,template:r}=i,o=t.getSheetTab(a);r&&o.applyFreeHeaderArea(r)}}let Xle={canUndo:!0,execute:function(e,t,i){return new Qle(e,t).execute(e,t,i)}};function Xx(e,t){const i={template:t.toJSON(),sheetName:e.getActiveSheetOrSheetTab().name(),selections:[]};oe.runCommand(e,"applyFreeHeaderArea",Xle,i)}function $le(e,t,i){if(C._isTableSheet(i)){let n=i.getDataView();if(n){let a=n.getColumn(),r=0,o=!0;if(a.forEach(l=>{if(typeof l.caption=="object"){let c=[...l.caption];if(c.length>=t){c.splice(t,0,c[t-1]);const d={...l};d.caption=c,n.updateColumn(d),$x(n,i,d)}r++,o=!1}}),r=0,o){let l=a[r].caption;C.isNullOrUndefined(l)&&(l=a[r].value),l=[l,l];const c={...a[0]};c.caption=l,n.updateColumn(c),$x(n,i,a[r])}}}}function ese(e,t,i){if(C._isTableSheet(i)){let n=i.getDataView();n&&n.getColumn().forEach(r=>{const o={...r};if(typeof r.caption=="object"){let l=[...r.caption];l.length>t?l.length===1&&t===1?o.caption=void 0:l.length===2?(l.splice(t,1),o.caption=l[0]):(l.splice(t,1),o.caption=l):o.caption=void 0,n.updateColumn(o),$x(n,i,o)}})}}function $x(e,t,i){e.setGroupSliceColumnSettings(i,"caption"),e.updateColumnSettingToGroupOptions(i,"caption"),t.refreshBindColumns(),t.applyStyleRules()}class tse extends oe.DesignerActionBase{executeImp(t,i,n){const{sheetName:a,index:r,type:o}=i,l=t.getSheetTab(a);r!=null&&(o==="delete"?ese(t,r,l):o==="insert"&&$le(t,r,l))}}let ise={canUndo:!0,execute:function(e,t,i){return new tse(e,t).execute(e,t,i)}};function e0(e,t,i){const n={index:t,type:i,sheetName:e.getActiveSheetOrSheetTab().name(),selections:[]};oe.runCommand(e,"applyMulHeaderArea",ise,n)}class nse extends oe.DesignerActionBase{executeImp(t,i,n){let a=this.spread();a.suspendPaint();let r=a.getActiveSheetTab();C._isTableSheet(r)&&(i.allowAddNew!==void 0&&(r.options.allowAddNew=i.allowAddNew),i.showRowNumber!==void 0&&(r.options.showRowNumber=i.showRowNumber),i.enableDefineColumn!==void 0&&(r.options.enableDefineColumn=i.enableDefineColumn),i.alternatingRowOptions&&(r.options.alternatingRowOptions=i.alternatingRowOptions)),a.resumePaint()}}let i_={canUndo:!0,execute:function(e,t,i){return new nse(e,t).execute(e,t,i)}};function t0(e,t){let i="Designer."+t;e.commandManager().register(i,i_,void 0,!1,!1,!1,!1)}function Zu(e,t,i,n,a){oe.runCommand(e,"setTableSheetOptions",i_,{allowAddNew:t,alternatingRowOptions:i,showRowNumber:n,enableDefineColumn:a})}class ase extends oe.DesignerActionBase{executeImp(t,i,n){let a=this.spread();a.suspendPaint();let r=a.getActiveSheetTab();C._isTableSheet(r)&&r.applyTableTheme(i.theme),a.resumePaint()}}let n_={canUndo:!0,execute:function(e,t,i){return new ase(e,t).execute(e,t,i)}};function rse(e,t){let i="Designer."+t;e.commandManager().register(i,n_,void 0,!1,!1,!1,!1)}function ose(e,t){oe.runCommand(e,"changeTableSheetTheme",n_,{theme:t})}class lse extends oe.DesignerActionBase{executeImp(t,i,n){let a=this.spread();a.suspendPaint();let r=a.getActiveSheetTab();C._isTableSheet(r)&&(r.options.defaultStackRowHeight=i.rowHeight),a.resumePaint()}}let a_={canUndo:!0,execute:function(e,t,i){return new lse(e,t).execute(e,t,i)}};function sse(e,t){let i="Designer."+t;e.commandManager().register(i,a_,void 0,!1,!1,!1,!1)}function cse(e,t){oe.runCommand(e,"setTableSheetStackRowHeight",a_,{rowHeight:t})}const ym="table-sheet-free-header-area-button-",i0="table-sheet-add-delete-button-wrapper",dse="table-sheet-free-header-area-add-delete-button-wrapper",n0="table-sheet-free-header-area-delete-row-button",a0="table-sheet-free-header-area-delete-row",use="table-sheet-multiple-header-area-add-delete-button-wrapper",r0="table-sheet-free-header-area-add-row-button",o0="table-sheet-free-header-area-add-row",Gb="table-sheet-free-header-area-bottom-border";let l0=()=>{},hse={title:"${res.ribbon.tableSheetDesign.designMode}",text:"${res.ribbon.tableSheetDesign.designMode}",iconClass:"ribbon-table-sheet-design-mode",type:"checkbox",bigButton:"=IF(AND(NOT(inDropdown), ribbonHeight>toolbarHeight), true, false)",commandName:p.ToggleTableSheetDesignMode,enableContext:`!${m.IsActualProtected}`,execute:async e=>{let t=e.Spread,i=t.getActiveSheetTab(),n=e.getData(m.IsInTableSheetDesignMode),a=e._container.querySelector(".spreadWrapper");i&&i.getDataView&&i.getDataView()?n?n===!0&&(e.setData(m.IsInTableSheetDesignMode,!1),r_(e,t),Vb(a),e.setData("isRibbonCollapse",!1),e.setData(m.TableSheetPanelVisible,!0),e.setData(m.OriginSheetTab,void 0),e.setData(m.TableSheetHasMultipleHeaderRows,i.getRowCount(GC.Spread.Sheets.SheetArea.colHeader)>1),i.options.isDesignMode=!1,e.activeRibbonTab("tableSheetDesign"),e.Spread.options._closeEnableAccessibility&&(e.Spread.options.enableAccessibility=!0,delete e.Spread.options._closeEnableAccessibility),i.unbind("TableSheetColHeaderRowCountChanged",l0)):(e.setData(m.TableSheetPanelVisible,!1),e.setData(m.OriginSheetTab,i.name()),e.setData(m.IsInTableSheetDesignMode,!0),Hb(e,a),e.setData(m.TableSheetHasMultipleHeaderRows,i.getRowCount(GC.Spread.Sheets.SheetArea.colHeader)>1),i.options.isDesignMode=!0,e.Spread.options.enableAccessibility&&(e.Spread.options.enableAccessibility=!1,e.Spread.options._closeEnableAccessibility=!0),i.bind("TableSheetColHeaderRowCountChanged",l0)):n===!0&&(r_(e,t),Vb(a),e.setData(m.IsInTableSheetDesignMode,!1),e.setData(m.OriginSheetTab,void 0),e.setData("isRibbonCollapse",!1),e.setData(m.TableSheetHasMultipleHeaderRows,i.getRowCount(GC.Spread.Sheets.SheetArea.colHeader)>1)),e.Spread.options.enableAccessibility&&e.Spread.focus(!0)},getState:e=>!!e.getData(m.IsInTableSheetDesignMode),init:e=>{l0=()=>{pse(e)}}};function r_(e,t){let i=e.getData(m.OriginSheetTab),n=C.getSheetOrSheetTabByName(t,i);if(C.isNullOrUndefined(n))return;let a=n.applyFreeHeaderArea();Object.keys(a.data).indexOf("dataTable")===-1&&a.rowCount===1&&C.setTableSheetFreeHeader(n,void 0)}function s0(e){e.stopPropagation()}function Vb(e){let t=e.querySelector("."+i0);t&&(t.removeEventListener("contextmenu",s0),e.removeChild(t))}function Hb(e,t){const i=t.getElementsByClassName(i0);for(let o=0;o<i.length;o++){const l=i[o];l.removeEventListener("contextmenu",s0),t.removeChild(l)}let n=mse(e),a=yse(e),r=document.createElement("div");r.append(n),r.append(a),r.style.position="fixed",r.style.borderRight="1px solid #ababab",r.className=i0,r.addEventListener("contextmenu",s0),t.append(r)}function pse(e){let t=e.getData(m.IsInTableSheetDesignMode);const i=e._container.querySelector(".spreadWrapper");Vb(i),t&&Hb(e,i)}function mse(e){let t=document.createElement("div");return t.style.backgroundColor="white",t.className=dse,gse(e.Spread,t),t}function gse(e,t){let i=e.getActiveSheetTab(),a=new GC.Spread.Sheets.Workbook(document.createElement("div"),{sheetCount:1}).getActiveSheet(),r=i.applyFreeHeaderArea();if(C.isNullOrUndefined(r)){a.setRowCount(1);let c=i.getColumnCount();a.setColumnCount(c),C.setTableSheetFreeHeader(i,a.toJSON())}else a.fromJSON(i.applyFreeHeaderArea());let o=a.getRowCount(),l=zb(e);for(let c=0;c<o;c++){let d=i.getRowHeight(c,1),u;c===o-1?(u=c0(e,l,d-1,c),u.classList.add(Gb)):u=c0(e,l,d,c),t.appendChild(u)}}function c0(e,t,i,n){let a=document.createElement("div"),r=e.getActiveSheetTab(),o=r.zoom();return a.style.width=t*o+"px",a.style.height=i*o+"px",a.className=ym+n,l_(a,t/2,i,o,function(l){l.addEventListener("click",()=>{e.suspendPaint();let c=l.parentElement,d=vm(c.classList);Cse(e,d+1);let u=c.parentElement,g=e.getActiveSheetTab().zoom(),f=c0(e,zb(e),r.getRowHeight(0,1),u.childNodes.length);u.appendChild(f),fse(e,u,g),e.resumePaint()})},function(l){l.addEventListener("click",()=>{e.suspendPaint();let c=l.parentElement,d=c.parentElement,u=r.getRowHeight(0,1);if(d.childNodes.length===1){let b=e.getActiveSheetTab(),S=C.getWorkSheetForTableSheetFreeHeaderArea(b,!0);if(S){S.deleteRows(0,1),S.setRowCount(1),Xx(e,S),c.style.height=r.getRowHeight(0,1)-1+"px";let y=c.querySelector("."+r0);y.style.height=r.getRowHeight(0,1)-1+"px";let v=c.querySelector("."+n0);v.style.height=r.getRowHeight(0,1)-1+"px";let x=c.querySelector("."+o0);x.style.top=u*o/2-10+"px";let L=c.querySelector("."+a0);L.style.top=u*o/2-10+"px"}e.resumePaint();return}let h=vm(c.classList);Sse(e,h);let g=d.childNodes;for(let b=0;b<g.length;b++)o_(g[b],h);d.removeChild(c),d.lastChild.classList.add(Gb),e.resumePaint()})}),a}function o_(e,t){let i=vm(e.classList);if(i>t){let n=c_(e.classList);e.classList.remove(n),e.classList.add(ym+(i-1))}}function l_(e,t,i,n,a,r){let o=s_(t,i,n,n0,a0,s.spreadSettingDialog.delete);r(o),e.append(o);let l=s_(t,i,n,r0,o0,s.spreadSettingDialog.add);a(l),e.append(l)}function s_(e,t,i,n,a,r){let o=document.createElement("div");o.style.width=e*i+"px",o.style.height=t*i+"px",o.className=n,o.setAttribute("role","button"),o.setAttribute("tabindex","0"),r&&o.setAttribute("aria-label",r);let l=document.createElement("div");return l.className=a,l.style.width="20px",l.style.height="20px",l.style.top=t*i/2-10+"px",o.appendChild(l),o}function fse(e,t,i){let n=e.getActiveSheetTab(),a=C.getWorkSheetForTableSheetFreeHeaderArea(n,!0);if(!a)return;let r=a.getRowCount();for(let o=0;o<r;o++){let l=n.getRowHeight(o,1),c=t.querySelector("."+ym+o);c.classList.remove(Gb),o===r-1&&(l--,c.classList.add(Gb),c.querySelector("."+n0).style.height=l*i+"px",c.querySelector("."+r0).style.height=l*i+"px"),c.style.height=l*i+"px",c.querySelector("."+a0).style.top=l*i/2-10+"px",c.querySelector("."+o0).style.top=l*i/2-10+"px"}}function vm(e){let t=c_(e);return C.isNullOrUndefined(t)?-1:bse(t)}function c_(e){for(let t=0;t<e.length;t++)if(new RegExp(ym).test(e[t]))return e[t]}function bse(e){return Number(e.substr(36))}function Sse(e,t){let i=e.getActiveSheetTab(),n=C.getWorkSheetForTableSheetFreeHeaderArea(i,!0);n&&(n.deleteRows(t,1),Xx(e,n))}function Cse(e,t){let i=e.getActiveSheetTab(),n=C.getWorkSheetForTableSheetFreeHeaderArea(i,!0);n&&(n.addRows(t,1),Xx(e,n))}function yse(e){let t=vse(e),i=document.createElement("div");return i.style.backgroundColor="white",i.className=use,xse(e.Spread,i,t),i}function vse(e){let t=e.Spread.getActiveSheetTab(),i=1;if(C._isTableSheet(t)){let n=t.getDataView();n&&n.getColumn().forEach(r=>{let o=r.caption;typeof o=="object"&&(i=i>o.length?i:o.length)})}return i}function xse(e,t,i){let n=e.getActiveSheetTab();if(C._isTableSheet(n)){let a=zb(e),r=n.applyFreeHeaderArea().rowCount;for(let o=0;o<i;o++){let l=n.getRowHeight(r+o+1,1),c=d_(e,a,l,o);t.appendChild(c)}}}function zb(e){let t=e.getActiveSheetTab(),i,n=0;if(C._isTableSheet(t)){i=t.getColumnCount(2);for(let a=0;a<i;a++)n+=t.getColumnWidth(a,2)}return n-1}function d_(e,t,i,n){let a=document.createElement("div"),r=e.getActiveSheetTab(),o=r.zoom();return a.style.width=t*o+"px",a.style.height=i*o+"px",a.className=ym+n,l_(a,t/2,i,o,function(l){l.addEventListener("click",()=>{e.suspendPaint();let c=l.parentElement,d=vm(c.classList);e0(e,d+1,"insert");let u=c.parentElement,h=r.applyFreeHeaderArea().rowCount,g=d_(e,zb(e),r.getRowHeight(h+1,1),u.childNodes.length);u.appendChild(g),e.resumePaint()})},function(l){l.addEventListener("click",()=>{let c=l.parentElement,d=c.parentElement;if(d.childNodes.length===1){e0(e,1,"delete");return}let u=vm(c.classList);e0(e,u,"delete");let h=d.childNodes;for(let g=0;g<h.length;g++)o_(h[g],u);d.removeChild(c)})}),a}const Lse=Object.freeze(Object.defineProperty({__proto__:null,ToggleTableSheetDesignMode:hse,addFreeHeaderAndMultipleHeiderButton:Hb,removeButtons:Vb},Symbol.toStringTag,{value:"Module"}));let aa=GC.Spread.Sheets;const En=".GC_Designer_Events",u_=e=>{e.getData(re.isFileModified)||e.setData(re.isFileModified,!0),e.getData(re.shouldModifiedHandlerExecute)&&(lc.updateWindowTitle(e),e.setData(re.shouldModifiedHandlerExecute,!1))};let d0;function h_(e){return(t,i)=>{let n=i.row,a=i.sheetArea,r=i.sheet;if(a===GC.Spread.Sheets.SheetArea.colHeader&&r&&r.parent){let o=C.getActiveSheetOrSheetTab(r.parent);o&&(o._freeHeaderSheet||o._freeHeaderSheetJson)&&C._isTableSheet(o)&&o.getSheet()===r&&n<r.getFreeAreaRowCount(a)&&(o._freeHeaderSheet=void 0,o._freeHeaderSheetJson=void 0)}d0||(d0=setTimeout(()=>{d0=null,e(t,i)}))}}function Tse(e,t){u0(e,t);const i=()=>{u_(e)};if(!C.isWorkbookValid(t))return;t.bind(aa.Events.CellChanged+En,h_(i)),t.bind(aa.Events.RowChanged+En,i),t.bind(aa.Events.ColumnChanged+En,i),t.bind(aa.Events.ActiveSheetChanged+En,i),t.bind(aa.Events.RangeChanged+En,h_(i)),t.bind(aa.Events.PivotTableChanged+En,i),t.bind(aa.Events.InvalidOperation+En,async(h,g)=>{switch(g.invalidType){case GC.Spread.Sheets.InvalidOperationType.changeSheetName:case GC.Spread.Sheets.InvalidOperationType.copyPaste:case GC.Spread.Sheets.InvalidOperationType.table:case GC.Spread.Sheets.InvalidOperationType.pivotTable:case GC.Spread.Sheets.InvalidOperationType.groupProtected:case GC.Spread.Sheets.InvalidOperationType.dragDrop:case GC.Spread.Sheets.InvalidOperationType.dragFill:case GC.Spread.Sheets.InvalidOperationType.cutProtected:case GC.Spread.Sheets.InvalidOperationType.editProtected:case GC.Spread.Sheets.InvalidOperationType.dataObjectCellTypeInsertData:case GC.Spread.Sheets.InvalidOperationType.customName:case GC.Spread.Sheets.InvalidOperationType.sort:case GC.Spread.Sheets.InvalidOperationType.sizeLimitExceeded:case 17:!e.getData(m.FileMenu_show)&&!C._hasDesignerDialog()&&(await e._showMessageBox(g.message,s.title,Re.warning,vt.ok),t.focus(!0));break;case GC.Spread.Sheets.InvalidOperationType.ptOverlapValue:await wse(g,t,g.message.force,e),t.focus(!0);break}}),t.bind(GC.Spread.Sheets.Events.ValidationError+En,(h,g)=>{m_(g,e)}),t.bind(GC.Spread.Sheets.Events.CellClick+En,(h,g)=>{aa.Designer.sd(e);let f=C.getSheetOrSheetTabByName(t,g.sheetName);if(C._isTableSheet(f)){let b=f.applyFreeHeaderArea();g.sheetArea===1&&b&&b.rowCount>g.row?(e.setData(m.DisableHomeButton,!1),e.activeRibbonTab("home")):e.setData(m.DisableHomeButton,!0)}else e.setData(m.DisableHomeButton,!1)});let n=!1;t.bind(GC.Spread.Sheets.Events.ChartClicked+En,(h,g)=>{let f=n;if(n||(n=!0),f||e.getData(m.ChartElementContext)){let y=pe.getSelectedSeries(g);e.setData(m.ChartElementContext,y),e.setData(m.ChartAltTextPanelVisible,!1),e.setData(m.FieldListVisible,!1)}e.setData(m.FunnelChartClicked,g.chart.chartType()===GC.Spread.Sheets.Charts.ChartType.funnel),e.setData(m.WaterfallChartClicked,g.chart.chartType()===GC.Spread.Sheets.Charts.ChartType.waterfall);let b=g.options&&g.options.info,S=-1;if(b){let y=b.index;isNaN(y)?(y=b.seriesIndex,isNaN(y)||(S=+y)):S=+y}e.setData(m.ChartSelectedSeriesIndex,S),setTimeout(()=>{n=!1},500)}),t.bind(GC.Spread.Sheets.Events.PermissionChanged,(h,g)=>{var v;const f=g.permission,b=f==null?void 0:f.mode,S=(v=GC.Spread.Sheets.Collaboration)==null?void 0:v.PermissionTypes,y=(f==null?void 0:f.viewModePermissions)||(S==null?void 0:S.allowNonDataModifyingOperations)||0;e.setData(m.InViewMode,b===1),e.setData(m.AllowNonDataModifyingOperations,y&(S==null?void 0:S.allowNonDataModifyingOperations)),e.setData(m.AllowViewModeResizeRowsOrColumns,y&(S==null?void 0:S.allowResizeRowsOrColumns)),e.setData(m.AllowViewModeHideRowsOrColumns,y&(S==null?void 0:S.allowHideRowsOrColumns)),e.setData(m.AllowViewModeFilter,y&(S==null?void 0:S.allowFilter)),e.setData(m.AllowViewModeSort,y&(S==null?void 0:S.allowSort))});let a=t.getHost();e.getData(re.dblclickBound)||(e._shapeDbClickHandler=h=>{Pse(h,e.Spread)&&(e.setData(m.ShapeAltTextPanelVisible,!1),e.setData(m.FieldListVisible,!1))},a.addEventListener("dblclick",e._shapeDbClickHandler),e.setData(re.dblclickBound,!0)),jle(e),e.setData(m.SelectionPane,!1),e.setData(m.ShowFormulaEditorPanel,!1),e.setData(m.ThreadedCommentPanel,!1),e.setData(m.FormatPainter,0),t.bind(aa.Events.TableRowsChanged+En,Dse),t.bind(aa.Events.TableColumnsChanged+En,Ase),t.bind(aa.Events.PictureSelectionChanged+En,(h,g)=>{let f=g.picture.isSelected();e.setData(m.hideContextMenu,f),e.setData(m.pictureSelected,f),f||e.setData(m.PictureAltTextPanelVisible,!1)}),t.bind(aa.Events.CellDoubleClick+En,(h,g)=>{let{row:f,col:b,sheet:S}=g;if(!S.pivotTables||S.isActualProtected()&&S.getCell(f,b).locked())return;let y=S.pivotTables.findPivotTable(f,b);if(y){if(e.getData(m.ForbidShowPivotDetailsWithDBClick)||y.options.enableDataValueEditing&&y.getPivotInfo(f,b).area===4)return;let v=y.getFieldsByArea();(v==null?void 0:v.length)>0&&Wle(e,S,y,f,b)}});const r=".spreadWrapper",o=".table-sheet-add-delete-button-wrapper",l=".table-sheet-free-header-area-add-delete-button-wrapper",c=".table-sheet-multiple-header-area-add-delete-button-wrapper";t.bind(aa.Events.ViewZoomed+En,(h,g)=>{let f=e._container.querySelector(r),b=f.querySelector(o);C.isNullOrUndefined(b)||(f.removeChild(b),Hb(e,f))}),t.bind(aa.Events.ColumnWidthChanged+En,(h,g)=>{let f=e._container.querySelector(r);if(C.isNullOrUndefined(f))return;let b=f.querySelector(o);if(C.isNullOrUndefined(b))return;let S=b.querySelector(l),y=b.querySelector(c);if(C.isNullOrUndefined(S)||C.isNullOrUndefined(y))return;let v=t.getActiveSheetTab();if(C.isNullOrUndefined(v)||!C._isTableSheet(v))return;let x,L=0;x=v.getColumnCount(2);for(let D=0;D<x;D++)L+=v.getColumnWidth(D,2);let T=function(D){D.style.width=L*g.sheet.zoom()+"px",D.childNodes[0].style.width=L/2*g.sheet.zoom()+"px",D.childNodes[1].style.width=L/2*g.sheet.zoom()+"px"},w=S.childNodes;for(let D=0;D<w.length;D++)T(w[D]);let M=y.childNodes;for(let D=0;D<M.length;D++)T(M[D])});let d=function(h,g){let f=e._container.querySelector(r),b=f==null?void 0:f.querySelector(o),S=g.newSheet;if(h&&h.type!=="ActiveSheetChangedInternal"&&e.setData(m.ParameterPanelHasBeenRefreshed,!1),C.isNullOrUndefined(b)){e.getData(m.DisableHomeButton)&&e.setData(m.DisableHomeButton,!1);return}!C.isNullOrUndefined(S)&&S.name()===e.getData(m.OriginSheetTab)?(b.style.display="block",e.setData(m.IsInTableSheetDesignMode,!0)):(b.style.display="none",e.activeRibbonTab("home"),e.getData(m.IsInTableSheetDesignMode)&&(e.setData(m.IsInTableSheetDesignMode,!1),e.setData(m.DisableHomeButton,!1)))};t.bind(aa.Events.ActiveSheetChanged+En,d),t.bind(aa.Events.ActiveSheetChangedInternal+En,d),t.bind(aa.Events.SheetChanged+En,d);let u=function(h,g){if(g.propertyName==="insertSheet"){let f=t.getSheet(g.sheetIndex);f.options.colHeaderAutoText=t.options.referenceStyle?GC.Spread.Sheets.HeaderAutoText.numbers:GC.Spread.Sheets.HeaderAutoText.letters}};t.bind(aa.Events.SheetChanged+En,u),t.bind(GC.Spread.Sheets.Events.WorkbookUndo+En,(h,g)=>{Ll(e)}),t.bind(GC.Spread.Sheets.Events.WorkbookRedo+En,(h,g)=>{Ll(e)})}async function wse(e,t,i,n){if(e.message.warningOnly)await(n==null?void 0:n._showMessageBox(e.message.message,s.title,Re.warning,vt.ok));else{let a=await(n==null?void 0:n._showMessageBox(e.message.message,s.title,i?Re.warning:Re.error,i?vt.ok:vt.okCancel));if(i)t.undoManager().undo();else switch(a){case Si.ok:e.cancel=!1;break;case Si.cancel:e.cancel=!0,t.undoManager().undo();break}}}function u0(e,t){t&&t.unbind&&t.unbind(En);let i=t&&t.getHost&&t.getHost();i&&e.getData(re.dblclickBound)&&(i.removeEventListener("dblclick",e._shapeDbClickHandler),e._shapeDbClickHandler=null,e.setData(re.dblclickBound,!1))}function Dse(e,t){if(t.propertyName==="tableInsertRows"){let i=t.sheet,n=t.table,a=t.row,r=t.count,o=t.isAfter,l=n.startColumn(),c=n.endColumn(),d=a+n.dataRange().row,u=o?d:d-1,h=[],g,f;for(g=l;g<=c;g++)f=i.getSparkline(u,g),f&&h.push(f);let b=h.length,S,y,v,x,L,T,w;for(let M=0;M<b;M++){S=h[M],y=S.data(),v=S.dataOrientation(),x=S.sparklineType(),L=S.setting(),T=S.dateAxisData(),w=S.dateAxisOrientation();for(let D=1;D<=r;D++){let P=S.column,A=u+D,E=new aa.Range(A,y.col,y.rowCount,y.colCount);i.setSparkline(A,P,E,v,x,L,T,w)}}}}function Ase(e,t){if(t.propertyName==="tableInsertColumns"){let i=t.sheet,n=t.table,a=t.col,r=t.count,o=t.isAfter,l=n.startRow(),c=n.endRow(),d=a+n.dataRange().col,u=o?d:d-1,h=[],g,f;for(g=l;g<=c;g++)f=i.getSparkline(g,u),f&&h.push(f);let b=h.length,S,y,v,x,L,T,w;for(let M=0;M<b;M++){S=h[M],y=S.data(),v=S.dataOrientation(),x=S.sparklineType(),L=S.setting(),T=S.dateAxisData(),w=S.dateAxisOrientation();for(let D=1;D<=r;D++){let P=S.row,A=u+D,E=new aa.Range(y.row,A,y.rowCount,y.colCount);i.setSparkline(P,A,E,v,x,L,T,w)}}}}function Pse(e,t){let i=t.getActiveSheet(),n=e.offsetX,a=e.offsetY,r=n,o=a,l=i&&i.hitTest(r,o);return l&&l.shapeHitInfo}function p_(e,t){var i;if(e.showFooter()&&e.useFooterDropDownList()){let n=e.endColumn()-e.startColumn()+1;for(let a=0;a<n;a++){let r=(i=e.footerRowDropDowns(a))==null?void 0:i[0].option.items;(r==null?void 0:r.length)<10&&t.forEach(o=>{r.push({text:C.parseResourcesText(o.text),value:o.commandName}),e.footerRowDropDowns(a,{listOption:{items:r},submitCommand:o.commandName})})}}}async function m_(e,t){var d,u,h;let i=e.sheet;i.suspendEvent();const n=i.getValue(e.row,e.col);let a=e.editingValue,r=e.validator,o=r.errorTitle(),l=r.errorMessage();o||(o=s.title);let c=!0;if(r.showErrorMessage()){if(setTimeout(()=>{var g;c&&((g=i.getParent())==null||g.focus(!1))},300),r.errorStyle()===0){e.validationResult=GC.Spread.Sheets.DataValidation.DataValidationResult.retry,l||(l=s.dataValidationDialog.errorMessage1);let g=await(t==null?void 0:t._showMessageBox(l,o,Re.error,vt.okCancel,void 0,void 0,{defaultEnterResult:Si.ok}));switch((d=i.getParent())==null||d.focus(),g){case Si.ok:i.setValue(e.row,e.col,n),i.startEdit(!0,String(a!=null?a:""));break;case Si.cancel:i.setValue(e.row,e.col,n),i.endEdit(!0);break}}else if(r.errorStyle()===1){e.validationResult=GC.Spread.Sheets.DataValidation.DataValidationResult.retry,l||(l=s.dataValidationDialog.errorMessage2);let g=await(t==null?void 0:t._showMessageBox(l,o,Re.warning,vt.yesNoCancel));switch((u=i.getParent())==null||u.focus(),g){case Si.yes:g_(i,a,e.row,e.col),i.endEdit(!0);break;case Si.no:i.setActiveCell(e.row,e.col),i.setValue(e.row,e.col,a),i.startEdit(!0);break;case Si.cancel:i.setValue(e.row,e.col,n),i.endEdit(!0);break}}else if(r.errorStyle()===2){e.validationResult=GC.Spread.Sheets.DataValidation.DataValidationResult.retry,l||(l=s.dataValidationDialog.errorMessage1);let g=await(t==null?void 0:t._showMessageBox(l,o,Re.info,vt.okCancel));switch((h=i.getParent())==null||h.focus(),g){case Si.ok:g_(i,a,e.row,e.col),i.endEdit(!0);break;case Si.cancel:i.setValue(e.row,e.col,n),i.endEdit(!0);break}}c=!1}else e.validationResult=0;i.resumeEvent(),t&&Eo(t)}function g_(e,t,i,n){e.getParent().commandManager().execute({cmd:"editCell",newValue:t,row:i,col:n,sheetName:e.name(),sheetArea:GC.Spread.Sheets.SheetArea.viewport,autoFormat:!0,ignoreValidate:!0})}const Ise=C.isNullOrUndefined,f_=C.objectValues,jb=void 0,Mse={type:GC.Spread.Sheets.DropDownType.slider,option:{min:0,max:100,direction:GC.Spread.Sheets.LayoutDirection.horizontal,height:350,width:350,scaleVisible:!1,step:1}},kse={type:GC.Spread.Sheets.DropDownType.slider,option:{min:0,max:100,direction:GC.Spread.Sheets.LayoutDirection.horizontal,height:350,width:350,scaleVisible:!1,step:1,showNumberRange:!0}},Rse={type:GC.Spread.Sheets.DropDownType.monthPicker,option:{startYear:new Date().getFullYear()-10,stopYear:new Date().getFullYear(),height:300}},_se={type:GC.Spread.Sheets.DropDownType.timePicker,option:{min:{},max:{hour:23,minute:59,second:59},step:{hour:1},formatString:"hh:mm",height:200}},Ose={type:GC.Spread.Sheets.DropDownType.dateTimePicker,option:{calendarPage:GC.Spread.Sheets.CalendarPage.day,showTime:!0,showDateRange:!1,startDay:GC.Spread.Sheets.CalendarStartDay.sunday}},Ese={type:GC.Spread.Sheets.DropDownType.dateTimePicker,option:{calendarPage:GC.Spread.Sheets.CalendarPage.day,showTime:!1,showDateRange:!0,startDay:GC.Spread.Sheets.CalendarStartDay.sunday,showBuiltInDateRange:!0}},xm={GoodBadAndNeutral:["Normal","Bad","Good","Neutral"],DataAndModel:["Calculation","Check Cell","Explanatory Text","Input","Linked Cell","Note","Output","Warning Text","Hyperlink"],TitlesAndHeadings:["Heading 1","Heading 2","Heading 3","Heading 4","Title","Total"],NumberFormat:["Comma","Comma [0]","Currency","Currency [0]","Percent"],CellButtons:["colorPicker-cellbutton","datetimepicker-cellbutton","dateRangePicker-cellbutton","timepicker-cellbutton","calculator-cellbutton","monthpicker-cellbutton","slider-cellbutton","sliderRange-cellbutton","okcancel-cellbutton","clear-cellbutton"]},Tl="gc-cell-style-celltype",ni="gc-cell-style-symbol",Wb="thin solid black",pc="bold 14.6667px Arial",Nse=(e,t)=>(i,n)=>{const a=n.value,r=t(a),o=C.CreateElement("div",n.textClass,null,C.parseResourcesText(n.text));jie(r,o,e),i.innerHTML="",i.appendChild(o)},b_=[{groupName:"${res.cellStylesDialog.custom}",commandName:p.CellStylesListContent,visible:!1,groupItems:[],contextMenu:[{text:"${res.cellStyleContextMenu.modify}",commandName:p.CellStylesListContent,value:"modify"},{text:"${res.cellStyleContextMenu.delete}",className:Js,commandName:p.CellStylesListContent,value:"delete"}]},{groupName:"${res.cellStylesDialog.cellButtonStyleTitle}",commandName:p.CellStylesListContent,contextMenu:[{text:"${res.cellStyleContextMenu.modify}",commandName:p.CellStylesListContent,value:"modify"},{text:"${res.cellStyleContextMenu.delete}",className:Js,commandName:p.CellStylesListContent,value:"delete"}],groupItems:[{text:"${res.cellStylesDialog.cellButtonsStyles.colorPicker-cellbutton}",className:Tl,iconClass:"ribbon-button-colprpicker-dropdown",value:"colorPicker-cellbutton"},{text:"${res.cellStylesDialog.cellButtonsStyles.datetimepicker-cellbutton}",className:Tl,iconClass:"ribbon-button-datetimepicker-dropdown",value:"datetimepicker-cellbutton"},{text:"${res.cellStylesDialog.cellButtonsStyles.dateRangePicker-cellbutton}",className:Tl,iconClass:"ribbon-button-datetimepicker-dropdown",value:"dateRangePicker-cellbutton"},{text:"${res.cellStylesDialog.cellButtonsStyles.timepicker-cellbutton}",className:Tl,iconClass:"ribbon-button-timepicker-dropdown",value:"timepicker-cellbutton"},{text:"${res.cellStylesDialog.cellButtonsStyles.calculator-cellbutton}",className:Tl,iconClass:"ribbon-button-calcualtor-dropdown",value:"calculator-cellbutton"},{text:"${res.cellStylesDialog.cellButtonsStyles.monthpicker-cellbutton}",className:Tl,iconClass:"ribbon-button-monthpicker-dropdown",value:"monthpicker-cellbutton"},{text:"${res.cellStylesDialog.cellButtonsStyles.slider-cellbutton}",className:Tl,iconClass:"ribbon-button-slider-dropdown",value:"slider-cellbutton"},{text:"${res.cellStylesDialog.cellButtonsStyles.sliderRange-cellbutton}",className:Tl,iconClass:"ribbon-button-slider-dropdown",value:"sliderRange-cellbutton"},{text:"${res.cellStylesDialog.cellButtonsStyles.okcancel-cellbutton}",className:Tl,iconClass:"ribbon-button-okcancel-dropdown",value:"okcancel-cellbutton"},{text:"${res.cellStylesDialog.cellButtonsStyles.clear-cellbutton}",className:Tl,iconClass:"ribbon-button-clear-dropdown",value:"clear-cellbutton"}]},{groupName:"${res.cellStylesDialog.goodBadAndNeutral}",commandName:p.CellStylesListContent,contextMenu:[{text:"${res.cellStyleContextMenu.modify}",commandName:p.CellStylesListContent,value:"modify"},{text:"${res.cellStyleContextMenu.delete}",className:Js,commandName:p.CellStylesListContent,value:"delete"}],groupItems:[{text:"${res.cellStylesDialog.goodBadAndNeutralContent.Normal}",textClass:"style-item",className:ni,value:"Normal"},{text:"${res.cellStylesDialog.goodBadAndNeutralContent.Bad}",textClass:"style-item",className:ni,value:"Bad"},{text:"${res.cellStylesDialog.goodBadAndNeutralContent.Good}",textClass:"style-item",className:ni,value:"Good"},{text:"${res.cellStylesDialog.goodBadAndNeutralContent.Neutral}",textClass:"style-item",className:ni,value:"Neutral"}]},{groupName:"${res.cellStylesDialog.dataAndModel}",commandName:p.CellStylesListContent,contextMenu:[{text:"${res.cellStyleContextMenu.modify}",commandName:p.CellStylesListContent,value:"modify"},{text:"${res.cellStyleContextMenu.delete}",className:Js,commandName:p.CellStylesListContent,value:"delete"}],groupItems:[{text:"${res.cellStylesDialog.dataAndModelContent.Calculation}",textClass:"style-item",className:ni,value:"Calculation"},{text:"${res.cellStylesDialog.dataAndModelContent.Check Cell}",textClass:"style-item",className:ni,value:"Check Cell"},{text:"${res.cellStylesDialog.dataAndModelContent.Explanatory Text}",textClass:"style-item",className:ni,value:"Explanatory Text"},{text:"${res.cellStylesDialog.dataAndModelContent.Input}",textClass:"style-item",className:ni,value:"Input"},{text:"${res.cellStylesDialog.dataAndModelContent.Linked Cell}",textClass:"style-item",className:ni,value:"Linked Cell"},{text:"${res.cellStylesDialog.dataAndModelContent.Note}",textClass:"style-item",className:ni,value:"Note"},{text:"${res.cellStylesDialog.dataAndModelContent.Output}",textClass:"style-item",className:ni,value:"Output"},{text:"${res.cellStylesDialog.dataAndModelContent.Warning Text}",textClass:"style-item",className:ni,value:"Warning Text"},{text:"${res.cellStylesDialog.dataAndModelContent.hyperlink}",textClass:"style-item",className:ni,value:"Hyperlink"}]},{groupName:"${res.cellStylesDialog.titlesAndHeadings}",commandName:p.CellStylesListContent,contextMenu:[{text:"${res.cellStyleContextMenu.modify}",commandName:p.CellStylesListContent,value:"modify"},{text:"${res.cellStyleContextMenu.delete}",className:Js,commandName:p.CellStylesListContent,value:"delete"}],groupItems:[{text:"${res.cellStylesDialog.titlesAndHeadingsContent.Heading 1}",textClass:"style-item heading1-style",className:ni,value:"Heading 1"},{text:"${res.cellStylesDialog.titlesAndHeadingsContent.Heading 2}",textClass:"style-item",className:ni,value:"Heading 2"},{text:"${res.cellStylesDialog.titlesAndHeadingsContent.Heading 3}",textClass:"style-item",className:ni,value:"Heading 3"},{text:"${res.cellStylesDialog.titlesAndHeadingsContent.Heading 4}",textClass:"style-item",className:ni,value:"Heading 4"},{text:"${res.cellStylesDialog.titlesAndHeadingsContent.Title}",textClass:"style-item",className:ni,value:"Title"},{text:"${res.cellStylesDialog.titlesAndHeadingsContent.Total}",textClass:"style-item",className:ni,value:"Total"}]},{groupName:"${res.cellStylesDialog.themedCellStyle}",commandName:p.CellStylesListContent,contextMenu:[{text:"${res.cellStyleContextMenu.modify}",commandName:p.CellStylesListContent,value:"modify"},{text:"${res.cellStyleContextMenu.delete}",className:Js,commandName:p.CellStylesListContent,value:"delete"}],groupItems:[{text:"${res.cellStylesDialog.themedCellStyleContent.20% - Accent1}",textClass:"style-item",className:ni,value:"20% - Accent1"},{text:"${res.cellStylesDialog.themedCellStyleContent.20% - Accent2}",textClass:"style-item",className:ni,value:"20% - Accent2"},{text:"${res.cellStylesDialog.themedCellStyleContent.20% - Accent3}",textClass:"style-item",className:ni,value:"20% - Accent3"},{text:"${res.cellStylesDialog.themedCellStyleContent.20% - Accent4}",textClass:"style-item",className:ni,value:"20% - Accent4"},{text:"${res.cellStylesDialog.themedCellStyleContent.20% - Accent5}",textClass:"style-item",className:ni,value:"20% - Accent5"},{text:"${res.cellStylesDialog.themedCellStyleContent.20% - Accent6}",textClass:"style-item",className:ni,value:"20% - Accent6"},{text:"${res.cellStylesDialog.themedCellStyleContent.40% - Accent1}",textClass:"style-item",className:ni,value:"40% - Accent1"},{text:"${res.cellStylesDialog.themedCellStyleContent.40% - Accent2}",textClass:"style-item",className:ni,value:"40% - Accent2"},{text:"${res.cellStylesDialog.themedCellStyleContent.40% - Accent3}",textClass:"style-item",className:ni,value:"40% - Accent3"},{text:"${res.cellStylesDialog.themedCellStyleContent.40% - Accent4}",textClass:"style-item",className:ni,value:"40% - Accent4"},{text:"${res.cellStylesDialog.themedCellStyleContent.40% - Accent5}",textClass:"style-item",className:ni,value:"40% - Accent5"},{text:"${res.cellStylesDialog.themedCellStyleContent.40% - Accent6}",textClass:"style-item",className:ni,value:"40% - Accent6"},{text:"${res.cellStylesDialog.themedCellStyleContent.60% - Accent1}",textClass:"style-item",className:ni,value:"60% - Accent1"},{text:"${res.cellStylesDialog.themedCellStyleContent.60% - Accent2}",textClass:"style-item",className:ni,value:"60% - Accent2"},{text:"${res.cellStylesDialog.themedCellStyleContent.60% - Accent3}",textClass:"style-item",className:ni,value:"60% - Accent3"},{text:"${res.cellStylesDialog.themedCellStyleContent.60% - Accent4}",textClass:"style-item",className:ni,value:"60% - Accent4"},{text:"${res.cellStylesDialog.themedCellStyleContent.60% - Accent5}",textClass:"style-item",className:ni,value:"60% - Accent5"},{text:"${res.cellStylesDialog.themedCellStyleContent.60% - Accent6}",textClass:"style-item",className:ni,value:"60% - Accent6"},{text:"${res.cellStylesDialog.themedCellStyleContent.Accent1}",textClass:"style-item",className:ni,value:"Accent1"},{text:"${res.cellStylesDialog.themedCellStyleContent.Accent2}",textClass:"style-item",className:ni,value:"Accent2"},{text:"${res.cellStylesDialog.themedCellStyleContent.Accent3}",textClass:"style-item",className:ni,value:"Accent3"},{text:"${res.cellStylesDialog.themedCellStyleContent.Accent4}",textClass:"style-item",className:ni,value:"Accent4"},{text:"${res.cellStylesDialog.themedCellStyleContent.Accent5}",textClass:"style-item",className:ni,value:"Accent5"},{text:"${res.cellStylesDialog.themedCellStyleContent.Accent6}",textClass:"style-item",className:ni,value:"Accent6"}]},{groupName:"${res.cellStylesDialog.numberFormat}",commandName:p.CellStylesListContent,contextMenu:[{text:"${res.cellStyleContextMenu.modify}",commandName:p.CellStylesListContent,value:"modify"},{text:"${res.cellStyleContextMenu.delete}",className:Js,commandName:p.CellStylesListContent,value:"delete"}],groupItems:[{text:"${res.cellStylesDialog.numberFormatContent.Comma}",textClass:"style-item",className:ni,value:"Comma"},{text:"${res.cellStylesDialog.numberFormatContent.Comma [0]}",textClass:"style-item",className:ni,value:"Comma [0]"},{text:"${res.cellStylesDialog.numberFormatContent.Currency}",textClass:"style-item",className:ni,value:"Currency"},{text:"${res.cellStylesDialog.numberFormatContent.Currency [0]}",textClass:"style-item",className:ni,value:"Currency [0]"},{text:"${res.cellStylesDialog.numberFormatContent.Percent}",textClass:"style-item",className:ni,value:"Percent"}]}];let Bse={title:"${res.cellStylesDialog.cellStyles}",text:"${res.cellStylesDialog.cellStyles}",iconClass:"ribbon-button-cellstyles",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.CellStyles,enableContext:`${m.AllowFormatCells} && !${m.IsInTableSheetDesignMode} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")',init:e=>{Vie(e.Spread,"deleteCellStyleByName"),Bie(e.Spread,"modifyCellStyleByName"),kie(e.Spread,"addAndSetStyleByName")}},Fse={title:"${res.cellStylesDialog.styleList}",text:"${res.cellStylesDialog.styleList}",commandName:p.CellStylesListContent,maxWidth:634,type:"listContent",dropdownListItemType:"menuitem",enableContext:`${m.AllowFormatCells}`,execute:async(e,t,i)=>{await Gse(e,t,i)},getState:e=>()=>{const t=e.Spread;let i=C.deepClone(e.getData(re.customCellStyleGroups));const n=C.getCustomStyles(e.Spread)||{},a=f_(n).slice(0,1e3);i[0].groupItems=a.map(l=>({text:l.name,textClass:"style-item",className:ni,value:l.name}));const r=e.getData(re.buildInCustomCellStyle),o=Nse(t,l=>{var c;return(c=n[l])!=null?c:r[l]});i[0].groupItems.length>0&&(i[0].visible=!0,i[0].itemRender=o);for(let l=2;l<i.length;l++)i[l].itemRender=o;return e.setData(re.customCellStyleGroups,C.deepClone(i)),C.CloneJsonObj(i)},init:e=>{e.setData(re.customCellStyleGroups,C.deepClone(b_));const t=p0(e.Spread);e.setData(re.buildInCustomCellStyle,t)}};async function Gse(e,t,i){let n=e.getData(re.buildInCustomCellStyleNameMap);if(t==="delete")Vse(e,i);else if(t==="modify")Hse(e,i,n);else{let a=C.getCustomStyles(e.Spread)||{};if(i){const r=e.getData(re.buildInCustomCellStyle);Rie(e.Spread,(n==null?void 0:n[i])||i,r,a),u_(e)}}}function Vse(e,t){var n;const i=C.deepClone(e.getData(re.customCellStyleGroups));if(i){for(let a=0;a<i.length;a++){const r=(n=i[a].groupItems)!=null?n:[];let o=r.findIndex(l=>l.value===t);if(o>=0){Hie(e.Spread,t),r.splice(o,1),r.length===0&&(i[a].visible=!1);break}}e.setData(re.customCellStyleGroups,i)}}async function Hse(e,t,i){var o;let n=C.getCustomStyles(e.Spread,i)||{};const a=e.getData(re.buildInCustomCellStyle);t=(i==null?void 0:i[t])||t;let r=(o=n[t])!=null?o:a[t];if(r){let l=$s(e.Spread,r,jb,!0);l.alignmentTabOption&&(l.alignmentTabOption.hideMerged=!0);let c=await e._showDialog(G.FormatDialogTemplate,l);if(c){let d=cx(c);d&&(d.name=t,Fie(e.Spread,t,d),a[t]&&(a[t]=d,e.setData(re.buildInCustomCellStyle,a)))}}}function zse(e,t){let i={},n=xm.CellButtons;for(let a of n){let r=(t==null?void 0:t[a])||a,o=e.getNamedStyle(r);if(o)i[a]=o;else switch(a){case"colorPicker-cellbutton":i[r]={name:r,icon:"gcui-ribbon-colorpickercellbutton",cellButtons:[{command:"openColorPicker",imageType:5,position:1,visibility:0}]};break;case"datetimepicker-cellbutton":i[r]={name:r,icon:"gcui-ribbon-calendarcellbutton",cellButtons:[{command:"openDateTimePicker",imageType:5,position:1,visibility:0}],dropDowns:[Ose]};break;case"dateRangePicker-cellbutton":i[r]={name:r,icon:"gcui-ribbon-calendarcellbutton",cellButtons:[{command:"openDateTimePicker",imageType:5,position:1,visibility:0}],dropDowns:[Ese],formatter:'=IF(ISBLANK(@), "", TEXT(@.start, "m/d/yyyy")&"~"&TEXT(@.end, "m/d/yyyy"))'};break;case"timepicker-cellbutton":i[r]={name:r,icon:"gcui-ribbon-timecellbutton",cellButtons:[{command:"openTimePicker",imageType:5,position:1,visibility:0}],dropDowns:[_se]};break;case"calculator-cellbutton":i[r]={name:r,icon:"gcui-ribbon-calculatorcellbutton",cellButtons:[{command:"openCalculator",imageType:5,position:1,visibility:0}],dropDowns:[]};break;case"monthpicker-cellbutton":i[r]={name:r,icon:"gcui-ribbon-monthcellbutton",cellButtons:[{command:"openMonthPicker",imageType:5,position:1,visibility:0}],dropDowns:[Rse]};break;case"slider-cellbutton":i[r]={name:r,icon:"gcui-ribbon-slidercellbutton",cellButtons:[{command:"openSlider",imageType:5,position:1,visibility:0}],dropDowns:[Mse]};break;case"sliderRange-cellbutton":i[r]={name:r,icon:"gcui-ribbon-slidercellbutton",cellButtons:[{command:"openSlider",imageType:5,position:1,visibility:0}],dropDowns:[kse],formatter:'=IF(ISBLANK(@), "", @.start&"~"&@.end)'};break;case"okcancel-cellbutton":i[r]={name:r,icon:"gcui-ribbon-okcancelcellstyle",cellButtons:[{command:"commitInputNavigationDown",imageType:4,position:1,visibility:2},{command:"cancelInput",imageType:3,position:1,visibility:2}],dropDowns:[]};break;case"clear-cellbutton":i[r]={name:r,icon:"gcui-ribbon-clearcellstyle",cellButtons:[{command:"clear",imageType:2,position:1,visibility:0}],dropDowns:[]};break}}return i}function jse(e){let t=xm.GoodBadAndNeutral,i={};for(let n of t){let a=e.getNamedStyle(n);if(a)i[n]=a;else switch(n){case"Normal":i.normal={name:"Normal",backColor:void 0,foreColor:void 0};break;case"Bad":i.bad={name:"Bad",backColor:"#FFC7CE",foreColor:"#9C0006"};break;case"Good":i.good={name:"Good",backColor:"#C6EFCE",foreColor:"#006100"};break;case"Neutral":i.neutral={name:"Neutral",backColor:"#FFEB9C",foreColor:"#9C6500"};break}}return i}const h0={name:"Hyperlink",font:"14.6667px Calibri",themeFont:"Body",foreColor:"hyperlink",textDecoration:1};function Wse(e){let t=xm.DataAndModel,i={};for(let n of t){let a=e.getNamedStyle(n);if(a)i[n]=a;else switch(n){case"Calculation":i.Calculation={name:"Calculation",backColor:"#F2F2F2",foreColor:"#FCA957",border:Wb,font:pc,themeFont:"Body"};break;case"Check Cell":i["Check Cell"]={name:"Check Cell",backColor:"#A5A5A5",foreColor:"#FFFFFF",border:"medium double black",font:pc,themeFont:"Body"};break;case"Explanatory Text":i["Explanatory Text"]={name:"Explanatory Text",foreColor:"#7F7F7F",font:"italic bold 14.6667px Arial",themeFont:"Body"};break;case"Input":i.Input={name:"Input",foreColor:"#3F3F76",backColor:"#FFCC99",border:Wb,font:pc,themeFont:"Body"};break;case"Linked Cell":i["Linked Cell"]={name:"Linked Cell",foreColor:"#FCA957",borderBottom:"medium double #FDD3A9",font:pc,themeFont:"Body"};break;case"Note":i.Note={name:"Note",backColor:"#FFFFCC",border:Wb,font:"14.6667px Arial",themeFont:"Body"};break;case"Output":i.Output={name:"Output",backColor:"#F2F2F2",border:Wb,font:pc,themeFont:"Body"};break;case"Warning Text":i["Warning Text"]={name:"Warning Text",foreColor:"#FF3030",font:"14.6667px Arial",themeFont:"Body"};break;case"Hyperlink":i.Hyperlink=h0;break}}return i}function Zse(e){let t=xm.TitlesAndHeadings,i={};for(let n of t){let a=e.getNamedStyle(n);if(a)i[n]=a;else switch(n){case"Heading 1":i["Heading 1"]={name:"Heading 1",foreColor:"Text 2",font:"bold 20px Arial",themeFont:"Body",borderBottom:"medium solid Accent 1"};break;case"Heading 2":i["Heading 2"]={name:"Heading 2",foreColor:"Text 2",font:"bold 17px Arial",themeFont:"Body",borderBottom:"medium solid Accent 1 40"};break;case"Heading 3":i["Heading 3"]={name:"Heading 3",foreColor:"Text 2",font:pc,themeFont:"Body",borderBottom:"thin solid Accent 1 40"};break;case"Heading 4":i["Heading 4"]={name:"Heading 4",foreColor:"Text 2",font:pc,themeFont:"Body"};break;case"Title":i.Title={name:"Title",foreColor:"Text 2",font:"bold 24px Century",themeFont:"Headings"};break;case"Total":i.Total={name:"Total",font:pc,themeFont:"Body",borderTop:"thin solid #1F497D",borderBottom:"medium double Accent 1"};break}}return i}function Use(e){let t={},i=s.cellStylesDialog.themedCellStyleContent,n="black";for(let a of Object.keys(i)){let r=e.getNamedStyle(a);if(r)t[a]=r;else{let o="",l=a.split("-"),c;if(l.length===1)c=l[0].substr(l[0].length-1),o="Accent "+c+" 0",n="Background 1 0";else if(l.length===2){c=l[1].substr(l[1].length-1);let d=100-parseInt(l[0],10);o="Accent "+c+" "+d,n="Text 1 0"}t[a]={name:a,backColor:o,foreColor:n}}}return t}function Jse(e){let t=xm.NumberFormat,i={};for(let n of t){let a=e.getNamedStyle(n);if(a)i[n]=a;else switch(n){case"Comma":i.Comma={name:"Comma",formatter:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'};break;case"Comma [0]":i["Comma [0]"]={name:"Comma [0]",formatter:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)'};break;case"Currency":i.Currency={name:"Currency",formatter:'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'};break;case"Currency [0]":i["Currency [0]"]={name:"Currency [0]",formatter:'_($* #,##0_);_($* (#,##0);_($* "-"_);_(@_)'};break;case"Percent":i.Percent={name:"Percent",formatter:"0%"};break}}return i}function p0(e,t){let i=zse(e,t),n=jse(e),a=Wse(e),r=Zse(e),o=Use(e),l=Jse(e);return Yse(i,n,a,r,o,l)}function Yse(...e){const t={};let i=[];for(let a=0;a<e.length-0;a++)i[a]=e[a+0];let n=i.length;for(let a=0;a<n;a++){let r=i[a];for(let o of Object.keys(r)){let l=r[o];l instanceof GC.Spread.Sheets.Style||(l=qse(l));let c=l.name;t[c]=l}}return t}function qse(e){e.borderTop&&(e.borderTop=mc(e.borderTop)),e.borderBottom&&(e.borderBottom=mc(e.borderBottom)),e.borderLeft&&(e.borderLeft=mc(e.borderLeft)),e.borderRight&&(e.borderRight=mc(e.borderRight)),e.border&&(e.borderTop=mc(e.border),e.borderBottom=mc(e.border),e.borderLeft=mc(e.border),e.borderRight=mc(e.border));let t=new GC.Spread.Sheets.Style;return Object.assign(t,e),t}function mc(e){return Ise(e)?jb:e instanceof GC.Spread.Sheets.LineBorder?e:typeof e=="string"?Kse(e):jb}function Kse(e){if(!e)return jb;let t=e.split(" "),i=GC.Spread.Sheets.LineStyle.thin,n;if(t.length>=3)return(t[0]==="thin"||t[0]==="medium"||t[0]==="thick")&&(i=GC.Spread.Sheets.LineStyle[t[0]]),t[1]!=="solid"&&(i=GC.Spread.Sheets.LineStyle[t[1]]),n=t.slice(2).join(" "),new GC.Spread.Sheets.LineBorder(n,i)}const S_=e=>{const t=e.Spread;if(t){const i=p0(t,e.getData(re.buildInCustomCellStyleNameMap)),n=C.getCustomStyles(t)||{},a=C.deepClone(b_);a[0].groupItems=f_(n).map(r=>({text:r.name,textClass:"style-item",className:ni,value:r.name})),a[0].groupItems.length>0&&(a[0].visible=!0),e.setData(re.buildInCustomCellStyle,i),e.setData(re.customCellStyleGroups,a),e.setData(re.tableStyleKey,t.customTableThemes.all()),e.setData(re.buildCellStyleList,p0(e.Spread))}},Qse=Object.freeze(Object.defineProperty({__proto__:null,CellStyles:Bse,CellStylesListContent:Fse,hyperlinkNamedStyle:h0,updateCellStylesForImport:S_},Symbol.toStringTag,{value:"Module"}));let Xse=function(){return{templateName:G.NewCellStyleDialogTemplate,title:s.cellStylesDialog.cellStylesDialogTitle,content:[{type:"FlexContainer",children:[{type:"ColumnSet",margin:"5px 0",children:[{type:"Column",children:[{type:"TextBlock",style:"line-height:25px",text:s.newCellStyleDialog.styleName}],width:"70px"},{type:"Column",children:[{type:"TextEditor",bindingPath:"styleName"}],width:"stretch"}]},{type:"ColumnSet",children:[{type:"Column",width:"180px"},{type:"Column",children:[{type:"Button",text:s.newCellStyleDialog.format,bindingPath:"customCellStyles",template:G.FormatDialogTemplate}],width:"80px"}]}]}]}},$se={text:"${res.cellStylesDialog.newCellStyle}",iconClass:"gc-ribbon-button-new-cell-style-element",commandName:p.NewCellStyle,execute:async e=>{await Zie(e)}};_e(G.NewCellStyleDialogTemplate,Xse);const ece=Object.freeze(Object.defineProperty({__proto__:null,newCellStyle:$se},Symbol.toStringTag,{value:"Module"}));let tce={title:"${res.cellStatesDialog.cellStates}",text:"${res.cellStatesDialog.cellStates}",iconClass:"ribbon-button-cellstates",bigButton:"=ribbonHeight>toolbarHeight",direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")',commandName:p.CellStates,enableContext:`${m.AllowFormatCells}`};const ice=Object.freeze(Object.defineProperty({__proto__:null,CellStates:tce},Symbol.toStringTag,{value:"Module"}));var nce=Object.getOwnPropertyDescriptor,ace=(e,t,i,n)=>{for(var a=n>1?void 0:n?nce(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};const rce="200px",oce="40px",Zb=2,Ub=1,lce=2;let m0=class extends yt{get c_formatPreview(){return this.getComponent(".format-preview")}get c_noPreview(){return this.getComponent(".no-preview")}get c_container(){return this.getComponent(".gc-format-rule-preview")}getTemplate(){return sce}constructor(e,t){var i;super(e,t),this._designerSpread=(i=t.spread)!=null?i:Pe.getContextSpread()}realRender(){var r;super.realRender(),(r=this.spreadTemplate)==null||r.dispose(),this.spreadTemplate=void 0;let e=this.options.width||rce,t=this.options.height||oce,i=this.options.margin||lce+"px",n=C.isNullOrUndefined(this.options.border)?`1px solid ${Kt().colorStroke||"black"}`:this.options.border;this.c_noPreview.style.height=t,this.c_noPreview.style.lineHeight=t,this.c_container.style.width=e,this.c_container.style.height=t,this.c_container.style.border=n;const a=this._designerSpread;window.requestAnimationFrame(()=>{this.spreadTemplate=new dd(this.c_formatPreview,{type:"SpreadTemplate",width:String(parseInt(e,10)-parseInt(i,10)*2)+"px",height:String(parseInt(t,10)-parseInt(i,10)*2)+"px",data:{text:s.fontPicker.previewText},useTheme:!1,enableAccessibility:a==null?void 0:a.options.enableAccessibility,initSpreadFunctions:[bl.initAsCell,function(o,l){var u;let c=C.getActiveSheet(o),d=(u=C.getActiveSheet(a))==null?void 0:u.currentTheme();d!==c.currentTheme()&&c.currentTheme(d),c.setRowCount(2),c.setColumnCount(2),c.setColumnWidth(0,c.getColumnWidth(0)-Ub-Zb),c.setRowHeight(0,c.getRowHeight(0)-Ub-Zb),c.setColumnWidth(1,Ub),c.setRowHeight(1,Ub),c.options.sheetAreaOffset.left=Zb,c.options.sheetAreaOffset.top=Zb,c.getCell(0,0).text(s.fontPicker.previewText)}],updateUIFunctions:[function(o,l){var d;let c=l.value;if(c){let u=new GC.Spread.Sheets.Style,h={},g=c.numberTabOption;g&&g.formatter&&(u.formatter=g.formatter);let f=c.fontTabOption;f&&(f.fontStyle&&f.fontStyle.indexOf("italic")!==-1&&(h.fontStyle="italic"),f.fontStyle&&f.fontStyle.indexOf("bold")!==-1&&(h.fontWeight="bold"),u.foreColor=Ae.themeColorToRGB(C.getActualActiveSheet(a!=null?a:o),f.foreColor||""),u.textDecoration=f.fontUnderlineListAndEffects&&f.fontUnderlineListAndEffects.textDecoration);let b=c.borderTabOption;b&&(b.borderBottom&&(u.borderBottom=new GC.Spread.Sheets.LineBorder(b.borderBottom.color,b.borderBottom.style)),b.borderLeft&&(u.borderLeft=new GC.Spread.Sheets.LineBorder(b.borderLeft.color,b.borderLeft.style)),b.borderTop&&(u.borderTop=new GC.Spread.Sheets.LineBorder(b.borderTop.color,b.borderTop.style)),b.borderRight&&(u.borderRight=new GC.Spread.Sheets.LineBorder(b.borderRight.color,b.borderRight.style)),b.diagonalDown&&(u.diagonalDown=new GC.Spread.Sheets.LineBorder(b.diagonalDown.color,b.diagonalDown.style)),b.diagonalUp&&(u.diagonalUp=new GC.Spread.Sheets.LineBorder(b.diagonalUp.color,b.diagonalUp.style)));let S=c.decorationTabOption;if(S){let L={position:0,size:0,color:""};if(S.LT&&(L.position=GC.Spread.Sheets.CornerPosition.leftTop),S.RT&&(L.position|=GC.Spread.Sheets.CornerPosition.rightTop),S.LB&&(L.position|=GC.Spread.Sheets.CornerPosition.leftBottom),S.RB&&(L.position|=GC.Spread.Sheets.CornerPosition.rightBottom),S.cornerFoldSize!==void 0&&(L.size=S.cornerFoldSize),S.cornerFoldColor!==void 0&&(L.color=S.cornerFoldColor),u.decoration=u.decoration||{},u.decoration.cornerFold=L,S.styleDecorationIcons&&S.styleDecorationIcons.length>0){let T=S.styleDecorationIcons.filter(w=>!C.isEmpty(w.src));T.length>0&&(u.decoration.icons=C.deepClone(T))}}let y=c.fillTabOption;if(y){let L=y.backColor||"";typeof L=="string"&&(L=Ae.themeColorToRGB(C.getActualActiveSheet(a!=null?a:o),L)),u.backColor=L}u.vAlign=GC.Spread.Sheets.VerticalAlign.center,u.hAlign=GC.Spread.Sheets.HorizontalAlign.center;let v=C.getActiveSheet(o),x=(d=C.getActiveSheet(a))==null?void 0:d.currentTheme();x!==v.currentTheme()&&v.currentTheme(x),v.setStyle(0,0,u),xd.customFont(v,0,0,h)}}]}),this.spreadTemplate.host.style.margin=i,this.spreadTemplate.RenderAll()})}onValueChanged(e,t){let i=!1;this._value&&(i=!0,setTimeout(()=>{this.spreadTemplate&&(this.spreadTemplate.value=this._value)},0)),this.c_formatPreview.style.display=i?"":"none",this.c_noPreview.style.display=i?"none":""}onBindingDataChange(e){this.spreadTemplate&&(this.spreadTemplate.value=C.CloneJsonObj(e))}dispose(){var e;(e=this.spreadTemplate)==null||e.dispose(),this.spreadTemplate=void 0,this._designerSpread=void 0}};m0=ace([Ue.Register("FormatRulePreview")],m0);const sce=`
|
|
350
350
|
<div class="gc-format-rule-preview">
|
|
@@ -371,7 +371,7 @@ e.repeatRowStart(x)}else b.repeatRowAvailable=!1;return aoe(b.headerAndFooter),b
|
|
|
371
371
|
</div>
|
|
372
372
|
<div class="cellstates-manage-content"></div>
|
|
373
373
|
</div>
|
|
374
|
-
`;let bce=function(){return{templateName:G.NewCellStateTemplate,title:s.cellStatesDialog.title,content:[{type:"FlexContainer",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",margin:"0 10px 0 5px",style:"line-height:25px",text:s.cellStatesDialog.selectStateType}]},{type:"Column",children:[{type:"ListComboEditor",visibleWhen:"isReportSheet!=true",bindingPath:"state",items:[{text:s.cellStatesDialog.hover,value:GC.Spread.Sheets.CellStatesType.hover},{text:s.cellStatesDialog.invalid,value:GC.Spread.Sheets.CellStatesType.invalid},{text:s.cellStatesDialog.readonly,value:GC.Spread.Sheets.CellStatesType.readonly},{text:s.cellStatesDialog.edit,value:GC.Spread.Sheets.CellStatesType.edit},{text:s.cellStatesDialog.active,value:GC.Spread.Sheets.CellStatesType.active},{text:s.cellStatesDialog.selected,value:GC.Spread.Sheets.CellStatesType.selected},{text:s.cellStatesDialog.dirty,value:GC.Spread.Sheets.CellStatesType.dirty},{text:s.cellStatesDialog.invalidFormula,value:GC.Spread.Sheets.CellStatesType.invalidFormula}]},{type:"ListComboEditor",visibleWhen:"isReportSheet=true",bindingPath:"state",items:[{text:s.cellStatesDialog.hover,value:GC.Spread.Sheets.CellStatesType.hover},{text:s.cellStatesDialog.invalid,value:GC.Spread.Sheets.CellStatesType.invalid},{text:s.cellStatesDialog.readonly,value:GC.Spread.Sheets.CellStatesType.readonly},{text:s.cellStatesDialog.edit,value:GC.Spread.Sheets.CellStatesType.edit},{text:s.cellStatesDialog.active,value:GC.Spread.Sheets.CellStatesType.active},{text:s.cellStatesDialog.selected,value:GC.Spread.Sheets.CellStatesType.selected}]}],width:"180px"}]},{type:"LabelContainer",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",margin:"5px 10px 0 5px",style:"line-height:25px",text:s.cellStatesDialog.range}]},{type:"Column",children:[{type:"RangeSelect",title:s.cellStatesDialog.title,needSheetName:!1,absoluteReference:!1,margin:"3px",bindingPath:"range"}],width:"180px"}]}],text:s.cellStatesDialog.selectRange},{type:"LabelContainer",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",margin:"0 10px 0 0",style:"line-height:40px",text:s.conditionalFormatting.newFormattingRule.preview.description}]},{type:"Column",children:[{type:"FormatRulePreview",bindingPath:"style"}],width:"200px"},{type:"Column",children:[{type:"Button",margin:"10px 0 0 10px",bindingPath:"style",text:s.conditionalFormatting.newFormattingRule.preview.buttonText,template:G.FormatDialogTemplate}],width:"80px"}]}],text:s.cellStatesDialog.selectStyle}]}]}};function y_(e){let t=C.getActiveSheet(e),i=t.getSelections(),n;i&&i.length>0&&(n=Ht.parseRangeToExpString(i[0],!1,0,0));let a={dialogOption:{activeTab:dt.Font},numberTabOption:{cellValue:"12345",category:{activeTab:"general"},formatter:"General"},borderTabOption:{},alignmentTabOption:{textIndent:0,orientation:{textOrientation:0,isVerticalText:!1}},fillTabOption:{backColor:""},cellButtonTabOption:{cellButtons:[]},decorationTabOption:{styleDecorationIcons:[]},protectionTabOption:{locked:!1,hidden:!1,allowEditInCell:!0},paddingTabOption:{text:"",alignment:GC.Spread.Sheets.LabelAlignment.topLeft,font:{fontFamily:s.fontPicker.fontFamilies.Calibri,fontSize:"11",fontStyle:!1,fontWeight:!1,foreColor:"#808080"},visibility:GC.Spread.Sheets.LabelVisibility.auto,margin:{top:0,right:0,left:0,bottom:0},padding:{top:0,right:0,left:0,bottom:0}}};return a.fontTabOption||(a.fontTabOption={fontFamily:"Calibri",fontStyle:"normal",fontSize:"11",fontWeight:"normal",foreColor:"#000000",fontUnderlineListAndEffects:{fontUnderlineList:"none",fontEffects:{fontStrikethrough:!1},textDecoration:0}}),{range:n,style:a,state:GC.Spread.Sheets.CellStatesType.hover,sheetName:t.name(),isReportSheet:C._isReportSheet(e&&e.getActiveSheetTab())}}function Sce(e){let t=[],i=C.getActiveSheet(e).cellStates.all();return i&&i.forEach(n=>{let a={state:n.state};n.range&&(a.range=Ht.parseRangeToExpString(n.range,!1)),n.style&&(a.style=$s(e,n.style,"1234")),t.unshift(a)}),t}function Cce(e,t){let i={},n=new GC.Spread.Sheets.Style;for(const a of Object.keys(e))["borderBottom","borderLeft","borderRight","borderTop","diagonalDown","diagonalUp"].indexOf(a)>-1&&(i[a]=e[a],delete e[a]);return Object.keys(i).length>0&&yce(n,i),vce(n,e,t),n}function yce(e,t){t.borderTop&&(e.borderTop=new GC.Spread.Sheets.LineBorder(t.borderTop.color,t.borderTop.style)),t.borderBottom&&(e.borderBottom=new GC.Spread.Sheets.LineBorder(t.borderBottom.color,t.borderBottom.style)),t.borderRight&&(e.borderRight=new GC.Spread.Sheets.LineBorder(t.borderRight.color,t.borderRight.style)),t.borderLeft&&(e.borderLeft=new GC.Spread.Sheets.LineBorder(t.borderLeft.color,t.borderLeft.style)),t.diagonalUp&&(e.diagonalUp=new GC.Spread.Sheets.LineBorder(t.diagonalUp.color,t.diagonalUp.style)),t.diagonalDown&&(e.diagonalDown=new GC.Spread.Sheets.LineBorder(t.diagonalDown.color,t.diagonalDown.style))}function vce(e,t,i){let n=t,a,r,o,l;for(const c of Object.keys(n))if(c==="font"){let d=n[c];for(const u of Object.keys(d))if(u==="fontSize")a=d[u]+"pt";else if(u==="fontStyle"&&d[u]){let h=d[u];h==="italic"?(o="italic",l="normal"):h==="bold"?(o="normal",l="bold"):h==="bold italic"?(o="italic",l="bold"):h==="normal"&&(o="normal",l="normal")}else u==="fontFamily"&&d[u]&&(r=d[u])}if(o||a||l||r){r=r||"Calibri",a=a||"11pt";let c=`${o||""} ${l||""} ${a} ${r}`,d=C.getMeasureSpan();d.style.font=c,e.font=d.style.font||void 0}for(const c of Object.keys(n))if(["LT","RT","LB","RB","cornerFoldSize","cornerFoldColor","styleDecorationIcons"].indexOf(c)>-1){xce(n);break}for(const c of Object.keys(n))if(c==="formatter"){let d=n[c]&&n[c].trim(),u=!0;if(d&&d[0]!=="="&&d.match(/\{\{=.*\}\}/)===null)try{new GC.Spread.Formatter.GeneralFormatter(d,"")}catch(h){u=!1,i==null||i._showMessageBox(h.message,s.title,Re.warning)}u&&(e[c]=n[c])}else c!=="merged"&&c!=="font"&&(e[c]=n[c])}function xce(e){let t={position:0,size:0,color:""};if(e.LT&&(t.position=GC.Spread.Sheets.CornerPosition.leftTop),delete e.LT,e.RT&&(t.position|=GC.Spread.Sheets.CornerPosition.rightTop),delete e.RT,e.LB&&(t.position|=GC.Spread.Sheets.CornerPosition.leftBottom),delete e.LB,e.RB&&(t.position|=GC.Spread.Sheets.CornerPosition.rightBottom),delete e.RB,e.cornerFoldSize!==void 0&&(t.size=e.cornerFoldSize,delete e.cornerFoldSize),e.cornerFoldColor!==void 0&&(t.color=e.cornerFoldColor,delete e.cornerFoldColor),t.size===0||t.color===""||(C.isNullOrUndefined(e.decoration)?e.decoration={cornerFold:t}:e.decoration.cornerFold=t),!C.isNullOrUndefined(e.styleDecorationIcons)){let i=e.styleDecorationIcons.filter(n=>!C.isEmpty(n.src));C.isNullOrUndefined(e.decoration)?C.isEmpty(i)?e.decoration=void 0:e.decoration={icons:i}:C.isEmpty(i)?delete e.decoration.icons:e.decoration.icons=i,delete e.styleDecorationIcons}}function Lce(e,t){let i="Designer."+t;e.commandManager().register(i,x_,void 0,!1,!1,!1,!1)}function v_(e,t,i){oe.runCommand(e,"addCellState",x_,{cellStates:t,isAddCellState:i})}class Tce extends oe.DesignerActionBase{executeImp(t,i,n){let a=i.cellStates,r=C.getActiveSheet(t);if(!i.isAddCellState){let l=r.cellStates;l.all().forEach(d=>{l.remove(d.range,d.state)})}let o=C.getSheetOrSheetTabByName(t,i.sheetName).cellStates;for(let l of a)if(l&&l.range){let c=Ht.parseExpStringToRanges(l.range,r);if(c!=null){let d=c[0].ranges[0];d&&o.add(d,l.state,Cce(l.style,t))}}}}let x_={canUndo:!0,execute:function(e,t,i){return new Tce(e,t).execute(e,t,i)}};_e(G.NewCellStateTemplate,bce);let wce={text:"${res.cellStatesDialog.add}",iconClass:"ribbon-button-add-cellstates",commandName:p.AddCellState,execute:async(e,t)=>{let i=y_(e.Spread),n=Ke(i.style),a=await e._showDialog(G.NewCellStateTemplate,i,Dce);if(a){if(a.style){let r=Cn(n,a.style);a.style=r}v_(e.Spread,[a],!0)}},init:e=>{Lce(e.Spread,"addCellState")}};function Dce(e,t){var a;e.range.indexOf("=")===-1&&(e.range="=".concat(e.range));let i=(a=Pe.getContextSpread())==null?void 0:a.getSheetFromName(e.sheetName);if(!i)return!1;let n=Ht.parseExpStringToRanges(e.range,i);return!n||n.length!==1||n[0].sheetName!==e.sheetName?(t==null||t._showMessageBox(s.cellStatesDialog.invalidSheet,s.title,Re.error),!1):!0}const Ace=Object.freeze(Object.defineProperty({__proto__:null,addCellStatesCommand:wce},Symbol.toStringTag,{value:"Module"}));let Pce=function(){return{templateName:G.CellStateManagerTemplate,title:s.cellStatesDialog.manage,content:[{type:"FlexContainer",children:[{type:"TextBlock",text:s.cellStatesDialog.list},{type:"CellStateManager",bindingPath:"rules"}]}]}};_e(G.CellStateManagerTemplate,Pce);let Ice={text:"${res.cellStatesDialog.manage}",iconClass:"ribbon-button-manage-cellstates",commandName:p.ManageCellState,execute:async(e,t)=>{let i={rules:{ruleItems:Sce(e.Spread),newItem:y_(e.Spread)}},n=Ke(i.rules.newItem.style);i.rules.newItem.style.protectionTabOption&&i.rules.newItem.style.protectionTabOption.allowEditInCell===void 0&&(i.rules.newItem.style.protectionTabOption.allowEditInCell=!1);let a=await e._showDialog(G.CellStateManagerTemplate,i);if(!a)return;let r=e.Spread;r.suspendPaint();try{let o=[];for(let l=a.rules.ruleItems.length-1;l>=0;l--){let c=a.rules.ruleItems[l];if(c){let d=Cn(n,c.style);c.style=d}o.push(c)}v_(r,o)}finally{r.resumePaint()}}};const Mce=Object.freeze(Object.defineProperty({__proto__:null,managerCellStates:Ice},Symbol.toStringTag,{value:"Module"}));function kce(){return{type:"FlexContainer",className:"gc-rule-style-combo-editor",children:[{type:"ListComboEditor",id:"c_style",popupWidth:220,items:[{text:s.conditionalFormatting.withStyle.lightRedFill_DarkRedText,value:"lightRedFill_DarkRedText"},{text:s.conditionalFormatting.withStyle.yellowFill_DarkYellowText,value:"yellowFill_DarkYellowText"},{text:s.conditionalFormatting.withStyle.greenFill_DarkGreenText,value:"greenFill_DarkGreenText"},{text:s.conditionalFormatting.withStyle.lightRedFill,value:"lightRedFill"},{text:s.conditionalFormatting.withStyle.redText,value:"redText"},{text:s.conditionalFormatting.withStyle.redBorder,value:"redBorder"},{text:s.conditionalFormatting.withStyle.customFormat,value:"customFormat"}]}]}}var Rce=Object.getOwnPropertyDescriptor,_ce=(e,t,i,n)=>{for(var a=n>1?void 0:n?Rce(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};let L_=class extends Bt{constructor(){super(...arguments),this._dialogOwner=Pe.getDialogOwner()}set value(e){this._value=e}get value(){let e={};switch(this.c_style.selectIndex){case 0:e={fontTabOption:{foreColor:"#8B0000"},fillTabOption:{backColor:"#FFB6C1"}};break;case 1:e={fontTabOption:{foreColor:"#BDB76B"},fillTabOption:{backColor:"#F0E68C"}};break;case 2:e={fontTabOption:{foreColor:"#006400"},fillTabOption:{backColor:"#90EE90"}};break;case 3:e={fillTabOption:{backColor:"#FFB6C1"}};break;case 4:e={fontTabOption:{foreColor:"#8B0000"}};break;case 5:e={borderTabOption:{borderBottom:new GC.Spread.Sheets.LineBorder("#8B0000",1),borderLeft:new GC.Spread.Sheets.LineBorder("#8B0000",1),borderTop:new GC.Spread.Sheets.LineBorder("#8B0000",1),borderRight:new GC.Spread.Sheets.LineBorder("#8B0000",1)}};break;case 6:e=this._value;break}return e}get c_style(){return this.getComponent("c_style")}getComponentJson(){return[kce()]}raiseValueChanged(){this.fire(Bt.ValueChanged,this._options)}onMounted(){let e=this.c_style&&this.c_style.value;this.c_style&&!e&&(this.c_style.value="lightRedFill_DarkRedText")}_attachEvent(){this.c_style.on(zt.ValueChanged,()=>{this.c_style.value==="customFormat"&&this.onCustomFormatClick()})}async onCustomFormatClick(){this._value=this._value||{numberTabOption:{cellValue:"12345"},fontTabOption:{foreColor:"",fontFamily:"",fontSize:"",fontStyle:"normal",fontWeight:"normal",textDecoration:GC.Spread.Sheets.TextDecorationType.none,disableFontFamily:!0,disableFontSize:!0,disableFontWeight:!0}},this._value.dialogOption={activeTab:dt.Font,showTabList:[dt.Number,dt.Font,dt.Border,dt.Fill]};let e=await this._dialogOwner._showDialog(G.ConditionalFormatDialogTemplate,this._value);e&&(this._value=e)}beforeDestroy(){this.raiseValueChanged()}};L_=_ce([Ue.Register("RuleStyleComboEditor")],L_);function Yo(e){let t=parseFloat(e);return!isNaN(t)&&isFinite(t)?t:e}function T_(e){let t=document.createElement("span");t.style.font=e;let i=t.style;return{fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight}}function ra(e,t){let i=new GC.Spread.Sheets.Style;if(e){e.numberTabOption&&e.numberTabOption.formatter!==void 0&&e.numberTabOption.formatter!=="General"&&(i.formatter=e.numberTabOption.formatter);let n;if(t){let a=C.getActualActiveSheet(t);a&&(n=a.getActualStyle(a.getActiveRowIndex(),a.getActiveColumnIndex()))}if(e.fontTabOption){let a="",r="",o="",l="",c=!1;if(n&&n.font&&({fontStyle:a,fontWeight:r,fontSize:o,fontFamily:l}=T_(n.font)),e.fontTabOption.fontStyle!==void 0&&(a=e.fontTabOption.fontStyle,c=!0),e.fontTabOption.fontWeight!==void 0&&(r=e.fontTabOption.fontWeight,c=!0),e.fontTabOption.fontSize!==void 0&&e.fontTabOption.fontSize!==""&&(o=e.fontTabOption.fontSize+"pt",c=!0),e.fontTabOption.fontFamily!==void 0&&e.fontTabOption.fontFamily!==""&&(l=e.fontTabOption.fontFamily,c=!0),c){i.fontWeight=r,i.fontStyle=a,e.fontTabOption.disableFontFamily!==!0&&(i.fontFamily=l),e.fontTabOption.disableFontSize!==!0&&(i.fontSize=o);let u=i.font,h=new RegExp("bold","g");if(u!=null&&u.match(h)){let g=u.match(h);g&&g.length===2&&(u=u.replace(/bold/i,"").trim())}i.font=u}let d=e.fontTabOption.fontUnderlineListAndEffects;d&&d.textDecoration!==void 0&&(i.textDecoration=d.textDecoration),e.fontTabOption.foreColor!==void 0&&(i.foreColor=e.fontTabOption.foreColor)}e.fillTabOption&&e.fillTabOption.backColor!==void 0&&(i.backColor=e.fillTabOption.backColor),e.borderTabOption&&(e.borderTabOption.borderTop&&(i.borderTop=Uu(e.borderTabOption.borderTop)),e.borderTabOption.borderBottom&&(i.borderBottom=Uu(e.borderTabOption.borderBottom)),e.borderTabOption.borderLeft&&(i.borderLeft=Uu(e.borderTabOption.borderLeft)),e.borderTabOption.borderRight&&(i.borderRight=Uu(e.borderTabOption.borderRight)),e.borderTabOption.diagonalUp&&(i.diagonalUp=Uu(e.borderTabOption.diagonalUp)),e.borderTabOption.diagonalDown&&(i.diagonalDown=Uu(e.borderTabOption.diagonalDown))),e.protectionTabOption&&(C.isNullOrUndefined(e.protectionTabOption.locked)||(i.locked=e.protectionTabOption.locked),C.isNullOrUndefined(e.protectionTabOption.hidden)||(i.hidden=e.protectionTabOption.hidden),C.isNullOrUndefined(e.protectionTabOption.allowEditInCell)||(i.allowEditInCell=e.protectionTabOption.allowEditInCell))}return i}function Uu(e){if(!e||e instanceof GC.Spread.Sheets.LineBorder)return e;let t=e.color||void 0,i=e.style||void 0;return new GC.Spread.Sheets.LineBorder(t,i)}const w_="=";function Jb(e,t){let i={type:"cellValue",cellValue:{operator:"between"},specificText:{operator:"containing"},dateOccurring:{operator:"yesterday"},ruleStyle:Yu(e,t)},n=o=>{let l=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators;switch(o){case l.between:return"between";case l.notBetween:return"notBetween";case l.equalsTo:return"equalTo";case l.notEqualsTo:return"notEqualTo";case l.greaterThan:return"greaterThan";case l.lessThan:return"lessThan";case l.greaterThanOrEqualsTo:return"greaterThanOrEqu";case l.lessThanOrEqualsTo:return"lessThanOrEqu"}},a=o=>{let l=GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators;switch(o){case l.contains:return"containing";case l.doesNotContain:return"notContaining";case l.beginsWith:return"beginningWith";case l.endsWith:return"endingWith"}},r=o=>{let l=GC.Spread.Sheets.ConditionalFormatting.DateOccurringType;switch(o){case l.yesterday:return"yesterday";case l.today:return"today";case l.tomorrow:return"tomorrow";case l.last7Days:return"last7days";case l.lastWeek:return"lastweek";case l.thisWeek:return"thisweek";case l.nextWeek:return"nextweek";case l.lastMonth:return"lastmonth";case l.thisMonth:return"thismonth";case l.nextMonth:return"nextmonth"}};if(t)switch(t.ruleType()){case GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule:i.type="cellValue",i.cellValue={value1:t.value1(),value2:t.value2()},i.cellValue.operator=n(t.operator());break;case GC.Spread.Sheets.ConditionalFormatting.RuleType.specificTextRule:i.type="specificText",i.specificText={value:t.text()},i.specificText.operator=a(t.operator());break;case GC.Spread.Sheets.ConditionalFormatting.RuleType.dateOccurringRule:i.type="dateOccurring",i.dateOccurring={};let l=r(t.type());l&&(i.dateOccurring.operator=l);break}return i}function D_(e,t){if(t)switch(t.type){case"cellValue":return Bce(e,t);case"specificText":return Fce(e,t);case"dateOccurring":return Gce(e,t);default:return Vce(e,t)}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function qo(e,t){let i;if(C.isNullOrUndefined(e)||e==="")return"";if(isNaN(Number(e)))e.startsWith("=")?i=e:i='="'+e+'"';else return e;if(t){let n=S0(t),a=A_(i,n);if(!Lm(a))throw s.conditionalFormatting.newFormattingRule.invalidFormulaError}return i}function Ju(e,t){if(C.isNullOrUndefined(e)||e==="")return"";const i=typeof e=="string",n=i&&e.startsWith(w_),a=S0(t);if(!n){let o,l=e;if(i&&GC.Spread.Formatter.GeneralFormatter)try{let c=new GC.Spread.Formatter.GeneralFormatter,d={};c.getPreferredDisplayFormatter(e,d),l=d.value}catch{}return l instanceof Date?(o=GC.Spread.CalcEngine.ExpressionType.number,l=C.toOADate(l)):typeof l=="boolean"?o=GC.Spread.CalcEngine.ExpressionType.boolean:typeof l=="number"?o=GC.Spread.CalcEngine.ExpressionType.number:o=GC.Spread.CalcEngine.ExpressionType.string,w_+Ece(S0(t),l,o)}const r=A_(e,a);if(!r||!Lm(r))throw s.conditionalFormatting.newFormattingRule.invalidFormulaError;return e}function S0(e){let t=C.getActiveSheet(e);if(!t){let i=e.getActiveSheetTab();C._isTableSheet(i)&&(t=i.getSheet())}return t}function A_(e,t){return GC.Spread.Sheets.CalcEngine.formulaToExpression(t,e)}function Oce(e,t,i){return GC.Spread.Sheets.CalcEngine.expressionToFormula(e,t,0,0,i)}function Ece(e,t,i){return Oce(e,{type:i,value:t},!1)}const Nce=[15,16,17];function Lm(e){if(e){if(Nce.indexOf(e.operatorType)!==-1||e.functionName==="LAMBDA"||e.type===GC.Spread.CalcEngine.ExpressionType.array)return!1;if(e.arguments){for(let t of e.arguments)if(!Lm(t))return!1}if(!Lm(e.value)||!Lm(e.value2))return!1}return!0}function Bce(e,t){let i=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators,n=GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule,a,r="",o="",l=i.between,c=ra(t.ruleStyle,e);if(t.cellValue)switch(r=Ju(t.cellValue.value1,e),o=Ju(t.cellValue.value2,e),t.cellValue.operator){case"between":l=i.between;break;case"notBetween":l=i.notBetween;break;case"equalTo":l=i.equalsTo;break;case"notEqualTo":l=i.notEqualsTo;break;case"greaterThan":l=i.greaterThan;break;case"lessThan":l=i.lessThan;break;case"greaterThanOrEqu":l=i.greaterThanOrEqualsTo;break;case"lessThanOrEqu":l=i.lessThanOrEqualsTo;break}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(n,a,c,l,r,o,void 0,void 0,void 0,void 0)}function Fce(e,t){let i=GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators,n=GC.Spread.Sheets.ConditionalFormatting.RuleType.specificTextRule,a,r="",o=i.contains,l=ra(t.ruleStyle,e);if(t.specificText)switch(r=t.specificText.value,t.specificText.operator){case"containing":o=i.contains;break;case"notContaining":o=i.doesNotContain;break;case"beginningWith":o=i.beginsWith;break;case"endingWith":o=i.endsWith;break}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(n,a,l,o,void 0,void 0,r,void 0,void 0,void 0)}function Gce(e,t){let i=GC.Spread.Sheets.ConditionalFormatting.DateOccurringType,n=GC.Spread.Sheets.ConditionalFormatting.RuleType.dateOccurringRule,a,r=i.yesterday,o=ra(t.ruleStyle,e);if(t.dateOccurring)switch(t.dateOccurring.operator){case"yesterday":r=i.yesterday;break;case"today":r=i.today;break;case"tomorrow":r=i.tomorrow;break;case"last7days":r=i.last7Days;break;case"lastweek":r=i.lastWeek;break;case"thisweek":r=i.thisWeek;break;case"nextweek":r=i.nextWeek;break;case"lastmonth":r=i.lastMonth;break;case"thismonth":r=i.thisMonth;break;case"nextmonth":r=i.nextMonth;break}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(n,a,o,void 0,void 0,void 0,void 0,void 0,r,void 0)}function Vce(e,t){let i=GC.Spread.Sheets.ConditionalFormatting.RuleType.formulaRule,n=ra(t.ruleStyle,e),a="",r="A1",o=[];if(e){let l=C.getActiveSheet(e);if(l){o=l.getSelections();let c=o[0];r=GC.Spread.Sheets.CalcEngine.rangeToFormula(c,0,0,GC.Spread.Sheets.CalcEngine.RangeReferenceRelative.allAbsolute)}else{let c=e.getActiveSheetTab();C._isTableSheet(c)&&(r="@")}}switch(t.type){case"blanks":a="ISBLANK("+r+")";break;case"noBlanks":a="NOT(ISBLANK("+r+"))";break;case"errors":a="ISERROR("+r+")";break;case"noErrors":a="NOT(ISERROR("+r+"))";break}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(i,o,n,void 0,void 0,void 0,void 0,"="+a,void 0,void 0)}const P_=()=>({dialogOption:{activeTab:dt.Font,showTabList:[dt.Number,dt.Font,dt.Border,dt.Fill]},numberTabOption:{category:{activeTab:"general"},cellValue:"12345"},fontTabOption:{foreColor:void 0,fontFamily:void 0,fontSize:void 0,fontStyle:void 0,fontWeight:void 0,fontUnderlineListAndEffects:{fontUnderlineList:"none",fontEffects:{fontStrikethrough:!1},textDecoration:void 0},disableFontFamily:!0,disableFontSize:!0,disableFontWeight:!0},fillTabOption:{backColor:void 0}});function Yu(e,t){var n;let i=C.deepClone((n=e==null?void 0:e.getData(m.ConditionalFormatRuleFormatDialogOptions))!=null?n:P_());if(t){let a=t.style();if(a){let r=C.parseFormat(a.formatter);if(i.numberTabOption={cellValue:"AaBcCcYyZz",formatter:a.formatter,category:{activeTab:C.transToCategoryStr((r==null?void 0:r.category)||"general").toLowerCase()}},a.font){const o=a.fontStyle===null?"normal":a.fontStyle,l=a.fontWeight===null?"normal":a.fontWeight;i.fontTabOption={disableFontFamily:!0,disableFontSize:!0,disableFontWeight:!0,foreColor:a.foreColor,fontFamily:"",fontSize:"",fontStyle:o,fontWeight:l,fontUnderlineListAndEffects:{fontUnderlineList:"none",textDecoration:a.textDecoration,fontEffects:{fontStrikethrough:!1}}}}else i.fontTabOption&&(i.fontTabOption.foreColor=a.foreColor);if(a.textDecoration!==void 0&&i.fontTabOption){let o=C.generateFontUnderlineListAndEffectsOptionByStyleTextDecoration(a.textDecoration);i.fontTabOption.fontUnderlineListAndEffects=o}i.borderTabOption={borderTop:a.borderTop,borderBottom:a.borderBottom,borderLeft:a.borderLeft,borderRight:a.borderRight,diagonalUp:a.diagonalUp,diagonalDown:a.diagonalDown,enableBorderHorizontal:!1,enableBorderVertical:!1},i.fillTabOption={backColor:a.backColor},i.protectionTabOption&&(i.protectionTabOption.locked=a.locked,i.protectionTabOption.hidden=a.hidden,i.protectionTabOption.allowEditInCell=a.allowEditInCell)}}return i}function C0(e,t){let i={ruleStyle:Yu(e,t)};if(t){let n=t.formula();!C.isNullOrUndefined(n)&&!M_(n)&&(n="="+n),i.value=n}return i}function I_(e,t){let i,n,a="";if(t){n=ra(t.ruleStyle,e);let r=qo(t.value,e);a=Hce(e,r)}if(a==="")throw s.formattingRulesManagerDialog.invalidFormulaEnter;return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.formulaRule,i,n,void 0,void 0,void 0,void 0,a,void 0,void 0)}function M_(e){return e&&typeof e=="string"?e.toString().charAt(0)==="=":!1}function Hce(e,t){if(e&&M_(t)){let i=C.getActualActiveSheet(e);if(!i)return t;let n=i.getSelections();if(!n||!n.length)return t;let a=n[0].row,r=n[0].col;for(let l=1;l<n.length;l++){let c=n[l];a=a<=c.row?a:c.row,r=r<=c.col?r:c.col}a=a<0?0:a,r=r<0?0:r;let o=GC.Spread.Sheets.CalcEngine.formulaToExpression(i,t,a,r);return"="+GC.Spread.Sheets.CalcEngine.expressionToFormula(i,o,a,r)}return t}let zce={title:"${res.ribbon.home.conditionFormat}",text:"${res.ribbon.home.conditionFormat}",iconClass:"ribbon-button-conditionalformat",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ConditionFormat,direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")',enableContext:`${m.AllowFormatCells} && !${m.IsInTableSheetDesignMode} && ${re.tableSheetSelectedExcludeGroupColumn} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,init:e=>{e.getData(m.ConditionalFormatRuleFormatDialogOptions)||e.setData(m.ConditionalFormatRuleFormatDialogOptions,P_())}};const jce=Object.freeze(Object.defineProperty({__proto__:null,ConditionalFormat:zce},Symbol.toStringTag,{value:"Module"}));let Wce={commandName:p.ClearRules,text:"${res.conditionalFormat.clearRules}",iconClass:"ribbon-control-dropdown-clear-rules",direction:"horizontal"};const Zce=Object.freeze(Object.defineProperty({__proto__:null,clearRules:Wce},Symbol.toStringTag,{value:"Module"}));function Uce(e,t){let i="Designer."+t;e.commandManager().register(i,R_,void 0,!1,!1,!1,!1)}function k_(e,t){oe.runCommand(e,"clearRule",R_,{isFromEntireSheet:t})}let R_={canUndo:!0,execute:function(e,t,i){return new Jce(e,t).execute(e,t,i)}};class Jce extends oe.DesignerActionBase{executeImp(t,i,n){let a=this,o=C.getActiveSheet(t).getSelections();if(i.isFromEntireSheet)a.sheet().conditionalFormats.clearRule();else for(let l=0;l<o.length;l++)a.sheet().conditionalFormats.removeRuleByRange(o[l].row,o[l].col,o[l].rowCount,o[l].colCount)}}let Yce={text:"${res.conditionalFormat.clearRulesFromEntireSheet}",commandName:p.ClearSheetRules,execute:(e,t,i)=>{k_(e.Spread,!0),e.setData(re.isFileModified,!0)},init:e=>{Uce(e.Spread,"clearRule")}};const qce=Object.freeze(Object.defineProperty({__proto__:null,clearRulesFromEntireSheet:Yce},Symbol.toStringTag,{value:"Module"}));let Kce={text:"${res.conditionalFormat.clearRulesFromSelectedCells}",commandName:p.ClearCellRules,execute:(e,t,i)=>{k_(e.Spread,!1),e.setData(re.isFileModified,!0)}};const Qce=Object.freeze(Object.defineProperty({__proto__:null,clearRulesFromSelectedCells:Kce},Symbol.toStringTag,{value:"Module"})),Xce=C.isNullOrUndefined;function $ce(e,t){let i="Designer."+t;e.commandManager().register(i,__,void 0,!1,!1,!1,!1)}function oa(e,t,i){oe.runCommand(e,"addRule",__,{isRemove:t,rule:i})}function ede(e){let t={},i=[];for(let n=0;n<e.length;n++){let a=e[n];Xce(t[a.pivotTableName])&&(t[a.pivotTableName]=[]),t[a.pivotTableName].push(n)}for(let n in t)if(t.hasOwnProperty(n)){let a=[],r=i.push({pivotTableName:n,ranges:a})-1;for(let o=0;o<t[n].length;o++)a=a.concat(e[t[n][o]].ranges);i[r].ranges=a}for(let n=i.length-1;n>=0;n--){let a=i[n];(!a.ranges||a.ranges.length<1)&&i.splice(n,1)}return i}function y0(e,t,i){if(!e.pivotTables){t.addRule(i);return}let n=i.ranges(),a={outsideRanges:[],insideRanges:[]};for(let r=0;r<n.length;r++){let o=Ae.spiltRangeByPivotTables(n[r],e);a.outsideRanges=a.outsideRanges.concat(o?o.outsideRanges:[]),a.insideRanges=a.insideRanges.concat(o?o.insideRanges:[])}if(a.outsideRanges.length>0)i.ranges(a.outsideRanges),t.addRule(i);else{let r=ede(a.insideRanges);if(r.length===1){let o=r[0].ranges,l=[];for(let d=0;d<o.length;d++){let u=o[d],h=e.pivotTables.getRangePivotAreas(u);if(h){for(let g in h)if(h.hasOwnProperty(g)){let f=h[g];l=l.concat(f);break}}}let c=e.pivotTables.get(r[0].pivotTableName);c&&c.addConditionalRule(l,i)}}}class tde extends oe.DesignerActionBase{executeImp(t,i,n){let a=this,r=a.sheet(),o=i.isRemove,l=r.conditionalFormats,c;if(o){c=i.rule;for(let d=l.count()-1;d>=0;d--){let u=l.getRule(d);if(u.ruleType()===c.ruleType()&&JSON.stringify(u.ranges())===JSON.stringify(c.ranges())){l.removeRule(u);break}}}else c=i.rule;y0(r,l,c)}}let __={canUndo:!0,execute:function(e,t,i){return new tde(e,t).execute(e,t,i)}};var Kn=(e=>(e.FormatOnValue="FormatOnValue",e.FormatContain="FormatContain",e.FormatRankedValue="FormatRankedValue",e.FormatAbove="FormatAbove",e.FormatUnique="FormatUnique",e.UseFormula="UseFormula",e.UseRowColumnStates="UseRowColumnStates",e))(Kn||{}),go=(e=>(e.ColorScale2="ColorScale2",e.ColorScale3="ColorScale3",e.DataBar="DataBar",e.IconSets="IconSets",e))(go||{});let qu=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType;function v0(e,t){let i={minType:qu.lowestValue,maxType:qu.highestValue,minValue:"("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.minSelector.lowest+")",maxValue:"("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.maxSelector.highest+")",color:{minColor:"#F00",maxColor:"#080",spread:t}};return e&&t&&(i.minType=e.minType(),i.maxType=e.maxType(),i.minValue=e.minValue(),i.maxValue=e.maxValue(),i.color={minColor:e.minColor(),maxColor:e.maxColor(),spread:t}),i.minType===qu.lowestValue&&(i.minValue="("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.minSelector.lowest+")"),i.maxType===qu.highestValue&&(i.maxValue="("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.maxSelector.highest+")"),i}function O_(e,t){var f,b,S,y;let i,n=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.lowestValue,a,r=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.highestValue,o=null,l,c=null,d,u,h,g;return t&&e&&(o=qo(t.minValue,e),c=qo(t.maxValue,e),d=(b=(f=t.color)==null?void 0:f.minColor)!=null?b:"#F00",h=(y=(S=t.color)==null?void 0:S.maxColor)!=null?y:"#080",n=t.minType,r=t.maxType,n===qu.lowestValue&&(o=null),r===qu.highestValue&&(c=null)),i=new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.twoScaleRule,n,o,d,a,l,u,r,c,h,g),i}let wd=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType;function x0(e,t){let i={minType:wd.lowestValue,midType:wd.percentile,maxType:wd.highestValue,minValue:"("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.minSelector.lowest+")",midValue:"50",maxValue:"("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.maxSelector.highest+")",color:{minColor:"#F00",midColor:"#FF0",maxColor:"#080",spread:t}};return e&&t&&(i.minType=e.minType(),i.midType=e.midType(),i.maxType=e.maxType(),i.minValue=e.minValue(),i.midValue=e.midValue(),i.maxValue=e.maxValue(),i.color={minColor:e.minColor(),midColor:e.midColor(),maxColor:e.maxColor(),spread:t},i.minType===wd.lowestValue&&(i.minValue="("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.minSelector.lowest+")"),i.maxType===wd.highestValue&&(i.maxValue="("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.maxSelector.highest+")")),i}function E_(e,t){var f,b,S,y,v,x;let i,n=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.lowestValue,a,r=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.highestValue,o=null,l,c=null,d,u,h,g;return t&&e&&(o=qo(t.minValue,e),l=qo(t.midValue,e),c=qo(t.maxValue,e),d=(b=(f=t.color)==null?void 0:f.minColor)!=null?b:"#F00",u=(y=(S=t.color)==null?void 0:S.midColor)!=null?y:"#FF0",h=(x=(v=t.color)==null?void 0:v.maxColor)!=null?x:"#080",n=t.minType,a=t.midType,r=t.maxType,n===wd.lowestValue&&(o=null),r===wd.highestValue&&(c=null)),i=new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule,n,o,d,a,l,u,r,c,h,g),i}let gc=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType;function N_(e){return e===gc.lowestValue||e===gc.highestValue||e===gc.automin||e===gc.automax}function L0(e){let t={};t.fillColor={color:"#F00"};let i={};i.borderColor={color:"#000"};let n={showBarOnly:!1,minType:gc.automin,minValue:"("+s.conditionalFormatting.newFormattingRule.formatOnValue.dataBar.auto+")",maxType:gc.automax,maxValue:"("+s.conditionalFormatting.newFormattingRule.formatOnValue.dataBar.auto+")",barAppearance:{fill:"solidFill",fillColor:"rgb(99, 142, 198)",border:"noBorder",borderColor:"rgb(0, 0, 0)",barDirection:"l2r"},negativeData:{negativeFill:{selectedValue:"apply",attachValues:t},enableBorder:!1,negativeBorder:{selectedValue:"apply",attachValues:i},axisPosition:GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic,axisColor:"#000"}};return e&&(n.showBarOnly=e.showBarOnly(),n.minType=e.minType(),n.minValue=e.minValue(),n.maxType=e.maxType(),n.maxValue=e.maxValue(),n.barAppearance&&(n.barAppearance.fill=e.gradient()?"gradientFill":"solidFill",n.barAppearance.fillColor=e.color(),n.barAppearance.border=e.showBorder()?"solidBorder":"noBorder",n.barAppearance.borderColor=e.borderColor(),n.barAppearance.barDirection=e.dataBarDirection()===GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight?"l2r":"r2l"),t.fillColor={color:e.negativeFillColor()||"#F00"},i.borderColor={color:e.negativeBorderColor()||"#000"},n.negativeData={negativeFill:{selectedValue:e.useNegativeFillColor()?"fillColor":"apply",attachValues:t},enableBorder:e.showBorder(),negativeBorder:{selectedValue:e.useNegativeBorderColor()?"borderColor":"apply",attachValues:i},axisPosition:e.axisPosition()||GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic,axisColor:e.axisColor()||"#000"}),n}function B_(e,t){let i,n,a=gc.lowestValue,r=gc.automax,o="",l="",c=!1,d="",u="",h=!1,g=!1,f=GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight,b=null;return t&&(a=t.minType,r=t.maxType,o=qo(t.minValue,e),l=qo(t.maxValue,e),N_(a)&&(o=null),N_(r)&&(l=null),c=t.showBarOnly||!1,d=t.barAppearance&&t.barAppearance.fillColor||"",u=t.barAppearance&&t.barAppearance.borderColor||"",b=t.negativeData,h=t.barAppearance&&t.barAppearance.fill==="gradientFill"||!1,g=t.barAppearance&&t.barAppearance.border==="solidBorder"||!1,f=t.barAppearance&&t.barAppearance.barDirection==="l2r"?GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight:GC.Spread.Sheets.ConditionalFormatting.BarDirection.rightToLeft),i=new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(a,Yo(o),r,Yo(l),d,n),i.showBarOnly(c),i.gradient(h),i.borderColor(u),i.showBorder(g),i.dataBarDirection(f),b&&(i.negativeFillColor(b.negativeFill.attachValues.fillColor.color),i.useNegativeFillColor(b.negativeFill.selectedValue==="fillColor"),i.negativeBorderColor(b.negativeBorder.attachValues.borderColor.color),i.useNegativeBorderColor(b.negativeBorder.selectedValue==="borderColor"),i.axisColor(b.axisColor),i.axisPosition(b.axisPosition)),i}function T0(e,t,i){let n={ruleStyle:Yu(e,t)};return t?(n.direction=t.isRow()?1:0,n.state=t.state()):(n.direction=1,n.state=GC.Spread.Sheets.RowColumnStates.hover),n.isReportSheet=C._isReportSheet(i&&i.getActiveSheetTab()),n}function F_(e,t){let i,n,a=!0,r;return t&&(n=ra(t.ruleStyle,e),a=t.direction===1,r=t.state,i||(i=C.getActualActiveSheet(e).getSelections())),new GC.Spread.Sheets.ConditionalFormatting.StateRule(a?GC.Spread.Sheets.ConditionalFormatting.RuleType.rowStateRule:GC.Spread.Sheets.ConditionalFormatting.RuleType.columnStateRule,r,n,i)}function w0(e,t){let i={type:"duplicate",ruleStyle:Yu(e,t)};if(t){let n=t.ruleType();n===GC.Spread.Sheets.ConditionalFormatting.RuleType.duplicateRule?i.type="duplicate":n===GC.Spread.Sheets.ConditionalFormatting.RuleType.uniqueRule&&(i.type="unique")}return i}function G_(e,t){let i=GC.Spread.Sheets.ConditionalFormatting.RuleType,n,a,r=i.duplicateRule;if(t)switch(a=ra(t.ruleStyle,e),t.type){case"duplicate":r=i.duplicateRule;break;case"unique":r=i.uniqueRule;break}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(r,n,a,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function D0(e,t){let i={type:"above",ruleStyle:Yu(e,t)};if(t){let n=GC.Spread.Sheets.ConditionalFormatting.AverageConditionType;switch(t.type()){case n.above:i.type="above";break;case n.below:i.type="below";break;case n.equalOrAbove:i.type="equalOrAbove";break;case n.equalOrBelow:i.type="equalOrBelow";break;case n.above1StdDev:i.type="above1StdDev";break;case n.below1StdDev:i.type="below1StdDev";break;case n.above2StdDev:i.type="above2StdDev";break;case n.below2StdDev:i.type="below2StdDev";break;case n.above3StdDev:i.type="above3StdDev";break;case n.below3StdDev:i.type="below3StdDev";break}}return i}function V_(e,t){let i=GC.Spread.Sheets.ConditionalFormatting.AverageConditionType,n,a,r=i.above;if(t)switch(a=ra(t.ruleStyle,e),t.type){case"above":r=i.above;break;case"below":r=i.below;break;case"equalOrAbove":r=i.equalOrAbove;break;case"equalOrBelow":r=i.equalOrBelow;break;case"above1StdDev":r=i.above1StdDev;break;case"below1StdDev":r=i.below1StdDev;break;case"above2StdDev":r=i.above2StdDev;break;case"below2StdDev":r=i.below2StdDev;break;case"above3StdDev":r=i.above3StdDev;break;case"below3StdDev":r=i.below3StdDev;break}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.averageRule,n,a,null,void 0,void 0,void 0,void 0,r,void 0)}function A0(e,t){let i={type:"top",rank:10,ruleStyle:Yu(e,t)};if(t){let n=t.type();n===GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top?i.type="top":n===GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.bottom&&(i.type="bottom"),i.rank=t.rank()}return i}function H_(e,t){let i=GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType,n,a,r=i.top,o=10;if(t){switch(a=ra(t.ruleStyle,e),t.type){case"top":r=i.top;break;case"bottom":r=i.bottom;break}o=t.rank||10}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule,n,a,null,void 0,void 0,void 0,void 0,r,o)}var Xe=(e=>(e[e.UpArrowGreen=0]="UpArrowGreen",e[e.RightArrowYellow=1]="RightArrowYellow",e[e.DownArrowRed=2]="DownArrowRed",e[e.UpArrowGray=3]="UpArrowGray",e[e.RightArrowGray=4]="RightArrowGray",e[e.DownArrowGray=5]="DownArrowGray",e[e.UpTriangleGreen=6]="UpTriangleGreen",e[e.MinusYellow=7]="MinusYellow",e[e.DownTriangleRed=8]="DownTriangleRed",e[e.RightUpArrowGray=9]="RightUpArrowGray",e[e.RightDownArrowGray=10]="RightDownArrowGray",e[e.RightUpArrowYellow=11]="RightUpArrowYellow",e[e.RightDownArrowYellow=12]="RightDownArrowYellow",e[e.TrafficLightGreen=13]="TrafficLightGreen",e[e.TrafficLightYellow=14]="TrafficLightYellow",e[e.TrafficLightRed=15]="TrafficLightRed",e[e.TrafficLightRimmedGreen=16]="TrafficLightRimmedGreen",e[e.TrafficLightRimmedYellow=17]="TrafficLightRimmedYellow",e[e.TrafficLightRimmedRed=18]="TrafficLightRimmedRed",e[e.UpTriangleYellow=19]="UpTriangleYellow",e[e.DownRhombusRed=20]="DownRhombusRed",e[e.TrafficLightBlack=21]="TrafficLightBlack",e[e.BallRed=22]="BallRed",e[e.BallPink=23]="BallPink",e[e.BallGray=24]="BallGray",e[e.BallBlack=25]="BallBlack",e[e.CheckCircledGreen=26]="CheckCircledGreen",e[e.NoticeCircledYellow=27]="NoticeCircledYellow",e[e.CloseCircledRed=28]="CloseCircledRed",e[e.CheckUncircledGreen=29]="CheckUncircledGreen",e[e.NoticeUncircledYellow=30]="NoticeUncircledYellow",e[e.CloseUncircledRed=31]="CloseUncircledRed",e[e.FlagGreen=32]="FlagGreen",e[e.FlagYellow=33]="FlagYellow",e[e.FlagRed=34]="FlagRed",e[e.StarSolid=35]="StarSolid",e[e.StarHalf=36]="StarHalf",e[e.StarHollow=37]="StarHollow",e[e.Rating4=38]="Rating4",e[e.Rating3=39]="Rating3",e[e.Rating2=40]="Rating2",e[e.Rating1=41]="Rating1",e[e.Rating0=42]="Rating0",e[e.Quarters4=43]="Quarters4",e[e.Quarters3=44]="Quarters3",e[e.Quarters2=45]="Quarters2",e[e.Quarters1=46]="Quarters1",e[e.Quarters0=47]="Quarters0",e[e.Box4=48]="Box4",e[e.Box3=49]="Box3",e[e.Box2=50]="Box2",e[e.Box1=51]="Box1",e[e.Box0=52]="Box0",e[e.None=53]="None",e))(Xe||{});const Mn={threeArrowsColored:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored,icons:[Xe.UpArrowGreen,Xe.RightArrowYellow,Xe.DownArrowRed],iconClass:"three-arrows-colored"},threeArrowsGray:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsGray,icons:[Xe.UpArrowGray,Xe.RightArrowGray,Xe.DownArrowGray],iconClass:"three-arrows-gray"},threeTriangles:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTriangles,icons:[Xe.UpTriangleGreen,Xe.MinusYellow,Xe.DownTriangleRed],iconClass:"three-triangles"},threeStars:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeStars,icons:[Xe.StarSolid,Xe.StarHalf,Xe.StarHollow],iconClass:"three-stars"},threeFlags:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeFlags,icons:[Xe.FlagGreen,Xe.FlagYellow,Xe.FlagRed],iconClass:"three-flags"},threeTrafficLightsUnrimmed:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsUnrimmed,icons:[Xe.TrafficLightGreen,Xe.TrafficLightYellow,Xe.TrafficLightRed],iconClass:"three-traffic-lights-unrimmed"},threeTrafficLightsRimmed:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsRimmed,icons:[Xe.TrafficLightRimmedGreen,Xe.TrafficLightRimmedYellow,Xe.TrafficLightRimmedRed],iconClass:"three-traffic-lights-rimmed"},threeSigns:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSigns,icons:[Xe.TrafficLightGreen,Xe.UpTriangleYellow,Xe.DownRhombusRed],iconClass:"three-signs"},threeSymbolsCircled:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsCircled,icons:[Xe.CheckCircledGreen,Xe.NoticeCircledYellow,Xe.CloseCircledRed],iconClass:"three-symbols-circled"},threeSymbolsUncircled:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsUncircled,icons:[Xe.CheckUncircledGreen,Xe.NoticeUncircledYellow,Xe.CloseUncircledRed],iconClass:"three-symbols-uncircled"},fourArrowsColored:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored,icons:[Xe.UpArrowGreen,Xe.RightUpArrowYellow,Xe.RightDownArrowYellow,Xe.DownArrowRed],iconClass:"four-arrows-colored"},fourArrowsGray:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray,icons:[Xe.UpArrowGray,Xe.RightUpArrowGray,Xe.RightDownArrowGray,Xe.DownArrowGray],iconClass:"four-arrows-gray"},fourRedToBlack:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack,icons:[Xe.BallRed,Xe.BallPink,Xe.BallGray,Xe.BallBlack],iconClass:"four-red-to-black"},fourRatings:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings,icons:[Xe.Rating3,Xe.Rating2,Xe.Rating1,Xe.Rating0],iconClass:"four-ratings"},fourTrafficLights:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights,icons:[Xe.TrafficLightGreen,Xe.TrafficLightYellow,Xe.TrafficLightRed,Xe.TrafficLightBlack],iconClass:"four-traffic-lights"},fiveArrowsColored:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored,icons:[Xe.UpArrowGreen,Xe.RightUpArrowYellow,Xe.RightArrowYellow,Xe.RightDownArrowYellow,Xe.DownArrowRed],iconClass:"five-arrows-colored"},fiveArrowsGray:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray,icons:[Xe.UpArrowGray,Xe.RightUpArrowGray,Xe.RightArrowGray,Xe.RightDownArrowGray,Xe.DownArrowGray],iconClass:"five-arrows-gray"},fiveRatings:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings,icons:[Xe.Rating4,Xe.Rating3,Xe.Rating2,Xe.Rating1,Xe.Rating0],iconClass:"five-ratings"},fiveQuarters:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters,icons:[Xe.Quarters4,Xe.Quarters3,Xe.Quarters2,Xe.Quarters1,Xe.Quarters0],iconClass:"five-quarters"},fiveBoxes:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes,icons:[Xe.Box4,Xe.Box3,Xe.Box2,Xe.Box1,Xe.Box0],iconClass:"five-boxes"},noIcons:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.noIcons,icons:[Xe.None],iconClass:"no-icon"}},z_={UpArrowGreen:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored],iconIndex:[0,0,0],iconClass:"icon-sets-icons up-arrow-green"},RightArrowYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored],iconIndex:[1,2],iconClass:"icon-sets-icons right-arrow-yellow"},DownArrowRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored],iconIndex:[2,3,4],iconClass:"icon-sets-icons down-arrow-red"},UpArrowGray:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsGray,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray],iconIndex:[0,0,0],iconClass:"icon-sets-icons up-arrow-gray"},RightArrowGray:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsGray,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray],iconIndex:[1,2],iconClass:"icon-sets-icons right-arrow-gray"},DownArrowGray:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsGray,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray],iconIndex:[2,3,4],iconClass:"icon-sets-icons down-arrow-gray"},UpTriangleGreen:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTriangles],iconIndex:[0],iconClass:"icon-sets-icons up-triangle-green"},MinusYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTriangles],iconIndex:[1],iconClass:"icon-sets-icons minus-yellow"},DownTriangleRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTriangles],iconIndex:[2],iconClass:"icon-sets-icons down-triangle-red"},RightUpArrowGray:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray],iconIndex:[1,1],iconClass:"icon-sets-icons right-up-arrow-gray"},RightUpArrowYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored],iconIndex:[1,1],iconClass:"icon-sets-icons right-up-arrow-yellow"},RightDownArrowGray:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray],iconIndex:[2,3],iconClass:"icon-sets-icons right-down-arrow-gray"},RightDownArrowYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored],iconIndex:[2,3],iconClass:"icon-sets-icons right-down-arrow-yellow"},TrafficLightGreen:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsUnrimmed,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSigns],iconIndex:[0,0,0],iconClass:"icon-sets-icons traffic-light-green"},TrafficLightYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsUnrimmed,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights],iconIndex:[1,1],iconClass:"icon-sets-icons traffic-light-yellow"},TrafficLightRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsUnrimmed,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights],iconIndex:[2,2],iconClass:"icon-sets-icons traffic-light-red"},TrafficLightRimmedGreen:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsRimmed],iconIndex:[0],iconClass:"icon-sets-icons traffic-light-rimmed-green"},TrafficLightRimmedYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsRimmed],iconIndex:[1],iconClass:"icon-sets-icons traffic-light-rimmed-yellow"},TrafficLightRimmedRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsRimmed],iconIndex:[2],iconClass:"icon-sets-icons traffic-light-rimmed-red"},UpTriangleYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSigns],iconIndex:[1],iconClass:"icon-sets-icons up-triangle-yellow"},DownRhombusRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSigns],iconIndex:[2],iconClass:"icon-sets-icons down-rhombus-red"},TrafficLightBlack:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights],iconIndex:[3],iconClass:"icon-sets-icons traffic-light-black"},BallRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack],iconIndex:[0],iconClass:"icon-sets-icons ball-red"},BallPink:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack],iconIndex:[1],iconClass:"icon-sets-icons ball-pink"},BallGray:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack],iconIndex:[2],iconClass:"icon-sets-icons ball-gray"},BallBlack:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack],iconIndex:[3],iconClass:"icon-sets-icons ball-black"},CheckCircledGreen:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsCircled],iconIndex:[0],iconClass:"icon-sets-icons check-circled-green"},NoticeCircledYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsCircled],iconIndex:[1],iconClass:"icon-sets-icons notice-circled-yellow"},CloseCircledRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsCircled],iconIndex:[2],iconClass:"icon-sets-icons close-circled-red"},CheckUncircledGreen:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsUncircled],iconIndex:[0],iconClass:"icon-sets-icons check-uncircled-green"},NoticeUncircledYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsUncircled],iconIndex:[1],iconClass:"icon-sets-icons notice-uncircled-yellow"},CloseUncircledRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsUncircled],iconIndex:[2],iconClass:"icon-sets-icons close-uncircled-red"},FlagGreen:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeFlags],iconIndex:[0],iconClass:"icon-sets-icons flag-green"},FlagYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeFlags],iconIndex:[1],iconClass:"icon-sets-icons flag-yellow"},FlagRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeFlags],iconIndex:[2],iconClass:"icon-sets-icons flag-red"},StarSolid:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeStars],iconIndex:[0],iconClass:"icon-sets-icons star-solid"},StarHalf:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeStars],iconIndex:[1],iconClass:"icon-sets-icons star-half"},StarHollow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeStars],iconIndex:[2],iconClass:"icon-sets-icons star-hollow"},Quarters4:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters],iconIndex:[0],iconClass:"icon-sets-icons quarters-4"},Quarters3:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters],iconIndex:[1],iconClass:"icon-sets-icons quarters-3"},Quarters2:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters],iconIndex:[2],iconClass:"icon-sets-icons quarters-2"},Quarters1:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters],iconIndex:[3],iconClass:"icon-sets-icons quarters-1"},Quarters0:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters],iconIndex:[4],iconClass:"icon-sets-icons quarters-0"},Rating4:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings],iconIndex:[0],iconClass:"icon-sets-icons rating-4"},Rating3:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings],iconIndex:[0,1],iconClass:"icon-sets-icons rating-3"},Rating2:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings],iconIndex:[1,2],iconClass:"icon-sets-icons rating-2"},Rating1:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings],iconIndex:[2,3],iconClass:"icon-sets-icons rating-1"},Rating0:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings],iconIndex:[3,4],iconClass:"icon-sets-icons rating-0"},Box4:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes],iconIndex:[0],iconClass:"icon-sets-icons box-4"},Box3:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes],iconIndex:[1],iconClass:"icon-sets-icons box-3"},Box2:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes],iconIndex:[2],iconClass:"icon-sets-icons box-2"},Box1:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes],iconIndex:[3],iconClass:"icon-sets-icons box-1"},Box0:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes],iconIndex:[4],iconClass:"icon-sets-icons box-0"},None:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.noIcons],iconIndex:[0],iconClass:"icon-sets-icons noIcon"}};function P0(e){let t={iconSetType:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored,showIconOnly:!1,reverseIconOrder:!1,threeArrowsColored:la(Mn.threeArrowsColored.icons),threeArrowsGray:la(Mn.threeArrowsGray.icons),threeTriangles:la(Mn.threeTriangles.icons),threeStars:la(Mn.threeStars.icons),threeFlags:la(Mn.threeFlags.icons),threeTrafficLightsUnrimmed:la(Mn.threeTrafficLightsUnrimmed.icons),threeTrafficLightsRimmed:la(Mn.threeTrafficLightsRimmed.icons),threeSigns:la(Mn.threeSigns.icons),threeSymbolsCircled:la(Mn.threeSymbolsCircled.icons),threeSymbolsUncircled:la(Mn.threeSymbolsUncircled.icons),fourArrowsColored:la(Mn.fourArrowsColored.icons),fourArrowsGray:la(Mn.fourArrowsGray.icons),fourRedToBlack:la(Mn.fourRedToBlack.icons),fourRatings:la(Mn.fourRatings.icons),fourTrafficLights:la(Mn.fourTrafficLights.icons),fiveArrowsColored:la(Mn.fiveArrowsColored.icons),fiveArrowsGray:la(Mn.fiveArrowsGray.icons),fiveRatings:la(Mn.fiveRatings.icons),fiveQuarters:la(Mn.fiveQuarters.icons),fiveBoxes:la(Mn.fiveBoxes.icons)};if(e){t.iconSetType=e.iconSetType(),t.showIconOnly=e.showIconOnly(),t.reverseIconOrder=e.reverseIconOrder();let i=null;switch(t.iconSetType){case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored:i=t.threeArrowsColored;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsGray:i=t.threeArrowsGray;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTriangles:i=t.threeTriangles;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsUnrimmed:i=t.threeTrafficLightsUnrimmed;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsRimmed:i=t.threeTrafficLightsRimmed;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSigns:i=t.threeSigns;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsCircled:i=t.threeSymbolsCircled;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsUncircled:i=t.threeSymbolsUncircled;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeFlags:i=t.threeFlags;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeStars:i=t.threeStars;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored:i=t.fourArrowsColored;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray:i=t.fourArrowsGray;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights:i=t.fourTrafficLights;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack:i=t.fourRedToBlack;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings:i=t.fourRatings;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored:i=t.fiveArrowsColored;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray:i=t.fiveArrowsGray;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters:i=t.fiveQuarters;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings:i=t.fiveRatings;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes:i=t.fiveBoxes;break}if(i){let n=e.iconCriteria();n.length===2?(ms(i.iconItem1,n[1]),ms(i.iconItem2,n[0])):n.length===3?(ms(i.iconItem1,n[2]),ms(i.iconItem2,n[1]),ms(i.iconItem3,n[0])):n.length===4&&(ms(i.iconItem1,n[3]),ms(i.iconItem2,n[2]),ms(i.iconItem3,n[1]),ms(i.iconItem4,n[0]));let a=e.icons(),r=Z_(t.iconSetType,a);if(a){let o=[];for(let l=0;l<a.length;l++)o[l]={iconSetType:a[l].iconSetType,iconIndex:a[l].iconIndex};i.icons=o.map(l=>lde(l.iconSetType,l.iconIndex,r))}(t.reverseIconOrder&&i.icons||r)&&i.icons.reverse()}}return t}function j_(e,t){let i;if(t){let n,a=t.iconSetType||GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored;i=new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(a,n),i.showIconOnly(t.showIconOnly),i.reverseIconOrder(t.reverseIconOrder),ide(i,t,a,e),ode(i,t,a)}return i}function ms(e,t){switch(e.operator=t.isGreaterThanOrEqualTo?"largeOrEqu":"large",e.value=fo(t.iconValue,null),t.iconValueType){case GC.Spread.Sheets.ConditionalFormatting.IconValueType.number:e.type="num";break;case GC.Spread.Sheets.ConditionalFormatting.IconValueType.percent:e.type="percent";break;case GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula:e.type="formula";break;case GC.Spread.Sheets.ConditionalFormatting.IconValueType.percentile:e.type="percentile";break}}function la(e){if(e.length===3)return{reverseIconOrder:!1,iconItem1:{icon:e[0],operator:"largeOrEqu",value:"67",type:"percent"},iconItem2:{icon:e[1],operator:"largeOrEqu",value:"33",type:"percent"},iconItem3:{icon:e[2]},icons:e.slice()};if(e.length===4)return{reverseIconOrder:!1,iconItem1:{icon:e[0],operator:"largeOrEqu",value:"75",type:"percent"},iconItem2:{icon:e[1],operator:"largeOrEqu",value:"50",type:"percent"},iconItem3:{icon:e[2],operator:"largeOrEqu",value:"25",type:"percent"},iconItem4:{icon:e[3]},icons:e.slice()};if(e.length===5)return{reverseIconOrder:!1,iconItem1:{icon:e[0],operator:"largeOrEqu",value:"80",type:"percent"},iconItem2:{icon:e[1],operator:"largeOrEqu",value:"60",type:"percent"},iconItem3:{icon:e[2],operator:"largeOrEqu",value:"40",type:"percent"},iconItem4:{icon:e[3],operator:"largeOrEqu",value:"20",type:"percent"},iconItem5:{icon:e[4]},icons:e.slice()}}function ide(e,t,i,n){let a=e.iconCriteria();switch(i){case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights:ade(t,i,a,n);break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes:rde(t,i,a,n);break;default:nde(t,i,a,n);break}e.iconCriteria(a)}function nde(e,t,i,n){let a=e[GC.Spread.Sheets.ConditionalFormatting.IconSetType[t]],r=a.iconItem1.operator==="largeOrEqu",o=a.iconItem2.operator==="largeOrEqu",l=gs(a.iconItem1.type||""),c=gs(a.iconItem2.type||""),d=fo(a.iconItem1.value,n),u=fo(a.iconItem2.value,n),h=c!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(u):u;i[0]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(o,c,h);let g=l!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(d):d;i[1]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(r,l,g)}function ade(e,t,i,n){let a=e[GC.Spread.Sheets.ConditionalFormatting.IconSetType[t]],r=a.iconItem1.operator==="largeOrEqu",o=a.iconItem2.operator==="largeOrEqu",l=a.iconItem3.operator==="largeOrEqu",c=gs(a.iconItem1.type||""),d=gs(a.iconItem2.type||""),u=gs(a.iconItem3.type||""),h=fo(a.iconItem1.value,n),g=fo(a.iconItem2.value,n),f=fo(a.iconItem3.value,n),b=u!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(f):f;i[0]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(l,u,b);let S=d!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(g):g;i[1]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(o,d,S);let y=c!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(h):h;i[2]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(r,c,y)}function rde(e,t,i,n){let a=e[GC.Spread.Sheets.ConditionalFormatting.IconSetType[t]],r=a.iconItem1.operator==="largeOrEqu",o=a.iconItem2.operator==="largeOrEqu",l=a.iconItem3.operator==="largeOrEqu",c=a.iconItem4.operator==="largeOrEqu",d=gs(a.iconItem1.type||""),u=gs(a.iconItem2.type||""),h=gs(a.iconItem3.type||""),g=gs(a.iconItem4.type||""),f=fo(a.iconItem1.value,n),b=fo(a.iconItem2.value,n),S=fo(a.iconItem3.value,n),y=fo(a.iconItem4.value,n),v=g!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(y):y;i[0]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(c,g,v);let x=h!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(S):S;i[1]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(l,h,x);let L=u!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(b):b;i[2]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(o,u,L);let T=d!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(f):f;i[3]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(r,d,T)}function ode(e,t,i){let n=t[GC.Spread.Sheets.ConditionalFormatting.IconSetType[i]],a=n.icons.map(o=>W_(o,i));e.reverseIconOrder()&&a.reverse();let r=Z_(i,a);if(r&&(a=n.icons.map(o=>W_(o,i,r)),a.reverse()),r&&a&&a.length>0){let o=e.icons();for(let l=0;l<a.length;l++)o[l]={iconSetType:a[l].iconSetType,iconIndex:a[l].iconIndex};e.icons(o),e._isCustomIconSet=!0}}function W_(e,t,i){let n=Xe[e],a=z_[n].iconSetTypes,r=z_[n].iconIndex,o=a.indexOf(t);o===-1&&(o=0);let l=a[o],c=GC.Spread.Sheets.ConditionalFormatting.IconSetType[l],u=Mn[c].icons.length;return{iconSetType:a[o],iconIndex:i?u-r[o]-1:r[o]}}function fo(e,t){return e&&typeof e=="string"&&e.toString().charAt(0)==="="&&!isNaN(parseInt(e.substring(1),10))?e.substring(1):e&&e.toString().charAt(0)!=="="&&!isNaN(e)?"="+e:(qo(e,t),e)}function gs(e){let t=GC.Spread.Sheets.ConditionalFormatting.IconValueType;switch(e){case"num":return t.number;case"percent":return t.percent;case"formula":return t.formula;case"percentile":return t.percentile}return t.number}function lde(e,t,i){let n=GC.Spread.Sheets.ConditionalFormatting.IconSetType[e];if(Mn[n]){let a=Mn[n].icons;if(a&&t>=0&&t<a.length)return i?a[a.length-t-1]:a[t]}return Xe.UpArrowGreen}function Z_(e,t){let i=!0,n=!0,a;for(a=0;a<t.length;a++)if(t[a].iconSetType!==e){i=!1;break}for(a=0;a<t.length;a++)if(parseInt(t[a].iconIndex,10)!==a){n=!1;break}return!i||!n}const sde=C.isNullOrUndefined;class bi{static getNewFormatRuleDialogOption(t,i){return{ruleTypeGroup:Kn.FormatOnValue,baseOnValueRuleType:go.ColorScale2,ruleScaleColor2:v0(void 0,i),ruleScaleColor3:x0(void 0,i),ruleDataBar:L0(),ruleIconSets:P0(),ruleFormatContain:Jb(t),ruleFormatAbove:D0(t),ruleFormatRankedValue:A0(t),ruleFormatUnique:w0(t),ruleUseFormula:C0(t),ruleUseRowColumnStates:T0(t,void 0,i)}}static ruleToRuleItem(t,i,n){let a=GC.Spread.Sheets.ConditionalFormatting.RuleType,r={ruleType:n.ruleType(),stopIfTrue:n.stopIfTrue(),ruleRange:cde(i,n),visible:n.visible,_idTag:n._idTag};switch(n.ruleType()){case a.cellValueRule:case a.specificTextRule:case a.dateOccurringRule:r.ruleValue=Jb(t,n);break;case a.duplicateRule:case a.uniqueRule:r.ruleValue=w0(t,n);break;case a.top10Rule:r.ruleValue=A0(t,n);break;case a.averageRule:r.ruleValue=D0(t,n);break;case a.dataBarRule:r.ruleValue=L0(n);break;case a.twoScaleRule:r.ruleValue=v0(n,i);break;case a.threeScaleRule:r.ruleValue=x0(n,i);break;case a.iconSetRule:r.ruleValue=P0(n);break;case a.formulaRule:r.ruleValue=C0(t,n);break;case a.rowStateRule:case a.columnStateRule:r.ruleValue=T0(t,n);break}return r}static ruleItemToRule(t,i){let n,a=GC.Spread.Sheets.ConditionalFormatting.RuleType;switch(i.ruleType){case a.cellValueRule:case a.specificTextRule:case a.dateOccurringRule:n=D_(t,i.ruleValue);break;case a.duplicateRule:case a.uniqueRule:n=G_(t,i.ruleValue);break;case a.top10Rule:n=H_(t,i.ruleValue);break;case a.averageRule:n=V_(t,i.ruleValue);break;case a.dataBarRule:n=B_(t,i.ruleValue);break;case a.twoScaleRule:n=O_(t,i.ruleValue);break;case a.threeScaleRule:n=E_(t,i.ruleValue);break;case a.iconSetRule:n=j_(t,i.ruleValue);break;case a.formulaRule:n=I_(t,i.ruleValue);break;case a.rowStateRule:case a.columnStateRule:n=F_(t,i.ruleValue);break}if(n){let r=Ae.stringToRange(t,i.ruleRange);n.ranges(r),n.stopIfTrue(i.stopIfTrue),n._idTag=i._idTag,n.visible=i.visible}return n}static ruleValueToRule(t,i){let n,a=r=>{switch(r){case go.ColorScale2:return O_(t,i.ruleScaleColor2);case go.ColorScale3:return E_(t,i.ruleScaleColor3);case go.DataBar:return B_(t,i.ruleDataBar);case go.IconSets:return j_(t,i.ruleIconSets)}};if(i)switch(i.ruleTypeGroup){case Kn.FormatOnValue:n=a(i.baseOnValueRuleType);break;case Kn.FormatContain:n=D_(t,i.ruleFormatContain);break;case Kn.FormatRankedValue:n=H_(t,i.ruleFormatRankedValue);break;case Kn.FormatAbove:n=V_(t,i.ruleFormatAbove);break;case Kn.FormatUnique:n=G_(t,i.ruleFormatUnique);break;case Kn.UseFormula:n=I_(t,i.ruleUseFormula);break;case Kn.UseRowColumnStates:n=F_(t,i.ruleUseRowColumnStates);break}return n}static applyRule(t,i){var n;t.suspendPaint();try{let a=C.getActualActiveSheet(t);if(a){let r=a.conditionalFormats;r.clearRule();let o=i.rules.ruleItems;for(let l=o.length-1;l>=0;l--){let c=bi.ruleItemToRule(t,o[l]);c&&y0(a,r,c)}}else{let r=t.getActiveSheetTab();if(C._isTableSheet(r)&&r.getDataView()){let l=(n=Pe.getContextDesigner())==null?void 0:n.getData(re.tableSheetSelectedColumn);if(!sde(l)&&l>=0){let c=[];I0(i,c),Oi(t,l,"conditionalFormats",c,kn.overwrite)}}}}finally{t.resumePaint()}}static validateConditionalFormatDialogFormula(t,i){try{bi.ruleValueToRule(Pe.getContextSpread(),t)}catch(n){let a=n===s.conditionalFormatting.newFormattingRule.invalidFormulaError?["gc-ribbon-condition-format-invalid-dialog"]:void 0;return i==null||i._showMessageBox(n,s.title,Re.warning,vt.ok,{classNames:a}),!1}return!0}static validateConditionalFormatHighLightCellsRulesFormula(t,i){try{t.value1!==void 0&&qo(t.value1,Pe.getContextSpread()),t.value2!==void 0&&qo(t.value2,Pe.getContextSpread())}catch(n){let a=n===s.conditionalFormatting.newFormattingRule.invalidFormulaError?["gc-ribbon-condition-format-invalid-dialog"]:void 0;return i==null||i._showMessageBox(n,s.title,Re.warning,vt.ok,{classNames:a}),!1}return!0}}function cde(e,t){let i="",n=t.ranges();if(n)for(let a=0;a<n.length;a++){let r=n[a],o=GC.Spread.Sheets.CalcEngine.rangeToFormula(r,0,0,GC.Spread.Sheets.CalcEngine.RangeReferenceRelative.allAbsolute,Ae.isUseR1C1(e));i=i+(a===0?"":",")+o}return i.startsWith("=")||(i="="+i),i}function dde(){return{templateName:G.TableSheetRuleManagerDialogTemplate,title:s.formattingRulesManagerDialog.title,content:[{type:"FlexContainer",children:[{type:"RuleManagerEditor",bindingPath:"rules",settings:{customApplyTo:!0}}]}],buttons:[{text:s.ok,buttonType:"Ok"},{text:s.close,buttonType:"Cancel"}]}}_e(G.TableSheetRuleManagerDialogTemplate,dde);function Ku(e){return typeof e=="boolean"}function U_(e){return typeof e=="number"}function Yb(e){return typeof e=="string"}function J_(e,t){return U_(e[t])}function I0(e,t,i){t.length=0;let n=e.rules.ruleItems;for(let a=n.length-1;a>=0;a--){let r=bi.ruleItemToRule(i,n[a]);if(r){let o=eO(r);t.push(o)}}}const M0=e=>{let t=new GC.Spread.Sheets.Style;return t.font=e,t};function Qu(e){var u;let t=Ke(e),i=e.formatter||"General",n=e.font?M0(e.font):M0(s.defaultFont),a=C.getFontSizeInPoint(n.fontSize),r=e.labelOptions,o=r&&r.font&&C.parseFont(r.font),l="none";t.textDecoration==="lineThroughUnderline"?(t.textDecoration=GC.Spread.Sheets.TextDecorationType.lineThrough|GC.Spread.Sheets.TextDecorationType.underline,l="single"):t.textDecoration==="lineThroughDoubleUnderline"?(t.textDecoration=GC.Spread.Sheets.TextDecorationType.lineThrough|GC.Spread.Sheets.TextDecorationType.doubleUnderline,l="double"):(t.textDecoration=GC.Spread.Sheets.TextDecorationType[e.textDecoration||"none"],t.textDecoration===GC.Spread.Sheets.TextDecorationType.underline?l="single":t.textDecoration===GC.Spread.Sheets.TextDecorationType.doubleUnderline&&(l="double"));let c="General";if(typeof i=="string"){let h=C.parseFormat(i);c=C.transToCategoryStr(h.category)}return{numberTabOption:{cellValue:"12345",formatter:i,category:{activeTab:c.toLowerCase()}},alignmentTabOption:{hAlign:GC.Spread.Sheets.HorizontalAlign[e.hAlign||"general"],vAlign:GC.Spread.Sheets.VerticalAlign[e.vAlign||"top"],textIndent:e.textIndent||0,wordWrap:e.wordWrap,shrinkToFit:e.shrinkToFit,merged:!1,showEllipsis:e.showEllipsis,showTextDirection:!1,orientation:{textOrientation:e.textOrientation||0,isVerticalText:e.isVerticalText||!1}},fontTabOption:{foreColor:e.foreColor||"#000000",fontFamily:C.trimQuote(n.fontFamily),fontSize:a?a.replace(/(pt|px)$/,""):null,fontStyle:C.getFormatDialogFontStyle(n),fontWeight:C.getFormatDialogFontWeight(n),fontUnderlineListAndEffects:{fontEffects:{fontStrikethrough:(t.textDecoration&GC.Spread.Sheets.TextDecorationType.lineThrough)>0},fontUnderlineList:l,textDecoration:t.textDecoration}},borderTabOption:{borderTop:qb(e.borderTop),borderBottom:qb(e.borderBottom),borderLeft:qb(e.borderLeft),borderRight:qb(e.borderRight),borderHorizontal:void 0,borderVertical:void 0,diagonalUp:void 0,diagonalDown:void 0,enableBorderHorizontal:!1,enableBorderVertical:!1},fillTabOption:{backColor:hde(e.backColor)},cellButtonTabOption:{cellButtons:pde(e.cellButtons),dropDowns:mde(e.dropDowns)},paddingTabOption:{text:e.watermark||"",alignment:GC.Spread.Sheets.LabelAlignment[r==null?void 0:r.alignment]||0,font:{fontFamily:o&&o.fontFamily||s.fontPicker.fontFamilies.Calibri,fontSize:o?(u=o.fontSize)==null?void 0:u.replace(/(pt|px)$/,""):"11",fontStyle:!!(o&&o.fontStyle.indexOf("italic")>=0),fontWeight:!!(o&&o.fontWeight==="bold"),foreColor:r?r.foreColor:"#808080"},margin:Ae.parseMargin(r==null?void 0:r.margin),padding:Ae.parseMargin(e==null?void 0:e.cellPadding),visibility:r?Ae.parseVisibility(r.visibility):GC.Spread.Sheets.LabelVisibility.auto},protectionTabOption:{locked:!1},dialogOption:{showTabList:[dt.Number,dt.Alignment,dt.Font,dt.Border,dt.Fill,dt.CellButton,dt.Padding]}}}function Xu(e,t){var i;if(e){if(e.hasOwnProperty("formatter")&&(t.formatter=e.formatter),Gi(e.hAlign)||(t.hAlign=GC.Spread.Sheets.HorizontalAlign[e.hAlign]),Gi(e.vAlign)||(t.vAlign=GC.Spread.Sheets.VerticalAlign[e.vAlign]),Gi(e.isVerticalText)||(t.isVerticalText=e.isVerticalText),Gi(e.showEllipsis)||(t.showEllipsis=e.showEllipsis),Gi(e.shrinkToFit)||(t.shrinkToFit=e.shrinkToFit),Gi(e.textOrientation)||(t.textOrientation=e.textOrientation),Gi(e.wordWrap)||(t.wordWrap=e.wordWrap),Gi(e.textIndent)||(t.textIndent=e.textIndent),Gi(e.foreColor)||(t.foreColor=e.foreColor),Gi(e.textDecoration)||(e.textDecoration===(GC.Spread.Sheets.TextDecorationType.lineThrough|GC.Spread.Sheets.TextDecorationType.underline)?t.textDecoration="lineThroughUnderline":e.textDecoration===(GC.Spread.Sheets.TextDecorationType.lineThrough|GC.Spread.Sheets.TextDecorationType.doubleUnderline)?t.textDecoration="lineThroughDoubleUnderline":t.textDecoration=GC.Spread.Sheets.TextDecorationType[e.textDecoration||GC.Spread.Sheets.TextDecorationType.none]),e.borderBottom&&(t.borderBottom=$a(e.borderBottom)),e.borderTop&&(t.borderTop=$a(e.borderTop)),e.borderLeft&&(t.borderLeft=$a(e.borderLeft)),e.borderRight&&(t.borderRight=$a(e.borderRight)),e.diagonalDown&&(t.diagonalDown=$a(e.diagonalDown)),e.diagonalUp&&(t.diagonalUp=$a(e.diagonalUp)),Gi(e.backColor)||(t.backColor=k0(e.backColor)),e.cellButtons&&(t.cellButtons=K_(e.cellButtons)),e.dropDowns&&(t.dropDowns=Q_(e.dropDowns)),Gi(e.cellPadding)||(t.cellPadding=e.cellPadding),e.watermark&&(t.watermark=e.watermark),e.labelOptions||e.watermark||e.cellPadding){e.labelOptions||(e.labelOptions={});let n=e.labelOptions.alignment||0,a=Gi(e.labelOptions.visibility)?2:e.labelOptions.visibility,r={font:e.labelOptions.font,foreColor:e.labelOptions.foreColor,margin:e.labelOptions.margin,alignment:GC.Spread.Sheets.LabelAlignment[n],visibility:GC.Spread.Sheets.LabelVisibility[a]};t.labelOptions=r}if(e.font){let n=t.font?M0(t.font):void 0,a=n!=null&&n.font?n:C.parseFont(s.defaultFont),r=[(e.font.fontStyle||a.fontStyle||"").replace("bold","").trim(),e.font.fontWeight||a.fontWeight,(e.font.fontSize||((i=a.fontSize)==null?void 0:i.replace("pt","")))+"pt",e.font.fontFamily||a.fontFamily];t.font=r.join(" ")}for(const n of Object.keys(e))if(["LT","RT","LB","RB","cornerFoldSize","cornerFoldColor","styleDecorationIcons"].indexOf(n)>-1){t.decoration=ude(e);break}}}function ude(e){let t={position:0,size:0,color:""};if(e.LT&&(t.position=GC.Spread.Sheets.CornerPosition.leftTop),e.RT&&(t.position|=GC.Spread.Sheets.CornerPosition.rightTop),e.LB&&(t.position|=GC.Spread.Sheets.CornerPosition.leftBottom),e.RB&&(t.position|=GC.Spread.Sheets.CornerPosition.rightBottom),e.cornerFoldSize!==void 0&&(t.size=e.cornerFoldSize),e.cornerFoldColor!==void 0&&(t.color=e.cornerFoldColor),e.decoration={cornerFold:t},!C.isEmpty(e.styleDecorationIcons)){let i=e.styleDecorationIcons.filter(n=>!C.isEmpty(n.src));C.isEmpty(i)||(e.decoration.icons=i),delete e.styleDecorationIcons}return e.decoration}function Ko(e,t){var d;let i=(d=e.numberTabOption)==null?void 0:d.formatter;i&&(t.formatter=i);let n=e.alignmentTabOption;if(n){let{hAlign:u,vAlign:h,textIndent:g,wordWrap:f,shrinkToFit:b,showEllipsis:S,orientation:y}=n;Gi(u)||(t.hAlign=GC.Spread.Sheets.HorizontalAlign[u]),Gi(h)||(t.vAlign=GC.Spread.Sheets.VerticalAlign[h]),t.textIndent=g,t.wordWrap=f,t.shrinkToFit=b,t.showEllipsis=S,t.textOrientation=y==null?void 0:y.textOrientation,t.isVerticalText=y==null?void 0:y.isVerticalText}let a=e.fontTabOption;if(a){let u=[(a.fontStyle||"").replace("bold","").trim(),a.fontWeight||"",a.fontSize+"pt",a.fontFamily];t.font=u.join(" ");let h="none",g=a.fontUnderlineListAndEffects;g&&g.fontUnderlineList==="single"&&(h="underline"),g&&g.fontUnderlineList==="double"&&(h="doubleUnderline"),g&&g.fontEffects&&g.fontEffects.fontStrikethrough&&(h="lineThrough"),t.textDecoration=h,t.foreColor=a.foreColor}let r=e.borderTabOption;r&&(t.borderLeft=$a(r.borderLeft),t.borderRight=$a(r.borderRight),t.borderTop=$a(r.borderTop),t.borderBottom=$a(r.borderBottom));let o=e.fillTabOption;o&&(t.backColor=k0(o.backColor));let l=e.cellButtonTabOption;l&&(t.cellButtons=K_(l.cellButtons),t.dropDowns=Q_(l.dropDowns));let c=e.paddingTabOption;if(c){t.watermark=c.text;let u=t.labelOptions;if(u||(u=t.labelOptions={}),u){c.alignment&&(u.alignment=GC.Spread.Sheets.LabelAlignment[c.alignment]),c.visibility&&(u.visibility=c.visibility);let S=c.font;S&&S.foreColor&&(u.foreColor=S.foreColor),S&&(u.font=[S.fontStyle?"italic":"",S.fontWeight?"bold":"",S.fontSize?S.fontSize+"pt":"",S.fontFamily?S.fontFamily:""].join(" ").trim())}let h=c.margin;u&&h&&(u.margin=[h.top,h.right,h.bottom,h.left].join(" "));let g=c.padding;g&&(t.cellPadding=[g.top,g.right,g.bottom,g.left].join(" "))}}function Y_(e){let t={};switch(e.type){case"number":{t.criteriaType=e.isIntegerValue?GC.Spread.Sheets.DataValidation.CriteriaType.wholeNumber:GC.Spread.Sheets.DataValidation.CriteriaType.decimalValues,t.rangeSelect1=e.value1,t.rangeSelect2=e.value2;break}case"date":{t.criteriaType=GC.Spread.Sheets.DataValidation.CriteriaType.date,t.rangeSelect1=tO(e.value1),t.rangeSelect2=tO(e.value2);break}case"textLength":{t.criteriaType=GC.Spread.Sheets.DataValidation.CriteriaType.textLength,t.rangeSelect1=e.value1,t.rangeSelect2=e.value2;break}case"formula":{t.criteriaType=GC.Spread.Sheets.DataValidation.CriteriaType.custom,t.rangeSelect1=e.formula;break}case"formulaList":{t.criteriaType=GC.Spread.Sheets.DataValidation.CriteriaType.list,t.rangeSelect1=e.formula;break}case"list":{t.criteriaType=GC.Spread.Sheets.DataValidation.CriteriaType.list,t.rangeSelect1=e.source;break}default:{t.criteriaType=GC.Spread.Sheets.DataValidation.CriteriaType.anyValue,t.rangeSelect1="",t.rangeSelect2="";break}}t.comparisonOperator=Gi(e.comparisonOperator)?GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between:GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators[e.comparisonOperator],t.ignoreBlank=Gi(e.ignoreBlank)?!0:e.ignoreBlank,t.inCellDropdown=Gi(e.inCellDropdown)?!0:e.inCellDropdown,t.showInputMsg=Gi(e.showInputMessage)?!0:e.showInputMessage,t.inputMsgTitle=e.inputTitle||"",t.inputMsg=e.inputMessage||"",t.showErrorMsg=Gi(e.showErrorMessage)?!0:e.showErrorMessage,t.styleType=Gi(e.errorStyle)?GC.Spread.Sheets.DataValidation.ErrorStyle.stop:GC.Spread.Sheets.DataValidation.ErrorStyle[e.errorStyle],t.errorTitle=e.errorTitle||"",t.errorMsg=e.errorMessage||"";let i=e.highlightStyle;return i?(t.highlightType=GC.Spread.Sheets.DataValidation.HighlightType[i.type],t.highlightColor=i.color,t.highlightPosition_dogear=GC.Spread.Sheets.DataValidation.HighlightPosition[i.position],t.highlightPosition_icon=GC.Spread.Sheets.DataValidation.HighlightPosition[i.position],t.highlightIcon=i.image):(t.highlightType=GC.Spread.Sheets.DataValidation.HighlightType.circle,t.highlightColor="#FF0000",t.highlightPosition_dogear=GC.Spread.Sheets.DataValidation.HighlightPosition.topLeft,t.highlightPosition_icon=GC.Spread.Sheets.DataValidation.HighlightPosition.outsideLeft,t.highlightIcon=""),t}function q_(e,t){let i=e.rangeSelect1,n=e.rangeSelect2;const a=GC.Spread.Sheets.DataValidation.CriteriaType;switch(e.criteriaType){case a.wholeNumber:t.type="number",t.value1=fs(i)?i:Number(i),t.value2=fs(n)?n:Number(n),t.isIntegerValue=!0;break;case a.decimalValues:t.type="number",t.value1=fs(i)?i:Number(i),t.value2=fs(n)?n:Number(n),t.isIntegerValue=!1;break;case a.date:t.type="date",t.value1=fs(i)?i:new Date(i),t.value2=fs(n)?n:new Date(n);break;case a.textLength:t.type="textLength",t.value1=fs(i)?i:Number(i),t.value2=fs(n)?n:Number(n);break;case a.custom:t.type="formula",t.formula=i;break;case a.list:fs(i)?(t.type="formulaList",t.formula=i):(t.type="list",t.source=i);break;default:{t.type="",t.value1="",t.value2="",t.isIntegerValue=!1,t.formula="",t.source="";break}}t.comparisonOperator=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators[e.comparisonOperator],t.showInputMessage=e.showInputMsg,t.inputTitle=e.inputMsgTitle,t.inputMessage=e.inputMsg,t.showErrorMessage=e.showErrorMsg,t.errorTitle=e.errorTitle,t.errorMessage=e.errorMsg,t.errorStyle=GC.Spread.Sheets.DataValidation.ErrorStyle[e.styleType],t.ignoreBlank=e.ignoreBlank,t.inCellDropdown=e.inCellDropdown;const r=e.highlightType,o=e.highlightPosition_dogear,l=e.highlightPosition_icon,c=GC.Spread.Sheets.DataValidation.HighlightType,d=GC.Spread.Sheets.DataValidation.HighlightPosition;let u=g=>{switch(g){case d.topLeft:return"topLeft";case d.topRight:return"topRight";case d.bottomRight:return"bottomRight";case d.bottomLeft:return"bottomLeft"}},h=(g,f)=>{switch(g){case d.outsideLeft:f.highlightStyle={type:"icon",color:e.highlightColor,position:"outsideLeft",image:e.highlightIcon};break;case d.outsideRight:f.highlightStyle={type:"icon",color:e.highlightColor,position:"outsideRight",image:e.highlightIcon};break}};switch(r){case c.circle:t.highlightStyle={type:"circle",color:e.highlightColor};break;case c.dogEar:let g=u(o)||d.topLeft;t.highlightStyle={type:"dogEar",color:e.highlightColor,position:g};break;case c.icon:h(l,t);break}}function Gi(e){return e==null}function qb(e){if(e&&e.style)return new GC.Spread.Sheets.LineBorder(e.color,GC.Spread.Sheets.LineStyle[e.style])}function $a(e){if(e)return{color:e.color,style:GC.Spread.Sheets.LineStyle[e.style]}}function hde(e){return e&&e.stops?e:e&&e.type?{type:e.type&&GC.Spread.Sheets.PatternType[e.type]||void 0,patternColor:e.patternColor,backgroundColor:e.backgroundColor}:e||""}function k0(e){return e&&e.stops?e:e&&e.type?{type:e.type&&GC.Spread.Sheets.PatternType[e.type]||void 0,patternColor:e.patternColor,backgroundColor:e.backgroundColor}:e||void 0}function pde(e){return e&&e.length>0?e.map(function(t){return{position:t.position&&GC.Spread.Sheets.ButtonPosition[t.position],useButtonStyle:t.useButtonStyle,enabled:t.enabled,width:t.width,caption:t.caption,imageSrc:t.imageSrc,imageSize:t.imageSize,captionAlign:t.captionAlign&&GC.Spread.Sheets.CaptionAlignment[t.captionAlign],command:t.command,imageType:t.imageType&&GC.Spread.Sheets.ButtonImageType[t.imageType],visibility:t.visibility&&GC.Spread.Sheets.ButtonVisibility[t.visibility],hoverBackColor:t.hoverBackColor,buttonBackColor:t.buttonBackColor}}):[]}function K_(e){return e&&e.length>0?e.map(function(t){return{position:!Gi(t.position)&&GC.Spread.Sheets.ButtonPosition[t.position],useButtonStyle:t.useButtonStyle,enabled:t.enabled,width:t.width,caption:t.caption,imageSrc:t.imageSrc,imageSize:t.imageSize,captionAlign:!Gi(t.captionAlign)&&GC.Spread.Sheets.CaptionAlignment[t.captionAlign],command:t.command,imageType:!Gi(t.imageType)&&GC.Spread.Sheets.ButtonImageType[t.imageType],visibility:!Gi(t.visibility)&&GC.Spread.Sheets.ButtonVisibility[t.visibility],hoverBackColor:t.hoverBackColor,buttonBackColor:t.buttonBackColor}}):[]}function mde(e){return e&&e.length>0?e.map(function(t){return{type:t.type&&GC.Spread.Sheets.DropDownType[t.type],option:X_(t.option),submitCommand:t.submitCommand}}):[]}function Q_(e){return e&&e.length>0?e.map(function(t){return{type:t.type&&GC.Spread.Sheets.DropDownType[t.type],option:X_(t.option),submitCommand:t.submitCommand}}):[]}function gde(e){if(e)return{cornerFold:e.cornerFold,icons:e.icons&&e.icons.length>0?e.icons.map(t=>({src:t.src,width:t.width,height:t.height,position:C.isNullOrUndefined(t.position)?void 0:GC.Spread.Sheets.IconPosition[t.position]})):void 0}}function X_(e){let t=C.deepClone(e),i=e.calendarPage;Gi(i)||(t.calendarPage=GC.Spread.Sheets.CalendarPage[i]);let n=e.startDay;Gi(n)||(t.startDay=GC.Spread.Sheets.CalendarStartDay[n]);let a=e.layout;if(a){let l=a.direction;Gi(l)||(t.layout.direction=GC.Spread.Sheets.LayoutDirection[l]);let c=a.displayAs;Gi(c)||(t.layout.displayAs=GC.Spread.Sheets.LayoutDisplayAs[c])}let r=e.valueType;Gi(r)||(t.valueType=GC.Spread.Sheets.DropdownListValue[r]);let o=e.direction;return Gi(o)||(t.direction=GC.Spread.Sheets.LayoutDirection[o]),t}function R0(e){let t;const i=e.ruleType,n=[],a=new GC.Spread.Sheets.Style(e.style||{});switch(i){case"cellValueRule":{t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule,n,a,GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators[e.comparisonOperator],e.value1,e.value2,void 0,void 0,void 0,void 0);break}case"specificTextRule":{t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.specificTextRule,n,a,GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators[e.comparisonOperator],void 0,void 0,e.text,void 0,void 0,void 0);break}case"formulaRule":t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.formulaRule,n,a,void 0,void 0,void 0,void 0,e.formula,void 0,void 0);break;case"dateOccurringRule":{t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.dateOccurringRule,n,a,void 0,void 0,void 0,void 0,void 0,GC.Spread.Sheets.ConditionalFormatting.DateOccurringType[e.type],void 0);break}case"top10Rule":{t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule,n,a,void 0,void 0,void 0,void 0,void 0,GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType[e.type],e.rank);break}case"uniqueRule":t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.uniqueRule,n,a,void 0,void 0,void 0,void 0,void 0,void 0,void 0);break;case"duplicateRule":t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.duplicateRule,n,a,void 0,void 0,void 0,void 0,void 0,void 0,void 0);break;case"averageRule":{t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.averageRule,n,a,void 0,void 0,void 0,void 0,void 0,GC.Spread.Sheets.ConditionalFormatting.AverageConditionType[e.type],void 0);break}case"twoScaleRule":t=new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.twoScaleRule,e.minType,e.minValue,e.minColor,void 0,void 0,void 0,e.maxType,e.maxValue,e.maxColor,n);break;case"threeScaleRule":t=new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule,e.minType,e.minValue,e.minColor,e.midType,e.midValue,e.midColor,e.maxType,e.maxValue,e.maxColor,n);break;case"dataBarRule":t=new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(e.minType,e.minValue,e.maxType,e.maxValue,e.color,n);const{gradient:r,showBarOnly:o,showBorder:l,borderColor:c,dataBarDirection:d,negativeData:u}=e;if(Ku(r)&&t.gradient(r),Ku(o)&&t.showBarOnly(o),Ku(l)&&t.showBorder(l),Yb(c)&&t.borderColor(c),J_(GC.Spread.Sheets.ConditionalFormatting.BarDirection,d)&&t.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection[d]),u){const{negativeFillColor:h,useNegativeFillColor:g,negativeBorderColor:f,useNegativeBorderColor:b,axisColor:S,axisPosition:y}=u;Yb(h)&&t.negativeFillColor(h),Ku(g)&&t.useNegativeFillColor(g),Yb(f)&&t.negativeBorderColor(f),Ku(b)&&t.useNegativeBorderColor(b),Yb(S)&&t.axisColor(S),J_(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition,y)&&t.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition[y])}break;case"iconSetRule":{if(t=new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(GC.Spread.Sheets.ConditionalFormatting.IconSetType[e.iconSetType],n),t.reverseIconOrder(e.reverseIconOrder),t.showIconOnly(e.showIconOnly),e.icons){let h=e.icons.map(function(g){return{iconSetType:GC.Spread.Sheets.ConditionalFormatting.IconSetType[g.iconSetType],iconIndex:g.iconIndex}});t.icons(h)}if(e.iconCriteria){let h=t.iconCriteria();e.iconCriteria.map(function(g,f){h[f]={iconValueType:GC.Spread.Sheets.ConditionalFormatting.IconValueType[g.iconValueType],isGreaterThanOrEqualTo:g.isGreaterThanOrEqualTo,iconValue:fo(g.iconValue)}}),t.iconCriteria(h)}break}}return t&&Ku(e.stopIfTrue)&&t.stopIfTrue(e.stopIfTrue),t}function fde(e,t){return Gi(t)?void 0:e[t]}function $_(e){let t={};return t.backColor=k0(e.backColor),t.foreColor=e.foreColor,t.font=e.font,t.formatter=e.formatter,t.borderLeft=$a(e.borderLeft),t.borderTop=$a(e.borderTop),t.borderRight=$a(e.borderRight),t.borderBottom=$a(e.borderBottom),t.diagonalDown=$a(e.diagonalDown),t.diagonalUp=$a(e.diagonalUp),U_(e.textDecoration)&&(e.textDecoration===(GC.Spread.Sheets.TextDecorationType.lineThrough|GC.Spread.Sheets.TextDecorationType.underline)?t.textDecoration="lineThroughUnderline":e.textDecoration===(GC.Spread.Sheets.TextDecorationType.lineThrough|GC.Spread.Sheets.TextDecorationType.doubleUnderline)?t.textDecoration="lineThroughDoubleUnderline":t.textDecoration=fde(GC.Spread.Sheets.TextDecorationType,e.textDecoration)),t.decoration=gde(e.decoration),t}function eO(e){let t={};const i=e.ruleType(),n=e.style();switch(n&&(t.style=$_(n)),i){case GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule:{let a=e.operator();t.comparisonOperator=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators[a],t.value1=e.value1(),t.value2=e.value2(),t.ruleType="cellValueRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.specificTextRule:{let a=e.operator();t.comparisonOperator=GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators[a],t.text=e.text(),t.ruleType="specificTextRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.formulaRule:{t.formula=e.formula(),t.ruleType="formulaRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.dateOccurringRule:{let a=e.type();t.type=GC.Spread.Sheets.ConditionalFormatting.DateOccurringType[a],t.ruleType="dateOccurringRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule:{let a=e.type();t.type=GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType[a],t.rank=e.rank(),t.ruleType="top10Rule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.uniqueRule:t.ruleType="uniqueRule";break;case GC.Spread.Sheets.ConditionalFormatting.RuleType.duplicateRule:t.ruleType="duplicateRule";break;case GC.Spread.Sheets.ConditionalFormatting.RuleType.averageRule:{let a=e.type();t.type=GC.Spread.Sheets.ConditionalFormatting.AverageConditionType[a],t.ruleType="averageRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.twoScaleRule:{t.minType=e.minType(),t.minValue=e.minValue(),t.minColor=e.minColor(),t.maxType=e.maxType(),t.maxValue=e.maxValue(),t.maxColor=e.maxColor(),t.ruleType="twoScaleRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule:{t.minType=e.minType(),t.minValue=e.minValue(),t.minColor=e.minColor(),t.midType=e.midType(),t.midValue=e.midValue(),t.midColor=e.midColor(),t.maxType=e.maxType(),t.maxValue=e.maxValue(),t.maxColor=e.maxColor(),t.ruleType="threeScaleRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.dataBarRule:{t.minType=e.minType(),t.minValue=e.minValue(),t.maxType=e.maxType(),t.maxValue=e.maxValue(),t.color=e.color(),t.gradient=e.gradient(),t.showBarOnly=e.showBarOnly(),t.showBorder=e.showBorder(),t.borderColor=e.borderColor();let a=e.dataBarDirection();t.dataBarDirection=GC.Spread.Sheets.ConditionalFormatting.BarDirection[a],t.negativeData={},t.negativeData.negativeFillColor=e.negativeFillColor(),t.negativeData.useNegativeFillColor=e.useNegativeFillColor(),t.negativeData.negativeBorderColor=e.negativeBorderColor(),t.negativeData.useNegativeBorderColor=e.useNegativeBorderColor(),t.negativeData.axisColor=e.axisColor();let r=e.axisPosition();t.negativeData.axisPosition=GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition[r],t.ruleType="dataBarRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.iconSetRule:{let a=e.iconSetType();t.iconSetType=GC.Spread.Sheets.ConditionalFormatting.IconSetType[a],t.reverseIconOrder=e.reverseIconOrder(),t.showIconOnly=e.showIconOnly(),t.ruleType="iconSetRule";let r=e.icons().map(function(l){return{iconSetType:GC.Spread.Sheets.ConditionalFormatting.IconSetType[l.iconSetType],iconIndex:l.iconIndex}});t.icons=r;let o=e.iconCriteria().map(function(l){return{iconValueType:GC.Spread.Sheets.ConditionalFormatting.IconValueType[l.iconValueType],isGreaterThanOrEqualTo:l.isGreaterThanOrEqualTo,iconValue:fo(l.iconValue)}});t.iconCriteria=o;break}}return t.stopIfTrue=e.stopIfTrue(),t}function tO(e){return e==null?"":e&&e.getDate?[e.getMonth()+1,e.getDate(),e.getFullYear()].join("/"):e+""}function fs(e){return!!e&&e[0]==="="}var kn=(e=>(e[e.add=0]="add",e[e.replace=1]="replace",e[e.overwrite=2]="overwrite",e))(kn||{});class bde extends oe.DesignerActionBase{executeImp(t,i,n){var o,l;let a=this.spread();a.suspendPaint();let r=a.getActiveSheetTab();if(C._isTableSheet(r)){let c=r.getDataView();if(c){let d=c.getColumn(i.columnIndex);if(i.prop==="dataType"){let u=d[i.prop],h=u==="string"||u==="number";if(!h){let g=((o=c.getTable().getSourceData())==null?void 0:o[d.value])||[];for(const f of g)if(!C.isNullOrUndefined(f)){let b=typeof f;h=b==="number"||b==="string";break}if(!h)return a.resumePaint(),!1}}if(i.prop==="conditionalFormats"?Sde(d,i):d[i.prop]=i.value,i.prop==="dataType"||i.prop==="isPrimaryKey"){let u=c.tableName,g=a.dataManager().tables[u].options.schema;g&&(g.columns=(l=g.columns)!=null?l:{}),i.prop==="dataType"?c.updateColumnDataType(d.value,i.value):i.prop==="isPrimaryKey"&&c.updateColumnIsPrimaryKeyType(d.value,i.value)}c.setGroupSliceColumnSettings(d,i.prop),c.updateColumnSettingToGroupOptions(d,i.prop),c.updateColumn(d),r.refreshBindColumns(),r.applyStyleRules()}}a.resumePaint()}}let iO={canUndo:!0,execute:function(e,t,i){return new bde(e,t).execute(e,t,i)}};function Sde(e,t){e.conditionalFormats||(e.conditionalFormats=[]);let i=t.value,n=t.applyStatus;if(n!==2){let a=[...e.conditionalFormats];for(const r of i){if(n===1){for(let o=a.length-1;o>=0;o--)if(a[o].ruleType===r.ruleType){a.splice(o,1);break}}a.push(r)}e.conditionalFormats=a}else e.conditionalFormats=i}function Cde(e,t){let i="Designer."+t;e.commandManager().register(i,iO,void 0,!1,!1,!1,!1)}function Oi(e,t,i,n,a){let r={columnIndex:t,prop:i,value:n,applyStatus:a};oe.runCommand(e,"changeTableSheetColumnSetting",iO,r)}function bs(e){let t=e.getSelections();return t[0]?t[0].col:-1}function $u(e,t,i,n){let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()&&n>=0){let o=eO(t);Oi(e,n,"conditionalFormats",[o],i)}}const bo=(e,t,i,n)=>{let a=e.Spread,r=C.getActiveSheet(a);if(r){let o,l=r.getSelections(),c=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.highestValue,d=null,u=t,h=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.lowestValue,g=null,f=i,b=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.percentile,S=50;if(n){let y=i;f=n,o=new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule,h,g,f,b,S,y,c,d,u,l)}else o=new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.twoScaleRule,h,g,f,null,null,null,c,d,u,l);oa(a,!0,o)}else{let o=a.getActiveSheetTab();if(C._isTableSheet(o)&&o.getDataView()){let c=e.getData(re.tableSheetSelectedColumn);if(c>=0){let d;n?d=[{ruleType:"threeScaleRule",minType:"lowestValue",minValue:null,minColor:n,midType:"percentile",midValue:50,midColor:i,maxType:"highestValue",maxValue:null,maxColor:t}]:d=[{ruleType:"twoScaleRule",minType:"lowestValue",minValue:null,minColor:i,maxType:"highestValue",maxValue:null,maxColor:t}],Oi(a,c,"conditionalFormats",d,kn.replace)}}}e.setData(re.isFileModified,!0)};let yde={iconClass:"gc-ribbon-bwr-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleBwr,tip:"${res.conditionalFormat.colorScales.bwr}",execute:(e,t,i)=>{bo(e,"blue","white","red")},init:e=>{$ce(e.Spread,"addRule")}};const vde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleBwr:yde},Symbol.toStringTag,{value:"Module"}));let xde={iconClass:"gc-ribbon-gw-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleGw,tip:"${res.conditionalFormat.colorScales.gw}",execute:(e,t,i)=>{bo(e,"green","white")}};const Lde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleGw:xde},Symbol.toStringTag,{value:"Module"}));let Tde={iconClass:"gc-ribbon-gwr-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleGwr,tip:"${res.conditionalFormat.colorScales.gwr}",execute:(e,t,i)=>{bo(e,"green","white","red")}};const wde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleGwr:Tde},Symbol.toStringTag,{value:"Module"}));let Dde={iconClass:"gc-ribbon-gy-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleGy,tip:"${res.conditionalFormat.colorScales.gy}",execute:(e,t,i)=>{bo(e,"green","yellow")}};const Ade=Object.freeze(Object.defineProperty({__proto__:null,colorScaleGy:Dde},Symbol.toStringTag,{value:"Module"}));let Pde={iconClass:"gc-ribbon-gyr-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleGyr,tip:"${res.conditionalFormat.colorScales.gyr}",execute:(e,t,i)=>{bo(e,"green","yellow","red")}};const Ide=Object.freeze(Object.defineProperty({__proto__:null,colorScaleGyr:Pde},Symbol.toStringTag,{value:"Module"}));let Mde={iconClass:"gc-ribbon-rw-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleRw,tip:"${res.conditionalFormat.colorScales.rw}",execute:(e,t,i)=>{bo(e,"red","white")}};const kde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleRw:Mde},Symbol.toStringTag,{value:"Module"}));let Rde={iconClass:"gc-ribbon-rwb-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleRwb,tip:"${res.conditionalFormat.colorScales.rwb}",execute:(e,t,i)=>{bo(e,"red","white","blue")}};const _de=Object.freeze(Object.defineProperty({__proto__:null,colorScaleRwb:Rde},Symbol.toStringTag,{value:"Module"}));let Ode={iconClass:"gc-ribbon-rwg-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleRwg,tip:"${res.conditionalFormat.colorScales.rwg}",execute:(e,t,i)=>{bo(e,"red","white","green")}};const Ede=Object.freeze(Object.defineProperty({__proto__:null,colorScaleRwg:Ode},Symbol.toStringTag,{value:"Module"}));let Nde={iconClass:"gc-ribbon-ryg-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleRyg,tip:"${res.conditionalFormat.colorScales.ryg}",execute:(e,t,i)=>{bo(e,"red","yellow","green")}};const Bde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleRyg:Nde},Symbol.toStringTag,{value:"Module"}));let Fde={iconClass:"gc-ribbon-wg-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleWg,tip:"${res.conditionalFormat.colorScales.wg}",execute:(e,t,i)=>{bo(e,"white","green")}};const Gde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleWg:Fde},Symbol.toStringTag,{value:"Module"}));let Vde={iconClass:"gc-ribbon-wr-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleWr,tip:"${res.conditionalFormat.colorScales.wr}",execute:(e,t,i)=>{bo(e,"white","red")}};const Hde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleWr:Vde},Symbol.toStringTag,{value:"Module"}));let zde={iconClass:"gc-ribbon-yg-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleYg,tip:"${res.conditionalFormat.colorScales.yg}",execute:(e,t,i)=>{bo(e,"yellow","green")}};const jde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleYg:zde},Symbol.toStringTag,{value:"Module"}));let Wde={commandName:p.ColorScalesList2,title:"${res.conditionalFormat.colorScales.title}"},Zde={commandName:p.ColorScalesList,text:"${res.conditionalFormat.colorScales.title}",iconClass:"ribbon-control-dropdown-color-scales",bigButton:"=ribbonHeight>toolbarHeight",comboWidth:170};const Ude=Object.freeze(Object.defineProperty({__proto__:null,ColorScalesList:Wde,colorScalesList:Zde},Symbol.toStringTag,{value:"Module"}));let Jde={text:"${res.conditionalFormat.moreRules}",title:"${res.conditionalFormat.moreColorScaleRules}",commandName:p.MoreColorScaleRules,controlOption:{className:"more-rules-item"},execute:async(e,t)=>{let i=await e._showDialog(G.NewFormattingRuleDialogTemplate,bi.getNewFormatRuleDialogOption(e,e.Spread),bi.validateConditionalFormatDialogFormula);i&&(Yde(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Yde(e,t,i){let n=bi.ruleValueToRule(e,t);if(n){let a=C.getActiveSheet(e);if(a){if(!n.ranges()){let o=a.getSelections();n.ranges(o)}oa(e,!1,n)}else $u(e,n,kn.add,i)}}const qde=Object.freeze(Object.defineProperty({__proto__:null,moreRules:Jde},Symbol.toStringTag,{value:"Module"}));let Kde={commandName:p.GradientFill,title:"${res.conditionalFormat.gradientFill.title}"},Qde={commandName:p.SolidFill,title:"${res.conditionalFormat.solidFill.title}"},Xde={commandName:p.DataBar,text:"${res.conditionalFormat.dataBars}",iconClass:"ribbon-control-dropdown-data-bars",bigButton:"=ribbonHeight>toolbarHeight",comboWidth:126};const $de=Object.freeze(Object.defineProperty({__proto__:null,dataBar:Xde,gradientFill:Kde,solidFill:Qde},Symbol.toStringTag,{value:"Module"})),Kb="(Automatic)",So=(e,t,i)=>{let n=e.Spread,a=C.getActiveSheet(n);if(a){let r=a.getSelections(),o=new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.automin,Kb,GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.automax,Kb,t,r);o.gradient(i),oa(n,!0,o)}else{let r=n.getActiveSheetTab();if(C._isTableSheet(r)&&r.getDataView()){let l=e.getData(re.tableSheetSelectedColumn);l>=0&&Oi(n,l,"conditionalFormats",[{ruleType:"dataBarRule",minType:"automin",minValue:Kb,maxType:"automax",maxValue:Kb,color:t,gradient:i}],kn.replace)}}e.setData(re.isFileModified,!0)};let eue={iconClass:"gc-ribbon-gradient-fill-blue-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.GradientFillBlueDataBar,tip:"${res.conditionalFormat.gradientFill.blue}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"blue",!0)}};const tue=Object.freeze(Object.defineProperty({__proto__:null,gradientFillBlueDataBar:eue},Symbol.toStringTag,{value:"Module"}));let iue={iconClass:"gc-ribbon-gradient-fill-green-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.GradientFillGreenDataBar,tip:"${res.conditionalFormat.gradientFill.green}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"green",!0)}};const nue=Object.freeze(Object.defineProperty({__proto__:null,gradientFillGreenDataBar:iue},Symbol.toStringTag,{value:"Module"}));let aue={iconClass:"gc-ribbon-gradient-fill-lightblue-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.GradientFillLightBlueDataBar,tip:"${res.conditionalFormat.gradientFill.lightBlue}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"lightblue",!0)}};const rue=Object.freeze(Object.defineProperty({__proto__:null,gradientFillLightBlueDataBar:aue},Symbol.toStringTag,{value:"Module"}));let oue={iconClass:"gc-ribbon-gradient-fill-orange-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.GradientFillOrangeDataBar,tip:"${res.conditionalFormat.gradientFill.orange}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"orange",!0)}};const lue=Object.freeze(Object.defineProperty({__proto__:null,gradientFillOrangeDataBar:oue},Symbol.toStringTag,{value:"Module"}));let sue={iconClass:"gc-ribbon-gradient-fill-purple-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.GradientFillPurpleDataBar,tip:"${res.conditionalFormat.gradientFill.purple}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"purple",!0)}};const cue=Object.freeze(Object.defineProperty({__proto__:null,gradientFillPurpleDataBar:sue},Symbol.toStringTag,{value:"Module"}));let due={iconClass:"gc-ribbon-gradient-fill-red-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.GradientFillRedDataBar,tip:"${res.conditionalFormat.gradientFill.red}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"red",!0)}};const uue=Object.freeze(Object.defineProperty({__proto__:null,gradientFillRedDataBar:due},Symbol.toStringTag,{value:"Module"}));let hue={text:"${res.conditionalFormat.moreRules}",title:"${res.conditionalFormat.moreDataBarRules}",commandName:p.MoreDataBarRules,controlOption:{className:"more-rules-item"},execute:async(e,t)=>{let i=bi.getNewFormatRuleDialogOption(e,e.Spread);i.baseOnValueRuleType=go.DataBar;let n=await e._showDialog(G.NewFormattingRuleDialogTemplate,i,bi.validateConditionalFormatDialogFormula);n&&(pue(e.Spread,n,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function pue(e,t,i){let n=bi.ruleValueToRule(e,t);if(n){let a=C.getActiveSheet(e);if(a){if(!n.ranges()){let o=a.getSelections();n.ranges(o)}oa(e,!1,n)}else $u(e,n,kn.add,i)}}const mue=Object.freeze(Object.defineProperty({__proto__:null,moreDataBarRules:hue},Symbol.toStringTag,{value:"Module"}));let gue={iconClass:"gc-ribbon-solid-fill-blue-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.SolidFillBlueDataBar,tip:"${res.conditionalFormat.solidFill.blue}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"blue",!1)}};const fue=Object.freeze(Object.defineProperty({__proto__:null,solidFillBlueDataBar:gue},Symbol.toStringTag,{value:"Module"}));let bue={iconClass:"gc-ribbon-solid-fill-green-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.SolidFillGreenDataBar,tip:"${res.conditionalFormat.solidFill.green}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"green",!1)}};const Sue=Object.freeze(Object.defineProperty({__proto__:null,solidFillGreenDataBar:bue},Symbol.toStringTag,{value:"Module"}));let Cue={iconClass:"gc-ribbon-solid-fill-lightblue-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.SolidFillLightBlueDataBar,tip:"${res.conditionalFormat.solidFill.lightBlue}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"lightblue",!1)}};const yue=Object.freeze(Object.defineProperty({__proto__:null,solidFillLightBlueDataBar:Cue},Symbol.toStringTag,{value:"Module"}));let vue={iconClass:"gc-ribbon-solid-fill-orange-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.SolidFillOrangeDataBar,tip:"${res.conditionalFormat.solidFill.orange}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"orange",!1)}};const xue=Object.freeze(Object.defineProperty({__proto__:null,solidFillOrangeDataBar:vue},Symbol.toStringTag,{value:"Module"}));let Lue={iconClass:"gc-ribbon-solid-fill-purple-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.SolidFillPurpleDataBar,tip:"${res.conditionalFormat.solidFill.purple}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"purple",!1)}};const Tue=Object.freeze(Object.defineProperty({__proto__:null,solidFillPurpleDataBar:Lue},Symbol.toStringTag,{value:"Module"}));let wue={iconClass:"gc-ribbon-solid-fill-red-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.SolidFillRedDataBar,tip:"${res.conditionalFormat.solidFill.red}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"red",!1)}};const Due=Object.freeze(Object.defineProperty({__proto__:null,solidFillRedDataBar:wue},Symbol.toStringTag,{value:"Module"})),Aue=function(){return{templateName:G.DateOccurringRuleDialogTemplate,title:s.conditionalFormatting.dateOccurringFormat.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.dateOccurringFormat.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",margin:"5px",bindingPath:"value1",items:[{text:s.conditionalFormatting.dateOccurringFormat.date.yesterday,value:"yesterday"},{text:s.conditionalFormatting.dateOccurringFormat.date.today,value:"today"},{text:s.conditionalFormatting.dateOccurringFormat.date.tomorrow,value:"tomorrow"},{text:s.conditionalFormatting.dateOccurringFormat.date.last7days,value:"last7days"},{text:s.conditionalFormatting.dateOccurringFormat.date.lastweek,value:"lastweek"},{text:s.conditionalFormatting.dateOccurringFormat.date.thisweek,value:"thisweek"},{text:s.conditionalFormatting.dateOccurringFormat.date.nextweek,value:"nextweek"},{text:s.conditionalFormatting.dateOccurringFormat.date.lastmonth,value:"lastmonth"},{text:s.conditionalFormatting.dateOccurringFormat.date.thismonth,value:"thismonth"},{text:s.conditionalFormatting.dateOccurringFormat.date.nextmonth,value:"nextmonth"}]}],width:"150px"},{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.DateOccurringRuleDialogTemplate,Aue);let Pue={text:"${res.conditionalFormat.aDateOccurring}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-a-date-occurring",commandName:p.HighlightCellsRulesDateOccurring,execute:async(e,t)=>{let i=await e._showDialog(G.DateOccurringRuleDialogTemplate,Iue());i&&(Mue(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Iue(){return{value1:"yesterday"}}function Mue(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=ra(t.ruleStyle,e),o=GC.Spread.Sheets.ConditionalFormatting.DateOccurringType,l=o.yesterday;switch(t.value1){case"yesterday":l=o.yesterday;break;case"today":l=o.today;break;case"tomorrow":l=o.tomorrow;break;case"last7days":l=o.last7Days;break;case"lastweek":l=o.lastWeek;break;case"thisweek":l=o.thisWeek;break;case"nextweek":l=o.nextWeek;break;case"lastmonth":l=o.lastMonth;break;case"thismonth":l=o.thisMonth;break;case"nextmonth":l=o.nextMonth;break}let c=GC.Spread.Sheets.ConditionalFormatting.RuleType.dateOccurringRule,d=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(c,a,r,void 0,void 0,void 0,void 0,void 0,l,void 0);oa(e,!1,d)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"dateOccurringRule",type:t.value1,style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const kue=Object.freeze(Object.defineProperty({__proto__:null,aDateOccurring:Pue},Symbol.toStringTag,{value:"Module"})),Rue=function(){return{templateName:G.BetweenRuleDialogTemplate,title:s.conditionalFormatting.between.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.between.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.between.title,margin:"5px",absoluteReference:!0,needSheetName:!1,bindingPath:"value1"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 3px",text:s.conditionalFormatting.common.and}],width:"auto"},{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.between.title,margin:"5px",absoluteReference:!0,needSheetName:!1,bindingPath:"value2"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 3px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.BetweenRuleDialogTemplate,Rue);let _ue={text:"${res.conditionalFormat.between}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-between",commandName:p.HighlightCellsRulesBetween,execute:async(e,t)=>{let i=await e._showDialog(G.BetweenRuleDialogTemplate,Oue(),bi.validateConditionalFormatHighLightCellsRulesFormula);i&&(Eue(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Oue(){return{value1:"0",value2:"0"}}function Eue(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=Ju(t.value1,e),o=t.value2||"",l=ra(t.ruleStyle,e),c=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between,d=GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule,u=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(d,a,l,c,r,o,void 0,void 0,void 0,void 0);oa(e,!1,u)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"cellValueRule",comparisonOperator:"between",value1:t.value1||"",value2:t.value2||"",style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const Nue=Object.freeze(Object.defineProperty({__proto__:null,between:_ue},Symbol.toStringTag,{value:"Module"})),Bue=function(){return{templateName:G.TextContainRuleDialogTemplate,title:s.conditionalFormatting.textThatContains.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.textThatContains.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.textThatContains.title,margin:"5px",absoluteReference:!0,needSheetName:!1,bindingPath:"value1"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.TextContainRuleDialogTemplate,Bue);let Fue={text:"${res.conditionalFormat.textThatContains}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-text-that-contains",commandName:p.HighlightCellsRulesContains,execute:async(e,t)=>{let i=await e._showDialog(G.TextContainRuleDialogTemplate,Gue(),bi.validateConditionalFormatHighLightCellsRulesFormula);i&&(Vue(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Gue(){return{value1:"0"}}function Vue(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=t.value1||"",o=ra(t.ruleStyle,e),l=GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators.contains,c=GC.Spread.Sheets.ConditionalFormatting.RuleType.specificTextRule,d=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(c,a,o,l,void 0,void 0,r,void 0,void 0,void 0);oa(e,!1,d)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"specificTextRule",comparisonOperator:"contains",text:t.value1||"",style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const Hue=Object.freeze(Object.defineProperty({__proto__:null,textThatContains:Fue},Symbol.toStringTag,{value:"Module"})),zue=function(){return{templateName:G.DuplicateValueRuleDialogTemplate,title:s.conditionalFormatting.duplicateValuesFormat.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.duplicateValuesFormat.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",margin:"5px",bindingPath:"value1",items:[{text:s.conditionalFormatting.newFormattingRule.formatUnique.type.duplicate,value:"duplicate"},{text:s.conditionalFormatting.newFormattingRule.formatUnique.type.unique,value:"unique"}]}],width:"120px"},{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.DuplicateValueRuleDialogTemplate,zue);let jue={text:"${res.conditionalFormat.duplicateValues}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-duplicate-values",commandName:p.HighlightCellsRulesDuplicateValues,execute:async(e,t)=>{let i=await e._showDialog(G.DuplicateValueRuleDialogTemplate,Wue());i&&(Zue(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Wue(){return{value1:"duplicate"}}function Zue(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=ra(t.ruleStyle,e),o=GC.Spread.Sheets.ConditionalFormatting.RuleType.duplicateRule;switch(t.value1){case"duplicate":o=GC.Spread.Sheets.ConditionalFormatting.RuleType.duplicateRule;break;case"unique":o=GC.Spread.Sheets.ConditionalFormatting.RuleType.uniqueRule;break}let l=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(o,a,r,void 0,void 0,void 0,void 0,void 0,void 0,void 0);oa(e,!1,l)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:t.value1==="unique"?"uniqueRule":"duplicateRule",style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const Uue=Object.freeze(Object.defineProperty({__proto__:null,duplicateValues:jue},Symbol.toStringTag,{value:"Module"})),Jue=function(){return{templateName:G.EqualToRuleDialogTemplate,title:s.conditionalFormatting.equalTo.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.equalTo.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.equalTo.title,margin:"5px",absoluteReference:!0,needSheetName:!1,bindingPath:"value1"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.EqualToRuleDialogTemplate,Jue);let Yue={text:"${res.conditionalFormat.equalTo}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-equal-to",commandName:p.HighlightCellsRulesEqualTo,execute:async(e,t)=>{let i=await e._showDialog(G.EqualToRuleDialogTemplate,que(),bi.validateConditionalFormatHighLightCellsRulesFormula);i&&(Kue(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function que(){return{value1:"0"}}function Kue(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=Ju(t.value1,e),o=ra(t.ruleStyle,e),l=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.equalsTo,c=GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule,d=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(c,a,o,l,r,void 0,void 0,void 0,void 0,void 0);oa(e,!1,d)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"cellValueRule",comparisonOperator:"equalsTo",value1:t.value1||"",style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const Que=Object.freeze(Object.defineProperty({__proto__:null,equalTo:Yue},Symbol.toStringTag,{value:"Module"})),Xue=function(){return{templateName:G.GreaterThanRuleDialogTemplate,title:s.conditionalFormatting.greaterThan.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.greaterThan.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.greaterThan.title,margin:"5px",absoluteReference:!0,needSheetName:!1,bindingPath:"value1"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 3px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.GreaterThanRuleDialogTemplate,Xue);let $ue={text:"${res.conditionalFormat.greaterThan}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-greater-than",commandName:p.HighlightCellsRulesGreaterThan,execute:async(e,t)=>{let i=await e._showDialog(G.GreaterThanRuleDialogTemplate,ehe(),bi.validateConditionalFormatHighLightCellsRulesFormula);i&&(the(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function ehe(){return{value1:"0"}}function the(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=Ju(t.value1,e),o=ra(t.ruleStyle,e),l=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan,c=GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule,d=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(c,a,o,l,r,void 0,void 0,void 0,void 0,void 0);oa(e,!1,d)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"cellValueRule",comparisonOperator:"greaterThan",value1:t.value1||"",style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const ihe=Object.freeze(Object.defineProperty({__proto__:null,greaterThan:$ue},Symbol.toStringTag,{value:"Module"}));let nhe={commandName:p.HighlightCellsRules,text:"${res.conditionalFormat.highlightCellsRules}",iconClass:"ribbon-control-dropdown-highlight-cells-rules",bigButton:"=IF(inDropdown, true, ribbonHeight>toolbarHeight)",direction:'=IF(inDropdown, "horizontal", "vertical")'};const ahe=Object.freeze(Object.defineProperty({__proto__:null,highlightCellsRules:nhe},Symbol.toStringTag,{value:"Module"})),rhe=function(){return{templateName:G.LessThanRuleDialogTemplate,title:s.conditionalFormatting.lessThan.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.lessThan.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.lessThan.title,margin:"5px",absoluteReference:!0,needSheetName:!1,bindingPath:"value1"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 3px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.LessThanRuleDialogTemplate,rhe);let ohe={text:"${res.conditionalFormat.lessThan}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-less-than",commandName:p.HighlightCellsRulesLessThan,execute:async(e,t)=>{let i=await e._showDialog(G.LessThanRuleDialogTemplate,lhe(),bi.validateConditionalFormatHighLightCellsRulesFormula);i&&(she(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function lhe(){return{value1:"0"}}function she(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=Ju(t.value1,e),o=ra(t.ruleStyle,e),l=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.lessThan,c=GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule,d=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(c,a,o,l,r,void 0,void 0,void 0,void 0,void 0);oa(e,!1,d)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"cellValueRule",comparisonOperator:"lessThan",value1:t.value1||"",style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const che=Object.freeze(Object.defineProperty({__proto__:null,lessThan:ohe},Symbol.toStringTag,{value:"Module"}));let dhe={text:"${res.conditionalFormat.moreRules}",title:"${res.conditionalFormat.moreHighlightCellsRules}",commandName:p.HighlightCellsMoreRules,controlOption:{className:"more-rules-item"},execute:async(e,t)=>{let i=Jb(e);i.cellValue={operator:"greaterThan"};let n=bi.getNewFormatRuleDialogOption(e,e.Spread);n.ruleTypeGroup=Kn.FormatContain,n.ruleFormatContain=i;let a=await e._showDialog(G.NewFormattingRuleDialogTemplate,n,bi.validateConditionalFormatDialogFormula);a&&(uhe(e.Spread,a,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function uhe(e,t,i){let n=bi.ruleValueToRule(e,t);if(n){let a=C.getActiveSheet(e);if(a){if(!n.ranges()){let o=a.getSelections();n.ranges(o)}oa(e,!1,n)}else $u(e,n,kn.add,i)}}const hhe=Object.freeze(Object.defineProperty({__proto__:null,highlightCellsMoreRules:dhe},Symbol.toStringTag,{value:"Module"})),sa=(e,t)=>{let i=e.Spread,n=C.getActiveSheet(i);if(n){let a=n.getSelections(),r=new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(t,a);oa(i,!0,r)}else{let a=i.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=e.getData(re.tableSheetSelectedColumn);if(o>=0){let l=[{ruleType:"iconSetRule",iconSetType:GC.Spread.Sheets.ConditionalFormatting.IconSetType[t]}];Oi(i,o,"conditionalFormats",l,kn.replace)}}}e.setData(re.isFileModified,!0)};let phe={iconClass:"common-icon three-triangles",iconWidth:100,iconHeight:20,commandName:p.IconSet3Triangles,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTriangles)}};const mhe=Object.freeze(Object.defineProperty({__proto__:null,iconSet3Triangles:phe},Symbol.toStringTag,{value:"Module"}));let ghe={iconClass:"common-icon five-arrows-colored",iconWidth:100,iconHeight:20,commandName:p.IconSetFiveArrowsColored,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored)}};const fhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFiveArrowsColored:ghe},Symbol.toStringTag,{value:"Module"}));let bhe={iconClass:"common-icon five-arrows-gray",iconWidth:100,iconHeight:20,commandName:p.IconSetFiveArrowsGray,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray)}};const She=Object.freeze(Object.defineProperty({__proto__:null,iconSetFiveArrowsGray:bhe},Symbol.toStringTag,{value:"Module"}));let Che={iconClass:"common-icon five-boxes",iconWidth:100,iconHeight:20,commandName:p.IconSetFiveBoxes,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes)}};const yhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFiveBoxes:Che},Symbol.toStringTag,{value:"Module"}));let vhe={iconClass:"common-icon five-quarters",iconWidth:100,iconHeight:20,commandName:p.IconSetFiveQuarters,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters)}};const xhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFiveQuarters:vhe},Symbol.toStringTag,{value:"Module"}));let Lhe={iconClass:"common-icon five-ratings",iconWidth:100,iconHeight:20,commandName:p.IconSetFiveRatings,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings)}};const The=Object.freeze(Object.defineProperty({__proto__:null,iconSetFiveRatings:Lhe},Symbol.toStringTag,{value:"Module"}));let whe={iconClass:"common-icon four-arrows-colored",iconWidth:100,iconHeight:20,commandName:p.IconSetFourArrowsColored,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored)}};const Dhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFourArrowsColored:whe},Symbol.toStringTag,{value:"Module"}));let Ahe={iconClass:"common-icon four-arrows-gray",iconWidth:100,iconHeight:20,commandName:p.IconSetFourArrowsGray,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray)}};const Phe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFourArrowsGray:Ahe},Symbol.toStringTag,{value:"Module"}));let Ihe={iconClass:"common-icon four-ratings",iconWidth:100,iconHeight:20,commandName:p.IconSetFourRatings,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings)}};const Mhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFourRatings:Ihe},Symbol.toStringTag,{value:"Module"}));let khe={iconClass:"common-icon four-red-to-black",iconWidth:100,iconHeight:20,commandName:p.IconSetFourRedToBlack,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack)}};const Rhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFourRedToBlack:khe},Symbol.toStringTag,{value:"Module"}));let _he={iconClass:"common-icon four-traffic-lights",iconWidth:100,iconHeight:20,commandName:p.IconSetFourTrafficLights,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights)}};const Ohe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFourTrafficLights:_he},Symbol.toStringTag,{value:"Module"}));let Ehe={commandName:p.Directional,title:"${res.conditionalFormat.directional}"},Nhe={commandName:p.Shapes,title:"${res.conditionalFormat.shapes}"},Bhe={commandName:p.Indicators,title:"${res.conditionalFormat.indicators}"},Fhe={commandName:p.Ratings,title:"${res.conditionalFormat.ratings}"},Ghe={commandName:p.IconSetList,text:"${res.conditionalFormat.iconSets}",iconClass:"ribbon-control-dropdown-icon-sets",bigButton:"=ribbonHeight>toolbarHeight",comboWidth:230};const Vhe=Object.freeze(Object.defineProperty({__proto__:null,IconSetList:Ghe,directional:Ehe,indicators:Bhe,ratings:Fhe,shapes:Nhe},Symbol.toStringTag,{value:"Module"}));let Hhe={iconClass:"common-icon three-arrows-colored",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeArrowsColored,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored)}};const zhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeArrowsColored:Hhe},Symbol.toStringTag,{value:"Module"}));let jhe={iconClass:"common-icon three-arrows-gray",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeArrowsGray,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsGray)}};const Whe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeArrowsGray:jhe},Symbol.toStringTag,{value:"Module"}));let Zhe={iconClass:"common-icon three-flags",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeFlags,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeFlags)}};const Uhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeFlags:Zhe},Symbol.toStringTag,{value:"Module"}));let Jhe={iconClass:"common-icon three-signs",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeSigns,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSigns)}};const Yhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeSigns:Jhe},Symbol.toStringTag,{value:"Module"}));let qhe={iconClass:"common-icon three-stars",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeStars,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeStars)}};const Khe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeStars:qhe},Symbol.toStringTag,{value:"Module"}));let Qhe={iconClass:"common-icon three-symbols-circled",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeSymbolsCircled,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsCircled)}};const Xhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeSymbolsCircled:Qhe},Symbol.toStringTag,{value:"Module"}));let $he={iconClass:"common-icon three-symbols-uncircled",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeSymbolsUnCircled,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsUncircled)}};const epe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeSymbolsUncircled:$he},Symbol.toStringTag,{value:"Module"}));let tpe={iconClass:"common-icon three-traffic-lights-rimmed",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeTrafficLightsRimmed,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsRimmed)}};const ipe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeTrafficLightsRimmed:tpe},Symbol.toStringTag,{value:"Module"}));let npe={iconClass:"common-icon three-traffic-lights-unrimmed",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeTrafficLightsUnRimmed,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsUnrimmed)}};const ape=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeTrafficLightsUnrimmed:npe},Symbol.toStringTag,{value:"Module"}));let rpe={text:"${res.conditionalFormat.moreRules}",title:"${res.conditionalFormat.moreIconSetRules}",commandName:p.MoreIconSetRules,controlOption:{className:"more-rules-item"},execute:async(e,t)=>{let i=bi.getNewFormatRuleDialogOption(e,e.Spread);i.baseOnValueRuleType=go.IconSets;let n=await e._showDialog(G.NewFormattingRuleDialogTemplate,i,bi.validateConditionalFormatDialogFormula);n&&(ope(e.Spread,n,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function ope(e,t,i){let n=bi.ruleValueToRule(e,t);if(n){let a=C.getActiveSheet(e);if(a){if(!n.ranges()){let o=a.getSelections();n.ranges(o)}oa(e,!1,n)}else $u(e,n,kn.add,i)}}const lpe=Object.freeze(Object.defineProperty({__proto__:null,moreIconSetRules:rpe},Symbol.toStringTag,{value:"Module"})),nO=function(){return{templateName:G.RuleManagerDialogTemplate,title:s.formattingRulesManagerDialog.title,resizable:!0,content:[{type:"FlexContainer",height:"100%",children:[{type:"RuleManagerEditor",bindingPath:"rules"}]}],buttons:[{text:s.ok,buttonType:"Ok"},{text:s.close,buttonType:"Cancel"},{text:s.apply,click:function(e,t,i){const n=e.rules.spread,a=C.deepClone(e,["spread"]);a.rules.spread=n;let r=Pe.getContextSpread(),o=Pe.getContextDesigner();r&&o&&Qb(r,a,o,!1),i("",a)}}]}};_e(G.RuleManagerDialogTemplate,nO);function aO(e,t){let i="Designer."+t;e.commandManager().register(i,lO,void 0,!1,!1,!1,!1)}function rO(e,t){let i="Designer."+t;e.commandManager().register(i,sO,void 0,!1,!1,!1,!1)}function spe(e,t){oe.runCommand(e,"applyRule",lO,{spread:e,options:t})}function cpe(e,t){oe.runCommand(e,"applyRuleCanNotUndo",sO,{spread:e,options:t})}class oO extends oe.DesignerActionBase{executeImp(t,i,n){t.suspendPaint();try{let a;i.options.rules.target?a=t.getSheetFromName(i.options.rules.target):a=C.getActiveSheet(t);let r=a.conditionalFormats;r.clearRule();let o=i.options.rules.ruleItems;for(let l=o.length-1;l>=0;l--){let c=bi.ruleItemToRule(t,o[l]);c&&y0(a,r,c)}}finally{t.resumePaint()}}}let lO={canUndo:!0,execute:function(e,t,i){return new oO(e,t).execute(e,t,i)}},sO={canUndo:!1,execute:function(e,t,i){return new oO(e,t).execute(e,t,i)}};_e(G.RuleManagerDialogTemplate,nO);let dpe={text:"${res.conditionalFormat.manageRules}",iconClass:"ribbon-control-dropdown-manage-rules",commandName:p.ConditionFormatManageRule,execute:async(e,t)=>{let i=await e._showDialog(G.RuleManagerDialogTemplate,upe(e.Spread,e));i&&Qb(e.Spread,i,e)},init:e=>{aO(e.Spread,"applyRule"),rO(e.Spread,"applyRuleCanNotUndo")}};function upe(e,t){let i=[],n=C.getActiveSheet(e);if(n){let l=n.conditionalFormats,c=l.getRules(),d=new GC.Spread.Sheets.ConditionalFormatting.ConditionalFormats(n);d.fromJSON(l.toJSON());let u=d.getRules();for(let h=0;h<c.length;h++)u[h]._isCustomIconSet=c[h]._isCustomIconSet;u.sort((h,g)=>g.priority()-h.priority());for(let h=u.length-1;h>=0;h--)i.push(u[h])}else{let l=e.getActiveSheetTab();if(C._isTableSheet(l)){let c=l.getDataView();if(c){let d=t.getData(re.tableSheetSelectedColumn);if(d>=0){let h=c.getColumn(d).conditionalFormats;if(h)for(let g=0;g<h.length;g++){let f=R0(h[g]);f&&i.push(f)}}}}}let a=e.getActiveSheet(),r=0;if(a){let l=a.getSelections();i.forEach(c=>{for(const d of l)c.intersects(d.row,d.col,d.rowCount,d.colCount)?(c.visible=!0,c._idTag=r++):(c.visible=!1,c._idTag=r++)})}else i.forEach(l=>{l.visible=!0,l._idTag=r++});let o=[];for(let l=0;l<i.length;l++)o.push(bi.ruleToRuleItem(t,e,i[l]));return{rules:{ruleItems:o,spread:e}}}function hpe(e,t,i){var r;const n=t.conditionalFormats.getRules(),a=t.getParent();for(const o of i.rules.ruleItems){const l=Ae.stringToRange(a,o.ruleRange),c=n.find(u=>u._idTag===o._idTag);if(!c)continue;const d=bi.ruleToRuleItem(e,a,c);if(!l||l.length<1)o.ruleRange=d.ruleRange;else{const u=o.ruleRange.split("!");if(u.length>1){const h=u[0].substring(2,u[0].length-1);h&&h.toLocaleUpperCase()!==((r=i.rules.target)==null?void 0:r.toLocaleUpperCase())&&(o.ruleRange=d.ruleRange)}}}}function Qb(e,t,i,n=!0){let a;if(t.rules.target?a=e.getSheetFromName(t.rules.target):a=C.getActiveSheet(e),a)hpe(i,a,t),n?spe(e,t):cpe(e,t);else{let r=e.getActiveSheetTab();if(C._isTableSheet(r)&&r.getDataView()){let l=i.getData(re.tableSheetSelectedColumn);if(l>=0){let c=[];I0(t,c,e),Oi(e,l,"conditionalFormats",c,kn.overwrite)}}}}const ppe=Object.freeze(Object.defineProperty({__proto__:null,execute_ruleManager:Qb,manageRules:dpe},Symbol.toStringTag,{value:"Module"}));let mpe={text:"${res.conditionalFormat.newRule}",iconClass:"ribbon-control-dropdown-new-rule",commandName:p.ConditionFormatNewRule,execute:async(e,t)=>{let i=await e._showDialog(G.NewFormattingRuleDialogTemplate,bi.getNewFormatRuleDialogOption(e,e.Spread),bi.validateConditionalFormatDialogFormula);i&&(gpe(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function gpe(e,t,i){let n=bi.ruleValueToRule(e,t);if(n){let a=C.getActiveSheet(e);if(a){if(!n.ranges()){let o=a.getSelections();n.ranges(o)}oa(e,!1,n)}else $u(e,n,kn.add,i)}}const fpe=Object.freeze(Object.defineProperty({__proto__:null,newRule:mpe},Symbol.toStringTag,{value:"Module"})),bpe=function(){return{templateName:G.AboveAverageRuleDialogTemplate,title:s.conditionalFormatting.aboveAverage.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.aboveAverage.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.selectedRangeWith}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.AboveAverageRuleDialogTemplate,bpe);let Spe={text:"${res.conditionalFormat.aboveAverage}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-above-average",commandName:p.TopBottomRulesAboveAverage,execute:async(e,t)=>{let i=await e._showDialog(G.AboveAverageRuleDialogTemplate,Cpe());i&&(ype(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Cpe(){return{}}function ype(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=ra(t.ruleStyle,e),o=GC.Spread.Sheets.ConditionalFormatting.RuleType.averageRule,l=GC.Spread.Sheets.ConditionalFormatting.AverageConditionType.above,c=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(o,a,r,void 0,void 0,void 0,void 0,void 0,l,void 0);oa(e,!1,c)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l),Oi(e,o,"conditionalFormats",[{ruleType:"averageRule",type:"above",style:l}],kn.add)}}}}const vpe=Object.freeze(Object.defineProperty({__proto__:null,aboveAverage:Spe},Symbol.toStringTag,{value:"Module"})),xpe=function(){return{templateName:G.BelowAverageRuleDialogTemplate,title:s.conditionalFormatting.belowAverage.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.belowAverage.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.selectedRangeWith}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.BelowAverageRuleDialogTemplate,xpe);let Lpe={text:"${res.conditionalFormat.belowAverage}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-below-average",commandName:p.TopBottomRulesBelowAverage,execute:async(e,t)=>{let i=await e._showDialog(G.BelowAverageRuleDialogTemplate,Tpe());i&&(wpe(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Tpe(){return{}}function wpe(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=ra(t.ruleStyle,e),o=GC.Spread.Sheets.ConditionalFormatting.RuleType.averageRule,l=GC.Spread.Sheets.ConditionalFormatting.AverageConditionType.below,c=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(o,a,r,void 0,void 0,void 0,void 0,void 0,l,void 0);oa(e,!1,c)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l),Oi(e,o,"conditionalFormats",[{ruleType:"averageRule",type:"below",style:l}],kn.add)}}}}const Dpe=Object.freeze(Object.defineProperty({__proto__:null,belowAverage:Lpe},Symbol.toStringTag,{value:"Module"})),Ape=function(){return{templateName:G.Bottom10RuleDialogTemplate,title:s.conditionalFormatting.bottom10items.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.bottom10items.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"NumberEditor",margin:"5px",min:1,max:1e3,bindingPath:"number"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.Bottom10RuleDialogTemplate,Ape);let Ppe={text:"${res.conditionalFormat.bottom10Items}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-bottom-10-items",commandName:p.TopBottomRulesBottom10,execute:async(e,t)=>{let i=Ipe();i.number=10;let n=await e._showDialog(G.Bottom10RuleDialogTemplate,i);n&&(Mpe(e.Spread,n,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Ipe(){return{}}function Mpe(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=t.number||10,o=ra(t.ruleStyle,e),l=GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.bottom,c=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule,a,o,void 0,void 0,void 0,void 0,void 0,l,r);oa(e,!1,c)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"top10Rule",type:"bottom",rank:t.number||10,style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const kpe=Object.freeze(Object.defineProperty({__proto__:null,bottomTenItems:Ppe},Symbol.toStringTag,{value:"Module"}));function Rpe(){return{type:"FlexContainer",className:"gc-format-contain-editor",children:[{type:"TextBlock",className:"title",text:s.conditionalFormatting.newFormattingRule.formatContain.description},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",className:"type",bindingPath:"type",items:[{text:s.conditionalFormatting.newFormattingRule.formatContain.type.cellValue,value:"cellValue"},{text:s.conditionalFormatting.newFormattingRule.formatContain.type.specificText,value:"specificText"},{text:s.conditionalFormatting.newFormattingRule.formatContain.type.dateOccurring,value:"dateOccurring"},{text:s.conditionalFormatting.newFormattingRule.formatContain.type.blanks,value:"blanks"},{text:s.conditionalFormatting.newFormattingRule.formatContain.type.noBlanks,value:"noBlanks"},{text:s.conditionalFormatting.newFormattingRule.formatContain.type.errors,value:"errors"},{text:s.conditionalFormatting.newFormattingRule.formatContain.type.noErrors,value:"noErrors"}]}],width:"150px"},{type:"Column",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",className:"operator",margin:"5px 0 0 0 ",bindingPath:"cellValue.operator",popupWidth:240,items:[{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.between,value:"between"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.notBetween,value:"notBetween"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.equalTo,value:"equalTo"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.notEqualTo,value:"notEqualTo"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.greaterThan,value:"greaterThan"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.lessThan,value:"lessThan"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.greaterThanOrEqu,value:"greaterThanOrEqu"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.lessThanOrEqu,value:"lessThanOrEqu"}]}],width:"170px"},{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.newFormattingRule.title,absoluteReference:!0,className:"range-selector",margin:"5px 0 0 0 ",text:"RangeSelect",bindingPath:"cellValue.value1"}],width:"140px"},{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.and}],width:"35px",visibleWhen:"cellValue.operator=between"},{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.newFormattingRule.title,absoluteReference:!0,className:"range-selector",text:"RangeSelect",margin:"5px 0 0 0 ",bindingPath:"cellValue.value2"}],width:"140px",visibleWhen:"cellValue.operator=between"},{type:"Column",margin:"8px 0 0 5px",children:[{type:"TextBlock",className:"label",text:s.conditionalFormatting.common.and}],width:"35px",visibleWhen:"cellValue.operator=notBetween"},{type:"Column",margin:"5px 0 0 -5px",children:[{type:"RangeSelect",title:s.conditionalFormatting.newFormattingRule.title,className:"range-selector",text:"RangeSelect",absoluteReference:!0,bindingPath:"cellValue.value2"}],width:"140px",visibleWhen:"cellValue.operator=notBetween"}],visibleWhen:"type=cellValue"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",className:"operator",margin:"5px 0 0 0 ",bindingPath:"specificText.operator",items:[{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_specificText.containing,value:"containing"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_specificText.notContaining,value:"notContaining"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_specificText.beginningWith,value:"beginningWith"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_specificText.endingWith,value:"endingWith"}]}],width:"170px"},{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.newFormattingRule.title,absoluteReference:!0,className:"range-selector",margin:"5px 0 0 0 ",bindingPath:"specificText.value"}],width:"stretch"}],visibleWhen:"type=specificText"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",className:"operator",margin:"5px 0 0 0 ",bindingPath:"dateOccurring.operator",items:[{text:s.conditionalFormatting.dateOccurringFormat.date.yesterday,value:"yesterday"},{text:s.conditionalFormatting.dateOccurringFormat.date.today,value:"today"},{text:s.conditionalFormatting.dateOccurringFormat.date.tomorrow,value:"tomorrow"},{text:s.conditionalFormatting.dateOccurringFormat.date.last7days,value:"last7days"},{text:s.conditionalFormatting.dateOccurringFormat.date.lastweek,value:"lastweek"},{text:s.conditionalFormatting.dateOccurringFormat.date.thisweek,value:"thisweek"},{text:s.conditionalFormatting.dateOccurringFormat.date.nextweek,value:"nextweek"},{text:s.conditionalFormatting.dateOccurringFormat.date.lastmonth,value:"lastmonth"},{text:s.conditionalFormatting.dateOccurringFormat.date.thismonth,value:"thismonth"},{text:s.conditionalFormatting.dateOccurringFormat.date.nextmonth,value:"nextmonth"}]}],width:"170px"}],visibleWhen:"type=dateOccurring"}],width:"auto"}]},{type:"LabelLine",margin:"15px 0 0 0"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",className:"preview-label",text:s.conditionalFormatting.newFormattingRule.preview.description}],width:"auto"},{type:"Column",children:[{type:"FormatRulePreview",bindingPath:"ruleStyle",id:"formatRulePreview"}],width:"210px"},{type:"Column",children:[{type:"Button",margin:"10px 0 0 0",bindingPath:"ruleStyle",id:"previewFormatButton",text:s.conditionalFormatting.newFormattingRule.preview.buttonText}],width:"80px"}]}]}}var _pe=Object.getOwnPropertyDescriptor,Ope=(e,t,i,n)=>{for(var a=n>1?void 0:n?_pe(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};const _0=C.isNullOrUndefined;let cO=class extends Bt{constructor(){super(...arguments),this._dialogOwner=Pe.getDialogOwner()}getComponentJson(){return[Rpe()]}_attachEvent(){let t=this;this.previewFormatButton.on(rt.ButtonClicked,async()=>{let i=t.value.ruleStyle,n=await this._dialogOwner._showDialog(G.ConditionalFormatDialogTemplate,Ke(i));n&&(Qo(n,i),t.formatRulePreview.value=i,t.previewFormatButton.value=i,t.raiseValueChanged())})}get previewFormatButton(){return this.getComponent("previewFormatButton")}get formatRulePreview(){return this.getComponent("formatRulePreview")}};cO=Ope([Ue.Register("FormatContainEditor")],cO);function Qo(e,t){delete e.alignmentTabOption,delete e.cellButtonTabOption,delete e.paddingTabOption,delete e.maskOption,delete e.decorationTabOption;let i=Cn(t,e);Epe(i,e),dO(t),Npe(i,t),Bpe(i,t),Fpe(i,t),Gpe(i,t),Vpe(i,t)}function Epe(e,t){t.fontTabOption&&(e.font&&e.font.fontWeight!==void 0&&(t.fontTabOption.fontWeight=e.font.fontWeight),e.font&&e.font.fontStyle!==void 0&&(t.fontTabOption.fontStyle=e.font.fontStyle))}function Npe(e,t){e.formatter!==void 0&&t.numberTabOption&&(t.numberTabOption.formatter=e.formatter)}function Bpe(e,t){t.fontTabOption&&(e.foreColor!==void 0&&(e.foreColor===""&&(e.foreColor=void 0),t.fontTabOption.foreColor=e.foreColor),e.font&&e.font.fontWeight!==void 0&&(t.fontTabOption.fontWeight=e.font.fontWeight),e.font&&e.font.fontStyle!==void 0&&(t.fontTabOption.fontStyle=e.font.fontStyle),e.textDecoration!==void 0&&t.fontTabOption.fontUnderlineListAndEffects&&(e.textDecoration===0&&(e.textDecoration=void 0),t.fontTabOption.fontUnderlineListAndEffects.textDecoration=e.textDecoration))}function Fpe(e,t){t.borderTabOption||(t.borderTabOption={}),e.borderTop!==void 0&&(t.borderTabOption.borderTop=e.borderTop),e.borderBottom!==void 0&&(t.borderTabOption.borderBottom=e.borderBottom),e.borderLeft!==void 0&&(t.borderTabOption.borderLeft=e.borderLeft),e.borderRight!==void 0&&(t.borderTabOption.borderRight=e.borderRight),e.borderHorizontal!==void 0&&(t.borderTabOption.borderHorizontal=e.borderHorizontal),e.borderVertical!==void 0&&(t.borderTabOption.borderVertical=e.borderVertical),e.diagonalUp!==void 0&&(t.borderTabOption.diagonalUp=e.diagonalUp),e.diagonalDown!==void 0&&(t.borderTabOption.diagonalDown=e.diagonalDown)}function Gpe(e,t){e.backColor!==void 0&&t.fillTabOption&&(e.backColor===""&&(e.backColor=void 0),t.fillTabOption.backColor=e.backColor)}function Vpe(e,t){t.protectionTabOption&&(_0(e.locked)||(t.protectionTabOption.locked=e.locked),_0(e.hidden)||(t.protectionTabOption.hidden=e.hidden),_0(e.allowEditInCell)||(t.protectionTabOption.allowEditInCell=e.allowEditInCell))}function dO(e){for(let t in e)e.hasOwnProperty(t)&&(t==="textDecoration"&&!e[t]?e[t]=void 0:e[t]instanceof Object?dO(e[t]):e[t]===""&&(e[t]=void 0))}function Hpe(){return{type:"FlexContainer",className:"gc-format-contain-editor",children:[{type:"TextBlock",className:"title",text:s.conditionalFormatting.newFormattingRule.formatContain.description},{type:"ColumnSet",margin:"10px 0 0 0",children:[{type:"Column",children:[{type:"ListComboEditor",className:"row-column-states-direction-list",bindingPath:"direction",items:[{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.direction.row,value:1},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.direction.column,value:0}]}],width:"100px",margin:"0 20px 0 0"},{type:"Column",children:[{type:"ListComboEditor",className:"row-column-states-type-list",visibleWhen:"isReportSheet!=true",bindingPath:"state",items:[{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.hover,value:GC.Spread.Sheets.RowColumnStates.hover},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.invalid,value:GC.Spread.Sheets.RowColumnStates.invalid},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.edit,value:GC.Spread.Sheets.RowColumnStates.edit},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.active,value:GC.Spread.Sheets.RowColumnStates.active},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.selected,value:GC.Spread.Sheets.RowColumnStates.selected},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.dirty,value:GC.Spread.Sheets.RowColumnStates.dirty},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.inserted,value:GC.Spread.Sheets.RowColumnStates.inserted},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.invalidFormula,value:GC.Spread.Sheets.RowColumnStates.invalidFormula}]},{type:"ListComboEditor",className:"row-column-states-type-list",visibleWhen:"isReportSheet=true",bindingPath:"state",items:[{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.hover,value:GC.Spread.Sheets.RowColumnStates.hover},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.active,value:GC.Spread.Sheets.RowColumnStates.active},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.selected,value:GC.Spread.Sheets.RowColumnStates.selected}]}],width:"200px"}]},{type:"LabelLine",margin:"15px 0 0 0"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",className:"preview-label",text:s.conditionalFormatting.newFormattingRule.preview.description}],width:"auto"},{type:"Column",children:[{type:"FormatRulePreview",bindingPath:"ruleStyle",id:"formatRulePreview"}],width:"210px"},{type:"Column",children:[{type:"Button",margin:"10px 0 0 0",bindingPath:"ruleStyle",id:"previewFormatButton",text:s.conditionalFormatting.newFormattingRule.preview.buttonText}],width:"80px"}]}]}}var zpe=Object.getOwnPropertyDescriptor,jpe=(e,t,i,n)=>{for(var a=n>1?void 0:n?zpe(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};let uO=class extends Bt{constructor(){super(...arguments),this._dialogOwner=Pe.getDialogOwner()}getComponentJson(){return[Hpe()]}_attachEvent(){let t=this;this.previewFormatButton.on(rt.ButtonClicked,async()=>{let i=t.value.ruleStyle,n=await this._dialogOwner._showDialog(G.ConditionalFormatDialogTemplate,Ke(i));n&&(Qo(n,i),t.formatRulePreview.value=i,t.previewFormatButton.value=i,t.raiseValueChanged())})}get previewFormatButton(){return this.getComponent("previewFormatButton")}get formatRulePreview(){return this.getComponent("formatRulePreview")}};uO=jpe([Ue.Register("UseRowColumnStatesEditor")],uO);function Wpe(){return{type:"FlexContainer",className:"gc-format-above-editor",children:[{type:"TextBlock",text:s.conditionalFormatting.newFormattingRule.formatAbove.description},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",className:"type",bindingPath:"type",items:[{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.above,value:"above"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.below,value:"below"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.equalOrAbove,value:"equalOrAbove"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.equalOrBelow,value:"equalOrBelow"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.std1Above,value:"above1StdDev"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.std1Below,value:"below1StdDev"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.std2Above,value:"above2StdDev"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.std2Below,value:"below2StdDev"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.std3Above,value:"above3StdDev"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.std3Below,value:"below3StdDev"}]}],width:"auto"},{type:"Column",children:[{type:"TextBlock",className:"label",text:s.conditionalFormatting.newFormattingRule.formatAbove.description2}],width:"auto"}]},{type:"LabelLine",margin:"15px 0 0 0"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",className:"preview-label",text:s.conditionalFormatting.newFormattingRule.preview.description}],width:"auto"},{type:"Column",children:[{type:"FormatRulePreview",bindingPath:"ruleStyle",id:"formatRulePreview"}],width:"210px"},{type:"Column",children:[{type:"Button",margin:"10px 0 0 0",bindingPath:"ruleStyle",id:"previewFormatButton",text:s.conditionalFormatting.newFormattingRule.preview.buttonText}],width:"80px"}]}]}}var Zpe=Object.getOwnPropertyDescriptor,Upe=(e,t,i,n)=>{for(var a=n>1?void 0:n?Zpe(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};let hO=class extends Bt{constructor(){super(...arguments),this._dialogOwner=Pe.getDialogOwner()}getComponentJson(){return[Wpe()]}_attachEvent(){let t=this;this.previewFormatButton.on(rt.ButtonClicked,async()=>{let i=t.value.ruleStyle,n=await this._dialogOwner._showDialog(G.ConditionalFormatDialogTemplate,Ke(i));n&&(Qo(n,i),t.formatRulePreview.value=i,t.previewFormatButton.value=i,t.raiseValueChanged())})}get previewFormatButton(){return this.getComponent("previewFormatButton")}get formatRulePreview(){return this.getComponent("formatRulePreview")}};hO=Upe([Ue.Register("FormatAboveEditor")],hO);function Jpe(){return{type:"FlexContainer",className:"gc-format-ranked-value-editor",children:[{type:"TextBlock",className:"title",text:s.conditionalFormatting.newFormattingRule.formatRankedValue.description},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",className:"type",bindingPath:"type",items:[{text:s.conditionalFormatting.newFormattingRule.formatRankedValue.type.top,value:"top"},{text:s.conditionalFormatting.newFormattingRule.formatRankedValue.type.bottom,value:"bottom"}]}],width:"auto"},{type:"Column",children:[{type:"NumberEditor",className:"value",bindingPath:"rank",min:1,max:1e3}],width:"210px"}]},{type:"LabelLine",margin:"15px 0 0 0"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",className:"preview-label",text:s.conditionalFormatting.newFormattingRule.preview.description}],width:"auto"},{type:"Column",children:[{type:"FormatRulePreview",bindingPath:"ruleStyle",id:"formatRulePreview"}],width:"210px"},{type:"Column",children:[{type:"Button",margin:"10px 0 0 0",bindingPath:"ruleStyle",id:"previewFormatButton",text:s.conditionalFormatting.newFormattingRule.preview.buttonText}],width:"80px"}]}]}}var Ype=Object.getOwnPropertyDescriptor,qpe=(e,t,i,n)=>{for(var a=n>1?void 0:n?Ype(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};let pO=class extends Bt{constructor(){super(...arguments),this._dialogOwner=Pe.getDialogOwner()}getComponentJson(){return[Jpe()]}_attachEvent(){let t=this;this.previewFormatButton.on(rt.ButtonClicked,async()=>{let i=t.value.ruleStyle,n=await this._dialogOwner._showDialog(G.ConditionalFormatDialogTemplate,Ke(i));n&&(Qo(n,i),t.formatRulePreview.value=i,t.previewFormatButton.value=i,t.raiseValueChanged())})}get previewFormatButton(){return this.getComponent("previewFormatButton")}get formatRulePreview(){return this.getComponent("formatRulePreview")}};pO=qpe([Ue.Register("FormatRankedValueEditor")],pO);function Kpe(){return{type:"FlexContainer",className:"gc-format-unique-editor",children:[{type:"TextBlock",className:"title",text:s.conditionalFormatting.newFormattingRule.formatUnique.description},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",className:"type",bindingPath:"type",items:[{text:s.conditionalFormatting.newFormattingRule.formatUnique.type.duplicate,value:"duplicate"},{text:s.conditionalFormatting.newFormattingRule.formatUnique.type.unique,value:"unique"}]}],width:"auto"},{type:"Column",children:[{type:"TextBlock",className:"label",text:s.conditionalFormatting.newFormattingRule.formatUnique.description2}],width:"auto"}]},{type:"LabelLine",margin:"10px 0 0 0",text:" "},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",className:"preview-label",text:s.conditionalFormatting.newFormattingRule.preview.description}],width:"auto"},{type:"Column",children:[{type:"FormatRulePreview",bindingPath:"ruleStyle",id:"formatRulePreview"}],width:"210px"},{type:"Column",children:[{type:"Button",margin:"10px 0 0 0",bindingPath:"ruleStyle",id:"previewFormatButton",text:s.conditionalFormatting.newFormattingRule.preview.buttonText}],width:"80px"}]}]}}var Qpe=Object.getOwnPropertyDescriptor,Xpe=(e,t,i,n)=>{for(var a=n>1?void 0:n?Qpe(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};let mO=class extends Bt{constructor(){super(...arguments),this._dialogOwner=Pe.getDialogOwner()}getComponentJson(){return[Kpe()]}_attachEvent(){let t=this;this.previewFormatButton.on(rt.ButtonClicked,async()=>{let i=t.value.ruleStyle,n=await this._dialogOwner._showDialog(G.ConditionalFormatDialogTemplate,Ke(i));n&&(Qo(n,i),t.formatRulePreview.value=i,t.previewFormatButton.value=i,t.raiseValueChanged())})}get previewFormatButton(){return this.getComponent("previewFormatButton")}get formatRulePreview(){return this.getComponent("formatRulePreview")}};mO=Xpe([Ue.Register("FormatUniqueEditor")],mO);let gO=function(){return{templateName:G.NewFormattingRuleDialogTemplate,title:s.conditionalFormatting.newFormattingRule.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",text:s.conditionalFormatting.newFormattingRule.description1},{type:"RuleTypeList",margin:"5px 0 0 0",bindingPath:"ruleTypeGroup"},{type:"TextBlock",margin:"5px 0 0 0",text:s.conditionalFormatting.newFormattingRule.description2},{type:"LabelContainer",text:"",margin:"5px 0 0 0",showText:!1,children:[{type:"Container",visibleWhen:"ruleTypeGroup=FormatOnValue",children:[{type:"TextBlock",margin:"3px 0",text:s.conditionalFormatting.newFormattingRule.formatOnValue.description},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",margin:"8px 0 3px 0",text:s.conditionalFormatting.newFormattingRule.formatOnValue.formatStyle}],width:wn==="jp"?"120px":"80px"},{type:"Column",children:[{type:"ListComboEditor",margin:"3px 0px",bindingPath:"baseOnValueRuleType",items:[{text:s.conditionalFormatting.newFormattingRule.formatOnValue.formatStyleSelector.color2,value:"ColorScale2"},{text:s.conditionalFormatting.newFormattingRule.formatOnValue.formatStyleSelector.color3,value:"ColorScale3"},{text:s.conditionalFormatting.newFormattingRule.formatOnValue.formatStyleSelector.dataBar,value:"DataBar"},{text:s.conditionalFormatting.newFormattingRule.formatOnValue.formatStyleSelector.iconSets,value:"IconSets"}]}],width:"130px"}]},{type:"ColorScale2Editor",visibleWhen:"baseOnValueRuleType=ColorScale2",bindingPath:"ruleScaleColor2"},{type:"ColorScale3Editor",visibleWhen:"baseOnValueRuleType=ColorScale3",bindingPath:"ruleScaleColor3"},{type:"DataBarEditor",visibleWhen:"baseOnValueRuleType=DataBar",bindingPath:"ruleDataBar"},{type:"IconSetsEditor",visibleWhen:"baseOnValueRuleType=IconSets",bindingPath:"ruleIconSets"}]},{type:"FormatContainEditor",visibleWhen:"ruleTypeGroup=FormatContain",bindingPath:"ruleFormatContain"},{type:"FormatRankedValueEditor",visibleWhen:"ruleTypeGroup=FormatRankedValue",bindingPath:"ruleFormatRankedValue"},{type:"FormatAboveEditor",visibleWhen:"ruleTypeGroup=FormatAbove",bindingPath:"ruleFormatAbove"},{type:"FormatUniqueEditor",visibleWhen:"ruleTypeGroup=FormatUnique",bindingPath:"ruleFormatUnique"},{type:"UseFormulaEditor",visibleWhen:"ruleTypeGroup=UseFormula",bindingPath:"ruleUseFormula"},{type:"UseRowColumnStatesEditor",visibleWhen:"ruleTypeGroup=UseRowColumnStates",bindingPath:"ruleUseRowColumnStates"}]}]}]}},$pe=function(){let e=gO();return e.title=s.conditionalFormatting.newFormattingRule.title2,e.templateName=G.EditFormattingRuleDialogTemplate,e};_e(G.NewFormattingRuleDialogTemplate,gO),_e(G.EditFormattingRuleDialogTemplate,$pe);let eme={text:"${res.conditionalFormat.moreRules}",title:"${res.conditionalFormat.moreTopBottomRules}",commandName:p.TopBottomRulesMoreRules,controlOption:{className:"more-rules-item"},execute:async(e,t)=>{let i=bi.getNewFormatRuleDialogOption(e,e.Spread);i.ruleTypeGroup=Kn.FormatRankedValue;let n=await e._showDialog(G.NewFormattingRuleDialogTemplate,i,bi.validateConditionalFormatDialogFormula);n&&(tme(e.Spread,n,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function tme(e,t,i){let n=bi.ruleValueToRule(e,t);if(n){let a=C.getActiveSheet(e);if(a){if(!n.ranges()){let o=a.getSelections();n.ranges(o)}oa(e,!1,n)}else $u(e,n,kn.add,i)}}const ime=Object.freeze(Object.defineProperty({__proto__:null,topBottomRulesMoreRules:eme},Symbol.toStringTag,{value:"Module"}));let nme={commandName:p.TopBottomRules,text:"${res.conditionalFormat.topBottomRules}",iconClass:"ribbon-control-dropdown-top-bottom-rules",bigButton:"=ribbonHeight>toolbarHeight"};const ame=Object.freeze(Object.defineProperty({__proto__:null,topBottomRules:nme},Symbol.toStringTag,{value:"Module"})),rme=function(){return{templateName:G.Top10RuleDialogTemplate,title:s.conditionalFormatting.top10items.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.top10items.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"NumberEditor",margin:"5px",min:1,max:1e3,bindingPath:"number"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.Top10RuleDialogTemplate,rme);let ome={text:"${res.conditionalFormat.top10Items}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-top-10-items",commandName:p.TopBottomRulesTop10,execute:async(e,t)=>{let i=lme();i.number=10;let n=await e._showDialog(G.Top10RuleDialogTemplate,i);n&&(sme(e.Spread,n,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function lme(){return{}}function sme(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=t.number||10,o=ra(t.ruleStyle,e),l=GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top,c=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule,a,o,void 0,void 0,void 0,void 0,void 0,l,r);oa(e,!1,c)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"top10Rule",type:"top",rank:t.number||10,style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const cme=Object.freeze(Object.defineProperty({__proto__:null,topTenItems:ome},Symbol.toStringTag,{value:"Module"}));function dme(e,t){let i="Designer."+t;e.commandManager().register(i,fO,void 0,!1,!1,!1,!1)}function O0(e,t){let i=C.getActiveSheet(e);if(i){let n=i.tables.find(i.getActiveRowIndex(),i.getActiveColumnIndex()),a=n?n.name():null;return oe.runCommand(e,"formatAsTable",fO,{tableStyle:t,tableName:a})}else{let n=t;typeof t=="string"&&(n=GC.Spread.Sheets.Tables.TableThemes[t]);let a=e.getActiveSheetTab();C._isTableSheet(a)&&ose(e,n||void 0)}}let fO={canUndo:!0,execute:function(e,t,i){return new ume(e,t).execute(e,t,i)}};class ume extends cc{executeImp(t,i,n){var g;let a=this,l=C.getActiveSheet(t).getSelections()[0];if(!l)return;let c=l.row===-1?0:l.row,d=l.col===-1?0:l.col,u=null;if(i.tableName&&(u=a.sheet().tables.findByName(i.tableName)),u instanceof GC.Spread.Sheets.Tables.Table)u.style(i.tableStyle);else{a.clearMergeInRange(l);let f;try{f=a.sheet().tables.add(a.getNewTableName(),c,d,l.rowCount,l.colCount,i.tableStyle)}catch(b){return(g=t._designer)==null||g._showMessageBox(b.message,s.title,Re.error),!1}i.tableName?f.name(i.tableName):i.tableName=f.name()}let h=this.sheet().tables.find(c,d);h&&h.showResizeHandle(!0)}}var qr=(e=>(e.wholeTableStyle="wholeTableStyle",e.firstColumnStripStyle="firstColumnStripStyle",e.secondColumnStripStyle="secondColumnStripStyle",e.firstRowStripStyle="firstRowStripStyle",e.secondRowStripStyle="secondRowStripStyle",e.highlightLastColumnStyle="highlightLastColumnStyle",e.highlightFirstColumnStyle="highlightFirstColumnStyle",e.headerRowStyle="headerRowStyle",e.footerRowStyle="footerRowStyle",e.firstHeaderCellStyle="firstHeaderCellStyle",e.lastHeaderCellStyle="lastHeaderCellStyle",e.firstFooterCellStyle="firstFooterCellStyle",e.lastFooterCellStyle="lastFooterCellStyle",e))(qr||{});function hme(){return{type:"FlexContainer",className:"gc-tablestyle_container",children:[{type:"ColumnSet",className:"gc_name_container",children:[{type:"Column",children:[{type:"TextBlock",className:"gc_name",text:s.formatTableStyle.name}],width:"40px"},{type:"Column",children:[{type:"TextEditor",id:"nameinput",editorLabel:s.formatTableStyle.name,className:"gc_nameinput"}],width:"stretch"}]},{type:"Container",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"LabelContainer",className:"gc_tableelement",children:[{type:"List",id:"gc_list",listLabel:s.formatTableStyle.tableElement,className:"gc_list_container",items:[{text:s.tableElement.wholeTableStyle,value:"wholeTableStyle"},{text:s.tableElement.firstColumnStripStyle,value:"firstColumnStripStyle"},{text:s.tableElement.secondColumnStripStyle,value:"secondColumnStripStyle"},{text:s.tableElement.firstRowStripStyle,value:"firstRowStripStyle"},{text:s.tableElement.secondRowStripStyle,value:"secondRowStripStyle"},{text:s.tableElement.highlightLastColumnStyle,value:"highlightLastColumnStyle"},{text:s.tableElement.highlightFirstColumnStyle,value:"highlightFirstColumnStyle"},{text:s.tableElement.headerRowStyle,value:"headerRowStyle"},{text:s.tableElement.footerRowStyle,value:"footerRowStyle"},{text:s.tableElement.firstHeaderCellStyle,value:"firstHeaderCellStyle"},{text:s.tableElement.lastHeaderCellStyle,value:"lastHeaderCellStyle"},{text:s.tableElement.firstFooterCellStyle,value:"firstFooterCellStyle"},{text:s.tableElement.lastFooterCellStyle,value:"lastFooterCellStyle"}]},{type:"ColumnSet",className:"gc_buttons",children:[{type:"Column",children:[{type:"Button",id:"gc_format",className:"format_button",text:s.formatTableStyle.format,width:70}]},{type:"Column",children:[{type:"Button",id:"gc_clear",className:"clear_button",text:s.formatTableStyle.clear,width:70}]}]}],text:s.formatTableStyle.tableElement}],width:"420px"},{type:"Column",children:[{type:"LabelContainer",children:[{type:"Container",id:"gc_preview",className:"gc_preview"}],text:s.formatTableStyle.preview},{type:"LabelContainer",id:"gc_stripesize_container",className:"gc_stripesize_container",children:[{type:"Container",className:"gc_stripesize",children:[{id:"gc_stripesize_combo",type:"ListComboEditor",editorLabel:s.formatTableStyle.stripeSize,items:[{text:"1",value:"1"},{text:"2",value:"2"},{text:"3",value:"3"},{text:"4",value:"4"},{text:"5",value:"5"},{text:"6",value:"6"},{text:"7",value:"7"},{text:"8",value:"8"}]}]}],text:s.formatTableStyle.stripeSize}]}]}]}]}}function Xb(e,t,i,n,a,r,o,l){const c=JSON.parse(JSON.stringify(t));switch(C.judgeFillType(c)){case C.FillType.solidFill:i.fillStyle=Ae.themeColorToRGB(e,c),l();return;case C.FillType.gradientPathFill:const u=c;u.stops.forEach(f=>{f.color=Ae.themeColorToRGB(e,f.color)}),GC.Spread.Sheets.util.setFillStyle(i,u,n,a,r,o,l);return;case C.FillType.gradientFill:const h=c;h.stops.forEach(f=>{f.color=Ae.themeColorToRGB(e,f.color)}),GC.Spread.Sheets.util.setFillStyle(i,h,n,a,r,o,l);return;case C.FillType.patternFill:const g=c;g.backgroundColor=Ae.themeColorToRGB(e,g.backgroundColor),g.patternColor=Ae.themeColorToRGB(e,g.patternColor),GC.Spread.Sheets.util.setFillStyle(i,g,n,a,r,o,l);return;case C.FillType.none:default:return}}class bO extends yt{constructor(){super(...arguments),this._showHeader=!0,this._showFooter=!1,this._showBandRows=!0,this._showFirstCol=!1,this._showLastCol=!1,this._showBandedCols=!1}realRender(){var g,f;this._initOptions();const t=document.createElement("div"),i=this.options.width,n=this.options.height;t.style.width=`${this.options.width+5}px`,t.style.height=`${this.options.height+5}px`,t.style.overflow="hidden";const a=document.createElement("canvas");a.style.margin="2px",a.width=i+1,a.height=n+1;const r=a.getContext("2d");if(!r||!this.value)return;const o=(g=this.options.rowCount)!=null?g:5,l=(f=this.options.colCount)!=null?f:5,c=parseInt(a.width/l+"",10),d=parseInt(a.height/o+"",10),u=this._generateTableStyle(this.value,i,n),h=this._calculateCellStyles(u,o,l);this._drawTable(r,i,n,c,d,o,l,h),t.appendChild(a),this.host.appendChild(t)}_getActiveSpread(){var t;return(t=this._options.spread)!=null?t:Pe.getContextSpread()}_initOptions(){const t=this._getActiveSpread();if(this._options.openAllTableOption){this._showHeader=!0,this._showFooter=!0,this._showBandRows=!0,this._showFirstCol=!0,this._showLastCol=!0,this._showBandedCols=!0;return}if(t){const i=t.getActiveSheet();if(i){const n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.tables.find(n,a);r&&(this._showHeader=r.showHeader(),this._showFooter=r.showFooter(),this._showBandRows=r.bandRows(),this._showFirstCol=r.highlightFirstColumn(),this._showLastCol=r.highlightLastColumn(),this._showBandedCols=r.bandColumns())}}}_drawBorder(t,i,n,a,r,o){var h,g,f,b;const l=(h=o.borderTop)==null?void 0:h.color;l&&(t.strokeStyle=this._getThemeColor(l),t.beginPath(),t.moveTo(i,n+.5),t.lineTo(i+a,n+.5),t.stroke());const c=(g=o.borderBottom)==null?void 0:g.color;c&&(t.strokeStyle=this._getThemeColor(c),t.beginPath(),t.moveTo(i,n+r+.5),t.lineTo(i+a,n+r+.5),t.stroke());const d=(f=o.borderLeft)==null?void 0:f.color;d&&(t.strokeStyle=this._getThemeColor(d),t.beginPath(),t.moveTo(i+.5,n),t.lineTo(i+.5,n+r),t.stroke());const u=(b=o.borderRight)==null?void 0:b.color;u&&(t.strokeStyle=this._getThemeColor(u),t.beginPath(),t.moveTo(i+a+.5,n),t.lineTo(i+a+.5,n+r),t.stroke())}_drawTable(t,i,n,a,r,o,l,c){var b,S;const h=a-6,g="#fff",f="#000";t.fillStyle=Kt().colorBackground||g,t.fillRect(0,0,i+1,n+1),t.textAlign="center",t.lineWidth=1;for(let y=0;y<o;y++)for(let v=0;v<l;v++){const x=c[y][v],L=v*a,T=y*r;this._setFillStyle((b=x.backColor)!=null?b:g,t,L,T,a,r,()=>{t.fillRect(L,T,a,r)}),t.strokeStyle=this._getThemeColor((S=x.foreColor)!=null?S:f),t.beginPath(),t.moveTo(L+3,T+Math.floor(r/2)+.5),t.lineTo(L+3+h,T+Math.floor(r/2)+.5),t.stroke()}t.lineWidth=1;for(let y=1;y<o-1;y++)for(let v=0;v<l;v++){const x=c[y][v],L=v*a,T=y*r;this._drawBorder(t,L,T,a,r,x)}for(let y=0;y<l;y++){const v=c[0][y],x=y*a;this._drawBorder(t,x,0,a,r,v)}for(let y=0;y<l;y++){const v=c[o-1][y],x=y*a,L=r*(o-1);this._drawBorder(t,x,L,a,r,v)}}_getThemeColor(t){const i=this._getActiveSpread();if(i){const n=C.getActualActiveSheet(i);return Ae.themeColorToRGB(n,t)}return t}_setFillStyle(t,i,n,a,r,o,l){const c=this._getActiveSpread();if(c){const d=C.getActualActiveSheet(c);Xb(d,t,i,n,a,r,o,l)}}_generateTableStyle(t,i,n){return{width:i,height:n,wholeTable:t.wholeTableStyle&&t.wholeTableStyle(),firstColumn:t.highlightFirstColumnStyle&&t.highlightFirstColumnStyle(),lastColumn:t.highlightLastColumnStyle&&t.highlightLastColumnStyle(),rowHeader:t.headerRowStyle&&t.headerRowStyle(),rowFooter:t.footerRowStyle&&t.footerRowStyle(),firstColumnStripe:t.firstColumnStripStyle&&t.firstColumnStripStyle(),firstRowStripe:t.firstRowStripStyle&&t.firstRowStripStyle(),secondColumnStripe:t.secondColumnStripStyle&&t.secondColumnStripStyle(),secondRowStripe:t.secondRowStripStyle&&t.secondRowStripStyle(),firstColumnStripeSize:t.firstColumnStripSize&&t.firstColumnStripSize(),firstRowStripeSize:t.firstRowStripSize&&t.firstRowStripSize(),secondColumnStripeSize:t.secondColumnStripSize&&t.secondColumnStripSize(),secondRowStripeSize:t.secondRowStripSize&&t.secondRowStripSize(),firstHeaderCell:t.firstHeaderCellStyle&&t.firstHeaderCellStyle(),lastHeaderCell:t.lastHeaderCellStyle&&t.lastHeaderCellStyle(),firstFooterCell:t.firstFooterCellStyle&&t.firstFooterCellStyle(),lastFooterCell:t.lastFooterCellStyle&&t.lastFooterCellStyle()}}_calculateCellStyles(t,i,n){var d,u,h,g,f,b,S,y,v,x,L,T,w,M,D,P,A,E,O,I,R,k,N,B,F,j,K,Q,X,ne,ce,fe,J,V,Z,Y,W,H,$,ee,ae,de,he,be,Le,Fe,q,se,ue,ge,xe,ke,Je,Qe,ft,bt,ve,we,Me,Ne,Ct,St,mt,Nt,pi,Ni,Zn,gn,fn,Ua,Pr,ao,Hr,zr,Tp,Yl,mu,Qc,Ir,Ro,et,Xy,$y,ev,tv,iv,nv,av,rv,ov,lv,gu,sv,cv,dv,uv,hv,pv,rf,mv,ul,ql,of,gv,fv,bv,lf,Sv,Cv,sf,yv,cf,df,vv,uf,xv,Lv,Tv,wp,wv,Dv,Av,Pv,Iv,Mv,kv,Dp,Rv;const a=[],r=this._showHeader?1:0,o=this._showFooter?i-1:i;for(let Ja=r;Ja<o;Ja++){const jr=[],mr=(Ja-r+1)%(t.firstRowStripeSize+t.secondRowStripeSize),tt=mr===0||mr>t.firstRowStripeSize;for(let fu=0;fu<n;fu++){const _v=(fu+1)%(t.firstColumnStripeSize+t.secondColumnStripeSize),Ov=_v===0||_v>t.firstColumnStripeSize,bu=fu===0,Ap=fu===n-1,It={backColor:(u=(d=t.wholeTable)==null?void 0:d.backColor)!=null?u:"#fff",foreColor:(g=(h=t.wholeTable)==null?void 0:h.foreColor)!=null?g:"#000",borderTop:Ja===0?(f=t.wholeTable)==null?void 0:f.borderTop:(b=t.wholeTable)==null?void 0:b.borderHorizontal,borderBottom:Ja===i-1?(S=t.wholeTable)==null?void 0:S.borderBottom:(y=t.wholeTable)==null?void 0:y.borderHorizontal,borderLeft:bu?(v=t.wholeTable)==null?void 0:v.borderLeft:(x=t.wholeTable)==null?void 0:x.borderVertical,borderRight:Ap?(L=t.wholeTable)==null?void 0:L.borderRight:(T=t.wholeTable)==null?void 0:T.borderVertical};!Ov&&t.firstColumnStripe&&this._showBandedCols&&(It.backColor=(w=t.firstColumnStripe.backColor)!=null?w:It.backColor,It.foreColor=(M=t.firstColumnStripe.foreColor)!=null?M:It.foreColor,It.borderTop=(D=t.firstColumnStripe.borderHorizontal)!=null?D:It.borderTop,It.borderBottom=(P=t.firstColumnStripe.borderHorizontal)!=null?P:It.borderBottom,It.borderLeft=(A=t.firstColumnStripe.borderLeft)!=null?A:It.borderLeft,It.borderRight=(E=t.firstColumnStripe.borderRight)!=null?E:It.borderRight),Ov&&t.secondColumnStripe&&this._showBandedCols&&(It.backColor=(O=t.secondColumnStripe.backColor)!=null?O:It.backColor,It.foreColor=(I=t.secondColumnStripe.foreColor)!=null?I:It.foreColor,It.borderTop=(R=t.secondColumnStripe.borderHorizontal)!=null?R:It.borderTop,It.borderBottom=(k=t.secondColumnStripe.borderHorizontal)!=null?k:It.borderBottom,It.borderLeft=(N=t.secondColumnStripe.borderLeft)!=null?N:It.borderLeft,It.borderRight=(B=t.secondColumnStripe.borderRight)!=null?B:It.borderRight),!tt&&t.firstRowStripe&&this._showBandRows&&(It.backColor=(F=t.firstRowStripe.backColor)!=null?F:It.backColor,It.foreColor=(j=t.firstRowStripe.foreColor)!=null?j:It.foreColor,It.borderTop=(K=t.firstRowStripe.borderTop)!=null?K:It.borderTop,It.borderBottom=(Q=t.firstRowStripe.borderBottom)!=null?Q:It.borderBottom,It.borderLeft=(X=bu?t.firstRowStripe.borderLeft:t.firstRowStripe.borderVertical)!=null?X:It.borderLeft,It.borderRight=(ne=Ap?t.firstRowStripe.borderRight:t.firstRowStripe.borderVertical)!=null?ne:It.borderRight),tt&&t.secondRowStripe&&this._showBandRows&&(It.backColor=(ce=t.secondRowStripe.backColor)!=null?ce:It.backColor,It.foreColor=(fe=t.secondRowStripe.foreColor)!=null?fe:It.foreColor,It.borderTop=(J=t.secondRowStripe.borderTop)!=null?J:It.borderTop,It.borderBottom=(V=t.secondRowStripe.borderBottom)!=null?V:It.borderBottom,It.borderLeft=(Z=bu?t.secondRowStripe.borderLeft:t.secondRowStripe.borderVertical)!=null?Z:It.borderLeft,It.borderRight=(Y=Ap?t.secondRowStripe.borderRight:t.secondRowStripe.borderVertical)!=null?Y:It.borderRight),Ap&&t.lastColumn&&this._showLastCol&&(It.backColor=(W=t.lastColumn.backColor)!=null?W:It.backColor,It.foreColor=(H=t.lastColumn.foreColor)!=null?H:It.foreColor,It.borderTop=($=t.lastColumn.borderHorizontal)!=null?$:It.borderTop,It.borderBottom=(ee=t.lastColumn.borderHorizontal)!=null?ee:It.borderBottom,It.borderLeft=(ae=t.lastColumn.borderLeft)!=null?ae:It.borderLeft,It.borderRight=(de=t.lastColumn.borderRight)!=null?de:It.borderRight),bu&&t.firstColumn&&this._showFirstCol&&(It.backColor=(he=t.firstColumn.backColor)!=null?he:It.backColor,It.foreColor=(be=t.firstColumn.foreColor)!=null?be:It.foreColor,It.borderTop=(Le=t.firstColumn.borderHorizontal)!=null?Le:It.borderTop,It.borderBottom=(Fe=t.firstColumn.borderHorizontal)!=null?Fe:It.borderBottom,It.borderLeft=(q=t.firstColumn.borderLeft)!=null?q:It.borderLeft,It.borderRight=(se=t.firstColumn.borderRight)!=null?se:It.borderRight),jr.push(It)}a.push(jr)}let l=[];if(this._showHeader){for(let Ja=0;Ja<n;Ja++){const jr=Ja===0,mr=Ja===n-1,tt={backColor:(ge=(ue=t.wholeTable)==null?void 0:ue.backColor)!=null?ge:"#fff",foreColor:(ke=(xe=t.wholeTable)==null?void 0:xe.foreColor)!=null?ke:"#000",borderTop:(Je=t.wholeTable)==null?void 0:Je.borderTop,borderBottom:(Qe=t.wholeTable)==null?void 0:Qe.borderHorizontal,borderLeft:jr?(ft=t.wholeTable)==null?void 0:ft.borderLeft:(bt=t.wholeTable)==null?void 0:bt.borderVertical,borderRight:mr?(ve=t.wholeTable)==null?void 0:ve.borderRight:(we=t.wholeTable)==null?void 0:we.borderVertical};mr&&t.lastColumn&&this._showLastCol&&(tt.backColor=(Me=t.lastColumn.backColor)!=null?Me:tt.backColor,tt.foreColor=(Ne=t.lastColumn.foreColor)!=null?Ne:tt.foreColor,tt.borderTop=(Ct=t.lastColumn.borderTop)!=null?Ct:tt.borderTop,tt.borderBottom=(St=t.lastColumn.borderHorizontal)!=null?St:tt.borderBottom,tt.borderLeft=(mt=t.lastColumn.borderLeft)!=null?mt:tt.borderLeft,tt.borderRight=(Nt=t.lastColumn.borderRight)!=null?Nt:tt.borderRight),jr&&t.firstColumn&&this._showFirstCol&&(tt.backColor=(pi=t.firstColumn.backColor)!=null?pi:tt.backColor,tt.foreColor=(Ni=t.firstColumn.foreColor)!=null?Ni:tt.foreColor,tt.borderTop=(Zn=t.firstColumn.borderTop)!=null?Zn:tt.borderTop,tt.borderBottom=(gn=t.firstColumn.borderHorizontal)!=null?gn:tt.borderBottom,tt.borderLeft=(fn=t.firstColumn.borderLeft)!=null?fn:tt.borderLeft,tt.borderRight=(Ua=t.firstColumn.borderRight)!=null?Ua:tt.borderRight),t.rowHeader&&(tt.backColor=(Pr=t.rowHeader.backColor)!=null?Pr:tt.backColor,tt.foreColor=(ao=t.rowHeader.foreColor)!=null?ao:tt.foreColor,tt.borderTop=(Hr=t.rowHeader.borderTop)!=null?Hr:tt.borderTop,tt.borderBottom=(zr=t.rowHeader.borderBottom)!=null?zr:tt.borderBottom,tt.borderLeft=(Tp=jr?t.rowHeader.borderLeft:t.rowHeader.borderVertical)!=null?Tp:tt.borderLeft,tt.borderRight=(Yl=mr?t.rowHeader.borderRight:t.rowHeader.borderVertical)!=null?Yl:tt.borderRight),jr&&t.firstHeaderCell&&this._showFirstCol&&(tt.backColor=(mu=t.firstHeaderCell.backColor)!=null?mu:tt.backColor,tt.foreColor=(Qc=t.firstHeaderCell.foreColor)!=null?Qc:tt.foreColor,tt.borderTop=(Ir=t.firstHeaderCell.borderTop)!=null?Ir:tt.borderTop,tt.borderBottom=(Ro=t.firstHeaderCell.borderBottom)!=null?Ro:tt.borderBottom,tt.borderLeft=(et=t.firstHeaderCell.borderLeft)!=null?et:tt.borderLeft,tt.borderRight=(Xy=t.firstHeaderCell.borderRight)!=null?Xy:tt.borderRight),mr&&t.lastHeaderCell&&this._showLastCol&&(tt.backColor=($y=t.lastHeaderCell.backColor)!=null?$y:tt.backColor,tt.foreColor=(ev=t.lastHeaderCell.foreColor)!=null?ev:tt.foreColor,tt.borderTop=(tv=t.lastHeaderCell.borderTop)!=null?tv:tt.borderTop,tt.borderBottom=(iv=t.lastHeaderCell.borderBottom)!=null?iv:tt.borderBottom,tt.borderLeft=(nv=t.lastHeaderCell.borderLeft)!=null?nv:tt.borderLeft,tt.borderRight=(av=t.lastHeaderCell.borderRight)!=null?av:tt.borderRight),l.push(tt)}a.unshift(l)}let c=[];if(this._showFooter){for(let Ja=0;Ja<n;Ja++){const jr=Ja===0,mr=Ja===n-1,tt={backColor:(ov=(rv=t.wholeTable)==null?void 0:rv.backColor)!=null?ov:"#fff",foreColor:(gu=(lv=t.wholeTable)==null?void 0:lv.foreColor)!=null?gu:"#000",borderTop:(sv=t.wholeTable)==null?void 0:sv.borderHorizontal,borderBottom:(cv=t.wholeTable)==null?void 0:cv.borderBottom,borderLeft:jr?(dv=t.wholeTable)==null?void 0:dv.borderLeft:(uv=t.wholeTable)==null?void 0:uv.borderVertical,borderRight:mr?(hv=t.wholeTable)==null?void 0:hv.borderRight:(pv=t.wholeTable)==null?void 0:pv.borderVertical};mr&&t.lastColumn&&this._showLastCol&&(tt.backColor=(rf=t.lastColumn.backColor)!=null?rf:tt.backColor,tt.foreColor=(mv=t.lastColumn.foreColor)!=null?mv:tt.foreColor,tt.borderTop=(ul=t.lastColumn.borderHorizontal)!=null?ul:tt.borderTop,tt.borderBottom=(ql=t.lastColumn.borderBottom)!=null?ql:tt.borderBottom,tt.borderLeft=(of=t.lastColumn.borderLeft)!=null?of:tt.borderLeft,tt.borderRight=(gv=t.lastColumn.borderRight)!=null?gv:tt.borderRight),jr&&t.firstColumn&&this._showFirstCol&&(tt.backColor=(fv=t.firstColumn.backColor)!=null?fv:tt.backColor,tt.foreColor=(bv=t.firstColumn.foreColor)!=null?bv:tt.foreColor,tt.borderTop=(lf=t.firstColumn.borderHorizontal)!=null?lf:tt.borderTop,tt.borderBottom=(Sv=t.firstColumn.borderBottom)!=null?Sv:tt.borderBottom,tt.borderLeft=(Cv=t.firstColumn.borderLeft)!=null?Cv:tt.borderLeft,tt.borderRight=(sf=t.firstColumn.borderRight)!=null?sf:tt.borderRight),t.rowFooter&&(tt.backColor=(yv=t.rowFooter.backColor)!=null?yv:tt.backColor,tt.foreColor=(cf=t.rowFooter.foreColor)!=null?cf:tt.foreColor,tt.borderTop=(df=t.rowFooter.borderTop)!=null?df:tt.borderTop,tt.borderBottom=(vv=t.rowFooter.borderBottom)!=null?vv:tt.borderBottom,tt.borderLeft=(uf=jr?t.rowFooter.borderLeft:t.rowFooter.borderVertical)!=null?uf:tt.borderLeft,tt.borderRight=(xv=mr?t.rowFooter.borderRight:t.rowFooter.borderVertical)!=null?xv:tt.borderRight),jr&&t.firstFooterCell&&this._showFirstCol&&(tt.backColor=(Lv=t.firstFooterCell.backColor)!=null?Lv:tt.backColor,tt.foreColor=(Tv=t.firstFooterCell.foreColor)!=null?Tv:tt.foreColor,tt.borderBottom=(wp=t.firstFooterCell.borderBottom)!=null?wp:tt.borderBottom,tt.borderLeft=(wv=t.firstFooterCell.borderLeft)!=null?wv:tt.borderLeft,tt.borderRight=(Dv=t.firstFooterCell.borderRight)!=null?Dv:tt.borderRight,tt.borderTop=(Av=t.firstFooterCell.borderTop)!=null?Av:tt.borderTop),mr&&t.lastFooterCell&&this._showLastCol&&(tt.backColor=(Pv=t.lastFooterCell.backColor)!=null?Pv:tt.backColor,tt.foreColor=(Iv=t.lastFooterCell.foreColor)!=null?Iv:tt.foreColor,tt.borderBottom=(Mv=t.lastFooterCell.borderBottom)!=null?Mv:tt.borderBottom,tt.borderLeft=(kv=t.lastFooterCell.borderLeft)!=null?kv:tt.borderLeft,tt.borderRight=(Dp=t.lastFooterCell.borderRight)!=null?Dp:tt.borderRight,tt.borderTop=(Rv=t.lastFooterCell.borderTop)!=null?Rv:tt.borderTop),c.push(tt)}a.push(c)}return a}}var pme=Object.getOwnPropertyDescriptor,mme=(e,t,i,n)=>{for(var a=n>1?void 0:n?pme(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};const SO="gc-hidden-stripe-size";let CO=class extends us{constructor(){super(...arguments),this._tableStyle=new GC.Spread.Sheets.Tables.TableTheme}getComponentJson(){return[hme()]}onMounted(){this.host.classList.toggle(SO,!0)}onDestroy(){this._tableStyle.name(this.component_stylename.value),this._value={customTableStyle:this._tableStyle,styleName:this.component_stylename.value},this.raiseValueChanged(),this._tableStylePreview&&(this._tableStylePreview.dispose(),this._tableStylePreview=void 0),this._tableStyle=null}_refresh(){this._value===void 0||this._value===null||(this._spread=Pe.getContextSpread(),this._tableStyle=this._cloneStyle(this._value.customTableStyle),this.component_list.value=qr.wholeTableStyle,this.component_stripesize.value="1",this.component_stylename.value=this._value.styleName,this._updateListItemClass(),this.component_clear.enable=!this._isNullStyle(this._tableStyle.wholeTableStyle()),this._renderPreview())}_attachEvent(){const e=Pe.getDialogOwner();this.component_format.on(rt.ValueChanged,async()=>{const t=this._generateFormatDialogOption(),i=await e._showDialog(G.ConditionalFormatDialogTemplate,t),n=this._composeStyle(i);n&&(this._updateTableStyle(n),this._updateListItemClass(),this._updateClearBtnState(!this._isNullStyle(this._tableStyle[this.component_list.value].call(this._tableStyle))))}),this.component_list.on(si.ListItemClickEvent,t=>{const i=this._tableStyle,n=i[t].call(i),a=t.indexOf("Strip")!==-1;if(this.host.classList.toggle(SO,!a),a){let r=1;t===qr.firstColumnStripStyle?r=i.firstColumnStripSize():t===qr.secondColumnStripStyle?r=i.secondColumnStripSize():t===qr.firstRowStripStyle?r=i.firstRowStripSize():r=i.secondRowStripSize(),this.component_stripesize.value=String(r)}this._updateClearBtnState(!this._isNullStyle(n))}),this.component_stripesize.on(lt.ValueChanged,()=>{this._updateStripeSize(),this._updateListItemClass(),this._updateClearBtnState(!this._isNullStyle(this._tableStyle[this.component_list.value].call(this._tableStyle))),this._renderPreview()}),this.component_clear.on(rt.ValueChanged,()=>{this._clearTableStyle()})}_updateListItemClass(){const e=this.component_list.items();if(e){const t=this._tableStyle,i=e.map(n=>{const a=t[n.value].call(t);return this._isNullStyle(a,n.value)?n.className=void 0:n.className="gc-table-style-highlight-item",n});this.component_list.items(i),this.component_list.RenderAll()}}_renderPreview(){this._tableStylePreview&&(this._tableStylePreview.dispose(),this._tableStylePreview=void 0,this.preview.container.innerHTML="");const e=new bO(this.preview.container,{width:120,height:100,rowCount:7,colCount:6,openAllTableOption:!0,spread:this._spread});e.value=this._tableStyle,e.RenderAll(),this._tableStylePreview=e}_cloneStyle(e){const t=new GC.Spread.Sheets.Tables.TableTheme;return t.fromJSON(e),t}_getTabOption(e){return{dialogOption:{activeTab:dt.Font,showTabList:[dt.Font,dt.Border,dt.Fill]},fontTabOption:{foreColor:e==null?void 0:e.foreColor,fontWeight:C.getFormatDialogFontWeight({fontWeight:(e==null?void 0:e.fontWeight)||"normal"}),fontStyle:C.getFormatDialogFontStyle({fontWeight:(e==null?void 0:e.fontWeight)||"normal",fontStyle:(e==null?void 0:e.fontStyle)||"normal"}),fontUnderlineListAndEffects:C.generateFontUnderlineListAndEffectsOptionByStyleTextDecoration((e==null?void 0:e.textDecoration)||0),disableFontFamily:!0,disableFontSize:!0},fillTabOption:{backColor:e==null?void 0:e.backColor},borderTabOption:{enableDiagonalUp:!1,enableDiagonalDown:!1,enableBorderHorizontal:!0,enableBorderVertical:!0,borderLeft:(e==null?void 0:e.borderLeft)||new GC.Spread.Sheets.LineBorder,borderTop:(e==null?void 0:e.borderTop)||new GC.Spread.Sheets.LineBorder,borderRight:(e==null?void 0:e.borderRight)||new GC.Spread.Sheets.LineBorder,borderBottom:(e==null?void 0:e.borderBottom)||new GC.Spread.Sheets.LineBorder,borderVertical:(e==null?void 0:e.borderVertical)||new GC.Spread.Sheets.LineBorder,borderHorizontal:(e==null?void 0:e.borderHorizontal)||new GC.Spread.Sheets.LineBorder}}}_generateFormatDialogOption(){const e=this._tableStyle,t=e[this.component_list.value].call(e);return this._getTabOption(t)}_composeStyle(e){var t,i,n;if(e)return{dialogOption:{activeTab:dt.Font,showTabList:[dt.Font,dt.Border,dt.Fill]},fontTabOption:e.fontTabOption,fillTabOption:{...e.fillTabOption,backColor:(t=e.fillTabOption)!=null&&t.backColor&&((i=e.fillTabOption)==null?void 0:i.backColor)!==""?Ke((n=e.fillTabOption)==null?void 0:n.backColor):void 0},borderTabOption:e.borderTabOption}}_clearTableStyle(){const e=this.component_list.value;!e||Object.keys(this._tableStyle).length===0||(this._tableStyle[e].call(this._tableStyle,new GC.Spread.Sheets.Tables.TableStyle),this._updateClearBtnState(!1),this._updateStripeSize(1),this._updateListItemClass(),this._renderPreview())}_updateTableStyle(e){var n;const t=this.component_list.value;if(!e||!t||Object.keys(this._tableStyle).length===0)return;let i=this._tableStyle[t].call(this._tableStyle);if(!i){const a=this._tableStyle[t].call(this._tableStyle,new GC.Spread.Sheets.Tables.TableStyle);i=a[t].call(a)}if(e.fontTabOption){const a=e.fontTabOption,r=a.fontStyle,o=a.fontSize||"11pt",l=a.fontFamily||"Calibri";i.font=`${r} ${o} ${l}`.trim(),i.textDecoration=(n=a.fontUnderlineListAndEffects)==null?void 0:n.textDecoration,i.foreColor=a.foreColor,i.fontWeight=a.fontWeight||"normal"}if(e.fillTabOption&&(i.backColor=e.fillTabOption.backColor),e.borderTabOption){const a=e.borderTabOption;i.borderLeft=a.borderLeft,i.borderRight=a.borderRight,i.borderTop=a.borderTop,i.borderBottom=a.borderBottom,i.borderHorizontal=a.borderHorizontal,i.borderVertical=a.borderVertical}this._renderPreview()}_updateStripeSize(e){const t=this.component_list.value;if(!t||Object.keys(this._tableStyle).length===0)return;let i=parseInt(this.component_stripesize.value,10);switch(e!==void 0&&(i=e,this.component_stripesize.value=String(i)),t){case qr.firstColumnStripStyle:this._tableStyle.firstColumnStripSize(i);break;case qr.secondColumnStripStyle:this._tableStyle.secondColumnStripSize(i);break;case qr.firstRowStripStyle:this._tableStyle.firstRowStripSize(i);break;case qr.secondRowStripStyle:this._tableStyle.secondRowStripSize(i);break;default:return}}_updateClearBtnState(e){this.component_clear.enable=e}_isNullStyle(e,t){const i=t!=null?t:this.component_list.value;let n=!1;switch(i){case qr.firstColumnStripStyle:n=(this._tableStyle.firstColumnStripSize?this._tableStyle.firstColumnStripSize():1)!==1;break;case qr.secondColumnStripStyle:n=(this._tableStyle.secondColumnStripSize?this._tableStyle.secondColumnStripSize():1)!==1;break;case qr.firstRowStripStyle:n=(this._tableStyle.firstRowStripSize?this._tableStyle.firstRowStripSize():1)!==1;break;case qr.secondRowStripStyle:n=(this._tableStyle.secondRowStripSize?this._tableStyle.secondRowStripSize():1)!==1;break}return(!e||!Object.keys(e).some(a=>!!e[a]))&&!n}get component_list(){return this.getComponent("gc_list")}get component_stripesize(){return this.getComponent("gc_stripesize_combo")}get component_format(){return this.getComponent("gc_format")}get component_clear(){return this.getComponent("gc_clear")}get component_stylename(){return this.getComponent("nameinput")}get preview(){return this.getComponent("gc_preview")}};CO=mme([Ue.Register("TableStyleEditor")],CO);const E0=function(e){return{templateName:G.TableStyleDialogTemplate,title:e!=null?e:s.formatTableStyle.newStyleDialogTitle,content:[{type:"TableStyleEditor",bindingPath:"data"}]}};_e(G.TableStyleDialogTemplate,E0);let gme={text:"${res.formatTableStyle.newTableStyle}",iconClass:"ribbon-button-new-table-style-element",commandName:p.NewTableStyle,execute:async e=>{let t=e.getData(re.tableStyleKey)||[],i={data:{styleName:`${s.formatTableStyle.newStyleDialogTitle} ${t.length+1}`,customTableStyle:new GC.Spread.Sheets.Tables.TableTheme().toJSON()}},n=await e._showDialog(G.TableStyleDialogTemplate,i,N0);n&&n.data&&(e.Spread.customTableThemes.add(n.data.customTableStyle),e.setData(re.tableStyleKey,e.Spread.customTableThemes.all()||[]))},init:e=>{e.setData(re.tableStyleKey,e.Spread.customTableThemes.all()||[])}};function N0(e,t){if(e&&e.data){let i=e.data.styleName.toLowerCase();if(vO(i)||th[i])return t==null||t._showMessageBox(s.formatTableStyle.exception,s.title,Re.info,vt.ok),!1}return!0}function yO(e,t,i){if(e&&e.data){let n=e.data.styleName.toLowerCase(),a=vO(n)||th[n],r=!1;if(t&&(r=n===t.toLowerCase()),a&&!r)return i==null||i._showMessageBox(s.formatTableStyle.exception,s.title,Re.info,vt.ok),!1}return!0}function vO(e){const t=(i,n)=>i&&n&&i.toLowerCase()===n.toLowerCase();return Object.keys(GC.Spread.Sheets.Tables.TableThemes).some(i=>t("TableStyle"+i,e))}const fme=Object.freeze(Object.defineProperty({__proto__:null,newTableStyle:gme,tableStyleModifyValid:yO,tableStyleValid:N0},Symbol.toStringTag,{value:"Module"}));var eh=(e=>(e.C_Modify="modify",e.C_Delete="delete",e.C_Set_Default="setDefault",e.C_Duplicate="duplicate",e.C_Apply="apply",e.C_Modify_Object="modifyObject",e))(eh||{});const Tt={};Tt.light0=null,Tt.light1=GC.Spread.Sheets.Tables.TableThemes.light1,Tt.light2=GC.Spread.Sheets.Tables.TableThemes.light2,Tt.light3=GC.Spread.Sheets.Tables.TableThemes.light3,Tt.light4=GC.Spread.Sheets.Tables.TableThemes.light4,Tt.light5=GC.Spread.Sheets.Tables.TableThemes.light5,Tt.light6=GC.Spread.Sheets.Tables.TableThemes.light6,Tt.light7=GC.Spread.Sheets.Tables.TableThemes.light7,Tt.light8=GC.Spread.Sheets.Tables.TableThemes.light8,Tt.light9=GC.Spread.Sheets.Tables.TableThemes.light9,Tt.light10=GC.Spread.Sheets.Tables.TableThemes.light10,Tt.light11=GC.Spread.Sheets.Tables.TableThemes.light11,Tt.light12=GC.Spread.Sheets.Tables.TableThemes.light12,Tt.light13=GC.Spread.Sheets.Tables.TableThemes.light13,Tt.light14=GC.Spread.Sheets.Tables.TableThemes.light14,Tt.light15=GC.Spread.Sheets.Tables.TableThemes.light15,Tt.light16=GC.Spread.Sheets.Tables.TableThemes.light16,Tt.light17=GC.Spread.Sheets.Tables.TableThemes.light17,Tt.light18=GC.Spread.Sheets.Tables.TableThemes.light18,Tt.light19=GC.Spread.Sheets.Tables.TableThemes.light19,Tt.light20=GC.Spread.Sheets.Tables.TableThemes.light20,Tt.light21=GC.Spread.Sheets.Tables.TableThemes.light21,Tt.medium1=GC.Spread.Sheets.Tables.TableThemes.medium1,Tt.medium2=GC.Spread.Sheets.Tables.TableThemes.medium2,Tt.medium3=GC.Spread.Sheets.Tables.TableThemes.medium3,Tt.medium4=GC.Spread.Sheets.Tables.TableThemes.medium4,Tt.medium5=GC.Spread.Sheets.Tables.TableThemes.medium5,Tt.medium6=GC.Spread.Sheets.Tables.TableThemes.medium6,Tt.medium7=GC.Spread.Sheets.Tables.TableThemes.medium7,Tt.medium8=GC.Spread.Sheets.Tables.TableThemes.medium8,Tt.medium9=GC.Spread.Sheets.Tables.TableThemes.medium9,Tt.medium10=GC.Spread.Sheets.Tables.TableThemes.medium10,Tt.medium11=GC.Spread.Sheets.Tables.TableThemes.medium11,Tt.medium12=GC.Spread.Sheets.Tables.TableThemes.medium12,Tt.medium13=GC.Spread.Sheets.Tables.TableThemes.medium13,Tt.medium14=GC.Spread.Sheets.Tables.TableThemes.medium14,Tt.medium15=GC.Spread.Sheets.Tables.TableThemes.medium15,Tt.medium16=GC.Spread.Sheets.Tables.TableThemes.medium16,Tt.medium17=GC.Spread.Sheets.Tables.TableThemes.medium17,Tt.medium18=GC.Spread.Sheets.Tables.TableThemes.medium18,Tt.medium19=GC.Spread.Sheets.Tables.TableThemes.medium19,Tt.medium20=GC.Spread.Sheets.Tables.TableThemes.medium20,Tt.medium21=GC.Spread.Sheets.Tables.TableThemes.medium21,Tt.medium22=GC.Spread.Sheets.Tables.TableThemes.medium22,Tt.medium23=GC.Spread.Sheets.Tables.TableThemes.medium23,Tt.medium24=GC.Spread.Sheets.Tables.TableThemes.medium24,Tt.medium25=GC.Spread.Sheets.Tables.TableThemes.medium25,Tt.medium26=GC.Spread.Sheets.Tables.TableThemes.medium26,Tt.medium27=GC.Spread.Sheets.Tables.TableThemes.medium27,Tt.medium28=GC.Spread.Sheets.Tables.TableThemes.medium28,Tt.dark1=GC.Spread.Sheets.Tables.TableThemes.dark1,Tt.dark2=GC.Spread.Sheets.Tables.TableThemes.dark2,Tt.dark3=GC.Spread.Sheets.Tables.TableThemes.dark3,Tt.dark4=GC.Spread.Sheets.Tables.TableThemes.dark4,Tt.dark5=GC.Spread.Sheets.Tables.TableThemes.dark5,Tt.dark6=GC.Spread.Sheets.Tables.TableThemes.dark6,Tt.dark7=GC.Spread.Sheets.Tables.TableThemes.dark7,Tt.dark8=GC.Spread.Sheets.Tables.TableThemes.dark8,Tt.dark9=GC.Spread.Sheets.Tables.TableThemes.dark9,Tt.dark10=GC.Spread.Sheets.Tables.TableThemes.dark10,Tt.dark11=GC.Spread.Sheets.Tables.TableThemes.dark11,Tt.professional1=GC.Spread.Sheets.Tables.TableThemes.professional1,Tt.professional2=GC.Spread.Sheets.Tables.TableThemes.professional2,Tt.professional3=GC.Spread.Sheets.Tables.TableThemes.professional3,Tt.professional4=GC.Spread.Sheets.Tables.TableThemes.professional4,Tt.professional5=GC.Spread.Sheets.Tables.TableThemes.professional5,Tt.professional6=GC.Spread.Sheets.Tables.TableThemes.professional6,Tt.professional7=GC.Spread.Sheets.Tables.TableThemes.professional7,Tt.professional8=GC.Spread.Sheets.Tables.TableThemes.professional8,Tt.professional9=GC.Spread.Sheets.Tables.TableThemes.professional9,Tt.professional10=GC.Spread.Sheets.Tables.TableThemes.professional10,Tt.professional11=GC.Spread.Sheets.Tables.TableThemes.professional11,Tt.professional12=GC.Spread.Sheets.Tables.TableThemes.professional12,Tt.professional13=GC.Spread.Sheets.Tables.TableThemes.professional13,Tt.professional14=GC.Spread.Sheets.Tables.TableThemes.professional14,Tt.professional15=GC.Spread.Sheets.Tables.TableThemes.professional15,Tt.professional16=GC.Spread.Sheets.Tables.TableThemes.professional16,Tt.professional17=GC.Spread.Sheets.Tables.TableThemes.professional17,Tt.professional18=GC.Spread.Sheets.Tables.TableThemes.professional18,Tt.professional19=GC.Spread.Sheets.Tables.TableThemes.professional19,Tt.professional20=GC.Spread.Sheets.Tables.TableThemes.professional20,Tt.professional21=GC.Spread.Sheets.Tables.TableThemes.professional21,Tt.professional22=GC.Spread.Sheets.Tables.TableThemes.professional22,Tt.professional23=GC.Spread.Sheets.Tables.TableThemes.professional23,Tt.professional24=GC.Spread.Sheets.Tables.TableThemes.professional24;const wl=(e,t)=>{var o;const i=Pe.getContextSpread(),n=t.value;let a;if(t.contextMenuOnly){const l=Pe.getContextDesigner(),c=l&&Tm(l);a=c==null?void 0:c.style()}else a=GC.Spread.Sheets.Tables.TableThemes[n],!a&&i&&(a=(o=i.customTableThemes.get(n))!=null?o:new GC.Spread.Sheets.Tables.TableTheme);const r=new bO(e,{width:60,height:45});r.value=a,r.RenderAll()};let th={},xO=[{groupName:"${res.formatTableStyle.custom}",visible:!1,wrap:!1,commandName:p.FormatTableListContent,render:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[],contextMenu:[{text:"${res.formatTableStyle.apply}",commandName:p.FormatTableListContent,value:"apply"},{text:"${res.formatTableStyle.modify}",commandName:p.FormatTableListContent,value:"modify"},{text:"${res.formatTableStyle.duplicate}",commandName:p.FormatTableListContent,value:"duplicate"},{text:"${res.formatTableStyle.delete}",commandName:p.FormatTableListContent,value:"delete"},{text:"${res.formatTableStyle.setAsDefault}",commandName:p.FormatTableListContent,value:"setDefault"}]},{groupName:"${res.formatTableStyle.light}",commandName:p.FormatTableListContent,itemRender:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[{value:"light0",tip:"${res.formatTableStyle.none}"},{value:"light1",tip:"${res.formatTableStyle.light}1"},{value:"light2",tip:"${res.formatTableStyle.light}2"},{value:"light3",tip:"${res.formatTableStyle.light}3"},{value:"light4",tip:"${res.formatTableStyle.light}4"},{value:"light5",tip:"${res.formatTableStyle.light}5"},{value:"light6",tip:"${res.formatTableStyle.light}6"},{value:"light7",tip:"${res.formatTableStyle.light}7"},{value:"light8",tip:"${res.formatTableStyle.light}8"},{value:"light9",tip:"${res.formatTableStyle.light}9"},{value:"light10",tip:"${res.formatTableStyle.light}10"},{value:"light11",tip:"${res.formatTableStyle.light}11"},{value:"light12",tip:"${res.formatTableStyle.light}12"},{value:"light13",tip:"${res.formatTableStyle.light}13"},{value:"light14",tip:"${res.formatTableStyle.light}14"},{value:"light15",tip:"${res.formatTableStyle.light}15"},{value:"light16",tip:"${res.formatTableStyle.light}16"},{value:"light17",tip:"${res.formatTableStyle.light}17"},{value:"light18",tip:"${res.formatTableStyle.light}18"},{value:"light19",tip:"${res.formatTableStyle.light}19"},{value:"light20",tip:"${res.formatTableStyle.light}20"},{value:"light21",tip:"${res.formatTableStyle.light}21"}],contextMenu:[{text:"${res.formatTableStyle.apply}",commandName:p.FormatTableListContent,value:"apply"},{text:"${res.formatTableStyle.duplicate}",commandName:p.FormatTableListContent,value:"duplicate",visible:(e,t)=>{var i;return((i=t.dataset)==null?void 0:i.value)!=="light0"}},{text:"${res.formatTableStyle.setAsDefault}",commandName:p.FormatTableListContent,value:"setDefault"}]},{groupName:"${res.formatTableStyle.medium}",commandName:p.FormatTableListContent,itemRender:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[{value:"medium1",tip:"${res.formatTableStyle.medium}1"},{value:"medium2",tip:"${res.formatTableStyle.medium}2"},{value:"medium3",tip:"${res.formatTableStyle.medium}3"},{value:"medium4",tip:"${res.formatTableStyle.medium}4"},{value:"medium5",tip:"${res.formatTableStyle.medium}5"},{value:"medium6",tip:"${res.formatTableStyle.medium}6"},{value:"medium7",tip:"${res.formatTableStyle.medium}7"},{value:"medium8",tip:"${res.formatTableStyle.medium}8"},{value:"medium9",tip:"${res.formatTableStyle.medium}9"},{value:"medium10",tip:"${res.formatTableStyle.medium}10"},{value:"medium11",tip:"${res.formatTableStyle.medium}11"},{value:"medium12",tip:"${res.formatTableStyle.medium}12"},{value:"medium13",tip:"${res.formatTableStyle.medium}13"},{value:"medium14",tip:"${res.formatTableStyle.medium}14"},{value:"medium15",tip:"${res.formatTableStyle.medium}15"},{value:"medium16",tip:"${res.formatTableStyle.medium}16"},{value:"medium17",tip:"${res.formatTableStyle.medium}17"},{value:"medium18",tip:"${res.formatTableStyle.medium}18"},{value:"medium19",tip:"${res.formatTableStyle.medium}19"},{value:"medium20",tip:"${res.formatTableStyle.medium}20"},{value:"medium21",tip:"${res.formatTableStyle.medium}21"},{value:"medium22",tip:"${res.formatTableStyle.medium}22"},{value:"medium23",tip:"${res.formatTableStyle.medium}23"},{value:"medium24",tip:"${res.formatTableStyle.medium}24"},{value:"medium25",tip:"${res.formatTableStyle.medium}25"},{value:"medium26",tip:"${res.formatTableStyle.medium}26"},{value:"medium27",tip:"${res.formatTableStyle.medium}27"},{value:"medium28",tip:"${res.formatTableStyle.medium}28"}],contextMenu:[{text:"${res.formatTableStyle.apply}",commandName:p.FormatTableListContent,value:"apply"},{text:"${res.formatTableStyle.duplicate}",commandName:p.FormatTableListContent,value:"duplicate"},{text:"${res.formatTableStyle.setAsDefault}",commandName:p.FormatTableListContent,value:"setDefault"}]},{groupName:"${res.formatTableStyle.dark}",commandName:p.FormatTableListContent,itemRender:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[{value:"dark1",tip:"${res.formatTableStyle.dark}1"},{value:"dark2",tip:"${res.formatTableStyle.dark}2"},{value:"dark3",tip:"${res.formatTableStyle.dark}3"},{value:"dark4",tip:"${res.formatTableStyle.dark}4"},{value:"dark5",tip:"${res.formatTableStyle.dark}5"},{value:"dark6",tip:"${res.formatTableStyle.dark}6"},{value:"dark7",tip:"${res.formatTableStyle.dark}7"},{value:"dark8",tip:"${res.formatTableStyle.dark}8"},{value:"dark9",tip:"${res.formatTableStyle.dark}9"},{value:"dark10",tip:"${res.formatTableStyle.dark}10"},{value:"dark11",tip:"${res.formatTableStyle.dark}11"}],contextMenu:[{text:"${res.formatTableStyle.apply}",commandName:p.FormatTableListContent,value:"apply"},{text:"${res.formatTableStyle.duplicate}",commandName:p.FormatTableListContent,value:"duplicate"},{text:"${res.formatTableStyle.setAsDefault}",commandName:p.FormatTableListContent,value:"setDefault"}]}],bme=[{groupName:"${res.formatTableStyle.light}",commandName:p.FormatTableListContent,itemRender:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[{value:"light0",tip:"${res.formatTableStyle.none}"},{value:"light1",tip:"${res.formatTableStyle.light}1"},{value:"light2",tip:"${res.formatTableStyle.light}2"},{value:"light3",tip:"${res.formatTableStyle.light}3"},{value:"light4",tip:"${res.formatTableStyle.light}4"},{value:"light5",tip:"${res.formatTableStyle.light}5"},{value:"light6",tip:"${res.formatTableStyle.light}6"},{value:"light7",tip:"${res.formatTableStyle.light}7"},{value:"light8",tip:"${res.formatTableStyle.light}8"},{value:"light9",tip:"${res.formatTableStyle.light}9"},{value:"light10",tip:"${res.formatTableStyle.light}10"},{value:"light11",tip:"${res.formatTableStyle.light}11"},{value:"light12",tip:"${res.formatTableStyle.light}12"},{value:"light13",tip:"${res.formatTableStyle.light}13"},{value:"light14",tip:"${res.formatTableStyle.light}14"},{value:"light15",tip:"${res.formatTableStyle.light}15"},{value:"light16",tip:"${res.formatTableStyle.light}16"},{value:"light17",tip:"${res.formatTableStyle.light}17"},{value:"light18",tip:"${res.formatTableStyle.light}18"},{value:"light19",tip:"${res.formatTableStyle.light}19"},{value:"light20",tip:"${res.formatTableStyle.light}20"},{value:"light21",tip:"${res.formatTableStyle.light}21"}]},{groupName:"${res.formatTableStyle.medium}",commandName:p.FormatTableListContent,itemRender:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[{value:"medium1",tip:"${res.formatTableStyle.medium}1"},{value:"medium2",tip:"${res.formatTableStyle.medium}2"},{value:"medium3",tip:"${res.formatTableStyle.medium}3"},{value:"medium4",tip:"${res.formatTableStyle.medium}4"},{value:"medium5",tip:"${res.formatTableStyle.medium}5"},{value:"medium6",tip:"${res.formatTableStyle.medium}6"},{value:"medium7",tip:"${res.formatTableStyle.medium}7"},{value:"medium8",tip:"${res.formatTableStyle.medium}8"},{value:"medium9",tip:"${res.formatTableStyle.medium}9"},{value:"medium10",tip:"${res.formatTableStyle.medium}10"},{value:"medium11",tip:"${res.formatTableStyle.medium}11"},{value:"medium12",tip:"${res.formatTableStyle.medium}12"},{value:"medium13",tip:"${res.formatTableStyle.medium}13"},{value:"medium14",tip:"${res.formatTableStyle.medium}14"},{value:"medium15",tip:"${res.formatTableStyle.medium}15"},{value:"medium16",tip:"${res.formatTableStyle.medium}16"},{value:"medium17",tip:"${res.formatTableStyle.medium}17"},{value:"medium18",tip:"${res.formatTableStyle.medium}18"},{value:"medium19",tip:"${res.formatTableStyle.medium}19"},{value:"medium20",tip:"${res.formatTableStyle.medium}20"},{value:"medium21",tip:"${res.formatTableStyle.medium}21"},{value:"medium22",tip:"${res.formatTableStyle.medium}22"},{value:"medium23",tip:"${res.formatTableStyle.medium}23"},{value:"medium24",tip:"${res.formatTableStyle.medium}24"},{value:"medium25",tip:"${res.formatTableStyle.medium}25"},{value:"medium26",tip:"${res.formatTableStyle.medium}26"},{value:"medium27",tip:"${res.formatTableStyle.medium}27"},{value:"medium28",tip:"${res.formatTableStyle.medium}28"}]},{groupName:"${res.formatTableStyle.dark}",commandName:p.FormatTableListContent,itemRender:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[{value:"dark1",tip:"${res.formatTableStyle.dark}1"},{value:"dark2",tip:"${res.formatTableStyle.dark}2"},{value:"dark3",tip:"${res.formatTableStyle.dark}3"},{value:"dark4",tip:"${res.formatTableStyle.dark}4"},{value:"dark5",tip:"${res.formatTableStyle.dark}5"},{value:"dark6",tip:"${res.formatTableStyle.dark}6"},{value:"dark7",tip:"${res.formatTableStyle.dark}7"},{value:"dark8",tip:"${res.formatTableStyle.dark}8"},{value:"dark9",tip:"${res.formatTableStyle.dark}9"},{value:"dark10",tip:"${res.formatTableStyle.dark}10"},{value:"dark11",tip:"${res.formatTableStyle.dark}11"}]},{groupName:"${res.formatTableStyle.professional}",commandName:p.FormatTableListContent,itemRender:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[{value:"professional1",tip:"${res.formatTableStyle.professional}1"},{value:"professional2",tip:"${res.formatTableStyle.professional}2"},{value:"professional3",tip:"${res.formatTableStyle.professional}3"},{value:"professional4",tip:"${res.formatTableStyle.professional}4"},{value:"professional5",tip:"${res.formatTableStyle.professional}5"},{value:"professional6",tip:"${res.formatTableStyle.professional}6"},{value:"professional7",tip:"${res.formatTableStyle.professional}7"},{value:"professional8",tip:"${res.formatTableStyle.professional}8"},{value:"professional9",tip:"${res.formatTableStyle.professional}9"},{value:"professional10",tip:"${res.formatTableStyle.professional}10"},{value:"professional11",tip:"${res.formatTableStyle.professional}11"},{value:"professional12",tip:"${res.formatTableStyle.professional}12"},{value:"professional13",tip:"${res.formatTableStyle.professional}13"},{value:"professional14",tip:"${res.formatTableStyle.professional}14"},{value:"professional15",tip:"${res.formatTableStyle.professional}15"},{value:"professional16",tip:"${res.formatTableStyle.professional}16"},{value:"professional17",tip:"${res.formatTableStyle.professional}17"},{value:"professional18",tip:"${res.formatTableStyle.professional}18"},{value:"professional19",tip:"${res.formatTableStyle.professional}19"},{value:"professional20",tip:"${res.formatTableStyle.professional}20"},{value:"professional21",tip:"${res.formatTableStyle.professional}21"},{value:"professional22",tip:"${res.formatTableStyle.professional}22"},{value:"professional23",tip:"${res.formatTableStyle.professional}23"},{value:"professional24",tip:"${res.formatTableStyle.professional}24"}]}];async function B0(e,t){let i=e.Spread;if(t)return e.setData(m.TableHasStyle,t!=="light0"),O0(i,t)}async function Sme(e,t){let i=e.Spread;t&&(i.customTableThemes.remove(t),delete th[t.trim().toLowerCase()],e.setData(re.tableStyleKey,e.Spread.customTableThemes.all()))}async function LO(e,t,i){let n=e.Spread;if(t){const a=Tm(e),r=i?a==null?void 0:a.style():n.customTableThemes.get(t);if(!r)return;const o=r.name(),l={data:{styleName:o,customTableStyle:r.toJSON()}},c=E0(s.formatTableStyle.modifyStyleDialogTitle),d=await e._showDialog(c,l,(u,h)=>yO(u,o,h));if(d&&d.data){const u=d.data.customTableStyle;a&&i?O0(n,u):(e.Spread.customTableThemes.update(o,u),e.setData(re.tableStyleKey,e.Spread.customTableThemes.all()))}}}async function Cme(e,t){let i=e.Spread;t&&i.defaultTableTheme(t)}async function yme(e,t){var n;let i=e.Spread;if(t){let a=Tt[t];if(a||(a=(n=i.customTableThemes.get(t))!=null?n:new GC.Spread.Sheets.Tables.TableTheme),a=vme(i,a),a){const r={data:{styleName:a.name(),customTableStyle:a.toJSON()}},o=E0(s.formatTableStyle.modifyStyleDialogTitle),l=await e._showDialog(o,r,N0),c=l==null?void 0:l.data.customTableStyle;c&&(i.customTableThemes.add(c),e.setData(re.tableStyleKey,i.customTableThemes.all()))}}}function vme(e,t){const i=new GC.Spread.Sheets.Tables.TableTheme;i.fromJSON(JSON.parse(JSON.stringify(t.toJSON())));let n=2,a=i.name()+" ",r=a+n;for(;e.customTableThemes.get(r);)r=a+ ++n;return i.name(r),i}function TO(e,t){Tme(e,t),Lme(e,t),xme(e,t)}function xme(e,t){var r;let i=Tm(e),n=((r=i==null?void 0:i.getStyleName())==null?void 0:r.toLowerCase())||"",a=!1;t.forEach(o=>{o.groupItems&&o.groupItems.forEach(l=>{if(l.value){const c=n&&(l.value===th[n]||l.value===n),d=!n&&i&&l.contextMenuOnly;l.selected=!!(c||d)&&!a,l.selected&&(a=!0)}})})}function Lme(e,t){Tm(e)?t[1].groupItems&&(t[1].groupItems[0].visible=!0):t[1].groupItems&&(t[1].groupItems[0].visible=!1)}function Tm(e){let t=e.Spread,i=C.getActiveSheet(t);if(!i)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex();return i.tables.find(n,a)}function Tme(e,t){var r;let i=e.Spread.customTableThemes.all()||[];e.setData(re.tableStyleKey,i);let n=t[0];n.groupItems=[],th={},i.forEach((o,l)=>{const c=o.name();n.groupItems&&n.groupItems.push({itemRender:wl,value:c,tip:c,selectedClassName:"gc-list-control-selected-item-border"}),th[c.toLowerCase()]=c});let a=Tm(e);if(a&&!a.getStyleName()){const o=a.style();if(o){const l=(r=o.name())!=null?r:"";n.groupItems&&n.groupItems.push({itemRender:wl,value:l,tip:l,selectedClassName:"gc-list-control-selected-item-border",contextMenu:[{text:"${res.formatTableStyle.modify}",commandName:p.FormatTableListContent,value:"modifyObject"}],contextMenuOnly:!0})}}n.visible=n.groupItems.length>0}let wme=C.CloneJsonObj(xO),Dme={title:"${res.ribbon.home.formatTableTitle}",text:"${res.ribbon.home.formatTableText}",iconClass:"ribbon-button-formattable",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.FormatTable2,dropdownListItemType:"menuitemradio",direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")',visibleContext:`!${m.ReportSheetActive} && !${m.IsInParameterPanelDesignMode}`,enableContext:`${m.AllowFormatCells} && !${m.PivotTableSelected} && !${m.IsInTableSheetDesignMode} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`},Ame={title:"${res.ribbon.home.styleList}",text:"${res.ribbon.home.styleList}",iconClass:"ribbon-button-formattable",commandName:p.FormatTableListContent,type:"listContent",dropdownListItemType:"menuitemradio",maxWidth:510,enableContext:`${m.AllowFormatCells} && !${m.PivotTableSelected}`,execute:async(e,t,i)=>{if(t===eh.C_Modify)await LO(e,i);else if(t===eh.C_Modify_Object)await LO(e,i,!0);else if(t===eh.C_Delete)await Sme(e,i);else if(t===eh.C_Set_Default)await Cme(e,i);else if(t===eh.C_Duplicate)await yme(e,i);else{if(await B0(e,i)===!1)return;e.setData(m.TableSelected,!0),e.setData(m.TableClicked,!0),e.setData(m.TableAllowResize,!0),e.activeRibbonTab("tableDesign")}},getState:e=>()=>{const t=C.CloneJsonObj(wme);return TO(e,t),t}},Pme=C.CloneJsonObj(bme),Ime={title:"${res.ribbon.tableSheetDesign.format}",text:"${res.ribbon.tableSheetDesign.format}",iconClass:"ribbon-button-format-table-sheet",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.FormatTableSheet,enableContext:`!${m.IsInTableSheetDesignMode}`,direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")'},Mme={title:"${res.ribbon.tableSheetDesign.styles}",text:"${res.ribbon.tableSheetDesign.styles}",commandName:p.FormatTableSheetListContent,type:"listContent",dropdownListItemType:"menuitemradio",maxWidth:510,execute:async(e,t,i)=>{await B0(e,i)},getState:e=>{const t=C.CloneJsonObj(Pme);return t[0].groupItems[0].visible=!1,t},init:e=>{rse(e.Spread,"changeTableSheetTheme")}};const kme=Object.freeze(Object.defineProperty({__proto__:null,FormatTable:Dme,FormatTableListContent:Ame,FormatTableSheet:Ime,FormatTableSheetListContent:Mme},Symbol.toStringTag,{value:"Module"}));function Rme(e){e.commandManager().execute({cmd:"cutFloatingObjects",sheetName:C.getActiveSheet(e).name()})}function _me(e,t){let i="Designer."+t;e.commandManager().register(i,wO,void 0,!1,!1,!1,!1)}function Ome(e,t){oe.runCommand(e,"cut",wO,{callback:t})}let wO={canUndo:!1,execute:function(e,t,i){return new Eme(e,t).execute(e,t,i)}};class Eme extends oe.DesignerActionBase{executeImp(t,i,n){let a=t,r=i.sheetName,o={};o.cmd="cut",o.sheetName=r,o.ignoreClipboard=!0,o.callback=function(){i.callback(o.cutData.copyText,o.cutData.copyHtml)},a.commandManager().execute(o)}}class wm{static getSelectedPicture(t){let i=t.pictures.all(),n=[];for(let a=0;a<i.length;a++){let r=i[a];r.isSelected()&&n.push(r)}return n}static isSelectedPicture(t){return!(!t||wm.getSelectedPicture(t).length===0)}}let DO={title:"${res.ribbon.home.cut}",iconClass:"ribbon-button-cut",commandName:p.RibbonCut,text:'=IF(inDropdown, "${res.ribbon.home.cut}", "")',enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode}`,execute:e=>{Nme(e)}};function Nme(e){let t=e.Spread,i=C.getActiveSheet(t);ut.getActiveAllShapes(i).length>0?t.commandManager().execute({cmd:"cutShapes",sheetName:C.getActiveSheet(t).name()}):vi.isSlicerSelected(i)||wm.isSelectedPicture(i)||pe.getActiveChart(t)?Rme(t):Ome(t,function(a,r){C.clipboard.copyText=a,C.clipboard.copyHtml=r})}const Bme=Object.freeze(Object.defineProperty({__proto__:null,Cut:DO},Symbol.toStringTag,{value:"Module"}));function Fme(e){e.commandManager().execute({cmd:"copyFloatingObjects",sheetName:C.getActiveSheet(e).name()})}function Gme(e,t){let i="Designer."+t;e.commandManager().register(i,PO,void 0,!1,!1,!1,!1)}function AO(e,t){oe.runCommand(e,"copy",PO,{callback:t})}class Vme extends oe.DesignerActionBase{executeImp(t,i,n){let a=t,r=i.sheetName,o={};o.cmd="copy",o.sheetName=r,o.ignoreClipboard=!0,o.callback=function(){i.callback(o.copyData.copyText,o.copyData.copyHtml)},a.commandManager().execute(o)}}let PO={canUndo:!1,execute:function(e,t,i){return new Vme(e,t).execute(e,t,i)}},IO={title:"${res.ribbon.home.copy}",iconClass:"ribbon-button-copy",commandName:p.RibbonCopy,text:'=IF(inDropdown, "${res.ribbon.home.copy}", "")',enableContext:`!${m.IsInTableSheetDesignMode}`,viewModeEnableContext:"true",metaData:{viewModePermissions:XA},execute:e=>{Hme(e)}};function Hme(e){let t=e.Spread,i=C.getActiveSheet(t);ut.getActiveAllShapes(i).length>0?t.commandManager().execute({cmd:"copyShapes",sheetName:C.getActiveSheet(t).name()}):vi.isSlicerSelected(i)||wm.isSelectedPicture(i)||pe.getActiveChart(t)?Fme(t):AO(t,function(a,r){C.clipboard.copyText=a,C.clipboard.copyHtml=r})}const zme=Object.freeze(Object.defineProperty({__proto__:null,Copy:IO},Symbol.toStringTag,{value:"Module"})),Co=".formatPinter";var MO=(e=>(e[e.unable=0]="unable",e[e.enable=1]="enable",e[e.remain=2]="remain",e[e.done=3]="done",e))(MO||{});let $b;class jme extends oe.DesignerActionBase{executeImp(t,i,n){let a=t.getActiveSheet();if(vi.isSlicerSelected(a)||wm.isSelectedPicture(a)||pe.getActiveChart(t)||ut.getActiveAllShapes(a).length>0)return;let r=!0;return t.bind(GC.Spread.Sheets.Events.InvalidOperation+Co,function(){eS(t,i.getFPState,i.setFPState),r=!1}),AO(t,()=>{}),r&&(t.bind(GC.Spread.Sheets.Events.SelectionChanged+Co,()=>{NO(t,i.getFPState,i.setFPState)}),t.bind(GC.Spread.Sheets.Events.CellChanged+Co,()=>{Dm(t,i.getFPState,i.setFPState)})),r}}class Wme extends oe.DesignerActionBase{executeImp(t,i,n){clearTimeout($b),t.unbind(GC.Spread.Sheets.Events.SelectionChanged+Co);let a=C.getActiveSheet(t);return t.bind("PasteEnd"+Co,()=>{t.unbind("PasteEnd"+Co),t.unbind(GC.Spread.Sheets.Events.InvalidOperation+Co),t.bind(GC.Spread.Sheets.Events.SelectionChanged+Co,()=>{NO(t,i.getFPState,i.setFPState)})}),t.bind(GC.Spread.Sheets.Events.ClipboardPasted+Co,(r,o)=>{t.unbind(GC.Spread.Sheets.Events.ClipboardPasted+Co);let{row:l,col:c,rowCount:d,colCount:u}=o.fromRange;!o.cellRange.equals(o.fromRange)&&o.cellRange.intersect(l,c,d,u)&&Dm(t,i.getFPState,i.setFPState)}),t.bind(GC.Spread.Sheets.Events.InvalidOperation+Co,function(){eS(t,i.getFPState,i.setFPState)}),t.commandManager().execute({cmd:"paste",sheetName:a.name(),isFromDesigner:!0,pasteOption:GC.Spread.Sheets.ClipboardPasteOptions.formatting}),!0}removeSpan(t,i){for(let n=0;n<i.length;n++){let a=i[n],r=a.row===-1?0:a.row,o=a.col===-1?0:a.col;for(let l=0;l<a.rowCount;l++)for(let c=0;c<a.colCount;c++)t.getActiveSheet().removeSpan(r+l,o+c)}}}class Zme extends oe.DesignerActionBase{executeImp(t,i,n){let a=C.getActiveSheet(t);return t.unbind(Co),(!a.isEditing||!a.isEditing())&&($b=setTimeout(()=>{t.commandManager().execute({cmd:"cancelInput",sheetName:a&&a.name(),isFromDesigner:!0}),clearTimeout($b)},200)),!0}}let kO={canUndo:!1,execute:(e,t,i)=>{let a=new jme(e,{}).execute(e,t,!1);return a&&t.getFPState()!==2?t.setFPState(1):clearTimeout($b),a}},RO={canUndo:!1,execute:(e,t,i)=>{let n=t.getFPState(),a=!0;return n!==0&&(a=new Wme(e,{}).execute(e,t,!1),n===1&&(t.setFPState(3),Dm(e,t.getFPState,t.setFPState))),a}},_O={canUndo:!1,execute:(e,t,i)=>{let a=new Zme(e,{}).execute(e,{},!1);return t.setFPState(0),a}};function eS(e,t,i){t()!==0&&Dm(e,t,i)}function OO(e,t,i){let n=e.commandManager();n.register("Designer.formatPainterStart",kO,void 0,!1,!1,!1,!1),n.register("Designer.formatPainterExecute",RO,void 0,!1,!1,!1,!1),n.register("Designer.formatPainterCancel",_O,void 0,!1,!1,!1,!1),e.commandManager().register("cancelFormatPainterESC",a=>{eS(a,t,i)},27,!1,!1,!1,!1),e.commandManager().register("cancelFormatPainterCtrlZ",a=>{eS(a,t,i)},90,!0,!1,!1,!1)}function EO(e,t,i){oe.runCommand(e,"formatPainterStart",kO,{getFPState:t,setFPState:i})}function NO(e,t,i){oe.runCommand(e,"formatPainterExecute",RO,{getFPState:t,setFPState:i})}function Dm(e,t,i){oe.runCommand(e,"formatPainterCancel",_O,{getFPState:t,setFPState:i})}const Ume="dbclick",F0=e=>()=>e.getData(m.FormatPainter),G0=e=>t=>{e.setData(m.FormatPainter,t)};let Jme={title:"${res.ribbon.home.formatPainter}",iconClass:"ribbon-button-formatPainter",commandName:p.RibbonFormatPainter,type:"dbclickCheckbox",enableContext:`(!${m.IsIncludeLockedCell} || ${m.AllowFormatCells}) && !${m.IsInTableSheetDesignMode} && !${m.ChartSelected}`,visiblePriority:5,text:'=IF(inDropdown, "${res.ribbon.home.formatPainter}", "")',execute:(e,t,i)=>{const n=F0(e),a=G0(e);t===Ume?(a(MO.remain),EO(e.Spread,n,a)):n()?Dm(e.Spread,n,a):EO(e.Spread,n,a)},getState:e=>{const t=F0(e),i=G0(e);return e.Spread.commandManager().getCommand("cancelFormatPainterESC")===void 0&&OO(e.Spread,t,i),!!e.getData(m.FormatPainter)},init:e=>{const t=F0(e),i=G0(e);OO(e.Spread,t,i)}};const Yme=Object.freeze(Object.defineProperty({__proto__:null,FormatPainter:Jme},Symbol.toStringTag,{value:"Module"}));let qme={title:"${res.ribbon.home.paste}",text:'=IF(inDropdown,"${res.ribbon.home.paste}","")',direction:'=IF(ribbonHeight>toolbarHeight, "vertical", "horizontal")',iconClass:"ribbon-button-paste",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.Paste,enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode}`};const Kme=Object.freeze(Object.defineProperty({__proto__:null,Paste:qme},Symbol.toStringTag,{value:"Module"}));function Qme(e,t){let i="Designer."+t;e.commandManager().register(i,BO,void 0,!1,!1,!1,!1)}function ih(e,t,i,n,a){oe.runCommand(e,"paste",BO,{pasteOptions:t,pasteSpecialOptions:a,text:i,html:n,isFromDesigner:!0})}let BO={canUndo:!1,execute:function(e,t,i){let n=C.getSheetOrSheetTabByName(e,t.sheetName);if(n.isPasteFloatingObject())return e.commandManager().execute({cmd:"pasteFloatingObjects",sheetName:n.name()});if(n.isPasteShapes&&n.isPasteShapes())return e.commandManager().execute({cmd:"pasteShapes",sheetName:n.name()});{let a=t.text,r=t.html;return e.commandManager().execute({cmd:"paste",sheetName:n.name(),pasteText:a,pasteHtml:r,pasteOption:t.pasteOptions,pasteSpecialOptions:t.pasteSpecialOptions,isFromDesigner:t.isFromDesigner})}}};var Dd=(e=>(e.All="paste-all",e.Formulas="paste-formulas",e.Values="paste-values",e.Formatting="paste-formatting",e.ValuesAndFormatting="paste-valuesAndFormatting",e.FormulasAndFormatting="paste-formulasAndFormatting",e))(Dd||{});function nh(e,t){switch(t){case"paste-all":ih(e.Spread,GC.Spread.Sheets.ClipboardPasteOptions.all);break;case"paste-formatting":ih(e.Spread,GC.Spread.Sheets.ClipboardPasteOptions.formatting);break;case"paste-formulas":ih(e.Spread,GC.Spread.Sheets.ClipboardPasteOptions.formulas);break;case"paste-formulasAndFormatting":ih(e.Spread,GC.Spread.Sheets.ClipboardPasteOptions.formulasAndFormatting);break;case"paste-values":ih(e.Spread,GC.Spread.Sheets.ClipboardPasteOptions.values);break;case"paste-valuesAndFormatting":ih(e.Spread,GC.Spread.Sheets.ClipboardPasteOptions.valuesAndFormatting);break}e.setData(re.isFileModified,!0)}let FO={text:'=IF(OR(inDropdown,isToolbarMode), IF(AND(inDropdown, NOT(isToolbarMode)), "", "${res.ribbon.home.all}"),"${res.ribbon.home.paste}")',title:"${res.ribbon.home.pasteAll}",tip:"${res.ribbon.home.pasteAll}",direction:'=IF(ribbonHeight>toolbarHeight, "vertical", "horizontal")',iconClass:"ribbon-button-paste",bigButton:"=AND(ribbonHeight>toolbarHeight,NOT(inDropdown))",commandName:p.PasteAll,enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode}`,dropdownMaxWidth:165,execute:(e,t)=>{nh(e,Dd.All)}};const Xme=Object.freeze(Object.defineProperty({__proto__:null,PasteAll:FO},Symbol.toStringTag,{value:"Module"}));let GO={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.ribbon.home.formulas}")',tip:"${res.ribbon.home.pasteFormulas}",commandName:p.PasteFormulas,iconClass:"ribbon-button-paste-formula",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && !${m.ClipboardCutting}`,execute:(e,t)=>{nh(e,Dd.Formulas)}};const $me=Object.freeze(Object.defineProperty({__proto__:null,PasteFormula:GO},Symbol.toStringTag,{value:"Module"}));let VO={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.ribbon.home.values}")',tip:"${res.ribbon.home.pasteValues}",commandName:p.PasteValues,enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && !${m.ClipboardCutting}`,execute:(e,t)=>{nh(e,Dd.Values)},iconClass:"ribbon-button-paste-values"};const ege=Object.freeze(Object.defineProperty({__proto__:null,PasteValue:VO},Symbol.toStringTag,{value:"Module"}));let HO={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.ribbon.home.formatting}")',tip:"${res.ribbon.home.pasteFormatting}",commandName:p.PasteFormatting,enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && !${m.ClipboardCutting}`,execute:(e,t)=>{nh(e,Dd.Formatting)},iconClass:"ribbon-button-formatting"};const tge=Object.freeze(Object.defineProperty({__proto__:null,PasteFormatting:HO},Symbol.toStringTag,{value:"Module"}));let zO={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.ribbon.home.valuesAndFormatting}")',tip:"${res.ribbon.home.pasteValuesAndFormatting}",commandName:p.ValuesAndFormatting,enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && !${m.ClipboardCutting}`,execute:(e,t)=>{nh(e,Dd.ValuesAndFormatting)},iconClass:"ribbon-button-paste-value-formatting"};const ige=Object.freeze(Object.defineProperty({__proto__:null,PasteValueAndFormatting:zO},Symbol.toStringTag,{value:"Module"}));let jO={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.ribbon.home.formulasAndFormatting}")',tip:"${res.ribbon.home.pasteFormulasAndFormatting}",commandName:p.FormulasAndFormatting,enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && !${m.ClipboardCutting}`,execute:(e,t)=>{nh(e,Dd.FormulasAndFormatting)},iconClass:"ribbon-button-paste-formula-formatting"};const nge=Object.freeze(Object.defineProperty({__proto__:null,PasteFormulasAndFormatting:jO},Symbol.toStringTag,{value:"Module"}));class Ia extends oe.DesignerActionBase{undoImp(t,i,n){t.suspendPaint();try{GC.Spread.Sheets.Commands.undoTransaction(t,i)}finally{t.resumePaint()}return!0}isSendEvent(t,i,n){return!0}changeSelectionInCommandExecuting(t,i,n){let a=i.selectedShape;n!=null&&(a=n);let r=a&&a[0];if(r){let o=r.startRow&&r.startRow(),l=r.startColumn&&r.startColumn();t.changeSelectionInCommandExecuting(i,o,l,null,a)}}}function age(e,t){let i="Designer."+t;e.commandManager().register(i,ZO,void 0,!1,!1,!1,!1)}function rge(e,t,i,n,a,r){return oe.runCommand(e,"insertShape",ZO,{PosX:t,PosY:i,width:n,height:a,shapeInfo:r})}function oge(e,t){let i="Designer."+t;e.commandManager().register(i,UO,void 0,!1,!1,!1,!1)}function WO(e,t,i,n){if(GC.Spread.Sheets.Shapes)return oe.runCommand(e,"insertCameraShape",UO,{range:t,PosX:i,PosY:n})}function lge(e,t){let i="Designer."+t;e.commandManager().register(i,JO,void 0,!1,!1,!1,!1)}function sge(e,t){if(GC.Spread.Sheets.Shapes)return oe.runCommand(e,"insertFormControlShape",JO,t)}let ZO={canUndo:!0,execute:function(e,t,i){return new cge(e,t).execute(e,t,i)}};class cge extends Ia{executeImp(t,i,n){let r=this.sheet();if(!r)return!1;let{type:o,isConnectorType:l,style:c,isTextBox:d}=i.shapeInfo,u=i.PosX,h=i.PosY,g=i.width,f=i.height;if(l){let b=r.shapes.addConnector("",o,u,h,u+g,h+f),S=b.style();i.shapeInfo.beginArrowhead!==void 0&&(S.line.beginArrowheadStyle=i.shapeInfo.beginArrowhead.style,S.line.beginArrowheadWidth=i.shapeInfo.beginArrowhead.width,S.line.beginArrowheadLength=i.shapeInfo.beginArrowhead.length,b.style(S)),i.shapeInfo.endArrowhead!==void 0&&(S.line.endArrowheadStyle=i.shapeInfo.endArrowhead.style,S.line.endArrowheadWidth=i.shapeInfo.endArrowhead.width,S.line.endArrowheadLength=i.shapeInfo.endArrowhead.length,b.style(S)),r.shapes.all().forEach(y=>y.isSelected(!1)),b.isSelected(!0)}else{let b=r.shapes.add("",o,u,h,g,f);c&&b.style(c),C.isNullOrUndefined(d)||b.isTextBox(d),r.shapes.all().forEach(S=>S.isSelected(!1)),b.isSelected(!0)}return!0}}let UO={canUndo:!0,execute:function(e,t,i){return new dge(e,t).execute(e,t,i)}};class dge extends Ia{executeImp(t,i,n){let r=this.sheet();if(!r)return!1;if(i.selections&&i.selections[0]){let o=i.selections[0];if(o.col<0||o.row<0||o.rowCount<0||o.colCount<0)return s.createCameraShapeDialog.warningText}if(i.range)return r.shapes.addCameraShape("",i.range,i.PosX,i.PosY),!0}}let JO={canUndo:!0,execute:function(e,t,i){return new uge(e,t).execute(e,t,i)}};class uge extends Ia{executeImp(t,i,n){let r=this.sheet();if(!r)return!1;let{type:o,x:l,y:c,width:d,height:u,text:h}=i,g=r.shapes.addFormControl("",o,l,c,d,u);return h&&g.text(h),!0}}const hge=e=>e;let pge=function(){return{templateName:G.InsertCameraShapeDialogTemplate,title:s.createCameraShapeDialog.createCameraShape,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px -4px",text:s.createCameraShapeDialog.whereYourCameraShape},{type:"RangeSelect",title:s.createCameraShapeDialog.createCameraShape,absoluteReference:!0,needSheetName:!1,margin:"5px -5px",bindingPath:hge("range")}]}]}};const mge=(e,t,i)=>{var a;let n=i;if(n){const r=GC.Spread.Sheets.CalcEngine.formulaToRanges,o=r(t,i),l=(o==null?void 0:o.length)===1&&((a=o[0].ranges)==null?void 0:a.length)===1&&o[0].ranges[0];if(l&&l.colCount===1&&l.rowCount===1){const c=o[0].sheetName,d=c?e==null?void 0:e.getSheetFromName(c):t,u=d==null?void 0:d.getSpan(l.row,l.col);if(u){const h=GC.Spread.Sheets.CalcEngine.rangeToFormula;n=`${c}!${h(u)}`}}}return n};_e(G.InsertCameraShapeDialogTemplate,pge);let gge={title:"${res.ribbon.shapeDesign.insertCamera}",text:"${res.ribbon.insert.cameraShape}",iconClass:"ribbon-button-camera-shape",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.InsertCameraShape,enableContext:`${m.AllowInsertShape} && ${m.AllowEditObject}`,visibleContext:`!${m.ReportSheetActive}`,execute:async(e,t)=>{let i=V0(e.Spread),n=await e._showDialog(G.InsertCameraShapeDialogTemplate,i);if(n!=null){let a=n.range;if(!a)return;let r=C.getActiveSheet(e.Spread);if(!r)return;a=mge(e.Spread,r,a);let o=ut.getFormulaRangeSize(r.getParent(),r,a),l=ut.getShapePosition(r,o&&o.width,o&&o.height),c=WO(e.Spread,a,l.x,l.y);if(typeof c=="string")return await e._showMessageBox(c,s.title,Re.warning),!1;e.setData(re.isFileModified,!0)}},init:e=>{oge(e.Spread,"insertCameraShape")}};function V0(e,t,i){let n=i||C.getActiveSheet(e);if(!n)return;let a=e.options.referenceStyle===1,r=t||n.getSelections()[0];return r?{range:Ht.parseRangeToExpString(r,!0,n.getActiveRowIndex(),n.getActiveColumnIndex(),a)}:void 0}const fge=Object.freeze(Object.defineProperty({__proto__:null,InsertCameraShapeButton:gge,getCameraShapeOption:V0},Symbol.toStringTag,{value:"Module"}));function bge(e,t,i){e.commandManager().register(i,t,void 0,!1,!1,!1,!1)}const H0="gc.spread.designer.LinkedPicture";function Sge(e){bge(e,{canUndo:!1,execute:function(i,n,a){var h;let r=i.getActiveSheet();if(!r)return;let o=r.getClipboardHelperObj().ranges,l=r.getClipboardHelperObj().fromSheet,c=(h=V0(i,o[0],l))==null?void 0:h.range;if(!c)return;r!==l&&(c=Ae.getSheetNameForFormula(l)+"!"+c);let d=ut.getFormulaRangeSize(r.getParent(),r,c),u=ut.getShapePosition(r,d&&d.width,d&&d.height);WO(i,c,u.x,u.y)}},H0)}const Cge=C.getActiveSheet,er=e=>"gc.spread.designer."+e,Ad=e=>"gc-spread-designer-pasteSpecial-icon-"+e,fc=er("pasteSpecialPasteGroup"),tS=er("pasteSpecialPasteValueGroup"),iS=er("pasteSpecialOtherOptionsGroup"),Xo="gc.spread.contextMenu.",Za={pasteFormulaAndNumberFormat:Xo+"pasteFormulaAndNumberFormat",pasteKeepSourceFormatting:Xo+"pasteKeepSourceFormatting",pasteNoBorders:Xo+"pasteNoBorders",pasteColumnWidth:Xo+"pasteColumnWidth",pasteTranspose:Xo+"pasteTranspose",pasteValueAndNumberFormats:Xo+"pasteValueAndNumberFormats",pasteValueAndSourceFormats:Xo+"pasteValueAndSourceFormats",pasteLink:Xo+"pasteLink"};let yge={text:"${res.pasteSpecial.title}",commandName:p.ContextMenuPasteSpecial,visibleContext:`${m.AllowPasteSpecial} && (!${m.PivotTableSelected} && ${m.ClickViewport} || ${m.ClickCorner} || ${m.ClickColHeader} || ${m.ClickRowHeader})`,type:"splitSubMenu",subMenu:vge(),execute:e=>{let t=e.Spread,i=Cge(t);t.commandManager().execute({cmd:"openPasteSpecialDialog",sheetName:i.name()})},init:e=>{Sge(e.Spread)}};function vge(){return[{text:s.pasteSpecial.paste,name:fc,type:"groupHeader"},{command:Xo+"pasteAll",name:er("pasteAll"),iconClass:"gc-spread-pasteAll",group:fc,text:s.pasteSpecial.paste},{command:Xo+"pasteFormula",name:er("pasteFormula"),iconClass:"gc-spread-pasteFormula",group:fc,text:s.pasteSpecial.formula},{command:Za.pasteFormulaAndNumberFormat,name:er("formulaAndNumberFormats"),iconClass:"gc-spread-pasteFormulaFormatting",group:fc,text:s.pasteSpecial.formulaAndNumberFormat},{command:Za.pasteKeepSourceFormatting,name:er("keepSourceFormatting"),iconClass:Ad("keepSourceFormat"),group:fc,text:s.pasteSpecial.keepSourceFormat},{command:Za.pasteNoBorders,name:er("noBorders"),iconClass:Ad("noBorders"),group:fc,text:s.pasteSpecial.noBorders},{command:Za.pasteColumnWidth,name:er("keepSourceColumnWidth"),iconClass:Ad("columnWidth"),group:fc,text:s.pasteSpecial.columnWidth},{command:Za.pasteTranspose,name:er("Transpose"),iconClass:Ad("transpose"),group:fc,text:s.pasteSpecial.transpose},{text:s.pasteSpecial.pasteValue,name:tS,type:"groupHeader"},{command:"gc.spread.contextMenu.pasteValues",name:er("PasteValue"),iconClass:"gc-spread-pasteValues",group:tS,text:s.pasteSpecial.values},{command:Za.pasteValueAndNumberFormats,name:er("PasteValue&NumberFormat"),iconClass:"gc-spread-pasteValuesFormatting",group:tS,text:s.pasteSpecial.valuesAndNumberFormat},{command:Za.pasteValueAndSourceFormats,name:er("PasteValue&SourceFormat"),iconClass:Ad("valueAndSourceFormats"),group:tS,text:s.pasteSpecial.valueAndSourceFormat},{text:s.pasteSpecial.otherPasteOptions,name:iS,type:"groupHeader"},{command:Xo+"pasteFormatting",name:er("PasteFormatting"),iconClass:"gc-spread-pasteValuesFormatting",group:iS,text:s.pasteSpecial.formatting},{command:Za.pasteLink,name:er("PasteLink"),iconClass:Ad("pasteLink"),group:iS,text:s.pasteSpecial.pasteLink},{command:H0,name:er("PasteLinkedPicture"),iconClass:Ad("linkedPicture"),group:iS,text:s.pasteSpecial.linkedPicture},{type:"separator"},{command:"openPasteSpecialDialog",name:"pasteSpecial",text:s.pasteSpecial.title}]}const xge=Object.freeze(Object.defineProperty({__proto__:null,PASTE_SPECIAL_COMMANDS:Za,ctx_PASTE_SPECIAL:yge},Symbol.toStringTag,{value:"Module"}));function Dl(e,t){e.commandManager().execute({cmd:t,sheetName:C.getActiveSheet(e).name()})}let Lge={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.formulaAndNumberFormat}")',tip:"${res.pasteSpecial.formulaAndNumberFormat}",commandName:p.PasteFormulaAndNumberFormat,iconClass:"ribbon-button-paste-formula-numberFormat",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteFormulaAndNumberFormat)}},Tge={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.keepSourceFormat}")',tip:"${res.pasteSpecial.keepSourceFormat}",commandName:p.PasteKeepSourceFormatting,iconClass:"ribbon-button-paste-source-format",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteKeepSourceFormatting)}},wge={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.noBorders}")',tip:"${res.pasteSpecial.noBorders}",commandName:p.PasteNoBorders,iconClass:"ribbon-button-paste-noBorders",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteNoBorders)}},Dge={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.columnWidth}")',tip:"${res.pasteSpecial.columnWidth}",commandName:p.PasteColumnWidth,iconClass:"ribbon-button-paste-column-width",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteColumnWidth)}},Age={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.transpose}")',tip:"${res.pasteSpecial.transpose}",commandName:p.PasteTranspose,iconClass:"ribbon-button-paste-transpose",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteTranspose)}},Pge={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.valuesAndNumberFormat}")',tip:"${res.pasteSpecial.valuesAndNumberFormat}",commandName:p.PasteValueAndNumberFormat,iconClass:"ribbon-button-paste-value-numberFormat",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteValueAndNumberFormats)}},Ige={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.valueAndSourceFormat}")',tip:"${res.pasteSpecial.valueAndSourceFormat}",commandName:p.PasteValueAndSourceFormat,iconClass:"ribbon-button-paste-values-source-format",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteValueAndSourceFormats)}},Mge={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.pasteLink}")',tip:"${res.pasteSpecial.pasteLink}",commandName:p.PasteLink,iconClass:"ribbon-button-paste-link",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteLink)}},kge={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.linkedPicture}")',tip:"${res.pasteSpecial.linkedPicture}",commandName:p.PasteLinkedPicture,iconClass:"ribbon-button-paste-linked-picture",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,H0)}},Rge={text:"${res.pasteSpecial.title}",commandName:p.OpenPasteSpecialDialog,enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,"openPasteSpecialDialog")}};const _ge=Object.freeze(Object.defineProperty({__proto__:null,OpenPasteSpecialDialog:Rge,PasteColumnWidth:Dge,PasteFormulaAndNumberFormat:Lge,PasteKeepSourceFormatting:Tge,PasteLink:Mge,PasteLinkedPicture:kge,PasteNoBorders:wge,PasteTranspose:Age,PasteValueAndNumberFormat:Pge,PasteValueAndSourceFormat:Ige},Symbol.toStringTag,{value:"Module"}));let Oge={title:"${res.ribbon.home.insert}",text:"${res.ribbon.home.insert}",iconClass:"ribbon-button-insert",bigButton:"=ribbonHeight>toolbarHeight",direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")',commandName:p.CellsInsert,enableContext:`!${m.IsInTableSheetDesignMode}`};const Ege=Object.freeze(Object.defineProperty({__proto__:null,CellsInsert:Oge},Symbol.toStringTag,{value:"Module"}));class bc extends oe.DesignerActionBase{canDoInsertOrDeleteRow(){return!0}canDoInsertOrDeleteColumn(){return!0}getSortedRowSelections(){let t=this.sheet().getSelections();for(let i=0;i<t.length-1;i++)for(let n=i+1;n<t.length;n++)if(t[i].row<t[n].row){let a=t[i];t[i]=t[n],t[n]=a}return t}getSortedColumnSelections(){let t=this.sheet().getSelections();for(let i=0;i<t.length-1;i++)for(let n=i+1;n<t.length;n++)if(t[i].col<t[n].col){let a=t[i];t[i]=t[n],t[n]=a}return t}}function Nge(e){return oe.runCommand(e,"insertDownCells",YO,{})}let YO={canUndo:!0,execute:function(e,t,i){return new Bge(e,t).execute(e,t,i)}};class Bge extends bc{executeImp(t,i,n){let a=this,r=i.selections;if(Ae.getSelectionTypeWithSelections(r)===3){let o=Ae.getSortedRowSelections(r),l=a.sheet().getRowCount();if(!a.canInsertDown(o))return s.insertCellOfTable;for(let c=0;c<o.length;c++){let d=o[c],u=GC.Spread.Sheets.CopyToOptions.all;a.sheet().addRows(l,d.rowCount),a.sheet().moveTo(d.row,d.col,d.row+d.rowCount,d.col,l-d.row,d.colCount,u)}}}canShiftCell(t,i){let n=t.tables.all(),a;for(let r=0;r<n.length;r++)if(a=n[r].range(),!(i.containsRange(a)||a.containsRange(i))&&i.intersect(a.row,a.col,a.rowCount,a.colCount))return{ret:!1,type:"table"}}canInsertDown(t){let i=this.sheet(),n=!0;for(let a=0;a<t.length;a++){let r=t[a],o=[],l=r.row,c=r.col,d=r.row+r.rowCount,u=r.col+r.colCount,h=new GC.Spread.Sheets.Range(l,c,i.getRowCount(),u-c),g=this.canShiftCell(i,h);if(g)return g.ret;for(let y=l;y<d;y++)for(let v=c;v<u;v++){let x;for(x=0;x<o.length&&!o[x].contains(y,v,1,1);x++);let L=i.getFormulaInformation(y,v);x===o.length&&L.isArrayFormula&&o.push(L.baseRange)}if(o.length===0)return n;let f=o[0].col,b=o[0].row,S=o[0].col+o[0].colCount;for(let y=1;y<o.length;y++)o[y].col<f&&(f=o[y].col),o[y].row<b&&(b=o[y].row),o[y].col+o[y].colCount<S&&(S=o[y].row+o[y].rowCount);if(f<r.col||b<r.row||S>r.col+r.colCount){n=!1;break}}return n}}function Fge(e,t){let i="Designer."+t;e.commandManager().register(i,YO,void 0,!1,!1,!1,!1)}function Gge(e){return oe.runCommand(e,"insertRightCells",qO,{})}let qO={canUndo:!0,execute:function(e,t,i){return new Vge(e,t).execute(e,t,i)}};class Vge extends bc{executeImp(t,i,n){let a=this,r=i.selections;if(Ae.getSelectionTypeWithSelections(r)===Ae.SelectionRangeType.OnlyCells){let o=Ae.getSortedColumnSelections(r),l=a.sheet().getColumnCount();if(!a.canInsertRight(o))return s.insertCellOfTable;for(let c=0;c<o.length;c++){let d=o[c],u=GC.Spread.Sheets.CopyToOptions.all;a.sheet().addColumns(l,d.colCount),a.sheet().moveTo(d.row,d.col,d.row,d.col+d.colCount,d.rowCount,l-d.col,u)}}}canShiftCell(t,i){let n=t.tables.all(),a;for(let r=0;r<n.length;r++)if(a=n[r].range(),!(i.containsRange(a)||a.containsRange(i))&&i.intersect(a.row,a.col,a.rowCount,a.colCount))return{ret:!1,type:"table"}}canInsertRight(t){let i=this.sheet(),n=!0;for(let a=0;a<t.length;a++){let r=t[a],o=[],l=r.row,c=r.col,d=r.row+r.rowCount,u=r.col+r.colCount,h=new GC.Spread.Sheets.Range(l,c,d-l,i.getColumnCount()),g=this.canShiftCell(i,h);if(g)return g.ret;for(let y=l;y<d;y++)for(let v=c;v<u;v++){let x;for(x=0;x<o.length&&!o[x].contains(y,v,1,1);x++);let L=i.getFormulaInformation(y,v);x===o.length&&L.isArrayFormula&&o.push(L.baseRange)}if(o.length===0)return n;let f=o[0].col,b=o[0].row,S=o[0].row+o[0].rowCount;for(let y=1;y<o.length;y++)o[y].col<f&&(f=o[y].col),o[y].row<b&&(b=o[y].row),o[y].row+o[y].rowCount<S&&(S=o[y].row+o[y].rowCount);if(f<r.col||b<r.row||S>r.row+r.rowCount){n=!1;break}}return n}}function Hge(e,t){let i="Designer."+t;e.commandManager().register(i,qO,void 0,!1,!1,!1,!1)}function KO(e,t){let i="Designer."+t;e.commandManager().register(i,zge,void 0,!1,!1,!1,!1)}function nS(e){let t={};oe.updateCommandOptions(e,t);let i=new QO(e,t);i.canExecute()&&i.executeImp(e,t,!1)}let zge={canUndo:!0,execute:function(e,t,i){return new QO(e,t).execute(e,t,i)}};class QO extends bc{canExecute(){return this.canDoInsertOrDeleteRow()}executeImp(t,i,n){let a=this,r=i.selections,o=a.sheet(),l=p.InsertRows;t.commandManager().execute({cmd:l,sheetName:o.name(),selections:r,activeRow:o&&o.getActiveRowIndex(),activeCol:o&&o.getActiveColumnIndex()})}}function XO(e,t){let i="Designer."+t;e.commandManager().register(i,jge,void 0,!1,!1,!1,!1)}function aS(e){let t={};oe.updateCommandOptions(e,t);let i=new $O(e,t);i.canExecute()&&i.executeImp(e,t,!1)}class $O extends bc{canExecute(){return this.canDoInsertOrDeleteColumn()}executeImp(t,i,n){let a=this,r=i.selections,o=a.sheet(),l=p.InsertColumns;t.commandManager().execute({cmd:l,sheetName:o.name(),selections:r,activeRow:o&&o.getActiveRowIndex(),activeCol:o&&o.getActiveColumnIndex()})}}let jge={canUndo:!0,execute:function(e,t,i){return new $O(e,t).execute(e,t,i)}};var ah=(e=>(e[e.shiftCellsRight=0]="shiftCellsRight",e[e.shiftCellsDown=1]="shiftCellsDown",e[e.entireRow=2]="entireRow",e[e.entireColumn=3]="entireColumn",e))(ah||{});let Wge=function(){return{templateName:G.CellsInsertDialogTemplate,title:s.insertCellsDialog.title,content:[{type:"Column",width:"200px",children:[{type:"LabelContainer",text:s.insertCellsDialog.title,size:{height:160},children:[{type:"Radio",bindingPath:"value",items:[{text:s.insertCellsDialog.shiftcellsright,value:0},{text:s.insertCellsDialog.shiftcellsdown,value:1},{text:s.insertCellsDialog.entirerow,value:2},{text:s.insertCellsDialog.entirecolumn,value:3}]}]}]}]}};const Zge=Ae.isFullCol,Uge=Ae.isFullRow;_e(G.CellsInsertDialogTemplate,Wge);async function eE(e,t){let i={value:ah.shiftCellsDown},n=e.Spread,a=C.getActiveSheet(n);if(Zge(a))aS(n);else if(Uge(a))nS(n);else{let r=await e._showDialog(G.CellsInsertDialogTemplate,i);if(r!=null)switch(r.value){case ah.shiftCellsDown:let o=Nge(n);typeof o=="string"&&e._showMessageBox(o,s.title,Re.warning);break;case ah.shiftCellsRight:let l=Gge(n);typeof l=="string"&&e._showMessageBox(l,s.title,Re.warning);break;case ah.entireRow:nS(n);break;case ah.entireColumn:aS(n);break}}}let Jge={text:"${res.ribbon.home.insertCells}",iconClass:"ribbon-control-dropdown-insertcells",commandName:p.InsertCellsInRibbon,enableContext:`${m.AllowInsertCell} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments} && !${m.PivotTableSelected}`,execute:eE,init:e=>{let t=e.Spread;Fge(t,"insertDownCells"),Hge(t,"insertRightCells"),XO(t,"insertColumns"),KO(t,"insertRows")}};const Yge=Object.freeze(Object.defineProperty({__proto__:null,insertCells:Jge},Symbol.toStringTag,{value:"Module"}));let qge={text:"${res.ribbon.home.insertSheetRows}",iconClass:"ribbon-control-dropdown-insertsheetrows",commandName:p.InsertSheetRows,enableContext:`${m.AllowInsertRows} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments} && !${m.PivotTableSelected}`,execute:(e,t)=>{nS(e.Spread)}};const Kge=Object.freeze(Object.defineProperty({__proto__:null,insertSheetRows:qge},Symbol.toStringTag,{value:"Module"}));let Qge={text:"${res.ribbon.home.insertSheetColumns}",iconClass:"ribbon-control-dropdown-insertsheetcolumns",commandName:p.InsertSheetColumns,enableContext:`${m.AllowInsertColumns} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments} && !${m.PivotTableSelected}`,execute:(e,t)=>{aS(e.Spread)}};const Xge=Object.freeze(Object.defineProperty({__proto__:null,insertSheetColumns:Qge},Symbol.toStringTag,{value:"Module"}));function $ge(e,t){let i="Designer."+t;e.commandManager().register(i,tE,void 0,!1,!1,!1,!1)}function efe(e){return oe.runCommand(e,"insertSheet",tE,{})}class tfe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;if(a.canExecute(t,i,n)){let r=a.spread(),o=r.getActiveSheet()||r.getActiveSheetTab(),l=r.getSheetPosition(o.name());r.addSheet(0);let c=r.getSheet(0);return r.changeSheetPosition(c.name(),l),r.setActiveSheet(c.name()),!0}else return!1}}let tE={canUndo:!1,execute:function(e,t,i){return new tfe(e,t).execute(e,t,i)}},ife={text:"${res.ribbon.home.insertSheet}",iconClass:"ribbon-control-dropdown-insertSheet",commandName:p.InsertSheetInRibbon,enableContext:`!${m.IsInParameterPanelDesignMode}`,execute:(e,t)=>{efe(e.Spread)&&e.setData(re.isFileModified,!0)},init:e=>{$ge(e.Spread,"insertSheet")}};const nfe=Object.freeze(Object.defineProperty({__proto__:null,insertSheets:ife},Symbol.toStringTag,{value:"Module"}));let afe={title:"${res.ribbon.home.Delete}",text:"${res.ribbon.home.Delete}",iconClass:"ribbon-button-delete",bigButton:"=ribbonHeight>toolbarHeight",direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")',commandName:p.CellsDelete,enableContext:`!${m.IsInTableSheetDesignMode}`};const rfe=Object.freeze(Object.defineProperty({__proto__:null,CellsDelete:afe},Symbol.toStringTag,{value:"Module"}));function ofe(e,t){let i="Designer."+t;e.commandManager().register(i,iE,void 0,!1,!1,!1,!1)}function lfe(e){oe.runCommand(e,"deleteLeftCells",iE,{})}class sfe extends bc{executeImp(t,i,n){let a=this,r=i.selections,o=Ae.getSortedColumnSelections(r);for(let l=0;l<o.length;l++){let c=o[l],d=GC.Spread.Sheets.CopyToOptions.all;a.sheet().moveTo(c.row,c.col+c.colCount,c.row,c.col,c.rowCount,a.sheet().getColumnCount()-(c.col+c.colCount),d)}}}let iE={canUndo:!0,execute:function(e,t,i){return new sfe(e,t).execute(e,t,i)}};function cfe(e,t){let i="Designer."+t;e.commandManager().register(i,nE,void 0,!1,!1,!1,!1)}function dfe(e){oe.runCommand(e,"deleteUpCells",nE,{})}class ufe extends bc{executeImp(t,i,n){let a=this,r=i.selections,o=Ae.getSortedRowSelections(r);for(let l=0;l<o.length;l++){let c=o[l],d=GC.Spread.Sheets.CopyToOptions.all,u=a.sheet().getRowCount()-(c.row+c.rowCount);if(a.sheet().moveTo(c.row+c.rowCount,c.col,c.row,c.col,u,c.colCount,d),u<c.rowCount){let h=GC.Spread.Sheets.StorageType.data|GC.Spread.Sheets.StorageType.axis|GC.Spread.Sheets.StorageType.bindingPath|GC.Spread.Sheets.StorageType.comment|GC.Spread.Sheets.StorageType.hyperlink|GC.Spread.Sheets.StorageType.sparkline|GC.Spread.Sheets.StorageType.style|GC.Spread.Sheets.StorageType.tag;a.sheet().clear(c.row+u,c.col,c.rowCount-u,c.colCount,3,h)}}}}let nE={canUndo:!0,execute:function(e,t,i){return new ufe(e,t).execute(e,t,i)}};function hfe(e,t){let i="Designer."+t;e.commandManager().register(i,pfe,void 0,!1,!1,!1,!1)}function rS(e){let t={};oe.updateCommandOptions(e,t);let i=new aE(e,t);i.canExecute()&&i.executeImp(e,t,!1)}class aE extends bc{canExecute(){return this.canDoInsertOrDeleteRow()&&!this._isTableHeaderInRange()}executeImp(t,i,n){let a=i.selections,o=this.sheet(),l=p.DeleteRows;t.commandManager().execute({cmd:l,sheetName:o.name(),selections:a,activeRow:o&&o.getActiveRowIndex(),activeCol:o&&o.getActiveColumnIndex()})}_isTableHeaderInRange(){let t=this,i=C.getActiveSheet(this.spread()).getSelections(),n=Ae.getSortedRowSelections(i),a=t.sheet().tables.all();for(let r in a)for(let o in n)if(a[r].headerIndex()===n[o].row)return!0;return!1}}let pfe={canUndo:!0,execute:function(e,t,i){return new aE(e,t).execute(e,t,i)}};function mfe(e,t){let i="Designer."+t;e.commandManager().register(i,gfe,void 0,!1,!1,!1,!1)}function oS(e){let t={};oe.updateCommandOptions(e,t);let i=new rE(e,t);i.canExecute()&&i.executeImp(e,t,!1)}let gfe={canUndo:!0,execute:function(e,t,i){return new rE(e,t).execute(e,t,i)}};class rE extends bc{canExecute(){return this.canDoInsertOrDeleteColumn()}executeImp(t,i,n){let a=this,r=i.selections,o=a.sheet(),l=p.DeleteColumns;t.commandManager().execute({cmd:l,sheetName:o.name(),selections:r,activeRow:o&&o.getActiveRowIndex(),activeCol:o&&o.getActiveColumnIndex()})}}var rh=(e=>(e[e.shiftCellsLeft=0]="shiftCellsLeft",e[e.shiftCellsUp=1]="shiftCellsUp",e[e.entireRow=2]="entireRow",e[e.entireColumn=3]="entireColumn",e))(rh||{});let ffe=function(){return{templateName:G.CellsDeleteDialogTemplate,title:s.deleteCellsDialog.title,content:[{type:"Column",width:"200px",children:[{type:"LabelContainer",text:s.deleteCellsDialog.title,size:{height:160},children:[{type:"Radio",bindingPath:"value",items:[{text:s.deleteCellsDialog.shiftcellsleft,value:0},{text:s.deleteCellsDialog.shiftcellsup,value:1},{text:s.deleteCellsDialog.entirerow,value:2},{text:s.deleteCellsDialog.entirecolumn,value:3}]}]}]}]}};_e(G.CellsDeleteDialogTemplate,ffe);async function oE(e,t){let i={value:rh.shiftCellsLeft},n=e.Spread,a=C.getActiveSheet(n);if(Ae.isFullCol(a))oS(n);else if(Ae.isFullRow(a))rS(n);else{let r=await e._showDialog(G.CellsDeleteDialogTemplate,i);if(r!=null)switch(r.value){case rh.shiftCellsLeft:lfe(n);break;case rh.shiftCellsUp:dfe(n);break;case rh.entireRow:rS(n);break;case rh.entireColumn:oS(n);break}}}let bfe={text:"${res.ribbon.home.deleteCells}",iconClass:"ribbon-control-dropdown-deletecells",commandName:p.CellsDeleteCell,enableContext:`${m.AllowDeleteCell} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments} && !${m.PivotTableSelected}`,execute:oE};const Sfe=Object.freeze(Object.defineProperty({__proto__:null,cellsDeleteCells:bfe},Symbol.toStringTag,{value:"Module"}));function Cfe(e,t){let i="Designer."+t;e.commandManager().register(i,lE,void 0,!1,!1,!1,!1)}function yfe(e){return oe.runCommand(e,"deleteSheet",lE,{})}let lE={canUndo:!1,execute:function(e,t,i){return new vfe(e,t).execute(e,t,i)}};class vfe extends oe.DesignerActionBase{canExecute(){return this.spread().getSheetCount()+this.spread().getSheetTabCount()>1}executeImp(t,i,n){let a=this,r=a.spread(),o=r.getSheetCount(),l=r.getSheetTabCount();if(o+l>1){let c=r.getActiveSheetOrSheetTab(),d=r.getSheetPosition(c.name());return r.getActiveSheet()?r.removeSheet(r.getSheetIndex(c.name())):r.getActiveSheetTab()&&r.removeSheetTab(c.name()),r.setActiveSheetOrSheetTabIndex(d),r.undoManager().clear(),!0}else return!1}}let xfe={text:"${res.ribbon.home.deleteSheet}",iconClass:"ribbon-control-dropdown-deletesheet",commandName:p.CellsDeleteSheet,enableContext:`!${m.IsInParameterPanelDesignMode}`,execute:e=>{yfe(e.Spread)},init:e=>{Cfe(e.Spread,"deleteSheet")}};const Lfe=Object.freeze(Object.defineProperty({__proto__:null,cellsDeleteSheet:xfe},Symbol.toStringTag,{value:"Module"}));let Tfe={text:"${res.ribbon.home.deleteSheetColumns}",iconClass:"ribbon-control-dropdown-deletesheetcolumns",commandName:p.CellsDeleteSheetColumn,enableContext:`${m.AllowDeleteColumns} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments} && !${m.PivotTableSelected}`,execute:(e,t)=>{oS(e.Spread)}};const wfe=Object.freeze(Object.defineProperty({__proto__:null,cellsDeleteSheetColumn:Tfe},Symbol.toStringTag,{value:"Module"}));let Dfe={text:"${res.ribbon.home.deleteSheetRows}",iconClass:"ribbon-control-dropdown-deletesheetrows",commandName:p.CellsDeleteSheetRow,enableContext:`${m.AllowDeleteRows} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments} && !${m.PivotTableSelected}`,execute:(e,t)=>{rS(e.Spread)}};const Afe=Object.freeze(Object.defineProperty({__proto__:null,cellsDeleteSheetRow:Dfe},Symbol.toStringTag,{value:"Module"}));let Pfe={title:"${res.ribbon.home.format}",text:"${res.ribbon.home.format}",iconClass:"ribbon-button-format",bigButton:"=ribbonHeight>toolbarHeight",direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")',commandName:p.CellsFormat,enableContext:`!${m.IsInTableSheetDesignMode}`};const Ife=Object.freeze(Object.defineProperty({__proto__:null,CellsFormat:Pfe},Symbol.toStringTag,{value:"Module"}));function Mfe(e,t){let i="Designer."+t;e.commandManager().register(i,sE,void 0,!1,!1,!1,!1)}function kfe(e){oe.runCommand(e,"autofitRows",sE,{})}let sE={canUndo:!0,execute:function(e,t,i){return new Rfe(e,t).execute(e,t,i)}};class Rfe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForRow(a.sheet(),i,function(r,o){a.sheet().autoFitRow(o)})}}let _fe={text:"${res.ribbon.home.autofitRowHeight}",commandName:p.CellsFormatAutoFitRowHeight,enableContext:`(${m.AllowFormatRows} || ${m.AllowResizeRows}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;kfe(i)},init:e=>{Mfe(e.Spread,"autofitRows")}};const Ofe=Object.freeze(Object.defineProperty({__proto__:null,autoFitRowHeight:_fe},Symbol.toStringTag,{value:"Module"}));function Efe(e,t){let i="Designer."+t;e.commandManager().register(i,cE,void 0,!1,!1,!1,!1)}function Nfe(e){oe.runCommand(e,"autofitColumns",cE,{})}let cE={canUndo:!0,execute:function(e,t,i){return new Bfe(e,t).execute(e,t,i)}};class Bfe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForCol(a.sheet(),i,function(r,o){a.sheet().autoFitColumn(o)})}}let Ffe={text:"${res.ribbon.home.autofitColumnWidth}",commandName:p.CellsFormatAutoFitColumnWidth,enableContext:`(${m.AllowFormatColumns} || ${m.AllowResizeColumns}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;Nfe(i)},init:e=>{Efe(e.Spread,"autofitColumns")}};const Gfe=Object.freeze(Object.defineProperty({__proto__:null,autofitColumnWidth:Ffe},Symbol.toStringTag,{value:"Module"})),Vfe=function(){return{templateName:G.ColumnWidthDialogTemplate2,title:s.columnWidthDialog.title,content:[{type:"FlexContainer",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",style:"line-height: 25px",margin:"0 20px 0 0",text:s.columnWidthDialog.columnWidth}],width:"auto"},{type:"Column",children:[{type:"TextEditor",bindingPath:"value"}],width:"120px"}]}]}]}},Hfe=function(){return{templateName:G.DefaultColumnWidthDialogTemplate,title:s.standardWidthDialog.title,content:[{type:"FlexContainer",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",style:"line-height: 25px",margin:"0 20px 0 0",text:s.standardWidthDialog.columnWidth}],width:"auto"},{type:"Column",children:[{type:"TextEditor",bindingPath:"value"}],width:"120px"}]}]}]}},zfe=function(){return{templateName:G.RowHeightDialogTemplate2,title:s.rowHeightDialog.title,content:[{type:"FlexContainer",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",style:"line-height: 25px",margin:"0 20px 0 0",text:s.rowHeightDialog.rowHeight}],width:"auto"},{type:"Column",children:[{type:"TextEditor",bindingPath:"value"}],width:"120px"}]}]}]}},jfe=function(){return{templateName:G.DefaultRowHeightDialogTemplate,title:s.standardHeightDialog.title,content:[{type:"FlexContainer",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",style:"line-height: 25px",margin:"0 20px 0 0",text:s.standardHeightDialog.rowHeight}],width:"auto"},{type:"Column",children:[{type:"TextEditor",bindingPath:"value"}],width:"120px"}]}]}]}};function Wfe(e,t){let i="Designer."+t;e.commandManager().register(i,dE,void 0,!1,!1,!1,!1)}function z0(e,t){oe.runCommand(e,"setRowsHeight",dE,{value:t})}let dE={canUndo:!0,execute:function(e,t,i){return new Zfe(e,t).execute(e,t,i)}};class Zfe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForRow(a.sheet(),i,function(r,o){a.sheet().setRowHeight(o,i.value)})}}function Ufe(e,t){let i="Designer."+t;e.commandManager().register(i,uE,void 0,!1,!1,!1,!1)}function j0(e,t){oe.runCommand(e,"setColumnsWidth",uE,{width:t})}let uE={canUndo:!0,execute:function(e,t,i){return new Jfe(e,t).execute(e,t,i)}};class Jfe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForCol(a.sheet(),i,function(r,o){a.sheet().setColumnWidth(o,i.width)})}}function Yfe(e,t){let i="Designer."+t;e.commandManager().register(i,pE,void 0,!1,!1,!1,!1)}function hE(e,t){oe.runCommand(e,"defaultRowHeight",pE,{value:t})}let pE={canUndo:!0,execute:function(e,t,i){return new qfe(e,t).execute(e,t,i)}};class qfe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForRow(a.sheet(),i,function(r,o){a.sheet().defaults.rowHeight=i.value})}}function Kfe(e,t){let i="Designer."+t;e.commandManager().register(i,mE,void 0,!1,!1,!1,!1)}function Qfe(e,t){oe.runCommand(e,"defaultColumnWidth",mE,{width:t})}let mE={canUndo:!0,execute:function(e,t,i){return new Xfe(e,t).execute(e,t,i)}};class Xfe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForCol(a.sheet(),i,function(r,o){a.sheet().defaults.colWidth=i.width})}}_e(G.ColumnWidthDialogTemplate2,Vfe),_e(G.DefaultColumnWidthDialogTemplate,Hfe),_e(G.RowHeightDialogTemplate2,zfe),_e(G.DefaultRowHeightDialogTemplate,jfe);async function gE(e,t){const i=e.Spread;let n=C.getActiveSheet(i),a={value:t?n.defaults.rowHeight:n.getRowHeight(n.getActiveRowIndex())},r=await e._showDialog(t?G.DefaultRowHeightDialogTemplate:G.RowHeightDialogTemplate2,a,SE);bE(r,hE,z0,t,i)}async function fE(e,t){const i=e.Spread;let n=C.getActiveSheet(i),a={value:t?n.defaults.colWidth:n.getColumnWidth(n.getActiveColumnIndex())},r=await e._showDialog(t?G.DefaultColumnWidthDialogTemplate:G.ColumnWidthDialogTemplate2,a,SE);bE(r,Qfe,j0,t,i)}function bE(e,t,i,n,a){if(e!=null){const r=n?t:i;let o=e.value;typeof o=="number"?r(a,o):r(a,o.match(/^(-?\d+)(\.\d+)?$/)?parseInt(o,10):o)}}function SE(e,t){let i=e.value,n;return typeof i=="number"?!0:(i.match(/^(-?\d+)(\.\d+)?$/)?parseFloat(i)>9999999||parseFloat(i)<0?t==null||t._showMessageBox(s.contextMenu.rowHeightColWidthError,s.title,Re.error):n=i:i.match(/^\d*(\.\d+)?\*$/)?n=i:t==null||t._showMessageBox(s.contextMenu.rowHeightColWidthError,s.title,Re.error),n!==void 0)}let $fe={text:"${res.ribbon.home.columnWidth}",iconClass:"ribbon-control-dropdown-columnwidth",commandName:p.CellsFormatColumnWidth,enableContext:`(${m.AllowFormatColumns} || ${m.AllowResizeColumns}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:async e=>{await fE(e)},init:e=>{Kfe(e.Spread,"defaultColumnWidth")}};const ebe=Object.freeze(Object.defineProperty({__proto__:null,columnWidth:$fe},Symbol.toStringTag,{value:"Module"}));let tbe={text:"${res.ribbon.home.defaultHeight}",commandName:p.CellsFormatDefaultHeight,enableContext:`(${m.AllowFormatRows} || ${m.AllowResizeRows}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:async e=>{await gE(e,!0)},init:e=>{Yfe(e.Spread,"defaultRowHeight")}};const ibe=Object.freeze(Object.defineProperty({__proto__:null,defaultHeight:tbe},Symbol.toStringTag,{value:"Module"}));let nbe={text:"${res.ribbon.home.defaultWidth}",commandName:p.CellsFormatDefaultWidth,enableContext:`(${m.AllowFormatColumns} || ${m.AllowResizeColumns}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:async e=>{await fE(e,!0)}};const abe=Object.freeze(Object.defineProperty({__proto__:null,defaultWidth:nbe},Symbol.toStringTag,{value:"Module"}));function rbe(e,t){let i="Designer."+t;e.commandManager().register(i,yE,void 0,!1,!1,!1,!1)}function CE(e){oe.runCommand(e,"hideColumns",yE,{})}class obe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForCol(a.sheet(),i,function(r,o){a.sheet().setColumnVisible(o,!1)})}}let yE={canUndo:!0,execute:function(e,t,i){return new obe(e,t).execute(e,t,i)}},lbe={text:"${res.ribbon.home.hideColumns}",commandName:p.CellsFormatHideColumns,enableContext:`(${m.AllowFormatRows} || ${m.AllowOutlineRows}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;CE(i)},init:e=>{rbe(e.Spread,"hideColumns")}};const sbe=Object.freeze(Object.defineProperty({__proto__:null,cellsFormatHideColumns:lbe},Symbol.toStringTag,{value:"Module"}));function cbe(e,t){let i="Designer."+t;e.commandManager().register(i,xE,void 0,!1,!1,!1,!1)}function vE(e){oe.runCommand(e,"hideRows",xE,{})}class dbe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForRow(a.sheet(),i,function(r,o){a.sheet().setRowVisible(o,!1)})}}let xE={canUndo:!0,execute:function(e,t,i){return new dbe(e,t).execute(e,t,i)}},ube={text:"${res.ribbon.home.hideRows}",commandName:p.CellsFormatHideRows,enableContext:`(${m.AllowFormatRows} || ${m.AllowOutlineRows}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;vE(i)},init:e=>{cbe(e.Spread,"hideRows")}};const hbe=Object.freeze(Object.defineProperty({__proto__:null,cellsFormatHideRows:ube},Symbol.toStringTag,{value:"Module"}));function pbe(e,t){let i="Designer."+t;e.commandManager().register(i,TE,void 0,!1,!1,!1,!1)}function LE(e,t){oe.runCommand(e,"LockCells",TE,{locked:t})}let TE={canUndo:!0,execute:function(e,t,i){return new mbe(e,t).execute(e,t,i)}};class mbe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForSetStyle(a.sheet(),i,function(r,o,l,c,d,u){let h=r.getStyle(o,l);h=a._composeStyleWithRowColumn(r,h,o,l,c,d,u),h&&(h.locked=i.locked,r.setStyle(o,l,h))})}}let gbe={text:"${res.ribbon.home.lockCells}",iconClass:"ribbon-control-dropdown-lockcells",commandName:p.CellsFormatLockCells,visibleContext:`!${m.CellLocked}`,enableContext:`!${m.IsActualProtected} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;LE(i,!0)}};const fbe=Object.freeze(Object.defineProperty({__proto__:null,lockCells:gbe},Symbol.toStringTag,{value:"Module"}));class bbe extends oe.DesignerActionBase{executeImp(t,i,n){let a=C.getSheetOrSheetTabByName(t,i.sheetName),r=i.value,o=r.protectPassword;return delete r.protectPassword,a.options.protectionOptions=r,o?a.protect(o):a.protect(),t.undoManager().clear(),!0}}let wE={canUndo:!1,execute:function(e,t,i){return new bbe(e,t).execute(e,t,i)}};function Sbe(e,t){let i="Designer."+t;e.commandManager().register(i,wE,void 0,!1,!1,!1,!1)}function Cbe(e,t){return oe.runCommand(e,"confirmProtectSheet",wE,{value:t})}const Ma=C.nameof;let ybe=function(){return{templateName:G.ProtectSheetDialogTemplate,title:s.protectionOptionDialog.title,content:[{type:"Column",width:"250px",children:[{type:"TextBlock",text:s.protectionOptionDialog.passwordLabel},{type:"TextEditor",isPassword:!0,bindingPath:Ma("protectPassword"),needFocus:!0,className:"gc-need-focus"},{type:"TextBlock",text:s.protectionOptionDialog.label},{type:"LabelContainer",text:"",margin:"2px 3px 3px 3px",showText:!1,children:[{type:"CheckBox",bindingPath:Ma("allowSelectLockedCells"),text:s.protectionOptionDialog.allowSelectLockedCells},{type:"CheckBox",bindingPath:Ma("allowSelectUnlockedCells"),text:s.protectionOptionDialog.allowSelectUnlockedCells},{type:"CheckBox",bindingPath:Ma("formatCells"),text:s.protectionOptionDialog.allowFormatCells},{type:"CheckBox",bindingPath:Ma("allowSort"),text:s.protectionOptionDialog.allowSort},{type:"CheckBox",bindingPath:Ma("allowFilter"),text:s.protectionOptionDialog.allowFilter},{type:"CheckBox",bindingPath:Ma("allowResizeRows"),text:s.protectionOptionDialog.allowResizeRows},{type:"CheckBox",bindingPath:Ma("allowResizeColumns"),text:s.protectionOptionDialog.allowResizeColumns},{type:"CheckBox",bindingPath:Ma("allowUsePivotTable"),text:s.protectionOptionDialog.allowUsePivotTable},{type:"CheckBox",bindingPath:Ma("allowEditObjects"),text:s.protectionOptionDialog.allowEditObjects},{type:"CheckBox",bindingPath:Ma("allowDragInsertRows"),text:s.protectionOptionDialog.allowDragInsertRows},{type:"CheckBox",bindingPath:Ma("allowDragInsertColumns"),text:s.protectionOptionDialog.allowDragInsertColumns},{type:"CheckBox",bindingPath:Ma("allowInsertRows"),text:s.protectionOptionDialog.allowInsertRows},{type:"CheckBox",bindingPath:Ma("allowInsertColumns"),text:s.protectionOptionDialog.allowInsertColumns},{type:"CheckBox",bindingPath:Ma("allowDeleteRows"),text:s.protectionOptionDialog.allowDeleteRows},{type:"CheckBox",bindingPath:Ma("allowDeleteColumns"),text:s.protectionOptionDialog.allowDeleteColumns},{type:"CheckBox",bindingPath:Ma("formatRows"),text:s.protectionOptionDialog.allowFormatRows},{type:"CheckBox",bindingPath:Ma("formatColumns"),text:s.protectionOptionDialog.allowFormatColumns}]}]}]}},vbe=function(){return{templateName:G.ConfirmPasswordDialogTemplate,title:s.confirmPasswordDialog.title,content:[{type:"Column",width:"300px",children:[{type:"TextBlock",text:s.confirmPasswordDialog.passwordLabel},{type:"TextEditor",isPassword:!0,bindingPath:"confirmedPassword",needFocus:!0},{type:"TextBlock",text:s.confirmPasswordDialog.passwordTips}]}]}};const xbe=["allowSort","allowFilter","allowEditObjects","allowResizeRows","allowResizeColumns","allowDragInsertRows","allowDragInsertColumns","allowInsertRows","allowInsertColumns","allowDeleteRows","allowDeleteColumns","formatCells","formatColumns","formatRows","allowOutlineColumns","allowOutlineRows","allowUsePivotTable"];_e(G.ProtectSheetDialogTemplate,ybe),_e(G.ConfirmPasswordDialogTemplate,vbe);async function DE(e,t){let i=e.Spread,r=C.getActiveSheet(i).options.protectionOptions,o=AE(r);o.allowSelectLockedCells===void 0&&(o.allowSelectLockedCells=!0),o.allowSelectUnlockedCells===void 0&&(o.allowSelectUnlockedCells=!0);let l=AE(o),c=await e._showDialog(G.ProtectSheetDialogTemplate,o,async d=>{if(d&&d.protectPassword){let u=await e._showDialog(G.ConfirmPasswordDialogTemplate,{});if(u&&u.confirmedPassword){if(u.confirmedPassword===d.protectPassword)return!0;e._showMessageBox(s.confirmPasswordDialog.errorMessage,s.title,Re.warning)}return!1}return!0});if(!C.isNullOrUndefined(c)){for(let d in c)d&&!C.isNullOrUndefined(c[d])&&xbe.indexOf(d)>-1&&c[d]===!1&&!l.hasOwnProperty(d)&&delete c[d];c.formatRows?c.allowOutlineRows=!0:c.allowOutlineRows=!1,c.formatColumns?c.allowOutlineColumns=!0:c.allowOutlineColumns=!1,Cbe(e.Spread,c),Eo(e),l2(e)}}function AE(e){let t={};for(let i in e)i&&(t[i]=e[i]);return t}let Lbe={text:"${res.ribbon.home.protectSheet}",iconClass:"ribbon-control-dropdown-protectsheet",commandName:p.CellsFormatProtectSheet,visibleContext:`!${m.IsProtected}`,execute:DE};const Tbe=Object.freeze(Object.defineProperty({__proto__:null,protectSheet:Lbe},Symbol.toStringTag,{value:"Module"}));let wbe={text:"${res.ribbon.home.rowHeight}",iconClass:"ribbon-control-dropdown-rowheight",commandName:p.CellsFormatRowHeight,enableContext:`(${m.AllowFormatRows} || ${m.AllowResizeRows}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:async e=>{await gE(e)}};const Dbe=Object.freeze(Object.defineProperty({__proto__:null,rowHeight:wbe},Symbol.toStringTag,{value:"Module"}));function Abe(e,t){let i="Designer."+t;e.commandManager().register(i,PE,void 0,!1,!1,!1,!1)}let PE={canUndo:!0,execute:function(e,t,i){return new Pbe(e,t).execute(e,t,i)}};function IE(e){oe.runCommand(e,"unHideColumns",PE,{})}class Pbe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this,r=C.getActiveSheet(t),o=r.getSelections();if(o.length===1&&o[0].colCount===1){let l=o[0],c=0;for(let d=0;d<=l.col;d++)if(r.getColumnVisible(d)){c=d;break}(l.col===c||c!==0)&&(r.setColumnVisible(c-1,!0),r.showColumn(c-1,GC.Spread.Sheets.HorizontalPosition.nearest))}else a.execInSelectionsForCol(r,i,function(l,c){l.setColumnVisible(c,!0)})}}let Ibe={text:"${res.ribbon.home.unHideColumns}",commandName:p.CellsFormatUnhideColumns,enableContext:`(${m.AllowFormatRows} || ${m.AllowOutlineRows}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;IE(i)},init:e=>{Abe(e.Spread,"unHideColumns")}};const Mbe=Object.freeze(Object.defineProperty({__proto__:null,cellsFormatUnHideColumns:Ibe},Symbol.toStringTag,{value:"Module"}));function kbe(e,t){let i="Designer."+t;e.commandManager().register(i,ME,void 0,!1,!1,!1,!1)}let ME={canUndo:!0,execute:function(e,t,i){return new Rbe(e,t).execute(e,t,i)}};function kE(e){oe.runCommand(e,"unHideRows",ME,{})}class Rbe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this,r=C.getActiveSheet(t),o=r.getSelections();if(o.length===1&&o[0].rowCount===1){let l=o[0],c=0;for(let d=0;d<=l.row;d++)if(r.getRowVisible(d)){c=d;break}(l.row===c||c!==0)&&(r.setRowVisible(c-1,!0),r.showRow(c-1,GC.Spread.Sheets.VerticalPosition.nearest))}else a.execInSelectionsForRow(r,i,_be)}}function _be(e,t){e.setRowVisible(t,!0)}let Obe={text:"${res.ribbon.home.unHideRows}",commandName:p.CellsFormatUnhideRows,enableContext:`(${m.AllowFormatRows} || ${m.AllowOutlineRows}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;kE(i)},init:e=>{kbe(e.Spread,"unHideRows")}};const Ebe=Object.freeze(Object.defineProperty({__proto__:null,cellsFormatUnHideRows:Obe},Symbol.toStringTag,{value:"Module"}));let Nbe={text:"${res.ribbon.home.unLockCells}",iconClass:"ribbon-control-dropdown-unlockcells",commandName:p.CellsFormatUnLockCells,visibleContext:`${m.CellLocked}`,enableContext:`!${m.IsActualProtected} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;LE(i,!1)}};const Bbe=Object.freeze(Object.defineProperty({__proto__:null,unLockCells:Nbe},Symbol.toStringTag,{value:"Module"}));let Fbe={title:"${res.contextMenu.headers}",text:"${res.contextMenu.headers}",commandName:p.Headers,enableContext:`!${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:async function(e,t){var i,n;(n=(i=EA(p.RowHeaders))==null?void 0:i.execute)==null||n.call(i,e)}};const Gbe=Object.freeze(Object.defineProperty({__proto__:null,HEADERS:Fbe},Symbol.toStringTag,{value:"Module"}));class Vbe extends oe.DesignerActionBase{executeImp(t,i,n){return C.getActiveSheet(t).unprotect(i.value)}}let RE={canUndo:!1,execute:function(e,t,i){return new Vbe(e,t).execute(e,t,i)}};function Hbe(e,t){let i="Designer."+t;e.commandManager().register(i,RE,void 0,!1,!1,!1,!1)}function _E(e,t){return oe.runCommand(e,"unprotectSheet",RE,{value:t})}let zbe=function(){return{templateName:G.UnprotectSheetDialogTemplate,title:s.unprotectSheetDialog.title,content:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",text:s.unprotectSheetDialog.passwordLable,style:"height: 24px; line-height:24px"}]},{type:"Column",children:[{type:"TextEditor",isPassword:!0,bindingPath:"password",style:"height: 24px",margin:"0 0 0 10px",needFocus:!0}]}]}]}};_e(G.UnprotectSheetDialogTemplate,zbe);async function OE(e,t){let i=e.Spread,n=C.getActiveSheet(i);if(n.options.isProtected){if(n.hasPassword()){let a=await e._showDialog(G.UnprotectSheetDialogTemplate,{});if(!a)return;_E(i,a.password)||e._showMessageBox(s.unprotectSheetDialog.passwordNotCorrect,s.title,Re.warning)}else _E(i);Eo(e),l2(e)}}let jbe={text:"${res.ribbon.home.unProtectSheet}",iconClass:"ribbon-control-dropdown-unprotectsheet",commandName:p.CellsFormatUnprotectSheet,visibleContext:`${m.IsProtected}`,execute:OE};const Wbe=Object.freeze(Object.defineProperty({__proto__:null,unProtectSheet:jbe},Symbol.toStringTag,{value:"Module"}));let Zbe={text:"${res.ribbon.home.cellType}",iconClass:"ribbon-button-celltype",commandName:p.CellType,bigButton:"=IF(inDropdown, true, ribbonHeight>toolbarHeight)",enableContext:`${m.AllowFormatCells} && !${m.PivotTableSelected} && !${m.IsInTableSheetDesignMode}`};const Ube=Object.freeze(Object.defineProperty({__proto__:null,CellType:Zbe},Symbol.toStringTag,{value:"Module"}));let Jbe={text:"${res.ribbon.home.cellDropdowns}",iconClass:"ribbon-button-celldropdown",bigButton:"=IF(inDropdown, true, ribbonHeight>toolbarHeight)",commandName:p.CellDropdowns,enableContext:`${m.AllowFormatCells} && !${m.PivotTableSelected} && !${m.IsInTableSheetDesignMode}`};const Ybe=Object.freeze(Object.defineProperty({__proto__:null,CellDropdown:Jbe},Symbol.toStringTag,{value:"Module"}));let qbe={title:"${res.ribbon.home.cellEditors}",text:"${res.ribbon.home.cellEditors}",iconClass:"ribbon-button-celltype",commandName:p.CellEditors,bigButton:"=ribbonHeight>toolbarHeight",direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")',enableContext:`${m.AllowFormatCells} && !${m.PivotTableSelected} && !${m.IsInTableSheetDesignMode} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`};const Kbe=Object.freeze(Object.defineProperty({__proto__:null,CellEditors:qbe},Symbol.toStringTag,{value:"Module"}));function Ss(e,t){let i=$s(e.Spread);return i.dialogOption={activeTab:dt.CellButton},i.cellButtonTabOption=i.cellButtonTabOption||{},i.cellButtonTabOption.initCellButton=t,i}let Qbe={text:"${res.ribbon.home.calculatorCellType}",iconClass:"ribbon-button-calcualtor-dropdown",commandName:p.CalculatorCellType,execute:async(e,t)=>{let i=Ss(e,"openCalculator"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const Xbe=Object.freeze(Object.defineProperty({__proto__:null,calculatorCellType:Qbe},Symbol.toStringTag,{value:"Module"}));function $be(e,t){return t.tables.all().filter(n=>n.range().intersect(e.row,e.col,e.rowCount,e.colCount))}function lS(e,t,i){$be(e,t).forEach(a=>{const r=a.range();if(e.row<=r.row&&e.col<=r.col&&e.row+e.rowCount>=r.row+r.rowCount&&e.col+e.colCount>=r.col+r.colCount){const{header:o,footer:l,data:c}=a.layoutStyle(),d=i(o),u=i(l),h=i(c);a.layoutStyle({header:d,footer:u,data:h});for(let g=0;g<r.colCount;g++){const f=a.columnLayoutStyle(g),b=f.header,S=f.footer,y=f.data,v=i(b),x=i(S),L=i(y);a.columnLayoutStyle(g,{header:v,footer:x,data:L})}}else{const o=r;if(a.showHeader()){if(o.row=r.row+1,o.rowCount=r.rowCount-1,e.row<=r.row&&e.col<=r.col&&e.row+e.rowCount>r.row&&e.col+e.colCount>=r.col+r.colCount){const d=a.layoutStyle(),u=i(d.header);d.header=u,a.layoutStyle(d)}const c=new GC.Spread.Sheets.Range(r.row,r.col,1,o.colCount).getIntersect(e,t.getRowCount(),t.getColumnCount());if(c)for(let d=0;d<c.colCount;d++){const u=c.col-r.col+d,h=a.columnLayoutStyle(u),g=i(h.header);h.header=g,a.columnLayoutStyle(u,h)}}if(a.showFooter()){if(o.rowCount=r.rowCount-1,e.row<r.row+r.rowCount&&e.row+e.rowCount>=r.row+r.rowCount&&e.col<=r.col&&e.col+e.colCount>=r.col+r.colCount){const d=a.layoutStyle(),u=i(d.footer);d.footer=u,a.layoutStyle(d)}const c=new GC.Spread.Sheets.Range(r.row+r.rowCount-1,r.col,1,o.colCount).getIntersect(e,t.getRowCount(),t.getColumnCount());if(c)for(let d=0;d<c.colCount;d++){const u=c.col-r.col+d,h=a.columnLayoutStyle(u),g=i(h.footer);h.footer=g,a.columnLayoutStyle(u,h)}}if(e.row<=o.row&&e.col<=o.col&&e.row+e.rowCount>=o.row+o.rowCount&&e.col+e.colCount>=o.col+o.colCount){const c=a.layoutStyle(),d=i(c.data);c.data=d,a.layoutStyle(c)}const l=o.getIntersect(e,t.getRowCount(),t.getColumnCount());for(let c=0;c<l.colCount;c++){const d=l.col-r.col+c,u=a.columnLayoutStyle(d),h=i(u.data);u.data=h,a.columnLayoutStyle(d,u)}}})}function eSe(e,t){let i="Designer."+t;e.commandManager().register(i,EE,void 0,!1,!1,!1,!1)}function tSe(e){oe.runCommand(e,"clearCellDropDown",EE,{})}function W0(e){return e.cellButtons=[],e.decoration&&e.decoration.icons&&delete e.decoration.icons,e}class iSe extends oe.DesignerActionBase{executeImp(t,i,n){const a=this,r=a.sheet();a.execInSelectionsForSetStyle(r,i,function(l,c,d,u,h,g){let f=l.getStyle(c,d);f=a._composeStyleWithRowColumn(l,f,c,d,u,h,g),f&&(f=W0(f),l.setStyle(c,d,f))});const o=r.getSelections();for(let l=0;l<o.length;l++){const c=o[l];lS(c,r,d=>{if(d){if(typeof d=="string"){let u=r.getNamedStyle(d);return u?W0(u):void 0}return W0(d)}})}}}let EE={canUndo:!0,execute:function(e,t,i){return new iSe(e,t).execute(e,t,i)}},nSe={text:"${res.ribbon.home.clearCellDropDown}",iconClass:"ribbon-button-clear-celltype",commandName:p.ClearCellDropdown,execute:(e,t,i)=>{tSe(e.Spread)},init:e=>{eSe(e.Spread,"clearCellDropDown")}};const aSe=Object.freeze(Object.defineProperty({__proto__:null,clearDropDown:nSe},Symbol.toStringTag,{value:"Module"}));let rSe={text:"${res.ribbon.home.colorPickerCellType}",iconClass:"ribbon-button-colprpicker-dropdown",commandName:p.ColorPickerCellType,execute:async(e,t)=>{let i=Ss(e,"openColorPicker"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const oSe=Object.freeze(Object.defineProperty({__proto__:null,colorPickerCellType:rSe},Symbol.toStringTag,{value:"Module"}));let lSe={text:"${res.ribbon.home.dateTimePickerCellType}",iconClass:"ribbon-button-datetimepicker-dropdown",commandName:p.DateTimePickerCellType,execute:async(e,t)=>{let i=Ss(e,"openDateTimePicker"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const sSe=Object.freeze(Object.defineProperty({__proto__:null,dateTimePickerCellType:lSe},Symbol.toStringTag,{value:"Module"}));let cSe={text:"${res.ribbon.home.listCellType}",iconClass:"ribbon-button-list-dropdown",commandName:p.ListCellType,execute:async(e,t)=>{let i=Ss(e,"openList"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const dSe=Object.freeze(Object.defineProperty({__proto__:null,listCellType:cSe},Symbol.toStringTag,{value:"Module"}));let uSe={text:"${res.dropdownDialog.monthpicker.title}",iconClass:"ribbon-button-monthpicker-dropdown",commandName:p.MonthPickerCellType,execute:async(e,t)=>{let i=Ss(e,"openMonthPicker"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const hSe=Object.freeze(Object.defineProperty({__proto__:null,monthpickerCellType:uSe},Symbol.toStringTag,{value:"Module"}));let pSe={text:"${res.ribbon.home.sliderCellType}",iconClass:"ribbon-button-slider-dropdown",commandName:p.SliderCellType,execute:async(e,t)=>{let i=Ss(e,"openSlider"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const mSe=Object.freeze(Object.defineProperty({__proto__:null,sliderCellType:pSe},Symbol.toStringTag,{value:"Module"}));let gSe={text:"${res.dropdownDialog.timepicker.title}",iconClass:"ribbon-button-timepicker-dropdown",commandName:p.TimePickerCellType,execute:async(e,t)=>{let i=Ss(e,"openTimePicker"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,a)}}};const fSe=Object.freeze(Object.defineProperty({__proto__:null,timepickerCellType:gSe},Symbol.toStringTag,{value:"Module"}));let bSe={text:"${res.ribbon.home.workflowlistCellType}",iconClass:"ribbon-button-workflow-dropdown",commandName:p.WorkflowList,execute:async(e,t)=>{let i=Ss(e,"openWorkflowList"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const SSe=Object.freeze(Object.defineProperty({__proto__:null,workflowlistCellType:bSe},Symbol.toStringTag,{value:"Module"}));let CSe={text:"${res.ribbon.home.mulitColumnListCellType}",iconClass:"ribbon-button-multiColumn-dropdown",commandName:p.MultiColumnPicker,execute:async(e,t)=>{let i=Ss(e,"openMultiColumn"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const ySe=Object.freeze(Object.defineProperty({__proto__:null,multiColumnPickerCellType:CSe},Symbol.toStringTag,{value:"Module"}));function vSe(){return{type:"FlexContainer",className:"gc-itemsProperties_container",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"LabelContainer",className:"gc_list_item",text:s.checkListCellTypeDialog.items,children:[{type:"List",editorLabel:s.checkListCellTypeDialog.items,id:"c_list",items:[],className:"gc_list_container"}]}],width:"stretch"},{type:"Column",children:[{type:"LabelContainer",className:"gc_list_itemProperties",text:s.checkListCellTypeDialog.itemProperties,children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",text:s.checkListCellTypeDialog.text}],width:"55px"},{type:"Column",children:[{type:"TextEditor",id:"c_itemproperties_text",fireEventOnInput:!0,editorLabel:s.checkListCellTypeDialog.text}]}]},{type:"ColumnSet",id:"c_columnset_value",children:[{type:"Column",children:[{type:"TextBlock",text:s.checkListCellTypeDialog.value}],width:"55px"},{type:"Column",children:[{type:"TextEditor",id:"c_itemproperties_value",fireEventOnInput:!0,editorLabel:s.checkListCellTypeDialog.value}]}]}]}],width:"stretch"}]},{type:"ColumnSet",className:"gc_buttons",children:[{type:"Column",children:[{type:"Button",className:"gc_add_button",id:"c_add",text:s.checkListCellTypeDialog.add,width:65}]},{type:"Column",children:[{type:"Button",className:"gc_remove_button",id:"c_remove",text:s.checkListCellTypeDialog.remove,width:65}]}]}]}}var xSe=Object.getOwnPropertyDescriptor,LSe=(e,t,i,n)=>{for(var a=n>1?void 0:n?xSe(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};const TSe=`
|
|
374
|
+
`;let bce=function(){return{templateName:G.NewCellStateTemplate,title:s.cellStatesDialog.title,content:[{type:"FlexContainer",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",margin:"0 10px 0 5px",style:"line-height:25px",text:s.cellStatesDialog.selectStateType}]},{type:"Column",children:[{type:"ListComboEditor",visibleWhen:"isReportSheet!=true",bindingPath:"state",items:[{text:s.cellStatesDialog.hover,value:GC.Spread.Sheets.CellStatesType.hover},{text:s.cellStatesDialog.invalid,value:GC.Spread.Sheets.CellStatesType.invalid},{text:s.cellStatesDialog.readonly,value:GC.Spread.Sheets.CellStatesType.readonly},{text:s.cellStatesDialog.edit,value:GC.Spread.Sheets.CellStatesType.edit},{text:s.cellStatesDialog.active,value:GC.Spread.Sheets.CellStatesType.active},{text:s.cellStatesDialog.selected,value:GC.Spread.Sheets.CellStatesType.selected},{text:s.cellStatesDialog.dirty,value:GC.Spread.Sheets.CellStatesType.dirty},{text:s.cellStatesDialog.invalidFormula,value:GC.Spread.Sheets.CellStatesType.invalidFormula}]},{type:"ListComboEditor",visibleWhen:"isReportSheet=true",bindingPath:"state",items:[{text:s.cellStatesDialog.hover,value:GC.Spread.Sheets.CellStatesType.hover},{text:s.cellStatesDialog.invalid,value:GC.Spread.Sheets.CellStatesType.invalid},{text:s.cellStatesDialog.readonly,value:GC.Spread.Sheets.CellStatesType.readonly},{text:s.cellStatesDialog.edit,value:GC.Spread.Sheets.CellStatesType.edit},{text:s.cellStatesDialog.active,value:GC.Spread.Sheets.CellStatesType.active},{text:s.cellStatesDialog.selected,value:GC.Spread.Sheets.CellStatesType.selected}]}],width:"180px"}]},{type:"LabelContainer",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",margin:"5px 10px 0 5px",style:"line-height:25px",text:s.cellStatesDialog.range}]},{type:"Column",children:[{type:"RangeSelect",title:s.cellStatesDialog.title,needSheetName:!1,absoluteReference:!1,margin:"3px",bindingPath:"range"}],width:"180px"}]}],text:s.cellStatesDialog.selectRange},{type:"LabelContainer",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",margin:"0 10px 0 0",style:"line-height:40px",text:s.conditionalFormatting.newFormattingRule.preview.description}]},{type:"Column",children:[{type:"FormatRulePreview",bindingPath:"style"}],width:"200px"},{type:"Column",children:[{type:"Button",margin:"10px 0 0 10px",bindingPath:"style",text:s.conditionalFormatting.newFormattingRule.preview.buttonText,template:G.FormatDialogTemplate}],width:"80px"}]}],text:s.cellStatesDialog.selectStyle}]}]}};function y_(e){let t=C.getActiveSheet(e),i=t.getSelections(),n;i&&i.length>0&&(n=Ht.parseRangeToExpString(i[0],!1,0,0));let a={dialogOption:{activeTab:dt.Font},numberTabOption:{cellValue:"12345",category:{activeTab:"general"},formatter:"General"},borderTabOption:{},alignmentTabOption:{textIndent:0,orientation:{textOrientation:0,isVerticalText:!1}},fillTabOption:{backColor:""},cellButtonTabOption:{cellButtons:[]},decorationTabOption:{styleDecorationIcons:[]},protectionTabOption:{locked:!1,hidden:!1,allowEditInCell:!0},paddingTabOption:{text:"",alignment:GC.Spread.Sheets.LabelAlignment.topLeft,font:{fontFamily:s.fontPicker.fontFamilies.Calibri,fontSize:"11",fontStyle:!1,fontWeight:!1,foreColor:"#808080"},visibility:GC.Spread.Sheets.LabelVisibility.auto,margin:{top:0,right:0,left:0,bottom:0},padding:{top:0,right:0,left:0,bottom:0}}};return a.fontTabOption||(a.fontTabOption={fontFamily:"Calibri",fontStyle:"normal",fontSize:"11",fontWeight:"normal",foreColor:"#000000",fontUnderlineListAndEffects:{fontUnderlineList:"none",fontEffects:{fontStrikethrough:!1},textDecoration:0}}),{range:n,style:a,state:GC.Spread.Sheets.CellStatesType.hover,sheetName:t.name(),isReportSheet:C._isReportSheet(e&&e.getActiveSheetTab())}}function Sce(e){let t=[],i=C.getActiveSheet(e).cellStates.all();return i&&i.forEach(n=>{let a={state:n.state};n.range&&(a.range=Ht.parseRangeToExpString(n.range,!1)),n.style&&(a.style=$s(e,n.style,"1234")),t.unshift(a)}),t}function Cce(e,t){let i={},n=new GC.Spread.Sheets.Style;for(const a of Object.keys(e))["borderBottom","borderLeft","borderRight","borderTop","diagonalDown","diagonalUp"].indexOf(a)>-1&&(i[a]=e[a],delete e[a]);return Object.keys(i).length>0&&yce(n,i),vce(n,e,t),n}function yce(e,t){t.borderTop&&(e.borderTop=new GC.Spread.Sheets.LineBorder(t.borderTop.color,t.borderTop.style)),t.borderBottom&&(e.borderBottom=new GC.Spread.Sheets.LineBorder(t.borderBottom.color,t.borderBottom.style)),t.borderRight&&(e.borderRight=new GC.Spread.Sheets.LineBorder(t.borderRight.color,t.borderRight.style)),t.borderLeft&&(e.borderLeft=new GC.Spread.Sheets.LineBorder(t.borderLeft.color,t.borderLeft.style)),t.diagonalUp&&(e.diagonalUp=new GC.Spread.Sheets.LineBorder(t.diagonalUp.color,t.diagonalUp.style)),t.diagonalDown&&(e.diagonalDown=new GC.Spread.Sheets.LineBorder(t.diagonalDown.color,t.diagonalDown.style))}function vce(e,t,i){let n=t,a,r,o,l;for(const c of Object.keys(n))if(c==="font"){let d=n[c];for(const u of Object.keys(d))if(u==="fontSize")a=d[u]+"pt";else if(u==="fontStyle"&&d[u]){let h=d[u];h==="italic"?(o="italic",l="normal"):h==="bold"?(o="normal",l="bold"):h==="bold italic"?(o="italic",l="bold"):h==="normal"&&(o="normal",l="normal")}else u==="fontFamily"&&d[u]&&(r=d[u])}if(o||a||l||r){r=r||"Calibri",a=a||"11pt";let c=`${o||""} ${l||""} ${a} ${r}`,d=C.getMeasureSpan();d.style.font=c,e.font=d.style.font||void 0}for(const c of Object.keys(n))if(["LT","RT","LB","RB","cornerFoldSize","cornerFoldColor","styleDecorationIcons"].indexOf(c)>-1){xce(n);break}for(const c of Object.keys(n))if(c==="formatter"){let d=n[c]&&n[c].trim(),u=!0;if(d&&d[0]!=="="&&d.match(/\{\{=.*\}\}/)===null)try{new GC.Spread.Formatter.GeneralFormatter(d,"")}catch(h){u=!1,i==null||i._showMessageBox(h.message,s.title,Re.warning)}u&&(e[c]=n[c])}else c!=="merged"&&c!=="font"&&(e[c]=n[c])}function xce(e){let t={position:0,size:0,color:""};if(e.LT&&(t.position=GC.Spread.Sheets.CornerPosition.leftTop),delete e.LT,e.RT&&(t.position|=GC.Spread.Sheets.CornerPosition.rightTop),delete e.RT,e.LB&&(t.position|=GC.Spread.Sheets.CornerPosition.leftBottom),delete e.LB,e.RB&&(t.position|=GC.Spread.Sheets.CornerPosition.rightBottom),delete e.RB,e.cornerFoldSize!==void 0&&(t.size=e.cornerFoldSize,delete e.cornerFoldSize),e.cornerFoldColor!==void 0&&(t.color=e.cornerFoldColor,delete e.cornerFoldColor),t.size===0||t.color===""||(C.isNullOrUndefined(e.decoration)?e.decoration={cornerFold:t}:e.decoration.cornerFold=t),!C.isNullOrUndefined(e.styleDecorationIcons)){let i=e.styleDecorationIcons.filter(n=>!C.isEmpty(n.src));C.isNullOrUndefined(e.decoration)?C.isEmpty(i)?e.decoration=void 0:e.decoration={icons:i}:C.isEmpty(i)?delete e.decoration.icons:e.decoration.icons=i,delete e.styleDecorationIcons}}function Lce(e,t){let i="Designer."+t;e.commandManager().register(i,x_,void 0,!1,!1,!1,!1)}function v_(e,t,i){oe.runCommand(e,"addCellState",x_,{cellStates:t,isAddCellState:i})}class Tce extends oe.DesignerActionBase{executeImp(t,i,n){let a=i.cellStates,r=C.getActiveSheet(t);if(!i.isAddCellState){let l=r.cellStates;l.all().forEach(d=>{l.remove(d.range,d.state)})}let o=C.getSheetOrSheetTabByName(t,i.sheetName).cellStates;for(let l of a)if(l&&l.range){let c=Ht.parseExpStringToRanges(l.range,r);if(c!=null){let d=c[0].ranges[0];d&&o.add(d,l.state,Cce(l.style,t))}}}}let x_={canUndo:!0,execute:function(e,t,i){return new Tce(e,t).execute(e,t,i)}};_e(G.NewCellStateTemplate,bce);let wce={text:"${res.cellStatesDialog.add}",iconClass:"ribbon-button-add-cellstates",commandName:p.AddCellState,execute:async(e,t)=>{let i=y_(e.Spread),n=Ke(i.style),a=await e._showDialog(G.NewCellStateTemplate,i,Dce);if(a){if(a.style){let r=Cn(n,a.style);a.style=r}v_(e.Spread,[a],!0)}},init:e=>{Lce(e.Spread,"addCellState")}};function Dce(e,t){var a;e.range.indexOf("=")===-1&&(e.range="=".concat(e.range));let i=(a=Pe.getContextSpread())==null?void 0:a.getSheetFromName(e.sheetName);if(!i)return!1;let n=Ht.parseExpStringToRanges(e.range,i);return!n||n.length!==1||n[0].sheetName!==e.sheetName?(t==null||t._showMessageBox(s.cellStatesDialog.invalidSheet,s.title,Re.error),!1):!0}const Ace=Object.freeze(Object.defineProperty({__proto__:null,addCellStatesCommand:wce},Symbol.toStringTag,{value:"Module"}));let Pce=function(){return{templateName:G.CellStateManagerTemplate,title:s.cellStatesDialog.manage,content:[{type:"FlexContainer",children:[{type:"TextBlock",text:s.cellStatesDialog.list},{type:"CellStateManager",bindingPath:"rules"}]}]}};_e(G.CellStateManagerTemplate,Pce);let Ice={text:"${res.cellStatesDialog.manage}",iconClass:"ribbon-button-manage-cellstates",commandName:p.ManageCellState,execute:async(e,t)=>{let i={rules:{ruleItems:Sce(e.Spread),newItem:y_(e.Spread)}},n=Ke(i.rules.newItem.style);i.rules.newItem.style.protectionTabOption&&i.rules.newItem.style.protectionTabOption.allowEditInCell===void 0&&(i.rules.newItem.style.protectionTabOption.allowEditInCell=!1);let a=await e._showDialog(G.CellStateManagerTemplate,i);if(!a)return;let r=e.Spread;r.suspendPaint();try{let o=[];for(let l=a.rules.ruleItems.length-1;l>=0;l--){let c=a.rules.ruleItems[l];if(c){let d=Cn(n,c.style);c.style=d}o.push(c)}v_(r,o)}finally{r.resumePaint()}}};const Mce=Object.freeze(Object.defineProperty({__proto__:null,managerCellStates:Ice},Symbol.toStringTag,{value:"Module"}));function kce(){return{type:"FlexContainer",className:"gc-rule-style-combo-editor",children:[{type:"ListComboEditor",id:"c_style",popupWidth:220,items:[{text:s.conditionalFormatting.withStyle.lightRedFill_DarkRedText,value:"lightRedFill_DarkRedText"},{text:s.conditionalFormatting.withStyle.yellowFill_DarkYellowText,value:"yellowFill_DarkYellowText"},{text:s.conditionalFormatting.withStyle.greenFill_DarkGreenText,value:"greenFill_DarkGreenText"},{text:s.conditionalFormatting.withStyle.lightRedFill,value:"lightRedFill"},{text:s.conditionalFormatting.withStyle.redText,value:"redText"},{text:s.conditionalFormatting.withStyle.redBorder,value:"redBorder"},{text:s.conditionalFormatting.withStyle.customFormat,value:"customFormat"}]}]}}var Rce=Object.getOwnPropertyDescriptor,_ce=(e,t,i,n)=>{for(var a=n>1?void 0:n?Rce(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};let L_=class extends Bt{constructor(){super(...arguments),this._dialogOwner=Pe.getDialogOwner()}set value(e){this._value=e}get value(){let e={};switch(this.c_style.selectIndex){case 0:e={fontTabOption:{foreColor:"#8B0000"},fillTabOption:{backColor:"#FFB6C1"}};break;case 1:e={fontTabOption:{foreColor:"#BDB76B"},fillTabOption:{backColor:"#F0E68C"}};break;case 2:e={fontTabOption:{foreColor:"#006400"},fillTabOption:{backColor:"#90EE90"}};break;case 3:e={fillTabOption:{backColor:"#FFB6C1"}};break;case 4:e={fontTabOption:{foreColor:"#8B0000"}};break;case 5:e={borderTabOption:{borderBottom:new GC.Spread.Sheets.LineBorder("#8B0000",1),borderLeft:new GC.Spread.Sheets.LineBorder("#8B0000",1),borderTop:new GC.Spread.Sheets.LineBorder("#8B0000",1),borderRight:new GC.Spread.Sheets.LineBorder("#8B0000",1)}};break;case 6:e=this._value;break}return e}get c_style(){return this.getComponent("c_style")}getComponentJson(){return[kce()]}raiseValueChanged(){this.fire(Bt.ValueChanged,this._options)}onMounted(){let e=this.c_style&&this.c_style.value;this.c_style&&!e&&(this.c_style.value="lightRedFill_DarkRedText")}_attachEvent(){this.c_style.on(zt.ValueChanged,()=>{this.c_style.value==="customFormat"&&this.onCustomFormatClick()})}async onCustomFormatClick(){this._value=this._value||{numberTabOption:{cellValue:"12345"},fontTabOption:{foreColor:"",fontFamily:"",fontSize:"",fontStyle:"normal",fontWeight:"normal",textDecoration:GC.Spread.Sheets.TextDecorationType.none,disableFontFamily:!0,disableFontSize:!0,disableFontWeight:!0}},this._value.dialogOption={activeTab:dt.Font,showTabList:[dt.Number,dt.Font,dt.Border,dt.Fill]};let e=await this._dialogOwner._showDialog(G.ConditionalFormatDialogTemplate,this._value);e&&(this._value=e)}beforeDestroy(){this.raiseValueChanged()}};L_=_ce([Ue.Register("RuleStyleComboEditor")],L_);function Yo(e){let t=parseFloat(e);return!isNaN(t)&&isFinite(t)?t:e}function T_(e){let t=document.createElement("span");t.style.font=e;let i=t.style;return{fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight}}function ra(e,t){let i=new GC.Spread.Sheets.Style;if(e){e.numberTabOption&&e.numberTabOption.formatter!==void 0&&e.numberTabOption.formatter!=="General"&&(i.formatter=e.numberTabOption.formatter);let n;if(t){let a=C.getActualActiveSheet(t);a&&(n=a.getActualStyle(a.getActiveRowIndex(),a.getActiveColumnIndex()))}if(e.fontTabOption){let a="",r="",o="",l="",c=!1;if(n&&n.font&&({fontStyle:a,fontWeight:r,fontSize:o,fontFamily:l}=T_(n.font)),e.fontTabOption.fontStyle!==void 0&&(a=e.fontTabOption.fontStyle,c=!0),e.fontTabOption.fontWeight!==void 0&&(r=e.fontTabOption.fontWeight,c=!0),e.fontTabOption.fontSize!==void 0&&e.fontTabOption.fontSize!==""&&(o=e.fontTabOption.fontSize+"pt",c=!0),e.fontTabOption.fontFamily!==void 0&&e.fontTabOption.fontFamily!==""&&(l=e.fontTabOption.fontFamily,c=!0),c){i.fontWeight=r,i.fontStyle=a,e.fontTabOption.disableFontFamily!==!0&&(i.fontFamily=l),e.fontTabOption.disableFontSize!==!0&&(i.fontSize=o);let u=i.font,h=new RegExp("bold","g");if(u!=null&&u.match(h)){let g=u.match(h);g&&g.length===2&&(u=u.replace(/bold/i,"").trim())}i.font=u}let d=e.fontTabOption.fontUnderlineListAndEffects;d&&d.textDecoration!==void 0&&(i.textDecoration=d.textDecoration),e.fontTabOption.foreColor!==void 0&&(i.foreColor=e.fontTabOption.foreColor)}e.fillTabOption&&e.fillTabOption.backColor!==void 0&&(i.backColor=e.fillTabOption.backColor),e.borderTabOption&&(e.borderTabOption.borderTop&&(i.borderTop=Uu(e.borderTabOption.borderTop)),e.borderTabOption.borderBottom&&(i.borderBottom=Uu(e.borderTabOption.borderBottom)),e.borderTabOption.borderLeft&&(i.borderLeft=Uu(e.borderTabOption.borderLeft)),e.borderTabOption.borderRight&&(i.borderRight=Uu(e.borderTabOption.borderRight)),e.borderTabOption.diagonalUp&&(i.diagonalUp=Uu(e.borderTabOption.diagonalUp)),e.borderTabOption.diagonalDown&&(i.diagonalDown=Uu(e.borderTabOption.diagonalDown))),e.protectionTabOption&&(C.isNullOrUndefined(e.protectionTabOption.locked)||(i.locked=e.protectionTabOption.locked),C.isNullOrUndefined(e.protectionTabOption.hidden)||(i.hidden=e.protectionTabOption.hidden),C.isNullOrUndefined(e.protectionTabOption.allowEditInCell)||(i.allowEditInCell=e.protectionTabOption.allowEditInCell))}return i}function Uu(e){if(!e||e instanceof GC.Spread.Sheets.LineBorder)return e;let t=e.color||void 0,i=e.style||void 0;return new GC.Spread.Sheets.LineBorder(t,i)}const w_="=";function Jb(e,t){let i={type:"cellValue",cellValue:{operator:"between"},specificText:{operator:"containing"},dateOccurring:{operator:"yesterday"},ruleStyle:Yu(e,t)},n=o=>{let l=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators;switch(o){case l.between:return"between";case l.notBetween:return"notBetween";case l.equalsTo:return"equalTo";case l.notEqualsTo:return"notEqualTo";case l.greaterThan:return"greaterThan";case l.lessThan:return"lessThan";case l.greaterThanOrEqualsTo:return"greaterThanOrEqu";case l.lessThanOrEqualsTo:return"lessThanOrEqu"}},a=o=>{let l=GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators;switch(o){case l.contains:return"containing";case l.doesNotContain:return"notContaining";case l.beginsWith:return"beginningWith";case l.endsWith:return"endingWith"}},r=o=>{let l=GC.Spread.Sheets.ConditionalFormatting.DateOccurringType;switch(o){case l.yesterday:return"yesterday";case l.today:return"today";case l.tomorrow:return"tomorrow";case l.last7Days:return"last7days";case l.lastWeek:return"lastweek";case l.thisWeek:return"thisweek";case l.nextWeek:return"nextweek";case l.lastMonth:return"lastmonth";case l.thisMonth:return"thismonth";case l.nextMonth:return"nextmonth"}};if(t)switch(t.ruleType()){case GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule:i.type="cellValue",i.cellValue={value1:t.value1(),value2:t.value2()},i.cellValue.operator=n(t.operator());break;case GC.Spread.Sheets.ConditionalFormatting.RuleType.specificTextRule:i.type="specificText",i.specificText={value:t.text()},i.specificText.operator=a(t.operator());break;case GC.Spread.Sheets.ConditionalFormatting.RuleType.dateOccurringRule:i.type="dateOccurring",i.dateOccurring={};let l=r(t.type());l&&(i.dateOccurring.operator=l);break}return i}function D_(e,t){if(t)switch(t.type){case"cellValue":return Bce(e,t);case"specificText":return Fce(e,t);case"dateOccurring":return Gce(e,t);default:return Vce(e,t)}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function qo(e,t){let i;if(C.isNullOrUndefined(e)||e==="")return"";if(isNaN(Number(e)))e.startsWith("=")?i=e:i='="'+e+'"';else return e;if(t){let n=S0(t),a=A_(i,n);if(!Lm(a))throw s.conditionalFormatting.newFormattingRule.invalidFormulaError}return i}function Ju(e,t){if(C.isNullOrUndefined(e)||e==="")return"";const i=typeof e=="string",n=i&&e.startsWith(w_),a=S0(t);if(!n){let o,l=e;if(i&&GC.Spread.Formatter.GeneralFormatter)try{let c=new GC.Spread.Formatter.GeneralFormatter,d={};c.getPreferredDisplayFormatter(e,d),l=d.value}catch{}return l instanceof Date?(o=GC.Spread.CalcEngine.ExpressionType.number,l=C.toOADate(l)):typeof l=="boolean"?o=GC.Spread.CalcEngine.ExpressionType.boolean:typeof l=="number"?o=GC.Spread.CalcEngine.ExpressionType.number:o=GC.Spread.CalcEngine.ExpressionType.string,w_+Ece(S0(t),l,o)}const r=A_(e,a);if(!r||!Lm(r))throw s.conditionalFormatting.newFormattingRule.invalidFormulaError;return e}function S0(e){let t=C.getActiveSheet(e);if(!t){let i=e.getActiveSheetTab();C._isTableSheet(i)&&(t=i.getSheet())}return t}function A_(e,t){return GC.Spread.Sheets.CalcEngine.formulaToExpression(t,e)}function Oce(e,t,i){return GC.Spread.Sheets.CalcEngine.expressionToFormula(e,t,0,0,i)}function Ece(e,t,i){return Oce(e,{type:i,value:t},!1)}const Nce=[15,16,17];function Lm(e){if(e){if(Nce.indexOf(e.operatorType)!==-1||e.functionName==="LAMBDA"||e.type===GC.Spread.CalcEngine.ExpressionType.array)return!1;if(e.arguments){for(let t of e.arguments)if(!Lm(t))return!1}if(!Lm(e.value)||!Lm(e.value2))return!1}return!0}function Bce(e,t){let i=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators,n=GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule,a,r="",o="",l=i.between,c=ra(t.ruleStyle,e);if(t.cellValue)switch(r=Ju(t.cellValue.value1,e),o=Ju(t.cellValue.value2,e),t.cellValue.operator){case"between":l=i.between;break;case"notBetween":l=i.notBetween;break;case"equalTo":l=i.equalsTo;break;case"notEqualTo":l=i.notEqualsTo;break;case"greaterThan":l=i.greaterThan;break;case"lessThan":l=i.lessThan;break;case"greaterThanOrEqu":l=i.greaterThanOrEqualsTo;break;case"lessThanOrEqu":l=i.lessThanOrEqualsTo;break}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(n,a,c,l,r,o,void 0,void 0,void 0,void 0)}function Fce(e,t){let i=GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators,n=GC.Spread.Sheets.ConditionalFormatting.RuleType.specificTextRule,a,r="",o=i.contains,l=ra(t.ruleStyle,e);if(t.specificText)switch(r=t.specificText.value,t.specificText.operator){case"containing":o=i.contains;break;case"notContaining":o=i.doesNotContain;break;case"beginningWith":o=i.beginsWith;break;case"endingWith":o=i.endsWith;break}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(n,a,l,o,void 0,void 0,r,void 0,void 0,void 0)}function Gce(e,t){let i=GC.Spread.Sheets.ConditionalFormatting.DateOccurringType,n=GC.Spread.Sheets.ConditionalFormatting.RuleType.dateOccurringRule,a,r=i.yesterday,o=ra(t.ruleStyle,e);if(t.dateOccurring)switch(t.dateOccurring.operator){case"yesterday":r=i.yesterday;break;case"today":r=i.today;break;case"tomorrow":r=i.tomorrow;break;case"last7days":r=i.last7Days;break;case"lastweek":r=i.lastWeek;break;case"thisweek":r=i.thisWeek;break;case"nextweek":r=i.nextWeek;break;case"lastmonth":r=i.lastMonth;break;case"thismonth":r=i.thisMonth;break;case"nextmonth":r=i.nextMonth;break}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(n,a,o,void 0,void 0,void 0,void 0,void 0,r,void 0)}function Vce(e,t){let i=GC.Spread.Sheets.ConditionalFormatting.RuleType.formulaRule,n=ra(t.ruleStyle,e),a="",r="A1",o=[];if(e){let l=C.getActiveSheet(e);if(l){o=l.getSelections();let c=o[0];r=GC.Spread.Sheets.CalcEngine.rangeToFormula(c,0,0,GC.Spread.Sheets.CalcEngine.RangeReferenceRelative.allAbsolute)}else{let c=e.getActiveSheetTab();C._isTableSheet(c)&&(r="@")}}switch(t.type){case"blanks":a="ISBLANK("+r+")";break;case"noBlanks":a="NOT(ISBLANK("+r+"))";break;case"errors":a="ISERROR("+r+")";break;case"noErrors":a="NOT(ISERROR("+r+"))";break}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(i,o,n,void 0,void 0,void 0,void 0,"="+a,void 0,void 0)}const P_=()=>({dialogOption:{activeTab:dt.Font,showTabList:[dt.Number,dt.Font,dt.Border,dt.Fill]},numberTabOption:{category:{activeTab:"general"},cellValue:"12345"},fontTabOption:{foreColor:void 0,fontFamily:void 0,fontSize:void 0,fontStyle:void 0,fontWeight:void 0,fontUnderlineListAndEffects:{fontUnderlineList:"none",fontEffects:{fontStrikethrough:!1},textDecoration:void 0},disableFontFamily:!0,disableFontSize:!0,disableFontWeight:!0},fillTabOption:{backColor:void 0}});function Yu(e,t){var n;let i=C.deepClone((n=e==null?void 0:e.getData(m.ConditionalFormatRuleFormatDialogOptions))!=null?n:P_());if(t){let a=t.style();if(a){let r=C.parseFormat(a.formatter);if(i.numberTabOption={cellValue:"AaBcCcYyZz",formatter:a.formatter,category:{activeTab:C.transToCategoryStr((r==null?void 0:r.category)||"general").toLowerCase()}},a.font){const o=a.fontStyle===null?"normal":a.fontStyle,l=a.fontWeight===null?"normal":a.fontWeight;i.fontTabOption={disableFontFamily:!0,disableFontSize:!0,disableFontWeight:!0,foreColor:a.foreColor,fontFamily:"",fontSize:"",fontStyle:o,fontWeight:l,fontUnderlineListAndEffects:{fontUnderlineList:"none",textDecoration:a.textDecoration,fontEffects:{fontStrikethrough:!1}}}}else i.fontTabOption&&(i.fontTabOption.foreColor=a.foreColor);if(a.textDecoration!==void 0&&i.fontTabOption){let o=C.generateFontUnderlineListAndEffectsOptionByStyleTextDecoration(a.textDecoration);i.fontTabOption.fontUnderlineListAndEffects=o}i.borderTabOption={borderTop:a.borderTop,borderBottom:a.borderBottom,borderLeft:a.borderLeft,borderRight:a.borderRight,diagonalUp:a.diagonalUp,diagonalDown:a.diagonalDown,enableBorderHorizontal:!1,enableBorderVertical:!1},i.fillTabOption={backColor:a.backColor},i.protectionTabOption&&(i.protectionTabOption.locked=a.locked,i.protectionTabOption.hidden=a.hidden,i.protectionTabOption.allowEditInCell=a.allowEditInCell)}}return i}function C0(e,t){let i={ruleStyle:Yu(e,t)};if(t){let n=t.formula();!C.isNullOrUndefined(n)&&!M_(n)&&(n="="+n),i.value=n}return i}function I_(e,t){let i,n,a="";if(t){n=ra(t.ruleStyle,e);let r=qo(t.value,e);a=Hce(e,r)}if(a==="")throw s.formattingRulesManagerDialog.invalidFormulaEnter;return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.formulaRule,i,n,void 0,void 0,void 0,void 0,a,void 0,void 0)}function M_(e){return e&&typeof e=="string"?e.toString().charAt(0)==="=":!1}function Hce(e,t){if(e&&M_(t)){let i=C.getActualActiveSheet(e);if(!i)return t;let n=i.getSelections();if(!n||!n.length)return t;let a=n[0].row,r=n[0].col;for(let l=1;l<n.length;l++){let c=n[l];a=a<=c.row?a:c.row,r=r<=c.col?r:c.col}a=a<0?0:a,r=r<0?0:r;let o=GC.Spread.Sheets.CalcEngine.formulaToExpression(i,t,a,r);return"="+GC.Spread.Sheets.CalcEngine.expressionToFormula(i,o,a,r)}return t}let zce={title:"${res.ribbon.home.conditionFormat}",text:"${res.ribbon.home.conditionFormat}",iconClass:"ribbon-button-conditionalformat",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ConditionFormat,direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")',enableContext:`${m.AllowFormatCells} && !${m.IsInTableSheetDesignMode} && ${re.tableSheetSelectedExcludeGroupColumn} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,init:e=>{e.getData(m.ConditionalFormatRuleFormatDialogOptions)||e.setData(m.ConditionalFormatRuleFormatDialogOptions,P_())}};const jce=Object.freeze(Object.defineProperty({__proto__:null,ConditionalFormat:zce},Symbol.toStringTag,{value:"Module"}));let Wce={commandName:p.ClearRules,text:"${res.conditionalFormat.clearRules}",iconClass:"ribbon-control-dropdown-clear-rules",direction:"horizontal"};const Zce=Object.freeze(Object.defineProperty({__proto__:null,clearRules:Wce},Symbol.toStringTag,{value:"Module"}));function Uce(e,t){let i="Designer."+t;e.commandManager().register(i,R_,void 0,!1,!1,!1,!1)}function k_(e,t){oe.runCommand(e,"clearRule",R_,{isFromEntireSheet:t})}let R_={canUndo:!0,execute:function(e,t,i){return new Jce(e,t).execute(e,t,i)}};class Jce extends oe.DesignerActionBase{executeImp(t,i,n){let a=this,o=C.getActiveSheet(t).getSelections();if(i.isFromEntireSheet)a.sheet().conditionalFormats.clearRule();else for(let l=0;l<o.length;l++)a.sheet().conditionalFormats.removeRuleByRange(o[l].row,o[l].col,o[l].rowCount,o[l].colCount)}}let Yce={text:"${res.conditionalFormat.clearRulesFromEntireSheet}",commandName:p.ClearSheetRules,execute:(e,t,i)=>{k_(e.Spread,!0),e.setData(re.isFileModified,!0)},init:e=>{Uce(e.Spread,"clearRule")}};const qce=Object.freeze(Object.defineProperty({__proto__:null,clearRulesFromEntireSheet:Yce},Symbol.toStringTag,{value:"Module"}));let Kce={text:"${res.conditionalFormat.clearRulesFromSelectedCells}",commandName:p.ClearCellRules,execute:(e,t,i)=>{k_(e.Spread,!1),e.setData(re.isFileModified,!0)}};const Qce=Object.freeze(Object.defineProperty({__proto__:null,clearRulesFromSelectedCells:Kce},Symbol.toStringTag,{value:"Module"})),Xce=C.isNullOrUndefined;function $ce(e,t){let i="Designer."+t;e.commandManager().register(i,__,void 0,!1,!1,!1,!1)}function oa(e,t,i){oe.runCommand(e,"addRule",__,{isRemove:t,rule:i})}function ede(e){let t={},i=[];for(let n=0;n<e.length;n++){let a=e[n];Xce(t[a.pivotTableName])&&(t[a.pivotTableName]=[]),t[a.pivotTableName].push(n)}for(let n in t)if(t.hasOwnProperty(n)){let a=[],r=i.push({pivotTableName:n,ranges:a})-1;for(let o=0;o<t[n].length;o++)a=a.concat(e[t[n][o]].ranges);i[r].ranges=a}for(let n=i.length-1;n>=0;n--){let a=i[n];(!a.ranges||a.ranges.length<1)&&i.splice(n,1)}return i}function y0(e,t,i){if(!e.pivotTables){t.addRule(i);return}let n=i.ranges(),a={outsideRanges:[],insideRanges:[]};for(let r=0;r<n.length;r++){let o=Ae.spiltRangeByPivotTables(n[r],e);a.outsideRanges=a.outsideRanges.concat(o?o.outsideRanges:[]),a.insideRanges=a.insideRanges.concat(o?o.insideRanges:[])}if(a.outsideRanges.length>0)i.ranges(a.outsideRanges),t.addRule(i);else{let r=ede(a.insideRanges);if(r.length===1){let o=r[0].ranges,l=[];for(let d=0;d<o.length;d++){let u=o[d],h=e.pivotTables.getRangePivotAreas(u);if(h){for(let g in h)if(h.hasOwnProperty(g)){let f=h[g];l=l.concat(f);break}}}let c=e.pivotTables.get(r[0].pivotTableName);c&&c.addConditionalRule(l,i)}}}class tde extends oe.DesignerActionBase{executeImp(t,i,n){let a=this,r=a.sheet(),o=i.isRemove,l=r.conditionalFormats,c;if(o){c=i.rule;for(let d=l.count()-1;d>=0;d--){let u=l.getRule(d);if(u.ruleType()===c.ruleType()&&JSON.stringify(u.ranges())===JSON.stringify(c.ranges())){l.removeRule(u);break}}}else c=i.rule;y0(r,l,c)}}let __={canUndo:!0,execute:function(e,t,i){return new tde(e,t).execute(e,t,i)}};var Kn=(e=>(e.FormatOnValue="FormatOnValue",e.FormatContain="FormatContain",e.FormatRankedValue="FormatRankedValue",e.FormatAbove="FormatAbove",e.FormatUnique="FormatUnique",e.UseFormula="UseFormula",e.UseRowColumnStates="UseRowColumnStates",e))(Kn||{}),go=(e=>(e.ColorScale2="ColorScale2",e.ColorScale3="ColorScale3",e.DataBar="DataBar",e.IconSets="IconSets",e))(go||{});let qu=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType;function v0(e,t){let i={minType:qu.lowestValue,maxType:qu.highestValue,minValue:"("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.minSelector.lowest+")",maxValue:"("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.maxSelector.highest+")",color:{minColor:"#F00",maxColor:"#080",spread:t}};return e&&t&&(i.minType=e.minType(),i.maxType=e.maxType(),i.minValue=e.minValue(),i.maxValue=e.maxValue(),i.color={minColor:e.minColor(),maxColor:e.maxColor(),spread:t}),i.minType===qu.lowestValue&&(i.minValue="("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.minSelector.lowest+")"),i.maxType===qu.highestValue&&(i.maxValue="("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.maxSelector.highest+")"),i}function O_(e,t){var f,b,S,y;let i,n=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.lowestValue,a,r=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.highestValue,o=null,l,c=null,d,u,h,g;return t&&e&&(o=qo(t.minValue,e),c=qo(t.maxValue,e),d=(b=(f=t.color)==null?void 0:f.minColor)!=null?b:"#F00",h=(y=(S=t.color)==null?void 0:S.maxColor)!=null?y:"#080",n=t.minType,r=t.maxType,n===qu.lowestValue&&(o=null),r===qu.highestValue&&(c=null)),i=new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.twoScaleRule,n,o,d,a,l,u,r,c,h,g),i}let wd=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType;function x0(e,t){let i={minType:wd.lowestValue,midType:wd.percentile,maxType:wd.highestValue,minValue:"("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.minSelector.lowest+")",midValue:"50",maxValue:"("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.maxSelector.highest+")",color:{minColor:"#F00",midColor:"#FF0",maxColor:"#080",spread:t}};return e&&t&&(i.minType=e.minType(),i.midType=e.midType(),i.maxType=e.maxType(),i.minValue=e.minValue(),i.midValue=e.midValue(),i.maxValue=e.maxValue(),i.color={minColor:e.minColor(),midColor:e.midColor(),maxColor:e.maxColor(),spread:t},i.minType===wd.lowestValue&&(i.minValue="("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.minSelector.lowest+")"),i.maxType===wd.highestValue&&(i.maxValue="("+s.conditionalFormatting.newFormattingRule.formatOnValue.color2.maxSelector.highest+")")),i}function E_(e,t){var f,b,S,y,v,x;let i,n=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.lowestValue,a,r=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.highestValue,o=null,l,c=null,d,u,h,g;return t&&e&&(o=qo(t.minValue,e),l=qo(t.midValue,e),c=qo(t.maxValue,e),d=(b=(f=t.color)==null?void 0:f.minColor)!=null?b:"#F00",u=(y=(S=t.color)==null?void 0:S.midColor)!=null?y:"#FF0",h=(x=(v=t.color)==null?void 0:v.maxColor)!=null?x:"#080",n=t.minType,a=t.midType,r=t.maxType,n===wd.lowestValue&&(o=null),r===wd.highestValue&&(c=null)),i=new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule,n,o,d,a,l,u,r,c,h,g),i}let gc=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType;function N_(e){return e===gc.lowestValue||e===gc.highestValue||e===gc.automin||e===gc.automax}function L0(e){let t={};t.fillColor={color:"#F00"};let i={};i.borderColor={color:"#000"};let n={showBarOnly:!1,minType:gc.automin,minValue:"("+s.conditionalFormatting.newFormattingRule.formatOnValue.dataBar.auto+")",maxType:gc.automax,maxValue:"("+s.conditionalFormatting.newFormattingRule.formatOnValue.dataBar.auto+")",barAppearance:{fill:"solidFill",fillColor:"rgb(99, 142, 198)",border:"noBorder",borderColor:"rgb(0, 0, 0)",barDirection:"l2r"},negativeData:{negativeFill:{selectedValue:"apply",attachValues:t},enableBorder:!1,negativeBorder:{selectedValue:"apply",attachValues:i},axisPosition:GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic,axisColor:"#000"}};return e&&(n.showBarOnly=e.showBarOnly(),n.minType=e.minType(),n.minValue=e.minValue(),n.maxType=e.maxType(),n.maxValue=e.maxValue(),n.barAppearance&&(n.barAppearance.fill=e.gradient()?"gradientFill":"solidFill",n.barAppearance.fillColor=e.color(),n.barAppearance.border=e.showBorder()?"solidBorder":"noBorder",n.barAppearance.borderColor=e.borderColor(),n.barAppearance.barDirection=e.dataBarDirection()===GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight?"l2r":"r2l"),t.fillColor={color:e.negativeFillColor()||"#F00"},i.borderColor={color:e.negativeBorderColor()||"#000"},n.negativeData={negativeFill:{selectedValue:e.useNegativeFillColor()?"fillColor":"apply",attachValues:t},enableBorder:e.showBorder(),negativeBorder:{selectedValue:e.useNegativeBorderColor()?"borderColor":"apply",attachValues:i},axisPosition:e.axisPosition()||GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic,axisColor:e.axisColor()||"#000"}),n}function B_(e,t){let i,n,a=gc.lowestValue,r=gc.automax,o="",l="",c=!1,d="",u="",h=!1,g=!1,f=GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight,b=null;return t&&(a=t.minType,r=t.maxType,o=qo(t.minValue,e),l=qo(t.maxValue,e),N_(a)&&(o=null),N_(r)&&(l=null),c=t.showBarOnly||!1,d=t.barAppearance&&t.barAppearance.fillColor||"",u=t.barAppearance&&t.barAppearance.borderColor||"",b=t.negativeData,h=t.barAppearance&&t.barAppearance.fill==="gradientFill"||!1,g=t.barAppearance&&t.barAppearance.border==="solidBorder"||!1,f=t.barAppearance&&t.barAppearance.barDirection==="l2r"?GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight:GC.Spread.Sheets.ConditionalFormatting.BarDirection.rightToLeft),i=new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(a,Yo(o),r,Yo(l),d,n),i.showBarOnly(c),i.gradient(h),i.borderColor(u),i.showBorder(g),i.dataBarDirection(f),b&&(i.negativeFillColor(b.negativeFill.attachValues.fillColor.color),i.useNegativeFillColor(b.negativeFill.selectedValue==="fillColor"),i.negativeBorderColor(b.negativeBorder.attachValues.borderColor.color),i.useNegativeBorderColor(b.negativeBorder.selectedValue==="borderColor"),i.axisColor(b.axisColor),i.axisPosition(b.axisPosition)),i}function T0(e,t,i){let n={ruleStyle:Yu(e,t)};return t?(n.direction=t.isRow()?1:0,n.state=t.state()):(n.direction=1,n.state=GC.Spread.Sheets.RowColumnStates.hover),n.isReportSheet=C._isReportSheet(i&&i.getActiveSheetTab()),n}function F_(e,t){let i,n,a=!0,r;return t&&(n=ra(t.ruleStyle,e),a=t.direction===1,r=t.state,i||(i=C.getActualActiveSheet(e).getSelections())),new GC.Spread.Sheets.ConditionalFormatting.StateRule(a?GC.Spread.Sheets.ConditionalFormatting.RuleType.rowStateRule:GC.Spread.Sheets.ConditionalFormatting.RuleType.columnStateRule,r,n,i)}function w0(e,t){let i={type:"duplicate",ruleStyle:Yu(e,t)};if(t){let n=t.ruleType();n===GC.Spread.Sheets.ConditionalFormatting.RuleType.duplicateRule?i.type="duplicate":n===GC.Spread.Sheets.ConditionalFormatting.RuleType.uniqueRule&&(i.type="unique")}return i}function G_(e,t){let i=GC.Spread.Sheets.ConditionalFormatting.RuleType,n,a,r=i.duplicateRule;if(t)switch(a=ra(t.ruleStyle,e),t.type){case"duplicate":r=i.duplicateRule;break;case"unique":r=i.uniqueRule;break}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(r,n,a,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function D0(e,t){let i={type:"above",ruleStyle:Yu(e,t)};if(t){let n=GC.Spread.Sheets.ConditionalFormatting.AverageConditionType;switch(t.type()){case n.above:i.type="above";break;case n.below:i.type="below";break;case n.equalOrAbove:i.type="equalOrAbove";break;case n.equalOrBelow:i.type="equalOrBelow";break;case n.above1StdDev:i.type="above1StdDev";break;case n.below1StdDev:i.type="below1StdDev";break;case n.above2StdDev:i.type="above2StdDev";break;case n.below2StdDev:i.type="below2StdDev";break;case n.above3StdDev:i.type="above3StdDev";break;case n.below3StdDev:i.type="below3StdDev";break}}return i}function V_(e,t){let i=GC.Spread.Sheets.ConditionalFormatting.AverageConditionType,n,a,r=i.above;if(t)switch(a=ra(t.ruleStyle,e),t.type){case"above":r=i.above;break;case"below":r=i.below;break;case"equalOrAbove":r=i.equalOrAbove;break;case"equalOrBelow":r=i.equalOrBelow;break;case"above1StdDev":r=i.above1StdDev;break;case"below1StdDev":r=i.below1StdDev;break;case"above2StdDev":r=i.above2StdDev;break;case"below2StdDev":r=i.below2StdDev;break;case"above3StdDev":r=i.above3StdDev;break;case"below3StdDev":r=i.below3StdDev;break}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.averageRule,n,a,null,void 0,void 0,void 0,void 0,r,void 0)}function A0(e,t){let i={type:"top",rank:10,ruleStyle:Yu(e,t)};if(t){let n=t.type();n===GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top?i.type="top":n===GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.bottom&&(i.type="bottom"),i.rank=t.rank()}return i}function H_(e,t){let i=GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType,n,a,r=i.top,o=10;if(t){switch(a=ra(t.ruleStyle,e),t.type){case"top":r=i.top;break;case"bottom":r=i.bottom;break}o=t.rank||10}return new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule,n,a,null,void 0,void 0,void 0,void 0,r,o)}var Xe=(e=>(e[e.UpArrowGreen=0]="UpArrowGreen",e[e.RightArrowYellow=1]="RightArrowYellow",e[e.DownArrowRed=2]="DownArrowRed",e[e.UpArrowGray=3]="UpArrowGray",e[e.RightArrowGray=4]="RightArrowGray",e[e.DownArrowGray=5]="DownArrowGray",e[e.UpTriangleGreen=6]="UpTriangleGreen",e[e.MinusYellow=7]="MinusYellow",e[e.DownTriangleRed=8]="DownTriangleRed",e[e.RightUpArrowGray=9]="RightUpArrowGray",e[e.RightDownArrowGray=10]="RightDownArrowGray",e[e.RightUpArrowYellow=11]="RightUpArrowYellow",e[e.RightDownArrowYellow=12]="RightDownArrowYellow",e[e.TrafficLightGreen=13]="TrafficLightGreen",e[e.TrafficLightYellow=14]="TrafficLightYellow",e[e.TrafficLightRed=15]="TrafficLightRed",e[e.TrafficLightRimmedGreen=16]="TrafficLightRimmedGreen",e[e.TrafficLightRimmedYellow=17]="TrafficLightRimmedYellow",e[e.TrafficLightRimmedRed=18]="TrafficLightRimmedRed",e[e.UpTriangleYellow=19]="UpTriangleYellow",e[e.DownRhombusRed=20]="DownRhombusRed",e[e.TrafficLightBlack=21]="TrafficLightBlack",e[e.BallRed=22]="BallRed",e[e.BallPink=23]="BallPink",e[e.BallGray=24]="BallGray",e[e.BallBlack=25]="BallBlack",e[e.CheckCircledGreen=26]="CheckCircledGreen",e[e.NoticeCircledYellow=27]="NoticeCircledYellow",e[e.CloseCircledRed=28]="CloseCircledRed",e[e.CheckUncircledGreen=29]="CheckUncircledGreen",e[e.NoticeUncircledYellow=30]="NoticeUncircledYellow",e[e.CloseUncircledRed=31]="CloseUncircledRed",e[e.FlagGreen=32]="FlagGreen",e[e.FlagYellow=33]="FlagYellow",e[e.FlagRed=34]="FlagRed",e[e.StarSolid=35]="StarSolid",e[e.StarHalf=36]="StarHalf",e[e.StarHollow=37]="StarHollow",e[e.Rating4=38]="Rating4",e[e.Rating3=39]="Rating3",e[e.Rating2=40]="Rating2",e[e.Rating1=41]="Rating1",e[e.Rating0=42]="Rating0",e[e.Quarters4=43]="Quarters4",e[e.Quarters3=44]="Quarters3",e[e.Quarters2=45]="Quarters2",e[e.Quarters1=46]="Quarters1",e[e.Quarters0=47]="Quarters0",e[e.Box4=48]="Box4",e[e.Box3=49]="Box3",e[e.Box2=50]="Box2",e[e.Box1=51]="Box1",e[e.Box0=52]="Box0",e[e.None=53]="None",e))(Xe||{});const Mn={threeArrowsColored:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored,icons:[Xe.UpArrowGreen,Xe.RightArrowYellow,Xe.DownArrowRed],iconClass:"three-arrows-colored"},threeArrowsGray:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsGray,icons:[Xe.UpArrowGray,Xe.RightArrowGray,Xe.DownArrowGray],iconClass:"three-arrows-gray"},threeTriangles:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTriangles,icons:[Xe.UpTriangleGreen,Xe.MinusYellow,Xe.DownTriangleRed],iconClass:"three-triangles"},threeStars:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeStars,icons:[Xe.StarSolid,Xe.StarHalf,Xe.StarHollow],iconClass:"three-stars"},threeFlags:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeFlags,icons:[Xe.FlagGreen,Xe.FlagYellow,Xe.FlagRed],iconClass:"three-flags"},threeTrafficLightsUnrimmed:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsUnrimmed,icons:[Xe.TrafficLightGreen,Xe.TrafficLightYellow,Xe.TrafficLightRed],iconClass:"three-traffic-lights-unrimmed"},threeTrafficLightsRimmed:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsRimmed,icons:[Xe.TrafficLightRimmedGreen,Xe.TrafficLightRimmedYellow,Xe.TrafficLightRimmedRed],iconClass:"three-traffic-lights-rimmed"},threeSigns:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSigns,icons:[Xe.TrafficLightGreen,Xe.UpTriangleYellow,Xe.DownRhombusRed],iconClass:"three-signs"},threeSymbolsCircled:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsCircled,icons:[Xe.CheckCircledGreen,Xe.NoticeCircledYellow,Xe.CloseCircledRed],iconClass:"three-symbols-circled"},threeSymbolsUncircled:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsUncircled,icons:[Xe.CheckUncircledGreen,Xe.NoticeUncircledYellow,Xe.CloseUncircledRed],iconClass:"three-symbols-uncircled"},fourArrowsColored:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored,icons:[Xe.UpArrowGreen,Xe.RightUpArrowYellow,Xe.RightDownArrowYellow,Xe.DownArrowRed],iconClass:"four-arrows-colored"},fourArrowsGray:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray,icons:[Xe.UpArrowGray,Xe.RightUpArrowGray,Xe.RightDownArrowGray,Xe.DownArrowGray],iconClass:"four-arrows-gray"},fourRedToBlack:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack,icons:[Xe.BallRed,Xe.BallPink,Xe.BallGray,Xe.BallBlack],iconClass:"four-red-to-black"},fourRatings:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings,icons:[Xe.Rating3,Xe.Rating2,Xe.Rating1,Xe.Rating0],iconClass:"four-ratings"},fourTrafficLights:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights,icons:[Xe.TrafficLightGreen,Xe.TrafficLightYellow,Xe.TrafficLightRed,Xe.TrafficLightBlack],iconClass:"four-traffic-lights"},fiveArrowsColored:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored,icons:[Xe.UpArrowGreen,Xe.RightUpArrowYellow,Xe.RightArrowYellow,Xe.RightDownArrowYellow,Xe.DownArrowRed],iconClass:"five-arrows-colored"},fiveArrowsGray:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray,icons:[Xe.UpArrowGray,Xe.RightUpArrowGray,Xe.RightArrowGray,Xe.RightDownArrowGray,Xe.DownArrowGray],iconClass:"five-arrows-gray"},fiveRatings:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings,icons:[Xe.Rating4,Xe.Rating3,Xe.Rating2,Xe.Rating1,Xe.Rating0],iconClass:"five-ratings"},fiveQuarters:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters,icons:[Xe.Quarters4,Xe.Quarters3,Xe.Quarters2,Xe.Quarters1,Xe.Quarters0],iconClass:"five-quarters"},fiveBoxes:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes,icons:[Xe.Box4,Xe.Box3,Xe.Box2,Xe.Box1,Xe.Box0],iconClass:"five-boxes"},noIcons:{value:GC.Spread.Sheets.ConditionalFormatting.IconSetType.noIcons,icons:[Xe.None],iconClass:"no-icon"}},z_={UpArrowGreen:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored],iconIndex:[0,0,0],iconClass:"icon-sets-icons up-arrow-green"},RightArrowYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored],iconIndex:[1,2],iconClass:"icon-sets-icons right-arrow-yellow"},DownArrowRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored],iconIndex:[2,3,4],iconClass:"icon-sets-icons down-arrow-red"},UpArrowGray:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsGray,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray],iconIndex:[0,0,0],iconClass:"icon-sets-icons up-arrow-gray"},RightArrowGray:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsGray,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray],iconIndex:[1,2],iconClass:"icon-sets-icons right-arrow-gray"},DownArrowGray:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsGray,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray],iconIndex:[2,3,4],iconClass:"icon-sets-icons down-arrow-gray"},UpTriangleGreen:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTriangles],iconIndex:[0],iconClass:"icon-sets-icons up-triangle-green"},MinusYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTriangles],iconIndex:[1],iconClass:"icon-sets-icons minus-yellow"},DownTriangleRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTriangles],iconIndex:[2],iconClass:"icon-sets-icons down-triangle-red"},RightUpArrowGray:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray],iconIndex:[1,1],iconClass:"icon-sets-icons right-up-arrow-gray"},RightUpArrowYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored],iconIndex:[1,1],iconClass:"icon-sets-icons right-up-arrow-yellow"},RightDownArrowGray:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray],iconIndex:[2,3],iconClass:"icon-sets-icons right-down-arrow-gray"},RightDownArrowYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored],iconIndex:[2,3],iconClass:"icon-sets-icons right-down-arrow-yellow"},TrafficLightGreen:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsUnrimmed,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSigns],iconIndex:[0,0,0],iconClass:"icon-sets-icons traffic-light-green"},TrafficLightYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsUnrimmed,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights],iconIndex:[1,1],iconClass:"icon-sets-icons traffic-light-yellow"},TrafficLightRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsUnrimmed,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights],iconIndex:[2,2],iconClass:"icon-sets-icons traffic-light-red"},TrafficLightRimmedGreen:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsRimmed],iconIndex:[0],iconClass:"icon-sets-icons traffic-light-rimmed-green"},TrafficLightRimmedYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsRimmed],iconIndex:[1],iconClass:"icon-sets-icons traffic-light-rimmed-yellow"},TrafficLightRimmedRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsRimmed],iconIndex:[2],iconClass:"icon-sets-icons traffic-light-rimmed-red"},UpTriangleYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSigns],iconIndex:[1],iconClass:"icon-sets-icons up-triangle-yellow"},DownRhombusRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSigns],iconIndex:[2],iconClass:"icon-sets-icons down-rhombus-red"},TrafficLightBlack:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights],iconIndex:[3],iconClass:"icon-sets-icons traffic-light-black"},BallRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack],iconIndex:[0],iconClass:"icon-sets-icons ball-red"},BallPink:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack],iconIndex:[1],iconClass:"icon-sets-icons ball-pink"},BallGray:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack],iconIndex:[2],iconClass:"icon-sets-icons ball-gray"},BallBlack:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack],iconIndex:[3],iconClass:"icon-sets-icons ball-black"},CheckCircledGreen:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsCircled],iconIndex:[0],iconClass:"icon-sets-icons check-circled-green"},NoticeCircledYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsCircled],iconIndex:[1],iconClass:"icon-sets-icons notice-circled-yellow"},CloseCircledRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsCircled],iconIndex:[2],iconClass:"icon-sets-icons close-circled-red"},CheckUncircledGreen:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsUncircled],iconIndex:[0],iconClass:"icon-sets-icons check-uncircled-green"},NoticeUncircledYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsUncircled],iconIndex:[1],iconClass:"icon-sets-icons notice-uncircled-yellow"},CloseUncircledRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsUncircled],iconIndex:[2],iconClass:"icon-sets-icons close-uncircled-red"},FlagGreen:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeFlags],iconIndex:[0],iconClass:"icon-sets-icons flag-green"},FlagYellow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeFlags],iconIndex:[1],iconClass:"icon-sets-icons flag-yellow"},FlagRed:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeFlags],iconIndex:[2],iconClass:"icon-sets-icons flag-red"},StarSolid:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeStars],iconIndex:[0],iconClass:"icon-sets-icons star-solid"},StarHalf:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeStars],iconIndex:[1],iconClass:"icon-sets-icons star-half"},StarHollow:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeStars],iconIndex:[2],iconClass:"icon-sets-icons star-hollow"},Quarters4:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters],iconIndex:[0],iconClass:"icon-sets-icons quarters-4"},Quarters3:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters],iconIndex:[1],iconClass:"icon-sets-icons quarters-3"},Quarters2:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters],iconIndex:[2],iconClass:"icon-sets-icons quarters-2"},Quarters1:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters],iconIndex:[3],iconClass:"icon-sets-icons quarters-1"},Quarters0:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters],iconIndex:[4],iconClass:"icon-sets-icons quarters-0"},Rating4:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings],iconIndex:[0],iconClass:"icon-sets-icons rating-4"},Rating3:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings],iconIndex:[0,1],iconClass:"icon-sets-icons rating-3"},Rating2:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings],iconIndex:[1,2],iconClass:"icon-sets-icons rating-2"},Rating1:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings],iconIndex:[2,3],iconClass:"icon-sets-icons rating-1"},Rating0:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings],iconIndex:[3,4],iconClass:"icon-sets-icons rating-0"},Box4:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes],iconIndex:[0],iconClass:"icon-sets-icons box-4"},Box3:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes],iconIndex:[1],iconClass:"icon-sets-icons box-3"},Box2:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes],iconIndex:[2],iconClass:"icon-sets-icons box-2"},Box1:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes],iconIndex:[3],iconClass:"icon-sets-icons box-1"},Box0:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes],iconIndex:[4],iconClass:"icon-sets-icons box-0"},None:{iconSetTypes:[GC.Spread.Sheets.ConditionalFormatting.IconSetType.noIcons],iconIndex:[0],iconClass:"icon-sets-icons noIcon"}};function P0(e){let t={iconSetType:GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored,showIconOnly:!1,reverseIconOrder:!1,threeArrowsColored:la(Mn.threeArrowsColored.icons),threeArrowsGray:la(Mn.threeArrowsGray.icons),threeTriangles:la(Mn.threeTriangles.icons),threeStars:la(Mn.threeStars.icons),threeFlags:la(Mn.threeFlags.icons),threeTrafficLightsUnrimmed:la(Mn.threeTrafficLightsUnrimmed.icons),threeTrafficLightsRimmed:la(Mn.threeTrafficLightsRimmed.icons),threeSigns:la(Mn.threeSigns.icons),threeSymbolsCircled:la(Mn.threeSymbolsCircled.icons),threeSymbolsUncircled:la(Mn.threeSymbolsUncircled.icons),fourArrowsColored:la(Mn.fourArrowsColored.icons),fourArrowsGray:la(Mn.fourArrowsGray.icons),fourRedToBlack:la(Mn.fourRedToBlack.icons),fourRatings:la(Mn.fourRatings.icons),fourTrafficLights:la(Mn.fourTrafficLights.icons),fiveArrowsColored:la(Mn.fiveArrowsColored.icons),fiveArrowsGray:la(Mn.fiveArrowsGray.icons),fiveRatings:la(Mn.fiveRatings.icons),fiveQuarters:la(Mn.fiveQuarters.icons),fiveBoxes:la(Mn.fiveBoxes.icons)};if(e){t.iconSetType=e.iconSetType(),t.showIconOnly=e.showIconOnly(),t.reverseIconOrder=e.reverseIconOrder();let i=null;switch(t.iconSetType){case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored:i=t.threeArrowsColored;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsGray:i=t.threeArrowsGray;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTriangles:i=t.threeTriangles;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsUnrimmed:i=t.threeTrafficLightsUnrimmed;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsRimmed:i=t.threeTrafficLightsRimmed;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSigns:i=t.threeSigns;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsCircled:i=t.threeSymbolsCircled;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsUncircled:i=t.threeSymbolsUncircled;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeFlags:i=t.threeFlags;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeStars:i=t.threeStars;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored:i=t.fourArrowsColored;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray:i=t.fourArrowsGray;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights:i=t.fourTrafficLights;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack:i=t.fourRedToBlack;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings:i=t.fourRatings;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored:i=t.fiveArrowsColored;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray:i=t.fiveArrowsGray;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters:i=t.fiveQuarters;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings:i=t.fiveRatings;break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes:i=t.fiveBoxes;break}if(i){let n=e.iconCriteria();n.length===2?(ms(i.iconItem1,n[1]),ms(i.iconItem2,n[0])):n.length===3?(ms(i.iconItem1,n[2]),ms(i.iconItem2,n[1]),ms(i.iconItem3,n[0])):n.length===4&&(ms(i.iconItem1,n[3]),ms(i.iconItem2,n[2]),ms(i.iconItem3,n[1]),ms(i.iconItem4,n[0]));let a=e.icons(),r=Z_(t.iconSetType,a);if(a){let o=[];for(let l=0;l<a.length;l++)o[l]={iconSetType:a[l].iconSetType,iconIndex:a[l].iconIndex};i.icons=o.map(l=>lde(l.iconSetType,l.iconIndex,r))}(t.reverseIconOrder&&i.icons||r)&&i.icons.reverse()}}return t}function j_(e,t){let i;if(t){let n,a=t.iconSetType||GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored;i=new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(a,n),i.showIconOnly(t.showIconOnly),i.reverseIconOrder(t.reverseIconOrder),ide(i,t,a,e),ode(i,t,a)}return i}function ms(e,t){switch(e.operator=t.isGreaterThanOrEqualTo?"largeOrEqu":"large",e.value=fo(t.iconValue,null),t.iconValueType){case GC.Spread.Sheets.ConditionalFormatting.IconValueType.number:e.type="num";break;case GC.Spread.Sheets.ConditionalFormatting.IconValueType.percent:e.type="percent";break;case GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula:e.type="formula";break;case GC.Spread.Sheets.ConditionalFormatting.IconValueType.percentile:e.type="percentile";break}}function la(e){if(e.length===3)return{reverseIconOrder:!1,iconItem1:{icon:e[0],operator:"largeOrEqu",value:"67",type:"percent"},iconItem2:{icon:e[1],operator:"largeOrEqu",value:"33",type:"percent"},iconItem3:{icon:e[2]},icons:e.slice()};if(e.length===4)return{reverseIconOrder:!1,iconItem1:{icon:e[0],operator:"largeOrEqu",value:"75",type:"percent"},iconItem2:{icon:e[1],operator:"largeOrEqu",value:"50",type:"percent"},iconItem3:{icon:e[2],operator:"largeOrEqu",value:"25",type:"percent"},iconItem4:{icon:e[3]},icons:e.slice()};if(e.length===5)return{reverseIconOrder:!1,iconItem1:{icon:e[0],operator:"largeOrEqu",value:"80",type:"percent"},iconItem2:{icon:e[1],operator:"largeOrEqu",value:"60",type:"percent"},iconItem3:{icon:e[2],operator:"largeOrEqu",value:"40",type:"percent"},iconItem4:{icon:e[3],operator:"largeOrEqu",value:"20",type:"percent"},iconItem5:{icon:e[4]},icons:e.slice()}}function ide(e,t,i,n){let a=e.iconCriteria();switch(i){case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights:ade(t,i,a,n);break;case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters:case GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes:rde(t,i,a,n);break;default:nde(t,i,a,n);break}e.iconCriteria(a)}function nde(e,t,i,n){let a=e[GC.Spread.Sheets.ConditionalFormatting.IconSetType[t]],r=a.iconItem1.operator==="largeOrEqu",o=a.iconItem2.operator==="largeOrEqu",l=gs(a.iconItem1.type||""),c=gs(a.iconItem2.type||""),d=fo(a.iconItem1.value,n),u=fo(a.iconItem2.value,n),h=c!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(u):u;i[0]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(o,c,h);let g=l!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(d):d;i[1]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(r,l,g)}function ade(e,t,i,n){let a=e[GC.Spread.Sheets.ConditionalFormatting.IconSetType[t]],r=a.iconItem1.operator==="largeOrEqu",o=a.iconItem2.operator==="largeOrEqu",l=a.iconItem3.operator==="largeOrEqu",c=gs(a.iconItem1.type||""),d=gs(a.iconItem2.type||""),u=gs(a.iconItem3.type||""),h=fo(a.iconItem1.value,n),g=fo(a.iconItem2.value,n),f=fo(a.iconItem3.value,n),b=u!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(f):f;i[0]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(l,u,b);let S=d!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(g):g;i[1]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(o,d,S);let y=c!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(h):h;i[2]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(r,c,y)}function rde(e,t,i,n){let a=e[GC.Spread.Sheets.ConditionalFormatting.IconSetType[t]],r=a.iconItem1.operator==="largeOrEqu",o=a.iconItem2.operator==="largeOrEqu",l=a.iconItem3.operator==="largeOrEqu",c=a.iconItem4.operator==="largeOrEqu",d=gs(a.iconItem1.type||""),u=gs(a.iconItem2.type||""),h=gs(a.iconItem3.type||""),g=gs(a.iconItem4.type||""),f=fo(a.iconItem1.value,n),b=fo(a.iconItem2.value,n),S=fo(a.iconItem3.value,n),y=fo(a.iconItem4.value,n),v=g!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(y):y;i[0]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(c,g,v);let x=h!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(S):S;i[1]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(l,h,x);let L=u!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(b):b;i[2]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(o,u,L);let T=d!==GC.Spread.Sheets.ConditionalFormatting.IconValueType.formula?Yo(f):f;i[3]=new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(r,d,T)}function ode(e,t,i){let n=t[GC.Spread.Sheets.ConditionalFormatting.IconSetType[i]],a=n.icons.map(o=>W_(o,i));e.reverseIconOrder()&&a.reverse();let r=Z_(i,a);if(r&&(a=n.icons.map(o=>W_(o,i,r)),a.reverse()),r&&a&&a.length>0){let o=e.icons();for(let l=0;l<a.length;l++)o[l]={iconSetType:a[l].iconSetType,iconIndex:a[l].iconIndex};e.icons(o),e._isCustomIconSet=!0}}function W_(e,t,i){let n=Xe[e],a=z_[n].iconSetTypes,r=z_[n].iconIndex,o=a.indexOf(t);o===-1&&(o=0);let l=a[o],c=GC.Spread.Sheets.ConditionalFormatting.IconSetType[l],u=Mn[c].icons.length;return{iconSetType:a[o],iconIndex:i?u-r[o]-1:r[o]}}function fo(e,t){return e&&typeof e=="string"&&e.toString().charAt(0)==="="&&!isNaN(parseInt(e.substring(1),10))?e.substring(1):e&&e.toString().charAt(0)!=="="&&!isNaN(e)?"="+e:(qo(e,t),e)}function gs(e){let t=GC.Spread.Sheets.ConditionalFormatting.IconValueType;switch(e){case"num":return t.number;case"percent":return t.percent;case"formula":return t.formula;case"percentile":return t.percentile}return t.number}function lde(e,t,i){let n=GC.Spread.Sheets.ConditionalFormatting.IconSetType[e];if(Mn[n]){let a=Mn[n].icons;if(a&&t>=0&&t<a.length)return i?a[a.length-t-1]:a[t]}return Xe.UpArrowGreen}function Z_(e,t){let i=!0,n=!0,a;for(a=0;a<t.length;a++)if(t[a].iconSetType!==e){i=!1;break}for(a=0;a<t.length;a++)if(parseInt(t[a].iconIndex,10)!==a){n=!1;break}return!i||!n}const sde=C.isNullOrUndefined;class bi{static getNewFormatRuleDialogOption(t,i){return{ruleTypeGroup:Kn.FormatOnValue,baseOnValueRuleType:go.ColorScale2,ruleScaleColor2:v0(void 0,i),ruleScaleColor3:x0(void 0,i),ruleDataBar:L0(),ruleIconSets:P0(),ruleFormatContain:Jb(t),ruleFormatAbove:D0(t),ruleFormatRankedValue:A0(t),ruleFormatUnique:w0(t),ruleUseFormula:C0(t),ruleUseRowColumnStates:T0(t,void 0,i)}}static ruleToRuleItem(t,i,n){let a=GC.Spread.Sheets.ConditionalFormatting.RuleType,r={ruleType:n.ruleType(),stopIfTrue:n.stopIfTrue(),ruleRange:cde(i,n),visible:n.visible,_idTag:n._idTag};switch(n.ruleType()){case a.cellValueRule:case a.specificTextRule:case a.dateOccurringRule:r.ruleValue=Jb(t,n);break;case a.duplicateRule:case a.uniqueRule:r.ruleValue=w0(t,n);break;case a.top10Rule:r.ruleValue=A0(t,n);break;case a.averageRule:r.ruleValue=D0(t,n);break;case a.dataBarRule:r.ruleValue=L0(n);break;case a.twoScaleRule:r.ruleValue=v0(n,i);break;case a.threeScaleRule:r.ruleValue=x0(n,i);break;case a.iconSetRule:r.ruleValue=P0(n);break;case a.formulaRule:r.ruleValue=C0(t,n);break;case a.rowStateRule:case a.columnStateRule:r.ruleValue=T0(t,n);break}return r}static ruleItemToRule(t,i){let n,a=GC.Spread.Sheets.ConditionalFormatting.RuleType;switch(i.ruleType){case a.cellValueRule:case a.specificTextRule:case a.dateOccurringRule:n=D_(t,i.ruleValue);break;case a.duplicateRule:case a.uniqueRule:n=G_(t,i.ruleValue);break;case a.top10Rule:n=H_(t,i.ruleValue);break;case a.averageRule:n=V_(t,i.ruleValue);break;case a.dataBarRule:n=B_(t,i.ruleValue);break;case a.twoScaleRule:n=O_(t,i.ruleValue);break;case a.threeScaleRule:n=E_(t,i.ruleValue);break;case a.iconSetRule:n=j_(t,i.ruleValue);break;case a.formulaRule:n=I_(t,i.ruleValue);break;case a.rowStateRule:case a.columnStateRule:n=F_(t,i.ruleValue);break}if(n){let r=Ae.stringToRange(t,i.ruleRange);n.ranges(r),n.stopIfTrue(i.stopIfTrue),n._idTag=i._idTag,n.visible=i.visible}return n}static ruleValueToRule(t,i){let n,a=r=>{switch(r){case go.ColorScale2:return O_(t,i.ruleScaleColor2);case go.ColorScale3:return E_(t,i.ruleScaleColor3);case go.DataBar:return B_(t,i.ruleDataBar);case go.IconSets:return j_(t,i.ruleIconSets)}};if(i)switch(i.ruleTypeGroup){case Kn.FormatOnValue:n=a(i.baseOnValueRuleType);break;case Kn.FormatContain:n=D_(t,i.ruleFormatContain);break;case Kn.FormatRankedValue:n=H_(t,i.ruleFormatRankedValue);break;case Kn.FormatAbove:n=V_(t,i.ruleFormatAbove);break;case Kn.FormatUnique:n=G_(t,i.ruleFormatUnique);break;case Kn.UseFormula:n=I_(t,i.ruleUseFormula);break;case Kn.UseRowColumnStates:n=F_(t,i.ruleUseRowColumnStates);break}return n}static applyRule(t,i){var n;t.suspendPaint();try{let a=C.getActualActiveSheet(t);if(a){let r=a.conditionalFormats;r.clearRule();let o=i.rules.ruleItems;for(let l=o.length-1;l>=0;l--){let c=bi.ruleItemToRule(t,o[l]);c&&y0(a,r,c)}}else{let r=t.getActiveSheetTab();if(C._isTableSheet(r)&&r.getDataView()){let l=(n=Pe.getContextDesigner())==null?void 0:n.getData(re.tableSheetSelectedColumn);if(!sde(l)&&l>=0){let c=[];I0(i,c),Oi(t,l,"conditionalFormats",c,kn.overwrite)}}}}finally{t.resumePaint()}}static validateConditionalFormatDialogFormula(t,i){try{bi.ruleValueToRule(Pe.getContextSpread(),t)}catch(n){let a=n===s.conditionalFormatting.newFormattingRule.invalidFormulaError?["gc-ribbon-condition-format-invalid-dialog"]:void 0;return i==null||i._showMessageBox(n,s.title,Re.warning,vt.ok,{classNames:a}),!1}return!0}static validateConditionalFormatHighLightCellsRulesFormula(t,i){try{t.value1!==void 0&&qo(t.value1,Pe.getContextSpread()),t.value2!==void 0&&qo(t.value2,Pe.getContextSpread())}catch(n){let a=n===s.conditionalFormatting.newFormattingRule.invalidFormulaError?["gc-ribbon-condition-format-invalid-dialog"]:void 0;return i==null||i._showMessageBox(n,s.title,Re.warning,vt.ok,{classNames:a}),!1}return!0}}function cde(e,t){let i="",n=t.ranges();if(n)for(let a=0;a<n.length;a++){let r=n[a],o=GC.Spread.Sheets.CalcEngine.rangeToFormula(r,0,0,GC.Spread.Sheets.CalcEngine.RangeReferenceRelative.allAbsolute,Ae.isUseR1C1(e));i=i+(a===0?"":",")+o}return i.startsWith("=")||(i="="+i),i}function dde(){return{templateName:G.TableSheetRuleManagerDialogTemplate,title:s.formattingRulesManagerDialog.title,content:[{type:"FlexContainer",children:[{type:"RuleManagerEditor",bindingPath:"rules",settings:{customApplyTo:!0}}]}],buttons:[{text:s.ok,buttonType:"Ok"},{text:s.close,buttonType:"Cancel"}]}}_e(G.TableSheetRuleManagerDialogTemplate,dde);function Ku(e){return typeof e=="boolean"}function U_(e){return typeof e=="number"}function Yb(e){return typeof e=="string"}function J_(e,t){return U_(e[t])}function I0(e,t,i){t.length=0;let n=e.rules.ruleItems;for(let a=n.length-1;a>=0;a--){let r=bi.ruleItemToRule(i,n[a]);if(r){let o=eO(r);t.push(o)}}}const M0=e=>{let t=new GC.Spread.Sheets.Style;return t.font=e,t};function Qu(e){var u;let t=Ke(e),i=e.formatter||"General",n=e.font?M0(e.font):M0(s.defaultFont),a=C.getFontSizeInPoint(n.fontSize),r=e.labelOptions,o=r&&r.font&&C.parseFont(r.font),l="none";t.textDecoration==="lineThroughUnderline"?(t.textDecoration=GC.Spread.Sheets.TextDecorationType.lineThrough|GC.Spread.Sheets.TextDecorationType.underline,l="single"):t.textDecoration==="lineThroughDoubleUnderline"?(t.textDecoration=GC.Spread.Sheets.TextDecorationType.lineThrough|GC.Spread.Sheets.TextDecorationType.doubleUnderline,l="double"):(t.textDecoration=GC.Spread.Sheets.TextDecorationType[e.textDecoration||"none"],t.textDecoration===GC.Spread.Sheets.TextDecorationType.underline?l="single":t.textDecoration===GC.Spread.Sheets.TextDecorationType.doubleUnderline&&(l="double"));let c="General";if(typeof i=="string"){let h=C.parseFormat(i);c=C.transToCategoryStr(h.category)}return{numberTabOption:{cellValue:"12345",formatter:i,category:{activeTab:c.toLowerCase()}},alignmentTabOption:{hAlign:GC.Spread.Sheets.HorizontalAlign[e.hAlign||"general"],vAlign:GC.Spread.Sheets.VerticalAlign[e.vAlign||"top"],textIndent:e.textIndent||0,wordWrap:e.wordWrap,shrinkToFit:e.shrinkToFit,merged:!1,showEllipsis:e.showEllipsis,showTextDirection:!1,orientation:{textOrientation:e.textOrientation||0,isVerticalText:e.isVerticalText||!1}},fontTabOption:{foreColor:e.foreColor||"#000000",fontFamily:C.trimQuote(n.fontFamily),fontSize:a?a.replace(/(pt|px)$/,""):null,fontStyle:C.getFormatDialogFontStyle(n),fontWeight:C.getFormatDialogFontWeight(n),fontUnderlineListAndEffects:{fontEffects:{fontStrikethrough:(t.textDecoration&GC.Spread.Sheets.TextDecorationType.lineThrough)>0},fontUnderlineList:l,textDecoration:t.textDecoration}},borderTabOption:{borderTop:qb(e.borderTop),borderBottom:qb(e.borderBottom),borderLeft:qb(e.borderLeft),borderRight:qb(e.borderRight),borderHorizontal:void 0,borderVertical:void 0,diagonalUp:void 0,diagonalDown:void 0,enableBorderHorizontal:!1,enableBorderVertical:!1},fillTabOption:{backColor:hde(e.backColor)},cellButtonTabOption:{cellButtons:pde(e.cellButtons),dropDowns:mde(e.dropDowns)},paddingTabOption:{text:e.watermark||"",alignment:GC.Spread.Sheets.LabelAlignment[r==null?void 0:r.alignment]||0,font:{fontFamily:o&&o.fontFamily||s.fontPicker.fontFamilies.Calibri,fontSize:o?(u=o.fontSize)==null?void 0:u.replace(/(pt|px)$/,""):"11",fontStyle:!!(o&&o.fontStyle.indexOf("italic")>=0),fontWeight:!!(o&&o.fontWeight==="bold"),foreColor:r?r.foreColor:"#808080"},margin:Ae.parseMargin(r==null?void 0:r.margin),padding:Ae.parseMargin(e==null?void 0:e.cellPadding),visibility:r?Ae.parseVisibility(r.visibility):GC.Spread.Sheets.LabelVisibility.auto},protectionTabOption:{locked:!1},dialogOption:{showTabList:[dt.Number,dt.Alignment,dt.Font,dt.Border,dt.Fill,dt.CellButton,dt.Padding]}}}function Xu(e,t){var i;if(e){if(e.hasOwnProperty("formatter")&&(t.formatter=e.formatter),Gi(e.hAlign)||(t.hAlign=GC.Spread.Sheets.HorizontalAlign[e.hAlign]),Gi(e.vAlign)||(t.vAlign=GC.Spread.Sheets.VerticalAlign[e.vAlign]),Gi(e.isVerticalText)||(t.isVerticalText=e.isVerticalText),Gi(e.showEllipsis)||(t.showEllipsis=e.showEllipsis),Gi(e.shrinkToFit)||(t.shrinkToFit=e.shrinkToFit),Gi(e.textOrientation)||(t.textOrientation=e.textOrientation),Gi(e.wordWrap)||(t.wordWrap=e.wordWrap),Gi(e.textIndent)||(t.textIndent=e.textIndent),Gi(e.foreColor)||(t.foreColor=e.foreColor),Gi(e.textDecoration)||(e.textDecoration===(GC.Spread.Sheets.TextDecorationType.lineThrough|GC.Spread.Sheets.TextDecorationType.underline)?t.textDecoration="lineThroughUnderline":e.textDecoration===(GC.Spread.Sheets.TextDecorationType.lineThrough|GC.Spread.Sheets.TextDecorationType.doubleUnderline)?t.textDecoration="lineThroughDoubleUnderline":t.textDecoration=GC.Spread.Sheets.TextDecorationType[e.textDecoration||GC.Spread.Sheets.TextDecorationType.none]),e.borderBottom&&(t.borderBottom=$a(e.borderBottom)),e.borderTop&&(t.borderTop=$a(e.borderTop)),e.borderLeft&&(t.borderLeft=$a(e.borderLeft)),e.borderRight&&(t.borderRight=$a(e.borderRight)),e.diagonalDown&&(t.diagonalDown=$a(e.diagonalDown)),e.diagonalUp&&(t.diagonalUp=$a(e.diagonalUp)),Gi(e.backColor)||(t.backColor=k0(e.backColor)),e.cellButtons&&(t.cellButtons=K_(e.cellButtons)),e.dropDowns&&(t.dropDowns=Q_(e.dropDowns)),Gi(e.cellPadding)||(t.cellPadding=e.cellPadding),e.watermark&&(t.watermark=e.watermark),e.labelOptions||e.watermark||e.cellPadding){e.labelOptions||(e.labelOptions={});let n=e.labelOptions.alignment||0,a=Gi(e.labelOptions.visibility)?2:e.labelOptions.visibility,r={font:e.labelOptions.font,foreColor:e.labelOptions.foreColor,margin:e.labelOptions.margin,alignment:GC.Spread.Sheets.LabelAlignment[n],visibility:GC.Spread.Sheets.LabelVisibility[a]};t.labelOptions=r}if(e.font){let n=t.font?M0(t.font):void 0,a=n!=null&&n.font?n:C.parseFont(s.defaultFont),r=[(e.font.fontStyle||a.fontStyle||"").replace("bold","").trim(),e.font.fontWeight||a.fontWeight,(e.font.fontSize||((i=a.fontSize)==null?void 0:i.replace("pt","")))+"pt",e.font.fontFamily||a.fontFamily];t.font=r.join(" ")}for(const n of Object.keys(e))if(["LT","RT","LB","RB","cornerFoldSize","cornerFoldColor","styleDecorationIcons"].indexOf(n)>-1){t.decoration=ude(e);break}}}function ude(e){let t={position:0,size:0,color:""};if(e.LT&&(t.position=GC.Spread.Sheets.CornerPosition.leftTop),e.RT&&(t.position|=GC.Spread.Sheets.CornerPosition.rightTop),e.LB&&(t.position|=GC.Spread.Sheets.CornerPosition.leftBottom),e.RB&&(t.position|=GC.Spread.Sheets.CornerPosition.rightBottom),e.cornerFoldSize!==void 0&&(t.size=e.cornerFoldSize),e.cornerFoldColor!==void 0&&(t.color=e.cornerFoldColor),e.decoration={cornerFold:t},!C.isEmpty(e.styleDecorationIcons)){let i=e.styleDecorationIcons.filter(n=>!C.isEmpty(n.src));C.isEmpty(i)||(e.decoration.icons=i),delete e.styleDecorationIcons}return e.decoration}function Ko(e,t){var d;let i=(d=e.numberTabOption)==null?void 0:d.formatter;i&&(t.formatter=i);let n=e.alignmentTabOption;if(n){let{hAlign:u,vAlign:h,textIndent:g,wordWrap:f,shrinkToFit:b,showEllipsis:S,orientation:y}=n;Gi(u)||(t.hAlign=GC.Spread.Sheets.HorizontalAlign[u]),Gi(h)||(t.vAlign=GC.Spread.Sheets.VerticalAlign[h]),t.textIndent=g,t.wordWrap=f,t.shrinkToFit=b,t.showEllipsis=S,t.textOrientation=y==null?void 0:y.textOrientation,t.isVerticalText=y==null?void 0:y.isVerticalText}let a=e.fontTabOption;if(a){let u=[(a.fontStyle||"").replace("bold","").trim(),a.fontWeight||"",a.fontSize+"pt",a.fontFamily];t.font=u.join(" ");let h="none",g=a.fontUnderlineListAndEffects;g&&g.fontUnderlineList==="single"&&(h="underline"),g&&g.fontUnderlineList==="double"&&(h="doubleUnderline"),g&&g.fontEffects&&g.fontEffects.fontStrikethrough&&(h="lineThrough"),t.textDecoration=h,t.foreColor=a.foreColor}let r=e.borderTabOption;r&&(t.borderLeft=$a(r.borderLeft),t.borderRight=$a(r.borderRight),t.borderTop=$a(r.borderTop),t.borderBottom=$a(r.borderBottom));let o=e.fillTabOption;o&&(t.backColor=k0(o.backColor));let l=e.cellButtonTabOption;l&&(t.cellButtons=K_(l.cellButtons),t.dropDowns=Q_(l.dropDowns));let c=e.paddingTabOption;if(c){t.watermark=c.text;let u=t.labelOptions;if(u||(u=t.labelOptions={}),u){c.alignment&&(u.alignment=GC.Spread.Sheets.LabelAlignment[c.alignment]),c.visibility&&(u.visibility=c.visibility);let S=c.font;S&&S.foreColor&&(u.foreColor=S.foreColor),S&&(u.font=[S.fontStyle?"italic":"",S.fontWeight?"bold":"",S.fontSize?S.fontSize+"pt":"",S.fontFamily?S.fontFamily:""].join(" ").trim())}let h=c.margin;u&&h&&(u.margin=[h.top,h.right,h.bottom,h.left].join(" "));let g=c.padding;g&&(t.cellPadding=[g.top,g.right,g.bottom,g.left].join(" "))}}function Y_(e){let t={};switch(e.type){case"number":{t.criteriaType=e.isIntegerValue?GC.Spread.Sheets.DataValidation.CriteriaType.wholeNumber:GC.Spread.Sheets.DataValidation.CriteriaType.decimalValues,t.rangeSelect1=e.value1,t.rangeSelect2=e.value2;break}case"date":{t.criteriaType=GC.Spread.Sheets.DataValidation.CriteriaType.date,t.rangeSelect1=tO(e.value1),t.rangeSelect2=tO(e.value2);break}case"textLength":{t.criteriaType=GC.Spread.Sheets.DataValidation.CriteriaType.textLength,t.rangeSelect1=e.value1,t.rangeSelect2=e.value2;break}case"formula":{t.criteriaType=GC.Spread.Sheets.DataValidation.CriteriaType.custom,t.rangeSelect1=e.formula;break}case"formulaList":{t.criteriaType=GC.Spread.Sheets.DataValidation.CriteriaType.list,t.rangeSelect1=e.formula;break}case"list":{t.criteriaType=GC.Spread.Sheets.DataValidation.CriteriaType.list,t.rangeSelect1=e.source;break}default:{t.criteriaType=GC.Spread.Sheets.DataValidation.CriteriaType.anyValue,t.rangeSelect1="",t.rangeSelect2="";break}}t.comparisonOperator=Gi(e.comparisonOperator)?GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between:GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators[e.comparisonOperator],t.ignoreBlank=Gi(e.ignoreBlank)?!0:e.ignoreBlank,t.inCellDropdown=Gi(e.inCellDropdown)?!0:e.inCellDropdown,t.showInputMsg=Gi(e.showInputMessage)?!0:e.showInputMessage,t.inputMsgTitle=e.inputTitle||"",t.inputMsg=e.inputMessage||"",t.showErrorMsg=Gi(e.showErrorMessage)?!0:e.showErrorMessage,t.styleType=Gi(e.errorStyle)?GC.Spread.Sheets.DataValidation.ErrorStyle.stop:GC.Spread.Sheets.DataValidation.ErrorStyle[e.errorStyle],t.errorTitle=e.errorTitle||"",t.errorMsg=e.errorMessage||"";let i=e.highlightStyle;return i?(t.highlightType=GC.Spread.Sheets.DataValidation.HighlightType[i.type],t.highlightColor=i.color,t.highlightPosition_dogear=GC.Spread.Sheets.DataValidation.HighlightPosition[i.position],t.highlightPosition_icon=GC.Spread.Sheets.DataValidation.HighlightPosition[i.position],t.highlightIcon=i.image):(t.highlightType=GC.Spread.Sheets.DataValidation.HighlightType.circle,t.highlightColor="#FF0000",t.highlightPosition_dogear=GC.Spread.Sheets.DataValidation.HighlightPosition.topLeft,t.highlightPosition_icon=GC.Spread.Sheets.DataValidation.HighlightPosition.outsideLeft,t.highlightIcon=""),t}function q_(e,t){let i=e.rangeSelect1,n=e.rangeSelect2;const a=GC.Spread.Sheets.DataValidation.CriteriaType;switch(e.criteriaType){case a.wholeNumber:t.type="number",t.value1=fs(i)?i:Number(i),t.value2=fs(n)?n:Number(n),t.isIntegerValue=!0;break;case a.decimalValues:t.type="number",t.value1=fs(i)?i:Number(i),t.value2=fs(n)?n:Number(n),t.isIntegerValue=!1;break;case a.date:t.type="date",t.value1=fs(i)?i:new Date(i),t.value2=fs(n)?n:new Date(n);break;case a.textLength:t.type="textLength",t.value1=fs(i)?i:Number(i),t.value2=fs(n)?n:Number(n);break;case a.custom:t.type="formula",t.formula=i;break;case a.list:fs(i)?(t.type="formulaList",t.formula=i):(t.type="list",t.source=i);break;default:{t.type="",t.value1="",t.value2="",t.isIntegerValue=!1,t.formula="",t.source="";break}}t.comparisonOperator=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators[e.comparisonOperator],t.showInputMessage=e.showInputMsg,t.inputTitle=e.inputMsgTitle,t.inputMessage=e.inputMsg,t.showErrorMessage=e.showErrorMsg,t.errorTitle=e.errorTitle,t.errorMessage=e.errorMsg,t.errorStyle=GC.Spread.Sheets.DataValidation.ErrorStyle[e.styleType],t.ignoreBlank=e.ignoreBlank,t.inCellDropdown=e.inCellDropdown;const r=e.highlightType,o=e.highlightPosition_dogear,l=e.highlightPosition_icon,c=GC.Spread.Sheets.DataValidation.HighlightType,d=GC.Spread.Sheets.DataValidation.HighlightPosition;let u=g=>{switch(g){case d.topLeft:return"topLeft";case d.topRight:return"topRight";case d.bottomRight:return"bottomRight";case d.bottomLeft:return"bottomLeft"}},h=(g,f)=>{switch(g){case d.outsideLeft:f.highlightStyle={type:"icon",color:e.highlightColor,position:"outsideLeft",image:e.highlightIcon};break;case d.outsideRight:f.highlightStyle={type:"icon",color:e.highlightColor,position:"outsideRight",image:e.highlightIcon};break}};switch(r){case c.circle:t.highlightStyle={type:"circle",color:e.highlightColor};break;case c.dogEar:let g=u(o)||d.topLeft;t.highlightStyle={type:"dogEar",color:e.highlightColor,position:g};break;case c.icon:h(l,t);break}}function Gi(e){return e==null}function qb(e){if(e&&e.style)return new GC.Spread.Sheets.LineBorder(e.color,GC.Spread.Sheets.LineStyle[e.style])}function $a(e){if(e)return{color:e.color,style:GC.Spread.Sheets.LineStyle[e.style]}}function hde(e){return e&&e.stops?e:e&&e.type?{type:e.type&&GC.Spread.Sheets.PatternType[e.type]||void 0,patternColor:e.patternColor,backgroundColor:e.backgroundColor}:e||""}function k0(e){return e&&e.stops?e:e&&e.type?{type:e.type&&GC.Spread.Sheets.PatternType[e.type]||void 0,patternColor:e.patternColor,backgroundColor:e.backgroundColor}:e||void 0}function pde(e){return e&&e.length>0?e.map(function(t){return{position:t.position&&GC.Spread.Sheets.ButtonPosition[t.position],useButtonStyle:t.useButtonStyle,enabled:t.enabled,width:t.width,caption:t.caption,imageSrc:t.imageSrc,imageSize:t.imageSize,captionAlign:t.captionAlign&&GC.Spread.Sheets.CaptionAlignment[t.captionAlign],command:t.command,imageType:t.imageType&&GC.Spread.Sheets.ButtonImageType[t.imageType],visibility:t.visibility&&GC.Spread.Sheets.ButtonVisibility[t.visibility],hoverBackColor:t.hoverBackColor,buttonBackColor:t.buttonBackColor}}):[]}function K_(e){return e&&e.length>0?e.map(function(t){return{position:!Gi(t.position)&&GC.Spread.Sheets.ButtonPosition[t.position],useButtonStyle:t.useButtonStyle,enabled:t.enabled,width:t.width,caption:t.caption,imageSrc:t.imageSrc,imageSize:t.imageSize,captionAlign:!Gi(t.captionAlign)&&GC.Spread.Sheets.CaptionAlignment[t.captionAlign],command:t.command,imageType:!Gi(t.imageType)&&GC.Spread.Sheets.ButtonImageType[t.imageType],visibility:!Gi(t.visibility)&&GC.Spread.Sheets.ButtonVisibility[t.visibility],hoverBackColor:t.hoverBackColor,buttonBackColor:t.buttonBackColor}}):[]}function mde(e){return e&&e.length>0?e.map(function(t){return{type:t.type&&GC.Spread.Sheets.DropDownType[t.type],option:X_(t.option),submitCommand:t.submitCommand}}):[]}function Q_(e){return e&&e.length>0?e.map(function(t){return{type:t.type&&GC.Spread.Sheets.DropDownType[t.type],option:X_(t.option),submitCommand:t.submitCommand}}):[]}function gde(e){if(e)return{cornerFold:e.cornerFold,icons:e.icons&&e.icons.length>0?e.icons.map(t=>({src:t.src,width:t.width,height:t.height,position:C.isNullOrUndefined(t.position)?void 0:GC.Spread.Sheets.IconPosition[t.position]})):void 0}}function X_(e){let t=C.deepClone(e),i=e.calendarPage;Gi(i)||(t.calendarPage=GC.Spread.Sheets.CalendarPage[i]);let n=e.startDay;Gi(n)||(t.startDay=GC.Spread.Sheets.CalendarStartDay[n]);let a=e.layout;if(a){let l=a.direction;Gi(l)||(t.layout.direction=GC.Spread.Sheets.LayoutDirection[l]);let c=a.displayAs;Gi(c)||(t.layout.displayAs=GC.Spread.Sheets.LayoutDisplayAs[c])}let r=e.valueType;Gi(r)||(t.valueType=GC.Spread.Sheets.DropdownListValue[r]);let o=e.direction;return Gi(o)||(t.direction=GC.Spread.Sheets.LayoutDirection[o]),t}function R0(e){let t;const i=e.ruleType,n=[],a=new GC.Spread.Sheets.Style(e.style||{});switch(i){case"cellValueRule":{t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule,n,a,GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators[e.comparisonOperator],e.value1,e.value2,void 0,void 0,void 0,void 0);break}case"specificTextRule":{t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.specificTextRule,n,a,GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators[e.comparisonOperator],void 0,void 0,e.text,void 0,void 0,void 0);break}case"formulaRule":t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.formulaRule,n,a,void 0,void 0,void 0,void 0,e.formula,void 0,void 0);break;case"dateOccurringRule":{t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.dateOccurringRule,n,a,void 0,void 0,void 0,void 0,void 0,GC.Spread.Sheets.ConditionalFormatting.DateOccurringType[e.type],void 0);break}case"top10Rule":{t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule,n,a,void 0,void 0,void 0,void 0,void 0,GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType[e.type],e.rank);break}case"uniqueRule":t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.uniqueRule,n,a,void 0,void 0,void 0,void 0,void 0,void 0,void 0);break;case"duplicateRule":t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.duplicateRule,n,a,void 0,void 0,void 0,void 0,void 0,void 0,void 0);break;case"averageRule":{t=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.averageRule,n,a,void 0,void 0,void 0,void 0,void 0,GC.Spread.Sheets.ConditionalFormatting.AverageConditionType[e.type],void 0);break}case"twoScaleRule":t=new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.twoScaleRule,e.minType,e.minValue,e.minColor,void 0,void 0,void 0,e.maxType,e.maxValue,e.maxColor,n);break;case"threeScaleRule":t=new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule,e.minType,e.minValue,e.minColor,e.midType,e.midValue,e.midColor,e.maxType,e.maxValue,e.maxColor,n);break;case"dataBarRule":t=new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(e.minType,e.minValue,e.maxType,e.maxValue,e.color,n);const{gradient:r,showBarOnly:o,showBorder:l,borderColor:c,dataBarDirection:d,negativeData:u}=e;if(Ku(r)&&t.gradient(r),Ku(o)&&t.showBarOnly(o),Ku(l)&&t.showBorder(l),Yb(c)&&t.borderColor(c),J_(GC.Spread.Sheets.ConditionalFormatting.BarDirection,d)&&t.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection[d]),u){const{negativeFillColor:h,useNegativeFillColor:g,negativeBorderColor:f,useNegativeBorderColor:b,axisColor:S,axisPosition:y}=u;Yb(h)&&t.negativeFillColor(h),Ku(g)&&t.useNegativeFillColor(g),Yb(f)&&t.negativeBorderColor(f),Ku(b)&&t.useNegativeBorderColor(b),Yb(S)&&t.axisColor(S),J_(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition,y)&&t.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition[y])}break;case"iconSetRule":{if(t=new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(GC.Spread.Sheets.ConditionalFormatting.IconSetType[e.iconSetType],n),t.reverseIconOrder(e.reverseIconOrder),t.showIconOnly(e.showIconOnly),e.icons){let h=e.icons.map(function(g){return{iconSetType:GC.Spread.Sheets.ConditionalFormatting.IconSetType[g.iconSetType],iconIndex:g.iconIndex}});t.icons(h)}if(e.iconCriteria){let h=t.iconCriteria();e.iconCriteria.map(function(g,f){h[f]={iconValueType:GC.Spread.Sheets.ConditionalFormatting.IconValueType[g.iconValueType],isGreaterThanOrEqualTo:g.isGreaterThanOrEqualTo,iconValue:fo(g.iconValue)}}),t.iconCriteria(h)}break}}return t&&Ku(e.stopIfTrue)&&t.stopIfTrue(e.stopIfTrue),t}function fde(e,t){return Gi(t)?void 0:e[t]}function $_(e){let t={};return t.backColor=k0(e.backColor),t.foreColor=e.foreColor,t.font=e.font,t.formatter=e.formatter,t.borderLeft=$a(e.borderLeft),t.borderTop=$a(e.borderTop),t.borderRight=$a(e.borderRight),t.borderBottom=$a(e.borderBottom),t.diagonalDown=$a(e.diagonalDown),t.diagonalUp=$a(e.diagonalUp),U_(e.textDecoration)&&(e.textDecoration===(GC.Spread.Sheets.TextDecorationType.lineThrough|GC.Spread.Sheets.TextDecorationType.underline)?t.textDecoration="lineThroughUnderline":e.textDecoration===(GC.Spread.Sheets.TextDecorationType.lineThrough|GC.Spread.Sheets.TextDecorationType.doubleUnderline)?t.textDecoration="lineThroughDoubleUnderline":t.textDecoration=fde(GC.Spread.Sheets.TextDecorationType,e.textDecoration)),t.decoration=gde(e.decoration),t}function eO(e){let t={};const i=e.ruleType(),n=e.style();switch(n&&(t.style=$_(n)),i){case GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule:{let a=e.operator();t.comparisonOperator=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators[a],t.value1=e.value1(),t.value2=e.value2(),t.ruleType="cellValueRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.specificTextRule:{let a=e.operator();t.comparisonOperator=GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators[a],t.text=e.text(),t.ruleType="specificTextRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.formulaRule:{t.formula=e.formula(),t.ruleType="formulaRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.dateOccurringRule:{let a=e.type();t.type=GC.Spread.Sheets.ConditionalFormatting.DateOccurringType[a],t.ruleType="dateOccurringRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule:{let a=e.type();t.type=GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType[a],t.rank=e.rank(),t.ruleType="top10Rule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.uniqueRule:t.ruleType="uniqueRule";break;case GC.Spread.Sheets.ConditionalFormatting.RuleType.duplicateRule:t.ruleType="duplicateRule";break;case GC.Spread.Sheets.ConditionalFormatting.RuleType.averageRule:{let a=e.type();t.type=GC.Spread.Sheets.ConditionalFormatting.AverageConditionType[a],t.ruleType="averageRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.twoScaleRule:{t.minType=e.minType(),t.minValue=e.minValue(),t.minColor=e.minColor(),t.maxType=e.maxType(),t.maxValue=e.maxValue(),t.maxColor=e.maxColor(),t.ruleType="twoScaleRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule:{t.minType=e.minType(),t.minValue=e.minValue(),t.minColor=e.minColor(),t.midType=e.midType(),t.midValue=e.midValue(),t.midColor=e.midColor(),t.maxType=e.maxType(),t.maxValue=e.maxValue(),t.maxColor=e.maxColor(),t.ruleType="threeScaleRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.dataBarRule:{t.minType=e.minType(),t.minValue=e.minValue(),t.maxType=e.maxType(),t.maxValue=e.maxValue(),t.color=e.color(),t.gradient=e.gradient(),t.showBarOnly=e.showBarOnly(),t.showBorder=e.showBorder(),t.borderColor=e.borderColor();let a=e.dataBarDirection();t.dataBarDirection=GC.Spread.Sheets.ConditionalFormatting.BarDirection[a],t.negativeData={},t.negativeData.negativeFillColor=e.negativeFillColor(),t.negativeData.useNegativeFillColor=e.useNegativeFillColor(),t.negativeData.negativeBorderColor=e.negativeBorderColor(),t.negativeData.useNegativeBorderColor=e.useNegativeBorderColor(),t.negativeData.axisColor=e.axisColor();let r=e.axisPosition();t.negativeData.axisPosition=GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition[r],t.ruleType="dataBarRule";break}case GC.Spread.Sheets.ConditionalFormatting.RuleType.iconSetRule:{let a=e.iconSetType();t.iconSetType=GC.Spread.Sheets.ConditionalFormatting.IconSetType[a],t.reverseIconOrder=e.reverseIconOrder(),t.showIconOnly=e.showIconOnly(),t.ruleType="iconSetRule";let r=e.icons().map(function(l){return{iconSetType:GC.Spread.Sheets.ConditionalFormatting.IconSetType[l.iconSetType],iconIndex:l.iconIndex}});t.icons=r;let o=e.iconCriteria().map(function(l){return{iconValueType:GC.Spread.Sheets.ConditionalFormatting.IconValueType[l.iconValueType],isGreaterThanOrEqualTo:l.isGreaterThanOrEqualTo,iconValue:fo(l.iconValue)}});t.iconCriteria=o;break}}return t.stopIfTrue=e.stopIfTrue(),t}function tO(e){return e==null?"":e&&e.getDate?[e.getMonth()+1,e.getDate(),e.getFullYear()].join("/"):e+""}function fs(e){return!!e&&e[0]==="="}var kn=(e=>(e[e.add=0]="add",e[e.replace=1]="replace",e[e.overwrite=2]="overwrite",e))(kn||{});class bde extends oe.DesignerActionBase{executeImp(t,i,n){var o,l;let a=this.spread();a.suspendPaint();let r=a.getActiveSheetTab();if(C._isTableSheet(r)){let c=r.getDataView();if(c){let d=c.getColumn(i.columnIndex);if(i.prop==="dataType"){let u=d[i.prop],h=u==="string"||u==="number";if(!h){let g=((o=c.getTable().getSourceData())==null?void 0:o[d.value])||[];for(const f of g)if(!C.isNullOrUndefined(f)){let b=typeof f;h=b==="number"||b==="string";break}if(!h)return a.resumePaint(),!1}}if(i.prop==="conditionalFormats"?Sde(d,i):d[i.prop]=i.value,i.prop==="dataType"||i.prop==="isPrimaryKey"){let u=c.tableName,g=a.dataManager().tables[u].options.schema;g&&(g.columns=(l=g.columns)!=null?l:{}),i.prop==="dataType"?c.updateColumnDataType(d.value,i.value):i.prop==="isPrimaryKey"&&c.updateColumnIsPrimaryKeyType(d.value,i.value)}c.setGroupSliceColumnSettings(d,i.prop),c.updateColumnSettingToGroupOptions(d,i.prop),c.updateColumn(d),r.refreshBindColumns(),r.applyStyleRules()}}a.resumePaint()}}let iO={canUndo:!0,execute:function(e,t,i){return new bde(e,t).execute(e,t,i)}};function Sde(e,t){e.conditionalFormats||(e.conditionalFormats=[]);let i=t.value,n=t.applyStatus;if(n!==2){let a=[...e.conditionalFormats];for(const r of i){if(n===1){for(let o=a.length-1;o>=0;o--)if(a[o].ruleType===r.ruleType){a.splice(o,1);break}}a.push(r)}e.conditionalFormats=a}else e.conditionalFormats=i}function Cde(e,t){let i="Designer."+t;e.commandManager().register(i,iO,void 0,!1,!1,!1,!1)}function Oi(e,t,i,n,a){let r={columnIndex:t,prop:i,value:n,applyStatus:a};oe.runCommand(e,"changeTableSheetColumnSetting",iO,r)}function bs(e){let t=e.getSelections();return t[0]?t[0].col:-1}function $u(e,t,i,n){let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()&&n>=0){let o=eO(t);Oi(e,n,"conditionalFormats",[o],i)}}const bo=(e,t,i,n)=>{let a=e.Spread,r=C.getActiveSheet(a);if(r){let o,l=r.getSelections(),c=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.highestValue,d=null,u=t,h=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.lowestValue,g=null,f=i,b=GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.percentile,S=50;if(n){let y=i;f=n,o=new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule,h,g,f,b,S,y,c,d,u,l)}else o=new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.twoScaleRule,h,g,f,null,null,null,c,d,u,l);oa(a,!0,o)}else{let o=a.getActiveSheetTab();if(C._isTableSheet(o)&&o.getDataView()){let c=e.getData(re.tableSheetSelectedColumn);if(c>=0){let d;n?d=[{ruleType:"threeScaleRule",minType:"lowestValue",minValue:null,minColor:n,midType:"percentile",midValue:50,midColor:i,maxType:"highestValue",maxValue:null,maxColor:t}]:d=[{ruleType:"twoScaleRule",minType:"lowestValue",minValue:null,minColor:i,maxType:"highestValue",maxValue:null,maxColor:t}],Oi(a,c,"conditionalFormats",d,kn.replace)}}}e.setData(re.isFileModified,!0)};let yde={iconClass:"gc-ribbon-bwr-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleBwr,tip:"${res.conditionalFormat.colorScales.bwr}",execute:(e,t,i)=>{bo(e,"blue","white","red")},init:e=>{$ce(e.Spread,"addRule")}};const vde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleBwr:yde},Symbol.toStringTag,{value:"Module"}));let xde={iconClass:"gc-ribbon-gw-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleGw,tip:"${res.conditionalFormat.colorScales.gw}",execute:(e,t,i)=>{bo(e,"green","white")}};const Lde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleGw:xde},Symbol.toStringTag,{value:"Module"}));let Tde={iconClass:"gc-ribbon-gwr-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleGwr,tip:"${res.conditionalFormat.colorScales.gwr}",execute:(e,t,i)=>{bo(e,"green","white","red")}};const wde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleGwr:Tde},Symbol.toStringTag,{value:"Module"}));let Dde={iconClass:"gc-ribbon-gy-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleGy,tip:"${res.conditionalFormat.colorScales.gy}",execute:(e,t,i)=>{bo(e,"green","yellow")}};const Ade=Object.freeze(Object.defineProperty({__proto__:null,colorScaleGy:Dde},Symbol.toStringTag,{value:"Module"}));let Pde={iconClass:"gc-ribbon-gyr-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleGyr,tip:"${res.conditionalFormat.colorScales.gyr}",execute:(e,t,i)=>{bo(e,"green","yellow","red")}};const Ide=Object.freeze(Object.defineProperty({__proto__:null,colorScaleGyr:Pde},Symbol.toStringTag,{value:"Module"}));let Mde={iconClass:"gc-ribbon-rw-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleRw,tip:"${res.conditionalFormat.colorScales.rw}",execute:(e,t,i)=>{bo(e,"red","white")}};const kde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleRw:Mde},Symbol.toStringTag,{value:"Module"}));let Rde={iconClass:"gc-ribbon-rwb-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleRwb,tip:"${res.conditionalFormat.colorScales.rwb}",execute:(e,t,i)=>{bo(e,"red","white","blue")}};const _de=Object.freeze(Object.defineProperty({__proto__:null,colorScaleRwb:Rde},Symbol.toStringTag,{value:"Module"}));let Ode={iconClass:"gc-ribbon-rwg-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleRwg,tip:"${res.conditionalFormat.colorScales.rwg}",execute:(e,t,i)=>{bo(e,"red","white","green")}};const Ede=Object.freeze(Object.defineProperty({__proto__:null,colorScaleRwg:Ode},Symbol.toStringTag,{value:"Module"}));let Nde={iconClass:"gc-ribbon-ryg-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleRyg,tip:"${res.conditionalFormat.colorScales.ryg}",execute:(e,t,i)=>{bo(e,"red","yellow","green")}};const Bde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleRyg:Nde},Symbol.toStringTag,{value:"Module"}));let Fde={iconClass:"gc-ribbon-wg-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleWg,tip:"${res.conditionalFormat.colorScales.wg}",execute:(e,t,i)=>{bo(e,"white","green")}};const Gde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleWg:Fde},Symbol.toStringTag,{value:"Module"}));let Vde={iconClass:"gc-ribbon-wr-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleWr,tip:"${res.conditionalFormat.colorScales.wr}",execute:(e,t,i)=>{bo(e,"white","red")}};const Hde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleWr:Vde},Symbol.toStringTag,{value:"Module"}));let zde={iconClass:"gc-ribbon-yg-color-scale",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.ColorScaleYg,tip:"${res.conditionalFormat.colorScales.yg}",execute:(e,t,i)=>{bo(e,"yellow","green")}};const jde=Object.freeze(Object.defineProperty({__proto__:null,colorScaleYg:zde},Symbol.toStringTag,{value:"Module"}));let Wde={commandName:p.ColorScalesList2,title:"${res.conditionalFormat.colorScales.title}"},Zde={commandName:p.ColorScalesList,text:"${res.conditionalFormat.colorScales.title}",iconClass:"ribbon-control-dropdown-color-scales",bigButton:"=ribbonHeight>toolbarHeight",comboWidth:170};const Ude=Object.freeze(Object.defineProperty({__proto__:null,ColorScalesList:Wde,colorScalesList:Zde},Symbol.toStringTag,{value:"Module"}));let Jde={text:"${res.conditionalFormat.moreRules}",title:"${res.conditionalFormat.moreColorScaleRules}",commandName:p.MoreColorScaleRules,controlOption:{className:"more-rules-item"},execute:async(e,t)=>{let i=await e._showDialog(G.NewFormattingRuleDialogTemplate,bi.getNewFormatRuleDialogOption(e,e.Spread),bi.validateConditionalFormatDialogFormula);i&&(Yde(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Yde(e,t,i){let n=bi.ruleValueToRule(e,t);if(n){let a=C.getActiveSheet(e);if(a){if(!n.ranges()){let o=a.getSelections();n.ranges(o)}oa(e,!1,n)}else $u(e,n,kn.add,i)}}const qde=Object.freeze(Object.defineProperty({__proto__:null,moreRules:Jde},Symbol.toStringTag,{value:"Module"}));let Kde={commandName:p.GradientFill,title:"${res.conditionalFormat.gradientFill.title}"},Qde={commandName:p.SolidFill,title:"${res.conditionalFormat.solidFill.title}"},Xde={commandName:p.DataBar,text:"${res.conditionalFormat.dataBars}",iconClass:"ribbon-control-dropdown-data-bars",bigButton:"=ribbonHeight>toolbarHeight",comboWidth:126};const $de=Object.freeze(Object.defineProperty({__proto__:null,dataBar:Xde,gradientFill:Kde,solidFill:Qde},Symbol.toStringTag,{value:"Module"})),Kb="(Automatic)",So=(e,t,i)=>{let n=e.Spread,a=C.getActiveSheet(n);if(a){let r=a.getSelections(),o=new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.automin,Kb,GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.automax,Kb,t,r);o.gradient(i),oa(n,!0,o)}else{let r=n.getActiveSheetTab();if(C._isTableSheet(r)&&r.getDataView()){let l=e.getData(re.tableSheetSelectedColumn);l>=0&&Oi(n,l,"conditionalFormats",[{ruleType:"dataBarRule",minType:"automin",minValue:Kb,maxType:"automax",maxValue:Kb,color:t,gradient:i}],kn.replace)}}e.setData(re.isFileModified,!0)};let eue={iconClass:"gc-ribbon-gradient-fill-blue-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.GradientFillBlueDataBar,tip:"${res.conditionalFormat.gradientFill.blue}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"blue",!0)}};const tue=Object.freeze(Object.defineProperty({__proto__:null,gradientFillBlueDataBar:eue},Symbol.toStringTag,{value:"Module"}));let iue={iconClass:"gc-ribbon-gradient-fill-green-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.GradientFillGreenDataBar,tip:"${res.conditionalFormat.gradientFill.green}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"green",!0)}};const nue=Object.freeze(Object.defineProperty({__proto__:null,gradientFillGreenDataBar:iue},Symbol.toStringTag,{value:"Module"}));let aue={iconClass:"gc-ribbon-gradient-fill-lightblue-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.GradientFillLightBlueDataBar,tip:"${res.conditionalFormat.gradientFill.lightBlue}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"lightblue",!0)}};const rue=Object.freeze(Object.defineProperty({__proto__:null,gradientFillLightBlueDataBar:aue},Symbol.toStringTag,{value:"Module"}));let oue={iconClass:"gc-ribbon-gradient-fill-orange-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.GradientFillOrangeDataBar,tip:"${res.conditionalFormat.gradientFill.orange}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"orange",!0)}};const lue=Object.freeze(Object.defineProperty({__proto__:null,gradientFillOrangeDataBar:oue},Symbol.toStringTag,{value:"Module"}));let sue={iconClass:"gc-ribbon-gradient-fill-purple-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.GradientFillPurpleDataBar,tip:"${res.conditionalFormat.gradientFill.purple}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"purple",!0)}};const cue=Object.freeze(Object.defineProperty({__proto__:null,gradientFillPurpleDataBar:sue},Symbol.toStringTag,{value:"Module"}));let due={iconClass:"gc-ribbon-gradient-fill-red-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.GradientFillRedDataBar,tip:"${res.conditionalFormat.gradientFill.red}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"red",!0)}};const uue=Object.freeze(Object.defineProperty({__proto__:null,gradientFillRedDataBar:due},Symbol.toStringTag,{value:"Module"}));let hue={text:"${res.conditionalFormat.moreRules}",title:"${res.conditionalFormat.moreDataBarRules}",commandName:p.MoreDataBarRules,controlOption:{className:"more-rules-item"},execute:async(e,t)=>{let i=bi.getNewFormatRuleDialogOption(e,e.Spread);i.baseOnValueRuleType=go.DataBar;let n=await e._showDialog(G.NewFormattingRuleDialogTemplate,i,bi.validateConditionalFormatDialogFormula);n&&(pue(e.Spread,n,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function pue(e,t,i){let n=bi.ruleValueToRule(e,t);if(n){let a=C.getActiveSheet(e);if(a){if(!n.ranges()){let o=a.getSelections();n.ranges(o)}oa(e,!1,n)}else $u(e,n,kn.add,i)}}const mue=Object.freeze(Object.defineProperty({__proto__:null,moreDataBarRules:hue},Symbol.toStringTag,{value:"Module"}));let gue={iconClass:"gc-ribbon-solid-fill-blue-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.SolidFillBlueDataBar,tip:"${res.conditionalFormat.solidFill.blue}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"blue",!1)}};const fue=Object.freeze(Object.defineProperty({__proto__:null,solidFillBlueDataBar:gue},Symbol.toStringTag,{value:"Module"}));let bue={iconClass:"gc-ribbon-solid-fill-green-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.SolidFillGreenDataBar,tip:"${res.conditionalFormat.solidFill.green}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"green",!1)}};const Sue=Object.freeze(Object.defineProperty({__proto__:null,solidFillGreenDataBar:bue},Symbol.toStringTag,{value:"Module"}));let Cue={iconClass:"gc-ribbon-solid-fill-lightblue-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.SolidFillLightBlueDataBar,tip:"${res.conditionalFormat.solidFill.lightBlue}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"lightblue",!1)}};const yue=Object.freeze(Object.defineProperty({__proto__:null,solidFillLightBlueDataBar:Cue},Symbol.toStringTag,{value:"Module"}));let vue={iconClass:"gc-ribbon-solid-fill-orange-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.SolidFillOrangeDataBar,tip:"${res.conditionalFormat.solidFill.orange}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"orange",!1)}};const xue=Object.freeze(Object.defineProperty({__proto__:null,solidFillOrangeDataBar:vue},Symbol.toStringTag,{value:"Module"}));let Lue={iconClass:"gc-ribbon-solid-fill-purple-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.SolidFillPurpleDataBar,tip:"${res.conditionalFormat.solidFill.purple}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"purple",!1)}};const Tue=Object.freeze(Object.defineProperty({__proto__:null,solidFillPurpleDataBar:Lue},Symbol.toStringTag,{value:"Module"}));let wue={iconClass:"gc-ribbon-solid-fill-red-data-bar",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.SolidFillRedDataBar,tip:"${res.conditionalFormat.solidFill.red}",comboWidth:32,comboHeight:32,execute:(e,t,i)=>{So(e,"red",!1)}};const Due=Object.freeze(Object.defineProperty({__proto__:null,solidFillRedDataBar:wue},Symbol.toStringTag,{value:"Module"})),Aue=function(){return{templateName:G.DateOccurringRuleDialogTemplate,title:s.conditionalFormatting.dateOccurringFormat.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.dateOccurringFormat.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",margin:"5px",bindingPath:"value1",items:[{text:s.conditionalFormatting.dateOccurringFormat.date.yesterday,value:"yesterday"},{text:s.conditionalFormatting.dateOccurringFormat.date.today,value:"today"},{text:s.conditionalFormatting.dateOccurringFormat.date.tomorrow,value:"tomorrow"},{text:s.conditionalFormatting.dateOccurringFormat.date.last7days,value:"last7days"},{text:s.conditionalFormatting.dateOccurringFormat.date.lastweek,value:"lastweek"},{text:s.conditionalFormatting.dateOccurringFormat.date.thisweek,value:"thisweek"},{text:s.conditionalFormatting.dateOccurringFormat.date.nextweek,value:"nextweek"},{text:s.conditionalFormatting.dateOccurringFormat.date.lastmonth,value:"lastmonth"},{text:s.conditionalFormatting.dateOccurringFormat.date.thismonth,value:"thismonth"},{text:s.conditionalFormatting.dateOccurringFormat.date.nextmonth,value:"nextmonth"}]}],width:"150px"},{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.DateOccurringRuleDialogTemplate,Aue);let Pue={text:"${res.conditionalFormat.aDateOccurring}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-a-date-occurring",commandName:p.HighlightCellsRulesDateOccurring,execute:async(e,t)=>{let i=await e._showDialog(G.DateOccurringRuleDialogTemplate,Iue());i&&(Mue(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Iue(){return{value1:"yesterday"}}function Mue(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=ra(t.ruleStyle,e),o=GC.Spread.Sheets.ConditionalFormatting.DateOccurringType,l=o.yesterday;switch(t.value1){case"yesterday":l=o.yesterday;break;case"today":l=o.today;break;case"tomorrow":l=o.tomorrow;break;case"last7days":l=o.last7Days;break;case"lastweek":l=o.lastWeek;break;case"thisweek":l=o.thisWeek;break;case"nextweek":l=o.nextWeek;break;case"lastmonth":l=o.lastMonth;break;case"thismonth":l=o.thisMonth;break;case"nextmonth":l=o.nextMonth;break}let c=GC.Spread.Sheets.ConditionalFormatting.RuleType.dateOccurringRule,d=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(c,a,r,void 0,void 0,void 0,void 0,void 0,l,void 0);oa(e,!1,d)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"dateOccurringRule",type:t.value1,style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const kue=Object.freeze(Object.defineProperty({__proto__:null,aDateOccurring:Pue},Symbol.toStringTag,{value:"Module"})),Rue=function(){return{templateName:G.BetweenRuleDialogTemplate,title:s.conditionalFormatting.between.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.between.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.between.title,margin:"5px",absoluteReference:!0,needSheetName:!1,bindingPath:"value1"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 3px",text:s.conditionalFormatting.common.and}],width:"auto"},{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.between.title,margin:"5px",absoluteReference:!0,needSheetName:!1,bindingPath:"value2"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 3px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.BetweenRuleDialogTemplate,Rue);let _ue={text:"${res.conditionalFormat.between}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-between",commandName:p.HighlightCellsRulesBetween,execute:async(e,t)=>{let i=await e._showDialog(G.BetweenRuleDialogTemplate,Oue(),bi.validateConditionalFormatHighLightCellsRulesFormula);i&&(Eue(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Oue(){return{value1:"0",value2:"0"}}function Eue(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=Ju(t.value1,e),o=t.value2||"",l=ra(t.ruleStyle,e),c=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between,d=GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule,u=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(d,a,l,c,r,o,void 0,void 0,void 0,void 0);oa(e,!1,u)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"cellValueRule",comparisonOperator:"between",value1:t.value1||"",value2:t.value2||"",style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const Nue=Object.freeze(Object.defineProperty({__proto__:null,between:_ue},Symbol.toStringTag,{value:"Module"})),Bue=function(){return{templateName:G.TextContainRuleDialogTemplate,title:s.conditionalFormatting.textThatContains.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.textThatContains.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.textThatContains.title,margin:"5px",absoluteReference:!0,needSheetName:!1,bindingPath:"value1"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.TextContainRuleDialogTemplate,Bue);let Fue={text:"${res.conditionalFormat.textThatContains}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-text-that-contains",commandName:p.HighlightCellsRulesContains,execute:async(e,t)=>{let i=await e._showDialog(G.TextContainRuleDialogTemplate,Gue(),bi.validateConditionalFormatHighLightCellsRulesFormula);i&&(Vue(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Gue(){return{value1:"0"}}function Vue(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=t.value1||"",o=ra(t.ruleStyle,e),l=GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators.contains,c=GC.Spread.Sheets.ConditionalFormatting.RuleType.specificTextRule,d=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(c,a,o,l,void 0,void 0,r,void 0,void 0,void 0);oa(e,!1,d)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"specificTextRule",comparisonOperator:"contains",text:t.value1||"",style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const Hue=Object.freeze(Object.defineProperty({__proto__:null,textThatContains:Fue},Symbol.toStringTag,{value:"Module"})),zue=function(){return{templateName:G.DuplicateValueRuleDialogTemplate,title:s.conditionalFormatting.duplicateValuesFormat.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.duplicateValuesFormat.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",margin:"5px",bindingPath:"value1",items:[{text:s.conditionalFormatting.newFormattingRule.formatUnique.type.duplicate,value:"duplicate"},{text:s.conditionalFormatting.newFormattingRule.formatUnique.type.unique,value:"unique"}]}],width:"120px"},{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.DuplicateValueRuleDialogTemplate,zue);let jue={text:"${res.conditionalFormat.duplicateValues}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-duplicate-values",commandName:p.HighlightCellsRulesDuplicateValues,execute:async(e,t)=>{let i=await e._showDialog(G.DuplicateValueRuleDialogTemplate,Wue());i&&(Zue(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Wue(){return{value1:"duplicate"}}function Zue(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=ra(t.ruleStyle,e),o=GC.Spread.Sheets.ConditionalFormatting.RuleType.duplicateRule;switch(t.value1){case"duplicate":o=GC.Spread.Sheets.ConditionalFormatting.RuleType.duplicateRule;break;case"unique":o=GC.Spread.Sheets.ConditionalFormatting.RuleType.uniqueRule;break}let l=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(o,a,r,void 0,void 0,void 0,void 0,void 0,void 0,void 0);oa(e,!1,l)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:t.value1==="unique"?"uniqueRule":"duplicateRule",style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const Uue=Object.freeze(Object.defineProperty({__proto__:null,duplicateValues:jue},Symbol.toStringTag,{value:"Module"})),Jue=function(){return{templateName:G.EqualToRuleDialogTemplate,title:s.conditionalFormatting.equalTo.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.equalTo.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.equalTo.title,margin:"5px",absoluteReference:!0,needSheetName:!1,bindingPath:"value1"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.EqualToRuleDialogTemplate,Jue);let Yue={text:"${res.conditionalFormat.equalTo}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-equal-to",commandName:p.HighlightCellsRulesEqualTo,execute:async(e,t)=>{let i=await e._showDialog(G.EqualToRuleDialogTemplate,que(),bi.validateConditionalFormatHighLightCellsRulesFormula);i&&(Kue(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function que(){return{value1:"0"}}function Kue(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=Ju(t.value1,e),o=ra(t.ruleStyle,e),l=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.equalsTo,c=GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule,d=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(c,a,o,l,r,void 0,void 0,void 0,void 0,void 0);oa(e,!1,d)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"cellValueRule",comparisonOperator:"equalsTo",value1:t.value1||"",style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const Que=Object.freeze(Object.defineProperty({__proto__:null,equalTo:Yue},Symbol.toStringTag,{value:"Module"})),Xue=function(){return{templateName:G.GreaterThanRuleDialogTemplate,title:s.conditionalFormatting.greaterThan.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.greaterThan.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.greaterThan.title,margin:"5px",absoluteReference:!0,needSheetName:!1,bindingPath:"value1"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 3px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.GreaterThanRuleDialogTemplate,Xue);let $ue={text:"${res.conditionalFormat.greaterThan}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-greater-than",commandName:p.HighlightCellsRulesGreaterThan,execute:async(e,t)=>{let i=await e._showDialog(G.GreaterThanRuleDialogTemplate,ehe(),bi.validateConditionalFormatHighLightCellsRulesFormula);i&&(the(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function ehe(){return{value1:"0"}}function the(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=Ju(t.value1,e),o=ra(t.ruleStyle,e),l=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan,c=GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule,d=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(c,a,o,l,r,void 0,void 0,void 0,void 0,void 0);oa(e,!1,d)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"cellValueRule",comparisonOperator:"greaterThan",value1:t.value1||"",style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const ihe=Object.freeze(Object.defineProperty({__proto__:null,greaterThan:$ue},Symbol.toStringTag,{value:"Module"}));let nhe={commandName:p.HighlightCellsRules,text:"${res.conditionalFormat.highlightCellsRules}",iconClass:"ribbon-control-dropdown-highlight-cells-rules",bigButton:"=IF(inDropdown, true, ribbonHeight>toolbarHeight)",direction:'=IF(inDropdown, "horizontal", "vertical")'};const ahe=Object.freeze(Object.defineProperty({__proto__:null,highlightCellsRules:nhe},Symbol.toStringTag,{value:"Module"})),rhe=function(){return{templateName:G.LessThanRuleDialogTemplate,title:s.conditionalFormatting.lessThan.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.lessThan.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.lessThan.title,margin:"5px",absoluteReference:!0,needSheetName:!1,bindingPath:"value1"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 3px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.LessThanRuleDialogTemplate,rhe);let ohe={text:"${res.conditionalFormat.lessThan}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-less-than",commandName:p.HighlightCellsRulesLessThan,execute:async(e,t)=>{let i=await e._showDialog(G.LessThanRuleDialogTemplate,lhe(),bi.validateConditionalFormatHighLightCellsRulesFormula);i&&(she(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function lhe(){return{value1:"0"}}function she(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=Ju(t.value1,e),o=ra(t.ruleStyle,e),l=GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.lessThan,c=GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule,d=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(c,a,o,l,r,void 0,void 0,void 0,void 0,void 0);oa(e,!1,d)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"cellValueRule",comparisonOperator:"lessThan",value1:t.value1||"",style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const che=Object.freeze(Object.defineProperty({__proto__:null,lessThan:ohe},Symbol.toStringTag,{value:"Module"}));let dhe={text:"${res.conditionalFormat.moreRules}",title:"${res.conditionalFormat.moreHighlightCellsRules}",commandName:p.HighlightCellsMoreRules,controlOption:{className:"more-rules-item"},execute:async(e,t)=>{let i=Jb(e);i.cellValue={operator:"greaterThan"};let n=bi.getNewFormatRuleDialogOption(e,e.Spread);n.ruleTypeGroup=Kn.FormatContain,n.ruleFormatContain=i;let a=await e._showDialog(G.NewFormattingRuleDialogTemplate,n,bi.validateConditionalFormatDialogFormula);a&&(uhe(e.Spread,a,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function uhe(e,t,i){let n=bi.ruleValueToRule(e,t);if(n){let a=C.getActiveSheet(e);if(a){if(!n.ranges()){let o=a.getSelections();n.ranges(o)}oa(e,!1,n)}else $u(e,n,kn.add,i)}}const hhe=Object.freeze(Object.defineProperty({__proto__:null,highlightCellsMoreRules:dhe},Symbol.toStringTag,{value:"Module"})),sa=(e,t)=>{let i=e.Spread,n=C.getActiveSheet(i);if(n){let a=n.getSelections(),r=new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(t,a);oa(i,!0,r)}else{let a=i.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=e.getData(re.tableSheetSelectedColumn);if(o>=0){let l=[{ruleType:"iconSetRule",iconSetType:GC.Spread.Sheets.ConditionalFormatting.IconSetType[t]}];Oi(i,o,"conditionalFormats",l,kn.replace)}}}e.setData(re.isFileModified,!0)};let phe={iconClass:"common-icon three-triangles",iconWidth:100,iconHeight:20,commandName:p.IconSet3Triangles,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTriangles)}};const mhe=Object.freeze(Object.defineProperty({__proto__:null,iconSet3Triangles:phe},Symbol.toStringTag,{value:"Module"}));let ghe={iconClass:"common-icon five-arrows-colored",iconWidth:100,iconHeight:20,commandName:p.IconSetFiveArrowsColored,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored)}};const fhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFiveArrowsColored:ghe},Symbol.toStringTag,{value:"Module"}));let bhe={iconClass:"common-icon five-arrows-gray",iconWidth:100,iconHeight:20,commandName:p.IconSetFiveArrowsGray,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsGray)}};const She=Object.freeze(Object.defineProperty({__proto__:null,iconSetFiveArrowsGray:bhe},Symbol.toStringTag,{value:"Module"}));let Che={iconClass:"common-icon five-boxes",iconWidth:100,iconHeight:20,commandName:p.IconSetFiveBoxes,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveBoxes)}};const yhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFiveBoxes:Che},Symbol.toStringTag,{value:"Module"}));let vhe={iconClass:"common-icon five-quarters",iconWidth:100,iconHeight:20,commandName:p.IconSetFiveQuarters,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveQuarters)}};const xhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFiveQuarters:vhe},Symbol.toStringTag,{value:"Module"}));let Lhe={iconClass:"common-icon five-ratings",iconWidth:100,iconHeight:20,commandName:p.IconSetFiveRatings,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveRatings)}};const The=Object.freeze(Object.defineProperty({__proto__:null,iconSetFiveRatings:Lhe},Symbol.toStringTag,{value:"Module"}));let whe={iconClass:"common-icon four-arrows-colored",iconWidth:100,iconHeight:20,commandName:p.IconSetFourArrowsColored,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsColored)}};const Dhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFourArrowsColored:whe},Symbol.toStringTag,{value:"Module"}));let Ahe={iconClass:"common-icon four-arrows-gray",iconWidth:100,iconHeight:20,commandName:p.IconSetFourArrowsGray,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourArrowsGray)}};const Phe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFourArrowsGray:Ahe},Symbol.toStringTag,{value:"Module"}));let Ihe={iconClass:"common-icon four-ratings",iconWidth:100,iconHeight:20,commandName:p.IconSetFourRatings,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRatings)}};const Mhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFourRatings:Ihe},Symbol.toStringTag,{value:"Module"}));let khe={iconClass:"common-icon four-red-to-black",iconWidth:100,iconHeight:20,commandName:p.IconSetFourRedToBlack,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourRedToBlack)}};const Rhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFourRedToBlack:khe},Symbol.toStringTag,{value:"Module"}));let _he={iconClass:"common-icon four-traffic-lights",iconWidth:100,iconHeight:20,commandName:p.IconSetFourTrafficLights,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights)}};const Ohe=Object.freeze(Object.defineProperty({__proto__:null,iconSetFourTrafficLights:_he},Symbol.toStringTag,{value:"Module"}));let Ehe={commandName:p.Directional,title:"${res.conditionalFormat.directional}"},Nhe={commandName:p.Shapes,title:"${res.conditionalFormat.shapes}"},Bhe={commandName:p.Indicators,title:"${res.conditionalFormat.indicators}"},Fhe={commandName:p.Ratings,title:"${res.conditionalFormat.ratings}"},Ghe={commandName:p.IconSetList,text:"${res.conditionalFormat.iconSets}",iconClass:"ribbon-control-dropdown-icon-sets",bigButton:"=ribbonHeight>toolbarHeight",comboWidth:230};const Vhe=Object.freeze(Object.defineProperty({__proto__:null,IconSetList:Ghe,directional:Ehe,indicators:Bhe,ratings:Fhe,shapes:Nhe},Symbol.toStringTag,{value:"Module"}));let Hhe={iconClass:"common-icon three-arrows-colored",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeArrowsColored,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored)}};const zhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeArrowsColored:Hhe},Symbol.toStringTag,{value:"Module"}));let jhe={iconClass:"common-icon three-arrows-gray",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeArrowsGray,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsGray)}};const Whe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeArrowsGray:jhe},Symbol.toStringTag,{value:"Module"}));let Zhe={iconClass:"common-icon three-flags",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeFlags,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeFlags)}};const Uhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeFlags:Zhe},Symbol.toStringTag,{value:"Module"}));let Jhe={iconClass:"common-icon three-signs",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeSigns,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSigns)}};const Yhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeSigns:Jhe},Symbol.toStringTag,{value:"Module"}));let qhe={iconClass:"common-icon three-stars",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeStars,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeStars)}};const Khe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeStars:qhe},Symbol.toStringTag,{value:"Module"}));let Qhe={iconClass:"common-icon three-symbols-circled",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeSymbolsCircled,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsCircled)}};const Xhe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeSymbolsCircled:Qhe},Symbol.toStringTag,{value:"Module"}));let $he={iconClass:"common-icon three-symbols-uncircled",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeSymbolsUnCircled,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeSymbolsUncircled)}};const epe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeSymbolsUncircled:$he},Symbol.toStringTag,{value:"Module"}));let tpe={iconClass:"common-icon three-traffic-lights-rimmed",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeTrafficLightsRimmed,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsRimmed)}};const ipe=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeTrafficLightsRimmed:tpe},Symbol.toStringTag,{value:"Module"}));let npe={iconClass:"common-icon three-traffic-lights-unrimmed",iconWidth:100,iconHeight:20,commandName:p.IconSetThreeTrafficLightsUnRimmed,execute:(e,t,i)=>{sa(e,GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsUnrimmed)}};const ape=Object.freeze(Object.defineProperty({__proto__:null,iconSetThreeTrafficLightsUnrimmed:npe},Symbol.toStringTag,{value:"Module"}));let rpe={text:"${res.conditionalFormat.moreRules}",title:"${res.conditionalFormat.moreIconSetRules}",commandName:p.MoreIconSetRules,controlOption:{className:"more-rules-item"},execute:async(e,t)=>{let i=bi.getNewFormatRuleDialogOption(e,e.Spread);i.baseOnValueRuleType=go.IconSets;let n=await e._showDialog(G.NewFormattingRuleDialogTemplate,i,bi.validateConditionalFormatDialogFormula);n&&(ope(e.Spread,n,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function ope(e,t,i){let n=bi.ruleValueToRule(e,t);if(n){let a=C.getActiveSheet(e);if(a){if(!n.ranges()){let o=a.getSelections();n.ranges(o)}oa(e,!1,n)}else $u(e,n,kn.add,i)}}const lpe=Object.freeze(Object.defineProperty({__proto__:null,moreIconSetRules:rpe},Symbol.toStringTag,{value:"Module"})),nO=function(){return{templateName:G.RuleManagerDialogTemplate,title:s.formattingRulesManagerDialog.title,resizable:!0,content:[{type:"FlexContainer",height:"100%",children:[{type:"RuleManagerEditor",bindingPath:"rules"}]}],buttons:[{text:s.ok,buttonType:"Ok"},{text:s.close,buttonType:"Cancel"},{text:s.apply,click:function(e,t,i){const n=e.rules.spread,a=C.deepClone(e,["spread"]);a.rules.spread=n;let r=Pe.getContextSpread(),o=Pe.getContextDesigner();r&&o&&Qb(r,a,o,!1),i("",a)}}]}};_e(G.RuleManagerDialogTemplate,nO);function aO(e,t){let i="Designer."+t;e.commandManager().register(i,lO,void 0,!1,!1,!1,!1)}function rO(e,t){let i="Designer."+t;e.commandManager().register(i,sO,void 0,!1,!1,!1,!1)}function spe(e,t){oe.runCommand(e,"applyRule",lO,{spread:e,options:t})}function cpe(e,t){oe.runCommand(e,"applyRuleCanNotUndo",sO,{spread:e,options:t})}class oO extends oe.DesignerActionBase{executeImp(t,i,n){t.suspendPaint();try{let a;i.options.rules.target?a=t.getSheetFromName(i.options.rules.target):a=C.getActiveSheet(t);let r=a.conditionalFormats;r.clearRule();let o=i.options.rules.ruleItems;for(let l=o.length-1;l>=0;l--){let c=bi.ruleItemToRule(t,o[l]);c&&y0(a,r,c)}}finally{t.resumePaint()}}}let lO={canUndo:!0,execute:function(e,t,i){return new oO(e,t).execute(e,t,i)}},sO={canUndo:!1,execute:function(e,t,i){return new oO(e,t).execute(e,t,i)}};_e(G.RuleManagerDialogTemplate,nO);let dpe={text:"${res.conditionalFormat.manageRules}",iconClass:"ribbon-control-dropdown-manage-rules",commandName:p.ConditionFormatManageRule,execute:async(e,t)=>{let i=await e._showDialog(G.RuleManagerDialogTemplate,upe(e.Spread,e));i&&Qb(e.Spread,i,e)},init:e=>{aO(e.Spread,"applyRule"),rO(e.Spread,"applyRuleCanNotUndo")}};function upe(e,t){let i=[],n=C.getActiveSheet(e);if(n){let l=n.conditionalFormats,c=l.getRules(),d=new GC.Spread.Sheets.ConditionalFormatting.ConditionalFormats(n);d.fromJSON(l.toJSON());let u=d.getRules();for(let h=0;h<c.length;h++)u[h]._isCustomIconSet=c[h]._isCustomIconSet;u.sort((h,g)=>g.priority()-h.priority());for(let h=u.length-1;h>=0;h--)i.push(u[h])}else{let l=e.getActiveSheetTab();if(C._isTableSheet(l)){let c=l.getDataView();if(c){let d=t.getData(re.tableSheetSelectedColumn);if(d>=0){let h=c.getColumn(d).conditionalFormats;if(h)for(let g=0;g<h.length;g++){let f=R0(h[g]);f&&i.push(f)}}}}}let a=e.getActiveSheet(),r=0;if(a){let l=a.getSelections();i.forEach(c=>{for(const d of l)c.intersects(d.row,d.col,d.rowCount,d.colCount)?(c.visible=!0,c._idTag=r++):(c.visible=!1,c._idTag=r++)})}else i.forEach(l=>{l.visible=!0,l._idTag=r++});let o=[];for(let l=0;l<i.length;l++)o.push(bi.ruleToRuleItem(t,e,i[l]));return{rules:{ruleItems:o,spread:e}}}function hpe(e,t,i){var r;const n=t.conditionalFormats.getRules(),a=t.getParent();for(const o of i.rules.ruleItems){const l=Ae.stringToRange(a,o.ruleRange),c=n.find(u=>u._idTag===o._idTag);if(!c)continue;const d=bi.ruleToRuleItem(e,a,c);if(!l||l.length<1)o.ruleRange=d.ruleRange;else{const u=o.ruleRange.split("!");if(u.length>1){const h=u[0].substring(2,u[0].length-1);h&&h.toLocaleUpperCase()!==((r=i.rules.target)==null?void 0:r.toLocaleUpperCase())&&(o.ruleRange=d.ruleRange)}}}}function Qb(e,t,i,n=!0){let a;if(t.rules.target?a=e.getSheetFromName(t.rules.target):a=C.getActiveSheet(e),a)hpe(i,a,t),n?spe(e,t):cpe(e,t);else{let r=e.getActiveSheetTab();if(C._isTableSheet(r)&&r.getDataView()){let l=i.getData(re.tableSheetSelectedColumn);if(l>=0){let c=[];I0(t,c,e),Oi(e,l,"conditionalFormats",c,kn.overwrite)}}}}const ppe=Object.freeze(Object.defineProperty({__proto__:null,execute_ruleManager:Qb,manageRules:dpe},Symbol.toStringTag,{value:"Module"}));let mpe={text:"${res.conditionalFormat.newRule}",iconClass:"ribbon-control-dropdown-new-rule",commandName:p.ConditionFormatNewRule,execute:async(e,t)=>{let i=await e._showDialog(G.NewFormattingRuleDialogTemplate,bi.getNewFormatRuleDialogOption(e,e.Spread),bi.validateConditionalFormatDialogFormula);i&&(gpe(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function gpe(e,t,i){let n=bi.ruleValueToRule(e,t);if(n){let a=C.getActiveSheet(e);if(a){if(!n.ranges()){let o=a.getSelections();n.ranges(o)}oa(e,!1,n)}else $u(e,n,kn.add,i)}}const fpe=Object.freeze(Object.defineProperty({__proto__:null,newRule:mpe},Symbol.toStringTag,{value:"Module"})),bpe=function(){return{templateName:G.AboveAverageRuleDialogTemplate,title:s.conditionalFormatting.aboveAverage.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.aboveAverage.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.selectedRangeWith}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.AboveAverageRuleDialogTemplate,bpe);let Spe={text:"${res.conditionalFormat.aboveAverage}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-above-average",commandName:p.TopBottomRulesAboveAverage,execute:async(e,t)=>{let i=await e._showDialog(G.AboveAverageRuleDialogTemplate,Cpe());i&&(ype(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Cpe(){return{}}function ype(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=ra(t.ruleStyle,e),o=GC.Spread.Sheets.ConditionalFormatting.RuleType.averageRule,l=GC.Spread.Sheets.ConditionalFormatting.AverageConditionType.above,c=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(o,a,r,void 0,void 0,void 0,void 0,void 0,l,void 0);oa(e,!1,c)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l),Oi(e,o,"conditionalFormats",[{ruleType:"averageRule",type:"above",style:l}],kn.add)}}}}const vpe=Object.freeze(Object.defineProperty({__proto__:null,aboveAverage:Spe},Symbol.toStringTag,{value:"Module"})),xpe=function(){return{templateName:G.BelowAverageRuleDialogTemplate,title:s.conditionalFormatting.belowAverage.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.belowAverage.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.selectedRangeWith}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.BelowAverageRuleDialogTemplate,xpe);let Lpe={text:"${res.conditionalFormat.belowAverage}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-below-average",commandName:p.TopBottomRulesBelowAverage,execute:async(e,t)=>{let i=await e._showDialog(G.BelowAverageRuleDialogTemplate,Tpe());i&&(wpe(e.Spread,i,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Tpe(){return{}}function wpe(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=ra(t.ruleStyle,e),o=GC.Spread.Sheets.ConditionalFormatting.RuleType.averageRule,l=GC.Spread.Sheets.ConditionalFormatting.AverageConditionType.below,c=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(o,a,r,void 0,void 0,void 0,void 0,void 0,l,void 0);oa(e,!1,c)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l),Oi(e,o,"conditionalFormats",[{ruleType:"averageRule",type:"below",style:l}],kn.add)}}}}const Dpe=Object.freeze(Object.defineProperty({__proto__:null,belowAverage:Lpe},Symbol.toStringTag,{value:"Module"})),Ape=function(){return{templateName:G.Bottom10RuleDialogTemplate,title:s.conditionalFormatting.bottom10items.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.bottom10items.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"NumberEditor",margin:"5px",min:1,max:1e3,bindingPath:"number"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.Bottom10RuleDialogTemplate,Ape);let Ppe={text:"${res.conditionalFormat.bottom10Items}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-bottom-10-items",commandName:p.TopBottomRulesBottom10,execute:async(e,t)=>{let i=Ipe();i.number=10;let n=await e._showDialog(G.Bottom10RuleDialogTemplate,i);n&&(Mpe(e.Spread,n,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function Ipe(){return{}}function Mpe(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=t.number||10,o=ra(t.ruleStyle,e),l=GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.bottom,c=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule,a,o,void 0,void 0,void 0,void 0,void 0,l,r);oa(e,!1,c)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"top10Rule",type:"bottom",rank:t.number||10,style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const kpe=Object.freeze(Object.defineProperty({__proto__:null,bottomTenItems:Ppe},Symbol.toStringTag,{value:"Module"}));function Rpe(){return{type:"FlexContainer",className:"gc-format-contain-editor",children:[{type:"TextBlock",className:"title",text:s.conditionalFormatting.newFormattingRule.formatContain.description},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",className:"type",bindingPath:"type",items:[{text:s.conditionalFormatting.newFormattingRule.formatContain.type.cellValue,value:"cellValue"},{text:s.conditionalFormatting.newFormattingRule.formatContain.type.specificText,value:"specificText"},{text:s.conditionalFormatting.newFormattingRule.formatContain.type.dateOccurring,value:"dateOccurring"},{text:s.conditionalFormatting.newFormattingRule.formatContain.type.blanks,value:"blanks"},{text:s.conditionalFormatting.newFormattingRule.formatContain.type.noBlanks,value:"noBlanks"},{text:s.conditionalFormatting.newFormattingRule.formatContain.type.errors,value:"errors"},{text:s.conditionalFormatting.newFormattingRule.formatContain.type.noErrors,value:"noErrors"}]}],width:"150px"},{type:"Column",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",className:"operator",margin:"5px 0 0 0 ",bindingPath:"cellValue.operator",popupWidth:240,items:[{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.between,value:"between"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.notBetween,value:"notBetween"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.equalTo,value:"equalTo"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.notEqualTo,value:"notEqualTo"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.greaterThan,value:"greaterThan"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.lessThan,value:"lessThan"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.greaterThanOrEqu,value:"greaterThanOrEqu"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_cellValue.lessThanOrEqu,value:"lessThanOrEqu"}]}],width:"170px"},{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.newFormattingRule.title,absoluteReference:!0,className:"range-selector",margin:"5px 0 0 0 ",text:"RangeSelect",bindingPath:"cellValue.value1"}],width:"140px"},{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.and}],width:"35px",visibleWhen:"cellValue.operator=between"},{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.newFormattingRule.title,absoluteReference:!0,className:"range-selector",text:"RangeSelect",margin:"5px 0 0 0 ",bindingPath:"cellValue.value2"}],width:"140px",visibleWhen:"cellValue.operator=between"},{type:"Column",margin:"8px 0 0 5px",children:[{type:"TextBlock",className:"label",text:s.conditionalFormatting.common.and}],width:"35px",visibleWhen:"cellValue.operator=notBetween"},{type:"Column",margin:"5px 0 0 -5px",children:[{type:"RangeSelect",title:s.conditionalFormatting.newFormattingRule.title,className:"range-selector",text:"RangeSelect",absoluteReference:!0,bindingPath:"cellValue.value2"}],width:"140px",visibleWhen:"cellValue.operator=notBetween"}],visibleWhen:"type=cellValue"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",className:"operator",margin:"5px 0 0 0 ",bindingPath:"specificText.operator",items:[{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_specificText.containing,value:"containing"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_specificText.notContaining,value:"notContaining"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_specificText.beginningWith,value:"beginningWith"},{text:s.conditionalFormatting.newFormattingRule.formatContain.operator_specificText.endingWith,value:"endingWith"}]}],width:"170px"},{type:"Column",children:[{type:"RangeSelect",title:s.conditionalFormatting.newFormattingRule.title,absoluteReference:!0,className:"range-selector",margin:"5px 0 0 0 ",bindingPath:"specificText.value"}],width:"stretch"}],visibleWhen:"type=specificText"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",className:"operator",margin:"5px 0 0 0 ",bindingPath:"dateOccurring.operator",items:[{text:s.conditionalFormatting.dateOccurringFormat.date.yesterday,value:"yesterday"},{text:s.conditionalFormatting.dateOccurringFormat.date.today,value:"today"},{text:s.conditionalFormatting.dateOccurringFormat.date.tomorrow,value:"tomorrow"},{text:s.conditionalFormatting.dateOccurringFormat.date.last7days,value:"last7days"},{text:s.conditionalFormatting.dateOccurringFormat.date.lastweek,value:"lastweek"},{text:s.conditionalFormatting.dateOccurringFormat.date.thisweek,value:"thisweek"},{text:s.conditionalFormatting.dateOccurringFormat.date.nextweek,value:"nextweek"},{text:s.conditionalFormatting.dateOccurringFormat.date.lastmonth,value:"lastmonth"},{text:s.conditionalFormatting.dateOccurringFormat.date.thismonth,value:"thismonth"},{text:s.conditionalFormatting.dateOccurringFormat.date.nextmonth,value:"nextmonth"}]}],width:"170px"}],visibleWhen:"type=dateOccurring"}],width:"auto"}]},{type:"LabelLine",margin:"15px 0 0 0"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",className:"preview-label",text:s.conditionalFormatting.newFormattingRule.preview.description}],width:"auto"},{type:"Column",children:[{type:"FormatRulePreview",bindingPath:"ruleStyle",id:"formatRulePreview"}],width:"210px"},{type:"Column",children:[{type:"Button",margin:"10px 0 0 0",bindingPath:"ruleStyle",id:"previewFormatButton",text:s.conditionalFormatting.newFormattingRule.preview.buttonText}],width:"80px"}]}]}}var _pe=Object.getOwnPropertyDescriptor,Ope=(e,t,i,n)=>{for(var a=n>1?void 0:n?_pe(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};const _0=C.isNullOrUndefined;let cO=class extends Bt{constructor(){super(...arguments),this._dialogOwner=Pe.getDialogOwner()}getComponentJson(){return[Rpe()]}_attachEvent(){let t=this;this.previewFormatButton.on(rt.ButtonClicked,async()=>{let i=t.value.ruleStyle,n=await this._dialogOwner._showDialog(G.ConditionalFormatDialogTemplate,Ke(i));n&&(Qo(n,i),t.formatRulePreview.value=i,t.previewFormatButton.value=i,t.raiseValueChanged())})}get previewFormatButton(){return this.getComponent("previewFormatButton")}get formatRulePreview(){return this.getComponent("formatRulePreview")}};cO=Ope([Ue.Register("FormatContainEditor")],cO);function Qo(e,t){delete e.alignmentTabOption,delete e.cellButtonTabOption,delete e.paddingTabOption,delete e.maskOption,delete e.decorationTabOption;let i=Cn(t,e);Epe(i,e),dO(t),Npe(i,t),Bpe(i,t),Fpe(i,t),Gpe(i,t),Vpe(i,t)}function Epe(e,t){t.fontTabOption&&(e.font&&e.font.fontWeight!==void 0&&(t.fontTabOption.fontWeight=e.font.fontWeight),e.font&&e.font.fontStyle!==void 0&&(t.fontTabOption.fontStyle=e.font.fontStyle))}function Npe(e,t){e.formatter!==void 0&&t.numberTabOption&&(t.numberTabOption.formatter=e.formatter)}function Bpe(e,t){t.fontTabOption&&(e.foreColor!==void 0&&(e.foreColor===""&&(e.foreColor=void 0),t.fontTabOption.foreColor=e.foreColor),e.font&&e.font.fontWeight!==void 0&&(t.fontTabOption.fontWeight=e.font.fontWeight),e.font&&e.font.fontStyle!==void 0&&(t.fontTabOption.fontStyle=e.font.fontStyle),e.textDecoration!==void 0&&t.fontTabOption.fontUnderlineListAndEffects&&(e.textDecoration===0&&(e.textDecoration=void 0),t.fontTabOption.fontUnderlineListAndEffects.textDecoration=e.textDecoration))}function Fpe(e,t){t.borderTabOption||(t.borderTabOption={}),e.borderTop!==void 0&&(t.borderTabOption.borderTop=e.borderTop),e.borderBottom!==void 0&&(t.borderTabOption.borderBottom=e.borderBottom),e.borderLeft!==void 0&&(t.borderTabOption.borderLeft=e.borderLeft),e.borderRight!==void 0&&(t.borderTabOption.borderRight=e.borderRight),e.borderHorizontal!==void 0&&(t.borderTabOption.borderHorizontal=e.borderHorizontal),e.borderVertical!==void 0&&(t.borderTabOption.borderVertical=e.borderVertical),e.diagonalUp!==void 0&&(t.borderTabOption.diagonalUp=e.diagonalUp),e.diagonalDown!==void 0&&(t.borderTabOption.diagonalDown=e.diagonalDown)}function Gpe(e,t){e.backColor!==void 0&&t.fillTabOption&&(e.backColor===""&&(e.backColor=void 0),t.fillTabOption.backColor=e.backColor)}function Vpe(e,t){t.protectionTabOption&&(_0(e.locked)||(t.protectionTabOption.locked=e.locked),_0(e.hidden)||(t.protectionTabOption.hidden=e.hidden),_0(e.allowEditInCell)||(t.protectionTabOption.allowEditInCell=e.allowEditInCell))}function dO(e){for(let t in e)e.hasOwnProperty(t)&&(t==="textDecoration"&&!e[t]?e[t]=void 0:e[t]instanceof Object?dO(e[t]):e[t]===""&&(e[t]=void 0))}function Hpe(){return{type:"FlexContainer",className:"gc-format-contain-editor",children:[{type:"TextBlock",className:"title",text:s.conditionalFormatting.newFormattingRule.formatContain.description},{type:"ColumnSet",margin:"10px 0 0 0",children:[{type:"Column",children:[{type:"ListComboEditor",className:"row-column-states-direction-list",bindingPath:"direction",items:[{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.direction.row,value:1},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.direction.column,value:0}]}],width:"100px",margin:"0 20px 0 0"},{type:"Column",children:[{type:"ListComboEditor",className:"row-column-states-type-list",visibleWhen:"isReportSheet!=true",bindingPath:"state",items:[{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.hover,value:GC.Spread.Sheets.RowColumnStates.hover},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.invalid,value:GC.Spread.Sheets.RowColumnStates.invalid},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.edit,value:GC.Spread.Sheets.RowColumnStates.edit},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.active,value:GC.Spread.Sheets.RowColumnStates.active},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.selected,value:GC.Spread.Sheets.RowColumnStates.selected},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.dirty,value:GC.Spread.Sheets.RowColumnStates.dirty},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.inserted,value:GC.Spread.Sheets.RowColumnStates.inserted},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.invalidFormula,value:GC.Spread.Sheets.RowColumnStates.invalidFormula}]},{type:"ListComboEditor",className:"row-column-states-type-list",visibleWhen:"isReportSheet=true",bindingPath:"state",items:[{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.hover,value:GC.Spread.Sheets.RowColumnStates.hover},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.active,value:GC.Spread.Sheets.RowColumnStates.active},{text:s.conditionalFormatting.newFormattingRule.useRowColumnStates.state.selected,value:GC.Spread.Sheets.RowColumnStates.selected}]}],width:"200px"}]},{type:"LabelLine",margin:"15px 0 0 0"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",className:"preview-label",text:s.conditionalFormatting.newFormattingRule.preview.description}],width:"auto"},{type:"Column",children:[{type:"FormatRulePreview",bindingPath:"ruleStyle",id:"formatRulePreview"}],width:"210px"},{type:"Column",children:[{type:"Button",margin:"10px 0 0 0",bindingPath:"ruleStyle",id:"previewFormatButton",text:s.conditionalFormatting.newFormattingRule.preview.buttonText}],width:"80px"}]}]}}var zpe=Object.getOwnPropertyDescriptor,jpe=(e,t,i,n)=>{for(var a=n>1?void 0:n?zpe(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};let uO=class extends Bt{constructor(){super(...arguments),this._dialogOwner=Pe.getDialogOwner()}getComponentJson(){return[Hpe()]}_attachEvent(){let t=this;this.previewFormatButton.on(rt.ButtonClicked,async()=>{let i=t.value.ruleStyle,n=await this._dialogOwner._showDialog(G.ConditionalFormatDialogTemplate,Ke(i));n&&(Qo(n,i),t.formatRulePreview.value=i,t.previewFormatButton.value=i,t.raiseValueChanged())})}get previewFormatButton(){return this.getComponent("previewFormatButton")}get formatRulePreview(){return this.getComponent("formatRulePreview")}};uO=jpe([Ue.Register("UseRowColumnStatesEditor")],uO);function Wpe(){return{type:"FlexContainer",className:"gc-format-above-editor",children:[{type:"TextBlock",text:s.conditionalFormatting.newFormattingRule.formatAbove.description},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",className:"type",bindingPath:"type",items:[{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.above,value:"above"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.below,value:"below"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.equalOrAbove,value:"equalOrAbove"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.equalOrBelow,value:"equalOrBelow"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.std1Above,value:"above1StdDev"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.std1Below,value:"below1StdDev"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.std2Above,value:"above2StdDev"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.std2Below,value:"below2StdDev"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.std3Above,value:"above3StdDev"},{text:s.conditionalFormatting.newFormattingRule.formatAbove.type.std3Below,value:"below3StdDev"}]}],width:"auto"},{type:"Column",children:[{type:"TextBlock",className:"label",text:s.conditionalFormatting.newFormattingRule.formatAbove.description2}],width:"auto"}]},{type:"LabelLine",margin:"15px 0 0 0"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",className:"preview-label",text:s.conditionalFormatting.newFormattingRule.preview.description}],width:"auto"},{type:"Column",children:[{type:"FormatRulePreview",bindingPath:"ruleStyle",id:"formatRulePreview"}],width:"210px"},{type:"Column",children:[{type:"Button",margin:"10px 0 0 0",bindingPath:"ruleStyle",id:"previewFormatButton",text:s.conditionalFormatting.newFormattingRule.preview.buttonText}],width:"80px"}]}]}}var Zpe=Object.getOwnPropertyDescriptor,Upe=(e,t,i,n)=>{for(var a=n>1?void 0:n?Zpe(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};let hO=class extends Bt{constructor(){super(...arguments),this._dialogOwner=Pe.getDialogOwner()}getComponentJson(){return[Wpe()]}_attachEvent(){let t=this;this.previewFormatButton.on(rt.ButtonClicked,async()=>{let i=t.value.ruleStyle,n=await this._dialogOwner._showDialog(G.ConditionalFormatDialogTemplate,Ke(i));n&&(Qo(n,i),t.formatRulePreview.value=i,t.previewFormatButton.value=i,t.raiseValueChanged())})}get previewFormatButton(){return this.getComponent("previewFormatButton")}get formatRulePreview(){return this.getComponent("formatRulePreview")}};hO=Upe([Ue.Register("FormatAboveEditor")],hO);function Jpe(){return{type:"FlexContainer",className:"gc-format-ranked-value-editor",children:[{type:"TextBlock",className:"title",text:s.conditionalFormatting.newFormattingRule.formatRankedValue.description},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",className:"type",bindingPath:"type",items:[{text:s.conditionalFormatting.newFormattingRule.formatRankedValue.type.top,value:"top"},{text:s.conditionalFormatting.newFormattingRule.formatRankedValue.type.bottom,value:"bottom"}]}],width:"auto"},{type:"Column",children:[{type:"NumberEditor",className:"value",bindingPath:"rank",min:1,max:1e3}],width:"210px"}]},{type:"LabelLine",margin:"15px 0 0 0"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",className:"preview-label",text:s.conditionalFormatting.newFormattingRule.preview.description}],width:"auto"},{type:"Column",children:[{type:"FormatRulePreview",bindingPath:"ruleStyle",id:"formatRulePreview"}],width:"210px"},{type:"Column",children:[{type:"Button",margin:"10px 0 0 0",bindingPath:"ruleStyle",id:"previewFormatButton",text:s.conditionalFormatting.newFormattingRule.preview.buttonText}],width:"80px"}]}]}}var Ype=Object.getOwnPropertyDescriptor,qpe=(e,t,i,n)=>{for(var a=n>1?void 0:n?Ype(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};let pO=class extends Bt{constructor(){super(...arguments),this._dialogOwner=Pe.getDialogOwner()}getComponentJson(){return[Jpe()]}_attachEvent(){let t=this;this.previewFormatButton.on(rt.ButtonClicked,async()=>{let i=t.value.ruleStyle,n=await this._dialogOwner._showDialog(G.ConditionalFormatDialogTemplate,Ke(i));n&&(Qo(n,i),t.formatRulePreview.value=i,t.previewFormatButton.value=i,t.raiseValueChanged())})}get previewFormatButton(){return this.getComponent("previewFormatButton")}get formatRulePreview(){return this.getComponent("formatRulePreview")}};pO=qpe([Ue.Register("FormatRankedValueEditor")],pO);function Kpe(){return{type:"FlexContainer",className:"gc-format-unique-editor",children:[{type:"TextBlock",className:"title",text:s.conditionalFormatting.newFormattingRule.formatUnique.description},{type:"ColumnSet",children:[{type:"Column",children:[{type:"ListComboEditor",className:"type",bindingPath:"type",items:[{text:s.conditionalFormatting.newFormattingRule.formatUnique.type.duplicate,value:"duplicate"},{text:s.conditionalFormatting.newFormattingRule.formatUnique.type.unique,value:"unique"}]}],width:"auto"},{type:"Column",children:[{type:"TextBlock",className:"label",text:s.conditionalFormatting.newFormattingRule.formatUnique.description2}],width:"auto"}]},{type:"LabelLine",margin:"10px 0 0 0",text:" "},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",className:"preview-label",text:s.conditionalFormatting.newFormattingRule.preview.description}],width:"auto"},{type:"Column",children:[{type:"FormatRulePreview",bindingPath:"ruleStyle",id:"formatRulePreview"}],width:"210px"},{type:"Column",children:[{type:"Button",margin:"10px 0 0 0",bindingPath:"ruleStyle",id:"previewFormatButton",text:s.conditionalFormatting.newFormattingRule.preview.buttonText}],width:"80px"}]}]}}var Qpe=Object.getOwnPropertyDescriptor,Xpe=(e,t,i,n)=>{for(var a=n>1?void 0:n?Qpe(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};let mO=class extends Bt{constructor(){super(...arguments),this._dialogOwner=Pe.getDialogOwner()}getComponentJson(){return[Kpe()]}_attachEvent(){let t=this;this.previewFormatButton.on(rt.ButtonClicked,async()=>{let i=t.value.ruleStyle,n=await this._dialogOwner._showDialog(G.ConditionalFormatDialogTemplate,Ke(i));n&&(Qo(n,i),t.formatRulePreview.value=i,t.previewFormatButton.value=i,t.raiseValueChanged())})}get previewFormatButton(){return this.getComponent("previewFormatButton")}get formatRulePreview(){return this.getComponent("formatRulePreview")}};mO=Xpe([Ue.Register("FormatUniqueEditor")],mO);let gO=function(){return{templateName:G.NewFormattingRuleDialogTemplate,title:s.conditionalFormatting.newFormattingRule.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",text:s.conditionalFormatting.newFormattingRule.description1},{type:"RuleTypeList",margin:"5px 0 0 0",bindingPath:"ruleTypeGroup"},{type:"TextBlock",margin:"5px 0 0 0",text:s.conditionalFormatting.newFormattingRule.description2},{type:"LabelContainer",text:"",margin:"5px 0 0 0",showText:!1,children:[{type:"Container",visibleWhen:"ruleTypeGroup=FormatOnValue",children:[{type:"TextBlock",margin:"3px 0",text:s.conditionalFormatting.newFormattingRule.formatOnValue.description},{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",margin:"8px 0 3px 0",text:s.conditionalFormatting.newFormattingRule.formatOnValue.formatStyle}],width:wn==="jp"?"120px":"80px"},{type:"Column",children:[{type:"ListComboEditor",margin:"3px 0px",bindingPath:"baseOnValueRuleType",items:[{text:s.conditionalFormatting.newFormattingRule.formatOnValue.formatStyleSelector.color2,value:"ColorScale2"},{text:s.conditionalFormatting.newFormattingRule.formatOnValue.formatStyleSelector.color3,value:"ColorScale3"},{text:s.conditionalFormatting.newFormattingRule.formatOnValue.formatStyleSelector.dataBar,value:"DataBar"},{text:s.conditionalFormatting.newFormattingRule.formatOnValue.formatStyleSelector.iconSets,value:"IconSets"}]}],width:"130px"}]},{type:"ColorScale2Editor",visibleWhen:"baseOnValueRuleType=ColorScale2",bindingPath:"ruleScaleColor2"},{type:"ColorScale3Editor",visibleWhen:"baseOnValueRuleType=ColorScale3",bindingPath:"ruleScaleColor3"},{type:"DataBarEditor",visibleWhen:"baseOnValueRuleType=DataBar",bindingPath:"ruleDataBar"},{type:"IconSetsEditor",visibleWhen:"baseOnValueRuleType=IconSets",bindingPath:"ruleIconSets"}]},{type:"FormatContainEditor",visibleWhen:"ruleTypeGroup=FormatContain",bindingPath:"ruleFormatContain"},{type:"FormatRankedValueEditor",visibleWhen:"ruleTypeGroup=FormatRankedValue",bindingPath:"ruleFormatRankedValue"},{type:"FormatAboveEditor",visibleWhen:"ruleTypeGroup=FormatAbove",bindingPath:"ruleFormatAbove"},{type:"FormatUniqueEditor",visibleWhen:"ruleTypeGroup=FormatUnique",bindingPath:"ruleFormatUnique"},{type:"UseFormulaEditor",visibleWhen:"ruleTypeGroup=UseFormula",bindingPath:"ruleUseFormula"},{type:"UseRowColumnStatesEditor",visibleWhen:"ruleTypeGroup=UseRowColumnStates",bindingPath:"ruleUseRowColumnStates"}]}]}]}},$pe=function(){let e=gO();return e.title=s.conditionalFormatting.newFormattingRule.title2,e.templateName=G.EditFormattingRuleDialogTemplate,e};_e(G.NewFormattingRuleDialogTemplate,gO),_e(G.EditFormattingRuleDialogTemplate,$pe);let eme={text:"${res.conditionalFormat.moreRules}",title:"${res.conditionalFormat.moreTopBottomRules}",commandName:p.TopBottomRulesMoreRules,controlOption:{className:"more-rules-item"},execute:async(e,t)=>{let i=bi.getNewFormatRuleDialogOption(e,e.Spread);i.ruleTypeGroup=Kn.FormatRankedValue;let n=await e._showDialog(G.NewFormattingRuleDialogTemplate,i,bi.validateConditionalFormatDialogFormula);n&&(tme(e.Spread,n,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function tme(e,t,i){let n=bi.ruleValueToRule(e,t);if(n){let a=C.getActiveSheet(e);if(a){if(!n.ranges()){let o=a.getSelections();n.ranges(o)}oa(e,!1,n)}else $u(e,n,kn.add,i)}}const ime=Object.freeze(Object.defineProperty({__proto__:null,topBottomRulesMoreRules:eme},Symbol.toStringTag,{value:"Module"}));let nme={commandName:p.TopBottomRules,text:"${res.conditionalFormat.topBottomRules}",iconClass:"ribbon-control-dropdown-top-bottom-rules",bigButton:"=ribbonHeight>toolbarHeight"};const ame=Object.freeze(Object.defineProperty({__proto__:null,topBottomRules:nme},Symbol.toStringTag,{value:"Module"})),rme=function(){return{templateName:G.Top10RuleDialogTemplate,title:s.conditionalFormatting.top10items.title,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px",text:s.conditionalFormatting.top10items.description,style:"font-weight:bold"},{type:"ColumnSet",children:[{type:"Column",children:[{type:"NumberEditor",margin:"5px",min:1,max:1e3,bindingPath:"number"}],width:"auto"},{type:"Column",children:[{type:"TextBlock",margin:"8px 5px",text:s.conditionalFormatting.common.with}],width:"auto"},{type:"Column",children:[{type:"RuleStyleComboEditor",margin:"5px",bindingPath:"ruleStyle"}],width:"auto"}]}]}]}};_e(G.Top10RuleDialogTemplate,rme);let ome={text:"${res.conditionalFormat.top10Items}",bigButton:"=ribbonHeight>toolbarHeight",iconClass:"ribbon-control-dropdown-top-10-items",commandName:p.TopBottomRulesTop10,execute:async(e,t)=>{let i=lme();i.number=10;let n=await e._showDialog(G.Top10RuleDialogTemplate,i);n&&(sme(e.Spread,n,e.getData(re.tableSheetSelectedColumn)),e.setData(re.isFileModified,!0))}};function lme(){return{}}function sme(e,t,i){let n=C.getActiveSheet(e);if(n){let a=n.getSelections(),r=t.number||10,o=ra(t.ruleStyle,e),l=GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top,c=new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule,a,o,void 0,void 0,void 0,void 0,void 0,l,r);oa(e,!1,c)}else{let a=e.getActiveSheetTab();if(C._isTableSheet(a)&&a.getDataView()){let o=i;if(o>=0){let l={};Ko(t.ruleStyle,l);let c=[{ruleType:"top10Rule",type:"top",rank:t.number||10,style:l}];Oi(e,o,"conditionalFormats",c,kn.add)}}}}const cme=Object.freeze(Object.defineProperty({__proto__:null,topTenItems:ome},Symbol.toStringTag,{value:"Module"}));function dme(e,t){let i="Designer."+t;e.commandManager().register(i,fO,void 0,!1,!1,!1,!1)}function O0(e,t){let i=C.getActiveSheet(e);if(i){let n=i.tables.find(i.getActiveRowIndex(),i.getActiveColumnIndex()),a=n?n.name():null;return oe.runCommand(e,"formatAsTable",fO,{tableStyle:t,tableName:a})}else{let n=t;typeof t=="string"&&(n=GC.Spread.Sheets.Tables.TableThemes[t]);let a=e.getActiveSheetTab();C._isTableSheet(a)&&ose(e,n||void 0)}}let fO={canUndo:!0,execute:function(e,t,i){return new ume(e,t).execute(e,t,i)}};class ume extends cc{executeImp(t,i,n){var g;let a=this,l=C.getActiveSheet(t).getSelections()[0];if(!l)return;let c=l.row===-1?0:l.row,d=l.col===-1?0:l.col,u=null;if(i.tableName&&(u=a.sheet().tables.findByName(i.tableName)),u instanceof GC.Spread.Sheets.Tables.Table)u.style(i.tableStyle);else{a.clearMergeInRange(l);let f;try{f=a.sheet().tables.add(a.getNewTableName(),c,d,l.rowCount,l.colCount,i.tableStyle)}catch(b){return(g=t._designer)==null||g._showMessageBox(b.message,s.title,Re.error),!1}i.tableName?f.name(i.tableName):i.tableName=f.name()}let h=this.sheet().tables.find(c,d);h&&h.showResizeHandle(!0)}}var qr=(e=>(e.wholeTableStyle="wholeTableStyle",e.firstColumnStripStyle="firstColumnStripStyle",e.secondColumnStripStyle="secondColumnStripStyle",e.firstRowStripStyle="firstRowStripStyle",e.secondRowStripStyle="secondRowStripStyle",e.highlightLastColumnStyle="highlightLastColumnStyle",e.highlightFirstColumnStyle="highlightFirstColumnStyle",e.headerRowStyle="headerRowStyle",e.footerRowStyle="footerRowStyle",e.firstHeaderCellStyle="firstHeaderCellStyle",e.lastHeaderCellStyle="lastHeaderCellStyle",e.firstFooterCellStyle="firstFooterCellStyle",e.lastFooterCellStyle="lastFooterCellStyle",e))(qr||{});function hme(){return{type:"FlexContainer",className:"gc-tablestyle_container",children:[{type:"ColumnSet",className:"gc_name_container",children:[{type:"Column",children:[{type:"TextBlock",className:"gc_name",text:s.formatTableStyle.name}],width:"40px"},{type:"Column",children:[{type:"TextEditor",id:"nameinput",editorLabel:s.formatTableStyle.name,className:"gc_nameinput"}],width:"stretch"}]},{type:"Container",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"LabelContainer",className:"gc_tableelement",children:[{type:"List",id:"gc_list",listLabel:s.formatTableStyle.tableElement,className:"gc_list_container",items:[{text:s.tableElement.wholeTableStyle,value:"wholeTableStyle"},{text:s.tableElement.firstColumnStripStyle,value:"firstColumnStripStyle"},{text:s.tableElement.secondColumnStripStyle,value:"secondColumnStripStyle"},{text:s.tableElement.firstRowStripStyle,value:"firstRowStripStyle"},{text:s.tableElement.secondRowStripStyle,value:"secondRowStripStyle"},{text:s.tableElement.highlightLastColumnStyle,value:"highlightLastColumnStyle"},{text:s.tableElement.highlightFirstColumnStyle,value:"highlightFirstColumnStyle"},{text:s.tableElement.headerRowStyle,value:"headerRowStyle"},{text:s.tableElement.footerRowStyle,value:"footerRowStyle"},{text:s.tableElement.firstHeaderCellStyle,value:"firstHeaderCellStyle"},{text:s.tableElement.lastHeaderCellStyle,value:"lastHeaderCellStyle"},{text:s.tableElement.firstFooterCellStyle,value:"firstFooterCellStyle"},{text:s.tableElement.lastFooterCellStyle,value:"lastFooterCellStyle"}]},{type:"ColumnSet",className:"gc_buttons",children:[{type:"Column",children:[{type:"Button",id:"gc_format",className:"format_button",text:s.formatTableStyle.format,width:70}]},{type:"Column",children:[{type:"Button",id:"gc_clear",className:"clear_button",text:s.formatTableStyle.clear,width:70}]}]}],text:s.formatTableStyle.tableElement}],width:"420px"},{type:"Column",children:[{type:"LabelContainer",children:[{type:"Container",id:"gc_preview",className:"gc_preview"}],text:s.formatTableStyle.preview},{type:"LabelContainer",id:"gc_stripesize_container",className:"gc_stripesize_container",children:[{type:"Container",className:"gc_stripesize",children:[{id:"gc_stripesize_combo",type:"ListComboEditor",editorLabel:s.formatTableStyle.stripeSize,items:[{text:"1",value:"1"},{text:"2",value:"2"},{text:"3",value:"3"},{text:"4",value:"4"},{text:"5",value:"5"},{text:"6",value:"6"},{text:"7",value:"7"},{text:"8",value:"8"}]}]}],text:s.formatTableStyle.stripeSize}]}]}]}]}}function Xb(e,t,i,n,a,r,o,l){const c=JSON.parse(JSON.stringify(t));switch(C.judgeFillType(c)){case C.FillType.solidFill:i.fillStyle=Ae.themeColorToRGB(e,c),l();return;case C.FillType.gradientPathFill:const u=c;u.stops.forEach(f=>{f.color=Ae.themeColorToRGB(e,f.color)}),GC.Spread.Sheets.util.setFillStyle(i,u,n,a,r,o,l);return;case C.FillType.gradientFill:const h=c;h.stops.forEach(f=>{f.color=Ae.themeColorToRGB(e,f.color)}),GC.Spread.Sheets.util.setFillStyle(i,h,n,a,r,o,l);return;case C.FillType.patternFill:const g=c;g.backgroundColor=Ae.themeColorToRGB(e,g.backgroundColor),g.patternColor=Ae.themeColorToRGB(e,g.patternColor),GC.Spread.Sheets.util.setFillStyle(i,g,n,a,r,o,l);return;case C.FillType.none:default:return}}class bO extends yt{constructor(){super(...arguments),this._showHeader=!0,this._showFooter=!1,this._showBandRows=!0,this._showFirstCol=!1,this._showLastCol=!1,this._showBandedCols=!1}realRender(){var g,f;this._initOptions();const t=document.createElement("div"),i=this.options.width,n=this.options.height;t.style.width=`${this.options.width+5}px`,t.style.height=`${this.options.height+5}px`,t.style.overflow="hidden";const a=document.createElement("canvas");a.style.margin="2px",a.width=i+1,a.height=n+1;const r=a.getContext("2d");if(!r||!this.value)return;const o=(g=this.options.rowCount)!=null?g:5,l=(f=this.options.colCount)!=null?f:5,c=parseInt(a.width/l+"",10),d=parseInt(a.height/o+"",10),u=this._generateTableStyle(this.value,i,n),h=this._calculateCellStyles(u,o,l);this._drawTable(r,i,n,c,d,o,l,h),t.appendChild(a),this.host.appendChild(t)}_getActiveSpread(){var t;return(t=this._options.spread)!=null?t:Pe.getContextSpread()}_initOptions(){const t=this._getActiveSpread();if(this._options.openAllTableOption){this._showHeader=!0,this._showFooter=!0,this._showBandRows=!0,this._showFirstCol=!0,this._showLastCol=!0,this._showBandedCols=!0;return}if(t){const i=t.getActiveSheet();if(i){const n=i.getActiveRowIndex(),a=i.getActiveColumnIndex(),r=i.tables.find(n,a);r&&(this._showHeader=r.showHeader(),this._showFooter=r.showFooter(),this._showBandRows=r.bandRows(),this._showFirstCol=r.highlightFirstColumn(),this._showLastCol=r.highlightLastColumn(),this._showBandedCols=r.bandColumns())}}}_drawBorder(t,i,n,a,r,o){var h,g,f,b;const l=(h=o.borderTop)==null?void 0:h.color;l&&(t.strokeStyle=this._getThemeColor(l),t.beginPath(),t.moveTo(i,n+.5),t.lineTo(i+a,n+.5),t.stroke());const c=(g=o.borderBottom)==null?void 0:g.color;c&&(t.strokeStyle=this._getThemeColor(c),t.beginPath(),t.moveTo(i,n+r+.5),t.lineTo(i+a,n+r+.5),t.stroke());const d=(f=o.borderLeft)==null?void 0:f.color;d&&(t.strokeStyle=this._getThemeColor(d),t.beginPath(),t.moveTo(i+.5,n),t.lineTo(i+.5,n+r),t.stroke());const u=(b=o.borderRight)==null?void 0:b.color;u&&(t.strokeStyle=this._getThemeColor(u),t.beginPath(),t.moveTo(i+a+.5,n),t.lineTo(i+a+.5,n+r),t.stroke())}_drawTable(t,i,n,a,r,o,l,c){var b,S;const h=a-6,g="#fff",f="#000";t.fillStyle=Kt().colorBackground||g,t.fillRect(0,0,i+1,n+1),t.textAlign="center",t.lineWidth=1;for(let y=0;y<o;y++)for(let v=0;v<l;v++){const x=c[y][v],L=v*a,T=y*r;this._setFillStyle((b=x.backColor)!=null?b:g,t,L,T,a,r,()=>{t.fillRect(L,T,a,r)}),t.strokeStyle=this._getThemeColor((S=x.foreColor)!=null?S:f),t.beginPath(),t.moveTo(L+3,T+Math.floor(r/2)+.5),t.lineTo(L+3+h,T+Math.floor(r/2)+.5),t.stroke()}t.lineWidth=1;for(let y=1;y<o-1;y++)for(let v=0;v<l;v++){const x=c[y][v],L=v*a,T=y*r;this._drawBorder(t,L,T,a,r,x)}for(let y=0;y<l;y++){const v=c[0][y],x=y*a;this._drawBorder(t,x,0,a,r,v)}for(let y=0;y<l;y++){const v=c[o-1][y],x=y*a,L=r*(o-1);this._drawBorder(t,x,L,a,r,v)}}_getThemeColor(t){const i=this._getActiveSpread();if(i){const n=C.getActualActiveSheet(i);return Ae.themeColorToRGB(n,t)}return t}_setFillStyle(t,i,n,a,r,o,l){const c=this._getActiveSpread();if(c){const d=C.getActualActiveSheet(c);Xb(d,t,i,n,a,r,o,l)}}_generateTableStyle(t,i,n){return{width:i,height:n,wholeTable:t.wholeTableStyle&&t.wholeTableStyle(),firstColumn:t.highlightFirstColumnStyle&&t.highlightFirstColumnStyle(),lastColumn:t.highlightLastColumnStyle&&t.highlightLastColumnStyle(),rowHeader:t.headerRowStyle&&t.headerRowStyle(),rowFooter:t.footerRowStyle&&t.footerRowStyle(),firstColumnStripe:t.firstColumnStripStyle&&t.firstColumnStripStyle(),firstRowStripe:t.firstRowStripStyle&&t.firstRowStripStyle(),secondColumnStripe:t.secondColumnStripStyle&&t.secondColumnStripStyle(),secondRowStripe:t.secondRowStripStyle&&t.secondRowStripStyle(),firstColumnStripeSize:t.firstColumnStripSize&&t.firstColumnStripSize(),firstRowStripeSize:t.firstRowStripSize&&t.firstRowStripSize(),secondColumnStripeSize:t.secondColumnStripSize&&t.secondColumnStripSize(),secondRowStripeSize:t.secondRowStripSize&&t.secondRowStripSize(),firstHeaderCell:t.firstHeaderCellStyle&&t.firstHeaderCellStyle(),lastHeaderCell:t.lastHeaderCellStyle&&t.lastHeaderCellStyle(),firstFooterCell:t.firstFooterCellStyle&&t.firstFooterCellStyle(),lastFooterCell:t.lastFooterCellStyle&&t.lastFooterCellStyle()}}_calculateCellStyles(t,i,n){var d,u,h,g,f,b,S,y,v,x,L,T,w,M,D,P,A,E,O,I,R,k,N,B,F,j,K,Q,X,ne,ce,fe,J,V,Z,Y,W,H,$,ee,ae,de,he,be,Le,Fe,q,se,ue,ge,xe,ke,Je,Qe,ft,bt,ve,we,Me,Ne,Ct,St,mt,Nt,pi,Ni,Zn,gn,fn,Ua,Pr,ao,Hr,zr,Tp,Yl,mu,Qc,Ir,Ro,et,Xy,$y,ev,tv,iv,nv,av,rv,ov,lv,gu,sv,cv,dv,uv,hv,pv,rf,mv,ul,ql,of,gv,fv,bv,lf,Sv,Cv,sf,yv,cf,df,vv,uf,xv,Lv,Tv,wp,wv,Dv,Av,Pv,Iv,Mv,kv,Dp,Rv;const a=[],r=this._showHeader?1:0,o=this._showFooter?i-1:i;for(let Ja=r;Ja<o;Ja++){const jr=[],mr=(Ja-r+1)%(t.firstRowStripeSize+t.secondRowStripeSize),tt=mr===0||mr>t.firstRowStripeSize;for(let fu=0;fu<n;fu++){const _v=(fu+1)%(t.firstColumnStripeSize+t.secondColumnStripeSize),Ov=_v===0||_v>t.firstColumnStripeSize,bu=fu===0,Ap=fu===n-1,It={backColor:(u=(d=t.wholeTable)==null?void 0:d.backColor)!=null?u:"#fff",foreColor:(g=(h=t.wholeTable)==null?void 0:h.foreColor)!=null?g:"#000",borderTop:Ja===0?(f=t.wholeTable)==null?void 0:f.borderTop:(b=t.wholeTable)==null?void 0:b.borderHorizontal,borderBottom:Ja===i-1?(S=t.wholeTable)==null?void 0:S.borderBottom:(y=t.wholeTable)==null?void 0:y.borderHorizontal,borderLeft:bu?(v=t.wholeTable)==null?void 0:v.borderLeft:(x=t.wholeTable)==null?void 0:x.borderVertical,borderRight:Ap?(L=t.wholeTable)==null?void 0:L.borderRight:(T=t.wholeTable)==null?void 0:T.borderVertical};!Ov&&t.firstColumnStripe&&this._showBandedCols&&(It.backColor=(w=t.firstColumnStripe.backColor)!=null?w:It.backColor,It.foreColor=(M=t.firstColumnStripe.foreColor)!=null?M:It.foreColor,It.borderTop=(D=t.firstColumnStripe.borderHorizontal)!=null?D:It.borderTop,It.borderBottom=(P=t.firstColumnStripe.borderHorizontal)!=null?P:It.borderBottom,It.borderLeft=(A=t.firstColumnStripe.borderLeft)!=null?A:It.borderLeft,It.borderRight=(E=t.firstColumnStripe.borderRight)!=null?E:It.borderRight),Ov&&t.secondColumnStripe&&this._showBandedCols&&(It.backColor=(O=t.secondColumnStripe.backColor)!=null?O:It.backColor,It.foreColor=(I=t.secondColumnStripe.foreColor)!=null?I:It.foreColor,It.borderTop=(R=t.secondColumnStripe.borderHorizontal)!=null?R:It.borderTop,It.borderBottom=(k=t.secondColumnStripe.borderHorizontal)!=null?k:It.borderBottom,It.borderLeft=(N=t.secondColumnStripe.borderLeft)!=null?N:It.borderLeft,It.borderRight=(B=t.secondColumnStripe.borderRight)!=null?B:It.borderRight),!tt&&t.firstRowStripe&&this._showBandRows&&(It.backColor=(F=t.firstRowStripe.backColor)!=null?F:It.backColor,It.foreColor=(j=t.firstRowStripe.foreColor)!=null?j:It.foreColor,It.borderTop=(K=t.firstRowStripe.borderTop)!=null?K:It.borderTop,It.borderBottom=(Q=t.firstRowStripe.borderBottom)!=null?Q:It.borderBottom,It.borderLeft=(X=bu?t.firstRowStripe.borderLeft:t.firstRowStripe.borderVertical)!=null?X:It.borderLeft,It.borderRight=(ne=Ap?t.firstRowStripe.borderRight:t.firstRowStripe.borderVertical)!=null?ne:It.borderRight),tt&&t.secondRowStripe&&this._showBandRows&&(It.backColor=(ce=t.secondRowStripe.backColor)!=null?ce:It.backColor,It.foreColor=(fe=t.secondRowStripe.foreColor)!=null?fe:It.foreColor,It.borderTop=(J=t.secondRowStripe.borderTop)!=null?J:It.borderTop,It.borderBottom=(V=t.secondRowStripe.borderBottom)!=null?V:It.borderBottom,It.borderLeft=(Z=bu?t.secondRowStripe.borderLeft:t.secondRowStripe.borderVertical)!=null?Z:It.borderLeft,It.borderRight=(Y=Ap?t.secondRowStripe.borderRight:t.secondRowStripe.borderVertical)!=null?Y:It.borderRight),Ap&&t.lastColumn&&this._showLastCol&&(It.backColor=(W=t.lastColumn.backColor)!=null?W:It.backColor,It.foreColor=(H=t.lastColumn.foreColor)!=null?H:It.foreColor,It.borderTop=($=t.lastColumn.borderHorizontal)!=null?$:It.borderTop,It.borderBottom=(ee=t.lastColumn.borderHorizontal)!=null?ee:It.borderBottom,It.borderLeft=(ae=t.lastColumn.borderLeft)!=null?ae:It.borderLeft,It.borderRight=(de=t.lastColumn.borderRight)!=null?de:It.borderRight),bu&&t.firstColumn&&this._showFirstCol&&(It.backColor=(he=t.firstColumn.backColor)!=null?he:It.backColor,It.foreColor=(be=t.firstColumn.foreColor)!=null?be:It.foreColor,It.borderTop=(Le=t.firstColumn.borderHorizontal)!=null?Le:It.borderTop,It.borderBottom=(Fe=t.firstColumn.borderHorizontal)!=null?Fe:It.borderBottom,It.borderLeft=(q=t.firstColumn.borderLeft)!=null?q:It.borderLeft,It.borderRight=(se=t.firstColumn.borderRight)!=null?se:It.borderRight),jr.push(It)}a.push(jr)}let l=[];if(this._showHeader){for(let Ja=0;Ja<n;Ja++){const jr=Ja===0,mr=Ja===n-1,tt={backColor:(ge=(ue=t.wholeTable)==null?void 0:ue.backColor)!=null?ge:"#fff",foreColor:(ke=(xe=t.wholeTable)==null?void 0:xe.foreColor)!=null?ke:"#000",borderTop:(Je=t.wholeTable)==null?void 0:Je.borderTop,borderBottom:(Qe=t.wholeTable)==null?void 0:Qe.borderHorizontal,borderLeft:jr?(ft=t.wholeTable)==null?void 0:ft.borderLeft:(bt=t.wholeTable)==null?void 0:bt.borderVertical,borderRight:mr?(ve=t.wholeTable)==null?void 0:ve.borderRight:(we=t.wholeTable)==null?void 0:we.borderVertical};mr&&t.lastColumn&&this._showLastCol&&(tt.backColor=(Me=t.lastColumn.backColor)!=null?Me:tt.backColor,tt.foreColor=(Ne=t.lastColumn.foreColor)!=null?Ne:tt.foreColor,tt.borderTop=(Ct=t.lastColumn.borderTop)!=null?Ct:tt.borderTop,tt.borderBottom=(St=t.lastColumn.borderHorizontal)!=null?St:tt.borderBottom,tt.borderLeft=(mt=t.lastColumn.borderLeft)!=null?mt:tt.borderLeft,tt.borderRight=(Nt=t.lastColumn.borderRight)!=null?Nt:tt.borderRight),jr&&t.firstColumn&&this._showFirstCol&&(tt.backColor=(pi=t.firstColumn.backColor)!=null?pi:tt.backColor,tt.foreColor=(Ni=t.firstColumn.foreColor)!=null?Ni:tt.foreColor,tt.borderTop=(Zn=t.firstColumn.borderTop)!=null?Zn:tt.borderTop,tt.borderBottom=(gn=t.firstColumn.borderHorizontal)!=null?gn:tt.borderBottom,tt.borderLeft=(fn=t.firstColumn.borderLeft)!=null?fn:tt.borderLeft,tt.borderRight=(Ua=t.firstColumn.borderRight)!=null?Ua:tt.borderRight),t.rowHeader&&(tt.backColor=(Pr=t.rowHeader.backColor)!=null?Pr:tt.backColor,tt.foreColor=(ao=t.rowHeader.foreColor)!=null?ao:tt.foreColor,tt.borderTop=(Hr=t.rowHeader.borderTop)!=null?Hr:tt.borderTop,tt.borderBottom=(zr=t.rowHeader.borderBottom)!=null?zr:tt.borderBottom,tt.borderLeft=(Tp=jr?t.rowHeader.borderLeft:t.rowHeader.borderVertical)!=null?Tp:tt.borderLeft,tt.borderRight=(Yl=mr?t.rowHeader.borderRight:t.rowHeader.borderVertical)!=null?Yl:tt.borderRight),jr&&t.firstHeaderCell&&this._showFirstCol&&(tt.backColor=(mu=t.firstHeaderCell.backColor)!=null?mu:tt.backColor,tt.foreColor=(Qc=t.firstHeaderCell.foreColor)!=null?Qc:tt.foreColor,tt.borderTop=(Ir=t.firstHeaderCell.borderTop)!=null?Ir:tt.borderTop,tt.borderBottom=(Ro=t.firstHeaderCell.borderBottom)!=null?Ro:tt.borderBottom,tt.borderLeft=(et=t.firstHeaderCell.borderLeft)!=null?et:tt.borderLeft,tt.borderRight=(Xy=t.firstHeaderCell.borderRight)!=null?Xy:tt.borderRight),mr&&t.lastHeaderCell&&this._showLastCol&&(tt.backColor=($y=t.lastHeaderCell.backColor)!=null?$y:tt.backColor,tt.foreColor=(ev=t.lastHeaderCell.foreColor)!=null?ev:tt.foreColor,tt.borderTop=(tv=t.lastHeaderCell.borderTop)!=null?tv:tt.borderTop,tt.borderBottom=(iv=t.lastHeaderCell.borderBottom)!=null?iv:tt.borderBottom,tt.borderLeft=(nv=t.lastHeaderCell.borderLeft)!=null?nv:tt.borderLeft,tt.borderRight=(av=t.lastHeaderCell.borderRight)!=null?av:tt.borderRight),l.push(tt)}a.unshift(l)}let c=[];if(this._showFooter){for(let Ja=0;Ja<n;Ja++){const jr=Ja===0,mr=Ja===n-1,tt={backColor:(ov=(rv=t.wholeTable)==null?void 0:rv.backColor)!=null?ov:"#fff",foreColor:(gu=(lv=t.wholeTable)==null?void 0:lv.foreColor)!=null?gu:"#000",borderTop:(sv=t.wholeTable)==null?void 0:sv.borderHorizontal,borderBottom:(cv=t.wholeTable)==null?void 0:cv.borderBottom,borderLeft:jr?(dv=t.wholeTable)==null?void 0:dv.borderLeft:(uv=t.wholeTable)==null?void 0:uv.borderVertical,borderRight:mr?(hv=t.wholeTable)==null?void 0:hv.borderRight:(pv=t.wholeTable)==null?void 0:pv.borderVertical};mr&&t.lastColumn&&this._showLastCol&&(tt.backColor=(rf=t.lastColumn.backColor)!=null?rf:tt.backColor,tt.foreColor=(mv=t.lastColumn.foreColor)!=null?mv:tt.foreColor,tt.borderTop=(ul=t.lastColumn.borderHorizontal)!=null?ul:tt.borderTop,tt.borderBottom=(ql=t.lastColumn.borderBottom)!=null?ql:tt.borderBottom,tt.borderLeft=(of=t.lastColumn.borderLeft)!=null?of:tt.borderLeft,tt.borderRight=(gv=t.lastColumn.borderRight)!=null?gv:tt.borderRight),jr&&t.firstColumn&&this._showFirstCol&&(tt.backColor=(fv=t.firstColumn.backColor)!=null?fv:tt.backColor,tt.foreColor=(bv=t.firstColumn.foreColor)!=null?bv:tt.foreColor,tt.borderTop=(lf=t.firstColumn.borderHorizontal)!=null?lf:tt.borderTop,tt.borderBottom=(Sv=t.firstColumn.borderBottom)!=null?Sv:tt.borderBottom,tt.borderLeft=(Cv=t.firstColumn.borderLeft)!=null?Cv:tt.borderLeft,tt.borderRight=(sf=t.firstColumn.borderRight)!=null?sf:tt.borderRight),t.rowFooter&&(tt.backColor=(yv=t.rowFooter.backColor)!=null?yv:tt.backColor,tt.foreColor=(cf=t.rowFooter.foreColor)!=null?cf:tt.foreColor,tt.borderTop=(df=t.rowFooter.borderTop)!=null?df:tt.borderTop,tt.borderBottom=(vv=t.rowFooter.borderBottom)!=null?vv:tt.borderBottom,tt.borderLeft=(uf=jr?t.rowFooter.borderLeft:t.rowFooter.borderVertical)!=null?uf:tt.borderLeft,tt.borderRight=(xv=mr?t.rowFooter.borderRight:t.rowFooter.borderVertical)!=null?xv:tt.borderRight),jr&&t.firstFooterCell&&this._showFirstCol&&(tt.backColor=(Lv=t.firstFooterCell.backColor)!=null?Lv:tt.backColor,tt.foreColor=(Tv=t.firstFooterCell.foreColor)!=null?Tv:tt.foreColor,tt.borderBottom=(wp=t.firstFooterCell.borderBottom)!=null?wp:tt.borderBottom,tt.borderLeft=(wv=t.firstFooterCell.borderLeft)!=null?wv:tt.borderLeft,tt.borderRight=(Dv=t.firstFooterCell.borderRight)!=null?Dv:tt.borderRight,tt.borderTop=(Av=t.firstFooterCell.borderTop)!=null?Av:tt.borderTop),mr&&t.lastFooterCell&&this._showLastCol&&(tt.backColor=(Pv=t.lastFooterCell.backColor)!=null?Pv:tt.backColor,tt.foreColor=(Iv=t.lastFooterCell.foreColor)!=null?Iv:tt.foreColor,tt.borderBottom=(Mv=t.lastFooterCell.borderBottom)!=null?Mv:tt.borderBottom,tt.borderLeft=(kv=t.lastFooterCell.borderLeft)!=null?kv:tt.borderLeft,tt.borderRight=(Dp=t.lastFooterCell.borderRight)!=null?Dp:tt.borderRight,tt.borderTop=(Rv=t.lastFooterCell.borderTop)!=null?Rv:tt.borderTop),c.push(tt)}a.push(c)}return a}}var pme=Object.getOwnPropertyDescriptor,mme=(e,t,i,n)=>{for(var a=n>1?void 0:n?pme(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};const SO="gc-hidden-stripe-size";let CO=class extends us{constructor(){super(...arguments),this._tableStyle=new GC.Spread.Sheets.Tables.TableTheme}getComponentJson(){return[hme()]}onMounted(){this.host.classList.toggle(SO,!0)}onDestroy(){this._tableStyle.name(this.component_stylename.value),this._value={customTableStyle:this._tableStyle,styleName:this.component_stylename.value},this.raiseValueChanged(),this._tableStylePreview&&(this._tableStylePreview.dispose(),this._tableStylePreview=void 0),this._tableStyle=null}_refresh(){this._value===void 0||this._value===null||(this._spread=Pe.getContextSpread(),this._tableStyle=this._cloneStyle(this._value.customTableStyle),this.component_list.value=qr.wholeTableStyle,this.component_stripesize.value="1",this.component_stylename.value=this._value.styleName,this._updateListItemClass(),this.component_clear.enable=!this._isNullStyle(this._tableStyle.wholeTableStyle()),this._renderPreview())}_attachEvent(){const e=Pe.getDialogOwner();this.component_format.on(rt.ValueChanged,async()=>{const t=this._generateFormatDialogOption(),i=await e._showDialog(G.ConditionalFormatDialogTemplate,t),n=this._composeStyle(i);n&&(this._updateTableStyle(n),this._updateListItemClass(),this._updateClearBtnState(!this._isNullStyle(this._tableStyle[this.component_list.value].call(this._tableStyle))))}),this.component_list.on(si.ListItemClickEvent,t=>{const i=this._tableStyle,n=i[t].call(i),a=t.indexOf("Strip")!==-1;if(this.host.classList.toggle(SO,!a),a){let r=1;t===qr.firstColumnStripStyle?r=i.firstColumnStripSize():t===qr.secondColumnStripStyle?r=i.secondColumnStripSize():t===qr.firstRowStripStyle?r=i.firstRowStripSize():r=i.secondRowStripSize(),this.component_stripesize.value=String(r)}this._updateClearBtnState(!this._isNullStyle(n))}),this.component_stripesize.on(lt.ValueChanged,()=>{this._updateStripeSize(),this._updateListItemClass(),this._updateClearBtnState(!this._isNullStyle(this._tableStyle[this.component_list.value].call(this._tableStyle))),this._renderPreview()}),this.component_clear.on(rt.ValueChanged,()=>{this._clearTableStyle()})}_updateListItemClass(){const e=this.component_list.items();if(e){const t=this._tableStyle,i=e.map(n=>{const a=t[n.value].call(t);return this._isNullStyle(a,n.value)?n.className=void 0:n.className="gc-table-style-highlight-item",n});this.component_list.items(i),this.component_list.RenderAll()}}_renderPreview(){this._tableStylePreview&&(this._tableStylePreview.dispose(),this._tableStylePreview=void 0,this.preview.container.innerHTML="");const e=new bO(this.preview.container,{width:120,height:100,rowCount:7,colCount:6,openAllTableOption:!0,spread:this._spread});e.value=this._tableStyle,e.RenderAll(),this._tableStylePreview=e}_cloneStyle(e){const t=new GC.Spread.Sheets.Tables.TableTheme;return t.fromJSON(e),t}_getTabOption(e){const t=e!=null&&e.font?C.parseFont(e.font):null,i=(e==null?void 0:e.fontWeight)||(t==null?void 0:t.fontWeight)||"normal",n=((e==null?void 0:e.fontStyle)||(t==null?void 0:t.fontStyle)||"").indexOf("italic")!==-1?"italic":"normal";return{dialogOption:{activeTab:dt.Font,showTabList:[dt.Font,dt.Border,dt.Fill]},fontTabOption:{foreColor:e==null?void 0:e.foreColor,fontWeight:C.getFormatDialogFontWeight({fontWeight:i}),fontStyle:C.getFormatDialogFontStyle({fontWeight:i,fontStyle:n}),fontUnderlineListAndEffects:C.generateFontUnderlineListAndEffectsOptionByStyleTextDecoration((e==null?void 0:e.textDecoration)||0),disableFontFamily:!0,disableFontSize:!0},fillTabOption:{backColor:e==null?void 0:e.backColor},borderTabOption:{enableDiagonalUp:!1,enableDiagonalDown:!1,enableBorderHorizontal:!0,enableBorderVertical:!0,borderLeft:(e==null?void 0:e.borderLeft)||new GC.Spread.Sheets.LineBorder,borderTop:(e==null?void 0:e.borderTop)||new GC.Spread.Sheets.LineBorder,borderRight:(e==null?void 0:e.borderRight)||new GC.Spread.Sheets.LineBorder,borderBottom:(e==null?void 0:e.borderBottom)||new GC.Spread.Sheets.LineBorder,borderVertical:(e==null?void 0:e.borderVertical)||new GC.Spread.Sheets.LineBorder,borderHorizontal:(e==null?void 0:e.borderHorizontal)||new GC.Spread.Sheets.LineBorder}}}_generateFormatDialogOption(){const e=this._tableStyle,t=e[this.component_list.value].call(e);return this._getTabOption(t)}_composeStyle(e){var t,i,n;if(e)return{dialogOption:{activeTab:dt.Font,showTabList:[dt.Font,dt.Border,dt.Fill]},fontTabOption:e.fontTabOption,fillTabOption:{...e.fillTabOption,backColor:(t=e.fillTabOption)!=null&&t.backColor&&((i=e.fillTabOption)==null?void 0:i.backColor)!==""?Ke((n=e.fillTabOption)==null?void 0:n.backColor):void 0},borderTabOption:e.borderTabOption}}_clearTableStyle(){const e=this.component_list.value;!e||Object.keys(this._tableStyle).length===0||(this._tableStyle[e].call(this._tableStyle,new GC.Spread.Sheets.Tables.TableStyle),this._updateClearBtnState(!1),this._updateStripeSize(1),this._updateListItemClass(),this._renderPreview())}_updateTableStyle(e){var n;const t=this.component_list.value;if(!e||!t||Object.keys(this._tableStyle).length===0)return;let i=this._tableStyle[t].call(this._tableStyle);if(!i){const a=this._tableStyle[t].call(this._tableStyle,new GC.Spread.Sheets.Tables.TableStyle);i=a[t].call(a)}if(e.fontTabOption){const a=e.fontTabOption,r=a.fontSize||"11pt",o=a.fontFamily||"Calibri",l=a.fontStyle,c=l&&l.indexOf("italic")!==-1?"italic":"normal",d=l?l.indexOf("bold")!==-1?"bold":"normal":a.fontWeight||"normal";i.font=`${c} ${d} ${r} ${o}`.trim(),i.fontStyle=c,i.fontWeight=d,i.textDecoration=(n=a.fontUnderlineListAndEffects)==null?void 0:n.textDecoration,i.foreColor=a.foreColor}if(e.fillTabOption&&(i.backColor=e.fillTabOption.backColor),e.borderTabOption){const a=e.borderTabOption;i.borderLeft=a.borderLeft,i.borderRight=a.borderRight,i.borderTop=a.borderTop,i.borderBottom=a.borderBottom,i.borderHorizontal=a.borderHorizontal,i.borderVertical=a.borderVertical}this._renderPreview()}_updateStripeSize(e){const t=this.component_list.value;if(!t||Object.keys(this._tableStyle).length===0)return;let i=parseInt(this.component_stripesize.value,10);switch(e!==void 0&&(i=e,this.component_stripesize.value=String(i)),t){case qr.firstColumnStripStyle:this._tableStyle.firstColumnStripSize(i);break;case qr.secondColumnStripStyle:this._tableStyle.secondColumnStripSize(i);break;case qr.firstRowStripStyle:this._tableStyle.firstRowStripSize(i);break;case qr.secondRowStripStyle:this._tableStyle.secondRowStripSize(i);break;default:return}}_updateClearBtnState(e){this.component_clear.enable=e}_isNullStyle(e,t){const i=t!=null?t:this.component_list.value;let n=!1;switch(i){case qr.firstColumnStripStyle:n=(this._tableStyle.firstColumnStripSize?this._tableStyle.firstColumnStripSize():1)!==1;break;case qr.secondColumnStripStyle:n=(this._tableStyle.secondColumnStripSize?this._tableStyle.secondColumnStripSize():1)!==1;break;case qr.firstRowStripStyle:n=(this._tableStyle.firstRowStripSize?this._tableStyle.firstRowStripSize():1)!==1;break;case qr.secondRowStripStyle:n=(this._tableStyle.secondRowStripSize?this._tableStyle.secondRowStripSize():1)!==1;break}return(!e||!Object.keys(e).some(a=>!!e[a]))&&!n}get component_list(){return this.getComponent("gc_list")}get component_stripesize(){return this.getComponent("gc_stripesize_combo")}get component_format(){return this.getComponent("gc_format")}get component_clear(){return this.getComponent("gc_clear")}get component_stylename(){return this.getComponent("nameinput")}get preview(){return this.getComponent("gc_preview")}};CO=mme([Ue.Register("TableStyleEditor")],CO);const E0=function(e){return{templateName:G.TableStyleDialogTemplate,title:e!=null?e:s.formatTableStyle.newStyleDialogTitle,content:[{type:"TableStyleEditor",bindingPath:"data"}]}};_e(G.TableStyleDialogTemplate,E0);let gme={text:"${res.formatTableStyle.newTableStyle}",iconClass:"ribbon-button-new-table-style-element",commandName:p.NewTableStyle,execute:async e=>{let t=e.getData(re.tableStyleKey)||[],i={data:{styleName:`${s.formatTableStyle.newStyleDialogTitle} ${t.length+1}`,customTableStyle:new GC.Spread.Sheets.Tables.TableTheme().toJSON()}},n=await e._showDialog(G.TableStyleDialogTemplate,i,N0);n&&n.data&&(e.Spread.customTableThemes.add(n.data.customTableStyle),e.setData(re.tableStyleKey,e.Spread.customTableThemes.all()||[]))},init:e=>{e.setData(re.tableStyleKey,e.Spread.customTableThemes.all()||[])}};function N0(e,t){if(e&&e.data){let i=e.data.styleName.toLowerCase();if(vO(i)||th[i])return t==null||t._showMessageBox(s.formatTableStyle.exception,s.title,Re.info,vt.ok),!1}return!0}function yO(e,t,i){if(e&&e.data){let n=e.data.styleName.toLowerCase(),a=vO(n)||th[n],r=!1;if(t&&(r=n===t.toLowerCase()),a&&!r)return i==null||i._showMessageBox(s.formatTableStyle.exception,s.title,Re.info,vt.ok),!1}return!0}function vO(e){const t=(i,n)=>i&&n&&i.toLowerCase()===n.toLowerCase();return Object.keys(GC.Spread.Sheets.Tables.TableThemes).some(i=>t("TableStyle"+i,e))}const fme=Object.freeze(Object.defineProperty({__proto__:null,newTableStyle:gme,tableStyleModifyValid:yO,tableStyleValid:N0},Symbol.toStringTag,{value:"Module"}));var eh=(e=>(e.C_Modify="modify",e.C_Delete="delete",e.C_Set_Default="setDefault",e.C_Duplicate="duplicate",e.C_Apply="apply",e.C_Modify_Object="modifyObject",e))(eh||{});const Tt={};Tt.light0=null,Tt.light1=GC.Spread.Sheets.Tables.TableThemes.light1,Tt.light2=GC.Spread.Sheets.Tables.TableThemes.light2,Tt.light3=GC.Spread.Sheets.Tables.TableThemes.light3,Tt.light4=GC.Spread.Sheets.Tables.TableThemes.light4,Tt.light5=GC.Spread.Sheets.Tables.TableThemes.light5,Tt.light6=GC.Spread.Sheets.Tables.TableThemes.light6,Tt.light7=GC.Spread.Sheets.Tables.TableThemes.light7,Tt.light8=GC.Spread.Sheets.Tables.TableThemes.light8,Tt.light9=GC.Spread.Sheets.Tables.TableThemes.light9,Tt.light10=GC.Spread.Sheets.Tables.TableThemes.light10,Tt.light11=GC.Spread.Sheets.Tables.TableThemes.light11,Tt.light12=GC.Spread.Sheets.Tables.TableThemes.light12,Tt.light13=GC.Spread.Sheets.Tables.TableThemes.light13,Tt.light14=GC.Spread.Sheets.Tables.TableThemes.light14,Tt.light15=GC.Spread.Sheets.Tables.TableThemes.light15,Tt.light16=GC.Spread.Sheets.Tables.TableThemes.light16,Tt.light17=GC.Spread.Sheets.Tables.TableThemes.light17,Tt.light18=GC.Spread.Sheets.Tables.TableThemes.light18,Tt.light19=GC.Spread.Sheets.Tables.TableThemes.light19,Tt.light20=GC.Spread.Sheets.Tables.TableThemes.light20,Tt.light21=GC.Spread.Sheets.Tables.TableThemes.light21,Tt.medium1=GC.Spread.Sheets.Tables.TableThemes.medium1,Tt.medium2=GC.Spread.Sheets.Tables.TableThemes.medium2,Tt.medium3=GC.Spread.Sheets.Tables.TableThemes.medium3,Tt.medium4=GC.Spread.Sheets.Tables.TableThemes.medium4,Tt.medium5=GC.Spread.Sheets.Tables.TableThemes.medium5,Tt.medium6=GC.Spread.Sheets.Tables.TableThemes.medium6,Tt.medium7=GC.Spread.Sheets.Tables.TableThemes.medium7,Tt.medium8=GC.Spread.Sheets.Tables.TableThemes.medium8,Tt.medium9=GC.Spread.Sheets.Tables.TableThemes.medium9,Tt.medium10=GC.Spread.Sheets.Tables.TableThemes.medium10,Tt.medium11=GC.Spread.Sheets.Tables.TableThemes.medium11,Tt.medium12=GC.Spread.Sheets.Tables.TableThemes.medium12,Tt.medium13=GC.Spread.Sheets.Tables.TableThemes.medium13,Tt.medium14=GC.Spread.Sheets.Tables.TableThemes.medium14,Tt.medium15=GC.Spread.Sheets.Tables.TableThemes.medium15,Tt.medium16=GC.Spread.Sheets.Tables.TableThemes.medium16,Tt.medium17=GC.Spread.Sheets.Tables.TableThemes.medium17,Tt.medium18=GC.Spread.Sheets.Tables.TableThemes.medium18,Tt.medium19=GC.Spread.Sheets.Tables.TableThemes.medium19,Tt.medium20=GC.Spread.Sheets.Tables.TableThemes.medium20,Tt.medium21=GC.Spread.Sheets.Tables.TableThemes.medium21,Tt.medium22=GC.Spread.Sheets.Tables.TableThemes.medium22,Tt.medium23=GC.Spread.Sheets.Tables.TableThemes.medium23,Tt.medium24=GC.Spread.Sheets.Tables.TableThemes.medium24,Tt.medium25=GC.Spread.Sheets.Tables.TableThemes.medium25,Tt.medium26=GC.Spread.Sheets.Tables.TableThemes.medium26,Tt.medium27=GC.Spread.Sheets.Tables.TableThemes.medium27,Tt.medium28=GC.Spread.Sheets.Tables.TableThemes.medium28,Tt.dark1=GC.Spread.Sheets.Tables.TableThemes.dark1,Tt.dark2=GC.Spread.Sheets.Tables.TableThemes.dark2,Tt.dark3=GC.Spread.Sheets.Tables.TableThemes.dark3,Tt.dark4=GC.Spread.Sheets.Tables.TableThemes.dark4,Tt.dark5=GC.Spread.Sheets.Tables.TableThemes.dark5,Tt.dark6=GC.Spread.Sheets.Tables.TableThemes.dark6,Tt.dark7=GC.Spread.Sheets.Tables.TableThemes.dark7,Tt.dark8=GC.Spread.Sheets.Tables.TableThemes.dark8,Tt.dark9=GC.Spread.Sheets.Tables.TableThemes.dark9,Tt.dark10=GC.Spread.Sheets.Tables.TableThemes.dark10,Tt.dark11=GC.Spread.Sheets.Tables.TableThemes.dark11,Tt.professional1=GC.Spread.Sheets.Tables.TableThemes.professional1,Tt.professional2=GC.Spread.Sheets.Tables.TableThemes.professional2,Tt.professional3=GC.Spread.Sheets.Tables.TableThemes.professional3,Tt.professional4=GC.Spread.Sheets.Tables.TableThemes.professional4,Tt.professional5=GC.Spread.Sheets.Tables.TableThemes.professional5,Tt.professional6=GC.Spread.Sheets.Tables.TableThemes.professional6,Tt.professional7=GC.Spread.Sheets.Tables.TableThemes.professional7,Tt.professional8=GC.Spread.Sheets.Tables.TableThemes.professional8,Tt.professional9=GC.Spread.Sheets.Tables.TableThemes.professional9,Tt.professional10=GC.Spread.Sheets.Tables.TableThemes.professional10,Tt.professional11=GC.Spread.Sheets.Tables.TableThemes.professional11,Tt.professional12=GC.Spread.Sheets.Tables.TableThemes.professional12,Tt.professional13=GC.Spread.Sheets.Tables.TableThemes.professional13,Tt.professional14=GC.Spread.Sheets.Tables.TableThemes.professional14,Tt.professional15=GC.Spread.Sheets.Tables.TableThemes.professional15,Tt.professional16=GC.Spread.Sheets.Tables.TableThemes.professional16,Tt.professional17=GC.Spread.Sheets.Tables.TableThemes.professional17,Tt.professional18=GC.Spread.Sheets.Tables.TableThemes.professional18,Tt.professional19=GC.Spread.Sheets.Tables.TableThemes.professional19,Tt.professional20=GC.Spread.Sheets.Tables.TableThemes.professional20,Tt.professional21=GC.Spread.Sheets.Tables.TableThemes.professional21,Tt.professional22=GC.Spread.Sheets.Tables.TableThemes.professional22,Tt.professional23=GC.Spread.Sheets.Tables.TableThemes.professional23,Tt.professional24=GC.Spread.Sheets.Tables.TableThemes.professional24;const wl=(e,t)=>{var o;const i=Pe.getContextSpread(),n=t.value;let a;if(t.contextMenuOnly){const l=Pe.getContextDesigner(),c=l&&Tm(l);a=c==null?void 0:c.style()}else a=GC.Spread.Sheets.Tables.TableThemes[n],!a&&i&&(a=(o=i.customTableThemes.get(n))!=null?o:new GC.Spread.Sheets.Tables.TableTheme);const r=new bO(e,{width:60,height:45});r.value=a,r.RenderAll()};let th={},xO=[{groupName:"${res.formatTableStyle.custom}",visible:!1,wrap:!1,commandName:p.FormatTableListContent,render:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[],contextMenu:[{text:"${res.formatTableStyle.apply}",commandName:p.FormatTableListContent,value:"apply"},{text:"${res.formatTableStyle.modify}",commandName:p.FormatTableListContent,value:"modify"},{text:"${res.formatTableStyle.duplicate}",commandName:p.FormatTableListContent,value:"duplicate"},{text:"${res.formatTableStyle.delete}",commandName:p.FormatTableListContent,value:"delete"},{text:"${res.formatTableStyle.setAsDefault}",commandName:p.FormatTableListContent,value:"setDefault"}]},{groupName:"${res.formatTableStyle.light}",commandName:p.FormatTableListContent,itemRender:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[{value:"light0",tip:"${res.formatTableStyle.none}"},{value:"light1",tip:"${res.formatTableStyle.light}1"},{value:"light2",tip:"${res.formatTableStyle.light}2"},{value:"light3",tip:"${res.formatTableStyle.light}3"},{value:"light4",tip:"${res.formatTableStyle.light}4"},{value:"light5",tip:"${res.formatTableStyle.light}5"},{value:"light6",tip:"${res.formatTableStyle.light}6"},{value:"light7",tip:"${res.formatTableStyle.light}7"},{value:"light8",tip:"${res.formatTableStyle.light}8"},{value:"light9",tip:"${res.formatTableStyle.light}9"},{value:"light10",tip:"${res.formatTableStyle.light}10"},{value:"light11",tip:"${res.formatTableStyle.light}11"},{value:"light12",tip:"${res.formatTableStyle.light}12"},{value:"light13",tip:"${res.formatTableStyle.light}13"},{value:"light14",tip:"${res.formatTableStyle.light}14"},{value:"light15",tip:"${res.formatTableStyle.light}15"},{value:"light16",tip:"${res.formatTableStyle.light}16"},{value:"light17",tip:"${res.formatTableStyle.light}17"},{value:"light18",tip:"${res.formatTableStyle.light}18"},{value:"light19",tip:"${res.formatTableStyle.light}19"},{value:"light20",tip:"${res.formatTableStyle.light}20"},{value:"light21",tip:"${res.formatTableStyle.light}21"}],contextMenu:[{text:"${res.formatTableStyle.apply}",commandName:p.FormatTableListContent,value:"apply"},{text:"${res.formatTableStyle.duplicate}",commandName:p.FormatTableListContent,value:"duplicate",visible:(e,t)=>{var i;return((i=t.dataset)==null?void 0:i.value)!=="light0"}},{text:"${res.formatTableStyle.setAsDefault}",commandName:p.FormatTableListContent,value:"setDefault"}]},{groupName:"${res.formatTableStyle.medium}",commandName:p.FormatTableListContent,itemRender:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[{value:"medium1",tip:"${res.formatTableStyle.medium}1"},{value:"medium2",tip:"${res.formatTableStyle.medium}2"},{value:"medium3",tip:"${res.formatTableStyle.medium}3"},{value:"medium4",tip:"${res.formatTableStyle.medium}4"},{value:"medium5",tip:"${res.formatTableStyle.medium}5"},{value:"medium6",tip:"${res.formatTableStyle.medium}6"},{value:"medium7",tip:"${res.formatTableStyle.medium}7"},{value:"medium8",tip:"${res.formatTableStyle.medium}8"},{value:"medium9",tip:"${res.formatTableStyle.medium}9"},{value:"medium10",tip:"${res.formatTableStyle.medium}10"},{value:"medium11",tip:"${res.formatTableStyle.medium}11"},{value:"medium12",tip:"${res.formatTableStyle.medium}12"},{value:"medium13",tip:"${res.formatTableStyle.medium}13"},{value:"medium14",tip:"${res.formatTableStyle.medium}14"},{value:"medium15",tip:"${res.formatTableStyle.medium}15"},{value:"medium16",tip:"${res.formatTableStyle.medium}16"},{value:"medium17",tip:"${res.formatTableStyle.medium}17"},{value:"medium18",tip:"${res.formatTableStyle.medium}18"},{value:"medium19",tip:"${res.formatTableStyle.medium}19"},{value:"medium20",tip:"${res.formatTableStyle.medium}20"},{value:"medium21",tip:"${res.formatTableStyle.medium}21"},{value:"medium22",tip:"${res.formatTableStyle.medium}22"},{value:"medium23",tip:"${res.formatTableStyle.medium}23"},{value:"medium24",tip:"${res.formatTableStyle.medium}24"},{value:"medium25",tip:"${res.formatTableStyle.medium}25"},{value:"medium26",tip:"${res.formatTableStyle.medium}26"},{value:"medium27",tip:"${res.formatTableStyle.medium}27"},{value:"medium28",tip:"${res.formatTableStyle.medium}28"}],contextMenu:[{text:"${res.formatTableStyle.apply}",commandName:p.FormatTableListContent,value:"apply"},{text:"${res.formatTableStyle.duplicate}",commandName:p.FormatTableListContent,value:"duplicate"},{text:"${res.formatTableStyle.setAsDefault}",commandName:p.FormatTableListContent,value:"setDefault"}]},{groupName:"${res.formatTableStyle.dark}",commandName:p.FormatTableListContent,itemRender:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[{value:"dark1",tip:"${res.formatTableStyle.dark}1"},{value:"dark2",tip:"${res.formatTableStyle.dark}2"},{value:"dark3",tip:"${res.formatTableStyle.dark}3"},{value:"dark4",tip:"${res.formatTableStyle.dark}4"},{value:"dark5",tip:"${res.formatTableStyle.dark}5"},{value:"dark6",tip:"${res.formatTableStyle.dark}6"},{value:"dark7",tip:"${res.formatTableStyle.dark}7"},{value:"dark8",tip:"${res.formatTableStyle.dark}8"},{value:"dark9",tip:"${res.formatTableStyle.dark}9"},{value:"dark10",tip:"${res.formatTableStyle.dark}10"},{value:"dark11",tip:"${res.formatTableStyle.dark}11"}],contextMenu:[{text:"${res.formatTableStyle.apply}",commandName:p.FormatTableListContent,value:"apply"},{text:"${res.formatTableStyle.duplicate}",commandName:p.FormatTableListContent,value:"duplicate"},{text:"${res.formatTableStyle.setAsDefault}",commandName:p.FormatTableListContent,value:"setDefault"}]}],bme=[{groupName:"${res.formatTableStyle.light}",commandName:p.FormatTableListContent,itemRender:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[{value:"light0",tip:"${res.formatTableStyle.none}"},{value:"light1",tip:"${res.formatTableStyle.light}1"},{value:"light2",tip:"${res.formatTableStyle.light}2"},{value:"light3",tip:"${res.formatTableStyle.light}3"},{value:"light4",tip:"${res.formatTableStyle.light}4"},{value:"light5",tip:"${res.formatTableStyle.light}5"},{value:"light6",tip:"${res.formatTableStyle.light}6"},{value:"light7",tip:"${res.formatTableStyle.light}7"},{value:"light8",tip:"${res.formatTableStyle.light}8"},{value:"light9",tip:"${res.formatTableStyle.light}9"},{value:"light10",tip:"${res.formatTableStyle.light}10"},{value:"light11",tip:"${res.formatTableStyle.light}11"},{value:"light12",tip:"${res.formatTableStyle.light}12"},{value:"light13",tip:"${res.formatTableStyle.light}13"},{value:"light14",tip:"${res.formatTableStyle.light}14"},{value:"light15",tip:"${res.formatTableStyle.light}15"},{value:"light16",tip:"${res.formatTableStyle.light}16"},{value:"light17",tip:"${res.formatTableStyle.light}17"},{value:"light18",tip:"${res.formatTableStyle.light}18"},{value:"light19",tip:"${res.formatTableStyle.light}19"},{value:"light20",tip:"${res.formatTableStyle.light}20"},{value:"light21",tip:"${res.formatTableStyle.light}21"}]},{groupName:"${res.formatTableStyle.medium}",commandName:p.FormatTableListContent,itemRender:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[{value:"medium1",tip:"${res.formatTableStyle.medium}1"},{value:"medium2",tip:"${res.formatTableStyle.medium}2"},{value:"medium3",tip:"${res.formatTableStyle.medium}3"},{value:"medium4",tip:"${res.formatTableStyle.medium}4"},{value:"medium5",tip:"${res.formatTableStyle.medium}5"},{value:"medium6",tip:"${res.formatTableStyle.medium}6"},{value:"medium7",tip:"${res.formatTableStyle.medium}7"},{value:"medium8",tip:"${res.formatTableStyle.medium}8"},{value:"medium9",tip:"${res.formatTableStyle.medium}9"},{value:"medium10",tip:"${res.formatTableStyle.medium}10"},{value:"medium11",tip:"${res.formatTableStyle.medium}11"},{value:"medium12",tip:"${res.formatTableStyle.medium}12"},{value:"medium13",tip:"${res.formatTableStyle.medium}13"},{value:"medium14",tip:"${res.formatTableStyle.medium}14"},{value:"medium15",tip:"${res.formatTableStyle.medium}15"},{value:"medium16",tip:"${res.formatTableStyle.medium}16"},{value:"medium17",tip:"${res.formatTableStyle.medium}17"},{value:"medium18",tip:"${res.formatTableStyle.medium}18"},{value:"medium19",tip:"${res.formatTableStyle.medium}19"},{value:"medium20",tip:"${res.formatTableStyle.medium}20"},{value:"medium21",tip:"${res.formatTableStyle.medium}21"},{value:"medium22",tip:"${res.formatTableStyle.medium}22"},{value:"medium23",tip:"${res.formatTableStyle.medium}23"},{value:"medium24",tip:"${res.formatTableStyle.medium}24"},{value:"medium25",tip:"${res.formatTableStyle.medium}25"},{value:"medium26",tip:"${res.formatTableStyle.medium}26"},{value:"medium27",tip:"${res.formatTableStyle.medium}27"},{value:"medium28",tip:"${res.formatTableStyle.medium}28"}]},{groupName:"${res.formatTableStyle.dark}",commandName:p.FormatTableListContent,itemRender:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[{value:"dark1",tip:"${res.formatTableStyle.dark}1"},{value:"dark2",tip:"${res.formatTableStyle.dark}2"},{value:"dark3",tip:"${res.formatTableStyle.dark}3"},{value:"dark4",tip:"${res.formatTableStyle.dark}4"},{value:"dark5",tip:"${res.formatTableStyle.dark}5"},{value:"dark6",tip:"${res.formatTableStyle.dark}6"},{value:"dark7",tip:"${res.formatTableStyle.dark}7"},{value:"dark8",tip:"${res.formatTableStyle.dark}8"},{value:"dark9",tip:"${res.formatTableStyle.dark}9"},{value:"dark10",tip:"${res.formatTableStyle.dark}10"},{value:"dark11",tip:"${res.formatTableStyle.dark}11"}]},{groupName:"${res.formatTableStyle.professional}",commandName:p.FormatTableListContent,itemRender:wl,selectedClassName:"gc-list-control-selected-item-border",className:"gc-list-control-style-format-group",groupItems:[{value:"professional1",tip:"${res.formatTableStyle.professional}1"},{value:"professional2",tip:"${res.formatTableStyle.professional}2"},{value:"professional3",tip:"${res.formatTableStyle.professional}3"},{value:"professional4",tip:"${res.formatTableStyle.professional}4"},{value:"professional5",tip:"${res.formatTableStyle.professional}5"},{value:"professional6",tip:"${res.formatTableStyle.professional}6"},{value:"professional7",tip:"${res.formatTableStyle.professional}7"},{value:"professional8",tip:"${res.formatTableStyle.professional}8"},{value:"professional9",tip:"${res.formatTableStyle.professional}9"},{value:"professional10",tip:"${res.formatTableStyle.professional}10"},{value:"professional11",tip:"${res.formatTableStyle.professional}11"},{value:"professional12",tip:"${res.formatTableStyle.professional}12"},{value:"professional13",tip:"${res.formatTableStyle.professional}13"},{value:"professional14",tip:"${res.formatTableStyle.professional}14"},{value:"professional15",tip:"${res.formatTableStyle.professional}15"},{value:"professional16",tip:"${res.formatTableStyle.professional}16"},{value:"professional17",tip:"${res.formatTableStyle.professional}17"},{value:"professional18",tip:"${res.formatTableStyle.professional}18"},{value:"professional19",tip:"${res.formatTableStyle.professional}19"},{value:"professional20",tip:"${res.formatTableStyle.professional}20"},{value:"professional21",tip:"${res.formatTableStyle.professional}21"},{value:"professional22",tip:"${res.formatTableStyle.professional}22"},{value:"professional23",tip:"${res.formatTableStyle.professional}23"},{value:"professional24",tip:"${res.formatTableStyle.professional}24"}]}];async function B0(e,t){let i=e.Spread;if(t)return e.setData(m.TableHasStyle,t!=="light0"),O0(i,t)}async function Sme(e,t){let i=e.Spread;t&&(i.customTableThemes.remove(t),delete th[t.trim().toLowerCase()],e.setData(re.tableStyleKey,e.Spread.customTableThemes.all()))}async function LO(e,t,i){let n=e.Spread;if(t){const a=Tm(e),r=i?a==null?void 0:a.style():n.customTableThemes.get(t);if(!r)return;const o=r.name(),l={data:{styleName:o,customTableStyle:r.toJSON()}},c=E0(s.formatTableStyle.modifyStyleDialogTitle),d=await e._showDialog(c,l,(u,h)=>yO(u,o,h));if(d&&d.data){const u=d.data.customTableStyle;a&&i?O0(n,u):(e.Spread.customTableThemes.update(o,u),e.setData(re.tableStyleKey,e.Spread.customTableThemes.all()))}}}async function Cme(e,t){let i=e.Spread;t&&i.defaultTableTheme(t)}async function yme(e,t){var n;let i=e.Spread;if(t){let a=Tt[t];if(a||(a=(n=i.customTableThemes.get(t))!=null?n:new GC.Spread.Sheets.Tables.TableTheme),a=vme(i,a),a){const r={data:{styleName:a.name(),customTableStyle:a.toJSON()}},o=E0(s.formatTableStyle.modifyStyleDialogTitle),l=await e._showDialog(o,r,N0),c=l==null?void 0:l.data.customTableStyle;c&&(i.customTableThemes.add(c),e.setData(re.tableStyleKey,i.customTableThemes.all()))}}}function vme(e,t){const i=new GC.Spread.Sheets.Tables.TableTheme;i.fromJSON(JSON.parse(JSON.stringify(t.toJSON())));let n=2,a=i.name()+" ",r=a+n;for(;e.customTableThemes.get(r);)r=a+ ++n;return i.name(r),i}function TO(e,t){Tme(e,t),Lme(e,t),xme(e,t)}function xme(e,t){var r;let i=Tm(e),n=((r=i==null?void 0:i.getStyleName())==null?void 0:r.toLowerCase())||"",a=!1;t.forEach(o=>{o.groupItems&&o.groupItems.forEach(l=>{if(l.value){const c=n&&(l.value===th[n]||l.value===n),d=!n&&i&&l.contextMenuOnly;l.selected=!!(c||d)&&!a,l.selected&&(a=!0)}})})}function Lme(e,t){Tm(e)?t[1].groupItems&&(t[1].groupItems[0].visible=!0):t[1].groupItems&&(t[1].groupItems[0].visible=!1)}function Tm(e){let t=e.Spread,i=C.getActiveSheet(t);if(!i)return;let n=i.getActiveRowIndex(),a=i.getActiveColumnIndex();return i.tables.find(n,a)}function Tme(e,t){var r;let i=e.Spread.customTableThemes.all()||[];e.setData(re.tableStyleKey,i);let n=t[0];n.groupItems=[],th={},i.forEach((o,l)=>{const c=o.name();n.groupItems&&n.groupItems.push({itemRender:wl,value:c,tip:c,selectedClassName:"gc-list-control-selected-item-border"}),th[c.toLowerCase()]=c});let a=Tm(e);if(a&&!a.getStyleName()){const o=a.style();if(o){const l=(r=o.name())!=null?r:"";n.groupItems&&n.groupItems.push({itemRender:wl,value:l,tip:l,selectedClassName:"gc-list-control-selected-item-border",contextMenu:[{text:"${res.formatTableStyle.modify}",commandName:p.FormatTableListContent,value:"modifyObject"}],contextMenuOnly:!0})}}n.visible=n.groupItems.length>0}let wme=C.CloneJsonObj(xO),Dme={title:"${res.ribbon.home.formatTableTitle}",text:"${res.ribbon.home.formatTableText}",iconClass:"ribbon-button-formattable",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.FormatTable2,dropdownListItemType:"menuitemradio",direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")',visibleContext:`!${m.ReportSheetActive} && !${m.IsInParameterPanelDesignMode}`,enableContext:`${m.AllowFormatCells} && !${m.PivotTableSelected} && !${m.IsInTableSheetDesignMode} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`},Ame={title:"${res.ribbon.home.styleList}",text:"${res.ribbon.home.styleList}",iconClass:"ribbon-button-formattable",commandName:p.FormatTableListContent,type:"listContent",dropdownListItemType:"menuitemradio",maxWidth:510,enableContext:`${m.AllowFormatCells} && !${m.PivotTableSelected}`,execute:async(e,t,i)=>{if(t===eh.C_Modify)await LO(e,i);else if(t===eh.C_Modify_Object)await LO(e,i,!0);else if(t===eh.C_Delete)await Sme(e,i);else if(t===eh.C_Set_Default)await Cme(e,i);else if(t===eh.C_Duplicate)await yme(e,i);else{if(await B0(e,i)===!1)return;e.setData(m.TableSelected,!0),e.setData(m.TableClicked,!0),e.setData(m.TableAllowResize,!0),e.activeRibbonTab("tableDesign")}},getState:e=>()=>{const t=C.CloneJsonObj(wme);return TO(e,t),t}},Pme=C.CloneJsonObj(bme),Ime={title:"${res.ribbon.tableSheetDesign.format}",text:"${res.ribbon.tableSheetDesign.format}",iconClass:"ribbon-button-format-table-sheet",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.FormatTableSheet,enableContext:`!${m.IsInTableSheetDesignMode}`,direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")'},Mme={title:"${res.ribbon.tableSheetDesign.styles}",text:"${res.ribbon.tableSheetDesign.styles}",commandName:p.FormatTableSheetListContent,type:"listContent",dropdownListItemType:"menuitemradio",maxWidth:510,execute:async(e,t,i)=>{await B0(e,i)},getState:e=>{const t=C.CloneJsonObj(Pme);return t[0].groupItems[0].visible=!1,t},init:e=>{rse(e.Spread,"changeTableSheetTheme")}};const kme=Object.freeze(Object.defineProperty({__proto__:null,FormatTable:Dme,FormatTableListContent:Ame,FormatTableSheet:Ime,FormatTableSheetListContent:Mme},Symbol.toStringTag,{value:"Module"}));function Rme(e){e.commandManager().execute({cmd:"cutFloatingObjects",sheetName:C.getActiveSheet(e).name()})}function _me(e,t){let i="Designer."+t;e.commandManager().register(i,wO,void 0,!1,!1,!1,!1)}function Ome(e,t){oe.runCommand(e,"cut",wO,{callback:t})}let wO={canUndo:!1,execute:function(e,t,i){return new Eme(e,t).execute(e,t,i)}};class Eme extends oe.DesignerActionBase{executeImp(t,i,n){let a=t,r=i.sheetName,o={};o.cmd="cut",o.sheetName=r,o.ignoreClipboard=!0,o.callback=function(){i.callback(o.cutData.copyText,o.cutData.copyHtml)},a.commandManager().execute(o)}}class wm{static getSelectedPicture(t){let i=t.pictures.all(),n=[];for(let a=0;a<i.length;a++){let r=i[a];r.isSelected()&&n.push(r)}return n}static isSelectedPicture(t){return!(!t||wm.getSelectedPicture(t).length===0)}}let DO={title:"${res.ribbon.home.cut}",iconClass:"ribbon-button-cut",commandName:p.RibbonCut,text:'=IF(inDropdown, "${res.ribbon.home.cut}", "")',enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode}`,execute:e=>{Nme(e)}};function Nme(e){let t=e.Spread,i=C.getActiveSheet(t);ut.getActiveAllShapes(i).length>0?t.commandManager().execute({cmd:"cutShapes",sheetName:C.getActiveSheet(t).name()}):vi.isSlicerSelected(i)||wm.isSelectedPicture(i)||pe.getActiveChart(t)?Rme(t):Ome(t,function(a,r){C.clipboard.copyText=a,C.clipboard.copyHtml=r})}const Bme=Object.freeze(Object.defineProperty({__proto__:null,Cut:DO},Symbol.toStringTag,{value:"Module"}));function Fme(e){e.commandManager().execute({cmd:"copyFloatingObjects",sheetName:C.getActiveSheet(e).name()})}function Gme(e,t){let i="Designer."+t;e.commandManager().register(i,PO,void 0,!1,!1,!1,!1)}function AO(e,t){oe.runCommand(e,"copy",PO,{callback:t})}class Vme extends oe.DesignerActionBase{executeImp(t,i,n){let a=t,r=i.sheetName,o={};o.cmd="copy",o.sheetName=r,o.ignoreClipboard=!0,o.callback=function(){i.callback(o.copyData.copyText,o.copyData.copyHtml)},a.commandManager().execute(o)}}let PO={canUndo:!1,execute:function(e,t,i){return new Vme(e,t).execute(e,t,i)}},IO={title:"${res.ribbon.home.copy}",iconClass:"ribbon-button-copy",commandName:p.RibbonCopy,text:'=IF(inDropdown, "${res.ribbon.home.copy}", "")',enableContext:`!${m.IsInTableSheetDesignMode}`,viewModeEnableContext:"true",metaData:{viewModePermissions:XA},execute:e=>{Hme(e)}};function Hme(e){let t=e.Spread,i=C.getActiveSheet(t);ut.getActiveAllShapes(i).length>0?t.commandManager().execute({cmd:"copyShapes",sheetName:C.getActiveSheet(t).name()}):vi.isSlicerSelected(i)||wm.isSelectedPicture(i)||pe.getActiveChart(t)?Fme(t):AO(t,function(a,r){C.clipboard.copyText=a,C.clipboard.copyHtml=r})}const zme=Object.freeze(Object.defineProperty({__proto__:null,Copy:IO},Symbol.toStringTag,{value:"Module"})),Co=".formatPinter";var MO=(e=>(e[e.unable=0]="unable",e[e.enable=1]="enable",e[e.remain=2]="remain",e[e.done=3]="done",e))(MO||{});let $b;class jme extends oe.DesignerActionBase{executeImp(t,i,n){let a=t.getActiveSheet();if(vi.isSlicerSelected(a)||wm.isSelectedPicture(a)||pe.getActiveChart(t)||ut.getActiveAllShapes(a).length>0)return;let r=!0;return t.bind(GC.Spread.Sheets.Events.InvalidOperation+Co,function(){eS(t,i.getFPState,i.setFPState),r=!1}),AO(t,()=>{}),r&&(t.bind(GC.Spread.Sheets.Events.SelectionChanged+Co,()=>{NO(t,i.getFPState,i.setFPState)}),t.bind(GC.Spread.Sheets.Events.CellChanged+Co,()=>{Dm(t,i.getFPState,i.setFPState)})),r}}class Wme extends oe.DesignerActionBase{executeImp(t,i,n){clearTimeout($b),t.unbind(GC.Spread.Sheets.Events.SelectionChanged+Co);let a=C.getActiveSheet(t);return t.bind("PasteEnd"+Co,()=>{t.unbind("PasteEnd"+Co),t.unbind(GC.Spread.Sheets.Events.InvalidOperation+Co),t.bind(GC.Spread.Sheets.Events.SelectionChanged+Co,()=>{NO(t,i.getFPState,i.setFPState)})}),t.bind(GC.Spread.Sheets.Events.ClipboardPasted+Co,(r,o)=>{t.unbind(GC.Spread.Sheets.Events.ClipboardPasted+Co);let{row:l,col:c,rowCount:d,colCount:u}=o.fromRange;!o.cellRange.equals(o.fromRange)&&o.cellRange.intersect(l,c,d,u)&&Dm(t,i.getFPState,i.setFPState)}),t.bind(GC.Spread.Sheets.Events.InvalidOperation+Co,function(){eS(t,i.getFPState,i.setFPState)}),t.commandManager().execute({cmd:"paste",sheetName:a.name(),isFromDesigner:!0,pasteOption:GC.Spread.Sheets.ClipboardPasteOptions.formatting}),!0}removeSpan(t,i){for(let n=0;n<i.length;n++){let a=i[n],r=a.row===-1?0:a.row,o=a.col===-1?0:a.col;for(let l=0;l<a.rowCount;l++)for(let c=0;c<a.colCount;c++)t.getActiveSheet().removeSpan(r+l,o+c)}}}class Zme extends oe.DesignerActionBase{executeImp(t,i,n){let a=C.getActiveSheet(t);return t.unbind(Co),(!a.isEditing||!a.isEditing())&&($b=setTimeout(()=>{t.commandManager().execute({cmd:"cancelInput",sheetName:a&&a.name(),isFromDesigner:!0}),clearTimeout($b)},200)),!0}}let kO={canUndo:!1,execute:(e,t,i)=>{let a=new jme(e,{}).execute(e,t,!1);return a&&t.getFPState()!==2?t.setFPState(1):clearTimeout($b),a}},RO={canUndo:!1,execute:(e,t,i)=>{let n=t.getFPState(),a=!0;return n!==0&&(a=new Wme(e,{}).execute(e,t,!1),n===1&&(t.setFPState(3),Dm(e,t.getFPState,t.setFPState))),a}},_O={canUndo:!1,execute:(e,t,i)=>{let a=new Zme(e,{}).execute(e,{},!1);return t.setFPState(0),a}};function eS(e,t,i){t()!==0&&Dm(e,t,i)}function OO(e,t,i){let n=e.commandManager();n.register("Designer.formatPainterStart",kO,void 0,!1,!1,!1,!1),n.register("Designer.formatPainterExecute",RO,void 0,!1,!1,!1,!1),n.register("Designer.formatPainterCancel",_O,void 0,!1,!1,!1,!1),e.commandManager().register("cancelFormatPainterESC",a=>{eS(a,t,i)},27,!1,!1,!1,!1),e.commandManager().register("cancelFormatPainterCtrlZ",a=>{eS(a,t,i)},90,!0,!1,!1,!1)}function EO(e,t,i){oe.runCommand(e,"formatPainterStart",kO,{getFPState:t,setFPState:i})}function NO(e,t,i){oe.runCommand(e,"formatPainterExecute",RO,{getFPState:t,setFPState:i})}function Dm(e,t,i){oe.runCommand(e,"formatPainterCancel",_O,{getFPState:t,setFPState:i})}const Ume="dbclick",F0=e=>()=>e.getData(m.FormatPainter),G0=e=>t=>{e.setData(m.FormatPainter,t)};let Jme={title:"${res.ribbon.home.formatPainter}",iconClass:"ribbon-button-formatPainter",commandName:p.RibbonFormatPainter,type:"dbclickCheckbox",enableContext:`(!${m.IsIncludeLockedCell} || ${m.AllowFormatCells}) && !${m.IsInTableSheetDesignMode} && !${m.ChartSelected}`,visiblePriority:5,text:'=IF(inDropdown, "${res.ribbon.home.formatPainter}", "")',execute:(e,t,i)=>{const n=F0(e),a=G0(e);t===Ume?(a(MO.remain),EO(e.Spread,n,a)):n()?Dm(e.Spread,n,a):EO(e.Spread,n,a)},getState:e=>{const t=F0(e),i=G0(e);return e.Spread.commandManager().getCommand("cancelFormatPainterESC")===void 0&&OO(e.Spread,t,i),!!e.getData(m.FormatPainter)},init:e=>{const t=F0(e),i=G0(e);OO(e.Spread,t,i)}};const Yme=Object.freeze(Object.defineProperty({__proto__:null,FormatPainter:Jme},Symbol.toStringTag,{value:"Module"}));let qme={title:"${res.ribbon.home.paste}",text:'=IF(inDropdown,"${res.ribbon.home.paste}","")',direction:'=IF(ribbonHeight>toolbarHeight, "vertical", "horizontal")',iconClass:"ribbon-button-paste",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.Paste,enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode}`};const Kme=Object.freeze(Object.defineProperty({__proto__:null,Paste:qme},Symbol.toStringTag,{value:"Module"}));function Qme(e,t){let i="Designer."+t;e.commandManager().register(i,BO,void 0,!1,!1,!1,!1)}function ih(e,t,i,n,a){oe.runCommand(e,"paste",BO,{pasteOptions:t,pasteSpecialOptions:a,text:i,html:n,isFromDesigner:!0})}let BO={canUndo:!1,execute:function(e,t,i){let n=C.getSheetOrSheetTabByName(e,t.sheetName);if(n.isPasteFloatingObject())return e.commandManager().execute({cmd:"pasteFloatingObjects",sheetName:n.name()});if(n.isPasteShapes&&n.isPasteShapes())return e.commandManager().execute({cmd:"pasteShapes",sheetName:n.name()});{let a=t.text,r=t.html;return e.commandManager().execute({cmd:"paste",sheetName:n.name(),pasteText:a,pasteHtml:r,pasteOption:t.pasteOptions,pasteSpecialOptions:t.pasteSpecialOptions,isFromDesigner:t.isFromDesigner})}}};var Dd=(e=>(e.All="paste-all",e.Formulas="paste-formulas",e.Values="paste-values",e.Formatting="paste-formatting",e.ValuesAndFormatting="paste-valuesAndFormatting",e.FormulasAndFormatting="paste-formulasAndFormatting",e))(Dd||{});function nh(e,t){switch(t){case"paste-all":ih(e.Spread,GC.Spread.Sheets.ClipboardPasteOptions.all);break;case"paste-formatting":ih(e.Spread,GC.Spread.Sheets.ClipboardPasteOptions.formatting);break;case"paste-formulas":ih(e.Spread,GC.Spread.Sheets.ClipboardPasteOptions.formulas);break;case"paste-formulasAndFormatting":ih(e.Spread,GC.Spread.Sheets.ClipboardPasteOptions.formulasAndFormatting);break;case"paste-values":ih(e.Spread,GC.Spread.Sheets.ClipboardPasteOptions.values);break;case"paste-valuesAndFormatting":ih(e.Spread,GC.Spread.Sheets.ClipboardPasteOptions.valuesAndFormatting);break}e.setData(re.isFileModified,!0)}let FO={text:'=IF(OR(inDropdown,isToolbarMode), IF(AND(inDropdown, NOT(isToolbarMode)), "", "${res.ribbon.home.all}"),"${res.ribbon.home.paste}")',title:"${res.ribbon.home.pasteAll}",tip:"${res.ribbon.home.pasteAll}",direction:'=IF(ribbonHeight>toolbarHeight, "vertical", "horizontal")',iconClass:"ribbon-button-paste",bigButton:"=AND(ribbonHeight>toolbarHeight,NOT(inDropdown))",commandName:p.PasteAll,enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode}`,dropdownMaxWidth:165,execute:(e,t)=>{nh(e,Dd.All)}};const Xme=Object.freeze(Object.defineProperty({__proto__:null,PasteAll:FO},Symbol.toStringTag,{value:"Module"}));let GO={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.ribbon.home.formulas}")',tip:"${res.ribbon.home.pasteFormulas}",commandName:p.PasteFormulas,iconClass:"ribbon-button-paste-formula",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && !${m.ClipboardCutting}`,execute:(e,t)=>{nh(e,Dd.Formulas)}};const $me=Object.freeze(Object.defineProperty({__proto__:null,PasteFormula:GO},Symbol.toStringTag,{value:"Module"}));let VO={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.ribbon.home.values}")',tip:"${res.ribbon.home.pasteValues}",commandName:p.PasteValues,enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && !${m.ClipboardCutting}`,execute:(e,t)=>{nh(e,Dd.Values)},iconClass:"ribbon-button-paste-values"};const ege=Object.freeze(Object.defineProperty({__proto__:null,PasteValue:VO},Symbol.toStringTag,{value:"Module"}));let HO={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.ribbon.home.formatting}")',tip:"${res.ribbon.home.pasteFormatting}",commandName:p.PasteFormatting,enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && !${m.ClipboardCutting}`,execute:(e,t)=>{nh(e,Dd.Formatting)},iconClass:"ribbon-button-formatting"};const tge=Object.freeze(Object.defineProperty({__proto__:null,PasteFormatting:HO},Symbol.toStringTag,{value:"Module"}));let zO={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.ribbon.home.valuesAndFormatting}")',tip:"${res.ribbon.home.pasteValuesAndFormatting}",commandName:p.ValuesAndFormatting,enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && !${m.ClipboardCutting}`,execute:(e,t)=>{nh(e,Dd.ValuesAndFormatting)},iconClass:"ribbon-button-paste-value-formatting"};const ige=Object.freeze(Object.defineProperty({__proto__:null,PasteValueAndFormatting:zO},Symbol.toStringTag,{value:"Module"}));let jO={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.ribbon.home.formulasAndFormatting}")',tip:"${res.ribbon.home.pasteFormulasAndFormatting}",commandName:p.FormulasAndFormatting,enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && !${m.ClipboardCutting}`,execute:(e,t)=>{nh(e,Dd.FormulasAndFormatting)},iconClass:"ribbon-button-paste-formula-formatting"};const nge=Object.freeze(Object.defineProperty({__proto__:null,PasteFormulasAndFormatting:jO},Symbol.toStringTag,{value:"Module"}));class Ia extends oe.DesignerActionBase{undoImp(t,i,n){t.suspendPaint();try{GC.Spread.Sheets.Commands.undoTransaction(t,i)}finally{t.resumePaint()}return!0}isSendEvent(t,i,n){return!0}changeSelectionInCommandExecuting(t,i,n){let a=i.selectedShape;n!=null&&(a=n);let r=a&&a[0];if(r){let o=r.startRow&&r.startRow(),l=r.startColumn&&r.startColumn();t.changeSelectionInCommandExecuting(i,o,l,null,a)}}}function age(e,t){let i="Designer."+t;e.commandManager().register(i,ZO,void 0,!1,!1,!1,!1)}function rge(e,t,i,n,a,r){return oe.runCommand(e,"insertShape",ZO,{PosX:t,PosY:i,width:n,height:a,shapeInfo:r})}function oge(e,t){let i="Designer."+t;e.commandManager().register(i,UO,void 0,!1,!1,!1,!1)}function WO(e,t,i,n){if(GC.Spread.Sheets.Shapes)return oe.runCommand(e,"insertCameraShape",UO,{range:t,PosX:i,PosY:n})}function lge(e,t){let i="Designer."+t;e.commandManager().register(i,JO,void 0,!1,!1,!1,!1)}function sge(e,t){if(GC.Spread.Sheets.Shapes)return oe.runCommand(e,"insertFormControlShape",JO,t)}let ZO={canUndo:!0,execute:function(e,t,i){return new cge(e,t).execute(e,t,i)}};class cge extends Ia{executeImp(t,i,n){let r=this.sheet();if(!r)return!1;let{type:o,isConnectorType:l,style:c,isTextBox:d}=i.shapeInfo,u=i.PosX,h=i.PosY,g=i.width,f=i.height;if(l){let b=r.shapes.addConnector("",o,u,h,u+g,h+f),S=b.style();i.shapeInfo.beginArrowhead!==void 0&&(S.line.beginArrowheadStyle=i.shapeInfo.beginArrowhead.style,S.line.beginArrowheadWidth=i.shapeInfo.beginArrowhead.width,S.line.beginArrowheadLength=i.shapeInfo.beginArrowhead.length,b.style(S)),i.shapeInfo.endArrowhead!==void 0&&(S.line.endArrowheadStyle=i.shapeInfo.endArrowhead.style,S.line.endArrowheadWidth=i.shapeInfo.endArrowhead.width,S.line.endArrowheadLength=i.shapeInfo.endArrowhead.length,b.style(S)),r.shapes.all().forEach(y=>y.isSelected(!1)),b.isSelected(!0)}else{let b=r.shapes.add("",o,u,h,g,f);c&&b.style(c),C.isNullOrUndefined(d)||b.isTextBox(d),r.shapes.all().forEach(S=>S.isSelected(!1)),b.isSelected(!0)}return!0}}let UO={canUndo:!0,execute:function(e,t,i){return new dge(e,t).execute(e,t,i)}};class dge extends Ia{executeImp(t,i,n){let r=this.sheet();if(!r)return!1;if(i.selections&&i.selections[0]){let o=i.selections[0];if(o.col<0||o.row<0||o.rowCount<0||o.colCount<0)return s.createCameraShapeDialog.warningText}if(i.range)return r.shapes.addCameraShape("",i.range,i.PosX,i.PosY),!0}}let JO={canUndo:!0,execute:function(e,t,i){return new uge(e,t).execute(e,t,i)}};class uge extends Ia{executeImp(t,i,n){let r=this.sheet();if(!r)return!1;let{type:o,x:l,y:c,width:d,height:u,text:h}=i,g=r.shapes.addFormControl("",o,l,c,d,u);return h&&g.text(h),!0}}const hge=e=>e;let pge=function(){return{templateName:G.InsertCameraShapeDialogTemplate,title:s.createCameraShapeDialog.createCameraShape,content:[{type:"FlexContainer",children:[{type:"TextBlock",margin:"5px -4px",text:s.createCameraShapeDialog.whereYourCameraShape},{type:"RangeSelect",title:s.createCameraShapeDialog.createCameraShape,absoluteReference:!0,needSheetName:!1,margin:"5px -5px",bindingPath:hge("range")}]}]}};const mge=(e,t,i)=>{var a;let n=i;if(n){const r=GC.Spread.Sheets.CalcEngine.formulaToRanges,o=r(t,i),l=(o==null?void 0:o.length)===1&&((a=o[0].ranges)==null?void 0:a.length)===1&&o[0].ranges[0];if(l&&l.colCount===1&&l.rowCount===1){const c=o[0].sheetName,d=c?e==null?void 0:e.getSheetFromName(c):t,u=d==null?void 0:d.getSpan(l.row,l.col);if(u){const h=GC.Spread.Sheets.CalcEngine.rangeToFormula;n=`${c}!${h(u)}`}}}return n};_e(G.InsertCameraShapeDialogTemplate,pge);let gge={title:"${res.ribbon.shapeDesign.insertCamera}",text:"${res.ribbon.insert.cameraShape}",iconClass:"ribbon-button-camera-shape",bigButton:"=ribbonHeight>toolbarHeight",commandName:p.InsertCameraShape,enableContext:`${m.AllowInsertShape} && ${m.AllowEditObject}`,visibleContext:`!${m.ReportSheetActive}`,execute:async(e,t)=>{let i=V0(e.Spread),n=await e._showDialog(G.InsertCameraShapeDialogTemplate,i);if(n!=null){let a=n.range;if(!a)return;let r=C.getActiveSheet(e.Spread);if(!r)return;a=mge(e.Spread,r,a);let o=ut.getFormulaRangeSize(r.getParent(),r,a),l=ut.getShapePosition(r,o&&o.width,o&&o.height),c=WO(e.Spread,a,l.x,l.y);if(typeof c=="string")return await e._showMessageBox(c,s.title,Re.warning),!1;e.setData(re.isFileModified,!0)}},init:e=>{oge(e.Spread,"insertCameraShape")}};function V0(e,t,i){let n=i||C.getActiveSheet(e);if(!n)return;let a=e.options.referenceStyle===1,r=t||n.getSelections()[0];return r?{range:Ht.parseRangeToExpString(r,!0,n.getActiveRowIndex(),n.getActiveColumnIndex(),a)}:void 0}const fge=Object.freeze(Object.defineProperty({__proto__:null,InsertCameraShapeButton:gge,getCameraShapeOption:V0},Symbol.toStringTag,{value:"Module"}));function bge(e,t,i){e.commandManager().register(i,t,void 0,!1,!1,!1,!1)}const H0="gc.spread.designer.LinkedPicture";function Sge(e){bge(e,{canUndo:!1,execute:function(i,n,a){var h;let r=i.getActiveSheet();if(!r)return;let o=r.getClipboardHelperObj().ranges,l=r.getClipboardHelperObj().fromSheet,c=(h=V0(i,o[0],l))==null?void 0:h.range;if(!c)return;r!==l&&(c=Ae.getSheetNameForFormula(l)+"!"+c);let d=ut.getFormulaRangeSize(r.getParent(),r,c),u=ut.getShapePosition(r,d&&d.width,d&&d.height);WO(i,c,u.x,u.y)}},H0)}const Cge=C.getActiveSheet,er=e=>"gc.spread.designer."+e,Ad=e=>"gc-spread-designer-pasteSpecial-icon-"+e,fc=er("pasteSpecialPasteGroup"),tS=er("pasteSpecialPasteValueGroup"),iS=er("pasteSpecialOtherOptionsGroup"),Xo="gc.spread.contextMenu.",Za={pasteFormulaAndNumberFormat:Xo+"pasteFormulaAndNumberFormat",pasteKeepSourceFormatting:Xo+"pasteKeepSourceFormatting",pasteNoBorders:Xo+"pasteNoBorders",pasteColumnWidth:Xo+"pasteColumnWidth",pasteTranspose:Xo+"pasteTranspose",pasteValueAndNumberFormats:Xo+"pasteValueAndNumberFormats",pasteValueAndSourceFormats:Xo+"pasteValueAndSourceFormats",pasteLink:Xo+"pasteLink"};let yge={text:"${res.pasteSpecial.title}",commandName:p.ContextMenuPasteSpecial,visibleContext:`${m.AllowPasteSpecial} && (!${m.PivotTableSelected} && ${m.ClickViewport} || ${m.ClickCorner} || ${m.ClickColHeader} || ${m.ClickRowHeader})`,type:"splitSubMenu",subMenu:vge(),execute:e=>{let t=e.Spread,i=Cge(t);t.commandManager().execute({cmd:"openPasteSpecialDialog",sheetName:i.name()})},init:e=>{Sge(e.Spread)}};function vge(){return[{text:s.pasteSpecial.paste,name:fc,type:"groupHeader"},{command:Xo+"pasteAll",name:er("pasteAll"),iconClass:"gc-spread-pasteAll",group:fc,text:s.pasteSpecial.paste},{command:Xo+"pasteFormula",name:er("pasteFormula"),iconClass:"gc-spread-pasteFormula",group:fc,text:s.pasteSpecial.formula},{command:Za.pasteFormulaAndNumberFormat,name:er("formulaAndNumberFormats"),iconClass:"gc-spread-pasteFormulaFormatting",group:fc,text:s.pasteSpecial.formulaAndNumberFormat},{command:Za.pasteKeepSourceFormatting,name:er("keepSourceFormatting"),iconClass:Ad("keepSourceFormat"),group:fc,text:s.pasteSpecial.keepSourceFormat},{command:Za.pasteNoBorders,name:er("noBorders"),iconClass:Ad("noBorders"),group:fc,text:s.pasteSpecial.noBorders},{command:Za.pasteColumnWidth,name:er("keepSourceColumnWidth"),iconClass:Ad("columnWidth"),group:fc,text:s.pasteSpecial.columnWidth},{command:Za.pasteTranspose,name:er("Transpose"),iconClass:Ad("transpose"),group:fc,text:s.pasteSpecial.transpose},{text:s.pasteSpecial.pasteValue,name:tS,type:"groupHeader"},{command:"gc.spread.contextMenu.pasteValues",name:er("PasteValue"),iconClass:"gc-spread-pasteValues",group:tS,text:s.pasteSpecial.values},{command:Za.pasteValueAndNumberFormats,name:er("PasteValue&NumberFormat"),iconClass:"gc-spread-pasteValuesFormatting",group:tS,text:s.pasteSpecial.valuesAndNumberFormat},{command:Za.pasteValueAndSourceFormats,name:er("PasteValue&SourceFormat"),iconClass:Ad("valueAndSourceFormats"),group:tS,text:s.pasteSpecial.valueAndSourceFormat},{text:s.pasteSpecial.otherPasteOptions,name:iS,type:"groupHeader"},{command:Xo+"pasteFormatting",name:er("PasteFormatting"),iconClass:"gc-spread-pasteValuesFormatting",group:iS,text:s.pasteSpecial.formatting},{command:Za.pasteLink,name:er("PasteLink"),iconClass:Ad("pasteLink"),group:iS,text:s.pasteSpecial.pasteLink},{command:H0,name:er("PasteLinkedPicture"),iconClass:Ad("linkedPicture"),group:iS,text:s.pasteSpecial.linkedPicture},{type:"separator"},{command:"openPasteSpecialDialog",name:"pasteSpecial",text:s.pasteSpecial.title}]}const xge=Object.freeze(Object.defineProperty({__proto__:null,PASTE_SPECIAL_COMMANDS:Za,ctx_PASTE_SPECIAL:yge},Symbol.toStringTag,{value:"Module"}));function Dl(e,t){e.commandManager().execute({cmd:t,sheetName:C.getActiveSheet(e).name()})}let Lge={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.formulaAndNumberFormat}")',tip:"${res.pasteSpecial.formulaAndNumberFormat}",commandName:p.PasteFormulaAndNumberFormat,iconClass:"ribbon-button-paste-formula-numberFormat",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteFormulaAndNumberFormat)}},Tge={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.keepSourceFormat}")',tip:"${res.pasteSpecial.keepSourceFormat}",commandName:p.PasteKeepSourceFormatting,iconClass:"ribbon-button-paste-source-format",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteKeepSourceFormatting)}},wge={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.noBorders}")',tip:"${res.pasteSpecial.noBorders}",commandName:p.PasteNoBorders,iconClass:"ribbon-button-paste-noBorders",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteNoBorders)}},Dge={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.columnWidth}")',tip:"${res.pasteSpecial.columnWidth}",commandName:p.PasteColumnWidth,iconClass:"ribbon-button-paste-column-width",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteColumnWidth)}},Age={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.transpose}")',tip:"${res.pasteSpecial.transpose}",commandName:p.PasteTranspose,iconClass:"ribbon-button-paste-transpose",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteTranspose)}},Pge={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.valuesAndNumberFormat}")',tip:"${res.pasteSpecial.valuesAndNumberFormat}",commandName:p.PasteValueAndNumberFormat,iconClass:"ribbon-button-paste-value-numberFormat",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteValueAndNumberFormats)}},Ige={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.valueAndSourceFormat}")',tip:"${res.pasteSpecial.valueAndSourceFormat}",commandName:p.PasteValueAndSourceFormat,iconClass:"ribbon-button-paste-values-source-format",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteValueAndSourceFormats)}},Mge={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.pasteLink}")',tip:"${res.pasteSpecial.pasteLink}",commandName:p.PasteLink,iconClass:"ribbon-button-paste-link",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,Za.pasteLink)}},kge={text:'=IF(AND(inDropdown, NOT(isToolbarMode)),"","${res.pasteSpecial.linkedPicture}")',tip:"${res.pasteSpecial.linkedPicture}",commandName:p.PasteLinkedPicture,iconClass:"ribbon-button-paste-linked-picture",enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,H0)}},Rge={text:"${res.pasteSpecial.title}",commandName:p.OpenPasteSpecialDialog,enableContext:`!${m.IsIncludeLockedCell} && !${m.IsInTableSheetDesignMode} && ${m.AllowPasteSpecial}`,execute:(e,t)=>{Dl(e.Spread,"openPasteSpecialDialog")}};const _ge=Object.freeze(Object.defineProperty({__proto__:null,OpenPasteSpecialDialog:Rge,PasteColumnWidth:Dge,PasteFormulaAndNumberFormat:Lge,PasteKeepSourceFormatting:Tge,PasteLink:Mge,PasteLinkedPicture:kge,PasteNoBorders:wge,PasteTranspose:Age,PasteValueAndNumberFormat:Pge,PasteValueAndSourceFormat:Ige},Symbol.toStringTag,{value:"Module"}));let Oge={title:"${res.ribbon.home.insert}",text:"${res.ribbon.home.insert}",iconClass:"ribbon-button-insert",bigButton:"=ribbonHeight>toolbarHeight",direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")',commandName:p.CellsInsert,enableContext:`!${m.IsInTableSheetDesignMode}`};const Ege=Object.freeze(Object.defineProperty({__proto__:null,CellsInsert:Oge},Symbol.toStringTag,{value:"Module"}));class bc extends oe.DesignerActionBase{canDoInsertOrDeleteRow(){return!0}canDoInsertOrDeleteColumn(){return!0}getSortedRowSelections(){let t=this.sheet().getSelections();for(let i=0;i<t.length-1;i++)for(let n=i+1;n<t.length;n++)if(t[i].row<t[n].row){let a=t[i];t[i]=t[n],t[n]=a}return t}getSortedColumnSelections(){let t=this.sheet().getSelections();for(let i=0;i<t.length-1;i++)for(let n=i+1;n<t.length;n++)if(t[i].col<t[n].col){let a=t[i];t[i]=t[n],t[n]=a}return t}}function Nge(e){return oe.runCommand(e,"insertDownCells",YO,{})}let YO={canUndo:!0,execute:function(e,t,i){return new Bge(e,t).execute(e,t,i)}};class Bge extends bc{executeImp(t,i,n){let a=this,r=i.selections;if(Ae.getSelectionTypeWithSelections(r)===3){let o=Ae.getSortedRowSelections(r),l=a.sheet().getRowCount();if(!a.canInsertDown(o))return s.insertCellOfTable;for(let c=0;c<o.length;c++){let d=o[c],u=GC.Spread.Sheets.CopyToOptions.all;a.sheet().addRows(l,d.rowCount),a.sheet().moveTo(d.row,d.col,d.row+d.rowCount,d.col,l-d.row,d.colCount,u)}}}canShiftCell(t,i){let n=t.tables.all(),a;for(let r=0;r<n.length;r++)if(a=n[r].range(),!(i.containsRange(a)||a.containsRange(i))&&i.intersect(a.row,a.col,a.rowCount,a.colCount))return{ret:!1,type:"table"}}canInsertDown(t){let i=this.sheet(),n=!0;for(let a=0;a<t.length;a++){let r=t[a],o=[],l=r.row,c=r.col,d=r.row+r.rowCount,u=r.col+r.colCount,h=new GC.Spread.Sheets.Range(l,c,i.getRowCount(),u-c),g=this.canShiftCell(i,h);if(g)return g.ret;for(let y=l;y<d;y++)for(let v=c;v<u;v++){let x;for(x=0;x<o.length&&!o[x].contains(y,v,1,1);x++);let L=i.getFormulaInformation(y,v);x===o.length&&L.isArrayFormula&&o.push(L.baseRange)}if(o.length===0)return n;let f=o[0].col,b=o[0].row,S=o[0].col+o[0].colCount;for(let y=1;y<o.length;y++)o[y].col<f&&(f=o[y].col),o[y].row<b&&(b=o[y].row),o[y].col+o[y].colCount<S&&(S=o[y].row+o[y].rowCount);if(f<r.col||b<r.row||S>r.col+r.colCount){n=!1;break}}return n}}function Fge(e,t){let i="Designer."+t;e.commandManager().register(i,YO,void 0,!1,!1,!1,!1)}function Gge(e){return oe.runCommand(e,"insertRightCells",qO,{})}let qO={canUndo:!0,execute:function(e,t,i){return new Vge(e,t).execute(e,t,i)}};class Vge extends bc{executeImp(t,i,n){let a=this,r=i.selections;if(Ae.getSelectionTypeWithSelections(r)===Ae.SelectionRangeType.OnlyCells){let o=Ae.getSortedColumnSelections(r),l=a.sheet().getColumnCount();if(!a.canInsertRight(o))return s.insertCellOfTable;for(let c=0;c<o.length;c++){let d=o[c],u=GC.Spread.Sheets.CopyToOptions.all;a.sheet().addColumns(l,d.colCount),a.sheet().moveTo(d.row,d.col,d.row,d.col+d.colCount,d.rowCount,l-d.col,u)}}}canShiftCell(t,i){let n=t.tables.all(),a;for(let r=0;r<n.length;r++)if(a=n[r].range(),!(i.containsRange(a)||a.containsRange(i))&&i.intersect(a.row,a.col,a.rowCount,a.colCount))return{ret:!1,type:"table"}}canInsertRight(t){let i=this.sheet(),n=!0;for(let a=0;a<t.length;a++){let r=t[a],o=[],l=r.row,c=r.col,d=r.row+r.rowCount,u=r.col+r.colCount,h=new GC.Spread.Sheets.Range(l,c,d-l,i.getColumnCount()),g=this.canShiftCell(i,h);if(g)return g.ret;for(let y=l;y<d;y++)for(let v=c;v<u;v++){let x;for(x=0;x<o.length&&!o[x].contains(y,v,1,1);x++);let L=i.getFormulaInformation(y,v);x===o.length&&L.isArrayFormula&&o.push(L.baseRange)}if(o.length===0)return n;let f=o[0].col,b=o[0].row,S=o[0].row+o[0].rowCount;for(let y=1;y<o.length;y++)o[y].col<f&&(f=o[y].col),o[y].row<b&&(b=o[y].row),o[y].row+o[y].rowCount<S&&(S=o[y].row+o[y].rowCount);if(f<r.col||b<r.row||S>r.row+r.rowCount){n=!1;break}}return n}}function Hge(e,t){let i="Designer."+t;e.commandManager().register(i,qO,void 0,!1,!1,!1,!1)}function KO(e,t){let i="Designer."+t;e.commandManager().register(i,zge,void 0,!1,!1,!1,!1)}function nS(e){let t={};oe.updateCommandOptions(e,t);let i=new QO(e,t);i.canExecute()&&i.executeImp(e,t,!1)}let zge={canUndo:!0,execute:function(e,t,i){return new QO(e,t).execute(e,t,i)}};class QO extends bc{canExecute(){return this.canDoInsertOrDeleteRow()}executeImp(t,i,n){let a=this,r=i.selections,o=a.sheet(),l=p.InsertRows;t.commandManager().execute({cmd:l,sheetName:o.name(),selections:r,activeRow:o&&o.getActiveRowIndex(),activeCol:o&&o.getActiveColumnIndex()})}}function XO(e,t){let i="Designer."+t;e.commandManager().register(i,jge,void 0,!1,!1,!1,!1)}function aS(e){let t={};oe.updateCommandOptions(e,t);let i=new $O(e,t);i.canExecute()&&i.executeImp(e,t,!1)}class $O extends bc{canExecute(){return this.canDoInsertOrDeleteColumn()}executeImp(t,i,n){let a=this,r=i.selections,o=a.sheet(),l=p.InsertColumns;t.commandManager().execute({cmd:l,sheetName:o.name(),selections:r,activeRow:o&&o.getActiveRowIndex(),activeCol:o&&o.getActiveColumnIndex()})}}let jge={canUndo:!0,execute:function(e,t,i){return new $O(e,t).execute(e,t,i)}};var ah=(e=>(e[e.shiftCellsRight=0]="shiftCellsRight",e[e.shiftCellsDown=1]="shiftCellsDown",e[e.entireRow=2]="entireRow",e[e.entireColumn=3]="entireColumn",e))(ah||{});let Wge=function(){return{templateName:G.CellsInsertDialogTemplate,title:s.insertCellsDialog.title,content:[{type:"Column",width:"200px",children:[{type:"LabelContainer",text:s.insertCellsDialog.title,size:{height:160},children:[{type:"Radio",bindingPath:"value",items:[{text:s.insertCellsDialog.shiftcellsright,value:0},{text:s.insertCellsDialog.shiftcellsdown,value:1},{text:s.insertCellsDialog.entirerow,value:2},{text:s.insertCellsDialog.entirecolumn,value:3}]}]}]}]}};const Zge=Ae.isFullCol,Uge=Ae.isFullRow;_e(G.CellsInsertDialogTemplate,Wge);async function eE(e,t){let i={value:ah.shiftCellsDown},n=e.Spread,a=C.getActiveSheet(n);if(Zge(a))aS(n);else if(Uge(a))nS(n);else{let r=await e._showDialog(G.CellsInsertDialogTemplate,i);if(r!=null)switch(r.value){case ah.shiftCellsDown:let o=Nge(n);typeof o=="string"&&e._showMessageBox(o,s.title,Re.warning);break;case ah.shiftCellsRight:let l=Gge(n);typeof l=="string"&&e._showMessageBox(l,s.title,Re.warning);break;case ah.entireRow:nS(n);break;case ah.entireColumn:aS(n);break}}}let Jge={text:"${res.ribbon.home.insertCells}",iconClass:"ribbon-control-dropdown-insertcells",commandName:p.InsertCellsInRibbon,enableContext:`${m.AllowInsertCell} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments} && !${m.PivotTableSelected}`,execute:eE,init:e=>{let t=e.Spread;Fge(t,"insertDownCells"),Hge(t,"insertRightCells"),XO(t,"insertColumns"),KO(t,"insertRows")}};const Yge=Object.freeze(Object.defineProperty({__proto__:null,insertCells:Jge},Symbol.toStringTag,{value:"Module"}));let qge={text:"${res.ribbon.home.insertSheetRows}",iconClass:"ribbon-control-dropdown-insertsheetrows",commandName:p.InsertSheetRows,enableContext:`${m.AllowInsertRows} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments} && !${m.PivotTableSelected}`,execute:(e,t)=>{nS(e.Spread)}};const Kge=Object.freeze(Object.defineProperty({__proto__:null,insertSheetRows:qge},Symbol.toStringTag,{value:"Module"}));let Qge={text:"${res.ribbon.home.insertSheetColumns}",iconClass:"ribbon-control-dropdown-insertsheetcolumns",commandName:p.InsertSheetColumns,enableContext:`${m.AllowInsertColumns} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments} && !${m.PivotTableSelected}`,execute:(e,t)=>{aS(e.Spread)}};const Xge=Object.freeze(Object.defineProperty({__proto__:null,insertSheetColumns:Qge},Symbol.toStringTag,{value:"Module"}));function $ge(e,t){let i="Designer."+t;e.commandManager().register(i,tE,void 0,!1,!1,!1,!1)}function efe(e){return oe.runCommand(e,"insertSheet",tE,{})}class tfe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;if(a.canExecute(t,i,n)){let r=a.spread(),o=r.getActiveSheet()||r.getActiveSheetTab(),l=r.getSheetPosition(o.name());r.addSheet(0);let c=r.getSheet(0);return r.changeSheetPosition(c.name(),l),r.setActiveSheet(c.name()),!0}else return!1}}let tE={canUndo:!1,execute:function(e,t,i){return new tfe(e,t).execute(e,t,i)}},ife={text:"${res.ribbon.home.insertSheet}",iconClass:"ribbon-control-dropdown-insertSheet",commandName:p.InsertSheetInRibbon,enableContext:`!${m.IsInParameterPanelDesignMode}`,execute:(e,t)=>{efe(e.Spread)&&e.setData(re.isFileModified,!0)},init:e=>{$ge(e.Spread,"insertSheet")}};const nfe=Object.freeze(Object.defineProperty({__proto__:null,insertSheets:ife},Symbol.toStringTag,{value:"Module"}));let afe={title:"${res.ribbon.home.Delete}",text:"${res.ribbon.home.Delete}",iconClass:"ribbon-button-delete",bigButton:"=ribbonHeight>toolbarHeight",direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")',commandName:p.CellsDelete,enableContext:`!${m.IsInTableSheetDesignMode}`};const rfe=Object.freeze(Object.defineProperty({__proto__:null,CellsDelete:afe},Symbol.toStringTag,{value:"Module"}));function ofe(e,t){let i="Designer."+t;e.commandManager().register(i,iE,void 0,!1,!1,!1,!1)}function lfe(e){oe.runCommand(e,"deleteLeftCells",iE,{})}class sfe extends bc{executeImp(t,i,n){let a=this,r=i.selections,o=Ae.getSortedColumnSelections(r);for(let l=0;l<o.length;l++){let c=o[l],d=GC.Spread.Sheets.CopyToOptions.all;a.sheet().moveTo(c.row,c.col+c.colCount,c.row,c.col,c.rowCount,a.sheet().getColumnCount()-(c.col+c.colCount),d)}}}let iE={canUndo:!0,execute:function(e,t,i){return new sfe(e,t).execute(e,t,i)}};function cfe(e,t){let i="Designer."+t;e.commandManager().register(i,nE,void 0,!1,!1,!1,!1)}function dfe(e){oe.runCommand(e,"deleteUpCells",nE,{})}class ufe extends bc{executeImp(t,i,n){let a=this,r=i.selections,o=Ae.getSortedRowSelections(r);for(let l=0;l<o.length;l++){let c=o[l],d=GC.Spread.Sheets.CopyToOptions.all,u=a.sheet().getRowCount()-(c.row+c.rowCount);if(a.sheet().moveTo(c.row+c.rowCount,c.col,c.row,c.col,u,c.colCount,d),u<c.rowCount){let h=GC.Spread.Sheets.StorageType.data|GC.Spread.Sheets.StorageType.axis|GC.Spread.Sheets.StorageType.bindingPath|GC.Spread.Sheets.StorageType.comment|GC.Spread.Sheets.StorageType.hyperlink|GC.Spread.Sheets.StorageType.sparkline|GC.Spread.Sheets.StorageType.style|GC.Spread.Sheets.StorageType.tag;a.sheet().clear(c.row+u,c.col,c.rowCount-u,c.colCount,3,h)}}}}let nE={canUndo:!0,execute:function(e,t,i){return new ufe(e,t).execute(e,t,i)}};function hfe(e,t){let i="Designer."+t;e.commandManager().register(i,pfe,void 0,!1,!1,!1,!1)}function rS(e){let t={};oe.updateCommandOptions(e,t);let i=new aE(e,t);i.canExecute()&&i.executeImp(e,t,!1)}class aE extends bc{canExecute(){return this.canDoInsertOrDeleteRow()&&!this._isTableHeaderInRange()}executeImp(t,i,n){let a=i.selections,o=this.sheet(),l=p.DeleteRows;t.commandManager().execute({cmd:l,sheetName:o.name(),selections:a,activeRow:o&&o.getActiveRowIndex(),activeCol:o&&o.getActiveColumnIndex()})}_isTableHeaderInRange(){let t=this,i=C.getActiveSheet(this.spread()).getSelections(),n=Ae.getSortedRowSelections(i),a=t.sheet().tables.all();for(let r in a)for(let o in n)if(a[r].headerIndex()===n[o].row)return!0;return!1}}let pfe={canUndo:!0,execute:function(e,t,i){return new aE(e,t).execute(e,t,i)}};function mfe(e,t){let i="Designer."+t;e.commandManager().register(i,gfe,void 0,!1,!1,!1,!1)}function oS(e){let t={};oe.updateCommandOptions(e,t);let i=new rE(e,t);i.canExecute()&&i.executeImp(e,t,!1)}let gfe={canUndo:!0,execute:function(e,t,i){return new rE(e,t).execute(e,t,i)}};class rE extends bc{canExecute(){return this.canDoInsertOrDeleteColumn()}executeImp(t,i,n){let a=this,r=i.selections,o=a.sheet(),l=p.DeleteColumns;t.commandManager().execute({cmd:l,sheetName:o.name(),selections:r,activeRow:o&&o.getActiveRowIndex(),activeCol:o&&o.getActiveColumnIndex()})}}var rh=(e=>(e[e.shiftCellsLeft=0]="shiftCellsLeft",e[e.shiftCellsUp=1]="shiftCellsUp",e[e.entireRow=2]="entireRow",e[e.entireColumn=3]="entireColumn",e))(rh||{});let ffe=function(){return{templateName:G.CellsDeleteDialogTemplate,title:s.deleteCellsDialog.title,content:[{type:"Column",width:"200px",children:[{type:"LabelContainer",text:s.deleteCellsDialog.title,size:{height:160},children:[{type:"Radio",bindingPath:"value",items:[{text:s.deleteCellsDialog.shiftcellsleft,value:0},{text:s.deleteCellsDialog.shiftcellsup,value:1},{text:s.deleteCellsDialog.entirerow,value:2},{text:s.deleteCellsDialog.entirecolumn,value:3}]}]}]}]}};_e(G.CellsDeleteDialogTemplate,ffe);async function oE(e,t){let i={value:rh.shiftCellsLeft},n=e.Spread,a=C.getActiveSheet(n);if(Ae.isFullCol(a))oS(n);else if(Ae.isFullRow(a))rS(n);else{let r=await e._showDialog(G.CellsDeleteDialogTemplate,i);if(r!=null)switch(r.value){case rh.shiftCellsLeft:lfe(n);break;case rh.shiftCellsUp:dfe(n);break;case rh.entireRow:rS(n);break;case rh.entireColumn:oS(n);break}}}let bfe={text:"${res.ribbon.home.deleteCells}",iconClass:"ribbon-control-dropdown-deletecells",commandName:p.CellsDeleteCell,enableContext:`${m.AllowDeleteCell} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments} && !${m.PivotTableSelected}`,execute:oE};const Sfe=Object.freeze(Object.defineProperty({__proto__:null,cellsDeleteCells:bfe},Symbol.toStringTag,{value:"Module"}));function Cfe(e,t){let i="Designer."+t;e.commandManager().register(i,lE,void 0,!1,!1,!1,!1)}function yfe(e){return oe.runCommand(e,"deleteSheet",lE,{})}let lE={canUndo:!1,execute:function(e,t,i){return new vfe(e,t).execute(e,t,i)}};class vfe extends oe.DesignerActionBase{canExecute(){return this.spread().getSheetCount()+this.spread().getSheetTabCount()>1}executeImp(t,i,n){let a=this,r=a.spread(),o=r.getSheetCount(),l=r.getSheetTabCount();if(o+l>1){let c=r.getActiveSheetOrSheetTab(),d=r.getSheetPosition(c.name());return r.getActiveSheet()?r.removeSheet(r.getSheetIndex(c.name())):r.getActiveSheetTab()&&r.removeSheetTab(c.name()),r.setActiveSheetOrSheetTabIndex(d),r.undoManager().clear(),!0}else return!1}}let xfe={text:"${res.ribbon.home.deleteSheet}",iconClass:"ribbon-control-dropdown-deletesheet",commandName:p.CellsDeleteSheet,enableContext:`!${m.IsInParameterPanelDesignMode}`,execute:e=>{yfe(e.Spread)},init:e=>{Cfe(e.Spread,"deleteSheet")}};const Lfe=Object.freeze(Object.defineProperty({__proto__:null,cellsDeleteSheet:xfe},Symbol.toStringTag,{value:"Module"}));let Tfe={text:"${res.ribbon.home.deleteSheetColumns}",iconClass:"ribbon-control-dropdown-deletesheetcolumns",commandName:p.CellsDeleteSheetColumn,enableContext:`${m.AllowDeleteColumns} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments} && !${m.PivotTableSelected}`,execute:(e,t)=>{oS(e.Spread)}};const wfe=Object.freeze(Object.defineProperty({__proto__:null,cellsDeleteSheetColumn:Tfe},Symbol.toStringTag,{value:"Module"}));let Dfe={text:"${res.ribbon.home.deleteSheetRows}",iconClass:"ribbon-control-dropdown-deletesheetrows",commandName:p.CellsDeleteSheetRow,enableContext:`${m.AllowDeleteRows} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments} && !${m.PivotTableSelected}`,execute:(e,t)=>{rS(e.Spread)}};const Afe=Object.freeze(Object.defineProperty({__proto__:null,cellsDeleteSheetRow:Dfe},Symbol.toStringTag,{value:"Module"}));let Pfe={title:"${res.ribbon.home.format}",text:"${res.ribbon.home.format}",iconClass:"ribbon-button-format",bigButton:"=ribbonHeight>toolbarHeight",direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")',commandName:p.CellsFormat,enableContext:`!${m.IsInTableSheetDesignMode}`};const Ife=Object.freeze(Object.defineProperty({__proto__:null,CellsFormat:Pfe},Symbol.toStringTag,{value:"Module"}));function Mfe(e,t){let i="Designer."+t;e.commandManager().register(i,sE,void 0,!1,!1,!1,!1)}function kfe(e){oe.runCommand(e,"autofitRows",sE,{})}let sE={canUndo:!0,execute:function(e,t,i){return new Rfe(e,t).execute(e,t,i)}};class Rfe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForRow(a.sheet(),i,function(r,o){a.sheet().autoFitRow(o)})}}let _fe={text:"${res.ribbon.home.autofitRowHeight}",commandName:p.CellsFormatAutoFitRowHeight,enableContext:`(${m.AllowFormatRows} || ${m.AllowResizeRows}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;kfe(i)},init:e=>{Mfe(e.Spread,"autofitRows")}};const Ofe=Object.freeze(Object.defineProperty({__proto__:null,autoFitRowHeight:_fe},Symbol.toStringTag,{value:"Module"}));function Efe(e,t){let i="Designer."+t;e.commandManager().register(i,cE,void 0,!1,!1,!1,!1)}function Nfe(e){oe.runCommand(e,"autofitColumns",cE,{})}let cE={canUndo:!0,execute:function(e,t,i){return new Bfe(e,t).execute(e,t,i)}};class Bfe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForCol(a.sheet(),i,function(r,o){a.sheet().autoFitColumn(o)})}}let Ffe={text:"${res.ribbon.home.autofitColumnWidth}",commandName:p.CellsFormatAutoFitColumnWidth,enableContext:`(${m.AllowFormatColumns} || ${m.AllowResizeColumns}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;Nfe(i)},init:e=>{Efe(e.Spread,"autofitColumns")}};const Gfe=Object.freeze(Object.defineProperty({__proto__:null,autofitColumnWidth:Ffe},Symbol.toStringTag,{value:"Module"})),Vfe=function(){return{templateName:G.ColumnWidthDialogTemplate2,title:s.columnWidthDialog.title,content:[{type:"FlexContainer",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",style:"line-height: 25px",margin:"0 20px 0 0",text:s.columnWidthDialog.columnWidth}],width:"auto"},{type:"Column",children:[{type:"TextEditor",bindingPath:"value"}],width:"120px"}]}]}]}},Hfe=function(){return{templateName:G.DefaultColumnWidthDialogTemplate,title:s.standardWidthDialog.title,content:[{type:"FlexContainer",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",style:"line-height: 25px",margin:"0 20px 0 0",text:s.standardWidthDialog.columnWidth}],width:"auto"},{type:"Column",children:[{type:"TextEditor",bindingPath:"value"}],width:"120px"}]}]}]}},zfe=function(){return{templateName:G.RowHeightDialogTemplate2,title:s.rowHeightDialog.title,content:[{type:"FlexContainer",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",style:"line-height: 25px",margin:"0 20px 0 0",text:s.rowHeightDialog.rowHeight}],width:"auto"},{type:"Column",children:[{type:"TextEditor",bindingPath:"value"}],width:"120px"}]}]}]}},jfe=function(){return{templateName:G.DefaultRowHeightDialogTemplate,title:s.standardHeightDialog.title,content:[{type:"FlexContainer",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",style:"line-height: 25px",margin:"0 20px 0 0",text:s.standardHeightDialog.rowHeight}],width:"auto"},{type:"Column",children:[{type:"TextEditor",bindingPath:"value"}],width:"120px"}]}]}]}};function Wfe(e,t){let i="Designer."+t;e.commandManager().register(i,dE,void 0,!1,!1,!1,!1)}function z0(e,t){oe.runCommand(e,"setRowsHeight",dE,{value:t})}let dE={canUndo:!0,execute:function(e,t,i){return new Zfe(e,t).execute(e,t,i)}};class Zfe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForRow(a.sheet(),i,function(r,o){a.sheet().setRowHeight(o,i.value)})}}function Ufe(e,t){let i="Designer."+t;e.commandManager().register(i,uE,void 0,!1,!1,!1,!1)}function j0(e,t){oe.runCommand(e,"setColumnsWidth",uE,{width:t})}let uE={canUndo:!0,execute:function(e,t,i){return new Jfe(e,t).execute(e,t,i)}};class Jfe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForCol(a.sheet(),i,function(r,o){a.sheet().setColumnWidth(o,i.width)})}}function Yfe(e,t){let i="Designer."+t;e.commandManager().register(i,pE,void 0,!1,!1,!1,!1)}function hE(e,t){oe.runCommand(e,"defaultRowHeight",pE,{value:t})}let pE={canUndo:!0,execute:function(e,t,i){return new qfe(e,t).execute(e,t,i)}};class qfe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForRow(a.sheet(),i,function(r,o){a.sheet().defaults.rowHeight=i.value})}}function Kfe(e,t){let i="Designer."+t;e.commandManager().register(i,mE,void 0,!1,!1,!1,!1)}function Qfe(e,t){oe.runCommand(e,"defaultColumnWidth",mE,{width:t})}let mE={canUndo:!0,execute:function(e,t,i){return new Xfe(e,t).execute(e,t,i)}};class Xfe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForCol(a.sheet(),i,function(r,o){a.sheet().defaults.colWidth=i.width})}}_e(G.ColumnWidthDialogTemplate2,Vfe),_e(G.DefaultColumnWidthDialogTemplate,Hfe),_e(G.RowHeightDialogTemplate2,zfe),_e(G.DefaultRowHeightDialogTemplate,jfe);async function gE(e,t){const i=e.Spread;let n=C.getActiveSheet(i),a={value:t?n.defaults.rowHeight:n.getRowHeight(n.getActiveRowIndex())},r=await e._showDialog(t?G.DefaultRowHeightDialogTemplate:G.RowHeightDialogTemplate2,a,SE);bE(r,hE,z0,t,i)}async function fE(e,t){const i=e.Spread;let n=C.getActiveSheet(i),a={value:t?n.defaults.colWidth:n.getColumnWidth(n.getActiveColumnIndex())},r=await e._showDialog(t?G.DefaultColumnWidthDialogTemplate:G.ColumnWidthDialogTemplate2,a,SE);bE(r,Qfe,j0,t,i)}function bE(e,t,i,n,a){if(e!=null){const r=n?t:i;let o=e.value;typeof o=="number"?r(a,o):r(a,o.match(/^(-?\d+)(\.\d+)?$/)?parseInt(o,10):o)}}function SE(e,t){let i=e.value,n;return typeof i=="number"?!0:(i.match(/^(-?\d+)(\.\d+)?$/)?parseFloat(i)>9999999||parseFloat(i)<0?t==null||t._showMessageBox(s.contextMenu.rowHeightColWidthError,s.title,Re.error):n=i:i.match(/^\d*(\.\d+)?\*$/)?n=i:t==null||t._showMessageBox(s.contextMenu.rowHeightColWidthError,s.title,Re.error),n!==void 0)}let $fe={text:"${res.ribbon.home.columnWidth}",iconClass:"ribbon-control-dropdown-columnwidth",commandName:p.CellsFormatColumnWidth,enableContext:`(${m.AllowFormatColumns} || ${m.AllowResizeColumns}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:async e=>{await fE(e)},init:e=>{Kfe(e.Spread,"defaultColumnWidth")}};const ebe=Object.freeze(Object.defineProperty({__proto__:null,columnWidth:$fe},Symbol.toStringTag,{value:"Module"}));let tbe={text:"${res.ribbon.home.defaultHeight}",commandName:p.CellsFormatDefaultHeight,enableContext:`(${m.AllowFormatRows} || ${m.AllowResizeRows}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:async e=>{await gE(e,!0)},init:e=>{Yfe(e.Spread,"defaultRowHeight")}};const ibe=Object.freeze(Object.defineProperty({__proto__:null,defaultHeight:tbe},Symbol.toStringTag,{value:"Module"}));let nbe={text:"${res.ribbon.home.defaultWidth}",commandName:p.CellsFormatDefaultWidth,enableContext:`(${m.AllowFormatColumns} || ${m.AllowResizeColumns}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:async e=>{await fE(e,!0)}};const abe=Object.freeze(Object.defineProperty({__proto__:null,defaultWidth:nbe},Symbol.toStringTag,{value:"Module"}));function rbe(e,t){let i="Designer."+t;e.commandManager().register(i,yE,void 0,!1,!1,!1,!1)}function CE(e){oe.runCommand(e,"hideColumns",yE,{})}class obe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForCol(a.sheet(),i,function(r,o){a.sheet().setColumnVisible(o,!1)})}}let yE={canUndo:!0,execute:function(e,t,i){return new obe(e,t).execute(e,t,i)}},lbe={text:"${res.ribbon.home.hideColumns}",commandName:p.CellsFormatHideColumns,enableContext:`(${m.AllowFormatRows} || ${m.AllowOutlineRows}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;CE(i)},init:e=>{rbe(e.Spread,"hideColumns")}};const sbe=Object.freeze(Object.defineProperty({__proto__:null,cellsFormatHideColumns:lbe},Symbol.toStringTag,{value:"Module"}));function cbe(e,t){let i="Designer."+t;e.commandManager().register(i,xE,void 0,!1,!1,!1,!1)}function vE(e){oe.runCommand(e,"hideRows",xE,{})}class dbe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForRow(a.sheet(),i,function(r,o){a.sheet().setRowVisible(o,!1)})}}let xE={canUndo:!0,execute:function(e,t,i){return new dbe(e,t).execute(e,t,i)}},ube={text:"${res.ribbon.home.hideRows}",commandName:p.CellsFormatHideRows,enableContext:`(${m.AllowFormatRows} || ${m.AllowOutlineRows}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;vE(i)},init:e=>{cbe(e.Spread,"hideRows")}};const hbe=Object.freeze(Object.defineProperty({__proto__:null,cellsFormatHideRows:ube},Symbol.toStringTag,{value:"Module"}));function pbe(e,t){let i="Designer."+t;e.commandManager().register(i,TE,void 0,!1,!1,!1,!1)}function LE(e,t){oe.runCommand(e,"LockCells",TE,{locked:t})}let TE={canUndo:!0,execute:function(e,t,i){return new mbe(e,t).execute(e,t,i)}};class mbe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this;a.execInSelectionsForSetStyle(a.sheet(),i,function(r,o,l,c,d,u){let h=r.getStyle(o,l);h=a._composeStyleWithRowColumn(r,h,o,l,c,d,u),h&&(h.locked=i.locked,r.setStyle(o,l,h))})}}let gbe={text:"${res.ribbon.home.lockCells}",iconClass:"ribbon-control-dropdown-lockcells",commandName:p.CellsFormatLockCells,visibleContext:`!${m.CellLocked}`,enableContext:`!${m.IsActualProtected} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;LE(i,!0)}};const fbe=Object.freeze(Object.defineProperty({__proto__:null,lockCells:gbe},Symbol.toStringTag,{value:"Module"}));class bbe extends oe.DesignerActionBase{executeImp(t,i,n){let a=C.getSheetOrSheetTabByName(t,i.sheetName),r=i.value,o=r.protectPassword;return delete r.protectPassword,a.options.protectionOptions=r,o?a.protect(o):a.protect(),t.undoManager().clear(),!0}}let wE={canUndo:!1,execute:function(e,t,i){return new bbe(e,t).execute(e,t,i)}};function Sbe(e,t){let i="Designer."+t;e.commandManager().register(i,wE,void 0,!1,!1,!1,!1)}function Cbe(e,t){return oe.runCommand(e,"confirmProtectSheet",wE,{value:t})}const Ma=C.nameof;let ybe=function(){return{templateName:G.ProtectSheetDialogTemplate,title:s.protectionOptionDialog.title,content:[{type:"Column",width:"250px",children:[{type:"TextBlock",text:s.protectionOptionDialog.passwordLabel},{type:"TextEditor",isPassword:!0,bindingPath:Ma("protectPassword"),needFocus:!0,className:"gc-need-focus"},{type:"TextBlock",text:s.protectionOptionDialog.label},{type:"LabelContainer",text:"",margin:"2px 3px 3px 3px",showText:!1,children:[{type:"CheckBox",bindingPath:Ma("allowSelectLockedCells"),text:s.protectionOptionDialog.allowSelectLockedCells},{type:"CheckBox",bindingPath:Ma("allowSelectUnlockedCells"),text:s.protectionOptionDialog.allowSelectUnlockedCells},{type:"CheckBox",bindingPath:Ma("formatCells"),text:s.protectionOptionDialog.allowFormatCells},{type:"CheckBox",bindingPath:Ma("allowSort"),text:s.protectionOptionDialog.allowSort},{type:"CheckBox",bindingPath:Ma("allowFilter"),text:s.protectionOptionDialog.allowFilter},{type:"CheckBox",bindingPath:Ma("allowResizeRows"),text:s.protectionOptionDialog.allowResizeRows},{type:"CheckBox",bindingPath:Ma("allowResizeColumns"),text:s.protectionOptionDialog.allowResizeColumns},{type:"CheckBox",bindingPath:Ma("allowUsePivotTable"),text:s.protectionOptionDialog.allowUsePivotTable},{type:"CheckBox",bindingPath:Ma("allowEditObjects"),text:s.protectionOptionDialog.allowEditObjects},{type:"CheckBox",bindingPath:Ma("allowDragInsertRows"),text:s.protectionOptionDialog.allowDragInsertRows},{type:"CheckBox",bindingPath:Ma("allowDragInsertColumns"),text:s.protectionOptionDialog.allowDragInsertColumns},{type:"CheckBox",bindingPath:Ma("allowInsertRows"),text:s.protectionOptionDialog.allowInsertRows},{type:"CheckBox",bindingPath:Ma("allowInsertColumns"),text:s.protectionOptionDialog.allowInsertColumns},{type:"CheckBox",bindingPath:Ma("allowDeleteRows"),text:s.protectionOptionDialog.allowDeleteRows},{type:"CheckBox",bindingPath:Ma("allowDeleteColumns"),text:s.protectionOptionDialog.allowDeleteColumns},{type:"CheckBox",bindingPath:Ma("formatRows"),text:s.protectionOptionDialog.allowFormatRows},{type:"CheckBox",bindingPath:Ma("formatColumns"),text:s.protectionOptionDialog.allowFormatColumns}]}]}]}},vbe=function(){return{templateName:G.ConfirmPasswordDialogTemplate,title:s.confirmPasswordDialog.title,content:[{type:"Column",width:"300px",children:[{type:"TextBlock",text:s.confirmPasswordDialog.passwordLabel},{type:"TextEditor",isPassword:!0,bindingPath:"confirmedPassword",needFocus:!0},{type:"TextBlock",text:s.confirmPasswordDialog.passwordTips}]}]}};const xbe=["allowSort","allowFilter","allowEditObjects","allowResizeRows","allowResizeColumns","allowDragInsertRows","allowDragInsertColumns","allowInsertRows","allowInsertColumns","allowDeleteRows","allowDeleteColumns","formatCells","formatColumns","formatRows","allowOutlineColumns","allowOutlineRows","allowUsePivotTable"];_e(G.ProtectSheetDialogTemplate,ybe),_e(G.ConfirmPasswordDialogTemplate,vbe);async function DE(e,t){let i=e.Spread,r=C.getActiveSheet(i).options.protectionOptions,o=AE(r);o.allowSelectLockedCells===void 0&&(o.allowSelectLockedCells=!0),o.allowSelectUnlockedCells===void 0&&(o.allowSelectUnlockedCells=!0);let l=AE(o),c=await e._showDialog(G.ProtectSheetDialogTemplate,o,async d=>{if(d&&d.protectPassword){let u=await e._showDialog(G.ConfirmPasswordDialogTemplate,{});if(u&&u.confirmedPassword){if(u.confirmedPassword===d.protectPassword)return!0;e._showMessageBox(s.confirmPasswordDialog.errorMessage,s.title,Re.warning)}return!1}return!0});if(!C.isNullOrUndefined(c)){for(let d in c)d&&!C.isNullOrUndefined(c[d])&&xbe.indexOf(d)>-1&&c[d]===!1&&!l.hasOwnProperty(d)&&delete c[d];c.formatRows?c.allowOutlineRows=!0:c.allowOutlineRows=!1,c.formatColumns?c.allowOutlineColumns=!0:c.allowOutlineColumns=!1,Cbe(e.Spread,c),Eo(e),l2(e)}}function AE(e){let t={};for(let i in e)i&&(t[i]=e[i]);return t}let Lbe={text:"${res.ribbon.home.protectSheet}",iconClass:"ribbon-control-dropdown-protectsheet",commandName:p.CellsFormatProtectSheet,visibleContext:`!${m.IsProtected}`,execute:DE};const Tbe=Object.freeze(Object.defineProperty({__proto__:null,protectSheet:Lbe},Symbol.toStringTag,{value:"Module"}));let wbe={text:"${res.ribbon.home.rowHeight}",iconClass:"ribbon-control-dropdown-rowheight",commandName:p.CellsFormatRowHeight,enableContext:`(${m.AllowFormatRows} || ${m.AllowResizeRows}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:async e=>{await gE(e)}};const Dbe=Object.freeze(Object.defineProperty({__proto__:null,rowHeight:wbe},Symbol.toStringTag,{value:"Module"}));function Abe(e,t){let i="Designer."+t;e.commandManager().register(i,PE,void 0,!1,!1,!1,!1)}let PE={canUndo:!0,execute:function(e,t,i){return new Pbe(e,t).execute(e,t,i)}};function IE(e){oe.runCommand(e,"unHideColumns",PE,{})}class Pbe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this,r=C.getActiveSheet(t),o=r.getSelections();if(o.length===1&&o[0].colCount===1){let l=o[0],c=0;for(let d=0;d<=l.col;d++)if(r.getColumnVisible(d)){c=d;break}(l.col===c||c!==0)&&(r.setColumnVisible(c-1,!0),r.showColumn(c-1,GC.Spread.Sheets.HorizontalPosition.nearest))}else a.execInSelectionsForCol(r,i,function(l,c){l.setColumnVisible(c,!0)})}}let Ibe={text:"${res.ribbon.home.unHideColumns}",commandName:p.CellsFormatUnhideColumns,enableContext:`(${m.AllowFormatRows} || ${m.AllowOutlineRows}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;IE(i)},init:e=>{Abe(e.Spread,"unHideColumns")}};const Mbe=Object.freeze(Object.defineProperty({__proto__:null,cellsFormatUnHideColumns:Ibe},Symbol.toStringTag,{value:"Module"}));function kbe(e,t){let i="Designer."+t;e.commandManager().register(i,ME,void 0,!1,!1,!1,!1)}let ME={canUndo:!0,execute:function(e,t,i){return new Rbe(e,t).execute(e,t,i)}};function kE(e){oe.runCommand(e,"unHideRows",ME,{})}class Rbe extends oe.DesignerActionBase{executeImp(t,i,n){let a=this,r=C.getActiveSheet(t),o=r.getSelections();if(o.length===1&&o[0].rowCount===1){let l=o[0],c=0;for(let d=0;d<=l.row;d++)if(r.getRowVisible(d)){c=d;break}(l.row===c||c!==0)&&(r.setRowVisible(c-1,!0),r.showRow(c-1,GC.Spread.Sheets.VerticalPosition.nearest))}else a.execInSelectionsForRow(r,i,_be)}}function _be(e,t){e.setRowVisible(t,!0)}let Obe={text:"${res.ribbon.home.unHideRows}",commandName:p.CellsFormatUnhideRows,enableContext:`(${m.AllowFormatRows} || ${m.AllowOutlineRows}) && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;kE(i)},init:e=>{kbe(e.Spread,"unHideRows")}};const Ebe=Object.freeze(Object.defineProperty({__proto__:null,cellsFormatUnHideRows:Obe},Symbol.toStringTag,{value:"Module"}));let Nbe={text:"${res.ribbon.home.unLockCells}",iconClass:"ribbon-control-dropdown-unlockcells",commandName:p.CellsFormatUnLockCells,visibleContext:`${m.CellLocked}`,enableContext:`!${m.IsActualProtected} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:(e,t)=>{let i=e.Spread;LE(i,!1)}};const Bbe=Object.freeze(Object.defineProperty({__proto__:null,unLockCells:Nbe},Symbol.toStringTag,{value:"Module"}));let Fbe={title:"${res.contextMenu.headers}",text:"${res.contextMenu.headers}",commandName:p.Headers,enableContext:`!${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`,execute:async function(e,t){var i,n;(n=(i=EA(p.RowHeaders))==null?void 0:i.execute)==null||n.call(i,e)}};const Gbe=Object.freeze(Object.defineProperty({__proto__:null,HEADERS:Fbe},Symbol.toStringTag,{value:"Module"}));class Vbe extends oe.DesignerActionBase{executeImp(t,i,n){return C.getActiveSheet(t).unprotect(i.value)}}let RE={canUndo:!1,execute:function(e,t,i){return new Vbe(e,t).execute(e,t,i)}};function Hbe(e,t){let i="Designer."+t;e.commandManager().register(i,RE,void 0,!1,!1,!1,!1)}function _E(e,t){return oe.runCommand(e,"unprotectSheet",RE,{value:t})}let zbe=function(){return{templateName:G.UnprotectSheetDialogTemplate,title:s.unprotectSheetDialog.title,content:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",text:s.unprotectSheetDialog.passwordLable,style:"height: 24px; line-height:24px"}]},{type:"Column",children:[{type:"TextEditor",isPassword:!0,bindingPath:"password",style:"height: 24px",margin:"0 0 0 10px",needFocus:!0}]}]}]}};_e(G.UnprotectSheetDialogTemplate,zbe);async function OE(e,t){let i=e.Spread,n=C.getActiveSheet(i);if(n.options.isProtected){if(n.hasPassword()){let a=await e._showDialog(G.UnprotectSheetDialogTemplate,{});if(!a)return;_E(i,a.password)||e._showMessageBox(s.unprotectSheetDialog.passwordNotCorrect,s.title,Re.warning)}else _E(i);Eo(e),l2(e)}}let jbe={text:"${res.ribbon.home.unProtectSheet}",iconClass:"ribbon-control-dropdown-unprotectsheet",commandName:p.CellsFormatUnprotectSheet,visibleContext:`${m.IsProtected}`,execute:OE};const Wbe=Object.freeze(Object.defineProperty({__proto__:null,unProtectSheet:jbe},Symbol.toStringTag,{value:"Module"}));let Zbe={text:"${res.ribbon.home.cellType}",iconClass:"ribbon-button-celltype",commandName:p.CellType,bigButton:"=IF(inDropdown, true, ribbonHeight>toolbarHeight)",enableContext:`${m.AllowFormatCells} && !${m.PivotTableSelected} && !${m.IsInTableSheetDesignMode}`};const Ube=Object.freeze(Object.defineProperty({__proto__:null,CellType:Zbe},Symbol.toStringTag,{value:"Module"}));let Jbe={text:"${res.ribbon.home.cellDropdowns}",iconClass:"ribbon-button-celldropdown",bigButton:"=IF(inDropdown, true, ribbonHeight>toolbarHeight)",commandName:p.CellDropdowns,enableContext:`${m.AllowFormatCells} && !${m.PivotTableSelected} && !${m.IsInTableSheetDesignMode}`};const Ybe=Object.freeze(Object.defineProperty({__proto__:null,CellDropdown:Jbe},Symbol.toStringTag,{value:"Module"}));let qbe={title:"${res.ribbon.home.cellEditors}",text:"${res.ribbon.home.cellEditors}",iconClass:"ribbon-button-celltype",commandName:p.CellEditors,bigButton:"=ribbonHeight>toolbarHeight",direction:'=IF(ribbonHeight<toolbarHeight,"horizontal","vertical")',enableContext:`${m.AllowFormatCells} && !${m.PivotTableSelected} && !${m.IsInTableSheetDesignMode} && !${m.ChartSelected} && !${m.ShapeSelected} && !${m.FloatingObjectSelected} && !${m.pictureSelected} && !${m.SlicerSelected} && !${m.SelectedOrEditComments}`};const Kbe=Object.freeze(Object.defineProperty({__proto__:null,CellEditors:qbe},Symbol.toStringTag,{value:"Module"}));function Ss(e,t){let i=$s(e.Spread);return i.dialogOption={activeTab:dt.CellButton},i.cellButtonTabOption=i.cellButtonTabOption||{},i.cellButtonTabOption.initCellButton=t,i}let Qbe={text:"${res.ribbon.home.calculatorCellType}",iconClass:"ribbon-button-calcualtor-dropdown",commandName:p.CalculatorCellType,execute:async(e,t)=>{let i=Ss(e,"openCalculator"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const Xbe=Object.freeze(Object.defineProperty({__proto__:null,calculatorCellType:Qbe},Symbol.toStringTag,{value:"Module"}));function $be(e,t){return t.tables.all().filter(n=>n.range().intersect(e.row,e.col,e.rowCount,e.colCount))}function lS(e,t,i){$be(e,t).forEach(a=>{const r=a.range();if(e.row<=r.row&&e.col<=r.col&&e.row+e.rowCount>=r.row+r.rowCount&&e.col+e.colCount>=r.col+r.colCount){const{header:o,footer:l,data:c}=a.layoutStyle(),d=i(o),u=i(l),h=i(c);a.layoutStyle({header:d,footer:u,data:h});for(let g=0;g<r.colCount;g++){const f=a.columnLayoutStyle(g),b=f.header,S=f.footer,y=f.data,v=i(b),x=i(S),L=i(y);a.columnLayoutStyle(g,{header:v,footer:x,data:L})}}else{const o=r;if(a.showHeader()){if(o.row=r.row+1,o.rowCount=r.rowCount-1,e.row<=r.row&&e.col<=r.col&&e.row+e.rowCount>r.row&&e.col+e.colCount>=r.col+r.colCount){const d=a.layoutStyle(),u=i(d.header);d.header=u,a.layoutStyle(d)}const c=new GC.Spread.Sheets.Range(r.row,r.col,1,o.colCount).getIntersect(e,t.getRowCount(),t.getColumnCount());if(c)for(let d=0;d<c.colCount;d++){const u=c.col-r.col+d,h=a.columnLayoutStyle(u),g=i(h.header);h.header=g,a.columnLayoutStyle(u,h)}}if(a.showFooter()){if(o.rowCount=r.rowCount-1,e.row<r.row+r.rowCount&&e.row+e.rowCount>=r.row+r.rowCount&&e.col<=r.col&&e.col+e.colCount>=r.col+r.colCount){const d=a.layoutStyle(),u=i(d.footer);d.footer=u,a.layoutStyle(d)}const c=new GC.Spread.Sheets.Range(r.row+r.rowCount-1,r.col,1,o.colCount).getIntersect(e,t.getRowCount(),t.getColumnCount());if(c)for(let d=0;d<c.colCount;d++){const u=c.col-r.col+d,h=a.columnLayoutStyle(u),g=i(h.footer);h.footer=g,a.columnLayoutStyle(u,h)}}if(e.row<=o.row&&e.col<=o.col&&e.row+e.rowCount>=o.row+o.rowCount&&e.col+e.colCount>=o.col+o.colCount){const c=a.layoutStyle(),d=i(c.data);c.data=d,a.layoutStyle(c)}const l=o.getIntersect(e,t.getRowCount(),t.getColumnCount());for(let c=0;c<l.colCount;c++){const d=l.col-r.col+c,u=a.columnLayoutStyle(d),h=i(u.data);u.data=h,a.columnLayoutStyle(d,u)}}})}function eSe(e,t){let i="Designer."+t;e.commandManager().register(i,EE,void 0,!1,!1,!1,!1)}function tSe(e){oe.runCommand(e,"clearCellDropDown",EE,{})}function W0(e){return e.cellButtons=[],e.decoration&&e.decoration.icons&&delete e.decoration.icons,e}class iSe extends oe.DesignerActionBase{executeImp(t,i,n){const a=this,r=a.sheet();a.execInSelectionsForSetStyle(r,i,function(l,c,d,u,h,g){let f=l.getStyle(c,d);f=a._composeStyleWithRowColumn(l,f,c,d,u,h,g),f&&(f=W0(f),l.setStyle(c,d,f))});const o=r.getSelections();for(let l=0;l<o.length;l++){const c=o[l];lS(c,r,d=>{if(d){if(typeof d=="string"){let u=r.getNamedStyle(d);return u?W0(u):void 0}return W0(d)}})}}}let EE={canUndo:!0,execute:function(e,t,i){return new iSe(e,t).execute(e,t,i)}},nSe={text:"${res.ribbon.home.clearCellDropDown}",iconClass:"ribbon-button-clear-celltype",commandName:p.ClearCellDropdown,execute:(e,t,i)=>{tSe(e.Spread)},init:e=>{eSe(e.Spread,"clearCellDropDown")}};const aSe=Object.freeze(Object.defineProperty({__proto__:null,clearDropDown:nSe},Symbol.toStringTag,{value:"Module"}));let rSe={text:"${res.ribbon.home.colorPickerCellType}",iconClass:"ribbon-button-colprpicker-dropdown",commandName:p.ColorPickerCellType,execute:async(e,t)=>{let i=Ss(e,"openColorPicker"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const oSe=Object.freeze(Object.defineProperty({__proto__:null,colorPickerCellType:rSe},Symbol.toStringTag,{value:"Module"}));let lSe={text:"${res.ribbon.home.dateTimePickerCellType}",iconClass:"ribbon-button-datetimepicker-dropdown",commandName:p.DateTimePickerCellType,execute:async(e,t)=>{let i=Ss(e,"openDateTimePicker"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const sSe=Object.freeze(Object.defineProperty({__proto__:null,dateTimePickerCellType:lSe},Symbol.toStringTag,{value:"Module"}));let cSe={text:"${res.ribbon.home.listCellType}",iconClass:"ribbon-button-list-dropdown",commandName:p.ListCellType,execute:async(e,t)=>{let i=Ss(e,"openList"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const dSe=Object.freeze(Object.defineProperty({__proto__:null,listCellType:cSe},Symbol.toStringTag,{value:"Module"}));let uSe={text:"${res.dropdownDialog.monthpicker.title}",iconClass:"ribbon-button-monthpicker-dropdown",commandName:p.MonthPickerCellType,execute:async(e,t)=>{let i=Ss(e,"openMonthPicker"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const hSe=Object.freeze(Object.defineProperty({__proto__:null,monthpickerCellType:uSe},Symbol.toStringTag,{value:"Module"}));let pSe={text:"${res.ribbon.home.sliderCellType}",iconClass:"ribbon-button-slider-dropdown",commandName:p.SliderCellType,execute:async(e,t)=>{let i=Ss(e,"openSlider"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const mSe=Object.freeze(Object.defineProperty({__proto__:null,sliderCellType:pSe},Symbol.toStringTag,{value:"Module"}));let gSe={text:"${res.dropdownDialog.timepicker.title}",iconClass:"ribbon-button-timepicker-dropdown",commandName:p.TimePickerCellType,execute:async(e,t)=>{let i=Ss(e,"openTimePicker"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,a)}}};const fSe=Object.freeze(Object.defineProperty({__proto__:null,timepickerCellType:gSe},Symbol.toStringTag,{value:"Module"}));let bSe={text:"${res.ribbon.home.workflowlistCellType}",iconClass:"ribbon-button-workflow-dropdown",commandName:p.WorkflowList,execute:async(e,t)=>{let i=Ss(e,"openWorkflowList"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const SSe=Object.freeze(Object.defineProperty({__proto__:null,workflowlistCellType:bSe},Symbol.toStringTag,{value:"Module"}));let CSe={text:"${res.ribbon.home.mulitColumnListCellType}",iconClass:"ribbon-button-multiColumn-dropdown",commandName:p.MultiColumnPicker,execute:async(e,t)=>{let i=Ss(e,"openMultiColumn"),n=await e._showDialog(G.FormatDialogTemplate,Ke(i));if(n){let a=Cn(i,n);jo(e.Spread,a,n)}}};const ySe=Object.freeze(Object.defineProperty({__proto__:null,multiColumnPickerCellType:CSe},Symbol.toStringTag,{value:"Module"}));function vSe(){return{type:"FlexContainer",className:"gc-itemsProperties_container",children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"LabelContainer",className:"gc_list_item",text:s.checkListCellTypeDialog.items,children:[{type:"List",editorLabel:s.checkListCellTypeDialog.items,id:"c_list",items:[],className:"gc_list_container"}]}],width:"stretch"},{type:"Column",children:[{type:"LabelContainer",className:"gc_list_itemProperties",text:s.checkListCellTypeDialog.itemProperties,children:[{type:"ColumnSet",children:[{type:"Column",children:[{type:"TextBlock",text:s.checkListCellTypeDialog.text}],width:"55px"},{type:"Column",children:[{type:"TextEditor",id:"c_itemproperties_text",fireEventOnInput:!0,editorLabel:s.checkListCellTypeDialog.text}]}]},{type:"ColumnSet",id:"c_columnset_value",children:[{type:"Column",children:[{type:"TextBlock",text:s.checkListCellTypeDialog.value}],width:"55px"},{type:"Column",children:[{type:"TextEditor",id:"c_itemproperties_value",fireEventOnInput:!0,editorLabel:s.checkListCellTypeDialog.value}]}]}]}],width:"stretch"}]},{type:"ColumnSet",className:"gc_buttons",children:[{type:"Column",children:[{type:"Button",className:"gc_add_button",id:"c_add",text:s.checkListCellTypeDialog.add,width:65}]},{type:"Column",children:[{type:"Button",className:"gc_remove_button",id:"c_remove",text:s.checkListCellTypeDialog.remove,width:65}]}]}]}}var xSe=Object.getOwnPropertyDescriptor,LSe=(e,t,i,n)=>{for(var a=n>1?void 0:n?xSe(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(a=o(a)||a);return a};const TSe=`
|
|
375
375
|
<input type="text" class="gc-text-editor" aria-label=" " />
|
|
376
376
|
`,wSe=`
|
|
377
377
|
<textarea class="gc-textarea-editor" />
|