@grapecity-software/spread-sheets-fill 17.0.5 → 17.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* SpreadJS Library 17.0.
|
|
3
|
+
* SpreadJS Library 17.0.7
|
|
4
4
|
*
|
|
5
5
|
* Copyright(c) GrapeCity Software inc. All rights reserved.
|
|
6
6
|
*
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* https://www.grapecity.com.cn/developer/spreadjs
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
!function(t){var n;"object"==typeof module&&"object"==typeof module.exports?(n=require("@grapecity-software/spread-common"),require("@grapecity-software/spread-calc-engine"),require("@grapecity-software/spread-sheets-core"),require("@grapecity-software/spread-sheets-calc-engine"),module.exports=t(n)):"function"==typeof define&&define.amd?define(["@grapecity-software/spread-common","@grapecity-software/spread-calc-engine","@grapecity-software/spread-sheets-core","@grapecity-software/spread-sheets-calc-engine"],t):"object"==typeof exports?(n=require("@grapecity-software/spread-common"),require("@grapecity-software/spread-calc-engine"),require("@grapecity-software/spread-sheets-core"),require("@grapecity-software/spread-sheets-calc-engine"),exports.Spread=t(n)):t(GC)}(function(n){!function(){"use strict";var i,r,t;function e(t){var n,n,n=r[t];return void 0!==n||(n=r[t]={exports:{}},i[t].call(n.exports,n,n.exports,e)),n.exports}i={"./dist/plugins/fill/drag-fill.js":function(_,t,n){var i,c,x,h,t,n,s,k,M,R,v,n,j,T,r,l,b,u,I,S,O,A,g,e,o,a,t,d,C,f,D,F,p,B,W,$;function E(t){return t.rowCount}function N(t){return t.colCount}function V(t,n){return t.getRowCount(n)}function q(t,n){return t.getColumnCount(n)}function H(t,n,i,r){return t&&n&&n.containsRange(t)&&(!k(i)&&(1===i&&t.row===n.row&&E(t)===E(n)||0===i&&t.col===n.col&&N(t)===N(n))||!(k(r)||(2!==r&&3!==r||t.col!==n.col||N(t)!==N(n))&&(0!==r&&1!==r||t.row!==n.row||E(t)!==E(n))))}function w(t,n){var i,r,e,o,u,s,a,f,l,c,a,i=B.call(this)||this,r=i,e=n[A],o=0===e,u=o||1===e,s=n[S],a=n[I],f=a.row,l=a.col,c=E(a),a=N(a);return r.Mf=t,4===(r.Ftt=n)[O]?r.Ptt=new x.Commands.JI(t,{ranges:[n[S]]}):r.Gtt=u?v(f,o?s.col:l,c,a+N(s)):v(2===e?s.row:f,l,c+E(s),a),r.Utt=u?1:0,i}function m(t,n){var i,r,i=W.call(this)||this,r=i;return r.Mf=t,r.Htt=n,r.ztt=n[I],r.Vtt=n[S],r.Ytt=n[O],r.Ztt=n[A],i}function L(t,n,i,r,e,o){var u,r,e,n,u=t.getSelections();t.IA(),t.n4(n,i,r,e,!0),r=t.getSelections(),e=0<n?n:t.N9(),n=0<i?i:t.k9(),t.O6(e,n,t.R9,t.B9),t.jA(u),t.parent&&o.Z3&&t.parent.changeSelectionInCommandExecuting(o,null,null,r)}function z(t){var n,i,n,i=t.parent.getActiveSheet();i&&t!==i&&i.repaint()}function y(t,n){return $.call(this,t,n)||this}i=this&&this.__extends||(p=function(t,n){return(p=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}p(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),Object.defineProperty(t,"__esModule",{value:!0}),c=n("Common"),x=n("Core"),h=n("./dist/plugins/fill/fill.js"),t=n("./dist/plugins/fill/fill.ns.js"),n=n("CalcEngine"),s=!!n,k=c.Common.lt.ht,M=null,R=void 0,v=x.Ec,n=x.GC$,j=Math.max,T=Math.floor,r=x.Commands.ActionBase,l=x.Commands.CI,b=x.Commands.SI,u=x.CopyToOptions.all,I="startRange",S="fillRange",O="autoFillType",A="fillDirection",g="cancel",e="fill",o="dragDrop",a=n.isEmptyObject,t=new c.Common.ResourceManager(t.SR,"Fill"),d=t.getResource.bind(t),n.extend(x.Worksheet.prototype,C={fillAuto:function(t,n,i){if(!n)throw new Error(d().Exp_RangeIsNull);var r=this,e=i.fillType,o=i.series,u=i.direction,s=i.step,a=i.stop,f=new h.Wtt(r),l=i.Qtt;if(H(t,n,u?M:o,u)){r.suspendPaint(),t&&(r.rt.Ktt=t);try{4===e?f.Jtt(n,o,!1,i.withTag,i.withoutStyle,l):0===e?f.Xtt(n,u):1===e||2===e?f.qtt(1===e,n,o,s,a):3===e&&f.$tt(n,o,3,s,k(a)?M:c.Common.ct.o0(a),i.unit)}finally{r.resumePaint()}}}}),x.Worksheet.ch(e,{init:function(){this.tnt=new h.nnt(this)},setHost:function(t){var t;t&&((t=this.Qy())[e]||t.register(e,x.Commands[e]),t[o]||t.register(o,x.Commands[o]))},dispose:function(t){var t;!1!==t.clearCache&&(t=this).tnt&&(t.tnt.L0(),t.tnt=M)}}),x.Workbook.ch(e,{onCultureChanged:function(){d()}}),i(w,B=r),w.prototype.canExecute=function(){var t=this,n=t.Mf,t=t.Ftt,i=t[I],r=t[S];return!(!n.PT(r.row,r.col,E(r),N(r),{isIgnoreFilterOutRow:!0,sheetArea:x.SheetArea.viewport})||4!==t[O]&&r.intersect(i.row,i.col,E(i),N(i)))},w.prototype.execute=function(){var t,n,i,r,e,o,o,t=this;if(t.canExecute()){i=(n=t.Ftt)[S],e=(r=t.Mf).parent.i4(),x.Commands.II(e),t.X5(r,!0);try{s&&r.suspendCalcService(),o=r.getSelections(),r.isDirtySuspended()||(t.ent=new l(r,n[S],u)),4===n[O]?t.int(r):t.rnt(r),r.EA(o,r.getSelections())&&r.jA(o)}finally{t.q5(r,!0),s&&r.resumeCalcService(!1),x.Commands.xI(e,n),r.Q1i&&r.Q1i(i.row,i.col,E(i),N(i)),o=[],r.isDirtySuspended()||(t.ont=new l(r,i,u),t.ont.yI(t.ent.bI()),o=t.ont.MI()),b(r,i.row,i.col,E(i),N(i),o,1)}}},w.prototype.int=function(t){var n,i,r,i,n,e,o,e,o,n,n=this;n.Ptt.execute(t),r=(i=n.Ftt)[I],i=i[S],n=0===n.Utt,o=E(r),e=N(r),o=n?j(1,o-E(i)):o,n=n?e:j(1,e-N(i)),r.equals(i)||(e=v(r.row,r.col,o,n),t.O6(j(t.N9(),e.row),j(t.k9(),e.col),t.R9,t.B9),t.IA(),t.n4(e.row,e.col,E(e),N(e)))},w.prototype.rnt=function(t){var n,i,r,e,o,u,s,a,f,l,c,h,v,g,d,p,w,m,y,_,C,D,r,F,b,n=this,i=n.Mf,r=n.Ftt,e=r[I],o=r[S],u=r[O],s=n.Gtt,l={fillType:4,series:n.Utt,withTag:!0,withoutStyle:!(i.lF&x.CopyToOptions.style)},c=i.tables,h=!1,v=new x.Range(s.row,s.col,s.rowCount,s.colCount);if(c)try{p=0===(g=r[A]),(d=2===g)&&(w=e.rowCount,m=0===c.AB(e.row,e.col,w,e.colCount).length)&&(h=!0,v.rowCount-=w),p&&(y=e.colCount,m=0===c.AB(e.row,e.col,e.rowCount,y).length)&&(h=!0,v.colCount-=y),_=[],C=[],c.yx(M,v,R,R,R,_,{applyDragFillAfterTableExpand:h,backupTableResizedArgs:C}),0<_.length&&(l.Qtt=_),n.lCe=C}catch(t){return i.jT(6,t.message),void i.resumePaint()}if(1===u){if(i.fillAuto(e,s,l),i.lF&x.CopyToOptions.style&&i.Ut.eE(e.row,e.col,e.rowCount,e.colCount))for(a=0;a<o.rowCount;a++)for(f=0;f<o.colCount;f++)(D=i.vI(e.row+T(a%e.rowCount),e.col+T(f%e.colCount)))&&D.clone&&(D=D.clone()),i.CL(o.row+a,o.col+f,D)}else 0===u?(r=i.lF&~x.CopyToOptions.comment,n.ant(e,o,r)):2===u?n.ant(e,o,4320):3===u&&((F=!(1!==E(e)||1!==N(e)||-1===e.row&&-1!==e.col||-1===e.col&&-1!==e.row))?n.ant(e,o,b=4251):(l.withoutStyle=!0,i.fillAuto(e,s,l)));i.O6(j(t.N9(),s.row),j(t.k9(),s.col),t.R9,t.B9),t.IA&&t.IA(),i.n4(s.row,s.col,E(s),N(s))},w.prototype.ant=function(t,n,i){var r=this,e=r.Mf,t=e.JS(t),n=e.JS(n),o=t.row,u=t.col,s=E(t),a=N(t),f=n.row,l=n.col,c=E(n),h=N(n),t=r.Ftt[A],v=3===t,g=1===t,d=T(c/s),n=c%s,p=T(h/a),t=h%a,w,m,y,_,C;if(e.HB=!0,0===r.Utt){for(w=0;w<d;w++)e.vT(o,u,_=v?f+w*s:f+c-(w+1)*s,l,s,a,i,!0,!0);0!=n&&e.vT(m=v?o:o+(d+1)*s-c,u,_=v?f+s*d:f+c-d*s-n,l,n,a,i,!0,!0)}else{for(w=0;w<p;w++)e.vT(o,u,f,C=g?l+w*a:l+h-(w+1)*a,s,a,i,!0,!0);0!=t&&e.vT(o,y=g?u:u+(p+1)*a-h,f,C=g?l+a*p:l+h-p*a-t,s,t,i,!0,!0)}delete e.HB,e.recalcRange(f,l,c,h)},w.prototype.undo=function(){var t,n,i,r,e,o,u,t=this,n=t.Mf,i=!1;if(t.canUndo()){t.X5(n,!0);try{s&&n.suspendCalcService(),r=n.getSelections(),e=t.Ftt,o=n.R_,u=e[S],i=4===e[O]?t.unt(n):t.snt(n),!n.cnt&&o&&o.close(),b(n,u.row,u.col,E(u),N(u),t.ont?t.ont.MI():[],1,R,!0),n.EA(r,n.getSelections())&&n.jA(r)}finally{t.q5(n,!0),s&&n.resumeCalcService(!1)}}return i},w.prototype.unt=function(t){var n,i,r,i,e,n=this,i=n.Ftt[I],r=i.row,i=i.col,e=x.Commands.TI(t.name());return t.Ut.undo(n.Ftt[e]),t.O6(j(t.N9(),r),j(t.k9(),i),t.R9,t.B9),!0},w.prototype.snt=function(t){var n,i,r,e,r,o,n,i=this.Ftt,r=i[I],e=r.row,r=r.col;s&&t.suspendCalcService();try{o=x.Commands.TI(t.name()),t.Ut.undo(i[o]),t.O6(j(t.N9(),e),j(t.k9(),r),t.R9,t.B9)}finally{s&&t.resumeCalcService(!1)}return t.invalidateLayout(),!0},f=w,i(m,W=r),m.prototype.execute=function(){var t,n,i,r,e,o,u,s,a,f,l,t=this,n=!1;if(t.canExecute()){r=(i=t.Mf).parent,e=t.Vtt,o=t.Htt,u=i.parent.i4(),x.Commands.II(u),t.XI(),t.X5(i,!0),i.QI=!0;try{s=i.getSelections(),a=void 0,f=i.rt,(l={sheet:i,sheetName:i.name(),cancel:!1})[S]=e,l[O]=t.Ytt,l[A]=t.Ztt,i.ki(x.Events.DragFillBlock,l),f.fnt=l[O],f.lnt=l[g],l[g]||(t.hnt(l),i.ki(x.Events.DragFillBlockCompleted,l)),n=!0,a=i.getSelections(),i.EA(s,a)&&i.jA(s),r&&o.Z3&&r.changeSelectionInCommandExecuting(o,null,null,a)}finally{t.q5(i,!0),i.QI=!1,t.dnt(i,e),x.Commands.xI(u,t.Htt)}}return n},m.prototype.hnt=function(t){var n,i,r,e,o,r,e,n=this,i=n.Mf,r=i.rt,e=n.Vtt,o=n.Ytt;r.fnt=o,r.lnt||((r={})[I]=n.ztt,r[S]=e,r[O]=5===t[O]?o:t[O],r[A]=n.Ztt,e=new f(i,r),i.suspendEvent(),e.execute(),i.resumeEvent(),n.Htt.vnt=e)},m.prototype.XI=function(){var t=this;t.Mf.isDirtySuspended()||(t.ent=new l(t.Mf,t.Vtt,u))},m.prototype.undo=function(){var t,n,i,r,e,o,u,s,a,n=this;if(n.canUndo()){i=n.Mf,r=n.Vtt,e=i.parent,o=n.Htt,n.XI(),n.X5(i,!0);try{u=i.getSelections(),i.suspendEvent(),i.Nj=!0,s=(0,x.hCe)(i),x.Commands.NI(s,o),i.Nj=!1,i.resumeEvent(),a=o[I],i.EA(u,[a])&&i.jA(u),e&&o.Z3&&e.changeSelectionInCommandExecuting(o,null,null,[a]),(0,x.handleRestoredTableResizedArgs)(null==(t=o.vnt)?void 0:t.lCe)}finally{n.q5(i,!0),n.dnt(i,r,!0)}}return!0},m.prototype.dnt=function(t,n,i){var r,e,o,r=this,e=[];t.isDirtySuspended()||((o=new l(t,n,u)).yI(r.ent.bI()),e=o.MI()),b(t,n.row,n.col,E(n),N(n),e,1,R,i)},D=m,i(y,$=r),y.prototype.canExecute=function(){var t,n,i,r,e,o,u,s,a,f,l,c,h,f,v,g,d,p,f,t=this,n=t.Mf,i=t.tT,r=i.fromRow,e=i.fromColumn,o=E(i),u=i.columnCount,s=i.toRow,a=i.toColumn,f=!i.copy,l,c;if(n.tables&&n.tables.mx(n,{row:r,col:e,rowCount:o,colCount:u},n,{row:s,col:a,rowCount:o,colCount:u},f))return!1;if(!n.zT(r,e,o,u,V(n),q(n)))return!1;if(!i.insert&&!n.zT(s,a,o,u,V(n),q(n)))return!1;if(i.cmd===x.RangeChangedAction[0]&&n.tables&&(h=!1,0<(f=n.tables.AB(r,e,o,u)).length)){for(g=(v=f[0].range()).row;g<v.row+v.rowCount;g++)if(n.isRowFilterOut(g)){h=!0;break}return!(h&&v.contains(i.mouseTargetRow,i.mouseTargetCol,1,1))}return f=t.mnt(d=0<=s&&a<0&&0<=r&&e<0&&0<o&&u<0,p=s<0&&0<=a&&r<0&&0<=e&&o<0&&0<u),n.PT(s,a,o,u,{isAllowDragInsert:f,sheetArea:x.SheetArea.viewport})&&n.PT(r,e,o,u,{isAllowDragInsert:f,sheetArea:x.SheetArea.viewport})},y.prototype.mnt=function(t,n){var i,r,i,r,e,i,e,i,i=this,r=i.tT,i=i.Mf,r=r.insert,e=i.isActualProtected(),i=i.options.protectionOptions;return!(!e||a(i)||(e=i.allowDragInsertRows,i=i.allowDragInsertColumns,!r)||!(e&&t||i&&n))},y.prototype.execute=function(){var t,n,i,r,e,o,u,s,a,f,l,c,h,v,g,d,p,w,m,y,_,C,D,F,b,R,j,T,t=this,n=!1;if(t.canExecute()){i=t.Mf,r=t.tT,t.XI(),s=r.fromRow,a=r.fromColumn,f=r.toRow,l=r.toColumn,c=E(r),h=r.columnCount,v=r.option,g=c,d=h,p=(u=o=e=void 0,x.hCe)(i),(w=i.o5())&&(g+=i.lT(f,c,!0),d+=i.lT(l,h)),x.Commands.II(p),t.X5(i,!0),i.QI=!0,m=void 0;try{try{y=[],m={shiftCells:r.insert&&r.shiftCells===x.InsertShiftCell.down,isCopy:r.copy,isFirst:!0},i.tables&&i.tables.yx(i,new x.Range(f,l,g,d),new x.Range(s,a,c,h),M,M,M,{shiftInfo:m,backupTableResizedArgs:y}),r.Kh.lCe=y}catch(t){return i.jT(6,t.message),void i.resumePaint()}r.insert?0<=a&&s<0?(e=a,u=h,_=o=l,i.addColumns(o,u),r.copy?i.copyTo(-1,o<=e?e+u:e,-1,o,-1,u,v):(i.moveTo(-1,o<=e?e+u:e,-1,o,-1,u,v),i.deleteColumns(o<=e?e+u:e,u),e<o&&(_=o-u)),L(i,-1,_,V(i),u,r)):0<=s&&a<0?(e=s,u=c,C=o=f,i.addRows(o,u),r.copy?i.copyTo(o<=e?e+u:e,-1,o,-1,u,-1,v):(i.moveTo(o<=e?e+u:e,-1,o,-1,u,-1,v),i.deleteRows(o<=e?e+u:e,u),e<o&&(C=o-u)),L(i,C,-1,u,q(i),r)):0<=s&&0<=a&&(D=r.shiftCells,F=new x.Range(f,l,1,1),b=[new x.Range(s,a,c,h)],k(D)||(R={cmd:"clipboardPaste",sheetName:i.name(),clipboardHtml:"",clipboardImage:"",clipboardText:"",fromRanges:b,fromSheet:i,isCutting:!r.copy,pasteOption:0,pastedRanges:[new x.Range(f,l,c,h)],cA:F,fA:b,sA:D,bx:!0,px:m&&m.ignoreFooterShiftIndex},i.Qy().execute(R),j=i.getSelections()[0],D===x.InsertShiftCell.down&&s<f&&!r.copy&&a===l?i.setSelection(j.row-c,j.col,j.rowCount,j.colCount):D===x.InsertShiftCell.right&&a<l&&!r.copy&&s===f&&i.setSelection(j.row,j.col-h,j.rowCount,j.colCount))):(r.copy?i.copyTo(s,a,f,l,c,h,v):i.moveTo(s,a,f,l,c,h,v),i&&(L(i,f,l,g,d,r),T=r.Kh,r.copy||i.isDirtySuspended()||(T.wx=t.gnt(i,T.qI,s,a,c,h)),i.isDirtySuspended()||(T.Mx=t.gnt(i,T.$I,f,l,c,h)))),n=!0}finally{i.rt.q6={},t.q5(i,!0),i.QI=!1,x.Commands.xI(p,r)}z(i)}return n},y.prototype.gnt=function(t,n,i,r,e,o){var u,s,u=new l(t,v(i,r,e,o),this.tT.option),s=t.tables&&t.tables.WI&&t.tables.WI(i,r,e,o);return s&&0<s.length&&(this.tT.tableNamesObj={r:i,c:r,rc:e,cc:o,tableNames:s}),u.yI(n.bI()),b(t,i,r,e,o,u.MI(),0,s),u},y.prototype.XI=function(){var t,n,t,i,r,e,o,u,s,a,f,o,u,r,e,t=this,n=t.Mf,t=t.tT,i=t.Kh;i=i||(t.Kh={}),r=t.fromRow,e=t.fromColumn,o=t.toRow,u=t.toColumn,s=t.option,a=r<0?0:r,f=e<0?0:e,o=o<0?0:o,u=u<0?0:u,r=r<0?V(n):E(t),e=e<0?q(n):t.columnCount,t.insert||n.isDirtySuspended()||(t.copy||(i.qI=new l(n,v(a,f,r,e),s)),i.$I=new l(n,v(o,u,r,e),s)),i.pnt=n.R9,i.bnt=n.B9,i.ynt=n.ui,i.wnt=n.ci},y.prototype.undo=function(){var t,n,i,r,e,o,u,s,a,f,l,c,h,v,g,d,p,w,m,y,_,C,D,F,t=this;if(t.canUndo()){if(n=t.Mf,r=(i=t.tT).fromRow,e=i.fromColumn,o=i.toRow,u=i.toColumn,s=E(i),a=i.columnCount,!n.zT(r,e,s,a,V(n),q(n)))return!1;if(!i.insert&&!n.zT(o,u,s,a,V(n),q(n)))return!1;l=i.Kh,t.X5(n,!(f=void 0)),c=(0,x.hCe)(n),x.Commands.NI(c,i);try{i.insert?0<=e&&0<=r||(0<=e?(f=a,n&&L(n,-1,e,V(n),f,i)):0<=r&&(f=s,n)&&L(n,r,-1,f,q(n),i)):(g=r<0?0:r,d=e<0?0:e,p=o<0?0:o,w=u<0?0:u,m=r<0?V(n):s,y=e<0?q(n):a,n&&(L(n,r,e,s,a,i),_=i.tableNamesObj,C=[],D=[],_&&(_.r===p&&_.c===w&&_.rc===m&&_.cc===y?D=_.tableNames:C=_.tableNames),b(n,p,w,m,y,l.Mx?l.Mx.MI():[],0,C,!0),b(n,g,d,m,y,l.wx?l.wx.MI():[],0,D,!0))),n&&(-1!==l.ynt&&-1!==l.wnt&&((F=n.getSelections()[0]).contains(l.ynt,l.wnt)?n.XA(l.ynt,l.wnt):n.XA(F.row,F.col)),-2!==l.pnt&&-2!==l.bnt&&-1!==l.ynt&&-1!==l.wnt&&n.showCell(l.ynt,l.wnt,3,3),(0,x.handleRestoredTableResizedArgs)(l.lCe))}finally{t.q5(n,!0)}z(n)}return!0},F=y,x.Commands[e]={canUndo:!0,execute:function(t,n,i){return x.Commands.zA(t,D,n,i)}},x.Commands[o]={canUndo:!0,execute:function(t,n,i){return x.Commands.zA(t,F,n,i)}}},"./dist/plugins/fill/fill-event.js":function(e,t,n){var p,D,d,r,w,t,m,y,v,_,f,C,F,b,g,R,i,o,l,c,h,j,n,T;function x(t){return t.rowViewportIndex}function k(t){return t.colViewportIndex}function u(t){return t.frozenRowCount()}function a(t){return t.frozenColumnCount()}function s(t){return t.hitTestType}function M(t,n){return t.getRowCount(n)}function I(t,n){return t.getColumnCount(n)}function S(t){return t.colCount}function O(t){return t.rowCount}function A(t){return t.height}function E(t){return t.width}function N(t){var n,t,n=7,t=t.parent;return n=t?2007<t.SC?2:7:n}function V(t,n,i,r,e,o,u){var s,a,f;t.save(),o=o||h,u=u||2,n===r?(t.rect(n-2,i,7,g(e-i)),t.clip(),t.beginPath(),i<e?(i-=3,e+=3):(i+=3,e-=3),s=(0,D.Zx)(n-1,i-1,r-1,e+1,o,u),a=(0,D.Zx)(n,i,r,e,o,u),f=(0,D.Zx)(n+1,i-1,r+1,e+1,o,u)):i===e&&(t.rect(n,i-2,g(r-n),7),t.clip(),t.beginPath(),n<r?(n-=3,r+=3):(n+=3,r-=3),s=(0,D.Zx)(n-1,i-1,r+1,e-1,o,u),a=(0,D.Zx)(n,i,r,e,o,u),f=(0,D.Zx)(n-1,i+1,r+1,e+1,o,u)),s&&s.qx(t),a&&a.qx(t),f&&f.qx(t),t.strokeStyle=o,t.stroke(),t.beginPath(),t.restore()}function q(t,n,i,r,e,o,u,s,a,f,l){var c=n?D.Events.DragDropBlock:D.Events.DragDropBlockCompleted,i={sheet:t,sheetName:t.name(),fromRow:i,fromCol:r,toRow:e,toCol:o,rowCount:u,colCount:s,copy:a,insert:f,copyOption:l};return n&&(i.cancel=!1),t.ki(c,i),i}function L(t,n,i,r,e){for(var o,u,s,o=0;o<i.rowCount;o++){for(u=0;u<i.colCount;u++){if(!(s=t.getSpan(i.row+o,i.col+u))||s.rowCount!==n.rowCount||s.colCount!==n.colCount)return!1;r&&(u+=n.colCount)}e&&(o+=n.rowCount)}return!0}function B(t,n,i){var r,e,o,u,s,a,f,l,e,u,r,r=n.row,e=n.rowCount,o=n.col,u=n.colCount,s=i.row,a=i.rowCount,f=i.col,l=i.colCount,e=r===s&&e===a,u=o===f&&u===l;return(e||u)&&(r=t.getSpan(r,o))&&L(t,r,n,e,u)&&!t.Ut.GT(s,f,a,l)&&L(t,r,i,e,u)}Object.defineProperty(t,"__esModule",{value:!0}),p=n("Common"),D=n("Core"),d=n("SheetsCalc"),r=n("./dist/plugins/fill/fill-ui.js"),w=n("./dist/plugins/fill/fill.js"),t=n("./dist/plugins/fill/fill.ns.js"),m=n("CalcEngine"),y=!!m,v=D.GC$,_=D.Ec,f=p.Common.lt.ht,C=null,F=void 0,b=Math.min,g=Math.abs,R=Math.max,i=5,o=3,l="drag",c="corner",h="black",j=p.Common.zf,n=new p.Common.ResourceManager(t.SR,"Fill"),T=n.getResource.bind(n),v.extend(D.nk.prototype,{bk:function(t){var n,i,r,e,e,o,u,u,o,e,u,i,n=this;n.zk||(i=n.Mf,r=C,1===(e=i.Ut.getSelections()).length?r=e[0]:e.length<1&&(r=i.Ut.getSpan(i.ui,i.ci)),r&&(n.zk=!0,n.rb=!0,n.Mnt=r,(e=i.tables&&i.tables.find(r.row,r.col))&&(o=n.Cnt=!0,u=e.range(),o=!(e.showHeader()&&r.row===u.row||e.showFooter()&&r.row===u.row+u.rowCount-1||r.col!==u.col||r.colCount!==u.colCount)&&o)&&(n.Snt=!0,n.e_=!0,n.Tnt=e.name()),u=i.getRangeRect(x(t),k(t),r),(o=n.q6).x=u.x,o.y=u.y,o.width=u.width-1,o.height=u.height-1,o.row=r.row,o.col=r.col,o.rowCount=O(r),o.colCount=S(r),e=i.JS(r),u=t.row,i=t.col,(u=u<e.row?e.row:u)>=e.row+O(e)&&(u=e.row+O(e)-1),(i=i<e.col?e.col:i)>=e.col+S(e)&&(i=e.col+S(e)-1),o.hitRow=u,o.hitCol=i,o.rowOffset=u-e.row,o.colOffset=i-e.col,n.Rk={e9:x(t),r9:k(t),Bk:s(t)},n.Ok()))},Vk:function(){var t,n,i,r,e,o,u,r,i,s,a,t=this;t.Rk&&t.rb&&t.zk&&t.Mnt&&(n=t.fk,i=t.q6,e=(r=t.Mf.getCellRect(i.hitRow,i.hitCol)).width/2,o=r.x+e,u=r.height/2,r=r.y+u,i.hitTarget={x:n.x,y:n.y},i=t.Q9(),s=t.K9(),a=!1,(g(o-n.x)>5+e||g(r-n.y)>5+u)&&(a=!0),0<=i&&0<=s&&a&&t.Ant(i,s),t.a9())},Ant:function(t,n){var i,r,e,o,u,s,a,f,l,c,h,c,u,l,f,c,u,t,n,o,i=this;i.zk&&i.Mnt&&(r=i.Mf,e=i.q6,o=r.o5(),u=r.U5(),s=M(r),a=I(r),f=b(a-S(e),n-e.colOffset),l=b(s-O(e),t-e.rowOffset),o&&(c=r.ox(n,e.colOffset+1),l-=h=r.ox(t,e.rowOffset+1,!0),0===r.getColumnWidth(f-=c)&&(f=r.r6(f)),0===r.getRowHeight(l))&&(l=r.nI(l)),-1===u.row&&-1!==u.col?(e.row=-1,e.col=R(0,f)):-1!==u.row&&-1===u.col?(e.row=R(0,l),e.col=-1):(e.row=e.row<0?-1:R(0,l),e.col=e.col<0?-1:R(0,f)),i.Snt&&(u=(c=r.tables&&r.tables.find(t,n))&&c.range(),!c||c.name()!==i.Tnt||t===u.row||c.showFooter()&&t===u.row+u.rowCount?i.e_=!1:i.e_=!0,i.e_?(e.col=u.col,i.i_=!i.isPressShiftKey):i.i_=i.isPressShiftKey),e.hitRow=t,e.hitCol=n,l=r.JS(e),o&&(f=r.lT(l.row,l.rowCount,!0),c=r.lT(l.col,l.colCount),l.rowCount+=f,l.colCount+=c,l.rowCount=b(s,l.rowCount),l.colCount=b(a,l.colCount),l.row+l.rowCount>s||l.col+l.colCount>a)||(u=i.Int)&&l.row===u.row&&l.col===u.col&&O(l)===O(u)&&S(l)===S(u)&&l.row>r.N9()&&l.col>r.k9()&&l.row+O(l)-1<r.P6()&&l.col+S(l)-1<r.G6()||(i.xnt=l,r.Dn.o_(),i.Int=l,(t=r.parent)&&t.options.showDragDropTip&&(n=e.x+e.width+5,o=e.y+e.height+5,t.Tw(j.j0(i.Nnt(l)),n,o))))},Nnt:function(t){var n,i,r,e,o,u,s,a,f,l,c,h,v,g;return t&&y?(r=O(i=(n=this.Mf).U5()),e=S(i),o=n.getActiveRowIndex(),u=n.getActiveColumnIndex(),s=void 0,a=n.o5(),o=o<0?0:o,u=u<0?0:u,s=1===r&&1===e?m.knt(C,C,t.row-o,t.col-u,!0,!0):(h=c=l=f=void 0,g=v=0,-1===i.row&&0<=i.col?(f=c=d.BAND_INDEX_CONST,l=t.col-u,h=t.col-u+e-1,g=e):-1===i.col&&0<=i.row?(l=h=d.BAND_INDEX_CONST,f=t.row-o,c=t.row-o+r-1,v=r):0<=i.row&&0<=i.col&&(f=t.row-o,c=t.row-o+r-1,l=t.col-u,h=t.col-u+e-1,v=r,g=e),a&&(c+=n.lT(t.row,v,!0),h+=n.lT(t.col,g)),m.lJ(C,C,f,l,c,h,!0,!0,!0,!0,o,u)),n.op().unparse(n.Uw(),s,o,u)):F},kD:function(t){var n,i,r,e,o,u,u,s,a,f,l,c,h,v,u,g,d,p,w,w,m,w,m,m,n=this,i=!1,r="",e=!1,o=n.Mf;n.Rk=C,n.l9(),u=o.U5(),s=n.q6.row,a=n.q6.col,f=n.q6.hitRow,l=n.q6.hitCol,n.i_&&u.contains(f,l)||(u=u&&(0<O(u)||0<S(u))?{r:u.row,c:u.col,rc:O(u),cc:S(u)}:{r:o.ui,c:o.ci,rc:1,cc:1},!0===n.zk&&!0===n.rb&&(c=u.r,h=u.c,v=u.rc,u=u.cc,g=o.options.protectionOptions,d=o.lF,p=void 0,n.shiftCells=null,n.i_&&(n.shiftCells=n.Dnt?D.InsertShiftCell.right:D.InsertShiftCell.down),w={fromRow:c,fromColumn:h,rowCount:v,columnCount:u,toRow:s,toColumn:a,isDragInsert:n.i_,isDragCopy:n.t_},o.ki(D.Events.BeforeDragDrop,w),(r=w.invalidMessage)&&0!==r.length||(!n.i_||-1!==c&&-1!==h?s===c&&a===h||(w=o.GT(c,h,v,u),m=o.GT(s,a,v,u),!w&&!m||(m=!1,m=!(w||n.shiftCells!==D.InsertShiftCell.right&&n.shiftCells!==D.InsertShiftCell.down)||m)||(i=!0,r=T().Exp_ChangeMergedCell),i||y&&(o.KT(c,h,v,u)||o.KT(s,a,v,u))&&(i=!0,r=T().Exp_ChangePartOfArray),!i&&o.isActualProtected()&&(!n.t_&&o.dA(_(c,h,v,u),!0,D.SheetArea.viewport)||o.dA(_(s,a,v,u),!0,D.SheetArea.viewport))&&(i=!0,r=o.FT()),i)||(n.i_&&(n.Dnt?a=n.q6.hitCol:s=n.q6.hitRow),(p=q(o,!0,c,h,s,a,v,u,n.t_,!1,d)).cancel)||(e=o.Qy().execute({cmd:"dragDrop",sheetName:o.name(),fromRow:c,fromColumn:h,toRow:s,toColumn:a,rowCount:v,columnCount:u,copy:n.t_,insert:n.i_,shiftCells:n.shiftCells,option:p.copyOption,mouseTargetRow:f,mouseTargetCol:l}),q(o,!1,c,h,s,a,v,u,n.t_,!1,p.copyOption)):0<=h?(n.t_&&(a<=h||h+u<=a)||!n.t_&&(a<h||h+u<a))&&((o.GT(-1,h,-1,u)||o.GT(-1,a,-1,0))&&(i=!0,r=T().Exp_ChangeMergedCell),w=g&&g.allowDragInsertColumns,!i&&o.isActualProtected()&&!0!==w&&(i=!0,r=T().Exp_ColumnReadOnly),i||(p=q(o,!0,-1,h,-1,a,-1,u,n.t_,!0,d)).cancel||(e=o.Qy().execute({cmd:"dragDrop",sheetName:o.name(),fromRow:-1,fromColumn:h,toRow:-1,toColumn:a,rowCount:-1,columnCount:u,copy:n.t_,insert:!0,option:p.copyOption,mouseTargetRow:f,mouseTargetCol:l}),q(o,!1,-1,h,-1,a,-1,u,n.t_,!0,p.copyOption))):0<=c&&h<0&&(n.t_&&(s<=c||c+v<=s)||!n.t_&&(s<c||c+v<s))&&((o.GT(c,-1,v,-1)||o.GT(s,-1,0,-1))&&(i=!0,r=T().Exp_ChangeMergedCell),i||y&&(o.KT(c,-1,v,-1)||o.KT(s,-1,0,-1))&&(i=!0,r=T().Exp_ChangePartOfArray),m=g&&g.allowDragInsertRows,!i&&o.isActualProtected()&&!0!==m&&(i=!0,r=T().Exp_RowReadOnly),i||(p=q(o,!0,c,-1,s,-1,v,-1,n.t_,!0,d)).cancel||(e=o.Qy().execute({cmd:"dragDrop",sheetName:o.name(),fromRow:c,fromColumn:-1,toRow:s,toColumn:-1,rowCount:v,columnCount:-1,copy:n.t_,insert:!0,option:p.copyOption,mouseTargetRow:f,mouseTargetCol:l}),q(o,!1,c,-1,s,-1,v,-1,n.t_,!0,p.copyOption)))))),n.rb=!1,n.zk=!1,n.Snt=!1,n.Cnt=!1,n.e_=!1,n.Tnt=C,n.Mnt=C,n.i_=!1,n.t_=!1,n.Int=C,n.xnt=C,n.iy(),e||(n.q6={},o.repaint()),i&&o.jT(3,r)},wk:function(t){var n=this;!0!==n.Yk&&!0!==n.rb&&(n._nt(),n.Ktt)&&(n.rb=!0,n.Yk=!0,n.hO=!0,n.Ent=t,n.jnt=k(t),n.Ont=x(t),n.Rnt=k(t),n.Bnt(),n.Rk={e9:x(t),r9:k(t),Bk:s(t)},n.Ok())},Bnt:function(){var t,n,i,r,n,t=this,n=u(t.Mf),i=a(t.Mf),r=t.Lnt();0<=r&&r<n?t.Fnt=0:n<=r&&r<=M(t.Mf)&&(t.Fnt=1),t.Pnt()?t.Gnt=1:t.Gnt=t.Ent,0<=(n=t.Unt())&&n<i?t.Hnt=0:i<=n&&n<=I(t.Mf)&&(t.Hnt=1),t.znt()?t.Vnt=1:t.Vnt=t.jnt},Zk:function(){var t,n,i,r,t=this;t.Rk&&t.Yk&&t.rb&&t.Ktt&&(t.Ont=t.nD(),t.Rnt=t.eD(),t.Ynt=t.Q9(),t.Znt=t.K9(),0<=t.Ynt&&0<=t.Znt&&(t.Wnt(),t.Qnt(),n=t.Mf.parent,i=!1,(r=t.Knt())&&(i=t.Jnt(t.Ktt,t.Xnt,!0)),n&&n.options.showDragFillTip&&i&&t.qnt(),t.$nt()),t.a9())},tet:function(){var t,n,i,r,e,e,o,u,s,s,a,u,f,l,c,h,v,h,v,g,d,t=this,n=t.Mf,i=t.Ktt,r=t.Xnt,e=n.parent.options.defaultDragFillType,e=t.net(3===e?5:e,3===e),o=t.eet(),u=t.Knt();return 1===e?(s=0===o||1===o?1:0,u=(a=new w.Wtt(n)).Jtt(u,s,!0),s=t.iet(o,r,i),l=(f=n.getActualStyle(s.row,s.col)).cellType||n.$f(),c=f.formatter||f._autoFormatter,h=p.Formatter&&p.Formatter.GeneralFormatter,u instanceof Date&&h&&(c=new h(p.Common.CultureManager.Fe().DateTimeFormat.shortDatePattern+" hh:mm:ss AM/PM;@","0")),h=3,(v=t.Rk)&&(h=v.Bk),v={sheet:n,row:s.row,col:s.col,sheetArea:h,quotePrefix:f.quotePrefix},l.format(u,c,g={},v)):0!==e||(s=t.iet(o,r,i),d=n.getFormula(s.row,s.col))?C:n.getText(s.row,s.col)},iet:function(t,n,i){var r,e,o,i,u,s,r=i.row,e=i.col,o=O(i),i=S(i),u=_(r,e,1,1);return 3===t?(s=O(n)%o,u.row=s=0===s?r+o-1:r+s-1,u.col=e):1===t?(s=0===(s=S(n)%i)?e+i-1:e+s-1,u.row=r,u.col=s):0===t?(s=0===(s=S(n)%i)?e:e+i-s,u.row=r,u.col=s):2===t&&(s=O(n)%o,u.row=s=0===s?r:r+o-s,u.col=e),u},qnt:function(){var t,n,i,r,e,o,u,o,n,t=this,n=t.Mf,i;if(4===t.net()||t.znt()||t.Pnt())return t.iy(),C;u=t.eet(),o=t.Knt(),n=n.j1(o),o=t.tet(),3===u||1===u?(r=n.x+n.width+3,e=n.y+n.height+3):0===u?(r=n.x+3,e=n.y+n.height+3):2===u&&(r=n.x+n.width+3,e=n.y+3),t.Tw(o,r,e)},$nt:function(){var t=this;t.ret(),t.oet(),t.aet(),t.uet=t.Knt()},ret:function(){var t,n,t=this.Mf;this.uet&&((n=t.j1(this.uet)).x-=2,n.y-=2,n.width+=4,n.height+=4,t.Dn.O1(n))},oet:function(t){var n;this.Mf.Dn.E1(this.Ktt,C,t)},aet:function(){var t,n,i,r,i,e,t,t=this.Mf,n=t.Dn,i=this.Knt();i&&(r=n.J(),i=t.j1(i),e=t.getSelectionBorderColor(),t=N(t),r.save(),r.beginPath(),n.cet(r,i,e,t),r.restore())},Qnt:function(){this.Xnt=this.dO()},znt:function(){return-1===this.Ktt.col&&-1!==this.Ktt.row},Pnt:function(){return-1===this.Ktt.row&&-1!==this.Ktt.col},lO:function(){return 4===this.bO||5===this.bO},dO:function(){var t,n,i,r,e,t=this,n=-1,i=-1,r=-1,e=-1;switch(t.bO){case 0:r=t.Pnt()?n=-1:(n=t.Lnt(),O(t.Ktt)),i=t.Znt,e=t.Unt()-i;break;case 1:r=t.Pnt()?n=-1:(n=t.Lnt(),O(t.Ktt)),i=t.fet()+1,e=t.Znt-i+1;break;case 2:n=t.Ynt,r=t.Lnt()-n,e=t.znt()?i=-1:(i=t.Unt(),S(t.Ktt));break;case 3:n=t.let()+1,r=t.Ynt-n+1,e=t.znt()?i=-1:(i=t.Unt(),S(t.Ktt));break;case 5:n=t.Ynt,r=t.let()-n+1,e=t.znt()?i=-1:(i=t.Unt(),S(t.Ktt));break;case 4:r=t.Pnt()?n=-1:(n=t.Ktt.row,O(t.Ktt)),i=t.Znt,e=t.fet()-i+1}return _(n,i,r,e)},het:function(){var t=this.let();return-1!==t?this.Mf._y(this.Gnt).findRow(t):C},det:function(){return this.Mf._y(this.Ont).findRow(this.vet())},vet:function(){return this.Mf.getViewportBottomRow(this.Ont)},met:function(){var t=this.fet();return-1!==t?this.Mf.Yy(this.Vnt).findCol(t):C},pet:function(){return this.Mf.Yy(this.Rnt).findCol(this.bet())},bet:function(){return this.Mf.getViewportRightColumn(this.Rnt)},Wnt:function(){var t,n,i,r,e,o,u,s,e,r,a,f,l,c,o,u,c,l,o,u,a,f,l,o,u,a,l,u,f,h,t=this,n=t.znt(),i=t.Pnt(),r=v(t.Mf.Dg()).offset(),e=t.fk.e,o=t.fk.x,u=t.fk.y,s=e.pageX-r.left,e=e.pageY-r.top,r=!1;n||i?i?t.Znt>=t.Unt()&&t.Znt<=t.fet()?t.bO=4:t.Znt<t.Unt()?t.bO=0:t.Znt>t.fet()&&(t.bO=1):n&&(t.Ynt>=t.Lnt()&&t.Ynt<=t.let()?t.bO=5:t.Ynt<t.Lnt()?t.bO=2:t.Ynt>t.let()&&(t.bO=3)):t.Ynt>=t.Lnt()&&t.Ynt<=t.let()?t.Znt>=t.Unt()&&t.Znt<=t.fet()?(a=g(t.Znt-t.fet()))<(f=g(t.Ynt-t.let()))?t.bO=5:f<a?t.bO=4:u>(l=(l=t.het())||t.det()).y+l.height?t.bO=3:(o=(c=(c=t.met())||t.pet()).x+c.width-o,u=l.y+l.height-u,s>=c.x&&s<=c.x+c.width&&e>=l.y&&e<=l.y+l.height?t.bO=u<=o?4:5:r=!0):t.Znt<t.Unt()?t.bO=0:t.Znt>t.fet()&&(t.bO=1):t.Ynt<t.Lnt()?t.Znt>=t.Unt()&&t.Znt<=t.fet()?t.bO=2:t.Znt<t.Unt()?(a=g(t.Znt-t.Unt()),f=g(t.Ynt-t.Lnt()),t.bO=a<=f?2:0):t.Znt>t.fet()&&(a=g(t.Znt-t.fet()),f=g(t.Ynt-t.Lnt()),t.bO=a<=f?2:1):t.Ynt>t.let()&&(t.Znt>=t.Unt()&&t.Znt<=t.fet()?t.bO=3:t.Znt<t.Unt()?(a=g(t.Znt-t.Unt()),f=g(t.Ynt-t.let()),t.bO=a<=f?3:0):t.Znt>t.fet()&&(a=g(t.Znt-t.fet()),f=g(t.Ynt-t.let()),t.bO=a<=f?3:1)),(c=t.Mf.Dn.yet)&&(u=(l=t.let())+1,a=(o=t.fet())+1,f=t.Mf.getRowHeight(l,3),l=t.Mf.getColumnWidth(o,3),o=t.Mf.getRowHeight(u,3),u=t.Mf.getColumnWidth(a,3),a=c.x+c.width/2-b(10,l/2),l=c.x+c.width/2+b(10,u/2),u=c.y+c.height/2-b(10,f/2),f=c.y+c.height/2+b(10,o/2),h=!1,(h=n||i?i?a<=s&&s<=l:u<=e&&e<=f:a<=s&&s<=l&&u<=e&&e<=f)||r?(t.hO=!0,t.bO=4):t.hO=!1)},Lnt:function(){return this.Ktt?-1===this.Ktt.row?0:this.Ktt.row:-1},let:function(){var t=this;return t.Ktt?-1===t.Ktt.row?M(t.Mf)-1:t.Ktt.row+O(t.Ktt)-1:-1},Unt:function(){return this.Ktt?-1===this.Ktt.col?0:this.Ktt.col:-1},fet:function(){var t=this;return t.Ktt?-1===t.Ktt.col?I(t.Mf)-1:t.Ktt.col+S(t.Ktt)-1:-1},wet:function(t,n){var n,i,r,e,e,r,e,t,n=_(n.row,n.col,n.rowCount,n.colCount),i=this.Mf;return i.Ut.findSpan(t.row,t.col)&&(r=t.rowCount,e=n.rowCount,0!==Math.floor(e%r)&&(e=Math.ceil(e/r)*r,n.row+e<=i.getRowCount())&&(n.rowCount=e),r=t.colCount,e=n.colCount,0!==Math.floor(e%r))&&(t=Math.ceil(e/r)*r,n.col+t<=i.getColumnCount())&&(n.colCount=t),n},DD:function(){var t,n,i,r,e,o,u,s,t=this,n=t.Mf;t.Rk=C,t.l9(),t.iy(),t.Yk&&t.rb?(t.Yk=!1,t.rb=!1,(i=t.Knt())&&(!(r=t.Jnt(t.Ktt,t.Xnt))||t.hO?(t.Met(),t.Ax(i)):(e=n.rt.Ktt,o=t.wet(e,t.Xnt),u=t.net(),n.Qy().execute({cmd:"fill",sheetName:n.name(),startRange:e,fillRange:o,autoFillType:u,fillDirection:n.rt.eet()}),!(s=t.lnt)&&t.Cet()&&n.parent.options.showDragFillSmartTag&&4!==t.fnt?t.Tet(t.fnt):t.Ax(i),t.Met()))):t.Met()},Tet:function(t){var n,i,i,n=this.Mf,i=n.Dn.yet,i={x:i.x+i.width,y:i.y+i.height,fillType:t};n.R_=new r.Aet(n.parent.j2(),n,i),n.R_.rQ()},_nt:function(){var t,n,n,i,t=this.Mf,n=t.Ut.getSelections();1===n.length?(n=n[0],(i=t.Ut.getSpans(n))&&0<i.length&&(n=t.kR(i,n)),this.Ktt=n):0<=t.ui&&0<=t.ci&&(this.Ktt=_(t.ui,t.ci,1,1))},Met:function(){this.rb=!1,this.Yk=!1},Ax:function(t){this.Mf.Dn.E1(t)},net:function(t,n){var i,r,t,e,i=this,r=i.Mf,t=t!==F?t:r.parent.options.defaultDragFillType;return i.lO()?4:5!==t?t:(e=1===O(i.Ktt)&&1===S(i.Ktt)&&!i.Pnt()&&!i.znt())?i.a_&&!n?1:0:i.a_&&!n?0:1},Knt:function(){var t,n,i,r,e,t=this;return t.Ktt?t.lO()?t.Ktt:t.Xnt?(e=r=i=n=0,e=t.Iet()?(n=(2===t.bO?t.Xnt:t.Ktt).row,i=O(t.Ktt)+O(t.Xnt),r=t.Ktt.col,S(t.Ktt)):(n=t.Ktt.row,i=O(t.Ktt),r=(0===t.bO?t.Xnt:t.Ktt).col,S(t.Ktt)+S(t.Xnt)),_(n,r,i,e)):C:C},Jnt:function(t,n,i){var r,e,o,r=this.Mf,e=!0,o="";return r.Ut.eE(n.row,n.col,O(n),S(n))&&!B(r,t,n)&&(e=!1,o=T().Exp_FillRangeContainsMergedCell),e&&r.isActualProtected()&&r.dA(n,!0,D.SheetArea.viewport)&&(e=!1,o=r.FT()),e||i||r.ki(D.Events.InvalidOperation,{sheet:r,sheetName:r.name(),invalidType:D.InvalidOperationType.dragFill,message:o,fillRange:n}),e},Cet:function(){return this.xet()||this.Net()},xet:function(){return 3===this.bO||1===this.bO},Net:function(){return 0===this.bO||2===this.bO},Iet:function(){return 2===this.bO||3===this.bO||5===this.bO},eet:function(){var t=this.bO;return 0<=t&&t<=3?t:4===t?0:5===t?2:3},VL:function(t,n,i){var r,e,o,t,u,s,a,u,o,r=this,e=C,o=x(t),t=k(t),u=r.Mf,s=u.parent;if(!f(o)&&!f(t)&&(s.options.allowUserDragDrop||s.options.allowUserDragFill)&&(-1!==(a=u.U5()).row||-1!==a.col)){if(0<=o&&0<=t&&1===u.Ut.getSelections().length){if(r.yD(o,t,n,i))return e;(e=(u=u.getRangeRect(o,t,a)).x-4<n&&n<u.x+4&&u.y<=i&&i<u.y+u.height?{action:l,side:"left"}:e)||(o=r.Mf.Dn.yet)&&o.x<=n&&n<=o.x+o.width&&o.y<=i&&i<=o.y+o.height&&(e={action:l,side:c}),e||u.x+u.width-4<n&&n<u.x+u.width+4&&u.y<=i&&i<u.y+u.height&&(e={action:l,side:"right"}),e||u.y-4<i&&i<u.y+4&&u.x<=n&&n<u.x+u.width&&(e={action:l,side:"top"}),e||u.y+u.height-4<i&&i<u.y+u.height+4&&u.x<=n&&n<u.x+u.width&&(e={action:l,side:"bottom"}),e&&(n<u.x||n>u.x+u.width||i<u.y||i>u.y+u.height)&&(e.outside=!0)}s&&s.options.allowUserDragDrop||e&&e.side!==c&&(e.side=C),s&&s.options.allowUserDragFill||e&&e.side===c&&(e.side=C)}return e},ket:function(t,n){var i,r,e,i=this,r,e=i.Mf.getSpan(t,n,3);return e?!f(i.Mf.getValue(e.row,e.col,3,0)):!f(i.Mf.getValue(t,n,3,0))},Det:function(t,n){var i,r,e,e,i,r,e=this.Mf.tables;return!(!e||0===e.all().length)&&(e=e.AB(t,n,1,1)[0])&&e.footerIndex()===t},_et:function(t,n,i,r){for(var e,o,e=this,o=n;o<n+r;o++)if(!e.ket(t,o)||e.Det(t,o))return!1;return!0},Eet:function(t,n,i,r){for(var e,o,e=this,o=n;o<n+r;o++)if(e.ket(t,o))return!1;return!0},jet:function(t,n,i,r){var e,o,u,s,a,f,l,c,h,e=this,o=e.Mf;if("left"===r){for(u=0;u<n;u++)e.ket(t,u)&&(i.searchArray[u]=!0);for(s=n-1,a=1;i.searchArray[s];)s--,a++;i.searchLength=a}if("right"===r){for(f=o.getColumnCount(),l=n;l<f;l++)e.ket(t,l)&&(i.searchArray[l-n]=!0);for(c=0,h=1;i.searchArray[c];)c++,h++;i.searchLength=h}return i},Oet:function(t,n,i,r,e){for(var o,u,s,a,f,l,c,h,v,g,o=this,u=o.Mf,s=0,a={searchArray:new Array(r),searchLength:1},f={searchArray:new Array(u.getColumnCount()-e),searchLength:1},l=n;l<i;l++)a=o.jet(l,t.col,a,"left"),f=o.jet(l,t.col+t.colCount-1,f,"right");for(;o.Eet(i+s,t.col,1,t.colCount);){for(h=!(c=!0),a=o.jet(i+s,r,a,"left"),f=o.jet(i+s,e,f,"right"),v=r-1;v>=r-a.searchLength;v--)if(o.ket(i+s,v)){s++,c=!1;break}if(c){for(g=e+1;g<=e+f.searchLength;g++)if(o.ket(i+s,g)){s++,h=!0;break}if(!h)return s}}return s},Ret:function(t){for(var n,i,n=this,i=0;n._et(t.row+t.rowCount+i,t.col,1,t.colCount);)i++;return i},Bet:function(t){var n,i,r,e,o,n=this;return n._et(t.row+t.rowCount,t.col,1,t.colCount)?n.Ret(t):(e=t.row-2,o=t.row+t.rowCount,r=1===t.colCount?i=t.col:(i=t.col,t.col+t.colCount-1),n.Oet(t,e,o,i,r))},H_:function(){var t,n,i,r,r,e,o,t=this,n=t.Mf,i=n.rt.Ktt,r=t.Bet(i);0!==r&&(r=_(i.row+i.rowCount,i.col,r,i.colCount),t.bO=3,t.Xnt=r,e=t.net(),o=t.lnt,n.Qy().execute({cmd:"fill",sheetName:n.name(),startRange:i,fillRange:r,autoFillType:e,fillDirection:t.bO}),!o)&&n.parent.options.showDragFillSmartTag&&4!==t.fnt&&t.Tet(t.fnt)}}),v.extend(D.g7.prototype,{Let:function(t,n){var i,r,e,o,t,u,i,s,a,n,i=this.Mf,r=t.x,e=t.y,o=E(t),t=A(t),u=i.U5(),i=i.Fi(),s=4,a=-2.5;return 2007<n&&(s=5,a=-3),n=new D.Rect(-4,-4,s,s),-1===u.col?(n.x=i.b6,n.y=e+t+a):-1===u.row?(n.x=r+o+a,n.y=i.T6):(n.x=r+o+a,n.y=e+t+a),n},yO:function(t,n,i,r,e){var o,u,s,a,a,r,f,l,c,h,s,n,i,o=this,u=o.Mf,s=u.Fi(),a=u.parent,a=a&&a.SC,r=o.Let(r,a),f=r.x,l=r.y,c=E(r),h=A(r),s=s.c9(n,i);e&&!r.intersectRect(e)||r.intersectRect(s)&&(n=-1.5,(i=new D.Rect(f+(n=2007<a?-1:n),l+n,c+2,h+2)).x=R(i.x,s.x),i.y=R(i.y,s.y),o.O1(i),t.save(),e&&!e.containsRect(r)&&(t.rect(e.x,e.y,E(e),A(e)),t.clip()),t.beginPath(),t.fillStyle=D.Pf.vl(u,u.getSelectionBorderColor()),t.fillRect(f,l,c,h),o.yet=new D.Rect(r.x,r.y,4,4),t.beginPath(),t.restore())},cet:function(t,n,i,r){var e=n.x,o=n.y,u=e+E(n),n=o+A(n);V(t,e-2,o,u+1,o,i,r),V(t,e-1,n,u+1,n,i,r),V(t,e,o-1,e,n+1,i,r),V(t,u,o-1,u,n+1,i,r)},Fet:function(t,n){var i,r,e,o,u,s,a,f,l,c,h,v,g,d,p,c,w,m,y,_,y,u,y,l,f,C,i=this,r=i.Mf,e=r.rt,o=e.q6,u=o.hitTarget;o&&u&&(s=o.hitCol,a=o.hitRow,f=o.row,l=o.col,c=e.i_,h=r.Pet,g=r.getSelectionBorderColor(),d=N(r),p=8,t.save(),!0===c?(c=r.Yy(0).findCol(s)||r.Yy(1).findCol(s)||r.Yy(2).findCol(s),w=r._y(0).findRow(a)||r._y(1).findRow(a)||r._y(2).findRow(a),-1===o.row&&-1!==o.col?c&&(m=c.x,y=E(c),o.col=s,u.x>m+y/2&&(o.col<r.getLastFullyVisibleColumn()||o.col===r.G6())&&(m=c.x+E(c),o.col++),(h=h&&0===E(h)?h:e.q6)&&(v=new D.Rect(h.x-8,h.y-8,E(h)+16,A(h)+16),i.O1(v,n),i.E1(r.U5(),n)),r.Uet=new D.Rect(m,o.y,0,A(o)),t.rect(n.x,n.y,E(n),A(n)),t.clip(),t.beginPath(),V(t,m-8,o.y,m+8,o.y,g,d),V(t,m,o.y,m,o.y+A(o),g,d),V(t,m-8,o.y+A(o),m+8,o.y+A(o),g,d)):-1!==o.row&&-1===o.col?w&&(_=w.y,y=A(w),o.row=a,u.y>_+y/2&&(o.row<r.getLastFullyVisibleRow()||o.row===r.P6())&&(_=w.y+A(w),o.row++),(h=h&&0===A(h)?h:e.q6)&&(v=new D.Rect(h.x-8,h.y-8,E(h)+16,A(h)+16),i.O1(v,n),i.E1(r.U5(),n)),r.Uet=new D.Rect(o.x,_,E(o),0),t.rect(n.x,n.y,E(n),A(n)),t.clip(),t.beginPath(),V(t,o.x,_-8,o.x,_+8,g,d),V(t,o.x,_,o.x+E(o),_,g,d),V(t,o.x+E(o),_-8,o.x+E(o),_+8,g,d)):-1!==o.row&&-1!==o.col&&(u=r.Yy(0).findCol(l)||r.Yy(1).findCol(l)||r.Yy(2).findCol(l),y=r._y(0).findRow(f)||r._y(1).findRow(f)||r._y(2).findRow(f),w)&&c&&y&&u&&(m=u.x,_=y.y,h&&(v=new D.Rect(h.x-8,h.y-8,E(h)+16,A(h)+16),i.O1(v,n),i.E1(r.U5(),n)),l=!1,f=r.getCellRect(a,s),(l=!e.Cnt&&f?(C=o.hitTarget.x-f.x)<b(16,r.nn(s)/4):l)?m=c.x:_=w.y,r.Uet=new D.Rect(m,_,E(o),A(o)),r.U5().contains(a,s)||(t.rect(n.x,n.y,E(n),A(n)),t.clip(),t.beginPath(),l?(V(t,m-8,_,m+8,_,g,d),V(t,m,_,m,_+A(o),g,d),V(t,m-8,_+A(o),m+8,_+A(o),g,d),e.Dnt=!0):(V(t,m,_-8,m,_+8,g,d),V(t,m,_,m+E(o),_,g,d),V(t,m+E(o),_-8,m+E(o),_+8,g,d),e.Dnt=!1)))):(h&&(v=new D.Rect(h.x-8,h.y-8,E(h)+16,A(h)+16),i.O1(v,n),i.E1(r.U5(),n)),t.rect(n.x,n.y,E(n),A(n)),t.clip(),t.beginPath(),i.cet(t,o,g,d)),t.beginPath(),t.restore())},o_:function(){var t,n,i,r,i,e,o,u,s,a,f,l,c,s,f,t=this,n=t.Mf,i=n.sw,r=n.rt.xnt;i&&i.dragInfo&&r&&(i=t.J(),e=n.Fi(),o=n.rt.q6,u=n.j1(r),s=n.frozenTrailingColumnCount(),a=n.frozenTrailingRowCount(),f=n.getColumnCount()-s,l=n.getRowCount()-a,c=e.c9(1,1),0<s&&r.col+r.colCount<=f&&u.x+E(u)>c.x+E(c)&&u.intersectRect(c)&&(u=u.getIntersectRect(c)),0<a&&r.row+r.rowCount<=l&&u.y+A(u)>c.y+A(c)&&u.intersectRect(c)&&(u=u.getIntersectRect(c)),s=new D.Rect(e.b6,e.T6,e.Hy+e.zy,e.Ay+e.Iy),0<=E(u)&&0<=A(u)&&(o.x=u.x,o.y=u.y,o.width=E(u),o.height=A(u),t.Fet(i,s)),f=n.rt.i_,n.Pet=!0===f?n.Uet:new D.Rect(o.x,o.y,E(o),A(o)))}})},"./dist/plugins/fill/fill-ui.js":function(N,t,n){var i,V,u,n,s,a,r,f,l,e,o,c,h,v,g,d,p,w,m,y,_,C,q,L,D,F,b,R,j,T,x,k,B,e,M,W,$,H,I,S;function O(t,n,i,r,e,o){var t=t.Oi,u=t?"160px":"150px",t=t?"25px":"20px",u=s(a("div")).css([C,L,D,"padding",F],["block",u,t,0,0]).addClass("gc-smartMenu-item-default "+i+" ui-state-default"+l),t=s(a("div")).addClass(d).appendTo(u),i=s(a("div")).addClass("gc-menu-item-text").appendTo(u),n=s(a("input")).attr({id:n,value:e,type:"radio",name:"fill-group",style:"display:none"}).appendTo(t);return s(a("span")).text(r).appendTo(i),o?(t.addClass(g),n.prop("checked","checked")):n.prop("checked",""),u}function A(t,n){var t,i,t=I.call(this,t,r(n.parent.Ti))||this;return t.Mf=n,t.Het=s("."+w),(i=t.g$=t.Xc()).addClass(c),O(n,"smartMenuCopyCells",o,M().CopyCells,"0",!0).appendTo(i),O(n,"smartMenuFillSeries",o,M().FillSeries,"1").appendTo(i),n.NMi||(O(n,"smartMenuFillFormattingOnly",o,M().FillFormattingOnly,"2").appendTo(i),O(n,"smartMenuFillWithoutFormatting",o,M().FillWithoutFormatting,"3").appendTo(i)),t}function E(t,n,i){var t,n,t=S.call(this,t,r(n.parent.Ti))||this;return t.Mf=n,t.zet=i,n=t.Vet=t.Xc().addClass("gc-smart-tag-default "+w+" gc-no-user-select ui-widget-header"+l),t.Yet=s(a("div")).attr("class","fillSmartTag").css(m,y).appendTo(n),t.Zet=s(a("div")).attr("class","fillSmartTagDown").css([m,C],[y,"none"]).appendTo(n),t}i=this&&this.__extends||(H=function(t,n){return(H=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}H(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),Object.defineProperty(t,"__esModule",{value:!0}),t.Aet=void 0,V=n("Common"),u=n("Core"),n=n("./dist/plugins/fill/fill.ns.js"),s=u.GC$,a=u.mt.En,r=u.mt.gi,f=s(document),l=" btn btn-default",o="gc-fill-type-item",c="gc-fill-menu-container",h=(e="ui-state-hover ")+"gc-smartMenu-item-hover",v=e+"gc-smart-tag-hover",g="ui-icon ui-icon-check gc-check-image",d="gc-menu-item-input",p="ui-state-active gc-smart-tag-active",w="gc-tag-container",m="float",y="left",_="top",C="display",q="width",L="min-width",D="height",F="margin",b="change",R="input[type=radio]",j="mouseover",T="mouseout",x="click",k="fillTypeChanged",B="keydown.ui-fill",e=new V.Common.ResourceManager(n.SR,"Fill"),M=e.getResource.bind(e),I=u.zc,i(A,I),A.prototype.$c=function(){I.prototype.$c.call(this)},A.prototype.aY=function(){var e,t,n,e=this,t;s("."+o).bind(j,function(){s(this).addClass(h)}).bind(T,function(){s(this).removeClass(h)}).bind(x,function(){var t,n,i,r,i,t=s(this),n=e.Het,i=t.find(R),r=i[0];r.checked=!0,i.trigger(b),n.trigger(x),n.trigger(T),t.removeClass(h),i=parseInt(s(r).attr("value"),10),e.Wet(i)}),(n=e.g$.find(R)).bind(b,function(){s("."+d).removeClass(g),s(this).parent().addClass(g)})},A.prototype.Qet=function(){s("."+o).unbind(j).unbind(T).unbind(x),this.g$.find(R).unbind(b)},A.prototype.Wet=function(t){var n=this,i=n.Mf,r=i.rt;if(n.Ket!==t){n.Ket=t,i.cnt=!0,i.suspendEvent();try{u.Commands.undo.execute(i.parent,{sheetName:i.name()})}finally{i.resumeEvent()}i.cnt=!1,i.Qy().execute({cmd:"fill",sheetName:i.name(),startRange:r.Ktt,fillRange:r.Xnt,autoFillType:t,fillDirection:r.bO}),n.Het.trigger(k,t)}},A.prototype.Jet=function(){return!!s("."+c).length},W=A,S=u.zc,i(E,S),E.prototype.Xet=function(t,n,i){var r=this,e=r.Mf.Oi,n=s(n),o=r.qet,r=r.Zet,u=e?"38px":"32px",e=e?"24px":"18px";o&&o.Jet()||(t?n.addClass(v):n.removeClass(v),n.css([q,D],[t?u:e,e]),i)||(t?r.show():r.hide())},E.prototype.$et=function(){var e=this,t=e.Vet,n=u.mt.pi(),o=u.mt.Tt.safari&&(n.ipad||n.iphone);t.bind(j,function(){e.Xet(!0,this,o)}).bind(T,function(){e.Xet(!1,this,o)}),t.bind(x,function(){var t,n,i,r,n,i,t=s(this),n=e.qet,i=e.Zet,r;n&&n.Jet()?(o&&i.hide(),t.removeClass(p),e.tit()):(o&&i.show(),t.addClass(p),e.nit(),(i=(n=e.g$)&&n.find(R)[e.zet.fillType])&&!i.checked&&(i.checked=!0,s(i).trigger(b)))}),f.bind(B,function(t){27===t.keyCode&&(e.qet&&e.qet.Jet()?e.tit():e.close(),u.mt.vi(t))})},E.prototype.rQ=function(){var t=this,n=t.Vet,i=t.zet,r=t.Mf.Oi,e=r?"3px":"0px",r=r?"24px":"18px";n&&(n.css([y,_],[i.x,i.y]),t.$c(),t.$et(),t.Yet.css(F,e),t.Zet.css(D,r),t.c5())},E.prototype.nit=function(){var t,n,n,i,r,r,e,o,u,t=this,n=t.Mf;t.qet||(t.qet=new W(n.parent.j2(),n),t.g$=t.qet.Xc()),i=(n=t.Vet).css(y),r=n.css(_),r=parseFloat(r),o=t.qet,u=t.zet,o.Ket=u.fillType,isNaN(r)||(e=r+n.height()+2),t.g$.css([y,_],[i,e]),o.$c(),o.aY(),o.Het.unbind(k).bind(k,function(t,n){u.fillType=n})},E.prototype.tit=function(){var t=this.qet;t&&(t.Qet(),t.close())},E.prototype.c5=function(){var t=this,n=t.qet,t=t.Vet;n&&(n.Jet()&&t.trigger(x),t.trigger(T))},E.prototype.close=function(){var t,n,t,t=this,n=t.Mf;t.c5(),f.unbind(B),S.prototype.close.call(this),(t=n.fg)&&(t.style.cursor="default"),n&&n.Zg()},E.prototype.lf=function(t){var n;return!(!this.Wc||!S.prototype.hf.call(this,this.Wc.get(0),t))||this.g$&&S.prototype.hf.call(this,this.g$.get(0),t)},t.Aet=E},"./dist/plugins/fill/fill.entry.js":function(t,n,i){var r,e,r=this&&this.__createBinding||(Object.create?function(t,n,i,r){void 0===r&&(r=i);var e=Object.getOwnPropertyDescriptor(n,i);e&&("get"in e?n.__esModule:!e.writable&&!e.configurable)||(e={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,r,e)}:function(t,n,i,r){t[r=void 0===r?i:r]=n[i]}),e=this&&this.__exportStar||function(t,n){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||r(n,t,i)};Object.defineProperty(n,"__esModule",{value:!0}),i("./dist/plugins/fill/drag-fill.js"),i("./dist/plugins/fill/fill-event.js"),e(i("./dist/plugins/fill/fill-ui.js"),n),e(i("./dist/plugins/fill/fill.js"),n),e(i("./dist/plugins/fill/fill.ns.js"),n)},"./dist/plugins/fill/fill.js":function(j,t,n){var i,e,h,r,T,n,M,o,tt,_,C,D,nt,I,u,S,x,u,O,A,it,rt,et,E,u,k,N,V,q,L,B,W,ot,$,H,u,n,z,P,U,n,G,J,K,Q,X,Y,Z,at,ft,lt,ct,ht,n,u,n,u,n,vt,gt,dt,pt,wt,mt,yt,_t,Ct,s,a,Dt,Ft;function ut(t){return!st(t)&&o.q8(t)}function st(t){return"string"==typeof t}function bt(t,n){return-1!==t.lastIndexOf(n)}function Rt(t){var n=[t];return n.rowCount=1,n.colCount=x(t),n}function jt(t){return t}function Tt(t,n,i,r){var n=Rt(n),i=Rt(i),r=Rt([r]),t=t?e.Common.eit(n,i,r,!0,jt,tt,tt,tt):e.Common.iit(n,i,r,!0,tt,tt,tt),n=t&&t[0][0];return typeof n===it?e.Common.st.E8(n,13):n}function xt(t){return t.toLowerCase()}function f(t){this.rit=[],this.oit=[],this.ait=[],this.uit=tt,this.sit=[],this.cit=tt,this.lit=nt(t)?-1:t}function l(t){this.hit=-1,this.dit=[],this.MV=-1,this.Mf=t}function kt(){this.vit="",this.mit="",this.MV=0,this.git=1,this._padding=""}function c(t){var n,i,r,e,n=t.length,i=1;if(1<n)for(i=t[1]-t[0],e=2;e<n;e++)if(i!==(r=t[e]-t[e-1])){i=0;break}return i}function v(t,n){return 0<t?(t-1)%n:n-Math.abs(t)%n-1}function g(t){for(var n="",i=0;i<t;)n+="0",i++;return n}function d(t,n){return 12*(n.getFullYear()-t.getFullYear())+(n.getMonth()-t.getMonth())}function Mt(t){return t.every(function(t){var n;return 1===t.getDate()})}function It(t){return t.every(function(t){var n,i,r,e,n=t.getFullYear(),i=t.getMonth(),r,e;return t.getDate()===new Date(n,i+1,0).getDate()})}function St(t){var n,i,n=0,i;return t.every(function(t){var t=t.getDate();return(n=n||t)===t})?n:0}function Ot(t,n){for(var i,r,e,o,i=t.length,r=!0,o=2;o<i&&(r=n===(e=d(t[o-1],t[o])));o++);return r}function At(t){return t.every(function(t){var n=t.getHours(),i=t.getMinutes(),t=t.getSeconds();return 0!==n||0!==i||0!==t})}function Et(t,n){return new Date(t,n+1,0).getDate()}function p(t){return"0"===t[0]}function Nt(n,t,i){var r,e,o,e,o,u,s,u=i?1:2,s=i?2:1;return t.every(function(t){return!!(r=t.match(n.pit))&&(e=r[u],(o=e.length)>n.yit&&p(e)&&(n.yit=o),o=parseInt(e,10),e=r[s],nt(n.cit)&&(n.cit=e),e!==n.cit?(n.wit=!0,n.cit=tt,n.sit=[]):n.sit.push(o),!0)})}function w(){}function Vt(){var t=null!==vt&&vt.apply(this,arguments)||this;return t.Mit=0,t.uit=rt,t}function m(){return null!==gt&>.apply(this,arguments)||this}function y(){return null!==dt&&dt.apply(this,arguments)||this}function qt(){return null!==pt&&pt.apply(this,arguments)||this}function Lt(){var t=wt.call(this)||this;return t.pit=tt,t.sit=[],t.cit=tt,t.wit=!1,t.yit=0,t.uit=et,t.Cit=!1,t.Sit=!1,t.Tit=new H,t}function F(t){var n=mt.call(this)||this;return n.Ait=new $(t),n}function Bt(){var t=null!==yt&&yt.apply(this,arguments)||this;return t.pit=/^\d+$/,t}function Wt(){var t=null!==_t&&_t.apply(this,arguments)||this;return t.pit=/^(.*\D+)(\d+)$/,t}function $t(){var t=null!==Ct&&Ct.apply(this,arguments)||this;return t.pit=/^(\d+)(\D+.*)$/,t}function b(){var t=null!==s&&s.apply(this,arguments)||this;return t.pit=/^(.*\D+)(\d+)(\D+.*)$/,t}function Ht(){return null!==a&&a.apply(this,arguments)||this}function zt(){return null!==Dt&&Dt.apply(this,arguments)||this}function Pt(){var t=null!==Ft&&Ft.apply(this,arguments)||this;return t.Cit=!0,t}function Ut(t){var n,i,i,t,r,e,o,n=this;n.Iit=[new z,new P,new U],n.xit=new at,n.Nit=new ft,i=N.culture(),i=N.Fe(i).isJCKCulture,t=new G(t),r=new J,e=new K,o=new Q,n.kit=i?[t,r,new Z,e,o,new X]:[t,r,e,o]}function Gt(t){t.forEach(function(t){t&&t.dispose()})}function R(t){this.Mf=t,this.Dit=!1,this._it=[]}i=this&&this.__extends||(ht=function(t,n){return(ht=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}ht(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),Object.defineProperty(t,"__esModule",{value:!0}),t.Wtt=t.nnt=t.FillDateUnit=t.FillType=t.FillSeries=t.FillDirection=t.AutoFillType=void 0,e=n("Common"),h=n("Core"),r=n("CalcEngine"),T=n("SheetsCalc"),n=n("./dist/plugins/fill/fill.ns.js"),M=!!r,o=e.Common.lt,tt=null,_=void 0,C=Math.floor,D=h.Ec,nt=o.ht,I=o.uJ,u=e.Common.Uf,S=u.Eit,x=u.tR,u=e.Common.ct,O=u.o0,A=u.Y0,it="number",rt="date",et="string",E="default",u=new e.Common.ResourceManager(n.SR,"Fill"),k=u.getResource.bind(u),N=e.Common.CultureManager,(n=V=t.AutoFillType||(t.AutoFillType={}))[n.copyCells=0]="copyCells",n[n.fillSeries=1]="fillSeries",n[n.fillFormattingOnly=2]="fillFormattingOnly",n[n.fillWithoutFormatting=3]="fillWithoutFormatting",n[n.clearValues=4]="clearValues",n[n.auto=5]="auto",(u=q=t.FillDirection||(t.FillDirection={}))[u.left=0]="left",u[u.right=1]="right",u[u.up=2]="up",u[u.down=3]="down",(n=L=t.FillSeries||(t.FillSeries={}))[n.column=0]="column",n[n.row=1]="row",(u=B=t.FillType||(t.FillType={}))[u.direction=0]="direction",u[u.linear=1]="linear",u[u.growth=2]="growth",u[u.date=3]="date",u[u.auto=4]="auto",(n=W=t.FillDateUnit||(t.FillDateUnit={}))[n.day=0]="day",n[n.weekday=1]="weekday",n[n.month=2]="month",n[n.year=3]="year",f.prototype.jit=function(){return x(this.rit)},f.prototype.Oit=function(){for(var t=this,n=[],i=t.oit,r,e,r=0;r<x(i);r++)e=i[r],n.push("object"===t.uit?t.r0(e):e);return n},f.prototype.Rit=function(){var t,n,i,r,e,t=this,n=t.rit;if(0<x(n)){for(r=[],e=void 0,-1===(i=t.lit)&&(i=n[0]),e=0;e<x(n);e++)r[e]=n[e]-i+1;return r}return tt},f.prototype.Bit=function(){var t=this.oit;return x(t)?t:tt},f.prototype.Eit=function(t,n,i){if(!ut(i))throw new Error(k().Exp_NumberOnly);var r=this;nt(r.uit)&&(r.uit=i instanceof Date?rt:it),S(r.rit,t,n),S(r.oit,t,I(i))},f.prototype.ZP=function(t,n){var i=this,r=nt(i.uit);ut(n)?(r&&(n instanceof Date?i.uit=rt:i.uit=it),i.oit.push(I(n))):r&&(i.uit=st(n)?et:E),i.rit.push(t),i.ait.push(n)},f.prototype.Lit=function(t){return this.uit===rt?this.r0(t):t},f.prototype.r0=function(n){var i=tt;if(n instanceof Date)i=n;else if(r)try{i=r.Convert.r0(n)}catch(t){i=n}return i},ot=f,l.prototype.L0=function(){this.Mf=tt},l.prototype.Fit=function(){var t=this.Mf;return t.parent&&t.parent.Ow()||[]},l.prototype.Pit=function(t){var n,i,r,e,o,u,s,a,f,l,c,h,v,g,d,p,n=t.length,i=!1;if(t&&0<n)for(r=xt(t[0]),e=this.Fit(),l=f=a=s=u=o=void 0,o=0;o<e.length;o++)if(0<=(a=(s=(u=e[o]).map(xt)).indexOf(r))){for(f=a,c=s.length,g=v=h=void 0,d=1;d<n;d++){if(v=xt(t[d]),!(0<=(h=s.indexOf(v)))){i=!1;break}if(g=h-f+c,l){if(l!==g){i=!1;break}}else i=!0,l=g,f=h}if(p=1===n,i||p){i=!0,this.hit=a,this.dit=u,this.MV=p?1:l;break}}return i},l.prototype.Sl=function(t){var n=this.dit,i=this.hit,r=this.MV,e=n.length,o,u,u;return n[(i+r*v(t,e))%e]},$=l,kt.prototype.Sl=function(t){var t=this.MV*(t-1)+this.git,n=this._padding.length,t=""+Math.abs(t),i,r=this._padding+t,e=r.length,t=n<t.length?t:r.substr(e-n);return this.vit+t+this.mit},H=kt,w.prototype.match=function(t){return!1},w.prototype.getTargetValue=function(t,n,i,r,e){},w.prototype.resetProp=function(){},w.prototype.Git=function(t,n){return t.indexOf(n+1)},w.prototype.dispose=function(){},i(Vt,vt=u=w),i(m,gt=n=Vt),m.prototype.match=function(t){var n,i,r,e,n=this.Mit=d(t[0],t[1]),i=Mt(t),r=t.length,e=!0;return i&&2<r&&(e=Ot(t,n)),i&&e},m.prototype.getTargetValue=function(t,n){var i,t=t.ait[0],r=t.getFullYear(),e,o,u,t=t.getMonth()+this.Mit*(n-1);return new Date(r+parseInt(t/12,10),t%12,1)},z=m,i(y,dt=n),y.prototype.match=function(t){var n,i,r,e,n=this.Mit=d(t[0],t[1]),i=It(t),r=t.length,e=!0;return i&&2<r&&(e=Ot(t,n)),i&&e},y.prototype.getTargetValue=function(t,n){var i,t=t.ait[0],r=t.getFullYear(),e,o,u,t=t.getMonth()+this.Mit*(n-1),n=r+parseInt(t/12,10),r=t%12;return new Date(n,r,Et(n,r))},P=y,i(qt,pt=n),qt.prototype.match=function(t){var n,i,r,e,o,u,n=!1;return At(t)||(i=this.Mit=d(t[0],t[1]),e=0<(r=St(t)),o=t.length,u=!0,this.Uit=r,e&&2<o&&(u=Ot(t,i)),n=e&&u),n},qt.prototype.getTargetValue=function(t,n){var i,t=t.ait[0],r=t.getFullYear(),e,o,u,t=t.getMonth()+this.Mit*(n-1),n=r+parseInt(t/12,10),s;return new Date(n,t%12,this.Uit)},U=qt,i(Lt,wt=u),Lt.prototype.resetProp=function(){this.sit=[],this.yit=0,this.cit=tt,this.wit=!1,this.Cit=!1,this.Sit=!1},Lt.prototype.getInternal=function(t){for(var n,i,r,e,n=!1,i=t[0],e=1;e<t.length;e++)if(r=t[e],1!==Math.abs(r-i)){n=!0;break}return n},i(F,mt=n=Lt),F.prototype.dispose=function(){var t=this;t.Ait&&(t.Ait.L0(),t.Ait=tt)},F.prototype.match=function(t){return this.Ait.Pit(t)},F.prototype.getTargetValue=function(t,n,i,r,e){var o,t=t.ait.length,i=this.Git(i,r),r=tt,u;return r=-1!==i?this.Ait.Sl(u=t*e+i+1):r},G=F,i(Bt,yt=n),Bt.prototype.match=function(t){var n=this,i,r,r;return t.every(function(t){return!!(i=t.match(n.pit))&&((r=t.length)>n.yit&&p(t)&&(n.yit=r),r=parseInt(t,10),n.sit.push(r),!0)})},Bt.prototype.getTargetValue=function(t,n,i,r,e){var o=t.ait,u=this.Tit,s=c(this.sit),o=o.length,a=0!==s,n=a?0:v(n,o),i=this.Git(i,r),r=tt,f;return this.Cit=a,this.Sit=this.getInternal(t.rit),-1!==i&&(u.MV=s,u.git=this.sit[n],u._padding=g(this.yit),r=u.Sl(f=o*e+i+1)),r},J=Bt,i(Wt,_t=n),Wt.prototype.match=function(t){return Nt(this,t,!1)},Wt.prototype.getTargetValue=function(t,n,i,r,e){var o=t.ait,u=this.Tit,s=c(this.sit),o=o.length,a=0!==s,n=a?0:v(n,o),i=this.Git(i,r),r=tt,f;return this.Cit=a,this.Sit=this.getInternal(t.rit),-1!==i&&(u.vit=this.cit,u.MV=s,u.git=this.sit[n],u._padding=g(this.yit),r=u.Sl(f=o*e+i+1)),r},K=Wt,i($t,Ct=n),$t.prototype.match=function(t){return Nt(this,t,!0)},$t.prototype.getTargetValue=function(t,n,i,r,e){var o=t.ait,u=this.Tit,s=c(this.sit),o=o.length,a=0!==s,n=a?0:v(n,o),i=this.Git(i,r),r=tt,f;return this.Cit=a,this.Sit=this.getInternal(t.rit),-1!==i&&(u.mit=this.cit,u.MV=s,u.git=this.sit[n],u._padding=g(this.yit),r=u.Sl(f=o*e+i+1)),r},Q=$t,i(b,s=n),b.prototype.resetProp=function(){s.prototype.resetProp.call(this),this.Hit=tt},b.prototype.match=function(t){var n,i,r,i,n,r,e,e=this;return t.every(function(t){return!!(n=t.match(e.pit))&&(i=n[2],(r=i.length)>e.yit&&p(i)&&(e.yit=r),r=parseInt(i,10),i=n[1],nt(e.cit)&&(e.cit=i),n=n[3],nt(e.Hit)&&(e.Hit=n),i!==e.cit||n!==e.Hit?(e.wit=!0,e.cit=tt,e.Hit=tt,e.sit=[]):e.sit.push(r),!0)})},b.prototype.getTargetValue=function(t,n,i,r,e){var o=this,u=t.ait,s=o.Tit,a=c(o.sit),u=u.length,f=0!==a,n=f?0:v(n,u),i=o.Git(i,r),r=tt,l;return o.Cit=f,o.Sit=o.getInternal(t.rit),-1!==i&&(s.vit=o.cit,s.mit=o.Hit,s.MV=a,s.git=o.sit[n],s._padding=g(o.yit),r=s.Sl(l=u*e+i+1)),r},Y=["-","_",":",".",","],i(Ht,a=X=b),Ht.prototype.resetProp=function(){a.prototype.resetProp.call(this),this.zit=tt},Ht.prototype.match=function(t){var r,e,o,r,e,o,u,s,u=this;return t.every(function(n){var t,t,t,i,t=u.zit;if(s=nt(t)?Y.some(function(t){if(bt(n,t))return u.zit=t,!0}):bt(n,t)){if(t=u.zit,t=n.lastIndexOf(t),r=n.substring(0,t+1),nt(u.cit))u.cit=r;else if(u.cit!==r)return!1;if(t=n.substr(t+1),r=t.match(i=/^(\d+)(\D+.*)$/))return e=r[1],(o=e.length)>u.yit&&p(e)&&(u.yit=o),o=parseInt(e,10),e=r[2],nt(u.Hit)&&(u.Hit=e),e!==u.Hit?(u.cit=tt,u.Hit=tt,!(u.sit=[])):(u.sit.push(o),!0)}return!1})},Z=Ht,i(zt,Dt=u),zt.prototype.getTargetValue=function(t,n,i){return Tt(!0,t.Bit(),i,n)},at=zt,i(Pt,Ft=u),Pt.prototype.getTargetValue=function(t,n,i,r){var t=t.ait,e,o;return t[v(n,t.length)]},ft=Pt,Ut.prototype.getRule=function(t,n){var i,r,e,o,u,i=[],r=this.Nit;for(t===rt?(i=this.Iit,r=this.xit):t===et?i=this.kit:t===it&&(r=this.xit),e=0;e<i.length;e++)if(u=void 0,(o=i[e]).resetProp(),o.match(n)){if(u=o.wit,nt(u)||!1===u)return o;if(!0===u)return r}return r},Ut.prototype.L0=function(){var t=this;t.Iit&&(Gt(t.Iit),t.Iit=tt),t.kit&&(Gt(t.kit),t.kit=tt),t.xit&&(t.xit.dispose(),t.xit=tt),t.Nit&&(t.Nit.dispose(),t.Nit=tt)},t.nnt=Ut,R.prototype.qtt=function(t,n,i,r,e){var o=this,t=t?1:2;nt(r)&&nt(e)?o.$tt(n,i,t):o.$tt(n,i,t,r,e,tt)},R.prototype.$tt=function(t,n,i,r,e,o){var u,s,t,a,f,l,c,h,v,g,d,p,w,m,y,_,C,D,F,t,b,R,p,j,T,u=this,s=u.Mf,t=s.JS(t),a=t.row,f=t.col,l=t.rowCount,c=t.colCount;if(s.Ut.eE(a,f,l,c))throw new Error(k().Exp_RangeContainsMergedCell);for(m=0,_=(y=1===n)?c:l,D=y?a+l:f+c,F=(w=3<arguments.length)?1:_,b=(t=this.Mf.rt.Ktt).row===a&&t.rowCount===l&&t.col>f||t.col===f&&t.colCount===c&&t.row>a,h=C=y?a:f;h<D;h++)if(p=b&&w?a+l-1:a,(j=y?u.Vit(h,R=b&&w?f+c-1:f,1,F,n):u.Vit(p,h,F,1,n))&&j.jit())for(d=j.rit[0],w?(p=b?j.oit[x(j.oit)-1]:j.oit[0],v=u.Yit(b,p,_,i,r,e,o),b&&(m=_-x(v),d=j.rit[x(j.rit)-1])):v=u.Zit(j,_,i),g=0;g<x(v);g++)T=j.Lit(v[g]),y?u.Wit(s,h,d,h,f+m+g,T,i):u.Wit(s,d,h,a+m+g,h,T,i)},R.prototype.Vit=function(t,n,i,r,e){for(var o=tt,u=this.Mf,s,a=1===e,f=a?n+r-1:t+i-1,l=a?n:t;l<=f;)ut(s=a?u.getValue(t,f):u.getValue(f,n))&&(o=o||new ot(l)).Eit(0,f,s),f--;return o},R.prototype.Yit=function(t,n,i,r,e,o,u){for(var s,a,f,l,c,h,v,s=[],a=n,l=0<=e,c=nt(o),f=0;f<i;f++)h=o<=a,v=a<=o,t&&(c||l&&h||!l&&v)?(s.unshift(a),1===r?a-=e:2===r?a/=e:3!==r||nt(u)||(a=this.Qit(!0,u,n,a,e,f+1))):!t&&(c||l&&v||!l&&h)&&(s.push(a),1===r?a+=e:2===r?a*=e:3!==r||nt(u)||(a=this.Qit(!1,u,n,a,e,f+1)));return s},R.prototype.Zit=function(t,n,i){var r=[],e,o=1===i;if(o||2===i){for(1===t.jit()&&t.ZP(t.rit[0]+1,o?t.Lit(t.oit[0]+1):t.Oit()[0]),e=0;e<n;e++)r.push(Tt(!!o,t.Bit(),t.Rit(),e+1));return r}return tt},R.prototype.Jtt=function(t,n,i,r,e,o){var u,s,a,t,f,l,c,t,s,h,v,a,u=this,s=u.Mf,a=s.Ut,t=s.JS(t),f=t.row,l=t.col,c=t.rowCount,t=t.colCount,s=s.JS(s.rt.Ktt),h=s.row,v=s.col;if(a.GT(h,v,s.rowCount,s.colCount)||a.GT(f,l,c,t))throw new Error(k().Exp_ChangeMergedCell);return a=u.Kit(s,c,t,n,i,!(f<h||l<v),r,e,o),u.Jit&&u.Jit.IB&&(u.Jit.IB.reFilter(),delete u.Jit),a},R.prototype.Kit=function(t,n,i,r,e,o,u,s,a){var f=this,l=o?1:-1,c,h,v,g,d=t.row,p=t.col,w=t.rowCount,m=t.colCount;if(1===r){if(c=C(i/m),h=i%m,!e)for(g=1;g<c;g++)v=D(d,p+g*l*m,w,m),f.Tle(t,v,r,4,e,o,_,_,!0,u,s),f.Xit(t,v,r,4,e,o,_,_,!0,u,s);if(e&&1<c&&0===h&&(c-=1,h=m),0<c&&0<h)return v=D(d,o?p+c*m:p-c*m+m-h,w,h),f.Tle(t,v,r,4,e,o,tt,o?0:m-h,_,u,s),f.Xit(t,v,r,4,e,o,tt,o?0:m-h,_,u,s)}else{if(c=C(n/w),h=n%w,f.Dit||(v=D(d+l*w,p,n-w,i),f.qit(t,v,l,a)),!e)for(g=1;g<c;g++)v=D(d+g*l*w,p,w,m),f.Tle(t,v,r,4,e,o,tt,tt,!0,u,s),f.Xit(t,v,r,4,e,o,tt,tt,!0,u,s);if(e&&1<c&&0===h&&(c-=1,h=w),0<c&&0<h)return v=D(o?d+c*w:d-c*w+w-h,p,h,m),f.Tle(t,v,r,4,e,o,o?0:w-h,tt,!0,u,s),f.Xit(t,v,r,4,e,o,o?0:w-h,tt,!0,u,s)}},R.prototype.Xit=function(t,n,N,i,r,e,V,q,o,u,s){for(var a,f,L,l,B,c,h,v,g,W,$,H,d,z,P,U,p,w,m,y,_,C,D,F,b,G,R,j,T,x,J,k,M,c,I,S,K,Q,X,O,Y,Z,A,E,a=this,f=a.Mf,L=f.Ut,l=1===N,W=l?t.row:t.col,$=l?t.col:t.row,H=l?n.row:n.col,d=l?n.col:n.row,z=l?t.rowCount:t.colCount,P=l?t.colCount:t.rowCount,U=l?n.colCount:n.rowCount,v=0;v<z;v++){for(m=0,C=y=W+v,D=_=H+v,F=(l?q:V)||0,b=l?0:F,G=l?tt:o,R=w=p=tt;m<P;)if(x=tt,J=j=$+m,k=T=d+m-F,l||(y=j,j=C,_=T,T=D),h=L.findSpan(y,j),(B=f.hasFormula&&f.hasFormula(y,j))||(x=f.getValue(y,j)),(M=a.Dit)&&nt(R)&&(R=!1===e?f.getValue($+P-1,j):f.getValue(y,j)),M||4!==i||!ut(x)&&!st(x)||(p=p||new ot,c=ut(x)?x instanceof Date?rt:it:et,(w=w||c)!==c))if(!M&&x&&p&&p.jit()){if(g=a.$it(l,t,n,C,D,p,r,e,b,G,u,s),r&&g)return g;w=p=tt}else{if(M||!h||h&&(l?h.row:h.col)===C)if(c=k===d+U-1,I=M?R:x,r){if(M)return I;if(h&&c||!h&&(c&&e||!e&&k===d))return x}else!(k<d+U&&d<=k)||!M&&!l&&(l||o&&f.XT&&f.XT(k))||M&&-1!==a._it.indexOf(_)||a.Wit(f,y,j,_,T,I,i,u,s);h?m+=l?h.colCount:h.rowCount:m++}else p.ZP(J,x),h?m+=l?h.colCount:h.rowCount:m++;if(a.Dit)for(S=t.row,K=t.col,Q=t.rowCount,X=t.colCount,Y=O=void 0,Z=!1===e?-1:1,A=1;A<Q;A++)for(O=S+Z*A,E=0;E<X;)Y=K+E,-1===a._it.indexOf(O)&&a.Wit(f,S,K,O,Y,R,i,u,s),E++;if(p&&p.jit()&&(g=a.$it(l,t,n,C,D,p,r,e,b,o,u,s),r)&&!nt(g))return g}return tt},R.prototype.Tle=function(t,n,N,i,r,e,V,q,L,o,u){var s,a,B,f,l,c,h,v,g,W,d,$,p,H,w,z,m,y,_,C,D,F,b,R,j,T,x,k,M,I,P,S,c,c,h,U,G,J,K,O,Q,X,A,E;if(!r){for(f=(B=(a=(s=this).Mf).Ut).yle(),W=(l=1===N)?t.row:t.col,d=l?t.col:t.row,$=l?n.row:n.col,p=l?n.col:n.row,H=l?t.rowCount:t.colCount,w=l?t.colCount:t.rowCount,z=l?n.colCount:n.rowCount,g=0;g<H;g++){for(_=0,F=C=W+g,b=D=$+g,R=(l?q:V)||0,j=l?0:R,T=l?tt:L,x=y=m=tt;_<w;)I=tt,P=k=d+_,S=M=p+_-R,l||(C=k,k=F,D=M,M=b),v=B.findSpan(C,k),c=a.getValueIgnoreDefault(C,k),nt(c)?_++:((c=f.getFormula(C,k))&&""!==c||(I=f.getValue(C,k)),(c=s.Dit)&&nt(x)&&(x=!1===e?a.getValue(d+w-1,k):a.getValue(C,k)),c||4!==i||!ut(I)&&!st(I)||(m=m||new ot,h=ut(I)?I instanceof Date?rt:it:et,(y=y||h)!==h)?!c&&I&&m&&m.jit()?(s.$it(l,t,n,F,b,m,r,e,j,T,o,u,!0),y=m=tt):((c||!v||v&&(l?v.row:v.col)===F)&&(h=c?x:I,!(S<p+z&&p<=S)||!c&&!l&&(l||L&&a.XT&&a.XT(S))||c&&-1!==s._it.indexOf(D)||s.Wit(a,C,k,D,M,h,i,o,u,!0)),v?_+=l?v.colCount:v.rowCount:_++):(m.ZP(P,I),v?_+=l?v.colCount:v.rowCount:_++));if(s.Dit)for(U=t.row,G=t.col,J=t.rowCount,K=t.colCount,Q=O=void 0,X=!1===e?-1:1,A=1;A<J;A++)for(O=U+X*A,E=0;E<K;)Q=G+E,-1===s._it.indexOf(O)&&s.Wit(a,U,G,O,Q,x,i,o,u,!0),E++;m&&m.jit()&&s.$it(l,t,n,F,b,m,r,e,j,T,o,u,!0)}return tt}},R.prototype.qit=function(t,n,i,r){var e,o,u,n,s,a,n,f,l,t,c,h,v,g,d,p,w,m,y,_,C,D,F,b,R,e=this,o=e.Mf,u=o.tables,n=t.union(n),s=n.row,a=n.rowCount,n=t.row,f=t.col,l=t.rowCount,t=t.colCount;if(u)for(h=0,v=c=u.AB(n,f,l,t);h<v.length;h++){if(d=(g=v[h]).Ky,p=g.iw,w=a,r)for(m=0,y=r;m<y.length;m++)if((_=y[m]).row===d&&_.col===p){w=_.rowCount,e.Jit=g;break}if(C=g.IB,D=e._it,F=void 0,C&&C.isFiltered&&C.isFiltered()){for(b=0;b<w;b++)C.isRowFilteredOut(F=s+i*b)&&e._it.push(F);if(0<D.length){e.Dit=!0;break}}}if(R=o.IB,!0!==e.Dit&&R&&R.isFiltered&&R.isFiltered()){for(D=e._it,F=void 0,b=0;b<a;b++)R.isRowFilteredOut(F=s+i*b)&&e._it.push(F);0<D.length&&(e.Dit=!0)}},R.prototype.Wit=function(t,n,i,r,e,o,u,s,a,f){var l,c,c,u,l=t.Ut;M&&(f?((c=l.yle().getExpression(n,i))&&t.hasFormula(n,i,3,!0)||!nt(t.getValueIgnoreDefault(n,i)))&&(0,h.copyDefaultFormula)(t,t,r,e,c):(t.hasFormula(n,i,3)||t.hasFormula(r,e,3))&&(t.setFormula(r,e,tt),0!==u&&4!==u||(t.getFormula(n,i)||l.getDefaultValue(n,i,tt,h.DefaultChangeValueType.Expression))&&T.CalcOperatorAdjustor.copyFormula(t,n,i,t,r,e,1,1,_,!0))),f||nt(t.getValueIgnoreDefault(n,i))&&!nt(l.getDefaultValue(n,i,tt,h.DefaultChangeValueType.Value))?l.getDefaultValue(n,i,tt,h.DefaultChangeValueType.Expression)||l.setDefaultValue(r,e,o,tt,h.DefaultChangeValueType.Value):t.setValue(r,e,o),f||(c=a?0:64,s&&(c|=4224),t.vT(n,i,r,e,1,1,c=c|1024|256,_,!0),a)||(t.removeSpan(r,e,3),(u=l.findSpan(n,i))&&n===u.row&&i===u.col&&t.EL(r,e,u.rowCount,u.colCount,3))},R.prototype.$it=function(t,n,i,r,e,o,u,s,a,f,l,c,h){var v,g,d,p,w,m,y,_,C,D,F,b,R,j,T,x,k,M,T,I,x,T,v=this,g=v.Mf,y=t?i.col:i.row,_=t?n.col:n.row,C=t?i.colCount:i.rowCount,D=t?n.colCount:n.rowCount;if(a=a||0,F=o.jit(),b=(y-_-a)/D,R=v.Cit(o.rit,o.oit),j=o.uit,R){for(w=[],p=0;p<F;p++)w[p]=p+1;d=F}else m=o.rit[0],d=o.rit[F-1]-m+1,1===F&&j!==et&&o.ZP(o.rit[0]+1,o.Lit(o.oit[0]+1)),w=o.Rit();for(p=0;p<d;p++)if(T=o.ait,M=k=x=void 0,I=y+C-1,T=(x=(M=(x=j!==rt&&j!==et?x:g.tnt&&g.tnt.getRule(j,T))?(k=x.getTargetValue(o,d*b+p+1,w,p,b),R=x.Cit||R,T=x.Sit||!1,R&&!T):(k=Tt(!0,o.Bit(),w,d*b+p+1),R))?o.rit[p]:m+p)+b*D,u){if(R&&(s&&T===I||!s&&T===y)||!R&&T+a===I)return o.Lit(k)}else T<y+C&&y<=T&&(t?f&&g.XT&&g.XT(r)||v.Wit(g,r,x,e,T,o.Lit(k),4,l,c,h):f&&g.XT&&g.XT(T)||v.Wit(g,x,r,T,e,o.Lit(k),4,l,c,h));return tt},R.prototype.Cit=function(t,n){var i,r,e,o,i=x(n);if(i<=1||x(t)!==i)return!1;for(r=t[1]-t[0],e=n[1]-n[0],o=2;o<i;o++)if(t[o]-t[o-1]!=r||n[o]-n[o-1]!=e)return!1;return!0},R.prototype.Xtt=function(t,n){var i=this,r=this.Mf,e=r.Ut.getSpans(),t=r.JS(t),o=t.row,u=t.col,s=t.rowCount,t=t.colCount,a,a=0===n?D(o,u+t-1,s,1):1===n?D(o,u,s,1):D(2===n?o+s-1:o,u,1,t);(a=r.nR(e,a))&&i.trt(a,o,u,s,t,n)},R.prototype.trt=function(t,n,i,r,e,o){var u=this,s=t.row,a=t.col,f=t.rowCount,l=t.colCount,c,h,v,g,d,p,w,m=u.Mf.Ut,y,d=0===o?(y=m.eE(n,i,r,e-l),p=0,w=-1*l,v=e,g=l,1):1===o?(y=m.eE(n,i+l,r,e-l),p=0,v=e,g=w=l,1):w=(g=2===o?(y=m.eE(n,i,r-f,e),p=-1*f,v=r,f):(y=m.eE(n+f,i,r-f,e),v=r,p=f),0);if(y)throw new Error(k().Exp_TargetContainsMergedCells);if(v%g!=0)throw new Error(k().Exp_MergedCellsIdentical);for(c=C(v/g),h=1;h<c;h++)u.Xit(t,D(s+h*p,a+h*w,f,l),d,0,_,_,_,_,!0)},R.prototype.Qit=function(t,n,i,r,e,o){var u,t,s,a,u=t?-1:1,t=C(o*e),s=Math.abs(e),a=A(1<n?i:r);if(0===n)a.setDate(a.getDate()+u*e);else if(1===n)for(;0<s;)a.setDate(a.getDate()+u*(0<e?1:-1)),6!==a.getDay()&&0!==a.getDay()&&s--;else 2===n?a.setMonth(a.getMonth()+u*t):a.setFullYear(a.getFullYear()+u*t);return O(a)},t.Wtt=R},"./dist/plugins/fill/fill.ns.js":function(t,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SR=void 0;var i=i("./dist/plugins/fill/fill.res.en.js");n.SR={en:i}},"./dist/plugins/fill/fill.res.en.js":function(t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Exp_ChangePartOfArray=n.Exp_RangeIsNull=n.Exp_CellReadOnly=n.Exp_RowReadOnly=n.Exp_ColumnReadOnly=n.Exp_ChangeMergedCell=n.Exp_FillCellsReadOnly=n.Exp_FillRangeContainsMergedCell=n.Exp_MergedCellsIdentical=n.Exp_TargetContainsMergedCells=n.Exp_RangeContainsMergedCell=n.Exp_NumberOnly=n.FillWithoutFormatting=n.FillFormattingOnly=n.FillSeries=n.CopyCells=void 0,n.CopyCells="Copy Cells",n.FillSeries="Fill Series",n.FillFormattingOnly="Fill Formatting Only",n.FillWithoutFormatting="Fill Without Formatting",n.Exp_NumberOnly="Only works for Numbers",n.Exp_RangeContainsMergedCell="Range should not have merged cells.",n.Exp_TargetContainsMergedCells="Target range should not have merged cells.",n.Exp_MergedCellsIdentical="This operation requires the merged cells to be identically sized.",n.Exp_FillRangeContainsMergedCell="Cannot fill range that contains a merged cell.",n.Exp_FillCellsReadOnly="The cells you are trying to fill are protected and therefore read-only.",n.Exp_ChangeMergedCell="Cannot change part of merged cell.",n.Exp_ColumnReadOnly="The column you are trying to change is protected and therefore read-only.",n.Exp_RowReadOnly="The row you are trying to change is protected and therefore read-only.",n.Exp_CellReadOnly="The cell you are trying to change is protected and therefore read-only.",n.Exp_RangeIsNull="range is null",n.Exp_ChangePartOfArray="Cannot change part of an array."},Common:function(t){t.exports=n.Spread},CalcEngine:function(t){t.exports=n.Spread.CalcEngine},Core:function(t){t.exports=n.Spread.Sheets},SheetsCalc:function(t){t.exports=n.Spread.Sheets.CalcEngine}},r={},t=e("./dist/plugins/fill/fill.entry.js"),(((n=void 0===n?{}:n).Spread=n.Spread||{}).Sheets=n.Spread.Sheets||{}).Fill=t}()});
|
|
12
|
+
!function(t){var n;"object"==typeof module&&"object"==typeof module.exports?(n=require("@grapecity-software/spread-common"),require("@grapecity-software/spread-calc-engine"),require("@grapecity-software/spread-sheets-core"),require("@grapecity-software/spread-sheets-calc-engine"),module.exports=t(n)):"function"==typeof define&&define.amd?define(["@grapecity-software/spread-common","@grapecity-software/spread-calc-engine","@grapecity-software/spread-sheets-core","@grapecity-software/spread-sheets-calc-engine"],t):"object"==typeof exports?(n=require("@grapecity-software/spread-common"),require("@grapecity-software/spread-calc-engine"),require("@grapecity-software/spread-sheets-core"),require("@grapecity-software/spread-sheets-calc-engine"),exports.Spread=t(n)):t(GC)}(function(n){!function(){"use strict";var i,r,t;function e(t){var n,n,n=r[t];return void 0!==n||(n=r[t]={exports:{}},i[t].call(n.exports,n,n.exports,e)),n.exports}i={"./dist/plugins/fill/drag-fill.js":function(_,t,n){var i,c,x,h,t,n,s,k,M,R,v,n,j,T,r,l,b,u,I,S,O,A,g,e,o,a,t,d,C,f,D,F,p,B,W,$;function E(t){return t.rowCount}function N(t){return t.colCount}function V(t,n){return t.getRowCount(n)}function q(t,n){return t.getColumnCount(n)}function H(t,n,i,r){return t&&n&&n.containsRange(t)&&(!k(i)&&(1===i&&t.row===n.row&&E(t)===E(n)||0===i&&t.col===n.col&&N(t)===N(n))||!(k(r)||(2!==r&&3!==r||t.col!==n.col||N(t)!==N(n))&&(0!==r&&1!==r||t.row!==n.row||E(t)!==E(n))))}function w(t,n){var i,r,e,o,u,s,a,f,l,c,a,i=B.call(this)||this,r=i,e=n[A],o=0===e,u=o||1===e,s=n[S],a=n[I],f=a.row,l=a.col,c=E(a),a=N(a);return r.Mf=t,4===(r.Ftt=n)[O]?r.Ptt=new x.Commands.JI(t,{ranges:[n[S]]}):r.Gtt=u?v(f,o?s.col:l,c,a+N(s)):v(2===e?s.row:f,l,c+E(s),a),r.Utt=u?1:0,i}function m(t,n){var i,r,i=W.call(this)||this,r=i;return r.Mf=t,r.Htt=n,r.ztt=n[I],r.Vtt=n[S],r.Ytt=n[O],r.Ztt=n[A],i}function L(t,n,i,r,e,o){var u,r,e,n,u=t.getSelections();t.IA(),t.n4(n,i,r,e,!0),r=t.getSelections(),e=0<n?n:t.N9(),n=0<i?i:t.k9(),t.O6(e,n,t.R9,t.B9),t.jA(u),t.parent&&o.Z3&&t.parent.changeSelectionInCommandExecuting(o,null,null,r)}function z(t){var n,i,n,i=t.parent.getActiveSheet();i&&t!==i&&i.repaint()}function y(t,n){return $.call(this,t,n)||this}i=this&&this.__extends||(p=function(t,n){return(p=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}p(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),Object.defineProperty(t,"__esModule",{value:!0}),c=n("Common"),x=n("Core"),h=n("./dist/plugins/fill/fill.js"),t=n("./dist/plugins/fill/fill.ns.js"),n=n("CalcEngine"),s=!!n,k=c.Common.lt.ht,M=null,R=void 0,v=x.Ec,n=x.GC$,j=Math.max,T=Math.floor,r=x.Commands.ActionBase,l=x.Commands.CI,b=x.Commands.SI,u=x.CopyToOptions.all,I="startRange",S="fillRange",O="autoFillType",A="fillDirection",g="cancel",e="fill",o="dragDrop",a=n.isEmptyObject,t=new c.Common.ResourceManager(t.SR,"Fill"),d=t.getResource.bind(t),n.extend(x.Worksheet.prototype,C={fillAuto:function(t,n,i){if(!n)throw new Error(d().Exp_RangeIsNull);var r=this,e=i.fillType,o=i.series,u=i.direction,s=i.step,a=i.stop,f=new h.Wtt(r),l=i.Qtt;if(H(t,n,u?M:o,u)){r.suspendPaint(),t&&(r.rt.Ktt=t);try{4===e?f.Jtt(n,o,!1,i.withTag,i.withoutStyle,l):0===e?f.Xtt(n,u):1===e||2===e?f.qtt(1===e,n,o,s,a):3===e&&f.$tt(n,o,3,s,k(a)?M:c.Common.ct.o0(a),i.unit)}finally{r.resumePaint()}}}}),x.Worksheet.ch(e,{init:function(){this.tnt=new h.nnt(this)},setHost:function(t){var t;t&&((t=this.Qy())[e]||t.register(e,x.Commands[e]),t[o]||t.register(o,x.Commands[o]))},dispose:function(t){var t;!1!==t.clearCache&&(t=this).tnt&&(t.tnt.L0(),t.tnt=M)}}),x.Workbook.ch(e,{onCultureChanged:function(){d()}}),i(w,B=r),w.prototype.canExecute=function(){var t=this,n=t.Mf,t=t.Ftt,i=t[I],r=t[S];return!(!n.PT(r.row,r.col,E(r),N(r),{isIgnoreFilterOutRow:!0,sheetArea:x.SheetArea.viewport})||4!==t[O]&&r.intersect(i.row,i.col,E(i),N(i)))},w.prototype.execute=function(){var t,n,i,r,e,o,o,t=this;if(t.canExecute()){i=(n=t.Ftt)[S],e=(r=t.Mf).parent.i4(),x.Commands.II(e),t.X5(r,!0);try{s&&r.suspendCalcService(),o=r.getSelections(),r.isDirtySuspended()||(t.ent=new l(r,n[S],u)),4===n[O]?t.int(r):t.rnt(r),r.EA(o,r.getSelections())&&r.jA(o)}finally{t.q5(r,!0),s&&r.resumeCalcService(!1),x.Commands.xI(e,n),r.Q1i&&r.Q1i(i.row,i.col,E(i),N(i)),o=[],r.isDirtySuspended()||(t.ont=new l(r,i,u),t.ont.yI(t.ent.bI()),o=t.ont.MI()),b(r,i.row,i.col,E(i),N(i),o,1)}}},w.prototype.int=function(t){var n,i,r,i,n,e,o,e,o,n,n=this;n.Ptt.execute(t),r=(i=n.Ftt)[I],i=i[S],n=0===n.Utt,o=E(r),e=N(r),o=n?j(1,o-E(i)):o,n=n?e:j(1,e-N(i)),r.equals(i)||(e=v(r.row,r.col,o,n),t.O6(j(t.N9(),e.row),j(t.k9(),e.col),t.R9,t.B9),t.IA(),t.n4(e.row,e.col,E(e),N(e)))},w.prototype.rnt=function(t){var n,i,r,e,o,u,s,a,f,l,c,h,v,g,d,p,w,m,y,_,C,D,r,F,b,n=this,i=n.Mf,r=n.Ftt,e=r[I],o=r[S],u=r[O],s=n.Gtt,l={fillType:4,series:n.Utt,withTag:!0,withoutStyle:!(i.lF&x.CopyToOptions.style)},c=i.tables,h=!1,v=new x.Range(s.row,s.col,s.rowCount,s.colCount);if(c)try{p=0===(g=r[A]),(d=2===g)&&(w=e.rowCount,m=0===c.AB(e.row,e.col,w,e.colCount).length)&&(h=!0,v.rowCount-=w),p&&(y=e.colCount,m=0===c.AB(e.row,e.col,e.rowCount,y).length)&&(h=!0,v.colCount-=y),_=[],C=[],c.yx(M,v,R,R,R,_,{applyDragFillAfterTableExpand:h,backupTableResizedArgs:C}),0<_.length&&(l.Qtt=_),n.lCe=C}catch(t){return i.jT(6,t.message),void i.resumePaint()}if(1===u){if(i.fillAuto(e,s,l),i.lF&x.CopyToOptions.style&&i.Ut.eE(e.row,e.col,e.rowCount,e.colCount))for(a=0;a<o.rowCount;a++)for(f=0;f<o.colCount;f++)(D=i.vI(e.row+T(a%e.rowCount),e.col+T(f%e.colCount)))&&D.clone&&(D=D.clone()),i.CL(o.row+a,o.col+f,D)}else 0===u?(r=i.lF&~x.CopyToOptions.comment,n.ant(e,o,r)):2===u?n.ant(e,o,4320):3===u&&((F=!(1!==E(e)||1!==N(e)||-1===e.row&&-1!==e.col||-1===e.col&&-1!==e.row))?n.ant(e,o,b=4251):(l.withoutStyle=!0,i.fillAuto(e,s,l)));i.O6(j(t.N9(),s.row),j(t.k9(),s.col),t.R9,t.B9),t.IA&&t.IA(),i.n4(s.row,s.col,E(s),N(s))},w.prototype.ant=function(t,n,i){var r=this,e=r.Mf,t=e.JS(t),n=e.JS(n),o=t.row,u=t.col,s=E(t),a=N(t),f=n.row,l=n.col,c=E(n),h=N(n),t=r.Ftt[A],v=3===t,g=1===t,d=T(c/s),n=c%s,p=T(h/a),t=h%a,w,m,y,_,C;if(e.HB=!0,0===r.Utt){for(w=0;w<d;w++)e.vT(o,u,_=v?f+w*s:f+c-(w+1)*s,l,s,a,i,!0,!0);0!=n&&e.vT(m=v?o:o+(d+1)*s-c,u,_=v?f+s*d:f+c-d*s-n,l,n,a,i,!0,!0)}else{for(w=0;w<p;w++)e.vT(o,u,f,C=g?l+w*a:l+h-(w+1)*a,s,a,i,!0,!0);0!=t&&e.vT(o,y=g?u:u+(p+1)*a-h,f,C=g?l+a*p:l+h-p*a-t,s,t,i,!0,!0)}delete e.HB,e.recalcRange(f,l,c,h)},w.prototype.undo=function(){var t,n,i,r,e,o,u,t=this,n=t.Mf,i=!1;if(t.canUndo()){t.X5(n,!0);try{s&&n.suspendCalcService(),r=n.getSelections(),e=t.Ftt,o=n.R_,u=e[S],i=4===e[O]?t.unt(n):t.snt(n),!n.cnt&&o&&o.close(),b(n,u.row,u.col,E(u),N(u),t.ont?t.ont.MI():[],1,R,!0),n.EA(r,n.getSelections())&&n.jA(r)}finally{t.q5(n,!0),s&&n.resumeCalcService(!1)}}return i},w.prototype.unt=function(t){var n,i,r,i,e,n=this,i=n.Ftt[I],r=i.row,i=i.col,e=x.Commands.TI(t.name());return t.Ut.undo(n.Ftt[e]),t.O6(j(t.N9(),r),j(t.k9(),i),t.R9,t.B9),!0},w.prototype.snt=function(t){var n,i,r,e,r,o,n,i=this.Ftt,r=i[I],e=r.row,r=r.col;s&&t.suspendCalcService();try{o=x.Commands.TI(t.name()),t.Ut.undo(i[o]),t.O6(j(t.N9(),e),j(t.k9(),r),t.R9,t.B9)}finally{s&&t.resumeCalcService(!1)}return t.invalidateLayout(),!0},f=w,i(m,W=r),m.prototype.execute=function(){var t,n,i,r,e,o,u,s,a,f,l,t=this,n=!1;if(t.canExecute()){r=(i=t.Mf).parent,e=t.Vtt,o=t.Htt,u=i.parent.i4(),x.Commands.II(u),t.XI(),t.X5(i,!0),i.QI=!0;try{s=i.getSelections(),a=void 0,f=i.rt,(l={sheet:i,sheetName:i.name(),cancel:!1})[S]=e,l[O]=t.Ytt,l[A]=t.Ztt,i.ki(x.Events.DragFillBlock,l),f.fnt=l[O],f.lnt=l[g],l[g]||(t.hnt(l),i.ki(x.Events.DragFillBlockCompleted,l)),n=!0,a=i.getSelections(),i.EA(s,a)&&i.jA(s),r&&o.Z3&&r.changeSelectionInCommandExecuting(o,null,null,a)}finally{t.q5(i,!0),i.QI=!1,t.dnt(i,e),x.Commands.xI(u,t.Htt)}}return n},m.prototype.hnt=function(t){var n,i,r,e,o,r,e,n=this,i=n.Mf,r=i.rt,e=n.Vtt,o=n.Ytt;r.fnt=o,r.lnt||((r={})[I]=n.ztt,r[S]=e,r[O]=5===t[O]?o:t[O],r[A]=n.Ztt,e=new f(i,r),i.suspendEvent(),e.execute(),i.resumeEvent(),n.Htt.vnt=e)},m.prototype.XI=function(){var t=this;t.Mf.isDirtySuspended()||(t.ent=new l(t.Mf,t.Vtt,u))},m.prototype.undo=function(){var t,n,i,r,e,o,u,s,a,n=this;if(n.canUndo()){i=n.Mf,r=n.Vtt,e=i.parent,o=n.Htt,n.XI(),n.X5(i,!0);try{u=i.getSelections(),i.suspendEvent(),i.Nj=!0,s=(0,x.hCe)(i),x.Commands.NI(s,o),i.Nj=!1,i.resumeEvent(),a=o[I],i.EA(u,[a])&&i.jA(u),e&&o.Z3&&e.changeSelectionInCommandExecuting(o,null,null,[a]),(0,x.handleRestoredTableResizedArgs)(null==(t=o.vnt)?void 0:t.lCe)}finally{n.q5(i,!0),n.dnt(i,r,!0)}}return!0},m.prototype.dnt=function(t,n,i){var r,e,o,r=this,e=[];t.isDirtySuspended()||((o=new l(t,n,u)).yI(r.ent.bI()),e=o.MI()),b(t,n.row,n.col,E(n),N(n),e,1,R,i)},D=m,i(y,$=r),y.prototype.canExecute=function(){var t,n,i,r,e,o,u,s,a,f,l,c,h,f,v,g,d,p,f,t=this,n=t.Mf,i=t.tT,r=i.fromRow,e=i.fromColumn,o=E(i),u=i.columnCount,s=i.toRow,a=i.toColumn,f=!i.copy,l,c;if(n.tables&&n.tables.mx(n,{row:r,col:e,rowCount:o,colCount:u},n,{row:s,col:a,rowCount:o,colCount:u},f))return!1;if(!n.zT(r,e,o,u,V(n),q(n)))return!1;if(!i.insert&&!n.zT(s,a,o,u,V(n),q(n)))return!1;if(i.cmd===x.RangeChangedAction[0]&&n.tables&&(h=!1,0<(f=n.tables.AB(r,e,o,u)).length)){for(g=(v=f[0].range()).row;g<v.row+v.rowCount;g++)if(n.isRowFilterOut(g)){h=!0;break}return!(h&&v.contains(i.mouseTargetRow,i.mouseTargetCol,1,1))}return f=t.mnt(d=0<=s&&a<0&&0<=r&&e<0&&0<o&&u<0,p=s<0&&0<=a&&r<0&&0<=e&&o<0&&0<u),n.PT(s,a,o,u,{isAllowDragInsert:f,sheetArea:x.SheetArea.viewport})&&n.PT(r,e,o,u,{isAllowDragInsert:f,sheetArea:x.SheetArea.viewport})},y.prototype.mnt=function(t,n){var i,r,i,r,e,i,e,i,i=this,r=i.tT,i=i.Mf,r=r.insert,e=i.isActualProtected(),i=i.options.protectionOptions;return!(!e||a(i)||(e=i.allowDragInsertRows,i=i.allowDragInsertColumns,!r)||!(e&&t||i&&n))},y.prototype.execute=function(){var t,n,i,r,e,o,u,s,a,f,l,c,h,v,g,d,p,w,m,y,_,C,D,F,b,R,j,T,t=this,n=!1;if(t.canExecute()){i=t.Mf,r=t.tT,t.XI(),s=r.fromRow,a=r.fromColumn,f=r.toRow,l=r.toColumn,c=E(r),h=r.columnCount,v=r.option,g=c,d=h,p=(u=o=e=void 0,x.hCe)(i),(w=i.o5())&&(g+=i.lT(f,c,!0),d+=i.lT(l,h)),x.Commands.II(p),t.X5(i,!0),i.QI=!0,m=void 0;try{try{y=[],m={shiftCells:r.insert&&r.shiftCells===x.InsertShiftCell.down,isCopy:r.copy,isFirst:!0},i.tables&&i.tables.yx(i,new x.Range(f,l,g,d),new x.Range(s,a,c,h),M,M,M,{shiftInfo:m,backupTableResizedArgs:y}),r.Kh.lCe=y}catch(t){return i.jT(6,t.message),void i.resumePaint()}r.insert?0<=a&&s<0?(e=a,u=h,_=o=l,i.addColumns(o,u),r.copy?i.copyTo(-1,o<=e?e+u:e,-1,o,-1,u,v):(i.moveTo(-1,o<=e?e+u:e,-1,o,-1,u,v),i.deleteColumns(o<=e?e+u:e,u),e<o&&(_=o-u)),L(i,-1,_,V(i),u,r)):0<=s&&a<0?(e=s,u=c,C=o=f,i.addRows(o,u),r.copy?i.copyTo(o<=e?e+u:e,-1,o,-1,u,-1,v):(i.moveTo(o<=e?e+u:e,-1,o,-1,u,-1,v),i.deleteRows(o<=e?e+u:e,u),e<o&&(C=o-u)),L(i,C,-1,u,q(i),r)):0<=s&&0<=a&&(D=r.shiftCells,F=new x.Range(f,l,1,1),b=[new x.Range(s,a,c,h)],k(D)||(R={cmd:"clipboardPaste",sheetName:i.name(),clipboardHtml:"",clipboardImage:"",clipboardText:"",fromRanges:b,fromSheet:i,isCutting:!r.copy,pasteOption:0,pastedRanges:[new x.Range(f,l,c,h)],cA:F,fA:b,sA:D,bx:!0,px:m&&m.ignoreFooterShiftIndex},i.Qy().execute(R),j=i.getSelections()[0],D===x.InsertShiftCell.down&&s<f&&!r.copy&&a===l?i.setSelection(j.row-c,j.col,j.rowCount,j.colCount):D===x.InsertShiftCell.right&&a<l&&!r.copy&&s===f&&i.setSelection(j.row,j.col-h,j.rowCount,j.colCount))):(r.copy?i.copyTo(s,a,f,l,c,h,v):i.moveTo(s,a,f,l,c,h,v),i&&(L(i,f,l,g,d,r),T=r.Kh,r.copy||i.isDirtySuspended()||(T.wx=t.gnt(i,T.qI,s,a,c,h)),i.isDirtySuspended()||(T.Mx=t.gnt(i,T.$I,f,l,c,h)))),n=!0}finally{i.rt.q6={},t.q5(i,!0),i.QI=!1,x.Commands.xI(p,r)}z(i)}return n},y.prototype.gnt=function(t,n,i,r,e,o){var u,s,u=new l(t,v(i,r,e,o),this.tT.option),s=t.tables&&t.tables.WI&&t.tables.WI(i,r,e,o);return s&&0<s.length&&(this.tT.tableNamesObj={r:i,c:r,rc:e,cc:o,tableNames:s}),u.yI(n.bI()),b(t,i,r,e,o,u.MI(),0,s),u},y.prototype.XI=function(){var t,n,t,i,r,e,o,u,s,a,f,o,u,r,e,t=this,n=t.Mf,t=t.tT,i=t.Kh;i=i||(t.Kh={}),r=t.fromRow,e=t.fromColumn,o=t.toRow,u=t.toColumn,s=t.option,a=r<0?0:r,f=e<0?0:e,o=o<0?0:o,u=u<0?0:u,r=r<0?V(n):E(t),e=e<0?q(n):t.columnCount,t.insert||n.isDirtySuspended()||(t.copy||(i.qI=new l(n,v(a,f,r,e),s)),i.$I=new l(n,v(o,u,r,e),s)),i.pnt=n.R9,i.bnt=n.B9,i.ynt=n.ui,i.wnt=n.ci},y.prototype.undo=function(){var t,n,i,r,e,o,u,s,a,f,l,c,h,v,g,d,p,w,m,y,_,C,D,F,t=this;if(t.canUndo()){if(n=t.Mf,r=(i=t.tT).fromRow,e=i.fromColumn,o=i.toRow,u=i.toColumn,s=E(i),a=i.columnCount,!n.zT(r,e,s,a,V(n),q(n)))return!1;if(!i.insert&&!n.zT(o,u,s,a,V(n),q(n)))return!1;l=i.Kh,t.X5(n,!(f=void 0)),c=(0,x.hCe)(n),x.Commands.NI(c,i);try{i.insert?0<=e&&0<=r||(0<=e?(f=a,n&&L(n,-1,e,V(n),f,i)):0<=r&&(f=s,n)&&L(n,r,-1,f,q(n),i)):(g=r<0?0:r,d=e<0?0:e,p=o<0?0:o,w=u<0?0:u,m=r<0?V(n):s,y=e<0?q(n):a,n&&(L(n,r,e,s,a,i),_=i.tableNamesObj,C=[],D=[],_&&(_.r===p&&_.c===w&&_.rc===m&&_.cc===y?D=_.tableNames:C=_.tableNames),b(n,p,w,m,y,l.Mx?l.Mx.MI():[],0,C,!0),b(n,g,d,m,y,l.wx?l.wx.MI():[],0,D,!0))),n&&(-1!==l.ynt&&-1!==l.wnt&&((F=n.getSelections()[0]).contains(l.ynt,l.wnt)?n.XA(l.ynt,l.wnt):n.XA(F.row,F.col)),-2!==l.pnt&&-2!==l.bnt&&-1!==l.ynt&&-1!==l.wnt&&n.showCell(l.ynt,l.wnt,3,3),(0,x.handleRestoredTableResizedArgs)(l.lCe))}finally{t.q5(n,!0)}z(n)}return!0},F=y,x.Commands[e]={canUndo:!0,execute:function(t,n,i){return x.Commands.zA(t,D,n,i)}},x.Commands[o]={canUndo:!0,execute:function(t,n,i){return x.Commands.zA(t,F,n,i)}}},"./dist/plugins/fill/fill-event.js":function(e,t,n){var p,D,d,r,w,t,m,y,v,_,f,C,F,b,g,R,i,o,l,c,h,j,n,T;function x(t){return t.rowViewportIndex}function k(t){return t.colViewportIndex}function u(t){return t.frozenRowCount()}function a(t){return t.frozenColumnCount()}function s(t){return t.hitTestType}function M(t,n){return t.getRowCount(n)}function I(t,n){return t.getColumnCount(n)}function S(t){return t.colCount}function O(t){return t.rowCount}function A(t){return t.height}function E(t){return t.width}function N(t){var n,t,n=7,t=t.parent;return n=t?2007<t.SC?2:7:n}function V(t,n,i,r,e,o,u){var s,a,f;t.save(),o=o||h,u=u||2,n===r?(t.rect(n-2,i,7,g(e-i)),t.clip(),t.beginPath(),i<e?(i-=3,e+=3):(i+=3,e-=3),s=(0,D.Zx)(n-1,i-1,r-1,e+1,o,u),a=(0,D.Zx)(n,i,r,e,o,u),f=(0,D.Zx)(n+1,i-1,r+1,e+1,o,u)):i===e&&(t.rect(n,i-2,g(r-n),7),t.clip(),t.beginPath(),n<r?(n-=3,r+=3):(n+=3,r-=3),s=(0,D.Zx)(n-1,i-1,r+1,e-1,o,u),a=(0,D.Zx)(n,i,r,e,o,u),f=(0,D.Zx)(n-1,i+1,r+1,e+1,o,u)),s&&s.qx(t),a&&a.qx(t),f&&f.qx(t),t.strokeStyle=o,t.stroke(),t.beginPath(),t.restore()}function q(t,n,i,r,e,o,u,s,a,f,l){var c=n?D.Events.DragDropBlock:D.Events.DragDropBlockCompleted,i={sheet:t,sheetName:t.name(),fromRow:i,fromCol:r,toRow:e,toCol:o,rowCount:u,colCount:s,copy:a,insert:f,copyOption:l};return n&&(i.cancel=!1),t.ki(c,i),i}function L(t,n,i,r,e){for(var o,u,s,o=0;o<i.rowCount;o++){for(u=0;u<i.colCount;u++){if(!(s=t.getSpan(i.row+o,i.col+u))||s.rowCount!==n.rowCount||s.colCount!==n.colCount)return!1;r&&(u+=n.colCount)}e&&(o+=n.rowCount)}return!0}function B(t,n,i){var r,e,o,u,s,a,f,l,e,u,r,r=n.row,e=n.rowCount,o=n.col,u=n.colCount,s=i.row,a=i.rowCount,f=i.col,l=i.colCount,e=r===s&&e===a,u=o===f&&u===l;return(e||u)&&(r=t.getSpan(r,o))&&L(t,r,n,e,u)&&!t.Ut.GT(s,f,a,l)&&L(t,r,i,e,u)}Object.defineProperty(t,"__esModule",{value:!0}),p=n("Common"),D=n("Core"),d=n("SheetsCalc"),r=n("./dist/plugins/fill/fill-ui.js"),w=n("./dist/plugins/fill/fill.js"),t=n("./dist/plugins/fill/fill.ns.js"),m=n("CalcEngine"),y=!!m,v=D.GC$,_=D.Ec,f=p.Common.lt.ht,C=null,F=void 0,b=Math.min,g=Math.abs,R=Math.max,i=5,o=3,l="drag",c="corner",h="black",j=p.Common.zf,n=new p.Common.ResourceManager(t.SR,"Fill"),T=n.getResource.bind(n),v.extend(D.nk.prototype,{bk:function(t){var n,i,r,e,e,o,u,u,o,e,u,i,n=this;n.zk||(i=n.Mf,r=C,1===(e=i.Ut.getSelections()).length?r=e[0]:e.length<1&&(r=i.Ut.getSpan(i.ui,i.ci)),r&&(n.zk=!0,n.rb=!0,n.Mnt=r,(e=i.tables&&i.tables.find(r.row,r.col))&&(o=n.Cnt=!0,u=e.range(),o=!(e.showHeader()&&r.row===u.row||e.showFooter()&&r.row===u.row+u.rowCount-1||r.col!==u.col||r.colCount!==u.colCount)&&o)&&(n.Snt=!0,n.e_=!0,n.Tnt=e.name()),u=i.getRangeRect(x(t),k(t),r),(o=n.q6).x=u.x,o.y=u.y,o.width=u.width-1,o.height=u.height-1,o.row=r.row,o.col=r.col,o.rowCount=O(r),o.colCount=S(r),e=i.JS(r),u=t.row,i=t.col,(u=u<e.row?e.row:u)>=e.row+O(e)&&(u=e.row+O(e)-1),(i=i<e.col?e.col:i)>=e.col+S(e)&&(i=e.col+S(e)-1),o.hitRow=u,o.hitCol=i,o.rowOffset=u-e.row,o.colOffset=i-e.col,n.Rk={e9:x(t),r9:k(t),Bk:s(t)},n.Ok()))},Vk:function(){var t,n,i,r,e,o,u,r,i,s,a,t=this;t.Rk&&t.rb&&t.zk&&t.Mnt&&(n=t.fk,i=t.q6,e=(r=t.Mf.getCellRect(i.hitRow,i.hitCol)).width/2,o=r.x+e,u=r.height/2,r=r.y+u,i.hitTarget={x:n.x,y:n.y},i=t.Q9(),s=t.K9(),a=!1,(g(o-n.x)>5+e||g(r-n.y)>5+u)&&(a=!0),0<=i&&0<=s&&a&&t.Ant(i,s),t.a9())},Ant:function(t,n){var i,r,e,o,u,s,a,f,l,c,h,c,u,l,f,c,u,t,n,o,i=this;i.zk&&i.Mnt&&(r=i.Mf,e=i.q6,o=r.o5(),u=r.U5(),s=M(r),a=I(r),f=b(a-S(e),n-e.colOffset),l=b(s-O(e),t-e.rowOffset),o&&(c=r.ox(n,e.colOffset+1),l-=h=r.ox(t,e.rowOffset+1,!0),0===r.getColumnWidth(f-=c)&&(f=r.r6(f)),0===r.getRowHeight(l))&&(l=r.nI(l)),-1===u.row&&-1!==u.col?(e.row=-1,e.col=R(0,f)):-1!==u.row&&-1===u.col?(e.row=R(0,l),e.col=-1):(e.row=e.row<0?-1:R(0,l),e.col=e.col<0?-1:R(0,f)),i.Snt&&(u=(c=r.tables&&r.tables.find(t,n))&&c.range(),!c||c.name()!==i.Tnt||t===u.row||c.showFooter()&&t===u.row+u.rowCount?i.e_=!1:i.e_=!0,i.e_?(e.col=u.col,i.i_=!i.isPressShiftKey):i.i_=i.isPressShiftKey),e.hitRow=t,e.hitCol=n,l=r.JS(e),o&&(f=r.lT(l.row,l.rowCount,!0),c=r.lT(l.col,l.colCount),l.rowCount+=f,l.colCount+=c,l.rowCount=b(s,l.rowCount),l.colCount=b(a,l.colCount),l.row+l.rowCount>s||l.col+l.colCount>a)||(u=i.Int)&&l.row===u.row&&l.col===u.col&&O(l)===O(u)&&S(l)===S(u)&&l.row>r.N9()&&l.col>r.k9()&&l.row+O(l)-1<r.P6()&&l.col+S(l)-1<r.G6()||(i.xnt=l,r.Dn.o_(),i.Int=l,(t=r.parent)&&t.options.showDragDropTip&&(n=e.x+e.width+5,o=e.y+e.height+5,t.Tw(j.j0(i.Nnt(l)),n,o))))},Nnt:function(t){var n,i,r,e,o,u,s,a,f,l,c,h,v,g;return t&&y?(r=O(i=(n=this.Mf).U5()),e=S(i),o=n.getActiveRowIndex(),u=n.getActiveColumnIndex(),s=void 0,a=n.o5(),o=o<0?0:o,u=u<0?0:u,s=1===r&&1===e?m.knt(C,C,t.row-o,t.col-u,!0,!0):(h=c=l=f=void 0,g=v=0,-1===i.row&&0<=i.col?(f=c=d.BAND_INDEX_CONST,l=t.col-u,h=t.col-u+e-1,g=e):-1===i.col&&0<=i.row?(l=h=d.BAND_INDEX_CONST,f=t.row-o,c=t.row-o+r-1,v=r):0<=i.row&&0<=i.col&&(f=t.row-o,c=t.row-o+r-1,l=t.col-u,h=t.col-u+e-1,v=r,g=e),a&&(c+=n.lT(t.row,v,!0),h+=n.lT(t.col,g)),m.lJ(C,C,f,l,c,h,!0,!0,!0,!0,o,u)),n.op().unparse(n.Uw(),s,o,u)):F},kD:function(t){var n,i,r,e,o,u,u,s,a,f,l,c,h,v,u,g,d,p,w,w,m,w,m,m,n=this,i=!1,r="",e=!1,o=n.Mf;n.Rk=C,n.l9(),u=o.U5(),s=n.q6.row,a=n.q6.col,f=n.q6.hitRow,l=n.q6.hitCol,n.i_&&u.contains(f,l)||(u=u&&(0<O(u)||0<S(u))?{r:u.row,c:u.col,rc:O(u),cc:S(u)}:{r:o.ui,c:o.ci,rc:1,cc:1},!0===n.zk&&!0===n.rb&&(c=u.r,h=u.c,v=u.rc,u=u.cc,g=o.options.protectionOptions,d=o.lF,p=void 0,n.shiftCells=null,n.i_&&(n.shiftCells=n.Dnt?D.InsertShiftCell.right:D.InsertShiftCell.down),w={fromRow:c,fromColumn:h,rowCount:v,columnCount:u,toRow:s,toColumn:a,isDragInsert:n.i_,isDragCopy:n.t_},o.ki(D.Events.BeforeDragDrop,w),(r=w.invalidMessage)&&0!==r.length||(!n.i_||-1!==c&&-1!==h?s===c&&a===h||(w=o.GT(c,h,v,u),m=o.GT(s,a,v,u),!w&&!m||(m=!1,m=!(w||n.shiftCells!==D.InsertShiftCell.right&&n.shiftCells!==D.InsertShiftCell.down)||m)||(i=!0,r=T().Exp_ChangeMergedCell),i||y&&(o.KT(c,h,v,u)||o.KT(s,a,v,u))&&(i=!0,r=T().Exp_ChangePartOfArray),!i&&o.isActualProtected()&&(!n.t_&&o.dA(_(c,h,v,u),!0,D.SheetArea.viewport)||o.dA(_(s,a,v,u),!0,D.SheetArea.viewport))&&(i=!0,r=o.FT()),i)||(n.i_&&(n.Dnt?a=n.q6.hitCol:s=n.q6.hitRow),(p=q(o,!0,c,h,s,a,v,u,n.t_,!1,d)).cancel)||(e=o.Qy().execute({cmd:"dragDrop",sheetName:o.name(),fromRow:c,fromColumn:h,toRow:s,toColumn:a,rowCount:v,columnCount:u,copy:n.t_,insert:n.i_,shiftCells:n.shiftCells,option:p.copyOption,mouseTargetRow:f,mouseTargetCol:l}),q(o,!1,c,h,s,a,v,u,n.t_,!1,p.copyOption)):0<=h?(n.t_&&(a<=h||h+u<=a)||!n.t_&&(a<h||h+u<a))&&((o.GT(-1,h,-1,u)||o.GT(-1,a,-1,0))&&(i=!0,r=T().Exp_ChangeMergedCell),w=g&&g.allowDragInsertColumns,!i&&o.isActualProtected()&&!0!==w&&(i=!0,r=T().Exp_ColumnReadOnly),i||(p=q(o,!0,-1,h,-1,a,-1,u,n.t_,!0,d)).cancel||(e=o.Qy().execute({cmd:"dragDrop",sheetName:o.name(),fromRow:-1,fromColumn:h,toRow:-1,toColumn:a,rowCount:-1,columnCount:u,copy:n.t_,insert:!0,option:p.copyOption,mouseTargetRow:f,mouseTargetCol:l}),q(o,!1,-1,h,-1,a,-1,u,n.t_,!0,p.copyOption))):0<=c&&h<0&&(n.t_&&(s<=c||c+v<=s)||!n.t_&&(s<c||c+v<s))&&((o.GT(c,-1,v,-1)||o.GT(s,-1,0,-1))&&(i=!0,r=T().Exp_ChangeMergedCell),i||y&&(o.KT(c,-1,v,-1)||o.KT(s,-1,0,-1))&&(i=!0,r=T().Exp_ChangePartOfArray),m=g&&g.allowDragInsertRows,!i&&o.isActualProtected()&&!0!==m&&(i=!0,r=T().Exp_RowReadOnly),i||(p=q(o,!0,c,-1,s,-1,v,-1,n.t_,!0,d)).cancel||(e=o.Qy().execute({cmd:"dragDrop",sheetName:o.name(),fromRow:c,fromColumn:-1,toRow:s,toColumn:-1,rowCount:v,columnCount:-1,copy:n.t_,insert:!0,option:p.copyOption,mouseTargetRow:f,mouseTargetCol:l}),q(o,!1,c,-1,s,-1,v,-1,n.t_,!0,p.copyOption)))))),n.rb=!1,n.zk=!1,n.Snt=!1,n.Cnt=!1,n.e_=!1,n.Tnt=C,n.Mnt=C,n.i_=!1,n.t_=!1,n.Int=C,n.xnt=C,n.iy(),e||(n.q6={},o.repaint()),i&&o.jT(3,r)},wk:function(t){var n=this;!0!==n.Yk&&!0!==n.rb&&(n._nt(),n.Ktt)&&(n.rb=!0,n.Yk=!0,n.hO=!0,n.Ent=t,n.jnt=k(t),n.Ont=x(t),n.Rnt=k(t),n.Bnt(),n.Rk={e9:x(t),r9:k(t),Bk:s(t)},n.Ok())},Bnt:function(){var t,n,i,r,n,t=this,n=u(t.Mf),i=a(t.Mf),r=t.Lnt();0<=r&&r<n?t.Fnt=0:n<=r&&r<=M(t.Mf)&&(t.Fnt=1),t.Pnt()?t.Gnt=1:t.Gnt=t.Ent,0<=(n=t.Unt())&&n<i?t.Hnt=0:i<=n&&n<=I(t.Mf)&&(t.Hnt=1),t.znt()?t.Vnt=1:t.Vnt=t.jnt},Zk:function(){var t,n,i,r,t=this;t.Rk&&t.Yk&&t.rb&&t.Ktt&&(t.Ont=t.nD(),t.Rnt=t.eD(),t.Ynt=t.Q9(),t.Znt=t.K9(),0<=t.Ynt&&0<=t.Znt&&(t.Wnt(),t.Qnt(),n=t.Mf.parent,i=!1,(r=t.Knt())&&(i=t.Jnt(t.Ktt,t.Xnt,!0)),n&&n.options.showDragFillTip&&i&&t.qnt(),t.$nt()),t.a9())},tet:function(){var t,n,i,r,e,e,o,u,s,s,a,u,f,l,c,h,v,h,v,g,d,t=this,n=t.Mf,i=t.Ktt,r=t.Xnt,e=n.parent.options.defaultDragFillType,e=t.net(3===e?5:e,3===e),o=t.eet(),u=t.Knt();return 1===e?(s=0===o||1===o?1:0,u=(a=new w.Wtt(n)).Jtt(u,s,!0),s=t.iet(o,r,i),l=(f=n.getActualStyle(s.row,s.col)).cellType||n.$f(),c=f.formatter||f._autoFormatter,h=p.Formatter&&p.Formatter.GeneralFormatter,u instanceof Date&&h&&(c=new h(p.Common.CultureManager.Fe().DateTimeFormat.shortDatePattern+" hh:mm:ss AM/PM;@","0")),h=3,(v=t.Rk)&&(h=v.Bk),v={sheet:n,row:s.row,col:s.col,sheetArea:h,quotePrefix:f.quotePrefix},l.format(u,c,g={},v)):0!==e||(s=t.iet(o,r,i),d=n.getFormula(s.row,s.col))?C:n.getText(s.row,s.col)},iet:function(t,n,i){var r,e,o,i,u,s,r=i.row,e=i.col,o=O(i),i=S(i),u=_(r,e,1,1);return 3===t?(s=O(n)%o,u.row=s=0===s?r+o-1:r+s-1,u.col=e):1===t?(s=0===(s=S(n)%i)?e+i-1:e+s-1,u.row=r,u.col=s):0===t?(s=0===(s=S(n)%i)?e:e+i-s,u.row=r,u.col=s):2===t&&(s=O(n)%o,u.row=s=0===s?r:r+o-s,u.col=e),u},qnt:function(){var t,n,i,r,e,o,u,o,n,t=this,n=t.Mf,i;if(4===t.net()||t.znt()||t.Pnt())return t.iy(),C;u=t.eet(),o=t.Knt(),n=n.j1(o),o=t.tet(),3===u||1===u?(r=n.x+n.width+3,e=n.y+n.height+3):0===u?(r=n.x+3,e=n.y+n.height+3):2===u&&(r=n.x+n.width+3,e=n.y+3),t.Tw(o,r,e)},$nt:function(){var t=this;t.ret(),t.oet(),t.aet(),t.uet=t.Knt()},ret:function(){var t,n,t=this.Mf;this.uet&&((n=t.j1(this.uet)).x-=2,n.y-=2,n.width+=4,n.height+=4,t.Dn.O1(n))},oet:function(t){var n;this.Mf.Dn.E1(this.Ktt,C,t)},aet:function(){var t,n,i,r,i,e,t,t=this.Mf,n=t.Dn,i=this.Knt();i&&(r=n.J(),i=t.j1(i),e=t.getSelectionBorderColor(),t=N(t),r.save(),r.beginPath(),n.cet(r,i,e,t),r.restore())},Qnt:function(){this.Xnt=this.dO()},znt:function(){return-1===this.Ktt.col&&-1!==this.Ktt.row},Pnt:function(){return-1===this.Ktt.row&&-1!==this.Ktt.col},lO:function(){return 4===this.bO||5===this.bO},dO:function(){var t,n,i,r,e,t=this,n=-1,i=-1,r=-1,e=-1;switch(t.bO){case 0:r=t.Pnt()?n=-1:(n=t.Lnt(),O(t.Ktt)),i=t.Znt,e=t.Unt()-i;break;case 1:r=t.Pnt()?n=-1:(n=t.Lnt(),O(t.Ktt)),i=t.fet()+1,e=t.Znt-i+1;break;case 2:n=t.Ynt,r=t.Lnt()-n,e=t.znt()?i=-1:(i=t.Unt(),S(t.Ktt));break;case 3:n=t.let()+1,r=t.Ynt-n+1,e=t.znt()?i=-1:(i=t.Unt(),S(t.Ktt));break;case 5:n=t.Ynt,r=t.let()-n+1,e=t.znt()?i=-1:(i=t.Unt(),S(t.Ktt));break;case 4:r=t.Pnt()?n=-1:(n=t.Ktt.row,O(t.Ktt)),i=t.Znt,e=t.fet()-i+1}return _(n,i,r,e)},het:function(){var t=this.let();return-1!==t?this.Mf._y(this.Gnt).findRow(t):C},det:function(){return this.Mf._y(this.Ont).findRow(this.vet())},vet:function(){return this.Mf.getViewportBottomRow(this.Ont)},met:function(){var t=this.fet();return-1!==t?this.Mf.Yy(this.Vnt).findCol(t):C},pet:function(){return this.Mf.Yy(this.Rnt).findCol(this.bet())},bet:function(){return this.Mf.getViewportRightColumn(this.Rnt)},Wnt:function(){var t,n,i,r,e,o,u,s,e,r,a,f,l,c,o,u,c,l,o,u,a,f,l,o,u,a,l,u,f,h,t=this,n=t.znt(),i=t.Pnt(),r=v(t.Mf.Dg()).offset(),e=t.fk.e,o=t.fk.x,u=t.fk.y,s=e.pageX-r.left,e=e.pageY-r.top,r=!1;n||i?i?t.Znt>=t.Unt()&&t.Znt<=t.fet()?t.bO=4:t.Znt<t.Unt()?t.bO=0:t.Znt>t.fet()&&(t.bO=1):n&&(t.Ynt>=t.Lnt()&&t.Ynt<=t.let()?t.bO=5:t.Ynt<t.Lnt()?t.bO=2:t.Ynt>t.let()&&(t.bO=3)):t.Ynt>=t.Lnt()&&t.Ynt<=t.let()?t.Znt>=t.Unt()&&t.Znt<=t.fet()?(a=g(t.Znt-t.fet()))<(f=g(t.Ynt-t.let()))?t.bO=5:f<a?t.bO=4:u>(l=(l=t.het())||t.det()).y+l.height?t.bO=3:(o=(c=(c=t.met())||t.pet()).x+c.width-o,u=l.y+l.height-u,s>=c.x&&s<=c.x+c.width&&e>=l.y&&e<=l.y+l.height?t.bO=u<=o?4:5:r=!0):t.Znt<t.Unt()?t.bO=0:t.Znt>t.fet()&&(t.bO=1):t.Ynt<t.Lnt()?t.Znt>=t.Unt()&&t.Znt<=t.fet()?t.bO=2:t.Znt<t.Unt()?(a=g(t.Znt-t.Unt()),f=g(t.Ynt-t.Lnt()),t.bO=a<=f?2:0):t.Znt>t.fet()&&(a=g(t.Znt-t.fet()),f=g(t.Ynt-t.Lnt()),t.bO=a<=f?2:1):t.Ynt>t.let()&&(t.Znt>=t.Unt()&&t.Znt<=t.fet()?t.bO=3:t.Znt<t.Unt()?(a=g(t.Znt-t.Unt()),f=g(t.Ynt-t.let()),t.bO=a<=f?3:0):t.Znt>t.fet()&&(a=g(t.Znt-t.fet()),f=g(t.Ynt-t.let()),t.bO=a<=f?3:1)),(c=t.Mf.Dn.yet)&&(u=(l=t.let())+1,a=(o=t.fet())+1,f=t.Mf.getRowHeight(l,3),l=t.Mf.getColumnWidth(o,3),o=t.Mf.getRowHeight(u,3),u=t.Mf.getColumnWidth(a,3),a=c.x+c.width/2-b(10,l/2),l=c.x+c.width/2+b(10,u/2),u=c.y+c.height/2-b(10,f/2),f=c.y+c.height/2+b(10,o/2),h=!1,(h=n||i?i?a<=s&&s<=l:u<=e&&e<=f:a<=s&&s<=l&&u<=e&&e<=f)||r?(t.hO=!0,t.bO=4):t.hO=!1)},Lnt:function(){return this.Ktt?-1===this.Ktt.row?0:this.Ktt.row:-1},let:function(){var t=this;return t.Ktt?-1===t.Ktt.row?M(t.Mf)-1:t.Ktt.row+O(t.Ktt)-1:-1},Unt:function(){return this.Ktt?-1===this.Ktt.col?0:this.Ktt.col:-1},fet:function(){var t=this;return t.Ktt?-1===t.Ktt.col?I(t.Mf)-1:t.Ktt.col+S(t.Ktt)-1:-1},wet:function(t,n){var n,i,r,e,e,r,e,t,n=_(n.row,n.col,n.rowCount,n.colCount),i=this.Mf;return i.Ut.findSpan(t.row,t.col)&&(r=t.rowCount,e=n.rowCount,0!==Math.floor(e%r)&&(e=Math.ceil(e/r)*r,n.row+e<=i.getRowCount())&&(n.rowCount=e),r=t.colCount,e=n.colCount,0!==Math.floor(e%r))&&(t=Math.ceil(e/r)*r,n.col+t<=i.getColumnCount())&&(n.colCount=t),n},DD:function(){var t,n,i,r,e,o,u,s,t=this,n=t.Mf;t.Rk=C,t.l9(),t.iy(),t.Yk&&t.rb?(t.Yk=!1,t.rb=!1,(i=t.Knt())&&(!(r=t.Jnt(t.Ktt,t.Xnt))||t.hO?(t.Met(),t.Ax(i)):(e=n.rt.Ktt,o=t.wet(e,t.Xnt),u=t.net(),n.Qy().execute({cmd:"fill",sheetName:n.name(),startRange:e,fillRange:o,autoFillType:u,fillDirection:n.rt.eet()}),!(s=t.lnt)&&t.Cet()&&n.parent.options.showDragFillSmartTag&&4!==t.fnt?t.Tet(t.fnt):t.Ax(i),t.Met()))):t.Met()},Tet:function(t){var n,i,i,n=this.Mf,i=n.Dn.yet,i={x:i.x+i.width,y:i.y+i.height,fillType:t};n.R_=new r.Aet(n.parent.j2(),n,i),n.R_.rQ()},_nt:function(){var t,n,n,i,t=this.Mf,n=t.Ut.getSelections();1===n.length?(n=n[0],(i=t.Ut.getSpans(n))&&0<i.length&&(n=t.kR(i,n)),this.Ktt=n):0<=t.ui&&0<=t.ci&&(this.Ktt=_(t.ui,t.ci,1,1))},Met:function(){this.rb=!1,this.Yk=!1},Ax:function(t){this.Mf.Dn.E1(t)},net:function(t,n){var i,r,t,e,i=this,r=i.Mf,t=t!==F?t:r.parent.options.defaultDragFillType;return i.lO()?4:5!==t?t:(e=1===O(i.Ktt)&&1===S(i.Ktt)&&!i.Pnt()&&!i.znt())?i.a_&&!n?1:0:i.a_&&!n?0:1},Knt:function(){var t,n,i,r,e,t=this;return t.Ktt?t.lO()?t.Ktt:t.Xnt?(e=r=i=n=0,e=t.Iet()?(n=(2===t.bO?t.Xnt:t.Ktt).row,i=O(t.Ktt)+O(t.Xnt),r=t.Ktt.col,S(t.Ktt)):(n=t.Ktt.row,i=O(t.Ktt),r=(0===t.bO?t.Xnt:t.Ktt).col,S(t.Ktt)+S(t.Xnt)),_(n,r,i,e)):C:C},Jnt:function(t,n,i){var r,e,o,r=this.Mf,e=!0,o="";return r.Ut.eE(n.row,n.col,O(n),S(n))&&!B(r,t,n)&&(e=!1,o=T().Exp_FillRangeContainsMergedCell),e&&r.isActualProtected()&&r.dA(n,!0,D.SheetArea.viewport)&&(e=!1,o=r.FT()),e||i||r.ki(D.Events.InvalidOperation,{sheet:r,sheetName:r.name(),invalidType:D.InvalidOperationType.dragFill,message:o,fillRange:n}),e},Cet:function(){return this.xet()||this.Net()},xet:function(){return 3===this.bO||1===this.bO},Net:function(){return 0===this.bO||2===this.bO},Iet:function(){return 2===this.bO||3===this.bO||5===this.bO},eet:function(){var t=this.bO;return 0<=t&&t<=3?t:4===t?0:5===t?2:3},VL:function(t,n,i){var r,e,o,t,u,s,a,u,o,r=this,e=C,o=x(t),t=k(t),u=r.Mf,s=u.parent;if(!f(o)&&!f(t)&&(s.options.allowUserDragDrop||s.options.allowUserDragFill)&&(-1!==(a=u.U5()).row||-1!==a.col)){if(0<=o&&0<=t&&1===u.Ut.getSelections().length){if(r.yD(o,t,n,i))return e;(e=(u=u.getRangeRect(o,t,a)).x-4<n&&n<u.x+4&&u.y<=i&&i<u.y+u.height?{action:l,side:"left"}:e)||(o=r.Mf.Dn.yet)&&o.x<=n&&n<=o.x+o.width&&o.y<=i&&i<=o.y+o.height&&(e={action:l,side:c}),e||u.x+u.width-4<n&&n<u.x+u.width+4&&u.y<=i&&i<u.y+u.height&&(e={action:l,side:"right"}),e||u.y-4<i&&i<u.y+4&&u.x<=n&&n<u.x+u.width&&(e={action:l,side:"top"}),e||u.y+u.height-4<i&&i<u.y+u.height+4&&u.x<=n&&n<u.x+u.width&&(e={action:l,side:"bottom"}),e&&(n<u.x||n>u.x+u.width||i<u.y||i>u.y+u.height)&&(e.outside=!0)}s&&s.options.allowUserDragDrop||e&&e.side!==c&&(e.side=C),s&&s.options.allowUserDragFill||e&&e.side===c&&(e.side=C)}return e},ket:function(t,n){var i,r,e,i=this,r,e=i.Mf.getSpan(t,n,3);return e?!f(i.Mf.getValue(e.row,e.col,3,0)):!f(i.Mf.getValue(t,n,3,0))},Det:function(t,n){var i,r,e,e,i,r,e=this.Mf.tables;return!(!e||0===e.all().length)&&(e=e.AB(t,n,1,1)[0])&&e.footerIndex()===t},_et:function(t,n,i,r){for(var e,o,e=this,o=n;o<n+r;o++)if(!e.ket(t,o)||e.Det(t,o))return!1;return!0},Eet:function(t,n,i,r){for(var e,o,e=this,o=n;o<n+r;o++)if(e.ket(t,o))return!1;return!0},jet:function(t,n,i,r){var e,o,u,s,a,f,l,c,h,e=this,o=e.Mf;if("left"===r){for(u=0;u<n;u++)e.ket(t,u)&&(i.searchArray[u]=!0);for(s=n-1,a=1;i.searchArray[s];)s--,a++;i.searchLength=a}if("right"===r){for(f=o.getColumnCount(),l=n;l<f;l++)e.ket(t,l)&&(i.searchArray[l-n]=!0);for(c=0,h=1;i.searchArray[c];)c++,h++;i.searchLength=h}return i},Oet:function(t,n,i,r,e){for(var o,u,s,a,f,l,c,h,v,g,o=this,u=o.Mf,s=0,a={searchArray:new Array(r),searchLength:1},f={searchArray:new Array(u.getColumnCount()-e),searchLength:1},l=n;l<i;l++)a=o.jet(l,t.col,a,"left"),f=o.jet(l,t.col+t.colCount-1,f,"right");for(;o.Eet(i+s,t.col,1,t.colCount);){for(h=!(c=!0),a=o.jet(i+s,r,a,"left"),f=o.jet(i+s,e,f,"right"),v=r-1;v>=r-a.searchLength;v--)if(o.ket(i+s,v)){s++,c=!1;break}if(c){for(g=e+1;g<=e+f.searchLength;g++)if(o.ket(i+s,g)){s++,h=!0;break}if(!h)return s}}return s},Ret:function(t){for(var n,i,n=this,i=0;n._et(t.row+t.rowCount+i,t.col,1,t.colCount);)i++;return i},Bet:function(t){var n,i,r,e,o,n=this;return n._et(t.row+t.rowCount,t.col,1,t.colCount)?n.Ret(t):(e=t.row-2,o=t.row+t.rowCount,r=1===t.colCount?i=t.col:(i=t.col,t.col+t.colCount-1),n.Oet(t,e,o,i,r))},H_:function(){var t,n,i,r,r,e,o,t=this,n=t.Mf,i=n.rt.Ktt,r=t.Bet(i);0!==r&&(r=_(i.row+i.rowCount,i.col,r,i.colCount),t.bO=3,t.Xnt=r,e=t.net(),o=t.lnt,n.Qy().execute({cmd:"fill",sheetName:n.name(),startRange:i,fillRange:r,autoFillType:e,fillDirection:t.bO}),!o)&&n.parent.options.showDragFillSmartTag&&4!==t.fnt&&t.Tet(t.fnt)}}),v.extend(D.g7.prototype,{Let:function(t,n){var i,r,e,o,t,u,i,s,a,n,i=this.Mf,r=t.x,e=t.y,o=E(t),t=A(t),u=i.U5(),i=i.Fi(),s=4,a=-2.5;return 2007<n&&(s=5,a=-3),n=new D.Rect(-4,-4,s,s),-1===u.col?(n.x=i.b6,n.y=e+t+a):-1===u.row?(n.x=r+o+a,n.y=i.T6):(n.x=r+o+a,n.y=e+t+a),n},yO:function(t,n,i,r,e){var o,u,s,a,a,r,f,l,c,h,s,n,i,o=this,u=o.Mf,s=u.Fi(),a=u.parent,a=a&&a.SC,r=o.Let(r,a),f=r.x,l=r.y,c=E(r),h=A(r),s=s.c9(n,i);e&&!r.intersectRect(e)||r.intersectRect(s)&&(n=-1.5,(i=new D.Rect(f+(n=2007<a?-1:n),l+n,c+2,h+2)).x=R(i.x,s.x),i.y=R(i.y,s.y),o.O1(i),t.save(),e&&!e.containsRect(r)&&(t.rect(e.x,e.y,E(e),A(e)),t.clip()),t.beginPath(),t.fillStyle=D.Pf.vl(u,u.getSelectionBorderColor()),t.fillRect(f,l,c,h),o.yet=new D.Rect(r.x,r.y,4,4),t.beginPath(),t.restore())},cet:function(t,n,i,r){var e=n.x,o=n.y,u=e+E(n),n=o+A(n);V(t,e-2,o,u+1,o,i,r),V(t,e-1,n,u+1,n,i,r),V(t,e,o-1,e,n+1,i,r),V(t,u,o-1,u,n+1,i,r)},Fet:function(t,n){var i,r,e,o,u,s,a,f,l,c,h,v,g,d,p,c,w,m,y,_,y,u,y,l,f,C,i=this,r=i.Mf,e=r.rt,o=e.q6,u=o.hitTarget;o&&u&&(s=o.hitCol,a=o.hitRow,f=o.row,l=o.col,c=e.i_,h=r.Pet,g=r.getSelectionBorderColor(),d=N(r),p=8,t.save(),!0===c?(c=r.Yy(0).findCol(s)||r.Yy(1).findCol(s)||r.Yy(2).findCol(s),w=r._y(0).findRow(a)||r._y(1).findRow(a)||r._y(2).findRow(a),-1===o.row&&-1!==o.col?c&&(m=c.x,y=E(c),o.col=s,u.x>m+y/2&&(o.col<r.getLastFullyVisibleColumn()||o.col===r.G6())&&(m=c.x+E(c),o.col++),(h=h&&0===E(h)?h:e.q6)&&(v=new D.Rect(h.x-8,h.y-8,E(h)+16,A(h)+16),i.O1(v,n),i.E1(r.U5(),n)),r.Uet=new D.Rect(m,o.y,0,A(o)),t.rect(n.x,n.y,E(n),A(n)),t.clip(),t.beginPath(),V(t,m-8,o.y,m+8,o.y,g,d),V(t,m,o.y,m,o.y+A(o),g,d),V(t,m-8,o.y+A(o),m+8,o.y+A(o),g,d)):-1!==o.row&&-1===o.col?w&&(_=w.y,y=A(w),o.row=a,u.y>_+y/2&&(o.row<r.getLastFullyVisibleRow()||o.row===r.P6())&&(_=w.y+A(w),o.row++),(h=h&&0===A(h)?h:e.q6)&&(v=new D.Rect(h.x-8,h.y-8,E(h)+16,A(h)+16),i.O1(v,n),i.E1(r.U5(),n)),r.Uet=new D.Rect(o.x,_,E(o),0),t.rect(n.x,n.y,E(n),A(n)),t.clip(),t.beginPath(),V(t,o.x,_-8,o.x,_+8,g,d),V(t,o.x,_,o.x+E(o),_,g,d),V(t,o.x+E(o),_-8,o.x+E(o),_+8,g,d)):-1!==o.row&&-1!==o.col&&(u=r.Yy(0).findCol(l)||r.Yy(1).findCol(l)||r.Yy(2).findCol(l),y=r._y(0).findRow(f)||r._y(1).findRow(f)||r._y(2).findRow(f),w)&&c&&y&&u&&(m=u.x,_=y.y,h&&(v=new D.Rect(h.x-8,h.y-8,E(h)+16,A(h)+16),i.O1(v,n),i.E1(r.U5(),n)),l=!1,f=r.getCellRect(a,s),(l=!e.Cnt&&f?(C=o.hitTarget.x-f.x)<b(16,r.nn(s)/4):l)?m=c.x:_=w.y,r.Uet=new D.Rect(m,_,E(o),A(o)),r.U5().contains(a,s)||(t.rect(n.x,n.y,E(n),A(n)),t.clip(),t.beginPath(),l?(V(t,m-8,_,m+8,_,g,d),V(t,m,_,m,_+A(o),g,d),V(t,m-8,_+A(o),m+8,_+A(o),g,d),e.Dnt=!0):(V(t,m,_-8,m,_+8,g,d),V(t,m,_,m+E(o),_,g,d),V(t,m+E(o),_-8,m+E(o),_+8,g,d),e.Dnt=!1)))):(h&&(v=new D.Rect(h.x-8,h.y-8,E(h)+16,A(h)+16),i.O1(v,n),i.E1(r.U5(),n)),t.rect(n.x,n.y,E(n),A(n)),t.clip(),t.beginPath(),i.cet(t,o,g,d)),t.beginPath(),t.restore())},o_:function(){var t,n,i,r,i,e,o,u,s,a,f,l,c,s,f,t=this,n=t.Mf,i=n.sw,r=n.rt.xnt;i&&i.dragInfo&&r&&(i=t.J(),e=n.Fi(),o=n.rt.q6,u=n.j1(r),s=n.frozenTrailingColumnCount(),a=n.frozenTrailingRowCount(),f=n.getColumnCount()-s,l=n.getRowCount()-a,c=e.c9(1,1),0<s&&r.col+r.colCount<=f&&u.x+E(u)>c.x+E(c)&&u.intersectRect(c)&&(u=u.getIntersectRect(c)),0<a&&r.row+r.rowCount<=l&&u.y+A(u)>c.y+A(c)&&u.intersectRect(c)&&(u=u.getIntersectRect(c)),s=new D.Rect(e.b6,e.T6,e.Hy+e.zy,e.Ay+e.Iy),0<=E(u)&&0<=A(u)&&(o.x=u.x,o.y=u.y,o.width=E(u),o.height=A(u),t.Fet(i,s)),f=n.rt.i_,n.Pet=!0===f?n.Uet:new D.Rect(o.x,o.y,E(o),A(o)))}})},"./dist/plugins/fill/fill-ui.js":function(N,t,n){var i,V,u,n,s,a,r,f,l,e,o,c,h,v,g,d,p,w,m,y,_,C,q,L,D,F,b,R,j,T,x,k,B,e,M,W,$,H,I,S;function O(t,n,i,r,e,o){var t=t.Oi,u=t?"160px":"150px",t=t?"25px":"20px",u=s(a("div")).css([C,L,D,"padding",F],["block",u,t,0,0]).addClass("gc-smartMenu-item-default "+i+" ui-state-default"+l),t=s(a("div")).addClass(d).appendTo(u),i=s(a("div")).addClass("gc-menu-item-text").appendTo(u),n=s(a("input")).attr({id:n,value:e,type:"radio",name:"fill-group",style:"display:none"}).appendTo(t);return s(a("span")).text(r).appendTo(i),o?(t.addClass(g),n.prop("checked","checked")):n.prop("checked",""),u}function A(t,n){var t,i,t=I.call(this,t,r(n.parent.Ti))||this;return t.Mf=n,t.Het=s("."+w),(i=t.g$=t.Xc()).addClass(c),O(n,"smartMenuCopyCells",o,M().CopyCells,"0",!0).appendTo(i),O(n,"smartMenuFillSeries",o,M().FillSeries,"1").appendTo(i),n.NMi||(O(n,"smartMenuFillFormattingOnly",o,M().FillFormattingOnly,"2").appendTo(i),O(n,"smartMenuFillWithoutFormatting",o,M().FillWithoutFormatting,"3").appendTo(i)),t}function E(t,n,i){var t,n,t=S.call(this,t,r(n.parent.Ti))||this;return t.Mf=n,t.zet=i,n=t.Vet=t.Xc().addClass("gc-smart-tag-default "+w+" gc-no-user-select ui-widget-header"+l),t.Yet=s(a("div")).attr("class","fillSmartTag").css(m,y).appendTo(n),t.Zet=s(a("div")).attr("class","fillSmartTagDown").css([m,C],[y,"none"]).appendTo(n),t}i=this&&this.__extends||(H=function(t,n){return(H=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}H(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),Object.defineProperty(t,"__esModule",{value:!0}),t.Aet=void 0,V=n("Common"),u=n("Core"),n=n("./dist/plugins/fill/fill.ns.js"),s=u.GC$,a=u.mt.En,r=u.mt.gi,f=s(document),l=" btn btn-default",o="gc-fill-type-item",c="gc-fill-menu-container",h=(e="ui-state-hover ")+"gc-smartMenu-item-hover",v=e+"gc-smart-tag-hover",g="ui-icon ui-icon-check gc-check-image",d="gc-menu-item-input",p="ui-state-active gc-smart-tag-active",w="gc-tag-container",m="float",y="left",_="top",C="display",q="width",L="min-width",D="height",F="margin",b="change",R="input[type=radio]",j="mouseover",T="mouseout",x="click",k="fillTypeChanged",B="keydown.ui-fill",e=new V.Common.ResourceManager(n.SR,"Fill"),M=e.getResource.bind(e),I=u.zc,i(A,I),A.prototype.$c=function(){I.prototype.$c.call(this)},A.prototype.aY=function(){var e,t,n,e=this,t;s("."+o).bind(j,function(){s(this).addClass(h)}).bind(T,function(){s(this).removeClass(h)}).bind(x,function(){var t,n,i,r,i,t=s(this),n=e.Het,i=t.find(R),r=i[0];r.checked=!0,i.trigger(b),n.trigger(x),n.trigger(T),t.removeClass(h),i=parseInt(s(r).attr("value"),10),e.Wet(i)}),(n=e.g$.find(R)).bind(b,function(){s("."+d).removeClass(g),s(this).parent().addClass(g)})},A.prototype.Qet=function(){s("."+o).unbind(j).unbind(T).unbind(x),this.g$.find(R).unbind(b)},A.prototype.Wet=function(t){var n=this,i=n.Mf,r=i.rt;if(n.Ket!==t){n.Ket=t,i.cnt=!0,i.suspendEvent();try{u.Commands.undo.execute(i.parent,{sheetName:i.name()})}finally{i.resumeEvent()}i.cnt=!1,i.Qy().execute({cmd:"fill",sheetName:i.name(),startRange:r.Ktt,fillRange:r.Xnt,autoFillType:t,fillDirection:r.bO}),n.Het.trigger(k,t)}},A.prototype.Jet=function(){return!!s("."+c).length},W=A,S=u.zc,i(E,S),E.prototype.Xet=function(t,n,i){var r=this,e=r.Mf.Oi,n=s(n),o=r.qet,r=r.Zet,u=e?"38px":"32px",e=e?"24px":"18px";o&&o.Jet()||(t?n.addClass(v):n.removeClass(v),n.css([q,D],[t?u:e,e]),i)||(t?r.show():r.hide())},E.prototype.$et=function(){var e=this,t=e.Vet,n=u.mt.pi(),o=u.mt.Tt.safari&&(n.ipad||n.iphone);t.bind(j,function(){e.Xet(!0,this,o)}).bind(T,function(){e.Xet(!1,this,o)}),t.bind(x,function(){var t,n,i,r,n,i,t=s(this),n=e.qet,i=e.Zet,r;n&&n.Jet()?(o&&i.hide(),t.removeClass(p),e.tit()):(o&&i.show(),t.addClass(p),e.nit(),(i=(n=e.g$)&&n.find(R)[e.zet.fillType])&&!i.checked&&(i.checked=!0,s(i).trigger(b)))}),f.bind(B,function(t){27===t.keyCode&&(e.qet&&e.qet.Jet()?e.tit():e.close(),u.mt.vi(t))})},E.prototype.rQ=function(){var t=this,n=t.Vet,i=t.zet,r=t.Mf.Oi,e=r?"3px":"0px",r=r?"24px":"18px";n&&(n.css([y,_],[i.x,i.y]),t.$c(),t.$et(),t.Yet.css(F,e),t.Zet.css(D,r),t.c5())},E.prototype.nit=function(){var t,n,n,i,r,r,e,o,u,t=this,n=t.Mf;t.qet||(t.qet=new W(n.parent.j2(),n),t.g$=t.qet.Xc()),i=(n=t.Vet).css(y),r=n.css(_),r=parseFloat(r),o=t.qet,u=t.zet,o.Ket=u.fillType,isNaN(r)||(e=r+n.height()+2),t.g$.css([y,_],[i,e]),o.$c(),o.aY(),o.Het.unbind(k).bind(k,function(t,n){u.fillType=n})},E.prototype.tit=function(){var t=this.qet;t&&(t.Qet(),t.close())},E.prototype.c5=function(){var t=this,n=t.qet,t=t.Vet;n&&(n.Jet()&&t.trigger(x),t.trigger(T))},E.prototype.close=function(){var t,n,t,t=this,n=t.Mf;t.c5(),f.unbind(B),S.prototype.close.call(this),(t=n.fg)&&(t.style.cursor="default"),n&&n.Zg()},E.prototype.lf=function(t){var n;return!(!this.Wc||!S.prototype.hf.call(this,this.Wc.get(0),t))||this.g$&&S.prototype.hf.call(this,this.g$.get(0),t)},t.Aet=E},"./dist/plugins/fill/fill.entry.js":function(t,n,i){var r,e,r=this&&this.__createBinding||(Object.create?function(t,n,i,r){void 0===r&&(r=i);var e=Object.getOwnPropertyDescriptor(n,i);e&&("get"in e?n.__esModule:!e.writable&&!e.configurable)||(e={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,r,e)}:function(t,n,i,r){t[r=void 0===r?i:r]=n[i]}),e=this&&this.__exportStar||function(t,n){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||r(n,t,i)};Object.defineProperty(n,"__esModule",{value:!0}),i("./dist/plugins/fill/drag-fill.js"),i("./dist/plugins/fill/fill-event.js"),e(i("./dist/plugins/fill/fill-ui.js"),n),e(i("./dist/plugins/fill/fill.js"),n),e(i("./dist/plugins/fill/fill.ns.js"),n)},"./dist/plugins/fill/fill.js":function(j,t,n){var i,e,h,r,T,n,M,o,tt,_,C,D,nt,I,u,S,x,u,O,A,it,rt,et,E,u,k,N,V,q,L,B,W,ot,$,H,u,n,z,P,U,n,G,J,K,Q,X,Y,Z,at,ft,lt,ct,ht,n,u,n,u,n,vt,gt,dt,pt,wt,mt,yt,_t,Ct,s,a,Dt,Ft;function ut(t){return!st(t)&&o.q8(t)}function st(t){return"string"==typeof t}function bt(t,n){return-1!==t.lastIndexOf(n)}function Rt(t){var n=[t];return n.rowCount=1,n.colCount=x(t),n}function jt(t){return t}function Tt(t,n,i,r){var n=Rt(n),i=Rt(i),r=Rt([r]),t=t?e.Common.eit(n,i,r,!0,jt,tt,tt,tt):e.Common.iit(n,i,r,!0,tt,tt,tt),n=t&&t[0][0];return typeof n===it?e.Common.st.E8(n,13):n}function xt(t){return t.toLowerCase()}function f(t){this.rit=[],this.oit=[],this.ait=[],this.uit=tt,this.sit=[],this.cit=tt,this.lit=nt(t)?-1:t}function l(t){this.hit=-1,this.dit=[],this.MV=-1,this.Mf=t}function kt(){this.vit="",this.mit="",this.MV=0,this.git=1,this._padding=""}function c(t){var n,i,r,e,n=t.length,i=1;if(1<n)for(i=t[1]-t[0],e=2;e<n;e++)if(i!==(r=t[e]-t[e-1])){i=0;break}return i}function v(t,n){return 0<t?(t-1)%n:n-Math.abs(t)%n-1}function g(t){for(var n="",i=0;i<t;)n+="0",i++;return n}function d(t,n){return 12*(n.getFullYear()-t.getFullYear())+(n.getMonth()-t.getMonth())}function Mt(t){return t.every(function(t){var n;return 1===t.getDate()})}function It(t){return t.every(function(t){var n,i,r,e,n=t.getFullYear(),i=t.getMonth(),r,e;return t.getDate()===new Date(n,i+1,0).getDate()})}function St(t){var n,i,n=0,i;return t.every(function(t){var t=t.getDate();return(n=n||t)===t})?n:0}function Ot(t,n){for(var i,r,e,o,i=t.length,r=!0,o=2;o<i&&(r=n===(e=d(t[o-1],t[o])));o++);return r}function At(t){return t.every(function(t){var n=t.getHours(),i=t.getMinutes(),t=t.getSeconds();return 0!==n||0!==i||0!==t})}function Et(t,n){return new Date(t,n+1,0).getDate()}function p(t){return"0"===t[0]}function Nt(n,t,i){var r,e,o,e,o,u,s,u=i?1:2,s=i?2:1;return t.every(function(t){return!!(r=t.match(n.pit))&&(e=r[u],(o=e.length)>n.yit&&p(e)&&(n.yit=o),o=parseInt(e,10),e=r[s],nt(n.cit)&&(n.cit=e),e!==n.cit?(n.wit=!0,n.cit=tt,n.sit=[]):n.sit.push(o),!0)})}function w(){}function Vt(){var t=null!==vt&&vt.apply(this,arguments)||this;return t.Mit=0,t.uit=rt,t}function m(){return null!==gt&>.apply(this,arguments)||this}function y(){return null!==dt&&dt.apply(this,arguments)||this}function qt(){return null!==pt&&pt.apply(this,arguments)||this}function Lt(){var t=wt.call(this)||this;return t.pit=tt,t.sit=[],t.cit=tt,t.wit=!1,t.yit=0,t.uit=et,t.Cit=!1,t.Sit=!1,t.Tit=new H,t}function F(t){var n=mt.call(this)||this;return n.Ait=new $(t),n}function Bt(){var t=null!==yt&&yt.apply(this,arguments)||this;return t.pit=/^\d+$/,t}function Wt(){var t=null!==_t&&_t.apply(this,arguments)||this;return t.pit=/^(.*\D+)(\d+)$/,t}function $t(){var t=null!==Ct&&Ct.apply(this,arguments)||this;return t.pit=/^(\d+)(\D+.*)$/,t}function b(){var t=null!==s&&s.apply(this,arguments)||this;return t.pit=/^(.*\D+)(\d+)(\D+.*)$/,t}function Ht(){return null!==a&&a.apply(this,arguments)||this}function zt(){return null!==Dt&&Dt.apply(this,arguments)||this}function Pt(){var t=null!==Ft&&Ft.apply(this,arguments)||this;return t.Cit=!0,t}function Ut(t){var n,i,i,t,r,e,o,n=this;n.Iit=[new z,new P,new U],n.xit=new at,n.Nit=new ft,i=N.culture(),i=N.Fe(i).isJCKCulture,t=new G(t),r=new J,e=new K,o=new Q,n.kit=i?[t,r,new Z,e,o,new X]:[t,r,e,o]}function Gt(t){t.forEach(function(t){t&&t.dispose()})}function R(t){this.Mf=t,this.Dit=!1,this._it=[]}i=this&&this.__extends||(ht=function(t,n){return(ht=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}ht(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),Object.defineProperty(t,"__esModule",{value:!0}),t.Wtt=t.nnt=t.FillDateUnit=t.FillType=t.FillSeries=t.FillDirection=t.AutoFillType=void 0,e=n("Common"),h=n("Core"),r=n("CalcEngine"),T=n("SheetsCalc"),n=n("./dist/plugins/fill/fill.ns.js"),M=!!r,o=e.Common.lt,tt=null,_=void 0,C=Math.floor,D=h.Ec,nt=o.ht,I=o.uJ,u=e.Common.Uf,S=u.Eit,x=u.tR,u=e.Common.ct,O=u.o0,A=u.Y0,it="number",rt="date",et="string",E="default",u=new e.Common.ResourceManager(n.SR,"Fill"),k=u.getResource.bind(u),N=e.Common.CultureManager,(n=V=t.AutoFillType||(t.AutoFillType={}))[n.copyCells=0]="copyCells",n[n.fillSeries=1]="fillSeries",n[n.fillFormattingOnly=2]="fillFormattingOnly",n[n.fillWithoutFormatting=3]="fillWithoutFormatting",n[n.clearValues=4]="clearValues",n[n.auto=5]="auto",(u=q=t.FillDirection||(t.FillDirection={}))[u.left=0]="left",u[u.right=1]="right",u[u.up=2]="up",u[u.down=3]="down",(n=L=t.FillSeries||(t.FillSeries={}))[n.column=0]="column",n[n.row=1]="row",(u=B=t.FillType||(t.FillType={}))[u.direction=0]="direction",u[u.linear=1]="linear",u[u.growth=2]="growth",u[u.date=3]="date",u[u.auto=4]="auto",(n=W=t.FillDateUnit||(t.FillDateUnit={}))[n.day=0]="day",n[n.weekday=1]="weekday",n[n.month=2]="month",n[n.year=3]="year",f.prototype.jit=function(){return x(this.rit)},f.prototype.Oit=function(){for(var t=this,n=[],i=t.oit,r,e,r=0;r<x(i);r++)e=i[r],n.push("object"===t.uit?t.r0(e):e);return n},f.prototype.Rit=function(){var t,n,i,r,e,t=this,n=t.rit;if(0<x(n)){for(r=[],e=void 0,-1===(i=t.lit)&&(i=n[0]),e=0;e<x(n);e++)r[e]=n[e]-i+1;return r}return tt},f.prototype.Bit=function(){var t=this.oit;return x(t)?t:tt},f.prototype.Eit=function(t,n,i){if(!ut(i))throw new Error(k().Exp_NumberOnly);var r=this;nt(r.uit)&&(r.uit=i instanceof Date?rt:it),S(r.rit,t,n),S(r.oit,t,I(i))},f.prototype.ZP=function(t,n){var i=this,r=nt(i.uit);ut(n)?(r&&(n instanceof Date?i.uit=rt:i.uit=it),i.oit.push(I(n))):r&&(i.uit=st(n)?et:E),i.rit.push(t),i.ait.push(n)},f.prototype.Lit=function(t){return this.uit===rt?this.r0(t):t},f.prototype.r0=function(n){var i=tt;if(n instanceof Date)i=n;else if(r)try{i=r.Convert.r0(n)}catch(t){i=n}return i},ot=f,l.prototype.L0=function(){this.Mf=tt},l.prototype.Fit=function(){var t=this.Mf;return t.parent&&t.parent.Ow()||[]},l.prototype.Pit=function(t){var n,i,r,e,o,u,s,a,f,l,c,h,v,g,d,p,n=t.length,i=!1;if(t&&0<n)for(r=xt(t[0]),e=this.Fit(),l=f=a=s=u=o=void 0,o=0;o<e.length;o++)if(0<=(a=(s=(u=e[o]).map(xt)).indexOf(r))){for(f=a,c=s.length,g=v=h=void 0,d=1;d<n;d++){if(v=xt(t[d]),!(0<=(h=s.indexOf(v)))){i=!1;break}if(g=h-f+c,l){if(l!==g){i=!1;break}}else i=!0,l=g,f=h}if(p=1===n,i||p){i=!0,this.hit=a,this.dit=u,this.MV=p?1:l;break}}return i},l.prototype.Sl=function(t){var n=this.dit,i=this.hit,r=this.MV,e=n.length,o,u,u;return n[(i+r*v(t,e))%e]},$=l,kt.prototype.Sl=function(t){var t=this.MV*(t-1)+this.git,n=this._padding.length,t=""+Math.abs(t),i,r=this._padding+t,e=r.length,t=n<t.length?t:r.substr(e-n);return this.vit+t+this.mit},H=kt,w.prototype.match=function(t){return!1},w.prototype.getTargetValue=function(t,n,i,r,e){},w.prototype.resetProp=function(){},w.prototype.Git=function(t,n){return t.indexOf(n+1)},w.prototype.dispose=function(){},i(Vt,vt=u=w),i(m,gt=n=Vt),m.prototype.match=function(t){var n,i,r,e,n=this.Mit=d(t[0],t[1]),i=Mt(t),r=t.length,e=!0;return i&&2<r&&(e=Ot(t,n)),i&&e},m.prototype.getTargetValue=function(t,n){var i,t=t.ait[0],r=t.getFullYear(),e,o,u,t=t.getMonth()+this.Mit*(n-1);return new Date(r+parseInt(t/12,10),t%12,1)},z=m,i(y,dt=n),y.prototype.match=function(t){var n,i,r,e,n=this.Mit=d(t[0],t[1]),i=It(t),r=t.length,e=!0;return i&&2<r&&(e=Ot(t,n)),i&&e},y.prototype.getTargetValue=function(t,n){var i,t=t.ait[0],r=t.getFullYear(),e,o,u,t=t.getMonth()+this.Mit*(n-1),n=r+parseInt(t/12,10),r=t%12;return new Date(n,r,Et(n,r))},P=y,i(qt,pt=n),qt.prototype.match=function(t){var n,i,r,e,o,u,n=!1;return At(t)||(i=this.Mit=d(t[0],t[1]),e=0<(r=St(t)),o=t.length,u=!0,this.Uit=r,e&&2<o&&(u=Ot(t,i)),n=e&&u),n},qt.prototype.getTargetValue=function(t,n){var i,t=t.ait[0],r=t.getFullYear(),e,o,u,t=t.getMonth()+this.Mit*(n-1),n=r+parseInt(t/12,10),s;return new Date(n,t%12,this.Uit)},U=qt,i(Lt,wt=u),Lt.prototype.resetProp=function(){this.sit=[],this.yit=0,this.cit=tt,this.wit=!1,this.Cit=!1,this.Sit=!1},Lt.prototype.getInternal=function(t){for(var n,i,r,e,n=!1,i=t[0],e=1;e<t.length;e++)if(r=t[e],1!==Math.abs(r-i)){n=!0;break}return n},i(F,mt=n=Lt),F.prototype.dispose=function(){var t=this;t.Ait&&(t.Ait.L0(),t.Ait=tt)},F.prototype.match=function(t){return this.Ait.Pit(t)},F.prototype.getTargetValue=function(t,n,i,r,e){var o,t=t.ait.length,i=this.Git(i,r),r=tt,u;return r=-1!==i?this.Ait.Sl(u=t*e+i+1):r},G=F,i(Bt,yt=n),Bt.prototype.match=function(t){var n=this,i,r,r;return t.every(function(t){return!!(i=t.match(n.pit))&&((r=t.length)>n.yit&&p(t)&&(n.yit=r),r=parseInt(t,10),n.sit.push(r),!0)})},Bt.prototype.getTargetValue=function(t,n,i,r,e){var o=t.ait,u=this.Tit,s=c(this.sit),o=o.length,a=0!==s,n=a?0:v(n,o),i=this.Git(i,r),r=tt,f;return this.Cit=a,this.Sit=this.getInternal(t.rit),-1!==i&&(u.MV=s,u.git=this.sit[n],u._padding=g(this.yit),r=u.Sl(f=o*e+i+1)),r},J=Bt,i(Wt,_t=n),Wt.prototype.match=function(t){return Nt(this,t,!1)},Wt.prototype.getTargetValue=function(t,n,i,r,e){var o=t.ait,u=this.Tit,s=c(this.sit),o=o.length,a=0!==s,n=a?0:v(n,o),i=this.Git(i,r),r=tt,f;return this.Cit=a,this.Sit=this.getInternal(t.rit),-1!==i&&(u.vit=this.cit,u.MV=s,u.git=this.sit[n],u._padding=g(this.yit),r=u.Sl(f=o*e+i+1)),r},K=Wt,i($t,Ct=n),$t.prototype.match=function(t){return Nt(this,t,!0)},$t.prototype.getTargetValue=function(t,n,i,r,e){var o=t.ait,u=this.Tit,s=c(this.sit),o=o.length,a=0!==s,n=a?0:v(n,o),i=this.Git(i,r),r=tt,f;return this.Cit=a,this.Sit=this.getInternal(t.rit),-1!==i&&(u.mit=this.cit,u.MV=s,u.git=this.sit[n],u._padding=g(this.yit),r=u.Sl(f=o*e+i+1)),r},Q=$t,i(b,s=n),b.prototype.resetProp=function(){s.prototype.resetProp.call(this),this.Hit=tt},b.prototype.match=function(t){var n,i,r,i,n,r,e,e=this;return t.every(function(t){return!!(n=t.match(e.pit))&&(i=n[2],(r=i.length)>e.yit&&p(i)&&(e.yit=r),r=parseInt(i,10),i=n[1],nt(e.cit)&&(e.cit=i),n=n[3],nt(e.Hit)&&(e.Hit=n),i!==e.cit||n!==e.Hit?(e.wit=!0,e.cit=tt,e.Hit=tt,e.sit=[]):e.sit.push(r),!0)})},b.prototype.getTargetValue=function(t,n,i,r,e){var o=this,u=t.ait,s=o.Tit,a=c(o.sit),u=u.length,f=0!==a,n=f?0:v(n,u),i=o.Git(i,r),r=tt,l;return o.Cit=f,o.Sit=o.getInternal(t.rit),-1!==i&&(s.vit=o.cit,s.mit=o.Hit,s.MV=a,s.git=o.sit[n],s._padding=g(o.yit),r=s.Sl(l=u*e+i+1)),r},Y=["-","_",":",".",","],i(Ht,a=X=b),Ht.prototype.resetProp=function(){a.prototype.resetProp.call(this),this.zit=tt},Ht.prototype.match=function(t){var r,e,o,r,e,o,u,s,u=this;return t.every(function(n){var t,t,t,i,t=u.zit;if(s=nt(t)?Y.some(function(t){if(bt(n,t))return u.zit=t,!0}):bt(n,t)){if(t=u.zit,t=n.lastIndexOf(t),r=n.substring(0,t+1),nt(u.cit))u.cit=r;else if(u.cit!==r)return!1;if(t=n.substr(t+1),r=t.match(i=/^(\d+)(\D+.*)$/))return e=r[1],(o=e.length)>u.yit&&p(e)&&(u.yit=o),o=parseInt(e,10),e=r[2],nt(u.Hit)&&(u.Hit=e),e!==u.Hit?(u.cit=tt,u.Hit=tt,!(u.sit=[])):(u.sit.push(o),!0)}return!1})},Z=Ht,i(zt,Dt=u),zt.prototype.getTargetValue=function(t,n,i){return Tt(!0,t.Bit(),i,n)},at=zt,i(Pt,Ft=u),Pt.prototype.getTargetValue=function(t,n,i,r){var t=t.ait,e,o;return t[v(n,t.length)]},ft=Pt,Ut.prototype.getRule=function(t,n){var i,r,e,o,u,i=[],r=this.Nit;for(t===rt?(i=this.Iit,r=this.xit):t===et?i=this.kit:t===it&&(r=this.xit),e=0;e<i.length;e++)if(u=void 0,(o=i[e]).resetProp(),o.match(n)){if(u=o.wit,nt(u)||!1===u)return o;if(!0===u)return r}return r},Ut.prototype.L0=function(){var t=this;t.Iit&&(Gt(t.Iit),t.Iit=tt),t.kit&&(Gt(t.kit),t.kit=tt),t.xit&&(t.xit.dispose(),t.xit=tt),t.Nit&&(t.Nit.dispose(),t.Nit=tt)},t.nnt=Ut,R.prototype.qtt=function(t,n,i,r,e){var o=this,t=t?1:2;nt(r)&&nt(e)?o.$tt(n,i,t):o.$tt(n,i,t,r,e,tt)},R.prototype.$tt=function(t,n,i,r,e,o){var u,s,t,a,f,l,c,h,v,g,d,p,w,m,y,_,C,D,F,t,b,R,p,j,T,u=this,s=u.Mf,t=s.JS(t),a=t.row,f=t.col,l=t.rowCount,c=t.colCount;if(s.Ut.eE(a,f,l,c))throw new Error(k().Exp_RangeContainsMergedCell);for(m=0,_=(y=1===n)?c:l,D=y?a+l:f+c,F=(w=3<arguments.length)?1:_,b=(t=this.Mf.rt.Ktt).row===a&&t.rowCount===l&&t.col>f||t.col===f&&t.colCount===c&&t.row>a,h=C=y?a:f;h<D;h++)if(p=b&&w?a+l-1:a,(j=y?u.Vit(h,R=b&&w?f+c-1:f,1,F,n):u.Vit(p,h,F,1,n))&&j.jit())for(d=j.rit[0],w?(p=b?j.oit[x(j.oit)-1]:j.oit[0],v=u.Yit(b,p,_,i,r,e,o),b&&(m=_-x(v),d=j.rit[x(j.rit)-1])):v=u.Zit(j,_,i),g=0;g<x(v);g++)T=j.Lit(v[g]),y?u.Wit(s,h,d,h,f+m+g,T,i):u.Wit(s,d,h,a+m+g,h,T,i)},R.prototype.Vit=function(t,n,i,r,e){for(var o=tt,u=this.Mf,s,a=1===e,f=a?n+r-1:t+i-1,l=a?n:t;l<=f;)ut(s=a?u.getValue(t,f):u.getValue(f,n))&&(o=o||new ot(l)).Eit(0,f,s),f--;return o},R.prototype.Yit=function(t,n,i,r,e,o,u){for(var s,a,f,l,c,h,v,s=[],a=n,l=0<=e,c=nt(o),f=0;f<i;f++)h=o<=a,v=a<=o,t&&(c||l&&h||!l&&v)?(s.unshift(a),1===r?a-=e:2===r?a/=e:3!==r||nt(u)||(a=this.Qit(!0,u,n,a,e,f+1))):!t&&(c||l&&v||!l&&h)&&(s.push(a),1===r?a+=e:2===r?a*=e:3!==r||nt(u)||(a=this.Qit(!1,u,n,a,e,f+1)));return s},R.prototype.Zit=function(t,n,i){var r=[],e,o=1===i;if(o||2===i){for(1===t.jit()&&t.ZP(t.rit[0]+1,o?t.Lit(t.oit[0]+1):t.Oit()[0]),e=0;e<n;e++)r.push(Tt(!!o,t.Bit(),t.Rit(),e+1));return r}return tt},R.prototype.Jtt=function(t,n,i,r,e,o){var u,s,a,t,f,l,c,t,s,h,v,a,u=this,s=u.Mf,a=s.Ut,t=s.JS(t),f=t.row,l=t.col,c=t.rowCount,t=t.colCount,s=s.JS(s.rt.Ktt),h=s.row,v=s.col;if(a.GT(h,v,s.rowCount,s.colCount)||a.GT(f,l,c,t))throw new Error(k().Exp_ChangeMergedCell);return a=u.Kit(s,c,t,n,i,!(f<h||l<v),r,e,o),u.Jit&&u.Jit.IB&&(u.Jit.IB.reFilter(),delete u.Jit),a},R.prototype.Kit=function(t,n,i,r,e,o,u,s,a){var f=this,l=o?1:-1,c,h,v,g,d=t.row,p=t.col,w=t.rowCount,m=t.colCount;if(1===r){if(c=C(i/m),h=i%m,!e)for(g=1;g<c;g++)v=D(d,p+g*l*m,w,m),f.Tle(t,v,r,4,e,o,_,_,!0,u,s),f.Xit(t,v,r,4,e,o,_,_,!0,u,s);if(e&&1<c&&0===h&&(c-=1,h=m),0<c&&0<h)return v=D(d,o?p+c*m:p-c*m+m-h,w,h),f.Tle(t,v,r,4,e,o,tt,o?0:m-h,_,u,s),f.Xit(t,v,r,4,e,o,tt,o?0:m-h,_,u,s)}else{if(c=C(n/w),h=n%w,f.Dit||(v=D(d+l*w,p,n-w,i),f.qit(t,v,l,a)),!e)for(g=1;g<c;g++)v=D(d+g*l*w,p,w,m),f.Tle(t,v,r,4,e,o,tt,tt,!0,u,s),f.Xit(t,v,r,4,e,o,tt,tt,!0,u,s);if(e&&1<c&&0===h&&(c-=1,h=w),0<c&&0<h)return v=D(o?d+c*w:d-c*w+w-h,p,h,m),f.Tle(t,v,r,4,e,o,o?0:w-h,tt,!0,u,s),f.Xit(t,v,r,4,e,o,o?0:w-h,tt,!0,u,s)}},R.prototype.Xit=function(t,n,N,i,r,e,V,q,o,u,s){for(var a,f,L,l,B,c,h,v,g,W,$,H,d,z,P,U,p,w,m,y,_,C,D,F,b,G,R,j,T,x,J,k,M,c,I,S,K,Q,X,O,Y,Z,A,E,a=this,f=a.Mf,L=f.Ut,l=1===N,W=l?t.row:t.col,$=l?t.col:t.row,H=l?n.row:n.col,d=l?n.col:n.row,z=l?t.rowCount:t.colCount,P=l?t.colCount:t.rowCount,U=l?n.colCount:n.rowCount,v=0;v<z;v++){for(m=0,C=y=W+v,D=_=H+v,F=(l?q:V)||0,b=l?0:F,G=l?tt:o,R=w=p=tt;m<P;)if(x=void 0,J=j=$+m,k=T=d+m-F,l||(y=j,j=C,_=T,T=D),h=L.findSpan(y,j),x=f.getValue(y,j),(M=a.Dit)&&nt(R)&&(R=!1===e?f.getValue($+P-1,j):f.getValue(y,j)),M||4!==i||!ut(x)&&!st(x)||f.hasFormula(y,j)||(p=p||new ot,c=ut(x)?x instanceof Date?rt:it:et,(w=w||c)!==c))if(!M&&x&&p&&p.jit()){if(g=a.$it(l,t,n,C,D,p,r,e,b,G,u,s),r&&g)return g;w=p=tt}else{if(M||!h||h&&(l?h.row:h.col)===C)if(c=k===d+U-1,I=M?R:x,r){if(M)return I;if(h&&c||!h&&(c&&e||!e&&k===d))return x}else!(k<d+U&&d<=k)||!M&&!l&&(l||o&&f.XT&&f.XT(k))||M&&-1!==a._it.indexOf(_)||a.Wit(f,y,j,_,T,I,i,u,s);h?m+=l?h.colCount:h.rowCount:m++}else p.ZP(J,x),h?m+=l?h.colCount:h.rowCount:m++;if(a.Dit)for(S=t.row,K=t.col,Q=t.rowCount,X=t.colCount,Y=O=void 0,Z=!1===e?-1:1,A=1;A<Q;A++)for(O=S+Z*A,E=0;E<X;)Y=K+E,-1===a._it.indexOf(O)&&a.Wit(f,S,K,O,Y,R,i,u,s),E++;if(p&&p.jit()&&(g=a.$it(l,t,n,C,D,p,r,e,b,o,u,s),r)&&!nt(g))return g}return tt},R.prototype.Tle=function(t,n,N,i,r,e,V,q,L,o,u){var s,a,B,f,l,c,h,v,g,W,d,$,p,H,w,z,m,y,_,C,D,F,b,R,j,T,x,k,M,I,P,S,c,c,h,U,G,J,K,O,Q,X,A,E;if(!r){for(f=(B=(a=(s=this).Mf).Ut).yle(),W=(l=1===N)?t.row:t.col,d=l?t.col:t.row,$=l?n.row:n.col,p=l?n.col:n.row,H=l?t.rowCount:t.colCount,w=l?t.colCount:t.rowCount,z=l?n.colCount:n.rowCount,g=0;g<H;g++){for(_=0,F=C=W+g,b=D=$+g,R=(l?q:V)||0,j=l?0:R,T=l?tt:L,x=y=m=tt;_<w;)I=tt,P=k=d+_,S=M=p+_-R,l||(C=k,k=F,D=M,M=b),v=B.findSpan(C,k),c=a.getValueIgnoreDefault(C,k),nt(c)?_++:((c=f.getFormula(C,k))&&""!==c||(I=f.getValue(C,k)),(c=s.Dit)&&nt(x)&&(x=!1===e?f.getValue(d+w-1,k):f.getValue(C,k)),c||4!==i||!ut(I)&&!st(I)||(m=m||new ot,h=ut(I)?I instanceof Date?rt:it:et,(y=y||h)!==h)?!c&&I&&m&&m.jit()?(s.$it(l,t,n,F,b,m,r,e,j,T,o,u,!0),y=m=tt):((c||!v||v&&(l?v.row:v.col)===F)&&(h=c?x:I,!(S<p+z&&p<=S)||!c&&!l&&(l||L&&a.XT&&a.XT(S))||c&&-1!==s._it.indexOf(D)||s.Wit(a,C,k,D,M,h,i,o,u,!0)),v?_+=l?v.colCount:v.rowCount:_++):(m.ZP(P,I),v?_+=l?v.colCount:v.rowCount:_++));if(s.Dit)for(U=t.row,G=t.col,J=t.rowCount,K=t.colCount,Q=O=void 0,X=!1===e?-1:1,A=1;A<J;A++)for(O=U+X*A,E=0;E<K;)Q=G+E,-1===s._it.indexOf(O)&&s.Wit(a,U,G,O,Q,x,i,o,u,!0),E++;m&&m.jit()&&s.$it(l,t,n,F,b,m,r,e,j,T,o,u,!0)}return tt}},R.prototype.qit=function(t,n,i,r){var e,o,u,n,s,a,n,f,l,t,c,h,v,g,d,p,w,m,y,_,C,D,F,b,R,e=this,o=e.Mf,u=o.tables,n=t.union(n),s=n.row,a=n.rowCount,n=t.row,f=t.col,l=t.rowCount,t=t.colCount;if(u)for(h=0,v=c=u.AB(n,f,l,t);h<v.length;h++){if(d=(g=v[h]).Ky,p=g.iw,w=a,r)for(m=0,y=r;m<y.length;m++)if((_=y[m]).row===d&&_.col===p){w=_.rowCount,e.Jit=g;break}if(C=g.IB,D=e._it,F=void 0,C&&C.isFiltered&&C.isFiltered()){for(b=0;b<w;b++)C.isRowFilteredOut(F=s+i*b)&&e._it.push(F);if(0<D.length){e.Dit=!0;break}}}if(R=o.IB,!0!==e.Dit&&R&&R.isFiltered&&R.isFiltered()){for(D=e._it,F=void 0,b=0;b<a;b++)R.isRowFilteredOut(F=s+i*b)&&e._it.push(F);0<D.length&&(e.Dit=!0)}},R.prototype.Wit=function(t,n,i,r,e,o,u,s,a,f){var l,c,c,u,l=t.Ut;M&&(f?((c=l.yle().getExpression(n,i))&&t.hasFormula(n,i,3,!0)||!nt(t.getValueIgnoreDefault(n,i)))&&(0,h.copyDefaultFormula)(t,t,r,e,c):(t.hasFormula(n,i,3)||t.hasFormula(r,e,3))&&(t.setFormula(r,e,tt),0!==u&&4!==u||(t.getFormula(n,i)||l.getDefaultValue(n,i,tt,h.DefaultChangeValueType.Expression))&&T.CalcOperatorAdjustor.copyFormula(t,n,i,t,r,e,1,1,_,!0))),f||nt(t.getValueIgnoreDefault(n,i))&&!nt(l.getDefaultValue(n,i,tt,h.DefaultChangeValueType.Value))?l.getDefaultValue(n,i,tt,h.DefaultChangeValueType.Expression)||l.setDefaultValue(r,e,o,tt,h.DefaultChangeValueType.Value):t.setValue(r,e,o),f||(c=a?0:64,s&&(c|=4224),t.vT(n,i,r,e,1,1,c=c|1024|256,_,!0),a)||(t.removeSpan(r,e,3),(u=l.findSpan(n,i))&&n===u.row&&i===u.col&&t.EL(r,e,u.rowCount,u.colCount,3))},R.prototype.$it=function(t,n,i,r,e,o,u,s,a,f,l,c,h){var v,g,d,p,w,m,y,_,C,D,F,b,R,j,T,x,k,M,T,I,x,T,v=this,g=v.Mf,y=t?i.col:i.row,_=t?n.col:n.row,C=t?i.colCount:i.rowCount,D=t?n.colCount:n.rowCount;if(a=a||0,F=o.jit(),b=(y-_-a)/D,R=v.Cit(o.rit,o.oit),j=o.uit,R){for(w=[],p=0;p<F;p++)w[p]=p+1;d=F}else m=o.rit[0],d=o.rit[F-1]-m+1,1===F&&j!==et&&o.ZP(o.rit[0]+1,o.Lit(o.oit[0]+1)),w=o.Rit();for(p=0;p<d;p++)if(T=o.ait,M=k=x=void 0,I=y+C-1,T=(x=(M=(x=j!==rt&&j!==et?x:g.tnt&&g.tnt.getRule(j,T))?(k=x.getTargetValue(o,d*b+p+1,w,p,b),R=x.Cit||R,T=x.Sit||!1,R&&!T):(k=Tt(!0,o.Bit(),w,d*b+p+1),R))?o.rit[p]:m+p)+b*D,u){if(R&&(s&&T===I||!s&&T===y)||!R&&T+a===I)return o.Lit(k)}else T<y+C&&y<=T&&(t?f&&g.XT&&g.XT(r)||v.Wit(g,r,x,e,T,o.Lit(k),4,l,c,h):f&&g.XT&&g.XT(T)||v.Wit(g,x,r,T,e,o.Lit(k),4,l,c,h));return tt},R.prototype.Cit=function(t,n){var i,r,e,o,i=x(n);if(i<=1||x(t)!==i)return!1;for(r=t[1]-t[0],e=n[1]-n[0],o=2;o<i;o++)if(t[o]-t[o-1]!=r||n[o]-n[o-1]!=e)return!1;return!0},R.prototype.Xtt=function(t,n){var i=this,r=this.Mf,e=r.Ut.getSpans(),t=r.JS(t),o=t.row,u=t.col,s=t.rowCount,t=t.colCount,a,a=0===n?D(o,u+t-1,s,1):1===n?D(o,u,s,1):D(2===n?o+s-1:o,u,1,t);(a=r.nR(e,a))&&i.trt(a,o,u,s,t,n)},R.prototype.trt=function(t,n,i,r,e,o){var u=this,s=t.row,a=t.col,f=t.rowCount,l=t.colCount,c,h,v,g,d,p,w,m=u.Mf.Ut,y,d=0===o?(y=m.eE(n,i,r,e-l),p=0,w=-1*l,v=e,g=l,1):1===o?(y=m.eE(n,i+l,r,e-l),p=0,v=e,g=w=l,1):w=(g=2===o?(y=m.eE(n,i,r-f,e),p=-1*f,v=r,f):(y=m.eE(n+f,i,r-f,e),v=r,p=f),0);if(y)throw new Error(k().Exp_TargetContainsMergedCells);if(v%g!=0)throw new Error(k().Exp_MergedCellsIdentical);for(c=C(v/g),h=1;h<c;h++)u.Xit(t,D(s+h*p,a+h*w,f,l),d,0,_,_,_,_,!0)},R.prototype.Qit=function(t,n,i,r,e,o){var u,t,s,a,u=t?-1:1,t=C(o*e),s=Math.abs(e),a=A(1<n?i:r);if(0===n)a.setDate(a.getDate()+u*e);else if(1===n)for(;0<s;)a.setDate(a.getDate()+u*(0<e?1:-1)),6!==a.getDay()&&0!==a.getDay()&&s--;else 2===n?a.setMonth(a.getMonth()+u*t):a.setFullYear(a.getFullYear()+u*t);return O(a)},t.Wtt=R},"./dist/plugins/fill/fill.ns.js":function(t,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SR=void 0;var i=i("./dist/plugins/fill/fill.res.en.js");n.SR={en:i}},"./dist/plugins/fill/fill.res.en.js":function(t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Exp_ChangePartOfArray=n.Exp_RangeIsNull=n.Exp_CellReadOnly=n.Exp_RowReadOnly=n.Exp_ColumnReadOnly=n.Exp_ChangeMergedCell=n.Exp_FillCellsReadOnly=n.Exp_FillRangeContainsMergedCell=n.Exp_MergedCellsIdentical=n.Exp_TargetContainsMergedCells=n.Exp_RangeContainsMergedCell=n.Exp_NumberOnly=n.FillWithoutFormatting=n.FillFormattingOnly=n.FillSeries=n.CopyCells=void 0,n.CopyCells="Copy Cells",n.FillSeries="Fill Series",n.FillFormattingOnly="Fill Formatting Only",n.FillWithoutFormatting="Fill Without Formatting",n.Exp_NumberOnly="Only works for Numbers",n.Exp_RangeContainsMergedCell="Range should not have merged cells.",n.Exp_TargetContainsMergedCells="Target range should not have merged cells.",n.Exp_MergedCellsIdentical="This operation requires the merged cells to be identically sized.",n.Exp_FillRangeContainsMergedCell="Cannot fill range that contains a merged cell.",n.Exp_FillCellsReadOnly="The cells you are trying to fill are protected and therefore read-only.",n.Exp_ChangeMergedCell="Cannot change part of merged cell.",n.Exp_ColumnReadOnly="The column you are trying to change is protected and therefore read-only.",n.Exp_RowReadOnly="The row you are trying to change is protected and therefore read-only.",n.Exp_CellReadOnly="The cell you are trying to change is protected and therefore read-only.",n.Exp_RangeIsNull="range is null",n.Exp_ChangePartOfArray="Cannot change part of an array."},Common:function(t){t.exports=n.Spread},CalcEngine:function(t){t.exports=n.Spread.CalcEngine},Core:function(t){t.exports=n.Spread.Sheets},SheetsCalc:function(t){t.exports=n.Spread.Sheets.CalcEngine}},r={},t=e("./dist/plugins/fill/fill.entry.js"),(((n=void 0===n?{}:n).Spread=n.Spread||{}).Sheets=n.Spread.Sheets||{}).Fill=t}()});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grapecity-software/spread-sheets-fill",
|
|
3
|
-
"version": "17.0.
|
|
3
|
+
"version": "17.0.7",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description":"SpreadJS sheets fill module",
|
|
6
6
|
"scripts": {},
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"spreadjs"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@grapecity-software/spread-common": "17.0.
|
|
20
|
-
"@grapecity-software/spread-calc-engine": "17.0.
|
|
21
|
-
"@grapecity-software/spread-sheets-core": "17.0.
|
|
22
|
-
"@grapecity-software/spread-sheets-calc-engine": "17.0.
|
|
19
|
+
"@grapecity-software/spread-common": "17.0.7",
|
|
20
|
+
"@grapecity-software/spread-calc-engine": "17.0.7",
|
|
21
|
+
"@grapecity-software/spread-sheets-core": "17.0.7",
|
|
22
|
+
"@grapecity-software/spread-sheets-calc-engine": "17.0.7"
|
|
23
23
|
},
|
|
24
24
|
"author": {
|
|
25
25
|
"email": "info.xa@grapecity.com",
|