/*! * * Spread.Sheets Library 10.2.0 * * Copyright(c) GrapeCity, Inc. All rights reserved. * * Licensed under the SpreadJS Commercial License. * spread.sales@grapecity.com * http://spread.grapecity.com/spreadjs/eula/ * * */var GC=GC||{}; GC.Spread=function(U){function u(d){if(l[d])return l[d].exports;var J=l[d]={exports:{},id:d,loaded:!1};return U[d].call(J.exports,J,J.exports,u),J.loaded=!0,J.exports}var l={};return u.m=U,u.c=l,u.p="",u(0)}([function(U,u,l){GC=GC||{};GC.Spread=GC.Spread||{};GC.Spread=l(1);GC.Spread.CalcEngine=l(24);GC.Spread.CalcEngine.BasicFunctions=l(31);GC.Spread.CalcEngine.AdvancedFunctions=l(35);GC.Spread.Sheets=l(41);GC.Spread.Sheets.CellTypes=l(83);GC.Spread.Sheets.Bindings=l(89);GC.Spread.Sheets.Search=l(95);GC.Spread.Sheets.Outlines=l(97);GC.Spread.Sheets.Touch=l(101);GC.Spread.Sheets.FloatingObjects=l(104);GC.Spread.Sheets.Sparklines=l(111);GC.Spread.Sheets.Comments=l(115);GC.Spread.Sheets.ConditionalFormatting=l(119);GC.Spread.Sheets.Filter=l(122);GC.Spread.Sheets.Tables=l(127);GC.Spread.Sheets.Slicers=l(132);GC.Spread.Sheets.DataValidation=l(139);GC.Spread.Sheets.Fill=l(142);GC.Spread.Sheets.FormulaTextBox=l(148);U.exports=GC.Spread},function(U,u,l){u.Common=l(2);u.Commands=l(14);u.Formatter=l(17);u.Sparklines=l(20);u.Slicers=l(22)},function(U,u,l){function d(d,l){for(var K in l)l.hasOwnProperty(K)&&(d[K]=l[K])}var J;u=l(3);l(11);J=l(4);d(u,J);J=l(12);d(u,J);u.j=l(5);u.k=l(10);u.l=l(9);u.o=l(6);u.q=l(7);u.u=l(8);u.SR={};u.SR.en=l(13);U.exports=u},function(U,u,l){u={};var d=l(4).CultureManager;u.A=function(d,l,u,K){var J,H,I;if(d&&0<=u&&u=H&&J.push(I));l=J.length;for(I=0;I=this.J()&&q<=this.K()},q.L=function(){var q,A,r=K.eras;if(void 0!==r){q=[];for(A=0;AQ?Math.max(0,K+Q):Q;Qt&&(v=D(10,t),!(y&&10>m/v||!y&&1<=m*v));)t++;return f=(m=y?q(m)/D(10,t):q(m)*D(10,t),x=z(m,p,c,e,b,h),x+(a+(y?"+":"-")+O(""+t,3))),0>g&&(f="-"+f),[f,k]}function r(g,f,k,a,p,h){var m,c,e;return k=0>g?E[h.numberNegativePattern]:"n",-1===p&&(p=2),m=F(f),c=G(m),e=m-c,f=z(e,p,h.numberGroupSizes,h.numberGroupSeparator,h.numberDecimalSeparator,h.negativeSign),f=""+(c+(1<=+f?1:0))+f.substring(1),[f,k]}function n(g){var f,k={Za:g.charAt(0),$a:0,_a:0},a="";for(f=1;fa||9b&&(b=-b,c=0>g?h+O(c.replace(h,""),b+1):O(c,b+1),e=c.slice(-b,c.length)+e,c=c.slice(0,-b)),0f?e.slice(0,f):H(e,f),e=p+e):e="",!0===m?c+e:w(c,k,a,h)+e}function C(g,f,k){var a,p,h,m,c,e,b,v,t,y,n,E,r,C,M,d,A,ga,T,fa,Fa,aa,xa,Ia,la,pa,l="";if(g*=D(100,f.fb),g*=D(1E3,f.gb),g/=D(10,3*f.eb),a=f.ab,p=f.bb,!a&&!p)return"";if(h=null,m=null,a)for(h="",c=0;caa&&(aa=0),b.Ya=aa):(aa=0,-1!==Fa&&(aa=T.substr(Fa+1,void 0).length),b.Ya=aa),b);if(f.hb)if(y=q(g),c=h?h.length:1,1<=y)ba.Xa>c?(ba.Xa-=c,ba.Ya+=c,g/=D(10,ba.Xa),t=ba.Xa):t=(ba.Xay&&0n&&E=k.length&&E=n&&0>ga.indexOf(M)&&"##################0"===h&&"################"===m||(l+=M),0b&&(b=h.indexOf("E")),0>b?(e=h,t=null):(e=h.substr(0,b),t=h.substr(b+1,void 0)),B=e.indexOf("."),0>B?(v=e,y=null):(v=e.substr(0,B),y=e.substr(B+1,void 0)),v=v.split(",").join(""),n=",".replace(/\u00A0/g," "),","!==n&&(v=v.split(n).join("")),E=c+v,null!==y&&(E+="."+y),w=E[E.length-1],w===k.percentSymbol&&(E=E.substr(0,E.length-1),E=K.ib(E,""),q=E.indexOf("."),-1===q&&(q=E.length),z="",z+=E.substr(0,q-2),z+=".",z+=E.substr(q-2,2),z+=E.substr(q+1,void 0),E=z),null!==t&&(r=m(t,k,1),""===r[0]&&(r[0]="+"),E+="e"+r[0]+r[1]),E.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/)?F(E):NaN)}function m(a,f,k){var g=f.negativeSign;f=f.positiveSign;if(4!==k&&2!==k||(g=" "+g,f=" "+f),4===k||3===k){if(K.jb(a,g))return["-",a.substr(0,a.length-g.length)];if(K.jb(a,f))return["+",a.substr(0,a.length-f.length)]}else if(2===k||1===k){if(K.kb(a,g))return["-",a.substr(g.length,void 0)];if(K.kb(a,f))return["+",a.substr(f.length,void 0)]}else{if(0!==k)throw Error("");if(K.kb(a,"(")&&K.jb(a,")"))return["-",a.substr(1,a.length-2)]}return["",a]}function h(a,f,k){if(0!==q(G(a)-a))throw Error(d().Exp_BadFormatSpecifier);a=0<=a?a.toString(16):(4294967295+a+1).toString(16);return a=f?a.toLowerCase():a.toUpperCase(),!R(k)&&a.lengtha&&(f="-"+f);break;case "c":case "C":m=0>a?p[c.currencyNegativePattern]:M[c.currencyPositivePattern];-1===g&&(g=c.currencyDecimalDigits);f=z(q(a),g,c.currencyGroupSizes,c.currencyGroupSeparator,c.currencyDecimalSeparator,c.negativeSign);break;case "n":case "N":m=0>a?E[c.numberNegativePattern]:"n";-1===g&&(g=c.numberDecimalDigits);f=z(q(a),g,c.numberGroupSizes,c.numberGroupSeparator,c.numberDecimalSeparator,c.negativeSign);break;case "p":case "P":m=0>a?t[c.percentNegativePattern]:y[c.percentPositivePattern];-1===g&&(g=c.percentDecimalDigits);f=z(100*q(a),g,c.percentGroupSizes,c.percentGroupSeparator,c.percentDecimalSeparator,c.negativeSign);break;case "F":case "f":a=r(a,f,m,k,g,c);f=a[0];m=a[1];break;case "e":case "E":a=A(a,f,m,k,g,c);f=a[0];m=a[1];break;case "x":case "X":m="n";f=h(a,"x"===k.charAt(0),-1===g?0:g);break;case "g":case "G":B=""+a;a=-1===B.indexOf("e")&&-1===B.indexOf("E")?r(a,f,m,k,g,c):A(a,f,m,k.replace("g","e").replace("G","E"),g,c);f=a[0];m=a[1];break;default:throw Error(d().Exp_BadFormatSpecifier);}a=/n|\$|-|%/g;for(k="";w=a.lastIndex,e=a.exec(m),k+=m.slice(w,e?e.index:m.length),e;)switch(e[0]){case "n":k+=f;break;case "$":k+=c.currencySymbol;break;case "-":/[1-9]/.test(f)&&(k+=c.negativeSign);break;case "%":k+=c.percentSymbol;break;default:throw Error(d().Exp_InvalidNumberFormat);}a=k}else{w=g.NumberFormat;var b,v,N,S;k=m=e=null;B={ab:null,bb:null,cb:!1,eb:0,fb:0,gb:0,hb:null};var X="",Y=!1,D=!1,l=!1,F=!1,G=!1,ea=!1,ga=!1,T;b=null;for(var fa=[],g=0;ga&&(e=f.Va),e||(e=f.Wa),c=C(a,e,w)+"",1===c.indexOf(w.negativeSign)&&0===c.indexOf(w.currencySymbol)&&(c=c[1]+c[0]+c.substring(2)),c)}else a=g&&0\?])/,"\\$1")},l}();U.exports=u},function(U,u,l){function d(d,l,u,H){var K,L;if(!l)throw Error();return""===l||!(l.length>d.length)&&(K=d,L=l,u&&(K=K.toLowerCase(),L=L.toLowerCase()),H(K,L))}var J,R=l(5).Fa;J={Bb:function(d,l,u){return u&&(d=d.toLowerCase(),l=l.toLowerCase()),""===l||0<=d.indexOf(l)},Cb:function(d,l,u){var K,I;return u&&u?(K=d.toLowerCase(),I=l.toLowerCase(),K.indexOf(I)):d.indexOf(l)},Db:function(d,l){if(!l)return d;for(var u=d;u.substr(0,l.length)===l;)u=u.substr(l.length,void 0);return u},ib:function(d,l){if(!l)return d;for(var u=d;u.substr(u.length-l.length,l.length)===l;)u=u.substr(0,u.length-l.length);return u},Eb:function(d,l,u){var H,K;if(0>l||l>d.length||R(u))throw Error();return H=d.substr(0,l),K=d.substr(l,d.length-l),H+u+K},Fb:function(d,l,u){var H,K;if(R(u)&&(u=d.length-l),0>l||0>u||l+u>d.length)throw Error();return H=d.substr(0,l),K=d.substr(l+u,d.length-l-u),H+K},kb:function(l,u,O){return d(l,u,O,function(d,l){return d.slice(0,l.length)===l})},jb:function(l,u,O){return d(l,u,O,function(d,l){return d.slice(-l.length)===l})},Gb:function(d,l,u,H){if(!l||""===l)throw Error();return u=(""+u).replace(/\$/g,"$$$$"),d.replace(RegExp(l,"g"+(H?"i":"")),u)},Hb:function(d,u,O,H){return u=l(7).Ab(u),this.Gb(d,u,O,H)},Ib:function(d,l){var u=d.indexOf(l);return 0>u||u>=d.length?d:d.substr(0,u)},Jb:function(d,l){for(var u=0,H=d.indexOf(l);0<=H;)u+=1,H=d.indexOf(l,H+1);return u},yb:function(d,l,u){return d.split(l).join(u)},Kb:function(d,l){var u,H,I=d;for(u=0;ue?X.amDesignator:X.pmDesignator;break;case "t":a+=(12>e?X.amDesignator:X.pmDesignator).charAt(0);break;case "f":a+=O(N,3).charAt(0);break;case "ff":a+=O(N,3).substr(0,2);break;case "fff":a+=O(N,3);break;case "z":B=S/60;a+=(0>=B?"+":"-")+I(L(B));break;case "zz":B=S/60;a+=(0>=B?"+":"-")+O(I(L(B)),2);break;case "zzz":B=S/60;a+=(0>=B?"+":"-")+O(I(L(B)),2)+":"+O(L(S%60),2);break;case "g":case "gg":case "ggg":if(!C)break;if(f===x-1){f=x;break}a+=C.ia(P[0],n);f=x;break;case "e":case "ee":if(!C){a+=O(g?g[0]:B,4);break}if(h===x-1){h=x;break}a+=C.ia(P[0],n);h=x;break;case "/":a+=X.dateSeparator;break;case "[h]":case "[hh]":case "[H]":case "[HH]":case "[mm]":case "[ss]":a+=P[0];break;default:throw Error(d.C(d.SR)().Exp_InvalidDateFormat);}else a+=P[0];return""+a}function A(n,q){var w,c,m,h=0,a=!1;w=0;for(c=n.length;wq||31y||11y||11y||11V&&(F=u.ca(G).ea,V+=F-F%100,V>l.DateTimeFormat.Calendar.TwoDigitYearMax&&(V-=100)),V),0>B||9999B||9999E)return null;break;case "m":case "mm":if(p=H(V,10),0>p||59g||59f||999f||999f||999t||6t||6w||13b||59w||13a))return null}if(N=/^(\d|\d\d):/.test(n),S=N?new Date(1899,11,30):new Date,Y=c.Calendar.convert,Y&&(X=Y.fromGregorian(S)),Y||(X=[S.getFullYear(),S.getMonth(),S.getDate()]),null===B?B=X[0]:100>B&&(c.eras?B=c.eras.ga(a||0,B):B+=30<=B?1900:2E3),null===y&&(y=X[1]),null===q&&(q=X[2]),Y){if(S=Y.toGregorian(B,y,q),null===S)return null}else if((S.setFullYear(B,y,q),S.getDate()!==q)||null!==t&&S.getDay()!==t)return null;return x&&12>E&&(E+=12),S.setHours(E,p,g,f),null!==k&&(D=S.getMinutes()-(k+S.getTimezoneOffset()),S.setHours(S.getHours()+D/60,D%60)),S}return{mb:function(n,q,r){return r||(r=Q.q4()),D(n,q,r)},Vb:function(n,q,r){return D(n,q,r||Q.q4())},Qa:function(n,r,C){var c,m;return r||C||(m=F[n],void 0===m)?(c=r?[n,r]:[n],m=q(n,C||Q.q4(),c),r||C||(F[n]=m),m?new Date(m):m):m?new Date(m):m},lb:function(n,r){return q(n,Q.q4("invariant"),[n,r])},Wb:n,Xb:function(n){var q,w=n-25569,c=0<=w?1:-1,w=(new Date(864E5*w)).getTimezoneOffset();q=(124416E6*n+c-3181192704E6+864E5*w)/1440;n=new Date(q);var c=0<=w?1:-1,m=(new Date(q+36E5*c)).getTimezoneOffset();if(w!==m)if(q=new Date(q+6E4*(m-w)),w>m){if(-1===c||m===n.getTimezoneOffset())return q}else if(wl))for(J=K=0;Kl&&(l=-1);for(u=l+1;uG&&(G+=240),240G?d+((l-d)*G+20)/40:120>G?l:160>G?d+((l-d)*(160-G)+20)/40:d},l.gc=function(d,F,G){var q,D,A,r,n;return 0===G?q=D=A=K(255*F/240,10):(n=120>=F?(F*(240+G)+120)/240:F+G-(F*G+120)/240,r=2*F-n,q=parseInt((255*l.fc(r,n,d+80)+120)/240,10),D=parseInt((255*l.fc(r,n,d)+120)/240,10),A=parseInt((255*l.fc(r,n,d-80)+120)/240,10)),{a:255,r:q,g:D,b:A}},l.hc=function(d,l){var F,q=255-Q(d.r-l.r),D=255-Q(d.g-l.g),A=255-Q(d.b-l.b),r=Q(d.a-l.a);return q/=255,D/=255,A/=255,F=(q+D+A)/3,!!(.9<=F&&.05>=r)},l.ic=function(d){return l.bc(d.a,255^d.r,255^d.g,255^d.b)},l.ec=function(d){function F(n){var q,r=l.Yn;return r||(q=document.createElement("canvas"),q&&q.getContext&&(r=l.Yn=q.getContext("2d"))),r?(r.fillStyle=n,r.fillStyle):n}function G(n){var q,r=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,c=/^rgb\(([\s\d]*),([\s\d]*),([\s\d]*)\)$/i,m=/^rgba\(([\s\d]*),([\s\d]*),([\s\d]*),([\s\d]*)\)$/i,h=function(a){return K(a,16)},a=function(a){return K(a+a,16)},B=function(a){return 0=this.kc?this.mc=K((240*l+w/2)/w,10):this.mc=K((240*l+(510-w)/2)/(510-w),10),G=(40*(n-A)+l/2)/l,q=(40*(n-r)+l/2)/l,D=(40*(n-d)+l/2)/l,A===n?this.lc=K(D-q,10):r===n?this.lc=K(80+G-D,10):this.lc=K(160+q-G,10),0>this.lc&&(this.lc+=240),240d&&(d=0),240=m)return F;for(r=w;r=u[F][G])return I;return d(!1,u,J,K,O,l,H,L,null,Math.log,Math.exp)}}},function(U,u){U.exports={Exp_InvalidDateFormat:"Invalid date format pattern",Exp_InvalidExponentFormat:"invalid exponent format",Exp_InvalidSemicolons:"invalid format: too many semicolons",Exp_InvalidNumberGroupSize:"NumberGroupSize must be between 1 and 9.",Exp_BadFormatSpecifier:"Bad Format Specifier",Exp_InvalidNumberFormat:"Invalid number format pattern",Exp_InvalidCast:"InvalidCastException",Exp_Separator:"numberDecimalSeparator, listSeparator and arrayListSeparator should be different in cluture info."}},function(U,u,l){function d(d,l){for(var u in l)l.hasOwnProperty(u)&&(d[u]=l[u])}u={};d(u,l(15));d(u,l(16));U.exports=u},function(U,u){function l(d,l){var u=this;u.tc=d;u.j4=l;Object.defineProperty(u,"shortcutKey",{get:function(){return u.vc},set:function(d){var l,H,I,L=u.vc;L!==d&&(l=u.tc.wc,H=l[L],H&&(I=H.indexOf(u),0<=I&&H.splice(I,1)),u.vc=d,d&&(H=l[d],H||(l[d]=H=[]),H.splice(0,0,u)))}})}function d(d){this.xc=d;this.Ze={};this.wc={}}u={Key:{left:37,right:39,up:38,down:40,tab:9,enter:13,shift:16,ctrl:17,space:32,altkey:18,home:36,end:35,pup:33,pdn:34,backspace:8,del:46,esc:27,a:65,c:67,v:86,x:88,z:90,y:89}};l.prototype={canUndo:function(){return this.j4.canUndo},execute:function(d,l,u){var K,J,H=!0;try{K=this.j4.execute||this.j4,J=K(d,l,1===u),H=!1!==J}catch(I){H=!1}return l&&H&&this.tc.g4({command:l,result:J,s4:u}),J}};d.prototype={register:function(d,u,Q,K,O,H,I){u=new l(this,u);this[d]=u;Q&&(u.shortcutKey=this.getShortcutKey(Q,K,O,H,I))},getCommand:function(d){return self[d]},execute:function(d){var l=this[d.cmd];if(l)return l.execute(this.xc,d,0)},setShortcutKey:function(d,l,u,K,O,H){var I;if(d)(I=this[d])&&(I.shortcutKey=this.getShortcutKey(l,u,K,O,H));else if(I=this.getShortcutKey(l,u,K,O,H),l=this.getCommands(I))for(u=l.length-1;0<=u;u--)l[u].shortcutKey=void 0},getShortcutKey:function(d,l,Q,K,O){if(d){var H=65<=d&&90>=d?String.fromCharCode(d):u.Key[d];return H||(H=d),""+H+(l?"+ctrl":"")+(Q?"+shift":"")+(K?"+alt":"")+(O?"+window":"")}},getCommands:function(d){return this.wc[d]},addListener:function(d,l){this.Ze[d]=l},removeListener:function(d){delete this.Ze[d]},g4:function(d){var l,u=this.Ze;for(l in u)u.hasOwnProperty(l)&&u[l](d)}};u.CommandManager=d;U.exports=u},function(U,u){function l(d,l,u){this.xc=d;0>l&&(l=2147483647);this.yc=l;this.zc=u;this.Ac=[];this.Bc=[]}l.prototype={Cc:function(d,l){var u,J,K;if(d)if(1===l)this.Bc.push(d);else{if(u=this.yc,J=this.Ac.length,0=u)for(K=0;Kk&&(k=0)):0===k&&(e+=v);return""+e}function Q(b){return b=K(b,"[",""),K(b,"]","")}function K(b,e,k){return!b||b===G.Dc||H(e,k,!0)?b:(e=e.replace(A,"\\$1"),b.replace(RegExp(e,"g"),k))}function O(b){var e,k,a=b.length,v=!1,f="";for(e=0;ec-2){g=!0;break a}if(0=b},Gc:function(b){b=b.charCodeAt(0);return 9<=b&&13>=b||32===b||133===b||160===b}};D={Hc:0,Va:1,Ua:2,_text:3};A=RegExp("([.+?*$^\\[\\](){}|/])","g");r=["M/d MMM/d MMMM/d d/M d/MMM d/MMMM M-d MMM-d MMMM-d d-M d-MMM d-MMMM".split(" "),"M/y MMM/y M/yyyy MMM/yyyy M-y MMM-y M-yyyy MMM-yyyy".split(" "),"M/d/y MMM/d/y MMMM/d/y M/d/yyyy MMM/d/yyyy MMMM/d/yyyy d/M/y d/MMM/y d/MMMM/y d/M/yyyy d/MMM/yyyy d/MMMM/yyyy yyyy/M/d M-d-y MMM-d-y MMMM-d-y M-d-yyyy MMM-d-yyyy MMMM-d-yyyy d-M-y d-MMM-y d-MMMM-y d-M-yyyy d-MMM-yyyy d-MMMM-yyyy yyyy-M-d".split(" "),["H:m","h:m tt"],["H:m:s","h:m:s tt","H:m:s","h:mm:ss tt"],["H:m:s.FFF","h:m:s.FFF tt"],"M/d H:m;MMM/d H:m;MMMM/d H:m;d/M H:m;d/MMM H:m;d/MMMM H:m;M/y H:m;MMM/y H:m;M/yyyy H:m;MMM/yyyy H:m;M/d/y H:m;MMM/d/y H:m;MMMM/d/y H:m;M/d/yyyy H:m;MMM/d/yyyy H:m;MMMM/d/yyyy H:m;M-d H:m;MMM-d H:m;MMMM-d H:m;d-M H:m;d-MMM H:m;d-MMMM H:m;M-y H:m;MMM-y H:m;M-yyyy H:m;MMM-yyyy H:m;M-d-y H:m;MMM-d-y H:m;MMMM-d-y H:m;M-d-yyyy H:m;MMM-d-yyyy H:m;MMMM-d-yyyy H:m;M/d h:m tt;MMM/d h:m tt;MMMM/d h:m tt;d/M h:m tt;d/MMM h:m tt;d/MMMM h:m tt;M/y h:m tt;MMM/y h:m tt;M/yyyy h:m tt;MMM/yyyy h:m tt;M/d/y h:m tt;MMM/d/y h:m tt;MMMM/d/y h:m tt;M/d/yyyy h:m tt;MMM/d/yyyy h:m tt;MMMM/d/yyyy h:m tt;M-d h:m tt;MMM-d h:m tt;MMMM-d h:m tt;d-M h:m tt;d-MMM h:m tt;d-MMMM h:m tt;M-y h:m tt;MMM-y h:m tt;M-yyyy h:m tt;MMM-yyyy h:m tt;M-d-y h:m tt;MMM-d-y h:m tt;MMMM-d-y h:m tt;M-d-yyyy h:m tt;MMM-d-yyyy h:m tt;MMMM-d-yyyy h:m tt".split(";"),"M/d H:m:s;MMM/d H:m:s;MMMM/d H:m:s;d/M H:m:s;d/MMM H:m:s;d/MMMM H:m:s;M/y H:m:s;MMM/y H:m:s;M/yyyy H:m:s;MMM/yyyy H:m:s;M/d/y H:m:s;MMM/d/y H:m:s;MMMM/d/y H:m:s;M/d/yyyy H:m:s;MMM/d/yyyy H:m:s;MMMM/d/yyyy H:m:s;d/M/y H:m:s;d/MMM/y H:m:s;d/MMMM/y H:m:s;d/M/yyyy H:m:s;d/MMM/yyyy H:m:s;d/MMMM/yyyy H:m:s;yyyy/M/d H:m:s;M-d H:m:s;MMM-d H:m:s;MMMM-d H:m:s;d-M H:m:s;d-MMM H:m:s;d-MMMM H:m:s;M-y H:m:s;MMM-y H:m:s;M-yyyy H:m:s;MMM-yyyy H:m:s;M-d-y H:m:s;MMM-d-y H:m:s;MMMM-d-y H:m:s;M-d-yyyy H:m:s;MMM-d-yyyy H:m:s;MMMM-d-yyyy H:m:s;d-M-y H:m:s;d-MMM-y H:m:s;d-MMMM-y H:m:s;d-M-yyyy H:m:s;d-MMM-yyyy H:m:s;d-MMMM-yyyy H:m:s;yyyy-M-d H:m:s;M/d h:m:s tt;MMM/d h:m:s tt;MMMM/d h:m:s tt;d/M h:m:s tt;d/MMM h:m:s tt;d/MMMM h:m:s tt;M/y h:m:s tt;MMM/y h:m:s tt;M/yyyy h:m:s tt;MMM/yyyy h:m:s tt;M/d/y h:m:s tt;MMM/d/y h:m:s tt;MMMM/d/y h:m:s tt;M/d/yyyy h:m:s tt;MMM/d/yyyy h:m:s tt;MMMM/d/yyyy h:m:s tt;d/M/y h:m:s tt;d/MMM/y h:m:s tt;d/MMMM/y h:m:s tt;d/M/yyyy h:m:s tt;d/MMM/yyyy h:m:s tt;d/MMMM/yyyy h:m:s tt;yyyy/M/d h:m:s tt;M/d/yyyy h:mm:ss tt;M-d h:m:s tt;MMM-d h:m:s tt;MMMM-d h:m:s tt;d-M h:m:s tt;d-MMM h:m:s tt;d-MMMM h:m:s tt;M-y h:m:s tt;MMM-y h:m:s tt;M-yyyy h:m:s tt;MMM-yyyy h:m:s tt;M-d-y h:m:s tt;MMM-d-y h:m:s tt;MMMM-d-y h:m:s tt;M-d-yyyy h:m:s tt;MMM-d-yyyy h:m:s tt;MMMM-d-yyyy h:m:s tt;d-M-y h:m:s tt;d-MMM-y h:m:s tt;d-MMMM-y h:m:s tt;d-M-yyyy h:m:s tt;d-MMM-yyyy h:m:s tt;d-MMMM-yyyy h:m:s tt;yyyy-M-d h:m:s tt".split(";"),"M/d H:m:s.FFF;MMM/d H:m:s.FFF;MMMM/d H:m:s.FFF;d/M H:m:s.FFF;d/MMM H:m:s.FFF;d/MMMM H:m:s.FFF;M/y H:m:s.FFF;MMM/y H:m:s.FFF;M/yyyy H:m:s.FFF;MMM/yyyy H:m:s.FFF;d/M/y H:m;d/MMM/y H:m;d/MMMM/y H:m;d/M/yyyy H:m;d/mmm/yyyy H:m;d/MMMM/yyyy H:m;yyyy/M/d H:m;M/d/y H:m:s.FFF;MMM/d/y H:m:s.FFF;MMMM/d/y H:m:s.FFF;M/d/yyyy H:m:s;MMM/d/yyyy H:m:s.FFF;MMMM/d/yyyy H:m:s.FFF;d/M/y H:m:s.FFF;d/MMM/y H:m:s.FFF;d/MMMM/y H:m:s.FFF;d/M/yyyy H:m:s.FFF;d/MMM/yyyy H:m:s.FFF;d/MMMM/yyyy H:m:s.FFF;yyyy/M/d H:m:s.FFF;M-d H:m:s.FFF;MMM-d H:m:s.FFF;MMMM-d H:m:s.FFF;d-M H:m:s.FFF;d-MMM H:m:s.FFF;d-MMMM H:m:s.FFF;M-y H:m:s.FFF;MMM-y H:m:s.FFF;M-yyyy H:m:s.FFF;MMM-Yyyy H:m:s.FFF;d-M-y H:m;d-MMM-y H:m;d-MMMM-y H:m;d-M-yyyy H:m;d-MMM-yyyy H:m;d-MMMM-yyyy H:m;yyyy-M-d H:m;M-d-y H:m:s.FFF;MMM-d-y H:m:s.FFF;MMMM-d-y H:m:s.FFF;M-d-yyyy H:m:s;MMM-d-yyyy H:m:s.FFF;MMMM-d-yyyy H:m:s.FFF;D-M-y H:m:s.FFF;d-MMM-y H:m:s.FFF;d-MMMM-y H:m:s.FFF;D-M-yyyy H:m:s.FFF;d-MMM-yyyy H:m:s.FFF;d-MMMM-yyyy H:m:s.FFF;yyyy-M-d H:m:s.FFF;M/d h:m:s.FFF tt;MMM/d h:m:s.FFF tt;MMMM/d h:m:s.FFF tt;d/M h:m:s.FFF tt;d/MMM h:m:s.FFF tt;d/MMMM h:m:s.FFF tt;M/y h:m:s.FFF tt;MMM/y h:m:s.FFF tt;M/yyyy h:m:s.FFF tt;MMM/yyyy h:m:s.FFF tt;d/M/y h:m tt;d/MMM/y h:m tt;d/MMMM/y h:m tt;d/M/yyyy h:m tt;d/mmm/yyyy h:m tt;d/MMMM/yyyy h:m tt;yyyy/M/d h:m tt;M/d/y h:m:s.FFF tt;MMM/d/y h:m:s.FFF tt;MMMM/d/y h:m:s.FFF tt;M/d/yyyy h:m:s tt;MMM/d/yyyy h:m:s.FFF tt;MMMM/d/yyyy h:m:s.FFF tt;d/M/y h:m:s.FFF tt;d/MMM/y h:m:s.FFF tt;d/MMMM/y h:m:s.FFF tt;d/M/yyyy h:m:s.FFF tt;d/MMM/yyyy h:m:s.FFF tt;d/MMMM/yyyy h:m:s.FFF tt;yyyy/M/d h:m:s.FFF tt;M-d h:m:s.FFF tt;MMM-d h:m:s.FFF tt;MMMM-d h:m:s.FFF tt;d-M h:m:s.FFF tt;d-MMM h:m:s.FFF tt;d-MMMM h:m:s.FFF tt;M-y h:m:s.FFF tt;MMM-y h:m:s.FFF tt;M-yyyy h:m:s.FFF tt;MMM-Yyyy h:m:s.FFF tt;d-M-y h:m tt;d-MMM-y h:m tt;d-MMMM-y h:m tt;d-M-yyyy h:m tt;d-MMM-yyyy h:m tt;d-MMMM-yyyy h:m tt;yyyy-M-d h:m tt;M-d-y h:m:s.FFF tt;MMM-d-y h:m:s.FFF tt;MMMM-d-y h:m:s.FFF tt;M-d-yyyy H:m:s tt;MMM-d-yyyy H:m:s.FFF tt;MMMM-d-yyyy h:m:s.FFF tt;d-M-y h:m:s.FFF tt;d-MMM-y h:m:s.FFF tt;d-MMMM-y h:m:s.FFF tt;d-M-yyyy h:m:s.FFF tt;d-MMM-yyyy h:m:s.FFF tt;d-MMMM-yyyy h:m:s.FFF tt;yyyy-M-d h:m:s.FFF tt".split(";")];n=function(){return{pattern:r,formatter:["d-mmm","mmm-yy",v(void 0).DateTimeFormat.shortDatePattern,"h:mm","h:mm:ss","h:mm:ss.0",v(void 0).DateTimeFormat.shortDatePattern+" h:mm",v(void 0).DateTimeFormat.shortDatePattern+" h:mm:ss",v(void 0).DateTimeFormat.shortDatePattern+" h:mm:ss.0"]}};w=function(){function e(e,a){var v,f,g,p,c;this.Kc=a;f="\x3c\x3d \x3c\x3e \x3e\x3d \x3e \x3c \x3d".split(" ");p=0;for(c=f.length;pthis.type||3e;e++)if(k.Bb(b.Qb,f[e],1))return b.Qb=k.Gb(b.Qb,f[e],g[e],!0),!0;return!1},Gb:function(b,a,v,g,p,c,h){var m,t,T,x,y,n,B,N,E;if(g||p){m=[];t=!0;!f(b)&&e(b)&&(t=!1);T=!1;for(x=0;x=b.length||!H(a[B],b[B+x],h)){n=!1;break}if(N=x+a.length-1,n&&N+1N+1&&(x=E,n=!1)}n&&!T&&m.splice(0,0,x)}'"'===y&&(T=!T)}if(c.Qb=b,0f&&(z=r(f),X=r(f)-f);r=Math.pow(10,x-1);w=Math.pow(10,x)-1;2>r&&(r=2);2>w&&(w=2);x=!1;for(ia=0;r<=w&&(a=r*X,k=Math.round(a),e=k/r,S=p(e-X),!((!x||SS)));r++);if(a=z,k=C,e=M,x){M=k;x=e;if(0===M)S=p(x);else{if(0!==x)for(S=Math.max(M,x),M=Math.min(M,x),x=S%M;0!==x;)S=M,M=x,x=S%M;S=p(M)}f=(y=S,1f&&(b+=g.NumberFormat.negativeSign),0===f&&(b+="0"),c=this.Cd,h=parseFloat(c),isNaN(h)||0=t&&0<=t?k=parseFloat(""+m):k=parseFloat(""+(m-1))),n=this.Ed,B=parseFloat(n),isNaN(B)||0===B&&(N=n.length,E=""+k,q=E.length,N>q?n=n.substr(0,N-(N-q)):N=t&&0<=t?parseFloat(""+m):parseFloat(""+(m-1)),b+=d+"/"+e):(b+=V.mb(d,this.Gd(this.Ed),g).replace(/^0*/,""),b+="/",b+=V.mb(e,this.Gd(this.Cd),g).replace(/^0*/,"")),0===d?"0":b))}else f=""+f;c=f}else c=V.mb(f,this.Gd(this.Fd),g),h=this.Ad,m=this.Ic,t=this.Jc,y=this.cultureName,c=Z(t)||(M=F(m,t.type,y),Z(M))?c:(x=t.Pc(c,M,h),C=v(y),"ja-JP"===C.name()&&1p.indexOf(g)))break}else(aa.indexOf(e)?a:b},Jd:function(b){var e=v(this.cultureName).NumberFormat.percentSymbol,a=!0,f=b;return k.kb(b,e)?f=k.Fb(b,0,e.length):k.jb(b,e)?f=k.Fb(b,b.length-e.length,e.length):a=!1,k.Bb(f,e)&&(a=!1),{Ld:f,Kd:a}}};return b}();E=function(){function b(b,e,k,a){this.Ic=e;this.Jc=k;this.cultureName=a;0p(a)&&0!==a?this.Pd().format(b):this.Nd().format(b)}else{if(P(b,"string"))return e=k.Gb(this.formatString(),'"',""),e=O(e),e?k.Gb(e,"General",b):b;if(P(b,"boolean"))return(""+b).toUpperCase()}return""},parse:function(b){var e,a,f,v,g,c,h;return G.Ec(b)?null:"number"==typeof b?b:(e=!1,a=k.Cb(b,"-"),0f&&(g="-"+g);else try{g=a.format(b)}catch(Fa){P(b,"string")&&(g=""+b)}return g}return v&&0>f?"-":P(b,"string")?""+b:void 0===b||null===b?G.Dc:""+b},parse:function(b){return this.formatters&&0b.length||4k)?c=e:a?c=a:e&&(c=e),c):null},Td:function(b){var e,a;if(this.PropertyChanged)for(e=0;ea:vpa.dc(b)?ma:ea}function H(b,e,a,k,f,v,g){var p={};return g?(p.left=e+f+v,p.width=k-2*f,p.top=b+f,p.height=a-2*f):(p.left=b+f,p.width=a-2*f,p.top=e+f,p.height=k-2*f),p}function I(b,e){var a,k,f=0;a=0;for(k=b.length;aw&&(w=-1,S=!0),a=la(a)?"grey":a,e.save(),0===b?(n=v-10,B=.7*g,0<=w?(S&&(p=new d(k+5+n-5,f+g/2)),h=new J(k+5,f+g*(1-.7)/2,n*w,B),x=new d(k+5,f+1),t=new d(k+5,f+g),y=1):(N=X(n*w),S&&(p=new d(k+5+5,f+g/2)),h=new J(k+v-5-N,f+g*(1-.7)/2,N,B),x=new d(k+v-5,f+1),t=new d(k+v-5,f+g),y=3),T=g):1===b&&(ia=g-10,E=.7*v,0<=w?(r=ia*w,h=new J(k+(1-.7)/2*v,f+g-5-r,E,r),S&&(p=new d(k+v/2,f+g-5-r+5),y=0),x=new d(k+1,f+g-5),t=new d(k+v,f+g-5)):(w=X(w),h=new J(k+(1-.7)/2*v,f+5,E,ia*w),S&&(p=new d(k+v/2,f+5+ia-5),y=2),x=new d(k+1,f+5),t=new d(k+v,f+5)),T=v),e.beginPath(),F(e,h.x,h.y,h.width,h.height,a),q(e,h.x,h.y,h.width,h.height),p&&m(e,p.x,p.y,T,y),e.restore(),c(e,x.x,x.y,t.x,t.y),e.restore())}function a(b,e,a,k,f){e=v(e);a=v(a);k=v(k);f=v(f);e===k&&(k-=.5,e=k);a===f&&(f-=.5,a=f);b.moveTo(e,a);b.lineTo(k,f)}function B(b,e,k,f,v,g,p,c,h,m,x){b.beginPath();b.strokeStyle=k;e?a(b,f,v,g,p):a(b,c,h,m,x);b.stroke()}function y(b,e,a,k,f,v){var g,p,c=v.labelText;g=v.fontSize;var h=v.startBox,m=v.endBox,x=v.boxColor,t=v.isInRightOrTopOfBox;b.save();b.beginPath();b.font=g+Ia;p=ea;v.vertical?(v=fa,t?0b&&(b=0),1b&&(e=b),a=c?1:(b-h)/(c-h),v,g):E(b===c&&b===m?1:b<=c?0:b>=m?1:(b-c)/(m-c),g,p);e[a+f]=c}}))}function g(b){var e=b.getFullYear(),a=b.getMonth(),k=b.getDate();for(b=1;bS&&(S=0);t=this.setting.options;y=this.linePos=[];E=t.displayEmptyCellsAs;for(h=0;hm&&c.showNegative&&(h=y(c.negativeColor)),"undefined"!==typeof h&&h!==k||(g=p.sparklineType,0===g?c.showMarkers&&(h=y(c.markersColor)):1===g?h=y(c.seriesColor):2===g&&(h=y(c.seriesColor)))),h===x||h===k?"Transparent":h},ae:function(b,e,a,k,f,v,g,p){var c,h,m,x,t,y,n,T={Width:k,Height:f},B=this.ee(v,g),N=B.length,ia=this.options.sparklineType;for(f=0;fy&&(y=1),b.strokeStyle!==t&&(b.strokeStyle=t),b.lineWidth!==y&&(b.lineWidth=y),b.beginPath(),b.moveTo(e+h,a+x),b.lineTo(e+m,a+x),b.stroke())},me:function(b){var e,a=this.ne(b);return a===-oa||(e=this.oe(b),e===oa)||a===e||0>=a*e},ke:function(b,e){var a,f,v,g,p,c=this.me(b);if(2!==this.options.sparklineType)return c;if(a=this.ee(b,e),f=a.length,!c&&0p&&(p=f),fc&&(c=2),c}return(b.Width-this.ce(f)-this.ce(f))/2},te:function(b,e,a,k){var f;return this.options.displayDateAxis?this.se(b,e,a,k):(f=this.ee(e,a).length,(b.Width-this.ce(k)-this.ce(k))/f)},ue:function(b,e,a,k,f){var v,g,p,c,h,m,x,t,y=this.ce(f);return this.options.displayDateAxis?(v=this.te(b,a,k,f),g=this.re(a,k),p=this.pe(a,k),g===p?y+v/2:(c=k[e])?(h=b.Width-y-this.ce(f),h-=v,m=g-p,y+W((c-p)/m*h)):0):(v=this.te(b,a,k,f),x=ya(this.ee(a,k),e),t=y+v*x,W(t))},ve:function(e,a){var k,f=e.Width-this.ce(a)-this.ce(a);return f=b(f,0),k=e.Height-this.ce(a)-this.ce(a),k=b(k,0),{Width:f,Height:k}},je:function(b){var e,a,f=b.length;for(a=0;athis.$d&&(this.$d=e))},ne:function(b){var e,a;return this.$d!==-oa&&this.$d||this.je(b),e=this.setting.options,a=e.maxAxisType,0===a?this.$d:1===a?e.groupMaxValue:2===a?e.manualMax:this.$d},oe:function(b){var e,a;return this.Zd!==oa&&this.Zd||this.je(b),e=this.setting.options,a=e.minAxisType,0===a?this.Zd:1===a?e.groupMinValue:2===a?e.manualMin:void 0},we:function(b,e,a,k){b=this.ve(b,k);k=this.ne(a);var f=this.oe(a),v=k-f,g,p;if(k===f){if(0===k)return 0;v=X(k)}return g=a[e],g||(g=0),p=b.Height/v,g*p},xe:function(b,e,a,f){var v,g,p,c=this.options.sparklineType;if(0===c)return this.we(b,e,a,f);if(1===c){if(v=a[e],("undefined"===typeof v||v===k)&&1===this.setting.options.displayEmptyCellsAs)return 0;if(g=this.we(b,e,a,f),g>-this.Wd&&gv)return g-this.Wd}return g}return 2===c?(v=a[e],"undefined"===typeof v||v===k||0===v||isNaN(v)?0:(p=this.ve(b,f),0<=v?p.Height/2:-p.Height/2)):void 0},ye:function(b,e,a){var k,f=this.ve(b,a),v=this.ne(e),g=this.oe(e);if(v===-oa||g===oa)return b.Height/2;if(e=v-g,v===g){if(0===v)return b.Height/2;e=v;0>v&&(v=0)}return k=f.Height/e,this.ce(a)+v*k},le:function(b,e,a){return 2===this.options.sparklineType?b.Height/2:this.ye(b,e,a)},ze:function(b,e,a,f){var v,g;b=this.ve(b,f);f=this.ne(a);var p=this.oe(a),c=f-p;if(f===p){if(0===f)return 0;c=f}return v=b.Height/c,g=this.ge(e,a),"undefined"!==typeof g&&g!==k||(g=0),f!==p&&0-g&&vB&&(B=0),B=W(B),1===B%2&&(B+=1),p=this.xe(a,e,k,g),c=this.le(a,k,g),h=this.ne(k),m=this.oe(k),0>h&&0>m?x=b(this.ce(g),c):(x=c,0<=p&&(x=c-p)),t=this.Ae(a,e,k,g),y=new v(f,x,B,X(t)),0!==p&&(n=this.ce(g),y.YT&&y.Y>T-1&&(y.Y=T-t,y.Height=t))),y},de:function(b){b*=this.setting.options.lineWeight;return 1>b&&(b=1),b},he:function(b,e,a,f,g){var p,c,h,m,x,t=this.de(g);return t++,2>t&&(t=2),p=this.Be(b,e,a,f,g),0===this.options.sparklineType&&(p.X+=(p.Width-t)/2,c=this.ge(b,a),"undefined"!==typeof c&&c!==k?(0<=c?p.Y-=t/2:p.Y=p.Bottom-t/2,p.Width=t,p.Height=t):(p.Width=0,p.Height=0)),this.setting.options.rightToLeft&&(h=p.X,m=e.Width-h,x=m-p.Width,p=new v(x,p.Y,p.Width,p.Height)),p}};return a}();u.SparklineRender=l;u.SparklineExRenders={PIESPARKLINE:function(b,a,k,f,v,g){var p,c,h;k+=v/2;f+=g/2;var m=e(v,g)/2-5,x=-.5*P,t=k+m*Z(x),y=f+m*V(x),n=[],T=[];if(!(0>=m)){v=L(a.values,function(b){return!la(b)&&!ka(b)&&isFinite(b)},function(b){return X(b)},function(b){1===b.length&&(b[1]=1-b[0])});g=v.length;p=D(g,a.colors);c=I(v);b.save();for(h=0;hE?0:E;t=0;t=t>E?E:t;t=tc*x[M-1]&&(z=g[g.length-1],z&&(C=r(z.x,z.y,P,aa,h),g.push(new A(C,h,t)))),g.push(new A(P,aa,c)),M===y-1&&g.push(new A(P,h,t));a.beginPath();C=0;for(y=g.length;Ct?B:f,a.fill(),C!==y-1&&(a.beginPath(),a.lineTo(x.x,x.y))));m(n);m(T);a.restore()},SCATTERSPARKLINE:function(a,k,f,g,p,c){function h(b,e,k,f){r=b[e];S=r.x;C=r.y;r=b[e+1];aa=r.x;M=r.y;fa=Va+(S-d)*L/(ia-d);W=Va+(aa-d)*L/(ia-d);X=ra+(E-C)*ea/(E-N);Z=ra+(E-M)*ea/(E-N);ba&&w(a,fa,X,W,Z,k,ya);sa&&(0===e&&f(fa,X),f(W,Z))}function m(b,e,a,k,f){var v=n(b,!0);b=n(b,!1);N=la(Y)?v.y:e;E=la(Fa)?b.y:a;d=la(D)?v.x:k;ia=la(Ka)?b.x:f;ia=d>=ia?d+1:ia;E=N>=E?N+1:E}function x(b,e,k){a.beginPath();a.arc(b-2,e-2,2,0,2*P,!1);a.fillStyle=k;a.fill()}function t(b,e){a.beginPath();a.strokeStyle=u;a.arc(b-2,e-2,2,0,2*P,!1);a.stroke()}function y(b,e){a.beginPath();a.strokeStyle=ja;a.strokeRect(b-2,e-2,4,4)}var T,B,N,E,d,ia,r,S,C,aa,M,fa,X,W,Z,xa,V,A,Ia,Qa,Ca=k.points1,l=k.points2,D=k.minX,Ka=k.maxX,Y=k.minY,Fa=k.maxY,G=k.hLine,pa=k.vLine,ga=k.xMinZone,wa=k.xMaxZone,qa=k.yMinZone,Aa=k.yMaxZone,ka=k.tags,sa=k.drawSymbol,ba=k.drawLines,u=k.color1,ja=k.color2,ya=k.dash;k=H(f,g,p,c,5);var Va=k.left,ra=k.top,L=k.width,ea=k.height;if(!(!Ca||0>=Ca.length||(T=z(Ca),0>=T.length||l&&0=B.length)))){q(a,f,g,p,c);a.beginPath();sa=!!la(sa)||sa;u=la(u)?"#969696":u;ja=la(ja)?"#CB0000":ja;m(T,Y,Fa,D,Ka);!(la(ga)||la(wa)||la(qa)||la(Aa))&&d<=ga&&ga<=ia&&d<=wa&&wa<=ia&&N<=qa&&qa<=E&&N<=Aa&&Aa<=E&&(xa=b(d,ga),V=e(ia,wa),Ia=b(N,qa),Qa=e(E,Aa),xa>=V&&(V=xa+1),Ia>=Qa&&(Qa=Ia+1),F(a,Va+(xa-d)*L/(ia-d),ra+(E-Qa)*ea/(E-N),(V-xa)*L/(ia-d),(Qa-Ia)*ea/(E-N),"#DCDCDC"));p=-oa;c=-oa;V=xa=oa;f=0;for(g=T.length;fc&&(p=fa,c=X),Xc&&(p=W,c=Z),Zx&&(v=x);c=w?new J(a+f*c,e-v,f*h,v):new J(e,k+g*c,v,g*h);b.fillRect(c.x,c.y,c.width,c.height)}var c,h,m,x,t,y,T,n=e.measure,B=e.target,N=e.maxi,E=e.good,d=e.bad,q=e.forecast,ia=e.tickUnit,r=e.colorScheme,w=e.vertical;if(!(la(N)||0>N)){if(n=la(n)||0>n?0:n,E=la(E)||0>E?0:E,d=la(d)||0>d?0:d,B=la(B)?0:B,q=la(q)?0:q,ia=la(ia)?0:ia,r=la(r)?"#A0A0A0":r,c="#252525",n>N&&(n=N,c="#CB0000"),E>N&&(E=N,c="#CB0000"),d>N&&(d=N,c="#CB0000"),B>N&&(B=0,c="#CB0000"),q>N&&(q=N,c="#CB0000"),h=H(a,k,f,g,5,g-10,w),m=h.left,x=h.width,b.save(),p(qa(r,1.66),1,1,.2,.6),p(qa(r,1.33),E,N,.2,.6),p(r,d,N,.2,.6),p(c,n,N,.375,.25),0x&&(y=x),K(b,w,a+.5*f,t,a+.5*f,t-y,t,k+.5*g,t+y,k+.5*g,"#3690BF",3)),0=m)){h=d[0].key;m=d[m-1].key;r=la(r)?h:r;w=la(w)?m:w;S=la(S)?4:S;n=la(n)?"#646464":n;x=H(f,g,p,c,5,c-10,k);h=x.left;m=x.width;t=x.top;x=x.height;q(a,f,g,p,c);a.beginPath();a.strokeStyle=n;a.fillStyle=n;a.lineWidth=2;f=R(d,!1);g=0;for(p=d.length;gn?.5:n,c=t+x/2-n,n=t+x/2+n,K(a,k,c,y,n,y,y,c,y,n);else if(4===S)n=c*x/f,n=1>n?1:n,K(a,k,t,y,t+n,y,y,t+x,y,t+x-n);else if(6===S)K(a,k,t,y,t+x,y,y,t,y,t+x);else{if(3===S){N=c;n=x;E=T.randomNumbers;for(var P,z=[],C=b(100,10*N),aa=0,M=[],fa=0;z.lengthC))a:{var Z,xa=void 0;X=0;for(Z=M.length;Xz?z:a;k&&!k(a)||(a=0>a?0:a,g=a/z*y,Ca?(f=v(t-g)-.5,Q(b,n,f,n+T,f,e)):(f=v(t+g)-.5,Q(b,f,n,f,n+T,e)))}var h,m,x,t,y,n,T,B,N,E,d,q,r,ia,w=e.points,S=e.colorRange,P=e.labelRange,z=e.maximum,aa=e.targetRed,M=e.targetGreen,X=e.targetBlue,Z=e.targetYellow;x=e.color;var Qa=e.highlightPosition,Ca=e.vertical,W=e.textOrientation;e=e.textSize;if(!(la(w)||0>=(h=w.length))){if(x=la(x)?"#646464":x,la(S)||S.length!==h||C(S))for(S=[],m=0;m=e?10:e;e=ka(e)?e:e*p.zoomFactor;p=H(a,k,f,g,5,g-10,Ca);t=p.left;y=p.width;n=p.top;T=p.height;b.save();p=t;x=0;for(m=h;x=h||(B=h/z*y,Ca?(N=a+.15*f,d=.7*f,E=p-B,q=B):(N=p,d=B,E=k+.15*g,q=.7*g),r=x+1===Qa?"#CB0000":S[x],b.fillStyle=r,b.beginPath(),b.fillRect(N,E,d,q),ia=P&&P[x],ia&&(b.save(),b.fillStyle=O(r),b.textBaseline=xa,b.textAlign=fa,b.font=e+Ia,b.rect(N,E,d,q),b.clip(),b.beginPath(),1===W?(b.translate(N+d/2,E),b.rotate(Math.PI/2),b.fillText(ia,q/2,0)):b.fillText(ia,N+d/2,E+q/2),b.restore()),p+=(Ca?-1:1)*B);c("red",aa,function(b){return 0Qa&&(A=Qa,d=!0),AX(P)*z&&(M=X(P+D)*z),Z=x+n*t,wa&&CZ))){if(q(b,a,k,f,g),A>l?p(Y,0,5-t,t-5,0,1,k-C,aa,Fa,C-a-f,ga,T,-1,X(Qa-A)*z):(M>X(P)*z&&(M=X(P+D)*z,C=x),p(pa,1,-5,5,2,3,C-k-g,Fa,aa,a-C,T,ga,1,X(D-A)*z)),E&&(W=x+n*Math.abs(D-l)*z,h(a,W,a+f,W,W,k,W,k+g)),0=sa.length))){ya=ya===k||"string"!==typeof ya?"5ns":ya.toLocaleLowerCase();"5ns"!==ya&&"7ns"!==ya&&"tukey"!==ya&&"bowley"!==ya&&"sigma3"!==ya&&(ya="5ns");ra=ja(ra);ra=ka(ra)?wa:ra;pa=ja(pa);pa=ka(pa)?ga:pa;oa=ja(oa);Va=ja(Va);ma!==k&&"string"===typeof ma||(ma="#D2D2D2");(ea===k||0!==ea&&1!==ea)&&(ea=0);ra>wa&&(ma="#CB0000",ra=wa);pa=E-1.5*r&&Ca-(E-1.5*r)d&&Ca<=d+1.5*r&&d+1.5*r-Ca=d+1.5*r)&&(A=!0,M=Ca<=E-3*r||Ca>=d+3*r?0:1),"7ns"===ya&&(Ca<=t||Ca>=N)&&(A=!0,M=1),"sigma3"===ya&&(Ca<=C-2*z||Ca>=C+2*z)&&(A=!0,M=Ca<=C-3*z||Ca>=C+3*z?0:1),A&&(1===ea?1===M?m(.2,.8,aa,"#969696"):m(.3,.7,aa,"#969696"):(V=.1*c,2>V&&(V=2),a.beginPath(),a.strokeStyle="#969696",Ia=p+.45*c,l=aa,a.arc(O?Ia:l,O?l:Ia,V/2,0,2*Math.PI),a.stroke()));switch((ra>oa||paVa?ma="#CB0000":oara?qa:wa;qa=C+2*z;D=qa=m||(Ca=parseInt(Ca),ka(Ca)||0>=Ca||Ca>m)))){Qa=la(Qa)?[]:Qa;t!==k&&"string"===typeof t||(t="#8CBF64");P!==k&&"string"===typeof P||(P="#D6604D");x=t;t=qa(t,1.3);n=P;T=qa(P,1.3);N=1;w=r=d=E=0;S=[];z=P=0;for(ia=Z.length;zr?-r:0,aa[1]=0r?(M=r,W=r):(M=W,P=-W);V=ja(V);ka(V)||0>V||Vb?0:b,1=h||(S=parseInt(S),ka(S)||0>=S||S>h)))){z=la(z)?[]:z;ia=c(ia);C=c(C);M=parseInt(M);M=ka(M)?0:M;m=1;h=0;p=[];x=0;for(t=d.length;xn||ka(n)||la(n)?(T[0]=1===m?0:h,T[1]=0):(h+=n,T[0]=1===m?0:h-n,T[1]=n),m++;m=H(a,k,f,g,5,g-10,fa);N=m.left;E=m.width;d=m.top;x=m.height;r=fa?-1:1;m=E/h;q(b,a,k,f,g);b.beginPath();b.lineWidth=1;p=p[S];T=p[1];t=N+r*p[0]*m;n=p[1]*m;S=S===aa?"#CB0000":0===z.length||"string"!==typeof z[S-1]?"#969696":z[S-1];fa?F(b,d,t-n,x,n,S):F(b,t,d,n,x,S);1===M?w=(p[0]+T)/h*1E3:2===M&&(w=T/h*1E3);w=v(w)/10+"%";1!==M&&2!==M||""===w||y(b,a,k,f,g,{labelText:w,vertical:fa,isInRightOrTopOfBox:(p[0]+p[1])*mv;v++)vf;f++)for(g=0;7>g;g++)b.fillStyle=E[e++],b.fillRect(a+f*B+2*(f+1),k+g*N+2*(g+1),B,N);b.restore()},YEARSPARKLINE:function(b,e,a,k,f,v,c){var h,m,x,y,n,T,B,N=e.year;m=e.values;var E=e.emptyColor||"lightgray",d=e.startColor,q=e.middleColor,r=e.endColor,S=parseInt(366/7)+2;y=[];var w=(new Date(N,0,1)).getDay(),P=g(new Date(N,11,31));for(h=0;h<7*S;h++)hf;f++)x={x:e+c*h+2*(c+1),y:k+f*m+2*(f+1),w:h,h:m},v[a]=x,b.fillStyle=y[a++],b.fillRect(x.x,x.y,x.w,x.h);k=[];y={};for(a=0;12>a;a++)y[a]=g(new Date(N,a,1))-1+w;e=y[11]+t(N,12)-1;for(c=a=0;cf;f++)w<=a&&ar||(this.columnNames[r]=l,delete q[d.toUpperCase()],q[l.toUpperCase()]=r,this.cf(d,l,"onColumnNameChanged"))},onRowsAdded:function(d,l,A){var q,n,w,z,C,c,m,h;h=I(this.columnNames);var a=this.data,B=this.Oe,y=this.Pe,t=this.Qe,E=this.Re,M=this.Ge,p=this.Ye,g=this.Ee,f=this.Ie,k=this.Je;this._e=[];for(q=0;q=d&&(c[m]+=l);F.isEquals(w[C],null)&&(q=c,z=C)}q||(q=[],w.push(null),z=I(w)-1,this.Se[n][null]=z,t[n].push(q),M[n]&&-1===k.indexOf(n)&&(M[n][z]=!0,p[n].push(z)));for(w=d;w=d&&(f[q]+=l);for(q=I(a)-1;q>=d+l;q--)g[q]=g[q-l];n=0=d+l){c=!1;break}c||w.push(a[q][n[z]])}h[q]=[];B[q]={}}if(R(this,q),n&&A)for(z=0;z=d+l&&(w[C]-=l);for(q=0;qq)){if(this._e[q]||this.We(q),r=this._e[q],n=I(r),w=this.Xe(r,A),q=w.start,A=w.end,5===l)return q>=n?void 0:r[q];if(4===l)return 0>A?void 0:r[A];if(3===l)return An)){A?(this.Ce=!0,this.Me=n):this.Ce&&O(this,!1);0>q.indexOf(n)&&q.push(n);if(D.ranges){D=D.ranges;var w,z,C,c,q=this.getColumnIndex(d),n=this.Te;n[q]||this.We(q);d=[];n=n[q];for(w=0;w=C.start&&n[c]<=C.end&&(z[c]=!0);A?(this.Le=z,this.Ue=D):(this.Ve[q]=D,this.Fe[q]=z,delete this.Ge[q],delete this.Ye[q])}else{D=D.exclusiveRowIndexes;q=this.getColumnIndex(d);n={};for(d=0;dd||(delete this.Ve[d],delete this.Fe[d],delete this.Ge[d],delete this.Ye[d],J(this),q=this.Je.indexOf(d),0<=q&&this.Je.splice(q,1))},onFiltered:function(){0===this.$e&&this.cf({rowIndexes:this.getFilteredRowIndexes(),isPreview:this.Ce},"onFiltered")},getListener:function(){return this.Ze}},G}();F=function(){function d(){}return d.quickSort=function(d){var q,l=I(d),r=[];for(q=0;q=I(d))return d;q=Math.floor(I(d)/2);q=d[q];l=[];r=[];n=[];for(w=0;wz?l.push(d[w]):0l.toLowerCase():d>l:"number"===typeof l},d.sortCompare=function(d,l){var q=H(d)||""===d||"number"===typeof d&&isNaN(d),r=H(l)||""===l||"number"===typeof l&&isNaN(l);return q&&r?0:q?1:r?-1:this.isEquals(d,l)?0:this.isGreaterThan(d,l)?1:-1},d}();U.exports={FilteredOutDataType:{all:0,byCurrentColumn:1,byOtherColumns:2},SlicerAggregateType:{average:1,count:2,counta:3,max:4,min:5,product:6,stdev:7,stdevp:8,sum:9,vars:10,varp:11},GeneralSlicerData:L,jf:F}},function(U,u,l){u=l(25);l(27);l(28);l(29);u.SR={};u.SR.en=l(30);U.exports=u},function(U,u,l){function d(b){return b&&b.toUpperCase()}function J(b,e){var a=new X(12);return a.value=b,a.needExpendIndexs=e,a}function R(b){var e=new X(3);return e.value=b,e}function Q(b){var e=new X(2);return e.value=b,e}function K(){}function O(b,e){return"number"===typeof b||b instanceof Date||!e&&("boolean"===typeof b||!isNaN(b)&&!isNaN(parseFloat(b)))}function H(b){return b instanceof f}function I(b){return b instanceof N}function L(b){return b instanceof S}function F(b,e,a,f,g,v){var p;if(b&&b.length&&b.rowCount&&b.colCount)return b;if(I(b))p=b.toArray(e,a,f,g,v),p.isArray=!0;else if(L(b))p=b.toArray(e,a,f,g,v),p.isReference=!0;else if(n(b)&&0=v&&(p=b[0]+b[1]+b[2],p=p.toUpperCase(),!pa[p]))||"/"===b[0]||"/"===b[b.length-1]||(c=new Date(b),K.Qh(c.valueOf())))return!1;c=m.Ra(c)}g&&(c/=100)}else if("boolean"===a)c=b?1:0;else{if(!(b instanceof Date))return!1;c=m.Ra(b)}}catch(jb){return!1}return e.value=c,!0}function A(b,e){try{if(b){if("boolean"!==typeof b)if(b instanceof Date)b=0!==m.Ra(b);else{if(!O(b))return!1;b=0!==b}}else b=!1}catch(wa){return!1}return e.value=b,!0}function r(b,e){var a,f,k,g;if(b)if(b instanceof Date)e.value=new Date(b);else if("string"===typeof b){if(a=qa.l.Qa(b),!a)if(isNaN(b)){if(a=new Date(b),isNaN(a.valueOf()))return!1;try{if(f=/^[-+=\s]*(\d+)\W+(\d+)\W+(\d+)$/,k=h.ib(h.Db(b.replace(/ |\n/g,"")," ")," "),g=f.exec(k),g&&4===g.length&&(-1===g.indexOf(""+a.getYear())||-1===g.indexOf(""+a.getMonth())||-1===g.indexOf(""+a.getDate())))return!1}catch(Da){return!1}}else if(a=qa.l.Xb(parseFloat(b)),!a)return!1;e.value=a}else{if("number"!==typeof b)return!1;e.value=qa.l.Xb(b)}else e.value=qa.l.Xb(0);return!0}var n,w,z,C,c,m,h,a,B,y,t,E,M,p,g,f,k,x,W,P,V,Z,e,b,v,N,S,X,Y,ka,ja,oa,ma,ea,ga,T,fa,Fa,aa,xa,Ia,la,pa,qa=l(26),ba={},ra=ba.Functions={},ya="#NULL! #DIV/0! #VALUE! #REF! #NAME? #N/A #NUM!".split(" "),sa=[0,7,15,23,29,42,36];ba.ErrorList=ya;u=qa.j;n=u.Ca;u=u.Ia;w=ba.BAND_INDEX_CONST=-2147483648;z=ba.MAX_ROW_COUNT=1048576;C=ba.MAX_COLUMN_COUNT=16384;c=qa.j.G;m=qa.l;h=qa.u;a=function(){return qa.C(ba.SR)()};B=["o","n","s","b","d"];y=ba.kf=function(b,e,a,f){return{row:b,col:e,rowCount:a,colCount:f}};t=null;E=void 0;M=Math.abs;ba.BangSource={};ba.RefErrorSource={};ba.supportRowColumnFormula=!1;p=qa.A;g=qa.B;f=function(){function b(e){e=b.nf(e);if(!e)throw a().Exp_NotSupported;this._error=e.error;this._code=e.code}return b.prototype.toString=function(){return this._error},b.prototype.clone=function(){return new b(this._error)},b.prototype.toJSON=function(){return{_calcError:this._error,_code:this._code}},b.parse=function(e){try{return new b(e)}catch(wa){return E}},b.nf=function(b){var e,a;if(b)for(e=0;ek&&(x=a,a=k,k=x,x=v,v=c,c=x),f>g&&(x=f,f=g,g=x,x=p,p=h,h=x),m.row=a,m.column=f,m.endRow=k,m.endColumn=g,m.rowRelative=v,m.columnRelative=p,m.endRowRelative=c,m.endColumnRelative=h,b&&(m.source=b),e&&(m.endSource=e),m};N=ba.CalcArray=function(b){this.array=b};N.prototype={getRowCount:function(){return this.array.length},getColumnCount:function(){return this.array[0].length},getValue:function(b,e){var a=this.array;return b.row!==E&&(b=b.row,e=b.column),0>b||0>e||b>=a.length||e>=a[0].length?k:this.array[b][e]},getValueByIndex:function(b){var e=this.getColumnCount();return this.getValue(Math.floor(b/e),b%e)},toArray:function(b,e,a,f,k){var g,v,p,c,h,m,x=[],t=K.CalcConvertedError;e=e===E||e;h=this.getRowCount();m=this.getColumnCount();for(p=0;pb?0:b;e=0>e?0:e;a=b+a>this.getRowCount()?this.getRowCount()-b:a;f=e+f>this.getColumnCount()?this.getColumnCount()-e:f;for(g=0;g=C?v%C:v):v=b.column,b.sf?(f.col=v,f.colCount=1):(b.endColumnRelative?(p=b.endColumn+a,p=p>=C?p%C:p):p=b.endColumn,f.col=v<=p?v:p,f.colCount=M(p-v)+1)),b.isFullColumn?(f.row=-1,f.rowCount=-1):(b.rowRelative?(k=b.row+e,k=k>=z?k%z:k):k=b.row,b.sf?(f.row=k,f.rowCount=1):(b.endRowRelative?(g=b.endRow+e,g=g>=z?g%z:g):g=b.endRow,f.row=k<=g?k:g,f.rowCount=M(g-k)+1)),f};ka=ba.CalcSource=function(){function b(e){this.id=b.sourceId++;this.Af=e;this.Bf=null}return b.sourceId=1,b}();ka.prototype={getCalcService:function(){return this.Af},Cf:function(){return this.Af},setCalcService:function(b){this.Af=b},getCalcSourceModel:function(){return this.Bf},setCalcSourceModel:function(b){this.Bf=b},getValue:function(b,e){return t},getName:function(){return""},setValue:function(b,e){},getReference:function(b){return new S(this,b)},getSources:function(b){return[this]},referenceToArray:function(b,e,a,f,g,v){var p,c,h,m,x,d,y,n,T,B,N,q,S=1,w=1,r=[],P=b.getRangeCount();if(0===P)return r.isError=!0,[];y=this.getRowCount();n=this.getColumnCount();a=a===E||a;for(T=0;Tthis.Ef&&(this.Ef=b)),f&&(k=f[e],a&&!k&&(k=f[e]={},e>this.Ff&&(this.Ff=e)))):-1===b&&0<=e?(k=this.If[e],a&&!k&&(k=this.If[e]={},e>this.Ff&&(this.Ff=e))):0<=b&&-1===e?(k=this.Hf[b],a&&!k&&(k=this.Hf[b]={},e>this.Ff&&(this.Ff=e))):-1===b&&-1===e&&(k=this.Jf,a&&!k&&(k=this.Jf={})),k},getNodeByName:function(b,e){var a=this.dataTableByName[b];return e&&!a&&(a=this.dataTableByName[b]={}),a},Kf:function(b,e){var a=this.getNode(b,e);return a&&a.Lf},Mf:function(b,e){var a=this.getNode(b,e);return a&&a.Nf},getExpr:function(b,e){return this.Kf(b,e)},getArray:function(b,e){return this.Of(b,e)},Of:function(b,e){var a=this.getNode(b,e);return a&&a.Pf},Qf:function(b,e){var a=this.getWorkingNode(b,e);return a&&a.Pf},getWorkingExpression:function(b,e){var a=this.getWorkingNode(b,e);return a&&a.Nf},getExpression:function(b,e){var a=this.getWorkingNode(b,e);return a&&a.Lf},getWorkingExpressionByName:function(b){return(b=this.getNodeByName(b))&&b.Nf},getExpressionByName:function(b){return(b=this.getNodeByName(b))&&b.Lf},clearAll:function(){this.clear(-1,-1,-1,-1);this.dataTable={};this.dataTableByName={};this.Hf=[];this.If=[];this.Jf=t},clear:function(b,e,a,f){this.$b(b,e,a,f)},addRows:function(b,e){var a;a=this.rC();if(!(0>b||b>a||0>e))for(p(this.dataTable,a,b,e),p(this.Hf,a,b,e),a=0;ab||b>=a||0>=e||(b+e>a&&(e=a-b),g(this.dataTable,a,b,e),g(this.Hf,a,b,e))},addColumns:function(b,e){var a,f,k=this.rC(),g=this.cC();if(!(0>b||b>g||0>e)){for(a=0;ab||b>=v||0>e)){for(a=0;ab?0:b,e=0>e?0:e,v=this.Cf(),v&&(this.$b(b,e,a,f),k)){try{p=k?v.parse(this.xf,k,b,e,!1,g,g):t}catch(Ra){if(!g)throw Ra;return}for(k=b;k=f.getRowCount()||e>=f.getColumnCount()?a:(0<=b&&0<=e?(a=this.getNode(b,e),a||(a=this.getNode(b,-1)),a||(a=this.getNode(-1,e))):a=0<=b&&-1===e?this.getNode(b,-1):-1===b&&0<=e?this.getNode(-1,e):this.getNode(-1,-1),a)},fg:function(b,e,a,f,k){var g,v,p,c,h=this.Cf();h.oia&&h.lh.asyncManager.endCalcCell();g=f!==E&&null!==f;v=new ba.EvaluateContext(this.xf,Z(g?f.row:b,g?f.col:e),g);g=la(v,a,g,g?b-f.row:0,g?e-f.col:0);g=g===a?E:g;f!==E&&(p=f);0<=b&&0<=e?((k===E||k)&&(c=a?h.unparse(this.xf,a,0<=b?b:0,0<=e?e:0):E,this.xf.setFormula(b,e,c)),this.ig(b,e,a,g,p)):0<=b&&-1===e?this.jg(b,a,g):-1===b&&0<=e&&this.kg(e,a,g);h.autoCalculation&&!h.IsSuspended()&&h.recalculateAll(!1)},gg:function(b,e,a,f){var k;a=this.Cf();var g=new ba.EvaluateContext(this.xf,Z(0,0),!1),g=la(g,e,!1,0,0),g=g===e?E:g;(f===E||f)&&(k=e?a.unparse(this.xf,e,0,0):E,this.xf.setFormulaByName(b,k));this.lg(b,e,g);a.autoCalculation&&!a.IsSuspended()&&a.recalculateAll(!1)},getRowExpression:function(b){return this.getExpression(b,-1)},getColumnExpression:function(b){return this.getExpression(-1,b)},lg:function(b,e,a){var f,k=this.mg(b,!0);k&&(k.ng(),f=this.getNodeByName(b,!0),f.Lf=e,a=e&&a?a:void 0,f.Nf=a,k.og(),this.Af.pg(k,3))},ig:function(b,e,a,f,k){var g;(g=this.qg(b,e,!0))&&(g.ng(),this.Rf(b,e,a),a?((f||this.Mf(b,e))&&this.Wf(b,e,f),(k||this.Qf(b,e))&&this.Xf(b,e,k)):(this.Wf(b,e,E),this.Xf(b,e,E)),g.og(),this.Af.pg(g,0))},jg:function(b,e,a){var f=this.rg(b,!0);f&&(f.ng(),this.Rf(b,-1,e),(a||this.Mf(b,-1))&&this.Wf(b,-1,a),f.og(),this.Af.pg(f,1))},kg:function(b,e,a){var f=this.sg(b,!0);f&&(f.ng(),this.Rf(-1,b,e),(a||this.Mf(-1,b))&&this.Wf(-1,b,a),f.og(),this.Af.pg(f,2))},$b:function(b,e,a,f){var k,g,v,p,c=this,h=0>b?0:b,m=0>e?0:e;a=0>b?c.rC():a;p=0>e?c.cC():f;f=h+a-1;var x=m+p-1,d=function(b,e){if(k=c.Mf(b,e),g=c.Kf(b,e),k||g){var a=(v=c.Of(b,e))?y(v.row,v.col,v.rowCount,v.colCount):E;c.fg(b,e,t,a,!0)}};for(a=h;a<=f&&0<=a;a++)for(0>e&&d(a,-1),p=m;p<=x&&0<=p;p++)a===h&&0>b&&d(-1,p),d(a,p);0>b&&0>e&&d(b,e)},dg:function(b,e,a,f){return this.tg(b,e,a,f,!0,!0)},tg:function(b,e,a,f,k,g){var v,p,c,h=0>b?0:b,m=0>e?0:e;b=0>b?this.rC():a;f=0>e?this.cC():f;e=h+(0===b?1:b)-1;var x=m+(0===f?1:f)-1,t=!1,d=[],n=[],T=this.dataTable;for(a=h;a<=e&&0<=a&&!(a>this.Ef);a++)if(b=T[a])for(v=m;v<=x&&0<=v&&!(v>this.Ff);v++)if(f=b[v])if(p=f.Pf){if(p.rowe||p.colx){if(k)return!0;t=!0}if(a===p.row||a===h)d.push(y(p.row,p.col,p.rowCount,p.colCount)),c=f.Lf,n.push(c),v=p.col+p.colCount-1}else!g&&(c=f.Lf)&&(d.push({row:a,col:v}),n.push(c));return!k&&{hasPart:t,ranges:d,formulas:n}},mg:function(b,e){var a=t,f=this.getNodeByName(b,e);return f&&(a=f.calc,!a&&e&&(a=new T(this,b),f.calc=a,a.node=f)),a},qg:function(b,e,a){var f,k,g,v=t;if(0<=b&&0<=e){if(f=this.dataTable,k=f[b],!k){if(!a)return v;k=f[b]={};b>this.Ef&&(this.Ef=b)}if(g=k[e],!g)return a&&(g=k[e]={},v=new oa(this,b,e),g.calc=v,v.node=g,e>this.Ff&&(this.Ff=e)),v;v=g.calc;!v&&a&&(v=new oa(this,b,e),g.calc=v,v.node=g,b>this.Ef&&(this.Ef=b),e>this.Ff&&(this.Ff=e))}return v},rg:function(b,e){var a=t;return 0<=b&&(a=this.Yf(b,-1),!a&&e&&(a=new ma(this,b),this.Zf(b,-1,a),b>this.Ef&&(this.Ef=b))),a},sg:function(b,e){var a=t;return 0<=b&&(a=this.Yf(-1,b),!a&&e&&(a=new ea(this,b),this.Zf(-1,b,a),b>this.Ff&&(this.Ff=b))),a},ug:function(b){return!this.vg&&b&&(this.vg=new fa(this)),this.vg},wg:function(b,e){var a=t;return this.xg||(this.xg={}),a=this.xg[b],!a&&e&&(a=this.xg[b]=new ga(this,b)),a},yg:function(b,e){var a,f,k=Math.min(this.Ff,b+e-1);for(a=b;-1!==a&&a<=k;a++)this.isDirty(-1,a)&&(f=this.sg(a,!0),this.Af.pg(f,2))},zg:function(b,e){var a,f,k=Math.min(this.Ef,b+e-1);for(a=b;-1!==a&&a<=k;a++)this.isDirty(a,-1)&&(f=this.rg(a,!0),this.Af.pg(f,1))},Ag:function(b,e,a,f){var k,g,v,p=Math.min(this.Ef,b+a-1),c=Math.min(this.Ff,e+f-1);for(k=b;k<=p;k++)for(g=e;g<=c;g++)this.ega(k,g)&&(v=this.qg(k,g,!0),this.Af.pg(v,0));this.zg(b,a);this.yg(e,f);(k=this.ug(!1))&&k.Bg(b,e,a,f)},Cg:function(){var b,e,a,f,k,g=this.ag();for(a=0;athis.mh&&(this.mh=0);this.IsSuspended()||(this.rh=t,this.qh=!1,this.recalculateAll(b))},suspendAdjust:function(){this.Fia++},resumeAdjust:function(){this.Fia--;0>this.Fia&&(this.Fia=0)},isAdjustSuspended:function(){return 0=this.maximumChange&&(f=!0);for(b=this.sh;b;b=e)e=b.eh,b.eh=E,e&&(e.dh=E);this.sh=this.wh=E}},Ch:function(b,e){var a,f;return b=b||0,e=e||0,a=parseFloat(b),f=parseFloat(e),M(f-a)},initParserContext:function(b){this.Dh||(this.Dh=b.getParserContext(this.useR1C1))},getParserContext:function(b){var e=this.Dh;return e||(b?this.Dh=e=b.getParserContext(this.useR1C1):e=new ba.ParserContext(t,this.useR1C1,Z(0,0),t)),e.setSource(b),e},parse:function(b,e,a,f,k,g,v){var p,c,h=this.rh;b=this.getParserContext(b);return b.useR1C1=!v&&this.useR1C1,b.ignoreError=g,b.row=a,b.column=f,b.culture=k,h?(b.useR1C1||(b.useR1C1=!0,e=this.kh.a1ToR1C1(b,e)),(p=h[e])?p:(c=this.kh.parse(b,e),h[e]=c,c)):this.kh.parse(b,e)},unparse:function(b,e,a,f,k,g){var v;b=this.getParserContext(b);return b.useR1C1=this.useR1C1,b.row=a,b.column=f,b.culture=k,g&&(b.Eh=!0,b.useR1C1=!1),v=this.kh.unparse(b,e),b.Eh=!1,v},Dg:function(b){return!!b.dh||b===this.sh},pg:function(b,e){var a,f;if(0===e)a=this.sh,f=this.wh;else if(1===e)a=this.th,f=this.xh;else if(2===e)a=this.uh,f=this.yh;else{if(3!==e)return;a=this.vh;f=this.zh}b&&!b.dh&&b!==a&&(a?f.eh=b:0===e?this.sh=b:1===e?this.th=b:2===e?this.uh=b:this.vh=b,b.dh=f,b.eh=t,0===e?this.wh=b:1===e?this.xh=b:2===e?this.yh=b:this.zh=b)},Bh:function(b,e){var a,f,k;if(0===e)a=this.sh;else if(1===e)a=this.th;else if(2===e)a=this.uh;else{if(3!==e)return;a=this.vh}b&&(b.dh||b===a)&&(f=b.dh,k=b.eh,f?f.eh=k:0===e?this.sh=k:1===e?this.th=k:2===e?this.uh=k:this.vh=k,k?k.dh=f:0===e?this.wh=f:1===e?this.xh=f:2===e?this.yh=f:this.zh=f,b.dh=t,b.eh=t)},Eg:function(b){return b.dh||b===this.th},isDirtyColumn:function(b){return b.dh||b===this.uh},Hg:function(b,e,a,f,g,v){var p,c,h,m,x,d,y=a.row||0,n=a.col||0,T=v?v.row:y,B=v?v.col:n,N=b.getEvaluatorContext(a,f,v),N=this.lh.evaluateExpression(e,N,g,4===arguments.length&&f);if(f&&5>=arguments.length)return N;if(K.Fh(N)){if(p=N.getRowCount(0),c=N.getColumnCount(0),1!==N.getRangeCount())return k;try{if(h=f?y-T:y-N.getRow(0),m=f?n-B:n-N.getColumn(0),x=Z(0,0),1!==p||1!==c)if(1===p&&1=c||1!==d&&n-B>=d)return P;N=N.getValue(1===c?0:y-T,1===d?0:n-B)}else N=N.getValueByIndex(0);return N===E||N===t?!1===g?N:0:N},Gh:function(b,e,a){var f=this.Dh;return f||(this.Dh=f=b.getParserContext(this.useR1C1)),f.useR1C1=this.useR1C1,f.row=e,f.column=a,f},evaluate:function(b,e,a,f){e=this.parse(b,e,a,f);return this.lh.evaluateExpression(e,b.getEvaluatorContext(Z(a,f),!1),!1)}};Fa=ba.Hh=function(b,e,a){var f=new X(5);return e&&(f.source=e),a&&(f.endSource=a),f.value=b,f};ba.Ih=Fa(x);aa=ba.Jh=function(b,e){var a=new X(7);return a["function"]=b,a.arguments=e,b instanceof X?(a["function"]=b["function"],a.functionName=b.functionName):(a["function"]=b.name&&b,a.functionName=b.name||b),a};xa=ba.Kh=function(b,e,a){var f=new X(9);return f.operatorType=b,f.value=e,f.value2=a,f};Ia=ba.Lh=function(b){var e=new X(10);return e.value=b,e};la=ba.Mh=function(e,a,f,g,p){var c,h,m,x,d,y,n,T,N,B,E,q,S,r,M,l,fa,X,V,A,Y,Oa,ca,D,Qa,Ca,pb,la,pa,ga,F,G,qa=function(b,e,a,f,k){return{expr:b,acceptsArray:e,acceptsRef:a,index:f,context:k}},ka=e.row,u=e.column,sa=[],ja=0,ya=e.arrayIdentity?e.arrayIdentity.row:ka,ia=e.arrayIdentity?e.arrayIdentity.col:u;sa[ja]={expr:a,acceptsArray:!1,acceptsRef:!1,index:-1};h=c=0;for(x=m=!1;0<=ja;){if(d=sa[ja--],y=d.acceptsArray,n=d.acceptsRef,a=d.expr,T=t,a)if(7===a.type){if(B=a,y=B.arguments.length,!B["function"]){if(!e){T=Fa(W);continue}B["function"]=e.getFunction(B.functionName)}if(E=B["function"],q=d.index,S=d.neeedExpendindexs,0>q?(d.arrayArgumentEvaluateMode=x,d.arrayFormulaCatchValue=f,E&&E.arrayArgumentEvaluateMode&&(x=E.arrayArgumentEvaluateMode),d.args=[]):(E&&E.acceptsArray(q)?c--:m&&(S||(S=[],d.neeedExpendindexs=S),B.arguments[q]!==N,S.push(q)),d.args.push(N)),q===y-1){if(x=d.arrayArgumentEvaluateMode,f=d.arrayFormulaCatchValue,r=d.args,N=!1,r&&0X?X+l:X,V=0>V?V+fa:V,a=b(a.source,t,X,V,!1,!1));else if(1===a.type||13===a.type){if(13===a.type){if(A=a,Y=A.getRange(ka,u),!Y){N=T=a;continue}a=v(A.source()===e.source?t:A.source(),t,Y.row,Y.col,Y.row+Y.rowCount-1,Y.col+Y.colCount-1)}N=a.source!==ba.BangSource&&a.source;Oa=a;h&&(Oa.rowRelative||Oa.columnRelative||Oa.endRowRelative||Oa.endColumnRelative)&&(M=N||e.source,l=M.getRowCount(),fa=M.getColumnCount(),ca=Oa.rowRelative?(Oa.row+ya)%l:Oa.row,D=Oa.columnRelative?(Oa.column+ia)%fa:Oa.column,Qa=Oa.endRowRelative?(Oa.endRow+ya)%l:Oa.endRow,Ca=Oa.endColumnRelative?(Oa.endColumn+ia)%fa:Oa.endColumn,ca=0>ca?ca+l:ca,D=0>D?D+fa:D,Qa=0>Qa?Qa+l:Qa,Ca=0>Ca?Ca+fa:Ca,ca>Qa&&(pb=ca,ca=Qa,Qa=pb),D>Ca&&(pb=D,D=Ca,Ca=pb),a.row===w&&(ca=Qa=w),a.column===w&&(D=Ca=w),a=v(N,a.endSource,ca,D,Qa,Ca,!1,!1,!1,!1));n&&(y||!f&&1!==x&&3!==x)||0>ka||0>u||(0=Y.rowCount||!Oa.isFullRow&&1!==Y.colCount&&p>=Y.colCount?T=Fa(P):(X=(Oa.isFullColumn?0:Y.row)+(1===Y.rowCount?0:g),V=(Oa.isFullRow?0:Y.col)+(1===Y.colCount?0:p),T=b(N,a.endSource,X,V,!1,!1)):1=Y.row+Y.rowCount)||1=Y.col+Y.colCount)?T=Fa(k):(X=Oa.isFullColumn||1=N.value.RowCount&&1=N.value.colCount&&1M(b))return parseInt(b,10);throw a().Exp_InvalidCast;};K.Sh=function(b,e){return!!D(b,e)&&1E21>M(e.value)&&(e.value=parseInt(e.value,10),!0)};K.Pa=q;pa={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};K.Th=D;K.Uh=A;K.Vh=function(b){if(!b)return!1;if("boolean"===typeof b)return b;if(b instanceof Date)return 0!==m.Ra(b);if(O(b))return 0!==b;if(H(b))return!1;throw a().Exp_InvalidCast;};K.bc=function(b){try{if(b===E||b===t)return"";if("boolean"===typeof b)return b?"TRUE":"FALSE";if("string"===typeof b)return b;if(b instanceof Date)return""+m.Ra(b);if(I(b))throw a().Exp_InvalidCast;return""+b}catch(Ka){throw a().Exp_InvalidCast;}};K.Wh=function(b){var e={value:t};if(r(b,e))return e.value;throw a().Exp_InvalidCast;};K.Xh=r;K.CalcConvertedError={};ba.Convert=K;l=function(){function b(){}return b.Yh=function(b,e){return b===e||M(b-e)=b.getColumnCount()&&1===b.getColumnCount()&&e=b.getRowCount()&&1===b.getColumnCount()&&ak?0:e;this.maxArgs=3>k?0:a;this.$h=f;this.typeName=""}return b.prototype={description:function(){var b=a()._h;return this.$h?this.$h:b&&b[this.name]},acceptsArray:function(b){return!1},acceptsReference:function(b){return!1},acceptsError:function(b){return!1},acceptsMissingArgument:function(b){return!1},isVolatile:function(){return!1},isContextSensitive:function(){return!1},isBranch:function(){return!1},findTestArgument:function(){return-1},findBranchArgument:function(b){return-1},expandRows:function(){return!0},expandColumns:function(){return!0},precedentReference:function(){return!0},returnReference:function(){return!1},evaluate:function(b){},evaluateWithContext:function(b,e){var a=e;return this.isContextSensitive()&&(a=e.slice(),a.unshift(b)),this.evaluate.apply(this,a)},toJSON:function(){var b,e={};for(b in this)this.hasOwnProperty(b)&&(e[b]=this[b]);return e},fromJSON:function(b){if(b)for(var e in b)b[e]!==E&&(this[e]=b[e])}},b.ai=function(b,e,a){var f;b=new ra.Function(b,0,255);if(e&&"function"==typeof e&&(b.evaluate=e),a)for(f in a)a.hasOwnProperty(f)&&"override"!==f&&(b[f]=a[f]);return b},b}();ra.Function=l;l=function(b){function e(e,a,f,k){b.call(this,e,a,f,k)}c(e,b);return e}(l);u(l.prototype,{isContextSensitive:function(){return!0},evaluate:function(b,e){return this.evaluateAsync.apply(self,arguments)},evaluateAsync:function(b,e){self.evaluate.apply(self,arguments)},defaultValue:function(){return 0},evaluateMode:function(){return 0},evaluateWhenArgumentsIsSame:function(){return!0},interval:function(){return 1E4}});ra.AsyncFunction=l;ra.AsyncFunctionEvaluateMode={onRecalculation:0,calculateOnce:1,onInterval:2};ra.bi={};ra.ci={};ra.defineGlobalCustomFunction=function(b,e){return ra.ci[d(b)]=e,e};ra.findGlobalFunction=function(b){if(!b){var e;b=ra.bi;var a=ra.ci,f=[];for(e in b)f.push(b[e]);for(e in a)f.push(a[e]);return f}b=d(b);e=ra.bi;a=ra.ci;return e&&e[b]||a&&a[b]};ra.removeGlobalFunction=function(b){if(!b)return ra.bi={},void(ra.ci={});b=d(b);var e=ra.bi,a=ra.ci;e[b]?delete e[b]:a[b]&&delete a[b]};U.exports=ba},function(U,u){U.exports=GC.Spread.Common},function(U,u,l){function d(){throw y().Exp_FormulaInvalid;}function J(a,c,h){throw B.Kb(y()[h||"Exp_FormulaInvalidChar"],[a,c]);}function R(a,c,h,p,g,f){var k,m=a.length,d=h===p?0:1,t=[];for(c+=1;c=a};m.ei=function(a){a=a.charCodeAt(0);return!(255>=a)||(127>=a?(a|=32,96<=a&&122>=a):0===q[a]||1===q[a])};m.fi=function(a){a=a.charCodeAt(0);return!(255>=a)||(127>=a?57>=a?48<=a:(a|=32,96<=a&&122>=a):0===q[a]||1===q[a])};m.isNumber=function(a){a=a.charCodeAt(0);return 127>=a?48<=a&&57>=a:8===q[a]||10===q[a]};m.Parser=function(){function h(){}return h.prototype={setParserOption:function(a){var m,p;void 0!==a&&c.CultureManager.q4()?(p=a.NumberFormat?a.NumberFormat:c.CultureManager.q4().NumberFormat,m=a?p:{}):(m={},p=m);L=h.listSeparator=m.listSeparator||",";I=m.numberDecimalSeparator||".";!a&&h.numberDecimalSeparator||(h.numberGroupSeparator=p.numberGroupSeparator||",",h.numberDecimalSeparator=p.numberDecimalSeparator);F=h.arrayGroupSeparator=m.arrayGroupSeparator||";";G=h.arrayListSeparator=m.arrayListSeparator||","},parse:function(a,c){var p,g;return this.setParserOption(a.culture),p=c.split(""),this.gi=p,g=this.parseToTokens(a,p,!a.ignoreError),this.buildExpressionTree(a,g,!a.ignoreError)},unparse:function(a,c,p){return p=p||[],this.kja(a,c,p),p.join("")},kja:function(a,c,p){var g,f;this.setParserOption(a.culture);g=a.getResolvers();for(f=0;f=b||65<=b&&90>=b)m.push(e);else if(34===b)(v=R(c,t,'"','"',"",p))?(f.push(new r(v.result,0,t,t+v.result.length+2,3)),t=v.endIndex,y=t+1):(A(m,c.slice(t,g)),t=g-1);else if(39===b)(v=R(c,t,"'","'","",p))?(m.push("'"),A(m,v.result),m.push("'"),t=v.endIndex):(m.push("'"),t=g-1);else if(91===b)if(v=R(c,t,"[","]","'",p))m.push("["),A(m,v.result),m.push("]"),t=v.endIndex;else{if(!this.lda||0!==m.length||"R"!==m[0]&&"r"!==m[0]&&"C"!==m[0]&&"c"!==m[0])A(m,c.slice(t,g)),t=g-1}else 13!==b&&10!==e&&(35===b?(v=Q(c,t))?(f.push(new r(v.result,0,t,t+v.result.length-1,6)),y=t+1,t=v.endIndex):m.push(e):33===b?(0===m.length,f.push(new r(m,0,y,t,12)),m=[],y=t+1):43===b||45===b?(v=0===f.length?null:f[f.length-1],0!==m.length?(f.push(new r(m,0,y)),f.push(new r(e,5,t)),m=[],y=t+1):(v&&7===v.Nc&&f.pop(),!v||2!==v.hi&&6!==v.Nc&&0!==v.Nc?(f.push(new r(e,4,t)),y=t+1):(f.push(new r(e,5,t)),y=t+1))):e===I||D(b)?0h&&p&&J(e,t),f.push(new r(F,3,t,t)),y=t+1):125===b?(m=a(f,m,y),0>B&&p&&J(e,t),y=k[h--],y=new r(e,y.Nc,t,t,2),f.push(y),y=t+1):32===b?(m=a(f,m,y),y=t+1):e===L||e===G||e===F?(m=a(f,m,y),0>h||1!==k[h].Nc?f.push(new r(L,5,t,t,10)):f.push(new r(e,3,t,t)),y=t+1):37===b?(m=a(f,m,y),f.push(new r(c[t],6,t,t)),y=t+1):t+2<=g&&z[e+c[t+1]]?(m=a(f,m,y),f.push(new r(c.slice(t,t+2),5,t,t+1,5)),t++,y=t+1):z[e]?(m=a(f,m,y),f.push(new r(e,5,t,t)),y=t+1):"("===e?(0h)?p&&J(e,t):(y=k[h--],y=new r(e,y.Nc,t,t,2),f.push(y),y=t+1):":"===e?(m=a(f,m,y),f.push(new r(e,5,t,t,11)),y=t+1):m.push(e));return a(f,m,y),f},buildExpressionTree:function(a,c,p){c=this.ii(a,c,p);return this.ji(a,c,p)},ji:function(a,c,p){var g,f,k;p=this.ki(a,c,p);for(a=3;a=H[c.value];)g=p[a-3],f=p[a-1],g=m.Kh(c.operatorType,g,f),p.splice(a-3,3,g),a-=2,3<=a&&(c=p[a-2]);a+=2}else a++;if(1===p.length)return p[0];for(a=p.length-2;0=h[y].operatorType;)y++;t=this.ji(c,h[y]);for(n=y-1;n>=k;n--)t=m.Kh(x.operatorType,t);k=y}else{if(2===x.operatorType){if(0!==k){t=m.Kh(x.operatorType,this.ji(c,g[g.length-1]));g[g.length-1]=t;continue}p&&d()}}else if(10===x.type)x.value=this.ji(c,x.value),t=x;else if(7===x.type){if(y=0,B=x.arguments,n=[],0a.type&&0!==h.type&&7!==h.type&&9>h.type&&(t=c[k].li,tp[c].priority){p.splice(c,0,a);break}},getFunction:function(a){return this.source&&this.source.getCustomFunction(a)||m.Functions.findGlobalFunction(a)}},a}();w={"+":0,"-":1};z=m.operaterTypesMap={":":15,",":16,"+":3,"-":4,"*":5,"/":6,"^":7,"%":2,"\x26":8,"\x3d":9,"\x3c":11,"\x3c\x3e":10,"\x3c\x3d":12,"\x3e":13,"\x3e\x3d":14};C=m.DefaultTokenResolver=function(){n.call(this)};U(C,n);u(C.prototype,{resolveToken:function(c,h,n,p){var g,f,k,x,t=n[p];f=t.ni;if(0===t.Nc&&0===t.hi)c=f.toUpperCase(),"TRUE"===c||"FALSE"===c?(t.hi=5,t.ni=c,g=new a(4),g.value="TRUE"===c):(g=new a(8),g.value=f);else if(1===t.Nc){if("ARRAY"===f){g=new a(6);p++;c=[[]];for(k=h=f=0;p=p.getRowCount())throw d;h=0;for(g=p.getRowCount();ha?A:p(b,a):void 0}function Q(e,b,a){if(8===e)return V(b)?b:V(a)?a:(b=b||"",a=a||"",W.bc(b)+W.bc(a))}function K(e,b,a){var f,k,g,v,c,p,h,m;if(V(b))return b;if(V(a))return a;if(f="string"===typeof b,k="string"===typeof a,g=f||k,v=g?"":0,b=null===b||void 0===b?v:b,a=null===a||void 0===a?v:a,c=function(){return b===a?0:f&&k?b.toUpperCase().localeCompare(a.toUpperCase()):f?1:k?-1:t.Zh.Yh(b,a)?0:b-a},!g){if(p={value:0},h={value:0},!P(b,p)||!P(a,h))return F;b=p.value;a=h.value}return m=c(),9===e&&0===m||10===e&&0!==m||11===e&&0>m||12===e&&0>=m||13===e&&0z||"\x3c\x3d"===T&&d<=z||"\x3e\x3d"===T&&d>=z||"\x3d"===T&&d===z||"!\x3d"===T&&d!==z||"checkLength"===T&&d.length>z){n.Ti=void 0===q?t.Errors.Number:q;n.Ei=!1;break a}}if(!f.Ei)break;e[g]=p.Zi?{$i:x,Qb:f.Ti}:f.Ti}else e[g]=p.Zi?{$i:x,Qb:p._i}:p._i}return{Di:e,Ei:f.Ei,Fi:f.Ti}}var L,F,G,q,D,A,r,n,w,z,C,c,m,h,a,B,y,t=l(25);U=t.Errors;var E=l(26),M=E.j.G,p=Math.pow,g=Math.min,f=Math.max,k=function(){return E.C(t.SR)()},x=k().Exp_Format,W=t.Convert,P=W.Th,V=W.vf,Z=W.Ph;l=function(){return function(e,b,a,f){this.ui=this.ti=this.si=0;this.source=e;this.arrayFormulaMode=!!a;this.identity=b||t.pf(0,0);this.row=(this.arrayIdentity=f)?f.row:this.identity.row;this.column=f?f.col:this.identity.col;this.rowOffset=f?this.identity.row-f.row:this.row;this.columnOffset=f?this.identity.col-f.col:this.column}}();l.prototype={fga:function(e){return e===t.BangSource?this.source:e},getValue:function(e,b){return e?this.fga(e).getValue(b):L},getReference:function(e,b){return e?this.fga(e).getReference(b):L},getSheetRangeReference:function(e){return e&&e.source&&e.endSource?this.fga(e.source).getSheetRangeReference(e):L},getFunction:function(e){return this.source?this.source.getCustomFunction(e):null},getName:function(e){var b,a=this.source?this.source.getCustomName(e):null;return!a&&this.source&&(b=this.source.Cf().getGlobalSourceModel(),a=b&&b.getSource().getCustomName(e)),a},vi:function(){return 0=e.type)g=this.evaluateConst(e,b,a);else if(1===e.type||13===e.type)g=this.evaluateReference(e,b,f,a);else if(8===e.type)g=this.evaluateName(e,b,a,f);else if(9!==e.type||e.value2)if(9===e.type)g=this.evaluateBinaryOperation(e,b,a,f,c);else if(7===e.type)g=this.evaluateFunction(e,b,a,f,c);else if(11===e.type)g=void 0;else{if(b.evaluate)return b.evaluate(e,a,f)}else g=this.evaluateUnaryOperation(e,b,a,f,c);return g},evaluateConst:function(e,b,a){e=e.value;return W.Ca(e)?a||b&&(b.arrayFormulaMode||b.vi())?e:e.getValue(0,0):e},evaluateReference:function(e,b,a,f){var k,g,c,p,v,h,m,x,t,d;if(!b)return F;if(k=(13===e.type?e.source():e.source)||b.source,g=b.row,c=b.column,p=e.getRange&&e.getRange(g,c),!p)return L;if(v=0>p.row?0:p.row,h=0>p.col?0:p.col,m=p.rowCount,x=p.colCount,a||b.arrayFormulaMode)return e.endSource?b.getSheetRangeReference({source:e.source,endSource:e.endSource,row:v,col:h,rowCount:m,colCount:x}):b.getReference(k,p);if(f&&(1=p.row&&g=p.col&&cg;g++){if(v=this.evaluate(c[g],b,h[g],m[g]),W.vf(v))return v;if(v===t.missingArgument)return D;p[g]=v}return this.evaluateWithArgs(e,function(b){return C(e.operatorType,b[0],b[1])},b,k,p,a,f)},startCache:function(){this.Bi={};this.service.oia&&this.asyncManager.startCalc()},endCache:function(){this.Bi=null},evaluateFunction:function(e,b,a,f,k){var g,c,p,v,h,m,x,d,n,B,N,w,E,r,S,z,P;if(!e||!e["function"]||"string"==typeof e["function"])return q;if(g=e.arguments.length,c=this,p=b.ti,v=e["function"],x=null,v instanceof y.AsyncFunction&&this.asyncManager.startCalcFunction(v,e.arguments,b),0===g)h=[];else{h=[];d=[];n=[];for(B=0;B=k.getRowCount(0)||f>=k.getColumnCount(0)?D:k.getValue(0,a,f))):W.Ca(b)&&(g=b,!e.arrayFormulaMode||-1===e.rowOffset&&-1===e.columnOffset?b=g.getValue(0,0):(a=1===g.getRowCount()?0:e.rowOffset,f=1===g.getColumnCount()?0:e.columnOffset,b=a>=g.getRowCount()||f>=g.getColumnCount()?D:g.getValue(a,f))),b},Gi:function(e,b,a,f,k){var g,c,p,v,h,m,x,t,y,n,B=1,N=1,q=-1,w=!0,r=!0,z=null,S;S=7===b.type?b:null;if(S&&!S["function"].expandRows()&&(w=!1),S&&!S["function"].expandColumns()&&(r=!1),S&&S["function"].isBranch()&&(e.arrayFormulaMode||e.vi())){if(q=S["function"].findTestArgument(),b=[],g=!1,f)for(c=0;cE.k.Cb(b,f)&&(W.Ca(a[f])||W.Fh(a[f]))&&b.push(f);f=b}}for(c=0;cB?S:B;N=g>N?g:N}p=[];c=0;v=f[c];for(h=0;h=S||1!==g&&n>=g?p[h][y][n]=D:z?p[h][y][n]=z.getValue(1===S?0:y,1===g?0:n):b?!k||k[h]?p[h][y][n]=b.getValue(0,1===S?0:y,1===g?0:n):p[h][y][n]=b.create([d(b.getRow(0)+(1===S?0:y),b.getColumn(0)+(1===g?0:n),1,1)]):p[h][y][n]=m}return p}};n=function(){return function(e,b){this.id=e;this.Fi=void 0;this.v5=!1;this.oi=[];void 0!==b&&(this.evaluateMode=b)}}();n.prototype={canEvaluate:function(){var e,b=this.oi;for(e=0;e=e)if(b){var k=z(b);e=k.success?R(e,k.value):void 0}else e=0;else if(14>=e)a:{var c=a,p,h,v,m,x,y,n,B,T,q,w;if(p=7>=e?R:8===e?Q:K,h=z(b),v=z(c),h.success&&v.success)e=p(e,h.value,v.value);else{if(k=h.value,c=v.value,b=h.success?-1:k.rowCount,m=h.success?-1:k.colCount,x=v.success?-1:c.rowCount,y=v.success?-1:c.colCount,n=-1,B=-1,h.success||v.success)h.success?(n=x,B=y):(n=b,B=m);else{if(1!==b&&1!==x&&b!==x||1!==m&&1!==y&&m!==y){e=D;break a}n=1===b?x:b;B=1===m?y:m}T=[];for(q=0;qb,z=2===b||102===b,P=z||3===b||103===b,l=5===b||105===b,V=4===b||104===b||l,Z=9===b||109===b,A=1===b||101===b||Z||f,D=6===b||106===b,F=D?1:0,G=!1,u=0;for(b=0;bF)?F=n:A?f?(g.sumx+=n,g.sumx2+=n*n,g.n++):(F+=n,u++):D&&(F*=n,u++),G=!0))}return A?Z?F:f?void 0:0===u?E:W(F/u):D?W(0=a:2===b?f=e!==a:3===b?f=ea),f}var f,g,c,h,m;return f=-1,g=!0,c={value:0},h=n.zb(e),4===a&&h&&(m=function(b){var e=n.sb(h);return e.lastIndex=0,e.test(b)}),C(e)?f=0:h?g=!1:p(""+e,c)?f=c.value:g=!1,function(c){C(c)&&(c="");var v={value:0};return g&&p(c,v)?b(a,v.value,f):(!h||!k(c,!0))&&(h&&m?m(""+c):b(a,(""+c).toUpperCase(),C(e)?"":(""+e).toUpperCase()))}}var F,G,q=l(26),D=l(25),A=q.l.Ra,r=q.k.ac,n=q.q,w=q.j,z=w.Ea,C=w.Fa,c=isNaN,m=Math.abs,h=Math.exp,a=Math.log,B=Math.pow;u=D.Errors;var y=u.Value,t=u.Number,E=u.DivideByZero;u=D.Convert;var M=u.CalcConvertedError,p=u.Th,g=u.Rh,f=u.Pa,k=u.Na,x=u.Ph,W=u.Nh,P=D.Functions,V=D.Zh.Yh;d.prototype={$j:function(a){var e,b,f,k,g=this.Di;if(w.Ca(g)||(g=[g]),-1===g[0])return!0;for(e=0;ek||"\x3e\x3d"===f&&a>=k||"%\x3d"===f&&a%2===k)return!0}else if(a===b)return!0;return!1},_j:function(){return this.Di}};P.ak=function(a,e,b,f,k,g,c,p){return p||(p={}),void 0!==b&&(p.minArgs=b),void 0!==f&&(p.maxArgs=f),void 0!==g&&(p.acceptsReference=g),void 0!==c&&(p.acceptsArray=c),void 0!==k&&(p.Ci=k),void 0!==p.bk&&(p.acceptsMissingArgument=p.bk),void 0!==p.ck&&(p.isVolatile=p.ck),void 0!==p.dk&&(p.isContextSensitive=p.dk),void 0!==p.ek&&(p.precedentReference=p.ek),void 0!==p.fk&&(p.arrayArgumentEvaluateMode=p.fk),void 0!==p.gk&&(p.acceptsError=p.gk),function(b,e,a){if(C(b))throw q.C(D.SR)().Exp_InvalidFunctionName;if(b=b.toUpperCase(),P.bi[b])throw q.C(D.SR)().Exp_InvalidOverrideFunction;var f=P.bi[b];if(f){if(!a||!a.override)throw q.C(D.SR)().Exp_OverrideNotAllowed;}else P.bi[b]=f=new P.Function(b,0,255);return e&&"function"==typeof e&&(f.evaluate=e),w.H(a,function(b,e){var k;0<=z(b,"acceptsReference acceptsArray acceptsError acceptsMissingArgument precedentReference expandColumns expandRows".split(" "))?(k=new d(e),f[b]=function(b){return k.$j(b)}):0<=z(b,["isVolatile","isBranch","findTestArgument","returnReference","isContextSensitive"])?(k=new d(e),f[b]=function(){return k._j()}):a.hasOwnProperty(b)&&"override"!==b&&(f[b]=e)}),f}(a,e,p)};P.hk=1.79769E308;P.ik=function(a){return"boolean"==typeof a};P.jk=J;P.Na=function(a){return"number"==typeof a};P.kk=R;P.lk=Q;P.mk=function(a,e){return a-e};P.nk=K;P.pk=H;P.qk=function(a){var e,b,f;return 0===a?b=0:(f=.5*m(a),3<=f?b=1:1>f?(e=f*f,b=((((((((1.24818987E-4*e-.001075204047)*e+.005198775019)*e-.019198292004)*e+.059054035642)*e-.151968751364)*e+.319152932694)*e-.5319230073)*e+.797884560593)*f*2):(f-=2,b=(((((((((((((-4.5255659E-5*f+1.5252929E-4)*f-1.9538132E-5)*f-6.76904986E-4)*f+.001390604284)*f-7.9462082E-4)*f-.002034254874)*f+.006549791214)*f-.010557625006)*f+.011630447319)*f-.009279453341)*f+.005353579108)*f-.002141268741)*f+5.35310849E-4)*f+.999936657524)),0f?(k=1,c++,12b||4n&&(n=-n,a=[e,e=a][0]),1===b?(c=a.getFullYear(),p=e.getFullYear(),h=new Date(a),h.setFullYear(h.getFullYear()+1),0a.getMonth()||R(p)&&541<=256*e.getMonth()+e.getDate()?1:0),d=f(x)/f(y),k=365+d):k=Q(new Date,b),n/k)}return b};F={};G={wk:function(a){var e=Math.floor(a);return V(a,e+1)?e+1:e},xk:function(a){var e,b,f,g,c,p=F;if(p||(F=p={}),e=p[a])return e;if(k(a))return p[a]=L(4,a);b=C(a)?"":(""+a).toUpperCase();f="\x00";for(g=0;2>g&&ge?a/b:a*b,a=0>a?G.zk(a-.5):G.wk(a+.5),a=0>e?a*b:a/b,W(a)},Bk:function(a,e){if(0>a||0>e||ae?fa(e):Math.ceil(e),(b&&0===e%2||!b&&0!==e%2)&&(e+=0>e?-1:1),e}function R(b,e,a){return 0a?ia:0>e&&0a?e/f:e*f,k=cb(e),g=La(e),b&&(k=[g,g=k][0]),e=0>e?k:g,e=0>a?e*f:e/f,Ga(e)}function K(b,e,a,f){e=e?-1:1;var k=0,g,c,p;if(S(a)!==S(f))return sa;for(p=0;pfa(b)||17e;e++)a[e]=oa(b[e]);break;default:return ba}return a}function q(b,e,a,f,k){var g;g=n(e,3);if(Aa(g))return g;for(g=va(g);0>a;++a)e.setDate(e.getDate()-1),g=0===g?6:--g,(b&&(5===g||6===g)||!b&&k[g]||0<=f.indexOf(v(e)))&&a--;for(;0h&&(a=[f,f=a][0],p=[h,h=p][0],m=!0);a=c(a,f,h-p+1,k);if(e&&Aa(a))m=a;else if(0>=a)m=0;else{var x;f=k;k=a;var y,d,t;if(e&&(f=void 0!==f?f:"0000011",y=G(f),Aa(y)))x=y;else if(void 0!==g&&(x=ib(g,4,!0,!0,!1)),x)if(x.isError)x=x[0];else{e=S(x);g=[];for(f=0;f=p&&c<=h&&g.push(c);x=k-S(g)}else x=k;m=(a=x,m?-a:a)}return m}function A(b,e,a){var f,k;return e=Ka.Wh(e),f=new Date(e.getFullYear(),e.getMonth(),1),f.setMonth(f.getMonth()+a),k=ua(f.getFullYear(),f.getMonth()),f.setDate(b?k:T(e.getDate(),k)),f}function r(b){var e;return ta(b)&&(e=N(b)),e?(60*(60*e.getHours()+e.getMinutes())+e.getSeconds())/86400:ba}function n(b,e){var a=b.getDay();switch(e){case 1:return a+1;case 2:return 0===a?7:a;case 3:return 0===a?6:a-1;default:return ia}}function w(b){var e,a,f=""+b,k="",g=[];if(0>b&&(f=f.substr(1),k="-"),e=f.split("."),a=S(e),1>a||2=S(e)?e:e.substr(b?0:S(e)-a,a)}function C(b,e){return e}var c,m,h,a,B,y,t,E,M,p,g,f,k,x,W,P=l(26),V=l(33),Z=P.q,e=P.u,b=P.l,v=b.Ra,N=b.Qa,S=P.k.ac;u=P.j;var X=u.Ea,Y=u.Fa,ka=isNaN,ja=parseFloat,oa=parseInt,ma=Math.abs,ea=Math.sqrt,ga=Math.max,T=Math.min,fa=Math.floor,Fa=Math.exp,aa=Math.log,xa=Math.PI,Ia=Math.random,la=Math.pow;u=V.Errors;var pa=u.Null,qa=u.DivideByZero,ba=u.Value,ra=u.Reference,ya=u.Name,sa=u.NotAvailable,ia=u.Number,Ka=V.Convert,wa=Ka.CalcConvertedError,Aa=Ka.vf,Va=Ka.Fh,$a=Ka.Ca,Da=Ka.Uh,va=Ka.Rh,Ra=Ka.Pa,jb=Ka.bc,Ta=Ka.Na,ib=Ka.Ph,Ga=Ka.Nh,bb=V.Zh.tryExtractToSingleValue,Na=V.Functions,Ya=Na.ik,ta=Na.jk,fb=Na.kk,ua=Na.nk,Ha=Na.tk,na=Na.rk,gb=Na.sk,Za=Na.Fk,cb=Za.zk,La=Za.wk,da=Na.ak;u={Hi:0};c={Hi:0,aj:"\x3d 0",bj:qa};m={Hi:0,aj:"\x3d 0",bj:0};h={_i:1,Hi:0,aj:"\x3d 0",bj:0};a={Hi:1};B={Hi:1,aj:"\x3c 0"};y={Hi:2};t={_i:1,Hi:2};E={_i:1,Hi:2,aj:"\x3c 0",bj:ba};M={Hi:5};p={Hi:6};g={Hi:2,aj:"\x3c 0",bj:ba};f={_i:[],Hi:4,Ii:4,Ji:!0,Ki:!0,Li:!0};k={Hi:4,Ii:1,Ki:!0,Li:!0};x={Hi:4,Ii:1,Ji:!0,Ki:!0,Xi:!0};W={Hi:4,Ii:3,Ji:!0,Ki:!0,Xi:!0};da("ABS",function(b){return Ga(ma(b))},1,1,u);da("ACOS",function(b){return Ga(Math.acos(b))},1,1,{Hi:0,aj:["\x3e 1","\x3c -1"]});da("ASIN",function(b){return Ga(Math.asin(b))},1,1,{Hi:0,aj:["\x3e 1","\x3c -1"]});da("ATAN",function(b){return Ga(Math.atan(b))},1,1,u);da("ATAN2",function(b,e){return 0===b&&0===e?qa:Ga(Math.atan2(e,b))},2,2,[u,u]);da("COS",function(b){return Ga(Math.cos(b))},1,1,u);da("CEILING",function(b,e){return R(!0,b,e)},2,2,[m,m]);da("ODD",function(b){return J(!0,b)},1,1,a);da("EVEN",function(b){return J(!1,b)},1,1,a);da("FLOOR",function(b,e){return R(!1,b,e)},2,2,[m,m]);da("LN",function(b){return Ga(aa(b))},1,1,{Hi:1,aj:"\x3c\x3d 0"});da("SQRT",function(b){return ea(b)},1,1,{Hi:1,aj:"\x3c 0"});da("SIN",function(b){return Ga(Math.sin(b))},1,1,u);da("TAN",function(b){return Ga(Math.tan(b))},1,1,u);da("SIGN",function(b){return 0===b?0:-1},1,1,{Hi:1,aj:"\x3e 0",bj:1});da("GCD",function(){var b,e,a,f,k=arguments,g=0;for(b=0;bf)return ia;g=d(g,va(f))}return g},1,void 0,x,-1,-1);da("LCM",function(){var b,e,a,f,k=arguments,g=1,c=[];for(b=0;bf)return ia;if(0===f)return 0;c.push(va(f))}for(e=0;eb&&0e&&0(g?a.getRowCount():a.getRowCount(0))||(k?b.getColumnCount():b.getColumnCount(0))>(g?a.getColumnCount():a.getColumnCount(0)))return ba;if(c.isError)return c[0];if(p.isError)return p[0];for(b=0;bf||170g||170f;f+=2){if(2<=f&&h[f-2]-h[f]<=b){k=f;g=f-2;for(c=0;ck+1&&h[g]-h[k+1]<=b;c++)k++;m.push(p[k]);m.push(p[g]);b+=h[k];b-=h[g]}if(1<=f&&h[f-1]<=b&&(m.push(p[f-1]),b-=h[f-1]),1<=f&&h[f-1]-h[f]<=b){k=f;g=f-1;for(c=0;ck+1&&h[g]-h[k+1]<=b;c++)k++;m.push(p[k]);m.push(p[g]);b+=h[k];b-=h[g]}for(;h[f]<=b;)m.push(p[f]),b-=h[f]}return m.join("")},1,2,[{Hi:2,aj:["\x3c 0","\x3e 3999"],bj:ba},{_i:0,Hi:2,aj:["\x3c 0","\x3e 4"],bj:ba}],void 0,void 0,{bk:1});da("CEILING.PRECISE",I,1,2,[m,h]);da("ISO.CEILING",I,1,2,[m,h]);da("FLOOR.PRECISE",function(b,e){return La(b/ma(e))*ma(e)},1,2,[m,h]);da("AND",function(){return L(!0,arguments)},1,void 0,W,-1,-1);da("OR",function(){return L(!1,arguments)},1,void 0,W,-1,-1);da("NOT",function(b){var e={};return Ka.Uh(b,e),!e.value},1,1);da("IF",function(b,e,a){var f,k,g=e,c=bb(b);return f=void 0!==a?a:2!==S(arguments)&&0,k={},Da(c.value,k),k.value?g:f},2,3,void 0,[1,2],[1,2],{gk:[1,2],bk:2,isBranch:!0,findTestArgument:0,findBranchArgument:function(b){if(Ka.vf(b))return-1;var e={value:!1};return Da(b,e),e.value?1:2}});da("IFERROR",function(b,e){if(!Aa(b)&&Va(b)){if(1=b&&(b+=1900);b=new Date(b,e-1,a);return bk.getHours()&&0>k.getMinutes()&&0>k.getSeconds()?ia:k},3,3,[y,y,y]);da("DATEVALUE",function(b){var e,a,f;if((ta(b)&&(e=N(b),e||(e=new Date(b),e&&!ka(e.valueOf())||(e=null))),!e)||(a=e.getFullYear(),f=F(e),1900>a))return ba;for(b=1900;bf&&(f=6)),k=a-1-(6-f),0>k&&(k=0),1+va(k/7)+(0!==k%7?1:0)):ia},1,2,[p,t],void 0,void 0,{bk:1});da("WEEKDAY",n,1,2,[p,t],void 0,void 0,{bk:1});da("EDATE",function(b,e){return A(!1,b,e)},2,2,[p,y]);da("EOMONTH",function(b,e){return A(!0,b,e)},2,2,[p,y]);da("WORKDAY",function(b,e,a){return q(!0,b,e,a)},2,3,[p,y,f],2,2,{bk:2});da("WORKDAY.INTL",function(b,e,a,f){a=G(a);return Aa(a)?a:"1111111"===a.join("")?ba:q(!1,b,e,f,a)},2,4,[p,y,{_i:"0000011"},f],[2,3],[2,3],{bk:[2,3]});da("DAYS360",Na.uk,2,3,[p,p,{_i:!1,Hi:7}],{bk:2});da("NETWORKDAYS",function(b,e,a){return D(!1,b,e,void 0,a,function(b,e,a){e=va(v(e)-v(b))%7;var f=va(n(b,2)+e);b=0===b.getDay()?1:2;return e=5b?b:e,a-=e,a-2*fa(a/7)})},2,3,[p,p],2,2,{bk:2});da("NETWORKDAYS.INTL",function(b,e,a,f){return D(!0,b,e,a,f,function(b,e,a,f){var k,g,c,p,h,m;if(f=void 0!==f?f:"0000011",k=G(f),g=0,c=0,Aa(k))return k;for(f=0;fa){for(f=0;fk)throw P.C(V.SR)().Exp_NotSupported;return(0,f[k])(b,e)},3,3,[p,p,M]);da("CLEAN",function(b){var e=[],a,f;for(a=0;a=f||127===f||128<=f&&159>=f||e.push(b[a]);return e.join("")},1,1,M);da("TRIM",function(b){var e,a,f,k,g;b=b.trim();e=[];a=!0;for(f=0;fa&&(f=f.substr(1)),k.push("$"),k.push(f),0>a&&(k.push(")"),k.unshift("(")),k.join("")},1,2,[u,{_i:2,Hi:2,aj:"\x3e 99",bj:ba}],void 0,void 0,{bk:1});da("FIXED",function(b,e,a){var f=0;return 0>e&&(f=va(la(10,ma(e))),b/=f),b=Ra(O(b,ga(0,e))),0>e&&(b*=f),a?""+b:w(b)},1,3,[u,{_i:2,Hi:2},{_i:!1,Hi:7}],void 0,void 0,{bk:[1,2]});da("TEXT",function(b,a){var f,k,g;if(""===a)return jb(b);Y(b)&&(b=0);var c=a,p,h;if(!e.kb(c,"[$-")&&(p=c.indexOf("["),-1!==p&&-1!==c.indexOf("]")))for(h=c.indexOf("]",p);-1!==p&&-1!==h;)p=c.substring(0,p),c=c.substring(h+1),c=p.concat(c),p=c.indexOf("["),h=-1===p?-1:c.indexOf("]",p);a=c;try{return f=l(34),k=f&&f.GeneralFormatter,k?(g=new k(a),g.format(b)):""+b}catch(Gb){return ba}},2,2,[{},M]);da("VALUE",function(b){if(!b)return 0;var e=N(b),a;return Y(e)?(e=ja(b),ka(e)?ba:e):(a=v(e),Aa(a)?r(e):a)},1,1,M);da("LOWER",function(b){return b.toLowerCase()},1,1,M);da("UPPER",function(b){return b.toUpperCase()},1,1,M);da("PROPER",function(b){var e,a,f,k=S(b),g=[];if(0c)return ba;for(p=0;p=f?"":fe||32767a||S(e)c.rowCount||1>c.colCount||2>h.rowCount||1>h.colCount||0>this.Lk||this.Jk.colCount<=this.Lk)throw C;}else{if(2!==arguments.length)throw K.C(O.SR)().Exp_InvalidNull;if(this.Lk=-1,2>c.rowCount||1>c.colCount||2>h.rowCount||1>h.colCount)throw C;}}function R(c,m,h,a){var d=0;for(m=new J(c,m,h);m.Pk();)c=m.Ok(),(c=a?F(c):c)&&d++;return q(d)}function Q(c,m,h,a,d,y,t){var n,B,p,g,f=t?1:0,k=0,x=0;for(c=new J(c,m,h);c.Pk();)if(n=c.Ok(),F(n)){if(B=L(n),z(B))return r;f=t?f*B:f+B;k+=B*B;x++}else if(G(n))return n;return y||t?q(f):(p=Math.max(0,(x*k-f*f)/(x*(x-d))),g=a?Math.sqrt(p):p,1>=x?A:q(g))}var K=l(26),O=l(33),H=K.q,I=O.Convert,L=I.Pa,F=I.Na,G=I.vf,q=I.Nh,D=O.Errors,A=D.DivideByZero,r=D.Value,n=O.Functions;u=n.ak;var w=n.jk,z=isNaN,C=K.C(O.SR)().Exp_InvalidCast;d.prototype.Ik=function(c){c=O.evaluateOperator({"\x3d":9,"\x3c\x3e":10,"\x3c":11,"\x3c\x3d":12,"\x3e":13,"\x3e\x3d":14}[this.Gk],c,this.Hk);return!!n.ik(c)&&I.Vh(c)};J.prototype={Mk:function(c,m){var h,a;if(w(m)){for(h=0;h=this.cj||this.Jk.rowCount<=this.cj)throw K.C(O.SR)().Exp_InvalidOperation;return this.Jk[this.cj][this.Lk]},Pk:function(){for(var c=!1,m=this.Jk.rowCount;!c&&this.cja)return!1;d=this.Jk[this.cj][a];y=H.zb(h.Hk,!0);d="\x3d"===h.Gk&&w(h.Hk)&&w(d)&&y?H.sb(y).test(d):h.Ik(d)}return d},Nk:function(c,m){return c.toLowerCase()===m.toLowerCase()}};l={Yi:!0,Hi:4,Ii:0};l=[l,{Yi:!0},l];u("DAVERAGE",function(c,m,h){var a,d,y=0,t=0;for(c=new J(c,m,h);c.Pk();){if(a=c.Ok(),G(a))return a;if(F(a)){if(d={value:0},!I.Th(a,d))return r;y+=d.value;t++}}return 0===t?A:q(y/t)},3,3,l,"!\x3d 1","!\x3d 1");u("DCOUNT",function(c,m,h){return R(c,m,h,!0)},3,3,l,"!\x3d 1","!\x3d 1");u("DCOUNTA",function(c,m,h){return R(c,m,h,!1)},3,3,l,"!\x3d 1","!\x3d 1");u("DGET",function(c,m,h){var a=null;c=new J(c,m,h);return c.Pk()?(a=c.Ok(),c.Pk()?D.Number:a):r},3,3,l,"!\x3d 1","!\x3d 1");u("DMAX",function(c,m,h){var a,d,y=!1,t=-n.hk;for(c=new J(c,m,h);c.Pk();){if(a=c.Ok(),G(a))return a;if(F(a)){if(d=L(a),z(d))return r;(!y||d>t)&&(t=d);y=!0}}return y?q(t):0},3,3,l,"!\x3d 1","!\x3d 1");u("DMIN",function(c,m,h){var a,d,y=!1,t=n.hk;for(c=new J(c,m,h);c.Pk();){if(a=c.Ok(),G(a))return a;if(F(a)){if(d=L(a),z(d))return r;(!y||ae&&(e+=b(a,10));e=e.toString(a);f-=x(e);for(a=0;a=b?(a=b*b,e&&1E-5>b?1-a/4:(l=f(a,z,3)/f(a,C,8,!0),k=(a-S)*(a-aa),k*=l,e?k:k*b)):(l=5/b,a=e?25/(b*b):l*l,k=f(a,n,6)/f(a,B,6),g=f(a,T,7)/f(a,q,7,!0),t=b-(e?.7853981633974483:2.356194490192345),k=k*V(t)-l*g*P(t),.7978845608028654*k/Z(b))}function g(b,a){var g,T,N,w,r,E=a?c:p,z=a?h:m,C=a?v:x,S=a?d:y,l=a?t:n,aa=a?B:q,fa=a?7:8;return 5>=b?(T=b*b,g=(a?1:b)*f(T,l,a?7:5)/f(T,aa,fa,!0),g+.6366197723675814*(a?e(b)*k(b,!0):k(b,!1)*e(b)-1/b)):(g=5/b,T=a?25/(b*b):g*g,N=f(T,E,6)/f(T,z,6),w=f(T,C,7)/f(T,S,7,!0),r=b-(a?.7853981633974483:2.356194490192345),N=N*P(r)+g*w*V(r),.7978845608028654*N/Z(b))}var c=[7.969367292973471E-4,.08283523921074408,1.239533716464143,5.447250030587687,8.74716500199817,5.303240382353949,1],p=[7.621256162081731E-4,.07313970569409176,1.1271960812968493,5.112079511468076,8.424045901417724,5.214515986823615,1],h=[9.244088105588637E-4,.08562884743544745,1.2535274390105895,5.470977403304171,8.761908832370695,5.306052882353947,1],m=[5.713231280725487E-4,.06884559087544954,1.105142326340617,5.073863861286015,8.399855543276042,5.209828486823619,1],v=[-.011366383889846916,-1.2825271867050931,-19.553954425773597,-93.20601521237683,-177.68116798048806,-147.07750515495118,-51.41053267665993,-6.050143506007285],x=[.05108625947501766,4.982138729512334,75.82382841325453,366.7796093601508,710.8563049989261,597.4896124006136,211.68875710057213,25.207020585802372],d=[64.3178256118178,856.4300259769806,3882.4018360540163,7240.467741956525,5930.727011873169,2062.0933166032783,242.0057402402914],y=[74.23732770356752,1056.4488603826283,4986.410583376536,9562.318924047562,7997.041604473507,2826.1927851763908,336.0936078106983],t=[15592.436785523574,-1.466392959039716E7,5.435264770518765E9,-9.821360657179115E11,8.75906394395367E13,-0xc5090e8ec6601,0x9d4a5b305a0018,-0x41b52d6418d9ec],n=[1.2632047479017804E9,-6.473558763791603E11,1.1450951154182373E14,-8127702555013251,0x2cf35a16e6cd620,-0xacf20aeef158b80],B=[1041.2835366425984,626107.330137135,2.6891963339381415E8,8.64002487103935E10,2.0297961275010555E13,3.1715775284297505E15,0x37a4bf79f36ba00],q=[594.3015923461282,235564.09294306856,7.348119444597217E7,1.8760131610870617E10,3.8823127749623857E12,6.205577271469538E14,0xf41f1e2a3d2440,0x3721e321ece8fe00],N=[-4.794432209782018E9,1.9561749194655657E12,-2.4924834436096772E14,9708622510473064],w=[-8.999712257055594E8,4.5222829799819403E11,-7.274942452218183E13,0xd15a1534be241],r=[499.563147152651,173785.4016763747,4.844096583399621E7,1.1185553704535683E10,2.112775201154892E12,3.1051822985742256E14,0x710505f9ecba70,0x17be34c7b662cc00],E=[620.8364781180543,256987.25675774884,8.351467914319493E7,2.215115954797925E10,4.749141220799914E12,7.843696078762359E14,89522233618462736,0x49de55d9c0a4e400];return T(function(b,e){var a=g(b,!0),f=g(b,!1),k=1,c=2*k,p;if(0===e)return a;if(1===e)return f;do p=c*f/b-a,a=f,f=p,c+=2,++k;while(k=e?1:0},1,2,g,void 0,void 0,{bk:1});l("COMPLEX",function(b,e,a){return"i"!==a&&"j"!==a?ka.Value:L(new aa(b,e),a)},2,3,[u,u,{Hi:5,_i:"i"}],void 0,void 0,{bk:2});l("IMABS",function(b){return T(Z(b.Ri*b.Ri+b.Si*b.Si))},1,1,E);l("IMAGINARY",function(b){return T(b.Si)},1,1,E);l("IMARGUMENT",function(b){return 0===b.Ri&&0===b.Si?ka.DivideByZero:T(S(b.Si,b.Ri))},1,1,E);l("IMCONJUGATE",function(b){return L(new aa(b.Ri,-b.Si))},1,1,E);l("IMCOS",function(b){return L(new aa(V(b.Ri)*Fa(b.Si,!1),-P(b.Ri)*Fa(b.Si,!0)))},1,1,E);l("IMDIV",function(b,e){var a=b.Ri,f=b.Si,k=e.Ri,g=e.Si;return L(new aa((a*k+f*g)/(k*k+g*g),(f*k-a*g)/(k*k+g*g)))},2,2,[E,M]);l("IMEXP",function(b){return L(new aa(v(b.Ri)*V(b.Si),v(b.Ri)*P(b.Si)))},1,1,E);l("IMLN",function(b){var a=b.Ri;b=b.Si;return L(new aa(e(Z(a*a+b*b)),S(b,a)))},1,1,M);l("IMLOG10",function(b){var a=b.Ri;b=b.Si;var f=fa.Ek(N,10);return L(new aa(f*e(Z(a*a+b*b)),f*S(b,a)))},1,1,M);l("IMLOG2",function(b){var a=b.Ri;b=b.Si;var f=fa.Ek(N,2);return L(new aa(f*e(Z(a*a+b*b)),f*S(b,a)))},1,1,M);l("IMREAL",function(b){return T(b.Ri)},1,1,E);l("IMSIN",function(b){return L(new aa(P(b.Ri)*Fa(b.Si,!1),V(b.Ri)*Fa(b.Si,!0)))},1,1,E);l("IMSQRT",function(b){var e,a,f=b.Ri;b=b.Si;return 0===f&&0===b?"0":(e=Z(f*f+b*b),a=S(b,f),L(new aa(Z(e)*V(a/2),Z(e)*P(a/2))))},1,1,E);l("IMSUB",function(b,e){return L(new aa(b.Ri-e.Ri,b.Si-e.Si))},2,2,[E,E]);l("IMPOWER",function(e,a){var f,k,g=e.Ri,c=e.Si;return 0===g&&0===c?0La(b,c));return f&&(c=new Date(k,g,e),v--,c.setMonth(g-v*m),h&&(p=cb(c.getFullYear(),c.getMonth()),c=new Date(c.getFullYear(),c.getMonth(),p))),c}function K(b,e,a,f){return da(Q(b,e,a,!1),b,f)}function O(b,e,a,f){return 0<=ba(f,[0,2,4,5])?360/a:3===f?365/a:da(Q(b,e,a,!1),Q(b,e,a,!0),1)}function H(b,e,a,f){return da(b,Q(b,e,a,!0),f)}function I(b,e,a){var f=e.getFullYear(),k=e.getMonth();e=e.getDate();var g=new Date(f,k,e),c=k-b.getMonth()+12*(f-b.getFullYear());if(g.setMonth(g.getMonth()-c),e===cb(f,k))for(;g.getDate()!==cb(g.getFullYear(),g.getMonth());)g.setDate(g.getDate()+1);return b.getDate()>=g.getDate()&&c--,parseInt(""+(1+c/(12/a)))}function L(b,e,a){return 0e?(a.Xk?a.Wk?va(b-a.Zk)n)switch(c){case 0:case 4:b=da(h,e,c);B=1+parseInt(""+Ra(b/n));break;default:m=new Date(h.getFullYear(),h.getMonth(),h.getDate());for(B=0;32767>B;B++)if(v=new Date(m.getFullYear(),m.getMonth(),m.getDate()),m.setMonth(m.getMonth()+12/g),0<=La(m,e)){B+=parseInt(""+Ra(da(v,e,c))/O(v,m,g,c))+1;break}m=n*F(p,b,h,g,c);v=n*F(b,h,h,g,c);t=n*F(p,h,h,g,c)}return x=k/Da(f,B-1+v/n),d=t/n/Da(f,v/n),y=Da(f,-v/n)*(Da(f,-B)-1/f)/(1/f-1),x+a*(d+y-m/n)}function D(b,e){var a=b.substr(0,3),f={ATS:13.7603,BEF:40.3399,DEM:1.95583,ESP:166.386,EUR:1,FIM:5.94573,FRF:6.55957,GRD:340.75,IEP:.787564,ITL:1936.27,LUX:40.3399,LUF:40.3399,NLG:2.20371,PTE:200.482,SIT:245.18};return f[a]?na(f[a],e):-1}function A(b,e,a,f,k,g,c){function p(b,e,a,f,k){var g=Da(1+b,e);return-(0===b?f+a*e:f*g+a*(0a||0!==c&&1!==c)return ta;a=function(b,e,a,f,k){var g,c=Da(1+b,e);return 0===b?g=(a+f)/e:(g=f*b/(c-1)+a*b/(1-1/c),0=c&&(h+=b?f*e:-f),k++);k<=g;k++)m=0ba(f,[1,2,4])||0<=La(e,a)?ta:b(e,a,f,k)}function w(b,e,a,f,k,g){if(0>ba(g,[1,2,4])||0ba(c,[1,2,4])||0La(m,a));return v=F(f,e,m,c,p),x=F(f,a,m,c,p),d=F(e,a,m,c,p),b?(g*c+100*k*(x-v*(1+h*d/c)))/(h*d+c):(c*(g-h)+100*k*(x-v))/(d*h+100*k*v*d/c)}function C(b,e,a){var f,k,g,c;return 0===a?Na:(f=0>e?Ra(e):ib(e),k=Da(10,Ra(Ha.Ek(a,10))),g=e-f,c=b?g*k/a:g*a/k,wa(f+c))}function c(b,e,a){var f=sa(e),k=0,g=1,c=1/(b+1);for(b=0;bg)return[!1,a];c+=e[k]/Ha.Ck(b,g/365)}return qa(c)?a=isNaN(c)?4.9E-324:c:c===Number.POSITIVE_INFINITY?a=gb:c===Number.NEGATIVE_INFINITY&&(a=-gb),[!0,a]}function h(b,e,a,f){var k,g;return-1g.gl&&(k=a),E===k)return z?[!1,f,g,c]:[!1,f,g];if(0===b?(B=e(c,p,m,E,x,d,y,t,n)-v,T=e(c,p,m,k,x,d,y,t,n)-v):1===b?(B=e(E,c,w,p),T=e(k,c,r,p)):(B=h(E,w,c),T=h(k,r,c)),ra(B)){if(N=B[2],w=B[1],q=B[0],!q)return z?[q,f,g,N]:[q,f,g]}else w=B;if(ra(T)){if(N=T[2],r=T[1],q=T[0],!q)return z?[q,f,g,N]:[q,f,g]}else r=T;return f=(r-w)/(k-E),z?[!0,f,g,N]:[!0,f,g]}function B(b,e,a,f,k,g,p,h,m,v,x,d,y){var t,n;return fa.gl?[!1,a]:(t=b?c(f,k):e(k,g,p,f,m,v,x,d,y)-h,n=L(f,t,a),a=n[1],[!!n[0],a])}function y(b,e,a,f,k){if(eb.gl)return[!1,b,f];a=m(e,a,f,k);return f=a[1],a[0]?(a=L(e,0,b),b=a[1],[!!a[0],b,f]):[a[0],b,f]}function t(b,e,a){var f,k,g=0;return eb.gl?[!1,b,a]:(f=h(e,g,a),a=f[2],g=f[1],f[0]?(k=L(e,g,b),b=k[1],[!!k[0],b,a]):[f[0],b,a])}function E(b,e,g,c,p,h,v,x,d,y){var t,n,B,T,q=0,N=b?15:2;if(!g.Wk||!g.Xk)return b?[!1,g,c]:[!1,g];n=va(g.Zk-g.Yk)/(va(g.Zk)+va(g.Yk));for(t=0;t<100+4*N;t++)if(B=0===t%4?1:2===t%4?2:3,T=b?f(g,c,n,q,0,B):e?k(!0,g,q,0,0,B,m,n,p,c,a):k(!1,g,q,0,0,B,G,n,h,v,x,c,p,d,y),g=T[1],c=T[2],q=b?T[3]:T[2],T[0])return b?[!0,g,c]:[!0,g];return b?[!1,g,c]:[!1,g]}function M(b,e,f,g,p,h,m,v,x,d,y){var t,n,B,T,N,w,r,E=0,z=b?15:2;if(!e.Wk||!e.Xk)return[!1,e];n=va(e.Zk-e.Yk)/(va(e.Zk)+va(e.Yk));for(t=0;t<100+4*z;t++)if(B=0,T=0,N=0===t%4?1:2===t%4?2:3,w=b?k(!0,e,E,B,T,N,c,n,void 0,f,a):k(!1,e,E,B,T,N,q,n,m,v,x,f,g,d,y,p,h),e=w[1],E=w[2],B=w[3],T=w[4],N=w[5],!(b&&null===w[0]||!b&&ya(w[0]))){if(w[0]||(T=b?c(B,f):q(f,g,m,B,x,d,y,p,h)-v,r=L(B,T,e),e=r[1],r[0]))return[!0,e];if(n=va(e.Zk-e.Yk)/(va(e.Zk)+va(e.Yk)),nn&&!(kf.gl);n++){if(q=b?m(k,g,0,c):e(g,c,p,k,v,x,d,y,t)-h,ra(q)){if(T=q[1],B=q[0],!B)return[B,f]}else T=q;if(N=L(k,T,f),f=N[1],N[0])return[!0,f];if(w=f.Xk&&f.Wk?va(f.Zk-f.Yk):f.gl-f.fl,r=(1E-10>va(k)?w:va(k))/1E6,E=0,N=b?a(1,m,k,E,r,f,g,c):a(0,e,k,E,r,f,g,c,p,h,v,x,d,y,t),f=N[2],E=N[1],B=N[0],!B)return[B,f];if(0===E)break;if((z=k-1.000001*T/E,z===k)||(P=va(z-k)/(va(k)+va(z)),k=z,Pf&&!(p=0,m=0,ab.gl);f++){if(v=h(a,p,e),e=v[2],p=v[1],c=v[0],!c)return[c,b,e];if(x=L(a,p,b),b=x[1],x[0])return[!0,b,e];if(v=h(a,m,e,!0),e=v[2],m=v[1],c=v[0],!c)return[c,b,e];if(0===m)break;if((k=a-1.000001*p/m,k===a)||(g=va(k-a)/(va(a)+va(k)),a=k,gb.Zk&&m>b.Yk))return[null,b,e,g]}return[!1,b,e,g]}function k(b,e,f,g,c,p,h,m,v,x,d,y,t,n,B,T,q){var N,w,r,E,z,P,C;switch(p){case 0:g=e.Zk-(e.Yk-e.Zk)/(e._k-e.$k)*e.$k;break;case 1:if(g=(e.Zk+e.Yk)/2,N=b?h(g,x,c,v):h(y,t,v,g,d,n,B,T,q)-x,ra(N)){if(c=N[1],!N[0])return[null,e,f,g,c,p]}else c=N;if(0===c)return e=L(g,c,e)[1],[!0,e,f,g,c,p];if(w=Ta(c*c-e.$k*e._k),0===w)return[null,e,f,g,c,p];g+=(g-e.Zk)*c/w;break;case 3:g=(e.Zk+e.Yk)/2;break;case 2:if(w=0,r=0,E=0,z=0,.1e.Zk&&g>e.Yk))return[null,e,f,g,c,p]}return[!1,e,f,g,c,p]}var x,W,P,V,Z,e,b,v,N,S,X,Y,ka,ja,oa,ma,ea,ga,T,fa,Fa,aa,xa,Ia,la,pa=l(26);u=l(33);var qa=isFinite;l=pa.j;var ba=l.Ea,ra=l.Ca,ya=l.Fa,sa=pa.k.ac;l=u.Convert;var ia=l.Rh,Ka=l.vf,wa=l.Nh,Aa=l.Ph,Va=l.Pa,$a=l.CalcConvertedError,Da=Math.pow,va=Math.abs,Ra=Math.ceil,jb=Math.log,Ta=Math.sqrt,ib=Math.floor,Ga=Math.max,bb=Math.min;l=u.Errors;var Na=l.DivideByZero,Ya=l.Value,ta=l.Number,fb=u.Functions,ua=fb.ak,Ha=fb.Fk,na=Ha.Ak,gb=fb.hk,Za=fb.lk,cb=fb.nk,La=fb.mk,da=fb.pk,Oa=fb.vk;u={Hi:0};l={_i:0,Hi:0};x={Hi:0,aj:"\x3c\x3d 0"};W={Hi:0,aj:"\x3c 1"};P={Hi:0,aj:"\x3c 0"};V={_i:.1,Hi:0};Z={_i:1E3,Hi:0,aj:"\x3c\x3d 0"};e={Hi:6};b={Hi:5};v={_i:!1,Hi:7};N={Hi:2};S={Hi:2,aj:"\x3c\x3d 0"};X={Hi:2,aj:"\x3c 1"};Y={_i:0,Hi:2,aj:["\x3c 0","\x3e 4"]};ka={Hi:2,aj:"\x3d 0",bj:Na};ja={Hi:2,aj:"\x3c 0"};oa={Hi:4,Ii:1,Ji:!0,Ki:!0};ma={Hi:4,Ii:1,Ji:!0,Ki:!0,breakOnConvertError:!0};ea=[e,e,N,Y];ga=[e,e,u,u,N,Y];T=[e,e,x];fa=[u,e,e,u,N,x,{_i:0,Hi:2,aj:["\x3c 0","\x3e 4","\x3d 2"]}];Fa=[u,u,u,l,l];aa=[e,e,x,x,Y];xa=[x,S,x,X,N,N];Ia=[x,X];la=[u,ja];ua("FV",function(b,e,a,f,k){k=k?1:0;var g=Da(1+b,e);return g=0===b?a*e+f:f*g+a*(1+b*k)*(g-1)/b,wa(-g)},3,5,Fa,void 0,void 0,{bk:[3,4]});ua("FVSCHEDULE",function(b,e){for(var a=0;a=g||0>=c?ta:(p=1-f*g/c,0>=p?ta:a/p))},4,5,aa,void 0,void 0,{bk:3});ua("XNPV",function(b,e,a){var f=sa(e),k=sa(a),g=0;if(f!==k)return ta;for(k=0;k=a+1||0!==g&&1!==g)return ta;a=R(b,a,f,k,g);return r(f,a,b,e-1)},4,6,[u,W,W,u,l,{_i:0,Hi:2}],void 0,void 0,{bk:[4,5]});ua("ISPMT",function(b,e,a,f){return wa(f*b*(e/a-1))},4,4,[u,N,ka,u]);ua("PMT",function(b,e,a,f,k){k=k?1:0;var g=Da(1+b,e);return g=0===b?(a+f)/e:(a*g+f)/((1+b*k)*(g-1)/b),wa(-g)},3,5,[u,{Hi:0,aj:"\x3d 0",bj:Na},u,l,l],void 0,void 0,{bk:[3,4]});ua("PPMT",function(b,e,a,f,k,g){if(g=g?1:0,e>=a+1)return ta;a=R(b,a,f,k,g);return a-r(f,a,b,e-1)},4,6,[u,W,u,u,l,l],void 0,void 0,{bk:[4,5]});ua("COUPDAYBS",function(b,e,a,f){return n(K,b,e,a,f)},3,4,ea,void 0,void 0,{bk:3});ua("COUPDAYS",function(b,e,a,f){return n(O,b,e,a,f)},3,4,ea,void 0,void 0,{bk:3});ua("COUPDAYSNC",function(b,e,a,f){return n(H,b,e,a,f)},3,4,ea,void 0,void 0,{bk:3});ua("COUPNCD",function(b,e,a){return n(function(b,e,a){return d(Q(b,e,a,!0))},b,e,a)},3,4,ea,void 0,void 0,{bk:3});ua("COUPNUM",function(b,e,a){return n(I,b,e,a)},3,4,ea,void 0,void 0,{bk:3});ua("COUPPCD",function(b,e,a){return n(function(b,e,a){return d(Q(b,e,a,!1))},b,e,a)},3,4,ea,void 0,void 0,{bk:3});ua("DURATION",function(b,e,a,f,k){return w(!1,b,e,a,f,k)},5,6,ga,void 0,void 0,{bk:5});ua("MDURATION",function(b,e,a,f,k){return w(!0,b,e,a,f,k)},5,6,ga,void 0,void 0,{bk:5});ua("NPER",function(b,e,a,f,k){return k=k?1:0,0===b?0===e?Na:wa(-(a+f)/e):wa(jb((e*(1+b*k)-f*b)/(a*b+e*(1+b*k)))/jb(1+b))},3,5,[{Hi:0,aj:"\x3c\x3d -1"},u,u,l,l],void 0,void 0,{bk:[3,4]});ua("YIELD",function(b,e,a,f,k,g,c){var h,m,v,x,d,y,t,n,T,q,N;if(0>ba(g,[1,2,4])||0=h)return m=K(b,e,g,c),v=H(b,e,g,c),x=O(b,e,g,c),d=g*x/v,y=k/100+a/g-(f/100+m/x*a/g),t=f/100+m/x*a/g,y/t*d;if(T=.1,q={fl:0,gl:1E3,hl:1E-10,Wk:!1,Zk:0,$k:0,Xk:!1,Yk:0,_k:0,al:0},N=p(!1,G,q,T,b,e,a,f,k,g,c),q=N[1],n=N[0],!n){for(T=1E-10;Tp||1p||2p||4p||0p?1:5>p?1.5:6>=p?2:2.5,g*=h,m=Oa(e,a,c),Ka(m))k=0;else{e=ib(m*g*b+.5);b-=e;a=b-f;for(f=0;fa){k=(v=k-f,0===v||1===v?ib(.5*b+.5):0);break a}b-=e}k=e}}return k},6,7,fa,void 0,void 0,{bk:6});ua("AMORLINC",function(b,e,a,f,k,g,c){if(0h?h:1):k===m+1?x-v*m-p:0)}return b},6,7,fa,void 0,void 0,{bk:6});ua("ODDFYIELD",function(b,e,a,f,k,g,c,h,m){var v,x,d;d=.1;if(0>ba(h,[1,2,4])||0k?ta:wa(f/k))},3,3,T);ua("TBILLYIELD",function(b,e,a){var f=d(e)-d(b);return 0<=La(b,e)||365p)return ta;1f&&(v=!0));if(!m||!v)return ta;var d;a:{a=e;var y,t,v=x.hl/2;for(f=0;20>f&&!(p=0,m=0,ax.gl);f++){if(p=c(a,h),t=L(a,p,x),x=t[1],t[0]){d=[!0,x];break a}if(m=c(a,h,!0),0===m)break;if((d=a-1.000001*p/m,d===a)||(y=va(d-a)/(va(a)+va(d)),a=d,yk;k*=2)x=B(!0,void 0,x,e*k,h)[1],x=B(!0,void 0,x,e/k,h)[1];k=M(!0,x,h);x=k[1];g=k[0]}return g?x.al:ta},1,2,[oa,V],0,0,{bk:1});ua("MIRR",function(b,e,a){var f,k,g=0,c=0,p=0,h=0,m=[],v=sa(b);if(2>v)return Na;for(f=0;f=a?Na:Da(-p*Da(1+a,k)/(h*(1+a)),1/(k-1))-1},3,3,[oa,u,u],0,0);ua("XIRR",function(b,e,f){var k,g,c,h,m,v,x,d,t,n=sa(b);c=sa(e);if(n!==c)return ta;for(c=0;cb[c]||g;if(!k||!g)return ta;if(h={fl:-1,gl:1E3,hl:1E-10,Wk:!1,Zk:0,$k:0,Xk:!1,Yk:0,_k:0,al:0},m=p(!0,a,h,f,b,e),h=m[1],m[0])return h.al;for(c=1;1024>=c;c+=c)if(v=c,x=9/(v+9),d=y(h,f,x,b,e),h=d[1],x=d[2],x=v,d=y(h,f,x,b,e),h=d[1],x=d[2],t=E(!1,!0,h,b,e),h=t[1],t[0])return h.al;return ta},2,3,[ma,{Hi:4,Ii:4,Ji:!0,Ki:!0,breakOnConvertError:!0},V],"!\x3d 2","!\x3d 2",{bk:2});ua("RATE",function(b,e,a,f,k,c){var p,h,m,v,x;if(1b;b*=2)v=t(p,c*b,m),m=v[2],p=v[1],v=t(p,c/b,m),m=v[2],p=v[1];v=E(!0,!1,p,m);p=v[1];x=v[0]}return x?p.al:ta},3,6,[x,u,u,l,{_i:0,Hi:2,aj:"\x3c 0",bj:Ya},V],void 0,void 0,{bk:[3,4,5]});ua("VDB",function(b,e,a,f,k,g,c){function p(b,e,a,f,k){var g,c,p;a=k/a;return 1<=a?(a=1,c=1===f?b:0):c=b*Da(1-a,f-1),p=b*Da(1-a,f),g=c-(pg?0:g}function h(b,e,a,f,k,g,c){function h(b,e,a,f,k,g){var c,h,m,v=0,x=0,d=Ra(k),y=b-e,t=!1;for(m=1;m<=d;m++)t?h=x:(c=p(b,e,a,m,g),x=y/(f-(m-1)),x>c?(h=x,t=!0):(h=c,y-=c)),m===d&&(h*=k+1-d),v+=h;return v}var m,v,x,d;if(m=ib(f),v=Ra(k),x=0,c)for(d=m+1;d<=v;d++)c=p(b,e,a,d,g),d===m+1?c*=bb(k,m+1)-f:d===v&&(c*=k+1-v),x+=c;else m=a,f!==ib(f)&&1=a/2&&(d=f-a/2,f=a/2,k-=d,m+=1),b-=h(b,e,a,m,f,g),x=h(b,e,a,a-f,k-f,g);return x}return kba(g,[1,2,4])||0<=La(b,a))return ta;if(1===g||0===c||4===c)return g=J(b,a,c),b=Za(b,c),0>g||0>=b?ta:g/b*f*k;p=b.getFullYear();h=b.getMonth();m=b.getDate();b=a.getFullYear();v=a.getMonth();x=a.getDate();y=e.getMonth();t=e.getDate();e=[];n=[];B=[];T=[31,28,31,30,31,30,31,31,30,31,30,31];for(q=0;qe[q]?2001:2002,B[q]=d(new Date(y,e[c],n[c]))-d(new Date(2001,e[q],n[q]));t=0;for(a=d(a);pe[q-1]);)q++;for(;qe[q]||h===e[q]&&m>=n[q])&&(q++,h!==e[q-1]||m!==n[q-1]););q--;c=q===g-1?0:q+1;y=12<=h+12/g?p+1:p;p=d(new Date(p,h,m));h=Math.min(d(new Date(y,e[c],n[c])),a);t+=k*f/g*(h-p)/B[q];p=y;h=e[c];m=n[c]}return t},6,8,[e,e,e,x,Z,N,Y],void 0,void 0,{bk:[4,6,7]});ua("ACCRINTM",function(b,e,a,f,k){if(0e||0>=b?ta:f*a*e/b},3,5,[e,e,x,Z,Y],void 0,void 0,{bk:[3,4]});ua("DISC",function(b,e,a,f,k){if(0<=La(b,e))return ta;var g=Za(b,k);b=J(b,e,k);return 0>=b||0>=g?ta:(f-a)/f*(g/b)},4,5,[e,e,x,x,Y],void 0,void 0,{bk:3});ua("EFFECT",function(b,e){return Da(1+b/e,e)-1},2,2,Ia);ua("INTRATE",function(b,e,a,f,k){if(0<=La(b,e))return ta;e=J(b,e,k);b=Za(b,k);return 0>=e||0>=b?ta:(f-a)/a*(b/e)},4,5,aa,void 0,void 0,{bk:3});ua("NOMINAL",function(b,e){return e*(Da(1+b,1/e)-1)},2,2,Ia);ua("DB",function(b,e,a,f,k){var g,c,p;if(a+(12>k?1:0)a?ta:(b-e)*(a-f+1)*2/(a*(a+1))},4,4,[u,P,X,S]);ua("DOLLARDE",function(b,e){return C(!0,b,e)},2,2,la);ua("DOLLARFR",function(b,e){return C(!1,b,e)},2,2,la);ua("PRICE",function(b,e,a,f,k,g,c){return 0>ba(g,[1,2,4])||0=e||0>=b?ta:f-a*f*e/b},4,5,aa,void 0,void 0,{bk:3});ua("PRICEMAT",function(b,e,a,f,k,g){var c,p,h,m,v;return 0<=La(b,e)?ta:(c=J(b,e,g),p=J(a,e,g),h=J(a,b,g),m=Za(b,g),0>=h||0>=m||0>=c||0>=p?ta:(v=1+c/m*k,0===v?ta:(100+p/m*f*100)/v-h/m*f*100))},5,6,[e,e,e,P,P,Y],void 0,void 0,{bk:5});ua("ODDFPRICE",function(b,e,a,f,k,g,c,p,h){return 0>ba(p,[1,2,4])||0f&&(e=[a,a=e][0]),b[a*f+e]}return b[0]}function J(b,e){return!p(e)&&(!!((p(b)||V(b,!0))&&V(e,!0)||ja(b)&&ja(e))||!(!oa(b)||!oa(e)))}function R(b,e,a,f,k){if(0>b||0>e||ee)return-1;if(k)return q=b,D=e,A=a,r=a,n=f,w=f,A;if(n){if(A++,A>D){if(n!==w)return-1;A=r-1;n=!1}}else if(A--,Aa&&y>g&&(v=y,p=!0);if(-1===y&&1<=a!=(2===m))return x;if(-1===y)return-1;if(m=Q(c,k,!1),1<=a&&1===m)v=y+1;else if(1<=a&&2===m)t=y-1;else if(-1>=a&&1===m)t=y-1;else if(-1>=a&&2===m)v=y+1;else if(0===m){for(;-1>=a&&y>v||0<=a&&ym||0<=m&&1===k)&&(m=b,h=c);else if(-1>=a&&2===k)k=-1,0<=m&&(k=Q(c,h,!1)),(0>m||0<=m&&2===k)&&(m=b,h=c);else if(0===k)return b;return m}function I(b,a,f){if(!b)return e;var k=b.arrayFormulaMode,g=void 0!==a,c=f?0:1;return a=g?a:b.getReference(b.source,B.qf(b.row,b.column,b.rowCount,b.columnCount)),a&&1===a.getRangeCount()?k&&g?new z(a.getSource(),a.getRow(0),a.getColumn(0),a.getRowCount(0),1,c):(f?a.getRow(0):a.getColumn(0))+1:e}function L(e,a,f,k,g){if(g&&f>a.colCount||!g&&f>a.rowCount)return b;e=k?O(e,a,1,g):H(e,a,0,g);return 0<=e?g?K(a,f-1,e):K(a,e,f-1):v}function F(b,e,a,f){return L(b,e,a,f,!1)}function G(b,e,a,f){return L(b,e,a,f,!0)}var q,D,A,r,n,w,z,C,c,m,h,a=l(26),B=l(33),y=a.q,t=a.j,E=a.l.lb,M=t.Ia,p=t.Fa,g=t.G,f=a.k.ac,k=B.Convert,x=k.vf,W=k.Rh,P=k.Sh,V=k.Na,Z=k.Pa;u=B.Errors;var e=u.Value,b=u.Reference,v=u.NotAvailable,N=B.Parser,S=B.CalcReference,X=B.CalcArrayHelper,Y=B.Functions,ka=Y.ak,ja=Y.ik,oa=Y.jk,ma=function(b,e,a,f){return{row:b,col:e,rowCount:a,colCount:f}};z=function(b){function e(e,a,f,k,g,c){b.call(this,e,[ma(a,f,k,g)]);this.cj=a;this.Lk=f;this.Xj=k;this.Yj=g;this.Nc=c}g(e,b);return M(e.prototype,{type:function(){return this.Nc},getValue:function(e,a,f){var k=this.Nc;return 0===k?this.getRow(0)+1+a:1===k?this.getColumn(0)+1+f:b.prototype.getValue.call(this,e,a,f)},toArray:function(e,a){var f=[],k=this.cj,g=this.Lk,c=this.Nc,p=this.getRangeCount(),h=this.Xj,m=this.Yj,v,x,d,y,t,n;for(v=0;vb&&(c||!d)||b>B.maxRowCount||1>k&&(c||!y)||k>B.maxColumnCount||1>g||8E?e:n*q=t.getRangeCount()?b:(n=t.getRowCount(m),q=t.getColumnCount(m),z=t.getRow(m),C=t.getColumn(m),-1===c&&!d&&1c||-1>h||0>m?e:n<=c||q<=h||t.getRangeCount()<=m?b:-1===c&&-1===h?t.create([ma(z,C,n,q)]):-1===c?t.create([ma(z,r,n,1)]):-1===h?t.create([ma(w,C,1,q)]):t.create([ma(w,r,1,1)])))):k.Ca(g)?(l=g,n=l.getRowCount(),q=l.getColumnCount(),c=void 0!==c?W(c):-1,h=void 0!==h?W(h):-1,m=void 0!==m?W(m)-1:1,1!==m?b:(-1===c&&-1===h?c=h=0:-1===h&&1===n&&(h=c,c=1),c=-1===c?0:c,h=-1===h?0:h,n=l.getRowCount(),q=l.getColumnCount(),0>c||0>h||0>m?e:(c>n&&1===n&&void 0===h&&(h=c,c=0),n=g||0>=c||0>h||p.getRowCount()m||p.getColumnCount()p?F(b,e,p):G(b,e,c),x(f)?v:f;if(a=k.Ph(a,0,!0,!1,!1)){if(1p)),0<=g?(c=a.colCount,p=a.rowCount,c>p?K(a,g,p-1):K(a,c-1,g)):v},2,3,[h,h],"!\x3d 0","!\x3d 0",{fk:1});ka("HLOOKUP",F,3,4,[h,h,m,u],1,1,{bk:3});ka("VLOOKUP",G,3,4,[h,h,m,u],1,1,{bk:3});ka("CHOOSE",function(b){var a=arguments;return 1>b||f(a)<=b?e:p(a[b])?0:a[b]},2,255,l,"\x3e\x3d 1","\x3e\x3d 1",{gk:"\x3e\x3d 1",isBranch:!0,findTestArgument:0,findBranchArgument:function(b){var e={value:-1};return x(b)?-1:(P(b,e),e.value)}});ka("MATCH",function(b,e,a){function k(b,e){var a,k,g,c,p=f(b);for(a=1;at.Ea(m.type,[1,13])?b:(x=m.source||e.source,25===m.type||26===m.type?x.getValueByName(m.nameIdentity):(d=m.getRange(k,g),13===m.type&&(x=m.source()),1!==d.rowCount||1!==d.colCount||e.acceptsReference||e.arrayFormulaMode?x.getReference(d):x.getValue(d.row,d.col)))):b):b:v},1,2,[{Hi:5},u],void 0,void 0,{bk:2,ck:!0,dk:!0});U.exports=Y},function(U,u,l){function d(b,e,a,f){var k,g;k=[];n(b,k);b=Ja(k);if(0===b||ek[b-1])a=mb;else{if(1===b)e=1;else{var c,p,h,m,v=Ja(k);if(e!==k[0]){p=0;h=k[0];for(b=1;bWa(d)&&(d=1E-50);g=d=1/d;for(f=1;300>=f&&(k=f+f,c=(e-f)*f*a/((v+k)*(b+k)),d=1+c*d,1E-50>Wa(d)&&(d=1E-50),x=1+c/x,1E-50>Wa(x)&&(x=1E-50),d=1/d,g*=d*x,c=0-(b+f)*(h+f)*a/((b+k)*(m+k)),d=1+c*d,1E-50>Wa(d)&&(d=1E-50),x=1+c/x,1E-50>Wa(x)&&(x=1E-50),d=1/d,p=d*x,g*=p,!(1E-20>Wa(p-1)));f++);return g}function R(b){return[2.2250738585072014E-308,1.7976931348623157E308,ab(2,-53),ab(2,-52),oc.Ek(2,10)][b-1]||0}function Q(b,e,a){var f=0,k=0,g;if(1>e)return 0;for(g=1;g<=e&&!(f=e-g,k+=Wa(Ea(b[f])),k>a);g++);return f}function K(b,e,a){var f,k,g,c;if(1>a||1E3b||1.1b?NaN:b>=g?4.930380657631324E-32:b=b?NaN:.375>=Wa(b)?b*(1-b*K(b/.375,e,a)):Ba(b+1)}function I(b){var e,a,f,k;e=1;var g=[1,.5772156649015329,-.6558780715202538,-.0420026350340952,.1665386113822915,-.0421977345555443,-.009621971527877,.007218943246663,-.0011651675918591,-2.152416741149E-4,1.280502823882E-4,-2.01348547807E-5,-1.2504934821E-6,1.133027232E-6,-2.056338417E-7,6.116095E-9,5.0020075E-9,-1.1812746E-9,1.043427E-10,7.7823E-12,-3.6968E-12,5.1E-13,-2.06E-14,-5.4E-15,1.4E-15];if(171b&&(a=-vb/(b*a*tc(vb*b))))}return a}function L(b){var e,a,f,k,g=0,c=[.08333333333333333,-.002777777777777778,7.936507936507937E-4,-5.952380952380952E-4,8.417508417508418E-4,-.001917526917526918,.00641025641025641,-.02955065359477124,.1796443723688307,-1.3924322169059],p=b;if(0>=b)return 1E308;if(1===b||2===b)return 0;7>=b&&(g=Rb(7-b),p=b+g);e=1/(p*p);a=2*vb;f=c[9];for(k=8;0<=k;k--)f=f*e+c[k];if(e=f/p+.5*Ba(a)+(p-.5)*Ba(p)-p,7>=b)for(k=1;k<=g;k++)e-=Ba(p-1),--p;return e}function F(b,e){var a,f,k,g=f=b;return ef&&(f=e),0>g?NaN:0===g?za:10<=g?(a=O(g)+O(f)-O(g+f),-.5*Ba(f)+.9189385332046728+a+(g-.5)*Ba(g/(g+f))+f*H(-g/(g+f))):10<=f?(a=O(f)-O(g+f),k=L(g),Pa(k)?NaN:Ea(k)+a+g-g*Ba(g+f)+(f-.5)*H(-g/(g+f))):Ba(I(g)*(I(f)/I(g+f)))}function G(b,e,a,f){var k,g,c,p,h,m,v,x,d,t;k=b.ge(e);g=b.ge(a);for(p=0;1E3>p&&!(0>k&&0g);p++)Wa(k)<=Wa(g)?(c=e,e+=2*(e-a),0>e&&(e=0),a=c,g=k,k=b.ge(e)):(c=a,a+=2*(a-e),e=c,k=g,g=b.ge(a));if(0===k)return e;if(0===g)return a;if(!(0>k&&0g))return f.jl=!0,0;f=e;c=k;h=a;m=g;v=e;x=k;d=.5*(e+a);t=!0;for(p=0;500>p&&1E-3072.22045E-16*Db(Wa(e),Wa(a));)t&&(c!==m&&m!==x&&x!==c?(d=f*x*m/(x-c)/(m-c)+v*m*c/(m-x)/(c-x)+h*c*x/(c-m)/(x-m),t=ek&&0x?(a=v,g=x):(e=v,k=x),t=t&&2*Wa(x)<=Wa(m),++p;return v}function q(b,e){var a,f,k,g,c=Ja(e);for(a=0;a=e;e++)f+=a[e]/++k;return-g+Ba(2.5066282746310007*f/b)}function A(b,e){var a,f,k,g,c=Ja(e);for(g=0;g=b?0:1<=b?1:1===a?ab(b,e):1===e?-B(a*q(-b)):(k=.5-b+.5,g=q(-b),p=b,h=Ba(b),v=e,x=a,d=b>e/(e+a),d&&(v=a,x=e,p=k,k=b,h=g,g=Ba(b)),f=C(p,v,x),f/=v,t=v/(v+x),y=x/(v+x),n=1t&&.97>y?c(p,v,x)*p*k:Sa(v*h+x*g-m(!1,v,x)),f*=n,d&&(f=.5-f+.5),1f&&(f=0),f)}function C(b,e,a){var f,k,g,c,p,h,m,v,x=1,d=1,t=1-(e+a)/(e+1)*b;0===t?(f=0,k=1,h=1):(f=1,k=1/t,h=f*k);m=p=1;v=!1;do g=e+2*m,c=m*(a-m)*b/((g-1)*g),g=-(e+m)*(e+a+m)*b/(g*(g+1)),x=(f+c*x)*k,d=(t+c*d)*k,f=x+g*f*k,t=d+g*t*k,0!==t&&(k=1/t,p=f*k,v=Wa(h-p)<2.22045E-16*Wa(h)),h=p,m+=1;while(5E4>m&&!v);return h}function c(b,e,a){var f,k,g,c,p,h,v;return 1===e?1===a?1:2===a?-2*b+2:.01>=b?a+a*Sa((a-1)*Ba(1-b))-1:a*ab(.5-b+.5,a-1):1===a?2===e?e*b:e*ab(b,e-1):0>=b&&!(1>e&&0===b)||1<=b&&!(1>a&&1===b)?0:(f=Ba(R(2)),k=Ba(R(1)),g=Ba(1-b),c=Ba(b),p=(e-1)*c,h=(a-1)*g,v=m(!1,e,a),pk&&hk&&vk&&p+hk?ab(b,e-1)*ab(.5-b+.5,a-1)/m(!0,e,a):Sa(p+h-v))}function m(b,e,f){var k,g,c,p,h,m,v=f,x=e;return e>f&&(v=[x,x=v][0]),b&&171.624376956302>v+x?a(v)/a(v+x)*a(x):(k=y(v),k/=y(v+x),k*=y(x),g=v+x+5.52468004077673,c=b?k*Ua(g/(v+5.52468004077673)/(x+5.52468004077673)):Ba(k)+.5*(Ba(g)-Ba(v+5.52468004077673)-Ba(x+5.52468004077673)),p=x/(v+5.52468004077673),h=v/(x+5.52468004077673),m=-v*Ba(1+p)-x*Ba(1+h)-5.52468004077673,b?Sa(m)*c:m+c)}function h(b){var e=y(b),a=b+6.02468004077673-.5,f=ab(a,b/2-.25);return e*=f,e/=Sa(a),e*=f,20>=b&&b===oc.wk(b)&&(e=Tb(e)),e}function a(b){var e,a,f=Ba(vb),k=Ba(R(2));return 171.624376956302=k?Xa:h(b+2)/(b+1)/b):(a=h(1-b)+Ba(Wa(tc(vb*b))),a-f>=k?0:0>a&&f-a>k?Xa:Sa(f-a)*(0>tc(vb*b)?-1:1))}function B(b){return 171.624376956302<=b?h(b):1<=b?Ba(h(b)):.5<=b?Ba(h(b+1)/b):h(b+2)-Ba(b+1)-Ba(b)}function y(b){var e,a,f,k=[2.353137688041076E10,4.29198036426491E10,3.571195923735567E10,1.792103442603721E10,6.039542586352028E9,1.4397204073117216E9,2.4887455786205417E8,3.1426415585400194E7,2876370.6289353725,186056.26539522348,8071.672002365816,210.82427775157936,2.5066282746310002],g=[0,39916800,120543840,150917976,105258076,45995730,13339535,2637558,357423,32670,1925,66,1];if(1>=b)for(e=k[12],a=g[12],f=11;0<=f;--f)e*=b,e+=k[f],a*=b,a+=g[f];else for(b=1/b,e=k[0],a=g[0],f=1;12>=f;++f)e*=b,e+=k[f],a*=b,a+=g[f];return e/a}function t(b,e){var a=b*Ba(e)-e-B(b),a=Sa(a);if(e>b+1){var f=R(3),k=.5*f,g=1/f,c=0,p,h=1-b,m=e+2-b,v,x=e+1,d=1,t=m*e,y=e,n=x/t,q=!1,T=0;do c+=1,h+=1,p=h*c,m+=2,v=x*m-d*p,p=t*m-y*p,0!==p&&(T=v/p,q=Wa((n-T)/T)<=k,n=T),d=x,x=v,y=t,t=p,Wa(v)>g&&(d*=f,x*=f,y*=f,t*=f);while(!q&&1E4>c);a=1-a*(q?n:qb)}else{f=.5*R(3);k=b;c=g=1/b;h=1;do k+=1,g=g*e/k,c+=g,h+=1;while(g/c>f&&1E4>=h);a*=1E4b?k:1-k}return qb}function p(b,e,a){var f={jl:!1};b=function(b,e,a){return{ge:function(f){return b-M(f,e,a)}}}(b,e,a);e=G(b,.5*e,e,f);return f.jl?mb:e}function g(b,e){var a=!1,f=0,k,g,c,p,h;for(g=0;gf||!b&&k=a||f=m)return hb;c/=m;p/=m;for(g=0;g=f)return Xa;c=b?c*f:c+1/f;p++}return b?0>=p?hb:eb(ab(c,1/p)):0===c?hb:eb(p/c)}function V(b,e,a,f,k){var g,c,p,h,m,v,x,d,t,y,n,B,q,T,N,w,r,E,z,P,C;d=e.rowCount;x=e.colCount;if(b)a=void 0!==a?ub(a,1,!1,!0,!0):e;else{if(void 0!==a)g=a;else{t=[];for(g=0;gx?(m[1][0]=Xa,m[1][1]=Xa,m[2][1]=Xa,m[3][0]=Xa):(m[1][0]=Ua(P*x/(r*(x-2))),m[1][1]=Ua(P*B/(r*(x-2))),m[2][1]=Ua((E-z*z/r)/(x*(x-2))),m[3][0]=1===C?Xa:C*(x-2)/(1-C)),m[2][0]=C,m[3][1]=x-2,m[4][0]=E/x-P,m[4][1]=P),new Fb(m)}if(1===x&&d===p||1===d&&x===h){t=[];d=[];y=1===x;x=p;v=h;for(g=0;gg;g++)for(m[g]=[],c=0;cg;g++)for(c=2;ce||1k&&(k=a,f=g[b])}return 0===k?mb:f}function N(b,e,a){var f=gc.CalcArrayHelper;if(kb.Fh(b)){if(1!==f.getLength(b))return qb;b=f.getValueByIndex(b,0)}return Ab(b=Ea(b))?qb:k(!0,e,b,a)}function S(b,e,a){return d(b,e,a,!0)}function X(e,a){var f=vc(a,[0,1,2,3,4]);return 0>f?Xa:b(e,.25*f)}function Y(){return Zb(arguments,!0,8)}function ka(){return Zb(arguments,!0,10)}function ja(){return Zb(arguments,!0,11)}function oa(b,e){return W(!0,b,e)}function ma(b,e,a){b=wa(b/2);return Pa(b)?b:-Ea(b)*(e/Ua(a))}function ea(b,e,a,f,k){function g(b){var e,a=b+5.5;return a-=(b+.5)*Ba(a),e=1.000000000190015+76.18009172947146/(b+1),e-=86.50532032941678/(b+2),e+=24.01409824083091/(b+3),e-=1.231739572450155/(b+4),e+=.001208650973866179/(b+5),e-=5.395239384953E-6/(b+6),Ba(2.506628274631001*e/b)-a}var c,p,h,m,v,x,d,t,y;return b=b?(p=b,v=e,d=a,g=0):(p=1-b,v=a,d=e,g=1);b=Ua(-Ba(p*p));n=b-(2.30753+.27061*b)/(1+(.99229+.04481*b)*b);1=t?B=1-Sa((Ba((1-p)*d)+q)/d):(t=(4*v+b-2)/t,B=1>=t?Sa((Ba(p*v)+q)/v):1-2/(t+1)));b=1-v;t=1-d;a=0;h=1;3E-308>B?B=3E-308:B>c&&(B=c);e=Db(1E-300,ab(10,-13-2.5/(v*v)-.5/(p*p)));for(c=y=x=0;1E3>c;c++){n=B;m=v;var T=d,N=void 0,w,r,E=void 0,z,P=void 0,C=void 0,S,l=void 0,aa=void 0,V=void 0,M=0,W=S=0;w=0;if(0===M&&(M=R(3),S=Ba(M),W=R(1),w=Ba(W)),l=n,aa=m,V=T,aa/(aa+V)w&&0!==l&&(N=Sa(C)),l===n&&aa===m||(N=1-N);else{if(E=V-hc(V),0===E&&(E=1),C=aa*Ba(l)-F(E,aa)-Ba(aa),N=0,C>=w&&(N=Sa(C),P=N*aa,1!==E))for(T=Rb(Db(S/Ba(l),4)),S=1;S<=T;S++)C=S,P=P*(C-E)*l/C,N+=P/(aa+C);if(1=z&&P/M<=r);S++)C=S,P=(V-C+1)*w*P/(aa+V-C),1=n*a&&(x=Db(Wa(h),3E-308));m=1;for(a=0;1E3>a;a++){if(h=m*n,Wa(h)=y)){if(x<=e||Wa(n)<=e)return 0!==g&&(B=1-B),eb((k-f)*B+f);if(0!==y&&1!==y)break}m/=3}if(y===B)break;B=y;a=n}return 0!==g&&(B=1-B),eb((k-f)*B+f)}function T(b,e,a,f){var k,g,c;if(ec?0:c}c=g;for(f=0;f=a;k++)c*=Ea(b-k)/Ea((k+1)*g/e),f-=c;return Ea(b-k)}f=c;for(k=0;k=b)return Xa;if(1E3=b||bb)return 0;if(.999998c)return NaN}else if(.322.2*m+6&&(c=-2*(Ba(1-b)-g*Ba(.5*c)+p))}else{c=.4;f=Ba(1-b)+p+.6931471805599453*g;do m=c,h=1+c*(4.67+c),v=c*(6.73+c*(6.66+c)),q=-.5+(4.67+2*c)/h-(6.73+c*(13.32+3*c))/v,c-=(1-Sa(f+.5*c)*v/h)/q;while(.01=T;T++){if(m=c,h=.5*c,N=ba(h,e,1,!0),Pa(N))return N;if(v=b-Ea(N),q=v*Sa(.6931471805599453*e+p+h-g*Ba(c)),k=q/c,f=.5*q-k*g,x=(210+f*(140+f*(105+f*(84+f*(70+60*f)))))/420,d=(420+f*(735+f*(966+f*(1141+1278*f))))/2520,t=(210+f*(462+f*(707+932*f)))/2520,y=(252+f*(672+1182*f)+g*(294+f*(889+1740*f)))/5040,n=(84+2264*f+g*(1175+606*f))/2520,B=(120+g*(346+127*g))/5040,c+=q*(1+.5*q*x-k*g*(x-k*(d-k*(t-k*(y-k*(n-k*B)))))),5E-7=Wa(h))f=h*h,k=h*(((-25.44106049637*f+41.39119773534)*f-18.61500062529)*f+2.50662823884)/((((3.13082909833*f-21.06224101826)*f+23.08336743743)*f+-8.4735109309)*f+1);else{if(f=b,0h?-k:k):0>h?-za:za;f=Ua(-Ba(f));k=(((2.32121276858*f+4.85014127135)*f-2.29796479134)*f-2.78718931138)/((1.63706781897*f+3.54388924762)*f+1);0>h&&(k=-k)}return g=(k-0)/1,c=.3989422804014327*Sa(-.5*g*g)/1,p=ia(k,0,1,!0),Pa(p)?p:(k-=(p-b)/c,e+a*k)}function wa(b){return Ka(b,0,1)}function Aa(b,e,a){var f=0;if(a)for(a=0;a<=b;a++)f+=Sa(-e)*ab(e,a)/yb.tk(a);else f=Sa(-e)*ab(e,b)/yb.tk(b);return eb(f)}function Va(b,e,a){var f,k,g,c,p,h,m,v;if(1!==a&&2!==a)return Xa;if(f=e,k=b/Ua(f),b=f/(f+b*b),g=f-2,c=f%2,p=1,h=1,f=1,m=2+c,v=m,2<=g)for(m=Rb(m);m<=g&&(h=h*b*(v-1)/v,p+=h,p!==f);m+=2)f=p,v+=2;return 1!==c?a*(1-(.5+.5*k*Ua(b)*p)):(1===e&&(p=0),a*(1-(.5+.3183098862*(k*b*p+$b(k)))))}function $a(b,e){var a,f,k,g,c,p,h,m,v,x,d=b/2;if(1E20d?(v=0,p=2*d):(v=1,p=2*(1-d)),1E-12>Wa(e-2))h=0.05+a){if(x=wa(.5*p),Pa(x))return x;c=Ea(x);m=c*c;5>e&&(k+=.3*(e-4.5)*(c+.6));m=(((((.4*m+6.3)*m+36)*m+94.5)/((((.05*g*c-5)*c-7)*c-2)*c+f+k)-m-3)/f+1)*c;m*=a*m;m=.002=(b+1)/(b+k+2);T&&(b=[k,k=b][0],c=1-c);f=b+k;v=b+1;e=b-1;h=1;p=1-f*c/v;4.450147717014403E-308>Wa(p)&&(p=4.450147717014403E-308);g=p=1/p;m=1;for(x=2;100>=m;m++,x+=2)if(t=m*(k-m)*c/((e+x)*(b+x)),p=1+t*p,4.450147717014403E-308>Wa(p)&&(p=4.450147717014403E-308),h=1+t/h,4.450147717014403E-308>Wa(h)&&(h=4.450147717014403E-308),p=1/p,g*=p*h,t=-(b+m)*(f+m)*c/((b+x)*(v+x)),p=1+t*p,4.450147717014403E-308>Wa(p)&&(p=4.450147717014403E-308),h=1+t/h,4.450147717014403E-308>Wa(h)&&(h=4.450147717014403E-308),p=1/p,y=p*h,g*=y,4.9E-324>Wa(Ea(y-1))){t=(n=B*g/b,T?1-n:n);break a}t=Xa}return d=t,Pa(d)?d:.5*a*Ea(d)}function va(b,e,a,f){var k=Sa(-ab(b/a,e));return eb(f?1-k:e/ab(a,e)*ab(b,e-1)*k)}function Ra(b,e,a){var f,k,g,c,p,h,m=0,v=0,x=0,d=0;if(void 0!==a&&Ab(m=Ea(a)))return qb;for(c=0;ca||c-1=h||(e=k/h,a=Ua((h*c-k*k)/(h*(h-1))),0===a))return hb;for(k=0;k=b+e-1)return Xa;var f=wb(b+e-1,e-1);return Pa(f)?f:eb(Ea(f)*ab(a,e)*ab(1-a,b))},3,3,[Ga,Ga,fb]);ha("NEGBINOM.DIST",function(b,e,a,f){if(0>=b+e-1)return Xa;if(f)return 1-z(1-a,b+1,e);f=ab(a,e);var k;for(k=0;k=b?0:t(e/2,b/2);else{var f,k;if(0>=b)b=0;else{if(1391E3e%2?(f=.5,k=2):(f=1/Ua(2*b*vb),k=1);k=a?0:t(e/2,a/2))}}}(b,e),f={bConvError:!1},a=G(a,.5*e,e,f);return f.jl?mb:a},2,2,Sb);ha("CHITEST",xa,2,2,ob,-1,-1);ha("CHISQ.TEST",xa,2,2,ob,-1,-1);ha("CORREL",function(b,e){var a,f,k,g,c,p,h,m,v=0,x=0,d=0,t=0,y=0,n=Ja(e);if(n!==Ja(b))return mb;for(p=c=0;p=c||(a=v/c,f=x/c,k=Ua((c*d-v*v)/(c*(c-1))),g=Ua((c*t-x*x)/(c*(c-1))),0===k||0===g))return hb;for(p=0;pfc(e,a)||bf||a>f?Xa:E(b,e,a,f)},4,4,[Na,Na,Na,Na]);ha("HYPGEOM.DIST",function(b,e,a,f,k){var g;if(b>fc(e,a)||bf||a>f)return Xa;if(k){for(g=k=0;g<=b;g++)k+=E(g,e,a,f);return k}return E(b,e,a,f)},5,5,[Na,Na,Na,Na,Ta]);ha("LOGNORMDIST",function(b,e,a){return Nb((Ba(b)-e)/a)},3,3,[Ha,ta,Ha]);ha("LOGNORM.DIST",function(b,e,a,f){if(f)return Nb((Ba(b)-e)/a);e=(Ba(b)-e)/a;return.3989422804014327*Sa(-(e*e)/2)/a/b},4,4,[Ha,ta,Ha,Ta]);ha("LOGINV",sa,3,3,sb);ha("LOGNORM.INV",sa,3,3,sb);ha("NORMDIST",ia,4,4,tb);ha("NORM.DIST",ia,4,4,tb);ha("NORMINV",Ka,3,3,sb);ha("NORM.INV",Ka,3,3,sb);ha("NORMSDIST",Nb,1,1,ta,void 0,void 0);ha("NORMSINV",wa,1,1,Za);ha("NORM.S.INV",wa,1,1,Za);ha("NORM.S.DIST",function(b,e){var a;if(e){var f=b,k,g;a=(f=.7071067811865475*-f,k=Ea(f),Ab(k)?qb:(g=Nb(k*Ua(2)),Pa(g)?NaN:.5*(2-2*parseFloat(g))))}else a=Sa(-ab(b,2)/2)/Ua(2*vb);return a},2,2,[ta,Ta]);ha("PEARSON",function(b,e){var a,f,k,g,c=0,p=0,h=0,m=0,v=0,x=Ja(b);if(x!==Ja(e))return mb;for(f=a=0;f=h||1=v||(b=p/v,e=Ua((v*h-p*p)/(v*(v-1))),0===e))return hb;for(a=0;ab?-p(1-b,e,4):p(b,e,4)},2,2,[{Hi:0,aj:["\x3c\x3d 0","\x3e 1"]},Ya]);ha("TTEST",Da,4,4,rb,[0,1],[0,1]);ha("T.TEST",Da,4,4,rb,[0,1],[0,1]);ha("WEIBULL",va,4,4,rc);ha("WEIBULL.DIST",va,4,4,rc);ha("ZTEST",Ra,2,3,zb,0,0,{bk:2});ha("Z.TEST",Ra,2,3,zb,0,0,{bk:2});ha("PERMUT",function(b,e){b=Ea(Rb(b));e=Ea(Rb(e));var a=1,f;if(0>b||0>e||bf?(f=a,k=[],k.push([g[b]])):a===f&&k.push([g[b]])}return 0===f?mb:new Fb(k)},1,void 0,Qa,-1,-1);ha("PERCENTILE.EXC",jb,2,2,[Oa,ua],0,0);ha("QUARTILE.EXC",function(b,e){var a=vc(e,[1,2,3]);return 0>a?Xa:jb(b,.25*(a+1))},2,2,[Oa,Ga],0,0);ha("RANK.AVG",function(b,e,a){return 1=a?1:(b=20*a,e=V(b),.82e)for(a=!1;;){if(h=b.substring(0,p),m=y.measureText(h).width,m===e||a&&me){if(1===h.length)return v=b.substring(h.length),0!==ea.Xn(v,g,!0)?(t.push(h),t.push(v)):t.push(b),t;--p;a=!0}else d=(e-m)/k,d=1<=d?d:1,p+=d}else b!==f&&0e&&(g="0%");k>a&&(c="0%");b.css("background-position",g+" "+c).css("background-size","auto auto");break;case 2:c=g=0;p=e;h=a;0f/k?(p=f/k*a,g=g+e/2-p/2):0k/f&&(h=k/f*e,c=c+a/2-h/2);b.css("background-position",g+"px "+c+"px").css("background-size",p+"px "+h+"px");break;case 3:b.css("background-position","0% 0%").css("background-size","auto auto")}};v.rl=v.device=function(){var b,e,a,f,k=p.userAgent,g=k.match(/iPad/i);return g&&(b=g[0],b&&(e="ipad"===b.toLowerCase())),g=k.match(/iPhone/i),g&&(b=g[0],b&&(a="iphone"===b.toLowerCase())),g=k.match(/android/i),g&&(b=g[0],b&&(f="android"===b.toLowerCase())),{ipad:e,iphone:a,android:f}};v.sl=function(){var b=p.platform;return b&&-1=f&&(p=0)),(c||0!==f)&&(p/=100,g.push({color:c,point:p}));return g};v.xl=function(b,e,a,k){var g,c,p,h,m,d,t,y,n,B,q,T,N,w,E,r,z=e.yl,P=0,C=[a];1===k&&(3===a?C.push(1):2===a&&C.push(0));for(a=0;aP&&(P=m)),3===g?k=v.El(k,b,e,g):k++);return 0===P?P=e.defaults.colWidth:P+=x(3/e._zoomFactor),x(P)};v.El=function(b,e,a,f){var k,g=-1,c=a.getRowCount(f);for(b+=1;bq&&(q=m)),3===a?k=v.Gl(b,k,e,a):k++);return 0===q?q=e.defaults.rowHeight:q+=x(3/e._zoomFactor),x(q)};v.Gl=function(b,e,a,f){var k,g=-1,c=a.getColumnCount(f);for(e+=1;eb.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(b)||[];return{browser:b[1]||"",version:b[2]||"0"}}(e);k={};a.browser&&(k[a.browser]=!0,k.version=a.version);k.chrome?k.webkit=!0:k.webkit&&(k.safari=!0);0<=e.indexOf("PhantomJS")&&(k.safari=!1,k.chrome=!0);a=e.toLowerCase();0>a.indexOf("compatible")&&/(trident)(?:.*? rv ([\w.]+)|)/.exec(a)!==f&&k&&(k.mozilla=g,k.msie=!0);e=/Edge\/\d+/.exec(e);e!==f&&0k));g++);return a};v.Z3=function(b,e){var a,f,k=0,g=0;return b!==e&&(a=ga(b).offset(),f=ga(e).offset(),k=a.left-f.left,g=a.top-f.top),{FB:g,EB:k}};u.Ul=u.util=v;N=u.Vl={};N.Wl=function(b){return N.Xl()===b&&b.mm&&b.mm.YH};N.Xl=function(){return E.Yl.activeElement};N.Zl=function(b,e){function a(b){function e(e){var g,c;for(g=0;2>=g;g++)(c=e.call(a,g))&&0!==c.width&&0!==c.height&&(b.$l=!0,f._l(k,c))}var a,f,k,g,c,p;if(b&&!N.Wl(b)&&b.parent&&b.parent.options.hideSelection){a=b.am();f=b.yl;k=f.bm();g=b.getSelections();for(c=0;c=ga(M).find("span.gc-theme-version.ui-widget-header.ui-state-default.wijmoThemeHelper.btn-default").length&&J(S.vm):S.vm=O("gc-theme-version ui-widget-header ui-state-default wijmoThemeHelper btn-default"),S.vm},sm:function(){return S.wm?0>=ga(M).find("span.gc-theme-version.ui-widget-content.wijmoThemeHelper.btn-default").length&&J(S.wm):S.wm=O("gc-theme-version ui-widget-content wijmoThemeHelper btn-default"),S.wm},tm:function(){return S.xm?0>=ga(M).find("span.gc-theme-version.ui-state-hover.wijmoThemeHelper.btn-primary").length&&J(S.xm):S.xm=O("gc-theme-version ui-state-hover wijmoThemeHelper btn-primary"),S.xm},um:function(){return S.ym?0>=ga(M).find("span.gc-theme-version.ui-state-highlight.wijmoThemeHelper.btn-warning").length&&J(S.ym):S.ym=O("gc-theme-version ui-state-highlight wijmoThemeHelper btn-warning"),S.ym},zm:function(){return S.Am?0>=ga(M).find("#gcDummyElement").length&&J(S.Am):S.Am=O("gc-theme-version","gcDummyElement"),S.Am},ad:function(){function b(b){var e,g,c=N.Xl();if(c&&(e=S.Bm(b.target),k.km.forEach(function(b){b&&b(c,e)}),!e))if(c.endEdit())a&&(g=c.mm,g&&g.Cm&&g.Cm()),N.Zl(f);else if(b.cancelable)return!1}var e,a,k=this;k.jm=0;E.addEventListener("keydown",I,!0);E.addEventListener("keyup",L,!0);E.addEventListener("compositionstart",F,!0);E.addEventListener("selectstart",G,!0);e=v.rl();a=e.ipad||e.iphone;p.msPointerEnabled?ga(M).bind("MSPointerDown",b):a?ga(M).bind("touchstart",b):(ga(M).bind("pointerdown",b),ga(M).bind("mousedown",b));ga(M).bind("DOMContentLoaded",function(){S.qm()})},Bm:function(b){for(var e;b&&"BODY"!==b.tagName&&"function"===typeof b.getAttribute;){if(e=b.getAttribute("gcUIElement"),e||(e=b.gcUIElement),e)return b;b=b.parentNode}return f},Dm:function(b,e){var a,f,k,c,p=S.rm();return 1===b||2===b?p=S.um():4===b&&(p=S.tm()),a=p.className,ga(p).removeClass(a).addClass(e),f=H(p),k={backgroundColor:f.backgroundColor,backgroundImage:f.backgroundImage},ga(p).addClass(a),f=H(p),c={backgroundColor:f.backgroundColor,backgroundImage:f.backgroundImage,color:f.color,zIndex:f.zIndex},c.borderLeftColor=f.borderLeftColor,c.borderRightColor=f.borderRightColor,c.borderBottomColor=f.borderBottomColor,c.borderBottomWidth=f.borderBottomWidth,c.borderTopColor=f.borderTopColor,c.borderRightWidth=f.borderRightWidth,c.backgroundImage===k.backgroundImage&&c.backgroundColor!==k.backgroundColor&&(c.backgroundImage=g),ga(p).removeClass(e),c},Em:function(b){var e,f=S.zm();return ga(f).removeClass(f.className).addClass("gc-theme-version "+b),e=H(f),a({},e)},Fm:function(b){var e,f=S.sm();return ga(f).removeClass(f.className).addClass("gc-theme-version ui-widget-content wijmoThemeHelper btn-default "+b),e=H(f),a({},e)},Gm:function(){E.Yl.jm++},Hm:function(){var b=E.Yl;b.jm--;0>b.jm&&(b.jm=0)}};E.Yl||(E.Yl=new K);u.VisualState={normal:0,highlight:1,selected:2,active:3,hover:4};u.SortState={none:0,ascending:1,descending:2};X=u.Im={styleCache:{}};X.Jm=function(b){return{0:"normal",1:"highlight",2:"selected",3:"active",4:"hover"}[b]||""};X.Km=function(b,e){var a=X.Jm(b)+e,f=X.styleCache;return f[a]||(f[a]=S.Dm(b,e)),f[a]};X.Lm=function(b){var e=X.styleCache;return e[b]||(e[b]=S.Em(b)),e[b]};X.Mm=function(b){var e="content"+b,a=X.styleCache;return a[e]||(a[e]=S.Fm(b)),a[e]};X.Nm=function(){X.styleCache={}};q.prototype.clone=function(){return new q(this.x,this.y)};u.Point=q;D.prototype={intersect:function(b,e,a,f){return b=e){a=-1;k=!0;for(p=0;p=e)return[b]}b=b.split(/\r\n|\r|\n/);for(f=0;fa?(p=q.pop(),0===q.length?(v=h(p,a),q.push(v[0]),2===v.length?E[B]=v[1]:B++,w[t++]=q.join(""),T=!1,q=[]):(T=!0,B--)):N=k.length||a.priority>k[f].priority){k.splice(f,0,a);break}};b.ao=function(e,a,f){var k,g,c=b._n;if(c)for(k=0;kf&&(f=0),f+"px"):f}function O(a,f,g){var k,c,p,e=a.nodeType;if(a&&3!==e&&8!==e&&2!==e)return p=1!==e,p&&(f=y[f]||f,c=t[f]),A(g)?c&&"get"in c&&null!==(k=c.get(a,f))?k:a[f]:c&&"set"in c&&!A(k=c.set(a,g,f))?k:a[f]=g}function H(a){var f,k,g,c=a.nodeType;return(!c||1===c||9===c)&&(f={embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},k=a.nodeName,g=k&&f[k.toLowerCase()],!g||!0!==g&&a.getAttribute("classid")===g)}function I(a){return a.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(a,f){return f.toUpperCase()})}function L(a,f,c,h){if(H(a)){var k,m,e=p,b=q(f),v=a.nodeType,x=v?M:a,d=v?a[e]:a[e]&&e;if(d&&x[d]&&(h||x[d].data)||!b||!A(c))return d||(v?a[e]=d=g++:d=e),x[d]||(x[d]={},v||(x[d].toJSON=function(){})),(D(f)||"function"==typeof f)&&(h?x[d]=J.extend(x[d],f):x[d].data=J.extend(x[d].data,f)),k=x[d],h||(k=k.data||(k.data={})),A(c)||(k[I(f)]=c),b?(m=k[f],null!==m&&void 0!==m||(m=k[I(f)])):m=k,m}}function F(a,f,g){var k,c,h,e,b,m,x;if(H(a)&&(k=function(b){for(var e in b)if(("data"!==e||!J.isEmptyObject(b[e]))&&"toJSON"!==e)return!1;return!0},b=a.nodeType,m=b?M:a,x=b?a[p]:p,m[x])){if(f&&(e=g?m[x]:m[x].data)){J.isArray(f)?f=f.concat(J.map(f,I)):f in e?f=[f]:(f=I(f),f=f in e?[f]:f.split(" "));c=0;for(h=f.length;cg,p=c?null:[],e=c?g+1:k.length,b=c?g:0;for(0>g&&(b=e);bk.indexOf(" "+g+" ")&&(k+=g+" ");f.className=J.trim(k)}return this},removeClass:function(a){var f,k,g,c,p,e=0,b=this.length,h=/[\t\r\n]/g;for(f=(a||"").match(/\S+/g)||[];e=T)?!1:(x[y]&&(O=x[y]),(0,L.nV)(A)&&(x[h]||x[a])&&!(0,L.mH)(x[h],x[a],A,!x.hasOwnProperty(y))?!1:!0):!1}else k=!1;f=e=k}f&&Ia(la())}}catch($a){ga=0,fa=!0}finally{aa--}d&&!b&&d.call(p,e,la)}function q(b,e,a,f){!(0,L.nV)(A)||G&&u&&x()||(0,L.timeout)(function(){return(f||p[n]||function(){})(b||2E3,e,a,q)},b)}function l(b,e){G&&u&&t(!0);x()?!Fa[b]:(0,L.timeout)(function(){return q(0,L.undefined,la,function(){e?e(2E3,la,q):(0,L.invalid_op)()})},1)}var e,b,v,N,S,X,Y,G,u,H,K,O,ga,T,fa,Fa,aa,xa,Ia,la;if(!(this instanceof M))throw new TypeError("Cannot call a class as a function");e=(0,L.storage)();b=k[0];v=k[1];N=w;S=!1;H=u=G=Y=X="";K=!1;O=L.undefined;ga=0;T=L.undefined;fa=!1;Fa=L.undefined;aa=0;xa=L.undefined;Ia=function(b){return e[g]=JSON.stringify(b)};la=function(){var b={};return b.m=ga,b.dp=Y,b.n=H,b.b=K,b.e=fa,fa||(b.d=T),b.f=Fa,b.adr=O,b};(function(b,e){b&&0>=aa&&(ga=b.m,e&&(Y=b.dp),H=b.n,K=b.b,fa=b.e,T=b.d,O=b.adr,Fa=b.f)})(I(e[g]),!0);ga=-1;K=!(0,L.nV)(A);(0,F["default"])(f,function(b){var e=p[b];p[b]=function(){(0,L.nV)(A)&&!x()&&l(b,p[n]);e&&e.apply(p,arguments)}.bind(p)});D(p,r,{get:function(){return X},set:function(e){S=!0;X=e;try{var a=b().co(),f,k,g,c;e&&-1!==(f=e.indexOf(a))&&(k=e.substring(0,f),g=e.substr(f+a.length),c=I(b().de(g)),N=a,Y=k,G=c.D,u=c.S)}catch(ia){q(0,ia,la,p[n])}t()},enumerable:!1,configurable:!1});d&&!(0,L.nV)(A)&&(0,L.timeout)(function(){S||d.call(p,x(),la)},0)}},function(d,l){(function(d){function d(d,l){I[d]=l}var u,I,L,F,G;Object.defineProperty(l,"__esModule",{value:!0});u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(d){return typeof d}:function(d){return d&&"function"==typeof Symbol&&d.constructor===Symbol?"symbol":typeof d};l.mH=function(d,l,A,r){var n=A("JYx3Gb#8Pb5R");A=A("Zdg3Ga#UHbw5");var n=I[n]&&I.location[A],q;if(n){n=n.toLowerCase();A=d.split(",");var z;if(z=d)a:{z=n;var C,c,m,h;for(C in A){if(c=A[C],m=!1,c&&0===c.lastIndexOf("*.",0)&&(m=!0),c=m?c.slice(2):c,c===z){z=L;break a}if(m&&(h=z.indexOf("."+c),0=arguments.length||void 0===arguments[1]?1:arguments[1],q=d.charCodeAt(0);return 65<=q&&90>=q?d.toLowerCase():97<=q&&122>=q?d.toUpperCase():48<=q&&57>=q?r(48+(q-48+10+n)%10):d}function F(d){var n=d.split(""),q=function(d){return L(d,-1)};for(d=n.length-5;0<=d;d--)I(n,d+1,d+3,q),I(n,d,d+2,q);return n.join("")}var G,q,D,A,r;Object.defineProperty(l,"__esModule",{value:!0});G=function(){function d(d,n){var q,c;for(q=0;q=arguments.length||void 0===arguments[1]?"A0":arguments[1];if(!(this instanceof d))throw new TypeError("Cannot call a class as a function");n&&"string"==typeof n||(0,q.invalid_op)("Invalid Key");this.c=w;this.k=n}return G(d,[{key:"co",value:function(){return"#"+this.c}},{key:"en",value:function(d){var n;if(d){d=A.getBytes(d);d=D.fromBytes(d);d=d.replace("\x3d\x3d","\x26");d=d.replace("\x3d","#");n=Math.floor(d.length/2);d=d.substr(n)+d.substr(0,n);d=d.split("").reverse().join("");n=d.split("");for(d=0;d>18&63,u=F>>12&63,L=F>>6&63,F&=63,D+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d".charAt(l)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d".charAt(u)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d".charAt(L)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d".charAt(F);while(q>16&255,u=L>>8&255,L&=255,D.push(l),64!==F&&(D.push(u),64!==G&&D.push(L));while(q>6)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(63&u);for(l+1==d.length?(u=parseInt(d.substring(l,l+1),16),L+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(u<<2)):l+2==d.length&&(u=parseInt(d.substring(l,l+2),16),L+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(u>>2)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((3&u)<<4));0<(3&L.length);)L+="\x3d";return L};l.toHex=function(d){var l,u,L="",F=0,G=0;for(l=0;lu||(0==F?(L+="0123456789abcdef".charAt(u>>2),G=3&u,F=1):1==F?(L+="0123456789abcdef".charAt(G<<2|u>>4),G=15&u,F=2):2==F?(L+="0123456789abcdef".charAt(G),L+="0123456789abcdef".charAt(u>>2),G=3&u,F=3):(L+="0123456789abcdef".charAt(G<<2|u>>4),L+="0123456789abcdef".charAt(15&u),F=0));return 1==F&&(L+="0123456789abcdef".charAt(G<<2)),L}},function(d,l,u){function H(d){for(var q,n=d.length,w=-1,l="";++w>>10&1023|55296),q=56320|1023&q),l+=G(q);return l}function I(d){55296<=d&&57343>=d&&(0,F.invalid_cdc)("Lone surrogate U+"+d.toString(16).toUpperCase()+" is not a scalar value")}function L(d){if(0==(4294967168&d))return[d];var q=[];return 0==(4294965248&d)?q.push(d>>6&31|192):0==(4294901760&d)?(I(d),q.push(d>>12&15|224),q.push(d>>6&63|128)):0==(4292870144&d)&&(q.push(d>>18&7|240),q.push(d>>12&63|128),q.push(d>>6&63|128)),q.push(63&d|128),q}var F,G,q,D;Object.defineProperty(l,"__esModule",{value:!0});l.getBytes=function(d){for(var q,n,w=[],l=0,C=d.length;l=q&&l=w&&(0,F.invalid_cdc)(D);var c=255&d[l];return l++,128==(192&c)?63&c:void(0,F.invalid_cdc)(q)}function n(){var c,h,a,n,y;if(l>w&&(0,F.invalid_cdc)(D),l==w)return!1;if(c=255&d[l],l++,0==(128&c))return c;if(192==(224&c)){if(h=r(),y=(31&c)<<6|h,128<=y)return y;(0,F.invalid_cdc)(q)}if(224==(240&c)){if(h=r(),a=r(),y=(15&c)<<12|h<<6|a,2048<=y)return I(y),y;(0,F.invalid_cdc)(q)}return 240==(248&c)&&(h=r(),a=r(),n=r(),y=(15&c)<<18|h<<12|a<<6|n,65536<=y&&1114111>=y)?y:void(0,F.invalid_cdc)()}var w,l,C,c;w=d.length;l=0;for(C=[];!1!==(c=n());)C.push(c);return H(C)};F=u(2);G=String.fromCharCode;q="Invalid continuation byte";D="Invalid byte index"},function(d,l,u){var H,I,L;Object.defineProperty(l,"__esModule",{value:!0});H=function(){function d(d,q){var l,A;for(l=0;l>>4*r&15,n+=q.toString(16);return n}var L,F,G,q;Object.defineProperty(l,"__esModule",{value:!0});L=u(2);F=function(d){var q,r;if(d&&d.__esModule)return d;if(q={},null!=d)for(r in d)Object.prototype.hasOwnProperty.call(d,r)&&(q[r]=d[r]);return q["default"]=d,q}(u(6));G=(d=u(9))&&d.__esModule?d:{"default":d};q=RegExp("");q.compile("[^0-9a-f]","gi");H.prototype.doPublic=function(d){return d.modPowInt(this.e,this.n)};H.prototype.setPublic=function(d,q){null!=d&&null!=q&&0C;C++)w[z][C]=c[64*z+4*C]<<24|c[64*z+4*C+1]<<16|c[64*z+4*C+2]<<8|c[64*z+4*C+3];w[n-1][14]=8*(c.length-1)/Math.pow(2,32);w[n-1][14]=Math.floor(w[n-1][14]);w[n-1][15]=8*(c.length-1)&4294967295;C=1732584193;c=4023233417;m=2562383102;h=271733878;a=3285377520;B=Array(80);for(z=0;zg;g++)B[g]=w[z][g];for(g=16;80>g;g++)y=B[g-3]^B[g-8]^B[g-14]^B[g-16],B[g]=y<<1|y>>>31;y=C;t=c;E=m;M=h;p=a;for(g=0;80>g;g++){f=Math.floor(g/20);var x=y<<5|y>>>27,A;a:{switch(f){case 0:A=t&E^~t&M;break a;case 1:A=t^E^M;break a;case 2:A=t&E^t&M^E&M;break a;case 3:A=t^E^M;break a}A=void 0}f=x+A+p+k[f]+B[g]&4294967295;p=M;M=E;E=t<<30|t>>>2;t=y;y=f}C=C+y&4294967295;c=c+t&4294967295;m=m+E&4294967295;h=h+M&4294967295;a=a+p&4294967295}r=I(C)+I(c)+I(m)+I(h)+I(a)===r}else r=0;return r};l["default"]=H},function(d,l,u){function H(a,c){for(var h in c)a[h]=c[h]}function I(a,c,h){null!=a&&("number"==typeof a?this.fromNumber(a,c,h):null==c&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,c))}function L(){return new I(null)}function F(a,c,h,m,d,n){for(;0<=--n;){var p=c*this[a++]+h[m]+d;d=z(p/67108864);h[m++]=67108863&p}return d}function G(a,c,h,m,d,n){for(var p,g,f=32767&c,k=c>>15;0<=--n;)c=32767&this[a],p=this[a++]>>15,g=k*c+p*f,c=f*c+((32767&g)<<15)+h[m]+(1073741823&d),d=(c>>>30)+(g>>>15)+k*p+(d>>>30),h[m++]=1073741823&c;return d}function q(a,c,h,m,d,n){for(var p,g,f=16383&c,k=c>>14;0<=--n;)c=16383&this[a],p=this[a++]>>14,g=k*c+p*f,c=f*c+((16383&g)<<14)+h[m]+d,d=(c>>28)+(g>>14)+k*p,h[m++]=268435455&c;return d}function D(a,c){var m=h[a.charCodeAt(c)];return null==m?-1:m}function A(a){var c=L();return c.fromInt(a),c}function r(a){var c=1,h;return 0!=(h=a>>>16)&&(a=h,c+=16),0!=(h=a>>8)&&(a=h,c+=8),0!=(h=a>>4)&&(a=h,c+=4),0!=(h=a>>2)&&(a=h,c+=2),0!=a>>1&&(c+=1),c}function n(a){this.m=a}function w(a){this.m=a;this.mp=a.invDigit();this.mpl=32767&this.mp;this.mph=this.mp>>15;this.um=(1<=d;++d)h[m++]=d;m=97;for(d=10;36>d;++d)h[m++]=d;m=65;for(d=10;36>d;++d)h[m++]=d;H(n.prototype,{convert:function(a){return 0>a.s||0<=a.compareTo(this.m)?a.mod(this.m):a},revert:function(a){return a},reduce:function(a){a.divRemTo(this.m,null,a)},mulTo:function(a,c,h){a.multiplyTo(c,h);this.reduce(h)},sqrTo:function(a,c){a.squareTo(c);this.reduce(c)}});H(w.prototype,{convert:function(a){var c=L();return a.abs().dlShiftTo(this.m.t,c),c.divRemTo(this.m,null,c),0>a.s&&0>15)*this.mpl&this.um)<<15)&a.DM,h=c+this.m.t,a[h]+=this.m.am(0,m,a,c,0,this.m.t);a[h]>=a.DV;)a[h]-=a.DV,a[++h]++;a.clamp();a.drShiftTo(this.m.t,a);0<=a.compareTo(this.m)&&a.subTo(this.m,a)},mulTo:function(a,c,h){a.multiplyTo(c,h);this.reduce(h)},sqrTo:function(a,c){a.squareTo(c);this.reduce(c)}});H(I.prototype,{copyTo:function(a){var c;for(c=this.t-1;0<=c;--c)a[c]=this[c];a.t=this.t;a.s=this.s},fromInt:function(a){this.t=1;this.s=0>a?-1:0;0a?this[0]=a+this.DV:this.t=0},fromString:function(a,c){var h,m,d,n,p;if(16==c)h=4;else if(8==c)h=3;else if(256==c)h=8;else if(2==c)h=1;else if(32==c)h=5;else{if(4!=c)return void this.fromRadix(a,c);h=2}this.s=this.t=0;m=a.length;d=!1;for(n=0;0<=--m;)p=8==h?255&a[m]:D(a,m),0>p?"-"==a.charAt(m)&&(d=!0):(d=!1,0==n?this[this.t++]=p:n+h>this.DB?(this[this.t-1]|=(p&(1<>this.DB-n):this[this.t-1]|=p<=this.DB&&(n-=this.DB));8==h&&0!=(128&a[0])&&(this.s=-1,0>d|g,g=(this[h]&n)<=this.t)return void(c.t=0);m=a%this.DB;d=this.DB-m;n=(1<>m;for(p=h+1;p>m;0>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;m>=this.DB;d-=a.s}h.s=0>d?-1:0;-1>d?h[m++]=this.DV+d:0=h.DV&&(a[m+h.t]-=h.DV,a[m+h.t+1]=1);0=k.t)){if(m=this.abs(),m.t>this.F2:0);m=this.FV/k;k=(1<n&&I.ZERO.subTo(h,h)}}},invDigit:function(){var a,c;return 1>this.t?0:(a=this[0],0==(1&a)?0:(c=3&a,c=c*(2-(15&a)*c)&15,c=c*(2-(255&a)*c)&255,c=c*(2-((65535&a)*c&65535))&65535,c=c*(2-a*c%this.DV)%this.DV,0a)return I.ONE;h=L();m=L();d=c.convert(this);n=r(a)-1;for(d.copyTo(h);0<=--n;)c.sqrTo(h,m),0<(a&1<a||36f?"-"==a.charAt(g)&&0==this.signum()&&(d=!0):(p=c*p+f,++n>=h&&(this.dMultiply(m),this.dAddOffset(p,0),n=0,p=0));0=this.DV;)this[c]-=this.DV,++c>=this.t&&(this[this.t++]=0),++this[c]}}});H(I.prototype,{toString:function(a){var c,h,m,d,n,p;if(0>this.s)return"-"+this.negate().toString(a);if(16==a)a=4;else if(8==a)a=3;else if(2==a)a=1;else if(32==a)a=5;else{if(4!=a)return this.toRadix(a);a=2}if(c=(1<>p)&&(m=!0,d="0123456789abcdefghijklmnopqrstuvwxyz".charAt(h));0<=n;)p>(p+=this.DB-a)):(h=this[n]>>(p-=a)&c,0>=p&&(p+=this.DB,--n)),0this.s?-1:0>=this.t||1==this.t&&0>=this[0]?0:1},intValue:function(){if(0>this.s){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<this.s?this.negate():this},compareTo:function(a){var c,h=this.s-a.s;if(0!=h)return h;if(c=this.t,h=c-a.t,0!=h)return 0>this.s?-h:h;for(;0<=--c;)if(0!=(h=this[c]-a[c]))return h;return 0},bitLength:function(){return 0>=this.t?0:this.DB*(this.t-1)+r(this[this.t-1]^this.s&this.DM)},mod:function(a){var c=L();return this.abs().divRemTo(a,null,c),0>this.s&&0a||c.isEven()?new n(c):new w(c),this.exp(a,h)}});I.ZERO=A(0);I.ONE=A(1);l["default"]=I}]);U.exports={M5:1,Gb:function(){J.Gb(R,d,-1)}}},function(U,u,l){function d(d,l){var q,r,n,w,z="",C=0;for(q=0;q=d[w].length?"00":d[w].charAt(q)+d[w].charAt(q+1):qn&&(A=z.left+G-n),z.top+q>w&&(D=z.top+q-w),(0>u||0>F||0u&&(u=0),0>F&&(F=0),C.css({left:u-l.left+"px",top:F-l.top+"px"}))))},vo:function(l){return 0(new Date).valueOf()-F||(G.close(),(l||u)&&G.Fo&&clearTimeout(G.Fo),Q(d))});["touchstart","MSPointerDown","pointerdown"].forEach(function(d){q.bind(d,function(d){l||u?G.Fo=setTimeout(function(){G.close()},100):G.close();Q(d)})})},Bo:function(){return 0=this.bo},no:function(){var d,l,u=this.eo;if(u)for(d in u)u[d]&&(l=J(u[d].jo),l.unbind(".gcSheet"));this["do"]=null}};u=l(42);u.oo=d;U.exports=u},function(U,u,l){function d(d){return function(l){return 0===arguments.length?this.po[d]:(this.po[d]=O(l),this)}}var J,R;u=l(26);var Q=u.j.Fa,K=u.pc,O=K.ec,H=parseInt,I=l(43),L=I.Ul.Pl;J=function(){function l(d,q,l,A,r,n,w,z,C,c,m,h,a){this.Cj=d;this.po=[];for(var B=1;13>B;B++)this.po.push(O(arguments[B]))}return l.prototype={constructor:l,name:function(d){return 0===arguments.length?this.Cj:(this.Cj=d,this)},background1:d(0),background2:d(1),textColor1:d(2),textColor2:d(3),accent1:d(4),accent2:d(5),accent3:d(6),accent4:d(7),accent5:d(8),accent6:d(9),hyperlink:d(10),followedHyperlink:d(11),getColor:function(d){var q,l,A,r,n;if(d&&(q=d.split(" "))){if(A=-1,r=q.length,1=A)return 2=d)return"none";var l="";return(1|d)===d&&(l+="underline "),(2|d)===d&&(l+="line-through "),(4|d)===d&&(l+="overline "),l.trim()};u.To=d;U.exports=u},function(U,u,l){function d(d,l,A){this.color=d||"black";this.style=l||0;this.level=A}function J(){var d,l;if(this.yn=J.Wo++,d=arguments,0!==d.length)for(l=0;l=k.width)return!1;if(g=f.labelOptions.alignment,g===a&&(g=f.labelOptions.alignment=0),0===g||1===g||2===g){if(0g;g++)f[g]=parseInt(f[g]),"number"==typeof f[g]&&0=f?f:p,n=h>=k?k:h,l=p>f&&0k&&0f/k?(t=f/k*h,l=g+p/2-t/2):0k/f&&(q=k/f*p,B=c+h/2-q/2):3===d&&(x=p>=f?f:p,n=h>=k?k:h,t=x,q=n),a.drawImage(b,0,0,x,n,l,B,t,q)):e.fo(m)}catch(ma){}};t.cp=function(a,k,g,c,p){a=0;var f=p&&p.sheet,h=g.textIndent,e=g.font,b=g.hAlign;if(f&&typeof k===m&&k){if(g.wordWrap)for(k=k.split(/\r\n|\r|\n/),g=0;g=f&&1>=b.rowCount&&b.col>=k&&k===b.col&&(h=d.Tl(k),1w?q+l:w-B+l-1;switch(c.labelOptions.alignment){case 0:b.x+=e+k+1;b.y+=m;break;case 1:b.x+=e+(y-e-t)/2;b.y+=m;break;case 2:b.x+=y-t-2;b.y+=m;break;case 3:b.x+=e+k+1;b.y+=q;break;case 4:b.x+=e+(y-e-t)/2;b.y+=q;break;case 5:b.x+=y-t-2,b.y+=q}}b&&(f.save(),f.textAlign=K(v.alignment),f.textBaseline="Alphabetic",f.font=h.font,f.fillStyle=v.foreColor||c.foreColor||"grey",f.rect(n.x,n.y,n.width,n.height),f.clip(),f.beginPath(),f.fillText(x,b.x,b.y),f.restore())}},f5:function(a,g){var f=a.clone(),k=d(g,0),c=d(g,1),p=d(g,2),h=d(g,3);return 0=a.width&&(f.width=0),k+p>=a.height&&(f.height=0),f},e5:function(a,g,c,p){var f,k,h,e,b,m,d,n,x,t,y,q,l=c.labelOptions;l&&(f=p.sheet,k=f.getText(p.row,p.col,p.sheetArea),h=c.watermark,e=l.visibility,1!==e&&h&&(b=l.font||c.font||f.yl.Bl(),1!==f._zoomFactor&&(b=f.yl.Cl(b),H(c,f._zoomFactor)),m=f.fp(b),Q(c,g)&&(d=O(g,c,m)),d&&(n=M(C.Nl("span")),n.text(h),x=2===e&&""===k,t=d.height-m,y=d.y+(x&&0d||A>t)||(1===E?ya&&(I=V/2,(I>ya.backgroundLeftWidth||I>ya.backgroundRightWidth)&&(A=!0)):V+l>d&&(A=!0)),A&&(a.rect(g,m,d,t),a.clip(),a.beginPath()),a.fillText(b,p+C,h+P),v&&this.ip(a,v,p+C,h+P,V,W,u);a.restore()},paint:function(a,g,c,p,h,m,d,e){var b;if(a){b=d.backColor;if(e.parentBackColor!==b){var f=d.backgroundImage,k=d.backgroundImageLayout,n=e.imageLoader;(b||f)&&(a.save(),a.beginPath(),b&&(a.fillStyle!==b&&(a.fillStyle=b),a.fillRect(c,p,h,m)),t.ap(a,c,p,h,m,f,k,n),a.restore())}c=new w(c,p,h,m);this.i5&&(this.i5(a,c,d,e),c=this.f5(c,d));0=m?12:m)-12)/21+1);a.lineWidth=f;0===(1&f)&&(k=0);"center"===e?c-=h/2:"right"===e&&(c-=h);a.beginPath();4===(4&g)&&(b=y(p+d-m-1)-k,a.moveTo(c,b),a.lineTo(c+h,b));2===(2&g)&&(b=y(p+d-m/2)-k,a.moveTo(c,b),a.lineTo(c+h,b));1===(1&g)&&(b=y(p+d-1)-k,a.moveTo(c,b),a.lineTo(c+h,b));a.stroke()},lp:function(a,g){var f="";4===(4&g)&&(f="overline");2===(2&g)&&(f+=" line-through");1===(1&g)&&(f+=" underline");a.css("text-decoration",f)},isImeAware:function(a){return!1},isEditting:function(){return!1},toJSON:function(){var a,g={};for(a in this)this.hasOwnProperty(a)&&(g[a]=this[a]);return g},fromJSON:function(a){if(a)for(var f in a)r(a[f])||(this[f]=a[f])}};L.Base=I;L._o={0:I};U.exports=u},function(U,u){U.exports=GC.Spread.Sheets.Sparklines},function(U,u,l){function d(d){return d&&d.options.allowCopyPasteExcelStyle}function J(d){this.n5=this.PA=z;this.G4=!1;this.tc=d;this.Nl()}function R(d,c){var m,h,a,n,y,t,l,r,p,g,f=[];for(m=0;mc&&2===(2&z)&&(w=!0),0>h&&1===(1&z)&&(r=!0),c=x.row,h=x.col,m=x.rowCount,a=x.colCount,q=[],q.push("\x3ctable\x3e"),r?(p=d.getColumnCount(2),g=this.lja(d,c,m,0,p,2,y,t,n,x,B,"\x26nbsp;"),l=this.lja(d,c,m,h,a,3,y,t,n,x,B,"\x26nbsp;"),q=this.yb(l,g,2)):w?(f=d.getRowCount(1),k=this.lja(d,0,f,h,a,1,y,t,n,x,B,"\x26nbsp;"),l=this.lja(d,c,m,h,a,3,y,t,n,x,B,"\x26nbsp;"),q=this.yb(l,k,1)):(l=this.lja(d,c,m,h,a,3,y,t,n,x,B,"\x26nbsp;"),q=this.yb(l,null,3)),q},yb:function(d,c,m){var h,a,n;if(1===m)h=c.concat(d);else if(2===m)for(h=[],m=c.length,a=0;aa+f)||-1!==g&&(p.colg+k)))return!0;return!1},hasSpans:function(a,g,f,k){var c=!1;return this.each(a,g,f,k,function(){return c=!0,!1}),c},clear:function(a,g,f,k){var c,p,h;for(c=0;c=this.length},addRows:function(a,g){var f,k,c,p,h,m=this.length;for(f=0;f=a?this.update(f,C(c+g,p,h,k)):c=a?this.update(f,C(c,p+g,h,k)):p=a?c=a?m=this.startColumn&&a<=this.endColumn};u.op=d;G=function(a){function c(){a.call(this);this.pp=2;this.qp=0}A(c,a);return r(c.prototype,{find:function(a,c){var h,g,f=this.length;for(g=0;g=g&&a=g&&a=v&&a=y&&cthis.x||a.xthis.y||a.yh&&(c=h-a),w(this.dataTable,h,a,c),w(this.Hf,h,a,c),w(this.Ap,h,a,c),this.rowCount-=c)},addColumns:function(a,c){var h,m,p=this.colCount;if(0<=a&&a<=p&&0<=c){for(h=0;hp&&(c=p-a);this.colCount-=c}},getNode:function(a,c,h){var m,p=this.dataTable,g=this.If,f=this.Hf,k=null;return athis.Ef&&(this.Ef=a)),m&&(k=m[c],h&&!k&&(k=m[c]={},this.FfI.k.Cb(g,n))for(k=c;ka&&(c[a]=null)},Hp:function(){return this.Gp},Ip:function(a,c){this.Gp=a;this.length=c},Jp:function(a){return this.Gp[a]},Kp:function(a,c){this.Gp[a]=c;this.length=this.Gp.length},getSize:function(c){c=this.Gp[c];var h=null;return c&&(h=!1===c.visible?0:a(c.size)),h},getActualSize:function(c){return(c=this.Gp[c])?a(c.size):null},setSize:function(a,c){var h=K(this,a);h.size!==c&&(h.size=c)}};q({visible:!0,resizable:!0,pageBreak:!1},function(a,c){var h=a[0].toUpperCase()+a.substr(1);m["get"+h]=function(h){var p=c;h=this.Gp[h];return h&&!z(h[a])&&(p=h[a]),p};m["set"+h]=function(c,h){var g=K(this,c);g[a]!==h&&(g[a]=h)}});u.Lp=O;U.exports=u},function(U,u,l){function d(){return n.C(u.SR)()}function J(b){if(typeof b===ja&&"/"===b.charAt(0)){var a;ma.test(b)?(a=b.match(ma),b=V.Xb(N(a[1]))):oa.test(b)&&(a=b.match(oa),b=new Date(N(a[1])))}return b}function R(b){return!h(b)&&V.Mia(b)&&(b=V.Daa(b)),b}function Q(b,a){var e,f,c,g=[],k=b.Mp().Ap;if(k)for(e in k)Z(k,e)&&(f=k[e],f&&f.rs===(a?"e":"n")&&(c={row:+e,item:b.getDataItem&&b.getDataItem(e)},a&&(c.originalItem=f.originalItem),g.push(c)));return g}function K(b,a,e){for(var f=0;a<=e;a++)f+=b._m(a);return f}function O(b,a,e){for(var f=0;a<=e;a++)f+=b.Sl(a);return f}function H(b){return b.getColumnCount()}function I(b){return b.getRowCount()}function L(b,a,e){Object.defineProperty(b,a,{get:function(){return this["_"+a]},set:function(b){var f=this["_"+a];f!==b&&(this["_"+a]=b,e&&e(a,b,f))}})}function F(b){var a=this;a.yn=F.Np++;a.options=E(ga,function(b,e,f){a.Op(b,e,f)});a.ad(b)}var G,q,D,A,r,n,w,z,C,c,m,h,a,B,y,t,E,M,p,g,f,k,x,W,P,V,Z,e,b,v,N,S,X,Y,ka,ja,oa,ma,ea,ga;u=l(42);G=l(43);q=l(48).oo;D=l(51).Style;A=l(55);r=l(44).GC$;n=l(26);w=G.Ul;z=G.En;C=G.Lj;c=G.Ul.Nl;m=G.kf;h=n.j.Fa;a=G.ln;B=G.Rect;y=G.Events;t=w.Pl;E=w.Ql;M=G.Vl;p=G.Im;g=G.Themes;f=G.Theme;k=A.zp;x=A.yp;W=r.each;P=r.isEmptyObject;V=n.l;Z=n.D;e=window;b=document;v=parseInt;N=parseFloat;S=isNaN;X=Math.min;Y=Math.max;ka=Math.floor;ja="string";oa=/^\/Date\((-?\d+)([-+]{1}\d+)?\)\/\s*$/;ma=/^\/OADate\(([-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)\)\/\s*$/;ea={backColor:!0,foreColor:!0,font:!0,borderLeft:!0,borderTop:!0,borderRight:!0,borderBottom:!0,textDecoration:!0};u.RangeChangedAction={dragDrop:0,dragFill:1,clear:2,paste:3,sort:4,setArrayFormula:5,evaluateFormula:6};u.SheetArea={corner:0,colHeader:1,rowHeader:2,viewport:3};u.HeaderAutoText={blank:0,numbers:1,letters:2};ga={rowHeaderVisible:!0,colHeaderVisible:!0,clipBoardOptions:0,frozenlineColor:"black",rowHeaderAutoText:1,colHeaderAutoText:2,rowHeaderAutoTextIndex:-1,colHeaderAutoTextIndex:-1,sheetTabColor:null,selectionBackColor:null,selectionBorderColor:null,allowCellOverflow:!1,isProtected:!1,protectionOptions:{},gridline:{},borderColor:"black",borderWidth:0};G.Zn(F);F.Np=1;F.Qp=ga;F.Rp=200;F.Sp=20;F.Tp=1;F.Vp=1;F.Wp=20;F.Xp=62;F.Yp=40;F.Zp=20;F.prototype={constructor:F,Op:function(b,a,e){var f,c,g=this;e=g.parent;switch(b){case "allowCellOverflow":case "colHeaderAutoText":case "colHeaderAutoTextIndex":case "colHeaderVisible":case "frozenlineColor":case "rowHeaderAutoText":case "rowHeaderAutoTextIndex":case "rowHeaderVisible":case "selectionBackColor":case "selectionBorderColor":g.$p();break;case "gridline":f=function(){g.$p()};c=g.options.gridline;["color","showHorizontalGridline","showVerticalGridline"].forEach(function(b){var e=a[b];L(c,b,f);c[b]=e});break;case "isProtected":e&&e.undoManager().clear();g._p();g.$p();break;case "protectionOptions":g._p();break;case "sheetTabColor":e&&e.aq()}},name:function(b){var a=this.parent;if(0===arguments.length)return this.Cj;if(!this.bq(b))throw d().Exp_NotSupported;return this.cq(b),a&&a.aq(),this},cq:function(b){var a=!!F.getDataValidatorsBeforeSetSheetName,e=a?F.getDataValidatorsBeforeSetSheetName(this):null;this.Cj=b;a&&(F.adjustModelFormulasAfterSetSheetName(this),F.adjustValidatorsAfterSetSheetName(this,e))},visible:t("visible",!0,function(b){var a=this.parent,e=a.sheets,f=e.length,c=r.inArray(this,e),g=a.getActiveSheetIndex();if(b)0>g?a.dq(c,1):a.aq();else if(c===g){for(b=c+1;b=f)for(b=c-1;0<=b&&!e[b].visible();)b--;bb?(this.no(!1),a.eq=b,a.fq()):a.dq(b,1)}else a.aq()}),addRows:function(b,a){var e,f,c,g,k,p;if(!(0>=a)){e=I(this);(0>b||b>e)&&(b=e);this.suspendPaint();try{if(f={changeType:"addingRows",row:b,rowCount:a,canAdd:!0},F.ao(this,"onLayoutChanged",f),f.canAdd)h(f.newRow)||(b=f.newRow),c=this.iq(),c.addItems(b,a),g=this.Mp(),g.addRows(b,a),k=this.Mp(2),k.addRows(b,a),p=this.zl(2),p.addRows(b,a),p=this.zl(),p.addRows(b,a),this.jq=!0,F.ao(this,"onLayoutChanged",{changeType:"addRows",row:b,oldValue:e,rowCount:a}),F.ao(this,"onLayoutChanged",{changeType:"addRows2",row:b,oldValue:e,rowCount:a}),this.kq(b,3,"addRows",a,e)}finally{this.resumePaint()}}},deleteRows:function(b,a){var e,f,c,g,k,h,p,m,d,v=I(this);if(!(0>b||b>=v||0>=a)){this.suspendPaint();try{if(e={changeType:"deletingRows",row:b,rowCount:a,canDelete:!0},F.ao(this,"onLayoutChanged",e),e.canDelete){if(f=this.iq(),f.deleteItems(b,a),c=this.Mp(),c.deleteRows(b,a),g=this.Mp(2),g.deleteRows(b,a),k=this.zl(2),k.removeRows(b,a),k=this.zl(),k.removeRows(b,a),h=this.lq,0<=h){p=-1;m=this.frozenRowCount();for(d=h;d>=m;d--)if(this.getRowVisible(d)&&0=v&&this.setActiveCell(v-1,this.getActiveColumnIndex());this.jq=!0;F.ao(this,"onLayoutChanged",{changeType:"deleteRows",row:b,oldValue:v,rowCount:a});this.kq(b,3,"deleteRows",a,v)}}finally{this.resumePaint()}}},addColumns:function(b,a){var e,f,c,g,k,h;0>=a||(e=H(this),(0>b||b>e)&&(b=e),f={changeType:"addingColumns",col:b,colCount:a,canAdd:!0},F.ao(this,"onLayoutChanged",f),f.canAdd&&(c=this.nq(),c.addItems(b,a),g=this.Mp(),g.addColumns(b,a),k=this.Mp(1),k.addColumns(b,a),h=this.zl(1),h.addColumns(b,a),h=this.zl(),h.addColumns(b,a),this.oq=!0,F.ao(this,"onLayoutChanged",{changeType:"addColumns",col:b,oldValue:e,colCount:a}),this.pq(b,3,"addColumns",a,e),this.$p()))},deleteColumns:function(b,a){var e,f,c,g,k,h,p=H(this);if(!(0>b||b>=p||0>=a)&&(e={changeType:"deletingColumns",col:b,colCount:a,canDelete:!0},F.ao(this,"onLayoutChanged",e),e.canDelete)){if(f=this.nq(),f.deleteItems(b,a),c=this.Mp(),c.deleteColumns(b,a),g=this.Mp(1),g.deleteColumns(b,a),k=this.zl(1),k.removeColumns(b,a),k=this.zl(),k.removeColumns(b,a),h=this.qq,0<=h){e=-1;f=this.frozenColumnCount();for(c=h;c>=f;c--)if(this.getColumnVisible(c)&&0=p&&this.setActiveCell(this.getActiveRowIndex(),p-1);this.oq=!0;F.ao(this,"onLayoutChanged",{changeType:"deleteColumns",col:b,oldValue:p,colCount:a});this.pq(b,3,"deleteColumns",a,p);this.$p()}},frozenColumnCount:t("frozenColumnCount",0,function(b){this.qqb||b===this.getRowCount(a)||(3===a||2===a?(f=I(e),f>b&&this.deleteRows(b,f-b),e.setRowCount(b),this.Mp(2).setRowCount(b),this.frozenRowCount()>b&&this.frozenRowCount(b)):1===a&&(c=this.Mp(1),I(c)>b&&(g=this.iq(a),g.deleteItems(b,I(c)-b)),c.setRowCount(b)),F.ao(this,"onLayoutChanged",{changeType:"setRowCount",rowCount:b,sheetArea:a}),this.jq=!0,this.Jl>=b&&(3===a||2===a)&&this.setActiveCell(b-1,this.getActiveColumnIndex()),this.$p(),this.clearPendingChanges()))},setColumnCount:function(b,a){var e,f,c,g;b=v(b,10);S(b)||(e=this.Mp(),0>b||b===this.getColumnCount(a)||(h(a)&&(a=3),3===a||1===a?(f=H(e),f>b&&this.deleteColumns(b,f-b),this.Mp().setColumnCount(b),this.Mp(1).setColumnCount(b),this.frozenColumnCount()>b&&this.frozenColumnCount(b)):2===a&&(c=this.Mp(2),H(c)>b&&(g=this.nq(a),g.deleteItems(b,H(c)-b)),c.setColumnCount(b)),F.ao(this,"onLayoutChanged",{changeType:"setColumnCount",colCount:b,sheetArea:a}),this.oq=!0,this.Kl>=b&&(3===a||1===a)&&this.setActiveCell(this.getActiveRowIndex(),b-1),this.$p(),this.clearPendingChanges()))},getText:function(b,a,e){var f,c,g;return h(e)&&(e=3),f=this.getValue(b,a,e),c=this.getCellType(b,a,e),g=this.tq(b,a,"formatter",e),g||(g=this.tq(b,a,"_autoFormatter",e)),f=c.format(f,g,{sheet:this,row:b,col:a,sheetArea:e}),f&&"string"==typeof f&&""!==f&&(f=f.replace(/\r\n?/g,"\n")),f},setText:function(b,a,e,f){var c,g,k,p,m;h(f)&&(f=3);c=e;e={value:e};F.ao(this,"settingText",e);g=e=e.value;k=this.getCellType(b,a,f);p=this.getFormatter&&this.getFormatter(b,a,f);k&&p&&(m={sheet:this,row:b,col:a,sheetArea:f},g=k.parse(c,p,m),g=h(g)?e:g);this.uq(b,a,g,f);this.$p()},getValue:function(b,a,e){var f,c,g,k,p,m,d,v,n;return 0===e?null:(h(e)&&(e=3),f=this.options,c=this.Mp(e),g=this.vq(c,b,a,e),1===e?h(g)&&(p=this.wq,p&&p.Ou&&(m=this.nq().Jp(a),d=f.colHeaderAutoTextIndex,m&&(0<=d&&b===d||-1===d&&b===I(c)-1)&&(g=m.displayName||m.name)),h(g)&&(k=f.colHeaderAutoTextIndex,(0>k||k>=I(c))&&(k=I(c)-1),b===k&&(v=f.colHeaderAutoText,2===v?g=this.xq(a+1):1===v&&(g=a+1)))):2===e&&h(g)&&(k=f.rowHeaderAutoTextIndex,(0>k||k>=H(c))&&(k=H(c)-1),a===k&&(n=f.rowHeaderAutoText,2===n?g=this.xq(b+1):1===n&&(g=b+1))),g)},setValue:function(b,a,e,f,c){this.uq(b,a,e,f,c);this.$p()},uq:function(b,a,e,f,c){var g,k,p,m,d,v,n,t,x,q,y;if(0!==f&&(h(f)&&(f=3),g=this,k=g.Mp(f),p=I(k),m=H(k),!(0>b||b>=p||0>a||a>=m))){if(d=3===f,e=R(e),g.isEventSuspended()&&g.isDirtySuspended()||(v=g.vq(k,b,a,f)),p=!1,n=g.tables,d&&n&&n.find(b,a)){if(t=n.yq(b,a,e),!t.isValid)return;p=t.isValueSet}d?(x=g.wq,!p&&x&&x.Ou&&(q=x.getValue(b,a),q.hasBinding&&e!==q.value&&(g.isDirtySuspended()||(y=r.extend({},g.getDataItem(b)),k.Cp(b,a,{Dp:y,Ep:v})),x.setValue(b,a,e)),p=q.hasBinding),p||k.setValue(b,a,e)):k.setValue(b,a,e);d&&!c&&u.X3&&g.zq(k,b,a);g.t4&&g.t4(b,a,1,1,f);(c=g.conditionalFormats)&&c.Nm();g.isEventSuspended()||v===e||g.Bq("value",b,a,f,v,e)}},getActualStyle:function(b,a,e,f,g){var c,k,p,m,d,v,n,t,x,q,y,l,B,w,N,T,r,z,C;if(h(e)&&(e=3),0===e)return new D;if(-1===b&&-1===a)return this.getDefaultStyle(e);if(v=this.Cq,w=this.Mp(e),p=w.getStyle(b,a),m=w.getStyle(b,-1),d=w.getStyle(-1,a),p=p?p:null,m=m?m:null,d=d?d:null,y="__undefined",p&&(y=p.charAt?p:"__spreadJSDefault"+p.yn),l="__undefined",m&&(l=m.charAt?m:"__spreadJSDefault"+m.yn),B="__undefined",d&&(B=d.charAt?d:"__spreadJSDefault"+d.yn),q=v[e],n=q[y],N=this.tables,T=3===e&&N?N.find(b,a):null,T||(n||(n=q[y]={}),t=n[l],t?x=t[B]:t=n[l]={}),x||(k=this.Dq(b,a,e,p,m,d,T)),3!==e||f||(x||(r=k.formatter,r&&r.hasFormatedColor&&r.hasFormatedColor()&&(z={value:null},r.format(this.getValue(b,a),z),z.value&&(c=new D,c.foreColor=z.value))),C=this.conditionalFormats,C&&(c=C.Eq(c,b,a,e))),c)c.Yo(x?x:k),k=c;else if(x)return g?x:x.clone(!0);return h(k.locked)&&(k.locked=!0),k=k.Zo(this.Pm),c||T||(t[B]=k.clone(!0)),k},tq:function(b,a,e,f){var c,g,k,p,m,d,v,n,t,x,q,y;if(0!==f){h(f)&&(f=3);p=this.Mp(f);d=!1;3===f&&("foreColor"===e&&(g=this.tq(b,a,"formatter",f),g&&g.hasFormatedColor&&g.hasFormatedColor()&&(n={value:null},g.format(this.getValue(b,a),n),n.value&&(m=n.value,d=!0))),t=this.conditionalFormats,t&&0=n;)if(0===n?c=p.getStyle(b,a):1===n?(q=this.tables,y=3===f&&q?q.find(b,a):null,y&&ea[e]&&(c=y.Gq(b,a,e))):c=2===n?p.getStyle(b,-1):3===n?p.getStyle(-1,a):this.getDefaultStyle(f),n++,c&&c.charAt&&typeof c===ja&&(c=this.Hq(c)),c){if("font"===e&&c.themeFont&&!v&&(v=c.themeFont),void 0!==c[e]){m=c[e];d=!0;break}for(g=c.parentName;g&&(k=this.Hq(g));){if(void 0!==k[e]){m=k[e];d=!0;break}g=k.parentName}}return"locked"===e?!!h(m)||m:d||v?("foreColor"!==e&&"backColor"!==e&&"font"!==e&&"borderLeft"!==e&&"borderTop"!==e&&"borderRight"!==e&&"borderBottom"!==e||(c=new D,c[e]=m,"font"===e&&v&&(c.themeFont=v),c.Zo(this.Pm),m=c[e]),m):void 0}},getStyle:function(b,a,e){return this.Iq(b,a,e,!0)},Iq:function(b,a,e,f){var c,g,k,p;if(h(e)&&(e=3),0!==e){if(c=this.Mp(e),g=c.getStyle(b,a),g instanceof D)return f&&this.Jq(),g;if(typeof g===ja&&(k=this.Hq(g),null!==k))return p=new D,p.Yo(k),f&&this.Jq(),p}return null},addNamedStyle:function(b){this.Kq(b);this.$p()},Kq:function(b){if(b){if(!b.name)throw Error(d.Exp_EmptyNamedStyle);var a=b.name.toUpperCase();this.Lq[a]=b}},getNamedStyle:function(b){return this.Mq(b,!0)},Mq:function(b,a){var e,f=this.Lq;return f&&b?(b=b.toUpperCase(),e=f[b],e&&a&&this.Jq(),e):null},Jq:function(){this.Cq=[{},{},{},{}]},removeNamedStyle:function(b){var a=this.Lq;a&&b&&(b=b.toUpperCase(),Z(a,b)&&(delete a[b],this.Jq(),this.$p()))},getNamedStyles:function(){var b=[],a=this.Lq;return a&&W(a,function(a,e){b.push(e)}),this.Jq(),b},setStyle:function(b,a,e,f){h(f)&&(f=3);this.Nq(b,a,e,f);-1===b&&-1===a&&(this.Oq[f]=null);-1!==b&&-1!==a||e&&e.validator&&e.validator.condition()&&4===e.validator.condition().conType()&&e.validator.condition().getExpected(this,0>b?0:b,0>a?0:a);this.Jq();this.$p()},Pq:function(b,a,e,f){var c,g;this.options.isProtected?(c=this.getStyle(b,a,f),e?(g=c?c.locked:void 0,e.locked!==g&&(e.locked=g),this.setStyle(b,a,e,f)):c&&(g=c.locked,void 0!==g&&(e=new D,e.locked=g),this.setStyle(b,a,e,f))):this.setStyle(b,a,e,f)},getStyleName:function(b,a,e){b=this.Aj(b,a,e);return b instanceof D?b.name:b},setStyleName:function(b,a,e,f){typeof e===ja&&(this.Nq(b,a,e,f),this.$p())},Aj:function(b,a,e){var f,c;return h(e)&&(e=3),0!==e&&(c=this.Mp(e),f=c.getStyle(b,a)),f||null},Nq:function(b,a,e,f){var c,g,k,p;(h(f)&&(f=3),0===f)||(c=this.Aj(b,a,f),g=this.Mp(f),k=I(g),p=H(g),-1>b||b>=k||-1>a||a>=p)||(k=g.getStyle(b,a),g.setStyle(b,a,e),C.zn(e,this,b,a),c=c&&c.cellType&&c.cellType.typeName||null,g=e&&e.cellType&&e.cellType.typeName||null,b===this.Jl&&a===this.Kl&&c!==g&&M.Wl(this)&&this.mm.Qq(),-1!==b&&-1!==a?this.Bq("[styleinfo]",b,a,f,k,e):-1!==b&&-1===a?this.kq(b,f,"[styleinfo]",e,k):-1===b&&-1!==a&&this.pq(a,f,"[styleinfo]",e,k))},getDefaultStyle:function(b){var a,e,f,c,g,k;return h(b)&&(b=3),a=this.Oq,(e=a[b])?e:0!==b?(f=this.Mp(b),c=f.getStyle(-1,-1),typeof c===ja&&(c=this.Hq(c)),c||(c=new D,f.setStyle(-1,-1,c)),g=1===b||2===b,"undefined"===typeof c.hAlign&&(c.hAlign=g?1:3),"undefined"===typeof c.vAlign&&(c.vAlign=g?1:0),"undefined"===typeof c.imeMode&&(c.imeMode=1),c.font||"undefined"!==typeof c.themeFont||(c.themeFont="Body"),a[b]=c,c):(k=new D,k.locked=!0,a[b]=k,k)},setDefaultStyle:function(b,a){var e;h(a)&&(a=3);0!==a&&(e=this.Mp(a),e.setStyle(-1,-1,b),C.zn(b,this,-1,-1));this.Oq[a]=null;this.Jq();this.$p()},Hq:function(b){var a,e=this.Mq(b,!1);return e?e:(a=this.parent,a?a.Mq(b,!1):null)},Dq:function(b,a,e,f,c,g,k,p){var m,d,v,n,t,x,q,y,l,B;if(h(e)&&(e=3),0!==e){if(m=this,d=new D,n=!1,t=m.Mp(e),x=m.tables,q=I(t),y=H(t),0<=b&&b=this.Xq&&this.yl.repaint(b)},Yq:function(b,a){var e,f,c,g,k;k=this.frozenRowCount();e=(e=this.frozenColumnCount())?this.Zq(e-1):this.$q();k=k?this._q(k-1):this.ar();if(a=e&&this.rq(this.br(a+1)),a>this.cr()&&a<=this.dr()){e=0;f=a;c=this.am();for((g=this.zl().find(b,f))&&(f=g.col+g.colCount-1);f>this.qq&&(e+=this.Tl(f),!(e>c.er));)f--;e=this.Zq(f);this.rq(e)}if(b=k&&this.mq(this.gr(b+1)),b>this.hr()&&b<=this.ir()){k=0;e=b;(f=this.zl().find(e,a))&&(e=f.row+f.rowCount-1);for(f=this.am();e>this.lq&&(k+=this.Sl(e),!(k>f.jr));)e--;k=this._q(e);this.mq(k)}a===this.dr()&&this.rq(this.lr())},hitTest:function(b,a,e){var f,c,g,k,h,p,m,d,v,n,t,x,q,y,l,B,w,N,r,z;return this.am(),f={x:b,y:a,rowViewportIndex:null,colViewportIndex:null,row:-1,col:-1,resizeInfo:null,hitTestType:null,outlineHitInfo:null,filterButtonHitInfo:null,dragInfo:null,cellTypeHitInfo:null,floatingObjectHitInfo:null,formulaRangeHitInfo:null,commentHitInfo:null},c=this.rowOutlines,g=this.columnOutlines,c&&(k=c.hitTest(this,b,a)),!k&&g&&(k=g.hitTest(this,b,a)),k?f.outlineHitInfo=k:(h=this.nr(a),p=this.or(b),f.rowViewportIndex=h,f.colViewportIndex=p,f.row=this.pr(a,h),f.col=this.qr(b,p),0<=h&&2>=h&&0<=p&&(m=this.rr(h,p,void 0,f.row,f.col),m&&!0!==e&&(f.row=m.row,f.col=m.col)),f.hitTestType=this.sr(h,p),d=this.mm,v=d.tr&&d.tr(f,b,a),v?f.dragInfo=v:(n=d.ur(f,b,a,5),n?f.resizeInfo=n:(t=d.vr?d.vr(f,b,a):null,t?f.formulaRangeHitInfo=t:(x=this.comments,q=x&&x.hitTest(b,a),q?f.commentHitInfo=q:(y=this.wr,l=y&&y.hitTest(b,a),l?f.floatingObjectHitInfo=l:(B=this.xr,w=B&&B.hitTest(f,b,a),w||(N=this.tables,r=N&&N.find(f.row,f.col),z=r&&r.xr,w=z&&z.hitTest(f,b,a)),w?f.filterButtonHitInfo=w:f.cellTypeHitInfo=this.yr(f,b,a))))))),f},getCellRect:function(b,a,e,f){var c,g,k,p,m,d=3;return-1===e?d=1:-1===f&&(d=2),c=this.am(),-1===e&&-1===f?new B(c.zr,c.Ar,c.Br,c.Cr):(g=this.Dr(),h(e)&&(e=this.Er(b)),h(f)&&(f=this.Fr(a)),k=this.Gr(e,d).findRow(b),p=this.Hr(f,d).findCol(a),m=this.Ir(e,f,d).findCell(b,a),m?new B(m.x-g.x,m.y-g.y,m.width,m.height):k&&p?new B(p.x-g.x,k.y-g.y,p.width,k.height):new B)},Jr:function(b,a,e){var f=this.mm,c=!1;h(b)||(this.Jl=b,c=!0);h(a)||(this.Kl=a,c=!0);!e&&f&&c&&f.Qq()},Kr:function(b,a,e,f,c){var g,k=this.Jl,h=this.Kl,p=this.zl().get(b,a);this.Lr=p.rowCount;this.Mr=p.colCount;0>=this.Xq&&(g=this.zl().get(k,h),this.yl.im(m(k,h,g.rowCount,g.colCount)));this.Nr=e;this.Pr=f;this.Jr(b,a,c);this.Qr=b;this.Rr=a},setActiveCell:function(b,a,e,f){this.Uq&&this.Sr(b,a,e,f,2)},Sr:function(b,a,e,f,c){var g=I(this),k=H(this);0>b?b=0:b>=g&&(b=g-1);0>a?a=0:a>=k&&(a=k-1);this.Tr();c=2===c?M.Wl(this):1===c;this.Kr(b,a,e,f,!c);b=this.zl().get(b,a);this.Ur(b.row,b.col,b.rowCount,b.colCount);this.$p()},getActiveRowIndex:function(){return this.Jl},getActiveColumnIndex:function(){return this.Kl},getRowResizable:function(b,a){return this.iq(a).getResizable(b)},setRowResizable:function(b,a,e){this.Vr(b,a,"resizable",!0,e)},Vr:function(b,a,e,f,c){h(c)&&(c=3);var g=f?this.iq(c):this.nq(c),k;switch(e){case "resizable":k=g.getResizable(b);g.setResizable(b,a);break;case "pageBreak":k=g.getPageBreak(b);g.setPageBreak(b,a);break;case "isVisible":k=g.getVisible(b);g.setVisible(b,a);f&&u.X3&&3===c&&k!==a&&this.recalcRows([b]);break;case "height":k=g.getSize(b);g.setSize(b,a);!u.X3||3!==c||k===a||0!==k&&0!==a||this.recalcRows([b]);break;case "width":k=g.getSize(b),g.setSize(b,a)}f?this.kq(b,c,e,a,k):this.pq(b,c,e,a,k)},getColumnResizable:function(b,a){return this.nq(a).getResizable(b)},setColumnResizable:function(b,a,e){this.Vr(b,a,"resizable",!1,e)},getRowHeight:function(b,a){var e,f,c,g,k,p;if(h(a)&&(a=3),3===a||2===a){if(e=this.Mp(a),f=I(e)||0,0>b||b>=f)return 0;e=this.Wr;for(f=0;fb||b>=g)return 0;e=this.Zr;for(c=0;cb&&(b=.25),this._zoomFactor=b,this.oq=!0,this.jq=!0,this.$p()),this)},invalidateLayout:function(){var b=this.mm;this._r=null;this.as={colHeader:null,viewport:null,colFooter:null};this.bs={rowHeader:null,viewport:null};F.ao(this,"onLayoutChanged",{changeType:"invalidateLayout"});b&&b.cs&&M.Wl(this)&&b.cs(this.Jl,this.Kl);this.oq&&(this.ds(),this.oq=!1);this.jq&&(this.es(),this.jq=!1);this.$l=!0},$p:function(){0>=this.Xq&&(this.invalidateLayout(),this.repaint())},getViewportHeight:function(b){var a=this.am();return 0===b?a.fs:1===b?a.jr:2===b?a.gs:0},getViewportWidth:function(b){var a=this.am();return 0===b?a.hs:1===b?a.er:2===b?a.js:0},getViewportTopRow:function(b){var a=this.frozenRowCount();return 0===b?0:1===b?Y(a,this.lq):2===b?Y(a,I(this)-this.frozenTrailingRowCount()):-1},getViewportBottomRow:function(b){var a,e,f,c,g;if(2===b)return I(this)-1;a=this.getViewportTopRow(b);e=this.getViewportHeight(b);c=f=0;g=I(this)-this.frozenTrailingRowCount();0===b&&(g=X(this.frozenRowCount(),g));for(b=a;bb||b>=I(this)||0>a||a>=H(this)||(c=this.Fr(a),g=this.Er(b),k=this.getViewportTopRow(g),h=this.getViewportLeftColumn(c),1===c&&(a=this.ks(a,f)),1===g&&(b=this.ms(b,e)),p=!1,1===g&&b!==k&&(b=X(b,this.ns()),this.lq=b,this.os(),p=!0),1===c&&a!==h&&(a=X(a,this.ps()),this.qq=a,this.qs(),p=!0),p&&(m=this.parent,m&&!m.options.scrollbarShowMax&&(this.oq=!0,this.jq=!0),this.$p()))},Er:function(b){var a=1;return b=I(this)-this.frozenTrailingRowCount()&&(a=2),a},Fr:function(b){var a=1;return b=H(this)-this.frozenTrailingColumnCount()&&(a=2),a},ks:function(b,a){var e=this.ss,f=this.Fr(b),c=this.getViewportLeftColumn(f);if(0!==a)if(1===a)for(f=ka((this.getViewportWidth(f)-e._m(b))/2);0f));b--);else if(2===a)for(f=this.getViewportWidth(f)-e._m(b);0f));b--);else if(3===a&&b>=c)for(f=this.getViewportWidth(f)-e._m(b);cf));b--);return b},ms:function(b,a){var e=this.ss,f=this.Er(b),c=this.getViewportTopRow(f);if(0!==a)if(1===a)for(f=ka((this.getViewportHeight(f)-e.Sl(b))/2);0f));b--);else if(2===a)for(f=this.getViewportHeight(f)-e.Sl(b);0f));b--);else if(3===a&&!(bf));b--);return b},showColumn:function(b,a){this.showCell(this.lq,b,0,a)},showRow:function(b,a){this.showCell(b,this.qq,a,0)},suspendEvent:function(){this.jm++},resumeEvent:function(){this.jm--;0>this.jm&&(this.jm=0)},isEventSuspended:function(){return 0b)for(x=0;xa)for(t=0;tg&&(e=g-b),a+f>k&&(f=k-a),g=0;gb||b>=g||-1>a||a>=k)||(e=R(e),(g=0=e)&&(e=1),(h(f)||0>=f)&&(f=1),k=[],p=g.Mp().Ap,!P(p)){if(m=[],0<=b)for(d=b;dthis.gga&&(this.gga=0,b.gga=0)},isDirtySuspended:function(){return 0a&&(b--,!C.getColumnVisible(b)););return b}function c(b,a){for(;ba&&(b--,!C.getRowVisible(b)););return b}function k(b,a){for(;bw&&(m=c(w,m)),dr&&(v=k(r,v)),m=q&&(ny&&(n=t&&(dx&&(d=v-f&&(n=this.it(2),n&&0n[n.length-1].col||m=v-f&&(n=this.it(2),n&&0=d-c&&(t=this.jt(2),t&&0t[t.length-1].row||h=d-c&&(t=this.jt(2),t&&0=b&&0<=a?3:0<=b&&2>=b&&0>a?2:0>b&&0<=a?1:0>b&&0>a?0:null},zt:function(b){var a=this.mm;a&&a.zt(b)},zo:function(){var b,a=this.parent,a=a&&a.qo;return a||(b=this.Xs,a=b&&b.parentElement),a},Pp:function(){this.Kl=this.Jl=0;this.Mr=this.Lr=1;this.Rr=this.Qr=0},Sl:function(b,a){var e=this.getRowHeight(b,a),f=this._zoomFactor;return 1!==f&&(e*=f),ka(e)},Tl:function(b,a){var e=this.getColumnWidth(b,a),f=this._zoomFactor;return 1!==f&&(e*=f),ka(e)},At:function(){var b,a,e,f,c,g,k,h=this.Dr();a=this.options;var p=a.borderWidth,m=new B(h.x+p,h.y+p,Y(0,h.width-2*p),Y(0,h.height-2*p)),h=m.width,p=m.height,m={x:m.x,y:m.y,width:m.width,height:m.height,Br:0,Cr:0,hs:0,fs:0,js:0,gs:0,Bt:0,Ct:0,Dt:0,Et:0,kt:0,nt:0,lt:0,ot:0,pt:0,qt:0,jr:0,er:0,zr:0,Ar:0,em:function(){return new B(this.x,this.y,this.Br,this.Cr)},gm:function(b){return 0===b?new B(this.kt,this.y,this.hs,this.Cr):1===b?new B(this.pt,this.y,this.er,this.Cr):2===b?new B(this.lt,this.y,this.js,this.Cr):null},fm:function(b){return 0===b?new B(this.x,this.nt,this.Br,this.fs):1===b?new B(this.x,this.qt,this.Br,this.jr):2===b?new B(this.x,this.ot,this.Br,this.gs):null},Ft:function(b,a){if(0===b){if(0===a)return new B(this.kt,this.nt,this.hs,this.fs);if(1===a)return new B(this.pt,this.nt,this.er,this.fs);if(2===a)return new B(this.lt,this.nt,this.js,this.fs)}else if(1===b){if(0===a)return new B(this.kt,this.qt,this.hs,this.jr);if(1===a)return new B(this.pt,this.qt,this.er,this.jr);if(2===a)return new B(this.lt,this.qt,this.js,this.jr)}else if(2===b){if(0===a)return new B(this.kt,this.ot,this.hs,this.gs);if(1===a)return new B(this.pt,this.ot,this.er,this.gs);if(2===a)return new B(this.lt,this.ot,this.js,this.gs)}return null}};if(this.Gt&&(b=this.Gt(),m.x+=b.width,m.y+=b.height,h-=b.width,p-=b.height),a.rowHeaderVisible)for(e=this.getColumnCount(2),b=0;ba;a++)(e=this.Gr(a,b))&&0a;a++)(e=this.Hr(a,b))&&0=A)){t=f+1;x=c+1;q=[];y=[];l=[];B=[];N=w=0;for(n=a-1;0<=n;n--)q[n]=this.Sl(n,m),N-=q[n],B[n]=N;N=0;for(n=a;nt){for(n=t;nx){for(n=x;ne;)if(b--,this.getColumnVisible(b,a)&&0e;)if(b--,this.getRowVisible(b,a)&&0=f-a+1)return c;e=0;for(g=a;g<=f;g++)c.originalIndex[e]=g,c.visibleIndex[g]=e,0=b._m(g)&&g>=a;)c.originalIndex[e]=g,c.visibleIndex[g]=e,g--;return c},Zt:function(b){var a,e,f,c,g;if(this.Yt&&!b)return this.Yt;if(a=this.frozenRowCount(),e=I(this)-this.frozenTrailingRowCount()-a,f=a+e-1,b=this.ss,c={visibleIndex:{},originalIndex:{}},0>=f-a+1)return c;e=0;for(g=a;g<=f;g++)c.originalIndex[e]=g,c.visibleIndex[g]=e,0=b.Sl(g)&&g>=a;)c.originalIndex[e]=g,c.visibleIndex[g]=e,g--;return c},Rt:function(b,a){var e,f=this.frozenRowCount(),c=I(this)-this.frozenTrailingRowCount()-1;if(a){if(b>c&&(b=c),e=this.gr(b+1),null!==e&&e>=f)return e}else if(bc&&(b=c),e=this.br(b+1),null!==e&&e>=f)return e}else if(b=a;g--)if(k=c.Sl(g),!(0>=k)){if(f+=k,f>b)break;e=g}return e},fu:function(b,a,e){var f,c,g,k;if(e=a;g--)if(k=c._m(g),!(0>=k)){if(f+=k,f>b)break;e=g}return e},gu:function(){var b,a,e,f=this.am(),c=this.Hr(1,3),g=0,k=0;if(c)for(b=0;bm&&(m=b.length-1)),x&&(b=x.Hp(),0d&&(d=b.length-1)),a=p.Mp(),a.Ef>m&&(m=a.Ef),a.Ff>d&&(d=a.Ff),e=p.Mp(2),e.Ef>m&&(m=e.Ef),f=p.Mp(1),f.Ff>d&&(d=f.Ff),c=p.zl(),c.Ef>m&&(m=c.Ef),c.Ff>d&&(d=c.Ff),g=p.zl(2),g.Ef>m&&(m=g.Ef),k=p.zl(1),k.Ff>d&&(d=k.Ff),h=F._n,h&&W(h,function(b,a){var e,f=a.lastNonNullRowAndCol;f&&(e=f.call(p),m=Y(m,e.lastNonNullRow),d=Y(d,e.lastNonNullCol))}),m>v&&(m=v),d>n&&(d=n),{lastNonNullRow:m,lastNonNullCol:d}},mq:function(b){var a,e=this.lq;b>=this._t()&&b<=this.ns()&&b!==e&&(a=this.parent,a&&(a.ku.ju(b),this.os()),a&&!a.options.scrollbarShowMax&&this.es())},rq:function(b){var a,e=this.qq;b>=this.$t()&&b<=this.ps()&&b!==e&&(a=this.parent,a&&(a.ku.lu(b),this.qs()),a&&!a.options.scrollbarShowMax&&this.ds())},zl:function(b){return h(b)||3===b?this.Fs:1===b?this.Gs:2===b?this.Hs:void 0},yr:function(b,a,e){var f,c,g,k,p,m,d,v=b.row,n=b.col;b=b.hitTestType;return h(v)||h(n)?null:(f=this.getSpan(v,n,b),f&&(v=f.row,n=f.col),c=this.getActualStyle(v,n,b),g=1===b?-1:void 0,k=2===b?-1:void 0,p=this.getCellRect(v,n,g,k),m={sheet:this,row:v,col:n,sheetArea:b},d=c.cellType||this.Al(b),d.h5(a,e,c,p,m))},mu:function(){this.unbindAll();this.nu()},ou:function(b){var a,e,f,c,g,k,h=this.Tq(b);e=h.row;b=h.col;for(var p=e+h.rowCount,h=b+h.colCount;eb&&0>a)&&(0>b&&(c=this.zl(1),c&&0a&&(g=this.zl(2),g&&0=this.Xq&&(this.Xq=0,F.ao(this,"onPaintSuspend",{suspend:!1}),b=this.parent,b&&b.getActiveSheet()!==this||this.$p())},isPaintSuspended:function(){return 0a?a%c+c:a>f?a%c:a}function J(a,c,g,e){var b,k,h=E,h={cj:h,dj:h,ej:!0,fj:!0,gj:!1,li:0,Qia:!0},p=c?Q(a,g,e,0):R(a,0);return p.hj?(h.cj=p.ij,h.ej=p.jj):(h.dj=p.ij,h.fj=p.jj),h.li=p.li,h.gj=p.gj,!p.gj||p.li>=a.length?h:!c&&p.hj||c&&!p.hj?{gj:!1}:(b=a[h.li],!c&&(f(b)||"$"===b)||c&&("C"===b||"c"===b)?(k=c?Q(a,g,e,h.li):R(a,h.li),h.li=k.li,!k.gj||!c&&!k.hj||c&&k.hj?(h.gj=!1,h):(h.li=p||("$"===a[c]&&(m.jj=!1,c++),c>=p))return m;if(g=c,b=a[g],f(b)&&"0"!==b){for(m.hj=!0;g=m)return p;if(b=e,k=a[b],"R"===k||"r"===k)p.hj=!0;else{if("C"!==k&&"c"!==k)return p;p.hj=!1;c=g}if(e++,b++,e>=m)return p.li=e,p.ij=c,p.jj=!0,p.gj=!0,p;if((k=a[b],"["===k&&(e++,b++,p.jj=!0),e>=m)||(h=!1,k=a[b],p.jj&&"-"===k&&(e++,b++,h=!0),e>=m))return p;if(k=a[b],!f(k))return p.jj?p:(p.li=e,p.ij=c,p.jj=!0,p.gj=!0,p);for(;b=m||"]"!==a[b])return p;b++}return e<(p.hj?y:t)?(p.jj?(e=h?-e:e,p.ij=e+c):p.ij=e-1,p.li=b,p.gj=!0,p):void 0}function K(a,f,c,e,b,g,k,p,m){var v,n;if(m=m||0,v=y-1,(0===m||1===m)&&e>-v&&e<=2*v&&(e+=g?f:0,e=d(e,v)),n=t-1,(0===m||2===m)&&b>-n&&b<=2*n&&(b+=k?c:0,b=d(b,n)),!(3===m||0<=e&&0<=b||1===m&&0<=e||2===m&&0<=b))return void p.push(""+h.Errors.Reference);if(a)(p.push("R"),0<=e&&(f!==e||!g)&&(g?p.push("["+(e-f)+"]"):(e++,p.push(e+""))),0>b)||(p.push("C"),c===b&&k||(k?p.push("["+(b-c)+"]"):(b++,p.push(b+""))));else{if(0<=b){k||p.push("$");a=b;f=1;for(c=M.length;fe||(e++,g||p.push("$"),p.push(e+""))}}function O(a,f){var c,e;if(!a||0===a.length)return!0;if(!f){if(h.isNumber(a[0]))return!1;e=J(a,!1,0,0);if(c=(e.gj||(e=J(a,!0,0,0)),e),c.gj&&c.li<=a.length)return!1}for(e=0;e=a.length-1||"'"!==a.charAt(e+1)))return!1}else if("'"===c||"["===c||"]"===c||"?"===c||"%"===c||h.operaterTypesMap[c])return!1;return!0}function I(a,f){var c,e,b;return!!h.isDigit(a[0])||(c=[],e=a,"["===a[0]&&(b=a.lastIndexOf("]"),0g&&D(),g}return-1}function F(a,f){var c,e,b;if(f)return!0;if(c="",c=a[0],e=c,"#"===c||" "===c||"@"===c||" "===c||","===c||":"===c||"["===c||"]"===c)return!1;for(b=1;bk&&" "===g[a];)a++;a=a>=k?g.slice(k,a+1):g}return{xj:a,tj:f,uj:c,wj:e}}function D(){throw a.C(h.SR)().Exp_FormulaInvalid;}function A(a,f,c){switch(a){case 1:return c?"[#This Row]":"@";case 2:return f?"[#Headers]":"#Headers";case 3:return f?"[#Data]":"#Data";case 8:return f?"[#Totals]":"#Totals";case 6:return"[#Headers], [#Data]";case 12:return"[#Data], [#Totals]"}return f?"[#All]":"#All"}function r(a){return 1===a.Nc&&"ARRAY"===a.ni?1:0===a.Nc&&3===a.hi?a.ni.length+2:0===a.Nc&&12===a.hi?a.ni.length+3:a.ni.length}function n(a,f,c){var e,b;a&&f&&(e=f.getName(),b=a[e],b||(b=a[e]=[],a.sheets||(a.sheets=[]),a.sheets.push(e)),b.push(c))}function w(a,f,c,e,b,g){var k;if(a){for(;10===a.type;)a=a.value;if(!(12===a.type&&(k=a,a=k.value),2<=a.type&&6>=a.type))if(1===a.type)b=a.getRange(b,g),!e.source||a.source&&a.source!==e.source||f.push(b),n(c,a.source||e.source,b);else if(13===a.type)b=a.getRange(b,g),a.source()===e.source&&b&&f.push(b),n(c,a.source()||e.source,b);else if(8===a.type)k=null,a.source?a.source.Cf()&&(k=new h.EvaluateContext(a.source,!1,h.pf(b,g))):k=e,w(k.getName(a.value),f,c,k,b,g);else if(9===a.type)w(a.value,f,c,e,b,g),a.value2&&w(a.value2,f,c,e,b,g);else if(7===a.type)for(k=0;kc[e+2].ni.indexOf(":")||0===f.Nc&&12===f.hi){if(A&&(0m?null:(k=a-b+1,p=g-c+1,h.qf(b,c,k,p))},a.offsetWhenInsertRemoveColumn=function(a,f,e){var b,c,g=this.nj;return athis.pj+g?this:(f=e?f:-f,b=a-g,c=C(),c.lj=this.lj,c.pj=this.pj+f,c.oj=this.oj,a<=g+this.oj&&(c.oj+=f,c.ojb.oj&&(b.oj+=e),b.pj=b.oj),b.rj=this.rj,b.qj=this.qj,b},a.offset=function(){var a=C();return a.lj=this.lj,a.qj=this.qj,a.oj=this.oj,a.pj=this.pj,a.rj=this.rj,a},a};c=h.StructureReferenceResolver=function(a){h.TokenResolver.call(this);this.kj=a;this.priority=7900};B(c,h.TokenResolver);u(c.prototype,{resolveToken:function(a,f,g,e){var b;f=g[e];if(0===f.Nc&&0===f.hi)if(f=f.ni,"]"===f.charAt(f.length-1))try{b=C();var k=f.split(""),h,d,n,t,x,y,l,B;f=0;var w=k[f],r;g=f;e=w;for(var z,E=null,A=0,M=k.length;"["!==e&&g=d&&D();a=k;h=f;z=w;for(var M=d,E=e=g=P=void 0,A=14,F=h;"]"!==z;)"'"===z&&h++,h++,z=a[h];P=a.slice(F,h).join("").toLowerCase().trim();g=!1;for(e=0;e=a.length)M--;else{for(z=a[h];" "===z;)h++,z=a[h];if(","===z){1>=M&&D();h++;for(z=a[h];" "===z;)h++,z=a[h];for("["===z&&(M++,h++,z=a[h]);" "===z;)h++,z=a[h]}1l){(t||"["===w&&1E&&(A=e,e=E,E=A),a.oj=e,a.pj=E,z++,z=k.length&&D();f++;w=k[f]}","===w&&(f++,w=k[f])}n||(b.qj=16);t||(b.oj=0,b.pj=b.lj.endColumn()-b.lj.startColumn(),b.rj=1);return b}catch(ia){}else if(b=a.getTableByName(f))return c.create(b);return null},unparse:function(a,f,c,e){var b;if(f=13===c.type){if(16===c.qj&&1===c.rj)e=(e.push(c.lj.tableName()),void(a.Eh&&e.push("[]")));else{(f=a.source===c.lj.source()&&a.row>=c.lj.startRow()&&a.column>=c.lj.startColumn()&&a.row<=c.lj.endRow()&&a.column<=c.lj.endColumn())&&!a.Eh||e.push(c.lj.tableName());e.push("[");16!==c.qj&&(b=A(c.qj,1!==c.rj,a.Eh),e.push(b));if(1!==c.rj)if(1===c.qj&&!a.Eh||16===c.qj||e.push(", "),b=c.lj.getColumnName(c.oj),b=G(b.split("")).join(""),4===c.rj)c=c.lj.getColumnName(c.pj),c=G(c.split("")).join(""),e.push("[",b,"]:[",c,"]");else{if(a=1===c.qj&&!a.Eh){a:if(f="",f=b[0],"#"===f||" "===f||"@"===f||" "===f||","===f||":"===f||"["===f||"]"===f)a=!0;else{for(a=1;ag[m].mi+p&&(k=new x(a.slice(g[m].mi+p,a.length),7,g[m].mi+p),g.splice(m+1,0,k));for(k=0;kh||0>a?I:f.Ju&&f.Ku===h&&f.Lu===a?f.Mu:(q=this.Hu,y=H[c],q?(t=q.rowCount,l=q.colCount,h>=t?null:a>=l?null:(w=q[h],w||(w=q[h]={}),p=w[a],p||(p=w[a]={v:f.getValue(h,a)}),g=p[y],g===O&&(g=n.Convert.wf(p.v,c,!0),p[y]=g),g)):h>=this.getRowCount()?null:a>=this.getColumnCount()?null:this.kj.getValue(h,a))},getReference:function(d){return-1===d.row&&(d.row=0,d.rowCount=this.getRowCount()),-1===d.col&&(d.col=0,d.colCount=this.getColumnCount()),new n.CalcReference(this,[d])},getSheetRangeReference:function(d){var c,m,h,a,n;if(d.endSource&&this.kj&&this.kj.parent&&this.kj.parent.sheets&&d.endSource instanceof q){c=this.kj.parent.sheets;m=!1;a=[];for(n=0;n=x||B>=w)return A=[null],A.rowCount=1,A.colCount=1,A.rangeCount=1,A;l+N>x&&(N=x-l);B+S>w&&(S=w-B);e=Y.Ju;for(b=0;b=a.startColumn()&&d.col+d.colCount-1<=a.endColumn()?4:O,l&&t);return C?n.StructureReferenceResolver.create(a,l,t,d.col-a.dataRange().col,d.col+d.colCount-a.dataRange().col-1):(1===d.rowCount&&1===d.colCount?q=n.rf(null,null,w,r,f,x):(0>d.row&&(w=p=n.BAND_INDEX_CONST),0>d.col&&(r=g=n.BAND_INDEX_CONST),q=n.uf(null,null,w,r,p,g,f,x,k,z)),q)};z.rangeToFormula=function(d,c,m,h,a){d=z.rangeToExpression(d,c,m,h);c=new D(null,!!a,n.pf(c,m));return(new n.Parser).unparse(c,d)};z.rangeToFormulaWithStructReference=function(d,c,m,h,a,q,l){c=z.rangeToExpression(c,m,h,a,l);d=new D(d,!!q,n.pf(m,h));return(new n.Parser).unparse(d,c)};z.formulaToRange=function(d,c,m,h){var a,n,q,t,l;if(!c)return null;if(m=m?m:0,h=h?h:0,a=d.Cf(),c=a.parse(d.yj(),c,m,h,!0,!0))if(n=c.source,n&&13===c.type)n=c.source();else if(1===c.type&&c.endSource){a=c.source;q=c.endSource;a=a.getSources(q);q=!1;for(t=0;tMath.abs(w))f=!0;else if(G(x))f=!1;else for(t=k+(0===k?.01:.01*k),y=0;!f&&100>y;y++)t=13<=(""+t).length?+t.toPrecision(13):t,d.setValue(c,m,t),x=h.getValue(a,n),l=(F(x)?+x:0)-q,F(x)&&.001>Math.abs(l)?f=!0:G(x)?t=(k+t)/2:0===k-t?t=k+(0===k?.01:.01*k):0===w-l?t=k+2*(t-k):(p=t-l*(k-t)/(w-l),k=t,w=l,t=p);return f||d.setValue(c,m,g),f};U.exports=n},function(U,u,l){function d(a,c,f,k,h,m,d,n,t,e){var b,g;return 0<=f||!h?(b=k+(h?f:0),g=m+(d?f:0),n===a&&t+e<=f&&(b-=h?e:0,g-=d?e:0),n===c&&(t<=b?(b+=e,g+=e):t<=g&&(g+=e)),b-=h?f:0,g-=d?f:0,{index:b,endIndex:g}):{index:k,endIndex:m}}function J(c,g,f,k,m,n,q,l,w){var e,b,p,x,r,z=k;if(1===k.type&&k.sf)a:{if(b=k.source||c){r=l?k.row:k.column;var E=l?k.rowRelative:k.columnRelative;if(l&&0<=g||!l&&0<=f||!E){if(w)x=d(c,b,l?g:f,r,E,-1,!1,m,n,q).index;else{b:if(g=l?g:f,0<=g||!E){f=r+(E?g:0);if(m===c&&n<=g&&(f+=E?q:0),m===b)if(n+q<=f)f-=q;else if(n<=f){c=t;break b}c=f-(E?g:0)}else c=r;if(x=c,C(x)){z=h(x);break a}}x!==r&&(k=k.offset(l?x-r:0,l?0:x-r,!0))}}z=k}else if(1===k.type)a:{e=k.source||c;var A,M,P;if(e){if(A=k.tf(),3===A||l&&2===A||!l&&1===A){z=k;break a}if(M=l?k.rowRelative:k.columnRelative,P=l?k.endRowRelative:k.endColumnRelative,x=l?k.row:k.column,z=l?k.endRow:k.endColumn,l&&0<=g||!l&&0<=f||!M||!P){if(w)b=d(c,e,l?g:f,x,M,z,P,m,n,q);else{b:if(g=l?g:f,0<=g||!M){if(r=x+(M?g:0),E=z+(P?g:0),f=n+q-1,m===c&&n<=g&&(r+=M?q:0,E+=P?q:0),m===e)if(f=E){c=t;break b}n>E||(f<=E?(r=n>=r?r:n,E-=q):E=n-1)}c=(r-=M?g:0,E-=P?g:0,{index:r,endIndex:E})}else c={index:x,endIndex:z};if(b=c,C(b)){z=new h(b);break a}}c=b.index;m=b.endIndex;c===x&&m===z||(k=k.offset2(l?c-x:0,l?0:c-x,l?m-z:0,l?0:m-z))}}z=k}else if(10===k.type)e=J(c,g,f,k.value,m,n,q,l,w),e!==k.value&&(z=a(e));else if(9===k.type)b=J(c,g,f,k.value,m,n,q,l,w),l=k.value2&&J(c,g,f,k.value2,m,n,q,l,w),b===k.value&&l===k.value2||(z=B(k.operatorType,b,l));else if(7===k.type){b=null;r=k.arguments.length;for(x=0;xb?b:n),-1!==v&&(q=!1,e=e>v?v:e),!q&&!m)break;if(!q&&!m)break}if(!(c&&m||!c&&q)&&(g=f[t].validator,d=f[t].sheet,z=d.yj(),h=g.condition(),p=h.getFormulas(),p&&0t)return E;if(h.Pj(a,c,f,1,1)&&(B=p?l:0,r=n?l:0,v-=B,t-=r),q=t-v,h.Sj(G,-1,v,-1,q))v+=l,t+=l;else if(h.Pj(G,-1,v,-1,q))return E;if(v-=p?f:0,t-=n?f:0,v!==k.column||t!==k.endColumn)return m(k.source,null,k.row,v,k.endRow,t,k.rowRelative,p,k.endRowRelative,n)}}else{if(e=k.row+(g?c:0),b=k.endRow+(d?c:0),e>b)return E;if(h.Pj(a,c,f,1,1)&&(y=g?L:0,w=d?L:0,e-=y,b-=w),x=b-e,h.Sj(G,e,-1,x,-1))x=L,e+=x,b+=x;else if(h.Pj(G,e,-1,x,-1))return E;if(e-=g?c:0,b-=d?c:0,e!==k.row||b!==k.endRow)return m(k.source,null,e,k.column,b,k.endColumn,g,k.columnRelative,d,k.endColumnRelative)}else if(1===H){if(g=k.rowRelative,d=k.endRowRelative,0<=c||!g||!d){if(e=k.row+(g?c:0),b=k.endRow+(d?c:0),e>b)return E;if(h.Pj(a,c,f,1,1)&&(y=g?L:0,w=d?L:0,e-=y,b-=w),x=b-e,h.Sj(G,e,-1,x,-1))x=L,e+=x,b+=x;else if(h.Pj(G,e,-1,x,-1))return E;if(e-=g?c:0,b-=d?c:0,e!==k.row||b!==k.endRow)return m(k.source,k.endSource,e,M,b,M,g,!1,d,!1)}}else if(2===H){if(p=k.columnRelative,n=k.endColumnRelative,v=k.column+(p?f:0),t=k.endColumn+(n?f:0),vn)return E;if(h.Pj(a,-1,f,-1,1)?(B=t?F:0,z=x?F:0,d-=B,n-=z):h.Sj(a,-1,f,-1,1)&&(B=t?F:0,z=x?F:0,d+=B,n+=z),b=n-d,h.Sj(C,-1,d,-1,b)?(y=F,d+=y,n+=y):h.Pj(C,-1,d,-1,b)&&(y=F,d-=y,n-=y),d-=t?f:0,n-=x?f:0,d!==k.column||n!==k.endColumn)return m(k.source,null,M,d,M,n,!1,t,!1,x)}return k}function G(c,g,f){var k,p,m,d,n,q=g;if(8===g.type){if(g.value===f&&(!g.source||g.source===c.getSource()))return h(t,g.source)}else if(10===g.type)k=G(c,g.value,f),k!==g.value&&(q=a(k));else if(9===g.type)k=G(c,g.value,f),c=g.value2&&G(c,g.value2,f),k===g.value&&c===g.value2||(q=B(g.operatorType,k,c));else if(7===g.type){d=null;n=g.arguments.length;for(m=0;m=h||g>=p?null:{row:f,col:g,rowCount:h-f,colCount:p-g,intersectWith:q}}var D,A,r=l(33),n=Math.min,w=Math.max,z=r.kf,C=r.Convert.vf,c=r.rf,m=r.uf,h=r.Hh,a=r.Lh,B=r.Kh,y=r.Jh,t=r.Errors.Reference,E=r.Ih,M=r.BAND_INDEX_CONST;U=r.CalcOperatorAdjustor=function(){function a(){}return a.zj=function(c,f,k,p,m){var g,d,n=c,e=a.zj;if(!c)return n;if(g=r.MAX_ROW_COUNT,d=r.MAX_COLUMN_COUNT,10===c.type)n=r.Lh(e.call(a,c.value,f,k,p,m));else if(1===c.type&&c.sf){if(c.rowRelative&&(0>c.row+f||c.row+f>g)||c.columnRelative&&(0>c.column+k||c.column+k>d))return h(t,c.source);n=c.offset(0,0,!1)}else if(1===c.type){if(c.rowRelative&&!c.isFullColumn&&(0>c.row+f||c.row+f>g)||c.columnRelative&&!c.isFullRow&&(0>c.column+k||c.column+k>d)||c.endRowRelative&&!c.isFullColumn&&(0>c.endRow+f||c.endRow+f>g)||c.endColumnRelative&&!c.isFullRow&&(0>c.endColumn+k||c.endColumn+k>d))return h(t,c.source,c.endSource);n=c.offset(0,0,!1)}else if(9===c.type)n=r.Kh(c.operatorType,e.call(a,c.value,f,k,p,m),c.value2&&e.call(a,c.value2,f,k,p,m));else if(7===c.type){if(g=[],c.arguments&&0f&&(q=0,d=n(c.rC(),h.rC()));0>k&&(x=0,t=n(c.cC(),h.cC()));0>p&&(l=0);0>m&&(y=0);c&&c.Sg(l,y,d,t);w=new r.CalcSourceModel(c.Cf(),w);for(B=0;Bf&&(f=0,d=n(a.getRowCount(),h.getRowCount()));0>p&&(p=0);0>c&&(c=0,t=n(a.getColumnCount(),h.getColumnCount()));0>m&&(m=0);a=!(a===h&&a.Cj===h.Cj);y.Sg(f,c,d,t);y._g(f,c,d,t,!0,!1);w.Sg(p,m,d,t);w._g(p,m,d,t,!0,!1);h=[];for(b=0;b=a.Tj&&h=a.Uj&&m=a.Vj&&h=a.Wj&&md[e].row?d[e].row:p,n=n>d[e].col?d[e].row:n;if(b=m&&m.getFormulas(),b&&0l?0:l,0>c?0:c);n?a.setArrayFormula(n.row,n.col,n.rowCount,n.colCount,h):m?a.setFormulaByName(m,h):a.setFormula(l,c,h,null,!0,!0)}function R(d,q,l,r,c,m,h,a,B,y){var n,w,z,p,g,f,k,x,C=m-l,A=h-r,D=q.yj(),F=c.yj();if(9===y.type){if(n=y.value,w=y.value2,z=R(d,q,l,r,c,m,h,a,B,n),p=w&&R(d,q,l,r,c,m,h,a,B,w),n!==z||w!==p)return K.Kh(y.operatorType,z,p)}else if(7===y.type){n=!1;w=[];for(p=0;p=l&&y.row=r&&y.column=l&&y.column>=r||f&&y.endColumnd||d>=this.getRowCount()||0>l||l>=this.getColumnCount())return void this.Os(0,G().Exp_IndexOutOfRange);h=this.tables;3===m&&0<=d&&0<=l&&h&&!h.av(d,l,1,1,r)||(a=this.Bj(),n=this.conditionalFormats,a&&(y=a.getFormula(d,l),a.setFormula(d,l,r,C,c),n&&n.Nm(),this.Bq("formula",d,l,m,y,r)),this.t4&&this.t4(d,l,1,1,m),this.$p())}},setArrayFormula:function(d,q,l,r,c){this.bv(d,q,l,r,c,!1)},bv:function(d,l,r,C,c,m,h){var a,n,y;if(1!==h&&2!==h){if(q(h)&&(h=3),0>d||d+r>this.getRowCount()||0>l||l+C>this.getColumnCount())return void this.Os(0,G().Exp_IndexOutOfRange);if(this.zl().hasSpans(d,l,r,C))return void this.Os(0,G().Exp_ArrayFromulaSpan);if(a=this.tables,!(3===h&&0<=d&&0<=l&&a)||a.av(d,l,r,C,c)){if(n=this.Bj(),y=this.conditionalFormats,n&&(this.suspendEvent(),n.setArrayFormula(d,l,r,C,c,m),this.resumeEvent(),y&&y.Nm(),1>this.jm)){m=[];for(a=d;ad&&(d=0,l=this.getRowCount());0>q&&(q=0,r=this.getColumnCount());for(m=0;m=l?r:0;else if(!m&&c)x+=x>=l?r:0;else if(m&&!c)if(k>=l+r)k-=r;else{if(k>=l)return p}else if(x>=l+r)x-=r;else if(x>=l)return p;if(k!==g||x!==f)return K.rf(z,Q,k,x,h.rowRelative,h.columnRelative)}}else if(1===h.type){if(w=h.source||d&&d.yj(),g=h.row,f=h.column,C=h.endRow,A=h.endColumn,d=h.rowRelative,q=h.columnRelative,k=h.endRowRelative,x=h.endColumnRelative,a=g,n=f,y=C,t=A,w&&w===z){if(m&&c)g+=!d&&g>=l?r:0,C+=!k&&C>=l?r:0;else if(!m&&c)f+=!q&&f>=l?r:0,A+=!x&&A>=l?r:0;else if(m&&!c){if(!d&&g>=l&&!k&&C=l+r)g-=r;else if(!(gl&&(g=l)}if(!k)if(C>=l+r)C-=r;else{if(d)return p;C=l&&!x&&A=l+r)f-=r;else if(!(fl&&(f=l)}if(!x)if(A>=l+r)A-=r;else{if(q)return p;Ae;e++){g=p("tr");for(c=0;2>c;c++)k=p("td"),h=k.style,h.padding=0,h.border=0,g.appendChild(k);a.appendChild(g)}b.appendChild(a);d.xs=p("div");d.xs.id=b.id+"vp";H(a.rows[0].cells[0]).append(d.xs);d.St=new G(!1);e=d.St.Bv();c=d.Cv=p("div");H(c).append(e);H(a.rows[0].cells[1]).append(c);H(e).bind("scroll.gcScrollbar",function(b,a){var e=a.scrollEventType;b.data=d;1===a.scrollOrientation&&(0===e||1===e||2===e||3===e||5===e?Q.Dv(b,a):4===e&&Q.Ev(b))}).bind("mousedown.gcScrollbar",function(b){b.data=d;Q.Fv(b)}).bind("mouseup.gcScrollbar",function(b){b.data=d;Q.Gv(b)});e=p("table");c=e.style;e.cellSpacing=0;e.cellPadding=0;e.border=0;c.border=0;c.margin=0;H(e).css("user-select","none");g=p("tr");for(c=0;2>c;c++)k=p("td"),h=k.style,h.padding=0,h.border=0,g.appendChild(k);e.appendChild(g);H(a.rows[1].cells[0]).append(e);c=d.Hv=p("div");g=c.style;g.width=""+d.Iv()*H(b).width()+"px";g.height=""+d.Jv()+"px";g.fontSize="10pt";g.fontFamily="Arial";H(e.rows[0].cells[0]).append(c);d.Pt=new G(!0);c=d.Pt.Bv();g=d.Kv=p("div");H(g).append(c);H(e.rows[0].cells[1]).append(g);H(c).bind("scroll.gcScrollbar",function(b,a){var e=a.scrollEventType;b.data=d;0===a.scrollOrientation&&(0===e||1===e||2===e||3===e||5===e?Q.Lv(b,a):4===e&&Q.Mv(b))}).bind("mousedown.gcScrollbar",function(b){b.data=d;Q.Nv(b)}).bind("mouseup.gcScrollbar",function(b){b.data=d;Q.Gv(b)});d.Ov=p("div");H(a.rows[1].cells[1]).append(d.Ov);d.ku=new Q(this);H(x).bind("resize.gcSpread",function(){d.Pv()});(a=J(d))&&a.ws(d.xs);d.Qv();d.fq();d.Rv(b);R.ao(d,"setHost",b)}},Rv:function(b){var a=this,e=k(H(b).attr("tabindex"),10)||0,f=p("div");H(f).css({position:"absolute",overflow:"hidden"}).attr("gcUIElement","gcSheetFocusElementForTab").attr("tabindex",e).bind("focus",function(){a.Sv||J(a).zt();a.Sv=!1});b.insertBefore(f,null);a.Tv=f},Uv:function(){var b=this.Tv;b&&(this.Sv=!0,b.focus())},no:function(){var b,a,e;b=this.Pt;var c=this.St;a=this.sheets;h.Tn(this);H(x).unbind("resize.gcSpread");this.Zv&&clearTimeout(this.Zv);b&&b.dispose();c&&c.dispose();this.mu();B.$b();for(b=0;bf&&(m=f)),f=c>m?cf&&(t.qq=f),p=t.Ot(t.qq),-1!==p&&p!==t.qq&&(t.qq=p),g=t.gu(),1>g&&(g=1),n=this.Pt,n&&(n.bw(t.Qt(b)),n.cw(t.Qt(f)),n.dw(g),n.ew(),n.value(t.Qt(t.qq))))},Xt:function(){var b,a,e,f,c,g,k,h,d,m,p,n,t=J(this),q=this.options;t&&(b=t.frozenRowCount(),a=t.getRowCount()-t.frozenTrailingRowCount()-b,e=t.am(),f=0===a?b:b+a-1,c=t.lq,k=t.eu(e.jr,b,f),q.scrollbarMaxAlign&&(f=k),q.scrollbarShowMax||(h=t.iu(),d=h.lastNonNullRow,m=t.eu(e.jr,b,d),m===b&&(m++,m>f&&(m=f)),f=c>m?cf&&(t.lq=f),p=t.Rt(t.lq),-1!==p&&p!==t.lq&&(t.lq=p),g=t.hu(),1>g&&(g=1),n=this.St,n&&(n.bw(t.Tt(b)),n.cw(t.Tt(f)),n.dw(g),n.ew(),n.value(t.Tt(t.lq))))},aq:function(){var b,a,e,f,c,g,k,h,d,m,p=this.Jv(),n=this.Wv(),t=this.Xv(),q=this.qo;q&&(b=this.options,a=b.tabStripVisible,e=H(q),f=e.width(),c=this.Pt,g=this.Hv.style,k=H(this.xs).width(),h=P(this.Iv()*k),h===k&&(h=k-1),g.width=""+h+"px",g.height=""+p+"px",d=f-(a?h:0)-(b.showVerticalScrollbar?t:0),c.Vo(0(new Date).valueOf()-d)||(d=J(this),m={oldSheet:d,newSheet:k,needTriggerSheetChange:!0},this.Wq(a.FormulatextboxActiveSheetChanging,m),p={oldSheet:d,newSheet:k,cancel:!1},(g=m.needTriggerSheetChange&&g)&&this.Wq(a.ActiveSheetChanging,p),!1===p.cancel&&(this.eq=b,k!==d&&(d&&d.no(!1),this.nw(k,e,!1,f)),this.fq(),this.Wq(a.FormulatextboxActiveSheetChanged,{oldSheet:d,newSheet:k}),g&&this.Wq(a.ActiveSheetChanged,{oldSheet:d,newSheet:k})),(h.ipad||h.iphone)&&(this.mw=(new Date).valueOf())))},nw:function(b,a,e,f){e||b.ws(this.xs);e=(e=y.Xl())&&e.parent===this;a=2===a?e:1===a;y.Zl(null);!this.mv&&a&&b.zt(f);b.qs();b.os()},addSheet:function(b,a){this.ow(b,2,a)},ow:function(b,a,e){var f,c,g,k,h,m;if(e||(e=this.vv(this.wv(b))),c=this.sheets,g=c.length,e.Cj)for(f=0;fh&&this.hq&&(h=this.hq.jw(h)),this.eq=h);e=J(this);e!==k&&(k&&k.no(!1),e&&this.nw(e,a,1===g),this.fq());this.hq&&(0>this.hq.gq&&(this.hq.gq=this.eq),this.hq.repaint())},removeSheet:function(b){this.qw(b,2)},qw:function(b,a){var e,f,c,g,k,h=this.sheets,m=this.Wu,p=this.hq,n=h.length;if(isNaN(b)||0>b||b>=n)throw Error(d().Exp_IndexOutOfRange);if(e=b<=this.eq||b===n-1,f=J(this),b=n)this.eq=p.rw(n);else{for(g=this.eq;g=n&&(this.eq=-1)}e&&(k=h[this.eq],f!==k&&(f&&f.no(!1),k&&this.nw(k,a,!1)));m&&m.removeSource(c.yj());p&&(p.gq>=n?this.startSheetIndex(p.rw(n)):0>p.gq?this.startSheetIndex(p.jw(-1)):this.fq())},clearSheets:function(){var b,a=this.sheets,e=this.Wu,f=this.hq;for(b=0;bb)throw d().Exp_ArgumentOutOfRange;if(0===b&&this.clearSheets(),e=this.sheets.length,b=b;e--)this.qw(e,a);else if(b>e)for(;ethis.jm&&(this.jm=0);for(b=0;bp&&(g=p),n=t.Qt(g),e!==n&&(a.newValue=n),f!==n&&v.ku.Bw(g,!0))},Mv:function(b){var a,e,f,c,g;b=b.data;var k=J(b);k&&(a=b.Pt,e=k.du(a.value()),f=k.$t(),c=k.ps(),g=k.Cw,ec&&a.value(k.Qt(c)),b.xw(),b.options.scrollbarShowMax||(b.ku.scrolling?k.oq=!0:b.Ut()),g&&g.focus())},Nv:function(b){var a,e,f,c,g=b.data;g&&(a=J(g),a&&(a.zt(),e=g.options.showScrollTip,1!==e&&3!==e||(f=H(b.srcElement||b.target),c=f.parent(),(f&&f.hasClass("gc-scroll-handle")||c&&c.hasClass("gc-scroll-handle")||f&&f.hasClass("gc-scroll-bar")||c&&c.hasClass("gc-scroll-bar"))&&(f||c)&&g.ku.Dw(!1,b))))},Dv:function(b,a){var e,f,c,g,h,d,m,p,n,t=b.data,v=J(t);v&&a&&(e=a.newValue,f=a.oldValue,c=a.scrollEventType,g=k(e,10),g=v.cu(g),f=a.oldValue=M(f)?0:k(f,10),v.jq=!1,d=t.options.scrollbarShowMax,2===c||0===c?(2===c&&(g=v.Ew()),h=v.Rt(g,!0),-1!==h&&h!==g&&(g=h),d||(v.jq=!0,a.ignoreUpdatePosition=!0)):3!==c&&1!==c||(3===c&&(g=v.Fw(),g===v.lq&&g++),d||(v.jq=!0,1===c&&e===f&&g++),h=v.Rt(g),-1!==h&&h!==g&&(g=h)),m=v._t(),p=v.ns(),gp&&(g=p),n=v.Tt(g),e!==n&&(a.newValue=n),f!==n&&t.ku.Bw(g))},Ev:function(b){var a,e,f,c,g;b=b.data;var k=J(b);k&&(a=b.St,e=k.cu(a.value()),f=k._t(),c=k.ns(),g=k.Cw,ec&&a.value(k.Tt(c)),b.xw(),b.options.scrollbarShowMax||(b.ku.scrolling?k.jq=!0:b.Xt()),g&&g.focus())},Fv:function(b){var a,e,f,c,g=b.data;g&&(a=J(g),a&&(a.zt(),e=g.options.showScrollTip,2!==e&&3!==e||(f=H(b.srcElement||b.target),f&&(c=f.parent(),(f.hasClass("gc-scroll-handle")||c&&c.hasClass("gc-scroll-handle")||f.hasClass("gc-scroll-bar")||c&&c.hasClass("gc-scroll-bar"))&&g.ku.Dw(!0,b)))))},Gv:function(b){(b=b.data)&&b.xw()}});Q.prototype={Bw:function(b,a){var e=this,f=J(e.yw);f&&(e.Gw=!0,e.Hw=a?f.lq:b,e.Iw=a?b:f.qq,window.setTimeout(function(){e.Kw()},0))},Kw:function(){J(this.yw)&&this.Gw&&(this.Gw=!1,this.Lw())},Lw:function(){var b,a,e,f,c;this.Mw||(this.Mw=!0,b=this.yw,a=J(b),a&&(e=b.options.showScrollTip,f=this.Hw,c=this.Iw,f!==a.lq?(this.ju(f),2!==e&&3!==e||b.ww(this.Nw(!0))):c!==a.qq&&(this.lu(c),1!==e&&3!==e||b.ww(this.Nw(!1)))),this.Mw=!1)},ju:function(b){var e,f,c,g,k,h,d,m,p,n,q,l,x,y,r,B,w=J(this.yw);if(w&&(e=w.lq,b!==e)){if(w.lq=b,0e){if(r=w.Gr(1),r&&0k+h;)--B,y=r[B];y.row>b&&(f=!0,d=c?c.x:g.x,m=x.y,p=g.width,n=y.y+y.height-x.y-2,q.Ow(d,m,p,n,d,k),w.invalidateLayout(),q._l(l,new t(d,k+n,p,h-n)),q.Pw(l,new t(d,k,p,h)))}}else{x=0;for(r=b;re){if(r=w.Hr(1),r&&0k+h;)--B,y=r[B];y.col>b&&(f=!0,d=x.x,m=c?c.y:g.y,p=y.x+y.width-x.x-2,n=g.height,q.Ow(d,m,p,n,k,m),w.invalidateLayout(),q._l(l,new t(k+p,m,h-p,n)),q.Pw(l,new t(k,m,h,n)))}}else{x=0;for(r=b;ra&&g===k-a&&(g=0)),e=b.Rt(g+a,0>a),-1!==e?g=e:g+=a,f=b._t(),c=b.ns(),0>=b.getRowCount()-k-b.frozenTrailingRowCount()||null===f?g=b.lq:(gc&&(g=c),null===g&&(g=-1)),g},Sw:function(b,a){var e,f,c,g=b.qq,k=b.frozenColumnCount();return 0a&&g===k-a&&(g=0)),e=b.Ot(g+a,0>a),-1!==e?g=e:g+=a,f=b.$t(),c=b.ps(),0>=b.getColumnCount()-k-b.frozenTrailingColumnCount()||null===f?g=b.qq:(gc&&(g=c),null===g&&(g=-1)),g},Dw:function(b,a){var e,f,c=this.yw;J(c)&&(b?(e=a.pageY,f=a.pageX-100):(e=a.pageY-40,f=a.pageX-30),c.uw(this.Nw(b),f,e,!0))},Nw:function(b){var a,e=J(this.yw),f=e.qq+1;return e&&(b?a=d().Tip_Row+(e.lq+1):(1!==e.options.colHeaderAutoText&&(f=e.xq(f)),a=d().Tip_Column+f)),a}};U.exports=u},function(U,u){U.exports=GC.Spread.Commands},function(U,u,l){function d(b){return(b=b.parent)&&b.options.allowExtendPasteRange}function J(b){return(b=b.parent)&&b.options.allowCopyPasteExcelStyle}function R(b){return(b=b.parent)&&b.options.copyPasteHeaderOptions}function Q(){return qa.C(u.SR)()}function K(b,a,e,f){throw Error(Va.Kb(Q().Exp_InvalidAndSpace,[b,a,e,f]));}function O(b){this.Vw=1===(1&b);this.Ww=2===(2&b);this.Xw=8===(8&b);this.Yw=u.X3&&16===(16&b);this.$w=this.Zw=!0}function H(b,a,e,f){var c,g,k,h,d,m,p,n,t,v,q,l;if(wa(b)||""===b)return na;(wa(a)||""===a)&&(a="\r\n");(wa(e)||""===e)&&(e="\t");(wa(f)||""===f)&&(f='"');$a(b,a)||(b+=a);c=[];g=[];k="";d=!1;m=f.length;p=a.length;n=e.length;t=b.length;for(v=0;v=m&&f===k.substr(h-m,m)?d&&t>=v+1+m&&f===b.substr(v+1,m)?v+=m:d?(k=k.substr(0,h-m),d=!1):(q=k,0===q.indexOf(f)&&(k=k.substr(0,h-m),d=!0)):!d&&h>=n&&e===k.substr(h-n,n)?(k=k.substr(0,h-n),g.push(""+k),k=""):!d&&h>=p&&a===k.substr(h-p,p)?(k=k.substr(0,h-p),g.push(""+k),c.push(g),g=[],k=""):!d&&1<=h&&"\n"===k.substr(h-1,1)?(k=k.substr(0,h-1),g.push(""+k),c.push(g),g=[],k=""):d&&t>=v+1+n&&e===b.substr(v+1,n)&&","!==e&&(v+=m);if(d){if(0=c.length&&c.push(g)}(g=""+k)&&(g=g.replace(RegExp(e,"g"),""),$a(g,a)&&(g=g.substr(0,g.length-p)),0===c.length&&c.push([g]))}return 0===c.length&&(l=b,$a(b,a)&&(l=l.substr(0,l.length-p)),c.push([l])),c}function I(b,a,e,f,c,g,k){for(var h=0;ha||a>=v)&&K("row",a,"-1",v-1),(-1>e||a+e>v)&&K("rowCount",e,"-1",v-a),(-1>f||f>=l)&&K("column",f,"-1",l-1),(-1>c||f+c>l)&&K("columnCount",c,"-1",l-f),r=!1,B=!1,-1===a&&-1===f&&-1===e&&-1===c?(a=0,f=0,x=b.getRowCount(void 0)-1,y=b.getColumnCount(void 0)-1):(-1===a&&(a=0,2===(2&b.parent.options.copyPasteHeaderOptions)&&(r=!0)),-1===f&&(f=0,1===(1&b.parent.options.copyPasteHeaderOptions)&&(B=!0)),-1===e&&(e=b.getRowCount(void 0)-a),-1===c&&(c=b.getColumnCount(void 0)-f),x=a+e-1,y=f+c-1),(wa(g)||""===g)&&(g="\r\n"),(wa(k)||""===k)&&(k="\t"),(wa(h)||""===h)&&(h='"'),w=RegExp(h,"g"),B?(C=b.getColumnCount(2),A=q(b,a,x,0,C-1,2,m,p,g,k,h,w,d,n,t),E=q(b,a,x,f,y,3,m,p,g,k,h,w,d,n,t),z=G(E,A,2,g,k)):r?(M=b.getRowCount(1),N=q(b,0,M-1,f,y,1,m,p,g,k,h,w,d,n,t),E=q(b,a,x,f,y,3,m,p,g,k,h,w,d,n,t),z=G(E,N,1,g,k)):(E=q(b,a,x,f,y,3,m,p,g,k,h,w,d,n,t),z=G(E,null,3,g,k)),z}function G(b,a,e,f,c){var g,k,h;if(1===e)g=a.concat(b);else if(2===e)for(e=a.length,g=[],k=0;kb||b>=this.getRowCount(void 0))&&K("row",b,"-1",this.getRowCount(void 0)-1),(-1>a||a>=this.getColumnCount(void 0))&&K("column",a,"-1",this.getColumnCount(void 0)-1),!wa(e)&&""!==e)if(-1===b&&(b=0),-1===a&&(a=0),(e=H(e,f,c,'"'))&&0=this.getColumnCount(2)&&(g.Vw=!1),0>=this.getRowCount(1)&&(g.Ww=!1)),k=g.Vw?this.getColumnCount(2):0,h=g.Ww?this.getRowCount(1):0,d=0,a-=k,0>=a&&(a=0),b-=h,0>=b&&(d=0),b-=d,0>=b&&(b=0),g.Zw&&f+b>this.getRowCount(void 0)&&this.setRowCount(f+b),g.$w&&c+a>this.getColumnCount(void 0)&&this.setColumnCount(c+a),m=d=0;d=p.length||(0x.row?this.getRowCount(void 0):x.rowCount,d=0>x.col?this.getColumnCount(void 0):x.colCount,m=0>k.row?b.getRowCount(void 0):k.rowCount,p=0>k.col?b.getColumnCount(void 0):k.colCount,h>m||d>p)for(b=e.row,a=e.col,0>e.row&&me.col&&pb?-1:b+c*m,0>a?-1:a+h*p,0>b?-1:m,0>a?-1:p))return this.Os(1,q),!1}else if(!this.nx(k,x)&&this.qu(x.row,x.col,x.rowCount,x.colCount))return this.Os(1,q),!1}else{if(1g.row?0:g.row,h=0>g.col?0:g.col,d=0>g.row?b.getRowCount(void 0):g.rowCount,m=0>g.col?b.getColumnCount(void 0):g.colCount,p=0>f.row?0:f.row,n=0>f.col?0:f.col,t=0>f.row?e.getRowCount(void 0):f.rowCount,v=0>f.col?e.getColumnCount(void 0):f.colCount,c?(t=d,v=m):0===t%d&&1===v?v=m:1===t&&0===v%m?t=d:0===t%d&&0===v%m||(t=d,v=m),!this.pu(k,h,d,m,b.getRowCount(void 0),b.getColumnCount(void 0)))||!e.l5(p,n,t,v))return na;if(a=new Ga(p,n,t,v),!c&&b.Cj===e.Cj)if(a.contains(k,h,d,m)){if(0!==(k-p)%d||0!==(h-n)%m)return na}else if(a.intersect(k,h,d,m)&&(t>d||v>m))return na;return-1===f.row&&(p=-1,t=-1),-1===f.col&&(n=-1,v=-1),new Ga(p,n,t,v)}return 1b.row?0:b.row,f=0>b.col?0:b.col,c=h.length,g=L(h),0f.row?e.getRowCount(void 0):f.rowCount,x=0>f.col?e.getColumnCount(void 0):f.colCount,n=0>a.row?b.getRowCount(void 0):a.rowCount,t=0>a.col?b.getColumnCount(void 0):a.colCount,l>n||x>t)for(m=f.row,p=f.col,0>f.row&&nf.col&&tm?-1:m+v*n,0>p?-1:p+q*t,0>m?-1:n,0>p?-1:t,h,d,R(b));else Ka.copyTo(b,a.row,a.col,e,f.row,f.col,a.rowCount,a.colCount,h,d,R(b))}else{m=f.row;p=f.col;n=f.rowCount;t=f.colCount;B=e.zl();w=[];B.each(m,p,n,t,function(b){b&&w.push(b)});z=0;for(E=w.length;z=e)return a&&(a.inSameRow=!0),!0;for(f=1;f=e)return a&&(a.inSameCol=!0),!0}return!1},o5:function(b){var a,e,f,c,g;if(b){if(a=b.length,1===a)return b[0];if(1f.col&&(f=g);return sa.kf(e.row,e.col,e.rowCount,f.col+f.colCount-e.col)}if(e.col===f.col&&e.colCount===f.colCount){for(c=0;cf.row&&(f=g);return sa.kf(e.row,e.col,f.row+f.rowCount-e.row,e.colCount)}}}return na},J5:function(b){var a,e,f,c,g,k,h=[],d=[];if(b&&(a=b.length,1e.col,f?ca.selectNextControl.execute(b,a):ca.moveToNextCell.execute(b,a)}};ca.moveToPreviousCellThenControl={canUndo:!1,execute:function(b,a){var e,f,c=D(b,a),g=c.Qr,k=c.getActiveColumnIndex();return c.Tx=!0,e=c.iy(c.getActiveRowIndex(),k,!0,g),c.Tx=!1,f=!e||e.leadingCellRow>g||e.leadingCellRow===g&&ka?this.$y[b]=na:this.$y[b]=a:0<=a&&(this.$y[b]=a);this._y[b]!==na?e?this._y[b]=e:this._y[b]=na:e&&(this._y[b]=e);this.az=!0},gz:function(b,a){a.level=-1;a.collapsed=!1;this.$y[b]!==na&&(a.level=this.$y[b]);this._y[b]!==na&&(a.collapsed=this._y[b])},hz:t("g",gb),iz:E("a"),jz:E("b"),kz:E("c"),Wy:E("d"),lz:E("e"),mz:E("f"),nz:function(){return this.az},oz:E("g")});Ha(p.prototype,{_v:t("a",0),bz:t("b",!0),cz:t("c",!0),Is:t("d",gb),pz:t("e",na),qz:t("f",na),fz:function(b,a,e){this.$y[b]!==na?0>a?this.$y[b]=na:this.$y[b]=a:0<=a&&(this.$y[b]=a);this._y[b]!==na?e?this._y[b]=e:this._y[b]=na:e&&(this._y[b]=e);this.az=!0},gz:function(b,a){a.level=-1;a.collapsed=!1;this.$y[b]!==na&&(a.level=this.$y[b]);this._y[b]!==na&&(a.collapsed=this._y[b])},rz:E("a"),jz:E("b"),kz:E("c"),Wy:E("d"),sz:E("e"),tz:E("f"),nz:function(){return this.az}});ca.x4=p;f.uz=function(b,a,e){var f=b.defaults;0<(64&e)&&(a.yy(b.getDefaultStyle()),a.Ay(b.getDefaultStyle(1)),a.Cy(b.getDefaultStyle(2)));0<(128&e)&&a.Is(b.tag());a.zy(f.colWidth);a.Wp(f.rowHeight);a.By(f.colHeaderRowHeight);a.Dy(f.rowHeaderColWidth)};f.vz=function(b,a,e,f,c){var k,h,d=a.Xj,m=a.Yj;if(g(b,1,0,f,d,m,c,a),0<(1&c))for(k=0;k=(1023&c)))for(k=a.Xj,h=a.Yj,g(b,2,f,0,k,h,c,a),0<(32&c)&&(a.A5=!0,b.zl(2).each(f,0,k,h,function(b){a.Ny(b)})),h=b.rowOutlines,k=e.Xj,d=0;d=(1023&c)||(k=a.Xj,h=a.Yj,g(b,3,e,f,k,h,c,a),0<(32&c)&&(a.A5=!0,b.zl().each(e,f,k,h,function(b){a.Ny(b)})))};f.zz=function(b,a,e){var f,c,g,k;if(b.tables&&(f=b.tables.all()))for(b=0,c=f.length;ba&&(a=0,f=b.getRowCount(void 0));0>e&&(e=0,g=b.getColumnCount(void 0));k=[];for(h=0;ha&&(a=0,f=b.getRowCount(void 0)),0>e&&(e=0,c=b.getColumnCount(void 0)),b.Bu(a,e,f,c,g,k))};f.Jz=function(b,a,e,f,c){(b=b.Bj())&&b.clear(a,e,f,c)};ca.Kz=f;W.prototype={constructor:W,execute:function(){},canExecute:function(){return!0},canUndo:function(){return!0},saveState:function(){},undo:function(){return!0},Lz:k,Mz:x};ca.ActionBase=W;ia(P,W);Ha(P.prototype,{Rz:function(b){var a,e,f,c,g,h,d,m,p,n,t,v,q,l,y,r,B,w,z,E,C=!1;if((b?this.canUndo():this.canExecute())&&(a=this.VQ,e=this.kj,f=a.columns,c=a.rowHeader,g=f&&f.length,h=da,e&&0=v&&!(e.getColumnVisible(q)&&0=v&&!(a.getRowVisible(q)&&0p?p:d,m=mg&&(g=-1,k=-1)),(-1===t.row||t.row<=g&&g+k<=t.row+t.rowCount)&&(-1===t.col||t.col<=c.range.col&&c.range.col+c.range.colCount<=t.col+t.colCount)))for(b=0>c.range.col?0:c.range.col,g=0>c.range.colCount?n.getColumnCount(void 0):c.range.colCount,a=0;al.row?0:l.row,e=0>l.col?0:l.col,c=0>l.row?x.getRowCount(void 0):l.rowCount,g=0>l.col?x.getColumnCount(void 0):l.colCount,0>l.row&&0>l.col&&0>n.row&&0>n.col&&x.Cj!==y.Cj&&(k=new h,f.uz(x,k,q),t.TA=k),0>l.row&&(b=fa(x,e,g,q),t.jA=b.headerCells,t.kA=b.columns),0>l.col&&(b=xa(x,a,c,q),t.nA=b.headerCells,t.oA=b.rows),t.bA=Fa(x,a,e,c,g,q),t.qA=aa(this.kj,a,e,c,g),x.isDirtySuspended()||(t.cA=new m(x,l,q)));a=0>n.row?0:n.row;e=0>n.col?0:n.col;c=0>n.row?y.getRowCount(void 0):n.rowCount;g=0>n.col?y.getColumnCount(void 0):n.colCount;x&&l&&(0>l.row&&0>l.col&&0>n.row&&0>n.col&&x.Cj!==y.Cj&&(p=new h,f.uz(y,p,q),t.UA=p),0>l.row&&(b=fa(y,e,g,q),t.hA=b.headerCells,t.iA=b.columns),0>l.col&&(b=xa(y,a,c,q),t.lA=b.headerCells,t.mA=b.rows));t.eA=Fa(y,a,e,c,g,q);t.pA=aa(this.kj,a,e,c,g);y.isDirtySuspended()||(t.fA=new m(y,n,q));d(y)&&(b={sheet:y,rowCount:y.getRowCount(),colCount:y.getColumnCount(),undo:Ia},t.m5=b)},VA:function(){return this.VQ.pasteExtent.targetRange},execute:function(){var b,a,e,c,g,k,h,p,n,t,v,q,l,x,y,r;if(this.canExecute()&&(b=this.VQ.fromSheet,a=this.VQ.toSheet,e=this.VQ.pasteExtent,c=this.VQ.pasteOption,g=e.sourceRange,k=e.targetRange,!b||!g||b.pu(g.row,g.col,g.rowCount,g.colCount,b.getRowCount(void 0),b.getColumnCount(void 0)))&&a&&k&&a.l5(k.row,k.col,k.rowCount,k.colCount,!0)){this.saveState();this.kj.suspendPaint();a.suspendEvent();b&&b.suspendEvent();try{d(a)&&(h=-1,p=-1,-1!==k.row?h=k.row+k.rowCount:-1===g.row&&(h=b.getRowCount(void 0)),n=a.getRowCount(void 0),h>n&&a.addRows(n,h-n),-1!==k.col?p=k.col+k.colCount:-1===g.col&&(p=b.getColumnCount(void 0)),p>a.getColumnCount(void 0)&&a.setColumnCount(p)),g&&Na.qn(b,g.row,g.col,g.row+g.rowCount-1,g.col+g.colCount-1),a.px(b,g,a,k,e.isCutting,e.clipboardText,e.clipboardHtml,c,!e.includeFilteredOutRow)}finally{a.resumeEvent(),b&&b.resumeEvent(),this.kj.resumePaint(),h=this.VQ.io,(p=this.kj)&&(t=h.bA,v=la.qx(c),e.isCutting&&t&&b&&t.data&&t.data.Py()&&(q=[],b.isDirtySuspended()||(l=new m(b,g,v),l.uy(h.cA.sy()),h._z=l,q=l.wy()),f.Bu(b,g.row,g.col,g.rowCount,g.colCount,q,3)),x=h.eA,x&&a&&x.data&&x.data.Py()&&(y=[],a.isDirtySuspended()||(r=new m(a,k,v),r.uy(h.fA.sy()),h.dA=r,y=r.wy()),f.Bu(a,k.row,k.col,k.rowCount,k.colCount,y,3))),g&&Na.Nm()}}},undo:function(){var b,a,e,c,g,k,h,m,p,n,t,v,q,l,x,y,r,B,w,z=0;if(this.canUndo()){if((b=this.VQ.fromSheet,a=this.VQ.toSheet,e=this.VQ.pasteExtent,c=e.sourceRange,g=e.targetRange,!a||!g)||!a.pu(g.row,g.col,g.rowCount,g.colCount,a.getRowCount(void 0),a.getColumnCount(void 0))||b&&c&&(!b.pu(c.row,c.col,c.rowCount,c.colCount,b.getRowCount(void 0),b.getColumnCount(void 0))||b&&b.Cj===a.Cj&&a.parent&&!Aa(a.parent.sheets,b)))return!1;e=this.VQ.io;this.kj.suspendPaint();try{h=k=na,m=0>g.row?0:g.row,p=0>g.col?0:g.col,n=0>g.row?a.getRowCount(void 0):g.rowCount,t=0>g.col?a.getColumnCount(void 0):g.colCount,(v=e.eA)&&v.data&&v.data.Py()&&(k=f.Iz(a,m,p,n,t)),u.X3&&f.Jz(a,m,p,n,t),z+=T(this,e.pA),e.UA&&(f.Gz(a,e.UA),z++),z+=T(this,e.hA),z+=T(this,e.iA),z+=T(this,v),z+=T(this,e.lA),z+=T(this,e.mA),d(a)&&(z+=T(this,e.m5)),y=x=l=q=0,b&&c&&(q=0>c.row?0:c.row,l=0>c.col?0:c.col,x=0>c.row?b.getRowCount(void 0):c.rowCount,y=0>c.col?b.getColumnCount(void 0):c.colCount,r=e.bA,r&&r.data&&r.data.Py()&&(h=f.Iz(b,q,l,x,y)),z+=T(this,e.qA),z+=T(this,e.jA),z+=T(this,e.kA),z+=T(this,r),z+=T(this,e.nA),z+=T(this,e.oA)),z&&this.kj&&(k&&a&&(B=e.dA,f.Bu(a,m,p,n,t,B?B.wy():[],3)),h&&b&&(w=e._z,f.Bu(b,q,l,x,y,w?w.wy():[],3)))}finally{this.kj.resumePaint()}}return 0f||f>=e)&&d("from row index",f,"-1",e-1);(-1>c||c>=b)&&d("from column index",c,"-1",b-1);(-1>p||p>=a)&&d("to row index",p,"-1",a-1);(-1>n||n>=h)&&d("to column index",n,"-1",h-1);g=c;0>c&&(g=0,q=b);c=0>n?0:n;(1>q||g+q>b||c+q>h)&&d("column count",q,"1",M(b-g,h-c));q=f;0>f&&(q=0,t=e);f=0>p?0:p;(1>t||q+t>e||f+t>a)&&d("row count",t,"1",M(e-q,a-f))}function R(a){if(!a||"number"==typeof a||"string"==typeof a||"boolean"==typeof a||y(a))return a;if(a.clone)return a.clone();if(a instanceof Date)return new Date(a);var f,c,g;f=a instanceof Object?new a.constructor:new a.constructor(a.valueOf());for(c in a)a.hasOwnProperty(c)&&(g=a[c],a.hasOwnProperty(c)&&f[c]!==g&&("object"==typeof g?f[c]=R(g):f[c]=g));return f.toString=a.toString,f.valueOf=a.valueOf,f}function Q(a,f,c,h,d,m,p,n,e){a=a.conditionalFormats;h=h.conditionalFormats;a&&h&&(a.XA(f,c,h,d,m,p,n),e&&a.YA(f,c,p,n))}function K(a,f,c,h,d,m,p,n,e){var b;0>f&&(f=0,p=M(a.getRowCount(void 0),h.getRowCount(void 0)));0>d&&(d=0);0>c&&(c=0,n=M(a.getColumnCount(void 0),h.getColumnCount(void 0)));0>m&&(m=0);a!==h||a.Cj!==h.Cj?(b=h.ZA,b&&(e?0f&&(f=0,d=M(a.getColumnCount(void 0),c.getColumnCount(void 0)));0>h&&(h=0);g=a.columnOutlines;k=c.columnOutlines;a!==c||a.Cj!==c.Cj?g&&k&&k.bB(g,f,h,d,m):g&&g.cB(f,h,d,m)}function H(a,f,c,h,d,m){var g;0>f&&(f=0,d=M(a.getRowCount(void 0),c.getRowCount(void 0)));0>h&&(h=0);g=!(a===c&&a.Cj===c.Cj);a=a.rowOutlines;c=c.rowOutlines;g?a&&c&&c.bB(a,f,h,d,m):a&&a.cB(f,h,d,m)}function I(a,f,c,h,d,m,p,n,e,b){var g=!(a===h&&a.Cj===h.Cj);a=a.zl(b);if(g){h=h.zl(b);var k,q,l,x,y,r,w,z,E=a&&0=m&&x=d&&lb&&(b=0,p=M(a.getRowCount(void 0),h.getRowCount(void 0)));0>d&&(d=0);0>g&&(g=0,n=M(a.getColumnCount(void 0),h.getColumnCount(void 0)));0>m&&(m=0);0>f&&I(a,-1,g,h,-1,m,-1,n,e,1);0>c&&I(a,b,-1,h,d,-1,p,-1,e,2);I(a,b,g,h,d,m,p,n,e)}function F(a,f,c,h,d,m,p){var g,e;0>f&&(f=0,d=M(a.getColumnCount(void 0),c.getColumnCount(void 0)));0>h&&(h=0);for(g=0;gf&&(f=0,d=M(a.getRowCount(void 0),c.getRowCount(void 0)));0>h&&(h=0);for(e=0;ef)if(z=c,E=p,g=M(a.getRowCount(1),d.getRowCount(1)),k=q,0>c&&(z=0,k=a.getColumnCount(void 0)),0>p&&(E=0),C)for(x=0;xc)if(b=f,z=m,g=n,k=M(a.getColumnCount(2),d.getColumnCount(2)),0>f&&(b=0,g=a.getRowCount(void 0)),0>m&&(z=0),C)for(x=0;xf&&(g=0,n=M(a.getRowCount(void 0),d.getRowCount(void 0))),0>c&&(k=0,q=M(a.getColumnCount(void 0),d.getColumnCount(void 0))),0>m&&(b=0),0>p&&(z=0),C)for(x=0;xf?M(c.getRowCount(void 0),h.getRowCount(void 0)):l,0>k?M(c.getColumnCount(void 0),h.getColumnCount(void 0)):y),E)));(g=u.X3)&&(c.suspendCalcService(),h.suspendCalcService());C=t;0<(256&e)&&(C=z(c,f,k,h,d,m,l,y,b,E));try{if(0<(1&e)&&(A(c,f,k,h,d,m,l,y,b,v,E),u.X3&&0===(2&e)&&h.clearFormula(d,m,l,y,function(a,e){return!b||!a.Ps||!a.Ps(e)}),0<(256&e)))for(N=C.length,D=0>d?0:d,P=0>m?0:m,V=0;Vf&&O(c,k,h,m,y,E),0>k&&H(c,f,h,d,l,E)),0<(32&e)&&(E||1!==l||1!==y)&&L(c,f,k,h,d,m,l,y,E),0>f&&0>=d&&F(c,k,h,m,y,e,E),0>k&&0>=m&&G(c,f,h,d,l,e,b,E),0>f&&0>=d&&0>k&&0>=m&&q(c,h,e,E),E&&0>f)for(f=k,0>k&&(f=0,y=M(c.getColumnCount(void 0),h.getColumnCount(void 0))),k=0;kn&&(w.xB=!0,w.wB=q>l-r),q>l&&(w.wB=!0,w.xB=d>n-r),w},CB:function(d){var q=J(d),n=this.sB,l=this.tB,z,C,c,m,h,a,B,y={EB:null,FB:null};return d?(z=q.offset(),C=l.offset(),c=n.offset(),z.leftWidth=z.left+q.outerWidth(),z.topHeight=z.top+q.outerHeight(),c.leftWidth=c.left+n.outerWidth(),c.topHeight=c.top+n.outerHeight(),m=z.left-C.left,z.leftc.leftWidth&&(h=z.leftWidth-C.left-n.innerWidth(),mc.topHeight&&(B=z.topHeight-C.top-n.innerHeight(),aq&&0-q>C-z&&(q=0-(C-z));q!==l&&(this.tB.css("top",q),this.gB&&n.value(0-q));O(d)}},d}();u.IB=l;q=function(){function q(d,q,n,l,z,C,c){this.KB=this.JB=!1;this.MB=this.LB=null;this.NB=300;this.OB=70;this.PB=d;this.Vo("number"==typeof q?q:0);this._v("number"==typeof n?n:0);this.dw("number"==typeof l?l:0);this.cw("number"==typeof z?z:0);this.bw("number"==typeof C?C:0);this.QB="number"==typeof c?c:1;this.RB=!1;this.SB=0;this.Qb=this.bw();this.ew()}return R.Zn(q),q.prototype={constructor:q,Bv:function(){return this.TB},qB:I("smallChange",1),rB:I("largeChange",10),dw:I("pageValue",10,function(d){0>=d&&this.dw(1)}),cw:I("maximum",100,function(d){0>=d&&this.cw(0)}),bw:I("minimum",0,function(d){0>=d&&this.bw(0)}),value:function(d){var q;return 0===arguments.length?this.Qb:("number"==typeof d&&d<=this.cw()&&d>=this.bw()&&(this.Qb=d,q=(d-this.bw())*this.UB,this.scrollTo(q,!0)),this)},Vo:I("width",0),_v:I("height",0),ew:function(){var d,q,n,l=this._v(),z=this.Vo(),C=0,c=0,m=!1,h=l,a=z-2*l,B=h,y="left",t="right",E="gc-scroll-arrowLeft",M="gc-scroll-arrowRight",p="gc-scrollbar-horizontal",g="margin-left",f="ui-state-default ui-corner-bl btn btn-default",k="ui-icon ui-icon-triangle-1-w",x="gc-scroll-handle ui-state-default ui-corner-all ui-draggable btn btn-default",D="ui-icon ui-icon-grip-solid-vertical",u="ui-state-default ui-corner-br btn btn-default",G="ui-icon ui-icon-triangle-1-e";this.VB=a;this.PB||(h=z,a=h,B=l-2*z,y="top",t="bottom",E="gc-scroll-arrowUp",M="gc-scroll-arrowDown",p="gc-scrollbar-vertical",g="margin-top",f="ui-state-default ui-corner-tr btn btn-default",k="ui-icon ui-icon-triangle-1-n",x="gc-scroll-handle ui-state-default ui-corner-all ui-draggable btn btn-default",D="ui-icon ui-icon-grip-solid-horizontal",u="ui-state-default ui-corner-br btn btn-default",G="ui-icon ui-icon-triangle-1-s",this.VB=B);d=this.VB;q=this.cw()-this.bw();this.dC=this.dw()*d/(q+this.dw());this.dC>d&&(this.dC=d);10>this.dC&&(this.dC=10);n=this.dC;this.UB=0===q?1:(d-n)/q;this.PB?(C=n,c=h):(C=h,c=n);this.WB||(m=!0,this.TB=H("div"),this.WB=J(this.TB),this.WB.css("position left top overflow outline border padding margin".split(" "),["relative",0,0,"hidden","none","none",0,0]).addClass("gc-scroll-container gc-scroll-corner-all ui-widget ui-corner-all"));this.XB||(this.XB=J.Nl("div","position display borderWidth padding margin boxSizing".split(" "),["absolute","inline-block","1px",0,0,"content-box"],"gc-scroll-arrow "+f,this.WB),this.YB=J.Nl("span",["display","border","padding","margin"],["block","none",0,0],E+" "+k,this.XB));this.ZB||(this.ZB=J.Nl("div","position display boxSizing border padding margin".split(" "),["absolute","inline-block","content-box","none",0,0],"gc-scrollbar-wrapper gc-scrollbar-wrapper",this.WB));this.$B||(this.$B=J.Nl("div",["position","borderWidth","padding","margin","boxSizing"],["absolute","1px",0,0,"content-box"],"gc-scroll-bar gc-no-user-select "+x,this.ZB),this._B=J.Nl("span",["display","border","padding","margin"],["block","none",0,0],p+" "+D,this.$B));this.aC||(this.aC=J.Nl("div","position display borderWidth padding margin boxSizing".split(" "),["absolute","inline-block","1px",0,0,"content-box"],"gc-scroll-arrow "+u,this.WB),this.bC=J.Nl("span",["display","border","padding","margin"],["block","none",0,0],M+" "+G,this.aC));this.WB.css(["width","height"],[z,l]);this.XB.css([y,"width","height"],[0,h-2,h-2]);this.YB.css(["width","height"],["100%","100%"]);this.ZB.css([y,"width","height"],[h,a,B]);this.$B.css([y,"width","height"],[this.SB,F(C-2),F(c-2)]);this._B.css(["width","height",g],[h-2,h-2,Math.floor((this.dC-h)/2)]);this.aC.css([t,"width","height"],[0,h-2,h-2]);this.bC.css(["width","height"],["100%","100%"]);m&&this.eC()},eC:function(){function d(d,q){d.bind("mousedown.gcScrollbar",function(d){l.fC(d,q)}).bind("mouseup.gcScrollbar",function(d){l.gC(d,q)}).bind("mouseover.gcScrollbar",function(d){l.hC(d,q)}).bind("mouseout.gcScrollbar",function(d){l.iC(d,q)})}var l=this;d(l.XB,!0);d(l.aC,!1);l.$B.bind("mousedown.gcScrollbar",function(d){l.jC(d)}).bind("mousemove.gcScrollbar",function(d){l.kC(d)}).bind("mouseup.gcScrollbar",function(d){l.lC(d)}).bind("mouseover.gcScrollbar",function(d){l.mC(d)}).bind("mouseout.gcScrollbar",function(d){l.nC(d)});l.ZB.bind("mousedown.gcScrollbar",function(d){var n,q;K&&K.mozilla&&(n=(new Date).valueOf(),q=l.oC,l.oC=n,q&&100>n-q)||l.pC(d)}).bind("mouseup.gcScrollbar",function(d){l.qC(d)});l.GB=function(d){l.sC(d)};l.WB.bind("mousewheel",l.GB);l.WB.bind("DOMMouseScroll",l.GB);q.ao(l,"initEvents",l.TB)},dispose:function(){var d=this.aC;d&&d.unbind(".gcScrollbar");(d=this.$B)&&d.unbind(".gcScrollbar");(d=this.XB)&&d.unbind(".gcScrollbar");(d=this.ZB)&&d.unbind(".gcScrollbar");this.WB&&(this.GB&&(this.WB.unbind("mousewheel",this.GB),this.WB.unbind("DOMMouseScroll",this.GB)),q.ao(this,"dispose",this.TB),this.WB.unbind(".gcScrollbar").remove())},tC:function(){var d=this;d.RB||(J(L).bind("mousemove.gcScrollbar",function(q){d.kC(q)}).bind("mouseup.gcScrollbar",function(q){d.lC(q)}),d.RB=!0)},uC:function(){this.RB&&(this.RB=!1,J(L).unbind("mousemove.gcScrollbar").unbind("mouseup.gcScrollbar"))},fC:function(q,l){var n,r=0,z=this,C=!0;z.KB=!0;null===z.LB&&(l?(z.XB.addClass("gc-scrollbar-stateActive ui-state-active"),r=0-z.qB(),z.vC=0):(z.aC.addClass("gc-scrollbar-stateActive ui-state-active"),r=z.qB(),z.vC=1),n=function(){z.scrollTo(z.SB+r*z.UB,!1);1===z.QB&&(z.LB=setTimeout(n,C?z.NB:z.OB));C=!1},n(),d(q))},gC:function(q,l){(l?this.XB:this.aC).removeClass("gc-scrollbar-stateActive ui-state-active");this.wC();d(q)},hC:function(q,l){(l?this.XB:this.aC).addClass("gc-scroll-arrow-hover ui-state-hover");d(q)},iC:function(q,l){(l?this.XB:this.aC).removeClass("gc-scroll-arrow-hover gc-scrollbar-stateActive ui-state-hover ui-state-active");this.wC();d(q)},jC:function(q){var l,n,w,z,C,c;0===q.button&&(this.JB=!0,this.xC={x:q.pageX,y:q.pageY},this.tC(),this.$B.addClass("gc-scrollbar-stateActive ui-state-active"),l=this.$B.offset(),n=this.$B.outerWidth(!0),w=this.$B.outerHeight(!0),z=this.ZB.offset(),C=this.ZB.outerWidth(!0),c=this.ZB.outerHeight(!0),this.yC={isBeyondEdge:!1,startEdgePosition:{x:z.left+q.pageX-l.left,y:z.top+q.pageY-l.top},endEdgePosition:{x:z.left+C-(n-q.pageX+l.left),y:z.top+c-(w-q.pageY+l.top)}});d(q)},kC:function(q){this.JB&&(this.zC={x:q.pageX,y:q.pageY},this.AC(),this.xC=this.zC,J(L.body).attr("unselectable","on").addClass("gc-no-user-select"));d(q)},lC:function(q){var l,n;this.JB=!1;this.vC=4;this.yC=null;this.WB.trigger("scroll.gcScrollbar",{newValue:this.Qb,oldValue:this.Qb,scrollOrientation:this.PB?0:1,scrollEventType:this.vC});l=(this.Qb-this.bw())*this.UB;n="left";this.PB||(n="top");this.SB=l;this.$B.css(n,l);this.uC();J(L.body).removeClass("gc-no-user-select");J(L.body).attr("unselectable")&&J(L.body).removeAttr("unselectable");this.$B.removeClass("gc-scrollbar-stateActive ui-state-active");this.vC=6;this.WB.trigger("scroll.gcScrollbar",{newValue:this.Qb,oldValue:this.Qb,scrollOrientation:this.PB?0:1,scrollEventType:this.vC});d(q)},mC:function(q){this.$B.addClass("gc-scrollbar-stateHover ui-state-hover");d(q)},nC:function(q){this.$B.removeClass("gc-scrollbar-stateHover ui-state-hover");d(q)},sC:function(q){var l;Q(q.wheelDelta)&&Q(q.detail)&&(q.wheelDelta=q.originalEvent.wheelDelta,q.detail=q.originalEvent.detail);l=(q.detail?q.detail:q.wheelDelta/-40)/3*this.qB()*this.UB;this.vC=0<=l?1:0;this.scrollTo(this.SB+l,!1);this.vC=6;this.WB.trigger("scroll.gcScrollbar",{newValue:this.Qb,oldValue:this.Qb,scrollOrientation:this.PB?0:1,scrollEventType:this.vC});d(q)},pC:function(q){var l,n=this,w=!0,z=q.pageX,C=q.pageY,c=0,m=n.ZB.offset(),h=n.rB();null===n.MB&&(c=n.PB?z-m.left-n.SB:C-m.top-n.SB,l=function(){var a=n.ZB.offset(),d=0,m=n.SB;if(d=n.PB?z-a.left-m:C-a.top-m,0>d*c||0<=d&&dc)n.vC=2,n.scrollTo(m-h*n.UB,!1);else{if(!(0m,n||l)return;Cm&&q(h.xC,m)}n=a+(z-C);n!==a&&(h.vC=5,h.scrollTo(n,!1))},scrollTo:function(d,q){var n,l,r,C,c="top";l=this.VB-this.dC;this.PB&&(c="left");n=!1;d>l&&(d=l,n=!0);0>d&&(d=0,n=!0);this.yC&&(this.yC.isBeyondEdge=n);n=F(d/this.UB)+this.bw();l=this.Qb;r=!1;q||(C={newValue:n,oldValue:l,scrollOrientation:this.PB?0:1,scrollEventType:this.vC},this.WB.trigger("scroll.gcScrollbar",C),r=C.ignoreUpdatePosition,C.newValue>this.cw()&&(C.newValue=this.cw()),n=C.newValue);this.Qb=n;5!==this.vC&&(d=(n-this.bw())*this.UB);this.SB=d;r||this.$B.css(c,d)}},q}();u.hv=q;U.exports=u},function(U,u,l){function d(d){O.call(this,d);this.EC=13;this.GC=12;this.HC=0;this.kw=30;this.KC=this.JC=this.IC=28;this.LC=0;this.MC="10pt Segoe UI"}var J,R,Q,K,O,H,I,L;u=l(42);J=l(26).pc;R=l(44).GC$;Q=l(43);K=l(50).To;O=l(67).DC;H=J.ic;I=J.ec;L=Q.Im;R.inherit(d,O);R.extend(d.prototype,{NC:function(){var d=this.OC;return d&&d.options.tabNavigationVisible?this.IC:0},PC:function(){var d=this.OC;return d&&d.options.tabNavigationVisible?d.Jv():0},QC:function(){return this.JC},RC:function(){return this.SC?0:this.JC},TC:function(){return this.SC?0:this.KC},UC:function(){var d,l,q=this.OC.sheets,D=this.VC(),A=this.WC;d=this.Dr();var r=d.x+d.width-this.kw-this.TC()-this.RC();d=this.gq;for(l=q.length;dr){D=r;break}return D},VC:function(){return 2*this.NC()+this.QC()+this.XC()},XC:function(){var d=this.OC;return d&&d.options.tabNavigationVisible?this.kw/2:0},hitTest:function(d,l){var q,D,A,r,n,w;w=this.QC();var z=this.RC();n=this.Dr();if(n.x+n.width-this.kwA;A++){if(Dn&&(D=n),Dthis._C()},_C:function(){return this.Dr().width-this.kw-this.TC()-this.RC()},aD:function(){return 6},bD:function(){return"navButton"},cD:function(){return this.VC()},dD:function(d,l){d.save();d.beginPath();var q=L.Km(0,"gc-tabStripBackground");this.eD=I(q.backgroundColor);d.fillStyle=q.backgroundColor;d.fillRect(l.x,l.y,l.width,l.height);d.beginPath();d.strokeStyle=q.borderTopColor;d.moveTo(l.x,l.y+.5);d.lineTo(l.x+l.width,l.y+.5);d.stroke();d.restore()},fD:function(d,l,q,D){var A,r,n=this.OC.options.newTabVisible,w=this.IC,z=this.RC();q+=z;n?this.KC=w:this.KC=0;A=l.x+l.width-this.kw-this.TC();q>A&&(q=A,r=A-z,rD&&(w=-1);d.moveTo(l-.5,q);d.lineTo(l-.5,q+1);d.moveTo(l+w-.5,q-1);d.lineTo(l+w-.5,q+2);d.moveTo(l+2*w-.5,q-2);d.lineTo(l+2*w-.5,q+3);d.moveTo(l+3*w-.5,q-3);d.lineTo(l+3*w-.5,q+4);d.stroke();d.restore()},hD:function(d,l,q,D,A,r){var n,w;d.save();d.beginPath();n=(A-14)/2;w=1;r&&(w=4);r=L.Km(w,"gc-tabStripNewTab-"+L.Jm(w));d.lineWidth=1.5;d.strokeStyle=this.tD(r.borderTopColor);d.arc(l+D/2,q+A/2,n,0,2*Math.PI);d.stroke();d.beginPath();d.lineWidth=2;d.moveTo(l+D/2-4,q+A/2);d.lineTo(l+D/2+4,q+A/2);d.moveTo(l+D/2,q+A/2-4);d.lineTo(l+D/2,q+A/2+4);d.stroke();d.restore()},gD:function(d,l,q,D,A){var r,n;d.save();d.beginPath();r=1;n=this.lD;5!==n&&6!==n||(r=4);r=L.Km(r,"gc-navMoreButton-"+L.Jm(r));d.fillStyle=this.tD(r.borderTopColor);d.fillRect(l+D/2,q+A/2,2,2);d.fillRect(l+D/2-4,q+A/2,2,2);d.fillRect(l+D/2+4,q+A/2,2,2);d.restore()},tD:function(d){var l=I(d),q=this.eD;return.01>=l.a?H(q):J.hc(q,l)?H(l):d}});u.iv=d;U.exports=u},function(U,u,l){function d(c,a,d){c.Wq(F.SheetTabClick,{sheet:a,sheetName:a?a.Cj:z,sheetTabIndex:A(d)?-1:d})}function J(c){this.OC=z;this.gq=this.$C=0;this.ZC=70;this.iD=this.lD=-1;this.MC="";this.WC=[];this.vD=this.uD=-1;this.wD=z;this.xD=0;this.Us(new q(0,0,200,28));this.Cj=c}var R,Q,K,O,H,I,L,F,G,q,D,A,r,n,w,z,C,c,m;u=l(42);R=l(26);Q=l(44).GC$;K=l(43);O=l(50).To;H=R.pc;I=K.Ul.wl;L=K.En;F=K.Events;G=K.Vl;q=K.Rect;D=K.Im;A=R.j.Fa;r=K.Ul.Nl;n=u.Bn;w=document;z=null;C=Math.max;c=Math.min;m=Math.pow;K.Zn(J);J.prototype={ws:function(c){var a,d=this;d.Xs&&d.no(!0);a=r("canvas");L.Kn(a,d.OC);a.setAttribute("id",d.Cj);d.yD=d.zD();c.appendChild(d.yD[0]);c.appendChild(a);d.Xs=a;Q(a).bind("mousedown.gcTab",function(a){return d.AD(a)}).bind("mousemove.gcTab",function(a){return d.BD(a)}).bind("mouseup.gcTab",function(a){return d.CD(a)}).bind("mouseout.gcTab",function(a){return d.DD(a)}).bind("dblclick.gcTab",function(a){return d.ED(a)});d.fq();J.ao(d,"setHost")},Yv:function(c){var a=c.options.font;(this.OC=c)&&a&&0=d.length||(c%=4,0===c?h.YD(d):1===c?(a||(h.ZD=setTimeout(function(){h.JD(1)},200)),h.$D(d)):2===c?(a||(h.ZD=setTimeout(function(){h.JD(2)},200)),h._D(d)):3===c&&h.aE(d))},KD:function(c,a){var h,m,n,q=this.OC;this.$C=c;this.ZC=a;q.suspendPaint();h=q.getActiveSheet();(m=q.getSheet(c))&&m.isEditing()&&m!==h&&(n=h.Cw&&h.Cw.V4,!m.gv(void 0,void 0,n))||(d(q,m,c),this.iw(c),q.resumePaint(),this.repaint())},MD:function(c){var a,h,m=this.OC;a=m.getActiveSheet();if(!this.bE||this.bE(a)){d(m,z,z,-1);a=m.sheets.length;h=m.vv(m.wv(a));m.ow(a,1,h);this.$C=a;this.ZC=c;for(m.dq(a,1,!1,!0);this.$C>this.gq&&(this.YC()||this.gqthis.gq&&this.ZC+this.WC[this.$C]>this._C()&&-1!==n&&(this.gq=n));this.$C=h.length||0>c))return a=h[c].Cj,a||(a="sheet"),d=Q(r("span")).text(a).css({position:"absolute",cursor:"default","border-radius":"5px",opacity:".7"}),d.addClass("ui-widget-header gc-tab-tip-span btn-primary"),d},VD:function(){var c=this.ZD;c&&(clearTimeout(c),this.ZD=z)},QD:function(c,a){var d,h,m=this.TD;m&&0===Q(".gc-tab-tip-span").length&&(m.appendTo(w.body),m.hide());d=m.width();h=m.height();m.css({left:c-d/2,top:a-h/2});m.show()},RD:function(c){var a=this,d=Q(a.Ws()),h=d.position(),m=d.offset(),d=c.pageX-m.left;c=a.hitTest(d,c.pageY-m.top);var m=c.element,n=a.Dr(),q=a.VC(),p=a.OC.sheets.length,n=n.x+a._C(),g=a.yD;d>n?a.wD===z&&a.uDn){for(;a>n;a--)c[a]=c[a-1];c[n]=d;q=n}else if(ac[0]&&(a=this.rw(this.gq),-1!==a&&this.OC.startSheetIndex(a))},_D:function(c){var a;0=p;m--)if(n=c[m],g=h[n],d+=g,m!==c.length-1&&(d+=this.HC),f=q+d,0!==m&&(f+=this.LC),f>a)return k=m+1=this.xD&&(this.xD=0,this.repaint())},repaint:function(c){var a=this.Ws();a&&a.getContext&&this.jp(a.getContext("2d"),c)},jp:function(d,a){var h,m,l,w,A,p,g,f,k,x,D,u;if(!(0=h.x+h.width||a.y>=h.y+h.height||a.x+a.width>h.width&&(a.width=h.width-a.x,0>=a.width)||a.y+a.height>h.height&&(a.height=h.height-a.y,0>=a.height)||0>=a.width||0>=a.height)return;if(l=this.buffer,l&&(!l||l.width===m.width&&l.height===m.height)&&(l||l.width===h.width&&l.height===h.height)||(l&&L.Rn(this.OC,l),this.buffer=l=r("canvas"),L.Kn(l,this.OC),L.Pn(l,h.width,h.height)),!(0>=h.width||0>=h.height||a&&(0>=a.width||0>=a.height))){l=this.buffer.getContext("2d");l.clearRect(0,0,h.width,h.height);n.Dn(l,-h.x,-h.y);this.iE(l,a);n.Dn(l,h.x,h.y);w=0<=h.x?0:-h.x;A=0<=h.y?0:-h.y;p=w;g=A;a&&(p=h.x+a.x,g=h.y+a.y,h=new q(p,g,a.width,a.height));w=0<=h.x?h.x:0;A=0<=h.y?h.y:0;x=z;D=L.Ln(m);u=L.Mn(m);m&&1!==D&&(p*=D,g*=u,h.x*=D,h.y*=u,h.width*=D,h.height*=u);try{m?a?(f=C(h.width-p,0),k=C(h.height-g,0)):(f=c(h.width-p,C(m.width-h.x,3)),k=c(h.height-g,C(m.height-h.y,3))):(p=a.x,g=a.y,f=a.width,k=a.height),m?(n.Cn(d,1,1),d.drawImage(this.buffer,p,g,f,k,w,A,f,k),n.Cn(d,D,u)):(l=this.buffer.getContext("2d"),x=l.getImageData(p,g,f,k))}catch(V){return}!m&&x&&0d.x+d.width));q++)g.push({i:q,x:n,w:h,t:p[q].Cj,visible:k}),k&&(n+=h+this.HC);this.dD(c,d);this.fD(c,d,n,m);this.jE(c,d,g,f,m);this.OC&&this.OC.options.tabNavigationVisible&&this.kD(c,d,m);this.nD(c,d);c.beginPath();c.restore()}},dD:function(c,a){},fD:function(c,a,d,m){},jE:function(c,a,d,m,n){var h,q,p;h=this.OC;var g=h.sheets,f=this.iD;if(this.$C=h.getActiveSheetIndex(),h=this.$C,0=m&&hH.dc(a)&&(d="white"),d}};u.DC=J;U.exports=u},function(U,u,l){function d(d){K.call(this,d);this.EC=12;this.GC=8;this.HC=3;this.kw=12;this.KC=48;this.LC=5;this.MC="10pt Arial"}var J,R,Q,K,O,H,I;u=l(42);J=l(26);R=l(43);Q=l(44).GC$;K=l(67).DC;O=R.Im;H=R.Ul.wl;I=Math.min;Q.inherit(d,K);Q.extend(d.prototype,{NC:function(){var d=this.OC,l=d&&d.options;return l&&l.tabNavigationVisible?d.Wv()*(l.useTouchLayout?2:1):0},PC:function(){var d=this.OC;return d&&d.options.tabNavigationVisible?d.Wv():0},VC:function(){return 4*this.NC()+this.lE()},lE:function(){var d=this.OC;return d&&d.options.tabNavigationVisible?2:0},hitTest:function(d,l){var u,q,D,A,r,n;n=this.OC;var w=n.options;q=this.Dr();if(q.x+q.width-this.kwD;D++){if(qq&&dthis._C()},_C:function(){return this.Dr().width-this.kw},aD:function(){return 1},bD:function(){return"newTab"},cD:function(){var d=this.Dr().height,d=this.VC()+d;return this.OC.options.newTabVisible&&(d+=this.TC(),d+=this.HC),d},dD:function(d,l){var u,q,D,A,r;if(d.save(),d.beginPath(),u=d.createLinearGradient(l.x,l.y,l.width,l.height),q=O.Km(0,"gc-tabStripBackground"),D=q&&q.backgroundImage,A=q&&q.backgroundColor,D&&-1!==D.indexOf("linear-gradient"))for(q=H(D),D=0,A=q.length;Dd},d.NE=function(d,q,l,r,c,m){q={_orientation:m?1:0,pE:0,nE:0};l=this.KE(d,l);r=this.KE(d,r);0<=l&&0<=r?0===l&&0===r?-1!==c&&1===c&&(q.nE-=c):-1===c?q.pE-=c:1===c&&(q.nE-=2*c):0<=r?(q.CE=2,q.pE+=c):0<=l&&(q.CE=1,q.pE+=c);this.JE(d,q)},d.OE=function(n,q,l,r,c,m,h,a,B){var y,t,w,z,p,g={_orientation:a?1:0,CE:B?2:1,pE:0,nE:0};a={_orientation:a?1:0,CE:B?1:2,pE:0,nE:0};B=1===m?r:c;var f=1===h?l:q;this.LE(f)?(y=this.KE(n,B),0===y?(t=this.KE(n,f),0===t?1===h&&(a.nE-=h):0w?0<(w=d.KE(n,q))?(a=d.FE(y),3===a||2===a?d.JE(n,{_orientation:0,pE:-2}):1===a&&d.JE(n,{_orientation:0,pE:-1})):0!==w&&0w?0<(w=d.KE(n,c))?(a=d.FE(t),3===a&&d.JE(n,{_orientation:0,nE:1})):0!==w&&d.JE(n,{_orientation:0,nE:-1}):0===w&&(0<(w=d.KE(n,c))?(a=d.FE(t),3===a&&d.JE(n,{_orientation:0,nE:1})):0!==w&&d.JE(n,{_orientation:0,nE:-1})):d.JE(n,{_orientation:0,nE:-2}))},d.SE=function(n,q,l,r,c,m,h){var a,w,y,t;(q||l||r)&&(y=d.IE(l,r),d.ME(n,q,l,r)?0<(w=d.KE(y,n))?(a=d.FE(y),d.LE(n)&&(d.LE(l)||d.LE(r)||d.LE(q))||3===a&&d.JE(n,{_orientation:1,pE:1})):0>w?0<(w=d.KE(n,q))?(a=d.FE(y),3===a||2===a?d.JE(n,{_orientation:1,pE:-2}):1===a&&d.JE(n,{_orientation:1,pE:-1})):0!==w&&0(w=d.KE(n,t))?(a=d.FE(t),d.LE(n)&&(d.LE(m)||d.LE(h)||d.LE(c))||(3===a||2===a?d.JE(n,{_orientation:1,nE:-2}):1===a&&d.JE(n,{_orientation:1,nE:-1}))):t!==Q&&0l+1&&t.c>r+1);y++);q||this.oF(c,h,this.cF,!0);B||this.oF(m,a,this.dF,!1)}},tF:function(){var d,q,l,r,c,m,h,a,B,y,t,E,M,p,g,f,k,x,D=this.$E,u=this._E,F=D.length,G=u.length,e={},b={};for(d=0;dd||q===R||0>q)return Q;if(n=l?this.fF:this.eF,c=this.pF(d,q,n,!0),c)return c;if(n=l?this.dF:this.cF,l){if(0>--q)return Q}else if(0>--d)return Q;return c=this.pF(d,q,n,!0),c?c:Q},paint:function(d,q){this.UE&&(this.VE||(this.rF(),this.qF(),this.mE(),this.VE=!0),d.save(),d.beginPath(),this.jp(d,q),d.closePath(),d.stroke(),d.restore())},jp:function(d){this.xF(d);this.yF(d)},xF:function(d){this._d(d,this.cF);this._d(d,this.dF)},yF:function(d){this._d(d,this.eF);this._d(d,this.fF)},_d:function(d,q){var n,l,c,m;for(n in q)if(q[n])for(l in c=q[n],c)c[l]&&(m=c[l].line,m&&m.jp(d))}},q}();u.zF=d;u.AF=l;U.exports=u},function(U,u,l){var d,J,R,Q,K,O,H,I,L;u=l(42);d=l(56).Worksheet;J=l(44).GC$;R=l(43);l=l(26);Q=R.Ul;K=Q.Ml;O=Q.rl();H=R.Events;I=l.j.Fa;L=R.Vl;u.EditorStatus={ready:0,enter:1,edit:2};J.extend(d.prototype,{startEdit:function(d,l){this.EF(this.Ws(),this.Jl,this.Kl,null,null,d,l)},editorStatus:function(){return this.Px||0},isEditing:function(){var d=this.Px;return 1===d||2===d},endEdit:function(d){return this.gv(d)},gv:function(l,u,q){if(!this.isEditing())return!0;this.suspendPaint();try{var D;a:{var A,r,n,w,z,C,c,m,h,a,B,y,t,E=this.mm,M=this.BF,p=this.Cj,g=this.Jl,f=this.Kl,k=this.getCellType(g,f),x={sheet:this,row:g,col:f,sheetArea:3};if(k.isImeAware(x)||E.Qq(),M&&M.parentNode){if((r=k.getEditorValue(M,x),n={sheet:this,sheetName:p,row:g,col:f,editor:M,editingText:r,cancel:!1},this.Wq(H.EditEnd,n),n.cancel)||(this.Wq(H.EditEnding,n),n.cancel)){D=void 0;break a}if(w=this.parent,z=w&&w.CF,document.activeElement===(z&&z.qo)&&E.Qq(),0<=g&&0<=f&&(C=M.Ep,k.isEditingValueChanged(C,r,x)||1===u))if(l)k.setEditorValue(M,C,x),k.selectAll(M,x);else if(c=k.DF,I(c)&&(c=!0),m={cmd:"editCell",sheetName:p,row:g,col:f,newValue:r,autoFormat:c,editingFormatter:M.pia},1===u&&(m.ranges=[this.Ix()],m.endEditType=u),this.wu().execute(m),A=m.applyResult,2===A){D=(k.focus(M,x),!1);break a}if(this.$l=!0,k.deactivateEditor(M,x),k.isImeAware(x))K.msie&&9===parseFloat(K.version)?E.Qq():J(M.parentNode.parentNode).css({width:0,height:0,overflow:"hidden",border:"none"});else for(h=this.zo(),a=M;a;)a.parentNode===h?h.removeChild(a):a=a.parentNode}D=(this.Ll=!1,B={sheet:this,sheetName:p,row:g,col:f,editingText:r},y=J.extend({},B),this.Wq(H.EditEnded,B),this.Wq(H.FormulatextboxEditEnded,y),(!0===q||!y.ignore)&&(0!==this.Px&&(t=this.Px,this.Px=0,this.Cu(t,0)),d.ao(this,"endEdit"),this.BF=null,1!==A))}return D}finally{this.resumePaint()}},FF:function(d,l,q){var D,A,r,n,w,z,C,c,m=this.hitTest(l,q);m&&(D=m.row,A=m.col,0<=D&&0<=A&&0<=m.rowViewportIndex&&0<=m.colViewportIndex&&!m.resizeInfo&&!m.dragInfo&&D===this.Jl&&A===this.Kl&&(r=this.isEditing(),this.EF(d,D,A),!r&&this.isEditing()&&(n=m.hitTestType,w=this.getCellType(D,A),w.tw&&(z=this.getCellRect(D,A,1===n?-1:void 0,2===n?-1:void 0),C=this.getActualStyle(D,A,n),c=w.h5(l,q,C,z,{sheet:this,row:D,col:A,sheetArea:n}),c&&c.isReservedLocation&&w.tw(this,D,A,3)))))},EF:function(l,G,q,D,A,r,n){var w,z,C,c,m,h,a,B,y,t,E,M;if(!(0>G||0>q||(w=this,z=w.Cj,C=w.options,w.isEditing()||(c=w.mm,c.zt(),m=w.getCellRect(G,q),!m||0>=m.width||0>=m.height||(w.showCell(w.Jl,w.Kl,3,3),h=w.getActualStyle(G,q),C.isProtected&&!1!==h.locked||(a=w.getCellType(G,q),!a||(B={sheet:w,row:G,col:q,sheetArea:3},y=a.isImeAware(B)?c.GF:a.a5(B),y&&y.firstChild&&(t=y.firstChild.firstChild),!t))))))){if(w.BF=t,E={sheet:w,sheetName:z,row:G,col:q,cancel:!1},w.Wq(H.EditStarting,E),E.cancel)return void(O.ipad&&c.Qq());m=w.getValue(G,q);l=u.X3&&w.getFormula(G,q);E=w.Px;w.HF?w.Px=1:I(m)&&I(l)?w.Px=1:w.Px=2;w.Cu(E,w.Px);l=w.am();m=w.getCellRect(G,q,D,A);a.isImeAware(B)&&c.JF();a.d5(y,h,m,B);w.KF(a,t,G,q,h,n);D=w.zo();a.isImeAware(B)||D.insertBefore(y,null);a.g5(y,h,m,B);a.isImeAware(B)&&r||a.focus(t,B);r&&a.selectAll(t,B);C.allowCellOverflow&&(M=m.clone(),M.y-=2,M.height+=4,M.x=l.kt,M.width=l.er,w.repaint(M));d.ao(w,"startEdit",{element:a.getEditingElement()});L.Zl(w);G={sheet:w,sheetName:z,row:G,col:q};w.Wq(H.EditStarted,G);w.Wq(H.FormulatextboxEditStarted,G)}},KF:function(d,l,q,D,A,r){var n,w,z,C,c=u.X3&&this.getFormula(q,D,!0);c&&(c="\x3d"+c);n=c;w={sheet:this,row:q,col:D,sheetArea:3};c&&0!==c.length||(c=this.getValue(q,D),z=this.parent,C=u.X3&&z&&z.options.allowUserEditFormula,c&&0f||0>c)&&(g=a.getCellRect(e.row,e.col,f,c))&&0=m.height-m.Bt))&&(h=new q.Rect(g.x-2,g.y-2,g.width+4,g.height+4),f=0>f&&0>c?m.em():0>f?m.gm(c):m.fm(f),h=h.getIntersectRect(f),b.VF(h.x,h.y,h.width,h.height),b=3,h=(0>e.rowViewportIndex&&(b=1),0>e.colViewportIndex&&(b=2),!(3===b||!a.vp(e.row,e.col,b,!0))));return h}function J(a,e,b){return{action:a,index:e,sheetArea:b}}function R(a,e,b,f,c,g){a={sheet:a,sheetName:e,sheetArea:c,row:b,col:f};return g&&(a.cancel=!1),a}function Q(a,e,b,f,c,g){var d=a.kj,k=R(d,d.Cj,d.Jl,d.Kl,M,!0);return d.Wq(y.LeaveCell,k),!(!k||!0!==k.cancel)||(d.Kr(e,b,f,c,g),d.Wq(y.EnterCell,R(d,d.Cj,e,b)),d.Wq(y.FormulatextboxEnterCell,R(d,d.Cj,e,b)),void(a.cs&&a.cs(e,b)))}function K(a,e,b,f,c,g,d){var k,h=a.kj;e=e.call(h,g.sheetArea);return(d&&!h.getRowVisible(g.index)||!d&&!h.getColumnVisible(g.index))&&(g.index=b.call(a,g.index,g.sheetArea)),k=f.call(e,g.index),k||(k=f.call(e,c)),k}function O(a,e,b,f){var c=f?"movingY":"movingX",g=f?"startY":"startX";a[c]=e;a[c]e&&(a[c]=e)}function H(a){this.qo=a;this.Fi=this.lI=this.kI=this.jI=E;this.nI=this.mI=!1}var I,L,F,G,q,D,A,r,n,w,z,C,c,m,h,a,B,y,t,E,M,p,g,f,k,x,W,P,V;u=l(42);I=l(56).Worksheet;L=l(26);F=l(55).yp;G=l(44).GC$;q=l(43);D=q.Range;A=window;r=document;n=G.each;w=q.Ul;z=w.Ml;C=w.rl();c=w.nl;m=w.Nl;h=L.u.Kb;a=q.kf;B=L.j.Fa;y=q.Events;t=q.Vl;E=null;M=void 0;p=isNaN;g=parseInt;f=Math.max;k=Math.min;x=Math.abs;W=Math.ceil;P=C.iphone||C.ipad||C.android;V=function(){return L.C(u.SR)()};I.$n("eventHandler",{dispose:function(a){var e;G(this.Ws()).unbind("mousedown.handler").unbind("mouseup.handler").unbind("mousemove.handler").unbind("mousewheel.handler").unbind("DOMMouseScroll.handler").unbind("mouseout.handler").unbind("dblclick.handler");(e=this.mm)&&(e.no(),e.MF());(e=this.BF)&&G(e).remove();(e=this.NF)&&e.close();!1!==a&&(this.OF=E,this.PF=E,this.QF=E,this.RF=E,this.SF=E,this.TF=E,this.mm=E)},setHost:function(a){if(a){var e=this,b=e.mm;e.OF=function(a){var f={e:a,r:E};if(I.ao(e,"preProcessMouseDown",f),!f.r)return b.AD(a)};e.PF=function(a){var f={e:a,r:E};I.ao(e,"preProcessMouseMove",f);f.r||b.RB||b.BD(a)};e.QF=function(a){var f={e:a,r:E};if(I.ao(e,"preProcessMouseUp",f),!f.r&&!e.XD)return b.RB?void 0:b.CD(a)};e.RF=function(a){var b,f,c,d,k,h,m,p,n;if(a=a||A.event,b={e:a,r:E},I.ao(e,"preProcessMouseWheel",b),!b.r)return f=a.detail?a.detail:a.wheelDelta/-40,c=0,(!w.sl()||(d=(new Date).valueOf(),k=a.wheelDeltaY,h=a.wheelDeltaX,x(k)>=x(h)?h=0:k=0,m=!e.zia||200=v.x&&f>=v.y)if(m.yt=h,this.eG=!0,h.resizeInfo)m.endEdit()&&this.fG(h);else if(q&&q.side&&"corner"!==q.side)m.endEdit()&&this.gG&&this.gG(h);else if(q&&"corner"===q.side)m.endEdit()&&this.hG&&this.hG(h);else if(h.filterButtonHitInfo)m.endEdit();else if(l)l.inBorder?this.iG(h):(l.inTopLeft||l.inTopRight||l.inBottomLeft||l.inBottomRight)&&this.jG(h);else if(m.Qs(0>h.rowViewportIndex?-1:p,0>h.colViewportIndex?-1:n)&&(!this.kG||!this.kG(m,h))){if(b=m.getActiveRowIndex(),f=m.getActiveColumnIndex(),t){if(e=t.sheetArea,(B(e)||3===e)&&(p!==b||n!==f)){m.suspendPaint();try{if(!m.endEdit()||(c=R(m,m.Cj,b,f,M,!0),m.Wq(y.LeaveCell,c),c&&!0===c.cancel))return;g=m.Uq.toArray();d=m.zl().get(p,n);k=[new D(d.row,d.col,d.rowCount,d.colCount)];m.yu(g,k);m.Sr(p,n,M,M,1);m.Wq(y.EnterCell,R(m,m.Cj,p,n));m.Wq(y.FormulatextboxEnterCell,R(m,m.Cj,p,n));m.Au(g);m.Iia=!0;this.cs&&this.cs(p,n)}finally{m.resumePaint()}}e=m.getCellType(t.row,t.col,h.hitTestType);t.sheet||(t.sheet=m);e.processMouseDown(t)}if(t&&t.isReservedLocation)return!0;this.lG(a);try{if(this.mG=h,m.isEditing()&&b===m.getActiveRowIndex()&&f===m.getActiveColumnIndex()&&!m.endEdit())return}finally{this.mG=E}B(p)||B(n)||(3===h.hitTestType&&this.cs&&this.cs(p,n),a=m.Uq.toArray(),this.nG(h),h=m.Uq.toArray(),m.yu(a,h))}},oG:function(a){var b,e=this.kj;return!e||(b=e.am(),B(a.x)||B(a.y)||B(a.width)||B(a.height)||a.x+a.width>b.pt+b.er+b.js||a.y+a.height>b.qt+b.jr+b.gs)},pG:function(a,b,f,c){var e,g,d,k,h,m,p,n=this.kj;g=0;d=a.options;for(k=d.length;g=k.qt+k.jr&&e.mq(e._q(c)))):c>e.frozenRowCount()&&e.mq(e.gr(c)));this.wG()},vG:function(a){var b,e,f,c,g,d,k,h;this.LG()||(b=this.kj,e=this.rG,f=e.MG,c=b.getViewportLeftColumn(f),g=b.getViewportRightColumn(f),a?g=k.pt+k.er&&b.rq(b.Zq(c)))):c>b.frozenColumnCount()&&b.rq(b.br(c)));this.wG()},JG:function(){var a,b,f,c,g=this.kj;c=g.am();var d=g.frozenRowCount();f=g.frozenTrailingRowCount();var h=this.$F,m=this.rG,p=m.KG;if(0===p){if(h.y>c.qt)return g.mq(g._t()),m.KG=1,!0}else if(1===p){if(a=g.Gr(1),a&&0c.ot&&b.row>=g.ir()&&b.y+b.height<=c.ot)return m.KG=2,!0}}else if(2===p&&(a=g.Gr(1),a&&0c.ot){a=c.jr;f=g.getRowCount(void 0)-f-1;b=0;for(c=f;c>=d;c--)if(b+=g.Sl(c),b>a){f=k(c+1,f);break}g.mq(g._q(f-1))}return m.KG=1,!0}return!1},LG:function(){var a,b,f,c,g=this.kj;f=g.frozenTrailingColumnCount();var d=g.frozenColumnCount();c=g.am();var h=this.$F,m=this.rG,p=m.MG;if(0===p){if(h.x>c.pt)return g.rq(g.$t()),m.MG=1,!0}else if(1===p){if(a=g.Hr(1),a&&0c.lt&&b.col>=g.dr()&&b.x+b.width<=c.lt)return m.MG=2,!0}}else if(2===p&&(a=g.Hr(1),a&&0c.lt){a=c.er;f=g.getColumnCount(void 0)-f-1;b=0;for(c=f;c>=d;c--)if(b+=g.Tl(c),b>a){f=k(c+1,f);break}g.rq(g.Zq(f-1))}return m.MG=1,!0}return!1},NG:function(){var a,b,f,c,g,d,k,h,m;(this.OG||this.O3||this.lV)&&(a=this.kj,b=a.am(),f=this.rG,c=f.KG,g=f.MG,d=this.$F,k=E,0<=c&&0<=g?k=b.Ft(c,g):0<=c?k=b.fm(c):0<=g&&(k=b.gm(g)),k&&(h=0,m=0,d.x<=k.x?h=d.x-k.x:d.x>=k.x+k.width&&(h=d.x-(k.x+k.width)),d.y<=k.y?m=d.y-k.y:d.y>=k.y+k.height&&(m=d.y-(k.y+k.height)),this._F().PG(this.QG(h)),this.aG().PG(this.QG(m))))},RG:function(){this._F().SG();this.aG().SG()},fG:function(a){var b,e,f,c=F.prototype,g=this.kj,d=a.resizeInfo;"sizeRow"===d.action||"sizeHiddenRow"===d.action?(b=K(this,g.Jt,this.TG,c.findRow,a.row,d,!0),d.startY=b.y):(e=K(this,g.Kt,this.UG,c.findCol,a.col,d,!1),d.startX=e.x);b=g.parent;e=a.x;a=a.y;b&&(f=b.options.showResizeTip,(1!==f||"sizeCol"!==d.action&&"sizeHiddenCol"!==d.action)&&(2!==f||"sizeRow"!==d.action&&"sizeHiddenRow"!==d.action)&&3!==f||(0>a-30?a+=15:a-=30,b.uw(this.VG(),e,a)));this.OG=this.isResizing=!0},WG:function(){var a,b,f,c,g=this.kj,d=g.yt,k=d.resizeInfo,h=this.$F,m=h.x,h=h.y,p=g.am();k&&this.OG&&this.isResizing&&(d.x===m&&d.y===h||("sizeRow"===k.action||"sizeHiddenRow"===k.action?O(k,h,p,!0):O(k,m,p,!1),a=g.yl,b=a.bm(),a.Mx(p.x,p.y,p.width,p.height),a.Pw(b),f=g.parent,f&&(c=f.options.showResizeTip,(1!==c||"sizeCol"!==k.action&&"sizeHiddenCol"!==k.action)&&(2!==c||"sizeRow"!==k.action&&"sizeHiddenRow"!==k.action)&&3!==c||f.ww(this.XG(k)))))},YG:function(){var a,b,c,g,d,k,h,m,p;this.OG=this.isResizing=!1;a=!0;b=this.kj;(c=b.yt.resizeInfo)&&(this.xw(),"sizeRow"===c.action||"sizeHiddenRow"===c.action?B(c.movingY)?a=!1:(g=f(0,(c.movingY-c.startY)/b._zoomFactor),d=[],b.tp(c.index)?G.each(b.Uq,function(a,e){if(-1===e.col){var f=b.Tq(e);d.push({firstRow:f.row,lastRow:f.row+f.rowCount-1})}}):d.push({firstRow:c.index,lastRow:c.index}),k=1===c.sheetArea,b.wu().execute({cmd:"resizeRow",sheetName:b.name(),rows:d,size:g,columnHeader:k})):B(c.movingX)?a=!1:(g=f(0,(c.movingX-c.startX)/b._zoomFactor),h=[],b.sp(c.index)?G.each(b.Uq,function(a,e){if(-1===e.row){var f=b.Tq(e);h.push({firstCol:f.col,lastCol:f.col+f.colCount-1})}}):h.push({firstCol:c.index,lastCol:c.index}),m=2===c.sheetArea,b.wu().execute({cmd:"resizeColumn",sheetName:b.name(),columns:h,size:g,rowHeader:m})),p=b.hitTest(this.$F.x,this.$F.y),p&&this.Tw(p),a||b.repaint())},ZG:function(a,b){var e,f,c,g,d,h,m=0,n=0,q=0,l=0,t=this.kj,y=t.wq,r=t.frozenRowCount(),w=t.frozenColumnCount();if(this.o4=this.$G=t.Uq.toArray(),this.ctrl||this.shift||t.Tr(),0===a.hitTestType){if(this.shift||(e=r?t.ar():t.lq,c=w?t.$q():t.qq,!Q(this,e,c,1,1,b)))this.ctrl||t.Tr(),t.Ur(-1,-1,t.getRowCount(void 0),t.getColumnCount(void 0),!0)}else if(1===a.hitTestType){if(this.shift||(e=r?t.ar():t.lq,f=this._G(e,a.col,!1),!Q(this,f.row,f.col,1,a.colViewportIndex,b)))this.shift?(m=k(t.Kl,a.col),l=x(t.Kl-a.col)+1,t.Kx(-1,m,t.getRowCount(void 0),l,!0)):t.Ur(-1,t.Kl,t.getRowCount(void 0),1,!0)}else if(2===a.hitTestType){if(!this.shift){if(g=w?t.$q():t.qq,f=this._G(a.row,g,!0),e=t.Jl!==f.row,Q(this,f.row,f.col,a.rowViewportIndex,1,b))return;e&&y&&y.Lx()}this.shift?(n=k(t.Jl,a.row),q=x(t.Jl-a.row)+1,t.Kx(n,-1,q,t.getColumnCount(void 0),!0)):t.Ur(t.Jl,-1,1,t.getColumnCount(void 0),!0)}else if(3===a.hitTestType)if(p(a.row)||p(a.col))t.isEditing()&&(h=t.getCellRect(t.Jl,t.Kl,t.Nr,t.Pr),t.yl.VF(h.x,h.y,h.width,h.height));else{if(!this.shift&&(t.Jl!==a.row||t.Kl!==a.col)){if(e=t.Jl!==a.row,Q(this,a.row,a.col,a.rowViewportIndex,a.colViewportIndex,b))return;e&&y&&y.Lx()}this.shift?t.aH(a.row,a.col,!0):(d=t.zl().get(a.row,a.col),t.Ur(d.row,d.col,d.rowCount,d.colCount,!0))}},bH:function(a){!a||3===a.hitTestType&&(p(a.row)||p(a.col))||(this.xG=this.OG=!0,this.rG={KG:a.rowViewportIndex,MG:a.colViewportIndex,sG:a.hitTestType},this.qG())},nG:function(a){this.ZG(a);this.bH(a)},yG:function(){var a;this.rG&&this.OG&&!0!==this.DA&&(a=this.rG.sG,3===a?this.cH():2===a?this.dH():1===a&&this.eH())},cH:function(){var a,b,f=this.kj,c=this.fH(),g=this.gH();0<=c&&0<=g&&f.Qs(c,g)&&(a=f.Uq.toArray(),f.aH(c,g,!0),b=f.Uq.toArray(),f.yu(a,b),this.NG())},dH:function(){var a,b,c,g,d=this.kj;b=this.fH();if(0<=b&&d.Qs(b,-1)){if(a=k(d.Jl,b),b=f(d.Jl,b)-a+1,c=d.getColumnCount(void 0),g=d.selectionPolicy(),0===g)return;g=d.selectionUnit();2===g&&(a=-1,b=-1);g=d.Uq.toArray();d.Kx(a,-1,b,c,!0);a=d.Uq.toArray();d.yu(g,a)}this.NG()},eH:function(){var a,b,c,g,d=this.kj;b=this.gH();if(0<=b&&d.Qs(-1,b)){if(a=k(d.Kl,b),b=f(d.Kl,b)-a+1,c=d.getRowCount(void 0),g=d.selectionPolicy(),0===g)return;g=d.selectionUnit();1===g&&(a=-1,b=-1);g=d.Uq.toArray();d.Kx(-1,a,c,b,!0);a=d.Uq.toArray();d.yu(g,a)}this.NG()},hH:function(){var a,b,f;this.rG=E;this.RG();this.DA=E;this.xG=this.OG=!1;a=this.kj;a.Uq&&(a.Iia?delete a.Iia:(b=!this.$G,b||(f=a.Uq.toArray(),b=this.zu(this.$G,f)),b&&a.Au(this.o4)),this.$G=a.Uq.toArray())},iH:function(){var a,b,f,c;a=this.kj;var g=this.$F.y,d=a.am();return b=0d.ot?2:1,f=this.rG.KG,c=a.Gr(1),0===b&&0a._t()?b=1:2===b&&2>f&&0d.lt?2:1,f=this.rG.MG,c=a.Hr(1),0===b&&0a.$t()?b=1:2===b&&2>f&&0a._t()?a._q(g-1)||g:1===f&&b>c.ot&&g>a.hr()?a.gr(g)||g:g):-1},gH:function(){var a,b,f,c,g;a=this.kj;b=this.$F.x;f=this.jH();var d;return(d=(d=a.Hr(f))?d.findNearX(b):E)?(c=a.am(),g=d.col,1===f&&ba.$t()?a.Zq(g-1)||g:1===f&&b>c.lt&&g>a.cr()?a.br(g)||g:g):-1},QG:function(a){var b,e=0;return p(a)||0===a||(b=0>a,e=W(500/x(a)),e=f(20,10*e),200b&&(a--,!e.getRowVisible(a,f)););return a},lH:function(a,b,f){for(var e=this.kj;a>b&&(a--,!e.getColumnVisible(a,f)););return a},mH:function(a,b,c,g,d){var e,k,h,m,n,q,l,t,v;return e=E,!a.options.isProtected||a.options.protectionOptions.allowResizeRows?(k=a.Gr(b.rowViewportIndex,g),!k||p(b.row)||p(b.col)||(a.getRowVisible(b.row,g)||(b.row=this.TG(b.row,g)),h=k.findRow(b.row),h&&(h.y+h.height-c<=d&&d<=h.y+h.height+c?(e=J("sizeRow",b.row,g),m=k[k.length-1].row,0<=m&&(n=a.ir(g),e.index===n&&e.index!==m&&h.y+h.height-c/2<=d&&(e=J(this.nH(a,m,g),m,g)))):h.y-c<=d&&d<=h.y+c&&0a.rowViewportIndex&&0<=a.colViewportIndex&&q?(l=this.oH(m,a,c,1,b),l||(l=this.mH(m,a,c,1,f))):0<=a.rowViewportIndex&&0>a.colViewportIndex&&n?(l=this.mH(m,a,c,2,f),l||(l=this.oH(m,a,c,2,b))):0>a.rowViewportIndex&&0>a.colViewportIndex?m.ir(2)===E&&x(f-d.Cr)<=c?(k=m.Gr(1),k&&0this.GH&&this.GH++,void c(a);this.FH=!0;this.GH=1;this.HH(a,!0)}},VG:function(){var a,b,f,c,g=this.kj,d=g.yt,k=d.resizeInfo;return"sizeRow"===k.action||"sizeHiddenRow"===k.action?(a=g.Jt(k.sheetArea),g.getRowVisible(k.index)||(k.index=this.TG(k.index,k.sheetArea)),b=a.findRow(k.index),b||(b=a.findRow(d.row)),h(V().Tip_Height,[b.height.toFixed(0)])):(f=g.Kt(k.sheetArea),g.getColumnVisible(k.index)||(k.index=this.UG(k.index,k.sheetArea)),c=f.findCol(k.index),c||(c=f.findCol(d.col)),h(V().Tip_Width,[c.width.toFixed(0)]))},XG:function(a){return"sizeRow"===a.action||"sizeHiddenRow"===a.action?h(V().Tip_Height,[(a.movingY-a.startY).toFixed(0)]):h(V().Tip_Width,[(a.movingX-a.startX).toFixed(0)])},HH:function(a,b){var e=this;e.FH&&(b||e.EH(a),e.FH&&(e.WF=setTimeout(function(){e.HH(a)},500/e.GH)))},IH:function(a){var b,e,f=this.kj,c=f.Ws();if(c){f.HF=!0;try{b=f.isEditing(),f.EF&&f.EF(c,f.Jl,f.Kl,E,E,!0),!b&&f.isEditing()&&(e=f.getCellType(f.Jl,f.Kl),!e.tw||32!==a.keyCode||a.ctrlKey||a.shiftKey||a.altKey||e.tw(f,f.Jl,f.Kl,3),e.JH&&e.JH(a))}finally{f.HF=!1}}},EH:function(a){var b,e,f,g,d,k,h,m,p,n=this.kj;if(this.lG(a),n.isEditing()||27!==a.keyCode||a.altKey||a.ctrlKey||a.shiftKey||!n.KH||(G(n.KH).remove(),n.KH=E),n.isEditing()||34!==a.keyCode&&33!==a.keyCode&&35!==a.keyCode&&36!==a.keyCode&&38!==a.keyCode&&40!==a.keyCode||c(a),n.isEditing()||37!==a.keyCode&&39!==a.keyCode||c(a),b=n.wu(),e=b.getShortcutKey(a.keyCode,a.ctrlKey,a.shiftKey,a.altKey,a.metaKey),f=b.getCommands(e))for(b=0;b=a.keyCode||48<=a.keyCode&&57>=a.keyCode||96<=a.keyCode&&105>=a.keyCode||186<=a.keyCode&&192>=a.keyCode||220<=a.keyCode&&222>=a.keyCode||219===a.keyCode||106<=a.keyCode&&111>=a.keyCode||32===a.keyCode||61===a.keyCode||173===a.keyCode||229===a.keyCode||0===a.keyCode||8===a.keyCode)},lG:function(a){var b,e,f,c,g=this.kj,d=w.sl()?a.metaKey:a.ctrlKey;this.ctrl=d&&!a.shiftKey;this.shift=a.shiftKey&&!d;g.Hx=!1;9===a.keyCode&&(1=k.kt&&m.y>=k.nt&&m.x+m.width<=k.lt+k.js&&m.y+m.height<=k.ot+k.gs?(n={sheet:b,row:c,col:g,sheetArea:3,canvasOffset:f},d.g5(p,h,m,n,!0)):G(p).css({top:-1E4,left:-1E4})),q=b.Cw,q&&q.SH())},TH:function(a,b){var e,f;if(!a)return E;for(e=a.firstChild;e;){if(e.id===b||e.name===b)return e;if(f=this.TH(e,b))return f;e=e.nextSibling}return E},zu:function(a,b){var e,f,c,g=!0;if(a.length===b.length)for(e=0;eg)&&(e=c);(p(f)||fk)&&(f=d);G(b).css("top",e).css("left",f)},cI:function(a){var b,e,f,c;this.aI();this.kj.isEditing()||this.XF&&r.activeElement===this.ZH||(b=this.kj,a?(e=a.row,f=a.col):(e=b.Jl,f=b.Kl),c=b.getCellType(e,f),this.UH(c,e,f,!1),this.ZH.focus(),this.XF=!0)},dI:function(a){0===arguments.length&&(a=!0);this.XF&&(this.XF=!1,this._H(a))},gx:function(a){var b=this.kj.tu();b&&(b.Eia(a),b.M4(),this.nja=!0,a&&b.N4())},hx:function(){var a=this.kj.tu();a&&a.Eia("");this.nja=!1;this._H(!0,!1)},MF:function(){var a;this.aI();(a=this.GF)&&(G(a).remove(),this.GF=M);(a=this.XH)&&(G(a).remove(),this.YH=M,this.XH=E,this.ZH=E)},uw:function(a,b,f,c){var e=this.kj.parent;e&&e.uw(a,b,f,c)},ww:function(a,b,f,c){var e=this.kj.parent;e&&e.ww(a,b,f,c)},xw:function(){var a=this.kj.parent;a&&a.xw()},Uw:function(a){var b,e,f,c=this.kj,g=!1,k=c.yt;k||(g=!0);g||a||(g=!0);if(!g){var h;if(!(h=a.col!==k.col||a.row!==k.row||a.colViewportIndex!==k.colViewportIndex||a.rowViewportIndex!==k.rowViewportIndex||a.hitTestType!==k.hitTestType)){h=a.resizeInfo;var m=k.resizeInfo,g=!1;h=!(h||m?h&&m&&(g=h.action===m.action&&h.index===m.index&&h.sheetArea===m.sheetArea):g=!0,g)}g=h}c.yt=a;g&&(c.fI=!0,b=c.yl,e=d(c,k,b),f=d(c,a,b),e=e||f,c.fI=!1,e&&b.im())},_G:function(a,b,f){a=this.gI(a,b,f);return this.hI(a)},gI:function(a,b,f){var e=this.kj.zl().get(a,b),c=e.rowCount,g=e.colCount;return 1===c&&1===g?e:f&&1===c||!f&&1===g?e:(f?b++:a++,this.gI(a,b,f))},hI:function(e){var b,f,c,g=this.kj,d=e.row;f=g.getRowCount(void 0);for(b=d;b=k)&&!b.findCell(g,a)&&(x=l.ge(g,a),m(x))&&(n=l.Ym(g,a),!n.watermark)&&(h?f=a:e=a,v+=l._m(a),!(p<=v));a+=h?1:-1);return h&&f===d||!h&&e===d?M:new y(d,e,f,p,t,v,h?-1:v,h?v:-1)}function O(a,b,e){this.kj=a;this.pJ=a.Hr(e);this.qJ=a.Ir(b,e);this.yI=B(a.yl.Bl(),a._zoomFactor).font;this.Rq=a.Al();this.rJ={}}function H(a){this.zJ=this.yJ=!1;this.kj=a;this.AJ()}var I,L,F,G,q,D,A,r,n,w,z,C,c,m,h,a,B,y,t,E,M,p,g,f,k,x,W,P,V,Z,e,b,v,N,S,X,Y=l(26).k,ka=l(56).Worksheet,ja=l(43),oa=l(50),ma=l(55),ea=l(70);u=l(42);I=l(26);L=u.Bn;F=ja.Ul;G=F.Ml;q=F.ol;D=ja.En;A=ja.mn;r=ja.Vn;n=ja.Vl;w=ja.Rect;z=ja.Events;C=ja.Rm;c=ja.kf;m=I.j.Fa;h=ja.Im;a=oa.Ho;B=oa.To.No;y=ma.op;t=ma.np;E=ea.AF;M=null;p=Math.min;g=Math.max;f=Math.abs;k=Math.floor;x=Math.ceil;ka.$n("render",{init:function(){this.yl=new R(this);this.at=new H(this)},dispose:function(a){var b;!1!==a&&(this.yl=M,b=this.at,b&&(b.no(),this.at=M))},onLayoutChanged:function(a){a=a.changeType;var b=this.at;"addRows"===a?b&&b.rI():"deleteRows"===a?b&&b.sI():"addColumns"===a?b&&b.tI():"deleteColumns"===a&&b&&b.uI()}});W="white";R.prototype={constructor:R,ad:function(a){this.kj=a},bm:function(){var a=M,b=this.kj.Ws();return b&&b.getContext&&(a=b.getContext("2d")),a},vI:function(){var a,b=this.kj,e=b.Dr(),f=b.Xs,c=f.width,f=f.height,g=this.wI;return g&&g.width===c&&g.height===f||(g&&D.Qn(b,g),this.wI=g=ja.Ul.Nl("canvas"),g.getContext&&(this.xI=g.getContext("2d"),D.Kn(g,M,b),D.Pn(g,e.width,e.height))),a=this.xI,a&&(a.beginPath(),a.font=this.Cl(this.Bl()),a.name="bufferContext"),a},Bl:function(){return this.yI||(this.yI=a+" "+this.kj.currentTheme().bodyFont())},us:function(){this.yI=M},zI:function(a){var b,e=this.kj,f=e.parent,c=f?f.options.grayAreaBackColor||h.Mm("gc-grayArea").backgroundColor:"gray",e=C.Om(e,c);return a?(b=f?f.options.backgroundImage:M,b&&(e="transparent"),e):e},Cl:function(a){var b=this.kj._zoomFactor;return 1===b?a:B(a,b).font},Mx:function(a,b,e,f,c){var g,d,k,h,m,p=this.wI,n=this.bm();0>=e||0>=f||!p||!n||(c||(c=this.kj.Dr()),g=D.Ln(p),d=D.Mn(p),1!==g&&(a*=g,b*=d,e*=g,f*=d,c=new w(c.x*g,c.y*d,c.width*g,c.height*d)),k=c.getIntersect(a,b,e,f),k&&(k.round(),a=k.x,b=k.y,e=k.width,f=k.height,h=p.width,h&&a+e>h&&(a=h-e,0>a&&(e+=a,a=0)),m=p.height,m&&b+f>m&&(b=m-f,0>b&&(f+=b,b=0)),G.qtMode&&(0w&&(a=w-e,0>a&&(e+=a,a=0)),B&&b+f>B&&(b=B-f,0>b&&(f+=b,b=0)),w&&q+t>w&&(q=w-t,0>q&&(t+=q,q=0)),B&&l+v>B&&(l=B-v,0>l&&(v+=l,l=0)),L.Cn(h,1,1),L.Cn(p,1,1),h.clearRect(q,l,t,v),h.drawImage(n,a,b,e,f,q,l,t,v),p.clearRect(q,l,t,v),p.drawImage(m,q,l,t,v,q,l,t,v),L.Cn(h,y,r),L.Cn(p,y,r)}catch($a){}},im:function(a,b,e,f){var d,k,h,m,n,q,l,t,v,x,y,r;if(e||(e=this.bm()),d=!1,k=this.kj,h=c(-1,-1,-1,-1),m=k.Hx,a&&(h=k.options.allowCellOverflow?c(a.row,0,a.rowCount,k.getColumnCount()):c(a.row,a.col,a.rowCount,a.colCount),!m)){if(0<=h.col){q=h.col;l=h.col+h.colCount-1;t=k.getRowCount(1);a=k.zl(1);for(v=0;v=d.Xq&&(g=this.bm(),g&&(c||(d.$l=!0),this.jp(g,new w(a,b,e,f))))},repaint:function(a){var b,e=this.kj;0=this.kj.Xq&&(e||this._l(a,b),this.Pw(a,b))},_l:function(a,b,e){var f,c,g,d=this.kj;a&&0>=d.Xq&&(f=this.vI(),c=f?f:a,g=d.Dr(),b||(b=g),b&&b.round(),e&&e.round(),d.$l&&(d.$l=!1,f&&(f.clearRect(b.x,b.y,b.width,b.height),e&&f.clearRect(e.x,e.y,e.width,e.height),L.Dn(f,-g.x,-g.y)),this.AI(c,b),e&&this.AI(c,e),f&&L.Dn(f,g.x,g.y)),f&&(this.dm(b),e&&this.dm(e)))},Pw:function(a,b){var e,f,c,g,d,k=this.kj,h=k.CH;if(a&&!(0=g;g++)(f=e.fm(g))&&0!==f.width&&0!==f.height&&this.dm(f);for(d=0;2>=d;d++)(f=e.gm(d))&&0!==f.width&&0!==f.height&&this.dm(f)}for(g=0;2>=g;g++)for(d=0;2>=d;d++)(f=e.Ft(g,d))&&0!==f.width&&0!==f.height&&(c=b,!h||1===g&&1===d||(this.dm(f),c=f),c&&!f.intersectRect(c)||this.BI(a,g,d,c));this.CI(a);ka.ao(k,"paintAdornment",{ctx:a,clipRect:b})}},dD:function(a,b){var e=this.kj,f=e.parent,f=f?f.options:{},c=J(e),e=C.Om(e,c);f.backgroundImage&&(e="transparent");a.save();a.fillStyle=e;a.fillRect(b.x,b.y,b.width,b.height);a.restore()},DI:function(a,b,e){var f,c,g,d,k;k=this.kj.am();for(c=0;2>=c;c++)(f=k.gm(c))&&(b?(g=f.getIntersectRect(b),g&&this.EI(a,c,g,e)):this.EI(a,c,f,e));for(f=0;2>=f;f++)for((c=k.fm(f))&&(b?(g=c.getIntersectRect(b),g&&this.FI(a,f,g,e)):this.FI(a,f,c,e)),c=0;2>=c;c++)(d=k.Ft(f,c))&&(b?(g=d.getIntersectRect(b),g&&this.GI(a,f,c,g,e)):this.GI(a,f,c,d,e));(k=k.em())&&(b?(g=k.getIntersectRect(b),g&&this.HI(a,g,e)):this.HI(a,k,e))},II:function(a){var b,e,f,c,g=this.kj,d=g.am(),k=d.zr,h=d.Ar,m=d.lt,p=d.ot,n=d.width,q=d.height,l=d.qt,d=d.pt,t=g.Gr(1);0=q))){g=!1;for(t=0;t=z)){if(c=p[0],g=c.row,d=c.rowCount,k=c.col,h=c.colCount,-1===g&&(g=0),-1===k&&(k=0),-1===d&&(d=B.getRowCount()),-1===h&&(h=B.getColumnCount()),a.save(),a.beginPath(),a.lineWidth=2,a.strokeStyle=B.getSelectionBorderColor(),m=f.x,p=f.y,n=f.width,f=f.height,q=B.frozenRowCount(),1!==z||0!==q||B.lq<=g||B.lq>=g+d)for(e=this.bJ(e),c=0,d=e.length;cm+n&&(v=0,y=m+n),a.moveTo(x+t-1,w-1),a.lineTo(y+v,w-1),a.stroke());if(r=B.frozenColumnCount(),1!==z||0!==r||B.qq<=k||B.qq>=k+h)for(b=this.cJ(b),g=0,h=b.length;gp+f&&(m=0,e=p+f),a.moveTo(E-1,n+w-1),a.lineTo(E-1,e+m),a.stroke());a.beginPath();a.restore()}},bJ:function(a){var b,e,f,c,g,d,k,h,m,p,n=this.kj,q=n.Uq,l=q.length,t=n.Hr(a),v=[];for(a=0;a=e+k)a.moveTo(h,m),a.lineTo(h+e,m),h=h+e+k,p=p-e-k;else{if(p>=e){a.moveTo(h,m);a.lineTo(h+e,m);p=p-e-k;break}if(0p&&(p=f(p),p>k&&(a.moveTo(h,m-2),a.lineTo(h,m+(p-k))),m+=p,n-=p);0=e+k?(a.moveTo(h,m),a.lineTo(h,m+e),m=m+e+k,n=n-e-k):n>=e?(a.moveTo(h,m),a.lineTo(h,m+e),n=n-e-k):0n&&(n=f(n),n>k&&(a.moveTo(h+2,m),a.lineTo(h-(n-k),m)),h-=n,p-=n);0=e+k)a.moveTo(h,m),a.lineTo(h-e,m),h=h-e-k,p=p-e-k;else{if(p>=e){a.moveTo(h,m);a.lineTo(h-e,m);p=p-e-k;break}if(0p&&(p=f(p),p>k&&(a.moveTo(h,m+2),a.lineTo(h,m-(p-k))),m-=p,n-=p);0=e+k?(a.moveTo(h,m),a.lineTo(h,m-e),m=m-e-k,n=n-e-k):n>=e?(a.moveTo(h,m),m-e===g?a.lineTo(h,m-e-1):a.lineTo(h,m-e),n=n-e-k):0g&&(a.moveTo(h,m),a.lineTo(h,m-n)),n=n-e-k)}a.stroke();a.beginPath();a.restore()},TI:function(a,b,e,f,c,g){var d,k,h,p,n,q,l,t,v,x,y,r,w,B,z,C,A,D,u,F,G,N,P,S,V,W,X,H,T,I,Z,K;if(m(f)&&(f=3),d=this.kj,k=d.parent,h=k&&k.options.resizeZeroIndicator,p=d.Gr(b,f),n=d.Hr(e,f),q=p.length,l=n.length,!(0>q||0>l)){t=d.Ir(b,e,f);v=0T||T!==z-1)&&X.push({x1:C,y1:A,x2:C,y2:A+u,horizontal:!1}),T=z),-1===e&&d.getRowVisible(B)&&0===d.Yr(B)&&((0>H||H!==B-1)&&X.push({x1:C,y1:A,x2:C+D,y2:A,horizontal:!0}),H=B)),c&&(C+D<=c.x||C>=c.x+c.width||A+u<=c.y||A>=c.y+c.height)||0!==D&&0!==u&&(r&&Y.Bb(P,r)||(F=w.ge(B,z,f),G=w.Ym(B,z,f),k&&d.isValid&&!d.isValid(B,z,F)&&W.push({x:C,y:A,width:D,height:u}),N.jF(B,z,C,A,D,u,G,r),S.push({data:F,row:B,col:z,x:C,y:A,width:D,height:u,style:G,cellLayout:r}),r&&P.push(r)));0S&&!1===P.value&&(V=I.dp(G,z.font),W=g(0,v-4),1!==y.hAlign&&y.textIndent&&(W=g(0,W-8*y.textIndent)),WB.backgroundLeftWidth?h:0>B.backgroundRightWidth?h+p-q:h+p/2-B.backgroundLeftWidth,f.cellOverflowLayout=B,E[B.column]&&N.push(z)):E[B.column]||(k=B.column,g=M.Ym(d,k),c=u.getValue(d,k),p=B.columnWidth,q=B.backgroundWidth,C=u.getCellRect(d,B.column),l=0>B.backgroundLeftWidth?C.x:0>B.backgroundRightWidth?C.x+C.width-q:C.x+C.width/2-B.backgroundLeftWidth,v={data:c,row:d,col:k,x:C.x,y:m,width:p,height:n,style:g,cellOverflowLayout:B},b.push(v)),B.layout=new w(l,m,q,n),e.gF(d,B),E[B.column]=!0):y&&!E[y.column]&&y.contains(k)?(k=y.column,g=M.Ym(d,k),c=u.getValue(d,k),p=y.columnWidth,q=y.backgroundWidth,A=u.getCellRect(d,y.endColumn),l=A.x+A.width-q,v={data:c,row:d,col:k,x:l,y:m,width:p,height:n,style:g,cellOverflowLayout:y},b.push(v),y.layout=new w(l,m,q,n),e.gF(d,y),E[y.column]=!0):r&&!E[r.column]&&r.contains(k)&&(k=r.column,g=M.Ym(d,k),c=u.getValue(d,k),p=r.columnWidth,q=r.backgroundWidth,D=u.getCellRect(d,r.startColumn),l=D.x,t=D.x+q-p,v={data:c,row:d,col:k,x:t,y:m,width:p,height:n,style:g,cellOverflowLayout:r},b.push(v),r.layout=new w(l,m,q,n),e.gF(d,r),E[r.column]=!0)}if(0=g.width||(d=g.col,h=e.ge(a,d),k=e.Ym(a,d),m(h)&&!k.watermark||k.shrinkToFit||k.wordWrap||(p=e._m(d),l=A.vn(b,k,h),n=k.hAlign,3===n&&(n=q(n,h,k.formatter)),0===n?(x=this.tJ({data:h,style:k,width:p,text:l},a,d,r),x&&v.push(x)):2===n?(x=this.uJ({data:h,style:k,width:p,text:l},a,d,y),x&&v.push(x)):1===n&&(x=this.vJ({data:h,style:k,width:p,text:l},a,d,y,r),x&&v.push(x))));v.trailingOverflowLayout=this.wJ(a)}return this.rJ[a]=v,v},tJ:function(a,b,e,f){return K(this.kj,this.qJ,this.Rq,this.yI,a,b,e,f,!0)},uJ:function(a,b,e,f){return K(this.kj,this.qJ,this.Rq,this.yI,a,b,e,f)},vJ:function(a,b,e,f,c){var g,d,k,h,p,n;h=this.kj;var q=h.ss,l=this.qJ,t=a.width;n=a.width;var v=a.data;p=a.style;a=a.text;var x=p.watermark;if(l.findCell(b,e)||(g=p.cellType||this.Rq,!g.allowOverflow||!a&&!x)||(!a&&x&&(a=x),d=Q(a,p,this.yI,h._zoomFactor),d<=n))return M;h=e;p=n/2;for(g=e-1;g>=f&&!l.findCell(b,g)&&(v=q.ge(b,g),m(v))&&(k=q.Ym(b,g),!k.watermark)&&(h=g,p+=q._m(g),!(d/2<=p));g--);f=e;n/=2;for(g=e+1;g<=c&&!l.findCell(b,g)&&(v=q.ge(b,g),m(v))&&(f=g,n+=q._m(g),!(d/2<=n));g++);return h===f?M:new y(e,h,f,d,t,p+n,p,n)},sJ:function(a){var b,e,f,c,g,d,k,h,p,n=this.kj,l=n.ss;p=this.pJ;var t=p[0].col,v=p[p.length-1].col,x=n.zl();for(p=1;100>p;p++){if((g=t-p,0>g)||x.find(a,g))return M;if(e=l.ge(a,g),f=l._m(g),0=t?d:M}},wJ:function(a){var b,e,f,c,g,d,k,h,p,n=this.kj,l=n.ss;p=this.pJ;var t=p[0].col,v=p[p.length-1].col,x=n.zl(),y=n.getColumnCount();for(p=1;100>p;p++){if((g=v+p,g>=y)||x.find(a,g))return M;if(e=l.ge(a,g),f=l._m(g),0=q&&(d=q-1);l>=z&&(l=z-1);q=F(0,d);z=F(0,l);this.Tr();n=2===n?H.Wl(this):1===n;this.Kr(q,z,this.Er(q),this.Fr(z),!n);this.addSelection(d,l,A,r)},getSelections:function(){return this.Uq.toArray()},clearSelection:function(){this.Tr();this.Kr(0,0);d.ao(this,"clearSelection");this.$p()},Tr:function(){this.Uq.clear()},Qs:function(d,l,A){var q,n,w,z,C,c,m,h,a,B,y;c=this.options;m=c.protectionOptions;var t=!1!==m.allowSelectLockedCells;m=!1!==m.allowSelectUnlockedCells;if(!c.isProtected||t&&m)return!0;if(!t&&!m)return!1;if(q=A?A.locked:this.tq(d,l,"locked"),n=0>l,w=0>d,t===q&&(w||n)){z=w?this.getRowCount(void 0):1;d=w?0:d;C=n?this.getColumnCount(void 0):1;l=n?0:l;c=this.Mp();m=c.dataTable;z=d+z-1;C=l+C-1;for(h=d;h<=z;h++)if(B=m[h])for(a=l;a<=C;a++)if(y=B[a],y&&y.style&&t!==y.style.locked)return!1;if(w)for(h=d;h<=z;h++)if(A=c.getStyle(h,-1),A&&t!==A.locked)return!1;if(n)for(a=l;a<=C;a++)if(A=c.getStyle(-1,a),A&&t!==A.locked)return!1}return t===q},selectionPolicy:function(d){var q=this.Uq;return 0===arguments.length?q.pp:(q.pp=d,this)},selectionUnit:function(d){var q=this.Uq;return 0===arguments.length?q.qp:(q.qp=d,this)},getSelectionBackColor:function(){return this.options.selectionBackColor||O.Lm("gc-selection").backgroundColor},getSelectionBorderColor:function(){return this.options.selectionBorderColor||O.Lm("gc-selection").borderTopColor},EJ:function(){var d=this.Uq;0C&&A&&(c=this.br(c),(0>c||I(c))&&(c=this.br(z)),r=c,n=this.JJ(q,c),C=n.r,c=n.c,c===l&&C<=d)?null:{row:C,col:c,leadingCellCol:r})},Bx:function(d,l,A){var q,n,w;A=this.LJ(d,l,A,this.Rr||0);!A||A.row===d&&A.col===l||(q=A.row,n=A.col,w=A.leadingCellCol,this.IJ(q,n)&&(this.Qr=q,this.Rr=w,this.Jr(q,n)))},LJ:function(d,l,A,r){var n,q=this.getRowCount(void 0),z=this.getColumnCount(void 0),C=d,c=l;if(!(C===q-1&&!A||0===q||0===z||(n=this.MJ(C,r),A||this.KJ(n),C=n.r,c=n.c,C===q&&A&&(c=this.Zq(c),(c>=z||I(c))&&(c=this.Zq(-1)),r=c,n=this.MJ(-1,c),C=n.r,c=n.c,c===l&&C>=d))))return{row:C,col:c,leadingCellCol:r}},Dx:function(){var d,l,A=this.NJ();A&&(d=A.row,l=A.col,this.Qr=d,this.Rr=l,this.Jr(d,l))},NJ:function(){var d,l,A,r,n,w=this.ir(),z=this.dr(),C=z;if(!w&&!C)return null;if(d=this.options,l=d.protectionOptions,A=!1!==l.allowSelectLockedCells,r=!1!==l.allowSelectUnlockedCells,!d.isProtected||A&&r)return{row:w,col:C};if(!A&&!r)return null;for(;null!==w&&0<=w;w=this.gr(w))for(C=z;null!==C&&0<=C;C=this.br(C))if(n=this.tq(w,C,"locked"),A===n)return{row:w,col:C};return null},Cx:function(){var d,l,A=this.OJ();A&&(d=A.row,l=A.col,this.Qr=d,this.Rr=l,this.Jr(d,l))},OJ:function(){var d,l,A,r,n,w=this._q(this.frozenRowCount()-1),z=this.Zq(this.frozenColumnCount()-1),C=z,c=this.ir(),m=this.dr();if(null===w||null===C)return null;if(d=this.options,l=d.protectionOptions,A=!1!==l.allowSelectLockedCells,r=!1!==l.allowSelectUnlockedCells,!d.isProtected||A&&r)return{row:w,col:C};if(!A&&!r)return null;for(;null!==w&&w<=c;w=this._q(w))for(C=z;null!==C&&C<=m;C=this.Zq(C))if(n=this.tq(w,C,"locked"),A===n)return{row:w,col:C};return null},zx:function(d,l,A){var q,n,w;(d=this.iy(d,l,A,this.Qr||0))&&(q=d.row,n=d.col,w=d.leadingCellRow,this.IJ(q,n)&&(this.Qr=w,this.Rr=n,this.Jr(q,n)))},iy:function(d,l,A,r){var n,q,z=this.getRowCount(void 0),C=this.getColumnCount(void 0),c,m=l;if(0===m&&!A||0===z||0===C)return null;n=this.PJ(r,m);q=r;A||this.KJ(n);c=n.r;for(m=n.c;0>m&&A;){if(c=this.gr(c,3,!0),(0>c||I(c))&&(c=this.gr(z,3,!0)),r=c,n=this.PJ(r,C),c=n.r,m=n.c,c===d&&md.r?d.r=this.ar():d.r>=this.getRowCount(void 0)&&(d.r=this.ir(),q=!0);0>d.c?d.c=this.$q():d.c>=this.getColumnCount(void 0)&&(d.c=this.dr(),q=!0);q&&(l=this.zl().get(d.r,d.c),l.row!==d.r&&(d.r=l.row),l.col!==d.c&&(d.c=l.col))},Fx:function(d,l){for(var q,r,n=this.Uq,w=n.rp,z=-1,C=this.Tq(this.Ix()),c=C.row,m=C.col,C=C.col+C.colCount-1,h=d,a=l;q=this.QJ(h,a),h=q.r,a=q.c,!(a>=m);){if(z===w&&h===d&&a<=l)return;h--;h>=c?a=C+1:(r=this.Tq(this.Ix(3)),z=n.rp,c=r.row,m=r.col,C=r.col+r.colCount-1,h=r.row+r.rowCount-1,a=r.col+r.colCount)}0<=h&&(this.Jr(h,a),this.Qr=h,this.Rr=a)},Gx:function(d,l){for(var q,r,n=this.Uq,w=n.rp,z=-1,C=this.Tq(this.Ix()),c=C.col,m=C.row+C.rowCount-1,C=C.col+C.colCount-1,h=d,a=l;q=this.RJ(h,a),h=q.r,a=q.c,!(a<=C);){if(z===w&&h===d&&a>=l)return;h++;h<=m?a=c-1:(r=this.Tq(this.Ix(4)),z=n.rp,c=r.col,m=r.row+r.rowCount-1,C=r.col+r.colCount-1,h=r.row,a=r.col-1)}0<=h&&(this.Jr(h,a),this.Qr=h,this.Rr=a)},Rs:function(d,l,A){var q,n,w;A=this.hy(d,l,A,this.Qr||0);!A||A.row===d&&A.col===l||(q=A.row,n=A.col,w=A.leadingCellRow,this.IJ(q,n)&&(this.Qr=w,this.Rr=n,this.Jr(q,n)))},hy:function(d,l,A,r){var n,q,z=this.getRowCount(void 0),C=this.getColumnCount(void 0),c,m=l;if(m===C-1&&!A||0===z||0===C)return null;n=this.SJ(r,m);q=r;A||this.KJ(n);c=n.r;for(m=n.c;m===C&&A;){if(c=this._q(c,!0),(c>=z||I(c))&&(c=this._q(-1,!0)),r=c,n=this.SJ(r,-1),c=n.r,m=n.c,c===d&&m>l)return null;if(c===d&&m===l){if(r===q)return null;n=this.SJ(r,m);c=n.r;m=n.c}}return{row:c,col:m,leadingCellRow:r}},PJ:function(d,l){for(var q,r,n,w=l;0<=w&&(q=d,w--,!(0>w))&&(r=this.getSpans(K(q,w,1,1)),r&&0=n.col&&(w=n.col,q=n.row)),!this.IJ(q,w)););return{r:q,c:w}},QJ:function(d,l){for(var q,r;0<=l&&(l--,!(0>l));){if(q=this.zl().find(d,l)){if(r=this.Ix(),!(r.row<=q.row&&q.row+q.rowCount<=r.row+r.rowCount&&r.col<=q.col&&q.col+q.colCount<=r.col+r.colCount))continue;if(q.row!==d||q.col!==l)continue;l>=q.col&&(l=q.col,d=q.row)}if(this.IJ(d,l))break}return{r:d,c:l}},SJ:function(d,l){for(var q,r,n,w,z=this.getColumnCount(void 0),C=l;C=z))&&(n=this.getSpans(K(q,C,1,1)),n&&0w.col?C=F(C,w.col+w.colCount):q=w.row),!this.IJ(q,C)););return{r:q,c:C}},RJ:function(d,l){for(var q,r,n,w=this.zl(),z=this.getColumnCount(void 0);l=z));){if(r=w.find(d,l)){if(n=this.Ix(),!(n.row<=r.row&&r.row+r.rowCount<=n.row+n.rowCount&&n.col<=r.col&&r.col+r.colCount<=n.col+n.colCount))continue;if(r.row!==d||r.col!==l)continue;l>r.col?l=F(l,r.col+r.colCount):d=r.row}if(this.IJ(d,l))break}return{r:d,c:l}},IJ:function(d,l){var q,r,n;return!!this.Qs(d,l)&&(q=0<=d&&dd))&&(q=this.getSpans(K(d,l,1,1)),q&&0=r.row&&(d=r.row,l=r.col)),!this.IJ(d,l)););return{r:d,c:l}},MJ:function(d,l){for(var q,r,n,w=this.getRowCount(void 0);d=w))&&(r=this.getSpans(K(d,l,1,1)),r&&0n.row?d=F(d,n.row+n.rowCount):l=n.col),!this.IJ(d,l)););return{r:d,c:l}},Ur:function(d,l,A,r,n){this.Uq.add(d,l,A,r);n&&0>=this.Xq&&this.yl.im()},aH:function(d,l,A){var q=this.Jx(d,l,this.Jl,this.Kl);d=q.row;l=q.col;var n=q.rowCount,q=q.colCount,w=this.selectionPolicy(),z=this.selectionUnit();0!==w&&(1===w&&this.Uq.clear(),1===z?(l=-1,q=-1):2===z&&(d=-1,n=-1),this.Kx(d,l,n,q,A))},Jx:function(d,l,A,r,n){var q,z,C,c,m;return I(A)&&(A=this.Jl),I(r)&&(r=this.Kl),q=this.zl(),z=q.get(A,r),C=q.get(d,l),n&&z.equals(C)?new u.Range(z.row,z.col,1,1):(c=z.union(C),m=this.getSpans(),m&&0=this.Xq)&&(q=this.Ix(),q.row!==C.row||q.col!==C.col||q.rowCount!==C.rowCount||q.colCount!==C.colCount)&&(d=this.yl,C.containsRange(q)?d.im(C):q.containsRange(C)?d.im(q):(d.im(C),d.im(q)))},Sx:function(d,l){var q,r,n,w,z,C,c,m,h;!(0>=L(this.Uq))&&(q=this.Ix(),r=this.UJ(q,d,l))&&(n=this.Uq.toArray(),w=r.row,z=r.col,C=r.rowCount,c=r.colCount,m=this.selectionPolicy(),h=this.selectionUnit(),0!==m)&&(1===m&&this.Uq.clear(),1===h?(z=-1,c=-1):2===h&&(w=-1,C=-1),this.Kx(w,z,C,c,!0),q=this.Uq.toArray(),this.mm.zu(n,q)&&(this.yu(n,q),this.Au(n)))},UJ:function(d,l,A,r,n){var q=this.Tq(d),z=null;return 37===l?z=A?this.VJ(q,!1,r,n):this.WJ(q,r,n):39===l?z=A?this.XJ(q,!1,r,n):this.YJ(q,r,n):38===l?z=A?this.ZJ(q,!1,r,n):this.$J(q,r,n):40===l?z=A?this._J(q,!1,r,n):this.aK(q,r,n):36===l?z=A?this.bK(q,r,n):this.cK(q,r,n):35===l?z=A?this.dK(q,r,n):this.eK(q,r,n):33===l?z=this.fK(q,r,n):34===l&&(z=this.gK(q,r,n)),z&&(0>d.row&&(z.row=-1,z.rowCount=this.getRowCount()),0>d.col&&(z.col=-1,z.colCount=this.getColumnCount())),z},WJ:function(d,l,A){var q,n,w,z,C,c,m,h,a,B=d.row,y=d.col,t=d.rowCount;d=d.colCount;for(var E=y+d-1,u=B+t-1;0=y||l)&&this.rq(t),n=this.Jx(a,t,A,r),q=G(a,n.row),z=G(B,n.col),C=F(a+d.rowCount-1,n.row+n.rowCount-1),c=G(B+d.colCount-1,n.col+n.colCount-1),m=C-q+1,h=c-z+1,K(q,z,m,h)},YJ:function(d,l,A){var q,n,w,z,C,c,m,h,a,B=d.row,y=d.col,t=d.rowCount;d=d.colCount;for(var E=y,u=this.getColumnCount(void 0)-1,p=B+t-1;E=h&&this.rq(this.ks(w,2)):y===a&&C>=h&&this.rq(this.ks(C,2)),K(n,w,c,m);return null},XJ:function(d,l,A,r){var n,q,z,C,c,m,h,a,B=d.row,y=d.col,t=this.lr();if(!I(t))return this.rq(t),n=this.dr(),l||(n+=this.frozenTrailingColumnCount()),q=this.Jx(B,n,A,r),z=G(B,q.row),C=F(y,q.col),c=F(B+d.rowCount-1,q.row+q.rowCount-1),m=F(y+d.colCount-1,q.col+q.colCount-1),h=c-z+1,a=m-C+1,K(z,C,h,a)},$J:function(d,l,A){var q,n,w,z,C,c,m,h,a,B=d.row,y=d.col,t=d.rowCount;d=d.colCount;for(var E=B+t-1,u=y+d-1;0=y||l)&&this.mq(t),n=this.Jx(t,B,A,r),q=G(a,n.row),z=G(B,n.col),C=G(a+d.rowCount-1,n.row+n.rowCount-1),c=F(B+d.colCount-1,n.col+n.colCount-1),m=C-q+1,h=c-z+1,K(q,z,m,h)},aK:function(d,l,A){var q,n,w,z,C,c,m,h,a,B=d.row,y=d.col,t=d.rowCount;d=d.colCount;for(var E=B,u=this.getRowCount(void 0)-1,p=y+d-1;E=h&&this.mq(this.ms(n,2)):B===a&&z>=h&&this.mq(this.ms(z,2)),K(n,w,c,m);return null},_J:function(d,l,A,r){var n,q,z,C,c,m,h,a,B=d.row,y=d.col,t=this.kr();if(!I(t))return this.mq(t),n=this.ir(),l||(n+=this.frozenTrailingRowCount()),q=this.Jx(n,y,A,r),z=F(B,q.row),C=G(y,q.col),c=F(B+d.rowCount-1,q.row+q.rowCount-1),m=F(y+d.colCount-1,q.col+q.colCount-1),h=c-z+1,a=m-C+1,K(z,C,h,a)},cK:function(d,l,A){var q,n,w,z,C,c,m,h=d.row,a=d.col,B=d.rowCount;d=d.colCount;for(var y=this.frozenColumnCount()-1,t=this.Kl,E=h+B-1;yt;)if(y--,this.IJ(E,y)){if(a+d-1>=y&&a===this.Kl)break;return q=this.Jx(E,y,l,A),n=G(h,q.row),w=F(a,q.col),z=F(h+B-1,q.row+q.rowCount-1),C=F(a+d-1,q.col+q.colCount-1),c=z-n+1,m=C-w+1,this.rq(this.lr()),K(n,w,c,m)}return null},dK:function(d,l,A){return d=this.XJ(d,!0,l,A),this._J(d,!0,l,A)},fK:function(d,l,A){var q,n,w,z,C,c,m,h,a,B,y=d.row,t=d.col,E=d.rowCount,u=this.Ew();return I(u)?null:(q=this.Gr(1),n=this.mq(u),w=-1,n?w=this._q(y+E-1-L(q)):0>=this.frozenRowCount()&&(w=this.ar()),w=this.Fw()&&(w=this.gr(this.Fw())),z=this.Jx(w,t,l,A),C=G(y,z.row),c=G(t,z.col),m=G(y+E-1,z.row+z.rowCount-1),h=F(t+d.colCount-1,z.col+z.colCount-1),a=m-C+1,B=h-c+1,K(C,c,a,B))},gK:function(d,l,A){var q,n,w,z,C,c,m,h,a,B=d.row,y=d.col,t=d.rowCount,E=this.$x();return I(E)?null:(q=this.Gr(1),this.mq(E),n=this.gr(B+t-1+L(q)),n=this.Fw()&&(n=this.lq>=this.kr()?this.Fw():this.gr(this.Fw())),w=this.Jx(n,y,l,A),z=F(B,w.row),C=G(y,w.col),c=F(B+t-1,w.row+w.rowCount-1),m=F(y+d.colCount-1,w.col+w.colCount-1),h=c-z+1,a=m-C+1,K(z,C,h,a))},Ew:function(){var d,l,A,r;d=this.Gr(1);if(!d||0>=L(d))return null;d=(d=this.frozenRowCount())?this._q(d-1):this.ar();l=0;A=this.lq;for(r=this.am();A>d&&(A--,l+=this.Sl(A),!(l>r.jr)););return A},zw:function(){var d,l,A,r;d=this.Hr(1);if(!d||0>=L(d))return null;d=(d=this.frozenColumnCount())?this.Zq(d-1):this.$q();l=0;A=this.qq;for(r=this.am();A>d&&(A--,l+=this.Tl(A),!(l>r.er)););return A},$x:function(){var d,l,A=this.Gr(1);return A&&0<(d=L(A))?(l=A[d-1].row,this.ir()<=l?this.lq:l):null},kr:function(){var d,l,A,r,n;if(this.ir()===this.Fw()&&(d=this.am(),l=this.Gr(1),l&&1<=(A=L(l))&&(r=l[A-1],r.y+r.height<=d.qt+d.jr)))return this.lq;d=this.lq;try{return this.lq=this.ir(),n=this.Ew(),this._q(n)}catch(w){}finally{this.lq=d}},lr:function(){var d,l,A,r;if(this.dr()===this.Aw()&&(d=this.am(),l=this.Hr(1),l&&1<=(A=L(l))&&(r=l[A-1],r.x+r.width<=d.pt+d.width)))return this.qq;d=this.am();l=0;for(A=this.dr();0d.er));)A--;return 0=q?r:(3===d?(l.rp--,0>l.rp&&(l.rp=q-1)):4===d&&(l.rp++,l.rp>=q&&(l.rp=0)),0<=l.rp&&(r=l[l.rp]),r)}});d.$n("selection",{init:function(){var d=new J;d.add(0,0,1,1);this.Uq=d}});U.exports=u},function(U,u,l){function d(d,n,l){for(var c=d[l-n];cl.toLowerCase():d>l):a}function Q(d,l,q,c,m){var h,a,r,y,t,w,z=d.length;if(1>=z)return d;h=d[Math.floor(z/2)];a=[];r=[];y=[];for(t=0;tw?a.push(d[t]):0=y.length||t)))||(w=this.wq,z=w&&w.Ou||t&&y[0]&&y[0].LZ(),-1===n&&(n=0),-1===q&&(q=la),-1===l&&(l=0),-1===c&&(c=pa),0>n||n>=la||0>l||l>=pa||0>q||n+q>la||0>c||l+c>pa||!h))return!1;this.suspendPaint();this.suspendEvent();u.X3&&this.suspendCalcService();try{if(p=[],z)for(g=[],f=n;fq&&0<=l&&ll&&0<=q&&ql&&(l=u=-1);0>q&&(q=A=-1);this.sheet=d;this.row=l;this.rowCount=I(u)?1:u;this.col=q;this.colCount=I(A)?1:A;this.sheetArea=I(r)?3:r}var Q,K,O,H,I,L;u=l(42);Q=l(56).Worksheet;K=l(51).Style;O=l(44).GC$;H=l(43).Range;I=l(26).j.Fa;l=Q.prototype;L=R.prototype={constructor:R,value:d(l.getValue,l.setValue),text:d(l.getText,l.setText),formula:d(function(d,l){return u.X3&&this.getFormula(d,l)},function(d,l,q,D){u.X3&&this.setFormula(d,l,q,D)}),tag:function(d){var l=this.sheet,q=this.row,u=this.col,A=this.rowCount,r=this.colCount,n=this.sheetArea,w,z;if(0===arguments.length)return l.getTag(q,u,n);if(0<=q&&0<=u)for(w=q;wl)for(l=0;ll)return q.getColumnWidth(u,A)},height:function(d){var l,q=this.sheet,u=this.row;l=this.col;var A=this.sheetArea;if(0!==arguments.length){if(0>l)for(l=0;ll)return q.getRowHeight(u,A)},visible:function(d){var l,q,u=this.sheet;q=this.row;l=this.col;var A=this.sheetArea;if(0!==arguments.length){if(0>l&&0<=q)for(l=0;lq)for(q=0;ql&&0<=q?u.getRowVisible(q,A):0<=l&&0>q?u.getColumnVisible(l,A):void 0},resizable:function(d){var l,q,u=this.sheet;q=this.row;l=this.col;var A=this.sheetArea;if(0!==arguments.length){if(0>l&&0<=q)for(l=0;lq)for(q=0;ql&&0<=q?u.getRowResizable(q,A):0<=l&&0>q?u.getColumnResizable(l,A):void 0},tq:function(d){return this.sheet.tq(this.row,this.col,d,this.sheetArea)},_w:function(d,l){function q(c,d,a,l,n,q){if(J(c,d,a,q)){var h=c.Iq(d,a,q);h||(h=new K);h[l]=n;c.setStyle(d,a,h,q)}}var u,A,r=this.sheet,n=this.row,w=this.col,z=this.rowCount,C=this.colCount,c=this.sheetArea;if(0<=n&&0<=w)for(u=n;u=u)return isNaN(d)?1:d;if(l=F(l[1]),10<=d)return d;if(3<=d){if(20143<=l)return 3;if(20142<=l)return 2}return 1}var J,R,Q,K,O,H,I,L,F;u=l(42);J=l(61).Workbook;R=l(51).Style;Q=l(44).GC$;K=l(43);O=l(26).CultureManager;H=J._n;I=Q.each;L=K.Ul.Ol;F=parseFloat;Q.extend(J.prototype,{toJSON:function(d){var l,u,A,r,n,w,z=this,C={version:K.productInfo.productVersion};(l=z.startSheetIndex())&&(C.startSheetIndex=l);I(z.options,function(c,d){"_ps"!==c&&J.Qp[c]!==d&&(C[c]=d)});l=z.getSheetCount();l!==J.nv&&(C.sheetCount=l);u=z.getActiveSheetIndex();u!==J.ov&&(C.activeSheetIndex=u);u={};for(A=0;Ad(l.version);A=K.Vl.Xl();q.mv=!0;q.suspendPaint();q.suspendEvent();r=O.culture();O.culture("");try{q.T3();u.X3&&q.qv(!0);u.X3&&q.Wu.suspendAdjust();q.lv=-1;q.clearSheets();n=q.options;w=l.canUserEditFormula;L(w)&&(n.allowUserEditFormula=w);z=l.allowDragDrop;L(z)&&(n.allowUserDragDrop=z);C=l.allowDragFill;L(C)&&(n.allowUserDragFill=C);for(c in n)n.hasOwnProperty(c)&&(m=l[c],L(m)&&(n[c]=m));if(h=l.sheetCount,L(h)||(h=J.nv),q.sw(h,0),q.Lq={},a=l.namedStyles)for(B=0;Bv.width&&(u=v.width-d.x),h.css("width",u-t).css("height",d.height-y),R(g)||0===g?c.maxWidth=v.width-d.x-t-z:1===g?c.maxWidth=2*w(0,n(v.width-d.x-d.width-t,d.x-v.Br-t))+d.width:2===g&&(c.maxWidth=d.x+d.width-v.Br-t-z),c.maxHeight=v.height-d.y-y-e,c.minWidth=parseInt(c.style.width,10),c.minHeight=parseInt(c.style.height,10));try{q=(q=q&&m&&m.keyCode&&ga.mm.LH(m)&&0===c.selectionStart&&c.selectionEnd===c.value.length)||l&&l.sheet&&l.sheet.HF}catch(T){}if(D=q?"":c.value,k=c.style.font,k||(k=p.Cl(p.Bl())),g=ga.fp(k),!q&&m&&(ga.mm.LH(m)&&(G=c.selectionStart,H=D.substr(0,G),K=D.substr(G,D.length-G),D=H+String.fromCharCode(m.keyCode)+K),this.kK&&(D=I?h.val():this.nK+m.data)),L=[],L=a&&a.wordWrap?Q.Wn(D,h.width(),k):D.split(/\r\n|\r|\n/),U=L.length,c.minWidth=n(c.minWidth,c.maxWidth),c.minHeight=n(c.minHeight,c.maxHeight),a&&a.wordWrap||0c.minWidth&&D<=c.maxWidth)h.css("width",D).css("word-wrap","normal").css("overflow","hidden");else if(D>c.maxWidth)for(h.css("width",c.maxWidth).css("word-wrap","break-word").css("overflow","hidden"),J=m=0;Jc.maxWidth&&(O=r(H/c.maxWidth),m+=g*O)}m<=c.minHeight?h.css("height",c.minHeight):m>c.minHeight&&m<=c.maxHeight?h.css("height",m):m>c.maxHeight&&h.css("height",c.maxHeight).css("overflow-y","scroll")}else k=ga.rt(D,k),k>c.minWidth&&k<=c.maxWidth?h.css("width",k).css("height",c.minHeight).css("word-wrap","normal").css("overflow","hidden"):k<=c.minWidth?h.css("width",c.minWidth).css("height",c.minHeight).css("word-wrap","normal").css("overflow","hidden"):k>c.maxWidth&&(h.css("width",c.maxWidth).css("word-wrap","break-word"),O=r(k/c.maxWidth),J=g*O,J<=c.minHeight?h.css("height",c.minHeight).css("overflow","hidden"):J<=c.maxHeight?h.css("height",J).css("overflow","hidden"):J>c.maxHeight&&h.css("height",c.maxHeight).css("overflow-y","scroll"));g=h.css("text-align");O=h.width()-c.minWidth;R(g)||"left"===g||("center"===g?h.css("left",c.originalLeft-O/2):"right"===g&&h.css("left",c.originalLeft-O));y=h.height()+y+E+e;t=t+B+z;"scroll"===h.css("overflow-y")?this.updateEditorContainer(c,{width:c.offsetWidth+t,height:q?0:y},a):this.updateEditorContainer(c,{width:h.width()+t,height:y},a)}},updateEditor:function(c,a,d,m){if(this.lK(c,a,d,null,m),I&&c)c=C(c),a=c.width(),c.width(a+1).width(a)},updateImeMode:function(c,a,d){this.isImeAware()&&c&&A.hp(c,a)},isReservedKey:function(c,a){var d=c.srcElement||c.target,h=c.keyCode,m=c.ctrlKey,l=c.altKey,n=c.metaKey;return!!(d&&a&&a.isEditing&&"gcEditingInput"===d.getAttribute("gcUIElement"))&&(13===h&&(m&&!c.shiftKey||l)||90===h&&m&&!l||89===h&&m&&!l||67===h&&(m||n)&&!l||88===h&&(m||n)&&!l)},isImeAware:function(c){return!0}});l.Text=d;l._o[1]=d;U.exports=u},function(U,u,l){function d(c,d){return c=c||0,I.Km(c,"gc-"+d+"-"+I.Jm(c))}function J(c,d,h,a,l,n){var m=new Image;n=n.replace('url("',"");n=n.replace('")',"");m.src=n;c.drawImage(m,d,h,a,l)}function R(c,m,h,a,l,y,t,r,w,p,g){var f,k;if(m){f=w.visualState||0;k=d(f,p);var x,B,z,E,u,e,b;if(!C.j.Fa(f)){if(m.save(),m.beginPath(),0===f&&r.backColor)x=r.backColor,m.fillStyle!==x&&(m.fillStyle=x),m.fillRect(a+1,l+1,y-1,t-1);else try{if(B=k&&k.backgroundColor,z=k&&k.backgroundImage,z&&-1!==z.indexOf("linear-gradient")){E=F(z);x=m.createLinearGradient(a+y/2,l,a+y/2,l+t);u=0;for(e=E.length;uf||M>t)&&(d.rect(a,l,f,t),d.clip(),d.beginPath()),d.fillText(h,a+e,l+v),q&&c.ip(d,q,a+e,l+v,F,D,I);d.restore()}}function K(){G.call(this);this.typeName="2"}function O(){G.call(this);this.typeName="3"}function H(){G.call(this);this.typeName="4"}var I,L,F,G,q,D,A,r=l(44).GC$.inherit,n=l(43),w=l(50).To,z=l(52).CellTypes,C=l(26);u=l(42);l=u.CellTypes||(u.CellTypes={});I=n.Im;L=n.Vn;F=n.Ul.wl;G=z.Base;q=z.Context;D="none";A=Math.floor;r(K,G);K.prototype.paint=function(c,d,h,a,l,n,q,r){R(this,c,d,h,a,l,n,q,r,"columnHeader",1)};K.prototype.paintContent=function(c,m,h,a,l,n,q,r){var t=d(r.visualState,"columnHeader");Q(this,c,m,h,a,l,n,q,r,1,t)};l.ColumnHeader=K;l._o[2]=K;r(O,G);O.prototype.paint=function(c,d,h,a,l,n,q,r){R(this,c,d,h,a,l,n,q,r,"rowHeader",2)};O.prototype.paintContent=function(c,m,h,a,l,n,q,r){var t=d(r.visualState,"rowHeader");Q(this,c,m,h,a,l,n,q,r,2,t)};l.RowHeader=O;l._o[3]=O;r(H,G);H.prototype.paint=function(c,d,h,a,l,n,q,r){var m,p,g,f,k;if(c){c.save();c.rect(h,a,l,n);c.clip();c.beginPath();d=r.visualState||0;try{p=(m=this.getThemeStyle(r.visualState,"gc-corner-"+I.Jm(d)))&&m.backgroundColor,g=m&&m.backgroundImage,p?(c.fillStyle=p,c.fillRect(h,a,l,n)):g&&g!==D&&J(c,h,a,l,n,g)}catch(x){}if(f=this.getThemeStyle(4,"gc-corner-triangle-"+I.Jm(d)),k=f&&f.backgroundImage,m=f&&f.backgroundColor,r=c.createLinearGradient(h+l/2,a,h+l/2,a+n),k&&-1!==k.indexOf("linear-gradient")){k=F(k);m=0;for(p=k.length;mn&&wc&&zn+m||zc+h)&&(d.rect(n,c,m,h),d.clip()),d.beginPath(),"#707070"!==d.strokeStyle&&(d.strokeStyle="#707070"),d.strokeRect(w+.5,z+.5,p-1,g-1),x=this._buttonState,B=this._text,2===x?k="#34B4E3":1===x?k="#A6F4FF":(k=this._buttonBackColor,k||(u=d.createLinearGradient(n+m/2,c,n+m/2,c+h),u.addColorStop(.125,"#F6FAFB"),u.addColorStop(1,"#D2DBEB"),k=u)),d.fillStyle!==k&&(d.fillStyle=k),d.fillRect(w+1,z+1,p-2,g-2),d.restore(),B&&D.prototype.paintValue.call(this,d,B,w,z,p,g,a,q)))},getText:function(d,l){return d},focus:function(d,l){d&&d.focus()},createEditorElement:function(d){var l,n;d=F.vl(d&&d.sheet&&d.sheet.parent&&d.sheet.parent.qo)+1E3;return r(this.b5).css("user-select","none").css("z-index",d).attr("tabindex",1).attr("gcUIElement","gcEditingInput"),l=r(I("div")),l.css("position","absolute").css("overflow","hidden").css("border","1px #707070 solid"),n=r(I("span")),n.css("position","absolute").css("white-space","nowrap").css("font","normal 11pt calibri").css("cursor","default"),l.append(n),l[0]},setEditorValue:function(d,l,n){d&&(d=d.firstChild)&&r(d).html(this._text)},getEditorValue:function(d,l){return d?d.Ep:null},tw:function(d,l,n,c){var m=d.parent;m&&m.tw(d,l,n,c)},activateEditor:function(d,l,n,c){var m,h,a,q=c&&c.sheet;d&&q&&(m=r(d.parentNode),h=this,d&&(a=r(d),m.bind("keydown.gcEditingInput",function(c){var d=c.keyCode;if(!c.ctrlKey&&!c.shiftKey&&!c.altKey){if(32===d)return h.tK||R(a,"#34B4E3"),h.tK=!0,G(c),!1;8===d&&G(c)}}),m.bind("keyup.gcEditingInput",function(d){!h.tK||32!==d.keyCode||d.ctrlKey||d.shiftKey||d.altKey||(h.tK=!1,R(a,h._buttonBackColor),h.tw(q,q.Jl,q.Kl,c.sheetArea))}),a.bind("mousedown.gcEditingInput",function(c){2!==c.button&&(h.eG=!0,R(a,"#34B4E3"))}),a.bind("mouseup.gcEditingInput",function(c){2!==c.button&&(h.eG=!1,R(a,"#A6F4FF"))}),a.bind("click.gcEditingInput",function(){h.tw(q,q.Jl,q.Kl,c.sheetArea)}),a.bind("mousemove.gcEditingInput",function(){h.eG?R(a,"#34B4E3"):R(a,"#A6F4FF")}),a.bind("mouseout.gcEditingInput",function(c){c=c.relatedTarget;c!==d&&c!==d.firstChild&&R(a,h._buttonBackColor)})))},updateEditor:function(d,l,n,c){var m,h,a,q,y,t,w,z,p,g,f,k,x,u,C,A,D,e;(c=d&&c&&c.sheet)&&(m=c.yl,d&&(h=this._marginLeft,a=this._marginTop,q=this._text,y=r(d),y.width(n.width-h-this._marginRight).height(n.height-a-this._marginBottom).css("margin-top",a-1).css("margin-left",h-1),R(y,this._buttonBackColor),t=l.foreColor,w=l.font,z=l.vAlign,p=l.hAlign,g=l.textDecoration,f=d.firstChild,f&&(k=r(f),t&&k.css("color",t),x=w?w:m.Bl(),1z.width||B.y+v>z.height)&&(a.rect(z.x,z.y,z.width,z.height),a.clip(),a.beginPath()),E=1,u="left",1===w?bc-a)||(p.IK?p.Wq(G,{isMouse:!0}):p.UK())});d=r("canvas");p.Xs=d;p.XK(a,0,h-a,g);c.appendChild(d);a=p.YK=r("div");k.appendChild(a);p.ZK=!1;m(a).css("position","absolute").css("border","1px solid").css("background-color","white").css("z-index",f||0).css("outline","none").css("display","none").css("cursor","default").css("box-sizing","content-box").attr("gcUIElement","gcDropDownWindow").attr("tabindex",-1).css("width",h-2*H).css("height",g);p.$K(0,g-2*H);p._K=0;h=p.aL=r("div");a.appendChild(h);p.bL=new A.IB(a,h);p._itemHeight=22;p.cL=O;p.dL=-1;p._editorValueType=0;p._items=[]}function Q(a){m(a).css("margin",0).css("overflow","hidden").css("resize","none").css("position","absolute").css("padding",L+"px 0px 0px "+I+"px").css("outline","none").css("background-color","white").css("white-space","nowrap").css("box-sizing","content-box").css("border","none").attr("gcUIElement","gcComboBoxEditor").attr("tabindex",-1)}var K,O,H,I,L,F,G,q,D,A=l(85);u=l(26);var r=A.Ul.Nl,n=u.j.Fa,w=A.Ul,z=w.nl,C=A.CellTypes,c=C.Base,m=A.GC$;u=m.extend;var h=m.each,a=document,B=Math.max,y=parseInt;C.EditorValueType={text:0,index:1,value:2};K=17;O=20;H=0;F=L=I=1;G="EndEdit.gcEditingInput";q={editorValueType:0,items:null,itemHeight:22,editable:!1,maxDropDownItems:O};m.inherit(J,c);D={isReservedKey:function(a,c){return this.GK},paintValue:function(a,d,h,m,g,f,k,l){var p=K,n=B(0,g-p-1);3===k.hAlign&&(k.hAlign=0);k.wordWrap&&(k.wordWrap=!1);0g||p>f)&&(a.rect(h,m,g,f),a.clip());a.beginPath();a.lineWidth=2;a.fillStyle="black";a.moveTo(h+g-p+3,m+(f-2)/2-2.5);a.lineTo(h+g-p+6,m+(f-2)/2+3.5);a.lineTo(h+g-p+9,m+(f-2)/2-2.5);a.fill();a.restore()},getText:function(a,c){return a},createEditorElement:function(a){var c,d=(a=a&&a.sheet)&&a.parent,d=w.vl(d&&d.qo)+1E3;a=a.defaults;a=new R(this.b5,0,0,a.colWidth,a.rowHeight,d);return a.editorValueType(this._editorValueType),a.items(this._items),a.itemHeight(this._itemHeight),a.itemCountPerPage(this._maxDropDownItems),a.editable(this._editable),c=a.getComboBox(),Object.defineProperty(c,"comboBox",{value:a,writable:!1}),null},getEditorValue:function(a,c){var h=d(a);return h&&(this.DF=!h.HK),h&&h.editorValue()},setEditorValue:function(a,c,h){(a=d(a))&&a.editorValue(c)},focus:function(a,c){var h=d(a);h&&h.focus()},selectAll:function(a,c){var h=d(a);h&&h.selectAll()},activateEditor:function(a,c,h,m){var g=m.sheet,f=d(a);f&&(f.editorValueType(this._editorValueType),f.items(this._items),f.itemHeight(this._itemHeight),f.itemCountPerPage(this._maxDropDownItems),f.editable(this._editable),f.bind(G,function(a,c){var d,k,h;if(h=c.keyCode){if(d=g.wu(),k=d.getShortcutKey(h,!1,!1,!1,!1),h=d.getCommands(k))for(d=0,k=h.length;d=f&&(this.HK=!1)}else if(2===h){for(h=0;h=f&&(c=a,this.HK=!1)}return n(a)&&(c=""),c},QK:function(a){var c,d,h=this._items,g=h.length;c=this._editorValueType;var f=a;if(1===c)for(d=0;d=g&&(d=-1)}else d=-1;this.hL(d)},SK:function(){m(this.PK).removeAttr("title")},TK:function(){var a=this.Xn(this._text),c=m(this.PK),d=c.width();a>d+I?c.attr("title",this._text):c.removeAttr("title")},VK:function(a,c,d,h){d-=H;h-=2*H;m(this.PK).css("left",a).css("top",c).css("width",d-I).css("height",h-L)},updateImeMode:function(a,c){if(this.isImeAware()){var h=d(a);h&&h.PK&&m(h.PK).css("ime-mode",c)}},editable:function(a){var c,d,h,g,f,k,l,n,q;0===arguments.length?c=this._editable:this._editable!==a?(this._editable=a,n=this.KK.firstChild,q=this.PK,d=m(q),g=y(d.css("left")),f=y(d.css("top")),k=y(d.css("width")),l=y(d.css("height")),c=d.css("background-color"),d=d.css("color"),h=q.style.font,n.removeChild(q),q=this.PK=a?this.NK:this.MK,n.appendChild(q),c=(m(this.PK).css("background-color",c).css("color",d).css("font",h),this.VK(g,f,k,l),this)):c=void 0;return c},text:function(a){var c=this.PK;return 0===arguments.length?this._text:void(a!==this._text&&(this._text=a,this._editable?c.value=a:c.textContent=a))},focus:function(){var a=this.PK;a.focus();this._editable&&(a.selectionStart=a.value.length)},selectAll:function(){this._editable&&this.PK.select()},XK:function(a,c,d,h){var g;d-=H;h-=2*H;g=this.Xs;m(this.WK).css("left",a).css("top",c).css("width",d).css("height",h);m(g).attr("width",d).attr("height",h);a=g.width;c=g.height;g=g.getContext("2d");g.beginPath();g.lineWidth=2;g.fillStyle="black";g.moveTo(a-K+4,(c-2)/2-2.5);g.lineTo(a-K+7,(c-2)/2+3.5);g.lineTo(a-K+10,(c-2)/2-2.5);g.fill()},showDropDownList:function(){var a=this,c=a.bL;a.ZK=!0;m(a.YK).bind("keydown",function(c){a.LK(c)}).show();a.iL=!1;a.jL();a.eL();a.iL&&(c.lB(m(a.aL.children).height()),c.ew(!1));a.kL("#1E90FF");a.lL(a.dL);a.focus()},closeDropDownList:function(){this.ZK=!1;m(this.YK).unbind("keydown").hide();this.kL("");this.focus()},UK:function(){this.ZK?this.closeDropDownList():this.showDropDownList()},listWidth:function(a){var c=m(this.YK);return 0===arguments.length?c.width():void(0d||c.getRowCount()<=d||(r=a?a.getColumnCount():c.getColumnCount(),0>h||r<=h))return k;if(a?(c.qia||(c.qia=a.nq().Hp()),l=c.qia[h],l&&(n=l.name)):c.HL&&(n=c.HL[h]),m)return w=G[m],p=l&&l.value,g=O(p)?p:F,w.getValue(f,g,n,d,h)}return k}function K(c){var m=F;return c&&(d&&c instanceof d?m=q:n.each(G,function(d,a){if(a.isDataSource(c))return m=d,!1})),m}function O(c){return c instanceof Function}function H(c,d,h){var a,m,l;if(c&&d)for(d=d.split("."),a=d.length,m=0;mc||this.getRowCount()<=c){h=k;break a}if(r=a?a.getColumnCount():this.getColumnCount(),0>d||r<=d){h=k;break a}a?(this.qia||(this.qia=a.nq().Hp()),l=this.qia[d],l&&(n=l.name)):this.HL&&(n=this.HL[d]);m&&(w=G[m],p=l&&l.value,g=O(p)?p:F,k=w.setValue(f,g,n,c,d,h))}h=k}return h},sL:function(){var c=G[this.CL];return c&&c.canAdd&&c.canAdd()},tL:function(){var c=G[this.CL];return c&&c.canInsert&&c.canInsert()},vL:function(){var c=G[this.CL];return c&&c.canRemove&&c.canRemove()},uL:function(c,d){var h,a,m=this.Ou;!m||c>this.getRowCount()||(h=this.CL,a=this.EL(),h&&h!==q&&(this.IL||(this.JL=!0,G[h].addItems(m,c,d,a),this.JL=!1)))},wL:function(c,d){var h=this.CL,a=this.getRowCount(),m=this.Ou;!m||c>=a||h&&h!==q&&(this.IL||(this.JL=!0,G[h].removeItems(m,c,d),this.JL=!1))},xL:function(c){return d&&(c||this.Ou)instanceof d},ad:function(c){this.Ou=F;this.CL="";this.HL=this.DL=F;this.AL=[];this.BL=[];this.qia=F;var d=(this.kj=c)&&c.wq;d&&d.xL()&&c.Wq(C.ResetBinding,{sheet:c})},FL:function(c){var d,h,a,l=this.kj;if(l&&!this.JL){if(c){this.IL=!0;if(a=!isNaN(c.length)){l.setRowCountCore(c.length);if(c=z(this.HL)&&0===l.nq().Hp().length)c=(this.HL=F,l.setColumnCount(this.getColumnCount()),d=l.nq(),h=this.rL());a=c}if(a)for(c=0,a=h.length;c=G&&0>=q)return D;A=Q(0,l.rowStart);r=Q(0,l.columnStart);n=l.rowEnd;w=l.columnEnd;z=0<(8&F);(0>n||!z)&&(n=G-1);(0>w||!z)&&(w=q-1);G=l.findBeginRow;q=l.findBeginColumn;G=0>G?A:G;for(q=0>q?r:q;0<=G&&0<=q;){if(C=this.getCell(G,q,u),0<(1&L)&&(c=C.text(),""!==c&&d(c,I,F)&&(D.searchFoundFlag|=1,D.foundString=c)),J.X3&&0<(8&L)&&(c=C.formula(),"string"===typeof c&&""!==c&&d(c,I,F)&&(D.searchFoundFlag|=8,D.foundString=c)),0<(4&L)&&(c=C.tag(),"string"===typeof c&&""!==c&&d(c,I,F)&&(D.searchFoundFlag|=4,D.foundString=c)),0!==D.searchFoundFlag)return D.foundRowIndex=G,D.foundColumnIndex=q,D;var h=null,a=G+1,B=q+1;if(m=(0===l.searchOrder?0<=B&&B<=w?h={r:G,c:B}:0<=a&&a<=n&&(h={r:a,c:z?r:0}):a<=n?h={r:a,c:q}:B<=w&&(h={r:z?A:0,c:B}),h),!m)break;G=m.r;q=m.c}return D};J.Workbook.prototype.search=function(d){var l,u,J,F,G,q;if(!d)return null;if(l=this.getSheetCount(),u=new K.SearchResult,!d.searchString||0===d.searchTarget||0>=l)return u;if(-1===d.startSheetIndex&&(d.startSheetIndex=0),-1===d.endSheetIndex&&(d.endSheetIndex=l-1),G=d.startSheetIndex,q=d.endSheetIndex,q>=G&&0<=G&&G=a?a-1:d}function K(c,d,h,a,l){if(dl)return l;for(;d<=l;d++)if(h.call(c,d))return d;return-1}function O(c){var m,h,a,l,n,q=!1;if(c?this.canExecute():this.canUndo())if(m=this.kj,h=this.VQ,a=d(this),l=h.collapsed,n=h.index,m&&a&&!C(l)&&!C(n)&&!C(h.level)){this.Lz(m,!0);c||(l=!l);a.setCollapsed(n,l);c=l;a=this.ML;var r,w,p,g,f,k,x,z,u,A,D,e,b;l=this.kj;n=h.index;q=a?l.getRowCount():l.getColumnCount();0>n||n>=q||(r=d(this),w=1===r.direction(),p=a?l.frozenRowCount():l.frozenColumnCount(),g=a?l.getRowHeight:l.getColumnWidth,f=a?l.getViewportTopRow:l.getViewportLeftColumn,k=a?l.getViewportHeight:l.getViewportWidth,x=f.call(l,1),D=r.find(w?n-1:n+1,h.level),D&&(e=w?D.start:n,b=w?n:D.end,w?(c?e=n:ez&&(x=Q(l,x,u-z,q,g)),A=K(l,x,g,p,q-1)):(c?b=n:b>=q&&(b=q-1),ez&&(x=Q(l,x,u-z,q,g),A=K(l,x,g,p,q-1)))),a&&void 0!==A?(l.lq=A,l.os()):a||void 0===A||(l.qq=A,l.qs())));this.Mz(m,!0);q=!0}return q}var H,I,L,F,G,q,D,A,r;u=l(26);var n=l(85),w=n.Commands;l=w.ActionBase;var z=n.GC$,C=u.j.Fa;u=function(c){function d(d,a,m){c.call(this);this.kj=d;this.VQ=a;this.ML=m}z.inherit(d,c);return z.extend(d.prototype,{execute:function(){return J.call(this,!0)},undo:function(){return J.call(this,!1)}}),d}(l);H=function(c){function d(d,a){c.call(this,d,a,!1)}z.inherit(d,c);return d}(u);I=function(c){function d(d,a){c.call(this,d,a,!0)}z.inherit(d,c);return d}(u);u=function(c){function m(d,a,m){c.call(this);this.kj=d;this.VQ=a;this.ML=m}z.inherit(m,c);return z.extend(m.prototype,{execute:function(){var c,a,m,l=this.kj,n=!1;return this.canExecute()&&(c=this.VQ.index,a=this.VQ.count,m=d(this),l&&m&&!C(c)&&!C(a)&&((0<=m.getLevel(c)||0<=m.getLevel(c+a-1))&&(this.Lz(l,!0),m.ungroupRange(c,a),this.Mz(l,!0)),n=!0)),n},undo:function(){var c,a,m,l=!1,n=this.kj;return this.canUndo()&&(c=this.VQ.index,a=this.VQ.count,m=d(this),n&&m&&!C(c)&&!C(a)&&(this.Lz(n,!0),m.group(c,a),this.Mz(n,!0),l=!0)),l}}),m}(l);L=function(c){function d(d,a){c.call(this,d,a,!1)}z.inherit(d,c);return d}(u);F=function(c){function d(d,a){c.call(this,d,a,!0)}z.inherit(d,c);return d}(u);u=function(c){function d(d,a,m){c.call(this);this.kj=d;this.VQ=a;this.ML=m}z.inherit(d,c);return z.extend(d.prototype,{execute:function(){return O.call(this,!0)},undo:function(){return O.call(this,!1)}}),d}(l);G=function(c){function d(d,a){c.call(this,d,a,!1)}z.inherit(d,c);return d}(u);q=function(c){function d(d,a){c.call(this,d,a,!0)}z.inherit(d,c);return d}(u);l=function(c){function m(d,a,m){c.call(this);this.kj=d;this.VQ=a;this.ML=m}z.inherit(m,c);return z.extend(m.prototype,{execute:function(){var c,a,m,l=this.kj;c=!1;if(this.canExecute()&&(a=this.VQ.level,m=d(this),l&&m&&!C(a))){this.Lz(l,!0);this.saveState();for(c=0;c=f;f++)if(e=a[f].XL(b,c,d))return{what:d?"rg":"cg",info:e};return null}function Q(a,b,c){a=[new w(a,b,0,c),new w(a,b,1,c),new w(a,b,2,c)];for(b=0;2>=b;b++)a[b].YL();return a}function K(a,b){return y(0,((b?a.width:a.height)-2*this.PADDING)/(this.ZL+2))}function O(a,b){return a?b.rowOutlines:b.columnOutlines}function H(a,b,c){var e,f,d,g;if(0=a.V3&&0c&&(f=I(a,b,c+1),b=f.index,d.addChild(f.g)),b>d.end&&(d.end=b),!a.isGroupEnd(b,c)));b++);if(d)for(a=d.end+1,c=d.start;cc))break;b=b.parent}return null}function G(a,b){switch(a){case "head":case "tail":return null===b;case "direction":return 1===b;case "itemsData":return 0===x(b);default:return!1}}function q(a){a.Uia=null;a.refresh()}function D(a){a.Sia||(a.Uia=a.createRangeGroup(),a.groupChangeHandler&&a.groupChangeHandler(void 0))}function A(a){a.Sia&&!a.Uia&&(a.Uia=a.createRangeGroup())}function r(a,b){if(!L(a,b))throw Error(Z().Exp_InvalidIndex);}function n(a){return{level:a?a.level:0,collapsed:!!a&&a.collapsed,viewCollapsed:!!a&&a.viewCollapsed}}function w(a,b,c,f){this.LINE_SIZE=this.PADDING=2;this.START_LINE_SIZE=6;this.bM=[];this.cM=[];this.dM=[];this.kj=a;this.ML=b;this.eM=c;this.ZL=W(f)?f:O(b,a).getMaxLevel()}function z(a,b,c){this.PADDING=2;this.kj=a;this.ML=b;this.ZL=W(c)?c:O(b,a).getMaxLevel()}var C,c,m=l(26),h=l(85),a=l(98),B={},y=Math.max,t=Math.min,E=h.GC$,M=E.each,p=h.Im.Lm,g=h.Rect;u=m.k;var f=u._b,k=u.$b,x=u.ac,W=h.Ul.Ol,P=m.j.Fa,V=h.Ul.Pl,Z=function(){return m.C(B.SR)()};u={Gt:function(){var a,b,c,f,d,g=this.TL;return g?g:(a={x:0,y:0,width:0,height:0,rowMaxLevel:-1,colMaxLevel:-1},b=this.rowOutlines,c=this.columnOutlines,f=t(17,17*this._zoomFactor),this.showRowOutline()&&b&&!b.iT()&&(d=b.getMaxLevel(),0<=d&&(a.width=f*(d+2)+4,a.rowMaxLevel=d)),this.showColumnOutline()&&c&&!c.iT()&&(d=c.getMaxLevel(),0<=d&&(a.height=f*(d+2)+4,a.colMaxLevel=d)),this.TL=a)},showRowOutline:V("showRowOutline",!0,function(){this.$p()}),showColumnOutline:V("showColumnOutline",!0,function(){this.$p()})};E.extend(h.Worksheet.prototype,u);h.Worksheet.$n("rangegroup",{init:function(){var a=this;a.rowOutlines=new c(a.getRowCount());a.columnOutlines=new c(a.getColumnCount());a.rowOutlines.groupChangeHandler=function(b){b&&b.indexes&&a.recalcRows&&a.recalcRows(b.indexes);a.au()};a.columnOutlines.groupChangeHandler=function(){a.bu()};a.Wr.push(a.rowOutlines);a.Zr.push(a.columnOutlines)},dispose:function(){E(this.Ws()).unbind("mousedown.group")},setHost:function(a){if(a){var b=this;a.bind("mousedown.group",function(a){var e,c=b.Vs();(a=J.call(b,a.pageX-c.left,a.pageY-c.top))&&(e=a.what,"rg"===e||"rgh"===e?b.rowOutlines.UL(b,a):"cg"!==e&&"cgh"!==e||b.columnOutlines.UL(b,a))})}},onPaintSuspend:function(a){a.suspend?(this.rowOutlines.Pia(),this.columnOutlines.Pia()):(this.rowOutlines.Ria(),this.columnOutlines.Ria())},onLayoutChanged:function(a){var b=a.changeType,e=a.row,c=a.rowCount,f=a.col,d=a.colCount;a=a.sheetArea;var g=this.rowOutlines,k=this.columnOutlines;"addRows"===b?H(g,e,c):"deleteRows"===b?0a)throw Error(Z().Exp_InvalidLevel);b=this.items;A(this);f=0;for(d=b.length;fa?(b=this.head,b||(b=this.head=new n)):aa&&(a=e))}),a},cB:function(a,e,c,d){if(!(0>=c||a===e)){0>a&&(a=0);0>e&&(e=0);for(var b=[],g=this.items,h=f(g,a-1),m;0<=h&&he&&(e=0),0>c&&(c=0),b=[],a)for(h=f(a.items,e-1);0<=h&&hc)e.splice(a,-c);else if(a=e[b-1])for(b=0;bf?this.head:fa?(this.head||(this.head=new n),this.head.level=e):a=b;b++)c[b].aM(e);e.beginPath();e.restore()}},UL:function(a,e){if(e){var b=e.what;if("rgh"===b||"cgh"===b){var c,f,g;a.isEditing&&a.isEditing()||(b=e.info.index,f=(c="rgh"===e.what)?"expandRowOutlineForLevel":"expandColumnOutlineForLevel",g=d(a,c,-1,b,!0),a.Wq(h.Events.RangeGroupStateChanging,g),g&&!1===g.cancel&&(a.wu().execute({cmd:f,sheetName:a.name(),level:b}),b=d(a,c,-1,b,!1),a.Wq(h.Events.RangeGroupStateChanged,b)))}else if("rg"===b||"cg"===b){var k,m,p="rg"===e.what;O(p,a)&&(b=e.info,f=c=b.index,g=b.level,m=p?"expandRowOutline":"expandColumnOutline",1===b.lineDirection?c--:c++,k=d(a,p,c,g,!0),a.Wq(h.Events.RangeGroupStateChanging,k),k&&!1===k.cancel&&(a.wu().execute({cmd:m,sheetName:a.name(),index:f,level:g,collapsed:b.isExpanded}),b=d(a,p,c,g,!1),a.Wq(h.Events.RangeGroupStateChanged,b)))}}},iT:function(){return this.wz},fromJSON:function(a){var b,e,c,f,d,g,k,h,m;if(a)for(b=this,e=b.items,c=a.itemsData,f=a.direction,d=a.head,a=a.tail,m=[],M(c,function(a,c){if(g=c.index,k=c.info,0<=g&&k){for(h=0;h=x(e));h++)c.info.collapsed&&m.push(c),e[g+h]=new n(k);b.wz=!1}}),P(f)||b.direction(f),d&&(b.head=d),a&&(b.tail=a),q(b),c=0;c=A){f=y(A,E);b=t(C,D);e&&(d={start:f,end:b,level:w,startLine:null},(u&&f===E||B&&b===D)&&(d.startLine=!0),r.bM.push(d));k=[];e=a.children;for(a=f;a<=b;a++)k.push(!1);M(e,function(a,b){var e=b.start,c=b.end,d;if(1===b.state())for(g=e;g<=c;g++)k[g-f]=!0;u?d=c+1:B&&(d=c-1);k[d-f]=!0;r.gM(b)});d=!0;for(a=0;a=f&&c<=d&&(b.index=c,b.lineDirection=g,this.dM.push(b))},jM:function(a){var b=this.kj,e=this.eM;return this.ML?b.Gr(e).findRow(a):b.Hr(e).findCol(a)},aM:function(a){var b,e,c,f,d,g,k;-1!==this.ZL&&(b=this.kj.Gt(),e=this.ML,c=K.call(this,b,e),c&&(f=this.START_LINE_SIZE,d=this.PADDING,g=this.LINE_SIZE,k=y(0,(c-f)/2)+d,a.save(),a.fillStyle=p("gc-group").color,this.kM(a,this.cM,e,b,c,k,g),this.lM(a,this.bM,e,b,c,k,g,f),this.mM(a,this.dM,e,b,c,k,g,d),a.beginPath(),a.restore()))},kM:function(a,b,c,f,d,g,k){var e,h,m=this;M(b,function(b,p){var l,n,q=m.jM(p.index);q&&(l=c?q.y:q.x,n=(c?q.height:q.width)-k,0<=n&&(e=l+y(0,n/2),h=p.level*d+g,c?e=[h,h=e][0]+.5:h+=.5,a.fillRect(f.x+e,f.y+h,k,k)))})},lM:function(a,b,c,f,d,g,k,h){var e,m,p,l,n,q,v,r,w,z,u,B=O(c,this.kj).direction();for(e=0;e=p);(n||q)&&(!n&&q?n=q:n&&!q&&(q=n),v=c?n.y:n.x,r=m.level*d+g,w=c?k:y(0,q.x+q.width-n.x),z=c?y(0,q.y+q.height-n.y):k,1===B&&(v+=1),c?v=[r,r=v][0]+.5:r+=.5,a.fillRect(f.x+v,f.y+r,w,z),m.startLine&&(u=t(h,d-k),0=n.y&&r=n.x&&v=n||(q=y(0,(n-d)/2),w=(c?l.y:l.x)+q,z=m.level*d+h,u=t(d,n),B=d,E=n-u,c?(w=[z,z=w][0],u=[B,B=u][0],A=.5,C=0):(A=0,C=.5),a.strokeStyle=p("gc-group-box").borderTopColor,a.lineWidth=1,a.fillStyle=p("gc-group-box").backgroundColor,a.fillRect(f.x+w,f.y+z,u,B),v=f.x+w+A,r=f.y+z+C,a.strokeRect(v,r,u,B),a.fillStyle=p("gc-group").color,this.nM(a,m.isExpanded,v,r,u,B),m.paintLine&&0this.ZL||(e=this.kj,f=e.Gt(),d=K.call(this,f,c),!d))return null;e=this.dM;for(m=0;m=k)&&(v=t(d,k),r=d,w=(c?q.y:q.x)+y(0,(k-d)/2),z=n,c&&(v=[r,r=v][0],w=[z,z=w][0]),h=new g(f.x+w+.5,f.y+z+.5,v,r),this.oM(h),h.contains(a,b))))return p;return null}};z.prototype={_L:function(a){var b,e,c,f,d,g,k,h,m,l,n,q,t,x,r,w,z,u,B,A,C,E=this.kj,D=this.ZL;if(!(0>D)&&(b=this.ML,e=E.Gt(),c=K.call(this,e,b),c&&(f=D+2,d=this.PADDING,g=E.options,k=e.width,h=e.height,m=e.x,l=e.y,n=E.am(),q=n.width,t=n.height,x=n.Cr,r=n.Br,w=n.zr,z=n.Ar,a.fillStyle=p("gc-group").backgroundColor,a.strokeStyle=p("gc-group-box").borderTopColor,a.font="8.25pt Arial",a.lineWidth=1,a.fillRect(m,l,b?k:q,b?t:h),a.strokeRect(m-.5,l-.5,b?k:q+1,b?t+1:h),b?a.strokeRect(m-.5,z-.5,k,x):a.strokeRect(w-.5,l-.5,r,h),u=(b?x:r)-c,A=y(0,(b?z:w)+u/2),C=d,b&&(A=[C,C=A][0]),B=b?g.colHeaderVisible:g.rowHeaderVisible,B&&0<=u)))for(e=0;ek?null:(e=k+2,f=g.am(),d=g.options,c?this.qM(g,a,b,c,d.colHeaderVisible,f.Cr,f.Ar,e):this.qM(g,a,b,c,d.rowHeaderVisible,f.Br,f.zr,e))},qM:function(a,b,c,f,d,g,k,m){a=a.Gt();var e=K.call(this,a,f);g-=e;var p;if(e&&d&&0<=g)for(d=y(0,k+g/2),k=this.PADDING,f&&(d=[k,k=d][0]),g=0;gva(e)&&13>va(c)&&Na(e*e+c*c)Ga?e-=2*Ga:e<-Ga&&(e+=2*Ga),e}function H(a,b){return Na((b.X-a.X)*(b.X-a.X)+(b.Y-a.Y)*(b.Y-a.Y))}function I(){this.BN=this.AN=0;this.CN=1;this._process=this.EN=this.DN=0;this.FN=511;this.GN=new z;this.HN=20;this.IN=new q}function L(){}function F(a,b){this.X=a;this.Y=b}function G(a){return new F(a?bb(a.X):-1,a?bb(a.Y):-1)}function q(){this.oI=this.Jb=0;this.pP=10;this.qP=[]}function D(a,b,e,c,f){a?this.qP=a:(this.xP=new F(b,e),this.yP=c,this.lO=f)}function A(a){this.zP=a;this.AP=0}function r(a){this.zP=a;this.AP=0}function n(a,b){this.BP=a;this.CP=b;this.AP=this.VO=this.UO=0;this.DP=Na(a*a+b*b)}function w(){this.sO=new F(0,0);this.pO=this.qO=this.rO=0}function z(){this.FP=[]}function C(a,b,e){this.dP=a;this.fP=b;this.eP=e}function c(a,b,e,c,f){this.GP=a;this.dP=b;this.gP=e;this.rN=c;this.eP=f}function m(a,b,e,c,f,d){this.GP=a;this.dP=b;this.fP=e;this.gP=c;this.rN=f;this.eP=d}function h(a,b,e,c,f,d,g){this.GP=a;this.dP=b;this.fP=e;this.eP=c;this.QO=f;this.RO=d;this.TO=g}function a(a,b,e,c){this.GP=a;this.HP=b;this.dP=e;this.rN=c}function B(a,b,e,c){this.GP=a;this.DO=b;this.GO=e;this.rN=c}function y(a){this.rN=a}function t(a){this.rN=a}function E(a){this.rN=a}function M(a,b){var e=a*b;return 4e&&(e=.5),e}function p(a){this.kj=a}function g(a,b,e,c,f,d){a.fillStyle=b;a.fillRect(e,c,f,d)}function f(a,b,e,c,f,d){a.beginPath();a.strokeStyle=b;a.moveTo(e,c);a.lineTo(f,d);a.stroke()}function k(a,b){var e=0;return a||(e|=1),b||(e|=2),e}function x(a){this.kj=a}function W(a,b,e,c){var f,d,g,k,h,m,p,l,n=!1,q=a.Uq;f=0;for(d=q.length;fa.x||0>a.y)&&(M[n]=null);return M}var ga={},T=l(26);u=l(85);var fa=T.j.Fa,Fa=u.Go,aa=u.GC$;l=aa.extend;var xa=aa.isEmptyObject,Ia=aa.inherit,la=u.Ul,pa=la.Nl,qa=u.Im,ba=u.Rect,ra=u.Vl,ya=u.En,sa=u.kf,ia=u.Events,Ka=u.zp,wa=u.yp,Aa=la.nl,Va=la.Ml.mozilla,$a=la.rl(),Da=$a.ipad||$a.iphone,va=Math.abs,Ra=Math.min,jb=Math.max,Ta=Math.pow,ib=Math.atan2,Ga=Math.PI,bb=Math.round,Na=Math.sqrt,Ya=Math.atan,ta=Math.log,fb=Math.floor,ua=isNaN,Ha=parseInt,na=parseFloat,gb=window,Za=gb.navigator,cb=document,La=gb.Yl,da=u.Bn;l(K.prototype,{vM:function(a){this.tM.vM=a},wM:function(a){this.tM.wM=a},xM:function(a){var b=this;b.tM.xM=function(e){a&&(a(e),(e=b.yM)&&e.zM())}},AM:function(a){this.tM.AM=a},BM:function(a){this.tM.BM=a},CM:function(a){this.uM.CM=a},DM:function(a){this.uM.DM=a},EM:function(a){this.uM.EM=a},FM:function(a){this.GM=a},HM:function(a){this.IM=a},JM:function(a,b){return la.Z3(a,b?b.KM:this.LM.KM)},MM:function(a,b){var e,c,f,d,g,k,h=b.pointerType,m=b.target,p=b.offsetX,l=b.offsetY;h!==b.MSPOINTER_TYPE_TOUCH&&"touch"!==h||(e=this.JM(m,a),c=e.EB,f=e.FB,d=this.NM(a,m,b.pointerId,new F(p+c,l+f),b.timeStamp),d&&Aa(b),"sheet"===this.LM.OM&&(g=b.pageX-(p+c),k=b.pageY-(l+f),La.canvasOffset={top:k,left:g}))},PM:function(a){var b,e;b=a.pointerType;e=a.pointerId;if(b===a.MSPOINTER_TYPE_TOUCH||"touch"===b){if(void 0===this.sM[e])return!1;b=this.JM(a.target);(e=this.aB(e,new F(a.offsetX+b.EB,a.offsetY+b.FB),a.timeStamp))&&Aa(a)}},QM:function(a){var b,e;b=a.pointerType;e=a.pointerId;if(b===a.MSPOINTER_TYPE_TOUCH||"touch"===b){if(void 0===this.sM[e])return!1;b=this.JM(a.target);(e=this.RM(e,new F(a.offsetX+b.EB,a.offsetY+b.FB)))&&Aa(a)}},SM:function(a){var b,e;b=a.pointerType;e=a.pointerId;if(b===a.MSPOINTER_TYPE_TOUCH||"touch"===b){if(void 0===this.sM[e])return!1;b=this.JM(a.target);(e=this.TM(e,new F(a.offsetX+b.EB,a.offsetY+b.FB)))&&Aa(a)}},UM:function(a,b){var e,c,f,d=Q(a.KM),g=b.changedTouches,k=!1;for(e=0;e=this.ZM.mN||(!this.yM||!this.yM.nN())&&(this.YM(c),this.yM&&0===this.sM.length&&this.yM.oN(),this.sM[e]={id:e,time:J(),position:c},this.sM.length++,this.tM.pN(b,e,c,f),this.tM.qN(e,c,this.sM.length,f),1===this.sM.length&&this.uM.qN(c),1===this.sM.length&&this.GM&&this.GM({rN:c}),!0))},aB:function(a,b,e){return void 0!==this.sM[a]&&(!this.yM||!this.yM.sN())&&(this.YM(b),this.sM[a]={id:a,time:J(),position:b},this.tM.tN(a,b,e),!0)},RM:function(a,b){return void 0!==this.sM[a]&&(delete this.sM[a],this.sM.length--,(!this.yM||!this.yM.uN())&&(this.YM(b),this.tM.vN(a),this.tM.wN(a),0===this.sM.length&&(this.uM.vN(b),this.uM.wN(b)),0===this.sM.length&&this.IM&&this.IM({rN:b}),this.yM&&0===this.sM.length&&0===this.tM._process&&this.yM.zM(),!0))},TM:function(a,b){return this.RM(a,b)},xN:function(a,b){function e(){aa(cb).unbind(q).unbind(r).unbind(t).unbind(y).unbind(v).unbind(z).unbind(x).unbind(w)}function c(b){aa(cb).bind(q,f).bind(t,d).bind(r,f).bind(y,d).bind(v,g).bind(x,g).bind(w,g).bind(z,g);n.MM(a,b)}function f(a){n.PM(a)}function d(a){n.QM(a);0===n.sM.length&&e()}function g(a){n.SM(a);0===n.sM.length&&e()}var k,h,m,p,l,n=this;k="."+a.OM;var q="MSPointerMove.gcSheet"+k,t="MSPointerUp.gcSheet"+k,v="MSPointerCancel.gcSheet"+k,x="MSLostPointerCapture.gcSheet"+k,r="pointermove.gcSheet"+k,y="pointerup.gcSheet"+k,w="LostPointerCapture.gcSheet"+k,z="pointercancel.gcSheet"+k;k=a.KM;h=n.rM;m=T.k.Cb(h,a);0<=m&&b||0>m&&!b||(p=Za.msPointerEnabled||Za.pointerEnabled,b?p?(l=k.style,fa(l.msTouchAction)||(l.msTouchAction="none"),fa(l.touchAction)||(l.touchAction="none"),aa(k).bind("MSPointerDown.gcSheet",c).bind("pointerdown.gcSheet",c)):(aa(k).bind("touchstart.gcSheet",function(b){n.UM(a,b)}),aa(k).bind("touchmove.gcSheet",function(a){n.VM(a)}).bind("touchend.gcSheet",function(a){n.WM(a)}).bind("touchcancel.gcSheet",function(a){n.XM(a)})):p?aa(k).unbind("MSPointerDown.gcSheet").unbind("pointerdown.gcSheet"):aa(k).unbind("touchstart.gcSheet").unbind("touchmove.gcSheet").unbind("touchend.gcSheet").unbind("touchcancel.gcSheet"),b?h.push(a):h.splice(m,1))},no:function(){var a,b=this.rM;for(a=b.length-1;0<=a;a--)this.xN(b[a],!1)}});l(I.prototype,{pN:function(a,b,e,c){3===this._process&&this.JN(!0);this.KN=2===this._process&&1===this.GN.MN();this.NN=a;a={};a.Np=b;a.ON=e;a.PN=e;this.GN.QN(a);this.RN=c;1e-this.RN)){if(this.GN.$N(a).aO=b,d=this.GN.MN(),1d&&(c=!0)),0===a?f=!0:(d=Ya(b/a)/Ga*180,75d&&(f=!0)),{yN:c,zN:f});this.SN=e.yN;this.TN=e.zN},gO:function(){var a=0,b=0,e=this.xO(),c=e.yO,e=e.zO,f=new F(c.X,c.Y);return a=c.X-e.X,b=c.Y-e.Y,{hO:a,iO:b,SH:f}},jO:function(){var a,b=0,e=1,c=0;if(this.ZN(16)&&1===this.GN.MN()&&this.YN())var f=this.GN.WN(0).aO,d=this.GN.WN(0).ON,g=this.AO,k=new F(g._Center.X,g._Center.Y),b=new F(d.X-k.X,d.Y-k.Y),f=new F(f.X-k.X,f.Y-k.Y),d=Ra(1,Ta(H(d,k)/g._Radius,4)),b=O(b,f),b=ua(b)?0:b*d;return 1=this.HN&&b>=this.HN&&(x++,r+=b,y+=f,(!p||c>=this.HN)&&e>=this.HN&&(k=O(d,g),n+=k,v++));return 0=c.PO.UO&&0>=c.PO.VO&&c.PO.WO(.003),0>=c.QO.XO()&&c.QO.WO(.002),0>=c.RO.XO()&&c.RO.WO(.003),b=J(),c.YO=b,c.ZO=b,c.$O=0,c._O=0,e._process=3,void(e.HO=setInterval(function(){try{e.aP(c)}catch(pb){}},20)))},aP:function(a){var b,e,c,f,d,g,k,h,p,l,n,q,t,v=J(),x=v-a.ZO;if(0!==x){if(b=a.JO,e=a.LO,c=a.MO,f=a.NO,a.JO=this.bP(x,a.PO.UO,a.JO),a.LO=this.bP(x,a.PO.VO,a.LO),a.MO=this.bP(x,a.QO.XO(),a.MO),a.NO=this.bP(x,a.RO.XO(),a.NO),b=(b+a.JO)/2,e=(e+a.LO)/2,c=(c+a.MO)/2,f=(f+a.NO)/2,a.ZO=v,d=!1,2.220446049250313E-16>=va(b)&&2.220446049250313E-16>=va(e)&&2.220446049250313E-16>=va(c)&&2.220446049250313E-16>=va(f)&&(d=!0),g=x*b,k=x*e,h=x*c,p=x*f,l=1,0this.CO+2*h&&(h=-this.CO/2+1),0!==this.CO&&(l=(this.CO+2*h)/this.CO)),this.EN+=h,this.DN+=p,this.AN+=g,this.BN+=k,this.CN*=l,this.CO+=h,this.oO=new F(this.oO.X+g,this.oO.Y+k),a.$O+=g,a._O+=k,d){if(g=bb(a.$O),k=bb(a._O),2.220446049250313E-16>=va(g)&&2.220446049250313E-16>=va(k))return void this.JN(!0)}else 1<=va(a.$O)&&(g=a.$O,a.$O-=g),1<=va(a._O)&&(k=a._O,a._O-=k);return n=new w,n.sO=new F(g,k),n.rO=l,n.pO=h,n.qO=p,q=new D(null,a.JO,a.LO,a.NO,a.MO),t=new m(this.NN,this.tO(),n,!0,G(this.oO),q),this.uO(t),t.vO?void this.JN(!0):void(d&&this.JN(!0))}},bP:function(a,b,e){if(2.220446049250313E-16>=va(e))return 0;var c;return c=0>e?e+b*a:e-b*a,(0>c&&0e)&&(c=0),c},tO:function(){var a=new w;return a.pO=this.EN,a.qO=this.DN,a.rO=this.CN,a.sO=new F(this.AN,this.BN),a},cP:function(a,b,e,c){var f,d=new w,g=new w,k=0,h=0,m=0,p=0,l=this.ZN(4)&&this.SN,n=this.ZN(8)&&this.TN;return!this.ZN(1)||n||a&&!this.ZN(64)||(d.sO.X=b.sO.X,g.sO.X=e.sO.X,k=c.KO().X),!this.ZN(2)||l||a&&!this.ZN(64)||(d.sO.Y=b.sO.Y,g.sO.Y=e.sO.Y,h=c.KO().Y),!this.ZN(32)||a&&!this.ZN(256)?(d.rO=b.rO,g.rO=1):(d.rO=b.rO,d.pO=b.pO,g.rO=e.rO,g.pO=e.pO,p=c.pO()),!this.ZN(16)||a&&!this.ZN(128)||(d.qO=b.qO,g.qO=e.qO,m=c.OO()),f=new D(null,k,h,m,p),new C(d,g,f)},EO:function(a){this.vM&&a&&this.vM(a)},wO:function(a){this.wM&&a&&this.wM(a)},dO:function(a){var b;this.xM&&a&&(b=this.cP(!1,a.dP,a.dP,a.eP),a.dP=b.dP,a.eP=b.eP,this.xM(a))},SO:function(a){var b;this.AM&&a&&(b=this.cP(!1,a.dP,a.fP,a.eP),a.dP=b.dP,a.fP=b.fP,a.eP=b.eP,this.AM(a))},uO:function(a){var b;this.BM&&a&&(b=this.cP(a.gP,a.dP,a.fP,a.eP),a.dP=b.dP,a.fP=b.fP,a.eP=b.eP,this.BM(a))}});l(L.prototype,{qN:function(a){var b;this._pointerCount++;1b-this.iP?this.Jb++:(this.hP=a,this.Jb=1),this.jP=a,this.iP=b)},wN:function(){this.cO&&(this.cO instanceof y?this.kP(this.cO):this.cO instanceof t&&this.lP(this.cO),this.cO=null)},vN:function(a){var b;this._pointerCount--;0b&&(this.wP(),e--)},wP:function(){this.oI++;this.oI===this.pP&&(this.oI=0);this.Jb--},IO:function(){this.Jb=0},uP:function(a){return(this.oI+a)%this.pP}});l(D.prototype,{KO:function(){return this.xP||(this.xP=new F(this.qP.rP(0),this.qP.rP(1))),this.xP},OO:function(){return fa(this.yP)&&(this.yP=this.qP.rP(3)),this.yP},pO:function(){return fa(this.lO)&&(this.lO=this.qP.rP(2)),this.lO}});l(A.prototype,{XO:function(){var a=this._DesiredExpansion,b=this._DesiredDeceleration,e=this.zP;return ua(a)||0===a?ua(b)?this.AP:b:.5*e*e/a},WO:function(a){this.AP=a}});l(r.prototype,{XO:function(){var a=this._DesiredRotation,b=this._DesiredDeceleration,e=this.zP;return ua(a)||0===a?ua(b)?this.AP:b:.5*e*e/a},WO:function(a){this.AP=a}});l(n.prototype,{EP:function(){var a=this._DesiredDisplacement,b=this.DP,e=this.BP,c=this.CP,f=this.XO();ua(a)||0===a?ua(f)||0===f?(this.UO=0,this.VO=0):(this.UO=f*va(e)/b,this.VO=f*va(c)/b):(this.UO=.5*b*va(e)/a,this.VO=.5*b*va(c)/a)},XO:function(){var a=this._DesiredDeceleration;return ua(a)&&ua(this._DesiredDisplacement)?this.AP:a},WO:function(a){this.AP=a;this.EP()}});l(z.prototype,{XN:function(a){var b,e,c=this.FP;for(b=0;bz&&mf){z=w.ns();for(m=-(p.y+p.height-m);kf;)k++,m-=h.Sl(k);z=f-m}f=k;if(w.lq=f,0a)this.ZP=this.YP=0,(b=w.jt(1))&&0=f&&(l=2,n=k+va(a),q=Ra(k+h,v.y+v.height)-n,0<=q&&(q-=l,this.WP(z-t.height),e.x=m,e.y=n,e.width=p,e.height=q,e.tx=m,e.ty=k,c.x=m,c.y=k+q,c.width=p,c.height=h-q)));else if(0=a)return b;if(b&&20<=y)return!0}else{if(200<=z&&(a-=z-199,z=199,0>=a))return b;if(r=Ha(200*(-200/(z-200)-1)),y=z,b&&20<=y)return!0}this.YP=r;this.ZP=y}else this.ZP=this.YP=0;az&&mf){z=w.ps();for(m=-(p.x+p.width-m);kf;)k++,m-=h._m(k);z=f-m}f=k;if(w.qq=f,0a)this._P=this.$P=0,(b=w.it(1))&&0=f&&(l=2,n=k+va(a),q=Ra(k+h,r.x+r.width)-n,0<=q&&(q-=l,this.VP(z-x.width),e.x=n,e.y=m,e.width=q,e.height=p,e.tx=k,e.ty=m,c.x=k+q,c.y=m,c.width=h-q,c.height=p)));else if(0=a)return b;if(b&&20<=v)return!0}else{if(200<=z&&(a-=z-199,z=199,0>=a))return b;if(t=Ha(200*(-200/(z-200)-1)),v=z,b&&20<=v)return!0}this.$P=t;this._P=v}else this._P=this.$P=0;ae.rowViewportIndex?-1:d,0>e.colViewportIndex?-1:g)){if(x.wQ&&!a.BG&&r.touchToolStrip.rQ(),b=x.getActiveRowIndex(),h=x.getActiveColumnIndex(),m=e.cellTypeHitInfo){if(n=m.sheetArea,!fa(n)&&3!==n||d===b&&g===h)x.yl.DH();else{if((x.suspendPaint(),!x.endEdit())||(q={sheet:x,sheetName:x.Cj,row:b,col:h,cancel:!1},x.Wq(ia.LeaveCell,q),q&&!0===q.cancel))return;n=x.Uq.toArray();q=x.zl().get(d,g);q=[sa(q.row,q.col,q.rowCount,q.colCount)];x.yu(n,q);q=m.isReservedLocation&&m.isFocusAware;x.Sr(d,g,void 0,void 0,q?0:1);q={sheet:x,sheetName:x.Cj,row:d,col:g};x.Wq(ia.EnterCell,q);x.Wq(ia.FormulatextboxEnterCell,q);x.Au(n);x.Iia=!0;a.cs&&a.cs(d,g);x.resumePaint();y=!0}n=x.getCellType(m.row,m.col,f);m.sheet||(m.sheet=x);n.processMouseDown(m);n.processMouseUp(m)}if(m&&m.isReservedLocation)return!0;x.Wq(ia.CellClick,{sheet:x,sheetName:x.Cj,sheetArea:f,row:e.row,col:e.col});try{if(a.mG=e,x.isEditing()&&b===x.getActiveRowIndex()&&h===x.getActiveColumnIndex()&&!x.endEdit())return}finally{a.mG=null}fa(d)||fa(g)||(3===f&&a.cs&&a.cs(d,g),W(x,d,g,f)&&!y?v.xQ=setTimeout(function(){var a={x:e.x,y:e.y,handled:!1},b=r.touchToolStrip;x.Wq(ia.TouchToolStripOpening,a);a.handled||b.open(e.x,e.y-100);v.tQ()},420):(l=x.Uq.toArray(),a.ZG(e),t=x.Uq.toArray(),x.yu(l,t),a.hH()))}},yQ:function(a){var b,e,c,f,d,g=this.kj;a=a.rN;if(this.tQ(),c=g.yt,c&&(g.Wq(ia.CellDoubleClick,{sheet:g,sheetName:g.Cj,sheetArea:c.hitTestType,row:c.row,col:c.col}),f=c.resizeInfo))if("sizeRow"===f.action||"sizeHiddenRow"===f.action){if(d=[],g.tp(f.index))for(b=0;b=f&&0<=d&&(k=t.rr(f,d,void 0,c.row,c.col),k&&(c.row=k.row,c.col=k.col));c.hitTestType=t.sr(f,d);var x,v,r,y;k=t.parent;d=t.mm;g=t.options;var w=c.rowViewportIndex,z=c.colViewportIndex,u=t.getSelections();f=null;k=(t.CH&&0z&&g.rowHeaderVisible?(f=d.mH(t,c,10,2,b),!f||"sizeRow"!==f.action&&"sizeHiddenRow"!==f.action||2!==f.sheetArea||f.index===v||(f=null)):-1===x&&-1!==r&&0>w&&0<=z&&g.colHeaderVisible&&(f=d.oH(t,c,10,1,a),!f||"sizeCol"!==f.action&&"sizeHiddenCol"!==f.action||1!==f.sheetArea||f.index===y||(f=null)))),f);(m=(m=t.xr)&&m.hitTest(c,a,b))||(l=t.tables,n=l&&l.find(c.row,c.col),q=n&&n.xr,m=q&&q.hitTest(c,a,b));if(l=t.wQ){var B;a:{var A,C,E,D,F,M,G,P;h=null;n=c.rowViewportIndex;q=c.colViewportIndex;if(fa(n)||fa(q))B=h;else{if(l=t.parent,x=t.Ix(),0<=n&&0<=q&&1===t.Uq.length){if(B=t.Tq(x),A=t.frozenTrailingColumnCount(),C=t.frozenTrailingRowCount(),E=t.getColumnCount(void 0)-A,x=t.getRowCount(void 0)-C,1===q&&0E&&(D=t.Hr(q),D&&0F.x+F.width))){B=h;break a}if(1===n&&0x&&(M=t.Gr(n),M&&0G.y+G.height))){B=h;break a}}B=(P=ja(t),P&&(h||(P.x-=P.width,P.y-=P.height,P.width*=3,P.height*=3,P.contains(a,b)&&(h={action:"drag",side:"corner"})),l&&l.options.allowUserDragFill||h&&"corner"===h.side&&(h.side=null)),h)}}l=h=B}if(l)c.dragInfo=h;else if(k)c.resizeInfo=k;else if(m)c.filterButtonHitInfo=m;else{if(e=!e){var N;a:{var V,H,W;p=c.hitTestType;e=ea(t);B=t.getSelections();P=3;t.CH&&0a&&e.css("min-width",a+"px"),e.css("width",a+"px")),this)},separatorHeight:function(a){return 0===arguments.length?this.KQ:(0=b&&(a.wQ=!0,a.yl.im()))},rQ:function(){var a=this.OC.getActiveSheet();a&&(a.wQ=!1,a.yl.im())},_Q:function(){var a=this.OC.getActiveSheet();a&&(this.dR=a.ux(!0));this.close()},ZQ:function(){var a=this.OC.getActiveSheet();a&&(this.dR=a.sx(!0));this.close()},XQ:function(){var a=this.dR,b=this.OC.getActiveSheet();b&&(fa(a)||b.vx({pasteHtml:a.copyHtml,pasteText:a.copyText}));this.close()},eR:function(){aa("#"+this.WQ.Cj).find("span.gc-toolstrip-text").text(d().ToolStrip_PasteText);aa("#"+this.YQ.Cj).find("span.gc-toolstrip-text").text(d().ToolStrip_CutText);aa("#"+this.$Q.Cj).find("span.gc-toolstrip-text").text(d().ToolStrip_CopyText);aa("#"+this.aR.Cj).find("span.gc-toolstrip-text").text(d().ToolStrip_AutoFillText)}});ga.TouchToolStrip=Z;l(e.prototype,{name:function(a){return 0===arguments.length?this.Cj:(aa("#"+this.Cj).attr("id",a),aa("#"+this.Cj+"Text").attr("id",a+"Text"),aa("#"+this.Cj+"Image").attr("id",a+"Image"),this.Cj=a,this)},text:function(a){return 0===arguments.length?this._text:(this._text=a,aa("#"+this.name()+"Text").text(a),this)},font:function(a){var b=aa("#"+this.name()+"Text");return 0===arguments.length?this.MC:(this.MC=a,b.css("font",a),this)},foreColor:function(a){var b=aa("#"+this.name()+"Text");return 0===arguments.length?this._foreColor?this._foreColor:b.css("color"):(b.css("color",a),this)},image:function(a){return 0===arguments.length?this.fR:(this.fR=a,aa("#"+this.name()+"Image").css("background-image","url("+a+")"),this)},TQ:function(a,b,e,c){var f,d,g,k,h,m;f=this.name();d=this.font();g=this.text();k=aa(pa("span"));k.attr("id",f+"Image");k.addClass(a);k.css({"background-image":"url("+this.image()+")","background-repeat":"no-repeat",display:"block",height:b,"background-position-x":"50%"});a=aa(pa("span"));a.attr("id",f+"Text");a.addClass(e);a.css("font",d);a.text(g);var p;b=pa("span");var l=cb.body;e=(b.className=e,b.style.font=d,b.style.cssFloat="left",b.textContent=g,l.insertBefore(b,null),p=aa(b).width(),l.removeChild(b),p);return h=60,e>h&&(h=e),m=aa(pa("button")),m.attr("type","button"),m.attr("id",f),m.addClass(c+" gc-toolstrip-button-style ui-state-default ui-widget btn btn-default"),m.css({"box-sizing":"content-box",border:"0px",padding:"4px",margin:"3px",width:h+"px"}),m.append(k),m.append(a),m[0]}});ga.TouchToolStripItem=e;l(b.prototype,{name:function(){return this.Cj},TQ:function(a,b){var e=aa(pa("div"));return e.attr("id",this.name()),e.addClass(a),e.css({width:"1px",height:b,display:"inline-block;","background-color":"#CCC","margin-left":"5px","margin-right":"5px",opacity:.6}),e[0]}});ga.TouchToolStripSeparator=b;l(v.prototype,{oN:function(){this.gR=2;this.tc.CH=!0},zM:function(){this.gR=0;this.hR=J()},nN:function(){return 1===this.gR},uN:function(){return 1===this.gR},sN:function(){return 1===this.gR},GQ:function(){if(2===this.gR)return!0;if(this.hR){if(200>=J()-this.hR)return this.iR++,!0;this.iR=this.hR=0}this.gR=1;return this.tc.CH=!1,!1},HQ:function(){return this.iR?(this.iR--,!0):2===this.gR||(this.gR=0,!1)},IQ:function(){return 2===this.gR}});ga.jR=v;ga.kR=N;l(S.prototype,{lR:function(a,b){var e,c,f=a.touches,d=a.targetTouches,g=a.changedTouches;!1!==a.isPrimary&&(f&&1<=f.length&&d&&1<=d.length&&(f[0].clientX!==d[0].clientX||f[0].clientY!==d[0].clientY)||(Aa(a),e=fa(g)?a:g[0],c=cb.createEvent("MouseEvents"),c.initMouseEvent(b,!0,!0,gb,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(c)))},NM:function(a){var b,e=a.pointerType;e&&e!==a.MSPOINTER_TYPE_TOUCH&&"touch"!==e||(b=a.data,b.mR)||(b.mR=!0,b.nR=!1,b.lR(a,"mouseover"),b.lR(a,"mousemove"),b.lR(a,"mousedown"))},aB:function(a){var b,e=a.pointerType;if(!e||e===a.MSPOINTER_TYPE_TOUCH||"touch"===e)if(b=a.data,b.mR)b.nR=!0,b.lR(a,"mousemove")},RM:function(a){var b,e=a.pointerType;if(!e||e===a.MSPOINTER_TYPE_TOUCH||"touch"===e)if(b=a.data,b.mR)b.lR(a,"mouseup"),b.lR(a,"mouseout"),b.nR||b.lR(a,"click"),b.mR=!1},oR:function(a,b,e){var c,f,d,g,k,h,m,p,l,n;"."!==e.charAt(0)&&(e="."+e);c="MSPointerDown"+e;f="MSPointerMove"+e;d="MSPointerUp"+e;g="pointerdown"+e;k="pointermove"+e;h="pointerup"+e;m="touchstart"+e;p="touchmove"+e;e="touchend"+e;l=Za.msPointerEnabled||Za.pointerEnabled;b?l?(n=a.style,fa(n.msTouchAction)||(n.msTouchAction="none"),fa(n.touchAction)||(n.touchAction="none"),aa(a).bind(c,this,this.NM).bind(g,this,this.NM),aa(cb).bind(f,this,this.aB).bind(k,this,this.aB).bind(d,this,this.RM).bind(h,this,this.RM)):aa(a).bind(m,this,this.NM).bind(p,this,this.aB).bind(e,this,this.RM):l?(aa(a).unbind(c).unbind(g),aa(cb).unbind(f).unbind(k).unbind(d).unbind(h)):aa(a).unbind(m).unbind(p).unbind(e)}});ga.pR=S;l(X.prototype,{lQ:function(a){var b,e,c,f,d,g,k,h;a=a.rN;var m=this.hq;b=m.OC.getActiveSheet();m.FD&&m.GD(b,!1);b=m.hitTest(a.X,a.Y).element;"resizeBar"===b?(m.HD=!0,m.ID=a.X):"tab"!==b&&"newTab"!==b&&""!==b||(e=m.Xs,c=ya.Nn(e),f=ya.On(e),d=this.IP(c,f),g=d.getContext("2d"),k=ya.Ln(d),h=ya.Mn(d),da.Cn(g,1,1),g.drawImage(e,0,0,d.width,d.height,0,0,d.width,d.height),da.Cn(g,k,h),this.Xs=d,this.qR=m.gq,this.rR=m.VC(),this.sR=m.UC(),this.KC=m.TC(),m.SC=!0);this.tR=m.jw(-1);this.uR=m.rD(m.sD())},pQ:function(a){var b,e,c,f,d,g,k,h,m,p,l,n,q,t,x,v,r,y,w,z;d=a.rN.X;var u=this.hq;if(u.HD)b=d-u.ID,e=u.OC,c=e.options,f=e.xs.clientWidth,c.tabStripRatio=e.Iv()+b/f,b=u.kw/f,e.Iv()a&&c===g&&u.gq===g&&(p=0),0p+k?a=p+k:0>a&&aa&&(r=h,t=r+va(a),x=m-t,0=c&&!(g>a);)g+=e[d],d--;da&&-1!==f){for(;d<=f&&!(gf&&(d=f)}return{gq:d,Vo:g}}});l(Y.prototype,{EQ:function(){var a=this.BQ;a&&a.xN(this.DQ,!0)},FQ:function(){var a=this.BQ;a&&a.xN(this.DQ,!1)},GQ:function(a){return this.yM.GQ(a)},HQ:function(a){return this.yM.HQ(a)},IQ:function(a){return this.yM.IQ(a)}});u.oJ.prototype.DH=function(){var a=this.kj,b=a.getSelections(),e=b.length;0>=a.Xq&&0=k&&c>=f}function H(a,b){var e=this;return b||(b={}),Y.each(a,function(a,c){var f=e[c],d=f.call(e);f.isDefault(d)||(b[c]=d)}),b}function I(a,b){if(b){var e=this;Y.each(a,function(a,c){void 0!==b[c]&&e[c].call(e,b[c],!1)})}}function L(a){return function(b){var e=this.sheet();"content"===a&&(this.KR=!0);e&&e.$p();this.onPropertyChanged(a,b)}}function F(a){return function(b){var e=this.sheet();e&&(q(this),e.$p());this.onPropertyChanged(a,b)}}function G(a){return function(b){var e=this.sheet();e&&(h(this),e.$p());this.onPropertyChanged(a,b)}}function q(a){function b(b,e,c,f,g){var k=0,h=b.call(a);return k=e.call(a,d,0,h),D.call(a,b,c,f,!0,g),k+c.call(a)}var e,c,d=a.sheet();d&&(e=b(a.startRow,A,a.startRowOffset,d.getRowHeight,"startRowOffset"),c=b(a.startColumn,r,a.startColumnOffset,d.getColumnWidth,"startColumnOffset"),a.x()===c&&a.y()===e||(a.x(c,!1),a.y(e,!1),a.onPropertyChanged("location",new f(c,e,a.width(),a.height()))))}function D(a,b,e,c,f){var d=b.call(this);a=e.call(this.sheet(),a.call(this),3);e=this.LR;0a?(e[f]||(e[f]=d),b.call(this,a)):e[f]&&(e[f]c));b++);return f}function r(a,b,e,c){for(var f=0;bc));b++);return f}function n(a){function b(b,e,c,f,d){b=z(a,b,e);e=b.index;f.call(a,b.offset,!1);-1===b.offset&&(e+=1,f.call(a,0),e===d&&(e=d-1));c.call(a,e,!1)}var e=a.sheet();e&&(b(!0,a.y(),a.startRow,a.startRowOffset,e.getRowCount()),b(!1,a.x(),a.startColumn,a.startColumnOffset,e.getColumnCount()))}function w(a){if(a.sheet()){var b=a.y()+a.height(),e=a.endRow,c=a.endRowOffset,b=z(a,!0,b);e.call(a,b.index,!1);c.call(a,b.offset,!1);b=a.x()+a.width();e=a.endColumn;c=a.endColumnOffset;b=z(a,!1,b);e.call(a,b.index,!1);c.call(a,b.offset,!1)}}function z(a,b,e){var c,f=0,d=0;a=a.sheet();var g=b?a.getRowCount():a.getColumnCount(),k;for(k=0;k=g&&(k=g-1,d=0),{offset:d,index:k}}function C(a){var b=a.PR;return g(b)&&(b=a.Gia),b}function c(a,b){a.PR=b;a.qo.forEach(function(a){for(a=a.parentElement;-1===a.className.indexOf("gc-floatingobject-container");)a=a.parentElement;a&&(a.style.zIndex=b+"")})}function m(a,b){this.kj=a;this.MR=b}function h(a){function b(b,e,c,d,g,k,h){var m,p,l=0;b=b.call(a);var n=e.call(a);return l=c.call(a,f,b,n),m=l+d.call(f,n,3),0===m&&a.isVisible()&&(a.isVisible(!1),a.RR=!1),b===n?(D.call(a,e,k,d,!1,h),l=k.call(a)-g.call(a)):(p=d.call(f,b,3),0c&&(c=0),0>e&&(e=0),a.width()!==c&&(a.width(c,!1),a.onPropertyChanged("width",c)),a.height()!==e&&(a.height(e,!1),a.onPropertyChanged("height",e)))}var a,B,y,t,E,M=l(85),p=l(26),g=p.j.Fa;u=l(106);var f=M.Rect,k=M.Point,x=M.Events,W=M.Rm,P=p.j.Ma,V=M.Ul,Z=V.Pl,e=V.Nl,b=V.Rl,v=u.yR,N=document,S=p.D,X=function(){return p.C(U.exports.SR)()},Y=M.GC$,ka=Math.ceil,ja=Math.floor,oa=Math.max,ma=Math.min,ea=Math.abs;(function(){this.uQ=function(){var a=this.wr;a&&a.zR().forEach(function(a){a.isSelected(!1)})};this.AR=function(){var a=this.wr;a&&(a.isNeedToUpdateLayout=!0)};this.BR=function(){var a=this.parent,b=this.tv,a=a&&a.tv;return b||(b=this.tv=a?a:{fromSheet:null,isCutting:!1}),b};this.ex=function(){var a=this.BR(),b=a&&a.fromSheet;b&&(b.CR=null);a.fromSheet=null;a.isCutting=!1};this.DR=function(a){var b=this.options;return!b.isProtected||!a.isLocked()||b.protectionOptions.allowEditObjects};this.ER=function(a){var b=this.options;return!b.isProtected||!a.isLocked()||b.protectionOptions.allowEditObjects};this.isPasteFloatingObject=function(){var a=this.BR().fromSheet,b=this.CR;return!b&&a&&(b=a.CR),b&&!b.isEmpty()}}).call(M.Worksheet.prototype);M.Worksheet.$n("floatingObjects",{init:function(){this.wr=new a(this);this.pictures=new m(this,"1");this.floatingObjects=new m(this,"0")},dispose:function(){d(this);Y.each(this.pictures.all(),function(a,b){b.no()});Y.each(this.floatingObjects.all(),function(a,b){b.no()});this.unbind(x.TableFiltered+".fos");this.unbind(x.RangeFiltered+".fos");Y(this.Ws()).unbind("mousedown.fos")},setHost:function(a){if(a){var b=this;a.bind("mousedown.fos",function(){b.uQ()});b.bind(x.TableFiltered+".fos",function(){b.AR()});b.bind(x.RangeFiltered+".fos",function(){b.AR()})}},onLayoutChanged:function(a){var b=a.changeType,e=a.row,c=a.rowCount,f=a.col;a=a.colCount;var d=this.wr;d&&("addRows"===b?J(d,e,c):"deleteRows"===b?R(d,e,c):"addColumns"===b?Q(d,f,a):"deleteColumns"===b&&K(d,f,a))},paint:function(a){var b=this;a=a.clipRect;b.QP||(b.IR=function(a,e){var c,f;return b.FR||(b.FR=[]),c=b.FR[a],c||(b.FR[a]=[]),f=b.FR[a][e],f||(b.FR[a][e]=new t(b)),b.FR[a][e]},b.QP=function(a,b){var e,c,f,d,g;if(!this.fI&&this.wr)for(e=this.am(),null!==b&&void 0!==b||(b=this._zoomFactor),f=0;2>=f;f++)for(d=0;2>=d;d++)(c=e.Ft(f,d))&&(g=this.IR(f,d),g&&g.yl(f,d,b))});b.QP(a)},lastNonNullRowAndCol:function(){var a=0,b=0,e=this.wr;return e&&e.zR().forEach(function(e){e&&(e.endRow()>a&&(a=e.endRow()),e.endColumn()>b&&(b=e.endColumn()))}),{lastNonNullRow:a,lastNonNullCol:b}},toJson:function(a){var b=this.wr.toJSON();0=e;e++)for(c=0;2>=c;c++)if(f=k.Ft(e,c),f&&f.contains(a,b)&&(d=g.IR(e,c),d&&d.jS.each(function(e){var c=e.YR,f;if(f=c&&c.isVisible()&&g.DR(c))f=(e=e.Nia)&&0f&&ee&&a.width(e,!1);a.height()>b&&a.height(b,!1)}function m(a){var b,e;b=a.x()+a.width();e=l(a,b);b>e&&a.x(oa(0,e-a.width()),!1);0>a.x()&&a.x(0,!1);b=a.y()+a.height();e=p(a,b);b>e&&a.y(oa(0,e-a.height()),!1);0>a.y()&&a.y(0,!1)}function p(a,b){var e,c=a.sheet();return c?(e=c.getRowCount(),A(c,0,e,b)):9007199254740992}function l(a,b){var e,c=a.sheet();return c?(e=c.getColumnCount(),r(c,0,e,b)):9007199254740992}var t,v="name x y width height canPrint isSelected isLocked isVisible dynamicMove dynamicSize fixedPosition allowResize allowMove".split(" "),y=[["sheet",null,function(){var a,b;g(this);m(this);a=this.startRow();b=this.startColumn();a&&b?q(this):n(this);a=this.endRow();b=this.endColumn();a&&b?h(this):w(this)}],["name",void 0,function(a){if("string"!=typeof a||""===a)throw Error(X().Exp_FloatingObjectNameEmptyError);this.sheet()&&this.sheet().wr.Sb(this);this.onPropertyChanged("name",a)},function(){return this.sheet()&&this.sheet().wr.Fb(this.name()),!0}],["x",0,c("x",!1)],["y",0,c("y",!1)],["height",0,c("height",!0)],["width",0,c("width",!0)],["startRow",void 0,F("startRow")],["startRowOffset",0,F("startRowOffset")],["startColumn",void 0,F("startColumn")],["startColumnOffset",0,F("startColumnOffset")],["endRow",void 0,G("endRow")],["endRowOffset",0,G("endRowOffset")],["endColumn",void 0,G("endColumn")],["endColumnOffset",0,G("endColumnOffset")],["isSelected",!1,L("isSelected")],["isLocked",!0,b("isLocked")],["canPrint",!0,b("canPrint")],["isVisible",!0,L("isVisible")],["dynamicMove",!0,function(a,e){b("dynamicMove").call(this,a,e)},function(a){return"boolean"==typeof a&&(a||this.dynamicSize(!1,!1),!this.fixedPosition())}],["dynamicSize",!0,function(a,e){b("dynamicSize").call(this,a,e)},function(a){return"boolean"==typeof a&&this.dynamicMove()&&!this.fixedPosition()}],["fixedPosition",!1,function(a){a&&(this.dynamicMove(!1,!1),this.dynamicSize(!1,!1));this.onPropertyChanged("fixedPosition",a)}],["allowResize",!0,L("allowResize")],["allowMove",!0,L("allowMove")]];return t={constructor:a,position:function(a){var b=this.sheet();0===arguments.length?b=new k(this.x(),this.y()):(!P(a,k)||this.x()===a.x&&this.y()===a.y||(this.x(a.x,!1),this.y(a.y,!1),m(this),n(this),w(this),b&&b.$p(),this.onPropertyChanged("position",a)),b=this);return b},content:Z("content",null,L("content")),cloneContent:function(){var a,b,c=this.content();return c?(c.cloneNode?a=c.cloneNode(!0):(b=e("div"),b.innerHTML=c.outerHTML,a=b.firstChild),Y(a).removeAttr("id")[0]):null},refreshContent:function(a){var b,e,c,f,d,g;this.KR&&a&&(b=Y(a),b.empty(),e=this.cloneContent(),c="100%",f="100%",d="",g="",e&&e.style&&(d=e.style.width,g=e.style.height),""!==d&&(c=d),""!==g&&(f=g),null!==e?(Y(e).css({width:c,height:f}).addClass("gc-floatingobject-background-cover").addClass("gc-no-user-select").attr("unselectable","on").appendTo(a),b.css("background","")):b.css("background","#044062"),this.KR=!1)},toJSON:function(){var a=H.call(this,v);return a.typeName=this.typeName,a.content=Y(e("div")).append(this.cloneContent()).html(),a},fromJSON:function(a,b){var c;a&&(this.TR=!0,I.call(this,v,a,b),n(this),w(this),a.content&&(c=e("div"),c.innerHTML=a.content,this.content(Y(c.firstChild)[0])),this.TR=void 0)},clone:function(){var b=M.getTypeFromString(this.typeName),b=b?new b:new a,e=JSON.stringify(this.toJSON());return b.fromJSON(JSON.parse(e)),b.content(this.cloneContent()),b},onPropertyChanged:function(a,b){var e;this.TR||(e=this.sheet(),this.Wq({sheet:e,sheetName:e?e.Cj:"",floatingObject:this,propertyName:a}))},Wq:function(a){var b,e=this.sheet();e&&(e.Wq(x.FloatingObjectChanged,a),"isSelected"===a.propertyName&&(b={sheet:a.sheet,sheetName:a.sheetName,floatingObject:a.floatingObject},e.Wq(x.FloatingObjectSelectionChanged,b)))},rI:function(a,b){a=ka(a);b=ka(b);f.call(this,this.startRow,this.endRow,a,b)},GR:function(a,b){d.call(this,this.startRow,this.startRowOffset,this.endRow,this.endRowOffset,a,b,a+b-1)},tI:function(a,b){a=ka(a);b=ka(b);f.call(this,this.startColumn,this.endColumn,a,b)},HR:function(a,b){a=ka(a);b=ka(b);d.call(this,this.startColumn,this.startColumnOffset,this.endColumn,this.endColumnOffset,a,b,a+b-1)},getHost:function(){return this.qo.concat()},UR:function(a){var b=this.qo;a&&0>b.indexOf(a)&&b.push(a)},VR:function(a){var b=this.qo;a=b.indexOf(a);0<=a&&b.splice(a,1)},WR:function(){var a,b,c,f,d,g,k=e("div");return Y(k).addClass("gc-no-user-select").addClass("gc-floatingobject-content-container").attr("unselectable","on").css("position","absolute"),a=this.cloneContent(),b="100%",c="100%",f="",d="",g=a&&a.style,g&&(f=g.width,d=g.height),""!==f&&(b=f),""!==d&&(c=d),null!==a&&Y(a).css({width:b,height:c}).addClass("gc-floatingobject-background-cover").addClass("gc-no-user-select").attr("unselectable","on").appendTo(k),this.UR(k),k},hga:function(){return!0},no:function(){}},Y.each(y,function(a,b){t[b[0]]=Z(b[0],b[1],b[2],b[3])}),a.prototype=t,a}();y=function(){function a(a,b){this.XR="";this.name=(this.YR=a)?a.name():"";this.kj=b;this.ZR=this.RB=!1}function c(a){a=Y(a);var b=a.position();return new f(b.left,b.top,a.width(),a.height())}function d(a,b,e,c,f,d){Y(a).css(["top","left","width","height"],[[c-1],[e-1],f,d]).addClass("gc-floatingobject-moving-div").appendTo(b)}function g(a){var b,e,c,f,d,g=a.kj,k=a.WE,h=a.aS,m=g.frozenTrailingRowCount(),p=g.frozenTrailingColumnCount(),l=g.am(),n=l.Ft(k,h),q=a.YR;a=q.startRow();var t=q.startColumn(),x=q.endRow(),q=q.endColumn(),v=g.frozenRowCount(),r=g.frozenColumnCount(),y=g.getRowCount(3)-m-1,p=g.getColumnCount(3)-p-1;return 1===k?(0y&&e===y&&(n.height+=l.gs))):0===k?(b=g.getViewportTopRow(k+1),(x>=b||b===v)&&(d=l.Ft(k+1,h),n.height+=d.height)):2===k&&(e=g.getViewportBottomRow(k-1),(a<=e||e===y)&&(d=l.Ft(k-1,h),n.y=d.y,n.height+=d.height)),1===h?(0p||f===p)&&(n.width+=l.js))):0===h?(c=g.getViewportLeftColumn(h+1),(q>=c||c===r)&&(d=l.Ft(k,h+1),n.width+=d.width)):2===h&&(f=g.getViewportRightColumn(h-1),(t<=f||f===p)&&(d=l.Ft(k,h-1),n.x=d.x,n.width+=d.width)),n}function h(a,b,e,f,d){var g=c(a);Y(a).css(["top","left","width","height"],[g.y+e,g.x+b,g.width+f,g.height+d])}function m(a,b){var e=a.kj;if(e)return e.RF(b),!1}function p(a,b,e){var c=Y(a);a=Y(a).position();c.css(["top","left"],[a.top+e,a.left+b])}function l(b){var c,f,d,g,k,h,p,l,n=e("div"),q=Y(n);return q.addClass("gc-floatingobject-container").addClass("gc-no-user-select").attr("unselectable","on").css("z-index",700).bind("mousedown",function(a){b.AD(a)}).bind("mousemove",function(a){b.BD(a)}).bind("mouseup",function(a){b.CD(a)}),n.addEventListener("mousewheel",function(a){m(b,a)},!1),n.addEventListener("DOMMouseScroll",function(a){m(b,a)},!1),c=Y(e("div")).addClass("gc-floatingobject-resize-indicator gc-floatingobject-top gc-floatingobject-left gc-floatingobject-absolute"),f=Y(e("div")).addClass("gc-floatingobject-resize-indicator gc-floatingobject-top gc-floatingobject-center gc-floatingobject-absolute"),d=Y(e("div")).addClass("gc-floatingobject-resize-indicator gc-floatingobject-top gc-floatingobject-right gc-floatingobject-absolute"),g=Y(e("div")).addClass("gc-floatingobject-resize-indicator gc-floatingobject-middle gc-floatingobject-left gc-floatingobject-absolute"),k=Y(e("div")).addClass("gc-floatingobject-resize-indicator gc-floatingobject-middle gc-floatingobject-right gc-floatingobject-absolute"),h=Y(e("div")).addClass("gc-floatingobject-resize-indicator gcfloatingobject-bottom gc-floatingobject-left gc-floatingobject-absolute"),p=Y(e("div")).addClass("gc-floatingobject-resize-indicator gcfloatingobject-bottom gc-floatingobject-center gc-floatingobject-absolute"),l=Y(e("div")).addClass("gc-floatingobject-resize-indicator gcfloatingobject-bottom gc-floatingobject-right gc-floatingobject-absolute"),q.append(c).append(f).append(d).append(g).append(k).append(h).append(p).append(l),a.ao(b,"init",n),n}function n(a){var b,c,f,k,h,m=a.hS&&a._R;if(m&&!a.cS){b=a.iS=e("div");a.cS=e("div");a.dS={};a.gS.jS.each(function(b){var c,f=b.YR;f&&f.name()!==a.YR.name()&&f.isSelected()&&!a.dS[f.name()]&&(c=b._R,a.dS[f.name()]={offsetX:c.x-m.x,offsetY:c.y-m.y,height:c.height,width:c.width,moveResizeDiv:e("div")})});c=g(a);f=Y(b);f.css("z-index top left width height background".split(" "),[701,c.y,c.x,c.width,c.height,"rgba(255,255,255,0.01)"]).addClass("gc-floatingobject-moving-container").bind("mousemove",function(b){a.BD(b)}).bind("mouseup",function(b){a.CD(b)});f=m.y-c.y;c=m.x-c.x;d(a.cS,b,c,f,m.width,m.height);b=a.dS;for(k in b)S(b,k)&&(h=b[k],d(h.moveResizeDiv,a.iS,c+h.offsetX,f+h.offsetY,h.width,h.height));a.Ks&&Y(a.Ks).append(a.iS)}}function q(a){a.RB||(Y(N).bind("mousemove.gcFloatingObject",function(b){a.BD(b)}).bind("mouseup.gcFloatingObject",function(b){a.CD(b)}),a.RB=!0)}function t(b,e,c,f,d,g,k,h,m){var p,l=Y(c,b.hS);e?(p=a.mS,l.css("left top right bottom width height cursor".split(" "),[f,d,g,k,p,p,h]).addClass("gc-floatingobject-resize-indicator-select").attr("resizeDirection",m)):v(b,c)}function v(a,b){Y(b,a.hS).removeClass("gc-floatingobject-resize-indicator-select").addClass("gc-floatingobject-resize-indicator-unSelect")}M.Zn(a);return a.prototype={AD:function(b){var e,f,d,g,h,m,p=this.kj,l=this.YR,t=p.comments,x=this.WE,v=this.aS;if(p.ER(l)&&p.endEdit()&&(e={e:b,r:null},a.ao(this,"preProcessMouseDown",e),!e.r)){if(0===b.button||2===b.button){if(f=l.isSelected(),b.ctrlKey||b.shiftKey?l.isSelected(!f):f||(p.uQ(),l.isSelected(!0)),f||M.Vl.Zl(p),t&&t.vQ(),p.EJ(),2===b.button)return;e=p.mm;f=p.Vs();f=new k(b.pageX-f.left,b.pageY-f.top);this._R?(t={inMoving:!1},t=(Y(b.target).attr("resizeDirection")||(t.inMoving=!0),t)):t=null;if(d=t,!l.allowMove()&&(!l.allowResize()||d.inMoving))return;this.$F=f;this.pS=!0;this.bS=d;d.inMoving?(g={},g.startTopRow=p.getViewportTopRow(x),g.startLeftColumn=p.getViewportLeftColumn(v),g.startX=f.x,g.startY=f.y,this.eS=g):(n(this),h={},m=c(this.cS),h.startX=m.x,h.startY=m.y,h.startWidth=m.width,h.startHeight=m.height,h.startTopRow=p.getViewportTopRow(x),h.startLeftColumn=p.getViewportLeftColumn(v),h.cursor=b.target.style.cursor,h.direction=Y(b.target).attr("resizeDirection"),this.$R=h);q(this);b=p.hitTest(f.x,f.y);e.rG={KG:b.rowViewportIndex,MG:b.colViewportIndex,sG:b.hitTestType};e.$F=f;e.qG();e.O3=!0}return!1}},BD:function(b){var e,d;d=this.kj;var m=this.hS,l=this.iS;if(d.ER(this.YR)&&(e={e:b,r:null},a.ao(this,"preProcessMouseMove",e),!e.r)){if(d.dG)l=(m&&Y(m).css("cursor","default"),!0);else{e=d.mm;d=d.Vs();b=new k(b.pageX-d.left,b.pageY-d.top);if(this.pS){if(this.bS.inMoving){this.qS=!0;n(this);var q=this.$F,t,x,v,r;if(x=this.cS)for(v in t=b.x-q.x,q=b.y-q.y,p(x,t,q),x=this.dS,x)S(x,v)&&(r=x[v],p(r.moveResizeDiv,t,q));Y(l).css("cursor","move")}else if(this.YR.allowResize()){this.kv=!0;var y,w,z,u;if(this.bS){m=this.$F;y=g(this);v=this.cS;r=this.$R;d=r.direction;m=new k(m.x-y.x,m.y-y.y);y=this.$R;switch(d){case "topleft":x=ma(y.startX+y.startWidth,m.x);z=ma(y.startY+y.startHeight,m.y);u=ea(m.x-y.startX-y.startWidth);w=ea(m.y-y.startY-y.startHeight);break;case "topcenter":x=y.startX;z=ma(y.startY+y.startHeight,m.y);u=y.startWidth;w=ea(m.y-y.startY-y.startHeight);break;case "topright":x=ma(y.startX,m.x);z=ma(y.startY+y.startHeight,m.y);u=ea(m.x-y.startX);w=ea(m.y-y.startY-y.startHeight);break;case "middleleft":x=ma(y.startX+y.startWidth,m.x);z=y.startY;u=ea(m.x-y.startX-y.startWidth);w=y.startHeight;break;case "middleright":x=ma(y.startX,m.x);z=y.startY;u=ea(m.x-y.startX);w=y.startHeight;break;case "bottomleft":x=ma(y.startX+y.startWidth,m.x);z=ma(y.startY,m.y);u=ea(m.x-y.startX-y.startWidth);w=ea(m.y-y.startY);break;case "bottomcenter":x=y.startX;z=ma(y.startY,m.y);u=y.startWidth;w=ea(m.y-y.startY);break;case "bottomright":x=ma(y.startX,m.x),z=ma(y.startY,m.y),u=ea(m.x-y.startX),w=ea(m.y-y.startY)}w=new f(x,z,u,w);r.endX=w.x;r.endY=w.y;r.endWidth=w.width;r.endHeight=w.height;r=c(v);x=w.y-r.y;z=w.x-r.x;u=w.width-r.width;w=w.height-r.height;h(v,z,x,u,w);v=this.dS;for(t in v)S(v,t)&&(q=v[t],h(q.moveResizeDiv,z,x,u,w))}Y(l).css("cursor",this.$R.cursor)}(this.qS||this.kv)&&(this.$F=b,e.$F=b,e.NG(),Y(N.body).addClass("gc-no-user-select").attr("unselectable","on"))}l=!1}return l}},CD:function(e){var c,d,g;d=this.kj;var h=d.mm;g=this.YR;var m=this.hS,p=this.bS;if(d.ER(g)&&(c={e:e,r:null},a.ao(this,"preProcessMouseUp",c),!c.r)){var l;if(d.dG)l=(Y(m).css("cursor","move"),!0);else{h.O3=!1;h.RG();c=d.Vs();c=new k(e.pageX-c.left,e.pageY-c.top);(d=this.eS)&&(d.endX=c.x,d.endY=c.y);if(p){g=g.fixedPosition();if(p.inMoving&&this.qS){if(g){var n,q,t,x,v,r,y,w,z,u,B;(l=this.eS)&&(n=this.YR,q=this.kj,t=q.am(),x=t.width-t.Br-t.zr,v=t.height-t.Cr-t.Ar,r=l.startX,y=l.startY,w=n.position().x,z=n.position().y,u=n.width(),B=n.height(),0>w+l.endX-r&&(l.endX=r-w),0>z+l.endY-y&&(l.endY=y-z),w+u+l.endX-r>x&&(l.endX=x+r-w-u),z+B+l.endY-y>v&&(l.endY=v+y-z-B),l.startTopRow=q.getViewportTopRow(this.WE),l.startLeftColumn=q.getViewportLeftColumn(this.aS))}if(e.ctrlKey){var A,C,E,D,F,M;l=this.kj;if((F=this.eS)&&(A=b(l,F.startTopRow,l.getViewportTopRow(this.WE),!0),C=b(l,F.startLeftColumn,l.getViewportLeftColumn(this.aS),!1),E=F.endX-F.startX+(F.endX>F.startX?C:-1*C),D=F.endY-F.startY+(F.endY>F.startY?A:-1*A),0!==E||0!==D)){F=[];F.push(this.YR.name());A=this.dS;for(M in A)S(A,M)&&F.push(M);l.wu().execute({cmd:"dragCopyFloatingObjects",sheetName:l.name(),floatingObjects:F,offsetX:E,offsetY:D})}}else if(l=this.kj,A=this.eS,D=l._zoomFactor,A){M=b(l,A.startTopRow,l.getViewportTopRow(this.WE),!0);E=b(l,A.startLeftColumn,l.getViewportLeftColumn(this.aS),!1);E=A.endX-A.startX+(A.endX>A.startX?E:-1*E);M=A.endY-A.startY+(A.endY>A.startY?M:-1*M);E/=D;M/=D;D=[];D.push(this.YR.name());A=this.dS;for(F in A)S(A,F)&&D.push(F);l.wu().execute({cmd:"moveFloatingObjects",sheetName:l.name(),floatingObjects:D,offsetX:E,offsetY:M})}}else if(this.kv){if(g){var G,P,V,H,W;(F=this.$R)&&(G=this.kj,P=G.am(),V=P.width-P.Br-P.zr,H=P.height-P.Cr-P.Ar,W=new f(F.endX,F.endY,F.endWidth,F.endHeight),W=W.getIntersect(0,0,V,H),F.endX=W.x,F.endY=W.y,F.endWidth=W.width,F.endHeight=W.height,F.startTopRow=G.getViewportTopRow(this.WE),F.startLeftColumn=G.getViewportLeftColumn(this.aS))}D=this.kj;e=D._zoomFactor;A=this.YR;if(n=this.$R){C=b(D,n.startTopRow,D.getViewportTopRow(this.WE),!0);M=b(D,n.startLeftColumn,D.getViewportLeftColumn(this.aS),!1);F=n.endX-n.startX+(n.endX>n.startX?M:-1*M);F/=e;E=n.endY-n.startY+(n.endY>n.startY?C:-1*C);E/=e;M=(n.endWidth+M)/e-A.width();C=(n.endHeight+C)/e-A.height();e=[];e.push(A.name());A=this.dS;for(l in A)S(A,l)&&e.push(l);D.wu().execute({cmd:"resizeFloatingObjects",sheetName:D.name(),floatingObjects:e,offsetX:F,offsetY:E,offsetWidth:M,offsetHeight:C})}}Y(N.body).removeClass("gc-no-user-select")}l=(this.rS(),!1)}return l}},rS:function(){this.dS=this.eS=this.$R=null;Y(this.iS).remove();this.cS=null;this.pS=!1;this.RB&&(this.RB=!1,Y(N).unbind("mousemove.gcFloatingObject").unbind("mouseup.gcFloatingObject"));this.kv=this.qS=!1},YR:function(){return this.YR},yl:function(b,f){var d,g,k,h,m,p=this.YR,n=this.kj;if(p){d=!1;this.sS=b;g=this.hS;g||(g=this.hS=l(this),k=C(p),g&&(g.style.zIndex=k+""),(k=n.parent)&&(h=this.Ks=k.xv(),h&&Y(h).append(g)));(h=this.kS)||(h=this.kS=p.WR(),"function"==typeof p.borderWidth?(this.lS=e("div"),Y(this.lS).addClass("gc-no-user-select gc-floatingobject-content-container").attr("unselectable","on"),g.appendChild(this.lS),this.lS.appendChild(h)):(g.appendChild(h),d=!0));if(this.lS){var q,r,y,w;k=this.lS;q=this.YR;var z=q.borderWidth(),u=q.borderStyle(),B=W.Om(q.sheet(),q.borderColor()),A=q.borderRadius();w=0;var E=ja(a.mS/2+1);q.nS(u)||(z=0);zf.x?q+=f.x-E:(q+=f.xf.y?r+=f.y-E:(r+=f.y=F&&(u=N-F),k=g.height-P-M.height-N,z=g.width-G-M.width-N,G+=N,P+=N);0=k.length||0>=h.length?q:(m=k[0],p=k[k.length-1],l=h[0],n=h[h.length-1],t.zR().forEach(function(a){var b,e,c,t,x;if(a&&a.isVisible()){if(a.fixedPosition())c=a.position(),b=c.x*f+d.kt,e=c.y*f+d.nt;else{if(e=a.startColumn(),b=k.findCol(e),b)b=b.x;else if(e=e;t--)b-=g._m(t);else for(b=p.x+p.width,t=p.col+1;t<=e;t++)b+=g._m(t);if(b+=a.startColumnOffset()*f,c=a.startRow(),x=h.findRow(c),x)e=x.y;else if(c=c;x--)e-=g.Sl(x);else for(e=n.y+n.height,x=n.row+1;x<=c;x++)e+=g.Sl(x);e+=a.startRowOffset()*f}c=ja(a.width()*f);x=ja(a.height()*f);q.push({name:a.name(),x:b,y:e,width:c,height:x})}}),q)}return a.prototype={no:function(){var a=this.jS;a.each(function(a){a.no()});a.empty()},yl:function(a,b,c){var d,g,k,h,m,p,l,n;if(!(0>a||0>b)){d=this;g=d.kj;k=d.jS;h=g.wr;m=e(d,a,b,c);p=[];k.each(function(a){m.find(a.name)||p.push(a)});c=0;for(l=p.length;cr&&(r=c));c=d.kj;var z=c.it(b),u=w=m=0,B=0;c=(z&&0=l?(q+=l,q+=v):l=p?(n+=p,n+=v):pg.row+g.rowCount-1?g:c>g.row?n(g.row,g.col,g.rowCount+d,g.colCount):n(g.row+d,g.col,g.rowCount,g.colCount):a}function Q(c,d,g){return g?c>g.col+g.colCount-1?g:c>g.col?n(g.row,g.col,g.rowCount,g.colCount+d):n(g.row,g.col+d,g.rowCount,g.colCount):a}function K(a,c,d,g){var f,k,h,e,b,m,p,l;for(f=0;fd)return e=c,f=d,{start:e,end:f};if(g<=c){m=0;for(k=c;k<=h&&k<=d;k++)m++;return e=g,f=e+(d-c+1)-m-1,{start:e,end:f}}m=0;for(k=c;k<=d;k++)-1===e&&(kh)&&(e=k),(kh)&&m++;return-1!==e&&0=c&&l=k.count()&&C(a,k)}}function F(c){var d;this.options={};for(d in E)E.hasOwnProperty(d)&&(this.options[d]=c&&c[d]?c[d]:E[d]);this.WS=a}function G(c,d){this.displayDateAxis=!1;this.ZA=a;this.PS=[];this.XS=a;this.YS=1;this.setting=d;this.sparklineType=c}function q(a,c,d,g,h,m){this.row=a;this.column=c;this._S=g;this.aT=d;this.cb=new G(h,m);this.cb.add(this)}var D,A,r,n,w,z,C,c,m,h,a,B,y,t,E,M=l(85),p=l(26),g=l(113);u={};l=M.GC$;D=l.isEmptyObject;A=M.Worksheet;r=M.Fp;n=M.kf;w=p.j.Fa;z=p.k;C=z.Fb;c=z.Bb;m=g.Vd;h=g.SparklineRender;a=null;B=Math.max;y=Number.MAX_VALUE;t="sparkline";A.$n("sparkline",{init:function(){this.ZA=new J(this,this)},dispose:function(c){!1!==c&&(this.ZA=a)},onLayoutChanged:function(a){var c,d=a.changeType,f=a.row,g=a.rowCount,h=a.col,m=a.colCount,e=this.ZA;"addRows"===d?e.rI(f,g):"deleteRows"===d?e.GR(f,g):"addColumns"===d?e.tI(h,m):"deleteColumns"===d?e.HR(h,m):"clear"===d&&(c=a.type,3===a.sheetArea&&16===(16&c)&&e.clear(f,h,g,m))},toJson:function(a){a.sparklineGroups=this.ZA.toJSON()},fromJson:function(a,c){var d,f,g,k,h,e;d=this.ZA;f=a.sparklineGroupManager;if(f=c?f&&f.groups:a.sparklineGroups)for(d.fromJSON(f,c),d=d.groups(),k=this.Mp(),h=0;h=k.count()&&h.remove(k),d.call(this,c,g,f,a)),this.$p())},groupSparkline:function(c){var d,f,g,h,m=this.ZA;if(!m)return a;d=a;for(f=0;f=h.count()&&m.remove(h)):d=g.group());return this.$p(),d},ungroupSparkline:function(a){var c,d,f,g,h=this.ZA;if(h&&a){c=[];c=c.concat(a.PS);for(d=0;da.row?g:a.rowCount,b=0>a.col?h:a.colCount,!(0>f+c||0>k+d||f+e+c>g||k+b+d>h))},aB:function(c,d,g,h,m,p){var f,e,b,k,l,n=this.kj;if(n){this.US(c,d,g,h,m,p);f=n.Mp();e=new r(m,p,a);for(b=0;b=q.count()&&c.ZA.remove(q),r.add(n),this.add(r),b.setValueForKey(h+f,m+k,t,n)):b.setValueForKey(h+f,m+k,t,a),e.setValueForKey(d+f,g+k,t,a)}},VS:function(a,c,d,g,h,m,p){var e,b,f,k,l;e=this.kj;if(a&&e){if(a===e)return void this.US(c,d,g,h,m,p);m=n(c,d,m,p);c=g-c;d=h-d;a=a.ZA.Ub;for(h=0;hh&&(a.groupMinValue=h)},ZS:function(a){var c,d,f,g=-y,h=y;if(c=a.data())for(a=a.$S(c,a.dataOrientation(),!1),c=0;cf?f:h);return{min:h,max:g}},toJSON:function(){function c(c,d){var e=!1;return"setting"===c||"axisReference"===c?e=d===a:"displayDateAxis"===c?e=!1===d:"axisOrientation"===c?e=1===d:"sparklines"===c&&(e=0===d.length),e}var d,g,h,m;d={setting:this.setting?this.setting.toJSON():a,displayDateAxis:this.displayDateAxis,sparklineType:this.sparklineType,axisReference:this.XS,axisOrientation:this.YS,sparklines:this.PS.map(function(a){return a.toJSON()})};g={};for(h in d)d.hasOwnProperty(h)&&(m=d[h],c(h,m)||(g[h]=m));return D(g)?void 0:g},fromJSON:function(a,c){var d,f,g,k,h,e;if(a&&(d=this,f=a.displayDateAxis,g=a.sparklineType,k=a.axisReference,h=a.axisOrientation,e=a.sparklines,d.setting=new F(a.setting),w(f)||(d.displayDateAxis=f),w(g)||(d.sparklineType=g),w(k)||(d.XS=k),w(h)||(d.YS=h),e))for(d.PS=[],f=0,g=e.length;f=c.getRowHeight(g.row+e)||0>=c.getColumnWidth(g.col+b))?k=NaN:w(k)||(l?k="number"===typeof k?p.l.Xb(k):Date.parse(k):"number"!==typeof k&&(k=m)),n.push(k);return n};u.Sparkline=q;U.exports=u},function(U,u){U.exports=GC.Spread.Sparklines},function(U,u,l){function d(a){return 0===a}function J(a){return 0===a||2===a}function R(a){var b,e,c,d,f,g,k=[];if(E(a))for(b=0,e=a.getRangeCount();bb))for(e=a.getRowCount(b),c=a.getColumnCount(b),d=0;d=e.length&&!f(b)&&e.push(b),{values:e,colors:Array.prototype.slice.call(a,1)}},a.acceptsReference=d,a},paint:P.PIESPARKLINE});u.PieSparkline=H;l(I,O);k(I.prototype,{createFunction:function(){var a=new p("AREASPARKLINE",1,7);return a.evaluate=function(a){return{points:R(a[0]),mini:a[1],maxi:a[2],line1:a[3],line2:a[4],colorPositive:a[5],colorNegative:a[6]}},a.acceptsReference=d,a},paint:P.AREASPARKLINE});u.AreaSparkline=I;l(L,O);k(L.prototype,{createFunction:function(){var a=new p("SCATTERSPARKLINE",1,18);return a.evaluate=function(a){var b=Q(a[0],0),e=Q(a[1],0);return{points1:b,points2:e,minX:a[2],maxX:a[3],minY:a[4],maxY:a[5],hLine:a[6],vLine:a[7],xMinZone:a[8],xMaxZone:a[9],yMinZone:a[10],yMaxZone:a[11],tags:a[12],drawSymbol:a[13],drawLines:a[14],color1:a[15],color2:a[16],dash:a[17]}},a.acceptsReference=function(a){return 0===a||1===a},a},paint:P.SCATTERSPARKLINE});u.ScatterSparkline=L;l(F,O);k(F.prototype,{createFunction:function(){var a=new p("BULLETSPARKLINE",3,9);return a.evaluate=function(a){return{measure:K(a[0]),target:K(a[1]),maxi:K(a[2]),good:K(a[3]),bad:K(a[4]),forecast:K(a[5]),tickUnit:K(a[6]),colorScheme:a[7],vertical:a[8]}},a.acceptsReference=function(a){return 0<=a&&6>=a},a},paint:P.BULLETSPARKLINE});u.BulletSparkline=F;l(G,O);k(G.prototype,{createFunction:function(){function a(a){var b,c,d,f,g={};b=0;for(d=a.length;b=a},a},paint:P.STACKEDSPARKLINE});u.StackedSparkline=q;l(D,O);k(D.prototype,{createFunction:function(){var a=new p("HBARSPARKLINE",1,2);return a.evaluate=function(a){return{value:K(a[0]),colorScheme:a[1]}},a.acceptsReference=d,a},paint:P.HBARSPARKLINE});u.HBarSparkline=D;l(A,O);k(A.prototype,{createFunction:function(){var a=new p("VBARSPARKLINE",1,2);return a.evaluate=function(a){return{value:K(a[0]),colorScheme:a[1]}},a.acceptsReference=d,a},paint:P.VBARSPARKLINE});u.VBarSparkline=A;l(r,O);k(r.prototype,{createFunction:function(){var a=new p("VARISPARKLINE",1,10);return a.evaluate=function(a){return{variance:K(a[0]),reference:K(a[1]),mini:K(a[2]),maxi:K(a[3]),mark:K(a[4]),tickUnit:K(a[5]),legend:a[6],colorPositive:a[7],colorNegative:a[8],vertical:a[9]}},a.acceptsReference=function(a){return 0<=a&&5>=a},a},paint:P.VARISPARKLINE});u.VariSparkline=r;l(n,O);k(n.prototype,{createFunction:function(){function a(a,b){return E(a)&&!Z(b)&&0<=b&&100>=b?g.PERCENTILE.evaluate(a,b/100):NaN}var b=new p("BOXPLOTSPARKLINE",1,10);return b.evaluate=function(b){var e=b[0],c=R(e),d=b[1],f=b[2],k=K(b[3]),h=K(b[4]),m=K(b[5]),p=K(b[6]),l=b[7],n=b[8];b=b[9];var q=a(e,2),t=a(e,9),r=a(e,10),v=a(e,90),x=a(e,91),y=a(e,98),w=a(e,25),z=a(e,75),u=a(e,50),e=E(e)?g.STDEVP.evaluate(e):NaN;return{points:c,boxPlotClass:d,showAverage:f,scaleStart:k,scaleEnd:h,acceptableStart:m,acceptableEnd:p,colorScheme:l,style:n,vertical:b,perc02:q,perc09:t,perc10:r,perc90:v,perc91:x,perc98:y,q1:w,q3:z,median:u,stDev:e}},b.acceptsReference=d,b},paint:P.BOXPLOTSPARKLINE});u.BoxPlotSparkline=n;l(w,O);k(w.prototype,{createFunction:function(){var a=new p("CASCADESPARKLINE",1,8);return a.evaluate=function(a){return{points:R(a[0]),pointIndex:K(a[1]),labels:R(a[2]),minimum:K(a[3]),maximum:K(a[4]),colorPositive:a[5],colorNegative:a[6],vertical:a[7]}},a.acceptsReference=J,a.acceptsArray=J,a},paint:P.CASCADESPARKLINE});u.CascadeSparkline=w;l(z,O);k(z.prototype,{createFunction:function(){var a=new p("PARETOSPARKLINE",1,8);return a.evaluate=function(a){return{points:R(a[0]),pointIndex:K(a[1]),colorRange:R(a[2]),target:K(a[3]),target2:K(a[4]),highlightPosition:K(a[5]),label:a[6],vertical:a[7]}},a.acceptsReference=J,a.acceptsArray=J,a},paint:P.PARETOSPARKLINE});u.ParetoSparkline=z;l(C,O);k(C.prototype,{createFunction:function(){var a=new p("MONTHSPARKLINE",3,7);return a.evaluate=function(a){var b,e,c,d,f,g,k,h,m,p=a[0],l=a[1],n=b=a[2];E(b)&&(n=Q(b,0));b=a[3];e=[];E(b)&&(e=Q(b,0));c=[];d=[];f=0;for(g=n.length;f=c&&k=d&&f=e;e++)for(b=0;2>=b;b++)(d=c.Ft(e,b))&&0!==d.width&&0!==d.height&&(a&&!d.intersectRect(a)||(f=this.comments,g&&f&&g.fT(f)))}});D.CellRange.prototype.comment=function(a){var c=this.sheet,d=this.row,e=this.col;return 0===arguments.length?c.comments.get(d,e):(a instanceof L&&c.comments.Cz(d,e,a),this)};K=function(a,c){var d=c.comments;c.bind(M.TopRowChanged+".comment",function(){c.comments.cQ()});c.bind(M.LeftColumnChanged+".comment",function(){c.comments.cQ()});a.bind("mousedown.comment",function(){d.vQ()}).bind("mousewheel.comment",function(a){O(c,a)}).bind("mousemove.comment",function(a){O(c,a)})};O=function(a,c){var d=a.Vs();if(d=a.hitTest(c.pageX-d.left,c.pageY-d.top)){var e=-1,b=-1;(d&&0<=d.rowViewportIndex&&0<=d.colViewportIndex&&(e=d.row,b=d.col),!a.parent)||0>e||0>b||(d=a.comments.get(e,b),a.comments&&a.comments.tT(d))}};H=function(a,c){c.unbind(".comment")};u.$n("comments",{init:function(){var a=this;a.comments=new G(a);a.nQ=function(){var c=a.parent;if(c)return c.gT||(c.gT=new q(c.xv())),c.gT.kj=a,a.parent.gT}},dispose:function(){var a=this.comments;a&&a.dispose();H(this,c(this.Ws()))},setHost:function(a){a&&K(a,this)},onLayoutChanged:function(a){var c=this.comments,d=a.changeType,e=a.row,b=a.rowCount,f=a.col,g=a.colCount;"addRows"===d?c.rI(e,b):"deletingRows"===d?c.GR(e,b):"addColumns"===d?c.tI(f,g):"deletingColumns"===d?c.HR(f,g):3===a.sheetArea&&("clear"===d?4===(4&a.type)&&c.clear(new D.Range(e,f,b,g)):"addSpan"===d?Q.call(this,!0,e,f,b,g):"removeSpan"===d&&Q.call(this,!1,e,f))},paint:function(a){if(!this.comments.iT()){var c=this.nQ();c&&c.rT(this);this.RP(a.clipRect)}},paintCell:function(a){if(!a.isPrinting&&3===a.sheetArea){var c=a.ctx,d=a.sheetArea;a=a.cell;var e=this.nQ();e&&e.sT(c,d,a)}},toJson:function(a){a.comments=this.comments.toJSON()},fromJson:function(a,c){if(a){var d=c?a.commentManager:a.comments;d&&this.comments.fromJSON(d,c)}},lastNonNullRowAndCol:function(){var a,c,d,e,b=0,f=0;if((c=this.comments)&&(a=c.jT,a&&0b&&(b=e.lT),e.mT>f&&(f=e.mT));return{lastNonNullRow:b,lastNonNullCol:f}},clearSelection:function(){var a=this.comments;a&&a.vQ()},processKeyDown:function(a){var c=this.comments&&this.comments.JU();c&&this.mm.LH(a.e)&&(c.commentState(2),a.r=!0)}});D.Workbook.$n("comments",{init:function(){A.uT(this.commandManager())}});M.CommentChanged="CommentChanged";I=function(){function a(a,c,e,b){1>=arguments.length?this.top=this.right=this.bottom=this.left=a||0:(this.top=a,this.right=c,this.bottom=e,this.left=b)}return a.prototype={constructor:a,clone:function(){return new a(this.top,this.right,this.bottom,this.left)},toString:function(){var a=this,c="";return["top","right","bottom","left"].forEach(function(e){c+=a[e]+"px "}),c.trim()}},a}();L=function(){function a(a){this.oT=this.nT=-1;this.text(a||"");this.zIndex(898)}function c(a){return function(){var b=this.kj;b&&(0>=b.Xq&&b.RP(),b.Wq(M.CommentChanged,{sheet:b,sheetName:b?b.Cj:"",comment:this,propertyName:a}))}}var f,e,b;f=[];return e=[["text",""],["location",d(9,-18)],["width",160,function(a){return 0=a}],["borderWidth",1,function(a){return 1<=a}],["borderStyle","solid"],["borderColor","black"],["padding"],["showShadow",!1],["displayMode",2],["commentState",3],["zIndex",-1],["ignoreDefaultLocation",!1]],b={clone:function(){var b=this,e=new a;return f.forEach(function(a){var c=b[a]();b[a].isDefault(c)||e[a](c&&c.clone?c.clone():c)}),e.kj=b.kj,e.nT=b.nT,e.oT=b.oT,e},toJSON:function(){var a=this,b={rowIndex:a.nT,colIndex:a.oT};return f.forEach(function(e){var c=a[e]();a[e].isDefault(c)||(b[e]=c&&c.clone?c.clone():c)}),b},fromJSON:function(a){if(a){var b=this;f.forEach(function(e){var c= a[e];void 0!==c&&("location"===e?b.location(new D.Point(c.x,c.y),!1):"padding"===e?b.padding(new I(c.top,c.right,c.bottom,c.left),!1):b[e](c,!1))});void 0!==a.rowIndex&&(b.nT=a.rowIndex);void 0!==a.colIndex&&(b.oT=a.colIndex)}}},e.forEach(function(a){var e=a[0],d;d=a[0];var g=a[1];a=a[2];d=(f.push(d),D.Ul.Pl(d,g,c(d),a));b[e]=d}),m(a.prototype,b),a}();F=function(){function m(a,b){var e;e=a&&a.kj;this.aS=this.WE=1;this.kT=a;this.vT();this._zoomFactor=e._zoomFactor;this.wT=b;this.BF=b.xT;this.ad();e=this.yT(this.zT(),a.width(),a.height());this.AT=d(e.x,e.y);this.BT();this.CT()}function l(a,b,c,d,f){b=J(b,c,d,d);b.cursor=f;a.push(b)}function q(a,b,d,f){c(a.DT).css(b,d);c(a.ET).css(b,f)}D.Zn(m);return m.prototype={constructor:m,ad:function(){var a=this.kT.kj;this.FT="gc-spread-floatBlockCanvas";this.GT="gc-spread-host-container";this.HT="gc-spread-host";this.IT="gc-spread-lineCanvas";this.JT=h("div");c(this.JT).addClass("gc-spread-floatBlockCanvas-container").css(["position","overflow","box-sizing"],["absolute","hidden","content-box"]);this.DT=h("canvas");t.Kn(this.DT,null,a);c(this.DT).addClass(this.FT).css(["left","top","position"],[0,0,"absolute"]);this.ET=h("div");c(this.ET).addClass(this.GT).css(["position","box-sizing","overflow"],["absolute","content-box","hidden"]);this.qo=h("div");c(this.qo).addClass(this.HT+" gc-no-user-select").css("left top width height position word-wrap word-break white-space overflow box-sizing unselectable line-height".split(" "),[0,0,"100%","100%","absolute","break-word","normal","pre-wrap","hidden","content-box","on","normal"]);c(this.ET).append(this.qo);c(this.JT).append(this.DT).append(this.ET);this.KT=h("div");c(this.KT).addClass("gc-spread-lineCanvas-container").css(["position","overflow","pointer-events"],["absolute","hidden","none"]);this.LT=h("canvas");t.Kn(this.LT,null,a);c(this.LT).addClass(this.IT).css(["left","right","position"],[0,0,"absolute"]);c(this.KT).append(this.LT);this.MT=[];this.NT=7;this.kv=this.qS=!1;m.ao(this,"init",[this.DT,this.qo])},OT:function(){var a=this.kT.kj;this.PT||a&&(this.PT=a.nQ().PT);this.PT&&(this.PT.appendChild(this.KT),this.QT(),this.PT.appendChild(this.JT),this.RT(this.DT,".floatBlockCanvas"),this.RT(this.ET,".hostContainer"),this.ST()?this.TT():this.UT(),this.AT=this.zT(),this.VT())},WT:function(){this.JT&&this.KT&&this.PT&&(this.XT(this.DT,".floatBlockCanvas"),this.XT(this.ET,".hostContainer"),this.YT(),this.ZT(),this.$T(),c(this.JT).remove(),c(this.KT).remove())},_T:function(){return this.kT.width()*this._zoomFactor},aU:function(){return this.kT.height()*this._zoomFactor},zT:function(){var a=this.kT;return a!==this.wT.bU||3!==a.commentState()||a.ignoreDefaultLocation()?this.cU(a.location()):a._3=this.cU(d(9,-18))},cU:function(a){var b,e,c=this.kT,f=c&&c.kj,g=this._zoomFactor,k=d(0,0);return f&&(b=this.dU(f,c.nT,c.oT,this.WE,this.aS),null!==b.x&&void 0!==b.x&&null!==b.y&&void 0!==b.y&&b.width&&b.height&&(e=f.am(),k.x=b.x+b.width+a.x*g-e.Br,k.y=b.y+a.y*g-e.Cr)),k},dU:function(a,b,c,d,f){var e,k,h,m=J(0,0,0,0),p=a.am(),l=a&&a.getViewportTopRow(d),n=a&&a.getViewportLeftColumn(f),q=this._zoomFactor,t=g(a,n,c,!1),r=g(a,l,b,!0);return b>=l?m.y=r:m.y=-r,c>=n?m.x=t:m.x=-t,e=a.getSpan(b,c),void 0!==e&&null!==e?(m.height=g(a,b,b+e.rowCount,!0),m.width=g(a,c,c+e.colCount,!1)):(m.height=(a&&a.getRowHeight(b))*q,m.width=(a&&a.getColumnWidth(c))*q),m.x+=p.Br,m.y+=p.Cr,k=p.hs,h=p.fs,1===d?m.y+=h:2===d&&(m.y+=h+p.jr),1===f?m.x+=k:2===f&&(m.x+=k+p.er),m},eU:function(a){var b,e,c=this.kT,f=c&&c.kj,g=this._zoomFactor,k=d(0,0);return f&&(b=this.dU(f,c.nT,c.oT,this.WE,this.aS),null!==b.x&&void 0!==b.x&&null!==b.y&&void 0!==b.y&&b.width&&b.height&&(e=f.am(),k.x=(a.x-(b.x+b.width-e.Br))/g,k.y=(a.y-(b.y-e.Cr))/g)),k},fU:function(){this.AT=this.zT();this.BT();this.CT();this.VT()},gU:function(){this.AT=this.zT();this.CT()},hU:function(){var a,b=this.kT;b.dynamicMove()?b.dynamicSize()?this.iU():(this.jU(),this.CT()):(this.BT(),this.CT(),a=this.eU(this.AT===b._3?this.zT():this.AT),b.location(a))},qT:function(){this.AT=this.zT();this.VT()},jU:function(){var a=this.kT,b=this.kU();this.AT=b;a.location(this.eU(b),!1);this.VT()},kU:function(){var a,b,c,f,k=this.kT,k=k&&k.kj,h=this._zoomFactor;b=k&&k.getViewportLeftColumn(this.aS);var m=k&&k.getViewportTopRow(this.WE),p=0;for(a=0;athis.nU&&a<=this.lT&&e.dynamicSize()&&(this.lT+=b);this.iU()},tI:function(a,b){var e=this.kT;a<=this.lU?e.dynamicMove()&&(this.lU+=b,this.mT+=b):a>this.lU&&a<=this.mT&&e.dynamicSize()&&(this.mT+=b);this.iU()},GR:function(a,b){var e=this.kT,c=a+b-1;al.x+l.width&&(e+=l.x+l.width-1-h)),e=n(l.width-1,e),kl.y+l.height&&(d+=l.y+l.height-1-m)),d=n(l.height-1,d),c(this.JT).css({left:g,top:k,width:e,height:d}),x=e,y=d,t.Pn(this.DT,x,y),w=r(0,x-2*(p+E.borderWidth())),z=r(0,y-2*(p+E.borderWidth())),c(this.ET).css({width:w,height:z}),u=w,B=z,A=E.padding(),A&&(u-=Math.ceil(f(A.left)+f(A.right)),B-=Math.ceil(f(A.top)+f(A.bottom))),c(a).css({width:r(0,u),height:r(0,B)}))},DU:function(a){var b,c,e,f,g=this.kT,k=this.AT;a.x===k.x&&a.y===k.y&&a.width===g.width()&&a.height===g.height()||(b=this.eU(d(a.x,a.y)),c=a.width,e=a.height,f=g.location(),b.x===f.x&&b.y===f.y||g.location(b,!1),c!==g.width()&&g.width(c,!1),e!==g.height()&&g.height(e,!1),g.dynamicMove()&&(this.AT=d(a.x,a.y)))},CU:function(){var a=this.kT;R(a&&a.kj)?(this.RT(this.DT,".floatBlockCanvas"),this.RT(this.ET,".hostContainer"),this.QT(),this.UT(),this.TT()):(a.locked()?(this.XT(this.DT,".floatBlockCanvas"),this.FU(this.DT),this.XT(this.ET,".hostContainer"),this.FU(this.ET),this.DT.style.cursor="default",this.ET.style.cursor="default"):(this.RT(this.DT,".floatBlockCanvas"),this.RT(this.ET,".hostContainer")),a.lockText()?(this.YT(),this.FU(this.qo),this.$T(),this.FU(this.BF),(a.locked()||1!==a.commentState())&&a.commentState(3),this.qo.style.cursor=a.locked()?"default":"move"):(this.UT(),this.TT()),this.QT())},yU:function(){var a=this.kT,b=this.wT,c=a&&a.kj;switch(a.commentState()){case 1:b.GU(a);this.ST()&&this.HU();0p.x?d(b.left+f.left,b.top+f.top):b.top+f.top+g.height()m.x+m.width&&(b-=k-(m.x+m.width));b=n(m.width,b);am.y+m.height&&(f-=h-(m.y+m.height));f=n(m.height,f);c(this.KT).css("left",g).css("top",a).css("width",b).css("height",f);t.Pn(this.LT,b,f);p.x-=g;p.y-=a;l.x-=g;l.y-=a;this.LU(p,l)},LU:function(a,b){var c,e;this.MU||(this.MU=this.LT.getContext("2d"));c=this.MU;e=this.kT.borderColor();c.strokeStyle=e;c.clearRect(0,0,t.Nn(this.LT),t.On(this.LT));c.beginPath();c.moveTo(a.x,a.y);c.lineTo(b.x,b.y);c.stroke();c.save();x.Dn(c,a.x,a.y);c.fillStyle=e;c.beginPath();e=z(b.y-a.y,b.x-a.x);c.rotate(e);c.moveTo(0,0);c.lineTo(7,-4);c.lineTo(7,4);c.lineTo(0,0);c.fill();x.Dn(c,-a.x,-a.y);c.closePath();c.restore()},wU:function(){var a,b,d,f,g,k,h,m=this.kT,p=m.kj;this.NU=this.kT.commentState();this.OU||(this.OU=this.DT.getContext("2d"));a=this.OU;b=t.Nn(this.DT);d=t.On(this.DT);f=c(this.ET).outerWidth();g=c(this.ET).outerHeight();k=this.NT;a.clearRect(0,0,b,d);this.kT.showShadow()&&(this.QU(a,b,d),h=2*(k+2),a.clearRect(k,k,b-h,d-h),this.PU(a,k,f,g));R(p,m)&&this.RU(a,k,b,d,f,g);a.restore()},PU:function(a,b,c,d){a.fillRect(b+2,d+b,c,2);a.fillRect(c+b,b+2,2,d)},QU:function(a,b,c){var e,d;switch(this.NU){case 1:a.beginPath();for(d=0;d=3*b?(l(h,0,w(f/2-b/2),b,"w-resize"),l(h,d-b,w(f/2-b/2),b,"e-resize")):(h.push(null),h.push(null)),g>=3*b?(l(h,w(d/2-b/2),0,b,"n-resize"),l(h,w(d/2-b/2),f-b,b,"s-resize")):(h.push(null),h.push(null)),a.restore(),a.fillStyle="white",a.strokeStyle="#939393",a.linewidth=1,x.Dn(a,.5,.5),c.each(h,function(){if(e){var b=this.x,c=this.y,d=this.width,f=this.height;a.beginPath();a.fillRect(b,c,d-1,f-1);a.strokeRect(b,c,d-1,f-1);a.stroke();a.closePath()}}),x.Dn(a,-.5,-.5))},SU:function(){var a,b,d=this,f=d.EU(d.WE,d.aS);d.TU?c(d.TU).remove():d.TU=h("div");a=c(d.TU);b=c(d.ET);a.addClass("gc-spread-moveResizeContainer").css("position left top width height border".split(" "),["absolute",d.AT.x+d.NT-f.x,d.AT.y+d.NT-f.y,b.outerWidth()-2,b.outerHeight()-2,"gray solid thin"]);d.UU?c(d.UU).remove():d.UU=h("div");a=c(d.UU);a.bind("mousemove",function(a){d.BD(a)}).bind("mouseup",function(a){d.CD(a)}).css("position overflow top left width height background z-index".split(" "),["absolute","hidden",f.y,f.x,f.width,f.height,"rgba(255,255,255,0.01)",901]);a.append(d.TU);d.PT&&d.PT.appendChild(d.UU)},VU:function(a){var b,e,f,g,k,h,m,p=this.NT,l=this._zoomFactor,n=this.wT.WU;n.XU&&(b=this.YU(),e=a.pageX/l-n.x+b.x,f=a.pageY/l-n.y+b.y,0!==e||0!==f)&&(a=this.EU(this.WE,this.aS),b=c(this.TU),0>n.ZU?(k=n.$U.x+e,h=n.$U.y+f,g=this.cU(d(k,h)),b.css(["left","top"],[g.x+p-a.x,g.y+p-a.y])):(m=this._U(e,f,n.ZU),g=this.cU(d(m.x,m.y)),b.css(["left","top","width","height"],[g.x+p-a.x,g.y+p-a.y,m.width*l-2*p-2,m.height*l-2*p-2])))},IU:function(){var a,b=this.kT;this.ST()||(a=this.wT.xT,c(this.qo).remove(),this.YT(),c(a).remove(),c(this.ET).append(a),this.aV(a),this.BU(a),c(a).focus(),a.selectionStart=a.value.length,this.TT(),2!==b.commentState()&&b.commentState(2))},HU:function(){var a,b=this.kT,d=b.kj;this.ST()&&(a=this.wT.xT,c(a).remove(),this.$T(),c(this.ET).append(this.qo),this.aV(this.qo),this.UT(),m.ao(this,"detachEditor",this.qo),2===b.commentState()&&b.commentState(3),c(a).val()!==b.text()&&d.wu().execute({cmd:"changeComment",sheetName:d.name(),comment:b,oldValue:b.text(),newValue:c(a).val(),propertyName:"text"}))},bV:function(a){var b=this.kT.kj,c=-1;return 0===a||2===a?c=b.getViewportHeight(a):1===a&&(c=g(b,b.getViewportBottomRow(0)+1,(b&&b.getViewportTopRow(2))+1,!0)),c},cV:function(a){var b=this.kT.kj,c=-1;return 0===a||2===a?c=b.getViewportWidth(a):1===a&&(c=g(b,b.getViewportRightColumn(0)+1,(b&&b.getViewportLeftColumn(2))+1,!1)),c},EU:function(a,b){var c=this.kT.kj.am(),e=c.Ft(a,b);return 0===a&&0===b||0===a&&2===b||2===a&&0===b||2===a&&2===b?e=J(0,0,c.hs+c.er+c.js,c.fs+c.jr+c.gs):0===a&&1===b||2===a&&1===b?e=J(c.hs,0,c.er,c.fs+c.jr+c.gs):1===a&&0===b||1===a&&2===b?e=J(0,c.fs,c.hs+c.er+c.js,c.jr):1===a&&1===b&&(e=J(c.hs,c.fs,c.er,c.jr)),e},aV:function(a){var b=this.kT,e=c(a);a!==this.BF&&a!==this.qo||(a===this.BF?a.value=b.text():a.innerHTML=k.Ob(b.text()),e.css("font-family font-style font-size font-weight color background-color text-align text-decoration".split(" "),[b.fontFamily(),b.fontStyle(),b.fontSize(),b.fontWeight(),b.foreColor(),b.backColor(),b.horizontalAlign(),b.textDecoration()]),b.padding()?e.css("padding",""+b.padding()):e.css("padding","0px"))},sU:function(){return this.JT&&this.JT.parentNode},ST:function(){return this.sU()&&this.kT===this.wT.JU()&&0n.ZU?this.qS=!0:this.kv=!0),c=h.mm,e=h.Vs(),f=d(a.pageX-e.left,a.pageY-e.top),g=h.hitTest(f.x,f.y),c.rG={KG:g.rowViewportIndex,MG:g.colViewportIndex,sG:g.hitTestType},c.$F=f,c.qG(),c.lV=!0,a.stopPropagation()))},yT:function(a,b,c){var e,d,f,k,h,m,p,l,n,q,t,r,x,y,v,w,z,u,B,A,E,D,F=this.kT,M=F&&F.kj,G=this.NT,H=this._zoomFactor,P=this.aS,I=this.WE,K=this.EU(I,P);return 1===arguments.length?(e=this._T(),d=this.aU()):3===arguments.length&&(e=b*H,d=c*H),f=a.x,k=a.y,h=M.am(),m=this.dU(M,0,0,I,P),p=a.x+(0-(m.x-h.Br))+e-G,l=a.y+(0-(m.y-h.Cr))+d-G,0===P?(n=0-G,t=h.width-h.Br):1===P?(x=g(M,M.getViewportRightColumn(0)+1,M&&M.getViewportLeftColumn(1),!1),n=K.x-G-x,y=this.cV(2),t=y):2===P&&(n=0-G,t=0),ft&&(this.kv?e-=p-t:this.qS?f-=p-t:(v=this.wT.bU&&!F.ignoreDefaultLocation()?9:F.location().x,w=2*C(v)+(M&&M.getColumnWidth(F.oT))+F.width(),z=f-w,z>n?f=z:fn?zr&&(this.kv?d-=l-r:this.qS?k-=l-r:l>r&&(E=l-r,D=k-E,Dr.ZU?(h=r.$U.x+c,m=r.$U.y+e,f=this.cU(d(h,m)),g=this.yT(f),k=this.eU(d(g.x,g.y)),k.x===n.location().x&&k.x===n.location().y||q.wu().execute({cmd:"changeComment",sheetName:q.name(),comment:n,oldValue:n.location().clone(),newValue:k,propertyName:"location"})):(n.autoSize(!1),p=this._U(c,e,r.ZU),f=this.cU(d(p.x,p.y)),g=this.yT(f,p.width,p.height),k=this.eU(d(g.x,g.y)),l=[],k.x===n.location().x&&k.y===n.location().y||l.push(new x(q,{cmd:"changeComment",sheetName:q.name(),comment:n,oldValue:n.location().clone(),newValue:k,propertyName:"location"})),g.width!==n.width()&&l.push(new x(q,{cmd:"changeComment",sheetName:q.name(),comment:n,oldValue:n.width(),newValue:g.width,propertyName:"width"})),g.height!==n.height()&&l.push(new x(q,{cmd:"changeComment",sheetName:q.name(),comment:n,oldValue:n.height(),newValue:g.height,propertyName:"height"})),0=a.row&&b=a.col&&e=a&&d=a&&bd.zIndex()&&(d=b):d=b);return d?{x:a,y:c,comment:d,area:this.CV(d,a,c)?"comment_editor":"comment_indicator"}:null},KU:function(a){var c=this.xV();return a===this.bU?c+2:a===this.rV?c+1:a.zIndex()},wV:function(){this.jT.forEach(function(a){a.hU()})},cQ:function(){this.jT.forEach(function(a){a.qT()})},fromJSON:function(a,c){var e,b,d;if(a&&0!==a.length)for(e=0;ec.row&&(e=c.row),d>c.col&&(d=c.col);return{r:e,c:d}}function J(a,b,c){switch(a){case 0:return b===c;case 1:return b!==c;case 2:return b>c;case 3:return b>=c;case 4:return ba.row?c.BAND_INDEX_CONST:a.row;var e=0>a.col?c.BAND_INDEX_CONST:a.col;b=new c.uf(null,null,b,e,b+a.rowCount-1,e+a.colCount-1)}else{if(!M(a)||isNaN(a=p(a)))throw z.C(w.SR)().Exp_NotSupport;b=new c.Expression(2);b.value=a}return b};R=function(a,b,c,e){var d=function(d,f){var g,k;return this.hasOwnProperty("_ps")||(this._ps={}),g=this._ps,0===arguments.length?void 0!==g[a]?e?e.call(this,g[a]):g[a]:b:(g[a]!==d&&(k=void 0!==g[a]?g[a]:b,g[a]=d,!1!==f&&c&&c.call(this,d,k)),this)};return d.isDefault=function(a){return a===b},d};Q=function(a,b){var c=this;return b||(b={}),a||(a=c),m.each(a,function(a,e){var d,f=c[e];P(f)||(d=f.call(c),"iconCriteria"===e?b[e]=d:ka.Mia(d)?b[e]=ka.Daa(d):d&&d.toJSON?b[e]=d.toJSON():P(d)||f.isDefault(d)||(b[e]=d))}),b};K=function(a,b,c){if(b){var e=this,d;a||(a=e);m.each(a,function(a,f){var g,k,h;if(d=b[f],!P(d))if("ranges"===f){g=[];for(k=0;kc},l=function(a,b){var c=n(a);return barguments.length){if(g=e,a&&d&&3===d.conType()){var k=a.getActualStyle(b,c);k&&(0===d.RV()?g=k.backColor:1===d.RV()&&(g=k.foreColor))}}else g=f;return g}}function g(e,d){return!P(e)&&e.evaluate(a,b,c,d)}var k,h,m=this;return k=f(m.item1(),e),h=f(m.item2(),d),g(m.item1(),k)+g(m.item2(),h)>m.RV()},cellValueConditionEvaluate:function(a,b,c,e){a=this.getExpected(a,b,c);return this.cellValueConditionCheckCondition(a,e)},cellValueConditionCheckCondition:function(a,b){var c,e,d,f=0,k=!1;if(P(b)&&P(a))switch(this.RV()){case 0:case 3:case 5:return!0;case 1:case 2:case 4:return!1;default:return!1}return"boolean"==typeof a?J(this.RV(),b,a):(c={},P(b)?this.treatNullValueAsZero()?(k=!0,f=0):f=b:"boolean"!=typeof b&&g(b,c)&&(f=c.value,k=!isNaN(f)),k?(e=0,d=!1,g(a,c)&&(e=c.value,d=!0),d?J(this.RV(),f,e):1===this.RV()):"string"==typeof b&&("string"==typeof a?J(this.RV(),b,a):1===this.RV()))},numberConditionEvaluate:function(a,b,c,e){a=this.numberConditionGetExpected(a,b,c);return this.integerValue()&&(a=isNaN(a)?null:0=b.getMonth();case 1:return 3<=b.getMonth()&&5>=b.getMonth();case 2:return 6<=b.getMonth()&&8>=b.getMonth();case 3:return 9<=b.getMonth()&&11>=b.getMonth();default:return!1}}var e,d,f,g,k,h,m,p;if(e=b,this.ignoreBlank()&&(P(e)||""===e))return!0;try{e=E.Wh(e)}catch(Ta){return!1}if(f=this.expectTypeId(),0===f){switch(d=null,f=null,g=new Date,k=new Date(g.getFullYear(),g.getMonth(),g.getDate(),g.getHours(),g.getMinutes(),g.getSeconds(),g.getMilliseconds()),a){case 3:r(k,v(k)-6);d=n(k);f=q(g);break;case 1:r(k,v(k)-1);d=n(k);f=q(k);break;case 0:d=n(g);f=q(g);break;case 2:r(k,v(k)+1);d=n(k);f=q(k);break;case 8:r(g,v(g)-g.getDay()-7);k.setDate(v(k)-k.getDay()-1);d=n(g);f=q(k);break;case 7:r(g,v(g)-g.getDay());r(k,v(k)-k.getDay()+6);d=n(g);f=q(k);break;case 9:r(g,v(g)-g.getDay()+7);r(k,v(k)-k.getDay()+13);d=n(g);f=q(k);break;case 5:r(g,1);g.setMonth(g.getMonth()-1);r(k,0);d=n(g);f=q(k);break;case 4:r(g,1);r(k,1);k.setMonth(k.getMonth()+1);r(k,0);d=n(g);f=q(k);break;case 6:r(g,1),g.setMonth(g.getMonth()+1),r(k,1),k.setMonth(k.getMonth()+2),r(k,0),d=n(g),f=q(k)}if(!P(d)&&!P(f))return h=L(5,5,d,null),m=L(5,3,f,null),p=L(0,1,null,null,null,null,null,h,m),p.evaluate(null,0,0,e)}else if(d=this.A4(null,0,0),!P(d)){if(1===f)return d===e.getFullYear();if(2===f)return c(d,e);if(3===f)return d===e.getMonth();if(4===f)return d===e.getDay();if(5===f)return d===v(e)}return!1},textLengthConditionEvaluate:function(a,b,c,e){var d,f;return P(e)||""===e?this.ignoreBlank():(d=P(e)?0:(""+e).length,f=this.A4(a,b,c),"number"==typeof f&&J(this.RV(),d,f))},top10ConditionEvaluate:function(a,b,c,e){var d,f;if(P(e)||""===e)return this.ignoreBlank();if(d=this.A4(a,b,c),!P(d)&&(f=this.getTopValues(a,d,this.ranges()))){a=0;try{a=this.Pa(e)}catch($a){return!1}if(ja.Bb(f,a))return!0}return!1},A4:function(a,b,c){a=this.getExpected(a,b,c);return a=parseInt(a,10),isNaN(a)||!isFinite(a)?null:a},adjustRange:function(a,b){return X(a.row,a.col,Math.min(a.rowCount,b.getRowCount()),Math.min(a.colCount,b.getColumnCount()))},getTopValues:function(a,b,c){var e,d,f,g,k,h,m,p=0===this.type()?1:-1,l=[];if(!c)return l;c=this.UV(a,c);e=ea(c);for(k=0;kb&&(l=l.slice(0,b)),l},Pa:function(a){return("number"==typeof a||Z(a,Date))&&b?p(a):null},uniqueConditionEvaluate:function(a,c,e,d){var f,g,k,h;return P(d)||""===d?this.ignoreBlank():(b&&M(d)&&(d=p(d)),f=this.getExpected(a,c,e),g={},E.Uh(f,g),k=g.value,!P(k)&&(h=this.getDuplicated(a,this.ranges()),!P(h)&&ja.Bb(h,d)?!0===k:!0!==k))},getDuplicated:function(a,c){var e,d,f,g,k,h,l,n,q=[],t=[],r=this.UV(a,c);if(r){e=ea(r);for(d=0;dh;case 1:return n=h;case 3:return n<=h;case 4:return!a&&n>h+m;case 5:return!a&&nh+2*m;case 7:return!a&&nh+3*m;case 9:return!a&&n=this.type()&&(this.TV=this.YV("STDEV",this.ranges())))},YV:function(a,e){var d,f,g,k;if(!b)return null;if(d=ga.findGlobalFunction(a)){f=[];g=ea(e);for(k=0;k=a?this.ranges()[e]=X(d.row+k,d.col+h,d.rowCount,d.colCount):fa?k+m<=a+b?e.push(g):this.ranges()[f]=X(g.row-q,g.col-t,g.rowCount,g.colCount):k<=a&&ae[c].row?e[c].row:a,b=b>e[c].col?e[c].col:b;d.Uu=-1===a?0:a;d.SV=-1===b?0:b}return d},dateOccurringRuleCreateCondition:function(){return L(6,null,this.type(),null,null)},top10RuleCreateCondition:function(){return L(8,null,this.rank(),null,null,this.type(),this.ranges())},uniqueRuleCreateCondition:function(){return L(9,null,!1,null,null,null,this.ranges())},duplicateRuleCreateCondition:function(){return L(9,null,!0,null,null,null,this.ranges())},averageRuleCreateCondition:function(){return L(10,null,null,null,null,this.type(),this.ranges())},createCondition:function(){return this[H[this.ruleType()]+"CreateCondition"]()},reset:function(){switch(this.ranges(null),this.condition(null),this.style(null),this.stopIfTrue(!1),this.priority(1),this.operator(6),this.value1(null),this.value2(null),this.text(""),this.formula(null),this.type(0),this.rank(10),this.ruleType()){case 1:this.operator(6);break;case 2:this.operator(0);break;case 4:this.style(0);break;case 5:this.type(0);this.rank(10);break;case 8:this.type(0)}},toJSON:function(){return Q.call(this,c)},fromJSON:function(a,b){K.call(this,c,a,b)}},m.extend(b.prototype,e),b}(F);w.NormalConditionRule=G;u=function(){return function(a,b){this.type=a;this.value=b}}();w.ScaleValue=u;q=function(a){function e(b,c,e,d,f,g,k,h,m,p,l){var n,q,t,r,x,y,v,w,z;a.call(this,b,null,l);this.highestValueCached=this.lowestValueCached=null;this.cached=!1;this.cW=null;n=c;q=e;t=d;r=f;x=g;y=k;v=h;w=m;z=p;1>=arguments.length&&(n=1,q=null,t=S(255,248,105,107),r=4,x=50,y=S(255,255,235,132),v=2,w=null,z=S(255,99,190,123));this.minColor(t);this.minValue(q);this.minType(n);this.midColor(y);this.midValue(x);this.midType(r);this.maxColor(z);this.maxValue(w);this.maxType(v)}var d,f;m.inherit(e,a);d="ruleType ranges minType minValue minColor maxType maxValue maxColor midType midValue midColor priority".split(" ");return f={stopIfTrue:function(){return!1},minValue:R("minValue",null),minType:R("minType",5),minColor:R("minColor",null),midValue:R("midValue",50,null,function(a){if(this.lh){if(2===this.midType())return this.dW(this.lh);if(1===this.midType())return this.eW(this.lh)}return a}),midType:R("midType",null),midColor:R("midColor",null),maxType:R("maxType",7),maxValue:R("maxValue",null),maxColor:R("maxColor",null),isScaleRule:function(){return!0},createCondition:function(){return null},fW:function(a){a=L(8,null,null,null,null,1).getTopValues(a,1,this.ranges());return 0=b&&(d=this.eW(a),f=this.dW(a),"undefined"!==typeof d&&null!==d&&"undefined"!==typeof f&&null!==f)?d+(f-d)*b/100:null},oW:function(a,b,c,e){var d,f,k,h,m,p=this.mW(a,b,c,e);if(!isNaN(p)&&0<=p&&100>=p){e=0;d=this.ranges();f=ea(d);for(k=0;kf?0:f;case 5:return g=this.eW(a),0=c?1:(a-b)/(c-b)},rW:function(a,b,c){var e,d,f,g,k,h;return 0<=a&&1>=a?(e=N.ec(b),d=N.ec(c),f=e.a*(1-a)+d.a*a,g=e.r*(1-a)+d.r*a,k=e.g*(1-a)+d.g*a,h=e.b*(1-a)+d.b*a,S(parseFloat(f/255),parseInt(g,10),parseInt(k,10),parseInt(h,10))):null},YV:function(a,e){var d,f,g,k;if(!b)return null;if(d=ga.findGlobalFunction(a)){f=[];g=ea(e);for(k=0;kk)return null;if(isNaN(g)){if(!isNaN(f)&&!isNaN(k))return this.qW(d,f,k)}else if(!isNaN(f)&&!isNaN(k))return d=k?2:f<=d&&d<=g?this.qW(d,f,g):1+this.qW(d,f,k)}catch(wa){}}return null},twoScaleRuleEvaluate:function(a,b,c,e){var d,f,k,h;if(!P(e)){if(d={},f=M(e)&&g(e,d)?d.value:NaN,isNaN(f))return null;if(k=this.pW(a,b,c,this.minType(),this.minValue()),h=this.pW(a,b,c,this.maxType(),this.maxValue()),!P(k)&&!P(h))return d=this.qW(f,k,h),this.rW(d,this.minColor(),this.maxColor())}return null},threeScaleRuleEvaluate:function(a,b,c,e){var d,f,k,h,m;if(this.lh=a,!P(e)){if(d={},f=M(e)&&g(e,d)?d.value:NaN,isNaN(f))return null;if(k=this.pW(a,b,c,this.minType(),this.minValue()),h=this.pW(a,b,c,this.midType(),this.midValue()),m=this.pW(a,b,c,this.maxType(),this.maxValue()),!P(k)&&!P(m)&&!P(h))return k>m?null:f<=k||k===m?f>=m?this.maxColor():this.minColor():f>=m?this.maxColor():k<=f&&f<=h?(d=this.qW(f,k,h),this.rW(d,this.minColor(),this.midColor())):(d=this.qW(f,h,m),this.rW(d,this.midColor(),this.maxColor()))}return null},evaluate:function(a,b,c,e){return this[H[this.ruleType()]+"Evaluate"](a,b,c,e)},ad:function(){this.minValue(null);this.minType(1);this.midValue(50);this.midType(4);this.maxValue(null);this.maxType(2);10===this.ruleType()&&(this.minColor(S(0,255,255,255)),this.maxColor(S(255,99,190,123)));11===this.ruleType()&&(this.midValue(50),this.midType(4),this.minColor(S(255,248,105,107)),this.midColor(S(255,255,235,132)),this.maxColor(S(255,99,190,123)))},reset:function(){this.ranges(null);this.condition(null);this.style(null);this.ad();this.lh=null;this.stopIfTrue(!1);this.priority(1)},toJSON:function(){return Q.call(this,d)},fromJSON:function(a,b){K.call(this,d,a,b)}},m.extend(e.prototype,f),e}(F);w.ScaleRule=q;D=function(b){function c(a,c,e,d,f,g){var k=a,h=c,m=e,p=d,l=f;0===arguments.length&&(k=5,h=null,m=7,p=null,l=S(255,99,142,198));b.call(this,12,k,h,null,null,null,null,m,p,null,g);this.ad(l)}var e,d;m.inherit(c,b);e="ruleType ranges gradient color showBorder borderColor dataBarDirection negativeFillColor useNegativeFillColor negativeBorderColor useNegativeBorderColor axisPosition axisColor showBarOnly minType minValue maxType maxValue priority".split(" ");return d={gradient:R("gradient",!0),color:R("color",null),showBorder:R("showBorder",!1),borderColor:R("borderColor","black"),dataBarDirection:R("dataBarDirection",0),negativeFillColor:R("negativeFillColor","red"),useNegativeFillColor:R("useNegativeFillColor",!0),negativeBorderColor:R("negativeBorderColor","black"),useNegativeBorderColor:R("useNegativeBorderColor",!1),axisPosition:R("axisPosition",0),axisColor:R("axisColor","black"),showBarOnly:R("showBarOnly",!1),ad:function(a){this.gradient(!0);this.color(a);this.showBorder(!1);this.borderColor("black");this.dataBarDirection(0);this.negativeFillColor("red");this.useNegativeFillColor(!0);this.negativeBorderColor("black");this.useNegativeBorderColor(!1);this.axisPosition(0);this.axisColor("black");this.showBarOnly(!1)},reset:function(){this.ranges(null);this.condition(null);this.style(null);this.ad(S(255,99,142,198));this.stopIfTrue(!1);this.priority(1);this.minValue(null);this.minType(5);this.midValue(null);this.midType(null);this.maxValue(null);this.maxType(7);this.minColor(null);this.midColor(null);this.maxColor(null)},sW:function(a,b,c,e){var d,f,g=null,k=e?this.maxType():this.minType();e=e?this.maxValue():this.minValue();if(6!==k&&4!==k)return this.pW(a,b,c,k,e);for(c=0;c=c&&a>b?[1,e]:a<=b&&a=c?[.5,e]:a<=b?[b/c*.5,e]:[.5*B(a/c),e]:0b?(f=c>B(b)?.5:c/d,g=c>B(b)?b/d:-.5,0=c?[f,e]:[a/c*f,e]:0>a?a<=b?[g,e]:[a/b*g,e]:[0,e]):0>=c&&0>b?c===b?[-.5,e]:a>=c?[-c/b*.5,e]:a<=b?[-.5,e]:[-a/b*.5,e]:0===c&&0===b?[0,e]:(e=-1,[-1,e])},vW:function(b,c,e,d){var f,g,k,m,p=B(c),l=B(e),n=B(e-c);return 0=e&&0>c?(f=a(p,l),g=h(p,l),k=B(b),m=0>c?-1:1,d=0>c?1:0,k<=g&&k=f&&k>g?[m,d]:g===f?[.5*m,d]:[m*(b-c)/n,d]):0c?(d=B(c)/n,0===b?[0,d]:b>=e?[1-d,d]:[a(b,c)/n,d]):0===e&&0===c?(d=.5,0===b?[0,d]:[.5*m,d]):(d=-1,[-1,d])},wW:function(a,b,c,e){return 0===this.axisPosition()?this.vW(a,b,c,e):1===this.axisPosition()?this.uW(a,b,c,e):this.tW(a,b,c,e)},evaluate:function(a,b,c,e){var d,f,k,h,m,p,l,n,q,t,r;if(!P(e)){if(d={},f=M(e,!0)&&g(e,d)?d.value:NaN,isNaN(f))return null;if(k=this.sW(a,b,c,!1),h=this.sW(a,b,c,!0),Z(k,Date)&&(k=ka.Ra(k)),Z(h,Date)&&(h=ka.Ra(h)),!P(k)&&!P(h))return k>h&&(m=h,h=k,k=m),l=this.wW(f,k,h,p),!l||2>ea(l)?null:(n=l[0],p=l[1],q=0>f&&this.useNegativeFillColor()?this.negativeFillColor():this.color(),t=0>f&&this.useNegativeBorderColor()?this.negativeBorderColor():this.borderColor(),r=this.axisColor(),q=fa.Om(a,q),t=fa.Om(a,t),r=fa.Om(a,r),{fillColor:q,borderColor:t,showBorder:this.showBorder(),axisColor:r,isGradient:this.gradient(),direction:this.dataBarDirection(),axisLocation:p,scale:n,showBarOnly:this.showBarOnly()})}return null},toJSON:function(){return Q.call(this,e)},fromJSON:function(a,b){K.call(this,e,a,b)}},m.extend(c.prototype,d),c.paintDataBar=function(a,b,c,e,d,f){var g,k,h,m,p,l,n,q,t;k=new C.Rect(c+2,e+2,d-4,f-4);e=k.x;var r=k.y,x=y(B(k.width*b.scale)),v=k.height;if(0===b.axisLocation)0>=b.scale&&(x=0);else if(1===b.axisLocation)0>b.scale?e=e+k.width-x:x=0;else{g=y(k.width*b.axisLocation+e)+.5;k=k.y;f-=2;a.lineWidth=1;a.strokeStyle=b.axisColor;a.beginPath();for(h=0;h<=f;h+=2)1===b.direction?(a.moveTo(2*c+d-g,k+h),a.lineTo(2*c+d-g,k+h+1)):(a.moveTo(g,k+h),a.lineTo(g,k+h+1));a.stroke();0b.scale?e=g-x:x=0}b.showBorder&&(e=y(e)+.5,--x,r+=.5,--v);g=e;f=e+x;1===b.direction&&(g=2*c+d-e-x,f=2*c+d-e);0<=x&&0<=v&&(m=b.fillColor,b.isGradient&&(m=a.createLinearGradient(g,r,f,r),p=N.ec(b.fillColor),l=S(p.a,y(229.5+p.r*(1-.9)),y(229.5+p.g*(1-.9)),y(229.5+p.b*(1-.9))),n=0>b.scale?1-.9:.9,q=b.fillColor,t=0>b.scale?1:0,1===b.direction?(m.addColorStop(n,q),m.addColorStop(t,l)):(m.addColorStop(n,l),m.addColorStop(t,q))),a.fillStyle=m,a.fillRect(g,r,x,v),b.showBorder&&0=this.iconSetType()?(this.NV=Array(2),this.NV[0]=new A(!0,4,33),this.NV[1]=new A(!0,4,67)):10<=this.iconSetType()&&14>=this.iconSetType()?(this.NV=Array(3),this.NV[0]=new A(!0,4,25),this.NV[1]=new A(!0,4,50),this.NV[2]=new A(!0,4,75)):15<=this.iconSetType()&&19>=this.iconSetType()?(this.NV=Array(4),this.NV[0]=new A(!0,4,20),this.NV[1]=new A(!0,4,40),this.NV[2]=new A(!0,4,60),this.NV[3]=new A(!0,4,80)):19=p:f>p,f=q&&(k=q-f),g+h-1>=t&&(h=t-g),m=0;m=d.ranges().length&&(this.GW(d),this.AW.splice(e,1)));this.QV()},GR:function(a,b){this.aW(a,b,!0)},HR:function(a,b){this.aW(a,b,!1)},Nm:function(){var a,b,c,e=this.AW;if(null!==e&&0=ma(P,x)&&x.contains(a+h,b+m)&&(P.push(x),u=X(e+h,f+m,-1,-1),v+z>=g+a?u.rowCount=g-h:a=k+b?u.colCount=k-m:bB?(G.push(n),H.push(t)):H[B]=H[B].concat(t))}a=0;for(b=G.length;a=ma(w,t)&&t.contains(b+f,c+g)&&(w.push(t),b>x&&n.push(X(x,y,b-x,r)),c>y&&n.push(X(a(b,x),y,h(b+e,x+v)-a(b,x),c-y)),c+dd||16>f)&&(a.rect(c,e,d,f),a.clip(),a.beginPath()),r.paintIconSet(a,h,c,e,d,f,g,k.imageLoader),v=h.showIconOnly),a.restore()),y||v},bp:function(a,b,c){if(P(c)||3===c)for(a=this.getRules(a,b),b=0,c=ea(a);ba;a++)for(c=D("tr"),h=G(c).appendTo(k),Q(c),c=0;3>c;c++)g=D("td"),G(g).appendTo(h),Q(g),0===c?d(g,"gc-layout-table-first-column"):2===c?d(g,"gc-layout-table-last-column"):1===c&&(0===a?d(g,"gc-filter-sort-asc-container gc-sort-container ui-menu-item"):1===a&&d(g,"gc-filter-sort-desc-container gc-sort-container ui-menu-item"));this.table.appendTo(f);f.css(["box-shadow","padding","width","height","box-sizing"],["rgba(0, 0, 0, 0.4) 2px 4px 5px","2px",this.lY+"px",this.mY+"px","content-box"]);d(f[0],"gc-filter-dialog-style gc-no-user-select")},GY:function(a){var c,d,g;d=a.originalEvent;g=a.wheelDelta;var f=a.detail;c=this.jY;var k=n(c),h=this.gY,l=n(h),q=0;z(g)&&z(f)&&(g=d.wheelDelta,f=d.detail);d=f?f:g/-40;g=a.wheelDeltaY;A.sl()&&g&&(d=g/-40);d=(0<=d?1:-1)*Math.floor(Math.abs(d));k&&(q=m(G(c[0]).text(),h));c=q+d;c>l-k&&(c=l-k);0>c&&(c=0);this.HY(c);r(a)},QQ:function(){var a=this,c=a.IY,h=!1,g=!1,f=G(".gc-filter-item"),k=G(".gc-filter-button");c.addEventListener("mousewheel",function(c){a.GY(c)},!1);c.addEventListener("DOMMouseScroll",function(c){a.GY(c)},!1);G("#gc-sortASC").bind("mouseup",function(c){h&&(h=!1,a.JY(!0),a.close(),r(c))}).bind("mousedown",function(a){r(a);h=!0});G("#gc-sortDES").bind("mouseup",function(c){g&&(g=!1,a.JY(!1),a.close(),r(c))}).bind("mousedown",function(a){r(a);g=!0});G(".gc-filter-sort").bind("mouseover",function(){J(G(".gc-filter-hover")[0],"ui-state-hover gc-filter-item-hover");d(this,"gc-filter-hover form-control well ui-state-hover gc-filter-item-hover")}).bind("mouseout",function(){J(this,"gc-filter-hover form-control well ui-state-hover gc-filter-item-hover")});G("#gc-filterCheckAll").bind("mousedown",function(a){r(a)}).bind("mouseup",function(c){a.KY(c,!0)});G("#gc-filterUnCheckAll").bind("mousedown",function(a){r(a)}).bind("mouseup",function(c){a.KY(c,!1)});f.bind("mouseover",function(){J(G(".gc-filter-hover")[0],"ui-state-hover gc-filter-item-hover");d(this,"gc-filter-hover form-control well ui-state-hover gc-filter-item-hover")}).bind("mouseout",function(){J(this,"gc-filter-hover form-control well ui-state-hover gc-filter-item-hover")}).bind("click",function(){G(this).find("input")[0].click()});f.find("input").bind("click",function(c){c&&c.stopPropagation?c.stopPropagation():window.event.cancelBubble=!0;a.LY(G(this).parent()[0]);a.MY()});G("#gc-filterSearch").bind("keydown",function(a){13===(a.which||a.keyCode)&&a.preventDefault()}).bind("keyup",function(c){0>m(c.keyCode,[9,37,38,39,40])&&(a.NY(c),a.MY())}).bind("search",function(c){a.NY(c);a.MY()});k.bind("mouseover",function(){d(this,"gc-filter-button-hover ui-state-hover ")}).bind("mouseout",function(){J(this,"gc-filter-button-hover ui-state-hover ")});k.bind("mousedown",function(){J(this,"gc-filter-button-hover ui-state-hover ");d(this,"gc-filter-button-active")}).bind("mouseout",function(){J(this,"gc-filter-button-active")});G("#gc-filterOK").bind("click",function(){var c=a.hY;a.OY(c);a.PY(c);a.close()});G("#gc-filterCancel").bind("click",function(){a.close()});a.xo.bind("mousewheel",function(a){r(a)}).bind("DOMMouseScroll",function(a){r(a)}).bind("keydown.ui-filter-dialog",function(c){a.QY(c)}).bind("keyup.ui-filter-dialog",function(a){r(a)})},KY:function(a,c){var d=[],g;this.kY.forEach(function(a){(g=a.style)&&"none"!==g.display&&d.push(a)});G(d).find("input").prop("checked",c);this.hY=c?this.gY.concat([]):[];this.MY();r(a)},QY:function(a){var c,h,g,f,k,l,q,t,y,w=this.elementList,e=G(".gc-filter-item-hover"),b=e[0],v=m(a.which||a.keyCode,[27,13,38,40,9]);if(0===v)this.close(),r(a);else if(1===v&&1===n(e))a=e.attr("id"),c="gc-sortASC"===a,h=this.hY,c||"gc-sortDES"===a?(this.JY(c),this.close()):"gc-filterCancel"===a?this.close():(this.OY(h),this.PY(h),this.close());else if(1m(b,h)&&(t=l?t+g:g+3,c=l?f[t+1]:f[t]);l&&tm&&(f=!1)),f))||(this.HY(c),c++,c>=n(this.gY))););return l},LY:function(a){var c,d,g,f=this.hY;(a=G(a).find("span.gc-filter-item-text"))&&(c=a.text(),d=m(c,f),g=m(c,this.gY),0>d?f.push(c):f.splice(d,1),0<=g&&(this.activeItemIndex=g))},RY:function(a){return"string"!==typeof a&&(a=G(a),0!==n(a)&&!!(a.hasClass("ui-button-disabled")||a.hasClass(" ui-state-disabled")||a.hasClass("gc-filter-button-disable")))},PY:function(a){var c,d,g,f,k,h=this.sheet;if(h)try{if(h.suspendPaint(),c=this.filterButtonInfo,d=c.rowFilter,d)g=c.col,k=(f=d.table&&d.table())?g-f.range().col:-1,a&&(f?h.Wq(q.TableFiltering,{sheet:h,sheetName:h.Cj,table:f,tableCol:k,filterValues:a}):h.Wq(q.RangeFiltering,{sheet:h,sheetName:h.Cj,col:g,filterValues:a})),d.filter(g),a&&(f?h.Wq(q.TableFiltered,{sheet:h,sheetName:h.Cj,table:f,tableCol:k,filterValues:a}):h.Wq(q.RangeFiltered,{sheet:h,sheetName:h.Cj,col:g,filterValues:a}))}finally{h.resumePaint()}},OY:function(a){var c,d,g;c=this.filterButtonInfo;var f=c.col,k=c.rowFilter,h=n(a),m=B().Blanks;if(k&&(k.removeFilterItems(f),h!==n(this.fY)))for(c=0;c=h&&ae?1:c=h||(l=a[m],q=D("div"),t=D("input"),r=D("span"),e=G(q),f=C(this.XY(l),f),d(q,"gc-filter-item ui-corner-all gc-no-user-select"),e.css("display padding border-width margin height box-sizing".split(" "),["block",b/2,B+"px",y+"px",this.rY+"px","content-box"]).attr("unselectable","on").appendTo(G(k)),d(t,"gc-filter-item-input"),G(t).attr({style:"margin: 3px; padding: 0",type:"checkbox",value:l}).appendTo(e),d(r,"gc-filter-item-text"),G(r).html(w(l)).appendTo(e),this.kY.push(q),this.iY.push(t),this.jY.push(r));this.YY=f;this.ZY=g;A.empty();l=D("table");q=D("tr");t=D("tr");r=D("td");e=D("td");b=D("td");this.$Y=y=D("td");this._Y=b;Q(q);Q(t);Q(r);Q(b);Q(y);Q(e);q.appendChild(r);q.appendChild(b);t.appendChild(y);t.appendChild(e);l.appendChild(q);l.appendChild(t);r.appendChild(k);Q(l);G(l).css(["width","height"],[z,u]).attr({cellspacing:0,cellpadding:0,border:0});this.aZ();A.append(l);this.bZ();this.cZ()},HY:function(a){var c,d,g,f,k=this.gY,h=this.jY,m=this.St,l=0,q=a;for(c=0;cd&&(k.xB=!0,k.wB=!!(c>g-f)),c>g&&(k.wB=!0,k.xB=!!(a>d-f)),k},XY:function(a){var m,l,g,f,k,n,q,t,r,y;return this.CY||(m=D("input"),l=D("span"),g=document.body,f=G(m).attr("type","checkbox").addClass("gc-filter-item-input"),k=G(l),d(m,"gc-filter-item-input"),d(l,"gc-filter-item-text"),this.DY=m,this.CY=l,g.insertBefore(m,null),g.insertBefore(l,null),n=c(f.css("marginLeft"))+c(f.css("marginRight")),q=c(f.css("paddingLeft"))+c(f.css("paddingRight")),t=c(k.css("marginLeft"))+c(k.css("marginRight")),r=c(k.css("paddingLeft"))+c(k.css("paddingRight")),h(n)&&(n=0),h(q)&&(q=0),h(t)&&(t=0),h(r)&&(r=0),this.eZ=f.width()+n+q,this.fZ=t+r,f.css("display","none"),k.css("display","none")),y=G(this.CY).html(w(a)).width(),y+this.eZ+this.fZ+1+2*this.pY+2*this.qY},bZ:function(){var a=this.defaultItemWidth,a=this.fB?this.YY:this.gB?a-this.hB:a;G(this.kY).css("width",a)},cZ:function(){var a={};G.each(this.hY,function(c,d){a[d]=d});this.iY.forEach(function(c){G(c).prop("checked",!z(a[G(c).val()]))})},JY:function(a){var c,d,g=this.filterButtonInfo,f=g.rowFilter,k=this.sheet;f&&k&&k.hK()&&(c=g.col,d={sheet:k,sheetName:k.Cj,col:c,ascending:a,cancel:!1},k.Wq(q.RangeSorting,d),d&&!1===d.cancel&&(k.suspendPaint(),f.sortColumn(c,a),k.resumePaint(),k.Wq(q.RangeSorted,d)))},MY:function(){var a=G("#gc-filterOK");0l?this.getColumnCount():l+k.colCount,d=0>l?0:l,1>a?(c=this.getRowCount(1)-1,q=1):(c=a-1,q=3),0<=c))for(;d=m&&cc.row?0:c.col},pZ:function(c,d){return 0>c.row?d.getColumnCount():c.col+c.colCount},addFilterItem:function(c,d){var a=this.kj,h=this.range,m=this.rZ,l=m[c];if(G(d))throw Error(O.C(I.SR)().Exp_FilterItemIsNull);if(-1>c||c>=a.getColumnCount())throw Error(O.C(I.SR)().Exp_InvalidColumnIndex);h&&!(h=a.Tq(h),c=h.col+h.colCount)&&(l||(l=[]),l.push(d),m[c]=l)},removeFilterItems:function(c){this.NX(c);this.unfilter(c)},NX:function(c){var d=this.rZ;this.sZ(c);d[c]&&d.splice(c,1,null)},unfilter:function(c){var d,a,m=this.kj;if(m){if(d=[],a=this.Je,G(c))for(c=n(a)-1;0<=c;c--)d.push(a[c]),this.OX(a[c]);else d.push(c),this.OX(c),this.reFilter();this.tZ(m,1,d)}},uZ:function(c){var d,a,m,l,n;a=this.range;if((this.OX(c),this.rZ[c]&&a)&&(d=a.col,-1===d||!(c=d+a.colCount))){a=this.kj.Tq(a);d=a.row;a=a.rowCount;m=this.vZ(c,d,a);n=this.wZ(d,a,c,m);for(l=d;l=d+m.rowCount)||n(a)>=n(this.Je)))},reset:function(){this.unfilter();this.rZ=[];this.Je=[];this.yZ=[];this.LX={};this.qZ={};this.zZ=null},Dl:function(c,d,a){var h,m,l,n=!1,q=this.kj,p=this.range;return p&&(p=q.Tq(p,a),h=p.row,m=p.col,l=d>=m&&dh-1&&l?n=!0:3===a&&c===h-1&&l&&(n=!0)),n},getFilterItems:function(c){return this.rZ[c]||[]},getFilteredItems:function(){return this.yZ},sortColumn:function(c,d){var a,h,m,l=this.kj;l&&(a=l.Tq(this.range),l.suspendPaint(),h={index:c,ascending:d},m=l.sortRange(a.row,a.col,a.rowCount,a.colCount,!0,[h]),m&&(this.zZ=h,this.isFiltered(c)&&this.reFilter()),l.resumePaint())},getSortState:function(c){var d=this.zZ,a=0;return d&&d.index===c&&(a=d.ascending?1:2),a},reFilter:function(){var c,d=this.Je,a=n(d);this.LX={};this.yZ=[];this.Je=[];for(c=0;c=n(l)||!(0>a||mD(h,d)))},rI:function(c,d){var a,h,m,l,q,r,p=this.range;if(p){if(a=this.kj.getRowCount(void 0)-d-1,h=p.row,m=p.col,l=p.rowCount,q=p.colCount,-1=c&&l<=a&&(r[l+d]=r[l],r[l]=void 0)}this.reFilter()}},tI:function(c,d){var a,h,m,l,q,w,p,g,f,k,x;if(l=this.range){if(a=l.row,h=l.col,m=l.rowCount,l=l.colCount,q=0,w=-1,p=0,0<=c&&this.CZ()){for(g=0;gw&&(w=0,p=this.kj.getColumnCount()-d);for(g=w+p-1;g>=w;g--)g>=c&&(f=g+d,k=D(this.Je,g),0<=k&&(this.Je[k]=f),x=this.rZ[g],n(x)&&(r(this.rZ,g),this.rZ[f]=x));this.reFilter()}},GR:function(c,d){var a,h,m,l,n,q,p,g,f,k=this.range;if(k){if(a=0,h=this.kj.getRowCount(void 0)+d-1,m=k.row,l=k.col,n=k.rowCount,q=k.colCount,-1=c&&a=c+d&&(g=a,f=p[g],f&&(p[g-d]=f,p[g]=void 0));this.reFilter()}},BZ:function(c){this.range=c},EZ:function(c){var d,a,m,l,n,q,r,p,g;g=this.kj;var f=this.range;if(f)if(c){if(!c.equals(f)){if(m=f.col,l=f.colCount,n=c.col,q=c.colCount,d=g.getColumnCount(),this.isFiltered()&&!(0>m&&0>n))for(0>m&&(m=0,l=d),0>n&&(n=0,q=d),d=0;da||a>=n+q)&&this.removeFilterItems(a);if(r=f.row,m=f.rowCount,p=c.row,l=c.rowCount,g=g.getRowCount(void 0),this.isFiltered()&&this.LX&&!(0>r&&0>p))for(0>r&&(r=0,m=g),0>p&&(p=0,l=g),d=0;da||a>=p+l)&&(this.LX[a]=void 0)}}else this.reset();!this.CZ()||c&&c.contains(-1,this.DZ())||(this.zZ=null);this.BZ(c)},HR:function(c,d){var a,h,m,l,q,w,p,g;q=this.range;a=this.DZ();var f=c+d;if(q){0<=c&&this.CZ()&&(a>=c&&a=f&&this.DZ(a-d));a=q.row;h=q.col;m=q.rowCount;l=q.colCount;0>h?(h=0,l=this.kj.getColumnCount()+d):l=q.colCount;for(q=h;q=c&&(qm&&(m=-1,n=-1),h.containsRange(F(m,q.col,n,q.colCount))&&this.unfilter()):h.containsRange(q)&&this.unfilter())},fromJSON:function(c,d){var a,h,m,l,q,r,p,g,f,k,x,w,z;if(c){if(a=c.range,h=c.filterItemMap,m=this.rZ,l=c.sortInfo,q=c.showFilterButton,r=c.filterButtonVisibleInfo,a&&(this.range=F(a.row,a.col,a.rowCount,a.colCount)),H)for(a=0;ae&&(d=[D,A,r][e](c%7),b="Light"+a,d.name(b),d.builtInName(b)),d}function D(a){a=G(a);var b=a+" 80",c=new L;return c[g](F(a,0,a,1,0,0,0,1)),c[k](F(a,0,a,0,0,1,0,1)),c[P](F(a,b)),c[W](F(a,0,a,1)),c[x](F(a,0,a,1)),c[Z](F(a,b)),c[f](F(a,0,a,1,0,1)),c}function A(a){a=G(a);var b=new L;return b[g](F(a,a,ea,1)),b[k](F(a,0,0,0,1,1,1,1)),b[P](F(a,0,0,0,0,1)),b[V](F(a,0,0,0,0,1)),b[Z](F(a,0,0,0,1)),b[e](F(a,0,0,0,1)),b[W](F(a,0,0,1)),b[x](F(a,0,0,1)),b[f](F(a,0,0,1,0,6)),b}function r(a){a=G(a);var b=a+" 80",c=new L;return c[g](F(a,0,0,1,0,0,0,2)),c[k](F(a,0,0,0,1,1,1,1,1,1)),c[P](F(a,b)),c[Z](F(a,b)),c[W](F(a,0,0,1)),c[x](F(a,0,0,1)),c[f](F(a,0,0,1,0,6)),c}function n(a){var b,d=a-1,e=null,f=ib(d/7);return 0<=f&&4>f&&(e=[w,z,C,c][f](d%7),b="Medium"+a,e.name(b),e.builtInName(b)),e}function w(a){a=G(a);var b=a+" 20",c=a+" 80",d=new L;return d[g](F(b,a,ea,1)),d[k](F(b,0,0,0,1,1,1,1,1)),d[P](F(b,c)),d[Z](F(b,c)),d[W](F(b,0,0,1)),d[x](F(b,0,0,1)),d[f](F(b,0,ga,1,0,6)),d}function z(a){a=G(a);var b=ea,c=a+" 60",d=a+" 80",e=new L;return e[g](F(b,a,ea,1,0,0,0,2,0,1)),e[k](F(b,d,0,0,0,0,0,0,1,1)),e[P](F(b,c)),e[Z](F(b,c)),e[W](F(b,a,ea,1)),e[x](F(b,a,ea,1)),e[f](F(b,a,ea,1,0,2,0,0,0,1)),e}function C(a){var b=G(a),c=0===a?ga:"#D3D3D3",d=new L;return d[g](F(ga,b,ea,1,0,2,0,2)),d[k](F(c,0,0,0,1,new sa(ga,2),1,new sa(ga,2),0===a?1:0,1)),d[P](F(c,"#D3D3D3")),d[Z](F(c,"#D3D3D3")),d[W](F(c,b,ea)),d[x](F(c,b,ea)),d[N](F(c,b,ea,1)),d[S](F(c,b,ea,1)),d[f](F(ga,0,ga,0,0,6)),d}function c(a){a=G(a);var b=a+" 40",c=a+" 80",d=a+" 60",e=a+" 80",h=new L;return h[g](F(b,c,ga,1,1,1,1,1,0,1)),h[k](F(b,c,0,0,1,1,1,1,1,1)),h[P](F(b,d)),h[Z](F(b,d)),h[W](F(b,0,0,1)),h[x](F(b,0,0,1)),h[f](F(b,e,ga,1,1,new sa(a,2),1,1,0,1)),h}function m(b){var c,d=b-1,e=null,f=ib(d/7);return 0<=f&&2>f&&(e=[h,a][f](d%7),c="Dark"+b,e.name(c),e.builtInName(c)),e}function h(a){var b=G(a),c=ga,d=0===a?b+" 25":b+" -25",e=0===a?b+" 50":b;a=0===a?b:b+" -50";var h=new L;return h[g](F(ea,c,ea,1,0,0,0,2)),h[k](F(b,e,ea)),h[P](F(b,d)),h[Z](F(b,d)),h[W](F(ea,d,ea,1,0,0,2)),h[x](F(ea,d,ea,1,2)),h[f](F(ea,a,ea,1,0,2)),h}function a(a){var b,c,d,e,h;return b=G(a),c=0>a||3a||3a||3k?(a.isDragCopy&&(p<=h||p>=h+l)||!q&&(ph+l))&&(e=!1,f.HZ(-1,p,-1,1)&&(e=!0,t=d().Exp_DragDropShiftTableCell),e||q||!f.HZ(-1,h,-1,l)||(t=g)):0<=k&&0>h&&(q&&(n<=k||n>=k+m)||!q&&(nk+m))&&!q&&f.HZ(k,-1,m,-1)&&(t=g));c.invalidMessage=t});a.bind(ya.ResetBinding+".table",function(){a.tables.IZ()});a.bind(ya.InitBinding+".table",function(){var b,c,d,e;b=a.tables;b.IZ();aa&&a.suspendCalcService();b=b.all();c=0;for(d=b.length;cg&&(g=e),f>k&&(k=f));return{lastNonNullRow:g,lastNonNullCol:k}}});Ka.extend(u.Workbook.prototype,{jga:function(a){var b,c,d,e=this.sheets;if(e)for(d=0;da||a>=this.OZ))switch(c=arguments,c.length){case 0:return g&&g.filterButtonVisible();case 1:if(d=c[0],e=typeof d,"number"===e)return g&&g.filterButtonVisible(d);if("boolean"===e&&g){f.suspendPaint();for(c=0;ca)return;p=c[a]-c[p]}else if(h){n=B=0;for(p=this.dataRange().row;p=E&&M&&(H=D===E,I=y||D===F-1,M.Yo(d,H,w,I,z))));this.bandColumns()&&(E=K[ja](),F=E+K[oa](),0=E&&M&&(H=D===E,I=z||D===F-1,M.Yo(d,r,H,y,I))))}(K=K[k]())&&K.Yo(d,u,w,A,z)}},YZ:function(a,b){var c,e,f,g,k;if((a!==this.cj||b!==this.dj)&&(c=this.OW())){if((0>a||c.getRowCount()b||c.getColumnCount()g||c+f>l.getRowCount()||e+g>l.getColumnCount())&&J(d().Exp_TableResizeOutOfRange),c===this.cj&&a.intersect(this.cj,this.dj,this.Xj,this.OZ)||J(d().Exp_TableResizeInvalidRange)),p=this.Nz,n=e+g-1,q=this.dj,t=this.dj+this.OZ-1,this.dj=e,this.OZ=g,et){for(g=t+1;g<=n;g++)m=new H(this.TZ()),p.push(m);k&&this.PZ(t+1,n-t);h&&this.SZ(t+1,n-t)}else n>=q&&(this.ZZ(n,t),p.splice(p.length-(t-n),t-n));f!==this.Xj&&(r=this.wq,x=this.dataRange(),y=x.row,v=x.rowCount,r?f>this.Xj?(w=y+v,z=f-this.Xj,l&&l.addRows(w,z),h||(b||this.c$(w,z),this.Xj=f,this.d$(w,z))):l&&(u=this.Xj-f,l.deleteRows(y+v-u,u)):(h&&(this.SZ(),A=this.footerIndex()),this.Xj=f,h&&(this.e$(),this.QZ(A))));this.a$();this.f$(B,this.dataRange())}},f$:function(a,b){var c,d,e,f,g,k,h,m,l,p,n=this.ZX;n&&(c=a.col,d=a.rowCount,e=a.colCount,f=b.col,g=b.rowCount,k=b.colCount,h=a.row+d,m=c+e,l=b.row+g,p=f+k,lh&&n.onRowsAdded(d,l-h),f>c&&n.onColumnsRemoved(0,f-c),pm&&n.onColumnsAdded(c+e-f,p-m))},a$:function(){var a=this.xr;a&&(a.EZ(this.dataRange()),a.reFilter())},RZ:function(){var a=this.xr;a&&(a.unfilter(),a.reset())},VZ:function(a){var b,c;null!==a&&(a=ba(a));for(b=0;ba||f.getRowCount()<=a))for(b=this.dj,c=this.OZ,e=0;e=this.cj+this.Xj?f:(d=this.cj,e=this.cj+this.Xj-1,a<=d?this.cj+=b:a<=e&&(c||(f=this.c$(a,b)),this.Xj+=b),f)},KZ:function(a,b){var c,d,e;a<=this.cj+this.Xj-1&&this.d$(a,b);c=this.ZX;d=this.dataRange().row;e=this.endRow();a>=d&&a<=e&&c&&c.onRowsAdded(a-d,b);this.xr&&this.xr.rI(a,b)},c$:function(a,b){var c=this.cj,d=this.wq;return!!d&&(d.uL(a-(this.showHeader()?c+1:c),b),!0)},d$:function(a,b){if(aa){var c=this,d=c.OW();aa&&d.suspendCalcService();Aa(c.Nz,function(e,f){var g,k,h=f.dataAreaFormula();if(h)for(g=e+c.dj,k=a;k=this.dj+this.OZ)){if(c=this.dj,a<=this.dj)this.dj+=b;else if(a=c&&(g=this.ZX,g&&g.onColumnsAdded(a-c,b))}},GR:function(a,b,c){var d,e,f,g,k,h,m,l=!1;return a>=this.cj+this.Xj?l:(d=this.dataRange(),e=d.row,f=d.rowCount,g=this.cj,k=this.cj+this.Xj-1,a=e&&a=this.dj+this.OZ||(c=this.dj,d=this.dj,e=this.dj+this.OZ-1,a=c&&(f=this.ZX,f&&f.onColumnsRemoved(a-c,b)))},$b:function(a,b,c,d){var e,f,g,k,h,m,l,p=c,n=d;(e=this.OW())&&(p=e.getRowCount(),n=e.getColumnCount());e=0>a?0:a;f=0>a?p:c;g=Ia(e,0>b?0:b,f,0>b?n:d);k=this.headerIndex();this.MZ&&e<=k&&kb?f.addRows(a+b,c-b):c=u;u++)21>=u&&(T["light"+u]=q(u)),11>=u&&(T["dark"+u]=m(u)),T["medium"+u]=n(u);fa.TableThemes=T;B.prototype={add:function(a,b,c,d,e,f,g){return this.LA(this.kj,a,b,c,d,e,!0),this.Cz(new O(a,b,c,d,e,f||T.medium2,g))},addFromDataSource:function(a,b,c,e,f,g){var k,h,m,l,p;if(e||J(d().Exp_TableDataSourceNullError),Ra)return k=this.kj,k.suspendPaint(),h=new Ra,h.bind(e),m=h.getRowCount()+1,l=h.getColumnCount(),p=this.add(a,b,c,m,l,f,g),p.Fu(h),k.clearPendingChanges(),k.resumePaint(),p},find:function(a,b){var c,d,e,f=this.l$,g=f.length;for(d=0;d=k.length)))){h.suspendPaint();try{a.b$(e)}finally{h.resumePaint()}}},all:function(){var a=[];return Aa(this.l$,function(b,c){a.push(c)}),a},LA:function(a,b,c,e,f,g,k){var h,m,l,p;return b?Q(b)?0>c||1>f||c+f>a.getRowCount()?(k&&J(d().Exp_TableInvalidRow),!1):0>e||1>g||e+g>a.getColumnCount()?(k&&J(d().Exp_TableInvalidColumn),!1):(h=a.tables,h.rn(c,e,f,g)?(k&&J(d().Exp_TableIntersectError),!1):h.findByName(b)?(k&&J(d().Exp_TableHasSameNameError),!1):(m=aa&&a.Ms(c,e,f,g),l=m&&m.ranges,p=!0,l&&Aa(m,function(a,b){if(1=b}function K(a,b,c){var e=d();return e[va](a)[Da](b)[$a](c),e}function O(a,b){var c,d,e,f,k,h,m=a.KW,l=a._caption,p=F(a.slicerData),n=a.zoomFactor();if(b){b[Ha]&&(q(a.xo,b[Ha],p,l,n),x(a,zb));c=a.LW;d=I(b[Ha],b[na]);var t,r=b[na];r&&(r[Ga]||r[bb]||r[Na]||r[Na])&&(t=I(b[Ha],r),!(t[Ya]&&0=za(h)&&(p=S(a,Ub,za(h)-1),n=d=za(v)||(h=S(a,hc),!h))return null;e=a.columnCount();m=a.hX;f=(h.width-(e-2)*m*q)/e;g=a.itemHeight()*q+2*a.lX;d=h.x+c%e*(f+m*q);e=h.y+Math.floor(c/e)*(g+m*q)}return new kb.Rect(d,e,f,g)}function X(a){return 0=b;b++)a["light"+b]=function(a){return function(){var b="Accent "+a;return Ba("Light",a,"normal 11pt calibri",ba,J(1,"solid",b),J(0,"",""),J(1,"solid",b),ra,b+",Lighter 60%",J(1,"solid","#999999"),"#828282",b+",Lighter 80%",J(1,"solid","#CCCCCC"),ra,ba,J(1,"solid","#CCCCCC"),"#828282",ba,J(1,"solid","#E0E0E0"),ra,"#F9E36F",J(1,"solid","#999999"))}}(b),a["dark"+b]=function(a){return function(){var b="Accent "+a;return Ba("Dark",a,"normal 11pt calibri",ba,J(1,"solid",b),J(0,"",""),J(1,"solid",b),ba,b,J(1,"solid",b),b+",Darker 25%",b+",Lighter 60%",J(1,"solid",b+",Lighter 60%"),ra,"#C0C0C0",J(1,"solid","#C0C0C0"),"#959595","#DFDFDF",J(1,"solid","#DFDFDF"),ra,"#F9E36F",J(1,"solid","#999999"))}}(b);return a.other1=function(){return Ba("Other",1,"normal 11pt calibri",ba,J(1,"solid","#808080"),J(0,"",""),J(1,"solid","#A6A6A6"),ra,"#BFBFBF",J(1,"solid","#999999"),ra,"#D9D9D9",J(1,"solid","#CCCCCC"),ra,ba,J(1,"solid","#CCCCCC"),"#959595",ba,J(1,"solid","#E0E0E0"),ra,"#F9E36F",J(1,"solid","#999999"))},a.other2=function(){return Ba("Other",2,"normal 11pt calibri",ba,J(1,"solid","#4F81BD"),J(0,"",""),J(1,"solid","#4F81BD"),ra,"#A9C1E3",J(1,"solid","#999999"),"#828282","#D5E2F6",J(1,"solid","#CCCCCC"),ra,ba,J(1,"solid","#CCCCCC"),"#828282",ba,J(1,"solid","#E0E0E0"),ra,"#F9E36F",J(1,"solid","#999999"))},a}();ic=function(){function a(){E(this)}function c(){this.fX=B(this);E(this)}function d(b,c,d,e){return d||(d=a),kb.Ul.Pl(b,c,d,e)}function h(a,b,c){this.name(a,!1);this.xo=null;this.PW=6;this.EX=1;this.VW=14;this.KW=null;this.MW=27;this.XW=5;this.WW=this._caption=null;this.RW=28;this.SW=25;this.TW=3;this.UW=0;this.AX=!1;this.QW=3;this.cX=this.aX=this._W=this.$W=this.ZW=this.YW=null;this.dX=this.eX=0;this.bX=null;this.FX=2;this._items=[];this.NW={};this.kX=this.lX=1;this.tX=6;this.hX=2;this.jX=17;this.sX=0;this.zX=ba;this.DX="#F9E578";this.CX="red";this.BX="#B0ADB0";this.HX=this.GX=!1;this.vX=[];this.wX=[];this.xX=0;this.fX=[];this.pX=[];this.rX=[];this.gX=[];this.oX=[];this.slicerData=b;this.columnName=c;this.data=b.getData(c);this.exclusiveDatas=b.getExclusiveData(c);this.slicerData.attachListener(this);this.IX()}var m,l,q,y;h.getDefaultStyle=function(){var a=function(a,b,c,d,e,f,g,k){var h={};return h[Da]=a,h[va]=b,h[Va]=c,h[Ga]=d,h[bb]=e,h[Na]=f,h[Ya]=g,h[ta]=k,h},b=function(a,b,c){var d={};return d[jb]=a,d[Ta]=b,d[ib]=c,d},c=b(1,"solid","#808080"),d=b(0,"",""),e=b(1,"solid","#999999"),f=b(1,"solid","#CCCCCC"),g=b(1,"solid","#E0E0E0"),k=a("#F9E36F",ra,"normal 11pt calibri",e,e,e,e),h={};return h[Ha]=a(ba,ra,"normal 11pt calibri",c,c,c,c),h[na]=a(ba,ra,"bold 11pt calibri",d,d,d,b(1,"solid","#A6A6A6")),h[gb]=a("#BFBFBF",ra,"normal 11pt calibri",e,e,e,e),h[Za]=a("#D9D9D9",ra,"normal 11pt calibri",f,f,f,f),h[cb]=a(ba,ra,"normal 11pt calibri",f,f,f,f),h[La]=a(ba,"#959595","normal 11pt calibri",g,g,g,g),h[da]=k,h[Oa]=k,h[ca]=k,h[nb]=k,h};m=[[xa],[Ka,180],[Aa,210],["captionName",""],["columnCount",1,null,X],["itemHeight",21,null,X],["showHeader",!0],["sortState",1,c],["showNoDataItems",!0,c],["showNoDataItemsInLast",!0,c],["visuallyNoDataItems",!0,c],[Ia,h.getDefaultStyle(),function(a){O(this,a);E(this)}],["zoomFactor",1,null,X],["isLocked"],["disableResizingAndMoving"]];l={constructor:h,IX:function(){this.oX=r(this.data);this.gX=r(this.exclusiveDatas);var a=xb(Qa);this.xo=(H(a,[Hb,Cb,sb,Jb],[Gb,6*this.zoomFactor(),tb,Kb]),Ma(a).addClass(sc),x(this,zb),Ma(a).append(n(this)).append(w(this)),a);this.captionName(this.columnName,!1);W(this);this.onFiltered();O(this,this.style());E(this)},getDOMElement:function(){return this.xo},mX:function(a,b){var c,d,e=[];if(0!==b){c=ub.jf.quickSort(a);for(d=0;dthis.dX},Bw:function(a,b){this.JX(a,b)},JX:function(a,b){var c=b.newValue;c!==this.sX&&c<=this.nX.cw()&&(this.sX=c,k(this),p(this))},onDataChanged:function(){t(this)},onRowsChanged:function(){t(this)},onColumnNameChanged:function(a,b){this.columnName===a&&this._caption&&(this.columnName=b,this.captionName(b,!1),Ma(this._caption).text(b))},onColumnRemoved:function(a){a===this.columnName&&(this.slicerData.doUnfilter(a),(a=this.xo)&&Ma(a).unbind(".slicer"),Ma(this.xo).remove(),this.xo=null)},onFiltered:function(){var a=this.slicerData,b=this.columnName;this.fX=B(this);this.rX=a.getFilteredOutIndexes(b,2);this.pX=a.getFilteredOutIndexes(b,1);E(this)},AD:function(a){var b=N(this,a);if(b){8===b[lb]&&(this.HX=!0);if(5===b[lb])if(this.wX=[],this.GX=!0,a.ctrlKey){var c,d,e=this.exclusiveDatas,f=this.pX,k=V(this,b[rb]);d=this.vX;var h=this.wX;Pa.Bb(d,k)?Pa.Fb(d,k):d.push(k);for(c=0;cp||mq||!w&&!n))if(d)a.prototype.doFilter.call(this,b,c,d);else{if(e=w?this.getExclusiveData(b):this.getData(b),d=[],w)d=g;else for(f=this.ef(),g=this.ff(),f[q]||this.We(q),f=f[q],k=0;k=d&&(n=I(1,d,r,a),n.integerValue(z)),h=new Q(n),h.type(z?1:2),h.comparisonOperator(d),h};R.createDateValidator=function(d,l,q){var n,r,c,m,h=null,a=null,w=null,y=null;if(R.bW(l)?h=L(l,"\x3d"):a=l,R.bW(q)?w=L(q,"\x3d"):y=q,l=null,6===d&&(n=I(5,5,a,h),r=I(5,3,y,w),l=I(0,1,null,null,null,null,null,n,r)),7===d&&(n=I(5,2,a,h),r=I(5,4,y,w),l=I(0,0,null,null,null,null,null,n,r)),0<=d&&5>=d){switch(d){case 0:c=0;break;case 1:c=1;break;case 2:c=4;break;case 3:c=5;break;case 4:c=2;break;case 5:c=3}l=I(5,c,a,h)}return m=new Q(l),m.type(4),m.comparisonOperator(d),m};R.createTextLengthValidator=function(d,l,q){var n,r,c,m,h=null,a=null,w=null,y=null;return R.bW(l)?h=L(l,"\x3d"):a=l,R.bW(q)?w=L(q,"\x3d"):y=q,n=null,6===d&&(r=I(7,3,a,h),c=I(7,5,y,w),n=I(0,1,null,null,null,null,null,r,c)),7===d&&(r=I(7,4,a,h),c=I(7,2,y,w),n=I(0,0,null,null,null,null,null,r,c)),0<=d&&5>=d&&(n=I(7,d,a,h)),m=new Q(n),m.type(6),m.comparisonOperator(d),m};R.createFormulaValidator=function(d){if(!K.X3)return null;d=new Q(I(4,null,null,L(d,"\x3d"),4));return d.type(7),d};R.createFormulaListValidator=function(d){if(!K.X3)return null;d=new Q(H.fromFormula(d));return d.type(3),d};R.createListValidator=function(d){d=new Q(H.fromSource(d));return d.type(3),d};G.extend(K.Worksheet.prototype,{getDataValidator:function(d,l,q){return this.tq(d,l,"validator",q)},setDataValidator:function(d,l,q,z){var n,c;F(z)&&(z=3);(n=this.Iq(d,l,z))||(n=new K.Style);c=n.validator;n.validator=q;this.suspendEvent();this.setStyle(d,l,n,z);this.resumeEvent();(n=q&&q.condition())&&4===n.conType()&&(F(n.Uu)&&(n.Uu=-1!==d?d:0),F(n.SV)&&(n.SV=-1!==l?l:0));this.Bq("validator",d,l,z,c,q);-1!==d&&-1===l?this.kq(d,z,"validator",q,c):-1===d&&-1!==l&&this.pq(l,z,"validator",q,c)},isValid:function(d,l,q){var n,r;try{if(n=this,n.Ku=d,n.Lu=l,n.Mu=q,n.Ju=!0,r=n.getDataValidator(d,l))return r.isValid(n,d,l,q)}finally{n.Ku=-1,n.Lu=-1,n.Mu=null,n.Ju=!1}return!0},hm:function(){var d,l,q,u;return!this.x$&&(this.x$=!0,d=this.KH,d&&(l=d.parentNode,l&&l.removeChild(d),this.KH=null),q=this.y$,q&&(G(q).unbind("click"),l=q.parentNode,l&&l.removeChild(q),this.y$=null),u=this.lm,u&&(G(u).unbind("keydown").unbind("blur").unbind("click"),l=u.parentNode,l&&l.removeChild(u),this.lm=null),this.x$=!1,!0)}});K.Worksheet.$n("validator",{dispose:function(){this.hm()}});K.Style.$n("validator",{fromJson:function(d){if("validator"===d.p){var l=new Q;l.fromJSON(d.v);this.validator=l;d.r=!0}}});window.Yl.km.push(function(d,l){!l&&d.hm&&d.hm()});U.exports=R},function(U,u,l){var d=l(85),J=l(33),R=l(26),Q=l(140),K=d.Ul,O=d.kf,H=K.rl(),I=K.Ml,L=d.GC$,F=K.Nl,G=R.j.Fa,q=R.u,D=K.nl,A=document,r=Math.max,n=Math.min;L.extend(d.iI.prototype,{cs:function(l,u){function w(a,b){if(a&&a[b])return"function"==typeof a[b]?a[b]():a[b]}var c,m,h,a,z,y,t,E,M,p,g,f,k,x,W,P,V,Z,e,b,v,N,S;if(c=this,m=c.kj,h=m&&m.parent,h&&Q&&(a=m.hm(),a&&(z=h.getActiveSheet(),z&&m.name()===z.name()&&(y=m.getDataValidator(l,u),y&&(t=m.getCellRect(l,u),!c.oG(t)&&(E=h.xv(),M=K.vl(h.getHost()),y&&w(y,"showInputMessage")&&w(y,"inputMessage")&&(p=q.Gb,g=q.Ob,f=p(g(w(y,"inputTitle")),"\n","\x3cbr/\x3e"),k=p(g(w(y,"inputMessage")),"\n","\x3cbr/\x3e"),x=F("span"),L(x).css("position","absolute").css("border","1px #C0C0C0 solid").css("padding","3px 8px 3px 8px").css("background-color","#FFFFFF").css("box-shadow","1px 2px 5px rgba(0,0,0,0.4)").css("font","normal normal normal 12px/normal Arial").width("auto").height("auto").css("top",t.y+t.height+5).css("left",t.x+t.width/2).css("z-index",M).html("\x3cb\x3e"+f+"\x3c/b\x3e\x3cbr/\x3e"+k).attr("gcUIElement","gcValidationInputMessage").appendTo(E),m.KH=x),y&&3===w(y,"type")&&w(y,"inCellDropdown"))))))){W=w(y,"condition").getValidListImp(m,l,u);h=W.length;P=F("select");a=m.getText(l,u);z=-1;y=A.createDocumentFragment();for(p=0;pz&&g===a&&(z=p),g instanceof Date&&(g=R.l.Vb(g,"M/d/yyyy h:mm:ss")),V=F("option"),V.value=g,V.text=g,y.appendChild(V));P.appendChild(y);P.selectedIndex=0f?(h=k,m=n,g=r,e=n,a.addColumns(m,g),c.copy?a.copyTo(-1,m<=h?h+g:h,-1,m,-1,g,y):(a.moveTo(-1,m<=h?h+g:h,-1,m,-1,g,y),a.deleteColumns(m<=h?h+g:h,g),hk&&(h=f,m=l,g=q,b=l,a.addRows(m,g),c.copy?a.copyTo(m<=h?h+g:h,-1,m,-1,g,-1,y):(a.moveTo(m<=h?h+g:h,-1,m,-1,g,-1,y),a.deleteRows(m<=h?h+g:h,g),hf?0:f,z=0>k?0:k,n=0>n?0:n,q=0>q?0:q,e=0>f?m.getRowCount(void 0):l.rowCount,b=0>k?m.getColumnCount(void 0):l.columnCount;l.insert?0>k&&0<=f&&(d=m.tables,!l.copy&&d&&d.rn(n,-1,1,-1)&&(c=y(m,u,e,w),g.nA=c.headerCells,g.oA=c.rows,g.bA=a(m,u,z,e,b,w))):(0>f&&(c=h(m,q,b,w),g.hA=c.headerCells,g.iA=c.columns,l.copy||(c=h(m,z,b,w),g.jA=c.headerCells,g.kA=c.columns)),0>k&&(c=y(m,n,e,w),g.lA=c.headerCells,g.mA=c.rows,l.copy||(c=y(m,u,e,w),g.nA=c.headerCells,g.oA=c.rows)),g.pA=B(m,n,q,e,b),g.eA=a(m,n,q,e,b,w),l.copy||(g.qA=B(m,u,z,e,b),g.bA=a(m,u,z,e,b,w),m.isDirtySuspended()||(g.cA=new r(m,L(u,z,e,b),w))),m.isDirtySuspended()||(g.fA=new r(m,L(n,q,e,b),w)));g.rA=m.Nr;g.sA=m.Pr;g.tA=m.Jl;g.uA=m.Kl},undo:function(){var a,c,h,l,g,f,k,q,r,y,w,z,e,b,v,A,B,C,D,F,G,H,K,I,J,L=0;if(this.canUndo()){if((a=this.kj,c=this.VQ,h=c.fromRow,l=c.fromColumn,g=c.toRow,f=c.toColumn,k=c.rowCount,q=c.columnCount,!a.pu(h,l,k,q,a.getRowCount(void 0),a.getColumnCount(void 0)))||!c.insert&&!a.pu(g,f,k,q,a.getRowCount(void 0),a.getColumnCount(void 0)))return!1;z=c.io;this.Lz(a,!0);try{c.insert?0<=l&&0<=h||(0<=l?(e=l,r=q,c.copy?a.deleteColumns(f,r):(y=f,w=l,lh?0:h,A=0>l?0:l,B=0>g?0:g,C=0>f?0:f,D=0>h?a.getRowCount(void 0):k,F=0>l?a.getColumnCount(void 0):q,u.X3&&n.Jz(a,B,C,D,F),G=null,H=null,K=z.bA,!c.copy&&K&&K.data&&K.data.Py()&&(H=n.Iz(a,v,A,D,F)),I=z.eA,I&&I.data&&I.data.Py()&&(G=n.Iz(a,B,C,D,F)),L+=m(this,z.pA),L+=m(this,z.hA),L+=m(this,z.iA),L+=m(this,I),L+=m(this,z.lA),L+=m(this,z.mA),L+=m(this,z.qA),L+=m(this,z.jA),L+=m(this,z.kA),L+=m(this,K),L+=m(this,z.nA),L+=m(this,z.oA),L&&a&&(d(a,h,l,k,q),G&&n.Bu(a,B,C,D,F,z.dA?z.dA.wy():[],0),H&&n.Bu(a,v,A,D,F,z._z?z._z.wy():[],0))),L&&a&&(-1!==z.tA&&-1!==z.uA&&(J=a.getSelections()[0],J.contains(z.tA,z.uA)?a.Jr(z.tA,z.uA):a.Jr(J.row,J.col)),-2!==z.rA&&-2!==z.sA&&-1!==z.tA&&-1!==z.uA&&a.showCell(z.tA,z.uA,3,3))}finally{this.Mz(a,!0)}}return 0G||m.col===G&&m.colCount===K&&m.row>F;for(m=y?F:G;m=r;)a=n?q.getValue(c,l):q.getValue(l,h),d(a)&&(m||(m=new K(r)),m.Eb(0,l,a)),l--;return m},m_:function(c,d,a,l,n,q,r){var h,m,g,f=[],k=d,t=0<=n,y=A(q);for(h=0;h=q,g=k<=q,c&&(y||t&&m||!t&&g)?(f.unshift(k),1===l?k-=n:2===l?k/=n:3!==l||A(r)||(k=this.p_(!0,r,d,k,n,h+1))):!c&&(y||t&&g||!t&&m)&&(f.push(k),1===l?k+=n:2===l?k*=n:3!==l||A(r)||(k=this.p_(!1,r,d,k,n,h+1)));return f},n_:function(c,d,a){var h=[],m=1===a;if(m||2===a){1===c.h_()&&c.Sb(c.e_[0]+1,m?c.k_(c.f_[0]+1):c.Ey()[0]);for(a=0;a=R&&(M||!(M||p&&J.Ps&&J.Ps(I)))&&this.o_(J,e,F,b,E,G,l,g);a?u+=M?a.colCount:a.rowCount:u++}if(y&&y.h_()&&(t=this.s_(M,c,h,v,A,y,n,q,C,D,g),n&&t))return t}return null},o_:function(c,d,a,l,n,q,r,w){var h,g,f=c.zl();H.X3&&(c.hasFormula(d,a)||c.hasFormula(l,n))&&(c.setFormula(l,n,null),0!==r&&4!==r||(h=c.Bj(),c.getFormula(d,a)&&L.CalcOperatorAdjustor.copyFormula(h,d,a,h,l,n,1,1)));c.setValue(l,n,q);q=64;w&&(q|=128);c.copyTo(d,a,l,n,1,1,q);f.isEmpty()||(c.removeSpan(l,n,3),g=f.find(d,a),g&&d===g.row&&a===g.col&&c.Sq(l,n,g.rowCount,g.colCount,3))},s_:function(c,d,a,l,n,q,r,w,p,g,f){var k,h,m,t,y,z,e,b,v,u,A=this.kj,B=c?a.col:a.row;k=c?d.col:d.row;a=c?a.colCount:a.rowCount;d=c?d.colCount:d.rowCount;if(p=p||0,y=q.h_(),z=(B-k-p)/d,e=this.t_(q.e_,q.f_),e){m=[];for(h=0;h=B&&(c?this.o_(A,l,v,n,u,q.k_(y),4,f):g&&A.Ps&&A.Ps(u)||this.o_(A,v,l,u,n,q.k_(y),4,f));return null},t_:function(c,d){var a,h,m,l=w(d);if(1>=l||w(c)!==l)return!1;a=c[1]-c[0];h=d[1]-d[0];for(m=2;ml.Uq.length&&(c=l.zl().get(l.Jl,l.Kl)),c&&(this.zG=!0,this.OG=!0,this.L_=c,m=l.getRangeRect(d.rowViewportIndex,d.colViewportIndex,c),h=this.gA,h.x=m.x,h.y=m.y,h.width=m.width-1,h.height=m.height-1,h.row=c.row,h.col=c.col,h.rowCount=c.rowCount,h.colCount=c.colCount,a=l.Tq(c),n=d.row,q=d.col,n=a.row+a.rowCount&&(n=a.row+a.rowCount-1),q=a.col+a.colCount&&(q=a.col+a.colCount-1),h.hitRow=n,h.hitCol=q,h.rowOffset=n-a.row,h.colOffset=q-a.col,this.rG={KG:d.rowViewportIndex,MG:d.colViewportIndex,sG:d.hitTestType},this.qG()))},AG:function(){var d,l,c,m,h,a,n,q,t;this.rG&&this.OG&&this.zG&&this.L_&&(d=this.$F,l=this.gA,c=l.width/2,m=l.x+c,h=l.height/2,a=l.y+h,l.hitTarget={x:d.x,y:d.y},n=this.fH(),q=this.gH(),t=!1,(r(m-d.x)>c+5||r(a-d.y)>h+5)&&(t=!0),0<=n&&0<=q&&t&&this.M_(n,q),this.NG())},M_:function(d,l){var c,m,h,a,q,r,t,u;this.zG&&this.L_&&(c=this.kj,m=this.gA,h=c.Ix(),-1===h.row&&-1!==h.col?(m.row=-1,m.col=n(0,A(c.getColumnCount(void 0)-m.colCount,l-m.colOffset))):-1!==h.row&&-1===h.col?(m.row=n(0,A(c.getRowCount(void 0)-m.rowCount,d-m.rowOffset)),m.col=-1):(m.row=0>m.row?-1:n(0,A(c.getRowCount(void 0)-m.rowCount,d-m.rowOffset)),m.col=0>m.col?-1:n(0,A(c.getColumnCount(void 0)-m.colCount,l-m.colOffset))),m.hitRow=d,m.hitCol=l,a=c.Tq(m),q=this.N_,q&&a.row===q.row&&a.col===q.col&&a.rowCount===q.rowCount&&a.colCount===q.colCount&&a.row>c.ar()&&a.col>c.$q()&&a.row+a.rowCount-1m?0:m,h=0>h?0:h,1===c.rowCount&&1===c.colCount?a=K.rf(null,null,d.row-m,d.col-h,!0,!0):(-1===c.row&&0<=c.col?(n=t=K.BAND_INDEX_CONST,q=d.col-h,r=d.col-h+c.colCount-1):-1===c.col&&0<=c.row?(q=r=K.BAND_INDEX_CONST,n=d.row-m,t=d.row-m+c.rowCount-1):0<=c.row&&0<=c.col&&(n=d.row-m,t=d.row-m+c.rowCount-1,q=d.col-h,r=d.col-h+c.colCount-1),a=K.uf(null,null,n,q,t,r,!0,!0,!0,!0)),l.Cf().unparse(l.yj(),a,m,h)):void 0},wH:function(){var d,l,c,m,h,a,n,q,t,r=!1,u="",p=!1,g=this.kj;this.rG=null;this.RG();d=(d=g.Ix())&&(0l?(this.PH&&(n<=c||n>=c+h)||!this.PH&&(nc+h))&&((g.qu(-1,c,-1,h)||g.qu(-1,n,-1,0))&&(r=!0,u=w().Exp_ChangeMergedCell),!r&&g.options.isProtected&&(r=!0,u=w().Exp_ColumnReadOnly),r||(q=J(g,!0,-1,c,-1,n,-1,h,this.PH,!0,1023),q||(p=g.wu().execute({cmd:"dragDrop",sheetName:g.name(),fromRow:-1,fromColumn:c,toRow:-1,toColumn:n,rowCount:-1,columnCount:h,copy:this.PH,insert:!0,option:1023}),J(g,!1,-1,c,-1,n,-1,h,this.PH,!0,1023)))):0<=l&&0>c&&(this.PH&&(a<=l||a>=l+m)||!this.PH&&(al+m))&&((g.qu(l,-1,m,-1)||g.qu(a,-1,0,-1))&&(r=!0,u=w().Exp_ChangeMergedCell),r||L&&(g.Ns(l,-1,m,-1)||g.Ns(a,-1,0,-1))&&(r=!0,u=w().Exp_ChangePartOfArray),!r&&g.options.isProtected&&(r=!0,u=w().Exp_RowReadOnly),r||(q=J(g,!0,l,-1,a,-1,m,-1,this.PH,!0,1023),q||(p=g.wu().execute({cmd:"dragDrop",sheetName:g.name(),fromRow:l,fromColumn:-1,toRow:a,toColumn:-1,rowCount:m,columnCount:-1,copy:this.PH,insert:!0,option:1023}),J(g,!1,l,-1,a,-1,m,-1,this.PH,!0,1023))))));this.zG=this.OG=!1;this.L_=null;this.PH=this.OH=!1;this.N_=null;this.xw();p||(this.gA={},g.repaint());r&&g.Os(3,u)},hG:function(d){!0!==this.BG&&!0!==this.OG&&(this.P_(),this.A$&&(this.OG=!0,this.BG=!0,this.$I=!0,this.Q_=d,this.R_=d.colViewportIndex,this.S_=d.rowViewportIndex,this.T_=d.colViewportIndex,this.U_(),this.rG={KG:d.rowViewportIndex,MG:d.colViewportIndex,sG:d.hitTestType},this.qG()))},U_:function(){var d;d=this.kj.frozenRowCount();var l=this.kj.frozenColumnCount(),c=this.V_();0<=c&&c=d&&c<=this.kj.getRowCount(void 0)&&(this.W_=1);this.X_()?this.Y_=1:this.Y_=this.Q_;d=this.Z_();0<=d&&d=l&&d<=this.kj.getColumnCount(void 0)&&(this.__=1);this.a0()?this.b0=1:this.b0=this.R_},CG:function(){var d,l,c;this.rG&&this.BG&&this.OG&&this.A$&&(this.S_=this.iH(),this.T_=this.jH(),this.c0=this.fH(),this.d0=this.gH(),0<=this.c0&&0<=this.d0&&(this.e0(),this.f0(),d=this.kj.parent,l=!1,c=this.g0(),c&&(l=this.h0(this.A$,this.A_,!0)),d&&d.options.showDragFillTip&&l&&this.i0(),this.j0()),this.NG())},k0:function(){var d,n,c,m,h,a,q,r,t,u,w,p,g,f=this.kj,k=this.A$,x=this.A_,A=f.parent.options.defaultDragFillType,A=this.l0(3===A?5:A),F=this.m0(),D=this.g0();return 1===A?(d=0===F||1===F?1:0,n=new O.z$(f),c=n.B$(D,d,!0),m=this.n0(F,x,k),h=f.getActualStyle(m.row,m.col),a=h.cellType||f.Al(),q=h.formatter?h.formatter:h._autoFormatter,r=l(34),t=r&&r.GeneralFormatter,c instanceof Date&&t&&(q=new t(Q.CultureManager.q4().DateTimeFormat.shortDatePattern+" hh:mm:ss AM/PM;@",0)),u=this.rG,w=3,u&&(w=u.sG),p={sheet:f,row:m.row,col:m.col,sheetArea:w},a.format(c,q,p)):0===A?(m=this.n0(F,x,k),g=f.getFormula(m.row,m.col),g?null:f.getText(m.row,m.col)):null},n0:function(d,l,c){var m,h=c.row,a=c.col,n=c.rowCount;c=c.colCount;var q=I(h,a,1,1);return 3===d?(m=l.rowCount%n,m=0===m?h+n-1:h+m-1,q.row=m,q.col=a):1===d?(m=l.colCount%c,m=0===m?a+c-1:a+m-1,q.row=h,q.col=m):0===d?(m=l.colCount%c,m=0===m?a:a+c-m,q.row=h,q.col=m):2===d&&(m=l.rowCount%n,m=0===m?h:h+n-m,q.row=m,q.col=a),q},i0:function(){var d,l,c,m,h,a,n=this.kj;return 4===this.l0()||this.a0()||this.X_()?(this.xw(),null):(m=this.m0(),h=this.g0(),a=n.cm(h),c=this.k0(),3===m?(d=a.x+a.width+3,l=a.y+a.height+3):1===m?(d=a.x+a.width+3,l=a.y+a.height+3):0===m?(d=a.x+3,l=a.y+a.height+3):2===m&&(d=a.x+a.width+3,l=a.y+3),void this.uw(c,d,l))},j0:function(){this.o0();this.p0();this.q0();this.r0=this.g0()},o0:function(){var d,l=this.kj;this.r0&&(d=l.cm(this.r0),d.x-=2,d.y-=2,d.width+=4,d.height+=4,l.yl.dm(d))},p0:function(d){this.kj.yl.im(this.A$,null,d)},q0:function(){var d,l,c=this.kj,m=c.yl,h=this.g0();h&&(d=m.bm(),l=c.cm(h),d.save(),d.beginPath(),m.RI(d,l),d.restore())},f0:function(){this.A_=this._I()},a0:function(){return-1===this.A$.col&&-1!==this.A$.row},X_:function(){return-1===this.A$.row&&-1!==this.A$.col},ZI:function(){return 4===this.dJ||5===this.dJ},_I:function(){var d=-1,l=-1,c=-1,m=-1;switch(this.dJ){case 0:this.X_()?(d=-1,c=-1):(d=this.V_(),c=this.A$.rowCount);l=this.d0;m=this.Z_()-l;break;case 1:this.X_()?(d=-1,c=-1):(d=this.V_(),c=this.A$.rowCount);l=this.s0()+1;m=this.d0-l+1;break;case 2:d=this.c0;c=this.V_()-d;this.a0()?(l=-1,m=-1):(l=this.Z_(),m=this.A$.colCount);break;case 3:d=this.t0()+1;c=this.c0-d+1;this.a0()?(l=-1,m=-1):(l=this.Z_(),m=this.A$.colCount);break;case 5:d=this.c0;c=this.t0()-d+1;this.a0()?(l=-1,m=-1):(l=this.Z_(),m=this.A$.colCount);break;case 4:this.X_()?(d=-1,c=-1):(d=this.A$.row,c=this.A$.rowCount),l=this.d0,m=this.s0()-l+1}return I(d,l,c,m)},u0:function(){var d=this.t0();return-1!==d?this.kj.Gr(this.Y_).findRow(d):null},v0:function(){return this.kj.Gr(this.S_).findRow(this.w0())},w0:function(){return this.kj.getViewportBottomRow(this.S_)},x0:function(){var d=this.s0();return-1!==d?this.kj.Hr(this.b0).findCol(d):null},y0:function(){return this.kj.Hr(this.T_).findCol(this.z0())},z0:function(){return this.kj.getViewportRightColumn(this.T_)},e0:function(){var d,l,c,m,h,a,n,q,t,u,w,p,g,f,k,x,F,D,G,I=this.a0(),e=this.X_(),b=H(this.kj.Ws()).offset(),v=this.$F.e,K=this.$F.x,J=this.$F.y,L=v.pageX-b.left,b=v.pageY-b.top,v=!1;I||e?e?this.d0>=this.Z_()&&this.d0<=this.s0()?this.dJ=4:this.d0this.s0()&&(this.dJ=1):I&&(this.c0>=this.V_()&&this.c0<=this.t0()?this.dJ=5:this.c0this.t0()&&(this.dJ=3)):this.c0>=this.V_()&&this.c0<=this.t0()?this.d0>=this.Z_()&&this.d0<=this.s0()?(d=r(this.d0-this.s0()),l=r(this.c0-this.t0()),l>d?this.dJ=5:lc.y+c.height?this.dJ=3:(m=this.x0(),m||(m=this.y0()),h=m.x+m.width-K,a=c.y+c.height-J,L>=m.x&&L<=m.x+m.width&&b>=c.y&&b<=c.y+c.height?h>=a?this.dJ=4:this.dJ=5:v=!0))):this.d0this.s0()&&(this.dJ=1):this.c0=this.Z_()&&this.d0<=this.s0()?this.dJ=2:this.d0=d?this.dJ=2:this.dJ=0):this.d0>this.s0()&&(d=r(this.d0-this.s0()),l=r(this.c0-this.V_()),l>=d?this.dJ=2:this.dJ=1):this.c0>this.t0()&&(this.d0>=this.Z_()&&this.d0<=this.s0()?this.dJ=3:this.d0=d?this.dJ=3:this.dJ=0):this.d0>this.s0()&&(d=r(this.d0-this.s0()),l=r(this.c0-this.t0()),l>=d?this.dJ=3:this.dJ=1));(d=this.kj.yl.rH)&&(n=this.t0(),q=this.s0(),t=n+1,u=q+1,w=this.kj.getRowHeight(n,3),p=this.kj.getColumnWidth(q,3),g=this.kj.getRowHeight(t,3),f=this.kj.getColumnWidth(u,3),k=d.x+d.width/2-A(10,p/2),x=d.x+d.width/2+A(10,f/2),F=d.y+d.height/2-A(10,w/2),D=d.y+d.height/2+A(10,g/2),G=!1,I||e?e?G=k<=L&&L<=x:I&&(G=F<=b&&b<=D):G=k<=L&&L<=x&&F<=b&&b<=D,G||v?(this.$I=!0,this.dJ=4):this.$I=!1)},V_:function(){return this.A$?-1===this.A$.row?0:this.A$.row:-1},t0:function(){return this.A$?-1===this.A$.row?this.kj.getRowCount(void 0)-1:this.A$.row+this.A$.rowCount-1:-1},Z_:function(){return this.A$?-1===this.A$.col?0:this.A$.col:-1},s0:function(){return this.A$?-1===this.A$.col?this.kj.getColumnCount(void 0)-1:this.A$.col+this.A$.colCount-1:-1},dja:function(d,l){var c,m,h,a,n,q,t=I(l.row,l.col,l.rowCount,l.colCount),r=this.kj;return r.zl().find(d.row,d.col)&&(c=d.rowCount,m=t.rowCount,0!==Math.floor(m%c)&&(h=Math.ceil(m/c)*c,t.row+h<=r.getRowCount()&&(t.rowCount=h)),a=d.colCount,n=t.colCount,0!==Math.floor(n%a)&&(q=Math.ceil(n/a)*a,t.col+q<=r.getColumnCount()&&(t.colCount=q))),t},xH:function(){var d,l,c,m,h,a,n=this.kj;return this.rG=null,this.RG(),this.xw(),this.BG&&this.OG?(this.BG=!1,this.OG=!1,d=this.g0(),void(d&&(l=this.h0(this.A$,this.A_),!l||this.$I?(this.A0(),this.WA(d)):(c=n.mm.A$,m=this.dja(c,this.A_),h=this.l0(),n.wu().execute({cmd:"fill",sheetName:n.name(),startRange:c,fillRange:m,autoFillType:h,fillDirection:n.mm.m0()}),a=this._$,!a&&this.B0()&&n.parent.options.showDragFillSmartTag&&4!==this.$$?this.C0(this.$$):this.WA(d),this.A0())))):void this.A0()},C0:function(d){var l=this.kj,c=l.yl.rH;d={x:c.x+c.width,y:c.y+c.height,fillType:d};l.NF=new O.K_(l.parent.xv(),l,d);l.NF.OT()},P_:function(){var d=this.kj;1===d.Uq.length?this.A$=d.Uq[0]:0<=d.Jl&&0<=d.Kl&&(this.A$=I(d.Jl,d.Kl,1,1))},A0:function(){this.BG=this.OG=!1},WA:function(d){this.kj.yl.im(d)},l0:function(d){var l,c=this.kj;d=void 0!==d?d:c.parent.options.defaultDragFillType;return this.ZI()?4:5!==d?d:(l=1===this.A$.rowCount&&1===this.A$.colCount&&!this.X_()&&!this.a0(),l?this.RH?1:0:this.RH?0:1)},g0:function(){var d,l,c,m;return this.A$?this.ZI()?this.A$:this.A_?(this.D0()?(d=2===this.dJ?this.A_.row:this.A$.row,l=this.A$.rowCount+this.A_.rowCount,c=this.A$.col,m=this.A$.colCount):(d=this.A$.row,l=this.A$.rowCount,c=0===this.dJ?this.A_.col:this.A$.col,m=this.A$.colCount+this.A_.colCount),I(d,c,l,m)):null:null},h0:function(d,l,c){function m(a,c,d,h,g){var f,k,l;for(f=0;f=d?d:4===d?0:5===d?2:3},tr:function(d,l,c){var m,h,a,n,q=null,t=d.rowViewportIndex;d=d.colViewportIndex;if(G(t)||G(d)||(m=this.kj,h=m.parent,a=m.Ix(),-1===a.row&&-1===a.col))return q;if(0<=t&&0<=d&&1===m.Uq.length){if(this.qH(t,d,l,c))return q;m=m.getRangeRect(t,d,a);m.x-4m.x+m.width||cm.y+m.height)&&(q.outside=!0)}return h&&h.options.allowUserDragDrop||q&&"corner"!==q.side&&(q.side=null),h&&h.options.allowUserDragFill||q&&"corner"===q.side&&(q.side=null),q}});H.extend(R.oJ.prototype,{gJ:function(d,l){var c,m=this.kj,h=d.x,a=d.y,n=d.width,r=d.height,t=m.Ix(),m=m.am(),u=4,w=-2.5;return 2007t+u/2&&(k.colp+g/2&&(k.rowu.x+u.width&&h.intersectRect(u)&&(h=h.getIntersectRect(u)),0u.y+u.height&&h.intersectRect(u)&&(h=h.getIntersectRect(u)),w=new q(l.kt,l.nt,l.lt+l.js,l.ot+l.gs),0c.row&&0>c.col&&(c=new I.Range(0,-1,a.getRowCount(),-1));k=(f=a.tables)&&f.find(c.row,c.col);f=q.G0.H0;var m;a:if(m=c,k){var n=!1,r=!1;if(1===m.rowCount){if(k.hasHeadersRow()&&m.row===k.startRow()||k.hasTotalsRow()&&m.row===k.endRow()){m=!0;break a}}else k.hasHeadersRow()&&m.row===k.startRow()&&(m.rowCount===k.dataRange().rowCount+1&&(n=!0),k.hasTotalsRow()&&m.rowCount===k.dataRange().rowCount+1+1&&(n=!0)),m.row===k.dataRange().row&&(m.rowCount===k.dataRange().rowCount&&(n=!0),k.hasTotalsRow()&&m.rowCount===k.dataRange().rowCount+1&&(n=!0));m=(m.col+m.colCount<=k.startColumn()+k.dataRange().colCount&&(r=!0),n&&r)}else m=!1;if(m)l=(f&&f._text&&f.kj!==a&&(d=h=-1),F.rangeToFormulaWithStructReference(a,c,d,h,g,l,k));else{d=F.rangeToFormula(c,d,h,g,l);if(f&&f._text||a.Cw&&a.Cw.V4&&a.Cw.fja)h=a.name(),h=L.jja(h.split(""),!1)?h:"'"+h+"'",d=h+"!"+d;l=d}d=l}else d=null;return d};I.Events.FormulaTextBoxTextChanged="FormulaTextBoxTextChanged";I.Events.FormulaTextBoxCaretChanged="FormulaTextBoxCaretChanged";w.Yl.km.push(function(a,c){var d,h=c&&"gcAttachedFormulaTextBox"===c.getAttribute("gcUIElement"),l=q.G0;!c&&a.endEdit&&!h&&l&&(d=l.H0,d&&d.I0&&a.Cw&&(a.Cw&&a.Cw.destroy(),a.Cw=null,d.$b()))});q.J0=R;q.K0=Q;q.L0=function(a,c){if(!c)return null;var d=a.Jl,h=a.Kl;try{return F.formulaToRange(a,c,d,h)}catch(p){}return null};u(I.DC.prototype,{bE:function(a){return!(a&&a.Cw&&a.Cw.M0())}});I.Worksheet.$n("formulatextbox",{startEdit:function(a){R(this,a.element)},endEdit:function(){Q(this)}});u=I.DC;l=u.prototype;K=l.dE;u.$n("formulatextbox",{preProcessMouseDbClick:function(a){var c=this.OC.getActiveSheet().Cw,c=c&&c.M0(),d=q.G0.H0;c?a.r=!1:d&&d.I0&&d.$b()}});l.dE=function(){var a=this.OC.getActiveSheet().Cw,c=q.G0.H0,c=c&&c._text;return K.call(this)&&!c&&!a};O="#0000ff #008000 #9900cc #800000 #00cc33 #cc6600 #cc0099".split(" ");H=function(){function d(a,c,d){var f,g=a;this.V4=!1;this.C5=0;this.Nfa=!1;this.fja=!0;c&&c.rangeSelectMode&&(!0===c.absoluteReference&&(this.Nfa=!0),!1===c.needSheetName&&(this.fja=!1),this.V4=!0,this.D5=!1,this.E5=!1,this.cga=a,f=l(a,this),g=f.contentDiv,this.gja=f.button,this.hja=a,this.C5=F++);this.ad(d&&d.getHost()||z.body);g&&this.N0(g);d&&(this.O0=!0,this.P0(d),this.OC.Gu(I.Events.FormulatextboxActiveSheetChanging,q.G0.Q0),this.OC.Fu(I.Events.FormulatextboxActiveSheetChanging,q.G0.Q0),this.OC.Gu(I.Events.FormulatextboxActiveSheetChanged,q.G0.R0),this.OC.Fu(I.Events.FormulatextboxActiveSheetChanged,q.G0.R0));this.S0=this.T0(this.text());this.U0(g)&&this.V0(this.S0)}function l(a,c){var d,g,h,l,m,p,q,e,b,t=n("table");return r(t).css("border-spacing","0"),r(t).css("width","100%"),r(a).append(t),d=n("tbody"),t.appendChild(d),g=document.createElement("tr"),d.appendChild(g),h=document.createElement("td"),r(h).css("padding-right","0px"),g.appendChild(h),l=document.createElement("td"),r(l).css("width","23px"),r(l).css("padding-right","0px"),g.appendChild(l),m=r(a).width()-r(l).width(),p=n("div"),q=n("div"),r(q).width(m),r(q).css({"overflow-y":"auto","overflow-x":"hidden",height:"20px"}),q.appendChild(p),h.appendChild(q),e=n("div"),l.appendChild(e),r(p).css({display:"inline-block","float":"left",height:"auto",outline:"none"}),r(p).width(m),r(p).attr("contenteditable","true"),r(p).attr("spellcheck","false"),b=r(e),b.css({display:"block","float":"right",width:"23px",height:"23px",background:'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAARCAIAAACw+gCQAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJSSURBVDhPY3hILqBYZ/eqV81LXpbNfp7S/yS0+Z5p+olD5x5OWXGyYcaBmql7yifuLOnbBkRFPVuACKIFqjNzwv2Qhhue5ReByK/qYlDtxb///n35+efd1z/PP/wB6vn2+/f7b79ffgIhiBaoTlPP5I2bN2/asmX7jh3Hjh+ft3wLUOfX779ef/h+6+nHtXsuffrx+/bj16euvwQiiBaETiAy904NTasGantRkvA8wetpsO0NJ839htKb9l/Jal6T3rgytX4FEEG0QHXuOnbr55+/P379AyIg40m8x8uZ3U+aC49bKn64eHzX0es4Xds0Y9ejl++vPXx3+f77Nx9/3PU3e5YR/CTM4WGs53pVPqBrgX6+8+QNFtdmNq0q6NpU1LOpe/6+o+fvH3fR36XCc9dE/KG3EdDNQPaF7VunLTuY0bA0omg2RAtUZ1LNUohjgCEJDJVtdlpPty6dr8x3yUDsvoPqRm2hqcp8Jy+9WbH/7cQ1EB0wnXEVCyBBt+fc8+NXXy9Yf/znz5/31swFaliiKjBZme/yrSe7z36YsuZBy4KbEC1QnRFFcxKqFgP1A1Fq7ZKcpqU1EzYuWX/kxIa1/WBtizYcAwqG5E71SZsA0QLVGZI3A+Lax+/+ACMwvHDmsn1v1xx8e+jSp83HXgP1ALmztryYsv4ZEEG0QHUGZk+FuHbHqadABORO3fC8Z/mdvmU3Oxdd9cuY1LX0VsOci/WzQQiiBaET4lQgii1fEFU6F4iAXgC6JShnakDWZKBmoDshCKIFqpMMQK7Ohw8BTajNa73pg9oAAAAASUVORK5CYII\x3d")',"background-repeat":"no-repeat"}),b.bind("click",function(){c.D5?(c.OC.Wq("RangeSelectEnding",c),c.endSelectMode()):c.startSelectMode()}),{contentDiv:p,button:e}}function u(a){var c=n("textarea");return r(c).css({display:"none"}),r(a).append(c),c}var F=1;return q.W4=u,d.prototype={constructor:d,j5:function(a){var c,d,k,h;this.O1();this.UF();this.E5=!0;c=u(this.OC.qo);d=this.a1();d.suspendPaint();R(d,c);c=d.Cw;c.V4=!0;c.C5=this.C5;c.Nfa=this.Nfa;c.fja=this.fja;a&&(this.text(a),this.caret(a.length));a=this.text();k=this.caret();0>=k&&(k=a.length);this.focus();this.caret(k);this.MH=!0;this.W0=1;h=a.lastIndexOf(",",k);-1!==h&&(this.W0=h+1);a||(this.text("\x3d"),a="\x3d",this.caret(1),k=1);0!==a.indexOf("\x3d")&&(a="\x3d"+a,k++);c.text(a);c.caret(k);c.MH=this.MH;c.W0=this.W0;d.resumePaint()},startSelectMode:function(a){a&&0!==a.indexOf("\x3d")&&(a="\x3d"+a);this.D5=this.V4=!0;r(this.gja).css({background:'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAARCAIAAACw+gCQAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAItSURBVDhPY3hILqBYZ/eqVxDUuvRl/cKXZbNf5E59ntT3DIgi2p/6NT5xq35iV/YYiCyLHkG0IHQuOvR/1t6/03b+mbD1d/eGXy2rf9Yu/wFE5Yu+Fc79mjXza+rUz0BkmHoWogXFTqCFVfNfQmwLa3vqVfsYiBzA9sCRftIJiBaozuYZO+89eAREt+4+AKIbt+9fvXkPiC5du3P28s0T564dOnV579Hz2w6cSaqcDdEC1Vk/ZQtQQ2vv7MaumbUd0+o6ZzT3zmnunQ1kF9T0pZe2J+U3x+U0bNx9MqZ4CkQLVGdB6xKgDaX1/b/+/PnyE4E+ff/z8uPvR29/3X35MzCxfPW2o2HZPRAtUJ2lXSuADkstann/9febz7/ff/3zLDP4Spj9Pjs1oE6gthvPfnpEFS7deDAwrRWiBaozv3kh0D8RadVAlFvZvWLDrjvRrk+bCrdpCS1ZsyOpoMU9ssA5NBeo0zuhDqIFqjO9Zubhk1eA6MT5G+eu3H78/PVFX/OnxQnrNQTuPnyx9+hFoA+B2uav2ecaVQ7RAtUZVzQBKH3g+KXTl24fdjE44mp4yFbtSYrfGg3+yQocQLTryEWgzgVr9zmEFkK0QHWGZbbvPHQOiI6cvnb5wMENhjJPE30eB1k9dFIDaruy/wAwPoA6563eaxOQDdEC1YkG1hvKrNKVuOEA0nYr2Pp5qA1UAglg1wkEW03lF2kI3wy1xaoNCHDqJAjI1fnwIQDHT83/UVFPcQAAAABJRU5ErkJggg\x3d\x3d")',"background-repeat":"no-repeat"});this.j5(a)},endSelectMode:function(){this.D5=!1;this.H5();r(this.gja).css({background:'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAARCAIAAACw+gCQAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJSSURBVDhPY3hILqBYZ/eqV81LXpbNfp7S/yS0+Z5p+olD5x5OWXGyYcaBmql7yifuLOnbBkRFPVuACKIFqjNzwv2Qhhue5ReByK/qYlDtxb///n35+efd1z/PP/wB6vn2+/f7b79ffgIhiBaoTlPP5I2bN2/asmX7jh3Hjh+ft3wLUOfX779ef/h+6+nHtXsuffrx+/bj16euvwQiiBaETiAy904NTasGantRkvA8wetpsO0NJ839htKb9l/Jal6T3rgytX4FEEG0QHXuOnbr55+/P379AyIg40m8x8uZ3U+aC49bKn64eHzX0es4Xds0Y9ejl++vPXx3+f77Nx9/3PU3e5YR/CTM4WGs53pVPqBrgX6+8+QNFtdmNq0q6NpU1LOpe/6+o+fvH3fR36XCc9dE/KG3EdDNQPaF7VunLTuY0bA0omg2RAtUZ1LNUohjgCEJDJVtdlpPty6dr8x3yUDsvoPqRm2hqcp8Jy+9WbH/7cQ1EB0wnXEVCyBBt+fc8+NXXy9Yf/znz5/31swFaliiKjBZme/yrSe7z36YsuZBy4KbEC1QnRFFcxKqFgP1A1Fq7ZKcpqU1EzYuWX/kxIa1/WBtizYcAwqG5E71SZsA0QLVGZI3A+Lax+/+ACMwvHDmsn1v1xx8e+jSp83HXgP1ALmztryYsv4ZEEG0QHUGZk+FuHbHqadABORO3fC8Z/mdvmU3Oxdd9cuY1LX0VsOci/WzQQiiBaET4lQgii1fEFU6F4iAXgC6JShnakDWZKBmoDshCKIFqpMMQK7Ohw8BTajNa73pg9oAAAAASUVORK5CYII\x3d")',"background-repeat":"no-repeat"})},H5:function(){var a=this.a1();a.gv(!0,void 0,!0);a.repaint()},destroy:function(){this.D5&&this.H5();this.MH=!1;this.W0=-1;this.X0();this.Y0();r(this.Z0).remove();r(this.$0).remove();r(this._0).remove()},bind:function(a,c,d){var f=this.qo;f&&a&&(a=a.split(/\s+/).join(".gcFormulaTextBox "),r(f).bind(a+".gcFormulaTextBox",c,d))},unbind:function(a,c){var d=this.qo;d&&a&&(a=a.split(/\s+/).join(".gcFormulaTextBox "),r(d).unbind(a+".gcFormulaTextBox",c))},unbindAll:function(){var a=this.qo;a&&r(a).unbind(".gcFormulaTextBox")},caret:function(a){var c,d,k=this.qo;if(k)return c=z.activeElement===k,d=r(k),0===arguments.length?c?this.b1(k).end:d.data("caret-before"):void(a!==this.caret()&&(c?(this.c1(k,a),d.data("caret-before",this.b1(k).end)):d.data("caret-before",a),this.Wq("CaretChanged",{})))},b1:function(a){var c,d,k,h=-1,l=-1,m=this.d1(a),p=this.U0(a);return m?(h=a.selectionStart,l=a.selectionEnd):p&&(c=w.getSelection(),0l)break}d.splice(k,0,c)}},remove:function(c){var d,f,k;if(c)for(c=a(c),d=this.i1,f=d.length,k=0;k=a)break}return null},n1:function(a){var c,d,k;return!!a&&(c=this.caret(),d=a.text,k=a.textOffset,ka||n<=a)return"";c=[];for(h=k=0;h=f&&(d.text=a,l=m.length+a.length)):(p=this.S0,e=G.k.Cb(p,d),h>f?(p.splice(e+1,0,{text:this.w1(),type:8}),p.splice(e+2,0,{text:a,type:11}),a=","+a):this.V4&&1a)&&c){d=!1;h=(g=this.S0)&&g.length;for(p=m=0;p=d.length&&--k,k=D(0,k-1)),this.caret(k))),l=m.Px,2!==l&&(m.Px=2,m.Cu(l,2)))},L1:function(a,d,f){var g,h,l,m,n,p="";return a&&(g=a.parent,h=g&&g.options,l=a.getFormulaInformation(d,f),l&&l.hasFormula?(p="\x3d"+l.formulaWithCulture,l.isArrayFormula&&(p="{"+p+"}")):(m=a.getActualStyle(d,f),n=a.getValue(d,f),p=c.Il(m,n,a)||"","\x3d"===p[0]&&h&&h.allowUserEditFormula&&(p="'"+p))),p},H1:function(a,c){var d,g=a.data;g.OG||(d=c.newSheet,g.V4||(g.OG=!0,g.close(),c&&g.text(g.L1(d,d.Jl,d.Kl)),g.OG=!1))},E1:function(a){var c,d,k;a=a.data;a.OG||(c=a.OC,d=c&&c.getActiveSheet(),k=d&&d.Cw,k&&a.V4===k.V4&&a.C5===k.C5&&(a.OG=!0,a.text(k.text()),a.OG=!1))},F1:function(a,c){var d=a.data;d.V4||d.OG||(d.OG=!0,c&&d.text(d.L1(c.sheet,c.row,c.col)),d.OG=!1)},I1:function(a,c){var d,g,h,l,m,n=a.data;n.OG||n.V4||(n.OG=!0,c&&(d=c.sheet,g=c.row,h=c.col,l=c.rowCount,m=c.colCount,(new I.Range(g,h,l,m)).contains(d.Jl,d.Kl)&&n.text(n.L1(d,d.Jl,d.Kl))),n.OG=!1)},G1:function(a,c){var d=a.data;return d.V4&&d.D5&&d.E5?void(c.ignore=!0):void(d.OG||(d.OG=!0,d.close(),c&&c.sheet.Cw&&(d.V4||c.sheet.Cw.V4||d.text(d.L1(c.sheet,c.row,c.col))),d.OG=!1))},J1:function(a,c){var d,g=a.data;g.OG||(!c.sheet.Cw||g.V4===c.sheet.Cw.V4&&g.C5===c.sheet.Cw.C5)&&(g.OG=!0,c&&(d=g.caret(),g.text(c.text),g.caret(d)),g.OG=!1)},K1:function(a,c){var d=a.data;d.OG||(!c.sheet.Cw||d.V4===c.sheet.Cw.V4&&d.C5===c.sheet.Cw.C5)&&(d.OG=!0,c&&d.caret(c.caret),d.OG=!1)},M1:function(a){var c,d,k,h,l;a=a.data;if(!a.OG&&(c=a.OC,d=c&&c.getActiveSheet())){if(a.OG=!0,k=d.Jl,h=d.Kl,l=d.Cw,c=d.getCellType(k,h),l){if(a.V4!==l.V4||a.C5!==l.C5)return;d=l.caret();l.text(a.text());l.caret(d)}else l={sheet:d,row:k,col:h,sheetArea:3},c.setEditorValue(d.BF,a.text(),l);a.OG=!1}},N1:function(a){var c,d,k;a=a.data;a.OG||(c=a.OC,d=c&&c.getActiveSheet(),d&&d.isEditing()&&(k=d&&d.Cw,(!k||a.V4===k.V4&&a.C5===k.C5)&&(a.OG=!0,k&&(k.caret(a.caret()),a.S1()),a.OG=!1)))},ad:function(a){var c,d,k=this;k.T1=!1;k.U1=!1;k.MH=!1;k.W0=-1;k.i1=[];k.g1=!0;k.h1=!0;k.V1=!0;c=n("div");c.className="gcsj-func-ac-popup";c.style.display="none";c.setAttribute("gcUIElement","gcFuncACPopup");a.insertBefore(c,null);k.Z0=c;k.R1=!1;d=n("div");d.className="gcsj-func-help-popup";d.style.display="none";d.setAttribute("gcUIElement","gcFuncHelpPopup");a.insertBefore(d,null);k.$0=d;k.W1=!1;r(c).bind("mouseover",function(){k.V1=!1}).bind("mouseout",function(){k.V1=!0});r(d).bind("mouseover",function(){k.V1=!1}).bind("mouseout",function(){k.V1=!0});r(c).bind("scroll",function(){k.X1&&clearTimeout(k.X1);k.X1=setTimeout(function(){k.qo&&k.qo.focus()},100)});c=n("div");c.style.display="none";c.setAttribute("gcUIElement","gcFuncHelpDiv");a.insertBefore(c,null);k._0=c;k.OC=null;k.OG=!1;k.Q1=!1;k.O0=!1},N0:function(a){var c,d,k;a&&(c=this,(c.d1(a)||c.U0(a))&&(d=r(a),c.qo&&c.X0(),c.qo=a,h&&h.msie?(k=10>parseInt(h.version,10),c.U0(a)||k?(c.Fu("focus",function(){d.data("text-before",c.text())}),c.Fu("click",function(){d.focus()}),["input","keydown","keyup","cut","paste"].forEach(function(a){c.Fu(a,function(){c.Y1()})})):c.Fu("input",function(){c.Z1()})):c.Fu("input",function(){c.Z1()}),c.Fu("keydown",function(a){var d,f,g=a.ctrlKey,k=a.shiftKey,e=a.altKey,b=a.metaKey,h=a.keyCode;c.U1=!1;!(g||k||e||b)&&c.R1&&(40===h?(c._1(1),m(a)):38===h?(c._1(-1),m(a)):9===h&&(c.a2(),m(a)));27===h&&c.close();c.b2(a);c.V4&&(d=c.OC.getActiveSheet(),d.mm.LH(a)&&(f=d.Cw,f&&f.MH&&f.NH()))}),c.Fu("keyup",function(a){if(c.U1&&h&&h.qtMode){var f=c.caret();d.data("caret-before")!==f&&(d.data("caret-before",f),c.Wq("CaretChanged",{}),c.c2(),c.R1||c.S1())}c.b2(a)}),c.Fu("focus",function(a){h&&h.mozilla&&!c.qo.innerText&&(c.qo.innerText="");c.b2(a);c.V4&&c.D5&&(c.E5=!0,c.j5())}),c.Fu("blur",function(){c.V1&&c.close();c.V4&&(c.H5(),c.E5=!1)}),c.Fu("mousedown",function(){c.E5=!0;c.O1()}),c.Fu("mouseup",function(){c.UF()}),c.Fu("click",function(a){var d;c.MH&&c.NH();(d=(d=(d=c.OC)&&d.getActiveSheet())&&d.Cw)&&d.MH&&(d.V4||d.NH());c.b2(a)}),c.Fu("compositionstart",function(){c.T1=!0}),c.Fu("compositionend",function(){c.T1=!1;h.edge&&c.Y1()})))},X0:function(){var a,c=this.qo;c&&(a=r(c),a.removeData("text-before"),a.removeData("caret-before"),this.nu(),this.unbindAll(),this.V4&&(r(this.cga).empty(),this.cga=null),this.qo=null)},Y1:function(){var a=r(this.qo),c=this.text();a.data("text-before")!==c&&(this.T1||a.data("text-before",c),this.Z1())},b2:function(a){h&&h.msie?setTimeout(function(a,c){return function(){a.d2(a,c)}}(this,a),10):this.d2(this,a)},d2:function(a,c){var d,g,h,l,m=c.keyCode,n=37===m||39===m||36===m||35===m||34===m||33===m||9===m||13===m;(a.g1||(n=n||38===m||40===m),d=void 0!==c.button,n||d)&&(g=a.qo,h=r(g),l=a.b1(g),l.start===l.end)&&(d=l.end,h.data("caret-before")!==d&&(h.data("caret-before",d),a.Wq("CaretChanged",{}),a.S1()))},e2:function(){return this.OC?this.OC.getActiveSheet().Jl:void 0},f2:function(){return this.OC?this.OC.getActiveSheet().Kl:void 0},a1:function(){if(this.OC)return this.OC.getActiveSheet()},T0:function(a){var c,d,k=[];return a&&"\x3d"===a[0]?(c=new L.Parser,d=c.parseReferenceExpressionInfos(a,this.a1(),this.e2(),this.f2(),!0),this.i2(d)):(k.push({text:a,type:17}),k)},Z1:function(){var a,c=this.qo,d=r(c);this.U1=!0;this.S0=this.T0(this.text());this.U0(c)?this.T1||(a=this.caret(),this.V0(this.S0),this.Wq("TextChanged",{type:"input"}),this.caret(a)):this.Wq("TextChanged",{type:"input"});a=this.caret();d.data("caret-before")!==a&&(d.data("caret-before",a),this.Wq("CaretChanged",{}));this.c2();this.R1||this.S1()},j2:function(){return G.CultureManager.q4().NumberFormat},h2:function(){var a=this.j2();return a&&a.arrayGroupSeperator||";"},l2:function(){var a=this.j2();return a&&a.arrayListSeparator||","},w1:function(){var a=this.j2();return a&&a.listSeparator||","},g2:function(){var a=this.j2();return a&&a.numberDecimalSeparator||"."},i2:function(a){var c,d,k,h,l=[],m=[],n=this.h2(),p=this.w1(),e=this.l2(),b=!1;for(c=0;c=a)return null;if(c=this.S0,d=c&&c.length,0=a)return l;return null},n2:function(){var a,c,d=this.OC,h=d&&d.getActiveSheet();if(a=h&&h.Cw){a=a.i1;for(c=0;c=m)return"";if(a=this.S0,c=a&&a.length,0=m)return h.text.substring(0,m-d);d+=h.text.length}return""},u2:function(){var c,d,f,h,l,m,n=this.caret(),q=this.S0,r=q&&q.length;l=[];var e=0;for(d=0;d=n)break}if(0a||a>=q.length)return p;if(c=this.OC,d=c&&c.getActiveSheet(),h={},void 0!==a&&null!==a||(a=e),d&&(l=q[a],m=d.tables,n=m&&m.findByName(C.Ib(l.text,"[")),void 0!==n&&null!==n&&!h[n]))for(h[n]=!0,a=0,c="";null!==c;)c=n.getColumnName(a++),null!==c&&p.push({name:c,description:""});return p},z2:function(){r(this.Z0).hide();this.R1=!1},_1:function(a){var c,d,h=r(this.Z0).find(".gcsj-func-ac-row"),l=h.length;if(0!==l){if(c=0,a)for(d=0;dr(this.Z0).scrollTop()+r(this.Z0).height()?r(this.Z0).scrollTop(r(this.Z0).scrollTop()+d):c.offsetTop=a));)m++,h+=l;d=a-h;l=n.text;a=0;C.Bb(l,"[")?(a=l.lastIndexOf("[",d-1),-1===a?(a=l.indexOf("["),-1===a?n.text=t:n.text=t+l.substr(a),a=0):(a++,"@"===l.charAt(a)&&(a+=1),q=l.indexOf("]",d),-1===q&&(q=l.length),n.text=l.substring(0,a)+t+l.substr(q))):n.text=t;e?n.type=2:n.type=11;q=m+1;m=c[q];!e||m&&5===m.type||c.splice(q,0,{text:"(",type:5});this.z2();this.qo.focus();this.z1();this.caret(h+t.length+a+(e?1:0));this.S1();this.S0=this.T0(this.text());this.Wq("TextChanged",{})}},S1:function(){var a,c,d,h,l,m,n,q,t;if(this.R1&&this.z2(),a=this.u2(),null===a||!0!==a.isFunc)return void this.w2();if(c=this.w1(),d=this.h1&&this.bW(this.text())&&a&&!this.MH&&!this.T1,d&&!this.V4){d=a.func;l=(h=d.parameters)&&h.length;a=A(l-1,a.activeParamterIndex);n="";for(q=0;ql&&(n=d-m,0<=n&&(a=n));c.css("top",a).css("left",h)}},focus:function(){r(this.qo).focus()},V0:function(a){var c,d,h,l="",m="",n=a&&a.length,p=0;for(d=0;d=c)return{node:d,offset:g.length+c};return{node:d,offset:g.length}}return null}},d}();q.FormulaTextBox=H;U.exports=q},function(U,u,l){var d=l(85),J=l(33),R=d.CalcEngine,Q=l(149),K=d.kf;U=d.GC$.extend;var O=Math.max,H=Math.min,I=Q.L0,L=Q.C2;U(d.iI.prototype,{D2:function(d){var l,q,u,A,r,n,w,z,F,c,m,h,a,B,y,t,E=this.kj,H=E.Cw;H&&(l=E.frozenRowCount(),q=E.frozenColumnCount(),u=H.MH,u&&this.E2||(this.E2={anchorRow:-1,anchorCol:-1,leadingRow:-1,leadingCol:-1}),A=E.getRowCount(),r=E.getColumnCount(),n=d.hitTestType,w=d.row,z=d.col,F=this.shift,c=this.ctrl,m=this.E2,h=m.anchorRow,a=m.anchorCol,B=-1,y=-1,0===n?(B=l?E.ar():E.lq,y=q?E.$q():E.qq,t=K(-1,-1,-1,-1),H.v1(L(E,t),F,!c),this.OG=!0):1===n?(B=l?E.ar():E.lq,y=z,t=E.Jx(0,z,A-1,z,!0),F&&0<=a&&(t=E.Jx(0,z,A-1,a,!0)),t=K(-1,t.col,-1,t.colCount),H.v1(L(E,t),F,!c),this.OG=!0):2===n?(B=w,y=q?E.$q():E.qq,t=E.Jx(w,0,w,r-1,!0),F&&0<=h&&(t=E.Jx(w,0,h,r-1,!0)),t=K(t.row,-1,t.rowCount,-1),H.v1(L(E,t),F,!c),this.OG=!0):3===n&&(B=w,y=z,t=E.Jx(w,z,w,z,!0),t=K(t.row,t.col,1,1),F&&0<=h&&0<=a&&(t=E.Jx(w,z,h,a,!0)),H.v1(L(E,t),F,!c),this.OG=!0),this.DG=this.OG,F&&u||(m.anchorRow=B,m.anchorCol=y,m.leadingRow=B,m.leadingCol=y),this.rG={KG:d.rowViewportIndex,MG:d.colViewportIndex,sG:d.hitTestType},this.qG())},F2:function(l){var u,q,F=!1,A=Q.G0.H0;if(A&&A.I0)if(u=A.kj,q=l.Cw,q&&u.setFormula(A.nT,A.Mk,q.text()),u!==l){if(d.Commands.Wx.G2(u),!u.endEdit())return;F=!0}else q&&(q.destroy(),l.Cw=null),A.$b();return F},EG:function(){var d,l=this.rG;l&&this.OG&&(d=l.sG,3===d?this.H2():2===d?this.I2():1===d&&this.J2())},H2:function(){var d,l,q,u,A=this.E2,r=A.anchorRow,A=A.anchorCol,n=this.fH(),w=this.gH();0<=r&&0<=A&&0<=n&&0<=w&&(d=this.kj,l=d.Jx(n,w,r,A,!0),q=L(d,l),q&&(u=d.Cw,u.v1(q,!0,!1)));this.NG()},I2:function(){var d,l,q,u,A=this.E2.anchorRow,r=this.fH();0<=A&&0<=r&&(d=this.kj,l=d.Jx(r,0,A,d.getColumnCount()-1,!0),l=K(l.row,-1,l.rowCount,-1),q=L(d,l),q&&(u=d.Cw,u.v1(q,!0,!1)));this.NG()},J2:function(){var d,l,q,u,A=this.E2.anchorCol,r=this.gH();0<=A&&0<=r&&(d=this.kj,l=d.Jx(0,r,d.getRowCount()-1,A,!0),l=K(-1,l.col,-1,l.colCount),q=L(d,l),q&&(u=d.Cw,u.v1(q,!0,!1)));this.NG()},yH:function(){this.RG();this.rG=null;this.DG=this.OG=!1},iG:function(d){var l,q,u,A,r,n,w,z,F=this.kj,c=F.Cw,m=d.formulaRangeHitInfo;m&&m.inBorder&&c&&(c.MH&&c.NH(),c.close(),l=m.paramRange,q=l&&l.text,q&&(u=I(F,q),u&&(A=F.Tq(u),r=d.row,n=d.col,r=A.row+A.rowCount&&(r=A.row+A.rowCount-1),n=A.col+A.colCount&&(n=A.col+A.colCount-1),w=r-A.row,z=n-A.col,this.OG=!0,this.FG=!0,this.K2={paramRange:l,fromRange:u,rowOffset:w,colOffset:z},this.rG={KG:d.rowViewportIndex,MG:d.colViewportIndex,sG:d.hitTestType},this.qG())))},GG:function(){var d,l,q,u,A,r,n,w,z,C,c,m,h,a,B,y,t,E,I;this.OG&&this.FG&&(d=this.fH(),l=this.gH(),0<=d&&0<=l&&(q=this.K2,u=q.fromRange,A=q.rowOffset,r=q.colOffset,n=q.toRow,w=q.toCol,d===n&&l===w||(q.toRow=d,q.toCol=l,z=this.kj,C=z.getRowCount(),c=z.getColumnCount(),m=u.row,h=u.col,a=u.rowCount,B=u.colCount,y=0>m?-1:O(0,H(C-a,d-A)),t=0>h?-1:O(0,H(c-B,l-r)),E=L(z,K(y,t,a,B)),E&&(I=z.Cw,I.D1(q.paramRange.index,E)))),this.NG())},zH:function(){this.RG();this.FG=this.OG=!1;this.K2=null},jG:function(d){var l,q,u,A,r,n,w;A=this.kj;r=A.Cw;if((n=d.formulaRangeHitInfo)&&r&&(r.MH&&r.NH(),l=n.paramRange,q=l&&l.text,l&&q&&(u=I(A,q)))){if(A=u.row,r=0>u.row?-1:u.row+u.rowCount-1,q=u.col,u=0>u.col?-1:u.col+u.colCount-1,n.inTopLeft)n=r,w=u;else if(n.inTopRight)n=r,w=q,q=u;else if(n.inBottomLeft)n=A,w=u,A=r;else{if(!n.inBottomRight)return;n=A;w=q;A=r;q=u}this.HG=this.OG=!0;this.L2={paramRange:l,anchorRow:n,anchorCol:w,toRow:A,toCol:q};this.rG={KG:d.rowViewportIndex,MG:d.colViewportIndex,sG:d.hitTestType};this.qG()}},kG:function(d,l){var q=d.Cw;return q&&q.M0()?(this.D2(l),!0):!!this.F2(d)},IG:function(){var d,l,q,u,A,r,n,w,z,C,c,m,h,a,B,y,t,E;this.OG&&this.HG&&(d=this.fH(),l=this.gH(),0<=d&&0<=l&&(q=this.L2,u=q.anchorRow,A=q.anchorCol,r=q.toRow,n=q.toCol,d===r&&l===n||(q.toRow=d,q.toCol=l,w=this.kj,z=w.getRowCount(),C=w.getColumnCount(),c=0>u?z-1:u,m=0>A?C-1:A,h=H(c,d),a=H(m,l),B=O(c,d)-h+1,y=O(m,l)-a+1,0===h&&B===z&&(h=-1,B=-1),0===a&&y===C&&(a=-1,y=-1),t=L(w,K(h,a,B,y)),t&&(E=w.Cw,E.D1(q.paramRange.index,t)))),this.NG())},AH:function(){var d,l;this.RG();this.HG=this.OG=!1;this.L2=null;d=this.kj.Cw;d.V4&&(d.W0=1,l=d.text().lastIndexOf(",",d.caret()),-1!==l&&(d.W0=l+1))},vr:function(d,l,q){var u,A,r,n,w,z,F,c,m,h,a=this.kj,B=a.Cw,B=B&&B.l1();if(!B||0===B.length||(u=d.rowViewportIndex,A=d.colViewportIndex,this.qH(u,A,l,q)))return null;for(d=B.length-1;0<=d;d--)if(r=B[d],!1!==r.allowDrag&&(z=Q.G0.H0,(!z||!z._text)&&(n=I(a,r.text)))){if((w=a.getRangeRect(u,A,n),F=w.x-2,c=w.x+w.width+1-5,m=w.y-2,h=w.y+w.height+1-5,F+5<=l&&l=G.kt&&D.y>=G.nt&&D.x+D.width<=G.lt+G.js&&D.y+D.height<=G.ot+G.gs&&(H={sheet:d,row:l,col:u,sheetArea:3},F&&F.parentNode&&J.g5(F.parentNode.parentNode,q,D,H,!0))}},l}();u=function(){function d(){}return d.Q0=function(d,l){J.G0.H0||(J.G0.H0=new R);J.G0.H0.V2(l)},d.R0=function(d,l){J.G0.H0.W2(l)},d}();J.G0=u;U.exports=J},function(U,u,l){U=l(85);var d=l(26),J=l(149);l=U.GC$.extend;var R=d.u,Q=J.L0;l(U.oJ.prototype,{uH:function(){var d,l,u=this.kj;0=l;l++)for(H=0;2>=H;H++)if((u=G.Ft(l,H))&&0!==u.width&&0!==u.height){var q=F;u=I;var D=l,A=H,r=K,n=void 0,w,z,C,c,m,h,a=void 0,B=void 0,y,t,E=void 0,M,p=void 0,g=void 0,f=void 0,k=void 0,x,U=void 0,P=q.kj;M=P.mm;var V=P.Cw,Z=V&&V.l1(),e=Z&&Z.length;if(!(0>=e)&&(n=q.VI(D,A,r))){u.save();u.rect(n.x,n.y,n.width,n.height);u.clip();u.beginPath();r=[];w=M.isFormulaRangeHoving;z=M.tH;C=M.FG;c=M.K2;m=M.HG;h=M.L2;for(M=0;M