diff --git a/index.html b/index.html index 973256d..d533706 100644 --- a/index.html +++ b/index.html @@ -7,6 +7,13 @@ + + + + + + +
{l==="rightbottom"?O.value.row_index+=L+1:l==="lefttop"&&(O.value.row_index+=L)}),d.borderInfo.push(...z)}l=="lefttop"?n==0?new Function("d","return d.unshift("+E.join(",")+")")(u):new Function("d","return d.splice("+n+", 0, "+E.join(",")+")")(u):new Function("d","return d.splice("+(n+1)+", 0, "+E.join(",")+")")(u)}else{if(I="c",d.columnlen!=null){let L={};for(let O in d.columnlen)O=parseFloat(O),O0){let L=[];for(let O=0;O =ee&&W.push({row:q[Y].row,column:[ee,te]})}if(W.length>0){let Y={rangeType:"range",borderType:d.borderInfo[O].borderType,style:d.borderInfo[O].style,color:d.borderInfo[O].color,range:W};L.push(Y)}}else if(V=="cell"){let q=d.borderInfo[O].value.col_index;q===n&&F.push(JSON.parse(JSON.stringify(d.borderInfo[O]))),l=="lefttop"?n<=q&&(q+=t):n {l==="rightbottom"?V.value.col_index+=L+1:l==="lefttop"&&(V.value.col_index+=L)}),d.borderInfo.push(...z)}for(let L=0;L0?$("#luckysheet-scrollbar-y").scrollTop(V-L+20):q-E-20<0&&$("#luckysheet-scrollbar-y").scrollTop(q-20),t>30&&($("#luckysheet-row-count-show").hide(),$("#luckysheet-column-count-show").hide())}}function _o(e,n){let t=we.deepCopyFlowData(h.flowdata),l=$.extend(!0,{},h.config);l.merge==null&&(l.merge={});let a=t[0].length,o=Vt([],e,a);t=t.concat(o);for(let s=0;s s.length-1&&(n=s.length-1),t>s.length-1&&(t=s.length-1)):(n>s[0].length-1&&(n=s[0].length-1),t>s[0].length-1&&(t=s[0].length-1)),n>t)return;let u=t-n+1,d=$.extend(!0,{},o.config);d.merge==null&&(d.merge={});let f={};for(let F in d.merge){let z=d.merge[F],M=z.r,N=z.c,E=z.rs,L=z.cs;e=="row"?M =n&&M+E-1 =t&&(f[M+"_"+N]={r:M,c:N,rs:E-u,cs:L}):M>=n&&M<=t?M+E-1>t&&(f[n+"_"+N]={r:n,c:N,rs:M+E-1-t,cs:L}):M>t&&(f[M-u+"_"+N]={r:M-u,c:N,rs:E,cs:L}):e=="column"&&(N =n&&N+L-1 =t&&(f[M+"_"+N]={r:M,c:N,rs:E,cs:L-u}):N>=n&&N<=t?N+L-1>t&&(f[M+"_"+n]={r:M,c:n,rs:E,cs:N+L-1-t}):N>t&&(f[M+"_"+(N-u)]={r:M,c:N-u,rs:E,cs:L}))}d.merge=f;let m=o.calcChain,g=[];if(m!=null&&m.length>0)for(let F=0;F t){let O="="+p.functionStrChange(L,"del","row",null,n,u);s[M][N]&&s[M][N].f==L&&(s[M][N].f=O),M>t&&(z.r=M-u),g.push(z)}}else if(e=="column"&&(N t)){let O="="+p.functionStrChange(L,"del","col",null,n,u);s[M][N]&&s[M][N].f==L&&(s[M][N].f=O),N>t&&(z.c=N-u),g.push(z)}}}let y=o.filter_select,v=o.filter,k=null;if(y!=null&&JSON.stringify(y)!="{}"){k={filter_select:null,filter:null};let F=y.row[0],z=y.row[1],M=y.column[0],N=y.column[1];if(e=="row"){if(F>t?(F-=u,z-=u,k.filter_select={row:[F,z],column:[M,N]}):F t&&(O[V-u]=0);JSON.stringify(O)!="{}"&&(k.filter==null&&(k.filter={}),k.filter[E]=$.extend(!0,{},v[E]),k.filter[E].rowhidden=O,k.filter[E].str=F,k.filter[E].edr=z)}}else if(e=="column"&&(M>t?(M-=u,N-=u,k.filter_select={row:[F,z],column:[M,N]}):M t&&(M=n,N-=u,k.filter_select={row:[F,z],column:[M,N]}),k.filter_select!=null&&v!=null))for(let E in v){let L=v[E].cindex;L t&&(L-=u,k.filter==null&&(k.filter={}),k.filter[L-M]=$.extend(!0,{},v[E]),k.filter[L-M].cindex=L,k.filter[L-M].stc=M,k.filter[L-M].edc=N)}}if(k!=null&&k.filter!=null){d.rowhidden==null&&(d.rowhidden={});for(let F in k.filter){let z=k.filter[F].rowhidden;for(let M in z)d.rowhidden[M]=0}}let b=o.luckysheet_conditionformat_save,w=[];if(b!=null&&b.length>0)for(let F=0;F =n&&L<=t||(E>t?(E-=u,L-=u):E t&&(E=n,L-=u),M.push({row:[E,L],column:[O,V]})):e=="column"&&(O>=n&&V<=t||(O>t?(O-=u,V-=u):O t&&(O=n,V-=u),M.push({row:[E,L],column:[O,V]})))}if(M.length>0){let N=$.extend(!0,{},b[F]);N.cellrange=M,w.push(N)}}let x=o.luckysheet_alternateformat_save,C=[];if(x!=null&&x.length>0)for(let F=0;F =n&&M<=t)){let L=$.extend(!0,{},x[F]);z>t?(z-=u,M-=u):z t&&(z=n,M-=u),L.cellrange={row:[z,M],column:[N,E]},C.push(L)}}else if(e=="column"&&!(N>=n&&E<=t)){let L=$.extend(!0,{},x[F]);N>t?(N-=u,E-=u):N t&&(N=n,E-=u),L.cellrange={row:[z,M],column:[N,E]},C.push(L)}}let S={freezenhorizontaldata:null,freezenverticaldata:null};if(X.freezenhorizontaldata!=null&&e=="row"){let F=X.freezenhorizontaldata[2],z=st(h.visibledatarow,F);z==-1&&(z=0);let M=X.freezenhorizontaldata[1]-1;M>=n&&(M =n&&(M t&&(T[z-u+"_"+M]=N):e=="column"&&(M t&&(T[z+"_"+(M-u)]=N))}let A=o.hyperlink,R={};if(A!=null)for(let F in A){let z=Number(F.split("_")[0]),M=Number(F.split("_")[1]),N=A[F];e=="row"?z t&&(R[z-u+"_"+M]=N):e=="column"&&(M t&&(R[z+"_"+(M-u)]=N))}let I;if(e=="row"){I="r",d.rowlen==null&&(d.rowlen={});let F={};for(let M in d.rowlen)M t&&(F[M-u]=d.rowlen[M]);d.rowlen=F,d.rowhidden==null&&(d.rowhidden={});let z={};for(let M in d.rowhidden)M t&&(z[M-u]=d.rowhidden[M]);if(d.rowhidden=z,d.borderInfo&&d.borderInfo.length>0){let M=[];for(let N=0;N =q&&O.push({row:[q,W],column:L[V].column})}if(O.length>0){let V={rangeType:"range",borderType:d.borderInfo[N].borderType,style:d.borderInfo[N].style,color:d.borderInfo[N].color,range:O};M.push(V)}}else if(E=="cell"){let L=d.borderInfo[N].value.row_index;L t&&(d.borderInfo[N].value.row_index=L-(t-n+1),M.push(d.borderInfo[N]))}}d.borderInfo=M}s.splice(n,u)}else{I="c",d.columnlen==null&&(d.columnlen={});let F={};for(let M in d.columnlen)M t&&(F[M-u]=d.columnlen[M]);d.columnlen=F,d.colhidden==null&&(d.colhidden={});let z={};for(let M in d.colhidden)M t&&(z[M-u]=d.colhidden[M]);if(d.colhidden=z,d.borderInfo&&d.borderInfo.length>0){let M=[];for(let N=0;N =q&&O.push({row:L[V].row,column:[q,W]})}if(O.length>0){let V={rangeType:"range",borderType:d.borderInfo[N].borderType,style:d.borderInfo[N].style,color:d.borderInfo[N].color,range:O};M.push(V)}}else if(E=="cell"){let L=d.borderInfo[N].value.col_index;L t&&(d.borderInfo[N].value.col_index=L-(t-n+1),M.push(d.borderInfo[N]))}}d.borderInfo=M}for(let M=0;M M+E-1||t N+L-1)y[M+"_"+N]={r:M,c:N,rs:E,cs:L};else if(n<=M&&t>=M+E-1&&a N+L-1||a M+E-1)y[M+"_"+N]={r:M,c:N,rs:E,cs:L};else if(l<=N&&a>=N+L-1&&t 0)for(let F=0;F t||N a)){let O;e=="moveLeft"?(O="="+p.functionStrChange(L,"del","col",null,l,m),N>a&&M>=n&&M<=t&&(z.c=N-m)):e=="moveUp"&&(O="="+p.functionStrChange(L,"del","row",null,n,f),M>t&&N>=l&&N<=a&&(z.r=M-f)),d[M][N]&&d[M][N].f==L&&(d[M][N].f=O),k.push(z)}}let b=u.filter_select,w=u.filter,x=null;if(b!=null&&JSON.stringify(b)!="{}"){x={filter_select:null,filter:null};let F=b.row[0],z=b.row[1],M=b.column[0],N=b.column[1];if(e=="moveUp")if(M>=l&&N<=a){if(F>t?x.filter_select={row:[F-f,z-f],column:[M,N]}:z t?x.filter_select={row:[F,z-f],column:[M,N]}:x.filter_select={row:[F,n-1],column:[M,N]}),x.filter_select!=null&&w!=null)for(let E in w){let L=w[E].rowhidden,O={};for(let V in L)V t&&(O[V-slen]=0);x.filter==null&&(x.filter={}),x.filter[E]=$.extend(!0,{},w[E]),JSON.stringify(O)!="{}"&&(x.filter[E].rowhidden=O),x.filter[E].str=x.filter_select.row[0],x.filter[E].edr=x.filter_select.row[1]}}else if(F>=n&&z<=t){if(M>a?x.filter_select={row:[F,z],column:[M,N]}:M>=l?N>a&&(x.filter_select={row:[F,z],column:[l,N-m]}):N a){x.filter==null&&(x.filter={}),V>a&&(V-=m);let q=V-L;x.filter[q]=$.extend(!0,{},w[E]),x.filter[q].cindex=V,x.filter[q].stc=L,x.filter[q].edc=O}}}else x.filter_select={row:[F,z],column:[M,N]},w!=null&&(x.filter=w);else if(e=="moveLeft")if(F>=n&&z<=t){if(M>a?x.filter_select={row:[F,z],column:[M-m,N-m]}:N a?x.filter_select={row:[F,z],column:[M,N-m]}:x.filter_select={row:[F,z],column:[M,l-1]}),x.filter_select!=null&&w!=null)for(let E in w){let L=x.filter_select.column[0],O=x.filter_select.column[1],V=w[E].cindex;if(V a){x.filter==null&&(x.filter={}),V>a&&(V-=m);let q=V-L;x.filter[q]=$.extend(!0,{},w[E]),x.filter[q].cindex=V,x.filter[q].stc=L,x.filter[q].edc=O}}}else M>=l&&N<=a?(F t)&&(x.filter_select={row:[F,z],column:[M,N]},w!=null&&(x.filter=w)):(x.filter_select={row:[F,z],column:[M,N]},w!=null&&(x.filter=w))}if(x!=null&&x.filter!=null){g.rowhidden==null&&(g.rowhidden={});for(let F in x.filter){let z=x.filter[F].rowhidden;for(let M in z)g.rowhidden[M]=0}}let C=u.luckysheet_conditionformat_save,S=[];if(C!=null&&C.length>0)for(let F=0;F =L&&l<=O&&a>=V||(M=rf(e,n,t,l,a,E,L,O,V,f,m))}if(M.length>0){let N=$.extend(!0,{},C[F]);N.cellrange=M,S.push(N)}}let _=u.dataVerification,T={};if(_!=null)for(let F in _){let z=Number(F.split("_")[0]),M=Number(F.split("_")[1]),N=_[F];(z t||M a)&&(e=="moveLeft"?M>a&&z>=n&&z<=t?T[z+"_"+(M-m)]=N:T[z+"_"+M]=N:e=="moveUp"&&(z>t&&M>=l&&M<=a?T[z-f+"_"+M]=N:T[z+"_"+M]=N))}let A=u.hyperlink,R={};if(A!=null)for(let F in A){let z=Number(F.split("_")[0]),M=Number(F.split("_")[1]),N=A[F];(z t||M a)&&(e=="moveLeft"?M>a&&z>=n&&z<=t?R[z+"_"+(M-m)]=N:R[z+"_"+M]=N:e=="moveUp"&&(z>t&&M>=l&&M<=a?R[z-f+"_"+M]=N:R[z+"_"+M]=N))}if(g.borderInfo&&g.borderInfo.length>0){let F=[];for(let z=0;z =V&&l<=q&&a>=W||(E=rf(e,n,t,l,a,O,V,q,W,f,m))}if(E.length>0){let L={rangeType:"range",borderType:g.borderInfo[z].borderType,style:g.borderInfo[z].style,color:g.borderInfo[z].color,range:E};F.push(L)}}else if(M=="cell"){let N=g.borderInfo[z].value.row_index,E=g.borderInfo[z].value.col_index;(N t||E a)&&(e=="moveLeft"?E>a&&N>=n&&N<=t&&(E-=m,g.borderInfo[z].value.col_index=E):e=="moveUp"&&N>t&&E>=l&&E<=a&&(N-=f,g.borderInfo[z].value.row_index=N),F.push(g.borderInfo[z]))}}g.borderInfo=F}let I=[];for(let F=l;F<=a;F++)I.push(null);if(e=="moveUp"){let F=[];for(let M=n;M<=d.length-1;M++){let N=[];for(let E=l;E<=a;E++)N.push(d[M][E]);F.push(N)}F.splice(0,f);let z=[];for(let M=n;M<=t;M++)z.push(I);F=F.concat(z);for(let M=n;M<=d.length-1;M++)for(let N=l;N<=a;N++)d[M][N]=F[M-n][N-l]}else if(e=="moveLeft")for(let F=n;F<=t;F++)d[F].splice(l,m),d[F]=d[F].concat(I);u.index==h.currentSheetIndex?Mi(d,g,{type:e,str:n,edr:t,stc:l,edc:a},k,x,S,T,R):(u.data=d,u.config=g,u.calcChain=k,u.filter=x.filter,u.filter_select=x.filter_select,u.luckysheet_conditionformat_save=S,u.dataVerification=T,u.hyperlink=R)}function rf(e,n,t,l,a,o,s,u,d,f,m){let g=[];if(e=="moveLeft"){if(n>s||t d)g.push({row:[o,s],column:[u,d]});else if(a=s)g.push({row:[o,s],column:[u-m,d-m]});else if(n>o&&t o){let y=[{row:[o,n-1],column:[u,d]},{row:[n,s],column:[u-m,d-m]}];g=g.concat(y)}else if(t=u){if(l<=u&&a>=d){if(n>o&&to){let y=[{row:[o,n-1],column:[u,d]}];g=g.concat(y)}else if(tu&&a=s)g.push({row:[o,s],column:[u,d-m]});else if(n>o&&t o){let y=[{row:[o,n-1],column:[u,d]},{row:[n,s],column:[u,d-m]}];g=g.concat(y)}else if(tu){if(n<=o&&t>=s)g.push({row:[o,s],column:[u,l-1]});else if(n>o&&to){let y=[{row:[o,n-1],column:[u,d]},{row:[n,s],column:[u,l-1]}];g=g.concat(y)}else if(t=s)g.push({row:[o,s],column:[u-m,d-m]});else if(n>o&&to){let y=[{row:[o,n-1],column:[u,d]},{row:[n,s],column:[u-m,d-m]}];g=g.concat(y)}else if(td||as)g.push({row:[o,s],column:[u,d]});else if(t=d)g.push({row:[o-f,s-f],column:[u,d]});else if(l>u&&a u){let y=[{row:[o,s],column:[u,l-1]},{row:[o-f,s-f],column:[l,d]}];g=g.concat(y)}else if(a =o){if(n<=o&&t>=s){if(l>u&&a u){let y=[{row:[o,s],column:[u,l-1]}];g=g.concat(y)}else if(a o&&t =d)g.push({row:[o,s-f],column:[u,d]});else if(l>u&&au){let y=[{row:[o,s],column:[u,l-1]},{row:[o,s-f],column:[l,d]}];g=g.concat(y)}else if(a o){if(l<=u&&a>=d)g.push({row:[o,n-1],column:[u,d]});else if(l>u&&a u){let y=[{row:[o,s],column:[u,l-1]},{row:[o,n-1],column:[l,d]}];g=g.concat(y)}else if(a =d)g.push({row:[o-f,s-f],column:[u,d]});else if(l>u&&a u){let y=[{row:[o,s],column:[u,l-1]},{row:[o-f,s-f],column:[l,d]}];g=g.concat(y)}else if(a {Qt();qt();Xt();Zt();gr();yr();Vl();Jt();zr();_l();Dt();Xe();El()});function Ks(e,n,t,l,a){a==null&&(a=!0),h.visibledatarow=[],h.visibledatacolumn=[],h.ch_width=0,h.rh_height=0,h.zoomRatio=1,l!=null?h.config=l:h.config={},t.length==0?h.flowdata=Vt(t,n,e):t.length {Zt();Qt();Ai();qt();Xt();gl();Xe()});var ja,m2,Ke,El=$e(()=>{ll();Wt();gl();qt();jr();vr();cn();Vl();Dt();fa();Sl();Qt();nf();Xe();ja={defaultStore:{container:null,luckysheetfile:null,defaultcolumnNum:60,defaultrowNum:84,fullscreenmode:!0,devicePixelRatio:1,currentSheetIndex:0,calculateSheetIndex:0,flowdata:[],config:{},visibledatarow:[],visibledatacolumn:[],ch_width:0,rh_height:0,cellmainWidth:0,cellmainHeight:0,toolbarHeight:0,infobarHeight:0,calculatebarHeight:0,rowHeaderWidth:46,columnHeaderHeight:20,cellMainSrollBarSize:12,sheetBarHeight:31,statisticBarHeight:23,luckysheetTableContentHW:[0,0],defaultcollen:73,defaultrowlen:19,jfcountfuncTimeout:null,jfautoscrollTimeout:null,luckysheet_select_status:!1,luckysheet_select_save:[{row:[0,0],column:[0,0]}],luckysheet_selection_range:[],luckysheet_copy_save:{},luckysheet_paste_iscut:!1,filterchage:!0,luckysheet_filter_save:{row:[],column:[]},luckysheet_sheet_move_status:!1,luckysheet_sheet_move_data:[],luckysheet_scroll_status:!1,luckysheetisrefreshdetail:!0,luckysheetisrefreshtheme:!0,luckysheetcurrentisPivotTable:!1,luckysheet_rows_selected_status:!1,luckysheet_cols_selected_status:!1,luckysheet_rows_change_size:!1,luckysheet_rows_change_size_start:[],luckysheet_cols_change_size:!1,luckysheet_cols_change_size_start:[],luckysheet_cols_dbclick_timeout:null,luckysheet_cols_dbclick_times:0,luckysheetCellUpdate:[],luckysheet_shiftpositon:null,iscopyself:!0,orderbyindex:0,luckysheet_model_move_state:!1,luckysheet_model_xy:[0,0],luckysheet_model_move_obj:null,luckysheet_cell_selected_move:!1,luckysheet_cell_selected_move_index:[],luckysheet_cell_selected_extend:!1,luckysheet_cell_selected_extend_index:[],luckysheet_cell_selected_extend_time:null,clearjfundo:!0,jfredo:[],jfundo:[],lang:"en",createChart:"",highlightChart:"",zIndex:15,chartparam:{luckysheetCurrentChart:null,luckysheetCurrentChartActive:!1,luckysheetCurrentChartMove:null,luckysheetCurrentChartMoveTimeout:null,luckysheetCurrentChartMoveObj:null,luckysheetCurrentChartMoveXy:null,luckysheetCurrentChartMoveWinH:null,luckysheetCurrentChartMoveWinW:null,luckysheetCurrentChartResize:null,luckysheetCurrentChartResizeObj:null,luckysheetCurrentChartResizeXy:null,luckysheetCurrentChartResizeWinH:null,luckysheetCurrentChartResizeWinW:null,luckysheetInsertChartTosheetChange:!0,luckysheetCurrentChartZIndexRank:100,luckysheet_chart_redo_click:!1,luckysheetCurrentChartMaxState:!1,jfrefreshchartall:"",changeChartCellData:"",renderChart:"",getChartJson:""},functionList:null,luckysheet_function:null,chart_selection:{},currentChart:"",scrollRefreshSwitch:!0,measureTextCache:{},measureTextCellInfoCache:{},measureTextCacheTimeOut:null,cellOverflowMapCache:{},zoomRatio:1,visibledatacolumn_unique:null,visibledatarow_unique:null,showGridLines:!0,toobarObject:{},inlineStringEditCache:null,inlineStringEditRange:null,fontList:[],currentSheetView:"viewNormal"},defaultFormula:{searchFunctionCell:null,functionlistPosition:{},rangechangeindex:null,rangestart:!1,rangetosheet:null,rangeSetValueTo:null,func_selectedrange:{},rangedrag_column_start:!1,rangedrag_row_start:!1,rangeResizeObj:null,rangeResize:null,rangeResizeIndex:null,rangeResizexy:null,rangeResizeWinH:null,rangeResizeWinW:null,rangeResizeTo:null,rangeMovexy:null,rangeMove:!1,rangeMoveObj:null,rangeMoveIndex:null,rangeMoveRangedata:null,functionHTMLIndex:0,functionRangeIndex:null,execvertex:{},execFunctionGroupData:null,execFunctionExist:null,formulaContainSheetList:{},cellTextToIndexList:{},isFunctionRangeSave:!1,formulaContainCellList:{},execFunctionGlobalData:{},groupValuesRefreshData:[],functionResizeData:{},functionResizeStatus:!1,functionResizeTimeout:null,data_parm_index:0},defaultSheet:{sheetMaxIndex:0,nulldata:null,mergeCalculationSheet:{},checkLoadSheetIndexToDataIndex:{},CacheNotLoadControll:[]},defaultPivotTable:{pivotDatas:null,pivotSheetIndex:0,pivotDataSheetIndex:0,celldata:null,origindata:null,pivot_data_type:{},pivot_select_save:null,column:null,row:null,values:null,filter:null,showType:null,rowhidden:null,selected:null,caljs:null,initial:!0,filterparm:null,luckysheet_pivotTable_select_state:!1,jgridCurrentPivotInput:null,movestate:!1,moveitemposition:[],movesave:{},drawPivotTable:!0,pivotTableBoundary:[12,6]},defaultImage:{imgItem:{type:"3",src:"",originWidth:null,originHeight:null,default:{width:null,height:null,left:null,top:null},crop:{width:null,height:null,offsetLeft:0,offsetTop:0},isFixedPos:!1,fixedLeft:null,fixedTop:null,border:{width:0,radius:0,style:"solid",color:"#000"}},images:null,currentImgId:null,currentWinW:null,currentWinH:null,resize:null,resizeXY:null,move:!1,moveXY:null,cropChange:null,cropChangeXY:null,cropChangeObj:null,copyImgItemObj:null},defaultDataVerification:{defaultItem:{type:"dropdown",type2:null,value1:"",value2:"",checked:!1,remote:!1,prohibitInput:!1,hintShow:!1,hintText:""},curItem:null,dataVerification:null,selectRange:[],selectStatus:!1}},m2={addDataAjax:function(e,n,t,l){let a=this;n==null&&(n=h.currentSheetIndex),t==null&&(t=ne.loadSheetUrl),$("#luckysheet-grid-window-1").append(Nr()),e.currentPage++;let o="application/json;charset=UTF-8",s=sessionStorage.getItem("x-auth-token");$.ajax({method:"POST",url:t,headers:{"x-auth-token":s},data:JSON.stringify(e),contentType:o,success:function(u){typeof u=="string"&&(u=JSON.parse(u));let d=u.data,f=d.celldata;_o(d.row,f),setTimeout(function(){h.loadingObj.close()},500),l&&typeof l=="function"&&l(d)}})},reload:function(e,n,t,l){let a=this;n==null&&(n=h.currentSheetIndex),t==null&&(t=ne.loadSheetUrl),$("#luckysheet-grid-window-1").append(Nr());let o={gridKey:ne.gridKey,index:n};e=$.extend(!0,e,o);let s=h.luckysheetfile[K(n)];$.post(t,e,function(u){let d=new Function("return "+u)();s.celldata=d[n.toString()];let f=ve.buildGridData(s);setTimeout(function(){h.loadingObj.close()},500),s.data=f,h.flowdata=f,we.webWorkerFlowDataCache(f),Ks(f[0].length,f.length,f,null,!1),s.load="1",h.luckysheet_select_save.length=0,h.luckysheet_selection_range=[],ne.saveParam("shs",null,h.currentSheetIndex),ve.changeSheet(n),l&&typeof l=="function"&&l()})},clearSheetByIndex:function(e){let n=K(e),t=h.luckysheetfile[n];t.isPivotTable?delete h.luckysheetfile[n]:(t.data=[],t.row=h.defaultrowNum,t.column=h.defaultcolumnNum,t.chart=[],t.config=null,t.filter=null,t.filter_select=null,t.celldata=[],t.pivotTable={},t.calcChain=[],t.status=0,t.load=0,h.flowdata=[],we.webWorkerFlowDataCache(h.flowdata),$("#"+h.container+" .luckysheet-data-visualization-chart").remove(),$("#"+h.container+" .luckysheet-datavisual-selection-set").remove(),$("#luckysheet-row-count-show, #luckysheet-formula-functionrange-select, #luckysheet-row-count-show, #luckysheet-column-count-show, #luckysheet-change-size-line, #luckysheet-cell-selected-focus, #luckysheet-selection-copy, #luckysheet-cell-selected-extend, #luckysheet-cell-selected-move, #luckysheet-cell-selected").hide(),delete t.load)},clear:function(e){let n=this;if(e=="all")for(let t=0;t .luckysheet-cols-menu").remove(),$("#luckysheet-modal-dialog-mask, #luckysheetTextSizeTest, #luckysheet-icon-morebtn-div").remove(),$("#luckysheet-input-box").parent().remove(),$("#luckysheet-formula-help-c").remove(),$(".chartSetting, .luckysheet-modal-dialog-slider").remove(),$(document).off(".luckysheetEvent"),$(document).off(".luckysheetProtection"),X.initialHorizontal=!0,X.initialVertical=!0;let e=$.extend(!0,{},ja.defaultStore);for(let s in e)s in h&&(h[s]=e[s]);let n=$.extend(!0,{},ja.defaultFormula);for(let s in n)s in p&&(p[s]=n[s]);let t=$.extend(!0,{},ja.defaultSheet);for(let s in t)s in ve&&(ve[s]=t[s]);let l=$.extend(!0,{},ja.defaultPivotTable);for(let s in l)s in Oe&&(Oe[s]=l[s]);let a=$.extend(!0,{},ja.defaultImage);for(let s in a)s in Ie&&(Ie[s]=a[s]);let o=$.extend(!0,{},ja.defaultDataVerification);for(let s in o)s in Ye&&(Ye[s]=o[s]);h.asyncLoad=["core"]},editorChart:function(e){let n=Yl[0],t="luckysheetEditMode-datav-chart",l=t+"_selection";e.chart_id=t;let a=e.chartTheme;a=a==null?"default0000":a,luckysheet.insertChartTosheet(e.sheetIndex,e.dataSheetIndex,e.option,e.chartType,e.selfOption,e.defaultOption,e.row,e.column,n,t,l,e.chartStyle,e.rangeConfigCheck,e.rangeRowCheck,e.rangeColCheck,e.chartMarkConfig,e.chartTitleConfig,e.winWidth,e.winHeight,e.scrollLeft,e.scrollTop,a,e.myWidth,e.myHeight,e.myLeft!=null?parseFloat(e.myLeft):null,e.myTop!=null?parseFloat(e.myTop):null,e.myindexrank,!0),$("#"+t).find(".luckysheet-modal-controll-update").click()},createHookFunction:function(){let e=arguments[0];if(me.hook&&me.hook[e]!=null&&typeof me.hook[e]=="function"){var n=Array.prototype.slice.apply(arguments);return n.shift(),me.hook[e].apply(this,n)!==!1}return!0}},Ke=m2});var p2,He,Gr=$e(()=>{Zl();Qt();qt();gn();Xt();Rn();Dt();ht();Vl();ol();_l();ll();Xe();El();p2={defaultWidth:144,defaultHeight:84,currentObj:null,currentWinW:null,currentWinH:null,resize:null,resizeXY:null,move:!1,moveXY:null,init:function(){let e=this;$("#luckysheet-postil-showBoxs").off("mousedown.showPs").on("mousedown.showPs",".luckysheet-postil-show",function(n){if(!!It(h.currentSheetIndex,"editObjects",!1)){if(e.currentObj=$(this).find(".luckysheet-postil-show-main"),$(this).hasClass("luckysheet-postil-show-active")){n.stopPropagation();return}e.removeActivePs(),$(this).addClass("luckysheet-postil-show-active"),$(this).find(".luckysheet-postil-dialog-resize").show(),$(this).find(".arrowCanvas").css("z-index",200),$(this).find(".luckysheet-postil-show-main").css("z-index",200),n.stopPropagation()}}),$("#luckysheet-postil-showBoxs").off("mouseup.showPs").on("mouseup.showPs",".luckysheet-postil-show",function(n){n.which=="3"&&n.stopPropagation()}),$("#luckysheet-postil-showBoxs").off("mousedown.resize").on("mousedown.resize",".luckysheet-postil-show .luckysheet-postil-dialog-resize .luckysheet-postil-dialog-resize-item",function(n){if(!It(h.currentSheetIndex,"editObjects",!1))return;e.currentObj=$(this).closest(".luckysheet-postil-show-main"),e.currentWinW=$("#luckysheet-cell-main")[0].scrollWidth,e.currentWinH=$("#luckysheet-cell-main")[0].scrollHeight,e.resize=$(this).data("type");let t=$("#luckysheet-cell-main").scrollTop(),l=$("#luckysheet-cell-main").scrollLeft(),a=nt(n.pageX,n.pageY),o=a[0]+l,s=a[1]+t,u=e.currentObj.position(),d=e.currentObj.width(),f=e.currentObj.height();if(e.resizeXY=[o,s,d,f,u.left+l,u.top+t,l,t],tn(!0),$(this).closest(".luckysheet-postil-show").hasClass("luckysheet-postil-show-active")){n.stopPropagation();return}e.removeActivePs(),$(this).closest(".luckysheet-postil-show").addClass("luckysheet-postil-show-active"),$(this).closest(".luckysheet-postil-show").find(".luckysheet-postil-dialog-resize").show(),$(this).closest(".luckysheet-postil-show").find(".arrowCanvas").css("z-index",200),$(this).closest(".luckysheet-postil-show").find(".luckysheet-postil-show-main").css("z-index",200),n.stopPropagation()}),$("#luckysheet-postil-showBoxs").off("mousedown.move").on("mousedown.move",".luckysheet-postil-show .luckysheet-postil-dialog-move .luckysheet-postil-dialog-move-item",function(n){if(!It(h.currentSheetIndex,"editObjects",!1))return;e.currentObj=$(this).closest(".luckysheet-postil-show-main"),e.currentWinW=$("#luckysheet-cell-main")[0].scrollWidth,e.currentWinH=$("#luckysheet-cell-main")[0].scrollHeight,e.move=!0;let t=$("#luckysheet-cell-main").scrollTop(),l=$("#luckysheet-cell-main").scrollLeft(),a=e.currentObj.offset(),o=e.currentObj.position();if(e.moveXY=[n.pageX-a.left,n.pageY-a.top,o.left,o.top,l,t],tn(!0),$(this).closest(".luckysheet-postil-show").hasClass("luckysheet-postil-show-active")){n.stopPropagation();return}e.removeActivePs(),$(this).closest(".luckysheet-postil-show").addClass("luckysheet-postil-show-active"),$(this).closest(".luckysheet-postil-show").find(".luckysheet-postil-dialog-resize").show(),$(this).closest(".luckysheet-postil-show").find(".arrowCanvas").css("z-index",200),$(this).closest(".luckysheet-postil-show").find(".luckysheet-postil-show-main").css("z-index",200),n.stopPropagation()})},overshow:function(e){let n=this;if($("#luckysheet-postil-overshow").remove(),$(e.target).closest("#luckysheet-cell-main").length==0)return;let t=nt(e.pageX,e.pageY),l=$("#luckysheet-cell-main").scrollLeft(),a=$("#luckysheet-cell-main").scrollTop(),o=t[0],s=t[1],u=0,d=0;X.freezenverticaldata!=null&&t[0] 0)return;let v=y.value==null?"":y.value,k=h.visibledatarow[f],b=f-1==-1?0:h.visibledatarow[f-1],w=h.visibledatacolumn[m],x=m-1==-1?0:h.visibledatacolumn[m-1];g&&(k=g.row[1],b=g.row[0],w=g.column[1],x=g.column[0]);let C=w+u,S=b+d,_=C+18*h.zoomRatio,T=S-18*h.zoomRatio;T<0&&(T=2);let A=y.width==null?n.defaultWidth*h.zoomRatio:y.width*h.zoomRatio,R=y.height==null?n.defaultHeight*h.zoomRatio:y.height*h.zoomRatio,I=n.getArrowCanvasSize(_,T,C,S),F="",z=v.split(` +`);for(let E of z)F+=" "+n.htmlEscape(E)+"";let M='";$(M).appendTo($("#luckysheet-cell-main"));let N=$("#luckysheet-postil-overshow .arrowCanvas").get(0).getContext("2d");n.drawArrow(N,I[4],I[5],I[6],I[7])},getArrowCanvasSize:function(e,n,t,l){let a=t-5;e'+F+"0&&$("#luckysheet-postil-show_"+e+"_"+n).remove(),t==null)return;let l=this;if(t.isshow==null?!1:t.isshow){let o=h.visibledatarow[e],s=e-1==-1?0:h.visibledatarow[e-1],u=h.visibledatacolumn[n],d=n-1==-1?0:h.visibledatacolumn[n-1],f=be.mergeborer(h.flowdata,e,n);f&&(o=f.row[1],s=f.row[0],u=f.column[1],d=f.column[0]);let m=u,g=s,y=t.left==null?m+18*h.zoomRatio:t.left*h.zoomRatio,v=t.top==null?g-18*h.zoomRatio:t.top*h.zoomRatio,k=t.width==null?l.defaultWidth*h.zoomRatio:t.width*h.zoomRatio,b=t.height==null?l.defaultHeight*h.zoomRatio:t.height*h.zoomRatio,w=t.value==null?"":t.value;v<0&&(v=2);let x=l.getArrowCanvasSize(y,v,m,g),C="",S=w.split(` +`);for(let A of S)C+=" "+l.htmlEscape(A)+"";let _='";$(_).appendTo($("#luckysheet-cell-main #luckysheet-postil-showBoxs"));let T=$("#luckysheet-postil-show_"+e+"_"+n+" .arrowCanvas").get(0).getContext("2d");l.drawArrow(T,x[4],x[5],x[6],x[7])}},newPs:function(e,n){if(!It(h.currentSheetIndex,"editObjects")||!Ke.createHookFunction("commentInsertBefore",e,n))return;let t=this,l=h.visibledatarow[e],a=e-1==-1?0:h.visibledatarow[e-1],o=h.visibledatacolumn[n],s=n-1==-1?0:h.visibledatacolumn[n-1],u=be.mergeborer(h.flowdata,e,n);u&&(l=u.row[1],a=u.row[0],o=u.column[1],s=u.column[0]);let d=o,f=a,m=d+18*h.zoomRatio,g=f-18*h.zoomRatio;g<0&&(g=2);let y=t.defaultWidth*h.zoomRatio,v=t.defaultHeight*h.zoomRatio,k=t.getArrowCanvasSize(m,g,d,f),b='';$(b).appendTo($("#luckysheet-cell-main #luckysheet-postil-showBoxs"));let w=$("#luckysheet-postil-show_"+e+"_"+n+" .arrowCanvas").get(0).getContext("2d");t.drawArrow(w,k[4],k[5],k[6],k[7]),$("#luckysheet-postil-show_"+e+"_"+n+" .formulaInputFocus").focus(),t.init();let x=we.deepCopyFlowData(h.flowdata),C=[];x[e][n]==null&&(x[e][n]={}),x[e][n].ps={left:null,top:null,width:null,height:null,value:"",isshow:!1},C.push(e+"_"+n),t.ref(x,C),setTimeout(()=>{Ke.createHookFunction("commentInsertAfter",e,n,x[e][n])},0)},editPs:function(e,n){let t=this;if(!!It(h.currentSheetIndex,"editObjects")){if($("#luckysheet-postil-show_"+e+"_"+n).length>0)$("#luckysheet-postil-show_"+e+"_"+n).show(),$("#luckysheet-postil-show_"+e+"_"+n).addClass("luckysheet-postil-show-active"),$("#luckysheet-postil-show_"+e+"_"+n).find(".luckysheet-postil-dialog-resize").show();else{let l=h.flowdata[e][n].ps,a=h.visibledatarow[e],o=e-1==-1?0:h.visibledatarow[e-1],s=h.visibledatacolumn[n],u=n-1==-1?0:h.visibledatacolumn[n-1],d=be.mergeborer(h.flowdata,e,n);d&&(a=d.row[1],o=d.row[0],s=d.column[1],u=d.column[0]);let f=s,m=o,g=l.left==null?f+18*h.zoomRatio:l.left*h.zoomRatio,y=l.top==null?m-18*h.zoomRatio:l.top*h.zoomRatio,v=l.width==null?t.defaultWidth*h.zoomRatio:l.width*h.zoomRatio,k=l.height==null?t.defaultHeight*h.zoomRatio:l.height*h.zoomRatio,b=l.value==null?"":l.value;y<0&&(y=2);let w=t.getArrowCanvasSize(g,y,f,m),x="",C=b.split(` +`);for(let T of C)x+=""+t.htmlEscape(T)+"";let S='";$(S).appendTo($("#luckysheet-cell-main #luckysheet-postil-showBoxs"));let _=$("#luckysheet-postil-show_"+e+"_"+n+" .arrowCanvas").get(0).getContext("2d");t.drawArrow(_,w[4],w[5],w[6],w[7])}$("#luckysheet-postil-show_"+e+"_"+n+" .formulaInputFocus").focus(),Cr($("#luckysheet-postil-show_"+e+"_"+n+" .formulaInputFocus").get(0)),t.init()}},delPs:function(e,n){if(!It(h.currentSheetIndex,"editObjects")||!Ke.createHookFunction("commentDeleteBefore",e,n,h.flowdata[e][n]))return;$("#luckysheet-postil-show_"+e+"_"+n).length>0&&$("#luckysheet-postil-show_"+e+"_"+n).remove();let t=we.deepCopyFlowData(h.flowdata),l=[];delete t[e][n].ps,l.push(e+"_"+n),this.ref(t,l),setTimeout(()=>{Ke.createHookFunction("commentDeleteAfter",e,n,h.flowdata[e][n])},0)},showHidePs:function(e,n){let t=this,l=h.flowdata[e][n].ps,a=l.isshow,o=we.deepCopyFlowData(h.flowdata),s=[];if(a)o[e][n].ps.isshow=!1,$("#luckysheet-postil-show_"+e+"_"+n).remove();else{o[e][n].ps.isshow=!0;let u=h.visibledatarow[e],d=e-1==-1?0:h.visibledatarow[e-1],f=h.visibledatacolumn[n],m=n-1==-1?0:h.visibledatacolumn[n-1],g=be.mergeborer(h.flowdata,e,n);g&&(u=g.row[1],d=g.row[0],f=g.column[1],m=g.column[0]);let y=$("#luckysheet-cell-main").scrollLeft(),v=$("#luckysheet-cell-main").scrollTop(),k=f,b=d;X.freezenverticaldata!=null&&k"+t.htmlEscape(z)+"";let I=' ";$(I).appendTo($("#luckysheet-cell-main #luckysheet-postil-showBoxs"));let F=$("#luckysheet-postil-show_"+e+"_"+n+" .arrowCanvas").get(0).getContext("2d");t.drawArrow(F,T[4],T[5],T[6],T[7]),t.init()}s.push(e+"_"+n),t.ref(o,s)},showHideAllPs:function(){let e=this,n=we.deepCopyFlowData(h.flowdata),t=!0,l=[];for(let o=0;o0)if(t){$("#luckysheet-cell-main #luckysheet-postil-showBoxs").empty();for(let o=0;o "+e.htmlEscape(N)+"";let z=' ";$(z).appendTo($("#luckysheet-cell-main #luckysheet-postil-showBoxs"));let M=$("#luckysheet-postil-show_"+s+"_"+u+" .arrowCanvas").get(0).getContext("2d");e.drawArrow(M,R[4],R[5],R[6],R[7]),n[s][u].ps.isshow=!0,a.push(l[o])}}e.ref(n,a),e.init()},removeActivePs:function(){if($("#luckysheet-postil-showBoxs .luckysheet-postil-show-active").length>0){let e=$("#luckysheet-postil-showBoxs .luckysheet-postil-show-active").attr("id"),n=e.split("luckysheet-postil-show_")[1].split("_")[0],t=e.split("luckysheet-postil-show_")[1].split("_")[1],l=$("#"+e).find(".formulaInputFocus").html().replaceAll("",` +`).replaceAll(/<(.*)>.*?|<(.*) \/>/g,"").trim();if(!Ke.createHookFunction("commentUpdateBefore",n,t,l)){h.flowdata[n][t].ps.isshow||$("#"+e).remove();return}let a=$.extend(!0,{},h.flowdata[n][t]);$("#"+e).removeClass("luckysheet-postil-show-active"),$("#"+e).find(".luckysheet-postil-dialog-resize").hide(),$("#"+e).find(".arrowCanvas").css("z-index",100),$("#"+e).find(".luckysheet-postil-show-main").css("z-index",100);let o=we.deepCopyFlowData(h.flowdata),s=[];o[n][t].ps.value=l,s.push(n+"_"+t),this.ref(o,s),o[n][t].ps.isshow||$("#"+e).remove(),setTimeout(()=>{Ke.createHookFunction("commentUpdateAfter",n,t,a,o[n][t])},0)}},ref:function(e,n){if(h.clearjfundo&&(h.jfundo.length=0,h.jfredo.push({type:"postil",data:h.flowdata,curdata:e,sheetIndex:h.currentSheetIndex,rc:n})),h.flowdata=e,we.webWorkerFlowDataCache(h.flowdata),h.luckysheetfile[K(h.currentSheetIndex)].data=h.flowdata,ne.allowUpdate)for(let t=0;t+ `,botton:` + `,style:"z-index:100003"}))}function k2(e){let n=Q(),t=n.protection,l=n.button,a="";for(let s=0;s"&]/g,function(n,t,l){switch(console.log(n,t,l),n){case"<":return"<";case">":return">";case"&":return"&";case'"':return"""}})}},He=p2});function Zs(e,n,t,l,a){let o={},s,u;a==null?(s=h.config,u=h.flowdata):(s=h.luckysheetfile[K(a)].config,u=h.luckysheetfile[K(a)].data);let d=s.borderInfo;if(d!=null&&d.length>0)for(let f=0;f n&&(x=n),C l&&(S=l),g=="border-left")for(let _=w;_<=x;_++){if(s.rowhidden!=null&&s.rowhidden[_]!=null)continue;o[_+"_"+C]==null&&(o[_+"_"+C]={}),o[_+"_"+C].l={color:y,style:v};let T=C-1;if(T>=0&&o[_+"_"+T])if(u[_]!=null&&P(u[_][T])=="object"&&u[_][T].mc!=null){let R=u[_][T],I=s.merge[R.mc.r+"_"+R.mc.c];I.c+I.cs-1==T&&(o[_+"_"+T].r={color:y,style:v})}else o[_+"_"+T].r={color:y,style:v};let A=s.merge||{};for(let R in A){let{c:I,r:F,cs:z,rs:M}=A[R];C<=I+z-1&&C>I&&_>=F&&_<=F+M-1&&(o[_+"_"+C].l=null)}}else if(g=="border-right")for(let _=w;_<=x;_++){if(s.rowhidden!=null&&s.rowhidden[_]!=null)continue;o[_+"_"+S]==null&&(o[_+"_"+S]={}),o[_+"_"+S].r={color:y,style:v};let T=S+1;if(T=I&&_>=F&&_<=F+M-1&&(o[_+"_"+S].r=null)}}else if(g=="border-top"){if(s.rowhidden!=null&&s.rowhidden[w]!=null)continue;for(let _=C;_<=S;_++){o[w+"_"+_]==null&&(o[w+"_"+_]={}),o[w+"_"+_].t={color:y,style:v};let T=w-1;if(T>=0&&o[T+"_"+_])if(u[T]!=null&&P(u[T][_])=="object"&&u[T][_].mc!=null){let R=u[T][_],I=s.merge[R.mc.r+"_"+R.mc.c];I.r+I.rs-1==T&&(o[T+"_"+_].b={color:y,style:v})}else o[T+"_"+_].b={color:y,style:v};let A=s.merge||{};for(let R in A){let{c:I,r:F,cs:z,rs:M}=A[R];w<=F+M-1&&w>F&&_>=I&&_<=I+z-1&&(o[w+"_"+_].t=null)}}}else if(g=="border-bottom"){if(s.rowhidden!=null&&s.rowhidden[x]!=null)continue;for(let _=C;_<=S;_++){o[x+"_"+_]==null&&(o[x+"_"+_]={}),o[x+"_"+_].b={color:y,style:v};let T=x+1;if(T =F&&_>=I&&_<=I+z-1&&(o[x+"_"+_].b=null)}}}else if(g=="border-all"){for(let _=w;_<=x;_++)if(!(s.rowhidden!=null&&s.rowhidden[_]!=null))for(let T=C;T<=S;T++){if(u[_]!=null&&P(u[_][T])=="object"&&u[_][T].mc!=null){let A=u[_][T],R=s.merge[A.mc.r+"_"+A.mc.c];R.r==_&&(o[_+"_"+T]==null&&(o[_+"_"+T]={}),o[_+"_"+T].t={color:y,style:v}),R.r+R.rs-1==_&&(o[_+"_"+T]==null&&(o[_+"_"+T]={}),o[_+"_"+T].b={color:y,style:v}),R.c==T&&(o[_+"_"+T]==null&&(o[_+"_"+T]={}),o[_+"_"+T].l={color:y,style:v}),R.c+R.cs-1==T&&(o[_+"_"+T]==null&&(o[_+"_"+T]={}),o[_+"_"+T].r={color:y,style:v})}else o[_+"_"+T]==null&&(o[_+"_"+T]={}),o[_+"_"+T].l={color:y,style:v},o[_+"_"+T].r={color:y,style:v},o[_+"_"+T].t={color:y,style:v},o[_+"_"+T].b={color:y,style:v};if(_==w){let A=w-1;if(A>=0&&o[A+"_"+T])if(u[A]!=null&&P(u[A][T])=="object"&&u[A][T].mc!=null){let R=u[A][T],I=s.merge[R.mc.r+"_"+R.mc.c];I.r+I.rs-1==A&&(o[A+"_"+T].b={color:y,style:v})}else o[A+"_"+T].b={color:y,style:v}}if(_==x){let A=x+1;if(A =0&&o[_+"_"+A])if(u[_]!=null&&P(u[_][A])=="object"&&u[_][A].mc!=null){let R=u[_][A],I=s.merge[R.mc.r+"_"+R.mc.c];I.c+I.cs-1==A&&(o[_+"_"+A].r={color:y,style:v})}else o[_+"_"+A].r={color:y,style:v}}if(T==S){let A=S+1;if(A=0&&o[A+"_"+T])if(u[A]!=null&&P(u[A][T])=="object"&&u[A][T].mc!=null){let R=u[A][T],I=s.merge[R.mc.r+"_"+R.mc.c];I.r+I.rs-1==A&&(o[A+"_"+T].b={color:y,style:v})}else o[A+"_"+T].b={color:y,style:v}}if(_==x){o[_+"_"+T]==null&&(o[_+"_"+T]={}),o[_+"_"+T].b={color:y,style:v};let A=x+1;if(A =0&&o[_+"_"+A])if(u[_]!=null&&P(u[_][A])=="object"&&u[_][A].mc!=null){let R=u[_][A],I=s.merge[R.mc.r+"_"+R.mc.c];I.c+I.cs-1==A&&(o[_+"_"+A].r={color:y,style:v})}else o[_+"_"+A].r={color:y,style:v}}if(T==S){o[_+"_"+T]==null&&(o[_+"_"+T]={}),o[_+"_"+T].r={color:y,style:v};let A=S+1;if(A=0&&o[A+"_"+T]&&delete o[A+"_"+T].b}if(_==x){let A=x+1;A =0&&o[_+"_"+A]&&delete o[_+"_"+A].r}if(T==S){let A=S+1;An||v l||s.rowhidden!=null&&s.rowhidden[y]!=null)continue;if(g.l!=null||g.r!=null||g.t!=null||g.b!=null)if(o[y+"_"+v]==null&&(o[y+"_"+v]={}),u[y]!=null&&P(u[y][v])=="object"&&u[y][v].mc!=null){let k=u[y][v],b=s.merge[k.mc.r+"_"+k.mc.c]||{};if(g.l!=null&&v==b.c){o[y+"_"+v].l={color:g.l.color,style:g.l.style};let w=v-1;if(w>=0&&o[y+"_"+w])if(u[y]!=null&&P(u[y][w])=="object"&&u[y][w].mc!=null){let x=u[y][w],C=s.merge[x.mc.r+"_"+x.mc.c];C.c+C.cs-1==w&&(o[y+"_"+w].r={color:g.l.color,style:g.l.style})}else o[y+"_"+w].r={color:g.l.color,style:g.l.style}}else o[y+"_"+v].l=null;if(g.r!=null&&v==b.c+b.cs-1){o[y+"_"+v].r={color:g.r.color,style:g.r.style};let w=v+1;if(w=0&&o[w+"_"+v])if(u[w]!=null&&P(u[w][v])=="object"&&u[w][v].mc!=null){let x=u[w][v],C=s.merge[x.mc.r+"_"+x.mc.c];C.r+C.rs-1==w&&(o[w+"_"+v].b={color:g.t.color,style:g.t.style})}else o[w+"_"+v].b={color:g.t.color,style:g.t.style}}else o[y+"_"+v].t=null;if(g.b!=null&&y==b.r+b.rs-1){o[y+"_"+v].b={color:g.b.color,style:g.b.style};let w=y+1;if(w =0&&o[y+"_"+k])if(u[y]!=null&&P(u[y][k])=="object"&&u[y][k].mc!=null){let b=u[y][k],w=s.merge[b.mc.r+"_"+b.mc.c];w.c+w.cs-1==k&&(o[y+"_"+k].r={color:g.l.color,style:g.l.style})}else o[y+"_"+k].r={color:g.l.color,style:g.l.style}}else o[y+"_"+v].l=null;if(g.r!=null){o[y+"_"+v].r={color:g.r.color,style:g.r.style};let k=v+1;if(k=0&&o[k+"_"+v])if(u[k]!=null&&P(u[k][v])=="object"&&u[k][v].mc!=null){let b=u[k][v],w=s.merge[b.mc.r+"_"+b.mc.c];w.r+w.rs-1==k&&(o[k+"_"+v].b={color:g.t.color,style:g.t.style})}else o[k+"_"+v].b={color:g.t.color,style:g.t.style}}else o[y+"_"+v].t=null;if(g.b!=null){o[y+"_"+v].b={color:g.b.color,style:g.b.style};let k=y+1;if(k {Dt();ht();Xe()});var Re,g2,al,Js=$e(()=>{Zl();Oa();Ua();Pt();Ml();Xt();Qt();qt();yr();_l();Jt();Dt();ht();Xe();yt();Re=Nl(kn()),g2={iconHtml:' ',typeListHtml:' ',copyRange:{},applyRange:{},applyType:null,direction:null,chnNumChar:{\u96F6:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9},chnNameValue:{\u5341:{value:10,secUnit:!1},\u767E:{value:100,secUnit:!1},\u5343:{value:1e3,secUnit:!1},\u4E07:{value:1e4,secUnit:!0},\u4EBF:{value:1e8,secUnit:!0}},ChineseToNumber:function(e){let n=this,t=0,l=0,a=0,o=!1,s=e.split("");for(let u=0;u0;){let s=e%10;s==0?o||(o=!0,l=n.chnNumChar2[s]+l):(o=!1,t=n.chnNumChar2[s],t+=n.chnUnitChar[a],l=t+l),a++,e=Math.floor(e/10)}return l},NumberToChinese:function(e){let n=this,t=0,l="",a="",o=!1;if(e==0)return n.chnNumChar2[0];for(;e>0;){let s=e%1e4;o&&(a=n.chnNumChar2[0]+a),l=n.SectionToChinese(s),l+=s!=0?n.chnUnitSection[t]:n.chnUnitSection[0],a=l+a,o=s<1e3&&s>0,e=Math.floor(e/1e4),t++}return a},isChnNumber:function(e){let n=this,t=!0;if(e)if(e.length==1)e=="\u65E5"||e in n.chnNumChar?t=!0:t=!1;else{let l=e.split("");for(let a=0;a =n&&a>=t?(o=l,s=a):(o=n,s=t);let u=rl(o)[1],d=rl(o)[0],f=Mt(s)[1],m=Mt(s)[0];$("#luckysheet-dropCell-icon").remove(),$("#luckysheet-cell-main").append(e.iconHtml),$("#luckysheet-dropCell-icon").css({left:f,top:u}),$("#luckysheet-dropCell-icon").mouseover(function(){$(this).css("background-color","#ffe8e8")}).mouseleave(function(){$(this).css("background-color","#f1f1f1")}).mousedown(function(g){$("#luckysheet-dropCell-typeList").remove();let v=Q().dropCell;$("body").append(_e(e.typeListHtml,{copyCell:v.copyCell,sequence:v.sequence,onlyFormat:v.onlyFormat,noFormat:v.noFormat,day:v.day,workDay:v.workDay,month:v.month,year:v.year,chineseNumber:v.chineseNumber}));let k=e.typeItemHide();!k[0]&&!k[1]&&!k[2]&&!k[3]&&!k[4]&&!k[5]&&!k[6]&&($("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=1]").hide(),$("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=4]").hide(),$("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=5]").hide(),$("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=6]").hide(),$("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=7]").hide(),$("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=8]").hide()),k[2]||($("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=4]").hide(),$("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=5]").hide(),$("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=6]").hide(),$("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=7]").hide()),k[3]||$("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=8]").hide();let b=$(this).offset().left,w=$(this).offset().top+25,x=$(window).height(),C=$(window).width(),S=$("#luckysheet-dropCell-typeList").width(),_=$("#luckysheet-dropCell-typeList").height();b+S>C&&(b=b-S),w+_>x&&(w=w-_-38),w<0&&(w=0),$("#luckysheet-dropCell-typeList").css({left:b,top:w}).show(),$("#luckysheet-dropCell-icon").mouseleave(function(){$(this).css("backgroundColor","#ffe8e8")});let T=e.applyType;$("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type="+T+"]").find("span").append(''),g.stopPropagation()}),$(document).off("click.dCtypeList").on("click.dCtypeList","#luckysheet-dropCell-typeList .luckysheet-cols-menuitem",function(){$("#luckysheet-dropCell-typeList .fa-check").remove(),$(this).find("span").append('');let g=$(this).attr("data-type");e.applyType=g,e.update(),$("#luckysheet-dropCell-typeList").hide(),$("#luckysheet-dropCell-icon").css("backgroundColor","#f1f1f1"),$("#luckysheet-dropCell-icon").mouseleave(function(){$(this).css("backgroundColor","#f1f1f1")}),wl()})},typeItemHide:function(){let e=this,n=e.copyRange,t=n.row[0],l=n.row[1],a=n.column[0],o=n.column[1],s=!1,u=!1,d=!1,f=!1,m=!1,g=!1,y=!1;for(let v=t;v<=l;v++)for(let k=a;k<=o;k++)if(h.flowdata[v][k]){let b=h.flowdata[v][k];P(b)=="object"&&b.v!=null&&b.f==null&&(b.ct!=null&&b.ct.t=="n"?s=!0:b.ct!=null&&b.ct.t=="d"?d=!0:e.isExtendNumber(b.m)[0]?u=!0:e.isChnNumber(b.m)&&b.m!="\u65E5"?f=!0:b.m=="\u65E5"?m=!0:e.isChnWeek2(b.m)?g=!0:e.isChnWeek3(b.m)&&(y=!0))}return[s,u,d,f,m,g,y]},update:function(){let e=this;if(!kr([e.applyRange],h.currentSheetIndex)||h.allowEdit===!1)return;let n=we.deepCopyFlowData(h.flowdata),t=h.luckysheetfile[K(h.currentSheetIndex)],l=$.extend(!0,{},h.config),a=Wr(),o=$.extend(!0,{},t.dataVerification),s=e.direction,u=e.applyType,d=e.copyRange,f=d.row[0],m=d.row[1],g=d.column[0],y=d.column[1],v=e.getCopyData(n,f,m,g,y,s),k;s=="down"||s=="up"?k=m-f+1:(s=="right"||s=="left")&&(k=y-g+1);let b=e.applyRange,w=b.row[0],x=b.row[1],C=b.column[0],S=b.column[1];if(s=="down"||s=="up"){let A=x-w+1;for(let R=C;R<=S;R++){let I=v[R-C],F=e.getApplyData(I,k,A);if(s=="down")for(let z=w;z<=x;z++){let M=F[z-w];if(M.f!=null){let L="="+p.functionCopy(M.f,"down",z-w+1),O=p.execfunction(L,z,R);if(p.execFunctionGroup(z,R,O[1],void 0,n),M.f=O[2],M.v=O[1],M.spl!=null)M.spl=O[3].data;else if(B(M.v)&&!/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(M.v)){if(M.v==Infinity||M.v==-Infinity)M.m=M.v.toString();else if(M.v.toString().indexOf("e")>-1){let V=M.v.toString().split(".")[1].split("e")[0].length;V>5&&(V=5),M.m=M.v.toExponential(V).toString()}else{let V;M.ct.fa==="##0.00"?(V=it(Math.round(M.v*1e9)/1e9+".00"),M.m=V[0].toString()):(V=it(Math.round(M.v*1e9)/1e9),M.m=V[0].toString())}M.ct=M.ct||{fa:"General",t:"n"}}else{let V=it(M.v);M.m=V[0].toString(),M.ct=V[1]}}n[z][R]=M;let N=f+(z-w)%k,E=R;if(a[N+"_"+E]){let L={rangeType:"cell",value:{row_index:z,col_index:R,l:a[N+"_"+E].l,r:a[N+"_"+E].r,t:a[N+"_"+E].t,b:a[N+"_"+E].b}};l.borderInfo.push(L)}else if(a[z+"_"+R]){let L={rangeType:"cell",value:{row_index:z,col_index:R,l:null,r:null,t:null,b:null}};l.borderInfo.push(L)}o[N+"_"+E]&&(o[z+"_"+R]=o[N+"_"+E])}if(s=="up")for(let z=x;z>=w;z--){let M=F[x-z];if(M.f!=null){let L="="+p.functionCopy(M.f,"up",x-z+1),O=p.execfunction(L,z,R);if(p.execFunctionGroup(z,R,O[1],void 0,n),M.f=O[2],M.v=O[1],M.spl!=null)M.spl=O[3].data;else if(B(M.v)&&!/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(M.v)){if(M.v==Infinity||M.v==-Infinity)M.m=M.v.toString();else if(M.v.toString().indexOf("e")>-1){let V=M.v.toString().split(".")[1].split("e")[0].length;V>5&&(V=5),M.m=M.v.toExponential(V).toString()}else{let V=it(Math.round(M.v*1e9)/1e9);M.m=V[0].toString()}M.ct={fa:"General",t:"n"}}else{let V=it(M.v);M.m=V[0].toString(),M.ct=V[1]}}n[z][R]=M;let N=m-(x-z)%k,E=R;if(a[N+"_"+E]){let L={rangeType:"cell",value:{row_index:z,col_index:R,l:a[N+"_"+E].l,r:a[N+"_"+E].r,t:a[N+"_"+E].t,b:a[N+"_"+E].b}};l.borderInfo.push(L)}else if(a[z+"_"+R]){let L={rangeType:"cell",value:{row_index:z,col_index:R,l:null,r:null,t:null,b:null}};l.borderInfo.push(L)}o[N+"_"+E]&&(o[z+"_"+R]=o[N+"_"+E])}}}else if(s=="right"||s=="left"){let A=S-C+1;for(let R=w;R<=x;R++){let I=v[R-w],F=e.getApplyData(I,k,A);if(s=="right")for(let z=C;z<=S;z++){let M=F[z-C];if(M.f!=null){let L="="+p.functionCopy(M.f,"right",z-C+1),O=p.execfunction(L,R,z);if(p.execFunctionGroup(R,z,O[1],void 0,n),M.f=O[2],M.v=O[1],M.spl!=null)M.spl=O[3].data;else if(B(M.v)&&!/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(M.v)){if(M.v==Infinity||M.v==-Infinity)M.m=M.v.toString();else if(M.v.toString().indexOf("e")>-1){let V=M.v.toString().split(".")[1].split("e")[0].length;V>5&&(V=5),M.m=M.v.toExponential(V).toString()}else{let V=it(Math.round(M.v*1e9)/1e9);M.m=V[0].toString()}M.ct={fa:"General",t:"n"}}else{let V=it(M.v);M.m=V[0].toString(),M.ct=V[1]}}n[R][z]=M;let N=R,E=g+(z-C)%k;if(a[N+"_"+E]){let L={rangeType:"cell",value:{row_index:R,col_index:z,l:a[N+"_"+E].l,r:a[N+"_"+E].r,t:a[N+"_"+E].t,b:a[N+"_"+E].b}};l.borderInfo.push(L)}else if(a[R+"_"+z]){let L={rangeType:"cell",value:{row_index:R,col_index:z,l:null,r:null,t:null,b:null}};l.borderInfo.push(L)}o[N+"_"+E]&&(o[R+"_"+z]=o[N+"_"+E])}if(s=="left")for(let z=S;z>=C;z--){let M=F[S-z];if(M.f!=null){let L="="+p.functionCopy(M.f,"left",S-z+1),O=p.execfunction(L,R,z);if(p.execFunctionGroup(R,z,O[1],void 0,n),M.f=O[2],M.v=O[1],M.spl!=null)M.spl=O[3].data;else if(B(M.v)&&!/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(M.v)){if(M.v==Infinity||M.v==-Infinity)M.m=M.v.toString();else if(M.v.toString().indexOf("e")>-1){let V=M.v.toString().split(".")[1].split("e")[0].length;V>5&&(V=5),M.m=M.v.toExponential(V).toString()}else{let V=it(Math.round(M.v*1e9)/1e9);M.m=V[0].toString()}M.ct={fa:"General",t:"n"}}else{let V=it(M.v);M.m=V[0].toString(),M.ct=V[1]}}n[R][z]=M;let N=R,E=y-(S-z)%k;if(a[N+"_"+E]){let L={rangeType:"cell",value:{row_index:R,col_index:z,l:a[N+"_"+E].l,r:a[N+"_"+E].r,t:a[N+"_"+E].t,b:a[N+"_"+E].b}};l.borderInfo.push(L)}else if(a[R+"_"+z]){let L={rangeType:"cell",value:{row_index:R,col_index:z,l:null,r:null,t:null,b:null}};l.borderInfo.push(L)}o[N+"_"+E]&&(o[R+"_"+z]=o[N+"_"+E])}}}let _=$.extend(!0,[],t.luckysheet_conditionformat_save);if(_!=null&&_.length>0)for(let A=0;A<_.length;A++){let R=_[A].cellrange,I=[];for(let F=0;F 0&&(I=I.concat(z))}I.length>0&&_[A].cellrange.push(b)}let T={cfg:l,cdformat:_,dataVerification:o};Ze(n,h.luckysheet_select_save,T),tt()},getCopyData:function(e,n,t,l,a,o){let s=this,u=[],d,f,m,g;o=="down"||o=="up"?(d=l,f=a,m=n,g=t):(o=="right"||o=="left")&&(d=n,f=t,m=l,g=a);for(let y=d;y<=f;y++){let v={},k=[],b=[],w="",x=null,C=null,S=!0;for(let _=m;_<=g;_++){let T;o=="down"||o=="up"?T=e[_][y]:(o=="right"||o=="left")&&(T=e[y][_]);let A;if(!!T&&!!T.v&&T.f==null)if(!!T.ct&&T.ct.t=="n")A="number",x=null,C=null;else if(!!T.ct&&T.ct.t=="d")A="date",x=null,C=null;else if(s.isExtendNumber(T.m)[0]){A="extendNumber";let R=s.isExtendNumber(T.m);x==null||C==null?(S=!0,x=R[2],C=R[3]):R[2]!=x||R[3]!=C?(S=!1,x=R[2],C=R[3]):S=!0}else s.isChnNumber(T.m)?(A="chnNumber",x=null,C=null):s.isChnWeek2(T.m)?(A="chnWeek2",x=null,C=null):s.isChnWeek3(T.m)?(A="chnWeek3",x=null,C=null):(A="other",x=null,C=null);else A="other",x=null,C=null;A=="extendNumber"?_==m?m==g?(w=A,k.push(T),b.push(_-m+1),v[w]=[],v[w].push({data:k,index:b})):(w=A,k.push(T),b.push(_-m+1)):_==g?w==A&&S?(k.push(T),b.push(_-m+1),w in v?v[w].push({data:k,index:b}):(v[w]=[],v[w].push({data:k,index:b}))):(w in v?v[w].push({data:k,index:b}):(v[w]=[],v[w].push({data:k,index:b})),w=A,k=[],k.push(T),b=[],b.push(_-m+1),w in v?v[w].push({data:k,index:b}):(v[w]=[],v[w].push({data:k,index:b}))):w==A&&S?(k.push(T),b.push(_-m+1)):(w in v?v[w].push({data:k,index:b}):(v[w]=[],v[w].push({data:k,index:b})),w=A,k=[],k.push(T),b=[],b.push(_-m+1)):_==m?m==g?(w=A,k.push(T),b.push(_-m+1),v[w]=[],v[w].push({data:k,index:b})):(w=A,k.push(T),b.push(_-m+1)):_==g?w==A?(k.push(T),b.push(_-m+1),w in v?v[w].push({data:k,index:b}):(v[w]=[],v[w].push({data:k,index:b}))):(w in v?v[w].push({data:k,index:b}):(v[w]=[],v[w].push({data:k,index:b})),w=A,k=[],k.push(T),b=[],b.push(_-m+1),w in v?v[w].push({data:k,index:b}):(v[w]=[],v[w].push({data:k,index:b}))):w==A?(k.push(T),b.push(_-m+1)):(w in v?v[w].push({data:k,index:b}):(v[w]=[],v[w].push({data:k,index:b})),w=A,k=[],k.push(T),b=[],b.push(_-m+1))}u.push(v)}return u},getApplyData:function(e,n,t){let l=this,a=[],o=l.direction,s=l.applyType,u=Math.floor(t/n),d=t%n,f=e.number,m=[];if(f)for(let R=0;R 0)for(let I=0;I 0)for(let I=0;I 0)for(let I=0;I 0)for(let I=0;I 0)for(let I=0;I 0)for(let I=0;I<_.length;I++)R in _[I].index&&a.push(_[I].data[_[I].index[R]]);if(A.length>0)for(let I=0;I 0){for(let u=1;u<=a;u++)for(let d=0;d 0&&o.ChineseToNumber(e[m].m)<7?d.push(o.ChineseToNumber(e[m].m)+f*7):d.push(o.ChineseToNumber(e[m].m));if((t=="up"||t=="left")&&(e.reverse(),d.reverse()),o.isEqualDiff(d))if(u||d[d.length-1]<6&&d[0]>0||d[0]<6&&d[d.length-1]>0){let m=d[1]-d[0];s=o.FillChnWeek(e,n,m)}else{let m=d[1]-d[0];s=o.FillChnNumber(e,n,m)}else s=o.FillCopy(e,n)}else if(a=="chnWeek2")if(e.length==1){let u;t=="down"||t=="right"?u=1:(t=="up"||t=="left")&&(u=-1),s=o.FillChnWeek2(e,n,u)}else{let u=[],d=0;for(let f=0;f 7){let u;t=="down"||t=="right"?u=1:(t=="up"||t=="left")&&(u=-1,e.reverse());let d;for(let f=1;f<=n;f++){let m=(f-1)%e.length,g=$.extend(!0,{},e[m]),y=Math.ceil(f/e.length);m==0&&(d=(0,Re.default)(g.m).add(u*y,"months").diff((0,Re.default)(g.m),"days"));let v=(0,Re.default)(g.m).add(d,"days").day(),k;v==0?k=(0,Re.default)(g.m).add(d,"days").subtract(2,"days").format("YYYY-MM-DD"):v==6?k=(0,Re.default)(g.m).add(d,"days").subtract(1,"days").format("YYYY-MM-DD"):k=(0,Re.default)(g.m).add(d,"days").format("YYYY-MM-DD"),g.m=k,g.v=it(k)[2],s.push(g)}}else{let u;t=="down"||t=="right"?u=7:(t=="up"||t=="left")&&(u=-7,e.reverse());let d;for(let f=1;f<=n;f++){let m=(f-1)%e.length,g=$.extend(!0,{},e[m]),y=Math.ceil(f/e.length);m==0&&(d=(0,Re.default)(g.m).add(u*y,"days").diff((0,Re.default)(g.m),"days"));let v=(0,Re.default)(g.m).add(d,"days").day(),k;v==0?k=(0,Re.default)(g.m).add(d,"days").subtract(2,"days").format("YYYY-MM-DD"):v==6?k=(0,Re.default)(g.m).add(d,"days").subtract(1,"days").format("YYYY-MM-DD"):k=(0,Re.default)(g.m).add(d,"days").format("YYYY-MM-DD"),g.m=k,g.v=it(k)[2],s.push(g)}}else{let u=o.judgeDate(e);if(u[0]&&u[3]){(t=="up"||t=="left")&&e.reverse();let d=(0,Re.default)(e[1].m).diff((0,Re.default)(e[0].m),"months");for(let f=1;f<=n;f++){let m=(f-1)%e.length,g=$.extend(!0,{},e[m]),y=(0,Re.default)(e[e.length-1].m).add(d*f,"months").day(),v;y==0?v=(0,Re.default)(e[e.length-1].m).add(d*f,"months").subtract(2,"days").format("YYYY-MM-DD"):y==6?v=(0,Re.default)(e[e.length-1].m).add(d*f,"months").subtract(1,"days").format("YYYY-MM-DD"):v=(0,Re.default)(e[e.length-1].m).add(d*f,"months").format("YYYY-MM-DD"),g.m=v,g.v=it(v)[2],s.push(g)}}else if(!u[0]&&u[2])if(Math.abs((0,Re.default)(e[1].m).diff((0,Re.default)(e[0].m)))>7){let d;t=="down"||t=="right"?d=1:(t=="up"||t=="left")&&(d=-1,e.reverse());let f;for(let m=1;m<=n;m++){let g=(m-1)%e.length,y=$.extend(!0,{},e[g]),v=Math.ceil(m/e.length);g==0&&(f=(0,Re.default)(y.m).add(d*v,"months").diff((0,Re.default)(y.m),"days"));let k=(0,Re.default)(y.m).add(f,"days").day(),b;k==0?b=(0,Re.default)(y.m).add(f,"days").subtract(2,"days").format("YYYY-MM-DD"):k==6?b=(0,Re.default)(y.m).add(f,"days").subtract(1,"days").format("YYYY-MM-DD"):b=(0,Re.default)(y.m).add(f,"days").format("YYYY-MM-DD"),y.m=b,y.v=it(b)[2],s.push(y)}}else{let d;t=="down"||t=="right"?d=7:(t=="up"||t=="left")&&(d=-7,e.reverse());let f;for(let m=1;m<=n;m++){let g=(m-1)%e.length,y=$.extend(!0,{},e[g]),v=Math.ceil(m/e.length);g==0&&(f=(0,Re.default)(y.m).add(d*v,"days").diff((0,Re.default)(y.m),"days"));let k=(0,Re.default)(y.m).add(f,"days").day(),b;k==0?b=(0,Re.default)(y.m).add(f,"days").subtract(2,"days").format("YYYY-MM-DD"):k==6?b=(0,Re.default)(y.m).add(f,"days").subtract(1,"days").format("YYYY-MM-DD"):b=(0,Re.default)(y.m).add(f,"days").format("YYYY-MM-DD"),y.m=b,y.v=it(b)[2],s.push(y)}}else(t=="up"||t=="left")&&e.reverse(),s=o.FillCopy(e,n)}else if(l=="6")if(e.length==1){let u;t=="down"||t=="right"?u=1:(t=="up"||t=="left")&&(u=-1),s=o.FillMonths(e,n,u)}else if(e.length==2)if((0,Re.default)(e[1].m).date()==(0,Re.default)(e[0].m).date()&&(0,Re.default)(e[1].m).diff((0,Re.default)(e[0].m),"months")!=0){(t=="up"||t=="left")&&e.reverse();let u=(0,Re.default)(e[1].m).diff((0,Re.default)(e[0].m),"months");s=o.FillMonths(e,n,u)}else{let u;t=="down"||t=="right"?u=1:(t=="up"||t=="left")&&(u=-1,e.reverse());let d;for(let f=1;f<=n;f++){let m=(f-1)%e.length,g=$.extend(!0,{},e[m]),y=Math.ceil(f/e.length);m==0&&(d=(0,Re.default)(g.m).add(u*y,"months").diff((0,Re.default)(g.m),"days"));let v=(0,Re.default)(g.m).add(d,"days").format("YYYY-MM-DD");g.m=v,g.v=it(v)[2],s.push(g)}}else{let u=o.judgeDate(e);if(u[0]&&u[3]){(t=="up"||t=="left")&&e.reverse();let d=(0,Re.default)(e[1].m).diff((0,Re.default)(e[0].m),"months");s=o.FillMonths(e,n,d)}else if(!u[0]&&u[2]){let d;t=="down"||t=="right"?d=1:(t=="up"||t=="left")&&(d=-1,e.reverse());let f;for(let m=1;m<=n;m++){let g=(m-1)%e.length,y=$.extend(!0,{},e[g]),v=Math.ceil(m/e.length);g==0&&(f=(0,Re.default)(y.m).add(d*v,"months").diff((0,Re.default)(y.m),"days"));let k=(0,Re.default)(y.m).add(f,"days").format("YYYY-MM-DD");y.m=k,y.v=it(k)[2],s.push(y)}}else(t=="up"||t=="left")&&e.reverse(),s=o.FillCopy(e,n)}else if(l=="7")if(e.length==1){let u;t=="down"||t=="right"?u=1:(t=="up"||t=="left")&&(u=-1),s=o.FillYears(e,n,u)}else if(e.length==2)if((0,Re.default)(e[1].m).date()==(0,Re.default)(e[0].m).date()&&(0,Re.default)(e[1].m).month()==(0,Re.default)(e[0].m).month()&&(0,Re.default)(e[1].m).diff((0,Re.default)(e[0].m),"years")!=0){(t=="up"||t=="left")&&e.reverse();let u=(0,Re.default)(e[1].m).diff((0,Re.default)(e[0].m),"years");s=o.FillYears(e,n,u)}else{let u;t=="down"||t=="right"?u=1:(t=="up"||t=="left")&&(u=-1,e.reverse());let d;for(let f=1;f<=n;f++){let m=(f-1)%e.length,g=$.extend(!0,{},e[m]),y=Math.ceil(f/e.length);m==0&&(d=(0,Re.default)(g.m).add(u*y,"years").diff((0,Re.default)(g.m),"days"));let v=(0,Re.default)(g.m).add(d,"days").format("YYYY-MM-DD");g.m=v,g.v=it(v)[2],s.push(g)}}else{let u=o.judgeDate(e);if(u[0]&&u[1]&&u[4]){(t=="up"||t=="left")&&e.reverse();let d=(0,Re.default)(e[1].m).diff((0,Re.default)(e[0].m),"years");s=o.FillYears(e,n,d)}else if(u[0]&&u[3]||u[2]){let d;t=="down"||t=="right"?d=1:(t=="up"||t=="left")&&(d=-1,e.reverse());let f;for(let m=1;m<=n;m++){let g=(m-1)%e.length,y=$.extend(!0,{},e[g]),v=Math.ceil(m/e.length);g==0&&(f=(0,Re.default)(y.m).add(d*v,"years").diff((0,Re.default)(y.m),"days"));let k=(0,Re.default)(y.m).add(f,"days").format("YYYY-MM-DD");y.m=k,y.v=it(k)[2],s.push(y)}}else(t=="up"||t=="left")&&e.reverse(),s=o.FillCopy(e,n)}else if(l=="8")if(e.length==1){let u;t=="down"||t=="right"?u=1:(t=="up"||t=="left")&&(u=-1),s=o.FillChnNumber(e,n,u)}else{let u=[];for(let d=0;d 2&&l.isEqualRatio(o))for(let s=1;s<=n;s++){let u=(s-1)%e.length,d=$.extend(!0,{},e[u]),f;t=="down"||t=="right"?f=Number(e[e.length-1].v)*Math.pow(Number(e[1].v)/Number(e[0].v),s):(t=="up"||t=="left")&&(f=Number(e[0].v)/Math.pow(Number(e[1].v)/Number(e[0].v),s)),d.v=f,d.m=_t(d.ct.fa,f),a.push(d)}else{let s=l.getXArr(e.length);for(let u=1;u<=n;u++){let d=(u-1)%e.length,f=$.extend(!0,{},e[d]),m;t=="down"||t=="right"?m=l.forecast(e.length+u,o,s):(t=="up"||t=="left")&&(m=l.forecast(1-u,o,s)),f.v=m,f.m=_t(f.ct.fa,m),a.push(f)}}return a},FillExtendNumber:function(e,n,t){let l=this,a=[],o=/0|([1-9]+[0-9]*)/g;for(let s=1;s<=n;s++){let u=(s-1)%e.length,d=$.extend(!0,{},e[u]),f=e[e.length-1].m,m=f.match(o),g=m[m.length-1],y=Math.abs(Number(g)+t*s),v=f.lastIndexOf(g),k=f.substr(0,v)+y.toString()+f.substr(v+g.length);d.v=k,d.m=k,a.push(d)}return a},FillOnlyFormat:function(e,n){let t=[];for(let l=1;l<=n;l++){let a=(l-1)%e.length,o=$.extend(!0,{},e[a]);delete o.f,delete o.m,delete o.v,t.push(o)}return t},FillWithoutFormat:function(e){let n=[];for(let t=0;t {Dt();zr();Jt();wn();ll();ol();Gr();Js();Zl();Xe();yt();Xt();hn={freezenHorizontalHTML:' ',freezenVerticalHTML:' ',initialHorizontal:!0,initialVertical:!0,horizontalmovestate:!1,horizontalmoveposition:null,verticalmovestate:!1,verticalmoveposition:null,windowHeight:null,windowWidth:null,freezenhorizontaldata:null,freezenverticaldata:null,freezenRealFirstRowColumn:!0,cutVolumn:function(e,n){if(n<=0)return e;let t=e.slice(0,n),l=t[t.length-1];return e.slice(n)},cancelFreezenVertical:function(e){let n=this,l=Q().freezen,a=` + + `;$("#luckysheet-freezen-btn-horizontal").html(a),$("#luckysheet-freezen-btn-vertical").html(' '+l.freezenColumn),n.freezenverticaldata=null;let o=$("#luckysheet-freezebar-vertical").is(":visible");$("#luckysheet-freezebar-vertical").hide(),e==null&&(e=h.currentSheetIndex);let s=h.luckysheetfile[K(e)];s.freezen!=null&&(s.freezen.vertical=null),s.frozen!=null&&o&&ne.saveParam("all",e,s.frozen,{k:"frozen"})},createFreezenVertical:function(e,n){let t=this;if(t.initialVertical){t.initialVertical=!1,$("#luckysheet-grid-window-1").append(t.freezenVerticalHTML),$("#luckysheet-freezebar-vertical").find(".luckysheet-freezebar-vertical-drop").hover(function(){$(this).parent().addClass("luckysheet-freezebar-hover")},function(){$(this).parent().removeClass("luckysheet-freezebar-hover")}),$("#luckysheet-freezebar-vertical").find(".luckysheet-freezebar-vertical-drop").mousedown(function(){t.verticalmovestate=!0,t.verticalmoveposition=$(this).position().left,t.windowWidth=$("#luckysheet-grid-window-1").width(),$(this).parent().addClass("luckysheet-freezebar-active"),$("#luckysheet-freezebar-vertical").find(".luckysheet-freezebar-vertical-handle").css("cursor","-webkit-grabbing")});let a=$("#luckysheet-grid-window-1").height();$("#luckysheet-freezebar-vertical").find(".luckysheet-freezebar-vertical-handle").css({height:a-10,width:"4px",cursor:"-webkit-grab",top:"0px"}).end().find(".luckysheet-freezebar-vertical-drop").css({height:a-10,width:"4px",top:"0px",cursor:"-webkit-grab"})}if(e==null){if(t.freezenRealFirstRowColumn){let a=0;n=h.visibledatacolumn[a]-2+h.rowHeaderWidth,e=[h.visibledatacolumn[a],a+1,0,t.cutVolumn(h.visibledatacolumn,a+1),n]}else{let a=$("#luckysheet-cell-main").scrollLeft(),o=st(h.visibledatacolumn,a);o==-1&&(o=0),n=h.visibledatacolumn[o]-2-a+h.rowHeaderWidth,e=[h.visibledatacolumn[o],o+1,a,t.cutVolumn(h.visibledatacolumn,o+1),n]}t.saveFreezen(null,null,e,n)}t.freezenverticaldata=e;let l=` + + `;$("#luckysheet-freezen-btn-horizontal").html(l),$("#luckysheet-freezebar-vertical").show().find(".luckysheet-freezebar-vertical-handle").css({left:n}).end().find(".luckysheet-freezebar-vertical-drop").css({left:n})},saveFreezen:function(e,n,t,l){let a=h.luckysheetfile[K(h.currentSheetIndex)];a.freezen==null&&(a.freezen={}),e!=null&&(a.freezen.horizontal==null&&(a.freezen.horizontal={}),a.freezen.horizontal.freezenhorizontaldata=e,a.freezen.horizontal.top=n),t!=null&&(a.freezen.vertical==null&&(a.freezen.vertical={}),a.freezen.vertical.freezenverticaldata=t,a.freezen.vertical.left=l),a.frozen!=null&&ne.saveParam("all",h.currentSheetIndex,a.frozen,{k:"frozen"})},initialFreezen:function(e){let n=this;n.frozenTofreezen();let t=h.luckysheetfile[K(e)];t.freezen!=null&&t.freezen.horizontal!=null&&t.freezen.horizontal.freezenhorizontaldata!=null?n.createFreezenHorizontal(t.freezen.horizontal.freezenhorizontaldata,t.freezen.horizontal.top):n.cancelFreezenHorizontal(e),t.freezen!=null&&t.freezen.vertical!=null&&t.freezen.vertical.freezenverticaldata!=null?n.createFreezenVertical(t.freezen.vertical.freezenverticaldata,t.freezen.vertical.left):n.cancelFreezenVertical(e),n.createAssistCanvas()},changeFreezenIndex:function(e,n){let t=this;if(n=="v"&&t.freezenverticaldata!=null){let l=t.freezenverticaldata[1],a=st(h.visibledatacolumn,$("#luckysheet-cell-main").scrollLeft());e-a=h.visibledatacolumn.length&&(l=h.visibledatacolumn.length-1),o>=h.visibledatacolumn.length&&(o=h.visibledatacolumn.length-1);let d=h.visibledatacolumn[l],f=h.visibledatacolumn[o];d<=f+u&&setTimeout(function(){$("#luckysheet-scrollbar-x").scrollLeft(0)},100)}if(e.freezenhorizontaldata!=null){let o=e.freezenhorizontaldata[1],s=st(e.freezenhorizontaldata[3],$("#luckysheet-cell-main").scrollTop()),u=e.freezenhorizontaldata[4];o+=s,n>=h.visibledatarow.length&&(n=h.visibledatarow.length-1),o>=h.visibledatarow.length&&(o=h.visibledatarow.length-1);let d=h.visibledatarow[n],f=h.visibledatarow[o];d<=f+u&&setTimeout(function(){$("#luckysheet-scrollbar-y").scrollTop(0)},100)}},cancelFreezenHorizontal:function(e){let n=this,t=` + + `;$("#luckysheet-freezen-btn-horizontal").html(t),n.freezenhorizontaldata=null;let l=$("#luckysheet-freezebar-horizontal").is(":visible");$("#luckysheet-freezebar-horizontal").hide(),e==null&&(e=h.currentSheetIndex);let a=h.luckysheetfile[K(e)];a.freezen!=null&&(a.freezen.horizontal=null),a.frozen!=null&&l&&ne.saveParam("all",e,a.frozen,{k:"frozen"})},createFreezenHorizontal:function(e,n){let t=this;if(t.initialHorizontal){t.initialHorizontal=!1,$("#luckysheet-grid-window-1").append(t.freezenHorizontalHTML),$("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-drop").hover(function(){$(this).parent().addClass("luckysheet-freezebar-hover")},function(){$(this).parent().removeClass("luckysheet-freezebar-hover")}),$("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-drop").mousedown(function(){t.horizontalmovestate=!0,t.horizontalmoveposition=$(this).position().top,t.windowHeight=$("#luckysheet-grid-window-1").height(),$(this).parent().addClass("luckysheet-freezebar-active"),$("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-handle").css("cursor","-webkit-grabbing")});let a=$("#luckysheet-grid-window-1").width();$("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-handle").css({width:a-10,height:"4px",cursor:"-webkit-grab",left:"0px"}).end().find(".luckysheet-freezebar-horizontal-drop").css({width:a-10,height:"4px",left:"0px",cursor:"-webkit-grab"})}if(e==null){let a;if(t.freezenRealFirstRowColumn)a=0,n=h.visibledatarow[a]-2+h.columnHeaderHeight,e=[h.visibledatarow[a],a+1,0,t.cutVolumn(h.visibledatarow,a+1),n],t.saveFreezen(e,n,null,null),setTimeout(()=>{hn.createAssistCanvas(),Be()});else{let o=$("#luckysheet-cell-main").scrollTop();a=st(h.visibledatarow,o),a==-1&&(a=0),n=h.visibledatarow[a]-2-o+h.columnHeaderHeight,e=[h.visibledatarow[a],a+1,o,t.cutVolumn(h.visibledatarow,a+1),n],t.saveFreezen(e,n,null,null)}}t.freezenhorizontaldata=e;let l=` + + `;$("#luckysheet-freezen-btn-horizontal").html(l),$("#luckysheet-freezebar-horizontal").show().find(".luckysheet-freezebar-horizontal-handle").css({top:n}).end().find(".luckysheet-freezebar-horizontal-drop").css({top:n})},createAssistCanvas:function(){let e=this;if(e.removeAssistCanvas(),e.freezenverticaldata!=null||e.freezenhorizontaldata!=null){let n,t,l,a,o,s,u=h.luckysheetTableContentHW[0],d=h.luckysheetTableContentHW[1];e.freezenverticaldata!=null&&e.freezenhorizontaldata!=null?(n=e.freezenhorizontaldata[0],t=e.freezenhorizontaldata[1],l=e.freezenhorizontaldata[2],a=e.freezenverticaldata[0],o=e.freezenverticaldata[1],s=e.freezenverticaldata[2],e.createCanvas("freezen_3",a-s,n-l+1,h.rowHeaderWidth-1,h.columnHeaderHeight-1),e.createCanvas("freezen_4",u-a+s,n-l+1,a-s+h.rowHeaderWidth-1,h.columnHeaderHeight-1),e.createCanvas("freezen_7",a-s,d-n+l-h.columnHeaderHeight,h.rowHeaderWidth-1,n-l+h.columnHeaderHeight-1)):e.freezenhorizontaldata!=null?(n=e.freezenhorizontaldata[0],t=e.freezenhorizontaldata[1],l=e.freezenhorizontaldata[2],e.createCanvas("freezen_h",u,n-l+1,h.rowHeaderWidth-1,h.columnHeaderHeight-1)):e.freezenverticaldata!=null&&(a=e.freezenverticaldata[0],o=e.freezenverticaldata[1],s=e.freezenverticaldata[2],e.createCanvas("freezen_v",a-s,d,h.rowHeaderWidth-1,h.columnHeaderHeight-1)),e.scrollAdapt()}},createCanvas:function(e,n,t,l,a){let o=$("").appendTo("#luckysheet-grid-window-1").attr({id:e,width:Math.ceil(n*h.devicePixelRatio),height:Math.ceil(t*h.devicePixelRatio)}).css({"user-select":"none",postion:"absolute",left:l,top:a,width:n,height:t,"z-index":10,"pointer-events":"none"})},removeAssistCanvas:function(){$("#luckysheet-grid-window-1 > canvas").not($("#luckysheetTableContent")).remove(),$("#luckysheet-cell-selected").css("z-index",15)},scrollAdapt:function(){let e=this;if(h.luckysheet_select_save!=null&&h.luckysheet_select_save.length>0&&e.scrollAdaptOfselect(),$(".luckysheet-modal-dialog-image").length>0&&imageCtrl.images!=null&&e.scrollAdaptOfImage(),$("#luckysheet-cell-main .luckysheet-data-visualization-chart").length>0){let n=h.luckysheetfile[K(h.currentSheetIndex)].chart;n!=null&&n.length>0&&e.scrollAdaptOfchart()}$("#luckysheet-postil-showBoxs .luckysheet-postil-show").length>0&&e.scrollAdaptOfpostil(),$("#luckysheet-dropCell-icon").length>0&&e.scrollAdaptOfdpicon(),$("#luckysheet-filter-options-sheet"+h.currentSheetIndex+" .luckysheet-filter-options").length>0&&e.scrollAdaptOffilteroptions()},scrollAdaptOfselect:function(){let e=this;$("#luckysheet-row-count-show").is(":visible")&&$("#luckysheet-row-count-show").hide(),$("#luckysheet-column-count-show").is(":visible")&&$("#luckysheet-column-count-show").hide(),$("#luckysheet-rows-h-selected").empty(),$("#luckysheet-cols-h-selected").empty();let n=$("#luckysheet-cell-main").scrollTop(),t=$("#luckysheet-cell-main").scrollLeft();if(e.freezenhorizontaldata!=null&&e.freezenverticaldata!=null){let l=e.freezenhorizontaldata[0],a=e.freezenhorizontaldata[1],o=n-e.freezenhorizontaldata[2],s=e.freezenverticaldata[0],u=e.freezenverticaldata[1],d=t-e.freezenverticaldata[2];for(let f=0;f=a?b+w =a?b+w =u?A+R =u?A+R=l?O+V=l?O+V =s?q+W =s?q+W=a?y+v=a?y+v =l?S+_ =l?S+_ =a?y+v =a?y+v =l?S+_ =l?S+_ =a?m.top=o?m.left g+40+2?$(s).css("visibility","hidden"):($(s).css({top:l+n,height:g-k,visibility:"visible"}),$(s).find("canvas").css("top",-k))}else $(s).css({top:u.top-y+n,height:g,visibility:"visible"}),$(s).find("canvas").css("top",0);if(u.left-vm+20+2?$(s).css("visibility","hidden"):($(s).css({left:a+t,width:m-k,visibility:"visible"}),$(s).find("canvas").css("left",-k))}else $(s).css({left:u.left-v+t,width:m,visibility:"visible"}),$(s).find("canvas").css("left",0)})}else if(e.freezenhorizontaldata!=null){let l=e.freezenhorizontaldata[0]-e.freezenhorizontaldata[2];$("#luckysheet-cell-main .luckysheet-data-visualization-chart").each(function(a,o){let s=$(o).position(),u=$(o).height(),d=$(o).find("canvas").height(),f=d-u;if(s.top-f d+40+2?$(o).css("visibility","hidden"):($(o).css({top:l+n,height:d-m,visibility:"visible"}),$(o).find("canvas").css("top",-m))}else $(o).css({top:s.top-f+n,height:d,visibility:"visible"}),$(o).find("canvas").css("top",0)})}else if(e.freezenverticaldata!=null){let l=e.freezenverticaldata[0]-e.freezenverticaldata[2];$("#luckysheet-cell-main .luckysheet-data-visualization-chart").each(function(a,o){let s=$(o).position(),u=$(o).width(),d=$(o).find("canvas").width(),f=d-u;if(s.left-f d+20+2?$(o).css("visibility","hidden"):($(o).css({left:l+t,width:d-m,visibility:"visible"}),$(o).find("canvas").css("left",-m))}else $(o).css({left:s.left-f+t,width:d,visibility:"visible"}),$(o).find("canvas").css("left",0)})}else $("#luckysheet-cell-main .luckysheet-data-visualization-chart").each(function(l,a){let o=$(a).position(),s=$(a).width(),u=$(a).height(),d=$(a).find("canvas").width(),f=$(a).find("canvas").height(),m=f-u,g=d-s;$(a).css({top:o.top-m+n,height:f,left:o.left-g+t,width:d,visibility:"visible"}),$(a).find("canvas").css({top:0,left:0})})},scrollAdaptOfpostil:function(){let e=this,n=$("#luckysheet-cell-main").scrollTop(),t=$("#luckysheet-cell-main").scrollLeft();if(e.freezenhorizontaldata!=null&&e.freezenverticaldata!=null){let l=e.freezenhorizontaldata[0],a=e.freezenverticaldata[0],o=n-e.freezenhorizontaldata[2],s=t-e.freezenverticaldata[2];$("#luckysheet-postil-showBoxs .luckysheet-postil-show").each(function(u,d){let f=$(d).attr("id"),m=f.split("luckysheet-postil-show_")[1].split("_")[0],g=f.split("luckysheet-postil-show_")[1].split("_")[1],y=h.flowdata[m][g].ps,v=h.visibledatarow[m],k=m-1==-1?0:h.visibledatarow[m-1],b=h.visibledatacolumn[g],w=g-1==-1?0:h.visibledatacolumn[g-1],x=be.mergeborer(h.flowdata,m,g);x&&(v=x.row[1],k=x.row[0],b=x.column[1],w=x.column[0]);let C=b,S=k,_=y.left==null?C+18:y.left,T=y.top==null?S-18:y.top,A=y.width==null?He.defaultWidth:y.width,R=y.height==null?He.defaultHeight:y.height;T<0&&(T=2);let I=He.getArrowCanvasSize(_,T,C,S),F=!0,z=!0;m>=e.freezenhorizontaldata[1]?T+R =e.freezenverticaldata[1]?_+A=e.freezenhorizontaldata[1]?S+T =e.freezenverticaldata[1]?C+_ =n&&a>=t?(o=l,s=a):(o=n,s=t),e.freezenhorizontaldata!=null&&e.freezenverticaldata!=null){let u=e.freezenhorizontaldata[1],d=st(e.freezenhorizontaldata[3],$("#luckysheet-cell-main").scrollTop()-e.freezenhorizontaldata[2]),f=e.freezenverticaldata[1],m=st(e.freezenverticaldata[3],$("#luckysheet-cell-main").scrollLeft()-e.freezenverticaldata[2]);if(o>=u&&s>=f)o=u)if(o=f)if(s =u)o=u)s=n&&f>=l)d =n)if(d =l)f =n?s =n)o a&&(a=o),a==-1&&(a=0);let s=h.visibledatarow[a]-2-l+h.columnHeaderHeight;t={horizontal:{freezenhorizontaldata:[h.visibledatarow[a],a+1,l,hn.cutVolumn(h.visibledatarow,a+1),s],top:s}}}else if(n.type==="rangeColumn"){let l=0,a=st(h.visibledatacolumn,l),o=n.range.column_focus;o>a&&(a=o),a==-1&&(a=0);let s=h.visibledatacolumn[a]-2-l+h.rowHeaderWidth;t={vertical:{freezenverticaldata:[h.visibledatacolumn[a],a+1,l,hn.cutVolumn(h.visibledatacolumn,a+1),s],left:s}}}else if(n.type==="rangeBoth"){let l=0,a=st(h.visibledatarow,l),o=n.range.row_focus;o>a&&(a=o),a==-1&&(a=0);let s=h.visibledatarow[a]-2-l+h.columnHeaderHeight,u=[h.visibledatarow[a],a+1,l,hn.cutVolumn(h.visibledatarow,a+1),s],d=0,f=st(h.visibledatacolumn,d),m=n.range.column_focus;m>f&&(f=m),f==-1&&(f=0);let g=h.visibledatacolumn[f]-2-d+h.rowHeaderWidth,y=[h.visibledatacolumn[f],f+1,d,hn.cutVolumn(h.visibledatacolumn,f+1),g];t={horizontal:{freezenhorizontaldata:u,top:s},vertical:{freezenverticaldata:y,left:g}}}else n.type==="cancel"&&(t={horizontal:null,vertical:null});e.freezen=t}},X=hn});function $t(e=!0){me.showinfobar?($("#luckysheet_info_detail").show(),h.infobarHeight=document.querySelector("#luckysheet_info_detail").offsetHeight):(h.infobarHeight=0,$("#luckysheet_info_detail").hide()),!!h.toobarObject&&!!h.toobarObject.toobarElements&&h.toobarObject.toobarElements.length===0?($("#"+h.container).find(".luckysheet-wa-editor").hide(),h.toolbarHeight=0):($("#"+h.container).find(".luckysheet-wa-editor").show(),h.toolbarHeight=document.querySelector("#"+h.container+" .luckysheet-wa-editor").offsetHeight),y2(),v2();let n=document.querySelector("#"+h.container+" .luckysheet-wa-calculate");me.sheetFormulaBar?(n.style.display="block",h.calculatebarHeight=n.offsetHeight):(n.style.display="none",h.calculatebarHeight=0),$("#"+h.container).find(".luckysheet-grid-container").css("top",h.toolbarHeight+h.infobarHeight+h.calculatebarHeight),jn=$("#"+h.container).width(),me.showConfigWindowResize&&($("#luckysheet-modal-dialog-slider-pivot").is(":visible")?jn-=$("#luckysheet-modal-dialog-slider-pivot").outerWidth():$(".chartSetting").is(":visible")?jn-=$(".chartSetting").outerWidth():$("#luckysheet-modal-dialog-slider-alternateformat").is(":visible")&&(jn-=$("#luckysheet-modal-dialog-slider-alternateformat").outerWidth()),$("#luckysheet-modal-dialog-slider-protection").is(":visible")&&(jn-=$("#luckysheet-modal-dialog-slider-protection").outerWidth()));let l=Q().toolbar,a=!1,o=0,s=` `,u='';$("#luckysheet-icon-morebtn-div").length==0&&$("body").append(u),We("#luckysheet-icon-morebtn-div").style.visibility="hidden",$("#luckysheet-icon-morebtn-div > div").each(function(){let g=$(this)[0],y=$("#luckysheet-wa-editor")[0];y.appendChild(document.createTextNode(" ")),y.appendChild(g)}),$("#luckysheet-icon-morebtn").remove();let d=h.toobarObject.toobarWidths,f=h.toobarObject.toobarElements,m=0;if(d!=null){for(let g=d.length-1;g>=0;g--)if(d[g]-1){let b=` + + + `;$(this).find(".luckysheet-toolbar-button-inner-box").html(b)}else{let b=` + + + `;$(this).find(".luckysheet-toolbar-button-inner-box").html(b)}}),$("#luckysheet-icon-morebtn-div .luckysheet-toolbar-button-split-left").off("hover").hover(function(){$(this).next(".luckysheet-toolbar-button-split-right").addClass("luckysheet-toolbar-button-split-right-hover")},function(){$(this).next(".luckysheet-toolbar-button-split-right").removeClass("luckysheet-toolbar-button-split-right-hover")}),$("#luckysheet-icon-morebtn-div .luckysheet-toolbar-button-split-right").off("hover").hover(function(){$(this).prev(".luckysheet-toolbar-button-split-left").addClass("luckysheet-toolbar-button-hover")},function(){$(this).prev(".luckysheet-toolbar-button-split-left").removeClass("luckysheet-toolbar-button-hover")}),U.createHoverTip("#luckysheet-icon-morebtn-div",".luckysheet-toolbar-menu-button, .luckysheet-toolbar-button, .luckysheet-toolbar-combo-button")),$("#"+h.container+" .luckysheet-wa-editor .luckysheet-toolbar-button-split-left").off("hover").hover(function(){$(this).next(".luckysheet-toolbar-button-split-right").addClass("luckysheet-toolbar-button-split-right-hover")},function(){$(this).next(".luckysheet-toolbar-button-split-right").removeClass("luckysheet-toolbar-button-split-right-hover")}),$("#"+h.container+" .luckysheet-wa-editor .luckysheet-toolbar-button-split-right").off("hover").hover(function(){$(this).prev(".luckysheet-toolbar-button-split-left").addClass("luckysheet-toolbar-button-hover")},function(){$(this).prev(".luckysheet-toolbar-button-split-left").removeClass("luckysheet-toolbar-button-hover")}),Qs=$("#"+h.container).height(),$("#"+h.container).find(".luckysheet").height(Qs-2).width(jn-2),ec(jn,Qs),e&&Be($("#luckysheet-cell-main").scrollLeft(),$("#luckysheet-cell-main").scrollTop()),ve.sheetArrowShowAndHide(),ve.sheetBarShowAndHide()}}function ec(e,n){e==null&&(e=$("#"+h.container).width()),n==null&&(n=$("#"+h.container).height()),h.cellmainHeight=n-(h.infobarHeight+h.toolbarHeight+h.calculatebarHeight+h.columnHeaderHeight+h.sheetBarHeight+h.statisticBarHeight),h.cellmainWidth=e-h.rowHeaderWidth,$("#luckysheet-cols-h-c, #luckysheet-cell-main").width(h.cellmainWidth),$("#luckysheet-cell-main").height(h.cellmainHeight),$("#luckysheet-rows-h").height(h.cellmainHeight-h.cellMainSrollBarSize),$("#luckysheet-scrollbar-y").height(h.cellmainHeight+h.columnHeaderHeight-h.cellMainSrollBarSize-3),$("#luckysheet-scrollbar-x").height(h.cellMainSrollBarSize),$("#luckysheet-scrollbar-y").width(h.cellMainSrollBarSize),$("#luckysheet-scrollbar-x").width(h.cellmainWidth).css("left",h.rowHeaderWidth-2),h.luckysheetTableContentHW=[h.cellmainWidth+h.rowHeaderWidth-h.cellMainSrollBarSize,h.cellmainHeight+h.columnHeaderHeight-h.cellMainSrollBarSize],$("#luckysheetTableContent, #luckysheetTableContentF").attr({width:Math.ceil(h.luckysheetTableContentHW[0]*h.devicePixelRatio),height:Math.ceil(h.luckysheetTableContentHW[1]*h.devicePixelRatio)}).css({width:h.luckysheetTableContentHW[0],height:h.luckysheetTableContentHW[1]}),$("#"+h.container).find("#luckysheet-grid-window-1").css("bottom",h.sheetBarHeight),$("#"+h.container).find(".luckysheet-grid-window").css("bottom",h.statisticBarHeight);let t=$("#luckysheet-grid-window-1").width();$("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-handle").css({width:t-10}).end().find(".luckysheet-freezebar-horizontal-drop").css({width:t-10});let l=$("#luckysheet-grid-window-1").height();$("#luckysheet-freezebar-vertical").find(".luckysheet-freezebar-vertical-handle").css({height:l-10}).end().find(".luckysheet-freezebar-vertical-drop").css({height:l-10}),X.createAssistCanvas()}function af(){let e=me.showtoolbar,n=me.showtoolbarConfig,t=h.toobarObject.toobarWidths=[],l=h.toobarObject.toobarElements=[],a=h.toobarObject.toolbarConfig=o();function o(){let d={};function f(g){let y={},v,k,b=0;for(let w=0;wf.index?1:-1}l.forEach((d,f,m)=>{m[f]=d.ele,f!==l.length-1?d.ele instanceof Array?t.push($(d.ele[0]).offset().left):t.push($(d.ele).offset().left):d.ele instanceof Array?(t.push($(d.ele[0]).offset().left),t.push($(d.ele[0]).offset().left+$(d.ele[0]).outerWidth()+5)):(t.push($(d.ele).offset().left),t.push($(d.ele).offset().left+$(d.ele).outerWidth()+5))});let u=$("#"+h.container).offset().left;t.forEach((d,f)=>{t[f]-=u})}function y2(){if(!me.initShowsheetbarConfig){me.initShowsheetbarConfig=!0;let t={add:!0,menu:!0,sheet:!0};if(!me.showsheetbar)for(let l in t)t[l]=!1;JSON.stringify(me.showsheetbarConfig)!=="{}"&&Object.assign(t,me.showsheetbarConfig),me.showsheetbarConfig=t}let e=me.showsheetbarConfig,n=0;for(let t in e)if(!e[t])switch(t){case"add":$("#luckysheet-sheets-add").hide(),n++;break;case"menu":$("#luckysheet-sheets-m").hide(),n++;break;case"sheet":$("#luckysheet-sheet-container").hide(),$("#luckysheet-sheets-leftscroll").hide(),$("#luckysheet-sheets-rightscroll").hide(),n++;break;default:break}n===3?($("#"+h.container).find("#luckysheet-sheet-area").hide(),h.sheetBarHeight=0):($("#"+h.container).find("#luckysheet-sheet-area").show(),h.sheetBarHeight=31)}function v2(){if(!me.initStatisticBarConfig){me.initStatisticBarConfig=!0;let t={count:!0,view:!0,zoom:!0};if(!me.showstatisticBar)for(let l in t)t[l]=!1;JSON.stringify(me.showstatisticBarConfig)!=="{}"&&Object.assign(t,me.showstatisticBarConfig),me.showstatisticBarConfig=t}let e=me.showstatisticBarConfig,n=0;for(let t in e)if(!e[t])switch(t){case"count":$("#luckysheet-sta-content").hide(),n++;break;case"view":$(".luckysheet-print-viewList").hide(),n++;break;case"zoom":$("#luckysheet-zoom-content").hide(),n++;break;default:break}n===3?($("#"+h.container).find(".luckysheet-stat-area").hide(),h.statisticBarHeight=0):($("#"+h.container).find(".luckysheet-stat-area").show(),h.statisticBarHeight=23)}var jn,Qs,nr=$e(()=>{Sl();Vl();Xt();Xe();yt();gl();tl();ht();is();jn=0,Qs=0});function df(e){let n=Q(),t=n.protection,l=n.button,a=e.name,o=e.sqref,s=e.password,u="";s!=null&&s.length>0&&(u='');let d=` + ++ `;$("#luckysheet-protection-rangeItem-container").append(d)}function nc(e){let n=Q(),t=n.protection,l=n.button;$("#luckysheet-slider-protection-ok").unbind("click").click(function(){let a=$("#protection-password").val(),o=$("#protection-swichProtectionState").is(":checked"),s=$("#protection-hint").val(),u=uf,d={};u!=null&&u.config!=null&&u.config.authority!=null&&(d=u.config.authority);let f={},m="None";a!="\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"?(f.password=a,f.algorithmName="None",f.saltValue=null):d!=null?(f.algorithmName=d.algorithmName,f.saltValue=d.saltValue,f.password=d.password):(f.algorithmName="None",f.saltValue=null,f.password=""),f.hintText=s,f.sheet=o==!0?1:0;for(let y=0;y+ +++ ${a}${u} +++ ${o} +++ ++div.luckysheet-protection-rangeItem").index(o),d=Yr[u];cf=u,$("#protection-allowRangeAdd-title").val(d.name),$("#protection-allowRangeAdd-range input").val(d.sqref),d.algorithmName=="None"?$("#protection-allowRangeAdd-password").val(d.password):$("#protection-allowRangeAdd-password").val("\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"),$("#protection-allowRangeAdd-hint").val(d.hintText)}),$(document).off("click.luckysheetProtection.rangeItemDelete").on("click.luckysheetProtection.rangeItemDelete","#luckysheet-protection-rangeItem-container .luckysheet-protection-rangeItem-del",function(a){let o=$(a.target).closest(".luckysheet-protection-rangeItem"),u=$("#luckysheet-protection-rangeItem-container").find("> div.luckysheet-protection-rangeItem").index(o),d=Yr[u];Yr.splice(u,1),o.remove()}),$(document).off("click.luckysheetProtection.rangeItemConfirm").on("click.luckysheetProtection.rangeItemConfirm","#luckysheet-protection-rangeItem-confirm",function(){let a=$("#protection-allowRangeAdd-title").val(),o=$("#protection-allowRangeAdd-range input").val(),s=$("#protection-allowRangeAdd-password").val(),u=$("#protection-allowRangeAdd-hint").val();if(a.length==0){alert(t.rangeItemErrorTitleNull);return}let d=Ye.getRangeByTxt(o);if(o.length==0){alert(t.rangeItemErrorRangeNull);return}if(d.length==0){alert(t.rangeItemErrorRange);return}if(o=pf(o),tc){let f={name:a,password:s,hintText:u,algorithmName:"None",saltValue:null,checkRangePasswordUrl:null,sqref:o};df(f),Yr.push(f)}else{let f=cf,m=Yr[f];m.name=a,m.sqref=o,m.hintText=u,s!="\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"&&(m.password=s,m.algorithmName="None");let y=$("#luckysheet-protection-rangeItem-container").find("> div.luckysheet-protection-rangeItem").eq(f),v=y.find(".luckysheet-protection-rangeItem-name"),k="";s!=null&&s.length>0&&(k=''),v.html(a+k).attr("title",a),y.find(".luckysheet-protection-rangeItem-range").html(o).attr("title",o)}$("#luckysheet-protection-rangeItem-dialog").hide(),$("#luckysheet-modal-dialog-mask").hide()}),$(document).off("click.luckysheetProtection.validationConfirm").on("click.luckysheetProtection.validationConfirm","#luckysheet-protection-sheet-validation-confirm",function(a){let o=$("#luckysheet-protection-sheet-validation"),s=Co;if(s==null){ac(Co),o.hide(),$("#luckysheet-modal-dialog-mask").hide(),$("#luckysheet-modal-dialog-slider-protection").show(),$t();return}let d=o.find("input").val();if(d==null||d.length==0){alert(t.checkPasswordNullalert);return}if(s.algorithmName!=null&&s.algorithmName!="None")if(s.saltValue!=null&&s.saltValue.length>0){var f=CryptoApi.getHasher(s.algorithmName);d=CryptoApi.hmac(s.saltValue,d,f)}else d=CryptoApi.hash(s.algorithmName,d);d==s.password?(ac(Co),o.hide(),$("#luckysheet-modal-dialog-mask").hide(),$("#luckysheet-modal-dialog-slider-protection").show(),$t(),lc=!1):alert(t.checkPasswordWrongalert)}),$("#luckysheet-protection-check-selectLockedCells").change(function(){let a=$("#luckysheet-protection-check-selectLockedCells"),o=$("#luckysheet-protection-check-selectunLockedCells"),s=a.is(":checked"),u=o.is(":checked");s&&o.prop("checked",!0)}),$("#luckysheet-protection-check-selectunLockedCells").change(function(){let a=$("#luckysheet-protection-check-selectLockedCells"),o=$("#luckysheet-protection-check-selectunLockedCells"),s=a.is(":checked");o.is(":checked")||a.prop("checked",!1)}),$(document).off("click.luckysheetProtection.dvRange").on("click.luckysheetProtection.dvRange","#protection-allowRangeAdd-range .fa-table",function(a){$("#luckysheet-protection-rangeItem-dialog").hide();let o="0",s=$(this).siblings("input").val().trim();Ye.rangeDialog(o,s),Ye.selectRange=[];let u=Ye.getRangeByTxt(s);if(u.length>0)for(let d=0;d 0)for(let d=0;d + + + + ++ + + `}let o=` + + `;$("body").append(o),$("body").append(_e(ft,{id:"luckysheet-protection-sheet-validation",addclass:"luckysheet-protection-sheet-validation",title:t.validationTitle,content:` + + + `,botton:` + `,style:"z-index:100003"}))}function ac(e){e==null&&(e={});for(let a=0;a0?e.algorithmName=="None"||e.algorithmName==null?$("#protection-password").val(e.password):$("#protection-password").val("\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"):$("#protection-password").val("");let n=e.sheet;e.sheet==null&&(n=0),$("#protection-swichProtectionState").prop("checked",n==1);let t=e.hintText;t==null&&(t=""),$("#protection-hint").val(t),Yr=[],$("#luckysheet-protection-rangeItem-container").empty();let l=e.allowRangeList;if(l!=null&&l.length>0)for(let a=0;a 0){Co=n,$("#luckysheet-protection-sheet-validation input").val(""),ma("luckysheet-protection-sheet-validation");return}else ac(n)}else $("#protection-swichProtectionState").prop("checked",!0),$("#luckysheet-protection-check-selectLockedCells").prop("checked",!0),$("#luckysheet-protection-check-selectunLockedCells").prop("checked",!0),$("#luckysheet-protection-check-formatCells").prop("checked",!0),$("#luckysheet-protection-check-formatColumns").prop("checked",!0),$("#luckysheet-protection-check-formatRows").prop("checked",!0),$("#luckysheet-protection-check-insertColumns").prop("checked",!0),$("#luckysheet-protection-check-insertRows").prop("checked",!0),$("#luckysheet-protection-check-deleteColumns").prop("checked",!0),$("#luckysheet-protection-check-insertHyperlinks").prop("checked",!0),$("#luckysheet-protection-check-deleteRows").prop("checked",!0),$("#luckysheet-protection-check-sort").prop("checked",!0),$("#luckysheet-protection-check-filter").prop("checked",!0),$("#luckysheet-protection-check-usePivotTablereports").prop("checked",!0),$("#luckysheet-protection-check-editObjects").prop("checked",!0),$("#luckysheet-protection-check-editScenarios").prop("checked",!0),b2();$("#luckysheet-modal-dialog-slider-protection").show(),$t()}function b2(){Yr=[],$("#luckysheet-protection-rangeItem-container").empty()}function mf(){$("#luckysheet-protection-rangeItem-dialog").hide(),$("#luckysheet-modal-dialog-slider-protection").hide(),$t()}function ic(e,n,t,l,a=!0,o=!0){let s=!1,u=t.allowRangeList;if(u!=null&&u.length>0){let d=!1;for(let f=0;f 0)for(let v=0;v =k&&e<=b&&n>=w&&n<=x){d=!0;break}}if(d){let v=m.password;if(v!=null&&v.length>0&&!(g in rc))return a&&(w2(m),$("#luckysheet-selection-copy .luckysheet-selection-copy").hide()),!1;s=!0;break}}}if(!s&&!o&&(s=!0),!s&&a){let d;t.hintText!=null&&t.hintText.length>0?d=t.hintText:d=l.defaultSheetHintText,U.info("",d),$("#luckysheet-selection-copy .luckysheet-selection-copy").hide()}return s}function w2(e){let n=Q(),t=n.protection,l=n.button;hf||$("body").append(_e(ft,{id:"luckysheet-protection-range-validation",addclass:"luckysheet-protection-sheet-validation",title:t.validationTitle,content:` + + + `,botton:` + `,style:"z-index:100003"})),hf=!0,ma("luckysheet-protection-range-validation");let a=$("#luckysheet-protection-range-validation-hint");e.hintText!=null&&e.hintText.length>0?a.html(e.hintText):a.html(t.defaultRangeHintText);let o=$("#luckysheet-protection-range-validation"),s=o.find("input");s.val(""),$("#luckysheet-protection-range-validation-confirm").off("click").on("click",function(){let u=s.val();if(u==null||u.length==0){alert(t.checkPasswordNullalert);return}if(e.algorithmName!=null&&e.algorithmName!="None")if(e.saltValue!=null&&e.saltValue.length>0){var d=CryptoApi.getHasher(e.algorithmName);u=CryptoApi.hmac(e.saltValue,u,d)}else u=CryptoApi.hash(e.algorithmName,u);u==e.password?(rc[e.sqref]=1,o.hide(),$("#luckysheet-modal-dialog-mask").hide(),alert(t.checkPasswordSucceedalert)):alert(t.checkPasswordWrongalert)})}function Ur(e){let n=ve.getSheetByIndex(e);if(n==null||n.config==null||n.config.authority==null)return!0;let t=n.config.authority;if(t==null||t.sheet==null||t.sheet==0)return!0;let a=Q().protection,o;return t.hintText!=null&&t.hintText.length>0?o=t.hintText:o=a.defaultSheetHintText,U.info("",o),!1}function xn(e,n,t,l=!0,a=!0){let o=ve.getSheetByIndex(t);if(o==null||o.config==null||o.config.authority==null)return!0;let s=o.data,u=s[e][n],d=o.config.authority;if(d==null||d.sheet==null||d.sheet==0||u&&u.lo===0)return!0;let m=Q().protection;return ic(e,n,d,m,l,a)}function So(e,n,t){let l=ve.getSheetByIndex(t);if(!l||l.data&&!l.data[e]||l.data&&!l.data[e][n]||l.config==null||l.config.authority==null)return!0;let a=l.data,o=a[e][n],s=l.config.authority;return s==null||s.sheet==null||s.sheet==0||o==null||o.hi==null||o.hi==0}function kr(e,n){let t=ve.getSheetByIndex(n);if(t==null||t.config==null||t.config.authority==null)return!0;let l=t.config.authority;if(l==null||l.sheet==null||l.sheet==0||e==null||e.length==0)return!0;let o=Q().protection;for(let s=0;s0?o=t.hintText:o=a.defaultSheetHintText,U.info("",o),!1}function It(e,n="formatColumns",t=!0){let l=ve.getSheetByIndex(e);if(l==null||l.config==null||l.config.authority==null)return!0;let a=l.config.authority;if(a==null||a.sheet==null||a.sheet==0||a[n]==1||a[n]==null)return!0;if(t){let s=Q().protection,u;a.hintText!=null&&a.hintText.length>0?u=a.hintText:u=s.defaultSheetHintText,U.info("",u)}return!1}var of,sf,Yr,tc,cf,Co,uf,lc,rc,hf,Ga,_l=$e(()=>{Xe();yt();Wt();Dt();Rn();gl();nr();vr();ht();Jt();tl();qr();of=!1,sf=!1,Yr=[],tc=!0,cf=null,Co=null,uf=null,lc=!0,rc={},hf=!1,Ga=["selectLockedCells","selectunLockedCells","formatCells","formatColumns","formatRows","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","filter","usePivotTablereports","editObjects","editScenarios"]});function Vr(e,n,t){t==null&&(t=!0);let l=function(o,s){let u=o[n],d=s[n];if(P(o[n])=="object"&&(u=o[n].v),P(s[n])=="object"&&(d=s[n].v),fe(u))return 1;if(fe(d))return-1;if(Ot(u)&&Ot(d))return ul(u,d);if(B(u)&&B(d))return(0,_n.default)(u).value()-(0,_n.default)(d).value();if(!B(u)&&!B(d))return u.localeCompare(d,"zh");if(B(u)){if(!B(d))return-1}else return 1},a=function(o,s){let u=o[n],d=s[n];if(P(o[n])=="object"&&(u=o[n].v),P(s[n])=="object"&&(d=s[n].v),fe(u))return 1;if(fe(d))return-1;if(Ot(u)&&Ot(d))return ul(d,u);if(B(u)&&B(d))return(0,_n.default)(d).value()-(0,_n.default)(u).value();if(!B(u)&&!B(d))return d.localeCompare(u,"zh");if(B(u)){if(!B(d))return 1}else return-1};return t?e.sort(l):e.sort(a)}function xo(e,n){n==null&&(n=!0);let t=function(a,o){let s=a,u=o;if(P(a)=="object"&&(s=a.v),P(o)=="object"&&(u=o.v),s==null&&(s=""),u==null&&(u=""),Ot(s)&&Ot(u))return ul(s,u);if(B(s)&&B(u))return(0,_n.default)(s).value()-(0,_n.default)(u).value();if(!B(s)&&!B(u))return s.localeCompare(u,"zh");if(B(s)){if(!B(u))return-1}else return 1},l=function(a,o){let s=a,u=o;if(P(a)=="object"&&(s=a.v),P(o)=="object"&&(u=o.v),s==null&&(s=""),u==null&&(u=""),Ot(s)&&Ot(u))return ul(u,s);if(B(s)&&B(u))return(0,_n.default)(u).value()-(0,_n.default)(s).value();if(!B(s)&&!B(u))return u.localeCompare(s,"zh");if(B(s)){if(!B(u))return 1}else return-1};return n?e.sort(t):e.sort(l)}function sc(e){if(!It(h.currentSheetIndex,"sort"))return;let t=Q().sort;if(h.luckysheet_select_save.length>1){de()?alert(t.noRangeError):U.info(t.noRangeError,"");return}e==null&&(e=!0);let l=we.deepCopyFlowData(h.flowdata),a=h.luckysheet_select_save[0].row[0],o=h.luckysheet_select_save[0].row[1],s=h.luckysheet_select_save[0].column[0],u=h.luckysheet_select_save[0].column[1],d,f;for(let v=a;v<=o;v++)if(l[v]!=null&&l[v][s]!=null){let k=l[v][s];if(k.mc!=null||fe(k.v))continue;if(d==null&&/[\u4e00-\u9fa5]+/g.test(k.v)){d=v+1,f=v+1;continue}d==null&&(d=v),f=v}if(d==null||d>o)return;let m=!1,g=[];for(let v=d;v<=f;v++){let k=[];for(let b=s;b<=u;b++){if(l[v][b]!=null&&l[v][b].mc!=null){m=!0;break}k.push(l[v][b])}g.push(k)}if(m){de()?alert(t.mergeError):U.info(t.mergeError,"");return}g=Vr(g,0,e);for(let v=d;v<=f;v++)for(let k=s;k<=u;k++)l[v][k]=g[v-d][k-s];let y={};if(h.config.rowlen!=null){let v=$.extend(!0,{},h.config);v=yl(l,d,f,v),y={cfg:v,RowlChange:!0}}Ze(l,[{row:[d,f],column:[s,u]}],y)}function cc(e,n){if(!It(h.currentSheetIndex,"sort"))return;n==null&&(n=!0);let l=Q().sort,a=we.deepCopyFlowData(h.flowdata),o=0,s=a.length-1,u=0,d=a[0].length-1,f,m;for(let k=o;k<=s;k++)if(!(a[k][e]!=null&&a[k][e].mc!=null)){if(a[k][e]!=null&&!fe(a[k][e].v)&&/[\u4e00-\u9fa5]+/g.test(a[k][e].v)&&f==null){f=k+1,m=k+1;continue}f==null&&(f=k),a[k][e]!=null&&!fe(a[k][e].v)&&(m=k)}if(f==null||f>s)return;let g=!1,y=[];for(let k=f;k<=m;k++){let b=[];for(let w=u;w<=d;w++){if(a[k][w]!=null&&a[k][w].mc!=null){g=!0;break}b.push(a[k][w])}y.push(b)}if(g){de()?alert(l.columnSortMergeError):U.info(l.columnSortMergeError,"");return}y=Vr(y,e,n);for(let k=f;k<=m;k++)for(let b=u;b<=d;b++)a[k][b]=y[k-f][b-u];let v={};if(h.config.rowlen!=null){let k=$.extend(!0,{},h.config);k=yl(a,f,m,k),v={cfg:k,RowlChange:!0}}Ze(a,[{row:[f,m],column:[u,d]}],v)}var _n,ha=$e(()=>{ht();Pt();Br();tl();Qt();pr();Xt();_l();Xe();yt();_n=Nl(ca())});var x2,gf,yf=$e(()=>{Zt();x2={transpose:function(e,n=!0){let t=[];if(e.length==0)return[];if(e[0].length==0)return[];for(let l=0;l e.row[1]||n.row[1] e.column[1]||n.column[1] e.column[0]&&n.column[1] e.row[0]&&n.row[1] e.row[0]&&n.row[0] e.column[0]&&n.column[1] e.column[0]&&n.column[0] {ht();_2={STDEVP:function(e,n){let t=0;for(let l=0;l {Dt();ht();Zt();Br();Ml();Pt();ha();Xt();tl();Qt();qr();yf();vf();Jt();zr();Wt();gl();nr();ll();_l();Xe();yt();Ni=Nl(ca());Wt();kf={pivotDatas:null,pivotSheetIndex:0,pivotDataSheetIndex:0,celldata:null,origindata:null,getCellData:function(e,n,t){let l=this,a;e!=null?a=e:a=h.currentSheetIndex;let o=K(a);P(h.luckysheetfile[o].pivotTable)!="object"&&(h.luckysheetfile[o].pivotTable=new Function("return "+h.luckysheetfile[o].pivotTable)()),h.luckysheetfile[o].pivotTable!=null?(l.column=h.luckysheetfile[o].pivotTable.column,l.row=h.luckysheetfile[o].pivotTable.row,l.values=h.luckysheetfile[o].pivotTable.values,l.filter=h.luckysheetfile[o].pivotTable.filter,l.showType=h.luckysheetfile[o].pivotTable.showType,l.filterparm=h.luckysheetfile[o].pivotTable.filterparm,h.luckysheetfile[o].pivotTable.drawPivotTable!=null?l.drawPivotTable=h.luckysheetfile[o].pivotTable.drawPivotTable:l.drawPivotTable=!0,h.luckysheetfile[o].pivotTable.pivotTableBoundary!=null?l.pivotTableBoundary=h.luckysheetfile[o].pivotTable.pivotTableBoundary:l.pivotTableBoundary=[12,6],t!=null?l.pivot_select_save=t:l.pivot_select_save=h.luckysheetfile[o].pivotTable.pivot_select_save,n!=null?l.pivotDataSheetIndex=n:l.pivotDataSheetIndex=h.luckysheetfile[o].pivotTable.pivotDataSheetIndex):(l.column=null,l.row=null,l.values=null,l.filter=null,l.showType=null,l.filterparm=null,l.drawPivotTable=!0,l.pivotTableBoundary=[12,6],t!=null?l.pivot_select_save=t:l.pivot_select_save=h.luckysheet_select_save,n!=null?l.pivotDataSheetIndex=n:l.pivotDataSheetIndex=a);let s=K(l.pivotDataSheetIndex),u=h.luckysheetfile[s];u.data==null&&(u.data=ve.buildGridData(u)),l.origindata=oa(u.data,l.pivot_select_save);let d={};if(l.filterparm!=null)for(let m in l.filterparm)for(let g in l.filterparm[m])g==="rowhidden"&&l.filterparm[m][g]!=null&&(d=$.extend(!0,d,l.filterparm[m][g]));l.rowhidden=d,l.pivotSheetIndex=a;let f=[];for(let m=0;m =2?($("#luckysheetpivottablevaluecolrowshow").show(),e.showType=="column"?($("#luckysheetpivottablevaluecolrow").prop("checked",!0),$("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow']").addClass("ui-state-active"),$("#luckysheetpivottablevaluecolrow1").prop("checked",!1),$("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow1']").removeClass("ui-state-active")):($("#luckysheetpivottablevaluecolrow1").prop("checked",!0),$("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow1']").addClass("ui-state-active"),$("#luckysheetpivottablevaluecolrow").prop("checked",!1),$("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow']").removeClass("ui-state-active"))):$("#luckysheetpivottablevaluecolrowshow").hide()},resetOrderby:function(e){let n=$("#luckysheet-modal-dialog-config-value .luckysheet-modal-dialog-slider-config-item").index(e);$("#luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column").find(".luckysheet-modal-dialog-slider-config-item").each(function(){$(this).data("orderby")==n&&$(this).data("orderby","self")})},luckysheetsliderlistclearfilter:function(e){let n=this,t=e.parent(),l=t.data("index"),a={},o={},s=n.origindata,u={};t.data("rowhidden","").find(".luckysheet-slider-list-item-filtered").hide(),n.setDatatojsfile("selected",{},l),n.setDatatojsfile("rowhidden",null,l);let d=[];for(let f=0;f 2)for(let T in b){let A=0,R="";for(let F in b[T]){let z=0,M="";for(let E in b[T][F]){let L=b[T][F][E];z+=L;let O;Number(F)<10?O="0"+Number(F):O=F;let V;Number(E)<10?V="0"+Number(E):V=E,T in w&&F in w&&E in w?M+=' ( '+L+" )":M+='( '+L+" )"}A+=z;let N;Number(F)<10?N="0"+Number(F):N=F,T in w&&F in w?R+='":R+='( '+z+' )'+M+""}let I;T in w?I='( '+z+' )'+M+"":I='( '+A+' )'+R+"",S.unshift(I)}if(JSON.stringify(x).length>2){let T=Object.keys(x);T=xo(T,!0);for(let A=0;A( '+A+' )'+R+"( '+x[R][I]+" )":z=' ( '+x[R][I]+" )",S.push(z)}}}let _=u-o.top-350;_<0&&(_=100),$("#luckysheet-pivotTableFilter-byvalue-select").append(" "),y.close()},1),un(s,o.left-250,o.top)},getSumTypeName:function(e){let n="",l=Q().pivotTable;return e=="SUM"?n=l.valueStatisticsSUM:e=="COUNT"?n=l.valueStatisticsCOUNT:e=="COUNTA"?n=l.valueStatisticsCOUNTA:e=="COUNTUNIQUE"?n=l.valueStatisticsCOUNTUNIQUE:e=="AVERAGE"?n=l.valueStatisticsAVERAGE:e=="MAX"?n=l.valueStatisticsMAX:e=="MIN"?n=l.valueStatisticsMIN:e=="MEDIAN"?n=l.valueStatisticsMEDIAN:e=="PRODUCT"?n=l.valueStatisticsPRODUCT:e=="STDEV"?n=l.valueStatisticsSTDEV:e=="STDEVP"?n=l.valueStatisticsSTDEVP:e=="let"?n=l.valueStatisticslet:e=="VARP"&&(n=l.valueStatisticsVARP),n},setDatatojsfile:function(e,n,t){let l=this,a=K(l.pivotSheetIndex);h.luckysheetfile[a].pivotTable==null&&(h.luckysheetfile[a].pivotTable={}),t==null?(h.luckysheetfile[a].pivotTable[e]=n,l[e]=n):(h.luckysheetfile[a].pivotTable.filterparm==null&&(h.luckysheetfile[a].pivotTable.filterparm={}),h.luckysheetfile[a].pivotTable.filterparm[t.toString()]==null&&(h.luckysheetfile[a].pivotTable.filterparm[t.toString()]={}),h.luckysheetfile[a].pivotTable.filterparm[t.toString()][e]=n,l.filterparm==null&&(l.filterparm={}),l.filterparm[t.toString()]==null&&(l.filterparm[t.toString()]={}),l.filterparm[t.toString()][e]=n)},createPivotTable:function(e){if(de()||h.allowEdit===!1)return;let n=this,t=h.currentSheetIndex,a=Q().pivotTable;if(de()){alert(a.errorNotAllowEdit);return}if(h.luckysheet_select_save.length>1){U.info("",a.errorNotAllowMulti);return}if(h.luckysheet_select_save.length==0||h.luckysheet_select_save[0].row[0]==h.luckysheet_select_save[0].row[1]||h.luckysheet_select_save[0].column[0]==h.luckysheet_select_save[0].column[1]){U.info("",a.errorSelectRange);return}let o=$.extend(!0,{},h.luckysheet_select_save[0]);ve.addNewSheet(e,!0),n.getCellData(h.currentSheetIndex,t,o),n.setDatatojsfile("pivot_select_save",o),n.setDatatojsfile("pivotDataSheetIndex",t),n.initialPivotManage()},changePivotTable:function(e){let n=this,l=Q().pivotTable,a=h.luckysheetfile[K(e)].pivotTable.pivotDataSheetIndex;if(K(a)==null){U.info(l.errorIsDamage,"");return}n.getCellData(e),n.initialPivotManage(!0),n.refreshPivotTable()},refreshPivotTable:function(e=!0){let n=this,t={};t.pivotTable=kf,t.data=we.deepCopyFlowData(h.flowdata),n.storePivotTableParam();let l=n.dataHandler(n.column,n.row,n.values,n.showType,n.celldata);n.setDatatojsfile("pivotDatas",l);let a=$.extend(!0,[],ve.nulldata),o=a,s=0,u=0;if(l.length==0)n.setDatatojsfile("drawPivotTable",!0),n.setDatatojsfile("pivotTableBoundary",[12,6]);else{n.setDatatojsfile("drawPivotTable",!1),n.setDatatojsfile("pivotTableBoundary",[l.length,l[0].length]);let d=l.length,f=l[0].length;s=d-a.length,u=f-a[0].length,o=Vt(a,s+20,u+10,!0);for(let m=0;m0||u>0?Rl(o[0].length,o.length,o,null,h.luckysheet_select_save,"datachangeAll",void 0,void 0,e):(Ze(o,h.luckysheet_select_save,{},null,e),tt()),h.clearjfundo=!0},drawPivotTable:!0,pivotTableBoundary:[12,6],pivotclick:function(e,n,t){t==null&&(t=h.currentSheetIndex);let l=h.luckysheetfile[K(t)];if(!l.isPivotTable)return;let a=l.pivotTable.pivotDataSheetIndex;if(K(a)==null)return;let s=$("#luckysheet-modal-dialog-slider-pivot"),u=this.isPivotRange(e,n);if(u&&s.is(":hidden")){if(!It(t,"usePivotTablereports",!1))return;s.show(),$t(),$("#luckysheet-sta-content").css("padding-right",260)}else!u&&s.is(":visible")&&(s.hide(),$t(),$("#luckysheet-sta-content").css("padding-right",10))},isPivotRange:function(e,n){let t=this;if(h.luckysheetcurrentisPivotTable)return e 0){for(let o=0;o 0)return e;for(let o=0;o ',botton:'"})),$("body").append(_e(Xi(),{menuid:"pivotTableFilter"})),$("body").append(_e(Ki(),{menuid:"pivotTableFilter"})),$("body").append(Au()),$("body").append(Du()),$("#luckysheet-pivotTableFilter-orderby-asc").remove(),$("#luckysheet-pivotTableFilter-orderby-desc").next().remove(),$("#luckysheet-pivotTableFilter-orderby-desc").remove(),$("#luckysheet-pivotTableFilter-orderby-color").next().remove(),$("#luckysheet-pivotTableFilter-orderby-color").remove(),$("#luckysheetpivottablevaluecolrow, #luckysheetpivottablevaluecolrow1").checkboxradio({icon:!1}).change(function(){n.refreshPivotTable()});let m=null;$("#luckysheet-pivotTableFilter-menu").mouseover(function(){clearTimeout(m),m=setTimeout(function(){$("#luckysheet-pivotTableFilter-submenu").hide()},500)}),$(document).off("click.ptFilterCheckbox1").on("click.ptFilterCheckbox1","#luckysheet-pivotTableFilter-byvalue-select .textBox",function(){$(this).attr("data-check")=="true"?($(this).attr("data-check","false"),$(this).find("input[type='checkbox']").removeAttr("checked")):($(this).attr("data-check","true"),$(this).find("input[type='checkbox']").prop("checked",!0))}),$(document).off("click.ptFilterCheckbox2").on("click.ptFilterCheckbox2","#luckysheet-pivotTableFilter-byvalue-select .year",function(){$(this).attr("data-check")=="true"?($(this).attr("data-check","false"),$(this).parents(".yearBox").find(".month").attr("data-check","false"),$(this).parents(".yearBox").find(".day").attr("data-check","false"),$(this).parents(".yearBox").find("input[type='checkbox']").removeAttr("checked")):($(this).attr("data-check","true"),$(this).parents(".yearBox").find(".month").attr("data-check","true"),$(this).parents(".yearBox").find(".day").attr("data-check","true"),$(this).parents(".yearBox").find("input[type='checkbox']").prop("checked",!0))}),$(document).off("click.ptFilterCheckbox3").on("click.ptFilterCheckbox3","#luckysheet-pivotTableFilter-byvalue-select .month",function(){$(this).attr("data-check")=="true"?($(this).attr("data-check","false"),$(this).parents(".monthBox").find(".day").attr("data-check","false"),$(this).parents(".monthBox").find("input[type='checkbox']").removeAttr("checked")):($(this).attr("data-check","true"),$(this).parents(".monthBox").find(".day").attr("data-check","true"),$(this).parents(".monthBox").find("input[type='checkbox']").prop("checked",!0));let g=!0;$(this).parents(".yearBox").find(".day").each(function(v,k){$(k).attr("data-check")=="true"||(g=!1)}),g?($(this).parents(".yearBox").find(".year").attr("data-check","true"),$(this).parents(".yearBox").find(".year input[type='checkbox']").prop("checked",!0)):($(this).parents(".yearBox").find(".year").attr("data-check","false"),$(this).parents(".yearBox").find(".year input[type='checkbox']").removeAttr("checked"))}),$(document).off("click.ptFilterCheckbox4").on("click.ptFilterCheckbox4","#luckysheet-pivotTableFilter-byvalue-select .day",function(){$(this).attr("data-check")=="true"?($(this).attr("data-check","false"),$(this).find("input[type='checkbox']").removeAttr("checked")):($(this).attr("data-check","true"),$(this).find("input[type='checkbox']").prop("checked",!0));let g=!0;$(this).parents(".monthBox").find(".day").each(function(b,w){$(w).attr("data-check")=="true"||(g=!1)}),g?($(this).parents(".monthBox").find(".month").attr("data-check","true"),$(this).parents(".monthBox").find(".month input[type='checkbox']").prop("checked",!0)):($(this).parents(".monthBox").find(".month").attr("data-check","false"),$(this).parents(".monthBox").find(".month input[type='checkbox']").removeAttr("checked"));let v=!0;$(this).parents(".yearBox").find(".day").each(function(b,w){$(w).attr("data-check")=="true"||(v=!1)}),v?($(this).parents(".yearBox").find(".year").attr("data-check","true"),$(this).parents(".yearBox").find(".year input[type='checkbox']").prop("checked",!0)):($(this).parents(".yearBox").find(".year").attr("data-check","false"),$(this).parents(".yearBox").find(".year input[type='checkbox']").removeAttr("checked"))}),$(document).off("click.ptFilterYearDropdown").on("click.ptFilterYearDropdown","#luckysheet-pivotTableFilter-byvalue-select .yearBox .fa-caret-right",function(){let g=$(this).parents(".luckysheet-mousedown-cancel");g.hasClass("year")&&$(this).parents(".yearBox").find(".monthList").slideToggle(),g.hasClass("month")&&$(this).parents(".monthBox").find(".dayList").slideToggle()}),$("#luckysheet-pivotTableFilter-byvalue-btn-all").click(function(){$("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']").prop("checked",!0),$("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']").parents(".luckysheet-mousedown-cancel").attr("data-check","true")}),$("#luckysheet-pivotTableFilter-byvalue-btn-contra").click(function(){$("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']").each(function(k,b){$(b).is(":checked")?($(b).removeAttr("checked"),$(b).parents(".luckysheet-mousedown-cancel").attr("data-check","false")):($(b).prop("checked",!0),$(b).parents(".luckysheet-mousedown-cancel").attr("data-check","true"))}),$("#luckysheet-pivotTableFilter-byvalue-select .ListBox .monthBox").each(function(k,b){let w=!0;$(b).find(".day input[type='checkbox']").each(function(C,S){$(S).is(":checked")||(w=!1)}),w?($(b).find(".month input[type='checkbox']").prop("checked",!0),$(b).attr("data-check","true")):($(b).find(".month input[type='checkbox']").removeAttr("checked"),$(b).attr("data-check","false"))}),$("#luckysheet-pivotTableFilter-byvalue-select .ListBox .yearBox").each(function(k,b){let w=!0;$(b).find(".day input[type='checkbox']").each(function(C,S){$(S).is(":checked")||(w=!1)}),w?($(b).find(".year input[type='checkbox']").prop("checked",!0),$(b).attr("data-check","true")):($(b).find(".year input[type='checkbox']").removeAttr("checked"),$(b).attr("data-check","false"))})}),$("#luckysheet-pivotTableFilter-byvalue-btn-clear").click(function(){$("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']").removeAttr("checked"),$("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']").parents(".luckysheet-mousedown-cancel").attr("data-check","false")}),$("#luckysheet-pivotTableFilter-byvalue-input").on("input propertychange",function(){let g=$(this).val().toString();$("#luckysheet-pivotTableFilter-byvalue-select .ListBox .luckysheet-mousedown-cancel").show(),g!=""&&$("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']").each(function(v,k){let b=$(k).parents(".luckysheet-mousedown-cancel");if(b.hasClass("day")){let w=$(k).siblings("label").text().toString(),x=$(k).parents(".monthBox").find(".month label").text().toString();($(k).parents(".yearBox").find(".year label").text().toString()+"-"+x+"-"+w).indexOf(g)==-1&&($(k).parents(".day").hide(),$(k).parents(".dayList").find(".day:visible").length==0&&$(k).parents(".monthBox").find(".month").hide(),$(k).parents(".monthList").find(".day:visible").length==0&&$(k).parents(".yearBox").find(".year").hide())}b.hasClass("textBox")&&$(k).siblings("label").text().toString().indexOf(g)==-1&&$(k).parents(".textBox").hide()})}),$("#luckysheet-pivotTableFilter-bycondition, #luckysheet-pivotTableFilter-byvalue").click(function(){let g=$(this);g.next().slideToggle(200),setTimeout(function(){g.attr("id")=="luckysheet-pivotTableFilter-bycondition"&&$("#luckysheet-pivotTableFilter-bycondition").next().is(":visible")&&$("#luckysheet-pivotTableFilter-selected span").text()!=o.filiterInputNone&&$("#luckysheet-pivotTableFilter-byvalue").next().slideUp(200),g.is($("#luckysheet-pivotTableFilter-bycondition"))&&$("#luckysheet-pivotTableFilter-bycondition").next().is(":hidden")&&$("#luckysheet-pivotTableFilter-byvalue").next().is(":hidden")&&$("#luckysheet-pivotTableFilter-byvalue").next().slideDown(200)},300)}),$("#luckysheet-pivotTableFilter-cancel").click(function(){$("#luckysheet-pivotTableFilter-menu, #luckysheet-pivotTableFilter-submenu").hide()}),$("#luckysheet-pivotTableFilter-selected").click(function(){let g=$(this),y=g.offset(),v=$("#luckysheet-pivotTableFilter-submenu");v.hide();let k=$(window).height(),b=$(window).width(),w=v.width(),x=v.height(),C=y.top,S=y.left,_=k-y.top-20;y.left+w>b&&(S=y.left-w),y.top>k/2&&(C=k-y.top,C<0&&(C=0),_=y.top-20),v.css({top:C,left:S,height:_}).show(),clearTimeout(m)}),$("#luckysheet-pivotTableFilter-submenu").mouseover(function(){clearTimeout(m)}).find(".luckysheet-cols-menuitem").click(function(g){$("#luckysheet-pivotTableFilter-selected span").html($(this).find(".luckysheet-cols-menuitem-content").text()).data("value",$(this).data("value")),$("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input").hide(),$(this).data("type")=="2"?($("#luckysheet-pivotTableFilter-selected span").data("type","2"),$("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input2").show()):$(this).data("type")=="0"?$("#luckysheet-pivotTableFilter-selected span").data("type","0"):($("#luckysheet-pivotTableFilter-selected span").data("type","1"),$("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input").eq(0).show(),$(this).attr("data-value")=="dateequal"||$(this).attr("data-value")=="datelessthan"||$(this).attr("data-value")=="datemorethan"?$("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input input").prop("type","date"):$("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input input").prop("type","text")),$("#luckysheet-pivotTableFilter-byvalue").next().slideUp(),$("#luckysheet-pivotTableFilter-submenu").hide()}),$("#luckysheet-modal-dialog-pivotTable-list").on("click"," .luckysheet-slider-list-item-filter",function(g){return n.luckysheetsliderlistitemfilter($(this)),g.stopPropagation(),!1}),$("#luckysheet-modal-dialog-pivotTable-list").on("click"," .luckysheet-slider-list-item-filtered",function(g){return n.luckysheetsliderlistclearfilter($(this).next()),g.stopPropagation(),!1}),$("#luckysheet-dialog-pivotTable-range-seleted").click(function(){$("#luckysheet-modal-dialog-slider-pivot").hide(),$t();let g=$("#luckysheet-data-pivotTable-selection"),y=g.outerHeight(),v=g.outerWidth(),k=$(window).width(),b=$(window).height(),w=$(document).scrollLeft(),x=$(document).scrollTop();$("#luckysheet-data-pivotTable-selection").css({left:(k+w-v)/2,top:(b+x-y)/4}).show(),n.jgridCurrentPivotInput=$("#luckysheet-dialog-pivotTable-range").html(),$("#luckysheet-pivotTable-range-selection-input").val(n.jgridCurrentPivotInput),n.luckysheet_pivotTable_select_state=!0}),$("#luckysheet-pivotTableFilter-initial").click(function(){$("#luckysheet-modal-dialog-pivotTable-list .luckysheet-slider-list-item-filtered").hide(),$("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").data("rowhidden",""),$("#luckysheet-pivotTableFilter-menu, #luckysheet-pivotTableFilter-submenu").hide(),$("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input").hide().find("input").val(),$("#luckysheet-pivotTableFilter-selected span").data("type","0").data("type",null).text(o.filiterInputNone),n.setDatatojsfile("filterparm",null),n.celldata=n.origindata,n.refreshPivotTable()}),$("#luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column").on("click",".luckysheet-modal-dialog-slider-config-item-icon",function(g){let y=$(g.target),v=y.closest(".luckysheet-modal-dialog-slider-config-item"),k=v.data("index"),b=v.offset(),w=v.data("order"),x=v.data("orderby"),C=v.data("stastic");w==null&&(w="default");let S='";return $("#luckysheet-modal-dialog-config-value .luckysheet-modal-dialog-slider-config-item").each(function(_){S+='"}),$("#luckysheet-pivotTable-config-option-orderby").empty().html(S),x==null&&(x="self"),C==null&&(C="1"),$("#luckysheet-pivotTable-config-option-order").val(w).data("index",k),$("#luckysheet-pivotTable-config-option-orderby").val(x).data("index",k),$("#luckysheet-pivotTable-config-option-stastic").val(C).data("index",k),ml($("#luckysheet-pivotTable-config-option"),b.left+v.outerWidth(),b.top-13,"rightbottom"),g.stopPropagation(),!1}),$("#luckysheet-pivotTable-config-option-order,#luckysheet-pivotTable-config-option-orderby,#luckysheet-pivotTable-config-option-stastic").change(function(){let g=$(this),y=g.data("index");$("#luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column").find(".luckysheet-modal-dialog-slider-config-item").each(function(){$(this).data("index")==y&&$(this).data(g.attr("id").replace("luckysheet-pivotTable-config-option-",""),g.val())}),n.refreshPivotTable()}),$("#luckysheet-modal-dialog-config-value").on("click",".luckysheet-modal-dialog-slider-config-item-icon",function(g){let y=$(g.target),v=y.closest(".luckysheet-modal-dialog-slider-config-item"),k=v.data("index"),b=v.offset(),w=v.data("sumtype"),x=n.pivot_data_type[k.toString()];w==null&&(x=="num"?w="SUM":w="COUNTA");let C=$("#luckysheet-pivotTable-config-option-sumtype");return C.find(".luckysheet-submenu-arrow").hide(),C.find(".luckysheet-cols-menuitem[sumtype='"+w+"'] .luckysheet-submenu-arrow").css("display","inline"),C.data("item",v),ml(C,b.left+v.outerWidth(),b.top-13,"rightbottom"),g.stopPropagation(),!1}),$("#luckysheet-pivotTable-config-option-sumtype .luckysheet-cols-menuitem").click(function(){let g=$("#luckysheet-pivotTable-config-option-sumtype").data("item"),y=$(this).attr("sumtype");g.data("sumtype",$(this).attr("sumtype"));let v=n.getSumTypeName(y)+":"+g.data("name");g.attr("title",v).find(".luckysheet-modal-dialog-slider-config-item-txt").html(v),$("#luckysheet-pivotTable-config-option-sumtype").hide(),n.refreshPivotTable()}),$("#luckysheet-modal-dialog-config-filter").on("click",".luckysheet-modal-dialog-slider-config-item-icon",function(g){let y=$(g.target),v=y.closest(".luckysheet-modal-dialog-slider-config-item").data("index");return n.luckysheetsliderlistitemfilter($("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").eq(v).find(".luckysheet-slider-list-item-filter")),g.stopPropagation(),!1}),$("#luckysheet-pivotTableFilter-confirm").click(function(){let y=$("#luckysheet-pivotTableFilter-menu").data("index"),v={};$("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").each(function(){let _=$(this),T=_.data("rowhidden");if(_.data("index")!=y){if(T==null||T=="")return!0;P(T)=="string"&&(T=JSON.parse(T));for(let A in T)v[A]=0}});let k=n.origindata,b={},w={},x={};if($("#luckysheet-pivotTableFilter-bycondition").next().is(":visible")&&$("#luckysheet-pivotTableFilter-byvalue").next().is(":hidden")&&$("#luckysheet-pivotTableFilter-selected span").data("value")!="null"){let _=$("#luckysheet-pivotTableFilter-selected span"),T=_.data("type"),A=_.data("value");if(x.value=A,x.text=_.text(),T=="0")x.type="0";else if(T=="2"){let R=$("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input2 input");x.type="2",x.value1=R.eq(0).val(),x.value2=R.eq(1).val()}else x.type="1",x.value1=$("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input").eq(0).find("input").val();for(let R=1;R -1&&(w[R]=0)}else if(A=="textstart"){let F=x.value1,z=F.length;(I==null||fe(I.v)||I.m.substr(0,z)!=F)&&(w[R]=0)}else if(A=="textend"){let F=x.value1,z=F.length;(I==null||fe(I.v)||z>I.m.length||I.m.substr(I.m.length-z,z)!=F)&&(w[R]=0)}else if(A=="textequal"){let F=x.value1;(I==null||fe(I.v)||I.m!=F)&&(w[R]=0)}else if(A=="dateequal"){let F=it(x.value1)[2];I==null||fe(I.v)?w[R]=0:I.ct!=null&&I.ct.t=="d"?parseInt(I.v)!=F&&(w[R]=0):w[R]=0}else if(A=="datelessthan"){let F=it(x.value1)[2];I==null||fe(I.v)?w[R]=0:I.ct!=null&&I.ct.t=="d"?parseInt(I.v)>=F&&(w[R]=0):w[R]=0}else if(A=="datemorethan"){let F=it(x.value1)[2];I==null||fe(I.v)?w[R]=0:I.ct!=null&&I.ct.t=="d"?parseInt(I.v)<=F&&(w[R]=0):w[R]=0}else if(A=="morethan"){let F=parseFloat(x.value1);I==null||fe(I.v)?w[R]=0:I.ct!=null&&I.ct.t=="n"?I.v<=F&&(w[R]=0):w[R]=0}else if(A=="moreequalthan"){let F=parseFloat(x.value1);I==null||fe(I.v)?w[R]=0:I.ct!=null&&I.ct.t=="n"?I.v =F&&(w[R]=0):w[R]=0}else if(A=="lessequalthan"){let F=parseFloat(x.value1);I==null||fe(I.v)?w[R]=0:I.ct!=null&&I.ct.t=="n"?I.v>F&&(w[R]=0):w[R]=0}else if(A=="equal"){let F=parseFloat(x.value1);I==null||fe(I.v)?w[R]=0:I.ct!=null&&I.ct.t=="n"?I.v!=F&&(w[R]=0):w[R]=0}else if(A=="noequal"){let F=parseFloat(x.value1);I==null||fe(I.v)?w[R]=0:I.ct!=null&&I.ct.t=="n"?I.v==F&&(w[R]=0):w[R]=0}else if(A=="include"){let F=parseFloat(x.value1),z=parseFloat(x.value2),M,N;F N)&&(w[R]=0):w[R]=0}else if(A=="noinclude"){let F=parseFloat(x.value1),z=parseFloat(x.value2),M,N;F =M&&I.v<=N&&(w[R]=0):w[R]=0}}}else{$("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']").each(function(_,T){if($(T).is(":visible")&&$(T).is(":checked"))return!0;if($(T).closest(".day").length>0){let A=$(T).siblings("label").text();Number(A)<10&&(A="0"+A);let R=$(T).closest(".monthBox").find(".month label").text().replace(o.filiterMonthText,"");Number(R)<10&&(R="0"+R);let I=$(T).closest(".yearBox").find(".year label").text().replace(o.filiterYearText,""),F=o.filterDateFormatTip+"#$$$#"+I+"-"+R+"-"+A;b[F]="1"}if($(T).closest(".textBox").length>0){let A=$(T).closest(".textBox").data("filter");b[A]="1"}});for(let _=1;_ 0||$("#luckysheet-pivotTableFilter-bycondition").next().is(":visible")&&$("#luckysheet-pivotTableFilter-byvalue").next().is(":hidden")&&$("#luckysheet-pivotTableFilter-selected span").data("value")!="null"?(C.data("rowhidden",JSON.stringify(w)).find(".luckysheet-slider-list-item-filtered").show(),n.setDatatojsfile("rowhidden",w,y),x!=null&&(C.data("byconditionvalue",x.value).data("byconditiontype",x.type).data("byconditiontext",x.text),x.value1!=null&&C.data("byconditionvalue1",x.value1),x.value2!=null&&C.data("byconditionvalue2",x.value2),n.setDatatojsfile("caljs",x,y))):(C.data("rowhidden","").find(".luckysheet-slider-list-item-filtered").hide(),n.setDatatojsfile("rowhidden",null,y));let S=[];for(let _=0;_ 1){k=v[0],b=v[1];for(let S in h.luckysheetfile)if(k==h.luckysheetfile[S].name){w=h.luckysheetfile[S].index;break}w==-1&&(w=0)}else{let S=K(h.currentSheetIndex);k=h.luckysheetfile[S].name,w=h.luckysheetfile[S].index,b=v[0]}if(h.luckysheetfile[K(w)].isPivotTable){de()?alert(l.errorNotAllowPivotData):U.info("",l.errorNotAllowPivotData),g.val(n.jgridCurrentPivotInput);return}if(b.indexOf(":")==-1){de()?alert(l.errorSelectionRange):U.info("",l.errorSelectionRange),g.val(n.jgridCurrentPivotInput);return}b=b.split(":");let x=[],C=[];if(x[0]=parseInt(b[0].replace(/[^0-9]/g,""))-1,x[1]=parseInt(b[1].replace(/[^0-9]/g,""))-1,x[0]>x[1]){de()?alert(l.errorSelectionRange):U.info("",l.errorSelectionRange),g.val(n.jgridCurrentPivotInput);return}if(C[0]=hl(b[0].replace(/[^A-Za-z]/g,"")),C[1]=hl(b[1].replace(/[^A-Za-z]/g,"")),C[0]>C[1]){de()?alert(l.errorSelectionRange):U.info(l.errorSelectionRange),g.val(n.jgridCurrentPivotInput);return}ve.changeSheetExec(n.pivotSheetIndex),n.setDatatojsfile("pivot_select_save",{row:x,column:C}),n.setDatatojsfile("pivotDataSheetIndex",w),n.getCellData(n.pivotSheetIndex,w,{row:x,column:C}),n.initialPivotManage(),$("#luckysheet-dialog-pivotTable-range").html(y),$("#luckysheet-modal-dialog-slider-pivot").show(),$("#luckysheet-data-pivotTable-selection").hide(),n.luckysheet_pivotTable_select_state=!1,n.refreshPivotTable(),$t(),nl()}}),$("#luckysheet-modal-dialog-slider-pivot").on("mousedown",".luckysheet-slider-list-item-name, .luckysheet-modal-dialog-slider-config-item-txt",function(g){let y=$(g.target);n.movestate=!0,n.movesave.obj=y.parent(),n.movesave.name=y.data("name"),n.movesave.containerid=y.parent().parent().attr("id"),n.movesave.index=y.data("index"),$("#luckysheet-modal-dialog-slider-pivot-move").length==0&&$("body").append(' '+n.movesave.name+""),n.movesave.width=$("#luckysheet-modal-dialog-slider-pivot-move").outerWidth(),n.movesave.height=$("#luckysheet-modal-dialog-slider-pivot-move").outerHeight(),$("#luckysheet-modal-dialog-pivotTable-list, #luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column, #luckysheet-modal-dialog-config-value").css("cursor","default")}),$("#luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column, #luckysheet-modal-dialog-config-value").mousemove(function(g){if(n.movestate){n.moveitemposition.length==0&&(n.moveitemposition=[0],$(this).find(".luckysheet-modal-dialog-slider-config-item").each(function(C){let S=$(this),_=S.outerHeight();n.moveitemposition.push(n.moveitemposition[C]+_+2)}),$(this).append('')),$("#luckysheet-modal-dialog-slider-pivot-move").css({background:"#FD8585",color:"#fff",border:"1px solid #FD7070"});let y=event.pageX,v=event.pageY,k=$(this),b=v-k.offset().top+k.scrollTop(),w=n.moveitemposition,x=st(w,b);x==-1?$("#luckysheet-modal-dialog-config-order-help").css({top:w[w.length-1]}):b-w[x-1]>(w[x]-w[x-1])/2?$("#luckysheet-modal-dialog-config-order-help").css({top:w[x]}):$("#luckysheet-modal-dialog-config-order-help").css({top:w[x-1]})}}).mouseleave(function(){n.movestate&&($("#luckysheet-modal-dialog-slider-pivot-move").css({background:"#fff",color:"#000",border:"1px dotted #000"}),n.moveitemposition=[],$("#luckysheet-modal-dialog-config-order-help").remove())}).mouseup(function(g){if(n.movestate){let y=$(this),v;if(n.movesave.containerid==y.attr("id"))v=n.movesave.obj.clone();else{let _=n.movesave.name,T="",A="";y.attr("id")=="luckysheet-modal-dialog-config-value"&&(n.pivot_data_type[n.movesave.index.toString()]=="num"?(_=l.valueStatisticsSUM+":"+_,T="data-sumtype='SUM'",A="data-nameindex='0'"):(_=l.valueStatisticsCOUNTA+":"+_,T="data-sumtype='COUNTA'",A="data-nameindex='0'"),$("#luckysheet-modal-dialog-config-value").find(".luckysheet-modal-dialog-slider-config-item").each(function(){if($(this).find(".luckysheet-modal-dialog-slider-config-item-txt").text()==_){let I=parseFloat($(this).data("nameindex"))+1;return _=_+I.toString(),$(this).data("nameindex",I),!1}})),v=' '}let k=event.pageX,b=event.pageY,w=$(this),x=b-w.offset().top+w.scrollTop(),C=n.moveitemposition,S=st(C,x);(n.movesave.containerid=="luckysheet-modal-dialog-pivotTable-list"||n.movesave.containerid=="luckysheet-modal-dialog-config-value"&&n.movesave.containerid!=y.attr("id"))&&$("#luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column").find(".luckysheet-modal-dialog-slider-config-item").each(function(){$(this).data("index")==n.movesave.index&&$(this).remove()}),S==-1?y.find(".luckysheet-modal-dialog-slider-config-item").length==0?y.append(v):y.find(".luckysheet-modal-dialog-slider-config-item").last().after(v):x-C[S-1]>(C[S]-C[S-1])/2?y.find(".luckysheet-modal-dialog-slider-config-item").eq(S-1).after(v):y.find(".luckysheet-modal-dialog-slider-config-item").eq(S-1).before(v),n.movesave.containerid=="luckysheet-modal-dialog-pivotTable-list"||n.movesave.containerid=="luckysheet-modal-dialog-config-value"&&n.movesave.containerid!=y.attr("id")||n.movesave.obj.remove(),$("#luckysheet-modal-dialog-pivotTable-list").find(".luckysheet-modal-dialog-slider-list-item").each(function(){let _=$(this).find(".luckysheet-slider-list-item-selected");$(this).data("index")==n.movesave.index&&_.find("i").length==0&&_.append('')}),n.refreshPivotTable(),$("#luckysheet-modal-dialog-slider-pivot-move").remove(),n.movestate=!1,$("#luckysheet-modal-dialog-pivotTable-list, #luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column, #luckysheet-modal-dialog-config-value").css("cursor","default"),n.moveitemposition=[],$("#luckysheet-modal-dialog-config-order-help").remove(),n.showvaluecolrow(),g.stopPropagation()}}),$("#luckysheet-modal-dialog-pivotTable-list").on("click",".luckysheet-slider-list-item-selected",function(){let g=$(this),y=g.parent(),v=y.data("index"),k=y.data("name");if(g.find("i").length==0){g.append('');let b=n.pivot_data_type[v.toString()],w;if(b=="num")w=' ',$("#luckysheet-modal-dialog-config-value").append(w);else{w=' ';let x=$("#luckysheet-modal-dialog-config-column"),C=$("#luckysheet-modal-dialog-config-row"),S=x.find(".luckysheet-modal-dialog-slider-config-item"),_=C.find(".luckysheet-modal-dialog-slider-config-item");S.length<2?x.append(w):_.length<2?C.append(w):x.append(w)}}else g.find("i").remove(),$("#luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column, #luckysheet-modal-dialog-config-value").find(".luckysheet-modal-dialog-slider-config-item").each(function(){$(this).data("index")==v&&($(this).parent().attr("id")=="luckysheet-modal-dialog-config-value"&&n.resetOrderby($(this)),$(this).remove())});n.refreshPivotTable(),n.showvaluecolrow()}),$("#luckysheet-dialog-pivotTable-clearitem").click(function(){$("#luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column, #luckysheet-modal-dialog-config-value").find(".luckysheet-modal-dialog-slider-config-item").each(function(){$(this).remove()}),$("#luckysheet-modal-dialog-pivotTable-list").find(".luckysheet-modal-dialog-slider-list-item").each(function(){$(this).find(".luckysheet-slider-list-item-selected").find("i").remove()}),n.refreshPivotTable(),n.showvaluecolrow()})}e==null&&(e=!1),n.celldata.length<=1&&n.celldata[0].length<=1&&(de()?alert(l.errorIncreaseRange):U.info("",l.errorIncreaseRange));let s="",u=1,d={},f=1;for(let m=0;m0&&(v="display:block;"),s+=' '}if($("#luckysheet-modal-dialog-pivotTable-list").html(s),$("#luckysheetpivottablevaluecolrowshow").hide(),$("#luckysheetpivottablevaluecolrow").prop("checked",!0),$("#luckysheetpivottablevaluecolrow1").prop("checked",!1),$("#luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column, #luckysheet-modal-dialog-config-value").empty(),e){if(n.filter!=null&&n.filter.length>0)for(let m=0;m';$("#luckysheet-modal-dialog-config-filter").append(y);let v=$("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").eq(g.index).find(".luckysheet-slider-list-item-selected");v.find("i").length==0&&v.append('')}if(n.row!=null&&n.row.length>0)for(let m=0;m ';$("#luckysheet-modal-dialog-config-row").append(v);let k=$("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").eq(g.index).find(".luckysheet-slider-list-item-selected");k.find("i").length==0&&k.append('')}if(n.column!=null&&n.column.length>0)for(let m=0;m ';$("#luckysheet-modal-dialog-config-column").append(v);let k=$("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").eq(g.index).find(".luckysheet-slider-list-item-selected");k.find("i").length==0&&k.append('')}if(n.values!=null&&n.values.length>0){for(let m=0;m ';$("#luckysheet-modal-dialog-config-value").append(v);let k=$("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").eq(g.index).find(".luckysheet-slider-list-item-selected");k.find("i").length==0&&k.append('')}n.values.length>=2&&($("#luckysheetpivottablevaluecolrowshow").show(),n.showType=="column"?($("#luckysheetpivottablevaluecolrow").prop("checked",!0),$("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow']").addClass("ui-state-active"),$("#luckysheetpivottablevaluecolrow1").prop("checked",!1),$("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow1']").removeClass("ui-state-active")):($("#luckysheetpivottablevaluecolrow1").prop("checked",!0),$("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow1']").addClass("ui-state-active"),$("#luckysheetpivottablevaluecolrow").prop("checked",!1),$("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow']").removeClass("ui-state-active")))}}$("#luckysheet-dialog-pivotTable-range").html(wt(n.pivotDataSheetIndex,n.pivot_select_save)),$("#luckysheet-modal-dialog-slider-pivot").show(),$t(!1)},getComposeArray:function(e){if(e.length==0)return[];let n=[];for(let t=0;t 0){o.children=l.orderbygroupchildren(o.children,n[o.index].orderby,n[o.index].order,t);for(let f=0;f e[t].max&&(e[t].max=a),a e[t].acc&&(e[t].acc=o)}l!=""&&(e[t].data.push(l),e[t].counta+=1,l in e[t].countuniquedata||(e[t].countuniquedata[l]=1,e[t].countunique+=1))},dataHandler:function(e,n,t,l,a){let o=this,s=Q(),u=s.filter,d=s.pivotTable;if(l==null&&(l="column"),e.length==0&&n.length==0&&t.length==0||a.length==0)return o.pivotDatas=[],[];let f={},m=a,g=[],y=[],v={},k=0,b=[],w=[],x={},C=0;for(let z=1;z 0&&O.unshift(d.valueSum),W.length>0&&W.unshift(d.valueSum);let ee=v,te=y;for(let ue=0;ue 0?(Z.push(""),Z=Z.join(t[ue].fullname+"|||").split("|||").slice(0,Z.length-1)):Z.push(t[ue].fullname):G.length>0?(G.push(""),G=G.join(t[ue].fullname+"|||").split("|||").slice(0,G.length-1)):G.push(t[ue].fullname),Z.length==0&&Z.push(""),G.length==0&&G.push("");for(let le=0;le M.acc&&(M.acc=N),M.result=Al(M.result,M.acc)}if(g=o.getTitleFromGroup(y,n,f),b=o.getTitleFromGroup(w,e,f),l=="column")if(b.length>0&&b[0].length>0)b=o.addValuesToTitle(b,t);else for(let z=0;z 0&&g[0].length>0)g=o.addValuesToTitle(g,t);else for(let z=0;z =I)b[z]!=null?P(b[z][M-I])=="object"?F[z][M]=b[z][M-I].name+d.valueSum:F[z][M]=b[z][M-I]:F[z][M]="";else if(z>=R&&M0&&n.length>0)F[0][0]=t[0].fullname,F.splice(e.length,1);else if(t.length==1&&e.length>0){let z=F.splice(e.length,1),M=[];for(let N=0;N 0)for(let g=0;g ${l.warning}`,l.errorNotAllowMerged);return}let k=f+g-u.length,b=m+y-u[0].length;(k>0||b>0)&&(u=Vt([].concat(u),k,b,!0));for(let w=0;w0)for(let g=0;g {Xe();bf=function(){let e,n;return e=function(){this.init.apply(this,arguments)},arguments.length>1?(arguments[0]?(e.prototype=$.extend(new arguments[0],arguments[arguments.length-1]),e._super=arguments[0].prototype):e.prototype=arguments[arguments.length-1],arguments.length>2&&(n=Array.prototype.slice.call(arguments,1,-1),n.unshift(e.prototype),$.extend.apply($,n))):e.prototype=arguments[0],e.prototype.cls=e,e},C2=bf({fre:/\{\{([\w.]+?)(:(.+?))?\}\}/g,precre:/(\w+)\.(\d+)/,init:function(e,n){this.format=e,this.fclass=n},render:function(e,n,t){let l=this,a=e,o,s,u,d,f;return this.format.replace(this.fre,function(){let m;return s=arguments[1],u=arguments[3],o=l.precre.exec(s),o?(f=o[2],s=o[1]):f=!1,d=a[s],d===void 0?"":u&&n&&n[u]?(m=n[u],m.get?n[u].get(d)||d:n[u][d]||d):(T2(d)&&(t.get("numberFormatter")?d=t.get("numberFormatter")(d):d=S2(d,f,t.get("numberDigitGroupCount"),t.get("numberDigitGroupSep"),t.get("numberDecimalMark"))),d)})}});$.spformat=function(e,n){return new C2(e,n)};Pi=function(e,n,t){return e t?t:e},hc=function(e,n){let t;return n===2?(t=Math.floor(e.length/2),e.length%2?e[t]:(e[t-1]+e[t])/2):e.length%2?(t=(e.length*n+n)/4,t%1?(e[Math.floor(t)]+e[Math.floor(t)-1])/2:e[t-1]):(t=(e.length*n+2)/4,t%1?(e[Math.floor(t)]+e[Math.floor(t)-1])/2:e[t-1])},dc=function(e){let n;switch(e){case"undefined":e=void 0;break;case"null":e=null;break;case"true":e=!0;break;case"false":e=!1;break;default:n=parseFloat(e),e==n&&(e=n)}return e},fc=function(e){let n,t=[];for(n=e.length;n--;)t[n]=dc(e[n]);return t},$o=function(e,n,t){let l;for(l=n.length;l--;)if(!(t&&n[l]===null)&&n[l]!==e)return!1;return!0},wf=function(e,n){let t,l,a=[];for(t=0,l=e.length;t 0;s-=t)e.splice(s,0,l);return e.join("")},Li=bf({init:function(e){let n,t,l=[];for(n in e)e.hasOwnProperty(n)&&typeof n=="string"&&n.indexOf(":")>-1&&(t=n.split(":"),t[0]=t[0].length===0?-Infinity:parseFloat(t[0]),t[1]=t[1].length===0?Infinity:parseFloat(t[1]),t[2]=e[n],l.push(t));this.map=e,this.rangelist=l||!1},get:function(e){let n=this.rangelist,t,l,a;if((a=this.map[e])!==void 0)return a;if(n){for(t=n.length;t--;)if(l=n[t],l[0]<=e&&l[1]>=e)return l[2]}}});$.range_map=function(e){return new Li(e)};Ar={defaultOption:{common:{type:"line",lineColor:"#2ec7c9",fillColor:"#CCF3F4",defaultPixelsPerValue:3,width:"auto",height:"auto",composite:!1,tagValuesAttribute:"values",tagOptionsPrefix:"spark",enableTagOptions:!1,enableHighlight:!0,highlightLighten:1.4,tooltipSkipNull:!0,tooltipPrefix:"",tooltipSuffix:"",disableHiddenCheck:!1,numberFormatter:!1,numberDigitGroupCount:3,numberDigitGroupSep:",",numberDecimalMark:".",disableTooltips:!0,disableInteraction:!0,offsetX:0,offsetY:0},line:{spotColor:0,highlightSpotColor:"#5f5",highlightLineColor:"#f22",spotRadius:1.5,minSpotColor:0,maxSpotColor:0,lineWidth:1,normalRangeMin:void 0,normalRangeMax:void 0,normalRangeColor:"#ccc",drawNormalOnTop:!0,chartRangeMin:void 0,chartRangeMax:void 0,chartRangeMinX:void 0,chartRangeMaxX:void 0},bar:{barColor:"#fc5c5c",negBarColor:"#97b552",stackedBarColor:["#2ec7c9","#fc5c5c","#5ab1ef","#ffb980","#d87a80","#8d98b3","#e5cf0d","#97b552","#95706d","#dc69aa","#07a2a4","#9a7fd1","#588dd5","#f5994e","#c05050","#59678c","#c9ab00","#7eb00a","#6f5553","#c14089"],zeroColor:void 0,nullColor:void 0,zeroAxis:!0,barWidth:4,barSpacing:1,chartRangeMax:void 0,chartRangeMin:void 0,chartRangeClip:!1,colorMap:void 0},column:{barColor:"#fc5c5c",negBarColor:"#97b552",stackedBarColor:["#2ec7c9","#fc5c5c","#5ab1ef","#ffb980","#d87a80","#8d98b3","#e5cf0d","#97b552","#95706d","#dc69aa","#07a2a4","#9a7fd1","#588dd5","#f5994e","#c05050","#59678c","#c9ab00","#7eb00a","#6f5553","#c14089"],zeroColor:void 0,nullColor:void 0,zeroAxis:!0,barWidth:4,barSpacing:1,chartRangeMax:void 0,chartRangeMin:void 0,chartRangeClip:!1,colorMap:void 0},tristate:{barWidth:4,barSpacing:1,posBarColor:"#fc5c5c",negBarColor:"#97b552",zeroBarColor:"#999",colorMap:{}},discrete:{lineHeight:"auto",thresholdColor:"#fc5c5c",thresholdValue:0,chartRangeMax:void 0,chartRangeMin:void 0,chartRangeClip:!1},bullet:{targetColor:"#f33",targetWidth:3,performanceColor:"#33f",rangeColors:["#d3dafe","#a8b6ff","#7f94ff","#6D87FF","#5876FF","#4465FF","#2F54FF","#1A43FF","#0532FF"],base:void 0},pie:{offset:0,sliceColors:["#2ec7c9","#fc5c5c","#5ab1ef","#ffb980","#d87a80","#8d98b3","#e5cf0d","#97b552","#95706d","#dc69aa","#07a2a4","#9a7fd1","#588dd5","#f5994e","#c05050","#59678c","#c9ab00","#7eb00a","#6f5553","#c14089"],borderWidth:0,borderColor:"#000"},box:{raw:!1,boxLineColor:"#000",boxFillColor:"#cdf",whiskerColor:"#000",outlierLineColor:"#5E5E5E",outlierFillColor:"#fff",medianColor:"#f00",showOutliers:!0,outlierIQR:1.5,spotRadius:1.5,target:void 0,targetColor:"#4a2",chartRangeMax:void 0,chartRangeMin:void 0}},line:{type:"line",init:function(e,n,t,l,a){this.vertices=[],this.regionMap=[],this.xvalues=[],this.yvalues=[],this.yminmax=[],this.hightlightSpotId=null,this.lastShapeId=null},getRegion:function(e,n,t){let l,a=this.regionMap;for(l=a.length;l--;)if(a[l]!==null&&n>=a[l][0]&&n<=a[l][1])return a[l][2]},getCurrentRegionFields:function(){let e=this.currentRegion;return{isNull:this.yvalues[e]===null,x:this.xvalues[e],y:this.yvalues[e],color:this.options.get("lineColor"),fillColor:this.options.get("fillColor"),offset:e}},renderHighlight:function(){let e=this.currentRegion,n=this.target,t=this.vertices[e],l=this.options,a=l.get("spotRadius"),o=l.get("highlightSpotColor"),s=l.get("highlightLineColor"),u,d;!t||(a&&o&&(u=n.drawCircle(t[0],t[1],a,void 0,o),this.highlightSpotId=u.id,n.insertAfterShape(this.lastShapeId,u)),s&&(d=n.drawLine(t[0],this.canvasTop,t[0],this.canvasTop+this.canvasHeight,s),this.highlightLineId=d.id,n.insertAfterShape(this.lastShapeId,d)))},removeHighlight:function(){let e=this.target;this.highlightSpotId&&(e.removeShapeId(this.highlightSpotId),this.highlightSpotId=null),this.highlightLineId&&(e.removeShapeId(this.highlightLineId),this.highlightLineId=null)},scanValues:function(){let e=this.values,n=e.length,t=this.xvalues,l=this.yvalues,a=this.yminmax,o,s,u,d,f;for(o=0;o this.maxy&&(this.maxy=t)),e.get("chartRangeMin")!==void 0&&(e.get("chartRangeClip")||e.get("chartRangeMin") this.maxy)&&(this.maxy=e.get("chartRangeMax")),e.get("chartRangeMinX")!==void 0&&(e.get("chartRangeClipX")||e.get("chartRangeMinX") this.maxx)&&(this.maxx=e.get("chartRangeMaxX"))},drawNormalRange:function(e,n,t,l,a){let o=this.options.get("normalRangeMin"),s=this.options.get("normalRangeMax"),u=n+Math.round(t-t*((s-this.miny)/a)),d=Math.round(t*(s-o)/a);d==0&&o==s&&(d=1),this.target.drawRect(e,u,l,d,void 0,this.options.get("normalRangeColor")).append()},render:function(e,n){this.vertices=[],this.regionMap=[],this.xvalues=[],this.yvalues=[],this.yminmax=[],this.hightlightSpotId=null,this.lastShapeId=null,this.values=n;let t=this.options,l=this.target,a=e.mergedOptions.width,o=e.mergedOptions.height,s=this.vertices,u=t.get("spotRadius"),d=this.regionMap,f,m,g,y,v,k,b,w,x,C,S,_,T,A,R,I,F,z,M,N,E,L,O,V,q;if(this.scanValues(),this.processRangeOptions(),O=this.xvalues,V=this.yvalues,!(!this.yminmax.length||this.yvalues.length<2)){for(y=v=0,f=this.maxx-this.minx==0?1:this.maxx-this.minx,m=this.maxy-this.miny==0?1:this.maxy-this.miny,g=this.yvalues.length-1,u&&(athis.maxy&&(C=this.maxy),b.length||b.push([_,y+o]),k=[_,y+Math.round(o-o*((C-this.miny)/m))],b.push(k),s.push(k));for(F=[],z=[],M=w.length,q=0;q 2&&(b[0]=[b[0][0],b[1][1]]),F.push(b));for(M=z.length,q=0;q -1,(y||$.isArray(O))&&(z=!0,y&&(O=n[x]=fc(O.split(":"))),O=wf(O,null),v=Math.min.apply(Math,O),k=Math.max.apply(Math,O),v g&&(g=k));this.stacked=z,this.regionShapes={},this.barWidth=Math.floor(l/n.length)-s,this.barSpacing=s,this.totalBarWidth=this.barWidth+s,this.width=l,f&&(I=u===void 0?-Infinity:u,F=d===void 0?Infinity:d),w=[],b=z?[]:w;let Y=[],ee=[];for(x=0,C=n.length;x 0&&(Y[x]+=O),m<0&&g>0?O<0?ee[x]+=Math.abs(O):b[x]+=O:b[x]+=Math.abs(O),w.push(O));else O=f?Pi(n[x],I,F):n[x],O=n[x]=dc(O),O!==null&&w.push(O);this.max=R=Math.max.apply(Math,w),this.min=A=Math.min.apply(Math,w),this.stackMax=g=z?Math.max.apply(Math,Y):R,this.stackMin=m=z?Math.min.apply(Math,w):A,t.get("chartRangeMin")!==void 0&&(t.get("chartRangeClip")||t.get("chartRangeMin")R)&&(R=t.get("chartRangeMax")),this.zeroAxis=_=t.get("zeroAxis",!0),A<=0&&R>=0&&_?T=0:_==!1?T=A:A>0?T=0:T=R,this.xaxisOffset=T,S=z?Math.max.apply(Math,b)+Math.max.apply(Math,ee):R-T,this.canvasHeightEf=_&&A<0?this.canvasHeight-2:this.canvasHeight-1,this.isNeg=!1,A =this.values.length?void 0:l},getCurrentRegionFields:function(){let e=this.currentRegion,n=ensureArray(this.values[e]),t=[],l,a;for(a=n.length;a--;)l=n[a],t.push({isNull:l===null,value:l,color:this.calcColor(a,l,e),offset:e});return t},calcColor:function(e,n,t){let l=this.colorMapByIndex,a=this.colorMapByValue,o=this.options,s,u;return this.stacked?s=o.get("stackedBarColor"):s=n<0?o.get("negBarColor"):o.get("barColor"),n===0&&o.get("zeroColor")!==void 0&&(s=o.get("zeroColor")),a&&(u=a.get(n))?s=u:l&&l.length>t&&(s=l[t]),$.isArray(s)?s[e%s.length]:s},renderRegion:function(e,n){let t=this.values[e],l=this.options,a=this.xaxisOffset,o=[],s=this.range,u=this.stacked,d=this.target,f=e*this.totalBarWidth,m=this.canvasHeightEf,g=this.yoffset,y,v,k,b,w,x,C,S,_,T;if(t=$.isArray(t)?t:[t],C=t.length,S=t[0],b=$o(null,t),T=$o(a,t,!0),b)return l.get("nullColor")?(k=n?l.get("nullColor"):this.calcHighlightColor(l.get("nullColor"),l),y=g>0?g-1:g,d.drawRect(y,f,0,this.barWidth-1,k,k)):void 0;for(w=g,this.isNeg&&(m=Math.floor(m/2)),x=0;x 0?v=Math.floor(m*(Math.abs(S-a)/s)):v=m,S-1,(y||$.isArray(O))&&(z=!0,y&&(O=n[x]=fc(O.split(":"))),O=wf(O,null),v=Math.min.apply(Math,O),k=Math.max.apply(Math,O),v g&&(g=k));this.stacked=z,this.regionShapes={},this.barWidth=Math.floor(l/n.length)-s,this.barSpacing=s,this.totalBarWidth=this.barWidth+s,this.width=l,f&&(I=u===void 0?-Infinity:u,F=d===void 0?Infinity:d),w=[],b=z?[]:w;let Y=[],ee=[];for(x=0,C=n.length;x 0&&(Y[x]+=O),m<0&&g>0?O<0?ee[x]+=Math.abs(O):b[x]+=O:b[x]+=Math.abs(O),w.push(O));else O=f?Pi(n[x],I,F):n[x],O=n[x]=dc(O),O!==null&&w.push(O);this.max=R=Math.max.apply(Math,w),this.min=A=Math.min.apply(Math,w),this.stackMax=g=z?Math.max.apply(Math,Y):R,this.stackMin=m=z?Math.min.apply(Math,w):A,t.get("chartRangeMin")!==void 0&&(t.get("chartRangeClip")||t.get("chartRangeMin")R)&&(R=t.get("chartRangeMax")),this.zeroAxis=_=t.get("zeroAxis",!0),A<=0&&R>=0&&_?T=0:_==!1?T=A:A>0?T=0:T=R,this.xaxisOffset=T,S=z?Math.max.apply(Math,b)+Math.max.apply(Math,ee):R-T,this.canvasHeightEf=_&&A<0?this.canvasHeight-2:this.canvasHeight-1,this.isNeg=!1,A =this.values.length?void 0:l},getCurrentRegionFields:function(){let e=this.currentRegion,n=ensureArray(this.values[e]),t=[],l,a;for(a=n.length;a--;)l=n[a],t.push({isNull:l===null,value:l,color:this.calcColor(a,l,e),offset:e});return t},calcColor:function(e,n,t){let l=this.colorMapByIndex,a=this.colorMapByValue,o=this.options,s,u;return this.stacked?s=o.get("stackedBarColor"):s=n<0?o.get("negBarColor"):o.get("barColor"),n===0&&o.get("zeroColor")!==void 0&&(s=o.get("zeroColor")),a&&(u=a.get(n))?s=u:l&&l.length>t&&(s=l[t]),$.isArray(s)?s[e%s.length]:s},renderRegion:function(e,n){let t=this.values[e],l=this.options,a=this.xaxisOffset,o=[],s=this.range,u=this.stacked,d=this.target,f=e*this.totalBarWidth,m=this.canvasHeightEf,g=this.yoffset,y,v,k,b,w,x,C,S,_,T;if(t=$.isArray(t)?t:[t],C=t.length,S=t[0],b=$o(null,t),T=$o(a,t,!0),b)return l.get("nullColor")?(k=n?l.get("nullColor"):this.calcHighlightColor(l.get("nullColor"),l),y=g>0?g-1:g,d.drawRect(f,y,this.barWidth-1,0,k,k)):void 0;for(w=g,this.isNeg&&(m=Math.floor(m/2)),x=0;x 0?v=Math.floor(m*(Math.abs(S-a)/s)):v=m,Sn?s=a[n]:t[n]<0?s=l.get("negBarColor"):t[n]>0?s=l.get("posBarColor"):s=l.get("zeroBarColor"),s},renderRegion:function(e,n){let t=this.values,l=this.options,a=this.target,o,s,u,d,f,m;if(o=this.canvasHeight,u=Math.round(o/2),d=e*this.totalBarWidth,t[e]<0?(f=u,s=u-1):t[e]>0?(f=0,s=u-1):(f=u-1,s=2),m=this.calcColor(t[e],e),m!==null)return n&&(m=this.calcHighlightColor(m,l)),a.drawRect(d,f,this.barWidth-1,s-1,m,m)}},discrete:{type:"discrete",init:function(e,n){let t=this.options,l=e.mergedOptions.width,a=e.mergedOptions.height;this.canvasWidth=e.mergedOptions.width,this.canvasHeight=e.mergedOptions.height,this.regionShapes={},this.values=n=$.map(n,Number),this.min=Math.min.apply(Math,n),this.max=Math.max.apply(Math,n),this.range=this.max-this.min,this.width=l,this.interval=Math.floor(l/n.length),this.itemWidth=l/n.length,t.get("chartRangeMin")!==void 0&&(t.get("chartRangeClip")||t.get("chartRangeMin") this.max)&&(this.max=t.get("chartRangeMax")),this.target&&(this.lineHeight=t.get("lineHeight")==="auto"?Math.round(this.canvasHeight*.3):t.get("lineHeight"))},getRegion:function(e,n,t){return Math.floor(n/this.itemWidth)},getCurrentRegionFields:function(){let e=this.currentRegion;return{isNull:this.values[e]===void 0,value:this.values[e],offset:e}},renderRegion:function(e,n){let t=this.values,l=this.options,a=this.min,o=this.max,s=this.range,u=this.interval,d=this.target,f=this.canvasHeight,m=this.lineHeight,g=f-m,y,v,k,b;return v=Pi(t[e],a,o),b=e*u,y=Math.round(g-g*((v-a)/s)),k=l.get("thresholdColor")&&v 0)for(s=n.length;s--;)o+=n[s];this.total=o,this.radius=Math.floor(Math.min(this.canvasWidth,this.canvasHeight)/2)},getRegion:function(e,n,t){let l=this.target.getShapeAt(e,n,t);return l!==void 0&&this.shapes[l]!==void 0?this.shapes[l]:void 0},getCurrentRegionFields:function(){let e=this.currentRegion;return{isNull:this.values[e]===void 0,value:this.values[e],percent:this.values[e]/this.total*100,color:this.options.get("sliceColors")[e%this.options.get("sliceColors").length],offset:e}},changeHighlight:function(e){let n=this.currentRegion,t=this.renderSlice(n,e),l=this.valueShapes[n];delete this.shapes[l],this.target.replaceWithShape(l,t),this.valueShapes[n]=t.id,this.shapes[t.id]=n},renderSlice:function(e,n){let t=this.target,l=this.options,a=this.radius,o=l.get("borderWidth"),s=l.get("offset"),u=2*Math.PI,d=this.values,f=this.total,m=s?2*Math.PI*(s/360):0,g,y,v,k,b;for(k=d.length,v=0;v 0&&(y=m+u*(d[v]/f)),e===v)return b=l.get("sliceColors")[v%l.get("sliceColors").length],n&&(b=this.calcHighlightColor(b,l)),t.drawPieSlice(a,a,a-o,g,y,void 0,b);m=y}},render:function(e,n){this.init(e,n);let t=this.target,l=this.values,a=this.options,o=this.radius,s=a.get("borderWidth"),u,d;for(s&&t.drawCircle(o,o,Math.floor(o-s/2),a.get("borderColor"),void 0,s).append(),d=l.length;d--;)l[d]&&(u=this.renderSlice(d).append(),this.valueShapes[d]=u.id,this.shapes[u.id]=d)}},box:{type:"box",init:function(e,n){let t=this.options,l=e.mergedOptions.width,a=e.mergedOptions.height;this.canvasWidth=e.mergedOptions.width,this.canvasHeight=e.mergedOptions.height,this.values=$.map(n,Number),this.width=t.get("width")==="auto"?"4.0em":l,this.values.length||(this.disabled=1)},getRegion:function(){return 1},getCurrentRegionFields:function(){let e=[{field:"lq",value:this.quartiles[0]},{field:"med",value:this.quartiles[1]},{field:"uq",value:this.quartiles[2]}];return this.loutlier!==void 0&&e.push({field:"lo",value:this.loutlier}),this.routlier!==void 0&&e.push({field:"ro",value:this.routlier}),this.lwhisker!==void 0&&e.push({field:"lw",value:this.lwhisker}),this.rwhisker!==void 0&&e.push({field:"rw",value:this.rwhisker}),e},render:function(e,n){this.init(e,n);let t=this.target,l=this.values,a=l.length,o=this.options,s=this.canvasWidth,u=this.canvasHeight,d=o.get("chartRangeMin")===void 0?Math.min.apply(Math,l):o.get("chartRangeMin"),f=o.get("chartRangeMax")===void 0?Math.max.apply(Math,l):o.get("chartRangeMax"),m=0,g,y,v,k,b,w,x,C,S,_,T;if(o.get("raw"))o.get("showOutliers")&&l.length>5?(y=l[0],g=l[1],k=l[2],b=l[3],w=l[4],x=l[5],C=l[6]):(g=l[0],k=l[1],b=l[2],w=l[3],x=l[4]);else if(l.sort(function(A,R){return A-R}),k=hc(l,1),b=hc(l,2),w=hc(l,3),v=w-k,o.get("showOutliers")){for(g=x=void 0,S=0;Sk-v*o.get("outlierIQR")&&(g=l[S]),l[S] x&&t.drawCircle((C-d)*T+m,u/2,o.get("spotRadius"),o.get("outlierLineColor"),o.get("outlierFillColor")).append()),t.drawRect(Math.round((k-d)*T+m),Math.round(u*.1),Math.round((w-k)*T),Math.round(u*.8),o.get("boxLineColor"),o.get("boxFillColor")).append(),t.drawLine(Math.round((g-d)*T+m),Math.round(u/2),Math.round((k-d)*T+m),Math.round(u/2),o.get("lineColor")).append(),t.drawLine(Math.round((g-d)*T+m),Math.round(u/4),Math.round((g-d)*T+m),Math.round(u-u/4),o.get("whiskerColor")).append(),t.drawLine(Math.round((x-d)*T+m),Math.round(u/2),Math.round((w-d)*T+m),Math.round(u/2),o.get("lineColor")).append(),t.drawLine(Math.round((x-d)*T+m),Math.round(u/4),Math.round((x-d)*T+m),Math.round(u-u/4),o.get("whiskerColor")).append(),t.drawLine(Math.round((b-d)*T+m),Math.round(u*.1),Math.round((b-d)*T+m),Math.round(u*.9),o.get("medianColor")).append(),o.get("target")&&(_=Math.ceil(o.get("spotRadius")),t.drawLine(Math.round((o.get("target")-d)*T+m),Math.round(u/2-_),Math.round((o.get("target")-d)*T+m),Math.round(u/2+_),o.get("targetColor")).append(),t.drawLine(Math.round((o.get("target")-d)*T+m-_),Math.round(u/2),Math.round((o.get("target")-d)*T+m+_),Math.round(u/2),o.get("targetColor")).append())}},shapeCount:0,shapes:{},shapeseq:[],lastShapeId:null,mergedOptions:null,init:function(e,n){let t,l,a;n=n||{};let o=this;return l=this.defaultOption,a=l.common,t=l[n.type||a.type],o.shapeCount=0,o.shapes={},o.shapeseq=[],o.lastShapeId=null,o.mergedOptions=$.extend({},a,t,n),o.mergedOptions.width=o.mergedOptions.width,o.mergedOptions.height=o.mergedOptions.height,o[o.mergedOptions.type].render(o,e),{shapes:o.shapes,shapeseq:o.shapeseq,offsetX:o.mergedOptions.offsetX,offsetY:o.mergedOptions.offsetY,pixelWidth:o.mergedOptions.width,pixelHeight:o.mergedOptions.height}},_getContext:function(e,n,t){let l;return this.ctx!=null?l=this.ctx:l=$("#"+this._canvasID).get(0).getContext("2d"),e!==void 0&&(l.strokeStyle=e),l.lineWidth=t===void 0?1:t,n!==void 0&&(l.fillStyle=n),l},reset:function(){this._getContext().clearRect(0,0,this.pixelWidth,this.pixelHeight),this.shapes={},this.shapeseq=[],this.currentTargetShapeId=void 0},_drawShape:function(e,n,t,l,a){let o=this._getContext(t,l,a),s,u;for(o.beginPath(),o.moveTo(n[0][0]+.5+this.offsetX,n[0][1]+.5+this.offsetY),s=1,u=n.length;s=h.visibledatarow.length&&(y=h.visibledatarow.length-1),v=st(h.visibledatacolumn,e),k=st(h.visibledatacolumn,e+t),v==-1&&(v=0),v+=s,k==-1&&(k=h.visibledatacolumn.length-1),k+=s,k>=h.visibledatacolumn.length&&(k=h.visibledatacolumn.length-1);let b,w,x,C;g==0?b=0:b=h.visibledatarow[g-1],w=h.visibledatarow[y],v==0?x=0:x=h.visibledatacolumn[v-1],C=h.visibledatacolumn[k],m.fillStyle="#ffffff",m.fillRect(a-1,o-1,C-e,w-n),m.font=Zn(),m.fillStyle=$l.fillStyle;let S=[],_={},T={},A=.5;Ke.createHookFunction("cellAllRenderBefore",h.flowdata,f,m);for(let N=g;N<=y;N++){let E;N==0?E=-n-1:E=h.visibledatarow[N-1]-n-1;let L=h.visibledatarow[N]-n;if(!(h.config.rowhidden!=null&&h.config.rowhidden[N]!=null))for(let O=v;O<=k;O++){let V;O==0?V=-e:V=h.visibledatacolumn[O-1]-e;let q=h.visibledatacolumn[O]-e;if(h.config.colhidden!=null&&h.config.colhidden[O]!=null)continue;let W=h.defaultcollen;if(h.config.columnlen!=null&&h.config.columnlen[O]!=null&&(W=h.config.columnlen[O]),h.flowdata[N]!=null&&h.flowdata[N][O]!=null){let Y=h.flowdata[N][O];if(P(Y)=="object"&&"mc"in Y)if(T[N+"_"+O]={start_r:E,start_c:V,end_r:L,end_c:q},"rs"in Y.mc){let ee="r"+N+"c"+O;_[ee]=S.length}else{let ee="r"+Y.mc.r+"c"+Y.mc.c,te=S[_[ee]];te==null?(_[ee]=S.length,S.push({r:N,c:O,start_c:V,start_r:E,end_r:L,end_c:q,firstcolumnlen:W})):(te.c==O&&(te.end_r+=L-E-1),te.r==N&&(te.end_c+=q-V,te.firstcolumnlen+=W));continue}}S.push({r:N,c:O,start_r:E,start_c:V,end_r:L,end_c:q,firstcolumnlen:W}),T[N+"_"+O]={start_r:E,start_c:V,end_r:L,end_c:q}}}let R=$i(h.luckysheetfile[K(h.currentSheetIndex)].dynamicArray),I=el.getComputeMap(),F=Se.getComputeMap(),z=R2(m,v,k,g,y),M=[];for(let N=0;N 0){let N=function(q,W,Y,ee,te,oe,ce,se,ue){let he=q,Z=ee-2+A+ce,G=Y+se-1,le=ee-2+A+ce,pe=te-2+A+se;ue.save(),be.setLineDash(ue,he,"v",Z,G,le,pe),ue.strokeStyle=W,ue.stroke(),ue.closePath(),ue.restore()},E=function(q,W,Y,ee,te,oe,ce,se,ue){let he=q,Z=oe-2+A+ce,G=Y+se-1,le=oe-2+A+ce,pe=te-2+A+se;ue.save(),be.setLineDash(ue,he,"v",Z,G,le,pe),ue.strokeStyle=W,ue.stroke(),ue.closePath(),ue.restore()},L=function(q,W,Y,ee,te,oe,ce,se,ue){let he=q,Z=ee-2+A+ce,G=te-2+A+se,le=oe-2+A+ce,pe=te-2+A+se;ue.save(),be.setLineDash(ue,he,"h",Z,G,le,pe),ue.strokeStyle=W,ue.stroke(),ue.closePath(),ue.restore()},O=function(q,W,Y,ee,te,oe,ce,se,ue){let he=q,Z=ee-2+A+ce,G=Y-1+A+se,le=oe-2+A+ce,pe=Y-1+A+se;ue.save(),be.setLineDash(ue,he,"h",Z,G,le,pe),ue.strokeStyle=W,ue.stroke(),ue.closePath(),ue.restore()},V=Zs(g,y,v,k);for(let q in V){let W=q.substr(0,q.indexOf("_")),Y=q.substr(q.indexOf("_")+1);if(T[W+"_"+Y]){let ee=T[W+"_"+Y].start_r,te=T[W+"_"+Y].start_c,oe=T[W+"_"+Y].end_r,ce=T[W+"_"+Y].end_c,se=gc(z,W,Y,v,k),ue=V[q].l;ue!=null&&(!se.colIn||se.stc==Y)&&N(ue.style,ue.color,ee,te,oe,ce,a,o,m);let he=V[q].r;he!=null&&(!se.colIn||se.colLast)&&E(he.style,he.color,ee,te,oe,ce,a,o,m);let Z=V[q].t;Z!=null&&O(Z.style,Z.color,ee,te,oe,ce,a,o,m);let G=V[q].b;G!=null&&L(G.style,G.color,ee,te,oe,ce,a,o,m)}}}k==h.visibledatacolumn.length-1&&m.clearRect(C-e+a-1,o-1,h.ch_width-h.visibledatacolumn[k],w-n),m.restore(),h.measureTextCacheTimeOut=setTimeout(()=>{h.measureTextCache={},h.measureTextCellInfoCache={},h.cellOverflowMapCache={}},100)}function R2(e,n,t,l,a){let o={},s=h.flowdata;for(let u=l;u<=a;u++){if(s[u]==null)continue;if(h.cellOverflowMapCache[u]!=null){o[u]=h.cellOverflowMapCache[u];continue}let d=!1;for(let f=0;f =n)&&ws[e].length-1)return{success:!1,r:e,c:t};let u=s[e][t];if(u!=null&&(!fe(u.v)||u.mc!=null))return{success:!1,r:e,c:t};let d=n-1<0?0:h.visibledatacolumn[n-1],f=h.visibledatacolumn[n],m=o-(f-d);a=="0"?(d-=m/2,f+=m/2):a=="1"?f+=m:a=="2"&&(d-=m);let g=t-1<0?0:h.visibledatacolumn[t-1],y=h.visibledatacolumn[t];if(l=="forward")return d y?Wa(e,n,t+1,l,a,o):f>g?{success:!0,r:e,c:t}:{success:!1,r:e,c:t}}function gc(e,n,t,l,a){let o=!1,s=!1,u,d,f,m;for(let g in e){for(let y in e[g]){u=g,d=y;let v=e[g][y];if(f=v.stc,m=v.edc,u==n&&t>=f&&t<=m&&(o=!0,t==m||t==a)){s=!0;break}}if(s)break}return{colIn:o,colLast:s,rowIndex:u,colIndex:d,stc:f,edc:m}}function Sf(e,n,t){if(e==null)return;let l=e.values,a=t.pos_x,o=t.pos_y;if(l!=null){e.rotate!=0&&e.type!="verticalWrap"&&(n.save(),n.translate((a+e.textLeftAll)/h.zoomRatio,(o+e.textTopAll)/h.zoomRatio),n.rotate(-e.rotate*Math.PI/180),n.translate(-(e.textLeftAll+a)/h.zoomRatio,-(o+e.textTopAll)/h.zoomRatio));for(let s=0;s {cn();yr();Va();mc();ol();vr();Wt();zr();go();Ta();Pt();pr();Zt();Ua();Dt();ht();yn();El();Xe();yt();gl();_f=function(e,n,t,l,a,o){if(h.flowdata[e]==null||h.flowdata[e][n]==null)return;let s=h.flowdata[e][n].spl;if(s!=null){if(typeof s=="string"&&(s=new Function("return "+s)()),P(s)=="object"){let u=s,d=u.offsetX,f=u.offsetY;d=d==null?0:d,f=f==null?0:f,Jl.render(u.shapeseq,u.shapes,t+d,l+f,u.pixelWidth,u.pixelHeight,a,o)}else if(P(s)=="array"&&P(s[0])=="object")for(let u=0;u ce?A:ce,he=ee+ue-I;u.textBaseline="bottom";let Z=he-13*h.zoomRatio;z=="0"?(he=ee+ue/2,u.textBaseline="middle",Z=he-6*h.zoomRatio):z=="1"&&(he=ee+I,u.textBaseline="top",Z=he+1*h.zoomRatio),se=se/h.zoomRatio,he=he/h.zoomRatio,Z=Z/h.zoomRatio,u.lineWidth=1,u.strokeStyle="#000",u.strokeRect(se,Z,10,10),V[e+"_"+n].checked&&(u.beginPath(),u.lineTo(se+1,Z+6),u.lineTo(se+4,Z+9),u.lineTo(se+9,Z+2),u.stroke(),u.closePath()),u.fillStyle=be.checkstatus(h.flowdata,e,n,"fc"),u.fillText(s==null?"":s,se+14,he),u.restore()}else{if(N!=null&&N.dataBar!=null&&N.dataBar.valueLen&&N.dataBar.valueLen.toString()!=="NaN"){let oe=l+m+R,ce=t+g+I,se=T-R*2,ue=A-I*2,he=N.dataBar.valueType,Z=N.dataBar.valueLen,G=N.dataBar.format;if(he=="minus"){let le=N.dataBar.minusLen;if(G.length>1){let pe=u.createLinearGradient(oe+se*le*(1-Z),ce,oe+se*le,ce);pe.addColorStop(0,"#ffffff"),pe.addColorStop(1,"#ff0000"),u.fillStyle=pe}else u.fillStyle="#ff0000";u.fillRect(oe+se*le*(1-Z),ce,se*le*Z,ue),u.beginPath(),u.moveTo(oe+se*le*(1-Z),ce),u.lineTo(oe+se*le*(1-Z),ce+ue),u.lineTo(oe+se*le,ce+ue),u.lineTo(oe+se*le,ce),u.lineTo(oe+se*le*(1-Z),ce),u.lineWidth=1,u.strokeStyle="#ff0000",u.stroke(),u.closePath()}else if(he=="plus"){let le=N.dataBar.plusLen;if(le==1){if(G.length>1){let pe=u.createLinearGradient(oe,ce,oe+se*Z,ce);pe.addColorStop(0,G[0]),pe.addColorStop(1,G[1]),u.fillStyle=pe}else u.fillStyle=G[0];u.fillRect(oe,ce,se*Z,ue),u.beginPath(),u.moveTo(oe,ce),u.lineTo(oe,ce+ue),u.lineTo(oe+se*Z,ce+ue),u.lineTo(oe+se*Z,ce),u.lineTo(oe,ce),u.lineWidth=1,u.strokeStyle=G[0],u.stroke(),u.closePath()}else{let pe=N.dataBar.minusLen;if(G.length>1){let ie=u.createLinearGradient(oe+se*pe,ce,oe+se*pe+se*le*Z,ce);ie.addColorStop(0,G[0]),ie.addColorStop(1,G[1]),u.fillStyle=ie}else u.fillStyle=G[0];u.fillRect(oe+se*pe,ce,se*le*Z,ue),u.beginPath(),u.moveTo(oe+se*pe,ce),u.lineTo(oe+se*pe,ce+ue),u.lineTo(oe+se*pe+se*le*Z,ce+ue),u.lineTo(oe+se*pe+se*le*Z,ce),u.lineTo(oe+se*pe,ce),u.lineWidth=1,u.strokeStyle=G[0],u.stroke(),u.closePath()}}}let Y=l+m,ee=t+g+1;u.save(),u.beginPath(),u.rect(Y,ee,T,A),u.clip(),u.scale(h.zoomRatio,h.zoomRatio);let te=$r(_,u,{cellWidth:T,cellHeight:A,space_width:R,space_height:I,r:e,c:n});if(N!=null&&N.icons!=null&&te.type=="plain"){let oe=N.icons.left,ce=N.icons.top,se=te.values[0],ue=Y+se.left,he=ee+se.top-te.textHeightAll;z=="0"?he=ee+A/2-te.textHeightAll/2:z=="1"?he=ee:z=="2"&&(he=he-te.desc),he=he/h.zoomRatio,ue=ue/h.zoomRatio,u.drawImage(Ca,oe*42,ce*32,32,32,Y/h.zoomRatio,he,te.textHeightAll/h.zoomRatio,te.textHeightAll/h.zoomRatio),F!="0"&&F!="2"&&(ue=ue+te.textHeightAll/h.zoomRatio)}u.fillStyle=be.checkstatus(h.flowdata,e,n,"fc"),M!=null&&M[0]!=null&&(u.fillStyle=M[0]),N!=null&&N.textColor!=null&&(u.fillStyle=N.textColor),_.ct&&_.ct.fa&&_.ct.fa.indexOf("[Red]")>-1&&_.ct.t=="n"&&_.v<0&&(u.fillStyle="#ff0000"),Sf(te,u,{pos_x:Y,pos_y:ee}),u.restore()}q&&!h.luckysheetcurrentisPivotTable&&h.showGridLines&&(u.beginPath(),u.moveTo(o+m-2+C,t+g),u.lineTo(o+m-2+C,a+g),u.lineWidth=1,u.strokeStyle=$l.strokeStyle,u.stroke(),u.closePath()),!h.luckysheetcurrentisPivotTable&&h.showGridLines&&(u.beginPath(),u.moveTo(l+m-1,a+g-2+C),u.lineTo(o+m-1,a+g-2+C),u.lineWidth=1,u.strokeStyle=$l.strokeStyle,u.stroke(),u.closePath()),Ke.createHookFunction("cellRenderAfter",h.flowdata[e][n],{r:e,c:n,start_r:O[1],start_c:O[0],end_r:O[3]+O[1],end_c:O[2]+O[0]},ve.getSheetByIndex(),u)},Tf=function(e,n,t,l,a,o,s,u,d,f,m){let g;e==0?g=-o-1:g=h.visibledatarow[e-1]-o-1;let y=h.visibledatarow[e]-o,v;t==0?v=-s:v=h.visibledatacolumn[t-1]-s;let k=h.visibledatacolumn[l]-s,b=h.flowdata[e][n],w=k-v-2,x=y-g-2,C=2,S=2,_=v+u,T=g+d+1,A=sa(b);a.font=A,a.save(),a.beginPath(),a.rect(_,T,w,x),a.clip(),a.scale(h.zoomRatio,h.zoomRatio);let R=$r(b,a,{cellWidth:w,cellHeight:x,space_width:C,space_height:S,r:e,c:n}),I=el.checksAF(e,n,f),F=Se.checksCF(e,n,m);a.fillStyle=be.checkstatus(h.flowdata,e,n,"fc"),I!=null&&I[0]!=null&&(a.fillStyle=I[0]),F!=null&&F.textColor!=null&&(a.fillStyle=F.textColor),Sf(R,a,{pos_x:_,pos_y:T}),a.restore()}});var A2,Cl,Ya=$e(()=>{ht();Zt();Xt();Zl();qt();tl();Qt();Wt();Jt();ll();gl();Vl();ol();Dt();yt();Xe();A2={item:{linkType:"external",linkAddress:"",linkTooltip:""},hyperlink:null,createDialog:function(){let e=this,n=Q(),t=n.insertLink,l=n.toolbar,a=n.button;$("#luckysheet-modal-dialog-mask").show(),$("#luckysheet-insertLink-dialog").remove();let o="";h.luckysheetfile.forEach(k=>{o+=``});let s=` +`;$("body").append(_e(ft,{id:"luckysheet-insertLink-dialog",addclass:"luckysheet-insertLink-dialog",title:l.insertLink,content:s,botton:` + `,style:"z-index:100003"}));let u=$("#luckysheet-insertLink-dialog").find(".luckysheet-modal-dialog-content").css("min-width",350).end(),d=u.outerHeight(),f=u.outerWidth(),m=$(window).width(),g=$(window).height(),y=$(document).scrollLeft(),v=$(document).scrollTop();$("#luckysheet-insertLink-dialog").css({left:(m+y-f)/2,top:(g+v-d)/3}).show(),e.dataAllocation()},init:function(){let e=this,t=Q().insertLink;$(document).off("change.linkType").on("change.linkType","#luckysheet-insertLink-dialog-linkType",function(l){let a=this.value;$("#luckysheet-insertLink-dialog .show-box").hide(),$("#luckysheet-insertLink-dialog .show-box-"+a).show()}),$(document).off("click.confirm").on("click.confirm","#luckysheet-insertLink-dialog-confirm",function(l){let a=h.luckysheet_select_save[h.luckysheet_select_save.length-1],o=a.row_focus||a.row[0],s=a.column_focus||a.column[0],u=$("#luckysheet-insertLink-dialog-linkText").val(),d=$("#luckysheet-insertLink-dialog-linkType").val(),f=$("#luckysheet-insertLink-dialog-linkAddress").val(),m=$("#luckysheet-insertLink-dialog-linkSheet").val(),g=$("#luckysheet-insertLink-dialog-linkCell").val(),y=$("#luckysheet-insertLink-dialog-linkTooltip").val();if(d=="external"){if(/^http[s]?:\/\//.test(f)||(f="https://"+f),!/^http[s]?:\/\/([\w\-\.]+)+[\w-]*([\w\-\.\/\?%&=]+)?$/ig.test(f)){U.info('',t.tooltipInfo1);return}}else{if(!p.iscelldata(g)){U.info('',t.tooltipInfo2);return}f=m+"!"+g}(u==null||u.replace(/\s/g,"")=="")&&(u=f);let v={linkType:d,linkAddress:f,linkTooltip:y},k=$.extend(!0,{},e.hyperlink),b=$.extend(!0,{},e.hyperlink);b[o+"_"+s]=v;let w=we.deepCopyFlowData(h.flowdata),x=w[o][s];x==null&&(x={}),x.fc="rgb(0, 0, 255)",x.un=1,x.v=x.m=u,w[o][s]=x,e.ref(k,b,h.currentSheetIndex,w,[{row:[o,o],column:[s,s]}]),$("#luckysheet-modal-dialog-mask").hide(),$("#luckysheet-insertLink-dialog").hide()})},dataAllocation:function(){let e=this,n=h.luckysheet_select_save[h.luckysheet_select_save.length-1],t=n.row_focus||n.row[0],l=n.column_focus||n.column[0],o=(e.hyperlink||{})[t+"_"+l]||{},s=ze(t,l,null,"m");$("#luckysheet-insertLink-dialog-linkText").val(s);let u=o.linkType||"external";$("#luckysheet-insertLink-dialog-linkType").val(u),$("#luckysheet-insertLink-dialog .show-box").hide(),$("#luckysheet-insertLink-dialog .show-box-"+u).show();let d=o.linkAddress||"";if(u=="external")$("#luckysheet-insertLink-dialog-linkAddress").val(d);else if(p.iscelldata(d)){let m=d.split("!")[0],g=d.split("!")[1];$("#luckysheet-insertLink-dialog-linkSheet").val(m),$("#luckysheet-insertLink-dialog-linkCell").val(g)}let f=o.linkTooltip||"";$("#luckysheet-insertLink-dialog-linkTooltip").val(f)},cellFocus:function(e,n){let t=this;if(t.hyperlink==null||t.hyperlink[e+"_"+n]==null)return;let l=t.hyperlink[e+"_"+n];if(l.linkType=="external")window.open(l.linkAddress);else{let a=p.getcellrange(l.linkAddress),o=a.sheetIndex,s=[{row:a.row,column:a.column}];o!=h.currentSheetIndex&&($("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active"),$("#luckysheet-sheets-item"+o).addClass("luckysheet-sheets-item-active"),ve.changeSheet(o)),h.luckysheet_select_save=s,tt(!0);let u=a.row[0]-1==-1?0:h.visibledatarow[a.row[0]-1],d=a.column[0]-1==-1?0:h.visibledatacolumn[a.column[0]-1];$("#luckysheet-scrollbar-x").scrollLeft(d),$("#luckysheet-scrollbar-y").scrollTop(u)}},overshow:function(e){let n=this;if($("#luckysheet-hyperlink-overshow").remove(),$(e.target).closest("#luckysheet-cell-main").length==0)return;let t=nt(e.pageX,e.pageY),l=$("#luckysheet-cell-main").scrollLeft(),a=$("#luckysheet-cell-main").scrollTop(),o=t[0]+l,s=t[1]+a;if(X.freezenverticaldata!=null&&t[0]+ + +++ + +++++ + +++++ + +++ + +++ + +++ ${g}+\u5355\u51FB\u9F20\u6807\u53EF\u4EE5\u8FFD\u8E2A+ `;$(w).appendTo($("#luckysheet-cell-main"))},ref:function(e,n,t,l,a){let o=this;if(h.clearjfundo){h.jfundo.length=0;let s={};s.type="updateHyperlink",s.sheetIndex=t,s.historyHyperlink=e,s.currentHyperlink=n,s.data=h.flowdata,s.curData=l,s.range=a,h.jfredo.push(s)}o.hyperlink=n,h.luckysheetfile[K(t)].hyperlink=n,h.flowdata=l,we.webWorkerFlowDataCache(h.flowdata),h.luckysheetfile[K(t)].data=h.flowdata,ne.allowUpdate&&(ne.saveParam("all",t,n,{k:"hyperlink"}),ne.historyParam(h.flowdata,t,a[0])),setTimeout(function(){Be()},1)}},Cl=A2});function yc(e,n,t){p.execFunctionExist=[];for(let l=0;l-1)f.type="extend",f.config=$.extend(!0,{},h.config),f.curconfig=$.extend(!0,{},l),f.range=$.extend(!0,[],h.luckysheet_select_save),f.currange=a,f.ctrlType=o,f.ctrlValue=s,ne.saveParam("arc",h.currentSheetIndex,{index:s.index,len:s.len,direction:s.direction,mc:l.merge},{rc:s.type});else if(o.indexOf("dele")>-1)f.type="dele",f.config=$.extend(!0,{},h.config),f.curconfig=$.extend(!0,{},l),f.range=$.extend(!0,[],h.luckysheet_select_save),f.currange=a,f.ctrlType=o,f.ctrlValue=s,ne.saveParam("drc",h.currentSheetIndex,{index:s.index,len:s.len,mc:l.merge,borderInfo:l.borderInfo},{rc:s.type});else{f.type="datachangeAll",f.range=$.extend(!0,[],h.luckysheet_select_save),f.currange=a,f.ctrlType=o,f.ctrlValue=s,m=!0;for(let g=0;g 0&&tt(),m&&yc(a,h.currentSheetIndex,t),St(n,e),d&&(Dr=setTimeout(function(){Be()},1)),ve.storeSheetParamALL(),window.luckysheet_getcelldata_cache=null}function La(e,n,t){clearTimeout(Dr),h.clearjfundo&&(h.jfundo.length=0,h.jfredo.push({type:"rangechange",data:h.flowdata,curdata:e,range:n,sheetIndex:h.currentSheetIndex,cdformat:$.extend(!0,[],h.luckysheetfile[K(h.currentSheetIndex)].luckysheet_conditionformat_save),curCdformat:t})),h.flowdata=e,we.webWorkerFlowDataCache(h.flowdata),h.luckysheetfile[K(h.currentSheetIndex)].data=h.flowdata,t!=null&&(h.luckysheetfile[K(h.currentSheetIndex)].luckysheet_conditionformat_save=t),yc(n,h.currentSheetIndex,e),Dr=setTimeout(function(){Be()},1);for(let l=0;l 0)for(let x=0;x 0)for(let g=0;g 0&&tt(),h.luckysheetfile[K(e.sheetIndex)].luckysheet_conditionformat_save=e.curCdformat,h.luckysheetfile[K(n.sheetIndex)].luckysheet_conditionformat_save=n.curCdformat,h.currentSheetIndex==e.sheetIndex?Ye.dataVerification=e.curDataVerification:h.currentSheetIndex==n.sheetIndex&&(Ye.dataVerification=n.curDataVerification),h.luckysheetfile[K(e.sheetIndex)].dataVerification=e.curDataVerification,h.luckysheetfile[K(n.sheetIndex)].dataVerification=n.curDataVerification,p.execFunctionExist.reverse(),p.execFunctionGroup(null,null,null,null,n.curData),p.execFunctionGlobalData=null;let o=K(h.currentSheetIndex),s=h.luckysheetfile[o];s.scrollTop=$("#luckysheet-cell-main").scrollTop(),s.scrollLeft=$("#luckysheet-cell-main").scrollLeft(),ve.showSheet(),Dr=setTimeout(function(){Be()},1),ve.storeSheetParamALL(),ne.saveParam("all",e.sheetIndex,e.curConfig,{k:"config"}),ne.saveParam("all",n.sheetIndex,n.curConfig,{k:"config"}),ne.historyParam(e.curData,e.sheetIndex,{row:e.range.row,column:e.range.column}),ne.historyParam(n.curData,n.sheetIndex,{row:n.range.row,column:n.range.column}),ne.saveParam("all",e.sheetIndex,e.curCdformat,{k:"luckysheet_conditionformat_save"}),ne.saveParam("all",n.sheetIndex,n.curCdformat,{k:"luckysheet_conditionformat_save"}),ne.saveParam("all",e.sheetIndex,e.curDataVerification,{k:"dataVerification"}),ne.saveParam("all",n.sheetIndex,n.curDataVerification,{k:"dataVerification"})}function St(e,n,t=!0){vn(e,n),clearTimeout(Dr),ve.storeSheetParam();let l=h.luckysheetfile[K(h.currentSheetIndex)].calcChain;if(l!=null&&l.length>0){h.config.rowlen==null&&(h.config.rowlen={}),h.config.columnlen==null&&(h.config.columnlen={});for(let a=0;a 0&&$("#luckysheet-filter-options-sheet"+h.currentSheetIndex+" .luckysheet-filter-options").each(function(a,o){let s=$(o).data("str"),u=$(o).data("cindex"),d=h.visibledatacolumn[u]-20,f=s-1==-1?0:h.visibledatarow[s-1];$(o).css({left:d,top:f})});if($("#luckysheet-filter-selected-sheet"+h.currentSheetIndex).length>0){let a=h.luckysheetfile[K(h.currentSheetIndex)].filter_select,o=a.row[0],s=a.row[1],u=a.column[0],d=a.column[1],f=h.visibledatarow[s],m=o-1==-1?0:h.visibledatarow[o-1],g=h.visibledatacolumn[d],y=u-1==-1?0:h.visibledatacolumn[u-1];$("#luckysheet-filter-selected-sheet"+h.currentSheetIndex).css({left:y,width:g-y-1,top:m,height:f-m-1})}ve.showSheet(),t&&(Dr=setTimeout(function(){Be()},1))}function Be(e,n){if(p.groupValuesRefresh(),e==null&&(e=$("#luckysheet-cell-main").scrollLeft()),n==null&&(n=$("#luckysheet-cell-main").scrollTop()),X.freezenverticaldata!=null||X.freezenhorizontaldata!=null){let t,l,a,o,s,u,d=h.luckysheetTableContentHW[0],f=h.luckysheetTableContentHW[1];X.freezenverticaldata!=null&&X.freezenhorizontaldata!=null?(t=X.freezenhorizontaldata[0],l=X.freezenhorizontaldata[1],a=X.freezenhorizontaldata[2],o=X.freezenverticaldata[0],s=X.freezenverticaldata[1],u=X.freezenverticaldata[2],ar(u,a,o,t,1,1,null,null,"freezen_3"),ar(e+o-u,a,d-o+u,t,1,1,null,null,"freezen_4"),ar(u,n+t-a,o,f-t+a,1,1,null,null,"freezen_7"),ar(e+o-u,n+t-a,d-o+u,f-t+a,o-u+h.rowHeaderWidth,t-a+h.columnHeaderHeight),ga(u,o,h.rowHeaderWidth),ga(e+o-u,d-o+u,o-u+h.rowHeaderWidth),pa(a,t,h.columnHeaderHeight),pa(n+t-a,f-t+a,t-a+h.columnHeaderHeight)):X.freezenhorizontaldata!=null?(t=X.freezenhorizontaldata[0],l=X.freezenhorizontaldata[1],a=X.freezenhorizontaldata[2],ar(e,a,d,t,1,1,null,null,"freezen_h"),ar(e,n+t-a,d,f-t+a,null,t-a+h.columnHeaderHeight),ga(e,d,null),pa(a,t,h.columnHeaderHeight),pa(n+t-a,f-t+a,t-a+h.columnHeaderHeight)):X.freezenverticaldata!=null&&(o=X.freezenverticaldata[0],s=X.freezenverticaldata[1],u=X.freezenverticaldata[2],ar(u,n,o,f,1,1,null,null,"freezen_v"),ar(e+o-u,n,d-o+u,f,o-u+h.rowHeaderWidth,null),pa(n,f,null),ga(u,o,h.rowHeaderWidth),ga(e+o-u,d-o+u,o-u+h.rowHeaderWidth))}else{if($("#luckysheetTableContent").length==0)return;let t=$("#luckysheetTableContent").get(0).getContext("2d");ar(e,n),ga(e),pa(n),t.clearRect(0,0,h.rowHeaderWidth*h.devicePixelRatio-1,h.columnHeaderHeight*h.devicePixelRatio-1)}}var Dr,Xt=$e(()=>{Ai();qt();Qt();gr();Zt();pr();Io();Vl();ll();gl();Gr();vr();Ya();Jt();wn();Dt();Xe();Dr=null});function $f(e,n,t){return new Promise((l,a)=>{let o=new XMLHttpRequest||new ActiveXObject("Microsoft.XMLHTTP");o.open(e,n),o.send(JSON.stringify(t)),o.onreadystatechange=function(){o.readyState==4&&(o.status==200?l(o.responseText):a("error"))}})}var If=$e(()=>{});var vc,zi,ya,ne,ll=$e(()=>{vc=Nl(Fd());Hs();Xt();Qt();Wt();gl();ol();wn();Vl();Gr();jr();vr();Ya();ht();Dt();Xe();Jt();yt();zi=Nl(kn());qa();Sl();If();El();ya={gridKey:null,loadUrl:null,updateUrl:null,updateImageUrl:null,title:null,loadSheetUrl:null,retryTimer:null,allowUpdate:!1,historyParam:function(e,n,t){let l=this,a=t.row[0],o=t.row[1],s=t.column[0],u=t.column[1];if(a==o&&s==u){let d=e[a][s];l.saveParam("v",n,d,{r:a,c:s})}else{let d=o-a+1,f=u-s+1,m=Math.floor(1e3/f),g=Math.ceil(d/m);for(let y=0;y {console.log(u)}).catch(u=>{console.log(u)});else{let u=vc.default.gzip(encodeURIComponent(JSON.stringify(o)),{to:"string"});a.websocket!=null&&a.websocket.send(u)}},websocket:null,wxErrorCount:0,openWebSocket:function(){let e=this;if("WebSocket"in window){let n=e.updateUrl+"?t=111&g="+encodeURIComponent(e.gridKey);e.updateUrl.indexOf("?")>-1&&(n=e.updateUrl+"&t=111&g="+encodeURIComponent(e.gridKey)),e.websocket=new WebSocket(n),e.websocket.onopen=function(){console.info(Q().websocket.success),Si(),e.wxErrorCount=0,e.retryTimer=setInterval(function(){e.websocket.send("rub")},6e4)},e.websocket.onmessage=function(t){h.result=t;let l=new Function("return "+t.data)();Ke.createHookFunction("cooperativeMessage",l),console.info(l);let a=l.type,{message:o,id:s}=l;if(o==="\u7528\u6237\u9000\u51FA"&&($("#luckysheet-multipleRange-show-"+s).hide(),h.cooperativeEdit.changeCollaborationSize=h.cooperativeEdit.changeCollaborationSize.filter(u=>u.id!=s),h.cooperativeEdit.checkoutData=h.cooperativeEdit.checkoutData.filter(u=>u.id!=s)),a==1){let u=l.data.v.index,d=h.luckysheetfile.filter(f=>f.index===u)[0];d!==null&&setTimeout(()=>{let f=l.data.i;d.index=f,h.currentSheetIndex=f,$(`#luckysheet-sheets-item${u}`).attr("data-index",f),$(`#luckysheet-sheets-item${u}`).prop("id",`luckysheet-sheets-item${f}`),$(`#luckysheet-datavisual-selection-set-${u}`).prop("id",`luckysheet-datavisual-selection-set-${f}`)},1)}else if(a==2){let u=JSON.parse(l.data);e.wsUpdateMsg(u);let d=JSON.parse(l.data);d.k=="columnlen"?Un(d.v,null):d.k=="rowlen"&&Un(null,d.v)}else if(a==3){let u=l.id,d=l.username,f=JSON.parse(l.data),m=f.t,g=f.i,y=f.v;h.cooperativeEdit.changeCollaborationSize.length===0&&h.cooperativeEdit.changeCollaborationSize.push({id:u,v:f.v[0],i:g}),h.cooperativeEdit.changeCollaborationSize.some(x=>x.id==u)?h.cooperativeEdit.changeCollaborationSize.forEach(x=>{x.id==u&&(x.v=f.v[0]||f.range[0],x.i=g)}):h.cooperativeEdit.changeCollaborationSize.push({id:u,v:f.v[0],i:g}),P(y)!="array"&&P(y)!=="object"&&(y=JSON.parse(y));let k=0,b=0;if(g==h.currentSheetIndex?P(y)==="object"&&y.op==="enterEdit"?(k=y.range[y.range.length-1].row[0],b=y.range[y.range.length-1].column[0],e.multipleRangeShow(u,d,k,b,y.op)):(k=y[y.length-1].row[0],b=y[y.length-1].column[0],e.multipleRangeShow(u,d,k,b)):P(y)==="object"&&y.op==="enterEdit"?(k=y.range[y.range.length-1].row[0],b=y.range[y.range.length-1].column[0]):(k=y[y.length-1].row[0],b=y[y.length-1].column[0]),h.cooperativeEdit.checkoutData.length===0&&(y.op?h.cooperativeEdit.checkoutData.push({id:u,username:d,r:k,c:b,op:y.op,index:g}):h.cooperativeEdit.checkoutData.push({id:u,username:d,r:k,c:b,index:g})),h.cooperativeEdit.checkoutData.some(x=>x.id==u)?h.cooperativeEdit.checkoutData.forEach(x=>{x.id==u&&(x.username=d,x.r=k,x.c=b,x.index=g,y.op==="enterEdit"&&(x.op=y.op))}):y.op==="enterEdit"?h.cooperativeEdit.checkoutData.push({id:u,username:d,r:k,c:b,op:y.op,index:g}):h.cooperativeEdit.checkoutData.push({id:u,username:d,r:k,c:b,index:g}),h.cooperativeEdit.checkoutData.forEach(x=>{x.index!=h.currentSheetIndex&&($("#luckysheet-multipleRange-show-"+x.id).hide(),x.op=="")}),$("#luckysheet-multipleRange-show-"+u)[0]){let x=$("#luckysheet-multipleRange-show-"+u)[0].offsetHeight-1;$("#luckysheet-multipleRange-show-"+u+">.username").css({bottom:x+"px"})}}else if(a==4){let u=l.data===""?l.data:JSON.parse(l.data);for(let d=0;d 3?Pa(Q().websocket.refresh):(Pa(Q().websocket.wait),e.openWebSocket())},e.websocket.onclose=function(t){console.info(Q().websocket.close),t.code===1e3?(clearInterval(e.retryTimer),e.retryTimer=null):alert(Q().websocket.contact)}}else alert(Q().websocket.support)},wsUpdateMsg:function(e){let n=e.t,t=e.i,l=e.v,a=h.luckysheetfile[K(t)];if(!(["v","rv","cg","all","fc","drc","arc","f","fsc","fsr","sh","c"].includes(n)&&a==null))if(n=="v"){if(a.data==null||a.data.length==0)return;let o=e.r,s=e.c;a.data[o][s]=l,t==h.currentSheetIndex&&(h.flowdata=a.data,we.webWorkerFlowDataCache(h.flowdata),l!=null&&l.ps!=null?He.buildPs(o,s,l.ps):He.buildPs(o,s,null),setTimeout(function(){Be()},1))}else if(n=="rv"){if(Object.keys(e.range).length>0&&(h.cooperativeEdit.merge_range=e.range,h.cooperativeEdit.merge_range.v=e.v,Un()),a.data==null||a.data.length==0)return;let o=e.range.row[0],s=e.range.row[1],u=e.range.column[0],d=e.range.column[1];for(let f=o;f<=s;f++)for(let m=u;m<=d;m++)a.data[f][m]=l[f-o][m-u];if(t==h.currentSheetIndex){h.flowdata=a.data,we.webWorkerFlowDataCache(h.flowdata);for(let f=o;f<=s;f++)for(let m=u;m<=d;m++)l[f-o][m-u]!=null&&l[f-o][m-u].ps!=null?He.buildPs(f,m,l[f-o][m-u].ps):He.buildPs(f,m,null);setTimeout(function(){Be()},1)}}else if(n=="cg"){let o=e.k;o=="borderInfo"?a.config.borderInfo=l:(o in a.config||(a.config[o]={}),l&&typeof l=="object"&&(a.config[o]=l)),t==h.currentSheetIndex&&(h.config=a.config,(o=="rowlen"||o=="columnlen"||o=="rowhidden")&&St(h.flowdata.length,h.flowdata[0].length),setTimeout(function(){Be()},1))}else if(n=="all"){let o=e.k;if(a[o]=l,o=="name")$("#luckysheet-sheet-container-c #luckysheet-sheets-item"+t).find("span.luckysheet-sheets-item-name").html(l);else if(o=="color"){let s=$("#luckysheet-sheet-container-c #luckysheet-sheets-item"+t);s.find(".luckysheet-sheets-item-color").remove(),(l!=null||l!="")&&s.append('')}else if(o!="pivotTable")if(o=="frozen"){if(X.frozenTofreezen(),t==h.currentSheetIndex){let u=Q().freezen;a.freezen.horizontal==null?($("#luckysheet-freezen-btn-horizontal").html(' '+u.freezenRow),X.freezenhorizontaldata=null,$("#luckysheet-freezebar-horizontal").hide()):X.createFreezenHorizontal(a.freezen.horizontal.freezenhorizontaldata,a.freezen.horizontal.top),a.freezen.vertical==null?($("#luckysheet-freezen-btn-vertical").html(' '+u.freezenColumn),X.freezenverticaldata=null,$("#luckysheet-freezebar-vertical").hide()):X.createFreezenVertical(a.freezen.vertical.freezenverticaldata,a.freezen.vertical.left),X.createAssistCanvas(),setTimeout(function(){Be()},1)}}else o=="filter_select"?t==h.currentSheetIndex&&Fl(l):o=="filter"?t==h.currentSheetIndex&&Fl(a.filter_select,l):o=="luckysheet_conditionformat_save"?t==h.currentSheetIndex&&setTimeout(function(){Be()},1):o=="luckysheet_alternateformat_save"?t==h.currentSheetIndex&&setTimeout(function(){Be()},1):o=="config"?t==h.currentSheetIndex&&(h.config=l,St(h.flowdata.length,h.flowdata[0].length)):o=="dynamicArray"?t==h.currentSheetIndex&&setTimeout(function(){Be()},1):o=="images"?t==h.currentSheetIndex&&(Ie.images=l,Ie.allImagesShow(),Ie.init()):o=="dataVerification"?t==h.currentSheetIndex&&(Ye.dataVerification=l,Ye.init()):o=="hyperlink"&&t==h.currentSheetIndex&&(Cl.hyperlink=l,Cl.init())}else if(n=="fc"){let o=e.op,s=e.pos;P(l)!="object"&&(l=new Function("return "+l)());let u=l.r,d=l.c,f=a.calcChain==null?[]:a.calcChain;if(o=="add")f.push(l);else if(o=="del")for(let m=0;m '),$("#luckysheet-sheet-container-c").append(_e(Ql,{index:l.index,active:"",name:l.name,style:"",colorset:o})),$("#luckysheet-cell-main").append(''),ve.locationSheet()}else if(n=="shc"){let o=l.copyindex,s=l.name,u=K(o),d=$.extend(!0,{},h.luckysheetfile[u]);d.index=t,d.name=s,h.luckysheetfile.splice(u+1,0,d);let f=$("#luckysheet-sheets-item"+o);$("#luckysheet-sheet-container-c").append(_e(Ql,{index:d.index,active:"",name:d.name,style:"",colorset:""})),$("#luckysheet-sheets-item"+d.index).insertAfter(f),$("#luckysheet-cell-main").append('')}else if(n=="shd"){for(let o=0;o 0?d=d.eq(0).data("index"):d=u.prevAll(":visible").eq(0).data("index"),$("#luckysheet-sheets-item"+d).addClass("luckysheet-sheets-item-active"),ve.changeSheetExec(d)}ya.sheetDeleSave.push(h.luckysheetfile[o]),h.luckysheetfile.splice(o,1);break}$("#luckysheet-sheets-item"+l.deleIndex).remove(),$("#luckysheet-datavisual-selection-set-"+l.deleIndex).remove(),ve.locationSheet()}else if(n=="shr")for(let o in l)h.luckysheetfile[K(o)].order=l[o];else if(n=="shre"){for(let o=0;o '),$("#luckysheet-sheet-container-c").append(_e(Ql,{index:s.index,active:"",name:s.name,style:"",colorset:u})),$("#luckysheet-cell-main").append('');break}}else if(n=="sh"){let o=e.op,s=e.cur;o=="hide"?(a.hide=1,$("#luckysheet-sheets-item"+t).hide(),t==h.currentSheetIndex&&($("#luckysheet-sheets-item"+s).addClass("luckysheet-sheets-item-active"),ve.changeSheetExec(s))):o=="show"&&(a.hide=0,$("#luckysheet-sheets-item"+t).show()),ve.locationSheet()}else if(n=="c"){let o=e.op,s=e.cid;if(o=="add")a.chart.push(l),luckysheet.insertChartTosheet(l.sheetIndex,l.dataSheetIndex,l.option,l.chartType,l.selfOption,l.defaultOption,l.row,l.column,l.chart_selection_color,l.chart_id,l.chart_selection_id,l.chartStyle,l.rangeConfigCheck,l.rangeRowCheck,l.rangeColCheck,l.chartMarkConfig,l.chartTitleConfig,l.winWidth,l.winHeight,l.scrollLeft1,l.scrollTop1,l.chartTheme,l.myWidth,l.myHeight,l.myLeft,l.myTop,l.myindexrank1,!0);else if(o=="xy"||o=="wh"||o=="update")for(let u=0;u 16&&(n=va(n,16)+"..."),a==="enterEdit"&&(n+=" "+Q().edit.typing),$("#luckysheet-multipleRange-show-"+e).length>0)$("#luckysheet-multipleRange-show-"+e).css({position:"absolute",left:m-1,width:f-m-1,top:d-1,height:u-d-1}),$("#luckysheet-multipleRange-show-"+e+" .username").text(n),$("#luckysheet-multipleRange-show-"+e+" .username").show(),h.cooperativeEdit.usernameTimeout["user"+e]!=null&&clearTimeout(h.cooperativeEdit.usernameTimeout["user"+e]),h.cooperativeEdit.usernameTimeout["user"+e]=setTimeout(()=>{clearTimeout(h.cooperativeEdit.usernameTimeout["user"+e]),h.cooperativeEdit.usernameTimeout["user"+e]=null},10*1e3);else{let y=` + +`;$(y).appendTo($("#luckysheet-cell-main #luckysheet-multipleRange-show")),o.multipleIndex++,h.cooperativeEdit.usernameTimeout["user"+e]!=null&&clearTimeout(h.cooperativeEdit.usernameTimeout["user"+e]),h.cooperativeEdit.usernameTimeout["user"+e]=setTimeout(()=>{clearTimeout(h.cooperativeEdit.usernameTimeout["user"+e]),h.cooperativeEdit.usernameTimeout["user"+e]=null},10*1e3)}},sheetDeleSave:[],submitInterval:1e3,imagesubmitInterval:5e3,submitdatalimit:50,submitcompresslimit:1e3,checksubmit:function(e){let n=this;n.submitTimeout(),clearTimeout(n.imageRequestTimeout),n.imageRequestTimeout=setTimeout(function(){n.imageRequest()},n.imagesubmitInterval)},submitTimeout:function(){let e=this;clearTimeout(e.requestTimeOut),!e.requestLock&&e.requestlast!=null&&e.requestlast.clone().add(1,"seconds").isBefore((0,zi.default)())&&e.request(),e.requestTimeOut=setTimeout(function(){e.submitTimeout()},e.submitInterval)},requestLock:!1,requestlast:null,firstchange:!0,requestTimeOut:null,request:function(){let e=this,t=this.gridKey+"__qkcache";e.cachelocaldata(function(l,a){if(a.length==0)return;a=encodeURIComponent(JSON.stringify(a));let o=a.length,s=!1;e.requestLock=!0,e.updateUrl!=""&&$.post(e.updateUrl,{compress:s,gridKey:e.gridKey,data:a},function(u){new Function("return "+u)().status?($("#luckysheet_info_detail_update").html("\u6700\u8FD1\u5B58\u6863\u65F6\u95F4:"+(0,zi.default)().format("M-D H:m:s")),$("#luckysheet_info_detail_save").html("\u540C\u6B65\u6210\u529F"),e.clearcachelocaldata()):($("#luckysheet_info_detail_save").html("\u540C\u6B65\u5931\u8D25"),e.restorecachelocaldata()),e.requestlast=(0,zi.default)(),e.requestLock=!1})})},imageRequestLast:null,imageRequestLock:!1,imageRequestTimeout:null,imageRequest:function(){let e=this;html2canvas($("#"+container).find(".luckysheet-grid-window").get(0),{onrendered:function(n){let t=$(n).appendTo("body");t.hide();let l=t.width(),a=t.height(),o=t.get(0).getContext("2d").getImageData(0,0,l,a),s=l,u=a;s*.54>u?s=u/.54:u=s*.54;let d=$("'):o=="colorGradation"?(d=l.colorGradation,f=''):o=="icons"?(d=l.icons,f=''):(d=n.getConditionRuleName(t[a].conditionName,t[a].conditionRange,t[a].conditionValue),s.textColor!=null&&(f+=''),s.cellColor!=null&&(f+=''));let m=[];for(let y=0;y+ ${n} ++ +++ + '+d+''+f+'';$("#luckysheet-administerRule-dialog .ruleList .listBox").prepend(g)}$("#luckysheet-administerRule-dialog .ruleList .listBox .item canvas").each(function(a){let o=$(this).closest(".item").attr("data-item"),s=t[o].type,u=t[o].format,d=$(this).get(0).getContext("2d");if(s=="dataBar")if(u.length==2){let f=d.createLinearGradient(0,0,46,0);f.addColorStop(0,u[0]),f.addColorStop(1,u[1]),d.fillStyle=f,d.fillRect(0,0,46,18),d.beginPath(),d.moveTo(0,0),d.lineTo(0,18),d.lineTo(46,18),d.lineTo(46,0),d.lineTo(0,0),d.lineWidth=h.devicePixelRatio,d.strokeStyle=u[0],d.stroke(),d.closePath()}else u.length==1&&(d.fillStyle=u[0],d.fillRect(0,0,46,18),d.beginPath(),d.moveTo(0,0),d.lineTo(0,18),d.lineTo(46,18),d.lineTo(46,0),d.lineTo(0,0),d.lineWidth=h.devicePixelRatio,d.strokeStyle=u[0],d.stroke(),d.closePath());else if(s=="colorGradation"){let f=d.createLinearGradient(0,0,46,0);u.length==3?(f.addColorStop(0,u[0]),f.addColorStop(.5,u[1]),f.addColorStop(1,u[2])):u.length==2&&(f.addColorStop(0,u[0]),f.addColorStop(1,u[1])),d.fillStyle=f,d.fillRect(0,0,46,18)}else if(s=="icons"){let f=u.len,m=u.leftMin,g=u.top,y=32*f+10*(f-1),v=32,k=46,b=46*32/y;m=="0"?d.drawImage(Ca,0,g*32,y,v,0,(18-b)/2,k,b):m=="5"&&d.drawImage(Ca,210,g*32,y,v,0,(18-b)/2,k,b)}}),$("#luckysheet-administerRule-dialog .ruleList .listBox .item").eq(0).addClass("on")}},getConditionRuleName:function(e,n,t){let l;n[0]!=null?l=lt(n[0].column[0])+(n[0].row[0]+1):l=t[0];let a=Q().conditionformat;if(e=="greaterThan")return a.cellValue+" > "+l;if(e=="lessThan")return a.cellValue+" < "+l;if(e=="betweenness"){let o;return n[1]!=null?o=lt(n[1].column[0])+(n[1].row[0]+1):o=t[1],a.cellValue+" "+a.between+" "+l+" "+a.in+" "+o+" "+a.between2}else{if(e=="equal")return a.cellValue+" = "+l;if(e=="textContains")return a.cellValue+a.contain+" ="+l;if(e=="occurrenceDate")return t;if(e=="duplicateValue"){if(t=="0")return a.duplicateValue;if(t=="1")return a.uniqueValue}else{if(e=="top10")return a.top+" "+l+" "+a.oneself;if(e=="top10%")return a.top+" "+l+"% "+a.oneself;if(e=="last10")return a.last+" "+l+" "+a.oneself;if(e=="last10%")return a.last+" "+l+"% "+a.oneself;if(e=="AboveAverage")return a.aboveAverage;if(e=="SubAverage")return a.belowAverage;if(e=="formula")return l.slice(0,1)!="="&&(l="="+l),a.formula+": "+l}}},newConditionRuleDialog:function(e){let n=this,t=Q().conditionformat,l=n.getRuleExplain(0);$("#luckysheet-modal-dialog-mask").show(),$("#luckysheet-administerRule-dialog").hide(),$("#luckysheet-newConditionRule-dialog").remove();let a='";$("body").append(_e(ft,{id:"luckysheet-newConditionRule-dialog",addclass:"luckysheet-newEditorRule-dialog",title:t.newFormatRule,content:a,botton:` + `,style:"z-index:100003"}));let o=$("#luckysheet-newConditionRule-dialog").find(".luckysheet-modal-dialog-content").css("min-width",400).end(),s=o.outerHeight(),u=o.outerWidth(),d=$(window).width(),f=$(window).height(),m=$(document).scrollLeft(),g=$(document).scrollTop();$("#luckysheet-newConditionRule-dialog").css({left:(d+m-u)/2,top:(f+g-s)/3}).show(),$("#luckysheet-newConditionRule-dialog .ruleTypeBox .ruleTypeItem:eq(0)").addClass("on").siblings().removeClass("on"),n.colorSelectInit()},editorConditionRuleDialog:function(){let e=this,n=Q().conditionformat,t=e.editorRule.data;if(t==null)return;let l=t.type,a=t.format,o=t.conditionName,s,u;l=="dataBar"||l=="colorGradation"||l=="icons"?(s=0,u=l):o=="greaterThan"||o=="lessThan"||o=="betweenness"||o=="equal"||o=="textContains"||o=="occurrenceDate"?(s=1,o=="greaterThan"||o=="lessThan"||o=="betweenness"||o=="equal"?u="number":o=="textContains"?u="text":o=="occurrenceDate"&&(u="date")):o=="top10"||o=="top10%"||o=="last10"||o=="last10%"?(s=2,o=="top10"||o=="top10%"?u="top":(o=="last10"||o=="last10%")&&(u="last")):o=="AboveAverage"||o=="SubAverage"?(s=3,u=o):o=="duplicateValue"?(s=4,u=t.conditionValue):o=="formula"&&(s=5);let d=e.getRuleExplain(s);$("#luckysheet-modal-dialog-mask").show(),$("#luckysheet-administerRule-dialog").hide(),$("#luckysheet-editorConditionRule-dialog").remove();let f=''+t.chooseRuleType+"\uFF1A"+n.ruleTypeHtml()+''+t.editRuleDescription+'\uFF1A'+l+"";$("body").append(_e(ft,{id:"luckysheet-editorConditionRule-dialog",addclass:"luckysheet-newEditorRule-dialog",title:n.editFormatRule,content:f,botton:` + `,style:"z-index:100003"}));let m=$("#luckysheet-editorConditionRule-dialog").find(".luckysheet-modal-dialog-content").css("min-width",400).end(),g=m.outerHeight(),y=m.outerWidth(),v=$(window).width(),k=$(window).height(),b=$(document).scrollLeft(),w=$(document).scrollTop();if($("#luckysheet-editorConditionRule-dialog").css({left:(v+b-y)/2,top:(k+w-g)/3}).show(),e.colorSelectInit(),$("#luckysheet-editorConditionRule-dialog .ruleTypeBox .ruleTypeItem:eq("+s+")").addClass("on").siblings().removeClass("on"),$("#luckysheet-editorConditionRule-dialog #type1").val(u),(u=="dataBar"||u=="colorGradation"||u=="icons"||u=="number"||u=="text"||u=="date")&&($("#luckysheet-editorConditionRule-dialog ."+u+"Box").show(),$("#luckysheet-editorConditionRule-dialog ."+u+"Box").siblings().hide()),u=="date"&&e.daterangeInit("luckysheet-editorConditionRule-dialog"),l=="dataBar"||l=="colorGradation"||l=="icons"){if(u=="dataBar")a.length==2?$("#luckysheet-editorConditionRule-dialog .dataBarBox #type2").val("gradient"):a.length==1&&$("#luckysheet-editorConditionRule-dialog .dataBarBox #type2").val("solid"),$("#luckysheet-editorConditionRule-dialog .dataBarBox .luckysheet-conditionformat-config-color").spectrum("set",a[0]);else if(u=="colorGradation")a.length==3?($("#luckysheet-editorConditionRule-dialog .colorGradationBox #type2").val("threeColor"),$("#luckysheet-editorConditionRule-dialog .colorGradationBox .midVal").show(),$("#luckysheet-editorConditionRule-dialog .colorGradationBox .maxVal .luckysheet-conditionformat-config-color").spectrum("set",a[0]),$("#luckysheet-editorConditionRule-dialog .colorGradationBox .midVal .luckysheet-conditionformat-config-color").spectrum("set",a[1]),$("#luckysheet-editorConditionRule-dialog .colorGradationBox .minVal .luckysheet-conditionformat-config-color").spectrum("set",a[2])):a.length==2&&($("#luckysheet-editorConditionRule-dialog .colorGradationBox #type2").val("twoColor"),$("#luckysheet-editorConditionRule-dialog .colorGradationBox .midVal").hide(),$("#luckysheet-editorConditionRule-dialog .colorGradationBox .maxVal .luckysheet-conditionformat-config-color").spectrum("set",a[0]),$("#luckysheet-editorConditionRule-dialog .colorGradationBox .minVal .luckysheet-conditionformat-config-color").spectrum("set",a[1]));else if(u=="icons"){let x=a.len,C=a.leftMin,S=a.top;$("#luckysheet-editorConditionRule-dialog .iconsBox li").each(function(_,T){if($(T).find("div").attr("data-len")==x&&$(T).find("div").attr("data-leftmin")==C&&$(T).find("div").attr("data-top")==S)return $("#luckysheet-editorConditionRule-dialog .iconsBox .showbox .model").css("background-position",$(T).find("div").css("background-position")),$("#luckysheet-editorConditionRule-dialog .iconsBox .showbox .model").attr("data-len",$(T).find("div").attr("data-len")),$("#luckysheet-editorConditionRule-dialog .iconsBox .showbox .model").attr("data-leftmin",$(T).find("div").attr("data-leftmin")),$("#luckysheet-editorConditionRule-dialog .iconsBox .showbox .model").attr("data-top",$(T).find("div").attr("data-leftmin")),$("#luckysheet-editorConditionRule-dialog .iconsBox .showbox .model").attr("title",$(T).find("div").attr("title")),!0})}}else{if(u=="number"){$("#luckysheet-editorConditionRule-dialog .numberBox #type2").val(o);let x;if(t.conditionRange[0]!=null?x=wt(h.currentSheetIndex,{row:t.conditionRange[0].row,column:t.conditionRange[0].column},h.currentSheetIndex):x=t.conditionValue[0],$("#luckysheet-editorConditionRule-dialog .numberBox #conditionVal input").val(x),o=="betweenness"){$("#luckysheet-editorConditionRule-dialog .numberBox .txt").show(),$("#luckysheet-editorConditionRule-dialog .numberBox #conditionVal2").show();let C;t.conditionRange[1]!=null?C=wt(h.currentSheetIndex,{row:t.conditionRange[1].row,column:t.conditionRange[1].column},h.currentSheetIndex):C=t.conditionValue[1],$("#luckysheet-editorConditionRule-dialog .numberBox #conditionVal2 input").val(C)}else $("#luckysheet-editorConditionRule-dialog .numberBox .txt").hide(),$("#luckysheet-editorConditionRule-dialog .numberBox #conditionVal2").hide()}else if(u=="text"){let x;t.conditionRange[0]!=null?x=wt(h.currentSheetIndex,{row:t.conditionRange[0].row,column:t.conditionRange[0].column},h.currentSheetIndex):x=t.conditionValue[0],$("#luckysheet-editorConditionRule-dialog .textBox #conditionVal input").val(x)}else if(u=="date"){e.daterangeInit("luckysheet-editorConditionRule-dialog");let x=t.conditionValue[0];$("#luckysheet-editorConditionRule-dialog .dateBox #daterange-btn").val(x)}else if(u=="top"||u=="last"){let x=t.conditionValue[0];(o=="top10%"||o=="last10%")&&$("#luckysheet-editorConditionRule-dialog #isPercent").attr("checked","checked")}else if(o=="formula"){let x=t.conditionValue[0];$("#luckysheet-editorConditionRule-dialog #formulaConditionVal input").val(x)}$("#luckysheet-editorConditionRule-dialog #textcolorshow").spectrum("set",a.textColor),$("#luckysheet-editorConditionRule-dialog #cellcolorshow").spectrum("set",a.cellColor)}},infoDialog:function(e,n){$("#luckysheet-modal-dialog-mask").show(),$("#luckysheet-conditionformat-info-dialog").remove(),$("body").append(_e(ft,{id:"luckysheet-conditionformat-info-dialog",addclass:"",title:e,content:n,botton:``,style:"z-index:100003"}));let t=$("#luckysheet-conditionformat-info-dialog").find(".luckysheet-modal-dialog-content").css("min-width",300).end(),l=t.outerHeight(),a=t.outerWidth(),o=$(window).width(),s=$(window).height(),u=$(document).scrollLeft(),d=$(document).scrollTop();$("#luckysheet-conditionformat-info-dialog").css({left:(o+u-a)/2,top:(s+d-l)/3}).show()},getRuleExplain:function(e){let n=Q().conditionformat,t=this.textCellColorHtml(),l;switch(e){case 0:l=`'+n.chooseRuleType+"\uFF1A"+e.ruleTypeHtml()+''+n.editRuleDescription+'\uFF1A'+d+"${n.ruleTypeItem1}\uFF1A++ + +++`;break;case 1:l=`++ + ++ + +++ + ++${n.ruleTypeItem2_title}\uFF1A++ +++++ ++ + ++ + ++ + +${n.setFormat}:${t}`;break;case 2:l=`${n.ruleTypeItem3_title}\uFF1A++ +++ ++ + +${n.setFormat}\uFF1A${t}`;break;case 3:l=`${n.ruleTypeItem4_title}\uFF1A++ + ${n.selectRange_average} ++${n.setFormat}\uFF1A${t}`;break;case 4:l=`${n.all}\uFF1A++ + ${n.selectRange_value} ++${n.setFormat}\uFF1A${t}`;break;case 5:l=`${n.ruleTypeItem2_title}\uFF1A++++ + ++${n.setFormat}:${t}`;break}return l},daterangeInit:function(e){let n=Q().conditionformat,t=/^\d{4}-\d{2}-\d{2}$/,l=/^\d{4}-\d{2}-\d{2} to \d{4}-\d{2}-\d{2}$/;$(".ranges_1 ul").remove();let a=$("#"+e).find("#daterange-btn");a.flatpickr({mode:"range",onChange:(o,s)=>{let[u,d]=o,f=[n.yesterday,n.today],m=[n.lastWeek,n.thisWeek,n.lastMonth,n.thisMonth,n.lastYear,n.thisYear,n.last7days,n.last30days];s==n.all?a.val(""):f.indexOf(s)>-1?a.val((0,ka.default)(u).format("YYYY/MM/DD")):m.indexOf(s)>-1&&a.val((0,ka.default)(u).format("YYYY/MM/DD")+"-"+(0,ka.default)(d).format("YYYY/MM/DD"));let g=t.test(s),y=l.test(s);g?a.val((0,ka.default)(u).format("YYYY/MM/DD")):y&&a.val((0,ka.default)(u).format("YYYY/MM/DD")+"-"+(0,ka.default)(d).format("YYYY/MM/DD"))}})},CFSplitRange:function(e,n,t,l){let a=[],o=t.row[0]-n.row[0],s=t.column[0]-n.column[0],u=e.row[0],d=e.row[1],f=e.column[0],m=e.column[1];return u>=n.row[0]&&d<=n.row[1]&&f>=n.column[0]&&m<=n.column[1]?l=="allPart"?a=[{row:[u+o,d+o],column:[f+s,m+s]}]:l=="restPart"?a=[]:l=="operatePart"&&(a=[{row:[u+o,d+o],column:[f+s,m+s]}]):u>=n.row[0]&&u<=n.row[1]&&f>=n.column[0]&&m<=n.column[1]?l=="allPart"?a=[{row:[n.row[1]+1,d],column:[f,m]},{row:[u+o,n.row[1]+o],column:[f+s,m+s]}]:l=="restPart"?a=[{row:[n.row[1]+1,d],column:[f,m]}]:l=="operatePart"&&(a=[{row:[u+o,n.row[1]+o],column:[f+s,m+s]}]):d>=n.row[0]&&d<=n.row[1]&&f>=n.column[0]&&m<=n.column[1]?l=="allPart"?a=[{row:[u,n.row[0]-1],column:[f,m]},{row:[n.row[0]+o,d+o],column:[f+s,m+s]}]:l=="restPart"?a=[{row:[u,n.row[0]-1],column:[f,m]}]:l=="operatePart"&&(a=[{row:[n.row[0]+o,d+o],column:[f+s,m+s]}]):un.row[1]&&f>=n.column[0]&&m<=n.column[1]?l=="allPart"?a=[{row:[u,n.row[0]-1],column:[f,m]},{row:[n.row[1]+1,d],column:[f,m]},{row:[n.row[0]+o,n.row[1]+o],column:[f+s,m+s]}]:l=="restPart"?a=[{row:[u,n.row[0]-1],column:[f,m]},{row:[n.row[1]+1,d],column:[f,m]}]:l=="operatePart"&&(a=[{row:[n.row[0]+o,n.row[1]+o],column:[f+s,m+s]}]):f>=n.column[0]&&f<=n.column[1]&&u>=n.row[0]&&d<=n.row[1]?l=="allPart"?a=[{row:[u,d],column:[n.column[1]+1,m]},{row:[u+o,d+o],column:[f+s,n.column[1]+s]}]:l=="restPart"?a=[{row:[u,d],column:[n.column[1]+1,m]}]:l=="operatePart"&&(a=[{row:[u+o,d+o],column:[f+s,n.column[1]+s]}]):m>=n.column[0]&&m<=n.column[1]&&u>=n.row[0]&&d<=n.row[1]?l=="allPart"?a=[{row:[u,d],column:[f,n.column[0]-1]},{row:[u+o,d+o],column:[n.column[0]+s,m+s]}]:l=="restPart"?a=[{row:[u,d],column:[f,n.column[0]-1]}]:l=="operatePart"&&(a=[{row:[u+o,d+o],column:[n.column[0]+s,m+s]}]):f n.column[1]&&u>=n.row[0]&&d<=n.row[1]?l=="allPart"?a=[{row:[u,d],column:[f,n.column[0]-1]},{row:[u,d],column:[n.column[1]+1,m]},{row:[u+o,d+o],column:[n.column[0]+s,n.column[1]+s]}]:l=="restPart"?a=[{row:[u,d],column:[f,n.column[0]-1]},{row:[u,d],column:[n.column[1]+1,m]}]:l=="operatePart"&&(a=[{row:[u+o,d+o],column:[n.column[0]+s,n.column[1]+s]}]):u>=n.row[0]&&u<=n.row[1]&&f>=n.column[0]&&f<=n.column[1]?l=="allPart"?a=[{row:[u,n.row[1]],column:[n.column[1]+1,m]},{row:[n.row[1]+1,d],column:[f,m]},{row:[u+o,n.row[1]+o],column:[f+s,n.column[1]+s]}]:l=="restPart"?a=[{row:[u,n.row[1]],column:[n.column[1]+1,m]},{row:[n.row[1]+1,d],column:[f,m]}]:l=="operatePart"&&(a=[{row:[u+o,n.row[1]+o],column:[f+s,n.column[1]+s]}]):u>=n.row[0]&&u<=n.row[1]&&m>=n.column[0]&&m<=n.column[1]?l=="allPart"?a=[{row:[u,n.row[1]],column:[f,n.column[0]-1]},{row:[n.row[1]+1,d],column:[f,m]},{row:[u+o,n.row[1]+o],column:[n.column[0]+s,m+s]}]:l=="restPart"?a=[{row:[u,n.row[1]],column:[f,n.column[0]-1]},{row:[n.row[1]+1,d],column:[f,m]}]:l=="operatePart"&&(a=[{row:[u+o,n.row[1]+o],column:[n.column[0]+s,m+s]}]):d>=n.row[0]&&d<=n.row[1]&&f>=n.column[0]&&f<=n.column[1]?l=="allPart"?a=[{row:[u,n.row[0]-1],column:[f,m]},{row:[n.row[0],d],column:[n.column[1]+1,m]},{row:[n.row[0]+o,d+o],column:[f+s,n.column[1]+s]}]:l=="restPart"?a=[{row:[u,n.row[0]-1],column:[f,m]},{row:[n.row[0],d],column:[n.column[1]+1,m]}]:l=="operatePart"&&(a=[{row:[n.row[0]+o,d+o],column:[f+s,n.column[1]+s]}]):d>=n.row[0]&&d<=n.row[1]&&m>=n.column[0]&&m<=n.column[1]?l=="allPart"?a=[{row:[u,n.row[0]-1],column:[f,m]},{row:[n.row[0],d],column:[f,n.column[0]-1]},{row:[n.row[0]+o,d+o],column:[n.column[0]+s,m+s]}]:l=="restPart"?a=[{row:[u,n.row[0]-1],column:[f,m]},{row:[n.row[0],d],column:[f,n.column[0]-1]}]:l=="operatePart"&&(a=[{row:[n.row[0]+o,d+o],column:[n.column[0]+s,m+s]}]):u n.row[1]&&f>=n.column[0]&&f<=n.column[1]?l=="allPart"?a=[{row:[u,n.row[0]-1],column:[f,m]},{row:[n.row[0],n.row[1]],column:[n.column[1]+1,m]},{row:[n.row[1]+1,d],column:[f,m]},{row:[n.row[0]+o,n.row[1]+o],column:[f+s,n.column[1]+s]}]:l=="restPart"?a=[{row:[u,n.row[0]-1],column:[f,m]},{row:[n.row[0],n.row[1]],column:[n.column[1]+1,m]},{row:[n.row[1]+1,d],column:[f,m]}]:l=="operatePart"&&(a=[{row:[n.row[0]+o,n.row[1]+o],column:[f+s,n.column[1]+s]}]):u n.row[1]&&m>=n.column[0]&&m<=n.column[1]?l=="allPart"?a=[{row:[u,n.row[0]-1],column:[f,m]},{row:[n.row[0],n.row[1]],column:[f,n.column[0]-1]},{row:[n.row[1]+1,d],column:[f,m]},{row:[n.row[0]+o,n.row[1]+o],column:[n.column[0]+s,m+s]}]:l=="restPart"?a=[{row:[u,n.row[0]-1],column:[f,m]},{row:[n.row[0],n.row[1]],column:[f,n.column[0]-1]},{row:[n.row[1]+1,d],column:[f,m]}]:l=="operatePart"&&(a=[{row:[n.row[0]+o,n.row[1]+o],column:[n.column[0]+s,m+s]}]):f n.column[1]&&u>=n.row[0]&&u<=n.row[1]?l=="allPart"?a=[{row:[u,n.row[1]],column:[f,n.column[0]-1]},{row:[u,n.row[1]],column:[n.column[1]+1,m]},{row:[n.row[1]+1,d],column:[f,m]},{row:[u+o,n.row[1]+o],column:[n.column[0]+s,n.column[1]+s]}]:l=="restPart"?a=[{row:[u,n.row[1]],column:[f,n.column[0]-1]},{row:[u,n.row[1]],column:[n.column[1]+1,m]},{row:[n.row[1]+1,d],column:[f,m]}]:l=="operatePart"&&(a=[{row:[u+o,n.row[1]+o],column:[n.column[0]+s,n.column[1]+s]}]):f n.column[1]&&d>=n.row[0]&&d<=n.row[1]?l=="allPart"?a=[{row:[u,n.row[0]-1],column:[f,m]},{row:[n.row[0],d],column:[f,n.column[0]-1]},{row:[n.row[0],d],column:[n.column[1]+1,m]},{row:[n.row[0]+o,d+o],column:[n.column[0]+s,n.column[1]+s]}]:l=="restPart"?a=[{row:[u,n.row[0]-1],column:[f,m]},{row:[n.row[0],d],column:[f,n.column[0]-1]},{row:[n.row[0],d],column:[n.column[1]+1,m]}]:l=="operatePart"&&(a=[{row:[n.row[0]+o,d+o],column:[n.column[0]+s,n.column[1]+s]}]):u n.row[1]&&f n.column[1]?l=="allPart"?a=[{row:[u,n.row[0]-1],column:[f,m]},{row:[n.row[0],n.row[1]],column:[f,n.column[0]-1]},{row:[n.row[0],n.row[1]],column:[n.column[1]+1,m]},{row:[n.row[1]+1,d],column:[f,m]},{row:[n.row[0]+o,n.row[1]+o],column:[n.column[0]+s,n.column[1]+s]}]:l=="restPart"?a=[{row:[u,n.row[0]-1],column:[f,m]},{row:[n.row[0],n.row[1]],column:[f,n.column[0]-1]},{row:[n.row[0],n.row[1]],column:[n.column[1]+1,m]},{row:[n.row[1]+1,d],column:[f,m]}]:l=="operatePart"&&(a=[{row:[n.row[0]+o,n.row[1]+o],column:[n.column[0]+s,n.column[1]+s]}]):l=="allPart"?a=[{row:[u,d],column:[f,m]}]:l=="restPart"?a=[{row:[u,d],column:[f,m]}]:l=="operatePart"&&(a=[]),a},getcolorGradation:function(e,n,t,l,a){let o=e.split(","),s=parseInt(o[0].split("(")[1]),u=parseInt(o[1]),d=parseInt(o[2].split(")")[0]),f=n.split(","),m=parseInt(f[0].split("(")[1]),g=parseInt(f[1]),y=parseInt(f[2].split(")")[0]),v=Math.round(s-(s-m)/(t-l)*(t-a)),k=Math.round(u-(u-g)/(t-l)*(t-a)),b=Math.round(d-(d-y)/(t-l)*(t-a));return"rgb("+v+", "+k+", "+b+")"},getCFPartRange:function(e,n,t){let l=[],a=h.luckysheetfile[K(e)].luckysheet_conditionformat_save;if(a!=null&&a.length>0){e:for(let o=0;o =d&&range[y].row[0]<=f||range[y].row[1]>=d&&range[y].row[1]<=f||range[y].column[0]>=m&&range[y].column[0]<=g||range[y].column[1]>=m&&range[y].column[1]<=g){l.push(a[o]);continue e}}}}return l},checksCF:function(e,n,t){return t!=null&&e+"_"+n in t?t[e+"_"+n]:null},getComputeMap:function(e){let n=K(h.currentSheetIndex);e!=null&&(n=K(e));let t=h.luckysheetfile[n].luckysheet_conditionformat_save,l=h.luckysheetfile[n].data;return l==null?null:this.compute(t,l)},compute:function(e,n){let t=this;e==null&&(e=[]);let l={};if(e.length>0)for(let a=0;a d)&&(d=parseInt(v.v)),(f==null||parseInt(v.v) 0){let w=Math.round(parseInt(b.v)/d*100)/100;v+"_"+k in l?l[v+"_"+k].dataBar={valueType:"plus",plusLen:m,minusLen:g,valueLen:w,format:u}:l[v+"_"+k]={dataBar:{valueType:"plus",plusLen:m,minusLen:g,valueLen:w,format:u}}}}}}else{let m=1;for(let g=0;g d)&&(d=parseInt(b.v)),(f==null||parseInt(b.v) f&&parseInt(w.v) y&&parseInt(w.v) f&&parseInt(b.v) g)&&(g=parseInt(w.v)),(y==null||parseInt(w.v) =b[0]&&parseInt(T.v)<=b[1]?S+"_"+_ in l?l[S+"_"+_].icons={left:f+2,top:m}:l[S+"_"+_]={icons:{left:f+2,top:m}}:parseInt(T.v)>=w[0]&&parseInt(T.v)<=w[1]?S+"_"+_ in l?l[S+"_"+_].icons={left:f+1,top:m}:l[S+"_"+_]={icons:{left:f+1,top:m}}:parseInt(T.v)>=x[0]&&parseInt(T.v)<=x[1]&&(S+"_"+_ in l?l[S+"_"+_].icons={left:f,top:m}:l[S+"_"+_]={icons:{left:f,top:m}}))}}else if(d==4){let b,w,x,C;k==2?(b=[y,y+v],w=[y+v+1,y+v*2],x=[y+v*2+1,y+v*3],C=[y+v*3+1,g]):k==3?(b=[y,y+v],w=[y+v+1,y+v*2],x=[y+v*2+1,y+v*3+1],C=[y+v*3+2,g]):(b=[y,y+v-1],w=[y+v,y+v*2-1],x=[y+v*2,y+v*3-1],C=[y+v*3,g]);for(let S=0;S =b[0]&&parseInt(A.v)<=b[1]?_+"_"+T in l?l[_+"_"+T].icons={left:f+3,top:m}:l[_+"_"+T]={icons:{left:f+3,top:m}}:parseInt(A.v)>=w[0]&&parseInt(A.v)<=w[1]?_+"_"+T in l?l[_+"_"+T].icons={left:f+2,top:m}:l[_+"_"+T]={icons:{left:f+2,top:m}}:parseInt(A.v)>=x[0]&&parseInt(A.v)<=x[1]?_+"_"+T in l?l[_+"_"+T].icons={left:f+1,top:m}:l[_+"_"+T]={icons:{left:f+1,top:m}}:parseInt(A.v)>=C[0]&&parseInt(A.v)<=C[1]&&(_+"_"+T in l?l[_+"_"+T].icons={left:f,top:m}:l[_+"_"+T]={icons:{left:f,top:m}}))}}else if(d==5){let b,w,x,C,S;k==2?(b=[y,y+v],w=[y+v+1,y+v*2],x=[y+v*2+1,y+v*3],C=[y+v*3+1,y+v*4],S=[y+v*4+1,g]):k==3?(b=[y,y+v],w=[y+v+1,y+v*2],x=[y+v*2+1,y+v*3+1],C=[y+v*3+2,y+v*4+1],S=[y+v*4+2,g]):k==4?(b=[y,y+v],w=[y+v+1,y+v*2+1],x=[y+v*2+2,y+v*3+1],C=[y+v*3+2,y+v*4+2],S=[y+v*4+3,g]):(b=[y,y+v-1],w=[y+v,y+v*2-1],x=[y+v*2,y+v*3-1],C=[y+v*3,y+v*4-1],S=[y+v*4,g]);for(let _=0;_ =b[0]&&parseInt(R.v)<=b[1]?T+"_"+A in l?l[T+"_"+A].icons={left:f+4,top:m}:l[T+"_"+A]={icons:{left:f+4,top:m}}:parseInt(R.v)>=w[0]&&parseInt(R.v)<=w[1]?T+"_"+A in l?l[T+"_"+A].icons={left:f+3,top:m}:l[T+"_"+A]={icons:{left:f+3,top:m}}:parseInt(R.v)>=x[0]&&parseInt(R.v)<=x[1]?T+"_"+A in l?l[T+"_"+A].icons={left:f+2,top:m}:l[T+"_"+A]={icons:{left:f+2,top:m}}:parseInt(R.v)>=C[0]&&parseInt(R.v)<=C[1]?T+"_"+A in l?l[T+"_"+A].icons={left:f+1,top:m}:l[T+"_"+A]={icons:{left:f+1,top:m}}:parseInt(R.v)>=S[0]&&parseInt(R.v)<=S[1]&&(T+"_"+A in l?l[T+"_"+A].icons={left:f,top:m}:l[T+"_"+A]={icons:{left:f,top:m}}))}}}}else{let d=e[a].conditionName,f=e[a].conditionValue[0],m=e[a].conditionValue[1],g=u.textColor,y=u.cellColor;for(let v=0;v f?k+"_"+b in l?(l[k+"_"+b].textColor=g,l[k+"_"+b].cellColor=y):l[k+"_"+b]={textColor:g,cellColor:y}:d=="lessThan"&&w.v m?(k=f,b=m):(k=m,b=f);for(let w=s[v].row[0];w<=s[v].row[1];w++)for(let x=s[v].column[0];x<=s[v].column[1];x++){if(n[w]==null||n[w][x]==null)continue;let C=n[w][x];P(C)!="object"||fe(C.v)||C.v>=b&&C.v<=k&&(w+"_"+x in l?(l[w+"_"+x].textColor=g,l[w+"_"+x].cellColor=y):l[w+"_"+x]={textColor:g,cellColor:y})}}else if(d=="occurrenceDate"){let k,b;if(f.toString().indexOf("-")==-1)k=it(f)[2],b=it(f)[2];else{let w=f.toString().split("-");k=it(w[1].trim())[2],b=it(w[0].trim())[2]}for(let w=s[v].row[0];w<=s[v].row[1];w++)for(let x=s[v].column[0];x<=s[v].column[1];x++)if(!(n[w]==null||n[w][x]==null)&&n[w][x].ct!=null&&n[w][x].ct.t=="d"){let C=ze(w,x,n);C>=b&&C<=k&&(w+"_"+x in l?(l[w+"_"+x].textColor=g,l[w+"_"+x].cellColor=y):l[w+"_"+x]={textColor:g,cellColor:y})}}else if(d=="duplicateValue"){let k={};for(let b=s[v].row[0];b<=s[v].row[1];b++)for(let w=s[v].column[0];w<=s[v].column[1];w++){let x=ze(b,w,n);x in k||(k[x]=[]),k[x].push({r:b,c:w})}if(f=="0"){for(let b in k)if(b!="null"&&b!="undefined"&&k[b].length>1)for(let w=0;w w&&(x+"_"+C in l?(l[x+"_"+C].textColor=g,l[x+"_"+C].cellColor=y):l[x+"_"+C]={textColor:g,cellColor:y})}else if(d=="SubAverage")for(let x=s[v].row[0];x<=s[v].row[1];x++)for(let C=s[v].column[0];C<=s[v].column[1];C++){if(n[x]==null||n[x][C]==null)continue;ze(x,C,n) -1&&w.v>x.v||$.inArray(f,[1,"1","desc"])>-1&&w.v 0&&(T="="+p.functionCopy(T,"down",A)),R>0&&(T="="+p.functionCopy(T,"right",R));let F=p.execfunction(T)[1];typeof F!="boolean"&&(F=!!Number(F)),!!F&&(S+"_"+_ in l?(l[S+"_"+_].textColor=g,l[S+"_"+_].cellColor=y):l[S+"_"+_]={textColor:g,cellColor:y})}}}}return h.conditionFormatCells=l,l},updateItem:function(e,n,t){if(!Rr(h.currentSheetIndex))return;let l=this,a=K(h.currentSheetIndex),o=$.extend(!0,[],h.luckysheetfile),s=l.getHistoryRules(o),u;if(e=="delSheet")u=[];else{let m={type:e,cellrange:n,format:t};u=h.luckysheetfile[a].luckysheet_conditionformat_save==null?[]:h.luckysheetfile[a].luckysheet_conditionformat_save,u.push(m)}h.luckysheetfile[a].luckysheet_conditionformat_save=u;let d=$.extend(!0,[],h.luckysheetfile),f=l.getCurrentRules(d);l.ref(s,f),ne.allowUpdate&&ne.saveParam("all",h.currentSheetIndex,u,{k:"luckysheet_conditionformat_save"})},getHistoryRules:function(e){let n=[];for(let t=0;t {Jt();ol();yr();_l();Qt();tl();qt();Ua();Zt();pr();Pt();Xt();Ml();Dt();ht();Xe();yt();jr();F2={clearcopy:function(e){let n=window.clipboardData;n||e&&(n=e.originalEvent.clipboardData);let t=" ";if(h.luckysheet_selection_range=[],Bt(),n)return n.setData("Text",t),!1;{let l=$("#luckysheet-copy-content").css("visibility","hidden");l.val(t),l.focus(),l.select(),setTimeout(function(){l.blur().css("visibility","visible")},10)}},getHtmlBorderStyle:function(e,n){let t="";return e={0:"none",1:"Thin",2:"Hair",3:"Dotted",4:"Dashed",5:"DashDot",6:"DashDotDot",7:"Double",8:"Medium",9:"MediumDashed",10:"MediumDashDot",11:"MediumDashDotDot",12:"SlantedDashDot",13:"Thick"}[e.toString()],e.indexOf("Medium")>-1?t+="1pt ":e=="Thick"?t+="1.5pt ":t+="0.5pt ",e=="Hair"?t+="double ":e.indexOf("DashDotDot")>-1?t+="dotted ":e.indexOf("DashDot")>-1?t+="dashed ":e.indexOf("Dotted")>-1?t+="dotted ":e.indexOf("Dashed")>-1?t+="dashed ":t+="solid ",t+n+";"},copy:function(e){let n=window.clipboardData;n||(n=e.originalEvent.clipboardData),h.luckysheet_selection_range=[];let t=[],l=[],a=[],o=!1,s=!1;for(let y=0;y 0&&(d=Wr());let f="",m=we.deepCopyFlowData(h.flowdata),g="";for(let y=0;y ':f+=` `;for(let k=0;k "}}if(f=`':g+=' '),h.config.colhidden!=null&&h.config.colhidden[b]!=null)continue;let w=' ';if(m[v]!=null&&m[v][b]!=null){let x="",C="",S=/^(w|W)((0?)|(0\.0+))$/,_;if(m[v][b].ct!=null&&m[v][b].ct.fa!=null&&m[v][b].ct.fa.match(S)?_=ze(v,b,m):_=ze(v,b,m,"m"),x+=be.getStyleByCell(m,v,b),P(m[v][b])=="object"&&"mc"in m[v][b])if("rs"in m[v][b].mc){if(C='rowspan="'+m[v][b].mc.rs+'" colspan="'+m[v][b].mc.cs+'"',d&&d[v+"_"+b]){let T={color:{},style:{}},A={color:{},style:{}},R={color:{},style:{}},I={color:{},style:{}};for(let M=v;M ",f+=w}f+="23){let M=null,N=null;for(let E in T.color)T.color[E]>=F/2&&(M=E);for(let E in T.style)T.style[E]>=F/2&&(N=E);M!=null&&N!=null&&(x+="border-left:"+u.getHtmlBorderStyle(N,M))}if(JSON.stringify(A).length>23){let M=null,N=null;for(let E in A.color)A.color[E]>=F/2&&(M=E);for(let E in A.style)A.style[E]>=F/2&&(N=E);M!=null&&N!=null&&(x+="border-right:"+u.getHtmlBorderStyle(N,M))}if(JSON.stringify(R).length>23){let M=null,N=null;for(let E in R.color)R.color[E]>=z/2&&(M=E);for(let E in R.style)R.style[E]>=z/2&&(N=E);M!=null&&N!=null&&(x+="border-top:"+u.getHtmlBorderStyle(N,M))}if(JSON.stringify(I).length>23){let M=null,N=null;for(let E in I.color)I.color[E]>=z/2&&(M=E);for(let E in I.style)I.style[E]>=z/2&&(N=E);M!=null&&N!=null&&(x+="border-bottom:"+u.getHtmlBorderStyle(N,M))}}}else continue;else if(d&&d[v+"_"+b]){if(d[v+"_"+b].l){let T=d[v+"_"+b].l.style,A=d[v+"_"+b].l.color;x+="border-left:"+u.getHtmlBorderStyle(T,A)}if(d[v+"_"+b].r){let T=d[v+"_"+b].r.style,A=d[v+"_"+b].r.color;x+="border-right:"+u.getHtmlBorderStyle(T,A)}if(d[v+"_"+b].b){let T=d[v+"_"+b].b.style,A=d[v+"_"+b].b.color;x+="border-bottom:"+u.getHtmlBorderStyle(T,A)}if(d[v+"_"+b].t){let T=d[v+"_"+b].t.style,A=d[v+"_"+b].t.color;x+="border-top:"+u.getHtmlBorderStyle(T,A)}}w=_e(w,{style:x,span:C}),_==null&&(_=ze(v,b,m)),_==null&&m[v][b]&&m[v][b].ct&&m[v][b].ct.t=="inlineStr"&&(_=m[v][b].ct.s.map(T=>{let A=$('
');return T.v.split(`\r +`).map(I=>{if(!I)return"";let F=$("");return T.fs&&F.css("font-size",`${T.fs}pt`),T.bl&&F.css("font-weight","bold"),T.it&&F.css("font-style","italic"),T.un&&F.css("text-decoration","underline"),T.fc&&F.css("color",T.fc),T.cl?F.append(`${I}`):F.text(I),F[0].outerHTML}).join(A[0].outerHTML)}).join("")),_==null&&(_=""),w+=_}else{let x="";if(d&&d[v+"_"+b]){if(d[v+"_"+b].l){let C=d[v+"_"+b].l.style,S=d[v+"_"+b].l.color;x+="border-left:"+u.getHtmlBorderStyle(C,S)}if(d[v+"_"+b].r){let C=d[v+"_"+b].r.style,S=d[v+"_"+b].r.color;x+="border-right:"+u.getHtmlBorderStyle(C,S)}if(d[v+"_"+b].b){let C=d[v+"_"+b].b.style,S=d[v+"_"+b].b.color;x+="border-bottom:"+u.getHtmlBorderStyle(C,S)}if(d[v+"_"+b].t){let C=d[v+"_"+b].t.style,S=d[v+"_"+b].t.color;x+="border-top:"+u.getHtmlBorderStyle(C,S)}}w+="",w=_e(w,{style:x,span:""}),w+=""}w+="",h.iscopyself=!0,n)return n.setData("Text",f),!1;{let y=$("#luckysheet-copy-content");y.html(f),y.focus(),y.select(),document.execCommand("selectAll"),document.execCommand("Copy"),setTimeout(function(){$("#luckysheet-copy-content").blur()},10)}},copybyformat:function(e,n){let t=window.clipboardData;t||(t=e.originalEvent&&e.originalEvent.clipboardData),h.luckysheet_selection_range=[{row:h.luckysheet_select_save[0].row,column:h.luckysheet_select_save[0].column}],Bt();let l=n;if(h.iscopyself=!0,t)return t.setData("Text",l),!1;{let a=$("#luckysheet-copy-content");a.text(l),a.focus(),a.select(),document.execCommand("selectAll"),document.execCommand("Copy"),setTimeout(function(){a.blur()},10)}},isPasteAction:!1,paste:function(e,n){let t=this;if(h.allowEdit===!1)return;let a=Q().drag,o=$("#luckysheet-copy-content");o.focus(),o.select(),setTimeout(function(){let s=o.html();s.indexOf("luckysheet_copy_action_table")>-1&&h.luckysheet_copy_save.copyRange!=null&&h.luckysheet_copy_save.copyRange.length>0?h.luckysheet_paste_iscut?(h.luckysheet_paste_iscut=!1,t.pasteHandlerOfCutPaste(h.luckysheet_copy_save),t.clearcopy(e)):t.pasteHandlerOfCopyPaste(h.luckysheet_copy_save):s.indexOf("luckysheet_copy_action_image")>-1?Ie.pasteImgItem():n!="btn"?t.pasteHandler(s):de()?alert(a.pasteMustKeybordAlert):U.info(a.pasteMustKeybordAlertHTMLTitle,a.pasteMustKeybordAlertHTML)},10)},pasteHandler:function(e,n){if(!kr(h.luckysheet_select_save,h.currentSheetIndex)||h.allowEdit===!1)return;let l=Q().paste;if(h.luckysheet_select_save.length>1&&(de()?alert(l.errorNotAllowMulti):U.info(`${l.warning}`,l.errorNotAllowMulti)),typeof e=="object"){if(e.length==0)return;let a=$.extend(!0,{},h.config);a.merge==null&&(a.merge={}),JSON.stringify(n).length>2&&a.borderInfo==null&&(a.borderInfo=[]);let o=e.length,s=e[0].length,u=h.luckysheet_select_save[0].row[0],d=u+o-1,f=h.luckysheet_select_save[0].column[0],m=f+s-1,g=!1;if(a.merge!=null&&(g=Nt(a,u,d,f,m)),g){de()?alert(l.errorNotAllowMerged):U.info(`${l.warning}`,l.errorNotAllowMerged);return}let y=we.deepCopyFlowData(h.flowdata),v=y.length,k=y[0].length,b=d-v+1,w=m-k+1;(b>0||w>0)&&(y=Vt([].concat(y),b,w,!0)),a.rowlen==null&&(a.rowlen={});let x=!1,C={};for(let S=u;S<=d;S++){let _=[].concat(y[S]),T=h.defaultrowlen;a.rowlen[S]!=null&&(T=a.rowlen[S]);for(let A=f;A<=m;A++){P(_[A])=="object"&&"mc"in _[A]&&("rs"in _[A].mc&&delete a.merge[_[A].mc.r+"_"+_[A].mc.c],delete _[A].mc);let R=null;if(e[S-u]!=null&&e[S-u][A-f]!=null&&(R=e[S-u][A-f]),_[A]=$.extend(!0,{},R),R!=null&&"mc"in _[A]&&(_[A].mc.rs!=null?(_[A].mc.r=S,_[A].mc.c=A,a.merge[_[A].mc.r+"_"+_[A].mc.c]=_[A].mc,C[R.mc.r+"_"+R.mc.c]=[_[A].mc.r,_[A].mc.c]):_[A]={mc:{r:C[R.mc.r+"_"+R.mc.c][0],c:C[R.mc.r+"_"+R.mc.c][1]}}),n[S-u+"_"+(A-f)]){let z={rangeType:"cell",value:{row_index:S,col_index:A,l:n[S-u+"_"+(A-f)].l,r:n[S-u+"_"+(A-f)].r,t:n[S-u+"_"+(A-f)].t,b:n[S-u+"_"+(A-f)].b}};a.borderInfo.push(z)}let I=sa(_[A]),F=be.getTextSize("\u7530",I)[1];F>T&&(T=F,x=!0)}y[S]=_,T!=h.defaultrowlen&&(a.rowlen[S]=T)}if(h.luckysheet_select_save=[{row:[u,d],column:[f,m]}],b>0||w>0||x){let S={cfg:a,RowlChange:!0};Ze(y,h.luckysheet_select_save,S)}else{let S={cfg:a};Ze(y,h.luckysheet_select_save,S),tt()}}else{e=e.replace(/\r/g,"");let a=[],o=e.split(` +`),s=o[0].split(" ").length;for(let w=0;w
${g} `+f+"0&&(S.f="",p.delFunctionGroup(w+f,C+m,h.currentSheetIndex));else{let T={},A=it(_);T.v=A[2],T.ct=A[1],T.m=A[0],x[C+m]=T}}u[w+f]=x}if(d.row=[f,f+g-1],d.column=[m,m+y-1],k>0||b>0){let w={RowlChange:!0};Ze(u,h.luckysheet_select_save,w)}else Ze(u,h.luckysheet_select_save),tt()}},pasteHandlerOfCutPaste:function(e){if(!kr(h.luckysheet_select_save,h.currentSheetIndex)||h.allowEdit===!1)return;let t=Q().paste,l=$.extend(!0,{},h.config);l.merge==null&&(l.merge={});let a=e.HasMC,o=e.RowlChange,s=e.dataSheetIndex,u=e.copyRange[0].row[0],d=e.copyRange[0].row[1],f=e.copyRange[0].column[0],m=e.copyRange[0].column[1],g=$.extend(!0,[],zt({row:[u,d],column:[f,m]},s)),y=g.length,v=g[0].length,k=h.luckysheet_select_save[h.luckysheet_select_save.length-1],b=k.row_focus,w=b+y-1,x=k.column_focus,C=x+v-1,S=!1;if(l.merge!=null&&(S=Nt(l,b,w,x,C)),S){de()?alert(t.errorNotAllowMerged):U.info(`${t.warning}`,t.errorNotAllowMerged);return}let _=we.deepCopyFlowData(h.flowdata),T=_.length,A=_[0].length,R=y+b-T,I=v+x-A;(R>0||I>0)&&(_=Vt([].concat(_),R,I,!0));let F=Wr(s),z=$.extend(!0,{},h.luckysheetfile[K(s)].dataVerification),M=$.extend(!0,{},h.luckysheetfile[K(h.currentSheetIndex)].dataVerification);if(h.currentSheetIndex==s){for(let O=u;O<=d;O++)for(let V=f;V<=m;V++){let q=_[O][V];P(q)=="object"&&"mc"in q&&("rs"in q.mc&&delete l.merge[q.mc.r+"_"+q.mc.c],delete q.mc),_[O][V]=null,delete M[O+"_"+V]}if(l.borderInfo&&l.borderInfo.length>0){let O=[];for(let V=0;V =u&&W<=d&&Y>=f&&Y<=m||O.push(l.borderInfo[V])}}l.borderInfo=O}}let N={};for(let O=b;O<=w;O++){let V=[].concat(_[O]);for(let q=x;q<=C;q++){if(F[u+O-b+"_"+(f+q-x)]){let Y={rangeType:"cell",value:{row_index:O,col_index:q,l:F[u+O-b+"_"+(f+q-x)].l,r:F[u+O-b+"_"+(f+q-x)].r,t:F[u+O-b+"_"+(f+q-x)].t,b:F[u+O-b+"_"+(f+q-x)].b}};l.borderInfo==null&&(l.borderInfo=[]),l.borderInfo.push(Y)}else if(F[O+"_"+q]){let Y={rangeType:"cell",value:{row_index:O,col_index:q,l:null,r:null,t:null,b:null}};l.borderInfo==null&&(l.borderInfo=[]),l.borderInfo.push(Y)}z[u+O-b+"_"+(f+q-x)]&&(M[O+"_"+q]=z[u+O-b+"_"+(f+q-x)]),P(V[q])=="object"&&"mc"in V[q]&&("rs"in V[q].mc&&delete l.merge[V[q].mc.r+"_"+V[q].mc.c],delete V[q].mc);let W=null;g[O-b]!=null&&g[O-b][q-x]!=null&&(W=g[O-b][q-x]),V[q]=$.extend(!0,{},W),W!=null&&a&&"mc"in V[q]&&(V[q].mc.rs!=null?(V[q].mc.r=O,V[q].mc.c=q,l.merge[V[q].mc.r+"_"+V[q].mc.c]=V[q].mc,N[W.mc.r+"_"+W.mc.c]=[V[q].mc.r,V[q].mc.c]):V[q]={mc:{r:N[W.mc.r+"_"+W.mc.c][0],c:N[W.mc.r+"_"+W.mc.c][1]}})}_[O]=V}k.row=[b,w],k.column=[x,C],o&&(h.currentSheetIndex!=s?l=yl(_,b,w,l):(l=yl(_,u,d,l),l=yl(_,b,w,l)));let E,L;if(h.currentSheetIndex!=s){let O=$.extend(!0,[],h.luckysheetfile[K(s)].data),V=$.extend(!0,{},h.luckysheetfile[K(s)].config),q=$.extend(!0,[],O),W=$.extend(!0,{},V);W.merge==null&&(W.merge={});for(let se=u;se<=d;se++)for(let ue=f;ue<=m;ue++){let he=q[se][ue];P(he)=="object"&&"mc"in he&&("rs"in he.mc&&delete W.merge[he.mc.r+"_"+he.mc.c],delete he.mc),q[se][ue]=null}if(o&&(W=yl(q,u,d,W)),W.borderInfo&&W.borderInfo.length>0){let se=[];for(let ue=0;ue =u&&Z<=d&&G>=f&&G<=m||se.push(W.borderInfo[ue])}}W.borderInfo=se}let Y=$.extend(!0,[],h.luckysheetfile[K(s)].luckysheet_conditionformat_save),ee=$.extend(!0,[],Y),te=[];if(ee!=null&&ee.length>0)for(let se=0;se 0&&(Z=Z.concat(pe))}if(ee[se].cellrange=he,Z.length>0){let G=$.extend(!0,{},ee[se]);G.cellrange=Z,te.push(G)}}let oe=$.extend(!0,[],h.luckysheetfile[K(h.currentSheetIndex)].luckysheet_conditionformat_save),ce=$.extend(!0,[],oe);te.length>0&&(ce=ce.concat(te));for(let se=u;se<=d;se++)for(let ue=f;ue<=m;ue++)delete z[se+"_"+ue];E={sheetIndex:s,data:O,curData:q,config:V,curConfig:W,cdformat:Y,curCdformat:ee,dataVerification:$.extend(!0,{},h.luckysheetfile[K(s)].dataVerification),curDataVerification:z,range:{row:[u,d],column:[f,m]}},L={sheetIndex:h.currentSheetIndex,data:h.flowdata,curData:_,config:$.extend(!0,{},h.config),curConfig:l,cdformat:oe,curCdformat:ce,dataVerification:$.extend(!0,{},h.luckysheetfile[K(h.currentSheetIndex)].dataVerification),curDataVerification:M,range:{row:[b,w],column:[x,C]}}}else{let O=$.extend(!0,[],h.luckysheetfile[K(h.currentSheetIndex)].luckysheet_conditionformat_save),V=$.extend(!0,[],O);if(V!=null&&V.length>0)for(let q=0;q 0||I>0?Xa(E,L,!0):Xa(E,L,o)},pasteHandlerOfCopyPaste:function(e){if(!kr(h.luckysheet_select_save,h.currentSheetIndex))return;let t=Q().paste,l=$.extend(!0,{},h.config);l.merge==null&&(l.merge={});let a=e.HasMC,o=e.RowlChange,s=e.dataSheetIndex,u=e.copyRange[0].row[0],d=e.copyRange[0].row[1],f=e.copyRange[0].column[0],m=e.copyRange[0].column[1],g=[],y=!1;for(let ce=0;ce 1?u==e.copyRange[1].row[0]&&d==e.copyRange[1].row[1]?(se=se[0].map(function(ue,he){return se.map(function(Z){return Z[he]})}),g=g.concat(se),y=!0):f==e.copyRange[1].column[0]&&m==e.copyRange[1].column[1]&&(g=g.concat(se)):g=se}y&&(g=g[0].map(function(ce,se){return g.map(function(ue){return ue[se]})}));let v=$.extend(!0,[],g);if(e.copyRange.length>1)for(let ce=0;ce ${t.warning}`,t.errorNotAllowMerged);return}let I=(C-x+1)/k,F=(_-S+1)/b,z=we.deepCopyFlowData(h.flowdata),M=z.length,N=z[0].length,E=k+x-M,L=b+S-N;(E>0||L>0)&&(z=Vt([].concat(z),E,L,!0));let O=Wr(s),V=$.extend(!0,{},h.luckysheetfile[K(s)].dataVerification),q=null,W=0,Y=0,ee=0,te=0;for(let ce=1;ce<=I;ce++)for(let se=1;se<=F;se++){W=x+(ce-1)*k,Y=S+(se-1)*b,te=x+ce*k,ee=S+se*b;let ue=W-u,he=Y-f,Z={};for(let G=W;G 0&&(Ae="="+p.functionCopy(Ae,"down",ue)),ue<0&&(Ae="="+p.functionCopy(Ae,"up",Math.abs(ue))),he>0&&(Ae="="+p.functionCopy(Ae,"right",he)),he<0&&(Ae="="+p.functionCopy(Ae,"left",Math.abs(he)));let ae=p.execfunction(Ae,G,pe,void 0,!0);ie.spl!=null?(ie.f=ae[2],ie.v=ae[1],ie.spl=ae[3].data):(ie.f=ae[2],ie.v=ae[1],ie.ct!=null&&ie.ct.fa!=null&&(ie.m=_t(ie.ct.fa,ae[1])))}le[pe]=$.extend(!0,{},ie),ie!=null&&a&&"mc"in le[pe]&&(le[pe].mc.rs!=null?(le[pe].mc.r=G,le[pe].mc.c=pe,l.merge[le[pe].mc.r+"_"+le[pe].mc.c]=le[pe].mc,Z[ie.mc.r+"_"+ie.mc.c]=[le[pe].mc.r,le[pe].mc.c]):le[pe]={mc:{r:Z[ie.mc.r+"_"+ie.mc.c][0],c:Z[ie.mc.r+"_"+ie.mc.c][1]}})}z[G]=le}}let oe=null;if(e.copyRange.length==1){let ce=h.luckysheetfile[K(s)],se=h.luckysheetfile[K(h.currentSheetIndex)],ue=$.extend(!0,[],ce.luckysheet_conditionformat_save);if(ue!=null&&ue.length>0){oe=$.extend(!0,[],se.luckysheet_conditionformat_save);for(let he=0;he 0&&(G=G.concat(Ae))}}G.length>0&&(ue[he].cellrange=G,oe.push(ue[he]))}}}if(w.row=[x,C],w.column=[S,_],o||E>0||L>0){l=yl(z,x,C,l);let ce={cfg:l,RowlChange:!0,cdformat:oe,dataVerification:q};Ze(z,h.luckysheet_select_save,ce)}else{let ce={cfg:l,cdformat:oe,dataVerification:q};Ze(z,h.luckysheet_select_save,ce),tt()}},pasteHandlerOfPaintModel:function(e){if(!kr(h.luckysheet_select_save,h.currentSheetIndex))return;let t=Q().paste,l=$.extend(!0,{},h.config);l.merge==null&&(l.merge={});let a=e.HasMC,o=e.RowlChange,s=e.dataSheetIndex,u=e.copyRange[0].row[0],d=e.copyRange[0].row[1],f=e.copyRange[0].column[0],m=e.copyRange[0].column[1],g=$.extend(!0,[],zt({row:[u,d],column:[f,m]},s)),y=h.luckysheet_select_save[h.luckysheet_select_save.length-1],v=y.row[0],k=y.row[1],b=y.column[0],w=y.column[1],x=g.length,C=g[0].length;if(v==k&&b==w){let q=!1;if(l.merge!=null&&(q=Nt(l,v,v+x-1,b,b+C-1)),q){de()?alert(t.errorNotAllowMerged):U.info(`${t.warning}`,t.errorNotAllowMerged);return}k=v+x-1,w=b+C-1}let S=Math.ceil((k-v+1)/x),_=Math.ceil((w-b+1)/C),T=we.deepCopyFlowData(h.flowdata),A=T[0].length,R=T.length,I=Wr(s),F=$.extend(!0,{},h.luckysheetfile[K(s)].dataVerification),z=null,M=0,N=0,E=0,L=0;for(let q=1;q<=S;q++)for(let W=1;W<=_;W++){M=v+(q-1)*x,N=b+(W-1)*C,L=v+q*x>R?R:v+q*x,L>k+1&&(L=k+1),E=b+W*C>A?A:b+W*C,E>w+1&&(E=w+1);let Y={};for(let ee=M;ee {Reflect.deleteProperty(te[oe],ue)}):te[oe]={v:te[oe]},te[oe]=$.extend(!0,te[oe],ce),te[oe].ct&&te[oe].ct.t==="inlineStr"&&te[oe].ct.s.forEach(se=>se=$.extend(!0,se,ce)),a&&"mc"in te[oe]&&(te[oe].mc.rs!=null?(te[oe].mc.r=ee,te[oe].mc.rs+ee>=L&&(te[oe].mc.rs=L-ee),te[oe].mc.c=oe,te[oe].mc.cs+oe>=E&&(te[oe].mc.cs=E-oe),l.merge[te[oe].mc.r+"_"+te[oe].mc.c]=te[oe].mc,Y[ce.mc.r+"_"+ce.mc.c]=[te[oe].mc.r,te[oe].mc.c]):te[oe]={mc:{r:Y[ce.mc.r+"_"+ce.mc.c][0],c:Y[ce.mc.r+"_"+ce.mc.c][1]}}),te[oe].v!=null&&ce.ct!=null&&ce.ct.fa!=null)){let se=_t(ce.ct.fa,te[oe].v);te[oe].m=se}}T[ee]=te}}let O=null,V=$.extend(!0,[],h.luckysheetfile[K(s)].luckysheet_conditionformat_save);if(V!=null&&V.length>0){O=$.extend(!0,[],h.luckysheetfile[K(h.currentSheetIndex)].luckysheet_conditionformat_save);for(let q=0;q 0&&(Y=Y.concat(te))}Y.length>0&&(V[q].cellrange=[{row:[v,k],column:[b,w]}],O.push(V[q]))}}if(y.row=[v,k],y.column=[b,w],o){l=yl(T,v,k,l);let q={cfg:l,RowlChange:!0,cdformat:O,dataVerification:z};Ze(T,h.luckysheet_select_save,q)}else{k>=T.length&&(k=T.length-1),l=yl(T,v,k,l);let q={cfg:l,RowlChange:!0,cdformat:O,dataVerification:z};Ze(T,h.luckysheet_select_save,q),tt()}},matchcopy:function(e,n){let t=[],l=[],a,o;if(typeof e=="object")t=e;else{t=e.split(` +`);for(let s=0;s {Ka();ol()});function kc(e,n,t,l,a){let o=Su();o=_e(o,{logotitle:a}),o=_e(o,{menu:Vu()});let s=$u;h.config==null&&(h.config={}),vn(n,e);let d=Q().info,f=''+d.row+'('+d.addLast+")",m=' ",g=_e(d.pageInfo,{total:me.total?me.total:"",totalPage:me.pageInfo.totalPage?me.pageInfo.totalPage:"",currentPage:me.pageInfo.currentPage?me.pageInfo.currentPage:""}),y=' '+g+' ',v=' '+g+"",k="";me.enableAddRow&&(k+=f),me.enablePage&&(parseInt(me.pageInfo.totalPage)==1?k+=v:k+=y),me.enableAddBackTop&&(k+=m);let b=_e(' ",{height:h.rh_height,width:h.ch_width-1}),w=_e(Mu,{width:h.ch_width,index:0,column:""});s=_e(s,{width:h.ch_width,flow:b,index:0}),o=_e(o,{flow:s,rowHeader:"",columnHeader:w,functionButton:me.functionButton}),$("#"+h.container).append(o),$("#luckysheet-scrollbar-x div").width(h.ch_width),$("#luckysheet-scrollbar-y div").height(h.rh_height+h.columnHeaderHeight-h.cellMainSrollBarSize-3),$("body").append(Pu),$("body").append(Iu),$("body").append(Ru()),$("body").append(Nu),$("body").append(_e(Xi(),{menuid:"filter"})),$("body").append(_e(Ki(),{menuid:"filter"})),$("body").append(Lu()),$("#luckysheet-rows-h").width(h.rowHeaderWidth-1.5),$("#luckysheet-cols-h-c").height(h.columnHeaderHeight-1.5),$("#luckysheet-left-top").css({width:h.rowHeaderWidth-1.5,height:h.columnHeaderHeight-1.5}),$("#luckysheet_info_detail_input").val(me.title)}var Rf=$e(()=>{Wt();Sl();Gr();Zt();Qt();Ai();ht();Xe();yt()});function Af(e){e==null&&(e="chart");for(var n=window.navigator.userAgent.replace(/[^a-zA-Z0-9]/g,"").split(""),t="",l=0;l<12;l++)t+=n[Math.round(Math.random()*(n.length-1))];var a=new Date().getTime();return e+"_"+t+"_"+a}function bc(e,n){return e.replace(/\$\{([\w]+)\}/g,function(t,l){var a=n[l];return typeof a!="undefined"?a:t})}var Df=$e(()=>{});var br,Cn,E2,D,Oi=$e(()=>{ht();Pt();Ml();qt();br=Nl(kn()),Cn={v:"#VALUE!",n:"#NAME?",na:"#N/A",r:"#REF!",d:"#DIV/0!",nm:"#NUM!",nl:"#NULL!",sp:"#SPILL!"},E2={getCellDataArr:function(e,n,t){let l=[];if(e.data==null)t||(n==="number"?l.push(0):n==="text"&&l.push(""));else if(P(e.data)==="array")for(let a=0;a'+k+"1){let t=e[0].length;for(let l=1;l m)return Cn.v;l=e.data[0][o-f]}else if(e.coll==1){if(ad)return Cn.v;l=e.data[a-u][0]}l==null||fe(l.v)||l.mc!=null?n=="number"?l=0:n=="text"&&(l=""):l=l.v}else return Cn.v}else l=e;return l},getCellBoolen:function(e){let t=this.getFirstValue(e);if(H(t))return t;if(P(t)!="boolean")if(P(t)=="string"&&(t.toLowerCase()=="true"||t.toLowerCase()=="false"))t.toLowerCase()=="true"?t=!0:t.toLowerCase()=="false"&&(t=!1);else if(B(t))t=parseFloat(t),t=t!=0;else return Cn.v;return t},getCellDate:function(e){let n=this,t;if(P(e)=="array")if(P(e[0])=="array"){if(!n.isDyadicArr(e))return Cn.v;t=e[0][0]}else t=e[0];else if(P(e)=="object"&&e.startCell!=null){if(e.data==null||P(e.data)=="array"||fe(e.data.v))return Cn.v;t=e.data.v,e.data.ct!=null&&e.data.ct.t=="d"&&(t=_t("YYYY-MM-DD h:mm:ss",t))}else t=e;return t},getCellrangeDate:function(e){let n=this,t=[];if(P(e)=="array"){if(P(e[0])=="array"&&!n.isDyadicArr(e))return Cn.v;t=t.concat(n.getDataArr(e,!1))}else if(P(e)=="object"&&e.startCell!=null)if(e.data==null)t.push(0);else if(P(e.data)=="array")for(let l=0;l =(0,br.default)(a))return!0;let o=(0,br.default)(n).year(),s=(0,br.default)().set({year:o,month:2,date:1});return t.isLeapYear(o)&&(0,br.default)(n)>=(0,br.default)(s)&&(0,br.default)(e)<(0,br.default)(s)},findResultIndex:function(e,n){let t={};for(let o=1;o l&&(l=n[i].length);for(let o=1;o {Mf={},N2=function(n){var t=function(){};t.precision=1e-6,t.create=function(a){var o=new t;return o.setElements(a)};var l=t.create;t.I=function(a){for(var o=[],s=a,u;s--;)for(u=a,o[s]=[];u--;)o[s][u]=s===u?1:0;return t.create(o)},t.prototype={e:function(a,o){return a<1||a>this.elements.length||o<1||o>this.elements[0].length?null:this.elements[a-1][o-1]},dimensions:function(){var a=this.elements.length===0?0:this.elements[0].length;return{rows:this.elements.length,cols:a}},rows:function(){return this.elements.length},cols:function(){return this.elements.length===0?0:this.elements[0].length},eql:function(a){var o=a.elements||a;if((!o[0]||typeof o[0][0]=="undefined")&&(o=t.create(o).elements),this.elements.length===0||o.length===0)return this.elements.length===o.length;if(this.elements.length!==o.length||this.elements[0].length!==o[0].length)return!1;for(var s=this.elements.length,u=this.elements[0].length,d;s--;)for(d=u;d--;)if(Math.abs(this.elements[s][d]-o[s][d])>t.precision)return!1;return!0},dup:function(){return t.create(this.elements)},map:function(a,o){if(this.elements.length===0)return t.create([]);for(var s=[],u=this.elements.length,d=this.elements[0].length,f;u--;)for(f=d,s[u]=[];f--;)s[u][f]=a.call(o,this.elements[u][f],u+1,f+1);return t.create(s)},isSameSizeAs:function(a){var o=a.elements||a;return typeof o[0][0]=="undefined"&&(o=t.create(o).elements),this.elements.length===0?o.length===0:this.elements.length===o.length&&this.elements[0].length===o[0].length},add:function(a){if(this.elements.length===0)return this.map(function(s){return s});var o=a.elements||a;return typeof o[0][0]=="undefined"&&(o=t.create(o).elements),this.isSameSizeAs(o)?this.map(function(s,u,d){return s+o[u-1][d-1]}):null},subtract:function(a){if(this.elements.length===0)return this.map(function(s){return s});var o=a.elements||a;return typeof o[0][0]=="undefined"&&(o=t.create(o).elements),this.isSameSizeAs(o)?this.map(function(s,u,d){return s-o[u-1][d-1]}):null},canMultiplyFromLeft:function(a){if(this.elements.length===0)return!1;var o=a.elements||a;return typeof o[0][0]=="undefined"&&(o=t.create(o).elements),this.elements[0].length===o.length},multiply:function(a){if(this.elements.length===0)return null;if(!a.elements)return this.map(function(k){return k*a});var o=!!a.modulus,s=a.elements||a;if(typeof s[0][0]=="undefined"&&(s=t.create(s).elements),!this.canMultiplyFromLeft(s))return null;for(var u=this.elements.length,d=s[0].length,f,m=this.elements[0].length,g,y=[],v;u--;)for(f=d,y[u]=[];f--;){for(g=m,v=0;g--;)v+=this.elements[u][g]*s[g][f];y[u][f]=v}var s=t.create(y);return o?s.col(1):s},minor:function(a,o,s,u){if(this.elements.length===0)return null;for(var d=[],f=s,m,g,y,v=this.elements.length,k=this.elements[0].length;f--;)for(m=s-f-1,d[m]=[],g=u;g--;)y=u-g-1,d[m][y]=this.elements[(a+m-1)%v][(o+y-1)%k];return t.create(d)},transpose:function(){if(this.elements.length===0)return t.create([]);for(var a=this.elements.length,o,s=this.elements[0].length,u,d=[],o=s;o--;)for(u=a,d[o]=[];u--;)d[o][u]=this.elements[u][o];return t.create(d)},isSquare:function(){var a=this.elements.length===0?0:this.elements[0].length;return this.elements.length===a},max:function(){if(this.elements.length===0)return null;for(var a=0,o=this.elements.length,s=this.elements[0].length,u;o--;)for(u=s;u--;)Math.abs(this.elements[o][u])>Math.abs(a)&&(a=this.elements[o][u]);return a},indexOf:function(a){if(this.elements.length===0)return null;var o=null,s=this.elements.length,u,d=this.elements[0].length,f;for(u=0;u t.precision){o++;break}return o},augment:function(a){if(this.elements.length===0)return this.dup();var o=a.elements||a;typeof o[0][0]=="undefined"&&(o=t.create(o).elements);var s=this.dup(),u=s.elements[0].length,d=s.elements.length,f=o[0].length,m;if(d!==o.length)return null;for(;d--;)for(m=f;m--;)s.elements[d][u+m]=o[d][m];return s},inverse:function(){if(this.elements.length===0||!this.isSquare()||this.isSingular())return null;for(var a=this.elements.length,o=a,s,u=this.augment(t.I(a)).toRightTriangular(),d=u.elements[0].length,f,m,g,y=[],v;o--;){for(m=[],y[o]=[],g=u.elements[o][o],f=0;f=a&&y[o].push(v);for(u.elements[o]=m,s=o;s--;){for(m=[],f=0;f "&&(e="!="),e=="="&&(e="=="),t==null&&a==null)return"#INVERSE!";if(t=="#INVERSE!")t=0,e=="-"?e="+":e=="+"&&(e="-");else if(e=="-"&&t==null)t=0;else if(e=="/"&&(a==0||a==null))return Me.d;function o(u,d,f){if(B(u)&&(u=parseFloat(u)),B(f)&&(f=parseFloat(f)),d=="==")return u==f;if(d=="!=")return u!=f;if(d==">=")return u>=f;if(d=="<=")return u<=f;if(d==">")return u>f;if(d=="<")return u ="||e=="<="||e==">"||e=="<")if(P(t)=="array"&&P(a)=="array"){let u=[];if(P(t[0])=="array"&&P(a[0])=="array"){if(t.length!=a.length&&t[0].length!=a[0].length)return Me.na;for(let d=0;d -1){n=e.split(";");for(let t=0;t 1){l=t[0].replace(/''/g,"'"),a=t[1],l.substr(0,1)=="'"&&l.substr(l.length-1,1)=="'"&&(l=l.substring(1,l.length-1));for(let u in n)if(l==n[u].name){o=n[u].index,s=n[u].data;break}o==-1&&(o=0)}else{let u=K(h.calculateSheetIndex);l=n[u].name,o=n[u].index,s=n[u].data,a=t[0]}if(a.indexOf(":")==-1){let u=parseInt(a.replace(/[^0-9]/g,""))-1,d=hl(a.replace(/[^A-Za-z]/g,""));if(!isNaN(u)&&!isNaN(d)){let f=oa(s,{row:[u,u],column:[d,d]})[0][0];if(p.execFunctionGlobalData!=null){let v=p.execFunctionGlobalData[u+"_"+d+"_"+o];v!=null&&(f=v)}let y={sheetName:l,startCell:a,rowl:1,coll:1,data:f};return window.luckysheet_getcelldata_cache[e]=y,y}else return[]}else{a=a.split(":");let u=[],d=[];if(u[0]=parseInt(a[0].replace(/[^0-9]/g,""))-1,u[1]=parseInt(a[1].replace(/[^0-9]/g,""))-1,isNaN(u[0])&&(u[0]=0),isNaN(u[1])&&(u[1]=s.length-1),u[0]>u[1])return U.info("\u9009\u62E9\u5931\u8D25","\u8F93\u5165\u8303\u56F4\u9519\u8BEF\uFF01"),[];if(d[0]=hl(a[0].replace(/[^A-Za-z]/g,"")),d[1]=hl(a[1].replace(/[^A-Za-z]/g,"")),isNaN(d[0])&&(d[0]=0),isNaN(d[1])&&(d[1]=s[0].length-1),d[0]>d[1])return U.info("\u9009\u62E9\u5931\u8D25","\u8F93\u5165\u8303\u56F4\u9519\u8BEF\uFF01"),[];let f=oa(s,{row:u,column:d});if(p.execFunctionGlobalData!=null)for(let v=u[0];v<=u[1];v++)for(let k=d[0];k<=d[1];k++){let b=p.execFunctionGlobalData[v+"_"+k+"_"+o];b!=null&&(f[v-u[0]][k-d[0]]=b)}let m=u[1]-u[0]+1,g=d[1]-d[0]+1,y={sheetName:l,startCell:a[0],rowl:m,coll:g,data:f};return window.luckysheet_getcelldata_cache[e]=y,y}}function Ja(e){if(typeof e=="object")return e==null?"":Array.isArray(e)?it(e[0])[2]:Array.isArray(e.data)?Me.v:e.data.v===void 0?"":e.data.v;if(p.isCompareOperator(e).flag){if(typeof e=="string"||typeof e=="number")return e}else return it(e)[2];return Me.v}function Gn(){let e=arguments[0];for(let n=0;n =4){if(l=D.getFirstValue(arguments[3]),H(l))return l;if(!B(l))return p.error.v;l=parseInt(l)}var a=arguments[0].coll;if(arguments.length==5){if(a=D.getFirstValue(arguments[4]),H(a))return a;if(!B(a))return p.error.v;a=parseInt(a)}if(l<1||a<1)return p.error.r;var o=p.getcellrange(e),s=o.row[0],u=o.column[0];s+=n,u+=t;var d=s+l-1,f=u+a-1;return s<0||d>=h.flowdata.length||u<0||f>=h.flowdata[0].length?p.error.r:wt(h.calculateSheetIndex,{row:[s,d],column:[u,f]})}function Sc(e,n,t){let l,a;if(e?(a=n,l=t):(l=n,a=t),l.startCell.indexOf(":")>-1||a.indexOf(":")>-1)return Me.v;if(e)return ir(a+":"+l.startCell);{let o=a,s="";if(a.indexOf("!")>-1){let u=a.split("!");s=u[0]+"!",o=u[1]}return ir(s+l.startCell+":"+o)}}var Bi,Hi=$e(()=>{Oi();qt();tl();Pt();Zt();Ml();wc();Dt();ht();Xe();Bi=Nl(ca())});function Nf(e,n,t){let l=e.data;Vf(L2),Hf(P2,null,function(){let a=new Vuex.Store;console.info("chartmix::",chartmix.default),Vue.use(chartmix.default,{store:a});let o=document.getElementsByTagName("body")[0];chartmix.default.initChart(o,h.lang),$(".chartSetting").css({top:"1px",bottom:"1px",position:"absolute",right:"0px",width:"350px",background:"#fff",border:"1px solid #E5E5E5","z-index":1004,"box-shadow":"0px 2px 4px rgba(0,0,0,0.2)","-webkit-box-shadow":"0px 2px 4px rgba(0,0,0,0.2)","-moz-box-shadow":"0px 2px 4px rgba(0,0,0,0.2)","-moz-user-select":"none","-khtml-user-select":"none","-webkit-user-select":"none","-ms-user-select":"none","user-select":"none","padding-left":"30px",display:"none"}),h.createChart=chartmix.default.createChart,h.highlightChart=chartmix.default.highlightChart,h.deleteChart=chartmix.default.deleteChart,h.resizeChart=chartmix.default.resizeChart,h.changeChartRange=chartmix.default.changeChartRange,h.changeChartCellData=chartmix.default.changeChartCellData,h.getChartJson=chartmix.default.getChartJson,h.chart_selection=B2(),h.chartparam.jfrefreshchartall=O2,h.chartparam.changeChartCellData=chartmix.default.changeChartCellData,h.chartparam.renderChart=chartmix.default.renderChart,h.chartparam.getChartJson=chartmix.default.getChartJson,h.chartparam.insertToStore=chartmix.default.insertToStore;for(let s=0;s ${content}',u;if($(`.luckysheet-cell-main #${o}`).length===0&&(u=$(bc(s,{id:o,addclass:"luckysheet-data-visualization-chart",title:"\u56FE\u8868\u751F\u6210",content:""})).appendTo($(".luckysheet-cell-main"))),!u)return;Pf(u),$(`#${o}`).children(".luckysheet-modal-dialog-content")[0].id=a;let d=document.getElementById(o),f;f=h.chartparam.getChartJson(l.chart_id),h.chartparam.renderChart({chart_id:l.chart_id,chartOptions:f}),h.currentChart=f,Qa(a),$(`#${a}_c .luckysheet-modal-controll-del`).click(function(k){Lf(a)}),$(`#${a}_c .luckysheet-modal-controll-update`).click(function(k){Bf()}),$(`#${a}_c`).mouseup(function(k){let b=$(this).css("width"),w=$(this).css("height"),x=$(this).css("top"),C=$(this).css("left"),S=h.luckysheetfile[K(h.currentSheetIndex)];S.chart||(S.chart=[]),S.chart.forEach(_=>{_.chart_id===a&&(_.width=parseFloat(b),_.height=parseFloat(w),_.left=parseFloat(C),_.top=parseFloat(x))})}),u.children(".luckysheet-modal-dialog-content").mousedown(function(k){h.chartparam.luckysheetCurrentChartMaxState||Qa(a),k.stopPropagation()}),u.mousedown(function(k){if(!h.chartparam.luckysheetCurrentChartMaxState){Qa(a),tn(!0),!$(k.target).is(".luckysheet-modal-dialog-controll")&&!$(k.target).is(".luckysheet-modal-controll-btn")&&!$(k.target).is("i")&&(h.chartparam.luckysheetCurrentChartMoveTimeout=setTimeout(function(){h.chartparam.luckysheetCurrentChartMove=!0},100));var b=h.chartparam.luckysheetCurrentChartMoveObj.offset(),w=h.chartparam.luckysheetCurrentChartMoveObj.position();h.chartparam.luckysheetCurrentChartMoveXy=[k.pageX-b.left,k.pageY-b.top,w.left,w.top,$("#luckysheet-scrollbar-x").scrollLeft(),$("#luckysheet-scrollbar-y").scrollTop()],h.chartparam.luckysheetCurrentChartMoveWinH=$("#luckysheet-cell-main")[0].scrollHeight,h.chartparam.luckysheetCurrentChartMoveWinW=$("#luckysheet-cell-main")[0].scrollWidth,!$(k.target).hasClass("luckysheet-mousedown-cancel")&&$(k.target).filter("[class*='sp-palette']").length==0&&$(k.target).filter("[class*='sp-thumb']").length==0&&$(k.target).filter("[class*='sp-']").length==0&&($("#luckysheet-rightclick-menu").hide(),$("#luckysheet-cols-h-hover").hide(),$("#luckysheet-cols-menu-btn").hide(),$("#luckysheet-rightclick-menu").hide(),$("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu, #luckysheet-user-menu").hide(),$("body > .luckysheet-filter-menu, body > .luckysheet-filter-submenu, body > .luckysheet-cols-menu").hide()),k.stopPropagation()}}).find(".luckysheet-modal-dialog-resize-item").mousedown(function(k){if(h.chartparam.luckysheetCurrentChartActive){h.chartparam.luckysheetCurrentChartResize=$(this).data("type");var b=nt(k.pageX,k.pageY),w=$("#luckysheet-scrollbar-x").scrollLeft(),x=$("#luckysheet-scrollbar-y").scrollTop(),C=b[0]+w,S=b[1]+x,_=h.chartparam.luckysheetCurrentChartResizeObj.position();h.chartparam.luckysheetCurrentChartResizeXy=[C,S,u.width(),u.height(),_.left+w,_.top+x,w,x],h.chartparam.luckysheetCurrentChartResizeWinH=$("#luckysheet-cell-main")[0].scrollHeight,h.chartparam.luckysheetCurrentChartResizeWinW=$("#luckysheet-cell-main")[0].scrollWidth,h.chartparam.luckysheetCurrentChart=a,k.stopPropagation()}});let m=l.width,g=l.height,y=l.left,v=l.top;d.style.width=m+"px",d.style.height=g+"px",d.style.position="absolute",d.style.background="#fff",d.style.left=y+"px",d.style.top=v+"px",d.style.zIndex=h.zIndex?h.zIndex:15,h.zIndex++}}function O2(e,n,t,l,a){let o=h.luckysheetfile.find(u=>u.index==h.currentSheetIndex),s=o.chart;s&&s.forEach(u=>{var d=ir(o.name+"!"+u.chartOptions.rangeTxt);if(typeof d=="object"&&d.length!=0&&d.data.length!=null){var f=d.data;h.chartparam.changeChartCellData(u.chart_id,f)}})}function B2(){return{create:function(){var e=h.currentChart;if(e.rangeArray.length>1)return;$("#luckysheet-chart-rangeShow").empty(),$("#luckysheet-cell-selected-boxs").hide(),$("#luckysheet-cell-selected-focus").hide(),$("#luckysheet-rows-h-selected").empty(),$("#luckysheet-cols-h-selected").empty(),$("#luckysheet-row-count-show").hide(),$("#luckysheet-column-count-show").hide();var n=e.rangeArray[0].row[0],t=e.rangeArray[0].column[0],l=e.rangeSplitArray,a=e.rangeRowCheck;if(a.exits)var o=f("rowtitle",l.rowtitle.row[0]+n,l.rowtitle.row[1]+n,l.rowtitle.column[0]+t,l.rowtitle.column[1]+t);else var o="";var s=e.rangeColCheck;if(s.exits)var u=f("coltitle",l.coltitle.row[0]+n,l.coltitle.row[1]+n,l.coltitle.column[0]+t,l.coltitle.column[1]+t);else var u="";var d=f("content",l.content.row[0]+n,l.content.row[1]+n,l.content.column[0]+t,l.content.column[1]+t);$("#luckysheet-chart-rangeShow").append(o+u+d);function f(m,g,y,v,k){var b=Zi(),w=Ji(),x=b[y],C=g-1==-1?0:b[g-1],S=w[k],_=v-1==-1?0:w[v-1];if(m=="rowtitle")var T="#C65151";if(m=="coltitle")var T="#9667C0";if(m=="content")var T="#4970D1";var A='';return A}},rangeMove:!1,rangeMovexy:null,rangeMoveIndex:null,rangeMoveObj:null,rangeMoveDraging:function(e,n,t){var l=h.currentChart,a=l.rangeArray[0].row[0],o=l.rangeArray[0].column[0],s=l.rangeRowCheck,u=l.rangeColCheck,d=l.rangeSplitArray,f=nt(e.pageX,e.pageY),m=$("#luckysheet-cell-main").scrollLeft(),g=$("#luckysheet-cell-main").scrollTop(),y=f[0]+m,v=f[1]+g,k=$(window).height()+g-n-t,b=$(window).width()+m,w=Ff(v),x=w[2],C=Ef(y),S=C[2],_=Zi(),T=Ji(),A=h.chart_selection.rangeMoveObj.attr("id");if(A=="luckysheet-chart-rangeShow-content"){var R=h.chart_selection.rangeMoveIndex[0]-h.chart_selection.rangeMovexy[0]+x;s.exits?(R=_.length-1||v>k)&&(R=_.length-1-d.content.row[1]+d.content.row[0],I=_.length-1);var F=h.chart_selection.rangeMoveIndex[1]-h.chart_selection.rangeMovexy[1]+S;u.exits?(F=T.length-1||y>b)&&(F=T.length-1-d.content.column[1]+d.content.column[0],z=T.length-1),s.exits&&u.exits?(l.rangeArray=[{row:[a,I],column:[o,z]}],l.rangeSplitArray.range={row:[a,I],column:[o,z]},l.rangeSplitArray.content={row:[R-a,I-a],column:[F-o,z-o]},l.rangeSplitArray.rowtitle={row:l.rangeSplitArray.rowtitle.row,column:[F-o,z-o]},l.rangeSplitArray.coltitle={row:[R-a,I-a],column:l.rangeSplitArray.coltitle.column}):s.exits?(l.rangeArray=[{row:[a,I],column:[F,z]}],l.rangeSplitArray.range={row:[a,I],column:[F,z]},l.rangeSplitArray.content={row:[R-a,I-a],column:l.rangeSplitArray.content.column}):u.exits?(l.rangeArray=[{row:[R,I],column:[o,z]}],l.rangeSplitArray.range={row:[R,I],column:[o,z]},l.rangeSplitArray.content={row:l.rangeSplitArray.content.row,column:[F-o,z-o]}):(l.rangeArray=[{row:[R,I],column:[F,z]}],l.rangeSplitArray.range={row:[R,I],column:[F,z]})}else if(A=="luckysheet-chart-rangeShow-rowtitle"){var F=h.chart_selection.rangeMoveIndex[1]-h.chart_selection.rangeMovexy[1]+S;u.exits?(F =T.length-1||y>b)&&(F=T.length-1-d.rowtitle.column[1]+d.rowtitle.column[0],z=T.length-1),u.exits?(l.rangeArray=[{row:l.rangeArray[0].row,column:[o,z]}],l.rangeSplitArray.range={row:l.rangeArray[0].row,column:[o,z]},l.rangeSplitArray.rowtitle={row:l.rangeSplitArray.rowtitle.row,column:[F-o,z-o]},l.rangeSplitArray.content={row:l.rangeSplitArray.content.row,column:[F-o,z-o]}):(l.rangeArray=[{row:l.rangeArray[0].row,column:[F,z]}],l.rangeSplitArray.range={row:l.rangeArray[0].row,column:[F,z]})}else if(A=="luckysheet-chart-rangeShow-coltitle"){var R=h.chart_selection.rangeMoveIndex[0]-h.chart_selection.rangeMovexy[0]+x;s.exits?(R=_.length-1||v>k)&&(R=_.length-1-d.coltitle.row[1]+d.coltitle.row[0],I=_.length-1),s.exits?(l.rangeArray=[{row:[a,I],column:l.rangeArray[0].column}],l.rangeSplitArray.range={row:[a,I],column:l.rangeArray[0].column},l.rangeSplitArray.coltitle={row:[R-a,I-a],column:l.rangeSplitArray.coltitle.column},l.rangeSplitArray.content={row:[R-a,I-a],column:l.rangeSplitArray.content.column}):(l.rangeArray=[{row:[R,I],column:l.rangeArray[0].column}],l.rangeSplitArray.range={row:[R,I],column:l.rangeArray[0].column})}h.chart_selection.create()},rangeMoveDragged:function(){h.chart_selection.rangeMove=!1;var e=h.currentChart;e.rangeTxt=wt(h.currentSheetIndex,e.rangeArray[0],h.currentSheetIndex),e.chartData=zt(e.rangeArray[0],h.currentSheetIndex),h.changeChartRange(e.chart_id,e.chartData,e.rangeArray,e.rangeTxt)},rangeResize:!1,rangeResizexy:null,rangeResizeIndex:null,rangeResizeObj:null,rangeResizeDraging:function(e,n,t){var l=h.currentChart,a=l.rangeArray[0].row[0],o=l.rangeArray[0].column[0],s=l.rangeRowCheck,u=l.rangeColCheck,d=l.rangeSplitArray,f=nt(e.pageX,e.pageY),m=$("#luckysheet-cell-main").scrollLeft(),g=$("#luckysheet-cell-main").scrollTop(),y=f[0]+m,v=f[1]+g,k=$(window).height()+g-n-t,b=$(window).width()+m,w=Ff(v),x=w[2],C=Ef(y),S=C[2],_=Zi(),T=Ji(),A=h.chart_selection.rangeResizeObj.attr("id");if(A=="luckysheet-chart-rangeShow-content"){var R,I,F,z;if(h.chart_selection.rangeResize=="lt"?(R=h.chart_selection.rangeResizeIndex.row[0],F=h.chart_selection.rangeResizeIndex.column[0],I=h.chart_selection.rangeResizeIndex.row[1],z=h.chart_selection.rangeResizeIndex.column[1]):h.chart_selection.rangeResize=="lb"?(R=h.chart_selection.rangeResizeIndex.row[1],F=h.chart_selection.rangeResizeIndex.column[0],I=h.chart_selection.rangeResizeIndex.row[0],z=h.chart_selection.rangeResizeIndex.column[1]):h.chart_selection.rangeResize=="rt"?(R=h.chart_selection.rangeResizeIndex.row[0],F=h.chart_selection.rangeResizeIndex.column[1],I=h.chart_selection.rangeResizeIndex.row[1],z=h.chart_selection.rangeResizeIndex.column[0]):h.chart_selection.rangeResize=="rb"&&(R=h.chart_selection.rangeResizeIndex.row[1],F=h.chart_selection.rangeResizeIndex.column[1],I=h.chart_selection.rangeResizeIndex.row[0],z=h.chart_selection.rangeResizeIndex.column[0]),s.exits){var M=R-h.chart_selection.rangeResizexy[0]+x;M=_.length-1||v>k)&&(M=_.length-1)}else{var M=a-h.chart_selection.rangeResizexy[0]+x;M<0||v<0?M=0:(M>=_.length-1||v>k)&&(M=_.length-1)}if(u.exits){var N=F-h.chart_selection.rangeResizexy[1]+S;N =T.length-1||y>b)&&(N=T.length-1)}else{var N=o-h.chart_selection.rangeResizexy[1]+S;N<0||y<0?N=0:(N>=T.length-1||y>b)&&(N=T.length-1)}var E,L,O,V;M>I?(E=I,L=M):(E=M,L=I),N>z?(O=z,V=N):(O=N,V=z),!s.exits&&!u.exits?(l.rangeArray=[{row:[E,L],column:[O,V]}],l.rangeSplitArray.range={row:[E,L],column:[O,V]}):(l.rangeArray=[{row:[a,L],column:[o,V]}],l.rangeSplitArray.range={row:[a,L],column:[o,V]},l.rangeSplitArray.content={row:[E-a,L-a],column:[O-o,V-o]},s.exits&&(l.rangeSplitArray.rowtitle={row:l.rangeSplitArray.rowtitle.row,column:[O-o,V-o]}),u.exits&&(l.rangeSplitArray.coltitle={row:[E-a,L-a],column:l.rangeSplitArray.coltitle.column}))}else if(A=="luckysheet-chart-rangeShow-rowtitle"){var F,z;if(h.chart_selection.rangeResize=="lt"||h.chart_selection.rangeResize=="lb"?(F=h.chart_selection.rangeResizeIndex.column[0],z=h.chart_selection.rangeResizeIndex.column[1]):(h.chart_selection.rangeResize=="rt"||h.chart_selection.rangeResize=="rb")&&(F=h.chart_selection.rangeResizeIndex.column[1],z=h.chart_selection.rangeResizeIndex.column[0]),u.exits){var N=F-h.chart_selection.rangeResizexy[1]+S;N =T.length-1||y>b)&&(N=T.length-1)}else{var N=o-h.chart_selection.rangeResizexy[1]+S;N<0||y<0?N=0:(N>=T.length-1||y>b)&&(N=T.length-1)}var O,V;N>z?(O=z,V=N):(O=N,V=z),u.exits?(l.rangeArray=[{row:l.rangeArray[0].row,column:[o,V]}],l.rangeSplitArray.range={row:l.rangeArray[0].row,column:[o,V]},l.rangeSplitArray.rowtitle={row:l.rangeSplitArray.rowtitle.row,column:[O-o,V-o]},l.rangeSplitArray.content={row:l.rangeSplitArray.content.row,column:[O-o,V-o]}):(l.rangeArray=[{row:l.rangeArray[0].row,column:[O,V]}],l.rangeSplitArray.range={row:l.rangeArray[0].row,column:[O,V]})}else if(A=="luckysheet-chart-rangeShow-coltitle"){var R,I;if(h.chart_selection.rangeResize=="lt"||h.chart_selection.rangeResize=="rt"?(R=h.chart_selection.rangeResizeIndex.row[0],I=h.chart_selection.rangeResizeIndex.row[1]):(h.chart_selection.rangeResize=="lb"||h.chart_selection.rangeResize=="rb")&&(R=h.chart_selection.rangeResizeIndex.row[1],I=h.chart_selection.rangeResizeIndex.row[0]),s.exits){var M=R-h.chart_selection.rangeResizexy[0]+x;M=_.length-1||v>k)&&(M=_.length-1)}else{var M=a-h.chart_selection.rangeResizexy[0]+x;M<0||v<0?M=0:(M>=_.length-1||v>k)&&(M=_.length-1)}var E,L;M>I?(E=I,L=M):(E=M,L=I),s.exits?(l.rangeArray=[{row:[a,L],column:l.rangeArray[0].column}],l.rangeSplitArray.range={row:[a,L],column:l.rangeArray[0].column},l.rangeSplitArray.coltitle={row:[E-a,L-a],column:l.rangeSplitArray.coltitle.column},l.rangeSplitArray.content={row:[E-a,L-a],column:l.rangeSplitArray.content.column}):(l.rangeArray=[{row:[E,L],column:l.rangeArray[0].column}],l.rangeSplitArray.range={row:[E,L],column:l.rangeArray[0].column})}h.chart_selection.create()},rangeResizeDragged:function(){h.chart_selection.rangeResize=null;var e=h.currentChart;e.rangeTxt=wt(h.currentSheetIndex,e.rangeArray[0],h.currentSheetIndex),e.chartData=zt(e.rangeArray[0],h.currentSheetIndex),h.changeChartRange(e.chart_id,e.chartData,e.rangeArray,e.rangeTxt)}}}function $c(e,n,t,l){var a=luckysheet.getluckysheet_select_save();a.length==1&&a[0].row[0]==a[0].row[1]&&a[0].column[0]==a[0].column[1]&&(sn("right","rangeOfSelect"),sn("down","rangeOfSelect"),a=luckysheet.getluckysheet_select_save());for(var o=-1,s=a[0].row[1]-a[0].row[0],u=a[0].row[0];u<=a[0].row[1];u++){for(var d=a[0].column[0];d<=a[0].column[1];d++){var f=ze(u,d,luckysheet.flowdata());if(f!=null&&f.toString().length>0){o=u;break}}if(o!==-1)break}o==-1&&(o=0),a[0].row=[o,o],a[0].row_focus=o,luckysheet.setluckysheet_select_save(a),h.luckysheet_shiftpositon=$.extend(!0,{},a[0]),Ba("down","range",!1,s),a=luckysheet.getluckysheet_select_save();for(var m=-1,g=a[0].column[1]-a[0].column[0],d=a[0].column[0];d<=a[0].column[1];d++){for(var u=a[0].row[0];u<=a[0].row[1];u++){var f=ze(u,d,luckysheet.flowdata());if(f!=null&&f.toString().length>0){m=d;break}}if(m!==-1)break}m==-1&&(m=0),a[0].column=[m,m],a[0].column_focus=m,luckysheet.setluckysheet_select_save(a),h.luckysheet_shiftpositon=$.extend(!0,{},a[0]),Ba("right","range",!1,g),a=luckysheet.getluckysheet_select_save();var y=$.extend(!0,[],a),v=wt(h.currentSheetIndex,y[0],h.currentSheetIndex);let k=zt();console.dir(k);let b=Af("chart"),w=b+"_c",x=' ',C=$(bc(x,{id:w,addclass:"luckysheet-data-visualization-chart",title:"\u56FE\u8868\u751F\u6210",content:""})).appendTo($(".luckysheet-cell-main")),S=document.getElementById(w),{render:_,chart_json:T}=h.createChart($(`#${w}`).children(".luckysheet-modal-dialog-content")[0],k,b,y,v);e=e||400,n=n||250,t=t||0,l=l||0,S.style.width=e+"px",S.style.height=n+"px",S.style.position="absolute",S.style.background="#fff",S.style.left=t+"px",S.style.top=l+"px",_.style.width="100%",_.style.height="100%",S.style.zIndex=h.zIndex?h.zIndex:15,h.zIndex++;let A=h.luckysheetfile[K(h.currentSheetIndex)];A.chart||(A.chart=[]),A.chart.push({chart_id:b,width:e,height:n,left:t,top:l,chartOptions:T.chartOptions,sheetIndex:A.index}),Qa(b),$(`#${b}_c .luckysheet-modal-controll-del`).click(function(R){Lf(b)}),Pf(C),$(`#${b}_c .luckysheet-modal-controll-update`).click(function(R){Bf()}),C.children(".luckysheet-modal-dialog-content").mousedown(function(R){h.chartparam.luckysheetCurrentChartMaxState||Qa(b),R.stopPropagation()}),C.mousedown(function(R){if(!h.chartparam.luckysheetCurrentChartMaxState){Qa(b),tn(!0),!$(R.target).is(".luckysheet-modal-dialog-controll")&&!$(R.target).is(".luckysheet-modal-controll-btn")&&!$(R.target).is("i")&&(h.chartparam.luckysheetCurrentChartMoveTimeout=setTimeout(function(){h.chartparam.luckysheetCurrentChartMove=!0},100));var I=h.chartparam.luckysheetCurrentChartMoveObj.offset(),F=h.chartparam.luckysheetCurrentChartMoveObj.position();h.chartparam.luckysheetCurrentChartMoveXy=[R.pageX-I.left,R.pageY-I.top,F.left,F.top,$("#luckysheet-scrollbar-x").scrollLeft(),$("#luckysheet-scrollbar-y").scrollTop()],h.chartparam.luckysheetCurrentChartMoveWinH=$("#luckysheet-cell-main")[0].scrollHeight,h.chartparam.luckysheetCurrentChartMoveWinW=$("#luckysheet-cell-main")[0].scrollWidth,!$(R.target).hasClass("luckysheet-mousedown-cancel")&&$(R.target).filter("[class*='sp-palette']").length==0&&$(R.target).filter("[class*='sp-thumb']").length==0&&$(R.target).filter("[class*='sp-']").length==0&&($("#luckysheet-rightclick-menu").hide(),$("#luckysheet-cols-h-hover").hide(),$("#luckysheet-cols-menu-btn").hide(),$("#luckysheet-rightclick-menu").hide(),$("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu, #luckysheet-user-menu").hide(),$("body > .luckysheet-filter-menu, body > .luckysheet-filter-submenu, body > .luckysheet-cols-menu").hide()),R.stopPropagation()}}).find(".luckysheet-modal-dialog-resize-item").mousedown(function(R){if(h.chartparam.luckysheetCurrentChartActive){h.chartparam.luckysheetCurrentChartResize=$(this).data("type");var I=nt(R.pageX,R.pageY),F=$("#luckysheet-scrollbar-x").scrollLeft(),z=$("#luckysheet-scrollbar-y").scrollTop(),M=I[0]+F,N=I[1]+z,E=h.chartparam.luckysheetCurrentChartResizeObj.position();h.chartparam.luckysheetCurrentChartResizeXy=[M,N,C.width(),C.height(),E.left+F,E.top+z,F,z],h.chartparam.luckysheetCurrentChartResizeWinH=$("#luckysheet-cell-main")[0].scrollHeight,h.chartparam.luckysheetCurrentChartResizeWinW=$("#luckysheet-cell-main")[0].scrollWidth,h.chartparam.luckysheetCurrentChart=b,R.stopPropagation()}}),$(`#${b}_c`).mouseup(function(R){let I=$(this).css("width"),F=$(this).css("height"),z=$(this).css("top"),M=$(this).css("left"),N=h.luckysheetfile[K(h.currentSheetIndex)];N.chart||(N.chart=[]),N.chart.forEach(E=>{E.chart_id===b&&(E.width=parseFloat(I),E.height=parseFloat(F),E.left=parseFloat(M),E.top=parseFloat(z))})})}function Pf(e){e.find(".luckysheet-modal-dialog-content").hover(function(){e.removeClass("chart-moveable")},function(){e.addClass("chart-moveable")}),e.hover(function(){e.addClass("chart-moveable")},function(){e.removeClass("chart-moveable")})}function Lf(e){$(`.luckysheet-cell-main #${e}_c`).remove(),Ic();let n=h.luckysheetfile[K(h.currentSheetIndex)],t=n.chart.findIndex(l=>l.chart_id==e);n.chart.splice(t,1),h.deleteChart(e)}function Qa(e){let n=h.luckysheetfile[K(h.currentSheetIndex)].chart;for(let t in n)n[t].needRangeShow=!1,n[t].chart_id==e&&(n[t].needRangeShow=!0,h.currentChart=h.getChartJson(e));zf(e)}function Ic(){let e=h.luckysheetfile[K(h.currentSheetIndex)].chart;for(let n in e)e[n].needRangeShow=!1;Of()}function zf(e){let n=$("#"+e+"_c");h.chart_selection.create(),h.chartparam.luckysheetCurrentChartActive=!0,h.chartparam.luckysheetCurrentChartMoveObj=n,h.chartparam.luckysheetCurrentChartResizeObj=n,h.chartparam.luckysheetCurrentChart=e,$("#luckysheet-cell-main").find(".luckysheet-modal-dialog-chart .luckysheet-modal-dialog-resize").hide(),$("#luckysheet-cell-main").find(".luckysheet-modal-dialog-chart .luckysheet-modal-dialog-controll").hide(),n.css("z-index",h.chartparam.luckysheetCurrentChartZIndexRank++),n.find(".luckysheet-modal-dialog-resize").show(),n.find(".luckysheet-modal-dialog-controll").show(),($(".chartSetting").is(":visible")||h.chartparam.luckysheet_chart_redo_click)&&e!=h.chartparam.luckysheetCurrentChart&&$("body .luckysheet-cols-menu").hide(),h.currentChart=h.highlightChart(e)}function Of(e){$("#luckysheet-cell-main .luckysheet-modal-dialog-chart .luckysheet-modal-dialog-resize, #luckysheet-cell-main .luckysheet-modal-dialog-chart .luckysheet-modal-dialog-controll").hide(),$("#luckysheet-cell-main").find(".luckysheet-datavisual-selection-set div").remove(),h.chartparam.luckysheetCurrentChartActive=!1,$("#luckysheet-chart-rangeShow").empty(),!e&&$(".chartSetting").is(":visible")&&!de()&&H2()}function Bf(e,n){$(".chartSetting").is(":visible")||($(".chartSetting").show(),$("#luckysheet-cell-main").find(".luckysheet-datavisual-selection-set div").show(),h.chartparam.luckysheetCurrentChartActive=!0,setTimeout(function(){$t()},0))}function H2(e){$(".chartSetting").is(":visible")&&($(".chartSetting").hide(),$("#luckysheet-cell-main .luckysheet-modal-dialog-chart .luckysheet-modal-dialog-resize, #luckysheet-cell-main .luckysheet-modal-dialog-chart .luckysheet-modal-dialog-controll").hide(),$("#luckysheet-cell-main").find(".luckysheet-datavisual-selection-set div").remove(),h.chartparam.luckysheetCurrentChartActive=!1,!de()&&!e&&setTimeout(function(){$t()},0))}function Rc(e){Of("true"),h.luckysheetfile.forEach(t=>{t.index==e?(t.chart||[]).forEach(a=>{a.isShow=!0,$("#"+a.chart_id+"_c").show(),h.resizeChart(a.chart_id),a.needRangeShow==!0&&(h.currentChart=h.getChartJson(a.chart_id),zf(a.chart_id))}):(t.chart||[]).forEach(a=>{a.isShow=!1,$("#"+a.chart_id+"_c").hide()})})}var Ff,Ef,P2,L2,Ao=$e(()=>{ht();Df();Zt();Xe();qt();Hi();Dt();Zl();Rn();Ha();Pt();nr();Xe();Ff=xt,Ef=bt,P2=["https://unpkg.com/vue@2.6.11/dist/vue.min.js","https://unpkg.com/vuex@3.4.0/dist/vuex.min.js","https://unpkg.com/element-ui@2.13.2/lib/index.js","https://unpkg.com/echarts@4.8.0/dist/echarts.min.js","./expendPlugins/chart/chartmix.umd.min.js"],L2=["https://unpkg.com/element-ui@2.13.2/lib/theme-chalk/index.css","./expendPlugins/chart/chartmix.css"]});function ba(e){h.flowdata==null||h.flowdata.length==0||(clearTimeout(qf),qf=setTimeout(()=>{h.clearjfundo&&h.jfredo.push({type:"zoomChange",zoomRatio:h.zoomRatio,curZoomRatio:e,sheetIndex:h.currentSheetIndex}),Xr=null,h.zoomRatio=e;let n=ve.getSheetByIndex();He.buildAllPs(n.data),Ie.images=n.images,Ie.allImagesShow(),Ie.init(),n.config==null&&(n.config={}),n.config.sheetViewZoom==null&&(n.config.sheetViewZoom={});let t=n.config.curentsheetView;t==null&&(t="viewNormal"),n.config.sheetViewZoom[t+"ZoomScale"]=e,ne.saveParam("all",h.currentSheetIndex,h.zoomRatio,{k:"zoomRatio"}),ne.saveParam("cg",h.currentSheetIndex,n.config.sheetViewZoom,{k:"sheetViewZoom"}),ei()},100))}function ei(){St(h.flowdata.length,h.flowdata[0].length),ec()}function jf(){let e=.02,n=.1,t=4,l=.1;$("#luckysheet-zoom-minus").click(function(){let a;h.zoomRatio==null?a=h.zoomRatio=1:a=Math.ceil(h.zoomRatio*10)/10,a=a-n,a==h.zoomRatio&&(a=a-n),a<=l&&(a=l),ba(a),or(a)}),$("#luckysheet-zoom-plus").click(function(){let a;h.zoomRatio==null?a=h.zoomRatio=1:a=Math.floor(h.zoomRatio*10)/10,a=a+n,a==h.zoomRatio&&(a=a+n),a>=t&&(a=t),ba(a),or(a)}),$("#luckysheet-zoom-slider").mousedown(function(a){let o=$(this).offset().left,s=a.pageX,u=Uf(s-o);ba(u),or(u)}),$("#luckysheet-zoom-cursor").mousedown(function(a){let o=a.pageX,s=parseFloat($("#luckysheet-zoom-cursor").css("left"));$("#luckysheet-zoom-cursor").css("transition","none"),$(document).off("mousemove.zoomCursor").on("mousemove.zoomCursor",function(u){let f=u.pageX-o,m=s+f,g=Uf(m);g>t&&(g=t,m=100),g${content}=t?Xr=t:Xr =t?s=t:s 50&&(n=Math.round(((e-50)*6/100+1)*100)/100),n}function V2(e){let n=50;e<1?n=Math.round((e-.1)*100/.18)/10:e>1&&(n=Math.round((e-1)*100/.6)/10+50),$("#luckysheet-zoom-cursor").css("left",n-4)}function or(e){let n=Math.round(e*100)+"%";$("#luckysheet-zoom-ratioText").html(n),V2(e)}var qf,Xr,Vi=$e(()=>{Xe();yt();ht();gl();nr();Xt();ll();Gr();jr();qf=null;Xr=null});var q2,ve,gl=$e(()=>{Pt();qr();Zt();gr();Rf();tl();qt();Xt();Ai();Qt();fa();Pt();ht();Wt();ll();Sl();cn();nr();Gr();jr();vr();Ya();Vl();wn();Jt();Xe();yt();Ao();nr();Vi();ol();El();_l();qt();q2={generateRandomSheetIndex:function(e){e==null&&(e="Sheet");let n=window.navigator.userAgent.replace(/[^a-zA-Z0-9]/g,"").split(""),t="";for(let a=0;a<12;a++)t+=n[Math.round(Math.random()*(n.length-1))];let l=new Date().getTime();return e+"_"+t+"_"+l},generateRandomSheetName:function(e,n){let t=e.length,a=Q().pivotTable.title;for(let o=0;o -1||e[o].name.indexOf(a)>-1){let s=parseFloat(e[o].name.replace("Sheet","").replace(a,""));s!="NaN"&&Math.ceil(s)>t&&(t=Math.ceil(s))}return n?a+(t+1):"Sheet"+(t+1)},generateCopySheetName:function(e,n){let l=Q().info,a="("+l.copy,o=n.toString().indexOf(a);~o&&(n=n.toString().substring(0,o));let s="",u=n+a,d=[];for(let m=0;m =s&&(s=parseInt(k)+1)}}let f;do{let m=a+s+")",g=31-m.length;f=n,f.length>g&&(f=f.slice(0,g-1)+"\u2026"),f=f+m}while(~d.indexOf(f)&&(s=(s||1)+1));return f},getSheetByIndex:function(e){let n=this;e==null&&(e=h.currentSheetIndex);let t=n.getSheetIndex(e);return h.luckysheetfile[t]},getSheetByName:function(e){let n=this;if(e==null)return null;for(let t=0;t {typeof t.index=="undefined"&&(t.index=this.generateRandomSheetIndex()),n.includes(t.index)?t.index=this.generateRandomSheetIndex():n.push(t.index),typeof t.status=="undefined"&&(t.status=0),t.status==1&&(e?t.status=0:e=!0)}),e||(h.luckysheetfile[0].status=1)}h.currentSheetIndex=h.luckysheetfile[0].index;for(let e=0;e '),nl(e),ne.saveParam("sha",null,$.extend(!0,{},s)),h.clearjfundo){h.jfundo.length=0;let d={};d.type="addSheet",d.sheetconfig=$.extend(!0,{},s),d.index=a,d.currentSheetIndex=h.currentSheetIndex,h.jfredo.push(d)}t.changeSheetExec(a,n,!0)},setSheetHide:function(e,n){let t=this,l=t.getSheetIndex(e);if(!n&&!Ke.createHookFunction("sheetHideBefore",{sheet:h.luckysheetfile[l]}))return;h.luckysheetfile[l].hide=1;let a=$("#luckysheet-sheets-item"+e);a.hide(),$("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active");let o;if(me.showsheetbarConfig.sheet)o=a.nextAll(":visible"),a.nextAll(":visible").length>0?o=o.eq(0).data("index"):o=a.prevAll(":visible").eq(0).data("index");else{let s,u=[];h.luckysheetfile.forEach((f,m)=>{f.hide!==1&&u.push(m)});let d=u.length;d===1?s=u[0]:s=u[d-1]>l?u.find(f=>f>l):u[d-1],o=h.luckysheetfile[s].index}$("#luckysheet-sheets-item"+o).addClass("luckysheet-sheets-item-active"),t.changeSheetExec(o),t.locationSheet(),ne.saveParam("sh",a.data("index"),1,{op:"hide",cur:o}),n||Ke.createHookFunction("sheetHideAfter",{sheet:h.luckysheetfile[l]})},setSheetShow:function(e){let n=this,t=h.luckysheetfile[n.getSheetIndex(e)];!Ke.createHookFunction("sheetShowBefore",{sheet:t})||(t.hide=0,n.changeSheetExec(e),ne.saveParam("sh",e,0,{op:"show",cur:null}),Ke.createHookFunction("sheetShowAfter",{sheet:t}))},sheetMaxIndex:0,ordersheet:function(e){return function(n,t){let l=n[e],a=t[e];return l-a}},getCurrentOrder:function(){let e={};return $("#luckysheet-sheet-area div.luckysheet-sheets-item").each(function(n){let t=$(this).data("index");for(let l=0;l {let l=n.order,a=t.order;return l!=null&&a!=null?l-a:l!=null?-1:(a!=null,1)})},createSheet:function(){let e=this,n=[];h.luckysheetfile.sort(e.ordersheet("order"));for(let t=0;t '),h.currentSheetIndex==a?n.push(_e(Ql,{index:a,active:"luckysheet-sheets-item-active",name:h.luckysheetfile[t].name,style:"",colorset:o})):(h.luckysheetfile[t].hide==1?n.push(_e(Ql,{index:a,active:"",name:h.luckysheetfile[t].name,style:"display:none;",colorset:o})):n.push(_e(Ql,{index:a,active:"",name:h.luckysheetfile[t].name,style:"",colorset:o})),l="style='display:none;'"),$("#luckysheet-cell-main").append("')}$("#luckysheet-sheet-container-c").append(n.join("")),e.locationSheet()},locationSheet:function(){let e=$("#luckysheet-sheet-container-c"),n=$("#"+h.container).width(),t=$("#luckysheet-sheet-container-c > div.luckysheet-sheets-item-active").eq(0),l=0,a=0;$("#luckysheet-sheet-container-c > div.luckysheet-sheets-item:visible").each(function(){$(this).hasClass("luckysheet-sheets-item-active")&&(l=a),a+=$(this).outerWidth()}),setTimeout(function(){e.scrollLeft(l-10),me.showsheetbarConfig.sheet&&(a>=n*.7?($("#luckysheet-sheet-area .luckysheet-sheets-scroll").css("display","inline-block"),$("#luckysheet-sheet-container .docs-sheet-fade-left").show()):($("#luckysheet-sheet-area .luckysheet-sheets-scroll").css("display","none"),$("#luckysheet-sheet-container .docs-sheet-fade-left").hide()))},1)},copySheet:function(e,n){if(de()||h.allowEdit===!1)return;let t=this,l=h.luckysheetfile.length,a=t.generateRandomSheetIndex(),o=t.getSheetIndex(e),s=$.extend(!0,{},h.luckysheetfile[o]);if(s.order=l,s.index=a,s.name=t.generateCopySheetName(h.luckysheetfile,s.name),!Ke.createHookFunction("sheetCopyBefore",{targetSheet:h.luckysheetfile[o],copySheet:s}))return;let u="";s.color!=null&&(u='');let d=$("#luckysheet-sheets-item"+e);if($("#luckysheet-sheet-container-c").append(_e(Ql,{index:s.index,active:"",name:s.name,order:s.order,style:"",colorset:u})),$("#luckysheet-sheets-item"+s.index).insertAfter(d),h.luckysheetfile.splice(o+1,0,s),$("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active"),$("#luckysheet-sheets-item"+a).addClass("luckysheet-sheets-item-active"),$("#luckysheet-cell-main").append(''),nl(n),ne.saveParam("shc",a,{copyindex:e,name:s.name}),t.changeSheetExec(a,void 0,void 0,!0),t.reOrderAllSheet(),h.clearjfundo)h.jfredo.push({type:"copySheet",copyindex:e,index:s.index,sheetIndex:s.index});else if(h.jfredo.length>0){let f=h.jfredo[h.jfredo.length-1];f.type=="copySheet"&&(f.index=s.index,f.sheetIndex=s.index)}},hasSheet:function(e){return!(e==null||(e=this.getSheetIndex(e),e==null))},createSheetbydata:function(e,n,t=!0){let l=this,a="";if(e.color!=null&&(a=''),$("#luckysheet-sheet-container-c").append(_e(Ql,{index:e.index,active:"",name:e.name,order:e.order,style:"",colorset:a})),t){let o=e.order;o>=h.luckysheetfile.length?(o=h.luckysheetfile.length-1,$("#luckysheet-sheets-item"+e.index).insertAfter($("#luckysheet-sheets-item"+h.luckysheetfile[o].index))):$("#luckysheet-sheets-item"+e.index).insertBefore($("#luckysheet-sheets-item"+h.luckysheetfile[o].index))}h.luckysheetfile.push(e),$("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active"),$("#luckysheet-sheets-item"+e.index).addClass("luckysheet-sheets-item-active"),$("#luckysheet-cell-main").append(''),nl(),n!=null?(ne.saveParam("shre",null,{reIndex:e.index}),e.hide=0,ne.saveParam("sh",e.index,0,{op:"show",cur:null})):ne.saveParam("sha",null,e),l.changeSheetExec(e.index,e.isPivotTable,!0),l.reOrderAllSheet()},deleteSheet:function(e){let n=this;if(h.allowEdit===!1)return;let t=n.getSheetIndex(e),l=h.luckysheetfile[t];if(!Ke.createHookFunction("sheetDeleteBefore",{sheet:l}))return;n.setSheetHide(e,!0),$("#luckysheet-sheets-item"+e).remove(),$("#luckysheet-datavisual-selection-set-"+e).remove();let a=h.luckysheetfile.splice(t,1);n.reOrderAllSheet(),ne.saveParam("shd",null,{deleIndex:e}),h.clearjfundo&&(a[0].type="deleteSheet",h.jfredo.push(a[0])),Ke.createHookFunction("sheetDeleteAfter",{sheet:l})},nulldata:null,getGridData:function(e){let n=[];for(let t=0;t 0?e.data:Vt([],n,t),a=e.celldata;if(e.data&&e.data.length>0)for(let o=0;o 0)for(let o=0;o =l.length&&(l=Vt(l,u-l.length+1,0)),d>=l[0].length&&(l=Vt(l,0,d-l[0].length+1)),Ft(u,d,l,f)}return me.autoFormatw=!1,me.accuracy=void 0,l},cutGridData:function(e){let n=0;for(let t=e.length-1;t>=0;t--){let l=!0;for(let a=0;a 0){l=!1;break}}if(l)n=t;else break}return e.slice(0,n)},addGridData:function(e,n,t){let l=Vt([],n,t);if(e!=null)for(let a=0;a =l.length&&(l=Vt(l,s-l.length+1,0)),u>=l[0].length&&(l=Vt(l,0,u-l[0].length+1)),Ft(s,u,l,d)}return l},sheetParamRestore:function(e,n){if(h.luckysheet_select_save=e.luckysheet_select_save,(h.luckysheet_select_save==null||h.luckysheet_select_save.length==0)&&(n[0]!=null&&n[0][0]!=null&&n[0][0].mc!=null?h.luckysheet_select_save=[{row:[0,n[0][0].mc.rs-1],column:[0,n[0][0].mc.cs-1]}]:h.luckysheet_select_save=[{row:[0,0],column:[0,0]}]),h.luckysheet_selection_range=e.luckysheet_selection_range==null?[]:e.luckysheet_selection_range,h.config=e.config==null?{}:e.config,h.zoomRatio=e.zoomRatio==null?1:e.zoomRatio,e.defaultRowHeight!=null?h.defaultrowlen=parseFloat(e.defaultRowHeight):h.defaultrowlen=me.defaultRowHeight,e.defaultColWidth!=null?h.defaultcollen=parseFloat(e.defaultColWidth):h.defaultcollen=me.defaultColWidth,e.showGridLines!=null){let t=e.showGridLines;t==0||t==!1?h.showGridLines=!1:h.showGridLines=!0}else h.showGridLines=!0},initialjfFile:function(e,n){let t=this;t.getCurSheet();let l=h.luckysheetfile[t.getSheetIndex(h.currentSheetIndex)];t.nulldata=Vt([],h.defaultrowNum,h.defaultcolumnNum);let a=t.buildGridData(l),o=[];l.jfgird_select_save=l.jfgird_select_save||[],l.jfgird_select_save.forEach(m=>o.push({row:m.row,column:m.column})),l.luckysheet_select_save=o,this.sheetParamRestore(l,a);let s=h.luckysheet_select_save[0].row[1],u=h.luckysheet_select_save[0].column[1];if(h.luckysheet_select_save.length>1)for(let m=0;m s&&(s=h.luckysheet_select_save[m].row[1]),h.luckysheet_select_save[m].column[1]>u&&(u=h.luckysheet_select_save[m].column[1]);be.fontInitial(h.fontList),l.data=a;let d=a.length;s>d-1&&(d=s+1);let f=a[0].length;u>f-1&&(f=u+1),typeof me.beforeCreateDom=="function"&&me.beforeCreateDom(luckysheet),typeof me.workbookCreateBefore=="function"&&me.workbookCreateBefore(luckysheet),kc(f,d,a,e,n),setTimeout(function(){U.createHoverTip("#luckysheet_info_detail",".luckysheet_info_detail_back, .luckysheet_info_detail_input, .luckysheet_info_detail_update"),U.createHoverTip("#luckysheet-wa-editor",".luckysheet-toolbar-menu-button, .luckysheet-toolbar-button, .luckysheet-toolbar-combo-button"),h.luckysheetTableContentHW=[$("#luckysheet-cell-main").width()+h.rowHeaderWidth-h.cellMainSrollBarSize,$("#luckysheet-cell-main").height()+h.columnHeaderHeight-h.cellMainSrollBarSize],$("#luckysheetTableContent, #luckysheetTableContentF").attr({width:Math.ceil(h.luckysheetTableContentHW[0]*h.devicePixelRatio),height:Math.ceil(h.luckysheetTableContentHW[1]*h.devicePixelRatio)}).css({width:h.luckysheetTableContentHW[0],height:h.luckysheetTableContentHW[1]}).get(0).getContext("2d");let m=Q().info,y=ne.gridKey+"__qkcache",v=function(){l.load="1",t.createSheet();let k=function(){t.mergeCalculation(l.index),t.setSheetParam(!1),t.storeSheetParam(),t.restoreselect(),t.CacheNotLoadControll=[],t.restoreCache(),p.execFunctionGroupForce(me.forceCalculation),t.restoreSheetAll(h.currentSheetIndex),$("#luckysheet_info_detail_save").html(m.detailSave),l.isPivotTable?h.luckysheetcurrentisPivotTable=!0:(h.luckysheetcurrentisPivotTable=!1,$("#luckysheet-modal-dialog-slider-pivot").hide()),af(),$t(),l.scrollLeft!=null&&l.scrollLeft>0?$("#luckysheet-scrollbar-x").scrollLeft(l.scrollLeft):$("#luckysheet-scrollbar-x").scrollLeft(0),l.scrollTop!=null&&l.scrollTop>0?$("#luckysheet-scrollbar-y").scrollTop(l.scrollTop):$("#luckysheet-scrollbar-y").scrollTop(0),Wn(h.asyncLoad,"core"),me.pointEdit?setTimeout(function(){h.loadingObj.close()},0):setTimeout(function(){h.loadingObj.close()},500)},b=ne.loadSheetUrl;if(b=="")t.loadOtherFile(l),k();else{let w=t.checkLoadSheetIndex(l),x=[];for(let C=0;C $("#luckysheet-scrollbar-x")[0].offsetWidth&&(n.scrollLeft=$("#luckysheet-scrollbar-x").scrollLeft()),$("#luckysheet-scrollbar-y")[0].scrollHeight>$("#luckysheet-scrollbar-y")[0].offsetHeight&&(n.scrollTop=$("#luckysheet-scrollbar-y").scrollTop()),n.zoomRatio=h.zoomRatio},setSheetParam:function(e=!0){let n=this.getSheetIndex(h.currentSheetIndex),t=h.luckysheetfile[n];h.flowdata=t.data,we.webWorkerFlowDataCache(h.flowdata),p.execFunctionGlobalData=null,window.luckysheet_getcelldata_cache=null,this.sheetParamRestore(t,h.flowdata),t.freezen==null?(X.freezenhorizontaldata=null,X.freezenverticaldata=null):(X.freezenhorizontaldata=t.freezen.horizontal==null?null:t.freezen.horizontal.freezenhorizontaldata,X.freezenverticaldata=t.freezen.vertical==null?null:t.freezen.vertical.freezenverticaldata),e&&vn(h.flowdata.length,h.flowdata[0].length),He.buildAllPs(h.flowdata),Ie.currentImgId=null,Ie.images=t.images,Ie.allImagesShow(),Ie.init(),Ye.dataVerification=t.dataVerification,Ye.init(),Cl.hyperlink=t.hyperlink,Cl.init(),Fl(t.filter_select,t.filter)},restoreselect:function(){let e=this.getSheetIndex(h.currentSheetIndex),n=h.luckysheetfile[e];tt(!0),Bt(),n.scrollLeft!=null&&n.scrollLeft>0?$("#luckysheet-scrollbar-x").scrollLeft(n.scrollLeft):$("#luckysheet-scrollbar-x").scrollLeft(0),n.scrollTop!=null&&n.scrollTop>0?$("#luckysheet-scrollbar-y").scrollTop(n.scrollTop):$("#luckysheet-scrollbar-y").scrollTop(0)},storeSheetParamALL:function(){let e=this;e.storeSheetParam();let n=e.getSheetIndex(h.currentSheetIndex);h.luckysheetfile[n].data=h.flowdata,h.luckysheetfile[n].config=$.extend(!0,{},h.config)},mergeCalculationSheet:{},mergeCalculation:function(e){let n=h.luckysheetfile[this.getSheetIndex(e)],t=n.config,l=n.data;if(t==null)return;let a=t.merge;if(!(a==null||e in this.mergeCalculationSheet||n.autoCalculationMerge===!1)){this.mergeCalculationSheet[e]=1;for(let o in a){let s=parseInt(o.substr(0,o.indexOf("_"))),u=parseInt(o.substr(o.indexOf("_")+1)),d=a[o];l[s][u]==null&&(l[s][u]={}),l[s][u].mc={r:s,c:u,rs:d.rs,cs:d.cs};for(let f=s;f {n.isPivotTable&&this.refreshPivotTableByFile(n)})},refreshPivotTableByFile:function(e){let n=e.pivotTable,t=n.column,l=n.row,a=n.values,o=n.showType,s=n.filterparm,u=n.pivotDataSheetIndex,d=this.getSheetIndex(u),f=h.luckysheetfile[d];f.data==null&&(f.data=this.buildGridData(f));let m=oa(f.data,n.pivot_select_save),g={};if(s!=null)for(let _ in s)for(let T in s[_])T==="rowhidden"&&_this.filterparm[_][T]!=null&&(g=$.extend(!0,g,s[_][T]));let y=[];for(let _=0;_{if(p.addToCellList(m,g),g.indexOf("!")>-1){let y=g.substr(0,g.indexOf("!")),v=this.getSheetByName(y);if(v!=null){let k=v.index;s[k]=1,p.addToSheetIndexList(m,k)}}}),p.formulaContainSheetList[m]==null&&p.addToSheetIndexList(m,f);f!=null}for(let u in s){let d=u;o[d.toString()]==null&&(a.push(d),o[d.toString()]=1,this.checkLoadSheetIndexToDataIndex[d]=1)}}if(t!=null)for(let s=0;s 0?$("#luckysheet-scrollbar-x").scrollLeft(n.scrollLeft*h.zoomRatio):$("#luckysheet-scrollbar-x").scrollLeft(0),n.scrollTop!=null&&n.scrollTop>0?$("#luckysheet-scrollbar-y").scrollTop(n.scrollTop*h.zoomRatio):$("#luckysheet-scrollbar-y").scrollTop(0),setTimeout(()=>{h.scrollRefreshSwitch=!0},0),or(h.zoomRatio)},setCurSheet:function(e){for(let n=0;n t?me.showsheetbarConfig.sheet&&($("#luckysheet-sheet-area .luckysheet-sheets-scroll").css("display","inline-block"),$("#luckysheet-sheet-container .docs-sheet-fade-left").show()):($("#luckysheet-sheet-area .luckysheet-sheets-scroll").css("display","none"),$("#luckysheet-sheet-container .docs-sheet-fade-left").hide())}},sheetBarShowAndHide(e){let n=$("#luckysheet-sheet-container-c");if(e!=null){let o=$("#luckysheet-sheets-item"+e);n.scrollLeft(o.offset().left)}let t=n.width(),l=n[0].scrollWidth,a=n.scrollLeft();a<=0?$("#luckysheet-sheet-container .docs-sheet-fade-left").hide():$("#luckysheet-sheet-container .docs-sheet-fade-left").show(),t+a>=l?$("#luckysheet-sheet-container .docs-sheet-fade-right").hide():$("#luckysheet-sheet-container .docs-sheet-fade-right").show()},delChart:function(e,n){let t=this.getSheetIndex(n),l=h.luckysheetfile[t];if(l.chart==null)l.chart=[];else for(let a=0;a =u&&b.r=u+d&&(b.r-=d)}o.row-=d}else{for(let k=0;f.length==0;k++){let b=f[k];b.c>=u&&b.c=u+d&&(b.c-=d)}o.column-=d}let m=[];for(let k=0;k u&&(y.r+=d)}o.row+=d}else{for(let g=0;g u&&(y.c+=d)}o.column+=d}let m;s=="r"?m="row":m="column",Ir(m,u,d,!0)}else t=="na"?ne.saveParam("na",null,a):t=="thumb"&&setTimeout(function(){n.imageRequest()},2e3)}},ve=q2});var j2,p,qt=$e(()=>{ht();Dt();Rn();Wt();gl();ol();ll();Vl();_l();vr();Jt();Pt();Br();pr();Zt();gr();Ml();Qt();tl();Zl();gn();Xt();yn();Hi();Xe();yt();qa();El();j2={error:{v:"#VALUE!",n:"#NAME?",na:"#N/A",r:"#REF!",d:"#DIV/0!",nm:"#NUM!",nl:"#NULL!",sp:"#SPILL!"},errorInfo:function(e){return e},errorParamCheck:function(e,n,t){let l,a,s=Q().formulaMore;return t -1?[!0,s.tipSuccessText]:l.indexOf("range")>-1&&(P(n)=="object"||P(n)=="array")?[!0,s.tipSuccessText]:l.indexOf("number")>-1&&(B(n)||P(n)=="boolean")?[!0,s.tipSuccessText]:l.indexOf("string")>-1&&P(n)=="string"?[!0,s.tipSuccessText]:l.indexOf("date")>-1&&Ot(n)?[!0,s.tipSuccessText]:[!1,s.tipParamErrorText]},getPureValueByData:function(e){if(e.length==0)return[];let n=[];if(P(e)=="array")if(P(e[0])=="array")for(let t=0;t n)for(let o=n;o -1){l||(l={});let m=f.split(":");m.length==2?l[m[0]]=m[1]:m.length>1&&(l[m[0]+":"+m[1]]=m[2])}else l||(l=[]),l.push(f)}a++}return l},colorList:["#2ec7c9","#fc5c5c","#5ab1ef","#ffb980","#d87a80","#8d98b3","#e5cf0d","#97b552","#95706d","#dc69aa","#07a2a4","#9a7fd1","#588dd5","#f5994e","#c05050","#59678c","#c9ab00","#7eb00a","#6f5553","#c14089"],classlist:{province:{11:"\u5317\u4EAC",12:"\u5929\u6D25",13:"\u6CB3\u5317",14:"\u5C71\u897F",15:"\u5185\u8499\u53E4",21:"\u8FBD\u5B81",22:"\u5409\u6797",23:"\u9ED1\u9F99\u6C5F",31:"\u4E0A\u6D77",32:"\u6C5F\u82CF",33:"\u6D59\u6C5F",34:"\u5B89\u5FBD",35:"\u798F\u5EFA",36:"\u6C5F\u897F",37:"\u5C71\u4E1C",41:"\u6CB3\u5357",42:"\u6E56\u5317",43:"\u6E56\u5357",44:"\u5E7F\u4E1C",45:"\u5E7F\u897F",46:"\u6D77\u5357",50:"\u91CD\u5E86",51:"\u56DB\u5DDD",52:"\u8D35\u5DDE",53:"\u4E91\u5357",54:"\u897F\u85CF",61:"\u9655\u897F",62:"\u7518\u8083",63:"\u9752\u6D77",64:"\u5B81\u590F",65:"\u65B0\u7586",71:"\u53F0\u6E7E",81:"\u9999\u6E2F",82:"\u6FB3\u95E8",91:"\u56FD\u5916"}},oldvalue:null,dontupdate:function(){let e=this;h.luckysheetCellUpdate.length=0,$("#luckysheet-functionbox-cell, #luckysheet-rich-text-editor").html(e.oldvalue),e.cancelNormalSelected(),e.rangetosheet!=h.currentSheetIndex&&ve.changeSheetExec(e.rangetosheet)},xssDeal:function(e){return typeof e!="string"?e:e.replace(/