jquery.wijmo.wijspread.3.20142.13.min_wev8.js
1.7 MB
/*
*
* SpreadJS Library 3.20142.13
* http://wijmo.com/
*
* Copyright(c) GrapeCity, Inc. All rights reserved.
*
* Licensed under the Wijmo Commercial License. Also available under the GNU GPL Version 3 license.
* licensing@wijmo.com
* http://wijmo.com/widgets/license/
*
*
**/
var __extends,wijmo;(function(n){(function(n){function u(n,t){if(i.ensure(n),t&&t.length>0&&!i.check(t)){var r=window.console;r&&r.error&&r.error("["+n+"]: One or more dependency in ["+t+"] are not found!")}}var r=jQuery,t=null,i=function(){function i(n,t,i){this.prop=n;this.getter=t;this.setter=i}return i.parse=function(r){var f,u,o,e;if(r!==undefined&&r!==t&&r.length>0){f=r.split(".");u=t;do o=f.shift(),e=new i(o,function(){var t=this;return t.base?t.base.getter()[t.prop]:n.features[t.prop]},function(i){var r=this,u;r.base?(u=r.base.getter(),(u===t||u===undefined)&&r.base.setter(u={}),u[r.prop]=i):n.features[r.prop]=i}),u&&(e.base=u),u=e;while(f.length>0);return u}return t},i.ensure=function(n){var t=i.parse(n);t&&t.setter(!0)},i.check=function(n){var t=!0;return r.each(n,function(n,r){var u=i.parse(r);return u&&!u.getter()?t=!1:!0}),t},i}();n.feature=u;n.features=function(n){return n?n:{core:{migrate:!1,mousewheel:!1,stringResource:!1,common:!1,imageLoader:!1,theme:!1,globalize:!1,spreadpanelex:!1,basecelltype:!1,sheet_model:!1,sheet_action:!1,sheet_event:!1,sheet_border:!1,sheet_render:!1,sheet_ui:!1,sheet:!1,spread:!1,spread_ui:!1},calc:{common:!1,functions:!1,functions_db:!1,functions_eng:!1,functions_fin:!1,functions_lookup:!1,functions_stat:!1},filter:!1,filter_ui:!1,sparkline:!1,table:!1,binding:!1,group:!1,celltype:!1,conditionalFormat:!1,dataValidator:!1,fill:!1,fill_ui:!1,formatter:!1,search:!1,touch:!1,floatingObject:!1,comment:!1,sparklineEx:!1,formulatextbox:!1,formulatextbox_resource:!1,basedialog:!1}}(n.features)})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={})),function(n){(function(n){(function(t){n.feature("core.migrate"),function(n,t){var u=t().jquery?t().jquery.split("."):"",r,i,e,o,f,s,h;(parseInt(u[0],10)>1||parseInt(u[0],10)===1&&parseInt(u[1],10)>=9)&&(t.event.handle=t.event.dispatch,t.uaMatch=function(n){n=n.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(n)||/(webkit)[ \/]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[];return{browser:t[1]||"",version:t[2]||"0"}},t.browser||(r=t.uaMatch(navigator.userAgent),i={},r.browser&&(i[r.browser]=!0,i.version=r.version),i.chrome?i.webkit=!0:i.webkit&&(i.safari=!0),t.browser=i),e=t.fn.toggle,t.fn.toggle=function(n,i){if(!t.isFunction(n)||!t.isFunction(i))return e.apply(this,arguments);var r=arguments,o=n.guid||t.guid++,u=0,f;for(f=function(i){var f=(t._data(this,"lastToggle"+n.guid)||0)%u;return t._data(this,"lastToggle"+n.guid,f+1),i.preventDefault(),r[f].apply(this,arguments)||!1},f.guid=o;u<r.length;)r[u++].guid=o;return this.click(f)},o=t.fn.andSelf||t.fn.addBack,t.fn.andSelf=function(){return o.apply(this,arguments)});f=navigator.userAgent.toLowerCase();s=f.indexOf("compatible")<0&&/(trident)(?:.*? rv ([\w.]+)|)/.exec(f)!==null;s&&t.browser&&(t.browser.mozilla=undefined,t.browser.msie=!0);h=function(){var t=null,n=null;try{new ActiveXObject("")}catch(i){t=i.name}try{n=!!new ActiveXObject("htmlfile")}catch(i){n=!1}return n=t!="ReferenceError"&&n==!1?!1:!0,!n};t.browser.msie&&h()&&(t.browser.metroMode=!0)}(window,jQuery)})(n.migrate||(n.migrate={}));var t=n.migrate})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(n){(function(t){n.feature("core.mousewheel",["core.migrate"]);var u="DOMMouseScroll",i="mousewheel",f="undefined",e="on",r=[u,i];typeof jQuery.event.special.gcmousewheel===f&&function(n){function t(t){var u=[].slice.call(arguments,1),r=0,e=!0;return t=n.event.fix(t||window.event),t.type="gc"+i,(typeof t.wheelDelta===f||t.wheelDelta===null)&&(typeof t.detail===f||t.detail===null)&&(t.wheelDelta=t.originalEvent.wheelDelta,t.detail=t.originalEvent.detail),t.wheelDelta&&(r=t.wheelDelta/120),t.detail&&(r=-t.detail/3),u.unshift(t,r),n.event.handle.apply(t.target||t.srcElement,u)}n.event.special.gcmousewheel={setup:function(){var n,f;if(this.addEventListener)for(n=r.length;n;)f=r[--n],f===i&&this.addEventListener(u,t,!1),this.addEventListener(f,t,!1);else this.attachEvent(e+i,t)},teardown:function(){var n,f;if(this.removeEventListener)for(n=r.length;n;)f=r[--n],f===i&&this.removeEventListener(u,t,!1),this.removeEventListener(f,t,!1);else this.detachEvent(e+i,t)}};n.fn.extend({handlegcmousewheel:function(n){return n?this.bind(i,n):this.trigger(i)},unhandlegcmousewheel:function(n){return this.unbind(i,n)}})}(jQuery)})(n.mousewheel||(n.mousewheel={}));var t=n.mousewheel})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(t){var i,r;t.feature("core.stringResource");i=function(){function t(){}return t.getHelpFuncs=function(){var t=n.spread.FormulaTextBoxResource_EN;return t?t.Functions:null},t.Exp_InvalidArgument="Invalid argument",t.Exp_InvalidCast="InvalidCastException",t.Exp_NotSupport="NotSupportException",t.Exp_FormulaInvalid="The formula you typed contains an invalid char: ",t.Exp_InvalidTokenAt="invalid token at ",t.Exp_InvalidArrayAt="Invalid array at ",t.Exp_InvalidCellReference="Invalid cell reference or name at ",t.Exp_InvalidFunctionName="Invalid function name",t.Exp_InvalidOverrideFunction="Cannot override built-in function",t.Exp_OverrideNotAllowed="Attempt to override function while override is not allowed",t.Exp_NoSyntax="no syntax '",t.Exp_MatchSyntax="'to match the syntax '",t.SingleQuotesFullStop="'.",t.SingleQuote="'",t.Exp_IsValid="' is invalid.",t.Exp_InvalidArray="Invalid array",t.AtIndexOn="' at index on ",t.FullStop=".",t.SingleQuoteAt="' at ",t.Exp_InvalidParameters="Invalid function parameters at ",t.Exp_InvalidArrayColumns="The length of array columns are unequal at ",t.Exp_ExprIsNull="The argument 'expr' is null",t.Exp_RuleIsNull="The argument 'rule' is null",t.CopyCells="Copy Cells",t.FillSeries="Fill Series",t.FillFormattingOnly="Fill Formatting Only",t.FillWithoutFormatting="Fill Without Formatting",t.Exp_NumberOnly="Only works for Numbers",t.Exp_RangeContainsMergedCell="Range should not have merged cell.",t.Exp_ChangeMergedCell="Cannot change part of merged cell.",t.Exp_TargetContainsMergedCells="Target range should not have merged cells.",t.Exp_MergedCellsIdentical="This operation requires the merged cells to be identically sized.",t.SortAscending="Sort Ascending",t.SortDescending="Sort Descending",t.OK="OK",t.Cancel="Cancel",t.Search="Search",t.CheckAll="Check all",t.UncheckAll="Uncheck all",t.Blanks="(Blanks)",t.Exp_FilterItemIsNull="FilterItem is null.",t.Exp_InvalidColumnIndex="Invalid column index.",t.Exp_TokenIsNull="token is null",t.Exp_InvalidBackslash="the '\\' cannot be evaluated",t.Exp_FormatIllegal="format is illegal.",t.Exp_ValueIsNull="value is null",t.Exp_PartIsNull="part is null",t.Exp_DuplicatedDescriptor="The type of descriptor was added.",t.Exp_TokenIllegal="token is illegal.",t.Exp_ValueIllegal="value is illegal.",t.Exp_StringIllegal="string is illegal.",t.Exp_InvalidNull="InvalidNullException",t.Exp_InvalidOperation="InvalidOperationException",t.Exp_ArgumentNull="ArgumentNullException",t.Exp_CriteriaIsNull="criteria is null",t.Exp_InvalidString="Invalid string",t.Exp_InvalidDateFormat="Invalid date format pattern",t.Exp_InvalidOADate="invalid OADate",t.Exp_InvalidExponentFormat="invalid exponent format",t.Exp_InvalidSemicolons="invalid format: too many semicolons",t.Exp_InvalidNumberGroupSize="NumberGroupSize must be between 1 and 9.",t.Exp_BadFormatSpecifier="Bad Format Specifier",t.Exp_InvalidNumberFormat="Invalid number format pattern",t.Exp_InvalidIndex="Invalid index",t.Exp_InvalidCount="Invalid count",t.Exp_InvalidLevel="Invalid level",t.Exp_GroupInfoIsNull="groupInfo is null",t.Exp_SheetIsNull="sheet is null.",t.Exp_DestSheetIsNull="destSheet is null",t.Exp_PasteExtentIsNull="pasteExtent is null",t.Exp_InvalidPastedArea="The pasted area should have the same size as the copy or cut area.",t.Exp_ChangePartOfArray="Cannot change part of an array.",t.Exp_ColumnReadOnly="The column you are trying to change is protected and therefore read-only.",t.Exp_RowReadOnly="The row you are trying to change is protected and therefore read-only.",t.Exp_CellReadOnly="The row you are trying to change is protected and therefore read-only.",t.Exp_FillRangeContainsMergedCell="Cannot fill range that contains a merged cell.",t.Exp_FillCellsReadOnly="The cells you are trying to fill is protected and therefore read-only.",t.Exp_OverlappingSpans="This operation will cause overlapping spans.",t.Exp_InvalidAndSpace="Invalid ",t.ColonSpace=": ",t.MustBeBetween=" (must be between ",t.SpaceAndSpace=" and ",t.RightBracketFullStop=").",t.Exp_SrcIsNull="The argument 'src' is null",t.Exp_DestIsNull="The argument 'dest' is null",t.Exp_InvalidCustomFunction="invalid custom function",t.Exp_InvalidCustomName="invalid custom name",t.Exp_IndexOutOfRange="Index is out of range!",t.Exp_InvalidRange="Invalid range",t.Exp_RangeIsNull="range is null",t.Exp_NotAFunction="is not a function",t.Exp_Format="Format",t.Exp_BraceMismatch="format: brace mis-match",t.Exp_InvalidFormat="invalid format",t.Exp_ArgumentOutOfRange="ArgumentOutOfRange",t.Exp_DragDropShiftTableCell="This operation is not allowed. The operation is attempting to shift cells in a table on your worksheet.",t.Exp_DragDropChangePartOfTable="Cannot complete operation: You are attempting to change a portion of a table row or column in a way that is not allowed.",t.Exp_TableEmptyNameError="The table name cannot be empty.",t.Exp_TableInvalidRow="Invalid row index or row count.",t.Exp_TableInvalidColumn="Invalid column index or column count.",t.Exp_TableIntersectError="The tables cannot be intersected.",t.Exp_TableHasSameNameError="The current worksheet already exists in a table with the same name.",t.Exp_TableDataSourceNullError="Table datasource cannot be null.",t.Exp_TableStyleAddCustomStyleError="The style with the same name already exists in the styles.",t.Exp_TableMoveOutOfRange="The table cannot be moved out of the sheet.",t.Exp_TableResizeOutOfRange="The invalid row count, column count and table cannot be resize out of the sheet.",t.Exp_PasteSourceCellsLocked="Source sheet's cells are locked.",t.Exp_InvalidCopyPasteSize="The copy and paste areas are not the same size.",t.Exp_PasteDestinationCellsLocked="The cell you are trying to change is protected and therefore read-only.",t.Exp_PasteChangeMergeCell="Cannot change part of a merged cell.",t.Tip_Row="Row: ",t.Tip_Column="Column: ",t.Tip_Height="Height: ",t.Tip_Width="Width: ",t.Tip_pixels=" pixels",t.NewTab="New...",t.Exp_EmptyNamedStyle="The name of named style cannot be empty or null",t.Exp_FloatingObjectHasSameNameError="The current worksheet already has a floating object with the same name.",t.Exp_FloatingObjectNameEmptyError="Floating object must have name",t.ToolStrip_PasteText="Paste",t.ToolStrip_CutText="Cut",t.ToolStrip_CopyText="Copy",t.ToolStrip_AutoFillText="AutoFill",t.Exp_ArrayFromulaPart="You cannot change part of an array.",t.Exp_ArrayFromulaSpan="Array formulas are not valid in merged cells.",t.Exp_ArrayFormulaTable="multi-cell array formulas are not allowed in tables.",t.Fbx_Summary="Summary",t}();t._ENStringResource=i;r=function(){function t(){}return t.getHelpFuncs=function(){var t=n.spread.FormulaTextBoxResource_JP;return t?t.Functions:null},t.Exp_InvalidArgument="\u7121\u52b9\u306a\u5f15\u6570",t.Exp_InvalidCast="\u4f8b\u5916:\u7121\u52b9\u306a\u30ad\u30e3\u30b9\u30c8",t.Exp_NotSupport="\u4f8b\u5916:\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u6a5f\u80fd\u306e\u5229\u7528\u3092\u8a66\u307f\u307e\u3057\u305f",t.Exp_FormulaInvalid="\u5165\u529b\u3055\u308c\u305f\u6570\u5f0f\u306f\u7121\u52b9\u306a\u6587\u5b57\u3092\u542b\u3093\u3067\u3044\u307e\u3059 : ",t.Exp_InvalidTokenAt="\u7121\u52b9\u306a\u30c8\u30fc\u30af\u30f3 : ",t.Exp_InvalidArrayAt="\u7121\u52b9\u306a\u914d\u5217 : ",t.Exp_InvalidCellReference="\u30bb\u30eb\u540d\u3082\u3057\u304f\u306f\u30bb\u30eb\u53c2\u7167\u304c\u7121\u52b9\u3067\u3059 : ",t.Exp_InvalidFunctionName="\u7121\u52b9\u306a\u95a2\u6570\u540d",t.Exp_InvalidOverrideFunction="\u7d44\u8fbc\u95a2\u6570\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093",t.Exp_OverrideNotAllowed="\u8a31\u53ef\u3055\u308c\u3066\u3044\u306a\u3044\u95a2\u6570\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u306e\u5b9f\u884c\u3067\u3059",t.Exp_NoSyntax="\u69cb\u6587 '",t.Exp_MatchSyntax="' \u306f\u6b21\u306e\u69cb\u6587 '",t.SingleQuotesFullStop="' \u3068\u30de\u30c3\u30c1\u3057\u307e\u305b\u3093\u3067\u3057\u305f\u3002",t.SingleQuote="'",t.Exp_IsValid="' \u306f\u7121\u52b9\u3067\u3059\u3002",t.Exp_InvalidArray="\u7121\u52b9\u306a\u914d\u5217 : ",t.AtIndexOn="' \u8a72\u5f53\u3059\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9 : ",t.FullStop="",t.SingleQuoteAt="' \u4f4d\u7f6e : ",t.Exp_InvalidParameters="\u7121\u52b9\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u691c\u51fa : ",t.Exp_InvalidArrayColumns="\u914d\u5217\u306e\u30ab\u30e9\u30e0\u9577\u304c\u4e00\u81f4\u3057\u307e\u305b\u3093 \u4f4d\u7f6e : ",t.Exp_ExprIsNull="\u5f15\u6570 'expr' \u304c null \u3067\u3059",t.Exp_RuleIsNull="\u5f15\u6570 'rule' \u304c null \u3067\u3059",t.CopyCells="\u30bb\u30eb\u306e\u30b3\u30d4\u30fc",t.FillSeries="\u9023\u7d50\u30c7\u30fc\u30bf",t.FillFormattingOnly="\u66f8\u5f0f\u306e\u307f\u30b3\u30d4\u30fc",t.FillWithoutFormatting="\u66f8\u5f0f\u306a\u3057\u30b3\u30d4\u30fc",t.Exp_NumberOnly="\u6570\u5b57\u306e\u307f\u6709\u52b9\u3067\u3059",t.Exp_RangeContainsMergedCell="\u7d50\u5408\u3055\u308c\u305f\u30bb\u30eb\u304c\u7bc4\u56f2\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002",t.Exp_ChangeMergedCell="\u7d50\u5408\u3055\u308c\u305f\u30bb\u30eb\u306e\u4e00\u90e8\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",t.Exp_TargetContainsMergedCells="\u7d50\u5408\u3055\u308c\u305f\u30bb\u30eb\u304c\u6307\u5b9a\u306e\u7bc4\u56f2\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002",t.Exp_MergedCellsIdentical="\u3053\u306e\u64cd\u4f5c\u306b\u306f\u540c\u3058\u30b5\u30a4\u30ba\u306e\u7d50\u5408\u30bb\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002",t.SortAscending="\u6607\u9806",t.SortDescending="\u964d\u9806",t.OK="OK",t.Cancel="\u30ad\u30e3\u30f3\u30bb\u30eb",t.Search="\u691c\u7d22",t.CheckAll="\u3059\u3079\u3066\u9078\u629e",t.UncheckAll="\u3059\u3079\u3066\u89e3\u9664",t.Blanks="(\u7a7a\u767d\u30bb\u30eb)",t.Exp_FilterItemIsNull="\u30d5\u30a3\u30eb\u30bf\u9805\u76ee\u304c null \u3067\u3059\u3002",t.Exp_InvalidColumnIndex="\u7121\u52b9\u306a\u5217\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3067\u3059\u3002",t.Exp_TokenIsNull="\u30c8\u30fc\u30af\u30f3\u304c null \u3067\u3059",t.Exp_InvalidBackslash="'\\' \u3092\u8a55\u4fa1\u3067\u304d\u307e\u305b\u3093\u3002",t.Exp_FormatIllegal="\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u304c\u4e0d\u6b63\u3067\u3059\u3002",t.Exp_ValueIsNull="\u5024\u306f null \u3067\u3059",t.Exp_PartIsNull="part \u306f null \u3067\u3059",t.Exp_DuplicatedDescriptor="\u305d\u306e\u7a2e\u985e\u306e\u8a18\u8ff0\u5b50\u306f\u65e2\u306b\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002",t.Exp_TokenIllegal="\u30c8\u30fc\u30af\u30f3\u304c\u4e0d\u6b63\u3067\u3059\u3002",t.Exp_ValueIllegal="\u5024\u304c\u4e0d\u6b63\u3067\u3059\u3002",t.Exp_StringIllegal="\u6587\u5b57\u5217\u304c\u4e0d\u6b63\u3067\u3059\u3002",t.Exp_InvalidNull="\u7121\u52b9\u306a null \u306b\u3088\u308b\u4f8b\u5916",t.Exp_InvalidOperation="\u7121\u52b9\u306a\u64cd\u4f5c\u306b\u3088\u308b\u4f8b\u5916",t.Exp_ArgumentNull="null \u5f15\u6570\u306b\u3088\u308b\u4f8b\u5916",t.Exp_CriteriaIsNull="\u6761\u4ef6\u3068\u306a\u308b\u5f15\u6570\u304c null \u3067\u3059",t.Exp_InvalidString="\u7121\u52b9\u306a\u6587\u5b57\u5217",t.Exp_InvalidDateFormat="\u7121\u52b9\u306a\u65e5\u4ed8\u30d5\u30a9\u30fc\u30de\u30c3\u30c8",t.Exp_InvalidOADate="\u7121\u52b9\u306a OADate",t.Exp_InvalidExponentFormat="\u7121\u52b9\u306a\u6307\u6570\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u3059",t.Exp_InvalidSemicolons="\u7121\u52b9\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8: \u30bb\u30df\u30b3\u30ed\u30f3\u304c\u591a\u3059\u304e\u307e\u3059",t.Exp_InvalidNumberGroupSize="NumberGroupSize \u306f1\u304b\u30899\u306e\u5024\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002",t.Exp_BadFormatSpecifier="\u8aa4\u3063\u305f\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u6307\u793a\u5b50",t.Exp_InvalidNumberFormat="\u7121\u52b9\u306a\u6570\u5024\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u3059",t.Exp_InvalidIndex="\u7121\u52b9\u306a\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3067\u3059",t.Exp_InvalidCount="\u7121\u52b9\u306a\u30ab\u30a6\u30f3\u30c8\u3067\u3059",t.Exp_InvalidLevel="\u7121\u52b9\u306a\u30ec\u30d9\u30eb\u3067\u3059",t.Exp_GroupInfoIsNull="groupInfo \u304c null \u3067\u3059",t.Exp_SheetIsNull="sheet \u304c null\u3067\u3059\u3002",t.Exp_DestSheetIsNull="destSheet \u304c null \u3067\u3059\u3002",t.Exp_PasteExtentIsNull="pasteExtent \u304c null \u3067\u3059",t.Exp_InvalidPastedArea="\u8cbc\u308a\u4ed8\u3051\u9818\u57df\u306f\u30b3\u30d4\u30fc/\u5207\u308a\u53d6\u308a\u7bc4\u56f2\u3068\u540c\u30b5\u30a4\u30ba\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002",t.Exp_ChangePartOfArray="\u914d\u5217\u306e\u4e00\u90e8\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",t.Exp_ColumnReadOnly="\u5909\u66f4\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u5217\u306f\u4fdd\u8b77\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002",t.Exp_RowReadOnly="\u5909\u66f4\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u884c\u306f\u4fdd\u8b77\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002",t.Exp_CellReadOnly="\u5909\u66f4\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u30bb\u30eb\u306f\u4fdd\u8b77\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002",t.Exp_FillRangeContainsMergedCell="\u7d50\u5408\u3057\u305f\u30bb\u30eb\u304c\u542b\u307e\u308c\u308b\u7bc4\u56f2\u3092\u30d5\u30a3\u30eb\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",t.Exp_FillCellsReadOnly="\u30d5\u30a3\u30eb\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u7bc4\u56f2\u306f\u4fdd\u8b77\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002",t.Exp_OverlappingSpans="\u3053\u306e\u64cd\u4f5c\u306f\u7d50\u5408\u90e8\u5206\u306e\u91cd\u8907\u3092\u5f15\u304d\u8d77\u3053\u3057\u307e\u3059\u3002",t.Exp_InvalidAndSpace="\u7121\u52b9\u306a ",t.ColonSpace=" : ",t.MustBeBetween=" \u306f ",t.SpaceAndSpace=" \u304b\u3089 ",t.RightBracketFullStop=" \u306e\u9593\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002",t.Exp_SrcIsNull="\u5f15\u6570 'src' \u306f null \u3067\u3059",t.Exp_DestIsNull="\u5f15\u6570 'dest' \u306f null \u3067\u3059",t.Exp_InvalidCustomFunction="\u7121\u52b9\u306a\u30ab\u30b9\u30bf\u30e0\u95a2\u6570",t.Exp_InvalidCustomName="\u7121\u52b9\u306a\u540d\u524d",t.Exp_IndexOutOfRange="\u7bc4\u56f2\u5916\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3067\u3059!",t.Exp_InvalidRange="\u7121\u52b9\u306a\u7bc4\u56f2",t.Exp_RangeIsNull="\u7bc4\u56f2\u304c null \u3067\u3059",t.Exp_NotAFunction="\u306f\u95a2\u6570\u3067\u306f\u3042\u308a\u307e\u305b\u3093",t.Exp_Format="\u30d5\u30a9\u30fc\u30de\u30c3\u30c8",t.Exp_BraceMismatch="\u30d5\u30a9\u30fc\u30de\u30c3\u30c8: \u62ec\u5f27\u306e\u500b\u6570\u304c\u4e00\u81f4\u3057\u3066\u3044\u307e\u305b\u3093",t.Exp_InvalidFormat="\u7121\u52b9\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8",t.Exp_ArgumentOutOfRange="\u7bc4\u56f2\u5916\u306e\u5f15\u6570",t.Exp_DragDropShiftTableCell="\u3053\u306e\u64cd\u4f5c\u306f\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u4e0a\u306e\u30c6\u30fc\u30d6\u30eb\u5185\u3067\u30bb\u30eb\u3092\u30b7\u30d5\u30c8\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u305f\u3081\u8a31\u53ef\u3055\u308c\u307e\u305b\u3093\u3002",t.Exp_DragDropChangePartOfTable="\u64cd\u4f5c\u3092\u5b8c\u4e86\u3067\u304d\u307e\u305b\u3093\u3002\u8a31\u53ef\u3055\u308c\u3066\u3044\u306a\u3044\u65b9\u6cd5\u3067\u30c6\u30fc\u30d6\u30eb\u306e\u884c\u307e\u305f\u306f\u5217\u306e\u4e00\u90e8\u3092\u5909\u66f4\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u307e\u3059\u3002",t.Exp_TableEmptyNameError="\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u7a7a\u306b\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",t.Exp_TableInvalidRow="\u7121\u52b9\u306a\u884c\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3082\u3057\u304f\u306f\u884c\u6570\u3067\u3059\u3002",t.Exp_TableInvalidColumn="\u7121\u52b9\u306a\u5217\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3082\u3057\u304f\u306f\u5217\u6570\u3067\u3059\u3002",t.Exp_TableIntersectError="\u30c6\u30fc\u30d6\u30eb\u3092\u91cd\u306d\u5408\u308f\u305b\u308b\u3053\u3068\u306f\u51fa\u6765\u307e\u305b\u3093\u3002",t.Exp_TableHasSameNameError="\u3059\u3067\u306b\u540c\u540d\u306e\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u304c\u5b58\u5728\u3057\u307e\u3059\u3002",t.Exp_TableDataSourceNullError="\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3092 null \u306b\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",t.Exp_TableStyleAddCustomStyleError="\u3059\u3067\u306b\u540c\u540d\u306e\u30b9\u30bf\u30a4\u30eb\u540d\u304c\u5b58\u5728\u3057\u307e\u3059\u3002",t.Exp_TableMoveOutOfRange="\u30c6\u30fc\u30d6\u30eb\u3092\u30b7\u30fc\u30c8\u5916\u306b\u79fb\u52d5\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",t.Exp_TableResizeOutOfRange="\u7121\u52b9\u306a\u884c\u6570\u3001\u5217\u6570\u3067\u3059\u3002\u30c6\u30fc\u30d6\u30eb\u3092\u30b7\u30fc\u30c8\u7bc4\u56f2\u5916\u306b\u30ea\u30b5\u30a4\u30ba\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",t.Exp_PasteSourceCellsLocked="\u53c2\u7167\u5143\u3068\u306a\u3063\u3066\u3044\u308b\u30b7\u30fc\u30c8\u306e\u30bb\u30eb\u306f\u30ed\u30c3\u30af\u3055\u308c\u3066\u3044\u307e\u3059\u3002",t.Exp_InvalidCopyPasteSize="\u30b3\u30d4\u30fc\u3068\u8cbc\u308a\u4ed8\u3051\u306e\u7bc4\u56f2\u30b5\u30a4\u30ba\u304c\u7570\u306a\u3063\u3066\u3044\u307e\u3059\u3002",t.Exp_PasteDestinationCellsLocked="\u5909\u66f4\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u30bb\u30eb\u306f\u4fdd\u8b77\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002",t.Exp_PasteChangeMergeCell="\u7d50\u5408\u3057\u305f\u30bb\u30eb\u306e\u4e00\u90e8\u306f\u5909\u66f4\u3067\u304d\u307e\u305b\u3093\u3002",t.Tip_Row="\u884c: ",t.Tip_Column="\u5217: ",t.Tip_Height="\u9ad8\u3055: ",t.Tip_Width="\u5e45: ",t.Tip_pixels=" \u30d4\u30af\u30bb\u30eb",t.NewTab="New...",t.Exp_EmptyNamedStyle="\u540d\u524d\u4ed8\u304d\u30b9\u30bf\u30a4\u30eb\u306e\u540d\u79f0\u3092\u7a7a\u306b\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",t.Exp_FloatingObjectHasSameNameError="\u3059\u3067\u306b\u540c\u540d\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u540d\u304c\u5b58\u5728\u3057\u307e\u3059\u3002",t.Exp_FloatingObjectNameEmptyError="\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u540d\u3092\u7a7a\u306b\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",t.ToolStrip_PasteText="\u8cbc\u308a\u4ed8\u3051",t.ToolStrip_CutText="\u5207\u308a\u53d6\u308a",t.ToolStrip_CopyText="\u30b3\u30d4\u30fc",t.ToolStrip_AutoFillText="\u30aa\u30fc\u30c8\u30d5\u30a3\u30eb",t.Exp_ArrayFromulaPart="\u914d\u5217\u306e\u4e00\u90e8\u3092\u5909\u66f4\u3067\u304d\u307e\u305b\u3093\u3002",t.Exp_ArrayFromulaSpan="\u914d\u5217\u6570\u5f0f\u306f\u3001\u7d50\u5408\u3057\u305f\u30bb\u30eb\u3067\u306f\u7121\u52b9\u3067\u3059\u3002",t.Exp_ArrayFormulaTable="\u8907\u6570\u30bb\u30eb\u306e\u914d\u5217\u6570\u5f0f\u306f\u30c6\u30fc\u30d6\u30eb\u3067\u306f\u8a31\u53ef\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002",t.Fbx_Summary="\u6982\u8981",t}();t._JPStringResource=r;t.SR=i})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(t){function g(n){if(u.browser.safari)return n.font;var t="",i="normal",r="400";return n.fontStyle!==i&&(t=n.fontStyle),n.fontVariant!==i&&(t+=" "+n.fontVariant),n.fontWeight!==i&&n.fontWeight!==r&&(t+=" "+n.fontWeight),t+=" "+n.fontSize,n.lineHeight!==i&&(t+="/"+n.lineHeight),t+(" "+n.fontFamily)}function iu(n){var t=document.createElement("span");return u(t).css("visibility","hidden").css("top","-10000px").css("left","-10000px").css("position","absolute").attr("className","gcFontDetectSpanStyle").attr("gcUIElement","gcFontDetectSpan"),document.body.insertBefore(t,r),{span:t,dispose:function(){document.body.removeChild(t);delete this.span}}}var c,l,h,vt,w,b,a,k,yt,pt,wt,bt,kt,dt,gt,ni,ti,ii,v,ri,ui,fi,ei,oi,si,hi,ci,li,ai,vi,yi,pi,wi,bi,ki,di,gi,nr,tr,ir,rr,ur,fr,er,or,sr,hr,cr,lr,ar,vr,yr,pr,wr,br,kr,dr,gr,nu,tu,o,d,nt,tt,y,it,rt,ut,ft,et,p,ot,ru,st;t.feature("core.common",["core.migrate","core.stringResource"]);var u=jQuery,ht="boolean",ct="date",f="undefined",i=undefined,r=null,lt=Math.abs,at=Math.floor,s=Math.min,e=Math.max;typeof u.wijmo===f&&(u.wijmo=n);c=function(){function n(){}return n.createEventHandler=function(n,t){return function(){return t.apply(n,arguments)}},n.cancelDefault=function(n){return n.preventDefault?(n.preventDefault(),n.stopPropagation()):(n.cancelBubble=!1,n.returnValue=!1),!1},n._isStandardCanvas=function(){return typeof n.canvasApiFound===f&&(n.canvasApiFound=typeof document.createElement("canvas").getContext!==f),n.canvasApiFound},n._isSilverlightCanvas=function(){return n._isStandardCanvas()?!0:(typeof n.slCanvasApiFound===f&&(n.slCanvasApiFound=typeof window.slcanvas!==f),n.slCanvasApiFound)},n._useDoubleBuffer=function(){var t=n;return t._isStandardCanvas()||t._isSilverlightCanvas()},n.getHAlignByValueType=function(n,t){if(n===3){var i=u.type(t);n=i==="boolean"?1:i==="number"||i==="date"?2:0}return n},n.inArray=function(n,t,i){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,n,i);var r=t.length;for(i=i?i<0?e(0,r+i):i:0;i<r;i++)if(i in t&&t[i]===n)return i}return-1},n.parseColorString=function(t){var h=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,c=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,l=/^rgb\(([\s\d]*),([\s\d]*),([\s\d]*)\)$/i,a=/^rgba\(([\s\d]*),([\s\d]*),([\s\d]*),([\s\d]*)\)$/i,v=function(n){var i,t;return n?function(n){if(!t){var i=window.document.createElement("canvas");i&&i.getContext&&(t=i.getContext("2d"))}return t?(t.fillStyle=n,t.fillStyle):n}:function(n){return typeof i===f&&(i=u("<span><\/span>")),i.css("color",n),i.css("color")}}(n._isStandardCanvas()),y=function(n){return parseInt(n,16)},p=function(n){return parseInt(n+n,16)},s=function(n){return n.indexOf("%")>0?parseFloat(n)*2.55:n|0},e=v(t),i=RegExp,o;if(h.test(e))return[i.$1,i.$2,i.$3].map(y);else if(a.test(e))return o=[i.$1,i.$2,i.$3].map(s),o.splice(0,0,parseFloat(i.$4)*255),o;else if(l.test(e))return[i.$1,i.$2,i.$3].map(s);else if(c.test(e))return[i.$1,i.$2,i.$3].map(p);return r},n.position=function(t,i){if(!i||!i.offset)return n._position.call(t,i);var r=i.offset.split(" "),f=i.at.split(" ");return r.length===1&&(r[1]=r[0]),/^\d/.test(r[0])&&(r[0]="+"+r[0]),/^\d/.test(r[1])&&(r[1]="+"+r[1]),f.length===1&&(/left|center|right/.test(f[0])?f[1]="center":(f[1]=f[0],f[0]="center")),n._position.call(t,u.extend(i,{at:f[0]+r[0]+" "+f[1]+r[1],offset:""}))},n.hasCalc=function(){return t.features.calc&&t.features.calc.common},n.toString=function(n){return n===r||n===i?"":u.type(n)===ht?n.toString().toUpperCase():u.type(n)===ct?n.getHours()===0&&n.getMinutes()===0&&n.getSeconds()===0&&n.getMilliseconds()===0?new t._DateTimeHelper(n).format("M/d/yyyy"):new t._DateTimeHelper(n).format("M/d/yyyy h:mm:ss"):n.toString()},n._applyBackgroundImageLayout=function(n,t,i,r,f,e){var h=u(n),o=t,s=i,c="background-position",l="background-size",a,v;switch(e){case 0:h.css(c,"0% 0%").css(l,"100% 100%");break;case 1:a="50%";v="50%";r>o&&(a="0%");f>s&&(v="0%");h.css(c,a+" "+v).css(l,"auto auto");break;case 2:var y=0,p=0,w=o,b=s;s>0&&f>0&&o/s>r/f?(w=r/f*s,y=y+o/2-w/2):o>0&&r>0&&s/o>f/r&&(b=f/r*o,p=p+s/2-b/2);h.css(c,y+"px "+p+"px").css(l,w+"px "+b+"px");break;case 3:h.css(c,"0% 0%").css(l,"auto auto");break;default:break}},n.device=function(){var i=navigator.userAgent,t=i.match(/iPad/i),n,r,u;return t&&(n=t[0],n&&(r=n.toLowerCase()==="ipad")),t=i.match(/iPhone/i),t&&(n=t[0],n&&(u=n.toLowerCase()==="iphone")),{ipad:r,iphone:u}},n.initPaint=function(t){var h=n._isStandardCanvas(),o,f,e,s;h||(o=document.getElementById(t),f=u(o).data("spread"),f)&&(f._initPaintTimeout!==i&&f._initPaintTimeout!==r&&window.clearTimeout(f._initPaintTimeout),e=f.canvas.firstChild,e&&e.loaded?(s=e.Content.SpreadsheetObject,f.attachSpreadsheetObject(s)):f._initPaintTimeout=window.setTimeout(function(){n.initPaint(t)},10))},n.isType=function(n,t){var f,u,e;if(n===i||n===r)return t==="null";if(!t)return!1;if((f={undefined:"undefined",number:"number",boolean:"boolean",string:"string"},f[typeof n]===t)||t==="function"&&/^\s*\bfunction\b/.test(""+n)||Object.prototype.toString.call(n).slice(8,-1).toLowerCase()===t.toLowerCase())return!0;if(n&&n._classNames){for(u=0;u<n._classNames.length;u++)if(e=n._classNames[u],e===t)return!0;return!1}else{if(n===i||n===r)return!1;if(t==="DateTime"||t==="TimeSpan")return n instanceof Date}return typeof t=="string"&&f[t]?!1:n instanceof t},n.asType=function(t,i){return n.isType(t,i)?t:r},n._position=u.fn.position,n}();t.util=c;l=function(){function n(){this._eventSuspended=0;typeof window.gcGlobal==f&&this._init()}return n.prototype._isIELessThan9=function(n,t){return n.browser.msie&&(typeof t===f||t<9)},n.prototype._createDummyObjects=function(){var t=n.prototype,i;t._dummyContent||(i=function(n){var t=document.createElement("span");return t.className=n,t.style.display="none",document.body.insertBefore(t,r),t},t._dummyHeader=i("ui-widget-header ui-state-default wijmoThemeHelper"),t._dummyContent=i("ui-widget-content wijmoThemeHelper"),t._dummyHover=i("ui-state-hover wijmoThemeHelper"),t._dummyHighlight=i("ui-state-highlight wijmoThemeHelper"))},n.prototype._init=function(){window.gcGlobal=this;this._eventSuspended=0;var t=n.prototype;window.addEventListener&&(window.addEventListener("keydown",t.keyDown,!0),window.addEventListener("keyup",t.keyUp,!0),window.addEventListener("compositionstart",t.compositionStart,!0),document.addEventListener("selectstart",t.docSelectStart,!0));u(document).mousedown(function(n){var i=window.gcGlobal.activeElement,u,f;i&&(u=t.getUIElement(n.target),f=u&&u.getAttribute("gcUIElement")==="gcAttachedFormulaTextBox",u||!i._endEditImp||f||(i._endEditImp(!1),i.repaint()),!u&&i._disposeValidationUI&&i._disposeValidationUI(),u||(window.gcGlobal.activeElement=r))});u(document).ready(function(){n.prototype._createDummyObjects()})},n.prototype.keyDown=function(n){var r=window.gcGlobal,t,i,f;r._eventSuspended>0||(t=r.activeElement,i=t&&t._validationSelect,i&&(f=u(i),f.is(":visible")))||t&&t.doKeyDown&&(t.doKeyDown(n),t.isEditing()||(n.keyCode===90||n.keyCode===89)&&n.ctrlKey&&!n.altKey&&c.cancelDefault(n))},n.prototype.keyUp=function(n){var i=window.gcGlobal,t;i._eventSuspended>0||(t=i.activeElement,t&&t.doKeyUp&&t.doKeyUp(n))},n.prototype.compositionStart=function(n){var i=window.gcGlobal,t;i._eventSuspended>0||(t=i.activeElement,t&&t.doCompositionStart&&t.doCompositionStart())},n.prototype.docSelectStart=function(n){return document.all===i&&window.gcGlobal&&window.gcGlobal.activeElement&&c.cancelDefault(n),!1},n.prototype.getUIElement=function(n){for(var t=n,i;t&&t.tagName!=="BODY";){if(typeof t.getAttribute!="function")break;if(i=t.getAttribute("gcUIElement"),i||(i=t.gcUIElement),i)return t;t=t.parentNode}return r},n.prototype.getWijmoThemeStyle=function(t){var r=n.prototype,i=r._dummyHeader,u;return t===1||t===2?i=r._dummyHighlight:t===4&&(i=r._dummyHover),u=i.currentStyle,document.defaultView&&document.defaultView.getComputedStyle&&(u=document.defaultView.getComputedStyle(i,"")),u},n.prototype.suspendEvent=function(){var n=window.gcGlobal;n._eventSuspended++},n.prototype.resumeEvent=function(){var n=window.gcGlobal;n._eventSuspended--;n._eventSuspended<0&&(n._eventSuspended=0)},n}();t.Global=l;window.gcGlobal=new l;h=Array;h.prototype.remove=function(n){for(var t=0;t<this.length;t++)if(this[t]===n){this.splice(t,1);return}};h.prototype.contains=function(n){for(var t=0;t<this.length;t++)if(this[t]===n)return!0;return!1};h.prototype.indexOf=function(n,t){(t===i||t===r||isNaN(t))&&(t=0);for(var u=t;u<this.length;u++)if(this[u]===n)return u;return-1};h.prototype.map||(h.prototype.map=function(n,i){var e,f,r,u=window.Object(this),o=u.length>>>0,s,h;if(typeof n!="function")throw new TypeError(n+t.SR.Exp_NotAFunction);for(i&&(e=i),f=new Array(o),r=0;r<o;)r in u&&(s=u[r],h=n.call(e,s,r,u),f[r]=h),r++;return f}),function(n){n[n.left=37]="left";n[n.right=39]="right";n[n.up=38]="up";n[n.down=40]="down";n[n.tab=9]="tab";n[n.enter=13]="enter";n[n.shift=16]="shift";n[n.ctrl=17]="ctrl";n[n.space=32]="space";n[n.altkey=18]="altkey";n[n.home=36]="home";n[n.end=35]="end";n[n.pup=33]="pup";n[n.pdn=34]="pdn";n[n.backspace=8]="backspace";n[n.del=46]="del";n[n.esc=27]="esc";n[n.a=65]="a";n[n.c=67]="c";n[n.v=86]="v";n[n.x=88]="x";n[n.z=90]="z";n[n.y=89]="y"}(t.Key||(t.Key={}));vt=t.Key;w=function(){function n(n,t,i,r,u,f){var e=this;e.key=n;e.ctrl=t;e.shift=i;e.alt=r;e.meta=f&&u||!1;e.action=f||u}return n}();t.KeyMap=w;b=function(){function n(n,t){this.x=n;this.y=t}return n.prototype.clone=function(){return new n(this.x,this.y)},n}();t.Point=b;a=function(){function n(n,t,i,r){var u=this;u.x=n;u.y=t;u.width=i;u.height=r}return n.prototype.intersect=function(n,t,i,r){var u=this;return n<u.x+u.width&&u.x<n+i&&t<u.y+u.height&&u.y<t+r},n.prototype.intersectRect=function(n){var t=this;return n.x<t.x+t.width&&t.x<n.x+n.width&&n.y<t.y+t.height&&t.y<n.y+n.height},n.prototype.contains=function(n,t){var i=this;return n<i.x+i.width&&i.x<n&&t<i.y+i.height&&i.y<t},n.prototype.containsRect=function(n){var t=this;return t.x<n.x&&n.x+n.width<t.x+t.width&&t.y<n.y&&n.y+n.height<t.y+t.height},n.prototype.getIntersectRect=function(n){return this.getIntersect(n.x,n.y,n.width,n.height)},n.prototype.getIntersect=function(t,i,u,f){var o=this,v=o.x,y=o.y,p=o.x+o.width,w=o.y+o.height,b=t,k=i,d=t+u,g=i+f,h=e(v,b),c=e(y,k),nt=s(p,d),tt=s(w,g),it=h,rt=c,l=nt-h,a=tt-c;return l>0&&a>0?new n(it,rt,l,a):r},n.empty=function(){return new n(0,0,0,0)},n}();t.Rect=a;k=function(){function n(n,t,i,r){var u=this;u.row=n;u.rowCount=i;u.col=t;u.colCount=r}return n.prototype.intersect=function(n,t,i,r){var u=this;return(n===-1||u.row===-1||u.row<n+i&&n<u.row+u.rowCount)&&(t===-1||u.col===-1||u.col<t+r&&t<u.col+u.colCount)},n.prototype.getIntersect=function(t,i,u){var f;if(t==r||(f=this,!f.intersect(t.row,t.col,t.rowCount,t.colCount)))return r;var c=f.col==-1?u:f.col+f.colCount-1,l=t.col==-1?u:t.col+t.colCount-1,a=f.row==-1?i:f.row+f.rowCount-1,v=t.row==-1?i:t.row+t.rowCount-1,o=e(f.col,t.col),y=s(c,l),h=e(f.row,t.row),p=s(a,v),w=h==-1?-1:p-h+1,b=o==-1?-1:y-o+1;return new n(h,o,w,b)},n.prototype.contains=function(t,i,r,u){var f=this;if(arguments.length===2)return(f.row===-1||f.row<=t&&t<f.row+f.rowCount)&&(f.col===-1||f.col<=i&&i<f.col+f.colCount);else if(arguments.length===4)return f.containsRange(new n(t,i,r,u));return!1},n.prototype.containsRange=function(n){var t=this;return(t.row===-1||t.row<=n.row&&n.row+n.rowCount<=t.row+t.rowCount)&&(t.col===-1||t.col<=n.col&&n.col+n.colCount<=t.col+t.colCount)},n.prototype.offset=function(t,i){var r=this,u=r.col,f=r.row;return r.col!==-1&&(u+=t),r.row!==-1&&(f+=i),new n(f,u,r.rowCount,r.colCount)},n.prototype.union=function(t){var i=this,r=s(i.row,t.row),u=s(i.col,t.col),f=e(i.row+i.rowCount-1,t.row+t.rowCount-1),o=e(i.col+i.colCount-1,t.col+t.colCount-1);return new n(r,u,f-r+1,o-u+1)},n.prototype.equals=function(t){var i=this;return t instanceof n?i.row===t.row&&i.col===t.col&&i.rowCount===t.rowCount&&i.colCount===t.colCount:!1},n}();t.Range=k,function(n){n[n.up=1]="up";n[n.down=2]="down";n[n.left=3]="left";n[n.right=4]="right"}(t.Direction||(t.Direction={}));yt=t.Direction,function(n){n[n.left=0]="left";n[n.center=1]="center";n[n.right=2]="right";n[n.general=3]="general"}(t.HorizontalAlign||(t.HorizontalAlign={}));pt=t.HorizontalAlign,function(n){n[n.top=0]="top";n[n.center=1]="center";n[n.bottom=2]="bottom"}(t.VerticalAlign||(t.VerticalAlign={}));wt=t.VerticalAlign,function(n){n[n.left=0]="left";n[n.center=1]="center";n[n.right=2]="right";n[n.nearest=3]="nearest"}(t.HorizontalPosition||(t.HorizontalPosition={}));bt=t.HorizontalPosition,function(n){n[n.top=0]="top";n[n.center=1]="center";n[n.bottom=2]="bottom";n[n.nearest=3]="nearest"}(t.VerticalPosition||(t.VerticalPosition={}));kt=t.VerticalPosition,function(n){n[n.blank=0]="blank";n[n.numbers=1]="numbers";n[n.letters=2]="letters"}(t.HeaderAutoText||(t.HeaderAutoText={}));dt=t.HeaderAutoText,function(n){n[n.All=0]="All";n[n.Values=1]="Values";n[n.Formatting=2]="Formatting";n[n.Formulas=3]="Formulas"}(t.ClipboardPasteOptions||(t.ClipboardPasteOptions={}));gt=t.ClipboardPasteOptions,function(n){n[n.None=0]="None";n[n.IncludeRowHeader=1]="IncludeRowHeader";n[n.IncludeColumnHeader=2]="IncludeColumnHeader";n[n.UnFormatted=8]="UnFormatted";n[n.ImportFormula=16]="ImportFormula"}(t.TextFileOpenFlags||(t.TextFileOpenFlags={}));ni=t.TextFileOpenFlags,function(n){n[n.Normal=0]="Normal";n[n.Highlight=1]="Highlight";n[n.Selected=2]="Selected";n[n.Active=3]="Active";n[n.Hover=4]="Hover"}(t.VisualState||(t.VisualState={}));ti=t.VisualState,function(n){n[n.A1=0]="A1";n[n.R1C1=1]="R1C1"}(t.ReferenceStyle||(t.ReferenceStyle={}));ii=t.ReferenceStyle,function(n){n[n.empty=0]="empty";n[n.thin=1]="thin";n[n.medium=2]="medium";n[n.dashed=3]="dashed";n[n.dotted=4]="dotted";n[n.thick=5]="thick";n[n.double=6]="double";n[n.hair=7]="hair";n[n.mediumDashed=8]="mediumDashed";n[n.dashDot=9]="dashDot";n[n.mediumDashDot=10]="mediumDashDot";n[n.dashDotDot=11]="dashDotDot";n[n.mediumDashDotDot=12]="mediumDashDotDot";n[n.slantedDashDot=13]="slantedDashDot"}(t.LineStyle||(t.LineStyle={}));v=t.LineStyle,function(n){n[n.corner=0]="corner";n[n.colHeader=1]="colHeader";n[n.rowHeader=2]="rowHeader";n[n.viewport=3]="viewport"}(t.SheetArea||(t.SheetArea={}));ri=t.SheetArea,function(n){n[n.Value=1]="Value";n[n.Formula=2]="Formula";n[n.Comment=4]="Comment";n[n.RangeGroup=8]="RangeGroup";n[n.Sparkline=16]="Sparkline";n[n.Span=32]="Span";n[n.Style=64]="Style";n[n.Tag=128]="Tag";n[n.BindingPath=256]="BindingPath";n[n.ConditionalFormat=512]="ConditionalFormat";n[n.All=1023]="All"}(t.CopyToOption||(t.CopyToOption={}));ui=t.CopyToOption,function(n){n[n.Single=0]="Single";n[n.Range=1]="Range";n[n.MultiRange=2]="MultiRange"}(t.SelectionPolicy||(t.SelectionPolicy={}));fi=t.SelectionPolicy,function(n){n[n.Cell=0]="Cell";n[n.Row=1]="Row";n[n.Column=2]="Column"}(t.SelectionUnit||(t.SelectionUnit={}));ei=t.SelectionUnit,function(n){n[n.CopyCells=0]="CopyCells";n[n.FillSeries=1]="FillSeries";n[n.FillFormattingOnly=2]="FillFormattingOnly";n[n.FillWithoutFormatting=3]="FillWithoutFormatting";n[n.ClearValues=4]="ClearValues"}(t.AutoFillType||(t.AutoFillType={}));oi=t.AutoFillType,function(n){n[n.Left=0]="Left";n[n.Right=1]="Right";n[n.Up=2]="Up";n[n.Down=3]="Down"}(t.FillDirection||(t.FillDirection={}));si=t.FillDirection,function(n){n[n.Column=0]="Column";n[n.Row=1]="Row"}(t.FillSeries||(t.FillSeries={}));hi=t.FillSeries,function(n){n[n.Data=1]="Data";n[n.Style=2]="Style";n[n.Comment=4]="Comment";n[n.Sparkline=16]="Sparkline";n[n.Axis=32]="Axis";n[n.BindingPath=64]="BindingPath"}(t.StorageType||(t.StorageType={}));ci=t.StorageType,function(n){n[n.Left=0]="Left";n[n.Right=1]="Right";n[n.Up=2]="Up";n[n.Down=3]="Down";n[n.LeftClear=4]="LeftClear";n[n.UpClear=5]="UpClear"}(t.DragFillDirection||(t.DragFillDirection={}));li=t.DragFillDirection,function(n){n[n.Ready=0]="Ready";n[n.Enter=1]="Enter";n[n.Edit=2]="Edit"}(t.EditorStatus||(t.EditorStatus={}));ai=t.EditorStatus,function(n){n[n.AnyValue=0]="AnyValue";n[n.WholeNumber=1]="WholeNumber";n[n.DecimalValues=2]="DecimalValues";n[n.List=3]="List";n[n.Date=4]="Date";n[n.Time=5]="Time";n[n.TextLength=6]="TextLength";n[n.Custom=7]="Custom"}(t.CriteriaType||(t.CriteriaType={}));vi=t.CriteriaType,function(n){n[n.ForceApply=0]="ForceApply";n[n.Discard=1]="Discard";n[n.Retry=2]="Retry"}(t.DataValidationResult||(t.DataValidationResult={}));yi=t.DataValidationResult,function(n){n[n.Stop=0]="Stop";n[n.Warning=1]="Warning";n[n.Information=2]="Information"}(t.ErrorStyle||(t.ErrorStyle={}));pi=t.ErrorStyle,function(n){n[n.EqualsTo=0]="EqualsTo";n[n.NotEqualsTo=1]="NotEqualsTo";n[n.GreaterThan=2]="GreaterThan";n[n.GreaterThanOrEqualsTo=3]="GreaterThanOrEqualsTo";n[n.LessThan=4]="LessThan";n[n.LessThanOrEqualsTo=5]="LessThanOrEqualsTo"}(t.GeneralCompareType||(t.GeneralCompareType={}));wi=t.GeneralCompareType,function(n){n[n.Or=0]="Or";n[n.And=1]="And"}(t.RelationCompareType||(t.RelationCompareType={}));bi=t.RelationCompareType,function(n){n[n.EqualsTo=0]="EqualsTo";n[n.NotEqualsTo=1]="NotEqualsTo";n[n.GreaterThan=2]="GreaterThan";n[n.GreaterThanOrEqualsTo=3]="GreaterThanOrEqualsTo";n[n.LessThan=4]="LessThan";n[n.LessThanOrEqualsTo=5]="LessThanOrEqualsTo";n[n.Between=6]="Between";n[n.NotBetween=7]="NotBetween"}(t.ComparisonOperator||(t.ComparisonOperator={}));ki=t.ComparisonOperator,function(n){n[n.Contains=0]="Contains";n[n.DoesNotContain=1]="DoesNotContain";n[n.BeginsWith=2]="BeginsWith";n[n.EndsWith=3]="EndsWith"}(t.TextComparisonOperator||(t.TextComparisonOperator={}));di=t.TextComparisonOperator,function(n){n[n.EqualsTo=0]="EqualsTo";n[n.NotEqualsTo=1]="NotEqualsTo";n[n.BeginsWith=2]="BeginsWith";n[n.DoesNotBeginWith=3]="DoesNotBeginWith";n[n.EndsWith=4]="EndsWith";n[n.DoesNotEndWith=5]="DoesNotEndWith";n[n.Contains=6]="Contains";n[n.DoesNotContain=7]="DoesNotContain"}(t.TextCompareType||(t.TextCompareType={}));gi=t.TextCompareType,function(n){n[n.BackgroundColor=0]="BackgroundColor";n[n.ForegroundColor=1]="ForegroundColor"}(t.ColorCompareType||(t.ColorCompareType={}));nr=t.ColorCompareType,function(n){n[n.Empty=0]="Empty";n[n.NonEmpty=1]="NonEmpty";n[n.Error=2]="Error";n[n.NonError=3]="NonError";n[n.Formula=4]="Formula"}(t.CustomValueType||(t.CustomValueType={}));tr=t.CustomValueType,function(n){n[n.EqualsTo=0]="EqualsTo";n[n.NotEqualsTo=1]="NotEqualsTo";n[n.Before=2]="Before";n[n.BeforeEqualsTo=3]="BeforeEqualsTo";n[n.After=4]="After";n[n.AfterEqualsTo=5]="AfterEqualsTo"}(t.DateCompareType||(t.DateCompareType={}));ir=t.DateCompareType,function(n){n[n.Top=0]="Top";n[n.Bottom=1]="Bottom"}(t.Top10ConditionType||(t.Top10ConditionType={}));rr=t.Top10ConditionType,function(n){n[n.Today=0]="Today";n[n.Yesterday=1]="Yesterday";n[n.Tomorrow=2]="Tomorrow";n[n.Last7Days=3]="Last7Days";n[n.ThisMonth=4]="ThisMonth";n[n.LastMonth=5]="LastMonth";n[n.NextMonth=6]="NextMonth";n[n.ThisWeek=7]="ThisWeek";n[n.LastWeek=8]="LastWeek";n[n.NextWeek=9]="NextWeek"}(t.DateOccurringType||(t.DateOccurringType={}));ur=t.DateOccurringType,function(n){n[n.Quarter1=0]="Quarter1";n[n.Quarter2=1]="Quarter2";n[n.Quarter3=2]="Quarter3";n[n.Quarter4=3]="Quarter4"}(t.QuarterType||(t.QuarterType={}));fr=t.QuarterType,function(n){n[n.None=0]="None";n[n.Ascending=1]="Ascending";n[n.Descending=2]="Descending"}(t.SortState||(t.SortState={}));er=t.SortState,function(n){n[n.Above=0]="Above";n[n.Below=1]="Below";n[n.EqualOrAbove=2]="EqualOrAbove";n[n.EqualOrBelow=3]="EqualOrBelow";n[n.Above1StdDev=4]="Above1StdDev";n[n.Below1StdDev=5]="Below1StdDev";n[n.Above2StdDev=6]="Above2StdDev";n[n.Below2StdDev=7]="Below2StdDev";n[n.Above3StdDev=8]="Above3StdDev";n[n.Below3StdDev=9]="Below3StdDev"}(t.AverageConditionType||(t.AverageConditionType={}));or=t.AverageConditionType,function(n){n[n.Number=0]="Number";n[n.LowestValue=1]="LowestValue";n[n.HighestValue=2]="HighestValue";n[n.Percent=3]="Percent";n[n.Percentile=4]="Percentile";n[n.Automin=5]="Automin";n[n.Formula=6]="Formula";n[n.Automax=7]="Automax"}(t.ScaleValueType||(t.ScaleValueType={}));sr=t.ScaleValueType,function(n){n[n.LeftToRight=0]="LeftToRight";n[n.RightToLeft=1]="RightToLeft"}(t.BarDirection||(t.BarDirection={}));hr=t.BarDirection,function(n){n[n.Automatic=0]="Automatic";n[n.CellMidPoint=1]="CellMidPoint";n[n.None=2]="None"}(t.DataBarAxisPosition||(t.DataBarAxisPosition={}));cr=t.DataBarAxisPosition,function(n){n[n.ThreeArrowsColored=0]="ThreeArrowsColored";n[n.ThreeArrowsGray=1]="ThreeArrowsGray";n[n.ThreeTriangles=2]="ThreeTriangles";n[n.ThreeStars=3]="ThreeStars";n[n.ThreeFlags=4]="ThreeFlags";n[n.ThreeTrafficLightsUnrimmed=5]="ThreeTrafficLightsUnrimmed";n[n.ThreeTrafficLightsRimmed=6]="ThreeTrafficLightsRimmed";n[n.ThreeSigns=7]="ThreeSigns";n[n.ThreeSymbolsCircled=8]="ThreeSymbolsCircled";n[n.ThreeSymbolsUncircled=9]="ThreeSymbolsUncircled";n[n.FourArrowsColored=10]="FourArrowsColored";n[n.FourArrowsGray=11]="FourArrowsGray";n[n.FourRedToBlack=12]="FourRedToBlack";n[n.FourRatings=13]="FourRatings";n[n.FourTrafficLights=14]="FourTrafficLights";n[n.FiveArrowsColored=15]="FiveArrowsColored";n[n.FiveArrowsGray=16]="FiveArrowsGray";n[n.FiveRatings=17]="FiveRatings";n[n.FiveQuarters=18]="FiveQuarters";n[n.FiveBoxes=19]="FiveBoxes"}(t.IconSetType||(t.IconSetType={}));lr=t.IconSetType,function(n){n[n.Number=1]="Number";n[n.Percent=4]="Percent";n[n.Formula=7]="Formula";n[n.Percentile=5]="Percentile"}(t.IconValueType||(t.IconValueType={}));ar=t.IconValueType,function(n){n[n.Backward=0]="Backward";n[n.Forward=1]="Forward"}(t.RangeGroupDirection||(t.RangeGroupDirection={}));vr=t.RangeGroupDirection,function(n){n[n.None=0]="None";n[n.Column=1]="Column";n[n.Row=2]="Row";n[n.Both=3]="Both"}(t.ShowResizeTip||(t.ShowResizeTip={}));yr=t.ShowResizeTip,function(n){n[n.None=0]="None";n[n.Horizontal=1]="Horizontal";n[n.Vertical=2]="Vertical";n[n.Both=3]="Both"}(t.ShowScrollTip||(t.ShowScrollTip={}));pr=t.ShowScrollTip,function(n){n[n.Cell=0]="Cell";n[n.CellWithHeader=1]="CellWithHeader"}(t.AutoFitType||(t.AutoFitType={}));wr=t.AutoFitType,function(n){n[n.Stretch=0]="Stretch";n[n.Center=1]="Center";n[n.Zoom=2]="Zoom";n[n.None=3]="None"}(t.ImageLayout||(t.ImageLayout={}));br=t.ImageLayout,function(n){n[n.SetFormula=0]="SetFormula";n[n.CopyPaste=1]="CopyPaste";n[n.DragFill=2]="DragFill";n[n.DragDrop=3]="DragDrop";n[n.ChangePartOfArrayFormula=4]="ChangePartOfArrayFormula"}(t.InvalidOperationType||(t.InvalidOperationType={}));kr=t.InvalidOperationType,function(n){n[n.CurrentCulture=0]="CurrentCulture";n[n.CurrentCultureIgnoreCase=1]="CurrentCultureIgnoreCase";n[n.InvariantCulture=2]="InvariantCulture";n[n.InvariantCultureIgnoreCase=3]="InvariantCultureIgnoreCase";n[n.Ordinal=4]="Ordinal";n[n.OrdinalIgnoreCase=5]="OrdinalIgnoreCase"}(t.StringComparison||(t.StringComparison={}));dr=t.StringComparison,function(n){n[n.Underline=1]="Underline";n[n.LineThrough=2]="LineThrough";n[n.Overline=4]="Overline";n[n.None=0]="None"}(t.TextDecorationType||(t.TextDecorationType={}));gr=t.TextDecorationType,function(n){n[n.Auto=1]="Auto";n[n.Active=2]="Active";n[n.Inactive=4]="Inactive";n[n.Disabled=0]="Disabled"}(t.ImeMode||(t.ImeMode={}));nu=t.ImeMode,function(n){n[n.Active=1]="Active";n[n.Edit=2]="Edit";n[n.Normal=3]="Normal"}(t.CommentState||(t.CommentState={}));tu=t.CommentState;o=function(){function n(n,t){this.color=n||"black";this.style=t||0}return n.prototype.width=function(n){var t=v;if(n&&n.style)switch(n.style){case 9:case 1:case 3:case 4:case 7:case 11:return 1;case 2:case 10:case 12:case 8:case 13:return 2;case 5:case 6:return 3}return 0},n.prototype._weight=function(n){var t=v;if(n&&n.style)switch(n.style){case 9:case 3:case 4:case 11:case 7:return 100;case 1:return 101;case 13:case 8:case 10:case 12:return 198;case 2:return 199;case 5:return 300;case 6:return 90;case 0:return 0}return-2},n.prototype.toJSON=function(){var n={};return(this.color!=="black"&&(n.color=this.color),this.style!==0&&(n.style=this.style),u.isEmptyObject(n))?i:n},n.prototype.fromJSON=function(n){n&&(n.color!==i&&(this.color=n.color),n.style!==i&&(this.style=n.style))},n}();t.LineBorder=o;d=function(){var n={};return n["font-style"]=function(n,t){n&&u(t).css("fontStyle",n)},n["font-variant"]=function(n,t){n&&u(t).css("fontVariant",n)},n["font-weight"]=function(n,t){n&&u(t).css("fontWeight",n)},n["font-size"]=function(n,t){n&&u(t).css("fontSize",n)},n["line-height"]=function(n,t){n&&u(t).css("lineHeight",n)},n["font-family"]=function(n,t){n&&u(t).css("fontFamily",n)},n}();nt=function(){function n(n){this._sheet=n}return n.prototype.buildFont=function(n,t){var e="",i,f;if(n){i=iu(this._sheet);try{t&&u(i.span).css("font",t);u.each(d,function(t,u){u(n.hasOwnProperty(t)?n[t]:r,i.span)})}finally{f=i.span.currentStyle;document.defaultView&&document.defaultView.getComputedStyle&&(f=document.defaultView.getComputedStyle(i.span,""));e=g(f);i.dispose()}}return e},n}();t.FontFactory=nt;tt=function(){function n(n,t,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt){if(arguments.length!==0){var tt=this;tt.backgroundImage=w;tt.backgroundImageLayout=k;tt.backColor=n;tt.foreColor=t;tt.hAlign=r;tt.vAlign=u;tt.font=f;tt.themeFont=e;tt.formatter=o;tt.borderLeft=s;tt.borderTop=h;tt.borderRight=c;tt.borderBottom=l;tt.locked=a;tt.textIndent=v;tt.wordWrap=y;tt.shrinkToFit=p;tt.validator=i;tt.cellType=b;tt.tabStop=d;tt.textDecoration=g;tt.imeMode=nt}}return n.prototype._initDefault=function(){var n=this;n.backgroundImage=i;n.backgroundImageLayout=i;n.backColor=i;n.foreColor=i;n.hAlign=i;n.vAlign=i;n.font=i;n.themeFont=i;n.formatter=i;n.validator=i;n.borderLeft=i;n.borderTop=i;n.borderRight=i;n.borderBottom=i;n.locked=i;n.textIndent=i;n.wordWrap=i;n.shrinkToFit=i;n.cellType=i;n.name=i;n.parentName=i;n.tabStop=i;n.textDecoration=i;n.imeMode=i},n.prototype.copyFrom=function(n){var t=this,i,r,u,f;t.backgroundImage=n.backgroundImage;t.backgroundImageLayout=n.backgroundImageLayout;t.backColor=n.backColor;t.foreColor=n.foreColor;t.hAlign=n.hAlign;t.vAlign=n.vAlign;t.font=n.font;t.themeFont=n.themeFont;t.formatter=n.formatter;t._autoFormatter=n._autoFormatter;t.validator=n.validator;t.locked=n.locked;t.textIndent=n.textIndent;t.wordWrap=n.wordWrap;t.shrinkToFit=n.shrinkToFit;t.cellType=n.cellType;t.name=n.name;t.parentName=n.parentName;t.tabStop=n.tabStop;t.textDecoration=n.textDecoration;t.imeMode=n.imeMode;n.borderLeft!==undefined&&(i=new o,i.fromJSON(n.borderLeft),t.borderLeft=i);n.borderRight!==undefined&&(r=new o,r.fromJSON(n.borderRight),t.borderRight=r);n.borderTop!==undefined&&(u=new o,u.fromJSON(n.borderTop),t.borderTop=u);n.borderBottom!==undefined&&(f=new o,f.fromJSON(n.borderBottom),t.borderBottom=f)},n.prototype._cloneLineBorder=function(n){return n&&n instanceof o?new o(n.color,n.style):n},n.prototype.compose=function(n,t){var r=this,u=r._cloneLineBorder,f,e,o,s;t?(r._autoFormatter=n._autoFormatter,r.backgroundImage=n.backgroundImage,r.backgroundImageLayout=n.backgroundImageLayout,r.backColor=n.backColor,r.foreColor=n.foreColor,r.hAlign=n.hAlign,r.vAlign=n.vAlign,r.font=n.font,r.themeFont=n.themeFont,r.formatter=n.formatter,f=n.borderLeft,r.borderLeft=f&&u(f)||f,e=n.borderTop,r.borderTop=e&&u(e)||e,o=n.borderRight,r.borderRight=o&&u(o)||o,s=n.borderBottom,r.borderBottom=s&&u(s)||s,r.locked=n.locked,r.textIndent=n.textIndent,r.wordWrap=n.wordWrap,r.shrinkToFit=n.shrinkToFit,r.validator=n.validator,r.cellType=n.cellType,r.name=n.name,r.parentName=n.parentName,r.tabStop=n.tabStop,r.textDecoration=n.textDecoration,r.imeMode=n.imeMode):(r.backgroundImage===i&&(r.backgroundImage=n.backgroundImage),r.backgroundImageLayout===i&&(r.backgroundImageLayout=n.backgroundImageLayout),r.backColor===i&&(r.backColor=n.backColor),r.foreColor===i&&(r.foreColor=n.foreColor),r.hAlign===i&&(r.hAlign=n.hAlign),r.vAlign===i&&(r.vAlign=n.vAlign),r.font===i&&(r.font=n.font),r.themeFont===i&&(r.themeFont=n.themeFont),r.formatter===i&&(r.formatter=n.formatter),r.validator===i&&(r.validator=n.validator),r._autoFormatter===i&&(r._autoFormatter=n._autoFormatter),r.borderLeft===i&&(f=n.borderLeft,r.borderLeft=f&&u(f)||f),r.borderTop===i&&(e=n.borderTop,r.borderTop=e&&u(e)||e),r.borderRight===i&&(o=n.borderRight,r.borderRight=o&&u(o)||o),r.borderBottom===i&&(s=n.borderBottom,r.borderBottom=s&&u(s)||s),r.locked===i&&(r.locked=n.locked),r.textIndent===i&&(r.textIndent=n.textIndent),r.wordWrap===i&&(r.wordWrap=n.wordWrap),r.shrinkToFit===i&&(r.shrinkToFit=n.shrinkToFit),r.cellType===i&&(r.cellType=n.cellType),r.tabStop===i&&(r.tabStop=n.tabStop),r.textDecoration===i&&(r.textDecoration=n.textDecoration),r.imeMode===i&&(r.imeMode=n.imeMode),r.name===i&&(r.name=n.name),r.parentName===i&&(r.parentName=n.parentName))},n.prototype.clear=function(n){if(arguments.length===0){this._initDefault();return}n==="dataValidator"&&(n="validator");this[n]=i},n.prototype.clone=function(){var t=this,r=t._cloneLineBorder,i=new n(t.backColor,t.foreColor,t.hAlign,t.vAlign,t.font,t.themeFont,t.formatter,t.borderLeft&&r(t.borderLeft)||t.borderLeft,t.borderTop&&r(t.borderTop)||t.borderTop,t.borderRight&&r(t.borderRight)||t.borderRight,t.borderBottom&&r(t.borderBottom)||t.borderBottom,t.locked,t.textIndent,t.wordWrap,t.shrinkToFit,t.backgroundImage,t.cellType,t.backgroundImageLayout,t.tabStop,t.textDecoration,t.imeMode);return i.name=t.name,i.parentName=t.parentName,i._autoFormatter=t._autoFormatter,i.validator=t.validator,i},n.prototype._normalize=function(n){var i=this,t,f,u,e,r;if(n&&n.getColor)for(t=i.foreColor,t&&(t=n.getColor(t),t&&(i.foreColor=t)),t=i.backColor,t&&(t=n.getColor(t),t&&(i.backColor=t)),f=[i.borderLeft,i.borderTop,i.borderRight,i.borderBottom],u=0,e=f.length;u<e;u++)r=f[u],r&&r.color&&(t=n.getColor(r.color),t&&(r.color=t));return i.themeFont&&n&&n.getFont&&(i.font=y.composeFont(i.font,n.getFont(i.themeFont))),i},n.prototype._setActualAutoFormatter=function(n){var t=this;if(t&&t._autoFormatter&&t._autoFormatter._innerFormatter&&n!==r){var i=t._autoFormatter._innerFormatter,f=i.formatCached,u=i.GetPreferredEditingFormatter(n);f!==u.formatCached&&(t._autoFormatter._innerFormatter=u)}},n}();t.Style=tt;y=function(){function n(){}return n.composeFont=function(t,i){return i?n.normalizeFont(t,i):t},n.normalizeFont=function(t,i){var f,e,o,r,s;if(!t&&!i)return t;if(f=n,this.measureSpan||f._createMeasureSpan(),e=f.measureSpan,t){if(o=i?t+"+"+i:t,r=f._fontStringCatch[o],r)return r;u(e).css("font",t)}else{if(o=i,r=f._fontStringCatch[o],r)return r;u(e).css("fontSize","10pt")}return i&&u(e).css("fontFamily",i),s=e.currentStyle,document.defaultView&&document.defaultView.getComputedStyle&&(s=document.defaultView.getComputedStyle(e,"")),r=g(s),f._fontStringCatch[o]=r,f._fontStringCatch[r]=r,r},n._scaleFont=function(t,i,r,u){var s=n,l=s.scaleFontInfoCache,o,f,y,a,h,v,c;if(!u)if(l){if(o=l[t],o)return o}else l=s.scaleFontInfoCache={};return f=s.measureSpan,f||(s._createMeasureSpan(),f=s.measureSpan),f.style.font=t,y=f.currentStyle,a=document.defaultView,a&&a.getComputedStyle&&(y=a.getComputedStyle(f,"")),h=y.fontSize,v="px",h.indexOf(v)!==-1&&(c=e(1,at(parseFloat(h.replace(v,""))*i)),r&&c===1&&(r.value=!0),h=c+v),i===1?o={font:t,fontSize:c}:(f.style.fontSize=h,o={font:f.style.font,fontSize:c}),u||(l[t]=o),o},n._createMeasureSpan=function(){var n=document.createElement("span"),t=n.style;t.visibility="hidden";t.top="-10000px";t.left="-10000px";document.body.insertBefore(n,r);this.measureSpan=n},n._disposeMeasureSpan=function(){var n=this.measureSpan;n&&(u(n).remove(),this.measureSpan=i)},n._fontStringCatch={},n.scaleFontInfoCache=r,n}();t.StyleHelper=y;it=function(){function n(n,t,i,r){var u=this;u._name=n;u._baseRow=i;u._baseColumn=r;u._expr=t}return n.prototype.getName=function(){return this._name},n.prototype.getRow=function(){return this._baseRow},n.prototype.getColumn=function(){return this._baseColumn},n.prototype.getExpression=function(){return this._expr},n.prototype.setExpression=function(n){this._expr=n},n}();t.NameInfo=it;rt=function(){function n(n,t,i,r,u){this._init(n,t,i,r,u)}return n.prototype._init=function(n,t,i,r,u){this._bounds=new a(n,t,i,r);this._name=u},n.prototype.getBounds=function(){return this._bounds},n.prototype.setBounds=function(n){var t=this._bounds;t.x=n.x;t.y=n.y;t.width=n.width;t.height=n.height},n.prototype._draw=function(n){var u,t,i,r;n&&(u=this,t=u._bounds,n.save(),i=n.createLinearGradient(t.x,t.y,t.x,t.y+40),i.addColorStop(0,"#00ABEB"),i.addColorStop(1,"#fff"),n.fillStyle=i,n.fillRect(t.x,t.y,t.width,t.height),r=u._name,r&&r.length>0&&(n.fillStyle="darkblue",n.font="20pt Arial",n.fillText(r,t.x+36,t.y+28)),n.strokeStyle="black",n.strokeRect(t.x,t.y,t.width,t.height),n.restore())},n.prototype.size=function(n,t){var i=this._bounds;i.width=n;i.height=t},n.prototype.move=function(n,t){var i=this._bounds;i.x=n;i.y=t},n}();t.GcUIElement=rt;ut=function(){function n(){}return n.getColor=function(n,t){if(n&&t){var i=n._currentTheme;if(i)return i.getColor(t)}return t},n.getFont=function(n,t){if(n&&t){var i=n._currentTheme;return i?i.getFont(t):t}return r},n}();t._ThemeContext=ut;ft=function(){function n(n){var t=this;t.host=n;t.interval=r;t.action=r;t.intervalId=r;t.result=r;t.working=!1;t._needIncrease=!1}return n.prototype.setAction=function(n){typeof n=="function"&&(this.action=n)},n.prototype.setInterval=function(n){var t=this,i;isNaN(n)||n===0?t.stop():(t._needIncrease=n>0?!0:!1,n=lt(n),i=t.interval,t.interval=n,i!==n&&t.start())},n.prototype.start=function(){var n=this;n.clear();isNaN(n.interval)||(n.intervalId=setInterval(function(){n.run()},n.interval))},n.prototype.run=function(){var n=this;n.working=!0;typeof n.action=="function"&&(n.result=n.action.call(n.host,n._needIncrease))},n.prototype.stop=function(){var n=this;n.clear();n.interval=r;n.intervalId=r;n.result=r;n.working=!1},n.prototype.clear=function(){this.intervalId&&clearInterval(this.intervalId)},n.prototype._dispose=function(){this.stop()},n}();t.Timer=ft;et=function(){function n(){}return n.ValidationError="ValidationError",n.CellClick="CellClick",n.CellDoubleClick="CellDoubleClick",n.EnterCell="EnterCell",n.LeaveCell="LeaveCell",n.ValueChanged="ValueChanged",n.TopRowChanged="TopRowChanged",n.LeftColumnChanged="LeftColumnChanged",n.InvalidOperation="InvalidOperation",n.RangeFiltering="RangeFiltering",n.RangeFiltered="RangeFiltered",n.RangeSorting="RangeSorting",n.RangeSorted="RangeSorted",n.ClipboardChanging="ClipboardChanging",n.ClipboardChanged="ClipboardChanged",n.ClipboardPasting="ClipboardPasting",n.ClipboardPasted="ClipboardPasted",n.ColumnWidthChanging="ColumnWidthChanging",n.ColumnWidthChanged="ColumnWidthChanged",n.RowHeightChanging="RowHeightChanging",n.RowHeightChanged="RowHeightChanged",n.DragDropBlock="DragDropBlock",n.DragDropBlockCompleted="DragDropBlockCompleted",n.DragFillBlock="DragFillBlock",n.DragFillBlockCompleted="DragFillBlockCompleted",n.EditStarting="EditStarting",n.EditStarted="EditStarted",n.EditChange="EditChange",n.EditEnding="EditEnding",n.EditEnd="EditEnd",n.EditEnded="EditEnded",n.RangeGroupStateChanging="RangeGroupStateChanging",n.RangeGroupStateChanged="RangeGroupStateChanged",n.SelectionChanging="SelectionChanging",n.SelectionChanged="SelectionChanged",n.SheetTabClick="SheetTabClick",n.SheetTabDoubleClick="SheetTabDoubleClick",n.SheetNameChanging="SheetNameChanging",n.SheetNameChanged="SheetNameChanged",n.UserZooming="UserZooming",n.UserFormulaEntered="UserFormulaEntered",n.CellChanged="CellChanged",n.ColumnChanged="ColumnChanged",n.RowChanged="RowChanged",n.ActiveSheetChanging="ActiveSheetChanging",n.ActiveSheetChanged="ActiveSheetChanged",n.SparklineChanged="SparklineChanged",n.RangeChanged="RangeChanged",n.ButtonClicked="ButtonClicked",n.EditorStatusChanged="EditorStatusChanged",n.CultureChanged="SpreadJSCultureChanged",n.FloatingObjectChanged="FloatingObjectChanged",n.FloatingObjectSelectionChanged="FloatingObjectSelectionChanged",n.PictureChanged="PictureChanged",n.PictureSelectionChanged="PictureSelectionChanged",n.CustomFloatingObjectLoaded="CustomFloatingObjectLoaded",n.TouchToolStripOpening="TouchToolStripOpening",n.CommentChanged="CommentChanged",n}();t.Events=et;p=function(){function n(){return Array.apply(this,arguments),[]}return n.prototype.pop=function(){return r},n.prototype.push=function(n){return 0},n.prototype.splice=function(n,t){for(var u=[],i=0;i<arguments.length-2;i++)u[i]=arguments[i+2];return r},n}();t._XArray=p;p.prototype=[];ot=function(){function n(n){this._cachedCells={};this._cachedColumns={};this._cachedRows={};this._sheet=n}return n.prototype.addCell=function(n,t,i){var u=this._cachedCells,r=u[n];r||(r=u[n]={});r[t]=i},n.prototype.getCachedCell=function(n,t){var u=this._cachedCells,r=u[n],i;return r||(r=u[n]={}),i=r[t],i||(i={data:this._sheet.getValue(n,t)},r[t]=i),i},n.prototype.addRow=function(n,t){this._cachedRows[n]=t},n.prototype.getCachedRow=function(n){var i=this._cachedRows,t=i[n];return t||(t={height:this._sheet._getZoomRowHeight(n)},i[n]=t),t},n.prototype.addColumn=function(n,t){this._cachedColumns[n]=t},n.prototype.getCachedColumn=function(n){var i=this._cachedColumns,t=i[n];return t||(t={width:this._sheet._getZoomColumnWidth(n)},i[n]=t),t},n.prototype.clearAll=function(){var n=this;n._cachedCells={};n._cachedColumns={};n._cachedRows={}},n}();t._CachePool=ot,function(n){n[n.normal=0]="normal";n[n.arrayFormula=1]="arrayFormula";n[n.sharedFormula=2]="sharedFormula"}(t.EndEditType||(t.EndEditType={}));ru=t.EndEditType;st=function(){function n(){}return n}();t.FormulaInformation=st})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(n){n.feature("core.imageLoader",["core.common"]);var t=function(){function n(n){this._imageCount=0;this._loadedCount=0;this.onLoadedComplete=n}return n.prototype.addImage=function(n){var t=this,u=t._imgs,i,r;u||(u=t._imgs={});i=u[n];i||(i={},r=$("<img/>"),r.bind("load",function(){t.imageLoaded(n)}),r.bind("error",function(){t.imageLoaded(n)}),r.bind("abort",function(){t.imageLoaded(n)}),t._imageCount++,i.state=!1,i.img=r,u[n]=i,r[0].src=n)},n.prototype.getImage=function(n){return this._imgs[n].img[0]},n.prototype.getState=function(n){var t=this._imgs,i=t&&t[n];return i?i.state:!1},n.prototype.imageLoaded=function(n){var t=this;t._loadedCount++;t._imgs[n].state=!0;t._loadedCount>=t._imageCount&&t.onLoadedComplete&&t.onLoadedComplete()},n}();n._GcImageLoader=t})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(t){function p(n){return n.split("\u00a0").join(" ").toUpperCase()}function l(n){for(var i=[],t=0,r=n.length;t<r;t++)i[t]=p(n[t]);return i}function nt(n,t,i){var u=p(n),r=new c(t).indexOf(u);return r===-1&&(r=new c(i).indexOf(u)),r}function ct(i){if(arguments.length===0)return t._currentCulture;if(i){var r=i.toLowerCase();if(t._currentCulture!==r){switch(r){case"ja-jp":n.spread.SR=n.spread._JPStringResource;f.currentCulture("ja-jp");break;case"en-us":default:n.spread.SR=n.spread._ENStringResource;f.currentCulture("en-us");break}t._currentCulture=i;lt(i)}}}function lt(n){$("div[gcUIElement='gcSpread']").trigger(t.Events.CultureChanged,[{CultureInfo:n}])}var o,g,v,b,y,k,f,a,d,w,rt,ut;t.feature("core.globalize",["core.stringResource","core.migrate"]);var i=null,r=undefined,ft=Math.max,et=Math.min,ot=Math.ceil,s=Math.floor,u=Math.abs,e=Math.pow,st=Math.round,h="undefined",c=function(){function n(n){this._array=n}return n.__insert=function(n,t,i){n.splice(t,0,i)},n.__add=function(n,t){n[n.length]=t},n.__indexOf=function(n,t,i){var u,r;if(typeof t===h)return-1;if(u=n.length,u!==0)for(i=+i,isNaN(i)?i=0:(isFinite(i)&&(i=i-i%1),i<0&&(i=ft(0,u+i))),r=i;r<u;r++)if(typeof n[r]!==h&&n[r]===t)return r;return-1},n.prototype.add=function(t){n.__add(this._array,t)},n.prototype.insert=function(t,i){n.__insert(this._array,t,i)},n.prototype.indexOf=function(t,i){return n.__indexOf(this._array,t,i)},n.prototype.array=function(n){return arguments.length===0?this._array:(this._array=n,this._array)},n}();t._ArrayHelper=c;o=function(){function n(n){this._value={};this._len=0;this._init(n)}return n.prototype._init=function(n){this._parts=typeof n!==h&&n!==i&&n!==""?[n.toString()]:[];this._value={};this._len=0},n.prototype._insert=function(n){this._parts.splice(0,0,n)},n.prototype.insert=function(n,t){var u=this,f,e,o;if((t===r||t===i)&&(t=0),t===0){u._insert(n);return}if(f=u.toString(),t>=f.length){u.append(n);return}e=f.substring(0,t);o=f.substr(t);u._init(e+n+o)},n.prototype.append=function(n){this._parts[this._parts.length]=n},n.prototype.appendLine=function(n){this._parts[this._parts.length]=typeof n===h||n===i||n===""?"\r\n":n+"\r\n"},n.prototype.clear=function(){this._init()},n.prototype.isEmpty=function(){return this._parts.length===0?!0:this.toString()===""},n.prototype.toString=function(n){var u=this,t,f,r;if(n=n||"",t=u._parts,u._len!==t.length&&(u._value={},u._len=t.length),f=u._value,typeof f[n]===h){if(n!=="")for(r=0;r<t.length;)typeof t[r]===h||t[r]===""||t[r]===i?t.splice(r,1):r++;f[n]=u._parts.join(n)}return f[n]},n}();t._StringBuilder=o;g=function(){function n(n){this.strValue="";n&&(this.strValue=n)}return n.prototype.Append=function(n){n&&(this.strValue+=n.toString())},n.prototype.toString=function(){return this.strValue.toString()},n.prototype.Length=function(){return this.strValue.length},n.prototype.ToString=function(n,t){var i=this.toString();return arguments.length===0?i:i.substr(n,t)},n.prototype.Remove=function(n,t){var i=this.toString();this.strValue=d.Remove(i,n,t)},n}();t.StringBuilder=g;v=function(){function n(n){var t=this;t.CurrencyDecimalDigits=2;t.CurrencyDecimalSeparator=".";t.CurrencyPositivePattern=0;t.CurrencyGroupSeparator=",";t.CurrencySymbol="\u00a4";t.CurrencyGroupSizes=[3];t.CurrencyNegativePattern=0;t.DigitSubstitution=1;t.IsReadOnly=!0;t.NumberGroupSizes=[3];t.NaNSymbol="NaN";t.NativeDigits=["0","1","2","3","4","5","6","7","8","9"];t.NumberNegativePattern=1;t.NegativeInfinitySymbol="-Infinity";t.NegativeSign="-";t.NumberDecimalDigits=2;t.NumberDecimalSeparator=".";t.NumberGroupSeparator=",";t.PositiveInfinitySymbol="Infinity";t.PositiveSign="+";t.PercentDecimalDigits=2;t.PercentDecimalSeparator=".";t.PercentGroupSeparator=",";t.PercentSymbol="%";t.PerMilleSymbol="\u2030";t.PercentPositivePattern=0;t.PercentNegativePattern=0;t.PercentGroupSizes=[3];n&&n.length>0&&(t.IsReadOnly=!1,t.CurrencySymbol="$")}return n}();t._NumberFormatInfo=v;b=function(){function n(){var n=this;n.MinSupportedDateTime="@-62135568000000@";n.MaxSupportedDateTime="@253402300799999@";n.AlgorithmType=1;n.CalendarType=1;n.Eras=[1];n.TwoDigitYearMax=2029;n.IsReadOnly=!0}return n}();t._Calendar=b;y=function(){function n(n){var t=this;t.AMDesignator="AM";t.AbbreviatedMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""];t.AbbreviatedDayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];t.AbbreviatedMonthGenitiveNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""];t.Calendar=new b;t.CalendarWeekRule=0;t.DateSeparator="/";t.DayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];t.FirstDayOfWeek=0;t.FullDateTimePattern="dddd, dd MMMM yyyy HH:mm:ss";t.IsReadOnly=!0;t.LongDatePattern="dddd, dd MMMM yyyy";t.LongTimePattern="HH:mm:ss";t.MonthDayPattern="MMMM dd";t.MonthNames=["January","February","March","April","May","June","July","August","September","October","November","December",""];t.MonthGenitiveNames=["January","February","March","April","May","June","July","August","September","October","November","December",""];t.NativeCalendarName="Gregorian Calendar";t.PMDesignator="PM";t.RFC1123Pattern="ddd, dd MMM yyyy HH':'mm':'ss 'GMT'";t.ShortDatePattern="MM/dd/yyyy";t.ShortTimePattern="HH:mm";t.SortableDateTimePattern="yyyy'-'MM'-'dd'T'HH':'mm':'ss";t.ShortestDayNames=["Su","Mo","Tu","We","Th","Fr","Sa"];t.TimeSeparator=":";t.UniversalSortableDateTimePattern="yyyy'-'MM'-'dd HH':'mm':'ss'Z'";t.YearMonthPattern="yyyy MMMM";n&&n.length>0&&(t.Calendar.IsReadOnly=!1,t.FullDateTimePattern="dddd, MMMM dd, yyyy h:mm:ss tt",t.LongDatePattern="dddd, MMMM dd, yyyy",t.LongTimePattern="h:mm:ss tt",t.ShortDatePattern="M/d/yyyy",t.ShortTimePattern="h:mm tt",t.YearMonthPattern="MMMM, yyyy",t.IsReadOnly=!1)}return n}();t._DateTimeFormatInfo=y;k=function(){function n(){}return n.isValidEraDate=function(n){return n<this.getEraMin()||n>this.getEraMax()?!1:!0},n.getEraDates=function(){var t=window.spreadJSEras,i,n,u;if(t!=r){for(i=[],n=0;n<t.length;n++)u=new Date(t[n].startDate.replace(/-/g,"/")),i[n]=u;return i}return this.EraDates},n.getEraNames=function(){var i=window.spreadJSEras,t=[],n;if(i!=r){for(n=0;n<i.length;n++)t[n]=i[n].name;return t}for(n=0;n<this.EraCount;n++)t[n]=this.EraNames[n+2*this.EraCount];return t},n.getEraSymbols=function(){var i=window.spreadJSEras,t=[],n;if(i!=r){for(n=0;n<i.length;n++)t[n]=i[n].symbol;return t}for(n=0;n<this.EraCount;n++)t[n]=this.EraNames[n];return t},n.getEraAbbreviations=function(){var i=window.spreadJSEras,t=[],n;if(i!=r){for(n=0;n<i.length;n++)t[n]=i[n].abbreviation;return t}for(n=0;n<this.EraCount;n++)t[n]=this.EraNames[n+this.EraCount];return t},n.getEraShortcuts=function(){var i=window.spreadJSEras,t=[],n;if(i!=r){for(n=0;n<i.length;n++)t[n]=i[n].shortcuts.split(",")[0];return t}for(n=0;n<this.EraCount;n++)t[n]=this.EraKeys[n];return t},n.getEraMax=function(){var n=window.spreadJSEras,t;return n!=r&&n.length>0?(t=new Date(n[n.length-1].startDate.replace(/-/g,"/")),t.setFullYear(t.getFullYear()+99),t):this.EraMax},n.getEraMin=function(){var n=window.spreadJSEras;return n!=r&&n.length>0?new Date(n[0].startDate.replace(/-/g,"/")):this.EraMin},n.getEraCount=function(){var n=window.spreadJSEras;return n!=r?n.length:this.EraCount},n.getEraYears=function(){var t=window.spreadJSEras,i,n,u,f;if(t!=r){for(i=[],n=1;n<t.length;n++)u=new Date(t[n-1].startDate.replace(/-/g,"/")),f=new Date(t[n].startDate.replace(/-/g,"/")),i[n-1]=f.getFullYear()-u.getFullYear()+1;return i[n-1]=99,i}return this.EraYears},n.getEraDate=function(n){var r={},t,i,u;if(r.era=-1,r.eraYear=-1,t=this,!t.isValidEraDate(n))return r;for(i=0;i<t.getEraCount();i++)if(u=i+1!=t.getEraCount()?t.getEraDates()[i+1]:t.addMilliseconds(t.getEraMax(),1),n<u){r.era=i;r.eraYear=n.getFullYear()-t.getEraDates()[i].getFullYear()+1;break}return r},n.addMilliseconds=function(n,t){var i=new Date(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds());return i.setMilliseconds(i.getMilliseconds()+t),new Date(i.valueOf())},n.getYearFromEra=function(t,i){var r=n.getEraDates()[t].getFullYear();return r+i-1},n.parseEraPart=function(t,i){var u,f,e,o,r;i=i.toUpperCase();u=n;switch(t){case"g":for(f=u.getEraSymbols(),r=0;r<f.length;r++)if(f[r]===i)return r;break;case"gg":for(e=u.getEraAbbreviations(),r=0;r<e.length;r++)if(e[r]===i)return r;break;case"ggg":for(o=u.getEraNames(),r=0;r<o.length;r++)if(o[r]===i)return r;break}return-1},n.formatEraPart=function(t,i,r){var o=n,u=o.getEraDate(i),e,f;switch(t){case"g":if(u.era<0)break;e=o.getEraSymbols()[u.era];r.append(e);break;case"gg":if(u.era<0)break;e=o.getEraAbbreviations()[u.era];r.append(e);break;case"ggg":if(u.era<0)break;e=o.getEraNames()[u.era];r.append(e);break;case"ee":if(u.eraYear<0)break;f=u.eraYear.toString();f.length===1&&(f="0"+f);r.append(f);break;case"e":if(u.eraYear<0)break;f=u.eraYear.toString();r.append(f);break}},n.EraDates=[new Date(1868,8,8),new Date(1912,6,30),new Date(1926,11,25),new Date(1989,0,8)],n.EraCount=4,n.EraYears=[45,15,64,99],n.EraMax=new Date(2087,11,31,23,59,59),n.EraMin=new Date(1868,8,8),n.EraKeys=["1","2","3","4","m","t","s","h"],n.EraIndices=[0,1,2,3,0,1,2,3],n.EraNames=["M","T","S","H","\u660e","\u5927","\u662d","\u5e73","\u660e\u6cbb","\u5927\u6b63","\u662d\u548c","\u5e73\u6210"],n.EraYearMax=99,n}();t._EraHelper=k;f=function(){function n(n,t,i){this.name=n;this.numberFormat=t;this.dateTimeFormat=i}return n.prototype.Name=function(){return this.name},n.prototype.NumberFormat=function(){return this.numberFormat},n.prototype.DateTimeFormat=function(){return this.dateTimeFormat},n.prototype._getDateTimeFormats=function(){return this._dateTimeFormats||(this._dateTimeFormats=["yy/MM/dd","yy/MM/d","yy/M/dd","yy/M/d","yyyy/MM/dd","yyyy/MM/d","yyyy/M/dd","yyyy/M/d","MM/dd/yyyy","MM/d/yyyy","M/dd/yyyy","M/d/yyyy","hh:mm:ss","hh:mm:s","hh:m:ss","hh:m:s","h:mm:ss","h:mm:s","h:m:ss","h:m:s","hh:mm:ss tt","hh:mm:s tt","hh:m:ss tt","hh:m:s tt","h:mm:ss tt","h:mm:s tt","h:m:ss tt","h:m:s tt","hh:mm","hh:m","h:mm","h:m","yy/MM/dd hh:mm:ss","yy/MM/dd hh:mm:s","yy/MM/dd hh:m:ss","yy/MM/dd hh:m:s","yy/MM/dd h:mm:ss","yy/MM/dd h:mm:s","yy/MM/dd h:m:ss","yy/MM/dd h:m:s","yy/MM/dd hh:mm:ss tt","yy/MM/dd hh:mm:s tt","yy/MM/dd hh:m:ss tt","yy/MM/dd hh:m:s tt","yy/MM/dd h:mm:ss tt","yy/MM/dd h:mm:s tt","yy/MM/dd h:m:ss tt","yy/MM/dd h:m:s tt","yy/MM/d hh:mm:ss","yy/MM/d hh:mm:s","yy/MM/d hh:m:ss","yy/MM/d hh:m:s","yy/MM/d hh:mm:ss","yy/MM/d h:mm:s","yy/MM/d h:m:ss","yy/MM/d h:m:s","yy/MM/d hh:mm:ss tt","yy/MM/d hh:mm:s tt","yy/MM/d hh:m:ss tt","yy/MM/d hh:m:s tt","yy/MM/d h:mm:ss tt","yy/MM/d h:mm:s tt","yy/MM/d h:m:ss tt","yy/MM/d h:m:s tt","yy/M/dd hh:mm:ss","yy/M/dd hh:mm:s","yy/M/dd hh:m:ss","yy/M/dd hh:m:s","yy/M/dd hh:mm:ss","yy/M/dd h:mm:s","yy/M/dd h:m:ss","yy/M/dd h:m:s","yy/M/dd hh:mm:ss tt","yy/M/dd hh:mm:s tt","yy/M/dd hh:m:ss tt","yy/M/dd hh:m:s tt","yy/M/dd h:mm:ss tt","yy/M/dd h:mm:s tt","yy/M/dd h:m:ss tt","yy/M/dd h:m:s tt","yy/M/d hh:mm:ss","yy/M/d hh:mm:s","yy/M/d hh:m:ss","yy/M/d hh:m:s","yy/M/d hh:mm:ss","yy/M/d h:mm:s","yy/M/d h:m:ss","yy/M/d h:m:s","yy/M/d hh:mm:ss tt","yy/M/d hh:mm:s tt","yy/M/d hh:m:ss tt","yy/M/d hh:m:s tt","yy/M/d h:mm:ss tt","yy/M/d h:mm:s tt","yy/M/d h:m:ss tt","yy/M/d h:m:s tt","yyyy/MM/dd hh:mm:ss","yyyy/MM/dd hh:mm:s","yyyy/MM/dd hh:m:ss","yyyy/MM/dd hh:m:s","yyyy/MM/dd hh:mm:ss","yyyy/MM/dd h:mm:s","yyyy/MM/dd h:m:ss","yyyy/MM/dd h:m:s","yyyy/MM/dd hh:mm:ss tt","yyyy/MM/dd hh:mm:s tt","yyyy/MM/dd hh:m:ss tt","yyyy/MM/dd hh:m:s tt","yyyy/MM/dd h:mm:ss tt","yyyy/MM/dd h:mm:s tt","yyyy/MM/dd h:m:ss tt","yyyy/MM/dd h:m:s tt","yyyy/MM/d hh:mm:ss","yyyy/MM/d hh:mm:s","yyyy/MM/d hh:m:ss","yyyy/MM/d hh:m:s","yyyy/MM/d hh:mm:ss","yyyy/MM/d h:mm:s","yyyy/MM/d h:m:ss","yyyy/MM/d h:m:s","yyyy/MM/d hh:mm:ss tt","yyyy/MM/d hh:mm:s tt","yyyy/MM/d hh:m:ss tt","yyyy/MM/d hh:m:s tt","yyyy/MM/d h:mm:ss tt","yyyy/MM/d h:mm:s tt","yyyy/MM/d h:m:ss tt","yyyy/MM/d h:m:s tt","yyyy/M/dd hh:mm:ss","yyyy/M/dd hh:mm:s","yyyy/M/dd hh:m:ss","yyyy/M/dd hh:m:s","yyyy/M/dd hh:mm:ss","yyyy/M/dd h:mm:s","yyyy/M/dd h:m:ss","yyyy/M/dd h:m:s","yyyy/M/dd hh:mm:ss tt","yyyy/M/dd hh:mm:s tt","yyyy/M/dd hh:m:ss tt","yyyy/M/dd hh:m:s tt","yyyy/M/dd h:mm:ss tt","yyyy/M/dd h:mm:s tt","yyyy/M/dd h:m:ss tt","yyyy/M/dd h:m:s tt","yyyy/M/d hh:mm:ss","yyyy/M/d hh:mm:s","yyyy/M/d hh:m:ss","yyyy/M/d hh:m:s","yyyy/M/d hh:mm:ss","yyyy/M/d h:mm:s","yyyy/M/d h:m:ss","yyyy/M/d h:m:s","yyyy/M/d hh:mm:ss tt","yyyy/M/d hh:mm:s tt","yyyy/M/d hh:m:ss tt","yyyy/M/d hh:m:s tt","yyyy/M/d h:mm:ss tt","yyyy/M/d h:mm:s tt","yyyy/M/d h:m:ss tt","yyyy/M/d h:m:s tt","MM/dd/yyyy hh:mm:ss","MM/dd/yyyy hh:mm:s","MM/dd/yyyy hh:m:ss","MM/dd/yyyy hh:m:s","MM/dd/yyyy hh:mm:ss","MM/dd/yyyy h:mm:s","MM/dd/yyyy h:m:ss","MM/dd/yyyy h:m:s","MM/dd/yyyy hh:mm:ss tt","MM/dd/yyyy hh:mm:s tt","MM/dd/yyyy hh:m:ss tt","MM/dd/yyyy hh:m:s tt","MM/dd/yyyy h:mm:ss tt","MM/dd/yyyy h:mm:s tt","MM/dd/yyyy h:m:ss tt","MM/dd/yyyy h:m:s tt","MM/d/yyyy hh:mm:ss","MM/d/yyyy hh:mm:s","MM/d/yyyy hh:m:ss","MM/d/yyyy hh:m:s","MM/d/yyyy hh:mm:ss","MM/d/yyyy h:mm:s","MM/d/yyyy h:m:ss","MM/d/yyyy h:m:s","MM/d/yyyy hh:mm:ss tt","MM/d/yyyy hh:mm:s tt","MM/d/yyyy hh:m:ss tt","MM/d/yyyy hh:m:s tt","MM/d/yyyy h:mm:ss tt","MM/d/yyyy h:mm:s tt","MM/d/yyyy h:m:ss tt","MM/d/yyyy h:m:s tt","M/dd/yyyy hh:mm:ss","M/dd/yyyy hh:mm:s","M/dd/yyyy hh:m:ss","M/dd/yyyy hh:m:s","M/dd/yyyy hh:mm:ss","M/dd/yyyy h:mm:s","M/dd/yyyy h:m:ss","M/dd/yyyy h:m:s","M/dd/yyyy hh:mm:ss tt","M/dd/yyyy hh:mm:s tt","M/dd/yyyy hh:m:ss tt","M/dd/yyyy hh:m:s tt","M/dd/yyyy h:mm:ss tt","M/dd/yyyy h:mm:s tt","M/dd/yyyy h:m:ss tt","M/dd/yyyy h:m:s tt","M/d/yyyy hh:mm:ss","M/d/yyyy hh:mm:s","M/d/yyyy hh:m:ss","M/d/yyyy hh:m:s","M/d/yyyy hh:mm:ss","M/d/yyyy h:mm:s","M/d/yyyy h:m:ss","M/d/yyyy h:m:s","M/d/yyyy hh:mm:ss tt","M/d/yyyy hh:mm:s tt","M/d/yyyy hh:m:ss tt","M/d/yyyy hh:m:s tt","M/d/yyyy h:mm:ss tt","M/d/yyyy h:mm:s tt","M/d/yyyy h:m:ss tt","M/d/yyyy h:m:s tt","yy-MM-dd","yy-MM-d","yy-M-dd","yy-M-d","yyyy-MM-dd","yyyy-MM-d","yyyy-M-dd","yyyy-M-d","MM-dd-yyyy","MM-d-yyyy","M-dd-yyyy","M-d-yyyy","yy-MM-dd hh:mm:ss","yy-MM-dd hh:mm:s","yy-MM-dd hh:m:ss","yy-MM-dd hh:m:s","yy-MM-dd h:mm:ss","yy-MM-dd h:mm:s","yy-MM-dd h:m:ss","yy-MM-dd h:m:s","yy-MM-dd hh:mm:ss tt","yy-MM-dd hh:mm:s tt","yy-MM-dd hh:m:ss tt","yy-MM-dd hh:m:s tt","yy-MM-dd h:mm:ss tt","yy-MM-dd h:mm:s tt","yy-MM-dd h:m:ss tt","yy-MM-dd h:m:s tt","yy-MM-d hh:mm:ss","yy-MM-d hh:mm:s","yy-MM-d hh:m:ss","yy-MM-d hh:m:s","yy-MM-d hh:mm:ss","yy-MM-d h:mm:s","yy-MM-d h:m:ss","yy-MM-d h:m:s","yy-MM-d hh:mm:ss tt","yy-MM-d hh:mm:s tt","yy-MM-d hh:m:ss tt","yy-MM-d hh:m:s tt","yy-MM-d h:mm:ss tt","yy-MM-d h:mm:s tt","yy-MM-d h:m:ss tt","yy-MM-d h:m:s tt","yy-M-dd hh:mm:ss","yy-M-dd hh:mm:s","yy-M-dd hh:m:ss","yy-M-dd hh:m:s","yy-M-dd hh:mm:ss","yy-M-dd h:mm:s","yy-M-dd h:m:ss","yy-M-dd h:m:s","yy-M-dd hh:mm:ss tt","yy-M-dd hh:mm:s tt","yy-M-dd hh:m:ss tt","yy-M-dd hh:m:s tt","yy-M-dd h:mm:ss tt","yy-M-dd h:mm:s tt","yy-M-dd h:m:ss tt","yy-M-dd h:m:s tt","yy-M-d hh:mm:ss","yy-M-d hh:mm:s","yy-M-d hh:m:ss","yy-M-d hh:m:s","yy-M-d hh:mm:ss","yy-M-d h:mm:s","yy-M-d h:m:ss","yy-M-d h:m:s","yy-M-d hh:mm:ss tt","yy-M-d hh:mm:s tt","yy-M-d hh:m:ss tt","yy-M-d hh:m:s tt","yy-M-d h:mm:ss tt","yy-M-d h:mm:s tt","yy-M-d h:m:ss tt","yy-M-d h:m:s tt","yyyy-MM-dd hh:mm:ss","yyyy-MM-dd hh:mm:s","yyyy-MM-dd hh:m:ss","yyyy-MM-dd hh:m:s","yyyy-MM-dd hh:mm:ss","yyyy-MM-dd h:mm:s","yyyy-MM-dd h:m:ss","yyyy-MM-dd h:m:s","yyyy-MM-dd hh:mm:ss tt","yyyy-MM-dd hh:mm:s tt","yyyy-MM-dd hh:m:ss tt","yyyy-MM-dd hh:m:s tt","yyyy-MM-dd h:mm:ss tt","yyyy-MM-dd h:mm:s tt","yyyy-MM-dd h:m:ss tt","yyyy-MM-dd h:m:s tt","yyyy-MM-d hh:mm:ss","yyyy-MM-d hh:mm:s","yyyy-MM-d hh:m:ss","yyyy-MM-d hh:m:s","yyyy-MM-d hh:mm:ss","yyyy-MM-d h:mm:s","yyyy-MM-d h:m:ss","yyyy-MM-d h:m:s","yyyy-MM-d hh:mm:ss tt","yyyy-MM-d hh:mm:s tt","yyyy-MM-d hh:m:ss tt","yyyy-MM-d hh:m:s tt","yyyy-MM-d h:mm:ss tt","yyyy-MM-d h:mm:s tt","yyyy-MM-d h:m:ss tt","yyyy-MM-d h:m:s tt","yyyy-M-dd hh:mm:ss","yyyy-M-dd hh:mm:s","yyyy-M-dd hh:m:ss","yyyy-M-dd hh:m:s","yyyy-M-dd hh:mm:ss","yyyy-M-dd h:mm:s","yyyy-M-dd h:m:ss","yyyy-M-dd h:m:s","yyyy-M-dd hh:mm:ss tt","yyyy-M-dd hh:mm:s tt","yyyy-M-dd hh:m:ss tt","yyyy-M-dd hh:m:s tt","yyyy-M-dd h:mm:ss tt","yyyy-M-dd h:mm:s tt","yyyy-M-dd h:m:ss tt","yyyy-M-dd h:m:s tt","yyyy-M-d hh:mm:ss","yyyy-M-d hh:mm:s","yyyy-M-d hh:m:ss","yyyy-M-d hh:m:s","yyyy-M-d hh:mm:ss","yyyy-M-d h:mm:s","yyyy-M-d h:m:ss","yyyy-M-d h:m:s","yyyy-M-d hh:mm:ss tt","yyyy-M-d hh:mm:s tt","yyyy-M-d hh:m:ss tt","yyyy-M-d hh:m:s tt","yyyy-M-d h:mm:ss tt","yyyy-M-d h:mm:s tt","yyyy-M-d h:m:ss tt","yyyy-M-d h:m:s tt","MM-dd-yyyy hh:mm:ss","MM-dd-yyyy hh:mm:s","MM-dd-yyyy hh:m:ss","MM-dd-yyyy hh:m:s","MM-dd-yyyy hh:mm:ss","MM-dd-yyyy h:mm:s","MM-dd-yyyy h:m:ss","MM-dd-yyyy h:m:s","MM-dd-yyyy hh:mm:ss tt","MM-dd-yyyy hh:mm:s tt","MM-dd-yyyy hh:m:ss tt","MM-dd-yyyy hh:m:s tt","MM-dd-yyyy h:mm:ss tt","MM-dd-yyyy h:mm:s tt","MM-dd-yyyy h:m:ss tt","MM-dd-yyyy h:m:s tt","MM-d-yyyy hh:mm:ss","MM-d-yyyy hh:mm:s","MM-d-yyyy hh:m:ss","MM-d-yyyy hh:m:s","MM-d-yyyy hh:mm:ss","MM-d-yyyy h:mm:s","MM-d-yyyy h:m:ss","MM-d-yyyy h:m:s","MM-d-yyyy hh:mm:ss tt","MM-d-yyyy hh:mm:s tt","MM-d-yyyy hh:m:ss tt","MM-d-yyyy hh:m:s tt","MM-d-yyyy h:mm:ss tt","MM-d-yyyy h:mm:s tt","MM-d-yyyy h:m:ss tt","MM-d-yyyy h:m:s tt","M-dd-yyyy hh:mm:ss","M-dd-yyyy hh:mm:s","M-dd-yyyy hh:m:ss","M-dd-yyyy hh:m:s","M-dd-yyyy hh:mm:ss","M-dd-yyyy h:mm:s","M-dd-yyyy h:m:ss","M-dd-yyyy h:m:s","M-dd-yyyy hh:mm:ss tt","M-dd-yyyy hh:mm:s tt","M-dd-yyyy hh:m:ss tt","M-dd-yyyy hh:m:s tt","M-dd-yyyy h:mm:ss tt","M-dd-yyyy h:mm:s tt","M-dd-yyyy h:m:ss tt","M-dd-yyyy h:m:s tt","M-d-yyyy hh:mm:ss","M-d-yyyy hh:mm:s","M-d-yyyy hh:m:ss","M-d-yyyy hh:m:s","M-d-yyyy hh:mm:ss","M-d-yyyy h:mm:s","M-d-yyyy h:m:ss","M-d-yyyy h:m:s","M-d-yyyy hh:mm:ss tt","M-d-yyyy hh:mm:s tt","M-d-yyyy hh:m:ss tt","M-d-yyyy hh:m:s tt","M-d-yyyy h:mm:ss tt","M-d-yyyy h:mm:s tt","M-d-yyyy h:m:ss tt","M-d-yyyy h:m:s tt"]),this._dateTimeFormats},n.prototype._getMonthIndex=function(n){var t=this;return t._upperMonths||(t._upperMonths=l(t.dateTimeFormat.MonthNames),t._upperMonthsGenitive=l(t.dateTimeFormat.MonthGenitiveNames)),nt(n,t._upperMonths,t._upperMonthsGenitive)},n.prototype._getAbbrMonthIndex=function(n){var t=this;return t._upperAbbrMonths||(t._upperAbbrMonths=l(t.dateTimeFormat.AbbreviatedMonthNames),t._upperAbbrMonthsGenitive=l(t.dateTimeFormat.AbbreviatedMonthGenitiveNames)),nt(n,t._upperAbbrMonths,t._upperAbbrMonthsGenitive)},n.prototype._getDayIndex=function(n){var t=this;return t._upperDays||(t._upperDays=l(t.dateTimeFormat.DayNames)),new c(t._upperDays).indexOf(p(n))},n.prototype._getAbbrDayIndex=function(n){var t=this;return t._upperAbbrDays||(t._upperAbbrDays=l(t.dateTimeFormat.AbbreviatedDayNames)),new c(t._upperAbbrDays).indexOf(p(n))},n._parseCulture=function(t){var i=t.dateTimeFormat;return new n(t.name,t.numberFormat,i)},n.prototype._parse=function(t){return n._parseCulture(t)},n.invariantCulture=function(){var t=n;return t._invariantCulture||(t._invariantCulture=new n("",new v(""),new y(""))),t._invariantCulture},n.currentCulture=function(t){var i=n;return arguments.length===0?i._currentCulture||(i._currentCulture=i.invariantCulture()):i._currentCulture=i.getCulture(t),i._currentCulture},n.enCulture=function(){var t=n;return t._enCulture||(t._enCulture=new n("en-US",new v("en-US"),new y("en-US"))),t._enCulture},n.japanCulture=function(){var i=n,t,r;return i._japanCulture||(t=new n("ja-JP",new v("ja-JP"),new y("ja-JP")),t.numberFormat.CurrencyDecimalDigits=0,t.numberFormat.CurrencySymbol="\uffe5",t.numberFormat.PercentPositivePattern=1,t.numberFormat.PercentNegativePattern=1,t.dateTimeFormat.AbbreviatedDayNames=["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],t.dateTimeFormat.AbbreviatedMonthNames=["1","2","3","4","5","6","7","8","9","10","11","12",""],t.dateTimeFormat.AbbreviatedMonthGenitiveNames=["1","2","3","4","5","6","7","8","9","10","11","12",""],t.dateTimeFormat.AMDesignator="\u5348\u524d",t.dateTimeFormat.DayNames=["\u65e5\u66dc\u65e5","\u6708\u66dc\u65e5","\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5"],t.dateTimeFormat.FullDateTimePattern="yyyy'\u5e74'M'\u6708'd'\u65e5' H:mm:ss",t.dateTimeFormat.LongDatePattern="yyyy'\u5e74'M'\u6708'd'\u65e5'",t.dateTimeFormat.LongTimePattern="H:mm:ss",t.dateTimeFormat.MonthDayPattern="M'\u6708'd'\u65e5'",t.dateTimeFormat.MonthGenitiveNames=["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708",""],t.dateTimeFormat.MonthNames=["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708",""],t.dateTimeFormat.NativeCalendarName="\u897f\u66a6 (\u65e5\u672c\u8a9e)",t.dateTimeFormat.PMDesignator="\u5348\u5f8c",t.dateTimeFormat.ShortDatePattern="yyyy/MM/dd",t.dateTimeFormat.ShortTimePattern="H:mm",t.dateTimeFormat.ShortestDayNames=["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],t.dateTimeFormat.YearMonthPattern="yyyy'\u5e74'M'\u6708'",t.dateTimeFormat.eras=k,r=t._getDateTimeFormats().slice(0),r.push(""),i._japanCulture=t),i._japanCulture},n.getCulture=function(t){t=t.toLowerCase();switch(t){case"ja-jp":return n.japanCulture();case"en-us":return n.enCulture();default:return n.invariantCulture()}},n}();t._CultureInfo=f;a=function(){function n(n){this._str=n}return n.__toFormattedString=function(n,r){for(var c,e,v,f,s="",o=r[0],u=0;;){if(c=o.indexOf("{",u),e=o.indexOf("}",u),c<0&&e<0){s+=o.slice(u);break}if(e>0&&(e<c||c<0)){if(o.charAt(e+1)!=="}")throw new Error(t.SR.Exp_BraceMismatch);s+=o.slice(u,e+1);u=e+2;continue}if(s+=o.slice(u,c),u=c+1,o.charAt(u)==="{"){s+="{";u++;continue}if(e<0)throw new Error(t.SR.Exp_BraceMismatch);var l=o.substring(u,e),a=l.indexOf(":"),y=parseInt(a<0?l:l.substring(0,a),10)+1;if(isNaN(y))throw new Error(t.SR.Exp_InvalidFormat);v=a<0?"":l.substring(a+1);f=r[y];(typeof f===h||f===i)&&(f="");s+=f.toFormattedString?f.toFormattedString(v):n&&f.localeFormat?f.localeFormat(v):f.format?f.format(v):f.toString();u=e+1}return s},n.prototype.startsWith=function(n){return this._str.substr(0,n.length)===n},n.prototype.endsWith=function(n){return this._str.indexOf(n,this._str.length-n.length)!==-1},n.prototype.trim=function(){return this._str.replace(/^\s+|\s+$/g,"")},n.prototype.trimEnd=function(){return this._str.replace(/\s+$/,"")},n.prototype.trimStart=function(){return this._str.replace(/^\s+/,"")},n.prototype.format=function(t,i){var u=[],r;for(u.push(t),r=0;r<i.length;r++)u.push(i[r]);return n.__toFormattedString(!1,u)},n}();t._StringHelper=a;d=function(){function n(){}return n.Contains=function(n,t){return t===""||n.indexOf(t)>=0},n.IndexOf=function(n,t,i){if(i)if(i===1){var r=n.toLowerCase(),u=t.toLowerCase();return r.indexOf(u)}else return n.indexOf(t);else return n.indexOf(t)},n.TrimStart=function(n,t){if(!t)return n;for(var i=n;;){if(i.substr(0,t.length)!==t)break;i=i.substr(t.length)}return i},n.TrimEnd=function(n,t){if(!t)return n;for(var i=n;;){if(i.substr(i.length-t.length,t.length)!==t)break;i=i.substr(0,i.length-t.length)}return i},n.Trim=function(t,i){var r=i;return i||(r=" "),t=n.TrimStart(t,r),n.TrimEnd(t,r)},n.Insert=function(n,t,u){if(t<0||t>n.length||u===i||u===r)throw new Error;var f=n.substr(0,t),e=n.substr(t,n.length-t);return f+u+e},n.Remove=function(n,t,u){if((u===r||u===i)&&(u=n.length-t),t<0||u<0||t+u>n.length)throw new Error;var f=n.substr(0,t),e=n.substr(t+u,n.length-t-u);return f+e},n.StartsWith=function(n,t,i){if(!t)throw new Error;if(t==="")return!0;if(t.length>n.length)return!1;var r=n,u=t;return i===1&&(r=r.toLowerCase(),u=u.toLowerCase()),r.search(new RegExp("^"+u))>-1},n.EndsWith=function(n,t,i){if(!t)throw new Error;if(t==="")return!0;if(t.length>n.length)return!1;var r=n,u=t;return i===1&&(r=r.toLowerCase(),u=u.toLowerCase()),r.search(new RegExp(u+"$"))>-1},n.Replace=function(n,t,i){if(!t||t==="")throw new Error;var r=new RegExp(t,"g");return n.replace(r,i)},n}();t.StringHelper=d;w=function(){function n(n){this._date=n}return n.prototype.Hour=function(){return this._date.getHours()},n.prototype.Minute=function(){return this._date.getMinutes()},n.prototype.Second=function(){return this._date.getSeconds()},n.prototype.Millisecond=function(){return this._date.getMilliseconds()},n.prototype.TotalDays=function(){return s(this.toOADate())},n.prototype.toOADate=function(){return n.___toOADate(this._date)},n.prototype.format=function(n){return this._toFormattedString(n,f.currentCulture())},n.prototype.customCultureFormat=function(n,t){return t||(t=f.currentCulture()),this._toFormattedString(n,t)},n.prototype.localeFormat=function(n){return this._toFormattedString(n,f.currentCulture())},n.prototype._toFormattedString=function(r,f){function ft(){return b||rt?b:(b=ut.test(r),rt=!0,b)}function y(n,t){if(a)return a[t];switch(t){case 0:return n.getFullYear();case 1:return n.getMonth();case 2:return n.getDate()}}var h=this,c=f.DateTimeFormat(),d=c.Calendar.convert,v,it,e,l,b,rt,ut,g,nt,a,p;if(!r||!r.length||r==="i")return f&&f.Name().length?d?h._toFormattedString(c.FullDateTimePattern,f):h._date.toLocaleString():h._date.toString();v=c.eras;it=r==="s";r=n.__expandFormat(c,r);e=new o;ut=/([^d]|^)(d|dd)([^d]|$)/g;g=0;nt=n.__getTokenRegExp();!it&&d&&(a=d.fromGregorian(h._date));var st=i,k=-2,tt=-2;for(p=0;;p++){var et=nt.lastIndex,w=nt.exec(r),ot=r.slice(et,w?w.index:r.length);if(g+=n.__appendPreOrPostMatch(ot,e),!w)break;if(g%2==1){e.append(w[0]);continue}switch(w[0]){case"dddd":e.append(c.DayNames[h._date.getDay()]);break;case"ddd":e.append(c.AbbreviatedDayNames[h._date.getDay()]);break;case"dd":b=!0;e.append(n.___addLeadingZero(y(h._date,2)));break;case"d":b=!0;e.append(y(h._date,2));break;case"MMMM":e.append(c.MonthGenitiveNames&&ft()?c.MonthGenitiveNames[y(h._date,1)]:c.MonthNames[y(h._date,1)]);break;case"MMM":e.append(c.AbbreviatedMonthGenitiveNames&&ft()?c.AbbreviatedMonthGenitiveNames[y(h._date,1)]:c.AbbreviatedMonthNames[y(h._date,1)]);break;case"MM":e.append(n.___addLeadingZero(y(h._date,1)+1));break;case"M":e.append(y(h._date,1)+1);break;case"yyyy":case"yyy":k>=0?v.formatEraPart("ee",h._date,e):e.append(n.___padYear(a?a[0]:h._date.getFullYear()));break;case"yy":k>=0?v.formatEraPart("ee",h._date,e):e.append(n.___addLeadingZero((a?a[0]:h._date.getFullYear())%100));break;case"y":k>=0?v.formatEraPart("e",h._date,e):e.append(((a?a[0]:h._date.getFullYear())%100).toString());break;case"hh":l=h._date.getHours()%12;l===0&&(l=12);e.append(n.___addLeadingZero(l));break;case"h":l=h._date.getHours()%12;l===0&&(l=12);e.append(l);break;case"HH":e.append(n.___addLeadingZero(h._date.getHours()));break;case"H":e.append(h._date.getHours().toString());break;case"mm":e.append(n.___addLeadingZero(h._date.getMinutes()));break;case"m":e.append(h._date.getMinutes().toString());break;case"ss":e.append(n.___addLeadingZero(h._date.getSeconds()));break;case"s":e.append(h._date.getSeconds().toString());break;case"tt":e.append(h._date.getHours()<12?c.AMDesignator:c.PMDesignator);break;case"t":e.append((h._date.getHours()<12?c.AMDesignator:c.PMDesignator).charAt(0));break;case"f":e.append(n.___addLeadingZeros(h._date.getMilliseconds()).charAt(0));break;case"ff":e.append(n.___addLeadingZeros(h._date.getMilliseconds()).substr(0,2));break;case"fff":e.append(n.___addLeadingZeros(h._date.getMilliseconds()));break;case"z":l=h._date.getTimezoneOffset()/60;e.append((l<=0?"+":"-")+s(u(l)));break;case"zz":l=h._date.getTimezoneOffset()/60;e.append((l<=0?"+":"-")+n.___addLeadingZero(s(u(l))));break;case"zzz":l=h._date.getTimezoneOffset()/60;e.append((l<=0?"+":"-")+n.___addLeadingZero(s(u(l)))+":"+n.___addLeadingZero(u(h._date.getTimezoneOffset()%60)));break;case"g":case"gg":case"ggg":if(!v)break;if(k===p-1){k=p;break}else v.formatEraPart(w[0],h._date,e),k=p;break;case"e":case"ee":if(v)if(tt===p-1){tt=p;break}else v.formatEraPart(w[0],h._date,e),tt=p;else{e.append(n.___padYear(a?a[0]:h._date.getFullYear()));break}break;case"/":e.append(c.DateSeparator);break;case"[h]":e.append("[h]");break;case"[mm]":e.append("[mm]");break;case"[ss]":e.append("[ss]");break;default:throw new Error(t.SR.Exp_InvalidDateFormat);}}return e.toString()},n.parseLocale=function(t,i){var r;return r=i?[t,i]:[t],n._parseDate(t,f.currentCulture(),r)},n.parseInvariant=function(t,i){return n._parseDate(t,f.invariantCulture(),[t,i])},n.__appendPreOrPostMatch=function(n,t){for(var u,f=0,i=!1,r=0,e=n.length;r<e;r++){u=n.charAt(r);switch(u){case"'":case'"':i?t.append("'"):f++;i=!1;break;case"\\":i&&t.append("\\");i=!i;break;default:t.append(u);i=!1;break}}return f},n.__expandFormat=function(n,i){i||(i="F");var r=i.length;if(r===1)switch(i){case"d":return n.ShortDatePattern;case"D":return n.LongDatePattern;case"t":return n.ShortTimePattern;case"T":return n.LongTimePattern;case"f":return n.LongDatePattern+" "+n.ShortTimePattern;case"F":return n.FullDateTimePattern;case"M":case"m":return n.MonthDayPattern;case"s":return n.SortableDateTimePattern;case"Y":case"y":return n.YearMonthPattern;case"g":case"G":case"e":return i;case"R":case"r":return n.RFC1123Pattern;case"u":return n.UniversalSortableDateTimePattern;case"U":return n.FullDateTimePattern;case"o":case"O":return"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffff";default:throw new Error(t.SR.Exp_InvalidString);}else r===2&&i.charAt(0)==="%"&&(i=i.charAt(1));return i},n.__expandYear=function(n,t){var u=new Date,r=n.DateTimeFormat().eras,i;return r&&t<100&&(i=r.getEraDate(u).eraYear,t+=i-i%100,t>n.DateTimeFormat().Calendar.TwoDigitYearMax&&(t-=100)),t},n.__getTokenRegExp=function(){return/\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|ggg|gg|g|ee|e|\[h\]|\[mm\]|\[ss\]/g},n.__getParseRegExp=function(r,u){var e,p,w,l;if(r._parseRegExp){if(r._parseRegExp[u])return r._parseRegExp[u]}else r._parseRegExp={};e=n.__expandFormat(r,u);e=e.replace("%M","M");e=e.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");for(var f=new o("^"),a=new c([]),h=0,v=0,y=n.__getTokenRegExp(),s;(s=y.exec(e))!==i;){if(p=e.slice(h,s.index),h=y.lastIndex,v+=n.__appendPreOrPostMatch(p,f),v%2==1){f.append(s[0]);continue}switch(s[0]){case"dddd":case"ddd":case"MMMM":case"MMM":case"gggg":case"ggg":case"gg":case"g":f.append("(\\D+)");break;case"tt":case"t":f.append("(\\D*)");break;case"yyy":case"yyyy":f.append("(\\d{4})");break;case"fff":f.append("(\\d{3})");break;case"ff":f.append("(\\d{2})");break;case"f":f.append("(\\d)");break;case"dd":case"d":case"MM":case"M":case"yy":case"y":case"eee":case"ee":case"e":case"HH":case"H":case"hh":case"h":case"mm":case"m":case"ss":case"s":f.append("(\\d\\d?)");break;case"zzz":f.append("([+-]?\\d\\d?:\\d{2})");break;case"zz":case"z":f.append("([+-]?\\d\\d?)");break;case"/":f.append("(\\"+r.DateSeparator+")");break;default:throw new Error(t.SR.Exp_InvalidDateFormat);}a.add(s[0])}return n.__appendPreOrPostMatch(e.slice(h),f),f.append("$"),w=f.toString().replace(/\s+/g,"\\s+"),l={regExp:w,groups:a.array()},r._parseRegExp[u]=l,l},n._parseDateExact=function(t,r,u){var b,at,f,ot,rt,d,st,e,g,k,ht;t=$.trim(t);var c=u.DateTimeFormat(),ct=n.__getParseRegExp(c,r),lt=new RegExp(ct.regExp).exec(t);if(lt===i)return i;var ut=ct.groups,ft=i,o=i,s=i,l=i,v=i,w=0,y,nt=0,tt=0,h=0,it=i,et=!1,p=!0;for(b=0,at=ut.length;b<at;b++)if(f=lt[b+1],f)switch(ut[b]){case"dd":case"d":if(p=!1,l=parseInt(f,10),l<1||l>31)return i;break;case"MMMM":if(p=!1,s=u._getMonthIndex(f),s<0||s>11)return i;break;case"MMM":if(p=!1,s=u._getAbbrMonthIndex(f),s<0||s>11)return i;break;case"M":case"MM":case"%M":if(p=!1,s=parseInt(f,10)-1,s<0||s>11)return i;break;case"e":case"ee":if(p=!1,o=n.__expandYear(u,parseInt(f,10)),o<0||o>9999)return i;break;case"y":case"yy":case"yyy":case"yyyy":if(p=!1,o=parseInt(f,10),o<0||o>9999)return i;break;case"h":case"hh":case"H":case"HH":if(w=parseInt(f,10),w<0||w>23)return i;break;case"m":case"mm":if(nt=parseInt(f,10),nt<0||nt>59)return i;break;case"s":case"ss":if(tt=parseInt(f,10),tt<0||tt>59)return i;break;case"tt":case"t":if(ot=f.toUpperCase(),et=ot===c.PMDesignator.toUpperCase(),!et&&ot!==c.AMDesignator.toUpperCase())return i;break;case"f":if(h=parseInt(f,10)*100,h<0||h>999)return i;break;case"ff":if(h=parseInt(f,10)*10,h<0||h>999)return i;break;case"fff":if(h=parseInt(f,10),h<0||h>999)return i;break;case"dddd":if(p=!1,v=u._getDayIndex(f),v<0||v>6)return i;break;case"ddd":if(p=!1,v=u._getAbbrDayIndex(f),v<0||v>6)return i;break;case"zzz":if((rt=f.split(/:/),rt.length!==2)||(y=parseInt(rt[0],10),y<-12||y>13)||(d=parseInt(rt[1],10),d<0||d>59))return i;it=y*60+(new a(f).startsWith("-")?-d:d);break;case"z":case"zz":if(y=parseInt(f,10),y<-12||y>13)return i;it=y*60;break;case"g":case"gg":case"ggg":if((st=f,!st||!c.eras)||(ft=c.eras.parseEraPart(ut[b],st),ft<0))return i;break}if(e=new Date,k=c.Calendar.convert,k&&(g=k.fromGregorian(e)),k||(g=[e.getFullYear(),e.getMonth(),e.getDate()]),o===i?o=g[0]:o<100&&(c.eras?o=c.eras.getYearFromEra(ft||0,o):o+=o>=30?1900:2e3),s===i&&(s=g[1]),l===i&&(l=g[2]),k){if(e=k.toGregorian(o,s,l),e===i)return i}else if((e.setFullYear(o,s,l),e.getDate()!==l)||v!==i&&e.getDay()!==v)return i;return et&&w<12&&(w+=12),e.setHours(w,nt,tt,h),it!==i&&(ht=e.getMinutes()-(it+e.getTimezoneOffset()),e.setHours(e.getHours()+ht/60,ht%60)),e},n.___addLeadingZero=function(n){return n<10?"0"+n:n.toString()},n.___addLeadingZeros=function(n){return n<10?"00"+n:n<100?"0"+n:n.toString()},n.___padYear=function(n){return n<10?"000"+n:n<100?"00"+n:n<1e3?"0"+n:n.toString()},n._parseDate=function(t,r,u){for(var e,s,h,c=!1,f=1,o=u.length;f<o;f++)if(s=u[f],s&&(c=!0,e=n._parseDateExact(t,s,r),e))return e;if(!c)for(h=r._getDateTimeFormats(),f=0,o=h.length;f<o;f++)if(e=n._parseDateExact(t,h[f],r),e)return e;return i},n.___toOADate=function(n){return n===r||n===i?0:(typeof n=="number"&&(n=new Date(n)),(n.getTime()*1440+3181192704e6-n.getTimezoneOffset()*864e5)/124416e6)},n._fromOADate=function(n){var t=new Date((n-25569)*864e5);return new Date(n*864e5-22091616e5+t.getTimezoneOffset()*6e4)},n.parseExact=n._parseDateExact,n.fromOADate=n._fromOADate,n}();t._DateTimeHelper=w;var ht=function(){function n(n,t,i){this.normal=n;this.negative=t;this.zero=i}return n}(),tt=function(){function n(){var n=this;n.intPart=i;n.decPart=i;n.group=!1;n.scale=0;n.percent=0;n.permile=0;n.exponent=i}return n}(),it=function(){function n(n){this._num=n}return n.prototype.format=function(n){return this._toFormattedString(n,f.invariantCulture())},n.prototype.localeFormat=function(n){return this._toFormattedString(n,f.currentCulture())},n.prototype.customCultureFormat=function(n,t){return t||(t=f.currentCulture()),this._toFormattedString(n,t)},n.prototype._toFormattedString=function(t,i){var r=this;return!t||t.length===0||t==="i"?i&&i.Name().length>0?r._num.toLocaleString():r._num.toString():n.__getStandardTokenRegExp().test(t)?r._toStandardFormattedString(t,i.NumberFormat()):r._toCustomFormattedString(t,i.NumberFormat())},n.prototype._toStandardFormattedString=function(i,r){var s=this,e=u(s._num).toString(),f,o,h,a,v,c,y,l;i||(i="D");f=-1;i.length>1&&(f=parseInt(i.slice(1),10));switch(i.charAt(0)){case"d":case"D":o="n";f!==-1&&(e=n.___zeroPad(""+e,f,!0));s._num<0&&(e="-"+e);break;case"c":case"C":o=s._num<0?n.___currencyNegativePattern[r.CurrencyNegativePattern]:n.___currencyPositivePattern[r.CurrencyPositivePattern];f===-1&&(f=r.CurrencyDecimalDigits);e=n.___expandNumber(u(s._num),f,r.CurrencyGroupSizes,r.CurrencyGroupSeparator,r.CurrencyDecimalSeparator,r.NegativeSign);break;case"n":case"N":o=s._num<0?n.___numberNegativePattern[r.NumberNegativePattern]:"n";f===-1&&(f=r.NumberDecimalDigits);e=n.___expandNumber(u(s._num),f,r.NumberGroupSizes,r.NumberGroupSeparator,r.NumberDecimalSeparator,r.NegativeSign);break;case"p":case"P":o=s._num<0?n.___percentNegativePattern[r.PercentNegativePattern]:n.___percentPositivePattern[r.PercentPositivePattern];f===-1&&(f=r.PercentDecimalDigits);e=n.___expandNumber(u(s._num)*100,f,r.PercentGroupSizes,r.PercentGroupSeparator,r.PercentDecimalSeparator,r.NegativeSign);break;case"F":case"f":h=s._toFixedPoint(e,o,i,f,r);e=h[0];o=h[1];break;case"e":case"E":h=s._toScientificNotation(e,o,i,f,r);e=h[0];o=h[1];break;case"x":case"X":o="n";e=n.___toHexString(s._num,i.charAt(0)==="x",f===-1?0:f);break;case"g":case"G":a=s._num.toString();h=[];h=a.indexOf("e")===-1&&a.indexOf("E")===-1?s._toFixedPoint(e,o,i,f,r):s._toScientificNotation(e,o,i.replace("g","e").replace("G","E"),f,r);e=h[0];o=h[1];break;default:throw new Error(t.SR.Exp_BadFormatSpecifier);}for(v=/n|\$|-|%/g,c="";;){if(y=v.lastIndex,l=v.exec(o),c+=o.slice(y,l?l.index:o.length),!l)break;switch(l[0]){case"n":c+=e;break;case"$":c+=r.CurrencySymbol;break;case"-":/[1-9]/.test(e)&&(c+=r.NegativeSign);break;case"%":c+=r.PercentSymbol;break;default:throw new Error(t.SR.Exp_InvalidNumberFormat);}}return c},n.prototype._toScientificNotation=function(t,i,r,f,e){return i="n",t=n.___toScientific(u(this._num),r.charAt(0),f===-1?6:f,e.NumberGroupSizes,e.NumberGroupSeparator,e.NumberDecimalSeparator,e.NegativeSign),this._num<0&&(t="-"+t),[t,i]},n.prototype._toFixedPoint=function(t,i,r,u,f){i=this._num<0?n.___numberNegativePattern[f.NumberNegativePattern]:"n";u===-1&&(u=2);var e=parseFloat(t),o=s(e),h=e-o;return t=n.___expandNumber(h,u,f.NumberGroupSizes,f.NumberGroupSeparator,f.NumberDecimalSeparator,f.NegativeSign),t=""+o+t.substring(1),[t,i]},n.prototype._toCustomFormattedString=function(t,r){var e=n.___parseCustomNumberFormatter(t),f=i,u;return this._num===0?f=e.zero:this._num<0&&(f=e.negative),f||(f=e.normal),u=n.___formatNumber(this._num,f,r)+"",u.indexOf(r.NegativeSign)===1&&u.indexOf(r.CurrencySymbol)===0&&(u=u[1]+u[0]+u.substring(2)),u},n.parseLocale=function(t){return n.__parseNumber(t,f.currentCulture())},n.parseInvariant=function(t){return n.__parseNumber(t,f.invariantCulture())},n.__getStandardTokenRegExp=function(){return/^(C|c|D|d|E|e|F|f|G|g|N|n|P|p|R|r|X|x)(\d*)$/g},n.___getDigitLength=function(n,t){for(var o=s(u(n)),f={integer:1,decimal:0},l;o>=10;)o=o/10,f.integer++;var r=n.toString(),h=r.search(/e/ig),e=r.indexOf(t),i;if(h!==-1){var a=r.substr(0,h),v=r.substr(h+1),c=0;e!==-1&&(c=a.substr(e+1).length);l=parseFloat(v);i=c-l;i<0&&(i=0);f.decimal=i}else i=0,e!==-1&&(i=r.substr(e+1).length),f.decimal=i;return f},n.___parseExponentFormat=function(n){for(var i={symbol:n.charAt(0),sign:0,exp:0},r="",u=1;u<n.length;u++)if(r=n.charAt(u),r==="+")i.sign=1;else if(r==="-")i.sign=-1;else if(r==="0"){i.exp=n.length-u;break}else throw new Error(t.SR.Exp_InvalidExponentFormat);return i},n.___parseCustomNumberFormatter=function(u){for(var ut,g,nt,c,l=i,a=i,v=i,s=new tt,f="",it=!1,rt=!1,ft=!1,y=!1,p=!1,w=!1,b=!1,k=!1,e=i,h=i,o=[],d=0;d<u.length;d++){if(e=u.charAt(d),it){e!=="'"?f+=e:(o.push(f),f="",it=!1);h=e;continue}else if(rt){e!=='"'?f+=e:(o.push(f),f="",rt=!1);h=e;continue}else if(ft){o.push(f+e);f="";h=e;continue}else if(y){if(h==="E"||h==="e")if(e==="+"||e==="-"||e==="0"){f+=e;continue}else y=!1;else if(h==="+"||h==="-")if(e==="0"){f+=e;continue}else y=!1,o.push(f),f="";else if(h==="0")if(e==="0"){f+=e;continue}else y=!1,b||(b=!0,s.exponent=n.___parseExponentFormat(f)),o.push(f),f=""}else if(e==="0"||e==="#")if(k=!0,h==="0"||h==="#"){f+=e;h=e;continue}else f!==""&&(o.push(f),f="");else(h==="0"||h==="#")&&e!=="0"&&e!=="#"&&(o.push(f),f="");if(e===";"){if(f!==""&&(y&&!b&&(s.exponent=n.___parseExponentFormat(f)),o.push(f),f=""),p?s.decPart=e:s.intPart=o,o=[],l===r||l===i)l=s;else if(a===r||a===i)a=s;else if(v===r||v===i)v=s;else throw new Error(t.SR.Exp_InvalidSemicolons);p=!1;k=!1;w&&(s.group=!0,w=!1);s=new tt}else if(p||e!==".")if(e==="'")it=!0;else if(e==='"')rt=!0;else if(e==="%")s.percent++,o.push(e);else if(e==="\u2030")s.permile++,o.push(e);else if(e==="0"||e==="#")f+=e;else if(e===",")if(p)f!==""&&(o.push(f),f="");else{if(f!==""&&(o.push(f),f=""),!k)continue;for(ut=!0,g="",nt=d+1;nt<u.length;nt++){if(c=u.charAt(nt),g!==""){(c==="'"||c==='"')&&(g="");continue}if(c==="'"||c==='"')g=c;else if(c==="0"||c==="#"){ut=!1;break}else if(c==="."||c===";")break}ut?s.scale++:w=!0}else e==="E"||e==="e"?(y=!0,f!==""&&o.push(f),f=e):f+=e;else h!=="#"&&h!=="0"&&(o.push(f),f="#"),f!==""&&(o.push(f),f=""),s.intPart=o,o=[],p=!0,k=!1,w&&(s.group=!0,w=!1);h=e}return f!==""&&(y&&!b&&(s.exponent=n.___parseExponentFormat(f)),o.push(f)),w&&(s.group=!0),p?s.decPart=o:s.intPart=o,l===r||l===i?l=s:a===r||a===i?a=s:(v===r||v===i)&&(v=s),new ht(l,a,v)},n.___zeroPad=function(n,t,i){for(var r=n.length;r<t;r++)n=i?"0"+n:n+"0";return n},n.__insertGroupSeparator=function(n,i,r,u){for(var f=i[0],h=1,e=n.length-1,c=new o(""),s=0,l=!1;e>=0;){if(f<1||f>9)throw new Error(t.SR.Exp_InvalidNumberGroupSize);/\d/ig.test(n[e])?(l&&(c.insert(r,0),l=!1),s++):s=0;c.insert(n[e],0);s===f&&(l=!0,s=0,h<i.length&&(f=i[h],h++));e--}return c.toString()},n.___expandNumber=function(t,i,r,u,f,o,s){var y=e(10,i),v=st(t*y)/y,c,h,l,a;return isFinite(v)||(v=t),t=v,c=t.toString(),a=c.split(/e/i),c=a[0],l=a.length>1?parseInt(a[1],10):0,a=c.split("."),c=a[0],h=a.length>1?a[1]:"",l>0?(h=n.___zeroPad(h,l,!1),c+=h.slice(0,l),h=h.substr(l)):l<0&&(l=-l,c=t<0?o+n.___zeroPad(c.replace(o,""),l+1,!0):n.___zeroPad(c,l+1,!0),h=c.slice(-l,c.length)+h,c=c.slice(0,-l)),i>0?(h=h.length>i?h.slice(0,i):n.___zeroPad(h,i,!1),h=f+h):h="",s===!0?c+h:n.__insertGroupSeparator(c,r,u,o)+h},n.___formatNumber=function(t,r,f){var s=new o(""),c,h,l,v,d,b,g,k,y,it,a,rt,nt,dt,ut,ht,p,at,ft,vt,gt,et,ni,yt,pt,kt,w,lt;if(t=t*e(100,r.percent),t=t*e(1e3,r.permile),t=t/e(10,r.scale*3),c=r.intPart,h=r.decPart,!c&&!h)return"";if(l=i,v=i,c)for(l="",d=0;d<c.length;d++)b=c[d],/^(0|#)+/g.test(b)&&(l+=b);if(h)for(v="",g=0;g<h.length;g++)k=h[g],/^(0|#)+/g.test(k)&&(v+=k);if(l||v)v||(v="");else return(c?c.join(""):"")+(h?h.join(""):"");if(it=0,a=n.___getDigitLength(t,f.NumberDecimalSeparator),r.exponent)if(rt=u(t),nt=l?l.length:1,rt>=1)a.integer>nt?(a.integer-=nt,a.decimal+=nt,t=t/e(10,a.integer),it=a.integer):it=a.integer<nt?0:0,r.exponent.sign===-1&&(r.exponent.sign=0);else if(rt<1&&rt>0){for(r.exponent.sign=-1,a.integer=nt,a.decimal-=nt,dt=e(10,nt);rt*10<dt;)rt*=10,it++;t*=e(10,it)}var ot=v.lastIndexOf("0"),wt=v.lastIndexOf("#"),st=a.decimal;if(ot>=0&&(st=ot+1),wt>ot&&wt<a.decimal&&(st=wt+1),h||(st=0),ut=n.___expandNumber(t,st,f.NumberGroupSizes,f.NumberGroupSeparator,f.NumberDecimalSeparator,f.NegativeSign,!0),ut==="")return(c?c.join(""):"")+(h?h.join(""):"");if(ht=!1,c){p=ut.split(f.NumberDecimalSeparator)[0];at=p.substr(0,1);at===f.NegativeSign&&(p=p.substr(1));var tt=0,bt="",ct=l.indexOf("0"),ti=ct===-1?p.length:l.length-ct;for(d=c.length-1;d>=0;d--)if(b=c[d],/^(0|#)+/g.test(b))if(bt=b+bt,bt!==l){for(ft=b.length,vt=p.length-tt-1;vt>=0&&ft>0;vt--)gt=p.charAt(vt),s._insert(gt),ft--,tt++;tt>=p.length&&tt<ti&&ft>0&&(s._insert(new Array(ft+1).join("0")),tt+=ft)}else et=p.substr(0,p.length-tt),ct>=0&&ct<l.length-tt-et.length&&(et=new Array(l.length-tt-ct-et.length+1).join("0")+et),s._insert(et);else r.exponent&&!ht&&/^((E(\+|-)?|e(\+|-)?)\d+)/g.test(b)?(ht=!0,y="",y+=r.exponent.symbol,y+=n.___signs[r.exponent.sign],y+=n.___zeroPad(it.toString(),r.exponent.exp,!0),s._insert(y)):s._insert(b);at===f.NegativeSign&&s._insert(at);r.group===!0&&(ni=n.__insertGroupSeparator(s.toString(),f.NumberGroupSizes,f.NumberGroupSeparator,f.NegativeSign),s=new o(ni))}if(h)for(yt="",st>0?(pt=ut.indexOf(f.NumberDecimalSeparator),pt!==-1&&(yt=ut.substring(pt+1),l===""&&s.append(ut.substr(0,pt)),s.append(f.NumberDecimalSeparator))):/^(#+)$/ig.test(v)&&h.join("").length===v.length||(s.append(f.NumberDecimalSeparator),ot>0&&(yt=new Array(ot+1).join("0"))),kt=0,g=0;g<h.length;g++)k=h[g],/^(0|#)+/g.test(k)?(s.append(yt.substr(kt,k.length)),kt+=k.length):r.exponent&&!ht&&/^((E(\+|-)?|e(\+|-)?)\d+)/g.test(k)?(ht=!0,y="",y+=r.exponent.symbol,y+=n.___signs[r.exponent.sign],y+=n.___zeroPad(it.toString(),r.exponent.exp,!0),s.append(y)):s.append(k);return w=s.toString(),lt=w.indexOf("0."),lt>=0&&(lt+2==w.length?w=w.replace("0.","."):lt+2<w.length&&(/[0-9]+/g.test(w.charAt(lt+2))||(w=w.replace("0.",".")))),w},n.__parseNumberNegativePattern=function(n,t,i){var r=t.NegativeSign,u=t.PositiveSign,f=new a(n);if((i===4||i===2)&&(r=" "+r,u=" "+u),i===4||i===3){if(f.endsWith(r))return["-",n.substr(0,n.length-r.length)];else if(f.endsWith(u))return["+",n.substr(0,n.length-u.length)]}else if(i===2||i===1){if(f.startsWith(r))return["-",n.substr(r.length)];else if(f.startsWith(u))return["+",n.substr(u.length)]}else if(i===0){if(f.startsWith("(")&&f.endsWith(")"))return["-",n.substr(1,n.length-2)]}else throw new Error("");return["",n]},n.__parseNumber=function(t,u){var k,c,l,h,d,g,nt,f,tt,v,y,b;if(t=t!==r&&t!==i?new a(t).trim():"",t.match(/^[+-]?infinity$/i))return parseFloat(t);if(t.match(/^0x[a-f0-9]+$/i))return parseInt(t,10);var e=u.numberFormat,p=n.__parseNumberNegativePattern(t,e,e.NumberNegativePattern),w=p[0],s=p[1];return(w===""&&e.NumberNegativePattern!==1&&(p=n.__parseNumberNegativePattern(t,e,1),w=p[0],s=p[1]),w===""&&(w="+"),s[0]===e.CurrencySymbol&&(s=s.substr(1)),l=s.indexOf("e"),l<0&&(l=s.indexOf("E")),l<0?(c=s,k=i):(c=s.substr(0,l),k=s.substr(l+1)),g=c.indexOf(e.NumberDecimalSeparator),g<0?(h=c,d=i):(h=c.substr(0,g),d=c.substr(g+e.NumberDecimalSeparator.length)),h=h.split(e.NumberGroupSeparator).join(""),nt=e.NumberGroupSeparator.replace(/\u00A0/g," "),e.NumberGroupSeparator!==nt&&(h=h.split(nt).join("")),f=w+h,d!==i&&(f+="."+d),tt=f[f.length-1],tt===e.PercentSymbol&&(f=f.substr(0,f.length-1),f=new a(f).trimEnd(),v=f.indexOf(e.NumberDecimalSeparator),v===-1&&(v=f.length),y=new o(""),y.append(f.substr(0,v-2)),y.append(e.NumberDecimalSeparator),y.append(f.substr(v-2,2)),y.append(f.substr(v+1)),f=y.toString()),k!==i&&(b=n.__parseNumberNegativePattern(k,e,1),b[0]===""&&(b[0]="+"),f+="e"+b[0]+b[1]),f.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/))?parseFloat(f):NaN},n.___toHexString=function(f,e,o){if(u(s(f)-f)!==0)throw new Error(t.SR.Exp_BadFormatSpecifier);var h=f>=0?f.toString(16):(n.___maxInt32+f+1).toString(16);return(h=e?h.toLowerCase():h.toUpperCase(),o!==r&&o!==i&&h.length<o)?n.___zeroPad(h,o,!0):h},n.___toScientific=function(t,i,r,f,o,s,h){for(var c=0,l=t>=1||t===0,a,v;c<1e3;){if(a=e(10,c),l&&t/a<10||!l&&t*a>=1)break;c++}return t=l?u(t)/e(10,c):u(t)*e(10,c),v=n.___expandNumber(t,r,f,o,s,h),v+(i+(l?"+":"-")+n.___zeroPad(c.toString(),3,!0))},n.___signs={"1":"+","0":"","-1":"-"},n.___maxInt32=4294967295,n.___percentPositivePattern=["n %","n%","%n"],n.___percentNegativePattern=["-n %","-n%","-%n"],n.___numberNegativePattern=["(n)","-n","- n","n-","n -"],n.___currencyPositivePattern=["$n","n$","$ n","n $"],n.___currencyNegativePattern=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"],n}();t._NumberHelper=it;t._currentCulture;t.Culture=ct,function(){var f=$("meta[name='spreadjs culture']"),u;f.length>0&&(u=$(f[f.length-1]).attr("content"),u!==i&&u!=r&&u.toLowerCase()==="ja-jp"&&(n.spread.SR=n.spread._JPStringResource,t._currentCulture="ja-jp"))}();rt=function(){function n(){}return n._getCtx=function(){if(!n._ctx){var t=document.createElement("canvas");t.getContext&&(n._ctx=t.getContext("2d"))}return n._ctx},n._getWrapInfo=function(t,r,u){var v=[],f,e,s,h,o,y,c,l,a;if(t.length===0||(f=n._getCtx(),!f))return v;if(f.font=u,r<=0){for(e=-1,s=!0,h=0;h<t.length;h++)o=t.charAt(h),o===" "||s?o!==" "&&s&&(e=f.measureText(o).width,s=!1):e=et(e,f.measureText(o).width);r=e}for(y=t.split(/\r\n|\r|\n/),c=0;c<y.length;c++)if(l=n._getWrapInfoByWord(y[c],r),l!=i)for(a=0;a<l.length;a++)v.push(l[a]);return v},n._getTextWords=function(n){for(var f,e,t=[],i=0,o=" ",u=0;u<n.length;u++)t[i]===r&&(t[i]=""),f=n.charAt(u),e="",u+1<n.length&&(e=n.charAt(u+1)),f===o&&e!==o?(t[i]+=f,i++):t[i]+=f;return t},n._measureText=function(t,i){var r=n._getCtx();return r?(r.font!==i&&(r.font=i),r.measureText(t).width):0},n._measureTextWithoutEndSpaces=function(t,i){var r=n._getCtx(),u;return r?(i&&(r.font=i),u=n._removeEndSpace(t),r.measureText(u).width):0},n._removeEndSpace=function(n){for(var t=n.length-1;n.charAt(t)===" ";)t--;return t!==n.length-1&&(n=n.substring(0,t+1)),n},n._getWrapInfoByCharacter=function(t,r){var u=[],s=n._getCtx(),c,f,e,l,o;if(!s)return u;var a=s.measureText(t).width,v=a/t.length,h=ot(r/v);if(a>r)for(c=!1;;)if(f=t.substring(0,h),e=s.measureText(f).width,e==r||c&&e<r)return u.push(f),u.push(t.substring(f.length)),u;else if(e>r){if(f.length===1)return l=t.substring(f.length),n._measureTextWithoutEndSpaces(l)!==0?(u.push(f),u.push(l)):u.push(t),u;h-=1;c=!0}else o=(r-e)/v,o=o>=1?o:1,h+=o;else t!=i&&t.length>0&&u.push(t);return u},n._getWrapInfoByWord=function(t,i){var f=[],c=n._getTextWords(t),v=n._getCtx(),a,s,p,h;if(!v)return f;for(var w=v.measureText(t).width,b=w/t.length,k=parseInt(i/b+"",10),l=0,e=0,y=0,u=0,r=[],o=!1;u<c.length;){if(o===!1)if(a=c[u],r.push(a),e+=a.length,e<k){u++;continue}else y=e,e=0;s=n._measureTextWithoutEndSpaces(r.join(""));s>i?(p=r.pop(),r.length===0?(h=n._getWrapInfoByCharacter(p,i),r.push(h[0]),h.length===2?c[u]=h[1]:u++,f[l++]=r.join(""),o=!1,r=[]):(o=!0,u--)):s<i&&o===!0||s===i?(o=!1,f[l++]=n._removeEndSpace(r.join("")),r=[],u++):s<i&&(u++,e=y)}return r.length!==0&&(f[l]=n._removeEndSpace(r.join(""))),f},n}();t._WordWrapHelper=rt;ut=function(){function n(){}return n.IsNumber=function(n){return t.util.isType(n,"number")||t.util.isType(n,"DateTime")||t.util.isType(n,"TimeSpan")||n&&!t.util.isType(n,"boolean")&&!isNaN(n)},n.ToDouble=function(n){return n===i||n===r||n===""?0:t.util.isType(n,"number")?n:t.util.isType(n,"string")&&!isNaN(n)?it.parseLocale(n):t.util.isType(n,"boolean")?n?1:0:t.util.isType(n,"DateTime")?new w(n).toOADate():t.util.isType(n,"TimeSpan")?new w(n).TotalDays():parseFloat(n)},n.toString=function(n){try{return n===i||n===r?"":typeof n=="boolean"?n?"TRUE":"FALSE":typeof n=="string"?n:n.toString()}catch(t){return""}},n}();t.FormatConverter=ut})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(n){function u(t){var i;if(t instanceof f)return t;var r=0,u=0,e=0,o=0;return t&&t!==""&&(i=n.util.parseColorString(t),i&&(i.length===3?(r=255,u=i[0],e=i[1],o=i[2]):i.length===4&&(r=i[0],u=i[1],e=i[2],o=i[3]))),new f(r,u,e,o)}var e,i,r,l;n.feature("core.theme",["core.migrate","core.common"]);var o=Math.min,s=Math.max,f=function(){function n(n,t,i,r){var u=this;u.a=n;u.r=t;u.g=i;u.b=r}return n.prototype.toString=function(){var n=this;return n.a===255?"#"+n.getColorUnitString(n.r)+n.getColorUnitString(n.g)+n.getColorUnitString(n.b):"rgba("+n.r+","+n.g+","+n.b+","+n.a+")"},n.prototype.getBrightness=function(){return(this.r*299+this.g*587+this.b*114)/1e3},n.prototype.getColorUnitString=function(n){var t=n.toString(16);return t.length===1&&(t="0"+t),t},n.hueToRGB=function(n,t,i){return(i<0&&(i+=240),i>240&&(i-=240),i<40)?n+((t-n)*i+20)/40:i<120?t:i<160?n+((t-n)*(160-i)+20)/40:n},n.fromHLS=function(t,i,r){var e,o,s,f,u;return r===0?e=o=s=parseInt(i*255/240,10):(u=i<=120?(i*(240+r)+120)/240:i+r-(i*r+120)/240,f=2*i-u,e=parseInt((n.hueToRGB(f,u,t+80)*255+120)/240,10),o=parseInt((n.hueToRGB(f,u,t)*255+120)/240,10),s=parseInt((n.hueToRGB(f,u,t-80)*255+120)/240,10)),new n(255,e,o,s)},n.parse=function(n){return u(n)},n}();n._Color=f;e=function(){function n(n){var t=this,f=n.r,e=n.g,h=n.b,r=s(s(f,e),h),c=o(o(f,e),h),u=r+c,i;if(t.luminosity=parseInt((u*240+255)/510,10),i=r-c,i===0)t.saturation=0,t.hue=160;else{t.saturation=t.luminosity<=120?parseInt((i*240+u/2)/u,10):parseInt((i*240+(510-u)/2)/(510-u),10);var l=((r-f)*40+i/2)/i,a=((r-e)*40+i/2)/i,v=((r-h)*40+i/2)/i;t.hue=f===r?parseInt(v-a,10):e===r?parseInt(80+l-v,10):parseInt(160+a-l,10);t.hue<0&&(t.hue+=240);t.hue>240&&(t.hue-=240)}}return n.prototype.toColor=function(){return f.fromHLS(this.hue,this.luminosity,this.saturation)},n.prototype.getLighterColor=function(n){var t=this,i=t.luminosity,r=t.newLuma(t.luminosity,500,!0);return f.fromHLS(t.hue,i+(r-i)*n,t.saturation)},n.prototype.getDrakerColor=function(n){var t=this,i=t.newLuma(t.luminosity,-333,!0);return f.fromHLS(t.hue,i*(1-n),t.saturation)},n.prototype.newLuma=function(n,t,i){return t===0?n:i?t>0?(n*(1e3-t)+241*t)/1e3:n*(t+1e3)/1e3:(n+=t*240/1e3,n<0&&(n=0),n>240&&(n=240),n)},n}();n.HLSColor=e;var a=function(n,t){if(t===0)return n;var i=new e(n),r=parseInt(t>0?(240-i.luminosity)*t:i.luminosity*t,10);return f.fromHLS(i.hue,i.luminosity+r,i.saturation)},v=0,y=1,p=2,w=3,b=4,k=5,d=6,g=7,nt=8,tt=9,h=10,c=11,t=function(){function n(n,t,i,r,f,e,o,s,h,c,l,a,v){this._name=n;this._colorList=[u(r),u(f),u(t),u(i),u(e),u(o),u(s),u(h),u(c),u(l),u(a),u(v)]}return n.prototype.name=function(n){return arguments.length===0?this._name:(this._name=n,this)},n.prototype.background1=function(n){return this._property(v,arguments.length===0,n)},n.prototype.background2=function(n){return this._property(y,arguments.length===0,n)},n.prototype.textColor1=function(n){return this._property(p,arguments.length===0,n)},n.prototype.textColor2=function(n){return this._property(w,arguments.length===0,n)},n.prototype.accent1=function(n){return this._property(b,arguments.length===0,n)},n.prototype.accent2=function(n){return this._property(k,arguments.length===0,n)},n.prototype.accent3=function(n){return this._property(d,arguments.length===0,n)},n.prototype.accent4=function(n){return this._property(g,arguments.length===0,n)},n.prototype.accent5=function(n){return this._property(nt,arguments.length===0,n)},n.prototype.accent6=function(n){return this._property(tt,arguments.length===0,n)},n.prototype.hyperline=function(n){return this._property(h,arguments.length===0,n)},n.prototype.followedHyperline=function(n){return this._property(c,arguments.length===0,n)},n.prototype._property=function(n,t,i){return t?this._colorList[n]:(this._colorList[n]=u(i),this)},n.prototype.getColor=function(n){var t,i,u,r,f;if(n&&(t=n.split(" "),t)){if(i=-1,u=t.length,u>1){if(!t[0])return n;r=t[0].toLowerCase();r==="background"?i=parseInt(t[1],10)-1:r==="text"?i=parseInt(t[1],10)+1:r==="accent"&&(i=parseInt(t[1],10)+3)}else u===1&&(r=t[0].toLowerCase(),r==="hyperlink"?i=h:r==="followedhyperlink"&&(i=c));if(i>=0&&i<=11)return u>2?(f=parseInt(t[2],10)/100,a(this._colorList[i],f).toString()):this._colorList[i].toString()}return n},n.prototype.toJSON=function(){return{name:this._name,colorList:this._colorList}},n}();n.ThemeColor=t;i=function(){function n(){}return n.Default=new t("Default","#000000","#1F497D","#FFFFFF","#EEECE1","#4F81BD","#C0504D","#9BBB59","#8064A2","#4BACC6","#F79646","#0000FF","#800080"),n.Office=new t("Office","#000000","#1F497D","#FFFFFF","#EEECE1","#4F81BD","#C0504D","#9BBB59","#8064A2","#4BACC6","#F79646","#0000FF","#800080"),n.Apex=new t("Apex","#000000","#69676D","#FFFFFF","#C9C2D1","#CEB966","#9CB084","#6BB1C9","#6585CF","#7E6BC9","#A379BB","#410082","#932968"),n.Aspect=new t("Aspect","#000000","#323232","#FFFFFF","#E3DED1","#F07F09","#9F2936","#1B587C","#4E8542","#604878","#C19859","#6B9F25","#B26B02"),n.Concourse=new t("Concourse","#000000","#464646","#FFFFFF","#DEF5FA","#2DA2BF","#DA1F28","#EB641B","#39639D","#474B78","#7D3C4A","#FF8119","#44B9E8"),n.Civic=new t("Civic","#000000","#646B86","#FFFFFF","#C5D1D7","#D16349","#CCB400","#8CADAE","#8C7B70","#8FB08C","#D19049","#00A3D6","#694F07"),n.Oriel=new t("Oriel","#000000","#575F6D","#FFFFFF","#FFF39D","#FE8637","#7598D9","#B32C16","#F5CD2D","#AEBAD5","#777C84","#D2611C","#3B435B"),n.Origin=new t("Origin","#000000","#464653","#FFFFFF","#DDE9EC","#727CA3","#9FB8CD","#D2DA7A","#FADA7A","#B88472","#8E736A","#B292CA","#6B5680"),n.Paper=new t("Paper","#000000","#444D26","#FFFFFF","#FEFAC9","#A5B592","#F3A447","#E7BC29","#D092A7","#9C85C0","#809EC2","#8E58B6","#7F6F6F"),n.Solstice=new t("Solstice","#000000","#4F271C","#FFFFFF","#E7DEC9","#3891A7","#FEB80A","#C32D2E","#84AA33","#964305","#475A8D","#8DC765","#AA8A14"),n.Technic=new t("Technic","#000000","#3B3B3B","#FFFFFF","#D4D2D0","#6EA0B0","#CCAF0A","#8D89A4","#748560","#9E9273","#7E848D","#00C8C3","#A116E0"),n.Trek=new t("Trek","#000000","#4E3B30","#FFFFFF","#FBEEC9","#F0A22E","#A5644E","#B58B80","#C3986D","#A19574","#C17529","#AD1F1F","#FFC42F"),n.Urban=new t("Urban","#000000","#424456","#FFFFFF","#DEDEDE","#53548A","#438086","#A04DA3","#C4652D","#8B5D3D","#5C92B5","#67AFBD","#C2A874"),n.Verve=new t("Verve","#000000","#666666","#FFFFFF","#D2D2D2","#FF388C","#E40059","#9C007F","#68007F","#005BD3","#00349E","#17BBFD","#FF79C2"),n.Equity=new t("Equity","#000000","#696464","#FFFFFF","#E9E5DC","#D34817","#9B2D1F","#A28E6A","#956251","#918485","#855D5D","#CC9900","#96A9A9"),n.Flow=new t("Flow","#000000","#04617B","#FFFFFF","#DBF5F9","#0F6FC6","#009DD9","#0BD0D9","#10CF9B","#7CCA62","#A5C249","#E2D700","#85DFD0"),n.Foundry=new t("Foundry","#000000","#676A55","#FFFFFF","#EAEBDE","#72A376","#B0CCB0","#A8CDD7","#C0BEAF","#CEC597","#E8B7B7","#DB5353","#903638"),n.Median=new t("Median","#000000","#775F55","#FFFFFF","#EBDDC3","#94B6D2","#DD8047","#A5AB81","#D8B25C","#7BA79D","#968C8C","#F7B615","#704404"),n.Metro=new t("Metro","#000000","#4E5B6F","#FFFFFF","#D6ECFF","#7FD13B","#EA157A","#FEB80A","#00ADDC","#738AC8","#1AB39F","#EB8803","#5F7791"),n.Module=new t("Module","#000000","#5A6378","#FFFFFF","#D4D4D6","#F0AD00","#60B5CC","#E66C7D","#6BB76D","#E88651","#C64847","#168BBA","#680000"),n.Opulent=new t("Opulent","#000000","#B13F9A","#FFFFFF","#F4E7ED","#B83D68","#AC66BB","#DE6C36","#F9B639","#CF6DA4","#FA8D3D","#FFDE66","#D490C5"),n}();n.ThemeColors=i;r=function(){function n(n,i,r,u){var f=this;f._name=n;f._themeColor=i?i:new t(n);f._headingFont=r;f._bodyFont=u}return n.prototype.name=function(n){return arguments.length===0?this._name:(this._name=n,this)},n.prototype.colors=function(n){return arguments.length===0?this._themeColor:(this._themeColor=n,this)},n.prototype.headerFont=function(n){return arguments.length===0?this._headingFont:(this._headingFont=n,this)},n.prototype.bodyFont=function(n){return arguments.length===0?this._bodyFont:(this._bodyFont=n,this)},n.prototype.getColor=function(n){return this._themeColor.getColor(n)},n.prototype.getFont=function(n){if(n==="Body")return this.bodyFont();else if(n==="Headings")return this.headerFont();return n},n.prototype.toJSON=function(){var n=this;return{name:n._name,themeColor:n._themeColor?n._themeColor.toJSON():undefined,headingFont:n._headingFont,bodyFont:n._bodyFont}},n}();n.SpreadTheme=r;l=function(){function n(){}return n.Default=new r("Default",i.Default,"Cambria","Calibri"),n.Office=new r("Office",i.Office,"Cambria","Calibri"),n.Apex=new r("Apex",i.Apex,"Lucida Sans","Book Antiqua"),n.Aspect=new r("Aspect",i.Aspect,"Verdana","Verdana"),n.Concourse=new r("Concourse",i.Concourse,"Lucida Sans Unicode","Lucida Sans Unicode"),n.Civic=new r("Civic",i.Civic,"Georgia","Georgia"),n.Oriel=new r("Oriel",i.Oriel,"Century Schoolbook","Century Schoolbook"),n.Origin=new r("Origin",i.Origin,"Bookman Old Style","Gill Sans MT"),n.Paper=new r("Paper",i.Paper,"Constantia","Constantia"),n.Solstice=new r("Solstice",i.Solstice,"Gill Sans MT","Gill Sans MT"),n.Technic=new r("Technic",i.Technic,"Franklin Gothic Book","Arial"),n.Trek=new r("Trek",i.Trek,"Franklin Gothic Medium","Franklin Gothic Book"),n.Urban=new r("Urban",i.Urban,"Trebuchet MS","Georgia"),n.Verve=new r("Verve",i.Verve,"Century Gothic","Century Gothic"),n.Equity=new r("Equity",i.Equity,"Franklin Gothic Book","Perpetua"),n.Flow=new r("Flow",i.Flow,"Calibri","Constantia"),n.Foundry=new r("Foundry",i.Foundry,"Rockwell","Rockwell"),n.Median=new r("Median",i.Median,"Tw Cen MT","Tw Cen MT"),n.Metro=new r("Metro",i.Metro,"Consolas","Corbel"),n.Module=new r("Module",i.Module,"Corbel","Corbel"),n.Opulent=new r("Opulent",i.Opulent,"Trebuchet MS","Trebuchet MS"),n}();n.SpreadThemes=l})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(t){var ht,ti,ii,ct,w;t.feature("core.spreadpanelex",["core.common"]);var r=null,s="undefined",b="scroll-container",lt="scroll-outContainer",e="scroll-arrow",h="scrollbar-wrapper",k="scroll-bar",rt="scroll-arrowUp",ut="scroll-arrowDown",ft="scroll-arrowLeft",et="scroll-arrowRight",ot="scrollbar-vertical",st="scrollbar-horizontal",d="scrollbar-none-user-select",at="scroll-horizontal",vt="scroll-vertical",yt="scroll-content-wrapper",pt="scroll-panel-container",wt="scroll-temp-content-wrapper",c="width",l="height",g="left",bt="right",a="top",kt="bottom",dt="margin-left",gt="margin-top",i=".gcScrollbar",v="mousedown"+i,o="mouseup"+i,nt="mousemove"+i,tt="mouseover"+i,it="mouseout"+i,y="mousewheel",p="DOMMouseScroll",it="mouseout"+i,ni="keydown"+i,u="scroll"+i,f={addHandler:function(n,t,i){n.addEventListener&&n.addEventListener(t,i,!1)},removeHandler:function(n,t,i){n.removeEventListener&&n.removeEventListener(t,i,!1)}};(function(n){n[n.pixels=0]="pixels";n[n.continuous=1]="continuous"})(t.ScrollType||(t.ScrollType={}));ht=t.ScrollType,function(n){n[n.horizontalScroll=0]="horizontalScroll";n[n.verticalScroll=1]="verticalScroll"}(t.ScrollOrientation||(t.ScrollOrientation={}));ti=t.ScrollOrientation,function(n){n[n.smallDecrement=0]="smallDecrement";n[n.smallIncrement=1]="smallIncrement";n[n.largeDecrement=2]="largeDecrement";n[n.largeIncrement=3]="largeIncrement";n[n.thumbPosition=4]="thumbPosition";n[n.thumbTrack=5]="thumbTrack";n[n.endScroll=8]="endScroll"}(t.ScrollEventType||(t.ScrollEventType={}));ii=t.ScrollEventType;ct=function(){function n(n,t){var i=this;i._showHorizontalScrollbar=!0;i._showVerticalScrollbar=!0;i._useWijmoTheme=!1;i._hSmallChange=10;i._vSmallChange=10;i._defaultScrollbarSize=18;i._superPanel=n;i._content=t;i.refreshLayout(!0)}return n.prototype.content=function(n){var t=this;return arguments.length===0?t._content:(n instanceof HTMLElement&&t._content!==n&&(t._content=n,t.refreshLayout(!0)),t)},n.prototype.superPanel=function(n){var t=this;return arguments.length===0?t._superPanel:(n instanceof HTMLElement&&t._superPanel!==n&&(t._superPanel=n,t.refreshLayout(!0)),t)},n.prototype.horizontalSmallChange=function(n){var t=this;return arguments.length===0?t._hSmallChange:(typeof n=="number"&&t._hSmallChange!==n&&(t._hSmallChange=n),t)},n.prototype.verticalSmallChange=function(n){var t=this;return arguments.length===0?t._vSmallChange:(typeof n=="number"&&t._vSmallChange!==n&&(t._vSmallChange=n),t)},n.prototype.showHorizontalScrollbar=function(){return this._showHorizontalScrollbar},n.prototype.showVerticalScrollbar=function(){return this._showVerticalScrollbar},n.prototype.refreshLayout=function(n){var t=this,s,v,h,rt,b,e,ut,ft,k,o,et;if(t._superPanel&&t._content){var c=$(t._superPanel),d=$(t._content),i=t._defaultScrollbarSize,g=d.width(),nt=d.height(),l=c.width(),a=c.height(),r=l-i,f=a-i,tt=!1;t._container||(t._container=document.createElement("div"),$(t._container).addClass(pt),tt=!0);s=$(t._container);s.css({width:l,height:a});t._contentWrapper||(t._contentWrapper=document.createElement("div"),$(t._contentWrapper).addClass(yt),s.append(t._contentWrapper));v=$(t._contentWrapper);t._tempContentWrapper||(t._tempContentWrapper=document.createElement("div"),$(t._tempContentWrapper).addClass(wt),v.append(t._tempContentWrapper));h=$(t._tempContentWrapper);n&&h.append(t._content);h.css({top:0,left:0});var it=t._isNeedScrollbars(g,nt,l,a),y=it.isNeedVScroll,p=it.isNeedHScroll;p?(y||(r+=i),t._hScrollbar||(t._hScrollbar=new w(!0),rt=t._hScrollbar.getScrollbar(),t._hbarContainer=document.createElement("div"),b=$(t._hbarContainer),b.addClass(at),b.append(rt),s.append(t._hbarContainer)),$(t._hbarContainer).css({width:r,height:i}),e=t._hScrollbar,ut=$(t._hScrollbar.getScrollbar()),e.width(r),e.height(i),e.minimum(0),e.maximum(g-r),e.pageValue(r),e.smallChange(t.horizontalSmallChange()),e.largeChange(r),e.refreshLayout(),ut.bind(u,function(n,t){h.css("left",0-t.newValue)}),$(t._hbarContainer).show(),t._showHorizontalScrollbar=!0):(t._hbarContainer&&$(t._hbarContainer).hide(),t._showHorizontalScrollbar=!1);y?(p||(f+=i),t._vScrollbar||(t._vScrollbar=new w(!1),ft=t._vScrollbar.getScrollbar(),t._vbarContainer=document.createElement("div"),k=$(t._vbarContainer),k.addClass(vt),k.append(ft),s.append(t._vbarContainer)),$(t._vbarContainer).css({width:i,height:f}),o=t._vScrollbar,et=$(t._vScrollbar.getScrollbar()),o.width(i),o.height(f),o.minimum(0),o.maximum(nt-f),o.pageValue(f),o.smallChange(t.verticalSmallChange()),o.largeChange(f),o.refreshLayout(),et.bind(u,function(n,t){h.css("top",0-t.newValue)}),$(t._vbarContainer).show(),t._showVerticalScrollbar=!0):(t._vbarContainer&&$(t._vbarContainer).hide(),t._showVerticalScrollbar=!1);p||y||(r+=i,f+=i);t._pageWidth=r;t._pageHeight=f;v.css({width:r,height:f});tt&&(c.append(t._container),t._initEvent())}},n.prototype.scrollChildIntoView=function(n){var t=this,i=t._getScrollOffset(n),u=i.left,f=i.top;u!==r&&t.hScrollTo(u);f!==r&&t._vScrollbar&&t.vScrollTo(f)},n.prototype.hScrollTo=function(n){var t=this,i,r;t._hScrollbar.value(n);i=t._pageWidth;r=$(t._content).width();n>=0&&n<=r-i&&$(t._tempContentWrapper).css(g,0-n)},n.prototype.useWijmoTheme=function(n){var t=this,i,r;return arguments.length===0?t._useWijmoTheme:(typeof n=="boolean"&&t._useWijmoTheme!==n&&(t._useWijmoTheme=n,i=t._hScrollbar,r=t._vScrollbar,i&&i.useWijmoTheme(n),r&&r.useWijmoTheme(n)),t)},n.prototype.vScrollTo=function(n){var t=this,i,r;t._vScrollbar.value(n);i=t._pageHeight;r=$(t._content).height();n>=0&&n<=r-i&&$(t._tempContentWrapper).css(a,0-n)},n.prototype._isNeedScrollbars=function(n,t,i,r){var f=this._defaultScrollbarSize,e=i-f,o=r-f,u={isNeedHScroll:!1,isNeedVScroll:!1};return n>i&&(u.isNeedHScroll=!0,u.isNeedVScroll=t>o?!0:!1),t>r&&(u.isNeedVScroll=!0,u.isNeedHScroll=n>e?!0:!1),n>e&&t>o&&(u.isNeedVScroll=!0,u.isNeedHScroll=!0),u},n.prototype._getScrollOffset=function(n){var h=$(n),f=$(this._contentWrapper),a=$(this._tempContentWrapper),t,e,i,o,c,s,l,u={left:r,top:r};return n?(t=h.offset(),e=a.offset(),i=f.offset(),t.leftWidth=t.left+h.outerWidth(),t.topHeight=t.top+h.outerHeight(),i.leftWidth=i.left+f.outerWidth(),i.topHeight=i.top+f.outerHeight(),o=t.left-e.left,t.left<i.left?u.left=o:t.leftWidth>i.leftWidth&&(c=t.leftWidth-e.left-f.innerWidth(),u.left=o<c?o:c),s=t.top-e.top,t.top<i.top?u.top=s:t.topHeight>i.topHeight&&(l=t.topHeight-e.top-f.innerHeight(),u.top=s<l?s:l),u):u},n.prototype._initEvent=function(){var n=this;this._tempContentWrapper&&(n._mousewheelHandler=function(t){n._contentContainerMousewheel(t)},f.addHandler(n._tempContentWrapper,y,n._mousewheelHandler),f.addHandler(n._tempContentWrapper,p,n._mousewheelHandler))},n.prototype._contentContainerMousewheel=function(n){var u=this,i;(typeof n.wheelDelta===s||n.wheelDelta===r)&&(typeof n.detail===s||n.detail===r)&&(n.wheelDelta=n.originalEvent.wheelDelta,n.detail=n.originalEvent.detail);var h=n.detail?n.detail:n.wheelDelta/-40,c=h,l=u._vScrollbar,f=parseInt($(u._tempContentWrapper).css(a)),e=u._pageHeight,o=$(u._content).height();o<e&&(o=e);isNaN(f)&&(f=0);i=f-c*u.verticalSmallChange();i>=0&&(i=0);i<0&&0-i>o-e&&(i=0-(o-e));i!==f&&($(u._tempContentWrapper).css(a,i),u._showVerticalScrollbar&&l.value(0-i));t.util.cancelDefault(n)},n.prototype.dispose=function(){var n=this;n._container&&(n._hScrollbar&&n._hScrollbar.dispose(),n._vScrollbar&&n._vScrollbar.dispose(),n._tempContentWrapper&&n._mousewheelHandler&&(f.removeHandler(n._tempContentWrapper,y,n._mousewheelHandler),f.removeHandler(n._tempContentWrapper,p,n._mousewheelHandler)),$(n._container).remove())},n}();t.ScrollablePanel=ct;w=function(){function w(n,t,i,u,f,e,o){var s=this;s._pageValue=10;s._maximum=100;s._minimum=0;s._value=0;s._largeChange=10;s._smallChange=1;s._scrollType=1;s._useWijmoTheme=!1;s._scrollPosition=0;s._isMousedownInScrollbar=!1;s._scrollTimeOutArrow=r;s._scrollTimeOutContainer=r;s._initialDelay=300;s._trackClickPepeatFreq=70;s._isHorizontalScroll=n;s._width=typeof t=="number"?t:0;s._height=typeof i=="number"?i:0;s._pageValue=typeof u=="number"?u:0;s._maximum=typeof f=="number"?f:0;s._minimum=typeof e=="number"?e:0;s._scrollType=typeof o=="number"?o:1;s._isMouseCapture=!1;s._scrollPosition=0;s._value=s._minimum;s.refreshLayout()}return w.prototype.getScrollbar=function(){return this._scrollContainerDiv},w.prototype.smallChange=function(n){var t=this;return arguments.length===0?t._smallChange:(typeof n=="number"&&t._smallChange!==n&&(t._smallChange=n),t)},w.prototype.largeChange=function(n){var t=this;return arguments.length===0?t._largeChange:(typeof n=="number"&&t._largeChange!==n&&(t._largeChange=n),t)},w.prototype.pageValue=function(n){var t=this;return arguments.length===0?t._pageValue:(typeof n=="number"&&t._pageValue!==n&&(n<=0&&(n=1),t._pageValue=n),t)},w.prototype.maximum=function(n){var t=this;return arguments.length===0?t._maximum:(typeof n=="number"&&t._maximum!==n&&(n<=0&&(n=0),t._maximum=n),t)},w.prototype.minimum=function(n){var t=this;return arguments.length===0?t._minimum:(typeof n=="number"&&t._minimum!==n&&(n<=0&&(n=0),t._minimum=n),t)},w.prototype.value=function(n){var t=this,i;return arguments.length===0?t._value:(typeof n=="number"&&n<=t._maximum&&n>=t._minimum&&(t._value=n,i=(n-t._minimum)*t._scrollUnit,t.scrollTo(i,!1,!0)),t)},w.prototype.width=function(n){var t=this;return arguments.length===0?t._width:(typeof n=="number"&&t._width!==n&&(t._width=n),t)},w.prototype.height=function(n){var t=this;return arguments.length===0?t._height:(typeof n=="number"&&t._height!==n&&(t._height=n),t)},w.prototype.scrollType=function(n){var t=this;return arguments.length===0?t._scrollType:(typeof ht[n]!==s&&t._scrollType!==n&&(t._scrollType=n),t)},w.prototype.useWijmoTheme=function(n){var t=this;if(arguments.length===0)return t._useWijmoTheme;if(typeof n=="boolean"&&t._useWijmoTheme!==n){t._useWijmoTheme=n;var i=ft,r=et,u=st,f="wijmo-wijsuperpanel-hbarcontainer ui-widget-header ui-corner-bottom",o="ui-state-default ui-corner-bl",s="ui-icon ui-icon-triangle-1-w",c="scroll-handle ui-state-default ui-corner-all ui-draggable",l="ui-icon ui-icon-grip-solid-vertical",a="ui-state-default ui-corner-br",v="ui-icon ui-icon-triangle-1-e";t._isHorizontalScroll||(i=rt,r=ut,u=ot,f="wijmo-wijsuperpanel-vbarcontainer ui-widget-header ui-corner-right",o="ui-state-default ui-corner-tr",s="ui-icon ui-icon-triangle-1-n",c="scroll-handle ui-state-default ui-corner-all ui-draggable",l="ui-icon ui-icon-grip-solid-horizontal",a="ui-state-default ui-corner-br",v="ui-icon ui-icon-triangle-1-s");n?($(t._scrollContainerDiv).removeClass(b).addClass(f),$(t._arrowStartDiv).removeClass(e).addClass(o),$(t._arrowStartSpan).removeClass(i).addClass(s),$(t._scrollbarWrapperDiv).removeClass(h).addClass(h),$(t._scrollbarDiv).removeClass(k).addClass(c),$(t._scrollbarSpan).removeClass(u).addClass(l),$(t._arrowEndDiv).removeClass(e).addClass(a),$(t._arrowEndSpan).removeClass(r).addClass(v)):($(t._scrollContainerDiv).removeClass(f).addClass(b),$(t._arrowStartDiv).removeClass(o).addClass(e),$(t._arrowStartSpan).removeClass(s).addClass(i),$(t._scrollbarWrapperDiv).removeClass(h).addClass(h),$(t._scrollbarDiv).removeClass(c).addClass(k),$(t._scrollbarSpan).removeClass(l).addClass(u),$(t._arrowEndDiv).removeClass(a).addClass(e),$(t._arrowEndSpan).removeClass(v).addClass(r))}return t},w.prototype.refreshLayout=function(){var n=this,f=n._height,o=n._width,t=f,y=o-2*f,p=t,s=g,it=bt,w=0,nt=0,ht=!1,i=2,ct=ft,at=et,vt=st,yt=dt,u,v,r,tt;n._isHorizontalScroll?n._scrollSize=y:(t=o,y=t,p=f-2*o,s=a,it=kt,n._scrollSize=p,ct=rt,at=ut,vt=ot,yt=gt);u=n._scrollSize;n._scrollbarSize=n._pageValue*u/(n._maximum-n._minimum+n._pageValue);n._scrollbarSize>u&&(n._scrollbarSize=u);n._scrollbarSize<10&&(n._scrollbarSize=10);v=n._scrollbarSize;n._scrollUnit=(u-v)/(n._maximum-n._minimum);n._isHorizontalScroll?(w=v,nt=t):(w=t,nt=v);n._scrollContainerDiv||(ht=!0,n._scrollContainerDiv=document.createElement("div"),$(n._scrollContainerDiv).css({position:"relative",left:0,top:0,overflow:"hidden",outline:"none"}).addClass(b).addClass(lt));r=$(n._scrollContainerDiv);r.css(c,o).css(l,f);n._arrowStartDiv||(n._arrowStartDiv=document.createElement("div"),$(n._arrowStartDiv).css({position:"absolute",display:"inline-block"}).addClass(e),n._arrowStartSpan=document.createElement("span"),$(n._arrowStartSpan).addClass(ct),$(n._arrowStartDiv).append(n._arrowStartSpan),r.append(n._arrowStartDiv));$(n._arrowStartDiv).css(s,0).css(c,t-i).css(l,t-i);$(n._arrowStartSpan).css({width:"100%",height:"100%",display:"block"});n._scrollbarWrapperDiv||(n._scrollbarWrapperDiv=document.createElement("div"),$(n._scrollbarWrapperDiv).css({position:"absolute",display:"inline-block"}).addClass(h),r.append(n._scrollbarWrapperDiv));tt=$(n._scrollbarWrapperDiv);tt.css(s,t).css(c,y).css(l,p);n._scrollbarDiv||(n._scrollbarDiv=document.createElement("div"),$(n._scrollbarDiv).css({position:"absolute"}).addClass(k).addClass(d),n._scrollbarSpan=document.createElement("span"),$(n._scrollbarSpan).addClass(vt),$(n._scrollbarDiv).append(n._scrollbarSpan),tt.append(n._scrollbarDiv));$(n._scrollbarDiv).css(s,n._scrollPosition).css(c,w-i).css(l,nt-i);$(n._scrollbarSpan).css({width:t-i,height:t-i,display:"block"});$(n._scrollbarSpan).css(yt,(n._scrollbarSize-t)/2);n._arrowEndDiv||(n._arrowEndDiv=document.createElement("div"),$(n._arrowEndDiv).css({position:"absolute",display:"inline-block"}).addClass(e),n._arrowEndSpan=document.createElement("span"),$(n._arrowEndSpan).addClass(at),$(n._arrowEndDiv).append(n._arrowEndSpan),r.append(n._arrowEndDiv));$(n._arrowEndDiv).css(it,0).css(c,t-i).css(l,t-i);$(n._arrowEndSpan).css({width:"100%",height:"100%",display:"block"});ht&&(r.attr("tabindex")||r.attr("tabindex",-1),n._initEvents())},w.prototype._initEvents=function(){var r=this;$(r._arrowStartDiv).bind(v,function(n){r._arrowMousedown(n,!0)}).bind(o,function(n){r._arrowMouseup(n,!0)}).bind(tt,function(n){r._arrowMouseover(n,!0)}).bind(it,function(n){r._arrowMouseout(n,!0)});$(r._arrowEndDiv).bind(v,function(n){r._arrowMousedown(n,!1)}).bind(o,function(n){r._arrowMouseup(n,!1)}).bind(tt,function(n){r._arrowMouseover(n,!1)}).bind(it,function(n){r._arrowMouseout(n,!1)});$(r._scrollbarDiv).bind(v,function(n){r._scrollbarMousedown(n)}).bind(nt,function(n){r._scrollbarMousemove(n)}).bind(o,function(n){r._scrollbarMouseup(n)}).bind(tt,function(n){r._scrollbarMouseover(n)}).bind(it,function(n){r._scrollbarMouseout(n)});$(r._scrollbarWrapperDiv).bind(v,function(n){r._scrollbarContainerMousedown(n)}).bind(o,function(n){r._scrollbarContainerMouseup(n)});r._mousewheelHandler=function(n){r._scrollContainerMousewheel(n)};f.addHandler(r._scrollContainerDiv,y,r._mousewheelHandler);f.addHandler(r._scrollContainerDiv,p,r._mousewheelHandler);$(r._scrollContainerDiv).bind(ni,function(n){r._scrollContainerKeydown(n)});t.features.touch&&(r._simulateMouseEvents=new n.spread._SimulateMouseEvents,r._simulateMouseEvents.bindUnBindTouchEvents(r._scrollContainerDiv,!0,i))},w.prototype.dispose=function(){var n=this,t=n._scrollContainerDiv;n._arrowEndDiv&&$(n._arrowEndDiv).unbind(i);n._scrollbarDiv&&$(n._scrollbarDiv).unbind(i);n._arrowStartDiv&&$(n._arrowStartDiv).unbind(i);n._scrollbarWrapperDiv&&$(n._scrollbarWrapperDiv).unbind(i);t&&(n._mousewheelHandler&&(f.removeHandler(t,y,n._mousewheelHandler),f.removeHandler(t,p,n._mousewheelHandler)),n._simulateMouseEvents&&n._simulateMouseEvents.bindUnBindTouchEvents(n._scrollContainerDiv,!1,i),$(t).removeAttr("tabindex").unbind(i).remove())},w.prototype._handleDocumentMouseMove=function(){var n=this;n._isMouseCapture||($(document).bind(nt,function(t){n._scrollbarMousemove(t)}).bind(o,function(t){n._scrollbarMouseup(t)}),n._isMouseCapture=!0)},w.prototype._unhandleDocumentMouseMove=function(){this._isMouseCapture&&(this._isMouseCapture=!1,$(document).unbind(nt).unbind(o))},w.prototype._arrowMousedown=function(n,t){var r=0,i=this,f=!0,u;i._scrollTimeOutArrow===null&&(t?(i._useWijmoTheme?$(i._arrowStartDiv).addClass("ui-state-active"):$(i._arrowStartDiv).addClass("scrollbar-stateActive"),r=0-i._smallChange*i._scrollUnit,i._scrollEventType=0):(i._useWijmoTheme?$(i._arrowEndDiv).addClass("ui-state-active"):$(i._arrowEndDiv).addClass("scrollbar-stateActive"),r=i._smallChange*i._scrollUnit,i._scrollEventType=1),u=function(){i.scrollTo(i._scrollPosition+r,!0);i._scrollType===1&&(i._scrollTimeOutArrow=setTimeout(u,f?i._initialDelay:i._trackClickPepeatFreq));f=!1},u())},w.prototype._arrowMouseup=function(n,t){var i=this,r=$(i._arrowStartDiv);t||(r=$(i._arrowEndDiv));i._useWijmoTheme?r.removeClass("ui-state-active"):r.removeClass("scrollbar-stateActive");i._endArrowScroll()},w.prototype._arrowMouseover=function(n,t){var i=this,r=$(i._arrowStartDiv);t||(r=$(i._arrowEndDiv));i._useWijmoTheme?r.addClass("ui-state-hover"):r.addClass("scrollbar-stateHover")},w.prototype._arrowMouseout=function(n,t){var i=this,r=$(i._arrowStartDiv);t||(r=$(i._arrowEndDiv));i._useWijmoTheme?r.removeClass("ui-state-hover").removeClass("ui-state-active"):r.removeClass("scrollbar-stateHover").removeClass("scrollbar-stateActive");i._endArrowScroll()},w.prototype._scrollbarMousedown=function(n){var t=this;if(n.button===0){t._isMousedownInScrollbar=!0;t._oldPosition={x:n.pageX,y:n.pageY};t._handleDocumentMouseMove();t._useWijmoTheme?$(t._scrollbarDiv).addClass("ui-state-active"):$(t._scrollbarDiv).addClass("scrollbar-stateActive");var i=$(t._scrollbarDiv).offset(),u=$(t._scrollbarDiv).outerWidth(!0),f=$(t._scrollbarDiv).outerHeight(!0),r=$(t._scrollbarWrapperDiv).offset(),e=$(t._scrollbarWrapperDiv).outerWidth(!0),o=$(t._scrollbarWrapperDiv).outerHeight(!0);t._edgePosition={isBeyondEdge:!1,startEdgePosition:{x:r.left+n.pageX-i.left,y:r.top+n.pageY-i.top},endEdgePosition:{x:r.left+e-(u-n.pageX+i.left),y:r.top+o-(f-n.pageY+i.top)}}}},w.prototype._scrollbarMousemove=function(n){var t=this;t._isMousedownInScrollbar&&(t._currentPosition={x:n.pageX,y:n.pageY},t._scrollbarDrag(),t._oldPosition=t._currentPosition,$(document.body).addClass(d))},w.prototype._scrollbarMouseup=function(n){var t=this,i;t._isMousedownInScrollbar=!1;t._scrollEventType=4;t._edgePosition=null;i={newValue:t._value,oldValue:t._value,scrollOrientation:t._isHorizontalScroll?0:1,scrollEventType:t._scrollEventType};$(t._scrollContainerDiv).trigger(u,i);var e=t._value,r=(e-t._minimum)*t._scrollUnit,f="left";t._isHorizontalScroll||(f="top");t._scrollPosition=r;$(t._scrollbarDiv).css(f,r);t._unhandleDocumentMouseMove();$(document.body).removeClass(d);t._useWijmoTheme?$(t._scrollbarDiv).removeClass("ui-state-active"):$(t._scrollbarDiv).removeClass("scrollbar-stateActive");t._scrollEventType=8;i={newValue:t._value,oldValue:t._value,scrollOrientation:t._isHorizontalScroll?0:1,scrollEventType:t._scrollEventType};$(t._scrollContainerDiv).trigger(u,i)},w.prototype._scrollbarMouseover=function(n){this._useWijmoTheme?$(this._scrollbarDiv).addClass("ui-state-hover"):$(this._scrollbarDiv).addClass("scrollbar-stateHover")},w.prototype._scrollbarMouseout=function(n){this._useWijmoTheme?$(this._scrollbarDiv).removeClass("ui-state-hover"):$(this._scrollbarDiv).removeClass("scrollbar-stateHover")},w.prototype._scrollContainerMousewheel=function(n){var i=this,e,f,o;(typeof n.wheelDelta===s||n.wheelDelta===r)&&(typeof n.detail===s||n.detail===r)&&(n.wheelDelta=n.originalEvent.wheelDelta,n.detail=n.originalEvent.detail);e=n.detail?n.detail:n.wheelDelta/-40;f=e/3*i._smallChange*i._scrollUnit;i._scrollEventType=f>=0?1:0;i.scrollTo(i._scrollPosition+f,!0);i._scrollEventType=8;o={newValue:i._value,oldValue:i._value,scrollOrientation:i._isHorizontalScroll?0:1,scrollEventType:i._scrollEventType};$(i._scrollContainerDiv).trigger(u,o);t.util.cancelDefault(n)},w.prototype._scrollContainerKeydown=function(n){var t=this,e=n.shiftKey,o=n.keyCode,i=0,f=t._scrollPosition,r=f,s;t._isHorizontalScroll?(o===37&&(i=t._calcMovingOffsetByKeydown(e,"left"),r=f-i),o===39&&(i=t._calcMovingOffsetByKeydown(e,"right"),r=f+i)):(o===38&&(i=t._calcMovingOffsetByKeydown(e,"top"),r=f-i),o===40&&(i=t._calcMovingOffsetByKeydown(e,"bottom"),r=f+i));r!==t._scrollPosition&&t.scrollTo(r,!0);t._scrollEventType=8;s={newValue:t._value,oldValue:t._value,scrollOrientation:t._isHorizontalScroll?0:1,scrollEventType:t._scrollEventType};$(t._scrollContainerDiv).trigger(u,s)},w.prototype._scrollbarContainerMousedown=function(n){var t=this,u=!0,f=n.pageX,e=n.pageY,i=0,o=$(t._scrollbarWrapperDiv).offset(),s=t._largeChange*t._scrollUnit,r;t._scrollTimeOutContainer===null&&(i=t._isHorizontalScroll?f-o.left-t._scrollPosition:e-o.top-t._scrollPosition,r=function(){var h=$(t._scrollbarWrapperDiv).offset(),n=0,o=t._scrollPosition;if(n=t._isHorizontalScroll?f-h.left-o:e-h.top-o,n*i<0||n>=0&&n<t._scrollbarSize){t._endContainerScroll();return}if(i<0)t._scrollEventType=2,t.scrollTo(o-s,!0);else if(i>0)t._scrollEventType=3,t.scrollTo(o+s,!0);else{t._endContainerScroll();return}t._scrollType===1&&(t._scrollTimeOutContainer=setTimeout(r,u?t._initialDelay:t._trackClickPepeatFreq));u=!1},r())},w.prototype._scrollbarContainerMouseup=function(n){this._endContainerScroll()},w.prototype._endContainerScroll=function(){var n=this,t;n._scrollTimeOutContainer&&clearTimeout(n._scrollTimeOutContainer);n._scrollTimeOutContainer=r;n._scrollEventType=8;t={newValue:n._value,oldValue:n._value,scrollOrientation:n._isHorizontalScroll?0:1,scrollEventType:n._scrollEventType};$(n._scrollContainerDiv).trigger(u,t)},w.prototype._endArrowScroll=function(){var n=this,t;n._scrollTimeOutArrow&&clearTimeout(n._scrollTimeOutArrow);n._scrollTimeOutArrow=r;n._scrollEventType=8;t={newValue:n._value,oldValue:n._value,scrollOrientation:n._isHorizontalScroll?0:1,scrollEventType:n._scrollEventType};$(n._scrollContainerDiv).trigger(u,t)},w.prototype._calcMovingOffsetByKeydown=function(n,t){var i=this;return n?(i._scrollEventType=t==="left"||t==="top"?2:3,i._largeChange*i._scrollUnit):(i._scrollEventType=t==="left"||t==="top"?0:1,i._smallChange*i._scrollUnit)},w.prototype._scrollbarDrag=function(){var n=this,r=0,u=n._scrollPosition,i=n._currentPosition,t=n._edgePosition,l,a;if(n._isHorizontalScroll){if(t&&t.isBeyondEdge){var f=t.startEdgePosition.x,e=t.endEdgePosition.x,h=i.x<f,c=i.x>e;if(h||c)return;n._oldPosition.x<f&&(n._oldPosition.x=f);n._oldPosition.x>e&&(n._oldPosition.x=e)}l=i.x-n._oldPosition.x;r=u+l}else{if(t&&t.isBeyondEdge){var o=t.startEdgePosition.y,s=t.endEdgePosition.y,h=i.y<o,c=i.y>s;if(h||c)return}n._oldPosition.y<o&&(n._oldPosition.y=o);n._oldPosition.y>s&&(n._oldPosition.y=s);a=i.y-n._oldPosition.y;r=u+a}r!==u&&(n._scrollEventType=5,n.scrollTo(r,!1))},w.prototype.scrollTo=function(n,i,r){var f=this,s=a,v=f._scrollSize-f._scrollbarSize,p="",y=f._scrollPosition,w=t.ScrollOrientation,o,e,h,c,l;(f._isHorizontalScroll&&(s=g),o=!1,n>v&&(n=v,o=!0),n<0&&(n=0,o=!0),f._edgePosition&&(f._edgePosition.isBeyondEdge=o),y!==n)&&(e=Math.round(n/f._scrollUnit)+f._minimum,h=f._value,Math.abs(e-h)>=1&&(r||(c={newValue:e,oldValue:h,scrollOrientation:f._isHorizontalScroll?0:1,scrollEventType:f._scrollEventType},$(f._scrollContainerDiv).trigger(u,c),e=c.newValue),f._value=e,f._scrollEventType!==5&&(n=(e-f._minimum)*f._scrollUnit)),f._scrollPosition=n,i?(l={},l[s]=n,$(f._scrollbarDiv).animate(l,{duration:250,esaing:"linear",queue:!1,disabled:!1})):$(f._scrollbarDiv).css(s,n))},w}();t.Scrollbar=w})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){(function(t){var sr,r,b,ni,it,ti,ii,ri;t.feature("core.basecelltype",["core.common","core.globalize","core.theme"]);var rt=window.document,ct="position",lt="absolute",at="margin",ut="font",ui="class",u="left",a="right",k="top",vt="alphabetic",v="center",d="gcUIElement",y="none",ft="0",et="#9fa9c5",yt="#f6fafb",pt="#d2dbeb",s=".gcEditingInput",fi="keydown"+s,ei="keyup"+s,oi="paste"+s,si="mousedown"+s,hi="compositionstart"+s,ci="compositionupdate"+s,li="compositionend"+s,l="width",e="height",wt="padding",ai="padding-left",vi="padding-right",yi="padding-top",pi="padding-bottom",bt="text-align",f="hidden",wi="visibility",h="word-wrap",o="overflow",g="normal",ot="break-word",kt="overflow-y",bi="resize",ki="border",di="outline",gi="box-shadow",nr="box-sizing",tr="autocomplete",dt="color",ir="border-width",gt="background-color",rr="z-index",ur="text-decoration",st="ime-mode",fr="overline",er="line-through",or="underline",nt="undefined",c=undefined,i=null,tt=Math.floor,p=Math.ceil,w=Math.min,ht=Math.max;(function(n){n[n.BaseCellType=0]="BaseCellType";n[n.TextCellType=1]="TextCellType";n[n.ColumnHeaderCellType=2]="ColumnHeaderCellType";n[n.RowHeaderCellType=3]="RowHeaderCellType";n[n.CornerCellType=4]="CornerCellType";n[n.CheckBoxCellType=5]="CheckBoxCellType";n[n.ButtonCellType=6]="ButtonCellType";n[n.ComboBoxCellType=7]="ComboBoxCellType";n[n.HyperLinkCellType=8]="HyperLinkCellType"})(t.CellTypeKind||(t.CellTypeKind={}));sr=t.CellTypeKind;r=function(){function n(){}return n._getAutoFitWidth=function(n,i,r,u,f,e){var o=0,l,h,c,s,a,v;if(typeof r=="string"&&r!==""){if(u.wordWrap)for(l=0,h=u.textIndent,h>0&&(l=h*8),c=r.split(/\r\n|\r|\n/),s=0;s<c.length;s++)o=ht(o,t._WordWrapHelper._measureTextWithoutEndSpaces(c[s],u.font)/n._zoomFactor);else o=n._getStringWidthByCanvas(r,u.font)/n._zoomFactor;u.hAlign!==1&&u.textIndent>0&&(o+=u.textIndent*8/n._zoomFactor);f&&(a=w(n._zoomFactor,1),v=parseInt((n.defaults.rowHeight*a).toString(),10),o+=v)}return o},n._getAutoFitHeight=function(n,i,r,u,f,e){var o=0,s,h,c,l;return typeof r=="string"&&r!==""&&(s=n._getFontHeight(u.font)/n._zoomFactor,u.wordWrap?(h=0,c=u.textIndent,c>0&&(h=c*8),l=t._WordWrapHelper._getWrapInfo(r,f-3-h,u.font),o=l.length*s):o=s),o},n.paintBackground=function(n,t,i,r,u,f,e,o,s){if(f||e){if(n.save(),n.beginPath(),f&&(n.fillStyle!==f&&(n.fillStyle=f),n.fillRect(t,i,r,u)),e&&e!==y&&s)try{if(s.getState(e)){var w=s.getImage(e),h=w.width,c=w.height,d=0,g=0,l=h,a=c,v=r,p=u,b=t,k=i;switch(o){case 0:break;case 1:l=r>=h?h:r;a=u>=c?c:u;b=r>h&&h>0?t+r/2-h/2:t;k=u>c&&c>0?i+u/2-c/2:i;v=l;p=a;break;case 2:u>0&&c>0&&r/u>h/c?(v=h/c*u,b=t+r/2-v/2):r>0&&h>0&&u/r>c/h&&(p=c/h*r,k=i+u/2-p/2);break;case 3:l=r>=h?h:r;a=u>=c?c:u;v=l;p=a;break;default:break}n.drawImage(w,d,g,l,a,b,k,v,p)}else s.addImage(e)}catch(nt){}n.restore()}},n.paintConditionalFormats=function(n,r,u,f,e,o,s,h){var b=h.conditionalFormats,w;if(b&&!(b.count()<=0)){var k=h.sheet,y=h.row,p=h.col,d=b.getRules(y,p),g=d.length;if(g<=0)return!1;n.save();n.beginPath();var nt=!1,tt=!1,a=i,v=i,l=i,c=i;for(d.sort(function(n,t){return n.priority()-t.priority()}),w=0;w<g;w++)if(l=d[w],l&&(!a&&l instanceof t.DataBarRule?a=l:!v&&l instanceof t.IconSetRule&&(v=l),l.stopIfTrue()&&(c=l.evaluate(k,y,p,r),c)))break;return a&&(c=a.evaluate(k,y,p,r),c&&(a._paintDataBar(n,c,u,f,e,o),nt=c.showBarOnly)),v&&(c=v.evaluate(k,y,p,r),c&&((e<16||o<16)&&(n.rect(u,f,e,o),n.clip(),n.beginPath()),v._paintIconSet(n,c,u,f,e,o,s,h.imageLoader),tt=c.showIconOnly)),n.restore(),nt||tt}},n.paintSparkline=function(n,t,i,r,u,f){f&&f.paintSparkline(n,t,i,r,u)},n.paintSparklineEx=function(n,i,r,u,f,e,o){var s,h;return t.features.sparklineEx&&i instanceof t.SparklineExValue&&(s=o&&o.parent,s&&(h=s.getSparklineEx(i.name),h))?(h._paintSparkline(n,i.value,r,u,f,e,o),!0):!1},n}();t.CellTypeContext=r;b=function(){function n(){this.allowOverflow=!1}return n.prototype.paintValue=function(n,r,f,e,o,s,h,c){var wt={value:i},k,d,g,ct,lt,at,ft,ri,gt;if(k=this.format(r,h.formatter||h._autoFormatter,wt),k){n.save();n.beginPath();d=h.foreColor;g=h.font;wt.value&&(d=wt.value);d&&n.fillStyle!==d&&(n.fillStyle=d);g&&n.font!==g&&(n.font=g);var nt=0,ni=h.textIndent,ti=h.wordWrap,p=h.hAlign,bt=h.vAlign,et=h.textDecoration,ot=u,ii=vt,y=2,w=2,kt=0,b=c.lineHeight,st=[],ht=0,it=c.fontInfo.fontSize;ni>0&&(nt=ni*8);p===3&&(p=t.util.getHAlignByValueType(p,r));y+=nt;p===1?(y=o/2,ot=v):p===2&&(y=o-3,y-=nt,ot=a);n.textAlign!==ot&&(n.textAlign=ot);ti&&(st=t._WordWrapHelper._getWrapInfo(k,o-3-nt,g),ht=st.length,ht>1&&bt!==0&&(kt=(ht-1)*b));ct=it>8?tt((it-8)/5+2):1;lt=b/2-it/2+ct;w+=b-lt;bt===1?w=(s-kt)/2+b/2-lt:bt===2&&(w=s-kt-2-lt);n.textBaseline!==ii&&(n.textBaseline=ii);var l={x:f,y:e,width:o-1,height:s},rt=c.cellOverflowLayout,ut=rt&&rt.layout;if(ut&&(l={x:ut.x,y:ut.y,width:ut.width,height:ut.height}),ti)for(n.rect(l.x,l.y,l.width,l.height),n.clip(),n.beginPath(),at=e+w,ft=0;ft<ht;ft++)n.fillText(st[ft],f+y,at),et&&(ri=n.measureText(st[ft]).width,this._renderTextDecoration(n,et,f+y,at,ri,it,ct)),at+=b;else{var yt=n.measureText(k).width,dt=l.width,ui=l.height,pt=yt>dt||b>ui;pt||(p===1?rt&&(gt=yt/2,(gt>rt.backgroundLeftWidth||gt>rt.backgroundRightWidth)&&(pt=!0)):yt+nt>dt&&(pt=!0));pt&&(n.rect(l.x,l.y,dt,ui),n.clip(),n.beginPath());n.fillText(k,f+y,e+w);et&&this._renderTextDecoration(n,et,f+y,e+w,yt,it,ct)}n.restore()}},n.prototype.paint=function(n,t,i,r,u,f,e,o){},n.prototype.createEditorElement=function(n){return i},n.prototype._getLocator=function(){var n=rt.createElement("span");return $(n).css(ct,lt).css(wi,f).css(gt,"#68E").css(at,ft).css(wt,"2px").css(ut,"normal 12px Arial").css(dt,"white").css(ir,ft).attr(ui,"gc-input-locator").attr(d,"gcEditingLocator"),n},n.prototype.getEditorValue=function(n,t){return i},n.prototype._formatEditorValue=function(n,t,i,r){return i},n.prototype.setEditorValue=function(n,t,i){},n.prototype.getEditingElement=function(){return i},n.prototype.parse=function(n,r,u){var o=typeof r===nt||r===i,f=typeof n===nt||n===i,e;if(o||f)return f?"":n.toString();else try{return t.features.formatter?(e=typeof r=="string"?new t.GeneralFormatter(r):r,e.Parse(n)):n.toString()}catch(s){return n.toString()}},n.prototype.format=function(n,r,u,f){if(n===c||n===i||n==="")return"";if(r)try{if(t.features.formatter){var e=i;return e=typeof r=="string"?new t.GeneralFormatter(r):r,e.Format(n,u)}else return n.toString()}catch(o){return n.toString()}else{if(typeof n=="boolean"||n instanceof Boolean)return n.toString().toUpperCase();else if(n instanceof Date)return new t._DateTimeHelper(n).localeFormat("M/d/yyyy h:mm:ss");return n.toString()}},n.prototype.focus=function(n,t){n&&n.focus&&n.focus()},n.prototype.getThemeStyle=function(n){return t.Global.prototype.getWijmoThemeStyle(n)},n.prototype.activateEditor=function(n,t,i,r){},n.prototype.deactivateEditor=function(n,t){},n.prototype.selectAll=function(n,t){n&&n.select&&n.select()},n.prototype.updateEditor=function(n,t,i,r){},n.prototype.setImeMode=function(n,t,i){this.isImeAware(i)?this.updateImeMode(n,t,i):n&&$(n).css(st,this._getImeModeString(0))},n.prototype.updateImeMode=function(n,t,i){n&&$(n).css(st,this._getImeModeString(t))},n.prototype._getImeModeString=function(n){var t="";n===c&&(n=1);switch(n){case 1:t="auto";break;case 2:t="active";break;case 4:t="inactive";break;case 0:t="disabled";break}return t},n.prototype._updateEditorLocator=function(n,t){var i=n&&t&&t.sheet,r,f;i&&i.isEditing()&&i.showEditingLocator&&(r=n._editingLocator,f=$(n),r&&$(r).css(k,parseInt(f.css(k),10)-18).css(u,parseInt(f.css(u),10)))},n.prototype.getHitInfo=function(n,t,r,u,f){return i},n.prototype.processMouseDown=function(n){return!1},n.prototype.processMouseMove=function(n){return!1},n.prototype.processMouseUp=function(n){return!1},n.prototype.processMouseEnter=function(n){},n.prototype.processMouseLeave=function(n){},n.prototype.isReservedKey=function(n,t){return!1},n.prototype.isEditingValueChanged=function(n,t,i){return n!==t},n.prototype.processKeyDown=function(n,t){return!1},n.prototype.processKeyUp=function(n,t){return!1},n.prototype._getAutoFitWidth=function(n,t,i,r,u,f){return 0},n.prototype._getAutoFitHeight=function(n,t,i,r,u,f){return 0},n.prototype._renderTextDecoration=function(n,t,i,r,u,f,e){n.strokeStyle=n.fillStyle;var o=0,h=0,s=.5,c;c=f<=12?12:f;h=tt((c-12)/21+1);n.lineWidth=h;(h&1)==0&&(s=0);n.textAlign===v?i=i-u/2:n.textAlign===a&&(i=i-u);n.beginPath();(t&4)==4&&(o=p(r+e-f-1)-s,n.moveTo(i,o),n.lineTo(i+u,o));(t&2)==2&&(o=p(r+e-f/2)-s,n.moveTo(i,o),n.lineTo(i+u,o));(t&1)==1&&(o=p(r+e-1)-s,n.moveTo(i,o),n.lineTo(i+u,o));n.stroke()},n.prototype._setEditStatusTextDecoration=function(n,t){var i="";(t&4)==4&&(i=fr);(t&2)==2&&(i+=" "+er);(t&1)==1&&(i+=" "+or);n.css(ur,i)},n.prototype.isImeAware=function(n){return!1},n.prototype.isEditting=function(){return!1},n.prototype.toJSON=function(){return{type:0}},n.prototype.fromJSON=function(n){},n}();t.BaseCellType=b;ni=function(b){function nt(){b.call(this);this.allowOverflow=!0}return __extends(nt,b),nt.prototype.paint=function(n,t,i,u,f,e,o,s){var h,c;n&&(r.paintBackground(n,i,u,f,e,o.backColor,o.backgroundImage,o.backgroundImageLayout,s.imageLoader),h=r.paintConditionalFormats(n,t,i,u,f,e,o,s),s.showBarIconOnly=h,r.paintSparkline(n,i,u,f,e,s.sparkline),c=r.paintSparklineEx(n,t,i,u,f,e,s.sheet),s.cellOverflowLayout||h||c||this.paintValue(n,t,i,u,f,e,o,s))},nt.prototype.createEditorElement=function(n){var i=$("<textarea><\/textarea>").css(at,ft).css(wt,"1px").css(nr,"content-box").css(ut,"normal 10pt Arial").css(h,"normal").css(o,f).css(bi,y).css(ki,"2px #5292f7 solid").css(di,y).css(gi,"1px 2px 5px rgba(0,0,0,0.4)").attr(tr,"off").attr(d,"gcEditingInput"),t=rt.createElement("div");return $(t).css(ct,lt).css(rr,"2000").append(i),t},nt.prototype.getEditorValue=function(n,t){var u=n&&n.children[0],r;return u&&(r=u.value,r!==c&&r!==i&&r.length>0)?r:i},nt.prototype.setEditorValue=function(n,t,r){var u=n&&n.children[0],f;u&&(f=r&&r.sheet&&r.sheet._startEditByKeydown?!0:!1,u.value=t===i||t===c||f?"":t,u.selectionStart=u.selectionEnd=u.value.length)},nt.prototype.focus=function(n,t){if(n){var i=n.children[0];this.isImeAware()&&i?(i.focus(),i.selectionStart=i.value.length):n.focus()}},nt.prototype._formatEditorValue=function(n,r,u,f){var o=n&&f&&f.sheet,l;if(o){var s=o._activeRowIndex,h=o._activeColIndex,e=r.formatter?r.formatter:r._autoFormatter;if(t.features.formatter&&u!==i&&u!==c)if(e instanceof t.AutoFormatter&&e._innerFormatter instanceof t.GeneralFormatter)u=e._innerFormatter.GetPreferredEditingFormatter(u).Format(u);else if(typeof e=="string"&&(e=new t.GeneralFormatter(e)),e)try{l=e.GetFormatType(u);l===2?(e=u.getHours()===0&&u.getMinutes()===0&&u.getSeconds()===0&&u.getMilliseconds()===0?new t.GeneralFormatter("yyyy/mm/dd"):new t.GeneralFormatter("yyyy/mm/dd hh:mm:ss"),o._editingTimeValue=!0):e=new t.GeneralFormatter("General");u=e.Format(u)}catch(a){u=o.getText(s,h)}else u=o.getText(s,h)}return u!==i&&u!==c&&(u=t.util.toString(u)),u},nt.prototype.activateEditor=function(n,r,f,e){var s=n&&e&&e.sheet,o,c,h;if(s){var v=$(n),l=s._eventHandler._getCanvasOffset(),a=s._bounds;v.css(k,l.top+a.y+f.y-2).css(u,l.left+a.x+f.x-2);o=this;c=n.children[0];c&&(h=$(c),o._editingElement=h.get(0),h.bind(fi,function(i){var u=i.keyCode===229||i.keyCode===0;if(u||o._isImeInputing||o._updateEditorImp(n,r,f,i,e),!o._processEditingWrap(i,e)){var h=c.selectionStart===0&&i.keyCode===37&&!i.ctrlKey&&!i.shiftKey&&!i.altKey,l=c.selectionStart===c.value.length&&i.keyCode===39&&!i.ctrlKey&&!i.shiftKey&&!i.altKey,a=c.selectionStart===c.selectionEnd;a&&(h||l)&&s._editorStatus===2&&t.util.cancelDefault(i)}}),h.bind(ei,function(i){(i.keyCode===46||i.keyCode===8||(i.keyCode===90||i.keyCode===89)&&i.ctrlKey&&!i.altKey)&&o._updateEditorImp(n,r,f,i,e);(i.keyCode!==13&&i.keyCode!==9||i.ctrlKey||i.altKey)&&s._trigger(t.Events.EditChange,{sheet:s,sheetName:s._name,row:s._activeRowIndex,col:s._activeColIndex,editingText:o.getEditorValue(n,e)})}),h.bind(oi,function(t){o._pasteInputSizingToken=window.setTimeout(function(){o._updateEditorImp(n,r,f,t,e);o._pasteInputSizingToken&&(window.clearTimeout(o._pasteInputSizingToken),delete o._pasteInputSizingToken)},10)}),h.bind(si,function(n){s._editorStatus===1&&(s._editorStatus=2,s._trigger(t.Events.EditorStatusChanged,{sheet:s,sheetName:s._name,oldStatus:1,newStatus:2}))}),h.bind(hi,function(n){o._isImeInputing=!0;o._oldValueBeforeImeInputting=h.val()}),h.bind(ci,function(t){o._updateEditorImp(n,r,f,t?t.originalEvent:i,e)}),h.bind(li,function(t){o._updateEditorImp(n,r,f,t?t.originalEvent:i,e);o._isImeInputing=!1}))}},nt.prototype.deactivateEditor=function(n,t){var r,u;n&&(r=n.children[0],r&&$(r).unbind(s),u=n._editingLocator,u&&rt.body.removeChild(u));this._editingElement=i},nt.prototype.getEditingElement=function(){return this._editingElement},nt.prototype.selectAll=function(n,t){var i=n&&n.children[0];i&&i.select&&i.select()},nt.prototype._updateEditorImp=function(n,r,s,y,b){var k=n&&n.children[0],rt=b&&b.sheet,ft,yt,ii,st,vt,ri,ui,et,ct,fi,hi,it,pt,si;if(k&&rt){var wt=this,d=$(k),ni=rt._render;if(rt.isEditing()){var nt=i,ei=u,tt=i;if(r&&(nt=t.util.getHAlignByValueType(r.hAlign,n._originalValue),nt===1?ei=v:nt===2&&(ei=a),d.css(bt,ei),r.backColor&&d.css(gt,r.backColor),r.foreColor&&d.css(dt,r.foreColor),tt=r.font||ni._getDefaultFont(),tt&&(rt._zoomFactor>1&&(tt=ni._getZoomFont(tt)),d.css(ut,tt)),r.textDecoration&&wt._setEditStatusTextDecoration(d,r.textDecoration)),s){$(n).width(s.width).height(s.height);var lt=rt._getSheetLayout(),at=1,ti=1;at=at+parseInt(d.css(ai),10)+parseInt(d.css(vi),10);ti=ti+parseInt(d.css(yi),10)+parseInt(d.css(pi),10);it=s.width;s.x+s.width>lt.width&&(it=lt.width-s.x);d.css(l,it-at).css(e,s.height-ti);nt===c||nt===i||nt===0?k.maxWidth=lt.width-s.x-at:nt===1?k.maxWidth=ht(0,w(lt.width-s.x-s.width-at,s.x-lt.rowHeaderWidth-at))*2+s.width:nt===2&&(k.maxWidth=s.x+s.width-lt.rowHeaderWidth-at);k.maxHeight=lt.height-s.y-ti;k.minWidth=parseInt(k.style.width,10);k.minHeight=parseInt(k.style.height,10)}if(ft=k.value,tt=k.style.font,tt||(tt=ni._getZoomFont(ni._getDefaultFont())),yt=rt._getFontHeight(tt),y){if(rt._eventHandler.allowEnterEditing(y)){var oi=k.selectionStart,ci=ft.substr(0,oi),li=ft.substr(oi,ft.length-oi);ft=ci+String.fromCharCode(y.keyCode)+li}wt._isImeInputing&&(ft=$.browser.msie?d.val():wt._oldValueBeforeImeInputting+y.data)}if(ii=[],ii=r&&r.wordWrap?t._WordWrapHelper._getWrapInfo(ft,d.width(),tt):ft.split(/\r\n|\r|\n/),ui=ii.length,k.minWidth=w(k.minWidth,k.maxWidth),k.minHeight=w(k.minHeight,k.maxHeight),r&&r.wordWrap||ui>0){if(et=ui*yt,r&&r.wordWrap)d.css(h,ot).css(o,f);else{for(ct=0,fi=[],st=0;st<ui;st++)hi=ii[st],vt=rt._getStringWidth(hi,tt),fi.push(vt),ct=ht(ct,vt);if(ct<=k.minWidth)d.css(l,k.minWidth).css(h,g).css(o,f);else if(ct>k.minWidth&&ct<=k.maxWidth)d.css(l,ct).css(h,g).css(o,f);else if(ct>k.maxWidth)for(d.css(l,k.maxWidth).css(h,ot).css(o,f),et=0,st=0;st<fi.length;st++)vt=fi[st],vt<=k.maxWidth?et+=yt:vt>k.maxWidth&&(ri=p(vt/k.maxWidth),et+=yt*ri)}et<=k.minHeight?d.css(e,k.minHeight):et>k.minHeight&&et<=k.maxHeight?d.css(e,et):et>k.maxHeight&&d.css(e,k.maxHeight).css(kt,"scroll")}else it=rt._getStringWidth(ft,tt),it>k.minWidth&&it<=k.maxWidth?d.css(l,it).css(e,k.minHeight).css(h,g).css(o,f):it<=k.minWidth?d.css(l,k.minWidth).css(e,k.minHeight).css(h,g).css(o,f):it>k.maxWidth&&(d.css(l,k.maxWidth).css(h,ot),ri=p(it/k.maxWidth),pt=yt*ri,pt<=k.minHeight?d.css(e,k.minHeight).css(o,f):pt<=k.maxHeight?d.css(e,pt).css(o,f):pt>k.maxHeight&&d.css(e,k.maxHeight).css(kt,"scroll"));nt=d.css(bt);si=d.width()-k.minWidth;nt!==c&&nt!==i&&nt!==u&&(nt===v?d.css(u,k.originalLeft-si/2):nt===a&&d.css(u,k.originalLeft-si));wt._updateEditorLocator(n,b)}}},nt.prototype.updateEditor=function(n,t,r,f){var e=f&&f.sheet,o,s,h,c;e&&r&&(o=e._eventHandler._getCanvasOffset(),s=e._bounds,$(n).css(k,o.top+s.y+r.y-2).css(u,o.left+s.x+r.x-2));this._updateEditorImp(n,t,r,i,f);$.browser.msie&&(h=$(n.children[0]),c=h.width(),h.width(c+1).width(c))},nt.prototype.updateImeMode=function(n,t,i){if(this.isImeAware()){var r=n&&n.children[0];r&&$(r).css(st,this._getImeModeString(t))}},nt.prototype.isReservedKey=function(n,t){var i=n.srcElement||n.target;return i&&t&&t.isEditing&&i.getAttribute(d)==="gcEditingInput"?n.keyCode===13&&(n.ctrlKey&&!n.shiftKey||n.altKey)||n.keyCode===90&&n.ctrlKey&&!n.altKey||n.keyCode===89&&n.ctrlKey&&!n.altKey:!1},nt.prototype._processEditingWrap=function(r,u){var f=r.srcElement||r.target,e,c,h;if(f&&f.getAttribute(d)==="gcEditingInput"&&r.keyCode===13&&(r.ctrlKey||r.altKey)){var o=f.selectionStart,s=f.value,l=s.substr(0,o),a=s.substr(o,s.length-o);return f.value=l+"\n"+a,f.selectionStart=o+1,f.selectionEnd=o+1,e=window.gcGlobal.activeElement,c=n.spread,e instanceof c.Sheet&&(h=e.getCellType(e._activeRowIndex,e._activeColIndex),h&&h.updateEditor(e._editor,i,i,u)),t.util.cancelDefault(r),!0}return!1},nt.prototype._getAutoFitWidth=function(n,t,i,u,f,e){return r._getAutoFitWidth(n,t,i,u,f,e)},nt.prototype._getAutoFitHeight=function(n,t,i,u,f,e){return r._getAutoFitHeight(n,t,i,u,f,e)},nt.prototype.isImeAware=function(n){return!0},nt.prototype.toJSON=function(){return{type:1}},nt}(b);t.TextCellType=ni;it=function(n){function f(){n.apply(this,arguments)}return __extends(f,n),f.prototype._paint=function(n,r,f,e,o,s,h,c,l,p){var gt,at,ni,g,rt,b,si,hi,ut,ft,et,ii,bt,kt,ht,dt,ct,ai,fi;if(n){var lt=this,d=i,vi=c.visualState,ei=c.useWijmoTheme;if(typeof vi!==nt){if(n.save(),n.beginPath(),ei)try{d=lt.getThemeStyle(c.visualState);gt=d&&d.backgroundColor;at=d&&d.backgroundImage;gt?(n.fillStyle=gt,n.fillRect(f,e,o,s)):at&&at!==y&&(ni=new Image,g=at,g=g.replace('url("',""),g=g.replace('")',""),ni.src=g,n.drawImage(ni,f,e,o,s))}catch(wi){}else l&&n.fillStyle!==l&&(n.fillStyle=l),n.fillRect(f,e,o,s);n.restore()}if(rt=lt.format(r,h.formatter),rt){b={x:f,y:e,width:o,height:s};n.save();n.beginPath();var ti=c.sheet,oi=ti.rowFilter(),yi=!!(oi&&oi.isFilterHeader(c.row,c.col,p));yi&&(si=w(ti._zoomFactor,1),hi=tt(ti.defaults.rowHeight*si),o-=hi);ut=h.foreColor;ei&&d&&(ut=d.color);ut&&n.fillStyle!==ut&&(n.fillStyle=ut);ft=h.font;ft&&n.font!==ft&&(n.font=ft);et=0;ii=h.textIndent;ii>0&&(et=ii*8);var ci=h.hAlign,ri=h.vAlign,yt=u,k=2;k+=et;ci===1?(k=o/2,yt=v):ci===2&&(k=o-1,k-=et,yt=a);n.textAlign!==yt&&(n.textAlign=yt);var ui=0,li=vt,it=3,pi=h.wordWrap,ot=c.lineHeight,st=c.fontInfo.fontSize,pt=[],wt=0;if(pi&&(pt=t._WordWrapHelper._getWrapInfo(rt,o-3-et,ft),wt=pt.length,wt>1&&ri!==0&&(ui=(wt-1)*ot)),bt=st>8?tt((st-8)/5+2):1,kt=ot/2-st/2+bt,it+=ot-kt,ri===1?it=(s-ui)/2+1+ot/2-kt:ri===2&&(it=s-ui-1-kt),n.textBaseline!==li&&(n.textBaseline=li),ht=h.textDecoration,h.wordWrap)for(n.rect(b.x,b.y,b.width,b.height),n.clip(),n.beginPath(),dt=e+it,ct=0;ct<wt;ct++)n.fillText(pt[ct],f+k,dt),ht&&(ai=n.measureText(pt[ct]).width,lt._renderTextDecoration(n,ht,f+k,dt,ai,st,bt)),dt+=c.lineHeight;else fi=n.measureText(rt).width,(fi>b.width||ot>b.height)&&(n.rect(b.x,b.y,b.width,b.height),n.clip(),n.beginPath()),n.fillText(rt,f+k,e+it),ht&<._renderTextDecoration(n,ht,f+k,e+it,fi,st,bt);n.restore()}}},f.prototype._getAutoFitWidth=function(n,t,i,u,f,e){return r._getAutoFitWidth(n,t,i,u,f,e)},f.prototype._getAutoFitHeight=function(n,t,i,u,f,e){return r._getAutoFitHeight(n,t,i,u,f,e)},f}(b);t.HeaderCellType=it;ti=function(n){function t(){n.call(this)}return __extends(t,n),t.prototype.paint=function(t,i,r,u,f,e,o,s){var h=t.createLinearGradient(r+f/2,u,r+f/2,u+e),c,l=s.visualState;l===0?o.backColor?c=o.backColor:(h.addColorStop(.125,yt),h.addColorStop(1,pt),c=h):l===1?(h.addColorStop(.125,"#ffd45a"),h.addColorStop(1,"#ffef72"),c=h):l===2?c=et:l===4&&(h.addColorStop(.125,"#ffe165"),h.addColorStop(1,"#fff9a3"),c=h);n.prototype._paint.call(this,t,i,r,u,f,e,o,s,c,1)},t.prototype.toJSON=function(){return{type:2}},t}(it);t.ColumnHeaderCellType=ti;ii=function(n){function t(){n.call(this)}return __extends(t,n),t.prototype.paint=function(t,i,r,u,f,e,o,s){var c,h=s.visualState;h===0?c=o.backColor?o.backColor:"#e4ecf7":h===1?t.fillStyle="#ffdc61":h===2?t.fillStyle=et:h===4&&(t.fillStyle="#fde47b");n.prototype._paint.call(this,t,i,r,u,f,e,o,s,c,2)},t.prototype.toJSON=function(){return{type:3}},t}(it);t.RowHeaderCellType=ii;ri=function(n){function t(){n.call(this)}return __extends(t,n),t.prototype.paint=function(n,t,i,r,u,f,e,o){var l,w,k,h,c,a,g,s,p;if(n){if(n.save(),n.rect(i,r,u,f),n.clip(),n.beginPath(),l=o.visualState,w=o.useWijmoTheme,typeof l!==nt){if(w)try{var v=this.getThemeStyle(o.visualState),d=v&&v.backgroundColor,b=v&&v.backgroundImage;d?(n.fillStyle=d,n.fillRect(i,r,u,f)):b&&b!==y&&(k=new Image,h=b,h=h.replace('url("',""),h=h.replace('")',""),k.src=h,n.drawImage(k,i,r,u,f))}catch(tt){}else l===0?c="#a9c4e9":l===2?c=et:l===4&&(c="#a1b0c8"),c&&n.fillStyle!==c&&(n.fillStyle=c),n.fillRect(i,r,u,f);a=n.createLinearGradient(i+u/2,r,i+u/2,r+f);a.addColorStop(.125,yt);w?(g=this.getThemeStyle(4),a.addColorStop(1,g.backgroundColor)):a.addColorStop(1,pt);n.fillStyle=a;n.beginPath();s=3;p=f;u<f&&(p=u);n.moveTo(i+u-p+s,r+f-s);n.lineTo(i+u-s,r+f-s);n.lineTo(i+u-s,r+f-p+s);n.fill()}n.restore()}},t.prototype.toJSON=function(){return{type:4}},t.prototype._getAutoFitWidth=function(n,t,i,u,f,e){return r._getAutoFitWidth(n,t,i,u,f,e)},t.prototype._getAutoFitHeight=function(n,t,i,u,f,e){return r._getAutoFitHeight(n,t,i,u,f,e)},t}(b);t.CornerCellType=ri})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(n){n.feature("basedialog",["core.common"]);var t=function(){function t(){var n=this;n._wijpopupClass="wijspread-popup";n._overlayClass="wijspread-overlay";n._useWijmoTheme=!1;n.defaultOverlayCSS={position:"fixed",width:"100%",height:"100%",margin:0,padding:0,top:0,left:0,border:"none",zIndex:999,backgroundColor:"rgba(0,0,0,0)"};n.defaultContainerCSS={position:"absolute",padding:0,margin:0,height:"auto",zIndex:1e3,outline:"none"};n._init()}return t.prototype._init=function(){var n=this;n._hasTargetContainer(n._name)?n.container=$("#"+n._name):(n._name=n._generateName(),n.container=$("<div><\/div>").addClass(n._wijpopupClass).attr({id:n._name,tabIndex:-1}).css(n.defaultContainerCSS))},t.prototype._generateName=function(){for(var n=0,t="dialog";this._hasTargetContainer(t+n);)n++;return t+n},t.prototype.useWijmoTheme=function(n){var t=this;return typeof n=="undefined"?t._useWijmoTheme:typeof n=="boolean"&&t._useWijmoTheme!==n?(t._useWijmoTheme=n,n?t.container.addClass("ui-widget ui-widget-content"):t.container.removeClass("ui-widget ui-widget-content"),t):null},t.prototype.getContainer=function(){if(this.container)return this.container},t.prototype.show=function(n,t,i){var u=this,f=arguments.length,r=u.container;u._hasOverlay()||u._createOverlay();window.gcGlobal.suspendEvent();u._hasTargetContainer(u._name)||($(document.body).append(r),u.resetDialogPosition(),r.css("display","none"));f===3?t==="slide"?r.slideDown(n,i):t==="fade"?r.fadeIn(n,i):r.show(n,i):f===2?t==="slide"?r.slideDown(n):t==="fade"?r.fadeIn(n):r.show(n):f===1?r.show(n):r.show()},t.prototype.close=function(){var n=this;n._hasTargetContainer(n._name)&&n.container.remove();$("."+n._wijpopupClass).is(":visible")||n.closeOverlay();window.gcGlobal.resumeEvent()},t.prototype.closeOverlay=function(){$("."+this._overlayClass).remove()},t.prototype.resetDialogPosition=function(){var n=this.container;if(n.length!==0){var t=parseInt(n.css("left")),i=parseInt(n.css("top")),u=n.width(),f=n.height();if(!isNaN(t)&&!isNaN(i)&&!isNaN(u)&&!isNaN(f)){var e=0,o=0,s=document.documentElement.clientWidth,h=document.documentElement.clientHeight,r=n.get(0).getBoundingClientRect();r.left+u>s&&(o=r.left+u-s);r.top+f>h&&(e=r.top+f-h);(t<0||i<0||e>0||o>0)&&(t-=o,i-=e,t<0&&(t=0),i<0&&(i=0),n.css({left:t,top:i}))}}},t.prototype._hasTargetContainer=function(n){return $("#"+n).length?!0:!1},t.prototype._createOverlay=function(){var t=this,i=$("<div><\/div>").addClass(t._overlayClass),r;i.css(t.defaultOverlayCSS);$(document.body).append(i);r="mousedown touchstart touchend touchmove";i.bind(r,function(i){t.close();n.util.cancelDefault(i)})},t.prototype._hasOverlay=function(){return $("."+this._overlayClass).length>0?!0:!1},t}();n.BaseDialog=t})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){(function(t){var f,s,h,c,l,a,e,v,y;t.feature("core.sheet_model",["core.common","core.stringResource"]);var r=null,i=undefined,u=Math.min,o=Math.floor,p=function(n){function e(){n.call(this)}return __extends(e,n),e.prototype.find=function(n,t){for(var f=this.length,i,u=0;u<f;u++)if(i=this[u],i&&i.contains(n,t))return i;return r},e.prototype.remove=function(n){for(var t=0;t<this.length;t++)if(this[t]===n){this.splice(t,1);return}},e.prototype.copy=function(n,i,r,u,f,e){var h=this,a=!1,v=h.length,o,l,s,c;if(n===-1){for(c=[],s=0;s<v;s++)o=h[s],i<=o.col&&o.col<i+e?(c.push(new t.Range(o.row,u+o.col-i,o.rowCount,o.colCount)),a=!0):u<=o.col&&o.col<u+e&&(h.splice(s,1),s--,v--,a=!0);for(s=0;s<c.length;s++){if(l=c[s],!h.isValid(h,0,h.length,l))throw new Error(t.SR.Exp_OverlappingSpans);h.push(l)}}else if(i===-1){for(c=[],s=0;s<v;s++)o=h[s],n<=o.row&&o.row<n+f?(c.push(new t.Range(r+o.row-n,o.col,o.rowCount,o.colCount)),a=!0):r<=o.row&&o.row<r+f&&(h.splice(s,1),s--,v--,a=!0);for(s=0;s<c.length;s++){if(l=c[s],!h.isValid(h,0,h.length,l))throw new Error(t.SR.Exp_OverlappingSpans);h.push(l)}}else{for(c=[],s=0;s<v;s++)o=h[s],n<=o.row&&o.row<n+f&&i<=o.col&&o.col<i+e?(c.push(new t.Range(r+o.row-n,u+o.col-i,o.rowCount,o.colCount)),a=!0):r<=o.row&&o.row<r+f&&u<=o.col&&o.col<u+e&&(h.splice(s,1),s--,v--,a=!0);for(s=0;s<c.length;s++){if(l=c[s],!h.isValid(h,0,h.length,l))throw new Error(t.SR.Exp_OverlappingSpans);h.push(l)}}},e.prototype.isValid=function(n,t,i,r){for(var f,u=t;u<i&&u<n.length;u++)if(f=n[u],f.intersect(r.row,r.col,r.rowCount,r.colCount))return!1;return!0},e.prototype.getEnumerator=function(n,t,i,r){return new f(this,n,t,i,r)},e.prototype.clear=function(n,t,i,r){for(var f,u=0;u<this.length;u++)f=this[u],(n===-1||n<=f.row&&f.row<n+i)&&(t===-1||t<=f.col&&f.col<t+r)&&this.splice(u--,1)},e.prototype.move=function(n,i,r,u,f,o){var a=this,v=!1,l=new e,y=[],p=a.length,s,h,c;if(n===-1)for(h=0;h<p;h++)s=a[h],i<=s.col&&s.col<i+o?(c=new t.Range(s.row,u+s.col-i,s.rowCount,s.colCount),y.push(c),v=!0):u<s.col&&s.col<u+o?v=!0:l.push(s);else if(i===-1)for(h=0;h<p;h++)s=a[h],n<=s.row&&s.row<n+f?(c=new t.Range(r+s.row-n,s.col,s.rowCount,s.colCount),y.push(c),v=!0):r<=s.row&&s.row<r+f?v=!0:l.push(s);else for(h=0;h<p;h++)s=a[h],n<=s.row&&s.row<n+f&&i<=s.col&&s.col<i+o?(c=new t.Range(r+s.row-n,u+s.col-i,s.rowCount,s.colCount),y.push(c),v=!0):r<=s.row&&s.row<r+f&&u<=s.col&&s.col<u+o?v=!0:l.push(s);if(v){if(y.length>0)for(h=0;h<y.length;h++){if(c=y[h],!a.isValid(l,0,l.length,c))throw new Error(t.SR.Exp_OverlappingSpans);l.push(c)}for(a.length=0,h=0;h<l.length;h++)a.push(l[h])}},e.prototype.isEmpty=function(){return this.length<=0?!0:!1},e.prototype.addRows=function(n,i){for(var r,f=this,e=!1,o=f.length,u=0;u<o;u++)r=f[u],r.row>=n?(f[u]=new t.Range(r.row+i,r.col,r.rowCount,r.colCount),e=!0):r.row<n&&n<r.row+r.rowCount&&(f[u]=new t.Range(r.row,r.col,r.rowCount+i,r.colCount),e=!0)},e.prototype.addColumns=function(n,i){for(var r,f=this,e=!1,o=f.length,u=0;u<o;u++)r=f[u],r.col>=n?(f[u]=new t.Range(r.row,r.col+i,r.rowCount,r.colCount),e=!0):r.col<n&&n<r.col+r.colCount&&(f[u]=new t.Range(r.row,r.col,r.rowCount,r.colCount+i),e=!0)},e.prototype.removeRows=function(n,i){for(var e=this,s=!1,o=[],c=e.length,r,h,f=0;f<c;f++)r=e[f],r.row>=n?r.row<n+i?(o.push(f),s=!0):(e[f]=new t.Range(r.row-i,r.col,r.rowCount,r.colCount),s=!0):r.row<n&&n<r.row+r.rowCount&&(e[f]=new t.Range(r.row,r.col,r.rowCount-u(r.row+r.rowCount-n,i),r.colCount),e[f].rowCount===1&&e[f].colCount===1&&o.push(f),s=!0);for(f=0;f<o.length;f++)h=o[f],e.splice(h,1)},e.prototype.removeColumns=function(n,i){for(var e=this,s=!1,o=[],c=e.length,r,h,f=0;f<c;f++)r=e[f],r.col>=n?r.col<n+i?(o.push(f),s=!0):(e[f]=new t.Range(r.row,r.col-i,r.rowCount,r.colCount),s=!0):r.col<n&&n<r.col+r.colCount&&(e[f]=new t.Range(r.row,r.col,r.rowCount,r.colCount-u(r.col+r.colCount-n,i)),e[f].rowCount===1&&e[f].colCount===1&&o.push(f),s=!0);for(f=0;f<o.length;f++)h=o[f],e.splice(h,1)},e.prototype.toJSON=function(){for(var n=[],t=0;t<this.length;t++)n.push(this[t]);return n.length===0?i:n},e.prototype.fromJSON=function(n){var u,r,i;if(n)for(u=n,r=0;r<u.length;r++)i=u[r],this.push(new t.Range(i.row,i.col,i.rowCount,i.colCount))},e}(t._XArray);t._SpanModel=p;f=function(){function n(n,t,i,r,u){var f=this;f.model=n;f.row=t;f.column=i;f.rowCount=r;f.columnCount=u;f.currentIndex=-1;t===-1&&i===-1&&(f.all=!0)}return n.prototype.current=function(){var n=this;return 0<=n.currentIndex&&n.currentIndex<n.model.length?n.model[n.currentIndex]:r},n.prototype.moveNext=function(){var n=this;if(n.currentIndex++,!n.all)while(n.currentIndex<n.model.length&&!n.model[n.currentIndex].intersect(n.row,n.column,n.rowCount,n.columnCount))n.currentIndex++;return n.currentIndex<n.model.length},n.prototype.reset=function(){this.currentIndex=-1},n}();t._SpanEnumerator=f;s=function(n){function t(){n.call(this);this.headingOverflowlayout=r;this.trailingOverflowLayout=r}return __extends(t,n),t.prototype.find=function(n){var u=this,f=u.length,i,t;if(f>0)for(t=0;t<f;t++)if(i=u[t],i.contains(n))return i;return r},t}(t._XArray);t._CellOverflowLayoutModel=s;h=function(){function n(n,t,i,r,u,f,e,o){var s=this;s.column=n;s.startColumn=t;s.endColumn=i;s.valueWidth=r;s.columnWidth=u;s.backgroundWidth=f;s.backgroundLeftWidth=e;s.backgroundRightWidth=o}return n.prototype.contains=function(n){return n>=this.startColumn&&n<=this.endColumn},n}();t._CellOverflowLayout=h;c=function(n){function f(){n.call(this);this.selectionPolicy=2;this.selectionUnit=0}return __extends(f,n),f.prototype.find=function(n,t){var f=this,e=f.length,u,i;if(e>0)for(i=0;i<e;i++)if(u=f[i],u.contains(n,t))return u;return r},f.prototype.clear=function(){this.splice(0,this.length);this.activeSelectedRangeIndex=-1},f.prototype.add=function(n,i,r,f){var e=this,o;e.selectionPolicy===0?(r=u(r,1),f=u(f,1),e.clear()):e.selectionPolicy===1&&e.clear();e.selectionUnit===1?(i=-1,f=-1):e.selectionUnit===2&&(n=-1,r=-1);o=new t.Range(n,i,r,f);e.push(o);e.activeSelectedRangeIndex=e.length-1},f.prototype.toArray=function(){for(var t=[],n=0;n<this.length;n++)t.push(this[n]);return t},f.prototype._isDefaultValue=function(n,t){var r=this,i;switch(n){case"selectionPolicy":return t===2;case"selectionUnit":return t===0;case"activeSelectedRangeIndex":return t===0;case"0":return i=t,r.length===1&&i.row===0&&i.col===0&&i.rowCount===1&&i.colCount===1;case"length":return t===1;default:return!1}},f.prototype.toJSON=function(){var n=this,r={};for(var t in n)!n._isDefaultValue(t,n[t])&&n.hasOwnProperty(t)&&(r[t]=n[t]);return $.isEmptyObject(r)?i:r},f.prototype.fromJSON=function(n){var f,r,e;if(n){var u=this,s=n,o=n.length;for(o===i&&(o=1),f=0;f<o;f++)r=s[f],r===i&&(r={row:0,col:0,rowCount:1,colCount:1}),u.push(new t.Range(r.row,r.col,r.rowCount,r.colCount));e=n.activeSelectedRangeIndex;e===i&&(e=0);u.activeSelectedRangeIndex=e;n.selectionPolicy!==i&&(u.selectionPolicy=n.selectionPolicy);n.selectionUnit!==i&&(u.selectionUnit=n.selectionUnit)}},f}(t._XArray);t._SelectionModel=c;l=function(n){function t(){n.call(this)}return __extends(t,n),t.prototype.findCell=function(n,t){var f=this,e=f.length,u,i;if(e>0)for(i=0;i<e;i++)if(u=f[i],u.contains(n,t))return u;return r},t.prototype.findRow=function(n){var u=this,f=u.length,i,t;if(f>0)for(t=0;t<f;t++)if(i=u[t],i.row===n)return i;return r},t.prototype.findCol=function(n){var u=this,f=u.length,i,t;if(f>0)for(t=0;t<f;t++)if(i=u[t],i.col===n)return i;return r},t.prototype.findX=function(n){var u=this,f=u.length,i,t;if(f>0)for(t=0;t<f;t++)if(i=u[t],i.containsX(n))return i;return r},t.prototype.findY=function(n){var u=this,f=u.length,i,t;if(f>0)for(t=0;t<f;t++)if(i=u[t],i.containsY(n))return i;return r},t.prototype.findNearX=function(n){var i=r,t=this,u=t.length;return u>0&&(i=t.findX(n),i||(i=n<t[0].x?t[0]:t[u-1])),i},t.prototype.findNearY=function(n){var i=r,t=this,u=t.length;return u>0&&(i=t.findY(n),i||(i=n<t[0].y?t[0]:t[u-1])),i},t}(t._XArray);t._LayoutModel=l;a=function(){function n(n,t,i,r,u,f,e,o){var s=this;s.rowCount=e;s.colCount=o;s.row=n;s.col=t;s.x=i;s.y=r;s.width=u;s.height=f}return n.prototype.contains=function(n,t){var i=this;return n<i.row+i.rowCount&&i.row<=n&&t<i.col+i.colCount&&i.col<=t},n.prototype.intersect=function(n){var t=this;return(t.x<0||n.x<t.x+t.width&&t.x<n.x+n.width)&&(t.y<0||n.y<t.y+t.height&&t.y<n.y+n.height)},n.prototype.containsX=function(n){return this.x<=n&&n<this.x+this.width},n.prototype.containsY=function(n){return this.y<=n&&n<this.y+this.height},n}();t._Layout=a;e=function(){function u(n,t,u){this._defaultRowCount=200;this._defaultColCount=20;this._isSuspendDirty=!1;var f=this;f.rowCount=n!==r&&n!==i?n:f._defaultRowCount;f.colCount=t!==r&&t!==i?t:f._defaultColCount;f.name=u;f.dataTable={};f._rowDataArray=[];f._columnDataArray=[];f._defaultDataNode=r;f.dirtyNodes={}}return u.prototype.getRowCount=function(){return this.rowCount},u.prototype.getColumnCount=function(){return this.colCount},u.prototype._updateDirty=function(n,t){if(!this._isSuspendDirty&&n>=0&&t>=0){var i=this.dataTable[n];i.rs!=="n"&&(i.rs="e");this.dirtyNodes[n]=i}},u.prototype._suspendDirty=function(){this._isSuspendDirty=!0},u.prototype._resumeDirty=function(){this._isSuspendDirty=!1},u.prototype.getValue=function(n,t){var u=this.getNode(n,t);return u&&u.value!==i&&u.value!==r?u.value:r},u.prototype.setValue=function(n,t,i){var r=this.getNode(n,t,!0);r.value!==i&&(r.value=i,this._updateDirty(n,t))},u.prototype.getBindingPath=function(n,t){var u=this.getNode(n,t);return u&&u.bindingPath!==i&&u.bindingPath!==r?u.bindingPath:r},u.prototype.setBindingPath=function(n,t,i){var r=this.getNode(n,t,!0);r.bindingPath!==i&&(r.bindingPath=i,this._updateDirty(n,t))},u.prototype.getSparkline=function(n,t){var i=this.getNode(n,t);return i&&i.sparkline||r},u.prototype.setSparkline=function(n,t,i){var r=this.getNode(n,t,!0);r.sparkline!==i&&(r.sparkline=i,this._updateDirty(n,t))},u.prototype.setFormula=function(n,t,i,r){var u=this.getNode(n,t,!0);u.formula!==i&&(u.formula=i,this._updateDirty(n,t));r&&(u.arrayInfo=r)},u.prototype.getFormula=function(n,t){var i=this.getNode(n,t);return i&&i.formula},u.prototype.getStyle=function(n,t){var i=this.getNode(n,t);return i&&i.style},u.prototype.setStyle=function(n,t,i){var r=this.getNode(n,t,!0);r&&r.style!==i&&(r.style=i,this._updateDirty(n,t))},u.prototype.getComment=function(n,t){var i=this.getNode(n,t);return i&&i.comment},u.prototype.setComment=function(n,t,i){var r=this.getNode(n,t,!0);r&&r.comment!==i&&(r.comment=i,this._updateDirty(n,t))},u.prototype.getVisualState=function(n,t){var i=this.getNode(n,t);return i&&i.visualState},u.prototype.setVisualState=function(n,t,i){var r=this.getNode(n,t,!0);r.visualState!==i&&(r.visualState=i,this._updateDirty(n,t))},u.prototype.addRows=function(n,t){var i=this,r;if(!(n<0)&&!(n>i.rowCount)&&!(t<0))for(i.addElements(i.dataTable,i.rowCount,n,t),i.addElements(i._rowDataArray,i.rowCount,n,t),i.addElements(i.dirtyNodes,i.rowCount,n,t),i.rowCount+=t,r=0;r<t;r++)i.dataTable[n+r]={rs:"n"},i.dirtyNodes[n+r]=i.dataTable[n+r]},u.prototype.deleteRows=function(n,t){var i=this,r=i.rowCount;n<0||n>=r||t<=0||(n+t>r&&(t=r-n),i.deleteElements(i.dataTable,r,n,t),i.deleteElements(i._rowDataArray,r,n,t),i.deleteElements(i.dirtyNodes,r,n,t),i.rowCount-=t)},u.prototype.addElements=function(n,t,u,f){var s,c,e,h,l;if(n&&0<=u&&u<t){for(s=[],e=u;e<t;e++)n[e]!==i&&s.push(e);for(c=s.length,e=0;e<c;e++)h=s[c-e-1],l=n[h],n[h]=r,n[o(h)+f]=l}},u.prototype.deleteElements=function(n,t,u,f){var s,l,c,e,h,a;if(n&&0<=u&&u<t){for(s=[],c=u+f,e=u;e<t;e++)n[e]!==i&&(u<=e&&e<c?n[e]=r:e>=c&&s.push(e));for(l=s.length,e=0;e<l;e++)h=s[e],a=n[h],n[h]=r,n[o(h)-f]=a}},u.prototype.addColumns=function(n,t){var i=this,r,u;if(!(n<0)&&!(n>i.colCount)&&!(t<0)){for(r=0;r<i.rowCount;r++)u=i.dataTable[r],u&&n<i.colCount&&i.addElements(u,i.colCount,n,t);i.addElements(i._columnDataArray,i.colCount,n,t);i.colCount+=t}},u.prototype.deleteColumns=function(n,t){var i=this,u=i.colCount,r,f;if(!(n<0)&&!(n>=u)&&!(t<0)){for(r=0;r<i.rowCount;r++)f=i.dataTable[r],f&&n<i.colCount&&i.deleteElements(f,i.colCount,n,t);i.deleteElements(i._columnDataArray,i.colCount,n,t);n+t>u&&(t=u-n);i.colCount-=t}},u.prototype.getNode=function(n,t,i){var f=this,u,e;return n>=f.rowCount||t>=f.colCount?r:(u=r,n>=0&&t>=0?(e=f.dataTable[n],i&&!e&&(e=f.dataTable[n]={}),e&&(u=e[t],i&&!u&&(u=e[t]={}))):n===-1&&t>=0?(u=f._columnDataArray[t],i&&!u&&(u=f._columnDataArray[t]={})):n>=0&&t===-1?(u=f._rowDataArray[n],i&&!u&&(u=f._rowDataArray[n]={})):n===-1&&t===-1&&(u=f._defaultDataNode,i&&!u&&(u=f._defaultDataNode={})),u)},u.prototype._setNode4Swap=function(n,t,i,r,u){var f=this,e;i>=0&&r>=0?(e=f.dataTable[i],e||(e=f.dataTable[i]={}),e[r]=u,u&&u.cellCalc&&delete u.cellCalc):i>=0&&r===-1&&n>=0&&t===-1?f._rowDataArray[i]=u:r>=0&&i===-1&&t>=0&&n===-1&&(f._columnDataArray[r]=u)},u.prototype.swapNode=function(n,t,i,u){var f=this,e=f.getNode(n,t),o=f.getNode(i,u);e?f._setNode4Swap(n,t,i,u,e):o&&f._setNode4Swap(n,t,i,u,r);o?f._setNode4Swap(i,u,n,t,o):e&&f._setNode4Swap(i,u,n,t,r)},u.prototype.getDataRowIndex=function(n){return n},u.prototype.nextNonNullRow=function(n){n++;for(var t=this.rowCount,i=this.dataTable;n>=0&&n<t;){if(i[n])break;n++}return n<t?n:-1},u.prototype.nextNonNullColumn=function(n,t){var i=this,u=r,f=i.colCount;if(n>=0&&n<i.rowCount&&(u=i.dataTable[n]),!u)return-1;for(t++;t>=0&&t<f;){if(u[t])break;t++}return t<f?t:-1},u.prototype.clear=function(n,t,i,r,u,f){var e=this,c=[],o,h,s;if(n>=0&&t>=0){if(n+i>e.rowCount&&(i=e.rowCount-n),i<=0)return;if(t+r>e.colCount&&(r=e.colCount-t),r<=0)return;for(s=n;s<n+i;s++)if(!f||!(f.indexOf(s)>=0))for(h=t;h<t+r;h++)o=e.getNode(s,h),o&&c.push(o)}else if(n>=0&&t===-1){if(n+i>e.rowCount&&(i=e.rowCount-n),i<=0)return;for(s=n;s<n+i;s++)o=e.getNode(s,-1),o&&c.push(o)}else if(n===-1&&t>=0){if(t+r>e.colCount&&(r=e.colCount-t),r<=0)return;for(h=t;h<t+r;h++)o=e.getNode(-1,h),o&&c.push(o)}else n===-1&&t===-1&&(o=e._defaultDataNode,o&&c.push(o));e.clearCore(c,u)},u.prototype.clearCore=function(n,t){for(var i=0;i<n.length;i++)n[i]&&((t&2)>0&&(n[i].style=r),(t&1)>0&&(n[i].value=r,n[i].formula=r),(t&16)>0&&(n[i].sparkline=r),(t&64)>0&&(n[i].bindingPath=r),(t&4)>0&&(n[i].comment=r))},u.prototype.toJSON=function(n){var t=this,u={},f,a,c,e,o,i,s,h,r,l;for(n===2?(t.rowCount!==t._defaultRowCount&&(u.rowCount=t.rowCount),t.colCount!==1&&(u.colCount=t.colCount)):n===1?(t.rowCount!==1&&(u.rowCount=t.rowCount),t.colCount!==t._defaultColCount&&(u.colCount=t.colCount)):(t.rowCount!==t._defaultRowCount&&(u.rowCount=t.rowCount),t.colCount!==t._defaultColCount&&(u.colCount=t.colCount)),f={},i=t.nextNonNullRow(-1);i>=0;){for(a=f[i]={},r=t.nextNonNullColumn(i,-1);r>=0;)c=t.getNode(i,r),c&&(a[r]=t._toJSONNode(c)),r=t.nextNonNullColumn(i,r);i=t.nextNonNullRow(i)}for($.isEmptyObject(f)||(u.dataTable=f),e=[],o=t._rowDataArray,i=0;i<t.rowCount;i++)o.hasOwnProperty(i)&&o[i]&&(e[i]=t._toJSONNode(o[i]));for(e.length>0&&(u.rowDataArray=e),s=[],h=t._columnDataArray,r=0;r<t.colCount;r++)h.hasOwnProperty(r)&&h[r]&&(s[r]=t._toJSONNode(h[r]));return s.length>0&&(u.columnDataArray=s),l=t._toJSONNode(t._defaultDataNode,n),$.isEmptyObject(l)||(u.defaultDataNode=l),u},u.prototype.fromJSON=function(n){var r,t,s,h,c,a,v,e,u,o,f,l;if(n){if(r=this,t=n,this._suspendDirty(),t.name!==i&&(r.name=t.name),t.rowCount!==i&&(r.rowCount=t.rowCount),t.colCount!==i&&(r.colCount=t.colCount),s=t.dataTable,s)for(a=r.rowCount,v=r.colCount,u=0;u<a;u++)if(h=s[u],h)for(f=0;f<v;f++)(c=h[f],c)&&r._copyFromJSONNode(u,f,c);if(e=t.rowDataArray?t.rowDataArray:t._rowDataArray,e)for(u=0;u<r.rowCount;u++)e.hasOwnProperty(u)&&e[u]&&r._copyFromJSONNode(u,-1,e[u]);if(o=t.columnDataArray?t.columnDataArray:t._columnDataArray,o)for(f=0;f<r.colCount;f++)o.hasOwnProperty(f)&&o[f]&&r._copyFromJSONNode(-1,f,o[f]);l=t.defaultDataNode?t.defaultDataNode:t._defaultDataNode;l&&r._copyFromJSONNode(-1,-1,l);this._resumeDirty()}},u.prototype._getCellTypeKinds=function(){if(!this._dict){var t={},i=n.spread,r=i.CellTypeKind;t[r.BaseCellType]=i.BaseCellType;t[r.TextCellType]=i.TextCellType;t[r.ColumnHeaderCellType]=i.ColumnHeaderCellType;t[r.RowHeaderCellType]=i.RowHeaderCellType;t[r.CornerCellType]=i.CornerCellType;t[r.CheckBoxCellType]=i.CheckBoxCellType;t[r.ButtonCellType]=i.ButtonCellType;t[r.ComboBoxCellType]=i.ComboBoxCellType;t[r.HyperLinkCellType]=i.HyperLinkCellType;this._dict=t}return this._dict},u.prototype._saveStyle=function(n,t,r){t.backgroundImage!==i&&(n.backgroundImage=t.backgroundImage);t.backgroundImageLayout!==i&&(n.backgroundImageLayout=t.backgroundImageLayout);t.backColor!==i&&(n.backColor=t.backColor);t.font!==i&&(n.font=t.font);t.themeFont!==i&&(n.themeFont=t.themeFont);t.formatter!==i&&(n.formatter=t.formatter);t.validator!==i&&(n.validator=t.validator);t.borderLeft!==i&&(n.borderLeft=t.borderLeft);t.borderTop!==i&&(n.borderTop=t.borderTop);t.borderRight!==i&&(n.borderRight=t.borderRight);t.borderBottom!==i&&(n.borderBottom=t.borderBottom);t.locked!==i&&(n.locked=t.locked);t.textIndent!==i&&(n.textIndent=t.textIndent);t.wordWrap!==i&&(n.wordWrap=t.wordWrap);t.shrinkToFit!==i&&(n.shrinkToFit=t.shrinkToFit);t.cellType!==i&&(n.cellType=t.cellType);t.tabStop!==i&&(n.tabStop=t.tabStop);t.textDecoration!==i&&(n.textDecoration=t.textDecoration);t.name!==i&&(n.name=t.name);t.parentName!==i&&(n.parentName=t.parentName);t.foreColor!==i&&t.foreColor!=="#000000"&&(n.foreColor=t.foreColor);t.imeMode!==i&&t.imeMode!==1&&(n.imeMode=t.imeMode);r===2?(t.hAlign!==i&&t.hAlign!==1&&(n.hAlign=t.hAlign),t.vAlign!==i&&t.vAlign!==1&&(n.vAlign=t.vAlign)):r===1?(t.hAlign!==i&&t.hAlign!==1&&(n.hAlign=t.hAlign),t.vAlign!==i&&t.vAlign!==1&&(n.vAlign=t.vAlign)):(t.hAlign!==i&&t.hAlign!==3&&(n.hAlign=t.hAlign),t.vAlign!==i&&t.vAlign!==0&&(n.vAlign=t.vAlign))},u.prototype._toJSONNode=function(n,u){var f,e,o;return n?(f={},n.value!==i&&n.value!==r&&(f.value=n.value),n.formula!==i&&n.formula!==r&&(f.formula=n.formula,n.arrayInfo&&(f.arrayInfo=n.arrayInfo)),e=n.style,typeof e=="string"?f.style=e:e&&(o={},this._saveStyle(o,e,u),$.isEmptyObject(o)||(f.style=o,e.font&&(f.style.font=t.StyleHelper.normalizeFont(e.font)))),n.bindingPath!==i&&n.bindingPath!==r&&(f.bindingPath=n.bindingPath),f):r},u.prototype._copyFromJSONNode=function(u,f,e){var c,o,l,a,w,v;if(e){var h=this,y=u,p=f,s=h.getNode(y,p,!0);h._updateDirty(y,p);e.value!==i&&(e.value!=r&&e.value._calcError&&(c=t.Calc.CalcError._parseCore(e.value._calcError),c!==i&&(e.value=c)),s.value=e.value);e.formula!==i&&(s.formula=e.formula,e.arrayInfo&&(s.arrayInfo=e.arrayInfo));e.style!==i&&(o=r,typeof e.style=="string"?o=e.style:e.style&&(o=new t.Style,o.copyFrom(e.style),e.style.validator!==i&&(t.features.dataValidator&&(l=new n.spread.DefaultDataValidator,l.fromJSON(e.style.validator)),o.validator=l),e.style.cellType!==i&&(w=h._getCellTypeKinds(),v=w[e.style.cellType.type],v&&(a=new v,a.fromJSON(e.style.cellType)),o.cellType=a)),s.style=o);e.visualState!==i&&(s.visualState=e.visualState);e.bindingPath!==i&&(s.bindingPath=e.bindingPath)}},u}();t._GcSheetModel=e;v=function(){function n(n,t,i){this.changed=r;var u=this;u._context=n;parseInt(t.toString(),10)<0&&(t=2147483647);u._maxLength=t;u._allowUndo=i;u._undoStack=[];u._redoStack=[]}return n.prototype.context=function(){return this._context},n.prototype.canUndo=function(){return this._undoStack.length>0},n.prototype.canRedo=function(){return this._redoStack.length>0},n.prototype._shrinkUndoStack=function(n){for(var t=0;t<n;t++)this._undoStack.shift()},n.prototype._raiseChanged=function(){var n=this;n.changed&&typeof n.changed=="function"&&n.changed(n)},n.prototype.doAction=function(n){if(!n||!n.execute)return!1;var t=this,i=!0;try{n.execute(t._context)}catch(r){i=!1}return t._allowUndo&&i&&n.canUndo()&&n.undo&&(t._maxLength>0&&t._undoStack.length>=t._maxLength&&t._shrinkUndoStack(t._undoStack.length-t._maxLength+1),t._undoStack.push(n),t._redoStack=[],t._raiseChanged()),i},n.prototype.undo=function(){var n=this,i=!0,t;if(n._allowUndo&&n.canUndo()){t=n._undoStack[n._undoStack.length-1];try{t&&t.canUndo&&t.canUndo()&&t.undo&&(i=t.undo(n._context))}catch(r){i=!1}i&&(n._redoStack.push(n._undoStack.pop()),n._raiseChanged())}return i},n.prototype.redo=function(){var n=this,i=!0,t;if(n._allowUndo&&n.canRedo()){t=n._redoStack[n._redoStack.length-1];try{t&&t.execute&&t.execute(n._context)}catch(r){i=!1}i&&(n._undoStack.push(n._redoStack.pop()),n._raiseChanged())}return i},n.prototype.getUndoList=function(){return this._undoStack.slice(0)},n.prototype.getRedoList=function(){return this._redoStack.slice(0)},n}();t._UndoManager=v;y=function(n){function r(t,i,r){n.call(this,t,i,r)}return __extends(r,n),r.prototype.getExpr=function(n,t){var i=this.getNode(n,t);return i&&i.expr},r.prototype.setExpr=function(n,t,r,u,f){var e=this.getNode(n,t,!0);e.expr=r;u?e.arrayInfo=u:e.arrayInfo&&(e.arrayInfo=i);e.workingExpr=f?f:i},r.prototype.clearExpr=function(n,t){var r=this.getNode(n,t,!0);r&&(r.expr=r.workingExpr=r.arrayInfo=i)},r.prototype.CopyExpr=function(n,i,r,u,f){var e=this.getNode(i,r),o;e&&e.expr&&(o=n.getNode(u,f,!0),e.arrayInfo&&(o.arrayInfo=new t.Range(u,f,e.arrayInfo.rowCount-(i-e.arrayInfo.row),e.arrayInfo.colCount-(r-e.arrayInfo.col))),o.expr=e.expr,e.workingExpr&&(o.workingExpr=e.workingExpr))},r.prototype.getWorkingExpr=function(n,t){var i=this.getNode(n,t);return i&&(i.workingExpr||i.expr)},r.prototype.containsNoe=function(n,t){var r=this.dataTable,i=r[n];return i&&i[t]},r.prototype.clearCore=function(t,r){var f,u;for(n.prototype.clearCore.call(this,t,r),f=0;f<t.length;f++)u=t[f],u&&(r&1)>0&&(u.arrayInfo&&(u.arrayInfo=i),u.expr&&(u.expr=i),u.workingExpr&&(u.workingExpr=i))},r}(e);t._CalcModel=y})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){(function(t){function f(n,t){if(n){if(n._editorStatus===2)return!1;var i=n._formulaTextBox;return i&&i.canAppendRange()?n._moveFormulaTextBoxCell(t,!1):n.moveActiveCell(t,!1),!0}return!1}function u(n,t,i,r){if(n){if(n._editorStatus===2)return!1;var u=n._formulaTextBox;return u&&u.canAppendRange()?n._moveFormulaTextBoxCell(t,!1,i,r):n.moveActiveCell(t,!1,i,r),!0}return!1}function i(n,t,i){if(n){if(n._editorStatus===2)return!1;var r=n._formulaTextBox;return r&&r.canAppendRange()?n._changeFormulaTextBoxActiveRange(t,i):(n.endEdit(),n._changeActiveSelectedRange(t,i)),!0}return!1}function o(n,t){for(var i,r=[],u=0,f=n._floatingObjectArray.length;u<f;u++)i=n._floatingObjectArray[u],t&&i.isSelected()?r.push(i.name()):r.push(i.name);return r}var r,e;t.feature("core.sheet_action",["core.common","core.sheet_model"]);r=null;e=function(){function e(){}return e.navigationLeft=function(){return f(this,3)},e.navigationRight=function(){return f(this,4)},e.navigationUp=function(){return f(this,1)},e.navigationDown=function(){return f(this,2)},e.commitArrayFormula=function(){var n=this;return n.commitArrayFormula(),!0},e.commitInputNavigationDown=function(){var n=this;return n.moveActiveCell(2,!1),!0},e.commitInputNavigationUp=function(){var n=this;return n.moveActiveCell(1,!1),!0},e.navigationHome=function(){var n=this;return u(n,4,r,n.frozenColCount?n.frozenColCount-1:-1)},e.navigationHome2=function(){var n=this;return u(n,4,r,-1)},e.navigationEnd=function(){var n=this;return u(this,3,r,n.getColumnCount()-n._frozenTrailingColCount)},e.navigationEnd2=function(){var n=this;return u(n,3,r,n.getColumnCount())},e.navigationTop=function(){var n=this;return u(n,2,-1,r)},e.navigationBottom=function(){var n=this;return u(n,1,n.getRowCount(),r)},e.navigationPageUp=function(){var n=this,u,s,i,e,f,o;return!n||n._editorStatus===2?!1:(u=n._getPrevPageTopRow(),u===r||u===n._scrollTopRow)?!0:(s=n._getRowLayout(1,3),i=n._getNextVisualRow(n._activeRowIndex-s.length),i<u&&(i=u),e=n._formulaTextBox,e&&e.canAppendRange()?(f=n._getKeyboardAppendingInfo(),f.anchorRow=i,f.leadingRow=i,o=n._eventHandler.rangeToString(new t.Range(f.anchorRow,f.anchorCol,1,1)),o&&e.appendRange(o,!1,!0)):(n.endEdit(),n._setActiveCellCore(i,r),n._leadingCellRow=i,n.moveActiveCell()),n._setTopRow(u),!0)},e.navigationPageDown=function(){var n=this,u,s,i,e,f,o;return!n||n._editorStatus===2?!1:(u=n._getNextPageTopRow(),u===r||u===n._scrollTopRow)?!0:(s=n._getRowLayout(1,3),i=n._getPrevVisualRow(n._activeRowIndex+s.length),i<u&&(i=u),e=n._formulaTextBox,e&&e.canAppendRange()?(f=n._getKeyboardAppendingInfo(),f.anchorRow=i,f.leadingRow=i,o=n._eventHandler.rangeToString(new t.Range(f.anchorRow,f.anchorCol,1,1)),o&&e.appendRange(o,!1,!0)):(n.endEdit(),n._setActiveCellCore(i,r),n._leadingCellRow=i,n.moveActiveCell()),n._setTopRow(u),!0)},e.navigationNextSheet=function(){var u=this,t=u.parent,f=n.spread,r,i;(t||t instanceof f.Spread)&&(r=t.getSheetCount(),i=t.getActiveSheetIndex(),i<r-1&&(i++,t.setActiveSheetIndex(i),t.repaint()))},e.navigationPreviousSheet=function(){var r=this,t=r.parent,u=n.spread,i;(t||t instanceof u.Spread)&&(i=t.getActiveSheetIndex(),i>0&&(i--,t.setActiveSheetIndex(i),t.repaint()))},e.navigationPrevious=function(){},e.navigationNext=function(){},e.navigationFirst=function(){var n=this,i,r;if(!n||n._editorStatus===2)return!1;var u=n.frozenColCount?n.frozenColCount-1:-1,f=n.frozenRowCount?n.frozenRowCount-1:-1,t=n._formulaTextBox;return t&&t.canAppendRange()?(i=n._eventHandler,r=t.isAppending?i._formulaRangeAppendingInfo:i._formulaRangeAppendingInfo={anchorRow:n._activeRowIndex,anchorCol:n._activeColIndex,leadingRow:n._leadingCellRow,leadingCol:n._leadingCellCol},n._moveFormulaTextBoxCell(4,!1,r.anchorRow,u),n._moveFormulaTextBoxCell(2,!1,f,r.anchorCol)):(n.moveActiveCell(4,!1,n._activeRowIndex,u),n.moveActiveCell(2,!1,f,n._activeColIndex)),!0},e.navigationLast=function(){var n=this,t,i,r;return!n||n._editorStatus===2?!1:(t=n._formulaTextBox,t&&t.canAppendRange()?(i=n._eventHandler,r=t.isAppending?i._formulaRangeAppendingInfo:i._formulaRangeAppendingInfo={anchorRow:n._activeRowIndex,anchorCol:n._activeColIndex,leadingRow:n._leadingCellRow,leadingCol:n._leadingCellCol},n._moveFormulaTextBoxCell(3,!1,r.anchorRow,n.getColumnCount()-n._frozenTrailingColCount),n._moveFormulaTextBoxCell(1,!1,n.getRowCount()-n._frozenTrailingRowCount,r.anchorCol)):(n.moveActiveCell(3,!1,n._activeRowIndex,n.getColumnCount()-n._frozenTrailingColCount),n.moveActiveCell(1,!1,n.getRowCount()-n._frozenTrailingRowCount,n._activeColIndex)),!0)},e.commitInputNavigationTabNext=function(){var n=this;n._isTabNavigation=!0;n._isNavigateInSelection?n._moveActiveCellInSelection(4):n.moveActiveCell(4,!0);n._isTabNavigation=!1},e.commitInputNavigationTabPrevious=function(){var n=this;n._isTabNavigation=!0;n._isNavigateInSelection?n._moveActiveCellInSelection(3):n.moveActiveCell(3,!0);n._isTabNavigation=!1},e.cancelInput=function(){var n=this,f,t,r,i,e,u;if(n.isEditing())return f=n.getValue(n._activeRowIndex,n._activeColIndex,3),n.endEdit(!0),n.setValue(n._activeRowIndex,n._activeColIndex,f,3,!0),!0;else if(t=n.parent,t&&t.sheets)for(r=t.sheets,i=0,e=r.length;i<e;i++)u=r[i],u&&u._cutCopyIndicatorManager.cancelIndicator()},e.clear=function(){var n=this;if(!n.isEditing()){var r=n.getSelections(),u=r.toArray(),i=new t.UndoRedo.ClearValueUndoAction(n,u);i.canExecute(n)&&n._doCommand(i)}},e.clearAndEditing=function(){var n=this;return n.isEditing()?!1:(n.startEdit(!0,""),!0)},e.copy=function(){var n=this;n._doCopy()},e.cut=function(){var n=this;n._doCut()},e.paste=function(){var n=this;n._doPaste()},e.selectionLeft=function(){return i(this,37)},e.selectionRight=function(){return i(this,39)},e.selectionUp=function(){return i(this,38)},e.selectionDown=function(){return i(this,40)},e.selectionHome=function(){return i(this,37,!0)},e.selectionEnd=function(){return i(this,39,!0)},e.selectionPageUp=function(){return i(this,33)},e.selectionPageDown=function(){return i(this,34)},e.selectionTop=function(){return i(this,38,!0)},e.selectionBottom=function(){return i(this,40,!0)},e.selectionFirst=function(){return i(this,36,!0)},e.selectionLast=function(){return i(this,35,!0)},e.unSelectAllFloatingObjects=function(){var n=this;n._hasFloatingObjectsSelected()&&(n._suspendInvalidate(),n.unSelectAllFloatingObjects(),n._loadAndSetSheetSelections(),n._resumeInvalidate())},e.selectAllFloatingObjects=function(){var n=this,t,r,i;if(n._hasFloatingObjectsSelected()){for(n._suspendInvalidate(),t=0,r=n._floatingObjectArray.length;t<r;t++)i=n._floatingObjectArray[t],i.isSelected()||i.isSelected(!0);n._resumeInvalidate()}},e.deleteFloatingObject=function(){var n=this,i=o(n,!0),r,u;i.length>0&&(r={names:i},u=new t.UndoRedo.DeleteFloatingObjectUndoAction(n,r),n._doCommand(u))},e.navigationNextFloatingObject=function(){var n=this,i,r,t,u;if(n._hasFloatingObjectsSelected()){for(n._suspendInvalidate(),t=0,i=0,r=n._floatingObjectArray.length;i<r;i++)u=n._floatingObjectArray[i],u.isSelected()&&(t=i);n.unSelectAllFloatingObjects();t+=1;t==n._floatingObjectArray.length&&(t=0);n._floatingObjectArray[t].isSelected(!0);n._resumeInvalidate()}},e.navigationPreviousFloatingObject=function(){var n=this,i,r,t,u;if(n._hasFloatingObjectsSelected()){for(n._suspendInvalidate(),t=0,i=0,r=n._floatingObjectArray.length;i<r;i++)u=n._floatingObjectArray[i],u.isSelected()&&(t=i);n.unSelectAllFloatingObjects();t-=1;t<0&&(t=n._floatingObjectArray.length-1);n._floatingObjectArray[t].isSelected(!0);n._resumeInvalidate()}},e.clipboardCutFloatingObject=function(){var n=this;n._doFloatingObjectCut()},e.clipboardCopyFloatingObject=function(){var n=this;n._doFloatingObjectCopy()},e.clipboardPasteFloatingObject=function(){var n=this;n._doFloatingObjectPaste()},e.moveFloatingObjectUp=function(){for(var n=this,u=[],o=0,r,e,i=0,f=n._floatingObjectArray.length;i<f;i++)r=n._floatingObjectArray[i],r.isSelected()&&u.push(r.name());e=new t.UndoRedo.MovingFloatingObjectUndoAction(n,{names:u},{offsetX:0,offsetY:-1});n._doCommand(e)},e.moveFloatingObjectDown=function(){for(var n=this,u=[],o=0,r,e,i=0,f=n._floatingObjectArray.length;i<f;i++)r=n._floatingObjectArray[i],r.isSelected()&&u.push(r.name());e=new t.UndoRedo.MovingFloatingObjectUndoAction(n,{names:u},{offsetX:0,offsetY:1});n._doCommand(e)},e.moveFloatingObjectLeft=function(){for(var n=this,u=[],o=0,r,e,i=0,f=n._floatingObjectArray.length;i<f;i++)r=n._floatingObjectArray[i],r.isSelected()&&u.push(r.name());e=new t.UndoRedo.MovingFloatingObjectUndoAction(n,{names:u},{offsetX:-1,offsetY:0});n._doCommand(e)},e.moveFloatingObjectRight=function(){for(var n=this,u=[],o=0,r,e,i=0,f=n._floatingObjectArray.length;i<f;i++)r=n._floatingObjectArray[i],r.isSelected()&&u.push(r.name());e=new t.UndoRedo.MovingFloatingObjectUndoAction(n,{names:u},{offsetX:1,offsetY:0});n._doCommand(e)},e.deleteComment=function(){var n=this,i=n._commentManager.getActiveComment(),r;i&&(r=new t.UndoRedo.CommentDeleteUndoAction(n,i),n._doCommand(r))},e.deactivateComment=function(){var n=this;n._commentManager.deactivateComment();n._loadAndSetSheetSelections();n.repaint()},e.moveCommentUp=function(){var i=this,n=i._commentManager.getActiveComment(),r;n&&(r=new t.UndoRedo.CommentPropertyUndoAction(i,n,n.location().clone(),new t.Point(n.location().x,n.location().y-1),"location"),i._doCommand(r))},e.moveCommentDown=function(){var i=this,n=i._commentManager.getActiveComment(),r;n&&(r=new t.UndoRedo.CommentPropertyUndoAction(i,n,n.location().clone(),new t.Point(n.location().x,n.location().y+1),"location"),i._doCommand(r))},e.moveCommentLeft=function(){var i=this,n=i._commentManager.getActiveComment(),r;n&&(r=new t.UndoRedo.CommentPropertyUndoAction(i,n,n.location().clone(),new t.Point(n.location().x-1,n.location().y),"location"),i._doCommand(r))},e.moveCommentRight=function(){var i=this,n=i._commentManager.getActiveComment(),r;n&&(r=new t.UndoRedo.CommentPropertyUndoAction(i,n,n.location().clone(),new t.Point(n.location().x+1,n.location().y),"location"),i._doCommand(r))},e.changeFormulaReference=function(){var n=this,t;if(n&&n._formulaTextBox&&(t=n._eventHandler,t)){n._suspendInvalidate();try{t.changeFormulaReference()}finally{n._resumeInvalidate()}}},e.undo=function(){var n=this,t=n.undoManager();n.isProtected===!1&&t.canUndo()&&t.undo()},e.redo=function(){var n=this,t=n.undoManager();n.isProtected===!1&&t.canRedo()&&t.redo()},e}();t.SpreadActions=e})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(n){(function(t){var i=null,o=undefined,s=Math.min,f=Math.max,nt=Math.ceil,y=Math.floor,h=function(){function n(n,t,i){var r=this;r.row=n;r.column=t;r.value=i}return n}(),p,e,l,c,r,u,tt,it,rt,ut,ft,et,ot,st,ht,ct,lt,at,vt,yt,pt,wt,bt,kt,b,k,d,dt,g,gt,v,ni,ti,ii,ui,w,fi,ei,oi;t.CellData=h;p=function(){function n(){}return n.prototype.saveDefaultStyle=function(n){this._defaultStyle=n;this._defaultStyleSaved=!0},n.prototype.getDefaultStyle=function(){return this._defaultStyle},n.prototype.saveDefaultColumnWidth=function(n){this._defaultColumnWidth=n;this._defaultColumnWidthSaved=!0},n.prototype.getDefaultColumnWidth=function(){return this._defaultColumnWidth},n.prototype.saveDefaultRowHeight=function(n){this._defaultRowHeight=n;this._defaultRowHeightSaved=!0},n.prototype.getDefaultRowHeight=function(){return this._defaultRowHeight},n.prototype.saveColumnHeaderDefaultStyle=function(n){this._columnHeaderDefaultStyle=n;this._columnHeaderDefaultStyleSaved=!0},n.prototype.getColumnHeaderDefaultStyle=function(){return this._columnHeaderDefaultStyle},n.prototype.saveColumnHeaderDefaultRowHeight=function(n){this._columnHeaderDefaultRowHeight=n;this._columnHeaderDefaultRowHeightSaved=!0},n.prototype.getColumnHeaderDefaultRowHeight=function(){return this._columnHeaderDefaultRowHeight},n.prototype.saveRowHeaderDefaultStyle=function(n){this._rowHeaderDefaultStyle=n;this._rowHeaderDefaultStyleSaved=!0},n.prototype.getRowHeaderDefaultStyle=function(){return this._rowHeaderDefaultStyle},n.prototype.saveRowHeaderDefaultColumnWidth=function(n){this._rowHeaderDefaultColumnWidth=n;this._rowHeaderDefaultColumnWidthSaved=!0},n.prototype.getRowHeaderDefaultColumnWidth=function(){return this._rowHeaderDefaultColumnWidth},n.prototype.saveCommentManager=function(n){this._commentManager=n;this._commentManagerSaved=!0},n.prototype.isDefaultStyleSaved=function(){return this._defaultStyleSaved},n.prototype.isDefaultColumnWidthSaved=function(){return this._defaultColumnWidthSaved},n.prototype.isDefaultRowHeightSaved=function(){return this._defaultRowHeightSaved},n.prototype.isColumnHeaderDefaultStyleSaved=function(){return this._columnHeaderDefaultStyleSaved},n.prototype.isColumnHeaderDefaultRowHeightSaved=function(){return this._columnHeaderDefaultRowHeightSaved},n.prototype.isRowHeaderDefaultStyleSaved=function(){return this._rowHeaderDefaultStyleSaved},n.prototype.isRowHeaderDefaultColumnWidthSaved=function(){return this._rowHeaderDefaultColumnWidthSaved},n.prototype.isCommentManagerSaved=function(){return this._commentManagerSaved},n}();t.CopyMoveSheetInfo=p;e=function(){function n(n,t){var i=this;i._rowCount=n;i._columnCount=t;i._init()}return n.prototype._init=function(){var n=this;n._values=[];n._formulas=[];n._sparklines=[];n._styles=[];n._comments=[];n._tags=[];n._bindingPaths=[];n._spans=i;n._arrayFormulas=[];n._valueSaved=!1;n._formulaSaved=!1;n._sparklineSaved=!1;n._styleSaved=!1;n._commentSaved=!1;n._tagSaved=!1;n._spanSaved=!1;n._arrayFormulaSaved=!1;n._bindingPathSaved=!1},n.prototype.saveValue=function(n,t,r){r!==o&&r!==i&&this._values.push(new h(n,t,r));this._valueSaved=!0},n.prototype.getValues=function(){return this._values},n.prototype.saveFormula=function(n,t,i){i&&i!==""&&this._formulas.push(new h(n,t,i));this._formulaSaved=!0},n.prototype.getFormulas=function(){return this._formulas},n.prototype.saveArrayFormula=function(n){this._arrayFormulas.push(n);this._arrayFormulaSaved=!0},n.prototype.getArrayFormula=function(){return this._arrayFormulas},n.prototype.saveSparkline=function(n,t,i){i&&this._sparklines.push(new h(n,t,i));this._sparklineSaved=!0},n.prototype.getSparklines=function(){return this._sparklines},n.prototype.saveStyle=function(n,t,i){i&&this._styles.push(new h(n,t,i));this._styleSaved=!0},n.prototype.getStyles=function(){return this._styles},n.prototype.saveComment=function(n,t,i){i&&this._comments.push(new h(n,t,i));this._commentSaved=!0},n.prototype.getComments=function(){return this._comments},n.prototype.saveTag=function(n,t,r){r!==o&&r!==i&&this._tags.push(new h(n,t,r));this._tagSaved=!0},n.prototype.getTags=function(){return this._tags},n.prototype.saveBindingPath=function(n,t,r){r!==o&&r!==i&&this._bindingPaths.push(new h(n,t,r));this._bindingPathSaved=!0},n.prototype.getBindingPaths=function(){return this._bindingPaths},n.prototype.saveSpan=function(n){var t=this;t._spans||(t._spans=[]);t._spans.push(n);t._spanSaved=!0},n.prototype.isValueSaved=function(){return this._valueSaved},n.prototype.isFormulaSaved=function(){return this._formulaSaved},n.prototype.isArrayFormulaSaved=function(){return this._arrayFormulaSaved},n.prototype.isSparklineSaved=function(){return this._sparklineSaved},n.prototype.isStyleSaved=function(){return this._styleSaved},n.prototype.isCommentSaved=function(){return this._commentSaved},n.prototype.isTagSaved=function(){return this._tagSaved},n.prototype.isSpanSaved=function(){return this._spanSaved},n.prototype.isBindingPathSaved=function(){return this._bindingPathSaved},n}();t.CopyMoveCellsInfo=e;l=function(){function n(n){this._columnCount=n;this._init()}return n.prototype._init=function(){var n=this;n._widths={};n._visibles={};n._resizables={};n._tags={};n._viewportColumnStyles={};n._headerColumnStyles={};n._levels={};n._collapsed={};n._bindingFields={};n._widthSaved=!1;n._visibleSaved=!1;n._resizableSaved=!1;n._tagSaved=!1;n._viewportColumnStyleSaved=!1;n._headerColumnStyleSaved=!1;n._rangeGroupSaved=!1;n._bindingFieldSaved=!1},n.prototype.saveWidth=function(n,t){var r=this;r._widths[n]!==i?r._widths[n]=t<0?i:t:t>=0&&(r._widths[n]=t);r._widthSaved=!0},n.prototype.getWidth=function(n){return this._widths[n]!==i?this._widths[n]:-1},n.prototype.saveVisible=function(n,t){var r=this;r._visibles[n]!==i?r._visibles[n]=t?i:t:t||(r._visibles[n]=t);r._visibleSaved=!0},n.prototype.getVisible=function(n){return this._visibles[n]!==i?this._visibles[n]:!0},n.prototype.saveResizable=function(n,t){var r=this;r._resizables[n]!==i?r._resizables[n]=t?i:t:t||(r._resizables[n]=t);r._resizableSaved=!0},n.prototype.getResizable=function(n){return this._resizables[n]!==i?this._resizables[n]:!0},n.prototype.saveTag=function(n,t){var r=this;r._tags[n]!==i?r._tags[n]=t===o||t===i?i:t:t!==i&&(r._tags[n]=t);r._tagSaved=!0},n.prototype.getTag=function(n){return this._tags[n]!==i?this._tags[n]:i},n.prototype.saveViewportColumnStyle=function(n,t){var r=this;r._viewportColumnStyles[n]?r._viewportColumnStyles[n]=t?t:i:t&&(r._viewportColumnStyles[n]=t);r._viewportColumnStyleSaved=!0},n.prototype.getViewportColumnStyle=function(n){return this._viewportColumnStyles[n]?this._viewportColumnStyles[n]:i},n.prototype.saveHeaderColumnStyle=function(n,t){var r=this;r._headerColumnStyles[n]?r._headerColumnStyles[n]=t?t:i:t&&(r._headerColumnStyles[n]=t);r._headerColumnStyleSaved=!0},n.prototype.getHeaderColumnStyle=function(n){return this._headerColumnStyles[n]?this._headerColumnStyles[n]:i},n.prototype.saveRangeGroup=function(n,t,r){var u=this;u._levels[n]!==i?u._levels[n]=t<0?i:t:t>=0&&(u._levels[n]=t);u._collapsed[n]!==i?u._collapsed[n]=r?r:i:r&&(u._collapsed[n]=r);u._rangeGroupSaved=!0},n.prototype.getRangeGroup=function(n,t){var r=this;t.level=-1;t.collapsed=!1;r._levels[n]!==i&&(t.level=r._levels[n]);r._collapsed[n]!==i&&(t.collapsed=r._collapsed[n])},n.prototype.saveBindingField=function(n,t){this._bindingFields[n]=t;this._bindingFieldSaved=!0},n.prototype.getBindingField=function(n,t){return(t.fieldName=i,this._bindingFields[n]!==i)?(t.fieldName=this._bindingFields[n],!0):!1},n.prototype.isWidthSaved=function(){return this._widthSaved},n.prototype.isVisibleSaved=function(){return this._visibleSaved},n.prototype.isResizableSaved=function(){return this._resizableSaved},n.prototype.isTagSaved=function(){return this._tagSaved},n.prototype.isViewportColumnStyleSaved=function(){return this._viewportColumnStyleSaved},n.prototype.isHeaderColumnStyleSaved=function(){return this._headerColumnStyleSaved},n.prototype.isRangeGroupSaved=function(){return this._rangeGroupSaved},n.prototype.isBindingFieldSaved=function(){return this._bindingFieldSaved},n}();t.CopyMoveColumnsInfo=l;c=function(){function n(n){this._rowCount=n;this._init()}return n.prototype._init=function(){var n=this;n._heights={};n._visibles={};n._resizables={};n._tags={};n._viewportRowStyles={};n._headerRowStyles={};n._levels={};n._collapsed={};n._heightSaved=!1;n._visibleSaved=!1;n._resizableSaved=!1;n._tagSaved=!1;n._viewportRowStyleSaved=!1;n._headerRowStyleSaved=!1;n._rangeGroupSaved=!1},n.prototype.saveHeight=function(n,t){var r=this;r._heights[n]!==i?r._heights[n]=t<0?i:t:t>=0&&(r._heights[n]=t);r._heightSaved=!0},n.prototype.getHeight=function(n){return this._heights[n]!==i?this._heights[n]:-1},n.prototype.saveVisible=function(n,t){var r=this;r._visibles[n]!==i?r._visibles[n]=t?i:t:t||(r._visibles[n]=t);r._visibleSaved=!0},n.prototype.getVisible=function(n){return this._visibles[n]!==i?this._visibles[n]:!0},n.prototype.saveResizable=function(n,t){var r=this;r._resizables[n]!==i?r._resizables[n]=t?i:t:t||(r._resizables[n]=t);r._resizableSaved=!0},n.prototype.getResizable=function(n){return this._resizables[n]!==i?this._resizables[n]:!0},n.prototype.saveTag=function(n,t){var r=this;r._tags[n]!==i?r._tags[n]=t===o||t===i?i:t:t!==i&&(r._tags[n]=t);r._tagSaved=!0},n.prototype.getTag=function(n){return this._tags[n]!==i?this._tags[n]:i},n.prototype.saveViewportRowStyle=function(n,t){var r=this;r._viewportRowStyles[n]?r._viewportRowStyles[n]=t?t:i:t&&(r._viewportRowStyles[n]=t);r._viewportRowStyleSaved=!0},n.prototype.getViewportRowStyle=function(n){return this._viewportRowStyles[n]?this._viewportRowStyles[n]:i},n.prototype.saveHeaderRowStyle=function(n,t){var r=this;r._headerRowStyles[n]?r._headerRowStyles[n]=t?t:i:t&&(r._headerRowStyles[n]=t);r._headerRowStyleSaved=!0},n.prototype.getHeaderRowStyle=function(n){return this._headerRowStyles[n]?this._headerRowStyles[n]:i},n.prototype.saveRangeGroup=function(n,t,r){var u=this;u._levels[n]!==i?u._levels[n]=t<0?i:t:t>=0&&(u._levels[n]=t);u._collapsed[n]!==i?u._collapsed[n]=r?r:i:r&&(u._collapsed[n]=r);u._rangeGroupSaved=!0},n.prototype.getRangeGroup=function(n,t){var r=this;t.level=-1;t.collapsed=!1;r._levels[n]!==i&&(t.level=r._levels[n]);r._collapsed[n]!==i&&(t.collapsed=r._collapsed[n])},n.prototype.isHeightSaved=function(){return this._heightSaved},n.prototype.isVisibleSaved=function(){return this._visibleSaved},n.prototype.isResizableSaved=function(){return this._resizableSaved},n.prototype.isTagSaved=function(){return this._tagSaved},n.prototype.isViewportRowStyleSaved=function(){return this._viewportRowStyleSaved},n.prototype.isHeaderRowStyleSaved=function(){return this._headerRowStyleSaved},n.prototype.isRangeGroupSaved=function(){return this._rangeGroupSaved},n}();t.CopyMoveRowsInfo=c;r=function(){function n(){}return n.getStyleObject=function(n,t,i,r){return n.getStyleObject(t,i,r)},n.setStyleObject=function(n,t,i,r,u){n.setStyleObject(t,i,u,r)},n.getComment=function(n,t,i){return n.getComment(t,i)},n.setComment=function(n,t,i,r){n.setComment(t,i,r)},n.saveSheetInfo=function(n,t,i){(i&64)>0&&(t.saveDefaultStyle(n.getDefaultStyle()),t.saveColumnHeaderDefaultStyle(n.getDefaultStyle(1)),t.saveRowHeaderDefaultStyle(n.getDefaultStyle(2)));t.saveDefaultColumnWidth(n.defaults.colWidth);t.saveDefaultRowHeight(n.defaults.rowHeight);t.saveColumnHeaderDefaultRowHeight(n.defaults.rowHeight);t.saveRowHeaderDefaultColumnWidth(n.defaults.rowHeaderColWidth)},n.saveColumnHeaderInfo=function(t,i,r,u,f){for(var l=i._rowCount,o=i._columnCount,e,a,c,h,s=0;s<l;s++)for(e=0;e<o;e++)(f&1)>0&&(a=t._getModel(1).getValue(s,u+e),i.saveValue(s,e,a)),(f&64)>0&&i.saveStyle(s,e,n.getStyleObject(t,s,u+e,1));if((f&1)>0)for(e=0;e<o;e++)t.isColumnBound(u+e)&&r.saveBindingField(e,t.getDataColumnName(u+e));if((f&32)>0)for(c=t._colHeaderSpanModel.getEnumerator(0,u,l,o);c.moveNext();)i.saveSpan(c.current());for(o=r._columnCount,e=0;e<o;e++)r.saveWidth(e,t._getActualColumnWidth(u+e)),r.saveVisible(e,t.getColumnVisible(u+e)),r.saveResizable(e,t.getColumnResizable(u+e));if((f&64)>0)for(e=0;e<o;e++)r.saveViewportColumnStyle(e,n.getStyleObject(t,-1,u+e,3)),r.saveHeaderColumnStyle(e,n.getStyleObject(t,-1,u+e,1));if((f&8)>0&&(h=t.colRangeGroup,h&&!h._isEmpty()))for(e=0;e<o;e++)r.saveRangeGroup(e,h.getLevel(u+e),h.getCollapsed(u+e))},n.saveRowHeaderInfo=function(t,i,r,u,f){var o,c,e,s,a,l,h;if(!((f&1023)<=0)){for(o=i._rowCount,c=i._columnCount,e=0;e<o;e++)for(s=0;s<c;s++)(f&1)>0&&(a=t._getModel(2).getValue(u+e,s),i.saveValue(e,s,a)),(f&64)>0&&i.saveStyle(e,s,n.getStyleObject(t,u+e,s,2));if((f&32)>0)for(l=t._rowHeaderSpanModel.getEnumerator(u,0,o,c);l.moveNext();)i.saveSpan(l.current());for(o=r._rowCount,e=0;e<o;e++)r.saveHeight(e,t._getActualRowHeight(u+e)),r.saveVisible(e,t.getRowVisible(u+e)),r.saveResizable(e,t.getRowResizable(u+e));if((f&64)>0)for(e=0;e<o;e++)r.saveViewportRowStyle(e,n.getStyleObject(t,u+e,-1,3)),r.saveHeaderRowStyle(e,n.getStyleObject(t,u+e,-1,2));if((f&8)>0&&(h=t.rowRangeGroup,h&&!h._isEmpty()))for(e=0;e<o;e++)r.saveRangeGroup(e,h.getLevel(u+e),h.getCollapsed(u+e))}},n.saveViewportInfo=function(t,r,u,f,e){var l,a,o,s,h,v;if(!((e&1023)<=0)){for(l=r._rowCount,a=r._columnCount,o=0;o<l;o++)for(s=0;s<a;s++){if((e&2)>0&&(h=t.getFormulaInformation(u+o,f+s),h.hasFormula&&(h.isArrayFormula?h.baseRange.row===u+o&&h.baseRange.col===f+s&&r.saveArrayFormula(h):r.saveFormula(o,s,h.formula))),(e&1)>0&&(!h||!h.hasFormula)&&r.saveValue(o,s,t.getValue(u+o,f+s,3)),(e&16)>0){var c=t.getSparkline(u+o,f+s),y=i,p=i;c&&(y=c.data(),p=c.dateAxisData());c&&y?r.saveSparkline(o,s,c.clone()):r.saveSparkline(o,s,i)}(e&64)>0&&r.saveStyle(o,s,n.getStyleObject(t,u+o,f+s,3));r.saveComment(o,s,n.getComment(t,u+o,f+s));(e&256)>0&&r.saveBindingPath(o,s,t.getBindingPath(u+o,f+s,3))}if((e&32)>0)for(v=t._spanModel.getEnumerator(u,f,l,a);v.moveNext();)r.saveSpan(v.current())}},n.undoCellsInfo=function(t,r,u,f,e){var ft=r._rowCount,et=r._columnCount,o,p,b,k,d,v,l,a,ot,g,st,ht,nt,y,s,ct,tt,lt,it,at,rt,yt,h,w,c,ut,vt;t.suspendCalcService();t.suspendEvent();try{for(l=0;l<ft;l++)for(a=0;a<et;a++)r.isBindingPathSaved()&&t.setBindingPath(u+l,f+a,i,e),r.isFormulaSaved()&&e===3&&t.setFormula(u+l,f+a,i),r.isSparklineSaved()&&e===3&&t.removeSparkline(u+l,f+a),r.isValueSaved()&&t.setValue(u+l,f+a,i,e),r.isStyleSaved()&&n.setStyleObject(t,u+l,f+a,e,i),r.isCommentSaved()&&n.setComment(t,u+l,f+a,i);if(r.isBindingPathSaved())for(ot=r.getBindingPaths(),o=0;o<ot.length;o++)g=ot[o],t.setBindingPath(u+g.row,f+g.column,g.value,e);if(r.isFormulaSaved()&&e===3)for(st=r.getFormulas(),o=0;o<st.length;o++)k=st[o],t.setFormula(u+k.row,f+k.column,k.value);if(r.isSparklineSaved()&&e===3)for(ht=r.getSparklines(),nt=0;nt<ht.length;nt++)y=ht[nt],s=y.value,s?s.dateAxisData()?t.setSparkline(u+y.row,f+y.column,s.data(),s.dataOrientation(),s.sparklineType(),s.setting(),s.dateAxisData(),s.dateAxisOrientation()):t.setSparkline(u+y.row,f+y.column,s.data(),s.dataOrientation(),s.sparklineType(),s.setting()):t.removeSparkline(u+y.row,f+y.column);if(r.isValueSaved())for(ct=r.getValues(),o=0;o<ct.length;o++)tt=ct[o],t.setValue(u+tt.row,f+tt.column,tt.value,e);if(r.isStyleSaved())for(lt=r.getStyles(),o=0;o<lt.length;o++)it=lt[o],n.setStyleObject(t,u+it.row,f+it.column,e,it.value);if(r.isCommentSaved())for(at=r.getComments(),o=0;o<at.length;o++)rt=at[o],yt=rt.value,n.setComment(t,u+rt.row,f+rt.column,yt);if(r.isArrayFormulaSaved()&&e===3){if(h=t._getsArrayFormulas(u,f,ft,et),h&&h.length>0)for(d=h.getLength(0),v=0;v<d;v++)b=h[v][0],t.setArrayFormula(b.row,b.col,b.rowCount,b.colCount,i);if(h=r.getArrayFormula(),h&&h.length>0)for(d=h.length,v=0;v<d;v++)w=h[v],t.setArrayFormula(w.baseRange.row,w.baseRange.col,w.baseRange.rowCount,w.baseRange.colCount,w.formula)}}finally{t.resumeCalcService();t.resumeEvent()}if(c=i,e===3?c=t._spanModel:e===1?c=t._colHeaderSpanModel:e===2&&(c=t._rowHeaderSpanModel),c&&c.length>0){for(ut=[],vt=c.getEnumerator(u,f,ft,et);vt.moveNext();)p=vt.current(),p&&ut.push(p);for(o=0;o<ut.length;o++)p=ut[o],c.remove(p)}if(r.isSpanSaved()&&c)for(o=0;o<r._spans.length;o++)p=r._spans[o],c.push(p)},n.undoColumnsInfo=function(t,r,u){var e=r._columnCount,f,h,o,s;if(r.isBindingFieldSaved())for(h={fieldName:i},f=0;f<e;f++)r.getBindingField(f,h)&&t.bindColumn(u+f,h.fieldName);if(r.isWidthSaved())for(f=0;f<e;f++)t.setColumnWidth(u+f,r.getWidth(f),3);if(r.isVisibleSaved())for(f=0;f<e;f++)t.setColumnVisible(u+f,r.getVisible(f),3);if(r.isResizableSaved())for(f=0;f<e;f++)t.setColumnResizable(u+f,r.getResizable(f),3);if(r.isViewportColumnStyleSaved())for(f=0;f<e;f++)n.setStyleObject(t,-1,u+f,3,r.getViewportColumnStyle(f));if(r.isHeaderColumnStyleSaved())for(f=0;f<e;f++)n.setStyleObject(t,-1,u+f,1,r.getHeaderColumnStyle(f));if(r.isRangeGroupSaved()&&(o=t.colRangeGroup,o))for(s={level:i,collapsed:i},f=0;f<e;f++)r.getRangeGroup(f,s),o._setLevel(u+f,s.level),o.setCollapsed(u+f,s.collapsed)},n.undoRowsInfo=function(t,r,u){var e=r._rowCount,f,o,s;if(r.isHeightSaved())for(f=0;f<e;f++)t.setRowHeight(u+f,r.getHeight(f),3);if(r.isVisibleSaved())for(f=0;f<e;f++)t.setRowVisible(u+f,r.getVisible(f),3);if(r.isResizableSaved())for(f=0;f<e;f++)t.setRowResizable(u+f,r.getResizable(f),3);if(r.isViewportRowStyleSaved())for(f=0;f<e;f++)n.setStyleObject(t,u+f,-1,3,r.getViewportRowStyle(f));if(r.isHeaderRowStyleSaved())for(f=0;f<e;f++)n.setStyleObject(t,u+f,-1,2,r.getHeaderRowStyle(f));if(r.isRangeGroupSaved()&&(o=t.rowRangeGroup,o))for(s={level:i,collapsed:i},f=0;f<e;f++)r.getRangeGroup(f,s),o._setLevel(u+f,s.level),o.setCollapsed(u+f,s.collapsed)},n.undoSheetInfo=function(n,t){t.isDefaultStyleSaved()&&n.setDefaultStyle(t.getDefaultStyle());t.isDefaultColumnWidthSaved()&&(n.defaults.colWidth=t.getDefaultColumnWidth());t.isDefaultRowHeightSaved()&&(n.defaults.rowHeight=t.getDefaultRowHeight());t.isColumnHeaderDefaultStyleSaved()&&n.setDefaultStyle(t.getColumnHeaderDefaultStyle(),1);t.isColumnHeaderDefaultRowHeightSaved()&&(n.defaults.rowHeight=t.getColumnHeaderDefaultRowHeight());t.isRowHeaderDefaultStyleSaved()&&n.setDefaultStyle(t.getRowHeaderDefaultStyle(),2);t.isRowHeaderDefaultColumnWidthSaved()&&(n.defaults.rowHeaderColWidth=t.getRowHeaderDefaultColumnWidth())},n.getValues=function(n,t,r,u,f){var l,e,s,c;for(t<0&&(t=0,u=n.getRowCount()),r<0&&(r=0,f=n.getColumnCount()),l=[],e=0;e<u;e++)for(s=0;s<f;s++)c=n.getValue(t+e,r+s),c!==o&&c!==i&&l.push(new h(e,s,c));return l},n.raiseRangeDataChanged=function(n,t,i,r,u,f){n&&(t<0&&(t=0,r=n.getRowCount()),i<0&&(i=0,u=n.getColumnCount()),n._raiseRangeDataChanged(t,i,r,u))},n.convertToKey=function(n,t){var i=0;return i=n,i<<=32,i|t},n.remove=function(n,t,r){var e=i,f=-1,o=n.length,u;if(o>0)for(u=0;u<o;u++)if(n[u].row===t&&n[u].column===r){f=u;break}return f!==-1&&(e=n[f],n.splice(f,1)),e},n}();t.CopyMoveHelper=r;u=function(){function n(){this.canExecuteChanged=i}return n.prototype.execute=function(n){},n.prototype.canExecute=function(n){return!0},n.prototype.canUndo=function(){return!0},n.prototype.saveState=function(){},n.prototype.undo=function(n){return!0},n.prototype._raiseCanExecuteChanged=function(){var n=this;n.canExecuteChanged&&typeof n.canExecuteChanged=="function"&&n.canExecuteChanged(n)},n.prototype._suspendInvalidate=function(n){n&&n._suspendInvalidate&&n._suspendInvalidate()},n.prototype._resumeInvalidate=function(n){return n&&n._resumeInvalidate?n._resumeInvalidate():!1},n}();t.ActionBase=u;tt=function(t){function r(n,i,r,u){t.call(this);var f=this;f._sheet=n;f._columns=i;f._size=r;f._rowHeader=u;f._oldSizes=[];f._oldVisibles=[]}return __extends(r,t),r.prototype.canExecute=function(n){return!0},r.prototype.execute=function(t){var r=this,i=r._sheet,h=r._columns,b=h&&h.length,p,c,k,f,e,o,y,u,nt;if(i&&b>0){if(r._suspendInvalidate(t),p=r._getColumnsReiszed(h),c={sheet:i,sheetName:i._name,colList:p,header:r._rowHeader,cancel:!1},i._trigger(n.Events.ColumnWidthChanging,c),c&&c.cancel===!0){r._canUndo=!1;r._resumeInvalidate(t);return}else r._canUndo=!0;r.saveState();k=i.isPaintSuspended();i.isPaintSuspended(!0);i.suspendEvent();try{var l=2,a=3,d=r._rowHeader,tt=d?i.getColumnCount(l):i.getColumnCount(a),v=i._scrollLeftCol,w=v;for(f=v-1;f>=i.frozenColCount;f--){if(i.getColumnVisible(f)&&i._getZoomColumnWidth(f)>0)break;i.getColumnResizable(f)&&(w=f)}for(e=Number.MAX_VALUE,o=r._size,y=0;y<b;y++){var g=h[y],it=g.firstCol,rt=g.lastCol;for(u=it;u<=rt;u++)0<=u&&u<tt&&(d&&i.getColumnResizable(u,l)&&o!==i._getActualColumnWidth(u,l)?i.setColumnWidth(u,o,l):i.getColumnResizable(u,a)&&o!==i._getActualColumnWidth(u,a)&&i.setColumnWidth(u,o,a),e=s(u,e))}e!==Number.MAX_VALUE&&e<=v&&w!==v&&(i._scrollLeftCol=w)}finally{i.resumeEvent();i.isPaintSuspended(k);nt=r._resumeInvalidate(t);nt||(i.invalidateLayout(),i.repaint())}i._trigger(n.Events.ColumnWidthChanged,{sheet:i,sheetName:i._name,colList:p,header:r._rowHeader});i._syncHScollbarPosition()}},r.prototype.saveState=function(){var u=this,s=[],h=[],f=u._sheet,l=u._columns,a=l&&l.length,n,t;if(f&&a>0){var v=u._rowHeader,p=v?2:3,k=f.getColumnCount(p),d=v?f.defaults.rowHeaderColWidth:f.defaults.colWidth,g=f._getColumnInfos(p),c;for(n=0;n<a;n++){var w=l[n],b=w.firstCol,nt=w.lastCol,e,o,r;for(s[n]=[],h[n]=[],t=b;t<=nt;t++)if(e=t-b,0<=t&&t<k){if(c=g[t],!c)continue;o=c.visible;(typeof o=="undefined"||o===i)&&(o=!0);r=c.size;r=isNaN(r)||r===i?d:y(r);s[n][e]=r;h[n][e]=o}else s[n][e]=-1,h[n][e]=!1}}u._oldSizes=s;u._oldVisibles=h},r.prototype.undo=function(t){var u=this,e=!1,i=u._sheet,h=u._columns,w=h&&h.length,y,c,b,f,r,k;if(i&&w>0){if(u._suspendInvalidate(t),y=u._getColumnsReiszed(h),c={sheet:i,sheetName:i._name,colList:y,header:u._rowHeader,cancel:!1},i._trigger(n.Events.ColumnWidthChanging,c),c&&c.cancel===!0)return u._resumeInvalidate(t),!1;b=i.isPaintSuspended();i.isPaintSuspended(!0);i.suspendEvent();try{var l=2,o=3,p=u._rowHeader,d=p?i.getColumnCount(2):i.getColumnCount(o),a,s;for(f=0;f<w;f++){var v=h[f],g=v.firstCol,nt=v.lastCol;for(r=g;r<=nt;r++)a=u._oldSizes[f][r-v.firstCol],s=u._oldVisibles[f][r-v.firstCol],0<=r&&r<d&&a!==-1&&(p&&i.getColumnResizable(r,l)?(i.setColumnWidth(r,a,l),e=!0):i.getColumnResizable(r,o)&&(i.setColumnWidth(r,a,o),e=!0),p&&i.getColumnVisible(r,l)!==s?(i.setColumnVisible(r,s,l),e=!0):i.getColumnVisible(r,o)!==s&&(i.setColumnVisible(r,s,o),e=!0))}}finally{i.resumeEvent();i.isPaintSuspended(b);k=u._resumeInvalidate(t);k||(i.invalidateLayout(),i.repaint())}i._trigger(n.Events.ColumnWidthChanged,{sheet:i,sheetName:i._name,colList:y,header:u._rowHeader})}return e},r.prototype._getColumnsReiszed=function(n){for(var t,r=[],i=0,f=n.length;i<f;i++){var u=n[i],e=u.firstCol,o=u.lastCol;for(t=e;t<=o;t++)r.push(t)}return r},r.prototype.canUndo=function(){return this._canUndo},r}(u);t.ColumnResizeUndoAction=tt;it=function(t){function r(n,i,r,u){t.call(this);var f=this;f._sheet=n;f._rows=i;f._size=r;f._columnHeader=u;f._oldSizes=[];f._oldVisibles=[]}return __extends(r,t),r.prototype.canExecute=function(n){return!0},r.prototype.execute=function(t){var r=this,i=r._sheet,h=r._rows,b=h&&h.length,p,c,k,f,e,o,y,u,nt;if(i&&b>0){if(r._suspendInvalidate(t),p=r._getRowsReiszed(h),c={sheet:i,sheetName:i._name,rowList:p,header:r._columnHeader,cancel:!1},i._trigger(n.Events.RowHeightChanging,c),c&&c.cancel===!0){r._canUndo=!1;r._resumeInvalidate(t);return}else r._canUndo=!0;r.saveState();k=i.isPaintSuspended();i.isPaintSuspended(!0);i.suspendEvent();try{var l=3,a=1,d=r._columnHeader,tt=d?i.getRowCount(a):i.getRowCount(l),v=i._scrollTopRow,w=v;for(f=v-1;f>=i.frozenRowCount;f--){if(i.getRowVisible(f)&&i._getZoomRowHeight(f)>0)break;i.getRowResizable(f)&&(w=f)}for(e=Number.MAX_VALUE,o=r._size,y=0;y<b;y++){var g=h[y],it=g.firstRow,rt=g.lastRow;for(u=it;u<=rt;u++)0<=u&&u<tt&&(d&&i.getRowResizable(u,a)&&o!==i._getActualRowHeight(u,a)?i.setRowHeight(u,o,a):i.getRowResizable(u,l)&&o!==i._getActualRowHeight(u,l)&&(i.setRowHeight(u,o,l),i.rowFilter()&&i.rowFilter()._addRowFilteredIn(u)),e=s(u,e))}e!==Number.MAX_VALUE&&e<=v&&w!==v&&(i._scrollTopRow=w)}finally{i.resumeEvent();i.isPaintSuspended(k);nt=r._resumeInvalidate(t);nt||(i.invalidateLayout(),i.repaint())}i._trigger(n.Events.RowHeightChanged,{sheet:i,sheetName:i._name,rowList:p,header:r._columnHeader});i._syncVScrollbarPosition()}},r.prototype.saveState=function(){var u=this,s=[],h=[],f=u._sheet,l=u._rows,a=l&&l.length,n,t;if(f&&a>0){var v=u._columnHeader,p=v?1:3,k=f.getRowCount(p),d=v?f.defaults.colHeaderRowHeight:f.defaults.rowHeight,g=f._getRowInfos(p),c;for(n=0;n<a;n++){var w=l[n],b=w.firstRow,nt=w.lastRow,e,o,r;for(s[n]=[],h[n]=[],t=b;t<=nt;t++)if(e=t-b,0<=t&&t<k){if(c=g[t],!c)continue;o=c.visible;(typeof o=="undefined"||o===i)&&(o=!0);r=c.size;r=isNaN(r)||r===i?d:y(r);s[n][e]=r;h[n][e]=o}else s[n][e]=-1,h[n][e]=!1}}u._oldVisibles=h;u._oldSizes=s},r.prototype.undo=function(t){var u=this,e=!1,i=u._sheet,c=u._rows,w=c&&c.length,v,l,b,f,r,d;if(i&&w>0){if(u._suspendInvalidate(t),v=u._getRowsReiszed(c),l={sheet:i,sheetName:i._name,rowList:v,header:u._columnHeader,cancel:!1},i._trigger(n.Events.RowHeightChanging,l),l&&l.cancel===!0)return u._resumeInvalidate(t),!1;b=i.isPaintSuspended();i.isPaintSuspended(!0);i.suspendEvent();try{var o=3,s=1,y=u._columnHeader,g=y?i.getRowCount(s):i.getRowCount(o),nt=u._oldSizes,tt=u._oldVisibles,a,h;for(f=0;f<w;f++){var k=c[f],p=k.firstRow,it=k.lastRow;for(r=p;r<=it;r++)a=nt[f][r-p],h=tt[f][r-p],0<=r&&r<g&&a!==-1&&(y&&i.getRowResizable(r,s)?(i.setRowHeight(r,a,s),e=!0):i.getRowResizable(r,o)&&(i.setRowHeight(r,a,o),e=!0),y&&i.getRowVisible(r,s)!==h?(i.setRowVisible(r,h,s),e=!0):i.getRowVisible(r,o)!==h&&(i.setRowVisible(r,h,o),e=!0))}}finally{i.resumeEvent();i.isPaintSuspended(b);d=u._resumeInvalidate(t);d||(i.invalidateLayout(),i.repaint())}i._trigger(n.Events.RowHeightChanged,{sheet:i,sheetName:i._name,rowList:v,header:u._columnHeader})}return e},r.prototype._getRowsReiszed=function(n){for(var t,r=[],i=0,f=n.length;i<f;i++){var u=n[i],e=u.firstRow,o=u.lastRow;for(t=e;t<=o;t++)r.push(t)}return r},r.prototype.canUndo=function(){return this._canUndo},r}(u);t.RowResizeUndoAction=it;rt=function(t){function r(n,i,r,u){t.call(this);var f=this;f._sheet=n;f._columns=i;f._sheetArea=r?2:3;arguments.length===3&&(u=n._getAutoFitType());f._autofitType=u;f._oldSizes=[];f._oldVisibles=[]}return __extends(r,t),r.prototype.canExecute=function(n){return this._sheet&&this._columns&&this._columns.length>0},r.prototype.execute=function(t){var r=this,i,e,w,a,u,c,f,b;if(r.canExecute(t)){i=r._sheet;e=r._sheetArea;r._suspendInvalidate(t);var v=r._getColumnsReiszed(r._columns),y=e===2,l={sheet:i,sheetName:i._name,colList:v,header:y,cancel:!1};if(i._trigger(n.Events.ColumnWidthChanging,l),l&&l.cancel===!0){r._canUndo=!1;r._resumeInvalidate(t);return}else r._canUndo=!0;r.saveState();var p=i.getColumnCount(e),s=p-1,h=0,o;for(u=0,c=r._columns.length;u<c;u++)o=r._columns[u].col,s=s>o?o:s,h=h<o?o:h;n._CatchMgr.startCatch(i,0,s,i.getRowCount()-1,h);w=i.isPaintSuspended();i.isPaintSuspended(!0);i.suspendEvent();try{for(u=0,c=r._columns.length;u<c;u++)f=r._columns[u],0<=f.col&&f.col<p&&i.getColumnResizable(f.col,e)&&(a=r._getColumnAutoFitValue(f.col),a!==i.getColumnWidth(f.col,e)&&i.setColumnWidth(f.col,a,e))}finally{n._CatchMgr.clearCatch();i.resumeEvent();i.isPaintSuspended(w);b=r._resumeInvalidate(t);b||(i.invalidateLayout(),i.repaint())}i._trigger(n.Events.ColumnWidthChanged,{sheet:i,sheetName:i._name,colList:v,header:y})}},r.prototype.saveState=function(){var n=this,u=i,f=i,e=n._sheet,o=n._sheetArea,s,t,h,r;if(e&&n._columns&&n._columns.length>0)for(s=e.getColumnCount(o),u=[n._columns.length],f=[n._columns.length],t=0,h=n._columns.length;t<h;t++)r=n._columns[t],0<=r.col&&r.col<s?(u[t]=e.getColumnWidth(r.col,o),f[t]=e.getColumnVisible(r.col,o)):(u[t]=-1,f[t]=!1);n._oldSizes=u;n._oldVisibles=f},r.prototype.undo=function(t){var r=this,l=!1,f=r._sheetArea,s,i,h,e,a,v,c,y,u,o,p;if(r._sheet&&r._columns&&r._columns.length>0){if(s=f===2,i=r._sheet,r._suspendInvalidate(t),h=r._getColumnsReiszed(r._columns),e={sheet:i,sheetName:i._name,colList:h,header:s,cancel:!1},i._trigger(n.Events.ColumnWidthChanging,e),e&&e.cancel===!0)return r._resumeInvalidate(t),!1;a=i.isPaintSuspended();i.isPaintSuspended(!0);i.suspendEvent();try{for(v=i.getColumnCount(f),u=0;u<r._columns.length;u++)o=r._columns[u],c=r._oldSizes[u],y=r._oldVisibles[u],0<=u&&u<v&&c!==-1&&i.getColumnResizable(o.col,f)&&(i.setColumnWidth(o.col,c,f),i.setColumnVisible(o.col,y,f),l=!0)}finally{i.resumeEvent();i.isPaintSuspended(a);p=r._resumeInvalidate(t);p||(i.invalidateLayout(),i.repaint())}i._trigger(n.Events.ColumnWidthChanged,{sheet:i,sheetName:i._name,colList:h,header:s})}return l},r.prototype._getColumnsReiszed=function(n){for(var r,i=[],t=0;t<n.length;t++)r=n[t],i.push(r.col);return i},r.prototype._nextAutoFitRow=function(n,t){for(var o,e,r=this._sheet,u=this._sheetArea,f=-1,s=r.getRowCount(u),i=n+1;i<s;i++){if(o=r.getText(i,t,u),o){f=i;break}if(e=r.getActualStyle(i,t,u),e&&e.cellType){f=i;break}}return f},r.prototype._getColumnAutoFitValue=function(n){var s=this,t=s._sheet,y=t._render,e=0,i=s._sheetArea,h=[i],c,u,p,l,o;for(s._autofitType==1&&(i==3?h.push(1):i==2&&h.push(0)),c=0;c<h.length;c++)for(var r=0,i=h[c],k=t.getRowCount(i);r>=0&&r<k;){if(u=t._getSpanModel(i).find(r,n),u&&(u.col<n||u.colCount>1||u.row<r)){r=u.row+u.rowCount;continue}var f=t.getActualStyle(r,n,i),a=0,v=f.cellType||t.getDefaultCellType(i);if(v){p=f.font||y._getDefaultFont(i);f.font=y._getZoomFont(p);l=!!(t.rowFilter()&&t.rowFilter().isFilterHeader(r,n,i));l||i!==3||(o=t.findTable(r,n),o&&o.showHeader()&&o.headerIndex()===r&&o.rowFilter().showFilterButton&&(l=!0));var d=f.formatter?f.formatter:f._autoFormatter,w={sheet:s,row:r,col:n,sheetArea:i},b=t.getValue(r,n,i),g=v.format(b,d,w);a=v._getAutoFitWidth(t,b,g,f,l,w)}a>e&&(e=a);r++}return e===0?e=t.defaults.colWidth:e+=nt(3/t._zoomFactor),e},r.prototype.canUndo=function(){return this._canUndo},r}(u);t.ColumnAutoFitUndoAction=rt;ut=function(t){function r(n,i,r,u){t.call(this);var f=this;f._sheet=n;f._rows=i;f._sheetArea=r?1:3;arguments.length===3&&(u=n._getAutoFitType());f._autofitType=u;f._oldSizes=[];f._oldVisibles=[]}return __extends(r,t),r.prototype.canExecute=function(n){return this._sheet&&this._rows&&this._rows.length>0},r.prototype.execute=function(t){var r=this,i,l,a,s,e,v,u,y;if(r.canExecute(t)){i=r._sheet;r._suspendInvalidate(t);var h=r._getRowsResized(r._rows),f=r._sheetArea,c=r._sheetArea===1,o={sheet:i,sheetName:i._name,rowList:h,header:c,cancel:!1};if(i._trigger(n.Events.RowHeightChanging,o),o&&o.cancel===!0){r._canUndo=!1;r._resumeInvalidate(t);return}else r._canUndo=!0;r.saveState();l=i.isPaintSuspended();i.isPaintSuspended(!0);i.suspendEvent();try{for(a=i.getRowCount(f),e=0,v=r._rows.length;e<v;e++)u=r._rows[e],0<=u.row&&u.row<a&&i.getRowResizable(u.row,f)&&(s=r._getRowAutoFitValue(u.row),s!==i.getRowHeight(u.row,f)&&i.setRowHeight(u.row,s,f))}finally{i.resumeEvent();i.isPaintSuspended(l);y=r._resumeInvalidate(t);y||(i.invalidateLayout(),i.repaint())}i._trigger(n.Events.RowHeightChanged,{sheet:i,sheetName:i._name,rowList:h,header:c})}},r.prototype.saveState=function(){var n=this,u=i,f=i,e=n._sheet,o=n._sheetArea,s,t,h,r;if(e&&n._rows&&n._rows.length>0)for(u=[n._rows.length],f=[n._rows.length],s=e.getRowCount(o),t=0,h=n._rows.length;t<h;t++)r=n._rows[t],0<=r.row&&r.row<s?(u[t]=e.getRowHeight(r.row,o),f[t]=e.getRowVisible(r.row,o)):(u[t]=-1,f[t]=!1);n._oldSizes=u;n._oldVisibles=f},r.prototype.undo=function(t){var r=this,c=!1,i=r._sheet,f=r._sheetArea,l=r._sheetArea===1,s,e,a,h,v,y,u,p,o,w;if(i&&r._rows&&r._rows.length>0){if(r._suspendInvalidate(t),s=r._getRowsResized(r._rows),e={sheet:i,sheetName:i._name,rowList:s,header:l,cancel:!1},i._trigger(n.Events.RowHeightChanging,e),e&&e.cancel===!0)return r._resumeInvalidate(t),!1;a=i.isPaintSuspended();i.isPaintSuspended(!0);i.suspendEvent();try{for(y=i.getRowCount(f),u=0,p=r._rows.length;u<p;u++)o=r._rows[u],h=r._oldSizes[u],v=r._oldVisibles[u],0<=u&&u<y&&h!==-1&&i.getRowResizable(o.row,f)&&(i.setRowHeight(o.row,h,f),i.setRowVisible(o.row,v,f),c=!0)}finally{i.resumeEvent();i.isPaintSuspended(a);w=r._resumeInvalidate(t);w||(i.invalidateLayout(),i.repaint())}i._trigger(n.Events.RowHeightChanged,{sheet:i,sheetName:i._name,rowList:s,header:l})}return c},r.prototype._getRowsResized=function(n){for(var r,i=[],t=0,u=n.length;t<u;t++)r=n[t],i.push(r.row);return i},r.prototype._nextAutoFitColumn=function(n,t){for(var e,f=this._sheet,o=this._sheetArea,h=this._sheetArea===1,r=f._nextNonNullColumn(n,t,h),i=-1,c=f.getColumnCount(o),u=t+1;u<c;u++)if(e=f.getActualStyle(n,u,o),e&&e.cellType){i=u;break}return r>=0&&i>=0?s(r,i):r>=0?r:i>=0?i:-1},r.prototype._getRowAutoFitValue=function(n){var e=this,i=e._sheet,y=i._render,f=0,r=e._sheetArea,g=e._sheetArea===1,o=[r],s,u,l,p,a,v;for(e._autofitType==1&&(r==3?o.push(2):r==1&&o.push(0)),s=0;s<o.length;s++){r=o[s];for(var t=0,w=i.getColumnCount(r),h,c=0;t>=0&&t<w;){if(u=i._getSpanModel(r).find(n,t),u){if(u.row<n||u.rowCount>1||u.col<t){t=u.col+u.colCount;continue}else if(t==u.col&&(c=i.getColumnWidth(t),u.colCount>1))for(h=t+1;h<t+u.colCount;h++)c+=i.getColumnWidth(h)}else c=i.getColumnWidth(t);if(l=i.getActualStyle(n,t,r),p=l.font||y._getDefaultFont(r),l.font=y._getZoomFont(p),a=0,v=i.getCellType(n,t,r),v){var b=i.getText(n,t,r),k=i.getValue(n,t,r),d={sheet:i,row:n,col:t,sheetArea:r};a=v._getAutoFitHeight(i,k,b,l,c,d)}a>f&&(f=a);r===3?t=e._nextAutoFitColumn(n,t):t++}}return f===0?f=i.defaults.rowHeight:f+=nt(3/i._zoomFactor),f},r.prototype.canUndo=function(){return this._canUndo},r}(u);t.RowAutoFitUndoAction=ut;ft=function(){function n(n,t){this.index=n;this.count=t}return n}();t.GroupExtent=ft;et=function(t){function i(n,i){t.call(this);this._sheet=n;this._columnGroupExtent=i;this._canUndo=!1}return __extends(i,t),i.prototype.canExecute=function(n){return!0},i.prototype.execute=function(t){var i=this,r=i._sheet,u,f,e;n.features.group&&r&&i._columnGroupExtent&&r.colRangeGroup&&(i._suspendInvalidate(t),u=i._columnGroupExtent.index,f=i._columnGroupExtent.count,r.colRangeGroup.group(u,f),e=i._resumeInvalidate(t),e||(r.invalidateLayout(),r.repaint()),i._canUndo=!0)},i.prototype.canUndo=function(){return this._canUndo},i.prototype.saveState=function(){},i.prototype.undo=function(t){var i=this,u=!1,r=i._sheet,f,e,o;return n.features.group&&r&&i._columnGroupExtent&&r.colRangeGroup&&(i._suspendInvalidate(t),f=i._columnGroupExtent.index,e=i._columnGroupExtent.count,r.colRangeGroup.ungroupRange(f,e),u=!0,o=i._resumeInvalidate(t),o||(r.invalidateLayout(),r.repaint())),u},i}(u);t.ColumnGroupUndoAction=et;ot=function(t){function i(n,i){t.call(this);this._sheet=n;this._columnUngroupExtent=i;this._canUndo=!1}return __extends(i,t),i.prototype.canExecute=function(n){return!0},i.prototype.execute=function(t){var i=this,r=i._sheet,u,f,e;n.features.group&&r&&i._columnUngroupExtent&&r.colRangeGroup&&(u=i._columnUngroupExtent.index,f=i._columnUngroupExtent.count,r.colRangeGroup.getLevel(u)>=0||r.colRangeGroup.getLevel(u+f-1)>=0?(i._suspendInvalidate(t),i._canUndo=!0,r.colRangeGroup.ungroupRange(u,f),e=i._resumeInvalidate(t),e||(r.invalidateLayout(),r.repaint())):i._canUndo=!1)},i.prototype.canUndo=function(){return this._canUndo},i.prototype.saveState=function(){},i.prototype.undo=function(t){var i=this,u=!1,r=i._sheet,f,e,o;return n.features.group&&i._canUndo===!0&&r&&i._columnUngroupExtent&&r.colRangeGroup&&(i._suspendInvalidate(t),f=i._columnUngroupExtent.index,e=i._columnUngroupExtent.count,r.colRangeGroup.group(f,e),u=!0,o=i._resumeInvalidate(t),o||(r.invalidateLayout(),r.repaint())),u},i}(u);t.ColumnUngroupUndoAction=ot;st=function(t){function i(n,i){t.call(this);this._sheet=n;this._rowGroupExtent=i;this._canUndo=!1}return __extends(i,t),i.prototype.canExecute=function(n){return!0},i.prototype.execute=function(t){var i=this,r=i._sheet,u,f,e;n.features.group&&r&&i._rowGroupExtent&&r.rowRangeGroup&&(i._suspendInvalidate(t),u=i._rowGroupExtent.index,f=i._rowGroupExtent.count,r.rowRangeGroup.group(u,f),e=i._resumeInvalidate(t),e||(r.invalidateLayout(),r.repaint()),i._canUndo=!0)},i.prototype.canUndo=function(){return this._canUndo},i.prototype.saveState=function(){},i.prototype.undo=function(t){var i=this,u=!1,r=i._sheet,f,e,o;return n.features.group&&r&&i._rowGroupExtent&&r.rowRangeGroup&&(i._suspendInvalidate(t),f=i._rowGroupExtent.index,e=i._rowGroupExtent.count,r.rowRangeGroup.ungroupRange(f,e),u=!0,o=i._resumeInvalidate(t),o||(r.invalidateLayout(),r.repaint())),u},i}(u);t.RowGroupUndoAction=st;ht=function(t){function i(n,i){t.call(this);this._sheet=n;this._rowUngroupExtent=i;this._canUndo=!1}return __extends(i,t),i.prototype.canExecute=function(n){return!0},i.prototype.execute=function(t){var i=this,r=i._sheet,u,f,e;n.features.group&&r&&i._rowUngroupExtent&&r.rowRangeGroup&&(u=i._rowUngroupExtent.index,f=i._rowUngroupExtent.count,r.rowRangeGroup.getLevel(u)>=0||r.rowRangeGroup.getLevel(u+f-1)>=0?(i._suspendInvalidate(t),i._canUndo=!0,r.rowRangeGroup.ungroupRange(u,f),e=i._resumeInvalidate(t),e||(r.invalidateLayout(),r.repaint())):i._canUndo=!1)},i.prototype.canUndo=function(){return this._canUndo},i.prototype.saveState=function(){},i.prototype.undo=function(t){var i=this,u=!1,r=i._sheet,f,e,o;return n.features.group&&i._canUndo===!0&&r&&i._rowUngroupExtent&&r.rowRangeGroup&&(i._suspendInvalidate(t),f=i._rowUngroupExtent.index,e=i._rowUngroupExtent.count,r.rowRangeGroup.group(f,e),u=!0,o=i._resumeInvalidate(t),o||(r.invalidateLayout(),r.repaint())),u},i}(u);t.RowUngroupUndoAction=ht;ct=function(t){function i(n,i){t.call(this);this._sheet=n;this._columnExpandExtent=i;this._canUndo=!1}return __extends(i,t),i.prototype.canExecute=function(){return!0},i.prototype.execute=function(t){var i=this,r=i._sheet,f,u,e;n.features.group&&r&&i._columnExpandExtent&&r.colRangeGroup&&(i._suspendInvalidate(t),f=i._columnExpandExtent.index,u=i._columnExpandExtent.collapsed,r.colRangeGroup.setCollapsed(f,u),i._showColumnRangeGroup(u),e=i._resumeInvalidate(t),e||(r.invalidateLayout(),r.repaint()),i._canUndo=!0)},i.prototype.canUndo=function(){return this._canUndo},i.prototype.saveState=function(){},i.prototype.undo=function(t){var i=this,f=!1,r=i._sheet,e,u,o;return n.features.group&&r&&i._columnExpandExtent&&r.colRangeGroup&&(i._suspendInvalidate(t),e=i._columnExpandExtent.index,u=i._columnExpandExtent.collapsed,r.colRangeGroup.setCollapsed(e,!u),f=!0,i._showColumnRangeGroup(!u),o=i._resumeInvalidate(t),o||(r.invalidateLayout(),r.repaint())),f},i.prototype._showColumnRangeGroup=function(n){var r=this,t=r._sheet,f=r._columnExpandExtent.index,o,u,e,h,i,c,l,a;if(!(f<0)&&!(f>=t.getColumnCount())){if(t.colRangeGroup.direction===1){if(o=t.colRangeGroup.find(f-1,r._columnExpandExtent.level),!o)return;u=o.start;e=f;h=1;n?u=f:u<t.frozenColCount&&(u=t.frozenColCount);i=t.getViewportLeftColumn(h);u<i&&(i=u);c=t.getViewportWidth(h);l=r._getColsTotalWidth(t,i,e);l>c&&(i=r._getNewLeftColumn(t,i,l-c));t._scrollLeftCol=r._tryGetNextScrollableCol(t,i)}else{if(o=t.colRangeGroup.find(f+1,r._columnExpandExtent.level),!o)return;u=f;e=o.end;h=1;n?e=f:(a=t.getColumnCount(),e>=a&&(e=a-1));i=t.getViewportLeftColumn(h);u<i?t._scrollLeftCol=r._tryGetNextScrollableCol(t,u):(c=t.getViewportWidth(h),l=r._getColsTotalWidth(t,i,e),l>c&&(i=r._getNewLeftColumn(t,i,l-c),t._scrollLeftCol=r._tryGetNextScrollableCol(t,s(u,i))))}t._syncHScollbarPosition()}},i.prototype._getColsTotalWidth=function(n,t,i){for(var u=0,f=n.getColumnCount(),r=t;r<=i&&r<f;r++)u+=n.getColumnWidth(r)*n._zoomFactor;return u},i.prototype._getNewLeftColumn=function(n,t,i){for(var f=0,r=n.getColumnCount(),u=t;u<r&&f<i;u++)t++,f+=n.getColumnWidth(u)*n._zoomFactor;return t>=r?r-1:t},i.prototype._tryGetNextScrollableCol=function(n,t){var u=n.frozenColCount,r=n.getColumnCount()-1,i,f;if(t<u)return u;if(t>r)return r;for(i=t;i<=r;i++)if(f=n.getColumnWidth(i),f>0)return i;return-1},i}(u);t.ColumnGroupExpandUndoAction=ct;lt=function(t){function i(n,i){t.call(this);this._sheet=n;this._rowExpandExtent=i;this._canUndo=!1}return __extends(i,t),i.prototype.canExecute=function(){return!0},i.prototype.execute=function(t){var i=this,r=i._sheet,f,u,e;n.features.group&&r&&i._rowExpandExtent&&r.rowRangeGroup&&(i._suspendInvalidate(t),f=i._rowExpandExtent.index,u=i._rowExpandExtent.collapsed,r.rowRangeGroup.setCollapsed(f,u),i._showRowRangeGroup(u),e=i._resumeInvalidate(t),e||(r.invalidateLayout(),r.repaint()),i._canUndo=!0)},i.prototype.canUndo=function(){return this._canUndo},i.prototype.saveState=function(){},i.prototype.undo=function(t){var i=this,f=!1,r=i._sheet,e,u,o;return n.features.group&&r&&i._rowExpandExtent&&r.rowRangeGroup&&(i._suspendInvalidate(t),e=i._rowExpandExtent.index,u=i._rowExpandExtent.collapsed,r.rowRangeGroup.setCollapsed(e,!u),f=!0,i._showRowRangeGroup(!u),o=i._resumeInvalidate(t),o||(r.invalidateLayout(),r.repaint())),f},i.prototype._showRowRangeGroup=function(n){var r=this,t=r._sheet,f=r._rowExpandExtent.index,o,u,e,h,i,c,l,a;if(!(f<0)&&!(f>=t.getRowCount())){if(t.rowRangeGroup.direction===1){if(o=t.rowRangeGroup.find(f-1,r._rowExpandExtent.level),!o)return;u=o.start;e=f;h=1;n?u=f:u<t.frozenRowCount&&(u=t.frozenRowCount);i=t.getViewportTopRow(h);u<i&&(i=u);c=t.getViewportHeight(h);l=r._getRowsTotalHeight(t,i,e);l>c&&(i=r._getNewTopRow(t,i,l-c));t._scrollTopRow=r._tryGetNextScrollableRow(t,i)}else{if(o=t.rowRangeGroup.find(f+1,r._rowExpandExtent.level),!o)return;u=f;e=o.end;h=1;n?e=f:(a=t.getRowCount(),e>=a&&(e=a-1));i=t.getViewportTopRow(h);u<i?t._scrollTopRow=r._tryGetNextScrollableRow(t,u):(c=t.getViewportHeight(h),l=r._getRowsTotalHeight(t,i,e),l>c&&(i=r._getNewTopRow(t,i,l-c),t._scrollTopRow=r._tryGetNextScrollableRow(t,s(u,i))))}t._syncVScrollbarPosition()}},i.prototype._getRowsTotalHeight=function(n,t,i){for(var u=0,f=n.getRowCount(),r=t;r<=i&&r<f;r++)u+=n.getRowHeight(r)*n._zoomFactor;return u},i.prototype._getNewTopRow=function(n,t,i){for(var f=0,r=n.getRowCount(),u=t;u<=r&&f<i;u++)t++,f+=n.getRowHeight(u)*n._zoomFactor;return t>=r?r-1:t},i.prototype._tryGetNextScrollableRow=function(n,t){var u=n.frozenRowCount,r=n.getRowCount()-1,i,f;if(t<u)return u;if(t>r)return r;for(i=t;i<=r;i++)if(f=n.getRowHeight(i),f>0)return i;return-1},i}(u);t.RowGroupExpandUndoAction=lt;at=function(t){function r(n,i){t.call(this);var r=this;r._sheet=n;r._columnGroupHeaderExpandExtent=i;r._oldStatus={};r._canUndo=!1}return __extends(r,t),r.prototype.canExecute=function(){return!0},r.prototype.execute=function(t){var i=this,r=i._sheet,f,u,e;if(n.features.group&&r&&i._columnGroupHeaderExpandExtent&&r.colRangeGroup){for(i._suspendInvalidate(t),i.saveState(),f=i._columnGroupHeaderExpandExtent.level,u=0;u<f;u++)r.colRangeGroup.expand(u,!0);r.colRangeGroup.expand(f,!1);e=i._resumeInvalidate(t);e||(r.invalidateLayout(),r.repaint());i._canUndo=!0}},r.prototype.canUndo=function(){return this._canUndo},r.prototype.saveState=function(){var u=this,f=i,t=u._sheet,s,e,n,r,h;if(t&&u._columnGroupHeaderExpandExtent&&t.colRangeGroup)for(s=u._columnGroupHeaderExpandExtent.level,f={},e=0;e<=s;e++)for(var o=0,c=t.getColumnCount(),l=t.colRangeGroup.direction;o<c;){if(n=t.colRangeGroup.find(o,e),n){r=-1;switch(l){case 0:r=n.start-1;break;case 1:r=n.end+1;break;default:break}h=n.getState()===1;f[r]||(f[r]=h);o+=n.end-n.start+1}o++}u._oldStatus=f},r.prototype.undo=function(t){var i=this,f=!1,r=i._sheet,u,e;if(n.features.group&&r&&i._oldStatus&&r.colRangeGroup){i._suspendInvalidate(t);for(u in i._oldStatus)u&&(r.colRangeGroup.setCollapsed(u,i._oldStatus[u]),f=!0);e=i._resumeInvalidate(t);e||(r.invalidateLayout(),r.repaint())}return f},r}(u);t.ColumnGroupHeaderExpandUndoAction=at;vt=function(t){function r(n,i){t.call(this);var r=this;r._sheet=n;r._rowGroupHeaderExpandExtent=i;r._oldStatus={};r._canUndo=!1}return __extends(r,t),r.prototype.canExecute=function(){return!0},r.prototype.execute=function(t){var i=this,r=i._sheet,f,u,e;if(n.features.group&&r&&i._rowGroupHeaderExpandExtent&&r.rowRangeGroup){for(i._suspendInvalidate(t),i.saveState(),f=i._rowGroupHeaderExpandExtent.level,u=0;u<f;u++)r.rowRangeGroup.expand(u,!0);r.rowRangeGroup.expand(f,!1);e=i._resumeInvalidate(t);e||(r.invalidateLayout(),r.repaint());i._canUndo=!0}},r.prototype.canUndo=function(){return this._canUndo},r.prototype.saveState=function(){var u=this,f=i,t=u._sheet,s,e,n,r,h;if(t&&u._rowGroupHeaderExpandExtent&&t.rowRangeGroup)for(s=u._rowGroupHeaderExpandExtent.level,f={},e=0;e<=s;e++)for(var o=0,c=t.getRowCount(),l=t.rowRangeGroup.direction;o<c;){if(n=t.rowRangeGroup.find(o,e),n){r=-1;switch(l){case 0:r=n.start-1;break;case 1:r=n.end+1;break;default:break}h=n.getState()===1;f[r]||(f[r]=h);o+=n.end-n.start+1}o++}u._oldStatus=f},r.prototype.undo=function(t){var i=this,f=!1,r=i._sheet,u,e;if(n.features.group&&r&&i._oldStatus&&r.rowRangeGroup){i._suspendInvalidate(t);for(u in i._oldStatus)u&&(r.rowRangeGroup.setCollapsed(u,i._oldStatus[u]),f=!0);e=i._resumeInvalidate(t);e||(r.invalidateLayout(),r.repaint())}return f},r}(u);t.RowGroupHeaderExpandUndoAction=vt;yt=function(){function n(n,t,i,r,u,f){var e=this;e.fromRow=n;e.fromColumn=t;e.toRow=i;e.toColumn=r;e.rowCount=u;e.columnCount=f}return n}();t.DragDropExtent=yt;pt=function(t){function u(n,i,r,u,f){t.call(this);var e=this;e._sheet=n;e._dragDropExtent=i;e._copy=r;e._insert=u;e._option=f}return __extends(u,t),u.prototype.canExecute=function(t){var u=this,r=u._sheet,i=u._dragDropExtent;return r._isValidRange(i.fromRow,i.fromColumn,i.rowCount,i.columnCount,u._sheet.getRowCount(),u._sheet.getColumnCount())?!u._insert&&!r._isValidRange(i.toRow,i.toColumn,i.rowCount,i.columnCount,u._sheet.getRowCount(),u._sheet.getColumnCount())?!1:!(r.isProtected&&r._isAnyCellInRangeLocked(new n.Range(i.toRow,i.toColumn,i.rowCount,i.columnCount)))&&r._checkArrayFormula(i.toRow,i.toColumn,i.rowCount,i.columnCount)&&!(r.isProtected&&r._isAnyCellInRangeLocked(new n.Range(i.fromRow,i.fromColumn,i.rowCount,i.columnCount)))&&r._checkArrayFormula(i.fromRow,i.fromColumn,i.rowCount,i.columnCount):!1},u.prototype.execute=function(t){var u=this,i=u._sheet,e,s,o,h,c,nt,tt,b,k,l,a;if(u.saveState(),u._insert){if(nt=u._dragDropExtent.fromRow,tt=u._dragDropExtent.fromColumn,tt>=0&&nt<0){e=u._dragDropExtent.fromColumn;s=u._dragDropExtent.toColumn;o=u._dragDropExtent.columnCount;b=u._dragDropExtent.toColumn;u._suspendInvalidate(t);l=i.isPaintSuspended();i.isPaintSuspended(!0);try{u._sheet.addColumns(s,o);u._copy?u._sheet.copyTo(-1,s<=e?e+o:e,-1,s,-1,o,u._option):(u._sheet.moveTo(-1,s<=e?e+o:e,-1,s,-1,o,u._option),u._sheet.deleteColumns(s<=e?e+o:e,o),e<s&&(b=s-o));i&&(h=i.getSelections().toArray(),i._clearSelectionImp(),i.addSelection(-1,b,i.getRowCount(),o),c=i.getSelections(),i._trigger(n.Events.SelectionChanging,{sheet:i,sheetName:i._name,oldSelections:h,newSelections:c}),i._trigger(n.Events.SelectionChanged,{sheet:i,sheetName:i._name}),i._setActiveCellImp(i._getFirstVisualRow(),b,i.activeRowViewportIndex,i.activeColViewportIndex))}finally{i._dragRect={};i.isPaintSuspended(l);a=u._resumeInvalidate(t);a||(i.invalidateLayout(),i.repaint())}}else if(u._dragDropExtent.fromRow>=0&&u._dragDropExtent.fromColumn<0){e=u._dragDropExtent.fromRow;s=u._dragDropExtent.toRow;o=u._dragDropExtent.rowCount;k=u._dragDropExtent.toRow;u._suspendInvalidate(t);l=i.isPaintSuspended();i.isPaintSuspended(!0);try{u._sheet.addRows(s,o);u._copy?u._sheet.copyTo(s<=e?e+o:e,-1,s,-1,o,-1,u._option):(u._sheet.moveTo(s<=e?e+o:e,-1,s,-1,o,-1,u._option),u._sheet.deleteRows(s<=e?e+o:e,o),e<s&&(k=s-o));i&&(h=i.getSelections().toArray(),i._clearSelectionImp(),i.addSelection(k,-1,o,i.getColumnCount()),c=i.getSelections(),i._trigger(n.Events.SelectionChanging,{sheet:i,sheetName:i._name,oldSelections:h,newSelections:c}),i._trigger(n.Events.SelectionChanged,{sheet:i,sheetName:i._name}),i._setActiveCellImp(k,i._getFirstVisualColumn(),i.activeRowViewportIndex,i.activeColViewportIndex))}finally{i._dragRect={};i.isPaintSuspended(l);a=u._resumeInvalidate(t);a||(i.invalidateLayout(),i.repaint())}}}else{var d=u._dragDropExtent.fromRow,g=u._dragDropExtent.fromColumn,v=u._dragDropExtent.toRow,y=u._dragDropExtent.toColumn,p=u._dragDropExtent.rowCount,w=u._dragDropExtent.columnCount;u._suspendInvalidate(t);l=i.isPaintSuspended();i.isPaintSuspended(!0);try{u._copy?i.copyTo(d,g,v,y,p,w,u._option):i.moveTo(d,g,v,y,p,w,u._option);i&&(h=i.getSelections().toArray(),i._clearSelectionImp(),i.addSelection(v,y,p,w),c=i.getSelections().toArray(),i._trigger(n.Events.SelectionChanging,{sheet:i,sheetName:i._name,oldSelections:h,newSelections:c}),i._trigger(n.Events.SelectionChanged,{sheet:i,sheetName:i._name}),i._setActiveCellImp(f(i._getFirstVisualRow(),v),f(i._getFirstVisualColumn(),y),i.activeRowViewportIndex,i.activeColViewportIndex),!u._copy&&u._savedFromViewportCells&&u._savedFromViewportCells.isValueSaved()&&r.raiseRangeDataChanged(i,d,g,p,w,u._savedFromViewportCells.getValues()),u._savedToViewportCells&&u._savedToViewportCells.isValueSaved()&&r.raiseRangeDataChanged(i,v,y,p,w,u._savedToViewportCells.getValues()))}finally{i._dragRect={};i.isPaintSuspended(l);a=u._resumeInvalidate(t);a||(i.invalidateLayout(),i.repaint())}}},u.prototype.saveState=function(){var n=this,v,y,p,w,b,k,d,u,f,o;n.initSaveState();var s=n._dragDropExtent.fromRow<0?0:n._dragDropExtent.fromRow,h=n._dragDropExtent.fromColumn<0?0:n._dragDropExtent.fromColumn,a=n._dragDropExtent.toRow<0?0:n._dragDropExtent.toRow,g=n._dragDropExtent.toColumn<0?0:n._dragDropExtent.toColumn,t=n._dragDropExtent.fromRow<0?n._sheet.getRowCount():n._dragDropExtent.rowCount,i=n._dragDropExtent.fromColumn<0?n._sheet.getColumnCount():n._dragDropExtent.columnCount;n._insert?n._dragDropExtent.fromColumn>=0&&n._dragDropExtent.fromRow>=0||n._dragDropExtent.fromColumn>=0||n._dragDropExtent.fromRow>=0&&(n._copy||n._sheet._hasTable(a,-1,1,-1)&&(u=new e(t,n._sheet.getColumnCount(2)),f=new c(t),r.saveRowHeaderInfo(n._sheet,u,f,s,n._option),n._savedFromRowHeaderCells=u,n._savedFromRows=f,o=new e(t,i),r.saveViewportInfo(n._sheet,o,s,h,n._option),n._savedFromViewportCells=o)):(n._dragDropExtent.fromRow<0&&(v=new e(n._sheet.getRowCount(1),i),y=new l(i),r.saveColumnHeaderInfo(n._sheet,v,y,g,n._option),n._savedToColumnHeaderCells=v,n._savedToColumns=y,n._copy||(p=new e(n._sheet.getRowCount(1),i),w=new l(i),r.saveColumnHeaderInfo(n._sheet,p,w,h,n._option),n._savedFromColumnHeaderCells=p,n._savedFromColumns=w)),n._dragDropExtent.fromColumn<0&&(b=new e(t,n._sheet.getColumnCount(2)),k=new c(t),r.saveRowHeaderInfo(n._sheet,b,k,a,n._option),n._savedToRowHeaderCells=b,n._savedToRows=k,n._copy||(u=new e(t,n._sheet.getColumnCount(2)),f=new c(t),r.saveRowHeaderInfo(n._sheet,u,f,s,n._option),n._savedFromRowHeaderCells=u,n._savedFromRows=f)),d=new e(t,i),r.saveViewportInfo(n._sheet,d,a,g,n._option),n._savedToViewportCells=d,n._copy||(o=new e(t,i),r.saveViewportInfo(n._sheet,o,s,h,n._option),n._savedFromViewportCells=o));n._savedAcitveRowViewportIndex=n._sheet.activeRowViewportIndex;n._savedAcitveColumnViewportIndex=n._sheet.activeColViewportIndex;n._savedActiveRow=n._sheet._activeRowIndex;n._savedActiveColumn=n._sheet._activeColIndex},u.prototype.initSaveState=function(){var n=this;n._savedFromColumnHeaderCells=i;n._savedFromColumns=i;n._savedFromViewportCells=i;n._savedFromRowHeaderCells=i;n._savedFromRows=i;n._savedToColumnHeaderCells=i;n._savedToColumns=i;n._savedToViewportCells=i;n._savedToRowHeaderCells=i;n._savedToRows=i;n._savedAcitveRowViewportIndex=-2;n._savedAcitveColumnViewportIndex=-2;n._savedActiveRow=-1;n._savedActiveColumn=-1},u.prototype.undo=function(t){var u=this,e=u._sheet,s,l,a,o,c,h,rt,ut,g,nt,tt,v,it;if(!e._isValidRange(u._dragDropExtent.fromRow,u._dragDropExtent.fromColumn,u._dragDropExtent.rowCount,u._dragDropExtent.columnCount,u._sheet.getRowCount(),u._sheet.getColumnCount())||!u._insert&&!e._isValidRange(u._dragDropExtent.toRow,u._dragDropExtent.toColumn,u._dragDropExtent.rowCount,u._dragDropExtent.columnCount,u._sheet.getRowCount(),u._sheet.getColumnCount()))return!1;if(s=!1,u._insert){if(!(u._dragDropExtent.fromColumn>=0&&u._dragDropExtent.fromRow>=0))if(u._dragDropExtent.fromColumn>=0){rt=u._dragDropExtent.fromColumn;o=u._dragDropExtent.columnCount;u._suspendInvalidate(t);v=e.isPaintSuspended();e.isPaintSuspended(!0);try{u._copy?u._sheet.deleteColumns(u._dragDropExtent.toColumn,o):(c=u._dragDropExtent.toColumn,h=u._dragDropExtent.fromColumn,u._dragDropExtent.fromColumn<u._dragDropExtent.toColumn?c=u._dragDropExtent.toColumn-o:h=u._dragDropExtent.fromColumn+o,u._sheet.addColumns(h,o),u._sheet.copyTo(-1,h<=c?c+o:c,-1,h,-1,o,u._option),u._sheet.deleteColumns(h<=c?c+o:c,o),c<h&&(rt=h-o));e&&(l=e.getSelections().toArray(),e._clearSelectionImp(),e.addSelection(-1,rt,e.getRowCount(),o),a=e.getSelections(),e._trigger(n.Events.SelectionChanging,{sheet:e,sheetName:e._name,oldSelections:l,newSelections:a}),e._trigger(n.Events.SelectionChanged,{sheet:e,sheetName:e._name}))}finally{e.isPaintSuspended(v);g=u._resumeInvalidate(t);g||(e.invalidateLayout(),e.repaint())}s=!0}else if(u._dragDropExtent.fromRow>=0){o=u._dragDropExtent.rowCount;ut=u._dragDropExtent.fromRow;u._suspendInvalidate(t);v=e.isPaintSuspended();e.isPaintSuspended(!0);try{u._copy?u._sheet.deleteRows(u._dragDropExtent.toRow,o):(c=u._dragDropExtent.toRow,h=u._dragDropExtent.fromRow,u._dragDropExtent.fromRow<u._dragDropExtent.toRow?c=u._dragDropExtent.toRow-o:h=u._dragDropExtent.fromRow+o,u._sheet.addRows(h,o),u._savedFromViewportCells&&(r.undoCellsInfo(u._sheet,u._savedFromViewportCells,h,0,3),s=!0),u._savedFromRowHeaderCells&&(r.undoCellsInfo(u._sheet,u._savedFromRowHeaderCells,h,0,2),s=!0),u._savedFromRows&&(r.undoRowsInfo(u._sheet,u._savedFromRows,h),s=!0),s||u._sheet.copyTo(h<=c?c+o:c,-1,h,-1,o,-1,u._option),u._sheet.deleteRows(h<=c?c+o:c,o),c<h&&(ut=h-o));e&&(l=e.getSelections().toArray(),e._clearSelectionImp(),e.addSelection(ut,-1,o,e.getColumnCount()),a=e.getSelections(),e._trigger(n.Events.SelectionChanging,{sheet:e,sheetName:e._name,oldSelections:l,newSelections:a}),e._trigger(n.Events.SelectionChanged,{sheet:e,sheetName:e._name}))}finally{e.isPaintSuspended(v);g=u._resumeInvalidate(t);g||(e.invalidateLayout(),e.repaint())}s=!0}}else{var w=u._dragDropExtent.fromRow<0?0:u._dragDropExtent.fromRow,b=u._dragDropExtent.fromColumn<0?0:u._dragDropExtent.fromColumn,y=u._dragDropExtent.toRow<0?0:u._dragDropExtent.toRow,p=u._dragDropExtent.toColumn<0?0:u._dragDropExtent.toColumn,k=u._dragDropExtent.fromRow<0?u._sheet.getRowCount():u._dragDropExtent.rowCount,d=u._dragDropExtent.fromColumn<0?u._sheet.getColumnCount():u._dragDropExtent.columnCount,ft=e._getCalcModel();ft.clear(y,p,k,d,1);nt=i;tt=i;!u._copy&&u._savedFromViewportCells&&u._savedFromViewportCells.isValueSaved()&&(tt=r.getValues(u._sheet,w,b,k,d));u._savedToViewportCells&&u._savedToViewportCells.isValueSaved()&&(nt=r.getValues(u._sheet,y,p,k,d));u._suspendInvalidate(t);v=e.isPaintSuspended();e.isPaintSuspended(!0);try{u._savedToColumnHeaderCells&&(r.undoCellsInfo(u._sheet,u._savedToColumnHeaderCells,0,p,1),s=!0);u._savedToColumns&&(r.undoColumnsInfo(u._sheet,u._savedToColumns,p),s=!0);u._savedToViewportCells&&(r.undoCellsInfo(u._sheet,u._savedToViewportCells,y,p,3),s=!0);u._savedToRowHeaderCells&&(r.undoCellsInfo(u._sheet,u._savedToRowHeaderCells,y,0,2),s=!0);u._savedToRows&&(r.undoRowsInfo(u._sheet,u._savedToRows,y),s=!0);u._savedFromColumnHeaderCells&&(r.undoCellsInfo(u._sheet,u._savedFromColumnHeaderCells,0,b,1),s=!0);u._savedFromColumns&&(r.undoColumnsInfo(u._sheet,u._savedFromColumns,b),s=!0);u._savedFromViewportCells&&(r.undoCellsInfo(u._sheet,u._savedFromViewportCells,w,b,3),s=!0);u._savedFromRowHeaderCells&&(r.undoCellsInfo(u._sheet,u._savedFromRowHeaderCells,w,0,2),s=!0);u._savedFromRows&&(r.undoRowsInfo(u._sheet,u._savedFromRows,w),s=!0);s&&e&&(l=e.getSelections().toArray(),e._clearSelectionImp(),e.addSelection(u._dragDropExtent.fromRow,u._dragDropExtent.fromColumn,u._dragDropExtent.rowCount,u._dragDropExtent.columnCount),a=e.getSelections(),e._trigger(n.Events.SelectionChanging,{sheet:e,sheetName:e._name,oldSelections:l,newSelections:a}),e._trigger(n.Events.SelectionChanged,{sheet:e,sheetName:e._name}),nt&&r.raiseRangeDataChanged(e,y,p,k,d,nt),tt&&r.raiseRangeDataChanged(e,w,b,k,d,tt))}finally{e.isPaintSuspended(v);u._resumeInvalidate(t)}}return s&&e&&(u._savedActiveRow!==-1&&u._savedActiveColumn!==-1&&(it=e.getSelections()[0],it.contains(u._savedActiveRow,u._savedActiveColumn)?e._setActiveCellImp(u._savedActiveRow,u._savedActiveColumn):e._setActiveCellImp(f(e._getFirstVisualRow(),it.row),f(e._getFirstVisualColumn(),it.col))),u._savedAcitveRowViewportIndex!==-2&&u._savedAcitveColumnViewportIndex!==-2&&u._savedActiveRow!==-1&&u._savedActiveColumn!==-1&&e.showCell(u._savedActiveRow,u._savedActiveColumn,3,3),e.invalidateLayout(),e.repaint()),s},u}(u);t.DragDropUndoAction=pt;wt=function(t){function r(n,i){var r,u;t.call(this);this._oldValueCatch={};this._oldValueIsFormulaCatch={};this._eventNS=".cellEditaction";this._sheet=n;this._cellEditInfo=i;this._canUndo=!1;i.ranges&&i.endEditType===1&&(r=i.ranges[0],r.row===-1&&(r.row=0,r.rowCount=n.getRowCount()),r.col===-1&&(r.col=0,r.colCount=n.getColumnCount()),r.rowCount===1&&r.colCount===1&&(u=n._getsArrayFormulas(r.row,r.col,1,1),u&&u.ranges&&u.ranges.length>0&&(i.ranges=[u.ranges[0]])))}return __extends(r,t),r.prototype.canExecute=function(n){var t=this,r,i;if(t._cellEditInfo.ranges){for(r=0;r<t._cellEditInfo.ranges.length;r++)if(i=t._cellEditInfo.ranges[r],!t._sheet._checkArrayFormula(i.row,i.col,i.rowCount,i.colCount))return!1}else if(!t._sheet._checkArrayFormula(t._cellEditInfo.row,t._cellEditInfo.col,1,1))return!1;return!0},r.prototype.saveState=function(){var n=this;n.iteration(function(t,i){var r=n._sheet.getFormulaInformation(t,i),u=n._positionToString(t,i);r.hasFormula?r.isArrayFormula&&(r.baseRange.row!==t||r.baseRange.col!==i)?n._oldValueIsFormulaCatch[u]=!1:(n._oldValueCatch[u]=r.formula,n._oldValueIsFormulaCatch[u]=r):n._oldValueCatch[u]=n._sheet.getValue(n._cellEditInfo.row,n._cellEditInfo.col)})},r.prototype.iteration=function(n){var i=this,r,t,u,f;if(i._cellEditInfo.ranges)for(r=0;r<i._cellEditInfo.ranges.length;r++)for(t=i._cellEditInfo.ranges[r],u=t.row;u<t.row+t.rowCount;u++)for(f=t.col;f<t.col+t.colCount;f++)n(u,f);else n(i._cellEditInfo.row,i._cellEditInfo.col)},r.prototype.saveCellState=function(n,t){},r.prototype.undo=function(t){var u=this,r=u._sheet,o=u._cellEditInfo.row,s=u._cellEditInfo.col,h=r._paintSuspended,f,e;try{r._paintSuspended=!0;r._bind(n.Events.CellChanged+u._eventNS,function(t,i){i.propertyName==="value"&&r._trigger(n.Events.ValueChanged,{sheet:i.sheet,sheetName:i.sheetName,row:i.row,col:i.col,oldValue:i._oldValue,newValue:i.sheet.getValue(i.row,i.col)})});u.iteration(function(n,t){var e=u._positionToString(n,t),f=u._oldValueIsFormulaCatch[e],h;if(f===!1)return;else f?f.isArrayFormula?r.setArrayFormula(n,t,f.baseRange.rowCount,f.baseRange.colCount,f.formula):r.setFormula(n,t,u._oldValueCatch[e]):(h=r.getFormula(n,t),h===i||h===""||r.setFormula(n,t,i),r.setValue(o,s,u._oldValueCatch[e]))})}catch(c){return!1}finally{r._unbind(n.Events.CellChanged+u._eventNS);r._paintSuspended=h}return f=r._getSheetLayout(),e=new n.Rect(f.frozenX,f.frozenY,f.width-f.frozenX,f.height-f.frozenY),r.repaint(e),!0},r.prototype.execute=function(t){var i=this,r,f,u,e;i.saveState();r=i._sheet;f=r._paintSuspended;try{r._paintSuspended=!0;r._bind(n.Events.CellChanged+i._eventNS,function(t,i){i.propertyName==="value"&&r._trigger(n.Events.ValueChanged,{sheet:i.sheet,sheetName:i.sheetName,row:i.row,col:i.col,oldValue:i._oldValue,newValue:i.sheet.getValue(i.row,i.col)})});i.applyResult=i._applyEditing(t)}finally{i._sheet._unbind(n.Events.CellChanged+i._eventNS);r._paintSuspended=f}u=r._getSheetLayout();e=new n.Rect(u.frozenX,u.frozenY,u.width-u.frozenX,u.height-u.frozenY);r.repaint(e);i._canUndo=i.applyResult===0},r.prototype._positionToString=function(n,t){return n+"_"+t},r.prototype._stringToPosition=function(n){var t=n.split("_");return{row:parseInt(t[0],10),col:parseInt(t[1],10)}},r.prototype._validateEditingValue=function(){var r=this,o=0,n=r._cellEditInfo.row,t=r._cellEditInfo.col,i=r._sheet,u=r._cellEditInfo.newValue,a=r._cellEditInfo.hasOwnProperty("autoFormat")?r._cellEditInfo.autoFormat:!0,f,e,s,h,c,l;return u&&u.length>0&&u[0]==="="?i.getDataValidator(n,t)&&(f=u.substring(1),f!==""&&f!==i.getFormula(n,t)&&(e=i.getCalcService(),e&&(s=e.parse(f,n>=0?n:0,t>=0?t:0),s&&(h=e.evaluateParsedFormula(i._getSheetSource(),s,n,t),i.isValid(n,t,h)||(o=i._validationError(n,t,h)))))):(c=r._getValueFromEditing(n,t,u,a),l=i.isValid(n,t,c),l||(o=i._validationError(n,t,u),i._eventHandler._forceCancelSelectiong=!0)),o},r.prototype._applyEditing=function(t){var u=this,r=u._sheet,f=u._cellEditInfo.newValue,c=u._validateEditingValue(),s,a,v,e,p;if(c===1||c===2)return c;var w=u._cellEditInfo.hasOwnProperty("autoFormat")?u._cellEditInfo.autoFormat:!0,b=r.parent?r.parent.canUserEditFormula():!0,l,h=u._cellEditInfo.row;if(h=h>=0?h:0,s=u._cellEditInfo.col,s=s>=0?s:0,a=r.getCalcService(),b&&a&&f&&f.length>0&&f[0]==="=")try{if(u._cellEditInfo.ranges&&u._cellEditInfo.endEditType===1)return e=u._cellEditInfo.ranges[0],r.setArrayFormula(e.row,e.col,e.rowCount,e.colCount,f.substring(1)),c;else v=a.parse(f.substring(1),h,s)}catch(y){r._raiseInvalidOperation(0,typeof y=="string"?y:y.message);throw y;}else u._cellEditInfo.ranges&&u._cellEditInfo.endEditType===1&&(e=u._cellEditInfo.ranges[0],r.clear(e.row,e.col,e.rowCount,e.colCount,3,1));return v||(p=!1,/^('=)/ig.test(f)&&(f=f.substring(1),p=!0),(l===o||l===i||p)&&(l=u._getValueFromEditing(h,s,f,w))),u.iteration(function(t,u){if(v)try{t==h&&u==s?r.setFormula(t,u,f.substring(1)):r.setFormula(t,u,a.unparse(v,t,u));r._trigger(n.Events.UserFormulaEntered,{sheet:r,sheetName:r._name,row:t,col:u,formula:f.substring(1).toUpperCase()})}catch(e){r._raiseInvalidOperation(0,typeof e=="string"?e:e.message);throw e;}else{try{r.hasFormula(t,u)&&r.setFormula(t,u,i)}catch(e){r._raiseInvalidOperation(0,typeof e=="string"?e:e.message);throw e;}try{r.setValue(t,u,l)}catch(o){r.setValue(t,u,f)}}}),c},r.prototype.canUndo=function(){return this._canUndo},r.prototype._getValueFromEditing=function(t,r,u,f){var l,s,h,a,c,p,w;if(!n.features.formatter)return u;var v=this,e=i,y=v._sheet.getActualStyle(t,r);if(y&&(y.formatter?(e=y.formatter,typeof e=="string"&&(e=new n.GeneralFormatter(e),v._sheet._editingTimeValue)):e=y._autoFormatter),!e||e instanceof n.AutoFormatter)if(f){s={};h=i;try{h=(new n.GeneralFormatter).GetPreferredDisplayFormatter(u,s)}catch(b){}return a=i,e&&e instanceof n.AutoFormatter&&s.value!==i&&h&&h.FormatString()!=="General"?a=new n.AutoFormatter(h):!e&&h&&(a=new n.AutoFormatter(h)),a&&(c=v._sheet.getStyleObject(t,r),p=typeof c=="string",(!c||p)&&(w=new n.Style,p&&(w.parentName=c),c=w),c._autoFormatter=a,v._sheet.setStyle(t,r,c)),s.hasOwnProperty("value")&&s.value!==o&&s.value!==i?s.value:u}else return u;else{l=i;try{l=e.Parse(u)}catch(b){}return l===o||l===i?u:l}},r}(u);t.CellEditUndoAction=wt;bt=function(n){function t(t,r){n.call(this);this._sheet=t;this._newName=r;this._oldName=i}return __extends(t,n),t.prototype.canUndo=function(){return!!this._oldName},t.prototype.canExecute=function(n){var t=this;return t._sheet&&t._newName&&t._newName!==t._oldName},t.prototype.execute=function(n){var t=this,i=t._sheet;i&&t._newName&&t._newName!==t._oldName&&(t.saveState(),t._suspendInvalidate(n),i._name=t._newName,t._resumeInvalidate(n),i._refreshTabStrip())},t.prototype.saveState=function(){this._sheet&&(this._oldName=this._sheet._name)},t.prototype.undo=function(n){var t=this,i=t._sheet;return i?(t._suspendInvalidate(n),i._name=t._oldName,t._resumeInvalidate(n),i._refreshTabStrip(),!0):!1},t}(u);t.SheetRenameUndoAction=bt;kt=function(n){function t(t,i){n.call(this);this._sheet=t;i<.25?i=.25:i>4&&(i=4);this._zoomFactor=i;this._prevZoomFactor=-1}return __extends(t,n),t.prototype.canExecute=function(n){var t=this;return t._sheet&&t._sheet.parent._allowUserZoom&&t._sheet._zoomFactor!==t._zoomFactor},t.prototype.execute=function(n){var i=this,t=i._sheet,r,u;i.saveState();t&&(!t.parent||t.parent._allowUserZoom===!0)&&t._zoomFactor!==i._zoomFactor&&(t.isEditing()===!0&&t.endEdit(),i._suspendInvalidate(n),r=t.isPaintSuspended(),t.isPaintSuspended(!0),t.zoom(i._zoomFactor),t.isPaintSuspended(r),u=i._resumeInvalidate(n),u||(t.invalidateLayout(),t.repaint()))},t.prototype.canUndo=function(){return this._sheet&&this._prevZoomFactor>0},t.prototype.saveState=function(){this._sheet&&(this._prevZoomFactor=this._sheet._zoomFactor)},t.prototype.undo=function(n){var i=this,t=i._sheet,r,u;return t?(i._suspendInvalidate(n),r=t.isPaintSuspended(),t.isPaintSuspended(!0),t.zoom(i._prevZoomFactor),t.isPaintSuspended(r),u=i._resumeInvalidate(n),u||(t.invalidateLayout(),t.repaint()),!0):!1},t}(u);t.ZoomUndoAction=kt;b=function(){function n(n,t){this.value=n;this.formulaInfo=t}return n}();k=function(t){function u(n,r){t.call(this);this._cachedFormulaInfos=[];this._eventNS=".clearRangeAction";var u=this;u._sheet=n;u._clearRange=r;u._cachedFilteredColumns=i;u._cachedValues=i;u._cachedTables=i}return __extends(u,t),u.prototype.execute=function(t){var f=this,i,u,e;if(f.saveState(),i=f._sheet,i&&(u=i._getActualRange(f._clearRange),u.colCount>0&&u.rowCount>0))try{i._bind(n.Events.CellChanged+f._eventNS,function(t,r){r.propertyName==="value"&&i._trigger(n.Events.ValueChanged,{sheet:r.sheet,sheetName:r.sheetName,row:r.row,col:r.col})});e=i.isPaintSuspended();i.isPaintSuspended(!0);i.suspendEvent();i.clear(u.row,u.col,u.rowCount,u.colCount,3,1);i.resumeEvent();i.isPaintSuspended(e);r.raiseRangeDataChanged(i,u.row,u.col,u.rowCount,u.colCount)}finally{f._sheet._unbind(n.Events.CellChanged+f._eventNS)}},u.prototype.canExecute=function(n){var i=this._sheet,t=this._clearRange;return!(i.isProtected===!0&&i._isAnyCellInRangeLocked(t))&&i._checkArrayFormula(t.row,t.col,t.rowCount,t.colCount)},u.prototype.canUndo=function(){return!!this._cachedValues},u.prototype.saveState=function(){var n=this,s=n._sheet,c,p,t,u,e,a,w,l,r,f,v,h,y;if(s){if(n._cachedTables=[],c=s.getTables(),c&&c.length>0)for(f=0;f<c.length;f++)p=c[f],n._clearRange.containsRange(p.range())&&n._cachedTables.push(p);if(n._cachedFilteredColumns=[],t=s.rowFilter(),t&&t.range&&t.isFiltered()&&(u=t.range.row,a=t.range.rowCount,t.showFilterButton&&(u=t.range.row-1,a=t.range.rowCount+1,u<0&&(u=-1,a=-1)),(n._clearRange.row===-1||n._clearRange.row<=u&&u+a<=n._clearRange.row+n._clearRange.rowCount)&&(n._clearRange.col===-1||n._clearRange.col<=t.range.col&&t.range.col+t.range.colCount<=n._clearRange.col+n._clearRange.colCount)))for(e=t.range.col<0?0:t.range.col,w=t.range.colCount<0?s.getColumnCount():t.range.colCount,l=0;l<w;l++)t.isColumnFiltered(e+l)&&n._cachedFilteredColumns.push(e+l);if(r=s._getActualRange(n._clearRange),r.colCount>0&&r.rowCount>0)for(n._cachedValues=[r.row+r.rowCount],f=0;f<r.rowCount;f++)for(n._cachedValues[r.row+f]=[r.col+r.colCount],n._cachedFormulaInfos[r.row+f]=[],v=0;v<r.colCount;v++)u=r.row+f,e=r.col+v,h=s.getFormulaInformation(u,e),h.hasFormula?n._cachedValues[u][e]=h.isArrayFormula&&(h.baseRange.row!==u||h.baseRange.col!==e)?-1:new b(h.formula,h):(y=s.getValue(u,e),y!==o&&y!==i&&(n._cachedValues[u][e]=new b(y,o)))}},u.prototype.undo=function(t){var f=this,u=f._sheet,v,e,y,w,o,a,l,p,b;if(u){if(v=!1,f._cachedTables&&f._cachedTables.length>0)for(y=f._cachedTables,w=y.length,e=0;e<w;e++)u._addTableInternal(y[e]);if(o=u._getActualRange(f._clearRange),f._cachedValues&&o.colCount>0&&o.rowCount>0)try{u._bind(n.Events.CellChanged+f._eventNS,function(t,i){i.propertyName==="value"&&u._trigger(n.Events.ValueChanged,{sheet:i.sheet,sheetName:i.sheetName,row:i.row,col:i.col})});var k=o.rowCount,d=o.colCount,g=u.isPaintSuspended();for(u.isPaintSuspended(!0),u.suspendEvent(),e=0;e<k;e++)for(a=0;a<d;a++){var s=o.row+e,h=o.col+a,c=f._cachedValues[s][h];if(c===-1)continue;else c?c.formulaInfo?(l=c.formulaInfo,l&&l.isArrayFormula?u.setArrayFormula(s,h,l.baseRange.rowCount,l.baseRange.colCount,l.formula):u.setFormula(s,h,c.value)):(u.setFormula(s,h,i),u.setValue(s,h,c.value)):(u.setFormula(s,h,i),u.setValue(s,h,i))}u.resumeEvent();u.isPaintSuspended(g);r.raiseRangeDataChanged(u,o.row,o.col,o.rowCount,o.colCount);v=!0}finally{u._unbind(n.Events.CellChanged+f._eventNS)}if(p=u.rowFilter(),p&&f._cachedFilteredColumns&&f._cachedFilteredColumns.length>0)for(e=0;e<f._cachedFilteredColumns.length;e++)b=f._cachedFilteredColumns[e],p.filter(b);if(v)return u.repaint(),!0}return!1},u}(u);t.ClearRangeValueUndoAction=k;d=function(n){function t(t,r){var u,f;if(n.call(this),this._cachedActions=[],u=this,u._sheet=t,u._cachedActions=i,r&&r.length>0)for(u._cachedActions=[],f=0;f<r.length;f++)u._cachedActions[f]=new k(t,r[f])}return __extends(t,n),t.prototype.canExecute=function(n){var t,i;if(this._cachedActions){for(t=0;t<this._cachedActions.length;t++)if(i=this._cachedActions[t],!i.canExecute(n))return!1;return!0}return!1},t.prototype.execute=function(n){var t=this,i,r,u;if(t.saveState(),t._cachedActions){for(t._suspendInvalidate(n),i=0;i<t._cachedActions.length;i++)r=t._cachedActions[i],r.execute(n);u=t._resumeInvalidate(n);u||(t._sheet.invalidateLayout(),t._sheet.repaint())}},t.prototype.canUndo=function(){var n,t;if(this._cachedActions){for(n=0;n<this._cachedActions.length;n++)if(t=this._cachedActions[n],!t.canUndo())return!1;return!0}return!1},t.prototype.saveState=function(){var n,t;if(this._cachedActions)for(n=0;n<this._cachedActions.length;n++)t=this._cachedActions[n],t.saveState()},t.prototype.undo=function(n){var t=this,i,r,u,f;if(t._cachedActions){for(i=t._cachedActions.length-1;i>=0;i--)if(r=t._cachedActions[i],t._suspendInvalidate(n),u=r.undo(n),f=t._resumeInvalidate(n),u)f||(t._sheet.invalidateLayout(),t._sheet.repaint());else return!1;return!0}return!1},t}(u);t.ClearValueUndoAction=d;dt=function(t){function u(n,i){t.call(this);var r=this;r._workSheet=n;r._dragFillExtent=i;r._dragFillExtent.autoFillType===4?r._clearValueUndoAction=new d(n,[r._dragFillExtent.fillRange]):r.initWholeFilledRange();r._fillSeries=r._dragFillExtent.fillDirection===0||r._dragFillExtent.fillDirection===1?1:0}return __extends(u,t),u.prototype.canExecute=function(n){var r=this,i=r._workSheet,t=r._dragFillExtent;return i.isProtected&&i._isAnyCellInRangeLocked(t.fillRange)?!1:i._checkArrayFormula(t.fillRange.row,t.fillRange.col,t.fillRange.rowCount,t.fillRange.colCount)?this._dragFillExtent.autoFillType===4?this.canExecuteDragClear():this.canExecuteDragFill():!1},u.prototype.canExecuteDragClear=function(){return!0},u.prototype.canExecuteDragFill=function(){var n=this._dragFillExtent.startRange,t=this._dragFillExtent.fillRange;return!t.intersect(n.row,n.col,n.rowCount,n.colCount)},u.prototype.execute=function(n){var u=this,o,f,s;if(u.canExecute(n)){var t=u._workSheet,h=t.getSelections()?t.getSelections().toArray():i,e=!1;try{u._suspendInvalidate(t);t.suspendCalcService();t.suspendEvent();u.saveState();o=t.isPaintSuspended();t.isPaintSuspended(!0);u._dragFillExtent.autoFillType===4?u.executeDragFillClear(t):u.executeDragFill(t)}finally{t.isPaintSuspended(o);t.resumeCalcService();t.resumeEvent();u._savedFilledViewportCells&&u._savedFilledViewportCells.isValueSaved()&&(f=u._dragFillExtent.fillRange,r.raiseRangeDataChanged(t,f.row,f.col,f.rowCount,f.colCount,u._savedFilledViewportCells.getValues()));s=t.getSelections()?t.getSelections().toArray():i;t._raiseSelectionChanging(h,s)&&t._raiseSelectionChanged();e=u._resumeInvalidate(t)}e||(t.invalidateLayout(),t.repaint())}},u.prototype.executeDragFillClear=function(t){var u=this,r,e,i;u._clearValueUndoAction.execute(t);r=u._dragFillExtent.startRange;e=u._dragFillExtent.fillRange;r.equals(e)||(u._fillSeries===0?(i=new n.Range(r.row,r.col,f(1,r.rowCount-e.rowCount),r.colCount),t._setActiveCellImp(f(t._getFirstVisualRow(),i.row),f(t._getFirstVisualColumn(),i.col),t.activeRowViewportIndex,t.activeColViewportIndex),t._clearSelectionImp(),t.addSelection(i.row,i.col,i.rowCount,i.colCount)):(i=new n.Range(r.row,r.col,r.rowCount,f(1,r.colCount-e.colCount)),t._setActiveCellImp(f(t._getFirstVisualRow(),i.row),f(t._getFirstVisualColumn(),i.col),t.activeRowViewportIndex,t.activeColViewportIndex),t._clearSelectionImp(),t.addSelection(i.row,i.col,i.rowCount,i.colCount)))},u.prototype.executeDragFill=function(t){var u=this,l=u._workSheet,e=u._dragFillExtent.startRange,c=u._dragFillExtent.fillRange,s,h,v,y,p,o,a;if(u._dragFillExtent.autoFillType===1)u.clearData(c,!0),l.fillAuto(e,u._wholeFillRange,u._fillSeries);else if(u._dragFillExtent.autoFillType===0)v=1019,u.copyCells(e,c,v);else if(u._dragFillExtent.autoFillType===2)u.copyCells(e,c,64);else if(u._dragFillExtent.autoFillType===3)if(u.clearData(c,!0),y=e.rowCount===1&&e.colCount===1&&!(e.row===-1&&e.col!==-1)&&!(e.col===-1&&e.row!==-1),y)p=187,u.copyCells(e,c,p);else{for(o=u.adjustRange(u._wholeFillRange),a=new n._GcSheetModel(o.rowCount,o.colCount,i),s=0;s<o.rowCount;s++)for(h=0;h<o.colCount;h++)a.setStyle(s,h,r.getStyleObject(u._workSheet,o.row+s,o.col+h,3));for(l.fillAuto(e,u._wholeFillRange,u._fillSeries),s=0;s<o.rowCount;s++)for(h=0;h<o.colCount;h++)r.setStyleObject(u._workSheet,o.row+s,o.col+h,3,a.getStyle(s,h))}l._setActiveCellImp(f(t._getFirstVisualRow(),u._wholeFillRange.row),f(t._getFirstVisualColumn(),u._wholeFillRange.col),t.activeRowViewportIndex,t.activeColViewportIndex);t._selectionModel&&t._clearSelectionImp();l.addSelection(u._wholeFillRange.row,u._wholeFillRange.col,u._wholeFillRange.rowCount,u._wholeFillRange.colCount)},u.prototype.clearData=function(n,t){var i=1;this._workSheet.clearCore(n.row,n.col,n.rowCount,n.colCount,3,i,t)},u.prototype.adjustRange=function(t){var i=t.row!==-1?t.row:0,r=t.col!==-1?t.col:0,u=t.rowCount!==-1?t.rowCount:this._workSheet.getRowCount(),f=t.colCount!==-1?t.colCount:this._workSheet.getColumnCount();return new n.Range(i,r,u,f)},u.prototype.copyCells=function(n,t,i){var f=this,w=f._workSheet,r=f.adjustRange(n),u=f.adjustRange(t),e,h,c,o,s,b,l,a,v,k,g,p,nt,d,tt,it;if(f._fillSeries===0){for(v=y(u.rowCount/r.rowCount),e=0;e<v;e++)h=r.row,c=r.col,f._dragFillExtent.fillDirection===3?o=u.row+e*r.rowCount:(b=u.row+u.rowCount,o=b-(e+1)*r.rowCount),s=u.col,l=r.rowCount,a=r.colCount,w.copyToCore(h,c,o,s,l,a,i,!0);k=u.rowCount%r.rowCount;k!==0&&(f._dragFillExtent.fillDirection===3?h=r.row:(g=r.rowCount-(u.rowCount-r.rowCount*v),h=r.row+g),c=r.col,f._dragFillExtent.fillDirection===3?o=u.row+r.rowCount*v:(b=u.row+u.rowCount,o=b-v*r.rowCount-k),s=u.col,l=k,a=r.colCount,w.copyToCore(h,c,o,s,l,a,i,!0))}else{for(p=y(u.colCount/r.colCount),e=0;e<p;e++)h=r.row,c=r.col,o=u.row,f._dragFillExtent.fillDirection===1?s=u.col+e*r.colCount:(nt=u.col+u.colCount,s=nt-(e+1)*r.colCount),l=r.rowCount,a=r.colCount,w.copyToCore(h,c,o,s,l,a,i,!0);d=u.colCount%r.colCount;d!==0&&(h=r.row,f._dragFillExtent.fillDirection===1?c=r.col:(tt=r.colCount-(u.colCount-r.colCount*p),c=r.col+tt),o=u.row,f._dragFillExtent.fillDirection===1?s=u.col+r.colCount*p:(it=u.col+u.colCount,s=it-p*r.colCount-d),l=r.rowCount,a=d,w.copyToCore(h,c,o,s,l,a,i,!0))}},u.prototype.saveState=function(){this._dragFillExtent.autoFillType===4?this.saveDragClearState():this.saveDragFillState()},u.prototype.saveDragClearState=function(){this._clearValueUndoAction.saveState()},u.prototype.saveDragFillState=function(){var n=this;n._savedFilledViewportCells=n.saveRangeStates(n._dragFillExtent.fillRange);n._savedStartViewportCells=n.saveRangeStates(n._dragFillExtent.startRange)},u.prototype.saveRangeStates=function(n){var t=this.adjustRange(n),i=new e(t.rowCount,t.colCount);return r.saveViewportInfo(this._workSheet,i,t.row,t.col,1023),i},u.prototype.undo=function(n){var i=this,t=i._workSheet,r=!1,u=!1,f;try{i._suspendInvalidate(t);t.suspendCalcService();f=t.isPaintSuspended();t.isPaintSuspended(!0);r=i._undo(t)}finally{t.isPaintSuspended(f);t.resumeCalcService();u=i._resumeInvalidate(t)}return u||(t.invalidateLayout(),t.repaint()),r},u.prototype._undo=function(n){var u=this,e,s=n.getSelections()?n.getSelections().toArray():i,f=i,t=u._dragFillExtent.fillRange,o;return u._savedFilledViewportCells&&u._savedFilledViewportCells.isValueSaved()&&(f=r.getValues(u._workSheet,t.row,t.col,t.rowCount,t.colCount)),e=u._dragFillExtent.autoFillType===4?u.undoDragClear(n):u.undoDragFill(n),n._skipCloseDragFillSmartTag!==!0&&n._closeDragFillPopup(),f&&r.raiseRangeDataChanged(n,t.row,t.col,t.rowCount,t.colCount,f),o=n.getSelections()?n.getSelections().toArray():i,n._raiseSelectionChanging(s,o)&&n._raiseSelectionChanged(),e},u.prototype.undoDragClear=function(n){var t=this,i=t._clearValueUndoAction.undo(n);return n._setActiveCellImp(f(n._getFirstVisualRow(),t._dragFillExtent.startRange.row),f(n._getFirstVisualColumn(),t._dragFillExtent.startRange.col),n.activeRowViewportIndex,n.activeColViewportIndex),n._clearSelectionImp(),n.addSelection(t._dragFillExtent.startRange.row,t._dragFillExtent.startRange.col,t._dragFillExtent.startRange.rowCount,t._dragFillExtent.startRange.colCount),i},u.prototype.undoDragFill=function(n){var t=this;t._suspendInvalidate(n);n.suspendCalcService();try{t.undoRangeStates(t._savedFilledViewportCells,t._dragFillExtent.fillRange);t.undoRangeStates(t._savedStartViewportCells,t._dragFillExtent.startRange);n._setActiveCellImp(f(n._getFirstVisualRow(),t._dragFillExtent.startRange.row),f(n._getFirstVisualColumn(),t._dragFillExtent.startRange.col),n.activeRowViewportIndex,n.activeColViewportIndex);n._clearSelectionImp();n.addSelection(t._dragFillExtent.startRange.row,t._dragFillExtent.startRange.col,t._dragFillExtent.startRange.rowCount,t._dragFillExtent.startRange.colCount)}finally{n.resumeCalcService();t._resumeInvalidate(n)}return n.invalidateLayout(),!0},u.prototype.undoRangeStates=function(n,t){var i=this.adjustRange(t);r.undoCellsInfo(this._workSheet,n,i.row,i.col,3)},u.prototype.initWholeFilledRange=function(){var i=this,f=0,e=0,o=0,s=0,r=i._dragFillExtent.fillDirection,t=i._dragFillExtent.startRange,u=i._dragFillExtent.fillRange;r===0||r===1?(f=t.row,e=t.rowCount,o=r===0?u.col:t.col,s=t.colCount+u.colCount):(f=r===2?u.row:t.row,e=t.rowCount+u.rowCount,o=t.col,s=t.colCount);i._wholeFillRange=new n.Range(f,o,e,s)},u}(u);t.DragFillUndoAction=dt;g=function(n){function t(t,i,r,u,f){n.call(this);var e=this;e._sheet=t;e._fromSheet=i;e._toSheet=r;e._pasteExtent=u;e._pasteOption=f}return __extends(t,n),t.prototype.canUndo=function(){return!0},t.prototype.canExecute=function(n){var t=this._sheet,i=this._pasteExtent.targetRange,r=this._pasteExtent.sourceRange;return!(t.isProtected&&t._isAnyCellInRangeLocked(i))&&t._checkArrayFormula(i.row,i.col,i.rowCount,i.colCount)&&(!this._pasteExtent.isCutting||!(t.isProtected&&t._isAnyCellInRangeLocked(r))&&t._checkArrayFormula(r.row,r.col,r.rowCount,r.colCount))},t.prototype.saveState=function(){var n=this,h,a,v,y,w,b,g,nt,tt,it,rt,ut;n.initSaveState();var ht=n._pasteExtent.isCutting,f=t.convertPasteOption(n._pasteOption),i=n._pasteExtent.sourceRange,u=n._pasteExtent.targetRange;if(n._fromSheet&&i&&ht){var ft=i.row<0?0:i.row,et=i.col<0?0:i.col,o=i.row<0?n._fromSheet.getRowCount():i.rowCount,s=i.col<0?n._fromSheet.getColumnCount():i.colCount;i.row<0&&i.col<0&&u.row<0&&u.col<0&&n._fromSheet._name!==n._toSheet._name&&(h=new p,r.saveSheetInfo(n._fromSheet,h,f),n._savedFromSheetInfo=h);i.row<0&&(a=new e(n._fromSheet.getRowCount(1),s),v=new l(s),r.saveColumnHeaderInfo(n._fromSheet,a,v,et,f),n._savedFromColumnHeaderCells=a,n._savedFromColumns=v);i.col<0&&(y=new e(o,n._fromSheet.getColumnCount(2)),w=new c(o),r.saveRowHeaderInfo(n._fromSheet,y,w,ft,f),n._savedFromRowHeaderCells=y,n._savedFromRows=w);b=new e(o,s);r.saveViewportInfo(n._fromSheet,b,ft,et,f);n._savedFromViewportCells=b}var ot=u.row<0?0:u.row,st=u.col<0?0:u.col,k=u.row<0?n._toSheet.getRowCount():u.rowCount,d=u.col<0?n._toSheet.getColumnCount():u.colCount;n._fromSheet&&i&&(i.row<0&&i.col<0&&u.row<0&&u.col<0&&n._fromSheet._name!==n._toSheet._name&&(g=new p,r.saveSheetInfo(n._toSheet,g,f),n._savedToSheetInfo=g),i.row<0&&(nt=new e(n._toSheet.getRowCount(1),d),tt=new l(d),r.saveColumnHeaderInfo(n._toSheet,nt,tt,st,f),n._savedToColumnHeaderCells=nt,n._savedToColumns=tt),i.col<0&&(it=new e(k,n._toSheet.getColumnCount(2)),rt=new c(k),r.saveRowHeaderInfo(n._toSheet,it,rt,ot,f),n._savedToRowHeaderCells=it,n._savedToRows=rt));ut=new e(k,d);r.saveViewportInfo(n._toSheet,ut,ot,st,f);n._savedToViewportCells=ut},t.prototype.initSaveState=function(){var n=this;n._savedFromSheetInfo=i;n._savedFromColumnHeaderCells=i;n._savedFromColumns=i;n._savedFromViewportCells=i;n._savedFromRowHeaderCells=i;n._savedFromRows=i;n._savedToSheetInfo=i;n._savedToColumnHeaderCells=i;n._savedToColumns=i;n._savedToViewportCells=i;n._savedToRowHeaderCells=i;n._savedToRows=i},t.prototype.pasteOption=function(){return this._pasteOption},t.prototype.pasteRange=function(){return this._pasteExtent.targetRange},t.prototype.execute=function(n){var t=this,i=t._pasteExtent.sourceRange,u=t._pasteExtent.targetRange,f;if((!t._fromSheet||!i||t._fromSheet._isValidRange(i.row,i.col,i.rowCount,i.colCount,t._fromSheet.getRowCount(),t._fromSheet.getColumnCount()))&&t._toSheet&&u&&t._toSheet._isValidRange(u.row,u.col,u.rowCount,u.colCount,t._toSheet.getRowCount(),t._toSheet.getColumnCount())){t.saveState();t._suspendInvalidate(n);t._toSheet.suspendEvent();t._fromSheet&&t._fromSheet.suspendEvent();try{t._toSheet._clipboardPaste(t._fromSheet,i,t._toSheet,u,t._pasteExtent.isCutting,t._pasteExtent.clipboardText,t._pasteOption)}finally{t._toSheet.resumeEvent();t._fromSheet&&t._fromSheet.resumeEvent();t._resumeInvalidate(n);f=t._sheet;f&&(t._pasteExtent.isCutting&&t._savedFromViewportCells&&t._savedFromViewportCells.isValueSaved()&&t._fromSheet&&r.raiseRangeDataChanged(t._fromSheet,i.row,i.col,i.rowCount,i.colCount,t._savedFromViewportCells.getValues()),t._savedToViewportCells&&t._savedToViewportCells.isValueSaved()&&t._toSheet&&r.raiseRangeDataChanged(t._toSheet,u.row,u.col,u.rowCount,u.colCount,t._savedToViewportCells.getValues()))}}},t.prototype.undo=function(n){var t=this,u=t._pasteExtent.sourceRange,e=t._pasteExtent.targetRange,f,b;if(!t._toSheet||!e||!t._toSheet._isValidRange(e.row,e.col,e.rowCount,e.colCount,t._toSheet.getRowCount(),t._toSheet.getColumnCount())||t._fromSheet&&u&&(!t._fromSheet._isValidRange(u.row,u.col,u.rowCount,u.colCount,t._fromSheet.getRowCount(),t._fromSheet.getColumnCount())||t._fromSheet&&t._fromSheet._name===t._toSheet._name&&t._toSheet.parent&&!t._toSheet.parent.sheets.contains(t._fromSheet)))return!1;t._suspendInvalidate(n);f=!1;try{var l=i,a=i,h=e.row<0?0:e.row,c=e.col<0?0:e.col,p=e.row<0?t._toSheet.getRowCount():e.rowCount,w=e.col<0?t._toSheet.getColumnCount():e.colCount;t._savedToSheetInfo&&(r.undoSheetInfo(t._toSheet,t._savedToSheetInfo),f=!0);t._savedToViewportCells&&t._savedToViewportCells.isValueSaved()&&(l=r.getValues(t._toSheet,h,c,p,w));t._savedToColumnHeaderCells&&(r.undoCellsInfo(t._toSheet,t._savedToColumnHeaderCells,0,c,1),f=!0);t._savedToColumns&&(r.undoColumnsInfo(t._toSheet,t._savedToColumns,c),f=!0);t._savedToViewportCells&&(r.undoCellsInfo(t._toSheet,t._savedToViewportCells,h,c,3),f=!0);t._savedToRowHeaderCells&&(r.undoCellsInfo(t._toSheet,t._savedToRowHeaderCells,h,0,2),f=!0);t._savedToRows&&(r.undoRowsInfo(t._toSheet,t._savedToRows,h),f=!0);var o=0,s=0,v=0,y=0;t._fromSheet&&u&&(o=u.row<0?0:u.row,s=u.col<0?0:u.col,v=u.row<0?t._fromSheet.getRowCount():u.rowCount,y=u.col<0?t._fromSheet.getColumnCount():u.colCount,t._savedFromViewportCells&&t._savedFromViewportCells.isValueSaved()&&(a=r.getValues(t._fromSheet,o,s,v,y)),t._savedFromColumnHeaderCells&&(r.undoCellsInfo(t._fromSheet,t._savedFromColumnHeaderCells,0,s,1),f=!0),t._savedFromColumns&&(r.undoColumnsInfo(t._fromSheet,t._savedFromColumns,s),f=!0),t._savedFromViewportCells&&(r.undoCellsInfo(t._fromSheet,t._savedFromViewportCells,o,s,3),f=!0),t._savedFromRowHeaderCells&&(r.undoCellsInfo(t._fromSheet,t._savedFromRowHeaderCells,o,0,2),f=!0),t._savedFromRows&&(r.undoRowsInfo(t._fromSheet,t._savedFromRows,o),f=!0));b=n;f&&b&&(l&&t._toSheet&&r.raiseRangeDataChanged(t._toSheet,h,c,p,w,l),a&&t._fromSheet&&r.raiseRangeDataChanged(t._fromSheet,o,s,v,y,a))}finally{t._resumeInvalidate(n)}return f},t.convertPasteOption=function(n){var t=0;return(n===0||n===1)&&(t|=1),(n===0||n===2)&&(t|=64),(n===0||n===3)&&(t|=2),n===0&&(t|=32,t|=16,t|=256,t|=4,t|=512),t},t}(u);t.ClipboardPasteRangeUndoAction=g;gt=function(t){function i(i,r,u,f,e){var o,s;if(t.call(this),this._sheet=i,!u)throw new Error(n.SR.Exp_DestSheetIsNull);if(!f)throw new Error(n.SR.Exp_PasteExtentIsNull);if(f.pastedRanges&&f.pastedRanges.length>0)for(this._cachedActions=[],o=0;o<f.pastedRanges.length;o++)s={sourceRange:f.fromRange,targetRange:f.pastedRanges[o],isCutting:f.isCutting,clipboardText:f.clipboardText},this._cachedActions[o]=new g(i,r,u,s,e)}return __extends(i,t),i.prototype.execute=function(n){var i=this,t,f,u,r,e,o;if(i._cachedActions){t=i._sheet;i._suspendInvalidate(t);f=t.isPaintSuspended();t.isPaintSuspended(!0);try{for(u=0;u<i._cachedActions.length;u++)r=i._cachedActions[u],t?(e=t._raiseClipboardPasting(r.pasteRange(),r.pasteOption()),e||(r.execute(n),t._raiseClipboardPasted(r.pasteRange(),r.pasteOption()))):r.execute(n);i.refreshSelection(n)}finally{t.isPaintSuspended(f);o=i._resumeInvalidate(t);o||i.refreshUI(n)}}},i.prototype.refreshSelection=function(n){var r=this,t=r._sheet,o,e,s,u,i;if(t&&r._cachedActions){if(o=t.getSelections().toArray(),t._clearSelectionImp(),r._cachedActions.length>1)for(e=0;e<r._cachedActions.length;e++)s=r._cachedActions[e],u=s.pasteRange(),t.addSelection(u.row,u.col,u.rowCount,u.colCount);else r._cachedActions.length>0&&(i=r._cachedActions[0].pasteRange(),t.addSelection(i.row,i.col,i.rowCount,i.colCount),i.contains(t._activeRowIndex,t._activeColIndex)||t._setActiveCellImp(f(t._getFirstVisualRow(),i.row),f(t._getFirstVisualColumn(),i.col),t.activeRowViewportIndex,t.activeColViewportIndex));t._raiseSelectionChanging(o,t.getSelections().toArray())&&t._raiseSelectionChanged()}},i.prototype.refreshUI=function(n){var t=this._sheet;t&&(t.invalidateLayout(),t.repaint())},i.prototype.canExecute=function(n){var t,i;if(this._cachedActions){for(t=0;t<this._cachedActions.length;t++)if(i=this._cachedActions[t],!i.canExecute(n))return!1;return!0}return!1},i.prototype.canUndo=function(){var n,t;if(this._cachedActions){for(n=0;n<this._cachedActions.length;n++)if(t=this._cachedActions[n],!t.canUndo())return!1;return!0}return!1},i.prototype.saveState=function(){var n,t;if(this._cachedActions)for(n=0;n<this._cachedActions.length;n++)t=this._cachedActions[n],t.saveState()},i.prototype.undo=function(n){var t=this,i,r,f,u,e,o;if(t._cachedActions){i=t._sheet;r=!0;t._suspendInvalidate(i);f=i.isPaintSuspended();i.isPaintSuspended(!0);try{for(u=0;u<t._cachedActions.length;u++)e=t._cachedActions[u],r=r&&e.undo(n)}finally{i.isPaintSuspended(f);o=t._resumeInvalidate(i);o||t.refreshUI(n)}return r}return!1},i}(u);t.ClipboardPasteUndoAction=gt;v=function(n){function t(){n.call(this)}return __extends(t,n),t.prototype.init=function(n,t){this._sheet=n;this._floatingObjectExtent=t;this._savedFloatingObjects=[]},t.prototype.refreshUI=function(n){var t=this._sheet;t&&(t.invalidateLayout(),t.repaint())},t.prototype.canExecute=function(n){return this._sheet._hasFloatingObjectsSelected()?!0:!1},t.prototype.canUndo=function(){return this._savedFloatingObjects&&this._savedFloatingObjects.length>0?!0:!1},t.prototype.saveState=function(){var n=this,t,r,i;if(n._floatingObjectExtent&&n._floatingObjectExtent.names instanceof Array)for(t=0,r=n._floatingObjectExtent.names.length;t<r;t++)i=n._sheet._findFloatingObjectInternal(n._floatingObjectExtent.names[t]),i&&n._savedFloatingObjects.push(i)},t}(u);t.FloatingObjectUndoActionBase=v;ni=function(t){function i(n,i){t.call(this);this.init(n,i)}return __extends(i,t),i.prototype.execute=function(t){var i=this,r,e,u,o,f,s;if(n.features.floatingObject&&i._floatingObjectExtent&&i._floatingObjectExtent.names instanceof Array){for(i.saveState(),r=i._sheet,i._suspendInvalidate(t),e=r.isPaintSuspended(),r.isPaintSuspended(!0),u=0,o=i._floatingObjectExtent.names.length;u<o;u++)f=r._findFloatingObjectInternal(i._floatingObjectExtent.names[u]),f&&(r._removeFloatingObjectInternal(i._floatingObjectExtent.names[u]),f.isSelected(!1));r._loadAndSetSheetSelections();r.isPaintSuspended(e);s=i._resumeInvalidate(t);s||i.refreshUI(t)}},i.prototype.undo=function(t){var i=this,r,e,u,o,f,s;if(n.features.floatingObject&&i._savedFloatingObjects&&i._savedFloatingObjects.length>0){for(r=i._sheet,i._suspendInvalidate(t),e=r.isPaintSuspended(),r.isPaintSuspended(!0),u=0,o=i._savedFloatingObjects.length;u<o;u++)f=i._savedFloatingObjects[u],f.isSelected(!0),r._addFloatingOjectInternal(f);return r._saveAndClearSheetSelections(),i._savedFloatingObjects.length=0,r.isPaintSuspended(e),s=i._resumeInvalidate(t),s||i.refreshUI(t),!0}return!1},i}(v);t.DeleteFloatingObjectUndoAction=ni;ti=function(t){function i(n,i,r){t.call(this);this.init(n,i);this._movingSettings=r}return __extends(i,t),i.prototype.execute=function(t){var i=this,r,o,u,s,f,e,h;if(n.features.floatingObject&&i._floatingObjectExtent&&i._floatingObjectExtent.names instanceof Array){for(i.saveState(),r=i._sheet,i._suspendInvalidate(t),o=r.isPaintSuspended(),r.isPaintSuspended(!0),u=0,s=i._floatingObjectExtent.names.length;u<s;u++)f=r._findFloatingObjectInternal(i._floatingObjectExtent.names[u]),e=f.position(),f.position(new n.Point(e.x+i._movingSettings.offsetX,e.y+i._movingSettings.offsetY));r.isPaintSuspended(o);h=i._resumeInvalidate(t);h||i.refreshUI(t)}},i.prototype.undo=function(t){var i=this,r,o,u,s,f,e,h;if(n.features.floatingObject&&i._savedFloatingObjects&&i._savedFloatingObjects.length>0){for(r=i._sheet,i._suspendInvalidate(t),o=r.isPaintSuspended(),r.isPaintSuspended(!0),u=0,s=i._savedFloatingObjects.length;u<s;u++)f=i._savedFloatingObjects[u],e=f.position(),f.position(new n.Point(e.x-i._movingSettings.offsetX,e.y-i._movingSettings.offsetY));return i._savedFloatingObjects.length=0,r.isPaintSuspended(o),h=i._resumeInvalidate(t),h||i.refreshUI(t),!0}return!1},i}(v);t.MovingFloatingObjectUndoAction=ti;ii=function(t){function i(n,i,r){t.call(this);this.init(n,i);this._resizingSettings=r}return __extends(i,t),i.prototype.execute=function(t){var i=this,u,o,f,s,r,e,h;if(n.features.floatingObject&&i._floatingObjectExtent&&i._floatingObjectExtent.names instanceof Array){for(i.saveState(),u=i._sheet,i._suspendInvalidate(t),o=u.isPaintSuspended(),u.isPaintSuspended(!0),f=0,s=i._floatingObjectExtent.names.length;f<s;f++)r=u._findFloatingObjectInternal(i._floatingObjectExtent.names[f]),e=r.position(),r.width(r.width()+i._resizingSettings.offsetWidth),r.height(r.height()+i._resizingSettings.offsetHeight),r.position(new n.Point(e.x+i._resizingSettings.offsetX,e.y+i._resizingSettings.offsetY));u.isPaintSuspended(o);h=i._resumeInvalidate(t);h||i.refreshUI(t)}},i.prototype.undo=function(t){var i=this,u,o,f,s,r,e,h;if(n.features.floatingObject&&i._savedFloatingObjects&&i._savedFloatingObjects.length>0){for(u=i._sheet,i._suspendInvalidate(t),o=u.isPaintSuspended(),u.isPaintSuspended(!0),f=0,s=i._savedFloatingObjects.length;f<s;f++)r=i._savedFloatingObjects[f],e=r.position(),r.position(new n.Point(e.x-i._resizingSettings.offsetX,e.y-i._resizingSettings.offsetY)),r.width(r.width()-i._resizingSettings.offsetWidth),r.height(r.height()-i._resizingSettings.offsetHeight);return i._savedFloatingObjects.length=0,u.isPaintSuspended(o),h=i._resumeInvalidate(t),h||i.refreshUI(t),!0}return!1},i}(v);t.ResizingFloatingObjectUndoAction=ii;var ri=15,a=9007199254740992,si=function(t){function r(n,r,u){t.call(this);this._sheet=i;this._fromSheet=i;this._floatingObjectExtent=i;this._savedObjects=i;var f=this;f._sheet=n;f._fromSheet=u;f._floatingObjectExtent=r;f._savedObjects=[];f._activeRowIndex=f._sheet.getActiveRowIndex();f._activeColumnIndex=f._sheet.getActiveColumnIndex()}return __extends(r,t),r.prototype.execute=function(t){var r=this,f,l,it,nt,v,y,c,e,b,k,tt,h,ft;if(n.features.floatingObject&&r._floatingObjectExtent&&r._floatingObjectExtent.names&&r._floatingObjectExtent.names.length>0){f=r._sheet;l=r._fromSheet._eventHandler;r._suspendInvalidate(t);it=f.isPaintSuspended();f.isPaintSuspended(!0);for(var o=r._floatingObjectExtent.names,rt=[],d=a,g=a,i=0,u=o.length;i<u;i++)e=l._getClipboardFloatingObjectData().findByPropertyName(o[i]).position(),d=s(d,e.x),g=s(g,e.y);for(nt=[],i=0,u=o.length;i<u;i++)e=l._getClipboardFloatingObjectData().findByPropertyName(o[i]).position(),nt.push(new n.Point(e.x-d,e.y-g));if(v=0,y=0,f._hasFloatingObjectsSelected()){var p=a,w=a,ut=f._floatingObjectArray;for(i=0,u=ut.length;i<u;i++)c=ut[i],c&&c.isSelected()&&(e=c.position(),p=s(p,e.x),w=s(w,e.y),c.isSelected(!1));v=p<a?p+ri:0;y=w<a?w+ri:0}else{for(b=0;b<r._activeRowIndex;b++)y+=f._getActualRowHeight(b,3);for(k=0;k<r._activeColumnIndex;k++)v+=f._getActualColumnWidth(k,3)}for(i=0,u=o.length;i<u;i++)tt=nt[i],rt.push(new n.Point(v+tt.x,y+tt.y));for(i=0,u=o.length;i<u;i++)h=l._getClipboardFloatingObjectData().findByPropertyName(o[i]).clone(),h.isVisible(!0),h.name(r._generateFloatingObjectName()),h.position(rt[i]),h.isSelected(!0),f._addFloatingOjectInternal(h),r._savedObjects.push(h);f.isPaintSuspended(it);ft=r._resumeInvalidate(t);ft||r.refreshUI(t)}},r.prototype.refreshUI=function(n){var t=this._sheet;t&&(t.invalidateLayout(),t.repaint())},r.prototype.canExecute=function(n){var t=this;return!t._sheet.isProtected&&t._floatingObjectExtent&&t._floatingObjectExtent.names&&t._floatingObjectExtent.names.length>0?!0:!1},r.prototype.canUndo=function(){return this._savedObjects&&this._savedObjects.length>0?!0:!1},r.prototype.undo=function(t){var i=this,r,f,u,e,o,s;if(n.features.floatingObject&&i._savedObjects&&i._savedObjects.length>0){for(r=i._sheet,i._suspendInvalidate(t),f=r.isPaintSuspended(),r.isPaintSuspended(!0),u=0,e=i._savedObjects.length;u<e;u++)o=i._savedObjects[u],r._removeFloatingObjectInternal(o.name());return i._savedObjects.length=0,r.isPaintSuspended(f),s=i._resumeInvalidate(t),s||i.refreshUI(t),!0}return!1},r.prototype._generateFloatingObjectName=function(){for(var r="FloatingObject",n=this._sheet._floatingObjectArray.length+1,t=r+n;this._sheet._findFloatingObjectInternal(t)!==i;)n++,t=r+n;return t},r}(u);t.ClipboardPasteFloatingObjectUndoAction=si;ui=function(t){function r(n,r,u){t.call(this);this._sheet=i;this._floatingObjectExtent=i;this._savedObjects=i;this._movingInfo=i;var f=this;f._sheet=n;f._floatingObjectExtent=r;f._savedObjects=[];f._movingInfo=u}return __extends(r,t),r.prototype.execute=function(t){var i=this,r,s,e,h,f,u,o,c;if(n.features.floatingObject&&i._floatingObjectExtent&&i._floatingObjectExtent.names&&i._floatingObjectExtent.names.length>0&&i._movingInfo){for(r=i._sheet,i._suspendInvalidate(t),s=r.isPaintSuspended(),r.isPaintSuspended(!0),e=0,h=i._floatingObjectExtent.names.length;e<h;e++)f=r._findFloatingObjectInternal(i._floatingObjectExtent.names[e]),f&&(u=f.clone(),o=f.position(),u.position(new n.Point(o.x+i._movingInfo.offsetX,o.y+i._movingInfo.offsetY)),u.name(i._generateFloatingObjectName()),u.isSelected(!0),f.isSelected(!1),r._addFloatingOjectInternal(u),i._savedObjects.push(u.name()));r.isPaintSuspended(s);c=i._resumeInvalidate(t);c||i.refreshUI(t)}},r.prototype.refreshUI=function(n){var t=this._sheet;t&&(t.invalidateLayout(),t.repaint())},r.prototype.canExecute=function(n){var t=this;return!t._sheet.isProtected&&t._floatingObjectExtent&&t._floatingObjectExtent.names&&t._floatingObjectExtent.names.length>0?!0:!1},r.prototype.canUndo=function(){return this._savedObjects&&this._savedObjects.length>0?!0:!1},r.prototype.undo=function(t){var i=this,r,f,u,e,o;if(n.features.floatingObject&&i._savedObjects&&i._savedObjects.length>0){for(r=i._sheet,i._suspendInvalidate(t),f=r.isPaintSuspended(),r.isPaintSuspended(!0),u=0,e=i._savedObjects.length;u<e;u++)r._removeFloatingObjectInternal(i._savedObjects[u]);return i._savedObjects.length=0,r.isPaintSuspended(f),o=i._resumeInvalidate(t),o||i.refreshUI(t),!0}return!1},r.prototype._generateFloatingObjectName=function(){for(var r="FloatingObject",n=this._sheet._floatingObjectArray.length+1,t=r+n;this._sheet._findFloatingObjectInternal(t)!==i;)n++,t=r+n;return t},r}(u);t.DragCopyFloatingObjectUndoAction=ui;w=function(n){function t(){n.call(this)}return __extends(t,n),t.prototype.init=function(n,t){this._sheet=n;this._comment=t},t.prototype.refreshUI=function(n){var t=this._sheet;t&&(t.invalidateLayout(),t.repaint())},t.prototype.canExecute=function(n){return!0},t.prototype.canUndo=function(){return this._savedComment?!0:!1},t.prototype.saveState=function(){this._savedComment=this._comment},t}(u);t.CommentUndoActionBase=w;fi=function(n){function t(t,i){n.call(this);this.init(t,i)}return __extends(t,n),t.prototype.execute=function(n){var t=this,r,u,f;t.saveState();r=t._sheet;t._suspendInvalidate(n);u=r.isPaintSuspended();r.isPaintSuspended(!0);r.setComment(t._comment._rowIndex,t._comment._colIndex,i);r._loadAndSetSheetSelections();r.isPaintSuspended(u);f=t._resumeInvalidate(n);f||t.refreshUI(n)},t.prototype.undo=function(n){var t=this,i,r,u;return t._savedComment?(i=t._sheet,t._suspendInvalidate(n),r=i.isPaintSuspended(),i.isPaintSuspended(!0),i.setComment(t._savedComment._rowIndex,t._savedComment._colIndex,t._savedComment),i._saveAndClearSheetSelections(),i.isPaintSuspended(r),u=t._resumeInvalidate(n),u||t.refreshUI(n),!0):!1},t}(w);t.CommentDeleteUndoAction=fi;ei=function(n){function t(t,i,r,u,f){n.call(this);var e=this;e.init(t,i);e._oldValue=r;e._newValue=u;e._propertyName=f}return __extends(t,n),t.prototype.execute=function(n){var t=this,i,r,u;t._comment&&(t.saveState(),i=t._sheet,t._suspendInvalidate(n),r=i.isPaintSuspended(),i.isPaintSuspended(!0),t._comment._changeProperty(t._propertyName,t._newValue),i.isPaintSuspended(r),u=t._resumeInvalidate(n),u||t.refreshUI(n))},t.prototype.undo=function(n){var t=this,i,r,u;return t._savedComment?(i=t._sheet,t._suspendInvalidate(n),r=i.isPaintSuspended(),i.isPaintSuspended(!0),t._comment._changeProperty(t._propertyName,t._oldValue),i.isPaintSuspended(r),u=t._resumeInvalidate(n),u||t.refreshUI(n),!0):!1},t}(w);t.CommentPropertyUndoAction=ei;oi=function(n){function t(){n.call(this);this._commentUndoTransaction=[]}return __extends(t,n),t.prototype.execute=function(n){var t=this,i,r;if(t._commentUndoTransaction&&t._commentUndoTransaction.length>0)for(i=0;i<t._commentUndoTransaction.length;i++)r=t._commentUndoTransaction[i],r&&r.execute(n)},t.prototype.undo=function(n){var t=this,i,r;if(t._commentUndoTransaction&&t._commentUndoTransaction.length>0){for(i=0;i<t._commentUndoTransaction.length;i++)r=t._commentUndoTransaction[i],r&&r.undo(n);return!0}return!1},t.prototype.add=function(n){this._commentUndoTransaction.push(n)},t}(u);t.CommentUndoTransaction=oi})(n.UndoRedo||(n.UndoRedo={}));var t=n.UndoRedo})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(t){var vt;t.feature("core.sheet_event",["core.migrate","core.common","core.sheet_action","core.stringResource"]);var i=null,e=undefined,u=Math.max,f=Math.min,o=Math.abs,et=Math.ceil,b="undefined",s="position",h="absolute",v="border",ot="border-radius",it="padding",rt="box-shadow",d="font",g="background-color",y="overflow",c="top",l="left",ut="z-index",st="outline",nt="width",tt="height",ht="resize",k="hidden",ct="visible",p="auto",ft="white",a="none",lt="size",w="gcUIElement",r=window.document,at=function(){function at(n){this.RESIZETOOLTIP_TOP=30;this.DRAGDROPTOOLTIP_OFFSET=5;this.DRAGFILLTOOLTIP_OFFSET=3;this.VSCROLLTOOLTIP_LEFT=100;this.HSCROLLTOOLTIP_LEFT=30;this.HSCROLLTOOLTIP_TOP=40;this._clipboardFloatingObjectData=i;this._repeatKeyDownTimeoutID=0;this.waittime=100;this.newLeft=0;this.newTop=0;this._focusReleased=!1;this._init(n)}return at.prototype._init=function(n){this._sheet=n;this._elem=i;this._eventSuspended=0},at.prototype._getElem=function(){return this._elem||(this._elem=r.createElement("input")),this._elem},at.prototype._dispose=function(){var n=this;n._hScrollTimer&&n._hScrollTimer._dispose();n._vScrollTimer&&n._vScrollTimer._dispose()},at.prototype._getHScrollTimer=function(){var n=this;return n._hScrollTimer||(n._hScrollTimer=new t.Timer(n)),n._hScrollTimer},at.prototype._getVScrollTimer=function(){var n=this;return n._vScrollTimer||(n._vScrollTimer=new t.Timer(n)),n._vScrollTimer},at.prototype.doResize=function(){var t=this._sheet,n=t._getCanvas(),r,f,h,c;if(n&&n.parentNode){var s=getComputedStyle(n.parentNode),e=s.width,o=s.height,i=e.indexOf("px");(i>0&&(e=e.substring(0,i)),i=o.indexOf("px"),i>0&&(o=o.substring(0,i)),r=parseInt(e),f=parseInt(o),isNaN(r)&&(r=$(n.parentNode).width()),isNaN(f)&&(f=$(n.parentNode).height()),r!==0&&f!==0)&&(h=0,c=0,n.style.display=a,n.width=u(r-h,0),n.height=u(f-c,0),n.style.display="",t._bounds.width=n.clientWidth||n.width,t._bounds.height=n.clientHeight||n.height,t._paintSuspended||(t.invalidateLayout(),t.repaint()))}},at.prototype._getCanvasOffset=function(){var t=this._sheet,n=$(t._getCanvas()).offset();return n?(isNaN(r.body.clientTop)||(n.top+=r.body.clientTop),isNaN(r.body.clientLeft)||(n.left+=r.body.clientLeft)):n={top:0,left:0},window.gcGlobal.canvasOffset&&(n=window.gcGlobal.canvasOffset),n},at.prototype.doMouseDown=function(n){var t,i,r,u;return n.button===2?!0:(t=this,i=t._sheet,i.inCanvas||t.handleDocumentMouseMove(),r=t._getCanvasOffset(),u=t.doMouseDownImp(n,n.pageX-r.left,n.pageY-r.top),i.isEditing()||u||t.setFocus(),i._isMouseDownInSheet=!0,!1)},at.prototype.handleDocumentMouseMove=function(){var n=this;n._isMouseCapture||($(r).bind("mousemove.gcSheet",function(t){n.doMouseMove(t)}).bind("mouseup.gcSheet",function(t){n.doMouseUp(t)}),n._isMouseCapture=!0)},at.prototype.unhandleDocumentMouseMove=function(){this._isMouseCapture&&(this._isMouseCapture=!1,$(r).unbind("mousemove.gcSheet").unbind("mouseup.gcSheet"))},at.prototype.doMouseDownImp=function(n,r,u){var s=this,f=s._sheet,o=f.hitTest(r,u),h=o.row,c=o.col,tt=o.groupHitInfo,v=o.dragInfo,it=o.filterButtonHitInfo,l=o.formulaRangeHitInfo,a=o.cellTypeHitInfo,k,d,p,w,rt,b,ft,g,nt;if(typeof f.unSelectAllFloatingObjects=="function"&&f.unSelectAllFloatingObjects(),k=f._commentManager,k&&k.deactivateComment(),tt)f.isEditing()||s._doClickRangeGroup(tt);else if(f._currentTarget=o,s.isMouseDown=!0,o.resizeInfo){if(!f.endEdit())return;s.startResizing(o)}else if(v&&v.side&&v.side!=="corner"){if(!f.endEdit())return;s.startDragDropping(o)}else if(v&&v.side==="corner"){if(!f.endEdit())return;s.startDragFill(o)}else if(it){if(!f.endEdit())return;s._openFilterDialog(it)}else if(l)l.inBorder?s.startFormulaRangeMoving(o):(l.inTopLeft||l.inTopRight||l.inBottomLeft||l.inBottomRight)&&s.startFormulaRangeResizing(o);else{if(d=f._formulaTextBox,d&&d.canAppendRange()){s.startFormulaRangeAppending(o);return}if(p=f.getActiveRowIndex(),w=f.getActiveColumnIndex(),a){if(h!==p||c!==w){rt=f.isPaintSuspended();f.isPaintSuspended(!0);try{if(!f.endEdit())return;if(b={sheet:f,sheetName:f._name,row:p,col:w,cancel:!1},f._trigger(t.Events.LeaveCell,b),b&&b.cancel===!0)return;var et=f._selectionModel.toArray(),ut=i,y=f._spanModel.find(h,c);ut=y?[new t.Range(y.row,y.col,y.rowCount,y.colCount)]:[new t.Range(h,c,1,1)];f._trigger(t.Events.SelectionChanging,{sheet:f,sheetName:f._name,oldSelections:et,newSelections:ut});f.setActiveCell(h,c);f._trigger(t.Events.EnterCell,{sheet:f,sheetName:f._name,row:h,col:c});f._trigger(t.Events.SelectionChanged,{sheet:f,sheetName:f._name});s._updateValidationUI(h,c)}finally{f.isPaintSuspended(rt)}}ft=f.getCellType(h,c,o.hitTestType);a.sheet||(a.sheet=f);ft.processMouseDown(a)}if(a&&a.isReservedLocation)return!0;else{s.setMetaKeyState(n);try{if(s._hitTestResult=o,f.isEditing()&&p===f.getActiveRowIndex()&&w===f.getActiveColumnIndex()&&!f.endEdit())return}finally{s._hitTestResult=i}if(h===e||h===i||c===e||c===i)return;o.hitTestType===3&&s._updateValidationUI(h,c);g=f._selectionModel.toArray();s.startSelecting(o);nt=f._selectionModel.toArray();s._notEqualSelecions(g,nt)&&f._trigger(t.Events.SelectionChanging,{sheet:f,sheetName:f._name,oldSelections:g,newSelections:nt})}}},at.prototype._openFilterDialog=function(n){if(n&&t.features.filter_ui){var i=new t._GcFilterDialog(this._sheet,n);this._sheet._filterDialiog=i;i.open()}},at.prototype._doClickRangeGroup=function(n){var i=this._sheet,r,e,u,o,f,s,h,c;i&&n&&t.features.group&&(r=n.info,n.what==="rgh"?i&&!i.isEditing()&&(e=r.index,u={sheet:i,sheetName:i._name,isRowGroup:!0,index:-1,level:e,cancel:!1},i._trigger(t.Events.RangeGroupStateChanging,u),u&&u.cancel===!1&&(o=new t.UndoRedo.RowGroupHeaderExpandUndoAction(i,{level:e}),i._doCommand(o),i._trigger(t.Events.RangeGroupStateChanged,{sheet:i,sheetName:i._name,isRowGroup:!0,index:-1,level:e}))):n.what==="cgh"?i.isEditing()||(e=r.index,u={sheet:i,sheetName:i._name,isRowGroup:!1,index:-1,level:e,cancel:!1},i._trigger(t.Events.RangeGroupStateChanging,u),u&&u.cancel===!1&&(o=new t.UndoRedo.ColumnGroupHeaderExpandUndoAction(i,{level:e}),i._doCommand(o),i._trigger(t.Events.RangeGroupStateChanged,{sheet:i,sheetName:i._name,isRowGroup:!1,index:-1,level:e}))):n.what==="rg"?i.rowRangeGroup&&(f=r.index,s=r.isExpanded,r.lineDirection===1?f--:f++,u={sheet:i,sheetName:i._name,isRowGroup:!0,index:f,level:r.level,cancel:!1},i._trigger(t.Events.RangeGroupStateChanging,u),u&&u.cancel===!1&&(h=new t.UndoRedo.RowGroupExpandUndoAction(i,{index:r.index,level:r.level,collapsed:s}),i._doCommand(h),i._trigger(t.Events.RangeGroupStateChanged,{sheet:i,sheetName:i._name,isRowGroup:!0,index:f,level:r.level}))):n.what==="cg"&&i.colRangeGroup&&(f=r.index,s=r.isExpanded,r.lineDirection===1?f--:f++,u={sheet:i,sheetName:i._name,isRowGroup:!1,index:f,level:r.level,cancel:!1},i._trigger(t.Events.RangeGroupStateChanging,u),u&&u.cancel===!1&&(c=new t.UndoRedo.ColumnGroupExpandUndoAction(i,{index:r.index,level:r.level,collapsed:s}),i._doCommand(c),i._trigger(t.Events.RangeGroupStateChanged,{sheet:i,sheetName:i._name,isRowGroup:!1,index:f,level:r.level}))))},at.prototype._isInvalidRect=function(n){var r=this._sheet,t;return r?(t=r._getSheetLayout(),n.x===i||n.x===e||n.y===i||n.y===e||n.width===i||n.width===e||n.height===i||n.height===e||n.x+n.width>t.viewportX+t.viewportWidth+t.frozenTrailingWidth||n.y+n.height>t.viewportY+t.viewportHeight+t.frozenTrailingHeight):!0},at.prototype._commitSelectValue=function(n,i,r){for(var o,s,h,l,a,u=this._sheet,f,e=0,c=n.options,v=c.length;e<v;e++)if(o=c[e],o.selected){f=o.value;break}s=!1;u.isProtected&&(h=u.getActualStyle(i,r),h&&(s=h.locked));f&&!s&&(l={row:i,col:r,newValue:f,autoFormat:!0},a=new t.UndoRedo.CellEditUndoAction(u,l),u._doCommand(a));$(n).hide()},at.prototype._updateValidationUI=function(n,o){var ht=this,y=ht._sheet,hi=y&&y.parent,kt,k,tt,b,dt,gt,vt,nt,yt,ii,ui,ct,bt,fi,ei,oi,si,vi,at;if(hi&&t.features.dataValidator&&(y._disposeValidationUI(),kt=hi.getActiveSheet(),kt&&y.getName()===kt.getName())&&(k=y.getDataValidator(n,o),k)&&(tt=ht._getCanvasOffset(),b=y.getCellRect(n,o),!ht._isInvalidRect(b))&&(dt=1e3,k&&k.showInputMessage&&k.inputMessage&&(gt=r.createElement("span"),$(gt).css(s,h).css(v,"1px #C0C0C0 solid").css(it,"3px 8px 3px 8px").css(g,"#FFFFFF").css(rt,"1px 2px 5px rgba(0,0,0,0.4)").css(d,"normal normal normal 12px/normal Arial").width(p).height(p).css(c,b.y+b.height+tt.top+5).css(l,b.x+b.width/2+tt.left).css(ut,dt).html("<b>"+k.inputTitle+"<\/b><br/>"+k.inputMessage).attr(w,"gcValidationInputMessage").appendTo(r.body),y._validationInputMessage=gt),k&&k.type===3&&k.inCellDropdown)){var ci=k.condition.getValidList(y,n,o),pt=ci.length,ot=r.createElement("select"),yi=y.getValue(n,o),wt=-1,li="";for(vt=0;vt<pt;vt++)nt=ci[vt],wt<0&&nt===yi&&(wt=vt),nt===i||nt===e?nt="":nt instanceof Date&&(nt=new t._DateTimeHelper(nt).localeFormat("M/d/yyyy h:mm:ss")),li+='<option value="'+nt+'">'+nt+"<\/option>";ot.innerHTML=li;ot.selectedIndex=wt>0?wt:0;var ni=y.getActualStyle(n,o),ai=y._render,ti=ni&&ni.font?ni.font:ai._getDefaultFont();y._zoomFactor>1&&(ti=ai._getZoomFont(ti));yt=y.getSpans(new t.Range(n,o,1,1));ii=1;yt&&yt.length>0&&yt[0]&&(ii=yt[0].colCount);var ri=o+ii-1==y.getColumnCount()-1,et=y.getRowHeight(n)*y._zoomFactor,pi=y.parent&&y.parent.useTouchLayout();et=pi?f(50,et):f(15,et);ui=t.util.device();ct=$.browser.safari&&(ui.ipad||ui.iphone);ct?(bt=b.width+3,fi=b.height+3,ei=b.y+tt.top-1.5,oi=b.x+tt.left-1.5,si=ft):(bt=u(b.width+(ri?0:et),y.defaults.colWidth),fi=pt>8?140:p,ei=b.y+b.height+tt.top,oi=b.x+b.width+tt.left+(ri?0:et)-bt,si="");vi=$(ot).css(st,a).css(s,h).css(d,ti).css(ut,dt).css(g,si).width(bt).height(fi).css(c,ei).css(l,oi).attr(w,"gcValidationSelect").appendTo(r.body).attr(lt,pt>2?pt:2).hide().bind("click",function(){ht._commitSelectValue(ot,n,o);ct&&$(y._validationButton).show()}).bind("keydown",function(t){t.keyCode!==13||t.ctrlKey||t.shiftKey||t.altKey?t.keyCode!==27||t.ctrlKey||t.shiftKey||t.altKey||$(ot).hide():ht._commitSelectValue(ot,n,o);ct&&$(y._validationButton).show()});ct&&vi.bind("blur",function(t){ht._commitSelectValue(ot,n,o);$(y._validationButton).show()});y._validationSelect=ot;at=r.createElement("input");at.type="image";at.src=t.DefaultDataValidator.getImageSrc();at.alt="v";$(at).css(s,h).width(et).height(et).css(c,b.y+b.height+tt.top-(et+3)).css(l,b.x+b.width+tt.left-(ri?et:0)).css(g,ft).css(v,"1px solid gray").attr(w,"gcValidationButton").appendTo(r.body).click(function(){y.isEditing()&&y.endEdit();$(y._validationSelect).toggle().focus();ct&&$(y._validationButton).toggle()});y._validationButton=at}},at.prototype.startScroll=function(){var n=this,t;n.startHitInfo&&(t=n.startHitInfo.hitTestType,(t===3||t===2)&&n._getVScrollTimer().setAction(n.processVSScrolled),(t===3||t===1)&&n._getHScrollTimer().setAction(n.processHSScrolled))},at.prototype.processVSScrolled=function(n){var t=this,s=t.adjustScrollRowViewport(),r,e,o;if(!s){var h=t.startHitInfo,i=t._sheet,f=h.scrollRowViewportIndex,u=i.getViewportTopRow(f),c=i.getViewportBottomRow(f);n?c<i.getRowCount()-i._frozenTrailingRowCount-1?i._setTopRow(i._getNextVisualRow(u)):(r=i._getRowLayout(f),r&&r.length>0&&(e=i._getSheetLayout(),o=r[r.length-1],o.y+o.height>=e.viewportY+e.viewportHeight&&i._setTopRow(i._getNextVisualRow(u)))):u>i.frozenRowCount&&i._setTopRow(i._getPrevVisualRow(u))}t.isSelecting&&t.continueSelecting();t.isDragDropping&&t.continueDragDropping();t.isDraggingFill&&t.continueDragFill();t.isFormulaRangeAppending&&t.continueFormulaRangeAppending();t.isFormulaRangeMoving&&t.continueFormulaRangeMoving();t.isFormulaRangeResizing&&t.continueFormulaRangeResizing()},at.prototype.processHSScrolled=function(n){var t=this,s=t.adjustScrollColViewport(),r,e,o;if(!s){var i=t._sheet,h=t.startHitInfo,f=h.scrollColViewportIndex,u=i.getViewportLeftColumn(f),c=i.getViewportRightColumn(f);n?c<i.getColumnCount()-i._frozenTrailingColCount-1?i._setLeftColumn(i._getNextVisualColumn(u)):(r=i._getColumnLayout(f),r&&r.length>0&&(e=i._getSheetLayout(),o=r[r.length-1],o.x+o.width>=e.viewportX+e.viewportWidth&&i._setLeftColumn(i._getNextVisualColumn(u)))):u>i.frozenColCount&&i._setLeftColumn(i._getPrevVisualColumn(u))}t.isSelecting&&t.continueSelecting();t.isDragDropping&&t.continueDragDropping();t.isDraggingFill&&t.continueDragFill();t.isFormulaRangeAppending&&t.continueFormulaRangeAppending();t.isFormulaRangeMoving&&t.continueFormulaRangeMoving();t.isFormulaRangeResizing&&t.continueFormulaRangeResizing()},at.prototype.adjustScrollRowViewport=function(){var n=this._sheet,r=n._getSheetLayout(),o=this.mousePosition,u=this.startHitInfo,h=u.scrollRowViewportIndex,t,i,e;if(h===0){if(o.y>r.viewportY)return n._setTopRow(n._getFirstPageTopRow()),u.scrollRowViewportIndex=1,!0}else if(h===1){if(t=n._getRowLayout(1),t&&t.length>0){if(i=t[0],n.frozenRowCount>0&&o.y<r.viewportY&&i.row<=n._getFirstPageTopRow())return u.scrollRowViewportIndex=0,!0;if(i=t[t.length-1],n._frozenTrailingRowCount>0&&o.y>r.frozenTrailingY&&i.row>=n._getLastVisualRow()&&i.y+i.height<=r.frozenTrailingY)return u.scrollRowViewportIndex=2,!0}}else if(h===2&&(t=n._getRowLayout(1),t&&t.length>0&&o.y<r.frozenTrailingY)){if(i=t[t.length-1],i.y+i.height>r.frozenTrailingY){var l=r.viewportHeight,s=n.getRowCount()-n._frozenTrailingRowCount-1,c=0;for(e=s;e>=n.frozenRowCount;e--)if(c+=n._getZoomRowHeight(e),c>l){s=f(e+1,s);break}n._setTopRow(n._getNextVisualRow(s-1))}return u.scrollRowViewportIndex=1,!0}return!1},at.prototype.adjustScrollColViewport=function(){var n=this._sheet,r=n._getSheetLayout(),o=this.mousePosition,u=this.startHitInfo,h=u.scrollColViewportIndex,t,i,e;if(h===0){if(o.x>r.viewportX)return n._setLeftColumn(n._getFirstPageLeftColumn()),u.scrollColViewportIndex=1,!0}else if(h===1){if(t=n._getColumnLayout(1),t&&t.length>0){if(i=t[0],n.frozenColCount>0&&o.x<r.viewportX&&i.col<=n._getFirstPageLeftColumn())return u.scrollColViewportIndex=0,!0;if(i=t[t.length-1],n._frozenTrailingColCount>0&&o.x>r.frozenTrailingX&&i.col>=n._getLastVisualColumn()&&i.x+i.width<=r.frozenTrailingX)return u.scrollColViewportIndex=2,!0}}else if(h===2&&(t=n._getColumnLayout(1),t&&t.length>0&&o.x<r.frozenTrailingX)){if(i=t[t.length-1],i.x+i.width>r.frozenTrailingX){var l=r.viewportWidth,s=n.getColumnCount()-n._frozenTrailingColCount-1,c=0;for(e=s;e>=n.frozenColCount;e--)if(c+=n._getZoomColumnWidth(e),c>l){s=f(e+1,s);break}n._setLeftColumn(n._getNextVisualColumn(s-1))}return u.scrollColViewportIndex=1,!0}return!1},at.prototype.continueScroll=function(){var t=this,e,o;if(t.isWorking||t.isFloatingObjectWorking||t.isCommentWorking){var c=t._sheet,s=c._getSheetLayout(),h=t.startHitInfo,u=h.scrollRowViewportIndex,f=h.scrollColViewportIndex,r=t.mousePosition,n=i;u>=0&&f>=0?n=s.viewportRect(u,f):u>=0?n=s.rowHeaderRect(u):f>=0&&(n=s.colHeaderRect(f));n&&(e=0,o=0,r.x<=n.x?e=r.x-n.x:r.x>=n.x+n.width&&(e=r.x-(n.x+n.width)),r.y<=n.y?o=r.y-n.y:r.y>=n.y+n.height&&(o=r.y-(n.y+n.height)),t._getHScrollTimer().setInterval(t.getIntervalFromDistance(e)),t._getVScrollTimer().setInterval(t.getIntervalFromDistance(o)))}},at.prototype.stopScroll=function(){this._getHScrollTimer().stop();this._getVScrollTimer().stop()},at.prototype.startResizing=function(n){var i=this,u=i._sheet,a=u._getSheetLayout(),t=n.resizeInfo,s,f,h,e,o;t.action==="sizeRow"?(s=u._getAllRowLayout(t.sheetArea),t.index=i._getPrevVisualRowBeforeFindRow(t.index,t.sheetArea),f=s.findRow(t.index),f||(f=s.findRow(n.row)),t.startY=f.y):(h=u._getAllColumnLayout(t.sheetArea),t.index=i._getPrevVisualColBeforeFindCol(t.index,t.sheetArea),e=h.findCol(t.index),e||(e=h.findCol(n.col)),t.startX=e.x);var c=u.parent,l=n.x,r=n.y;c&&(o=c.showResizeTip(),(o===1&&t.action==="sizeCol"||o===2&&t.action==="sizeRow"||o===3)&&(r=r-i.RESIZETOOLTIP_TOP<0?r+i.RESIZETOOLTIP_TOP/2:r-i.RESIZETOOLTIP_TOP,i._showTooltip(i._getMouseDownResizeTooltipContent(),l,r)));i.isResizing=!0;i.isWorking=!0},at.prototype.continueResizing=function(){var i=this,u=i._sheet,o=u._currentTarget,n=o.resizeInfo,h=i.mousePosition,c=h.x,l=h.y,t=u._getSheetLayout(),r,v,f,a,s,e;n&&i.isWorking&&i.isResizing&&(o.x!==c||o.y!==l)&&(n.action==="sizeRow"?(n.movingY=l,n.movingY<n.startY&&(n.movingY=n.startY),r=t.y+t.height,n.movingY>r&&(n.movingY=r)):(n.movingX=c,n.movingX<n.startX&&(n.movingX=n.startX),r=t.x+t.width,n.movingX>r&&(n.movingX=r)),f=u._render,a=f._getCtx(),f.copyDoubleBuffer(t.x,t.y,t.width,t.height),f.paintAdornment(a),s=u.parent,s&&(e=s.showResizeTip(),(e===1&&n.action==="sizeCol"||e===2&&n.action==="sizeRow"||e===3)&&i._refreshTooltip(i._getMouseMoveResizeTooltipContent(n))))},at.prototype.stopResizing=function(){var s=this,l,v,a,y;s.isResizing=!1;s.isWorking=!1;var r=s._sheet,p=r._currentTarget,n=p.resizeInfo,h,o,f,c;if(n)if(s._removeTooltip(),n.action==="sizeRow"){if(n.movingY!==e&&n.movingY!==i){if(h=u(0,(n.movingY-n.startY)/r._zoomFactor),l=[],r._isRowSelected(n.index))for(o=0;o<r._selectionModel.length;o++)f=r._selectionModel[o],f.col===-1&&(f=r._getActualRange(f),l.push({firstRow:f.row,lastRow:f.row+f.rowCount-1}));else l.push({firstRow:n.index,lastRow:n.index});v=n.sheetArea===1;c=new t.UndoRedo.RowResizeUndoAction(r,l,h,v);r._doCommand(c)}}else if(n.movingX!==e&&n.movingX!==i){if(h=u(0,(n.movingX-n.startX)/r._zoomFactor),a=[],r._isColumnSelected(n.index))for(o=0;o<r._selectionModel.length;o++)f=r._selectionModel[o],f.row===-1&&(f=r._getActualRange(f),a.push({firstCol:f.col,lastCol:f.col+f.colCount-1}));else a.push({firstCol:n.index,lastCol:n.index});y=n.sheetArea===2;c=new t.UndoRedo.ColumnResizeUndoAction(r,a,h,y);r._doCommand(c)}},at.prototype._startSelectingCore=function(n,i){var y=0,p=0,w=0,b=0,u=this,r=u._sheet,h,e,s,a,v,k,c,l;if(u._lastSelections=r._selectionModel.toArray(),u.ctrl||u.shift||r._clearSelectionImp(),n.hitTestType===0){if(!u.shift){if(h=r.frozenRowCount?r._getFirstVisualRow():r._scrollTopRow,v=r.frozenColCount?r._getFirstVisualColumn():r._scrollLeftCol,e={sheet:r,sheetName:r._name,row:r._activeRowIndex,col:r._activeColIndex,cancel:!1},r._trigger(t.Events.LeaveCell,e),e&&e.cancel===!0)return;r._setActiveCellImp(h,v,1,1,i);r._trigger(t.Events.EnterCell,{sheet:r,sheetName:r._name,row:h,col:v});u._updateValidationUI(h,v)}u.ctrl||r._clearSelectionImp();r._setSelectedRange(-1,-1,r.getRowCount(),r.getColumnCount(),!0)}else if(n.hitTestType===1){if(!u.shift){if(h=r.frozenRowCount?r._getFirstVisualRow():r._scrollTopRow,s=r._getAvailableActiveCell(h,n.col,!1),e={sheet:r,sheetName:r._name,row:r._activeRowIndex,col:r._activeColIndex,cancel:!1},r._trigger(t.Events.LeaveCell,e),e&&e.cancel===!0)return;r._setActiveCellImp(s.row,s.col,1,n.colViewportIndex,i);r._trigger(t.Events.EnterCell,{sheet:r,sheetName:r._name,row:s.row,col:s.col});u._updateValidationUI(s.row,s.col)}u.shift?(y=f(r._activeColIndex,n.col),b=o(r._activeColIndex-n.col)+1,r._replaceActiveSelectedRange(-1,y,r.getRowCount(),b,!0)):r._setSelectedRange(-1,r._activeColIndex,r.getRowCount(),1,!0)}else if(n.hitTestType===2){if(!u.shift){if(k=r.frozenColCount?r._getFirstVisualColumn():r._scrollLeftCol,s=r._getAvailableActiveCell(n.row,k,!0),e={sheet:r,sheetName:r._name,row:r._activeRowIndex,col:r._activeColIndex,cancel:!1},r._trigger(t.Events.LeaveCell,e),e&&e.cancel===!0)return;a=r._activeRowIndex!==s.row;r._setActiveCellImp(s.row,s.col,n.rowViewportIndex,1,i);a&&r.doDataItemChanged();r._trigger(t.Events.EnterCell,{sheet:r,sheetName:r._name,row:s.row,col:s.col});u._updateValidationUI(s.row,s.col)}u.shift?(p=f(r._activeRowIndex,n.row),w=o(r._activeRowIndex-n.row)+1,r._replaceActiveSelectedRange(p,-1,w,r.getColumnCount(),!0)):r._setSelectedRange(r._activeRowIndex,-1,1,r.getColumnCount(),!0)}else if(n.hitTestType===3)if(isNaN(n.row)||isNaN(n.col))r.isEditing()&&(l=r.getCellRect(r._activeRowIndex,r._activeColIndex,r.activeRowViewportIndex,r.activeColViewportIndex),r._render.update(l.x,l.y,l.width,l.height));else{if(!u.shift&&(r._activeRowIndex!==n.row||r._activeColIndex!==n.col)){if(e={sheet:r,sheetName:r._name,row:r._activeRowIndex,col:r._activeColIndex,cancel:!1},r._trigger(t.Events.LeaveCell,e),e&&e.cancel===!0)return;a=r._activeRowIndex!==n.row;r._setActiveCellImp(n.row,n.col,n.rowViewportIndex,n.colViewportIndex,i);a&&r.doDataItemChanged();r._trigger(t.Events.EnterCell,{sheet:r,sheetName:r._name,row:n.row,col:n.col});u._updateValidationUI(n.row,n.col)}u.shift?r._extendSelectedRange(n.row,n.col,!0):(c=r._spanModel.find(n.row,n.col),c?r._setSelectedRange(c.row,c.col,c.rowCount,c.colCount,!0):r._setSelectedRange(n.row,n.col,1,1,!0))}},at.prototype._startSelectingScroll=function(n){if(n&&(n.hitTestType!==3||!(isNaN(n.row)||isNaN(n.col)))){var t=this;t.isWorking=!0;t.isSelecting=!0;t.startHitInfo={scrollRowViewportIndex:n.rowViewportIndex,scrollColViewportIndex:n.colViewportIndex,hitTestType:n.hitTestType};t.startScroll()}},at.prototype.startSelecting=function(n){this._startSelectingCore(n);this._startSelectingScroll(n)},at.prototype.continueSelecting=function(){var n=this,t;n.startHitInfo&&n.isWorking&&n._forceCancelSelectiong!==!0&&(t=n.startHitInfo.hitTestType,t===3?n.continueCellSelecting():t===2?n.continueRowSelecting():t===1&&n.continueColumnSelecting())},at.prototype.continueCellSelecting=function(){var i=this,n=i._sheet,f=i.getHitRowIndex(),e=i.getHitColumnIndex(),r,u;f>=0&&e>=0&&(r=n._selectionModel.toArray(),n._extendSelectedRange(f,e,!0),u=n._selectionModel.toArray(),i._notEqualSelecions(r,u)&&n._trigger(t.Events.SelectionChanging,{sheet:n,sheetName:n._name,oldSelections:r,newSelections:u}));i.continueScroll()},at.prototype.continueRowSelecting=function(){var i=this,n=i._sheet,r=i.getHitRowIndex(),c,o,s;if(r>=0){var e=f(n._activeRowIndex,r),h=u(n._activeRowIndex,r)-e+1,l=-1,a=n.getColumnCount(),v=n.selectionPolicy();if(v===0)return;c=n.selectionUnit();c===2&&(e=-1,h=-1);o=n._selectionModel.toArray();n._replaceActiveSelectedRange(e,l,h,a,!0);s=n._selectionModel.toArray();i._notEqualSelecions(o,s)&&n._trigger(t.Events.SelectionChanging,{sheet:n,sheetName:n._name,oldSelections:o,newSelections:s})}i.continueScroll()},at.prototype.continueColumnSelecting=function(){var i=this,n=i._sheet,r=i.getHitColumnIndex(),c,o,s;if(r>=0){var e=f(n._activeColIndex,r),h=u(n._activeColIndex,r)-e+1,l=-1,a=n.getRowCount(),v=n.selectionPolicy();if(v===0)return;c=n.selectionUnit();c===1&&(e=-1,h=-1);o=n._selectionModel.toArray();n._replaceActiveSelectedRange(l,e,a,h,!0);s=n._selectionModel.toArray();i._notEqualSelecions(o,s)&&n._trigger(t.Events.SelectionChanging,{sheet:n,sheetName:n._name,oldSelections:o,newSelections:s})}i.continueScroll()},at.prototype.stopSelecting=function(){var n=this,u,r,f;n.startHitInfo=i;n.stopScroll();n._forceCancelSelectiong=i;n.isWorking=!1;n.isSelecting=!1;u=n._sheet;r=!n._lastSelections;r||(f=u._selectionModel.toArray(),r=n._notEqualSelecions(n._lastSelections,f));r&&u._trigger(t.Events.SelectionChanged,{sheet:n._sheet,sheetName:n._sheet._name})},at.prototype.startDragDropping=function(n){var o=this,f,e,l,c,u;if(!o.isDragDropping&&(f=o._sheet,e=i,f._selectionModel.length===1?e=f._selectionModel[0]:f._selectionModel.length<1&&(l=f._spanModel.find(f._activeRowIndex,f._activeColIndex),e=l?l:new t.Range(f._activeRowIndex,f._activeColIndex,1,1)),e)){o.isDragDropping=!0;o.isWorking=!0;o._dragDropFromRange=e;c=f._getRangeRect(n.rowViewportIndex,n.colViewportIndex,e);u=f._dragRect;u.x=c.x;u.y=c.y;u.width=c.width-1;u.height=c.height-1;u.row=e.row;u.col=e.col;u.rowCount=e.rowCount;u.colCount=e.colCount;var r=f._fixRange(e),s=n.row,h=n.col;s<r.row&&(s=r.row);s>=r.row+r.rowCount&&(s=r.row+r.rowCount-1);h<r.col&&(h=r.col);h>=r.col+r.colCount&&(h=r.col+r.colCount-1);u.hitRow=s;u.hitCol=h;u.rowOffset=s-r.row;u.colOffset=h-r.col;o.startHitInfo={scrollRowViewportIndex:n.rowViewportIndex,scrollColViewportIndex:n.colViewportIndex,hitTestType:n.hitTestType};o.startScroll()}},at.prototype.continueDragDropping=function(){var n=this,t,i;if(n.startHitInfo&&n.isWorking&&n.isDragDropping&&n._dragDropFromRange){var r=n.mousePosition,u=n._sheet,f=u._dragRect;f.hitTarget={x:r.x,y:r.y};t=n.getHitRowIndex();i=n.getHitColumnIndex();t>=0&&i>=0&&n.updateDragDropRect(t,i);n.continueScroll()}},at.prototype.updateDragDropRect=function(n,t){var o=this,e,s,c,l,a;if(o.isDragDropping&&o._dragDropFromRange){var r=o._sheet,i=r._dragRect,h=r._getActiveSelectedRange();(h.row===-1&&h.col!==-1?(i.row=-1,i.col=t):h.row!==-1&&h.col===-1?(i.row=n,i.col=-1):(i.row=i.row<0?-1:u(0,f(r.getRowCount()-i.rowCount,n-i.rowOffset)),i.col=i.col<0?-1:u(0,f(r.getColumnCount()-i.colCount,t-i.colOffset))),i.hitRow=n,i.hitCol=t,e=r._fixRange(i),s=r._oldDragRange,s&&e.row===s.row&&e.col===s.col&&e.rowCount===s.rowCount&&e.colCount===s.colCount&&e.row>r._getFirstVisualRow()&&e.col>r._getFirstVisualColumn()&&e.row+e.rowCount-1<r._getLastVisualRow()&&e.col+e.colCount-1<r._getLastVisualColumn())||(r._actualDragRange=e,r._render.refreshDragDropIndicator(),r._oldDragRange=e,c=r.parent,c&&c.showDragDropTip()&&(l=i.x+i.width+o.DRAGDROPTOOLTIP_OFFSET,a=i.y+i.height+o.DRAGDROPTOOLTIP_OFFSET,o._showTooltip(o._getDragDropRectString(e),l,a)))}},at.prototype._getDragDropRectString=function(n){if(n&&t.util.hasCalc()){var o=this._sheet,i=o._getActiveSelectedRange(),r=o.getActiveRowIndex(),u=o.getActiveColumnIndex(),f;return r=r<0?0:r,u=u<0?0:u,i.rowCount===1&&i.colCount===1?f=new t.Calc.Expressions.CellExpression(n.row-r,n.col-u,!0,!0):(f=new t.Calc.Expressions.RangeExpression,i.row===-1&&i.col>=0?f.initBand(n.col-u,n.col-u+i.colCount-1,!0,!0,!1):i.col===-1&&i.row>=0?f.initBand(n.row-r,n.row-r+i.rowCount-1,!0,!0,!0):i.row>=0&&i.col>=0&&f.init(n.row-r,n.col-u,n.row-r+i.rowCount-1,n.col-u+i.colCount-1,!0,!0,!0,!0)),o.getCalcService().unparse(f,r,u)}else return e},at.prototype.stopDragDrop=function(){var u=this,f=!1,s="",b=!1,r=u._sheet,w=i,v;if(u.startHitInfo=i,u.stopScroll(),v=r._getActiveSelectedRange(),w=v&&(v.rowCount>0||v.colCount>0)?{r:v.row,c:v.col,rc:v.rowCount,cc:v.colCount}:{r:r._activeRowIndex,c:r._activeColIndex,rc:1,cc:1},u.isDragDropping===!0&&u.isWorking===!0){var e=w.r,o=w.c,h=w.rc,c=w.cc,a=r._dragRect.row,l=r._dragRect.col,y,p,n;u._isDragInsert&&(e===-1||o===-1)?o>=0&&e<0?(u._isDragCopy&&(l<=o||l>=o+c)||!u._isDragCopy&&(l<o||l>o+c))&&((r._hasPartSpans(-1,o,-1,c)||r._hasPartSpans(-1,l,-1,0))&&(f=!0,s=t.SR.Exp_ChangeMergedCell),f||(r._hasPartArrayFormulas(-1,o,-1,c)||r._hasPartArrayFormulas(-1,l,-1,0))&&(f=!0,s=t.SR.Exp_ChangePartOfArray),!f&&r.isProtected&&(f=!0,s=t.SR.Exp_ColumnReadOnly),!f&&r._hasPartTable(-1,l,-1,1)&&(f=!0,s=t.SR.Exp_DragDropShiftTableCell),f||u._isDragCopy||!r._hasPartTable(-1,o,-1,c)||(f=!0,s=t.SR.Exp_DragDropChangePartOfTable),f||(n=new t.UndoRedo.DragDropExtent(-1,o,-1,l,-1,c),p=r._raiseDragDropBlock(n.fromRow,n.fromColumn,n.toRow,n.toColumn,n.rowCount,n.columnCount,u._isDragCopy,!0,1023),p||(y=new t.UndoRedo.DragDropUndoAction(r,n,u._isDragCopy,!0,1023),r.doCommand(y),r._raiseDragDropBlockCompleted(n.fromRow,n.fromColumn,n.toRow,n.toColumn,n.rowCount,n.columnCount,u._isDragCopy,!0,1023),b=!0))):e>=0&&o<0&&(u._isDragCopy&&(a<=e||a>=e+h)||!u._isDragCopy&&(a<e||a>e+h))&&((r._hasPartSpans(e,-1,h,-1)||r._hasPartSpans(a,-1,0,-1))&&(f=!0,s=t.SR.Exp_ChangeMergedCell),f||(r._hasPartArrayFormulas(e,-1,h,-1)||r._hasPartArrayFormulas(a,-1,0,-1))&&(f=!0,s=t.SR.Exp_ChangePartOfArray),!f&&r.isProtected&&(f=!0,s=t.SR.Exp_RowReadOnly),f||u._isDragCopy||!r._hasPartTable(e,-1,h,-1)||(f=!0,s=t.SR.Exp_DragDropChangePartOfTable),f||(n=new t.UndoRedo.DragDropExtent(e,-1,a,-1,h,-1),p=r._raiseDragDropBlock(n.fromRow,n.fromColumn,n.toRow,n.toColumn,n.rowCount,n.columnCount,u._isDragCopy,!0,1023),p||(y=new t.UndoRedo.DragDropUndoAction(r,n,u._isDragCopy,!0,1023),r.doCommand(y),r._raiseDragDropBlockCompleted(n.fromRow,n.fromColumn,n.toRow,n.toColumn,n.rowCount,n.columnCount,u._isDragCopy,!0,1023),b=!0))):(a!==e||l!==o)&&((r._hasPartSpans(e,o,h,c)||r._hasPartSpans(a,l,h,c))&&(f=!0,s=t.SR.Exp_ChangeMergedCell),f||(r._hasPartArrayFormulas(e,o,h,c)||r._hasPartArrayFormulas(a,l,h,c))&&(f=!0,s=t.SR.Exp_ChangePartOfArray),!f&&r.isProtected&&(!u._isDragCopy&&r._isAnyCellInRangeLocked(new t.Range(e,o,h,c))||r._isAnyCellInRangeLocked(new t.Range(a,l,h,c)))&&(f=!0,s=t.SR.Exp_CellReadOnly),f||(n=new t.UndoRedo.DragDropExtent(e,o,a,l,h,c),p=r._raiseDragDropBlock(n.fromRow,n.fromColumn,n.toRow,n.toColumn,n.rowCount,n.columnCount,u._isDragCopy,!1,1023),p||(y=new t.UndoRedo.DragDropUndoAction(r,n,u._isDragCopy,!1,1023),r.doCommand(y),r._raiseDragDropBlockCompleted(n.fromRow,n.fromColumn,n.toRow,n.toColumn,n.rowCount,n.columnCount,u._isDragCopy,!1,1023),b=!0)))}u.isWorking=!1;u.isDragDropping=!1;u._dragDropFromRange=i;u._isDragInsert=!1;u._isDragCopy=!1;u._removeTooltip();b===!1&&(r._dragRect={},r.repaint());f&&r._raiseInvalidOperation(3,s)},at.prototype.startFormulaRangeAppending=function(n){var r=this,u=r._sheet,f=u._formulaTextBox,w;if(f){w=f.isAppending();w&&r._formulaRangeAppendingInfo||(r._formulaRangeAppendingInfo={anchorRow:-1,anchorCol:-1,leadingRow:-1,leadingCol:-1});var b=u.getRowCount(),k=u.getColumnCount(),a=n.hitTestType,e=n.row,o=n.col,l=r.shift,v=r.ctrl,s=r._formulaRangeAppendingInfo,y=s.anchorRow,p=s.anchorCol,h=-1,c=-1,i;a===0?(h=u.frozenRowCount?u._getFirstVisualRow():u._scrollTopRow,c=u.frozenColCount?u._getFirstVisualColumn():u._scrollLeftCol,i=new t.Range(-1,-1,-1,-1),v?f.appendRange(r.rangeToString(i),!1,!1):l?f.appendRange(r.rangeToString(i),!0,!1):f.appendRange(r.rangeToString(i),!1,!0),r.isWorking=!0):a===1?(h=u.frozenRowCount?u._getFirstVisualRow():u._scrollTopRow,c=o,i=u._getExtendedRange(0,o,b-1,o),i=new t.Range(-1,i.col,-1,i.colCount),v?f.appendRange(r.rangeToString(i),!1,!1):l?(p>=0&&(i=u._getExtendedRange(0,o,b-1,p),i=new t.Range(-1,i.col,-1,i.colCount)),f.appendRange(r.rangeToString(i),!0,!1)):f.appendRange(r.rangeToString(i),!1,!0),r.isWorking=!0):a===2?(h=e,c=u.frozenColCount?u._getFirstVisualColumn():u._scrollLeftCol,i=u._getExtendedRange(e,0,e,k-1),i=new t.Range(i.row,-1,i.rowCount,-1),v?f.appendRange(r.rangeToString(i),!1,!1):l?(y>=0&&(i=u._getExtendedRange(e,0,y,k-1),i=new t.Range(i.row,-1,i.rowCount,-1)),f.appendRange(r.rangeToString(i),!0,!1)):f.appendRange(r.rangeToString(i),!1,!0),r.isWorking=!0):a===3&&(h=e,c=o,i=u._getExtendedRange(e,o,e,o),i=new t.Range(i.row,i.col,1,1),v?f.appendRange(r.rangeToString(i),!1,!1):l?(y>=0&&p>=0&&(i=u._getExtendedRange(e,o,y,p)),f.appendRange(r.rangeToString(i),!0,!1)):f.appendRange(r.rangeToString(i),!1,!0),r.isWorking=!0);r.isFormulaRangeAppending=r.isWorking;l&&w||(s.anchorRow=h,s.anchorCol=c,s.leadingRow=h,s.leadingCol=c);r.startHitInfo={scrollRowViewportIndex:n.rowViewportIndex,scrollColViewportIndex:n.colViewportIndex,hitTestType:n.hitTestType};r.startScroll()}},at.prototype.continueFormulaRangeAppending=function(){var n=this,i=n.startHitInfo,t;i&&n.isWorking&&(t=i.hitTestType,t===3?n.continueFormulaRangeCellAppending():t===2?n.continueFormulaRangeRowAppending():t===1&&n.continueFormulaRangeColumnAppending())},at.prototype.continueFormulaRangeCellAppending=function(){var n=this,t=n._formulaRangeAppendingInfo,i=t.anchorRow,r=t.anchorCol,u=n.getHitRowIndex(),f=n.getHitColumnIndex(),s;if(i>=0&&r>=0&&u>=0&&f>=0){var e=n._sheet,h=e._getExtendedRange(u,f,i,r),o=n.rangeToString(h);o&&(s=e._formulaTextBox,s.appendRange(o,!0,!1))}n.continueScroll()},at.prototype.continueFormulaRangeRowAppending=function(){var n=this,f=n._formulaRangeAppendingInfo.anchorRow,e=n.getHitRowIndex(),r,i,u,o;f>=0&&e>=0&&(r=n._sheet,i=r._getExtendedRange(e,0,f,r.getColumnCount()-1),i=new t.Range(i.row,-1,i.rowCount,-1),u=n.rangeToString(i),u&&(o=r._formulaTextBox,o.appendRange(u,!0,!1)));n.continueScroll()},at.prototype.continueFormulaRangeColumnAppending=function(){var n=this,f=n._formulaRangeAppendingInfo.anchorCol,e=n.getHitColumnIndex(),r,i,u,o;f>=0&&e>=0&&(r=n._sheet,i=r._getExtendedRange(0,e,r.getRowCount()-1,f),i=new t.Range(-1,i.col,-1,i.colCount),u=n.rangeToString(i),u&&(o=r._formulaTextBox,o.appendRange(u,!0,!1)));n.continueScroll()},at.prototype.stopFormulaRangeAppending=function(){var n=this;n.stopScroll();n.startHitInfo=i;n.isWorking=!1;n.isFormulaRangeAppending=!1},at.prototype.startFormulaRangeMoving=function(n){var i=this,c=i._sheet,f=c._formulaTextBox,s=n.formulaRangeHitInfo,e,h,o,l,a;if(s&&s.inBorder&&f&&(f.isAppending()&&f.stopAppending(),f.close(),e=s.paramRange,h=e&&e.text,h)&&(o=i.stringToRange(h),o)){var t=c._fixRange(o),r=n.row,u=n.col;r<t.row&&(r=t.row);r>=t.row+t.rowCount&&(r=t.row+t.rowCount-1);u<t.col&&(u=t.col);u>=t.col+t.colCount&&(u=t.col+t.colCount-1);l=r-t.row;a=u-t.col;i.isWorking=!0;i.isFormulaRangeMoving=!0;i._formulaRangeMovingInfo={paramRange:e,fromRange:o,rowOffset:l,colOffset:a};i.startHitInfo={scrollRowViewportIndex:n.rowViewportIndex,scrollColViewportIndex:n.colViewportIndex,hitTestType:n.hitTestType};i.startScroll()}},at.prototype.continueFormulaRangeMoving=function(){var n=this,r,e,y;if(n.isWorking&&n.isFormulaRangeMoving){if(r=n.getHitRowIndex(),e=n.getHitColumnIndex(),r>=0&&e>=0){var i=n._formulaRangeMovingInfo,o=i.fromRange,p=i.rowOffset,w=i.colOffset,b=i.toRow,k=i.toCol,h=r,c=e;if(h!==b||c!==k){i.toRow=h;i.toCol=c;var s=n._sheet,d=s.getRowCount(),g=s.getColumnCount(),nt=o.row,tt=o.col,l=o.rowCount,a=o.colCount,it=nt<0?-1:u(0,f(d-l,r-p)),rt=tt<0?-1:u(0,f(g-a,e-w)),v=n.rangeToString(new t.Range(it,rt,l,a));v&&(y=s._formulaTextBox,y.repalceRange(i.paramRange.index,v))}}n.continueScroll()}},at.prototype.stopFormulaRangeMoving=function(){var n=this;n.stopScroll();n.isWorking=!1;n.isFormulaRangeMoving=!1;n._formulaRangeMovingInfo=i},at.prototype.startFormulaRangeResizing=function(n){var i=this,p=i._sheet,v=p._formulaTextBox,r=n.formulaRangeHitInfo,s,y,t;if(r&&v&&(v.isAppending()&&v.stopAppending(),s=r.paramRange,y=s&&s.text,y)&&(t=i.stringToRange(y),t)){var h=t.row,c=t.row<0?-1:t.row+t.rowCount-1,l=t.col,a=t.col<0?-1:t.col+t.colCount-1,u,f,e,o;if(r.inTopLeft)u=c,f=a,e=h,o=l;else if(r.inTopRight)u=c,f=l,e=h,o=a;else if(r.inBottomLeft)u=h,f=a,e=c,o=l;else if(r.inBottomRight)u=h,f=l,e=c,o=a;else return;i.isWorking=!0;i.isFormulaRangeResizing=!0;i._formulaRangeResizingInfo={paramRange:s,anchorRow:u,anchorCol:f,toRow:e,toCol:o};i.startHitInfo={scrollRowViewportIndex:n.rowViewportIndex,scrollColViewportIndex:n.colViewportIndex,hitTestType:n.hitTestType};i.startScroll()}},at.prototype.continueFormulaRangeResizing=function(){var n=this,h,c,y,nt;if(n.isWorking&&n.isFormulaRangeResizing){if(h=n.getHitRowIndex(),c=n.getHitColumnIndex(),h>=0&&c>=0){var i=n._formulaRangeResizingInfo,p=i.anchorRow,w=i.anchorCol,tt=i.toRow,it=i.toCol,r=h,e=c;if(r!==tt||e!==it){i.toRow=r;i.toCol=e;var l=n._sheet,b=l.getRowCount(),k=l.getColumnCount(),d=p<0?b-1:p,g=w<0?k-1:w,o=f(d,r),s=f(g,e),a=u(d,r)-o+1,v=u(g,e)-s+1;o===0&&a===b&&(o=-1,a=-1);s===0&&v===k&&(s=-1,v=-1);y=n.rangeToString(new t.Range(o,s,a,v));y&&(nt=l._formulaTextBox,nt.repalceRange(i.paramRange.index,y))}}n.continueScroll()}},at.prototype.stopFormulaRangeResizing=function(){var n=this;n.stopScroll();n.isWorking=!1;n.isFormulaRangeResizing=!1;n._formulaRangeResizingInfo=i},at.prototype.getFormulaRangeHitInfo=function(n,t,r){var w=this._sheet,b=w._formulaTextBox,l=b&&b.getRanges(),v,y,e,p,f,a;if(!l||l.length===0||(v=n.rowViewportIndex,y=n.colViewportIndex,this.inGrayArea(v,y,t,r)))return i;for(a=l.length-1;a>=0;a--)if((e=l[a],p=this.stringToRange(e.text),p)&&(f=w._getRangeRect(v,y,p),f&&f.width>0&&f.height>0)){var u=5,o=f.x-2,s=f.x+f.width+1-u,h=f.y-2,c=f.y+f.height+1-u;if(o+u<=t&&t<s&&(h+1<=r&&r<=h+3||c+1<=r&&r<=c+3))return{paramRange:e,inBorder:!0};if(h+u<=r&&r<c&&(o+1<=t&&t<=o+3||s+1<=t&&t<=s+3))return{paramRange:e,inBorder:!0};if(s<=t&&t<s+u&&c<=r&&r<c+u)return{paramRange:e,inBottomRight:!0};if(o<=t&&t<o+u&&c<=r&&r<c+u)return{paramRange:e,inBottomLeft:!0};if(s<=t&&t<s+u&&h<=r&&r<h+u)return{paramRange:e,inTopRight:!0};if(o<=t&&t<o+u&&h<=r&&r<h+u)return{paramRange:e,inTopLeft:!0}}return i},at.prototype.changeFormulaReference=function(){var s=this,l=s._sheet,f=l._formulaTextBox,p,v,b,k,w;if(f){var g=n.spread,y=t.Calc,a=y.Expressions,h=l._activeRowIndex,c=l._activeColIndex,d=l.referenceStyle()===1,e=new y.ParserContext(d,h,c),o=new y.Parser,u,r;if(f.isAppending())for(p=f.getAppendingRanges(),v=0;v<p.length;v++){u=p[v];try{r=o.parse(u.text,e)}catch(nt){r=i}r&&(r instanceof a.RangeExpression?(s.changeRangeExpressionReference(r,h,c,!0,!0),f.repalceRange(u.index,o.unparse(r,e))):r instanceof a.CellExpression&&(s.changeCellExpressionReference(r,h,c),f.repalceRange(u.index,o.unparse(r,e))))}else{if(u=f.getActiveRange(),!u)return;try{r=o.parse(u.text,e)}catch(nt){r=i}if(!r)return;r instanceof a.RangeExpression?(b=u.textOffset+u.text.lastIndexOf(":"),k=f.caret()<=b,k?(s.changeRangeExpressionReference(r,h,c,!0,!1),w=o.unparse(r,e),f.repalceRange(u.index,w),f.caret(u.textOffset+w.lastIndexOf(":"))):(s.changeRangeExpressionReference(r,h,c,!1,!0),f.repalceRange(u.index,o.unparse(r,e)))):r instanceof a.CellExpression&&(s.changeCellExpressionReference(r,h,c),f.repalceRange(u.index,o.unparse(r,e)))}}},at.prototype.changeRangeExpressionReference=function(n,t,i,r,u){var o=n.startRowRelative,s=n.startColumnRelative,f,e;r&&(o&&s?(n.startRowRelative=!1,n.startColumnRelative=!1,n.startRow+=t,n.startColumn+=i):o?(n.startColumnRelative=!0,n.startColumn-=i):s?(n.startRowRelative=!0,n.startColumnRelative=!1,n.startRow-=t,n.startColumn+=i):(n.startColumnRelative=!0,n.startColumn-=i));f=n.endRowRelative;e=n.endColumnRelative;u&&(f&&e?(n.endRowRelative=!1,n.endColumnRelative=!1,n.endRow+=t,n.endColumn+=i):f?(n.endColumnRelative=!0,n.endColumn-=i):e?(n.endRowRelative=!0,n.endColumnRelative=!1,n.endRow-=t,n.endColumn+=i):(n.endColumnRelative=!0,n.endColumn-=i))},at.prototype.changeCellExpressionReference=function(n,t,i){var r=n.rowRelative,u=n.columnRelative;r&&u?(n.rowRelative=!1,n.columnRelative=!1,n.row+=t,n.column+=i):r?(n.columnRelative=!0,n.column-=i):u?(n.rowRelative=!0,n.columnRelative=!1,n.row-=t,n.column+=i):(n.columnRelative=!0,n.column-=i)},at.prototype.rangeToString=function(r){if(!r)return i;var f=n.spread,e=t.Calc,u=this._sheet,o=u._activeRowIndex,s=u._activeColIndex,h=u.referenceStyle()===1;return r.row<0&&r.col<0&&(r=new f.Range(0,-1,u.getRowCount(),-1)),e.rangeToFormula(r,o,s,15,h)},at.prototype.stringToRange=function(r){if(!r)return i;var h=n.spread,f=t.Calc,u=this._sheet,e=u._activeRowIndex,o=u._activeColIndex,s=u.referenceStyle()===1;try{return f.formulaToRange(r,e,o,s)}catch(c){}return i},at.prototype.startDragFill=function(n){var t=this;t.isDraggingFill!==!0&&t.isWorking!==!0&&(t.updateDragFillStartRange(),t._dragFillStartRange)&&(t.isWorking=!0,t.isDraggingFill=!0,t._isDragAroundIndicator=!0,t._dragStartRowViewport=n.rowViewportIndex,t._dragStartColumnViewport=n.colViewportIndex,t._dragToRowViewport=n.rowViewportIndex,t._dragToColumnViewport=n.colViewportIndex,t.updateDragStartRangeViewports(),t.startHitInfo={scrollRowViewportIndex:n.rowViewportIndex,scrollColViewportIndex:n.colViewportIndex,hitTestType:n.hitTestType},t.startScroll())},at.prototype.updateDragStartRangeViewports=function(){var n=this,i=n.dragFillStartTopRow(),t;i>=0&&i<n._sheet.frozenRowCount?n._dragFillStartTopRowViewport=0:i>=n._sheet.frozenRowCount&&i<=n._sheet.getRowCount()&&(n._dragFillStartTopRowViewport=1);n._dragFillStartBottomRowViewport=n.isDragFillWholeColumns()?1:n._dragStartRowViewport;t=n.dragFillStartLeftColumn();t>=0&&t<n._sheet.frozenColCount?n._dragFillStartLeftColumnViewport=0:t>=n._sheet.frozenColCount&&t<=n._sheet.getColumnCount()&&(n._dragFillStartLeftColumnViewport=1);n._dragFillStartRightColumnViewport=n.isDragFillWholeRows()?1:n._dragStartColumnViewport},at.prototype.continueDragFill=function(){var n=this;if(n.startHitInfo&&n.isDraggingFill&&n.isWorking&&n._dragFillStartRange){if(n._dragToRowViewport=n.getHitRowViewportIndex(),n._dragToColumnViewport=n.getHitColumnViewportIndex(),n._dragToRow=n.getHitRowIndex(),n._dragToColumn=n.getHitColumnIndex(),n._dragToRow>=0&&n._dragToColumn>=0){n.updateCurrentFillSettings();n.updateCurrentFillRange();var t=n._sheet.parent,i=!1,r=n.getDragFillFrameRange();r&&(i=n.validateFillRange(r));t&&t.showDragFillTip()&&i&&n._showDragFillTooltip();n.refreshDragFill()}n.continueScroll()}},at.prototype._getDragFillTooltipContent=function(){var v,e,p,s,w,r,b;if(!t.features.fill)return i;var n=this,u=n._sheet,h=n._dragFillStartRange,c=n._currentFillRange,l=n.getDragAutoFillType(),f=n.getCurrentFillDirection(),k=n.getDragFillFrameRange(),a;if(l===1){a=f===0||f===1?1:0;v=new t.FillImp(u);e=i;e=v.fillAuto(k,a,!0);var r=n._getAvailableRange(f,c,h),o=u.getActualStyle(r.row,r.col),d=o.cellType||u.getDefaultCellType(),y=o.formatter?o.formatter:o._autoFormatter;return e instanceof Date&&t.features.formatter&&(y=new t.GeneralFormatter(t.DefaultTokens.DateTimeFormatInfo().ShortDatePattern+" hh:mm:ss AM/PM;@",0,t._CultureInfo.currentCulture().Name())),p=n.startHitInfo,s=3,p&&(s=n.startHitInfo.hitTestType),w={sheet:u,row:r.row,col:r.col,sheetArea:s},d.format(e,y,w)}else return l===0?(r=n._getAvailableRange(f,c,h),b=u.getFormula(r.row,r.col),b)?i:u.getText(r.row,r.col):i},at.prototype._getAvailableRange=function(n,i,r){var f=new t.Range(r.row,r.col,1,1),u;return n===3?(u=i.rowCount%r.rowCount,u=u===0?r.row+r.rowCount-1:r.row+u-1,f.row=u,f.col=r.col):n===1?(u=i.colCount%r.colCount,u=u===0?r.col+r.colCount-1:r.col+u-1,f.row=r.row,f.col=u):n===0?(u=i.colCount%r.colCount,u=u===0?r.col:r.col+r.colCount-u,f.row=r.row,f.col=u):n===2&&(u=i.rowCount%r.rowCount,u=u===0?r.row:r.row+r.rowCount-u,f.row=u,f.col=r.col),f},at.prototype._showDragFillTooltip=function(){var n=this,o=n.getDragAutoFillType();if(o===4||n.isDragFillWholeRows()||n.isDragFillWholeColumns())return n._removeTooltip(),i;else{var r,u,e,s=n._sheet,f=n.getCurrentFillDirection(),h=n.getDragFillFrameRange(),t=s._getRangeRect2(h);e=n._getDragFillTooltipContent();f===3?(r=t.x+t.width+n.DRAGFILLTOOLTIP_OFFSET,u=t.y+t.height+n.DRAGFILLTOOLTIP_OFFSET):f===1?(r=t.x+t.width+n.DRAGFILLTOOLTIP_OFFSET,u=t.y+t.height+n.DRAGFILLTOOLTIP_OFFSET):f===0?(r=t.x+n.DRAGFILLTOOLTIP_OFFSET,u=t.y+t.height+n.DRAGFILLTOOLTIP_OFFSET):f===2&&(r=t.x+t.width+n.DRAGFILLTOOLTIP_OFFSET,u=t.y+n.DRAGFILLTOOLTIP_OFFSET);n._showTooltip(e,r,u)}},at.prototype.refreshDragFill=function(){var n=this;n.clearDragFill();n.refreshSelectionBorder();n.paintDragFill();n._oldDragFillFrameRange=n.getDragFillFrameRange()},at.prototype.clearDragFill=function(){var t=this._sheet,n;this._oldDragFillFrameRange&&(n=t._getRangeRect2(this._oldDragFillFrameRange),n.x-=2,n.y-=2,n.width+=4,n.height+=4,t._render.copyDoubleBufferRect(n))},at.prototype.refreshSelectionBorder=function(n){var t=this._sheet;t._render.repaintSelection(this._dragFillStartRange,i,n)},at.prototype.paintDragFill=function(){var t=this._sheet,i=t._render,r=this.getDragFillFrameRange(),n,u;r&&(n=i._getCtx(),u=t._getRangeRect2(r),n.save(),n.beginPath(),i.paintDragRectangle(n,u),n.restore())},at.prototype.updateCurrentFillRange=function(){this._currentFillRange=this.getCurrentFillRange()},at.prototype.isDragFillWholeRows=function(){return this._dragFillStartRange.col===-1&&this._dragFillStartRange.row!==-1},at.prototype.isDragFillWholeColumns=function(){return this._dragFillStartRange.row===-1&&this._dragFillStartRange.col!==-1},at.prototype.isDragClear=function(){return this._currentFillDirection===4||this._currentFillDirection===5},at.prototype.getCurrentFillRange=function(){var n=this,i=-1,r=-1,u=-1,f=-1;switch(n._currentFillDirection){case 0:n.isDragFillWholeColumns()?(i=-1,u=-1):(i=n.dragFillStartTopRow(),u=n._dragFillStartRange.rowCount);r=n._dragToColumn;f=n.dragFillStartLeftColumn()-r;break;case 1:n.isDragFillWholeColumns()?(i=-1,u=-1):(i=n.dragFillStartTopRow(),u=n._dragFillStartRange.rowCount);r=n.dragFillStartRightColumn()+1;f=n._dragToColumn-r+1;break;case 2:i=n._dragToRow;u=n.dragFillStartTopRow()-i;n.isDragFillWholeRows()?(r=-1,f=-1):(r=n.dragFillStartLeftColumn(),f=n._dragFillStartRange.colCount);break;case 3:i=n.dragFillStartBottomRow()+1;u=n._dragToRow-i+1;n.isDragFillWholeRows()?(r=-1,f=-1):(r=n.dragFillStartLeftColumn(),f=n._dragFillStartRange.colCount);break;case 5:i=n._dragToRow;u=n.dragFillStartBottomRow()-i+1;n.isDragFillWholeRows()?(r=-1,f=-1):(r=n.dragFillStartLeftColumn(),f=n._dragFillStartRange.colCount);break;case 4:n.isDragFillWholeColumns()?(i=-1,u=-1):(i=n._dragFillStartRange.row,u=n._dragFillStartRange.rowCount);r=n._dragToColumn;f=n.dragFillStartRightColumn()-r+1;break;default:break}return new t.Range(i,r,u,f)},at.prototype.dragFillStartBottomRowLayout=function(){var n=this.dragFillStartBottomRow();return n!==-1?this._sheet._getRowLayout(this._dragFillStartBottomRowViewport).findRow(n):i},at.prototype.dragFillToViewportBottomRowLayout=function(){return this._sheet._getRowLayout(this._dragToRowViewport).findRow(this.dragFillToViewportBottomRow())},at.prototype.dragFillToViewportBottomRow=function(){return this._sheet.getViewportBottomRow(this._dragToRowViewport)},at.prototype.dragFillStartRightColumnLayout=function(){var n=this.dragFillStartRightColumn();return n!==-1?this._sheet._getColumnLayout(this._dragFillStartRightColumnViewport).findCol(n):i},at.prototype.dragFillToViewportRightColumnLayout=function(){return this._sheet._getColumnLayout(this._dragToColumnViewport).findCol(this.dragFillToViewportRightColumn())},at.prototype.dragFillToViewportRightColumn=function(){return this._sheet.getViewportRightColumn(this._dragToColumnViewport)},at.prototype.updateCurrentFillSettings=function(){var n=this,c=n.isDragFillWholeRows(),l=n.isDragFillWholeColumns(),v=$(n._sheet._getCanvas()).offset(),y=n.mousePosition.e,ut=n.mousePosition.x,p=n.mousePosition.y,s=y.pageX-v.left,h=y.pageY-v.top,w=!1,t,i,r,e,b,k,u;if(c||l?l?n._dragToColumn>=n.dragFillStartLeftColumn()&&n._dragToColumn<=n.dragFillStartRightColumn()?n._currentFillDirection=4:n._dragToColumn<n.dragFillStartLeftColumn()?n._currentFillDirection=0:n._dragToColumn>n.dragFillStartRightColumn()&&(n._currentFillDirection=1):c&&(n._dragToRow>=n.dragFillStartTopRow()&&n._dragToRow<=n.dragFillStartBottomRow()?n._currentFillDirection=5:n._dragToRow<n.dragFillStartTopRow()?n._currentFillDirection=2:n._dragToRow>n.dragFillStartBottomRow()&&(n._currentFillDirection=3)):n._dragToRow>=n.dragFillStartTopRow()&&n._dragToRow<=n.dragFillStartBottomRow()?n._dragToColumn>=n.dragFillStartLeftColumn()&&n._dragToColumn<=n.dragFillStartRightColumn()?(t=o(n._dragToColumn-n.dragFillStartRightColumn()),i=o(n._dragToRow-n.dragFillStartBottomRow()),i>t?n._currentFillDirection=5:i<t?n._currentFillDirection=4:(r=n.dragFillStartBottomRowLayout(),r||(r=n.dragFillToViewportBottomRowLayout()),p>r.y+r.height?n._currentFillDirection=3:(e=n.dragFillStartRightColumnLayout(),e||(e=n.dragFillToViewportRightColumnLayout()),b=e.x+e.width-ut,k=r.y+r.height-p,s>=e.x&&s<=e.x+e.width&&h>=r.y&&h<=r.y+r.height?n._currentFillDirection=b>=k?4:5:w=!0))):n._dragToColumn<n.dragFillStartLeftColumn()?n._currentFillDirection=0:n._dragToColumn>n.dragFillStartRightColumn()&&(n._currentFillDirection=1):n._dragToRow<n.dragFillStartTopRow()?n._dragToColumn>=n.dragFillStartLeftColumn()&&n._dragToColumn<=n.dragFillStartRightColumn()?n._currentFillDirection=2:n._dragToColumn<n.dragFillStartLeftColumn()?(t=o(n._dragToColumn-n.dragFillStartLeftColumn()),i=o(n._dragToRow-n.dragFillStartTopRow()),n._currentFillDirection=i>=t?2:0):n._dragToColumn>n.dragFillStartRightColumn()&&(t=o(n._dragToColumn-n.dragFillStartRightColumn()),i=o(n._dragToRow-n.dragFillStartTopRow()),n._currentFillDirection=i>=t?2:1):n._dragToRow>n.dragFillStartBottomRow()&&(n._dragToColumn>=n.dragFillStartLeftColumn()&&n._dragToColumn<=n.dragFillStartRightColumn()?n._currentFillDirection=3:n._dragToColumn<n.dragFillStartLeftColumn()?(t=o(n._dragToColumn-n.dragFillStartLeftColumn()),i=o(n._dragToRow-n.dragFillStartBottomRow()),n._currentFillDirection=i>=t?3:0):n._dragToColumn>n.dragFillStartRightColumn()&&(t=o(n._dragToColumn-n.dragFillStartRightColumn()),i=o(n._dragToRow-n.dragFillStartBottomRow()),n._currentFillDirection=i>=t?3:1)),u=n._sheet._dragFillIndicatorRect,u){var d=n.dragFillStartBottomRow(),g=n.dragFillStartRightColumn(),ft=d+1,et=g+1,ot=n._sheet.getRowHeight(d,3),st=n._sheet.getColumnWidth(g,3),ht=n._sheet.getRowHeight(ft,3),ct=n._sheet.getColumnWidth(et,3),nt=u.x+u.width/2-f(10,st/2),tt=u.x+u.width/2+f(10,ct/2),it=u.y+u.height/2-f(10,ot/2),rt=u.y+u.height/2+f(10,ht/2),a=!1;c||l?l?a=nt<=s&&s<=tt:c&&(a=it<=h&&h<=rt):a=nt<=s&&s<=tt&&it<=h&&h<=rt;a||w?(n._isDragAroundIndicator=!0,n._currentFillDirection=4):n._isDragAroundIndicator=!1}},at.prototype.dragFillStartTopRow=function(){return this._dragFillStartRange?this._dragFillStartRange.row===-1?0:this._dragFillStartRange.row:-1},at.prototype.dragFillStartBottomRow=function(){var n=this;return n._dragFillStartRange?n._dragFillStartRange.row===-1?n._sheet.getRowCount()-1:n._dragFillStartRange.row+n._dragFillStartRange.rowCount-1:-1},at.prototype.dragFillStartLeftColumn=function(){return this._dragFillStartRange?this._dragFillStartRange.col===-1?0:this._dragFillStartRange.col:-1},at.prototype.dragFillStartRightColumn=function(){var n=this;return n._dragFillStartRange?n._dragFillStartRange.col===-1?n._sheet.getColumnCount()-1:n._dragFillStartRange.col+n._dragFillStartRange.colCount-1:-1},at.prototype.endDragFill=function(){var n=this,t,u,r,f;if(n.startHitInfo=i,n.stopScroll(),n._removeTooltip(),!n.isDraggingFill||!n.isWorking){n.resetDragFill();return}(n.isDraggingFill=!1,n.isWorking=!1,t=n.getDragFillFrameRange(),t)&&(u=n.validateFillRange(t),!u||n._isDragAroundIndicator?(n.resetDragFill(),n.refreshSelection(t)):(r=n.getDragAutoFillType(),f=n.executeDragFillAction(n._currentFillRange,r),!f&&n.isDragFill()?n.showDragFillSmartTag(r):n.refreshSelection(t),n.resetDragFill()))},at.prototype.showDragFillSmartTag=function(n){if(t.features.fill_ui){var i=this._sheet,r=i._dragFillIndicatorRect,u={x:r.x+r.width,y:r.y+r.height,fillType:n};i._smartTag=new t._GcFillDialog(i,u);i._smartTag.open()}},at.prototype.updateDragFillStartRange=function(){var n=this._sheet;n._selectionModel.length===1?this._dragFillStartRange=n._selectionModel[0]:n._activeRowIndex>=0&&n._activeColIndex>=0&&(this._dragFillStartRange=new t.Range(n._activeRowIndex,n._activeColIndex,1,1))},at.prototype.resetDragFill=function(){this.isWorking=!1;this.isDraggingFill=!1},at.prototype.refreshSelection=function(n){this._sheet._render.repaintSelection(n)},at.prototype.getDragAutoFillType=function(){var n=this,t;return n.isDragClear()?4:(t=n._dragFillStartRange.rowCount===1&&n._dragFillStartRange.colCount===1&&!n.isDragFillWholeColumns()&&!n.isDragFillWholeRows(),t?n.isControlPressed?1:0:n.isControlPressed?0:1)},at.prototype.getDragFillFrameRange=function(){var n=this;if(!n._dragFillStartRange)return i;if(n.isDragClear())return n._dragFillStartRange;if(!n._currentFillRange)return i;var r=0,u=0,f=0,e=0;return n.isVerticalDragFill()?(r=n._currentFillDirection===2?n._currentFillRange.row:n._dragFillStartRange.row,u=n._dragFillStartRange.rowCount+n._currentFillRange.rowCount,f=n._dragFillStartRange.col,e=n._dragFillStartRange.colCount):(r=n._dragFillStartRange.row,u=n._dragFillStartRange.rowCount,f=n._currentFillDirection===0?n._currentFillRange.col:n._dragFillStartRange.col,e=n._dragFillStartRange.colCount+n._currentFillRange.colCount),new t.Range(r,f,u,e)},at.prototype.validateFillRange=function(n){var r=this._sheet,i=!0,u="";return r._hasSpans(n.row,n.col,n.rowCount,n.colCount)&&(i=!1,u=t.SR.Exp_FillRangeContainsMergedCell),i&&r.isProtected&&r._isAnyCellInRangeLocked(n)&&(i=!1,u=t.SR.Exp_FillCellsReadOnly),i||r._raiseInvalidOperation(2,u),i},at.prototype.executeDragFillAction=function(n,i){var f=this,u=f._sheet,e=u._getActualRange(n),r,o,s;return(f._preFillCellsInfo=new t.UndoRedo.CopyMoveCellsInfo(e.rowCount,e.colCount),t.UndoRedo.CopyMoveHelper.saveViewportInfo(u,f._preFillCellsInfo,e.row,e.col,1023),r={startRange:f._dragFillStartRange,fillRange:n,autoFillType:i,fillDirection:f.getCurrentFillDirection()},o=u._raiseDragFillBlock(r.fillRange,r.fillDirection,r.autoFillType),!o)?(s=new t.UndoRedo.DragFillUndoAction(u,r),u.doCommand(s),u._raiseDragFillBlockCompleted(r.fillRange,r.fillDirection,r.autoFillType),!1):!0},at.prototype.isDragFill=function(){return this.isIncreaseFill()||this.isDecreaseFill()},at.prototype.isIncreaseFill=function(){return this._currentFillDirection===3||this._currentFillDirection===1},at.prototype.isDecreaseFill=function(){return this._currentFillDirection===0||this._currentFillDirection===2},at.prototype.isVerticalDragFill=function(){return this._currentFillDirection===2||this._currentFillDirection===3||this._currentFillDirection===5},at.prototype.isDragToRowInView=function(){return this.isRowInViewport(this._dragToRowViewport,this._dragToRow)},at.prototype.isRowInViewport=function(n,t){var i=this._sheet.getViewportTopRow(n),r=this._sheet.getViewportBottomRow(n);return t>=i&&t<=r?!0:!1},at.prototype.getCurrentDragToRowLayout=function(){return this._sheet._getRowLayout(this._dragToRowViewport).findRow(this._dragToRow)},at.prototype.isDragFillStartBottomRowInView=function(){return this.isRowInViewport(this._dragFillStartBottomRowViewport,this.dragFillStartBottomRow())},at.prototype.dragFillStartViewportBottomRowLayout=function(){return this._sheet._getRowLayout(this._dragStartRowViewport).findRow(this.dragFillStartViewportBottomRow())},at.prototype.dragFillStartViewportBottomRow=function(){return this._sheet.getViewportBottomRow(this._dragStartRowViewport)},at.prototype.getValidVerDragToRowLayout=function(){var n=this;return n.isIncreaseFill()?n.isDragToRowInView()?n.getCurrentDragToRowLayout():n.dragFillToViewportBottomRowLayout():n.isDragFillStartBottomRowInView?n.dragFillStartBottomRowLayout():n.dragFillStartViewportBottomRowLayout()},at.prototype.isDragToColumnInView=function(){return this.isColumnInViewport(this._dragToColumnViewport,this._dragToColumn)},at.prototype.isColumnInViewport=function(n,t){var i=this._sheet.getViewportLeftColumn(n),r=this._sheet.getViewportRightColumn(n);return t>=i&&t<=r?!0:!1},at.prototype.getCurrentDragToColumnLayout=function(){return this._sheet._getColumnLayout(this._dragToColumnViewport).findCol(this._dragToColumn)},at.prototype.isDragFillStartRightColumnInView=function(){return this.isColumnInViewport(this._dragFillStartRightColumnViewport,this.dragFillStartRightColumn())},at.prototype.dragFillStartViewportRightColumnLayout=function(){return this._sheet._getColumnLayout(this._dragStartColumnViewport).findCol(this.dragFillStartViewportRightColumn())},at.prototype.dragFillStartViewportRightColumn=function(){return this._sheet.getViewportRightColumn(this._dragStartColumnViewport)},at.prototype.getValidHorDragToColumnLayout=function(){var n=this;return n.isIncreaseFill()?n.isDragToColumnInView()?n.getCurrentDragToColumnLayout():n.dragFillToViewportRightColumnLayout():n.isDragFillStartRightColumnInView()?n.dragFillStartRightColumnLayout():n.dragFillStartViewportRightColumnLayout()},at.prototype.dragFillToViewportTopRowLayout=function(){return this._sheet._getRowLayout(this._dragToRowViewport).findRow(this.dragFillToViewportTopRow())},at.prototype.dragFillToViewportTopRow=function(){return this._sheet.getViewportTopRow(this._dragToRowViewport)},at.prototype.dragFillToViewportLeftColumnLayout=function(){return this._sheet._getColumnLayout(this._dragToColumnViewport).findCol(this.dragFillToViewportLeftColumn())},at.prototype.dragFillToViewportLeftColumn=function(){return this._sheet.getViewportLeftColumn(this._dragToColumnViewport)},at.prototype.getCurrentFillDirection=function(){switch(this._currentFillDirection){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 0;case 5:return 2;default:break}return 3},at.prototype.getHitRowViewportIndex=function(){var i=this._sheet,n=i._getRowViewportIndexNearY(this.mousePosition.y),r=this.startHitInfo.scrollRowViewportIndex,t=i._getRowLayout(1);return n===0&&r>0&&t.length>0&&t[0].row>i._getFirstPageTopRow()?n=1:n===2&&r<2&&t.length>0&&t[t.length-1].row<i._getLastVisualRow()&&(n=1),n},at.prototype.getHitColumnViewportIndex=function(){var i=this._sheet,n=i._getColumnViewportIndexNearX(this.mousePosition.x),r=this.startHitInfo.scrollColViewportIndex,t=i._getColumnLayout(1);return n===0&&r>0&&t.length>0&&t[0].col>i._getFirstPageLeftColumn()?n=1:n===2&&r<2&&t.length>0&&t[t.length-1].col<i._getLastVisualColumn()&&(n=1),n},at.prototype.getHitRowIndex=function(){var t=this._sheet,i=this.mousePosition.y,r=this.getHitRowViewportIndex(),f=t._getViewportRowLayoutNearY(r,i),u,n;return f?(u=t._getSheetLayout(),n=f.row,r===1&&i<u.viewportY&&n>t._getFirstPageTopRow())?t._getNextVisualRow(n-1)||n:r===1&&i>u.frozenTrailingY&&n>t._getLastFullyVisibleRow()?t._getPrevVisualRow(n)||n:n:-1},at.prototype.getHitColumnIndex=function(){var t=this._sheet,i=this.mousePosition.x,r=this.getHitColumnViewportIndex(),f=t._getViewportColumnLayoutNearX(r,i),u,n;return f?(u=t._getSheetLayout(),n=f.col,r===1&&i<u.viewportX&&n>t._getFirstPageLeftColumn())?t._getNextVisualColumn(n-1)||n:r===1&&i>u.frozenTrailingX&&n>t._getLastFullyVisibleColumn()?t._getPrevVisualColumn(n)||n:n:-1},at.prototype.getIntervalFromDistance=function(n){var t=0,i;return isNaN(n)||n===0||(i=n<0,n=o(n),t=et(500/n),t=u(20,t*10),t>200&&(t=200),i&&(t=-t)),t},at.prototype.updateRange=function(n,t,i,r){if(i!==0&&r!==0){var a=this,e=a._sheet,y=3,o=e._getRowLayout(0,y),s=e._getColumnLayout(0,y),h=e._getRowLayout(1,y),c=e._getColumnLayout(1,y),p=0;s&&s.length>0&&(p=s[s.length-1].col);c&&c.length>0&&(p=c[c.length-1].col);var l=a.getYForRow(n,t,i,r,!0,p,o,h),w=a.getYForRow(n,t,i,r,!1,p,o,h),b=0;o&&o.length>0&&(b=o[o.length-1].row);h&&h.length>0&&(b=h[h.length-1].row);var f=a.getXForCol(n,t,i,r,!0,b,s,c),v=a.getXForCol(n,t,i,r,!1,b,s,c),u=e._getSheetLayout(),k=e._render;v>f&&w>l&&k.update(f-u.headerX-2,l-u.headerY-2,v-f+2*u.headerX+2,w-l+2*u.headerY+2);w>l&&k.update(u.headerX,l,u.rowHeaderWidth,w-l);v>f&&(k.update(f,u.headerY,v-f,u.colHeaderHeight),k.update(f,u.footerY,v-f,u.colHeaderHeight))}},at.prototype.getYForRow=function(n,t,i,r,f,e,o,s){var v=this._sheet,c=n,l,a,h;if(f||(c=n+i-1),c<v.frozenRowCount){if(o.length<1)return-1}else{if(s.length<1)return-1;f?c<s[0].row&&(c=s[0].row):c>s[s.length-1].row&&(c=s[s.length-1].row)}for(l=0,f&&(l=9e4),a=u(v._scrollLeftCol,t);a<t+r&&a<=e;a++)h=v.getCellRect(c,a),h&&(f?h.y<l&&(l=h.y):l<h.y+h.height&&(l=h.y+h.height));return l},at.prototype.getXForCol=function(n,t,i,r,f,e,o,s){var v=this._sheet,c=t,l,a,h;if(f||(c=t+r-1),c<v.frozenColCount){if(o.length<1)return}else{if(s.length<1)return;f?c<s[0].col&&(c=s[0].col):c>s[s.length-1].col&&(c=s[s.length-1].col)}for(l=0,f&&(l=9e4),a=u(v._scrollTopRow,n);a<n+i&&a<=e;a++)h=v.getCellRect(a,c),h&&(f?h.x<l&&(l=h.x):l<h.x+h.width&&(l=h.x+h.width));return l},at.prototype._getPrevVisualRowBeforeFindRow=function(n,t){var u=this._sheet,r=n;return this._isCellHiddenByGroup(r,0,t)?(r=u._getPrevVisualRow(r,t),r!==i?r:n):n},at.prototype._getPrevVisualColBeforeFindCol=function(n,t){var u=this._sheet,r=n;return this._isCellHiddenByGroup(0,r,t)?(r=u._getPrevVisualColumn(r,t),r!==i?r:n):n},at.prototype._isCellHiddenByGroup=function(n,t,r){var u,f,e,o,s;return(typeof r===b||r===i)&&(r=3),u=this._sheet,r===3?(f=u.rowRangeGroup,e=u.colRangeGroup):r===1?e=u.colRangeGroup:r===2&&(f=u.rowRangeGroup),o=f&&!f._isEmpty()&&f.isCollapsed(n),s=e&&!e._isEmpty()&&e.isCollapsed(t),o||s},at.prototype._getResizeRowInfo=function(n,t,r,f,e){var s=i,h=n._getRowLayout(t.rowViewportIndex,f),o,l,v,c,a;return!h||isNaN(t.row)||isNaN(t.col)||(t.row=this._getPrevVisualRowBeforeFindRow(t.row,f),o=h.findRow(t.row),o&&(o.y+o.height-r<=e&&e<=o.y+o.height+r?(s={action:"sizeRow",index:t.row,sheetArea:f},l=h[h.length-1].row,l>=0&&(v=n._getLastVisualRow(f),s.index===v&&s.index!==l&&o.y+o.height-r/2<=e&&(s={action:"sizeRow",index:l,sheetArea:f}))):o.y-r<=e&&e<=o.y+r&&h.indexOf(o)>0&&(s={action:"sizeRow",index:t.row-1,sheetArea:f})),!s&&t.rowViewportIndex===1&&h.length>0&&(o=h[0],u(0,o.y-r)<=e&&e<=o.y+r&&(c=t.row-1,a=n._getRowLayout(t.rowViewportIndex-1,f),c>=0&&a&&!a.findRow(c)&&n.getRowHeight(c)===0&&(s={action:"sizeRow",index:c,sheetArea:f})))),s&&!n.getRowResizable(s.index,f)&&(s=i),s},at.prototype._getResizeColInfo=function(n,t,r,f,e){var s=i,h=n._getColumnLayout(t.colViewportIndex,f),o,l,v,c,a;return!h||isNaN(t.col)||isNaN(t.row)||(t.col=this._getPrevVisualColBeforeFindCol(t.col,f),o=h.findCol(t.col),o&&(o.x+o.width-r<=e&&e<=o.x+o.width+r?(s={action:"sizeCol",index:t.col,sheetArea:f},l=h[h.length-1].col,l>=0&&(v=n._getLastVisualColumn(f),s.index===v&&s.index!==l&&o.x+o.width-r/2<=e&&(s={action:"sizeCol",index:l,sheetArea:f}))):o.x-r<=e&&e<=o.x+r&&h.indexOf(o)>0&&(s={action:"sizeCol",index:t.col-1,sheetArea:f})),!s&&t.colViewportIndex===1&&h.length>0&&(o=h[0],u(0,o.x-r)<=e&&e<=o.x+r&&(c=t.col-1,a=n._getColumnLayout(t.colViewportIndex-1,f),c>=0&&a&&!a.findCol(c)&&n.getColumnWidth(c)===0&&(s={action:"sizeCol",index:c,sheetArea:f})))),s&&!n.getColumnResizable(s.index,f)&&(s=i),s},at.prototype.getResizingRowCol=function(n,t,r,u){var c=this,f=c._sheet,e=i,s,h,l,a,v;return(!f.parent||f.parent._allowUserResize)&&(l=f._getSheetLayout(),n.rowViewportIndex<0&&n.colViewportIndex>=0&&f.colHeaderVisible?(e=c._getResizeColInfo(f,n,u,1,t),e||(e=c._getResizeRowInfo(f,n,u,1,r))):n.rowViewportIndex>=0&&n.colViewportIndex<0&&f.rowHeaderVisible?(e=c._getResizeRowInfo(f,n,u,2,r),e||(e=c._getResizeColInfo(f,n,u,2,t))):n.rowViewportIndex<0&&n.colViewportIndex<0?f._getLastVisualRow(2)===i&&o(r-l.colHeaderHeight)<=u?(a=f._getRowLayout(1),a&&a.length>0&&(s=a[a.length-1].row),s>=0&&(e={action:"sizeRow",index:s,sheetArea:2})):f._getLastVisualColumn(1)===i&&o(t-l.rowHeaderWidth)<=u&&(v=f._getColumnLayout(1),v&&v.length>0&&(h=v[v.length-1].col),h>=0&&(e={action:"sizeCol",index:h,sheetArea:1})):n.rowViewportIndex>=0&&n.colViewportIndex>=0&&(l.colHeaderHeight===0&&r<=u&&f.colHeaderVisible?(s=f.getRowCount(1)-1,s>=0&&(e={action:"sizeRow",index:s,sheetArea:1})):l.rowHeaderWidth===0&&t<=u&&f.rowHeaderVisible&&(h=f.getColumnCount(2)-1,h>=0&&(e={action:"sizeCol",index:h,sheetArea:2})))),e},at.prototype.getDragInfo=function(n,t,r){var o=this,f=i,s=n.rowViewportIndex,h=n.colViewportIndex,c,l,u,e;if(typeof s===b||s===i||typeof h===b||h===i||(c=o._sheet,l=c._getActiveSelectedRange(),l.row===-1&&l.col===-1))return f;if(s>=0&&h>=0&&c._selectionModel.length===1){if(o.inGrayArea(s,h,t,r))return f;u=c._getRangeRect(s,h,l);u.x-4<t&&t<u.x+4&&u.y<=r&&r<u.y+u.height&&(f={action:"drag",side:"left"});f||(e=o._sheet._dragFillIndicatorRect,e&&e.x<=t&&t<=e.x+e.width&&e.y<=r&&r<=e.y+e.height&&(f={action:"drag",side:"corner"}));f||u.x+u.width-4<t&&t<u.x+u.width+4&&u.y<=r&&r<u.y+u.height&&(f={action:"drag",side:"right"});f||u.y-4<r&&r<u.y+4&&u.x<=t&&t<u.x+u.width&&(f={action:"drag",side:"top"});f||u.y+u.height-4<r&&r<u.y+u.height+4&&u.x<=t&&t<u.x+u.width&&(f={action:"drag",side:"bottom"});f&&(t<u.x||t>u.x+u.width||r<u.y||r>u.y+u.height)&&(f.outside=!0)}return o._sheet.canUserDragDrop()||f&&f.side!=="corner"&&(f.side=i),o._sheet.canUserDragFill()||f&&f.side==="corner"&&(f.side=i),f},at.prototype.inGrayArea=function(n,t,i,r){var o=this._sheet,c=o._getSheetLayout(),u=c.viewportRect(1,1),f,s,e,h;if(t===1)if(f=o._getColumnLayout(t),f&&f.length>0){if(s=f[f.length-1],s.x+s.width<=i&&i<u.x+u.width)return!0}else if(u.contains(i,r))return!0;if(n===1)if(e=o._getRowLayout(n),e&&e.length>0){if(h=e[e.length-1],h.y+h.height<=r&&r<u.y+u.height)return!0}else if(u.contains(i,r))return!0;return!1},at.prototype.doMouseMove=function(n){var t=this._getCanvasOffset();this.doMouseMoveImp(n,n.pageX-t.left,n.pageY-t.top)},at.prototype.doMouseOut=function(n){var r=this._sheet,t=r._currentTarget,u;if(t&&t.cellTypeHitInfo){var f=t.row,e=t.col,o=r.getCellType(f,e,t.hitTestType);o.processMouseLeave(t.cellTypeHitInfo)}this.isWorking||(u={x:-1e4,y:-1e4,rowViewportIndex:i,colViewportIndex:i,row:-1,col:-1,resizeInfo:i,hitTestType:i},r._setHoverCell(u))},at.prototype._hoverShowComment=function(n){var t=this._sheet,i=-1,r=-1,u;if(n&&n.rowViewportIndex>=0&&n.colViewportIndex>=0&&(i=n.row,r=n.col),t.parent){if(i<0||r<0)return;u=t.getComment(i,r);t._commentManager&&t._commentManager.hoverShowComment(u)}},at.prototype.doMouseMoveImp=function(n,r,u){var f=this,h,e,s,o,a;if(f.mousePosition={e:n,x:r,y:u},h=f._sheet,f.isMouseDown&&(window.gcGlobal.activeElement||(window.gcGlobal.activeElement=h)),f.isMouseDown&&f.isWorking){f.isResizing?f.continueResizing():f.isDragDropping?f.continueDragDropping():f.isDraggingFill?f.continueDragFill():f.isFormulaRangeAppending?f.continueFormulaRangeAppending():f.isFormulaRangeMoving?f.continueFormulaRangeMoving():f.isFormulaRangeResizing?f.continueFormulaRangeResizing():f.isSelecting&&f.continueSelecting();return}if((e=h.hitTest(r,u),e)&&(t.features.comment&&f._hoverShowComment(e),s=h._getCanvas(),s)){if(o=h._currentTarget,a=!o||e.row!==o.row||e.col!==o.col||e.hitTestType!==o.hitTestType||e.resizeInfo&&!o.resizeInfo||!e.resizeInfo&&o.resizeInfo||e.resizeInfo&&e.resizeInfo.action!==o.resizeInfo.action||e.dragInfo&&!o.dragInfo||!e.dragInfo&&o.dragInfo||e.dragInfo&&e.dragInfo.action!==o.dragInfo.action,o&&a&&o.cellTypeHitInfo){var d=o.row,g=o.col,y=h.getCellType(d,g,o.hitTestType);y.processMouseLeave(o.cellTypeHitInfo)}var p=e.resizeInfo,v=e.dragInfo,c=e.formulaRangeHitInfo,l=e.cellTypeHitInfo,w=h._render;if(p)s.style.cursor=p.action==="sizeCol"?"w-resize":p.action==="sizeRow"?"n-resize":"default";else if(v&&v.action==="drag")v.side==="corner"?s.style.cursor="crosshair":v.side&&(s.style.cursor="move");else if(c){c.inBorder?s.style.cursor="move":c.inTopLeft?s.style.cursor="nw-resize":c.inTopRight?s.style.cursor="ne-resize":c.inBottomLeft?s.style.cursor="sw-resize":c.inBottomRight&&(s.style.cursor="se-resize");var nt=f.isFormulaRangeHoving,b=f._formulRangeHovingInfo,tt=b&&b.paramRange,k=c.paramRange;f.isFormulaRangeHoving=!0;f._formulRangeHovingInfo={paramRange:k};nt&&k.index===tt.index||w.paintFormulaTextBox()}else{if(l){var it=e.row,rt=e.col,y=h.getCellType(it,rt,e.hitTestType);l.sheet=h;a&&y.processMouseEnter(l);y.processMouseMove(l)}!a&&l&&l.isReservedLocation||(s.style.cursor="default");f.isFormulaRangeHoving&&(f.isFormulaRangeHoving=!1,f._formulRangeHovingInfo=i,w.paintFormulaTextBox())}h._setHoverCell(e)}},at.prototype.doMouseUp=function(n){var t=this,i=t._sheet,r;if(i.inCanvas||t.unhandleDocumentMouseMove(),r=t._getCanvasOffset(),i._isMouseDownInSheet)i._isMouseDownInSheet=!1;else return!0;return t.doMouseUpImp(n,n.pageX-r.left,n.pageY-r.top),!1},at.prototype.doMouseUpImp=function(n,i,r){var u=this,e=u._sheet,o=window.gcGlobal.activeElement,f;if(u.isMouseDown=!1,o&&o!==e&&o.endEdit&&(o.endEdit(),o.repaint()),u.isResizing)u.stopResizing();else if(u.isDragDropping)u.stopDragDrop();else if(u.isDraggingFill)u.endDragFill();else if(u.isFormulaRangeAppending)u.stopFormulaRangeAppending();else if(u.isFormulaRangeMoving)u.stopFormulaRangeMoving();else if(u.isFormulaRangeResizing)u.stopFormulaRangeResizing();else if(e._currentTarget){if(f=e._currentTarget,f.cellTypeHitInfo){var s=f.row,h=f.col,c=e.getCellType(s,h,f.hitTestType);f.cellTypeHitInfo.sheet||(f.cellTypeHitInfo.sheet=e);c.processMouseUp(f.cellTypeHitInfo)}f.cellTypeHitInfo&&f.cellTypeHitInfo.isReservedLocation||e._trigger(t.Events.CellClick,{sheet:e,sheetName:e._name,sheetArea:f.hitTestType,row:f.row,col:f.col})}window.gcGlobal.activeElement=e;u.stopSelecting();u.setMetaKeyState(n)},at.prototype.startEdit=function(n){var t=this._sheet,r=t._getCanvas(),i=this._getCanvasOffset();n.shiftKey||n.ctrlKey||t._doStartEdit(r,n.pageX-i.left,n.pageY-i.top)},at.prototype.doKeyDown=function(n){var r=this,i=r._sheet,o,s,h;if(i){var u=i.getActiveRowIndex(),f=i.getActiveColumnIndex(),e=i.getCellType(u,f),c={isEditing:i.isEditing(),sheet:i,row:u,col:f,sheetArea:3},l={sheet:i,row:u,col:f,sheetArea:3};if(e&&e.isReservedKey(n,c)){i.isEditing()||e.processKeyDown(n,l);return}if(o=i._formulaTextBox,o&&o.isReservedKey(n))return;if(s=i.parent&&i.parent._attachedFormulaTextBox,s&&s.isReservedKey(n))return}if(h=!i.isEditing()&&!n.ctrlKey&&!n.metaKey&&(n.keyCode===34||n.keyCode===33||n.keyCode===37||n.keyCode===39||n.keyCode===9||n.keyCode===13||n.keyCode===38||n.keyCode===40),i._isTouchMode&&(i._isTouchMode=!1,i._render.refreshTouchSelectionIndicator()),h){if(r._keyPressed){r._keyPressedCount<25&&r._keyPressedCount++;t.util.cancelDefault(n);return}r._keyPressed=!0;r._keyPressedCount=1;r._repeatKeyDown(n)}else r._keyDownImp(n)},at.prototype._getMouseDownResizeTooltipContent=function(){var u=this._sheet,f=u._currentTarget,n=f.resizeInfo,e,i,o,r;return n.action==="sizeRow"?(e=u._getAllRowLayout(n.sheetArea),n.index=this._getPrevVisualRowBeforeFindRow(n.index,n.sheetArea),i=e.findRow(n.index),i||(i=e.findRow(f.row)),t.SR.Tip_Height+i.height.toFixed(0)+t.SR.Tip_pixels):(o=u._getAllColumnLayout(n.sheetArea),n.index=this._getPrevVisualColBeforeFindCol(n.index,n.sheetArea),r=o.findCol(n.index),r||(r=o.findCol(f.col)),t.SR.Tip_Width+r.width.toFixed(0)+t.SR.Tip_pixels)},at.prototype._getMouseMoveResizeTooltipContent=function(n){return n.action==="sizeRow"?t.SR.Tip_Height+(n.movingY-n.startY).toFixed(0)+t.SR.Tip_pixels:t.SR.Tip_Width+(n.movingX-n.startX).toFixed(0)+t.SR.Tip_pixels},at.prototype._repeatKeyDown=function(n){var t=this;t._keyPressed&&(t._keyDownImp(n),t._keyPressed&&(t._repeatKeyDownTimeoutID=window.setTimeout(function(){t._repeatKeyDown(n)},500/t._keyPressedCount)))},at.prototype._startEditByKeyboard=function(){var n=this._sheet,r=n._getCanvas(),u,t;if(r){n._startEditByKeydown=!0;try{u=n.isEditing();n._startEditImp(r,n._activeRowIndex,n._activeColIndex,i,i,!0);!u&&n.isEditing()&&(t=n.getCellType(n._activeRowIndex,n._activeColIndex),!t._triggerButtonClicked||event.keyCode!==32||event.ctrlKey||event.shiftKey||event.altKey||t._triggerButtonClicked(n,n._activeRowIndex,n._activeColIndex),t._cancelDefaultKeydown&&t._cancelDefaultKeydown(event))}finally{n._startEditByKeydown=!1}}},at.prototype._keyDownImp=function(n){var u=this,r=u._sheet,o,f,s,e,h;(u.setMetaKeyState(n),n.keyCode===9&&t.util.cancelDefault(n),r.isEditing()||n.keyCode!==27||n.altKey||n.ctrlKey||n.shiftKey||!r._validationInputMessage||($(r._validationInputMessage).remove(),r._validationInputMessage=i),r.isEditing()||n.keyCode!==34&&n.keyCode!==33&&n.keyCode!==35&&n.keyCode!==36&&n.keyCode!==38&&n.keyCode!==40||t.util.cancelDefault(n),r.isEditing()||n.keyCode!==37&&n.keyCode!==39||t.util.cancelDefault(n),t.features.floatingObject&&r._processFloatingObjectsKeyMap(n))||t.features.comment&&r._processCommentKeyMap(n)||r._processKeyMap(n)||(o=n.keyCode===229||n.keyCode===0,u.allowEnterEditing(n)&&!o&&(f=r._formulaTextBox,f&&f.isAppending()&&f.stopAppending(),s=r.isEditing(),s||(e=t.Global.prototype.getUIElement(n.target),h=e&&e.getAttribute("gcUIElement")==="gcAttachedFormulaTextBox",h||u._startEditByKeyboard())))},at.prototype.doKeyUp=function(n){var i=this,t,e,o;if(i._keyPressed=!1,i._repeatKeyDownTimeoutID>0&&(window.clearTimeout(i._repeatKeyDownTimeoutID),i._repeatKeyDownTimeoutID=0),t=i._sheet,t){var r=t.getActiveRowIndex(),u=t.getActiveColumnIndex(),f=t.getCellType(r,u),s={isEditing:t.isEditing(),sheet:t,row:r,col:u,sheetArea:3},h={sheet:t,row:r,col:u,sheetArea:3};if(f&&f.isReservedKey(n,s)){t.isEditing()||f.processKeyUp(n,h);return}if(e=t._formulaTextBox,e&&e.isReservedKey(n))return;if(o=t.parent&&t.parent._attachedFormulaTextBox,o&&o.isReservedKey(n))return}i.setMetaKeyState(n)},at.prototype.doCompositionStart=function(){this._startEditByKeyboard()},at.prototype.allowEnterEditing=function(n){if(n.ctrlKey||n.altKey||n.metaKey)return!1;if(n.keyCode>=65&&n.keyCode<=90)return!0;else if(n.keyCode>=48&&n.keyCode<=57||n.keyCode>=96&&n.keyCode<=105)return!0;else if(n.keyCode>=186&&n.keyCode<=192)return!0;else if(n.keyCode>=220&&n.keyCode<=222||n.keyCode===219)return!0;else if(n.keyCode>=106&&n.keyCode<=111)return!0;else if(n.keyCode===32)return!0;else if(n.keyCode===61)return!0;else if(n.keyCode===173)return!0;else if(n.keyCode===229||n.keyCode===0)return!0;else if(n.keyCode===8)return!0;return!1},at.prototype.setMetaKeyState=function(n){var t=this,i=t._sheet,r;if(t.shift=n.shiftKey&&!n.ctrlKey,t.ctrl=n.ctrlKey&&!n.shiftKey,i._isNavigateInSelection=!1,n.keyCode===9&&(i._selectionModel.length>1?i._isNavigateInSelection=!0:(r=i._getActiveSelectedRange(),r&&i._selectionModel.length>0&&(i._isNavigateInSelection=!(i._activeRowIndex===r.row&&i._activeColIndex===r.col&&i._activeRowCount===r.rowCount&&i._activeColCount===r.colCount)))),t.isDragDropping===!0){var u=i._getActiveSelectedRange(),f=t._isDragInsert,e=t._isDragCopy;t._isDragInsert=u.row===-1||u.col===-1?n.shiftKey:!1;t._isDragCopy=n.ctrlKey;(f!==t._isDragInsert||e!==t._isDragCopy)&&i._render.refreshDragDropIndicator()}t.isShiftPressed=n.shiftKey;t.isControlPressed=n.ctrlKey},at.prototype.doMouseWheel=function(n,i){var r=this._sheet,o,u,f,s,c;if(n.ctrlKey){if(!r.parent||r.parent._allowUserZoom){var h=r._zoomFactor,e=r._zoomFactor-.05*i,l=new t.UndoRedo.ZoomUndoAction(r,e);r._doCommand(l);e=r._zoomFactor;h!==e&&r._trigger(t.Events.UserZooming,{sheet:r,sheetName:r._name,oldZoomFactor:h,newZoomFactor:e})}}else o=r._scrollTopRow,u=o,r.frozenRowCount>0&&(r._scrollTopRow===0&&i>0?u=r.frozenRowCount:i<0&&r._scrollTopRow===r.frozenRowCount-i&&(u=0)),i<0?(f=r._getScrollableRow(u+i,!0),u=f!=-1?f:u+i):i>0&&(f=r._getScrollableRow(u+i),u=f!=-1?f:u+i),u<r._getFirstPageTopRow()?u=r._getFirstPageTopRow():u>r._getLastVisualRow()&&(u=r._getLastVisualRow()),o!==u&&(this.vScrollTo(u),r._syncVScrollbarPosition(),r._trigger(t.Events.TopRowChanged,{sheet:r,sheetName:r._name,oldTopRow:o,newTopRow:u}));t.features.comment&&(s=this._getCanvasOffset(),c=r.hitTest(n.pageX-s.left,n.pageY-s.top),this._hoverShowComment(c))},at.prototype.updateEditingEditor=function(){var n=this._sheet,e,u;if(n.isEditing()){var t=n._activeRowIndex,i=n._activeColIndex,o=n.getCellType(t,i),f=n._editor,s=n.getActualStyle(t,i),r=n.getCellRect(t,i);r&&r.width>0&&r.height>0?(e={sheet:n,row:t,col:i,sheetArea:3},o.updateEditor(f,s,r,e)):$(f).css({top:-1e4,left:-1e4});u=n._formulaTextBox;u&&u.position()}},at.prototype.doVScroll=function(n){var t=this,i=t._sheet;t.scrolling=!0;t.newTop=n;t.newLeft=i._scrollLeftCol;t.scrollTimer||(t.scrollTimer=window.setInterval(function(){t._scrollView()},t.waittime))},at.prototype.doHScroll=function(n){var t=this,i=t._sheet;t.scrolling=!0;t.newLeft=n;t.newTop=i._scrollTopRow;t.scrollTimer||(t.scrollTimer=window.setInterval(function(){t._scrollView()},t.waittime))},at.prototype._scrollView=function(){var n=this,t;if(!n.scrolling){if(n.scrollTimer&&(window.clearInterval(n.scrollTimer),n.scrollTimer=i,t=n.newTop!==n._sheet._scrollTopRow,t)){var r=n._sheet.getViewportTopRow(1),e=n._sheet.getViewportBottomRow(1),f=u(0,r-60);f<n._sheet.getRowCount()&&n._loadData(f,2*e-r)}return}n.scrolling=!1;n._updateView()},at.prototype._showScrollTooltip=function(n,t){var i=this,r,u;n?(r=t.pageY,u=t.pageX-i.VSCROLLTOOLTIP_LEFT):(r=t.pageY-i.HSCROLLTOOLTIP_TOP,u=t.pageX-i.HSCROLLTOOLTIP_LEFT);i._showTooltip(i._getScrollTooltipContent(n),u,r,!0)},at.prototype._getScrollTooltipContent=function(n){var i=this._sheet;return n?t.SR.Tip_Row+(i._scrollTopRow+1):i.colHeaderAutoText===1?t.SR.Tip_Column+(i._scrollLeftCol+1):t.SR.Tip_Column+i._indexToLetters(i._scrollLeftCol+1)},at.prototype._loadData=function(n,t){var i=this;i._sheet.parent&&i._sheet.parent._host&&i._sheet.dataContext&&i._sheet.dataContext.read&&(i._dataContextLoadDelegate=function(n,t){return i._dataContextLoaded(n,t)},i.lastLoadedRowIndex=n)},at.prototype._dataContextLoaded=function(n,t){var r=n.data,u,f,i;if(r&&r.length>0){if(u=this._sheet,f=u.getDataSource(),f&&this.lastLoadedRowIndex===n.start)for(i=0;i<r.length;i++)f[n.start+i]=r[i];u.recalcAll();u.repaint()}},at.prototype.getElementById=function(n,t){var r,u;if(!n)return i;for(r=n.firstChild;r;){if(r.id===t||r.name===t)return r;if(u=this.getElementById(r,t),u)return u;r=r.nextSibling}return i},at.prototype._updateView=function(){var n=this,i=n._sheet,r,t;n.painting||(n.painting=!0,r=i.parent,t=0,r&&(t=r.showScrollTip()),n.newTop!==i._scrollTopRow?(n.vScrollTo(n.newTop),(t===2||t===3)&&n._refreshTooltip(n._getScrollTooltipContent(!0))):n.newLeft!==i._scrollLeftCol&&(n.hScrollTo(n.newLeft),(t===1||t===3)&&n._refreshTooltip(n._getScrollTooltipContent(!1))),n.painting=!1)},at.prototype.vScrollTo=function(n){var i=this._sheet,d=i._scrollTopRow,y,b,o,s,h,r,nt;if(n!==d&&(i._scrollTopRow=n,!i._paintSuspended&&!(i._layoutSuspended>0))){if(y=!1,t.util._useDoubleBuffer()){var p=i._bounds,c=i._getSheetLayout(),l=c.viewportY,f=c.viewportHeight,e=i._render,w=e._getCtx();if(n>d){if(s=i._getRowLayout(1),s&&s.length>0&&(b=s.findRow(n)),b){for(r=s.length-1,o=s[r];o.y+o.height>l+f;)r=r-1,o=s[r];if(o.row>n){y=!0;var g=2,u=p?p.x:c.x,k=b.y,a=c.width,v=o.y+o.height-b.y-g;e.copyScreen(u,k,a,v,u,l);i.invalidateLayout();e.paintBody(w,new t.Rect(u,l+v,a,f-v));e.paintAdornment(w,new t.Rect(u,l,a,f))}}}else{for(h=0,r=n;r<d&&h<f;r++)h+=i._getZoomRowHeight(r);if(h<f){y=!0;var g=2,u=p?p.x:c.x,k=l,a=c.width,v=f-h;i.getFrozenTrailingRowCount()>0&&(v-=1);e.copyScreen(u,k,a,v,u,k+h);i.invalidateLayout();e.paintBody(w,new t.Rect(u,k,a,h+g));e.paintAdornment(w,new t.Rect(u,l,a,f))}}}y||(i.invalidateLayout(),i.repaint());t.features.comment&&(nt=i._commentManager,nt.updateCommentsLayoutWhenSheetScroll());this.updateEditingEditor()}},at.prototype.hScrollTo=function(n){var i=this._sheet,d=i._scrollLeftCol,y,b,o,s,h,r,nt;if(n!==d&&(i._scrollLeftCol=n,!i._paintSuspended&&!(i._layoutSuspended>0))){if(y=!1,t.util._useDoubleBuffer()){var p=i._bounds,c=i._getSheetLayout(),l=c.viewportX,f=c.viewportWidth,e=i._render,w=e._getCtx();if(n>d){if(s=i._getColumnLayout(1),s&&s.length>0&&(b=s.findCol(n)),b){for(r=s.length-1,o=s[r];o.x+o.width>l+f;)r=r-1,o=s[r];if(o.col>n){y=!0;var g=2,k=b.x,u=p?p.y:c.y,v=o.x+o.width-b.x-g,a=c.height;e.copyScreen(k,u,v,a,l,u);i.invalidateLayout();e.paintBody(w,new t.Rect(l+v,u,f-v,a));e.paintAdornment(w,new t.Rect(l,u,f,a))}}}else{for(h=0,r=n;r<d&&h<f;r++)h+=i._getZoomColumnWidth(r);if(h<f){y=!0;var g=2,k=l,u=p?p.y:c.y,v=f-h,a=c.height;i.getFrozenTrailingColumnCount()>0&&(v-=1);e.copyScreen(k,u,v,a,k+h,u);i.invalidateLayout();e.paintBody(w,new t.Rect(k,u,h+g,a));e.paintAdornment(w,new t.Rect(l,u,f,a))}}}y||(i.invalidateLayout(),i.repaint());t.features.comment&&(nt=i._commentManager,nt.updateCommentsLayoutWhenSheetScroll());this.updateEditingEditor()}},at.prototype._notEqualSelecions=function(n,t){var f=!0,i,r,u;if(n.length===t.length)for(i=0;i<n.length;i++)if(r=n[i],u=t[i],r.row!==u.row||r.col!==u.col||r.rowCount!==u.rowCount||r.colCount!==u.colCount){f=!0;break}else f=!1;return f},at.prototype._createFocusHolder=function(n,t,u,f){var e=this,c=e._sheet,p={sheet:c,row:t,col:u,sheetArea:3},it=n.isImeAware(p),o,d,l,g;return f&&e._destroyFocusHolder(),it&&!e._cellTypeFocusHolder&&(o=n.createEditorElement(p),e._focusHolderOldCss||(e._focusHolderOldCss={overflow:ct,border:a}),e._focusHolderOldCss.overflow=o.style.overflow,e._focusHolderOldCss.border=o.style.border,$(o).css(s,h).css(y,k).css(nt,"0px").css(tt,"0px").css(v,a),c=e._sheet,c._setEditorValue(n,o,t,u,c.getActualStyle(t,u)),d=n.getEditorValue(o,p),$.browser.safari&&(d===""||d===i||typeof d===b)&&n.setEditorValue(o," ",p),r.body.insertBefore(o,i),e._cellTypeFocusHolder=o),e._originalFocusHolder||(o=r.createElement("div"),$(o).css(s,h).css(y,k).css(nt,"0px").css(tt,"0px"),e._originalFocusHolder=o,l=r.createElement("textarea"),$(l).attr(w,"gcSheetFocusInput").css(s,h).css(y,k).css(v,a).css(ht,a),l.value=" ",o.insertBefore(l,i),e._focusElem=l,g=r.createElement("textarea"),$(g).css(s,h).css(y,k).attr(w,"gcSheetFocusInput").attr("readonly","readonly"),o.insertBefore(g,i),e._readonlyFocusElem=g,r.body.insertBefore(o,i)),e._cellTypeFocusHolder&&e._setVisibleLocation(c,e._cellTypeFocusHolder),e._setVisibleLocation(c,e._originalFocusHolder),it?e._cellTypeFocusHolder:e._focusElem},at.prototype._resetFocusHolder=function(){var n=this;n._cellTypeFocusHolder&&n._focusHolderOldCss&&$(n._cellTypeFocusHolder).css(y,n._focusHolderOldCss.overflow).css(v,n._focusHolderOldCss.border)},at.prototype._destroyFocusHolder=function(){var n=this;n._cellTypeFocusHolder&&(n._cellTypeFocusHolder.parentElement&&n._cellTypeFocusHolder.parentElement.removeChild(n._cellTypeFocusHolder),n._cellTypeFocusHolder=i)},at.prototype.setFocus=function(){window.gcGlobal.activeElement||this._setFocusCore(!0,!0)},at.prototype.changeFocusHolder=function(){this._setFocusCore(!0,!0)},at.prototype._clearTouchSetFocusTimeout=function(){this._touchSetFocusTimeout&&(clearTimeout(this._touchSetFocusTimeout),this._touchSetFocusTimeout=i)},at.prototype._setFocusCore=function(n,i){var f,u,s,h,e,o,c,l;(!t.util._isSilverlightCanvas()||t.util._isStandardCanvas())&&(arguments.length===0&&(n=!0),f=this,f._focusReleased=!1,f._clearTouchSetFocusTimeout(),u=f._sheet,s=u.getActiveRowIndex(),h=u.getActiveColumnIndex(),e=u.getCellType(s,h),f._createFocusHolder(e,s,h,i),o={sheet:u,row:s,col:h,sheetArea:3},c=e.isImeAware(o)?f._cellTypeFocusHolder:f._focusElem,i&&!$.browser.msie&&e.setImeMode(c,u.getActualStyle(s,h).imeMode,o),r.body.focus(),l=function(){var n=function(){e.isImeAware(o)?(e.focus(c,o),e.selectAll(c,o)):(c.focus(),c.select())};n();i&&$.browser.msie&&(e.setImeMode(c,u.getActualStyle(s,h).imeMode,o),n())},u._isTouchMode&&(n||!e.isImeAware(o))?$.browser.metroMode?i&&e.setImeMode(f._cellTypeFocusHolder,u.getActualStyle(s,h).imeMode,o):f._touchSetFocusTimeout=setTimeout(function(){(f._clearTouchSetFocusTimeout(),u.isEditing())||l()},200):l(),window.gcGlobal.activeElement||(window.gcGlobal.activeElement=u),f._updateValidationUI(u._activeRowIndex,u._activeColIndex))},at.prototype._setVisibleLocation=function(n,t){var h=n.getActiveRowIndex(),a=n.getActiveColumnIndex(),v=n.activeRowViewportIndex,y=n.activeColViewportIndex,f=n.getCellRect(h,a,v,y),i,r,u=this,e;u._isInvalidRect(f)?(i=parseInt($(u._cellTypeFocusHolder).css(c),10),r=parseInt($(u._cellTypeFocusHolder).css(l),10)):(e=u._getCanvasOffset(),i=f.y+e.top-2,r=f.x+e.left-2);var o=window.pageYOffset,p=window.innerHeight+o-parseInt($(u._cellTypeFocusHolder).css(tt),10),s=window.pageXOffset,w=window.innerWidth+s-parseInt($(u._cellTypeFocusHolder).css(nt),10);(isNaN(i)||i<o||i>p)&&(i=o);(isNaN(r)||r<s||r>w)&&(r=s);$(t).css(c,i);$(t).css(l,r)},at.prototype.releaseFocus=function(n){var t=this,i,u,f,e,o,s;(t._clearTouchSetFocusTimeout(),t._focusReleased&&r.activeElement===t._readonlyFocusElem)||(i=t._sheet,n?(u=n.row,f=n.col,e=n.rowViewportIndex,o=n.colViewportIndex):(u=i._activeRowIndex,f=i._activeColIndex,e=i.activeRowViewportIndex,o=i.activeColViewportIndex),s=i.getCellType(u,f),t._createFocusHolder(s,u,f,!1),t._readonlyFocusElem.focus(),t._focusReleased=!0)},at.prototype.resumeFocus=function(n){var t=this;arguments.length===0&&(n=!0);t._focusReleased&&(t._focusReleased=!1,t._setFocusCore(n))},at.prototype._switchFocusForClipboard=function(n){var t=this;t._focusElem&&(t._focusElem.value=n,t._focusElem.focus(),t._focusElem.select(),t._clipboardFloatingObjectData=i)},at.prototype._switchBackFocusAfterClipboard=function(){this._setFocusCore(!0,!1)},at.prototype._setClipboardFloatingObjectData=function(n){this._clipboardFloatingObjectData=n},at.prototype._getClipboardFloatingObjectData=function(){return this._clipboardFloatingObjectData},at.prototype._getClipboardData=function(){var u=this._focusElem?this._focusElem.value:"",n=new t.StringBuilder,i,r;if(u){var o='"',f=o.length,e=!1;for(i=0;i<u.length;i++)r=u[i],e||r!=="\n"||(r="\r\n"),n.Append(r),n.Length()>=f&&o===n.ToString(n.Length()-f,f)&&(e=!e)}return n.ToString()},at.prototype._disposeFocusHolders=function(){var n=this,t;n._clearTouchSetFocusTimeout();t=n._cellTypeFocusHolder;t&&($(t).remove(),n._cellTypeFocusHolder=e);t=n._originalFocusHolder;t&&($(t).remove(),n._focusElem=e,n._originalFocusHolder=i,n._readonlyFocusElem=i)},at.prototype.bind=function(n,t,i){$(this._getElem()).bind(n,t,i)},at.prototype.unbind=function(n,t){$(this._getElem()).unbind(n,t)},at.prototype.trigger=function(n,t){this._eventSuspended===0&&$(this._getElem()).trigger(n,t)},at.prototype._showTooltip=function(n,t,i,u){var o=this._sheet,e=o.parent,f;e&&!e._tooltip&&(f=r.createElement("div"),e.useWijmoTheme?($(f).addClass("ui-widget-content"),$(f).addClass("ui-state-default")):$(f).addClass("spread-toolTip"),$(f).css(s,h).css(it,"0px 3px 0px 3px").css(d,"normal normal normal 10pt Arial").css(rt,"1px 2px 5px rgba(0,0,0,0.4)").css(ot,"3px").width(p).height(p).appendTo(r.body),e._tooltip=f);this._refreshTooltip(n,t,i,u)},at.prototype._refreshTooltip=function(n,t,r,u){var h=this._sheet,a=h.parent,f,s,o;a&&(f=$(a._tooltip),f&&(n===e||n===i||n===""?f.hide():(f.html(n),f.show()),s=this._getCanvasOffset(),u&&(r-=s.top,t-=s.left),o=h._bounds,r+f.outerHeight()>o.y+o.height&&(r=o.y+o.height-f.outerHeight()),t+f.outerWidth()>o.x+o.width&&(t=o.x+o.width-f.outerWidth()),r!==i&&r!==e&&f.css(c,r+s.top),t!==i&&t!==e&&f.css(l,t+s.left)))},at.prototype._removeTooltip=function(){var t=this._sheet,n=t.parent;n&&n._tooltip&&($(n._tooltip).remove(),n._tooltip=i)},at}();t._SheetEventHandler=at;vt=function(){function n(){var n=this;n.top=!1;n.bottom=!1;n.left=!1;n.right=!1;n.distanceX=0;n.distanceY=0;n.nearMouseX=0;n.nearMouseY=0}return n}()})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){(function(t){var s,f,c,l;t.feature("core.sheet_border",["core.common"]);var u="undefined",i=null,d=Math.sqrt,y=Math.pow,g=Math.min,e={first:1,second:2},o=function(){function n(){}return n.prototype.adjust=function(n){var t=this;n.orientation===0?(n.offsetEnd&&(t._x2+=n.offsetEnd),n.offsetStart&&(t._x1+=n.offsetStart)):n.orientation===1&&(n.offsetEnd&&(t._y2+=n.offsetEnd),n.offsetStart&&(t._y1+=n.offsetStart))},n.prototype.paint=function(n){var t=this._color||"#9eb6ce",i=this._lineWidth,r=n.lineWidth,u=n.strokeStyle;(r!==i||u!==t)&&(n.closePath(),n.stroke(),n.beginPath(),r!==i&&(n.lineWidth=i),u!==t&&(n.strokeStyle=t));this.paintLine(n)},n.prototype.paintLine=function(n){var t=this;n.moveTo(t._x1,t._y1);n.lineTo(t._x2,t._y2)},n.Create=function(n,t,r,e,o,h){(typeof h===u||h===i)&&(h=1);switch(h){case 1:return new s(n,t,r,e,o,1);case 2:return new s(n,t,r,e,o,2);case 5:return new s(n,t,r,e,o,3);case 3:return new f(n,t,r,e,o,1,[3,1]);case 9:return new f(n,t,r,e,o,1,[8,2,2,2]);case 4:return new f(n,t,r,e,o,1,[2,2]);case 11:return new f(n,t,r,e,o,1,[9,3,3,3,3,3]);case 13:return new c(n,t,r,e,o,n!==r,[11,1,5,1],[10,2,4,2]);case 10:return new f(n,t,r,e,o,2,[9,3,3,3]);case 12:return new f(n,t,r,e,o,2,[9,3,3,3,3,3]);case 8:return new f(n,t,r,e,o,2,[9,3]);case 7:return new f(n,t,r,e,o,1,[1]);case 6:return new l(n,t,r,e,o,n!==r)}return i},n}();t.Line=o;s=function(n){function t(t,i,r,u,f,e){var s,o;n.call(this);s=e%2;s||(t!==r?(i-=.5,u-=.5):(t-=.5,r-=.5));o=this;o._x1=t;o._y1=i;o._x2=r;o._y2=u;o._color=f;o._lineWidth=e}return __extends(t,n),t}(o);t.SolidLine=s;f=function(n){function t(t,i,r,u,f,e,o){var h,s;n.call(this);h=e%2;h||(t!==r?(i-=.5,u-=.5):(t-=.5,r-=.5));s=this;s._x1=t;s._y1=i;s._x2=r;s._y2=u;s._color=f;s._lineWidth=e;s._pattern=o}return __extends(t,n),t.prototype.paintLine=function(n){var i=this;t.render(n,i._x1,i._y1,i._x2,i._y2,i._pattern)},t.render=function(n,t,i,r,u,f){var e=d(y(r-t,2)+y(u-i,2)),c={x:(r-t)/e,y:(u-i)/e},s=0,l=0,o,h;for(f=f&&f.length?f:[4,4];s<e;)o=g(f[l++%f.length],e-s),h=l%2,s+=o,h&&n.moveTo(t,i),t+=o*c.x,i+=o*c.y,h&&n.lineTo(t,i)},t}(o);t.DashedLine=f;c=function(n){function t(t,i,r,u,f,e,o,s){n.call(this);e?(t-=1,r-=1):(i-=1,u-=1);var h=this;h._x1=t;h._y1=i;h._x2=r;h._y2=u;h._color=f;h._horizental=e;h._lineWidth=1;h._pattern1=o;h._pattern2=s}return __extends(t,n),t.prototype.paintLine=function(n){var t=this,i=t._horizental?0:1,r=t._horizental?1:0;f.render(n,t._x1-i,t._y1-r,t._x2-i,t._y2-r,t._pattern1);f.render(n,t._x1,t._y1,t._x2,t._y2,t._pattern2)},t}(o);t.SlantedLine=c;l=function(n){function t(t,i,r,u,f,e){n.call(this);var h=e?0:1,c=e?1:0,o=this;o._line1=new s(t-h,i-c,r-h,u-c,f,1);o._line2=new s(t+h,i+c,r+h,u+c,f,1);o._color=f;o._horizental=e;o._lineWidth=1}return __extends(t,n),t.prototype.paintLine=function(n){this._line1.paintLine(n);this._line2.paintLine(n)},t.prototype.adjust=function(n){var t=this;n.lineSide?n.lineSide===e.first?t._line1.adjust(n):n.lineSide===e.second&&t._line2.adjust(n):(t._line1.adjust(n),t._line2.adjust(n))},t}(o);t.DoubleLine=l;var nt=function(n,t){return 0},a=function(n,i){if(n){if(!i)return 1}else return i?-1:0;var r=t.LineBorder.prototype._weight(n),u=t.LineBorder.prototype._weight(i);return r===u?nt(n.color,i.color):r-u},r=function(n){if(n){if(n.isGridLine)return 1;if(n.style)return t.LineBorder.prototype.width(n.style)}return 0},v=function(n){return n&&n.style===6},p=function(n){return n&&n.style===13},h=function(){var n={previous:-1,next:1},s=function(n,t){if(n){if(!t)return n}else return t?t:i;return a(n.style,t.style)>0?n:t},f=function(n,t){n&&n.line&&n.line.adjust(t)},o=function(n,t){if(n===i||typeof n===u)return t===i||typeof t===u?0:-1;else if(t===i||typeof t===u)return 1;else{if(n.isGridLine)return t.isGridLine?0:-1;else if(t.isGridLine)return 1;return a(n.style,t.style)}},t=function(n){return n&&v(n.style)},h=function(n,i,r,u){if(!t(n)){var f=0;return f+=t(i)?1:0,f+=t(r)?1:0,f+=t(u)?1:0,f<2}return!0},l=function(t,i,r,u,s,h){var c={orientation:h?1:0,offsetStart:0,offsetEnd:0},l=o(t,r),a=o(t,u);l>=0&&a>=0?l===0&&a===0?s!==n.previous&&s===n.next&&(c.offsetEnd-=s):s===n.previous?c.offsetStart-=s:s===s.next&&(c.offsetEnd-=2*s):a>=0?(c.lineSide=e.second,c.offsetStart+=s):l>=0&&(c.lineSide=e.first,c.offsetStart+=s);f(t,c)},c=function(i,u,s,h,c,l,a,v,y){var w={orientation:v?1:0,lineSide:y?e.second:e.first,offsetStart:0,offsetEnd:0},p={orientation:v?1:0,lineSide:y?e.first:e.second,offsetStart:0,offsetEnd:0},tt=l===1?h:c,b=a===n.next?s:u,et=t(b),it,rt,ut,ft,g;et?(it=o(i,tt),it===0?(rt=o(i,b),rt===0?a===n.next&&(p.offsetEnd-=a):rt>0&&(a===n.previous?p.offsetStart-=2*a:a===n.next&&(p.offsetEnd-=2*a))):it>0?(ut=o(i,b),ut===0?a===n.next&&(p.offsetEnd-=a):ut>0&&(a===n.previous?p.offsetStart-=2*a:a===n.next&&(p.offsetEnd-=2*a))):(ft=o(i,b),ft===0?a===n.previous?w.offsetStart+=2*a:a===n.next&&(w.offsetEnd+=2*a):ft>0&&(a===n.previous?w.offsetStart-=3*a:a===n.next&&(w.offsetEnd-=3*a)))):o(i,tt)>=0?a===n.previous?p.offsetStart-=2*a:a===n.next&&(p.offsetEnd-=2*a):a===n.previous?w.offsetStart+=2*a:a===n.next&&(w.offsetEnd+=2*a);var ot=l===1?2:1,d=ot===1?h:c,nt=!1,k=0;!nt&&t(d)&&o(d,i)>0&&(nt=!0,g=r(d),o(d,tt)>0?g>0&&(k=a===n.next&&t(s)?g>=2?2:1:a===n.previous&&t(u)?g>=3?2:1:g===3?3:2):k=g===3?3:2);nt||t(b)||(!b||b.isGridLine)&&(!d||d.isGridLine)||(nt=!0,k=a===n.previous?2:1);nt&&(a===n.previous?(w.offsetStart+=a*k,p.offsetStart+=a*k):a===n.next&&(w.offsetEnd+=a*k,p.offsetEnd+=a*k));(w.offsetStart||w.offsetEnd)&&f(i,w);(p.offsetStart||p.offsetEnd)&&f(i,p)},y=function(i,r,u,e,s,h){if(o(i,u)>=0&&o(i,e)>=0){var c={orientation:h?1:0,offsetStart:0,offsetEnd:0};s===n.previous?(c.offsetStart-=2*s,t(i)&&o(r,i)>0&&(c.offsetStart-=1)):s===n.next&&(c.offsetEnd-=2*s,t(i)&&o(r,i)>0&&(c.offsetEnd+=1));f(i,c)}},p=function(i,u,e,o,h,c){var a,v,l;t(i)&&(a=s(e,o),a&&!a.isGridLine&&(v=r(a),v>0&&(l={orientation:c?1:0,offsetStart:0,offsetEnd:0},h===n.previous?l.offsetStart+=v*h:l.offsetEnd+=v*h,(l.offsetStart||l.offsetEnd)&&f(i,l))))};return{calcLayoutHorizontal:function(n,i,u,e,c,l,a){var v,y,p,w;(i||u||e)&&(p=s(u,e),h(n,i,u,e)?(y=o(p,n))>0?(v=r(p),t(n)&&(t(u)||t(e)||t(i))||v===3&&f(n,{orientation:0,offsetStart:1})):p&&y<0?(y=o(n,i))>0?(v=r(p),v===3||v===2?f(n,{orientation:0,offsetStart:-2}):v===1&&f(n,{orientation:0,offsetStart:-1})):y!==0&&o(i,p)>0&&(v=r(p),v===3&&f(n,{orientation:0,offsetStart:1})):y===0&&(!i||o(n,i)>0)&&(v=r(p),v===3||v===2?f(n,{orientation:0,offsetStart:-2}):v===1&&f(n,{orientation:0,offsetStart:-1})):f(n,{orientation:0,offsetStart:1}));(c||l||a)&&(w=s(l,a),h(n,c,l,a)?(y=o(w,n))>0?(v=r(w),t(n)&&(t(l)||t(a)||t(c))||(v===3?f(n,{orientation:0,offsetEnd:-2}):(v===2||v===1)&&f(n,{orientation:0,offsetEnd:-1}))):y<0?(y=o(n,c))>0?(v=r(w),v===3&&f(n,{orientation:0,offsetEnd:1})):y!==0&&f(n,{orientation:0,offsetEnd:-1}):y===0&&((y=o(n,c))>0?(v=r(w),v===3&&f(n,{orientation:0,offsetEnd:1})):y!==0&&f(n,{orientation:0,offsetEnd:-1})):f(n,{orientation:0,offsetEnd:-2}))},calcLayoutVertical:function(n,u,e,c,l,a,v){var y,p,w,b;(u||e||c)&&(w=s(e,c),h(n,u,e,c)?(p=o(w,n))>0?(y=r(w),t(n)&&(t(e)||t(c)||t(u))||y===3&&f(n,{orientation:1,offsetStart:1})):p<0?(p=o(n,u))>0?(y=r(w),y===3||y===2?f(n,{orientation:1,offsetStart:-2}):y===1&&f(n,{orientation:1,offsetStart:-1})):p!==0&&o(u,w)>0&&(y=r(w),y===3&&f(n,{orientation:1,offsetStart:1})):p===0&&o(n,u)>0&&(y=r(w),y===3||y===2?f(n,{orientation:1,offsetStart:-2}):y===1&&f(n,{orientation:1,offsetStart:-1})):f(n,{orientation:1,offsetStart:1}));(l||a||v)&&(b=s(a,v),h(n,l,a,v)?(p=o(n,b))<0?(y=r(b),t(n)&&(t(a)||t(v)||t(l))||(y===3||y===2?f(n,{orientation:1,offsetEnd:-2}):y===1&&f(n,{orientation:1,offsetEnd:-1}))):b!==i&&p>0?(p=o(n,l))>0?(y=r(b),y===3&&f(n,{orientation:1,offsetEnd:1})):p!==0&&f(n,{orientation:1,offsetEnd:-1}):p===0&&((p=o(n,l))>0?(y=r(b),y===3&&f(n,{orientation:1,offsetEnd:1})):p!==0&&f(n,{orientation:1,offsetEnd:-1})):f(n,{orientation:1,offsetEnd:-2}))},calcDoubleLayout:function(i,r,u,f,e,o,s,h){var w;h?this.calcLayoutVertical(i,r,u,f,e,o,s):this.calcLayoutHorizontal(i,r,u,f,e,o,s);var a=t(u),v=t(f),b=t(r);a&&v&&b?l(i,r,u,f,n.previous,h):a&&!v?c(i,r,e,u,f,1,n.previous,h,!0):!a&&v?c(i,r,e,u,f,2,n.previous,h,!1):a&&v&&!b?y(i,r,u,f,n.previous,h):b&&p(i,r,u,f,n.previous,h);a=t(o);v=t(s);w=t(e);a&&v&&w?l(i,e,o,s,n.next,h):a&&!v?c(i,r,e,o,s,1,n.next,h,!0):!a&&v?c(i,r,e,o,s,2,n.next,h,!1):a&&v&&!w?y(i,e,o,s,n.next,h):w&&p(i,e,o,s,n.next,h)}}}(),w={layoutHorizontal:function(n,t,i,r,u,f,e){h.calcLayoutHorizontal(n,t,i,r,u,f,e)},layoutVertical:function(n,t,i,r,u,f,e){h.calcLayoutVertical(n,t,i,r,u,f,e)}},b={layoutHorizontal:function(n,t,i,r,u,f,e){h.calcDoubleLayout(n,t,i,r,u,f,e,!1)},layoutVertical:function(n,t,i,r,u,f,e){h.calcDoubleLayout(n,t,i,r,u,f,e,!0)}},k={layoutHorizontal:function(n,t,i,r,u,f,e){},layoutVertical:function(n,t,i,r,u,f,e){}},tt=function(){function t(n,t,i,r){this._isInitialized=!1;this._isMerged=!1;var u=this;u._sheet=n;u._sheetArea=r;u._rowViewportIndex=t;u._colViewportIndex=i}return t.prototype._initialize=function(){var n=this,h,c,f,r,l,a,e,u;n._spanCells=[];n._rowIndecies=[];n._colIndecies=[];n._overflowedCells=[];n._adjustingRanges=[];n._hGridLine={};n._vGridLine={};n._hBorders={};n._vBorders={};var o=n._sheet,s=n._sheetArea,v=n._colViewportIndex,y=n._rowViewportIndex,t=o._getRowLayout(y,s),i=o._getColumnLayout(v,s);if(t&&t.length>0&&i&&i.length>0){for(h=n._rowIndecies,c=t.length,r=0;r<c;r++)f=t[r],f.height>0&&h.push(f.row);for(l=n._colIndecies,a=i.length,u=0;u<a;u++)e=i[u],e.width>0&&l.push(e.col)}n._isInitialized=!0},t.prototype.addCellOverlfowLayout=function(n,t){if(t){var i={row:n,startCol:t.startColumn,endCol:t.endColumn};this._overflowedCells.push(i)}},t.prototype.addCellLines=function(n,t,i,r,u,f,e,o){var s=this,h,c,l,a,v;s._isInitialized||s._initialize();o?s._spanCells.push(o):(e&&(h=e.borderLeft,c=e.borderTop,l=e.borderRight,a=e.borderBottom,v=e.backColor),!v||h||l||c||a||s._adjustingRanges.push({r:n,c:t,rc:1,cc:1}),s._addCellLineImp(n,t,i,r,u,f,h,c,l,a,v))},t.prototype._addCellLineImp=function(n,t,i,r,f,e,o,s,h,c,l,a,v){var y=this,k=!1,d=!1,g=!1,nt=!1,p,w,b;s&&(k=y._addCellLineSide(n,t,i,r-.5,i+f,r-.5,s,y._hBorders));o&&(d=y._addCellLineSide(n,t,i-.5,r,i-.5,r+e,o,y._vBorders));c&&(g=y._addCellLineSide(n+1,t,i,r+e-.5,i+f,r+e-.5,c,y._hBorders));h&&(nt=y._addCellLineSide(n,t+1,i+f-.5,r,i+f-.5,r+e,h,y._vBorders));p=y._sheet;l&&p.getRowHeight(n)!==0&&p.getColumnWidth(t)!==0||(w=!g&&!a,b=!nt&&!v,(w||b)&&y._addGridLine(n,t,i,r,f,e,w,b));(k||typeof l!==u)&&y._removeLineItem(n-1,t,y._hGridLine);(d||typeof l!==u)&&y._removeLineItem(n,t-1,y._vGridLine);!l||o||h||s||c||(y._adjustLineItem(n-1,t-1,y._vGridLine,!1),y._adjustLineItem(n-1,t-1,y._hGridLine,!0))},t.prototype._addCellLineSide=function(n,t,r,u,f,e,s,h){if(s){var c,l=this._queryLineItem(n,t,h,!0);return l.success?(c=l.lineItem,c.style.style!==6&&(s.style===6||a(s,c.style)>0)&&(c.line=o.Create(r,u,f,e,s.color,s.style),c.style=s)):(c=this._queryLineItem(n,t,h).lineItem,c.line=o.Create(r,u,f,e,s.color,s.style),c.style=s),c.line!==i}return!1},t.prototype._addGridLine=function(t,i,r,u,f,e,o,s){var h=this,w=n.spread,c=h._sheetArea===3,l=h._sheet.gridline,p=w.Line,a,v,y;(!c||l)&&(a=c?l.color:"#9eb6ce",o&&(l.showHorizontalGridline||!c)&&(v=h._queryLineItem(t,i,h._hGridLine).lineItem,v.isGridLine=!0,v.line=p.Create(r,u+e-.5,r+f,u+e-.5,a)),s&&(l.showVerticalGridline||!c)&&(y=h._queryLineItem(t,i,h._vGridLine).lineItem,y.isGridLine=!0,y.line=p.Create(r+f-.5,u,r+f-.5,u+e,a)))},t.prototype._adjustLineItem=function(n,t,i,r){var f=this._queryLineItem(n,t,i,!0),u;f.success&&(u=f.lineItem,u&&u.line&&u.line.adjust({orientation:r?0:1,offsetEnd:-1}))},t.prototype._removeLineItem=function(n,t,i){var r,u;n>=0&&t>=0&&(r=i[n],r&&(u=r[t],u&&delete r[t]))},t.prototype._queryLineItem=function(n,t,i,r){var u,f;if(n===-1||t===-1)return{success:!1};if(u=i[n],!u){if(r)return{success:!1};i[n]=u={}}if(f=u[t],!f){if(r)return{success:!1};u[t]=f={}}return{success:!0,lineItem:f}},t.prototype._processOverflowCells=function(){for(var t,n=this,e=n._overflowedCells,h=e.length,o=n._vBorders,s=n._vGridLine,u=0;u<h;u++){var f=e[u],i=f.row,c=f.startCol,l=f.endCol,r;for(t=c;t<l;t++)r=n._queryLineItem(i,t+1,o,!0),r.success?n._removeLineItem(i,t+1,o):(r=n._queryLineItem(i,t,s,!0),r.success&&n._removeLineItem(i,t,s))}},t.prototype._processSpans=function(){var t=this._spanCells,i=t.length,r,n;if(i>0)for(n=0;n<i;n++)r=t[n],this._processSpanCell(r)},t.prototype._processSpanCell=function(n){var t=this,d=n.row,g=n.col,it=n.x,ut=n.y,a,v,y,p,rt=t._sheet.getActualStyle(d,g,t._sheetArea),l=rt?rt.backColor:i,o,r,u,f,e,w,nt,b,tt,s,h=it,c=ut,k;if(n.rowCount===1)for(r=d,f=t._sheet._getZoomRowHeight(r,t._sheetArea),o=0;o<n.colCount;o++)w=o===0,b=o===n.colCount-1,u=g+o,e=t._sheet._getZoomColumnWidth(u,t._sheetArea),s=t._sheet.getActualStyle(r,u,t._sheetArea),s?(a=s.borderLeft,v=s.borderTop,y=s.borderRight,p=s.borderBottom):a=v=y=p=i,w?t._addCellLineImp(r,u,h,c,e,f,a,v,i,p,l,!1,!0):b?t._addCellLineImp(r,u,h,c,e,f,i,v,y,p,l):t._addCellLineImp(r,u,h,c,e,f,i,v,i,p,l,!1,!0),h+=e;else if(n.colCount===1)for(u=g,e=t._sheet._getZoomColumnWidth(u,t._sheetArea),o=0;o<n.rowCount;o++)nt=o===0,tt=o===n.rowCount-1,r=d+o,f=t._sheet._getZoomRowHeight(r,t._sheetArea),s=t._sheet.getActualStyle(r,u,t._sheetArea),s?(a=s.borderLeft,v=s.borderTop,y=s.borderRight,p=s.borderBottom):a=v=y=p=i,nt?t._addCellLineImp(r,u,h,c,e,f,a,v,y,i,l,!0,!1):tt?t._addCellLineImp(r,u,h,c,e,f,a,i,y,p,l):t._addCellLineImp(r,u,h,c,e,f,a,i,y,i,l,!0,!1),c+=f;else for(o=0;o<n.rowCount;o++){for(r=d+o,nt=o===0,tt=o===n.rowCount-1,f=t._sheet._getZoomRowHeight(r,t._sheetArea),k=0;k<n.colCount;k++)u=g+k,w=k===0,b=k===n.colCount-1,e=t._sheet._getZoomColumnWidth(u,t._sheetArea),s=t._sheet.getActualStyle(r,u,t._sheetArea),s?(a=s.borderLeft,v=s.borderTop,y=s.borderRight,p=s.borderBottom):a=v=y=p=i,nt?w?t._addCellLineImp(r,u,h,c,e,f,a,v,i,i,l,!0,!0):b?t._addCellLineImp(r,u,h,c,e,f,i,v,y,i,l,!0,!1):t._addCellLineImp(r,u,h,c,e,f,i,v,i,i,l,!0,!0):tt?w?t._addCellLineImp(r,u,h,c,e,f,a,i,i,p,l,!1,!0):b?t._addCellLineImp(r,u,h,c,e,f,i,i,y,p,l):t._addCellLineImp(r,u,h,c,e,f,i,i,i,p,l,!1,!0):w?t._addCellLineImp(r,u,h,c,e,f,a,i,i,i,l,!0,!0):b&&t._addCellLineImp(r,u,h,c,e,f,i,i,y,i,l,!0,!1),h+=e;h=it;c+=f}!l||a||y||v||p||t._adjustingRanges.push({r:d,c:g,rc:n.rowCount,cc:n.colCount})},t.prototype._adjust=function(){var n=this,t=!1,i=!1,r,u;for(r in n._vBorders){t=!0;break}for(u in n._hBorders){i=!0;break}(t||i)&&n._adjustBorders();n._adjustingRanges.length>0&&n._adjustGridlines()},t.prototype._adjustGridlines=function(){for(var f,e,o,n,i=this,s=i._adjustingRanges,a=s.length,h=0;h<a;h++){var t=s[h],r=t.r,u=t.c,c=r,v=r-1,y=u-1,l=u;for(t.rc>1&&(c+=t.rc-1),t.cc>1&&(l+=t.cc-1),f=!1,e=!1,o=0;o<a;o++){if(n=s[o],n.c===l+1&&n.r===r&&(e=!0),n.r===c+1&&n.c===u&&(f=!0),f&&e)break;if(n.r>r+1&&n.c>u+1)break}f||i._adjustLineItem(c,y,i._hGridLine,!0);e||i._adjustLineItem(v,l,i._vGridLine,!1)}},t.prototype._adjustBorders=function(){for(var o=this,f=o._rowIndecies,e=o._colIndecies,s=f.length,h=e.length,t,i,r,n=0;n<=s;n++)for(i=f[n],typeof i===u&&n===s&&(i=f[n-1]+1),t=0;t<=h;t++)r=e[t],typeof r===u&&t===h&&(r=e[t-1]+1),o._adjustHorizontalBorderLine(n,t,i,r);for(t=0;t<=h;t++)for(r=e[t],typeof r===u&&t===h&&(r=e[t-1]+1),n=0;n<=s;n++)i=f[n],typeof i===u&&n===s&&(i=f[n-1]+1),o._adjustVerticalBorderLine(n,t,i,r)},t.prototype._adjustHorizontalBorderLine=function(n,t,i,r){var u=this,a,e,o,s,h,c,l,y=u._queryLineItem(i,r,u._hBorders,!0),f=0;if(y.success)f++;else if(y=u._queryLineItem(i-1,r,u._hGridLine,!0),!y.success)return;a=y.lineItem;e=u._getLineItemImp(i,u._prevCol(t),!1);e&&e.line&&!e.isGridLine&&f++;o=u._getLineItemImp(u._prevRow(n),r,!0);o&&o.line&&!o.isGridLine&&f++;s=u._getLineItemImp(i,r,!0);s&&s.line&&!s.isGridLine&&f++;h=u._getLineItemImp(i,u._nextCol(t),!1);h&&h.line&&!h.isGridLine&&f++;c=u._getLineItemImp(u._prevRow(n),u._nextCol(t),!0);c&&c.line&&!c.isGridLine&&f++;l=u._getLineItemImp(i,u._nextCol(t),!0);l&&l.line&&!l.isGridLine&&f++;f>0&&(v(a.style)?b.layoutHorizontal(a,e,o,s,h,c,l):p(a.style)?k.layoutHorizontal(a,e,o,s,h,c,l):w.layoutHorizontal(a,e,o,s,h,c,l))},t.prototype._adjustVerticalBorderLine=function(n,t,i,r){var u=this,a,e,o,s,h,c,l,y=u._queryLineItem(i,r,u._vBorders,!0),f=0;if(y.success)f++;else if(y=u._queryLineItem(i,r-1,u._vGridLine,!0),!y.success)return;a=y.lineItem;e=u._getLineItemImp(u._prevRow(n),r,!0);e&&e.line&&!e.isGridLine&&f++;o=u._getLineItemImp(i,u._prevCol(t),!1);o&&o.line&&!o.isGridLine&&f++;s=u._getLineItemImp(i,r,!1);s&&s.line&&!s.isGridLine&&f++;h=u._getLineItemImp(u._nextRow(n),r,!0);h&&h.line&&!h.isGridLine&&f++;c=u._getLineItemImp(u._nextRow(n),u._prevCol(t),!1);c&&c.line&&!c.isGridLine&&f++;l=u._getLineItemImp(u._nextRow(n),r,!1);l&&l.line&&!l.isGridLine&&f++;f>0&&(v(a.style)?b.layoutVertical(a,e,o,s,h,c,l):p(a.style)?k.layoutVertical(a,e,o,s,h,c,l):w.layoutVertical(a,e,o,s,h,c,l))},t.prototype._prevCol=function(n){return n<0?-1:this._colIndecies[n-1]},t.prototype._nextCol=function(n){var t=this._colIndecies,i=t.length,r=t[n+1];return typeof r===u&&n+1>=i?t[i-1]+1:r},t.prototype._prevRow=function(n){return n<0?-1:this._rowIndecies[n-1]},t.prototype._nextRow=function(n){var t=this._rowIndecies,i=t.length,r=t[n+1];return typeof r===u&&n+1>=i?t[i-1]+1:r},t.prototype._getLineItemImp=function(n,t,r){if(typeof n===u||n<0||typeof t===u||t<0)return i;var f=this,o=r?f._vBorders:f._hBorders,e=f._queryLineItem(n,t,o,!0);if(e.success)return e.lineItem;if(o=r?f._vGridLine:f._hGridLine,r){if(--t<0)return i}else if(--n<0)return i;return(e=f._queryLineItem(n,t,o,!0),e.success)?e.lineItem:i},t.prototype.paint=function(n,t){var i=this;i._isInitialized&&(i._isMerged||(i._processSpans(),i._processOverflowCells(),i._adjust(),i._isMerged=!0),n.save(),n.beginPath(),i._paint(n,t),n.closePath(),n.stroke(),n.restore())},t.prototype._paint=function(n,t){this._paintGridLine(n);this._paintBorderLines(n)},t.prototype._paintGridLine=function(n){var t=this;t._paintLines(n,t._hGridLine);t._paintLines(n,t._vGridLine)},t.prototype._paintBorderLines=function(n){var t=this;t._paintLines(n,t._hBorders);t._paintLines(n,t._vBorders)},t.prototype._paintLines=function(n,t){var i,r,u,f,e;if(t)for(f in t)if(i=t[f],i)for(e in i)r=i[e],u=r&&r.line,u&&u.paint(n)},t}();t._GcBorders=tt})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(n){var o,s;n.feature("core.sheet_render",["core.common","core.sheet_border","core.sheet_action","core.sheet_model","core.imageLoader"]);var t=null,u=Math.min,i=Math.max,f=Math.abs,h=Math.PI,r="undefined",e=window.document,c=function(){function s(n){this.ctx=t;this.buffer=t;this.bufferCtx=t;this._rowGroups=t;this._columnGroups=t;this._floatingObjectRenderManager=t;this._existTouchDragFillIndicator=!1;this._showTouchSelectionIndicator=!0;this._init(n)}return s.prototype._init=function(n){this._sheet=n},s.prototype._getCtx=function(){var i=this,u,r;if(i.ctx=t,u=i._sheet,r=u._getCanvas(),r){if(!r.getContext&&n.util._isSilverlightCanvas()&&!r.getContext)return;r.getContext&&(i.ctx=r.getContext("2d"))}return i.ctx&&(i.ctx.name="userContext"),i.ctx},s.prototype._getBufferCtx=function(){var t=this,u=t._sheet,r=u._bounds,i=t.buffer;if(i&&i.width===r.width&&i.height===r.height||(t.buffer=i=e.createElement("canvas"),i.width=r.width,i.height=r.height),i.getContext)t.bufferCtx=i.getContext("2d");else if(n.util._isSilverlightCanvas())if(i.getContext)t.bufferCtx=i.getContext("2d");else return;return t.bufferCtx&&(t.bufferCtx.beginPath(),t.bufferCtx.font=t._getZoomFont(t._getDefaultFont()),t.bufferCtx.name="bufferContext"),t.bufferCtx},s.prototype._getDefaultFont=function(n){return n===3||typeof n===r||n===t?"10pt Arial":"11pt "+this._sheet.currentTheme().bodyFont()},s.prototype._getDefaultBackground=function(){return"white"},s.prototype._getSpreadBackColor=function(){var r=this._sheet,i=r.parent,e=i?i._backColor:this._getDefaultBackground(),u=n._ThemeContext.getColor(r,e),f=i?i._backgroundImage:t;return f&&f!==""&&(u="transparent"),u},s.prototype._getGrayAreaBackColor=function(i){var e=this._sheet,r=e.parent,o=r?r._grayAreaBackColor:"gray",u=this._getThemeContentBackgroundColor(n._ThemeContext.getColor(e,o)),f;return i?(f=r?r._backgroundImage:t,f&&f!==""&&(u="transparent"),u):u},s.prototype._getZoomFont=function(t){var r=this._sheet,i=r._zoomFactor;return i===1?t:n.StyleHelper._scaleFont(t,i).font},s.prototype.copyDoubleBuffer=function(n,t,i,r,u){var e,o,f,s,h;i<=0||r<=0||(e=this.buffer,o=this._getCtx(),e&&o)&&(u||(u=this._sheet._bounds),f=u.getIntersect(n,t,i,r),f)&&(n=f.x,t=f.y,i=f.width,r=f.height,s=e.width,s&&n+i>s&&(i=s-n),h=e.height,h&&t+r>h&&(r=h-t),$.browser.qtMode&&(n>0&&i--,t>0&&r--),o.clearRect(n,t,i,r),o.drawImage(e,n,t,i,r,n,t,i,r))},s.prototype.copyDoubleBufferRect=function(n,t){n&&this.copyDoubleBuffer(n.x,n.y,n.width,n.height,t)},s.prototype.copyScreen=function(n,t,i,r,u,f){try{var e=this,h=e._sheet,o=e._getCtx(),c=h._getCanvas(),s=e._getBufferCtx(),l=e.buffer;o.clearRect(u,f,i,r);o.drawImage(l,n,t,i,r,u,f,i,r);s.clearRect(u,f,i,r);s.drawImage(c,u,f,i,r,u,f,i,r)}catch(a){}},s.prototype.repaintSelection=function(t,r,f){var l=this,a,v,h,o,c;f||(f=l._getCtx());var d=!1,s=l._sheet,e=new n.Range(-1,-1,-1,-1),y=s._isNavigateInSelection;if(t&&(e=s._allowCellOverflow?new n.Range(t.row,0,t.rowCount,s.getColumnCount()):new n.Range(t.row,t.col,t.rowCount,t.colCount),!y)){if(e.col>=0){var p=e.col,b=e.col+e.colCount-1,g=s.getRowCount(1);for(a=0;a<g;a++)h=s._colHeaderSpanModel.find(a,e.col),h&&(p=u(h.col,p)),h=s._colHeaderSpanModel.find(a,e.col+e.colCount-1),h&&(b=i(h.col+h.colCount-1,b));e.col=p;e.colCount=b-p+1}if(e.row>=0){var w=e.row,k=e.row+e.rowCount-1,nt=s.getColumnCount(2);for(v=0;v<nt;v++)h=s._rowHeaderSpanModel.find(e.row,v),h&&(w=u(h.row,w)),h=s._rowHeaderSpanModel.find(e.row+e.rowCount-1,v),h&&(k=i(h.row+h.rowCount-1,k));e.row=w;e.rowCount=k-w+1}}if(o=s._getRangeRect2(e),o.width>=0&&o.height>=0){if(o.x-=9,o.y-=9,o.width+=18,o.height+=30,r&&(o=o.getIntersectRect(r),!o))return;l.paint(f,o);c=s._getSheetLayout();o.height>0&&!y&&(s._dirty=!0,l.paint(f,new n.Rect(c.x,i(c.frozenY,o.y),c.rowHeaderWidth,o.height)));o.width>0&&!y&&(s._dirty=!0,l.paint(f,new n.Rect(i(c.frozenX,o.x),c.y,o.width,c.colHeaderHeight)));e.row!==-1||e.col!==-1||y||(s._dirty=!0,l.paint(f,c.headerCornerRect()));d=!0}return d},s.prototype.update=function(t,i,r,u,f){var o=this._sheet,e;o._layoutSuspended>0||(e=this._getCtx(),e&&(f||(o._dirty=!0),this.paint(e,new n.Rect(t,i,r,u))))},s.prototype.repaint=function(n){var i=this._sheet,t;i._layoutSuspended>0||(t=this._getCtx(),t&&(i._dirty=!0,this.paint(t,n)))},s.prototype.paint=function(n,t){var i=this._sheet;!n||i._layoutSuspended>0||(this.paintBody(n,t),this.paintAdornment(n,t))},s.prototype.paintBody=function(t,i){var e=this,o=e._sheet,u,r,f;!t||o._layoutSuspended>0||(u=n.util._useDoubleBuffer(),r=u?e._getBufferCtx():t,r||(u=!1,r=t),f=o._bounds,i||(i=f),o._dirty&&(o._dirty=!1,u&&(r.clearRect(i.x,i.y,i.width,i.height),r.translate(-f.x,-f.y)),e.paintSheet(r,i),u&&r.translate(f.x,f.y)),u&&e.copyDoubleBufferRect(i))},s.prototype.paintAdornment=function(n,t){var f=this,e=f._sheet,h=e._isTouchMode,o,i,s,r,u,c;if(n&&!e._paintSuspended&&!(e._layoutSuspended>0)){if(o=e._getSheetLayout(),!e._hoverCell){if(h){for(r=0;r<=2;r++)(i=o.rowHeaderRect(r),i&&i.width!==0&&i.height!==0)&&f.copyDoubleBufferRect(i);for(u=0;u<=2;u++)(i=o.colHeaderRect(u),i&&i.width!==0&&i.height!==0)&&f.copyDoubleBufferRect(i)}for(r=0;r<=2;r++)for(u=0;u<=2;u++)(i=o.viewportRect(r,u),i&&i.width!==0&&i.height!==0)&&(s=t,h&&(r!==1||u!==1)&&(f.copyDoubleBufferRect(i),s=i),(!s||i.intersectRect(s))&&f.paintSelection(n,r,u,s));if(f.paintResizeLine(n),c=e._formulaTextBox,c)for(r=0;r<=2;r++)for(u=0;u<=2;u++)(i=o.viewportRect(r,u),i&&i.width!==0&&i.height!==0)&&f.paintFormulaTextBoxRange(n,r,u)}h&&(f.paintTouchResizeIndicator(n),f._existTouchDragFillIndicator?f.paintTouchDragFillIndicator(n):f.paintTouchSelectionIndicator(n))}},s.prototype.paintTouchResizeIndicator=function(t){var i=this._sheet,w=i.getRowCount(),b=i.getColumnCount(),v=i._getSheetLayout(),o,u=16,r,e,f,p=i.getSelections(),l,a,y;if(i._isTouchMode&&p.length>0){var s=p[p.length-1],k=s.row,h=s.row+s.rowCount-1,d=s.col,c=s.col+s.colCount-1;(!i.parent||i.parent._allowUserResize)&&(k!==-1&&d===-1&&i.getRowResizable(h)?(h<i.frozenRowCount?l=0:h<w-i._frozenTrailingRowCount?l=1:h<w&&(l=2),o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABaSURBVDhPY/z//z8DLsDIyAiWBKphBAtgAUxQGgPANIMAMhsdYDUAmwZchtDOC8SCgTcA5DfcgUAEoNwFo7GAPQxwJVtsYYHVBdgU4gpInF5A1oBLMwMDAwMApuAtD6Z7YxQAAAAASUVORK5CYII=",r=i.getCellRect(h,i.getColumnCount(2)-1,l,-1),f=v.rowHeaderRect(l),f.y<=r.y&&r.y+r.height<=f.y+f.height&&(e=new n.Rect(v.frozenX-u,r.y+r.height-u/2,u,u))):k===-1&&d!==-1&&i.getColumnResizable(c)&&(c<i.frozenColCount?a=0:c<b-i._frozenTrailingColCount?a=1:c<b&&(a=2),o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAE1JREFUOE/ljtEKACAIA/v/nzZ9mFhsJPRocLEuGS4zk/iJyyP/D6gE0wrYoCqoLoUafPl8fEBln3ulSscfErk65TMjMFRBhUowosDWBoHpba8+C7w0AAAAAElFTkSuQmCC",r=i.getCellRect(i.getRowCount(1)-1,c,-1,a),f=v.colHeaderRect(a),f.x<=r.x&&r.x+r.width<=f.x+f.width&&(e=new n.Rect(r.x+r.width-u/2,v.frozenY-u,u,u))),o&&e&&(y=i._getImageLoader(),y.getState(o)?t.drawImage(y.getImage(o),e.x,e.y,e.width,e.height):y.addImage(o)))}},s.prototype._getFloatingObjectRender=function(i,r){var u=this,f,e;return n.features.floatingObject?(u._floatingObjectRenderManager||(u._floatingObjectRenderManager=[]),f=u._floatingObjectRenderManager[i],f||(u._floatingObjectRenderManager[i]=[]),e=u._floatingObjectRenderManager[i][r],e||(u._floatingObjectRenderManager[i][r]=new n._FloatingObjectRenderManager(u._sheet)),u._floatingObjectRenderManager[i][r]):t},s.prototype._paintFloatingObject=function(n,i){var o=this._sheet,h,e,u,f,s;if(!o._hoverCell)for(h=o._getSheetLayout(),(i===t||typeof i===r)&&(i=o._zoomFactor),u=0;u<=2;u++)for(f=0;f<=2;f++)(e=h.viewportRect(u,f),e&&e.width!==0&&e.height!==0)&&(!n||e.intersectRect(n))&&(s=this._getFloatingObjectRender(u,f),s&&!o._eventHandler.isFloatingObjectWorking&&s._render(u,f,i))},s.prototype.paintSheet=function(t,r){var f=this,h=f._sheet,e,u,c,o,p,w,b,k,s,v,l,y,a;if(t&&!(h._layoutSuspended>0)){for(n._CatchMgr.startCatch(h,0,0,h.getRowCount()-1,h.getColumnCount()-1),e=h._bounds,t.save(),r?t.rect(r.x,r.y,r.width,r.height):t.rect(e.x,e.y,e.width,e.height),t.clip(),t.beginPath(),t.fillStyle=f._getSpreadBackColor(),t.fillRect(e.x,e.y,e.width,e.height),u=h._getSheetLayout(),n.features.group&&f.paintGroup(t,r),n.features.floatingObject&&f._paintFloatingObject(r),o=0;o<=2;o++)p=u.colHeaderRect(o),p&&(r?(s=p.getIntersectRect(r),s&&f.paintColHeader(t,o,s)):f.paintColHeader(t,o,p));for(c=0;c<=2;c++)for(w=u.rowHeaderRect(c),w&&(r?(s=w.getIntersectRect(r),s&&f.paintRowHeader(t,c,s)):f.paintRowHeader(t,c,w)),o=0;o<=2;o++)b=u.viewportRect(c,o),b&&(r?(s=b.getIntersectRect(r),s&&f.paintViewport(t,c,o,s)):f.paintViewport(t,c,o,b));n.features.comment&&f._paintComment(r);k=u.headerCornerRect();k&&(r?(s=k.getIntersectRect(r),s&&f.paintColHeaderCorner(t,s)):f.paintColHeaderCorner(t,k));v=h._getRowLayout(1);v.length>0?(l=v[v.length-1],l.y+l.height<u.frozenTrailingY&&(t.fillStyle=f._getGrayAreaBackColor(!1),t.fillRect(u.headerX,l.y+l.height,u.width,u.frozenTrailingY-(l.y+l.height)))):v.length===0&&(t.fillStyle=f._getGrayAreaBackColor(!1),t.fillRect(u.headerX,u.viewportY,u.width,u.frozenTrailingY-u.viewportY));y=h._getColumnLayout(1);y.length>0?(a=y[y.length-1],a.x+a.width<u.frozenTrailingX&&(t.fillStyle=f._getGrayAreaBackColor(!1),t.fillRect(a.x+a.width,u.headerY,u.frozenTrailingX-(a.x+a.width),u.height))):y.length===0&&(t.fillStyle=f._getGrayAreaBackColor(!1),t.fillRect(u.viewportX,u.headerY,u.frozenTrailingX-u.viewportX,u.height));f.paintFrozenLine(t);h.borderWidth>0&&(t.strokeStyle=h.borderColor,t.lineWidth=h.borderWidth,t.strokeRect(e.x+t.lineWidth/2,e.y+t.lineWidth/2,i(0,e.width-t.lineWidth),i(0,e.height-t.lineWidth)));n._CatchMgr.clearCatch();t.beginPath();t.restore()}},s.prototype._getThemeContentBackgroundColor=function(t){var u=this._sheet,r,i;return u.parent&&u.parent.useWijmoTheme&&(r=n.Global.prototype._dummyContent,i=r.currentStyle,e.defaultView&&e.defaultView.getComputedStyle&&(i=e.defaultView.getComputedStyle(r,"")),i&&i.backgroundColor&&i.backgroundColor!==""&&(t=i.backgroundColor)),t},s.prototype.refreshDragDropIndicator=function(){var o=this,i=o._sheet,h=i._currentTarget,s,v;if(h&&h.dragInfo){var c=o._getCtx(),f=i._getSheetLayout(),e=i._actualDragRange,r=i._dragRect,t=i._getRangeRect2(e),l=i._frozenTrailingColCount,a=i._frozenTrailingRowCount,y=i.getColumnCount()-l,p=i.getRowCount()-a,u=f.viewportRect(1,1);l>0&&e.col+e.colCount<=y&&t.x+t.width>u.x+u.width&&t.intersectRect(u)&&(t=t.getIntersectRect(u));a>0&&e.row+e.rowCount<=p&&t.y+t.height>u.y+u.height&&t.intersectRect(u)&&(t=t.getIntersectRect(u));s=new n.Rect(f.frozenX,f.frozenY,f.frozenTrailingX+f.frozenTrailingWidth,f.frozenTrailingY+f.frozenTrailingHeight);t.width>0&&t.height>0?(r.x=t.x,r.y=t.y,r.width=t.width-1,r.height=t.height-1,o.paintDragDropIndicator(c,s)):(t.width===0||t.height===0)&&(r.x=t.x,r.y=t.y,r.width=t.width,r.height=t.height,o.paintDragDropIndicator(c,s));v=i._eventHandler._isDragInsert;i._dragOldRect=v===!0?i._insertDragRect:new n.Rect(r.x,r.y,r.width,r.height)}},s.prototype.paintDragDropIndicator=function(t,i){var e=this,f=e._sheet,r=f._dragRect,p=f._eventHandler._isDragInsert,a=r.hitTarget,u,h,o,c,v,s,l,y;f&&r&&a&&(t.save(),p===!0&&(r.row===-1||r.col===-1)?r.row===-1&&r.col!==-1?(o=f._getColumnLayout(0).findCol(r.hitCol),o||(o=f._getColumnLayout(1).findCol(r.hitCol)),o||(o=f._getColumnLayout(2).findCol(r.hitCol)),o&&(c=o.x,v=o.width,r.col=r.hitCol,a.x>c+v/2&&(r.col<f._getLastFullyVisibleColumn()||r.col===f._getLastVisualColumn())&&(c=o.x+o.width,r.col++),u=f._dragOldRect,u&&u.width===0||(u=f._dragRect),u&&(h=new n.Rect(u.x-2,u.y-2,u.width+4,u.height+4),e.copyDoubleBufferRect(h,i),e.repaintSelection(f._getActiveSelectedRange(),i)),f._insertDragRect=new n.Rect(c,r.y,0,r.height),t.rect(i.x,i.y,i.width,i.height),t.clip(),t.beginPath(),e.paintDragLine(t,c,r.y,c,r.y+r.height))):r.row!==-1&&r.col===-1&&(s=f._getRowLayout(0).findRow(r.hitRow),s||(s=f._getRowLayout(1).findRow(r.hitRow)),s||(s=f._getRowLayout(2).findRow(r.hitRow)),s&&(l=s.y,y=s.height,r.row=r.hitRow,a.y>l+y/2&&(r.row<f._getLastFullyVisibleRow()||r.row===f._getLastVisualRow())&&(l=s.y+s.height,r.row++),u=f._dragOldRect,u&&u.height===0||(u=f._dragRect),u&&(h=new n.Rect(u.x-2,u.y-2,u.width+4,u.height+4),e.copyDoubleBufferRect(h,i),e.repaintSelection(f._getActiveSelectedRange(),i)),f._insertDragRect=new n.Rect(r.x,l,r.width,0),t.rect(i.x,i.y,i.width,i.height),t.clip(),t.beginPath(),e.paintDragLine(t,r.x,l,r.x+r.width,l))):(u=f._dragOldRect,u&&(h=new n.Rect(u.x-2,u.y-2,u.width+4,u.height+4),e.copyDoubleBufferRect(h,i),e.repaintSelection(f._getActiveSelectedRange(),i)),t.rect(i.x,i.y,i.width,i.height),t.clip(),t.beginPath(),e.paintDragRectangle(t,r)),t.beginPath(),t.restore())},s.prototype.paintDragRectangle=function(n,t){var i=this;i.paintDragLine(n,t.x,t.y,t.x+t.width,t.y);i.paintDragLine(n,t.x,t.y+t.height,t.x+t.width,t.y+t.height);i.paintDragLine(n,t.x,t.y,t.x,t.y+t.height);i.paintDragLine(n,t.x+t.width,t.y,t.x+t.width,t.y+t.height)},s.prototype.paintDragLine=function(t,i,r,u,e){t.save();var o,s,h;i===u?(t.rect(i-2,r,7,f(e-r)),t.clip(),t.beginPath(),r<e?(r-=3,e+=3):(r+=3,e-=3),o=n.Line.Create(i-1,r-1,u-1,e+1,"black",7),s=n.Line.Create(i,r,u,e,"black",7),h=n.Line.Create(i+1,r-1,u+1,e+1,"black",7)):r===e&&(t.rect(i,r-2,f(u-i),7),t.clip(),t.beginPath(),i<u?(i-=3,u+=3):(i+=3,u-=3),o=n.Line.Create(i-1,r-1,u+1,e-1,"black",7),s=n.Line.Create(i,r,u,e,"black",7),h=n.Line.Create(i-1,r+1,u+1,e+1,"black",7));o.paintLine(t);s.paintLine(t);h.paintLine(t);t.stroke();t.beginPath();t.restore()},s.prototype.paintResizeLine=function(n){var t,r,e,o,l,a,s=this._sheet,h,u,f,c;if(s._eventHandler.isResizing&&(h=s._currentTarget,h)&&(u=h.resizeInfo,u)){if(f=s._getSheetLayout(),c="#000000",n.save(),n.strokeStyle!==c&&(n.strokeStyle=c),n.lineWidth!==1&&(n.lineWidth=1),n.beginPath(),u.action==="sizeRow")for(r=i(0,u.startY-.5),o=u.movingY-.5,l=f.x+f.width,t=f.x;t<l;t+=2)n.moveTo(t,r),n.lineTo(t+1,r),n.moveTo(t,o),n.lineTo(t+1,o);else for(t=i(0,u.startX-.5),e=u.movingX-.5,a=f.y+f.height,r=f.y;r<a;r+=2)n.moveTo(t,r),n.lineTo(t,r+1),n.moveTo(e,r),n.lineTo(e,r+1);n.stroke();n.beginPath();n.restore()}},s.prototype.paintColHeaderCorner=function(i,r){var f=this._sheet,u,o,e;i.beginPath();u=f._getSheetLayout().headerCornerRect();o=f.getActualStyle(-1,-1,0);this.paintCells(i,[{data:t,row:-1,col:-1,x:u.x,y:u.y,width:u.width,height:u.height,style:o}],0);e=new n._GcBorders(f,0,0,0);e.addCellLines(0,0,u.x,u.y,u.width,u.height);e.paint(i,r)},s.prototype.paintFrozenLine=function(t){var r=this._sheet,i;(r.frozenRowCount||r.frozenColCount||r._frozenTrailingRowCount||r._frozenTrailingColCount)&&(i=r._getSheetLayout(),t.save(),t.strokeStyle=n._ThemeContext.getColor(r,r._frozenlineColor),t.lineWidth=1,t.beginPath(),r.frozenColCount&&(t.moveTo(i.viewportX-.5,i.y),t.lineTo(i.viewportX-.5,i.y+i.height)),r.frozenRowCount&&(t.moveTo(i.x,i.viewportY-.5),t.lineTo(i.x+i.width,i.viewportY-.5)),r._frozenTrailingColCount&&(t.moveTo(i.frozenTrailingX-.5,i.y),t.lineTo(i.frozenTrailingX-.5,i.y+i.height)),r._frozenTrailingRowCount&&(t.moveTo(i.x,i.frozenTrailingY-.5),t.lineTo(i.x+i.width,i.frozenTrailingY-.5)),t.stroke(),t.restore())},s.prototype.paintColHeader=function(n,t,i){this.paintViewportImp(n,-1,t,1,i)},s.prototype.paintRowHeader=function(n,t,i){this.paintViewportImp(n,t,-1,2,i)},s.prototype.paintViewport=function(n,t,i,r){this.paintViewportImp(n,t,i,3,r);var u=this._sheet._cutCopyIndicatorManager;u&&u.paintCutCopyIndicator(n,r,t,i)},s.prototype.getTouchDragFillIndicatorRect=function(){var r=this._sheet,u=t,f=r.getSelections(),e=f.length;if(r._isTouchMode&&e>0){var s=f[e-1],i=r._getRangeRect2(s),o=17,h=20;u=new n.Rect(i.x+i.width-o,i.y+i.height,o,h)}return u},s.prototype.getCurrentViewportRange=function(t,i){var r=this._sheet,c=r.getRowCount(),l=r.getColumnCount(),o=1,u;0<=t&&t<r.frozenRowCount?o=0:c>t&&t>=c-r._frozenTrailingRowCount&&(o=2);u=1;0<=i&&i<r.frozenColCount?u=0:l>i&&i>=l-r._frozenTrailingColCount&&(u=2);var f=r._getViewportRowLayout(o),e=r._getViewportColumnLayout(u),s=0,a=0,h=0,v=0;return f.length>0&&(s=f[0].row,a=f[f.length-1].row),e.length>0&&(h=e[0].col,v=e[e.length-1].col),new n.Range(s,h,a-s+1,v-h+1)},s.prototype.isContainedByCurrentViewport=function(n,t){var i=this._sheet,s=i.getRowCount(),h=i.getColumnCount(),f=1,u;0<=n&&n<i.frozenRowCount?f=0:s>n&&n>=s-i._frozenTrailingRowCount&&(f=2);u=1;0<=t&&t<i.frozenColCount?u=0:h>t&&t>=h-i._frozenTrailingColCount&&(u=2);var y=i._getSheetLayout(),r=y.viewportRect(f,u),c=!1,l=i._getViewportColumnLayout(u),e=t===-1?l[0]:l.findCol(t);e&&(c=r.x<=e.x&&e.x+e.width<=r.x+r.width);var a=!1,v=i._getViewportRowLayout(f),o=n===-1?v[0]:v.findRow(n);return o&&(a=r.y<=o.y&&o.y+o.height<=r.y+r.height),c&&a},s.prototype.getSelectionIndicatorRects=function(){var l=this,i=l._sheet,it=i.getSelections(),f=[],lt,g,vt,nt,tt,y;if(i._isTouchMode&&it.length>0){var u=it[it.length-1],r=i._getRangeRect2(u),t=8,p=i._getSheetLayout(),a=u.row,e=u.row+u.rowCount-1,v=u.col,o=u.col+u.colCount-1,ot=l.getCurrentViewportRange(a,v),w=l.getCurrentViewportRange(e,o),b=ot.row,s=w.row+w.rowCount-1,k=ot.col,h=w.col+w.colCount-1,c,d,st=e===s&&l.isContainedByCurrentViewport(s,-1),ht=o===h&&l.isContainedByCurrentViewport(-1,h);if(u.row!==-1&&u.col!==-1)k<=v&&v<=h&&b<=a&&a<=s&&(f[0]=new n.Rect(r.x-t,r.y-t,t*2,t*2)),(k<=o&&o<h||ht)&&(b<=e&&e<s||st)&&(f[1]=new n.Rect(r.x+r.width-t,r.y+r.height-t,t*2,t*2));else if(u.row!==-1){c=p.viewportRect(1,0);d=p.viewportRect(1,1);var rt=c.x+(c.width+d.width)/2-t,yt=i.getColumnCount()-1-i.getFrozenTrailingColumnCount(),ct=i._getViewportColumnLayout(1),ut=ct.findCol(yt);ut&&(lt=i._getViewportColumnLayout(0),g=lt[0]||ct[0],g&&(rt=g.x+(ut.x+ut.width-g.x)/2-t));b<=a&&a<=s&&(f[0]=new n.Rect(rt,r.y-t,t*2,t*2));(b<=e&&e<s||st)&&(f[1]=new n.Rect(rt,r.y+r.height-t,t*2,t*2))}else if(u.col!==-1){c=p.viewportRect(0,1);d=p.viewportRect(1,1);var ft=c.y+(c.height+d.height)/2-t,pt=i.getRowCount()-1-i.getFrozenTrailingRowCount(),at=i._getViewportRowLayout(1),et=at.findRow(pt);et&&(vt=i._getViewportRowLayout(0),nt=vt[0]||at[0],nt&&(ft=nt.y+(et.y+et.height-nt.y)/2-t));k<=v&&v<=h&&(f[0]=new n.Rect(r.x-t,ft,t*2,t*2));(k<=o&&o<h||ht)&&(f[1]=new n.Rect(r.x+r.width-t,ft,t*2,t*2))}for(y=f.length-1;y>=0;y--)tt=f[y],(!tt||tt.x<0||tt.y<0)&&f.splice(y,1)}return f},s.prototype.paintTouchSelectionIndicator=function(n){var r,u,t,i;if(!this._sheet.isEditing()&&this._showTouchSelectionIndicator&&(r=this.getSelectionIndicatorRects(),u=r.length,u>0)){for(n.save(),n.fillStyle="white",n.strokeStyle="black",i=0;i<u;i++)t=r[i],n.beginPath(),n.arc(t.x+t.width/2,t.y+t.height/2,t.width/2,0,h*2,!1),n.fill(),n.stroke();n.restore()}},s.prototype.refreshTouchSelectionIndicator=function(){var t=this._sheet,n=t.getSelections();!t._paintSuspended&&n.length>0&&this.repaintSelection(n[n.length-1])},s.prototype.paintTouchDragFillIndicator=function(n){var u=this._sheet,f=17,e=20,r=this.getTouchDragFillIndicatorRect(),t,i;r&&(t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAATCAIAAAD5x3GmAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwwAADsMBx2 + oZAAAAGhJREFUOE / djkEOwCAIBHk6P98u1lKo1diEU + dggOyAAkC + YPl / Onx3WDmiytm4aulQoKba + 4uiO77YhHDH5SqnRa0If / Nhq0fnjPob2h5oVXJI0rJA3h1ya1kgU4f4nQfVzozk7APgAIEqATZbalz1AAAAAElFTkSuQmCC",i=u._getImageLoader(),i.getState(t)?n.drawImage(i.getImage(t),r.x,r.y,f,e):i.addImage(t))},s.prototype.paintSelection=function(t,r,u,f){var l=this,s=l._sheet,v=s._eventHandler,tt=s._getSheetLayout(),p=tt.viewportRect(r,u),k=s._selectionModel,d=k.length,a,y,o,w,g,b,h,e,nt,c;if((f=l._getClipRect(r,u,f),f)&&(a=l._getPaintingRects(r,u,k,f),y=a.length,!(y<=0))){for(w=!1,g=!1,h=0;h<y;h++)if(o=a[h],!f.containsRect(o)){w=!0;break}if(t.save(),w&&(t.rect(f.x,f.y,f.width,f.height),t.clip(),g=!0),t.beginPath(),y>0)for(b=n._ThemeContext.getColor(s,s.selectionBackColor()),t.fillStyle!==b&&(t.fillStyle=b),h=0;h<a.length;h++)o=a[h],t.fillRect(o.x,o.y,o.width,o.height);e=s.getCellRect(s._activeRowIndex,s._activeColIndex,r,u);p.intersectRect(e)&&(e.x=i(e.x,p.x),e.y=i(e.y,p.y));e&&e.intersectRect(f)&&(l.copyDoubleBuffer(e.x+1,e.y+1,e.width-2,e.height-2),d>1&&(t.strokeStyle="black",t.lineWidth=1,t.strokeRect(e.x+1.5,e.y+1.5,e.width-4,e.height-4)));d===1&&(v.isDraggingFill&&v.isDragClear()&&!v._isDragAroundIndicator&&(nt=v.getCurrentFillRange(),c=s._getRangeRect(r,u,nt),c&&c.width>0&&c.height>0&&(t.fillStyle="rgba(110,110,110, 0.5)",t.fillRect(c.x,c.y,c.width,c.height))),o&&o.width>=0&&o.height>=0&&l.paintSelectionBorder(t,r,u,o,f));t.beginPath();t.restore()}},s.prototype.paintSelectionBorder=function(t,i,r,u,f){var e=this._sheet,o=e._eventHandler;if(u.width>=0&&u.height>=0&&(!f||u.intersect(f.x-1,f.y-1,f.width+2,f.height+2))){if(t.save(),f&&!f.containsRect(u)&&(t.rect(f.x,f.y,f.width,f.height),t.clip()),t.beginPath(),t.strokeStyle=n._ThemeContext.getColor(e,e.selectionBorderColor()),t.lineWidth=2,u.width>0&&u.height>0){if(o.isDraggingFill)switch(o._currentFillDirection){case 2:t.moveTo(u.x+.5,u.y-.5);t.lineTo(u.x+u.width-1,u.y-.5);break;case 3:t.moveTo(u.x+.5,u.y+u.height-.5);t.lineTo(u.x+u.width-1,u.y+u.height-.5);break;case 0:t.moveTo(u.x-.5,u.y+.5);t.lineTo(u.x-.5,u.y+u.height-1);break;case 1:t.moveTo(u.x+u.width-.5,u.y+.5);t.lineTo(u.x+u.width-.5,u.y+u.height-1);break;case 5:case 4:break;default:break}else t.rect(u.x-.5,u.y-.5,u.width,u.height);t.stroke();e.canUserDragFill()&&this.paintDragFillIndicator(t,i,r,u,f)}else(u.width===0||u.height===0)&&t.strokeRect(u.x-1,u.y-1,u.width+1,u.height+1);t.beginPath();t.restore()}},s.prototype._getClipRect=function(n,i,r){var c=this._sheet,l=c._getSheetLayout(),f=l.viewportRect(n,i),e,o,s,h;return i===1&&(e=c._getColumnLayout(i),o=e.length>0?e[e.length-1]:t,o&&(f.width=u(f.width,o.x+o.width-l.viewportX))),n===1&&(s=c._getRowLayout(n),h=s.length>0?s[s.length-1]:t,h&&(f.height=u(f.height,h.y+h.height-l.viewportY))),r?r.getIntersect(f.x,f.y,f.width,f.height):f},s.prototype._getPaintingRects=function(n,t,i,r){for(var s=this._sheet,c=s._spanModel,e,l=i.length,f,h=[],u,o=0;o<l;o++)f=i[o],f&&(e=c.find(f.row,f.col),e&&e.containsRange(f)&&(f=e),u=s._getRangeRect(n,t,f),u&&u.x<=r.x+r.width&&u.y<=r.y+r.height&&r.x<=u.x+u.width&&r.y<=u.y+u.height&&h.push(u));return h},s.prototype.paintFormulaTextBox=function(){var t=this,i=t._sheet,n,r;i._paintSuspended||i._layoutSuspended>0||(n=i._getSheetLayout(),r=t._getCtx(),t.copyDoubleBuffer(n.x,n.y,n.width,n.height),t.paintAdornment(r))},s.prototype.paintFormulaTextBoxRange=function(t,i,r){var a=this,d=a._sheet,s=d._eventHandler,l=d._formulaTextBox,y=l&&l.getRanges(),g=y&&y.length,h,e;if(!(g<=0)&&(h=a._getClipRect(i,r),h)){t.save();t.rect(h.x,h.y,h.width,h.height);t.clip();t.beginPath();var nt=s.isFormulaRangeHoving,tt=s._formulRangeHovingInfo,ot=s.isFormulaRangeMoving,st=s._formulaRangeMovingInfo,ht=s.isFormulaRangeResizing,ct=s._formulaRangeResizingInfo,v,it,p,u,c;for(e=0;e<g;e++)if((v=y[e],it=v.text,p=s.stringToRange(it),p)&&(u=a._getPaintingRects(i,r,[p],h)[0],u&&u.width>0&&u.height>0)){if(c=l.getRangeColor(e),l.isAppendingRange(v)?(nt&&tt.paramRange.index===e&&(t.beginPath(),t.lineWidth=2,t.strokeStyle=c,t.rect(u.x+1,u.y+1,u.width-3,u.height-3),t.stroke()),a.paintDashRect(t,u,c)):nt&&tt.paramRange.index===e||ot&&st.paramRange.index===e||ht&&ct.paramRange.index===e?(t.beginPath(),t.lineWidth=2,t.strokeStyle=c,t.rect(u.x+1,u.y+1,u.width-3,u.height-3),t.stroke()):(t.beginPath(),t.lineWidth=2,t.strokeStyle=c,t.rect(u.x,u.y,u.width-1,u.height-1),t.stroke()),l.isActiveRange(v)){var lt=.1,w=0,b=0,k=0,o=n.util.parseColorString(c);o.length===3?(w=o[0],b=o[1],k=o[2]):o.length===4&&(w=o[1],b=o[2],k=o[3]);t.beginPath();t.fillStyle="rgba("+w+","+b+","+k+","+lt+")";t.fillRect(u.x+1,u.y+1,u.width-3,u.height-3)}var f=5,rt=u.x-2,ut=u.x+u.width+1-f,ft=u.y-2,et=u.y+u.height+1-f;t.beginPath();t.fillStyle=c;t.fillRect(rt,ft,f,f);t.fillRect(ut,ft,f,f);t.fillRect(rt,et,f,f);t.fillRect(ut,et,f,f)}t.beginPath();t.restore()}},s.prototype.paintDashRect=function(n,t,i){var c,o,h,u,r,e,s;if(n.save(),c=[6,6],n.setLineDash&&!$.browser.qtMode)n.beginPath(),n.lineWidth=2,n.strokeStyle=i,n.setLineDash(c),n.rect(t.x,t.y,t.width-1,t.height-1),n.stroke();else{for(n.beginPath(),n.lineWidth=2,n.strokeStyle=i,o=c[0],h=c[1],u=t.x,r=t.y,e=t.width;e>0;)if(e>=o+h)n.moveTo(u,r),n.lineTo(u+o,r),u=u+o+h,e=e-o-h;else if(e>=o){n.moveTo(u,r);n.lineTo(u+o,r);e=e-o-h;break}else if(e>0){n.moveTo(u,r);n.lineTo(u+e,r);e=e-o-h;break}for(u=t.x+t.width-1,r=t.y+1,s=t.height-1,e<0&&(e=f(e),e>h&&(n.moveTo(u,r-2),n.lineTo(u,r+(e-h))),r+=e,s-=e);s>0;)s>=o+h?(n.moveTo(u,r),n.lineTo(u,r+o),r=r+o+h,s=s-o-h):s>=o?(n.moveTo(u,r),n.lineTo(u,r+o),s=s-o-h):s>0&&(n.moveTo(u,r),n.lineTo(u,r+s),s=s-o-h);for(u=t.x+t.width-2,r=t.y+t.height-1,e=t.width-1,s<0&&(s=f(s),s>h&&(n.moveTo(u+2,r),n.lineTo(u-(s-h),r)),u-=s,e-=s);e>0;)if(e>=o+h)n.moveTo(u,r),n.lineTo(u-o,r),u=u-o-h,e=e-o-h;else if(e>=o){n.moveTo(u,r);n.lineTo(u-o,r);e=e-o-h;break}else if(e>0){n.moveTo(u,r);n.lineTo(u-e,r);e=e-o-h;break}for(u=t.x,r=t.y+t.height-2,s=t.height-1,e<0&&(e=f(e),e>h&&(n.moveTo(u,r+2),n.lineTo(u,r-(e-h))),r-=e,s-=e);s>0;)s>=o+h?(n.moveTo(u,r),n.lineTo(u,r-o),r=r-o-h,s=s-o-h):s>=o?(n.moveTo(u,r),r-o===t.y?n.lineTo(u,r-o-1):n.lineTo(u,r-o),s=s-o-h):s>0&&(r>t.y&&(n.moveTo(u,r),n.lineTo(u,r-s)),s=s-o-h);n.stroke()}n.beginPath();n.restore()},s.prototype.getDragFillIndicatorRect=function(t){var r=this._sheet,u=r._getActiveSelectedRange(),f=r._getSheetLayout(),i=new n.Rect(-4,-4,4,4);return u.col===-1?(i.x=f.frozenX,i.y=t.y+t.height-.5-2):u.row===-1?(i.x=t.x+t.width-.5-2,i.y=f.frozenY):(i.x=t.x+t.width-.5-2,i.y=t.y+t.height-.5-2),i},s.prototype.paintDragFillIndicator=function(t,r,u,f,e){var h=this._sheet,l=h._getSheetLayout(),o=this.getDragFillIndicatorRect(f),c=l.viewportRect(r,u),s;(!e||o.intersectRect(e))&&o.intersectRect(c)&&(s=new n.Rect(o.x-1.5,o.y-1.5,o.width+2,o.height+2),s.x=i(s.x,c.x),s.y=i(s.y,c.y),this.copyDoubleBufferRect(s),t.save(),e&&!e.containsRect(o)&&(t.rect(e.x,e.y,e.width,e.height),t.clip()),t.beginPath(),t.fillStyle=n._ThemeContext.getColor(h,h.selectionBorderColor()),t.fillRect(o.x,o.y,o.width,o.height),h._dragFillIndicatorRect=new n.Rect(o.x,o.y,4,4),t.beginPath(),t.restore())},s.prototype._paintCommentFloatLayoutPanel=function(n){var i=this,t;n===3&&(t=i._sheet._commentRender,t&&t.renderCommentFloatPanel(i._sheet))},s.prototype._paintCommentCellAdorner=function(n,t,i){var u=this,r=u._sheet._commentRender;r&&r.renderCommentCellAdorner(n,t,i)},s.prototype._paintComment=function(n){var e=this,u=e._sheet,o=u._commentRender,s,t,i,r,f;if(!u._hoverCell)for(s=e._sheet._getSheetLayout(),i=0;i<=2;i++)for(r=0;r<=2;r++)(t=s.viewportRect(i,r),t&&t.width!==0&&t.height!==0)&&(!n||t.intersectRect(n))&&(f=u._commentManager,o&&f&&o.renderComment(f))},s.prototype.paintViewportImp=function(i,u,f,e,s){var b=this,ut,ft,d,wt;(typeof e===r||e===t)&&(e=3);var h=b._sheet,st=h._getRowLayout(u,e),ht=h._getColumnLayout(f,e),ct=st.length,lt=ht.length;if(!(ct<0)&&!(lt<0)){var at=h._getCellLayout(u,f,e),bt=at.length>0,g=t,nt=t,c=t,l,a,p=0,w=0,v=0,y=0,tt,it,et=new n._GcBorders(h,u,f,e),vt=[],rt=[],yt=e===3&&h._allowCellOverflow,kt=h._cachePool,k=t,pt=h._getFilterButtonModel(),ot=[],dt=e===3&&h.parent&&h.parent.highlightInvalidData();for(n.features.comment&&b._paintCommentFloatLayoutPanel(e),i.save(),s&&(i.rect(s.x,s.y,s.width,s.height),i.clip()),i.beginPath(),ut=0;ut<ct;ut++)for(g=st[ut],ft=0;ft<lt;ft++)(nt=ht[ft],c=bt&&at.findCell(g.row,nt.col),c?(l=c.row,a=c.col,p=c.x,w=c.y,v=c.width,y=c.height):(l=g.row,a=nt.col,p=nt.x,w=g.y,v=nt.width,y=g.height),s&&(p+v<=s.x||p>=s.x+s.width||w+y<=s.y||w>=s.y+s.height))||v!==0&&y!==0&&(c&&vt.contains(c)||(tt=h.getValue(l,a,e),it=h.getActualStyle(l,a,e),yt&&kt.addCell(l,a,{data:tt,style:it}),pt&&v>0&&y>0&&(d=pt.find(l,a,e),d&&(k||(k=new n._FilterButtonInfoModel),k.push(new n._FilterButtonInfo(d.rowFilter,d.row,d.col,d.sheetArea,p,w,v,y)))),dt&&!h.isValid(l,a,tt)&&ot.push({x:p,y:w,width:v,height:y}),et.addCellLines(l,a,p,w,v,y,it,c),rt.push({data:tt,row:l,col:a,x:p,y:w,width:v,height:y,style:it}),c&&vt.push(c)));rt.length>0&&(yt&&(wt=new o(h,u,f),b.buildCellOverflowValueLayout(wt,rt,et)),b.paintCells(i,rt,e));k&&k.length>0&&b._paintFilterButtons(i,k);et.paint(i,s);ot.length>0&&b._paintValidationUI(i,ot);i.restore()}},s.prototype._getFilterButtonRect=function(n){var t=this._sheet,r=t._zoomFactor,e=r>1?1:r,i=parseInt((u(20,t.defaults.rowHeight)*e).toString(),10);t.parent&&t.parent.useTouchLayout()&&(i=parseInt((t.defaults.rowHeight*r).toString(),10));var f=i,o=n.x+n.width-i,s=n.y+n.height-f;return{x:o,y:s,width:i,height:f}},s.prototype._paintFilterButtons=function(t,i){var a=this._sheet,v,u;for(t.save(),t.beginPath(),t.lineWidth=1,t.fillStyle="#FFFFFF",t.strokeStyle="#CCCCCC",v=this._getCtx(),u=0;u<i.length;u++){var r=i[u],f=this._getFilterButtonRect(new n.Rect(r.x,r.y,r.width,r.height)),e=f.width,o=f.height,s=f.x,h=f.y;t.save();t.rect(r.x,r.y,r.width,r.height);t.clip();t.beginPath();t.fillRect(s+1,h+1,e-3,o-3);t.strokeRect(s+1-.5,h+2-.5,e-3,o-4);var y=r.getState(),c=n._GcFilterDialog.getImageSrc(y),l=a._getImageLoader();try{l.getState(c)?t.drawImage(l.getImage(c),s,h+1,e-3,o-3):l.addImage(c)}catch(p){}t.beginPath();t.restore()}t.restore()},s.prototype._paintValidationUI=function(n,t){var y,e;if(t)for(y=t.length,e=0;e<y;e++){var o=t[e],r=o.x-4,f=o.y-4,c=o.width+8,l=o.height+8,p=.5522848,s=c/2*p,h=l/2*p,a=r+c,v=f+l,u=r+c/2,i=f+l/2;n.save();n.lineWidth=2;n.strokeStyle="red";n.beginPath();n.moveTo(r,i);n.bezierCurveTo(r,i-h,u-s,f,u,f);n.bezierCurveTo(u+s,f,a,i-h,a,i);n.bezierCurveTo(a,i+h,u+s,v,u,v);n.bezierCurveTo(u-s,v,r,i+h,r,i);n.closePath();n.stroke();n.restore()}},s.prototype.paintCells=function(r,u,f){var tt=this,e=tt._sheet,at=f===3,ut=n.StyleHelper._scaleFont,vt=e._zoomFactor,yt=ut(tt._getDefaultFont(f),vt),pt=e.getDefaultStyle(f),kt=e.getDefaultCellType(f),dt=e.parent&&e.parent.useWijmoTheme,gt=e._conditionalFormats,ni=e._getImageLoader(),ot,st,ht,ct,lt,nt,v;r.save();r.beginPath();r.fillStyle=pt&&pt.foreColor||"#000000";r.font=yt.font;r.textAlign=at?"right":"center";var it=u.length,h,p,w,b,k,d,g,l,y,o,rt,wt,a,ft,bt,ti=n.features.sparkline,ii=e._getModel(f),et=[],c,s={sheet:e,row:-1,col:-1,fontInfo:t,lineHeight:-1,imageLoader:ni,conditionalFormats:gt,useWijmoTheme:dt,sheetArea:f};for(v=0;v<it;v++){if(h=u[v],w=h.data,b=h.row,k=h.col,d=h.x,g=h.y,l=h.width,y=h.height,o=h.style,rt=h.cellOverflowLayout,a=o.font?ut(o.font,vt):yt,ot=!o.wordWrap&&o.shrinkToFit,ot&&(st=e.getText(b,k,f),st))for(ht={value:!1},ct=0;ct<3&&ht.value===!1;ct++)if(lt=e._getStringWidthByCanvas(st,a.font),nt=i(0,l-4),o.hAlign!==1&&o.textIndent&&(nt=i(0,nt-o.textIndent*8)),nt<lt)a=ut(a.font,nt/lt,ht,!0);else break;o.font=a.font;l>0&&y>0&&(p=o.cellType||kt,d--,g--,l++,y++,at?(bt=ti&&ii.getSparkline(b,k),s.sparkline=bt):(wt=tt.getVisualState(b,k,f),s.visualState=wt),ft=e._getFontHeight(a.font,ot),s.lineHeight=ft,s.row=b,s.col=k,s.fontInfo=a,s.cellOverflowLayout=rt,p.paint(r,w,d,g,l,y,o,s),rt&&!s.showBarIconOnly&&et.push({cellType:p,data:w,x:d,y:g,width:l,height:y,style:o,options:{sheet:e,row:b,col:k,fontInfo:a,lineHeight:ft,cellOverflowLayout:rt}}));n.features.comment&&tt._paintCommentCellAdorner(r,f,h)}if(it=et.length,it>0){var ri=e.isEditing(),ui=e._activeRowIndex,fi=e._activeColIndex,ei=n.features.sparklineEx;for(v=0;v<it;v++)(c=et[v],p=c.cellType,w=c.data,d=c.x,g=c.y,l=c.width,y=c.height,o=c.style,s=c.options,ri&&s.row===ui&&s.col===fi)||ei&&w instanceof n.SparklineExValue||p.paintValue&&p.paintValue(r,w,d,g,l,y,o,s)}r.restore()},s.prototype.getVisualState=function(n,i,u){var f=this._sheet,e=0;return u===3||typeof u===r||u===t?!f.isEditing()&&f._isActiveCell(n,i)?e=3:f._isSelected(n,i,u)&&(e=2):(f._isSelected(n,i,u)&&(e=1,f._isAllSelected(n,i,u)&&(e=2)),f._isHover(n,i,u)&&(e=4)),e},s.prototype.paintLine=function(n,t,i,r,u,f){n.lineWidth=t.width();n.strokeStyle=t.color;n.moveTo(i,r);n.lineTo(u,f)},s.prototype.paintGroup=function(t,i){var u=this._sheet,r=u._getGroupLayout(),s,e,l,a,h,o,v,y,f,c;if(r.width!==0||r.height!==0){if(t.save(),t.beginPath(),s=u._getSheetLayout(),r.width>0&&(!i||i.intersect(r.x,r.y,r.width,s.height)))for(e=r.rowMaxLevel,l=new n._RangeGroupHeaderPresenter(u,!0,e),l.paintGroupHeader(t),a=[new n._RangeGroupPresenter(u,!0,0,e),new n._RangeGroupPresenter(u,!0,1,e),new n._RangeGroupPresenter(u,!0,2,e)],f=0;f<=2;f++)h=a[f],h.createGroupInfo(),h.paintGroups(t);if(r.height>0&&(!i||i.intersect(r.x,r.y,s.width,r.height)))for(o=r.colMaxLevel,v=new n._RangeGroupHeaderPresenter(u,!1,o),v.paintGroupHeader(t),y=[new n._RangeGroupPresenter(u,!1,0,o),new n._RangeGroupPresenter(u,!1,1,o),new n._RangeGroupPresenter(u,!1,2,o)],f=0;f<=2;f++)c=y[f],c.createGroupInfo(),c.paintGroups(t);t.beginPath();t.restore()}},s.prototype.groupHitTest=function(i,r){var e,u,a,l,s,o,f,h,p,v,c,w,y;if(!n.features.group||(e=this._sheet,u=e._getGroupLayout(),u.width===0&&u.height===0)||(a=e._getSheetLayout(),l=new n.Rect(u.x,u.y,u.width,a.height),!l.contains(i,r)&&(l=new n.Rect(u.x,u.y,a.width,u.height),!l.contains(i,r))))return t;if(s={what:"empty",info:t},u.width>0&&(h=u.rowMaxLevel,p=new n._RangeGroupHeaderPresenter(e,!0,h),f=p.getGroupButton(i,r),f&&(s={what:"rgh",info:f}),s.what==="empty"))for(v=[new n._RangeGroupPresenter(e,!0,0,h),new n._RangeGroupPresenter(e,!0,1,h),new n._RangeGroupPresenter(e,!0,2,h)],o=0;o<=2;o++)if(v[o].createGroupInfo(),f=v[o].getRowGroupButton(i,r),f){s={what:"rg",info:f};break}if(u.height>0&&(c=u.colMaxLevel,s.what==="empty"&&(w=new n._RangeGroupHeaderPresenter(e,!1,c),f=w.getGroupButton(i,r),f&&(s={what:"cgh",info:f})),s.what==="empty"))for(y=[new n._RangeGroupPresenter(e,!1,0,c),new n._RangeGroupPresenter(e,!1,1,c),new n._RangeGroupPresenter(e,!1,2,c)],o=0;o<=2;o++)if(y[o].createGroupInfo(),f=y[o].getColGroupButton(i,r),f){s={what:"cg",info:f};break}return s},s.prototype.buildCellOverflowValueLayout=function(n,t,i){for(var p=this._sheet,tt=t.length,f,w,b,u,r,l,y,c,v,o,a,nt,k,d,s,h,e,g=0;g<tt;g++)f=t[g],u=f.row,r=f.col,l=f.x,y=f.y,v=f.height,d=n.getCellOverflowLayoutModel(u),s=d.headingOverflowlayout,h=d.trailingOverflowLayout,e=d.find(r),e&&e.column===r?(c=f.width,o=e.backgroundWidth,a=e.backgroundLeftWidth<0?l:e.backgroundRightWidth<0?l+c-o:l+c/2-e.backgroundLeftWidth,f.cellOverflowLayout=e,e.layout={x:a,y:y,width:o,height:v},i.addCellOverlfowLayout(u,e)):s&&s.endColumn===r?(r=s.column,b=p.getActualStyle(u,r),w=p.getValue(u,r),c=s.columnWidth,o=s.backgroundWidth,a=l+f.width-o,k={data:w,row:u,col:r,x:a,y:f.y,width:c,height:v,style:b,cellOverflowLayout:s},t.push(k),s.layout={x:a,y:y,width:o,height:v},i.addCellOverlfowLayout(u,s)):h&&h.startColumn===r&&(r=h.column,b=p.getActualStyle(u,r),w=p.getValue(u,r),c=h.columnWidth,o=h.backgroundWidth,a=l,nt=l+o-c,k={data:w,row:u,col:r,x:nt,y:y,width:c,height:v,style:b,cellOverflowLayout:h},t.push(k),h.layout={x:a,y:y,width:o,height:v},i.addCellOverlfowLayout(u,h))},s}();n._SheetRender=c;o=function(){function i(t,i,r){this.TEXT_WIDTH_OFFSET=2;var u=this;u._sheet=t;u._rowViewportIndex=i;u._colViewportIndex=r;u._colLayoutModel=t._getColumnLayout(r);u._cellLayoutModel=t._getCellLayout(i,r);u.maxCellOverflowDistance=t.maxCellOverflowDistance;u.scaleFont=n.StyleHelper._scaleFont;u.zoomFactor=t._zoomFactor;u.defaultFont=u.scaleFont(t._render._getDefaultFont(),u.zoomFactor).font;u.defaultCellType=t.getDefaultCellType();u.cachedCellOverflowModels={}}return i.prototype.getCellOverflowLayoutModel=function(i){var u=this,w=u.cachedCellOverflowModels[i],y;if(w)return w;var b=u._sheet,l=u._colLayoutModel,k=l.length,d=l[0].col,g=l[k-1].col,p,o,nt=b._cachePool,a,tt,f,s,v,h,c=new n._CellOverflowLayoutModel,e;for(c.headingOverflowlayout=u._buildHeadingCellOverflowLayout(i),y=0;y<k;y++)(p=l[y],p.width<=0)||(o=p.col,a=nt.getCachedCell(i,o),s=a.data,s!==t&&typeof s!==r)&&((f=a.style,f||(f=a.style=b.getActualStyle(i,o)),f.shrinkToFit||f.wordWrap)||(tt=nt.getCachedColumn(o),v=tt.width,h=f.hAlign,h===3&&(h=n.util.getHAlignByValueType(h,s)),h===0?(e=u._buildCellOverflowLayoutModelForLeft({data:s,style:f,width:v},i,o,g),e&&c.push(e)):h===2?(e=u._buildCellOverflowLayoutModelForRight({data:s,style:f,width:v},i,o,d),e&&c.push(e)):h===1&&(e=u._buildCellOverflowLayoutModelForCenter({data:s,style:f,width:v},i,o,d,g),e&&c.push(e))));return c.trailingOverflowLayout=u._buildTrailingCellOverflowLayout(i),u.cachedCellOverflowModels[i]=c,c},i.prototype._buildCellOverflowLayoutModelForLeft=function(i,u,f,e){var o=this,p=o._sheet,d=o._cellLayoutModel,g=p._cachePool,ft=i.width,h=i.width,a=i.data,c=i.style,s,nt,tt,w,v,b,it,rt,l,k,ut,y;if(d.findCell(u,f)!==t||(b=c.cellType||o.defaultCellType,!b.allowOverflow)||(it=c.formatter||c._autoFormatter,rt={sheet:p,row:u,col:f,sheetArea:p._getSheetArea(o._rowViewportIndex,o._colViewportIndex)},w=b.format(a,it,rt),!w)||(l=c.font,k=c.textIndent,l=l?o.scaleFont(l,o.zoomFactor).font:o.defaultFont,v=n._WordWrapHelper._measureText(w,l)+(k?k*8:0)+o.TEXT_WIDTH_OFFSET,v<=h))return t;for(ut=f,y=f,s=f+1;s<=e;s++){if(d.findCell(u,s)!==t)break;if(nt=g.getCachedCell(u,s),a=nt.data,a!==t&&typeof a!==r)break;if(y=s,tt=g.getCachedColumn(s),h+=tt.width,v<=h)break}return y==f?t:new n._CellOverflowLayout(f,ut,y,v,ft,h,-1,h)},i.prototype._buildCellOverflowLayoutModelForRight=function(i,u,f,e){var o=this,p=o._sheet,d=o._cellLayoutModel,g=p._cachePool,ft=i.width,h=i.width,a=i.data,c=i.style,et,s,nt,tt,w,v,b,it,rt,l,k,y,ut;if(d.findCell(u,f)!==t||(b=c.cellType||o.defaultCellType,!b.allowOverflow)||(it=c.formatter||c._autoFormatter,rt={sheet:p,row:u,col:f,sheetArea:p._getSheetArea(o._rowViewportIndex,o._colViewportIndex)},w=b.format(a,it,rt),!w)||(l=c.font,k=c.textIndent,l=l?o.scaleFont(l,o.zoomFactor).font:o.defaultFont,v=n._WordWrapHelper._measureText(w,l)+(k?k*8:0)+o.TEXT_WIDTH_OFFSET,v<=h))return t;for(y=f,ut=f,s=f-1;s>=e;s--){if(d.findCell(u,s)!==t)break;if(nt=g.getCachedCell(u,s),a=nt.data,a!==t&&typeof a!==r)break;if(y=s,tt=g.getCachedColumn(s),h+=tt.width,v<=h)break}return y==f?t:new n._CellOverflowLayout(f,y,ut,v,ft,h,h,-1)},i.prototype._buildCellOverflowLayoutModelForCenter=function(i,u,f,e,o){var h=this,nt=h._sheet,tt=h._cellLayoutModel,w=nt._cachePool,st=i.width,it=i.width,c=i.data,l=i.style,s,b,k,rt,a,ut,et,ot,v,ft,d,y,g,p;if(tt.findCell(u,f)!==t||(ut=l.cellType||h.defaultCellType,!ut.allowOverflow)||(et=l.formatter||l._autoFormatter,ot={sheet:nt,row:u,col:f,sheetArea:nt._getSheetArea(h._rowViewportIndex,h._colViewportIndex)},rt=ut.format(c,et,ot),!rt)||(v=l.font,ft=l.textIndent,v=v?h.scaleFont(v,h.zoomFactor).font:h.defaultFont,a=n._WordWrapHelper._measureText(rt,v)+(ft?ft*8:0)+h.TEXT_WIDTH_OFFSET,a<=it))return t;for(d=f,y=it/2,s=f-1;s>=e;s--){if(tt.findCell(u,s)!==t)break;if(b=w.getCachedCell(u,s),c=b.data,c!==t&&typeof c!==r)break;if(d=s,k=w.getCachedColumn(s),y+=k.width,a/2<=y)break}for(g=f,p=it/2,s=f+1;s<=o;s++){if(tt.findCell(u,s)!==t)break;if(b=w.getCachedCell(u,s),c=b.data,c!==t&&typeof c!==r)break;if(g=s,k=w.getCachedColumn(s),p+=k.width,a/2<=p)break}return d===g?t:new n._CellOverflowLayout(f,d,g,a,st,y+p,y,p)},i.prototype._buildHeadingCellOverflowLayout=function(i){for(var s=this,v=s._sheet,y=s._colLayoutModel,c=y[0].col,w=y[y.length-1].col,d=v._getSpanModel(),b=v._cachePool,e,o,l,h,g=s.maxCellOverflowDistance,nt=c,u,a,k,f,p=1;p<g;p++){if((u=nt-p,u<0)||d.find(i,u))return t;if(a=b.getCachedCell(i,u),o=a.data,k=b.getCachedColumn(u),l=k.width,l>0&&o!==t&&typeof o!==r){if(e=a.style,e||(e=a.style=v.getActualStyle(i,u)),h=e.hAlign,h===3&&(h=n.util.getHAlignByValueType(h,o)),h===0){if(f=s._buildCellOverflowLayoutModelForLeft({data:o,style:e,width:l},i,u,w),f&&f.endColumn>=c)return f}else if(1&&(f=s._buildCellOverflowLayoutModelForCenter({data:o,style:e,width:l},i,u,c,w),f&&f.endColumn>=c))return f;return t}}},i.prototype._buildTrailingCellOverflowLayout=function(i){for(var s=this,c=s._sheet,y=s._colLayoutModel,w=y[0].col,l=y[y.length-1].col,d=c._getSpanModel(),b=c._cachePool,e,o,a,h,g=s.maxCellOverflowDistance,nt=c.getColumnCount(),tt=l,u,v,k,f,p=1;p<g;p++){if((u=tt+p,u>=nt)||d.find(i,u))return t;if(v=b.getCachedCell(i,u),o=v.data,k=b.getCachedColumn(u),a=k.width,a>0&&o!==t&&typeof o!==r){if(e=v.style,e||(e=v.style=c.getActualStyle(i,u)),h=e.hAlign,h===3&&(h=n.util.getHAlignByValueType(h,o)),h===2){if(f=s._buildCellOverflowLayoutModelForRight({data:o,style:e,width:a},i,u,w),f&&f.startColumn<=l)return f}else if(1&&(f=s._buildCellOverflowLayoutModelForCenter({data:o,style:e,width:a},i,u,w,l),f&&f.startColumn<=l))return f;return t}}},i}();n._CellOverflowLayoutBuilder=o;s=function(){function i(n){this._needPaintIndicator=!1;this._eventNS=".cutCopyIndicator";this._ch=t;this._sheet=n;this._bindEvents()}return i.prototype.needPaintIndicator=function(n){var t=this,i;if(arguments.length===0)return t._needPaintIndicator;if(typeof n=="boolean"){if(t._needPaintIndicator===n&&n===!1)return t;t._needPaintIndicator=n;i=t._sheet;i&&i.invalidate()}return t},i.prototype.getClipboardHelper=function(){var n=this,t=n._sheet;return t&&!n._ch&&(n._ch=t._getClipboardHelper()),n._ch},i.prototype._bindEvents=function(){var t=this,i=t._sheet,r=!1;i&&(i._bind(n.Events.ClipboardChanged+t._eventNS,function(n,i){t.needPaintIndicator(!0)}),i._bind(n.Events.ValueChanged+t._eventNS,function(n,i){t.needPaintIndicator(!1)}),i._eventHandler.bind(n.Events.CellChanged+t._eventNS,function(n,i){t.needPaintIndicator(!1)}),i._bind(n.Events.ColumnChanged+t._eventNS,function(n,i){i.propertyName!=="resizable"&&i.propertyName!=="width"&&i.propertyName!=="isVisible"&&t.needPaintIndicator(!1)}),i._bind(n.Events.RowChanged+t._eventNS,function(n,i){i.propertyName!=="resizable"&&i.propertyName!=="height"&&i.propertyName!=="isVisible"&&t.needPaintIndicator(!1)}),i._bind(n.Events.RangeChanged+t._eventNS,function(n,i){t.needPaintIndicator(!1)}),i._bind(n.Events.ClipboardPasting+t._eventNS,function(n,i){r=t.needPaintIndicator()}),i._bind(n.Events.ClipboardPasted+t._eventNS,function(n,i){var f=i.cellRange,e=i.sheet,u=t.getClipboardHelper();f&&u&&u.range&&u.fromSheet&&e&&(u.range.intersect(f.row,f.col,f.rowCount,f.colCount)||!e._isPastedInternal(u.fromSheet,u.range,e,e._eventHandler._getClipboardData())?t.needPaintIndicator(!1):t.needPaintIndicator(r))}))},i.prototype.paintCutCopyIndicator=function(t,i,r,u){var e=this._sheet,c=e._render,s=this.getClipboardHelper(),f=e.parent,v=f&&f.cutCopyIndicatorVisible?f.cutCopyIndicatorVisible():!0,l,a;if(v&&this._needPaintIndicator&&s&&s.fromSheet===e&&s.range){var y=e._getSheetLayout(),o=y.viewportRect(r,u),h=c._getPaintingRects(r,u,[s.range],i)[0];h&&o&&(t.save(),t.rect(o.x,o.y,o.width,o.height),t.clip(),h&&(l=f&&f.cutCopyIndicatorBorderColor?f.cutCopyIndicatorBorderColor():"blue",a=n._ThemeContext.getColor(e,l),c.paintDashRect(t,h,a)),t.beginPath(),t.restore())}},i.prototype.addRows=function(){this._needPaintIndicator&&this.needPaintIndicator(!1)},i.prototype.deleteRows=function(){this._needPaintIndicator&&this.needPaintIndicator(!1)},i.prototype.addColumns=function(){this._needPaintIndicator&&this.needPaintIndicator(!1)},i.prototype.deleteColumns=function(){this._needPaintIndicator&&this.needPaintIndicator(!1)},i.prototype.cancelIndicator=function(){this._needPaintIndicator&&this.needPaintIndicator(!1)},i.prototype._dispose=function(){this._sheet._eventHandler.unbind(n.Events.CellChanged+this._eventNS)},i}();n.CutCopyIndicatorManager=s})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(n){var rt,ut;n.feature("core.sheet_ui",["core.common"]);var it=undefined,t="backColor",i="foreColor",r="hAlign",u="vAlign",f="themeFont",e="font",o="formatter",s="borderLeft",h="borderTop",c="borderRight",l="borderBottom",a="locked",v="textIndent",y="wordWrap",p="shrinkToFit",w="backgroundImage",b="backgroundImageLayout",k="validator",d="cellType",et="bindingPath",g="tabStop",nt="textDecoration",tt="imeMode",ft=function(){function rt(n,t,i,r){var u=this;u.sheet=n;u.row=t;u.row2=t;u.col=i;u.col2=i;(r===it||r===null)&&(r=3);u.sheetArea=r}return rt.prototype.value=function(n){var t=this,i,r;if(arguments.length===0)return t.sheet.getValue(t.row,t.col,t.sheetArea);else{for(i=t.row;i<=t.row2;i++)for(r=t.col;r<=t.col2;r++)t._isValidIndex(i,r)&&t.sheet.setValue(i,r,n,t.sheetArea);return t}},rt.prototype.text=function(n){var t=this,i,r;if(arguments.length===0)return t.sheet.getText(t.row,t.col,t.sheetArea);else{for(i=t.row;i<=t.row2;i++)for(r=t.col;r<=t.col2;r++)t._isValidIndex(i,r)&&t.sheet.setText(i,r,n,t.sheetArea);return t}},rt.prototype.formula=function(n){var t=this,i,r;if(arguments.length===0)return t.sheet.getFormula(t.row,t.col,t.sheetArea);else{for(i=t.row;i<=t.row2;i++)for(r=t.col;r<=t.col2;r++)t._isValidIndex(i,r)&&t.sheet.setFormula(i,r,n,t.sheetArea);return t}},rt.prototype.bindingPath=function(n){var t=this,i,r;if(arguments.length===0)return t.sheet.getBindingPath(t.row,t.col,t.sheetArea);else{for(i=t.row;i<=t.row2;i++)for(r=t.col;r<=t.col2;r++)t._isValidIndex(i,r)&&t.sheet.setBindingPath(i,r,n,t.sheetArea);return t}},rt.prototype.comment=function(n){var t=this,i,r;if(arguments.length===0)return t.sheet.getComment(t.row,t.col);else{for(i=t.row;i<=t.row2;i++)for(r=t.col;r<=t.col2;r++)t._isValidIndex(i,r)&&t.sheet.setComment(i,r,n);return t}},rt.prototype.dataValidator=function(n){return arguments.length==0?this._getStyleProperty(k):this._setStyleProperty(k,n)},rt.prototype.cellType=function(n){return arguments.length==0?this._getStyleProperty(d):this._setStyleProperty(d,n)},rt.prototype.backgroundImage=function(n){return arguments.length==0?this._getStyleProperty(w):this._setStyleProperty(w,n)},rt.prototype.backgroundImageLayout=function(n){return arguments.length==0?this._getStyleProperty(b):this._setStyleProperty(b,n)},rt.prototype.backColor=function(n){return arguments.length===0?this._getStyleProperty(t):this._setStyleProperty(t,n)},rt.prototype.foreColor=function(n){return arguments.length===0?this._getStyleProperty(i):this._setStyleProperty(i,n)},rt.prototype.hAlign=function(n){return arguments.length===0?this._getStyleProperty(r):this._setStyleProperty(r,n)},rt.prototype.vAlign=function(n){return arguments.length===0?this._getStyleProperty(u):this._setStyleProperty(u,n)},rt.prototype.themeFont=function(n){return arguments.length===0?this._getStyleProperty(f):this._setStyleProperty(f,n)},rt.prototype.font=function(n){return arguments.length===0?this._getStyleProperty(e):this._setStyleProperty(e,n)},rt.prototype.formatter=function(n){return arguments.length===0?this._getStyleProperty(o):this._setStyleProperty(o,n)},rt.prototype.borderLeft=function(n){return arguments.length===0?this._getStyleProperty(s):this._setStyleProperty(s,n)},rt.prototype.borderTop=function(n){return arguments.length===0?this._getStyleProperty(h):this._setStyleProperty(h,n)},rt.prototype.borderRight=function(n){return arguments.length===0?this._getStyleProperty(c):this._setStyleProperty(c,n)},rt.prototype.borderBottom=function(n){return arguments.length===0?this._getStyleProperty(l):this._setStyleProperty(l,n)},rt.prototype.locked=function(n){return arguments.length===0?this._getStyleProperty(a):this._setStyleProperty(a,n)},rt.prototype.textIndent=function(n){return arguments.length===0?this._getStyleProperty(v):this._setStyleProperty(v,n)},rt.prototype.wordWrap=function(n){return arguments.length===0?this._getStyleProperty(y):this._setStyleProperty(y,n)},rt.prototype.shrinkToFit=function(n){return arguments.length===0?this._getStyleProperty(p):this._setStyleProperty(p,n)},rt.prototype.tabStop=function(n){return arguments.length===0?this._getStyleProperty(g):this._setStyleProperty(g,n)},rt.prototype.textDecoration=function(n){return arguments.length===0?this._getStyleProperty(nt):this._setStyleProperty(nt,n)},rt.prototype.imeMode=function(n){return arguments.length===0?this._getStyleProperty(tt):this._setStyleProperty(tt,n)},rt.prototype.clearStyleProperty=function(n){for(var i,u,t=this,r=t.row;r<=t.row2;r++)for(i=t.col;i<=t.col2;i++)t._isValidIndex(r,i)&&(u=t.sheet.getStyle(r,i,t.sheetArea),u&&u.clear(n))},rt.prototype._getStyleProperty=function(n){var t=this;return t.sheet.getStyleProperty(t.row,t.col,n,t.sheetArea)},rt.prototype._setStyleProperty=function(t,i){for(var u,e,r=this,f=r.row;f<=r.row2;f++)for(u=r.col;u<=r.col2;u++)r._isValidIndex(f,u)&&(e=r.sheet.getStyle(f,u,r.sheetArea),e||(e=new n.Style),e[t]=i,r.sheet.setStyle(f,u,e,r.sheetArea));return r},rt.prototype._isValidIndex=function(n,t){var r=this,i=r.sheet,u=r.sheetArea,f,e;return i&&(f=i.getRowCount(u),e=i.getColumnCount(u),0<=n&&n<f&&0<=t&&t<e)?!0:!1},rt}();n.Cell=ft;rt=function(){function rt(n,t,i){var r=this;r.sheet=n;r.index=t;r.index2=t;(i===it||i===null)&&(i=3);r.sheetArea=i}return rt.prototype.height=function(n){var t=this,i;if(arguments.length===0)return t.sheet.getRowHeight(t.index,t.sheetArea);else{for(i=t.index;i<=t.index2;i++)t._isValidIndex(i)&&t.sheet.setRowHeight(i,n,t.sheetArea);return t}},rt.prototype.visible=function(n){var t=this,i;if(arguments.length===0)return t.sheet.getRowVisible(t.index,t.sheetArea);else{for(i=t.index;i<=t.index2;i++)t._isValidIndex(i)&&t.sheet.setRowVisible(i,n,t.sheetArea);return t}},rt.prototype.resizable=function(n){var t=this,i;if(arguments.length===0)return t.sheet.getRowResizable(t.index,t.sheetArea);else{for(i=t.index;i<=t.index2;i++)t._isValidIndex(i)&&t.sheet.setRowResizable(i,n,t.sheetArea);return t}},rt.prototype.dataValidator=function(n){return arguments.length==0?this._getStyleProperty(k):this._setStyleProperty(k,n)},rt.prototype.cellType=function(n){return arguments.length==0?this._getStyleProperty(d):this._setStyleProperty(d,n)},rt.prototype.backgroundImage=function(n){return arguments.length==0?this._getStyleProperty(w):this._setStyleProperty(w,n)},rt.prototype.backgroundImageLayout=function(n){return arguments.length==0?this._getStyleProperty(b):this._setStyleProperty(b,n)},rt.prototype.backColor=function(n){return arguments.length===0?this._getStyleProperty(t):this._setStyleProperty(t,n)},rt.prototype.foreColor=function(n){return arguments.length===0?this._getStyleProperty(i):this._setStyleProperty(i,n)},rt.prototype.hAlign=function(n){return arguments.length===0?this._getStyleProperty(r):this._setStyleProperty(r,n)},rt.prototype.vAlign=function(n){return arguments.length===0?this._getStyleProperty(u):this._setStyleProperty(u,n)},rt.prototype.themeFont=function(n){return arguments.length===0?this._getStyleProperty(f):this._setStyleProperty(f,n)},rt.prototype.font=function(n){return arguments.length===0?this._getStyleProperty(e):this._setStyleProperty(e,n)},rt.prototype.formatter=function(n){return arguments.length===0?this._getStyleProperty(o):this._setStyleProperty(o,n)},rt.prototype.borderLeft=function(n){return arguments.length===0?this._getStyleProperty(s):this._setStyleProperty(s,n)},rt.prototype.borderTop=function(n){return arguments.length===0?this._getStyleProperty(h):this._setStyleProperty(h,n)},rt.prototype.borderRight=function(n){return arguments.length===0?this._getStyleProperty(c):this._setStyleProperty(c,n)},rt.prototype.borderBottom=function(n){return arguments.length===0?this._getStyleProperty(l):this._setStyleProperty(l,n)},rt.prototype.locked=function(n){return arguments.length===0?this._getStyleProperty(a):this._setStyleProperty(a,n)},rt.prototype.textIndent=function(n){return arguments.length===0?this._getStyleProperty(v):this._setStyleProperty(v,n)},rt.prototype.wordWrap=function(n){return arguments.length===0?this._getStyleProperty(y):this._setStyleProperty(y,n)},rt.prototype.shrinkToFit=function(n){return arguments.length===0?this._getStyleProperty(p):this._setStyleProperty(p,n)},rt.prototype.tabStop=function(n){return arguments.length===0?this._getStyleProperty(g):this._setStyleProperty(g,n)},rt.prototype.textDecoration=function(n){return arguments.length===0?this._getStyleProperty(nt):this._setStyleProperty(nt,n)},rt.prototype.imeMode=function(n){return arguments.length===0?this._getStyleProperty(tt):this._setStyleProperty(tt,n)},rt.prototype.clearStyleProperty=function(t){for(var f,i=this,u=i.sheet,r=i.index;r<=i.index2;r++)i._isValidIndex(r)&&(f=u.getStyle(r,-1,i.sheetArea),f&&(f.clear(t),u._trigger(n.Events.RowChanged,{sheet:u,sheetName:u._name,row:r,sheetArea:i.sheetArea,propertyName:t})))},rt.prototype._getStyleProperty=function(n){var t=this.sheet.getStyle(this.index,-1,this.sheetArea);return t?t[n]:it},rt.prototype._setStyleProperty=function(t,i){for(var f,r=this,u=r.index;u<=r.index2;u++)r._isValidIndex(u)&&(f=r.sheet.getStyle(u,-1,r.sheetArea),f||(f=new n.Style),f[t]=i,r.sheet.setStyle(u,-1,f,r.sheetArea));return r},rt.prototype._isValidIndex=function(n){if(this.sheet){var t=this.sheet.getRowCount(this.sheetArea);if(0<=n&&n<t)return!0}return!1},rt}();n.Row=rt;ut=function(){function rt(n,t,i){var r=this;r.sheet=n;r.index=t;r.index2=t;(i===it||i===null)&&(i=3);r.sheetArea=i}return rt.prototype.width=function(n){var t=this,i;if(arguments.length===0)return t.sheet.getColumnWidth(t.index,t.sheetArea);else{for(i=t.index;i<=t.index2;i++)t._isValidIndex(i)&&t.sheet.setColumnWidth(i,n,t.sheetArea);return t}},rt.prototype.visible=function(n){var t=this,i;if(arguments.length===0)return t.sheet.getColumnVisible(t.index,t.sheetArea);else{for(i=t.index;i<=t.index2;i++)t._isValidIndex(i)&&t.sheet.setColumnVisible(i,n,t.sheetArea);return t}},rt.prototype.resizable=function(n){var t=this,i;if(arguments.length===0)return t.sheet.getColumnResizable(t.index,t.sheetArea);else{for(i=t.index;i<=t.index2;i++)t._isValidIndex(i)&&t.sheet.setColumnResizable(i,n,t.sheetArea);return t}},rt.prototype.dataValidator=function(n){return arguments.length==0?this._getStyleProperty(k):this._setStyleProperty(k,n)},rt.prototype.cellType=function(n){return arguments.length==0?this._getStyleProperty(d):this._setStyleProperty(d,n)},rt.prototype.backgroundImage=function(n){return arguments.length==0?this._getStyleProperty(w):this._setStyleProperty(w,n)},rt.prototype.backgroundImageLayout=function(n){return arguments.length==0?this._getStyleProperty(b):this._setStyleProperty(b,n)},rt.prototype.backColor=function(n){return arguments.length===0?this._getStyleProperty(t):this._setStyleProperty(t,n)},rt.prototype.foreColor=function(n){return arguments.length===0?this._getStyleProperty(i):this._setStyleProperty(i,n)},rt.prototype.hAlign=function(n){return arguments.length===0?this._getStyleProperty(r):this._setStyleProperty(r,n)},rt.prototype.vAlign=function(n){return arguments.length===0?this._getStyleProperty(u):this._setStyleProperty(u,n)},rt.prototype.themeFont=function(n){return arguments.length===0?this._getStyleProperty(f):this._setStyleProperty(f,n)},rt.prototype.font=function(n){return arguments.length===0?this._getStyleProperty(e):this._setStyleProperty(e,n)},rt.prototype.formatter=function(n){return arguments.length===0?this._getStyleProperty(o):this._setStyleProperty(o,n)},rt.prototype.borderLeft=function(n){return arguments.length===0?this._getStyleProperty(s):this._setStyleProperty(s,n)},rt.prototype.borderTop=function(n){return arguments.length===0?this._getStyleProperty(h):this._setStyleProperty(h,n)},rt.prototype.borderRight=function(n){return arguments.length===0?this._getStyleProperty(c):this._setStyleProperty(c,n)},rt.prototype.borderBottom=function(n){return arguments.length===0?this._getStyleProperty(l):this._setStyleProperty(l,n)},rt.prototype.locked=function(n){return arguments.length===0?this._getStyleProperty(a):this._setStyleProperty(a,n)},rt.prototype.textIndent=function(n){return arguments.length===0?this._getStyleProperty(v):this._setStyleProperty(v,n)},rt.prototype.wordWrap=function(n){return arguments.length===0?this._getStyleProperty(y):this._setStyleProperty(y,n)},rt.prototype.shrinkToFit=function(n){return arguments.length===0?this._getStyleProperty(p):this._setStyleProperty(p,n)},rt.prototype.tabStop=function(n){return arguments.length===0?this._getStyleProperty(g):this._setStyleProperty(g,n)},rt.prototype.textDecoration=function(n){return arguments.length===0?this._getStyleProperty(nt):this._setStyleProperty(nt,n)},rt.prototype.imeMode=function(n){return arguments.length===0?this._getStyleProperty(tt):this._setStyleProperty(tt,n)},rt.prototype.clearStyleProperty=function(t){for(var f,i=this,u=i.sheet,r=i.index;r<=i.index2;r++)i._isValidIndex(r)&&(f=u.getStyle(-1,r,i.sheetArea),f&&(f.clear(t),u._trigger(n.Events.ColumnChanged,{sheet:u,sheetName:u._name,col:r,sheetArea:i.sheetArea,propertyName:t})))},rt.prototype._getStyleProperty=function(n){var t=this.sheet.getStyle(-1,this.index,this.sheetArea);return t?t[n]:it},rt.prototype._setStyleProperty=function(t,i){for(var f,r=this,u=r.index;u<=r.index2;u++)r._isValidIndex(u)&&(f=r.sheet.getStyle(-1,u,r.sheetArea),f||(f=new n.Style),f[t]=i,r.sheet.setStyle(-1,u,f,r.sheetArea));return r},rt.prototype._isValidIndex=function(n){if(this.sheet){var t=this.sheet.getColumnCount(this.sheetArea);if(0<=n&&n<t)return!0}return!1},rt}();n.Column=ut})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(t){function l(n,i,r,u){throw new Error(t.SR.Exp_InvalidAndSpace+n+t.SR.ColonSpace+i+t.SR.MustBeBetween+r+t.SR.SpaceAndSpace+u+t.SR.RightBracketFullStop);}function ot(n,t,i){for(var r in w)w[r]&&(n=n.replace(w[r],w[r].source));return t===!0?(n=n.replace(/~\?/g,ft.source),n=n.replace(/~\*/g,et.source),n=n.replace(/\?/g,"."),n=i?n.replace(/\*/g,"((.|\\n)+)"):n.replace(/\*/g,"((.|\\n)*)"),n=n.replace(ft,"\\?"),n=n.replace(et,"\\*")):(n=n.replace(/\?/g,"\\?"),n=n.replace(/\*/g,"\\*")),n}var b,wt;t.feature("core.sheet",["core.common","core.stringResource","core.sheet_event","core.sheet_render","core.basecelltype","core.sheet_ui","core.sheet_model","core.sheet_action","core.sheet_border"]);var i=null,u=undefined,f=Math.min,e=Math.max,o=Math.floor,r="undefined",c="function",h="number",p="string",a="boolean",y=window.document,ut=window.ko,bt=function(){function n(n){var i=1,r=2,u=8,f=16,t=this;t.rowHeader=(n&i)===i;t.columnHeader=(n&r)===r;t.unFormatted=(n&u)===u;t.formula=(n&f)===f;t.expandRows=!0;t.expandColumns=!0}return n.prototype.fixOptions=function(n){n&&(n.getColumnCount(2)<=0&&(this.rowHeader=!1),n.getRowCount(1)<=0&&(this.columnHeader=!1))},n}();var s=function(){function n(){}return n.copyTo=function(t,r,u,f,e,o,s,h,c,l){var v,y,a;n.checkArguments(t,r,u,f,e,o,s,h);t.suspendCalcService();f.suspendCalcService();v=i;(c&256)>0&&(v=n.copyBindingPath(t,r,u,f,e,o,s,h,l));try{if((c&1)>0&&(n.copyValue(t,r,u,f,e,o,s,h,l),(c&2)==0&&n.clearFormula(f,e,o,s,h,l),(c&256)>0)){var w=v.length,p=e<0?0:e,b=o<0?0:o;for(y=0;y<w;y++)(a=v[y],l&&f.isRowFilterOut(p+a.row))||f.setValue(p+a.row,b+a.col,a.value)}(c&2)>0&&n.copyFormula(t,r,u,f,e,o,s,h,l)}finally{t.resumeCalcService();f.resumeCalcService()}(c&64)>0&&n.copyStyle(t,r,u,f,e,o,s,h,l);(c&512)>0&&n.copyConditionalFormatRules(t,r,u,f,e,o,s,h);(c&4)>0&&n.copyComment(t,r,u,f,e,o,s,h,l);(c&16)>0&&n.copySparkline(t,r,u,f,e,o,s,h);(c&8)>0&&(r<0&&n.copyColumnRangeGroup(t,u,f,o,h),u<0&&n.copyRowRangeGroup(t,r,f,e,s));(c&32)>0&&n.copySpan(t,r,u,f,e,o,s,h);r<0&&n.copyColumnAxis(t,u,f,o,h,c);u<0&&n.copyRowAxis(t,r,f,e,s,c,l);r<0&&e<0&&u<0&&o<0&&n.copySheetInfo(t,f,c)},n.checkArguments=function(n,i,r,u,e,o,s,h){var c,v,a,y;if(!n)throw new Error(t.SR.Exp_SrcIsNull);if(!u)throw new Error(t.SR.Exp_DestIsNull);(i<-1||i>=n.getRowCount())&&l("from row index",i,"-1",n.getRowCount()-1);(r<-1||r>=n.getColumnCount())&&l("from column index",r,"-1",n.getColumnCount()-1);(e<-1||e>=u.getRowCount())&&l("to row index",e,"-1",u.getRowCount()-1);(o<-1||o>=u.getColumnCount())&&l("to column index",o,"-1",u.getColumnCount()-1);c=r;r<0&&(c=0,h=n.getColumnCount());v=o<0?0:o;(h<1||c+h>n.getColumnCount()||v+h>u.getColumnCount())&&l("column count",h,"1",f(n.getColumnCount()-c,u.getColumnCount()-v));a=i;i<0&&(a=0,s=n.getRowCount());y=e<0?0:e;(s<1||a+s>n.getRowCount()||y+s>u.getRowCount())&&l("row count",s,"1",f(n.getRowCount()-a,u.getRowCount()-y))},n.copyValue=function(u,e,o,s,h,c,l,a,v){var st=!(u===s&&u._name===s._name),b,k,y,p,w,ht,lt,yt;if(e<0){var d=1,g=o,ft=c;if(b=f(u.getRowCount(d),s.getRowCount(d)),k=a,o<0&&(g=0,k=u.getColumnCount()),c<0&&(ft=0),st)for(y=0;y<b;y++)for(p=0;p<k;p++)w=u.getValue(y,g+p,d),(typeof w===r||w===i)&&u.isColumnBound(g+p)&&(y===u.colHeaderAutoTextIndex||y===b-1&&u.colHeaderAutoTextIndex===-1)&&(w=u.getDataColumnName(g+p)),typeof w===r||w===i?s._setValueInternal(y,ft+p,i,d,!1):s._setValueInternal(y,ft+p,n.cloneObject(w),d,!1);else{for(ht=new t._GcSheetModel(b,k,i),y=0;y<b;y++)for(p=0;p<k;p++)w=u._getModel(d).getValue(y,g+p),(typeof w===r||w===i)&&u.isColumnBound(g+p)&&(y===u.colHeaderAutoTextIndex||y===b-1&&u.colHeaderAutoTextIndex===-1)&&(w=u.getDataColumnName(g+p)),typeof w!==r&&w!==i&&ht.setValue(y,p,n.cloneObject(w));for(y=0;y<b;y++)for(p=0;p<k;p++)s._setValueInternal(y,ft+p,ht.getValue(y,p),d,!1)}}if(o<0){var nt=2,ct=e,et=h;if(b=l,k=f(u.getColumnCount(nt),s.getColumnCount(nt)),e<0&&(ct=0,b=u.getRowCount()),h<0&&(et=0),st)for(y=0;y<b;y++)for(p=0;p<k;p++)w=u.getValue(ct+y,p,nt),typeof w===r||w===i?s._setValueInternal(et+y,p,i,nt,!1):s._setValueInternal(et+y,p,n.cloneObject(w),nt,!1);else{for(lt=new t._GcSheetModel(b,k,i),y=0;y<b;y++)for(p=0;p<k;p++)w=u._getModel(nt).getValue(ct+y,p),typeof w!==r&&w!==i&<.setValue(y,p,n.cloneObject(w));for(y=0;y<b;y++)for(p=0;p<k;p++)s._setValueInternal(et+y,p,lt.getValue(y,p),nt,!1)}}var it=3,at=e,vt=o,tt=h,ot=c,rt=l,ut=a;if(e<0&&(at=0,rt=f(u.getRowCount(),s.getRowCount())),o<0&&(vt=0,ut=f(u.getColumnCount(),s.getColumnCount())),h<0&&(tt=0),c<0&&(ot=0),st){for(y=0;y<rt;y++)if(!v||!s.isRowFilterOut(tt+y))for(p=0;p<ut;p++)w=u.getValue(at+y,vt+p,it),typeof w===r||w===i?s._setValueInternal(tt+y,ot+p,i,it,!1):s._setValueInternal(tt+y,ot+p,n.cloneObject(w),it,!1)}else{for(yt=new t._GcSheetModel(rt,ut,i),y=0;y<rt;y++)for(p=0;p<ut;p++)w=u.getValue(at+y,vt+p,it),typeof w!==r&&w!==i&&yt.setValue(y,p,n.cloneObject(w));for(y=0;y<rt;y++)if(!v||!s.isRowFilterOut(tt+y))for(p=0;p<ut;p++)s._setValueInternal(tt+y,ot+p,yt.getValue(y,p),it,!1)}},n._copyMoveBindingPath=function(n,r,u,e,o,s,h,c,l,a){var p=r,w=u,g=o,tt=s,k=h,d=c,nt,rt,it,b,v,y;if(r<0&&(p=0,k=f(n.getRowCount(),e.getRowCount())),u<0&&(w=0,d=f(n.getColumnCount(),e.getColumnCount())),o<0&&(g=0),s<0&&(tt=0),nt=[],rt=!(n===e&&n._name===e._name),rt)for(v=0;v<k;v++)for(y=0;y<d;y++)b=n.getBindingPath(p+v,w+y),e.setBindingPath(g+v,tt+y,b),b&&nt.push({row:v,col:y,value:n.getValue(p+v,w+y)}),l&&n.setBindingPath(p+v,w+y,i);else{for(it=new t._GcSheetModel(k,d,i),v=0;v<k;v++)for(y=0;y<d;y++)b=n.getBindingPath(p+v,w+y),it.setBindingPath(v,y,b),b&&nt.push({row:v,col:y,value:n.getValue(p+v,w+y)}),l&&n.setBindingPath(p+v,w+y,i);for(v=0;v<k;v++)if(!a||!e.isRowFilterOut(g+v))for(y=0;y<d;y++)e.setBindingPath(g+v,tt+y,it.getBindingPath(v,y))}return nt},n.copyBindingPath=function(t,i,r,u,f,e,o,s,h){return n._copyMoveBindingPath(t,i,r,u,f,e,o,s,!1,h)},n.cloneObject=function(t){var u,i;if(typeof t===h||typeof t===p||typeof t===a||typeof t===r)return t;else if(t instanceof Date)return new Date(t);else u=t instanceof Object?new t.constructor:new t.constructor(t.valueOf());for(i in t)t.hasOwnProperty(i)&&u[i]!==t[i]&&(u[i]=typeof this[i]=="object"?n.cloneObject(t[i]):t[i]);return u.toString=t.toString,u.valueOf=t.valueOf,u},n.clearFormula=function(n,t,r,u,f,e){var o,s;for(t<0&&(t=0,u=n.getRowCount()),r<0&&(r=0,f=n.getColumnCount()),o=t;o<u;o++)if(!e||!n.isRowFilterOut(o))for(s=r;s<f;s++)n.setFormula(o,s,i)},n._copyExpression=function(i,r,u,f,e){var l=i,h,s,o,y;if(!t.util.hasCalc())return l;var c=t.Calc.Expressions,b=t.Calc.Functions,a=t.Calc.Parser,v=t.Calc.Errors.Reference,p=c.ErrorExpression,w=c.ExternalErrorExpression;if(i instanceof c.ParenthesesExpression)l=new c.ParenthesesExpression,l.argument=n._copyExpression(i.argument,r,u,f,e);else if(i instanceof c.CellExpression){if(i.rowRelative&&(i.row+r<0||i.row+r>a.maxRowCount)||i.columnRelative&&(i.column+u<0||i.column+u>a.maxColumnCount))return new p(v);l=new c.CellExpression(i.row,i.column,i.rowRelative,i.columnRelative)}else if(i instanceof c.ExternalCellExpression){if(i.rowRelative&&(i.row+r<0||i.row+r>a.maxRowCount)||i.columnRelative&&(i.column+u<0||i.column+u>a.maxColumnCount))return new w(i.source,v);l=new c.ExternalCellExpression(i.source,i.row,i.column,i.rowRelative,i.columnRelative)}else if(i instanceof c.RangeExpression){if((h=i,h.startRowRelative&&(h.startRow+r<0||h.startRow+r>a.maxRowCount))||h.startColumnRelative&&(h.startColumn+u<0||h.startColumn+u>a.maxColumnCount)||h.endRowRelative&&(h.endRow+r<0||h.endRow+r>a.maxRowCount)||h.endColumnRelative&&(h.endColumn+u<0||h.endColumn+u>a.maxColumnCount))return new p(v);l=new c.RangeExpression(h.startRow,h.startColumn,h.endRow,h.endColumn,h.startRowRelative,h.startColumnRelative,h.endRowRelative,h.endColumnRelative);l.isFullRow=h.isFullRow;l.isFullColumn=h.isFullColumn}else if(i instanceof c.ExternalRangeExpression){if((s=i,s.startRowRelative&&(s.startRow+r<0||s.startRow+r>a.maxRowCount))||s.startColumnRelative&&(s.startColumn+u<0||s.startColumn+u>a.maxColumnCount)||s.endRowRelative&&(s.endRow+r<0||s.endRow+r>a.maxRowCount)||s.endColumnRelative&&(s.endColumn+u<0||s.endColumn+u>a.maxColumnCount))return new w(s.source,v);l=new c.ExternalRangeExpression(s.source,s.startRow,s.startColumn,s.endRow,s.endColumn,s.startRowRelative,s.startColumnRelative,s.endRowRelative,s.endColumnRelative);l.isFullRow=s.isFullRow;l.isFullColumn=s.isFullColumn}else if(i instanceof c.SheetRangeExpression){if((o=i,o.startRowRelative&&(o.startRow+r<0||o.startRow+r>a.maxRowCount))||o.startColumnRelative&&(o.startColumn+u<0||o.startColumn+u>a.maxColumnCount)||o.endRowRelative&&(o.endRow+r<0||o.endRow+r>a.maxRowCount)||o.endColumnRelative&&(o.endColumn+u<0||o.endColumn+u>a.maxColumnCount))return new c.SheetRangeErrorExpression(o.startSource,o.endSource,v);l=new c.SheetRangeExpression(o.startSource,o.endSource,o.startRow,o.startColumn,o.endRow,o.endColumn,o.startRowRelative,o.startColumnRelative,o.endRowRelative,o.endColumnRelative);l.isFullRow=o.isFullRow;l.isFullColumn=o.isFullColumn}else if(i instanceof c.UnaryOperatorExpression)l=new c.UnaryOperatorExpression(i.operator,n._copyExpression(i.operand,r,u,f,e));else if(i instanceof c.BinaryOperatorExpression)l=new c.BinaryOperatorExpression(i.operator,n._copyExpression(i.left,r,u,f,e),n._copyExpression(i.right,r,u,f,e));else if(i instanceof c.FunctionExpression){if(l=new c.FunctionExpression(i.fn,[]),i.args&&i.args.length>0)for(y=0;y<i.args.length;y++)l.args[y]=n._copyExpression(i.args[y],r,u,f,e)}else i instanceof c.StructReferenceExpression&&(l=i.offsetWhenCopy(f,e));return l},n.copyFormula=function(r,e,o,s,h,c,l,a,v){var vt=r._getCalcModel(),yt=s._getCalcModel(),gt=r._getSheetSource(),pt=s._getSheetSource(),dt,tt,ut,y,p,ht,ct,w,d,lt,at,et,ot,kt,it;if(vt&&yt){var wt=e,bt=o,rt=h,st=c,g=l,nt=a;for(e<0&&(wt=0,g=f(r.getRowCount(),s.getRowCount())),o<0&&(bt=0,nt=f(r.getColumnCount(),s.getColumnCount())),h<0&&(rt=0),c<0&&(st=0),dt=!(r===s&&r._name===s._name),tt=s._getSheetSource(),tt&&tt.unlinkCellExpression(rt,st,g,nt),ut=new t._CalcModel(g,nt,i),y=0;y<g;y++)for(p=0;p<nt;p++)vt.CopyExpr(ut,y+wt,p+bt,y,p);for(ht={},ct=s.getCalcService(),y=0;y<g;y++)if(!v||!s.isRowFilterOut(y+rt))for(w=y+rt,p=0;p<nt;p++){var ft=ut.getNode(y,p,!1),k=ft&&ft.expr,b=p+st;if(k){if(k===ht)continue;if(k=n._copyExpression(k,w,b,h-e,c-o),d=ft.arrayInfo,tt)if(d){for(lt=g-y<d.rowCount?g-y:d.rowCount,at=nt-p<d.colCount?nt-p:d.colCount,et=0;et<lt;et++)for(ot=0;ot<at;ot++)ut.getNode(y+et,p+ot).expr=ht;s._setArrayFormulaCore(w,b,lt,at,ct.unparse(k,w,b),!1,3)}else kt=k?ct.unparse(k,w,b):u,s._getModel().setFormula(w,b,kt),it=ft.workingExpr,it&&(it=n._copyExpression(it,w,b,h-e,c-o)),pt._setCellExpression(w,b,k,it,d);else pt.setExpression(w,b,k,d,!0)}else tt&&tt.getExpression(w,b)&&yt.setExpr(w,b,u,u,u)}}},n.copyStyle=function(n,r,u,e,o,s,h,c,l){var ut=!(n===e&&n._name===e._name),p,w,a,v,y,tt,k,ft,it,d,et,ht;if(r<0)if(tt=u,k=s,p=f(n.getRowCount(1),e.getRowCount(1)),w=c,u<0&&(tt=0,w=n.getColumnCount()),s<0&&(k=0),ut)for(a=0;a<p;a++)for(v=0;v<w;v++)y=n.getCompositeStyle(a,tt+v,1),y?e.setStyle(a,k+v,y.clone(),1):e.setStyle(a,k+v,i,1);else{for(ft=new t._GcSheetModel(p,w,i),a=0;a<p;a++)for(v=0;v<w;v++)y=n.getCompositeStyle(a,tt+v,1),y&&ft.setValue(a,v,y.clone());for(a=0;a<p;a++)for(v=0;v<w;v++)e.setStyle(a,k+v,ft.getValue(a,v),1)}if(u<0)if(it=r,d=o,p=h,w=f(n.getColumnCount(2),e.getColumnCount(2)),r<0&&(it=0,p=n.getRowCount()),o<0&&(d=0),ut)for(a=0;a<p;a++)for(v=0;v<w;v++)y=n.getCompositeStyle(it+a,v,2),y?e.setStyle(d+a,v,y.clone(),2):e.setStyle(d+a,v,i,2);else{for(et=new t._GcSheetModel(p,w,i),a=0;a<p;a++)for(v=0;v<w;v++)y=n.getCompositeStyle(it+a,v,2),y&&et.setValue(a,v,y.clone());for(a=0;a<p;a++)for(v=0;v<w;v++)e.setStyle(d+a,v,et.getValue(a,v),2)}var ot=r,st=u,b=o,rt=s,g=h,nt=c;if(r<0&&(ot=0,g=f(n.getRowCount(),e.getRowCount())),u<0&&(st=0,nt=f(n.getColumnCount(),e.getColumnCount())),o<0&&(b=0),s<0&&(rt=0),ut){for(a=0;a<g;a++)if(!l||!e.isRowFilterOut(b+a))for(v=0;v<nt;v++)y=n.getCompositeStyle(ot+a,st+v,3),y?e.setStyle(b+a,rt+v,y.clone(),3):e.setStyle(b+a,rt+v,i,3)}else{for(ht=new t._GcSheetModel(g,nt,i),a=0;a<g;a++)for(v=0;v<nt;v++)y=n.getCompositeStyle(ot+a,st+v,3),y&&ht.setValue(a,v,y.clone());for(a=0;a<g;a++)if(!l||!e.isRowFilterOut(b+a))for(v=0;v<nt;v++)e.setStyle(b+a,rt+v,ht.getValue(a,v),3)}},n.copyConditionalFormatRules=function(n,i,r,u,f,e,o,s){var k=[],d=n.getConditionalFormats(),c,l,w,y,v,b,p,h,a;if(d)for(c=0;c<o;c++)for(l=0;l<s;l++)for(w=d.getRules(i+c,r+l),y=0;y<w.length;y++){for(v=w[y],b=[],p=0;p<v.ranges.length;p++){if(h=v.ranges[p],k.indexOf(h)>-1||!h.contains(i+c,r+l))continue;else k.push(h);a=new t.Range(-1,-1,-1,-1);a.row=f+c;a.col=e+l;a.rowCount=h.row+h.rowCount>=o+i?o-c:i<h.row?h.rowCount:h.row+h.rowCount-i;a.colCount=h.col+h.colCount>=s+r?s-l:r<h.col?h.colCount:h.col+h.colCount-r;b.push(a)}v.ranges=v.ranges.concat(b)}},n.copyComment=function(n,t,i,r,u,e,o,s,h){var b=t,k=i,w=u,d=e,g=o,nt=s,y,a,v,l,p,tt,c;for(t<0&&(b=0,g=f(n.getRowCount(),r.getRowCount())),i<0&&(k=0,nt=f(n.getColumnCount(),r.getColumnCount())),u<0&&(w=0),e<0&&(d=0),y=[],a=0;a<g;a++)if(!h||!r.isRowFilterOut(w+a))for(v=0;v<nt;v++)c=n.getComment(b+a,k+v),c&&(l=c.clone(),l._sheet=r,l._rowIndex=w+a,l._colIndex=d+v,l._location=l._defaultLocation,y.push(l));for(p=0,tt=y.length;p<tt;p++)c=y[p],r.setComment(c._rowIndex,c._colIndex,c)},n.copyColumnRangeGroup=function(t,i,r,u,e){var o=i,s=u,h=e,l,c;o<0&&(o=0,h=f(t.getColumnCount(),r.getColumnCount()));u<0&&(s=0);l=!(t===r&&t._name===r._name);l?t.colRangeGroup&&r.colRangeGroup&&n.crossSheetCopyRangeGroup(t.colRangeGroup,o,r.colRangeGroup,s,h):(c=t.colRangeGroup,c&&c._copy(o,s,h))},n.crossSheetCopyRangeGroup=function(n,i,r,u,f){var o,e,s,h;if(i<0&&(i=0),u<0&&(u=0),o=[],n)for(e=n.items.nextNonEmptyIndex(i-1);e>=0&&e<i+f;)o[e-i]=new t.RangeGroupItemInfo(n.items[e]),e=n.items.nextNonEmptyIndex(e);if(r&&(r.items.clear(u,f),o.length>0))for(s in o)o.hasOwnProperty(s)&&(h=o[s],r.items[u+s]=h)},n.copySparkline=function(n,t,i,r,u,e,o,s,h){var l=t,a=i,v=u,y=e,p=o,w=s,b,c;t<0&&(l=0,p=f(n.getRowCount(),r.getRowCount()));i<0&&(a=0,w=f(n.getColumnCount(),r.getColumnCount()));u<0&&(v=0);e<0&&(y=0);b=!(n===r&&n._name===r._name);b?(c=r._sparklineGroupManager,c&&c._exCopy(n,l,a,v,y,p,w,h)):(c=n._sparklineGroupManager,c&&c._copy(l,a,v,y,p,w,h))},n.copyRowRangeGroup=function(t,i,r,u,e){var o=i,s=u,h=e,l,c;i<0&&(o=0,h=f(t.getRowCount(),r.getRowCount()));u<0&&(s=0);l=!(t===r&&t._name===r._name);l?t.rowRangeGroup&&r.rowRangeGroup&&n.crossSheetCopyRangeGroup(t.rowRangeGroup,o,r.rowRangeGroup,s,h):(c=t.rowRangeGroup,c&&c._copy(o,s,h))},n.copySpan=function(t,i,r,u,e,o,s,h){var l=i,c=r,a=e,v=o,y=s,p=h,w,b,k,d;i<0&&(l=0,y=f(t.getRowCount(),u.getRowCount()));c<0&&(c=0,p=f(t.getColumnCount(),u.getColumnCount()));e<0&&(a=0);o<0&&(v=0);w=!(t===u&&t._name===u._name);i<0&&(w?n.crossSheetCopySpans(t._colHeaderSpanModel,-1,c,u._colHeaderSpanModel,-1,v,-1,p):(b=t._getSpanModel(1),b&&b.copy(-1,c,-1,v,-1,p)));r<0&&(w?n.crossSheetCopySpans(t._rowHeaderSpanModel,l,-1,u._rowHeaderSpanModel,a,-1,y,-1):(k=t._getSpanModel(2),k&&k.copy(l,-1,a,-1,y,-1)));w?n.crossSheetCopySpans(t._spanModel,l,c,u._spanModel,a,v,y,p):(d=t._getSpanModel(3),d&&d.copy(l,c,a,v,y,p))},n.crossSheetCopySpans=function(i,r,u,f,e,o,s,h){var v=n.getSpans(i),y=n.getSpans(f),w=[],l,a,c,p,b;if(r===-1){if(v&&v.length>0)for(l=0;l<v.length;l++)c=v[l],c.col>=u&&c.col+c.colCount<=u+h&&w.push(new t.Range(c.row,o+c.col-u,c.rowCount,c.colCount));if(y&&y.length>0)for(l=0;l<y.length;l++)if(c=y[l],c.col>=o&&c.col<o+h)for(a=0;a<f.length;a++)if(p=f[a],p.row===c.row&&p.col===c.col){f.splice(a,1);break}}else if(u===-1){if(v&&v.length>0)for(l=0;l<v.length;l++)c=v[l],r<=c.row&&c.row+c.rowCount<=r+s&&w.push(new t.Range(e+c.row-r,c.col,c.rowCount,c.colCount));if(y&&y.length>0)for(l=0;l<y.length;l++)if(c=y[l],c.row>=e&&c.row<e+s)for(a=0;a<f.length;a++)if(p=f[a],p.row===c.row&&p.col===c.col){f.splice(a,1);break}}else{if(v&&v.length>0)for(l=0;l<v.length;l++)c=v[l],r<=c.row&&c.row<r+s&&u<=c.col&&c.col<u+h&&w.push(new t.Range(e+c.row-r,o+c.col-u,c.rowCount,c.colCount));if(y&&y.length>0)for(l=0;l<y.length;l++)if(c=y[l],c.row>=e&&c.row<e+s&&c.col>=o&&c.col<o+h)for(a=0;a<f.length;a++)if(p=f[a],p.row===c.row&&p.col===c.col){f.splice(a,1);break}}if(w.length>0&&f)for(l=0;l<w.length;l++)b=w[l],f.push(b)},n.getSpans=function(n){return n&&n.length>0?n.slice(0):i},n.copyColumnAxis=function(n,t,r,e,o,s){var v=t,l=e,k=o,c,h,p,w,a,d,y,b;for(t<0&&(v=0,k=f(n.getColumnCount(),r.getColumnCount())),e<0&&(l=0),c=1,h=0;h<k;h++)p=n._getActualColumnWidth(h+v),p!==u&&p!==i&&r.setColumnWidth(h+l,p),w=n.getColumnVisible(h+v),w!==u&&w!==i&&r.setColumnVisible(h+l,w),(s&64)>0&&(a=n.getActualStyle(-1,h+v),a?r.setStyle(-1,h+l,a.clone()):r.setStyle(-1,h+l,i),a=n.getActualStyle(-1,h+v,c),a?r.setStyle(-1,h+l,a.clone(),c):r.setStyle(-1,h+l,i,c));for(d=f(n.getRowCount(c),r.getRowCount(c)),y=0;y<d;y++)b=n._getActualRowHeight(y,c),b!==u&&b!==i&&r.setRowHeight(y,b,c)},n.cloneAxisInfo=function(n,t,r){for(var u,s,f,e=[],o=0;o<r;o++)if(u=n[t+o],u){s={};for(f in u)u.hasOwnProperty(f)&&(s[f]=u[f]);e.push(s)}else e.push(i);return e},n.getAxisInfo=function(n,t,i){for(var u=[],r=0;r<i;r++)u.push(n[t+r]);return u},n.setAxisInfo=function(n,t,i){if(t)for(var r=0;r<n.length;r++)t[i+r]=n[r]},n.copyRowAxis=function(n,t,r,e,o,s,h){var y=t,l=e,d=o,a,c,w,b,v,g,p,k;for(t<0&&(y=0,d=f(n.getRowCount(),r.getRowCount())),e<0&&(l=0),a=2,c=0;c<d;c++)h&&r.isRowFilterOut(c+l)||(w=n._getActualRowHeight(c+y),w!==u&&w!==i&&r.setRowHeight(c+l,w),b=n.getRowVisible(c+y),b!==u&&b!==i&&r.setRowVisible(c+l,b),(s&64)>0&&(v=n.getActualStyle(c+y,-1),v?r.setStyle(c+l,-1,v.clone()):r.setStyle(c+l,-1,i),v=n.getActualStyle(c+y,-1,a),v?r.setStyle(c+l,-1,v.clone(),a):r.setStyle(c+l,-1,i,a)));for(g=f(n.getColumnCount(a),r.getColumnCount(a)),p=0;p<g;p++)k=n._getActualColumnWidth(p,a),k!==u&&k!==i&&r.setColumnWidth(p,k,a)},n.copySheetInfo=function(n,t,i){if(!(n===t&&n._name===t._name)){if((i&64)>0){var r=1,u=2;t.setDefaultStyle(n.getDefaultStyle().clone());t.setDefaultStyle(n.getDefaultStyle(r).clone(),r);t.setDefaultStyle(n.getDefaultStyle(u).clone(),u)}t.defaults.colWidth=n.defaults.colWidth;t.defaults.rowHeight=n.defaults.rowHeight;t.defaults.rowHeaderColWidth=n.defaults.rowHeaderColWidth}},n.moveTo=function(t,r,u,e,o,s,h,c,l){var v,y,p,w,b,a;n.checkArguments(t,r,u,e,o,s,h,c);t.suspendCalcService();e.suspendCalcService();v=i;(l&256)>0&&(v=n.moveBindingPath(t,r,u,e,o,s,h,c));try{if((l&1)>0&&(n.moveValue(t,r,u,e,o,s,h,c),(l&2)==0&&n.clearFormula(e,o,s,h,c),(l&256)>0)){var k=v.length,d=o<0?0:o,g=s<0?0:s;for(y=0;y<k;y++)p=v[y],e.setValue(d+p.row,g+p.col,p.value)}(l&2)>0&&n.moveFormula(t,r,u,e,o,s,h,c)}finally{t.resumeCalcService();e.resumeCalcService()}if((l&64)>0&&n.moveStyle(t,r,u,e,o,s,h,c),(l&512)>0&&n.moveConditionalFormatRules(t,r,u,e,o,s,h,c),(l&4)>0&&n.moveComment(t,r,u,e,o,s,h,c),(l&16)>0&&n.moveSparkline(t,r,u,e,o,s,h,c),(l&8)>0&&(r<0&&n.moveColumnRangeGroup(t,u,e,s,c),u<0&&n.moveRowRangeGroup(t,r,e,o,h)),(l&32)>0&&n.moveSpan(t,r,u,e,o,s,h,c),r<0&&n.moveColumnAxis(t,u,e,s,c,l),u<0&&n.moveRowAxis(t,r,e,o,h,l),r<0&&o<0&&u<0&&s<0&&n.moveSheetInfo(t,e,l),r<0)for(w=u,b=c,u<0&&(w=0,b=f(t.getColumnCount(),e.getColumnCount())),a=0;a<b;a++)t.isColumnBound(w+a)&&(t._colInfos[w+a]=i)},n.moveValue=function(n,u,e,o,s,h,c,l){var ht=!(n===o&&n._name===o._name),p,w,a,v,y,ct,b,g,it,lt,at;if(u<0){var k=1,d=e,et=h;if(p=f(n.getRowCount(k),o.getRowCount(k)),w=l,e<0&&(d=0,w=n.getColumnCount()),h<0&&(et=0),ht)for(a=0;a<p;a++)for(v=0;v<w;v++)y=n._getModel(k).getValue(a,d+v),(typeof y===r||y===i)&&n.isColumnBound(d+v)&&(a===n.colHeaderAutoTextIndex||a===p-1&&n.colHeaderAutoTextIndex===-1)&&(y=n.getDataColumnName(d+v)),typeof y===r||y===i?o._setValueInternal(a,et+v,i,k,!1):(o._setValueInternal(a,et+v,y,k,!1),n._setValueInternal(a,d+v,i,k,!1));else{for(ct=new t._GcSheetModel(p,w,i),a=0;a<p;a++)for(v=0;v<w;v++)y=n._getModel(k).getValue(a,d+v),(typeof y===r||y===i)&&n.isColumnBound(d+v)&&(a===n.colHeaderAutoTextIndex||a===p-1&&n.colHeaderAutoTextIndex===-1)&&(y=n.getDataColumnName(d+v)),typeof y!==r&&y!==i&&ct.setValue(a,v,y),n._setValueInternal(a,d+v,i,k,!1);for(a=0;a<p;a++)for(v=0;v<w;v++)o._setValueInternal(a,et+v,ct.getValue(a,v),k,!1)}}if(b=2,e<0)if(g=u,it=s,p=c,w=f(n.getColumnCount(b),o.getColumnCount(b)),u<0&&(g=0,p=n.getRowCount()),s<0&&(it=0),ht)for(a=0;a<p;a++)for(v=0;v<w;v++)y=n.getValue(g+a,v,b),typeof y===r||y===i?o._setValueInternal(it+a,v,i,b,!1):(o._setValueInternal(it+a,v,y,b,!1),n._setValueInternal(g+a,v,i,b,!1));else{for(lt=new t._GcSheetModel(p,w,i),a=0;a<p;a++)for(v=0;v<w;v++)y=n._getModel(b).getValue(g+a,v),typeof y!==r&&y!==i&<.setValue(a,v,y),n._setValueInternal(g+a,v,i,b,!1);for(a=0;a<p;a++)for(v=0;v<w;v++)o._setValueInternal(it+a,v,lt.getValue(a,v),b,!1)}var rt=3,ut=u,ft=e,ot=s,st=h,nt=c,tt=l;if(u<0&&(ut=0,nt=f(n.getRowCount(),o.getRowCount())),e<0&&(ft=0,tt=f(n.getColumnCount(),o.getColumnCount())),s<0&&(ot=0),h<0&&(st=0),ht)for(a=0;a<nt;a++)for(v=0;v<tt;v++)y=n.getValue(ut+a,ft+v),typeof y===r||y===i?o._setValueInternal(ot+a,st+v,i,rt,!1):(o._setValueInternal(ot+a,st+v,y,rt,!1),n._setValueInternal(ut+a,ft+v,i,rt,!1));else{for(at=new t._GcSheetModel(nt,tt,i),a=0;a<nt;a++)for(v=0;v<tt;v++)y=n.getValue(ut+a,ft+v),typeof y!==r&&y!==i&&at.setValue(a,v,y);for(a=0;a<nt;a++)for(v=0;v<tt;v++)n._setValueInternal(ut+a,ft+v,i,rt,!1);for(a=0;a<nt;a++)for(v=0;v<tt;v++)o._setValueInternal(ot+a,st+v,at.getValue(a,v),rt,!1)}},n.moveFormula=function(n,r,e,o,s,h,c,l){var ft=n._getCalcModel(),et=o._getCalcModel(),it,ut,st,rt,ht,tt;if(ft&&et){var k=r,d=e,y=s,p=h,w=c,b=l;r<0&&(k=0,w=f(n.getRowCount(),o.getRowCount()));e<0&&(d=0,b=f(n.getColumnCount(),o.getColumnCount()));s<0&&(y=0);h<0&&(p=0);var lt=!(n===o&&n._name===o._name),g=n._getSheetSource(),nt=o._getSheetSource();g&&(g.unlinkCellExpression(k,d,w,b),g._addDependentsToAdjust(k,d,w,b));nt&&(nt.unlinkCellExpression(y,p,w,b),nt._addDependentsToAdjust(y,p,w,b));for(var at=n._getModel(),ct=o._getModel(),ot=[],v,a=0;a<w;a++)for(v=0;v<b;v++)it=ft.getNode(a+k,v+d),it?(ot.push({expr:it.expr,workingExpr:it.workingExpr,arrayInfo:it.arrayInfo}),at.setFormula(a+k,v+d,i),ft.clearExpr(a+k,v+d)):ot.push(i);for(ut=o.getCalcService(),a=0;a<w;a++)for(v=0;v<b;v++)rt=ot.shift(),rt?(ht=rt.expr,tt=rt.arrayInfo,ut&&tt&&tt.row===k+a&&tt.col===d+v&&(st=new t.Range(a+y,v+p,tt.rowCount,tt.colCount),ct.setFormula(a+y,v+p,ut.unparse(ht,a+y,v+p),st)),tt&&(tt.row=a+y,tt.col=v+p),et.setExpr(a+y,v+p,ht,tt?st:u,rt.workingExpr)):(ut&&ct.setFormula(a+y,v+p,u),et.setExpr(a+y,v+p,u,u,u));g&&g._addCellsToAdjust(k,d,w,b);nt&&nt._addCellsToAdjust(y,p,w,b);g&&g._controller&&g._controller.adjustFormulasOnMove(g,k,d,nt,y,p,w,b);lt===!0&&nt&&nt._controller&&nt._controller.adjustFormulasOnMove(g,k,d,nt,y,p,w,b)}},n.moveStyle=function(n,r,u,e,o,s,h,c){var ot=!(n===e&&n._name===e._name),b=1,y,p,l,a,v,k,g,st,w,d,nt,ht,ct;if(r<0)if(k=u,g=s,y=f(n.getRowCount(b),e.getRowCount(b)),p=c,u<0&&(k=0,p=n.getColumnCount()),s<0&&(g=0),ot)for(l=0;l<y;l++)for(a=0;a<p;a++)v=n.getCompositeStyle(l,k+a,b),v?(e.setStyle(l,g+a,v.clone(),b),n.setStyle(l,k+a,i,b)):e.setStyle(l,g+a,i,b);else{for(st=new t._GcSheetModel(y,p,i),l=0;l<y;l++)for(a=0;a<p;a++)v=n.getCompositeStyle(l,k+a,b),v&&st.setValue(l,a,v.clone()),n.setStyle(l,k+a,i,b);for(l=0;l<y;l++)for(a=0;a<p;a++)e.setStyle(l,g+a,st.getValue(l,a),b)}if(w=2,u<0)if(d=r,nt=o,y=h,p=f(n.getColumnCount(w),e.getColumnCount(w)),r<0&&(d=0,y=n.getRowCount()),o<0&&(nt=0),ot)for(l=0;l<y;l++)for(a=0;a<p;a++)v=n.getCompositeStyle(d+l,a,w),v?(e.setStyle(nt+l,a,v.clone(),w),n.setStyle(d+l,a,i,w)):e.setStyle(nt+l,a,i,w);else{for(ht=new t._GcSheetModel(y,p,i),l=0;l<y;l++)for(a=0;a<p;a++)v=n.getCompositeStyle(d+l,a,w),v&&ht.setValue(l,a,v.clone()),n.setStyle(d+l,a,i,w);for(l=0;l<y;l++)for(a=0;a<p;a++)e.setStyle(nt+l,a,ht.getValue(l,a),w)}var tt=r,it=u,ft=o,et=s,rt=h,ut=c;if(r<0&&(tt=0,rt=f(n.getRowCount(),e.getRowCount())),u<0&&(it=0,ut=f(n.getColumnCount(),e.getColumnCount())),o<0&&(ft=0),s<0&&(et=0),ot)for(l=0;l<rt;l++)for(a=0;a<ut;a++)v=n.getCompositeStyle(tt+l,it+a),v?(e.setStyle(ft+l,et+a,v.clone()),n.setStyle(tt+l,it+a,i)):e.setStyle(ft+l,et+a,i);else{for(ct=new t._GcSheetModel(rt,ut,i),l=0;l<rt;l++)for(a=0;a<ut;a++)v=n.getCompositeStyle(tt+l,it+a),v&&ct.setValue(l,a,v.clone()),n.setStyle(tt+l,it+a,i);for(l=0;l<rt;l++)for(a=0;a<ut;a++)e.setStyle(ft+l,et+a,ct.getValue(l,a))}},n.moveConditionalFormatRules=function(n,t,i,r,u,f,e,o){this.copyConditionalFormatRules(n,t,i,r,u,f,e,o);this._deleteConditionalFormatRange(n,t,i,r,u,f,e,o)},n._deleteConditionalFormatRange=function(n,i,r,u,o,s,h,c){var g=[],ut=n.getConditionalFormats(),k,d,rt,nt,y,p,tt,l,w,a,v,b,it;if(ut)for(k=0;k<h;k++)for(d=0;d<c;d++)for(rt=ut.getRules(i+k,r+d),nt=0;nt<rt.length;nt++){for(y=rt[nt],p=[],tt=0;tt<y.ranges.length;tt++){if(l=y.ranges[tt],g.indexOf(l)>-1||!l.contains(i+k,r+d))continue;else g.push(l);i>l.row&&(w=new t.Range(-1,-1,-1,-1),w.row=l.row,w.col=l.col,w.rowCount=i-l.row,w.colCount=l.colCount,p.push(w));r>l.col&&(a=new t.Range(-1,-1,-1,-1),a.row=e(i,l.row),a.col=l.col,a.rowCount=f(i+h,l.row+l.rowCount)-a.row,a.colCount=r-l.col,p.push(a));r+c<l.col+l.colCount&&(v=new t.Range(-1,-1,-1,-1),v.row=e(i,l.row),v.col=r+c,v.rowCount=f(i+h,l.row+l.rowCount)-v.row,v.colCount=l.col+l.colCount-(r+c),p.push(v));i+h<l.row+l.rowCount&&(b=new t.Range(-1,-1,-1,-1),b.row=i+h,b.col=l.col,b.rowCount=l.row+l.rowCount-(i+h),b.colCount=l.colCount,p.push(b))}for(it=0;it<g.length;it++)y.ranges.remove(g[it]);y.ranges=y.ranges.concat(p)}},n.moveComment=function(n,t,r,u,e,o,s,h){var w=t,b=r,k=e,d=o,g=s,nt=h,y,l,a,v,p,tt,c;for(t<0&&(w=0,g=f(n.getRowCount(),u.getRowCount())),r<0&&(b=0,nt=f(n.getColumnCount(),u.getColumnCount())),e<0&&(k=0),o<0&&(d=0),y=[],l=0;l<g;l++)for(a=0;a<nt;a++)c=n.getComment(w+l,b+a),c&&(v=c.clone(),v._sheet=u,v._rowIndex=k+l,v._colIndex=d+a,y.push(v),n.setComment(w+l,b+a,i));for(p=0,tt=y.length;p<tt;p++)c=y[p],u.setComment(c._rowIndex,c._colIndex,c)},n.moveSparkline=function(n,t,i,r,u,e,o,s){var c=t,l=i,a=u,v=e,y=o,p=s,w,h;t<0&&(c=0,y=f(n.getRowCount(),r.getRowCount()));i<0&&(l=0,p=f(n.getColumnCount(),r.getColumnCount()));u<0&&(a=0);e<0&&(v=0);w=!(n===r&&n._name===r._name);w?(h=r._sparklineGroupManager,h&&h._exMove(n,c,l,a,v,y,p)):(h=n._sparklineGroupManager,h&&h._move(c,l,a,v,y,p))},n.moveColumnRangeGroup=function(t,i,r,u,e){var o=i,h=u,s=e,l,c;o<0&&(o=0,s=f(t.getColumnCount(),r.getColumnCount()));u<0&&(h=0);l=!(t===r&&t._name===r._name);l?t.colRangeGroup&&r.colRangeGroup&&(n.crossSheetCopyRangeGroup(t.colRangeGroup,o,r.colRangeGroup,h,s),t.colRangeGroup.items.clear(o,s)):(c=t.colRangeGroup,c&&c._move(o,h,s))},n.moveRowRangeGroup=function(t,i,r,u,e){var o=i,h=u,s=e,l,c;i<0&&(o=0,s=f(t.getRowCount(),r.getRowCount()));u<0&&(h=0);l=!(t===r&&t._name===r._name);l?t.rowRangeGroup&&r.rowRangeGroup&&(n.crossSheetCopyRangeGroup(t.rowRangeGroup,o,r.rowRangeGroup,h,s),t.rowRangeGroup.items.clear(o,s)):(c=t.rowRangeGroup,c&&c._move(o,h,s))},n.moveSpan=function(t,i,r,u,e,o,s,h){var l=i,c=r,y=e,p=o,a=s,v=h,w,b,k,d;i<0&&(l=0,a=f(t.getRowCount(),u.getRowCount()));c<0&&(c=0,v=f(t.getColumnCount(),u.getColumnCount()));e<0&&(y=0);o<0&&(p=0);w=!(t===u&&t._name===u._name);i<0&&(w?(n.crossSheetCopySpans(t._colHeaderSpanModel,-1,c,u._colHeaderSpanModel,-1,p,-1,v),t._colHeaderSpanModel&&t._colHeaderSpanModel.clear(-1,c,-1,v)):(b=t._getSpanModel(1),b&&b.move(-1,c,-1,p,-1,v)));r<0&&(w?(n.crossSheetCopySpans(t._rowHeaderSpanModel,l,-1,u._rowHeaderSpanModel,y,-1,a,-1),t._rowHeaderSpanModel&&t._rowHeaderSpanModel.clear(l,-1,a,-1)):(k=t._getSpanModel(2),k&&k.move(l,-1,y,-1,a,-1)));w?(n.crossSheetCopySpans(t._spanModel,l,c,u._spanModel,y,p,a,v),t._spanModel&&t._spanModel.clear(l,c,a,v)):(d=t._getSpanModel(),d&&d.move(l,c,y,p,a,v))},n.moveColumnAxis=function(n,t,r,e,o,s){var l=t,a=e,k=o,c,h,p,w,v,d,y,b;for(t<0&&(l=0,k=f(n.getColumnCount(),r.getColumnCount())),e<0&&(a=0),c=1,h=0;h<k;h++)p=n._getActualColumnWidth(h+l),p!==u&&p!==i&&(n.setColumnWidth(h+l,n.defaults.colWidth),r.setColumnWidth(h+a,p)),w=n.getColumnVisible(h+l),w!==u&&w!==i&&(n.setColumnVisible(h+l,!0),r.setColumnVisible(h+a,w)),(s&64)>0&&(v=n.getActualStyle(-1,h+l),v?(r.setStyle(-1,h+a,v.clone()),n.setStyle(-1,h+l,i)):r.setStyle(-1,h+a,i),v=n.getActualStyle(-1,h+l,c),v?(r.setStyle(-1,h+a,v.clone(),c),n.setStyle(-1,h+l,i,c)):r.setStyle(-1,h+a,i,c));for(d=f(n.getRowCount(c),r.getRowCount(c)),y=0;y<d;y++)b=n._getActualRowHeight(y,c),b!==u&&b!==i&&(n.setRowHeight(y,n.defaults.colHeaderRowHeight,c),r.setRowHeight(y,b,c))},n.moveRowAxis=function(n,t,r,e,o,s){var l=t,a=e,k=o,c,h,p,w,v,d,y,b;for(t<0&&(l=0,k=f(n.getRowCount(),r.getRowCount())),e<0&&(a=0),c=2,h=0;h<k;h++)p=n._getActualRowHeight(h+l),p!==u&&p!==i&&(n.setRowHeight(h+l,n.defaults.rowHeight),r.setRowHeight(h+a,p)),w=n.getRowVisible(h+l),w!==u&&w!==i&&(n.setRowVisible(h+l,!0),r.setRowVisible(h+a,w)),(s&64)>0&&(v=n.getActualStyle(h+l,-1),v?(r.setStyle(h+a,-1,v.clone()),n.setStyle(h+l,-1,i)):r.setStyle(h+a,-1,i),v=n.getActualStyle(h+l,-1,c),v?(r.setStyle(h+a,-1,v.clone(),c),n.setStyle(h+l,-1,i,c)):r.setStyle(h+a,-1,i,c));for(d=f(n.getColumnCount(c),r.getColumnCount(c)),y=0;y<d;y++)b=n._getActualColumnWidth(y,c),b!==u&&b!==i&&(n.setColumnWidth(y,n.defaults.rowHeaderColWidth,c),r.setColumnWidth(y,b,c))},n.moveSheetInfo=function(n,t,r){if(n!==t||n._name!==t._name){if((r&64)>0){var u=1,f=2;t.setDefaultStyle(n.getDefaultStyle());t.setDefaultStyle(n.getDefaultStyle(u),u);t.setDefaultStyle(n.getDefaultStyle(f),f);n.setDefaultStyle(i);n.setDefaultStyle(i,u);n.setDefaultStyle(i,f)}t.defaults.colWidth=n.defaults.colWidth;t.defaults.rowHeight=n.defaults.rowHeight;t.defaults.rowHeaderColWidth=n.defaults.rowHeaderColWidth;n.defaults.colWidth=62;n.defaults.rowHeight=20;n.defaults.rowHeaderColWidth=40}},n.moveBindingPath=function(t,i,r,u,f,e,o,s){return n._copyMoveBindingPath(t,i,r,u,f,e,o,s,!0)},n.setRangeText=function(r,f,e,o,s,h,c,a){if(!r)throw new Error(t.SR.Exp_SheetIsNull);if((f<-1||f>=r.getRowCount())&&l("row",f,"-1",r.getRowCount()-1),(e<-1||e>=r.getColumnCount())&&l("column",e,"-1",r.getColumnCount()-1),o!==u&&o!==i&&o!==""){f===-1&&(f=0);e===-1&&(e=0);var v=n.parseText(o,s,h,c);v&&v.length>0&&n.setSheetData(r,f,e,v,a)}},n.getRangeText=function(n,r,f,e,o,s,h,c,a,v){var w,b,p,k,nt,d,y,g;if(!n)throw new Error(t.SR.Exp_SheetIsNull);for((r<-1||r>=n.getRowCount())&&l("row",r,"-1",n.getRowCount()-1),(f<-1||r+f>n.getRowCount())&&l("rowCount",r,"-1",n.getRowCount()-r),(e<-1||e>=n.getColumnCount())&&l("column",e,"-1",n.getColumnCount()-1),(o<-1||e+o>n.getColumnCount())&&l("columnCount",e,"-1",n.getColumnCount()-e),w=-1,b=-1,r===-1&&e===-1&&f===-1&&o===-1?(r=0,e=0,w=n.getRowCount()-1,b=n.getColumnCount()-1):(r===-1&&(r=0),e===-1&&(e=0),f===-1&&(f=n.getRowCount()-r),o===-1&&(o=n.getColumnCount()-e),w=r+f-1,b=e+o-1),(s===u||s===i||s==="")&&(s="\r\n"),(h===u||h===i||h==="")&&(h="\t"),(c===u||c===i||c==="")&&(c='"'),p="",k=r;k<=w;k++){for(nt=!0,d=e;d<=b;d++)nt||(p+=h),nt=!1,y="",g=n.getText(k,d),g!==u&&g!==i&&(y=g,y=y.replace(new RegExp(c,"g"),c+c)),p+=a||y.indexOf(c)!==-1||y.indexOf(h)!==-1||y.indexOf(s)!==-1||y.indexOf("\n")!==-1?c+y+c:y;p+=s}return p.toString()},n.parseText=function(n,r,f,e){var c,k,w,l,b;if(n===u||n===i||n==="")return i;(r===u||r===i||r==="")&&(r="\r\n");(f===u||f===i||f==="")&&(f="\t");(e===u||e===i||e==="")&&(e='"');t.StringHelper.EndsWith(n,r)||(n+=r);var h=[],v=[],o=new t.StringBuilder,a=!1,s=e.length,y=r.length,p=f.length;for(c=0;c<n.length;c++)o.Append(n[c]),o.Length()>=s&&e===o.ToString(o.Length()-s,s)?a&&n.length>=c+1+s&&e===n.substr(c+1,s)?c+=s:a?(o.Remove(o.Length()-s,s),a=!1):(k=o.ToString(),k.indexOf(e)===0&&(o.Remove(o.Length()-s,s),a=!0)):!a&&o.Length()>=p&&f===o.ToString(o.Length()-p,p)?(o.Remove(o.Length()-p,p),v.push(o.toString()),o.Remove(0,o.Length())):!a&&o.Length()>=y&&r===o.ToString(o.Length()-y,y)?(o.Remove(o.Length()-y,y),v.push(o.toString()),h.push(v),v=[],o.Remove(0,o.Length())):a&&n.length>=c+1+p&&f===n.substr(c+1,p)&&f!=","&&(c+=s);if(a){if(v.length>0){for(w=0;w<h.length;w++)if(h[w]===v)break;w>=h.length&&h.push(v)}l=o.toString();l&&(l=l.replace(new RegExp(f,"g"),""),t.StringHelper.EndsWith(l,r)&&(l=l.substr(0,l.length-y)),h.length==0&&h.push([l]))}return h.length==0&&n&&(b=n,t.StringHelper.EndsWith(n,r)&&(b=b.substr(0,b.length-y)),h.push([b])),h},n.setSheetData=function(t,i,r,u,f){var e=u.length,s=n.getMaxLength(u),o,c,h,l;if(e!==0&&s!==0){o=new bt(f);o.fixOptions(t);var v=o.rowHeader?t.getColumnCount(2):0,a=o.columnHeader?t.getRowCount(1):0,y=0;for(s-=v,s<=0&&(s=0),e-=a,e<=0&&(y=0),e-=y,e<=0&&(e=0),o.expandRows&&i+e>t.getRowCount()&&t.setRowCount(i+e),o.expandColumns&&r+s>t.getColumnCount()&&t.setColumnCount(r+s),c=0,h=0;c<u.length;c++,h++)(l=u[c],l.length<=0)||(a>0&&c<a?n.setRowData(t,l,h,r,s,1,o):e>0&&h<t.getRowCount()&&(c===a&&(h=i),n.setRowData(t,l,h,0,v,2,o),l.splice(0,v),n.setRowData(t,l,h,r,s,3,o)))}},n.setRowData=function(t,i,r,u,f,e,o){for(var s=0,h=u;s<i.length;s++,h++)f>0&&h<t.getColumnCount(e)&&n.setCellData(t,e,r,h,i[s],o)},n.setCellData=function(n,r,f,e,o,s){var h=o,a=i,l,c,v;if(s.unFormatted===!1&&t.features.formatter&&(l={value:o},a=(new t.GeneralFormatter).GetPreferredDisplayFormatter(o,l),h=l.value),h===u||h===i)n.setValue(f,e,h,r);else if(o!=="")if(s.formula&&o[0]==="=")try{n.setFormula(f,e,o.substr(1),r)}catch(y){n.setText(f,e,o,r)}else c=n.getActualStyle(f,e,r),c&&(s.unFormatted===!1&&t.features.formatter?c.formatter?c.formatter.toString()==="@"&&(h=o.toString()):(v=new t.AutoFormatter(a),n.getCell(f,e,r)._setStyleProperty("_autoFormatter",v)):c.formatter&&n.getCell(f,e,r).formatter(i)),n.setValue(f,e,h,r);else n.setValue(f,e,i,r)},n.getMaxLength=function(n){var t,r,f;if(n===u||n===i)return 0;for(t=0,r=0;r<n.length;r++)f=n[r],t=e(f.length,t);return t},n.parseCsv=function(t,r,u,f){var c=i,s=n.parseText(t,r,u,f),e,o;if(s){var l=s.length,a=n.getMaxLength(s),h=[];for(e=0;e<l;e++)for(h[e]=[],o=0;o<a;o++)h[e][o]=o<s[e].length?s[e][o]:i;c=h}return c},n}(),w=[/\\/g,/\(/g,/\[/g,/\{/g,/\^/g,/\$/g,/\|/g,/\)/g,/\+/g,/\./g],ft=new RegExp("{113E2532-EAF5-444c-A5CB-3D7446971C4D}","g"),et=new RegExp("{E21523B3-0F1F-458f-B547-23D25713D0EC}","g");b=function(){function n(n,t,i,r){var u=this;u.read=n;u.create=t;u.update=i;u.remove=r}return n}();t.DataContext=b;var v=".gcSheet",k=".gcSheetInternal",d="mousedown"+v,g="mousemove"+v,nt="mouseup"+v,tt="mouseout"+v,it="dblclick"+v,rt="gcmousewheel"+v,kt="resize"+v,st="value",dt="left",gt="top",ni="width",ti="height",ht="hidden",ct="visibility",lt="POST",at="json",vt="application/json;charset=UTF-8",yt=new RegExp("^/Date\\((-?\\d+)([-+]{1}\\d+)?\\)/\\s*$"),pt=new RegExp("^/OADate\\(([-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)\\)/\\s*$"),ii=function(){function l(n){var r=this;r._name="";r._visible=!0;r.defaults=i;r.gridline=i;r.borderColor="black";r.borderWidth=0;r._zoomFactor=1;r.frozenRowCount=0;r.frozenColCount=0;r.rowHeaderVisible=!0;r.colHeaderVisible=!0;r.rowHeaderAutoText=1;r.colHeaderAutoText=2;r.rowHeaderAutoTextIndex=-1;r.colHeaderAutoTextIndex=-1;r.rowRangeGroup=i;r.colRangeGroup=i;r._activeRowIndex=0;r._activeColIndex=0;r.activeRowViewportIndex=0;r.activeColViewportIndex=0;r._allowCellOverflow=!1;r.maxCellOverflowDistance=100;r.showEditingLocator=!0;r.keyMap=i;r.isProtected=!1;r._allowUndo=!0;r._paintSuspended=!1;r._layoutSuspended=0;r.checkingChanges=!1;r.autoGenerateColumns=!0;r._allowEditorReservedLocations=!0;r._sheetTabColor=i;r._frozenlineColor="black";r._frozenTrailingRowCount=0;r._frozenTrailingColCount=0;r._rowLayoutCache=i;r._colLayoutCache=i;r._dragRect=i;r._scrollTopRow=0;r._scrollLeftCol=0;r._activeRowDirty=!1;r.floatingObjectKeyMap=i;r._commentKeyMap=i;r._cachePool=new t._CachePool(this);r._composedDefaultStyle={};r._defaultRowCount=200;r._defaultColCount=20;r._defaultRowHeight=20;r._defaultColWidth=62;r._defaultRowHeaderColWidth=40;r._defaultColHeaderRowHeight=20;r._defaultGridLineColor="#d0d7e5";r._defaultShowVerticalGridline=!0;r._defaultShowHorizontalGridline=!0;r.fontHeightCache=i;r._init(n)}return l.prototype._addFloatingOjectInternal=function(n){var i=this,r=i._floatingObjectArray,u;if(r&&t.features.floatingObject)try{u=i.isPaintSuspended();i.isPaintSuspended(!0);r.add(n)}finally{i.isPaintSuspended(u)}},l.prototype._findFloatingObjectInternal=function(n){var r=this._floatingObjectArray;return t.features.floatingObject&&r&&r.length>0?r.find(n):i},l.prototype._removeFloatingObjectInternal=function(n){var i=this._floatingObjectArray,r;t.features.floatingObject&&i&&i.length&&(r=i.find(n),r&&i.remove(r))},l.prototype._saveAndClearSheetSelections=function(){var u=this,r=u._selectionModel,n,i,f;if(r&&r.length>0){for(n=new t._SelectionModel,u._selectionModelCache=n,n.selectionPolicy=r.selectionPolicy,n.selectionUnit=r.selectionUnit,n.activeSelectedRangeIndex=r.activeSelectedRangeIndex,i=0,f=r.length;i<f;i++)n.push(r[i]);for(u._clearSelectionImp(),i=0,f=n.length;i<f;i++)u._render.repaintSelection(n[i])}},l.prototype._loadAndSetSheetSelections=function(){var n=this._selectionModelCache,i,r,u;if(n)for(i=new t._SelectionModel,this._selectionModel=i,i.selectionPolicy=n.selectionPolicy,i.selectionUnit=n.selectionUnit,i.activeSelectedRangeIndex=n.activeSelectedRangeIndex,r=0,u=n.length;r<u;r++)i.push(n[r])},l.prototype._updateFloatingObjectsLayout=function(){var n=this,i=n._floatingObjectArray,r=n._render;t.features.floatingObject&&i&&i.length>0&&(i._updateFloatingsObjectlayoutOnColumnRowChanged(),r&&r._paintFloatingObject(n._bounds))},l.prototype.unSelectAllFloatingObjects=function(){var n=this._floatingObjectArray,i;if(t.features.floatingObject&&n&&n.length>0)for(i=0;i<n.length;i++)n[i].isSelected(!1)},l.prototype.addFloatingObject=function(n){this._floatingObjectArray&&t.features.floatingObject&&n instanceof t.CustomFloatingObject&&this._addFloatingOjectInternal(n)},l.prototype.findFloatingObject=function(n){var r=this._findFloatingObjectInternal(n);return r instanceof t.CustomFloatingObject?r:i},l.prototype.removeFloatingObject=function(n){var i=this._findFloatingObjectInternal(n);i instanceof t.CustomFloatingObject&&this._floatingObjectArray.remove(i)},l.prototype.getFloatingObjects=function(){var i=[],r,n,f,u;if(!t.features.floatingObject)return i;for(r=this._floatingObjectArray,n=0,f=r.length;n<f;n++)u=r[n],u instanceof t.CustomFloatingObject&&i.push(u);return i},l.prototype.addPicture=function(n,u,f,e,o,s,h,c,l,a){var y=this,p=y._floatingObjectArray,w,v;if(!p||!t.features.floatingObject)return i;try{return w=y.isPaintSuspended(),y.isPaintSuspended(!0),v=new t.Picture(n),v.owner(y),v.src(u),v.startRow(f),v.startColumn(e),v.endRow(o),v.endColumn(s),(typeof o===r||typeof s===r)&&(v._isTakeOriginalSize=!0),typeof h=="number"&&v.startRowOffset(h),typeof c=="number"&&v.startColumnOffset(c),typeof l=="number"&&v.endRowOffset(l),typeof a=="number"&&v.endColumnOffset(a),p.add(v),v}finally{y.isPaintSuspended(w)}},l.prototype.findPicture=function(n){var r=this._findFloatingObjectInternal(n);return r instanceof t.Picture?r:i},l.prototype.removePicture=function(n){var i=this._findFloatingObjectInternal(n);i instanceof t.Picture&&this._floatingObjectArray.remove(i)},l.prototype.getPictures=function(){var i=[],r,n,f,u;if(!t.features.floatingObject)return i;for(r=this._floatingObjectArray,n=0,f=r.length;n<f;n++)u=r[n],u instanceof t.Picture&&i.push(u);return i},l.prototype.setFloatingObjectZIndex=function(n,i){var o,r,u,f,h,c,e,s;if(!isNaN(i)&&t.features.floatingObject&&(o=this._render,r=o&&o._floatingObjectRenderManager,r))for(u=0,h=r.length;u<h;u++)if(e=r[u],e)for(f=0,c=e.length;f<c;f++)s=e[f],s&&s.setFloatingObjectZIndex(n,i)},l.prototype.getFloatingObjectZIndex=function(n){var o=this._render,f=o&&o._floatingObjectRenderManager,i,r,s,h,u,e;if(t.features.floatingObject&&f)for(i=0,s=f.length;i<s;i++)if(u=f[i],u)for(r=0,h=u.length;r<h;r++)if(e=u[r],e)return e.getFloatingObjectZIndex(n);return-1},l.prototype.getDataSource=function(){var n=this._bindingManager;return n?n.getSource():i},l.prototype.getBindingPath=function(n,t,r){if((r===u||r===i)&&(r=3),r===3){var f=this._getModel(r);if(f)return f.getBindingPath(n,t)}return i},l.prototype.setBindingPath=function(n,t,r,f){var e=this;return e._bindToAutoRefresh(function(n,t,r,f){if((f===u||f===i)&&(f=3),f===3){var o=e._getModel(f);o&&o.setBindingPath(n,t,r)}return e})(n,t,r,f)},l.prototype._autoGenerateColumnCellType=function(n){var i=this,f=i._bindingManager,r=i._colInfos,u,e;f&&r&&r[n]&&(u=f.getDataItem(0),u&&(e=u[r[n].name],typeof e===a&&i.setCellType(-1,n,new t.CheckBoxCellType)))},l.prototype.setDataSource=function(n,i){var r=this,u=r._bindingManager;u&&u.getSource()!==n&&r._bindToAutoRefresh(function(n,i){var f,e;if((!n||i)&&r.reset(),u=r._bindingManager,n){if(u.bind(n),t._BindingManager.isCellBindingSource(n))return;if(r.setRowCount(u.getRowCount()),r.autoGenerateColumns){if(r.setColumnCount(u.getColumnCount()),r._colInfos={},f=u.getFields(),f)for(e in f)r._colInfos[e]={name:f[e]}}else r._colInfos||(r._colInfos={});r.calcService.IsSuspended()||r.recalcAll()}})(n,i)},l.prototype.bindColumn=function(n,t){var i=this,u=i.isPaintSuspended(),r;i.isPaintSuspended(!0);try{typeof t===p&&(t={name:t});r=i._colInfos;r||(i._colInfos=r={});r[n]=t;t&&t.formatter&&i.setFormatter(-1,n,t.formatter);t&&t.cellType&&i.setCellType(-1,n,t.cellType)}finally{i.isPaintSuspended(u)}},l.prototype.bindColumns=function(n){var i=this,u=i.isPaintSuspended(),r,t;i.isPaintSuspended(!0);try{if(i._colInfos={},n)for(isNaN(n.length)||i.setColumnCount(n.length),r=0;r<n.length;r++)t=n[r],typeof t===p&&(t={name:t}),i._colInfos[r]=t,t&&t.formatter&&i.setFormatter(-1,r,t.formatter),t&&t.cellType&&i.setCellType(-1,r,t.cellType)}finally{i.isPaintSuspended(u)}},l.prototype.getDataContext=function(){return this.dataContext},l.prototype.setDataContext=function(n){this.dataContext=n;this.load()},l.prototype.getDataItem=function(n){var f=this,o=f._bindingManager,h=f._colInfos,t,r,u;if(!o||o.getRowCount()===0)return i;var l=f.getColumnCount(),s={},e=o.getDataItem(n);if(e)for(t in e)e.hasOwnProperty(t)&&typeof t!==c&&(s[t]=e[t]);if(h)for(r=0;r<l;r++)u=h[r],u&&u.name&&u.name.length>0&&(s[u.name]=f.getValue(n,r));return s},l.prototype.getDirtyRows=function(){var r=this,u=[],t=r._dataModel.dirtyNodes,f,e,n;if(t){f=r._bindingManager;e=r.getDataSource();for(n in t)t.hasOwnProperty(n)&&t[n]&&t[n].rs==="e"&&u.push({row:n,item:r.getDataItem(n),originalItem:e?f.getDataItem(n):i})}return u},l.prototype.getInsertRows=function(){var i=[],t=this._dataModel.dirtyNodes,n;if(t)for(n in t)t.hasOwnProperty(n)&&t[n]&&t[n].rs==="n"&&i.push({row:n,item:this.getDataItem(n)});return i},l.prototype._getDeleteRows=function(){var n=[];return this.deletedRows&&$.each(this.deletedRows,function(t,r){typeof r!==c&&r&&r.data!==u&&r.data!==i&&n.push({row:t,originalItem:r.data})}),n},l.prototype.hasPendingChanges=function(){var u=this,t=u._dataModel.dirtyNodes,n,i,r;if(t)for(n in t)if(t[n]&&(t[n].rs==="e"||t[n].rs==="n"))return!0;if(i=u.deletedRows,i)for(n in i)if(r=i[n],r&&typeof r!==c)return!0;return!1},l.prototype.clearPendingChanges=function(){function f(n){$.each(n,function(n,t){typeof n!==c&&t&&t.dirty&&(t.dirty=i)})}var n=this,r=n._dataModel.dirtyNodes,u,t;for(u in r)t=r[u],t&&t.rs&&delete t.rs;n._dataModel.dirtyNodes={};n.deletedRows=[];f(n._rowInfos);f(n._colInfos)},l.prototype.load=function(){var n=this,t=n.dataContext;t&&t.read&&(n._dataReceivedDelegate=function(t){return n._onDataReceived(t)},$.getJSON(t.read,n._dataReceivedDelegate))},l.prototype.updateRecord=function(){var n=this,t=n.dataContext,u,f,i,e,r;n.autoUpdate&&t&&t.update&&t.update!==""&&(u=n._bindingManager,f=n.getDataSource(),f&&u.getRowCount()!==0)&&(n._dataUpdatedDelegate=function(t){return n._onDataUpdated(t)},i=n._activeRowIndex,i>=0&&(e=n.getDataItem(i),r=t.update,n._dataModel.dataTable&&n._dataModel.dataTable[i]&&n._dataModel.dataTable[i].rs==="n"&&(r=t.create),$.ajax({url:r,type:lt,data:JSON.stringify(e),dataType:at,contentType:vt,success:n._dataUpdatedDelegate})))},l.prototype._onDataUpdated=function(n){},l.prototype._onDataReceived=function(n){var r,t,u,i;if(n&&(r=n.data,r)){if(t=this,t.setDataSource(r),isNaN(n.total)||t.setRowCount(n.total),window.localStorage)for(u=t.getColumnCount(),i=0;i<u;i++)window.localStorage["col,"+i]&&t.setColumnWidth(i,parseInt(window.localStorage["col,"+i],10));t.parent&&t.parent._doResize();t.invalidateLayout();t.repaint()}},l.prototype._getProperties=function(n){var i=[],t;if(n)for(t in n)typeof n[t]!==c?i.push(t):typeof ut!==r&&ut.isObservable(n[t])&&i.push(t);return i},l.prototype.referenceStyle=function(n){var r=t.ReferenceStyle,i=this.getCalcService();return arguments.length===0?i&&i.useR1C1?1:0:(i&&(i.useR1C1=n===1),this)},l.prototype.recalcAll=function(){var n=this.getCalcService();n&&n.recalculateAll(!0)},l.prototype._recalcCell=function(n,t,i){var r=this.getCalcService();r&&!r.ignoreDirty()&&r.recalculate({target:this,model:n},t,i)},l.prototype.getCalcService=function(){var n=this;return!n.calcService&&t.util.hasCalc()&&(n.calcService=new t.Calc.Service(n)),n.calcService},l.prototype._getCalcContexts=function(){var n=this,t=[],i=n._getModel();return t.push({name:n._name,target:n,refModel:i}),t},l.prototype.updateCalcContexts=function(){var n=this.getCalcService();n&&n.contextChanged()},l.prototype.suspendCalcService=function(n){this.calcService&&this.calcService.suspend(n)},l.prototype.resumeCalcService=function(n){this.calcService&&this.calcService.resume(n)},l.prototype._getSheetSource=function(n){return n===u||n===i||n===3?this._vpSheetSource:i},l.prototype.getCustomFunction=function(n){return this._functions&&n&&n!==""?this._functions[n.toUpperCase()]:i},l.prototype.addCustomFunction=function(n){if(t.util.hasCalc()){if(!n||!(n instanceof t.Calc.Functions.Function))throw new Error(t.SR.Exp_InvalidCustomFunction);var i=this,r=n.name.toUpperCase();i._functions||(i._functions={});i._functions[r]=n;i.recalcAll()}},l.prototype.removeCustomFunction=function(n){var t=this;t._functions&&n&&n!==""&&(n=n.toUpperCase(),t._functions.hasOwnProperty(n)&&(delete t._functions[n],t.recalcAll()))},l.prototype.clearCustomFunctions=function(){this._functions&&(delete this._functions,this.recalcAll())},l.prototype._findCustomFunction=function(n){if(!n||n==="")return i;var u=this,t=u.parent,r=u.getCustomFunction(n);return!r&&t&&t.getCustomFunction&&(r=t.getCustomFunction(n)),r},l.prototype.addCustomFunctionDescription=function(n){if(n&&n.name&&!this.getCustomFunctionDescription(n.name)){var t=this._functionDescriptions;t||(t=this._functionDescriptions=[]);t.push(n)}},l.prototype.getCustomFunctionDescription=function(n){var u=this._functionDescriptions,f,t,r;if(u&&n)for(n=n.toUpperCase(),f=u.length,r=0;r<f;r++)if(t=u[r],t.name&&t.name.toUpperCase()===n)return t;return i},l.prototype.removeCustomFunctionDescription=function(n){var i=this._functionDescriptions,u,r,t;if(i&&n)for(n=n.toUpperCase(),u=i.length,t=0;t<u;t++)if(r=i[t],r.name&&r.name.toUpperCase()===n){i.splice(t,1);break}},l.prototype.clearCustomFunctionDescriptions=function(){this._functionDescriptions&&(this._functionDescriptions=i)},l.prototype.getCustomName=function(n){var t=this._names;return t?t[n]:i},l.prototype.getCustomNames=function(){var n=[],t=this._names;return t&&$.each(t,function(t,i){n.push(i)}),n},l.prototype.addCustomName=function(n,t,i,r){this._addCustomNameCore(n,t,i,r,!1)},l.prototype._addCustomNameCore=function(n,i,r,u,f){var e,o,h,c,s;if(!n||n===""||!i||i==="")throw new Error(t.SR.Exp_InvalidCustomName);if(e=this,e._names||(e._names={}),o=e.getCalcService(),h=e._getSheetSource(),o&&h){if(f)try{c=o.parse(i,r,u)}catch(l){}else c=o.parse(i,r,u);e._names[n]=new t.NameInfo(n,c,r,u);s=h._getNameCalc(n,!0);s&&(s.updateListening(!0,!0),s.addToDirty());e.recalcAll()}},l.prototype.removeCustomName=function(n){var t=this,r,i;t._names&&n&&n!==""&&t._names.hasOwnProperty(n)&&(delete t._names[n],r=t._getSheetSource(),r&&(i=r._getNameCalc(n),i&&(i.updateListening(!0,!1),i.addToDirty())),t.recalcAll())},l.prototype.clearCustomNames=function(){var n=this,r,u,f,t,i;if(n._names){if(r=n._names,delete n._names,u=n._getSheetSource(),u)for(f=r.length,t=0;t<f;t++)i=u._getNameCalc(r[t]),i&&(i.updateListening(!0,!1),i.addToDirty());n.recalcAll()}},l.prototype._findCustomName=function(n){if(!n||n==="")return i;var u=this,t=u.parent,r=u.getCustomName(n);return!r&&t&&t.getCustomName&&(r=t.getCustomName(n)),r},l.prototype.setFormula=function(n,t,i,r){this._setFormulaCore(n,t,i,!1,r)},l.prototype._setFormulaCore=function(n,r,f,e,o){var s=this,v,c,h,l,a;if(o!==1&&o!==2){if((o===u||o===i)&&(o=3),v=t.Events,n<0||n>=s.getRowCount()||r<0||r>=s.getColumnCount()){s._raiseInvalidOperation(0,t.SR.Exp_IndexOutOfRange);return}if(c=s._tableManager,o===3&&n>=0&&r>=0&&c&&(h=c.find(n,r),h)){if(h.showHeader()&&n===h.headerIndex()&&f)return;h.showFooter()&&n===h.footerIndex()&&h._setFooterFormula(n,r,f)}l=s._getSheetSource();a=s._conditionalFormats;l&&(l.setFormula(n,r,f,e),a&&a._clearCache(),s._eventHandler._eventSuspended<1&&s._trigger(v.CellChanged,{sheet:s,sheetName:s._name,row:n,col:r,sheetArea:o,propertyName:"formula"}));s._paintSuspended||(s.invalidateLayout(),s.repaint())}},l.prototype.setArrayFormula=function(n,t,i,r,u,f){this._setArrayFormulaCore(n,t,i,r,u,!1,f)},l.prototype._setArrayFormulaCore=function(n,r,f,e,o,s,h){var c=this;c._bindToAutoRefresh(function(n,r,f,e,o,h){var p,a,l,v,y;if(h!==1&&h!==2){if((h===u||h===i)&&(h=3),p=t.Events,n<0||n+f>c.getRowCount()||r<0||r+e>c.getColumnCount()){c._raiseInvalidOperation(0,t.SR.Exp_IndexOutOfRange);return}if(a=c._tableManager,h===3&&n>=0&&r>=0&&a&&(l=a.find(n,r),l)){if(f>1||e>1){c._raiseInvalidOperation(0,t.SR.Exp_ArrayFormulaTable);return}if(l.showHeader()&&n===l.headerIndex()&&o)return;l.showFooter()&&n===l.footerIndex()&&l._setFooterFormula(n,r,o)}v=c._getSheetSource();y=c._conditionalFormats;v&&(v.setArrayFormula(n,r,f,e,o,s),y&&y._clearCache(),c._eventHandler._eventSuspended<1&&c._trigger(p.RangeChanged,{sheet:c,sheetName:c._name,row:n,col:r,rowCount:f,colCount:e,sheetArea:h,propertyName:"formula"}))}})(n,r,f,e,o,h)},l.prototype.getFormula=function(n,t,r){if(r===u||r===i||r===3){var f=this._getSheetSource();if(f)return f.getFormula(n,t)}return i},l.prototype.getFormulaInformation=function(n,r,f){var e=new t.FormulaInformation,h,s,o,c;return(f===u||f===i||f===3)&&(h=this._getCalcModel(f),h&&(s=h.getNode(n,r),s&&s.expr&&(e.hasFormula=!0,o=s.arrayInfo,o&&(e.baseRange=new t.Range(o.row,o.col,o.rowCount,o.colCount)),e.isArrayFormula=!!s.arrayInfo)),c=this._getSheetSource(),c&&(e.formula=c.getFormula(n,r),e.hasFormula=!!e.formula)),e},l.prototype.hasFormula=function(n,t,r){if(r===u||r===i||r===3){var f=this._getSheetSource();if(f)return f.hasFormula(n,t)}return!1},l.prototype._findFormulas=function(n,t,i,r){},l.prototype._rebuildCalcNodes=function(){var n=this._getCalcModel(),u,i,r;if(n&&(u=this._getSheetSource(),u))for(var t=n.nextNonNullRow(-1),f=n.getRowCount(),e=n.getColumnCount();0<=t&&t<f;){for(i=n.nextNonNullColumn(t,-1);0<=i&&i<e;)r=u._getCellCalc(t,i),r&&(r.stopListening(),r.startListening()),i++;t++}},l.prototype.toJSON=function(){var n=this,a=n._bindingManager,v=n._sparklineGroupManager,y=n._commentManager,p=n.getConditionalFormats(),w=n._tableManager,b=n._floatingObjectArray,k=n._rowFilter,d={defaults:n.defaults,columns:n._toArray(n._colInfos,n.getColumnCount()),rows:n._toArray(n._rowInfos,n.getRowCount()),autoGenerateColumns:n.autoGenerateColumns,dataBinding:a?a.toJSON():i,frozenRowCount:n.frozenRowCount,frozenColCount:n.frozenColCount,frozenTrailingRowCount:n._frozenTrailingRowCount,frozenTrailingColCount:n._frozenTrailingColCount,rowCount:n.getRowCount(),columnCount:n.getColumnCount(),sparklineGroupManager:v?v.toJSON():i,commentManager:y?y.toJSON():i,spans:n._spanModel.toJSON(),selectionBackColor:n._selectionBackColor,selectionBorderColor:n._selectionBorderColor,activeRow:n._activeRowIndex,activeCol:n._activeColIndex,gridline:n.gridline,allowCellOverflow:n._allowCellOverflow,referenceStyle:n.referenceStyle(),zoomFactor:n._zoomFactor,theme:n.currentTheme(),showRowRangeGroup:n._showRowRangeGroup,showColumnRangeGroup:n._showColumnRangeGroup,conditionalFormats:p?p.toJSON():i,sheetTabColor:n._sheetTabColor,frozenlineColor:n._frozenlineColor,rowHeaderAutoText:n.rowHeaderAutoText,colHeaderAutoText:n.colHeaderAutoText,rowHeaderAutoTextIndex:n.rowHeaderAutoTextIndex,colHeaderAutoTextIndex:n.colHeaderAutoTextIndex,rowHeaderVisible:n.rowHeaderVisible,colHeaderVisible:n.colHeaderVisible,rowHeaderColCount:n.getColumnCount(2),colHeaderRowCount:n.getRowCount(1),rowHeaderSpan:n._rowHeaderSpanModel.toJSON(),colHeaderSpan:n._colHeaderSpanModel.toJSON(),rowHeaderColInfos:n._toArray(n._rowHeaderColInfos,n.getColumnCount(2)),colHeaderRowInfos:n._toArray(n._colHeaderRowInfos,n.getRowCount(1)),clipBoardOptions:n._clipBoardOptions,isProtected:n.isProtected,borderColor:n.borderColor,borderWidth:n.borderWidth,allowDragDrop:n._allowDragDrop,allowDragFill:n._allowDragFill,allowUndo:n._allowUndo,allowEditorReservedLocations:n._allowEditorReservedLocations,tableManager:w?w.toJSON():i,floatingObjectArray:b?b.toJSON():i,visible:n._visible,rowHeaderData:n._rowHeaderModel.toJSON(2),colHeaderData:n._colHeaderModel.toJSON(1),data:n._dataModel.toJSON(),rowRangeGroup:n.rowRangeGroup.toJSONCore(!0),colRangeGroup:n.colRangeGroup.toJSONCore(!1)},r={name:n._name,selections:n._selectionModel.toJSON(),rowFilter:k?k.toJSON():u},c,f,e,t,o,s,l;for(t in d)c=d[t],n._isDefaultValue(t,c)||(r[t]=c);if(f=[],e=n._namedStyles,e)for(t in e)f.push(e[t]);if(f.length>0&&(r.namedStyles=f),o=[],s=n._names,s&&n.calcService)for(l in s)if(n._names.hasOwnProperty(l)){var h=s[l],tt=h.getName(),g=h.getRow(),nt=h.getColumn(),it=h.getExpression(),rt=n.calcService.unparse(it,g,nt);o.push({name:tt,formula:rt,row:g,col:nt})}return o.length>0&&(r.names=o),r},l.prototype._isDefaultTheme=function(n){if(!n)return!1;if(n._name==="Office"){var i=JSON.stringify(n._themeColor),r=JSON.stringify(t.ThemeColors.Office);if(n._bodyFont==="Calibri"&&n._headingFont==="Cambria"&&i===r)return!0}return!1},l.prototype._isDefaultValue=function(n,t){var r=this;switch(n){case"defaults":return t.rowHeight===r._defaultRowHeight&&t.colWidth===r._defaultColWidth&&t.rowHeaderColWidth===r._defaultRowHeaderColWidth&&t.colHeaderRowHeight===r._defaultColHeaderRowHeight;case"columns":return!t||t.length===0;case"rows":return!t||t.length===0;case"autoGenerateColumns":return t===!0;case"dataBinding":return t===i;case"sparklineGroupManager":return t===i;case"commentManager":return t===i;case"frozenRowCount":return t===0;case"frozenColCount":return t===0;case"frozenTrailingRowCount":return t===0;case"frozenTrailingColCount":return t===0;case"rowCount":return t===200;case"columnCount":return t===20;case"selectionBackColor":return t==="rgba(180,180,200,0.2)";case"selectionBorderColor":return t==="black";case"activeRow":return t===0;case"activeCol":return t===0;case"gridline":return t.color===r._defaultGridLineColor&&t.showHorizontalGridline===r._defaultShowHorizontalGridline&&t.showVerticalGridline===r._defaultShowVerticalGridline;case"allowCellOverflow":return t===!1;case"referenceStyle":return t===0;case"zoomFactor":return t===1;case"theme":return r._isDefaultTheme(t);case"showRowRangeGroup":return t===!0;case"showColumnRangeGroup":return t===!0;case"conditionalFormats":return t===i;case"sheetTabColor":return t===i;case"frozenlineColor":return t==="black";case"rowHeaderAutoText":return t===1;case"colHeaderAutoText":return t===2;case"rowHeaderAutoTextIndex":return t===-1;case"colHeaderAutoTextIndex":return t===-1;case"rowHeaderVisible":return t===!0;case"colHeaderVisible":return t===!0;case"rowHeaderColCount":return t===1;case"colHeaderRowCount":return t===1;case"rowHeaderColInfos":return!t||t.length===0;case"colHeaderRowInfos":return!t||t.length===0;case"clipBoardOptions":return t===0;case"isProtected":return t===!1;case"borderColor":return t==="black";case"borderWidth":return t===0;case"allowDragDrop":return t===!0;case"allowDragFill":return t===!0;case"allowUndo":return t===!0;case"allowEditorReservedLocations":return t===!0;case"tableManager":return t===i;case"floatingObjectArray":return t===i;case"visible":return t===!0;case"data":return $.isEmptyObject(t);case"rowHeaderData":return $.isEmptyObject(t);case"colHeaderData":return $.isEmptyObject(t);default:return!1}},l.prototype.fromJSON=function(i,u){var f,ti,y,p,l,ii,s,ri,w,a,b,k,g,nt,dt,ui,gt,tt,it,e,pt,wt,d,h,bt,kt,ni;if(i){arguments.length==1&&(u=!0);f=this;ti=f.isPaintSuspended();f.isPaintSuspended(!0);y=i.rowCount;p=i.columnCount;try{if(f._name=i.name,i.defaults&&(f.defaults=i.defaults),typeof y===r&&(y=f._defaultRowCount),f.setRowCount(y),typeof p===r&&(p=f._defaultColCount),f.setColumnCount(p),typeof i.activeRow!==r&&(f._activeRowIndex=i.activeRow),typeof i.activeCol!==r&&(f._activeColIndex=i.activeCol),typeof i.frozenRowCount!==r&&f.setFrozenRowCount(i.frozenRowCount),typeof i.frozenColCount!==r&&f.setFrozenColumnCount(i.frozenColCount),typeof i.frozenTrailingRowCount!==r&&f.setFrozenTrailingRowCount(i.frozenTrailingRowCount),typeof i.frozenTrailingColCount!==r&&f.setFrozenTrailingColumnCount(i.frozenTrailingColCount),typeof i.gridline!==r&&(f.gridline=i.gridline),typeof i.allowCellOverflow!==r&&(f._allowCellOverflow=i.allowCellOverflow),typeof i.autoGenerateColumns!==r&&(f.autoGenerateColumns=i.autoGenerateColumns),i.dataSource&&(l=f._bindingManager,l&&l.bind(i.dataSource)),i.dataBinding&&(l=f._bindingManager,l&&l.fromJSON(i.dataBinding)),i.rows&&(f._rowInfos=i.rows,f._rowInfos.length=y),i.columns&&(f._colInfos=i.columns,f._colInfos.length=p),i.colStyles)for(s in i.colStyles)isNaN(s)||(ii=parseInt(s,10),f.setStyle(-1,ii,i.colStyles[s],3));if(i.rowStyles)for(s in i.rowStyles)isNaN(s)||(ri=parseInt(s,10),f.setStyle(ri,-1,i.rowStyles[s],3));if(typeof i.rowHeaderAutoText!==r&&(f.rowHeaderAutoText=i.rowHeaderAutoText),typeof i.colHeaderAutoText!==r&&(f.colHeaderAutoText=i.colHeaderAutoText),typeof i.rowHeaderAutoTextIndex!==r&&(f.rowHeaderAutoTextIndex=i.rowHeaderAutoTextIndex),typeof i.colHeaderAutoTextIndex!==r&&(f.colHeaderAutoTextIndex=i.colHeaderAutoTextIndex),typeof i.rowHeaderVisible!==r&&(f.rowHeaderVisible=i.rowHeaderVisible),typeof i.colHeaderVisible!==r&&(f.colHeaderVisible=i.colHeaderVisible),typeof i.rowHeaderColCount!==r&&f.setColumnCount(i.rowHeaderColCount,2),typeof i.colHeaderRowCount!==r&&f.setRowCount(i.colHeaderRowCount,1),i.rowHeaderData&&f._rowHeaderModel.fromJSON(i.rowHeaderData),i.colHeaderData&&f._colHeaderModel.fromJSON(i.colHeaderData),i.rowHeaderSpan&&f._rowHeaderSpanModel.fromJSON(i.rowHeaderSpan),i.colHeaderSpan&&f._colHeaderSpanModel.fromJSON(i.colHeaderSpan),i.rowHeaderColInfos&&(f._rowHeaderColInfos=i.rowHeaderColInfos),i.colHeaderRowInfos&&(f._colHeaderRowInfos=i.colHeaderRowInfos),(typeof i._zoomFactor!==r||typeof i.zoomFactor!==r)&&(f._zoomFactor=typeof i.zoomFactor===r?i._zoomFactor:i.zoomFactor),i.spans&&f._spanModel.fromJSON(i.spans),i.selections&&(f._clearSelectionImp(),f._selectionModel.fromJSON(i.selections)),f.referenceStyle(0),i.data&&(f._dataModel.fromJSON(i.data),w=i.data.dataTable,u&&w))for(a in w)if(typeof a!==c)for(b in w[a])typeof b!==c&&(k=w[a][b],g=k.formula,g&&(k.arrayInfo?f._setArrayFormulaCore(parseInt(a,10),parseInt(b,10),parseInt(k.arrayInfo.rowCount,10),parseInt(k.arrayInfo.colCount,10),g,!0):f._setFormulaCore(parseInt(a,10),parseInt(b,10),g,!0)));if(u&&i.sparklineGroupManager&&(nt=f._sparklineGroupManager,nt))for(nt.fromJSON(i.sparklineGroupManager),dt=nt.groups(),ui=f._getModel(),h=0;h<dt.length;h++)for(gt=dt[h]._innerList,it=0;it<gt.length;it++)tt=gt[it],ui.setSparkline(tt.row,tt.column,tt);if(i.commentManager&&f._commentManager.fromJSON(i.commentManager),i.theme)if(e=i.theme,typeof e=="string"||typeof e===r)f.currentTheme(e);else{var v=e.themeColor?e.themeColor:e._themeColor,o=v.colorList?v.colorList:v._colorList,fi=v.name?v.name:v._name,ei=0,oi=1,si=2,hi=3,ci=4,li=5,ai=6,vi=7,yi=8,pi=9,wi=10,bi=11,rt=o[si],ut=o[hi],ft=o[ei],et=o[oi],ot=o[ci],st=o[li],ht=o[ai],ct=o[vi],lt=o[yi],at=o[pi],vt=o[wi],yt=o[bi],ki=new t.ThemeColor(fi,new t._Color(rt.a,rt.r,rt.g,rt.b),new t._Color(ut.a,ut.r,ut.g,ut.b),new t._Color(ft.a,ft.r,ft.g,ft.b),new t._Color(et.a,et.r,et.g,et.b),new t._Color(ot.a,ot.r,ot.g,ot.b),new t._Color(st.a,st.r,st.g,st.b),new t._Color(ht.a,ht.r,ht.g,ht.b),new t._Color(ct.a,ct.r,ct.g,ct.b),new t._Color(lt.a,lt.r,lt.g,lt.b),new t._Color(at.a,at.r,at.g,at.b),new t._Color(vt.a,vt.r,vt.g,vt.b),new t._Color(yt.a,yt.r,yt.g,yt.b)),di=new t.SpreadTheme(e.name?e.name:e._name,ki,e.headingFont?e.headingFont:e._headingFont,e.bodyFont?e.bodyFont:e._bodyFont);f.currentTheme(di)}if(typeof i.showRowRangeGroup!==r&&(f._showRowRangeGroup=i.showRowRangeGroup),typeof i.showColumnRangeGroup!==r&&(f._showColumnRangeGroup=i.showColumnRangeGroup),i.rowRangeGroup&&f.rowRangeGroup&&f.rowRangeGroup.fromJSON(i.rowRangeGroup),i.colRangeGroup&&f.colRangeGroup&&f.colRangeGroup.fromJSON(i.colRangeGroup),i.rowFilter&&t.features.filter&&(pt=new t.HideRowFilter,f._rowFilter=pt,pt.sheet=f,pt.fromJSON(i.rowFilter)),i.conditionalFormats&&t.features.conditionalFormat&&f.getConditionalFormats().fromJSON(i.conditionalFormats),i.sheetTabColor&&f.sheetTabColor(i.sheetTabColor),i.frozenlineColor&&f.frozenlineColor(i.frozenlineColor),typeof i.clipBoardOptions!==r&&(f._clipBoardOptions=i.clipBoardOptions),typeof i.isProtected!==r&&(f.isProtected=i.isProtected),i.borderColor&&(f.borderColor=i.borderColor),typeof i.borderWidth!==r&&(f.borderWidth=i.borderWidth),typeof i.allowDragDrop!==r&&(f._allowDragDrop=i.allowDragDrop),typeof i.allowDragFill!==r&&(f._allowDragFill=i.allowDragFill),typeof i.allowUndo!==r&&f.allowUndo(i.allowUndo),typeof i.allowEditorReservedLocations!==r&&f.allowEditorReservedLocations(i.allowEditorReservedLocations),u&&i.names){for(wt=0;wt<i.names.length;wt++)d=i.names[wt],f._addCustomNameCore(d.name,d.formula,d.row,d.col,!0);f._rebuildCalcNodes()}if(f._namedStyles={},i.namedStyles)for(h=0;h<i.namedStyles.length;h++)bt=i.namedStyles[h],kt=new t.Style,kt.copyFrom(bt),typeof bt.validator!==r&&(t.features.dataValidator&&(ni=new n.spread.DefaultDataValidator,ni.fromJSON(bt.validator)),kt.validator=ni),f._addNamedStyleImp(kt,!1);i.selectionBackColor&&f.selectionBackColor(i.selectionBackColor);i.selectionBorderColor&&f.selectionBorderColor(i.selectionBorderColor);typeof i.tableManager!==r&&f._tableManager&&f._tableManager.fromJSON(i.tableManager);typeof i.floatingObjectArray!==r&&f._floatingObjectArray&&f._floatingObjectArray.fromJSON(i.floatingObjectArray);u&&typeof i.referenceStyle!==r&&f.referenceStyle(i.referenceStyle);typeof i.visible!==r&&(f._visible=i.visible)}finally{f.isPaintSuspended(ti)}}},l.prototype.formulaFromJSON=function(n){var t=this,s,h,u,w,f,i,e,o,l,b,a,k,g,d,v,y,p;if(typeof n.referenceStyle!==r&&t.referenceStyle(n.referenceStyle),s=n.names,s)for(h=0;h<s.length;h++)u=s[h],t._addCustomNameCore(u.name,u.formula,u.row,u.col,!0);if(w=n.data,w&&(f=w.dataTable,f))for(i in f)if(typeof i!==c)for(e in f[i])typeof e!==c&&(o=f[i][e],l=o.formula,l&&(o.arrayInfo?t._setArrayFormulaCore(parseInt(i,10),parseInt(e,10),parseInt(o.arrayInfo.rowCount,10),parseInt(o.arrayInfo.colCount,10),l,!0):t._setFormulaCore(parseInt(i,10),parseInt(e,10),l,!0)));if(b=n.sparklineGroupManager,b&&(a=t._sparklineGroupManager,a))for(a.fromJSON(b),k=a.groups(),g=t._getModel(),y=0;y<k.length;y++)for(d=k[y]._innerList,p=0;p<d.length;p++)v=d[p],g.setSparkline(v.row,v.column,v)},l.prototype._toArray=function(n,t){var f,r;if(!n)return i;for(f=[],r=0;r<t;r++)n[r]!==u&&(f[r]=n[r]);return f},l.prototype.isPaintSuspended=function(n){var t=this;return arguments.length===0?t._paintSuspended:(t._paintSuspended!==n&&(t._paintSuspended=n,!n&&t._layoutSuspended<=0&&(!t.parent||t.parent.getActiveSheet&&t.parent.getActiveSheet()===t)&&(t.invalidateLayout(),t.repaint())),t)},l.prototype.getName=function(){return this._name},l.prototype.setName=function(n){var i=this,r=i.parent;if(!i._isValidSheetName(n))throw t.SR.Exp_NotSupport;i._name=n;r&&r._doTabHSResize&&r._doTabHSResize()},l.prototype.visible=function(n){var u=this,r,i;if(arguments.length==0)return u._visible;if(u._visible=n,r=u.parent,r){var e=r.sheets,o=e.length,f=t.util.inArray(u,e),s=r.getActiveSheetIndex();if(f!=-1){if(n)s<0?r.setActiveSheetIndex(f):r._doTabHSResize();else if(f===s){for(i=f+1;i<o&&!e[i]._visible;)i++;if(i>=o)for(i=f-1;i>=0&&!e[i]._visible;)i--;i!==-1&&i<r._tab._firstTab&&(r._tab._firstTab=i);r.setActiveSheetIndex(i)}else r._doTabHSResize();return u}}},l.prototype.allowCellOverflow=function(n){var t=this;return arguments.length===0?t._allowCellOverflow:t._bindToAutoRefresh(function(n){return t._allowCellOverflow=n,t})(n)},l.prototype.allowUndo=function(n){var t=this,i;return arguments.length===0?t._allowUndo:(t._allowUndo=n,i=t.undoManager(),i&&(i._allowUndo=n),t)},l.prototype.allowEditorReservedLocations=function(n){return arguments.length===0?this._allowEditorReservedLocations:(this._allowEditorReservedLocations=n,this)},l.prototype.sheetTabColor=function(n){var t=this,i=t.parent;return arguments.length===0?t._sheetTabColor:(t._sheetTabColor=n,i&&i._doTabHSResize&&i._doTabHSResize(),t)},l.prototype.frozenlineColor=function(n){var t=this;return arguments.length===0?t._frozenlineColor:t._bindToAutoRefresh(function(n){return n&&(t._frozenlineColor=n),t})(n)},l.prototype.addRows=function(n,i){var r,u,k,f,s,h,c,l,d,e,a,v,y,p,w,o,b;if(!(i<=0)){if(r=this,u=r.getDataSource(),u&&t._BindingManager.isDataViewSource(u)){if(!u.canAdd||!u.canAdd())return;n=r.getRowCount()}k=r.isPaintSuspended();r.isPaintSuspended(!0);try{if((n<0||n>r.getRowCount())&&(n=r.getRowCount()),f=r._getSheetSource(),f){if(!r._checkArrayFormula(n,0,0,r.getColumnCount()))return;f.onBeforeAddRemoveRows(n)}if(s=r._getModel(),s.addElements(r._rowInfos,r.getRowCount(),n,i),s.addRows(n,i),h=r._cutCopyIndicatorManager,h&&h.addRows(),c=r._bindingManager,c&&c.addItems(n,i),l=r._getCalcModel(),l&&l.addRows(n,i),d=r._getModel(2),d.addRows(n,i),e=r._getSpanModel(2),e.addRows(n,i),e=r._getSpanModel(),e.addRows(n,i),a=r._rowFilter,a&&a._addRows(n,i),v=r.rowRangeGroup,v&&v._add(n,i),y=r._sparklineGroupManager,y&&y._addRows(n,i),p=r._conditionalFormats,p&&p._addRows(n,i),w=r._tableManager,w&&w.addRows(n,i),f)f.onAfterAddRows(n,i);o=r._floatingObjectArray;o&&o.length>0&&o.addRows(n,i);b=r._commentManager;b&&b.addRows(n,i);r._needSyncScrollbarSize=!0}finally{r.isPaintSuspended(k)}}},l.prototype._onDataDeleted=function(n){},l.prototype.deleteRows=function(n,r){var u=this,e,ft,l,o,p,et,h,ot,f,w,b,k,d,st,v,g,nt,tt,it,rt,a,s,c,y,ut;if(!(0>n)&&!(n>=u.getRowCount())&&!(r<=0)&&(e=u.getDataSource(),!e||!t._BindingManager.isDataViewSource(e)||e.canRemove&&e.canRemove())){ft=u.isPaintSuspended();u.isPaintSuspended(!0);try{if(l=u._getSheetSource(),l){if(!u._checkArrayFormula(n,0,r,u.getColumnCount()))return;l.onBeforeAddRemoveRows(n)}if(o=u._getModel(),u.autoUpdate&&u.dataContext&&u.dataContext.remove&&e&&e.length>0&&(u._dataDeleteDelegate=function(n){return u._onDataDeleted(n)},p=n,p>=0&&(et=u.getDataItem(p),$.ajax({url:u.dataContext.remove,type:lt,data:JSON.stringify(et),dataType:at,contentType:vt,success:u._dataDeleteDelegate}))),u.deletedRows||(u.deletedRows=[]),h=u._bindingManager,h)for(ot=h.getRowCount(),f=0;f<r&&n+f<o.rowCount;f++)w=i,n+f<ot&&(w=h.getDataItem(n+f)),b=i,o.dataTable&&o.dataTable[n+f]&&(b=o.dataTable[n+f].key),u.deletedRows.push({row:n+f,data:w,key:b});if(o.deleteElements(u._rowInfos,u.getRowCount(),n,r),o.deleteRows(n,r),h&&h.removeItems(n,r),k=u._cutCopyIndicatorManager,k&&k.deleteRows(),d=u._getCalcModel(),d&&d.deleteRows(n,r),st=u._getModel(2),st.deleteRows(n,r),v=u._getSpanModel(2),v.removeRows(n,r),v=u._getSpanModel(),v.removeRows(n,r),g=u._rowFilter,g&&g._removeRows(n,r),nt=u.rowRangeGroup,nt&&nt._remove(n,r),tt=u._sparklineGroupManager,tt&&tt._removeRows(n,r),it=u._conditionalFormats,it&&it._removeRows(n,r),rt=u._tableManager,rt&&rt.removeRows(n,r),a=u._scrollTopRow,a>=0){for(s=-1,c=a;c>=u.frozenRowCount;c--)if(u.getRowVisible(c)&&u._getZoomRowHeight(c)>0){s=c;break}s===-1&&(s=0);a!==s&&(u._scrollTopRow=s,u._syncVScrollbarPosition(),u._trigger(t.Events.TopRowChanged,{sheet:u,sheetName:u._name,oldTopRow:a,newTopRow:s}))}if(l)l.onAfterRemoveRows(n,r);y=u._floatingObjectArray;y&&y.length>0&&y.removeRows(n,r);ut=u._commentManager;ut&&ut.removeRows(n,r);u._needSyncScrollbarSize=!0}finally{u.isPaintSuspended(ft)}}},l.prototype.addColumns=function(n,t){if(!(t<=0)){var i=this;i._bindToAutoRefresh(function(n,t){var r,e,o,s,p,u,h,c,l,a,v,f,y;if((n<0||n>i.getColumnCount())&&(n=i.getColumnCount()),!i.parent||!i.parent.gcSpreadsheet){if(r=i._getSheetSource(),r){if(!i._checkArrayFormula(0,n,i.getRowCount(),0))return;r.onBeforeAddRemoveColumns(n)}if(e=i._getModel(),e.addElements(i._colInfos,i.getColumnCount(),n,t),e.addColumns(n,t),o=i._cutCopyIndicatorManager,o&&o.addColumns(),s=i._getCalcModel(),s&&s.addColumns(n,t),p=i._getModel(1),p.addColumns(n,t),u=i._getSpanModel(1),u.addColumns(n,t),u=i._getSpanModel(),u.addColumns(n,t),h=i._rowFilter,h&&h._addColumns(n,t),c=i.colRangeGroup,c&&c._add(n,t),l=i._sparklineGroupManager,l&&l._addColumns(n,t),a=i._conditionalFormats,a&&a._addColumns(n,t),v=i._tableManager,v&&v.addColumns(n,t),r)r.onAfterAddColumns(n,t);f=i._floatingObjectArray;f&&f.length>0&&f.addColumns(n,t);y=i._commentManager;y&&y.addColumns(n,t);i._needSyncScrollbarSize=!0}})(n,t)}},l.prototype.deleteColumns=function(n,i){var r=this;0>n||n>=r.getColumnCount()||i<=0||r.parent&&r.parent.gcSpreadsheet||r._bindToAutoRefresh(function(n,i){var o=r._getSheetSource(),c,l,a,d,s,v,y,p,w,b,e,u,f,h,k;if(o){if(!r._checkArrayFormula(0,n,r.getRowCount(),i))return;o.onBeforeAddRemoveColumns(n)}if(c=r._getModel(),c.deleteElements(r._colInfos,r.getColumnCount(),n,i),c.deleteColumns(n,i),l=r._cutCopyIndicatorManager,l&&l.deleteColumns(),a=r._getCalcModel(),a&&a.deleteColumns(n,i),d=r._getModel(1),d.deleteColumns(n,i),s=r._getSpanModel(1),s.removeColumns(n,i),s=r._getSpanModel(3),s.removeColumns(n,i),v=r._rowFilter,v&&v._removeColumns(n,i),y=r.colRangeGroup,y&&y._remove(n,i),p=r._sparklineGroupManager,p&&p._removeColumns(n,i),w=r._conditionalFormats,w&&w._removeColumns(n,i),b=r._tableManager,b&&b.removeColumns(n,i),e=r._scrollLeftCol,e>=0){for(u=-1,f=e;f>=r.frozenColCount;f--)if(r.getColumnVisible(f)&&r._getZoomColumnWidth(f)>0){u=f;break}u===-1&&(u=0);e!==u&&(r._trigger(t.Events.LeftColumnChanged,{sheet:r,sheetName:r._name,oldLeftCol:e,newLeftCol:u}),r._scrollLeftCol=u,r._syncHScollbarPosition())}if(o)o.onAfterRemoveColumns(n,i);h=r._floatingObjectArray;h&&h.length>0&&h.removeColumns(n,i);k=r._commentManager;k&&k.removeColumns(n,i);r._needSyncScrollbarSize=!0})(n,i)},l.prototype.setFrozenCount=function(n,t){(typeof n===r||n===i||n<0||isNaN(n))&&(n=0);(typeof t===r||t===i||t<0||isNaN(t))&&(t=0);var u=this;(u.frozenRowCount!==n||u.frozenColCount!==t)&&u._bindToAutoRefresh(function(n,t){var i=!1;u.frozenRowCount!==n&&(u._scrollTopRow+=n-u.frozenRowCount,u.frozenRowCount=n,i=!0);u.frozenColCount!==t&&(u._scrollLeftCol+=t-u.frozenColCount,u.frozenColCount=t,i=!0);i&&(u._needSyncScrollbarSize=!0)})(n,t)},l.prototype.setFrozenColumnCount=function(n){(typeof n===r||n===i||n<0||isNaN(n))&&(n=0);var t=this;t.frozenColCount!==n&&t._bindToAutoRefresh(function(n){t._scrollLeftCol+=n-t.frozenColCount;t.frozenColCount=n;t._needSyncScrollbarSize=!0})(n)},l.prototype.setFrozenRowCount=function(n){(typeof n===r||n===i||n<0||isNaN(n))&&(n=0);var t=this;t.frozenRowCount!==n&&t._bindToAutoRefresh(function(n){t._scrollTopRow+=n-t.frozenRowCount;t.frozenRowCount=n;t._needSyncScrollbarSize=!0})(n)},l.prototype.setFrozenTrailingRowCount=function(n){(typeof n===r||n===i||n<0||isNaN(n))&&(n=0);var t=this;t._frozenTrailingRowCount!==n&&t._bindToAutoRefresh(function(n){t._frozenTrailingRowCount=n;t._needSyncScrollbarSize=!0})(n)},l.prototype.setFrozenTrailingColumnCount=function(n){(n===u||n===i||n<0||isNaN(n))&&(n=0);var t=this;t._frozenTrailingColCount!==n&&t._bindToAutoRefresh(function(n){t._frozenTrailingColCount=n;t._needSyncScrollbarSize=!0})(n)},l.prototype.getRowCount=function(n){var t=this._getModel(n);return t&&t.rowCount||0},l.prototype.getColumnCount=function(n){var t=this._getModel(n);return t&&t.colCount||0},l.prototype.setRowCount=function(n,t){if(n=parseInt(n,10),!isNaN(n)){var r=this;n<0||n===r.getRowCount(t)||r._bindToAutoRefresh(function(n,t){if((t===u||t===i)&&(t=3),t===3||t===2)r._dataModel.rowCount>n&&r.deleteRows(n,r._dataModel.rowCount-n),r._dataModel.rowCount=r._rowHeaderModel.rowCount=n,r._calcDataModel&&(r._calcDataModel.rowCount=n),r.frozenRowCount>n&&r.setFrozenRowCount(n),r._rowInfos||(r._rowInfos={}),r.rowRangeGroup&&r.rowRangeGroup._setCount(n);else if(t===1){r._colHeaderRowInfos||(r._colHeaderRowInfos={});var f=r._colHeaderModel;f.rowCount>n&&f.deleteElements(r._colHeaderRowInfos,f.rowCount,n,f.rowCount-n);f.rowCount=n}r._needSyncScrollbarSize=!0;r._activeRowIndex>=n&&(t===3||t===2)&&(r._clearSelectionImp(),r._setActiveCellImp(-1,-1,r.activeRowViewportIndex,r.activeColViewportIndex))})(n,t)}},l.prototype.setColumnCount=function(n,t){if(n=parseInt(n,10),!isNaN(n)){var r=this;n<0||n===r.getColumnCount(t)||r._bindToAutoRefresh(function(n,t){if((t===u||t===i)&&(t=3),t===3||t===1)r._dataModel.colCount>n&&r.deleteColumns(n,r._dataModel.colCount-n),r._dataModel.colCount=r._colHeaderModel.colCount=r._colFooterModel.colCount=n,r._calcDataModel&&(r._calcDataModel.colCount=n),r.frozenColCount>n&&r.setFrozenColumnCount(n),r._colInfos||(r._colInfos={}),r.colRangeGroup&&r.colRangeGroup._setCount(n);else if(t===2){r._rowHeaderColInfos||(r._rowHeaderColInfos={});var f=r._rowHeaderModel;f.colCount>n&&f.deleteElements(r._rowHeaderColInfos,f.colCount,n,f.colCount-n);f.colCount=n}r._needSyncScrollbarSize=!0;r._activeColIndex>=n&&(t===3||t===1)&&(r._clearSelectionImp(),r._setActiveCellImp(-1,-1,r.activeRowViewportIndex,r.activeColViewportIndex))})(n,t)}},l.prototype.getText=function(n,t,u){var f,e;if((typeof u===r||u===i)&&(u=3),f=this,e=f.getValue(n,t,u),e===i||typeof e===r)return"";else{var s=f.getCellType(n,t,u),o=f.getActualStyle(n,t,u),h=o.formatter?o.formatter:o._autoFormatter,c={sheet:f,row:n,col:t,sheetArea:u};return s.format(e,h,c)}},l.prototype.setText=function(n,t,r,f){var e=this;e._bindToAutoRefresh(function(n,t,r,f){var c;(f===u||f===i)&&(f=3);var o=r,s=e.getCellType(n,t,f),h=e.getCell(n,t,f).formatter();s&&h&&(c={sheet:e,row:n,col:t,sheetArea:f},o=s.parse(r,h,c));e.setValue(n,t,o,f)})(n,t,r,f)},l.prototype.getValue=function(n,u,f){var o,h,e,s,c,v,l,a,y,p;return((typeof f===r||f===i)&&(f=3),o=this,h=o._getModel(f),!h)?i:(e=o._getValueImp(h,n,u,f),f===1?(typeof e===r||e===i)&&(c=o.getDataSource(),c&&(v=window.ko,(t._BindingManager.isDataViewSource(c)||c.length>0||v&&v.isObservable(c))&&(l=o._colInfos[u],a=o.colHeaderAutoTextIndex,l&&(a>=0&&n===a||a===-1&&n===h.rowCount-1)&&(e=l.displayName||l.name))),(typeof e===r||e===i)&&(s=o.colHeaderAutoTextIndex,(s<0||s>=h.rowCount)&&(s=h.rowCount-1),n===s&&(y=o.colHeaderAutoText,y===2?e=o._indexToLetters(u+1):y===1&&(e=u+1)))):f===2&&(typeof e===r||e===i)&&(s=o.rowHeaderAutoTextIndex,(s<0||s>=h.colCount)&&(s=h.colCount-1),u===s&&(p=o.rowHeaderAutoText,p===2?e=o._indexToLetters(n+1):p===1&&(e=n+1))),e)},l.prototype._getCurrentValue=function(n,t){var i=this;return i._isValidatingCell&&i._validatingRow===n&&i._validatingColumn===t?i._validatingValue:i.getValue(n,t)},l.prototype._getValuesForCalc=function(n,t,i,r,u,f,e){var o=this,c=o._getModel(),s,h;if(c){var v=o.getRowCount(),y=o.getColumnCount(),p=o._getValueImp(c,t,i,3),l,a;for(s=0;s<r;s++)for(l=(s+t)%v,h=0;h<u;h++)a=(h+i)%y,n[0][f+s][e+h]=o._getValueImp(c,l,a,3);o._isValidatingCell&&o._validatingRow>=t&&o._validatingRow<t+r&&o._validatingColumn>=i&&o._validatingColumn<i+u&&(n[0][f+o._validatingRow][e+o._validatingColumn]=o._validatingValue)}},l.prototype.setValue=function(n,t,i,r,u){this._setValueInternal(n,t,i,r,u);this.invalidate()},l.prototype._setValueInternal=function(n,u,f,e,o){var s,c,k,d,l,a,h,y,p,w,v,b;if(((typeof e===r||e===i)&&(e=3),s=this,c=s._getModel(e),c)&&(k=c.rowCount,d=c.colCount,!(n<0)&&!(n>=k)&&!(u<0)&&!(u>=d))){if(l=e===3,typeof f!==r&&f!==i&&f.constructor===Date&&(f="/OADate("+new t._DateTimeHelper(f).toOADate()+")/"),a=s._tableManager,l&&a&&a._tableList.length>0&&(h=a.find(n,u),h))if(h.showHeader()&&n===h.headerIndex()){if(h._hasColumnName(f))return;h._setHeader(n,u,f)}else h.showFooter()&&n===h.footerIndex()&&h._setFooterValue(n,u,f);p=s._eventHandler._eventSuspended>0;p||(y=s._getValueImp(c,n,u,e));l?(w=!1,v=s._bindingManager,v&&v._dataSource&&(w=v.setValue(n,u,f)),(!w||s.checkingChanges)&&(c.setValue(n,u,f),s._activeRowDirty=!0)):c.setValue(n,u,f);l&&!o&&s._recalcCell(c,n,u);b=s._conditionalFormats;b&&b._clearCache();p||y===f||s._trigger(t.Events.CellChanged,{sheet:s,sheetName:s._name,row:n,col:u,sheetArea:e,propertyName:st,_oldValue:y})}},l.prototype.sortRange=function(n,i,r,u,f,e){var o=this;return o._bindToAutoRefresh(function(n,i,r,u,f,e){var ct=o.isPaintSuspended(),st,tt,it,b,k,h,c,a,v,rt,ut,ft,et,ot,d,g;o.isPaintSuspended(!0);o.suspendEvent();o.suspendCalcService();try{if((st=o.getSpans(new t.Range(n,i,r,u)),st&&st.length>0)||(tt=o.getRowCount(),it=o.getColumnCount(),n===-1&&(n=0),r===-1&&(r=tt),i===-1&&(i=0),u===-1&&(u=it),n<0||n>=tt||i<0||i>=it||r<0||n+r>tt||u<0||i+u>it||!e))return!1;if(rt=o._quickSort(n,i,r,u,f,e),rt){var ht=o._getModel(),l=o._getCalcModel(),y=o._getSheetSource(),nt,p,w;if(f){for(k=n;k<n+r;k++)if(nt=o._getSwapIndex(rt,n,k),k!==nt)for(h=k,a=nt,b=i;b<i+u;b++)c=b,ut=o.getValue(h,c),ft=o.getValue(a,c),et=o.getComment(h,c),ot=o.getComment(a,c),l&&y&&(d=y._getCellCalc(h,c,!1),d&&d.hasListeners()&&d.addListenersToAdjust(),g=y._getCellCalc(a,c,!1),g&&g.hasListeners()&&g.addListenersToAdjust(),l.swapNode(h,c,a,c),p=s._copyExpression(l.getExpr(h,c),h,c,0,0),l.setFormula(h,c,p),w=y._getCellCalc(h,c,!!p),w&&w.startListening(),p=s._copyExpression(l.getExpr(a,c),a,c,0,0),l.setFormula(a,c,p),w=y._getCellCalc(a,c,!!p),w&&w.startListening(),y._controller.adjustFormulasOnSwap(l,h,c,l,a,c,1,1)),ht.swapNode(h,c,a,c),o.setComment(h,c,ot),o.setComment(a,c,et),o.setValue(h,c,ft),o.setValue(a,c,ut)}else for(b=i;b<i+u;b++)if(nt=o._getSwapIndex(rt,i,b),b!==nt)for(c=b,v=nt,k=n;k<n+r;k++)h=k,ut=o.getValue(h,c),ft=o.getValue(h,v),et=o.getComment(h,c),ot=o.getComment(h,v),l&&y&&(d=y._getCellCalc(h,c,!1),d&&d.hasListeners()&&d.addListenersToAdjust(),g=y._getCellCalc(h,v,!1),g&&g.hasListeners()&&g.addListenersToAdjust(),l.swapNode(h,c,h,v),p=s._copyExpression(l.getExpr(h,c),h,c,0,0),l.setFormula(h,c,p),w=y._getCellCalc(h,c,!!p),w&&w.startListening(),p=s._copyExpression(l.getExpr(h,v),h,v,0,0),l.setFormula(h,v,p),w=y._getCellCalc(h,v,!!p),w&&w.startListening(),y._controller.adjustFormulasOnSwap(l,h,c,l,h,v,1,1)),ht.swapNode(h,c,h,v),o.setComment(h,c,ot),o.setComment(h,v,et),o.setValue(h,c,ft),o.setValue(h,v,ut);return!0}return!1}finally{o.resumeCalcService();o.resumeEvent();o.isPaintSuspended(ct);o._raiseRangeDataChanged(n,i,r,u)}})(n,i,r,u,f,e)},l.prototype.getActualStyle=function(n,u,f,e){var s,o,a,l,v,y,p;if((typeof f===r||f===i)&&(f=3),s=this,a=s.getCompositeStyle(n,u,f),f===3&&!e&&(l=a.formatter,l&&l.HasFormatedColor&&l.HasFormatedColor()&&(v={value:i},l.Format(s.getValue(n,u),v),v.value&&(o=new t.Style,o.foreColor=v.value)),y=s._conditionalFormats,y&&y.count()>0)){var w=y.getRules(n,u),b=w.length,h,c=i;if(b>0)for(o||(o=new t.Style),w.sort(function(n,t){return n.priority()-t.priority()}),p=0;p<b;p++)if((h=w[p],h)&&(h.isScaleRule()?(h instanceof t.TwoScaleRule||h instanceof t.ThreeScaleRule)&&(c=h.evaluate(s,n,u,s.getValue(n,u,f)),c&&(o.backColor=c)):(c=h.evaluate(s,n,u,s.getValue(n,u,f)),c&&o.compose(c)),h.stopIfTrue()&&c))break}return o?o.compose(a):o=a,(typeof o.locked===r||o.locked===i)&&(o.locked=!0),o._normalize(s._currentTheme)},l.prototype.getStyleProperty=function(n,f,e,o){var h,s,k,p,w,c,l,b,d,g,nt,y,tt,rt,ft;if((typeof o===r||o===i)&&(o=3),h=this,w=h._getModel(o),!w)return u;if(l=!1,o===3&&(e==="foreColor"&&(b=h.getStyleProperty(n,f,"formatter",o),b&&b.HasFormatedColor&&b.HasFormatedColor()&&(d={value:i},b.Format(h.getValue(n,f),d),d.value&&(c=d.value,l=!0))),g=h._conditionalFormats,g&&g.count()>0)){var it=g.getRules(n,f),ut=it.length,a,v=i;if(ut>0)for(it.sort(function(n,t){return n.priority()-t.priority()}),nt=0;nt<ut;nt++)if(a=it[nt],a){if(a.isScaleRule()){if(e==="backColor"&&(a instanceof t.TwoScaleRule||a instanceof t.ThreeScaleRule)&&(v=a.evaluate(h,n,f,h.getValue(n,f,o)),v)){c=v;l=!0;break}}else if(v=a.evaluate(h,n,f,h.getValue(n,f,o)),v&&v[e]!==u){c=v[e];l=!0;break}if(a.stopIfTrue()&&v)break}}for(y=0;!l&&y<=4;)if(y===0?s=w.getStyle(n,f):y===1?(tt=h._tableManager,tt&&tt.getCount()>0&&o===3&&(rt=tt.find(n,f),rt&&(s=new t.Style,rt._compose(n,f,s)))):s=y===2?w.getStyle(n,-1):y===3?w.getStyle(-1,f):h.getDefaultStyle(),y++,s){if(s.charAt&&typeof s=="string"&&(s=h._name2Style(s)),s[e]!==u){c=s[e];l=!0;break}for(k=s.parentName;k;){if(p=h._name2Style(k),!p)break;if(p[e]!==u){c=p[e];l=!0;break}k=p.parentName}}if(e==="locked")return c===u||c===i?!0:c;else if(l)return(e==="foreColor"||e==="backColor"||e==="font"||e==="borderLeft"||e==="borderTop"||e==="borderRight"||e==="borderBottom")&&(s=new t.Style,s[e]=c,e==="font"&&(ft=h.getStyleProperty(n,f,"themeFont",o),s.themeFont=ft),s._normalize(h._currentTheme),c=s[e]),c;return u},l.prototype.getStyle=function(n,r,f){var o,e,s,h;if((f===u||f===i)&&(f=3),o=this._getModel(f),o)if(e=o.getStyle(n,r),e instanceof t.Style)return e;else if(typeof e=="string"&&(s=this._name2Style(e),s!==i))return h=new t.Style,h.compose(s),h;return i},l.prototype.addNamedStyle=function(n){this._addNamedStyleImp(n,!0)},l.prototype._addNamedStyleImp=function(n,r){if(n!==i&&n!==u){if(n.name===i||n.name===u||n.name==="")throw new Error(t.SR.Exp_EmptyNamedStyle);if(r)this._bindToAutoRefresh(function(n){var t=n.name.toUpperCase();this._namedStyles[t]=n})(n);else{var f=n.name.toUpperCase();this._namedStyles[f]=n}}},l.prototype.getNamedStyle=function(n){var t=this._namedStyles;return t&&n?(n=n.toUpperCase(),t[n]||i):i},l.prototype.getNamedStyles=function(){var n=[],t=this._namedStyles;return t&&$.each(t,function(t,i){n.push(i)}),n},l.prototype.removeNamedStyle=function(n){var t=this;t._namedStyles&&n!==u&&n!=i&&n!==""&&(n=n.toUpperCase(),t._namedStyles.hasOwnProperty(n)&&(delete t._namedStyles[n],t.invalidate()))},l.prototype.setStyle=function(n,t,i,r){this.setStyleObject(n,t,i,r);this.invalidate()},l.prototype.getStyleName=function(n,i,r){var u=this.getStyleObject(n,i,r);return u instanceof t.Style?u.name:u},l.prototype.setStyleName=function(n,t,i,r){typeof i=="string"&&(this.setStyleObject(n,t,i,r),this.invalidate())},l.prototype.getStyleObject=function(n,t,r){(r===u||r===i)&&(r=3);var f=i,e=this._getModel(r);return e&&(f=e.getStyle(n,t),f!==u&&f!==i)?f:i},l.prototype.setStyleObject=function(n,u,f,e){var o,l,s,h;(typeof e===r||e===i)&&(e=3);o=this;l=o._getModel(e);l&&(l.setStyle(n,u,f),f&&f.formatter&&t.features.formatter&&(s=f.formatter,s&&typeof s.Init===c&&s.Init()),h="[styleinfo]",n!==-1&&u!==-1?o._trigger(t.Events.CellChanged,{sheet:o,sheetName:o._name,row:n,col:u,sheetArea:e,propertyName:h}):n!==-1&&u===-1?o._trigger(t.Events.RowChanged,{sheet:o,sheetName:o._name,row:n,sheetArea:e,propertyName:h}):n===-1&&u!==-1&&o._trigger(t.Events.ColumnChanged,{sheet:o,sheetName:o._name,col:u,sheetArea:e,propertyName:h}))},l.prototype.getDefaultStyle=function(n){var e,o,f,u,s;return((typeof n===r||n===i)&&(n=3),e=this._composedDefaultStyle,o=e[n],o)?o:(f=this._getModel(n),f)?(u=f.getStyle(-1,-1),typeof u=="string"&&(u=this._name2Style(u)),u||(u=new t.Style,f.setStyle(-1,-1,u)),s=n===1||n===2,u.foreColor||(u.foreColor="#000000"),typeof u.hAlign===r&&(u.hAlign=s?1:3),typeof u.vAlign===r&&(u.vAlign=s?1:0),typeof u.imeMode===r&&(u.imeMode=1),e[n]=u,u):i},l.prototype.setDefaultStyle=function(n,t){(typeof t===r||t===i)&&(t=3);var u=this._getModel(t);u&&u.setStyle(-1,-1,n);this._composedDefaultStyle[t]=i},l.prototype._name2Style=function(n){var r=this.getNamedStyle(n),t;return r?r:(t=this.parent,t&&t.getNamedStyle)?t.getNamedStyle(n):i},l.prototype.getCompositeStyle=function(n,u,f){var p,w,e,y,b,l;(typeof f===r||f===i)&&(f=3);var h=this,c=new t.Style,o,s,a=!1,v=h._getModel(f);if(v){if(p=v.rowCount,w=v.colCount,0<=n&&n<p&&0<=u&&u<w&&(e=v.getStyle(n,u),e&&e.charAt&&(e=h._name2Style(e)),e))for(c.compose(e,!0),a=!0,s=e.parentName;s;){if(o=h._name2Style(s),!o)break;c.compose(o);s=o.parentName}if(y=h._tableManager,y&&y.getCount()>0&&f===3&&(b=y.find(n,u),b&&(b._compose(n,u,c),a=!0)),0<=n&&n<p&&(e=v.getStyle(n,-1),e&&e.charAt&&(e=h._name2Style(e)),e))for(c.compose(e,!a),a=!0,s=e.parentName;s;){if(o=h._name2Style(s),!o)break;c.compose(o);s=o.parentName}if(0<=u&&u<w&&(e=v.getStyle(-1,u),e&&e.charAt&&(e=h._name2Style(e)),e))for(c.compose(e,!a),a=!0,s=e.parentName;s;){if(o=h._name2Style(s),!o)break;c.compose(o);s=o.parentName}}if(l=h.getDefaultStyle(f),l&&l.charAt&&(l=h._name2Style(l)),l)for(c.compose(l,!a),s=l.parentName;s;){if(o=h._name2Style(s),!o)break;c.compose(o);s=o.parentName}return c},l.prototype.getCellType=function(n,t,i){return this.getStyleProperty(n,t,"cellType",i)||this.getDefaultCellType(i)},l.prototype.getDefaultCellType=function(n){(typeof n===r||n===i)&&(n=3);var u=this._defaultCellType;return u||(u=this._defaultCellType=new t.TextCellType),n===3?u:n===1?new t.ColumnHeaderCellType:n===2?new t.RowHeaderCellType:n===0?new t.CornerCellType:u},l.prototype.setCellType=function(n,i,r,u){var f=this.getStyle(n,i,u);f||(f=new t.Style);f.cellType=r;this.setStyle(n,i,f,u)},l.prototype.getFormatter=function(n,t,i){return this.getStyleProperty(n,t,"formatter",i)},l.prototype.setFormatter=function(n,i,r,u){var f=this.getStyle(n,i,u);f||(f=new t.Style);f.formatter=r;this.setStyle(n,i,f,u)},l.prototype.getDataValidator=function(n,t,i){return this.getStyleProperty(n,t,"validator",i)},l.prototype.setDataValidator=function(n,r,f,e){var o,s,h,c;(e===u||e===i)&&(e=3);o=this;s=o.getStyle(n,r,e);s||(s=new t.Style);s.validator=f;o.suspendEvent();o.setStyle(n,r,s,e);o.resumeEvent();t.features.conditionalFormat&&f&&(f.condition instanceof t.FormulaCondition&&(f.condition._baseRow===u||f.condition._baseRow===i)&&(f.condition._baseRow=n!==-1?n:0),f.condition instanceof t.FormulaCondition&&(f.condition._baseCol===u||f.condition._baseCol===i)&&(f.condition._baseCol=r!==-1?r:0));h=t.Events;c="validator";o._trigger(h.CellChanged,{sheet:o,sheetName:o._name,row:n,col:r,sheetArea:e,propertyName:c});n!==-1&&r===-1?o._trigger(h.RowChanged,{sheet:o,sheetName:o._name,row:n,sheetArea:e,propertyName:c}):n===-1&&r!==-1&&o._trigger(h.ColumnChanged,{sheet:o,sheetName:o._name,col:r,sheetArea:e,propertyName:c})},l.prototype.isValid=function(n,t,r){var u,f;try{if(u=this,u._validatingRow=n,u._validatingColumn=t,u._validatingValue=r,u._isValidatingCell=!0,f=u.getDataValidator(n,t),f)return f.isValid(u,n,t,r)}finally{u._validatingRow=-1;u._validatingColumn=-1;u._validatingValue=i;u._isValidatingCell=!1}return!0},l.prototype.addSelection=function(n,i,r,u){var f=this;f._bindToAutoRefresh(function(n,i,r,u){var s=n,h=i,c=r,l=u,o,e;s!==-1&&h!==-1&&(o=f._getSpanModel().slice(0),o&&o.length>0&&(e=f._cellRangeInflate(o,new t.Range(n,i,r,u)),s=e.row,h=e.col,c=e.rowCount,l=e.colCount));f._selectionModel.add(s,h,c,l)})(n,i,r,u)},l.prototype.setSelection=function(n,t,i,r){var u=this,o=u.getRowCount(),s=u.getColumnCount(),f,e;n>=o&&(n=o-1);f=n;f<0&&(f=0);e=t;t>=s&&(t=s-1);e<0&&(e=0);u._clearSelectionImp();u._setActiveCellImp(f,e);u.addSelection(n,t,i,r)},l.prototype.getSelections=function(){return this._selectionModel},l.prototype._addSpanImp=function(n,r,f,e,o){var s=this;s._bindToAutoRefresh(function(n,r,f,e,o){var l,a,v,c,h;if((o===u||o===i)&&(o=3),l=s._getSpanModel(o),l.clear(n,r,f,e),a=new t.Range(n,r,f,e),v=s._getActualRange(a,o),l.push(v),o===3)for(c=s.getSelections(),h=0;h<c.length;h++)c[h].intersect(n,r,f,e)&&(c[h]=c[h].union(a))})(n,r,f,e,o)},l.prototype.addSpan=function(n,i,r,u,f){var e,s,o,h,c;if((r!==1||u!==1)&&f!==0){if(e=!0,(f===3||f===undefined)&&(e=this._checkArrayFormula(n,i,r,u,!1)),e)for(s=this._getSpanModel(f),o=s.getEnumerator(n,i,r,u);o.moveNext();)if(h=o.current(),c=new t.Range(n,i,r,u),!c.containsRange(h)){e=!1;break}if(!e)throw new Error(t.SR.Exp_InvalidRange);this._addSpanImp(n,i,r,u,f)}},l.prototype.removeSpan=function(n,t,r){this._bindToAutoRefresh(function(n,t,r){var e,f,o;for((r===u||r===i)&&(r=3),e=this._getSpanModel(r),f=0;f<e.length;f++)if(o=e[f],o.row===n&&o.col===t){e.splice(f,1);return}})(n,t,r)},l.prototype.repaint=function(n){this._paintSuspended||this._render.repaint(n)},l.prototype.startEdit=function(n,t){var r=this;r._startEditImp(r._getCanvas(),r._activeRowIndex,r._activeColIndex,i,i,n,t)},l.prototype.editorStatus=function(){return this._editorStatus?this._editorStatus:0},l.prototype.isEditing=function(){return this._editorStatus===1||this._editorStatus===2},l.prototype.doKeyDown=function(n){this._eventHandler.doKeyDown(n)},l.prototype.doKeyUp=function(n){this._eventHandler.doKeyUp(n)},l.prototype.doCompositionStart=function(){this._eventHandler.doCompositionStart()},l.prototype.removeKeyMap=function(n,t,i,r,u){var o=this.keyMap,e,f;if(o)for(u=typeof u=="function"?!1:u,e=0;e<o.length;e++)if(f=o[e],f&&f.key===n&&f.ctrl===t&&f.shift===i&&f.alt===r&&f.meta===u){o.splice(e,1);break}},l.prototype.removeFloatingObjectKeyMap=function(n,t,i,r,u,f){var s=this.floatingObjectKeyMap,o,e;if(s){var h=f&&u||!1,c=f||u,u=h,f=c;for(o=0;o<s.length;o++)if(e=s[o],e&&e.key===n&&e.ctrl===t&&e.shift===i&&e.alt===r&&e.meta===u){s.splice(o,1);break}}},l.prototype.removeCommentKeyMap=function(n,t,i,r,u,f){var s=this,o,e;if(s._commentKeyMap){var h=f&&u||!1,c=f||u,u=h,f=c;for(o=0;o<s._commentKeyMap.length;o++)if(e=s._commentKeyMap[o],e&&e.key===n&&e.ctrl===t&&e.shift===i&&e.alt===r&&e.meta===u){s._commentKeyMap.splice(o,1);break}}},l.prototype.addKeyMap=function(n,i,r,u,f,e){var o=this;o.keyMap||(o.keyMap=[]);var h=e&&f||!1,c=e||f,f=h,e=c,s=o._getKeyAction(n,i,r,u,f);s?s.action=e:o.keyMap.push(new t.KeyMap(n,i,r,u,f,e))},l.prototype.addFloatingObjectKeyMap=function(n,i,r,u,f,e){var o=this;o.floatingObjectKeyMap||(o.floatingObjectKeyMap=[]);var h=e&&f||!1,c=e||f,f=h,e=c,s=o._getFloatingObjectKeyAction(n,i,r,u,f);s?s.action=e:o.floatingObjectKeyMap.push(new t.KeyMap(n,i,r,u,f,e))},l.prototype.addCommentKeyMap=function(n,i,r,u,f,e){var o=this;o._commentKeyMap||(o._commentKeyMap=[]);var h=e&&f||!1,c=e||f,f=h,e=c,s=o._getCommentKeyAction(n,i,r,u,f);s?s.action=e:o._commentKeyMap.push(new t.KeyMap(n,i,r,u,f,e))},l.prototype._moveFormulaTextBoxCell=function(n,u,f,e){var c=this,v=c._formulaTextBox,y,s,h,b,k,l,a;if(v&&v.canAppendRange()){var o=c._getKeyboardAppendingInfo(),d=o.anchorRow,g=o.anchorCol,p=o.leadingRow,w=o.leadingCol;(typeof f===r||f===i)&&(f=d);(typeof e===r||e===i)&&(e=g);y=c._eventHandler;switch(n){case 3:case 4:if(l=n===3?c._getMoveLeftCell(f,e,u,p):c._getMoveRightCell(f,e,u,p),!l)return;if(s=l.row,h=l.col,b=l.leadingCellRow,!c._canMoveCurrentTo(s,h))return;o.anchorRow=s;o.anchorCol=h;o.leadingRow=b;o.leadingCol=h;a=y.rangeToString(new t.Range(s,h,1,1));a&&v.appendRange(a,!1,!0);break;case 1:case 2:if(l=n===1?c._getMoveUpCell(f,e,u,w):c._getMoveDownCell(f,e,u,w),!l)return;if(s=l.row,h=l.col,k=l.leadingCellCol,!c._canMoveCurrentTo(s,h))return;o.anchorRow=s;o.anchorCol=h;o.leadingRow=s;o.leadingCol=k;a=y.rangeToString(new t.Range(s,h,1,1));a&&v.appendRange(a,!1,!0);break;default:break}s>=0&&h>=0&&c._scrollByMoveCell(s,h)}},l.prototype._changeFormulaTextBoxActiveRange=function(n,i){var u=this,r=u._formulaTextBox,l,a,e;if(r&&r.canAppendRange()){var o=u._eventHandler,s=u._getKeyboardAppendingInfo(),h=s.anchorRow,c=s.anchorCol,f;r.isAppending()?(l=r.getActiveRange(),f=o.stringToRange(l.text)):f=new t.Range(h,c,1,1);f&&(a=u._getKeyboardSelectedRange(f,n,i,h,c),e=o.rangeToString(a),e&&r.appendRange(e,!0,!1))}},l.prototype._getKeyboardAppendingInfo=function(){var n=this,i=n._formulaTextBox,t=n._eventHandler;return i.isAppending()?t._formulaRangeAppendingInfo:t._formulaRangeAppendingInfo={anchorRow:n._activeRowIndex,anchorCol:n._activeColIndex,leadingRow:n._leadingCellRow,leadingCol:n._leadingCellCol}},l.prototype.moveActiveCell=function(n,r,f,e){var o=this,s={sheet:o,sheetName:o._name,row:o._activeRowIndex,col:o._activeColIndex,cancel:!1},h,c,l;(o._trigger(t.Events.LeaveCell,s),s&&s.cancel===!0)||o.endEdit()&&(o._activeRowDirty&&(o.updateRecord(),o._activeRowDirty=!1),h=o._activeRowIndex,c=o._activeColIndex,(f===u||f===i)&&(f=o._activeRowIndex),(e===u||e===i)&&(e=o._activeColIndex),l=t.Direction,n===3?o._moveActiveCellLeft(f,e,r):n===4?o._moveActiveCellRight(f,e,r):n===1?o._moveActiveCellUp(f,e,r):n===2&&o._moveActiveCellDown(f,e,r),o.moveActiveCellEnd(n,h,c))},l.prototype._moveActiveCellInSelection=function(n){var i=this,r={sheet:i,sheetName:i._name,row:i._activeRowIndex,col:i._activeColIndex,cancel:!1},u,f;(i._trigger(t.Events.LeaveCell,r),r&&r.cancel===!0)||(i.endEdit(),i._activeRowDirty&&(i.updateRecord(),i._activeRowDirty=!1),u=i._activeRowIndex,f=i._activeColIndex,n===3?i._moveActiveCellLeftInSelection(i._activeRowIndex,i._activeColIndex):n===4&&i._moveActiveCellRightInSelection(i._activeRowIndex,i._activeColIndex),i.moveActiveCellEnd(n,u,f))},l.prototype.doDataItemChanged=function(){var n=this._bindingManager;n&&n.doDataItemChanged()},l.prototype.moveActiveCellEnd=function(n,i,r){var u=this,p=u._eventHandler,it=u._selectionModel.toArray(),rt=!1,w,k,d,et,s,g,nt,y,ht,l,tt;u.shift||u._isNavigateInSelection||(w=u._fixRange(u._getActiveSelectedRange()),(u._selectionModel.length>1||w.rowCount>1||w.colCount>1)&&(rt=!0),u._clearSelectionImp());var o=u._activeRowIndex,h=u._activeColIndex,b=u._spanModel.find(o,h);if(b?(u._activeRowCount=b.rowCount,u._activeColCount=b.colCount):(u._activeRowCount=1,u._activeColCount=1),!u._isNavigateInSelection){var f=u._getExtendedRange(o,h),ut=u.selectionPolicy(),ft=u.selectionUnit();ut===0?u._selectionModel.clear():ut===1&&u._selectionModel.clear();ft===1?(f.col=-1,f.colCount=-1):ft===2&&(f.row=-1,f.rowCount=-1);u._replaceActiveSelectedRange(f.row,f.col,f.rowCount,f.colCount,!1);k=u._selectionModel.toArray();p._notEqualSelecions(it,k)&&(d=t.Events,u._trigger(d.SelectionChanging,{sheet:u,sheetName:u._name,oldSelections:it,newSelections:k}),u._trigger(d.SelectionChanged,{sheet:u,sheetName:u._name}))}if(et=u._scrollTopRow,u._scrollByMoveCell(o,h),i!=o&&u.doDataItemChanged(),s=u._render,rt){var c=u._getSheetLayout(),a=c.headerX,v=c.headerY,ot=c.width-a,st=c.height-v;s.copyDoubleBuffer(a,v,ot,st);s.repaint(new t.Rect(a,v,ot,c.colHeaderHeight));s.repaint(new t.Rect(a,v,c.rowHeaderWidth,st));s.paintAdornment(s._getCtx())}else y=u._spanModel.find(i,r),y?(g=y.rowCount,nt=y.colCount):(g=1,nt=1),s.repaintSelection(new t.Range(o,h,u._activeRowCount,u._activeColCount).union(new t.Range(i,r,g,nt)));if(ht=et!==u._scrollTopRow,ht&&(l=u._getViewportRowLayout(1),tt=l&&l.length,tt>0)){var ct=l[0].row,at=l[tt-1].row,lt=e(0,ct-60);lt<u.getRowCount()&&p._loadData(lt,2*at-ct)}u._trigger(t.Events.EnterCell,{sheet:u,sheetName:u._name,row:o,col:h});p._updateValidationUI(o,h)},l.prototype._scrollByMoveCell=function(n,t){var i=this,a=i.frozenColCount?i._getNextVisualColumn(i.frozenColCount-1):i._getFirstVisualColumn(),v=i.frozenRowCount?i._getNextVisualRow(i.frozenRowCount-1):i._getFirstVisualRow(),s,c,l;if(t<i._scrollLeftCol&&t>=a&&i._setLeftColumn(i._getPrevVisualColumn(t+1)),t>i._getLastFullyVisibleColumn()&&t<=i._getLastVisualColumn()){var o=0,r=t,y=i._getSheetLayout(),f=i._spanModel.find(n,r);for(f&&(r=f.col+f.colCount-1);r>i._scrollLeftCol;){if(o+=i._getZoomColumnWidth(r),o>y.viewportWidth)break;r--}s=i._getNextVisualColumn(r);i._setLeftColumn(s)}if(n<i._scrollTopRow&&n>=v&&i._setTopRow(i._getPrevVisualRow(n+1)),n>i._getLastFullyVisibleRow()&&n<=i._getLastVisualRow()){var h=0,u=n,e=i._spanModel.find(u,t);for(e&&(u=e.row+e.rowCount-1),c=i._getSheetLayout();u>i._scrollTopRow;){if(h+=i._getZoomRowHeight(u),h>c.viewportHeight)break;u--}l=i._getNextVisualRow(u);i._setTopRow(l)}n===i._getLastVisualRow()&&i._setTopRow(i._getLastPageTopRow());t===i._getLastVisualColumn()&&i._setLeftColumn(i._getLastPageLeftColumn())},l.prototype.commitArrayFormula=function(){this._endEditImp(!1,1)},l.prototype._endEditImp=function(n,r){var u=this,v=u._eventHandler,l,s,p,w,b,a,k,d,h,g;if(!u.isEditing())return!0;var f=u._editor,c,e=u.getCellType(u._activeRowIndex,u._activeColIndex),o={sheet:u,row:u._activeRowIndex,col:u._activeColIndex,sheetArea:3};if(!e.isImeAware(o)&&v&&v.changeFocusHolder(),f&&f.parentNode){if(l=e.getEditorValue(f,o),s={sheet:u,sheetName:u._name,row:u._activeRowIndex,col:u._activeColIndex,editingText:l,cancel:!1},u._trigger(t.Events.EditEnd,s),s&&s.cancel===!0)return;if(s.editor=f,u._trigger(t.Events.EditEnding,s),s&&s.cancel===!0)return;if(u._detachFormulaTextBox(),p=this.parent&&this.parent._attachedFormulaTextBox,y.activeElement===(p&&p._host)&&v.changeFocusHolder(),u._activeRowIndex>=0&&u._activeColIndex>=0&&(w=f._oldValue,e.isEditingValueChanged(w,l,o)||r===1)){if(n)e.setEditorValue(f,w,o);else if(b=e.hasOwnProperty("_autoFormatValue")?e._autoFormatValue:!0,a={row:u._activeRowIndex,col:u._activeColIndex,newValue:l,autoFormat:b},r===1&&(k=[u._getActiveSelectedRange()],a.ranges=k,a.endEditType=r),c=new t.UndoRedo.CellEditUndoAction(u,a),u._doCommand(c),d=c.applyResult===2,d===!0)return e.focus(f,o),u._attachFormlulaTextBox(e.getEditingElement()),!1;try{e.selectAll(f,o)}catch(nt){}}if(u._dirty=!0,e.deactivateEditor(f,o),e.isImeAware(o))$(f).css("width","0"),$(f).css("height","0"),$(f).css("overflow","hidden");else for(h=f;h;)h.parentNode===y.body?y.body.removeChild(h):h=h.parentNode}return(u._editingTimeValue=!1,u._trigger(t.Events.EditEnded,{sheet:u,sheetName:u._name,row:u._activeRowIndex,col:u._activeColIndex,editingText:l}),u._editorStatus!==0&&(g=u._editorStatus,u._editorStatus=0,u._trigger(t.Events.EditorStatusChanged,{sheet:u,sheetName:u._name,oldStatus:g,newStatus:0})),u._editor=i,c&&c.applyResult===1)?!1:!0},l.prototype.endEdit=function(n){return this._endEditImp(n)},l.prototype.hitTest=function(n,t,r){var e=this,f,l,o,s,h,c,a,v,y,p,w,b;return e._getSheetLayout(),f={x:n,y:t,rowViewportIndex:i,colViewportIndex:i,row:-1,col:-1,resizeInfo:i,hitTestType:i,groupHitInfo:i,filterButtonHitInfo:i,dragInfo:i,cellTypeHitInfo:i,floatingObjectHitInfo:i,formulaRangeHitInfo:i,commentHitInfo:i},l=e._render.groupHitTest(n,t),l?f.groupHitInfo=l:(o=e._getRowViewportIndexFromY(t),s=e._getColumnViewportIndexFromX(n),f.rowViewportIndex=o,f.colViewportIndex=s,f.row=e._getRowIndexFromY(t,o),f.col=e._getColumnIndexFromX(n,s),o>=0&&o<=2&&s>=0&&(h=e._getCellLayoutByCell(o,s,u,f.row,f.col),h&&r!==!0&&(f.row=h.row,f.col=h.col)),f.hitTestType=e._getSheetArea(o,s),c=e._eventHandler,(a=c.getResizingRowCol(f,n,t,5))?f.resizeInfo=a:(w=c.getFormulaRangeHitInfo(f,n,t))?f.formulaRangeHitInfo=w:(b=this._getCommentHitInfo(n,t))?f.commentHitInfo=b:(v=this._getFloatingObjectHitInfo(n,t))?f.floatingObjectHitInfo=v:(y=c.getDragInfo(f,n,t))?f.dragInfo=y:(p=e._getFilterButtonHitInfo(f,n,t))?f.filterButtonHitInfo=p:f.cellTypeHitInfo=e._getCellTypeHitInfo(f,n,t)),f},l.prototype.getCellRect=function(n,u,f,e){var s=3,o,h;if(f===-1?s=1:e===-1&&(s=2),o=this,h=o._getSheetLayout(),f===-1&&e===-1)return new t.Rect(h.headerX,h.headerY,h.rowHeaderWidth,h.colHeaderHeight);var l=o._bounds,y=o.getRowCount(),p=o.getColumnCount();(typeof f===r||f===i)&&(n<o.frozenRowCount?f=0:n<y-o._frozenTrailingRowCount?f=1:n<y&&(f=2));(typeof e===r||e===i)&&(u<o.frozenColCount?e=0:u<p-o._frozenTrailingColCount?e=1:u<p&&(e=2));var a=o._getRowLayout(f,s).findRow(n),v=o._getColumnLayout(e,s).findCol(u),c=o._getCellLayout(f,e,s).findCell(n,u);return c?new t.Rect(c.x-l.x,c.y-l.y,c.width,c.height):a&&v?new t.Rect(v.x-l.x,a.y-l.y,v.width,a.height):new t.Rect},l.prototype._setActiveCellCore=function(n,t,r){var f=this,o=f._eventHandler,e=!1;n!==i&&n!==u&&(f._activeRowIndex=n,e=!0);t!==i&&t!==u&&(f._activeColIndex=t,e=!0);!r&&o&&e&&o.changeFocusHolder()},l.prototype._setActiveCellImp=function(n,i,r,u,f){var e=this,o;e._activeRowIndex!==n&&e._activeRowDirty&&(e.updateRecord(),e._activeRowDirty=!1);o=e._spanModel.find(n,i);o?(e._activeRowCount=o.rowCount,e._activeColCount=o.colCount):(e._activeRowCount=1,e._activeColCount=1);e._paintSuspended||e._render.repaintSelection(new t.Range(e._activeRowIndex,e._activeColIndex,1,1));e.activeRowViewportIndex=r;e.activeColViewportIndex=u;e._setActiveCellCore(n,i,f);e._leadingCellRow=n;e._leadingCellCol=i},l.prototype.setActiveCell=function(n,t,i,r){this._setActiveCellAndSelection(n,t,i,r)},l.prototype._setActiveCellAndSelection=function(n,t,i,r,u){var f=this;f._bindToAutoRefresh(function(n,t,i,r,u){var o=f.getRowCount(),s=f.getColumnCount(),e;n<0?n=0:n>=o&&(n=o-1);t<0?t=0:t>=s&&(t=s-1);f._clearSelectionImp();f._setActiveCellImp(n,t,i,r,u);e=f._spanModel.find(n,t);e?f._setSelectedRange(e.row,e.col,e.rowCount,e.colCount):f._setSelectedRange(n,t,1,1)})(n,t,i,r,u)},l.prototype.getActiveRowIndex=function(){return this._activeRowIndex},l.prototype.getActiveColumnIndex=function(){return this._activeColIndex},l.prototype.selectionPolicy=function(n){return arguments.length===0?this._selectionModel.selectionPolicy:(this._selectionModel.selectionPolicy=n,this)},l.prototype.selectionUnit=function(n){return arguments.length===0?this._selectionModel.selectionUnit:(this._selectionModel.selectionUnit=n,this)},l.prototype.getRowResizable=function(n,t){(typeof t===r||t===i)&&(t=3);var f=!0,e=this._getRowInfos(t),u=e&&e[n];return u&&typeof u.resizable!==r&&u.resizable!==i&&(f=u.resizable),f},l.prototype.setRowResizable=function(n,u,f){(typeof f===r||f===i)&&(f=3);var e=this,o=e._getRowInfos(f);o[n]||(o[n]={});o[n].resizable=u;o[n].dirty=!0;e._trigger(t.Events.RowChanged,{sheet:e,sheetName:e._name,row:n,sheetArea:f,propertyName:"resizable"})},l.prototype.getColumnResizable=function(n,t){(typeof t===r||t===i)&&(t=3);var f=!0,e=this._getColumnInfos(t),u=e&&e[n];return u&&typeof u.resizable!==r&&u.resizable!==i&&(f=u.resizable),f},l.prototype.setColumnResizable=function(n,u,f){(typeof f===r||f===i)&&(f=3);var e=this,o=e._getColumnInfos(f);o[n]||(o[n]={});o[n].resizable=u;o[n].dirty=!0;e._trigger(t.Events.ColumnChanged,{sheet:e,sheetName:e._name,col:n,sheetArea:f,propertyName:"resizable"})},l.prototype.getRowHeight=function(n,t){var u=this,y,k,f,p,e,d,w,s,h,c,l,b,a,g,v;if((typeof t===r||t===i)&&(t=3),t===3||t===2){if((y=u._getModel(t),k=y&&y.rowCount||0,n<0||n>=k)||(f=u._rowFilter,f&&f.isHideRowFilter()&&f.isFiltered()&&f.isRowFilteredOut(n)))return 0;if(p=u._tableManager,e=p&&p.getTables(),e&&e.length>0)for(d=e.length,h=0;h<d;h++)if((w=e[h],w)&&(s=w.rowFilter(),s&&s.isHideRowFilter()&&s.isFiltered()&&s.isRowFilteredOut(n)))return 0;if(c=u.rowRangeGroup,c&&!c._isEmpty()&&c.isCollapsed(n))return 0}if(l=u.defaults.rowHeight,t===1&&(l=u.defaults.colHeaderRowHeight),b=u._getRowInfos(t),a=b&&b[n],a){if(g=a.visible,g===!1)return 0;v=a.size;isNaN(v)||v===i||(l=o(v))}return l},l.prototype._getActualRowHeight=function(n,t){var u,e,s,f;return(typeof t===r||t===i)&&(t=3),u=this.defaults.rowHeight,t===1&&(u=this.defaults.colHeaderRowHeight),e=this._getRowInfos(t),s=e&&e[n],s&&(f=s.size,isNaN(f)||f===i||(u=o(f))),u},l.prototype.setRowHeight=function(n,u,f){(typeof f===r||f===i)&&(f=3);var e=this,s=e._getRowInfos(f),o=s[n];(o||(s[n]=o={}),o.size!==u)&&(o.size=u,o.dirty=!0,e._trigger(t.Events.RowChanged,{sheet:e,sheetName:e._name,row:n,sheetArea:f,propertyName:ti}),e.invalidate())},l.prototype.getRowVisible=function(n,t){var u=this,f;if(((typeof t===r||t===i)&&(t=3),u.isRowFilterOut(n,t))||(t===3||t===2)&&(f=u.rowRangeGroup,f&&!f._isEmpty()&&0<=n&&n<u.getRowCount(t)&&f.isCollapsed(n)))return!1;var o=!0,s=u._getRowInfos(t),e=s&&s[n];return e&&typeof e.visible!==r&&e.visible!==i&&(o=e.visible),o},l.prototype.isRowFilterOut=function(n,t){var c=this,u,s,f,l,h,e,o;if((typeof t===r||t===i)&&(t=3),t===3||t===2){if(u=c._rowFilter,u&&u.isHideRowFilter()&&u.isFiltered()&&u.isRowFilteredOut(n))return!0;if(s=c._tableManager,f=s&&s.getTables(),f&&f.length>0)for(l=f.length,o=0;o<l;o++)if((h=f[o],h)&&(e=h.rowFilter(),e&&e.isHideRowFilter()&&e.isFiltered()&&e.isRowFilteredOut(n)))return!0}return!1},l.prototype.setRowVisible=function(n,u,f){var e=this;e._bindToAutoRefresh(function(n,u,f){(typeof f===r||f===i)&&(f=3);var s=e._getRowInfos(f),o=s[n];(o||(s[n]=o={}),o.visible!==u)&&(o.visible=u,o.dirty=!0,e._trigger(t.Events.RowChanged,{sheet:e,sheetName:e._name,row:n,sheetArea:f,propertyName:"isVisible"}))})(n,u,f)},l.prototype.getColumnWidth=function(n,t){var u=this,f,c,a,e,l,s,v,h;if((typeof t===r||t===i)&&(t=3),f=u.defaults.colWidth,t===2&&(f=u.defaults.rowHeaderColWidth),(t===3||t===1)&&((c=u._getModel(t),a=c&&c.colCount||0,n<0||n>=a)||(e=u.colRangeGroup,e&&!e._isEmpty()&&e.isCollapsed(n))))return 0;if(l=u._getColumnInfos(t),s=l&&l[n],s){if(v=s.visible,v===!1)return 0;h=s.size;isNaN(h)||h===i||(f=o(h))}return f},l.prototype._getActualColumnWidth=function(n,t){var u,e,s,f;return(typeof t===r||t===i)&&(t=3),u=this.defaults.colWidth,t===2&&(u=this.defaults.rowHeaderColWidth),e=this._getColumnInfos(t),s=e&&e[n],s&&(f=s.size,isNaN(f)||f===i||(u=o(f))),u},l.prototype.setColumnWidth=function(n,u,f){(typeof f===r||f===i)&&(f=3);var e=this,s=e._getColumnInfos(f),o=s[n];o||(s[n]=o={});o.size=u;o.dirty=!0;e._trigger(t.Events.ColumnChanged,{sheet:e,sheetName:e._name,col:n,sheetArea:f,propertyName:ni});e.invalidate()},l.prototype.getColumnVisible=function(n,t){var u;if((typeof t===r||t===i)&&(t=3),(t===3||t===1)&&(u=this.colRangeGroup,u&&!u._isEmpty()&&0<=n&&n<this.getColumnCount(t)&&u.isCollapsed(n)))return!1;var e=!0,o=this._getColumnInfos(t),f=o&&o[n];return f&&typeof f.visible!==r&&f.visible!==i&&(e=f.visible),e},l.prototype.setColumnVisible=function(n,r,f){var e=this;e._bindToAutoRefresh(function(n,r,f){(f===u||f===i)&&(f=3);var s=e._getColumnInfos(f),o=s[n];(o||(s[n]=o={}),o.visible!==r)&&(o.visible=r,o.dirty=!0,e._trigger(t.Events.ColumnChanged,{sheet:e,sheetName:e._name,col:n,sheetArea:f,propertyName:"isVisible"}))})(n,r,f)},l.prototype.zoom=function(n){if(n=parseFloat(n),!isNaN(n)&&isFinite(n)){n>4?n=4:n<.25&&(n=.25);var t=this;t._bindToAutoRefresh(function(n){t.showEditingLocator&&t._showEditingLocator();t._zoomFactor=n})(n)}},l.prototype.invalidateLayout=function(){var n=this,r=n._eventHandler;n._layoutModel=i;n._cachedGroupLayout=i;n._rowLayoutCache={colHeader:i,viewport:i,colFooter:i};n._colLayoutCache={rowHeader:i,viewport:i};n._filterButtonsModel=i;n._cachePool.clearAll();t.StyleHelper.scaleFontInfoCache=i;r&&window.gcGlobal.activeElement===n&&r._updateValidationUI(n._activeRowIndex,n._activeColIndex);n._needSyncScrollbarSize&&(n._syncScrollbarSize(),n._needSyncScrollbarSize=!1);n._dirty=!0},l.prototype.invalidate=function(){var n=this;!n._paintSuspended&&n._layoutSuspended<=0&&(n.invalidateLayout(),n.repaint())},l.prototype.getViewportHeight=function(n){var t=this._getSheetLayout();return n===0?t.frozenHeight:n===1?t.viewportHeight:n===2?t.frozenTrailingHeight:0},l.prototype.getViewportWidth=function(n){var t=this._getSheetLayout();return n===0?t.frozenWidth:n===1?t.viewportWidth:n===2?t.frozenTrailingWidth:0},l.prototype.getViewportTopRow=function(n){var t=this;return n===0?0:n===1?e(t.frozenRowCount,t._scrollTopRow):n===2?e(t.frozenRowCount,t.getRowCount()-t._frozenTrailingRowCount):-1},l.prototype.getViewportBottomRow=function(n){var t=this,i;if(n===2)return t.getRowCount()-1;var u=t.getViewportTopRow(n),s=t.getViewportHeight(n),e=0,o=0,r=t.getRowCount()-t._frozenTrailingRowCount;for(n===0&&(r=f(t.frozenRowCount,r)),i=u;i<r&&e<s;i++,o++)e+=t._getZoomRowHeight(i);return u+o-1},l.prototype.getViewportLeftColumn=function(n){var t=this;return n===0?0:n===1?e(t.frozenColCount,t._scrollLeftCol):n===2?e(t.frozenColCount,t.getColumnCount()-t._frozenTrailingColCount):-1},l.prototype.getViewportRightColumn=function(n){var t=this,i;if(n===2)return t.getColumnCount()-1;var u=t.getViewportLeftColumn(n),s=t.getViewportWidth(n),e=0,o=0,r=t.getColumnCount()-t._frozenTrailingColCount;for(n===0&&(r=f(t.frozenColCount,r)),i=u;i<r&&o<s;i++,e++)o+=t._getZoomColumnWidth(i);return u+e-1},l.prototype.clearSelection=function(){this._bindToAutoRefresh(function(){this._clearSelectionImp();this._setActiveCellImp(0,0)})()},l.prototype._clearSelectionImp=function(){this._selectionModel.clear()},l.prototype._validationError=function(n,i,r){var u=this,e=u.getDataValidator(n,i),f={sheet:u,sheetName:u._name,row:n,col:i,validator:e,validationResult:0};return u._trigger(t.Events.ValidationError,f),f.validationResult},l.prototype.getSpans=function(n,t){var r,e,f,o;if((t===u||t===i)&&(t=3),r=this._getSpanModel(t),!n)return r.slice(0);for(e=[],f=0;f<r.length;f++)o=r[f],(!n||o.intersect(n.row,n.col,n.rowCount,n.colCount))&&e.push(o);return e},l.prototype.getSpan=function(n,t,r){(r===u||r===i)&&(r=3);var f=this._getSpanModel(r);return f.find(n,t)},l.prototype.getCell=function(n,i,r){return new t.Cell(this,n,i,r)},l.prototype.getCells=function(n,t,i,r,u){var f=this.getCell(n,t,u);return f.row2=i,f.col2=r,f},l.prototype.getRow=function(n,i){return new t.Row(this,n,i)},l.prototype.getRows=function(n,t,i){var r=this.getRow(n,i);return r.index2=t,r},l.prototype.getColumn=function(n,i){return new t.Column(this,n,i)},l.prototype.getColumns=function(n,t,i){var r=this.getColumn(n,i);return r.index2=t,r},l.prototype.setBorder=function(n,t,r,f){var s,y;(f===u||f===i)&&(f=3);s=this;y=s.isPaintSuspended();s.isPaintSuspended(!0);try{var v=s._getActualRange(n,f),h=v.row,c=v.col,l=v.rowCount,a=v.colCount,e,o;if(r.left||r.all||r.outline)for(e=0;e<l;e++)s.getCell(h+e,c,f).borderLeft(t);if(r.top||r.all||r.outline)for(o=0;o<a;o++)s.getCell(h,c+o,f).borderTop(t);if(r.right||r.all||r.outline)for(e=0;e<l;e++)s.getCell(h+e,c+a-1,f).borderRight(t);if(r.bottom||r.all||r.outline)for(o=0;o<a;o++)s.getCell(h+l-1,c+o,f).borderBottom(t);if(r.innerHorizontal||r.all||r.inside)for(e=0;e<l-1;e++)for(o=0;o<a;o++)s.getCell(h+e,c+o,f).borderBottom(t),s.getCell(h+e+1,c+o,f).borderTop(t);if(r.innerVertical||r.all||r.inside)for(o=0;o<a-1;o++)for(e=0;e<l;e++)s.getCell(h+e,c+o,f).borderRight(t),s.getCell(h+e,c+o+1,f).borderLeft(t)}finally{s.isPaintSuspended(y)}},l.prototype.search=function(n){var r,f,o,u;if(!n||!t.features.search)return i;var e=this,a=n.sheetArea,s=n.searchString,h=n.searchTarget,c=n.searchFlags,v=e.getRowCount(a),y=e.getColumnCount(a);if(!s||h===0||v<=0&&y<=0)return new t.SearchResult;for(n.rowStart===-1&&(n.rowStart=0),n.columnStart===-1&&(n.columnStart=0),n.findBeginRow===-1&&(n.findBeginRow=n.rowStart),n.findBeginColumn===-1&&(n.findBeginColumn=n.columnStart),n.rowEnd===-1&&(n.rowEnd=v-1),n.columnEnd===-1&&(n.columnEnd=y-1),r=new t.SearchResult,f=new t.CellsEnumerator(e,n),(c&8)>0&&(f.isBlockRange=!0);f.moveNext();){var w=f.currentRow,b=f.currentColumn,l=f.current();if(l&&((h&1)>0&&(o=l.text(),e._trySearch(o,s,c)&&o!==""&&(r.searchFoundFlag|=1,r.foundString=o)),(h&8)>0&&(u=l.formula(),u=typeof u===p?u.toString():i,e._trySearch(u,s,c)&&u!==""&&(r.searchFoundFlag|=8,r.foundString=u)),r.searchFoundFlag!==0))return r.foundRowIndex=w,r.foundColumnIndex=b,r}return new t.SearchResult},l.prototype.showCell=function(n,t,i,r){var u=this,y=u.getRowCount(),p=u.getColumnCount(),f=u._zoomFactor,e,s,v;if(!(n<0)&&!(n>=y)&&!(t<0)&&!(t>=p)){var k=isNaN(u.frozenRowCount)?0:u.frozenRowCount,d=isNaN(u.frozenColCount)?0:u.frozenColCount,w=isNaN(u._frozenTrailingRowCount)?0:u._frozenTrailingRowCount,b=isNaN(u._frozenTrailingColCount)?0:u._frozenTrailingColCount,l=u._scrollTopRow,a=u._scrollLeftCol,h=1,c=1;if(n<k?(l=0,c=0):n>=y-w&&(l=y-w,c=2),t<d?(a=0,h=0):t>=p-b&&(a=p-b,h=2),h===1&&r!==0)if(r===1){for(e=o((u.getViewportWidth(h)-o(u.getColumnWidth(t)*f))/2);0<t;t--)if(e-=o(u.getColumnWidth(t-1)*f),e<0)break}else if(r===2){for(e=u.getViewportWidth(h)-o(u.getColumnWidth(t)*f);0<t;t--)if(e-=o(u.getColumnWidth(t-1)*f),e<0)break}else if(r===3&&t>=a)for(e=u.getViewportWidth(h)-o(u.getColumnWidth(t)*f);a<t;t--)if(e-=o(u.getColumnWidth(t-1)*f),e<0)break;if(c===1&&i!==0)if(i===1){for(s=o((u.getViewportHeight(c)-o(u.getRowHeight(n)*f))/2);0<n;n--)if(s-=o(u.getRowHeight(n-1)*f),s<0)break}else if(i===2){for(s=u.getViewportHeight(c)-o(u.getRowHeight(n)*f);0<n;n--)if(s-=o(u.getRowHeight(n-1)*f),s<0)break}else if(i===3&&!(n<l||l===-1))for(s=u.getViewportHeight(c)-o(u.getRowHeight(n)*f);l<n;n--)if(s-=o(u.getRowHeight(n-1)*f),s<0)break;v=!1;c===1&&n!==l&&(u._scrollTopRow=n,u._syncVScrollbarPosition(),v=!0);h===1&&t!==a&&(u._scrollLeftCol=t,u._syncHScollbarPosition(),v=!0);v&&(u.invalidateLayout(),u.repaint())}},l.prototype.showColumn=function(n,t){this.showCell(this._scrollTopRow,n,0,t)},l.prototype.showRow=function(n,t){this.showCell(n,this._scrollLeftCol,t,0)},l.prototype.bind=function(n,t,i){this._eventHandler.bind(n+v,t,i)},l.prototype.unbind=function(n,t){this._eventHandler.unbind(n+v,t)},l.prototype.unbindAll=function(){this._eventHandler.unbind(v)},l.prototype._bind=function(n,t,i){n.indexOf(".")>=0?this._eventHandler.bind(n,t,i):this._eventHandler.bind(n+k,t,i)},l.prototype._unbind=function(n,t){n.indexOf(".")>=0?this._eventHandler.unbind(n,t):this._eventHandler.unbind(n+k,t)},l.prototype._unbindAll=function(){this._eventHandler.unbind(k)},l.prototype.suspendEvent=function(){this._eventHandler._eventSuspended++},l.prototype.resumeEvent=function(){var n=this._eventHandler;n._eventSuspended--;n._eventSuspended<0&&(n._eventSuspended=0)},l.prototype.currentTheme=function(n){var i=this;return arguments.length===0?(i._currentTheme||(i._currentTheme=t.SpreadThemes.Office),i._currentTheme):(typeof n===p&&(n=t.SpreadThemes.hasOwnProperty(n)?t.SpreadThemes[n]:new t.SpreadTheme(n)),i._bindToAutoRefresh(function(n){i._currentTheme=n})(n),i)},l.prototype.reset=function(){var n=this,r;n.defaults={rowHeight:n._defaultRowHeight,colWidth:n._defaultColWidth,rowHeaderColWidth:n._defaultRowHeaderColWidth,colHeaderRowHeight:n._defaultColHeaderRowHeight};n.gridline={color:n._defaultGridLineColor,showVerticalGridline:n._defaultShowVerticalGridline,showHorizontalGridline:n._defaultShowHorizontalGridline};n._rowLayoutCache={colHeader:i,viewport:i,colFooter:i};n._colLayoutCache={rowHeader:i,viewport:i};n._dragRect={};n._render=new t._SheetRender(n);r=i;n._eventHandler&&(r=n._eventHandler._elem);n._eventHandler=new t._SheetEventHandler(n);n._eventHandler._elem=r;n._composedDefaultStyle={};n._dataModel=new t._GcSheetModel;n._dataModel.name=n._name;t.util.hasCalc()&&(n._calcDataModel=new t._CalcModel(n._dataModel.rowCount,n._dataModel.colCount,n._name+"_calc"));n._rowHeaderModel=new t._GcSheetModel(n._dataModel.rowCount,1);n._colHeaderModel=new t._GcSheetModel(1,n._dataModel.colCount);n._colFooterModel=new t._GcSheetModel(1,n._dataModel.colCount,n._name+"cf");n._spanModel=new t._SpanModel;n._colHeaderSpanModel=new t._SpanModel;n._rowHeaderSpanModel=new t._SpanModel;n._selectionModel=new t._SelectionModel;n._selectionBackColor="rgba(180,180,200,0.2)";n._selectionBorderColor="black";n._currentTheme=t.SpreadThemes.Office;n._allowDragDrop=!0;n._allowDragFill=!0;t.util.hasCalc()&&(n._vpSheetSource=new t.Calc._SheetSource(n,3));t.features.group&&(n.rowRangeGroup=new t.RangeGroup(n.getRowCount()),n.colRangeGroup=new t.RangeGroup(n.getColumnCount()));n._showRowRangeGroup=!0;n._showColumnRangeGroup=!0;n._rowInfos=i;n._colInfos=i;n.dataContext=i;n.autoGenerateColumns=!0;n.autoUpdate=!0;n._rowFilter=i;n._initDefaultKeyMap();t.features.floatingObject&&n._initDefaultFloatingObjectKeyMap();t.features.comment&&n._initDefaultCommentKeyMap();n._scrollTopRow=0;n._scrollLeftCol=0;n.frozenRowCount=0;n.frozenColCount=0;n._frozenTrailingRowCount=0;n._frozenTrailingColCount=0;t.features.binding&&(n._bindingManager=new t._BindingManager(n));t.features.sparkline&&(n._sparklineGroupManager=new t.WorksheetSparklineGroupManager(n,n));t.features.table&&(n._tableManager=new t._SheetTableManager(n));t.features.floatingObject&&(n._floatingObjectArray=new t._FloationgObjectArray(n));n._namedStyles={};n._needSyncScrollbarSize=!0;n._cutCopyIndicatorManager=new t.CutCopyIndicatorManager(n);n.invalidateLayout();n._dirty=!0;n._clipBoardOptions=0;n._containerDiv=i;t.features.comment&&(n._commentManager=new t.CommentManager(n))},l.prototype.undoManager=function(){var n=this,i=n.parent;return n._undoManager||(n._undoManager=i&&i._undoManager?i._undoManager:new t._UndoManager(n,-1,n.allowUndo())),n._undoManager},l.prototype.clipBoardOptions=function(n){return arguments.length===0?this._clipBoardOptions:(this._clipBoardOptions=n,this)},l.prototype.doCommand=function(n){this._doCommand(n)},l.prototype.copyTo=function(n,t,i,r,u,f,e){this.copyToCore(n,t,i,r,u,f,e)},l.prototype.copyToCore=function(n,t,i,r,u,f,e,o){var h=this,c=h.isPaintSuspended();h.isPaintSuspended(!0);h.suspendEvent();s.copyTo(h,n,t,h,i,r,u,f,e,o);h.resumeEvent();h.isPaintSuspended(c)},l.prototype.moveTo=function(n,t,i,r,u,f,e){var o=this,h=o.isPaintSuspended();o.isPaintSuspended(!0);o.suspendEvent();s.moveTo(o,n,t,o,i,r,u,f,e);o.resumeEvent();o.isPaintSuspended(h)},l.prototype.setCsv=function(n,t,i,r,u,f){var e=this,o=e.isPaintSuspended();e.isPaintSuspended(!0);e.suspendEvent();s.setRangeText(e,n,t,i,r,u,'"',f);e.resumeEvent();e.isPaintSuspended(o)},l.prototype.getCsv=function(n,t,i,r,u,f){return s.getRangeText(this,n,i,t,r,u,f,'"',!0,0)},l.prototype.canUserDragDrop=function(n){var i=this,t=i.parent;return arguments.length===0?(t&&t.canUserDragDrop&&(i._allowDragDrop=t.canUserDragDrop()),i._allowDragDrop):(t&&t.canUserDragDrop?t.canUserDragDrop(n):i._allowDragDrop=n,i)},l.prototype.canUserDragFill=function(n){var i=this,r=i.parent,u;return arguments.length===0?t.features.fill?(r&&r.canUserDragFill&&(i._allowDragFill=r.canUserDragFill()),i._allowDragFill):!1:(u=i.canUserDragFill(),u!==n&&(r&&r.canUserDragFill?r.canUserDragFill(n):i._allowDragFill=n,i.getSelections().length!==1||i._paintSuspended||i._render.repaintSelection(i.getSelections().toArray()[0])),i)},l.prototype.isColumnBound=function(n){var t=this,r,i;return n<0||n>=t.getColumnCount()?!1:(r=t.getDataSource(),r&&t._colInfos)?(i=t._colInfos[n],!!(i&&i.name)):!1},l.prototype.getDataColumnName=function(n){var t=this,u,r;return n<0||n>=t.getColumnCount()?i:(u=t.getDataSource(),u&&t._colInfos)?(r=t._colInfos[n],r.displayName||r.name):i},l.prototype.getSparkline=function(n,t){if(!this._sparklineGroupManager)return i;var r=3,u=this._getModel(r);return u.getSparkline(n,t)},l.prototype.setSparkline=function(n,r,f,e,o,s,h,c){var l=this,a=l._sparklineGroupManager;return a?l._bindToAutoRefresh(function(n,r,f,e,o,s,h,c){var p=f,v=new t.Sparkline(n,r,p,e,o,s),y;return h&&c!==u&&c!==i&&(v.dateAxisData(h),v.dateAxisOrientation(c),v.group().displayDateAxis=!0),l.removeSparkline(n,r),y=l._getModel(),y.setSparkline(n,r,v),a.add(v.group()),l._raiseCellChanged("sparkline",n,r,3),v})(n,r,f,e,o,s,h,c):i},l.prototype.removeSparkline=function(n,t){var r=this,u=r._sparklineGroupManager;u&&r._bindToAutoRefresh(function(n,t){var s=3,o=r._getModel(s),e=o.getSparkline(n,t),f;e&&(f=e.group(),f.remove(e),f.count()<=0&&u.remove(f));o.setSparkline(n,t,i)})(n,t)},l.prototype.groupSparkline=function(n){var t=this._sparklineGroupManager;return t?this._bindToAutoRefresh(function(n){for(var r,f,u=i,e=0;e<n.length;e++)if(r=n[e],r){if(!u){u=r.group();continue}f=r.group();f.remove(r);u.add(r);f.count()<=0&&t.remove(f)}return u})(n):i},l.prototype.ungroupSparkline=function(n){var i=this,t=i._sparklineGroupManager;t&&i._bindToAutoRefresh(function(n){var i,r,u,f;if(n){for(i=[],i=i.concat(n._innerList),r=0;r<i.length;r++)u=i[r],u&&(n.remove(u),f=n.clone(),f.add(u),t.add(f));t.remove(n)}})(n)},l.prototype.fillAuto=function(n,i,r){if(t.features.fill){if(!i)throw new Error(t.SR.Exp_RangeIsNull);var u=this;u._checkFillRange(n,i,r)&&u._bindToAutoRefresh(function(n,i,r){n&&(u._eventHandler._dragFillStartRange=n);var f=new t.FillImp(u);f.fillAuto(i,r)})(n,i,r)}},l.prototype.fillAutobyDirection=function(n,r,u){if(t.features.fill){if(!r)throw new Error(t.SR.Exp_RangeIsNull);var f=this;f._checkFillRange(n,r,i,u)&&f._bindToAutoRefresh(function(n,i,r){n&&(f._eventHandler._dragFillStartRange=n);var u=new t.FillImp(f);u.fillAutobyDirection(i,r)})(n,r,u)}},l.prototype.fillLinear=function(n,i,r,u,f){if(t.features.fill){if(!i)throw new Error(t.SR.Exp_RangeIsNull);var e=this;e._checkFillRange(n,i,r)&&e._bindToAutoRefresh(function(n,i,r,u,f){n&&(e._eventHandler._dragFillStartRange=n);var o=new t.FillImp(e);o.fillLinear(i,r,u,f)})(n,i,r,u,f)}},l.prototype.fillGrowth=function(n,i,r,u,f){if(t.features.fill){if(!i)throw new Error(t.SR.Exp_RangeIsNull);var e=this;e._checkFillRange(n,i,r)&&e._bindToAutoRefresh(function(n,i,r,u,f){n&&(e._eventHandler._dragFillStartRange=n);var o=new t.FillImp(e);o.fillGrowth(i,r,u,f)})(n,i,r,u,f)}},l.prototype.fillDate=function(n,r,f,e,o,s){if(t.features.fill){if(!r)throw new Error(t.SR.Exp_RangeIsNull);var h=this;h._checkFillRange(n,r,f)&&h._bindToAutoRefresh(function(n,r,f,e,o,s){n&&(h._eventHandler._dragFillStartRange=n);var l=new t.FillImp(h),c=i;s!==u&&s!==i&&(c=new t._DateTimeHelper(s).toOADate());l.fillDate(r,f,e,o,c)})(n,r,f,e,o,s)}},l.prototype._checkFillRange=function(n,t,r,f){if(!n||!t||!t.containsRange(n))return!1;if(r!==u&&r!==i)if(r===1){if(n.row===t.row&&n.rowCount===t.rowCount)return!0}else if(r===0&&n.col===t.col&&n.colCount===t.colCount)return!0;if(f!==u&&f!==i)if(f===2||f===3){if(n.col===t.col&&n.colCount===t.colCount)return!0}else if((f===0||f===1)&&n.row===t.row&&n.rowCount===t.rowCount)return!0;return!1},l.prototype.clear=function(n,t,i,r,u,f){this.clearCore(n,t,i,r,u,f)},l.prototype._checkArrayFormula=function(n,i,r,u,f){return(f=f===undefined?!0:!1,f&&this._hasPartArrayFormulas(n,i,r,u)||!f&&this._hasArrayFormula(n,i,r,u))?(this._raiseInvalidOperation(4,t.SR.Exp_ChangePartOfArray),!1):!0},l.prototype.clearCore=function(n,t,r,f,e,o,s){var h=this;h._bindToAutoRefresh(function(n,t,r,f,e,o){var c,a,l,v,k,w,d,y,p,g,b,nt;h.suspendCalcService();try{if(k=3,e===u||e===i||e===k){if(!h._checkArrayFormula(n,t,r,f))return!1;if((o&1)==1){if(h.getDataSource()||h.dataContext){for(h.suspendEvent(),c=n;c<n+r;c++)if(!s||!h.isRowFilterOut(c))for(a=t;a<t+f;a++)h.setValue(c,a,i,e);h.resumeEvent()}h._conditionalFormats&&h._conditionalFormats._clearCache();h._rowFilter&&h._rowFilter.range&&h._rowFilter._clear(n,t,r,f)}(o&16)==16&&h._sparklineGroupManager&&h._sparklineGroupManager.clear(n,t,r,f);h._tableManager&&h._tableManager.clear(n,t,r,f,o);(o&4)==4&&h._commentManager&&h._commentManager.clear(n,t,r,f)}if(w=h._getModel(e),d=h._getCalcModel(e),w){for(c=n===-1?0:n,y=n===-1?w.rowCount:r,a=t===-1?0:t,p=t===-1?w.colCount:f,g=[],b=c;b<y;b++)s&&h.isRowFilterOut(b)&&g.push(b);if(w.clear(c,a,y,p,o,g),d&&d.clear(c,a,y,p,o),(o&2)==2&&!(n>=0&&t>=0))if(t>=0)for(v=0;v<p;v++)h.setStyle(-1,a+v,i,e);else if(n>=0)for(l=0;l<y;l++)s&&h.isRowFilterOut(c+l)||h.setStyle(c+l,-1,i,e);else h.setStyle(-1,-1,i,e);if((o&32)==32&&!(n>=0&&t>=0))if(t>=0)for(v=0;v<p;v++)h.setColumnVisible(a+v,!0,e),h.setColumnResizable(a+v,!0,e),h.setColumnWidth(a+v,e===2?h.defaults.rowHeaderColWidth:h.defaults.colWidth,e);else if(n>=0)for(l=0;l<y;l++)s&&h.isRowFilterOut(c+l)||(h.setRowVisible(c+l,!0,e),h.setRowResizable(c+l,!0,e),h.setRowHeight(c+l,e===1?h.defaults.colHeaderRowHeight:h.defaults.rowHeight,e));else{for(v=0;v<p;v++)h.setColumnVisible(a+v,!0,e),h.setColumnResizable(a+v,!0,e),h.setColumnWidth(a+v,e===2?h.defaults.rowHeaderColWidth:h.defaults.colWidth,e);for(l=0;l<y;l++)s&&h.isRowFilterOut(c+l)||(h.setRowVisible(c+l,!0,e),h.setRowResizable(c+l,!0,e),h.setRowHeight(c+l,e===1?h.defaults.colHeaderRowHeight:h.defaults.rowHeight,e))}for(l=0;l<y;l++)for(v=0;v<p;v++)c=n+l,a=t+v,(o&1)==1&&h._raiseCellChanged(st,c,a,e),(o&2)==2&&h._raiseCellChanged("style",c,a,e),(o&16)==16&&h._raiseCellChanged("sparkline",c,a,e),(o&4)==4&&h._raiseCellChanged("comment",c,a,e),(o&32)==32&&h._raiseCellChanged("axis",c,a,e),(o&64)==64&&h._raiseCellChanged("bindingPath",c,a,e)}(e===u||e===i||e===k)&&(o&1)==1&&(nt=h._getSheetSource(),nt&&nt._addCellsToDirty(n,t,r,f))}finally{h.resumeCalcService()}})(n,t,r,f,e,o)},l.prototype.getConditionalFormats=function(){var n=this;return!n._conditionalFormats&&t.features.conditionalFormat&&(n._conditionalFormats=new t.ConditionalFormats(n)),n._conditionalFormats},l.prototype.rowFilter=function(n){var t=this;return arguments.length===0?t._rowFilter:t._bindToAutoRefresh(function(n){return t._rowFilter&&t._rowFilter.reset(),t._rowFilter=n,t._rowFilter&&(t._rowFilter.sheet=t),t})(n)},l.prototype.autoFitColumn=function(n){if(!(n<0)&&!(n>=this.getColumnCount())){var i=new t.UndoRedo.ColumnAutoFitUndoAction(this,[{col:n}],!1);i.execute(this)}},l.prototype.autoFitRow=function(n){if(!(n<0)&&!(n>=this.getRowCount())){var i=new t.UndoRedo.RowAutoFitUndoAction(this,[{row:n}],!1);i.execute(this)}},l.prototype.setGridlineOptions=function(n){var t=this;t._bindToAutoRefresh(function(n){if(n){t.gridline||(t.gridline={});var r=t.gridline;n.color&&(r.color=n.color);n.showVerticalGridline!==i&&n.showVerticalGridline!==u&&(r.showVerticalGridline=n.showVerticalGridline);n.showHorizontalGridline!==i&&n.showHorizontalGridline!==u&&(r.showHorizontalGridline=n.showHorizontalGridline)}})(n)},l.prototype.getGridlineOptions=function(){var i=this,t,n;return i.gridline||(i.gridline={}),t=i.gridline,n={},n.color=t.color,n.showVerticalGridline=t.showVerticalGridline,n.showHorizontalGridline=t.showHorizontalGridline,n},l.prototype.getFrozenRowCount=function(){return this.frozenRowCount},l.prototype.getFrozenColumnCount=function(){return this.frozenColCount},l.prototype.getFrozenTrailingRowCount=function(){return this._frozenTrailingRowCount},l.prototype.getFrozenTrailingColumnCount=function(){return this._frozenTrailingColCount},l.prototype.setRowHeaderVisible=function(n){this._bindToAutoRefresh(function(t){this.rowHeaderVisible=n})(n)},l.prototype.getRowHeaderVisible=function(){return this.rowHeaderVisible},l.prototype.setColumnHeaderVisible=function(n){this._bindToAutoRefresh(function(t){this.colHeaderVisible=n})(n)},l.prototype.getColumnHeaderVisible=function(){return this.colHeaderVisible},l.prototype.setRowHeaderAutoText=function(n){this._bindToAutoRefresh(function(n){this.rowHeaderAutoText=n})(n)},l.prototype.getRowHeaderAutoText=function(){return this.rowHeaderAutoText},l.prototype.setColumnHeaderAutoText=function(n){this._bindToAutoRefresh(function(n){this.colHeaderAutoText=n})(n)},l.prototype.getColumnHeaderAutoText=function(){return this.colHeaderAutoText},l.prototype.setRowHeaderAutoTextIndex=function(n){this._bindToAutoRefresh(function(n){this.rowHeaderAutoTextIndex=n})(n)},l.prototype.getRowHeaderAutoTextIndex=function(){return this.rowHeaderAutoTextIndex},l.prototype.setColumnHeaderAutoTextIndex=function(n){this._bindToAutoRefresh(function(n){this.colHeaderAutoTextIndex=n})(n)},l.prototype.getColumnHeaderAutoTextIndex=function(){return this.colHeaderAutoTextIndex},l.prototype.setIsProtected=function(n){this._bindToAutoRefresh(function(t){this.isProtected=n})(n)},l.prototype.getIsProtected=function(){return this.isProtected},l.prototype.setArray=function(n,t,i,r){var u=this,f=u.getRowCount(),e=u.getColumnCount(),o;if(i&&0<=n&&n<f&&0<=t&&t<e){u.suspendCalcService();o=u.isPaintSuspended();u.isPaintSuspended(!0);try{$.each(i,function(i,o){if(o instanceof Array)$.each(o,function(o,s){var h=n+i,c=t+o;h<f&&c<e&&(r?u.setFormula(h,c,s,3):u.setValue(h,c,s,3,!0))});else{var s=n+i,h=t;s<f&&h<e&&(r?u.setFormula(s,h,o,3):u.setValue(s,h,o,3,!0))}})}finally{u.resumeCalcService();u.isPaintSuspended(o)}}},l.prototype.getArray=function(n,t,i,r,u){var o=this,s=[],h=o.getRowCount(),c=o.getColumnCount(),f,e;if(0<=n&&n<h&&0<=t&&t<c)for(n+i>h&&(i=h-n),t+r>c&&(r=c-t),f=0;f<i;f++)for(s[f]=[],e=0;e<r;e++)s[f][e]=u?o.getFormula(n+f,t+e):o.getValue(n+f,t+e);return s},l.prototype.showRowRangeGroup=function(n){var i=this;return arguments.length===0?t.features.group?i._showRowRangeGroup:!1:(i._showRowRangeGroup!==n&&i._bindToAutoRefresh(function(n){i._showRowRangeGroup=n})(n),i)},l.prototype.showColumnRangeGroup=function(n){var i=this;return arguments.length===0?t.features.group?i._showColumnRangeGroup:!1:(i._showColumnRangeGroup!==n&&i._bindToAutoRefresh(function(n){i._showColumnRangeGroup=n})(n),i)},l.prototype.addTable=function(n,r,f,e,o,s){var h=this,c=h._tableManager,l;if(!c)return i;h._checkCanAddTable(n,r,f,e,o,!0);s===u&&(s=t.TableStyles.medium2());l=h.isPaintSuspended();h.isPaintSuspended(!0);try{return c.add(new t.SheetTable(n,r,f,e,o,s))}finally{h.isPaintSuspended(l)}},l.prototype.addTableByDataSource=function(n,r,f,e,o){var s=this,v=s._tableManager,c,h,l,y,a;if(!v||!t.features.binding)return i;if(!e)throw new Error(t.SR.Exp_TableDataSourceNullError);s._checkCanAddTable(n,r,f,1,1,!0);c=new t._BindingManager;c.bind(e);h=c.getRowCount();l=c.getColumnCount();h=h+1;r+h>s.getRowCount()&&s.setRowCount(r+h);f+l>s.getColumnCount()&&s.setColumnCount(f+l);s._checkCanAddTable(n,r,f,h,l,!0);o===u&&(o=t.TableStyles.medium2());y=s.isPaintSuspended();s.isPaintSuspended(!0);try{return a=v.add(new t.SheetTable(n,r,f,h,l,o)),a._bind(c),a}finally{s.isPaintSuspended(y)}},l.prototype.findTable=function(n,t){var r=this._tableManager;return r?r.find(n,t):i},l.prototype.findTableByName=function(n){var t=this._tableManager;return t?t.findByName(n):i},l.prototype.removeTable=function(n){var t=this,i=t._tableManager,r;if(!n||!i)return t;r=t.isPaintSuspended();t.isPaintSuspended(!0);try{return i.remove(n),t}finally{t.isPaintSuspended(r)}},l.prototype.removeTableByName=function(n){var t=this.findTableByName(n);return t&&this.removeTable(t),this},l.prototype.moveTable=function(n,t,i){var r=this,f=r._tableManager,o;if(!f||!n||t<0||i<0)return r;var e=n.range(),s=e.rowCount,h=e.colCount,u=f.findByRange(t,i,s,h);if(u)if(u.length>1)return r;else if(u.length===1&&u[0]!==n)return r;o=r.isPaintSuspended();r.isPaintSuspended(!0);try{return n._moveTo(t,i),r}finally{r.isPaintSuspended(o)}},l.prototype.moveTableByName=function(n,t,i){var r=this.findTableByName(n);return r&&this.moveTable(r,t,i),this},l.prototype.resizeTable=function(n,t,i){var r=this,u=r._tableManager,o;if(!u||!n||t<0||i<0)return r;var f=n.range(),s=f.row,h=f.col,e=u.findByRange(s,h,t,i);if(e&&e.length>1)return r;o=r.isPaintSuspended();r.isPaintSuspended(!0);try{return n._resize(t,i),r}finally{r.isPaintSuspended(o)}},l.prototype.resizeTableByName=function(n,t,i){var r=this.findTableByName(n);return r&&this.resizeTable(r,t,i),this},l.prototype.getTables=function(){var n=this._tableManager;if(n)return n.getTables()},l.prototype.selectionBackColor=function(n){var t=this;return arguments.length===0?t._selectionBackColor:t._bindToAutoRefresh(function(n){return n&&(t._selectionBackColor=n),t})(n)},l.prototype.selectionBorderColor=function(n){var t=this;return arguments.length===0?t._selectionBorderColor:t._bindToAutoRefresh(function(n){return n&&(t._selectionBorderColor=n),t})(n)},l.prototype._addTableInternal=function(n){var i=this._tableManager,t;i&&(t=n.range(),this._checkCanAddTable(n.name(),t.row,t.col,t.rowCount,t.colCount))&&i.add(n)},l.prototype._checkCanAddTable=function(n,i,r,u,f,e){var o=this,s,h,c;if(!n){if(e)throw new Error(t.SR.Exp_TableEmptyNameError);return!1}if(i<0||u<1||i+u>o.getRowCount()){if(e)throw new Error(t.SR.Exp_TableInvalidRow);return!1}if(r<0||f<1||r+f>o.getColumnCount()){if(e)throw new Error(t.SR.Exp_TableInvalidColumn);return!1}if(o._hasTable(i,r,u,f)){if(e)throw new Error(t.SR.Exp_TableIntersectError);return!1}if(o.parent&&o.parent._findTable(n)||!o.parent&&o.findTableByName(n)){if(e)throw new Error(t.SR.Exp_TableHasSameNameError);return!1}if(s=o._getsArrayFormulas(i,r,u,f),s&&s.ranges&&s.ranges.length>0)for(h=0;h<s.ranges.length;h++)if(c=s.ranges[h],c.rowCount>1||c.colCount>1){if(e)throw new Error(t.SR.Exp_ArrayFormulaTable);return!1}return!0},l.prototype._bindToAutoRefresh=function(n,t){return t||(t=this),function(){var i=n.apply(t,arguments);return t._paintSuspended||(typeof t.invalidateLayout===c&&t.invalidateLayout(),typeof t.repaint===c&&t.repaint()),i}},l.prototype._isValidSheetName=function(n){var r,t,f,i,u;if(!n||n==="")return!1;if(r=this,t=r.parent,!t)return!0;for(f=t.sheets.length,i=0;i<f;i++)if(u=t.sheets[i],u!==r&&n===u._name)return!1;return!0},l.prototype._init=function(n){this._name=n;this._bounds=new t.Rect(0,0,0,0);this.reset()},l.prototype.applyOptions=function(n){var e,o,u,i,s;if(n){var t=this,r=t.defaults,f=t.gridline;typeof n.name===p&&n.name.length>0&&(t._name=n.name);n.data&&t.setDataSource(n.data);typeof n.defaultRowHeight===h&&(r.rowHeight=n.defaultRowHeight);typeof n.defaultColWidth===h&&(r.colWidth=n.defaultColWidth);typeof n.defaultRowHeaderColWidth===h&&(r.rowHeaderColWidth=n.defaultRowHeaderColWidth);typeof n.defaultColHeaderRowHeight===h&&(r.colHeaderRowHeight=n.defaultColHeaderRowHeight);typeof n.rowCount===h&&t.setRowCount(n.rowCount);typeof n.colCount===h&&t.setColumnCount(n.colCount);typeof n.frozenRowCount===h&&(t.frozenRowCount=n.frozenRowCount);typeof n.frozenColCount===h&&(t.frozenColCount=n.frozenColCount);typeof n.frozenTrailingRowCount===h&&(t._frozenTrailingRowCount=n.frozenTrailingRowCount);typeof n.frozenTrailingColCount===h&&(t._frozenTrailingColCount=n.frozenTrailingColCount);n.gridlineColor&&(f.color=n.gridlineColor);typeof n.showVerticalGridline===a&&(f.showVerticalGridline=n.showVerticalGridline);typeof n.showHorizontalGridline===a&&(f.showHorizontalGridline=n.showHorizontalGridline);n.borderColor&&(t.borderColor=n.borderColor);typeof n.borderWidth===h&&(t.borderWidth=n.borderWidth);typeof n._zoomFactor===h&&(t._zoomFactor=n._zoomFactor);typeof n.rowHeaderVisible===a&&(t.rowHeaderVisible=n.rowHeaderVisible);typeof n.colHeaderVisible===a&&(t.colHeaderVisible=n.colHeaderVisible);typeof n.autoUpdate===a&&(t.autoUpdate=n.autoUpdate);typeof n.autoGenerateColumns===a&&(t.autoGenerateColumns=n.autoGenerateColumns);n.rowHeaderAutoText&&(t.rowHeaderAutoText=n.rowHeaderAutoText);n.colHeaderAutoText&&(t.colHeaderAutoText=n.colHeaderAutoText);typeof n._activeRowIndex===h&&(e=n._activeRowIndex);typeof n._activeColIndex===h&&(o=n._activeColIndex);t._setActiveCellCore(e,o);typeof n._allowCellOverflow===a&&(t._allowCellOverflow=n._allowCellOverflow);typeof n.isProtected===a&&(t.isProtected=n.isProtected);typeof n.allowUndo===a&&t.allowUndo(n.allowUndo);u=n.columns;u&&u.length>0&&(t.autoGenerateColumns=!1,t.bindColumns(u));i=n.dataContext;i&&(s=new b(i.read,i.create,i.update,i.remove),t.setDataContext(s))}},l.prototype._initDefaultFloatingObjectKeyMap=function(){var u=navigator.platform,f=u&&u.indexOf("Mac")>-1,i,r,n;f?(i=!1,r=!0):(i=!0,r=!1);n=this;n.addFloatingObjectKeyMap(27,!1,!1,!1,!1,t.SpreadActions.unSelectAllFloatingObjects);n.addFloatingObjectKeyMap(46,!1,!1,!1,!1,t.SpreadActions.deleteFloatingObject);n.addFloatingObjectKeyMap(9,!1,!1,!1,!1,t.SpreadActions.navigationNextFloatingObject);n.addFloatingObjectKeyMap(9,!1,!0,!1,!1,t.SpreadActions.navigationPreviousFloatingObject);n.addFloatingObjectKeyMap(88,i,!1,!1,r,t.SpreadActions.clipboardCutFloatingObject);n.addFloatingObjectKeyMap(67,i,!1,!1,r,t.SpreadActions.clipboardCopyFloatingObject);n.addFloatingObjectKeyMap(86,i,!1,!1,r,t.SpreadActions.clipboardPasteFloatingObject);n.addFloatingObjectKeyMap(65,i,!1,!1,r,t.SpreadActions.selectAllFloatingObjects);n.addFloatingObjectKeyMap(38,!1,!1,!1,!1,t.SpreadActions.moveFloatingObjectUp);n.addFloatingObjectKeyMap(40,!1,!1,!1,!1,t.SpreadActions.moveFloatingObjectDown);n.addFloatingObjectKeyMap(37,!1,!1,!1,!1,t.SpreadActions.moveFloatingObjectLeft);n.addFloatingObjectKeyMap(39,!1,!1,!1,!1,t.SpreadActions.moveFloatingObjectRight)},l.prototype._initDefaultCommentKeyMap=function(){var i=navigator.platform,f=i&&i.indexOf("Mac")>-1,r,u,n;f?(r=!1,u=!0):(r=!0,u=!1);n=this;n.addCommentKeyMap(46,!1,!1,!1,!1,t.SpreadActions.deleteComment);n.addCommentKeyMap(27,!1,!1,!1,!1,t.SpreadActions.deactivateComment);n.addCommentKeyMap(38,!1,!1,!1,!1,t.SpreadActions.moveCommentUp);n.addCommentKeyMap(40,!1,!1,!1,!1,t.SpreadActions.moveCommentDown);n.addCommentKeyMap(37,!1,!1,!1,!1,t.SpreadActions.moveCommentLeft);n.addCommentKeyMap(39,!1,!1,!1,!1,t.SpreadActions.moveCommentRight)},l.prototype._initDefaultKeyMap=function(){var u=navigator.platform,f=u&&u.indexOf("Mac")>-1,i,r,n;f?(i=!1,r=!0):(i=!0,r=!1);n=this;n.addKeyMap(37,!1,!1,!1,!1,t.SpreadActions.navigationLeft);n.addKeyMap(39,!1,!1,!1,!1,t.SpreadActions.navigationRight);n.addKeyMap(38,!1,!1,!1,!1,t.SpreadActions.navigationUp);n.addKeyMap(40,!1,!1,!1,!1,t.SpreadActions.navigationDown);n.addKeyMap(37,i,!1,!1,r,t.SpreadActions.navigationHome2);n.addKeyMap(39,i,!1,!1,r,t.SpreadActions.navigationEnd2);n.addKeyMap(38,i,!1,!1,r,t.SpreadActions.navigationTop);n.addKeyMap(40,i,!1,!1,r,t.SpreadActions.navigationBottom);n.addKeyMap(36,!1,!1,!1,!1,t.SpreadActions.navigationHome);n.addKeyMap(36,!0,!1,!1,!1,t.SpreadActions.navigationFirst);n.addKeyMap(35,!1,!1,!1,!1,t.SpreadActions.navigationEnd);n.addKeyMap(35,!0,!1,!1,!1,t.SpreadActions.navigationLast);n.addKeyMap(9,!1,!1,!1,!1,t.SpreadActions.commitInputNavigationTabNext);n.addKeyMap(9,!1,!0,!1,!1,t.SpreadActions.commitInputNavigationTabPrevious);n.addKeyMap(33,!1,!1,!1,!1,t.SpreadActions.navigationPageUp);n.addKeyMap(34,!1,!1,!1,!1,t.SpreadActions.navigationPageDown);n.addKeyMap(33,i,!1,!1,r,t.SpreadActions.navigationPreviousSheet);n.addKeyMap(34,i,!1,!1,r,t.SpreadActions.navigationNextSheet);n.addKeyMap(46,!1,!1,!1,!1,t.SpreadActions.clear);n.addKeyMap(8,!1,!1,!1,!1,t.SpreadActions.clearAndEditing);n.addKeyMap(13,!1,!1,!1,!1,t.SpreadActions.commitInputNavigationDown);n.addKeyMap(13,!1,!0,!1,!1,t.SpreadActions.commitInputNavigationUp);n.addKeyMap(27,!1,!1,!1,!1,t.SpreadActions.cancelInput);n.addKeyMap(13,!0,!0,!1,!1,t.SpreadActions.commitArrayFormula);n.addKeyMap(37,!1,!0,!1,!1,t.SpreadActions.selectionLeft);n.addKeyMap(39,!1,!0,!1,!1,t.SpreadActions.selectionRight);n.addKeyMap(38,!1,!0,!1,!1,t.SpreadActions.selectionUp);n.addKeyMap(40,!1,!0,!1,!1,t.SpreadActions.selectionDown);n.addKeyMap(36,!1,!0,!1,!1,t.SpreadActions.selectionHome);n.addKeyMap(35,!1,!0,!1,!1,t.SpreadActions.selectionEnd);n.addKeyMap(33,!1,!0,!1,!1,t.SpreadActions.selectionPageUp);n.addKeyMap(34,!1,!0,!1,!1,t.SpreadActions.selectionPageDown);n.addKeyMap(37,i,!0,!1,r,t.SpreadActions.selectionHome);n.addKeyMap(39,i,!0,!1,r,t.SpreadActions.selectionEnd);n.addKeyMap(38,i,!0,!1,r,t.SpreadActions.selectionTop);n.addKeyMap(40,i,!0,!1,r,t.SpreadActions.selectionBottom);n.addKeyMap(36,!0,!0,!1,!1,t.SpreadActions.selectionFirst);n.addKeyMap(35,!0,!0,!1,!1,t.SpreadActions.selectionLast);n.addKeyMap(67,i,!1,!1,r,t.SpreadActions.copy);n.addKeyMap(88,i,!1,!1,r,t.SpreadActions.cut);n.addKeyMap(86,i,!1,!1,r,t.SpreadActions.paste);n.addKeyMap(90,i,!1,!1,r,t.SpreadActions.undo);n.addKeyMap(89,i,!1,!1,r,t.SpreadActions.redo)},l.prototype._setHost=function(n){var h=t.util._isStandardCanvas(),c=t.util._isSilverlightCanvas(),e,s,f,o;if(h||!c){var i=this,r=i._eventHandler,u=y.createElement("canvas");u.setAttribute("id",n.getAttribute("id")+"_vp");$(u).html("You need a browser which full supports HTML5 Canvas to run SpreadJS");n.appendChild(u);u.gcObject=!0;e=i._canvas;e&&($(e).unbind(d).unbind(g).unbind(nt).unbind(tt).unbind(it).unbind(rt),i._unbindTouchEvents(),e.parentNode&&e.parentNode.removeChild(e));i._canvas=u;t.features.comment&&(i._commentRender=i.parent?i.parent._commentRender:new t.CommentRender(i._getContainerDiv()));u.setAttribute("renderMethod","auto");s=t.util.device();f=s.ipad||s.iphone;i._mouseDownDelegate=function(n){if(!f){var u=i._touchManager;if(u&&u.preProcessMouseDown(n)){t.util.cancelDefault(n);return}return r.doMouseDown(n)}};i._mouseMoveDelegate=function(n){if(!f){var u=i._touchManager;if(u&&u.preProcessMouseMove(n)){t.util.cancelDefault(n);return}r._isMouseCapture||r.doMouseMove(n)}};i._mouseUpDelegate=function(n){if(!f){var u=i._touchManager;if(u&&u.preProcessMouseUp(n)){t.util.cancelDefault(n);return}if(!i._continueMouseUpBubble)return r._isMouseCapture?void 0:r.doMouseUp(n)}};i._mouseOutDelegate=function(n){if(!f)return r.doMouseOut(n)};i._dblClickDelegate=function(n){var u,s,e,c,h,o,l,a,v,y;if(!f&&(u=i,!u._isTouchMode)){if(h=u._currentTarget,h&&(u._trigger(t.Events.CellDoubleClick,{sheet:u,sheetName:u._name,sheetArea:h.hitTestType,row:h.row,col:h.col}),o=h.resizeInfo,o)){if(o.action==="sizeRow"){if(l=[],u._isRowSelected(o.index)){for(s=0;s<u._selectionModel.length;s++)if(e=u._selectionModel[s],e.col===-1)for(e=u._getActualRange(e),a=0;a<e.rowCount;a++)l.push({row:e.row+a})}else l.push({row:o.index});c=new t.UndoRedo.RowAutoFitUndoAction(u,l,o.sheetArea===1);u._doCommand(c)}else{if(v=[],u._isColumnSelected(o.index)){for(s=0;s<u._selectionModel.length;s++)if(e=u._selectionModel[s],e.row===-1)for(e=u._getActualRange(e),y=0;y<e.colCount;y++)v.push({col:e.col+y})}else v.push({col:o.index});c=new t.UndoRedo.ColumnAutoFitUndoAction(u,v,o.sheetArea===2);u._doCommand(c)}return}return r.startEdit(n)}};i._mouseWheelDelegate=function(n){if(!f){n=n?n:window.event;var i=n.detail?n.detail:n.wheelDelta/-40;return r.doMouseWheel(n,parseInt(i,10)),t.util.cancelDefault(n),!1}};$(u).bind(d,i._mouseDownDelegate).bind(g,i._mouseMoveDelegate).bind(nt,i._mouseUpDelegate).bind(tt,i._mouseOutDelegate).bind(it,i._dblClickDelegate).bind(rt,i._mouseWheelDelegate);i._bindTouchEvents();i._initializeActiveCell();r.doResize();i.parent&&i.parent._paintSpreadBackgroundImage();t.features.floatingObject&&($(window.document.body).scroll(function(){var n=i.parent.getActiveSheet(),t=n._render,r=n._floatingObjectArray;r&&r.length>0&&t&&t._paintFloatingObject(n._bounds)}),i._bind(t.Events.ColumnChanged,function(n,t){var r=t.propertyName;(r==="width"||r==="isVisible")&&i._updateFloatingObjectsLayout()}),i._bind(t.Events.RowChanged,function(n,t){var r=t.propertyName;(r==="height"||r==="isVisible")&&i._updateFloatingObjectsLayout()}),i._bind(t.Events.ColumnWidthChanged,function(n,t){i._updateFloatingObjectsLayout()}),i._bind(t.Events.RowHeightChanged,function(n,t){i._updateFloatingObjectsLayout()}));t.features.comment&&(o=i._commentManager,i._bind(t.Events.ColumnChanged,function(n,t){var i=t.propertyName;(i==="width"||i==="isVisible")&&o.updateCommentsLayoutWhenRowColumnChanged()}),i._bind(t.Events.RowChanged,function(n,t){var i=t.propertyName;(i==="height"||i==="isVisible")&&o.updateCommentsLayoutWhenRowColumnChanged()}),i._bind(t.Events.ColumnWidthChanged,function(n,t){o.updateCommentsLayoutWhenRowColumnChanged()}),i._bind(t.Events.RowHeightChanged,function(n,t){o.updateCommentsLayoutWhenRowColumnChanged()}),i._bind(t.Events.CommentChanged,function(n,t){var i=t.propertyName,r=o.getCommentView(t.comment);i==="autoSize"?r.updateLayoutWhenAutosizeChanged():i==="location"?r.updateLayoutWhenLocationChanged():(i==="width"||i==="height")&&r.updateLayoutWhenWidthHeightChanged()}))}},l.prototype._unbindTouchEvents=function(){this._touchManager&&this._touchManager.detach()},l.prototype._bindTouchEvents=function(){if(t.features.touch){var n=this,i=n.parent,u=i&&i._touchEventProvider?i._touchEventProvider:new t.TouchEventProvider,r=new t.TouchManager(n._canvas,n,u);r.attach();n._touchManager=r}},l.prototype._disposeValidationUI=function(){var t=this,f=t._validationInputMessage,r,u,n;f&&(n=f.parentNode,n&&n.removeChild(f),t._validationInputMessage=i);r=t._validationButton;r&&(n=r.parentNode,n&&n.removeChild(r),t._validationButton=i);u=t._validationSelect;u&&(n=u.parentNode,n&&n.removeChild(u),t._validationSelect=i)},l.prototype._disposeFloatingObjectUI=function(){var e=this._render,n=e&&e._floatingObjectRenderManager,r,u,o,s,t,f;if(n){for(r=0,o=n.length;r<o;r++)if(t=n[r],t){for(u=0,s=t.length;u<s;u++)f=t[u],f&&f._dispose();t.length=0}n.length=0;n=i}},l.prototype._disposeComment=function(){var t=this,n=t._commentManager;n&&n.hideAllComments()},l.prototype._dispose=function(){var n=this,r,u,f,e,o,s;n.isEditing()&&n.endEdit();r=n._canvas;r&&($(r).unbind(d).unbind(g).unbind(nt).unbind(tt).unbind(it).unbind(rt),r.parentNode.removeChild(r),n._canvas=i);$(window).unbind(kt);t.StyleHelper._disposeMeasureSpan();u=n._eventHandler;u&&(u._dispose(),u._disposeFocusHolders());f=n._filterDialiog;f&&f.close();e=n._smartTag;e&&e.close();o=n._editor;o&&$(o).remove();s=n._cutCopyIndicatorManager;s&&s._dispose();n._disposeValidationUI();n._disposeFloatingObjectUI();n._disposeComment();n._disposeStringWidthPre();n._disposeStringWidthSpan()},l.prototype._disposeStringWidthSpan=function(){var n=this._editingSpan;n&&($(n).remove(),this._editingSpan=u)},l.prototype._disposeStringWidthPre=function(){var n=this._editingPre;n&&($(n).remove(),this._editingPre=u)},l.prototype._getModel=function(n){var t=this;if(n===3||typeof n===r||n===i)return t._dataModel;else if(n===2)return t._rowHeaderModel;else if(n===1)return t._colHeaderModel;return i},l.prototype._getCalcModel=function(n){return n===u||n===i||n===3?this._calcDataModel:i},l.prototype._getValueImp=function(n,u,f,e){var v=this,s,a,h,b,c;(typeof e===r||e===i)&&(e=3);var y=e===3,o=i,w=!1,l=v._tableManager;return y&&l&&l._tableList.length>0&&(s=l.find(u,f),s&&s.showHeader()&&u===s.headerIndex()&&(a=s._getColumn(f),a&&(w=!0,(typeof o===r||o===i)&&(o=a.name())))),(typeof o===r||o===i)&&(h=v._bindingManager,b=h&&h._dataSource,b&&y&&(o=h.getValue(u,f))),(typeof o===r||o===i)&&(o=n.getValue(u,f)),typeof o===p&&o.charAt(0)==="/"&&(pt.test(o)?(c=o.match(pt),o=t._DateTimeHelper.fromOADate(parseFloat(c[1]))):yt.test(o)&&(c=o.match(yt),o=new Date(parseFloat(c[1])))),w&&o!==i&&typeof o!==r&&(o=t.util.toString(o)),o},l.prototype._getSwapIndex=function(n,t,i){for(var r=n[i-t];r.index<i;)r=n[r.index-t];return r.index},l.prototype._quickSortImp=function(n){var t,i;if(n.length<=1)return n;var e=o(n.length/2),s=n[e],r=[],u=[],f=[];for(t=0;t<n.length;t++)i=this._sortCompare(n[t],s),i<0?r.push(n[t]):i>0?u.push(n[t]):f.push(n[t]);return this._quickSortImp(r).concat(f,this._quickSortImp(u))},l.prototype._quickSort=function(n,t,i,r,u,f){var s=u?i:r,o=[],e;if(u)for(e=0;e<s;e++)o[e]={sheet:this,index:n+e,byRows:u,sortInfo:f};else for(e=0;e<s;e++)o[e]={sheet:this,index:t+e,byRows:u,sortInfo:f};return this._quickSortImp(o)},l.prototype._isEquals=function(n,i){return n instanceof Date&&i instanceof Date?new t._DateTimeHelper(n).toOADate()===new t._DateTimeHelper(i).toOADate():n===i},l.prototype._isGreaterThan=function(n,i){return(typeof n=="boolean"?n=n?1:0:n instanceof Date&&(n=new t._DateTimeHelper(n).toOADate()),typeof i=="boolean"?i=i?1:0:i instanceof Date&&(i=new t._DateTimeHelper(i).toOADate()),typeof n!=typeof i&&(typeof n=="number"||typeof i=="number"))?typeof i=="number":n>i},l.prototype._sortCompare=function(n,t){var l,e,r,f,o,s,h,a,c;if(n.sortInfo&&n.sortInfo.length>0){for(l=this,e=0,h=0;h<n.sortInfo.length;h++)if(n.sortInfo[h]&&(a=n.sortInfo[h].ascending,c=n.sortInfo[h].index,0<=c&&(n.byRows?(r=n.sheet.getValue(n.index,c),f=t.sheet.getValue(t.index,c),o=r===u||r===i||r==="",s=f===u||f===i||f==="",o||s?o&&s?e=0:o&&!s?e=1:!o&&s&&(e=-1):e=l._isEquals(r,f)?0:l._isGreaterThan(r,f)?a?1:-1:a?-1:1):(r=n.sheet.getValue(c,n.index),f=t.sheet.getValue(c,t.index),o=r===u||r===i||r==="",s=f===u||f===i||f==="",o||s?o&&s?e=0:o&&!s?e=1:!o&&s&&(e=-1):e=l._isEquals(r,f)?0:l._isGreaterThan(r,f)?a?1:-1:a?-1:1))),e!==0)break;return e}return 0},l.prototype._getActualRange=function(n,u){(typeof u===r||u===i)&&(u=3);var f=new t.Range(-1,-1,-1,-1);return n===i||typeof n===r?f:(f.col=n.col,f.row=n.row,f.colCount=n.colCount,f.rowCount=n.rowCount,f.col===-1&&(f.col=0,f.colCount=this.getColumnCount(u)),f.row===-1&&(f.row=0,f.rowCount=this.getRowCount(u)),f)},l.prototype._getRangeRect=function(n,i,r){var e=new t.Rect(-1,-1,-1,-1),o=this,s=o._getSheetLayout(),p,w;if(s.width===0||s.height===0||(p=o._getViewportColumnLayout(i),w=o._getViewportRowLayout(n),!p||p.length===0||!w||w.length===0))return e;var b=o._getActualRange(r),k=o._cachePool,l=function(n,t){for(var r=0,u,i=n;i<=t;i++)u=k.getCachedColumn(i),r+=u.width;return r},a=function(n,t){for(var r=0,u,i=n;i<=t;i++)u=k.getCachedRow(i),r+=u.height;return r},u=b.row,h=b.row+b.rowCount-1,f=b.col,c=b.col+b.colCount-1,d=o.frozenRowCount,g=o.getRowCount()-o._frozenTrailingRowCount-1,nt=o.frozenColCount,tt=o.getColumnCount()-o._frozenTrailingColCount-1,v=p[0].col,it=p[p.length-1].col,y=w[0].row,rt=w[w.length-1].row,ut=function(n,t){while(n>t)if(n--,o.getColumnVisible(n))return n;return n},ft=function(n,t){while(n<t)if(n++,o.getColumnVisible(n))return n;return n},et=function(n,t){while(n>t)if(n--,o.getRowVisible(n))return n;return n},ot=function(n,t){while(n<t)if(n++,o.getRowVisible(n))return n;return n};return(f<v&&(f=ut(v,f)),c>it&&(c=ft(it,c)),u<y&&(u=et(y,u)),h>rt&&(h=ot(rt,h)),c<f||h<u)?e:(i===0?f<nt&&(e.x=s.frozenX+l(0,f-1),e.width=l(f,c)):i===1?f<=tt&&c>=nt&&(e.x=f<v?s.viewportX-l(f,v-1):s.viewportX+l(v,f-1),e.width=l(f,c)):i===2&&c>tt&&(e.x=f<v?s.frozenTrailingX-l(f,v-1):s.frozenTrailingX+l(v,f-1),e.width=l(f,c)),n===0?u<d&&(e.y=s.frozenY+a(0,u-1),e.height=a(u,h)):n===1?u<=g&&h>=d&&(e.y=u<y?s.viewportY-a(u,y-1):s.viewportY+a(y,u-1),e.height=a(u,h)):n===2&&h>g&&(e.y=u<y?s.frozenTrailingY-a(u,y-1):s.frozenTrailingY+a(y,u-1),e.height=a(u,h)),e)},l.prototype._getRangeRect2=function(n){var o=this,i=new t.Rect(-1,-1,-1,-1),w=o._getSheetLayout();if(w.width===0||w.height===0)return i;var d=o._getActualRange(n),g=isNaN(o.frozenColCount)?0:o.frozenColCount,nt=isNaN(o.frozenRowCount)?0:o.frozenRowCount,b=isNaN(o._frozenTrailingColCount)?0:o._frozenTrailingColCount,k=isNaN(o._frozenTrailingRowCount)?0:o._frozenTrailingRowCount,tt=o._cachePool,y=function(n,t){for(var r=0,u,i=n;i<=t;i++)u=tt.getCachedColumn(i),r+=u.width;return r},p=function(n,t){for(var r=0,u,i=n;i<=t;i++)u=tt.getCachedRow(i),r+=u.height;return r},a=d.row,s=d.row+d.rowCount-1,v=d.col,h=d.col+d.colCount-1,c=o.getRowCount(),l=o.getColumnCount(),r,u;if(v<g)i.x=w.frozenX+y(0,v-1),i.width=y(v,f(h,g-1)),g<=h&&h<l-b?(r=o._getViewportColumnLayout(1),r&&r.length>0&&(i.width+=y(r[0].col,f(h,r[r.length-1].col)))):h>=l-b&&(r=o._getViewportColumnLayout(2),r&&r.length>0&&(i.width=r[0].x-i.x,i.width+=y(l-b,f(h,l-1))));else if(v<l-b){if(r=o._getViewportColumnLayout(1),!r||r.length===0||v>r[r.length-1].col||h<r[0].col)return i;i.x=w.viewportX+y(r[0].col,v-1);g<=h&&h<l-b?i.width=y(e(v,r[0].col),f(h,r[r.length-1].col)):h>=l-b&&(r=o._getViewportColumnLayout(2),r&&r.length>0&&(i.width=r[0].x-i.x,i.width+=y(l-b,f(h,l-1))))}else v<l&&(r=o._getViewportColumnLayout(2),r&&r.length>0&&(i.x=w.frozenTrailingX+y(r[0].col,v-1),i.width=y(v,f(h,l-1))));if(a<nt)i.y=w.frozenY+p(0,a-1),i.height=p(a,f(s,nt-1)),nt<=s&&s<c-k?(u=o._getViewportRowLayout(1),u&&u.length>0&&(i.height+=p(u[0].row,f(s,u[u.length-1].row)))):s>=c-k&&(u=o._getViewportRowLayout(2),u&&u.length>0&&(i.height=u[0].y-i.y,i.height+=p(c-k,f(s,c-1))));else if(a<c-k){if(u=o._getViewportRowLayout(1),!u||u.length===0||a>u[u.length-1].row||s<u[0].row)return i;i.y=w.viewportY+p(u[0].row,a-1);nt<=s&&s<c-k?i.height=p(e(a,u[0].row),f(s,u[u.length-1].row)):s>=c-k&&(u=o._getViewportRowLayout(2),u&&u.length>0&&(i.height=u[0].y-i.y,i.height+=p(c-k,f(s,c-1))))}else a<c&&(u=o._getViewportRowLayout(2),u&&u.length>0&&(i.y=w.frozenTrailingY+p(u[0].row,a-1),i.height+=p(a,f(s,c-1))));return i},l.prototype._getCanvas=function(){var n=this._canvas;return!n&&this.parent&&(n=this.parent.canvas),n&&!n.getContext&&n.firstChild&&(n.getContext=n.firstChild.getContext),n},l.prototype._draw=function(n,t){var i=this._render,r=i._getCtx();r&&i.paint(r,t)},l.prototype._getStringWidth=function(n,t){return this._getStringWidthByCanvas(n,t)+1},l.prototype._getStringWidthByCanvas=function(n,i){var r="",u=this._render;return r=i?i:u._getZoomFont(u._getDefaultFont()),t._WordWrapHelper._measureText(n,r)},l.prototype._getFontHeight=function(n,t){var i=this,r=i.fontHeightCache,f,u,e;if(!t)if(r){if(f=r[n],f)return f}else r=i.fontHeightCache={};return u=i._getEditingSpan(),u.style.font=n?n:i._render._getDefaultFont(),u.innerHTML="H",e=u.offsetHeight,t||(r[n]=e),e},l.prototype._getEditingSpan=function(){if(!this._editingSpan){var n=y.createElement("span"),t=n.style;t.visibility=ht;t.top="-10000px";t.left="-10000px";t.position="absolute";n.className="gcStringWidthSpanStyle";n.setAttribute("gcUIElement","gcStringWidthSpan");y.body.insertBefore(n,i);this._editingSpan=n}return this._editingSpan},l.prototype._getColumnViewportIndexFromX=function(n){var t=this._getSheetLayout(),r=i;return t.headerX<n&&n<t.headerX+t.rowHeaderWidth?r=-1:t.frozenX<n&&n<t.frozenX+t.frozenWidth?r=0:t.viewportX<n&&n<t.viewportX+t.viewportWidth?r=1:t.frozenTrailingX<n&&n<t.frozenTrailingX+t.frozenTrailingWidth&&(r=2),r},l.prototype._getRowViewportIndexFromY=function(n){var t=this._getSheetLayout(),r=i;return t.headerY<n&&n<t.headerY+t.colHeaderHeight?r=-1:t.frozenY<n&&n<t.frozenY+t.frozenHeight?r=0:t.viewportY<n&&n<t.viewportY+t.viewportHeight?r=1:t.frozenTrailingY<n&&n<t.frozenTrailingY+t.frozenTrailingHeight&&(r=2),r},l.prototype._getRowIndexFromY=function(n,t){var r=i,u;return r=t===-1?this._getColumnHeaderRowLayout():this._getViewportRowLayout(t),r&&(u=r.findY(n),u)?u.row:void 0},l.prototype._getColumnIndexFromX=function(n,t){var r=i,u;return r=t===-1?this._getRowHeaderColumnLayout():this._getViewportColumnLayout(t),r&&(u=r.findX(n),u)?u.col:void 0},l.prototype._isActiveCell=function(n,t){var i=this;return i._activeRowIndex<=n&&n<i._activeRowIndex+i._activeRowCount&&i._activeColIndex<=t&&t<i._activeColIndex+i._activeColCount},l.prototype._isColumnSelected=function(n){for(var t,r,i=0;i<this._selectionModel.length;i++)if(t=this._selectionModel[i],r=t.col===-1?0:t.col,t.row===-1&&n>=r&&n<r+t.colCount)return!0;return!1},l.prototype._isRowSelected=function(n){for(var t,r,i=0;i<this._selectionModel.length;i++)if(t=this._selectionModel[i],r=t.row===-1?0:t.row,t.col===-1&&n>=r&&n<r+t.rowCount)return!0;return!1},l.prototype._isSelected=function(n,t,u){for(var o,f,e=!1,h=this._selectionModel,s=0,c=h.length;s<c;s++)if(o=h[s],f=this._getActualRange(o),u===3||typeof u===r||u===i?e=f.row<=n&&n<f.row+f.rowCount&&f.col<=t&&t<f.col+f.colCount:u===2?e=f.row<=n&&n<f.row+f.rowCount:u===1?e=f.col<=t&&t<f.col+f.colCount:u===0&&(e=o.row===-1&&o.col===-1),e)return e;return e},l.prototype._isAllSelected=function(n,t,r){for(var f,h,c,o=this,e=!1,l=o.getRowCount(),a=o.getColumnCount(),s=0;s<o._selectionModel.length;s++)if(f=o._selectionModel[s],r!==u&&r!==i&&r!==3&&(r===2?(h=f.row===-1?0:f.row,e=f.col===-1&&n>=h&&n<h+f.rowCount):r===1?(c=f.col===-1?0:f.col,e=f.row===-1&&t>=c&&t<c+f.colCount):r===0&&(e=f.row===-1&&f.col===-1&&f.rowCount===l&&f.colCount===a)),e)return e;return e},l.prototype._isHover=function(n,t,u){var h=!1,f=this._currentTarget,e,o,s;if(f&&typeof u!==r&&u!==i)if(u===1)return e=!1,o=this._colHeaderSpanModel.find(f.row,f.col),o&&(e=o.contains(n,t,1,1)),s=n===f.row&&t===f.col||e,f.hitTestType===u&&s;else if(u===2)return e=!1,o=this._rowHeaderSpanModel.find(f.row,f.col),o&&(e=o.contains(n,t,1,1)),s=n===f.row&&t===f.col||e,f.hitTestType===u&&s;else if(u===3)return f.hitTestType===u&&n===f.row&&t===f.col;else if(u===0)return f.hitTestType===u;return h},l.prototype._indexToLetters=function(n){for(var r="A",u=r.charCodeAt(0),t="",i;n>0;n=(n-1)/26)i=parseInt((n-1)%26,10),(n===1||i>=0&&n>1)&&(t=String.fromCharCode(u+i)+t);return t},l.prototype._doStartEdit=function(n,t,i){var r=this,e=r.hitTest(t,i),u,f,h,s,o;if(e&&(u=e.row,f=e.col,u>=0&&f>=0&&e.rowViewportIndex>=0&&e.colViewportIndex>=0&&!e.resizeInfo&&!e.dragInfo&&u===r._activeRowIndex&&f===r._activeColIndex&&(h=r.isEditing(),r._startEditImp(n,u,f),!h&&r.isEditing()&&(s=e.hitTestType,o=r.getCellType(u,f),o._triggerButtonClicked)))){var l=r.getCellRect(u,f),a=r.getActualStyle(u,f,s),v={sheet:r,row:u,col:f,sheetArea:s},c=o.getHitInfo(t,i,a,l,v);c&&c.isReservedLocation&&o._triggerButtonClicked(r,u,f)}},l.prototype._getSheetArea=function(n,t){if(n>=0&&n<=2&&t>=0)return 3;else if(n>=0&&n<=2&&t<0)return 2;else if(n<0&&t>=0)return 1;else if(n<0&&t<0)return 0;return i},l.prototype.setFocus=function(){var n=this._eventHandler;n&&n.setFocus()},l.prototype._startEditImp=function(n,r,f,e,o,s,h){var c,b,d,l,g,a,nt,it,k,rt,ut,tt,ot,st,w;if(!(r<0)&&!(f<0)&&(c=this,!c.isEditing())){b=c._eventHandler;b&&b.setFocus();var v=r,p=f,k=c.getCellRect(v,p);if(k&&!(k.width<=0)&&!(k.height<=0)&&(c.showCell(c._activeRowIndex,c._activeColIndex,3,3),d=c.getActualStyle(r,f),!c.isProtected||d.locked===!1)&&(l=c.getCellType(v,p),l)&&(a={sheet:c,row:r,col:f,sheetArea:3},l.isImeAware(a)?b&&(g=b._cellTypeFocusHolder):g=l.createEditorElement(a),g)&&(c._editor=g,nt={sheet:c,sheetName:c._name,row:v,col:p,cancel:!1},c._trigger(t.Events.EditStarting,nt),!nt||nt.cancel!==!0)){var ft=c.getValue(v,p),et=c.getFormula(v,p),ht=c._editorStatus;c._editorStatus=c._startEditByKeydown?1:(ft===i||ft===u)&&(et===i||et===u)?1:2;c._trigger(t.Events.EditorStatusChanged,{sheet:c,sheetName:c._name,oldStatus:ht,newStatus:c._editorStatus});it=c._getSheetLayout();k=c.getCellRect(v,p,e,o);l.isImeAware(a)&&b._resetFocusHolder();l.activateEditor(c._editor,d,k,a);c._setEditorValue(l,c._editor,v,p,d,h);rt=1;ut=2;c.showEditingLocator&&(tt=l._getLocator(),g._editingLocator=tt,ot=c.getValue(c._getModel(rt).rowCount-1,f,rt),st=c.getValue(r,c._getModel(ut).colCount-1,ut),tt.innerHTML=ot+""+st,l._updateEditorLocator(c._editor,a),y.body.insertBefore(tt,i));l.isImeAware(a)||y.body.insertBefore(c._editor,i);l.updateEditor(c._editor,d,k,a);l.isImeAware(a)&&s||l.focus(c._editor,a);s&&l.selectAll(c._editor,a);c._allowCellOverflow&&(w=c.getCellRect(r,f,e,o),w.x-=2,w.y-=2,w.width+=4,w.height+=4,w.x=it.frozenX,w.width=it.viewportWidth,c.repaint(w));c._render.refreshTouchSelectionIndicator();c._attachFormlulaTextBox(l.getEditingElement());window.gcGlobal.activeElement=c;c._trigger(t.Events.EditStarted,{sheet:c,sheetName:c._name,row:v,col:p})}}},l.prototype._setEditorValue=function(n,t,r,f,e,o){var h=this,s=h.getFormula(r,f),c,l,a;s&&(s="="+s);c=s;l={sheet:h,row:r,col:f,sheetArea:3};s&&s.length!==0||(s=h.getValue(r,f),a=h.parent?h.parent.canUserEditFormula():!0,s&&s.length>0&&/^=/ig.test(s)&&a&&(s="'"+s),c=s,s=n._formatEditorValue(t,e,s,l));t._oldValue=s;o!==i&&o!==u&&(s=o);n.setEditorValue(t,s,l);t._originalValue=c},l.prototype._attachFormlulaTextBox=function(n){var i,u;if(t.features.formulatextbox&&n){i=this;i._formulaTextBox&&i._formulaTextBox.destroy();i._formulaTextBox=new t.FormulaTextBox(n);var r=i._formulaTextBox,e=i._eventHandler,f=i._render;r.bind("AppendStarted",function(n){r.close();var t=$.wijmo.wijspread.EditorStatus,u=i._editorStatus;u!==t.Enter&&(i._editorStatus=t.Enter,i._trigger("EditorStatusChanged",{sheet:i,sheetName:i._name,oldStatus:u,newStatus:t.Enter}))});r.bind("AppendEnded",function(n){f.paintFormulaTextBox()});r.bind("TextChanged",function(n,u){if(u&&u.type!=="input"){e.updateEditingEditor();var o=i._activeRowIndex,s=i._activeColIndex,h=i.getCellType(o,s);i._trigger(t.Events.EditChange,{sheet:i,sheetName:i._name,row:o,col:s,editingText:h.getEditorValue(i._editor)})}f.paintFormulaTextBox();i._trigger("FormulaTextBoxTextChanged",{sheet:i,sheetName:i._name,text:r.text()})});r.bind("CaretChanged",function(){f.paintFormulaTextBox();i._trigger("FormulaTextBoxCaretChanged",{sheet:i,sheetName:i._name,caret:r.caret()})});r.add(t.SR.getHelpFuncs());u=this._functionDescriptions;u&&u.length>0&&r.add(u);u=this.parent&&this.parent._functionDescriptions;u&&u.length>0&&r.add(u);f.paintFormulaTextBox()}},l.prototype._detachFormulaTextBox=function(){var n=this;n._formulaTextBox&&(n._formulaTextBox.destroy(),n._formulaTextBox=i,n._render.paintFormulaTextBox())},l.prototype._showEditingLocator=function(){var n=this,t,i,o,s;if(n.isEditing()!==!1&&(t=n._editor,i=t&&t._editingLocator,i)){var f=$(t),r=parseInt(f.css(dt),10)+n.getColumnWidth(n._activeColIndex)/2,u=parseInt(f.css(gt),10)+n.getRowHeight(n._activeRowIndex)/2,e=$(n._getCanvas()).offset();r-=e.left;u-=e.top;o=n._getRowIndexFromY(u,n._getRowViewportIndexFromY(u));s=n._getColumnIndexFromX(r,n._getColumnViewportIndexFromX(r));o===n._activeRowIndex&&s===n._activeColIndex?$(i).css(ct,ht):$(i).css(ct,"visible")}},l.prototype._getKeyAction=function(n,t,r,u,f){var s=this.keyMap,h,e,o;if(!s)return i;for(h=s.length,o=0;o<h;o++)if(e=s[o],e&&e.key===n&&e.ctrl===t&&e.shift===r&&e.alt===u&&e.meta===f)return e;return i},l.prototype._getFloatingObjectKeyAction=function(n,t,r,u,f){var s=this.floatingObjectKeyMap,h,e,o;if(!s)return i;for(h=s.length,o=0;o<h;o++)if(e=s[o],e&&e.key===n&&e.ctrl===t&&e.shift===r&&e.alt===u&&e.meta===f)return e;return i},l.prototype._getCommentKeyAction=function(n,t,r,u,f){var e,o;if(!this._commentKeyMap)return i;for(o=0;o<this._commentKeyMap.length;o++)if(e=this._commentKeyMap[o],e&&e.key===n&&e.ctrl===t&&e.shift===r&&e.alt===u&&e.meta===f)return e;return i},l.prototype._moveActiveCellUp=function(n,t,i){var r=this,u=r._getMoveUpCell(n,t,i,r._leadingCellCol||0);if(u){var f=u.row,e=u.col,o=u.leadingCellCol;r._canMoveCurrentTo(f,e)&&(r._leadingCellRow=f,r._leadingCellCol=o,r._setActiveCellCore(f,e))}},l.prototype._getMoveUpCell=function(n,t,r,f){var o=n,e=t;if(o===0&&!r)return i;var s=this,c=s.getRowCount(),l=s.getColumnCount(),h=s._getPrevRow(o,f);return(r||s._adjustCell(h),o=h.r,e=h.c,o<0&&r&&(e=s._getPrevVisualColumn(e),(e<0||e===u||e===i)&&(e=s._getPrevVisualColumn(l)),f=e,h=s._getPrevRow(c,e),o=h.r,e=h.c,e===t&&o<=n))?i:{row:o,col:e,leadingCellCol:f}},l.prototype._moveActiveCellDown=function(n,t,i){var r=this,u=r._getMoveDownCell(n,t,i,r._leadingCellCol||0);if(u){var f=u.row,e=u.col,o=u.leadingCellCol;r._canMoveCurrentTo(f,e)&&(r._leadingCellRow=f,r._leadingCellCol=o,r._setActiveCellCore(f,e))}},l.prototype._getMoveDownCell=function(n,t,r,f){var o=this,c=o.getRowCount(),l=o.getColumnCount(),s=n,e=t,h;if(s!==c-1||r)return(h=o._getNextRow(s,f),r||o._adjustCell(h),s=h.r,e=h.c,s===c&&r&&(e=o._getNextVisualColumn(e),(e>=l||e===u||e===i)&&(e=o._getNextVisualColumn(-1)),f=e,h=o._getNextRow(-1,e),s=h.r,e=h.c,e===t&&s>=n))?void 0:{row:s,col:e,leadingCellCol:f}},l.prototype._moveActiveCellLeft=function(n,t,i){var r=this,u=r._getMoveLeftCell(n,t,i,r._leadingCellRow||0);if(u){var e=u.row,f=u.col,o=u.leadingCellRow;r._canMoveCurrentTo(e,f)&&(r._leadingCellRow=o,r._leadingCellCol=f,r._setActiveCellCore(e,f))}},l.prototype._getMoveLeftCell=function(n,t,r,f){var e=n,o=t;if(o===0&&!r)return i;var s=this,c=s.getRowCount(),l=s.getColumnCount(),h=s._getPrevColumn(f,o);for(r||s._adjustCell(h),e=h.r,o=h.c;o<0&&r;)if(e=s._getPrevVisualRow(e,3,!0),(e<0||e===u||e===i)&&(e=s._getPrevVisualRow(c,3,!0)),f=e,h=s._getPrevColumn(e,l),e=h.r,o=h.c,e===n&&o<=t)return i;return{row:e,col:o,leadingCellRow:f}},l.prototype._adjustCell=function(n){var t=this;n.r<0?n.r=t._getFirstVisualRow():n.r>=t.getRowCount()&&(n.r=t._getLastVisualRow());n.c<0?n.c=t._getFirstVisualColumn():n.c>=t.getColumnCount()&&(n.c=t._getLastVisualColumn())},l.prototype._fixRange=function(n){var i=n.row<0?0:n.row,r=n.col<0?0:n.col,u=n.row<0?this.getRowCount():n.rowCount,f=n.col<0?this.getColumnCount():n.colCount;return new t.Range(i,r,u,f)},l.prototype._moveActiveCellLeftInSelection=function(n,t){for(var i=this,s=i._selectionModel,v=s.activeSelectedRangeIndex,h=-1,e=i._fixRange(i._getActiveSelectedRange()),c=e.row,l=e.col,a=e.col+e.colCount-1,r=n,f=t,o,u;;){if(o=i._getPrevColumnInSelection(r,f),r=o.r,f=o.c,f>=l)break;if(h===v&&r===n&&f<=t)return;r--;r>=c?f=a+1:(u=i._fixRange(i._getActiveSelectedRange(3)),h=s.activeSelectedRangeIndex,c=u.row,l=u.col,a=u.col+u.colCount-1,r=u.row+u.rowCount-1,f=u.col+u.colCount)}r>=0&&(i._setActiveCellCore(r,f),i._leadingCellRow=r,i._leadingCellCol=f)},l.prototype._moveActiveCellRightInSelection=function(n,t){for(var i=this,s=i._selectionModel,v=s.activeSelectedRangeIndex,h=-1,e=i._fixRange(i._getActiveSelectedRange()),c=e.col,l=e.row+e.rowCount-1,a=e.col+e.colCount-1,r=n,u=t,o,f;;){if(o=i._getNextColumnInSelection(r,u),r=o.r,u=o.c,u<=a)break;if(h===v&&r===n&&u>=t)return;r++;r<=l?u=c-1:(f=i._fixRange(i._getActiveSelectedRange(4)),h=s.activeSelectedRangeIndex,c=f.col,l=f.row+f.rowCount-1,a=f.col+f.colCount-1,r=f.row,u=f.col-1)}r>=0&&(i._setActiveCellCore(r,u),i._leadingCellRow=r,i._leadingCellCol=u)},l.prototype._moveActiveCellRight=function(n,t,i){var r=this,u=r._getMoveRightCell(n,t,i,r._leadingCellRow||0);if(u){var e=u.row,f=u.col,o=u.leadingCellRow;r._canMoveCurrentTo(e,f)&&(r._leadingCellRow=o,r._leadingCellCol=f,r._setActiveCellCore(e,f))}},l.prototype._getMoveRightCell=function(n,t,r,f){var s=this,l=s.getRowCount(),c=s.getColumnCount(),e=n,h=t,o;if(h===c-1&&!r)return i;if(o=s._getNextColumn(f,h),!r){if(o.c===c)return i;s._adjustCell(o)}for(e=o.r,h=o.c;h===c&&r;)if(e=s._getNextVisualRow(e,!0),(e>=l||e===u||e===i)&&(e=s._getNextVisualRow(-1,!0)),f=e,o=s._getNextColumn(e,-1),e=o.r,h=o.c,e===n&&h>=t)return i;return{row:e,col:h,leadingCellRow:f}},l.prototype._getPrevColumn=function(n,i){for(var f={r:n,c:i},r,u;i>=0;){if(n=f.r,i--,i<0)break;if(r=this.getSpans(new t.Range(n,i,1,1)),r&&r.length>0&&(u=r[0],i>=u.col&&(i=u.col,n=u.row)),this._canMoveCurrentTo(n,i))return{r:n,c:i}}return{r:n,c:i}},l.prototype._getPrevColumnInSelection=function(n,t){for(var i,r;t>=0;){if(t--,t<0)break;if(i=this._spanModel.find(n,t),i){if(r=this._getActiveSelectedRange(),r.row<=i.row&&i.row+i.rowCount<=r.row+r.rowCount&&r.col<=i.col&&i.col+i.colCount<=r.col+r.colCount){if(!(i.row===n&&i.col===t))continue}else continue;t>=i.col&&(t=i.col,n=i.row)}if(this._canMoveCurrentTo(n,t))return{r:n,c:t}}return{r:n,c:t}},l.prototype._getNextColumn=function(n,i){for(var u=this,s=u.getColumnCount(),h={r:n,c:i},o,f,r;i<s;){if(n=h.r,o=u._spanModel.find(n,i),o?i+=o.colCount:i++,i>=s)break;if(f=u.getSpans(new t.Range(n,i,1,1)),f&&f.length>0&&(r=f[0],i>r.col?i=e(i,r.col+r.colCount):n=r.row),u._canMoveCurrentTo(n,i))return{r:n,c:i}}return{r:n,c:i}},l.prototype._getNextColumnInSelection=function(n,t){for(var u=this,o=u.getColumnCount(),f,i,r;t<o;){if(f=u._spanModel.find(n,t),f?t+=f.colCount:t++,t>=o)break;if(i=u._spanModel.find(n,t),i){if(r=u._getActiveSelectedRange(),r.row<=i.row&&i.row+i.rowCount<=r.row+r.rowCount&&r.col<=i.col&&i.col+i.colCount<=r.col+r.colCount){if(!(i.row===n&&i.col===t))continue}else continue;t>i.col?t=e(t,i.col+i.colCount):n=i.row}if(u._canMoveCurrentTo(n,t))return{r:n,c:t}}return{r:n,c:t}},l.prototype._canMoveCurrentTo=function(n,t){var i=this,r=!1,e=i.getRowVisible(n),o=i.getColumnVisible(t),s=i._getZoomRowHeight(n),h=i._getZoomColumnWidth(t),f,u;return r=n>=0&&n<i.getRowCount()&&t>=0&&t<i.getColumnCount()&&e&&o&&s>0&&h>0,f=!!i._isTabNavigation,r===!0&&f===!0&&(u=i.getActualStyle(n,t),u&&u.tabStop===!1&&(r=!1)),r},l.prototype._getPrevRow=function(n,i){for(var f={r:n,c:i},r,u;n>=0;){if(n--,n<0)break;if(r=this.getSpans(new t.Range(n,i,1,1)),r&&r.length>0&&(u=r[0],n>=u.row&&(n=u.row,i=u.col)),this._canMoveCurrentTo(n,i))return{r:n,c:i}}return{r:n,c:i}},l.prototype._getNextRow=function(n,i){for(var u=this,s=u.getRowCount(),h={r:n,c:i},o,f,r;n<s;){if(o=u._spanModel.find(n,i),o?n+=o.rowCount:n++,n>=s)break;if(f=u.getSpans(new t.Range(n,i,1,1)),f&&f.length>0&&(r=f[0],n>r.row?n=e(n,r.row+r.rowCount):i=r.col),u._canMoveCurrentTo(n,i))return{r:n,c:i}}return{r:n,c:i}},l.prototype._setSelectedRange=function(n,t,i,r,u){this._selectionModel.add(n,t,i,r);u&&!this._paintSuspended&&this._render.repaintSelection()},l.prototype._extendSelectedRange=function(n,t,i){var r=this,u=r._getExtendedRange(n,t,r._activeRowIndex,r._activeColIndex),f=u.row,e=u.col,o=u.rowCount,s=u.colCount,h=r.selectionPolicy(),c=r.selectionUnit();if(h===0)return;else h===1&&r._selectionModel.clear();c===1?(e=-1,s=-1):c===2&&(f=-1,o=-1);r._replaceActiveSelectedRange(f,e,o,s,i)},l.prototype._getExtendedRange=function(n,i,u,f){var e=this,h,c,l,a,o,s;return typeof u===r&&(u=e._activeRowIndex),typeof f===r&&(f=e._activeColIndex),h=new t.Range(u,f,1,1),c=e._spanModel.find(u,f),c&&(h=c),l=new t.Range(n,i,1,1),a=e._spanModel.find(n,i),a&&(l=a),o=h.union(l),s=e.getSpans(),s&&s.length>0&&(o=e._inflateRangeToCoverSpans(s,o)),o},l.prototype._replaceActiveSelectedRange=function(n,i,r,u,f){var o=this,s=o._getActiveSelectedRange(),e,h;if(o._selectionModel.length>0?o._selectionModel.splice(o._selectionModel.activeSelectedRangeIndex,1,new t.Range(n,i,r,u)):o._selectionModel.add(n,i,r,u),f&&!o._paintSuspended){if(e=o._getActiveSelectedRange(),e.row===s.row&&e.col===s.col&&e.rowCount===s.rowCount&&e.colCount===s.colCount)return;h=o._render;s.containsRange(e)?h.repaintSelection(s):e.containsRange(s)?h.repaintSelection(e):(h.repaintSelection(s),h.repaintSelection(e))}},l.prototype._changeActiveSelectedRange=function(n,i){var r=this,e,u,f;if(!(r._selectionModel.length<=0)&&(e=r._getActiveSelectedRange(),u=r._getKeyboardSelectedRange(e,n,i),u)){var o=r._selectionModel.toArray(),s=u.row,h=u.col,c=u.rowCount,l=u.colCount,a=r.selectionPolicy(),v=r.selectionUnit();if(a===0)return;else a===1&&r._selectionModel.clear();v===1?(h=-1,l=-1):v===2&&(s=-1,c=-1);r._replaceActiveSelectedRange(s,h,c,l,!0);f=r._selectionModel.toArray();r._eventHandler._notEqualSelecions(o,f)&&(r._trigger(t.Events.SelectionChanging,{sheet:r,sheetName:r._name,oldSelections:o,newSelections:f}),r._trigger(t.Events.SelectionChanged,{sheet:r,sheetName:r._name}))}},l.prototype._getKeyboardSelectedRange=function(n,t,r,u,f){var e=this,o=e._fixRange(n),s=i;return t===37?s=r?e._searchSelectedRangebyLeftCtrl(o,!1,u,f):e._searchSelectedRangebyLeft(o,u,f):t===39?s=r?e._searchSelectedRangebyRightCtrl(o,!1,u,f):e._searchSelectedRangebyRight(o,u,f):t===38?s=r?e._searchSelectedRangebyUpCtrl(o,!1,u,f):e._searchSelectedRangebyUp(o,u,f):t===40?s=r?e._searchSelectedRangebyDownCtrl(o,!1,u,f):e._searchSelectedRangebyDown(o,u,f):t===36?s=r?e._searchSelectedRangebyHomeCtrl(o,u,f):e._searchSelectedRangebyHome(o,u,f):t===35?s=r?e._searchSelectedRangebyEndCtrl(o,u,f):e._searchSelectedRangebyEnd(o,u,f):t===33?s=e._searchSelectedRangebyPageUp(o,u,f):t===34&&(s=e._searchSelectedRangebyPageDown(o,u,f)),s&&(n.row<0&&(s.row=-1,s.rowCount=-1),n.col<0&&(s.col=-1,s.colCount=-1)),s},l.prototype._searchSelectedRangebyLeft=function(n,r,u){for(var s=this,h=n.col+n.colCount-1,k=0,w={r:n.row+n.rowCount-1,c:h},o,l,c,b,v,y,p,a;h>k;)if((h--,s._canMoveCurrentTo(w.r,h))&&(o=s._getExtendedRange(w.r,h,r,u),l=f(n.row,o.row),c=f(n.col,o.col),b=e(n.row+n.rowCount-1,o.row+o.rowCount-1),v=f(n.col+n.colCount-1,o.col+o.colCount-1),y=b-l+1,p=v-c+1,!(l===n.row&&c===n.col&&y===n.rowCount&&p===n.colCount)))return a=s._getPrevVisualColumn(s._scrollLeftCol),(c===a||v===a)&&s._setLeftColumn(a),new t.Range(l,c,y,p);return i},l.prototype._searchSelectedRangebyLeftCtrl=function(n,r,o,s){var h=this,k=h.frozenColCount?h._getNextVisualColumn(h.frozenColCount-1):h._getFirstVisualColumn(),l=r?k:h._getFirstVisualColumn(),c,a,v,y,p,w,b;if(l===u||l===i)return;else(h.frozenColCount<=0||r)&&h._setLeftColumn(l);return c=h._getExtendedRange(n.row,l,o,s),a=f(n.row,c.row),v=f(n.col,c.col),y=e(n.row+n.rowCount-1,c.row+c.rowCount-1),p=f(n.col+n.colCount-1,c.col+c.colCount-1),w=y-a+1,b=p-v+1,new t.Range(a,v,w,b)},l.prototype._searchSelectedRangebyRight=function(n,r,o){for(var s=this,a=n.col,g=s.getColumnCount()-1,k={r:n.row+n.rowCount-1,c:a},h,v,c,d,y,p,w,l,b;a<g;)if((a++,s._canMoveCurrentTo(k.r,a))&&(h=s._getExtendedRange(k.r,a,r,o),v=f(n.row,h.row),c=e(n.col,h.col),d=e(n.row+n.rowCount-1,h.row+h.rowCount-1),y=e(n.col+n.colCount-1,h.col+h.colCount-1),p=d-v+1,w=y-c+1,!(v===n.row&&c===n.col&&p===n.rowCount&&w===n.colCount)))return l=s.frozenColCount?s._getNextVisualColumn(s.frozenColCount-1):i,b=s._getPageRightColumn(),l!==u&&l!==i&&(c===l||y===l)?s._setLeftColumn(l):(c===b||y===b)&&s._setLeftColumn(s._getNextVisualColumn(s._scrollLeftCol)),new t.Range(v,c,p,w);return i},l.prototype._searchSelectedRangebyRightCtrl=function(n,r,o,s){var c=this,l=c._getLastPageLeftColumn(),a,h,v,y,p,w,b,k;if(l===u||l===i)return;else c._setLeftColumn(l);return a=c._getLastVisualColumn(),r||(a+=c._frozenTrailingColCount),h=c._getExtendedRange(n.row,a,o,s),v=f(n.row,h.row),y=e(n.col,h.col),p=e(n.row+n.rowCount-1,h.row+h.rowCount-1),w=e(n.col+n.colCount-1,h.col+h.colCount-1),b=p-v+1,k=w-y+1,new t.Range(v,y,b,k)},l.prototype._searchSelectedRangebyUp=function(n,r,u){for(var s=this,h=n.row+n.rowCount-1,k=0,w={r:h,c:n.col+n.colCount-1},o,c,l,v,b,y,p,a;h>k;)if((h--,s._canMoveCurrentTo(h,w.c))&&(o=s._getExtendedRange(h,w.c,r,u),c=f(n.row,o.row),l=f(n.col,o.col),v=f(n.row+n.rowCount-1,o.row+o.rowCount-1),b=e(n.col+n.colCount-1,o.col+o.colCount-1),y=v-c+1,p=b-l+1,!(c===n.row&&l===n.col&&y===n.rowCount&&p===n.colCount)))return a=s._getPrevVisualRow(s._scrollTopRow),(c===a||v===a)&&s._setTopRow(a),new t.Range(c,l,y,p);return i},l.prototype._searchSelectedRangebyUpCtrl=function(n,r,o,s){var h=this,k=h.frozenRowCount?h._getNextVisualRow(h.frozenRowCount-1):h._getFirstVisualRow(),l=r?k:h._getFirstVisualRow(),c,a,v,y,p,w,b;if(l===u||l===i)return;else(h.frozenRowCount<=0||r)&&h._setTopRow(l);return c=h._getExtendedRange(l,n.col,o,s),a=f(n.row,c.row),v=f(n.col,c.col),y=f(n.row+n.rowCount-1,c.row+c.rowCount-1),p=e(n.col+n.colCount-1,c.col+c.colCount-1),w=y-a+1,b=p-v+1,new t.Range(a,v,w,b)},l.prototype._searchSelectedRangebyDown=function(n,r,o){for(var s=this,a=n.row,g=s.getRowCount()-1,k={r:a,c:n.col+n.colCount-1},h,c,v,y,d,p,w,l,b;a<g;)if(a++,s._canMoveCurrentTo(a,k.c))if(h=s._getExtendedRange(a,k.c,r,o),c=e(n.row,h.row),v=f(n.col,h.col),y=e(n.row+n.rowCount-1,h.row+h.rowCount-1),d=e(n.col+n.colCount-1,h.col+h.colCount-1),p=y-c+1,w=d-v+1,c===n.row&&v===n.col&&p===n.rowCount&&w===n.colCount)continue;else return l=s.frozenRowCount?s._getNextVisualRow(s.frozenRowCount-1):i,b=s._getPageBottomRow(),l!==u&&l!==i&&(c===l||y===l)?s._setTopRow(l):(c===b||y===b)&&s._setTopRow(s._getNextVisualRow(s._scrollTopRow)),new t.Range(c,v,p,w);return i},l.prototype._searchSelectedRangebyDownCtrl=function(n,r,o,s){var c=this,l=c._getLastPageTopRow(),a,h,v,y,p,w,b,k;if(l===u||l===i)return;else c._setTopRow(l);return a=c._getLastVisualRow(),r||(a+=c._frozenTrailingRowCount),h=c._getExtendedRange(a,n.col,o,s),v=e(n.row,h.row),y=f(n.col,h.col),p=e(n.row+n.rowCount-1,h.row+h.rowCount-1),w=e(n.col+n.colCount-1,h.col+h.colCount-1),b=p-v+1,k=w-y+1,new t.Range(v,y,b,k)},l.prototype._searchSelectedRangebyHome=function(n,r,u){for(var o=this,h=o.frozenColCount?o.frozenColCount-1:-1,b=o._activeColIndex,a={r:n.row+n.rowCount-1,c:n.col},s,c,l,v,y,p,w;h<b;)if(h++,o._canMoveCurrentTo(a.r,h)){if(n.col<=h&&n.col+n.colCount-1===o._activeColIndex)break;return s=o._getExtendedRange(a.r,h,r,u),c=f(n.row,s.row),l=f(n.col,s.col),v=e(n.row+n.rowCount-1,s.row+s.rowCount-1),y=f(n.col+n.colCount-1,s.col+s.colCount-1),p=v-c+1,w=y-l+1,o._setLeftColumn(o._getFirstVisualColumn()),new t.Range(c,l,p,w)}return i},l.prototype._searchSelectedRangebyHomeCtrl=function(n,t,i){return n=this._searchSelectedRangebyLeftCtrl(n,!0,t,i),this._searchSelectedRangebyUpCtrl(n,!0,t,i)},l.prototype._searchSelectedRangebyEnd=function(n,r,u){for(var o=this,h=o.getColumnCount(),b=o._activeColIndex,a={r:n.row+n.rowCount-1,c:n.col+n.colCount-1},s,c,l,v,y,p,w;h>b;)if(h--,o._canMoveCurrentTo(a.r,h)){if(n.col+n.colCount-1>=h&&n.col===o._activeColIndex)break;return s=o._getExtendedRange(a.r,h,r,u),c=f(n.row,s.row),l=e(n.col,s.col),v=e(n.row+n.rowCount-1,s.row+s.rowCount-1),y=e(n.col+n.colCount-1,s.col+s.colCount-1),p=v-c+1,w=y-l+1,o._setLeftColumn(o._getLastPageLeftColumn()),new t.Range(c,l,p,w)}return i},l.prototype._searchSelectedRangebyEndCtrl=function(n,t,i){return n=this._searchSelectedRangebyRightCtrl(n,!0,t,i),this._searchSelectedRangebyDownCtrl(n,!0,t,i)},l.prototype._searchSelectedRangebyPageUp=function(n,r,o){var s=this,l=s._getPrevPageTopRow(),c,a,v,y,p,w,b;if(l===u||l===i)return i;var k=s._getRowLayout(1),d=s._setTopRow(l),h=-1;return d?h=s._getNextVisualRow(n.row+n.rowCount-1-k.length):s.frozenRowCount<=0&&(h=s._getFirstVisualRow()),h<s._scrollTopRow?h=s._scrollTopRow:h>=s._getPageBottomRow()&&(h=s._getPrevVisualRow(s._getPageBottomRow())),c=s._getExtendedRange(h,n.col,r,o),a=f(n.row,c.row),v=f(n.col,c.col),y=f(n.row+n.rowCount-1,c.row+c.rowCount-1),p=e(n.col+n.colCount-1,c.col+c.colCount-1),w=y-a+1,b=p-v+1,new t.Range(a,v,w,b)},l.prototype._searchSelectedRangebyPageDown=function(n,r,o){var s=this,l=s._getNextPageTopRow(),y,c,h,a,v,p,w,b,k;return l===u||l===i?i:(y=s._getRowLayout(1),s._setTopRow(l),c=s._getPrevVisualRow(n.row+n.rowCount-1+y.length),c<s._scrollTopRow?c=s._scrollTopRow:c>=s._getPageBottomRow()&&(c=s._scrollTopRow>=s._getLastPageTopRow()?s._getPageBottomRow():s._getPrevVisualRow(s._getPageBottomRow())),h=s._getExtendedRange(c,n.col,r,o),a=e(n.row,h.row),v=f(n.col,h.col),p=e(n.row+n.rowCount-1,h.row+h.rowCount-1),w=e(n.col+n.colCount-1,h.col+h.colCount-1),b=p-a+1,k=w-v+1,new t.Range(a,v,b,k))},l.prototype._getPrevPageTopRow=function(){var n=this,r=n._getRowLayout(1);if(!r||r.length<=0)return i;for(var f=n.frozenRowCount?n._getNextVisualRow(n.frozenRowCount-1):n._getFirstVisualRow(),u=0,t=n._scrollTopRow,e=n._getSheetLayout();t>f;){if(u+=n._getZoomRowHeight(t),u>e.viewportHeight)break;t--}return t},l.prototype._getPrevPageLeftColumn=function(){var n=this,r=n._getColumnLayout(1);if(!r||r.length<=0)return i;for(var f=n.frozenColCount?n._getNextVisualColumn(n.frozenColCount-1):n._getFirstVisualColumn(),u=0,t=n._scrollLeftCol,e=n._getSheetLayout();t>f;){if(u+=n._getZoomColumnWidth(t),u>e.viewportWidth)break;t--}return t},l.prototype._getNextPageTopRow=function(){var n=this._getRowLayout(1);return!n||n.length<=0?i:this._getLastVisualRow()===n[n.length-1].row?this._scrollTopRow:n[n.length-1].row},l.prototype._getLastPageTopRow=function(){var n=this,i,t,r,u,f;if(n._getLastVisualRow()===n._getPageBottomRow()&&(i=n._getSheetLayout(),t=n._getRowLayout(1),t&&t.length>=1&&(r=t[t.length-1],r.y+r.height<=i.viewportY+i.viewportHeight)))return n._scrollTopRow;u=n._scrollTopRow;try{return n._scrollTopRow=n._getLastVisualRow(),f=n._getPrevPageTopRow(),n._getNextVisualRow(f)}catch(e){}finally{n._scrollTopRow=u}},l.prototype._getLastPageLeftColumn=function(){var n=this,i,r,u,f,t;if(n._getLastVisualColumn()===n._getPageRightColumn()&&(i=n._getSheetLayout(),r=n._getColumnLayout(1),r&&r.length>=1&&(u=r[r.length-1],u.x+u.width<=i.viewportX+i.width)))return n._scrollLeftCol;for(i=n._getSheetLayout(),f=0,t=n._getLastVisualColumn();t>0;){if(f+=n._getZoomColumnWidth(t),f>i.viewportWidth)break;t--}return t>0&&(t=n._getNextVisualColumn(t)),t},l.prototype._getPageBottomRow=function(){var n=this._getRowLayout(1);return!n||n.length<=0?i:n[n.length-1].row},l.prototype._getPageRightColumn=function(){var n=this._getColumnLayout(1);return!n||n.length<=0?i:n[n.length-1].col},l.prototype._getLastFullyVisibleRow=function(){var n=this._getRowLayout(1),r,t;return!n||n.length<=0?i:(r=this._getSheetLayout(),t=n.length-1,n[t].y+n[t].height<=r.viewportY+r.viewportHeight?n[t].row:n[e(t-1,0)].row)},l.prototype._getLastFullyVisibleColumn=function(){var n=this._getColumnLayout(1),r,t;return!n||n.length<=0?i:(r=this._getSheetLayout(),t=n.length-1,n[t].x+n[t].width<=r.viewportX+r.viewportWidth?n[t].col:n[e(t-1,0)].col)},l.prototype._getFirstVisualRow=function(){return this._getNextVisualRow(-1)},l.prototype._getLastVisualRow=function(n){(n===u||n===i)&&(n=3);var t=this.getRowCount(n);return(n===3||n===2)&&(t=t-this._frozenTrailingRowCount),this._getPrevVisualRow(t,n)},l.prototype._getFirstVisualColumn=function(){return this._getNextVisualColumn(-1)},l.prototype._getLastVisualColumn=function(n){(n===u||n===i)&&(n=3);var t=this.getColumnCount(n);return(n===3||n===1)&&(t=t-this._frozenTrailingColCount),this._getPrevVisualColumn(t,n)},l.prototype._getFirstPageLeftColumn=function(){var n=this,t=isNaN(n.frozenColCount)?0:n.frozenColCount;return t>0?n._getNextVisualColumn(t-1):n._getFirstVisualColumn()},l.prototype._getFirstPageTopRow=function(){var n=this,t=isNaN(n.frozenRowCount)?0:n.frozenRowCount;return t>0?n._getNextVisualRow(t-1):n._getFirstVisualRow()},l.prototype._getNextVisualRow=function(n,t){for(var r=this,u=t?r.getRowCount()-1:r.getRowCount()-1-r._frozenTrailingRowCount;n<u;)if(n++,r.getRowVisible(n)&&r._getZoomRowHeight(n)>0)return n;return i},l.prototype._getPrevVisualRow=function(n,t,r){for(var u=r?0:this.frozenRowCount;n>u;)if(n--,this.getRowVisible(n,t)&&this._getZoomRowHeight(n,t)>0)return n;return i},l.prototype._getNextVisualColumn=function(n){for(var t=this,r=t.getColumnCount()-1-t._frozenTrailingColCount;n<r;)if(n++,t.getColumnVisible(n)&&t._getZoomColumnWidth(n)>0)return n;return i},l.prototype._getPrevVisualColumn=function(n,t){while(n>this.frozenColCount)if(n--,this.getColumnVisible(n,t)&&this._getZoomColumnWidth(n,t)>0)return n;return i},l.prototype._inflateRangeToCoverSpans=function(n,t){var r,i;if(n&&n.length>0)for(r=0;r<n.length;r++)if(i=n[r],t.intersect(i.row,i.col,i.rowCount,i.colCount))return n.splice(r--,1),this._inflateRangeToCoverSpans(n,t.union(i));return t},l.prototype._getActiveSelectedRange=function(n){var i=this,r=new t.Range(-1,-1,0,0);return i._selectionModel.length<=0?r:(n===3?(i._selectionModel.activeSelectedRangeIndex--,i._selectionModel.activeSelectedRangeIndex<0&&(i._selectionModel.activeSelectedRangeIndex=i._selectionModel.length-1)):n===4&&(i._selectionModel.activeSelectedRangeIndex++,i._selectionModel.activeSelectedRangeIndex>=i._selectionModel.length&&(i._selectionModel.activeSelectedRangeIndex=0)),i._selectionModel.activeSelectedRangeIndex>=0&&(r=i._selectionModel[i._selectionModel.activeSelectedRangeIndex]),r)},l.prototype._initializeActiveCell=function(){var n=this,o=n._activeRowIndex,s=n._activeColIndex,t=n._selectionModel,h;if(o===u||o===i||s===u||s===i||t.length<=0){var r=0,f=0,e=n._spanModel.find(r,f);e?(t.add(r,f,e.rowCount,e.colCount),n._activeRowIndex=r,n._activeColIndex=f,n._activeRowCount=e.rowCount,n._activeColCount=e.colCount):(t.add(r,f,1,1),n._activeRowIndex=r,n._activeColIndex=f,n._activeRowCount=1,n._activeColCount=1);t.length>0&&!n._paintSuspended&&(h=t[0],n._render.repaintSelection(h))}},l.prototype._setHoverCell=function(n){var u=this,o=!1,r=u._currentTarget,s,h,f;if(r||(o=!0),o||n||(o=!0),o||(o=n.col!==r.col||n.row!==r.row||n.colViewportIndex!==r.colViewportIndex||n.rowViewportIndex!==r.rowViewportIndex||n.hitTestType!==r.hitTestType),u._currentTarget=n,o){u._hoverCell=!0;var e=u._getSheetLayout(),c=u._render,t=i;r&&(r.rowViewportIndex<0||r.colViewportIndex<0)&&(t=u.getCellRect(r.row,r.col,r.rowViewportIndex,r.colViewportIndex),t&&t.width>0&&t.height>0&&(s=0,h=0,f=u._getGroupLayout(),f&&(s=f.width,h=f.height),(t.x<e.rowHeaderWidth+s||t.y<e.colHeaderHeight+h||t.y>=e.height-e.footerHeight)&&c.update(t.x,t.y,t.width,t.height)));n&&(n.rowViewportIndex<0||n.colViewportIndex<0)&&(t=u.getCellRect(n.row,n.col,n.rowViewportIndex,n.colViewportIndex),t&&t.width>0&&t.height>0&&(s=0,h=0,f=u._getGroupLayout(),f&&(s=f.width,h=f.height),(t.x<e.rowHeaderWidth+s||t.y<e.colHeaderHeight+h||t.y>=e.height-e.footerHeight)&&c.update(t.x,t.y,t.width,t.height)));u._hoverCell=!1}},l.prototype._getAvailableActiveCell=function(n,t,i){var r=this._skipSpanCell(n,t,i);return this._skipInvisibleCell(r)},l.prototype._skipSpanCell=function(n,i,r){var u=this._spanModel.find(n,i);if(u){if(r&&u.rowCount===1||!r&&u.colCount===1)return u}else return new t.Range(n,i,1,1);return r?i++:n++,this._skipSpanCell(n,i,r)},l.prototype._skipInvisibleCell=function(n){for(var r=this,f=n.row,o=r.getRowCount(),u,e,i=f;i<o;i++)if(r.getRowVisible(i)===!0)break;for(i<o&&(f=i),u=n.col,e=r.getColumnCount(),i=u;i<e;i++)if(r.getColumnVisible(i)===!0)break;return i<e&&(u=i),new t.Range(f,u,n.rowCount,n.colCount)},l.prototype._processKeyMap=function(n){var u=n.ctrlKey,f=n.shiftKey,e=n.altKey,o=n.metaKey,s=n.keyCode,i=this._getKeyAction(s,u,f,e,o),r;return i&&typeof i.action===c?(r=i.action.call(this),r&&t.util.cancelDefault(n),r):!1},l.prototype._processFloatingObjectsKeyMap=function(n){var e,r,u,c;if(!t.features.floatingObject||(e=n.keyCode===90&&n.ctrlKey===!0||n.keyCode===89&&n.ctrlKey===!0,e))return!1;var i=this,o=i._eventHandler,s=n.keyCode===86&&n.ctrlKey===!0,l=i._getFloatingObjectClipboardHelper(),h=l.fromSheet,f=h&&h._eventHandler;return((o||f)&&(r=o._getClipboardFloatingObjectData(),!r&&f&&(r=f._getClipboardFloatingObjectData()),r&&r.length||(s=!1)),(i._hasFloatingObjectsSelected()||s)&&(u=i._getFloatingObjectKeyAction(n.keyCode,n.ctrlKey,n.shiftKey,n.altKey,n.metaKey),u&&u.action))?(c=u.action.call(i),c&&t.util.cancelDefault(n),!0):!1},l.prototype._processCommentKeyMap=function(n){var f,i,u,r,e;if(!t.features.comment||(f=n.keyCode===90&&n.ctrlKey===!0||n.keyCode===89&&n.ctrlKey===!0,f))return!1;if(i=this,u=i._commentManager.getActiveComment(),u){if(n.keyCode===9)return!0;if(r=i._getCommentKeyAction(n.keyCode,n.ctrlKey,n.shiftKey,n.altKey,n.metaKey),r&&r.action)return e=r.action.call(i),e&&t.util.cancelDefault(n),!0;else if(i._eventHandler.allowEnterEditing(n))return u.commentState(2),!0}return!1},l.prototype._hasFloatingObjectsSelected=function(){var f=this,n=f._floatingObjectArray,i,r,u;if(t.features.floatingObject&&n&&n.length>0)for(i=0,r=n.length;i<r;i++)if(u=n[i],u.isSelected())return!0;return!1},l.prototype._getRowInfos=function(n){var t,u,f;if((typeof n===r||n===i)&&(n=3),t=this,n===3||n===2)return u=t._rowInfos,u||(t._rowInfos=u={}),u;else if(n===1)return f=t._colHeaderRowInfos,f||(t._colHeaderRowInfos=f={}),f;return i},l.prototype._getZoomRowHeight=function(n,t){var i=this.getRowHeight(n,t),r=this._zoomFactor;return r!==1&&(i*=r),o(i)},l.prototype._getColumnInfos=function(n){var t=this,u,f;if((typeof n===r||n===i)&&n===3,n===3||n===1)return u=t._colInfos,u||(t._colInfos=u={}),u;else if(n===2)return f=t._rowHeaderColInfos,f||(t._rowHeaderColInfos=f={}),f;return i},l.prototype._getZoomColumnWidth=function(n,t){var i=this.getColumnWidth(n,t),r=this._zoomFactor;return r!==1&&(i*=r),o(i)},l.prototype._getGroupLayout=function(){var n=this;return n._cachedGroupLayout||(n._cachedGroupLayout=n._createGroupLayout()),n._cachedGroupLayout},l.prototype._getGroupButtonWidth=function(){return 17},l.prototype._getGroupButtonHeight=function(){return 17},l.prototype._getGroupPadding=function(){return 2},l.prototype._createGroupLayout=function(){var t={x:0,y:0,width:0,height:0,rowMaxLevel:-1,colMaxLevel:-1},n=this,o=n._getGroupButtonWidth(),s=n._getGroupButtonHeight(),h=n._getGroupPadding(),u=n.rowRangeGroup,e=n.colRangeGroup,v=n._showRowRangeGroup,y=n._showColumnRangeGroup,c=n._zoomFactor,i,l,r,a;return v&&u&&!u._isEmpty()&&(i=u.getMaxLevel(),i>=0&&(l=f(o,o*c),t.width=l*(i+2)+h*2,t.rowMaxLevel=i)),y&&e&&!e._isEmpty()&&(r=e.getMaxLevel(),r>=0&&(a=f(s,s*c),t.height=a*(r+2)+h*2,t.colMaxLevel=r)),t},l.prototype._createLayout=function(){var r=this,c=new t.Rect(r._bounds.x+r.borderWidth,r._bounds.y+r.borderWidth,e(0,r._bounds.width-2*r.borderWidth),e(0,r._bounds.height-2*r.borderWidth)),a=c.width,l=c.height,n={x:c.x,y:c.y,width:c.width,height:c.height,rowHeaderWidth:0,colHeaderHeight:0,frozenWidth:0,frozenHeight:0,frozenTrailingWidth:0,frozenTrailingHeight:0,footerHeight:0,footerWidth:0,footerX:0,footerY:0,frozenX:0,frozenY:0,frozenTrailingX:0,frozenTrailingY:0,viewportX:0,viewportY:0,viewportHeight:0,viewportWidth:0,headerX:0,headerY:0,headerCornerRect:function(){var n=this;return new t.Rect(n.x,n.y,n.rowHeaderWidth,n.colHeaderHeight)},colHeaderRect:function(n){var r=this;return n===0?new t.Rect(r.frozenX,r.y,r.frozenWidth,r.colHeaderHeight):n===1?new t.Rect(r.viewportX,r.y,r.viewportWidth,r.colHeaderHeight):n===2?new t.Rect(r.frozenTrailingX,r.y,r.frozenTrailingWidth,r.colHeaderHeight):i},rowHeaderRect:function(n){var r=this;return n===0?new t.Rect(r.x,r.frozenY,r.rowHeaderWidth,r.frozenHeight):n===1?new t.Rect(r.x,r.viewportY,r.rowHeaderWidth,r.viewportHeight):n===2?new t.Rect(r.x,r.frozenTrailingY,r.rowHeaderWidth,r.frozenTrailingHeight):i},viewportRect:function(n,r){var u=this;return n===0?r===0?new t.Rect(u.frozenX,u.frozenY,u.frozenWidth,u.frozenHeight):r===1?new t.Rect(u.viewportX,u.frozenY,u.viewportWidth,u.frozenHeight):r===2?new t.Rect(u.frozenTrailingX,u.frozenY,u.frozenTrailingWidth,u.frozenHeight):i:n===1?r===0?new t.Rect(u.frozenX,u.viewportY,u.frozenWidth,u.viewportHeight):r===1?new t.Rect(u.viewportX,u.viewportY,u.viewportWidth,u.viewportHeight):r===2?new t.Rect(u.frozenTrailingX,u.viewportY,u.frozenTrailingWidth,u.viewportHeight):i:n===2?r===0?new t.Rect(u.frozenX,u.frozenTrailingY,u.frozenWidth,u.frozenTrailingHeight):r===1?new t.Rect(u.viewportX,u.frozenTrailingY,u.viewportWidth,u.frozenTrailingHeight):r===2?new t.Rect(u.frozenTrailingX,u.frozenTrailingY,u.frozenTrailingWidth,u.frozenTrailingHeight):i:i},footerRect:function(n){var r=this;return n===0?new t.Rect(r.frozenX,r.footerY,r.frozenWidth,r.footerHeight):n===1?new t.Rect(r.viewportX,r.footerY,r.viewportWidth,r.footerHeight):n===2?new t.Rect(r.frozenTrailingX,r.footerY,r.frozenTrailingWidth,r.footerHeight):i},footerCornerRect:function(){var n=this;return new t.Rect(n.footerX,n.footerY,n.footerWidth,n.footerHeight)}},v=r._getGroupLayout(),f,s,o,h;if(n.x+=v.width,n.y+=v.height,a-=v.width,l-=v.height,r.rowHeaderVisible===i||r.rowHeaderVisible===u||r.rowHeaderVisible)for(h=r.getColumnCount(2),o=0;o<h;o++)n.rowHeaderWidth+=r._getZoomColumnWidth(o,2);if(r.colHeaderVisible===i||r.colHeaderVisible===u||r.colHeaderVisible)for(s=r.getRowCount(1),f=0;f<s;f++)n.colHeaderHeight+=r._getZoomRowHeight(f,1);if(r.frozenColCount>0)for(h=r.getColumnCount(),o=0;o<r.frozenColCount&&o<h;o++)r.getColumnVisible(o)&&(n.frozenWidth+=r._getZoomColumnWidth(o));if(r.frozenRowCount>0)for(s=r.getRowCount(),f=0;f<r.frozenRowCount&&f<s;f++)r.getRowVisible(f)&&(n.frozenHeight+=r._getZoomRowHeight(f));if(r._frozenTrailingColCount>0)for(h=r.getColumnCount(),o=e(r.frozenColCount,h-r._frozenTrailingColCount);o<h;o++)n.frozenTrailingWidth+=r._getZoomColumnWidth(o);if(r._frozenTrailingRowCount>0)for(s=r.getRowCount(),f=e(r.frozenRowCount,s-r._frozenTrailingRowCount);f<s;f++)n.frozenTrailingHeight+=r._getZoomRowHeight(f);return a-=n.rowHeaderWidth,l-=n.colHeaderHeight,a-=n.frozenWidth,l-=n.frozenHeight,a-=n.frozenTrailingWidth,l-=n.frozenTrailingHeight,l-=n.footerHeight,n.viewportWidth=e(0,a),n.viewportHeight=e(0,l),n.headerX=n.x,n.headerY=n.y,n.frozenX=n.headerX+n.rowHeaderWidth,n.frozenY=n.headerY+n.colHeaderHeight,n.viewportX=n.frozenX+n.frozenWidth,n.viewportY=n.frozenY+n.frozenHeight,n.frozenTrailingX=n.viewportX+n.viewportWidth,n.frozenTrailingY=n.viewportY+n.viewportHeight,n.footerX=n.headerX,n.footerY=n.y+n.height-n.footerHeight,n},l.prototype._getSheetLayout=function(){var n=this;return n._layoutModel||(n._layoutModel=n._createLayout()),n._layoutModel},l.prototype._getColumnLayout=function(n,t){if(typeof t===r||t===i||t===3||t===1)return this._getViewportColumnLayout(n);else if(t===2)return this._getRowHeaderColumnLayout();return i},l.prototype._getRowHeaderColumnLayout=function(){var n=this;return n._colLayoutCache.rowHeader||(n._colLayoutCache.rowHeader=n._createRowHeaderColumnLayout()),n._colLayoutCache.rowHeader},l.prototype._getViewportColumnLayout=function(n){var t=this;return t._colLayoutCache.viewport||(t._colLayoutCache.viewport={}),t._colLayoutCache.viewport[n]||(t._colLayoutCache.viewport[n]=t._createViewportColumnLayout(n)),t._colLayoutCache.viewport[n]},l.prototype._createRowHeaderColumnLayout=function(){for(var r=new t._LayoutModel,f=this._getSheetLayout(),u=f.headerX,i,e=this.getColumnCount(2),n=0;n<e;n++)i=this._getZoomColumnWidth(n,2),r.push(new t._Layout(-1,n,u,-1,i,-1)),u+=i;return r},l.prototype._createViewportColumnLayout=function(n){var r=this,h=new t._LayoutModel,c=r._getSheetLayout(),s=r.getColumnCount(),i,o,u,l=r._cachePool,a,v;if(n===0)for(o=c.frozenX,s=isNaN(r.frozenColCount)?0:f(r.frozenColCount,s),i=0;i<s;i++)u=l.getCachedColumn(i).width,h.push(new t._Layout(-1,i,o,-1,u,-1)),o+=u;else if(n===1)for(o=c.viewportX,s=s-r._frozenTrailingColCount,a=c.viewportWidth,v=e(r.frozenColCount,r._scrollLeftCol),i=v;a>0&&i<s;i++)u=l.getCachedColumn(i).width,h.push(new t._Layout(-1,i,o,-1,u,-1)),o+=u,a-=u;else if(n===2)for(o=c.frozenTrailingX,i=e(r.frozenColCount,s-r._frozenTrailingColCount);i<s;i++)u=l.getCachedColumn(i).width,h.push(new t._Layout(-1,i,o,-1,u,-1)),o+=u;return h},l.prototype._getRowLayout=function(n,t){if(typeof t===r||t===i||t===3||t===2)return this._getViewportRowLayout(n);else if(t===1)return this._getColumnHeaderRowLayout();return i},l.prototype._getAllRowLayout=function(n){for(var i,r=new t._LayoutModel,u=0;u<3;u++)i=this._getRowLayout(u,n),i&&i.length>0&&(r=$.merge(r,i));return r},l.prototype._getAllColumnLayout=function(n){for(var i,r=new t._LayoutModel,u=0;u<3;u++)i=this._getColumnLayout(u,n),i&&i.length>0&&(r=$.merge(r,i));return r},l.prototype._getColumnHeaderRowLayout=function(){var n=this;return n._rowLayoutCache.colHeader||(n._rowLayoutCache.colHeader=n._createColumnHeaderRowLayout()),n._rowLayoutCache.colHeader},l.prototype._getViewportRowLayout=function(n){var t=this;return t._rowLayoutCache.viewport||(t._rowLayoutCache.viewport={}),t._rowLayoutCache.viewport[n]||(t._rowLayoutCache.viewport[n]=t._createViewportRowLayout(n)),t._rowLayoutCache.viewport[n]},l.prototype._createColumnHeaderRowLayout=function(){for(var r=new t._LayoutModel,f=this._getSheetLayout(),u=f.headerY,i,e=this.getRowCount(1),n=0;n<e;n++)i=this._getZoomRowHeight(n,1),r.push(new t._Layout(n,-1,-1,u,-1,i)),u+=i;return r},l.prototype._createViewportRowLayout=function(n){var r=this,h=new t._LayoutModel,c=r._getSheetLayout(),s=r.getRowCount(),i,o,u,l=r._cachePool,a,v;if(n===0)for(o=c.frozenY,s=isNaN(r.frozenRowCount)?0:f(r.frozenRowCount,s),i=0;i<s;i++)u=l.getCachedRow(i).height,h.push(new t._Layout(i,-1,-1,o,-1,u)),o+=u;else if(n===1)for(o=c.viewportY,s=s-r._frozenTrailingRowCount,a=c.viewportHeight,v=e(r.frozenRowCount,r._scrollTopRow),i=v;a>0&&i<s;i++)u=l.getCachedRow(i).height,h.push(new t._Layout(i,-1,-1,o,-1,u)),o+=u,a-=u;else if(n===2)for(o=c.frozenTrailingY,i=e(r.frozenRowCount,s-r._frozenTrailingRowCount);i<s;i++)u=l.getCachedRow(i).height,h.push(new t._Layout(i,-1,-1,o,-1,u)),o+=u;return h},l.prototype._getCellLayout=function(n,i,r){var u=this,v=u.getRowCount(r),y=u.getColumnCount(r),f=u._getRowLayout(n,r),e=u._getColumnLayout(i,r),c=new t._LayoutModel;if(f&&f.length>0&&e&&e.length>0){var o=f[0].row,s=e[0].col,l=f[f.length-1].row,a=e[e.length-1].col,h=u.getSpans(new t.Range(o,s,l-o+1,a-s+1),r);h&&h.length>0&&u._addCellLayout(h,o,s,l,a,c,v,y,r,f,e)}return c},l.prototype._getCellLayoutByCell=function(n,r,u,f,e){var o=this,v=o.getRowCount(u),y=o.getColumnCount(u),h=o._getRowLayout(n,u),c=o._getColumnLayout(r,u),l=new t._LayoutModel,a;if(h&&h.length>0&&c&&c.length>0){var p=h[0].row,w=c[0].col,s=o.getSpan(f,e,u);return(s&&(a=[],a.push(s),o._addCellLayout(a,p,w,s.row+s.rowCount,s.col+s.colCount,l,v,y,u,h,c)),l.length>0)?l[0]:i}return i},l.prototype._addCellLayout=function(n,i,r,u,f,e,o,s,h,c,l){var ot=n.length,ut,v,ft,et,a;if(!(ot<=0)){var w=this,b=u+1,k=f+1,y=new Array(b),p=new Array(k),nt=new Array(k),tt=new Array(b),d=0,g=0;for(a=i-1;a>=0;a--)y[a]=w._getZoomRowHeight(a,h),g-=y[a],tt[a]=g;for(g=0,a=i;a<b;a++)tt[a]=g,y[a]=w._getZoomRowHeight(a,h),g+=y[a];for(a=r-1;a>=0;a--)p[a]=w._getZoomColumnWidth(a,h),d-=p[a],nt[a]=d;for(d=0,a=r;a<k;a++)nt[a]=d,p[a]=w._getZoomColumnWidth(a,h),d+=p[a];for(ut=0;ut<ot;ut++)if(v=n[ut],v.intersect(i,r,u-i+1,f-r+1)){if(ft=v.row+v.rowCount,ft>b){for(a=b;a<ft;a++)y.push(w._getZoomRowHeight(a,h)),tt.push(tt[a-1]+y[a]);b=ft}if(et=v.col+v.colCount,et>k){for(a=k;a<et;a++)p.push(w._getZoomColumnWidth(a,h)),nt.push(nt[a-1]+p[a]);k=et}for(var d=nt[v.col],g=tt[v.row],st=0,ht=0,it,rt=v.col;rt<v.col+v.colCount&&rt<s;rt++)st+=p[rt];for(it=v.row;it<v.row+v.rowCount&&it<o;it++)ht+=y[it];e.push(new t._Layout(v.row,v.col,l[0].x+d,c[0].y+g,st,ht,v.rowCount,v.colCount))}}},l.prototype._getRowViewportIndexNearY=function(n){var t=this._getSheetLayout();return this.frozenRowCount>0&&n<t.frozenY+t.frozenHeight?0:this._frozenTrailingRowCount>0&&n>t.frozenTrailingY?2:1},l.prototype._getColumnViewportIndexNearX=function(n){var t=this._getSheetLayout();return this.frozenColCount>0&&n<t.frozenX+t.frozenWidth?0:this._frozenTrailingColCount>0&&n>t.frozenTrailingX?2:1},l.prototype._getViewportColumnLayoutNearX=function(n,t){var r=this._getColumnLayout(n);return r?r.findNearX(t):i},l.prototype._getViewportRowLayoutNearY=function(n,t){var r=this._getRowLayout(n);return r?r.findNearY(t):i},l.prototype._syncHScollbarPosition=function(){var n=this,t=n.parent,i=n._getScrollableColumn(n._scrollLeftCol);i!=-1&&i!=n._scrollLeftCol&&(n._scrollLeftCol=i);t&&t._scrollbarH&&t._scrollbarH.value(n._scrollLeftCol)},l.prototype._syncVScrollbarPosition=function(){var n=this,t=n.parent,i=n._getScrollableRow(n._scrollTopRow);i!==-1&&i!=n._scrollTopRow&&(n._scrollTopRow=i);t&&t._scrollbarV&&t._scrollbarV.value(n._scrollTopRow)},l.prototype._syncScrollbarSize=function(){var n=this;n.parent&&n.parent._resizeScrollBar&&n.parent._resizeScrollBar()},l.prototype._getScrollableRow=function(n,t){var u=this,f=u.getFrozenRowCount(),e=u.getRowCount()-u.getFrozenTrailingRowCount()-1,r;if(t){if(n>e&&(n=e),r=u._getPrevVisualRow(n+1),r!=i&&r>=f)return r}else if(n<f&&(n=f),r=u._getNextVisualRow(n-1),r!=i&&r<=e)return r;return-1},l.prototype._getScrollableColumn=function(n,t){var u=this,f=u.getFrozenColumnCount(),e=u.getColumnCount()-u.getFrozenTrailingColumnCount()-1,r;if(t){if(n>e&&(n=e),r=u._getPrevVisualColumn(n+1),r!=i&&r>=f)return r}else if(n<f&&(n=f),r=u._getNextVisualColumn(n-1),r!=i&&r<=e)return r;return-1},l.prototype._setTopRow=function(n){var i=this,r=i._scrollTopRow;n>=i._getFirstPageTopRow()&&n<=i._getLastVisualRow()&&n!==r&&(i._eventHandler.vScrollTo(n),i._syncVScrollbarPosition(),i._trigger(t.Events.TopRowChanged,{sheet:i,sheetName:i._name,oldTopRow:r,newTopRow:n}))},l.prototype._setLeftColumn=function(n){var i=this,r=i._scrollLeftCol;n>=i._getFirstPageLeftColumn()&&n<=i._getLastVisualColumn()&&n!==r&&(i._eventHandler.hScrollTo(n),i._syncHScollbarPosition(),i._trigger(t.Events.LeftColumnChanged,{sheet:i,sheetName:i._name,oldLeftCol:r,newLeftCol:n}))},l.prototype._getSpanModel=function(n){if(n===u||n===i||n===3)return this._spanModel;else if(n===1)return this._colHeaderSpanModel;else if(n===2)return this._rowHeaderSpanModel},l.prototype._clipboardFloatingObjectCopy=function(n,r,u){var s,e,h;if(t.features.floatingObject){var f=this,o=f._getFloatingObjectClipboardHelper(),c=o.fromSheet,l=c&&c._eventHandler;for(l&&l._setClipboardFloatingObjectData(i),o.fromSheet=f,o.isCutting=r,s=new t._HelperArray,e=0;e<n.length;e++)h=f._findFloatingObjectInternal(n[e]),h&&s.push(h);f._eventHandler._setClipboardFloatingObjectData(s)}},l.prototype._clipboardCopy=function(n,r,u){var c;if(n){var l="\t",a="\r\n",v='"',f=this,o=f._eventHandler,h=s.getRangeText(f,n.row,n.rowCount,n.col,n.colCount,a,l,v,!1,0),e=f._getClipboardHelper();e.fromSheet=f;e.range=n;e.isCutting=r;try{c={sheet:f,sheetName:f._name,copyData:h,cancel:!1};f._trigger(t.Events.ClipboardChanging,c);c&&c.cancel===!1?(o&&!u&&o._switchFocusForClipboard(h),f._trigger(t.Events.ClipboardChanged,{sheet:f,sheetName:f._name,copyData:h}),setTimeout(function(){o&&!u&&o._switchBackFocusAfterClipboard()},100)):(e.fromSheet=i,e.range=i)}catch(y){}finally{return h}}},l.prototype._trySearch=function(n,i,r){var l,u,o,s,h,e,c,f;return n?(l=t.SearchFlags,n=n.toString(),i=i.toString(),u=(r&2)>0,u&&(r&4)==0?(r&1)>0?(o=n.toLowerCase(),s=i.toLowerCase(),o===s):n===i:(h=(r&1)>0,e=(r&4)>0,c=h?new RegExp(ot(i,e,u),"i"):new RegExp(ot(i,e,u)),f=n.search(c)>-1,u&&f&&i.search(/\*/)<=-1&&(f=n.length===i.length),f)):!1},l.prototype._getFilterButtonModel=function(){var n=this;return!n._filterButtonsModel&&t.features.filter_ui&&(n._filterButtonsModel=n._createFilterButtonModle()),n._filterButtonsModel},l.prototype._createFilterButtonModle=function(){var e=this,y=new t._FilterButtonInfoModel,o=e.rowFilter(),h,c,l,p,f,a,r,n,v,u,i;if(o&&o.range&&o.showFilterButton){var n=o.range,u=n.col<0?0:n.col,w=n.col<0?e.getColumnCount():n.col+n.colCount,r,s;if(n.row<1?(r=e.getRowCount(1)-1,s=1):(r=n.row-1,s=3),r>=0)while(u<w)i=new t._FilterButtonInfo(o),i.sheetArea=s,i.row=r,h=e.getSpans(new t.Range(r,u,1,1),s),h&&h.length>0?(c=h[0],i.row=c.row,i.col=c.col,u+=c.colCount):(i.col=u,u++),y.push(i)}for(l=e.getTables(),p=l?l.length:0,a=0;a<p;a++)if(f=l[a],f&&f.showHeader()&&f.rowFilter().showFilterButton&&(r=f.headerIndex(),r>=0))for(n=f.range(),v=0;v<n.colCount;v++)u=n.col+v,i=new t._FilterButtonInfo(f.rowFilter(),r,u,3),y.push(i);return y},l.prototype._getFilterButtonHitInfo=function(n,r,u){var s,w,f;if(!t.features.filter_ui)return i;var e=this,p=n.rowViewportIndex,y=n.colViewportIndex,l,a,v;if(n.hitTestType===1?(l=e._getColumnHeaderRowLayout().findY(u),a=e._getViewportColumnLayout(y).findX(r),v=1):n.hitTestType===3&&(l=e._getViewportRowLayout(p).findY(u),a=e._getViewportColumnLayout(y).findX(r),v=3),!l||!a)return i;var h=l.row,c=a.col,o=e.getSpan(h,c,v);if(o){if(h!==o.row+o.rowCount-1||c!==o.col+o.colCount-1)return i;h=o.row;c=o.col}return(s=e._getFilterButtonModel().find(h,c,v),s&&(w=e.getCellRect(h,c,p,y),f=e._render._getFilterButtonRect(w),f.x<=r&&r<=f.x+f.width&&f.y<=u&&u<=f.y+f.height))?new t._FilterButtonInfo(s.rowFilter,s.row,s.col,s.sheetArea,f.x,f.y,f.width,f.height):i},l.prototype._getCellTypeHitInfo=function(n,t,r){var u=this,f=n.row,e=n.col,o=n.hitTestType,s=u.getActualStyle(f,e,o),l=s.cellType||u.getDefaultCellType(o),h,c;return u.isProtected&&s.locked?i:(h=u.getCellRect(f,e),c={sheet:u,row:f,col:e,sheetArea:o},u._allowEditorReservedLocations?l.getHitInfo(t,r,s,h,c):i)},l.prototype._getFloatingObjectHitInfo=function(n,r){var e=this,o=e._floatingObjectArray,u=e._getSheetLayout(),s;if(t.features.floatingObject&&u&&o&&o.length>0)for(s=o.length-1;s>=0;s--){var f=o[s],h=f.position().x*e._zoomFactor+u.headerX+u.rowHeaderWidth,c=f.position().y*e._zoomFactor+u.headerY+u.colHeaderHeight,l=f.width(),a=f.height();if(n>=h&&n<h+l&&r>=c&&r<c+a)return{x:n,y:r,floatingObject:f}}return i},l.prototype._getCommentHitInfo=function(n,r){return t.features.comment?this._commentManager.getCommentHitInfo(n,r):i},l.prototype._trigger=function(n,t){var i=this._eventHandler;i._eventSuspended===0&&i.trigger(n,t)},l.prototype._disposeUserEvents=function(){this.unbindAll();this._unbindAll()},l.prototype._doCommand=function(n){var t=this.undoManager();t.doAction(n)},l.prototype._refreshTabStrip=function(){var n=this;n.parent&&n.parent._tab&&n.parent._tab.repaint&&n.parent._tab.repaint()},l.prototype._isAnyCellInRangeLocked=function(n){for(var i,t=this._getActualRange(n),u=t.row,f=t.col,o=u+t.rowCount,s=f+t.colCount,e,r=u;r<o;r++)for(i=f;i<s;i++)if(e=this.getActualStyle(r,i),e.locked===!0)return!0;return!1},l.prototype._isValidRange=function(n,t,i,r,u,f){if(-1<=n&&n<u&&-1<=t&&t<f)if(n===-1&&t===-1)return!0;else if(n===-1){if(r!==0&&t+r<=f)return!0}else if(t===-1){if(i!==0&&n+i<=u)return!0}else if(r!==0&&t+r<=f&&i!==0&&n+i<=u)return!0;return!1},l.prototype._hasPartSpans=function(n,t,r,u){var e,f,o,s,h,c;if(n<0&&t<0)return!1;else if(n<0){if(o=this._colHeaderSpanModel,o&&o.length!==0)for(e=o.getEnumerator(-1,t,-1,u),f=i;e.moveNext();)if(f=e.current(),f.col<t||f.col+f.colCount>t+u)return!0}else if(t<0&&(s=this._rowHeaderSpanModel,s&&s.length!==0))for(e=s.getEnumerator(n,-1,r,-1),f=i;e.moveNext();)if(f=e.current(),f.row<n||f.row+f.rowCount>n+r)return!0;if(h=this._spanModel,h&&h.length!==0)for(c=h.getEnumerator(n,t,r,u),f=i;c.moveNext();)if((f=c.current(),n!==-1&&(f.row<n||f.row+f.rowCount>n+r))||t!==-1&&(f.col<t||f.col+f.colCount>t+u))return!0;return!1},l.prototype._hasSpans=function(n,t,i,r){var f=this._spanModel,u,e,o;if(f)for(u=0,e=f.length;u<e;u++)if(o=f[u],o.intersect(n,t,i,r))return!0;return!1},l.prototype._hasPartTable=function(n,i,r,u){var e=this.getTables(),s,h,f,o;if(e&&e.length>0)for(s=new t.Range(n,i,r,u),h=e.length,o=0;o<h;o++)if(f=e[o].range(),s.intersect(f.row,f.col,f.rowCount,f.colCount)&&!s.containsRange(f))return!0;return!1},l.prototype._hasTable=function(n,t,i,r){return this._tableManager&&this._tableManager.has(n,t,i,r)?!0:!1},l.prototype._hasPartArrayFormulas=function(n,t,i,r){return this._getSheetSource()&&this._getSheetSource()._getFormulaExps(n,t,i,r,!0,!0)},l.prototype._getsArrayFormulas=function(n,t,i,r){return this._getSheetSource()&&this._getSheetSource()._getFormulaExps(n,t,i,r,!1,!0)},l.prototype._hasArrayFormula=function(n,t,i,r){var u=this._getsArrayFormulas(n,t,i,r);return u&&u.formulas&&u.formulas.length>0},l.prototype._raiseDragDropBlock=function(n,i,r,u,f,e,o,s,h){var c={sheet:this,sheetName:this._name,fromRow:n,fromCol:i,toRow:r,toCol:u,rowCount:f,colCount:e,copy:o,insert:s,copyOption:h,cancel:!1};return this._trigger(t.Events.DragDropBlock,c),c&&c.cancel===!0},l.prototype._raiseDragDropBlockCompleted=function(n,i,r,u,f,e,o,s,h){var c={sheet:this,sheetName:this._name,fromRow:n,fromCol:i,toRow:r,toCol:u,rowCount:f,colCount:e,copy:o,insert:s,copyOption:h};this._trigger(t.Events.DragDropBlockCompleted,c)},l.prototype._raiseInvalidOperation=function(n,i){var r={sheet:this,sheetName:this._name,invalidType:n,message:i};this._trigger(t.Events.InvalidOperation,r)},l.prototype._suspendInvalidate=function(){this._layoutSuspended++},l.prototype._resumeInvalidate=function(){var n=this;if(n._layoutSuspended--,n._layoutSuspended<=0){if(!n.isPaintSuspended())return n.invalidateLayout(),n.repaint(),!0;n._layoutSuspended=0}return!1},l.prototype._raiseSelectionChanging=function(n,i){var r=this,u=r._eventHandler._notEqualSelecions(n,i);return u===!0?(r._trigger(t.Events.SelectionChanging,{sheet:r,sheetName:r._name,oldSelections:n,newSelections:i}),!0):!1},l.prototype._raiseSelectionChanged=function(){this._trigger(t.Events.SelectionChanged,{sheet:this,sheetName:this._name})},l.prototype._raiseDragFillBlock=function(n,i,r){var u={sheet:this,sheetName:this._name,fillRange:n,autoFillType:r,fillDirection:i,cancel:!1};return this._trigger(t.Events.DragFillBlock,u),u&&u.cancel===!0},l.prototype._raiseDragFillBlockCompleted=function(n,i,r){var u={sheet:this,sheetName:this._name,fillRange:n,autoFillType:r,fillDirection:i};this._trigger(t.Events.DragFillBlockCompleted,u)},l.prototype._raiseCellChanged=function(n,i,r,u){var f={sheet:this,sheetName:this._name,row:i,col:r,sheetArea:u,propertyName:n};this._trigger(t.Events.CellChanged,f)},l.prototype._raisePropertyChanged=function(n){},l.prototype._nextNonNullRow=function(n,t){var r=this,f=r._bindingManager,o=r.getDataSource(),u,i;for(n++,u=t?r._getModel(2):r._getModel(3),i=u.rowCount,t===!1&&o&&(i=e(i,f.getRowCount()));n>=0&&n<i;){if(u.dataTable.hasOwnProperty(n)&&u.dataTable[n])break;if(t===!1&&o&&f.getDataItem(n))break;n++}return n<i?n:-1},l.prototype._nextNonNullColumn=function(n,t,r){var o=this,h=o._bindingManager,c=o.getDataSource(),f=i,e=r?o._getModel(1):o._getModel(3),s;if(n>=0&&n<e.rowCount&&e.dataTable.hasOwnProperty(n)&&(f=e.dataTable[n]),r===!1&&!f&&c&&n>=0&&n<h.getRowCount()&&(f=h.getDataItem(n)),!f)return-1;for(t++;t>=0&&(t<e.colCount||t<f.length);){if(f.hasOwnProperty(t)&&f[t])break;if(r===!1&&c&&(s=o._getValueImp(e,n,t),s!==u&&s!==i))break;t++}return t<e.colCount||r===!1&&f&&t<f.length?t:-1},l.prototype._closeDragFillPopup=function(){this._smartTag&&this._smartTag.close()},l.prototype._cellRangeInflate=function(n,t){var r,i;if(n&&n.length>0)for(r=0;r<n.length;r++)if(i=n[r],t.intersect(i.row,i.col,i.rowCount,i.colCount))return n.splice(r--,1),this._cellRangeInflate(n,this._unionCellRange(t,i));return t},l.prototype._unionCellRange=function(n,i){var r=f(n.row,i.row),u=f(n.col,i.col),o=e(n.row+n.rowCount-1,i.row+i.rowCount-1),s=e(n.col+n.colCount-1,i.col+i.colCount-1);return r>=0&&u>=0?new t.Range(r,u,o-r+1,s-u+1):r>=0?new t.Range(r,-1,o-r+1,-1):u>=0?new t.Range(-1,u,-1,s-u+1):new t.Range(-1,-1,-1,-1)},l.prototype._getClipboardHelper=function(){var n=this;return!n._clipboardHelper&&n.parent&&n.parent._clipboardHelper?n._clipboardHelper=n.parent._clipboardHelper:n._clipboardHelper||(n._clipboardHelper={fromSheet:i,range:i,isCutting:!1}),n._clipboardHelper},l.prototype._getFloatingObjectClipboardHelper=function(){var n=this;return!n._floatingObjectClipboardHelper&&n.parent&&n.parent._floatingObjectClipboardHelper?n._floatingObjectClipboardHelper=n.parent._floatingObjectClipboardHelper:n._floatingObjectClipboardHelper||(n._floatingObjectClipboardHelper={fromSheet:i,isCutting:!1}),n._floatingObjectClipboardHelper},l.prototype._checkPastedRange=function(n,r,u,f,e,s){var rt=t.SR.Exp_PasteSourceCellsLocked,nt=t.SR.Exp_InvalidCopyPasteSize,ut=t.SR.Exp_PasteDestinationCellsLocked,d=t.SR.Exp_PasteChangeMergeCell,g=t.SR.Exp_ChangePartOfArray,h,c,v,y,tt,it,b,k;if(s.pastedInternal=!1,s.pastedRange=i,!n&&(!e||e===""))return!1;if(h=this,c=h,h._isPastedInternal(n,r,c,e)||!e){if(s.pastedInternal=!0,f&&n.isProtected&&n._isAnyCellInRangeLocked(r))return h._raiseInvalidOperation(1,rt),!1;s.pastedRange=h._getPastedRange(n,r,c,u,f)}else s.pastedRange=h._getPastedRangefromText(u,e);if(!s.pastedRange)return h._raiseInvalidOperation(1,nt),!1;if(c.isProtected&&c._isAnyCellInRangeLocked(s.pastedRange))return h._raiseInvalidOperation(1,ut),!1;if(s.pastedInternal){if(n._hasPartSpans(r.row,r.col,r.rowCount,r.colCount))return h._raiseInvalidOperation(1,d),!1;if(f&&n._hasPartArrayFormulas(r.row,r.col,r.rowCount,r.colCount))return h._raiseInvalidOperation(1,g),!1;var p=s.pastedRange.row<0?c.getRowCount():s.pastedRange.rowCount,w=s.pastedRange.col<0?c.getColumnCount():s.pastedRange.colCount,l=r.row<0?n.getRowCount():r.rowCount,a=r.col<0?n.getColumnCount():r.colCount;if(p>l||w>a)for(v=u.row,y=u.col,u.row<0&&l<c.getRowCount()&&(v=0),u.col<0&&a<c.getColumnCount()&&(y=0),p%l==0&&w===1?(w=a,s.pastedRange=new t.Range(v,y,p,w)):p===1&&w%a==0?(p=l,s.pastedRange=new t.Range(v,y,p,w)):(p%l!=0||w%a!=0)&&(p=l,w=a,s.pastedRange=new t.Range(v,y,p,w)),tt=o(p/l),it=o(w/a),b=0;b<tt;b++)for(k=0;k<it;k++){if(c._hasPartSpans(v<0?-1:v+b*l,y<0?-1:y+k*a,v<0?-1:l,y<0?-1:a))return h._raiseInvalidOperation(1,d),!1;if(c._hasPartArrayFormulas(v<0?-1:v+b*l,y<0?-1:y+k*a,v<0?-1:l,y<0?-1:a))return h._raiseInvalidOperation(1,g),!1}else{if(c._hasPartSpans(s.pastedRange.row,s.pastedRange.col,s.pastedRange.rowCount,s.pastedRange.colCount))return h._raiseInvalidOperation(1,d),!1;if(c._hasPartArrayFormulas(s.pastedRange.row,s.pastedRange.col,s.pastedRange.rowCount,s.pastedRange.colCount))return h._raiseInvalidOperation(1,g),!1}}else{if(c._hasPartSpans(s.pastedRange.row,s.pastedRange.col,s.pastedRange.rowCount,s.pastedRange.colCount))return h._raiseInvalidOperation(1,d),!1;if(c._hasPartArrayFormulas(s.pastedRange.row,s.pastedRange.col,s.pastedRange.rowCount,s.pastedRange.colCount))return h._raiseInvalidOperation(1,g),!1;if(s.pastedRange.row+s.pastedRange.rowCount>c.getRowCount()||s.pastedRange.col+s.pastedRange.colCount>c.getColumnCount())return h._raiseInvalidOperation(1,nt),!1}return!0},l.prototype._isPastedInternal=function(n,t,i,r){if(n&&t&&i){var f=s.getRangeText(n,t.row,t.rowCount,t.col,t.colCount,"\r\n","\t",'"',!1,0),u=f===r;return!u&&($.browser.chrome||$.browser.safari||$.browser.webkit)&&(u=f===r+"\r\n"),u}return!1},l.prototype._getPastedRange=function(n,r,u,f,e){var v=r.row<0?0:r.row,y=r.col<0?0:r.col,h=r.row<0?n.getRowCount():r.rowCount,c=r.col<0?n.getColumnCount():r.colCount,l=f.row<0?0:f.row,a=f.col<0?0:f.col,o=f.row<0?u.getRowCount():f.rowCount,s=f.col<0?u.getColumnCount():f.colCount,p;if((e?(o=h,s=c):o%h==0&&s===1?s=c:o===1&&s%c==0?o=h:(o%h!=0||s%c!=0)&&(o=h,s=c),!this._isValidRange(v,y,h,c,n.getRowCount(),n.getColumnCount()))||!this._isValidRange(l,a,o,s,u.getRowCount(),u.getColumnCount()))return i;if(p=new t.Range(l,a,o,s),!e&&n._name===u._name)if(p.contains(v,y,h,c)){if((v-l)%h!=0||(y-a)%c!=0)return i}else if(p.intersect(v,y,h,c)&&(o>h||s>c))return i;return f.row===-1&&(l=-1,o=-1),f.col===-1&&(a=-1,s=-1),new t.Range(l,a,o,s)},l.prototype._getPastedRangefromText=function(n,r){var f=i,u=s.parseCsv(r,"\r\n","\t",'"');if(u){var h=n.row<0?0:n.row,c=n.col<0?0:n.col,e=u.length,o=s.getMaxLength(u);e>0&&o>0&&(f=new t.Range(h,c,e,o))}return f},l.prototype._clipboardPaste=function(n,r,u,f,e,h,c){var v,y,l,a,p,w,rt,d,b,k,ut,ft,tt,g,it,nt,et;if(!n||u._name!==n._name||!u.parent||u.parent.sheets.contains(n))if(n&&r){if(rt=t.UndoRedo.ClipboardPasteRangeUndoAction.convertPasteOption,d=rt(c),(d&2)!=0&&(e&&n._hasPartArrayFormulas(r.row,r.col,r.rowCount,r.colCount)||u._hasPartArrayFormulas(f.row,f.col,f.rowCount,f.colCount)))throw t.SR.Exp_ChangePartOfArray;if(e)s.moveTo(n,r.row,r.col,u,f.row,f.col,r.rowCount,r.colCount,d);else if(b=f.row<0?u.getRowCount():f.rowCount,k=f.col<0?u.getColumnCount():f.colCount,l=r.row<0?n.getRowCount():r.rowCount,a=r.col<0?n.getColumnCount():r.colCount,b>l||k>a){v=f.row;y=f.col;f.row<0&&l<u.getRowCount()&&(v=0);f.col<0&&a<u.getColumnCount()&&(y=0);b%l==0&&k===1?k=a:b===1&&k%a==0?b=l:(b%l!=0||k%a!=0)&&(b=l,k=a);ut=o(b/l);ft=o(k/a);n.suspendCalcService();u.suspendCalcService();try{for(p=0;p<ut;p++)for(w=0;w<ft;w++)s.copyTo(n,r.row,r.col,u,v<0?-1:v+p*l,y<0?-1:y+w*a,v<0?-1:l,y<0?-1:a,d)}finally{n.resumeCalcService();u.resumeCalcService()}}else s.copyTo(n,r.row,r.col,u,f.row,f.col,r.rowCount,r.colCount,d)}else{for(v=f.row,y=f.col,l=f.rowCount,a=f.colCount,tt=u._spanModel.getEnumerator(v,y,l,a),g=[];tt.moveNext();)it=tt.current(),it&&g.push(it);for(nt=0,et=g.length;nt<et;nt++)u._spanModel.remove(g[nt]);if(h&&h!=="")u.setCsv(v,y,h,"\r\n","\t",16);else for(p=0;p<l;p++)for(w=0;w<a;w++)u.setValue(v+p,y+w,i)}},l.prototype._raiseClipboardPasting=function(n,i){var r={sheet:this,sheetName:this._name,cellRange:n,pasteOption:i,cancel:!1};return this._trigger(t.Events.ClipboardPasting,r),r.cancel===!0},l.prototype._raiseClipboardPasted=function(n,i){var r={sheet:this,sheetName:this._name,cellRange:n,pasteOption:i};this._trigger(t.Events.ClipboardPasted,r)},l.prototype._raiseValueChanged=function(n,i){var r={sheet:this,sheetName:this._name,row:n,col:i};this._trigger(t.Events.ValueChanged,r)},l.prototype._raiseRangeDataChanged=function(n,i,r,u){var f={sheet:this,sheetName:this._name,row:n,column:i,rowCount:r,columnCount:u};this._trigger(t.Events.RangeChanged,f)},l.prototype._copyFormula=function(n,t,i,r,u,f){s.copyFormula(this,n,t,this,i,r,u,f)},l.prototype._getAutoFitType=function(){if(this.parent!=i){var n=this.parent;return n.autoFitType()}return 0},l.prototype._doCut=function(n){if(!this.isEditing()){var t=this.getSelections();if(t&&t.length===1)return this._clipboardCopy(t[0],!0,n)}return i},l.prototype._doCopy=function(n){if(!this.isEditing()){var t=this.getSelections();if(t&&t.length===1)return this._clipboardCopy(t[0],!1,n)}return i},l.prototype._doFloatingObjectCopy=function(n){var i=this,r,t,e,u,f;if(i._hasFloatingObjectsSelected()){for(r=[],u=i._floatingObjectArray,t=0,e=u.length;t<e;t++)f=u[t],f.isSelected()&&r.push(f.name());i._clipboardFloatingObjectCopy(r,!1,n)}},l.prototype._doFloatingObjectCut=function(n){var i=this,r,u,o,f,e,s,h;if(i._hasFloatingObjectsSelected()){for(r=[],f=i._floatingObjectArray,u=0,o=f.length;u<o;u++)e=f[u],e.isSelected()&&r.push(e.name());i._clipboardFloatingObjectCopy(r,!0,n);s={names:r};h=new t.UndoRedo.DeleteFloatingObjectUndoAction(i,s);i._doCommand(h)}},l.prototype._doFloatingObjectPaste=function(n,i){var r=this;if(!r.isEditing()&&t.features.floatingObject){var u=r._getFloatingObjectClipboardHelper(),f=u.fromSheet,e=f._eventHandler,o=u.isCutting;setTimeout(function(){var u=n,s,o,h,c;if(e&&!n&&(u=e._getClipboardFloatingObjectData()),u&&u.length){for(s=[],o=0,h=u.length;o<h;o++)s.push(u[o].name());c=new t.UndoRedo.ClipboardPasteFloatingObjectUndoAction(r,{names:s},f);r._doCommand(c)}i&&i()},100)}},l.prototype._doPaste=function(n,r){var u=this,s=u._eventHandler;if(!u.isEditing()){var h=t.SR.Exp_InvalidPastedArea,o=u._getClipboardHelper(),f=o.fromSheet,e=o.range;s&&!n&&s._switchFocusForClipboard("");setTimeout(function(){var v=n,l,w,b,k,d;s&&!n&&(v=s._getClipboardData(),s._switchBackFocusAfterClipboard());l=o.isCutting;l&&(o.fromSheet=i,o.range=i,o.isCutting=!1);l&&f&&e&&f.isProtected&&f._isAnyCellInRangeLocked(e)&&(l=!1);var a={pastedRange:i,pastedInternal:!1},y=[],p=u.getSelections(),c;if(p.length>1)for(w=0;w<p.length;w++){if(c=p[w],!u._checkPastedRange(f,e,c,l,v,a))return;if(c.containsRange(a.pastedRange)&&!c.equals(a.pastedRange)){u._raiseInvalidOperation(1,h);return}y.push(a.pastedRange)}else if(p.length>0){if(c=p[0],!u._checkPastedRange(f,e,c,l,v,a))return;y.push(a.pastedRange)}else{if(c=u._getSpanModel().find(u._activeRowIndex,u._activeColIndex),c||(c=new t.Range(u._activeRowIndex,u._activeColIndex,1,1)),!u._checkPastedRange(f,e,c,l,v,a))return;y.push(a.pastedRange)}y.length>0&&(a.pastedInternal||(f=i,e=i),b=u.clipBoardOptions(),l&&(b=0),k={fromRange:e,pastedRanges:y.slice(0),isCutting:l,clipboardText:v},d=new t.UndoRedo.ClipboardPasteUndoAction(u,f,u,k,b),u._doCommand(d));r&&r()},100)}},l.prototype._getImageLoader=function(){if(!this.imageLoader){var n=this;this.imageLoader=new t._GcImageLoader(function(){n.repaint()})}return this.imageLoader},l.prototype._getContainerDiv=function(){var n=this;return!n._containerDiv&&n._canvas&&n._canvas.parentNode&&(n._containerDiv=y.createElement("div"),$(n._containerDiv).css({position:"absolute",left:0,top:0,width:0,height:0}),$(n._canvas.parentNode).prepend(n._containerDiv)),n._containerDiv},l.prototype.setComment=function(n,i,r){var o;if(t.features.comment){var f=this,u=this._commentManager,e=f.getComment(n,i);e&&u&&u.containsComment(e)&&u.removeComment(e);o=f._getModel(3);o.setComment(n,i,r);u.addComment(n,i,r);f._raiseCellChanged("comment",n,i,3)}},l.prototype.getComment=function(n,r){if(!t.features.comment)return i;var u=this._getModel(3);return u.getComment(n,r)},l.prototype.getComments=function(){if(t.features.comment)return this._commentManager.getCommentList()},l}();t.Sheet=ii;wt=function(){function n(){}return n.startCatch=function(t,i,r,u,f){var h=n,c,o,s,e;if(h._catched=!0,c=t.getRowCount(),t._hasTable(i,r,u-i+1,f-r+1))for(o=-1,s=h._visibleRowIndexCatch=[],e=0;e<=u;e++)t.getRowVisible(e)?(o++,s[e]=o):s[e]=-1},n.clearCatch=function(){n._visibleRowIndexCatch=null;n._catched=!1},n._catched=!1,n}();t._CatchMgr=wt})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(t){t.feature("core.spread",["core.common","core.theme","core.sheet_event","core.sheet_action","core.sheet","core.spreadpanelex","core.stringResource","core.imageLoader"]);var i=null,u=undefined,ct=Math.round,s=Math.max,w=Math.min,r="undefined",f=window.document,tr="refresh",lt="scroll",at="resize",ir="horizontal",rr="vertical",vt="input",yt="div",e="px",o="0",ur="3000",fr="hidden",er="visible",ai="top",pt="none",c=".gcSpread",vi="_data",l=".gcScrollbar",b="scroll-handle",k="scroll-bar",wt="mousedown",bt="mouseup",yi=function(){function s(n,t,r){var u=this;u._host=i;u._allowUndo=!0;u._paintSuspended=!1;u._availableSheetIndex=-1;u._useTouchLayout=!1;u.sheets=i;u.name=i;u.useWijmoTheme=!1;u._tabStripRatio=.5;u._tabStripRatioUserSet=.5;u._activeSheetIndex=0;u._allowUserZoom=!0;u._allowUserResize=!0;u._allowSheetReorder=!0;u._tabStripVisible=!0;u._tabEditable=!0;u._newTabVisible=!0;u._firstTabUserSet=0;u._canUserEditFormula=!0;u._highlightInvalidData=!1;u._autoFitType=0;u._allowDragDrop=!0;u._allowDragFill=!0;u._showScrollTip=0;u._showResizeTip=0;u._showDragDropTip=!0;u._showDragFillTip=!0;u._tooltip=i;u._showVerticalScrollbar=!0;u._showHorizontalScrollbar=!0;u._backColor="white";u._backgroundImage=i;u._backgroundImageLayout=0;u._grayAreaBackColor="gray";u._imageLoader=i;u._suspendSetFocus=!1;u._cutCopyIndicatorVisible=!0;u._cutCopyIndicatorBorderColor="#217346";u._defaultSheetCount=1;u._defaultActiveSheetIndex=0;u._windowResizeTimer=i;u._init(n,t,r)}return s.prototype._init=function(n,r,u){var e=this,o,s,h;for(e.name=n,t.util.hasCalc()&&(e.calcService=new t.Calc.Service(e)),e._userEvents=[],e._userEventsElem=f.createElement(vt),e._eventSuspended=0,e._undoManager=new t._UndoManager(e,-1,e.allowUndo()),e._clipboardHelper={fromSheet:i,range:i,isCutting:!1},e._floatingObjectClipboardHelper={fromSheet:i,isCutting:!1},e._containerDiv=i,t.features.touch&&(e._touchEventProvider=new t.TouchEventProvider),e.sheets=[],e._namedStyles={},t.features.sparklineEx&&(e._sparklineExs={},e.addSparklineEx(new t.PieSparkline),e.addSparklineEx(new t.AreaSparkline),e.addSparklineEx(new t.ScatterSparkline),e.addSparklineEx(new t.LineSparkline),e.addSparklineEx(new t.ColumnSparkline),e.addSparklineEx(new t.WinlossSparkline)),o=0;o<r;o++)e.sheets.push(e._createSheet(e._getDefaultSheetName(o)));if(e.sheets.length>0&&t.util.hasCalc()){for(s=i,o=0;!s&&o<e.sheets.length;o++)s=e.sheets[o]._getSheetSource();if(s)for(o=0;o<e.sheets.length;o++)h=e.sheets[o]._getSheetSource(),h&&h.shareCalculations(s)}u&&e._setHost(u);t.features.touch&&!e.touchToolStrip&&(e.touchToolStrip=new t.TouchToolStrip(e))},s.prototype._getContainerDiv=function(){var n=this;return!n._containerDiv&&n._host&&(n._containerDiv=f.createElement("div"),$(n._containerDiv).css({position:"relative",left:0,top:0,width:0,height:0}),$(n._host).prepend(n._containerDiv)),n._containerDiv},s.prototype._getDefaultSheetName=function(n){var t=this,r,e,o,f,s;t._availableSheetIndex<t.getSheetCount()?t._availableSheetIndex=t.getSheetCount():t._availableSheetIndex++;(n===u||n===i||n<t._availableSheetIndex)&&(n=t._availableSheetIndex);r=!1;do if(e="Sheet"+(n+1),o=t.sheets.length,o>0)for(f=0;f<o;f++)if(f in t.sheets)if(s=t.sheets[f],s._name===e){n++;r=!0;break}else r&&(r=!1);while(r);return e},s.prototype._createSheet=function(n){var i=new t.Sheet(n);return i.calcService=this.calcService,i.parent=this,i},s.prototype._slSetHost=function(n){var r=this,i;$(n).data("spread",r);i=f.createElement("canvas");i.setAttribute("width",""+n.clientWidth);i.setAttribute("height",""+n.clientHeight);n.appendChild(i);r.canvas=i;i.setAttribute("renderMethod","auto");i.setAttribute("gcSpreadsheet","true");i.setAttribute("onload","$.wijmo.wijspread.util.initPaint('"+n.id+"')");this._resizeHandler=t.util.createEventHandler(r,r._doResize);$(window).bind("resize.gcSpread",this._resizeHandler)},s.prototype._setHost=function(n){var r=this,k,d,p,u,h,s,w,v,a,y,b;if(n){if(k=t.util._isStandardCanvas(),d=t.util._isSilverlightCanvas(),!k&&d){r._slSetHost(n);window.slcanvas&&window.slcanvas.autoLoad&&window.slcanvas.autoLoad();return}for(r._host=n,$(n).data("spread",r),n.setAttribute("gcUIElement","gcSpread"),t.Global.prototype._createDummyObjects(),p=[],u=0;u<n.children.length;u++)p.push(n.children[u]);for(n.innerHTML="<table cellspacing=0 cellpadding=0 border=0><tr><td><\/td><td><\/td><\/tr><tr><td><\/td><td><\/td><\/tr><\/table>",s=n.firstChild,$(n).bind(t.Events.CultureChanged,r,r._onCultureChanged),$(n).addClass("gc-host-none-user-select");p.length>0;)n.insertBefore(p.pop(),s);for(r._vp=f.createElement(yt),r._vp.id=n.id+"vp",s.rows[0].cells[0].insertBefore(r._vp,i),w="100%",s.style.width=w,s.style.height=w,s.style.border=o,s.style.margin=o,u=0;u<s.rows.length;u++)for(h=0;h<s.rows[u].cells.length;h++)s.rows[u].cells[h].style.padding=o,s.rows[u].cells[h].style.border=o;for(r._scrollbarV=new $.wijmo.wijspread.Scrollbar(!1),v=r._scrollbarV.getScrollbar(),s.rows[0].cells[1].insertBefore(v,i),$(v).bind(lt+l,function(n,t){var f=r.getActiveSheet(),i=t.scrollEventType,u=t.scrollOrientation;if(n.data=r,u===1)switch(i){case 0:case 1:case 2:case 3:case 5:r._vscrollDelegate(n,t);break;case 4:r._vScrollStop(n);break;default:break}}),$(v).bind(wt+l,function(n,t){n.data=r;r._vScrollMouseDown(n)}),$(v).bind(bt+l,function(n,t){n.data=r;r._scrollMouseUp(n)}),s.rows[1].cells[0].innerHTML="<table cellspacing=0 cellpadding=0 border=0><tr><td><\/td><td><\/td><\/tr><\/table>",a=s.rows[1].cells[0].firstChild,a.style.border=o,a.style.margin=o,$(a).css("user-select","none"),u=0;u<a.rows.length;u++)for(h=0;h<a.rows[u].cells.length;h++)a.rows[u].cells[h].style.padding=o,a.rows[u].cells[h].style.border=o;r._tabs=f.createElement(yt);r._tabs.style.width=""+r._getActualTabStripRatio()*$(r._host).width()+e;r._tabs.style.height=""+r._getScrollbarSize()+e;r._tabs.style.fontSize="10pt";r._tabs.style.fontFamily="Arial";a.rows[0].cells[0].insertBefore(r._tabs,i);r._tab=new nr(n.getAttribute("id")+"_tabStrip");r._tab.setOwner(r);r._tab._setHost(r._tabs);r._scrollbarH=new $.wijmo.wijspread.Scrollbar(!0);y=r._scrollbarH.getScrollbar();a.rows[0].cells[1].insertBefore(y,i);$(y).bind(lt+l,function(n,t){var f=r.getActiveSheet(),i=t.scrollEventType,u=t.scrollOrientation;if(n.data=r,u===0)switch(i){case 0:case 1:case 2:case 3:case 5:r._hscrollDelegate(n,t);break;case 4:r._hScrollStop(n);break;default:break}});$(y).bind(wt+l,function(n,t){n.data=r;r._hScrollMouseDown(n)});$(y).bind(bt+l,function(n,t){n.data=r;r._scrollMouseUp(n)});this._resizeHandler=t.util.createEventHandler(r,r._doWindowResize);$(window).bind(at+c,this._resizeHandler);t.features.comment&&(r._commentRender=new t.CommentRender(r._getContainerDiv()));b=r.getActiveSheet();b&&(b._setHost(r._vp),$(window).unbind("resize.gcSheet"));r._doResize();Object.defineProperty&&Object.defineProperty(r,"useWijmoTheme",{set:function(n){var t=r._scrollbarH,i=r._scrollbarV;t&&t.useWijmoTheme(n);i&&i.useWijmoTheme(n);this._useWijmoTheme=n},get:function(){return!!this._useWijmoTheme}})}},s.prototype._onCultureChanged=function(n,t){var r=n.data,e,c,u,f,s,h;for(r.invalidateLayout(),r.touchToolStrip&&r.touchToolStrip._updateResource(),e=0,c=r.sheets.length;e<c;e++){var o=r.sheets[e],l=o.getRowCount(),a=o.getColumnCount();for(u=0;u<l;u++)for(f=0;f<a;f++)(s=o.getValue(u,f),s!==i)&&(h=o.getStyle(u,f),h&&h._setActualAutoFormatter(s))}r.repaint()},s.prototype._hscrollDelegate=function(n,r){var h=n.data,e=h.getActiveSheet(),f,o,s;e&&r&&(f=parseInt(r.newValue,10),(r.oldValue===u||r.oldValue===i)&&(r.oldValue=0),r.oldValue=parseInt(r.oldValue,10),r.scrollEventType===2||r.scrollEventType===0?(r.scrollEventType===2&&(f=e._getPrevPageLeftColumn()),o=e._getScrollableColumn(f,!0),o!=-1&&o!=f&&(f=o)):(r.scrollEventType===3||r.scrollEventType===1)&&(r.scrollEventType===3&&(f=e._getPageRightColumn()),o=e._getScrollableColumn(f),o!=-1&&o!=f&&(f=o)),s=e._getFirstPageLeftColumn(),f<s&&(f=s),f>e._getLastVisualColumn()&&(f=e._getLastVisualColumn()),r.newValue!==f&&(r.newValue=f),r.oldValue!==r.newValue&&(e._eventHandler.doHScroll(f),e._trigger(t.Events.LeftColumnChanged,{sheet:e,sheetName:e._name,oldLeftCol:r.oldValue,newLeftCol:r.newValue})))},s.prototype._hScrollStop=function(n){var u=n.data,t=u.getActiveSheet(),i,r;t&&(i=u._scrollbarH,r=i.value(),r<t._getFirstPageLeftColumn()?i.value(t._getFirstPageLeftColumn()):r>t._getLastVisualColumn()&&i.value(t._getLastVisualColumn()),t._eventHandler._removeTooltip())},s.prototype._hScrollMouseDown=function(n){var r=n.data,u,t,i,f,e;r&&(u=r.showScrollTip(),(u===1||u===3)&&(t=$(n.srcElement?n.srcElement:n.target),i=t.parent(),(t&&t.hasClass(b)||i&&i.hasClass(b)||t&&t.hasClass(k)||i&&i.hasClass(k))&&(t||i)&&(f=r.getActiveSheet(),e=f&&f._eventHandler,e&&e._showScrollTooltip(!1,n))))},s.prototype._vscrollDelegate=function(n,r){var h=n.data,e=h.getActiveSheet(),f,o,s;e&&r&&(f=parseInt(r.newValue,10),(r.oldValue===u||r.oldValue===i)&&(r.oldValue=0),r.oldValue=parseInt(r.oldValue,10),r.scrollEventType===2||r.scrollEventType===0?(r.scrollEventType===2&&(f=e._getPrevPageTopRow()),o=e._getScrollableRow(f,!0),o!=-1&&o!=f&&(f=o)):(r.scrollEventType===3||r.scrollEventType===1)&&(r.scrollEventType===3&&(f=e._getPageBottomRow()),o=e._getScrollableRow(f),o!=-1&&o!=f&&(f=o)),s=e._getFirstPageTopRow(),f<s&&(f=s),f>e._getLastVisualRow()&&(f=e._getLastVisualRow()),r.newValue!==f&&(r.newValue=f),r.oldValue!==f&&(e._eventHandler.doVScroll(f),e._trigger(t.Events.TopRowChanged,{sheet:e,sheetName:e._name,oldTopRow:r.oldValue,newTopRow:f})))},s.prototype._initPaint=function(){var u=t.util._isStandardCanvas(),n,r,i;u||(n=this,r=n.getActiveSheet(),r)&&(i=r._getCanvas(),i&&i.firstChild&&i.firstChild.loaded?(n.invalidateLayout(),n.repaint()):window.setTimeout(function(){n._initPaint.call(n)},10))},s.prototype._vScrollStop=function(n){var u=n.data,t=u.getActiveSheet(),i,r;t&&(i=u._scrollbarV,r=i.value(),r<t._getFirstPageTopRow()?i.value(t._getFirstPageTopRow()):r>t._getLastVisualRow()&&i.value(t._getLastVisualRow()),t._eventHandler._removeTooltip())},s.prototype._vScrollMouseDown=function(n){var r=n.data,u,t,i,f,e;r&&(u=r.showScrollTip(),(u===2||u===3)&&(t=$(n.srcElement?n.srcElement:n.target),t&&(i=t.parent(),(t.hasClass(b)||i&&i.hasClass(b)||t.hasClass(k)||i&&i.hasClass(k))&&(f=r.getActiveSheet(),e=f&&f._eventHandler,e&&e._showScrollTooltip(!0,n)))))},s.prototype._scrollMouseUp=function(n){var r=n.data,t,i;r&&(t=r.getActiveSheet(),i=t&&t._eventHandler,i&&i._removeTooltip())},s.prototype._dispose=function(){var n=this,u,r;$(window).unbind(at+c,this._resizeHandler);n._scrollbarH&&n._scrollbarH.dispose();n._scrollbarV&&n._scrollbarV.dispose();n._touchEventProvider&&n._touchEventProvider.dispose();n._disposeUserEvents();u=n.getActiveSheet();u&&u._dispose();n._host&&(n._host.innerHTML="",n._host.removeAttribute("gcUIElement"),r=$(n._host),r.unbind(t.Events.CultureChanged),r.removeClass("gc-host-none-user-select"),r.attr("class")||r.removeAttr("class"));n.touchToolStrip&&(n.touchToolStrip._dispose(),n.touchToolStrip=i);n._commentRender&&(n._commentRender=i)},s.prototype._disposeUserEvents=function(){var n,t;for($(this._userEventsElem).unbind(c),n=0;n<this.sheets.length;n++)t=this.sheets[n],t._disposeUserEvents()},s.prototype._getCalcContexts=function(){for(var r,n,i=[],t=0;t<this.sheets.length;t++)if(r=this.sheets[t],n=r._getCalcContexts(),n)while(n.length>0)i.push(n.pop());return i},s.prototype._doWindowResize=function(){var n=this;n._windowResizeTimer&&window.clearTimeout(n._windowResizeTimer);n._windowResizeTimer=window.setTimeout(function(){n._doResize();n._windowResizeTimer=i},100)},s.prototype._doResize=function(){var n=this,u,c,i,f,p,l,a,t,w;if($.browser.msie&&parseInt($.browser.version,10)<9&&(u=n.canvas,u)){var s=u.parentElement,r=s.parentElement,h=u.firstChild;h&&r&&(c=function(n){return n===""||n==="auto"||/%$/ig.test(n)},c(s.style.width)&&r.offsetWidth>12&&(h.width=r.offsetWidth-12),c(s.style.height&&r.offsetHeight>10)&&(h.height=r.offsetHeight-10))}if(i=n._getScrollbarSize(),f=n._host,f){var v=$(f),o=v.width(),y=$(f).height();n._vp.style.width=n.showVerticalScrollbar()?""+(o-i)+e:""+o+e;n._vp.style.height=n.showHorizontalScrollbar()||n._tabStripVisible?""+(y-i)+e:""+y+e;p=$(n._vp).width();l=n._getActualTabStripRatio()*p;n._tabs.style.width=""+(l-1)+e;n._tabs.style.height=""+i+e;n._scrollbarV.width(i);n._scrollbarV.height($(n._vp).height());a=o-(n._tabStripVisible?l:0)-(n.showVerticalScrollbar()?i:0);n._scrollbarH.width(a>0?a:1);n._scrollbarH.height(i);t=n.getActiveSheet();t&&(t._scrollTopRow===0&&(t._scrollTopRow=t._getFirstPageTopRow()),t._scrollLeftCol===0&&(t._scrollLeftCol=t._getFirstPageLeftColumn()));t&&t._eventHandler.doResize();n._resizeScrollBar();n._tabStripVisible===!0?$(n._tabs).show():$(n._tabs).hide();n._tab.doResize();w=v.width();o===w||n._haveLayoutFixing||(n._haveLayoutFixing=!0,setTimeout(function(){delete n._haveLayoutFixing;n._doResize()},1))}},s.prototype._resizeScrollBar=function(){var n=this.getActiveSheet(),u,f;if(n){var e=n.getColumnCount()-n._frozenTrailingColCount-n.frozenColCount,o=n.getRowCount()-n._frozenTrailingRowCount-n.frozenRowCount,c=1,l=1,a=n.frozenColCount,v=n.frozenRowCount,t=n._getSheetLayout();for(u=v;u<v+o;u++)c+=n.getRowHeight(u);for(f=a;f<a+e;f++)l+=n.getColumnWidth(f);var y=t.width-t.rowHeaderWidth-t.frozenWidth-t.frozenTrailingWidth,p=t.height-t.colHeaderHeight-t.frozenHeight-t.frozenTrailingHeight,i=this._scrollbarH,r=this._scrollbarV,s=ct(e*y/l),h=ct(o*p/c);s<0&&(s=1);h<0&&(h=1);i&&(i.minimum(n.frozenColCount),i.maximum(n.frozenColCount+e-1),i.pageValue(s),i.refreshLayout(),i.value(n._scrollLeftCol));r&&(r.minimum(n.frozenRowCount),r.maximum(n.frozenRowCount+o-1),r.pageValue(h),r.refreshLayout(),r.value(n._scrollTopRow))}},s.prototype._doTabHSResize=function(){var n=this,i=n._getScrollbarSize(),u=n._host,r,t;if(u){var o=$(u),s=o.width(),h=$(n._vp).width(),f=n._getActualTabStripRatio()*h;n._tabs.style.width=""+(f-1)+e;n._tabs.style.height=""+i+e;r=s-(n._tabStripVisible?f:0)-(n.showVerticalScrollbar()?i:0);n._scrollbarH.width(r>0?r:1);n._scrollbarH.height(i);n._scrollbarH.refreshLayout();t=n.getActiveSheet();t&&(t._scrollLeftCol===0&&(t._scrollLeftCol=t._getFirstPageLeftColumn()),n._scrollbarH.value(t._scrollLeftCol));n._tabStripVisible===!0?$(n._tabs).show():$(n._tabs).hide();n._tab.doResize()}},s.prototype._trigger=function(n,t){this._eventSuspended===0&&$(this._userEventsElem).trigger(n,[t])},s.prototype._copyUserEvents=function(n){var t,i;for(n._eventHandler._eventSuspended=this._eventSuspended,t=0;t<this._userEvents.length;t++)i=this._userEvents[t],n.bind(i.type,i.data,i.fn)},s.prototype._suspendInvalidate=function(){var n=this.getActiveSheet();n&&n._suspendInvalidate()},s.prototype._resumeInvalidate=function(){var n=this.getActiveSheet();return n?n._resumeInvalidate():!1},s.prototype._paintSpreadBackgroundImage=function(){var n=this,e=n.getActiveSheet(),r,f;if(e){if(!n._backgroundImage)return;if(r=$(e._getCanvas()),r.css("background-image","url('"+n._backgroundImage+"')").css("background-repeat","no-repeat"),n._backgroundImageLayout===i||n._backgroundImageLayout===u)return;f=n._backgroundImage;n._imageLoader||(n._imageLoader=new t._GcImageLoader(function(){n._paintSpreadBackgroundImage()}));try{if(n._imageLoader.getState(f)){var o=n._imageLoader.getImage(f),s=r.width(),h=r.height();t.util._applyBackgroundImageLayout(e._getCanvas(),s,h,o.width,o.height,n._backgroundImageLayout)}else n._imageLoader.addImage(f)}catch(c){}}},s.prototype.showVerticalScrollbar=function(n){var t=this;return arguments.length===0?t._showVerticalScrollbar:(t._showVerticalScrollbar!==n&&(t._showVerticalScrollbar=n,n?$(t._scrollbarV.getScrollbar()).show():$(t._scrollbarV.getScrollbar()).hide(),t._doResize()),t)},s.prototype.showHorizontalScrollbar=function(n){var t=this;return arguments.length===0?t._showHorizontalScrollbar:(t._showHorizontalScrollbar!==n&&(t._showHorizontalScrollbar=n,n?($(t._scrollbarH.getScrollbar()).show(),t.setTabStripRatio(t.getTabStripRatio())):($(t._scrollbarH.getScrollbar()).hide(),t._setActualTabStripRatio(1)),t._doResize()),t)},s.prototype.allowUserZoom=function(n){return arguments.length===0?this._allowUserZoom:(this._allowUserZoom=n,this)},s.prototype.allowSheetReorder=function(n){return arguments.length===0?this._allowSheetReorder:(this._allowSheetReorder=n,this)},s.prototype.allowUserResize=function(n){return arguments.length===0?this._allowUserResize:(this._allowUserResize=n,this)},s.prototype.tabStripVisible=function(n){var t=this;return arguments.length===0?t._tabStripVisible:(t._tabStripVisible!==n&&(t._tabStripVisible=n,t._doResize()),t)},s.prototype.tabEditable=function(n){return arguments.length===0?this._tabEditable:(this._tabEditable=n,this)},s.prototype.newTabVisible=function(n){var t=this;return arguments.length===0?t._newTabVisible:(t._newTabVisible!==n&&(t._newTabVisible=n,t._doTabHSResize()),t)},s.prototype.cutCopyIndicatorVisible=function(n){var t=this,i;return arguments.length===0?t._cutCopyIndicatorVisible:t._cutCopyIndicatorVisible===n?t:(i=t.getActiveSheet(),i?i._bindToAutoRefresh(function(n){return t._cutCopyIndicatorVisible=n,t})(n):(t._cutCopyIndicatorVisible=n,t))},s.prototype.cutCopyIndicatorBorderColor=function(n){var t=this,i;return arguments.length===0?t._cutCopyIndicatorBorderColor:t._cutCopyIndicatorBorderColor===n?t:(i=t.getActiveSheet(),i?i._bindToAutoRefresh(function(n){return t._cutCopyIndicatorBorderColor=n,t})(n):(t._cutCopyIndicatorBorderColor=n,t))},s.prototype.canUserEditFormula=function(n){return arguments.length===0?t.util.hasCalc()&&this._canUserEditFormula:(this._canUserEditFormula=n,this)},s.prototype.autoFitType=function(n){return arguments.length===0?this._autoFitType:(this._autoFitType=n,this)},s.prototype.startSheetIndex=function(n){var t=this,i;return arguments.length===0?t._tab?t._firstTabUserSet:0:(t._tab&&0<=n&&n<t.getSheetCount()&&(t._firstTabUserSet=n,t.sheets[n].visible()?t._tab._firstTab=n:(i=t._tab._getNextVisibleIndex(n),i!==-1&&(t._tab._firstTab=i))),t._doTabHSResize(),t)},s.prototype.highlightInvalidData=function(n){if(arguments.length===0)return this._highlightInvalidData;var t=this,i=this.getActiveSheet();if(i)return i._bindToAutoRefresh(function(n){return t._highlightInvalidData=n,t})(n);else t._highlightInvalidData=n},s.prototype.isPaintSuspended=function(n){var t=this,i;if(arguments.length===0)return t._paintSuspended;else{if(t._paintSuspended!==n){for(t._paintSuspended=n,i=0;i<t.sheets.length;i++)t.sheets[i].isPaintSuspended(n);t._tab&&t._tab.isPaintSuspended(n)}return t}},s.prototype.repaint=function(){var n=this,t;n._tab&&n._tab.repaint();n.touchToolStrip&&n.touchToolStrip.repaint();t=n.getActiveSheet();t&&t.repaint()},s.prototype.invalidateLayout=function(){var n=this.getActiveSheet();n&&n.invalidateLayout()},s.prototype.getActiveSheet=function(){return this.sheets.length>0?this.sheets[this._activeSheetIndex]:i},s.prototype.setActiveSheet=function(n){for(var i=this.sheets,t=0;t<i.length;t++)i[t].getName()===n&&this.setActiveSheetIndex(t)},s.prototype.getActiveSheetIndex=function(){return this._activeSheetIndex},s.prototype.setActiveSheetIndex=function(n){var t,i,r;typeof n=="number"&&(t=this,n!==t._activeSheetIndex)&&(i=t.sheets[n],i&&i.visible())&&(r=t.getActiveSheet(),t._activeSheetIndex=n,i!==r&&(r&&r._dispose(),t._setActiveSheetImp(i)),t._doResize())},s.prototype.addNamedStyle=function(n){this._addNamedStyleImp(n,!0)},s.prototype._addNamedStyleImp=function(n,r){var e=this,o,f;if(n!==i&&n!==u){if(n.name===i||n.name===u||n.name==="")throw new Error(t.SR.Exp_EmptyNamedStyle);r?(f=n.name.toUpperCase(),o=e.getActiveSheet(),o?o._bindToAutoRefresh(function(n){e._namedStyles[f]=n})(n):e._namedStyles[f]=n):(f=n.name.toUpperCase(),e._namedStyles[f]=n)}},s.prototype.getNamedStyle=function(n){var t=this._namedStyles;return t&&n?(n=n.toUpperCase(),t[n]||i):i},s.prototype.removeNamedStyle=function(n){var t=this._namedStyles,i;t&&n&&(n=n.toUpperCase(),t.hasOwnProperty(n)&&(delete t[n],i=this.getActiveSheet(),i&&i.invalidate()))},s.prototype.getNamedStyles=function(){var n=[],t=this._namedStyles;return t&&$.each(t,function(t,i){n.push(i)}),n},s.prototype._setActiveSheetImp=function(n){n._setHost(this._vp);window.gcGlobal.activeElement=i;this._suspendSetFocus||n.setFocus();n._syncHScollbarPosition();n._syncVScrollbarPosition()},s.prototype.addSheet=function(n,r){var u=this,f,a,e,c,l,o;for(r||(r=u._createSheet(u._getDefaultSheetName(n))),r._name||(r._name=u._getDefaultSheetName(n)),a=u.sheets.length,f=0;f<a;f++)if(u.sheets[f]._name===r._name)throw t.SR.Exp_NotSupport;if(u._copyUserEvents(r),e=i,u.sheets.length>0)for(f=0;!e&&f<u.sheets.length;f++)e=u.sheets[f]._getSheetSource();var s=u.getActiveSheet(),v=u._activeSheetIndex,y=u.sheets.length-n,h=[];for(f=0;f<y&&u.sheets.length>0;f++)h.push(u.sheets.pop());for(c=u.isPaintSuspended(),r._paintSuspended!==c&&(r._paintSuspended=c),u.sheets.push(r),r.parent=u,r.calcService=u.calcService,r.updateCalcContexts(),e&&(l=r._getSheetSource(),l&&l.shareCalculations(e));h.length>0;)u.sheets.push(h.pop());u.sheets.length===1?(u._vp&&r._setHost(u._vp),u._activeSheetIndex=0):u._activeSheetIndex=v;o=u.getActiveSheet();o!==s&&(s&&s._dispose(),o&&u._setActiveSheetImp(o),u._doResize());u._tab&&u._tab.repaint()},s.prototype.removeSheet=function(n){var i=this,h,f,c,o,r,u,e,s;if(isNaN(n)||n<0||n>=i.sheets.length)throw new Error(t.SR.Exp_IndexOutOfRange);if(h=n<=i._activeSheetIndex||n===i.sheets.length-1,f=i.getActiveSheet(),n<i._activeSheetIndex&&i._activeSheetIndex--,c=i.sheets[n],c._disposeUserEvents(),i.sheets.splice(n,1),o=i.sheets,r=o.length,r===0)i._activeSheetIndex=-1;else if(i._activeSheetIndex>=r)i._activeSheetIndex=i._tab._getPreVisibleIndex(r);else{for(u=i._activeSheetIndex;u<r;u++)if(o[u]._visible){i._activeSheetIndex=u;break}u>=r&&(i._activeSheetIndex=-1)}h&&(e=i.sheets[i._activeSheetIndex],f!==e&&(f&&f._dispose(),e&&i._setActiveSheetImp(e)));i.calcService&&i.calcService.contextChanged();i._tab&&(s=i.sheets.length,i._tab._firstTab>=s?i.startSheetIndex(i._tab._getPreVisibleIndex(s)):i._tab._firstTab<0?i.startSheetIndex(0):i._doResize())},s.prototype.clearSheets=function(){for(var n=this,t=n.sheets,r=n.getActiveSheet(),i=0;i<t.length;i++)t[i]._disposeUserEvents(),t[i]._dispose();t.splice(0,t.length);n.calcService&&n.calcService.contextChanged();n._activeSheetIndex=-1;n._tab&&(n._tab._firstTab=0,n._tab.repaint())},s.prototype.getSheet=function(n){return n>=0&&n<this.sheets.length?this.sheets[n]:i},s.prototype.getSheetFromName=function(n){for(var r=this.sheets,t=0;t<r.length;t++)if(r[t].getName()===n)return r[t];return i},s.prototype.getSheetIndex=function(n){for(var r=this.sheets,t=0;t<r.length;t++)if(r[t].getName()===n)return t;return i},s.prototype.getSheetCount=function(){return this.sheets.length},s.prototype.setSheetCount=function(n){var u=this,r,i;if(n<0)throw t.SR.Exp_ArgumentOutOfRange;else n===0&&u.clearSheets();if(r=u.sheets.length,n<r)for(i=r-1;i>=n;i--)u.removeSheet(i);else if(n>r)for(i=r;i<n;i++)u.addSheet(i)},s.prototype.search=function(n){var r,e,u,o,f;if(!n||!t.features.search)return i;if(r=this,e=0,!n.searchString||n.searchTarget===e||r.getSheetCount()<=0)return new t.SearchResult;if(n.startSheetIndex===-1&&(n.startSheetIndex=0),n.endSheetIndex===-1&&(n.endSheetIndex=r.getSheetCount()-1),n.endSheetIndex>=n.startSheetIndex&&0<=n.startSheetIndex&&n.startSheetIndex<r.getSheetCount()&&0<=n.endSheetIndex&&n.endSheetIndex<r.getSheetCount())for(u=n.startSheetIndex;u<=n.endSheetIndex;u++)if(o=r.getSheet(u),f=o.search(n),f&&f.searchFoundFlag!==e)return f.foundSheetIndex=u,f;return new t.SearchResult},s.prototype.showCell=function(n,t,i,r){var u=this.getActiveSheet();u&&u.showCell(n,t,i,r)},s.prototype.showColumn=function(n,t){var i=this.getActiveSheet();i&&i.showColumn(n,t)},s.prototype.showRow=function(n,t){var i=this.getActiveSheet();i&&i.showRow(n,t)},s.prototype.showActiveCell=function(n,t){var i=this.getActiveSheet();i&&i.showCell(i._activeRowIndex,i._activeColIndex,n,t)},s.prototype.getCustomName=function(n){return this._names?this._names[n]:i},s.prototype.getCustomNames=function(){var n=[];return this._names&&$.each(this._names,function(t,i){n.push(i)}),n},s.prototype.addCustomName=function(n,r,f,e){var o,s;if(n===u||n===i||n===""||r===u||r===i||r==="")throw new Error(t.SR.Exp_InvalidCustomName);o=this;o._names||(o._names={});o.calcService&&(s=o.calcService.parse(r,f,e),o._names[n]=new t.NameInfo(n,s,f,e),o._recalcAll())},s.prototype.removeCustomName=function(n){var t=this;t._names&&n!==u&&n!==i&&n!==""&&t._names.hasOwnProperty(n)&&(delete t._names[n],t._recalcAll())},s.prototype.clearCustomNames=function(){this._names&&(delete this._names,this._recalcAll())},s.prototype._findCustomName=function(n){if(n===u||n===i||n==="")return i;return this.getCustomName(n)},s.prototype.addCustomFunction=function(n){if(t.util.hasCalc()){if(n===u||n===i||!(n instanceof t.Calc.Functions.Function))throw new Error(t.SR.Exp_InvalidCustomFunction);var r=this,f=n.name.toUpperCase();r._functions||(r._functions=[]);r._functions[f]=n;r._recalcAll()}},s.prototype.getCustomFunction=function(n){return this._functions&&n!==u&&n!==i&&n!==""?this._functions[n.toUpperCase()]:i},s.prototype.removeCustomFunction=function(n){var t=this;t._functions&&n!==u&&n!==i&&n!==""&&(n=n.toUpperCase(),t._functions.hasOwnProperty(n)&&(delete t._functions[n],t._recalcAll()))},s.prototype.clearCustomFunctions=function(){this._functions&&(this._functions=i,this._recalcAll())},s.prototype._recalcAll=function(){this.calcService&&!this.calcService.IsSuspended()&&this.calcService.recalculateAll()},s.prototype.addCustomFunctionDescription=function(n){if(n&&n.name&&!this.getCustomFunctionDescription(n.name)){var t=this._functionDescriptions;t||(t=this._functionDescriptions=[]);t.push(n)}},s.prototype.getCustomFunctionDescription=function(n){var u=this._functionDescriptions,f,t,r;if(u&&n)for(n=n.toUpperCase(),f=u.length,r=0;r<f;r++)if(t=u[r],t.name&&t.name.toUpperCase()===n)return t;return i},s.prototype.removeCustomFunctionDescription=function(n){var i=this._functionDescriptions,u,r,t;if(i&&n)for(n=n.toUpperCase(),u=i.length,t=0;t<u;t++)if(r=i[t],r.name&&r.name.toUpperCase()===n){i.splice(t,1);break}},s.prototype.clearCustomFunctionDescriptions=function(){this._functionDescriptions&&(this._functionDescriptions=i)},s.prototype.referenceStyle=function(n){var t=this,i=1,r=0;return arguments.length===0?t.calcService?t.calcService.useR1C1?i:r:r:(t.calcService&&(t.calcService.useR1C1=n===i),t)},s.prototype.bind=function(n,t,i){var r=this,u,f;for(r._userEvents.push({type:n,data:t,fn:i}),$(r._userEventsElem).bind(n+c,t,i),u=0;u<r.sheets.length;u++)f=r.sheets[u],f.bind(n,t,i)},s.prototype.unbind=function(n,t){for(var f,u,e,i=this,r=0;r<i._userEvents.length;r++)f=i._userEvents[r],f.type===n&&i._userEvents.splice(r,1);for($(i._userEventsElem).unbind(n+c,t),u=0;u<i.sheets.length;u++)e=i.sheets[u],e.unbind(n,t)},s.prototype.unbindAll=function(){var n=this,t,i;for(n._userEvents.length=0,$(n._userEventsElem).unbind(c),t=0;t<n.sheets.length;t++)i=n.sheets[t],i.unbindAll()},s.prototype.suspendEvent=function(){var n,t;for(this._eventSuspended++,n=0;n<this.sheets.length;n++)t=this.sheets[n],t.suspendEvent()},s.prototype.resumeEvent=function(){var n=this,t,i;for(n._eventSuspended--,n._eventSuspended<0&&(n._eventSuspended=0),t=0;t<n.sheets.length;t++)i=n.sheets[t],i.resumeEvent()},s.prototype.saveData=function(){var t=this,y,e,o,n,l,a,r,s,v,h,w;if(t._host&&(y=t._host.id,e=f.getElementById(y+vi),e!==u&&e!==i)){var p=t.getSheetCount(),c=[],b={activeSheetIndex:t.getActiveSheetIndex(),sheetCount:p,tabStripRatio:t.getTabStripRatio(),tabStripVisible:t._tabStripVisible,tabEditable:t._tabEditable,newTabVisible:t._newTabVisible,allowCellOverflow:t.getActiveSheet()?t.getActiveSheet()._allowCellOverflow:!1,theme:t.getActiveSheet().currentTheme().name()};for(c.push(JSON.stringify(b)),o=0;o<p;o++){n=t.getSheet(o);l="";n.deletedRows&&(l=JSON.stringify(n.deletedRows));a={};for(r in n._rowInfos)typeof r!="function"&&(s=n._rowInfos[r],s&&s.dirty&&(a[r]=s));v={};for(r in n._colInfos)typeof r!="function"&&(h=n._colInfos[r],h&&h.dirty&&(v[r]=h));w={name:n._name,ar:n._activeRowIndex,ac:n._activeColIndex,columns:v,rows:a,rowCount:n.getRowCount(),columnCount:n.getColumnCount(),data:n._dataModel.dirtyNodes,deletedRows:l,spans:n._getSpanModel(),rowHeaderAutoText:n.rowHeaderAutoText,colHeaderAutoText:n.colHeaderAutoText,referenceStyle:n.referenceStyle(),gridline:n.gridline,frozenRowCount:n.frozenRowCount,frozenColCount:n.frozenColCount,frozenTrailingRowCount:n._frozenTrailingRowCount,frozenTrailingColCount:n._frozenTrailingColCount};c.push(JSON.stringify(w))}e.value=JSON.stringify(c)}},s.prototype.doCommand=function(n){this._undoManager.doAction(n)},s.prototype.allowUndo=function(n){var t=this;return arguments.length===0?t._allowUndo:(t._allowUndo=n,t._undoManager&&(t._undoManager._allowUndo=n),t)},s.prototype.undoManager=function(){var n=this;return n._undoManager||(n._undoManager=new t._UndoManager(n,-1,n.allowUndo())),n._undoManager},s.prototype.canUserDragDrop=function(n){return arguments.length===0?this._allowDragDrop:(this._allowDragDrop=n,this)},s.prototype.canUserDragFill=function(n){var i=this,r;return arguments.length===0?t.features.fill?i._allowDragFill:!1:(i._allowDragFill!==n&&(i._allowDragFill=n,r=i.getActiveSheet(),r&&r.getSelections().length===1&&r._render.repaintSelection(r.getSelections().toArray()[0])),i)},s.prototype.toJSON=function(){var n=this,l=n.getSheetCount(),a={activeSheetIndex:n.getActiveSheetIndex(),sheetCount:l,tabStripRatio:n.getTabStripRatio(),tabStripVisible:n._tabStripVisible,tabEditable:n._tabEditable,newTabVisible:n._newTabVisible,referenceStyle:n.referenceStyle(),useWijmoTheme:n.useWijmoTheme,canUserEditFormula:n._canUserEditFormula,startSheetIndex:n.startSheetIndex(),allowUndo:n._allowUndo,allowUserZoom:n._allowUserZoom,allowUserResize:n._allowUserResize,allowDragDrop:n._allowDragDrop,allowDragFill:n._allowDragFill,allowSheetReorder:n._allowSheetReorder,highlightInvalidData:n._highlightInvalidData,autoFitType:n._autoFitType,showScrollTip:n._showScrollTip,showResizeTip:n._showResizeTip,showDragDropTip:n._showDragDropTip,showDragFillTip:n._showDragFillTip,showHorizontalScrollbar:n._showHorizontalScrollbar,showVerticalScrollbar:n._showVerticalScrollbar,backColor:n._backColor,backgroundImage:n._backgroundImage,backgroundImageLayout:n._backgroundImageLayout,grayAreaBackColor:n._grayAreaBackColor,cutCopyIndicatorVisible:n._cutCopyIndicatorVisible,cutCopyIndicatorBorderColor:n._cutCopyIndicatorBorderColor,useTouchLayout:n._useTouchLayout},i={version:"2.0"},s,r,u,h,f,t,e,c;for(t in a)s=a[t],n._isDefaultValue(t,s)||(i[t]=s);for(r={},u=0;u<l;u++)h=n.getSheet(u),r[h._name]=h.toJSON();if($.isEmptyObject(r)||(i.sheets=r),f=[],n._namedStyles)for(t in n._namedStyles)f.push(n._namedStyles[t]);if(f.length>0&&(i.namedStyles=f),e=[],n._names&&n.calcService)for(c in n._names)if(n._names.hasOwnProperty(c)){var o=n._names[c],p=o.getName(),v=o.getRow(),y=o.getColumn(),w=o.getExpression(),b=n.calcService.unparse(w,v,y);e.push({name:p,formula:b,row:v,col:y})}return e.length>0&&(i.names=e),i},s.prototype._isDefaultValue=function(n,t){switch(n){case"activeSheetIndex":return t===this._defaultActiveSheetIndex;case"sheetCount":return t===this._defaultSheetCount;case"tabStripRatio":return t===.5;case"tabStripVisible":return t===!0;case"tabEditable":return t===!0;case"newTabVisible":return t===!0;case"referenceStyle":return t===0;case"useWijmoTheme":return t===!1;case"canUserEditFormula":return t===!0;case"startSheetIndex":return t===0;case"allowUndo":return t===!0;case"allowUserZoom":return t===!0;case"allowUserResize":return t===!0;case"allowDragDrop":return t===!0;case"allowDragFill":return t===!0;case"allowSheetReorder":return t===!0;case"highlightInvalidData":return t===!1;case"autoFitType":return t===0;case"showScrollTip":return t===0;case"showResizeTip":return t===0;case"showDragDropTip":return t===!0;case"showDragFillTip":return t===!0;case"showHorizontalScrollbar":return t===!0;case"showVerticalScrollbar":return t===!0;case"backColor":return t==="white";case"backgroundImage":return t===i;case"backgroundImageLayout":return t===0;case"grayAreaBackColor":return t==="gray";case"cutCopyIndicatorVisible":return t===!0;case"cutCopyIndicatorBorderColor":return t==="#217346";case"useTouchLayout":return t===!1;default:return}},s.prototype.fromJSON=function(f){var e,g,v,y,p,d,o,w,h,b,k,a,c,s,l;if(f){e=this;e._suspendSetFocus=!0;g=e.isPaintSuspended();e.isPaintSuspended(!0);e.suspendEvent();try{if(t.util.hasCalc()&&(e.calcService=new t.Calc.Service(e)),e._availableSheetIndex=-1,e.clearSheets(),v=f.sheetCount,typeof v===r&&(v=e._defaultSheetCount),e.setSheetCount(v),f.referenceStyle!==i&&f.referenceStyle!==u&&e.referenceStyle(f.referenceStyle),e._namedStyles={},f.namedStyles)for(o=0;o<f.namedStyles.length;o++)y=f.namedStyles[o],p=new t.Style,p.copyFrom(y),typeof y.validator!==r&&(t.features.dataValidator&&(d=new n.spread.DefaultDataValidator,d.fromJSON(y.validator)),p.validator=d),e._addNamedStyleImp(p,!1);if(o=0,h=f.sheets,h)for(c in h)typeof c=="string"&&(s=h[c],l=s.index!==u?s.index:s._index,w=l!=u?e.sheets[l]:e.sheets[o],w.fromJSON(s,!1),o++);if(b=f.activeSheetIndex,typeof b===r&&(b=e._defaultActiveSheetIndex),e.setActiveSheetIndex(b),typeof f.tabStripRatio!==r&&e.setTabStripRatio(f.tabStripRatio),typeof f.tabStripVisible!==r&&(e._tabStripVisible=f.tabStripVisible),typeof f.tabEditable!==r&&(e._tabEditable=f.tabEditable),typeof f.newTabVisible!==r&&(e._newTabVisible=f.newTabVisible),e.gcSpreadsheet=f.gcSpreadsheet,typeof f.useWijmoTheme!==r&&(e.useWijmoTheme=f.useWijmoTheme),typeof f.canUserEditFormula!==r&&(e._canUserEditFormula=f.canUserEditFormula),typeof f.startSheetIndex!==r&&e.startSheetIndex(f.startSheetIndex),typeof f.allowUndo!==r&&e.allowUndo(f.allowUndo),typeof f.allowUserZoom!==r&&(e._allowUserZoom=f.allowUserZoom),typeof f.allowUserResize!==r&&(e._allowUserResize=f.allowUserResize),typeof f.allowDragDrop!==r&&(e._allowDragDrop=f.allowDragDrop),typeof f.allowDragFill!==r&&(e._allowDragFill=f.allowDragFill),typeof f.allowSheetReorder!==r&&(e._allowSheetReorder=f.allowSheetReorder),typeof f.highlightInvalidData!==r&&(e._highlightInvalidData=f.highlightInvalidData),typeof f.autoFitType!==r&&e.autoFitType(f.autoFitType),typeof f.showResizeTip!==r&&(e._showResizeTip=f.showResizeTip),typeof f.showScrollTip!==r&&(e._showScrollTip=f.showScrollTip),typeof f.showDragDropTip!==r&&(e._showDragDropTip=f.showDragDropTip),typeof f.showDragFillTip!==r&&(e._showDragFillTip=f.showDragFillTip),typeof f.showHorizontalScrollbar!==r&&e.showHorizontalScrollbar(f.showHorizontalScrollbar),typeof f.showVerticalScrollbar!==r&&e.showVerticalScrollbar(f.showVerticalScrollbar),typeof f.backColor!==r&&e.backColor(f.backColor),typeof f.backgroundImage!==r&&e.backgroundImage(f.backgroundImage),typeof f.backgroundImageLayout!==r&&e.backgroundImageLayout(f.backgroundImageLayout),typeof f.grayAreaBackColor!==r&&e.grayAreaBackColor(f.grayAreaBackColor),typeof f.cutCopyIndicatorVisible!==r&&e.cutCopyIndicatorVisible(f.cutCopyIndicatorVisible),typeof f.cutCopyIndicatorBorderColor!==r&&e.cutCopyIndicatorBorderColor(f.cutCopyIndicatorBorderColor),typeof(f.useTouchLayout!==r)&&e.useTouchLayout(f.useTouchLayout),e.calcService&&e.calcService.suspend(),e.clearCustomNames(),f.names)for(k=0;k<f.names.length;k++)a=f.names[k],e.addCustomName(a.name,a.formula,a.row,a.col);if(h){o=0;for(c in h)typeof c=="string"&&(s=h[c],l=s.index!==u?s.index:s._index,w=l!=u?e.sheets[l]:e.sheets[o],w.formulaFromJSON(s),o++)}e.calcService&&(f.noRecalc?e.calcService.resumeWithoutCalc():e.calcService.resume(!0))}finally{e._suspendSetFocus=!1;e.getActiveSheet().setFocus();e.resumeEvent();e.isPaintSuspended(g)}}},s.prototype.setTabStripRatio=function(n,i){var r;if(typeof i=="undefined"&&(i=!1),isNaN(r=n))throw t.SR.Exp_InvalidArgument;var u=this,e=$(u._vp).width(),f=u._tab._resizeBarWidth/e;u._tabStripRatio=r<f?f:r>1?1:r;u._tabStripRatioUserSet=r<0?0:r>1?1:r;u._doTabHSResize()},s.prototype.getTabStripRatio=function(){return this._tabStripRatioUserSet},s.prototype._getActualTabStripRatio=function(){return this.showHorizontalScrollbar()?this._tabStripRatio:1},s.prototype._setActualTabStripRatio=function(n){this._tabStripRatio=n},s.prototype.showScrollTip=function(n){return arguments.length===0?this._showScrollTip:(this._showScrollTip=n,this)},s.prototype.showResizeTip=function(n){return arguments.length===0?this._showResizeTip:(this._showResizeTip=n,this)},s.prototype.showDragDropTip=function(n){return arguments.length===0?t.util.hasCalc()?this._showDragDropTip:!1:(this._showDragDropTip=n,this)},s.prototype.showDragFillTip=function(n){return arguments.length===0?t.features.fill?this._showDragFillTip:!1:(this._showDragFillTip=n,this)},s.prototype.grayAreaBackColor=function(n){if(arguments.length===0)return this._grayAreaBackColor;var t=this,i=this.getActiveSheet();if(i)return i._bindToAutoRefresh(function(n){return t._grayAreaBackColor=n,t})(n);else t._grayAreaBackColor=n},s.prototype.backColor=function(n){if(arguments.length===0)return this._backColor;var t=this,i=this.getActiveSheet();if(i)return i._bindToAutoRefresh(function(n){return t._backColor=n,t})(n);else t._backColor=n},s.prototype.backgroundImage=function(n){var t=this,i;return arguments.length===0?t._backgroundImage:(i=t.getActiveSheet(),i?i._bindToAutoRefresh(function(n){return t._backgroundImage=n,t._paintSpreadBackgroundImage(),t})(n):(t._backgroundImage=n,t))},s.prototype.backgroundImageLayout=function(n){var t=this;return arguments.length===0?t._backgroundImageLayout:(t._backgroundImageLayout=n,t._paintSpreadBackgroundImage(),t)},s.prototype._findTable=function(n){var r,f,t,e,u;if(!this.sheets||this.sheets.length===0)return i;for(r=this.sheets,f=r.length,t=0;t<f;t++)if(e=r[t],u=e.findTableByName(n),u)return u;return i},s.prototype.addSparklineEx=function(n){var t=this._sparklineExs;n&&t&&(t[n.name()]=n)},s.prototype.getSparklineEx=function(n){var t=this._sparklineExs;return t&&t[n]},s.prototype.removeSparklineEx=function(n){var t=this._sparklineExs;t&&(t[n]=u)},s.prototype.useTouchLayout=function(n){var t=this;return arguments.length===0?t._useTouchLayout:(t._useTouchLayout=n,t._doResize(),t)},s.prototype._getScrollbarSize=function(){return 18},s.prototype.suspendCalcService=function(n){this.calcService&&this.calcService.suspend(n)},s.prototype.resumeCalcService=function(n){this.calcService&&this.calcService.resume(n)},s}();t.Spread=yi;var p=".gcTab",g=".tabNameEditor",kt=".spliter",a="mouse",pi="down",dt="move",gt="up",wi="out",bi="focusin",ki="focusout",di="keydown",ni=a+dt+kt,ti=a+gt+kt,ii=di+g,ri=bi+g,ui=ki+g,nt=a+pi+p,tt=a+dt+p,it=a+gt+p,rt=a+wi+p,ut="dblclick"+p,fi="canvas",ft="2d",et="resizeBar",ot="navButton",v="tab",d="newTab",y="#FFFFFF",ei="#D8E7FA",oi="#D5E5F9",si="#B6D2F5",hi="#D9E7F9",ci="#688CAF",li="#92A5C7",st="black",ht="white",h=4,gi="tab-tip-span",nr=function(){function n(n){var t=this;t._spread=i;t._activeIndex=0;t._firstTab=0;t._tabLeftPadding=12;t._tabRightPadding=8;t._tabSpace=3;t._activePos=70;t._hoverNavButton=-1;t._hoverTab=-1;t._newTabSize=48;t._firstTabSpace=5;t._font="10pt Arial";t._resizeBarWidth=8;t._tabSizes=[];t._targetTabIndex=-1;t._sourceTabIndex=-1;t._reorderSpeedTimeout=i;t._paintSuspended=!1;t._init(n)}return n.prototype._init=function(n){this._bounds=new t.Rect(0,0,200,20);this.name=n},n.prototype._setHost=function(n){var i=this,r=f.createElement(fi);r.setAttribute("id",i.name);i._tabIndicator=i._getTabIndicator();n.appendChild(i._tabIndicator[0]);n.appendChild(r);r.gcObject=!0;i.canvas&&($(i.canvas).unbind(nt).unbind(tt).unbind(it).unbind(rt).unbind(ut),i._unbindTouchEvents(),i.canvas.parentNode.removeChild(i.canvas));i.canvas=r;!t.util._isStandardCanvas()&&t.util._isSilverlightCanvas()&&(r.setAttribute("renderMethod","auto"),r.setAttribute("onload",i._test(i)));$(r).bind(nt,t.util.createEventHandler(i,i.doMouseDown)).bind(tt,t.util.createEventHandler(i,i.doMouseMove)).bind(it,t.util.createEventHandler(i,i.doMouseUp)).bind(rt,t.util.createEventHandler(i,i.doMouseOut)).bind(ut,t.util.createEventHandler(i,i.doMouseDbClick));i._bindTouchEvents();i.doResize()},n.prototype._unbindTouchEvents=function(){this._touchManager&&this._touchManager.unbindTouchEvents()},n.prototype._bindTouchEvents=function(){if(t.features.touch){var n=this,i=new t.TabStripTouchManager(n.canvas,n,n._spread._touchEventProvider);i.bindTouchEvents();n._touchManager=i;n._resizeBarWidth=12}},n.prototype._getTabIndicator=function(){return $("<div>").css({position:"absolute","border-style":"solid","border-color":st,"border-width":h,display:"none",width:"0","border-bottom":"0","border-left-color":"transparent","border-right-color":"transparent"})},n.prototype._getNavigationButtonWidth=function(){var t=0,n=this._spread;return n&&(t=n.useTouchLayout()?n._getScrollbarSize()*2:n._getScrollbarSize()),t},n.prototype._getNavigationButtonHeight=function(){return this._spread?this._spread._getScrollbarSize():0},n.prototype._getTabStartPosition=function(){return this._getNavigationButtonWidth()*4+2},n.prototype._test=function(n){return n._spread.initPaint(n._spread)},n.prototype.setOwner=function(n){this._spread=n;n&&n._font&&n._font.length>0&&(this._font=n._font)},n.prototype._dispose=function(){var n=this.canvas;n&&($(n).unbind(nt).unbind(tt).unbind(it).unbind(ut).unbind(rt),n.parentNode.removeChild(n))},n.prototype.getBounds=function(){return this._bounds},n.prototype.setBounds=function(n){var t=this._bounds;t.x=n.x;t.y=n.y;t.width=n.width;t.height=n.height},n.prototype._clearRepeatDown=function(){this._repeatDown&&(window.clearTimeout(this._repeatDown),this._repeatDown=i)},n.prototype.doNavButtonClick=function(n,t){var i=this,r,u;if(i._clearRepeatDown(),r=i._getVisibleTabs(),!(r.length<=0)){u=200;switch(n){case 0:i._navigateToFirst(r);break;case 1:t||(i._repeatDown=window.setTimeout(function(){i.doNavButtonClick(1)},u));i._navigateToPrevious(r);break;case 2:t||(i._repeatDown=window.setTimeout(function(){i.doNavButtonClick(2)},u));i._navigateToNext(r);break;case 3:i._navigateToLast(r);break;default:return}}},n.prototype._getVisibleTabs=function(){for(var t=[],n=0;n<this._spread.sheets.length;n++)this._tabVisible(n)&&t.push(n);return t},n.prototype._navigateToFirst=function(n){n.length<=0||this._firstTab!=n[0]&&this._spread.startSheetIndex(n[0])},n.prototype._navigateToPrevious=function(n){var t,i;n.length<=0||(t=this,t._firstTab>n[0]&&(i=t._getPreVisibleIndex(t._firstTab),i!==-1&&t._spread.startSheetIndex(i)))},n.prototype._navigateToNext=function(n){var t,i;n.length<=0||(t=this,t._firstTab<n[n.length-1]&&(i=t._reCalculateFirstTabIndex(n),i!==-1&&t._spread.startSheetIndex(t._getNextVisibleIndex(t._firstTab))))},n.prototype._navigateToLast=function(n){if(!(n.length<=0)&&this._firstTab<n[n.length-1]){var t=this._reCalculateFirstTabIndex(n);t!==-1&&this._spread.startSheetIndex(t)}},n.prototype._reCalculateFirstTabIndex=function(n){var r,h,e,o;if(n.length<=0)return-1;var t=this,c=t._bounds.width-t._resizeBarWidth,u=0,l=t._tabSizes,i,s,a=t._bounds.height,f=t._getTabStartPosition()+a;for(t._spread._newTabVisible&&(f+=t._newTabSize,f+=t._tabSpace),r=t._getVisibleTabIndex(t._firstTab,n),r===-1&&(r=0),i=n.length-1;i>=r;i--)if(s=n[i],h=l[s],u+=h,i!==n.length-1&&(u+=t._tabSpace),e=f+u,i!==0&&(e+=t._firstTabSpace),e>c)return o=i+1<n.length?n[i+1]:n[n.length-1],t._firstTab<o?o:-1;return-1},n.prototype._getPreVisibleIndex=function(n){for(var i=this._spread.sheets.length,t=n-1;t>=0;t--)if(this._tabVisible(t))return t;return-1},n.prototype._getNextVisibleIndex=function(n){for(var i=this._spread.sheets.length,t=n+1;t<i;t++)if(this._tabVisible(t))return t;return-1},n.prototype._getVisibleTabIndex=function(n,t){for(var i=0;i<=t.length-1;i++)if(n===t[i])return i;return-1},n.prototype._tabVisible=function(n){return this._spread.sheets[n].visible()},n.prototype._hitTest=function(n,t){var i=this,f=i.getBounds(),o,e;if(f.x+f.width-i._resizeBarWidth<n&&n<f.x+f.width&&i._spread.showHorizontalScrollbar())return{element:et};for(var s=-1,r=0,h=i._getNavigationButtonWidth(),u=0;u<4;u++){if(r<=n&&n<r+h){s=u;break}r+=h}if(s!==-1)return{element:ot,index:u};if(r=i._getTabStartPosition(),o=i._getPreVisibleIndex(i._firstTab),o!==-1){if(r<n&&n<r+i._firstTabSpace+i._tabSpace)return{element:v,index:o,position:r};r+=i._firstTabSpace}if(e=0,i._firstTab>-1)for(u=i._firstTab;u<i._spread.sheets.length&&u<i._tabSizes.length;u++)if(i._spread.sheets[u].visible()){if(e=i._tabSizes[u],r<n&&n<r+e+i._tabSpace)return{element:v,index:u,position:r};r+=e+i._tabSpace}return i._spread._newTabVisible&&n>r&&n<r+i._newTabSize?{element:d,position:r}:{element:""}},n.prototype.doSheetTabClick=function(n,i){var r=this,e=t.Events,h,o,u,f,s;r._activeIndex=n;r._activePos=i;h=r._spread.isPaintSuspended();r._spread.isPaintSuspended(!0);o=r._spread.getActiveSheet();u=r._spread.getSheet(n);u&&u.isEditing()&&u.endEdit();r._spread._trigger(e.SheetTabClick,{sheet:u,sheetName:u._name,sheetTabIndex:n});n!==r._spread._activeSheetIndex&&(f={oldSheet:o,newSheet:u,cancel:!1},r._spread._trigger(e.ActiveSheetChanging,f),f&&f.cancel===!1&&(r._spread.setActiveSheetIndex(n),this._spread._trigger(e.ActiveSheetChanged,{oldSheet:o,newSheet:u}),s=r._getNextVisibleIndex(r._firstTab),r._activeIndex>r._firstTab&&r._activePos+r._tabSizes[r._activeIndex]>r.getBounds().width-r._resizeBarWidth&&s!=-1&&(r._firstTab=s)));r._activeIndex<r._firstTab&&(r._firstTab=r._getPreVisibleIndex(r._firstTab));r._spread.isPaintSuspended(h);r.repaint()},n.prototype.doNewTabClick=function(n){var r=this,s=t.Events,u=r._spread,h=u.getActiveSheet(),f,e,o;if(u._trigger(s.SheetTabClick,{sheet:i,sheetName:i,sheetTabIndex:-1}),f=u.sheets.length,e=u._createSheet(u._getDefaultSheetName(f)),u.addSheet(f,e),r._activeIndex=f,r._activePos=n,o={oldSheet:h,newSheet:e,cancel:!1},u._trigger(s.ActiveSheetChanging,o),o&&o.cancel===!1){for(u.setActiveSheetIndex(f),u._trigger(s.ActiveSheetChanged,{oldSheet:h,newSheet:e});r._activeIndex>r._firstTab&&r._activePos+r._tabSizes[r._activeIndex]+r._newTabSize>r.getBounds().width-r._resizeBarWidth;)u.sheets[r._firstTab].visible()&&(r._activePos-=r._tabSizes[r._firstTab]),r._firstTab++;r.repaint()}},n.prototype.doMouseDown=function(n){var o=t.util.device(),h=o.ipad||o.iphone,r,u,a,e;if(!h){if(r=this,r._touchManager&&r._touchManager.preProcessMouseDown(n))return t.util.cancelDefault(n),!1;var s=$(r._getCanvas()).offset(),c=n.pageX-s.left,l=n.pageY-s.top,f=r._spread.getActiveSheet(),y;if(r._tabNameEditor&&r.endSheetTabEditing(f,!1),u=r._hitTest(c,l),a=t.Events,n.button===0&&(u.element===et?(r.resizeTab=!0,r.activeX=n.pageX,r.handleDocumentMouseMove()):u.element===ot?r.doNavButtonClick(u.index):u.element===v?(r.doSheetTabClick(u.index,u.position),r._initTabReorder(u)):u.element===d&&r.doNewTabClick(u.position),f=r._spread.getActiveSheet(),e=f&&f._eventHandler,e&&!f.isEditing()))try{e._tabStripHitTestResult={left:n.pageX,top:n.pageY};f.setFocus()}finally{e._tabStripHitTestResult=i}return r._isMouseDownInTab=!0,!1}},n.prototype._initTabReorder=function(n){var t=this;this._spread._allowSheetReorder?(t._sourceTabIndex=n.index,t._reorderSheet=!0,t._tabTip=t._getTabTip(t._sourceTabIndex),t.handleDocumentMouseMove()):t._reorderSheet=!1},n.prototype._getTabTip=function(n){var r=this._spread.sheets,u=r.length,t,i;if(!(n>=u)&&!(n<0))return t=r[n]._name,t||(t="sheet"),i=$("<span>").text(t).css({position:"absolute",cursor:"default","border-radius":"5px",opacity:".7"}),this._spread.useWijmoTheme?i.addClass("ui-widget-header"):i.addClass("tab-tip-span"),i},n.prototype.doMouseMove=function(n){var c=t.util.device(),a=c.ipad||c.iphone,i,f,e,s,h;if(!a){if(i=this,i._touchManager&&i._touchManager.preProcessMouseMove(n))return t.util.cancelDefault(n),!1;if(f="default",e="w-resize",i.resizeTab){i.canvas.style.cursor=e;var y=n.pageX-i.activeX,o=i._spread._vp.clientWidth,u=i._spread;u.setTabStripRatio(u._getActualTabStripRatio()+y/o,!0);s=i._resizeBarWidth/o;h=1;u._getActualTabStripRatio()<s?(u.setTabStripRatio(s,!0),i.activeX=i._resizeBarWidth):u._getActualTabStripRatio()>=h?(u.setTabStripRatio(h,!0),i.activeX=o):i.activeX=n.pageX}else if(i._reorderSheet)i._showTabTip(n.pageX,n.pageY),i._setTabIndicator(n);else{i._hoverNavButton=-1;i._hoverTab=-1;var l=$(i._getCanvas()).offset(),p=n.pageX-l.left,w=n.pageY-l.top,r=i._hitTest(p,w);if(r.element==="")return i.canvas.style.cursor=f,i.repaint(),!1;else r.element===et?i.canvas.style.cursor=e:(i.canvas.style.cursor=f,r.element===ot?i._hoverNavButton=r.index:r.element===v?i._hoverTab=r.index:r.element===d&&(i._hoverTab=-2));i.repaint()}return!1}},n.prototype._showTabTip=function(n,t){var i=this,r,u;i._tabTip&&$("."+gi).length===0&&(i._tabTip.appendTo(f.body),i._tabTip.hide());r=i._tabTip.width();u=i._tabTip.height();i._tabTip.css({left:n-r/2,top:t-u/2});i._tabTip.show()},n.prototype._setTabIndicator=function(n){var t=this,o=$(t._getCanvas()),u=o.position(),s=o.offset(),e=n.pageX-s.left,p=n.pageY-s.top,f=t._hitTest(e,p),c=t.getBounds(),l=t._getTabStartPosition(),a=t._spread.sheets.length,y=100;e>c.x+c.width-t._resizeBarWidth?t._reorderSpeedTimeout===i&&t._targetTabIndex<a&&(t._reorderSpeedTimeout=setInterval(function(){t._navigateToNext(t._getVisibleTabs());t._targetTabIndex===a?(t._clearSpeedTimeout(),t._tabIndicator.css({left:u.left+t._getLastTabPos()-h,top:u.top-h}),t._tabIndicator.show()):(t._targetTabIndex++,t._tabIndicator.hide())},y)):e<l?t._reorderSpeedTimeout===i&&t._targetTabIndex>0&&(t._reorderSpeedTimeout=setInterval(function(){t._navigateToPrevious(t._getVisibleTabs());t._targetTabIndex===0?(t._clearSpeedTimeout(),t._tabIndicator.css({left:u.left+l-h,top:u.top-h}),t._tabIndicator.show()):(t._targetTabIndex--,t._tabIndicator.hide())},y)):(t._clearSpeedTimeout(),(f.element===v||f.element===d)&&(t._targetTabIndex=typeof f.index!==r?f.index:t._spread.sheets.length,t._tabIndicator.css({left:u.left+f.position-h,top:u.top-h}),t._tabIndicator.show()))},n.prototype._getLastTabPos=function(){for(var f,n=this,e=n._tabSizes,t=n._getVisibleTabs(),o=n._getVisibleTabIndex(n._firstTab,t),u=0,s=n._bounds.height,i=n._getTabStartPosition()+n._firstTabSpace,r=o;r<t.length;r++)u=t[r],f=e[u],i+=f,i+=n._tabSpace;return i},n.prototype.doMouseUp=function(n){var r=t.util.device(),u=r.ipad||r.iphone,i;if(!u)return(i=this,i._touchManager&&i._touchManager.preProcessMouseUp(n))?(t.util.cancelDefault(n),!1):(i.resizeTab&&(i.resizeTab=!1,i._spread._doTabHSResize()),i._clearSpeedTimeout(),i._reorderSheet&&(i._reorderSheet=!1,i._tabTip.remove(),i._reorderTab(),i._tabIndicator.hide()),i._clearRepeatDown(),i.unhandleDocumentMouseMove(),i._isMouseDownInTab?(i._isMouseDownInTab=!1,!1):!0)},n.prototype._reorderTab=function(){var u=this,n=u._targetTabIndex,i=u._sourceTabIndex,f=-1,r,e,t;if(n!==-1&&i!==-1&&i!==n&&i!==n-1&&u._tabIndicator.is(":visible")){if(r=u._spread.sheets,e=r[i],i>n){for(t=i;t>n;t--)r[t]=r[t-1];r[n]=e;f=n}else if(i<n-1){for(t=i;t<n-1;t++)r[t]=r[t+1];r[n-1]=e;f=n-1}u._spread._activeSheetIndex=f;u.doResize()}},n.prototype._clearSpeedTimeout=function(){this._reorderSpeedTimeout!==i&&(window.clearInterval(this._reorderSpeedTimeout),this._reorderSpeedTimeout=i)},n.prototype.doMouseOut=function(n){var r=t.util.device(),e=r.ipad||r.iphone,i,u,f;if(!e)return i=this,i._clearRepeatDown(),u=i._hoverNavButton,i._hoverNavButton=-1,f=i._hoverTab,i._hoverTab=-1,(i._hoverNavButton!==u||i._hoverTab!==f)&&i.repaint(),!1},n.prototype._doMouseDbClickImp=function(n,r){var u=this,y,l,s,h;if(!u._spread._tabEditable)return!1;if(y=u._hitTest(n,r),y.element===v){l=window.gcGlobal.activeElement;l&&l.endEdit&&l.endEdit();window.gcGlobal.activeElement=i;var a=u._activeIndex,c=u._spread.sheets[a],w=u._tabSizes[a],p=$(u._getCanvas()).offset();u._spread._trigger(t.Events.SheetTabDoubleClick,{sheet:c,sheetName:c._name,sheetTabIndex:a});s=f.createElement(vt);h=s.style;s.type="text";s.value=c._name;s.setAttribute("contentEditable","true");s.setAttribute("autocomplete","off");h.position="absolute";h.margin=o;h.padding=o;h.margin=o;h.left=p.left+u._activePos+u._tabLeftPadding+e;h.top=p.top+1+e;h.width=w-u._tabLeftPadding-u._tabRightPadding+2+e;h.backgroundColor=ht;h.borderWidth="0px";h.outline=pt;f.body.insertBefore(s,i);u._tabNameEditor=s;$(s).addClass("sheetTabEditor").bind(ii,function(n){if(n.keyCode===13)return u.endSheetTabEditing(c,!1),!1;else if(n.keyCode===27)return u.endSheetTabEditing(c,!0),!1}).bind(ri,function(n){s.selectionStart=0;s.selectionEnd=s.value.length}).bind(ui,function(n){u.endSheetTabEditing(c,!1)});s.focus()}return!1},n.prototype.doMouseDbClick=function(n){var i=t.util.device(),u=i.ipad||i.iphone;if(!u){var r=$(this._getCanvas()).offset(),f=n.pageX-r.left,e=n.pageY-r.top;return this._doMouseDbClickImp(f,e)}},n.prototype._isValidSheetName=function(n){var r,t,f;if(n===u||n===i||n==="")return!1;for(r=this._spread.sheets.length,t=0;t<r;t++)if(f=this._spread.sheets[t],n===f._name)return!1;return!0},n.prototype.endSheetTabEditing=function(n,r){var e=this,f,o,s,h;e._tabNameEditor&&(f=e._tabNameEditor.value,r===!1&&f!==u&&f!==i&&f!==""&&e._isValidSheetName(f)&&(o={sheet:n,oldValue:n.getName(),newValue:f,cancel:!1},n._trigger(t.Events.SheetNameChanging,o),o&&o.cancel===!1&&(s=new t.UndoRedo.SheetRenameUndoAction(n,f),n._doCommand(s),h={sheet:n,oldValue:n.getName(),newValue:f},n._trigger(t.Events.SheetNameChanged,h))),$(e._tabNameEditor).unbind(ii).unbind(ri).unbind(ui),e._tabNameEditor.parentNode.removeChild(e._tabNameEditor),delete e._tabNameEditor)},n.prototype.handleDocumentMouseMove=function(){var n=this,t;n._isCapture||($(f).bind(ni,function(t){n.doMouseMove(t)}).bind(ti,function(t){n.doMouseUp(t)}),t=n._spread.getActiveSheet(),t&&(t._continueMouseUpBubble=!0),n._isCapture=!0)},n.prototype.unhandleDocumentMouseMove=function(){if(this._isCapture){this._isCapture=!1;$(f).unbind(ni).unbind(ti);var n=this._spread.getActiveSheet();n&&delete n._continueMouseUpBubble}},n.prototype.isPaintSuspended=function(n){var t=this;return arguments.length===0?t._paintSuspended:(t._paintSuspended!==n&&(t._paintSuspended=n,n||t.repaint()),t)},n.prototype.repaint=function(n){var i=this._getCanvas();if(i){if(!i.getContext&&t.util._isSilverlightCanvas()&&!i.getContext)return;i.getContext||typeof window.FlashCanvas===r||window.FlashCanvas.initElement(i);i.getContext&&this.paint(i.getContext(ft),n)}},n.prototype.doResize=function(){var i=this,n=i._getCanvas(),t;n&&n.parentNode&&(t=$(n.parentNode),t.width()!==0&&t.height()!==0)&&(n.style.display=pt,n.width=s(t.width(),0),n.height=s(t.height(),0),n.style.display="",i._bounds.width=n.clientWidth||n.width,i._bounds.height=n.clientHeight||n.height,i.repaint())},n.prototype.paint=function(n,u){var h=this,e,c,y,o,b,l,a,v,p;if(!h._paintSuspended){if(e=h.getBounds(),u){if(u.x>=e.x+e.width)return;if(u.y>=e.y+e.height)return;if(u.x+u.width>e.width&&(u.width=e.width-u.x,u.width<=0))return;if(u.y+u.height>e.height&&(u.height=e.height-u.y,u.height<=0))return;if(u.width<=0||u.height<=0)return}if(y=t.util._useDoubleBuffer(),y&&(o=h.buffer,o&&o.width===e.width&&o.height===e.height||(h.buffer=o=f.createElement(fi),o.width=e.width,o.height=e.height),!o.getContext))if(t.util._isSilverlightCanvas()){if(!o.getContext)return}else if(typeof window.FlashCanvas!==r&&(b=h._getCanvas(),window.FlashCanvas.initElement(b),!o.getContext))return;if(c=y?h.buffer.getContext(ft):n,c.clearRect(0,0,e.width,e.height),c.translate(-e.x,-e.y),h.paintTabs(c,u),c.translate(e.x,e.y),y){l=e.x>=0?0:-e.x;a=e.y>=0?0:-e.y;u&&(l=e.x+u.x,a=e.y+u.y,e=new t.Rect(e.x+u.x,e.y+u.y,u.width,u.height));c=h.buffer.getContext(ft);v=i;try{u?v=c.getImageData(u.x,u.y,u.width,u.height):(p=h._getCanvas(),v=p?c.getImageData(l,a,w(e.width-l,s(p.width-e.x,3)),w(e.height-a,s(p.height-e.y,3))):c.getImageData(l,a,s(e.width-l,0),s(e.height-a,0)))}catch(k){return}l=e.x>=0?e.x:0;a=e.y>=0?e.y:0;v&&e.width>0&&e.height>0&&n.putImageData(v,l,a)}}},n.prototype._getCanvas=function(){var n=this.canvas;return n&&!n.getContext&&n.firstChild&&(n.getContext=n.firstChild.getContext),n},n.prototype._getTabStripBackColor=function(n,t){var r=i,u;return this._spread.useWijmoTheme?(r=n.createLinearGradient(t.x,t.y,t.width,t.height),u=window.gcGlobal.getWijmoThemeStyle(0),r.addColorStop(0,"#DDDDDD"),r.addColorStop(1,u.backgroundColor)):(r=n.createLinearGradient(t.x+.7*t.height,t.y+0,.7*t.height,t.height),r.addColorStop(0,"#7FA1D1"),r.addColorStop(.3,"#A1BADD"),r.addColorStop(1,"#9AB5DB")),r},n.prototype.paintTabs=function(n,r){var f=this,y=f._spread,u,s,v,d,c,ut,g,w,p,nt,b,l;if(n&&y){u=f.getBounds();n.save();n.font=f._font;r?n.rect(r.x,r.y,r.width,r.height):n.rect(u.x,u.y,u.width,u.height);n.clip();n.beginPath();n.fillStyle=f._getTabStripBackColor(n,u);n.fillRect(u.x,u.y,u.width,u.height);var a=60,rt=f._getTabStartPosition(),k=rt;for(f._tabSizes=[],v=y.sheets,s=0;s<v.length;s++)a=n.measureText(v[s]._name).width+f._tabRightPadding+f._tabLeftPadding,f._tabSizes.push(a);if(d=[],c=f._firstTab,c>0&&f._getPreVisibleIndex(c)>=0&&(k+=f._firstTabSpace),c>=0)for(s=c;s<v.length;s++){if(ut=v[s].visible(),a=f._tabSizes[s],k>u.x+u.width)break;d.push({i:s,x:k,w:a,t:v[s]._name,visible:ut});ut&&(k+=a+f._tabSpace)}if(g=f._hoverTab,y._newTabVisible&&(f._newTabSize=n.measureText(t.SR.NewTab).width+f._tabLeftPadding,f.drawTab(n,k,0,f._newTabSize,u.height,5,!1,g===-2,t.SR.NewTab)),f._activeIndex=y.getActiveSheetIndex(),w=f._activeIndex,v.length>0){for(s=d.length-1;s>=0;s--)p=d[s],p.i!==w&&p.visible&&f.drawTab(n,p.x,0,p.w,u.height,5,!1,p.i===g,p.t);c>0&&f._getPreVisibleIndex(c)>=0&&(nt=c-1,a=f._tabSizes[nt],f.drawTab(n,rt+f._firstTabSpace-a-f._tabSpace,0,a,u.height,5,w===nt,g===nt,""));b=d[w-c];w>=c&&w<v.length&&b&&b.visible&&f.drawTab(n,b.x,0,b.w,u.height,5,!0,!1,b.t)}n.fillStyle=li;n.fillRect(u.x,u.y,rt-1,u.height);var o=5,tt=f._getNavigationButtonWidth(),ot=f._getNavigationButtonHeight(),e=tt/2,h=ot/2,it=f._hoverNavButton;if(f.drawNavButton(n,e,h,e+o,h+o,e+o,h-o,!0,e-o,it===0),e+=tt,f.drawNavButton(n,e,h,e+o,h+o,e+o,h-o,!0,i,it===1),e+=tt,f.drawNavButton(n,e,h,e-o,h+o,e-o,h-o,!1,i,it===2),e+=tt,f.drawNavButton(n,e,h,e-o,h+o,e-o,h-o,!1,e+4,it===3),l=f._resizeBarWidth,y.useWijmoTheme){var ft=window.gcGlobal.getWijmoThemeStyle,et=ft(4),st=ft(0);y.showHorizontalScrollbar()&&(e=u.x+u.width-l,n.fillStyle=st.backgroundColor,n.fillRect(e,u.y,l,u.height),n.fillStyle=et.backgroundColor,n.fillRect(e+1,u.y+1,l-2,u.height-2),n.fillStyle=et.color,n.fillRect(e+l/2-1,u.y+4,2,u.height-8))}else y.showHorizontalScrollbar()&&(e=u.x+u.width-l,n.fillStyle=ci,n.fillRect(e,u.y,l,u.height),n.fillStyle="#D7E6F7",n.fillRect(e+1,u.y+1,l-2,u.height-2),n.fillStyle=ht,n.fillRect(e+l/2-1,u.y+4,4,u.height-8),n.fillStyle=ci,n.fillRect(e+l/2-1,u.y+4,1,u.height-8));n.beginPath();n.restore()}},n.prototype.drawNavButton=function(n,t,r,f,e,o,h,c,l,a){var nt,b;n.save();var d=i,g=i,k=this,v=k.getBounds(),p=k._getNavigationButtonWidth();k._spread.useWijmoTheme?(nt=window.gcGlobal.getWijmoThemeStyle,d=nt(4),g=nt(0),a?(n.fillStyle=d.backgroundColor,n.fillRect(t-p/2+2,v.y+2,p-4,v.height-4)):(n.fillStyle=g.backgroundColor,n.fillRect(t-p/2,v.y+1,p,v.height-2))):a?(n.fillStyle="orange",n.fillRect(t-p/2+1,v.y+1,p-2,v.height-2),n.fillStyle="lightyellow",n.fillRect(t-p/2+2,v.y+2,p-4,v.height-4)):(b=n.createLinearGradient(v.x+.7*v.height,v.y+0,.7*v.height,v.height),b.addColorStop(0,y),b.addColorStop(.1,ei),b.addColorStop(.45,oi),b.addColorStop(.45,si),b.addColorStop(.9,hi),b.addColorStop(1,y),n.fillStyle=b,n.fillRect(t-p/2,v.y+1,p,v.height-2));n.fillStyle=k._spread.useWijmoTheme?a?d.color:g.color:st;l!==u&&l!==i&&n.fillRect(l,w(e,h),1,s(e,h)-w(e,h));c?(t-=2,f-=2,o-=2):(t+=2,f+=2,o+=2);n.beginPath();n.moveTo(t,r);n.lineTo(f,e);n.lineTo(o,h);n.lineTo(t,r);n.fill();n.restore()},n.prototype._getTabBackColor=function(n,i,r,u,f){var o=this,s=o.getBounds(),e=n.createLinearGradient(s.x+.7*s.height,s.y+0,.7*s.height,s.height),h=o._spread.getSheetFromName(u),c,a,l;return u===""&&o._firstTab>0&&(h=o._spread.getSheet(o._firstTab-1)),c=!1,f?(e.addColorStop(0,f.backgroundColor),c=!0):h&&h._sheetTabColor&&(a="rgba(0, 0, 0, 0)",n.fillStyle=a,n.fillStyle=t._ThemeContext.getColor(h,h._sheetTabColor),l=n.fillStyle,l===a?c=!1:(r||i?(e.addColorStop(0,y),e.addColorStop(.45,"#F1F6FD"),e.addColorStop(.9,l),e.addColorStop(1,y)):e=l,c=!0)),c||(r||i?(e.addColorStop(0,y),e.addColorStop(.6,"#F1F6FD"),e.addColorStop(.9,"#BCD5F6"),e.addColorStop(1,y)):(e.addColorStop(0,ei),e.addColorStop(.45,oi),e.addColorStop(.6,si),e.addColorStop(1,hi))),e},n.prototype._getTabForeColor=function(n,i){var r=st,u;return n?r=n.color:i&&(u=t._Color.parse(i),u&&u.getBrightness()<255/2&&(r=ht)),r},n.prototype.drawTab=function(n,t,r,u,f,e,o,s,h){var c,l,v,a,y,p;n.save();n.beginPath();n.moveTo(t,r);n.lineTo(t,r+f-e);n.arcTo(t,r+f,t+u,r+f,e);n.lineTo(t+u,r+f);n.lineTo(t+u+f,r);o||n.lineTo(t,r);c=this;l=i;c._spread.useWijmoTheme&&(v=0,(o||s)&&(v=4),l=window.gcGlobal.getWijmoThemeStyle(v));a=c._getTabBackColor(n,o,s,h,l);n.fillStyle=a;n.fill();n.strokeStyle=li;n.stroke();n.textBaseline=ai;typeof a=="string"&&(y=a);n.fillStyle=c._getTabForeColor(l,y);p=c._tabLeftPadding;n.textBaseline="middle";n.fillText(h,t+p,r+f/2);n.restore()},n}()})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(t){function c(n,i){var r,h,l,c,f,e,a;if(n){if(r=new t.Spread(n.id,i.sheetCount),typeof i.name===o&&i.name.length>0&&(r.name=i.name),typeof i.font===o&&i.font.length>0&&(r._font=i.font),typeof i.allowUserZoom===u&&(r._allowUserZoom=i.allowUserZoom),typeof i.allowUserResize===u&&(r._allowUserResize=i.allowUserResize),typeof i.tabStripVisible===u&&(r._tabStripVisible=i.tabStripVisible),typeof i.tabEditable===u&&(r._tabEditable=i.tabEditable),typeof i.newTabVisible===u&&(r._newTabVisible=i.newTabVisible),typeof i.useWijmoTheme===u&&(r.useWijmoTheme=i.useWijmoTheme),typeof i.tabStripRatio===s&&(r._tabStripRatio=i.tabStripRatio),typeof i.activeSheetIndex===s&&(r._activeSheetIndex=i.activeSheetIndex),h=t.util._isStandardCanvas(),l=t.util._isSilverlightCanvas(),h&&r._suspendInvalidate(),!h&&l?r._slSetHost(n):r._setHost(n),i.sheets&&i.sheets.length>0){if(r.getSheetCount()<i.sheets.length)for(f=r.getSheetCount();f<i.sheets.length;)c=r._createSheet(r._getDefaultSheetName(f)),r.addSheet(f,c),f=r.getSheetCount();for(e=0;e<i.sheets.length;e++)c=r.getSheet(e),c.applyOptions(i.sheets[e])}h?(a=r._resumeInvalidate(),a||(r.invalidateLayout(),r.repaint())):l&&window.slcanvas&&window.slcanvas.autoLoad&&window.slcanvas.autoLoad()}}var e,f,r;t.feature("core.spread_ui",["core.migrate","core.common","core.spread"]);var o="string",u="boolean",s="number",i=jQuery,h=function(){function n(){var n=this;n.sheetCount=1;n.name="";n.font="10pt Arial";n.allowUserZoom=!0;n.allowUserResize=!0;n.tabStripVisible=!0;n.tabEditable=!0;n.newTabVisible=!0;n.useWijmoTheme=!1;n.tabStripRatio=.5;n.activeSheetIndex=0;n.sheets=[]}return n}();t.WijspreadOptions=h;e=new h;i.ui&&i.widget?i.widget("wijmo.wijspread",{_init:function(){var n=this.element.context;c(n,this.options)},spread:function(){return this.element.data("spread")},destroy:function(){var n=this.spread();n&&(i(window).unbind("resize.gcSpread",n._resizeHandler),n._dispose())},refresh:function(){var n=this.spread();n&&(n._doResize(),n.repaint())},repaint:function(){var n=this.spread();n&&n.repaint()},options:e}):(f={init:function(n){n=i.extend(!0,e,n);var t=this.get(0);c(t,n)},spread:function(){return this.data("spread")},destroy:function(){var n=this.data("spread");n&&(i(window).unbind("resize.gcSpread",n._resizeHandler),n._dispose())},refresh:function(){var n=this.data("spread");n&&(n._doResize(),n.repaint())},repaint:function(){var n=this.data("spread");n&&n.repaint()}},i.fn.wijspread=function(n){if(f[n])return f[n].apply(this,Array.prototype.slice.call(arguments,1));else if(typeof n=="object"||!n)return f.init.apply(this,arguments)});i.wijmo.wijspread=n.spread;r=window.ko;r&&(r.wijmo=r.wijmo||{},r.wijmo.wijspreadBinding={init:function(n,t,r,u){i("#"+n.id).wijspread(t())},update:function(n,t,i,r){}},r.bindingHandlers.wijspread=r.wijmo.wijspreadBinding)})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){(function(i){(function(r){function at(n,t,i,r,u){if((i===e||i===f)&&(i=0),!u&&t instanceof p)return n.call(t);else if(t instanceof b)return n.call(t,i);return r}function oi(n,t){return(n===e||n===f)&&(t===e||t===f)?!0:(n===e||n===f)&&t!==e&&t!==f||n!==e&&n!==f&&(t===e||t===f)?!1:n.toLowerCase()===t.toLowerCase()}function eu(n,t){var r=this,i={row:r.row,column:r.column,rowCount:1,columnCount:1};return r.rowRelative&&(i.row+=n,i.row=i.row>=v.maxRowCount?i.row%v.maxRowCount:i.row),r.columnRelative&&(i.column+=t,i.column=i.column>=v.maxColumnCount?i.column%v.maxColumnCount:i.column),i}function nr(n,t){var r={row:-1,column:-1,rowCount:-1,columnCount:-1},u,f,e,o,i=this;return i.isFullRow?(r.column=-1,r.columnCount=-1):(i.startColumnRelative?(e=i.startColumn+t,e=e>=v.maxColumnCount?e%v.maxColumnCount:e):e=i.startColumn,i.endColumnRelative?(o=i.endColumn+t,o=o>=v.maxColumnCount?o%v.maxColumnCount:o):o=i.endColumn,r.column=e<=o?e:o,r.columnCount=et(o-e)+1),i.isFullColumn?(r.row=-1,r.rowCount=-1):(i.startRowRelative?(u=i.startRow+n,u=u>=v.maxRowCount?u%v.maxRowCount:u):u=i.startRow,i.endRowRelative?(f=i.endRow+n,f=f>=v.maxRowCount?f%v.maxRowCount:f):f=i.endRow,r.row=u<=f?u:f,r.rowCount=et(f-u)+1),r}function lf(n){return n<=255}function ie(n){return n<=127}function tr(n){var t=n.charCodeAt(0);return t>=48&&t<=57}function ci(n){var t=n.charCodeAt(0);return t|=32,t>=96&&t<=122}function ir(n){var t=n.charCodeAt(0);return t<=57?t>=48:(t|=32,t>=96&&t<=122)}function ou(n){var t=n.charCodeAt(0);return lf(t)?hi[t]===si.MathSymbol||hi[t]===si.CurrencySymbol||hi[t]===si.ModifierSymbol||hi[t]===si.OtherSymbol:!1}function ni(n){var t=n.charCodeAt(0);return t>=48&&t<=57}function af(n,t,i){for(var u,e=n.length,r=y.None,f=t;f<e;f++)if(u=n.charAt(f),tr(u))r===y.None?r=y.Int:r===y.Dot?r=y.Decimal:r===y.Sign?r=y.Int:(r===y.Exponent||r===y.SignExponent)&&(r=y.ScientificNotation);else if(u===i)if(r===y.Int)r=y.Decimal;else if(r===y.None||r===y.Sign)r=y.Dot;else return{result:!1};else if(u==="+"||u==="-")if(r===y.None)r=y.Sign;else if(r===y.Exponent)r=y.SignExponent;else return{result:!0,endIndex:f-1};else if(u==="E"||u==="e")if(r===y.Int||r===y.Decimal)r=y.Exponent;else return{result:!1};else if(r===y.Int||r===y.Decimal||r===y.ScientificNotation)return{result:!0,endIndex:f-1};return r===y.Int||r===y.Decimal||r===y.ScientificNotation?{result:!0,endIndex:e-1}:{result:!1}}function rr(n,t,r,u){for(var e,h=n.length,s=r===u?0:1,o="",f=t+1;f<h;f++)if(e=n.charAt(f),e===r&&s++,e===u)if(s--,r===u&&f+2<h&&n.charAt(f+1)===r)o+=r,f++;else if(s!==0)o+=e;else return{result:o,endIndex:f};else o+=e;throw i.SR.Exp_NoSyntax+u+i.SR.Exp_MatchSyntax+r+i.SR.SingleQuotesFullStop;}function lu(n,t,r,u,f){for(var e,c=n.length,h=0,s="",o=t;o<c;o++)if(e=n.charAt(o),e===f&&(s+=e,o++,e=n.charAt(o)),e===r)s+=e,h++;else if(e===u)if(h--,h!=0)s+=e;else return{result:s,endIndex:o};else s+=e;throw i.SR.Exp_NoSyntax+u+i.SR.Exp_MatchSyntax+r+i.SR.SingleQuotesFullStop;}function au(n,t){for(var r,u,e,o=n.length,s=o-t,f=0;f<fi.length;f++)if((r=fi[f],u=r.length,!(t+u>o))&&(e=n.slice(t,t+u),u<=s&&(r===e||r===e.toUpperCase())))return{result:r,endIndex:t+u-1};throw i.SR.SingleQuote+n.slice(t)+i.SR.Exp_IsValid;}function ti(n){return n==="^"||n===":"?1:n==="*"||n==="/"||n===" "?2:n==="+"||n==="-"||n===","?3:n==="&"?4:5}function vu(n){if(n.subType===11)return w.range;else if(n.subType===10)return w.union;else if(n.subType===9)return w.intersection;var t=n.value;if(t==="^")return w.exponent;else if(t==="*")return w.multiply;else if(t==="/")return w.divide;else if(t==="+")return w.add;else if(t==="-")return w.subtract;else if(t==="&")return w.concatenate;else if(t==="<")return w.lessThan;else if(t==="=")return w.equal;else if(t===">")return w.greaterThan;else if(t===">=")return w.greaterThanOrEqual;else if(t==="<=")return w.lessThanOrEqual;else if(t==="<>")return w.notEqual;else if(t===":"||t==="!")return w.range;else if(t===" "||t===",")return w.intersection;return w.add}function ur(n,t,i){return n&&n.hasOwnProperty(t)?n[t]:i}function yu(n,t){var i=t+1;return n<0?n%i+i:n>t?n%i:n}function st(n,t,i){n[t]||(n[t]=[]);n[t].push(i)}function ht(n,t,i){var u=n[t],r;if(u)for(r=0;r<u.length;r++)if(u[r]===i){u.splice(r,1);return}}function er(n,t,i,r,u){return(n.row===-1||t===-1||n.row<t+r&&t<n.row+n.rowCount)&&(n.column===-1||i===-1||n.column<i+u&&i<n.column+n.columnCount)}function or(n,t,i){return(n.row===-1||n.row<=t&&t<n.row+n.rowCount)&&(n.column===-1||n.column<=i&&i<n.column+n.columnCount)}function re(n,t){if(t.action===wu)return er(n,t.row,t.column,t.rowCount,t.columnCount);else if(t.action===bu)return or(n,t.row,t.column);return!1}function vf(n,t){for(var i=0;i<t.length;i++)if(n.hasOwnProperty(t[i])&&n[t[i]].length>0)return!0;return!1}function uf(n,t){var i=ct(n.row,t.row),r=ct(n.column,t.column),u=pt(n.row+n.rowCount,t.row+t.rowCount),e=pt(n.column+n.columnCount,t.column+t.columnCount);return i>=u||r>=e?f:{row:i,column:r,rowCount:u-i,columnCount:e-r,intersectWith:uf}}function pf(n,t,i,r){return n===-1&&r>127||t===-1&&i>127||i*r>127}function wf(n,t,i,u,f){var e=new r.Parser,o=new bt(!!f,i,u),s=e.parse(t,o);return r.evaluateExpression(n,s,i,u)}function bf(n,t,i,r){var o=n.getCalcService(),u,f;return i===e&&(i=n.getActiveRowIndex()),r===e&&(r=n.getActiveColumnIndex()),u=n._getSheetSource(),f=o.evaluateParsedFormula(u,t,i,r,!1,!0),f}function kf(n,t,i,r){var s=n.row,h=n.col,a=n.row+n.rowCount-1,v=n.col+n.colCount-1,e=!1,c=!1,o=!1,l=!1,f;return arguments.length>=4&&(e=(r&1)!=0,c=(r&4)!=0,o=(r&2)!=0,l=(r&8)!=0,s-=e?t:0,a-=c?t:0,h-=o?i:0,v-=l?i:0),n.row<0&&n.col<0?f=new u.RangeExpression:n.row<0?(f=new u.RangeExpression,f.initBand(h,v,o,l,!1)):n.col<0?(f=new u.RangeExpression,f.initBand(s,a,e,c,!0)):f=n.rowCount===1&&n.colCount===1?new u.CellExpression(s,h,e,o):new u.RangeExpression(s,h,a,v,e,o,c,l),f}function df(n,t,i,u,f){var e=r.rangeToExpression(n,t,i,u),o=new r.ParserContext(!!f,t,i),s=new r.Parser;return s.unparse(e,o)}function gf(n,t,u,f){var e;if(!n)return null;t=t?t:0;u=u?u:0;var s=new r.ParserContext(!!f,t,u),h=new r.Parser,o=h.parse(n,s);return o&&o.getRange?(e=o.getRange(t,u),new i.Range(e.row,e.column,e.rowCount,e.columnCount)):null}function ne(n,t,i,u,f){var e="",c=new r.Parser,l=new r.ParserContext(!!f,t,i),o,h,s;for(n.length>1&&(e="("),o=0;o<n.length;o++)h=r.rangeToExpression(n[o],t,i,u),s=c.unparse(h,l),o>0?e+=", "+s:e=s;return n.length>1&&(e+=")"),e}var d,p,wt,nu,wi,bi,tu,b,ki,tt,di,iu,ru,uu,o,lt,gi,w,fu,c,su,hu,a,cu,bt,v,ii,pu,fr,wu,bu,lr,ar,vr,li,yr,ai,ff,ef,te;i.feature("calc.common",["core.migrate","core.stringResource","core.common","core.globalize"]);var nt="undefined",ui="number",k="string",vt="boolean",kt="TRUE",dt="FALSE",gt="ARRAY",yt="ARRAYROW",pr="#NULL!",wr="#DIV/0!",br="#VALUE!",vi="#REF!",kr="#NAME?",dr="#N/A",gr="#NUM!",fi=[pr,wr,br,vi,kr,dr,gr],of=[0,7,15,23,29,42,36],yi=[1,26,676],f=null,e=undefined,pt=Math.min,ct=Math.max,et=Math.abs,sf=Math.pow;r.missingArgument={};d=function(){function n(n,t){this._error=n;this._code=t}return n.prototype.toString=function(){return this._error},n.parse=function(t){var i=n._parseCore(t);if(i===e)throw"Incorrect error!";return i},n._parseCore=function(t){var i,r;if(typeof t!==nt&&t!==f&&t!=="")for(i=0;i<fi.length;i++)if(r=fi[i],r===t||r===t.toUpperCase())return new n(r,of[i]);return e},n}();r.CalcError=d;r.Error=d;var hf=new d(pr,0),ei=new d(wr,7),s=new d(br,15),l=new d(vi,23),ot=new d(kr,29),g=new d(dr,42),pi=new d(gr,36),cf=function(){function n(){}return n.Null=hf,n.DivideByZero=ei,n.Value=s,n.Reference=l,n.Name=ot,n.NotAvailable=g,n.Number=pi,n}();r.Errors=cf;p=function(){function n(){}return n.prototype.getRowCount=function(){return 1},n.prototype.getColumnCount=function(){return 1},n.prototype.length=function(){return this.getRowCount()*this.getColumnCount()},n.prototype.getValueByIndex=function(n){var t=this.getColumnCount(),i=parseInt(n/t,10),r=n%t;return this.getValue(i,r)},n.prototype.getValue=function(n,t){return f},n.prototype.getAllValue=function(n,t,i,r){for(var f,e=[],u=n;u<n+i;u++)for(e[u]=[],f=t;f<t+r;f++)e[u][f]=this.getValue(u,f);return e},n}();r.CalcArray=p;r.Array=p;wt=function(n){function t(t,i){var r,f,u;if(n.call(this),r=this,f=t.length,r._array=t,r._rowCount=f,arguments.length<2)for(i=0,u=0;u<f;u++)i=ct(t[u].length,i);r._columnCount=i}return __extends(t,n),t.prototype.getRowCount=function(){return this._rowCount},t.prototype.getColumnCount=function(){return this._columnCount},t.prototype.getValue=function(n,t){return this._array[n][t]},t.prototype.getAllValue=function(n,t,i,r){var e,u,f;if(n===undefined)return this._array;for(e=[],u=n;u<n+i;u++)for(e[u]=[],f=t;f<t+r;f++)e[u][f]=this._array[u][f];return e},t}(p);r._ConcreteArray=wt;nu=function(n){function t(t,i,r,u,f){n.call(this);var e=this;e._array=t;e._row=i;e._column=r;e._rowCount=u;e._columnCount=f}return __extends(t,n),t.prototype.getRowCount=function(){return this._rowCount},t.prototype.getColumnCount=function(){return this._columnCount},t.prototype.getValue=function(n,t){var i=this;return gi.getValue(i._array,i._row+n,i._column+t)},t}(p);r._SliceArray=nu;wi=function(n){function t(t){n.call(this);this._value=t}return __extends(t,n),t.prototype.getRowCount=function(){return this._value.getRowCount(0)},t.prototype.getColumnCount=function(){return this._value.getColumnCount(0)},t.prototype.getValue=function(n,t){return this._value.getValue(0,n,t)},t}(p);r._ArrayWrappingRange=wi;bi=function(n){function t(t){n.call(this);this._value=t}return __extends(t,n),t.prototype.getRowCount=function(){return 1},t.prototype.getColumnCount=function(){return 1},t.prototype.getValue=function(n,t){return this._value},t}(p);r._ArrayWrappingScalar=bi;tu=function(n){function t(t){n.call(this);this._value=t}return __extends(t,n),t.prototype.getRowCount=function(){return this._value.length},t.prototype.getColumnCount=function(){return 1},t.prototype.getValue=function(n,t){return this._value[n]},t}(p);r._OneDimensionalArray=tu;b=function(){function n(){}return n.prototype.getRangeCount=function(){return 1},n.prototype.getRow=function(n){return 0},n.prototype.getColumn=function(n){return 0},n.prototype.getRowCount=function(n){return 0},n.prototype.getColumnCount=function(n){return 0},n.prototype.getValue=function(n,t,i){return f},n.prototype.isSubtotal=function(n,t,i){return!1},n.prototype.getSource=function(){return f},n.prototype.getAllValue=function(n,t,i,r,u){for(var e,o,s=[],h=n===undefined?0:n,c=n===undefined?this.getRangeCount():n,f=h;f<=c;f++)for(s[f]=[],e=t;e<t+r;e++)for(s[f][e]=[],o=i;o<i+u;o++)s[f][e][o]=this.getValue(f,e,o);return s},n}();r.Reference=b;ki=function(n){function t(t){var u,o,e,r;if(n.call(this),!t||t.length===0)throw i.SR.Exp_InvalidArgument;for(u=f,o=0;o<t.length;o++)if(e=t[o],u){if(e.getRangeCount()!==u.getRangeCount())throw i.SR.Exp_InvalidArgument;for(r=0;r<e.getRangeCount();r++)if(e.getColumn(r)!==u.getColumn(r)||e.getColumnCount(r)!==u.getColumnCount(r)||e.getRow(r)!==u.getRow(r)||e.getRowCount(r)!==u.getRowCount(r))throw i.SR.Exp_InvalidArgument;}else u=e;this._references=t.slice(0)}return __extends(t,n),t.prototype.getSheetCount=function(){return this._references.length},t.prototype.getRangeCount=function(){return this._references[0].getRangeCount()},t.prototype.getRow=function(n){return this._references[0].getRow(n)},t.prototype.getColumn=function(n){return this._references[0].getColumn(n)},t.prototype.getRowCount=function(n){return this._references[0].getRowCount(n)},t.prototype.getColumnCount=function(n){return this._references[0].getColumnCount(n)},t.prototype.getValue=function(n,t,i){return f},t.prototype.isSubtotal=function(n,t,i){return!1},t.prototype.getSource=function(){return f},t}(b);r._SheetRangeReference=ki,function(n){n.getSource=function(n){return this._references[n].getSource()};n.getValue=function(n,t,i,r){return(typeof n===nt||n===f)&&(n=0),this._references[n].getValue(t,i,r)};n.isSubtotal=function(n,t,i,r){return(typeof n===nt||n===f)&&(n=0),this._references[n].isSubtotal(t,i,r)}}(ki.prototype);tt=function(n){function t(t,i,r){n.call(this);var u=this;u._source=t;u._ranges=i;u._range=arguments.length>2?r:-1}return __extends(t,n),t.prototype.getRangeCount=function(){return this._ranges.length},t.prototype.getRow=function(n){return this._ranges[n].row},t.prototype.getColumn=function(n){return this._ranges[n].col},t.prototype.getRowCount=function(n){return this._ranges[n].rowCount},t.prototype.getColumnCount=function(n){return this._ranges[n].colCount},t.prototype.getValue=function(n,t,i){var r=this,u=r._range<0?n:r._range,f=r._source;return f.getValue(u,r.getRow(n)-f.getRow(u)+t,r.getColumn(n)-f.getColumn(u)+i)},t.prototype.getActualValue=function(n,t,i){var r=this,u=r._range<0?n:r._range,f=r._source;return f.getValue(u,r.getRow(n)-f.getRow(u)+t,r.getColumn(n)-f.getColumn(u)+i)},t.prototype.isSubtotal=function(n,t,i){var r=this,u=r._range<0?n:r._range,f=r._source;return f.isSubtotal(u,r.getRow(n)-f.getRow(u)+t,r.getColumn(n)-f.getColumn(u)+i)},t.prototype.getSource=function(){return this._source.getSource()},t.prototype.getAllValue=function(n,t,i,r,u){var f=this,o=f._source,h,e,c,l;if(r=r===undefined?f.getRowCount(0):r,u=u===undefined?f.getColumnCount(0):u,n===undefined)for(h=[],e=0;e<f._ranges.length;e++)c=f.getRow(e)-o.getRow(e),l=f.getColumn(e)-o.getColumn(e),h[e]=o.getAllValue(n,c,l,r,u)[0];else{var s=f._range<0?n:f._range,c=f.getRow(s)-o.getRow(s),l=f.getColumn(s)-o.getColumn(s);h=o.getAllValue(s,c,l,r,u)}return h},t}(b);r._ConcreteReference=tt;di=function(n){function t(t){n.call(this);this._sheet=t}return __extends(t,n),t.prototype.getRangeCount=function(){return 1},t.prototype.getRow=function(n){return 0},t.prototype.getColumn=function(n){return 0},t.prototype.getRowCount=function(n){return this._sheet.getRowCount()},t.prototype.getColumnCount=function(n){return this._sheet.getColumnCount()},t.prototype.getValue=function(n,t,i){return t>=0||i>=0?this._sheet.getValue(t,i):l},t.prototype.isSubtotal=function(n,t,i){var f=this._sheet,r;return n===0&&t<f.getRowCount()&&i<f.getColumnCount()?(r=f.getExpression(t,i),r&&r instanceof u.FunctionExpression&&r.getFunctionName().toUpperCase()==="SUBTOTAL"):!1},t.prototype.getSource=function(){return this},t.prototype.getAllValue=function(n,t,i,r,u){return this._sheet.getAllValue(n,t,i,r,u)},t}(b);r._SheetReference=di;iu=function(n){function t(t,r,u,f,e,o,s,h){n.call(this,t,[new i.Range(r,u,f,e)]);var c=this;c.Action=o;c.Operand1=s;c.Operand2=h}return __extends(t,n),t.prototype.getValue=function(n,t,i){var r=this;return r.Action(r.getActualValue(n,t,i),r.Operand1,r.Operand2)},t}(tt);r._TernaryCompositeConcreteReference=iu;ru=function(n){function t(t,r,u,f,e,o){n.call(this,t,[new i.Range(r,u,f,e)]);this.Action=o}return __extends(t,n),t.prototype.getValue=function(n,t,i){return this.Action(this.getActualValue(n,t,i))},t}(tt);r._UnaryCompositeConcreteReference=ru;uu=function(n){function t(t,r,u,f,e,o,s,h){n.call(this,t,[new i.Range(r,u,f,e)]);var c=this;c.Action=o;c.Operand1=s;c.SwitchOrder=h}return __extends(t,n),t.prototype.getValue=function(n,t,i){var r=this,u=r.getActualValue(n,t,i);return r.SwitchOrder?r.Action(r.Operand1,u):r.Action(u,r.Operand1)},t}(tt);r._BinaryCompositeConcreteReference=uu;o=function(){function n(){}return n.isNumber=function(t){return n._inArray?typeof t===ui||t instanceof Date:typeof t===ui||!isNaN(t)&&!isNaN(parseFloat(t))||t instanceof Date},n.isError=function(n){return n instanceof d},n._isCalcArray=function(n){return n instanceof p},n._isCalcReference=function(n){return n instanceof b},n.toResult=function(n){return isNaN(n)||!isFinite(n)?pi:n},n._toArray=function(n){if(n instanceof p)return n;else if(n instanceof b){if(n.getRangeCount()===1)return new wi(n)}else return new bi(n)},n._isNaNOrInfinite=function(n){return isNaN(n)||!isFinite(n)},n.toInt=function(t){var r=n.toDouble(t);if(et(r)<1e21)return parseInt(r,10);throw i.SR.Exp_InvalidCast;},n.toDouble=function(t){var r={value:0};if(n.tryToDouble(t,r))return r.value;throw i.SR.Exp_InvalidCast;},n.tryToDouble=function(i,r){var u=f,e;if(typeof i===nt||i===f)return r.value=0,!0;e=typeof i;try{if(e===ui){if(u=new Number(i).valueOf(),n._isNaNOrInfinite(u))return!1}else if(e===k){if(u=new Number(i).valueOf(),n._isNaNOrInfinite(u))return!1}else if(e===vt)u=i?1:0;else if(i instanceof Date)u=new t._DateTimeHelper(i).toOADate();else return!1}catch(o){return!1}return r.value=u,!0},n.tryToBool=function(t,r){try{if(typeof t===nt||t===f)return!1;else if(typeof t===vt)return t;else if(t instanceof Date)return new i._DateTimeHelper(t).toOADate()!==0;else if(n.isNumber(t))return t!==0;else throw i.SR.Exp_InvalidCast;}catch(u){}return!0},n.toBool=function(t){if(typeof t===nt||t===f)return!1;else if(typeof t===vt)return t;else if(t instanceof Date)return new i._DateTimeHelper(t).toOADate()!==0;else if(n.isNumber(t))return t!==0;else if(t instanceof r.Error)return!1;else throw i.SR.Exp_InvalidCast;},n.toString=function(n){try{if(typeof n===nt||n===f)return"";else if(typeof n===vt)return n?kt:dt;else if(typeof n===k)return n;else if(n instanceof Date)return new i._DateTimeHelper(n).localeFormat("M/d/yyyy h:mm:ss");else if(n instanceof p)throw i.SR.Exp_InvalidCast;else return n.toString()}catch(t){throw i.SR.Exp_InvalidCast;}},n.toDateTime=function(n){if(typeof n===nt||n===f)return i._DateTimeHelper.fromOADate(0);else if(n instanceof Date)return new Date(n);else if(typeof n===k){var t=i._DateTimeHelper.parseLocale(n);if(typeof t!==nt&&t!==f||isNaN(n)||(t=i._DateTimeHelper.fromOADate(parseFloat(n))),t===e||t===f)throw i.SR.Exp_InvalidArgument;return t}else if(typeof n===ui)return i._DateTimeHelper.fromOADate(n);else throw i.SR.Exp_InvalidCast;},n._inArray=!1,n}();r.Convert=o;lt=function(){function n(){}return n._argumentExists=function(n,t){return n&&t<n.length&&n[t]!==r.missingArgument},n.getArrayValue=function(n,t,i){return typeof n===nt||n===f?s:t<n.getRowCount()&&i<n.getColumnCount()?n.getValue(t,i):i>=n.getColumnCount()&&n.getColumnCount()===1&&t<n.getRowCount()?n.getValue(t,0):t>=n.getRowCount()&&n.getColumnCount()===1&&i<n.getColumnCount()?n.getValue(0,i):s},n.tryExtractToSingleValue=function(n){if(n instanceof b){var t=o._toArray(n);n=t.getRowCount()===1&&t.getColumnCount()===1?t.getValue(0,0):t}return n instanceof p&&n.getRowCount()===1&&n.getColumnCount()===1&&(n=n.getValue(0,0)),{value:n,success:!(n instanceof p)}},n}();r._Helper=lt;gi=function(){function n(){}return n.isArrayOrReference=function(n){return n instanceof p?(o._inArray=!0,!0):n instanceof b},n.getRangeCount=function(n){return n instanceof b?n.getRangeCount():1},n.getLength=function(n,t){return at(function(){return arguments.length===0?n.getRowCount()*n.getColumnCount():n.getRowCount(arguments[0])*n.getColumnCount(arguments[0])},n,t,1)},n.getRowCount=function(n,t){return at(n.getRowCount,n,t,1)},n.getColumnCount=function(n,t){return at(n.getColumnCount,n,t,1)},n.getValueByIndex=function(n,t,i){return at(function(){if(arguments.length===0)return n.getValueByIndex(t);var i=n.getColumnCount(arguments[0]);return n.getValue(arguments[0],parseInt(t/i,10),t%i)},n,i,n)},n.getValue=function(n,t,i,r){return at(function(){return arguments.length===0?n.getValue(t,i):n.getValue(arguments[0],t,i)},n,r,n)},n.isSubtotalByIndex=function(n,t,i){return at(function(){var i=n.getColumnCount(arguments[0]);return n.isSubtotal(arguments[0],t/i,t%i)},n,i,!1,!0)},n.isSubtotal=function(n,t,i,r){return at(function(){return n.isSubtotal(arguments[0],t,i)},n,r,!1,!0)},n}();r._ArrayHelper=gi,function(n){function r(n,t){return n===t?!0:et(n-t)<et(n)/281474976710656}var u=function(){function n(n){this.name=n}return n.prototype.getName=function(){return this.name},n.prototype.compareTo=function(n){return oi(this.name,n.name)},n.prototype.toString=function(){return this.getName()},n}(),i,t;n.Operator=u;i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype._evaluateSingle=function(n,t){},t.prototype._evaluateImp=function(n,t){var i=f,s,r,u;if(n instanceof p&&(i=n),n instanceof b&&(i=o._toArray(n)),i===e||i===f)return this._evaluateSingle(n,t);if(i.length()<1)return pi;for(s=[],r=0;r<i.getRowCount();r++)for(s[r]=[],u=0;u<i.getColumnCount();u++)s[r][u]=this._evaluateSingle(i.getValue(r,u),t);return new wt(s,i.getColumnCount())},t.prototype.evaluate=function(n,t){return this._evaluateImp(n,t)},t}(u);n.UnaryOperator=i;n.plus=new i("+");n.plus._evaluateSingle=function(n,t){if(n===e||n===f)return 0;var i={value:0};return o.tryToDouble(n,i)?o.toDouble(i.value):typeof n=="string"?n:s};n.negate=new i("-");n.negate._evaluateSingle=function(n,t){if(n===e||n===f)return 0;var i={value:0};return o.tryToDouble(n,i)?-i.value:s};n.percent=new i("%");n.percent._evaluateSingle=function(n,t){if(n===e||n===f)return 0;var i={value:0};return o.tryToDouble(n,i)?i.value/100:s};t=function(n){function t(t,i){n.call(this,t);this.acceptsReference=i}return __extends(t,n),t.prototype._evaluateSingle=function(n,t,i){},t.prototype.evaluate=function(n,t,i){var r=lt.tryExtractToSingleValue(n),u=lt.tryExtractToSingleValue(t),v,c,a;if(r.success&&u.success)return this._evaluateSingle(r.value,u.value);n=r.value;t=u.value;var f=r.success?-1:n.getRowCount(),e=r.success?-1:n.getColumnCount(),o=u.success?-1:t.getRowCount(),s=u.success?-1:t.getColumnCount(),l=-1,h=-1;if(r.success||u.success)r.success?(l=o,h=s):(l=f,h=e);else{if(f!=1&&o!=1&&f!=o||e!=1&&s!=1&&e!=s)return g;l=f==1?o:f;h=e==1?s:e}for(v=[],c=0;c<l;c++)for(v[c]=[],a=0;a<h;a++)v[c][a]=!r.success&&(f!==1&&f<l||e!==1&&e<h)||!u.success&&(o!==1&&o<l||s!==1&&s<h)?g:this._evaluateSingle(r.success?n:lt.getArrayValue(n,f===1?0:c,e===1?0:a),u.success?t:lt.getArrayValue(t,o==1?0:c,s===1?0:a));return new wt(v,h)},t}(u);n.BinaryOperator=t;n.add=new t("+",!1);n.add._evaluateSingle=function(n,t,i){var r,u;return o.isError(n)?n:o.isError(t)?t:((n===e||n===f)&&(n=0),(t===e||t===f)&&(t=0),r={value:0},!o.tryToDouble(n,r))?s:(u={value:0},!o.tryToDouble(t,u))?s:r.value+u.value};n.subtract=new t("-",!1);n.subtract._evaluateSingle=function(n,t,i){var r,u;return o.isError(n)?n:o.isError(t)?t:((n===e||n===f)&&(n=0),(t===e||t===f)&&(t=0),r={value:0},!o.tryToDouble(n,r))?s:(u={value:0},!o.tryToDouble(t,u))?s:r.value-u.value};n.multiply=new t("*",!1);n.multiply._evaluateSingle=function(n,t,i){var r,u;return o.isError(n)?n:o.isError(t)?t:((n===e||n===f)&&(n=0),(t===e||t===f)&&(t=0),r={value:0},!o.tryToDouble(n,r))?s:(u={value:0},!o.tryToDouble(t,u))?s:r.value*u.value};n.divide=new t("/",!1);n.divide._evaluateSingle=function(n,t,i){var u,r;return t===e||t===f||t===""||t===0?ei:o.isError(n)?n:o.isError(t)?t:((n===e||n===f)&&(n=0),u={value:0},!o.tryToDouble(n,u))?s:(r={value:0},!o.tryToDouble(t,r))?s:r.value===0?ei:u.value/r.value};n.exponent=new t("^",!1);n.exponent._evaluateSingle=function(n,t,i){var r,u;return o.isError(n)?n:o.isError(t)?t:((n===e||n===f)&&(n=0),(t===e||t===f)&&(t=0),r={value:0},!o.tryToDouble(n,r))?s:(n=r.value,u={value:0},!o.tryToDouble(t,u))?s:(t=u.value,n===0&&t<0)?ei:sf(n,t)};n.concatenate=new t("&",!1);n.concatenate._evaluateSingle=function(n,t,i){return o.isError(n)?n:o.isError(t)?t:((n===e||n===f)&&(n=""),(t===e||t===f)&&(t=""),n.toString()+t.toString())};n.equal=new t("=",!1);n.equal._evaluateSingle=function(n,t,i){var u,h,c,l;return o.isError(n)?n:o.isError(t)?t:((n===e||n===f)&&(n=typeof t===k?"":0),(t===e||t===f)&&(t=typeof n===k?"":0),typeof n===k||typeof t===k?n.toString().toUpperCase()===t.toString().toUpperCase():(u={value:0},!o.tryToDouble(n,u))?s:(n=u.value,h={value:0},!o.tryToDouble(t,h))?s:(t=h.value,c=n,l=t,r(c,l)))};n.notEqual=new t("<>",!1);n.notEqual._evaluateSingle=function(t,i,r){var u=n.equal._evaluateSingle.call(this,t,i,r);return typeof u===vt?!u:u};n.lessThan=new t("<",!1);n.lessThan._evaluateSingle=function(n,t,i){var u,h,c,l;return o.isError(n)?n:o.isError(t)?t:((n===e||n===f)&&(n=0),(t===e||t===f)&&(t=0),typeof n===k||typeof t===k?n.toString().toUpperCase()<t.toString().toUpperCase():(u={value:0},!o.tryToDouble(n,u))?s:(n=u.value,h={value:0},!o.tryToDouble(t,h))?s:(t=h.value,c=n,l=t,c<l&&!r(c,l)))};n.greaterThan=new t(">",!1);n.greaterThan._evaluateSingle=function(n,t,i){var u,h,c,l;return o.isError(n)?n:o.isError(t)?t:((n===e||n===f)&&(n=0),(t===e||t===f)&&(t=0),typeof n===k||typeof t===k?n.toString().toUpperCase()>t.toString().toUpperCase():(u={value:0},!o.tryToDouble(n,u))?s:(n=u.value,h={value:0},!o.tryToDouble(t,h))?s:(t=h.value,c=n,l=t,c>l&&!r(c,l)))};n.lessThanOrEqual=new t("<=",!1);n.lessThanOrEqual._evaluateSingle=function(n,t,i){var u,h,c,l;return o.isError(n)?n:o.isError(t)?t:((n===e||n===f)&&(n=0),(t===e||t===f)&&(t=0),typeof n===k||typeof t===k?n.toString().toUpperCase()<=t.toString().toUpperCase():(u={value:0},!o.tryToDouble(n,u))?s:(n=u.value,h={value:0},!o.tryToDouble(t,h))?s:(t=h.value,c=n,l=t,c<l||r(c,l)))};n.greaterThanOrEqual=new t(">=",!1);n.greaterThanOrEqual._evaluateSingle=function(n,t,i){var u,h,c,l;return o.isError(n)?n:o.isError(t)?t:((n===e||n===f)&&(n=0),(t===e||t===f)&&(t=0),typeof n===k||typeof t===k?n.toString().toUpperCase()>=t.toString().toUpperCase():(u={value:0},!o.tryToDouble(n,u))?s:(n=u.value,h={value:0},!o.tryToDouble(t,h))?s:(t=h.value,c=n,l=t,c>l||r(c,l)))};n.range=new t(":",!0);n.range.evaluate=function(n,t,i){var r;if(n===e||n===f||t===e||t===f||n.getRangeCount()!==1||t.getRangeCount()!==1||(r=n.getSource(),!r||r!==t.getSource()))return s;var u=n.getRow(0),o=n.getColumn(0),h=t.getRow(0),c=t.getColumn(0),l=pt(u,h),a=pt(o,c),v=ct(u+n.getRowCount(0),h+t.getRowCount(0))-l,y=ct(o+n.getColumnCount(0),c+t.getColumnCount(0))-a;return new tt(r,[{row:l,col:a,rowCount:v,colCount:y}])};n.union=new t(",",!0);n.union.evaluate=function(n,t,i){if(n===e||n===f||t===e||t===f)return s;for(var u=[],r=0,r=0;r<n.getRangeCount();r++)u.push({row:n.getRow(r),col:n.getColumn(r),rowCount:n.getRowCount(r),colCount:n.getColumnCount(r)});for(r=0;r<t.getRangeCount();r++)u.push({row:t.getRow(r),col:t.getColumn(r),rowCount:t.getRowCount(r),colCount:t.getColumnCount(r)});return new tt(n.getSource(),u)};n.intersection=new t(" ",!0);n.intersection.evaluate=function(n,t,i){var r;if(n===e||n===f||t===e||t===f||n.getRangeCount()!==1||t.getRangeCount()!==1||(r=n.getSource(),!r||r!==t.getSource()))return s;var u=n.getRow(0),o=n.getColumn(0),h=t.getRow(0),c=t.getColumn(0),l=ct(u,h),a=ct(o,c),v=pt(u+n.getRowCount(0),h+t.getRowCount(0))-l,y=pt(o+n.getColumnCount(0),c+t.getColumnCount(0))-a;return new tt(r,[{row:l,col:a,rowCount:v,colCount:y}])}}(r.Operators||(r.Operators={}));w=r.Operators,function(n){function r(t,r,u){var o,s;if(t===e||t===f)throw i.SR.Exp_InvalidFunctionName;if(t=t.toUpperCase(),n.Functions._builtInFunctions.hasOwnProperty(t))throw i.SR.Exp_InvalidOverrideFunction;if(n.Functions._customFunctions.hasOwnProperty(t))if(o=n.Functions._customFunctions[t],o){if(!u||!u.override)throw i.SR.Exp_OverrideNotAllowed;}else n.Functions._customFunctions[t]=new n.Functions.Function(t,0,255),o=n.Functions[t.toUpperCase()];else o=new n.Functions.Function(t,0,255),n.Functions._customFunctions[t]=o;if(r&&typeof r=="function"&&(o.evaluate=r),u)for(s in u)u.hasOwnProperty(s)&&s!=="override"&&(o[s]=u[s]);return o}function u(t){return t===e||t===f?f:(t=t.toUpperCase(),n.Functions._builtInFunctions&&n.Functions._builtInFunctions.hasOwnProperty(t))?n.Functions._builtInFunctions[t]:n.Functions._customFunctions.hasOwnProperty(t)?n.Functions._customFunctions[t]:f}(function(n){n[n.normal=0]="normal";n[n.allwaysExpand=1]="allwaysExpand";n[n.neverExpand=2]="neverExpand"})(n.ArrayArgumentEvaluateMode||(n.ArrayArgumentEvaluateMode={}));var o=n.ArrayArgumentEvaluateMode,t=function(){function t(n,t,i){var r=arguments.length;this._init(n,r<2?0:t,r<3?0:i)}return t.prototype._init=function(n,t,i){var r=this;r.name=n;r.minArgs=t;r.maxArgs=i},t.prototype.acceptsArray=function(n){return!1},t.prototype.acceptsReference=function(n){return!1},t.prototype.acceptsError=function(n){return!1},t.prototype.acceptsMissingArgument=function(n){return!1},t.prototype.isVolatile=function(){return!1},t.prototype.isContextSensitive=function(){return!1},t.prototype.isBranch=function(){return!1},t.prototype.findTestArgument=function(){return-1},t.prototype.findBranchArgument=function(n){return-1},t.prototype.expandRows=function(){return!0},t.prototype.expandColumns=function(){return!0},t.prototype.precedentReference=function(){return!0},t.prototype.evaluate=function(n){},t.prototype.evaluateWithContext=function(n,t){var i=this;return i.isContextSensitive()?i.evaluate(n,t):i.evaluate(n)},t.prototype.toString=function(){return this.name},t._create=function(t,i,r){var f=new n.Functions.Function(t,0,255),u;if(i&&typeof i=="function"&&(f.evaluate=i),r)for(u in r)r.hasOwnProperty(u)&&u!=="override"&&(f[u]=r[u]);return f},t}();n.Function=t;n._customFunctions={};n._builtInFunctions={};n.defineGlobalCustomFunction=r;n.findGlobalFunction=u;$.extend({ce:{createFunction:function(t,i,r){return n.Functions.Function._create(t,i,r)},defineGlobalCustomFunction:function(t,i,r){return n.Functions.defineGlobalCustomFunction(t,i,r)},findGlobalFunction:function(t){return n.Functions.findGlobalFunction(t)}}})}(r.Functions||(r.Functions={}));fu=r.Functions;c={cell:0,row:1,column:2,sheet:3},function(n){function ri(u,e,o,h,c){var bi=u.row,ki=u.column,pt=[],fr,er,nr,fi,pi,ei,p,tr,it,ht,yt,ui,bt,ir,kt,vi,or,wi,rr,dt,ur,et;pt.push({expr:e,acceptsArray:!1,acceptsRef:!1,index:-1});for(var si=0,di=0,gt=!1,hi=h,ci=c,gi=!1,hr=!1,l,yi,sr,v,wt;pt.length!=0;){if(l=pt.pop(),yi=l.acceptsArray,sr=l.acceptsRef,e=l.expr,v=f,e instanceof rt)fr=e,l.index===-1?(l.index=0,pt.push(l),pt.push({expr:fr.argument,acceptsArray:yi,acceptsRef:ur,index:-1})):fr.argument!==wt&&(v=new rt(wt));else if(e instanceof b||e instanceof ft)er=e,l.index==1?(di--,v=wt):(di++,pt.push({expr:e,acceptsArray:!0,acceptsRef:!0,index:1}),nr=e instanceof ft?e.source.getName(er.name,u.row,u.column):u.getName(er.name),nr||(nr=new n.ErrorExpression(ot)),pt.push({expr:nr,acceptsArray:!0,acceptsRef:!0,index:-1}));else if(e instanceof at){if(fi=e,!yi&&(si>0||o))gt=!0;else if(!yi&&si==0)if(hi>=fi.value.RowCount&&fi.value.RowCount>1||ci>=fi.value.ColumnCount&&fi.value.ColumnCount>1)v=new t(g);else try{fi.value.RowCount==1&&(hi=0);fi.value.ColumnCount==1&&(ci=0);pi=fi.value.getValue(hi,ci);typeof pi=="string"?v=new lt(pi):typeof pi=="number"&&(v=new ct(pi));vt||(vt=new r.Parser);v=vt.parse(fi.value.getValue(hi,ci).toString(),f)}catch(cr){v=new t(g)}}else if(e instanceof w||e instanceof a){if(ei=e,di&&(ei.rowRelative||ei.columnRelative)){var oi=e instanceof a?e.source:u.source,li=oi.getRowCount(),ai=oi.getColumnCount(),ht=ei.rowRelative?(ei.row+u.activeRow)%li:ei.row,yt=ei.columnRelative?(ei.column+u.activeColumn)%ai:ei.column;ht=ht<0?ht+li:ht;yt=yt<0?yt+ai:yt;e=e instanceof a?new a(oi,ht,yt,!1,!1):new w(ht,yt,!1,!1)}}else if(e instanceof r.Expressions.RangeExpression||e instanceof y||e instanceof i){if(p=e,di&&(p.startRowRelative||p.startColumnRelative||p.endRowRelative||p.endColumnRelative)){var oi=e instanceof y?e.source:e instanceof i?e.startSource:u.source,li=oi.getRowCount(),ai=oi.getColumnCount(),ni=p.startRowRelative?(p.startRow+u.activeRow)%li:p.startRow,ti=p.startColumnRelative?(p.startColumn+u.activeColumn)%ai:p.startColumn,ii=p.endRowRelative?(p.endRow+u.activeRow)%li:p.endRow,ri=p.endColumnRelative?(p.endColumn+u.activeColumn)%ai:p.endColumn;ni=ni<0?ni+li:ni;ti=ti<0?ti+ai:ti;ii=ii<0?ii+li:ii;ri=ri<0?ri+ai:ri;ni>ii&&(tr=ni,ni=ii,ii=tr);ti>ri&&(tr=ti,ti=ri,ri=tr);e=e instanceof nt?new nt(ni,ti,ii,ri,!1,!1,!1,!1):e instanceof y?new y(oi,ni,ti,ii,ri,!1,!1,!1,!1):new i(oi,e.endSource,ni,ti,ii,ri,!1,!1,!1,!1)}sr&&(yi||!o)||(si>0&&!o||si===0||gi?(it=p.getRange(bi,ki),o?!p.isFullColumn&&it.rowCount!=1&&hi>=it.rowCount||!p.isFullRow&&it.columnCount!=1&&ci>=it.columnCount?v=new t(g):(ht=(p.isFullColumn?0:it.row)+(it.rowCount==1?0:hi),yt=(p.isFullRow?0:it.column)+(it.columnCount==1?0:ci),v=e instanceof i?new i(e.startSource,e.endSource,ht,yt,ht,yt,!1,!1,!1,!1):e instanceof y?new a(e.source,ht,yt,!1,!1):new w(ht,yt,!1,!1)):it.rowCount>1&&it.columnCount>1||it.rowCount>1&&!p.isFullColumn&&(bi<it.row||bi>=it.row+it.rowCount)||it.columnCount>1&&!p.isFullRow&&(ki<it.column||ki>=it.column+it.columnCount)?v=new t(s):(ht=p.isFullColumn||it.rowCount>1?bi:it.row,yt=p.isFullRow||it.columnCount>1?ki:it.column,v=e instanceof i?new i(e.startSource,e.endSource,ht,yt,ht,yt,!1,!1,!1,!1):e instanceof y?new a(e.source,ht,yt,!1,!1):new w(ht,yt,!1,!1))):gt=!0)}else if(e instanceof ut){if(ui=e,ir=ui.argCount(),typeof ui.fn===k)if(u)if(bt=u.getFunction(ui.fn),bt)if(ir<bt.minArgs||ir>bt.maxArgs){v=new t(s);continue}else ui.fn=bt;else{v=new t(ot);continue}else v=new t(ot);if(bt=ui.fn,kt=l.index,et=l.neeedExpendindexs,kt<0?(l.noExpendCatchValue=gi,l.arrayFormulaCatchValue=o,bt.arrayArgumentEvaluateMode===2&&(gi=!0),bt.arrayArgumentEvaluateMode===1&&(o=!0),l.args=[]):(bt.acceptsArray(kt)?si--:gt&&(et||(et=[],l.neeedExpendindexs=et),ui.getArg(kt)!=wt,et.push(kt)),l.args.push(wt)),kt==ir-1){if(gi=l.noExpendCatchValue,o=l.arrayFormulaCatchValue,vi=l.args,or=!1,vi&&vi.length>0)for(wi=0;wi<vi.length;wi++)if(vi[wi]!==ui.getArg(wi)){or=!0;break}v=or?new ut(ui.fn,vi):e;et&&et.length>0&&(v=new tt(v,et),gt=!0)}else gt=!1,kt++,l.index=kt,bt.acceptsArray(kt)&&si++,pt.push(l),pt.push({expr:ui.getArg(kt),acceptsArray:bt.acceptsArray(kt),acceptsRef:bt.acceptsReference(kt),index:-1})}else e instanceof st?(rr=e,l.index===-1?(l.index=0,pt.push(l),pt.push({expr:rr.operand,acceptsArray:!1,acceptsRef:!1,index:-1})):(v=wt!=rr.operand?new st(rr.operator,wt):e,gt&&(et=[],et.push(0),v=new tt(v,et)))):e instanceof d&&(dt=e,ur=dt.operator.acceptsReference,l.index===-1?(l.index=0,pt.push(l),pt.push({expr:dt.left,acceptsArray:!1,acceptsRef:ur,index:-1})):l.index==0?(wt!=dt.left&&(v=new d(dt.operator,wt,dt.right),l.expr=v),gt&&(et=[],et.push(0),l.neeedExpendindexs=et,gt=!1),l.index=1,pt.push(l),pt.push({expr:dt.right,acceptsArray:!1,acceptsRef:ur,index:-1})):(v=wt!=dt.right?new d(dt.operator,dt.left,wt):dt,et=l.neeedExpendindexs,gt&&(et||(et=[]),et.push(1)),et&&(v=new tt(v,et),gt=!0)));v===f?v=e:v!=e&&(hr=!0);wt=v}return v}var u=function(){function n(){}return n}(),rt,ut,b,yt,ft,o,pt,ct,lt,t,bt,kt,dt,at,gt,et,st,d,p,ht,w,ni,a,nt,ti,y,i,ii,tt,vt;n.Expression=u;rt=function(n){function t(t){n.call(this);this.argument=t}return __extends(t,n),t}(u);n.ParenthesesExpression=rt;ut=function(n){function t(t,i){n.call(this);this.fn=t;this.args=i}return __extends(t,n),t.prototype.argCount=function(){return this.args?this.args.length:0},t.prototype.getArg=function(n){return this.args?this.args[n]:f},t.prototype.getFunctionName=function(){var n=this;return typeof n.fn===k?n.fn:n.fn.name},t}(u);n.FunctionExpression=ut;b=function(n){function t(t){n.call(this);this.name=t}return __extends(t,n),t}(u);n.NameExpression=b;yt=function(n){function t(t){n.call(this,t)}return __extends(t,n),t}(b);n.BangNameExpression=yt;ft=function(n){function t(t,i){n.call(this,i);this.source=t}return __extends(t,n),t}(b);n.ExternalNameExpression=ft;o=function(n){function t(t){n.call(this);this.value=t}return __extends(t,n),t}(u);n.ConstantExpression=o;pt=function(n){function t(t){n.call(this,t)}return __extends(t,n),t}(o);n.BooleanExpression=pt;ct=function(n){function t(t,i){n.call(this,t);this.originalValue=i}return __extends(t,n),t}(o);n.DoubleExpression=ct;lt=function(n){function t(t){n.call(this,t)}return __extends(t,n),t}(o);n.StringExpression=lt;t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t}(o);n.ErrorExpression=t;bt=function(n){function t(t,i){n.call(this,i);this.source=t}return __extends(t,n),t}(t);n.ExternalErrorExpression=bt;kt=function(n){function t(t,i,r){n.call(this,r);this.startSource=t;this.endSource=i}return __extends(t,n),t}(t);n.SheetRangeErrorExpression=kt;dt=function(n){function t(t){n.call(this,t)}return __extends(t,n),t}(t);n.BangErrorExpression=dt;at=function(n){function t(t){n.call(this,new wt(t))}return __extends(t,n),t}(o);n.ArrayExpression=at;gt=function(n){function t(){n.call(this,r.missingArgument)}return __extends(t,n),t}(o);n.MissingArgumentExpression=gt;et=function(n){function t(t){n.call(this);this.operator=t}return __extends(t,n),t}(u);n.OperatorExpression=et;st=function(n){function t(t,i){n.call(this,t);this.operand=i}return __extends(t,n),t}(et);n.UnaryOperatorExpression=st;d=function(n){function t(t,i,r){n.call(this,t);this.left=i;this.right=r}return __extends(t,n),t}(et);n.BinaryOperatorExpression=d;p=function(n){function t(){n.call(this)}return __extends(t,n),t.prototype.getRange=function(n,t){return f},t}(u);n.ReferenceExpression=p;ht=function(n){function t(t){n.call(this);this.source=t}return __extends(t,n),t}(p);n.ExternalReferenceExpression=ht;w=function(n){function t(t,i,r,u){n.call(this);var f=this;f.row=t;f.column=i;f.rowRelative=r;f.columnRelative=u}return __extends(t,n),t.prototype.getRange=function(n,t){return eu.call(this,n,t)},t}(p);n.CellExpression=w;ni=function(n){function t(t,i,r,u){n.call(this,t,i,r,u)}return __extends(t,n),t}(w);n.BangCellExpression=ni;a=function(n){function t(t,i,r,u,f){n.call(this,t);var e=this;e.row=i;e.column=r;e.rowRelative=u;e.columnRelative=f}return __extends(t,n),t.prototype.getRange=function(n,t){return eu.call(this,n,t)},t}(ht);n.ExternalCellExpression=a;nt=function(n){function t(t,i,r,u,f,e,o,s){n.call(this);arguments.length===0?this._initDefault():this.init(t,i,r,u,f,e,o,s)}return __extends(t,n),t.prototype._initDefault=function(){var n=v.BAND_INDEX_CONST,t=this;t.init(n,n,n,n,!1,!1,!1,!1);t.isFullRow=!0;t.isFullColumn=!0},t.prototype.init=function(n,t,i,r,u,f,e,o){var s=this;u===e&&n>i?(s.startRow=i,s.endRow=n,s.startRowRelative=e,s.endRowRelative=u):(s.startRow=n,s.endRow=i,s.startRowRelative=u,s.endRowRelative=e);f===o&&t>r?(s.startColumn=r,s.endColumn=t,s.startColumnRelative=o,s.endColumnRelative=f):(s.startColumn=t,s.endColumn=r,s.startColumnRelative=f,s.endColumnRelative=o);s.isFullRow=!1;s.isFullColumn=!1},t.prototype.initBand=function(n,t,i,r,u){var e,o,f;n>t&&(e=n,n=t,t=e,o=i,i=r,r=o);f=this;u?(f.startRow=n,f.startColumn=v.BAND_INDEX_CONST,f.endRow=t,f.endColumn=v.BAND_INDEX_CONST,f.startRowRelative=i,f.startColumnRelative=!1,f.endRowRelative=r,f.endColumnRelative=!1,f.isFullRow=!0,f.isFullColumn=!1):(f.startRow=v.BAND_INDEX_CONST,f.startColumn=n,f.endRow=v.BAND_INDEX_CONST,f.endColumn=t,f.startRowRelative=!1,f.startColumnRelative=i,f.endRowRelative=!1,f.endColumnRelative=r,f.isFullRow=!1,f.isFullColumn=!0)},t.prototype._getRangeType=function(){var n=this;return n.isFullRow&&n.isFullColumn?c.sheet:n.isFullRow?c.row:n.isFullColumn?c.column:c.cell},t.prototype.getRange=function(n,t){return nr.call(this,n,t)},t}(p);n.RangeExpression=nt;ti=function(n){function t(t,i,r,u,f,e,o,s){n.call(this,t,i,r,u,f,e,o,s)}return __extends(t,n),t}(nt);n.BangRangeExpression=ti;y=function(n){function t(t,i,r,u,e,o,s,h,c){n.call(this,f);arguments.length===1?this._initDefault(t):this.init(t,i,r,u,e,o,s,h,c)}return __extends(t,n),t.prototype._initDefault=function(n){var t=v.BAND_INDEX_CONST,i=this;i.init(n,t,t,t,t,!1,!1,!1,!1);i.isFullRow=!0;i.isFullColumn=!0},t.prototype.init=function(n,t,i,r,u,f,e,o,s){var h=this;h.source=n;f===o&&t>r?(h.startRow=r,h.endRow=t,h.startRowRelative=o,h.endRowRelative=f):(h.startRow=t,h.endRow=r,h.startRowRelative=f,h.endRowRelative=o);e===s&&i>u?(h.startColumn=u,h.endColumn=i,h.startColumnRelative=s,h.endColumnRelative=e):(h.startColumn=i,h.endColumn=u,h.startColumnRelative=e,h.endColumnRelative=s)},t.prototype.initBand=function(n,t,i,r,u,f){var e=this,o,s;e.source=n;t>i&&(o=t,t=i,i=o,s=r,r=u,u=s);f?(e.startRow=t,e.startColumn=v.BAND_INDEX_CONST,e.endRow=i,e.endColumn=v.BAND_INDEX_CONST,e.startRowRelative=r,e.startColumnRelative=!1,e.endRowRelative=u,e.endColumnRelative=!1,e.isFullRow=!0):(e.startRow=v.BAND_INDEX_CONST,e.startColumn=t,e.endRow=v.BAND_INDEX_CONST,e.endColumn=i,e.startRowRelative=!1,e.startColumnRelative=r,e.endRowRelative=!1,e.endColumnRelative=u,e.isFullColumn=!0)},t.prototype._getRangeType=function(){var n=this;return n.isFullRow&&n.isFullColumn?c.sheet:n.isFullRow?c.row:n.isFullColumn?c.column:c.cell},t.prototype.getRange=function(n,t){return nr.call(this,n,t)},t}(ht);n.ExternalRangeExpression=y;i=function(n){function t(t,i,r,u,f,e,o,s,h,c){n.call(this);this.init(t,i,r,u,f,e,o,s,h,c)}return __extends(t,n),t.prototype.init=function(n,t,i,r,u,f,e,o,s,h){var c=this;c.startSource=n;c.endSource=t;e===s&&i>u?(c.startRow=u,c.endRow=i,c.startRowRelative=s,c.endRowRelative=e):(c.startRow=i,c.endRow=u,c.startRowRelative=e,c.endRowRelative=s);o===h&&r>f?(c.startColumn=f,c.endColumn=r,c.startColumnRelative=h,c.endColumnRelative=o):(c.startColumn=r,c.endColumn=f,c.startColumnRelative=o,c.endColumnRelative=h)},t.prototype.initBand=function(n,t,i,r,u,f,e){var o=this,s,h;o.startSource=n;o.endSource=t;i>r&&(s=i,i=r,r=s,h=u,u=f,f=h);e?(o.startRow=i,o.startColumn=v.BAND_INDEX_CONST,o.endRow=r,o.endColumn=v.BAND_INDEX_CONST,o.startRowRelative=u,o.startColumnRelative=!1,o.endRowRelative=f,o.endColumnRelative=!1,o.isFullRow=!0):(o.startRow=v.BAND_INDEX_CONST,o.startColumn=i,o.endRow=v.BAND_INDEX_CONST,o.endColumn=r,o.startRowRelative=!1,o.startColumnRelative=u,o.endRowRelative=!1,o.endColumnRelative=f,o.isFullColumn=!0)},t.prototype.getRange=function(n,t){return nr.call(this,n,t)},t.prototype._getRangeType=function(){var n=this;return n.isFullRow&&n.isFullColumn?c.sheet:n.isFullRow?c.row:n.isFullColumn?c.column:c.cell},t}(p);n.SheetRangeExpression=i;ii=function(n){function i(t,i){n.call(this);i!==f&&t&&this._parseStructReferenceString(i,t)}return __extends(i,n),i.create=function(n){var t=new i(f,f);return t._baseTable=n,t._referencePortions=h.NotSpecific,t._columnReferenceStartInTable=0,t._columnReferenceEndInTable=n.endColumn()-n.startColumn(),t._referenceColumnSpecifier=it.NotSpecific,t},i.prototype.tableName=function(){return this._baseTable.tableName()},i.prototype._updateCatch=function(){this._catchedTableStartColumn=this._baseTable.startColumn()},i.prototype.columnReferenceStart=function(){return this._columnReferenceStartInTable+this._baseTable.startColumn()},i.prototype.columnReferenceEnd=function(){return this._columnReferenceEndInTable+this._baseTable.startColumn()},i.prototype.referencePortions=function(){return this._referencePortions},i.prototype.referenceColumnSpecifier=function(){return this._referenceColumnSpecifier},i.prototype.source=function(){return this._baseTable.source()},i.prototype.getRange=function(n,t){var o=this;o._updateCatch();var i,s,r,a,v,y,u=o._baseTable.startRow(),e=o._baseTable.endRow(),c=o._baseTable.hasTotalsRow(),l=o._baseTable.hasHeadersRow();switch(o._referencePortions){case h.Data:case h.NotSpecific:i=u+1;r=c?e-1:e;break;case h.Headers:if(!l)return f;i=u;r=u;break;case h.Totals:if(!c)return f;i=e;r=e;break;case h.ThisRow:i=n;r=n;break;case h.HeadersAndData:i=l?u:u+1;r=c?e-1:e;break;case h.DataAndTotals:i=u+1;r=e;break;case h.All:default:i=l?u:u+1;r=e;break}return(s=o.columnReferenceStart(),a=o.columnReferenceEnd(),r<i||i<u||r>e)?f:(v=r-i+1,y=a-s+1,{row:i,column:s,rowCount:v,columnCount:y})},i.prototype._parseStructReferenceString=function(n,t){var c=i,e=this,p,a,y;t=t.trim();var r=0,u=t.charAt(r),o=c._parseTableObject(n,t,r,u);for(o.table===f&&c._throwError(),p=o.table,e._baseTable=p,r=o.charIndex,u=o.currentChar,r++,u=t.charAt(r);u===" ";)r++,u=t.charAt(r);for(var s=1,l=!1,v=!1;s!==0;)if(u==="["&&(s++,r++,u=t.charAt(r)),u==="#")l&&s<=1&&c._throwError(),o=c._parsePortion(t,r,u,s),a=o.portion,r=o.charIndex,u=o.currentChar,s=o.lbracketLever,l?e._referencePortions===h.Headers&&a===h.Data||a===h.Headers&&e._referencePortions===h.Data?e._referencePortions=h.HeadersAndData:e._referencePortions===h.Data&&a===h.Totals||a===h.Data&&e._referencePortions===h.Totals?e._referencePortions=h.DataAndTotals:c._throwError():e._referencePortions=a,l=!0;else if(u==="@"){for((s>1||l)&&c._throwError(),l=!0,e._referencePortions=h.ThisRow,r++,u=t.charAt(r);u===" ";)r++,u=t.charAt(r);u===","&&c._throwError()}else{for(y=r;u!=="]"&&(u!==","||s>1)&&u!=="[";)u==="'"&&r++,r++,u=t.charAt(r);if(r>y&&((v||u==="["&&s>1)&&c._throwError(),o=e._parseColumnRange(t,r,u,s,y),r=o.charIndex,u=o.currentChar,s=o.lbracketLever,v=!0),u==="]"){if(s--,s===0)break;else r>=t.length&&c._throwError();r++;u=t.charAt(r)}u===","&&(r++,u=t.charAt(r))}l||(e._referencePortions=h.NotSpecific);v||(e._columnReferenceStartInTable=0,e._columnReferenceEndInTable=e._baseTable.endColumn()-e._baseTable.startColumn(),e._referenceColumnSpecifier=it.NotSpecific)},i.prototype._parseColumnRange=function(n,t,r,u,f){var p=i,s="",a="",b=!1,k=!1,o,w,c,l,v,y,d;if(u>1)b=!0,u--,s=n.substring(f,t),t++,r=n.charAt(t),r===":"&&(t++,r=n.charAt(t),k=r==="[",o=p._getColumnEndString(n,t,r,u),a=o.columnEndString,t=o.charIndex,r=o.currentChar,u=o.lbracketLever);else if(r==="["){for(k=!0,c=t-1,r=n[c];r===" ";)c--,r=n[c];r!==":"&&p._throwError();s=n.substring(f,c);b||(s=p._trimStart(s));r=n.charAt(t);o=p._getColumnEndString(n,t,r,u);a=o.columnEndString;t=o.charIndex;r=o.currentChar;u=o.lbracketLever}else(this._referencePortions===e||this._referencePortions===h.NotSpecific)&&(b=!0),w=n.substring(f,t),c=w.indexOf(":"),c>0?(s=w.substring(0,c),s=s,a=w.substring(c+1),a.charAt(0)!=="["&&p._throwError()):s=w;if(l=this,v=l._getColumnIndex(s,b),a?(y=l._getColumnIndex(a,k),l._referenceColumnSpecifier=it.ColumnRange):(y=v,l._referenceColumnSpecifier=it.SingleColumn),v>y&&(d=v,v=y,y=d),l._columnReferenceStartInTable=v,l._columnReferenceEndInTable=y,t++,t<n.length)for(r=n.charAt(t);r===" ";)t++,r=n.charAt(t);return{charIndex:t,currentChar:r,lbracketLever:u}},i._trimStart=function(n){for(var t=n.length-1;t>=0&&n[t]===" ";)t--;while(t>=0&&n[t]!==" ")t--;return t>=0?n.substr(t+1,n.length-t-1):n},i._trimEnd=function(n){for(var t=0,i=n.length;t<i&&n[t]===" ";)t++;while(t<i&&n[t]!==" ")t++;return t<i?n.substr(0,t):n},i.prototype._getColumnIndex=function(n,t){var u,r,f,e;if(n&&i._validateColumnString(n,t)){for(u="",r=0,f=n.length;r<f;r++)n[r]==="'"&&r<f-1&&n.charAt(r+1)!=="'"||(u+=n.charAt(r));return n=u,e=this._baseTable.getColumnIndexInTable(n),e<0&&i._throwError(),e}return-1},i._validateColumnString=function(n,t,i){var r,u,f;if(t)return!0;if(arguments.length===2&&(i=!0),r="",r=n[0],u=r,r==="#"||r===" "||r==="@"||r===" "||r===","||r===":"||r==="["||r==="]")return!1;for(f=1;f<n.length;f++){if(r=n[f],r===" "||r===","||r===":"||r==="["&&u!=="'"||r==="]"&&u!=="'"||r==="@"&&u!=="'"||r==="#"&&u!=="'")return!1;u=r}return!0},i._getValidaColumnString=function(n){for(var t="",r="",t=n.charAt(0),i=0;i<n.length;i++)t=n.charAt(i),(t==="["||t==="]"||t==="@"||t==="#")&&(r+="'"),r+=t;return r},i._containsInvalidateColumnString=function(n){var t="",i;if(t=n.charAt(0),t==="#"||t===" "||t==="@"||t===" "||t===","||t===":"||t==="["||t==="]")return!0;for(i=1;i<n.length;i++)if(t=n.charAt(i),t===" "||t===","||t===":"||t==="["||t==="]"||t==="@"||t==="#")return!0;return!1},i._getColumnEndString=function(n,t,r,u){var e,f;if(r==="[")for(u++,t++,r=n.charAt(t);r===" ";)t++,r=n.charAt(t);for(e=t;r!=="]"&&(r!==","||u>1);)r==="'"&&t++,t++,r=n.charAt(t);return t<=e&&i._throwError(),u>1&&u--,f=n.substring(e,t),f=i._trimEnd(f),{columnEndString:f,charIndex:t,currentChar:r,lbracketLever:u}},i._parsePortion=function(n,t,r,u){for(var f=i,c=h.All,a=t,o,s,e,l;r!=="]";)r==="'"&&t++,t++,r=n.charAt(t);for(o=n.substring(a,t).toLowerCase().trim(),s=!1,e=0;e<f._structReferenceKeywordsLlowercase.length;e++)if(l=f._structReferenceKeywordsLlowercase[e],o===l){c=f._getPortion(o);s=!0;break}if(s||f._throwError(),t++,t>=n.length)u--;else{for(r=n.charAt(t);r===" ";)t++,r=n.charAt(t);if(r===","){for(u<=1&&f._throwError(),t++,r=n.charAt(t);r===" ";)t++,r=n.charAt(t);for(r==="["&&(u++,t++,r=n.charAt(t));r===" ";)t++,r=n.charAt(t)}u>1&&u--}return{portion:c,charIndex:t,currentChar:r,lbracketLever:u}},i._getPortion=function(n){switch(n){case"#all":return h.All;case"#data":return h.Data;case"#headers":return h.Headers;case"#totals":return h.Totals;case"#this row":return h.ThisRow;default:break}return h.All},i._parseTableObject=function(n,t,i,r){for(var u=f,e=0,o;r!=="[";)i++,r=t.charAt(i);return e=i,e>0?(o=t.substring(0,e),u=n.getTableByName(o)):u=n.getTableByIndex(n.row,n.column),{table:u,charIndex:i,currentChar:r}},i._throwError=function(){throw"";},i.prototype.unParse=function(n,t){var r=this,f,s,e,u,o;if(r._referencePortions===h.NotSpecific&&r._referenceColumnSpecifier===it.NotSpecific){t.content+=r._baseTable.tableName();return}f=i;s=n.row>=r._baseTable.startRow()&&n.column>=r._baseTable.startColumn()&&n.row<=r._baseTable.endRow()&&n.column<=r._baseTable.endColumn();s||(t.content+=r._baseTable.tableName());t.content+="[";r._referencePortions!==h.NotSpecific&&(e=f._getPortionsString(r._referencePortions),t.content+=r._referencePortions===h.DataAndTotals||r._referencePortions===h.HeadersAndData||r._referencePortions===h.ThisRow?e:r._referenceColumnSpecifier!==it.All?"["+e+"]":e);r._referenceColumnSpecifier!==it.NotSpecific&&(r._referencePortions===h.ThisRow||r._referencePortions===h.NotSpecific||(t.content+=", "),u=r._baseTable.getColumnName(r._columnReferenceStartInTable),u=f._getValidaColumnString(u),r._referenceColumnSpecifier===it.ColumnRange?(o=r._baseTable.getColumnName(r._columnReferenceEndInTable),o=f._getValidaColumnString(o),t.content+="["+u+"]:["+o+"]"):t.content+=(r._referencePortions!==h.ThisRow||f._containsInvalidateColumnString(u))&&r._referencePortions!==h.NotSpecific?"["+u+"]":u);t.content+="]"},i._getPortionsString=function(n){switch(n){case h.ThisRow:return"@";case h.Headers:return"#Headers";case h.Data:return"#Data";case h.Totals:return"[#Totals]";case h.HeadersAndData:return"[#Headers], [#Data]";case h.DataAndTotals:return"[#Data], [#Totals]";case h.All:return"#All";case h.NotSpecific:break;default:break}return"#All"},i.prototype.offsetWhenInsertRemoveColumn=function(n,r,u){var o=this,s=o._catchedTableStartColumn,h,e;return n<s||n===s&&u||n>o._columnReferenceEndInTable+s?o:(r=u?r:-r,h=n-s,e=new i(f,f),e._baseTable=o._baseTable,e._columnReferenceEndInTable=o._columnReferenceEndInTable+r,e._columnReferenceStartInTable=o._columnReferenceStartInTable,n<=s+o._columnReferenceStartInTable&&(e._columnReferenceStartInTable+=r,e._columnReferenceStartInTable<h&&(e._columnReferenceStartInTable=h)),e._referenceColumnSpecifier=o._referenceColumnSpecifier,e._referencePortions=o._referencePortions,e._columnReferenceEndInTable<e._columnReferenceStartInTable)?new t(l):e},i.prototype.offsetWhenCopy=function(n,t){var u=this,r=new i(f,f),e;return r._baseTable=u._baseTable,r._columnReferenceEndInTable=u._columnReferenceEndInTable,r._columnReferenceStartInTable=u._columnReferenceStartInTable,u._referenceColumnSpecifier===it.SingleColumn&&t&&t>0&&(e=u._baseTable.endColumn()-u._baseTable.startColumn()+1,t%=e,r._columnReferenceStartInTable+=t,r._columnReferenceStartInTable<0&&(r._columnReferenceStartInTable+=e),r._columnReferenceEndInTable=r._columnReferenceStartInTable),r._referenceColumnSpecifier=u._referenceColumnSpecifier,r._referencePortions=u._referencePortions,r},i._structReferenceKeywordsLlowercase=["#all","#data","#headers","#totals","#this row"],i}(p);n.StructReferenceExpression=ii;tt=function(n){function t(t,i){n.call(this);this.expr=t;this.needExpendIndexs=i}return __extends(t,n),t}(u);n.ExpandExpression=tt;n._mappingArray=ri}(r.Expressions||(r.Expressions={}));var u=r.Expressions,h={ThisRow:1,Headers:2,Data:3,Totals:8,HeadersAndData:6,DataAndTotals:12,All:14,NotSpecific:16},it={All:1,NotSpecific:1,SingleColumn:2,ColumnRange:4},y={None:0,Sign:1,Int:2,Dot:3,Decimal:4,Exponent:5,SignExponent:6,ScientificNotation:7,Number:8},si={UppercaseLetter:0,LowercaseLetter:1,DecimalDigitNumber:8,OtherNumber:10,SpaceSeparator:11,Control:14,ConnectorPunctuation:18,DashPunctuation:19,OpenPunctuation:20,ClosePunctuation:21,InitialQuotePunctuation:22,FinalQuotePunctuation:23,OtherPunctuation:24,MathSymbol:25,CurrencySymbol:26,ModifierSymbol:27,OtherSymbol:28},hi=[14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,11,24,24,24,26,24,24,24,20,21,24,25,24,19,24,24,8,8,8,8,8,8,8,8,8,8,24,24,25,25,25,24,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,24,21,27,18,27,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,20,25,21,25,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,11,24,26,26,26,26,28,28,27,28,1,22,25,19,28,27,28,25,10,10,27,1,28,24,27,10,1,23,10,10,10,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,25,1,1,1,1,1,1,1,1];(function(n){n[n.Operand=0]="Operand";n[n.Function=1]="Function";n[n.Subexpression=2]="Subexpression";n[n.Argument=3]="Argument";n[n.OperatorPrefix=4]="OperatorPrefix";n[n.OperatorInfix=5]="OperatorInfix";n[n.OperatorPostfix=6]="OperatorPostfix";n[n.Whitespace=7]="Whitespace";n[n.Unknown=8]="Unknown"})(su||(su={})),function(n){n[n.Nothing=0]="Nothing";n[n.Start=1]="Start";n[n.Stop=2]="Stop";n[n.Text=3]="Text";n[n.Number=4]="Number";n[n.Logical=5]="Logical";n[n.Error=6]="Error";n[n.RangeOrName=7]="RangeOrName";n[n.Concatenation=8]="Concatenation";n[n.Intersection=9]="Intersection";n[n.Union=10]="Union";n[n.RangeOp=11]="RangeOp"}(hu||(hu={}));a=function(){function n(n,t,i,r){(r===e||r===f)&&(r=0);var u=this;u.value=n;u.type=t;u.index=i;u.subType=r;u.children=[]}return n}();cu=function(){function n(){this._stack=[]}return n.prototype.push=function(n){this._stack.push(n)},n.prototype.pop=function(){if(this._stack.length===0)return f;var n=this._stack.pop();return new a("",n.type,n.index,2)},n.prototype.current=function(){var n=this._stack,t=n.length;return t>0?n[t-1]:f},n}();bt=function(){function n(n,t,i,r){var u=this;u.useR1C1=n;u.row=t;u.column=i;u.option=r}return n.prototype.getExternalSource=function(n,t){return f},n.prototype.getExternalSourceToken=function(n){return""},n.prototype.getTableByName=function(n){return f},n.prototype.getTableByIndex=function(n,t){return f},n}();r.ParserContext=bt;v=function(){function n(n){this._init(n)}return n.prototype._init=function(n){var t=this;t.listSeparator=ur(n,"listSeparator",",");t.numberDecimalSeparator=ur(n,"numberDecimalSeparator",".");t.arrayGroupSeparator=ur(n,"arrayGroupSeparator",";");t._arrayArgumentSepatator=t.listSeparator===t.arrayGroupSeparator?"\\":t.listSeparator;t._operatorInfix="\\+-*/^&=><: "+this.listSeparator},n.prototype.parse=function(n,t){var i=this,r;return t||(t=new bt(!1,0,0)),t.option&&i._init(t.option),r=i._parseToToken(n),i._buildExpressionTree(t,r)},n.prototype.unparse=function(n,t){if(!n)return"";t||(t=new bt(!1,0,0));t.option&&this._init(t.option);var i={content:""};return this._unparseExpression(n,t,i),i.content},n.prototype._unparseExpression=function(n,t,r){var f=this,e;if(n instanceof u.ConstantExpression)f._unparseConstantExpression(n,t,r);else if(n instanceof u.OperatorExpression)f._unParseOperatorExpressions(n,t,r);else if(n instanceof u.ReferenceExpression)f._unParseRefenceExpressions(n,t,r);else if(n instanceof u.BangNameExpression)r.content+="!",r.content+=n.name;else if(n instanceof u.NameExpression)r.content+=n.name;else if(n instanceof u.ExternalNameExpression)f._unparseSource(n.source,t,r),r.content+="!",r.content+=n.name;else if(n instanceof u.ParenthesesExpression)r.content+="(",f._unparseExpression(n.argument,t,r),r.content+=")";else if(n instanceof u.FunctionExpression){for(r.content+=n.getFunctionName(),r.content+="(",e=0;e<n.argCount();e++)e!==0&&(r.content+=f.listSeparator),f._unparseExpression(n.getArg(e),t,r);r.content+=")"}else throw i.SR.Exp_NotSupport;},n.prototype._unparseSource=function(n,t,i){t.getExternalSourceToken&&(i.content+=this._getValidSource(t.getExternalSourceToken(n),t.useR1C1))},n.prototype._unparseSource2=function(n,t,i,r){var u=this,f={content:""};u._unparseSource(n,i,f);var s=u._removeApostrophe(f),h=u._removeWorkbook(f),c=h.success,o=h.workBookName,e={content:""};u._unparseSource(t,i,e);s|=u._removeApostrophe(e);o=u._removeWorkbook(e).workBookName;s?(r.content+="'",c&&(r.content+=o),r.content+=f.content,r.content+=":",r.content+=e.content,r.content+="'"):(c&&(r.content+=o),r.content+=f.content,r.content+=":",r.content+=e.content)},n.prototype._getValidSource=function(n,t){if(n===e||n===f||n==="")return"";var i=this._readSheetReference(n,t,!0),r=n.length;return i.success?(n.charAt(0)==="'"&&n.charAt(r-1)==="'"&&(n=n.substr(1,r-2),n=n.replace("'","''"),n="'"+n+"'"),n):(i=this._readSheetReference("'"+n+"'",t,!0),i.success)?(n=n.replace("'","''"),"'"+n+"'"):""},n.prototype._unParseRefenceExpressions=function(n,t,r){var o=this,c=t.row,l=t.column,v,y,a,s,h,e,f;if(n instanceof u.BangCellExpression)r.content+="!",v=n,o._unParseCell(t.useR1C1,c,l,v.row,v.column,v.rowRelative,v.columnRelative,r);else if(n instanceof u.CellExpression)y=n,o._unParseCell(t.useR1C1,c,l,y.row,y.column,y.rowRelative,y.columnRelative,r);else if(n instanceof u.ExternalCellExpression)a=n,o._unparseSource(a.source,t,r),r.content+="!",o._unParseCell(t.useR1C1,c,l,a.row,a.column,a.rowRelative,a.columnRelative,r);else if(n instanceof u.BangRangeExpression)r.content+="!",s=n,o._unParseRange(t.useR1C1,c,l,s.startRow,s.startColumn,s.endRow,s.endColumn,s.startRowRelative,s.startColumnRelative,s.endRowRelative,s.endColumnRelative,r,s._getRangeType());else if(n instanceof u.RangeExpression)h=n,o._unParseRange(t.useR1C1,c,l,h.startRow,h.startColumn,h.endRow,h.endColumn,h.startRowRelative,h.startColumnRelative,h.endRowRelative,h.endColumnRelative,r,h._getRangeType());else if(n instanceof u.ExternalRangeExpression)e=n,o._unparseSource(e.source,t,r),r.content+="!",o._unParseRange(t.useR1C1,c,l,e.startRow,e.startColumn,e.endRow,e.endColumn,e.startRowRelative,e.startColumnRelative,e.endRowRelative,e.endColumnRelative,r,e._getRangeType());else if(n instanceof u.SheetRangeExpression)f=n,o._unparseSource2(f.startSource,f.endSource,t,r),r.content+="!",o._unParseRange(t.useR1C1,c,l,f.startRow,f.startColumn,f.endRow,f.endColumn,f.startRowRelative,f.startColumnRelative,f.endRowRelative,f.endColumnRelative,r,f._getRangeType());else if(n instanceof u.StructReferenceExpression)n.unParse(t,r);else throw i.SR.Exp_NotSupport;},n.prototype._removeApostrophe=function(n){var t=n.content,i=t.length;return t.charAt(i-1)==="'"?(n.content=t.substr(1,i-2),!0):!1},n.prototype._removeWorkbook=function(n){if(n.content.charAt(0)!=="[")return{success:!1,workBookName:""};var t=n.content.indexOf("]"),i=n.content.substr(0,t+1);return n.content=n.content.substr(t),{success:!0,workBookName:i}},n.prototype._unParseCell=function(t,i,r,u,o,s,h,a,v){var g,b,k,p,y,w,d,nt,tt;if((v===e||v===f)&&(v=c.cell),g=n.BAND_INDEX_CONST,b=n.maxRowCount-1,(v===c.cell||v===c.row)&&u!==g&&u>-b&&u<=2*b&&(u+=s?i:0,u=yu(u,b)),k=n.maxColumnCount-1,(v===c.cell||v===c.column)&&o!==g&&o>-k&&o<=2*k&&(o+=h?r:0,o=yu(o,k)),this._isCellIndexsError(i,r,u,o,s,h,v)){a.content+=l.toString();return}if(p="",y="",t){if(p="R",u>=0&&(i!==u||!s)&&(s?p=p+"["+(u-i)+"]":(u++,p=p+u)),o<0){a.content+=p;return}if(y="C",r===o&&h||(h?y=y+"["+(o-r)+"]":(o++,y=y+o)),s&&u<0||!s&&u<=0){a.content+=y;return}a.content+=p;a.content+=y}else{if(u++,p=""+u,s||(p="$"+u),o<0){a.content+=p;return}for(w=o,d=1,nt=yi.length;d<nt;d++)tt=yi[nt-d],o=parseInt(w/tt,10),w=w%tt,o!==0&&(y=y+String.fromCharCode(o+65-1));if(y=y+String.fromCharCode(w+65),h||(y="$"+y),u<=0){a.content+=y;return}a.content+=y;a.content+=p}},n.prototype._isCellIndexsError=function(n,t,i,r,u,f,e){var o=!1;switch(e){case c.sheet:break;case c.cell:o|=i<0;o|=r<0;break;case c.row:o|=i<0;break;case c.column:o|=r<0;break}return o},n.prototype._unParseRange=function(t,i,r,u,o,s,h,l,a,v,y,p,w){(w===e||w===f)&&(w=c.cell);this._unParseCell(t,i,r,u,o,l,a,p,w);var b=n.BAND_INDEX_CONST;t&&u===s&&o===h&&(s===b||h===b)||(s!==b||h!==b)&&(p.content+=":",this._unParseCell(t,i,r,s,h,v,y,p,w))},n.prototype._unParseOperatorExpressions=function(n,t,r){var f=this,s,e,o;if(n instanceof u.UnaryOperatorExpression)s=n.operator,s===w.percent?(f._unparseExpression(n.operand,t,r),r.content+=s.name):(r.content+=s.name,f._unparseExpression(n.operand,t,r));else if(n instanceof u.BinaryOperatorExpression){e={content:""};o={content:""};f._unparseExpression(n.right,t,o);var c=n.left instanceof u.BinaryOperatorExpression,l=n.right instanceof u.BinaryOperatorExpression,h=ti(n.operator.name);c&&ti(n.left.operator.name)>h?(e.content+="(",f._unparseExpression(n.left,t,e),e.content+=")"):f._unparseExpression(n.left,t,e);l&&ti(n.right.operator.name)>h&&(o.content+="(",f._unparseExpression(n.right,t,o),o.content+="(");r.content+=e.content;r.content+=n.operator instanceof w.UnaryOperator?f.listSeparator:n.operator.name;r.content+=o.content}else throw i.SR.Exp_NotSupport;},n.prototype._unparseConstantExpression=function(t,r,o){var c=this,v=i.SR.Exp_InvalidArray,h,y,p,l,a,s;if(t instanceof u.StringExpression)o.content+='"',o.content+=t.value,o.content+='"';else if(t instanceof u.DoubleExpression)o.content+=t.originalValue;else if(t instanceof u.BooleanExpression)o.content+=t.value?kt:dt;else if(t instanceof u.ArrayExpression){if(o.content+="{",h=t.value,h.getRowCount()<=0)throw v;for(y=n.BAND_INDEX_CONST,p=y,l=0;l<h.getRowCount();l++)for(l>=1&&(o.content+=c.arrayGroupSeparator),a=0;a<h.getColumnCount();a++){if(p!==y&&(p!==h.getColumnCount()||h.getColumnCount()===0))throw v;if(a!==0&&(o.content+=c._arrayArgumentSepatator),s=h.getValue(l,a),s===e||s===f)throw v;s instanceof u.Expression?c._unparseExpression(s,r,o):typeof s===k?(o.content+='"',o.content+=s,o.content+='"'):o.content+=typeof s===vt?s?kt:dt:s.toString()}o.content+="}"}else if(t instanceof u.ExternalErrorExpression)c._unparseSource(t.source,r,o),o.content+="!",o.content+=t.value.toString();else if(t instanceof u.SheetRangeErrorExpression)c._unparseSource2(t.startSource,t.endSource,r,o),o.content+="!",o.content+=t.value.toString();else if(t instanceof u.BangErrorExpression)o.content+="!",o.content+=t.value.toString();else if(t instanceof u.ErrorExpression)o.content+=t.value.toString();else if(!(t instanceof u.MissingArgumentExpression))throw i.SR.Exp_NotSupport;},n.prototype._parseToToken=function(n){for(var h=this,v=n.length,u=[],s=new cu,r="",d=i.SR.AtIndexOn,o,e=0,w=0,t,f,y,b,nt,c,it,p,tt,rt,k,l,g;w<v&&n.charAt(w)===" ";)w++;for(n.charAt(w)==="="&&w++,t=w;t<v;t++)if(f=n.charAt(t),f==='"')y=rr(n,t,'"','"'),u.push(new a(y.result,0,t,3)),t=y.endIndex,e=t+1;else if(f==="'")y=rr(n,t,"'","'"),r+="'",r+=y.result,r+="'",t=y.endIndex;else if(f==="[")y=lu(n,t,"[","]","'"),r+=y.result,r+="]",t=y.endIndex;else if(f==="\r"||f==="\n")continue;else if(f==="#")b=au(n,t),nt=t<v?n.charAt(t+1):'\0',t>0&&n.charAt(t-1)==="!"?r+=b.result:vi===b.result.toUpperCase()&&t<v&&(ir(nt)||nt==="$")?r+=b.result:(u.push(new a(b.result,0,t,6)),e=t+1),t=b.endIndex;else if(f==="+"||f==="-")c=u.length===0?null:u[u.length-1],r.length!==0?(u.push(new a(r,0,e)),u.push(new a(f,5,t)),r="",e=t+1):(c&&c.type===7&&(u.pop(),c=u[u.length-1]),c&&(c.type===1&&c.subType===2||c.type===2&&c.subType===2||c.type===6||c.type===0)?(u.push(new a(f,5,t)),e=t+1):(u.push(new a(f,4,t)),e=t+1));else if(f===h.numberDecimalSeparator||tr(f))if(r.length>0)r+=f;else if((it=af(n,t,h.numberDecimalSeparator)).result){for(p=it.endIndex,tt=n.slice(t,p+1);p<=v-2&&n.charAt(p+1)===" ";)p++;p<=v-2&&n.charAt(p+1)===":"?(r+=tt,r+=":",p++):u.push(new a(tt,0,t,4));e=t+1;t=p}else r+=f;else if(f==="{"){if(r.length>0)throw i.SR.Exp_FormulaInvalid+i.SR.SingleQuote+"{"+d+t+i.SR.FullStop;o=new a(gt,1,t,1);u.push(o);s.push(o);o=new a(yt,1,t,1);u.push(o);s.push(o);e=t+1}else if(f===h.arrayGroupSeparator&&s.current()&&(s.current().value===gt||s.current().value===yt)){if(r.length>0&&(u.push(new a(r,0,e)),r=""),!s.current())throw i.SR.Exp_FormulaInvalid+i.SR.SingleQuote+f+d+t+i.SR.FullStop;u.push(s.pop());u.push(new a(h.listSeparator,3,t));o=new a(yt,1,t+1,1);u.push(o);s.push(o);e=t+1}else if(f==="}"){if(r.length>0&&(u.push(new a(r,0,e)),r=""),!s.current())throw i.SR.Exp_FormulaInvalid+i.SR.SingleQuote+f+d+t+i.SR.FullStop;u.push(s.pop());u.push(s.pop());e=t+1}else if(f===" "){for(rt=t,t++;t<v&&r.charAt(r.length-1)===" ";)t++;r.length>0&&r.charAt(r.length-1)!==":"&&t<v&&n.charAt(t)!==":"&&(u.push(new a(r,0,e)),r="",u.push(new a("",7,rt)),e=t);t--}else if(t+2<=v&&f==="<"&&n.charAt(t+1)==="="||f===">"&&n.charAt(t+1)==="="||f==="<"&&n.charAt(t+1)===">")r.length>0&&(u.push(new a(r,0,e)),r=""),u.push(new a(n.slice(t,t+2),5,t,5)),t++,e=t+1;else if(f==="%")r.length>0&&(u.push(new a(r,0,e)),r=""),u.push(new a(n.charAt(t),6,t)),e=t+1;else if(f==="+"||f==="-"||f==="*"||f==="/"||f==="="||f===">"||f==="<"||f==="&"||f==="^")r.length>0&&(u.push(new a(r,0,e)),r=""),u.push(new a(f,5,t)),e=t+1;else if(f==="(")r.length>0?(k=r.charAt(r.length-1),k===":"||k===h.listSeparator||k===" "?(r=r.slice(0,r.length-1),u.push(new a(r,0,e,7)),u.push(new a(k,5,t-1,0)),o=new a("",2,t,1),u.push(o),s.push(o)):(l=r.indexOf(":"),g=":",l===-1&&(l=r.indexOf(h.listSeparator),g=h.listSeparator),l===-1&&(l=r.indexOf(" "),g=" "),l!==-1&&l>0?(u.push(new a(r.substr(0,l),0,e,7)),u.push(new a(g,5,l,0)),r=r.slice(l+1),o=new a(r.toUpperCase(),1,t,1),u.push(o),s.push(o)):(o=new a(r.toUpperCase(),1,t,1),u.push(o),s.push(o))),r=""):(o=new a("",2,t,1),u.push(o),s.push(o)),e=t+1;else if(f===h.listSeparator||f===h.arrayGroupSeparator)r.length>0&&(u.push(new a(r,0,e)),r=""),s.current()&&s.current().type===1?u.push(new a(h._arrayArgumentSepatator,3,t)):u.push(new a(h.listSeparator,5,t,10)),e=t+1;else if(f===")"){if(r.length>0&&(u.push(new a(r,0,e)),r=""),!s.current())throw i.SR.Exp_FormulaInvalid+i.SR.SingleQuote+f+d+t+i.SR.FullStop;u.push(s.pop());e=t+1}else f===":"?r.length===0&&u[u.length-1].subType===2?(u.push(new a(":",5,t,11)),e=t+1):r+=":":r+=f;return r.length>0&&u.push(new a(r,0,e)),h._processTokens(u)},n.prototype._processTokens=function(n){var s=this._removeWhiteSpace(n),e=[],v=new a("",8,0,1),h,l,u,t,r,o,c,y;for(e.push(v),l=s.length,u=0;u<l;u++)if(t=s[u],t){if(r=u===0?f:s[u-1],o=u===l-1?f:s[u+1],t.type===0&&t.subType===0?(c=t.value.toUpperCase(),c===kt||c===dt?(t.subType=5,t.value=c):t.subType=7):t.type===1&&t.value.length>0&&t.value.charAt(0)==="@"&&(t.value=t.value.substr(1)),e.length===0)throw i.SR.Exp_InvalidTokenAt+t.index+i.SR.FullStop;if(h=e[e.length-1],h.value===yt&&t.type!==3&&t.subType!==6&&t.subType!==2&&t.subType!==5&&t.subType!==4&&t.subType!==3&&t.type!==4)throw i.SR.Exp_InvalidArrayAt+t.index+i.SR.FullStop;switch(t.type){case 0:if(r&&(r.type===0||r.type===6||r.type===1&&r.subType===2||r.type===2&&r.subType===2))throw i.SR.Exp_InvalidTokenAt+t.index+i.SR.FullStop;break;case 1:case 2:if(t.value!==gt||t.type!==1||t.subType!==1||r){if(t.subType===2&&(!r||r.type===4||r.type===5)||t.subType===1&&r&&(!o||r.type===6||r.subType===2))throw i.SR.Exp_InvalidTokenAt+t.index+i.SR.FullStop;}else break;if(t.subType===2&&t.type===2&&r.subType===1)throw i.SR.Exp_InvalidTokenAt+t.index+i.SR.FullStop;if(t.subType===2&&t.type===1&&r.type===2&&r.subType===1)throw i.SR.Exp_InvalidTokenAt+t.index+i.SR.FullStop;break;case 3:if(!o||!r||r.type===5||r.type===4)throw i.SR.Exp_InvalidTokenAt+t.index+i.SR.FullStop;break;case 4:if(!o||r&&r.type===6)throw i.SR.Exp_InvalidTokenAt+t.index+i.SR.FullStop;break;case 5:if(!o||!r||r.type===5||r.type===4||r.type===3||r.type===1&&r.subType===1||r.type===2&&r.subType===1)throw i.SR.Exp_InvalidTokenAt+t.index+i.SR.FullStop;break;case 6:if(!r||r.type===4||r.type===5||r.type===1&&r.subType===1||r.type===2&&r.subType===1)throw i.SR.Exp_InvalidTokenAt+t.index+i.SR.FullStop;break;default:throw i.SR.Exp_InvalidTokenAt+t.index+i.SR.FullStop;}if(t.subType===1)e.push(t),h.children.push(t);else if(t.subType===2){if(e.length===0){y=t.value===gt||t.value===yt?"}":")";throw i.SR.Exp_FormulaInvalid+i.SR.SingleQuote+y+i.SR.SingleQuoteAt+t.index+i.SR.FullStop;}e.pop()}else h.children.push(t)}return v.children},n.prototype._removeWhiteSpace=function(n){for(var u,i,r,e=[],o=n.length,t=0;t<o;t++)if(u=n[t],u){if(u.type!==7){e.push(u);continue}(i=t==0?f:n[t-1],r=t==o-1?f:n[t+1],i&&r)&&(i.type===1&&i.subType===2||i.type===2&&i.subType===2||i.type===0)&&(r.type===1&&r.subType===1||r.type===2&&r.subType===1||r.type===0)&&e.push(new a(" ",5,u.index,9))}return e},n.prototype._buildExpressionNode=function(n,t){var r=this,i;return t.type===1?i=t.value===gt?r._buildArraryExpression(n,t):r._buildFunctionExpression(n,t):t.type===2?i=r._buildSubExpression(n,t):t.type===0&&(t.subType===4?i=new u.DoubleExpression(parseFloat(t.value),t.value):t.subType===6?i=new u.ErrorExpression(d.parse(t.value)):t.subType===5?oi(t.value,kt)?i=new u.BooleanExpression(!0):oi(t.value,dt)&&(i=new u.BooleanExpression(!1)):i=t.subType===7?r._buildCellReferenceOrNameExpressions(n,t.value,t.index):new u.StringExpression(t.value)),i},n.prototype._buildExpressionTree=function(n,t){for(var r=this._parseToBinaryOperatorList(n,t),f,e,o,s,h,i=3;i<r.length;)if(s=r[i],h=r[i-2],s&&s.type===5){while(i>=3&&ti(s.value)>=ti(h.value))e=r[i-3],o=r[i-1],f=new u.BinaryOperatorExpression(vu(h),e,o),r.splice(i-3,1),r.splice(i-3,1),r.splice(i-3,1),r.splice(i-3,0,f),i-=2,i>=3&&(h=r[i-2]);i+=2}else i++;if(r.length===1)return r[0];else{for(i=r.length-2;i>0;i-=2)e=r[i-1],o=r[i+1],f=new u.BinaryOperatorExpression(vu(r[i]),e,o),r.splice(i-1,1),r.splice(i-1,1),r.splice(i-1,1),r.push(f);return f}},n.prototype._parseToBinaryOperatorList=function(n,t){for(var i,o,s,h,r=[],f,e=0;e<t.length;e++)if(i=t[e],i.type===4){for(o=[];i.type===4;)o.push(i.value==="+"?w.plus:w.negate),e++,i=t[e];for(s=t[e],f=new u.UnaryOperatorExpression(o.pop(),this._buildExpressionNode(n,s));o.length>0;)f=new u.UnaryOperatorExpression(o.pop(),f);r.push(f)}else i.type===6?(h=r[r.length-1],f=new u.UnaryOperatorExpression(w.percent,h),r.pop(),r.push(f)):i.type===5?r.push(i):(f=this._buildExpressionNode(n,i),r.push(f));return r},n.prototype._buildFunctionExpression=function(n,t){for(var s,e,h,r=[],f=[],o=0;o<t.children.length;o++)s=t.children[o],s.type!==3?f.push(s):f.length===0?r.push(new u.MissingArgumentExpression):(r.push(this._buildExpressionTree(n,f)),f=[]);if(f.length!==0?r.push(this._buildExpressionTree(n,f)):t.children.length!==0&&r.push(new u.MissingArgumentExpression),e=fu.findGlobalFunction(t.value),e){if(h=r.length,h<e.minArgs||h>e.maxArgs)throw i.SR.Exp_InvalidParameters+t.index+i.SR.FullStop;return new u.FunctionExpression(e,r)}else return new u.FunctionExpression(t.value,r)},n.prototype._buildSubExpression=function(n,t){return new u.ParenthesesExpression(this._buildExpressionTree(n,t.children))},n.prototype._buildArraryExpression=function(n,t){for(var v,w,s,h,a,g,c=[],k=-1,o,d=t.children,nt=d.length,l=0;l<nt;l++){if(o=d[l],v=l===0?f:d[l-1],o.type===3){if(!v||v.type===3||l===nt-1)throw i.SR.Exp_InvalidArrayAt+o.index+i.SR.FullStop;continue}else if(v&&v.type!==3)throw i.SR.Exp_InvalidArrayAt+o.index+i.SR.FullStop;else if(o.type!==1||o.value!==yt)throw i.SR.Exp_InvalidArrayAt+o.index+i.SR.FullStop;else if(k!==-1&&o.children.length!==k)throw i.SR.Exp_InvalidArrayColumns+o.index+i.SR.FullStop;else k=o.children.length;w=[];c.push(w);var y=o.children,b=y.length,p=f;for(s=0;s<b;s++){if(h=y[s],h.type===3)p&&p.type!==3&&s!==b-1||w.push(r.missingArgument);else if(p&&p.type!==3)throw i.SR.Exp_InvalidArrayAt+o.index;else{if(h.type===4){if(s+1>=b)throw i.SR.Exp_InvalidArrayAt+o.index;a=y[s+1];a.value=""+h.value+a.value;h=a;s++}else s+1<b&&y[s+1].type===6&&(a=y[s+1],h.value=""+h.value+a.value,s++);g=this._buildExpressionNode(n,h);g&&w.push(g.value)}p=h}}if(c.length===0||c[0]===e||c[0]===f||c[0].length===0)throw i.SR.Exp_InvalidArrayAt+o.index;return new u.ArrayExpression(c)},n.prototype._buildCellReferenceOrNameExpressions=function(n,t,r){var s=this._buildCellReferenceOrNameExpressions2(n,t,r),f=s.endIndex,e=s.expression,c=t.length,o,l,h;if(!e)throw i.SR.Exp_InvalidCellReference+r+i.SR.FullStop;if(f<=0||f>=c)return e;if(t.charAt(f)!==":")throw i.SR.Exp_InvalidCellReference+r+i.SR.FullStop;for(f++,o=[],o.push(e);f>0&&f<c;){if(l=f,s=this._buildCellReferenceOrNameExpressions2(n,t.substr(f),r),f=s.endIndex,e=s.expression,!e)throw i.SR.Exp_InvalidCellReference+r+i.SR.FullStop;if(o.push(e),f+=l,f<c&&t.charAt(f)!==":")throw i.SR.Exp_InvalidCellReference+r+i.SR.FullStop;f++}for(e=o[0],h=1;h<o.length;h++)e=new u.BinaryOperatorExpression(w.range,e,o[h]);return e},n.prototype._buildCellReferenceOrNameExpressions2=function(n,t,i){var b=this,h,g,it,p,ut,ft,rt,tt,ot,st,et,ht,v,d,vt,ct,lt;if(t===e||t===f||t==="")return{endIndex:0,expression:f};if(h=t.length,t.length>=5&&t.substr(0,5)==="#REF!")return{endIndex:h,expression:new u.ErrorExpression(l)};if(g=t.charAt(0)==="!",it=g?1:0,h<1)return{endIndex:0,expression:f};var y=-1,nt="",o=0;if(g)y=it;else if(t.charAt(0)==="'")y=t.indexOf("!")+1,nt=t.substr(0,y-1);else if(p=t.indexOf("!"),v=t.indexOf(":"),p!==-1)if(ut=t.substr(it,p-it),v<0||p<v)p<h-1&&(nt=ut,y=p+1);else{if(ft=b._parseToCellReference(n,ut,g),ft.expression)return ft;else p<h-1&&(nt=ut,y=p+1);o=ft.endIndex}var k="",c="",w="";if(y!==-1&&nt&&nt!==""){if(rt=b._readSheetReference(nt,n.useR1C1,!1),!rt.success)return{endIndex:o,expression:f};k=rt.workBookName;c=rt.startSheetName;w=rt.endSheetName}else y=it;if(et=!1,(k&&k!==""||c&&c!=="")&&(et=!0,n.getExternalSource&&(ot=n.getExternalSource(k,c),!ot)))return{endIndex:o,expression:new u.ErrorExpression(l)};if(w&&w!==""&&(et=!0,n.getExternalSource&&(st=n.getExternalSource(k,w),!st)))return{endIndex:o,expression:new u.ErrorExpression(l)};var a=t.substr(y),at=b._parseToCellReference(n,a,g,ot,st),s=at.expression;if(o=at.endIndex,s)if(!et||s instanceof u.SheetRangeExpression||s instanceof u.ExternalReferenceExpression||s instanceof u.ExternalErrorExpression||s instanceof u.SheetRangeErrorExpression||s instanceof u.ExternalNameExpression)if(o<a.length-1){if(o=h-(a.length-o),t.charAt(o)!==":"){if(c&&c!==""){if(w&&w!=="")return{endIndex:o,expression:f};if(!n.getExternalSource)return{endIndex:o,expression:new u.ErrorExpression(l)};if(tt=n.getExternalSource(k,c),!tt)return{endIndex:o,expression:new u.ErrorExpression(l)};s=new u.ExternalNameExpression(tt,a)}else s=new u.NameExpression(a);o=h}}else o=h;else return{endIndex:h,expression:new u.ErrorExpression(l)};else{for(v=-1,d=0;d<t.length;d++)if(ht=t[d],ht==="[")vt=lu(t,d,"[","]","'"),d=vt.endIndex;else if(ht===":"){v=d;break}if(g)s=new u.BangNameExpression(a);else if(c&&c!==""){if(w&&w!=="")return{endIndex:o,expression:f};if(!n.getExternalSource)return{endIndex:o,expression:new u.ErrorExpression(l)};if(tt=n.getExternalSource(k,c),!tt)return{endIndex:o,expression:new u.ErrorExpression(l)};s=new u.ExternalNameExpression(tt,a)}else v>0?(ct=t.substr(0,v),s=b._validateName(ct)?new r.Expressions.BinaryOperatorExpression(r.Operators.range,new r.Expressions.NameExpression(ct),b._buildCellReferenceOrNameExpressions(n,t.substr(v+1),i+v+1)):f):s=new u.NameExpression(a);o=h}if(s instanceof u.NameExpression||s instanceof u.ExternalNameExpression)if(lt=b._createStructExpression(n,a,i),lt)s=lt;else if(!b._validateName(a))return{endIndex:o,expression:f};return{endIndex:o,expression:s}},n.prototype._parseToCellReference=function(t,i,r,u,e){var h=this,a=0,c,l,o,s,v;if(i.charAt(0)==="#"&&(c=au(i,0),a=c.endIndex+1,l=d.parse(c.result),l))return{endIndex:a,expression:h._createExternalErrorExpression(l,r,u,e)};if(o=t.useR1C1?h._isR1C1CellReferance(i,t.row,t.column):h._isA1CellReferance(i),s=n.BAND_INDEX_CONST,o.success&&t.useR1C1&&o.startRow!==s&&o.startColumn===s&&o.endRow===s&&o.endColumn===s)o.endRow=o.startRow,o.endRowRelative=o.startRowRelative;else if(o.success&&t.useR1C1&&o.startColumn!==s&&o.startRow===s&&o.endRow===s&&o.endColumn===s)o.endColumn=o.startColumn,o.endColumnRelative=o.startColumnRelative;else if(!o.success||o.startRow===s&&(o.startColumn===s||o.endColumn===s)||o.startColumn===s&&o.endRow===s)return{endIndex:o.endIndex,expression:f};return v=h._createCellReferenceExpression(t,t.row,t.column,o.startRow,o.startColumn,o.endRow,o.endColumn,o.startRowRelative,o.startColumnRelative,o.endRowRelative,o.endColumnRelative,r,u,e),{endIndex:o.endIndex,expression:v}},n.prototype._createExternalErrorExpression=function(n,t,i,r){return t?new u.BangErrorExpression(n):i&&r?new u.SheetRangeErrorExpression(i,r,n):i?new u.ExternalErrorExpression(i,n):new u.ErrorExpression(n)},n.prototype._createCellReferenceExpression=function(t,i,r,e,o,s,h,c,l,a,v,y,p,w){var k=n.BAND_INDEX_CONST,b,d,g;return e!==k&&s!=k&&e>s&&(d=e,e=s,s=d,g=c,c=a,a=g),o!==k&&h!=k&&o>h&&(d=o,o=h,h=d,g=l,l=v,v=g),e-=e!==k&&c?i:0,o-=o!=k&&l?r:0,s-=s!==k&&a?i:0,h-=h!==k&&v?r:0,p&&w?(b=new u.SheetRangeExpression(p,w),e===k?b.initBand(p,w,o,h,l,v,!1):o===k?b.initBand(p,w,e,s,c,a,!0):b.init(p,w,e,o,s,h,c,l,a,v),b):s===k&&h===k?y?p||w?f:new u.BangCellExpression(e,o,c,l):p?new u.ExternalCellExpression(p,e,o,c,l):new u.CellExpression(e,o,c,l):y?p&&w?f:(b=new u.BangRangeExpression,e===k?b.initBand(o,h,l,v,!1):o===k?b.initBand(e,s,c,a,!0):b.init(e,o,s,h,c,l,a,v),b):p?(b=new u.ExternalRangeExpression,e===k?b.initBand(p,o,h,l,v,!1):o===k?b.initBand(p,e,s,c,a,!0):b.init(p,e,o,s,h,c,l,a,v),b):(b=new u.RangeExpression,e===k?b.initBand(o,h,l,v,!1):o===k?b.initBand(e,s,c,a,!0):b.init(e,o,s,h,c,l,a,v),b)},n.prototype._readSheetReference=function(n,t,i){var r={success:!1,startSheetName:"",endSheetName:"",workBookName:""},f=!1,c=n.length,u,h,e,o,s;return(n.charAt(0)==="'"&&n.charAt(c-1)==="'"&&(f=!0,n=n.substr(1,c-2)),u=n.indexOf("["),u!==-1&&(u!==0&&(r.workBookName=n.substr(0,u),r.workBookName.charAt(u-1)!=="\\"&&(r.workBookName=r.workBookName+"\\")),h=rr(n,u,"[","]"),r.workBookName=r.workBookName+h.result,n=n.substr(h.endIndex+1)),e=n.indexOf(":"),e===-1?r.startSheetName=n:(r.startSheetName=n.substr(0,e),r.endSheetName=n.substr(e+1)),!r.startSheetName||r.startSheetName==="")?(r.success=!1,r):(o=this,s=o._validateWorkbook(r.workBookName,f),s=o._validateSheetName(r.startSheetName,t,f),s&=o._validateSheetName(r.endSheetName,t,f),i&&(r.startSheetName&&(r.startSheetName=r.startSheetName.replace("'","''")),r.endSheetName&&(r.endSheetName=r.endSheetName.replace("'","''"))),r.success=s,r)},n.prototype._isStartWithCellReference=function(n,t){return t?this._isR1C1CellReferance(n):this._isA1CellReferance(n)},n.prototype._isA1CellReferance=function(t){var f=this,s=n.BAND_INDEX_CONST,i={startRow:s,startColumn:s,endRow:s,endColumn:s,startRowRelative:!0,startColumnRelative:!0,endRowRelative:!0,endColumnRelative:!0,success:!1,endIndex:0},h,u,r,c,l,a,e,o;if(t=t.replace(" ",""),h=t.length,u=f._readOneA1Element(t,0),i.endIndex=u.endIndex,!u.success||i.endIndex>h)return i;if(u.isRow)return i.startRow=u.elementIndex,i.startRowRelative=u.isRelative,t.charAt(i.endIndex)===":"?(i.endIndex++,r=f._readOneA1Element(t,i.endIndex),i.endIndex=r.endIndex,!r.success||!r.isRow)?i:(i.endRow=r.elementIndex,i.endRowRelative=r.isRelative,i.success=!0,i):i;else if(i.startColumn=u.elementIndex,i.startColumnRelative=u.isRelative,t.charAt(i.endIndex)===":")return(i.endIndex++,r=f._readOneA1Element(t,i.endIndex),i.endIndex=r.endIndex,!r.success||r.isRow)?i:(i.endColumn=r.elementIndex,i.endColumnRelative=r.isRelative,i.success=!0,i);if(ni(t.charAt(i.endIndex))||t.charAt(i.endIndex)==="$"){if(r=f._readOneA1Element(t,i.endIndex),i.endIndex=r.endIndex,!r.success||!r.isRow)return i;if(i.startRow=r.elementIndex,i.startRowRelative=r.isRelative,c=i.endIndex,i.endIndex<h-1&&t.charAt(i.endIndex)===":"){if(t.charAt(i.endIndex+1)==="'"||(l=t.indexOf("!",i.endIndex+1),a=t.indexOf(":",i.endIndex+1),l!==-1&&(a===-1||a>l)))return i.success=!0,i;if(i.endIndex++,e=f._readOneA1Element(t,i.endIndex),!e.success||e.isRow)return i.endIndex=c,i.success=!0,i;else i.endIndex=e.endIndex;if(i.endColumn=e.elementIndex,i.endColumnRelative=e.isRelative,o=f._readOneA1Element(t,i.endIndex),o.success&&o.isRow)i.endIndex=o.endIndex;else return i.endIndex=c,i.endColumn=s,i.success=!0,i;return i.endRow=o.elementIndex,i.endRowRelative=o.isRelative,i.success=!0,i}else return i.success=!0,i}else return i},n.prototype._isR1C1CellReferance=function(t,i,r){var o=this,c=n.BAND_INDEX_CONST,u={startRow:c,startColumn:c,endRow:c,endColumn:c,startRowRelative:!0,startColumnRelative:!0,endRowRelative:!0,endColumnRelative:!0,success:!1,endIndex:0},l,e,f,a,v,y,s,h;if(t=t.replace(" ",""),l=t.length,e=o._readOneR1C1Element(t,i,r,0),u.endIndex=e.endIndex,!e.success)return u;if(e.isRow){if(u.startRow=e.elementIndex,u.startRowRelative=e.isRelative,u.endIndex>=l)return u.success=!0,u;if(t.charAt(u.endIndex)===":")return(u.endIndex++,f=o._readOneR1C1Element(t,i,r,u.endIndex),u.endIndex=f.endIndex,!f.success||!f.isRow)?u:(u.endRow=f.elementIndex,u.endRowRelative=f.isRelative,u.success=!0,u)}else return(u.startColumn=e.elementIndex,u.startColumnRelative=e.isRelative,u.endIndex>=l)?(u.success=!0,u):t.charAt(u.endIndex)===":"?(u.endIndex++,f=o._readOneR1C1Element(t,i,r,u.endIndex),u.endIndex=f.endIndex,!f.success||f.isRow)?u:(u.endColumn=f.elementIndex,u.endColumnRelative=f.isRelative,u.success=!0,u):u;if(t.charAt(u.endIndex)==="C"||t.charAt(u.endIndex)==="c"){if(f=o._readOneR1C1Element(t,i,r,u.endIndex),u.endIndex=f.endIndex,!f.success||f.isRow)return u;if(u.startColumn=f.elementIndex,u.startColumnRelative=f.isRelative,a=u.endIndex,u.endIndex<l-1&&t.charAt(u.endIndex)===":"){if(t.charAt(u.endIndex+1)==="'"||(v=t.indexOf("!",u.endIndex+1),y=t.indexOf(":",u.endIndex+1),v!==-1&&(y===-1||y>v)))return u.success=!0,u;if(u.endIndex++,s=o._readOneR1C1Element(t,i,r,u.endIndex),s.success&&s.isRow)u.endIndex=s.endIndex;else return u.endIndex=a,u.success=!0,u;if(u.endRow=s.elementIndex,u.endRowRelative=s.isRelative,h=o._readOneR1C1Element(t,i,r,u.endIndex),!h.success||h.isRow)return u.endIndex=a,u.success=!0,u;else u.endIndex=h.endIndex;return u.endColumn=h.elementIndex,u.endColumnRelative=h.isRelative,u.success=!0,u}else return u.success=!0,u}else return u},n.prototype._readOneA1Element=function(t,i){var c=n.BAND_INDEX_CONST,r={endIndex:i,elementIndex:c,isRow:!0,isRelative:!0,success:!1},s=t.length,u,f,e,o,h;if(i>=s||(t.charAt(i)==="$"&&(r.isRelative=!1,i++),i>=s))return r;if(u=i,e=t.charAt(u),ni(e)&&e!=="0"){for(r.isRow=!0;u<s&&ni(e);)u++,u<s&&(e=t.charAt(u));if(f=parseInt(t.substr(i,u-i),10),f>=1&&f<=n.maxRowCount)return r.elementIndex=f-1,r.endIndex=u,r.success=!0,r}else if(ci(e)){for(r.isRow=!1;u<s&&ci(e);)u++,u<s&&(e=t.charAt(u));if(o=t.substr(i,u-i),o.length>3)return r;for(o=o.toUpperCase(),f=0,h=o.length-1;h>=0;h--)f+=(o.charCodeAt(h)-64)*yi[o.length-h-1];if(f<=n.maxColumnCount)return r.elementIndex=f-1,r.endIndex=u,r.success=!0,r}return r},n.prototype._readOneR1C1Element=function(t,i,r,u){var a=n.BAND_INDEX_CONST,f={endIndex:u,elementIndex:a,isRow:!0,isRelative:!1,success:!1},s=t.length,e,o,c,l,h;if(u>=s)return f;if(e=u,o=t.charAt(e),o==="R"||o==="r")f.isRow=!0,c=i;else if(o==="C"||o==="c")f.isRow=!1,c=r;else return f;if(u++,e++,u>=s)return f.endIndex=u,f.elementIndex=c,f.isRelative=!0,f.success=!0,f;if((o=t.charAt(e),o==="["&&(u++,e++,f.isRelative=!0),u>=s)||(l=!1,o=t.charAt(e),f.isRelative&&o==="-"&&(u++,e++,l=!0),u>=s))return f;if(o=t.charAt(e),ni(o)){while(e<s&&ni(o))e++,e<s&&(o=t.charAt(e));if(h=parseInt(t.substr(u,e-u),10),f.isRelative){if(e>=s||t.charAt(e)!=="]")return f;e++}if(h<(f.isRow?n.maxRowCount:n.maxColumnCount))return f.isRelative?(h=l?-h:h,f.elementIndex=h+c):f.elementIndex=h-1,f.endIndex=e,f.success=!0,f}else return f.isRelative?f:(f.endIndex=u,f.elementIndex=c,f.isRelative=!0,f.success=!0,f)},n.prototype._validateWorkbook=function(n,t){var i,r;if(n===e||n===f||n==="")return!0;for(r=0;r<n.length;r++)if(i=n[r],t){if(i==="*"||i===":"||i==="["||i==="]"||i==="?"||i==="'"&&(r===0||r>=n.length-1||n.charAt(r+1)!=="'"))return!1}else if(i==="'"||i==="["||i==="]"||i==="?"||i==="%"||this._operatorInfix.indexOf(i)!==-1)return!1;return!0},n.prototype._validateSheetName=function(n,t,i){var o,r,u;if(n===e||n===f||n==="")return!0;if(!i&&tr(n.charAt(0))||(o=this._isStartWithCellReference(n,t),!i&&o.success&&o.endIndex===n.length))return!1;for(u=0;u<n.length;u++)if(r=n.charAt(u),i){if(r==="*"||r===":"||r==="["||r==="]"||r==="?"||r==="\\"||r==="/")return!1}else if(r==="'"||r==="["||r==="]"||r==="?"||r==="\\"||r==="%"||r==='"'||this._operatorInfix.indexOf(r)!==-1)return!1;return!0},n.prototype._createStructExpression=function(n,t,r){if(t.charAt(t.length-1)==="]")try{return new u.StructReferenceExpression(t,n)}catch(o){throw i.SR.Exp_FormulaInvalid+i.SR.SingleQuote+"{"+i.SR.AtIndexOn+r+i.SR.FullStop;}else{var e=n.getTableByName(t);if(e)return u.StructReferenceExpression.create(e)}return f},n.prototype._validateName=function(n){var r,t,i;if(n===e||n===f||n===""||(r=n.length,r===1&&(n==="R"||n==="r"||n==="C"||n==="c"))||(t=n.charAt(0),!(t==="_"||t==="\\"||ci(t)||ou(t))))return!1;for(i=1;i<r;i++)if(t=n.charAt(i),!(t==="_"||t==="\\"||t==="?"||t==="."||ir(t)||ou(t)))return!1;return!0},n.BAND_INDEX_CONST=-2147483648,n.maxRowCount=1048576,n.maxColumnCount=16384,n._isLetter=ci,n._isLetterOrDigit=ir,n}();r.Parser=v;ii=function(){function n(n,t,i,r,u,f,e,o){this._expandArrayToMultiCallCount=0;var s=this,h=arguments.length;s.source=n;s.arrayFormulaMode=h>=2?t:!1;s.row=h>=3?i:0;s.column=h>=4?r:0;s.rowCount=h>=5?u:1;s.columnCount=h>=6?f:1;s.activeRow=h>=7?e:s.row;s.activeColumn=h>=8?o:s.column;s.rowOffset=h<7?s.row:s.activeRow-s.row;s.columnOffset=h<8?s.column:s.activeColumn-s.column}return n.prototype.getValue=function(n,t,i){return n?n.getValue(t,i):l},n.prototype.getReference=function(n,t,i,r,u){return n?n.getReference(t,i,r,u):l},n.prototype.getFunction=function(n){var t=this;return t.source&&t.source.getFunction?t.source.getFunction(n):f},n.prototype.getName=function(n){var t=this;return t.source&&t.source.getName?t.source.getName(n,t.row,t.column):f},n.prototype._isExpandArrayToMultiCall=function(){return this._expandArrayToMultiCallCount>0},n.prototype._beginExpandArrayToMultiCall=function(){this._expandArrayToMultiCallCount++},n.prototype._endExpandArrayToMultiCall=function(){this._expandArrayToMultiCallCount--},n.prototype._offset=function(t,i){var r=this;return new n(r.source,r.arrayFormulaMode,r.row+t,r.column+i,r.rowCount,r.columnCount,r.rowOffset,r.columnOffset)},n}();r.EvaluateContext=ii;pu=new v;fr=function(){function n(){}return n.prototype.evaluateFormula=function(n,t,i){return this.evaluateExpression(pu.parse(n,t),i)},n.prototype.evaluateExpression=function(n,t,i){var r=this._evaluate(n,t,!1,!1);return i?r===e||r===f?0:r:r},n.prototype._evaluate=function(n,t,r,e){var s,o,h,l,a,c;if(!n)throw i.SR.Exp_ExprIsNull;while(n instanceof u.ParenthesesExpression)n=n.argument;return s=this,h=f,n instanceof u.ExpandExpression&&(l=n,n=l.expr,h=l.needExpendIndexs),n instanceof u.ConstantExpression?o=s._evaluateConst(n,t,r):n instanceof u.ReferenceExpression?o=s._evaluateReference(n,t,e):n instanceof u.ExternalNameExpression?(c=f,(a=n.source.getCalcService())&&(c=a._getEvaluatorContext4Cell(n.source._sheet,t.row,t.column,t.arrayFormulaMode)),c||(o=ot),o=s._evaluateName(n.name,c,t,r,e)):n instanceof u.NameExpression?o=s._evaluateName(n.name,t,t,r,e):n instanceof u.UnaryOperatorExpression?o=s._evaluateUnaryOperation(n,t,r,e,h):n instanceof u.BinaryOperatorExpression?o=s._evaluateBinaryOperation(n,t,r,e,h):n instanceof u.FunctionExpression&&(o=s._evaluateFunction(n,t,r,e,h)),o},n.prototype._evaluateConst=function(n,t,i){var r=n.value;return r instanceof p?i||t&&(t.arrayFormulaMode||t._isExpandArrayToMultiCall())?r:lt.getArrayValue(r,0,0):r},n.prototype._evaluateReference=function(n,t,i){var f,e,o,h,c;if(!t)return s;f=t.source;n instanceof u.ExternalReferenceExpression?f=n.source:n instanceof u.StructReferenceExpression&&(f=n.source());var a=t.row,v=t.column,r=n.getRange(a,v);if(!r)return l;if(i||t.arrayFormulaMode)return t.getReference(f,r.row,r.column,r.rowCount,r.columnCount);if(e=r.row,o=r.column,r.rowCount>1||r.columnCount>1)if(h=t.row>=r.row&&t.row<r.row+r.rowCount,c=t.column>=r.column&&t.column<r.column+r.columnCount,h||c)if(h&&!c&&r.columnCount===1)e=t.row;else if(!h&&c&&r.rowCount===1)o=t.column;else if(r.rowCount===1||r.columnCount===1)e=t.row,o=t.column;else return s;else return s;else if(r.row===-1&&r.rowCount===-1){if(r.columnCount!==1)return s;e=t.row}else if(r.column===-1&&r.columnCount===-1){if(r.rowCount!==1)return s;o=t.column}return t.getValue(f,e,o)},n.prototype._evaluateName=function(n,t,i,r,u){if(!t||!i)return ot;var f=t.getName(n);return f?this._evaluate(f,i,r,u):ot},n.prototype._evaluateOperationArg=function(n,t,i,u){var f=this._evaluate(n,t,i,u);return f instanceof d?f:f===r.missingArgument?g:f},n.prototype._evaluateUnaryOperation=function(n,t,i,u,e){var s=!1,o;return(e!=f&&e.length>0&&(i=!0,s=!0),o=this._evaluate(n.operand,t,i,s),o instanceof r.Error)?o:o===r.missingArgument?g:this._evaluateWithArgs(n,function(i){return n.operator.evaluate(i[0],t)},t,e,[o],i,u)},n.prototype._evaluateBinaryOperation=function(n,t,i,u,e){var c=[i,i],l=[n.operator.acceptsReference,n.operator.acceptsReference],a,h,o,s;if(e!=f&&e.length>0)for(o=0;o<e.length;o++)c[e[o]]=!0,l[e[o]]=!0;for(a=[n.left,n.right],h=[],o=0;o<2;o++){if(s=this._evaluate(a[o],t,c[o],l[o]),s instanceof r.Error)return s;if(s===r.missingArgument)return g;h[o]=s}return this._evaluateWithArgs(n,function(i){return n.operator.evaluate(i[0],i[1],t)},t,e,h,i,u)},n.prototype._evaluateFunction=function(n,t,i,u,e){var a,v,y,w,it,c,o,h,k,d,rt,ut,g;if(!n||!n.fn||typeof n.fn=="string")return ot;var nt=n.argCount(),s=n.fn,l,tt=f;if(nt===0)l=[];else{for(l=[],a=[],v=[],o=0;o<nt;o++)a[o]=s.acceptsArray(o),v[o]=s.acceptsReference(o);if(e&&e.length>0){for(tt=[],o=0;o<nt;o++)tt[o]=!0;for(o=0;o<e.length;o++)y=e[o],a[y]=!0,v[y]=!0,tt[y]=!(s.acceptsReference(y)&&!s.acceptsArray(y))}for(s.isBranch()&&(t.arrayFormulaMode||t._isExpandArrayToMultiCall())&&(a[s.findTestArgument()]=!0,v[s.findTestArgument()]=!0),c=-1,it=-1,s.isBranch()&&(c=s.findTestArgument(),s.acceptsArray(c)&&t._beginExpandArrayToMultiCall(),w=this._evaluate(n.getArg(c),t,a[c],v[c]),s.acceptsArray(c)&&t._endExpandArrayToMultiCall(),w instanceof r.Reference||w instanceof r.CalcArray||(it=s.findBranchArgument(w))),o=0;o<nt;o++){if(c===o){l[o]=w;continue}else if(it>=0&&o!==it){l[o]=null;continue}if(s.acceptsArray(o)&&t._beginExpandArrayToMultiCall(),h=this._evaluate(n.getArg(o),t,a[o],v[o]),s.acceptsArray(o))t._endExpandArrayToMultiCall();else if(!s.acceptsArray(o)&&h instanceof p||!s.acceptsReference(o)&&h instanceof b)if(k=h instanceof p?h:f,d=h instanceof b?h:f,k!=f&&k.getRowCount()==1&&k.getColumnCount()==1)h=k.getValue(0,0);else if(d!=f&&d.getRowCount(0)==1&&d.getColumnCount(0)==1)h=d.getValue(0,0,0);else{if(rt=[],ut=!1,e!=f)for(g=0;g<e.length;g++)rt.push(e[g]),e[g]==o&&(ut=!0);ut||(rt.push(o),e=rt)}if(h instanceof r.Error&&!s.acceptsError(o))return h;h===r.missingArgument&&(s.acceptsMissingArgument(o)||(h=f));l[o]=h}}return this._evaluateWithArgs(n,function(n){return s.isContextSensitive()?(t.acceptsReference=u||t._isExpandArrayToMultiCall(),s.evaluateWithContext(n,t)):s.evaluate(n)},t,e,l,i,u,tt)},n.prototype._evaluateWithArgs=function(n,t,i,r,u,e,o,h){var v,l,a,k,y,c;if(r&&r.length>0){if(v=this._expandArgs(i,n,u,r,h),v==f)return g;var w=[],d=v[0].length,nt=v[0][0].length;for(l=0;l<d;l++)for(w[l]=[],a=0;a<nt;a++)try{for(k=[],y=0;y<u.length;y++)k[y]=v[y][l][a];c=t(k);c instanceof b&&(c=this.getOneValue(i,c));w[l][a]=c}catch(tt){w[l][a]=s}return new wt(w)}else try{return(c=t(u),i.arrayFormulaMode&&i._isExpandArrayToMultiCall())?c:c instanceof p&&!e?this.getOneValue(i,c):c instanceof b&&!o?this.getOneValue(i,c):c}catch(tt){return s}},n.prototype.getOneValue=function(n,t){var i,e,u,f;return t instanceof b?(i=t,i.getRangeCount()>1?t=s:(n.rowOffset!=-1||n.columnOffset!=-1?(u=i.getRowCount(0)==1?0:n.rowOffset,f=i.getColumnCount(0)==1?0:n.columnOffset):(u=i.getRowCount(0)==1?0:n.row-i.getRow(0),f=i.getColumnCount(0)==1?0:n.column-i.getColumn(0)),t=u>=i.getRowCount(0)||f>=i.getColumnCount(0)?g:i.getValue(0,u,f))):t instanceof r.Array&&(e=t,n.arrayFormulaMode&&(n.rowOffset!=-1||n.columnOffset!=-1)?(u=e.getRowCount()==1?0:n.rowOffset,f=e.getColumnCount()==1?0:n.columnOffset,t=u>=e.getRowCount()||f>=e.getColumnCount()?g:e.getValue(u,f)):t=e.getValue(0,0)),t},n.prototype._expandArgs=function(n,i,r,e,o){var nt=1,it=1,d=-1,ct=!0,lt=!0,y=i instanceof u.FunctionExpression?i:f,rt,at,ut,w,et,a,v,k;if(y==f||y.fn.expandRows()||(ct=!1),y==f||y.fn.expandColumns()||(lt=!1),y!=f&&y.fn.isBranch&&(n.arrayFormulaMode||n._isExpandArrayToMultiCall())){if(d=y.fn.findTestArgument(),rt=[],at=!1,e)for(ut=0;ut<e.length;ut++)rt.push(e[ut]),e[ut]===d&&(at=!0);if(at||r[d]instanceof p||r[d]instanceof b){for(w=0;w<y.argCount();w++)w!=d&&rt.indexOf(w)<0&&(r[w]instanceof p||r[w]instanceof b)&&rt.push(w);e=rt}}for(et=0;et<e.length;et++){var ot=r[e[et]],l=ot instanceof p?ot:null,s=ot instanceof b?ot:null,h=0,c=0;if(l!=f)h=l.getRowCount(),c=l.getColumnCount();else if(s!=f){if(s.getRangeCount()>1)return f;h=ct?s.getRowCount(0):1;c=lt?s.getColumnCount(0):1}nt=h>nt?h:nt;it=c>it?c:it}var st=[],ht=0,vt=e[ht];for(a=0;a<r.length;a++){st[a]=[];var ft=r[a],l=null,s=null,h=1,c=1;if(a==vt){if(l=ft instanceof p?ft:f,s=ft instanceof b?ft:f,(l!=f||s!=f)&&(h=l!=f?l.getRowCount():ct?s.getRowCount(0):1,c=l!=f?l.getColumnCount():lt?s.getColumnCount(0):1,(h!=1&&h!=nt||c!=1&&c!=it)&&(d==-1||a==d)))return f;ht++;vt=ht<e.length?e[ht]:-1}for(v=0;v<nt;v++)for(st[a][v]=[],k=0;k<it;k++)st[a][v][k]=h!=1&&v>=h||c!=1&&k>=c?g:l!=f?l.getValue(h==1?0:v,c==1?0:k):s!=f?o==f||o[a]?s.getValue(0,h==1?0:v,c==1?0:k):new tt(s,[new t.Range(s.getRow(0)+(h==1?0:v),s.getColumn(0)+(c==1?0:k),1,1)],0):ft}return st},n}();r.Evaluator=fr;wu="intersects";bu="contains";var rt="cellListeners",ut="rowListeners",ft="columnListeners",sr="rowSliceListeners",hr="columnSliceListeners",ku="addToAdjust",cr="addToDirty",du="incrementDelay",gu="decrementDelay",ri=function(){function n(){}return n.prototype.hasListeners=function(){return vf(this,this._listeners)},n.prototype.processCellListener=function(n,t){t?st(this,rt,n):ht(this,rt,n)},n.prototype.processRowListener=function(n,t){t?st(this,ut,n):ht(this,ut,n)},n.prototype.processColumnListener=function(n,t){t?st(this,ft,n):ht(this,ft,n)},n.prototype.addListenersToAdjust=function(){for(var n,u,t,r=this._listeners,i=0;i<r.length;i++)if(n=this[r[i]],n)for(u=n.length,t=0;t<u;t++)n[t][ku]()},n.prototype.addListenersToDirty=function(){for(var n,u,t,r=this._listeners,i=0;i<r.length;i++)if(n=this[r[i]],n)for(u=n.length,t=0;t<u;t++)n[t][cr]()},n.prototype.incrementDelayOfListeners=function(){for(var n,u,t,r=this._listeners,i=0;i<r.length;i++)if(n=this[r[i]],n)for(u=n.length,t=0;t<u;t++)n[t][du]()},n.prototype.decrementDelayOfListeners=function(){for(var n,u,t,r=this._listeners,i=0;i<r.length;i++)if(n=this[r[i]],n)for(u=n.length,t=0;t<u;t++)n[t][gu]()},n.prototype.addToAdjust=function(){},n.prototype.addToDirty=function(){},n.prototype.incrementDelay=function(){},n.prototype.decrementDelay=function(){},n}();r.BaseCalc=ri;lr=function(n){function t(t,i,r){n.call(this);var u=this;u.sheetSource=t;u.row=i;u.column=r;u.delay=0;u._listeners=[rt,ut,ft]}return __extends(t,n),t.prototype.incrementDelay=function(){this.delay+=1},t.prototype.decrementDelay=function(){this.delay-=1},t.prototype.startListening=function(){var n=this;n.sheetSource.linkCellExpression(n.row,n.column,1,1)},t.prototype.stopListening=function(){var n=this;n.sheetSource.unlinkCellExpression(n.row,n.column,1,1)},t.prototype.addToAdjust=function(){this.sheetSource._controller.addAdjustCell(this)},t.prototype.addToDirty=function(){this.sheetSource._controller.addDirtyCell(this)},t}(ri);r.CellCalc=lr;ar=function(n){function t(t,i){n.call(this);var r=this;r.sheetSource=t;r.row=i;r._listeners=[rt,ut,sr,ft]}return __extends(t,n),t.prototype.incrementDelay=function(){this.sheetSource.incrementDelay(this.row,-1,1,-1)},t.prototype.incrementDelay2=function(n,t){this.sheetSource.incrementDelay(this.row,n,1,t)},t.prototype.decrementDelay=function(){this.sheetSource.decrementDelay(this.row,-1,1,-1)},t.prototype.decrementDelay2=function(n,t){this.sheetSource.decrementDelay(this.row,n,1,t)},t.prototype.startListening=function(){this.sheetSource.linkRowExpression(this.row,1)},t.prototype.stopListening=function(){this.sheetSource.unlinkRowExpression(this.row,1)},t.prototype.processRowListener2=function(n,t,i){i?st(this,sr,{row:n,columnOffset:t,columnCount:1}):ht(this,sr,{row:n,columnOffset:t,columnCount:1})},t.prototype.addToAdjust=function(){this.sheetSource._controller.addAdjustRow(this)},t.prototype.addToDirty=function(){this.sheetSource._controller.addDirtyRow(this)},t}(ri);r.RowCalc=ar;vr=function(n){function t(t,i){n.call(this);var r=this;r.sheetSource=t;r.column=i;r._listeners=[rt,ut,ft,hr]}return __extends(t,n),t.prototype.incrementDelay=function(){this.sheetSource.incrementDelay(-1,this.column,-1,1)},t.prototype.incrementDelay2=function(n,t){this.sheetSource.incrementDelay(n,this.column,t,1)},t.prototype.decrementDelay=function(){this.sheetSource.decrementDelay(-1,this.column,-1,1)},t.prototype.decrementDelay2=function(n,t){this.sheetSource.decrementDelay(n,this.column,t,1)},t.prototype.startListening=function(){this.sheetSource.linkColumnExpression(this.column,1)},t.prototype.stopListening=function(){this.sheetSource.unlinkColumnExpression(this.column,1)},t.prototype.processColumnListener2=function(n,t,i){i?st(this,hr,{column:n,rowOffset:t,rowCount:1}):ht(this,hr,{column:n,rowOffset:t,rowCount:1})},t.prototype.addToAdjust=function(){this.sheetSource._controller.addAdjustColumn(this)},t.prototype.addToDirty=function(){this.sheetSource._controller.addDirtyColumn(this)},t}(ri);r.ColumnCalc=vr;li=function(n){function t(t){n.call(this);this.name=t;this._listeners=[rt,ut,ft]}return __extends(t,n),t.prototype.incrementDelay=function(){this.delay+=1},t.prototype.decrementDelay=function(){this.delay-=1},t.prototype.updateListening=function(n,t){var i=this;$(this._listeners).each(function(r,u){i[u]&&$(i[u]).each(function(i,r){n&&r.stopListening();t&&r.startListening()})})},t.prototype.addToDirty=function(){for(var n,u,t,r=this._listeners,i=0;i<r.length;i++)if(n=this[r[i]],n)for(u=n.length,t=0;t<u;t++)n[t][cr]()},t}(ri);r.NameCalc=li;var nf="cell",tf="row",rf="column",yf=function(){function n(n){this.sheetSource=n;this._listeners=[rt,ut,ft]}return n.prototype.processCellListener=function(n,t,i,r,u,f){f?st(this,rt,{type:nf,row:n,column:t,rowCount:i,columnCount:r,listener:u}):ht(this,rt,{type:nf,row:n,column:t,rowCount:i,columnCount:r,listener:u})},n.prototype.processRowListener=function(n,t,i,r,u,f,e,o,s){s?st(this,ut,{type:tf,row:n,column:t,rowCount:i,columnCount:r,listener:u}):ht(this,ut,{type:tf,row:n,column:t,rowCount:i,columnCount:r,listener:u})},n.prototype.processColumnListener=function(n,t,i,r,u,f,e,o,s){s?st(this,ft,{type:rf,row:n,column:t,rowCount:i,columnCount:r,listener:u}):ht(this,ft,{type:rf,row:n,column:t,rowCount:i,columnCount:r,listener:u})},n.prototype.addListenersToAdjust=function(n,t,i,r){for(var u,s,f,o=this._listeners,e=0;e<o.length;e++)if(u=this[o[e]],u)for(s=u.length,f=0;f<s;f++)er(u[f],n,t,i,r)&&u[f].listener[ku]()},n.prototype.addListenersToDirty=function(n,t,i,r){for(var u,s,f,o=this._listeners,e=0;e<o.length;e++)if(u=this[o[e]],u)for(s=u.length,f=0;f<s;f++)er(u[f],n,t,i,r)&&u[f].listener[cr]()},n.prototype.incrementDelayOfListeners=function(n,t){for(var i,e,r,f=this._listeners,u=0;u<f.length;u++)if(i=this[f[u]],i)for(e=i.length,r=0;r<e;r++)or(i[r],n,t)&&i[r].listener[du]()},n.prototype.decrementDelayOfListeners=function(n,t){for(var i,e,r,f=this._listeners,u=0;u<f.length;u++)if(i=this[f[u]],i)for(e=i.length,r=0;r<e;r++)or(i[r],n,t)&&i[r].listener[gu]()},n}();yr=function(){function n(n,t,i,r,u,f,e,o){var s=this;s._fromModel=n;s._fromRow=t;s._fromColumn=i;s._toModel=r;s._toRow=u;s._toColumn=f;s._rowCount=e;s._columnCount=o}return n.prototype.getRowOffset=function(){return this._toRow-this._fromRow},n.prototype.getColumnOffset=function(){return this._toColumn-this._fromColumn},n.prototype.sourceContains=function(n,t,i,r,u){var f=this;return f._fromModel===n&&(f._fromRow===-1||f._fromRow<=t&&t+r<=f._fromRow+f._rowCount)&&(f._fromColumn===-1||f._fromColumn<=i&&i+u<=f._fromColumn+f._columnCount)},n.prototype.destinationContains=function(n,t,i,r,u){var f=this;return f._toModel===n&&(f._toRow===-1||f._toRow<=t&&t+r<=f._toRow+f._rowCount)&&(f._toColumn===-1||f._toColumn<=i&&i+u<=f._toColumn+f._columnCount)},n.prototype.sourceIntersectWith=function(n,t,i,r,u){var e=this,o,s;return e._toModel!==n?f:(o=e._createValidCellRange(n,t,i,r,u),s=e._createValidCellRange(n,e._fromRow,e._fromColumn,r,u),s.intersectWith(o))},n.prototype._createValidCellRange=function(n,t,i,r,u){var f=t===-1?0:t,e=t===-1||r===-1?n.rowCount:r,o=i===-1?0:i,s=i===-1||u===-1?n.columnCount:u;return{row:f,column:o,rowCount:e,columnCount:s,intersectWith:uf}},n}();ai=function(){function n(){this.autoCalculation=!0;this.iteration=!1;this.maximumIterations=1;this.maximumChange=.01;var n=this;n._dataModels=[];n.clearDirties()}return n.prototype.attachDataModel=function(n){this._dataModels.contains(n)||this._dataModels.push(n)},n.prototype.detachDataModel=function(n){for(var o,i,s,r,e,t=this,h=f,u=t._headDirtyCells;u;u=h)h=u.nextDirty,u.sheetSource===n&&t.removeDirtyCell(u);for(o=f,i=t._headDirtyRows;i;i=o)o=i.nextDirty,i.sheetSource===n&&t.removeDirtyRow(i);for(s=f,r=t._headDirtyColumns;r;r=s)s=r.nextDirty,r.sheetSource===n&&t.removeDirtyColumn(r);for(e=0;e<t._dataModels.length;e++)if(t._dataModels[e]===n){t._dataModels.splice(e,1);break}},n.prototype.getAllCustomNames=function(){for(var i,r,u,n=[],t,f=0;f<this._dataModels.length;f++)i=this._dataModels[f],i._sheet&&(t||(t=i._sheet.parent),r=i._sheet.getCustomNames(),r&&r.length>0&&(n=n.concat(r)));return t&&t.getCustomNames&&(u=t.getCustomNames(),u&&u.length>0&&(n=n.concat(u))),n},n.prototype.isDirtyCell=function(n){return typeof n.previousDirty!==nt||n===this._headDirtyCells},n.prototype.addDirtyCell=function(n){var t=this;!n||typeof n.previousDirty!==nt||n===this._headDirtyCells||(t._headDirtyCells?t._tailDirtyCells.nextDirty=n:t._headDirtyCells=n,n.previousDirty=t._tailDirtyCells,n.nextDirty=f,t._tailDirtyCells=n)},n.prototype.removeDirtyCell=function(n){var r=this,t,i;r.isDirtyCell(n)&&(t=n.previousDirty,i=n.nextDirty,t?t.nextDirty=i:r._headDirtyCells=i,i?i.previousDirty=t:r._tailDirtyCells=t,n.previousDirty=e,n.nextDirty=e)},n.prototype.isDirtyRow=function(n){return n.previousDirty||n===this._headDirtyRows},n.prototype.addDirtyRow=function(n){var t=this;n&&!t.isDirtyRow(n)&&n.row<n.sheetSource.getRowCount()&&(t._headDirtyRows?t._tailDirtyRows.nextDirty=n:t._headDirtyRows=n,n.previousDirty=t._tailDirtyRows,n.nextDirty=f,t._tailDirtyRows=n)},n.prototype.removeDirtyRow=function(n){var r=this,t,i;r.isDirtyRow(n)&&(t=n.previousDirty,i=n.nextDirty,t?t.nextDirty=i:r._headDirtyRows=i,i?i.previousDirty=t:r._tailDirtyRows=t,n.previousDirty=f,n.nextDirty=f)},n.prototype.isDirtyColumn=function(n){return n.previousDirty||n===this._headDirtyColumns},n.prototype.addDirtyColumn=function(n){var t=this;n&&!t.isDirtyColumn(n)&&n.column<n.sheetSource.getColumnCount()&&(t._headDirtyColumns?t._tailDirtyColumns.nextDirty=n:t._headDirtyColumns=n,n.previousDirty=t._tailDirtyColumns,n.nextDirty=f,t._tailDirtyColumns=n)},n.prototype.removeDirtyColumn=function(n){var r=this,t,i;r.isDirtyColumn(n)&&(t=n.previousDirty,i=n.nextDirty,t?t.nextDirty=i:r._headDirtyColumns=i,i?i.previousDirty=t:r._tailDirtyColumns=t,n.previousDirty=f,n.nextDirty=f)},n.prototype.isVolatileCell=function(n){return n.previousVolatile||n===this._headVolatileCells},n.prototype.addVolatileCell=function(n){var t=this;n&&!t.isVolatileCell(n)&&n.row<n.sheetSource.getRowCount()&&n.column<n.sheetSource.getColumnCount()&&(t._headVolatileCells?t._tailVolatileCells.nextDirty=n:t._headVolatileCells=n,n.previousDirty=t._tailVolatileCells,n.nextDirty=f,t._tailVolatileCells=n)},n.prototype.removeVolatileCell=function(n){var r=this,t,i;r.isVolatileCell(n)&&(t=n.previousDirty,i=n.nextDirty,t?t.nextDirty=i:r._headVolatileCells=i,i?i.previousDirty=t:r._tailVolatileCells=t,n.previousDirty=e,n.nextDirty=e)},n.prototype.isAdjustCell=function(n){return n.previousAdjust||n===this._headAdjustCells},n.prototype.addAdjustCell=function(n){var t=this;n&&!t.isAdjustCell(n)&&n.row<n.sheetSource.getRowCount()&&n.column<n.sheetSource.getColumnCount()&&(t._headAdjustCells?t._tailAdjustCells.nextAdjust=n:t._headAdjustCells=n,n.previousAdjust=t._tailAdjustCells,n.nextAdjust=f,t._tailAdjustCells=n)},n.prototype.removeAdjustCell=function(n){var r=this,t,i;r.isAdjustCell(n)&&(t=n.previousAdjust,i=n.nextAdjust,t?t.nextAdjust=i:r._headAdjustCells=i,i?i.previousAdjust=t:r._tailAdjustCells=t,n.previousAdjust=f,n.nextAdjust=f)},n.prototype.isAdjustRow=function(n){return n.previousAdjust||n===this._headAdjustRows},n.prototype.addAdjustRow=function(n){var t=this;n&&!t.isAdjustRow(n)&&n.row<n.sheetSource.getRowCount()&&(t._headAdjustRows?t._tailAdjustRows.nextAdjust=n:t._headAdjustRows=n,n.previousAdjust=t._tailAdjustRows,n.nextAdjust=f,t._tailAdjustRows=n)},n.prototype.removeAdjustRow=function(n){var r=this,t,i;r.isAdjustRow(n)&&(t=n.previousAdjust,i=n.nextAdjust,t?t.nextAdjust=i:r._headAdjustRows=i,i?i.previousAdjust=t:r._tailAdjustRows=t,n.previousAdjust=f,n.nextAdjust=f)},n.prototype.isAdjustColumn=function(n){return n.previousAdjust||n===this._headAdjustColumns},n.prototype.addAdjustColumn=function(n){var t=this;n&&!t.isAdjustColumn(n)&&n.column<n.sheetSource.getColumnCount()&&(t._headAdjustColumns?t._tailAdjustColumns.nextAdjust=n:t._headAdjustColumns=n,n.previousAdjust=t._tailAdjustColumns,n.nextAdjust=f,t._tailAdjustColumns=n)},n.prototype.removeAdjustColumn=function(n){var r=this,t,i;r.isAdjustColumn(n)&&(t=n.previousAdjust,i=n.nextAdjust,t?t.nextAdjust=i:r._headAdjustColumns=i,i?i.previousAdjust=t:r._tailAdjustColumns=t,n.previousAdjust=f,n.nextAdjust=f)},n.prototype.recalculate=function(n){var d,g,p,k,w,nt,tt;n===undefined&&(n=!0);var i=this,c=f,b=!1,r,u,e,l,a,v,y,t,o,s,h;if(n){while(i._headVolatileCells)i.addDirtyCell(i._headVolatileCells),i.removeVolatileCell(i._headVolatileCells);while(i._headDirtyRows){for(r=i._headDirtyRows.sheetSource,y=r.getColumnCount(),e=0;e<y;e++)i.addDirtyCell(r._getCellCalc(i._headDirtyRows.row,e,!0));i.removeDirtyRow(i._headDirtyRows)}while(i._headDirtyColumns){for(r=i._headDirtyColumns.sheetSource,v=r.getRowCount(),u=0;u<v;u++)i.addDirtyCell(r._getCellCalc(u,i._headDirtyColumns.column,!0));i.removeDirtyColumn(i._headDirtyColumns)}for(t=i._headDirtyCells;t;t=t.nextDirty){for(r=t.sheetSource,l=t.row,a=t.column,o=r._getRowCalc(l,!1),s=r._getColumnCalc(a,!1),h=r._getRangeCalc(!1),t.addListenersToDirty(),o&&o.addListenersToDirty(a),s&&s.addListenersToDirty(l),h&&h.addListenersToDirty(l,a,1,1);i._headDirtyRows;){for(r=i._headDirtyRows.sheetSource,y=r.getColumnCount(),e=0;e<y;e++)i.addDirtyCell(r._getCellCalc(i._headDirtyRows.row,e,!0));i.removeDirtyRow(i._headDirtyRows)}while(i._headDirtyColumns){for(r=i._headDirtyColumns.sheetSource,v=r.getRowCount(),u=0;u<v;u++)i.addDirtyCell(r._getCellCalc(u,i._headDirtyColumns.column,!0));i.removeDirtyColumn(i._headDirtyColumns)}}}for(t=i._headDirtyCells;t;t=c)r=t.sheetSource,d=r.getRowCount(),g=r.getColumnCount(),c=t.nextDirty,t.row<d&&t.column<g?t.delay=0:i.removeDirtyCell(t);for(t=i._headDirtyCells;t;t=t.nextDirty)r=t.sheetSource,u=t.row,e=t.column,o=r._getRowCalc(u,!1),s=r._getColumnCalc(e,!1),h=r._getRangeCalc(!1),t.incrementDelayOfListeners(),o&&o.incrementDelayOfListeners(e),s&&s.incrementDelayOfListeners(u),h&&h.incrementDelayOfListeners(u,e);do for(b=!1,t=i._headDirtyCells;t;t=c)c=t.nextDirty,t.delay===0&&(r=t.sheetSource,u=t.row,e=t.column,o=r._getRowCalc(u,!1),s=r._getColumnCalc(e,!1),h=r._getRangeCalc(!1),r.recalculateCell(u,e),i.removeDirtyCell(t),t.decrementDelayOfListeners(),o&&o.decrementDelayOfListeners(e),s&&s.decrementDelayOfListeners(u),h&&h.decrementDelayOfListeners(u,e),b=!0);while(b);if(i._headDirtyCells)for(p=!0,k=0;p&&k<i.maximumIterations;k++)for(p=!1,t=i._headDirtyCells;t;t=t.nextDirty)w=t.sheetSource,u=t.row,e=t.column,nt=w.getValue(u,e),w.recalculateCell(u,e),tt=w.getValue(u,e),i._iterationChange(nt,tt)>=i.maximumChange&&(p=!0)},n.prototype._iterationChange=function(n,t){var i=parseFloat(n),r=parseFloat(t);return et(r-i)},n.prototype.clearDirties=function(){var n=this;n._headAdjustCells=f;n._tailAdjustCells=f;n._headAdjustRows=f;n._tailAdjustRows=f;n._headAdjustColumns=f;n._tailAdjustColumns=f;n._headDirtyCells=f;n._tailDirtyCells=f;n._headDirtyRows=f;n._tailDirtyRows=f;n._headDirtyColumns=f;n._tailDirtyColumns=f;n._headVolatileCells=f;n._tailVolatileCells=f},n.prototype._adjustIndexOnAdd=function(n,t,i,r,u,f,e,o){if(i>=0||!u){var s=r+(u?i:0);return f===n&&e+o<=i&&(s-=u?o:0),f===t&&e<=s&&(s+=o),s-(u?i:0)}return r},n.prototype._adjustRangeOnAdd=function(n,t,i,r,u,f,e,o,s,h){if(i>=0||!u){var l=r+(u?i:0),c=f+(e?i:0);return o===n&&s+h<=i&&(l-=u?h:0,c-=e?h:0),o===t&&(s<=l?(l+=h,c+=h):s<=c&&(c+=h)),l-=u?i:0,c-=e?i:0,{index:l,endIndex:c}}return{index:r,endIndex:f}},n.prototype._adjustCellExpressionOnAddRow=function(n,t,i,r,f,e,o,s){var h,c;return t&&(h=f.rowRelative,(i>=0||!h)&&(c=this._adjustIndexOnAdd(n,t,i,f.row,f.rowRelative,e,o,s),c!==f.row))?n===t?new u.CellExpression(c,f.column,h,f.columnRelative):new u.ExternalCellExpression(t,c,f.column,h,f.columnRelative):f},n.prototype._adjustRangeExpressionOnAddRow=function(n,t,i,r,f,e,o,s){var v,h,l,a;if(t){if(v=f._getRangeType(),v===c.sheet||v===c.column)return f;if(h=f.startRowRelative,l=f.endRowRelative,i>=0||!h||!l){var w=this._adjustRangeOnAdd(n,t,i,f.startRow,h,f.endRow,l,e,o,s),y=w.index,p=w.endIndex;return v===c.row?(n===t?(a=new u.RangeExpression,a.initBand(y,p,h,l,!0)):(a=new u.ExternalRangeExpression,a.initBand(t,y,p,h,l,!0)),a):n===t?new u.RangeExpression(y,f.startColumn,p,f.endColumn,h,f.startColumnRelative,l,f.endColumnRelative):new u.ExternalRangeExpression(t,y,f.startColumn,p,f.endColumn,h,f.startColumnRelative,l,f.endColumnRelative)}}return f},n.prototype._adjustCellExpressionOnAddColumn=function(n,t,i,r,f,e,o,s){var h,c;return t&&(h=f.columnRelative,(r>=0||!h)&&(c=this._adjustIndexOnAdd(n,t,r,f.column,f.columnRelative,e,o,s),c!==f.column))?n===t?new u.CellExpression(f.row,c,f.rowRelative,h):new u.ExternalCellExpression(t,f.row,c,f.rowRelative,h):f},n.prototype._adjustStructReferenceExpressionOnAddColumn=function(n,t,i,r,u,f,e,o){if(t){var s=u;if(s&&t===s.source())return s.offsetWhenInsertRemoveColumn(e,o,!0)}return u},n.prototype._adjustStructReferenceExpressionOnRemoveColumn=function(n,t,i,r,u,f,e,o){if(t){var s=u;if(s&&t===s.source())return s.offsetWhenInsertRemoveColumn(e,o,!1)}return u},n.prototype._adjustRangeExpressionOnAddColumn=function(n,t,i,r,f,e,o,s){var v,h,l,a;if(t){if(v=f._getRangeType(),v===c.sheet||v===c.row)return f;if(h=f.startColumnRelative,l=f.endColumnRelative,r>=0||!h||!l){var w=this._adjustRangeOnAdd(n,t,r,f.startColumn,h,f.endColumn,l,e,o,s),y=w.index,p=w.endIndex;return v===c.column?(n===t?(a=new u.RangeExpression,a.initBand(y,p,h,l,!1)):(a=new u.ExternalRangeExpression,a.initBand(t,y,p,h,l,!1)),a):n===t?new u.RangeExpression(f.startRow,y,f.endRow,p,f.startRowRelative,h,f.endRowRelative,l):new u.ExternalRangeExpression(t,f.startRow,y,f.endRow,p,f.startRowRelative,h,f.endRowRelative,l)}}return f},n.prototype.adjustFormulaOnAddRows=function(n,t,i,r,o,s,h){var l=this,a=r,v,w,b,y,p,c,k;if(r instanceof u.CellExpression)a=l._adjustCellExpressionOnAddRow(n,n,t,i,r,o,s,h);else if(r instanceof u.RangeExpression)a=l._adjustRangeExpressionOnAddRow(n,n,t,i,r,o,s,h);else if(r instanceof u.ExternalCellExpression)a=l._adjustCellExpressionOnAddRow(n,r.source,t,i,r,o,s,h);else if(r instanceof u.ExternalRangeExpression)a=l._adjustRangeExpressionOnAddRow(n,r.source,t,i,r,o,s,h);else if(r instanceof u.ParenthesesExpression)v=l.adjustFormulaOnAddRows(n,t,i,r.argument,o,s,h),v!==r.argument&&(a=new u.ParenthesesExpression(v));else if(r instanceof u.UnaryOperatorExpression)v=l.adjustFormulaOnAddRows(n,t,i,r.operand,o,s,h),v!==r.operand&&(a=new u.UnaryOperatorExpression(r.operator,v));else if(r instanceof u.BinaryOperatorExpression)w=l.adjustFormulaOnAddRows(n,t,i,r.left,o,s,h),b=l.adjustFormulaOnAddRows(n,t,i,r.right,o,s,h),(w!==r.left||b!==r.right)&&(a=new u.BinaryOperatorExpression(r.operator,w,b));else if(r instanceof u.FunctionExpression){for(y=f,k=r.argCount(),c=0;c<k;c++)if(p=r.getArg(c),v=l.adjustFormulaOnAddRows(n,t,i,p,o,s,h),v!==p){y=[];y[c]=v;break}if(y){for(c=0;c<k;c++)p=r.getArg(c),(y[c]===e||y[c]===f)&&(y[c]=l.adjustFormulaOnAddRows(n,t,i,p,o,s,h));a=new u.FunctionExpression(r.fn,y)}}return a},n.prototype.adjustFormulasOnAddRows=function(n,t,i){this.adjustFormulasOnOperator(n,this.adjustFormulaOnAddRows,t,i)},n.prototype.adjustFormulaOnAddColumns=function(n,t,i,r,o,s,h){var l=this,a=r,v,w,b,y,p,c,k;if(r instanceof u.CellExpression)a=l._adjustCellExpressionOnAddColumn(n,n,t,i,r,o,s,h);else if(r instanceof u.RangeExpression)a=l._adjustRangeExpressionOnAddColumn(n,n,t,i,r,o,s,h);else if(r instanceof u.ExternalCellExpression)a=l._adjustCellExpressionOnAddColumn(n,r.source,t,i,r,o,s,h);else if(r instanceof u.ExternalRangeExpression)a=l._adjustRangeExpressionOnAddColumn(n,r.source,t,i,r,o,s,h);else if(r instanceof u.ParenthesesExpression)v=l.adjustFormulaOnAddColumns(n,t,i,r.argument,o,s,h),v!==r.argument&&(a=new u.ParenthesesExpression(v));else if(r instanceof u.UnaryOperatorExpression)v=l.adjustFormulaOnAddColumns(n,t,i,r.operand,o,s,h),v!==r.operand&&(a=new u.UnaryOperatorExpression(r.operator,v));else if(r instanceof u.BinaryOperatorExpression)w=l.adjustFormulaOnAddColumns(n,t,i,r.left,o,s,h),b=l.adjustFormulaOnAddColumns(n,t,i,r.right,o,s,h),(w!==r.left||b!==r.right)&&(a=new u.BinaryOperatorExpression(r.operator,w,b));else if(r instanceof u.FunctionExpression){for(y=f,k=r.argCount(),c=0;c<k;c++)if(p=r.getArg(c),v=l.adjustFormulaOnAddColumns(n,t,i,p,o,s,h),v!==p){y=[];y[c]=v;break}if(y){for(c=0;c<k;c++)p=r.getArg(c),(y[c]===e||y[c]===f)&&(y[c]=l.adjustFormulaOnAddColumns(n,t,i,p,o,s,h));a=new u.FunctionExpression(r.fn,y)}}else r instanceof u.StructReferenceExpression&&(a=l._adjustStructReferenceExpressionOnAddColumn(n,n,t,i,r,o,s,h));return a},n.prototype.adjustFormulasOnAddColumns=function(n,t,i){this.adjustFormulasOnOperator(n,this.adjustFormulaOnAddColumns,t,i)},n.prototype._adjustIndexOnRemove=function(n,t,i,r,u,f,e,o){if(i>=0||!u){var s=r+(u?i:0);if(f===n&&e<=i&&(s+=u?o:0),f===t)if(e+o<=s)s-=o;else if(e<=s)return l;return s-(u?i:0)}return r},n.prototype._adjustRangeOnRemove=function(n,t,i,r,u,f,e,o,s,h){if(i>=0||!u){var c=r+(u?i:0),a=f+(e?i:0),v=s+h-1;if(o===n&&s<=i&&(c+=u?h:0,a+=e?h:0),o===t)if(v<c)c-=h,a-=h;else if(s<=c&&v>=a)return l;else s>a||(v<=a?(c=s>=c?c:s,a-=e?h:0):a=s);return c-=u?i:0,a-=e?i:0,{index:c,endIndex:a}}return{index:r,endIndex:f}},n.prototype._adjustCellExpressionOnRemoveRow=function(n,t,i,r,f,e,o,s){var c,h;if(t&&(c=f.rowRelative,i>=0||!c)){if(h=this._adjustIndexOnRemove(n,t,i,f.row,f.rowRelative,e,o,s),h instanceof d)return new u.ErrorExpression(h);if(h!==f.row)return n===t?new u.CellExpression(h,f.column,c,f.columnRelative):new u.ExternalCellExpression(t,h,f.column,c,f.columnRelative)}return f},n.prototype._adjustRangeExpressionOnRemoveRow=function(n,t,i,r,f,e,o,s){var w,h,l,a,v,y,p;if(t){if(w=f._getRangeType(),w===c.sheet||w===c.column)return f;if(h=f.startRowRelative,l=f.endRowRelative,i>=0||!h||!l)return(a=this._adjustRangeOnRemove(n,t,i,f.startRow,h,f.endRow,l,e,o,s),a instanceof d)?new u.ErrorExpression(a):(v=a.index,y=a.endIndex,w===c.column)?(n===t?(p=new u.RangeExpression,p.initBand(v,y,h,l,!1)):(p=new u.ExternalRangeExpression,p.initBand(t,v,y,h,l,!1)),p):n===t?new u.RangeExpression(v,f.startColumn,y,f.endColumn,h,f.startColumnRelative,l,f.endColumnRelative):new u.ExternalRangeExpression(t,v,f.startColumn,y,f.endColumn,h,f.startColumnRelative,l,f.endColumnRelative)}return f},n.prototype._adjustCellExpressionOnRemoveColumn=function(n,t,i,r,f,e,o,s){var c,h;if(t&&(c=f.columnRelative,r>=0||!c)){if(h=this._adjustIndexOnRemove(n,t,r,f.column,f.columnRelative,e,o,s),h instanceof d)return new u.ErrorExpression(h);if(h!==f.column)return n===t?new u.CellExpression(f.row,h,f.rowRelative,c):new u.ExternalCellExpression(t,f.row,h,f.rowRelative,c)}return f},n.prototype._adjustRangeExpressionOnRemoveColumn=function(n,t,i,r,f,e,o,s){var w,h,l,a,v,y,p;if(t){if(w=f._getRangeType(),w===c.sheet||w===c.row)return f;if(h=f.startColumnRelative,l=f.endColumnRelative,r>=0||!h||!l)return(a=this._adjustRangeOnRemove(n,t,r,f.startColumn,h,f.endColumn,l,e,o,s),a instanceof d)?new u.ErrorExpression(a):(v=a.index,y=a.endIndex,w===c.column)?(n===t?(p=new u.RangeExpression,p.initBand(v,y,h,l,!1)):(p=new u.ExternalRangeExpression,p.initBand(t,v,y,h,l,!1)),p):n===t?new u.RangeExpression(f.startRow,v,f.endRow,y,f.startRowRelative,h,f.endRowRelative,l):new u.ExternalRangeExpression(t,f.startRow,v,f.endRow,y,f.startRowRelative,h,f.endRowRelative,l)}return f},n.prototype.adjustFormulaOnRemoveRows=function(n,t,i,r,o,s,h){var l=this,a=r,v,p,c,w,b,y,k;if(r instanceof u.CellExpression)a=l._adjustCellExpressionOnRemoveRow(n,n,t,i,r,o,s,h);else if(r instanceof u.RangeExpression)a=l._adjustRangeExpressionOnRemoveRow(n,n,t,i,r,o,s,h);else if(r instanceof u.ExternalCellExpression)a=l._adjustCellExpressionOnRemoveRow(n,r.source,t,i,r,o,s,h);else if(r instanceof u.ExternalRangeExpression)a=l._adjustRangeExpressionOnRemoveRow(n,r.source,t,i,r,o,s,h);else if(r instanceof u.ParenthesesExpression)v=l.adjustFormulaOnRemoveRows(n,t,i,r.argument,o,s,h),v!==r.argument&&(a=new u.ParenthesesExpression(v));else if(r instanceof u.UnaryOperatorExpression)v=l.adjustFormulaOnRemoveRows(n,t,i,r.operand,o,s,h),v!==r.operand&&(a=new u.UnaryOperatorExpression(r.operator,v));else if(r instanceof u.BinaryOperatorExpression)w=l.adjustFormulaOnRemoveRows(n,t,i,r.left,o,s,h),b=l.adjustFormulaOnRemoveRows(n,t,i,r.right,o,s,h),(w!==r.left||b!==r.right)&&(a=new u.BinaryOperatorExpression(r.operator,w,b));else if(r instanceof u.FunctionExpression){for(y=f,k=r.argCount(),c=0;c<k;c++)if(p=r.getArg(c),v=l.adjustFormulaOnRemoveRows(n,t,i,p,o,s,h),v!==p){y=[];y[c]=v;break}if(y){for(c=0;c<k;c++)p=r.getArg(c),(y[c]===e||y[c]===f)&&(y[c]=l.adjustFormulaOnRemoveRows(n,t,i,p,o,s,h));a=new u.FunctionExpression(r.fn,y)}}return a},n.prototype.adjustFormulasOnRemoveRows=function(n,t,i){this.adjustFormulasOnOperator(n,this.adjustFormulaOnRemoveRows,t,i)},n.prototype.adjustFormulaOnRemoveColumns=function(n,t,i,r,o,s,h){var l=this,a=r,v,p,c,w,b,y,k;if(r instanceof u.CellExpression)a=l._adjustCellExpressionOnRemoveColumn(n,n,t,i,r,o,s,h);else if(r instanceof u.RangeExpression)a=l._adjustRangeExpressionOnRemoveColumn(n,n,t,i,r,o,s,h);else if(r instanceof u.ExternalCellExpression)a=l._adjustCellExpressionOnRemoveColumn(n,r.source,t,i,r,o,s,h);else if(r instanceof u.ExternalRangeExpression)a=l._adjustRangeExpressionOnRemoveColumn(n,r.source,t,i,r,o,s,h);else if(r instanceof u.ParenthesesExpression)v=l.adjustFormulaOnRemoveColumns(n,t,i,r.argument,o,s,h),v!==r.argument&&(a=new u.ParenthesesExpression(v));else if(r instanceof u.UnaryOperatorExpression)v=l.adjustFormulaOnRemoveColumns(n,t,i,r.operand,o,s,h),v!==r.operand&&(a=new u.UnaryOperatorExpression(r.operator,v));else if(r instanceof u.BinaryOperatorExpression)w=l.adjustFormulaOnRemoveColumns(n,t,i,r.left,o,s,h),b=l.adjustFormulaOnRemoveColumns(n,t,i,r.right,o,s,h),(w!==r.left||b!==r.right)&&(a=new u.BinaryOperatorExpression(r.operator,w,b));else if(r instanceof u.FunctionExpression){for(y=f,k=r.argCount(),c=0;c<k;c++)if(p=r.getArg(c),v=l.adjustFormulaOnRemoveColumns(n,t,i,p,o,s,h),v!==p){y=[];y[c]=v;break}if(y){for(c=0;c<k;c++)p=r.getArg(c),(y[c]===e||y[c]===f)&&(y[c]=l.adjustFormulaOnRemoveColumns(n,t,i,p,o,s,h));a=new u.FunctionExpression(r.fn,y)}}else r instanceof u.StructReferenceExpression&&(a=l._adjustStructReferenceExpressionOnRemoveColumn(n,n,t,i,r,o,s,h));return a},n.prototype.adjustFormulasOnRemoveColumns=function(n,t,i){this.adjustFormulasOnOperator(n,this.adjustFormulaOnRemoveColumns,t,i)},n.prototype.adjustFormulasOnOperator=function(n,t,r,u){for(var k,s,h,c,l,w,y,d,a,v,p,o=this,g=o.getAllCustomNames(),b=0;b<g.length;b++)k=g[b],k.setExpression(t.call(o,f,-1,-1,k.getExpression(),n,r,u));for(y={};o._headAdjustCells;){if(s=o._headAdjustCells.sheetSource,d=s._sheet._getCalcModel(),h=o._headAdjustCells.row,c=o._headAdjustCells.column,y[h]&&y[h][c]){o.removeAdjustCell(o._headAdjustCells);continue}if(w=d.getNode(h,c),w&&w.expr)if(l=w.expr,l=t.call(o,s,h,c,l,n,r,u),a=d.getNode(h,c,!1).arrayInfo,a)for(a=new i.Range(h,c,a.rowCount,a.colCount),v=h;v<h+a.rowCount;v++)for(y[v]||(y[v]={}),p=c;p<c+a.colCount;p++)s.setExpression(v,p,l,a,v===h&&p===c),y[v][p]=!0;else s.setExpression(h,c,l,a,!0);else(s.getRowExpression&&s.getRowExpression(h)||s.getColumnExpression&&s.getColumnExpression(c))&&s._addCellsToDirty(h,c,1,1);o.removeAdjustCell(o._headAdjustCells)}while(o._headAdjustRows)s=o._headAdjustRows.sheetSource,h=o._headAdjustRows.row,s.getRowExpression&&(l=s.getRowExpression(h),l&&s.setExpression&&s.setExpression(h,-1,t.call(o,s,h,-1,l,n,r,u),e,!0)),o.removeAdjustRow(o._headAdjustRows);while(o._headAdjustColumns)s=o._headAdjustColumns.sheetSource,c=o._headAdjustColumns.column,s.getColumnExpression&&(l=s.getColumnExpression(c),l&&s.setExpression&&s.setExpression(-1,c,t.call(o,s,-1,c,l,n,r,u),e,!0)),o.removeAdjustColumn(o._headAdjustColumns)},n.prototype.adjustFormulaOnRemoveSheet2=function(n,t,i,r,u){return this.adjustFormulaOnRemoveSheet(n,r,u)},n.prototype.adjustFormulaOnRemoveSheet=function(n,t,i){var h=this,c=t,o,a,r,v,y,p,s,w;if(t instanceof u.ExternalReferenceExpression)v=t.source,(n!==i&&v===i||n===i&&v!==i)&&(c=new u.ErrorExpression(l));else if(t instanceof u.ParenthesesExpression)o=h.adjustFormulaOnRemoveSheet(n,t.argument,i),o!==t.argument&&(c=new u.ParenthesesExpression(o));else if(t instanceof u.UnaryOperatorExpression)o=h.adjustFormulaOnRemoveSheet(n,t.operand,i),o!==t.operand&&(c=new u.UnaryOperatorExpression(t.operator,o));else if(t instanceof u.BinaryOperatorExpression)y=h.adjustFormulaOnRemoveSheet(n,t.left,i),p=h.adjustFormulaOnRemoveSheet(n,t.right,i),(y!==t.left||p!==t.right)&&(c=new u.BinaryOperatorExpression(t.operator,y,p));else if(t instanceof u.FunctionExpression){for(s=f,w=t.argCount(),r=0;r<w;r++)if(a=t.getArg(r),o=h.adjustFormulaOnRemoveSheet(n,a,i),o!==a){s=[];s[r]=o;break}if(s){for(r=0;r<w;r++)a=t.getArg(r),(s[r]===e||s[r]===f)&&(s[r]=h.adjustFormulaOnRemoveSheet(n,a,i));c=new u.FunctionExpression(t.fn,s)}}return c},n.prototype.adjustFormulasOnRemoveSheet=function(n){this.adjustFormulasOnOperator(n,this.adjustFormulaOnRemoveSheet2)},n.prototype._adjustCellExpressionOnMove=function(n,t,i,r,f){var y=r instanceof u.ExternalReferenceExpression,h=y?r.source:n,c=r.rowRelative,a=r.columnRelative,o,s,p,v;if((t>=0||!c)&&(i>=0||!a)){if(o=r.row+(c?t:0),s=r.column+(a?i:0),v=f.destinationContains(n,t,i,1,1),h===f._toModel&&f.destinationContains(h,o,s,1,1)&&(!c&&!a||!v))return new u.ErrorExpression(l);if(p=(!y||h===f._fromModel)&&(!v&&f.sourceContains(f._fromModel,o,s,1,1)||v&&f.destinationContains(f._toModel,o,s,1,1)),v&&(o-=c?f.getRowOffset():0,s-=a?f.getColumnOffset():0),p&&(o+=f.getRowOffset(),s+=f.getColumnOffset()),o-=c?t:0,s-=a?i:0,f._fromModel===f._toModel?h=y?r.source:e:(h=e,p&&v&&y?h=f._toModel:p&&v||(p?h=f._toModel:v&&!y&&(h=f._fromModel))),o!==r.row||s!==r.column||h!=r.source)return h?new u.ExternalCellExpression(h,o,s,c,a):new u.CellExpression(o,s,c,a)}else if((t>=0||!c)&&i===-1){if(o=r.row+(c?t:0),f.destinationContains(n,t,i,1,1)&&(o-=c?f.getRowOffset():0),f.sourceContains(h,o,-1,c,-1))o+=f.getRowOffset();else if(f.destinationContains(h,o,-1,1,-1))return new u.ErrorExpression(l);if(o-=c?t:0,o!==r.row)if(r instanceof u.CellExpression)return new u.CellExpression(o,r.column,c,r.columnRelative);else if(r instanceof u.ExternalCellExpression)return new u.ExternalCellExpression(r.source,o,r.column,c,r.columnRelative)}else if(t===-1&&i>=0&&!a){if(s=r.column+(a?i:0),f.destinationContains(n,t,i,1,1)&&(s-=a?f.getColumnOffset():0),f.sourceContains(h,o,s,1,1))s+=f.getColumnOffset();else if(f.destinationContains(h,o,s,1,1))return new u.ErrorExpression(l);if(s-=a?i:0,o!==r.row||s!==r.column)if(r instanceof u.CellExpression)return new u.CellExpression(r.row,s,r.rowRelative,a);else if(r instanceof u.ExternalCellExpression)return new u.ExternalCellExpression(r.source,r.row,s,r.rowRelative,a)}return r},n.prototype._adjustRangeExpressionOnMove=function(n,t,i,r,f){var ot=r instanceof u.ExternalReferenceExpression,p=ot?r.source:n,ht=r._getRangeType(),v,w,y,b,o,h,s,a,k,d,g,nt,rt,ut,ft,et,st,tt,ct,lt,at,it,vt,yt,pt,wt;if(ht===c.cell){if(v=r.startRowRelative,w=r.startColumnRelative,y=r.endRowRelative,b=r.endColumnRelative,t>=0||!v||!y||i>=0||!w||!b){if(o=r.startRow+(v?t:0),h=r.endRow+(y?t:0),s=r.startColumn+(w?i:0),a=r.endColumn+(b?i:0),k=h-o+1,d=a-s+1,tt=f.destinationContains(n,t,i,1,1),tt&&(ct=f._toRow-f._toColumn,lt=f._toColumn-f._toRow,k+=(v?-ct:0)+(y?ct:0),d+=(w?-lt:0)+(b?lt:0)),p===f._toModel&&f.destinationContains(p,o,s,k,d)&&(!v&&!w&&!y&&!b||!tt))return new u.ErrorExpression(l);if(st=(!ot||p===f._fromModel)&&(!tt&&f.sourceContains(f._fromModel,o,s,k,d)||tt&&f.destinationContains(f._toModel,o,s,k,d)),tt&&(rt=v?f.getRowOffset():0,ut=y?f.getRowOffset():0,ft=w?f.getColumnOffset():0,et=b?f.getColumnOffset():0,o-=rt,h-=ut,s-=ft,a-=et),at=!1,st)g=f.getRowOffset(),nt=f.getColumnOffset(),o+=g,h+=g,s+=nt,a+=nt;else if(f.destinationContains(p,o,s,k,d))if(it=f.sourceIntersectWith(p,o,s,k,d),it&&(it.rowCount===k||it.columnCount===d))o=it.row+f.getRowOffset(),s=it.column+f.getColumnOffset(),h=o+it.rowCount,a=s+it.columnCount,at=!0;else return new u.ErrorExpression(l);if(o-=v?t:0,h-=y?t:0,s-=w?i:0,a-=b?i:0,f._fromModel===f._toModel?p=ot?r.source:e:(p=e,st&&tt&&ot?p=f._toModel:st&&tt||(st?p=f._toModel:tt&&!ot&&(p=f._fromModel))),o!==r.startRow||s!==r.startColumn||h!==r.endRow||a!==r.endColumn||at||p!=r.source)return p?new u.ExternalRangeExpression(p,o,s,h,a,v,w,y,b):new u.RangeExpression(o,s,h,a,v,w,y,b)}else if((t>=0||!v||!y)&&i===-1){if(o=r.startRow+(v?t:0),h=r.endRow+(y?t:0),o>h)return new u.ErrorExpression(l);if(f.destinationContains(n,t,i,1,1)&&(rt=v?f.getRowOffset():0,ut=y?f.getRowOffset():0,o-=rt,h-=ut),k=h-o,f.sourceContains(p,o,-1,k,-1))g=f.getRowOffset(),o+=g,h+=g;else if(f.destinationContains(p,o,-1,k,-1))return new u.ErrorExpression(l);if(o-=v?t:0,h-=y?t:0,o!==r.startRow||h!==r.endRow)if(r instanceof u.RangeExpression)return new u.RangeExpression(o,r.startColumn,h,r.endColumn,v,r.startColumnRelative,y,r.endColumnRelative);else if(r instanceof u.ExternalRangeExpression)return new u.ExternalRangeExpression(r.source,o,r.startColumn,h,r.endColumn,v,r.startColumnRelative,y,r.endColumnRelative)}else if(t===-1&&(i>=0||!w||!b)){if(s=r.startColumn+(w?i:0),a=r.endColumn+(b?i:0),s>a)return new u.ErrorExpression(l);if(f.destinationContains(n,t,i,1,1)&&(ft=w?f.getColumnOffset():0,et=b?f.getColumnOffset():0,s-=ft,a-=et),d=a-s,f.sourceContains(p,-1,s,-1,d))nt=f.getColumnOffset(),s+=nt,a+=nt;else if(f.destinationContains(p,-1,s,-1,d))return new u.ErrorExpression(l);if(s-=w?i:0,a-=b?i:0,s!==r.startColumn||a!==r.endColumn)if(r instanceof u.RangeExpression)return new u.RangeExpression(r.startRow,s,r.endRow,a,r.startRowRelative,w,r.endRowRelative,b);else if(r instanceof u.ExternalRangeExpression)return new u.ExternalRangeExpression(r.source,r.startRow,s,r.endRow,a,r.startRowRelative,w,r.endRowRelative,b)}}else if(ht===c.row){if(v=r.startRowRelative,y=r.endRowRelative,t>=0||!v||!y){if(o=r.startRow+(v?t:0),h=r.endRow+(y?t:0),o>h)return new u.ErrorExpression(l);if(f.destinationContains(n,t,i,1,1)&&(rt=v?f.getRowOffset():0,ut=y?f.getRowOffset():0,o-=rt,h-=ut),k=h-o,f.sourceContains(p,o,-1,k,-1))g=f.getRowOffset(),o+=g,h+=g;else if(f.destinationContains(p,o,-1,k,-1))return new u.ErrorExpression(l);if(o-=v?t:0,h-=y?t:0,o!==r.startRow||h!==r.endRow)if(r instanceof u.RangeExpression)return vt=new u.RangeExpression,vt.initBand(o,h,v,y,!0),vt;else if(r instanceof u.ExternalRangeExpression)return yt=new u.ExternalRangeExpression,yt.initBand(r.source,o,h,v,y,!0),yt}}else if(ht===c.column){if(w=r.startColumnRelative,b=r.endColumnRelative,s=r.startColumn+(w?i:0),a=r.endColumn+(b?i:0),s<a)return new u.ErrorExpression(l);if(f.destinationContains(n,t,i,1,1)&&(ft=w?f.getColumnOffset():0,et=b?f.getColumnOffset():0,s-=ft,a-=et),d=a-s,f.sourceContains(p,-1,s,-1,d))nt=f.getColumnOffset(),s+=nt,a+=nt;else if(f.destinationContains(p,-1,s,-1,d))return new u.ErrorExpression(l);if(s-=w?i:0,a-=b?i:0,s!==r.startColumn||a!==r.endColumn)if(r instanceof u.RangeExpression)return pt=new u.RangeExpression,pt.initBand(s,a,w,b,!1),pt;else if(r instanceof u.ExternalRangeExpression)return wt=new u.ExternalRangeExpression,wt.initBand(r.source,s,a,w,b,!1),wt}return r},n.prototype.adjustFormulaOnMove=function(n,t,i,r,o){var c=this,l=r,h,b,p;if(r instanceof u.CellExpression||r instanceof u.ExternalCellExpression)l=c._adjustCellExpressionOnMove(n,t,i,r,o);else if(r instanceof u.RangeExpression||r instanceof u.ExternalRangeExpression)l=c._adjustRangeExpressionOnMove(n,t,i,r,o);else if(r instanceof u.ParenthesesExpression)b=r,h=c.adjustFormulaOnMove(n,t,i,b.argument,o),h!==b.argument&&(l=new u.ParenthesesExpression(h));else if(r instanceof u.UnaryOperatorExpression)p=r,h=c.adjustFormulaOnMove(n,t,i,p.operand,o),h!==p.operand&&(l=new u.UnaryOperatorExpression(p.operator,h));else if(r instanceof u.BinaryOperatorExpression){var v=r,k=c.adjustFormulaOnMove(n,t,i,v.left,o),d=c.adjustFormulaOnMove(n,t,i,v.right,o);(k!==v.left||d!==v.right)&&(l=new u.BinaryOperatorExpression(v.operator,k,d))}else if(r instanceof u.FunctionExpression){for(var a=f,y,w=r,g=w.argCount(),s=0;s<g;s++)if(y=w.getArg(s),h=c.adjustFormulaOnMove(n,t,i,y,o),h!==y){a=[];a[s]=h;break}if(a){for(s=0;s<g;s++)y=w.getArg(s),(a[s]===e||a[s]===f)&&(a[s]=c.adjustFormulaOnMove(n,t,i,y,o));l=new u.FunctionExpression(w.fn,a)}}return l},n.prototype.adjustFormulasOnMove=function(n,t,r,u,o,s,h,c){for(var tt,a,v,y,p,k,rt,w,b,d,l=this,g=new yr(n,t,r,u,o,s,h,c),it=l.getAllCustomNames(),nt=0;nt<it.length;nt++)tt=it[nt],tt.setExpression(l.adjustFormulaOnMove(f,-1,-1,tt.getExpression(),g));for(k={};l._headAdjustCells;){if(a=l._headAdjustCells.sheetSource,rt=a._sheet._getCalcModel(),v=l._headAdjustCells.row,y=l._headAdjustCells.column,k[v]&&k[v][y]){l.removeAdjustCell(l._headAdjustCells);continue}if(p=a.getExpression(v,y),p)if(p=l.adjustFormulaOnMove(a,v,y,p,g),w=rt.getNode(v,y,!1).arrayInfo,w)for(w=new i.Range(v,y,w.rowCount,w.colCount),b=v;b<v+w.rowCount;b++)for(k[b]||(k[b]={}),d=y;d<y+w.colCount;d++)a.setExpression(b,d,p,w,b===v&&d===y),k[b][d]=!0;else a.setExpression(v,y,p,w,!0);else(a.getRowExpression&&a.getRowExpression(v)||a.getColumnExpression&&a.getColumnExpression(y))&&a._addCellsToDirty(v,y,1,1);l.removeAdjustCell(l._headAdjustCells)}while(l._headAdjustRows)a=l._headAdjustRows.sheetSource,v=l._headAdjustRows.row,a.getRowExpression&&(p=a.getRowExpression(v),p&&a._setRowExpression&&a._setRowExpression(v,l.adjustFormulaOnMove(a,v,-1,p,g),e)),l.removeAdjustRow(l._headAdjustRows);while(l._headAdjustColumns)a=l._headAdjustColumns.sheetSource,y=l._headAdjustColumns.column,a.getColumnExpression&&(p=a.getColumnExpression(y),p&&a._setColumnExpression&&a._setColumnExpression(y,l.adjustFormulaOnMove(a,-1,y,p,g),e)),l.removeAdjustColumn(l._headAdjustColumns)},n.prototype._adjustCellExpressionOnSwap=function(n,t,i,r,f){var c=r instanceof u.ExternalReferenceExpression?r.source:n,s=r.rowRelative,h=r.columnRelative,e,o;if((t>=0||!s)&&(i>=0||!h)){if(e=r.row+(s?t:0),o=r.column+(h?i:0),f.destinationContains(n,t,i,1,1)?(e-=s?f.getRowOffset():0,o-=h?f.getColumnOffset():0):f.sourceContains(n,e,o,1,1)&&(e+=s?f.getRowOffset():0,o+=h?f.getColumnOffset():0),f.sourceContains(c,e,o,1,1)?(e+=f.getRowOffset(),o+=f.getColumnOffset()):f.destinationContains(c,e,o,1,1)&&(e-=f.getRowOffset(),o-=f.getColumnOffset()),e-=s?t:0,o-=h?i:0,e!==r.row||o!==r.column)if(r instanceof u.CellExpression)return new u.CellExpression(e,o,s,h);else if(r instanceof u.ExternalCellExpression)return new u.ExternalCellExpression(r.source,e,o,s,h)}else if((t>=0||!s)&&i===-1){if(e=r.row+(s?t:0),f.destinationContains(n,t,-1,1,-1)?e-=s?f.getRowOffset():0:f.sourceContains(n,e,-1,1,-1)&&(e+=s?f.getRowOffset():0),f.sourceContains(c,e,-1,1,-1)?e+=f.getRowOffset():f.destinationContains(c,e,-1,1,-1)&&(e-=f.getRowOffset()),e-=s?t:0,e!==r.row||o!==r.column)if(r instanceof u.CellExpression)return new u.CellExpression(e,r.column,s,r.columnRelative);else if(r instanceof u.ExternalCellExpression)return new u.ExternalCellExpression(r.source,e,r.column,s,r.columnRelative)}else if(t===-1&&i>=0&&!h&&(o=r.column+(h?i:0),f.destinationContains(n,-1,i,-1,1)?o-=h?f.getColumnOffset():0:f.sourceContains(n,-1,o,-1,1)&&(o+=h?f.getColumnOffset():0),f.sourceContains(c,-1,o,-1,1)?o+=f.getColumnOffset():f.destinationContains(c,-1,o,-1,1)&&(o-=f.getColumnOffset()),o-=h?i:0,e!==r.row||o!==r.column))if(r instanceof u.CellExpression)return new u.CellExpression(r.row,o,r.rowRelative,h);else if(r instanceof u.ExternalCellExpression)return new u.ExternalCellExpression(r.source,r.row,o,r.rowRelative,h);return r},n.prototype._adjustRangeExpressionOnSwap=function(n,t,i,r,f){var tt=r instanceof u.ExternalReferenceExpression?r.source:n,ut=r._getRangeType(),e,s,o,h,it,rt,a,v,p,y,w,b,k,d,g,nt,ft,et,ot,st;if(ut===c.cell){if(a=r.startRowRelative,v=r.startColumnRelative,p=r.endRowRelative,y=r.endColumnRelative,(t>=0||!a||!p)&&(i>=0||!v||!y)){if(e=r.startRow+(a?t:0),s=r.endRow+(p?t:0),o=r.startColumn+(v?i:0),h=r.endColumn+(y?i:0),it=s-e,rt=h-o,f.destinationContains(n,t,i,1,1)?(k=a?f.getRowOffset():0,d=v?f.getColumnOffset():0,g=p?f.getRowOffset():0,nt=y?f.getColumnOffset():0,e-=k,s-=g,o-=d,h-=nt):f.sourceContains(n,e,o,it,rt)&&(k=a?f.getRowOffset():0,d=v?f.getColumnOffset():0,g=p?f.getRowOffset():0,nt=y?f.getColumnOffset():0,e+=k,s+=g,o+=d,h+=nt),f.sourceContains(tt,e,o,it,rt)?(w=f.getRowOffset(),b=f.getColumnOffset(),e+=w,s+=w,o+=b,h+=b):f.destinationContains(tt,e,o,it,rt)&&(w=f.getRowOffset(),b=f.getColumnOffset(),e-=w,s-=w,o-=b,h-=b),e-=a?t:0,s-=p?t:0,o-=v?i:0,h-=y?i:0,e!==r.startRow||o!==r.startColumn||s!==r.endRow||h!==r.endColumn)if(r instanceof u.RangeExpression)return new u.RangeExpression(e,o,s,h,a,v,p,y);else if(r instanceof u.ExternalRangeExpression)return new u.ExternalRangeExpression(r.source,e,o,s,h,a,v,p,y)}else if((t>=0||!a||!p)&&i===-1){if(e=r.startRow+(a?t:0),s=r.endRow+(p?t:0),e<s)return new u.ErrorExpression(l);if(f.destinationContains(n,t,-1,1,-1)?(k=a?f.getRowOffset():0,g=a?f.getRowOffset():0,e-=k,s-=g):f.sourceContains(n,t,-1,1,-1)&&(k=a?f.getRowOffset():0,g=a?f.getRowOffset():0,e+=k,s+=g),it=s-e,f.sourceContains(tt,e,-1,it,-1)?(w=f.getRowOffset(),e+=w,s+=w):f.destinationContains(tt,e,-1,it,-1)&&(w=f.getRowOffset(),e-=w,s-=w),e-=a?t:0,s-=p?t:0,e!==r.startRow||s!==r.endRow)if(r instanceof u.RangeExpression)return new u.RangeExpression(e,r.startColumn,s,r.endColumn,a,r.startColumnRelative,p,r.endColumnRelative);else if(r instanceof u.ExternalRangeExpression)return new u.ExternalRangeExpression(r.source,e,r.startColumn,s,r.endColumn,a,r.startColumnRelative,p,r.endColumnRelative)}else if(t===-1&&(i>=0||!v||!y)){if(o=r.startColumn+(v?i:0),h=r.endColumn+(y?i:0),o<h)return new u.ErrorExpression(l);if(f.destinationContains(n,-1,i,-1,1)?(d=v?f.getColumnOffset():0,nt=y?f.getColumnOffset():0,o-=d,h-=nt):f.sourceContains(n,-1,i,-1,1)&&(d=v?f.getColumnOffset():0,nt=y?f.getColumnOffset():0,o+=d,h+=nt),rt=h-o,f.sourceContains(tt,-1,o,-1,rt)?(b=f.getColumnOffset(),o+=b,h+=b):f.destinationContains(tt,-1,o,-1,rt)&&(b=f.getColumnOffset(),o-=b,h-=b),o-=v?i:0,h-=y?i:0,o!==r.startColumn||h!==r.endColumn)if(r instanceof u.RangeExpression)return new u.RangeExpression(r.startRow,o,r.endRow,h,r.startRowRelative,v,r.endRowRelative,y);else if(r instanceof u.ExternalRangeExpression)return new u.ExternalRangeExpression(r.source,r.startRow,o,r.endRow,h,r.startRowRelative,v,r.endRowRelative,y)}}else if(ut===c.row){if(a=r.startRowRelative,p=r.endRowRelative,t>=0||!a||!p){if(e=r.startRow+(a?t:0),s=r.endRow+(p?t:0),e<s)return new u.ErrorExpression(l);if(f.destinationContains(n,t,-1,1,-1)?(k=a?f.getRowOffset():0,g=p?f.getRowOffset():0,e-=k,s-=g):f.sourceContains(n,t,-1,1,-1)&&(k=a?f.getRowOffset():0,g=p?f.getRowOffset():0,e+=k,s+=g),it=s-e,f.sourceContains(tt,e,-1,it,-1)?(w=f.getRowOffset(),e+=w,s+=w):f.destinationContains(tt,e,-1,it,-1)&&(w=f.getRowOffset(),e-=w,s-=w),e-=a?t:0,s-=p?t:0,e!==r.startRow||s!==r.endRow)if(r instanceof u.RangeExpression)return ft=new u.RangeExpression,ft.initBand(e,s,a,p,!0),ft;else if(r instanceof u.ExternalRangeExpression)return et=new u.ExternalRangeExpression,et.initBand(r.source,e,s,a,p,!0),et}}else if(ut===c.column){if(v=r.startColumnRelative,y=r.endColumnRelative,o=r.startColumn+(v?i:0),h=r.endColumn+(y?i:0),o>h)return new u.ErrorExpression(l);if(f.destinationContains(n,-1,i,-1,1)?(d=v?f.getColumnOffset():0,nt=y?f.getColumnOffset():0,o-=d,h-=nt):f.sourceContains(n,-1,i,-1,1)&&(d=v?f.getColumnOffset():0,nt=y?f.getColumnOffset():0,o+=d,h+=nt),rt=h-o,f.sourceContains(tt,-1,o,-1,rt)?(b=f.getColumnOffset(),o+=b,h+=b):f.destinationContains(tt,-1,o,-1,rt)&&(b=f.getColumnOffset(),o-=b,h-=b),o-=v?i:0,h-=y?i:0,o!==r.startColumn||h!==r.endColumn)if(r instanceof u.RangeExpression)return ot=new u.RangeExpression,ot.initBand(o,h,v,y,!1),ot;else if(r instanceof u.ExternalRangeExpression)return st=new u.ExternalRangeExpression,st.initBand(r.source,o,h,v,y,!1),st}return r},n.prototype.adjustFormulaOnSwap=function(n,t,i,r,o){var c=this,a=r,h,y,p,l,v,s,w;if(r instanceof u.CellExpression||r instanceof u.ExternalCellExpression)a=c._adjustCellExpressionOnSwap(n,t,i,r,o);else if(r instanceof u.RangeExpression||r instanceof u.ExternalRangeExpression)a=c._adjustRangeExpressionOnSwap(n,t,i,r,o);else if(r instanceof u.ParenthesesExpression)h=c.adjustFormulaOnSwap(n,t,i,r.argument,o),h!==r.argument&&(a=new u.ParenthesesExpression(h));else if(r instanceof u.UnaryOperatorExpression)h=c.adjustFormulaOnSwap(n,t,i,r.operand,o),h!==r.operand&&(a=new u.UnaryOperatorExpression(r.operator,h));else if(r instanceof u.BinaryOperatorExpression)y=c.adjustFormulaOnSwap(n,t,i,r.left,o),p=c.adjustFormulaOnSwap(n,t,i,r.right,o),(y!==r.left||p!==r.right)&&(a=new u.BinaryOperatorExpression(r.operator,y,p));else if(r instanceof u.FunctionExpression){for(l=f,w=r.argCount(),s=0;s<w;s++)if(v=r.getArg(s),h=c.adjustFormulaOnSwap(n,t,i,v,o),h!==v){l=[];l[s]=h;break}if(l){for(s=0;s<w;s++)v=r.getArg(s),(l[s]===e||l[s]===f)&&(l[s]=c.adjustFormulaOnSwap(n,t,i,v,o));a=new u.FunctionExpression(r.fn,l)}}return a},n.prototype.adjustFormulasOnSwap=function(n,t,r,u,o,s,h,c){for(var tt,a,v,y,p,k,rt,w,b,d,l=this,g=new yr(n,t,r,u,o,s,h,c),it=l.getAllCustomNames(),nt=0;nt<it.length;nt++)tt=it[nt],tt.setExpression(l.adjustFormulaOnSwap(f,-1,-1,tt.getExpression(),g));for(k={};l._headAdjustCells;){if(a=l._headAdjustCells.sheetSource,rt=a._sheet._getCalcModel(),v=l._headAdjustCells.row,y=l._headAdjustCells.column,k[v]&&k[v][y]){l.removeAdjustCell(l._headAdjustCells);continue}if(p=a.getExpression(v,y),p)if(p=l.adjustFormulaOnSwap(a,v,y,p,g),w=rt.getNode(v,y,!1).arrayInfo,w)for(w=new i.Range(v,y,w.rowCount,w.colCount),b=v;b<v+w.rowCount;b++)for(k[b]||(k[b]={}),d=y;d<y+w.colCount;d++)a.setExpression(b,d,p,w,b===v&&d===y),k[b][d]=!0;else a.setExpression(v,y,p,w,!0);else(a.getRowExpression&&a.getRowExpression(v)||a.getColumnExpression&&a.getColumnExpression(y))&&a._addCellsToDirty(v,y,1,1);l.removeAdjustCell(l._headAdjustCells)}while(l._headAdjustRows)a=l._headAdjustRows.sheetSource,v=l._headAdjustRows.row,a.getRowExpression&&(p=a.getRowExpression(v),p&&a._setRowExpression&&a._setRowExpression(v,l.adjustFormulaOnSwap(a,v,-1,p,g),e)),l.removeAdjustRow(l._headAdjustRows);while(l._headAdjustColumns)a=l._headAdjustColumns.sheetSource,y=l._headAdjustColumns.column,a.getColumnExpression&&(p=a.getColumnExpression(y),p&&a._setColumnExpression&&a._setColumnExpression(y,l.adjustFormulaOnSwap(a,-1,y,p,g),e)),l.removeAdjustColumn(l._headAdjustColumns)},n}();r._Controller=ai;ff=function(){function n(n,t){var i=this;i._sheet=n;i._sheetArea=t;i._controller=new ai;i._controller.attachDataModel(i)}return n.prototype._getSheetReference=function(){var n=this;return n._reference=n._reference||new di(n),n._reference},n.prototype.getAllValue=function(n,t,i,r,u){var o=[[]],h=this.getRowCount(),c=this.getColumnCount(),a,v,f,e;if(t>h||i>c)return[[[l]]];for(t=t===undefined?0:t,i=i===undefined?0:i,r=r===undefined?h-t:r,u=u===undefined?c-i:u,a=0,v=0,f=0;f<r;f++)o[0][f]=[];if(t<0){for(a=-t,f=0;f<a;f++)for(e=0;e<u;f++)o[0][f][e]=s;t=0;r+=t}if(i<0){for(v=-i,f=0;f<r;f++)for(e=0;e<v;f++)o[0][f][e]=s;i=0;u+=i}if(t+r>h){for(f=h-t;f<r;f++)for(e=0;e<u;f++)o[0][f][e]=l;r-=r-h+t}if(i+u>c){for(f=0;f<r;f++)for(e=c-i;e<u;e++)o[0][f][e]=l;u-=u-c+i}return this._sheet._getValuesForCalc(o,t,i,r,u,a,v),o},n.prototype.getValue=function(n,t){var i=this;return n<0||t<0?s:n>=i.getRowCount()?l:t>=i.getColumnCount()?l:i._sheet._getCurrentValue(n,t)},n.prototype.getReference=function(n,t,i,r){var u=this;return n===-1&&t===-1?u._getSheetReference():n===-1?new tt(u._getSheetReference(),[{row:0,rowCount:u.getRowCount(),col:t,colCount:r}]):t===-1?new tt(u._getSheetReference(),[{row:n,rowCount:i,col:0,colCount:u.getColumnCount()}]):new tt(u._getSheetReference(),[{row:n,rowCount:i,col:t,colCount:r}])},n.prototype.getFunction=function(n){return this._sheet?this._sheet._findCustomFunction(n):f},n.prototype.getName=function(n,t,i){var r=this._sheet?this._sheet._findCustomName(n):f;return r?r.getExpression():f},n.prototype.getColumnCount=function(){return this._sheet.getColumnCount()},n.prototype.getRowCount=function(){return this._sheet.getRowCount()},n.prototype.getCalcService=function(){return this._sheet?this._sheet.getCalcService():f},n.prototype.hasFormula=function(n,t){return n=n!==e?n:-1,t=t!==e?t:-1,!!this.getExpression(n,t)},n.prototype.setFormula=function(n,t,i,r){var u=this,o,s,h;if(i&&i.length===0&&(i=f),!r&&u._intersectWithArrayFormula(n,t,1,1)&&u._throwArrayPartException(),o=u.getFormula(n,t),o!==i&&!(o===""&&!i||!o&&i==="")){if(s=u.getCalcService(),s)try{h=i?s.parse(i,n>=0?n:0,t>=0?t:0):f;u.setExpression(n,t,h,e,!1)}catch(c){if(!r)throw c;}n>=0&&t>=0&&u._sheet._getModel(u._sheetArea).setFormula(n,t,i)}},n.prototype.getFormula=function(n,t){var r=this.getCalcService(),i;return r&&(i=this.getEvaluateNode(n,t),i&&i.expr)?(n=i.arrayInfo?i.arrayInfo.row:n,t=i.arrayInfo?i.arrayInfo.col:t,r.unparse(i.expr,n,t)):f},n.prototype.getRowFormula=function(n){return this.getFormula(n,-1)},n.prototype.setRowFormula=function(n,t){this.setFormula(n,-1,t)},n.prototype.getColumnFormula=function(n){this.getFormula(-1,n)},n.prototype.setColumnFormula=function(n,t){this.setFormula(-1,n,t)},n.prototype._throwArrayPartException=function(){throw i.SR.Exp_ArrayFromulaPart;},n.prototype.setArrayFormula=function(n,r,u,e,o,s){var h=this,a,v,y,c,l;if(o&&o.length===0&&(o=f),a=h._sheet,a._hasSpans(n,r,u,e))throw i.SR.Exp_ArrayFromulaSpan;if((h._intersectWithArrayFormula(n,r,u,e)&&h._throwArrayPartException(),n=n<0?0:n,r=r<0?0:r,v=h.getCalcService(),v)&&(h._clear(n,r,u,e),o)){try{y=o?v.parse(o,n,r):f}catch(p){if(!s)throw p;return}for(c=n;c<n+u;c++)for(l=r;l<r+e;l++)h.setExpression(c,l,y,new t.Range(n,r,u,e),!1);n>=0&&r>=0&&a._getModel(h._sheetArea).setFormula(n,r,o,new i.Range(n,r,u,e))}},n.prototype._clear=function(n,i,r,u){var l=this,c=l._sheet._getCalcModel(l._sheetArea),s,h,o,y;if(!c)return f;var a=n<0?0:n,v=i<0?0:i,p=n<0?c.getRowCount():r,w=i<0?c.getColumnCount():u,b=a+p-1,k=v+w-1,d=l.getCalcService(),g=!1,nt=[],tt=[];for(s=a;s<=b&&s>=0;s=c.nextNonNullRow(s))for(h=v;h<=k&&h>=0;h=c.nextNonNullColumn(s,h))(o=c.getNode(s,h),o)&&(o.workingExpr||o.expr)&&(y=o.arrayInfo?new t.Range(o.arrayInfo.row,o.arrayInfo.col,o.arrayInfo.rowCount,o.arrayInfo.colCount):e,l.setExpression(s,h,f,y,!0))},n.prototype._intersectWithArrayFormula=function(n,t,i,r){return this._getFormulaExps(n,t,i,r,!0,!0)},n.prototype._getFormulaExps=function(n,i,r,u,e,o){var y=this,a=y._sheet._getCalcModel(y._sheetArea),h,c,l,s,it;if(!a)return f;var v=n<0?0:n,p=i<0?0:i,w=n<0?a.getRowCount():r,b=i<0?a.getColumnCount():u,g=v+(w===0?1:w)-1,nt=p+(b===0?1:b)-1,rt=y.getCalcService(),tt=!1,k=[],d=[];for(h=v;h<=g&&h>=0;h=a.nextNonNullRow(h))for(c=p;c<=nt&&c>=0;c=a.nextNonNullColumn(h,c))if(l=a.getNode(h,c),l)if(l.arrayInfo){if(s=l.arrayInfo,s.row<v||w>0&&s.row+s.rowCount-1>g||s.col<p||b>0&&s.col+s.colCount-1>nt){if(e)return!0;tt=!0}if(h!==s.row&&h!==v)continue;k.push(new t.Range(s.row,s.col,s.rowCount,s.colCount));it=l.expr;d.push(it);c=s.col+s.colCount-1}else!o&&l.expr&&(k.push({row:h,col:c}),d.push(l.expr));return e?!1:{hasPart:tt,ranges:k,formulas:d}},n.prototype.getExpression=function(n,t){var s=this,i=f,u,e,o,r=s._sheet._getCalcModel(s._sheetArea);return s._sheet?(u=r.getNode(n,t),u&&(i=u.expr),!i&&n<r.getRowCount()&&(e=r.getNode(n,-1),e&&(i=e.expr)),!i&&t<r.getColumnCount()&&(o=r.getNode(-1,t),o&&(i=o.expr))):n>=0&&t===-1?!i&&n<r.getRowCount()&&(e=r.getNode(n,-1),e&&(i=e.expr)):n===-1&&t>=0?i&&t<r.getColumnCount()&&(o=r.getNode(-1,t),o&&(i=o.expr)):n===-1&&t===-1&&(u=r.getNode(-1,-1),u&&(i=u.expr)),i},n.prototype.getEvaluateNode=function(n,t){var e=this,r=f,i,u=e._sheet._getCalcModel(e._sheetArea);return n>=0&&t>=0?(i=u.getNode(n,t),i&&(r=i.workingExpr||i.expr)):n>=0&&t===-1?!r&&n<u.getRowCount()&&(i=u.getNode(n,-1),i&&(r=i.workingExpr||i.expr)):n===-1&&t>=0?r&&t<u.getColumnCount()&&(i=u.getNode(-1,t),i&&(r=i.workingExpr||i.expr)):n===-1&&t===-1&&(i=u.getNode(-1,-1),i&&(r=i.workingExpr||i.expr)),i},n.prototype.setExpression=function(n,t,i,r,f){var o=this,c=o.getCalcService(),s=r!==e&&r!==null,v=new ii(o,s,s?r.row:n,s?r.col:t),h=u._mappingArray(v,i,s,s?n-r.row:0,s?t-r.col:0),l,a;h=h===i?e:h;r!==e&&(l=r);n>=0&&t>=0?((f===e||f)&&(a=i?c.unparse(i,n>=0?n:0,t>=0?t:0):e,o._sheet._getModel(o._sheetArea).setFormula(n,t,a)),o._setCellExpression(n,t,i,h,l)):n>=0&&t===-1?o._setRowExpression(n,i,h):n===-1&&t>=0&&o._setColumnExpression(t,i,h);o._controller.autoCalculation&&!c.IsSuspended()&&o._controller.recalculate()},n.prototype.getRowExpression=function(n){return this.getExpression(n,-1)},n.prototype.getColumnExpression=function(n){return this.getExpression(-1,n)},n.prototype._setCellExpression=function(n,t,i,r,u){var o=this,s,f;s=u?o._getCellCalc(n,t,!0):o._getCellCalc(n,t,!0);s&&(s.stopListening(),f=o._sheet._getCalcModel(o._sheetArea).getNode(n,t,!0),f.expr=i,i?((r||f.workingExpr)&&(f.workingExpr=r),(u||f.arrayInfo)&&(f.arrayInfo=u)):(f.workingExpr=e,f.arrayInfo=e),s.startListening(),o._controller.addDirtyCell(s))},n.prototype._setRowExpression=function(n,t,i){var r=this,u=r._getRowCalc(n,!0),e,f;u&&(u.stopListening(),e=r._sheet._getCalcModel(r._sheetArea),f=r._sheet._getCalcModel(r._sheetArea).getNode(n,-1,!0),f.expr=t,(i||f.workingExpr)&&(f.workingExpr=i),u.startListening(),r._controller.addDirtyRow(u))},n.prototype._setColumnExpression=function(n,t,i){var r=this,u=r._getColumnCalc(n,!0),e,f;u&&(u.stopListening(),e=r._sheet._getCalcModel(r._sheetArea),f=r._sheet._getCalcModel(r._sheetArea).getNode(-1,n,!0),f.expr=t,(i||f.workingExpr)&&(f.workingExpr=i),u.startListening(),r._controller.addDirtyRow(u))},n.prototype.onBeforeAddRemoveRows=function(n){var t=this,i=t.getRowCount(),r=t.getColumnCount();t.unlinkCellExpression(n,0,i-n,r);t.unlinkRowExpression(n,i-n);t._addDependentsToAdjust(n,-1,i-n,-1)},n.prototype.onAfterAddRows=function(n,t){var i=this,r=i.getRowCount(),u=i.getColumnCount();i._addCellsToDirty(n,0,t,u);i._addCellsToAdjust(n,0,r-n,u);i._addRowsToAdjust(n,r-n);i._controller.adjustFormulasOnAddRows(i,n,t);i._controller.autoCalculation&&i._controller.recalculate()},n.prototype.onAfterRemoveRows=function(n,t){var i=this,r=i.getRowCount(),u=i.getColumnCount();i._addCellsToAdjust(n,0,r-n,u);i._addRowsToAdjust(n,r-n);i._controller.adjustFormulasOnRemoveRows(i,n,t);i._controller.autoCalculation&&i._controller.recalculate()},n.prototype.onBeforeAddRemoveColumns=function(n){var t=this,r=t.getRowCount(),i=t.getColumnCount();t.unlinkCellExpression(0,n,r,i-n);t.unlinkColumnExpression(n,i-n);t._addDependentsToAdjust(-1,n,-1,i-n)},n.prototype.onAfterAddColumns=function(n,t){var i=this,r=i.getRowCount(),u=i.getColumnCount();i._addCellsToDirty(0,n,r,t);i._addCellsToAdjust(0,n,r,u-n);i._addColumnsToAdjust(n,u-n);i._controller.adjustFormulasOnAddColumns(i,n,t)},n.prototype.onAfterRemoveColumns=function(n,t){var i=this,u=i.getRowCount(),r=i.getColumnCount();i._addCellsToAdjust(0,n,u,r-n);i._addColumnsToAdjust(n,r-n);i._controller.adjustFormulasOnRemoveColumns(i,n,t);i._controller.autoCalculation&&i._controller.recalculate()},n.prototype._dealWithExpression=function(n,t,i,e,o){for(var rt=this,p,k,d,w,g,b,nt,st,ht,h,tt,it,l,a,v,y,s,ft,ct,lt,ut,at,ot;e instanceof u.ParenthesesExpression;)e=e.argument;while(e instanceof u.ExpandExpression)e=e.expr;if(e instanceof u.StructReferenceExpression){if(p=e.getRange(t,i),p===f)return;e=p.rowCount===1&&p.columnCount===1?new u.CellExpression(p.row,p.column,!1,!1):new u.RangeExpression(p.row,p.column,p.row+p.rowCount-1,p.column+p.columnCount-1,!1,!1,!1,!1)}if(e instanceof u.CellExpression||e instanceof u.ExternalCellExpression){if(y=e,v=e instanceof u.CellExpression?rt:e.source,0<=t&&0<=i){if(k=y.row+(y.rowRelative?t:0),d=y.column+(y.columnRelative?i:0),h=v._getCellCalc(k,d,!0),!h)return;h.processCellListener(n,o)}else if(0<=t&&i===-1)if(k=y.row+(y.rowRelative?t:0),d=y.column,y.columnRelative){if(tt=v._getRowCalc(k,!0),!tt)return;tt.processRowListener2(n,-d,o)}else{if(h=v._getCellCalc(k,d,!0),!h)return;h.processRowListener(n,o)}else if(t===-1&&0<=i)if(k=y.row,d=y.column+(y.columnRelative?i:0),y.rowRelative){if(it=v._getColumnCalc(d,!0),!it)return;it.processColumnListener2(n,-k,o)}else{if(h=v._getCellCalc(k,d,!0),!h)return;h.processColumnListener(n,o)}}else if(e instanceof u.RangeExpression||e instanceof u.ExternalRangeExpression)if(v=e instanceof u.RangeExpression?rt:e.source,s=e,ft=s._getRangeType(),ft===c.cell){if(0<=t&&0<=i)if(w=s.startRow+(s.startRowRelative?t:0),b=s.startColumn+(s.startColumnRelative?i:0),g=s.endRow+(s.endRowRelative?t:0),nt=s.endColumn+(s.endColumnRelative?i:0),st=et(g-w)+1,ht=et(nt-b)+1,pf(k,d,st,ht)){if(ct=v._getRangeCalc(!0),!ct)return;ct.processCellListener(w,b,st,ht,n,o)}else for(l=w;l<=g;l++)for(a=b;a<=nt;a++)h=v._getCellCalc(l,a,!0),h&&h.processCellListener(n,o);else if(0<=t&&i===-1)for(w=s.startRow+(s.startRowRelative?t:0),b=s.startColumn+(s.startColumnRelative?i:0),g=s.endRow+(s.endRowRelative?t:0),nt=s.endColumn+(s.endColumnRelative?i:0),l=w;l<=g;l++)for(a=b;a<=nt;a++)s.startColumnRelative||s.endColumnRelative?(tt=v._getRowCalc(l,!0),tt&&tt.processRowListener2(n,-a,o)):(h=v._getCellCalc(l,a,!0),h&&h.processRowListener(n,o));else if(t===-1&&0<=i)for(w=s.startRow+(s.startRowRelative?t:0),b=s.startColumn+(s.startColumnRelative?i:0),g=s.endRow+(s.endRowRelative?t:0),nt=s.endColumn+(s.endColumnRelative?i:0),l=w;l<=g;l++)for(a=b;a<=nt;a++)s.startRowRelative||s.endRowRelative?(it=v._getColumnCalc(a,!0),it&&it.processColumnListener2(n,-l,o)):(h=v._getCellCalc(l,a,!0),h&&h.processColumnListener(n,o))}else if(ft===c.row)if(0<=t&&0<=i)for(w=s.startRow+(s.startRowRelative?t:0),g=s.endRow+(s.endRowRelative?t:0),l=w;l<=g;l++)tt=v._getRowCalc(l,!0),tt&&tt.processCellListener(n,o);else 0<=t&&i===-1||t===-1&&0<=i;else if(ft===c.column)if(0<=t&&0<=i)for(b=s.startColumn+(s.startColumnRelative?i:0),nt=s.endColumn+(s.endColumnRelative?i:0),a=b;a<=nt;a++)it=v._getColumnCalc(a,!0),it&&it.processCellListener(n,o);else 0<=t&&i===-1||t===-1&&0<=i;else ft===c.sheet&&(0<=t&&0<=i||0<=t&&i===-1||t===-1&&0<=i);else if(e instanceof u.UnaryOperatorExpression)rt._dealWithExpression(n,t,i,e.operand,o);else if(e instanceof u.BinaryOperatorExpression)rt._dealWithExpression(n,t,i,e.left,o),rt._dealWithExpression(n,t,i,e.right,o);else if(e instanceof u.NameExpression||e instanceof u.ExternalNameExpression){if(v=e instanceof u.NameExpression?rt:e.source,lt=v._getNameCalc(e.name,!0),!lt)return;lt.processCellListener(n,o);rt._dealWithExpression(n,t,i,v.getName(e.name,t,i),o)}else if(e instanceof u.FunctionExpression){if(ut=e,ut.fn&&ut.fn instanceof r.Functions.Function&&!ut.fn.precedentReference())return;for(at=ut.argCount(),ot=0;ot<at;ot++)rt._dealWithExpression(n,t,i,ut.getArg(ot),o)}},n.prototype._dealWithCellExpression=function(n,t,i,r,u){for(var e,f,o=this,h=o._sheet._getCalcModel(o._sheetArea),c=n+i,l=t+r,s=n;s<c;s++)for(e=t;e<l;e++)f=h.getNode(s,e),f&&(f.workingExpr||f.expr)&&(f.arrayInfo?o._dealWithExpression(o._getCellCalc(s,e),f.arrayInfo.row,f.arrayInfo.col,f.workingExpr||f.expr,u):o._dealWithExpression(o._getCellCalc(s,e),s,e,f.workingExpr||f.expr,u))},n.prototype.linkCellExpression=function(n,t,i,r){this._dealWithCellExpression(n,t,i,r,!0)},n.prototype.unlinkCellExpression=function(n,t,i,r){this._dealWithCellExpression(n,t,i,r,!1)},n.prototype.linkRowExpression=function(n,t){},n.prototype.unlinkRowExpression=function(n,t){},n.prototype.linkColumnExpression=function(n,t){},n.prototype.unlinkColumnExpression=function(n,t){},n.prototype._addColumnsToDirty=function(n,t){for(var u,f,r=this,e=r._sheet._getCalcModel(r._sheetArea),i=n;i!==-1&&i<n+t;i++)(u=e.getNode(-1,i,!1),u&&(u.columnCalc||u.expr))&&(f=r._getColumnCalc(i,!0),r._controller.addDirtyColumn(f))},n.prototype._addRowsToDirty=function(n,t){for(var u,f,r=this,e=r._sheet._getCalcModel(r._sheetArea),i=n;i!==-1&&i<n+t;i++)(u=e.getNode(i,-1,!1),u&&(u.rowCalc||u.expr))&&(f=r._getRowCalc(i,!0),r._controller.addDirtyRow(f))},n.prototype._addCellsToDirty=function(n,t,i,r){for(var f,o,u=this,s=u._sheet._getCalcModel(u._sheetArea),h=n+i,c=t+r,e=n;e<h;e++)for(f=t;f<c;f++)s.containsNoe(e,f)&&(o=u._getCellCalc(e,f,!0),u._controller.addDirtyCell(o));u._addRowsToDirty(n,i);u._addColumnsToDirty(t,r)},n.prototype._addDependentsToAdjust=function(n,t,i,r){this._addDependents(n,t,i,r,!0,!1)},n.prototype._iterateEachCell=function(n,t,i,r,u,f,e){for(var o,s,c=t+r,l=i+u,h=t;h<c;h++)for(o=i;o<l;o++)s=this._getCellCalc(h,o,!1),s&&(f&&s.addListenersToAdjust(),e&&s.addListenersToDirty())},n.prototype._iterateEachRow=function(n,t,i,r,u){var f,e,o;if(n._rowDataArray)for(f=t;f!==-1&&f<t+i&&f<n._rowDataArray.length;f++)(e=n._rowDataArray[f],e&&e.rowCalc)&&(o=e.rowCalc,r&&o.addListenersToAdjust(),u&&o.addListenersToDirty())},n.prototype._iterateEachColumn=function(n,t,i,r,u){var f,e,o;if(n._columnDataArray)for(f=t;f!==-1&&f<t+i&&f<n._columnDataArray.length;f++)(e=n._columnDataArray[f],e&&e.columnCalc)&&(o=e.columnCalc,r&&o.addListenersToAdjust(),u&&o.addListenersToDirty())},n.prototype._addDependents=function(n,t,i,r,u,f){var e,o,s,h;(u||f)&&(e=this,o=e._sheet._getCalcModel(e._sheetArea),0<=n&&0<=t?(e._iterateEachCell(o,n,t,i,r,u,f),e._iterateEachRow(o,n,i,u,f),e._iterateEachColumn(o,t,r,u,f),e._rangeCalc&&(u&&e._rangeCalc.addListenersToAdjust(n,t,i,r),f&&e._rangeCalc.addListenersToDirty(n,t,i,r))):0<=n&&t===-1?(e._iterateEachCell(o,n,0,i,e.getColumnCount(),u,f),e._iterateEachRow(o,n,i,u,f),e._rangeCalc&&(u&&e._rangeCalc.addListenersToAdjust(n,t,i,r),f&&e._rangeCalc.addListenersToDirty(n,t,i,r))):n===-1&&0<=t?(e._iterateEachCell(o,0,t,e.getRowCount(),r,u,f),e._iterateEachColumn(o,t,r,u,f),e._rangeCalc&&(u&&e._rangeCalc.addListenersToAdjust(n,t,i,r),f&&e._rangeCalc.addListenersToDirty(n,t,i,r))):n===-1&&t===-1&&(s=e.getRowCount(),h=e.getColumnCount(),e._iterateEachCell(o,0,0,s,h,u,f),e._iterateEachRow(o,0,s,u,f),e._iterateEachColumn(o,0,h,u,f),e._rangeCalc&&(u&&e._rangeCalc.addListenersToAdjust(n,t,i,r),f&&e._rangeCalc.addListenersToDirty(n,t,i,r))))},n.prototype._addCellsToAdjust=function(n,t,i,r){for(var e,u,h,o=this,c=o._sheet._getCalcModel(o._sheetArea),l=n+i,a=t+r,s=n;s<l;s++)for(e=t;e<a;e++)(u=c.getNode(s,e,!1),u&&(u.cellCalc||u.expr))&&(u.cellCalc&&(u.cellCalc=f),h=o._getCellCalc(s,e,!0),o._controller.addAdjustCell(h))},n.prototype._addColumnsToAdjust=function(n,t){for(var u,f,i=this,e=i._sheet._getCalcModel(i._sheetArea),r=n;r!==-1&&r<n+t;r++)(u=e.getNode(-1,n),u&&(u.columnCalc||u.expr))&&(f=i._getColumnCalc(r,!0),i._controller.addAdjustColumn(f))},n.prototype._addRowsToAdjust=function(n,t){for(var u,f,i=this,e=i._sheet._getCalcModel(i._sheetArea),r=n;r!==-1&&r<n+t;r++)(u=e.getNode(n,-1),u&&(u.rowCalc||u.expr))&&(f=i._getRowCalc(r,!0),i._controller.addAdjustRow(f))},n.prototype._getCellCalc=function(n,t,i){var e=this,r=f,o,u;return n>=0&&t>=0&&(o=e._sheet._getCalcModel(e._sheetArea),u=o.getNode(n,t,i),u&&(r=u.cellCalc,!r&&i&&(u.cellCalc=r=new lr(e,n,t)))),r},n.prototype._getRowCalc=function(n,t){var u=this,i=f,e,r;return n>=0&&(e=u._sheet._getCalcModel(u._sheetArea),r=e.getNode(n,-1,t),r&&(i=r.rowCalc,!i&&t&&(r.rowCalc=i=new ar(u,n)))),i},n.prototype._getColumnCalc=function(n,t){var u=this,i=f,e,r;return n>=0&&(e=u._sheet._getCalcModel(u._sheetArea),r=e.getNode(-1,n,t),r&&(i=r.columnCalc,!i&&t&&(r.columnCalc=i=new vr(u,n)))),i},n.prototype._getRangeCalc=function(n){var t=this,i=t._sheet._getCalcModel(t._sheetArea);return!i._rangeCalc&&n&&(i._rangeCalc=new yf(t)),i._rangeCalc},n.prototype._getNameCalc=function(n,t){var u=this,r=f,i,e;return u._sheet.getCustomName(n)?(i=u._sheet._getCalcModel(u._sheetArea),i._names||(i._names={}),r=i._names[n],!r&&t&&(r=i._names[n]=new li(n))):(e=u._sheet.getCalcService(),e&&e._getNameCalc&&(r=e._getNameCalc(n,t)),r||(i=u._sheet._getCalcModel(u._sheetArea),i._names||(i._names={}),r=i._names[n],!r&&t&&(r=i._names[n]=new li(n)))),r},n.prototype.recalculateCell=function(n,t){var r=this,i=r.getEvaluateNode(n,t),l=i?i.workingExpr||i.expr:f,e,s,a,v,y,p,u,h,c,o;if(l){if(e=r._sheet.getValue(n,t),s=!1,i.arrayInfo&&(s=!0,a=i.arrayInfo.row,v=i.arrayInfo.col,y=i.arrayInfo.rowCount,p=i.arrayInfo.colCount),u=r._sheet.getCalcService().evaluateParsedFormula(r,l,n,t,s,!0,a,v,y,p),e===u)return;else if(e instanceof Date&&u instanceof Date&&e.valueOf()===u.valueOf())return;if(h=r._sheet._getModel(),!h)return;c=!1;o=r._sheet._bindingManager;o&&o._dataSource&&(c=o.setValue(n,t,u));(!c||r._sheet.checkingChanges)&&h.setValue(n,t,u)}},n.prototype.shareCalculations=function(n){var t=this,i;t._controller!==n._controller&&(t._controller.detachDataModel(t),t._controller._dataModels.length>0&&(i=t._controller._dataModels[0],i&&i.shareCalculations(n)),t._controller=n._controller,t._controller.attachDataModel(t))},n.prototype.unshareCalculations=function(){var n=this;n._addCellsToAdjust(0,0,n.getRowCount(),n.getColumnCount());n._addRowsToAdjust(0,n.getRowCount());n._addColumnsToAdjust(0,n.getColumnCount());n._addDependentsToAdjust(-1,-1,-1,-1);n._controller.adjustFormulasOnRemoveSheet(n);n._controller.autoCalculation&&n._controller.recalculate();n._controller.detachDataModel(n);n._controller=new ai;n._controller.attachDataModel(n)},n}();r._SheetSource=ff;ef=function(){function t(n){var t=this;t.context=n;t.parser=new v;t.evaluator=new fr;t.useR1C1=!1;t._suspended=0}return t.prototype.contextChanged=function(){this.cachedContexts=f},t.prototype._getExternalSource=function(t,i){var u=this,r,e,o;if(!u.context||t&&(!(u.context instanceof n.spread.Spread)||u.context.name!==t))return f;if(r=u.getSheetContexts(),r&&r.length>0)for(e=0;e<r.length;e++)if(o=r[e],oi(o.name,i))return o.target._getSheetSource();return f},t.prototype._getExternalSourceToken=function(n){return n._sheet._name},t.prototype._getTableByName=function(n){var t=this;if(t.context.getActiveSheet&&t.context._findTable)return t.context._findTable(n);else if(t.context.parent&&t.context._findTable)return t.context._findTable(n);else if(t.context.findTableByName)return t.context.findTableByName(n);return f},t.prototype._getTableByIndex=function(n,t){var i=this.context;return i.getActiveSheet&&(i=i.getActiveSheet()),i.findTable?i.findTable(n,t):void 0},t.prototype._getParserContext=function(n,t){var i=new bt(this.useR1C1,n,t,f),r=this;return i.getExternalSource=function(n,t){return r._getExternalSource(n,t)},i.getExternalSourceToken=function(n){return r._getExternalSourceToken(n)},i.getTableByName=function(n){return r._getTableByName(n)},i.getTableByIndex=function(n,t){return r._getTableByIndex(n,t)},i},t.prototype._getEvaluatorContext4Cell=function(n,t,i,r,u,f,e,o){return r?(u=typeof u===nt?t:u,f=typeof f===nt?i:f,new ii(n._getSheetSource(),r,u,f,e,o,t,i)):new ii(n._getSheetSource(),r,t,i)},t.prototype.getSheetContexts=function(){var n=this;return n.cachedContexts||n.createSheetContexts(),n.cachedContexts},t.prototype.createSheetContexts=function(){var n=this;n.context&&(n.cachedContexts=n.context._getCalcContexts())},t.prototype.parse=function(n,t,i){var r=this._getParserContext(t,i);return r.row=t,r.column=i,this.parser.parse(n,r)},t.prototype.unparse=function(n,t,i){var r=this._getParserContext(t,i);return r.row=t,r.column=i,this.parser.unparse(n,r)},t.prototype.evaluateParsedFormula=function(n,t,i,r,u,o,h,c,a,v){var ut=this._getEvaluatorContext4Cell(n._sheet,i,r,u,h,c,a,v),y=this.evaluator.evaluateExpression(t,ut,o),w,k,d,nt;if(u&&arguments.length<=5)return y===e||y===f?0:y;if(y instanceof b)if(w=y.getRowCount(0),k=y.getColumnCount(0),y.getRangeCount()<=0)return l;else if(y.getRangeCount()!==1)return s;else try{if(d=u?i-h:i-y.getRow(0),nt=u?r-c:r-y.getColumn(0),w===1&&k===1)y=y.getValue(0,0,0);else if(w===1&&k>1&&nt>=0&&nt<k)y=y.getValue(0,0,nt);else if(w>1&&k===1&&d>=0&&d<w)y=y.getValue(0,d,0);else if(u&&d<w&&nt<k)y=y.getValue(0,d,nt);else return u?g:s}catch(ft){return s}else if(y instanceof p)if(u){var rt=y,tt=rt.getRowCount(),it=rt.getColumnCount();if(tt!=1&&i-h>=tt||it!=1&&r-c>=it)return g;y=y.getValue(tt==1?0:i-h,it==1?0:r-c)}else y=y.getValueByIndex(0);return y===e||y===f?0:y},t.prototype.evaluate=function(n,t,i,r){var u=this;return u.evaluator.evaluateFormula(t,u._getParserContext(i,r),u._getEvaluatorContext4Cell(n._sheet,i,r,!1))},t.prototype.recalculate=function(n,t,i){var u=n.target,r;u&&(r=u._getSheetSource(),r&&(r._addCellsToDirty(t,i,1,1),this.IsSuspended()||r._controller.recalculate()))},t.prototype.recalculateAll=function(n){var u=this.getSheetContexts(),f,e,t,i,r;if(u){for(t=0;t<u.length;t++)i=u[t].target,i&&(r=i._getSheetSource(),r&&n!==!1&&(f=i.getColumnCount(),e=i.getRowCount(),r._addColumnsToDirty(0,f),r._addRowsToDirty(0,e),r._addCellsToDirty(0,0,e,f)));if(!this.IsSuspended())for(t=0;t<u.length;t++)i=u[t].target,i&&(r=i._getSheetSource(),r&&r._controller.recalculate(n===!1))}},t.prototype.ignoreDirty=function(){return this._ignoreDirty},t.prototype.suspend=function(n){this._suspended++;this._ignoreDirty=n?!0:n},t.prototype.resume=function(n){var t=this;t._suspended--;t._suspended<0&&(t._suspended=0);t.IsSuspended()||(t._ignoreDirty=!1,t.recalculateAll(n))},t.prototype.resumeWithoutCalc=function(){var n,t,i,r;if(this._suspended=0,n=this.getSheetContexts(),n)for(t=0;t<n.length;t++)i=n[t].target,i&&(r=i._getSheetSource(),r&&r._controller.clearDirties())},t.prototype.IsSuspended=function(){return this._suspended>0},t}();r.Service=ef;r.evaluateFormula=wf;r.evaluateExpression=bf;r.rangeToExpression=kf;r.rangeToFormula=df;r.formulaToRange=gf;r.rangesToFormula=ne,function(n){n[n.allAbsolute=0]="allAbsolute";n[n.startRowRelative=1]="startRowRelative";n[n.startColRelative=2]="startColRelative";n[n.endRowRelative=4]="endRowRelative";n[n.endColRelative=8]="endColRelative";n[n.rowRelative=5]="rowRelative";n[n.colRelative=10]="colRelative";n[n.allRelative=15]="allRelative"}(r.RangeReferenceRelative||(r.RangeReferenceRelative={}));te=r.RangeReferenceRelative})(i.Calc||(i.Calc={}));var r=i.Calc})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(t){(function(i){(function(r){function ai(n,i,u){var f,e;if(n===s||n===o)throw t.SR.Exp_InvalidFunctionName;if(n=n.toUpperCase(),r.Functions._builtInFunctions.hasOwnProperty(n))if(f=r.Functions._builtInFunctions[n],f){if(!u||!u.override)throw t.SR.Exp_OverrideNotAllowed;}else r.Functions._builtInFunctions[n]=new r.Functions.Function(n,0,255),f=r.Functions[n.toUpperCase()];else f=new r.Functions.Function(n,0,255),r.Functions._builtInFunctions[n]=f;if(i&&typeof i=="function"&&(f.evaluate=i),u)for(e in u)u.hasOwnProperty(e)&&e!=="override"&&(f[e]=u[e]);return f}function f(n){return!0}function wr(){return!1}function bt(n){return n!==0}function w(n){return n===1}function a(n){return n===2}function kt(n){return n===0||n===2}function dt(n){return n===0||n%2==1}function lt(n){return n===3}function it(){return!0}function rt(n){return n===1||n===2}function yi(){return!0}function gt(n){return n===0}function at(n,t,r){var o=i.Convert,u,f,e,s,h;if(o.isError(n))return r.value=n,!1;else if(o._isCalcReference(n)){for(u=0;u<n.getRangeCount();u++)for(f=0;f<n.getRowCount(u);f++)for(e=0;e<n.getColumnCount(u);e++)if(n instanceof i._SheetRangeReference){for(s=0;s<n.getSheetCount();s++)if((r.includeSubtotal||!n.isSubtotal(s,u,f,e))&&t(n.getValue(s,u,f,e),r)===!1)return!1}else if((r.includeSubtotal||!n.isSubtotal(u,f,e))&&t(n.getValue(u,f,e),r)===!1)return!1}else if(o._isCalcArray(n)){for(o._inArray=!0,h=0;h<n.length();h++)if(t(n.getValueByIndex(h),r)===!1)return!1;o._inArray=!1}else if(et.isArray(n))et.each(n,function(n,i){return t(i,r)});else if(t(n,r)===!1)return!1;return!0}function pi(){return 0}function br(n){var r=i.Convert,t;if(r.isError(n))return-1;t=!1;try{t=r.toBool(n)}catch(u){}return t?1:2}function ni(n){return n>0}function kr(n){return n===1}function ti(n){return n===1||n===2||n===3}function dr(n){return n===2}function gr(n){return n===0||n===2}function nu(n){return n===0||n===1}function tu(n){return n===0||n%2==1}function ii(n){return n===0}function ri(n){return n===0||n===1||n===2}function iu(n){return n%2==0}function ru(n){return n===3}function ui(n){return n!==3}function uu(n){return n===3||n===4}function fu(n){return n!==1}function eu(n){return n===3||n===4}function ou(n){return n>0}function su(n){return n===4}function hu(n){return n===4||n===5}function cu(n){return n===5}function lu(n){return n===6}function au(n){return n===8}function vu(n){return n===7}function yu(n){return n!==2}function pu(n){return n===5||n===6}function wu(n){return n===4||n===6||n===7}function bu(n){return n===3||n===4||n===5}function ku(n){return n>=1}function du(n){return n===2||n===3||n===4}function gu(n){return n===1||n===2||n===3}function nf(n){if(n===""||n===s||n===o)return n;for(var t in ut)ut.hasOwnProperty(t)&&(n=n.replace(ut[t],ut[t].source));return n=n.replace("~?","{113E2532-EAF5-444c-A5CB-3D7446971C4D}"),n=n.replace("~*","{E21523B3-0F1F-458f-B547-23D25713D0EC}"),n=n.replace("?","."),n=n.replace("*","((.|\\n)*)"),n=n.replace("{113E2532-EAF5-444c-A5CB-3D7446971C4D}","\\?"),n=n.replace("{E21523B3-0F1F-458f-B547-23D25713D0EC}","\\*"),n.toString()}function tf(n){var t,r=i.Convert;return isNaN(t=r.toDouble(n[0]))?u:r.toResult(l(t))}function rf(n){var t=parseFloat(n[0]);return t===s||t===o?u:r.Functions._MathHelper.approxFloor(t)}function uf(n){var o=i.Convert,f=o.toDouble(n[0]),t=o.toDouble(n[1]);return isNaN(f)||isNaN(t)?u:f===0||t===0?0:f>0&&t<0?e:f<0&&0<t?(t=-t,r.Functions._MathHelper.approxFloor(f/t)*t):r.Functions._MathHelper.approxCeiling(f/t)*t}function ff(n){var r=parseFloat(n[0]),t=parseFloat(n[1]),o,f;if(isNaN(r)||isNaN(t))return u;if(r<0||t<0||r<t)return e;for(o=1,t=st(r-t,t),f=1;f<=t;f++)o*=r-f+1,o/=f;return i.Convert.toResult(o)}function ef(n){var t;return isNaN(t=parseFloat(n[0]))?u:180*t/ct}function of(n){var t=parseFloat(n[0]);return t<0?(t=ht(t),t%2!=0&&(t-=1)):(t=pt(t),t%2!=0&&(t+=1)),t}function sf(n){var t=parseInt(n[0],10),r=1,i;if(isNaN(t))return u;if(t<0||170<t)return e;for(i=1;i<=t;i++)r*=i;return r}function hf(n){var t=parseInt(n[0],10),r=1,i;if(isNaN(t))return u;if(t<0||300<t)return e;for(i=t;i>1;i-=2)r*=i;return r}function cf(n){var t=parseFloat(n[0]);return t===s||t===o?u:t<=0?e:i.Convert.toResult(p(t))}function lf(n){var i=parseFloat(n[0]),t=parseFloat(n[1]);return t===0?"#DIV/0!":i-t*ht(i/t)}function af(n){var t=parseFloat(n[0]);return t<0?(t=ht(t),t%2==0&&(t-=1)):(t=pt(t),t%2==0&&(t+=1)),t}function vf(n){return ct}function yf(n){var t=parseFloat(n[0]),i=parseFloat(n[1]);return nt(t,i)}function bi(n,t){var r=i.Convert,f,u;return r.isError(n)?(t.value=n,!1):r._isCalcReference(n)||r._isCalcArray(n)||et.isArray(n)?at(n,bi,t):(f={value:0},r.tryToDouble(n,f)&&(u=f.value,!isNaN(u)&&isFinite(u)&&(t.value+=u)),!0)}function pf(n){var a,w,e,r,f,u,d,g,o,v,b,s,y,k,h,c,p,l;if(!n||n.length<1)throw t.SR.Exp_InvalidArgument;for(a=0,e=0;e<n.length;e++){if(r=n[e],u=i.Convert,u.isError(r))return r;else u._isCalcReference(r)?(d=r,f=d.getAllValue()):u._isCalcArray(r)?(u._inArray=!0,g=r,f=[g.getAllValue()]):f=et.isArray(r)?r:[[[r]]];for(w=f.length,o=0;o<w;o++)for(v=f[o],b=v.length,s=0;s<b;s++)for(y=v[s],k=y.length,h=0;h<k;h++)if(c=y[h],u.isError(c))return c;else p={value:0},u.tryToDouble(c,p)&&(l=p.value,!isNaN(l)&&isFinite(l)&&(a+=l));u._inArray=!1}return a}function wf(n){var t=parseFloat(n[0]);return t>0?1:t===0?0:-1}function fi(n,t){while(t!==0){var i=n%t;n=t;t=i}return n}function bf(n){for(var l,f,o,h,c,u=0,a=n.length,r=i.Convert,s=i._ArrayHelper,t=0;t<a;t++){if(r.isError(n[t]))return n[t];if(s.isArrayOrReference(n[t])){for(l=s.getLength(n[t]),f=0;f<l;f++)if(o=s.getValueByIndex(n[t],f),r.isError(o))return r._inArray=!1,o;else{if(h=r.toInt(o),h<0)return r._inArray=!1,e;u=fi(u,h)}r._inArray=!1}else{if(c=r.toInt(n[t]),c<0)return e;u=fi(u,c)}}return u}function kf(n){for(var s,h,c,u,f=1,o=[],r=i.Convert,l=i._ArrayHelper,t=0;t<n.length;t++){if(r.isError(n[t]))return n[t];if(l.isArrayOrReference(n[t])){for(s=0;s<l.getLength(n[t]);s++)if(h=l.getValueByIndex(n[t],s),r.isError(h))return r._inArray=!1,h;else o.push(r.toInt(h));r._inArray=!1}else o.push(r.toInt(n[t]));for(c=0;c<o.length;c++){if(u=o[c],u<0)return e;else if(u===0)return 0;f/=fi(f,u);f*=u}}return f}function ki(n,t){for(var p,h,a,v=1,y=0,f=i.Convert,c,l,e,o,s,r=0;r<n.length;r++){if(f.isError(n[r]))return n[r];if(f._isCalcArray(n[r])){for(f._inArray=!0,l=n[r].getColumnCount(),c=n[r].getRowCount(),o=0;o<l;o++)for(e=0;e<c;e++)if(s=n[r].getValue(e,o),f.isNumber(s))v*=f.toDouble(s),y++;else if(f.isError(s))return s;f._inArray=!1}else if(f._isCalcReference(n[r]))for(p=n[r].getRangeCount(),l=0,c=0,h=0;h<p;h++)for(l=n[r].getColumnCount(h),o=0;o<l;o++)for(c=n[r].getRowCount(h),e=0;e<c;e++){if(n[r]instanceof i._SheetRangeReference)for(a=0;a<n[r].getSheetCount();a++)(t||!n[r].isSubtotal(a,h,e,o))&&(s=n[r].getValue(a,h,e,o));else(t||!n[r].isSubtotal(h,e,o))&&(s=n[r].getValue(h,e,o));if(f.isNumber(s))v*=f.toDouble(s),y++;else if(f.isError(s))return s}else{if(isNaN(f.toDouble(n[r])))return u;v*=n[r];y++}}return f.toResult(y>0?v:0)}function df(n){return ki(n,!0)}function gf(n){var t=parseFloat(n[0]);return t>=0?d(t):e}function ne(n){var t=i.Convert,f,r;return t.isError(n[0])?n[0]:t.isError(n[1])?n[1]:(f=t.toDouble(n[0]),r=t.toDouble(n[1]),isNaN(f)||isNaN(r))?u:r===0?y:parseInt((f/r).toString(),10)}function te(n){for(var c,e,h,s,r=i.Convert.toInt(n[0]),f=[],o=1;o<n.length;o++)f[o-1]=n[o];if(c=i.Functions,e=c._StatHelper,r===1||r===101)return e.__averageIncludeSubtotals(f,!1);else if(r===2||r===102)return e.__countIncludeSubtotals(f,!1);else if(r===3||r===103)return e.__countaIncludeSubtotals(f,!1);else if(r===4||r===104)return e.__maxIncludeSubtotals(f,!1);else if(r===5||r===105)return e.__minIncludeSubtotals(f,!1);else if(r===6||r===106)return ki(f,!1);else if(r===7||r===107)return e.__stdevIncludeSubtotals(f,!1);else if(r===8||r===108)return e.__stdevpIncludeSubtotals(f,!1);else if(r===9||r===109){if(!f||f.length<1)throw t.SR.Exp_InvalidArgument;for(h={value:0,includeSubtotal:!1},s=0;s<f.length;s++)if(at(f[s],bi,h)===!1)break;return h.value}else if(r===10||r===110)return e.__varrIncludeSubtotals(f,!1);else if(r===11||r===111)return e.__varpIncludeSubtotals(f,!1);return u}function ie(n){var s=i.Convert,f=s.toDouble(n[0]),t=s.toDouble(n[1]),o;return isNaN(f)||isNaN(t)?u:f===0||t===0?0:f>0&&t<0?e:(o=r.Functions._MathHelper,f<0&&0<t)?(t=-t,o.approxCeiling(f/t)*t):o.approxFloor(f/t)*t}function re(n){var o=i.Convert,f=o.toDouble(n[0]),t=o.toDouble(n[1]);return isNaN(f)||isNaN(t)?u:f===0||t===0?0:f<0&&0<t||t<0&&0<f?e:r.Functions._MathHelper.approxFloor(f/t+.5)*t}function ei(n){var e=i.Convert,t=e.toDouble(n[0]);if(isNaN(t))return u;var o=e.toInt(n[1]),s=r.Functions._MathHelper,f=s.pow10(l(o));return o<0?t/=f:t*=f,t=t<0?s.approxCeiling(t-.5):s.approxFloor(t+.5),o<0?t*=f:t/=f,e.toResult(t)}function ue(n){var e=i.Convert,t=e.toDouble(n[0]);if(isNaN(t))return u;var o=e.toInt(n[1]),s=r.Functions._MathHelper,f=s.pow10(l(o));return o<0?t/=f:t*=f,t=t<0?s.approxCeiling(t):s.approxFloor(t),o<0?t*=f:t/=f,e.toResult(t)}function fe(n){var e=i.Convert,t=e.toDouble(n[0]);if(isNaN(t))return u;var o=e.toInt(n[1]),s=r.Functions._MathHelper,f=s.pow10(l(o));return o<0?t/=f:t*=f,t=t<0?s.approxFloor(t):s.approxCeiling(t),o<0?t*=f:t/=f,e.toResult(t)}function ee(n){var e=i.Convert,t=e.toDouble(n[0]);if(isNaN(t))return u;var o=i._Helper._argumentExists(n,1)?e.toInt(n[1]):0,s=r.Functions._MathHelper,f=s.pow10(l(o));return o<0?t/=f:t*=f,t=t<0?s.approxCeiling(t):s.approxFloor(t),o<0?t*=f:t/=f,e.toResult(t)}function oe(n){var t,r=i.Convert;return isNaN(t=r.toDouble(n[0]))?u:r.toResult(c(t))}function se(n){var r=i.Convert,f=r.toDouble(n[0]),t;if(isNaN(f))return u;if(i._Helper._argumentExists(n,1)){if(t=r.toDouble(n[1]),isNaN(t))return u}else t=10;return f<=0||t<=0?e:t===1?y:r.toResult(ft.log(f,t))}function he(n){var r=i.Convert,t=r.toDouble(n[0]);return isNaN(t)?u:t<=0?e:r.toResult(ft.log10(t))}function yt(n,t,f){var b=0,nt,tt,ut,ft,e,h,c,w,l;if(n===s||n===o)return b;var k=i.Convert,it=r.Functions._MathHelper.parseCriteria(n),a=t instanceof i.CalcArray,v=f instanceof i.CalcArray,d=t,y=t,g=f,p=f,rt=a?1:y.getRangeCount();if(rt!=(v?1:p.getRangeCount())||(nt=a?d.getRowCount():y.getRowCount(0),nt!=(v?g.getRowCount():p.getRowCount(0)))||(tt=a?d.getColumnCount():y.getColumnCount(0),tt!=(v?g.getColumnCount():p.getColumnCount(0))))return u;for(ut=a?[d.getAllValue()]:y.getAllValue(),ft=v?[g.getAllValue()]:p.getAllValue(),e=0;e<rt;e++)for(h=0;h<nt;h++)for(c=0;c<tt;c++){if(w=ut[e][h][c],w instanceof i.CalcError)return w;if(it&&it(w))if(l=ft[e][h][c],k.isNumber(l))b+=k.toDouble(l);else if(l instanceof i.CalcError)return l}return k.toResult(b)}function ce(n){var l=n[0],y=n[1],f,p,h,c;if(y===s||y===o)throw t.SR.Exp_CriteriaIsNull;var a=i._Helper._argumentExists(n,2)?n[2]:n[0],v=i.Convert,r=n[1],e,u;if(v._isCalcReference(r))return(e=r.getRowCount(0),u=r.getColumnCount(0),e===1&&u===1)?yt(r.getValue(0,0,0),l,a):new i._TernaryCompositeConcreteReference(r.getSource(),r.getRow(0),r.getColumn(0),e,u,yt,l,a);if(f=n[1],v._isCalcArray(f)){for(v._inArray=!0,e=f.getRowCount(),u=f.getColumnCount(),p=new i._ConcreteArray(f,u),h=0;h<e;h++)for(c=0;c<u;c++)p._array[h][c]=yt(f.getValue(h,c),l,a);return v._inArray=!1,p}return yt(y,l,a)}function le(n){var r,u,t;if(n.length<3||n.length%2!=1)return!1;for(r=i._ArrayHelper.getRowCount(n[0]),u=i._ArrayHelper.getColumnCount(n[0]),t=1;t<n.length;t=t+2)if(r!==i._ArrayHelper.getRowCount(n[t])||u!==i._ArrayHelper.getColumnCount(n[t]))return!1;return!0}function ae(n){var p,f,s,t,e;if(!le(n))return u;var a=0,w=n[0],o=i.Convert,h=i._ArrayHelper,b=h.getLength(n[0]),c=[],v=[];for(t=1;t<n.length;t=t+2){var y=n[t],k=n[t+1],l=r.Functions._MathHelper.parseCriteria(k);c.push(y);v.push(l)}for(p=c.length,f=0;f<b;f++){for(s=!0,t=0;t<p;t++){var y=c[t],l=v[t],d=h.getValueByIndex(y,f);if(s=l&&l(d),!s)break}if(s)if(e=h.getValueByIndex(w,f),o.isNumber(e))a+=o.toDouble(e);else if(o.isError(e))return e}return o.toResult(a)}function ve(n){for(var o,s,h,c,r,l=0,f=i.Convert,t=i._ArrayHelper,a=t.getRowCount(n[0]),v=t.getColumnCount(n[0]),e=1;e<n.length;e++)if(a!==t.getRowCount(n[e])||v!==t.getColumnCount(n[e]))return u;for(o=0;o<a;o++)for(s=0;s<v;s++){for(h=1,c=0;c<n.length;c++)if(r=t.getValue(n[c],o,s),f.isError(r))return r;else f.isNumber(r)?h*=f.toDouble(r):h=0;l+=h}return f.toResult(l)}function ye(n){for(var o,e,f,s=0,t=i.Convert,h=i._ArrayHelper,r=0;r<n.length;r++){if(t.isError(n[r]))return n[r];if(h.isArrayOrReference(n[r])){for(o=0;o<h.getLength(n[r]);o++)if(e=h.getValueByIndex(n[r],o),t.isNumber(e))f=t.toDouble(e),s+=f*f;else if(t.isError(e))return t._inArray=!1,e;t._inArray=!1}else{if(isNaN(f=t.toDouble(n[r])))return u;s+=f*f}}return t.toResult(s)}function pe(n){var l=0,r,f,t=i.Convert,e=i._ArrayHelper,o,s,c;if(e.getLength(n[0])!==e.getLength(n[1]))return h;if(t.isError(n[0]))return n[0];if(t.isError(n[1]))return n[1];if(e.isArrayOrReference(n[0])){for(o=0;o<e.getLength(n[0]);o++)if(s=e.getValueByIndex(n[0],o),c=e.getValueByIndex(n[1],o),t.isNumber(s)&&t.isNumber(c))r=t.toDouble(s),f=t.toDouble(c),l+=r*r-f*f;else if(t.isError(s))return t._inArray=!1,s;else if(t.isError(c))return t._inArray=!1,c;t._inArray=!1}else{if(isNaN(r=t.toDouble(n[0]))||isNaN(f=t.toDouble(n[1])))return u;l+=r*r-f*f}return l}function we(n){var l=0,r,f,t=i.Convert,e=i._ArrayHelper,o,s,c;if(e.getLength(n[0])!==e.getLength(n[1]))return h;if(t.isError(n[0]))return n[0];if(t.isError(n[1]))return n[1];if(e.isArrayOrReference(n[0])){for(o=0;o<e.getLength(n[0]);o++)if(s=e.getValueByIndex(n[0],o),c=e.getValueByIndex(n[1],o),t.isNumber(s)&&t.isNumber(c))r=t.toDouble(s),f=t.toDouble(c),l+=r*r+f*f;else if(t.isError(s))return t._inArray=!1,s;else if(t.isError(c))return t._inArray=!1,c;t._inArray=!1}else{if(isNaN(r=t.toDouble(n[0]))||isNaN(f=t.toDouble(n[1])))return u;l+=r*r+f*f}return t.toResult(l)}function be(n){var l=0,r,f,t=i.Convert,e=i._ArrayHelper,o,s,c;if(e.getLength(n[0])!==e.getLength(n[1]))return h;if(t.isError(n[0]))return n[0];if(t.isError(n[1]))return n[1];if(e.isArrayOrReference(n[0])){for(o=0;o<e.getLength(n[0]);o++)if(s=e.getValueByIndex(n[0],o),c=e.getValueByIndex(n[1],o),t.isNumber(s)&&t.isNumber(c))r=t.toDouble(s),f=t.toDouble(c),l+=(r-f)*(r-f);else if(t.isError(s))return t._inArray=!1,s;else if(t.isError(c))return t._inArray=!1,c;t._inArray=!1}else{if(isNaN(r=t.toDouble(n[0]))||isNaN(f=t.toDouble(n[1])))return u;l+=(r-f)*(r-f)}return t.toResult(l)}function ke(n){var o,s,h,t=i.Convert,c=i._ArrayHelper,f,e,r,l;if(isNaN(o=t.toDouble(n[0]))||isNaN(h=t.toInt(n[1]))||isNaN(s=t.toInt(n[2])))return u;for(f=n[3],e=0,r=0;r<c.getLength(f);r++){if(isNaN(l=t.toDouble(c.getValueByIndex(f,r))))return u;e+=l*nt(o,h+r*s)}return t.toResult(e)}function de(n){var t,r=i.Convert;return isNaN(t=r.toDouble(n[0]))?u:t<0?e:r.toResult(d(t*ct))}function ge(n){var t;return isNaN(t=i.Convert.toDouble(n[0]))?u:ct*t/180}function no(n){var t,r=i.Convert;return isNaN(t=r.toDouble(n[0]))?u:r.toResult(sr(t))}function to(n){var t,r=i.Convert;return isNaN(t=r.toDouble(n[0]))?u:t<-1||1<t?e:r.toResult(hr(t))}function io(n){var t,r=i.Convert;return isNaN(t=r.toDouble(n[0]))?u:r.toResult((c(t)+c(-t))/2)}function ro(n){var t,r=i.Convert;return isNaN(t=r.toDouble(n[0]))?u:t<1?e:r.toResult(p(t+d(t*t-1)))}function uo(n){var t,r=i.Convert;return isNaN(t=r.toDouble(n[0]))?u:r.toResult(er(t))}function fo(n){var t,r=i.Convert;return isNaN(t=r.toDouble(n[0]))?u:t<-1||1<t?e:r.toResult(or(t))}function eo(n){var t,r=i.Convert;return isNaN(t=r.toDouble(n[0]))?u:r.toResult((c(t)-c(-t))/2)}function oo(n){var t,r=i.Convert;return isNaN(t=r.toDouble(n[0]))?u:r.toResult(p(t+d(t*t+1)))}function so(n){var t,r=i.Convert;return isNaN(t=r.toDouble(n[0]))?u:r.toResult(cr(t))}function ho(n){var t,r=i.Convert;return isNaN(t=r.toDouble(n[0]))?u:r.toResult(lr(t))}function co(n){var t,r,f=i.Convert;return isNaN(t=f.toDouble(n[0]))||isNaN(r=f.toDouble(n[1]))?u:t===0&&r===0?y:f.toResult(ar(r,t))}function lo(n){var t,e=i.Convert,r,f;return isNaN(t=e.toDouble(n[0]))?u:(r=c(t),f=c(-t),e.toResult(r-f)/(r+f))}function ao(n){var t,r=i.Convert;return isNaN(t=r.toDouble(n[0]))?u:t<=-1||1<=t?e:r.toResult(p((1+t)/(1-t))/2)}function vo(n){var y=i.Convert,p=y._toArray(n[0]),f,r,o,c,l,w,t,b,s,e,k,h,d,a,v;if(p.getRowCount()!==p.getColumnCount())return u;for(f=p.getRowCount(),r=[],o=0;o<f;o++)for(r[o]=[f],c=0;c<f;c++){if(l=p.getValue(o,c),y.isError(l))return l;if(!y.isNumber(l))return u;r[o][c]=y.toDouble(l)}for(w=1,t=0;t<f-1;t++){if(r[t][t]===0){for(b=!1,s=t+1;!b&&s<f;s++)if(r[s][t]!==0){for(e=t;e<f;e++)k=r[t][e],r[t][e]=r[s][e],r[s][e]=k;w*=-1;b=!0}if(!b)return 0}for(h=t+1;h<f;h++)if(r[h][t]!==0)for(d=r[h][t]/r[t][t],a=t;a<f;a++)r[h][a]-=d*r[t][a]}for(v=0;v<f;v++)w*=r[v][v];return w}function yo(n){var g=i.Convert,nt=g._toArray(n[0]),a,p,w,v,b,t,tt,s,c,ut,l,ft,h,rt,k,d,y,et,it;if(nt.getRowCount()!==nt.getColumnCount())return u;var r=nt.getRowCount(),f=[],o=[];for(a=0;a<r;a++)for(f[a]=[r],p=0;p<r;p++){if(w=nt.getValue(a,p),g.isError(w))return w;if(!g.isNumber(w))return u;f[a][p]=g.toDouble(w)}for(v=0;v<r;v++)for(o[v]=[r],b=0;b<r;b++)o[v][b]=v===b?1:0;for(t=0;t<r;t++){if(f[t][t]===0){for(tt=!1,s=t+1;!tt&&s<r;s++)if(f[s][t]!==0){for(c=t;c<r;c++)ut=f[t][c],f[t][c]=f[s][c],f[s][c]=ut;for(l=1;l<r;l++)ft=o[t][l],o[t][l]=o[s][l],o[s][l]=ft;tt=!0}if(!tt)return e}for(h=0;h<r;h++)if(h!==t&&f[h][t]!==0){for(rt=f[h][t]/f[t][t],k=t;k<r;k++)f[h][k]-=rt*f[t][k];for(d=0;d<r;d++)o[h][d]-=rt*o[t][d]}}for(y=0;y<r;y++)for(et=f[y][y],it=0;it<r;it++)o[y][it]/=et;return new i._ConcreteArray(o)}function po(n){var t=i.Convert,y=t._toArray(n[0]),p=t._toArray(n[1]),tt=y.getRowCount(),w=y.getColumnCount(),b=p.getRowCount(),v=p.getColumnCount(),r,o,s,f,h,c,e,l,nt,a;if(w!==b)return u;var k=[],d=[],g=[];for(r=0;r<tt;r++)for(k[r]=[w],o=0;o<w;o++){if(s=y.getValue(r,o),t.isError(s))return s;if(!t.isNumber(s))return u;k[r][o]=t.toDouble(s)}for(f=0;f<b;f++)for(d[f]=[v],h=0;h<v;h++){if(c=p.getValue(f,h),t.isError(c))return c;if(!t.isNumber(c))return u;d[f][h]=t.toDouble(c)}for(e=0;e<tt;e++)for(g[e]=[v],l=0;l<v;l++){for(nt=0,a=0;a<b;a++)nt+=k[e][a]*d[a][l];g[e][l]=nt}return new i._ConcreteArray(g)}function oi(n){for(var i=1,t=n;t>1;t--)i*=t;return i}function wo(n){for(var s,h,f,o,u=0,c=1,r=i.Convert,l=i._ArrayHelper,t=0;t<n.length;t++){if(r.isError(n[t]))return n[t];if(l.isArrayOrReference(n[t])){for(s=0;s<l.getLength(n[t]);s++)if(h=l.getValueByIndex(n[t],s),r.isError(h))return r._inArray=!1,h;else{if(f=r.toInt(h),f<0||170<f)return r._inArray=!1,e;u+=f;c*=oi(f)}r._inArray=!1}else{if(o=r.toInt(n[t]),o<0||170<o)return e;u+=o;c*=oi(o)}}return u<0||170<u?e:oi(u)/c}function bo(n){var t=li(),i=-1+t*2;return l(i)}function ko(n){var t=i.Convert,r,f,o;return t.isError(n[1])?n[1]:t.isError(n[0])?n[0]:isNaN(r=t.toInt(n[0]))||isNaN(f=t.toInt(n[1]))?u:f<r?e:(o=li(),t.toInt(r+o*(f-r+1)))}function go(){var n=[];return n.push(new b("M",1e3)),n.push(new b("D",500)),n.push(new b("C",100)),n.push(new b("L",50)),n.push(new b("X",10)),n.push(new b("V",5)),n.push(new b("I",1)),n}function ns(n){var c=i.Convert,p=i._Helper,f,o,e,t,r,s,l,v,h,a,y;if(c.isError(n[0]))return n[0];if(f=c.toInt(n[0]),o=0,p._argumentExists(n,1)){if(c.isError(n[1]))return n[1];o=typeof n[1]=="boolean"?n[1]?0:4:c.toInt(n[1])}if(e=[],f<0||3999<f||o<0||4<o)return u;for(t=go(),r=0;r<t.length;r+=2){if(2<=r&&t[r-2].Value-t[r].Value<=f){for(s=r,l=r-2,v=0;v<o&&s+1<t.length&&t[l].Value-t[s+1].Value<=f;v++)s++;e.push(t[s].Key);e.push(t[l].Key);f+=t[s].Value;f-=t[l].Value}if(1<=r&&t[r-1].Value<=f&&(e.push(t[r-1].Key),f-=t[r-1].Value),1<=r&&t[r-1].Value-t[r].Value<=f){for(h=r,a=r-1,y=0;y<o&&h+1<t.length&&t[a].Value-t[h+1].Value<=f;y++)h++;e.push(t[h].Key);e.push(t[a].Key);f+=t[h].Value;f-=t[a].Value}while(t[r].Value<=f)e.push(t[r].Key),f-=t[r].Value}return e.join("")}function ts(n){for(var e,t,r,l,h=!0,a=i.Convert,c=i._ArrayHelper,f=0;f<n.length;f++)for(e=n[f],t=0;t<c.getLength(e);t++)if(r=c.getValueByIndex(e,t),r!==s&&r!==o){try{l=a.toBool(r)}catch(v){return u}h&=l}else return!1;return!!h}function is(n){for(var e,t,r,l,h=!1,a=i.Convert,c=i._ArrayHelper,f=0;f<n.length;f++)for(e=n[f],t=0;t<c.getLength(e);t++)if(r=c.getValueByIndex(e,t),r!==s&&r!==o){try{l=a.toBool(r)}catch(v){return u}h|=l}return!!h}function si(n){try{var t=i.Convert.toBool(n);return!t}catch(r){return u}}function rs(n){var f=i.Convert,t,r;if(f._isCalcReference(n[0]))return n[0].getRangeCount()>1?u:new i._UnaryCompositeConcreteReference(n[0].getSource(),n[0].getRow(0),n[0].getColumn(0),n[0].getRowCount(0),n[0].getColumnCount(0),si);if(f._isCalcArray(n[0])){f._inArray=!0;var e=[],s=n[0].getRowCount(),o=n[0].getColumnCount();for(t=0;t<s;t++)for(e[t]=[o],r=0;r<o;r++)e[t][r]=si(n[0].getValue(t,r));return f._inArray=!1,new i._ConcreteArray(e)}return si(n[0])}function di(n,t,r){try{var f=i.Convert.toBool(n);return f?t:r}catch(e){return u}}function us(n){var f=n[0],o=n[1],e=i._Helper,s=e._argumentExists(n,2)?n[2]:n.length===2?!1:0,t=e.tryExtractToSingleValue(f),c,r,u;if(t.success)return f=t.value,di(f,o,s);t=e.tryExtractToSingleValue(o);o=t.value;c=t.success;t=e.tryExtractToSingleValue(s);s=t.value;var a=t.success,v=f.getRowCount(),l=f.getColumnCount(),h=[];for(r=0;r<v;r++)for(h[r]=[l],u=0;u<l;u++)h[r][u]=di(f.getValue(r,u),c?o:e.getArrayValue(o,r,u),a?s:e.getArrayValue(s,r,u));return new i._ConcreteArray(h)}function fs(n,t){return i.Convert.isError(n)?t!==s&&t!==o?t:0:n!==s&&n!==o?n:0}function es(n){var r=i.Convert,f=r.isError(n[0]),t;return!f&&r._isCalcReference(n[0])?(t=n[0],t.getRangeCount()>1)?u:new i._BinaryCompositeConcreteReference(t.getSource(),t.getRow(0),t.getColumn(0),t.getRowCount(0),t.getColumnCount(0),fs,n[1]):f?n[1]!==s&&n[1]!==o?n[1]:0:n[0]!==s&&n[0]!==o?n[0]:0}function os(n){return!0}function ss(n){return!1}function hs(n){var r,t,o,s,f;try{return(r=i.Convert,isNaN(t=r.toInt(n[0]))||isNaN(o=r.toInt(n[1]))||isNaN(s=r.toInt(n[2])))?u:t<0||9999<t?e:(t<=1899&&(t+=1900),f=new Date(t,o-1,s),f<new Date(1899,11,30))?e:f}catch(h){return e}}function cs(t){var o,s,h,f,r;try{return(f=i.Convert,isNaN(o=f.toInt(t[0]))||isNaN(s=f.toInt(t[1]))||isNaN(h=f.toInt(t[2])))?u:(r=n.spread._DateTimeHelper.fromOADate(0),r.setHours(o),r.setMinutes(s),r.setSeconds(h),r.setMilliseconds(0),r.getHours()<0&&r.getMinutes()<0&&r.getSeconds()<0)?e:r}catch(c){return e}}function g(n){return n%400==0||n%4==0&&n%100!=0||n===1900}function ls(t){var f=i.Convert.toString(t[0]),e,h,c,l;if(f===s||f===o||f==="")return u;try{if(e=n.spread._DateTimeHelper.parseLocale(f),h=e.getFullYear(),h<1900)return u;var a=e.getMonth(),v=e.getDate(),r=0;for(c=1900;c<h;c++)r+=g(c)?366:365;for(l=0;l<a;l++)switch(l){case 0:case 2:case 4:case 6:case 7:case 9:case 11:r+=31;break;case 1:r+=g(h)?29:28;break;case 3:case 5:case 8:case 10:r+=30;break}return r+v}catch(y){return u}}function as(t){try{return n.spread._DateTimeHelper.parseLocale(t)}catch(i){return u}}function gi(n){var t=i.Convert.toString(n[0]);if(t===s||t===o||t==="")return u;try{var r=as(t),f=(r.getHours()*60+r.getMinutes())*60+r.getSeconds(),e=86400;return f/e}catch(h){return u}}function vs(n){return new Date}function ys(n){var t=new Date;return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t}function ps(n){try{var t=i.Convert.toDateTime(n[0]);return t.getHours()}catch(r){return u}}function ws(n){try{var t=i.Convert.toDateTime(n[0]);return t.getMinutes()}catch(r){return u}}function bs(n){try{var t=i.Convert.toDateTime(n[0]);return t.getSeconds()}catch(r){return u}}function ks(n){try{var t=i.Convert.toDateTime(n[0]);return t.getDate()}catch(r){return u}}function ds(n){try{var t=i.Convert.toDateTime(n[0]);return t.getMonth()+1}catch(r){return u}}function gs(n){try{var t=i.Convert.toDateTime(n[0]);return t.getFullYear()}catch(r){return u}}function nh(n){for(var r=n.getFullYear(),u=n.getMonth(),f=n.getDate(),t=0,i=0;i<u;i++)switch(i){case 0:case 2:case 4:case 6:case 7:case 9:case 11:t+=31;break;case 1:t+=g(r)?29:28;break;case 3:case 5:case 8:case 10:t+=30;break}return t+f}function th(n,t){var f=nh(n),u=new Date(n.getFullYear(),0,1).getDay(),r;return t===2&&(u-=1,u<0&&(u=6)),r=f-1-(6-u),r<0&&(r=0),1+i.Convert.toInt(r/7)+(r%7!=0?1:0)}function ih(n){var r,f=i.Convert,t,s;try{r=f.toDateTime(n[0])}catch(o){return u}if(isNaN(t=f.toInt(i._Helper._argumentExists(n,1)?n[1]:1)))return u;switch(t){case 1:case 2:return th(r,t);default:return e}}function hi(n){var t,f,r;try{t=i.Convert.toDateTime(n[0])}catch(o){return u}if(isNaN(f=i.Convert.toInt(i._Helper._argumentExists(n,1)?n[1]:1)))return u;switch(f){case 1:r=t.getDay()+1;break;case 2:r=t.getDay()===0?7:t.getDay();break;case 3:r=t.getDay()===0?6:t.getDay()-1;break;default:return e}return r}function rh(n){var t,r,f=i.Convert;try{t=f.toDateTime(n[0])}catch(e){return u}return isNaN(r=f.toInt(n[1]))?u:(t.setMonth(t.getMonth()+r),t)}function uh(n,t){switch(t){case 0:case 2:case 4:case 6:case 7:case 9:case 11:return 31;case 1:return g(n)?29:28;case 3:case 5:case 8:case 10:return 30}}function fh(n){var t,r,f=i.Convert,e;try{t=f.toDateTime(n[0])}catch(o){return u}return isNaN(r=f.toInt(n[1]))?u:(t.setMonth(t.getMonth()+r),e=uh(t.getFullYear(),t.getMonth()),t.setDate(e),t)}function nr(n,t){return n-t}function ci(n,t){for(var r,u=n.length,i=0;i<u;i++)if(r=n[i],nr(r,t)===0)return!0;return!1}function eh(t){for(var s,h,r,o=i.Convert,v=i._Helper,a=i._ArrayHelper,u=o.toDateTime(t[0]),f=o.toInt(t[1]),y=v._argumentExists(t,2)?a.getLength(t[2]):0,c=[],l=0;l<y;l++)c.push(o.toDateTime(a.getValueByIndex(t[2],l)));if(s=[],s[0]=u,s[1]=3,h=hi(s),o.isError(h))return h;for(r=o.toInt(h);f<0;++f){try{u.setDate(u.getDate()-1)}catch(p){return e}r===0?r=6:r--;r===5||r===6?f--:ci(c,u)&&f--}for(;f>0;--f){try{u.setDate(u.getDate()+1)}catch(w){return e}r===6?r=0:r++;r===5||r===6?f++:ci(c,u)&&f++}return new n.spread._DateTimeHelper(u).toOADate()}function tr(n){var f=i.Convert,h=i._Helper,e=f.toDateTime(n[0]),o=f.toDateTime(n[1]),c=h._argumentExists(n,2)?f.toBool(n[2]):!1,t=e.getDate(),r=o.getDate(),l=e.getMonth(),u=o.getMonth(),a=e.getFullYear(),s=o.getFullYear();return c?(r=r===31?30:r,t=t===31?30:t):(t=t===31?30:t,r===31&&(t<30?(r=1,u++,u>12&&(u=1,s++)):r=30)),((s-a)*12+(u-l))*30+(r-t)}function oh(n){return n.getDay()===6||n.getDay()===0}function sh(t,r,u,f){for(var e,h,l=i.Convert,a=i._Helper,c=i._ArrayHelper,v=a._argumentExists(t,2)?c.getLength(t[2]):0,o=[],s=0;s<v;s++)e=l.toDateTime(c.getValueByIndex(t[2],s)),h=new n.spread._DateTimeHelper(e).toOADate(),!ci(o,e)&&!oh(e)&&h>=r&&h<=u&&o.push(e);return f-o.length}function hh(t,r,u){var e=i.Convert,s=n.spread._DateTimeHelper,f=e.toInt(new s(r).toOADate()-new s(t).toOADate())%7,h=e.toInt(hi([t,2])+f),o,c;return f=h>5?h-5:0,o=t.getDay()===0?1:2,f=f>o?o:f,u-=f,c=e.toInt(u/7*2),u-c}function ch(t){var e=i.Convert,h=n.spread._DateTimeHelper,o=e.toDateTime(t[0]),s=e.toDateTime(t[1]),u=e.toInt(new h(o).toOADate()),f=e.toInt(new h(s).toOADate()),c=!1,l,a,r;return(u>f&&(l=o,a=u,u=f,f=a,o=s,s=l,c=!0),r=f-u+1,r=hh(o,s,r),r<=0)?0:(r=sh(t,u,f,r),c?-r:r)}function lh(t,r,u){var k=i.Functions,y=k._FinancialHelper,h=i.Convert,s=y.__days_between_basis(t,r,u),c,p,e,o,f,w,l,a,v,b;return s<0&&(s=-s,p=t,t=r,r=p),u===1?(e=t.getFullYear(),o=r.getFullYear(),f=t,f.setFullYear(f.getFullYear()+1),nr(r,f)>0?(a=o+1-e,f=new Date(e,0,1),w=new Date(o+1,0,1),v=n.spread._DateTimeHelper,l=h.toInt(new v(w).toOADate()-new v(f).toOADate())-365*(o+1-e)):(a=1,l=g(e)&&t.getMonth()<3||g(o)&&r.getMonth()*256+r.getDate()>=541?1:0),b=h.toDouble(l)/h.toDouble(a),c=365+b):c=y.__annual_year_basis(new Date,u),s/c}function ir(n){var t=i.Convert,u=i._Helper,f=t.toDateTime(n[0]),o=t.toDateTime(n[1]),r=u._argumentExists(n,2)?t.toInt(n[2]):0;return r<0||r>4?e:lh(f,o,r)}function ah(){var n=[];return n[0]=function(n,t){return t.getFullYear()-n.getFullYear()+(t.getMonth()<n.getMonth()||t.getMonth()===n.getMonth()&&t.getDate()<n.getDate()?-1:0)},n[1]=function(n,t){return 12*(t.getFullYear()-n.getFullYear())+(t.getMonth()-n.getMonth())+(t.getDate()<n.getDate()?-1:0)},n[2]=function(n,t){return(t.getTime()-n.getTime())/864e5},n[3]=function(n,t){var i=new Date(t.getFullYear(),t.getMonth()+t.getDate()<n.getDate()?-1:0,n.getDate());return(t.getTime()-i.getTime())/864e5},n[4]=function(n,t){return t.getMonth()-n.getMonth()+(t.getMonth()<n.getMonth()||t.getMonth()===n.getMonth()&&t.getDate()<n.getDate()?12:0)+(t.getDate()<n.getDate()?-1:0)},n[5]=function(n,t){var i=new Date(t.getFullYear()+(t.getMonth()<n.getMonth()||t.getMonth()===n.getMonth()&&t.getDate()<n.getDate()?-1:0),n.getMonth(),n.getDate());return(t-i)/864e5},n}function vh(n,i){var r;switch(i){case"Y":r=0;break;case"M":r=1;break;case"D":r=2;break;case"MD":r=3;break;case"YM":r=4;break;case"YD":r=5;break;default:throw t.SR.Exp_NotSupport;}return n[r]}function yh(n){var t=i.Convert,f=t.toDateTime(n[0]),o=t.toDateTime(n[1]),h=t.toString(n[2]).toLocaleUpperCase(),s,r;if(o<f)return e;if(s=ah(),r=vh(s,h),r)try{return r(f,o)}catch(c){return u}return e}function ph(n){return 0<=n&&n<=31||127===n||128<=n&&n<=159}function wh(n){for(var r=i.Convert.toString(n[0]),u=[],t=0;t<r.length;t++)ph(r.charCodeAt(t))||u.push(r[t]);return u.join("")}function rr(n){return n===" "||n==="\t"||n==="\n"}function bh(n){for(var t,u=i.Convert.toString(n[0]).trim(),f=[],e=!0,r=0;r<u.length;r++)t=u.charAt(r),(!rr(t)||e)&&f.push(t),e=!rr(t);return f.join("")}function ur(n){var i=n.toString(),e="",f,t,r;if(n<0&&(i=i.substr(1),e="-"),f=i.split("."),f.length<1||f.length>2)return u;for(t=[],f.length===2&&(t.push(f[1]),t.push(".")),i=f[0],r=i.length-3;r>=0;r=r-3)t.push(i.substr(r,3)),r>0&&t.push(",");return t.push(i.substring(0,r+3)),t.reverse(),e+t.join("")}function kh(n){var i=ur(n),t;return n<0&&(i=i.substr(1)),t=[],t.push("$"),t.push(i),n<0&&(t.push(")"),t.unshift("(")),t.join("")}function dh(n){var t,r=i.Convert,e=i._Helper,f;return isNaN(t=r.toDouble(n[0]))?u:(f=e._argumentExists(n,1)?r.toInt(n[1]):2,f>99)?u:(t=r.toDouble(ei([t,f])),kh(t))}function gh(n){var t,r=i.Convert,s=i._Helper;if(isNaN(t=r.toDouble(n[0])))return u;var e=s._argumentExists(n,1)?r.toInt(n[1]):2,h=s._argumentExists(n,2)?r.toBool(n[2]):!1,f=[],o=0;return e<0?(o=r.toInt(nt(10,l(e))),t/=o,f[0]=t,f[1]=0):(f[0]=t,f[1]=e),t=r.toDouble(ei(f)),e<0&&(t*=o),h?t.toString():ur(t)}function nc(n){var t,i,r,u;if(n.indexOf("[")!==-1&&n.indexOf("]")!==-1)for(t=n.indexOf("["),i=n.indexOf("]",t);t!==-1&&i!==-1;)r=n.substring(0,t-1),u=n.substring(i+1),n=r.concat(u),t=n.indexOf("["),i=t===-1?-1:n.indexOf("]",t);return n}function tc(n){var f=n[0],h=i.Convert,c=t._StandardDateTimeFormatter,l=t._StandardNumberFormatter,r=i.Convert.toString(n[1]),e;if(r===""||r===o||r===s)return h.toString(f);(f===o||f===s)&&(f=0);r=nc(r);try{return e=new t.GeneralFormatter(r),e.Format(f)}catch(a){return u}}function ic(t){var e=i.Convert,h=n.spread._DateTimeHelper,c=e.toString(t[0]),r=h.parseLocale(c),f,l;return r!==s&&r!==o?(f=new h(r).toOADate(),e.isError(f)?gi([r]):f):isNaN(l=parseFloat(c))?u:l}function rc(n){var t=i.Convert.toString(n[0]);return t.toLowerCase()}function uc(n){var t=i.Convert.toString(n[0]);return t.toUpperCase()}function fc(n){var t=i.Convert.toInt(n[0]);return t<1||255<t?u:String.fromCharCode(t)}function ec(n){var t=i.Convert.toString(n[0]);if(t===""||t===s||t===o)return u;try{return t[0].charCodeAt(0)}catch(r){return u}}function oc(n){var r=i.Convert,f=r.toString(n[0]),t=r.toInt(n[1]),e=r.toInt(n[2]),h=r.toString(n[3]),o,s;return t<1||e<0?u:(t=st(t,f.length+1),e=st(e,f.length-t+1),o=f.substring(0,t-1),s=f.substr(t-1+e),o.concat(h).concat(s))}function sc(n){var e=i.Convert,f=e.toString(n[0]),t=e.toString(n[1]),a=e.toString(n[2]),h,c,r,l,v,y;if(t===""||t===s||t===o)return f;if(n.length>3){if(c=e.toInt(n[3]),r=0,c<1)return u;for(l=0;l<c;l++){if(r=f.indexOf(t,r),r===-1)return f;r+=t.length}r-=t.length;v=f.substring(0,r);y=f.substr(r+t.length);h=v.concat(a).concat(y)}else h=f.replace(t,a);return h}function hc(n){for(var h,r,u,f=[],c=n.length,l=i.Convert,e=i._ArrayHelper,t=0;t<c;t++)for(h=e.getLength(n[t]),r=0;r<h;r++)u=e.getValueByIndex(n[t],r),u!==s&&u!==o&&f.push(l.toString(u));return f.join("")}function cc(n){var f=i.Convert,e=i._Helper,t=f.toString(n[0]),r=e._argumentExists(n,1)?f.toInt(n[1]):1;return r<0?u:r>=t.length?t:t.substr(0,r)}function lc(n){var f=i.Convert,r=f.toString(n[0]),t=f.toInt(n[1])-1,e=f.toInt(n[2]);return t<0||e<0?u:t>=r.length?"":r.length<t+e?r.substr(t):r.substr(t,e)}function ac(n){var f=i.Convert,e=i._Helper,t=f.toString(n[0]),r=e._argumentExists(n,1)?f.toInt(n[1]):1;return r<0?u:t.length<r?t:t.substr(t.length-r,r)}function vc(n){var e=i.Convert,o=e.toString(n[0]),t=e.toInt(n[1]),r,f;if(t<0||32767<t*o.length)return u;for(r=[],f=0;f<t;f++)r.push(o);return r.join("")}function yc(n){return i.Convert.toString(n[0]).length}function pc(n){var t=i.Convert,o=i._Helper,s=t.toString(n[0]),e=t.toString(n[1]),r=o._argumentExists(n,2)?t.toInt(n[2]):1,f;return r<1||e.length<r?u:(f=e.indexOf(s,r-1),f===-1)?u:f+1}function wc(n){var f=i.Convert,l=i._Helper,r=f.toString(n[0]),c=f.toString(n[1]),e=l._argumentExists(n,2)?f.toInt(n[2]):1,t;if(e--,e<0)return u;t=-1;try{if(r.indexOf("*")===-1&&r.indexOf("?")===-1)t=c.toLowerCase().indexOf(r.toLowerCase(),e);else{var a=nf(r).toLowerCase(),v=new RegExp(a,"i"),h=v.exec(c);t=h!==s&&h!==o?h.index:-1}}catch(y){}return t===-1?u:t+1}function bc(n){var t=i.Convert,r=t.toString(n[0]),u=t.toString(n[1]);return r===u}function kc(n){var t=n[0];return typeof t=="string"?t:""}function dc(n,t){if(i.Convert.isError(n))t.value=!0;else if(typeof n===tt){var r=i.Error._parseCore(n);t.value=r!==s&&r!==o}t.value=!1}function gc(n,t){if(i.Convert.isError(n)&&n._code!==h._code)t.value=!0;else if(typeof n===tt){var r=i.Error._parseCore(n);t.value=r!==s&&r!==o&&r!==h}t.value=!1}function v(n){if(n===s||n===o)throw t.SR.Exp_InvalidArgument;else if(n.length<1||n.length>1)throw t.SR.Exp_InvalidArgument;}function nl(n){v(n);var t={value:!1};return i.Convert.isError(n[0])?t.value=!0:at(n[0],dc,t),t.value}function tl(n){v(n);var r=i.Convert,t={value:!1};return r.isError(n[0])&&n[0]._code!==h._code?t.value=!0:r.isError(n[0])&&n[0]._code===h._code?t.value=!1:at(n[0],gc,t),t.value}function il(n){return(v(n),i.Convert.isError(n[0]))?n[0]._code===h._code:!1}function rl(n){v(n);var t=n[0];if(t!==s&&t!==o&&i.Convert.isError(t))switch(t._code){case vr._code:return 1;case y._code:return 2;case u._code:return 3;case yr._code:return 4;case pr._code:return 5;case e._code:return 6;case h._code:return 7;default:break}return h}function ul(n){return v(n),i.Convert.isNumber(n[0])}function fl(n){v(n);var t;return isNaN(t=i.Convert.toDouble(n[0]))?u:r.Functions._MathHelper.approxFloor(l(t))%2==0}function el(n){v(n);var t;return isNaN(t=i.Convert.toDouble(n[0]))?u:r.Functions._MathHelper.approxFloor(l(t))%2!=0}function ol(n){v(n);var t=n[0],r=i.Convert;if(r.isNumber(t))return r.toDouble(t);else if(typeof t===wt)return t?1:0;else if(r.isError(t))return t;return 0}function sl(n){return v(n),n[0]===s||n[0]===o}function hl(n){return v(n),typeof n[0]===wt}function cl(n){return v(n),typeof n[0]===tt}function ll(n){return v(n),typeof n[0]!==tt}function al(n){return v(n),i.Convert._isCalcReference(n[0])}function vl(n){v(n);var t=n[0],r=i.Convert;return r.isNumber(t)?1:typeof t===tt?2:typeof t===wt?4:r.isError(t)?16:r._isCalcArray(t)?64:u}function yl(n){return h}function pl(n){var l=i.Convert,ft=i._Helper,a=l._toArray(n[0]),s=new i.CalcArray,b,et,t,r,y,f,o,p,c,k,w,d,v,tt,e,rt,ut;for(s=ft._argumentExists(n,1)?l._toArray(n[1]):a,b=ft._argumentExists(n,2)?l._toArray(n[2]):s,et=ft._argumentExists(n,3)?l.toBool(n[3]):!0,t=0;t<a.getRowCount();t++)for(r=0;r<a.getColumnCount();r++)if(!l.isNumber(a.getValue(t,r)))return u;for(t=0;t<s.getRowCount();t++)for(r=0;r<s.getColumnCount();r++)if(!l.isNumber(s.getValue(t,r)))return u;for(t=0;t<b.getRowCount();t++)for(r=0;r<b.getColumnCount();r++)if(!l.isNumber(b.getValue(t,r)))return u;if(a.getRowCount()===s.getRowCount()&&a.getColumnCount()===s.getColumnCount()){p=s.getRowCount()*s.getColumnCount();var g=0,nt=0,ot=0,it=0,st;for(t=0;t<s.getRowCount();t++)for(r=0;r<s.getColumnCount();r++){if(isNaN(c=l.toDouble(s.getValue(t,r)))||isNaN(k=l.toDouble(a.getValue(t,r))))return u;g+=c;nt+=c*c;ot+=k;it+=c*k}for(et?(o=(p*it-g*ot)/(p*nt-g*g),st=(ot*nt-g*it)/(p*nt-g*g)):(o=it/nt,st=0),w=[],t=0;t<b.getRowCount();t++)for(w[t]=[],r=0;r<b.getColumnCount();r++){if(isNaN(c=l.toDouble(b.getValue(t,r))))return u;w[t][r]=o*c+st}return w}else if(a.getColumnCount()===1&&a.getRowCount()===s.getRowCount()||a.getRowCount()===1&&a.getColumnCount()===s.getColumnCount()){if(k=[],c=[],a.getColumnCount()===1){for(p=s.getRowCount(),o=s.getColumnCount(),t=0;t<p;t++){if(isNaN(y=l.toDouble(a.getValue(t,0))))return u;k[t]=y}for(t=0;t<p;t++)for(c[t]=[],r=0;r<o;r++){if(isNaN(y=l.toDouble(s.getValue(t,r))))return u;c[t][r]=y}}else{for(p=s.getColumnCount(),o=s.getRowCount(),c=[],k=[],t=0;t<p;t++){if(isNaN(y=l.toDouble(a.getValue(0,t))))return u;k[t]=y}for(t=0;t<p;t++)for(c[t]=[],r=0;r<o;r++){if(isNaN(y=l.toDouble(s.getValue(r,t))))return u;c[t][r]=y}}for(e=[],f=0;f<o+1;f++)e[f]=[];for(rt=0;rt<o+1;rt++)for(ut=0;ut<o+2;ut++)e[rt][ut]=0;for(f=0;f<p;f++)for(e[0][o+1]=e[0][o+1]+k[f],t=0;t<o;t++)for(e[0][t+1]=e[0][t+1]+c[f][t],e[t+1][0]=e[0][t+1],e[t+1][o+1]=e[t+1][o+1]+c[f][t]*k[f],r=t;r<o;r++)e[r+1][t+1]=e[r+1][t+1]+c[f][t]*c[f][r],e[t+1][r+1]=e[r+1][t+1];if(e[0][0]=p,et)for(t=0;t<o+1;t++){if(e[t][t]===0){for(d=!1,r=t+1;!d&&r<o+1;r++)if(e[r][t]!==0){for(f=0;f<o+2;f++)tt=e[t][f],e[t][f]=e[r][f],e[r][f]=tt;d=!0}if(!d)return h}for(v=1/e[t][t],f=0;f<o+2;f++)e[t][f]=e[t][f]*v;for(r=0;r<o+1;r++)if(r!==t)for(v=-e[r][t],f=0;f<o+2;f++)e[r][f]=e[r][f]+v*e[t][f]}else for(t=1;t<o+1;t++){if(e[t][t]===0){for(d=!1,r=t+1;!d&&r<o+1;r++)if(e[r][t]!==0){for(f=0;f<o+2;f++)tt=e[t][f],e[t][f]=e[r][f],e[r][f]=tt;d=!0}if(!d)return h}for(v=1/e[t][t],f=1;f<o+2;f++)e[t][f]=e[t][f]*v;for(r=1;r<o+1;r++)if(r!==t)for(v=-e[r][t],f=1;f<o+2;f++)e[r][f]=e[r][f]+v*e[t][f];e[0][o+1]=0}if(a.getColumnCount()===1){for(w=[],t=0;t<b.getRowCount();t++){for(w[t]=[],v=e[0][o+1],r=0;r<o;r++){if(isNaN(y=l.toDouble(b.getValue(t,r))))return u;v+=e[r+1][o+1]*y}w[t][0]=v}return w}else{for(w=[],w[0]=[],t=0;t<b.getColumnCount;t++){for(v=e[0][o+1],r=0;r<o;r++){if(isNaN(y=l.toDouble(b.getValue(r,t))))return u;v+=e[r+1][o+1]*y}w[0][t]=v}return w}}return h}function wl(n){var v=i.Convert,ht=i._Helper,b=v._toArray(n[0]),y=[],tt,ct,d,it,t,r,o,g,w,k,rt,ot,nt,a,s,l,f,ft;for(y=ht._argumentExists(n,1)?v._toArray(n[1]):b,tt=ht._argumentExists(n,2)?v._toArray(n[2]):y,ct=ht._argumentExists(n,3)?v.toBool(n[3]):!0,t=0;t<b.getRowCount();t++)for(r=0;r<b.getColumnCount();r++)if(s=b.getValue(t,r),v.isError(s))return s;else if(v.isNumber(s)){if(v.toDouble(s)<=0)return e}else return u;for(t=0;t<y.getRowCount();t++)for(r=0;r<y.getColumnCount();r++)if(s=y.getValue(t,r),v.isError(s))return s;else if(!v.isNumber(s))return u;for(t=0;t<tt.getRowCount();t++)for(r=0;r<tt.getColumnCount();r++)if(s=tt.getValue(t,r),v.isError(s))return s;else if(!v.isNumber(s))return u;if(b.getRowCount()===y.getRowCount()&&b.getColumnCount()===y.getColumnCount()){g=y.getRowCount()*y.getColumnCount();var ut=0,et=0,lt=0,st=0,at;for(t=0;t<y.getRowCount();t++)for(r=0;r<y.getColumnCount();r++){if(isNaN(w=v.toDouble(y.getValue(t,r)))||isNaN(k=v.toDouble(b.getValue(t,r))))return u;k=p(k);ut+=w;et+=w*w;lt+=k;st+=w*k}for(ct?(o=(g*st-ut*lt)/(g*et-ut*ut),at=(lt*et-ut*st)/(g*et-ut*ut)):(o=st/et,at=0),nt=[],t=0;t<tt.getRowCount();t++)for(nt[t]=[],r=0;r<tt.getColumnCount();r++){if(isNaN(w=v.toDouble(tt.getValue(t,r))))return u;nt[t][r]=c(o*w+at)}return nt}else if(b.getColumnCount()===1&&b.getRowCount()===y.getRowCount()||b.getRowCount()===1&&b.getColumnCount()===y.getColumnCount()){if(k=[],w=[],b.getColumnCount()===1){for(g=y.getRowCount(),o=y.getColumnCount(),t=0;t<g;t++){if(isNaN(d=v.toDouble(b.getValue(t,0))))return u;k[t]=p(d)}for(t=0;t<g;t++)for(w[t]=[],r=0;r<o;r++){if(isNaN(d=v.toDouble(y.getValue(t,r))))return u;w[t][r]=d}}else{for(g=y.getColumnCount(),o=y.getRowCount(),w=[],k=[],t=0;t<g;t++){if(isNaN(d=v.toDouble(b.getValue(0,t))))return u;k[t]=d}for(t=0;t<g;t++)for(w[t]=[],r=0;r<o;r++){if(isNaN(d=v.toDouble(y.getValue(r,t))))return u;w[t][r]=d}}for(f=[],rt=0;rt<o+1;rt++)for(f[rt]=[],ot=0;ot<o+2;ot++)f[rt][ot]=0;for(ft=[],rt=0;rt<o+2;rt++)ft[rt]=0;for(it=0;it<g;it++)for(ft[o+1]=ft[o+1]+k[it]*k[it],f[0][o+1]=f[0][o+1]+k[it],ft[0]=f[0][o+1],t=0;t<o;t++)for(f[0][t+1]=f[0][t+1]+w[it][t],f[t+1][0]=f[0][t+1],f[t+1][o+1]=f[t+1][o+1]+w[it][t]*k[it],ft[t+1]=f[t+1][o+1],r=t;r<o;r++)f[r+1][t+1]=f[r+1][t+1]+w[it][t]*w[it][r],f[t+1][r+1]=f[r+1][t+1];if(f[0][0]=g,ct)for(a=0;a<o+1;a++){for(t=a;t<o+1&&f[t][a]===0;)t++;if(t>=o+1)return h;for(l=0;l<o+2;l++)s=f[a][l],f[a][l]=f[t][l],f[t][l]=s;for(s=1/f[a][a],l=0;l<o+2;l++)f[a][l]=f[a][l]*s;for(t=0;t<o+1;t++)if(t!==a)for(s=-f[t][a],l=0;l<o+2;l++)f[t][l]=f[t][l]+s*f[a][l]}else for(a=1;a<o+1;a++){for(t=a;t<o+1&&f[t][a]===0;)t++;if(t>=o+1)return h;for(l=1;l<o+2;l++)s=f[a][l],f[a][l]=f[t][l],f[t][l]=s;for(s=1/f[a][a],f[a][l]=f[a][l]*s,t=1;t<o+1;t++)t!==a&&(s=-f[t][a],f[t][l]=f[t][l]+s*f[a][l]);f[0][o+1]=0}if(b.getColumnCount()===1){for(nt=[],t=0;t<tt.getRowCount();t++){for(nt[t]=[],s=f[0][o+1],r=0;r<o;r++){if(isNaN(d=v.toDouble(tt.getValue(t,r))))return u;s+=f[r+1][o+1]*d}nt[t][0]=c(s)}return nt}else{for(nt=[],nt[0]=[],t=0;t<tt.getColumnCount();t++){for(s=f[0][o+1],r=0;r<o;r++){if(isNaN(d=v.toDouble(tt.getValue(r,t))))return u;s+=f[r+1][o+1]*d}nt[0][t]=c(s)}return nt}}return h}function bl(n){var b,t=i.Convert,l=i._ArrayHelper,r,o,s,c;if(isNaN(b=t.toDouble(n[0])))return u;var a,e,v=0,f=0,p=0,k=0,d,w,g=l.getLength(n[1]);if(g!==l.getLength(n[2]))return h;for(r=0,o=0;o<g;o++)if(s=l.getValueByIndex(n[1],o),c=l.getValueByIndex(n[2],o),t.isNumber(s)&&t.isNumber(c))a=t.toDouble(s),e=t.toDouble(c),v+=a,f+=e,p+=e*e,k+=e*a,r++;else if(t.isError(s))return s;else if(t.isError(c))return c;return r===0?y:r*p-f*f==0?y:(w=(r*k-f*v)/(r*p-f*f),d=v/r-w*(f/r),t.toResult(d+w*b))}function kl(n){return vt.__averageIncludeSubtotals(n,!0)}function dl(n){return vt.__stdevIncludeSubtotals(n,!0)}function fr(n){var s,r=i.Convert,l=i._ArrayHelper,t,h,c,o,f,a;if(isNaN(s=r.toDouble(n[1])))return u;if(t=[],r.isError(n[0]))return n[0];if(l.isArrayOrReference(n[0])){for(c=0;c<l.getLength(n[0]);c++)if(o=l.getValueByIndex(n[0],c),r.isNumber(o))h=r.toDouble(o),t.push(h);else if(r.isError(o))return i.Convert._inArray=!1,o;i.Convert._inArray=!1}else{if(isNaN(h=r.toDouble(n[0])))return u;t.push(h)}return(t.sort(function(n,t){return n-t}),t.length===0)?e:s<0||1<s?e:(f=s*(t.length-1),a=f%1,f=parseInt(f.toString(),10),a===0?t[f]:r.toDouble(t[f])+a*(r.toDouble(t[f+1])-r.toDouble(t[f])))}var vi,b,ut,wi,vt,ft;t.feature("calc.functions",["calc.common"]);var et=jQuery,o=null,s=undefined,l=Math.abs,d=Math.sqrt,ot=Math.max,st=Math.min,ht=Math.floor,pt=Math.ceil,er=Math.sin,or=Math.asin,sr=Math.cos,hr=Math.acos,cr=Math.tan,lr=Math.atan,ar=Math.atan2,c=Math.exp,p=Math.log,ct=Math.PI,li=Math.random,nt=Math.pow,tt="string",wt="boolean",k=i.Errors,vr=k.Null,y=k.DivideByZero,u=k.Value,yr=k.Reference,pr=k.Name,h=k.NotAvailable,e=k.Number;r.Functions=i.Functions;r.Functions._builtInFunctions=r.Functions._builtInFunctions||{};r._defineBuildInFunction=ai;r.def=ai;vi=function(){function n(){}return n.days360=tr,n.yearfrac=ir,n}();r._DateHelper=vi;r.acceptsAny=f;r.acceptsNone=wr;r.acceptsNotZero=bt;r.acceptsOne=w;r.acceptsTwo=a;r.acceptsZeroTwo=kt;r.acceptsZeroOdd=dt;r.acceptsThree=lt;r.isVolatile=it;r.acceptsOneTwo=rt;r.isBranch=yi;r.acceptsZero=gt;r.findTestArgument=pi;r.acceptAboveZero=ni;r.acceptsSecond=kr;r.acceptsSecondOrThirdOrFourth=ti;r.acceptsThird=dr;r.acceptsFirstOrThird=gr;r.acceptsFirstOrOne=nu;r.acceptsFirstOrOdd=tu;r.acceptsFirst=ii;r.acceptsFirstOrSecondOrThird=ri;r.acceptsEven=iu;r.acceptsFourth=ru;r.acceptsNotFourth=ui;r.acceptsFourthOrFifth=uu;r.acceptsNotSecond=fu;r.acceptsThreeFour=eu;r.acceptsPositive=ou;r.acceptsFour=su;r.acceptsFourFive=hu;r.acceptsFive=cu;r.acceptsSix=lu;r.acceptsEight=au;r.acceptsSeven=vu;r.acceptsNotTwo=yu;r.acceptsFiveSix=pu;r.acceptsFourSixSeven=wu;r.acceptsThreeFourFive=bu;r.acceptsMoreThanOne=ku;r.acceptsTwoThreeFour=du;r.acceptsOneTwoThree=gu;b=function(){function n(n,t){this.Key=n;this.Value=t}return n}();ut=[/\\/g,/\(/g,/\[/g,/\{/g,/\^/g,/\$/g,/\|/g,/\)/g,/\+/g,/\./g];wi=function(){function t(){}return t.__isLeapYear=function(n){return n%400==0||n%4==0&&n%100!=0||n===1900},t.__compareDateTime=function(n,t){return n-t},t.__toOADate=function(t){return new n.spread._DateTimeHelper(t).toOADate()},t.__annual_year_basis=function(n,i){var r;switch(i){case 0:return 360;case 1:return r=t.__isLeapYear(n.getFullYear()),r?366:365;case 2:return 360;case 3:return 365;case 4:return 360;default:return-1}},t.__getDaysInMonth=function(n,i){switch(i){case 0:case 2:case 4:case 6:case 7:case 9:case 11:return 31;case 1:return t.__isLeapYear(n)?29:28;break;case 3:case 5:case 8:case 10:return 30}},t.__Days_Between_BASIS_30E_360=function(n,t){var u,f,i,e,o,r;return u=n.getFullYear(),f=n.getMonth(),i=n.getDate(),e=t.getFullYear(),o=t.getMonth(),r=t.getDate(),i===31&&(i=30),r===31&&(r=30),(e-u)*360+(o-f)*30+(r-i)},t.__Days_Between_BASIS_30Ep_360=function(n,t){var f,e,i,o,u,r;return f=n.getFullYear(),e=n.getMonth(),i=n.getDate(),o=t.getFullYear(),u=t.getMonth(),r=t.getDate(),i===31&&(i=30),r===31&&(r=1,u++),(o-f)*360+(u-e)*30+(r-i)},t.__Days_Between_BASIS_MSRB_30_360_SYM=function(n,i){var o,f,r,s,e,u;return o=n.getFullYear(),f=n.getMonth(),r=n.getDate(),s=i.getFullYear(),e=i.getMonth(),u=i.getDate(),f===2&&t.__getDaysInMonth(o,f)===r&&(r=30),e===2&&t.__getDaysInMonth(s,e)===u&&(u=30),u===31&&r>=30&&(u=30),r===31&&(r=30),(s-o)*360+(e-f)*30+(u-r)},t.__Days_Between_BASIS_MSRB_30_360=function(n,i){var o,f,r,s,e,u;return o=n.getFullYear(),f=n.getMonth(),r=n.getDate(),s=i.getFullYear(),e=i.getMonth(),u=i.getDate(),f===2&&t.__getDaysInMonth(o,f)===r&&e===2&&t.__getDaysInMonth(s,e)===u&&(r=30,u=30),u===31&&r>=30&&(u=30),r===31&&(r=30),(s-o)*360+(e-f)*30+(u-r)},t.__days_between_basis=function(n,r,u){var f=1,e;t.__compareDateTime(n,r)>0&&(e=n,n=r,r=e,f=-1);switch(u){case 1:case 2:case 3:return f*i.Convert.toInt(t.__toOADate(r)-t.__toOADate(n));case 4:return f*t.__Days_Between_BASIS_30E_360(n,r);case 5:return f*t.__Days_Between_BASIS_30Ep_360(n,r);case 6:return f*t.__Days_Between_BASIS_MSRB_30_360_SYM(n,r);default:return f*t.__Days_Between_BASIS_MSRB_30_360(n,r)}},t}();r._FinancialHelper=wi;vt=function(){function n(){}return n.__dev1=function(n,t,r){for(var o,s,c,l,e=i.Convert,h=i._ArrayHelper,f=0;f<n.length;f++)if(e.isError(n[f]))return n[f];else if(h.isArrayOrReference(n[f])){for(o=0;o<h.getLength(n[f]);o++)if(r||!h.isSubtotalByIndex(n[f],o))if(s=h.getValueByIndex(n[f],o),e.isNumber(s))c=e.toDouble(s),t.sumx+=c,t.sumx2+=c*c,t.n++;else if(e.isError(s))return i.Convert._inArray=!1,s;i.Convert._inArray=!1}else{if(isNaN(l=e.toDouble(n[f])))return u;t.sumx+=l;t.sumx2+=l*l;t.n++}},n.st_normsdist=function(n){var e,s=i.Convert,o,t,f,r;return isNaN(e=s.toDouble(n[0]))?u:(o=6,e===0?f=0:(t=.5*l(e),t>=o*.5?f=1:t<1?(r=t*t,f=((((((((.000124818987*r-.001075204047)*r+.005198775019)*r-.019198292004)*r+.059054035642)*r-.151968751364)*r+.319152932694)*r-.5319230073)*r+.797884560593)*t*2):(t-=2,f=(((((((((((((-45255659e-12*t+.00015252929)*t-19538132e-12)*t-.000676904986)*t+.001390604284)*t-.00079462082)*t-.002034254874)*t+.006549791214)*t-.010557625006)*t+.011630447319)*t-.009279453341)*t+.005353579108)*t-.002141268741)*t+.000535310849)*t+.999936657524)),e>0?(f+1)*.5:(1-f)*.5)},n.__averageIncludeSubtotals=function(n,t){for(var e,s,h,a,l=0,c=0,f=i.Convert,o=i._ArrayHelper,r=0;r<n.length;r++){if(f.isError(n[r]))return n[r];if(o.isArrayOrReference(n[r])){for(e=0;e<o.getRangeCount(n[r]);e++)for(s=0;s<o.getLength(n[r],e);s++)if(t||!o.isSubtotalByIndex(n[r],s,e))if(h=o.getValueByIndex(n[r],s,e),f.isNumber(h))l+=f.toDouble(h),c++;else if(f.isError(h))return i.Convert._inArray=!1,h;i.Convert._inArray=!1}else{if(isNaN(a=f.toDouble(n[r])))return u;l+=a;c++}}return c===0?y:f.toResult(l/c)},n.__countIncludeSubtotals=function(n,t){for(var v,e,a,c,l=0,o=i.Convert,s,h,u,f,r=0;r<n.length;r++)if(o._isCalcArray(n[r])){for(o._inArray=!0,h=n[r].getColumnCount(),s=n[r].getRowCount(),f=0;f<h;f++)for(u=0;u<s;u++)o.isNumber(n[r].getValue(u,f))&&l++;o._inArray=!1}else if(o._isCalcReference(n[r]))for(v=n[r].getRangeCount(),h=0,s=0,e=0;e<v;e++)for(h=n[r].getColumnCount(e),f=0;f<h;f++)for(s=n[r].getRowCount(e),u=0;u<s;u++){if(n[r]instanceof i._SheetRangeReference)for(c=0;c<n[r].getSheetCount();c++)(t||!n[r].isSubtotal(c,e,u,f))&&(a=n[r].getValue(c,e,u,f));else(t||!n[r].isSubtotal(e,u,f))&&(a=n[r].getValue(e,u,f));o.isNumber(a)&&l++}else o.isNumber(n[r])&&l++;return o.toResult(l)},n.__countaIncludeSubtotals=function(n,t){for(var u,e,c,h=0,l=i.Convert,f=i._ArrayHelper,r=0;r<n.length;r++)if(f.isArrayOrReference(n[r])){for(u=0;u<f.getRangeCount(n[r]);u++)for(e=0;e<f.getLength(n[r],u);e++)(t||!f.isSubtotalByIndex(n[r],e,u))&&(c=f.getValueByIndex(n[r],e,u),c!==s&&c!==o&&h++);i.Convert._inArray=!1}else n[r]!==s&&n[r]!==o&&h++;return l.toResult(h)},n.__maxIncludeSubtotals=function(n,t){for(var o,s,a,l,h=!1,f=0,e=i.Convert,c=i._ArrayHelper,r=0;r<n.length;r++){if(e.isError(n[r]))return n[r];if(c.isArrayOrReference(n[r])){for(o=0;o<c.getLength(n[r]);o++)if(t||!c.isSubtotalByIndex(n[r],o))if(s=c.getValueByIndex(n[r],o),e.isNumber(s))a=e.toDouble(s),(!h||a>f)&&(f=a),h=!0;else if(e.isError(s))return i.Convert._inArray=!1,s;i.Convert._inArray=!1}else{if(l=e.toDouble(n[r]),isNaN(l))return u;(!h||l>f)&&(f=l);h=!0}}return f},n.__minIncludeSubtotals=function(n,t){for(var s,h,c=!1,e=0,f,o=i.Convert,l=i._ArrayHelper,r=0;r<n.length;r++){if(o.isError(n[r]))return n[r];if(l.isArrayOrReference(n[r])){for(s=0;s<l.getLength(n[r]);s++)if(t||!l.isSubtotalByIndex(n[r],s))if(h=l.getValueByIndex(n[r],s),o.isNumber(h))f=o.toDouble(h),(!c||f<e)&&(e=f),c=!0;else if(o.isError(h))return i.Convert._inArray=!1,h;i.Convert._inArray=!1}else{if(isNaN(f=o.toDouble(n[r])))return u;(!c||f<e)&&(e=f);c=!0}}return e},n.__stdevIncludeSubtotals=function(t,r){var u={sumx:0,sumx2:0,n:0},f=n.__dev1(t,u,r),e=i.Convert;return e.isError(f)?f:u.n<=1?y:e.toResult(d(ot(0,(u.n*u.sumx2-u.sumx*u.sumx)/(u.n*(u.n-1)))))},n.__stdevpIncludeSubtotals=function(t,r){var u={sumx:0,sumx2:0,n:0},f=n.__dev1(t,u,r),e=i.Convert;return e.isError(f)?f:u.n<=0?y:e.toResult(d(ot(0,(u.n*u.sumx2-u.sumx*u.sumx)/(u.n*u.n))))},n.__varrIncludeSubtotals=function(t,r){var u={sumx:0,sumx2:0,n:0},f=n.__dev1(t,u,r),e=i.Convert;return e.isError(f)?f:u.n<=1?y:e.toResult(ot(0,(u.n*u.sumx2-u.sumx*u.sumx)/(u.n*(u.n-1))))},n.__varpIncludeSubtotals=function(t,r){var u={sumx:0,sumx2:0,n:0},f=n.__dev1(t,u,r),e=i.Convert;return e.isError(f)?f:u.n<=0?y:e.toResult(ot(0,(u.n*u.sumx2-u.sumx*u.sumx)/(u.n*u.n)))},n.st_percentile=fr,n}();r._StatHelper=vt;ft=function(){function n(){}return n.log=function(n,t){return isNaN(n)?n:isNaN(t)?t:t!==1&&n===1||t!==0&&t!==Number.POSITIVE_INFINITY?p(n)/p(t):NaN},n.log10=function(t){return n.log(t,10)},n}();r._MathHelper=function(){function f(n){var t=ht(n);return r.Functions._MathHelper.approxEqual(n,t+1)?t+1:t}function h(n){var t=pt(n);return r.Functions._MathHelper.approxEqual(n,t-1)?t-1:t}function y(n,t){return n===t?!0:l(n-t)<l(n)/281474976710656}function w(){var n=[];return n[0]=1,n[1]=10,n[2]=100,n[3]=1e3,n[4]=1e4,n[5]=1e5,n[6]=1e6,n[7]=1e7,n[8]=1e8,n[9]=1e9,n[10]=1e10,n[11]=1e11,n[12]=1e12,n[13]=1e13,n[14]=1e14,n[15]=1e15,n[16]=1e16,n}function a(n){var i=w(),t=i[n];return t!==s&&t!==o?t:nt(10,parseFloat(n))}function t(t,r){var u,f,e,h,c;switch(t){case 0:u=function(n,t){return n<=t};f=function(n,t){return n<=t};break;case 1:u=function(n,t){return n>=t};f=function(n,t){return n>=t};break;case 2:u=function(n,t){return n!==t};f=function(n,t){return n!==t};break;case 3:u=function(n,t){return n<t};f=function(n,t){return n<t};break;case 4:u=function(n,t){return n===t};f=function(n,t){return n===t};break;case 5:u=function(n,t){return n>t};f=function(n,t){return n>t};break;default:return function(n){return!1}}e=-1;h=!0;try{c={value:0};r===s||r===o?e=0:n.spread.Calc.Convert.tryToDouble(r.toString(),c)?e=c.value:h=!1}catch(l){h=!1}return function(n){if((n===s||n===o)&&(n=""),h){var t=-1;try{if(!isNaN(t=i.Convert.toDouble(n)))return f(t,e)}catch(c){}}return u(n.toString().toUpperCase(),r!==s&&r!==o?r.toString().toUpperCase():"")}}function b(n){var f,e;if(i.Convert.isNumber(n))return t(4,n);var h="=><",r=n!==s&&n!==o?n.toString().toUpperCase():"",u='\0';for(f=0;f<2&&f<r.length;f++)if(e=r[f],h.indexOf(e)!==-1)if(e==="=")switch(u){case"<":return t(0,r.substring(2));case">":return t(1,r.substring(2));default:return t(4,u==='\0'?r.substring(1):n)}else{if(u==='\0'){u=e;continue}if(u==="<")return e===">"?t(2,r.substring(2)):t(3,r.substring(1));else if(u===">")return t(5,r.substring(1))}else switch(u){case"<":return t(3,r.substring(1));case">":return t(5,r.substring(1));default:break}return t(4,n)}function k(n,t){if(isNaN(n))return u;var r=a(l(t));return t<0?n/=r:n*=r,n=n<0?h(n-.5):f(n+.5),t<0?n*=r:n/=r,i.Convert.toResult(n)}function d(n,t){var f,r;if(isNaN(n)||isNaN(t))return u;if(n<0||t<0||n<t)return e;for(f=1,t=st(n-t,t),r=1;r<=t;r++)f*=n-r+1,f/=r;return i.Convert.toResult(f)}function v(n){return p(1+n)-(1+n-1-n)/(1+n)}function g(n,t){var i;return i=l(n)>.5?nt(1+n,t):c(t*v(n)),isFinite(i)?isNaN(i)&&(i=494065645841247e-338):i===Number.POSITIVE_INFINITY?i=179769e303:i===Number.NEGATIVE_INFINITY&&(i=-179769e303),i}function tt(n){return(c(n)+c(-n))/2}function it(n){return(c(n)-c(-n))/2}return{approxFloor:f,approxCeiling:h,approxEqual:y,pow10:a,parseCriteria:b,round:k,combin:d,log10:ft.log10,log:ft.log,pow1p:g,log1p:v,cosh:tt,sinh:it}}();r.def("ABS",tf,{minArgs:1,maxArgs:1});r.def("ACOS",to,{minArgs:1,maxArgs:1});r.def("ASIN",fo,{minArgs:1,maxArgs:1});r.def("ATAN",ho,{minArgs:1,maxArgs:1});r.def("ATAN2",co,{minArgs:2,maxArgs:2});r.def("COS",no,{minArgs:1,maxArgs:1});r.def("CEILING",uf,{minArgs:2,maxArgs:2});r.def("ODD",af,{minArgs:1,maxArgs:1});r.def("EVEN",of,{minArgs:1,maxArgs:1});r.def("FLOOR",ie,{minArgs:2,maxArgs:2});r.def("LN",cf,{minArgs:1,maxArgs:1});r.def("SQRT",gf,{minArgs:1,maxArgs:1});r.def("SIN",uo,{minArgs:1,maxArgs:1});r.def("TAN",so,{minArgs:1,maxArgs:1});r.def("SIGN",wf,{minArgs:1,maxArgs:1});r.def("GCD",bf,{minArgs:1,acceptsReference:f,acceptsArray:f});r.def("LCM",kf,{minArgs:1,acceptsReference:f,acceptsArray:f});r.def("PRODUCT",df,{minArgs:1,acceptsReference:f,acceptsArray:f});r.def("POWER",yf,{minArgs:2,maxArgs:2});r.def("MOD",lf,{minArgs:2,maxArgs:2});r.def("QUOTIENT",ne,{minArgs:2,maxArgs:2});r.def("SUBTOTAL",te,{minArgs:2,acceptsReference:bt,acceptsArray:bt});r.def("INT",rf,{minArgs:1,maxArgs:1});r.def("MROUND",re,{minArgs:2,maxArgs:2});r.def("ROUND",ei,{minArgs:2,maxArgs:2});r.def("ROUNDDOWN",ue,{minArgs:2,maxArgs:2});r.def("ROUNDUP",fe,{minArgs:2,maxArgs:2});r.def("TRUNC",ee,{minArgs:1,maxArgs:2,acceptsMissingArgument:w});r.def("EXP",oe,{minArgs:1,maxArgs:1});r.def("LOG",se,{minArgs:1,maxArgs:2,acceptsMissingArgument:w});r.def("LOG10",he,{minArgs:1,maxArgs:1});r.def("SUM",pf,{minArgs:1,acceptsReference:f,acceptsArray:f});r.def("SUMIF",ce,{minArgs:2,maxArgs:3,acceptsMissingArgument:a,acceptsReference:kt,acceptsArray:kt});r.def("SUMIFS",ae,{minArgs:3,acceptsReference:dt,acceptsArray:dt});r.def("SUMPRODUCT",ve,{minArgs:1,acceptsReference:f,acceptsArray:f,arrayArgumentEvaluateMode:1});r.def("SUMSQ",ye,{minArgs:1,acceptsReference:f,acceptsArray:f});r.def("SUMX2MY2",pe,{minArgs:2,maxArgs:2,acceptsReference:f,acceptsArray:f});r.def("SUMX2PY2",we,{minArgs:2,maxArgs:2,acceptsReference:f,acceptsArray:f});r.def("SUMXMY2",be,{minArgs:2,maxArgs:2,acceptsReference:f,acceptsArray:f});r.def("SERIESSUM",ke,{minArgs:4,maxArgs:4,acceptsReference:lt,acceptsArray:lt});r.def("PI",vf,{minArgs:0,maxArgs:0});r.def("SQRTPI",de,{minArgs:1,maxArgs:1});r.def("DEGREES",ef,{minArgs:1,maxArgs:1});r.def("RADIANS",ge,{minArgs:1,maxArgs:1});r.def("COSH",io,{minArgs:1,maxArgs:1});r.def("ACOSH",ro,{minArgs:1,maxArgs:1});r.def("SINH",eo,{minArgs:1,maxArgs:1});r.def("ASINH",oo,{minArgs:1,maxArgs:1});r.def("TANH",lo,{minArgs:1,maxArgs:1});r.def("ATANH",ao,{minArgs:1,maxArgs:1});r.def("MDETERM",vo,{minArgs:1,maxArgs:1,acceptsArray:f,acceptsReference:f});r.def("MINVERSE",yo,{minArgs:1,maxArgs:1,acceptsArray:f,acceptsReference:f});r.def("MMULT",po,{minArgs:2,maxArgs:2,acceptsArray:f,acceptsReference:f});r.def("FACT",sf,{minArgs:1,maxArgs:1});r.def("FACTDOUBLE",hf,{minArgs:1,maxArgs:1});r.def("MULTINOMIAL",wo,{minArgs:1,acceptsArray:f,acceptsReference:f});r.def("RAND",bo,{minArgs:0,maxArgs:0,isVolatile:it});r.def("RANDBETWEEN",ko,{minArgs:2,maxArgs:2,isVolatile:it});r.def("COMBIN",ff,{minArgs:2,maxArgs:2});r.def("ROMAN",ns,{minArgs:1,maxArgs:2,acceptsMissingArgument:w});r.def("AND",ts,{minArgs:1,acceptsReference:f,acceptsArray:f});r.def("OR",is,{minArgs:1,acceptsReference:f,acceptsArray:f});r.def("NOT",rs,{minArgs:1,maxArgs:1});r.def("IF",us,{minArgs:2,maxArgs:3,acceptsReference:rt,acceptsArray:rt,acceptsError:rt,acceptsMissingArgument:a,isBranch:yi,findTestArgument:pi,findBranchArgument:br});r.def("IFERROR",es,{minArgs:2,maxArgs:2,acceptsReference:gt,acceptsError:gt});r.def("TRUE",os,{minArgs:0,maxArgs:0});r.def("FALSE",ss,{minArgs:0,maxArgs:0});r.def("DATE",hs,{minArgs:3,maxArgs:3});r.def("TIME",cs,{minArgs:3,maxArgs:3});r.def("DATEVALUE",ls,{minArgs:1,maxArgs:1});r.def("TIMEVALUE",gi,{minArgs:1,maxArgs:1});r.def("NOW",vs,{minArgs:0,maxArgs:0,isVolatile:it});r.def("TODAY",ys,{minArgs:0,maxArgs:0,isVolatile:it});r.def("HOUR",ps,{minArgs:1,maxArgs:1});r.def("MINUTE",ws,{minArgs:1,maxArgs:1});r.def("SECOND",bs,{minArgs:1,maxArgs:1});r.def("DAY",ks,{minArgs:1,maxArgs:1});r.def("MONTH",ds,{minArgs:1,maxArgs:1});r.def("YEAR",gs,{minArgs:1,maxArgs:1});r.def("WEEKNUM",ih,{minArgs:1,maxArgs:2,acceptsMissingArgument:w});r.def("WEEKDAY",hi,{minArgs:1,maxArgs:2,acceptsMissingArgument:w});r.def("EDATE",rh,{minArgs:2,maxArgs:2});r.def("EOMONTH",fh,{minArgs:2,maxArgs:2});r.def("WORKDAY",eh,{minArgs:2,maxArgs:3,acceptsMissingArgument:a,acceptsArray:a,acceptsReference:a});r.def("DAYS360",tr,{minArgs:2,maxArgs:3,acceptsMissingArgument:a});r.def("NETWORKDAYS",ch,{minArgs:2,maxArgs:3,acceptsMissingArgument:a,acceptsArray:a,acceptsReference:a});r.def("YEARFRAC",ir,{minArgs:2,maxArgs:3,acceptsMissingArgument:a});r.def("DATEDIF",yh,{minArgs:3,maxArgs:3});r.def("CLEAN",wh,{minArgs:1,maxArgs:1});r.def("TRIM",bh,{minArgs:1,maxArgs:1});r.def("DOLLAR",dh,{minArgs:1,maxArgs:2,acceptsMissingArgument:w});r.def("FIXED",gh,{minArgs:1,maxArgs:3,acceptsMissingArgument:rt});r.def("TEXT",tc,{minArgs:2,maxArgs:2});r.def("VALUE",ic,{minArgs:1,maxArgs:1});r.def("LOWER",rc,{minArgs:1,maxArgs:1});r.def("UPPER",uc,{minArgs:1,maxArgs:1});r.def("CHAR",fc,{minArgs:1,maxArgs:1});r.def("CODE",ec,{minArgs:1,maxArgs:1});r.def("REPLACE",oc,{minArgs:4,maxArgs:4,acceptsMissingArgument:a});r.def("SUBSTITUTE",sc,{minArgs:3,maxArgs:4,acceptsMissingArgument:lt});r.def("CONCATENATE",hc,{minArgs:2,acceptsArray:f});r.def("LEFT",cc,{minArgs:1,maxArgs:2,acceptsMissingArgument:w});r.def("MID",lc,{minArgs:3,maxArgs:3});r.def("RIGHT",ac,{minArgs:1,maxArgs:2,acceptsMissingArgument:w});r.def("REPT",vc,{minArgs:2,maxArgs:2});r.def("LEN",yc,{minArgs:1,maxArgs:1});r.def("FIND",pc,{minArgs:2,maxArgs:3,acceptsMissingArgument:a});r.def("SEARCH",wc,{minArgs:2,maxArgs:3,acceptsMissingArgument:a});r.def("EXACT",bc,{minArgs:2,maxArgs:2});r.def("T",kc,{minArgs:1,maxArgs:1});r.def("ISERROR",nl,{minArgs:1,maxArgs:1,acceptsError:f});r.def("ISERR",tl,{minArgs:1,maxArgs:1,acceptsError:f});r.def("ISNA",il,{minArgs:1,maxArgs:1,acceptsError:f});r.def("ERROR.TYPE",rl,{minArgs:1,maxArgs:1,acceptsError:f});r.def("ISNUMBER",ul,{minArgs:1,maxArgs:1,acceptsError:f});r.def("ISEVEN",fl,{minArgs:1,maxArgs:1});r.def("ISODD",el,{minArgs:1,maxArgs:1});r.def("N",ol,{minArgs:1,maxArgs:1});r.def("ISBLANK",sl,{minArgs:1,maxArgs:1,acceptsError:f});r.def("ISLOGICAL",hl,{minArgs:1,maxArgs:1,acceptsError:f});r.def("ISTEXT",cl,{minArgs:1,maxArgs:1,acceptsError:f});r.def("ISNONTEXT",ll,{minArgs:1,maxArgs:1,acceptsError:f});r.def("ISREF",al,{minArgs:1,maxArgs:1,acceptsError:f,acceptsReference:f});r.def("TYPE",vl,{minArgs:1,maxArgs:1,acceptsArray:f,acceptsError:f});r.def("NA",yl,{minArgs:0,maxArgs:0});r.def("TREND",pl,{minArgs:1,maxArgs:4,acceptsReference:ri,acceptsArray:ri,acceptsMissingArgument:ti});r.def("GROWTH",wl,{minArgs:1,maxArgs:4,acceptsReference:ui,acceptsArray:ui,acceptsMissingArgument:ti});r.def("FORECAST",bl,{minArgs:3,maxArgs:3,acceptsArray:ni,acceptsReference:ni});r.def("AVERAGE",kl,{minArgs:1,acceptsArray:f,acceptsReference:f});r.def("STDEV",dl,{minArgs:1,acceptsArray:f,acceptsReference:f});r.def("PERCENTILE",fr,{minArgs:2,maxArgs:2,acceptsArray:ii,acceptsReference:ii})})(i.Functions||(i.Functions={}));var r=i.Functions})(t.Calc||(t.Calc={}));var i=t.Calc})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){(function(n){var l,yt,pt,it,i,u,p,w,b,rt,k,d;n.feature("formatter",["core.common","core.globalize","core.migrate"]);var t=null,e=undefined,o=Math.abs,h=Math.ceil,nt=Math.pow,a=Math.floor,lt=Math.max,at=Math.min,vt=Math.round,r={Empty:"",Format:function(){for(var r,n,f,u=[],i=0;i<arguments.length-0;i++)u[i]=arguments[i+0];if(arguments.length===0)return t;for(r=u[0],n=1;n<arguments.length;n++)f=new RegExp("\\{"+(n-1)+"\\}","gm"),r=r.replace(f,arguments[n]);return r},IsNullOrEmpty:function(n){return!n||n===r.Empty}},tt;(function(n){n[n.None=0]="None";n[n.AllowLeadingWhite=1]="AllowLeadingWhite";n[n.AllowTrailingWhite=2]="AllowTrailingWhite";n[n.AllowInnerWhite=4]="AllowInnerWhite";n[n.AllowWhiteSpaces=7]="AllowWhiteSpaces";n[n.NoCurrentDateDefault=8]="NoCurrentDateDefault";n[n.AdjustToUniversal=16]="AdjustToUniversal";n[n.AssumeLocal=32]="AssumeLocal";n[n.AssumeUniversal=64]="AssumeUniversal";n[n.RoundtripKind=128]="RoundtripKind"})(tt||(tt={}));l={IsDigit:function(n){var t=n.charCodeAt(0);return t>=48&&t<=57},IsWhiteSpace:function(n){var t=n.charCodeAt(0);return t>=9&&t<=13||t===32||t===133||t===160}},function(n){n[n.CustomMode=0]="CustomMode";n[n.StandardDateTimeMode=1]="StandardDateTimeMode";n[n.StandardNumericMode=2]="StandardNumericMode"}(n.FormatMode||(n.FormatMode={}));yt=n.FormatMode,function(n){n[n.General=0]="General";n[n.Number=1]="Number";n[n.DateTime=2]="DateTime";n[n.Text=3]="Text"}(n.NumberFormatType||(n.NumberFormatType={}));pt=n.NumberFormatType,function(n){n[n.Hour=0]="Hour";n[n.Minute=1]="Minute";n[n.Second=2]="Second"}(it||(it={}));i=function(){function i(){}return i.DateTimeFormatInfo=function(){return n._CultureInfo.currentCulture().DateTimeFormat()},i.NumberFormatInfo=function(){return n._CultureInfo.currentCulture().NumberFormat()},i.Filter=function(n,i,r){var s,u,f,o;if(n===e||n===t||n==="")return n;for(s="",u=0,f=0;f<n.length;f++)o=n[f],o===i?u++:o===r?(u--,u<0&&(u=0)):u===0&&(s+=o);return s.toString()},i.TrimSquareBracket=function(t){return!t||t===r.Empty?t:(t[0]===i.LeftSquareBracket&&(t=n.StringHelper.TrimStart(t,i.LeftSquareBracket)),t[t.length-1]===i.RightSquareBracket&&(t=n.StringHelper.TrimEnd(t,i.RightSquareBracket)),t)},i.IsOperator=function(n){return n===i.LessThanSign||n===i.GreaterThanSign||n===i.EqualsThanSign},i.TrimEscape=function(t){for(var u,o=t.length,r=!1,f=new n.StringBuilder,e=0;e<o;e++)u=t.charAt(e),u===i.ReverseSolidusSign?(r=!r,r||f.Append(u)):(r=!1,f.Append(u));return f.toString()},i.AddSquareBracket=function(t){if(!t)throw new Error(n.SR.Exp_TokenIsNull);return(t.length===0||t[0]!==i.LeftSquareBracket)&&(t=n.StringHelper.Insert(t,0,i.LeftSquareBracket.toString())),(t.length===0||t[t.length-1]!==i.RightSquareBracket)&&(t=n.StringHelper.Insert(t,t.length,i.RightSquareBracket.toString())),t},i.IsEquals=function(n,t,i){return n||t?n&&t?i?n.toLowerCase()===t.toLowerCase():n===t:!1:!0},i.ReplaceKeyword=function(t,i,u){var f,o,e;if(!t||t===r.Empty||this.IsEquals(i,u,!0))return t;for(f=t,o=0;;)if(e=n.StringHelper.IndexOf(f,i,1),e>-1)f=n.StringHelper.Remove(f,e,i.length),f=n.StringHelper.Insert(f,e,u),o=e+u.length;else break;return f},i.IsDecimal=function(n,t){var r=i.DecimalSeparator;return t&&(r=t.NumberDecimalSeparator),n.indexOf(r)>-1},i.DoubleQuote='"',i.SingleQuote="'",i.Tab="\t",i.LeftSquareBracket="[",i.RightSquareBracket="]",i.LessThanSign="<",i.GreaterThanSign=">",i.EqualsThanSign="=",i.PlusSign="+",i.HyphenMinus="-",i.UnderLine="_",i.LeftParenthesis="(",i.RightParenthesis=")",i.Dollar="$",i.Comma=";",i.Space=" ",i.SolidusSign="/",i.ReverseSolidusSign="\\",i.Zero="0",i.QuestionMark="?",i.Colon=":",i.Semicolon=";",i.Sharp="#",i.CommercialAt="@",i.NumberSign="#",i.Asterisk="*",i.Exponential1="E+",i.Exponential2="E-",i.DecimalSeparator=".",i.NumberGroupSeparator=",",i.PercentSymbol="%",i.NaNSymbol="NaN",i.FormatSeparator=";",i.NegativeSign="-",i.ReplacePlaceholder="@",i.ExponentialSymbol="E",i}();n.DefaultTokens=i;u=function(){function u(i,r,u){this._classNames=["NumberFormatBase","IFormatter","IFormatProviderSupport"];this.numberFormatInfo=t;this.dateTimeFormatInfo=t;this.cultureName="";var f=this;f._initFileds();f.partLocaleID=i;f.partDbNumberFormat=r;f.cultureName=u?u:n._CultureInfo.currentCulture().Name()}return u.prototype._initFileds=function(){var n=this;n.numberStringConverter=t;n.numberFormatInfo=t;n.dateTimeFormatInfo=t;n.partLocaleID=t;n.partDbNumberFormat=t},u.prototype.NumberStringConverter=function(n){return arguments.length===0?this.numberStringConverter?this.numberStringConverter:t:(this.numberStringConverter=n,n)},u.prototype.PartLocaleID=function(){return n.util.asType(this.partLocaleID,"LocaleIDFormatPart")},u.prototype.PartDBNumberFormat=function(){return n.util.asType(this.partDbNumberFormat,"DBNumberFormatPart")},u.prototype.DateTimeFormatInfo=function(n){return arguments.length===0?this.dateTimeFormatInfo:(this.dateTimeFormatInfo=n,n)},u.prototype.NumberFormatInfo=function(n){return arguments.length===0?this.numberFormatInfo:(this.numberFormatInfo=n,n)},u.prototype.CultureName=function(n){var t=this;return arguments.length===0?t.partLocaleID?t.partLocaleID.CultureInfo().Name():t.cultureName:(t.cultureName=n,n)},u.prototype.NumberGroupSeparator=function(){return this.NumberFormatInfo()?this.NumberFormatInfo().NumberGroupSeparator:i.NumberGroupSeparator},u.prototype.PercentSymbol=function(){return this.NumberFormatInfo()?this.NumberFormatInfo().PercentSymbol:i.PercentSymbol},u.prototype.PositiveSign=function(){return this.NumberFormatInfo()?this.NumberFormatInfo().PositiveSign:i.NumberFormatInfo().PositiveSign},u.prototype.NegativeSign=function(){return this.NumberFormatInfo()?this.NumberFormatInfo().NegativeSign:i.NegativeSign},u.prototype.DecimalSeparator=function(){return this.NumberFormatInfo()?this.NumberFormatInfo().NumberDecimalSeparator:i.DecimalSeparator},u.prototype.NaNSymbol=function(){return this.NumberFormatInfo()?this.NumberFormatInfo().NaNSymbol:i.NaNSymbol},u.TrimNotSupportSymbol=function(t,i){var o,s,r,f,e;for(arguments.length===1&&(i=!0),o=!1,s=new n.StringBuilder,r=0;r<t.length;r++)f=t[r],e=!0,f==='"'?o=!o:o||(i||(f==="?"&&(u.IsTransform(t,r)||(e=!1)),f==="/"&&(u.IsTransform(t,r)||(e=!1))),f==="_"?u.IsTransform(t,r)||(e=!1,r++):f==="*"&&(u.IsTransform(t,r)||(e=!1))),e&&s.Append(f);return s.toString()},u.IsTransform=function(t,i){if(t[i]==="\\")throw new Error(n.SR.Exp_InvalidBackslash);if(i-1>0&&i-1<t.length&&t[i-1]==="\\")if(i-2<0)return!0;else if(i-2>0&&i-2<t.length)return t[i-2]!=="\\";return!1},u.ContainsKeywords=function(u,f){var o,e,a,s,v;if(!u||u===r.Empty)return!1;var c=new n.StringBuilder,h=!1,l=t;for(o=0;o<u.length;o++)e=u[o],e==='"'?h=!h:h||e!==i.UnderLine&&l!==i.UnderLine&&c.Append(e==="E"?e:e.toLowerCase()),l=e;for(a=c.toString(),s=0;s<f.length;s++)if(v=f[s],n.StringHelper.Contains(a,v))return!0;return!1},u.prototype.Format=function(n){return""},u.prototype.Parse=function(n){return t},u.prototype.FormatString=function(){return""},u.prototype.ExcelCompatibleFormatString=function(){return""},u.General="General",u}();p=function(){function i(n){var t=this;t.ShortDatePattern="d";t.LongDatePattern="D";t.FullDatePatternShortTime="f";t.FullDatePatternLongTime="F";t.GeneralDatePatternLongTimeShortTime="g";t.GeneralDatePatternLongTimeLongTime="G";t.MonthDayPattern1="m";t.MonthDayPattern2="M";t.RoundTripDatePattern1="o";t.RoundTripDatePattern2="O";t.RFC1123Pattern1="r";t.RFC1123Pattern2="R";t.SortableDatePattern="s";t.ShortTimePattern="t";t.LongTimePattern="T";t.UniversalSortableDatePattern="u";t.UniversalFullDatePattern="U";t.YearMonthPattern1="y";t.YearMonthPattern2="Y";t._classNames=["StandardDateTimeFormatter","IFormatter"];t._formatString=n}return i.prototype.EvaluateFormat=function(n){var t=this;return n===t.ShortDatePattern||n===t.LongDatePattern||n===t.FullDatePatternShortTime||n===t.FullDatePatternLongTime||n===t.GeneralDatePatternLongTimeShortTime||n===t.GeneralDatePatternLongTimeLongTime||n===t.MonthDayPattern1||n===t.MonthDayPattern2||n===t.RoundTripDatePattern1||n===t.RoundTripDatePattern2||n===t.RFC1123Pattern1||n===t.RFC1123Pattern2||n===t.SortableDatePattern||n===t.ShortTimePattern||n===t.LongTimePattern||n===t.UniversalSortableDatePattern||n===t.UniversalFullDatePattern||n===t.YearMonthPattern1||n===t.YearMonthPattern2?!0:!1},i.prototype.Format=function(i){try{return i===e||i===t||i===""?"":new n._DateTimeHelper(i).localeFormat(this._formatString)}catch(r){return i.toString()}},i.prototype.Parse=function(i){try{return!i||i===""?t:n._DateTimeHelper.parseLocale(i,this._formatString)}catch(r){return new Date(i)}},i.prototype.FormatString=function(){return this._formatString},i}();n._StandardDateTimeFormatter=p;w=function(){function i(n){var t=this;t.CurrencyPattern1="c";t.CurrencyPattern2="C";t.DecimalPattern1="d";t.DecimalPattern2="D";t.ScientificPattern1="e";t.ScientificPattern2="E";t.FixedPointPattern1="f";t.FixedPointPattern2="F";t.GeneralPattern1="g";t.GeneralPattern2="G";t.NumberPattern1="n";t.NumberPattern2="N";t.PercentPattern1="p";t.PercentPattern2="P";t.RoundTripPattern1="r";t.RoundTripPattern2="R";t.HexadecimalPattern1="x";t.HexadecimalPattern2="X";t._classNames=["StandardNumberFormatter","IFormatter"];t._formatString=n}return i.prototype.EvaluateFormat=function(n){var i=this,t;return n&&n!==r.Empty&&n.length>0&&(t=n.substr(0,1),t===i.CurrencyPattern1||t===i.CurrencyPattern2||t===i.DecimalPattern1||t===i.DecimalPattern2||t===i.ScientificPattern1||t===i.ScientificPattern2||t===i.FixedPointPattern1||t===i.FixedPointPattern2||t===i.GeneralPattern1||t===i.GeneralPattern2||t===i.NumberPattern1||t===i.NumberPattern2||t===i.PercentPattern1||t===i.PercentPattern2||t===i.RoundTripPattern1||t===i.RoundTripPattern2||t===i.HexadecimalPattern1||t===i.HexadecimalPattern2)?!0:!1},i.prototype.Format=function(t){try{return!t||t===""?"":new n._NumberHelper(t).localeFormat(this._formatString)}catch(i){return t.toString()}},i.prototype.Parse=function(i){try{return!i||i===""?t:n._NumberHelper.parseLocale(i)}catch(u){var r=parseFloat(i);return isNaN(r)||!isFinite(r)?t:r}},i.prototype.FormatString=function(){return this._formatString},i}();n._StandardNumberFormatter=w;b=function(r){function f(n,t,f,e){var s=this,o;r.call(this,t,f,e);s._classNames=["NumberFormatText","IFormatter"];o=u.TrimNotSupportSymbol(n,!1);t&&(o=i.ReplaceKeyword(o,s.PartLocaleID().OriginalToken(),s.PartLocaleID().CurrencySymbol()));o=i.Filter(o,i.LeftSquareBracket,i.RightSquareBracket);o=i.TrimEscape(o);s._formatString=o}return __extends(f,r),f.prototype.Format=function(i){try{var r=n.Calc.Convert.toString(i),u=n.StringHelper.Replace(this._formatString,'"',"");return u!==t&&typeof u!==e&&(r=n.StringHelper.Replace(u,"@",r)),r}catch(f){return""}},f.prototype.Parse=function(n){return n?n:""},f.prototype.FormatString=function(){return this._formatString},f.EvaluateFormat=function(n){return!0},f.prototype.DefaultDateTimeNumberStringConverter=function(){},f}(u);rt=function(){function n(n){this._innerFormatter=n}return n.prototype.FormatString=function(){return this._innerFormatter?this._innerFormatter.FormatString():""},n.prototype.innerFormatter=function(n){return arguments.length===0?this._innerFormatter:(this._innerFormatter=n,this)},n.prototype.Parse=function(n){return this._innerFormatter?this._innerFormatter.Parse(n):n},n.prototype.Format=function(n){return this._innerFormatter?this._innerFormatter.Format(n):n===e||n===t?"":n.toString()},n.prototype.toJSON=function(){return e},n}();n.AutoFormatter=rt;k=function(){function o(i,r){var e=this;e.conditionFormatPart=t;e.colorFormatPart=t;e.localeIDFormatPart=t;e.dbNumberFormatPart=t;e.numberFormat=t;e.dateTimeFormatInfo=t;e.numberFormatInfo=t;e.formatCached=t;e._classNames=["CustomNumberFormat","IFormatter","IFormatProviderSupport"];r||(r=n._CultureInfo.currentCulture().Name());arguments.length===0?(e.formatCached=u.General,e.numberFormat=new f):e.Init(i,r)}return o.prototype.Init=function(u,o){var h,d,p,nt,w,v,tt;if(u===t||u===e)throw new Error(n.SR.Exp_FormatIllegal);h=this;h.formatCached=u;var a=t,l=t,k=!1,g=[];for(d=0;d<u.length;d++)if(p=u[d],p===i.LeftSquareBracket){if(k)throw new Error(n.SR.Exp_FormatIllegal);else l&&(a||(a=new n.StringBuilder),a.Append(l.toString()),l=t),l=new n.StringBuilder,l.Append(p);k=!0}else if(p===i.RightSquareBracket){if(k)if(l){if(l||(l=new n.StringBuilder),l.Append(p),nt=l.toString(),w=n.util.asType(s.Create(nt),"FormatPartBase"),w&&!n.util.isType(w,"ABSTimeFormatPart"))h.AddPart(w);else if(n.util.isType(w,"ABSTimeFormatPart"))g.push(n.util.asType(w,"ABSTimeFormatPart")),a||(a=new n.StringBuilder),a.Append(l.toString());else throw new Error(n.SR.Exp_FormatIllegal);l=t}else throw new Error(n.SR.Exp_FormatIllegal);else throw new Error(n.SR.Exp_FormatIllegal);k=!1}else l||(l=new n.StringBuilder),l.Append(p);if(l)if(k)throw new Error(n.SR.Exp_FormatIllegal);else a||(a=new n.StringBuilder),a.Append(l.toString());if(h.localeIDFormatPart!==t&&(o=h.localeIDFormatPart.CultureInfo().Name()),v=a?a.toString():r.Empty,f.EvaluateFormat(v))h.numberFormat=new f(v,h.LocaleIDFormatPart(),h.dbNumberFormatPart,o);else if(c.EvaluateFormat(v))tt=g.length>0?g:t,h.numberFormat=new c(v,tt,h.LocaleIDFormatPart(),h.dbNumberFormatPart,o);else if(y.EvaluateFormat(v))h.numberFormat=new y(u,h.LocaleIDFormatPart(),h.dbNumberFormatPart,o);else if(b.EvaluateFormat(v))h.numberFormat=new b(u,h.LocaleIDFormatPart(),h.dbNumberFormatPart,o);else throw new Error(n.SR.Exp_FormatIllegal);},o.prototype.FormatString=function(){var t=this,i=new n.StringBuilder;return t.numberFormat&&t.numberFormat.FormatString()&&(t.ColorFormatPart()&&i.Append(t.ColorFormatPart().toString()),t.ConditionFormatPart()&&i.Append(t.ConditionFormatPart().toString()),t.DBNumberFormatPart()&&i.Append(t.DBNumberFormatPart().toString()),t.LocaleIDFormatPart()&&i.Append(t.LocaleIDFormatPart().toString()),i.Append(t.numberFormat.FormatString())),i.toString()},o.prototype.ConditionFormatPart=function(){return this.conditionFormatPart},o.prototype.ColorFormatPart=function(){return this.colorFormatPart},o.prototype.LocaleIDFormatPart=function(){return this.localeIDFormatPart},o.prototype.DBNumberFormatPart=function(){return this.dbNumberFormatPart},o.prototype.NumberStringConverter=function(n){var i=this;if(arguments.length===0)return i.numberFormat?i.numberFormat.NumberStringConverter():t;else i.numberFormat&&i.numberFormat.NumberStringConverter(n)},o.prototype.ExcelCompatibleFormatString=function(){var t=this,i=new n.StringBuilder;return t.numberFormat&&t.numberFormat.ExcelCompatibleFormatString()&&(n.util.isType(t.numberFormat,"NumberFormatDigital")||(t.DBNumberFormatPart()&&i.Append(t.DBNumberFormatPart().toString()),t.LocaleIDFormatPart()&&i.Append(t.LocaleIDFormatPart().toString()),t.ConditionFormatPart()&&i.Append(t.ConditionFormatPart().toString()),t.ColorFormatPart()&&i.Append(t.ColorFormatPart().toString())),i.Append(t.numberFormat.ExcelCompatibleFormatString())),i.toString()},o.prototype.Formatter=function(){return this.numberFormat},o.prototype.DateTimeFormatInfo=function(n){return arguments.length===0?this.Formatter().DateTimeFormatInfo():(this.Formatter().DateTimeFormatInfo(n),this.dateTimeFormatInfo=n,n)},o.prototype.NumberFormatInfo=function(n){return arguments.length===0?this.Formatter().NumberFormatInfo():(this.Formatter().NumberFormatInfo(n),this.numberFormatInfo=n,n)},o.prototype.AddPart=function(t){if(!t)throw new Error(n.SR.Exp_PartIsNull);var i=this;if(n.util.isType(t,"ConditionFormatPart"))if(i.conditionFormatPart)throw new Error(n.SR.Exp_DuplicatedDescriptor);else i.conditionFormatPart=n.util.asType(t,"ConditionFormatPart");else if(n.util.isType(t,"ColorFormatPart"))if(i.colorFormatPart)throw new Error(n.SR.Exp_DuplicatedDescriptor);else i.colorFormatPart=n.util.asType(t,"ColorFormatPart");else if(n.util.isType(t,"LocaleIDFormatPart"))if(i.localeIDFormatPart)throw new Error(n.SR.Exp_DuplicatedDescriptor);else i.localeIDFormatPart=n.util.asType(t,"LocaleIDFormatPart");else if(n.util.isType(t,"DBNumberFormatPart"))if(i.dbNumberFormatPart)throw new Error(n.SR.Exp_DuplicatedDescriptor);else i.dbNumberFormatPart=n.util.asType(t,"DBNumberFormatPart")},o.prototype.Format=function(n){return this.numberFormat.Format(n)},o.prototype.Parse=function(n){return this.numberFormat.Parse(n)},o}();d=function(){function s(i,f,e){var o=this;o.formatters=t;o.formatModeType=0;o.dateTimeFormatInfo=t;o.numberFormatInfo=t;o.isSingleFormatterInfo=!0;o.isDefault=!0;o.isConstructed=!1;o.customerCultureName=t;o.PropertyChanged=[];o._classNames=["GeneralFormatter","IFormatter","INotifyPropertyChanged","IColorFormatter"];r.IsNullOrEmpty(i)&&(i=u.General);f||(f=0);o.formatCached=i;o.formatModeType=f;o.isDefault=o.formatCached.toLowerCase()===u.General.toLowerCase();o.isConstructed=!1;o.customerCultureName=e?n._CultureInfo.getCulture(e).Name():n._CultureInfo.currentCulture().Name()}return s._needChangeDefaultFormat=function(t){if(t){var i=n._CultureInfo.currentCulture().Name().toLowerCase(),r=t.customerCultureName.toLowerCase();return r===i?!1:!0}else return!0},s.DefaultNumberFormatter=function(){return s._needChangeDefaultFormat(this.defaultNumberFormatter)&&(this.defaultNumberFormatter=new s("###################0.################",0,n._CultureInfo.currentCulture().Name())),this.defaultNumberFormatter},s.DefaultGeneralFormatter=function(){return s._needChangeDefaultFormat(this.defaultGeneralFormatter)&&(this.defaultGeneralFormatter=new s),this.defaultGeneralFormatter},s.DefaultShortDatePatternFormatter=function(){return s._needChangeDefaultFormat(this.defaultShortDatePatternFormatter)&&(this.defaultShortDatePatternFormatter=new s(i.DateTimeFormatInfo().ShortDatePattern)),this.defaultShortDatePatternFormatter},s.DefaultSXDatetimePatternFormatter=function(){var n=i.DateTimeFormatInfo().ShortDatePattern+" h:mm:ss";return s._needChangeDefaultFormat(this.defaultSXDatetimePatternFormatter)&&(this.defaultSXDatetimePatternFormatter=new s(n)),this.defaultSXDatetimePatternFormatter},s.DefaultLongTimePatternFormatter=function(){var n=i.DateTimeFormatInfo().LongTimePattern;return s._needChangeDefaultFormat(this.defaultLongTimePatternFormatter)&&(this.defaultLongTimePatternFormatter=new s(n)),this.defaultLongTimePatternFormatter},s.DefaultDMMMFormatter=function(){return s._needChangeDefaultFormat(this.defaultDMMMFormatter)&&(this.defaultDMMMFormatter=new s("d-mmm",0,n._CultureInfo.currentCulture().Name())),this.defaultDMMMFormatter},s.DefaultMMMYYFormatter=function(){return s._needChangeDefaultFormat(this.defaultMMMYYFormatter)&&(this.defaultMMMYYFormatter=new s("mmm-yy",0,n._CultureInfo.currentCulture().Name())),this.defaultMMMYYFormatter},s.DefaultHMMFormatter=function(){return s._needChangeDefaultFormat(this.defaultHMMFormatter)&&(this.defaultHMMFormatter=new s("h:mm",0,n._CultureInfo.currentCulture().Name())),this.defaultHMMFormatter},s.DefaultHMMSSFormatter=function(){return s._needChangeDefaultFormat(this.defaultHMMSSFormatter)&&(this.defaultHMMSSFormatter=new s("h:mm:ss",0,n._CultureInfo.currentCulture().Name())),this.defaultHMMSSFormatter},s.DefaultHMMSS0Formatter=function(){return s._needChangeDefaultFormat(this.defaultHMMSS0Formatter)&&(this.defaultHMMSS0Formatter=new s("h:mm:ss.0",0,n._CultureInfo.currentCulture().Name())),this.defaultHMMSS0Formatter},s.DefaultComboNumberFormatter1=function(){return s._needChangeDefaultFormat(this.defaultComboNumberFormatter1)&&(this.defaultComboNumberFormatter1=new s(r.Format("{0}#,##0.00;[Red]({0}#,##0.00)",i.NumberFormatInfo().CurrencySymbol))),this.defaultComboNumberFormatter1},s.DefaultComboNumberFormatter2=function(){return s._needChangeDefaultFormat(this.defaultComboNumberFormatter2)&&(this.defaultComboNumberFormatter2=new s(r.Format("{0}#,##0;[Red]({0}#,##0)",i.NumberFormatInfo().CurrencySymbol))),this.defaultComboNumberFormatter2},s.DefaultStandardNumberFormatter=function(){return s._needChangeDefaultFormat(this.defaultStandardNumberFormatter)&&(this.defaultStandardNumberFormatter=new s("0.00E+00",0,n._CultureInfo.currentCulture().Name())),this.defaultStandardNumberFormatter},s.DefaultStandardPercentFormatter1=function(){return s._needChangeDefaultFormat(this.defaultStandardPercentFormatter1)&&(this.defaultStandardPercentFormatter1=new s("0.00%",0,n._CultureInfo.currentCulture().Name())),this.defaultStandardPercentFormatter1},s.DefaultStandardPercentFormatter2=function(){return s._needChangeDefaultFormat(this.defaultStandardPercentFormatter2)&&(this.defaultStandardPercentFormatter2=new s("0%",0,n._CultureInfo.currentCulture().Name())),this.defaultStandardPercentFormatter2},s.DefaultStandardGroupNumberFormatter1=function(){return s._needChangeDefaultFormat(this.defaultStandardGroupNumberFormatter1)&&(this.defaultStandardGroupNumberFormatter1=new s("#,##0.00",0,n._CultureInfo.currentCulture().Name())),this.defaultStandardGroupNumberFormatter1},s.DefaultStandardGroupNumberFormatter2=function(){return s._needChangeDefaultFormat(this.defaultStandardGroupNumberFormatter2)&&(this.defaultStandardGroupNumberFormatter2=new s("#,##0",0,n._CultureInfo.currentCulture().Name())),this.defaultStandardGroupNumberFormatter2},s.prototype.findDateTimeGeneralFormatter=function(i,r,u,f){var e,s,o;if(u&&u.length>0)for(e in u)if(u.hasOwnProperty(e)&&(s=u[e],o=n._DateTimeHelper.parseLocale(i,s),o&&o-r==0))return f();return t},s.prototype._formatDefaultValue=function(n){var i,r,u;if(n!==t&&typeof n!="undefined"&&(i=JSON.parse(JSON.stringify(n)),typeof i=="object"))for(r in i)i.hasOwnProperty(r)&&(u=i[r],u===t&&delete n[r],typeof u=="object"&&this._formatDefaultValue(n[r]))},s.prototype.toJSON=function(){if(this.formatters===t)return e;var n=$.extend(!0,{},JSON.parse(JSON.stringify(this.formatters)));return this._formatDefaultValue(n),{formatters:n}},s.prototype.HasFormatedColor=function(){var n=this;return n.isDefault?!1:n.PositiveExpression()&&n.PositiveExpression().ColorFormatPart()?!0:n.NegativeExpression()&&n.NegativeExpression().ColorFormatPart()?!0:n.ZeroExpression()&&n.ZeroExpression().ColorFormatPart()?!0:n.TextExpression()&&n.TextExpression().ColorFormatPart()?!0:!1},s.prototype.IsDefaultFormat=function(){return this.isDefault},s.prototype.FormatString=function(f){var e=this,o,s,h,c;if(arguments.length===0){e.Init();o=t;switch(e.FormatMode()){case 0:if(e.formatters)for(s=0;s<e.formatters.length;s++)h=e.formatters[s],n.util.isType(h,"CustomNumberFormat")&&(o?o.Append(i.FormatSeparator):o=new n.StringBuilder,c=h.FormatString(),o.Append(c));break;case 1:if(n.util.isType(e.formatters[0],"StandardDateTimeFormatter"))return e.formatters[0].FormatString();break;case 2:if(n.util.isType(e.formatters[0],"StandardNumberFormatter"))return e.formatters[0].FormatString();break}return o?o.toString():r.Empty}else{if(!f)throw new Error(n.SR.Exp_ValueIsNull);e.formatters=t;e.formatCached=f;e.isDefault=e.formatCached.toLowerCase()===u.General.toLowerCase();e.isConstructed=!1;e.Init();e.RaisePropertyChanged("FormatString")}},s.prototype.DateTimeFormatInfo=function(t){var r=this,u,f,e;if(arguments.length===0)return(r.Init(),r.dateTimeFormatInfo)?r.dateTimeFormatInfo:i.DateTimeFormatInfo();else{if(r.Init(),r.dateTimeFormatInfo=t,r.formatters)for(u=0;u<r.formatters.length;u++)f=r.formatters[u],n.util.isType(f,"IFormatProviderSupport")&&(e=f,e.DateTimeFormatInfo(t));return r.RaisePropertyChanged("DateTimeFormatInfo"),t}},s.prototype.NumberFormatInfo=function(t){var r=this,u,f,e;if(arguments.length===0)return(r.Init(),r.numberFormatInfo)?r.numberFormatInfo:i.NumberFormatInfo();else{if(r.Init(),r.numberFormatInfo=t,r.formatters)for(u=0;u<r.formatters.length;u++)f=r.formatters[u],n.util.isType(f,"IFormatProviderSupport")&&(e=f,e.NumberFormatInfo(t));return r.RaisePropertyChanged("NumberFormatInfo"),t}},s.prototype.FormatMode=function(n){return arguments.length===0?this.formatModeType:(this.formatModeType=n,this.RaisePropertyChanged("FormatMode"),n)},s.prototype.ExcelCompatibleFormatString=function(){var u=this,f,e,o,s;u.Init();f=t;switch(u.FormatMode()){case 0:if(u.formatters)for(e=0;e<u.formatters.length;e++)o=u.formatters[e],n.util.isType(o,"CustomNumberFormat")&&(f?f.Append(i.FormatSeparator):f=new n.StringBuilder,s=o.ExcelCompatibleFormatString(),f.Append(s));break;case 1:if(n.util.isType(u.formatters[0],"StandardDateTimeFormatter"))return u.formatters[0].ExcelCompatibleFormatString();break;case 2:if(n.util.isType(u.formatters[0],"StandardNumberFormatter"))return u.formatters[0].ExcelCompatibleFormatString();break}return f?f.toString():r.Empty},s.prototype.PositiveExpression=function(){var i=this;return(i.Init(),i.formatters&&i.formatters.length>0)?n.util.asType(i.formatters[0],"CustomNumberFormat"):t},s.prototype.NegativeExpression=function(){var i=this;return(i.Init(),i.formatters&&i.formatters.length>1)?n.util.asType(i.formatters[1],"CustomNumberFormat"):t},s.prototype.ZeroExpression=function(){var i=this;return(i.Init(),i.formatters&&i.formatters.length>2)?n.util.asType(i.formatters[2],"CustomNumberFormat"):t},s.prototype.TextExpression=function(){var i=this;return(i.Init(),i.formatters&&i.formatters.length>3)?n.util.asType(i.formatters[3],"CustomNumberFormat"):t},s.prototype.GetFormatType=function(t){var i,r;if(this.Init(),i=this.GetFormatInfo(t),n.util.isType(i,"CustomNumberFormat")){if(r=i.Formatter(),n.util.isType(r,"NumberFormatDigital"))return 1;else if(n.util.isType(r,"NumberFormatDateTime"))return 2;else if(n.util.isType(r,"NumberFormatText"))return 3}else if(n.util.isType(i,"NumberFormatDigital")||n.util.isType(i,"StandardNumberFormatter"))return 1;else if(n.util.isType(i,"NumberFormatDateTime")||n.util.isType(i,"StandardDateTimeFormatter"))return 2;else if(n.util.isType(i,"NumberFormatText"))return 3;return 0},s.prototype.GetPreferredEditingFormatter=function(t){var i,r;return this.Init(),n.util.isType(t,"DateTime")?(i=new n._DateTimeHelper(t),i.Hour()===0&&i.Minute()===0&&i.Second()===0&&i.Millisecond()===0?s.DefaultShortDatePatternFormatter():s.DefaultSXDatetimePatternFormatter()):n.util.isType(t,"TimeSpan")?s.DefaultLongTimePatternFormatter():n.FormatConverter.IsNumber(t)?(r=n.FormatConverter.ToDouble(t),r>1e20?new s("0.##E+00"):s.DefaultNumberFormatter()):n.util.isType(t,"string")?s.DefaultGeneralFormatter():s.DefaultGeneralFormatter()},s.prototype.GetPreferredDisplayFormatter=function(u,e){var o=this,c,h,l;if(e||(e={value:t}),e.value=t,o.Init(),r.IsNullOrEmpty(u))return new s;if(c=u,h=e.value=o.Parse(c),n.util.isType(h,"DateTime")||n.util.isType(h,"TimeSpan")){if((l=o.findDateTimeGeneralFormatter(u,h,f.GeneralMonthDay(),function(){return s.DefaultDMMMFormatter()}))||(l=o.findDateTimeGeneralFormatter(u,h,f.GeneralYearMonth(),function(){return s.DefaultMMMYYFormatter()}))||(l=o.findDateTimeGeneralFormatter(u,h,f.GeneralYearMonthDay(),function(){return s.DefaultShortDatePatternFormatter()}))||(l=o.findDateTimeGeneralFormatter(u,h,f.GeneralHourMinute(),function(){return s.DefaultHMMFormatter()}))||(l=o.findDateTimeGeneralFormatter(u,h,f.GeneralHourMinuteSecond(),function(){return s.DefaultHMMSSFormatter()}))||(l=o.findDateTimeGeneralFormatter(u,h,f.GeneralHourMinuteSecondSubSecond(),function(){return s.DefaultHMMSS0Formatter()}))||(l=o.findDateTimeGeneralFormatter(u,h,f.GeneralHourMinuteWithDate(),function(){return s._needChangeDefaultFormat(s.defaultShortDatePatternHMMFormatter)&&(s.defaultShortDatePatternHMMFormatter=new s(o.DateTimeFormatInfo().ShortDatePattern+" h:mm")),s.defaultShortDatePatternHMMFormatter}))||(l=o.findDateTimeGeneralFormatter(u,h,f.GeneralHourMinuteSecondWithDate(),function(){return s._needChangeDefaultFormat(s.defaultShortDatePatternHMMSSFormatter)&&(s.defaultShortDatePatternHMMSSFormatter=new s(o.DateTimeFormatInfo().ShortDatePattern+" h:mm:ss")),s.defaultShortDatePatternHMMSSFormatter}))||(l=o.findDateTimeGeneralFormatter(u,h,f.GeneralHourMinuteSecondSubSecondWithDate(),function(){return s._needChangeDefaultFormat(s.defaultShortDatePatternHMMSS0Formatter)&&(s.defaultShortDatePatternHMMSS0Formatter=new s(o.DateTimeFormatInfo().ShortDatePattern+" h:mm:ss.0")),s.defaultShortDatePatternHMMSS0Formatter})))return l}else if(n.FormatConverter.IsNumber(h))if(c[0]===i.NumberFormatInfo().CurrencySymbol[0])return n.StringHelper.Contains(c,i.DecimalSeparator)?s.DefaultComboNumberFormatter1():s.DefaultComboNumberFormatter2();else if(n.StringHelper.IndexOf(c,"e",1)>-1)return s.DefaultStandardNumberFormatter();else if(c[0].toString()===i.PercentSymbol||c[c.length-1].toString()===i.PercentSymbol)return n.StringHelper.Contains(c,i.DecimalSeparator)?s.DefaultStandardPercentFormatter1():s.DefaultStandardPercentFormatter2();else if(n.StringHelper.Contains(c,i.NumberGroupSeparator))return n.StringHelper.Contains(c,i.DecimalSeparator)?s.DefaultStandardGroupNumberFormatter1():s.DefaultStandardGroupNumberFormatter2();return s.DefaultGeneralFormatter()},s.prototype.Format=function(u,f){var s,v,c,l,h,a;if(n.util.isType(u,"boolean"))return u.toString().toUpperCase();if(f&&(f.value=t),this.Init(),s=this.GetFormatInfo(u),n.util.isType(s,"CustomNumberFormat")&&(v=s.ColorFormatPart(),f&&v&&(f.value=v.ForeColor())),c=0,l=n.FormatConverter.IsNumber(u),l&&(c=n.FormatConverter.ToDouble(u)),s){if(h=t,l&&s===this.NegativeExpression())h=s.Format(o(c)),n.util.isType(s,"CustomNumberFormat")&&(a=n.util.asType(s,"CustomNumberFormat"),a&&a.ConditionFormatPart()&&a.ConditionFormatPart().Value()>0&&c<0&&(h=i.NegativeSign+h));else try{h=s.Format(u)}catch(y){n.util.isType(u,"string")&&(h=u.toString())}return h?h:r.Empty}else return l&&c<0?i.HyphenMinus.toString():n.util.isType(u,"string")?u.toString():u===e||u===t?r.Empty:u.toString()},s.prototype.Parse=function(n){var i=this;return(i.Init(),i.formatters&&i.formatters.length>0)?i.formatters[0].Parse(n):t},s.prototype.Init=function(){var n=this;if(!n.isConstructed){n.isConstructed=!0;switch(n.formatModeType){case 0:n.InitExcelCompatibleMode(n.formatCached);break;case 1:n.InitStandardDateTimeMode(n.formatCached);break;case 2:n.InitStandardNumericMode(n.formatCached);break}}},s.prototype.InitStandardDateTimeMode=function(t){var i=new p(t);if(i.EvaluateFormat(t))this.formatters=[],this.formatters.push(i);else throw new Error(n.SR.Exp_FormatIllegal);},s.prototype.InitStandardNumericMode=function(t){var i=new w(t);if(i.EvaluateFormat(t))this.formatters=[],this.formatters.push(i);else throw new Error(n.SR.Exp_FormatIllegal);},s.prototype.InitExcelCompatibleMode=function(t){var u,f,o,e,s;if(r.IsNullOrEmpty(t))throw new Error(n.SR.Exp_FormatIllegal);if(u=this,u.formatters=[],u.isDefault)u.formatters.push(new k);else{if(u.isSingleFormatterInfo=!n.StringHelper.Contains(t,i.FormatSeparator.toString()),f=t.split(i.FormatSeparator),!f)throw new Error(n.SR.Exp_FormatIllegal);if(f.length<1||f.length>5)throw new Error(n.SR.Exp_FormatIllegal);for(o=0,e=0;e<f.length;e++){if(o++,o>4)break;s=new k(f[e],u.customerCultureName);s&&u.formatters.push(s)}if(!u.PositiveExpression())throw new Error(n.SR.Exp_FormatIllegal);}},s.prototype.GetFormatInfo=function(i){var r=this;if(r.FormatMode()===0){if(typeof i=="string"&&isNaN(i))return r.TextExpression()?r.TextExpression():r.PositiveExpression();else if(n.FormatConverter.IsNumber(i)||n.util.isType(i,"boolean")){var e=r.PositiveExpression(),o=r.NegativeExpression(),f=n.FormatConverter.ToDouble(i),s=e&&e.ConditionFormatPart(),h=o&&o.ConditionFormatPart(),u=r.isSingleFormatterInfo?r.PositiveExpression():t;return r.PositiveExpression()&&(s?e.ConditionFormatPart().IsMeetCondition(f)&&(u=e):(f>0||f===0&&!r.ZeroExpression())&&(u=e)),!u&&r.NegativeExpression()&&(h?o.ConditionFormatPart().IsMeetCondition(f)&&(u=o):f<0&&(u=o)),!u&&r.ZeroExpression()&&f===0&&(u=r.ZeroExpression()),!u&&r.ZeroExpression()&&(u=r.ZeroExpression()),!u&&r.NegativeExpression()&&(u=r.NegativeExpression()),u}}else if((r.FormatMode()===1||r.FormatMode()===2)&&r.formatters&&r.formatters.length===1)return r.formatters[0];return t},s.prototype.RaisePropertyChanged=function(n){var t=this,i,r;if(t.PropertyChanged)for(i=0;i<t.PropertyChanged.length;i++)r=t.PropertyChanged[i],typeof r=="function"&&r(t,n)},s.defaultNumberFormatter=t,s.defaultGeneralFormatter=t,s.defaultShortDatePatternFormatter=t,s.defaultLongTimePatternFormatter=t,s.defaultSXDatetimePatternFormatter=t,s.defaultDMMMFormatter=t,s.defaultMMMYYFormatter=t,s.defaultHMMFormatter=t,s.defaultHMMSSFormatter=t,s.defaultHMMSS0Formatter=t,s.defaultShortDatePatternHMMFormatter=t,s.defaultShortDatePatternHMMSSFormatter=t,s.defaultShortDatePatternHMMSS0Formatter=t,s.defaultComboNumberFormatter1=t,s.defaultComboNumberFormatter2=t,s.defaultStandardNumberFormatter=t,s.defaultStandardPercentFormatter1=t,s.defaultStandardPercentFormatter2=t,s.defaultStandardGroupNumberFormatter1=t,s.defaultStandardGroupNumberFormatter2=t,s}();n.GeneralFormatter=d;var s=function(){function n(n){this._classNames=["FormatPartBase"];this.originalToken=n}return n.prototype.OriginalToken=function(){return this.originalToken},n.prototype.SupportedPartFormat=function(){return n._supportedPartFormat||(n._supportedPartFormat=["ConditionFormatPart","ColorFormatPart","LocaleIDFormatPart"]),n._supportedPartFormat},n.Create=function(n){return ut.EvaluateFormat(n)?new ut(n):ot.EvaluateFormat(n)?new ot(n):ht.EvaluateFormat(n)?new ht(n):et.EvaluateFormat(n)?new et(n):ft.EvaluateFormat(n)?new ft(n):t},n}(),ut=function(u){function f(f){var e,h,v,y,a;if(u.call(this,f),e=this,s.call(e,f),e._classNames.push("ConditionFormatPart"),e._initFileds(),h=i.TrimSquareBracket(f),r.IsNullOrEmpty(h))throw new Error(n.SR.Exp_TokenIllegal);for(var o=t,c=0,l=t;c<h.length;c++)if(l=h[c],i.IsOperator(l))o||(o=new n.StringBuilder),o.Append(l);else break;if(!o)throw new Error(n.SR.Exp_TokenIllegal);v=o.toString();o=t;switch(v){case"<":e.compareOperator=4;break;case"<=":e.compareOperator=5;break;case"=":e.compareOperator=0;break;case">=":e.compareOperator=3;break;case">":e.compareOperator=2;break;case"<>":e.compareOperator=1;break;default:throw new Error(n.SR.Exp_TokenIllegal);}for(;c<h.length;c++){if(l=h[c],i.IsOperator(l))throw new Error(n.SR.Exp_TokenIllegal);o||(o=new n.StringBuilder);o.Append(l)}if(!o)throw new Error(n.SR.Exp_TokenIllegal);if(y=o.toString(),a=parseFloat(y),isNaN(a))throw new Error(n.SR.Exp_TokenIllegal);else e.value=a}return __extends(f,u),f.prototype._initFileds=function(){this.value=0;this.compareOperator=t},f.prototype.CompareOperator=function(){return this.compareOperator},f.prototype.Value=function(){return this.value},f.prototype.toString=function(){var t=new n.StringBuilder;switch(this.compareOperator){case 0:t.Append("=");break;case 2:t.Append(">");break;case 3:t.Append(">=");break;case 4:t.Append("<");break;case 5:t.Append("<=");break;case 1:t.Append("<>");break;default:throw new Error;}return t.Append(this.value.toString()),i.AddSquareBracket(t.toString())},f.prototype.IsMeetCondition=function(n){var t=this;switch(t.compareOperator){case 0:return n===t.value;case 2:return n>t.value;case 3:return n>=t.value;case 4:return n<t.value;case 5:return n<=t.value;case 1:return n!==t.value}return!1},f.EvaluateFormat=function(n){if(!n||n===r.Empty)return!1;var t=i.TrimSquareBracket(n);return!t||t===r.Empty?!1:i.IsOperator(t[0])},f}(s),ft=function(u){function f(f){var o,e,h,c;if(u.call(this,f),this.foreColor="black",this.index=-1,this.colorName=t,o=this,s.call(o,f),o._classNames.push("ColorFormatPart"),e=i.TrimSquareBracket(f),!e||e===r.Empty)throw new Error(n.SR.Exp_TokenIllegal);try{o.foreColor=e;o.colorName=e;return}catch(l){}if(!(e.length>5)||(e=n.StringHelper.Remove(e,0,5),h=-1,c=parseInt(e,10),isNaN(c)||(h=c,!(h>=1)||!(h<=56))))throw new Error(n.SR.Exp_TokenIllegal);}return __extends(f,u),f.prototype.ForeColor=function(){return this.foreColor},f.prototype.toString=function(){var n=this;if(n.index>-1)return i.AddSquareBracket("Color"+n.index);else if(n.colorName)return i.AddSquareBracket(n.colorName);throw new Error;},f.EvaluateFormat=function(t){if(!t||t===r.Empty)return!1;var u=i.TrimSquareBracket(t);return!u||u===r.Empty?!1:u.length<3?!1:isNaN(t[t.length-1])?t[0]!==t[1]:n.StringHelper.StartsWith(t,"Color",1)},f}(s),et=function(u){function f(t){var i,r,e;if(u.call(this,t),i=this,s.call(i,t),i._classNames.push("ABSTimeFormatPart"),i._initFileds(),f.EvaluateFormat(t))if(i.token=t.toLowerCase(),i.token[1]===f.HoursABSContent)i.type=0;else if(i.token[1]===f.MinuteABSContent)i.type=1;else if(i.token[1]===f.SecondABSContent)i.type=2;else throw new Error(n.SR.Exp_TokenIllegal);else throw new Error(n.SR.Exp_TokenIllegal);for(r=new n.StringBuilder,e=0;e<i.token.length-2;e++)r.Append("0");i.formatString=r.toString()}return __extends(f,u),f.prototype._initFileds=function(){this.token=t;this.type=t;this.formatString=t},f.prototype.FormatString=function(){return this.formatString},f.prototype.TimePartType=function(){return this.type},f.prototype.Token=function(){return this.token},f.EvaluateFormat=function(n){var u,e,o,s;if(!n||n===r.Empty||(u=i.TrimSquareBracket(n),!u||u===r.Empty))return!1;for(u=u.toLowerCase(),e=t,o=0;o<u.length;o++)if((e||(e=u[o]),s=f,e!==s.HoursABSContent&&e!==s.MinuteABSContent&&e!==s.SecondABSContent)||e!==u[o])return!1;return!0},f.HoursABSContent="h",f.MinuteABSContent="m",f.SecondABSContent="s",f}(s),g=function(){function n(n,i){var f=this,o,e,u;if(f._classNames=["DBNumber"],o=t,e=t,n)for(f.units=[],u=0;u<n.length;u++)e=n[u],e===0?f.units.push(r.Empty):f.units.push(String.fromCharCode(e));if(i)for(f.numbers=[],u=0;u<i.length;u++)e=i[u],e===0?f.numbers.push(r.Empty):f.numbers.push(String.fromCharCode(e))}return n.JapaneseDBNum1=function(){return n.japaneseDBNum1||(n.japaneseDBNum1=new n(n.JapaneseNumberUnitLetter1,n.JapaneseNumberLetterValues1)),n.japaneseDBNum1},n.JapaneseDBNum2=function(){return n.japaneseDBNum2||(n.japaneseDBNum2=new n(n.JapaneseNumberUnitLetter2,n.JapaneseNumberLetterValues2)),n.japaneseDBNum2},n.JapaneseDBNum3=function(){return n.japaneseDBNum3||(n.japaneseDBNum3=new n(t,n.JapaneseNumberLetterValues3)),n.japaneseDBNum3},n.prototype.Units=function(){return this.units},n.prototype.Numbers=function(){return this.numbers},n.japaneseDBNum1=t,n.japaneseDBNum2=t,n.japaneseDBNum3=t,n.JapaneseNumberUnitLetter1=[21315,30334,21313,20806,21315,30334,21313,20740,21315,30334,21313,19975,21315,30334,21313,0],n.JapaneseNumberUnitLetter2=[38433,30334,25342,20806,38433,30334,25342,20740,38433,30334,25342,33836,38433,30334,25342,0],n.JapaneseNumberLetterValues1=[12295,19968,20108,19977,22235,20116,20845,19971,20843,20061],n.JapaneseNumberLetterValues2=[12295,22769,24336,21442,22235,20237,20845,19971,20843,20061],n.JapaneseNumberLetterValues3=[65296,65297,65298,65299,65300,65301,65302,65303,65304,65305],n}(),ot=function(u){function f(r){var e,o,s;if(u.call(this,r),this.token=t,this.type=0,e=this,e._classNames.push("DBNumberFormatPart"),f.EvaluateFormat(r)){if(e.token=r,o=i.TrimSquareBracket(r),s=n.StringHelper.Remove(o,0,5),e.type=parseInt(s,10),e.type<0||e.type>3)throw new Error(n.SR.Exp_TokenIllegal);}else throw new Error(n.SR.Exp_TokenIllegal);}return __extends(f,u),f.prototype.Token=function(){return this.token?this.token:r.Empty},f.prototype.Type=function(){return this.type},f.prototype.ReplaceNumberString=function(u,f,e){var l,p;if(!u||u===r.Empty)return u;var h=u,w=u,s=-1,o=-1,a=!1,c=t,v=t,y=t;for(l=u.length-1;l>=0;l--)p=w[l],isNaN(p)&&(!i.IsEquals(p,i.DecimalSeparator,!1)||a)?o>-1&&s>-1&&(c=w.substr(o,s-o+1),v=parseFloat(c),isNaN(v)||(y=this.NumberString(c,f,e),h=n.StringHelper.Remove(h,o,s-o+1),h=n.StringHelper.Insert(h,o,y)),s=-1,o=-1,a=!1):(i.IsEquals(p,i.DecimalSeparator,!1)&&(a=!0),s===-1&&(s=l),o=l);return o>-1&&s>-1&&(c=w.substr(o,s-o+1),v=parseFloat(c),isNaN(v)||(y=this.NumberString(c,f,e),h=n.StringHelper.Remove(h,o,s-o+1),h=n.StringHelper.Insert(h,o,y)),s=-1,o=-1,a=!1),h},f.prototype.NumberString=function(i,r,u){var e=i.split("."),o,s;if(e)if(e.length===1)return f.FormatNumberString(e[0],r.Numbers(),u?r.Units():t);else if(e.length===2)return o=f.FormatNumberString(e[0],r.Numbers(),u?r.Units():t),s=f.FormatNumberString(e[1],r.Numbers()),o+"."+s;throw new Error(n.SR.Exp_ValueIllegal);},f.prototype.toString=function(){if(this.type>-1)return i.AddSquareBracket("DBNum"+this.type);throw new Error;},f.EvaluateFormat=function(t){if(!t||t===r.Empty)return!1;var u=i.TrimSquareBracket(t);return!u||u===r.Empty?!1:n.StringHelper.StartsWith(u,"DBNum",1)?!0:!1},f.FormatNumberString=function(i,u,e){var b=i,y=0,v=t,p=0,d,nt,tt,k,o,l,c,rt,it;if(arguments.length===2){for(d=new n.StringBuilder,y=0;y<b.length;y++)v=b.substr(y,1),p=parseInt(v,10),d.Append(u[p]);return d.toString()}else if(arguments.length===3){if(!e)return f.FormatNumberString(i,u);var s=0,g="",a=b.length,w=!1,h=[];for(y=0;y<a;y++)nt=e.length-1-y,nt>-1?h.push(e[nt].toString()):h.push(r.Empty);for(tt=[],o=h.length-1;o>=0;o--)tt[h.length-o-1]=h[o];for(h=tt,k=!1,o=0;o<a;o++)v=b.substr(o,1),p=parseInt(v,10),l=r.Empty,c=r.Empty,a-o-16>0?(l=u[p],c="",k=!0):o!==a-1&&o!==a-5&&o!==a-9&&o!==a-13?v==="0"?(l="",c="",s=s+1):v!=="0"&&s!==0?(l=u[0]+u[p],c=h[o],s=0):(l=u[p],c=h[o],s=0):v!=="0"&&s!==0?(l=u[0]+u[p],c=h[o],s=0):v!=="0"&&s===0||k?(l=u[p],c=h[o],s=0,k=!1):v==="0"&&s>=3?(l="",c="",s=s+1):a>=11?(l="",s=s+1):(l="",c=h[o],s=s+1),rt=l+c===r.Empty,rt||(w=!1),o!==a-13||w||(c=h[o],w=!0),o!==a-9||w||(c=h[o],w=!0),o===a-1&&(c=h[o],w=!0),g=g+l+c;return(it=parseInt(i,10),!isNaN(it)&&it===0)?u[0]:g}},f}(s),v=function(){function t(){}return t.ParseHexString=function(t){if(!t||t===r.Empty)throw new Error(n.SR.Exp_StringIllegal);return parseInt(t,16)},t.FixJapaneseChars=function(n){return n},t.GetFraction=function(n,t,i,r,u){var l=0,y=0,p=0,f=0,s,c,a,v,e;for(n>0?(f=n-h(n)+1,f==1?(f=0,l=n):l=h(n)-1):n<0&&(l=h(n),f=h(n)-n),s=2,c=9,s=nt(10,t-1),c=nt(10,t)-1,s<2&&(s=2),c<2&&(c=2),a=!1,v=0,e=s;e<=c;e++){var d=e*f,w=vt(d),b=w/e,k=o(b-f);if((a?k<o(v-f):!0)&&(a=!0,v=b,y=w,p=e,k<.0005))break}return i.value=l,r.value=y,u.value=p,a},t}(),st=function(){function t(){}return t.AllowScience=function(n){return n?!(n.indexOf("ja")===0)&&!(n.indexOf("zh")===0):!0},t.CreateCultureInfo=function(i){switch(i){case 1033:return n._CultureInfo.getCulture(t.EnglishUnitedStates);case 1041:return n._CultureInfo.getCulture(t.JapanneseJapan);default:return n._CultureInfo.currentCulture()}},t.JapanneseJapan="ja-JP",t.EnglishUnitedStates="en-US",t}(),ht=function(u){function f(f){var o,e,h;if(u.call(this,f),this.currencySymbol=t,this.locateID=-1,this.cultureInfo=t,this.content=t,o=this,s.call(o,f),o._classNames.push("LocaleIDFormatPart"),!f)throw new Error(n.SR.Exp_TokenIsNull);if(f===r.Empty)throw new Error(n.SR.Exp_TokenIllegal);if(o.content=i.TrimSquareBracket(f),e=o.content,!e||e===r.Empty)throw new Error(n.SR.Exp_TokenIllegal);if(i.IsEquals(e[0],i.Dollar,!1))e=n.StringHelper.Remove(e,0,1);else throw new Error(n.SR.Exp_TokenIllegal);if(h=e.indexOf(i.HyphenMinus),h>-1)o.currencySymbol=e.substr(0,h),e=n.StringHelper.Remove(e,0,h);else{o.currencySymbol=e;return}if(i.IsEquals(e[0],i.HyphenMinus,!1))e=n.StringHelper.Remove(e,0,1);else throw new Error(n.SR.Exp_TokenIllegal);if(e.length>0)o.locateID=v.ParseHexString(e);else throw new Error(n.SR.Exp_TokenIllegal);}return __extends(f,u),f.prototype.CultureInfo=function(){var n=this;return n.cultureInfo||(n.cultureInfo=st.CreateCultureInfo(n.locateID),n.currencySymbol&&n.currencySymbol!==r.Empty&&n.cultureInfo&&!n.cultureInfo.NumberFormat().IsReadOnly&&(n.cultureInfo.NumberFormat().CurrencySymbol=n.currencySymbol)),n.cultureInfo},f.prototype.CurrencySymbol=function(){return this.currencySymbol?this.EncodeSymbol(this.currencySymbol):r.Empty},f.prototype.AllowScience=function(){if(this.cultureInfo)return st.AllowScience(this.cultureInfo.Name())},f.prototype.GetDBNumber=function(n){var i=this.locateID&255;switch(i){case 17:switch(n){case 1:return g.JapaneseDBNum1();case 2:return g.JapaneseDBNum2();case 3:return g.JapaneseDBNum3()}break;default:break}return t},f.prototype.toString=function(){return this.content?i.AddSquareBracket(this.content):r.Empty},f.prototype.EncodeSymbol=function(t){return n.StringHelper.Replace(t,"\\.","'.'")},f.EvaluateFormat=function(n){if(!n||n===r.Empty)return!1;var t=i.TrimSquareBracket(n);return!t||t===r.Empty?!1:i.IsEquals(t[0],i.Dollar,!1)},f}(s),ct=function(){function r(){}return r.prototype.ConvertTo=function(r,u,f,e,o){var s=r,h;return e!=t&&o!=t&&u instanceof Date&&(h=e.GetDBNumber(o.Type()),s=o.ReplaceNumberString(s,h,!0),s=s.replace(i.ReplacePlaceholder+c.YearFourDigit,new n._DateTimeHelper(u).localeFormat(c.YearFourDigit)),s=s.replace(i.ReplacePlaceholder+c.YearTwoDigit,new n._DateTimeHelper(u).localeFormat(c.YearTwoDigit)),s=o.ReplaceNumberString(s,h,!1)),s},r}(),c=function(f){function o(n,i,r,e,o){f.call(this,r,e,o);this.baseNumberStringConverter=u.prototype.NumberStringConverter;this.baseDateTimeFormatInfo=u.prototype.DateTimeFormatInfo;this.baseCultureName=u.prototype.CultureName;var s=this;s.validDateTimeFormatString=t;s.formatString=t;s.hasJD=!1;s.absoluteTime=t;s.absTimeParts=t;s.hasYearDelay=!1;s.exactlyMatch=!1;s._classNames.push("NumberFormatDateTime");s.exactlyMatch=!1;s.formatString=s.FixFormat(u.TrimNotSupportSymbol(n));s.absTimeParts=i;s._init(n,i,r,e)}return __extends(o,f),o.EvaluateFormat=function(n){return u.ContainsKeywords(n,o.keyWords)},o.prototype._init=function(t,r,u,f){var s=this,e={value:s.formatString},h=o,a,c,l;if(h.EvaluateFormat(e.value)){if(a=s.ProcessAMPM(e),s.hasJD=s.Replace(e.value,h.MonthJD,'"'+h.PlaceholderMonthJD+'"',!0,!1,e,!1,!1),s.Replace(e.value,h.MonthUnabbreviated,h.StandardMonthUnabbreviated,!0,!1,e,!1,!1),s.Replace(e.value,h.MonthAbbreviation,h.StandardMonthAbbreviation,!0,!1,e,!1,!1),s.Replace(e.value,h.MonthTwoDigit,h.StandardMonthTwoDigit,!0,!1,e,!1,!1),s.Replace(e.value,h.MonthSingleDigit,h.StandardMonthSingleDigit,!0,!1,e,!1,!1),s.Replace(e.value,h.DayWeekDayAbbreviation,h.StandardDayWeekDayAbbreviation,!0,!0,e,!1,!0),s.Replace(e.value,h.DayWeekDayUnabbreviated,h.StandardDayWeekDayUnabbreviated,!0,!0,e,!1,!0),s.Replace(e.value,h.MinuteSingleDigit,h.StandardMinuteSingleDigit,!1,!0,e,!1,!1),a||(s.Replace(e.value,h.HoursSingleDigit,h.StandardHourSingleDigit,!0,!0,e,!1,!1),s.Replace(e.value,h.HoursTwoDigit,h.StandardHourTwoDigit,!0,!0,e,!1,!1)),s.Replace(e.value,h.SecondSingleDigit,h.StandardSecondSingleDigit,!0,!0,e,!1,!0),s.PartDBNumberFormat()&&s.PartLocaleID()&&(s.hasYearDelay=s.hasYearDelay||s.Replace(e.value,h.YearFourDigit,'"'+i.ReplacePlaceholder+h.YearFourDigit+'"',!0,!1,e,!1,!0),s.hasYearDelay=s.hasYearDelay||s.Replace(e.value,h.YearTwoDigit,'"'+i.ReplacePlaceholder+h.YearTwoDigit+'"',!0,!1,e,!1,!0)),s.absTimeParts)for(c=0;c<s.absTimeParts.length;c++)l=s.absTimeParts[c],s.Replace(e.value,l.token,i.ReplacePlaceholder+l.token,!0,!0,e,!1,!0);s.validDateTimeFormatString=e.value}else throw new Error(n.SR.Exp_FormatIllegal);},o.prototype._isJanpaneseCulture=function(){var i=this.PartLocaleID();if(i!==t&&i.CultureInfo()!==t){if(i.CultureInfo()===n._CultureInfo.japanCulture())return!0}else if(this.CultureName()===n._CultureInfo.japanCulture().Name())return!0;return!1},o.prototype.NumberStringConverter=function(n){return arguments.length===0?this.baseNumberStringConverter()?this.baseNumberStringConverter():o.defaultDateTimeNumberStringConverter:(this.baseNumberStringConverter(n),n)},o.prototype.AbsoluteTime=function(){return this.absoluteTime?this.absoluteTime:o.defaultAbsoluteTime},o.prototype.FormatString=function(){return this.formatString},o.prototype.DateTimeFormatInfo=function(t){var r=this;return arguments.length===0?r.baseDateTimeFormatInfo()?r.baseDateTimeFormatInfo():r.PartLocaleID()&&r.PartLocaleID().CultureInfo()?r.PartLocaleID().CultureInfo().DateTimeFormat():r.baseCultureName()?n._CultureInfo.getCulture(r.baseCultureName()).DateTimeFormat():i.DateTimeFormatInfo():(r.baseDateTimeFormatInfo(t),t)},o.prototype.ExcelCompatibleFormatString=function(){var t=this,i=t.formatString,n=o,r={value:i};return t.Replace(i,n.StandardAMPMSingleDigit,t.CurrentAMPM(),!0,!0,r,!1,!0),t.Replace(i,n.StandardMonthUnabbreviated,n.MonthUnabbreviated,!0,!1,r,!1,!0),t.Replace(i,n.StandardMonthAbbreviation,n.MonthAbbreviation,!0,!1,r,!1,!0),t.Replace(i,n.StandardMonthTwoDigit,n.MonthTwoDigit,!0,!1,r,!1,!0),t.Replace(i,n.StandardMonthSingleDigit,n.MonthSingleDigit,!0,!1,r,!1,!0),t.Replace(i,n.StandardDayWeekDayAbbreviation,n.DayWeekDayAbbreviation,!0,!0,r,!1,!0),t.Replace(i,n.StandardDayWeekDayUnabbreviated,n.DayWeekDayUnabbreviated,!0,!0,r,!1,!0),t.Replace(i,n.StandardMinuteSingleDigit,n.MinuteSingleDigit,!1,!0,r,!1,!0),t.Replace(i,n.StandardHourSingleDigit,n.HoursSingleDigit,!0,!0,r,!1,!1),t.Replace(i,n.StandardHourTwoDigit,n.HoursTwoDigit,!0,!0,r,!1,!1),t.Replace(i,n.StandardSecondSingleDigit,n.SecondSingleDigit,!0,!0,r,!1,!0),t.Replace(i,n.StandardSubSecondThreeDigit,n.SubSecondThreeDigit,!0,!0,r,!1,!0),t.Replace(i,n.StandardSubSecondTwoDigit,n.SubSecondTwoDigit,!0,!0,r,!1,!0),t.Replace(i,n.StandardSubSecondSingleDigit,n.SubSecondSingleDigit,!0,!0,r,!1,!0),r.value},o.prototype.CurrentAMPM=function(){var n=t;return(n=this.DateTimeFormatInfo()?this.DateTimeFormatInfo():i.DateTimeFormatInfo(),n&&n.AMDesignator&&n.AMDesignator!==r.Empty&&n.PMDesignator&&n.PMDesignator!==r.Empty)?r.Format("{0}/{1}",n.AMDesignator,n.PMDesignator):o.AMPMTwoDigit},o.prototype.Format=function(u){var l,c,b,y,p,w,v,k;if(n.util.isType(u,"boolean"))return u.toString().toUpperCase();var f=this,s=r.Empty,h=t;try{try{h=n.Calc.Convert.toDateTime(u);h||(s=u.toString())}catch(d){s=u.toString()}if(h&&(l=f.validDateTimeFormatString,c=f.validDateTimeFormatString.replace(/%/g,""),c==="H"||c==="h"||c==="m"||c==="M"||c==="d"||c==="s"||c==="y"?(l="%"+c,f.validDateTimeFormatString=l):l=c,s=f.PartLocaleID()&&f.PartLocaleID().CultureInfo()?new n._DateTimeHelper(h).customCultureFormat(l,f.PartLocaleID().CultureInfo()):f.CultureName()?new n._DateTimeHelper(h).customCultureFormat(l,n._CultureInfo.getCulture(f.CultureName())):new n._DateTimeHelper(h).localeFormat(l),f.hasJD&&(b=f._getMonthName(h.getMonth()),s=n.StringHelper.Replace(s,o.PlaceholderMonthJD,b.substr(0,1))),f.absTimeParts))for(y=h-f.AbsoluteTime(),p=0;p<f.absTimeParts.length;p++){w=f.absTimeParts[p];v=t;switch(w.TimePartType()){case 0:v=a(y/36e5);break;case 1:v=a(y/6e4);break;case 2:v=a(y/1e3);break}v!==t&&typeof v!==e&&(k=w.token.replace("[","\\[").replace("]","\\]"),s=n.StringHelper.Replace(s,i.ReplacePlaceholder+k,v))}}catch(g){s=n.FormatConverter.toString(u)}return f.NumberStringConverter()&&(f.NumberStringConverter()instanceof ct?s=f.NumberStringConverter().ConvertTo(s,u,!1,f.PartLocaleID(),f.PartDBNumberFormat()):(f.hasYearDelay&&(s=n.StringHelper.Replace(s,i.ReplacePlaceholder+o.YearFourDigit,new n._DateTimeHelper(h).localeFormat(o.YearFourDigit)),s=n.StringHelper.Replace(s,i.ReplacePlaceholder+o.YearTwoDigit,new n._DateTimeHelper(h).localeFormat(o.YearTwoDigit))),s=f.NumberStringConverter().ConvertTo(s,u,!0,f.PartLocaleID(),f.PartDBNumberFormat()))),s},o.prototype._getMonthName=function(n){var t=["January","February","March","April","May","June","July","August","September","October","November","December"];return t[n]},o.prototype.Parse=function(i){var o,e;if(!i||i===r.Empty)return t;var f=this,u=v.FixJapaneseChars(i),s=u.toLowerCase();if(s==="true")return!0;else if(s==="false")return!1;if(f.validDateTimeFormatString&&(o=n._DateTimeHelper.parseExact(u,f.validDateTimeFormatString,n._CultureInfo.getCulture(f.CultureName())),o))return o;if(!f.exactlyMatch)try{return e=n.Calc.Convert.toDateTime(u),e&&!isNaN(e)?e:u}catch(h){return u}return t},o.prototype.FixFormat=function(t){for(var r,u=t,s=new n.StringBuilder,e=!1,h=n.StringHelper.IndexOf(u,o.HoursSingleDigit[0],1)>-1||n.StringHelper.IndexOf(u,o.SecondSingleDigit[0],1)>-1,c=n.StringHelper.IndexOf(u,o.YearTwoDigit[0],1)>-1||n.StringHelper.IndexOf(u,o.DaySingleDigit[0],1)>-1,f=0;f<u.length;f++)r=u[f],r==='"'?e=!e:e||(r==="Y"||r==="D"||r==="S"||r==="E"||r==="G"?r=r.toLowerCase():r==="M"&&(f>1?i.IsEquals("A",u[f-1],!0)||i.IsEquals("P",u[f-1],!0)||(r=r.toLowerCase()):r=r.toLowerCase())),s.Append(r);return s.toString()},o.prototype.ProcessAMPM=function(t){var u=!1,i,f,r;return n.StringHelper.Contains(t.value,o.AMPMTwoDigit)&&(t.value=n.StringHelper.Replace(t.value,o.AMPMTwoDigit,o.StandardAMPMSingleDigit),u=!0),i=this.DateTimeFormatInfo(),n.StringHelper.Contains(t.value,o.AMPMSingleDigit)&&(t.value=n.StringHelper.Replace(t.value,o.AMPMSingleDigit,o.StandardAMPMSingleDigit),i&&(i.AMDesignator=o.AMPMSingleDigit.substr(0,1),i.PMDesignator=o.AMPMSingleDigit.substr(2,1)),u=!0),f=this.CurrentAMPM(),n.StringHelper.Contains(t.value,f)&&(t.value=n.StringHelper.Replace(t.value,f,o.StandardAMPMSingleDigit),r=f.split("/"),r&&r.length===2&&(i.AMDesignator=r[0],i.PMDesignator=r[1]),u=!0),u},o.prototype.Replace=function(t,r,u,f,e,s,h,c){var a,w,y,b,tt,v,g;if(s.value=t,f||e){var k=[],p=!0,it=n.StringHelper.IndexOf(s.value,o.HoursSingleDigit[0],1)>-1||n.StringHelper.IndexOf(s.value,o.SecondSingleDigit[0],1)>-1,rt=n.StringHelper.IndexOf(s.value,o.YearTwoDigit[0],1)>-1||n.StringHelper.IndexOf(s.value,o.DaySingleDigit[0],1)>-1;!rt&&it&&(p=!1);for(var d=!1,nt=0,l=0;l<s.value.length;l++){if(a=s.value[l],i.IsEquals(a,o.HoursSingleDigit[0],!0)||i.IsEquals(a,o.SecondSingleDigit[0],!0)?p=!1:(i.IsEquals(a,o.YearTwoDigit[0],!0)||i.IsEquals(a,o.DaySingleDigit[0],!0))&&(p=!0),f&&i.IsEquals(a,r[nt],c)&&p||e&&i.IsEquals(a,r[nt],c)&&!p){for(w=!0,y=0;y<r.length;y++)if(y+l>=t.length||!i.IsEquals(r[y],s.value[y+l],c)){w=!1;break}if(b=l+r.length-1,w&&b+1<s.value.length){for(tt=s.value[b],v=-1,v=b+1;v<s.value.length;v++)if(!i.IsEquals(tt,s.value[v],c))break;v>b+1&&(l=v,w=!1)}w&&!d&&new n._ArrayHelper(k).insert(0,l)}a==='"'&&(d=!d)}if(k.length>0){if(!h)for(l=0;l<k.length;l++)g=k[l],s.value=n.StringHelper.Remove(s.value,g,r.length),s.value=n.StringHelper.Insert(s.value,g,u);return!0}else return!1}return!1},o.defaultDateTimeNumberStringConverter=new ct,o.YearTwoDigit="yy",o.YearSingleDigit="y",o.YearFourDigit="yyyy",o.MonthSingleDigit="m",o.MonthTwoDigit="mm",o.MonthAbbreviation="mmm",o.MonthUnabbreviated="mmmm",o.MonthJD="mmmmm",o.DaySingleDigit="d",o.DayTwoDigit="dd",o.DayWeekDayAbbreviation="aaa",o.DayWeekDayUnabbreviated="aaaa",o.HoursSingleDigit="h",o.HoursTwoDigit="hh",o.MinuteSingleDigit="m",o.MinuteTwoDigit="mm",o.SecondSingleDigit="s",o.SecondTwoDigit="ss",o.SubSecondSingleDigit=".0",o.SubSecondTwoDigit=".00",o.SubSecondThreeDigit=".000",o.EraYear="e",o.AMPMTwoDigit="AM/PM",o.AMPMSingleDigit="A/P",o.StandardYearSingleDigit="%y",o.StandardMonthSingleDigit="%M",o.StandardMonthTwoDigit="MM",o.StandardMonthAbbreviation="MMM",o.StandardMonthUnabbreviated="MMMM",o.StandardAMPMSingleDigit="tt",o.StandardMinuteSingleDigit="%m",o.StandardHourSingleDigit="H",o.StandardHourTwoDigit="HH",o.StandardSecondSingleDigit="%s",o.StandardSubSecondSingleDigit=".f",o.StandardSubSecondTwoDigit=".ff",o.StandardSubSecondThreeDigit=".fff",o.StandardDayWeekDayAbbreviation="ddd",o.StandardDayWeekDayUnabbreviated="dddd",o.PlaceholderMonthJD=i.ReplacePlaceholder+"mmmmm",o.defaultAbsoluteTime=new Date(1899,11,30,0,0,0,0),o.keyWords=[o.YearTwoDigit,o.YearFourDigit,o.MonthSingleDigit,o.MonthTwoDigit,o.MonthAbbreviation,o.MonthUnabbreviated,o.MonthJD,o.DaySingleDigit,o.DayTwoDigit,o.DayWeekDayAbbreviation,o.DayWeekDayUnabbreviated,o.HoursSingleDigit,o.HoursTwoDigit,o.MinuteSingleDigit,o.MinuteTwoDigit,o.SecondSingleDigit,o.SecondTwoDigit,"ggg","gg","g","ee","e"],o}(u),wt=function(){function n(){}return n.prototype.ConvertTo=function(n,i,r,u,f){if(u!=t&&f!=t){var e=u.GetDBNumber(f.Type());if(e!=t)return f.ReplaceNumberString(n,e,r)}return n},n}(),y=function(f){function e(e,o,s,h){var c,l,p,w,v,a,y;f.call(this,o,s,h);this.baseNumberStringConverter=u.prototype.NumberStringConverter;this.baseNumberFormatInfo=u.prototype.NumberFormatInfo;this.baseCultureName=u.prototype.CultureName;c=this;c.numberFormatString=t;c.fullFormatString=t;c.isGeneralNumber=!1;c.fractionIntegerFormat=t;c.fractionNumeratorFormat=t;c.fractionDenominatorFormat=t;c.excelFormatString=r.Empty;c._classNames.push("NumberFormatDigital");l=u.TrimNotSupportSymbol(e);c.fullFormatString=i.Filter(e,i.LeftSquareBracket,i.RightSquareBracket);c.excelFormatString=l;o&&(p=l,l=i.ReplaceKeyword(p,c.PartLocaleID().OriginalToken(),c.PartLocaleID().CurrencySymbol()));c.PartDBNumberFormat()&&(c.excelFormatString=i.ReplaceKeyword(c.excelFormatString,c.PartDBNumberFormat().OriginalToken(),c.PartDBNumberFormat().toString()));l=i.Filter(l,i.LeftSquareBracket,i.RightSquareBracket);w=l.indexOf(i.SolidusSign);w>-1&&(l=n.StringHelper.Replace(l,"\\"+i.QuestionMark,i.Zero),v=l.split(i.SolidusSign),v&&v.length===2&&(c.fractionDenominatorFormat=v[1],a=v[0],a&&(y=a.lastIndexOf(i.Space),y>-1?(c.fractionIntegerFormat=a.substr(0,y),c.fractionNumeratorFormat=a.substr(y+1,a.length-y-1)):c.fractionNumeratorFormat=a)));c.numberFormatString=l}return __extends(e,f),e.prototype.NumberStringConverter=function(n){var t=this;return arguments.length===0?t.baseNumberStringConverter()?t.baseNumberStringConverter():e.defaultNumberStringConverter:(t.baseNumberStringConverter(n),n)},e.prototype.FormatString=function(){return this.fullFormatString},e.prototype.NumberFormatInfo=function(t){var r=this;return arguments.length===0?r.baseNumberFormatInfo()?r.baseNumberFormatInfo():r.PartLocaleID()&&r.PartLocaleID().CultureInfo()?r.PartLocaleID().CultureInfo().NumberFormat():r.baseCultureName()?n._CultureInfo.getCulture(r.baseCultureName()).NumberFormat():i.NumberFormatInfo():(r.baseNumberFormatInfo(t),t)},e.prototype.IsGeneralNumber=function(n){return arguments.length===0?this.isGeneralNumber:(this.isGeneralNumber=n,n)},e.prototype.ExcelCompatibleFormatString=function(){return this.excelFormatString},e.prototype.Format=function(u){var f,l,d,o,y,it,p,a,b,ut,v,w;if(n.util.isType(u,"boolean"))return u.toString().toUpperCase();if(f=this,l=n.FormatConverter.ToDouble(u),isNaN(l)||!isFinite(l)||isNaN(u))return typeof u=="string"?u:t;if(d=f.NaNSymbol(),o=t,y=f.CultureName()?n._CultureInfo.getCulture(f.CultureName()):n._CultureInfo.currentCulture(),f.fractionNumeratorFormat&&f.fractionDenominatorFormat){var g={value:0},s={value:0},c={value:0},ft=f.fractionDenominatorFormat.length;if(e.GetFraction(l,ft,g,s,c))if(it=f.GetGCD(s.value,c.value),it>1&&(s.value/=it,c.value/=it),f.fractionIntegerFormat){if(o=new n.StringBuilder,g.value!==0&&(o.Append(new n._NumberHelper(g.value).customCultureFormat(f.fractionIntegerFormat,y)),o.Append(i.Space)),g.value===0&&l<0&&o.Append(i.NegativeSign),l===0&&o.Append("0"),p=f.fractionDenominatorFormat,a=parseFloat(p),isNaN(a)||a>0&&(s.value*=a/c.value,p=r.Empty,c.value=a,v=h(s.value),w=v-s.value,s.value=w<=.5&&w>=0?parseFloat(v.toString()):parseFloat((v-1).toString())),b=f.fractionNumeratorFormat,ut=parseFloat(b),!isNaN(ut)&&ut===0){var nt=b.length,rt=s.value.toString(),tt=rt.length;nt>tt?b=b.substr(0,nt-(nt-tt)):nt<tt&&(rt=rt.substr(0,tt-(tt-nt)),s.value=parseInt(rt,10))}return s.value!==0&&(o.Append(new n._NumberHelper(s.value).customCultureFormat(b,y).replace(/^0*/,"")),o.Append(i.SolidusSign),o.Append(new n._NumberHelper(c.value).customCultureFormat(p,y).replace(/^0*/,""))),o.toString()}else{o=new n.StringBuilder;var k=g.value*c.value+s.value,p=f.fractionDenominatorFormat,a=parseFloat(p);return a>0?(k*=a/c.value,p=r.Empty,c.value=a,v=h(k),w=v-k,k=w<=.5&&w>=0?parseFloat(v.toString()):parseFloat((v-1).toString()),o.Append(k+i.SolidusSign+c.value)):(o.Append(new n._NumberHelper(k).customCultureFormat(f.fractionNumeratorFormat,y).replace(/^0*/,"")),o.Append(i.SolidusSign),o.Append(new n._NumberHelper(c.value).customCultureFormat(f.fractionDenominatorFormat,y).replace(/^0*/,""))),o.toString()}else return l.toString()}else d=new n._NumberHelper(l).customCultureFormat(f.EncodeNumberFormat(f.numberFormatString),y),f.NumberStringConverter()&&(d=f.NumberStringConverter().ConvertTo(d,u,f.isGeneralNumber,f.PartLocaleID(),f.PartDBNumberFormat()));return d},e.prototype.Parse=function(u){var e=this,g,p,c,l,w,b,rt,tt,ut,f,y,it,k;if(u=e.TrimSpecialSymbol(u),u=e.TrimCurrencySymbol(u),!u||u===r.Empty)return t;if(n.StringHelper.EndsWith(u,i.NumberGroupSeparator))return u;if(g=v.FixJapaneseChars(u),u.toLowerCase()==="true")return!0;else if(u.toLowerCase()==="false")return!1;var s=i.IsDecimal(g,e.NumberFormatInfo()),nt=n.StringHelper.IndexOf(g,i.ExponentialSymbol,1),h=nt>-1;if(e.numberFormatString){if(p={value:0},u=e.TrimPercentSign(u,p),c=u,h&&(c=u.substr(0,nt)),c[0]===i.NumberFormatInfo().PositiveSign&&(c=c.substr(1),u=u.substr(1)),l=n.StringHelper.Replace(c,i.NumberGroupSeparator,""),w=l.indexOf(i.DecimalSeparator),w===l.lastIndexOf(i.DecimalSeparator)){if(b=new n.StringBuilder("#,##0"),w!==-1)for(b.Append("."),rt=l.length-w-1,tt=0;tt<rt;tt++)b.Append("0");ut=new d(b.toString()).Format(l);ut===c&&(u=h?l+u.substr(nt):l)}if(f=parseFloat(u),y=t,f.toString()!==u&&(it=e.NumberFormatInfo(),k=i.DecimalSeparator,it&&(k=it.NumberDecimalSeparator),s||h?s&&!h?y=new RegExp("^((\\+|-)?\\d*)"+k+"(\\d*)$","ig"):!s&&h?y=new RegExp("^((\\+|-)?\\d+)((E(\\+|-)?|e(\\+|-)?)\\d+)$","ig"):s&&h&&(y=new RegExp("^((\\+|-)?\\d*)"+k+"(\\d*)((E(\\+|-)?|e(\\+|-)?)\\d+)$","ig")):y=new RegExp("^((\\+|-)?\\d+)$","ig")),!isNaN(f)&&isFinite(f)&&(!y||y.test(u)))return p.value>0&&(f=f/parseFloat((100*p.value).toString())),f!==0&&o(f-a(f))!==0&&(s=!0),h&&(s=!0),e.ToObject(f,s)}return t},e.prototype.EncodeNumberFormat=function(t){var r,u,i;if(t){for(r=t.split(""),u=new n.StringBuilder,i=0;i<r.length-1;)r[i]==="\\"?(u.Append(r[i+1]),i+=2):(u.Append(r[i]),i++);i===r.length-1&&r[i]!=="\\"&&u.Append(r[i]);t=u.toString()}return t},e.prototype.ToObject=function(n,t){return t?n:n<=1e22?n:n},e.prototype.TrimPercentSign=function(t,u){if(u.value=0,!t||t===r.Empty)return t;var f=t,e=i.PercentSymbol,o=t.indexOf(e);return o===t.length-1&&o===t.lastIndexOf(e)&&(f=n.StringHelper.Replace(f,e,""),u.value+=(t.length-f.length)/e.length),f},e.prototype.TrimSpecialSymbol=function(t){var u,h,e,c,o,f,s;if(!t||t===r.Empty)return t;for(u=t,h=-1,e=0;e<u.length;e++)if(l.IsDigit(u[e])){h=e;break}for(c=-1,o=u.length-1;o>-1;o--)if(l.IsDigit(u[o])){c=o;break}for(f=u.length-1;f>-1;f--)if(s=u[f],this.IsSpecialSymbol(s))l.IsWhiteSpace(s)?(f<h||c<f)&&(u=n.StringHelper.Remove(u,f,1)):u=n.StringHelper.Remove(u,f,1);else if((s==="-"||s==="+")&&f>0&&u[f-1]!=="e"&&u[f-1]!=="E"&&u[f-1]!=="("&&u[f-1].toString()!==i.NumberFormatInfo().CurrencySymbol)break;return u},e.prototype.IsStandardNumberSymbol=function(n){var t=this.NumberFormatInfo()?this.NumberFormatInfo():i.NumberFormatInfo(),r;return t&&(r=n.toString(),r===t.CurrencyDecimalSeparator||r===t.CurrencyGroupSeparator||r===t.CurrencySymbol||r===t.NaNSymbol||r===t.NegativeInfinitySymbol||r===t.NegativeSign||r===t.NumberDecimalSeparator||r===t.NumberGroupSeparator||r===t.PercentDecimalSeparator||r===t.PercentGroupSeparator||r===t.PercentSymbol||r===t.PerMilleSymbol||r===t.PositiveInfinitySymbol||r===t.PositiveSign)?!0:!1},e.prototype.IsSpecialSymbol=function(n){return this.IsStandardNumberSymbol(n)?!1:l.IsWhiteSpace(n)?!0:!1},e.prototype.TrimCurrencySymbol=function(n){var t,r,u;return n?(t=this.NumberFormatInfo()?this.NumberFormatInfo():i.NumberFormatInfo(),t&&(r=t.CurrencySymbol,u=n.toString().indexOf(r),u===0&&u===n.lastIndexOf(r)&&(n=n.substr(1))),n):n},e.EvaluateFormat=function(n){return u.ContainsKeywords(n,e.keywords)},e.GetFraction=function(n,t,i,r,u){return v.GetFraction(n,t,i,r,u)},e.prototype.GetGCD=function(n,t){if(n==0)return o(t);if(t==0)return o(n);for(var r=lt(n,t),i=at(n,t),u=r%i;u!=0;)r=i,i=u,u=r%i;return o(i)},e.defaultNumberStringConverter=new wt,e.keywords=[i.Exponential1,i.Exponential2,i.NumberSign,i.DecimalSeparator,i.NumberGroupSeparator,i.PercentSymbol,i.Zero,i.SolidusSign],e}(u),f=function(f){function s(r,e,o,h){if(f.call(this,e,o,h),this.digitalFormat=t,this.exponentialDigitalFormat=t,this.fullFormatString=t,this._classNames.push("NumberFormatGeneral"),arguments.length>0)if(s.EvaluateFormat(r)){if(r.indexOf(i.Zero)>=0||r.indexOf(i.NumberSign)>=0||r.indexOf(i.DecimalSeparator)>=0||r.indexOf(i.CommercialAt)>=0)throw n.SR.Exp_FormatIllegal;this.fullFormatString=r}else throw n.SR.Exp_FormatIllegal;else this.fullFormatString=u.General}return __extends(s,f),s.prototype.DigitalFormat=function(){var n=this,t;return n.digitalFormat||(t=n.fullFormatString,t=i.ReplaceKeyword(t,u.General,s.GeneralNumber),n.digitalFormat=new y(t,n.PartLocaleID(),n.PartDBNumberFormat(),n.CultureName()),n.digitalFormat.IsGeneralNumber(!0)),n.digitalFormat},s.prototype.ExponentialDigitalFormat=function(){var n=this;return n.exponentialDigitalFormat||(n.exponentialDigitalFormat=new y("0.#####E+00",n.PartLocaleID(),n.PartDBNumberFormat(),n.CultureName()),n.exponentialDigitalFormat.IsGeneralNumber(!0)),n.exponentialDigitalFormat},s.prototype.FormatString=function(){return n.StringHelper.Replace(this.fullFormatString,s.GeneralPlaceholder,u.General)},s.prototype.Format=function(r){var f=this,h,u,s;if(n.FormatConverter.IsNumber(r)){if(h=f.PartLocaleID()?f.PartLocaleID().AllowScience():!0,u=n.FormatConverter.ToDouble(r),u!==e&&u!==t)return o(u)>99999999999&&h||o(u)<1e-11&&u!==0?f.ExponentialDigitalFormat().Format(r):f.DigitalFormat().Format(r)}else if(n.util.isType(r,"string"))return(s=n.StringHelper.Replace(f.FormatString(),'"',""),s=i.TrimEscape(s),s)?n.StringHelper.Replace(s,"General",r):r;else if(n.util.isType(r,"boolean"))return r.toString().toUpperCase();return""},s.prototype.Parse=function(u){var c,l,a,v;if(r.IsNullOrEmpty(u))return t;if(c=!1,l=n.StringHelper.IndexOf(u,"-"),l>0&&(i.IsEquals(u.charAt(l-1),i.ExponentialSymbol,!0)||(c=!0)),(n.StringHelper.Contains(u,"/")||c||n.StringHelper.Contains(u,":")||n.StringHelper.Contains(u,"-"))&&(a=n._DateTimeHelper.parseLocale(u),a))return a;var s=u,f=t,h=t;if(s.charAt(0)===i.NegativeSign?h=!0:s.charAt(0)===i.NumberFormatInfo().PositiveSign&&(h=!1),v=!1,h&&s.length>3&&s.charAt(1)===i.LeftParenthesis&&s.charAt(s.length-1)===i.RightParenthesis&&(v=!0),h&&v){if(f=this.DigitalFormat().Parse(n.StringHelper.Remove(u,0,1)),f)return n.util.isType(f,"number")?o(f)*(h?-1:1):f}else if(f=this.DigitalFormat().Parse(u),f!==e&&f!==t)return f;return u},s.GeneralMonthDay=function(){return["M/d","MMM/d","MMMM/d","d/M","d/MMM","d/MMMM","M-d","MMM-d","MMMM-d","d-M","d-MMM","d-MMMM"]},s.GeneralYearMonth=function(){return["M/y","MMM/y","M/yyyy","MMM/yyyy","M-y","MMM-y","M-yyyy","MMM-yyyy"]},s.GeneralYearMonthDay=function(){return["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"]},s.GeneralHourMinute=function(){return["H:m","h:m tt"]},s.GeneralHourMinuteWithDate=function(){return["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"]},s.GeneralHourMinuteSecond=function(){return["H:m:s","h:m:s tt","H:m:s","h:mm:ss tt"]},s.GeneralHourMinuteSecondSubSecond=function(){return["H:m:s.FFF","h:m:s.FFF tt"]},s.GeneralHourMinuteSecondWithDate=function(){return["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"]},s.GeneralHourMinuteSecondSubSecondWithDate=function(){return["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"]},s.EvaluateFormat=function(n){return!n||n===r.Empty?!1:u.ContainsKeywords(n,[u.General.toLowerCase()])},s.GeneralPlaceholder="@NumberFormat",s.GeneralNumber="##################0.################",s}(u)})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){(function(n){var bt,kt,e,y,b,h,at,k,d,vt,g,nt,p,tt,it,yt,rt,v,ut,ft,w,et,ot,r,c,st,ht,ct,o,lt,pt,wt;n.feature("conditionalFormat",["core.common","core.globalize","core.stringResource","core.theme","core.imageLoader"]);var t=null,i=undefined,s="undefined",u=Math.min,f=Math.max,l=Math.abs,a=Math.floor;(function(n){n[n.RelationCondition=0]="RelationCondition";n[n.NumberCondition=1]="NumberCondition";n[n.TextCondition=2]="TextCondition";n[n.ColorCondition=3]="ColorCondition";n[n.FormulaCondition=4]="FormulaCondition";n[n.DateCondition=5]="DateCondition";n[n.DateExCondition=6]="DateExCondition";n[n.TextLengthCondition=7]="TextLengthCondition";n[n.Top10Condition=8]="Top10Condition";n[n.UniqueCondition=9]="UniqueCondition";n[n.AverageCondition=10]="AverageCondition";n[n.CellValueCondition=11]="CellValueCondition";n[n.AreaCondition=12]="AreaCondition"})(n.ConditionType||(n.ConditionType={}));bt=n.ConditionType,function(n){n[n.ConditionRuleBase=0]="ConditionRuleBase";n[n.CellValueRule=1]="CellValueRule";n[n.SpecificTextRule=2]="SpecificTextRule";n[n.FormulaRule=3]="FormulaRule";n[n.DateOccurringRule=4]="DateOccurringRule";n[n.Top10Rule=5]="Top10Rule";n[n.UniqueRule=6]="UniqueRule";n[n.DuplicateRule=7]="DuplicateRule";n[n.AverageRule=8]="AverageRule";n[n.ScaleRule=9]="ScaleRule";n[n.TwoScaleRule=10]="TwoScaleRule";n[n.ThreeScaleRule=11]="ThreeScaleRule";n[n.DataBarRule=12]="DataBarRule";n[n.IconSetRule=13]="IconSetRule"}(n.RuleType||(n.RuleType={}));kt=n.RuleType;e=function(){function i(n){var i=this;i.condition=t;i.ranges=t;i.style=t;i._priority=1;i._stopIfTrue=!1;i.style=n}return i.prototype.hasNoReference=function(){return!(this.ranges&&this.ranges.length>0)},i.prototype.evaluate=function(n,i,r,u){var f=this,e,o;return f.contains(i,r)?(f.initCondition(),e={baseRow:0,baseCol:0},f.getBaseCoordinate(e),f.condition.adjustOffset(i-e.baseRow,r-e.baseCol),o=t,f.condition.evaluate(n,i,r,u)&&(o=f.getExpected()),f.condition.adjustOffset(0,0),o):t},i.prototype.contains=function(n,t){var r=this.ranges,u,f,i;if(r)for(u=r.length,i=0;i<u;i++)if(f=this.ranges[i],f.contains(n,t))return!0;return!1},i.prototype.createCondition=function(){},i.prototype.initCondition=function(){this.condition||(this.condition=this.createCondition())},i.prototype.priority=function(){return this._priority},i.prototype.stopIfTrue=function(n){return arguments.length===0?this._stopIfTrue:(this._stopIfTrue=n,this)},i.prototype.getExpected=function(){return this.style},i.prototype.reset=function(){var n=this;n.ranges=t;n.condition=t;n.style=t;n._stopIfTrue=!1;n._priority=1},i.prototype.intersects=function(n,t,i,r){var f=this.ranges,e,o,u;if(f)for(e=f.length,u=0;u<e;u++)if(o=f[u],o.intersect(n,t,i,r))return!0;return!1},i.prototype.isScaleRule=function(){return!1},i.prototype.getBaseCoordinate=function(n){var t,i,r;if(n.baseRow=Number.MAX_VALUE,n.baseCol=Number.MAX_VALUE,t=this,t.ranges&&t.ranges.length>0)for(i=0;i<t.ranges.length;i++)r=t.ranges[i],n.baseRow=u(r.row,n.baseRow),n.baseCol=u(r.col,n.baseCol);else n.baseRow=0,n.baseCol=0},i.prototype._addRows=function(t,i){var f=this,e,u,r;if(f.ranges)for(e=f.ranges.length,u=0;u<e;u++)r=f.ranges[u],r.row>=t?f.ranges[u]=new n.Range(r.row+i,r.col,r.rowCount,r.colCount):r.row<t&&t<r.row+r.rowCount&&(f.ranges[u]=new n.Range(r.row,r.col,r.rowCount+i,r.colCount))},i.prototype._addColumns=function(t,i){var f=this,e,u,r;if(f.ranges)for(e=f.ranges.length,u=0;u<e;u++)r=f.ranges[u],r.col>=t?f.ranges[u]=new n.Range(r.row,r.col+i,r.rowCount,r.colCount):r.col<t&&t<r.col+r.colCount&&(f.ranges[u]=new n.Range(r.row,r.col,r.rowCount,r.colCount+i))},i.prototype._removeRows=function(t,i){var f=this,o,c,e,r,s,l,h,a;if(f.ranges){for(o=[],c=f.ranges.length,e=0;e<c;e++)r=f.ranges[e],r.row>t?r.row+r.rowCount<=t+i?o.push(r):f.ranges[e]=new n.Range(r.row-i,r.col,r.rowCount,r.colCount):r.row<=t&&t<r.row+r.rowCount&&(s=new n.Range(r.row,r.col,r.rowCount-u(r.row+r.rowCount-t,i),r.colCount),s.colCount===0||s.rowCount===0?o.push(r):f.ranges[e]=s);for(l=o.length,h=0;h<l;h++)a=o[h],f.ranges.remove(a)}},i.prototype._removeColumns=function(t,i){var f=this,o,c,e,r,s,l,h,a;if(f.ranges){for(o=[],c=f.ranges.length,e=0;e<c;e++)r=f.ranges[e],r.col>t?r.col+r.colCount<=t+i?o.push(r):f.ranges[e]=new n.Range(r.row,r.col-i,r.rowCount,r.colCount):r.col<=t&&t<r.col+r.colCount&&(s=new n.Range(r.row,r.col,r.rowCount,r.colCount-u(r.col+r.colCount-t,i)),s.colCount===0||s.rowCount===0?o.push(r):f.ranges[e]=s);for(l=o.length,h=0;h<l;h++)a=o[h],f.ranges.remove(a)}},i.prototype._isDefaultValue=function(n,i){switch(n){case"ranges":return i===t;case"style":return i===t;case"priority":return i===1;case"stopIfTrue":return i===!1;default:return!1}},i.prototype.toJSON=function(){},i.prototype.fromJSON=function(n){},i}();n.ConditionRuleBase=e;y=function(){function n(n,i,r){var u=this;u.conditionType="RelationCondition";u.compareType=1;u.item1=t;u.item2=t;u.ignoreBlank=!1;u._dict=t;u.compareType=n;u.item1=i;u.item2=r}return n.prototype.adjustOffset=function(n,t){},n.prototype.create=function(t,i,r){return new n(t,i,r)},n.prototype._getActualValue=function(n,t,i,r,u){if(n&&t&&t.conditionType==="ColorCondition"){var f=n.getActualStyle(i,r);f&&(t.compareType===0?u=f.backColor:t.compareType===1&&(u=f.foreColor))}return u},n.prototype.evaluate=function(n,r,u,f,e){var o=this,h,c,s;if(o.item1&&(o.item1.ignoreBlank=o.ignoreBlank,h=arguments.length<5?o._getActualValue(n,o.item1,r,u,f):f),o.item2&&(o.item2.ignoreBlank=o.ignoreBlank,c=arguments.length<5?o._getActualValue(n,o.item2,r,u,f):e),o.compareType===1)return(s=o.item1===i||o.item1===t?!1:o.item1.evaluate(n,r,u,h),!s)?!1:o.item2===i||o.item2===t?!1:o.item2.evaluate(n,r,u,c);else if(o.compareType===0)return(s=o.item1===i||o.item1===t?!1:o.item1.evaluate(n,r,u,h),s)?!0:o.item2===i||o.item2===t?!1:o.item2.evaluate(n,r,u,c);return!1},n.prototype.reset=function(){var n=this;n.ignoreBlank=!1;n.compareType=1;n.item1=t;n.item2=t},n.prototype._getConditionTypeDictionary=function(){if(!this._dict){var t={};t[0]=n;t[1]=at;t[2]=d;t[3]=vt;t[4]=nt;t[5]=p;t[6]=it;t[7]=yt;t[8]=v;t[9]=w;t[10]=ot;t[11]=h;t[12]=pt;this._dict=t}return this._dict},n.prototype.toJSON=function(){var n=this,e={compareType:n.compareType,item1:n.item1?n.item1.toJSON():t,item2:n.item2?n.item2.toJSON():t,conType:0,ignoreBlank:n.ignoreBlank},u={},r,f;for(r in e)f=e[r],n._isDefaultValue(r,f)||(u[r]=f);return $.isEmptyObject(u)?i:u},n.prototype._isDefaultValue=function(n,i){switch(n){case"ignoreBlank":return i===!1;case"item1":return i===t;case"item2":return i===t;default:return!1}},n.prototype.fromJSON=function(n){var r,f;if(n){if(r=this,n.compareType!==t&&n.compareType!==i&&(r.compareType=n.compareType),n.item1!==t&&n.item1!==i){var u=t,h=r._getConditionTypeDictionary(),e=n.item1.conType;typeof e===s&&(e=0);f=h[e];f&&(u=new f,u.fromJSON(n.item1));r.item1=u}if(n.item2!==t&&n.item2!==i){var u=t,h=r._getConditionTypeDictionary(),o=n.item2.conType;typeof o===s&&(o=0);f=h[o];f&&(u=new f,u.fromJSON(n.item2));r.item2=u}n.ignoreBlank!==t&&n.ignoreBlank!==i&&(r.ignoreBlank=n.ignoreBlank)}},n}();n.RelationCondition=y;b=function(r){function u(n,t,i,u){r.call(this,u);this.operator=n;this.value1=typeof t=="string"?$.trim(t):t;this.value2=typeof i=="string"?$.trim(i):i}return __extends(u,r),u.prototype.createCondition=function(){var n=this,e=n.isFormula(n.value1)?n.value1.replace("=",""):t,c=n.isFormula(n.value1)?t:n.value1,s=n.isFormula(n.value2)?n.value2.replace("=",""):t,l=n.isFormula(n.value2)?t:n.value2,u,f,i=n.operator,r=t,o;if(i===6)return u=new h(3,n.value1,e),u.treatNullValueAsZero=!0,f=new h(5,n.value2,s),f.treatNullValueAsZero=!0,new y(1,u,f);else if(i===7)return u=new h(4,n.value1,e),u.treatNullValueAsZero=!0,f=new h(2,n.value2,s),f.treatNullValueAsZero=!0,new y(0,u,f);else i===0?r=0:i===2?r=2:i===3?r=3:i===4?r=4:i===5?r=5:i===1&&(r=1);return r!==t?(o=new h(r,n.value1,e),o.treatNullValueAsZero=!0,o):t},u.prototype.reset=function(){var n=this;n.operator=6;n.value1=t;n.value2=t;n.style=t;n._stopIfTrue=!1;n._priority=1},u.prototype.isFormula=function(n){return n!==i&&n!==t&&n[0]==="="},u.prototype.toJSON=function(){var n=this,f={ruleType:1,ranges:n.ranges,style:n.style,operator:n.operator,value1:n.value1,value2:n.value2,priority:n._priority,stopIfTrue:n._stopIfTrue},r={},t,u;for(t in f)u=f[t],n._isDefaultValue(t,u)||(r[t]=u);return $.isEmptyObject(r)?i:r},u.prototype.fromJSON=function(r){var u,e,f;if(r){if(u=this,r.ranges)for(u.ranges=[],e=0;e<r.ranges.length;e++)f=r.ranges[e],u.ranges.push(new n.Range(f.row,f.col,f.rowCount,f.colCount));r.style&&(u.style=new n.Style,u.style.copyFrom(r.style));r.operator!==t&&r.operator!==i&&(u.operator=r.operator);r.value1!==t&&r.value1!==i&&(u.value1=r.value1);r.value2!==t&&r.value2!==i&&(u.value2=r.value2);r.priority!==t&&r.priority!==i&&(u._priority=r.priority);r.stopIfTrue!==t&&r.stopIfTrue!==i&&(u._stopIfTrue=r.stopIfTrue)}},u}(e);n.CellValueRule=b;h=function(){function r(n,i,r){var u=this;u.compareType=t;u.treatNullValueAsZero=!1;u.compareType=n;u.expected=i;u.formula=r}return r.prototype.adjustOffset=function(n,t){},r.prototype.getExpected=function(n,t,i,r){var u=this,f,e;return u.formula&&u.formula.length>0?(f=n.getCalcService(),!f)?u.expected:(e=f.parse(u.formula,t,i),f.evaluateParsedFormula(n._getSheetSource(),e,t,i)):u.expected},r.prototype.evaluate=function(n,t,i,r){var u=this.getExpected(n,t,i);return this.checkCondition(u,r)},r.prototype.isSatisfyingCondition=function(n){var i=this.getExpected(t,0,0);return this.checkCondition(i,n)},r.prototype.checkCondition=function(r,u){var f=this,e=0,c=!1,a,o,v,l,s,h;if(typeof r=="boolean"){a=r;switch(f.compareType){case 0:return u===r;case 1:return u!==r;case 2:return f._compareBool(a,u)<0;case 3:return f._compareBool(a,u)<=0;case 4:return f._compareBool(a,u)>0;case 5:return!!f._compareBool(a,u);default:break}}try{u===i||u===t?f.treatNullValueAsZero?(c=!0,e=0):(c=!1,e=u):(l={value:undefined},n.Calc.Convert.tryToDouble(u,l)?(e=l.value,c=!isNaN(e)):c=!1)}catch(y){c=!1}if((u===i||u===t)&&(r===i||r===t))switch(f.compareType){case 0:case 3:case 5:return!0;case 1:case 2:case 4:return!1;default:return!1}if(c){o=0;v=!1;try{l={value:undefined};n.Calc.Convert.tryToDouble(r,l)&&(o=l.value,v=!0)}catch(p){}if(!v){switch(f.compareType){case 0:return!1;case 1:return!0}return!1}switch(f.compareType){case 0:return e===o;case 1:return e!==o;case 2:return e>o;case 3:return e>=o;case 4:return e<o;case 5:return e<=o}}else if(typeof u=="string"){if(s=t,typeof r=="string")s=r;else{switch(f.compareType){case 0:return!1;case 1:return!0}return!1}h=u;switch(f.compareType){case 0:return h===s;case 1:return h!==s;case 2:return s<h;case 3:return s<=h;case 4:return s>h;case 5:return s>=h}}return!1},r.prototype._compareBool=function(n,t){return n===t?0:n===!1&&t===!0?-1:1},r.prototype._isDefaultValue=function(n,t){switch(n){case"treatNullValueAsZero":return t===!1;default:return!1}},r.prototype.toJSON=function(){var n=this,f={compareType:n.compareType,expected:n.expected,formula:n.formula,conType:11,treatNullValueAsZero:n.treatNullValueAsZero},r={},t,u;for(t in f)u=f[t],n._isDefaultValue(t,u)||(r[t]=u);return $.isEmptyObject(r)?i:r},r.prototype.fromJSON=function(n){if(n){var r=this;n.compareType!==t&&n.compareType!==i&&(r.compareType=n.compareType);n.expected!==t&&n.expected!==i&&(r.expected=n.expected);n.formula!==t&&n.formula!==i&&(r.formula=n.formula);n.treatNullValueAsZero!==t&&n.treatNullValueAsZero!==i&&(r.treatNullValueAsZero=n.treatNullValueAsZero)}},r}();n.CellValueCondition=h;at=function(){function n(n,t,i){var r=this;r.compareType=0;r.conditionType="NumberCondition";r.ignoreBlank=!1;r.integerValue=!1;r.compareType=n;r.expected=t;r.formula=typeof i=="string"?$.trim(i).replace("=",""):i}return n.prototype.evaluate=function(n,i,r,u){var f=this.getExpected(n,i,r);return this.integerValue&&(f=isNaN(f)?t:parseInt(f,10)),this.checkCondition(f,u)},n.prototype.checkCondition=function(n,r){var f=this,u,e;if((r===i||r===t||r==="")&&f.ignoreBlank)return!0;if(isNaN(r))return!1;if(n===i||n===t)if(f.ignoreBlank)return!0;else n=0;u=0;try{u=parseFloat(r)}catch(o){return!1}if(f.integerValue===!0&&(e=u-a(u)==0,e===!1))return!1;switch(f.compareType){case 0:return u===n;case 1:return u!==n;case 2:return u>n;case 3:return u>=n;case 4:return u<n;case 5:return u<=n}return!1},n.prototype.getExpected=function(n,t,i){var r=this,u;return r.formula&&r.formula.length>0?(u=n.getCalcService(),!u)?r.expected:u.evaluate(n._getSheetSource(),r.formula,t,i):r.expected},n.prototype.reset=function(){var n=this;n.expected=t;n.ignoreBlank=!1;n.compareType=0;n.integerValue=!1},n.prototype._isDefaultValue=function(n,t){switch(n){case"ignoreBlank":return t===!1;case"integerValue":return t===!1;default:return!1}},n.prototype.toJSON=function(){var n=this,f={compareType:n.compareType,expected:n.expected,formula:n.formula,conType:1,ignoreBlank:n.ignoreBlank,integerValue:n.integerValue},r={},t,u;for(t in f)u=f[t],n._isDefaultValue(t,u)||(r[t]=u);return $.isEmptyObject(r)?i:r},n.prototype.fromJSON=function(n){if(n){var r=this;n.compareType!==t&&n.compareType!==i&&(r.compareType=n.compareType);n.expected!==t&&n.expected!==i&&(r.expected=n.expected);n.formula!==t&&n.formula!==i&&(r.formula=n.formula);n.ignoreBlank!==t&&n.ignoreBlank!==i&&(r.ignoreBlank=n.ignoreBlank);n.integerValue!==t&&n.integerValue!==i&&(r.integerValue=n.integerValue)}},n}();n.NumberCondition=at;k=function(r){function u(n,t,i){r.call(this,i);this.text=t;this.operator=n}return __extends(u,r),u.prototype.createCondition=function(){var n,i;switch(this.operator){case 2:n=2;break;case 3:n=4;break;case 0:n=6;break;case 1:n=7;break;default:n=0;break}return i=new d(n,this.text,t),i.ignoreCase=!0,i},u.prototype.reset=function(){var n=this;n.operator=0;n.text="";n.style=t;n._stopIfTrue=!1;n._priority=1},u.prototype.toJSON=function(){var n=this,f={ruleType:2,ranges:n.ranges,style:n.style,operator:n.operator,text:n.text,priority:n._priority,stopIfTrue:n._stopIfTrue},r={},t,u;for(t in f)u=f[t],n._isDefaultValue(t,u)||(r[t]=u);return $.isEmptyObject(r)?i:r},u.prototype.fromJSON=function(r){var u,e,f;if(r){if(u=this,r.ranges)for(u.ranges=[],e=0;e<r.ranges.length;e++)f=r.ranges[e],u.ranges.push(new n.Range(f.row,f.col,f.rowCount,f.colCount));r.style&&(u.style=new n.Style,u.style.copyFrom(r.style));r.operator!==t&&r.operator!==i&&(u.operator=r.operator);r.text!==t&&r.text!==i&&(u.text=r.text);r.priority!==t&&r.priority!==i&&(u._priority=r.priority);r.stopIfTrue!==t&&r.stopIfTrue!==i&&(u._stopIfTrue=r.stopIfTrue)}},u}(e);n.SpecificTextRule=k;d=function(){function n(n,i,r){var u=this;u.forceValue2Text=!1;u.useWildCards=!0;u.regex=t;u.ignoreCase=!1;u.conditionType="TextCondition";u.questionMarkWildcard="?";u.questionMarkWildcardRegularExpression=".";u.asteriskWildcard="*";u.asteriskWildcardRegularExpression="[.\n]*";u.ignoreBlank=!1;u.compareType=n;u.expected=i;u.formula=typeof r=="string"?$.trim(r).replace("=",""):r}return n.prototype.adjustOffset=function(n,t){},n.prototype.evaluate=function(n,r,u,f){var e=this,o=t,s;if(e.forceValue2Text===!0||typeof f=="string"||typeof f=="number")o=f!==i&&f!==t?f.toString():"";else{if(f instanceof Date)return e.compareType===2||e.compareType===4||e.compareType===6?!1:e.compareType===3||e.compareType===5||e.compareType===7;o=f!==i&&f!==t?f.toString():""}if(e.ignoreBlank&&(o===i||o===t||o===""))return!0;if(s=e.getExpectedString(n,r,u),e.hasWildcard(s)&&typeof f=="number")return e.compareType===3||e.compareType===7||e.compareType===5||e.compareType===1;switch(e.compareType){case 0:return e.isEquals(s,o);case 1:return!e.isEquals(s,o);case 2:return e.isStartWith(s,o);case 3:return!e.isStartWith(s,o);case 4:return e.isEndWith(s,o);case 5:return!e.isEndWith(s,o);case 6:return e.isContains(s,o);case 7:return!e.isContains(s,o)}return!1},n.prototype.getExpectedString=function(n,r,u){var f=this.getExpected(n,r,u);return f===i||f===t?t:f.toString()},n.prototype.getExpected=function(n,t,i){var r=this,u,f;return r.formula&&r.formula.length>0?(u=n.getCalcService(),!u)?r.expected:(f=u.parse(r.formula,t,i),u.evaluateParsedFormula(n._getSheetSource(),f,t,i)):r.expected},n.prototype.hasWildcard=function(n){return n===i||n===t||n===""?!1:n.indexOf(this.asteriskWildcard)>-1||n.indexOf(this.questionMarkWildcard)>-1},n.prototype.isEquals=function(n,r){var u=this,f,e,o;return u.useWildCards&&u.hasWildcard(n)?(f=u.createEqualsRegex(n),f&&(e=r===i&&r===t?"":r,f.lastIndex=-1,e!==i&&e!==t))?e.search(f)>-1:!1:r!==i&&r!==t&&r!==""?(o=n!==i&&n!==t?n:"",u.ignoreCase?o.toLowerCase()===r.toLowerCase():o===r):n===i||n===t||n===""},n.prototype.createEqualsRegex=function(n){var i=this,r,u,f,e;if(i.regex)return i.regex;n=i.encodeExpression(n);r=n;u=new RegExp("\\"+i.questionMarkWildcard,"g");r=r.replace(u,i.questionMarkWildcardRegularExpression);u=new RegExp("\\"+i.asteriskWildcard,"g");r=r.replace(u,i.asteriskWildcardRegularExpression);f=t;try{e=i.ignoreCase?"ig":"g";f=new RegExp("^"+r+"$",e)}catch(o){return t}return f},n.prototype.encodeExpression=function(n){if(!n)return t;var i=n;return i=i.replace(/\^/g,"\\^"),i=i.replace(/\$/g,"\\$"),i=i.replace(/\(/g,"\\("),i=i.replace(/\)/g,"\\)"),i=i.replace(/\[/g,"\\["),i=i.replace(/\]/g,"\\]"),i=i.replace(/\{/g,"\\{"),i=i.replace(/\}/g,"\\}"),i=i.replace(/\./g,"\\."),i=i.replace(/\+/g,"\\+"),i.replace(/\|/g,"\\|")},n.prototype.isStartWith=function(n,r){var o=this,u,s,f,e;return o.useWildCards&&o.hasWildcard(n)?(s=o.createStartWithRegex(n),s&&(u=r===i||r===t?"":r,s.lastIndex=-1,u!==i&&u!==t))?u.search(s)>-1:!1:r!==i&&r!==t&&r!==""?n===i||n===t?!1:(f=n,u=r,o.ignoreCase&&(f=f.toLowerCase(),u=u.toLowerCase()),e=u.match("^"+f),e!==i&&e!==t&&e.length>0?e[0]===f:!1):n===i||n===t||n===""},n.prototype.createStartWithRegex=function(n){var i=this,r,u,f,e;if(i.regex)return i.regex;n=i.encodeExpression(n);r=n;u=new RegExp("\\"+i.questionMarkWildcard,"g");r=r.replace(u,i.questionMarkWildcardRegularExpression);u=new RegExp("\\"+i.asteriskWildcard,"g");r=r.replace(u,i.asteriskWildcardRegularExpression);f=t;try{e=i.ignoreCase?"ig":"g";f=n[0]===i.asteriskWildcard?new RegExp(r,e):new RegExp("^"+r,e)}catch(o){return t}return f},n.prototype.isEndWith=function(n,r){var o=this,u,s,f,e;return o.useWildCards&&o.hasWildcard(n)?(s=o.createEndWithRegex(n),s&&(u=r===i||r===t?"":r,s.lastIndex=-1,u!==i&&u!==t))?u.search(s)>-1:!1:r!==i&&r!==t&&r!==""?n===i||n===t?!1:(f=n,u=r,o.ignoreCase&&(f=f.toLowerCase(),u=u.toLowerCase()),e=u.match(f+"$"),e!==i&&e!==t&&e.length>0?e[0]===f:!1):n===i||n===t||n===""},n.prototype.createEndWithRegex=function(n){var i=this,r,u,f,e;if(i.regex)return i.regex;n=i.encodeExpression(n);r=n;u=new RegExp("\\"+i.questionMarkWildcard,"g");r=r.replace(u,i.questionMarkWildcardRegularExpression);u=new RegExp("\\"+i.asteriskWildcard,"g");r=r.replace(u,i.asteriskWildcardRegularExpression);f=t;try{e=i.ignoreCase?"ig":"g";f=n[n.length-1]===i.asteriskWildcard?new RegExp(r,e):new RegExp(r+"$",e)}catch(o){return t}return f},n.prototype.isContains=function(n,r){var f=this,u,e,o;return f.useWildCards&&f.hasWildcard(n)?(e=f.createContainsRegex(n),e&&(u=r===i||r===t?"":r,e.lastIndex=-1,u!==i&&u!==t))?u.search(e)>-1:!1:r!==i&&r!==t&&r!==""?n===i||n===t?!1:(o=n,u=r,f.ignoreCase&&(o=o.toLowerCase(),u=u.toLowerCase()),u.indexOf(o)>-1):n===i||n===t||n===""},n.prototype.createContainsRegex=function(n){var i=this,r,u,f,e;if(i.regex)return i.regex;n=i.encodeExpression(n);r=n;u=new RegExp("\\"+i.questionMarkWildcard,"g");r=r.replace(u,i.questionMarkWildcardRegularExpression);u=new RegExp("\\"+i.asteriskWildcard,"g");r=r.replace(u,i.asteriskWildcardRegularExpression);f=t;try{e=i.ignoreCase?"ig":"g";f=new RegExp(r,e)}catch(o){return t}return f},n.prototype.reset=function(){var n=this;n.expected=t;n.ignoreBlank=!1;n.compareType=0;n.useWildCards=!0;n.ignoreCase=!1;n.forceValue2Text=!1},n.prototype._isDefaultValue=function(n,i){switch(n){case"forceValue2Text":return i===!1;case"useWildCards":return i===!0;case"ignoreCase":return i===!1;case"regex":return i===t;case"ignoreBlank":return i===!1;default:return!1}},n.prototype.toJSON=function(){var n=this,r={compareType:n.compareType,expected:n.expected,formula:n.formula,forceValue2Text:n.forceValue2Text,useWildCards:n.useWildCards,ignoreCase:n.ignoreCase,regex:n.regex,conType:2,ignoreBlank:n.ignoreBlank},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},n.prototype.fromJSON=function(n){if(n){var r=this;n.compareType!==t&&n.compareType!==i&&(r.compareType=n.compareType);n.expected!==t&&n.expected!==i&&(r.expected=n.expected);n.formula!==t&&n.formula!==i&&(r.formula=n.formula);n.forceValue2Text!==t&&n.forceValue2Text!==i&&(r.forceValue2Text=n.forceValue2Text);n.useWildCards!==t&&n.useWildCards!==i&&(r.useWildCards=n.useWildCards);n.ignoreCase!==t&&n.ignoreCase!==i&&(r.ignoreCase=n.ignoreCase);n.regex!==t&&n.regex!==i&&(r.regex=n.regex);n.ignoreBlank!==t&&n.ignoreBlank!==i&&(r.ignoreBlank=n.ignoreBlank)}},n}();n.TextCondition=d;vt=function(){function r(n,t){this.conditionType="ColorCondition";this.ignoreBlank=!1;this.compareType=n;this.expected=t}return r.prototype.evaluate=function(n,t,i,r){return this.isEqualsColor(n,r)},r.prototype.isEqualsColor=function(n,r){var o=this,u=o.getColorFromString(o.expected),f,e;if(u!==i&&u!==t&&u!==""){if(f=o.getColorFromString(r),f!==i&&f!==t&&f!=="")return f.a===u.a&&f.r===u.r&&f.g===u.g&&f.b===u.b;else if(o.compareType===0?n&&n.getDefaultStyle&&(e=n.getDefaultStyle().backColor):o.compareType===1&&n&&n.getDefaultStyle&&(e=n.getDefaultStyle().foreColor),e)return u.a===e.a&&u.r===e.r&&u.g===e.g&&u.b===e.b}else if(o.ignoreBlank)return!0;return!1},r.prototype.getColorFromString=function(r){return r===i||r===t||r===""?t:n._Color.parse(r)},r.prototype.reset=function(){this.expected=t;this.ignoreBlank=!1;this.compareType=0},r.prototype._isDefaultValue=function(n,t){switch(n){case"ignoreBlank":return t===!1;default:return!1}},r.prototype.toJSON=function(){var n=this,r={compareType:n.compareType,expected:n.expected,conType:3,ignoreBlank:n.ignoreBlank},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},r.prototype.fromJSON=function(n){n&&(n.compareType!==t&&n.compareType!==i&&(this.compareType=n.compareType),n.expected!==t&&n.expected!==i&&(this.expected=n.expected),n.ignoreBlank!==t&&n.ignoreBlank!==i&&(this.ignoreBlank=n.ignoreBlank))},r}();n.ColorCondition=vt;g=function(r){function u(t,i){if(r.call(this,i),t&&typeof t!="string")throw new Error(n.SR.Exp_InvalidArgument);this.formula=t}return __extends(u,r),u.prototype.createCondition=function(){var n=this,i=new nt(4,!n.formula||n.formula===""?t:n.formula);return n.ranges&&n.ranges.length>0&&(i._baseRow=n.ranges[0].row,i._baseCol=n.ranges[0].col),i},u.prototype.reset=function(){var n=this;n.formula=t;n.style=t;n._stopIfTrue=!1;n._priority=1},u.prototype.isFormula=function(n){return n&&n[0]==="="},u.prototype.toJSON=function(){var n=this,r={ruleType:3,ranges:n.ranges,style:n.style,formula:n.formula,priority:n._priority,stopIfTrue:n._stopIfTrue},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},u.prototype.fromJSON=function(r){var u,e,f;if(r){if(u=this,r.ranges)for(u.ranges=[],e=0;e<r.ranges.length;e++)f=r.ranges[e],u.ranges.push(new n.Range(f.row,f.col,f.rowCount,f.colCount));r.style&&(u.style=new n.Style,u.style.copyFrom(r.style));r.formula!==t&&r.formula!==i&&(u.formula=r.formula);r.priority!==t&&r.priority!==i&&(u._priority=r.priority);r.stopIfTrue!==t&&r.stopIfTrue!==i&&(u._stopIfTrue=r.stopIfTrue)}},u}(e);n.FormulaRule=g;nt=function(){function r(n,i){var r=this,u,f;r.expected=t;r.ignoreBlank=!1;r.conditionType="FormulaCondition";r._baseRow=t;r._baseCol=t;r._expr=t;r.customValueType=n;u=i;typeof u=="string"&&(f=$.trim(u),u=f[0]==="="?f.substr(1):f);r.formula=u}return r.prototype.adjustOffset=function(n,t){},r.prototype.evaluate=function(r,u,f,e){var o,s,h;if(!n.util.hasCalc())return!1;if(o=this,o.customValueType===4){if(s=o.getExpected(r,u,f),o.ignoreBlank&&(s===i||s===t||s===""))return!0;try{return n.Calc.Convert.toBool(s)}catch(c){return!1}}else{h=n.Calc.Convert.isError;switch(o.customValueType){case 0:return e===i||e===t||e==="";case 1:return e!==i&&e!==t&&e!=="";case 2:return h(e);case 3:return!h(e)}}return!1},r.prototype.getExpected=function(r,u,f){var e=this,v,o,l,a,c,s,h,y,p;if(e.formula&&e.formula.length>0){if(v=r.getCalcService(),!v)return e.expected;if(e._expr||((e._baseRow===i||e._baseRow===t)&&(e._baseCol===i||e._baseCol===t)&&(e._baseRow=u,e._baseCol=f),e._expr=v.parse(e.formula,e._baseRow,e._baseCol)),o=v.evaluateParsedFormula(r._getSheetSource(),e._expr,u,f,!0),o instanceof n.Calc.Reference){for(l=o.getRowCount(0),a=o.getColumnCount(0),c=[],s=0;s<l;s++)for(c[s]=[],h=0;h<a;h++)c[s][h]=o.getValue(0,s,h);o=c}else if(o instanceof n.Calc.Array){for(l=o.getRowCount(),a=o.getColumnCount(),c=[],s=0;s<l;s++)for(c[s]=[],h=0;h<a;h++)c[s][h]=o.getValue(s,h);o=c}return o instanceof Array?(l=o.length,a=o[0].length,l===1&&a===1)?o[0][0]:(y=u-e._baseRow,p=f-e._baseCol,y<l&&p<a?o[y][p]:n.Calc.Errors.NotAvailable):o}else return e.expected},r.prototype.reset=function(){var n=this;n.expected=t;n.ignoreBlank=!1;n.customValueType=0;n._expr=t;n._baseRow=t;n._baseCol=t},r.prototype._isDefaultValue=function(n,i){switch(n){case"expected":return i===t;case"ignoreBlank":return i===!1;default:return!1}},r.prototype.toJSON=function(){var n=this,r={customValueType:n.customValueType,expected:n.expected,formula:n.formula,conType:4,ignoreBlank:n.ignoreBlank},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},r.prototype.fromJSON=function(n){if(n){var r=this;n.customValueType!==t&&n.customValueType!==i&&(r.customValueType=n.customValueType);n.expected!==t&&n.expected!==i&&(r.expected=n.expected);n.formula!==t&&n.formula!==i&&(r.formula=n.formula);n.ignoreBlank!==t&&n.ignoreBlank!==i&&(r.ignoreBlank=n.ignoreBlank)}},r}();n.FormulaCondition=nt;p=function(){function r(n,t,i){var r=this;r.conditionType="DateCondition";r.ignoreBlank=!1;r.compareType=n;r.expected=t;r.formula=typeof i=="string"?$.trim(i).replace("=",""):i}return r.prototype.evaluate=function(n,r,u,f){var e=this,o;if((f===i||f===t||f==="")&&e.ignoreBlank)return!0;if(!(f instanceof Date))return!1;if(o=e.getExpectedDateTime(n,r,u),o===i||o===t)return!!e.ignoreBlank;switch(e.compareType){case 0:return e.isEquals(o,f);case 1:return!e.isEquals(o,f);case 4:return e.isAfter(o,f);case 5:return e.isAfter(o,f)||e.isEquals(o,f);case 2:return e.isBefore(o,f);case 3:return e.isBefore(o,f)||e.isEquals(o,f)}return!1},r.prototype.getExpectedDateTime=function(i,r,u){var f=this.getExpected(i,r,u);if(f instanceof Date)return f;else if(typeof f=="string")return n._DateTimeHelper.parseLocale(f);return t},r.prototype.getExpected=function(n,t,i){var r=this,u,f;return r.formula&&r.formula.length>0?(u=n.getCalcService(),!u)?r.expected:(f=u.parse(r.formula,t,i),u.evaluateParsedFormula(n._getSheetSource(),f,t,i)):r.expected},r.prototype.isEquals=function(n,t){return n.getYear()===t.getYear()&&n.getMonth()===t.getMonth()&&n.getDate()===t.getDate()},r.prototype.isAfter=function(n,t){var i=this.createDayEnding(n);return t>i},r.prototype.createDayEnding=function(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59,999)},r.prototype.isBefore=function(n,t){var i=this.createDayBeginning(n);return t<i},r.prototype.createDayBeginning=function(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0)},r.prototype.reset=function(){this.expected=t;this.ignoreBlank=!1;this.compareType=0},r.prototype._isDefaultValue=function(n,t){switch(n){case"ignoreBlank":return t===!1;default:return!1}},r.prototype.toJSON=function(){var n=this,r={compareType:n.compareType,expected:n.expected,formula:n.formula,conType:5,ignoreBlank:n.ignoreBlank},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},r.prototype.fromJSON=function(n){if(n){var r=this;n.compareType!==t&&n.compareType!==i&&(r.compareType=n.compareType);n.expected!==t&&n.expected!==i&&(r.expected=$.type(n.expected)==="string"?new Date(n.expected):n.expected);n.formula!==t&&n.formula!==i&&(r.formula=n.formula);n.ignoreBlank!==t&&n.ignoreBlank!==i&&(r.ignoreBlank=n.ignoreBlank)}},r}();n.DateCondition=p;tt=function(r){function u(n,t){r.call(this,t);this.type=n}return __extends(u,r),u.prototype.createCondition=function(){return new it(this.type)},u.prototype.reset=function(){var n=this;n.type=0;n.style=t;n._stopIfTrue=!1;n._priority=1},u.prototype.toJSON=function(){var n=this,r={ruleType:4,ranges:n.ranges,style:n.style,type:n.type,priority:n._priority,stopIfTrue:n._stopIfTrue},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},u.prototype.fromJSON=function(r){var u,e,f;if(r){if(u=this,r.ranges)for(u.ranges=[],e=0;e<r.ranges.length;e++)f=r.ranges[e],u.ranges.push(new n.Range(f.row,f.col,f.rowCount,f.colCount));r.style&&(u.style=new n.Style,u.style.copyFrom(r.style));r.type!==t&&r.type!==i&&(u.type=r.type);r.priority!==t&&r.priority!==i&&(u._priority=r.priority);r.stopIfTrue!==t&&r.stopIfTrue!==i&&(u._stopIfTrue=r.stopIfTrue)}},u}(e);n.DateOccurringRule=tt;it=function(){function r(n){var i=this;i.ignoreBlank=!1;i.formula=t;i.expectTypeId=0;i.conditionType="DateExCondition";i.expected=n}return r.prototype.adjustOffset=function(n,t){},r.prototype.evaluate=function(n,r,u,f){var e=this.getExpectedInt(n,r,u);return e!==i&&e!==t?this.checkCondition(e,f):!1},r.prototype.getExpectedInt=function(n,i,r){var u=this.getExpected(n,i,r);return u=parseInt(u,10),isNaN(u)?t:u},r.prototype.getExpected=function(n,t,i){var r=this,u,f;return r.formula&&r.formula.length>0?(u=n.getCalcService(),!u)?r.expected:(f=u.parse(r.formula,t,i),u.evaluateParsedFormula(n._getSheetSource(),f,t,i)):r.expected},r.prototype.checkCondition=function(r,u){var s=this,l=u,o,k,d,g,nt,tt,it,w,rt,ut,a,b,v;if(s.ignoreBlank&&(l===i||l===t||l===""))return!0;try{l=n.Calc.Convert.toDateTime(l)}catch(st){return!1}if(s.expectTypeId===0){var h=t,c=t,e=new Date,f=new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());switch(r){case 3:f.setDate(f.getDate()-6);h=new Date(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0,0);c=new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59,999);break;case 1:f.setDate(f.getDate()-1);h=new Date(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0,0);c=new Date(f.getFullYear(),f.getMonth(),f.getDate(),23,59,59,999);break;case 0:h=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0);c=new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59,999);break;case 2:f.setDate(f.getDate()+1);h=new Date(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0,0);c=new Date(f.getFullYear(),f.getMonth(),f.getDate(),23,59,59,999);break;case 8:k=e;k.setDate(e.getDate()-e.getDay()-7);d=f;d.setDate(f.getDate()-f.getDay()-1);h=new Date(k.getFullYear(),k.getMonth(),k.getDate(),0,0,0,0);c=new Date(d.getFullYear(),d.getMonth(),d.getDate(),23,59,59,999);break;case 7:g=e;g.setDate(e.getDate()-e.getDay());nt=f;nt.setDate(f.getDate()-f.getDay()+6);h=new Date(g.getFullYear(),g.getMonth(),g.getDate(),0,0,0,0);c=new Date(nt.getFullYear(),nt.getMonth(),nt.getDate(),23,59,59,999);break;case 9:tt=e;tt.setDate(e.getDate()-e.getDay()+7);it=f;it.setDate(f.getDate()-f.getDay()+13);h=new Date(tt.getFullYear(),tt.getMonth(),tt.getDate(),0,0,0,0);c=new Date(it.getFullYear(),it.getMonth(),it.getDate(),23,59,59,999);break;case 5:w=e;w.setDate(1);w.setMonth(e.getMonth()-1);rt=f;rt.setDate(0);h=new Date(w.getFullYear(),w.getMonth(),w.getDate(),0,0,0,0);c=new Date(rt.getFullYear(),rt.getMonth(),rt.getDate(),23,59,59,999);break;case 4:ut=e;ut.setDate(1);a=f;a.setDate(1);a.setMonth(f.getMonth()+1);a.setDate(0);h=new Date(ut.getFullYear(),ut.getMonth(),ut.getDate(),0,0,0,0);c=new Date(a.getFullYear(),a.getMonth(),a.getDate(),23,59,59,999);break;case 6:b=e;b.setDate(1);b.setMonth(e.getMonth()+1);v=f;v.setDate(1);v.setMonth(f.getMonth()+2);v.setDate(0);h=new Date(b.getFullYear(),b.getMonth(),b.getDate(),0,0,0,0);c=new Date(v.getFullYear(),v.getMonth(),v.getDate(),23,59,59,999);break}if(h!==i&&h!==t&&c!==i&&c!==t){var ft=new p(5,h,t),et=new p(3,c,t),ot=new y(1,ft,et);return ot.evaluate(t,0,0,l)}}else if(s.expectTypeId===1){if(o=s.getExpectedInt(t,0,0),o!==i&&o!==t)return s.isEqualsYear(o,l)}else if(s.expectTypeId===2){if(o=s.getExpectedInt(t,0,0),o!==i&&o!==t)return s.isEqualsQuarter(o,l)}else if(s.expectTypeId===3){if(o=s.getExpectedInt(t,0,0),o!==i&&o!==t)return s.isEqualsMonth(o,l)}else if(s.expectTypeId===4){if(o=s.getExpectedInt(t,0,0),o!==i&&o!==t)return s.isEqualsWeek(o,l)}else if(s.expectTypeId===5&&(o=s.getExpectedInt(t,0,0),o!==i&&o!==t))return s.isEqualsDay(o,l);return!1},r.prototype.isEqualsYear=function(n,t){return n===t.getFullYear()},r.prototype.isEqualsQuarter=function(n,t){switch(n){case 0:return t.getMonth()>=1&&t.getMonth()<=3;case 1:return t.getMonth()>=4&&t.getMonth()<=6;case 2:return t.getMonth()>=7&&t.getMonth()<=9;case 3:return t.getMonth()>=10&&t.getMonth()<=12}return!1},r.prototype.isEqualsMonth=function(n,t){return n===t.getMonth()},r.prototype.isEqualsWeek=function(n,t){return n===t.getDay()},r.prototype.isEqualsDay=function(n,t){return n===t.getDate()},r.prototype.reset=function(){this.expected=t;this.ignoreBlank=!1;this.expectTypeId=0},r.prototype._isDefaultValue=function(n,i){switch(n){case"ignoreBlank":return i===!1;case"formula":return i===t;case"expectTypeId":return i===0;default:return!1}},r.prototype.toJSON=function(){var n=this,r={ignoreBlank:n.ignoreBlank,formula:n.formula,expected:n.expected,expectTypeId:n.expectTypeId,conType:6},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},r.prototype.fromJSON=function(n){if(n){var r=this;n.ignoreBlank!==t&&n.ignoreBlank!==i&&(r.ignoreBlank=n.ignoreBlank);n.formula!==t&&n.formula!==i&&(r.formula=n.formula);n.expected!==t&&n.expected!==i&&(r.expected=n.expected);n.expectTypeId!==t&&n.expectTypeId!==i&&(r.expectTypeId=n.expectTypeId)}},r.fromDay=function(n){var t=new r(n);return t.expectTypeId=5,t},r.fromMonth=function(n){var t=new r(n);return t.expectTypeId=3,t},r.fromQuarter=function(n){var t=new r(n);return t.expectTypeId=2,t},r.fromWeek=function(n){var t=new r(n);return t.expectTypeId=4,t},r.fromYear=function(n){var t=new r(n);return t.expectTypeId=1,t},r}();n.DateExCondition=it;yt=function(){function n(n,t,i){var r=this;r.ignoreBlank=!1;r.conditionType="TextLengthCondition";r.compareType=n;r.expected=t;r.formula=typeof i=="string"?$.trim(i).replace("=",""):i}return n.prototype.evaluate=function(n,r,u,f){if(f===i||f===t||f==="")return this.ignoreBlank;var o=f===i||f===t?0:f.length,e=this.getExpectedInt(n,r,u);if(typeof e=="number")switch(this.compareType){case 0:return o===e;case 2:return o>e;case 3:return o>=e;case 4:return o<e;case 5:return o<=e;case 1:return o!==e}return!1},n.prototype.getExpectedInt=function(n,i,r){var u=this.getExpected(n,i,r);return u=parseInt(u,10),isNaN(u)?t:u},n.prototype.getExpected=function(n,t,i){var r=this,u,f;return r.formula&&r.formula.length>0?(u=n.getCalcService(),!u)?r.expected:(f=u.parse(r.formula,t,i),u.evaluateParsedFormula(n._getSheetSource(),f,t,i)):r.expected},n.prototype.reset=function(){this.expected=t;this.ignoreBlank=!1;this.compareType=0},n.prototype._isDefaultValue=function(n,t){switch(n){case"ignoreBlank":return t===!1;default:return!1}},n.prototype.toJSON=function(){var n=this,r={compareType:n.compareType,expected:n.expected,formula:n.formula,conType:7,ignoreBlank:n.ignoreBlank},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},n.prototype.fromJSON=function(n){if(n){var r=this;n.compareType!==t&&n.compareType!==i&&(r.compareType=n.compareType);n.expected!==t&&n.expected!==i&&(r.expected=n.expected);n.formula!==t&&n.formula!==i&&(r.formula=n.formula);n.ignoreBlank!==t&&n.ignoreBlank!==i&&(r.ignoreBlank=n.ignoreBlank)}},n}();n.TextLengthCondition=yt;rt=function(r){function u(n,t,i){r.call(this,i);this.type=n;this.rank=t}return __extends(u,r),u.prototype.createCondition=function(){return new v(this.type,this.rank,this.ranges)},u.prototype.reset=function(){var n=this;n.type=0;n.rank=10;n.style=t;n._stopIfTrue=!1;n._priority=1},u.prototype.toJSON=function(){var n=this,r={ruleType:5,ranges:n.ranges,style:n.style,type:n.type,rank:n.rank,priority:n._priority,stopIfTrue:n._stopIfTrue},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},u.prototype.fromJSON=function(r){var u,e,f;if(r){if(u=this,r.ranges)for(u.ranges=[],e=0;e<r.ranges.length;e++)f=r.ranges[e],u.ranges.push(new n.Range(f.row,f.col,f.rowCount,f.colCount));r.style&&(u.style=new n.Style,u.style.copyFrom(r.style));r.type!==t&&r.type!==i&&(u.type=r.type);r.rank!==t&&r.rank!==i&&(u.rank=r.rank);r.priority!==t&&r.priority!==i&&(u._priority=r.priority);r.stopIfTrue!==t&&r.stopIfTrue!==i&&(u._stopIfTrue=r.stopIfTrue)}},u}(e);n.Top10Rule=rt;v=function(){function r(n,i,r){var u=this;u.isPercent=!1;u.ignoreBlank=!1;u.conditionType="Top10Condition";u.formula=t;u.expected=i;u.type=n;u.ranges=r}return r.prototype.adjustOffset=function(n,t){},r.prototype.evaluate=function(n,r,u,f){var e=this,o,s,h;if(f===i||f===t||f==="")return e.ignoreBlank;if(o=e.getExpectedInt(n,r,u),o!==i&&o!==t&&(s=t,e.type===0?s=e.getMaxValues(n,o,e.ranges):e.type===1&&(s=e.getMinValues(n,o,e.ranges)),s)){h=0;try{h=e._toDouble(f)}catch(c){return!1}if(s.contains(h))return!0}return!1},r.prototype.getExpectedInt=function(n,i,r){var u=this.getExpected(n,i,r);return u=parseInt(u,10),isNaN(u)||!isFinite(u)?t:u},r.prototype.getExpected=function(n,t,i){var r=this,u,f;return r.formula&&r.formula.length>0?(u=n.getCalcService(),!u)?r.expected:(f=u.parse(r.formula,t,i),u.evaluateParsedFormula(n._getSheetSource(),f,t,i)):r.expected},r.prototype.adjustRange=function(t,i){return new n.Range(t.row,t.col,Math.min(t.rowCount,i.getRowCount()),Math.min(t.colCount,i.getColumnCount()))},r.prototype.getMaxValues=function(n,i,r){var u=[],l,a,v,h,d;if(!r)return u;var e=Number.MAX_VALUE,y=0,g=r.length,o,p,w,b,k,c,f;for(l=0;l<g;l++)for(o=r[l],o=this.adjustRange(o,n),p=o.rowCount,w=o.colCount,a=0;a<p;a++)for(b=a+o.row,v=0;v<w;v++)if(k=v+o.col,c=n.getValue(b,k),f=this._toDouble(c),typeof c!==s&&c!==t&&typeof f!==s&&f!==t)try{if(y<i)u.push(f),f<e&&(e=f),y++;else if(f>e&&(u.remove(e),u.push(f),u.indexOf(e)<0))for(e=f,h=0,d=u.length;h<d;h++)u[h]<e&&(e=u[h])}catch(nt){}return u},r.prototype.getMinValues=function(n,i,r){var u=[],l,a,v,h,d;if(!r)return u;var e=-Number.MAX_VALUE,y=0,g=r.length,o,p,w,b,k,c,f;for(l=0;l<g;l++)for(o=r[l],o=this.adjustRange(o,n),p=o.rowCount,w=o.colCount,a=0;a<p;a++)for(b=a+o.row,v=0;v<w;v++)if(k=v+o.col,c=n.getValue(b,k),f=this._toDouble(c),typeof c!==s&&c!==t&&typeof f!==s&&f!==t)try{if(y<i)u.push(f),f>e&&(e=f),y++;else if(f<e&&(u.remove(e),u.push(f),u.indexOf(e)<0))for(e=f,h=0,d=u.length;h<d;h++)u[h]>e&&(e=u[h])}catch(nt){}return u},r.prototype.reset=function(){var n=this;n.expected=t;n.ignoreBlank=!1;n.type=0;n.isPercent=!1;n.ranges=t},r.prototype._toDouble=function(i){return(typeof i=="number"||i instanceof Date)&&n.util.hasCalc()?n.Calc.Convert.toDouble(i):t},r.prototype._isDefaultValue=function(n,i){switch(n){case"formula":return i===t;case"isPercent":return i===!1;case"ignoreBlank":return i===!1;default:return!1}},r.prototype.toJSON=function(){var n=this,r={expected:n.expected,formula:n.formula,type:n.type,isPercent:n.isPercent,ignoreBlank:n.ignoreBlank,ranges:n.ranges,conType:8},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},r.prototype.fromJSON=function(r){var u,e,f;if(r&&(u=this,r.expected!==t&&r.expected!==i&&(u.expected=r.expected),r.formula!==t&&r.formula!==i&&(u.formula=r.formula),r.type!==t&&r.type!==i&&(u.type=r.type),r.isPercent!==t&&r.isPercent!==i&&(u.isPercent=r.isPercent),r.ignoreBlank!==t&&r.ignoreBlank!==i&&(u.ignoreBlank=r.ignoreBlank),r.ranges))for(u.ranges=[],e=0;e<r.ranges.length;e++)f=r.ranges[e],u.ranges.push(new n.Range(f.row,f.col,f.rowCount,f.colCount))},r}();n.Top10Condition=v;ut=function(r){function u(n){r.call(this,n)}return __extends(u,r),u.prototype.createCondition=function(){return new w(!1,this.ranges)},u.prototype.toJSON=function(){var n=this,r={ruleType:6,ranges:n.ranges,style:n.style,priority:n._priority,stopIfTrue:n._stopIfTrue},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},u.prototype.fromJSON=function(r){var u,e,f;if(r){if(u=this,r.ranges)for(u.ranges=[],e=0;e<r.ranges.length;e++)f=r.ranges[e],u.ranges.push(new n.Range(f.row,f.col,f.rowCount,f.colCount));r.style&&(u.style=new n.Style,u.style.copyFrom(r.style));r.priority!==t&&r.priority!==i&&(u._priority=r.priority);r.stopIfTrue!==t&&r.stopIfTrue!==i&&(u._stopIfTrue=r.stopIfTrue)}},u}(e);n.UniqueRule=ut;ft=function(r){function u(n){r.call(this,n)}return __extends(u,r),u.prototype.createCondition=function(){return new w(!0,this.ranges)},u.prototype.toJSON=function(){var n=this,r={ruleType:7,ranges:n.ranges,style:n.style,priority:n._priority,stopIfTrue:n._stopIfTrue},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},u.prototype.fromJSON=function(r){var u,e,f;if(r){if(u=this,r.ranges)for(u.ranges=[],e=0;e<r.ranges.length;e++)f=r.ranges[e],u.ranges.push(new n.Range(f.row,f.col,f.rowCount,f.colCount));r.style&&(u.style=new n.Style,u.style.copyFrom(r.style));r.priority!==t&&r.priority!==i&&(u._priority=r.priority);r.stopIfTrue!==t&&r.stopIfTrue!==i&&(u._stopIfTrue=r.stopIfTrue)}},u}(e);n.DuplicateRule=ft;w=function(){function r(n,i){var r=this;r.conditionType="UniqueCondition";r.ignoreBlank=!1;r.formula=t;r.expected=n;r.ranges=i}return r.prototype.adjustOffset=function(n,t){},r.prototype.evaluate=function(r,u,f,e){var h=this,o=e,l,s,c;return o===i||o===t||o===""?h.ignoreBlank:(n.util.hasCalc()&&(l=n.Calc.Convert,l.isNumber(o)&&(o=l.toDouble(o))),s=h.getExpectedBoolean(r,u,f),s!==i&&s!==t)?(c=h.getDuplicated(r,h.ranges),c!==i&&c!==t)?c.contains(o)?s===!0:s!==!0:s!==!0:!1},r.prototype.getExpectedBoolean=function(i,r,u){var f=this.getExpected(i,r,u);try{return n.Calc.Convert.toBool(f)}catch(e){return t}},r.prototype.getExpected=function(n,t,i){var r=this,u,f;return r.formula&&r.formula.length>0?(u=n.getCalcService(),!u)?r.expected:(f=u.parse(r.formula,t,i),u.evaluateParsedFormula(n._getSheetSource(),f,t,i)):r.expected},r.prototype.adjustRange=function(t,i){return new n.Range(t.row,t.col,Math.min(t.rowCount,i.getRowCount()),Math.min(t.colCount,i.getColumnCount()))},r.prototype.getDuplicated=function(r,u){var a=[],c=[],v,o,e,s,y,h,p,f,l;if(u)for(v=u.length,o=0;o<v;o++)for(e=u[o],e=this.adjustRange(e,r),s=0;s<e.rowCount;s++)for(y=s+e.row,h=0;h<e.colCount;h++)p=h+e.col,f=r.getValue(y,p,3),f!==i&&f!==t&&(n.util.hasCalc()&&(l=n.Calc.Convert,l.isNumber(f)&&(f=l.toDouble(f))),this._containsKey(a,f)?c.contains(f)||c.push(f):a.push({key:f,value:!1}));return c},r.prototype._containsKey=function(n,t){for(var r=n.length,i=0;i<r;i++)if(n[i].key===t)return!0;return!1},r.prototype.reset=function(){this.expected=t;this.ignoreBlank=!1;this.ranges=t},r.prototype._isDefaultValue=function(n,i){switch(n){case"formula":return i===t;case"ignoreBlank":return i===!1;default:return!1}},r.prototype.toJSON=function(){var n=this,r={expected:n.expected,formula:n.formula,ranges:n.ranges,conType:9,ignoreBlank:n.ignoreBlank},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},r.prototype.fromJSON=function(r){var u,e,f;if(r){if(u=this,r.expected!==t&&r.expected!==i&&(u.expected=r.expected),r.formula!==t&&r.formula!==i&&(u.formula=r.formula),r.ranges)for(u.ranges=[],e=0;e<r.ranges.length;e++)f=r.ranges[e],u.ranges.push(new n.Range(f.row,f.col,f.rowCount,f.colCount));r.ignoreBlank!==t&&r.ignoreBlank!==i&&(u.ignoreBlank=r.ignoreBlank)}},r}();n.UniqueCondition=w;et=function(r){function u(n,t){r.call(this,t);this.type=n}return __extends(u,r),u.prototype.createCondition=function(){return new ot(this.type,this.ranges)},u.prototype.reset=function(){var n=this;n.type=0;n.style=t;n._stopIfTrue=!1;n._priority=1},u.prototype.toJSON=function(){var n=this,r={ruleType:8,ranges:n.ranges,style:n.style,type:n.type,priority:n._priority,stopIfTrue:n._stopIfTrue},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},u.prototype.fromJSON=function(r){var u,e,f;if(r){if(u=this,r.ranges)for(u.ranges=[],e=0;e<r.ranges.length;e++)f=r.ranges[e],u.ranges.push(new n.Range(f.row,f.col,f.rowCount,f.colCount));r.style&&(u.style=new n.Style,u.style.copyFrom(r.style));r.type!==t&&r.type!==i&&(u.type=r.type);r.priority!==t&&r.priority!==i&&(u._priority=r.priority);r.stopIfTrue!==t&&r.stopIfTrue!==i&&(u._stopIfTrue=r.stopIfTrue)}},u}(e);n.AverageRule=et;ot=function(){function r(n,i){var r=this;r.conditionType="AverageCondition";r.ignoreBlank=!1;r._expr=t;r._stdevExpr=t;r.type=n;r.ranges=i}return r.prototype.adjustOffset=function(n,t){},r.prototype.evaluate=function(r,u,f,e){var c,l,a,h;if(!n.util.hasCalc())return!1;if(c=this,c.ignoreBlank&&(e===i||e===t||e===""))return!0;l=n.Calc.Convert;a=l.toDouble;c._rebuildFormula();var s=c.getExpectedDouble(r,u,f),o=t,v=c._stdevExpr?c._getExpectedByExpression(r,c._stdevExpr,u,f):t;if(v!==i&&v!==t)try{o=a(v)}catch(y){o=NaN}if(l.isNumber(e)&&(h=a(e),!isNaN(s)))switch(c.type){case 0:return h>s;case 1:return h<s;case 2:return h>=s;case 3:return h<=s;case 4:return isNaN(o)?!1:h>s+o;case 5:return isNaN(o)?!1:h<s-o;case 6:return isNaN(o)?!1:h>s+2*o;case 7:return isNaN(o)?!1:h<s-2*o;case 8:return isNaN(o)?!1:h>s+3*o;case 9:return isNaN(o)?!1:h<s-3*o}return!1},r.prototype._rebuildFormula=function(){var n=this;n.ranges&&(n._expr=n._createExpression("AVERAGE",n.ranges),(n.type===4||n.type===5||n.type===6||n.type===7||n.type===8||n.type===9)&&(n._stdevExpr=n._createExpression("STDEV",n.ranges)))},r.prototype._createExpression=function(i,r){var e,c,f,u;if(!n.util.hasCalc())return t;var o=n.Calc.Expressions,l=n.Calc.Functions,s=n.Calc.Convert,h=l.findGlobalFunction(i);if(h){for(e=[],c=r.length,f=0;f<c;f++)if(u=r[f],u instanceof o.Expression)e[f]=u;else if(u instanceof n.Range)e[f]=new o.RangeExpression(u.row,u.col,u.row+u.rowCount-1,u.col+u.colCount-1);else if(s.isNumber(u)&&!isNaN(u=s.toDouble(u)))e[f]=new o.DoubleExpression(u,u.toString());else throw n.SR.Exp_NotSupport;return new o.FunctionExpression(h,e)}return t},r.prototype.getExpectedDouble=function(t,i,r){var u=this.getExpected(t,i,r);try{return n.Calc.Convert.toDouble(u)}catch(f){return NaN}},r.prototype.getExpected=function(n,i,r){var u=n.getCalcService(),f;return u?(f=u.unparse(this._expr,i,r),this._expr=u.parse(f,i,r),u.evaluateParsedFormula(n._getSheetSource(),this._expr,i,r)):t},r.prototype._getExpectedByExpression=function(n,i,r,u){var f=n.getCalcService(),e;return f?(e=f.unparse(i,r,u),i=f.parse(e,r,u),f.evaluateParsedFormula(n._getSheetSource(),i,r,u)):t},r.prototype.reset=function(){var n=this;n.ignoreBlank=!1;n.type=0;n.ranges=t;n._expr=t;n._stdevExpr=t},r.prototype._isDefaultValue=function(n,t){switch(n){case"ignoreBlank":return t===!1;default:return!1}},r.prototype.toJSON=function(){var n=this,r={type:n.type,ranges:n.ranges,conType:10,ignoreBlank:n.ignoreBlank},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},r.prototype.fromJSON=function(r){var u,e,f;if(r){if(u=this,r.type!==t&&r.type!==i&&(u.type=r.type),r.ranges)for(u.ranges=[],e=0;e<r.ranges.length;e++)f=r.ranges[e],u.ranges.push(new n.Range(f.row,f.col,f.rowCount,f.colCount));r.ignoreBlank!==t&&r.ignoreBlank!==i&&(u.ignoreBlank=r.ignoreBlank)}},r}();n.AverageCondition=ot;r=function(){function n(n,t){this.type=n;this.value=t}return n}();n.ScaleValue=r;c=function(r){function u(n,i,u){r.call(this,t);var f=this;f.expected=[];f.lowestValueCached=t;f.highestValueCached=t;f.cached=!1;f._oldRanges=t;f.scales=[n,i,u]}return __extends(u,r),u.prototype.stopIfTrue=function(){return this._stopIfTrue},u.prototype.isScaleRule=function(){return!0},u.prototype.createCondition=function(){return t},u.prototype._calculateLowestValueEx=function(n){var i=(new v).getMinValues(n,1,this.ranges);return i.length>0?i[0]:t},u.prototype._calculateHighestValueEx=function(n){var i=(new v).getMaxValues(n,1,this.ranges);return i.length>0?i[0]:t},u.prototype._cloneRanges=function(t){for(var u=[],f=t.length,i,r=0;r<f;r++)i=t[r],u.push(new n.Range(i.row,i.col,i.rowCount,i.colCount));return u},u.prototype._rangesChanged=function(){var t=this._oldRanges,r=this.ranges,u,i,n;if(!t)return!1;if(u=t.length,i=r.length,u!==i)return!0;for(n=0;n<i;n++)if(!t[n].equals(r[n]))return!0;return!1},u.prototype._tryCache=function(n){var t=this;t._rangesChanged()&&(t._clearCache(),t._oldRanges=t._cloneRanges(t.ranges));t.cached===!1&&(t.lowestValueCached=t._calculateLowestValueEx(n),t.highestValueCached=t._calculateHighestValueEx(n),t.cached=!0)},u.prototype._clearCache=function(){this.lowestValueCached=t;this.highestValueCached=t;this.cached=!1},u.prototype._calculateFormula=function(n,i,r,u){var f,e;return u&&u.length>0?(f=n.getCalcService(),!f)?t:(e=f.parse(u,i,r),f.evaluateParsedFormula(n._getSheetSource(),e,i,r)):t},u.prototype._isFormula=function(n){return n&&n[0]==="="},u.prototype._trimFormula=function(n){return n===i||n===t||n===""?t:n[0]==="="?n.substr(1):n},u.prototype._calculateValue=function(i,r,u,f){var e=t;if(this._isFormula(f))e=this._calculateFormula(i,r,u,this._trimFormula(f.toString()));else try{e=n.Calc.Convert.toDouble(f)}catch(o){e=NaN}return e},u.prototype._getHighestValue=function(n){return this._tryCache(n),this.highestValueCached},u.prototype._getLowestValue=function(n){return this._tryCache(n),this.lowestValueCached},u.prototype._calculatePercent=function(n,i,r,u){var e=this._calculateValue(n,i,r,u),f,o;return!isNaN(e)&&0<=e&&e<=100&&(f=this._getLowestValue(n),o=this._getHighestValue(n),typeof f!==s&&f!==t&&typeof o!==s&&o!==t)?f+(o-f)*e/100:t},u.prototype._calculatePercentile=function(i,r,u,f){var e=this._calculateValue(i,r,u,f),o;if(!isNaN(e)&&0<=e&&e<=100){var h=0,c=this.ranges,l=c.length;for(o=0;o<l;o++){var a=this._createExpression("PERCENTILE",[c[o],e/100]),s=i.getCalcService(),v=s.unparse(a,r,u),a=s.parse(v,r,u),y=s.evaluateParsedFormula(i._getSheetSource(),a,r,u);try{h+=n.Calc.Convert.toDouble(y)}catch(p){}}return h/l}return t},u.prototype._getActualValue=function(n,i,r,u,f){var e=this,o=e.scales[u],s,h;if(o)switch(o.type){case 6:return e._calculateValue(n,i,r,o.value);case 2:return e._getHighestValue(n);case 1:return e._getLowestValue(n);case 0:return e._calculateValue(n,i,r,o.value);case 3:return e._calculatePercent(n,i,r,o.value);case 4:return e._calculatePercentile(n,i,r,o.value);case 7:return s=e._getHighestValue(n),s<0?0:s;case 5:return h=e._getLowestValue(n),h>0?0:h}return t},u.prototype._evaluate2Scale=function(n,t,i){return n<=t?0:n>=i?1:(n-t)/(i-t)},u.prototype.evaluate=function(r,u,f,e){var s=this,a;if(s._tryCache(r),s.contains(u,f)){if(e===i||e===t)return t;try{var c=n.Calc.Convert.toDouble(e),o=s._getActualValue(r,u,f,0),l=s._getActualValue(r,u,f,1),h=s._getActualValue(r,u,f,2);if(isNaN(l)){if(!isNaN(o)&&!isNaN(h))return o>h?t:s._evaluate2Scale(c,o,h)}else if(!isNaN(o)&&!isNaN(h)&&!isNaN(l))return o>h?t:c<o?0:c>=h?2:(a=s._evaluate2Scale(l,o,h),o<=c&&c<=l?s._evaluate2Scale(c,o,l):1+s._evaluate2Scale(c,o,h))}catch(v){return t}}return t},u.prototype._evaluateColor=function(i,r,u){if(0<=i&&i<=1){var f=n._Color.parse(r),e=n._Color.parse(u),o=f.a*(1-i)+e.a*i,s=f.r*(1-i)+e.r*i,h=f.g*(1-i)+e.g*i,c=f.b*(1-i)+e.b*i;return new n._Color(parseFloat(o/255),parseInt(s,10),parseInt(h,10),parseInt(c,10)).toString()}return t},u.prototype._createExpression=function(i,r){var e,c,f,u;if(!n.util.hasCalc())return t;var o=n.Calc.Expressions,l=n.Calc.Functions,s=n.Calc.Convert,h=l.findGlobalFunction(i);if(h){for(e=[],c=r.length,f=0;f<c;f++)if(u=r[f],u instanceof o.Expression)e[f]=u;else if(u instanceof n.Range)e[f]=new o.RangeExpression(u.row,u.col,u.row+u.rowCount-1,u.col+u.colCount-1);else if(s.isNumber(u)&&!isNaN(u=s.toDouble(u)))e[f]=new o.DoubleExpression(u,u.toString());else throw n.SR.Exp_NotSupport;return new o.FunctionExpression(h,e)}return t},u.prototype._addRows=function(n,t){r.prototype._addRows.call(this,n,t);this._clearCache()},u.prototype._addColumns=function(n,t){r.prototype._addColumns.call(this,n,t);this._clearCache()},u.prototype._removeRows=function(n,t){r.prototype._removeRows.call(this,n,t);this._clearCache()},u.prototype._removeColumns=function(n,t){r.prototype._removeColumns.call(this,n,t);this._clearCache()},u}(e);n.ScaleRule=c;st=function(u){function f(i,f,e,o,s,h){var c=i,l=f,a=e,v=o,y=s,p=h,w,b;arguments.length===0&&(c=1,l=t,a=new n._Color(0,255,255,255).toString(),v=2,y=t,p=new n._Color(255,99,190,123).toString());w=new r(c,l);b=new r(v,y);u.call(this,w,t,b);this.expected[0]=a;this.expected[2]=p}return __extends(f,u),f.prototype.evaluate=function(r,u,f,e){var s,l;if(e!==i&&e!==t){s=NaN;try{n.Calc.Convert.isNumber(e)&&(s=n.Calc.Convert.toDouble(e))}catch(a){return t}if(isNaN(s))return t;var o=this,h=o._getActualValue(r,u,f,0),c=o._getActualValue(r,u,f,2);if(h!==i&&h!==t&&c!==i&&c!==t)return l=o._evaluate2Scale(s,h,c),o._evaluateColor(l,o.expected[0],o.expected[2])}return t},f.prototype._init=function(){var i=this;i.scales=new Array(3);i.scales[0]=new r(1,t);i.scales[2]=new r(2,t);i.expected=new Array(3);i.expected[0]=new n._Color(0,255,255,255).toString();i.expected[2]=new n._Color(255,99,190,123).toString()},f.prototype.reset=function(){var n=this;n.ranges=t;n.condition=t;n.style=t;n._stopIfTrue=!1;n._priority=1;n._init()},f.prototype.getMinimumType=function(){var n=this.scales;return n&&n.length===3?n[0].type:t},f.prototype.setMinimumType=function(n){var t=this.scales;t&&t.length===3&&(t[0].type=n)},f.prototype.getMinimumValue=function(){var n=this.scales;return n&&n.length===3?n[0].value:t},f.prototype.setMinimumValue=function(n){var t=this.scales;t&&t.length===3&&(t[0].value=n)},f.prototype.getMinimumColor=function(){return this.expected&&this.expected.length===3?this.expected[0]:t},f.prototype.setMinimumColor=function(n){this.expected&&this.expected.length===3&&(this.expected[0]=n)},f.prototype.getMaximumType=function(){var n=this.scales;return n&&n.length===3?n[2].type:t},f.prototype.setMaximumType=function(n){var t=this.scales;t&&t.length===3&&(t[2].type=n)},f.prototype.getMaximumValue=function(){var n=this.scales;return n&&n.length===3?n[2].value:t},f.prototype.setMaximumValue=function(n){var t=this.scales;t&&t.length===3&&(t[2].value=n)},f.prototype.getMaximumColor=function(){return this.expected&&this.expected.length===3?this.expected[2]:t},f.prototype.setMaximumColor=function(n){this.expected&&this.expected.length===3&&(this.expected[2]=n)},f.prototype._isDefaultValue=function(n,i){switch(n){case"ranges":return i===t;case"priority":return i===1;case"stopIfTrue":return i===!1;default:return!1}},f.prototype.toJSON=function(){var n=this,r={ruleType:10,ranges:n.ranges,minType:n.getMinimumType(),minValue:n.getMinimumValue(),minColor:n.getMinimumColor(),maxType:n.getMaximumType(),maxValue:n.getMaximumValue(),maxColor:n.getMaximumColor(),priority:n._priority,stopIfTrue:n._stopIfTrue},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},f.prototype.fromJSON=function(r){var u,e,f;if(r){if(u=this,r.ranges)for(u.ranges=[],e=0;e<r.ranges.length;e++)f=r.ranges[e],u.ranges.push(new n.Range(f.row,f.col,f.rowCount,f.colCount));r.minType!==t&&r.minType!==i&&u.setMinimumType(r.minType);r.minValue!==t&&r.minValue!==i&&u.setMinimumValue(r.minValue);r.minColor!==t&&r.minColor!==i&&u.setMinimumColor(r.minColor);r.maxType!==t&&r.maxType!==i&&u.setMaximumType(r.maxType);r.maxValue!==t&&r.maxValue!==i&&u.setMaximumValue(r.maxValue);r.maxColor!==t&&r.maxColor!==i&&u.setMaximumColor(r.maxColor);r.priority!==t&&r.priority!==i&&(u._priority=r.priority);r.stopIfTrue!==t&&r.priority!==i&&(u._stopIfTrue=!1)}},f}(c);n.TwoScaleRule=st;ht=function(u){function f(i,f,e,o,s,h,c,l,a){var v=i,y=f,p=e,w=o,b=s,k=h,d=c,g=l,nt=a;arguments.length===0&&(v=1,y=t,p=new n._Color(255,248,105,107).toString(),w=4,b=50,k=new n._Color(255,255,235,132).toString(),d=2,g=t,nt=new n._Color(255,99,190,123).toString());u.call(this,new r(v,y),new r(w,b),new r(d,g));this.expected[0]=p;this.expected[1]=k;this.expected[2]=nt}return __extends(f,u),f.prototype.evaluate=function(r,u,f,e){var o=this,s,a;if(o._evaluator=r,e!==i&&e!==t){s=NaN;try{n.Calc.Convert.isNumber(e)&&(s=n.Calc.Convert.toDouble(e))}catch(v){return t}if(isNaN(s))return t;var h=o._getActualValue(r,u,f,0),c=o._getActualValue(r,u,f,1),l=o._getActualValue(r,u,f,2);if(h!==i&&h!==t&&l!==i||l!==t&&c!==i&&c!==t)return h>l?t:s<h?o.expected[0]:s>=l?o.expected[2]:h<=s&&s<=c?(a=o._evaluate2Scale(s,h,c),o._evaluateColor(a,o.expected[0],o.expected[1])):(a=o._evaluate2Scale(s,c,l),o._evaluateColor(a,o.expected[1],o.expected[2]))}return t},f.prototype._init=function(){var i=this;i.scales=new Array(3);i.scales[0]=new r(1,t);i.scales[1]=new r(4,50);i.scales[2]=new r(2,t);i.expected=new Array(3);i.expected[0]=new n._Color(255,248,105,107).toString();i.expected[1]=new n._Color(255,255,235,132).toString();i.expected[2]=new n._Color(255,99,190,123).toString()},f.prototype.reset=function(){var n=this;n.ranges=t;n.condition=t;n.style=t;n._init();n._evaluator=t;n._stopIfTrue=!1;n._priority=1},f.prototype.getMinimumType=function(){var n=this.scales;return n&&n.length===3?n[0].type:t},f.prototype.setMinimumType=function(n){var t=this.scales;t&&t.length===3&&(t[0].type=n)},f.prototype.getMinimumValue=function(){var n=this.scales;return n&&n.length===3?n[0].value:t},f.prototype.setMinimumValue=function(n){var t=this.scales;t&&t.length===3&&(t[0].value=n)},f.prototype.getMinimumColor=function(){return this.expected&&this.expected.length===3?this.expected[0]:t},f.prototype.setMinimumColor=function(n){this.expected&&this.expected.length===3&&(this.expected[0]=n)},f.prototype.getMidpointType=function(){var n=this.scales;return n&&n.length===3?n[1].type:t},f.prototype.setMidpointType=function(n){var t=this.scales;t&&t.length===3&&(t[1].type=n)},f.prototype.getMidpointValue=function(){var n=this,i=n.scales;if(i&&i.length===3){if(n._evaluator)if(i[1].type===2)return n._getHighestValue(n._evaluator);else if(i[1].type===1)return n._getLowestValue(n._evaluator);return i[1].value}return t},f.prototype.setMidpointValue=function(n){var t=this.scales;t&&t.length===3&&(t[1].value=n)},f.prototype.getMidpointColor=function(){return this.expected&&this.expected.length===3?this.expected[1]:t},f.prototype.setMidpointColor=function(n){this.expected&&this.expected.length===3&&(this.expected[1]=n)},f.prototype.getMaximumType=function(){var n=this.scales;return n&&n.length===3?n[2].type:t},f.prototype.setMaximumType=function(n){var t=this.scales;t&&t.length===3&&(t[2].type=n)},f.prototype.getMaximumValue=function(){var n=this.scales;return n&&n.length===3?n[2].value:t},f.prototype.setMaximumValue=function(n){var t=this.scales;t&&t.length===3&&(t[2].value=n)},f.prototype.getMaximumColor=function(){return this.expected&&this.expected.length===3?this.expected[2]:t},f.prototype.setMaximumColor=function(n){this.expected&&this.expected.length===3&&(this.expected[2]=n)},f.prototype._isDefaultValue=function(n,i){switch(n){case"ranges":return i===t;case"priority":return i===1;case"stopIfTrue":return i===!1;default:return!1}},f.prototype.toJSON=function(){var n=this,r={ruleType:11,ranges:n.ranges,minType:n.getMinimumType(),minValue:n.getMinimumValue(),minColor:n.getMinimumColor(),midType:n.getMidpointType(),midValue:n.getMidpointValue(),midColor:n.getMidpointColor(),maxType:n.getMaximumType(),maxValue:n.getMaximumValue(),maxColor:n.getMaximumColor(),priority:n._priority,stopIfTrue:n._stopIfTrue},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},f.prototype.fromJSON=function(r){var u,e,f;if(r){if(u=this,r.ranges)for(u.ranges=[],e=0;e<r.ranges.length;e++)f=r.ranges[e],u.ranges.push(new n.Range(f.row,f.col,f.rowCount,f.colCount));r.minType!==t&&r.minType!==i&&u.setMinimumType(r.minType);r.minValue!==t&&r.minValue!==i&&u.setMinimumValue(r.minValue);r.minColor!==t&&r.minColor!==i&&u.setMinimumColor(r.minColor);r.midType!==t&&r.midType!==i&&u.setMidpointType(r.midType);r.midValue!==t&&r.midValue!==i&&u.setMidpointValue(r.midValue);r.midColor!==t&&r.midColor!==i&&u.setMidpointColor(r.midColor);r.maxType!==t&&r.maxType!==i&&u.setMaximumType(r.maxType);r.maxValue!==t&&r.maxValue!==i&&u.setMaximumValue(r.maxValue);r.maxColor!==t&&r.maxColor!==i&&u.setMaximumColor(r.maxColor);r.priority!==t&&r.priority!==i&&(u._priority=r.priority);r.stopIfTrue!==t&&r.priority!==i&&(u._stopIfTrue=!1)}},f}(c);n.ThreeScaleRule=ht;ct=function(u){function f(i,f,e,o,s){var h=i,c=f,l=e,a=o,v=s,y,p;arguments.length===0&&(h=5,c=t,l=7,a=t,v=new n._Color(255,99,142,198).toString());y=new r(h,c);p=new r(l,a);u.call(this,y,t,p);this._init(v)}return __extends(f,u),f.prototype._init=function(n){var t=this;t._gradient=!0;t._color=n;t._showBorder=!1;t._borderColor="black";t._dataBarDirection=0;t._negativeFillColor="red";t._useNegativeFillColor=!0;t._negativeBorderColor="black";t._useNegativeBorderColor=!1;t._axisPosition=0;t._axisColor="black";t._showBarOnly=!1},f.prototype.reset=function(){var i=this;i.ranges=t;i.condition=t;i.style=t;i._init(new n._Color(255,99,142,198).toString());i._stopIfTrue=!1;i._priority=1;i.scales=[];i.scales[0]=new r(5,t);i.scales[2]=new r(7,t);i.expected=[]},f.prototype._calcuteMinValue=function(n,i,r,u,f){var e=this,h=e.scales[u],s=t,o;if(h)if(h.type===6||h.type===4){for(o=0;o<e.ranges.length;o++)if(e.ranges[o].intersect(i,-1,1,-1)){s=e.ranges[o];break}if(s)return e._getActualValue(n,s.row,s.col,0,f)}else return e._getActualValue(n,i,r,0,f);return t},f.prototype._calcuteMaxValue=function(n,i,r,u,f){var e=this,h=e.scales[u],s=t,o;if(h)if(h.type===6||h.type===4){for(o=0;o<e.ranges.length;o++)if(e.ranges[o].intersect(i,-1,1,-1)){s=e.ranges[o];break}if(s)return e._getActualValue(n,s.row,s.col,2,f)}else return e._getActualValue(n,i,r,2,f);return t},f.prototype._evaluateNoneScale=function(n,t,i,r){return(r=0,i===t)?n<t?[0,r]:n>i?[1,r]:[.5,r]:n>=i?[1,r]:n<=t?[0,r]:[(n-t)/(i-t),r]},f.prototype._evaluateMidScale=function(n,t,i,r){var u,f,e;if(r=.5,u=l(i-t),i>0&&t>=0)return i===t?[.5,r]:n>=i?[.5,r]:n<=t?[t/i*.5,r]:[l(n/i)*.5,r];else if(i>0&&t<0)return f=i>l(t)?.5:i/u,e=i>l(t)?t/u:-.5,n>0?n>=i?[f,r]:[n/i*f,r]:n<0?n<=t?[e,r]:[n/t*e,r]:[0,r];else if(i<=0&&t<0)return i===t?[-.5,r]:n>=i?[-i/t*.5,r]:n<=t?[-.5,r]:[-n/t*.5,r];else if(i===0&&t===0)return[0,r];return r=-1,[-1,r]},f.prototype._evaluateAutoScale=function(n,t,i,r){var u=l(i-t);if(i>0&&t>=0)return(r=0,t===i)?n<t?[0,r]:n>i?[1,r]:[.5,r]:n<=t?[0,r]:n>=i?[1,r]:[(n-t)/u,r];else if(i>0&&t<0)return r=l(t)/u,n>=i?[1-r,r]:n<=t?[-r,r]:n===0?[0,r]:[(+n)/u,r];else if(i<=0&&t<0)return(r=1,i===t)?n<t?[-1,r]:n>i?[0,r]:[-.5,r]:n>=i?[-0,r]:n<=t?[-1,r]:[(n-i)/u,r];else if(i===0&&t===0)return r=.5,n>0?[.5,r]:n<0?[-.5,r]:[0,r];return r=-1,[-1,r]},f.prototype._evaluateScale=function(n,t,i,r){var u=this;return u._axisPosition===0?u._evaluateAutoScale(n,t,i,r):u._axisPosition===1?u._evaluateMidScale(n,t,i,r):u._evaluateNoneScale(n,t,i,r)},f.prototype._paintDataBar=function(t,i,r,u,f,e){var p=new n.Rect(r+2,u+2,f-4,e-4),s=p.x,h=p.y,o=a(l(p.width*i.scale)),c=p.height,w,y,v;if(i.axisLocation===0)i.scale<=0&&(o=0);else if(i.axisLocation===1)i.scale<0?s=s+p.width-o:o=0;else{var b=a(p.width*i.axisLocation+s)+.5,k=p.y,g=1,ut=e-1;for(t.lineWidth=g,t.strokeStyle=i.axisColor,t.beginPath(),w=0;w<=ut;w+=2)i.direction===1?(t.moveTo(2*r+f-b,k+w),t.lineTo(2*r+f-b,k+w+1)):(t.moveTo(b,k+w),t.lineTo(b,k+w+1));t.stroke();i.scale>0?s=b+g:i.scale<0?s=b-o:o=0}if(i.showBorder&&(s=a(s)+.5,o-=1,h+=.5,c-=1),o>=0&&c>=0){if(y=i.fillColor,i.isGradient){v=.9;y=i.direction===1?t.createLinearGradient(2*r+f-s-o,h,2*r+f-s,h+c):t.createLinearGradient(s,h,s+o,h+c);var d=n._Color.parse(i.fillColor),nt=new n._Color(d.a,a(255*v+d.r*(1-v)),a(255*v+d.g*(1-v)),a(255*v+d.b*(1-v))).toString(),tt=i.scale<0?1-v:v,it=i.fillColor,rt=i.scale<0?1:0;i.direction===1?(y.addColorStop(tt,it),y.addColorStop(rt,nt)):(y.addColorStop(tt,nt),y.addColorStop(rt,it))}t.fillStyle!==y&&(t.fillStyle=y);i.direction===1?t.fillRect(2*r+f-s-o,h,o,c):t.fillRect(s,h,o,c);i.showBorder&&o>0&&c>0&&(t.strokeStyle=i.borderColor,i.direction===1?t.strokeRect(2*r+f-s-o,h,o,c):t.strokeRect(s,h,o,c))}},f.prototype.evaluate=function(r,u,f,e){var a=e,c,y,v,l,p,w,b;if(a!==t&&a!==i){c=NaN;try{n.Calc.Convert.isNumber(a)&&(c=n.Calc.Convert.toDouble(a))}catch(k){return t}if(isNaN(c))return t;var o=this,s=o._calcuteMinValue(r,u,f,0,e),h=o._calcuteMaxValue(r,u,f,2,e);if(s instanceof Date&&(s=new n._DateTimeHelper(s).toOADate()),h instanceof Date&&(h=new n._DateTimeHelper(h).toOADate()),s!==t&&s!==i&&h!==t&&h!==i)return(s>h&&(y=h,h=s,s=y),l=o._evaluateScale(c,s,h,v),!l||l.length<2)?t:(p=l[0],v=l[1],w=c<0&&o._useNegativeFillColor?o._negativeFillColor:o._color,b=c<0&&o._useNegativeBorderColor?o._negativeBorderColor:o._borderColor,{fillColor:w,borderColor:b,showBorder:o._showBorder,axisColor:o._axisColor,isGradient:o._gradient,direction:o._dataBarDirection,axisLocation:v,scale:p,showBarOnly:o._showBarOnly})}return t},f.prototype.minimumType=function(n){var r=this,i=r.scales;return arguments.length===0?i&&i.length===3?i[0].type:t:(i&&i.length===3&&(i[0].type=n),r)},f.prototype.minimumValue=function(n){var r=this,i=r.scales;return arguments.length===0?i&&i.length===3?i[0].value:t:(i&&i.length===3&&(i[0].value=n),r)},f.prototype.maximumType=function(n){var r=this,i=r.scales;return arguments.length===0?i&&i.length===3?i[2].type:t:(i&&i.length===3&&(i[2].type=n),r)},f.prototype.maximumValue=function(n){var r=this,i=r.scales;return arguments.length===0?i&&i.length===3?i[2].value:t:(i&&i.length===3&&(i[2].value=n),r)},f.prototype.gradient=function(n){return arguments.length===0?this._gradient:(this._gradient=n,this)},f.prototype.color=function(n){return arguments.length===0?this._color:(this._color=n,this)},f.prototype.showBorder=function(n){return arguments.length===0?this._showBorder:(this._showBorder=n,this)},f.prototype.borderColor=function(n){return arguments.length===0?this._borderColor:(this._borderColor=n,this)},f.prototype.dataBarDirection=function(n){return arguments.length===0?this._dataBarDirection:(this._dataBarDirection=n,this)},f.prototype.negativeFillColor=function(n){return arguments.length===0?this._negativeFillColor:(this._negativeFillColor=n,this)},f.prototype.useNegativeFillColor=function(n){return arguments.length===0?this._useNegativeFillColor:(this._useNegativeFillColor=n,this)},f.prototype.negativeBorderColor=function(n){return arguments.length===0?this._negativeBorderColor:(this._negativeBorderColor=n,this)},f.prototype.useNegativeBorderColor=function(n){return arguments.length===0?this._useNegativeBorderColor:(this._useNegativeBorderColor=n,this)},f.prototype.axisPosition=function(n){return arguments.length===0?this._axisPosition:(this._axisPosition=n,this)},f.prototype.axisColor=function(n){return arguments.length===0?this._axisColor:(this._axisColor=n,this)},f.prototype.showBarOnly=function(n){return arguments.length===0?this._showBarOnly:(this._showBarOnly=n,this)},f.prototype._isDefaultValue=function(n,i){switch(n){case"ranges":return i===t;case"gradient":return i===!0;case"showBorder":return i===!1;case"borderColor":return i==="black";case"dataBarDirection":return i===0;case"negativeFillColor":return i==="red";case"useNegativeFillColor":return i===!0;case"negativeBorderColor":return i==="black";case"useNegativeBorderColor":return i===!1;case"axisPosition":return i===0;case"axisColor":return i==="black";case"showBarOnly":return i===!1;case"priority":return i===1;case"stopIfTrue":return i===!1}},f.prototype.toJSON=function(){var n=this,r={ruleType:12,ranges:n.ranges,minType:n.minimumType(),minValue:n.minimumValue(),maxType:n.maximumType(),maxValue:n.maximumValue(),gradient:n.gradient(),color:n.color(),showBorder:n.showBorder(),borderColor:n.borderColor(),dataBarDirection:n.dataBarDirection(),negativeFillColor:n.negativeFillColor(),useNegativeFillColor:n.useNegativeFillColor(),negativeBorderColor:n.negativeBorderColor(),useNegativeBorderColor:n.useNegativeBorderColor(),axisPosition:n.axisPosition(),axisColor:n.axisColor(),showBarOnly:n.showBarOnly(),priority:n._priority,stopIfTrue:n._stopIfTrue},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},f.prototype.fromJSON=function(r){var u,e,f;if(r){if(u=this,r.ranges)for(u.ranges=[],e=0;e<r.ranges.length;e++)f=r.ranges[e],u.ranges.push(new n.Range(f.row,f.col,f.rowCount,f.colCount));r.minType!==t&&r.minType!==i&&u.minimumType(r.minType);r.minValue!==t&&r.minValue!==i&&u.minimumValue(r.minValue);r.maxType!==t&&r.maxType!==i&&u.maximumType(r.maxType);r.maxValue!==t&&r.maxValue!==i&&u.maximumValue(r.maxValue);r.gradient!==t&&r.gradient!==i&&u.gradient(r.gradient);r.color!==t&&r.color!==i&&u.color(r.color);r.showBorder!==t&&r.showBorder!==i&&u.showBorder(r.showBorder);r.borderColor!==t&&r.borderColor!==i&&u.borderColor(r.borderColor);r.dataBarDirection!==t&&r.dataBarDirection!==i&&u.dataBarDirection(r.dataBarDirection);r.negativeFillColor!==t&&r.negativeFillColor!==i&&u.negativeFillColor(r.negativeFillColor);r.useNegativeFillColor!==t&&r.useNegativeFillColor!==i&&u.useNegativeFillColor(r.useNegativeFillColor);r.negativeBorderColor!==t&&r.negativeBorderColor!==i&&u.negativeBorderColor(r.negativeBorderColor);r.useNegativeBorderColor!==t&&r.useNegativeBorderColor!==i&&u.useNegativeBorderColor(r.useNegativeBorderColor);r.axisPosition!==t&&r.axisPosition!==i&&u.axisPosition(r.axisPosition);r.axisColor!==t&&r.axisColor!==i&&u.axisColor(r.axisColor);r.showBarOnly!==t&&r.showBarOnly!==i&&u.showBarOnly(r.showBarOnly);r.priority!==t&&r.priority!==i&&(u._priority=r.priority);r.stopIfTrue!==t&&r.priority!==i&&(u._stopIfTrue=!1)}},f}(c);n.DataBarRule=ct;o=function(){function n(n,t,i){this.isGreaterThanOrEqualTo=n;this.iconValueType=t;this.iconValue=i}return n}();n.IconCriterion=o;lt=function(r){function u(n){var i=n;arguments.length===0&&(i=0);r.call(this,t,t,t);this._init(i)}return __extends(u,r),u.prototype._initIconSetType=function(n){var t=this;t._iconSetType=n;t._iconSetType>=0&&t._iconSetType<=9?(t._iconCriteria=new Array(2),t._iconCriteria[0]=new o(!0,4,33),t._iconCriteria[1]=new o(!0,4,67)):t._iconSetType>=10&&t._iconSetType<=14?(t._iconCriteria=new Array(3),t._iconCriteria[0]=new o(!0,4,25),t._iconCriteria[1]=new o(!0,4,50),t._iconCriteria[2]=new o(!0,4,75)):t._iconSetType>=15&&t._iconSetType<=19?(t._iconCriteria=new Array(4),t._iconCriteria[0]=new o(!0,4,20),t._iconCriteria[1]=new o(!0,4,40),t._iconCriteria[2]=new o(!0,4,60),t._iconCriteria[3]=new o(!0,4,80)):t._iconSetType>19&&(t._iconCriteria=[])},u.prototype._init=function(n){this._showIconOnly=!1;this._reverseIconOrder=!1;this._initIconSetType(n)},u.prototype._modifyIconIndex=function(n){var t=this._iconCriteria.length+1;return this._reverseIconOrder&&t>2?t-1-n:n},u.prototype._getActualValue=function(n,i,r,u){var e=this,f=e._iconCriteria[u];if(f)switch(f.iconValueType){case 7:return e._calculateValue(n,i,r,f.iconValue);case 1:return e._calculateValue(n,i,r,f.iconValue);case 4:return e._calculatePercent(n,i,r,f.iconValue);case 5:return e._calculatePercentile(n,i,r,f.iconValue)}return t},u.prototype._paintIconSet=function(n,t,i,r,f,e,o,s){var c=i+1,l=r+2,a=16,v=16,h;t.showIconOnly&&(o.hAlign==1?c=i+f/2-a/2:o.hAlign==2&&(c=i+f-a-2));o.vAlign==1?l=r+e/2-v/2:o.vAlign==2&&(l=r+e-v-2);h=u.getIcon(t.iconSetType,t.iconIndex);try{h&&s&&($.type(h)==="string"?s.getState(h)?n.drawImage(s.getImage(h),c,l,a,v):s.addImage(h):s.getState(h.image)?n.drawImage(s.getImage(h.image),h.x,h.y,h.w,h.h,c,l,a,v):s.addImage(h.image))}catch(y){}},u.prototype.evaluate=function(r,u,f,e){var h=this,y=e,l,k,a,w,d,c,v;if(y===t||y===i)return t;l=NaN;try{n.Calc.Convert.isNumber(y)&&(l=n.Calc.Convert.toDouble(y))}catch(g){return t}if(isNaN(l))return t;var p=0,o=h._iconSetType,b=h._iconCriteria;if(o>=0&&o<=9?p=3:o>=10&&o<=14?p=4:o>=15&&o<=19&&(p=5),!b)return 0;for(k=Number.MAX_VALUE,a=h._showIconOnly,c=p-1;c>0;c--)if(c<b.length+1)if(w=b[c-1],d=w&&w.iconValue,d!==t&&typeof d!==s)if(v=h._getActualValue(r,u,f,c-1),v!==t&&typeof v!==s){if(w.isGreaterThanOrEqualTo){if(l<k&&l>=v)return{iconSetType:o,iconIndex:h._modifyIconIndex(c),showIconOnly:a}}else if(l<k&&l>v)return{iconSetType:o,iconIndex:h._modifyIconIndex(c),showIconOnly:a}}else return{iconSetType:o,iconIndex:h._modifyIconIndex(0),showIconOnly:a};else return{iconSetType:o,iconIndex:h._modifyIconIndex(0),showIconOnly:a};else return{iconSetType:o,iconIndex:h._modifyIconIndex(0),showIconOnly:a};return{iconSetType:o,iconIndex:h._modifyIconIndex(0),showIconOnly:a}},u.prototype.reset=function(){var n=this;n.ranges=t;n.condition=t;n.style=t;n._showIconOnly=!1;n._reverseIconOrder=!1;n._iconSetType=0;n._iconCriteria=t;n._stopIfTrue=!1;n._priority=1;n.scales=[];n.expected=[]},u.prototype.iconSetType=function(n){return arguments.length===0?this._iconSetType:(this._initIconSetType(n),this)},u.prototype.reverseIconOrder=function(n){return arguments.length===0?this._reverseIconOrder:(this._reverseIconOrder=n,this)},u.prototype.showIconOnly=function(n){return arguments.length===0?this._showIconOnly:(this._showIconOnly=n,this)},u.prototype.iconCriteria=function(){return this._iconCriteria},u.prototype._isDefaultValue=function(n,t){switch(n){case"showIconOnly":return t===!1;case"reverseIconOrder":return t===!1;case"priority":return t===1;case"stopIfTrue":return t===!1;default:return!1}},u.prototype.toJSON=function(){var n=this,r={ruleType:13,ranges:n.ranges,iconSetType:n.iconSetType(),iconCriteria:n.iconCriteria(),showIconOnly:n.showIconOnly(),reverseIconOrder:n.reverseIconOrder(),priority:n._priority,stopIfTrue:n._stopIfTrue},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},u.prototype.fromJSON=function(r){var u,e,h,f,s;if(r){if(u=this,r.ranges)for(u.ranges=[],f=0;f<r.ranges.length;f++)e=r.ranges[f],u.ranges.push(new n.Range(e.row,e.col,e.rowCount,e.colCount));if(r.iconSetType!==t&&r.iconSetType!==i&&u._initIconSetType(r.iconSetType),r.iconCriteria!==t&&r.iconCriteria!==i)for(h=r.iconCriteria.length,f=0;f<h;f++)s=r.iconCriteria[f],u._iconCriteria[f]=new o(s.isGreaterThanOrEqualTo,s.iconValueType,s.iconValue);r.showIconOnly!==t&&r.showIconOnly!==i&&u.showIconOnly(r.showIconOnly);r.reverseIconOrder!==t&&r.reverseIconOrder!==i&&u.reverseIconOrder(r.reverseIconOrder);r.priority!==t&&r.priority!==i&&(u._priority=r.priority);r.stopIfTrue!==t&&r.priority!==i&&(u._stopIfTrue=!1)}},u._getImageSrc=function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAQgCAYAAADvxtzfAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAANyVJREFUeF7tfQl8TFf7/6CvVsXaIkqrtVZqKxq0SCyxxxpr0ailtUYoYilCrLWEqC0h9i2xJyKSEJSiUcQWW4tGFRFEJJlkMs//+Z577yzJzGQm+v5/fd93ns/n+7nnnvN8v2e59z5z7ty5Z1R/u7m4uDR1dXWlFi1aDJOzrDeFfPv2bbJZxJCswGqRnOSYmJg8RZjjgTKxk5MMREVHmRVRyDoBzmhnKBIVFU2RR45QRMThXCIKWckTArCcIhERERQeFk4HDhwwEgFu3bqVnksAllPkwP4DtHfvXgoNDdHlGSKXACynSEhIKO3YsYO2bt1KGzdtovXB6ykwMNC8ACynCMibNm2k4PUSefXq1ZYFYIYiIK8PDtaRf/zxR6sEdOeG0myFvDxguWUBQzKgI69cSQHLA8jff5l5Ac50MSRbQi6Bnj17FkKmLZCpdjM0UwNlCTJNb3wO6C7XvGBSAKaIKJctAswRjg+HDh2i/fv3U4h8dZoVgBm2JDIyksLDw2nf3n20a9cu2rJlS94CiD6KQNjBg7R3zx7auWMnbd68mdavW2dZwJAM7N4dStu3b6dNGzdSUFAQreRrwqxATnJoaCht27aNNmzYQGsD1/LVuJKWLfM3LZCTrPQ3eH2wLs8QRgI5yTu4v5u4v+vk/ioEQx+dQE6y0t9A7q+hMx+ZdoaxQidgSNb1d60UOA3JwplNEdEJGKoCa9asMUtWjPNF4JF3c4tYIiuGACQnJTMUyYts1hSRfJHt9k+xlLUuHi8DmxPj5KMVLg5ytnUmyEEuROnXKWXN57aJGJIVvFjlbJ1ITrL2N2+9yIp6JkVeBroEpaxuLF1MLwObGZEF7ozR5T33/8RIhNPBzxZUpBcrG0oCogVrmuhFmKy9PZLxjV5kcVUhAnLy/Aoi78WKuvrLGSIpqz7Ti4B8czDRjYG6vGcLP6Dk+e+R9uWldOw/X1ZTLwCDyIuAunqRmwOIEvqQ9noPXZ4hnnGrZKreIPLcv6bOSXutO9E1d6LLbYniWxBdakp00VkS+KFSbgEYRJ4trqIXudKWtPEtZXIjogv1RX7yvPKmBWBChEdaCMhkrSB/StrztUX+U793zQukrnWplzy/vNQKmaxFzb8y+bzUxaezipsWkMjvSWQANf/KZNQcx+Rfqon8pJlvmxjEda4uuprzwJPphXMLvPixPr0IqMNnX01xmDDSyQsqUPLcMpQ8uxQ99S1GSTOKUNL3henJ1ILmx+B/2XCN4zLFlYaLRTeQfNbhxMGxx+HDETA5iAgUyhmYF3AkZJqxKde8ctlKAWYUaW8N5cubr9BrHpIAH06ZktskEelsVMhaJmuv9SDt1Q4iH+eE7G5sCF2IPgggQkCuWcs1a68wGZc15+PEkil6U8gIYXASAmg2ggpqBvliY0mAz06ZJpmOzEFUT+5vVLOWydrz9SQBPsVlqp6MMK4jJ3Czr/OAgSznGUIXkXRk/iBRCkWzMdoGZBxewytVFxNBxkeZUpBztCXnKoQoZRgrcMUqAsZkbrbos5wHR5CFM5sSrXDZiwwUGn20GZAR5g3JiiHwIHbIu7lFAHzQmCKbNUMRfNTZRFZMiPCHbb7Idvs3WIl1Dh4l1xWNKx74tu0zd5BLrCt675vY4VR8zduJxVfYIGJIXnEhiLAttvytxLcXWyGSk9zuWCedSNEfCie+PfdN8yKG5ICLgdQ6pr2AGwP7yH9r1r8S35xhQsSIfGkNuUS65cLyS2uFSOFpbyS+6VNIL2JIXh6/mh1X0zJGk3BXhovYIh95KIPfG98VSizkLYvwoaISgYw1Ran4yrep2yl38o9fSZ/u/5zqy/C/vFLkF570Bv1rfCF6w7sgFRptZn7gsPQtWnplBTmFNqRPQj8jp92f8X4AFfZ5wzQhpxX94S1acnUZVdlRl6pur8Ooy/vL0WzrBN6e9yYtvuZP72+uSe9vceKtEy25tpQKjbVySlNkdmFalLCEym2oRuWCq1FZBvYLjbJS4K0ZhemHG4uoVNBHVHrdR2K7iPcLDi9gnUDhqW+wwA9UfO0HOmC/wDfWCkwqRAtvLsyFAkNV1gn8i0cbA4bjjGYX+JYB8mArBexm+TtF2cWywdHwyxgFNgsoDyuAfAlERUXRkagjdOSI9LTDZoGIQ4cE8E1mvgQOHDwgnnAoTzlsFti9e7cO+RLAk40d2yWYFTD3hTwImzdtok2MzZs26wRyQogoX3+dOXNGOCrAl5HrghgGX0oC8IM/eEIAllNk9epVtGr1avFgQoFZsmI5RQJWBFBAwAqxzZOsWE6Rpf7SN7hWkRXLKWITWTFDEZvJiiki+SLbTW/KIPI1U1jOss0g8FoiIBueCzaLgJjzbDQSQWZegIBZEUMHSwiUHxfkElEETp0+TcdPnKDomGg6FBEhPU8KCRHPWzdsCGaBtbRq5apcIiYEYsQz5/0HJIFtEBDPWyGwklYEGMcGvcApFjgutUAIyC2AQHDwBrkF0uMhky3IC6bGQDeIeUERyUW2xhSBfJFhIOWbDAMx32TYa5FhfLYZPwqym3WGyxQjn68jYEi2+QTKSbbpFDZFxjzRKhFTZMwNxRyRY4NFEVNkZW6o4CDPF82K5CQryDlHVJBLBDs5AUdpfrjdaI6YE9z63NcJCkDYvFmaH27irSIgu1g2RSAIc8R1QQL5Eli9ynh+aLOANEeUkC8B/6VLeY64lPzleaLNAosXL9YhXwI5YZOAOcgudrPGHgz7ksxBdrFsfwzuQ3TnTi5YLXB3YHdByAoJ1QH797/ubZ3A7T7ukgDHgqxtOyhz23ax/3v/btYJ3OjRRhAyN26izA0SsH+zZ3vrBK65uwqCek0QqXlupF4TKPavd25pncDldl8IQsayFZSxPIC3AWL/cvum1glccmssCOkLf6CMBYsYP4h95Msuervi4uRw+YtamguNaz6EA4DDBUKa72xK9/VjzBb7yD/a+BOBsHJvvTzw7hsJQuSScw0PEFOjDgtHBWlTpgm8mjzNKD9x5TIKr+5Ie0v+q7YQgJ2p/ZHHL80+pZeRh4TTq/ETGBNlID1B5P+hI6v0ZMVO1HD0+Mm5JqVEhEsio8cKpDIE+Ud/82TFoj8o7QGnF4cOClLq8FHG5KIWyIodciwiRJ6HH7C+5py2r3Qhj32lCj2+7jPW+ppz2u4SKtESm2q2W25LXd+SHk1W5f+p18v1LpQS+HlWvkVeBjWjjMshlBL0Rf5EXq7l4JJ+XRIJNCHy1NeBnvqVpuR5ZSl5QUV6trgyPfevQS8CalPKygaCqDx/NCmSNLOIzsESxMNr3uYSefJ9YcnpXCXpxxnna5MWP1S55CI98cUDazyHxaPzO3xl5hRJmvaGTkAbV50F6pD2gjNp4zkyX20vfkYjHiFD4PYo3U+NhMjqxq9USVMLGrfgV24BC9AlV+nhrWELWEDfgqaaRz6qdqonU1SSQB4wGoPVzhJZjAELPJlSgJ5wV5Kmv0U4KniqnzwXR6WCICgiSD//sZ6ebI09W/i+jvzMv6ZtZBiecAvyDx/aTobhNwZP5znmjwxL9itF+SbbLf9WhOHJCGHEyUAaeSizaM6MhOrVq1OvXr1o2rRpAkgjD2Wyj0nzKlKkiGb8+PEUGxsrgFtfQNlHGXzgK1H05la0aFENfk4NR/zIecWKFTRr1iyazViwYIH4pTTK4ANfcCSqZPFo6rFjx2jVqlXk5+dHM2fOpKnTptKECRPIy8uLxo4dS/Pnzxc+8AVHoqpUTcuXLy/U8TPjuXPnSuSpEnnMmDE0bNgw6t9/APXt00c8a4AvOOBCwAeDBOUlS5aQr69vDvJQGsDkHh49qEP79uTNLYEvOOBCwB9NxA/b0cRpCnm0XPOA/tSjh0Ru4eJCLfjeCb7ggAsBPzhitOfNm0cTDZo9QCF3aM83XS7UyNmZGtSvL3xRzlxfCAxu3bq1aNaiRYtYmclDQeZmi5o76Mh1atchV24FfMFhLk4uVRk+LGp80YABQtNRs4eoGWRXHbkGn0w4nPAFB1wIwPxdZGUMZN++fUWfDcnVq1UjrzFewge+4EhUyUow4keMGCEOEe7cO7u7i2a6NGsmtkv5Xhpl8IGvzDGyCoyzzlwjfrcOZ4z2zp07RBp5KIMP4wMQTBmutnGMRFw87twKQL6QEhkTZB+rzInRUQbSdrPWFi9eXISvd89Jk3xCvL2940aOHBk3ePDQkP79+3t6eHhYPgIcSJynT5+e4OMzmcaNG0cjR42kIUOGiOuiZ8+e1KlTp4Q2bdqYjokcvryYrPGZ7CPIo0aOoiFDh/DlPIB6MblzZ3dya+NGzZo11TRs1Mg4JnIQcZv+/XTNZF3NTBY19+eae4mTqY2bGzVv3ozPxs/42qit+bjqx/qYyDXHKzWP5JqHDuEoJDe7c+fO1IZrbt68uUSuw1dljepUqVIlKSbOmDGjqb7Zxn1GzW5t2lAzQearEuTqNejDDz8kR46JpUqVaqqaxMNtasBwNbq5tdHXXLeuiAcgI6C+88475ODg4KPiQ+U/Stdng5q5z81En6Waq9eoQZU+rCTIpd8pTcWKFaO33nrLX8XXtx9GW0/uLJqtG7A6XLMgKzXryFSoUCFfFdc8WN9sJivN/oxrrss1iz5LNb9T+h09+Q3xuxxP1aBBg8p49PJQS2RltA0GrJJM5j4r5DcKCbI+Jrp3cvfHoVJGu658qKQBc6TSBjXLZEAfEznmleAzLP4zpWbus+Fo68hSs4HcMbFx48YV6tSpfdbwUJWWyW++9aZhzeZjYsWKFYvwGTbO0dEx0XjAxC+hbIuJfJI4FS5cuCMfKntMtMYmz91J5mBNuXA4dvpWLigOeZXbBWQHc7Cm/PXNlLICa8rz7GNe5XYB2cEcrCm3299hpkZXgTXleR7nvMrtArKDOVhT/jdYrRAyCzZTNSsQfDj2mH4tFwwFLI6BXYANjubABkdzEHy7/Q1manQVWFOe53HOq9wuIDuYgzXlf4OZugoVWFOOhKV4kGe5XUByMAtryu32d5ip0VXAZuoqVCD4cLR0nOFoMR7YBdjgaA5scDQHwX99M1WzAmvKkbA0BnmW2wUkB7Owptxuf4eZGl0F1pQjYfE451VuF5AczMKa8tc3U8oKrClHwmIf8yq3C0gOZmFNud3+Zjt9+nSRY8eOecbExIQciYqKi4w8EhcRERESFhHhuXPnTstPuaKPH3eOPno0AW+W4YcaypKoeCHk4MGDtP/AgYQ9e/aYfu58NDbWK+boUY1EjiaumSIOH6bwcJDDQKa9e/fhnQ4Nt8T4uXNsbKwbyGKhxegoOnwkUiIfCqeDYUyWl0XFCyF4VW3Hjh2abdu26Z87Mzle1CzIR+iwIHPNOrKoWZCxhiJ+TrF161bpuTMPWFOFHKnUjGYb1byHdoWE6slbtopfBW3cuLGpKioqxicqWu4zD1juPu+hkF1M3rmLtm8zIlNwcLCPKjIqyl+MtqiZ+wzy/v26mrGi684du2ib1GzxasrGDZtow/pg/PDFXxUZGemnb/ZB8SuXfQYDJmqWm70JZFHzBrGOZNDaIF8VH+PBumYb9Fki6waMm72FyZvEao7r162ndYFBtHbtWk8IlOGa1YK8T+rzLh15h9xnJotmo2YmBzF5zVo1d0F67sxkf5M1K2RpwGTyOvGm4drVa/XPnXft2lUiNDQ0XiyBC/I2ueZNClmqOShQR45fs2aN8XNnrrXC9h07zhoN2IaN4u1Kw5qZeJZh+rkzixTZunnrOD5UiQp5nb7mRK55An4lIrtbNh4gp6CgoI7AulXr7M+d/27rues1Xpr0vPyNl2f8tydHXBlh29qKMJAHXf6WAJtFvrw01Kv/xcHU/+IQgQEXB6cNuDhM/4Zdz7hhuX5nppjHuYFeveIGUK+4gRJ+Gaj2OP+V/tezXX7qWa/z6d6P3X/uLX5rZ2idT/X24jJS4H6qt9r9dB89uc3Jrg3cjnV+6hbbhdyOd9a4He+iE2kd29mrzfEupID31a2OuRv/brdptJvHF0faaJpFtSWgKdKRbT2bH2nrpc9jRLVRM0z/6LfBIRePBuHNNQ3DXahhmCuDt5xuoKTDXNT1w1zxYw7z5rTP2eOTvY00tfY2ptr7GhO2tXjLaXWtfc6WyYpV3VnPo3rop5rqIQ2oemh9qhZaX11tZ33ryIp9tK22x0fba2s+3F5H/eG22p3lbNvso511nSvvcjL7E0K7/Q+Yt6pIMa9insXGFAtx8CoWByCNPJTJXqatuHdxZ4cxxRNqza9N3bd7kPfx8QJIIw9l8JHdjY1r8Xp3QhnN8KhRtP0pz0oYwY830XqGso8y+MBXpklWfExxt7ITy2mW3lwuHBf+sUQEzl7nB1C3c33I41x/Gn9lMv2YuJZmXp5DZSeV04Aj01F78Xg0dWvSDvru1mT68tIg6vkrk8/2oU6ne5BzREuqtK0WtQh3p+o7G1Dbg10IHEF2GOPQ9KMZlUXN3170ovanulObE12o5bFOIo2Y8P7WT2jiuen0KiuNttzZSZ2P9iFwwGWB4j4YpLm3fxCO3572piGnRtOH22tTlZ31RI377oeTYuF/HCH3o73FwIKrcvAq7j/s8Lc08+Yc6n98mHBKzXpFLbm5bSO6093U+yIvMzuTZp6fLyppF92DwAEXo+/31YFBLDBXFEb/FSsIf6U/ogxNhkgnvnpAnSJ7i/JK3LK1f64ncJjrizEY3CrQjbY93Un1DjQVTb6ZclsQYUf/PEGf7GpMH/AgglxrdxMx2OCIk8thtEOZMhPKqoMSg2nitWlUZden9Pn+tvQo/QnNvbhEV+tH2+uK9NBzowm+4IArHQnui+uaFkK5+09fCkKNnQ1FrR/tqMsDWofJtajlYXfa8mQ7wVf0X7FSk0qVwHH9OnyIOJxjLk2gzw66UtWQ+ixQh2qGNqaRv44XZfCBLzgyXbIi3kUqOIwpdrZxwOcUcGelcF71IIgRKNLIQxl8So0pZSbgSlfiOK4hERdPx42dBJBGHpdNyPOKVIwHyKnY2GIdAaTlbLtZZf+9MXHmrTmiDD7wtSkmunGIc4lpT/3ODKYt7ANfcATZMCbOubeQ+jG5F5O7MrkjyMc7k8vRDvR5ZGsx8cKFBt9cMREBZciVEdRTNLuvnhzTgZqAfMiF6h74nBqHu3FLd+aOiesfb5T6jJpP9RCR2RU1H0HNrlSHyTX3NKJqfInjCs0VEzHaSs0go89odgNB/oLJzlR1V336kOOD2ZjYk0fb7YTc7CNu3Gwm72fybj3ZYkycnDBDrpnJXHNdJjtxzdWYbHVM7HtmkFSz3Gz02eaY6H3Zh5zDWthj4v+YubpPoGETlmORyeGMh2KxSQl7VF+rashu5g0C7JzIzhHFllegxodb0ldXh1KdjQ2J8+5xmTPDjRHLOCnT9CYLnCwZ+CEBjQ+3EgIuh9sgX80icSh3+rGW8JNpesst0JI8IRDBAtwCXAvdfulL7aM6WyvQShI43FYS2JYfgWtDpC4Igdq2CshdkAUqWdsChyXlQYjg9HDeXqi+8hMjAbdD7S0IsCMXXuWtp6qnqpBqkMqF02c572GFoBrUYEsjkB9yHt6iMDYICJGcNlhVlQlxjBjGbyxq+qo0K2BoPVXm14qzSsCS/ZcIfDthZf4F7KZS4d01oE+fPjR0kCd9NbCfeMer35cDqFcfvkPr0ZO6dOlGHTq0o1ZuralzJ3fhD+gE/P2XC3zJpJ4e3cm9Uwdq2bIlOTdqQnXq1KLKH1Wn9xzLU/GSJfDKMhVQFdQL9O3dh5Yt9ceODu+3rET1vBqS88zPqYanE5Wq9Y5ROdDFvSu2KtWQrwfTgC/7i8wi775NLX5sS/1+5aneuYHU9ee+1OEkT3tiu1DV4TWpwBtijWUB+X1Xleqrr74Sr+Uis9Wa9jTg1yH0zeUxNCLem/qeG0Rtj3cjV572fMEzl/cHVJYFClJz12aSAAasU6dOVLlzNep3fhCNuvIdBf21kXYl76ZZt+dTh+M9xLSnMd+Ef3HIjRxqFKeCqgLk6iIL9OvXj1q1akVNFrhQ73Nf0XfXp9Ke5wfoYEoEreRb/k7He9JnPGdyPtSCWh11pxoTa4tW6LrQu3dvaty4MTVf05q6nO5Nnue/pSX3Aijo4UYad3kKNYtsLyZcEMFY1JrbgFQFVOTq2lwSQP9r165N9b535v52FU4dTvSkTid6UdPIdnxL/AV9sreR6EL7E93ooxHVjbvQpUsXqlKlCpVtXp5aHO0ovsFsFNGKGhxsTvW45tr7moh5cqujnVigO735/tviPGjuKncB7zU7OjqKfjVc+QU1j24nRrwJi+BDphkLolXuP/WkGt+L/xsQwHuA4OPVPCpeXPw1ChUuWZg+W9mM2vGhAzqc7E6dfvKgtrFdqco4Jx0Z0B1GnJI4PZUCoIyrI33i14BqL/mMPvL6mN6qaFwOuHcxuBYKFCjA/VKJbSHZAfsYbeSJrZyvwOhiUoBjC7g2x7aFvG0mRhyvcKPM0F8I2O1vNu3p00U0EZGe2WHhIZr9++M0obvjMnfsDFFv2eKpzeu5szY62jn78JGE7PBDpNl/gDS795Bm5y7K2rKNsjZsoMy1gQmZq1aZvnfWHIn20hyO1GSHHaJshbxDIW9kchBlrlxNGcuWazIWLTG+d86KjnYTZK5ZIu+lLJmcCXJgEKmZrF4WQBmLl1D6vAWadN85+ntnJsdLzT5ImtAcNTM5c+UqHTlj/kJK95tLaTNmSvfOdCiqqQY17zNutlIzmq1etlxHzvCbQ+kzZlLa1O8pbdKkpipN2CEfZcCy5AHLDEaf13GzpZrVi5YyeQFlzAbZl9IFeTKljZvko+I++wuyqHkrZYGsq5nJSrMFmWue9j2lT5pCad9NpFRvb39VVsheP+OaMWByzYJsULMgc81MfuU9nl6NGeurUm/fOdi4ZkOyUrOv1GcfmTyWyV5jKXXUKE8Vn11l1MEb1FLN8qFCn+fxgBn0OV0hSzVT6sjR6pTRo6V7Z/Xadf6i2csxYPJoz56rr1lp9thxgvxq1BiufbT+3pnWrCmR4b88XjpUC/g465stDdgErhlkb0FmxCcPy/Fs7tXixRXS5y08q/RZd6i45jRudppS88gxZ9PGjDF976xdvLhI2gzfcelTpyXqmi1qxoCNTuRBm6D19rbu3jll/Hin1LHjO6aOGtuRB8t+75xPQ+jC3xEDpsOYGRtWvXr1F127dqXvvvtOAGnkoUxyMW2Ob7/99hEsZRAWFiaWLYmPjxdAGnkogw98JYqBFStW7CgWHo2OjqbHjx/L3+3rDXkogw98ZZrOhqGpR48epczMTJmS21AGEfgyZ7hEVamK8PTmGZqYlJQku5q3J0+eiO6Aw1zxEL8pBun06dOyS952/PhxMbDMbQIBz2+//ZYuX74sF+dtFy9eJHDAFQKYK1+9elUuztsuXbpE4CgCTTF1wXK31hq6K69uKrpQhI9tMv4qITU1VXYxbykpKeJvFcBhru6XEMO/+OILoZydnS275jaNRkM//fQTwRcciaq3GCym8fPPP5tsCfJAhg98JYqxYV2c2AYNGtD69euFM44McPLkSbHsD8rgI/uaNVwwT6tWrUrt2rUTQBp5cpnVlu/L2W56+4fEROwjjOU7JnKRAM5C/MTM5pjIZTpgdRKI2BQTudwIn376qW0xUSEaAkuhWR0TFZIhsPSZPSbaY6LdrDd7TJSNy3T4X42JCskQWF/R6piokAyxcOFC62OiQlKARbjwI3CrYyKX6VC4cGGxvqJNMZHzBbD0F8g2x0QsuIg/MLDHxP9Us8dE2bhMh//2mCivEWsVTMbE2bNn53I0B5MxEXEOUUdxMgeLMRHKb0gLDZqEVTERi/OaaolNMTEwMFA4Ix7aY+J/uv0fx0SELqRtjokIWfIZZwSrYiJOV8Q93jeJPGNi3bp1c5FywmxMxKWsOOUFkzFRXvrZKthjoj0m2u1vsNdejQVE4/VgbDSbBeCoQNm3WcCQ8B8ggAIFyr7NApYIOfdzWV6EnPsiQ4Eph7z2bSbk3P9vEVCQn3275cNeexBBNDqMtprNAnBUoOzbLGDxTMzL/v8LoECBsm+zgCVCzv1clhch577xei9seRFy7guBMTsfvp7A4FV3X0/AcI2bvAg594VAu5EXXk9ABzYUKLBm3275sNceRBCND6ONZrMAHBUo+zYLWD4T87D/AwET14bNAl67rA8wuY2JIzcn2iAARwXy/rC192wTMIyJ2H619I5tAoYxEds+c27YJmC07hdvu025apuAYUzEtpP3JdsEdDCxD0cFpvbtlg977UEE0fgw2mi2C5g4L2wWsBQf8jYmjtr65+sJjNhoPsDkNjgqkPeHBd63TcCwz9h+veJ32wQMYyK2A5bctiCAAgXyvmFMxLbvvJuWBSzFRGx7zrxuWcBSTMS26+QrlgUsxURsO38Xb1nAUkzEtqOX+RgpHHSwYh9EBaLcbvmwHINquzFxjOHFZrMxcfR2fYDJ2+CoQN4fufmBbQI548O3wX/YJmAYE7EdGmhwuedp7GgYE7H9eqXB1ZvLUKBA3jeMidgO9DeIF7mMCyzFRGy/XHjLsoClmIitUcARCQXyvqWYiK3HDH2IExm2xERsjSIWErbERGy7TLhsLGBLTMS20ziDfSRsiYnYth9z0VhAh/zs2y23na6oKnKshMozpqQq5GhJVRyANPJQJruZtujiKmcmJPzyeW26NWYo/bUmQABp5KEMPrK7sXGh1/H3imoeLJ1P9McfEn77TYK8jzL4wFemScaqbicqFtO8OhkrHLWXL1P2kSjSHJBfmGNknz0ryuADX3BkukoVU0IVj6bS/fukPfUzZR+SX08MZfL2HZS1cTNlBq2jLN6ne/dEt8AR5GOlVE1Pf/K+1MwLF0m8JLhvP2WFhJJm23Ymb5LeLvxxJWX4+5Mm8ojwBQdcVUwplQ8Gie7/wc0+IsiakBAmyy8Irg2kzB9/pIwl/pSxYCGpeYuWggMumu//x8LZRHd+o+y9+0izK0R6NTF4A6nXBJJ6BZMX4+XAhZQxy4/Sv59B2uvXCRxwIeB3d6YPC9yRyVspcz3IaykzYIUgp+P9Ppmc5jOFtDduEDjM9VUdLaEafLVfV9GsrF2hlLUumDJXryH18hXSW3bzFlC672xKmzZdvJ6Hd97gCw5OLtUJB1WZ4xWKqTOv8KE7cZLUq1YzeTllLFpMGXPnCXL6VCZPmkyvxk+gTD4S8AUHXHEk0JfLvTqKQ5S1Yyepf1gkkWfOkt7tm8jkcd/xUVhGdPcuwVf0X7GoUqoSnBF/f850cYiy+FCpecTTpk5jsg/3fTpl7T8oyuADX3BkumTRpVUV+BQ9e7GTK6WfOS2ctdeuCSCNPJTBh8mm3+3D1caDOo6RiIsnYciXAuJC4jyueUKeV6Ri3CInrq0jgLScbbd/q/3ernXju1066c8uE/ZbB7fm97p2WCTv6g3k5G++yUr1Hk/3unUKkrONDORnI0ZohE/XjivkbMn+GtD/Ac51wJSIQlZ8UsaM1d5s16KKXKxSYefpkMFppkRykl96jaXf3duMF0RDyykC3O/RJcwqsmKmRKwmKyZEhg7NMCSnjh1nHRkm+jx8RLahAGDu6BjZ7U6tWxn2WbyabK1ITjL6fLdLh7k5x8SkiCmy0mdTA5tLxPBEMjXaEEka/PUrxSfXiXSrTZv32SHV0qFSRED+vVO7EXK23iDyW8f2Q+VdkwaR253aDJJ37fZvs3/WPFGbkCCg7Fs9T8w6HEnpPKXBdAZAOisqSpRZnifevSf9yjkzkzJ4aqcIZPJEk7RaqYx9zM4Ts3hymXVMWpAVBIgIsmyZmD+yD3xNzBPvU/qcuaLGrJM/SQylVjaQRXfYx+Q8UXvtuq7JQPZvv8tUoqwzZ43K4JtrnojRVhwMmy1M7o5OwNw8EWsf5OqzQXcgAh+z88SssHBdv5U+AzqR7GwxiObniXyIsniyaUg2FEEZfPKeJx4My30iHYoQZTbOE68LIG2fJ/7HWlh1x3bh1R0pvEZZ4whkjSnkRzu2kM0iCvnZsWjS3rxF6Rd+tV5EISfHHn2Qfeq0uIPNPn/eOhHDmjUnTgiyAiHy63nzIjry0SjKijlKmbgB3cq3v1hsBneyjOxz51gkLreIjhxzRIR0NW62Bdbxjfc6g/0g0vBlnR73i15kl0pVCDs3p06g7MtXxL2hBL75NIKSt4y0t27RX6sChIhowaGqjk7YeRC0WoT1ND++6dRhrgwpreGBTYo+cgr+aLkQgCki2VeuUtaRKEqbPJVeTeYbT94qQPOf7dktajYiK6aI3AsOvJEVESktYwN4jSNN7Al6tnuXebJiiojmwgXKCj9EqcNHUVZ0DD3btSNvsmK6MeGByk64YbrPeZkicmPUMOtrzmmKSL7IdnsNwwpFtHy5Z/aixSGaOfPjNLNmx2mmfB+i/m6SZ54rE2mXr3LW+i9P0P6wmLLnzScmU9bU7ylr4iTK5NNZ/c3IhMzBg03PE7UBP3plL12myTYkT2PyBB8me5P62xGU8fUQSu83QJPRvbdxRNIGBLgJ8iImz51P2b6zSWNEHklqiUxpHr3pVacumpdt2uvnidn+y+KVmkHOmjadMtHsMTJ5EJO/HEDpTE5z70av2nSgV64t5bXC/P2b6sjcbMOaM9FsJmd8OZDSe3DN7l1lcit6+XkzSmnQqKlKs3CRj+gzasaACTIPGNeskNMMyKlMTv28Ob1s0JhS6jTwUXGf/QVZ1IzR1jdb1CyarZBbM7kZvWzI5LoN6PnHdfxVWb6z/dBnHXn4CKnP/bhmXZ/bU6pLa3rZBM0GuT6l1KxDL6rV9FVppk4fbDTag4ZKA8bNTuskDZhCFs3mml9IZHpRuZqnSjt5chn1aG915nCpzzhU6R69mMzNbis3uwn3Gc2uo5Cd6NmH1dQpjlXltcK+HeEvnSRKs+U+o2b9gFGKE5OrOtHzytXp+QdVDNYKGzasRFrfAfEYMP1oy2S5ZqnPTP5IkOOTK1fOsVaYh0eFNPcuZ41qVsioWfS5Oj37oMpZJptZK6yxR5GXrq3G8YAlpih9lslcc+KzDypPuF+xonXzxJR69ZxefFy344tqH3dM+aCqfZ6Yl2Fh3hHjA+hQdcfh4dUcH+LTSEK5PRE13rNunW12TgyvVi7i6eQpRHvDKDtkH931HID8ewerlXMOr1rWLax6udiwauVMr/CMAnyUqxcsIS0LaFngGV+hLKpmxKH86uCBwk+m6c1IYCEEwvUC3IKMOQtIG7qfkpcvz1sgQwgYtMBWAakFLBDKAhxYbW8Bj4EYRBZ4PmFiDoEAywJ/9uuLQYsQh7N6uQtXunUUAmpZ4PEPP5gXgCMfpqvs4InJJ89OXPhcOIvzInmiD/0xBUfE8SGXW7/O9uEqZapKh9Axhsm/YcojFxmbOQFD2+XkZF9n25KBbF9n+zVNWaX3n7XOdtcmTWj+V560YfQYmty1GzWW3vM0gsl1th1LlaLDfn6kwaPjA/spa9cuysST36B1tLCHBxUuVEgnYHKd7WhM92KiKPvCz5R98QxpIsNJjWew0oq2NLNdB1nAxDrbX7VuTVlhHM5+OUXaZ78TpdwnzaWfKXPDBkHGA9xXywKo/vvvm15neycH0ax9+yn7zAnSJv9O2hf3SPPrKb5/DqR0noxmLFoi7qUDBwwUrci1znYs912sLbt/L2lOHyPNmVjKDN1JGTzA6XPnUQaLZK4Ppv0jRppeZzuYZ2p4VC76vI7v2teulcnzKW32HHHjnblxMy3p3sP0OtvdGjTk0V4vDRju1LlG1JzGN91ovhplLFDt3XfFeWByne1Ib54nL1/BNfPtPh6ZM7CPp+H4EmLLQPGmtYDJdbZLvv02hQz9htSr1kgLEgdLRHXwRgrgpsNHgcV1tjt+Uou2ff01RfGZuLpnL6pRpoxROWBfZ/t/w0aMGOEAyLu225gxY/wAedc28/b2rjBx4sRUAGk523obPXp00L59+whAWs62zry8vOpNnTpV8+DBAwKQRp5cbNrYoQb3tx9jIeMq/uP62rVrAkgjTy7rB1+ZJpo6nTNfzpkzRywuhb9oPn/+PD18+FCs1AMgjTyUwQe+4ICLwSrCiZNYFAFrAiUkJNCZM2fFGkEghB8Kp5ijMSIPZfCBLzjgilYM4/tGzriA/3S+e/cuhXNoxz8t79u7T2zxT9Ph4WGiDD5cexw4gqwYC5RhJGCNixs3boh/WDYE8lAGH/jKNGPjgnZYOOH27du0afNm8QfJmzdvElvkYSEF+MjuuW3UqFGeG/hTCAsrhYaG0sWLF8QaukjHx18ilMFHds9t3DdfnDh//vkn/fbbb2KwAKSRhzL4yO65jQs3YZBQE4/wS95fDCCNPHkAN8nuuY37d5LxlDGdSaXlbBzq0siTy3JP9xVj9X6WLl+UwUfetZs19mhGmdeLiU9nl8p/TEzyK10heWHF/MfEp34lg9JjvPIXE5/5laiXvKSqRpsUZX1MfDLrnRpP55TslzS75MKns0tezfh5BtFfG/OOiUyYzs19+Xx1fUrd04vST/Bc8fpqouRo0v7uk3dMvL+4YpEkv5InX4V5Ej0/wbVuIO29WaS9PYq0NwZaFxOT55cqkTS71IW0qJFET0JJe60Laa+4CVgdE1PmOJThriSkH59A9DCQtL/WJPrVybaYyCdOu5QNLtyNYKIzJUl7tpRtMTHJr4Rn6t4+RPf9iM7XILo307aY+NSvlC9OHkqOpOw/9xMG1qaYyAKbMJBoxdN5777ko2NbTMThTPIr9RTnxvMZxW2PiTgTcQnLu7nMHhPzYRhQS4OapyEmAvKubabERABpOdt6U2IigLScbZ0ZxkQAaeTJxabNXEwEkEaeKGMf+Mq0vGMigDTyUAYf+IIDrumYeF8fEwXujBZxEmXwgS844IpW5IqJV5WY2EZsCVuOkyiDD1/2ceAIsmI5YyLiofZ8TYYTpzk+ch7K4ANfmWZs+pi4nojjIZ0xAMfJlI0teDBL2RYTBX7lNOehDD6ye24zFRMBpJEnnVSlbIuJANLIkwfQ9piINPJEGfvI2bktr5iIMvjIu3b7/2IVvSsWKfM6QbXspHKxZSeWixP/qmmrlZ1Ytt8XK5oSUGaiY6418iwamv3BtEoPVt8LpDX3g+j97yslc3d0Z2aeVnai47zB4UMp8NF6CnoUTEiXm1hupVxs2cpPKv/BJ/NqZW5+tI3GJ/jQuIRJtPnxNnKaV0tT5rv3LEdmWLmJjlu/PzeDZt+ZT1/+8jX1Y/jdWUDIKzfJEQtQmrcyk8o3bbG2Fa3jUO5+oje1j+1O7WJ7UNeTfWjD4y3UdGVzdKWj7J7D+FA5Ti5/cdmtFfTV2W+oUXhLRisdhsaNpkXXl5LjpPK3nGaYeFyCQ9V9hwctuLOEPg51phohn8ngdOhnVDO0ES29t4LgU25SOR+ZJhkOUeUZVZLXPdhALQ93Fv/lbApto3oQfCrPqJxaekpF/QcuDlHv0L7ib5jx/9U//L7MJIIebhA+Hjt78Vg4bpXpOO7lrr43pQI1XPqZVYAvH5GHMl26aMr7lG9gC17rIrPbv8OOOZVxCPu4fANbsNPwZwR4khnh9D791NHFKsAXT0dluvhx39Yr3/H05s4d4tsz8W6fKfCNo/C55jMWz171EepgtYoVohpWT828eIHwF3xZm7dSpsAWgSwFBw8SfNg3+bBTjhjJTfK57D2ctHyXhpfi1KvXUMaqNeJbfgVavv2FD54KyzS94ZlqeI3yt15EHaas0N2UsXARpctAOnP7Tko9fozCP37vIp4KyzRj4351PNOzI0/prlH67LmUNm0GpeF1vFmzxRj80r87116+qexu2nhAjzzavpkyQ3ZLr6F4f0eZu0IJeRhs2c28hVV7r94xlwaa7GtXKU38PnEaIX2sxWeZByqXN/M/7zkMh+j2vJmUffIn8WtRpPlcmScX5204RJF1KydnxJ2j9HNn6HCdyg9wtsrF1hkO1c892hMQXrWs7RMr8etRPHevXg5ryObP0Gyji8ZudvtnW9IcB6cns0o0sAWPZhSvKpFnlViZNLsE5QuzSszju/biJ8Wd6sMfbYI2cS0EwvjuvXhs1vnBRNf7MwbI25xQ8rEdQFpG5s8DuRXF9/PtbvHeT2aXOM1NirMFaPljv2JmJp12s9v/ud33VhV5NKWg55MpBUKeTCkYJ6FACPJQJruZtqQpKufHUwomPFtRh1IPDKaMX5YKII08lMFHdje2x9MKej2Z6aBJPzWHKP22hFdXGDy9k/dRBh/4yjTJkiYXcnviW0KjSYySnF8ck677xHlE92cyfIme7hNl8IEvODJdpeJ+xqOplH6T6MkOogeLmYw36KYT3Z3Ak8vRRLeGSGJpN0S3wBHkR1NVTZN/+ECq+VkkkxcR/YF3174n+h1knsHe4oCT0JcIX8j9yS1jX3DAVT2ZWtAHg0Tpt6Rm/+FHdG8ak79j8giim4OY3Ifoameiy2687SpaCg643PwC/uknuGmv4pk8m5s8lei38US3hzPZk0NYLya5M7kV0cUviH5tQJTyM4EDLreggF9aDDcVAnenMHksk7/hSfdXTO7J5I5E8S2Z/DmT6xOd/4To5S8EDgv4qh5PLTg4ZTv3DV24x7XfGsZkBE8PoisdmNyCyY2Z/ClRnBOnG/FA3iRwcHKp/pysKsMfFGpt8nkivkOnGxx9r3VncnsmuxJdALke0S81ic5V4Up42su+4IArjgT6krKFa+NDRPgS9kpbokvNmcy1/VqHawa5Mgtzq9ISCL6i/4olT1KVwHFNi+Uu4HDiUF1uw/0FuQaLNOTzgg8vl8EHvuDIdMn4HK/A43H2xXpX0jyMlYR4tCnltEgjD2XwYbLpOTOuNnYYx0jExfNyd18BcSFxHtc8Ic8rUrGkySqnx1MKdQSQlrPtZoul7Clc8+Xmt/oDSMvZ1ltaWMG9GdEqyohREdJytvWWduhfezOO/osApOVs6y09oujejNiipGYgLWdbb+mRpfeqT7xD6hOlCWk523pLi3IMzDxVgQCk5WzrLf3oR7Mzf67Ks7GqhLScbb1lnq71TdYvdSjrXB1CWs623rLON+qcdb4xZcUxOC1nW2+Z8a4umostKfNc82yk5ez/JEuPVg3JiFKdAZCWs603Jt0U1wIDaTnbenvtFtjtNewfNk/kmYiAvG/9PPGv9ZQa60ipx0oLpJ/iicXDtaLM8jyRJw90x0tMa1KOvEmkzSSt+k96dexdniN8xpMuniuyj/l54p8rpDlRvIskIJYsSGOBd1iAZ2fnearzx0Lha2KeyLPUaz14auMipjeSgJYo6wULlJbmSedrcxnPm3iSlXue+PKcTG4m5oMpUUWYryFtxp88reEugIwnwHEfm5knYrQxsbrYlNGEXkY7cPPVpH2VwM5lmczzQ8zUfqlubp7IXbjCM1ImY3b26mhJrvkd3hanjJOO0kwtjsmY9pmdJz7wl6d2DSn9eBk+CEmU/fw0qU++xzXzbO1cNZ6Ez7E0T+TDiEPFU9r04+9S9st40vy1gwW4BSBf50m3VfPEB0tJfbqKIKpPlqOsM1x74hJRlo95IoPT9nniP97wMtDICQH0dKbD8Ke+Dg8ZJDCz6J4ns4pZ924fkxOTfB0iNBEF+UaLrw2OSuqYjsR595JmFHdO8i3qljSzaCxvTb9VhgI6oSIBIRBM2Ze+hoCaxeNQ/mqPu/CTaXozKxAvBO7RWY5Y92ZS1qXp1grw3Sl34fUEHrGA1IV7dC6/LVAEzlayTiDrYCEQInA4eXshLfQLWUBqQWbcJEsCDvee+ha9mjSrmCftUhVK9nVw4f2zOC80RyvwtN8D58bDpzOLWf9uH743xSFkYgyfA78lzXDI/7t9NENlf7fPkoFsf7fvNU15M+if9W5ftzZVaOGkJrRpoStNHV6HmtR716gcMP1uX5miFLmRJ1t3xktTvhs8XxDf5PWgxRM+ocL/KqgTMPlu39GtHiJ40KNgxmZOT+eJRW9p+nO5Hc0ZrbxlaOLdPs8ePA+6PZZnpat5JnKV5wW3iB5v5Rb047ljGwHN5W7UwKm46Xf7QgLciG6NkCacaVdYgCdejzdx83tKU0BuASUMpLUzpT9NzfVu38ltPE/C14B3vCWRh2u4RWO45tY8e+PZGb6gu/E17VnW0PS7fZsWfC7Vhhkrvg7Et3rx+CKSyRd4rnylk5iELfSuavrdvh5tKrITvvrEV4FMxKxVnvbRRe7C9b6kTRhE1T+QzgOT7/Zd2MPNvcIfbVc6Sn1G8zGAmOLdHEqhS+oJP8Dku31lS79JcaFMuDGI4SmNCW+1CV/Txjm1dWTA4rt9vdqWp7CVjejnbU1p24K6VLtaUaNywP5un92sskczVI4WP9bzssdTC2wV94b5MdyVPp1fnp4tc3qFuxk523rju5O4jLhllHkrhO9WCuT9+xNDezK5YL/nq52JMn4XSNneVbpPtsZ44Bxwf5R1ew9pf/MWyH5yhu8Ti1+SXSzb4ykF5qFG1Ky9PYIxXKRfRXoRWia7mTbczj3h2Tlq1HIgMULKVXq6oMJDtFB2z20YrLSYSVLtHFC117rJWw6unIdBRQtld2MTX0Qs/ojo1U3SXm4tQPJWSvNnBos8W90o85GPSnpwrxj1VBXiE+ZCxnn+LGAnPMnRcijXIiIbprks6244Pfn+X+EyVTI+5sN0hy2uFtF5BfjSgSHy5DT7vNzdj7tSSHpsLg7btDcSoSwErAAGmSfld8R1In1rpXxjlQemFozlgV6jwOyXUtabSvX/AOf1iiJEERHsAAAAAElFTkSuQmCC"},u.getIcon=function(n,i){var e=[["0,160,16,16","0,180,16,16","0,80,16,16",t,t],["0,100,16,16","0,120,16,16","0,140,16,16",t,t],["0,900,16,16","0,920,16,16","0,880,16,16",t,t],["0,820,16,16","0,840,16,16","0,860,16,16",t,t],["0,780,16,16","0,1000,16,16","0,420,16,16",t,t],["0,680,16,16","0,940,16,16","0,400,16,16",t,t],["0,800,16,16","0,1020,16,16","0,440,16,16",t,t],["0,740,16,16","0,1040,16,16","0,400,16,16",t,t],["0,720,16,16","0,980,16,16","0,380,16,16",t,t],["0,700,16,16","0,960,16,16","0,360,16,16",t,t],["0,160,16,16","0,40,16,16","0,60,16,16","0,80,16,16",t],["0,100,16,16","0,0,16,16","0,20,16,16","0,140,16,16",t],["0,220,16,16","0,340,16,16","0,460,16,16","0,760,16,16",t],["0,600,16,16","0,620,16,16","0,640,16,16","0,660,16,16",t],["0,200,16,16","0,680,16,16","0,940,16,16","0,400,16,16",t],["0,160,16,16","0,40,16,16","0,180,16,16","0,60,16,16","0,80,16,16"],["0,100,16,16","0,0,16,16","0,120,16,16","0,20,16,16","0,140,16,16"],["0,580,16,16","0,600,16,16","0,620,16,16","0,640,16,16","0,660,16,16"],["0,480,16,16","0,500,16,16","0,520,16,16","0,540,16,16","0,560,16,16"],["0,240,16,16","0,260,16,16","0,280,16,16","0,300,16,16","0,320,16,16"]],o=u._getImageSrc(),f=e[n][i],r;return f?(r=f.split(","),{image:o,x:r[0],y:r[1],w:r[2],h:r[3]}):t},u}(c);n.IconSetRule=lt;pt=function(){function r(n,t){this.ignoreBlank=!1;this.expected=n;this.formula=typeof t=="string"?$.trim(t).replace("=",""):t}return r.prototype._concatArray=function(n,t){var i,r;if(t.length===1)if(i=t[0],i instanceof Array)for(r=0;r<i.length;r++)n.push(i[r]);else n.push(i);else for(r=0;r<t.length;r++)i=t[r],i instanceof Array?i.length>0&&n.push(i[0]):n.push(i)},r.prototype.getValidList=function(r,u,f){var e=this,s=[],c,y,l,v,a,h,o;if(e.formula&&e.formula.length>0)c=e.getExpected(r,u,f),c instanceof Array?e._concatArray(s,c):s.push(c);else if(e.expected&&e.expected.length>0&&(y=e.expected,l=y.split(","),l))for(v=n.features.formatter?new n.GeneralFormatter:t,a=0;a<l.length;a++)if((h=l[a],h!==i&&h!==t&&h!=="")&&(o=$.trim(h),o!==i&&o!==t&&o!==""))try{v?s.push(v.Parse(o)):s.push(o)}catch(p){s.push(o)}return s},r.prototype._equals=function(n,t){return n instanceof Date&&t instanceof Date?n.valueOf()===t.valueOf():n===t},r.prototype.evaluate=function(n,r,u,f){var o,s,e;if(f===i||f===t||f==="")return this.ignoreBlank===!0;if(o=this.getValidList(n,r,u),o)for(s=0;s<o.length;s++)if(e=o[s],(e===i||e===t)&&(f===i||f===t))return!0;else if(e!==i&&e!==t&&this._equals(e,f))return!0;return!1},r.prototype.getExpected=function(t,i,r){var s=this,h,c,u,f,o,l,a,e;if(s.formula){if(o=[],l=t.getCalcService(),!l)return s.expected;if(a=l.parse(s.formula,i,r),e=l.evaluateParsedFormula(t._getSheetSource(),a,i,r,!0),e instanceof n.Calc.Reference)for(h=e.getRowCount(0),c=e.getColumnCount(0),u=0;u<h;u++)for(o[u]=[],f=0;f<c;f++)o[u][f]=e.getValue(0,u,f);else if(e instanceof n.Calc.Array)for(h=e.getRowCount(),c=e.getColumnCount(),u=0;u<h;u++)for(o[u]=[],f=0;f<c;f++)o[u][f]=e.getValue(u,f);return o}else return s.expected},r.prototype._isDefaultValue=function(n,t){switch(n){case"ignoreBlank":return t===!1;default:return!1}},r.prototype.toJSON=function(){var n=this,r={expected:n.expected,formula:n.formula,conType:12,ignoreBlank:n.ignoreBlank},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},r.prototype.fromJSON=function(n){n&&(n.expected!==t&&n.expected!==i&&(this.expected=n.expected),n.formula!==t&&n.formula!==i&&(this.formula=n.formula),n.ignoreBlank!==t&&n.ignoreBlank!==i&&(this.ignoreBlank=n.ignoreBlank))},r.fromSource=function(n){return new r(n,t)},r.fromFormula=function(n){return new r("",n)},r}();n.AreaCondition=pt;wt=function(){function r(n){this.rules=[];this._ruleTypes=t;this.worksheet=n}return r.prototype.getRule=function(n){return this.rules[n]},r.prototype.count=function(){return this.rules.length},r.prototype._cloneRanges=function(n){for(var i=[],r=n.length,t=0;t<r;t++)i.push(this.worksheet._getActualRange(n[t]));return i},r.prototype.addSpecificTextRule=function(n,t,i,r){var u=new k(n,t,i);return u.ranges=r,this.addRule(u)},r.prototype.addCellValueRule=function(n,t,i,r,u){var f=new b(n,t,i,r);return f.ranges=u,this.addRule(f)},r.prototype.addDateOccurringRule=function(n,t,i){var r=new tt(n,t);return r.ranges=i,this.addRule(r)},r.prototype.addFormulaRule=function(n,t,i){var r=new g(n,t);return r.ranges=i,this.addRule(r)},r.prototype.addTop10Rule=function(n,t,i,r){var u=new rt(n,t,i);return u.ranges=r,this.addRule(u)},r.prototype.addUniqueRule=function(n,t){var i=new ut(n);return i.ranges=t,this.addRule(i)},r.prototype.addDuplicateRule=function(n,t){var i=new ft(n);return i.ranges=t,this.addRule(i)},r.prototype.addAverageRule=function(n,t,i){var r=new et(n,t);return r.ranges=i,this.addRule(r)},r.prototype.add3ScaleRule=function(n,t,i,r,u,f,e,o,s,h){var c=new ht(n,t,i,r,u,f,e,o,s);return c.ranges=h,this.addRule(c)},r.prototype.add2ScaleRule=function(n,t,i,r,u,f,e){var o=new st(n,t,i,r,u,f);return o.ranges=e,this.addRule(o)},r.prototype.addDataBarRule=function(n,t,i,r,u,f){var e=new ct(n,t,i,r,u);return e.ranges=f,this.addRule(e)},r.prototype.addIconSetRule=function(n,t){var i=new lt(n);return i.ranges=t,this.addRule(i)},r.prototype.addRule=function(t){if(this.worksheet){var i=this;return this.worksheet._bindToAutoRefresh(function(t){if(!t)throw new Error(n.SR.Exp_RuleIsNull);for(var r=0;r<i.rules.length;r++)i.rules[r]._priority++;return t._priority=1,t.ranges=i._cloneRanges(t.ranges),i.rules.push(t),t})(t)}},r.prototype.removeRule=function(n){if(this.worksheet){var t=this;this.worksheet._bindToAutoRefresh(function(n){n&&t.rules.remove(n)})(n)}},r.prototype._removeRange=function(i,r,e,o,s){var k,d,g,nt,tt,it,rt,ut;if(!i.intersect(r,e,o,s))return[i];var h=i.row,p=i.row+i.rowCount-1,c=i.col,w=i.col+i.colCount-1,l=r,a=r+o-1,v=e,y=e+s-1,b=[];return(h!==-1&&c!==-1&&l!==-1&&v!==-1&&(v-c>0&&l-h>0&&(k=new n.Range(h,c,l-h,v-c),b.push(k)),u(y,w)-f(v,c)>=0&&l-h>0&&(d=new n.Range(h,f(v,c),l-h,u(y,w)-f(v,c)+1),b.push(d)),w-y>0&&l-h>0&&(g=new n.Range(h,y+1,l-h,w-y),b.push(g)),v-c>0&&u(a,p)-f(l,h)>=0&&(nt=new n.Range(f(l,h),c,u(a,p)-f(l,h)+1,v-c),b.push(nt)),w-y>0&&u(a,p)-f(l,h)>=0&&(tt=new n.Range(f(l,h),y+1,u(a,p)-f(l,h)+1,w-y),b.push(tt)),v-c>0&&p-a>0&&(it=new n.Range(a+1,c,p-a,v-c),b.push(it)),u(y,w)-f(v,c)>=0&&p-a>0&&(rt=new n.Range(a+1,f(v,c),p-a,u(y,w)-f(v,c)+1),b.push(rt)),w-y>0&&p-a>0&&(ut=new n.Range(a+1,y+1,p-a,w-y),b.push(ut))),b.length>0)?b:t},r.prototype.removeRuleByRange=function(n,t,i,r){if(this.worksheet){var u=this;this.worksheet._bindToAutoRefresh(function(n,t,i,r){var c=[],o,a,f,e,s,v,y,l,h,p;if(u.rules)for(o=0,a=u.rules.length;o<a;o++)if(f=u.rules[o],f&&f.ranges&&f.intersects(n,t,i,r)){for(e=[],s=0,v=f.ranges.length;s<v;s++)y=f.ranges[s],l=u._removeRange(y,n,t,i,r),l&&(e=e.concat(l));e.length>0?f.ranges=e:c.push(f)}for(h=0,p=c.length;h<p;h++)u.rules.remove(c[h])})(n,t,i,r)}},r.prototype.clearRule=function(){if(this.worksheet){var n=this;this.worksheet._bindToAutoRefresh(function(){n.rules.length=0})()}},r.prototype.getRules=function(n,t){var o=this.rules,l,s,h,a,i,r,u,v,y,c,f,e;if(arguments.length===0)return o;for(l=o.length,c=[],f=0;f<l;f++)for(s=o[f],h=s.ranges,a=h.length,e=0;e<a;e++)i=h[e],r=i.row,u=i.col,v=i.rowCount,y=i.colCount,(r===-1||r<=n&&n<r+v)&&(u===-1||u<=t&&t<u+y)&&c.push(s);return c},r.prototype.containsRule=function(n,t,i){return n&&this.rules.contains(n)?n.contains(t,i):!1},r.prototype._clearNullRefRules=function(){var n=this,t,i;if(n.rules)for(t=n.count()-1;t>-1;t--)i=n.rules[t],i.hasNoReference()&&n.removeRule(i)},r.prototype._addRows=function(n,t){var i=this,f,r,u;if(i.rules&&i.worksheet)for(f=i.rules.length,r=0;r<f;r++)u=i.rules[r],u&&u._addRows(n,t)},r.prototype._addColumns=function(n,t){var i=this,f,r,u;if(i.rules&&i.worksheet)for(f=i.rules.length,r=0;r<f;r++)u=i.rules[r],u&&u._addColumns(n,t)},r.prototype._removeRows=function(n,t){var i=this,f,r,u;if(i.rules&&i.worksheet)for(f=i.rules.length,r=0;r<f;r++)u=i.rules[r],u&&u._removeRows(n,t)},r.prototype._removeColumns=function(n,t){var i=this,f,r,u;if(i.rules&&i.worksheet)for(f=i.rules.length,r=0;r<f;r++)u=i.rules[r],u&&u._removeColumns(n,t)},r.prototype._clearCache=function(){var n=this.rules,r,i,u;if(n!=t&&n.length>0)for(i=0,u=n.length;i<u;i++)r=n[i],r instanceof c&&r._clearCache()},r.prototype.toJSON=function(){for(var u,n=[],r=0;r<this.rules.length;r++)u=this.rules[r],n.push(u?u.toJSON():t);return n.length===0?i:{rules:n}},r.prototype.fromJSON=function(n){var r,u,i,e,f;if(n&&n.rules)for(this.rules=[],r=0;r<n.rules.length;r++)u=n.rules[r],i=t,u&&(e=this._getRuleTypes(),f=e[u.ruleType],f&&(i=new f,i.fromJSON(u))),i&&this.rules.push(i)},r.prototype._getRuleTypes=function(){if(!this._ruleTypes){var n={};n[0]=e;n[1]=b;n[2]=k;n[3]=g;n[4]=tt;n[5]=rt;n[6]=ut;n[7]=ft;n[8]=et;n[9]=c;n[10]=st;n[11]=ht;n[12]=ct;n[13]=lt;this._ruleTypes=n}return this._ruleTypes},r}();n.ConditionalFormats=wt})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(n){function u(n){if(n===i||n===t)return 0;else if(typeof n=="number")return n;else if(typeof n=="string"){var r=parseFloat(n);if(!isNaN(r)&&r.toString()===n.toString())return r}return t}function f(n){if(n instanceof Date)return n;else if(typeof n=="string")return new Date(n);return t}var t,i,r;n.feature("dataValidator",["core.common"]);t=null;i=undefined;r=function(){function r(n){var i=this;i.condition=t;i.type=0;i.errorStyle=0;i.ignoreBlank=!0;i.inCellDropdown=!0;i.showInputMessage=!0;i.showErrorMessage=!0;i.inputTitle="";i.errorTitle="";i.inputMessage="";i.errorMessage="";i.comparisonOperator=t;i._init();i.condition=n;i.condition&&(i.condition.ignoreBlank=i.ignoreBlank);i.type=7}return r.prototype.IgnoreBlank=function(n){var t=this;return arguments.length<=0?t.ignoreBlank:(t.ignoreBlank=n,t.condition&&(t.condition.ignoreBlank=n),t)},r.prototype._init=function(){var n=this;n.errorStyle=0;n.ignoreBlank=!0;n.inCellDropdown=!0;n.showInputMessage=!0;n.showErrorMessage=!0;n.inputTitle="";n.errorTitle="";n.inputMessage="";n.errorMessage="";n.comparisonOperator=6},r.prototype.value1=function(){var i=this,n=i.condition&&i.condition.item1?i.condition.item1:i.condition;return n?n.formula&&n.formula.length>0?"="+$.trim(n.formula.toString().toUpperCase()).replace("=",""):n.expected:t},r.prototype.value2=function(){var i=this,n=i.condition&&i.condition.item2?i.condition.item2:i.condition;return n?n.formula&&n.formula.length>0?"="+$.trim(n.formula.toString().toUpperCase()).replace("=",""):n.expected:t},r.prototype.isValid=function(n,r,e,o){var h=this,c,s;if(h.condition){if(h.IgnoreBlank(h.ignoreBlank),h.condition.ignoreBlank&&(o===i||o===t||o===""))return!0;if(c=o,o!==i&&o!==t)switch(h.type){case 0:return!0;case 2:case 1:s=u(o);s!==i&&s!==t&&(c=s);break;case 4:case 5:s=f(o);s!==i&&s!==t&&(c=s);break;case 7:case 3:case 6:break}return h.condition.evaluate(n,r,e,c,c)}return!0},r.prototype.reset=function(){this._init();this.type=7;this.condition=t},r.prototype.getValidList=function(i,r,u){if(!n.features.conditionalFormat)return t;var f=this;return f.condition!=t&&f.type===3&&f.condition instanceof n.AreaCondition?f.condition.getValidList(i,r,u):t},r.prototype._isDefaultValue=function(n,i){switch(n){case"errorStyle":return i===0;case"ignoreBlank":return i===!0;case"inCellDropdown":return i===!0;case"showInputMessage":return i===!0;case"showErrorMessage":return i===!0;case"inputTitle":return i==="";case"errorTitle":return i==="";case"inputMessage":return i==="";case"errorMessage":return i==="";case"comparisonOperator":return i===6;case"type":return i===0;case"condition":return i===t;default:return!1}},r.prototype.toJSON=function(){var n=this,f={errorStyle:n.errorStyle,ignoreBlank:n.ignoreBlank,inCellDropdown:n.inCellDropdown,showInputMessage:n.showInputMessage,showErrorMessage:n.showErrorMessage,inputTitle:n.inputTitle,errorTitle:n.errorTitle,inputMessage:n.inputMessage,errorMessage:n.errorMessage,comparisonOperator:n.comparisonOperator,type:n.type,condition:n.condition},r={},t,u;for(t in f)u=f[t],n._isDefaultValue(t,u)||(r[t]=u);return $.isEmptyObject(r)?i:r},r.prototype.fromJSON=function(r){var u;if(r){if(u=this,n.features.conditionalFormat&&r.condition!==t&&r.condition!==i){var f=t,o=u._getConditionTypes(),e=o[r.condition.conType];e&&(f=new e,f.fromJSON(r.condition));u.condition=f}r.type!==t&&r.type!==i&&(u.type=r.type);r.comparisonOperator!==t&&r.comparisonOperator!==i&&(u.comparisonOperator=r.comparisonOperator);r.errorStyle!==t&&r.errorStyle!==i&&(u.errorStyle=r.errorStyle);r.ignoreBlank!==t&&r.ignoreBlank!==i&&(u.ignoreBlank=r.ignoreBlank);r.inCellDropdown!==t&&r.inCellDropdown!==i&&(u.inCellDropdown=r.inCellDropdown);r.showInputMessage!==t&&r.showInputMessage!==i&&(u.showInputMessage=r.showInputMessage);r.showErrorMessage!==t&&r.showErrorMessage!==i&&(u.showErrorMessage=r.showErrorMessage);r.inputTitle!==t&&r.inputTitle!==i&&(u.inputTitle=r.inputTitle);r.errorTitle!==t&&r.errorTitle!==i&&(u.errorTitle=r.errorTitle);r.inputMessage!==t&&r.inputMessage!==i&&(u.inputMessage=r.inputMessage);r.errorMessage!==t&&r.errorMessage!==i&&(u.errorMessage=r.errorMessage)}},r.prototype._getConditionTypes=function(){if(!this._dict){var t={};t[0]=n.RelationCondition;t[1]=n.NumberCondition;t[2]=n.TextCondition;t[3]=n.ColorCondition;t[4]=n.FormulaCondition;t[5]=n.DateCondition;t[6]=n.DateExCondition;t[7]=n.TextLengthCondition;t[8]=n.Top10Condition;t[9]=n.UniqueCondition;t[10]=n.AverageCondition;t[11]=n.CellValueCondition;t[12]=n.AreaCondition;this._dict=t}return this._dict},r.getImageSrc=function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAMOSURBVHjaXJNdaJRHFIbfM7PfGremUTfkpxgpiheiBOmFtYUgRXNRqNnd75sEhBoIKhrwQpFUUSsihhIQ41+FNrUGqYhRY43STZqgARNRTIzRaFqz6xJTtals3K8xRQ3x7UV215+LB2bOxTNn3jMDs+mEIgmS+LwQiqSQ9JG03FHX54666pn7TLmJEZVIjCCRGMkYGxvNiI9FvaENZzLw/PmqtCDFV/4WkERw8TI03K6XqqrNWLBgPoafDmNwMCbd3TestpMDHpJAuIcWSZjSUrnS0SFOWamXJLpuDYAkAiYAkioYDCIej0+Lx12QrervFxOemjWfCvIyIcmTVeLVC1986OkUklhRtlgutLYrkpnOKlt1dl0BSfTHmnCnm5oTm0AS6I0xLaDLrK1PusTp/cb7/rUAyH8kSL+Vqt0ebpuGP699LCRROAdqf/suGforCpLi4DMpAOQQLAEgfE2sRDZIv5cknGxi74HDFnZ/32olk9f//vOTPIj05ZnKZpp14QlnfZgpTOXvNGsvjrvuH9MnOwAOYlhQ/UPYmxRkJVvzPHw8JF8EdrKoZEeapSt2cHDo4Sxn7R0hiV8/hEQe3Ad21jZNJQnbDklSBBas0ddvRj2Fi4qZIhaL+Q3ni8N0ZohGe4Dv6sKZfFP0kvkSWLZdGvLpiUTuTS9cVMxI5H5+fz+UfXyOto/Ns5bUL7dyjsBjTsKDbbVnM0iqYNHXYi9ZLiSlaRbFn089zlzvwN1IzkDlmDhfdiin5KgOBY5qO9iojX1K9+VRcOCXnlySsFkOkjj/WGschtR0Kt/Ga9D2aYj5DWKaIeYSxTlFMS2T66udBDbXHS94Z97ZUB8Ayt7+iVVddlkzl5LCvrklvQ9dr1fnF0IQbng5O/VQsmAJSfnxSLuqCG3Rxxpfz3xbXv0IEkzm5YR7lXOCGs6+PVNJYjaQnoKwSgBIDSqkjjPUuv3QLP9ImW+hG1/lKJtzp5jaCmW2nrNAUpOUkqrWrJUb23T5rhZf0eoWhbeEKX7O4eTPHe8DSTjF59T/AwCfnhbaDaIICgAAAABJRU5ErkJggg=="},r.isFormula=function(n){return n&&n[0]==="="},r.createNumberValidator=function(i,u,f,e){var a;if(!n.features.conditionalFormat)return t;var s=r.isFormula(u)?u.replace("=",""):t,h=r.isFormula(u)?t:u,v=r.isFormula(f)?f.replace("=",""):t,y=r.isFormula(f)?t:f,o=t,c,l,p=n.ComparisonOperator,w=n.GeneralCompareType,b=n.RelationCompareType;switch(i){case 6:c=new n.NumberCondition(3,h,s);c.integerValue=e;l=new n.NumberCondition(5,y,v);l.integerValue=e;o=new n.RelationCondition(1,c,l);break;case 7:c=new n.NumberCondition(4,h,s);c.integerValue=e;l=new n.NumberCondition(2,y,v);l.integerValue=e;o=new n.RelationCondition(0,c,l);break;case 0:o=new n.NumberCondition(0,h,s);o.integerValue=e;break;case 1:o=new n.NumberCondition(1,h,s);o.integerValue=e;break;case 2:o=new n.NumberCondition(2,h,s);o.integerValue=e;break;case 3:o=new n.NumberCondition(3,h,s);o.integerValue=e;break;case 4:o=new n.NumberCondition(4,h,s);o.integerValue=e;break;case 5:o=new n.NumberCondition(5,h,s);o.integerValue=e;break}return a=new r(o),a.type=e?1:2,a.comparisonOperator=i,a},r.createDateValidator=function(i,u,f){var l;if(!n.features.conditionalFormat)return t;var o=r.isFormula(u)?u.replace("=",""):t,s=r.isFormula(u)?t:u,a=r.isFormula(f)?f.replace("=",""):t,v=r.isFormula(f)?t:f,e=t,h,c,y=n.ComparisonOperator,p=n.DateCompareType,w=n.RelationCompareType;switch(i){case 6:h=new n.DateCondition(5,s,o);c=new n.DateCondition(3,v,a);e=new n.RelationCondition(1,h,c);break;case 7:h=new n.DateCondition(2,s,o);c=new n.DateCondition(4,v,a);e=new n.RelationCondition(0,h,c);break;case 0:e=new n.DateCondition(0,s,o);break;case 1:e=new n.DateCondition(1,s,o);break;case 2:e=new n.DateCondition(4,s,o);break;case 3:e=new n.DateCondition(5,s,o);break;case 4:e=new n.DateCondition(2,s,o);break;case 5:e=new n.DateCondition(3,s,o);break}return l=new r(e),l.type=4,l.comparisonOperator=i,l},r.createTextLengthValidator=function(i,u,f){var l;if(!n.features.conditionalFormat)return t;var o=r.isFormula(u)?u.replace("=",""):t,s=r.isFormula(u)?t:u,a=r.isFormula(f)?f.replace("=",""):t,v=r.isFormula(f)?t:f,e=t,h,c,y=n.ComparisonOperator,p=n.GeneralCompareType,w=n.RelationCompareType;switch(i){case 6:h=new n.TextLengthCondition(3,s,o);c=new n.TextLengthCondition(5,v,a);e=new n.RelationCondition(1,h,c);break;case 7:h=new n.TextLengthCondition(4,s,o);c=new n.TextLengthCondition(2,v,a);e=new n.RelationCondition(0,h,c);break;case 0:e=new n.TextLengthCondition(0,s,o);break;case 1:e=new n.TextLengthCondition(1,s,o);break;case 2:e=new n.TextLengthCondition(2,s,o);break;case 3:e=new n.TextLengthCondition(3,s,o);break;case 4:e=new n.TextLengthCondition(4,s,o);break;case 5:e=new n.TextLengthCondition(5,s,o);break}return l=new r(e),l.type=6,l.comparisonOperator=i,l},r.createFormulaValidator=function(i){var u,f;return n.features.conditionalFormat?(u=i,u&&u.charAt(0)==="="&&(u=u.substr(1)),f=new r(new n.FormulaCondition(4,u)),f.type=7,f):t},r.createFormulaListValidator=function(i){if(!n.features.conditionalFormat)return t;var u=new r(n.AreaCondition.fromFormula(i));return u.type=3,u},r.createListValidator=function(i){if(!n.features.conditionalFormat)return t;var u=new r(n.AreaCondition.fromSource(i));return u.type=3,u},r}();n.DefaultDataValidator=r})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){(function(n){var yi,pi,wi,dt,gt,ni,ti;n.feature("celltype",["core.common","core.sheet_action","core.basecelltype"]);var ii="undefined",t=null,i=undefined,c=Math.max,ut=Math.min,it=Math.floor,ri=Math.round,u=window.document,e="position",o="absolute",v="margin",l="font",r="left",ft="right",f="top",di="bottom",et="alphabetic",gi="middle",at="center",g="gcUIElement",a="none",s="0",ui="#F6FAFB",fi="#D2DBEB",nt="#34B4E3",vt="#A6F4FF",y=".gcEditingInput",yt="keydown"+y,pt="keyup"+y,wt="mousedown"+y,bt="mouseup"+y,ei="mouseout"+y,oi="mousemove"+y,si="click"+y,ot="width",st="height",rt="padding",b="hidden",nr="visibility",tr="word-wrap",tt="overflow",kt="resize",k="border",d="outline",ht="box-shadow",p="box-sizing",w="color",hi="border-width",ci="border-style",li="border-color",ct="white-space",h="background-color",ai="max-width",vi="max-height";(function(n){n[n.Text=0]="Text";n[n.Index=1]="Index";n[n.Value=2]="Value"})(n.EditorValueType||(n.EditorValueType={}));yi=n.EditorValueType,function(n){n[n.top=0]="top";n[n.bottom=1]="bottom";n[n.left=2]="left";n[n.right=3]="right"}(n.CheckBoxTextAlign||(n.CheckBoxTextAlign={}));pi=n.CheckBoxTextAlign,function(n){n[n.Blank=0]="Blank";n[n.Self=1]="Self";n[n.Parent=2]="Parent";n[n.Top=3]="Top"}(n.HyperLinkTargetType||(n.HyperLinkTargetType={}));wi=n.HyperLinkTargetType;dt=function(y){function nt(){y.call(this);var n=this;n.allowOverflow=!1;n._checkboxSize=12;n._caption="";n._textTrue="";n._textIndeterminate="";n._textFalse="";n._textAlign=3;n._isThreeState=!1}return __extends(nt,y),nt.prototype.paintValue=function(u,f,e,o,s,h,c,l){var ht,ut;if(u){u.save();u.rect(e,o,s,h);u.clip();u.beginPath();var y=this,d=y._getDisplayText(f),g=0,p=0,st=l.sheet;st&&(g=st._getStringWidthByCanvas(d,c.font),p=st._getFontHeight(c.font),d&&(ht=d.split(/\r\n|\r|\n/),p*=ht.length));var a=y._checkboxSize/2,ct=new n.Rect(++e,++o,--s,--h),w=parseInt((e+y._getCheckBoxLeft(c,ct,g)).toString()),v=parseInt((o+y._getCheckBoxTop(c,ct,p)).toString()),rt=r,nt=w+1;c.hAlign===1?(rt=at,nt+=a):c.hAlign===2&&(rt=ft,nt+=a*2);ut=c.font;ut&&u.font!==ut&&(u.font=ut);c.foreColor&&(u.fillStyle=c.foreColor);var b=c.textDecoration,tt=l.fontInfo.fontSize,ot=tt>8?it((tt-8)/5+2):1,k=p/2-tt/2+ot;u.textBaseline!==et&&(u.textBaseline=et);y._textAlign===2?(u.textAlign=ft,u.fillText(d,w+1-2,v+a+p/2-k),b&&y._renderTextDecoration(u,b,w+1-2,v+a+p/2-k,g,tt,ot)):y._textAlign===0&&(u.textAlign=rt,u.fillText(d,nt,v-2-k),b&&y._renderTextDecoration(u,b,nt,v-2-k,g,p));u.strokeStyle="black";u.strokeRect(w+.5,v+.5,a*2+.05,a*2+.05);u.fillStyle="white";u.fillRect(w+1,v+1,a*2-1,a*2-1);y._isThreeState&&(f===t||f===i)?(u.beginPath(),u.fillStyle="green",u.rect(w+3,v+3,(a-2.5)*2,(a-2.5)*2),u.fill()):!!f==!0&&(u.beginPath(),u.lineWidth=2.5,u.moveTo(w+3,v+a),u.lineTo(w+a,v+a*2-3.5),u.lineTo(w+a*2-1.5,v+3),u.stroke());c.foreColor&&(u.fillStyle=c.foreColor);y._textAlign===3?(u.textAlign=r,u.fillText(d,w+1+a*2+2,v+a+p/2-k),b&&y._renderTextDecoration(u,b,w+1+a*2+2,v+a+p/2-k,g,tt,ot)):y._textAlign===1&&(u.textAlign=rt,u.fillText(d,nt,v+a*2+2+p-k),b&&y._renderTextDecoration(u,b,nt,v+a*2+2+p-k,g,tt,ot));u.restore()}},nt.prototype.focus=function(n,t){n&&n.focus()},nt.prototype._formatEditorValue=function(n,t,i,r){return i},nt.prototype._getCheckBoxLeft=function(n,t,i,r){var u=t.x-1,o=t.width+1,s=0,f=0,e=this,h;return e._textAlign===0||e._textAlign===1?(f=u+5,n.hAlign===1?f=u+o/2-e._checkboxSize/2:n.hAlign===2&&(f=u+o-5-e._checkboxSize)):e._textAlign===2?(s=e._checkboxSize+i,f=u+5+i,n.hAlign===1?f=u+o/2-s/2+i:n.hAlign===2&&(f=u+o-5-s+i)):(s=e._checkboxSize+i,f=u+5,n.hAlign===1?f=u+o/2-s/2:n.hAlign===2&&(f=u+o-5-s)),h=f-u,r&&$.browser.msie&&(h-=3),h},nt.prototype._getCheckBoxTop=function(n,t,i,r){var u=t.y-1,e=t.height+1,o=0,f=0,s=this,h;return s._textAlign===0?(o=s._checkboxSize+i,f=u+5+i,n.vAlign===1?f=u+e/2-o/2+i:n.vAlign===2&&(f=u+e-5-o+i)):s._textAlign===1?(o=s._checkboxSize+i,f=u+5,n.vAlign===1?f=u+e/2-o/2:n.vAlign===2&&(f=u+e-5-o)):(f=u+5,n.vAlign===1?f=u+e/2-s._checkboxSize/2:n.vAlign===2&&(f=u+e-5-s._checkboxSize)),h=f-u,r&&$.browser.msie&&(h-=3),h},nt.prototype.createEditorElement=function(n){var c=u.createElement("div"),t=$(c),i,r,f;return t.css(e,o).css(v,s).css(rt,s).css(tt,b).css(kt,a).css(k,"2px #5292f7 solid").css(d,a).css(ht,"1px 2px 5px rgba(0,0,0,0.4)").css(p,"content-box").attr("tabindex",1).attr(g,"gcEditingInput"),i=$("<input/>"),i.attr("type","checkbox"),t.append(i),r=$("<span><\/span>"),r.css(e,o).css(l,"normal 10pt Arial").css("cursor","default").css(ct,"nowrap"),t.append(r),f=$("<div><\/div>"),f.css(e,o).css(h,"green").css(ot,(this._checkboxSize/2-2.5)*2).css(st,(this._checkboxSize/2-2.5)*2),t.append(f),c},nt.prototype._getNextState=function(n){return this._isThreeState?n===t||n===i?!1:!!n==!0?t:!0:!n},nt.prototype.setEditorValue=function(n,r,u){if(n&&n.children[0]&&n.children[1]&&n.children[2]){var f=u&&u.sheet&&u.sheet._startEditByKeydown;f||(r=this._getNextState(r));this._isThreeState?r===t||r===i?(n.children[0].checked=!1,$(n.children[2]).show()):(n.children[0].checked=!!r,$(n.children[2]).hide()):n.children[0].checked=!!r;$(n.children[1]).text(this._getDisplayText(r))}},nt.prototype.getEditorValue=function(n,i){return n&&n.children[0]&&n.children[1]&&n.children[2]?this._isThreeState?$(n.children[2]).is(":visible")?t:n.children[0].checked:n.children[0].checked:t},nt.prototype._triggerButtonClicked=function(t,i,r){var u=t.parent;u&&u._trigger(n.Events.ButtonClicked,{sheet:t,sheetName:t._name,row:i,col:r})},nt.prototype.activateEditor=function(t,i,u,e){var s=t&&e&&e.sheet,o;if(s){var c=$(t),l=s._eventHandler._getCanvasOffset(),a=s._bounds;c.css(f,l.top+a.y+u.y-2).css(r,l.left+a.x+u.x-2).css(h,i.backColor?i.backColor:"white");o=this;c.bind(wt,function(t){n.util.cancelDefault(t)});c.bind(bt,function(n){var r=o.getEditorValue(t,e);o.setEditorValue(t,r,e);o.updateEditor(t,i,u,e);o._triggerButtonClicked(s,s._activeRowIndex,s._activeColIndex)});c.bind(yt,function(t){if(t.keyCode!==32||t.ctrlKey||t.shiftKey||t.altKey)t.keyCode!==8||t.ctrlKey||t.shiftKey||t.altKey||n.util.cancelDefault(t);else return o._isKeyDown=!0,n.util.cancelDefault(t),!1});c.bind(pt,function(n){if(o._isKeyDown&&n.keyCode===32&&!n.ctrlKey&&!n.shiftKey&&!n.altKey){o._isKeyDown=!1;var r=o.getEditorValue(t,e);o.setEditorValue(t,r,e);o.updateEditor(t,i,u,e);o._triggerButtonClicked(s,s._activeRowIndex,s._activeColIndex)}});t.children[0]&&$(t.children[0]).bind("click",function(t){n.util.cancelDefault(t)})}},nt.prototype.updateEditor=function(n,i,u,e){var c=n&&e&&e.sheet,p,d,a,v,b,rt,h,y,ut,ft;if(c){$(n).width(u.width).height(u.height);var et=$(n),g=c._render,nt=c._eventHandler._getCanvasOffset(),tt=c._bounds;et.css(f,nt.top+tt.y+u.y-2).css(r,nt.left+tt.x+u.x-2);var o=n.children[0],it=n.children[1],k=n.children[2];if(o&&it&&k){p=$(it);d=p.text();i.foreColor&&p.css(w,i.foreColor);a=t;a=i.font?i.font:g._getDefaultFont();c._zoomFactor>1&&(a=g._getZoomFont(a));p.css(l,a);v=c._getStringWidth(d,a);b=c._getFontHeight(a);d&&(rt=d.split(/\r\n|\r|\n/),b*=rt.length);var s=this,ot=s._getCheckBoxLeft(i,u,v,!0),st=s._getCheckBoxTop(i,u,b,!0);$(o).css("margin-left",ot).css("margin-top",st);h=0;y=0;s._textAlign===0?(h=o.offsetLeft,i.hAlign===1?h=o.offsetLeft+s._checkboxSize/2-v/2:i.hAlign===2&&(h=o.offsetLeft+s._checkboxSize-v),y=o.offsetTop-b):s._textAlign===1?(h=o.offsetLeft,i.hAlign===1?h=o.offsetLeft+s._checkboxSize/2-v/2:i.hAlign===2&&(h=o.offsetLeft+s._checkboxSize-v),y=o.offsetTop+o.offsetHeight):s._textAlign===2?(h=o.offsetLeft-v-2,y=o.offsetTop+s._checkboxSize/2-b/2):(h=o.offsetLeft+o.offsetWidth+2,y=o.offsetTop+s._checkboxSize/2-b/2);$.browser.msie&&(h+=3,y+=3);p.css(r,h).css(f,y);s._isThreeState?(ut=o.offsetLeft+(o.offsetWidth-k.offsetWidth)/2,ft=o.offsetTop+(o.offsetHeight-k.offsetHeight)/2,$(k).css(r,ut).css(f,ft).toggle().toggle()):$(k).hide();i.textDecoration&&s._setEditStatusTextDecoration(p,i.textDecoration)}}},nt.prototype.caption=function(n){return arguments.length===0?this._caption:(this._caption=n,this)},nt.prototype.textTrue=function(n){return arguments.length===0?this._textTrue:(this._textTrue=n,this)},nt.prototype.textIndeterminate=function(n){return arguments.length===0?this._textIndeterminate:(this._textIndeterminate=n,this)},nt.prototype.textFalse=function(n){return arguments.length===0?this._textFalse:(this._textFalse=n,this)},nt.prototype._getDisplayText=function(n){var r=this;return r._isThreeState&&(n===t||n===i)?r._textIndeterminate||r._caption:!!n==!0?r._textTrue||r._caption:r._textFalse||r._caption},nt.prototype.textAlign=function(n){return arguments.length===0?this._textAlign:(this._textAlign=n,this)},nt.prototype.isThreeState=function(n){return arguments.length===0?this._isThreeState:(this._isThreeState=n,this)},nt.prototype.getHitInfo=function(n,r,u,f,e){if(e){var o=e.sheetArea;if(o===t||o===i||o===3)return{x:n,y:r,row:e.row,col:e.col,cellRect:f,sheetArea:o,isReservedLocation:!0,sheet:e.sheet}}return t},nt.prototype.processMouseDown=function(n){if(!n)return!1;n.isReservedLocation&&(this._isMouseDownReservedLocation=!0)},nt.prototype.processMouseUp=function(t){var u,r;if(!t)return!1;if(u=this,r=t.sheet,u._isMouseDownReservedLocation&&r&&t.isReservedLocation){u._isMouseDownReservedLocation=!1;var f=t.row,e=t.col,o=t.sheetArea,i=r._getModel(o).getNode(f,e,!0);if(i._isFirstMouseUp)delete i._isFirstMouseUp,i._mouseupToken&&(window.clearTimeout(i._mouseupToken),delete i._mouseupToken);else{var s=r.getValue(f,e,o),h=u._getNextState(s),c={row:f,col:e,newValue:h,autoFormat:!0},l=new n.UndoRedo.CellEditUndoAction(r,c);return r._doCommand(l),u._triggerButtonClicked(r,f,e),i._isFirstMouseUp=!0,i._mouseupToken=window.setTimeout(function(){delete i._isFirstMouseUp;i._mouseupToken&&(window.clearTimeout(i._mouseupToken),delete i._mouseupToken)},250),!0}}return!1},nt.prototype.processMouseLeave=function(n){if(!n)return!1;this._isMouseDownReservedLocation=!1},nt.prototype.isReservedKey=function(n,t){return n.keyCode===32&&!n.ctrlKey&&!n.shiftKey&&!n.altKey?!0:!1},nt.prototype.processKeyUp=function(t,i){var r=i.sheet;if(!r)return!1;var u=r.getActiveRowIndex(),f=r.getActiveColumnIndex(),e=r._getSheetArea(r.activeRowViewportIndex,r.activeColViewportIndex),o=r.getValue(u,f,e),s=this._getNextState(o),h={row:u,col:f,newValue:s,autoFormat:!0},c=new n.UndoRedo.CellEditUndoAction(r,h);return r._doCommand(c),this._triggerButtonClicked(r,u,f),!0},nt.prototype._getAutoFitWidth=function(t,i,r,u,f,e){var o=this,s=n.CellTypeContext._getAutoFitWidth(t,i,o._getDisplayText(i),u,f,e);return o._textAlign===0||o._textAlign===1?s=c(s,o._checkboxSize):s+=o._checkboxSize,s+5+2},nt.prototype._getAutoFitHeight=function(t,i,r,u,f,e){var o=this,s=n.CellTypeContext._getAutoFitHeight(t,i,o._getDisplayText(i),u,f,e);return o._textAlign===0||o._textAlign===1?s+=o._checkboxSize:s=c(s,o._checkboxSize),s+5},nt.prototype._cancelDefaultKeydown=function(t){t.keyCode!==32||t.ctrlKey||t.shiftKey||t.altKey||n.util.cancelDefault(t)},nt.prototype.isImeAware=function(n){return!1},nt.prototype._isDefaultValue=function(n,t){switch(n){case"caption":return t==="";case"textTrue":return t==="";case"textIndeterminate":return t==="";case"textFalse":return t==="";case"textAlign":return t===3;case"isThreeState":return t===!1;default:return!1}},nt.prototype.toJSON=function(){var n=this,r={type:5,caption:n.caption(),textTrue:n.textTrue(),textIndeterminate:n.textIndeterminate(),textFalse:n.textFalse(),textAlign:n.textAlign(),isThreeState:n.isThreeState()},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},nt.prototype.fromJSON=function(n){if(n){var r=this;n.caption&&r.caption(n.caption);n.textTrue&&r.textTrue(n.textTrue);n.textIndeterminate&&r.textIndeterminate(n.textIndeterminate);n.textFalse&&r.textFalse(n.textFalse);n.textAlign!==t&&n.textAlign!==i&&r.textAlign(n.textAlign);n.isThreeState!==t&&n.isThreeState!==i&&r.isThreeState(n.isThreeState)}},nt}(n.TextCellType);n.CheckBoxCellType=dt;gt=function(c){function y(){c.call(this);var n=this;n.allowOverflow=!1;n._marginTop=2;n._marginRight=2;n._marginBottom=2;n._marginLeft=2;n._text="";n._buttonBackColor=t;n._buttonBorderColor="#707070";n._eventNameSpace=".buttonCellType"}return __extends(y,c),y.prototype.paintValue=function(n,t,i,r,u,f,e,o){var p,y,w;if(n){var s=this,h=i+s._marginLeft,l=r+s._marginTop,a=u-s._marginLeft-s._marginRight,v=f-s._marginTop-s._marginBottom,b=h+a>i&&h<i+u&&l+v>r&&l<r+f;a-2>0&&v-2>0&&b&&(n.save(),(h<i||h+a>i+u||l<r||l+v>r+f)&&(n.rect(i,r,u,f),n.clip()),n.beginPath(),p=s._buttonBorderColor,p&&n.strokeStyle!==p&&(n.strokeStyle=p),n.strokeRect(h+.5,l+.5,a-1,v-1),y=s._buttonBackColor,y||(w=n.createLinearGradient(i+u/2,r,i+u/2,r+f),w.addColorStop(.125,ui),w.addColorStop(1,fi),y=w),n.fillStyle!==y&&(n.fillStyle=y),n.fillRect(h+1,l+1,a-2,v-2),n.restore(),s._text&&c.prototype.paintValue.call(this,n,s._text,h,l,a,v,e,o))}},y.prototype.focus=function(n,t){n&&n.focus()},y.prototype._formatEditorValue=function(n,t,i,r){return i},y.prototype.createEditorElement=function(n){var r=u.createElement("div"),f=$(r),t,i;return f.css(e,o).css(v,s).css(rt,s).css(tt,b).css(kt,a).css(k,"2px #5292f7 solid").css(d,a).css(ht,"1px 2px 5px rgba(0,0,0,0.4)").css(p,"content-box").css("user-select","none").attr("tabindex",1).attr(g,"gcEditingInput"),t=$("<div><\/div>"),t.css(e,o).css(tt,b).css(k,"1px "+this._buttonBorderColor+" solid"),f.append(t),i=$("<span><\/span>"),i.css(e,o).css(ct,"nowrap").css(l,"normal 10pt Arial").css("cursor","default"),t.append(i),r},y.prototype.setEditorValue=function(n,t,i){var r=n&&n.children[0]&&n.children[0].children[0];r&&$(r).html(this._text)},y.prototype.getEditorValue=function(n,i){return n?n._oldValue:t},y.prototype._triggerButtonClicked=function(t,i,r){var u=t.parent;u&&u._trigger(n.Events.ButtonClicked,{sheet:t,sheetName:t._name,row:i,col:r})},y.prototype._setButtonBackgroundColor=function(n,t){n.removeClass("gradientButton");t?n.css(h,t):n.addClass("gradientButton")},y.prototype.activateEditor=function(t,i,u,e){var c=t&&e&&e.sheet,o,l,s;if(c){var a=$(t),v=c._eventHandler._getCanvasOffset(),y=c._bounds;a.css(f,v.top+y.y+u.y-2).css(r,v.left+y.x+u.x-2).css(h,i.backColor?i.backColor:"white");o=this;l=t.children[0];l&&(s=$(l),a.bind(yt,function(t){if(t.keyCode!==32||t.ctrlKey||t.shiftKey||t.altKey)t.keyCode!==8||t.ctrlKey||t.shiftKey||t.altKey||n.util.cancelDefault(t);else return o._isKeyDown||o._setButtonBackgroundColor(s,nt),o._isKeyDown=!0,n.util.cancelDefault(t),!1}),a.bind(pt,function(n){!o._isKeyDown||n.keyCode!==32||n.ctrlKey||n.shiftKey||n.altKey||(o._isKeyDown=!1,o._setButtonBackgroundColor(s,o._buttonBackColor),o._triggerButtonClicked(c,c._activeRowIndex,c._activeColIndex))}),s.bind(wt,function(n){n.button!==2&&(o._isMouseDown=!0,o._setButtonBackgroundColor(s,nt))}),s.bind(bt,function(n){n.button!==2&&(o._isMouseDown=!1,o._setButtonBackgroundColor(s,vt))}),s.bind(si,function(n){o._triggerButtonClicked(c,c._activeRowIndex,c._activeColIndex)}),s.bind(oi,function(n){o._isMouseDown?o._setButtonBackgroundColor(s,nt):o._setButtonBackgroundColor(s,vt)}),s.bind(ei,function(n){var t=n.relatedTarget;t!==l&&t!==l.children[0]&&o._setButtonBackgroundColor(s,o._buttonBackColor)}))}},y.prototype.updateEditor=function(n,i,u,e){var s=n&&e&&e.sheet,v,o,h,k,a,c,d,y,it,p,b;if(s){var rt=$(n),g=s._render,nt=s._eventHandler._getCanvasOffset(),tt=s._bounds;rt.css(f,nt.top+tt.y+u.y-2).css(r,nt.left+tt.x+u.x-2).width(u.width).height(u.height);v=n.children[0];v&&(o=this,h=$(v),h.width(u.width-o._marginLeft-o._marginRight).height(u.height-o._marginTop-o._marginBottom).css("margin-top",o._marginTop-1).css("margin-left",o._marginLeft-1),o._setButtonBackgroundColor(h,o._buttonBackColor),k=v.children[0],k&&(a=$(k),i.foreColor&&a.css(w,i.foreColor),c=t,c=i.font?i.font:g._getDefaultFont(),s._zoomFactor>1&&(c=g._getZoomFont(c)),a.css(l,c),d=s._getStringWidth(o._text,c),y=s._getFontHeight(c),o._text&&(it=o._text.split(/\r\n|\r|\n/),y*=it.length),p=0,i.vAlign===1?p=h.height()/2-y/2:i.vAlign===2&&(p=h.height()-y),b=0,i.hAlign===1?b=h.width()/2-d/2:i.hAlign===2&&(b=h.width()-d),a.css(f,p).css(r,b),i.textDecoration&&o._setEditStatusTextDecoration(a,i.textDecoration)))}},y.prototype.marginTop=function(n){return arguments.length===0?this._marginTop:(this._marginTop=n,this)},y.prototype.marginRight=function(n){return arguments.length===0?this._marginRight:(this._marginRight=n,this)},y.prototype.marginBottom=function(n){return arguments.length===0?this._marginBottom:(this._marginBottom=n,this)},y.prototype.marginLeft=function(n){return arguments.length===0?this._marginLeft:(this._marginLeft=n,this)},y.prototype.text=function(n){return arguments.length===0?this._text:(this._text=n,this)},y.prototype.buttonBackColor=function(n){return arguments.length===0?this._buttonBackColor:(this._buttonBackColor=n,this)},y.prototype.getHitInfo=function(n,r,u,f,e){var s=this,o;if(!e)return t;if(o=e.sheetArea,(o===t||o===i||o===3)&&f){var c=f.x+s._marginLeft,l=f.x+f.width-s._marginRight,a=f.y+s._marginTop,v=f.y+f.height-s._marginBottom,h={x:n,y:r,row:e.row,col:e.col,cellRect:f,sheetArea:o,sheet:e.sheet};return c<=n&&n<=l&&a<=r&&r<=v&&(h.isReservedLocation=!0),h}return t},y.prototype.processMouseDown=function(n){if(!n)return!1;var t=this,i=n.sheet;return i&&n.isReservedLocation&&!t._isMouseDownReservedLocation?(t._originButtonBackColor=t._buttonBackColor,t._isMouseDownReservedLocation=!0,t._buttonBackColor=nt,i.repaint(n.cellRect),!0):!1},y.prototype.processMouseUp=function(n){var i,r;if(!n)return!1;if(i=this,r=n.sheet,i._isMouseDownReservedLocation&&r&&n.isReservedLocation){i._buttonBackColor=i._originButtonBackColor;r.repaint(n.cellRect);i._isMouseDownReservedLocation=!1;var u=n.row,f=n.col,e=n.sheetArea,t=r._getModel(e).getNode(u,f,!0);if(t._isFirstMouseUp)delete t._isFirstMouseUp,t._mouseupToken&&(window.clearTimeout(t._mouseupToken),delete t._mouseupToken);else return i._triggerButtonClicked(r,u,f),t._isFirstMouseUp=!0,t._mouseupToken=window.setTimeout(function(){delete t._isFirstMouseUp;t._mouseupToken&&(window.clearTimeout(t._mouseupToken),delete t._mouseupToken)},250),!0}return!1},y.prototype.processMouseLeave=function(n){if(!n)return!1;var t=this,i=n.sheet;i&&t._isMouseDownReservedLocation&&(t._buttonBackColor=t._originButtonBackColor,i.repaint(n.cellRect),t._isMouseDownReservedLocation=!1)},y.prototype.processKeyDown=function(t,i){var u=i&&i.sheet,r;if(!u)return!1;if(r=this,!r._isKeyPressed){var e=u.getActiveRowIndex(),o=u.getActiveColumnIndex(),f=u.getCellRect(e,o,u.activeRowViewportIndex,u.activeColViewportIndex);return r._originButtonBackColor=r._buttonBackColor,r._buttonBackColor=nt,u.repaint(f),u._bind(n.Events.SelectionChanged+r._eventNameSpace,function(t,i){u._unbind(n.Events.SelectionChanged+r._eventNameSpace);r._isKeyPressed=!1;r._buttonBackColor=r._originButtonBackColor;u.repaint(f)}),r._isKeyPressed=!0,!0}return!1},y.prototype.processKeyUp=function(t,i){var r=i.sheet,u;if(!r)return!1;if(u=this,u._isKeyPressed){var f=r.getActiveRowIndex(),e=r.getActiveColumnIndex(),o=r.getCellRect(f,e,r.activeRowViewportIndex,r.activeColViewportIndex);return u._buttonBackColor=u._originButtonBackColor,r.repaint(o),r._unbind(n.Events.SelectionChanged+u._eventNameSpace),u._triggerButtonClicked(r,f,e),u._isKeyPressed=!1,!0}return!1},y.prototype.isReservedKey=function(n,t){return n.keyCode===32&&!n.ctrlKey&&!n.shiftKey&&!n.altKey?!0:!1},y.prototype._getAutoFitWidth=function(t,i,r,u,f,e){var o=this,s=n.CellTypeContext._getAutoFitWidth(t,i,o._text,u,f,e);return s+o._marginLeft+o._marginRight},y.prototype._getAutoFitHeight=function(t,i,r,u,f,e){var o=this,s=n.CellTypeContext._getAutoFitHeight(t,i,o._text,u,f,e);return s+o._marginTop+o._marginBottom},y.prototype._cancelDefaultKeydown=function(t){t.keyCode!==32||t.ctrlKey||t.shiftKey||t.altKey||n.util.cancelDefault(t)},y.prototype.isImeAware=function(n){return!1},y.prototype._isDefaultValue=function(n,i){switch(n){case"marginTop":return i===2;case"marginRight":return i===2;case"marginBottom":return i===2;case"marginLeft":return i===2;case"text":return i==="";case"buttonBackColor":return i===t;default:return!1}},y.prototype.toJSON=function(){var n=this,r={type:6,marginTop:n.marginTop(),marginRight:n.marginRight(),marginBottom:n.marginBottom(),marginLeft:n.marginLeft(),text:n.text(),buttonBackColor:n.buttonBackColor()},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},y.prototype.fromJSON=function(n){if(n){var r=this;n.marginTop!==t&&n.marginTop!==i&&r.marginTop(n.marginTop);n.marginRight!==t&&n.marginRight!==i&&r.marginRight(n.marginRight);n.marginBottom!==t&&n.marginBottom!==i&&r.marginBottom(n.marginBottom);n.marginLeft!==t&&n.marginLeft!==i&&r.marginLeft(n.marginLeft);n.text&&r.text(n.text);n.buttonBackColor&&r.buttonBackColor(n.buttonBackColor)}},y}(n.TextCellType);n.ButtonCellType=gt;var lt=17,bi=20,ki=function(y){function b(){y.call(this);var n=this;n.allowOverflow=!1;n._editorValueType=0;n._items=t;n._autoFormatValue=!1;n._hasInPlaceEditor=!1}return __extends(b,y),b.prototype.getHitInfo=function(n,r,u,f,e){var o,s,h;return e?(o=e.sheetArea,(o===t||o===i||o===3)&&f)?(s=f.x+f.width,h={x:n,y:r,row:e.row,col:e.col,cellStyle:u,cellRect:f,sheetArea:o,isFocusAware:!0,isEditting:this._hasInPlaceEditor,sheet:e.sheet},(this._hasInPlaceEditor||s-lt<=n&&n<s)&&(h.isReservedLocation=!0),h):t:t},b.prototype.processMouseDown=function(n){n&&n.sheet&&n.isReservedLocation&&(this._dropDown?this._closeDropDown(n):this._openDropDown(n))},b.prototype.isReservedKey=function(n,t){if(this._hasInPlaceEditor){var i=n.ctrlKey||n.shiftKey||n.altKey;return!i&&(n.which===13||n.which===27||n.which===9||n.which===37||n.which===39)?!1:!0}return!1},b.prototype.isEditting=function(){return this._hasInPlaceEditor},b.prototype._openDropDown=function(i,e){var v=i&&i.sheet,o,it,et,ht;if(v){typeof e===ii&&(e=bi);var ct=v._render,at=i.row,vt=i.col,y=i.cellRect,yt=i.sheetArea,b=i.cellStyle,s=this,k=s.createEditorElement();s._dropDown=k;o=$(k);u.body.insertBefore(k,t);o.hide();var lt=n.util.device(),pt=$.browser.safari&&(lt.ipad||lt.iphone),rt,ut,g,ft,nt=v._eventHandler._getCanvasOffset(),tt=v._bounds;pt?(rt=nt.top+tt.y+y.y-1.5,ut=nt.left+tt.x+y.x-1.5,g=y.width+3,ft=y.height+3):(rt=nt.top+tt.y+y.y+y.height,ut=nt.left+tt.x+y.x,g=y.width,ft="auto");o.css(f,rt).css(r,ut).css(p,"border-box").css(st,ft).css(d,a);b.backColor&&o.css(h,b.backColor);b.foreColor&&o.css(w,b.foreColor);it=b&&b.font?b.font:ct._getDefaultFont();v._zoomFactor>1&&(it=ct._getZoomFont(it));o.css(l,it);s._renderItems(k,s._items);et=k.length;et>e?o.prop("size",e):o.prop("size",c(2,et));s.setEditorValue(k,v.getValue(at,vt,yt),i);ht=parseInt(o.css("width"));ht>g&&(g=ht);o.css(ot,g);o.bind("keydown",function(t){t.ctrlKey||t.shiftKey||t.altKey||(t.which===27?s._closeDropDown(i,!0):t.which===13?s._closeDropDown(i):t.which===37?(t.preventDefault(),s._closeDropDown(i),n.SpreadActions.navigationLeft.apply(v)):t.which===39&&(t.preventDefault(),s._closeDropDown(i),n.SpreadActions.navigationRight.apply(v)))});o.bind("click",function(n){(n.target.tagName==="SELECT"||n.target.tagName==="OPTION")&&s._closeDropDown(i)});o.bind("blur",function(){s._closeDropDown(i)});o.show();o.focus();s._hasInPlaceEditor=!0;v.repaint(y)}},b.prototype._closeDropDown=function(i,r){var f=this,e=i.sheet,o=i.row,s=i.col,h=i.cellRect;if($(f._dropDown).unbind("blur").unbind("click").unbind("keydown"),u.body.removeChild(f._dropDown),f._hasInPlaceEditor=!1,r)e.repaint(h);else{var c=f.getEditorValue(f._dropDown,i),l={row:o,col:s,newValue:c,autoFormat:f._autoFormatValue},a=new n.UndoRedo.CellEditUndoAction(e,l);e._doCommand(a)}f._dropDown=t},b.prototype.paintValue=function(n,t,i,r,u,f,e,o){var s=lt,h=c(0,u-s-1);e.hAlign===3&&(e.hAlign=0);e.wordWrap&&(e.wordWrap=!1);h>0&&f>0&&y.prototype.paintValue.call(this,n,t,i,r,h,f,e,o);n.save();(s>u||s>f)&&(n.rect(i,r,u,f),n.clip());n.beginPath();this._hasInPlaceEditor&&o.sheet.getActiveRowIndex()===o.row&&o.sheet.getActiveColumnIndex()===o.col&&(n.beginPath(),n.rect(i+u-s-.5,r+1.5+.05,s-1,f-3+.05),n.fillStyle="#ddedfc",n.fill(),n.lineWidth=1,n.strokeStyle="#7eb4ea",n.stroke());n.beginPath();n.lineWidth=2;n.fillStyle="#000000";n.moveTo(i+u-s+4,r+(f-2)/2-2.5);n.lineTo(i+u-s+7,r+(f-2)/2+3.5);n.lineTo(i+u-s+10,r+(f-2)/2-2.5);n.fill();n.restore()},b.prototype.createEditorElement=function(n){var t=u.createElement("select");return $(t).css(e,o).css(v,s).css(h,"white").attr(g,"gcEditor"),t},b.prototype.setEditorValue=function(n,r,u){var h=this,c=h._items,l,a,v,s,e,f,o;if(n&&c)if(l=n,a=c.length,h._editorValueType===0){for(v=r!==i&&r!==t?r.toString().toLowerCase():t,e=-1,f=0;f<a;f++)if(o=c[f],s=o&&o.hasOwnProperty("text")?o.text:o,s=s!==i&&s!==t?s.toString().toLowerCase():t,s===v){e=f;break}l.selectedIndex=e}else if(h._editorValueType===1)e=parseInt(r,10),l.selectedIndex=isNaN(e)?-1:e;else if(h._editorValueType===2){for(e=-1,f=0;f<a;f++)if(o=c[f],o&&o.hasOwnProperty("value")&&o.value===r){e=f;break}l.selectedIndex=e}},b.prototype.getEditorValue=function(n,i){var f=this,e=f._items,u,r;if(!n||!e)return t;if(u=n.selectedIndex,u>=0)if(f._editorValueType===0)return r=e[u],r&&r.hasOwnProperty("text")?r.text:r;else if(f._editorValueType===1)return u;else if(f._editorValueType===2&&(r=e[u],r&&r.hasOwnProperty("value")))return r.value;return t},b.prototype.activateEditor=function(t,i,u,e){var o=e&&e.sheet;if(o){var s=t,h=$(s),c=o._eventHandler._getCanvasOffset(),l=o._bounds;h.css(f,c.top+l.y+u.y-1).css(r,c.left+l.x+u.x-1).css(p,"border-box").css(k,"1px solid black").css(d,a);this._renderItems(s,this._items);h.bind("keydown",function(t){(t.keyCode!==8||t.ctrlKey||t.shiftKey||t.altKey||n.util.cancelDefault(t),t.ctrlKey||t.shiftKey||t.altKey)||o.isEditing()&&o.editorStatus()===1&&(t.which===37?(t.preventDefault(),o.endEdit(),n.SpreadActions.navigationLeft.apply(o)):t.which===39&&(t.preventDefault(),o.endEdit(),n.SpreadActions.navigationRight.apply(o)))});this._hasInPlaceEditor=!0}},b.prototype.deactivateEditor=function(n,t){if(n){var i=n;$(i).unbind("keydown")}this._hasInPlaceEditor=!1;y.prototype.deactivateEditor.call(this,n,t);t&&t.sheet&&t.sheet.repaint()},b.prototype.updateEditor=function(n,t,i,u){var o=n&&u&&u.sheet,c,a,s;if(o){var y=n,v=o._render,e=$(y);i&&(c=o._eventHandler._getCanvasOffset(),a=o._bounds,e.css(f,c.top+a.y+i.y-1).css(r,c.left+a.x+i.x-1));t&&(t.backColor&&e.css(h,t.backColor),t.foreColor&&e.css(w,t.foreColor),s=t.font?t.font:v._getDefaultFont(),o._zoomFactor>1&&(s=v._getZoomFont(s)),e.css(l,s),t.textDecoration&&this._setEditStatusTextDecoration(e,t.textDecoration));i&&e.css(ot,i.width+1).css(st,i.height+1)}},b.prototype._formatEditorValue=function(n,t,i,r){return i},b.prototype.format=function(n,r,u,f){var a=this,c=a._editorValueType,o=a._items,l,s,h,e;if(o&&(l=o.length,c!==0))if(c===1)s=parseInt(n),0<=s&&s<l&&(e=o[s],e!==i&&e!==t&&(n=e.hasOwnProperty("text")?e.text:e));else if(c===2)for(h=0;h<l;h++)if(e=o[h],e&&e.hasOwnProperty("value")&&e.value===n){n=e.hasOwnProperty("text")?e.text:e;break}return y.prototype.format.call(this,n,r,u)},b.prototype.parse=function(n,t,i){var h=this,o=h._editorValueType,e=h._items,f=y.prototype.parse.call(this,n,t),s,u,r;if(e)if(s=e.length,o===0)return f;else if(o===1){for(u=0;u<s;u++)if(r=e[u],r&&r.hasOwnProperty("text")&&r.text===f||r===f)return u}else if(o===2)for(u=0;u<s;u++)if(r=e[u],r&&r.hasOwnProperty("text")&&r.text===f||r===f)return r.value;return f},b.prototype.editorValueType=function(n){return arguments.length===0?this._editorValueType:(this._editorValueType=n,this)},b.prototype.items=function(n){return arguments.length===0?this._items:(this._items=n,this)},b.prototype._renderItems=function(n,r){var o,f,e,u;if(r&&n)for(o=r.length,f=0;f<o;f++)e=new window.Option,u=r[f],u!==i&&u!==t&&(e.text=u.hasOwnProperty("text")?u.text:u),n.add(e)},b.prototype._getAutoFitWidth=function(t,i,r,u,f,e){var o=n.CellTypeContext._getAutoFitWidth(t,i,r,u,f,e);return o+lt},b.prototype._getAutoFitHeight=function(t,i,r,u,f,e){return n.CellTypeContext._getAutoFitHeight(t,i,r,u,f,e)},b.prototype.isImeAware=function(n){return!1},b.prototype._isDefaultValue=function(n,i){switch(n){case"editorValueType":return i===0;case"items":return i===t;default:return!1}},b.prototype.toJSON=function(){var i={type:7,editorValueType:this.editorValueType(),items:this.items()},r={},n,t;for(n in i)t=i[n],this._isDefaultValue(n,t)||(r[n]=t);return r},b.prototype.fromJSON=function(n){n&&(n.editorValueType!==t&&n.editorValueType!==i&&this.editorValueType(n.editorValueType),n.items!==t&&n.items!==i&&this.items(n.items))},b}(n.TextCellType);n.ComboBoxCellType=ki;ni=function(y){function nt(){y.call(this);var n=this;n.allowOverflow=!1;n._link="";n._linkColor="#0066cc";n._visitedLinkColor="#3399ff";n._text="";n._linkToolTip="";n._id=nt._getUniqueId();n._target=0}return __extends(nt,y),nt.prototype.paintValue=function(t,i,u,f,e,o,s,h){var v=this,p,tt,rt,k,d,wt,g,ht,l,dt,nt;if(!v._actived&&t&&(p=v._text||i,p)){p=p.replace(/\s+/g," ");var ct=!1,lt=h.sheet._getModel().getNode(h.row,h.col),vt=lt&<.hyperlinkInfo;vt&&(v._id===vt.id?ct=vt.visited:delete lt.hyperlinkInfo);t.save();t.beginPath();tt=ct?v._visitedLinkColor:v._linkColor;tt&&t.fillStyle!==tt&&(t.fillStyle=tt);rt=s.font;rt&&t.font!==rt&&(t.font=rt);var ut=s.hAlign,yt=s.vAlign,w=t.measureText(p).width,y=h.lineHeight,ot=v._calcPosition(new n.Rect(u,f,e,o),w,y,ut,yt),b={x:u,y:f,width:e,height:o};(ot.x+w>b.width||ot.y+y>b.height)&&(t.rect(b.x,b.y,b.width,b.height),t.clip(),t.beginPath());k=2;d=r;ut===1?w<e-3&&(k=e/2,d=at):ut===2&&w<e-3&&(k=e-2,d=ft);t.textAlign!==d&&(t.textAlign=d);var a=$.browser.mozilla?5:2,bt=et,st=h.fontInfo.fontSize,kt=st>8?it((st-8)/5+2):1,pt=y/2-st/2+kt;a+=y-pt;yt===1?y<o&&(a=$.browser.mozilla?o/2+1:$.browser.msie?o/2+.5:o/2,it(a)!==a&&(a=a+.5),a+=y/2-pt):yt===2&&(a=o-2.5-pt);t.textBaseline!==bt&&(t.textBaseline=bt);t.fillText(p,u+k,f+a);wt=s.textDecoration;wt&&v._renderTextDecoration(t,wt,u+k,f+a,w,st,kt);g=u+ot.x;ht=g+w;ut===2||(g=g+1,ht=ht+1);l=f+ot.y+y;s.vAlign===2&&(l=l-.5);l=l-c(0,ri(y/9)-1);it(l)===l&&(l=l+.5);dt=l;t.beginPath();nt=v._linkColor;ct&&(nt=v._visitedLinkColor);nt&&t.strokeStyle!==nt&&(t.strokeStyle=nt);t.lineWidth=1;t.moveTo(g,l);t.lineTo(ht,dt);t.stroke();t.restore()}},nt.prototype.createEditorElement=function(n){var i=u.createElement("div"),r=$(i),t,f;r.css(v,s).css(rt,s).css(k,a).css(e,o).css(tt,b).css(p,"content-box").css(ct,"nowrap").attr(g,"gcEditor").attr("tabindex",1).css(d,a);switch(this._target){case 0:t="_blank";break;case 1:t="_self";break;case 2:t="_parent";break;case 3:t="_top";break}return f=u.createElement("a"),$(f).css(v,s).css(d,a).css("display","block").attr("target",t).appendTo(r),i},nt.prototype._triggerButtonClicked=function(t,i,r){var u=t.parent;u&&(t._startEditByKeydown||u._trigger(n.Events.ButtonClicked,{sheet:t,sheetName:t._name,row:i,col:r}))},nt.prototype.activateEditor=function(i,c,l,a){var y,d,k,it,rt,nt;if(i&&l){if(y=a&&a.sheet,d=$(i),d.css(h,c&&c.backColor||"white"),y){var ut=y._eventHandler._getCanvasOffset(),ft=y._bounds,et=ut.top+ft.y+l.y,ot=ut.left+ft.x+l.x;d.css(f,et).css(r,ot)}d.bind("keydown",function(t){t.keyCode!==8||t.ctrlKey||t.shiftKey||t.altKey||n.util.cancelDefault(t)});k=this;it=d.children()[0];it&&(rt=$(it),rt.bind("click",function(){if(rt.css(w,k._visitedLinkColor),y){var n=y._activeRowIndex,t=y._activeColIndex,i=y._getModel().getNode(n,t,!0);i.hyperlinkInfo={id:k._id,visited:!0};k._triggerButtonClicked(y,n,t)}}));nt=u.createElement("div");$(nt).css(v,s).css(e,o).css(tt,b).css(p,"content-box").attr(g,"gcEditingInput").css(hi,"1px").css(ci,"solid").css(h,"transparent");u.body.insertBefore(nt,t);k._clip=nt;k._actived=!0}},nt.prototype.deactivateEditor=function(n,t){var i,r;this._clip&&u.body.removeChild(this._clip);n&&($(n).unbind("keydown"),i=$(n).children()[0],i&&$(i).unbind("click"));y.prototype.deactivateEditor.call(this,n,t);this._actived=!1;r=t&&t.sheet;r&&r.repaint()},nt.prototype.updateEditor=function(n,i,u,e){var c,p,b,v,a;if(n&&u){var o=this,s=e&&e.sheet,y=s&&s._render,rt=n,h=$(rt),k=h.children()[0];if(k&&(c=$(k),o._link&&c.attr("href",o._link),p=o._text||o._link,p&&c.text(p),c.attr("title",o._linkToolTip),b=!1,v=s?s._getModel().getNode(s._activeRowIndex,s._activeColIndex):t,v&&v.hyperlinkInfo&&(o._id===v.hyperlinkInfo.id?b=v.hyperlinkInfo.visited:delete v.hyperlinkInfo),b?c.css(w,o._visitedLinkColor):c.css(w,o._linkColor),a=i&&i.font?i.font:t,!a&&y&&(a=y._getDefaultFont()),y&&s._zoomFactor>1&&(a=y._getZoomFont(a)),a&&c.css(l,a)),i&&s){h.css(ai,u.width-2);h.css(vi,u.height-2);var d=s._eventHandler._getCanvasOffset(),g=s._bounds,nt=d.top+g.y+u.y,tt=d.left+g.x+u.x,it=o._calcPosition(u,h.width(),h.height(),i.hAlign,i.vAlign);h.css(f,nt+it.y).css(r,tt+it.x);o._clip&&$(o._clip).css(f,nt).css(r,tt).height(u.height-3).width(u.width-3).css(li,i.backColor||"white");i.textDecoration&&o._setEditStatusTextDecoration(h,i.textDecoration)}}},nt.prototype.getEditorValue=function(n,t){return this._link},nt.prototype.setEditorValue=function(n,t,i){this._link=t},nt.prototype._formatEditorValue=function(n,t,i,r){return i},nt.prototype.getHitInfo=function(n,r,u,f,e){if(e){var o=e.sheetArea;if((o===t||o===i||o===3)&&u&&f)return{x:n,y:r,row:e.row,col:e.col,cellStyle:u,cellRect:f,sheetArea:o,isFocusAware:!0,sheet:e.sheet}}return t},nt.prototype.processMouseDown=function(n){if(n){var t=n.sheet;t&&!t.isEditing()&&(n.isReservedLocation=this._isHitHyperlink(n,t)?!0:!1,n.isReservedLocation&&(this._isMouseDownLink=!0))}},nt.prototype.processMouseUp=function(n){var t,i,r,u;if(n&&(t=n.sheet,t&&!t.isEditing())){if(i=this,n.isReservedLocation=i._isHitHyperlink(n,t)?!0:!1,n.isReservedLocation&&i._isMouseDownLink){if(r=t.getValue(n.row,n.col,n.sheetArea),r)switch(i._target){case 0:window.open(r,"_blank");break;case 1:window.open(r,"_self");break;case 2:window.open(r,"_parent");break;case 3:window.open(r,"_top");break}u=t._getModel(n.sheetArea).getNode(n.row,n.col,!0);u.hyperlinkInfo={id:i._id,visited:!0};t.repaint(n.cellRect);i._triggerButtonClicked(t,n.row,n.col)}i._isMouseDownLink=!1}},nt.prototype.processMouseMove=function(n){var t,r,i;n&&(t=n.sheet,t)&&(t.isEditing()&&t.getActiveRowIndex()===n.row&&t.getActiveColumnIndex()===n.col||(n.isReservedLocation=this._isHitHyperlink(n,t)?!0:!1,n.isReservedLocation?(this._showLinkToolTip(t,n),i=t._getCanvas(),i&&(r=t.getValue(n.row,n.col,n.sheetArea),i.style.cursor=r?"pointer":"text")):(this._hideLinkToolTip(),i=t._getCanvas(),i&&(i.style.cursor="default"))))},nt.prototype.processMouseLeave=function(n){var t,i;this._isMouseDownLink=!1;this._hideLinkToolTip();t=n.sheet;t&&(i=t._getCanvas(),i&&(i.style.cursor="default"))},nt.prototype._isHitHyperlink=function(n,t){var f=n.cellStyle,i=n.cellRect,o=t._render,s=n.x,h=n.y,r=this._text||this._link,e;if(r||(r=t.getValue(n.row,n.col,n.sheetArea)),!r)return!1;r=r.replace(/\s+/g," ");e=f&&f.font?f.font:o._getDefaultFont();t._zoomFactor>1&&(e=o._getZoomFont(e));var u=this._getLinkRect(r,f.hAlign,f.vAlign,e,i),c=i.x+u.x,l=ut(i.x+u.x+u.width,i.x+i.width),a=i.y+u.y,v=ut(i.y+u.y+u.height,i.y+i.height);return c<=s&&s<l&&a<=h&&h<v?!0:!1},nt.prototype._showLinkToolTip=function(n,i){var o,e;if(this._linkToolTip){o=this._getLinkToolTipElement();e=$(o);e.text(this._linkToolTip);var s=n._eventHandler._getCanvasOffset(),h=s.left+i.x,c=s.top+i.y+20;e.parent().length===0&&(u.body.insertBefore(o,t),e.css(f,c).css(r,h))}},nt.prototype._hideLinkToolTip=function(){this._linkToolTipElement&&(u.body.removeChild(this._linkToolTipElement),this._linkToolTipElement=t)},nt.prototype._getLinkToolTipElement=function(){if(!this._linkToolTipElement){var n=u.createElement("div");n.className="gcHyperLinkCellTypeToolTip";$(n).css(e,o).css(v,s).css(rt,2).css(k,"1px #c0c0c0 solid").css(ht,"1px 2px 5px rgba(0,0,0,0.4)").css(p,"content-box").css(h,"#ffffff").css(l,"9pt Arial");this._linkToolTipElement=n}return this._linkToolTipElement},nt.prototype._getLinkRect=function(n,t,i,r,u){var v=nt._getEditorElement(),f=$(v),h=f.children()[0],e,s;h&&(e=$(h),e.text(n?n:""),r&&e.css(l,r));var c=f.width(),a=f.height(),o={x:0,y:0,width:c,height:a};return u&&(s=this._calcPosition(u,c,a,t,i),o.x=s.x,o.y=s.y),o},nt.prototype._calcPosition=function(n,t,i,r,u){var f=1,e=1,o=n.width-3,s=n.height-3;return r===1?f=f+c(0,(o-t)/2):r===2&&(f=f+c(0,o-t)),u===1?e=e+c(0,(s-i)/2):u===2&&(e=e+c(0,s-i)),{x:f,y:e}},nt.prototype.isReservedKey=function(n,t){return n.keyCode===32&&!n.ctrlKey&&!n.shiftKey&&!n.altKey?!0:!1},nt.prototype.processKeyUp=function(n,t){var i=t.sheet,o;if(!i)return!1;var u=i.getActiveRowIndex(),f=i.getActiveColumnIndex(),e=i._getSheetArea(i.activeRowViewportIndex,i.activeColViewportIndex),r=i.getValue(u,f,e),s=i.getCellRect(u,f,i.activeRowViewportIndex,i.activeColViewportIndex);if(r){r=r.toString();switch(this._target){case 0:window.open(r,"_blank");break;case 1:window.open(r,"_self");break;case 2:window.open(r,"_parent");break;case 3:window.open(r,"_top");break}}return o=i._getModel(e).getNode(u,f,!0),o.hyperlinkInfo={id:this._id,visited:!0},i.repaint(s),this._triggerButtonClicked(i,u,f),!0},nt.prototype.linkColor=function(n){return arguments.length===0?this._linkColor:(this._linkColor=n,this)},nt.prototype.visitedLinkColor=function(n){return arguments.length===0?this._visitedLinkColor:(this._visitedLinkColor=n,this)},nt.prototype.text=function(n){return arguments.length===0?this._text:(this._text=n,this)},nt.prototype.linkToolTip=function(n){return arguments.length===0?this._linkToolTip:(this._linkToolTip=n,this)},nt.prototype.target=function(n){return arguments.length===0?this._target:(this._target=n,this)},nt.prototype._getAutoFitWidth=function(n,t,i,r,u,f){var e=this,o=n._render,s=e._text||t,h=r&&r.font?r.font:o._getZoomFont(o._getDefaultFont()),c=e._getLinkRect(s,r.hAlign,r.vAlign,h);return c.width},nt.prototype._getAutoFitHeight=function(n,t,i,r,u,f){var h=this._text||t,o=n._render,e=r&&r.font?r.font:o._getDefaultFont(),s;return n._zoomFactor>1&&(e=o._getZoomFont(e)),s=this._getLinkRect(h,r.hAlign,r.vAlign,e),s.height},nt.prototype.isImeAware=function(n){return!1},nt.prototype._isDefaultValue=function(n,t){switch(n){case"linkColor":return t==="#0066cc";case"visitedLinkColor":return t==="#3399ff";case"text":return t==="";case"linkToolTip":return t==="";case"target":return t===0;default:return!1}},nt.prototype.toJSON=function(){var n=this,r={type:8,linkColor:n._linkColor,visitedLinkColor:n._visitedLinkColor,text:n._text,linkToolTip:n._linkToolTip,target:n._target},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},nt.prototype.fromJSON=function(n){if(n){var r=this;n.linkColor!==i&&n.linkColor!==t&&(r._linkColor=n.linkColor);n.visitedLinkColor!==i&&n.visitedLinkColor!==t&&(r._visitedLinkColor=n.visitedLinkColor);n.text!==i&&n.text!==t&&(r._text=n.text);n.linkToolTip!==i&&n.linkToolTip!==t&&(r._linkToolTip=n.linkToolTip);n.target!==i&&n.target!==t&&(r._target=n.target)}},nt._getUniqueId=function(){var n=this;return(n._id===i||n._id===t)&&(n._id=0),"id_"+n._id++},nt._getEditorElement=function(){var r=this,n,i;return r._editorElement||(n=nt.prototype.createEditorElement(),i=n.style,u.body.insertBefore(n,t),i.visibility=b,i.top="-10000px",i.left="-10000px",n.className="gcHyperLinkCellTypeEditor",r._editorElement=n),r._editorElement},nt}(n.TextCellType);n.HyperLinkCellType=ni;ti=function(t){function i(){t.call(this)}return __extends(i,t),i.prototype.paint=function(t,i,r,u,f,e,o,s){var h,c;t&&(n.CellTypeContext.paintBackground(t,r,u,f,e,o.backColor,o.backgroundImage,o.backgroundImageLayout,s.imageLoader),h=n.CellTypeContext.paintConditionalFormats(t,i,r,u,f,e,o,s),s.showBarIconOnly=h,n.CellTypeContext.paintSparkline(t,r,u,f,e,s.sparkline),c=n.CellTypeContext.paintSparklineEx(t,i,r,u,f,e,s.sheet),s.cellOverflowLayout||h||c||this.paintValue(t,i,r,u,f,e,o,s))},i.prototype.createEditorElement=function(n){},i.prototype.getEditorValue=function(n,t){},i.prototype.setEditorValue=function(n,t,i){},i.prototype.activateEditor=function(n,t,i,r){var u=n&&r&&r.sheet,f;if(u){f=u._eventHandler;this.isImeAware(r)&&f._resetFocusHolder();var e=f._getCanvasOffset(),o=u._bounds,s=e.top+o.y+i.y-2,h=e.left+o.x+i.x-2;$(n).css("top",s).css("left",h)}},i.prototype.deactivateEditor=function(n,t){n&&n._editingLocator&&u.body.removeChild(n._editingLocator)},i.prototype.updateEditor=function(n,t,i,r){n&&$(n).width(i.width).height(i.height)},i.prototype.updateImeMode=function(n,i,r){t.prototype.updateImeMode.call(this,n,i,r)},i.prototype.getHitInfo=function(n,t,i,r,u){},i.prototype.processMouseDown=function(n){},i.prototype.processMouseMove=function(n){},i.prototype.processMouseUp=function(n){},i.prototype.processMouseEnter=function(n){},i.prototype.processMouseLeave=function(n){},i.prototype.isReservedKey=function(n,t){return!1},i.prototype.processKeyDown=function(n,t){return!1},i.prototype.processKeyUp=function(n,t){return!1},i.prototype.isEditingValueChanged=function(n,t,i){return n!==t},i.prototype._getAutoFitWidth=function(n,t,i,r,u,f){var e=this.getAutoFitWidth(t,i,r,n._zoomFactor,f),o,s;return u&&(o=ut(n._zoomFactor,1),s=parseInt((n.defaults.rowHeight*o).toString(),10),e+=s),e},i.prototype._getAutoFitHeight=function(n,t,i,r,u,f){return this.getAutoFitHeight(t,i,r,n._zoomFactor,f)},i.prototype.getAutoFitWidth=function(n,t,i,r,u){return 0},i.prototype.getAutoFitHeight=function(n,t,i,r,u){return 0},i.prototype.isImeAware=function(n){return!1},i}(n.BaseCellType);n.CustomCellType=ti})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){(function(n){var r,f;n.feature("filter",["core.common","core.stringResource"]);var t=null,i=undefined,u=function(){function r(n){this.range=n;this.reset()}return r.prototype.setShowFilterButton=function(n){this.showFilterButton=n;this.sheet&&(this.sheet.invalidateLayout(),this.sheet.repaint())},r.prototype.getShowFilterButton=function(){return this.showFilterButton},r.prototype.addFilterItem=function(r,u){var f=this,o,e;if(u===i||u===t)throw new Error(n.SR.Exp_FilterItemIsNull);if(r<-1||r>=f.sheet.getColumnCount())throw new Error(n.SR.Exp_InvalidColumnIndex);f.range&&((o=f.sheet._getActualRange(f.range),r<o.col||r>=o.col+o.colCount)||(e=f.filterItemMap[r],e||(e=[]),e.push(u),f.filterItemMap[r]=e))},r.prototype.addAverageFilter=function(t,i){if(n.features.conditionalFormat){var r=new n.AverageCondition(i);this.addFilterItem(t,r)}},r.prototype.addBackgroundFilter=function(t,i){if(n.features.conditionalFormat){var r=new n.ColorCondition(0,i);this.addFilterItem(t,r)}},r.prototype.addDateFilter=function(t,i,r){if(n.features.conditionalFormat){var u=new n.DateCondition(i,r);this.addFilterItem(t,u)}},r.prototype.addForegroundFilter=function(t,i){if(n.features.conditionalFormat){var r=new n.ColorCondition(1,i);this.addFilterItem(t,r)}},r.prototype.addNumberFilter=function(t,i,r){if(n.features.conditionalFormat){var u=new n.NumberCondition(i,r);this.addFilterItem(t,u)}},r.prototype.addTextFilter=function(t,i,r){if(n.features.conditionalFormat){var u=new n.TextCondition(i,r);this.addFilterItem(t,u)}},r.prototype.addTop10Filter=function(t,i,r){if(n.features.conditionalFormat){var u=new n.Top10Condition(i,r);this.addFilterItem(t,u)}},r.prototype.removeFilterItems=function(n){this.filterItemMap[n]&&this.filterItemMap.splice(n,1,t);this.unfilter(n)},r.prototype.unfilter=function(n){var r=this;r.sheet&&r.sheet._bindToAutoRefresh(function(n){if(n!==t&&n!==i)r._unfilterColumn(n);else if(r.filteredColMap)for(var u=0;u<r.filteredColMap.length;u++)r._unfilterColumn(r.filteredColMap[u])})(n)},r.prototype._filterColumn=function(n){var t=this,r,u,f,e,i;if(t._unfilterColumn(n),t.filterItemMap[n]){if(t.range&&t.range.col!==-1&&(n<t.range.col||n>t.range.col+t.range.colCount-1))return;for(f=t.sheet.getRowCount(),t.range&&(r=t.range.row,u=t.range.rowCount,r===-1&&(r=0,u=f)),e={},e=t._getRowDataCache(n,r,u),i=0;i<f;i++){if(t.range&&(i<r||i>=r+u)){t._addRowFilteredIn(i);continue}t.isRowFilteredOut(i)||t._filterRowByCell(i,n,e)}t._setColumnFilteredState(n,!0)}},r.prototype._getRowDataCache=function(n,t,i){var h={},s=[],u,c,r,f,o,e;for(s=this._getItemType(n),c=s.length,r=t;r<t+i;r++){for(f={},o=0;o<c;o++){u=s[o];switch(u){case"T":f[u]=this.sheet.getText(r,n);break;case"BC":e=this.sheet.getActualStyle(r,n);e&&(f[u]=e.backColor);break;case"FC":e=this.sheet.getActualStyle(r,n);e&&(f[u]=e.foreColor);break;case"V":f[u]=this.sheet.getValue(r,n);break}}h[r]=f}return h},r.prototype._getItemType=function(t){for(var r,i=[],f=this.filterItemMap[t],e=f.length,u=0;u<e;u++)r=f[u],r.conditionType==="RelationCondition"||r instanceof n.RelationCondition?(r.item1&&(r.item1.conditionType==="TextCondition"||r.item1.conditionType==="TextLengthCondition"?i.indexOf("T")===-1&&i.push("T"):r.item1.conditionType==="ColorCondition"?r.item1.compareType===0?i.indexOf("BC")===-1&&i.push("BC"):r.item1.compareType===1&&i.indexOf("FC")===-1&&i.push("FC"):i.indexOf("V")===-1&&i.push("V")),r.item2&&(r.item2.conditionType==="TextCondition"||r.item2.conditionType==="TextLengthCondition"?i.indexOf("T")===-1&&i.push("T"):r.item2.conditionType==="ColorCondition"?r.item2.compareType===0?i.indexOf("BC")===-1&&i.push("BC"):r.item2.compareType===1&&i.indexOf("FC")===-1&&i.push("FC"):i.indexOf("V")===-1&&i.push("V"))):r.conditionType==="TextCondition"||r.conditionType==="TextLengthCondition"?i.indexOf("T")===-1&&i.push("T"):r.conditionType==="ColorCondition"?r.compareType===0?i.indexOf("BC")===-1&&i.push("BC"):r.compareType===1&&i.indexOf("FC")===-1&&i.push("FC"):i.indexOf("V")===-1&&i.push("V");return i},r.prototype.filter=function(n){var r=this;r.sheet&&r.sheet._bindToAutoRefresh(function(n){if(n!==t&&n!==i)r._filterColumn(n);else if(r.filterItemMap)for(var u=0;u<r.filterItemMap.length;u++)r.filterItemMap[u]&&r.filterItemMap[u].length>0&&r._filterColumn(u)})(n)},r.prototype.isHideRowFilter=function(){return!1},r.prototype.isFiltered=function(){return this.filteredColMap.length>0},r.prototype.isColumnFiltered=function(n){return this.filteredColMap.contains(n)},r.prototype.isRowFilteredOut=function(n){return this.isFiltered()?!this.filterInRows.contains(n):!1},r.prototype.reset=function(){var n=this;n.filterInRows=[];n.filterItemMap=[];n.filteredColMap=[];n.filteredItems=[];n.filteredInRowsWithColIndexs={};n.showFilterButton=!0;n.sortInfo=t},r.prototype.isFilterHeader=function(n,t,i){var u=this,f=!1,r;return u.range&&(r=u.sheet._getActualRange(u.range,i),i===1&&n===u.sheet.getRowCount(i)-1&&r.row-1<0?t>=r.col&&t<r.col+r.colCount&&(f=!0):i===3&&n===r.row-1&&t>=r.col&&t<r.col+r.colCount&&(f=!0)),f},r.prototype.isLastFilteredColumn=function(n){var t=this.filteredColMap.length;return t>0?this.filteredColMap[t-1]===n:!1},r.prototype.getFilterItems=function(n){var t=this.filterItemMap[n];return t||(t=[]),t},r.prototype.getFilteredItems=function(){return this.filteredItems},r.prototype.sortColumn=function(n,t){var r=this,i=r.sheet;i&&i._bindToAutoRefresh(function(n,t){var u=i._getActualRange(r.range),e=i.isPaintSuspended(),f;i.isPaintSuspended(!0);f=i.sortRange(u.row,u.col,u.rowCount,u.colCount,!0,[{index:n,ascending:t}]);i.isPaintSuspended(e);f&&(r.sortInfo={index:n,ascending:t},r.isColumnFiltered(n)&&r.reFilter())})(n,t)},r.prototype.getSortState=function(n){var t=0;return this.sortInfo&&this.sortInfo.index===n&&(t=this.sortInfo.ascending?1:2),t},r.prototype.reFilter=function(){var n=this,t,i;if(n.filteredInRowsWithColIndexs={},(n.filteredItems||n.filteredItems.length>0)&&(n.filteredItems.length=0),n.filteredColMap||n.filteredColMap.length>0)for(t=[],t=t.concat(n.filteredColMap),n.filteredColMap.length=0,i=0;i<t.length;i++)n.filter(t[i])},r.prototype._addRowFilteredIn=function(n){this.filterInRows.contains(n)||this.filterInRows.push(n)},r.prototype._addFilteredInRowsWithColumnIndex=function(n,r){var u=this.filteredInRowsWithColIndexs[n];u===i||u===t?u=[r]:(u.contains(r)&&u.remove(r),u.push(r));this.filteredInRowsWithColIndexs[n]=u},r.prototype._addFilteredItem=function(n){this.filteredItems.contains(n)||this.filteredItems.push(n)},r.prototype._unfilterColumn=function(n){var t=this,r,i,u,f;if(t.range)if(r=t.sheet._getActualRange(t.range),t.isColumnFiltered(n)){if(!(t.filteredColMap.length>1&&n===t.filteredColMap[0]))for(i=r.row;i<r.row+r.rowCount;i++)u=t._isRowfilteredOutByColumn(i,n),u&&t._addRowFilteredIn(i);t._setColumnFilteredState(n,!1);t._removeFilteredInRowsWithColumnIndex(n);t._removeFilteredItems(n)}else for(i=r.row;i<r.row+r.rowCount;i++)f=t.isRowFilteredOut(i),f||t._addRowFilteredIn(i)},r.prototype._setColumnFilteredState=function(n,t){var i=this;if(t){if(i.filteredColMap.length>0)if(i.filteredColMap[i.filteredColMap.length-1]===n)return;else i.filteredColMap.remove(n);i.filteredColMap.push(n)}else i.filteredColMap.remove(n)},r.prototype._removeFilteredItems=function(n){var i=this,r,u,t,f;if(i.filterItemMap[n]){for(r=[],u=[],t=0;t<i.filterItemMap.length;t++)t===n?r=r.concat(i.filterItemMap[t]):u=u.concat(i.filterItemMap[t]);for(t=0;t<r.length;t++)f=r[t],u.contains(f)||i.filteredItems.remove(f)}},r.prototype._removeFilteredInRowsWithColumnIndex=function(n){var i,t;for(i in this.filteredInRowsWithColIndexs)i&&(t=this.filteredInRowsWithColIndexs[i],t&&t.contains(n)&&t.remove(n))},r.prototype._filterRowByCell=function(t,i,r){for(var u,o,c,f=this,s={},h=f.filterItemMap[i],e=0;e<h.length;e++)if(u=h[e],u.conditionType==="RelationCondition"||u instanceof n.RelationCondition?(u.item1&&(o=f._getActualValueFromCache(u.item1,t,i,r),u.item1.conditionType==="Top10Condition"||u.item1 instanceof n.Top10Condition?u.item1.ranges=f._getReviseRanges(i,f.range):(u.item1.conditionType==="AverageCondition"||u.item1 instanceof n.AverageCondition)&&(u.item1.ranges=f._getReviseRanges(i,f.range))),u.item2&&(c=f._getActualValueFromCache(u.item2,t,i,r),u.item2.conditionType==="Top10Condition"||u.item2 instanceof n.Top10Condition?u.item2.ranges=f._getReviseRanges(i,f.range):(u.item2.conditionType==="AverageCondition"||u.item2 instanceof n.AverageCondition)&&(u.item2.ranges=f._getReviseRanges(i,f.range)))):(o=f._getActualValueFromCache(u,t,i,r),u.conditionType==="Top10Condition"||u instanceof n.Top10Condition?u.ranges=f._getReviseRanges(i,f.range):(u.conditionType==="AverageCondition"||u instanceof n.AverageCondition)&&(u.ranges=f._getReviseRanges(i,f.range))),u.evaluate(f.sheet,t,i,o,c)){f._addRowFilteredIn(t);f._addFilteredInRowsWithColumnIndex(t,i);f._addFilteredItem(u);break}else s[t]||(f.filterInRows.remove(t),s[t]=!0)},r.prototype._getActualValueFromCache=function(n,i,r,u){var f=t;return n.conditionType==="TextCondition"||n.conditionType==="TextLengthCondition"?f=u[i].T:n.conditionType==="ColorCondition"?n.compareType===0?f=u[i].BC:n.compareType===1&&(f=u[i].FC):f=u[i].V,f},r.prototype._getReviseRanges=function(t,i){var u=[],r;return i&&(r=this.sheet._getActualRange(i),r.col<=t&&t<r.col+r.colCount&&u.push(new n.Range(r.row,t,r.rowCount,1))),u},r.prototype._getCandindateDataItems=function(n,t){var u=this,o=u.sheet,e=[],s={},f=o._getActualRange(u.range),h,r,i;if(n<f.col||n>f.col+f.colCount-1)return e;for(h=!1,r=f.row;r<f.row+f.rowCount;r++){if(i=o.getText(r,n),i===""){h=!0;continue}s[i]||(u.isRowFilteredOut(r)?!u.isFiltered()||u.isLastFilteredColumn(n)&&u._isRowfilteredOutByColumn(r,n)?(e.push(i),s[i]=!0):o.getRowHeight(r,3)>0&&(e.push(i),s[i]=!0):o.getRowHeight(r,3)>0&&(e.push(i),s[i]=!0))}return h&&t&&(t.hasBlank=!0),e},r.prototype._isRowfilteredOutByColumn=function(n,t){var r=this,u,f,i;return r.filteredColMap.length===0?!1:r.filteredInRowsWithColIndexs?(u=-1,f=r.filteredColMap.indexOf(t),f>0&&(u=r.filteredColMap[f-1]),i=r.filteredInRowsWithColIndexs[n],u>-1?i&&i.length!==0?u===i[i.length-1]:!1:r.filteredColMap.length===1?!i||i.length===0:!1):!1},r.prototype._addRows=function(t,i){var u=this,o,r,e,f,s,h;if(u.range){if(o=u.sheet.getRowCount()-i-1,u.range.row>-1&&(r=u.range,o=r.row+r.rowCount-1,r.row>=t?u._setRangeInternal(new n.Range(r.row+i,r.col,r.rowCount,r.colCount)):r.row<t&&t<r.row+r.rowCount&&u._setRangeInternal(new n.Range(r.row,r.col,r.rowCount+i,r.colCount))),u.isFiltered()&&u.filterInRows)for(e=u.filterInRows.length-1;e>=0;e--)f=u.filterInRows[e],f>=t&&f<=o&&(s=u.filterInRows[f],h=f+i,u.filterInRows[h]=s,u.filterInRows.remove(f));u.reFilter()}},r.prototype._addColumns=function(t,i){var r=this,f,c,o,l,a,h;if(r.range){if(t>=0&&r._isSortted()){for(c=0,o=0;o<i;o++)f=o+t,f<=r._sorttedColumn()&&c++;r._sorttedColumn(r._sorttedColumn()+c)}var e=-1,s=0,u=r.range;for(u.col>-1&&(u.col>=t?(e=r.range.col,r._setRangeInternal(new n.Range(u.row,u.col+i,u.rowCount,u.colCount)),s=r.range.colCount):u.col<t&&t<u.col+u.colCount&&(e=t,s=u.colCount-(t-u.col),r._setRangeInternal(new n.Range(u.row,u.col,u.rowCount,u.colCount+i)))),e<0&&(e=0,s=r.sheet.getColumnCount()-i),f=e+s-1;f>=e;f--)f>=t&&(l=f+i,a=r.filteredColMap.indexOf(f),a>=0&&(r.filteredColMap[a]=l),h=r.filterItemMap[f],h&&h.length>0&&(r.filterItemMap.remove(f),r.filterItemMap[l]=h));r.reFilter()}},r.prototype._removeRows=function(r,u){var e=this,c,l,f,o,s,h,a;if(e.range){if(c=0,l=e.sheet.getRowCount()+u-1,e.range.row>-1&&(f=e.range,c=f.row,l=f.row+f.rowCount-1,f.row>=r?f.row===r+1?e._setRangeInternal(t):f.row+f.rowCount<=r+u?e._setRangeInternal(t):f.row<r+u?e._setRangeInternal(new n.Range(r,f.col,f.row+f.rowCount-(r+u),f.colCount)):e._setRangeInternal(new n.Range(f.row-u,f.col,f.rowCount,f.colCount)):f.row<r&&r<f.row+f.rowCount&&e._setRangeInternal(new n.Range(f.row,f.col,f.rowCount-Math.min(f.row+f.rowCount-r,u),f.colCount))),e.isFiltered()&&e.filterInRows)for(o=c;o<=l;o++)o>=r&&(o<r+u?e.filterInRows.remove(o):(s=o,h=e.filterInRows[s],h!==i&&h!==t&&(a=s-u,e.filterInRows[a]=h,e.filterInRows.remove(s))));e.reFilter()}},r.prototype._setRangeInternal=function(n){this.range=n},r.prototype._updateRange=function(n){var r=this,s=r.sheet,f=r.range,c,u,a;if(f)if(n){if(!n.equals(f)){var h=f.col,v=f.colCount,e=n.col,y=n.colCount;if((!(h<0)||!(e<0))&&r.isFiltered())for(h<0&&(h=0,v=s.getColumnCount()),e<0&&(e=0,y=s.getColumnCount()),u=0;u<v;u++)c=h+u,e<=c&&c<e+y||r.removeFilterItems(c);var l=f.row,p=f.rowCount,o=n.row,w=n.rowCount;if((!(l<0)||!(o<0))&&r.isFiltered()&&r.filteredInRowsWithColIndexs)for(l<0&&(l=0,p=s.getRowCount()),o<0&&(o=0,w=s.getRowCount()),u=0;u<p;u++)a=l+u,o<=a&&a<o+w||(r.filteredInRowsWithColIndexs[a]=i)}}else r.reset();r._isSortted()&&(n&&n.contains(-1,r._sorttedColumn())||(r.sortInfo=t));r._setRangeInternal(n)},r.prototype._removeColumns=function(i,r){var f=this,o,e,l,a,h;if(f.range){i>=0&&f._isSortted()&&(i<=f._sorttedColumn()&&f._sorttedColumn()<i+r?f._sorttedColumn(-1):f._sorttedColumn()>=i&&f._sorttedColumn(f._sorttedColumn()-r));var u=f.range,s=u.col,c=u.colCount;for(s<0?(s=0,c=f.sheet.getColumnCount()+r):c=f.range.colCount,o=i+r,e=s;e<s+c;e++)e>=i&&(e<o?f.removeFilterItems(e):(l=e-r,a=f.filteredColMap.indexOf(e),a>=0&&(f.filteredColMap[a]=l),h=f.filterItemMap[e],h&&h.length>0&&(f.filterItemMap.remove(e),f.filterItemMap[l]=h)));u.col>=0&&(i<u.col?o<=u.col?f._setRangeInternal(new n.Range(u.row,u.col-r,u.rowCount,u.colCount)):o<=u.col+u.colCount?f._setRangeInternal(new n.Range(u.row,i,u.rowCount,u.col+u.colCount-o)):f._setRangeInternal(t):i<u.col+u.colCount&&(o<=u.col+u.colCount?f._setRangeInternal(new n.Range(u.row,u.col,u.rowCount,u.colCount-r)):f._setRangeInternal(new n.Range(u.row,u.col,u.rowCount,i-u.col))));f.reFilter()}},r.prototype._isSortted=function(){var n=this;return n.sortInfo?n.sortInfo.index>-1&&n.getSortState(n.sortInfo.index)!==0:!1},r.prototype._sorttedColumn=function(n){var t=this;return arguments.length===0?t.sortInfo?t.sortInfo.index:-1:(t.sortInfo?t.sortInfo.index=n:t.sortInfo={index:n,ascending:!1},t)},r.prototype._clear=function(t,i,r,u){var f=this,o,e,s;f.range&&(o=new n.Range(t,i,r,u),f.showFilterButton?(e=f.range.row-1,s=f.range.rowCount+1,e<0&&(e=-1,s=-1),o.containsRange(new n.Range(e,f.range.col,s,f.range.colCount))&&f.unfilter()):o.containsRange(f.range)&&f.unfilter())},r.prototype._getConditionTypeDictionary=function(){if(!this._ruleTypeDictionary){var t={};t[0]=n.RelationCondition;t[1]=n.NumberCondition;t[2]=n.TextCondition;t[3]=n.ColorCondition;t[4]=n.FormulaCondition;t[5]=n.DateCondition;t[6]=n.DateExCondition;t[7]=n.TextLengthCondition;t[8]=n.Top10Condition;t[9]=n.UniqueCondition;t[10]=n.AverageCondition;t[11]=n.CellValueCondition;t[12]=n.AreaCondition;this._ruleTypeDictionary=t}return this._ruleTypeDictionary},r.prototype.fromJSON=function(r){var f,e,o,s,h,c,v,a,u,l;if(r){if(f=this,r.range&&(e=r.range,f.range=new n.Range(e.row,e.col,e.rowCount,e.colCount)),n.features.conditionalFormat&&r.filterItemMap)for(u=0;u<r.filterItemMap.length;u++)if(o=r.filterItemMap[u].conditions,o)for(s=0;s<o.length;s++)h=o[s],c=t,h&&(v=f._getConditionTypeDictionary(),a=v[h.conType],a&&(c=new a,c.fromJSON(h),f.addFilterItem(r.filterItemMap[u].index,c)));if(r.filteredColMap)for(u=0;u<r.filteredColMap.length;u++)l=r.filteredColMap[u],l!==i&&l!==t&&f._filterColumn(l);r.sortInfo&&f.sortColumn(r.sortInfo.index,r.sortInfo.ascending);r.showFilterButton!==t&&r.showFilterButton!==i&&(f.showFilterButton=r.showFilterButton)}},r.prototype.toJSON=function(){for(var r,e,u,o,s,h,f,c,n=this,l=[],i=0,a=0;i<n.filterItemMap.length;i++)if(r=n.filterItemMap[i],r){for(e=[],u=0;u<r.length;u++)o=r[u],e.push(o?o.toJSON():t);l[a++]={index:i,conditions:e}}s={range:n.range,filterItemMap:l,filteredColMap:n.filteredColMap,sortInfo:n.sortInfo,showFilterButton:n.showFilterButton};h={};for(f in s)c=s[f],n._isDefaultValue(f,c)||(h[f]=c);return h},r.prototype._isDefaultValue=function(n,i){switch(n){case"filterItemMap":return i.length===0;case"filteredColMap":return i.length===0;case"sortInfo":return i===t;case"showFilterButton":return i===!0;default:return!1}},r}();n.RowFilterBase=u;r=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.isHideRowFilter=function(){return!0},t}(u);n.HideRowFilter=r;f=function(n){function t(t){n.call(this);this._table=t;t&&(this.sheet=t._getSheet())}return __extends(t,n),t.prototype.table=function(n){if(arguments.length===0)return this._table;this._table=n;n&&(this.sheet=n._getSheet())},t.prototype._addRows=function(t,i){n.prototype._addRows.call(this,t,i);this._table&&this._setRangeInternal(this._table.dataRange())},t.prototype._removeRows=function(t,i){n.prototype._removeRows.call(this,t,i);this._table&&this._setRangeInternal(this._table.dataRange())},t}(r);n._TableFilter=f})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){(function(n){var lt,it,rt,ut;n.feature("filter_ui",["core.common","core.stringResource","filter","core.spreadpanelex"]);var u=null,f="undefined",l="sortASC",y="sortDES",o="filterOK",p="filterCancel",a="filterSearch",w="filterCheckAll",s="filterUnCheckAll",t="filter-item",e="filter-item-container",ft="filter-ui",et="filter-item-wrapper",v="filter-item-input",b="filter-item-text",h="filter-button",c="filter-sort",g="filter-check",k="filter-check-style",ot="filter-check-outerDiv",nt=".ui-filter-dialog",st="keydown"+nt,ht="keyup"+nt,tt="layout-table",d="filter-dialog-style",i="ui-state-hover",r="container-default-hover",ct="no-user-select";(function(n){n[n.noSortFilter=0]="noSortFilter";n[n.ascend=1]="ascend";n[n.descend=2]="descend";n[n.filter=3]="filter";n[n.filterAscend=4]="filterAscend";n[n.filterDescend=5]="filterDescend";n[n.sortAscending=6]="sortAscending";n[n.sortDescending=7]="sortDescending";n[n.checkAll=8]="checkAll";n[n.unCheckAll=9]="unCheckAll"})(n._FilterButtonState||(n._FilterButtonState={}));lt=n._FilterButtonState;it=function(){function n(n,t,i,r,u,f,e,o){var s=this;s.rowFilter=n;s.row=t;s.col=i;s.sheetArea=r;s.x=u;s.y=f;s.width=e;s.height=o}return n.prototype.getState=function(){var n=0,i=this.rowFilter,t;return i?(t=i.getSortState(this.col),i.isColumnFiltered(this.col)?t===0?n=3:t===1?n=4:t===2&&(n=5):t===0?n=0:t===1?n=1:t===2&&(n=2),n):n},n}();n._FilterButtonInfo=it;rt=function(n){function t(){n.call(this)}return __extends(t,n),t.prototype.find=function(n,t,i){for(var e=this.length,r,f=0;f<e;f++)if(r=this[f],r&&r.row===n&&r.col===t&&r.sheetArea===i)return r;return u},t}(n._XArray);n._FilterButtonInfoModel=rt;ut=function(nt){function it(n,t){nt.call(this);var i=this;i._useWijmoTheme=!1;i.sheet=n;i.filterButtonInfo=t;i.init()}return __extends(it,nt),it.prototype.init=function(){var n=this;n.defaultItemWidth=185;n._touchContainerWidth=257;n._touchContainerHeight=355;n.rEscape="/[-[]{}()*+?.,\\^$|#s]/g";n._itemValueCache=[];n._firstOpenCache=[];n.elementList=[];n.allItemsLength=-1;n.activeItemIndex=0;n.container=n.getContainer();n._createTableLayout();n._initFilterPanel()},it.prototype.open=function(){var t=this,r=t.sheet,i=r.parent,e,u;if(r){e=i&&i.useTouchLayout?i.useTouchLayout():!1;u=i&&typeof i.useWijmoTheme!=f?i.useWijmoTheme:!1;t._initData(t.filterButtonInfo.col);t.container.appendTo(document.body);t.container.hide();t.show("normal","fade",function(){$("#"+l).focus()});e&&t._updateFilterPanel(t._touchContainerWidth,t._touchContainerHeight);var o=$(r._getCanvas()).offset(),c=t.container.width(),a=t.container.height(),s=t.filterButtonInfo.x+t.filterButtonInfo.width-c,h=t.filterButtonInfo.y+t.filterButtonInfo.height;s+=o.left-6;h+=o.top;t.container.css({left:s,top:h});t.resetDialogPosition();t._initFirstOpenCache();t._setItemWidth();t.filterScrollPanel||(t.filterScrollPanel=new n.ScrollablePanel(t.itemList[0],t.itemsWrapper[0]));t.filterScrollPanel.refreshLayout();t._updateItemWidth();t._updateItemCache();t._attachEvent();t.useWijmoTheme(u);t.filterScrollPanel.useWijmoTheme(u)}},it.prototype._updateFilterPanel=function(n,i){var f=this,u=n-parseFloat(f.container.css("width")),r=i-parseFloat(f.container.css("height")),nt,l,y,rt,k,ft,g,et,st,ht;if(!(u<=0)&&!(r<=0)){f.container.css({width:n+"px",height:i+"px"});nt=parseFloat($("."+c).css("padding-top"))+r/30;$("."+c).css("padding",nt+"px 6px");l=$("."+t);y=parseFloat(l.css("height"))+r/4;l.css("height",y+"px");var p=$("."+v),tt=$("."+b),ct=parseFloat(p.css("height")),lt=parseFloat(p.css("margin-top")),it=(y-ct)/2;p.css("margin-top",it+"px");rt=parseFloat(tt.css("top"))+it-lt;tt.css("top",rt+"px");var at=parseFloat($("."+e).css("height")),vt=parseFloat($("."+e).css("width")),yt=at+u,ut=vt+r/2;$("."+e).css({width:ut+"px",height:yt+"px"});f.defaultItemWidth=ut-5;var w=$("."+h),pt=parseFloat(w.css("width"))+u/4,wt=parseFloat(w.css("height"))+r/8;w.css({width:pt+"px",height:wt+"px"});k=$("#"+o);ft=parseFloat(k.css("margin-left"))+u/2;k.css("margin-left",ft+"px");var d=$("#"+a),bt=parseFloat(d.css("width"))+u,kt=parseFloat(d.css("height"))+r/8;d.css({height:kt+"px",width:bt+"px"});g=$("."+ot);et=parseFloat(g.css("margin-top"))+r/10;g.css("margin-top",et+"px");st=$("#"+s);ht=parseFloat(st.css("margin-left"))+u;$("#"+s).css("margin-left",ht+"px")}},it.prototype.close=function(){nt.prototype.close.call(this);this.sheet&&this.sheet.setFocus()},it.prototype.useWijmoTheme=function(n){var i=this;if(typeof n===f)return i._useWijmoTheme;if(typeof n=="boolean"&&i._useWijmoTheme!==n){nt.prototype.useWijmoTheme.call(this,n);var e=$("."+g),r=$("."+h),o=$("."+c),l=$("."+t),a=$("#"+w),v=$("#"+s),y=$(".sort-container"),p=$("."+tt);return n?(i.container.removeClass(d),i.searchOuterDiv.removeClass("container-default-header"),r.removeClass("container-default-state"),e.removeClass(k),i.searchOuterDiv.addClass("ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix"),o.addClass("ui-corner-all"),l.addClass("ui-corner-all"),r.addClass("ui-button ui-state-default ui-corner-all"),a.find("span:eq(0)").addClass("ui-icon ui-icon-check"),v.find("span:eq(0)").addClass("ui-icon ui-icon-closethick"),p.addClass("ui-menu"),y.addClass("ui-menu-item")):(i.searchOuterDiv.remove("ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix"),o.removeClass("ui-corner-all"),l.removeClass("ui-corner-all"),r.removeClass("ui-button ui-state-default ui-corner-all"),a.find("span:eq(0)").removeClass("ui-icon ui-icon-check"),v.find("span:eq(0)").removeClass("ui-icon ui-icon-closethick"),p.removeClass("ui-menu"),y.removeClass("ui-menu-item"),i.container.addClass(d),e.addClass(k),i.searchOuterDiv.addClass("container-default-header"),r.addClass("container-default-state")),i}return u},it.prototype._initFilterPanel=function(){var t=this,u=t._getSortLink(l,n.SR.SortAscending).css("margin-top","6px"),f=t._getSortLink(y,n.SR.SortDescending),c,v,i,r;t.table.find("tr:eq(0) td:eq(0)").append($("<img>").attr("src",it.getImageSrc(6)));t.table.find("tr:eq(1) td:eq(0)").append($("<img>").attr("src",it.getImageSrc(7)));t.table.find("tr:eq(0) td:eq(1)").append(u);t.table.find("tr:eq(1) td:eq(1)").append(f);t.elementList.push(u[0]);t.elementList.push(f[0]);t.searchOuterDiv=$("<div>").addClass("search-outer-div container-default-header");c=$("<div>").appendTo(t.searchOuterDiv);v=$("<input>").attr({type:"search",placeholder:n.SR.Search,id:a}).appendTo(c);t.elementList.push(v[0]);var b=$("<div>").appendTo(t.searchOuterDiv).addClass("filter-check-outerDiv"),k=t._getCheckLink(w,n.SR.CheckAll,"check-image"),d=t._getCheckLink(s,n.SR.UncheckAll,"uncheck-image");b.append(k).append(d);t.table.find("tr:eq(2) td:eq(1)").append(t.searchOuterDiv);t.itemList=$("<div>").addClass(e);t.table.find("tr:eq(3) td:eq(1)").append(t.itemList);i=$("<button>").text(n.SR.OK).addClass(h+" container-default-state").attr({id:o});r=$("<button>").text(n.SR.Cancel).addClass(h+" container-default-state").attr({id:p});t.table.find("tr:eq(4) td:eq(1)").append(i);t.table.find("tr:eq(4) td:eq(1)").append(r);t.elementList.push(i[0]);t.elementList.push(r[0])},it.prototype._createTableLayout=function(){var n=this,u=5,f=3,t,i,r,e;for(n.table=$("<table>").css({padding:0,display:"table"}).attr({cellspacing:0,cellpadding:0}).addClass(tt),t=0;t<u;t++){for(i=$("<tr>"),r=0;r<f;r++)e=$("<td>").appendTo(i);i.appendTo(n.table)}n.table.appendTo(n.container);$(n.table).find("tr").each(function(){$("td:eq(0)",this).addClass("layout-table-first-column");$("td:eq(2)",this).addClass("layout-table-last-column")});$(n.table).find("tr:eq(1) td:eq(1)").addClass("filter-sort-desc-container sort-container");$(n.table).find("tr:eq(0) td:eq(1)").addClass("filter-sort-asc-container sort-container");n.container.css({"box-shadow":"rgba(0, 0, 0, 0.4) 2px 4px 5px",padding:"2px"}).addClass(d+" "+ft+" "+ct)},it.prototype._updateItemCache=function(){var t=$("."+e),i=t.find("input"),n;this._itemValueCache=[];n=this;i.each(function(t){n._itemValueCache.push($(this).val().toLowerCase())})},it.prototype._stopBubble=function(n){return n&&n.stopPropagation?n.stopPropagation():window.event.cancelBubble=!0,!1},it.prototype._attachEvent=function(){var e=this;$("#"+l).bind({mouseup:function(t){e._sortByUser(!0);e.close();n.util.cancelDefault(t)},mousedown:function(t){n.util.cancelDefault(t)}});$("#"+y).bind({mouseup:function(t){e._sortByUser(!1);e.close();n.util.cancelDefault(t)},mousedown:function(t){n.util.cancelDefault(t)}});$("."+c).hover(function(){var n="filter-hover "+(e._useWijmoTheme?i:r),t=$(".filter-hover");t.removeClass(i+" "+r);$(this).addClass(n)},function(){var n="filter-hover "+(e._useWijmoTheme?i:r);$(this).removeClass(n)});$("#"+w).bind({mousedown:function(t){n.util.cancelDefault(t)},mouseup:function(i){var r=$("."+t).find("input:visible");r.prop("checked",!0);e._setButtonState();n.util.cancelDefault(i)}});$("#"+s).bind({mousedown:function(t){n.util.cancelDefault(t)},mouseup:function(i){var r=$("."+t).find("input:visible");r.prop("checked",!1);e._setButtonState();n.util.cancelDefault(i)}});$("."+t).bind({mouseenter:function(){var n="filter-hover "+(e._useWijmoTheme?i:r),t=$(".filter-hover");t.removeClass(i+" "+r);$(this).addClass(n)},mouseleave:function(){var n="filter-hover "+(e._useWijmoTheme?i:r);$(this).removeClass(n)},click:function(n){$(this).find("input").trigger("click")}});$("."+t).find("input").bind("click",function(n){e._stopBubble(n);e._setButtonState();var i=$(this).parents("div."+t).get(0);e._updateActiveItemIndex(i)});$("#"+a).bind({keydown:function(n){var t=n.which||n.keyCode;t===13&&n.preventDefault()},keyup:function(n){switch(n.keyCode){case 9:case 37:case 38:case 39:case 40:return;default:e._handler.call(e,n);e._setItemWidth();e.filterScrollPanel.refreshLayout();e._updateItemWidth();e._setButtonState()}},search:function(n){e._handler.call(e,n);e._setItemWidth();e.filterScrollPanel.refreshLayout();e._updateItemWidth();e._setButtonState()}});$("."+h).hover(function(){var n=$(".filter-button-hover"),t="filter-button-hover "+(e._useWijmoTheme?i:r);n.removeClass(i+" "+r);$(this).addClass(t)},function(){var n="filter-button-hover "+(e._useWijmoTheme?i:r);$(this).removeClass(n)});$("#"+o).bind("click",function(){var n=e._getCheckedValuesByUser();e._updateData(n);e._filter(n);e.close()});$("#"+p).bind("click",function(){e.close()});$(e.container).bind("mousewheel",function(t){n.util.cancelDefault(t)});$(e.container).bind(st,function(s){var b=s.which||s.keyCode,c,g,tt,it,h,d,w,nt,rt,k,a,ft,et,v,ot,ut;if(b===27||b===13||b===38||b===40||b===9){if(c=u,c=e._useWijmoTheme?$("."+i):$("."+r),b===27)return e.close(),n.util.cancelDefault(s),!1;if(b===13){if(c.length!==1)return;g=c.attr("id");g===l?(e._sortByUser(!0),e.close()):g===y?(e._sortByUser(!1),e.close()):g===o?(tt=e._getCheckedValuesByUser(),e._updateData(tt),e._filter(tt),e.close()):g===p?e.close():(it=$(c).find("input"),it.length>0&&it.trigger("click"),e._updateActiveItemIndex(c[0]))}if(b===38||b===40||b===9){if(d=e.itemList.find("div."+t),c.length===0)h=e.elementList[0];else{for(c.removeClass(i+" "+r),w=e.elementList.concat([]),nt=0;nt<d.length;nt++)w.splice(-2,0,d[nt]);if(rt=!0,b===9){if(s.shiftKey&&(rt=!1),k=e.elementList.concat([]),k.splice(-2,0,d[e.activeItemIndex]),a=$.inArray(c[0],d),rt){if(a>=0)ft=$(e.elementList[3]),h=e._ignoreElement(ft)?e.elementList[4]:e.elementList[3];else if(a=$.inArray(c[0],k),a>=0)for(et=k.length,h=k[a+1];e._ignoreElement($(h))&&a<et;)h=k[a+1],a++}else{if(a>=0)h=e.elementList[2];else if(a=$.inArray(c[0],k),a>=0)for(h=k[a-1];a>0&&e._ignoreElement($(h));)h=k[a-1],a--;typeof h===f&&(h=k[k.length-1])}typeof h===f&&(h=k[0])}else if(v=$.inArray(c[0],w),ot=w.length,v>=0){if(b===40)for(h=w[v+1],$.inArray(h,d)!==-1&&$.inArray(c[0],d)===-1&&(v=v+e.activeItemIndex,h=w[v+1]);v<ot&&e._ignoreElement($(h));)h=w[v+1],v++;else{for(h=w[v-1],$.inArray(h,d)!==-1&&$.inArray(c[0],d)===-1&&(v=e.activeItemIndex+3,h=w[v]);v>0&&e._ignoreElement($(h));)h=w[v-1],v--;typeof h===f&&(h=w[w.length-1])}typeof h===f&&(h=w[0])}}c=$(h);ut=$.inArray(h,d);ut>=0?(e.activeItemIndex=ut,e.filterScrollPanel.scrollChildIntoView(h),c.find("input").focus()):c.focus();e._useWijmoTheme?c.addClass("filter-hover "+i):c.addClass("filter-hover "+r);n.util.cancelDefault(s)}}});$(e.container).bind(ht,function(t){n.util.cancelDefault(t)})},it.prototype._updateActiveItemIndex=function(n){var r=this.itemList.find("div."+t),i;r.length!==0&&(i=$.inArray(n,r),i>=0&&(this.activeItemIndex=i))},it.prototype._setFocusBack=function(){this.sheet&&this.sheet.setFocus()},it.prototype._ignoreElement=function(n){return n.length===0?!1:n.hasClass("ui-button-disabled")||n.hasClass(" ui-state-disabled")||n.hasClass("filter-button-disable")?!0:n.is(":visible")?!1:!0},it.prototype._updateItemPanel=function(){var n=$("."+t),i=n.find("input");i.prop("checked",!1);n.show()},it.prototype._filter=function(t){var r=this,i=r.sheet,f,u;if(i){f=i.isPaintSuspended();try{if(i.isPaintSuspended(!0),u=r.filterButtonInfo.rowFilter,!u)return;t&&t.length>0&&i._trigger(n.Events.RangeFiltering,{sheet:i,sheetName:i._name,col:r.filterButtonInfo.col,filterValues:t});u.filter(r.filterButtonInfo.col);t&&t.length>0&&i._trigger(n.Events.RangeFiltered,{sheet:i,sheetName:i._name,col:r.filterButtonInfo.col,filterValues:t})}finally{i.isPaintSuspended(f)}}},it.prototype._updateData=function(t){var e=this.filterButtonInfo.col,i=this.filterButtonInfo.rowFilter,r,f,o;if(i&&n.features.conditionalFormat)for(i.unfilter(e),i.removeFilterItems(e),r=0;r<t.length;r++)f=t[r],f===n.SR.Blanks&&(f=""),o=new n.TextCondition(0,f,u),i.addFilterItem(e,o)},it.prototype._getCheckedValuesByUser=function(){var n=[],t=$("."+e),i=t.find("input");return i.each(function(t){$(this).prop("checked")&&n.push($(this).val())}),this.allItemsLength===n.length&&(n=[]),n},it.prototype._handler=function(n){var o=$("#"+a),r=$.trim(o.val().toLowerCase()),s=$("."+e),t=s.find("input"),i=t.parent(),u,f;r?(i.hide(),t.prop("checked",!1),f=new RegExp(r.replace(this.rEscape,"\\$&"),"gi"),$.map(this._itemValueCache,function(n,r){if(n.search(f)!==-1){i.eq(r).show();var u=t.get(r);return $(u).prop("checked",!0),u}})):(i.show(),this._firstOpenCache&&this._firstOpenCache.length!==0?(t.prop("checked",!1),u=this,$.each(t,function(n,t){var i=t;$.inArray(i.value,u._firstOpenCache)!==-1&&$(i).prop("checked",!0)})):this._initFirstOpenCache())},it.prototype._getSortLink=function(n,t,i){var r=$("<a>");return r.attr({id:n,href:"javascript:void(0)"}).text(t).addClass(c).css({display:"block",padding:"5px 6px",cursor:"default",margin:"2px 0px 1px 2px","text-decoration":"none",outline:"none"}),i&&(r.click=i),r},it.prototype._getCheckLink=function(n,t,i,r){var f=$("<span>").addClass("check-uncheck-all "+i),e=$("<span>").text(t),u=$("<a>");return u.attr({href:"javascript:void(0)",id:n}).css({float:"left","margin-left":"7px"}).addClass(g+" "+k).append(f).append(e),r&&(u.click=r),u},it.prototype._initData=function(n){var t=this,u=t.filterButtonInfo.rowFilter,i,r,f;u&&(i=t._getAllData(n),i.sort(function(n,t){return n>t?1:n<t?-1:0}),t._bindData(i),r=[],r=u.isColumnFiltered(n)?t._getCheckedData(n):i,f=t._getActualValues(i,r),t._setCheckedValues(f))},it.prototype._getAllData=function(t){var i=[],u=this.filterButtonInfo.rowFilter,r,f,e;return u?(f=this.sheet,f&&(r=f._getActualRange(u.range)),t<r.col||t>r.col+r.colCount-1)?i:(e={hasBlank:!1},i=u._getCandindateDataItems(t,e),e.hasBlank&&i.push(n.SR.Blanks),i):i},it.prototype._bindData=function(n){var r=this,s=document.createElement("div"),h,f,e,u,i,o;for(s.className=et,h=n.length,f=0;f<h;f++)e=n[f],u=document.createElement("div"),u.className=t,s.appendChild(u),i=document.createElement("input"),i.className=v,i.setAttribute("type","checkbox"),i.setAttribute("value",e),i.setAttribute("title",e),u.appendChild(i),o=document.createElement("span"),o.className=b,o.innerHTML=e,u.appendChild(o);r.itemList.empty();r.allItemsLength=h;r.itemsWrapper=$(s);$(r.itemsWrapper).appendTo(r.itemList)},it.prototype._setItemWidth=function(){var s=$("."+b),h=$("."+t),i=$("."+v),r=parseFloat(h.css("border-width")),u=parseFloat(i.css("margin-left")),f=parseFloat(i.css("margin-right")),e=0,l=0,n,o,c;for(isNaN(r)&&(r=0),isNaN(u)&&(u=0),isNaN(f)&&(f=0),n=0;n<s.length;n++)o=$(s[n]).width(),e<o&&(e=o);c=e+i.width()+u+f+2*r;h.css("width",c)},it.prototype._updateItemWidth=function(){var n=this,i=n.filterScrollPanel,r,u,f;i&&(r=i.showVerticalScrollbar(),u=i.showHorizontalScrollbar(),f=u?$(n.itemsWrapper).width():r?n.defaultItemWidth-i._defaultScrollbarSize:n.defaultItemWidth,$("."+t).css("width",f))},it.prototype._getCheckedData=function(n){var f=this.sheet,e=[],h={},t=this.filterButtonInfo.rowFilter,o,c,i,s,r;if(!t||!f)return e;if(t.isColumnFiltered(n))for(o=t.range.row===-1?0:t.range.row,c=t.range.rowCount===-1?f.getRowCount():t.range.rowCount,i=o;i<o+c;i++)t.isRowFilteredOut(i)||(s=f.getValue(i,n),r=u,r=s instanceof Date?s:f.getText(i,n),h[r]||(e.push(r),h[r]=!0));return e},it.prototype._ArrayToDic=function(n){var t={};return $.each(n,function(n,i){t[i]=i}),t},it.prototype._setCheckedValues=function(n){var t=this._ArrayToDic(n);this.itemList.find("input").each(function(){var n=$(this),i=n.val();t[i]!==u&&typeof t[i]!=f?n.prop("checked",!0):n.prop("checked",!1)})},it.prototype._getActualValues=function(t,i){for(var r,o=[],s=this._ArrayToDic(t),h={},e=0;e<i.length;e++)r=i[e],(r===undefined||r===u||r==="")&&(r=n.SR.Blanks),s[r]===u||typeof s[r]==f||h[r]||(o.push(r),h[r]=!0);return o},it.prototype._sortByUser=function(t){var f=this.filterButtonInfo.rowFilter,i,u,r,e;f&&(i=this.sheet,u=i._name,i)&&(r=this.filterButtonInfo.col,i._trigger(n.Events.RangeSorting,{sheet:i,sheetName:u,col:r,ascending:t}),e=i.isPaintSuspended(),i.isPaintSuspended(!0),f.sortColumn(r,t),i.isPaintSuspended(e),i._trigger(n.Events.RangeSorted,{sheet:i,sheetName:u,col:r,ascending:t}))},it.prototype._setButtonState=function(){var f=$("."+e),s=f.find("input"),n=0,t=$("#"+o);s.each(function(t){if($(this).prop("checked"))return n++,!1});var i=this._useWijmoTheme,r="ui-button-disabled ui-state-disabled",u="filter-button-disable";n>0?t.attr("disabled",!1).removeClass(i?r:u):t.attr("disabled",!0).addClass(i?r:u)},it.prototype._initFirstOpenCache=function(){var t=$("."+v),n;this._firstOpenCache=[];n=this;$.each(t,function(t,i){$(i).prop("checked")===!0&&n._firstOpenCache.push(i.value)})},it.getImageSrc=function(n){if(n===0)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAMOSURBVHjaXJNdaJRHFIbfM7PfGremUTfkpxgpiheiBOmFtYUgRXNRqNnd75sEhBoIKhrwQpFUUSsihhIQ41+FNrUGqYhRY43STZqgARNRTIzRaFqz6xJTtals3K8xRQ3x7UV215+LB2bOxTNn3jMDs+mEIgmS+LwQiqSQ9JG03FHX54666pn7TLmJEZVIjCCRGMkYGxvNiI9FvaENZzLw/PmqtCDFV/4WkERw8TI03K6XqqrNWLBgPoafDmNwMCbd3TestpMDHpJAuIcWSZjSUrnS0SFOWamXJLpuDYAkAiYAkioYDCIej0+Lx12QrervFxOemjWfCvIyIcmTVeLVC1986OkUklhRtlgutLYrkpnOKlt1dl0BSfTHmnCnm5oTm0AS6I0xLaDLrK1PusTp/cb7/rUAyH8kSL+Vqt0ebpuGP699LCRROAdqf/suGforCpLi4DMpAOQQLAEgfE2sRDZIv5cknGxi74HDFnZ/32olk9f//vOTPIj05ZnKZpp14QlnfZgpTOXvNGsvjrvuH9MnOwAOYlhQ/UPYmxRkJVvzPHw8JF8EdrKoZEeapSt2cHDo4Sxn7R0hiV8/hEQe3Ad21jZNJQnbDklSBBas0ddvRj2Fi4qZIhaL+Q3ni8N0ZohGe4Dv6sKZfFP0kvkSWLZdGvLpiUTuTS9cVMxI5H5+fz+UfXyOto/Ns5bUL7dyjsBjTsKDbbVnM0iqYNHXYi9ZLiSlaRbFn089zlzvwN1IzkDlmDhfdiin5KgOBY5qO9iojX1K9+VRcOCXnlySsFkOkjj/WGschtR0Kt/Ga9D2aYj5DWKaIeYSxTlFMS2T66udBDbXHS94Z97ZUB8Ayt7+iVVddlkzl5LCvrklvQ9dr1fnF0IQbng5O/VQsmAJSfnxSLuqCG3Rxxpfz3xbXv0IEkzm5YR7lXOCGs6+PVNJYjaQnoKwSgBIDSqkjjPUuv3QLP9ImW+hG1/lKJtzp5jaCmW2nrNAUpOUkqrWrJUb23T5rhZf0eoWhbeEKX7O4eTPHe8DSTjF59T/AwCfnhbaDaIICgAAAABJRU5ErkJggg==";else if(n===1)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAALLSURBVHjadJNtaNVlGMav+/kfjy3GTDfcsQW1CMrhWSZ6AsmXmflFDts5/0eYA52i02M6tdBIRQQJBLX8Yg4xYlMEJaHphzxKzoiaZptN0MBtacyXoYIobUgT/fXhtOMS+vBw89wXXPfLdd0CLNxwyACF648YYH7tnuEYAeQbv3CA/EeHBcivazbAUo1fv6hwfYtJEjDy2XP//8vpGbA9ZiE7xQ6USs3S7sUx9YHNbMqYn1IerGmQ3pr8uYXsNUAqnZ+LvqHJAA2BeIoGT6DJbMqBbAwArR77vs4/uhOje9BxlXEcww13pXDvtwaoes1MB6iz8xfxGkIIiLCUIEXaDTxiFJOmKp5YxDcciS6jVpRi8g1H87PVgLYslwO0GYzf+x377ubwXoLKafXEE/WUTfC9tBIhwNTJdAPkw4R1fdkkOmJW1/LAYNBV54iDJK8HH7NPd+/9MTqeWER//62YHxrrJvCDydd99Z/tpjLboz7znQF2/vSfufwY9Ne1e9r9JtHKaUvxqWY3UgXX23dNbccOlhQUFxUN9GweVsaWIQNZRfkeByidrnDxRD19N29U5AnChkMO0BMYAwRA4GkPAKuZc/2F8JWTDlB716sCIm9PXcz1K9+/lCc4erstABQmP3U8LBvlV2VJr8yyIHMSv+LUk1QmCzADBjQnrB0dT9TT0/243NfqXx8szwaAzq6Q1bDJnWnrmlKV3EZVchvvJbfQ2nqmDLDqD0/YXFqs8t0l/Haxu3j+vOPDO9ifu4P9jwPAeSk6RE/RpHc+4KefL8waYWEDrOPX9ol/cycA1KH7pvCTsxFAPxZGXQ1YmDhlgNIHsoWQd5wONw4JxgfhwmeKXSUjXbq0Oi/j80el28UjqpdqK1ivcCB7KJwXTuHKcwWAPtPCoJkShy7kjKU3dIXLAvQyVdq1C3WVXNbE2RgUOphuqVXH3T8DAFTcPgRQEEuLAAAAAElFTkSuQmCC";else if(n===2)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAJKSURBVHjanJJfSJNhFMaf9/02R9MFCVZLUOgfpLMCmwrd7KIIm6X4fXoTY1oXltaN86oEi4xodtNNeNMHJZQ0gpDQmUKEyUAiyKCFW4PNtSFMoyKJSp4uputbJIUX5+K855zfe85zDkhiza4u2+HXn4M64dcBvw5BTotLtyDJ49KvI2fapK/Q/8qkwAjYiEHj4rrBG+ft4p+AB51f8pKazxxDY/djhLYj95bJLKG5fR+w5whUVxNUtR6qOiHUrmABNH3AkgcoqsBM11O56gvVUy2GV6CQNA/WjFdkMpnyhYV0NjZOAf6ksQMZCGQL3e526fUWm0kKrlAJRT7CUXeac+Gp3bRTaJpHXsReoLl3yGQAKPUtlaJh8yHxKI0s+C3xLHHXwjIqlbXtTKc/lKTScaRSFItMAWReB4WtdfdMJCVJTI18xihLNzFCyWXC4WxjMpksjiOK5BytjXIGUH0XCowjkFsESeF27BQLSy9F/2FK0ip6wa2VtV7OxxNF8XgciUQCKpMCZFoaRdQ6PXIHshvQDtACUJDARA/tVTVe6rHrSs97mMPh16j3vQECvpKc4iSLWzrGqXWMrahnx6h1jP5oPRf8Ho1FLA5nG/c7vayq8TIajdoikRi0nqCEdn9gDaCQLNVOXZOuk310nbhCV0Mvhx+OWlbhykGnh+Hou20sy2rUdLtbAJxUfs9PwW9PQM4qjuqjfDEd6ssX+VP56kdZ/+s80H9nZJcBYDxT6x8b+vspDw4Fbf+TuC7gpn7ZtoFCSdJE0vxrAN8Jcr/DWZzEAAAAAElFTkSuQmCC";else if(n===3)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAMuSURBVHjaZJN/aNR1GMefz+f7/d6P3aZGDGVKERLDbXdMJAQhlr+ujWo62g5DpUBiEyJjpxi0ZRtyDSQvV0cDd2uw213b1EHiFjbGZq5bIbc5dTuyybRyK+ZCDrG0evWHdwfWHx8+PDwPz/vzeb2fR451DGvpQB2ODJvnP24zDkewD7Zct6h9qD1j4TzPWNgsip80isbCxuS7vzinGm5aZwcwbwVPGoAhgAIEsAAN2NKxSscmYKRvE1iRPrY3Vt7Ski4WQKaJOmbjyF3WS//3jfr4hVXGEA55J5aXc+ZMdF0yOZWbFtCAKtx5zCUQLQBk32svPFJ8eHN16u+fCn6fv+MErKWlRWdvPzr9QpUVnIroxravlYz0tTvWdi9XRFGA6ugKOMPh7qHu7u5Ue3s7ra2tBIMnaG4+Sl1dHTU1NZSXl7P42x39zRxKYl82mYD8Q0wA8bjFmv855Xqzdu/swsICDx78xfz8r0xMXKa+/iBer5fx8W+PDi22PjH43pKSoi2bzIS+reVlUYCVn18q11hl9vb2GIFAgFQqxczMDKFQCK/Xy8WLF4ozkN2e00o8O07YA1KpxCUCyKYSUX1fxDQgc3NzRjAY/DMej+Pz+ejpiTkzAAEpqfpEJHeP2PZJXO32VBsbKryydY3IPZB1a3IVIH6/n1AoREVFBWmQjzknK7aLHm4bWXs5cel48uq0ziQGolE9e/uG8vsPceDttygrK8s2cBfkZ9zQ8syGbeaVyQmp3v8VNXWDvFo3SPX+8/hqzxEPjqiD9X5eqqoiN8fFjzeu5wHidh9xZTjIgZr1BqAaWi6Zm3e8z/OVDZS90kBv74AdUH7/IbZu3oJps0h8N7N62IXpLt2VnVbZWfKc+jTx+aM/3bti85RuZ3RsvBjQxFgWO9VnTSebzB+SMyvhtMMTFsv9+l4r26Czq0sxcV9F+3eprnOJwumr14ozpMMfnLV/duQjPdeDmiTiaGrutLs3Nhjujc86sxD/uHs/DxCPjFrbXly0N7ZEbR9GcPb0jz4NS/q/1P/nwlOFlYpOrZ4UkeUiOt8nRk6xyGNzT3YXTGBZeqEcgP53ACxeTBjELwuFAAAAAElFTkSuQmCC";else if(n===4)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAMNSURBVHjalJNfaFt1FMfP796bm9hublCwa93AVd3W5d67ddisFFw1lovUl7r0jx2rWWW6prpCkzfrUwjVFx0LwSrYPtiO0YJPDsuwIOJKq1PL0q43iZ3OuUp04p8owmbl40PXMgaCPnzhcPjCOef7PV8BxD6WETrKjXcviUbjTlW870/ta9mqfiqv1kuRQePjk68pkj4FSfX66HRA8ujfDPapvveWN4n1xKAC5H9CB3SRo767m9uhvRxQUGXAEXOt3uCodViWpT4Yi+tC1Rrhj99/luV8QQ43unrkxWaNVSqvXSNgHSeQSqU2A4Zt2xUdHR3bp6amwp8uTNU91jRgij2PAWg1da+sTwmeGTv768TExN8jIyOk0xlOnTpNMpkiFovR3t6O67rcuPHDJkCtr6U7zVH/gffPKrwravLzC75EIkGxWOTWrVWKxR+Zn79EPB7HdV3m5uYaAK12/xfmxm0P1uwW62D36p77nzdXVr4Txwn5h4aGVkqlEp6XJ5PJ4LouMzMzDYAGiPXkGwGJLGIAyqmPYod6sEM9vziRF0xALMvS0+n0zdnZWTo7O5mcnNwHaNevi27bqN0v+w1pWyj5AOUEjygn1I3VeLzaund/xfj4uAASi8WWM5kMLS0tAAYgV69+K5cvvyq/zZ7TpG1hzZaqbZbsDR3DPnSi2n6ka0uhUJB8Pt+QSCTo7++nqamJ204YXV1PG5aF2nFxUgn7PlGAWIefVXYoihVufcBWorLZrOTz+YMDAwN/tba2UlZWRi6Xq7itmQbb9JnU25qMvvmRAKrmoafEqY/edOqf2bljV/iebDYrgPT29q6Ew2FM06RQKFQMDw+L4ziabaP3nXwpIBy9oACVnBblHOh52N4Vqaxr7jYAFQwGty4uLm72PE/3PK8yt+QZuawnjgSN0TOiDj36nCmP9364pjiY1hJ67RX8F5dMBUjtW7Xav+Xh3PRnIiK6CF/qd/66886YHvW3Sfh8lQHfy11Z2MCegBgioknbCZQTPr1l71di/IcUqjsgLfHzvn8GACNDKumTxWELAAAAAElFTkSuQmCC";else if(n===5)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAANBSURBVHjaXJNfSGR1HMXP73fvdcYdo7Vy1KRlZ9DdnOvv5uTODK0s1mxDyKIYSRYoUwQikkgzPUS0RuW6QRCEuIiM/XuxNdiH6m17WnZFCMSHtjuOszONf0ZnGgW1iLbw9DBl0sPhy3k5HDjfD0h6w/VvSJJC8a5sOPeUYQ1TIjAuPOc+kN6Kae2JthodGBCVrSEdpmXAd8pJUrb2julgiWgJ9MMXABIXYADApQA0ACLc8Jjg9bAkKbhbD5LimDTgNQn15sc6SZD1onyPZIAUSyQOSS124oLzDxL7hwRJjaTIFbYcUJ5xB0lYp29oZ8+OypZnPhfvkXiHdGz8nHHs7++6e+vede6UiiiVio69vR2v1+2S5slqQRJ4XvdXkBS7O+uuUv43bO79UvPZp4nfr8/N/Tk7O8urVz9cu3x5zH6x76Xvuru7f+zq6joIhUKFYrHYSBJA4yVBUm5sbWPm15nqH1bvOpRScnBwcL1QKPD+/b+4vV3k0tIy4/E4I5EIFxcXu0nKckDwWUlSV6peqGCUW/mvJUmoNr82MTHBg4MD2rbNqakpRiIR3r59a5ykzOc3QBJob5txkZSbuQ00h/q5ub7htZSJ9NYmlDLF5OQkFxYW2NfXx/n5+YskhWk2G0p9IV5BXgDBAZ1k5Z07tx6wAlHmcjlHjrUim13D8vIaYrEYr12bZmdnJ0k6ygvVHi0GOD2SpHGPhApGmclkKjKZ15HJpHHzJrV4PM6RkRF2dHQwm83WeTweMTw8cCwA1YKkUwWjVMEofaFXeS99w1CksKwWIxaLsaenh1VVVUyn0yf8fmBoKCpIoqeBAr3n50DywdXVlWorEGUqufp0imnpM8eEaZpaPB5nOBymrutMpVKuM2dGdQvjGh+icfFxCCA0YJB0tKC9Mpn8qTKZhLSS0BOJUWmaprBtu8K2bW1lZeVR27alUq3SwpDBh2t1fAUN/eepkYfCOvW26/grWxNB6XukvYJJwgKE+c1zUs270TQdkmq4WeKtTwS+hETiCgUJafrb/89CWTU9/8JT9k2UnP7HN1Ag+OQV8Ps6Yb78vigj/a08ahGCaGzql/zIrbmhy/9IzAmSztMvzJz8ewAvdf7cUVI5hQAAAABJRU5ErkJggg==";else if(n===6)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAABy0lEQVR42pyST2gTQRTGv9nEpCnqTasHES8VLCioiFDIYYum+I/ebFXQm1BbsdSDhKgoXhS8tLQSqAhexIInETwJIqJiexJEZXupwRJNbRsy2Z3dzHxesjGEChs/eMx7A+837817giQAYCD3cZuScqG8Wtj19tG5n/iHhBAkKcLYCh3fdSd04HXCq5xHG2oAdOAdNIG3qAJ5tW1A/9hrm8ZsV+7vDLTe2nsmP9AWwATuXe27330lLwvLkloHY5EBR0dexkB0xxKp9Ieno8MbOjYP1ZRMHz77YE8kAMk35V/fkpWSc6L3dL7Tl6uPAaAm155EAYhwjFHVOsY4AEwPXXkG7W+0EqmCodlRW17oCkrO5Pjc55lon7i2mBqenc7ETTmLFWdvaenLpijJDUBcywsAYFRwu/jja1dMWNfWKf2WEOJ43T8ihLgHACAJkpgZvNQ3kTnJG/u6Z8O7ZgNwAACbzCb5dxNVLPnQW3aKyY7EKABM2XZPcwUk5wG8qIfvSL5qtJAfHLnvF+Z2GsPr2fefipPH0luq5aXsOi3frJ+5xhSm+k/1VErOxRWlqgkrfujO/t191ZqxLeB5azbJeSFELnz9v/agVX8GAIjG5r9I9yjkAAAAAElFTkSuQmCC";else if(n===7)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsSAAALEgHS3X78AAAAGXRFWHRTb2Z0d2FyZQBQYWludC5ORVQgVjMuNS41Tib51gAAAXlJREFUOE9jYACCqRH5a6eGZu6cHl00d2pUwa6J7r4Xe4w1U0ByWMB/DLHJnoHbQIKzI1PEp3r6vKjVU72HQzNIGNOA6W5uYiCZmUHxM+v0Vf836KuHkWQASPGciGznSe6+/+v01Vbh0YzdBeBwiC560GWi+aLVXEccxJ/i6KhNdBjMCM/u7be3+99hpJEK0jTJ01a0y1hjKVEGTHH31e4w1vxSrqP0tVZPbXazodqKSl2VV9W6KnOJMoCAf4mLRpAq/+pTEh4F+79aJSwGxwjJseBZdHCVa/b2/1YR00vJMsAtd+c957T1D42De17iMKARKO4NTUiuQLoLrs694IAT0PbvNrFzNYwDOv9bRc4IwGKIMVQzKCWCsBNcDVDzaafUdbfMwiZNMwnq/mIeNvkgDldsgWo+hqyZ2TVr+0egIRIgQcuomb7G/h3/zaOmaeFxBcJ2l6xtx8xDJ/6wDJ+cYhU2g8vYv/M9yABj//aLOFxRTUbU49YCALt6h216b0oVAAAAAElFTkSuQmCC";else if(n===8)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAAKBJREFUOE+l0cENwjAMBdCM0BEYhZG6AjdvwQhMUvXQI0KcKo6IY2/9v0qQnVilFoenJF+2q6RJRP7ihhFuGOGGO851Zg4/9PCGi8oOD+iAzQM8c7bRRTX9pStMmbnGd1Nhwz2vbOD+ATcwteagjPBSZuAVTmBqzUHhnTnkA2wkPmJT2wRKGbLk1avZHUAcwldv/n/hhhFuGOGGEW54nKQVV2qyDejeW7YAAAAASUVORK5CYII=";else if(n===9)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAAHpJREFUOE+lz8ENgDAMA8COxEiMkxWYgkmYhCGgllpkUz8aeJyQrVQJJSJ+sWWGLTNsmWHLaq22amkZX2T0MiuB7ASPOMusBIKNh9Evekh4weaTDOfDUDTYdBnTF/AjbOYssxJIf9Q39ouG35DwhS0zbJlhywxbzotyAztMtZGgPPrJAAAAAElFTkSuQmCC";return""},it}(n.BaseDialog);n._GcFilterDialog=ut})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(n){function i(t,i,r,u){return new n.Range(t,i,r,u)}function s(t){return new n._DateTimeHelper(t)}function e(t){return typeof t=="string"?!1:n.FormatConverter.IsNumber(t)}function h(t){return n._DateTimeHelper.fromOADate(t)}function c(i,r,u,f,e,o){return function(i,u,f,e){if(!n.util.hasCalc())return t;var o=n.Calc.Functions.findGlobalFunction(r),s=o.evaluate([u,f,e]);return s[0][0]}(u,f,e,o)}var p,w,a,o,f,v;n.feature("fill",["core.common","core.globalize","core.stringResource"]);var t=null,r=undefined,y=Math.abs,l=Math.min,u=Math.floor;(function(n){n[n.Direction=0]="Direction";n[n.Linear=1]="Linear";n[n.Growth=2]="Growth";n[n.Date=3]="Date";n[n.Auto=4]="Auto"})(n.FillType||(n.FillType={}));p=n.FillType,function(n){n[n.Day=0]="Day";n[n.Weekday=1]="Weekday";n[n.Month=2]="Month";n[n.Year=3]="Year"}(n.FillDateUnit||(n.FillDateUnit={}));w=n.FillDateUnit;a=function(){function n(n){this._sheet=n}return n}();o=function(){function i(n){this._indexes=[];this._innerValues=[];this._type=t;this._startIndex=n===r||n===t?-1:n}return i.prototype.dataCount=function(){return this._innerValues.length},i.prototype.values=function(){var n=this,i,t,r,u;if(n._innerValues.length>0){for(i=[],t=0;t<n._innerValues.length;t++)r=n._innerValues[t],u=n._type==="object"?n.toDateTime(r):r,i.push(u);return i}return[]},i.prototype.indexes2=function(){var r=this,u=r._indexes.length,f,e,i;if(u>0&&n.util.hasCalc()){for(f=r._startIndex,f===-1&&(f=r._indexes[0]),e=new Array(1),e[0]=new Array(u),i=0;i<u;i++)e[0][i]=r._indexes[i]-f+1;return new n.Calc._ConcreteArray(e,u)}return t},i.prototype.values2=function(){var i=this._innerValues.length,r;return i>0&&n.util.hasCalc()?(r=[this._innerValues],new n.Calc._ConcreteArray(r,i)):t},i.prototype.insert=function(i,u,f){if(!e(f))throw new Error(n.SR.Exp_NumberOnly);var o=this;(o._type===r||o._type===t)&&(o._type=f instanceof Date?"date":"number");new n._ArrayHelper(o._indexes).insert(i,u);new n._ArrayHelper(o._innerValues).insert(i,o.toDouble(f))},i.prototype.add=function(n,i){var u=this;(u._type===r||u._type===t)&&(u._type=i instanceof Date?"date":"number");u._indexes.push(n);u._innerValues.push(u.toDouble(i))},i.prototype.toActualValue=function(n){return this._type==="date"?this.toDateTime(n):n},i.prototype.toDouble=function(t){return n.FormatConverter.ToDouble(t)},i.prototype.toDateTime=function(i){var r=t;if(i instanceof Date)r=i;else if(n.util.hasCalc())try{r=n.Calc.Convert.toDateTime(i)}catch(u){r=i}return r},i}();f=function(){function n(){}return n.TREND=function(n,t,i,r){return c(this,"Trend",n,t,i,r)},n.GROWTH=function(n,t,i,r){return c(this,"Growth",n,t,i,r)},n.FORECAST=function(n,t,i,r){return c(this,"Forecast",n,t,i,r)},n}();v=function(){function c(n){this._worksheet=n;this._fillCache=new a(n)}return c.prototype.fillLinear=function(n,i,u,f){(u===r||u===t)&&(f===r||f===t)?this.seriesTrendFillRange(n,i,1):this.seriesFillRange(n,i,1,u,f,t)},c.prototype.fillGrowth=function(n,i,u,f){(u===r||u===t)&&(f===r||f===t)?this.seriesTrendFillRange(n,i,2):this.seriesFillRange(n,i,2,u,f,t)},c.prototype.fillDate=function(n,t,i,r,u){this.seriesFillRange(n,t,3,r,u,i)},c.prototype.seriesTrendFillRange=function(t,i,r,u){var s=this,v=s.fixRange(t),l=v.row,a=v.col,y=v.rowCount,p=v.colCount,f,e,o,h,c;if(s.hasSpans(l,a,y,p))throw new Error(n.SR.Exp_RangeContainsMergedCell);if(i===1){for(h=l;h<l+y;h++)if(f=s.getSeriesSource(h,a,1,p,i),f&&f.dataCount()>0&&(e=s.calcSeriesTrendData(f,p,r),e&&e.length>0))for(o=0;o<e.length;o++)if(u)return f.toActualValue(e[o]);else s.copyCell(s._worksheet,h,f._indexes[0],h,a+o,f.toActualValue(e[o]),r)}else if(i===0)for(c=a;c<a+p;c++)if(f=s.getSeriesSource(l,c,y,1,i),f&&f.dataCount()>0&&(e=s.calcSeriesTrendData(f,y,r),e&&e.length>0))for(o=0;o<e.length;o++)if(u)return f.toActualValue(e[o]);else s.copyCell(s._worksheet,f._indexes[0],c,l+o,c,f.toActualValue(e[o]),r)},c.prototype.getSeriesSource=function(n,i,r,u,f){var s=t,h,c,l;if(f===1)for(c=i+u-1;c>=i;)h=this._worksheet.getValue(n,c),e(h)&&(s||(s=new o(i)),s.insert(0,c,h)),c--;else if(f===0)for(l=n+r-1;l>=n;)h=this._worksheet.getValue(l,i),e(h)&&(s||(s=new o(n)),s.insert(0,l,h)),l--;return s},c.prototype.calcSeriesTrendData=function(i,r,u){var o,e;if(i&&i.dataCount()>0&&n.util.hasCalc()&&(u===1||u===2)){for(o=[],i.dataCount()===1&&(u===1?i.add(i._indexes[0]+1,i.toActualValue(i._innerValues[0]+1)):u===2&&i.add(i._indexes[0]+1,i.values()[0])),e=0;e<r;e++)u===1?o.push(f.TREND(this._worksheet,i.values2(),i.indexes2(),e+1)):u===2&&o.push(f.GROWTH(this._worksheet,i.values2(),i.indexes2(),e+1));return o}return t},c.prototype.fillAuto=function(t,i,r){var f=this,a=f._worksheet,e=f.fixRange(t),s=e.row,h=e.col,c=e.rowCount,l=e.colCount,u=f.fixRange(a._eventHandler._dragFillStartRange),o;if(u){if(f.hasPartSpans(u.row,u.col,u.rowCount,u.colCount)||f.hasPartSpans(s,h,c,l))throw new Error(n.SR.Exp_ChangeMergedCell);return o=!0,(s<u.row||h<u.col)&&(o=!1),f.autoFillRange(u,c,l,i,r,o)}},c.prototype.fixRange=function(n){var t=n.row,r=n.col,u=n.rowCount,f=n.colCount;return t===-1&&(t=0,u=this._worksheet.getRowCount()),r===-1&&(r=0,f=this._worksheet.getColumnCount()),i(t,r,u,f)},c.prototype.autoFillRange=function(n,r,f,e,o,s){var v=this,h,c,l,a,y=s?1:-1;if(e===1){if(h=u(f/n.colCount),c=f%n.colCount,h>1&&!o)for(a=1;a<h;a++)l=i(n.row,n.col+a*y*n.colCount,n.rowCount,n.colCount),v.copyRange(n,l,e,4,o);if(o&&h>1&&c===0&&(h=h-1,c=n.colCount),h>0&&c>0)return l=s?i(n.row,n.col+h*n.colCount,n.rowCount,c):i(n.row,n.col-h*n.colCount+n.colCount-c,n.rowCount,c),v.copyRange(n,l,e,4,o,s,t,s?0:n.colCount-c)}else if(e===0){if(h=u(r/n.rowCount),c=r%n.rowCount,h>1&&!o)for(a=1;a<h;a++)l=i(n.row+a*y*n.rowCount,n.col,n.rowCount,n.colCount),v.copyRange(n,l,e,4,o,t,t,t,!0);if(o&&h>1&&c===0&&(h=h-1,c=n.rowCount),h>0&&c>0)return l=s?i(n.row+h*n.rowCount,n.col,c,n.colCount):i(n.row-h*n.rowCount+n.rowCount-c,n.col,c,n.colCount),v.copyRange(n,l,e,4,o,s,s?0:n.rowCount-c,t,!0)}},c.prototype.copyRange=function(n,i,r,u,f,s,h,c,l){var it=this,k=it._worksheet,d,g,p,w,y,b,a,ft,rt,ut,v=t,tt=t,nt;if(r===1)for(d=0;d<n.rowCount;d++){for(v=t,tt=t,w=n.row+d,y=i.row+d,c=c?c:0,g=0;g<n.colCount;){if(p=n.col+g,b=i.col+g-c,a=t,ft=k.getFormula(w,p),ft&&ft!==""||(a=k.getValue(w,p)),u===4&&e(a)&&(v||(v=new o),rt=t,rt=a instanceof Date?"date":"number",tt||(tt=rt),tt===rt)){v.add(p,a);g++;continue}if(a&&v&&v.dataCount()>0){if(nt=it.autoFillRowTrendValues(n,i,w,y,v,f,s,c),f&&nt!==t)return nt;v=t;tt=t;continue}if(ut=k._spanModel.find(w,p),ut){if(ut.row===w)if(f){if(b===i.col+i.colCount-1)return a}else b<i.col+i.colCount&&b>=i.col&&it.copyCell(k,w,p,y,b,a,u);g+=ut.colCount}else{if(f){if(s&&b===i.col+i.colCount-1)return a;else if(!s&&b===i.col)return a}else b<i.col+i.colCount&&b>=i.col&&it.copyCell(k,w,p,y,b,a,u);g++}}if(v&&v.dataCount()>0&&(nt=it.autoFillRowTrendValues(n,i,w,y,v,f,s,c),f&&nt!==t))return nt}else if(r===0)for(g=0;g<n.colCount;g++){for(v=t,tt=t,p=n.col+g,b=i.col+g,h=h?h:0,d=0;d<n.rowCount;){if(w=n.row+d,y=i.row+d-h,a=t,ft=k.getFormula(w,p),ft&&ft!==""||(a=k.getValue(w,p)),u===4&&e(a)&&(v||(v=new o),rt=t,rt=a instanceof Date?"date":"number",tt||(tt=rt),tt===rt)){v.add(w,a);d++;continue}if(a&&v&&v.dataCount()>0){if(nt=it.autoFillColumnTrendValues(n,i,p,b,v,f,s,h,l),f&&nt!==t)return nt;v=t;tt=t;continue}if(ut=k._spanModel.find(w,p),ut){if(ut.col===p)if(f){if(y===i.row+i.rowCount-1)return a}else y<i.row+i.rowCount&&y>=i.row&&(l&&k.isRowFilterOut(y)||it.copyCell(k,w,p,y,b,a,u));d+=ut.rowCount}else{if(f){if(s&&y===i.row+i.rowCount-1)return a;else if(!s&&y===i.row)return a}else y<i.row+i.rowCount&&y>=i.row&&(l&&k.isRowFilterOut(y)||it.copyCell(k,w,p,y,b,a,u));d++}}if(v&&v.dataCount()>0&&(nt=it.autoFillColumnTrendValues(n,i,p,b,v,f,s,h,l),f&&nt!==t))return nt}return t},c.prototype.autoFillRowTrendValues=function(i,r,u,e,o,s,h,c){var b=this,k=b._worksheet,v,l,y,p,a,w,nt,d,tt,g;if(o&&o.dataCount()>0&&n.util.hasCalc())if(w=(r.col-i.col)/i.colCount,b.isArithmeticProgression(o._indexes,o._innerValues)){for(nt=o.values2(),d=new Array(1),v=o.dataCount(),d[0]=new Array(v),l=0;l<v;l++)d[0][l]=l+1;for(tt=new n.Calc._ConcreteArray(d,v),l=0;l<v;l++)if(y=f.TREND(k,nt,tt,v*w+l+1),p=o._indexes[l],a=p+w*i.colCount,s){if(h&&a===r.col+r.colCount-1)return o.toActualValue(y);else if(!h&&a===r.col)return o.toActualValue(y)}else a<r.col+r.colCount&&a>=r.col&&b.copyCell(k,u,p,e,a,o.toActualValue(y),4)}else for(g=o._indexes[0],v=o._indexes[o.dataCount()-1]-g+1,o.dataCount()===1&&o.add(o._indexes[0]+1,o.toActualValue(o._innerValues[0]+1)),l=0;l<v;l++)if(y=f.TREND(k,o.values2(),o.indexes2(),v*w+l+1),p=g+l,a=p+w*i.colCount,s){if(a===r.col+r.colCount-1)return o.toActualValue(y)}else a<r.col+r.colCount&&a>=r.col&&b.copyCell(k,u,p,e,a,o.toActualValue(y),4);return t},c.prototype.copyCell=function(i,r,u,f,e,o,s){var a,c,l,h;(i.hasFormula(r,u)||i.hasFormula(f,e))&&(i.setFormula(f,e,t),(s===0||s===4)&&(a=i.getFormula(r,u),a&&i._copyFormula(r,u,f,e,1,1)));i.setValue(f,e,o);c=i.getCompositeStyle(r,u);c?(l=new n.Style,l.copyFrom(c),i.setStyle(f,e,l,3)):i.setStyle(f,e,t,3);i._spanModel.isEmpty()||(i.removeSpan(f,e,3),h=i._spanModel.find(r,u),h&&i._addSpanImp(f,e,h.rowCount,h.colCount,3))},c.prototype.autoFillColumnTrendValues=function(i,r,u,e,o,s,h,c,l){var d=this,p=d._worksheet,y,a,w,b,v,k,tt,g,it,nt;if(o&&o.dataCount()>0&&n.util.hasCalc())if(k=(r.row-i.row-c)/i.rowCount,d.isArithmeticProgression(o._indexes,o._innerValues)){for(tt=o.values2(),g=new Array(1),y=o.dataCount(),g[0]=new Array(y),a=0;a<y;a++)g[0][a]=a+1;for(it=new n.Calc._ConcreteArray(g,y),a=0;a<y;a++)if(w=f.TREND(p,tt,it,y*k+a+1),b=o._indexes[a],v=b+k*i.rowCount,s){if(h&&v===r.row+r.rowCount-1||!h&&v===r.row)return o.toActualValue(w)}else v<r.row+r.rowCount&&v>=r.row&&(l&&p.isRowFilterOut(v)||d.copyCell(p,b,u,v,e,o.toActualValue(w),4))}else for(nt=o._indexes[0],y=o._indexes[o.dataCount()-1]-nt+1,o.dataCount()===1&&o.add(o._indexes[0]+1,o.toActualValue(o._innerValues[0]+1)),a=0;a<y;a++)if(w=f.TREND(p,o.values2(),o.indexes2(),y*k+a+1),b=nt+a,v=b+k*i.rowCount,s){if(v+c===r.row+r.rowCount-1)return o.toActualValue(w)}else v<r.row+r.rowCount&&v>=r.row&&(l&&p.isRowFilterOut(v)||d.copyCell(p,nt,u,v,e,o.toActualValue(w),4));return t},c.prototype.isArithmeticProgression=function(n,t){var r,u,f,i;if(n.length!==t.length)return!1;if(r=t.length,r<=1)return!1;else if(r===2)return!0;else{for(u=n[1]-n[0],f=t[1]-t[0],i=2;i<r;i++)if(n[i]-n[i-1]!==u||t[i]-t[i-1]!==f)return!1;return!0}},c.prototype.fillAutobyDirection=function(n,t){var i=this.fixRange(n),r=i.row,u=i.col,f=i.rowCount,e=i.colCount,o=this.getDirectionFillSourceRange(r,u,f,e,t);o&&this.directionFillRange(o,r,u,f,e,t)},c.prototype.directionFillRange=function(t,r,f,e,o,s){var l=this,y=n.SR.Exp_TargetContainsMergedCells,p=n.SR.Exp_MergedCellsIdentical,c,a,v,h;if(s===0){if(l.hasSpans(r,f,e,o-t.colCount))throw new Error(y);if(c=u(o/t.colCount),a=o%t.colCount,a!==0)throw new Error(p);if(c>1)for(h=1;h<c;h++)v=i(t.row,t.col-h*t.colCount,t.rowCount,t.colCount),l.copyRange(t,v,1,0)}else if(s===1){if(l.hasSpans(r,f+t.colCount,e,o-t.colCount))throw new Error(y);if(c=u(o/t.colCount),a=o%t.colCount,a!==0)throw new Error(p);if(c>1)for(h=1;h<c;h++)v=i(t.row,t.col+h*t.colCount,t.rowCount,t.colCount),l.copyRange(t,v,1,0)}else if(s===2){if(l.hasSpans(r,f,e-t.rowCount,o))throw new Error(y);if(c=u(e/t.rowCount),a=e%t.rowCount,a!==0)throw new Error(p);if(c>1)for(h=1;h<c;h++)v=i(t.row-h*t.rowCount,t.col,t.rowCount,t.colCount),l.copyRange(t,v,0,0)}else if(s===3){if(l.hasSpans(r+t.rowCount,f,e-t.rowCount,o))throw new Error(y);if(c=u(e/t.rowCount),a=e%t.rowCount,a!==0)throw new Error(p);if(c>1)for(h=1;h<c;h++)v=i(t.row+h*t.rowCount,t.col,t.rowCount,t.colCount),l.copyRange(t,v,0,0)}},c.prototype.getDirectionFillSourceRange=function(n,r,u,f,e){var o=t;return e===0?o=i(n,r+f-1,u,1):e===1?o=i(n,r,u,1):e===2?o=i(n+u-1,r,1,f):e===3&&(o=i(n,r,1,f)),this.inflateCellRange(o)},c.prototype.inflateCellRange=function(n){var t=this._worksheet.getSpans();return t&&n&&(n=this._worksheet._cellRangeInflate(t,n)),n},c.prototype.hasPartSpans=function(n,t,i,r){for(var f=this._worksheet._spanModel.getEnumerator(n,t,i,r),u;f.moveNext();)if((u=f.current(),u.row<n||u.row+u.rowCount>n+i)||u.col<t||u.col+u.colCount>t+r)return!0;return!1},c.prototype.hasSpans=function(n,t,i,r){var u=this._worksheet._spanModel.getEnumerator(n,t,i,r);return u.moveNext()},c.prototype.seriesFillRange=function(t,i,r,u,f,e){var s=this,p=s.fixRange(t),v=p.row,y=p.col,w=p.rowCount,b=p.colCount,o,h,c,l,a;if(s.hasSpans(v,y,w,b))throw new Error(n.SR.Exp_RangeContainsMergedCell);if(i===1){for(l=v;l<v+w;l++)if(o=s.getSeriesSource(l,y,1,1,i),o&&o.dataCount()>0&&(h=s.calcSeriesData(o,b,r,u,f,e),h&&h.length>0))for(c=0;c<h.length;c++)s.copyCell(s._worksheet,l,o._indexes[0],l,y+c,o.toActualValue(h[c]),r)}else if(i===0)for(a=y;a<y+b;a++)if(o=s.getSeriesSource(v,a,1,1,i),o&&o.dataCount()>0&&(h=s.calcSeriesData(o,w,r,u,f,e),h&&h.length>0))for(c=0;c<h.length;c++)s.copyCell(s._worksheet,o._indexes[0],a,v+c,a,o.toActualValue(h[c]),r)},c.prototype.calcSeriesData=function(n,i,u,f,e,o){var h;if(n&&n.dataCount()>0){var c=[],l=n._innerValues[0],s=l;for(h=0;h<i;h++)(e===r||e===t||s<=e)&&(c.push(s),u===1?s+=f:u===2?s*=f:u===3&&o!==r&&o!==t&&(s=this.getNextDateValue(o,l,s,f,h+1)));return c}return t},c.prototype.getNextDateValue=function(n,t,i,r,f){var o=i,e,c;if(n===0)e=h(i),o=s(e.setDate(e.getDate()+r)).toOADate();else if(n===1){for(e=h(i),c=y(r);c>0;)r>0?e.setDate(e.getDate()+l(1,c)):e.setDate(e.getDate()-l(1,c)),e.getDay()!==6&&e.getDay()!==0&&(c-=1);o=s(e).toOADate()}else n===2?(e=h(t),o=s(e.setMonth(e.getMonth()+u(f*r))).toOADate()):n===3&&(e=h(t),o=s(e.setFullYear(e.getFullYear()+u(f*r))).toOADate());return o},c}();n.FillImp=v})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){(function(n){var r,t,i;n.feature("fill_ui",["core.common","core.sheet_action","core.stringResource"]),function(n){n[n.Tag=0]="Tag";n[n.Down=1]="Down"}(n._FillSmartTag||(n._FillSmartTag={}));r=n._FillSmartTag;t=function(t){function r(n,i){t.call(this);var r=this;r._useWijmoTheme=!1;r.eventNameSpace=".ui-fill";r.fillKeyDown="keydown"+r.eventNameSpace;r.sheet=n;r.fillInfo=i;r._initTagDialog()}return __extends(r,t),r.prototype._initTagDialog=function(){var n=this;n.tagContainer=n.getContainer().addClass("container-default-header tag-container no-user-select");n.smartTag=$("<img>").attr("src",r.getImageSrc(0)).css("float","left").appendTo(n.tagContainer);n.smartTagDown=$("<img>").attr("src",r.getImageSrc(1)).css({float:"left",display:"none"}).appendTo(n.tagContainer)},r.prototype.useWijmoTheme=function(n){var i=this;if(typeof n=="undefined")return i._useWijmoTheme;if(typeof n=="boolean"&&i._useWijmoTheme!==n){t.prototype.useWijmoTheme.call(this,n);var r=i.tagContainer,u="ui-widget-header",f="container-default-header";return r.removeClass(n?f:u),r.addClass(n?u:f),i}return null},r.prototype._registerEvent=function(){var t=this,r=n.util.device(),i=$.browser.safari&&(r.ipad||r.iphone);t.tagContainer.hover(function(){var u=t._useWijmoTheme?"ui-state-hover":"container-default-hover",n=t.sheet._isTouchMode,f=n?"38px":"32px",e=n?"24px":"18px",r;t.menuDialog&&(r=t.menuDialog.isOpen(),r)||($(this).addClass(u),$(this).css({width:f,height:e}),i||t.smartTagDown.show())},function(){var u=t._useWijmoTheme?"ui-state-hover":"container-default-hover",n=t.sheet._isTouchMode,f=n?"24px":"18px",e=n?"24px":"18px",r;t.menuDialog&&(r=t.menuDialog.isOpen(),r)||($(this).removeClass(u),$(this).css({width:f,height:e}),i||t.smartTagDown.hide())});t.tagContainer.toggle(function(){var n=t._useWijmoTheme?"ui-state-active":"container-default-active";i&&t.smartTagDown.show();$(this).addClass(n);t._openMenu();t._initData()},function(){var n=t._useWijmoTheme?"ui-state-active":"container-default-active";i&&t.smartTagDown.hide();$(this).removeClass(n);t._closeMenu()});$(document).bind(t.fillKeyDown,function(i){i.keyCode===27&&(t.menuDialog&&t.menuDialog.isOpen()?t._closeMenu():t.close(),n.util.cancelDefault(i))})},r.prototype.open=function(){var n=this,i=n.sheet,t,o;if(n.tagContainer){var r=$(i._getCanvas()).offset(),u=n.fillInfo.x,f=n.fillInfo.y;u+=r.left;f+=r.top;n.tagContainer.css({left:u,top:f});n.show();n._registerEvent();var e=i._isTouchMode,s=e?"3px":"0px",h=e?"24px":"18px";n.smartTag.css("margin",s);n.smartTagDown.css("height",h);n._reset();t=i.parent;o=t&&typeof t.useWijmoTheme!="undefined"?t.useWijmoTheme:!1;n.useWijmoTheme(o)}},r.prototype._initData=function(){var t=this.fillInfo.fillType,n;this.menuContainer&&(n=this.menuContainer.find(":radio")[t],n&&n.checked===!1&&(n.checked=!0,$(n).change()))},r.prototype._openMenu=function(){var n=this;n.menuDialog||(n.menuDialog=new i(n.sheet),n.menuContainer=n.menuDialog.getContainer(),n.menuDialog.useWijmoTheme(n._useWijmoTheme));var t=$(n.tagContainer).offset(),r=t.left,u=t.top+n.tagContainer.height()+2;n.menuContainer.css({left:r,top:u});n.menuDialog.show("normal");n.menuDialog._attachEvent();$(n.menuDialog).unbind("fillTypeChanged");$(n.menuDialog).bind("fillTypeChanged",function(t,i){n.fillInfo.fillType=i})},r.prototype._closeMenu=function(){this.menuDialog&&this.menuDialog.close()},r.prototype._reset=function(){var n=this,t;n.menuDialog&&(t=n.menuDialog.isOpen(),t&&n.tagContainer.click(),n.tagContainer.mouseleave())},r.prototype.close=function(){var n=this;n._reset();$(document).unbind(n.fillKeyDown);t.prototype.close.call(this);n.sheet&&n.sheet.setFocus()},r.getImageSrc=function(n){if(n===0)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFJJREFUeNrclEEKACAIBOfp/Xy7i4WSRnRYBIVRVhFJVIhyEAxllQa5E/wBSnsU6Rza2nugqNmASi57C/KKNg/Iqn+iVWzx6M4bOdUEAAD//wMAAYRMfiNaiqEAAAAASUVORK5CYII=";else if(n===1)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAASCAYAAACXScT7AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAGCSURBVHjafNFPKKRxHAbw5/v7GYdBYUQjLm5SkoNykCQHtcx431/KgdKumJvSrAO7Nwc3RQ5kd3OkHJC/hUJREluonVcToqRh3sRFPA6M1Mbhc3z6Pj1fkMRHQNJL0uPeul731lU37o1y49cqHr8GvvgWQRLBsmpM/P0j4XAXiooKcXl1CZDEzl4EJBEwAZBUwWAQsVgsFSRR11gmM8trimSa3WypzZ31l5v2/vfk/4oAcv9aSGyUSz4gg/AIAOET0YQswIQWaNrnH+2OeSaY0BJN2+wDTi/OpCrwkxX1vW8q63p5cnaaB+Z/09u7x0nFJTVMiEajPsNCQaC6Ryb8THKcw/Tikho6zj//0RGUNV6gMZ1H8fmpH5iTHDlwsiOhO7FrN5RdP6aBIUj/pvJ2bkFbkxAzBzELELNCQQqgrJ5ST1/jqmYOJcHa7dYYGV5TrQ3d+vfUU+b7IfrOIRCGBYD0o1VGmaHaB6DZkqvMD2hUfF1UAISkvE/+yqbCZ89+HgBtwgFOrBUzJgAAAABJRU5ErkJggg==";return""},r}(n.BaseDialog);n._GcFillDialog=t;i=function(t){function i(n){t.call(this);this.sheet=n;this.init()}return __extends(i,t),i.prototype.init=function(){var n=this;n.itemClass="fill-type-item";n.menuClass="wijspread-fill-menu-container";n._useWijmoTheme=!1;n.smartTagContainer=$(".tag-container");n._initMenuDialog()},i.prototype.show=function(n){arguments.length!==0&&t.prototype.show.call(this,n)},i.prototype._initMenuDialog=function(){var t=this;t.menuContainer=t.getContainer();t.menuContainer.addClass(t.menuClass);t.copyCells=t._createMenuItem("smartMenuCopyCells",t.itemClass,n.SR.CopyCells,"0",!0).appendTo(t.menuContainer);t.fillSeries=t._createMenuItem("smartMenuFillSeries",t.itemClass,n.SR.FillSeries,"1").appendTo(t.menuContainer);t.fillFormattingOnly=t._createMenuItem("smartMenuFillFormattingOnly",t.itemClass,n.SR.FillFormattingOnly,"2").appendTo(t.menuContainer);t.fillWithoutFormatting=t._createMenuItem("smartMenuFillWithoutFormatting",t.itemClass,n.SR.FillWithoutFormatting,"3").appendTo(t.menuContainer)},i.prototype._createMenuItem=function(n,t,i,r,u){var e=this.sheet._isTouchMode,h=e?"160px":"150px",c=e?"25px":"20px",f=$("<div>").css({width:h,height:c}).addClass("container-default-state "+t),o=$("<div>").addClass("menu-item-input").appendTo(f),l=$("<div>").addClass("menu-item-text").appendTo(f),s=$("<input>").attr({id:n,value:r,type:"radio",name:"fill-group",style:"display:none"}).appendTo(o),a=$("<span>").text(i).appendTo(l);return u?(o.addClass("check-image"),s.prop("checked","checked")):s.prop("checked",""),f},i.prototype.useWijmoTheme=function(n){var i=this;if(typeof n=="undefined")return i._useWijmoTheme;if(typeof n=="boolean"&&i._useWijmoTheme!==n){t.prototype.useWijmoTheme.call(this,n);var r=i.menuContainer.find("div."+i.itemClass),u=r.find("input:checked").parent(),f="ui-state-default",e="container-default-state",o="ui-icon ui-icon-check",s="check-image";return r.removeClass(n?e:f),r.addClass(n?f:e),u.removeClass(n?s:o),u.addClass(n?o:s),i}return null},i.prototype._attachEvent=function(){var n=this,t=$("."+n.itemClass),i;t.hover(function(){var t=n._useWijmoTheme?"ui-state-hover":"container-default-hover";$(this).addClass(t)},function(){var t=n._useWijmoTheme?"ui-state-hover":"container-default-hover";$(this).removeClass(t)});t.click(function(){var u=n._useWijmoTheme?"ui-state-hover":"container-default-hover",t=$(this).find(":radio"),i=t[0],r;i.checked=!0;t.change();n.smartTagContainer.click();n.smartTagContainer.mouseleave();$(this).removeClass(u);r=parseInt(i.value,10);n._changeFill(r)});i=n.menuContainer.find(":radio");$(i).change(function(){var t=n._useWijmoTheme?"ui-icon ui-icon-check":"check-image";$(".menu-item-input").removeClass(t);$(this).parent().addClass(t)})},i.prototype._changeFill=function(t){var i=this.sheet,r=i._eventHandler;i._skipCloseDragFillSmartTag=!0;i.suspendEvent();try{n.SpreadActions.undo.call(i)}finally{i.resumeEvent()}i._skipCloseDragFillSmartTag=!1;r.executeDragFillAction(r._currentFillRange,t);$(this).trigger("fillTypeChanged",t)},i.prototype.isOpen=function(){return $("."+this.menuClass).length>0?!0:!1},i}(n.BaseDialog)})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(t){var s,f,e,o,h,c,l;t.feature("search",["core.common","core.sheet_ui","core.stringResource"]);var i=null,r=Math.max,u=Math.min;(function(n){n[n.All=0]="All";n[n.HasValue=1]="HasValue";n[n.HasStyle=2]="HasStyle"})(t.EnumeratorOption||(t.EnumeratorOption={}));s=t.EnumeratorOption;f=function(){function f(t,i){if(this.actualEndRow=-1,this.isActualEndRowSet=!1,this.isBlockRange=!1,this.options=1,!t)throw new Error(n.spread.SR.Exp_SheetIsNull);var r=this;r.worksheet=t;r.sheetArea=i.sheetArea;r.searchOrder=i.searchOrder;r.rowStart=i.rowStart;r.columnStart=i.columnStart;r.rowEnd=i.rowEnd;r.columnEnd=i.columnEnd;r.findBeginRow=i.findBeginRow;r.findBeginColumn=i.findBeginColumn;r.init();r.block=r.worksheet}return f.prototype.init=function(){this.currentRow=-1;this.currentColumn=-1},f.prototype.moveNext=function(){var n=this;if(n.currentRow===-1&&n.currentColumn===-1&&n.rowStart<=n.rowEnd&&n.columnStart<=n.columnEnd&&(n.currentRow=n.findBeginRow,n.currentColumn=n.findBeginColumn,n.isIndexAcceptable(n.currentRow,n.currentColumn)&&!n.skipCurrent()))return!0;if(n.rowStart<=n.rowEnd&&n.columnStart<=n.columnEnd)while(n.tryMoveNext())if(!n.skipCurrent())return!0;return n.currentRow=-1,n.currentColumn=-1,!1},f.prototype.isIndexAcceptable=function(n,t){var r=this;return(r.options&1)>0&&r.block&&(r.block.getValue(n,t,r.sheetArea)!==i||r.block.getFormula(n,t,r.sheetArea)!==i)?!0:r.options===0},f.prototype.skipCurrent=function(){return!1},f.prototype.tryMoveNext=function(){var n=this,t=n.currentRow,i=n.currentColumn,f=!1,r,u;return(n.options&1)>0&&(r={value:t},u={value:i},n.nextValue(r,u)&&(t=r.value,i=u.value,f=!0)),n.options===1&&(f?(n.currentRow=t,n.currentColumn=i):(n.currentRow=-1,n.currentColumn=-1)),!(n.currentRow===-1&&n.currentColumn===-1)},f.prototype.nextValue=function(n,t){while(this.next(n,t))if(this.isIndexAcceptable(n.value,t.value))return!0;return!1},f.prototype.nextZOrder=function(n,t,i){var r=this,e,u,f;if(n){if(e=r.getNextNonEmptyColumnInRow(n,t.value,i.value+1),e!==-1&&(i.value=e,r.isZOrderOver(t.value,i.value)))return!0;do if(u=n.nextNonNullRow(t.value),u===-1||u>r.rowEnd?t.value=-1:(u!==-1&&(t.value=u),u!==-1&&u<t.value&&(t.value=u)),t.value!==-1){i.value=t.value===r.rowStart||r.isBlockRange?r.columnStart-1:-1;do if(f=r.getNextNonEmptyColumnInRow(n,t.value,i.value+1),f===-1||f>r.columnEnd?i.value=-1:(f!==-1&&(i.value=f),f!==-1&&f<i.value&&(i.value=f)),i.value!==-1)return r.isZOrderOver(t.value,i.value);while(i.value!==-1)}while(t.value!==-1)}return!1},f.prototype.getNextNonEmptyColumnInRow=function(n,t,r){for(var u=r;u<=this.columnEnd;u++)if(n.getValue(t,u)!==i)return u;return-1},f.prototype.isZOrderOver=function(n,t){var i=this;if(i.isBlockRange)return n>=i.rowStart&&n<=i.getActualEndRow()&&t>=i.columnStart&&t<=i.actualEndColumn();else if(n>i.getActualEndRow()||n===i.getActualEndRow()&&(t<0||t>i.actualEndColumn())||n<i.rowStart||n===i.rowStart&&t<i.columnStart)return!1;return!0},f.prototype.getActualEndRow=function(){var n=this,t,i,f;return n.isActualEndRowSet?n.actualEndRow:(t=-1,i=!1,(n.options&1)>0&&n.block&&(f=n.block.getRowCount(n.sheetArea)-1,t=r(t,f),i=!0),t=i?u(t,n.rowEnd):n.rowEnd,n.actualEndRow=t,n.isActualEndRowSet=!0,n.actualEndRow)},f.prototype.actualEndColumn=function(){return this.columnEnd},f.prototype.next=function(n,t){var i=this,r,u;if(i.searchOrder===0)return r=i.getActualEndColumnZOrder(n.value),t.value+1<=r?(t.value+=1,i.isZOrderOver(n.value,t.value)):n.value+1<=i.getActualEndRow()?(n.value+=1,t.value=i.isBlockRange?i.columnStart:0,i.isZOrderOver(n.value,t.value)):!1;else if(i.searchOrder===1)return u=i.getActualEndRowNOrder(t.value),n.value+1<=u?(n.value+=1,i.isNOrderOver(n.value,t.value)):t.value+1<=i.actualEndColumn()?(t.value+=1,n.value=i.isBlockRange?i.rowStart:0,i.isNOrderOver(n.value,t.value)):!1;return!1},f.prototype.getActualEndColumnZOrder=function(n){var t=this,i,f;return n>=t.rowStart&&n<=t.rowEnd?(i=-1,f=!1,(t.options&1)>0&&t.block&&(i=r(i,t.block.getColumnCount(t.sheetArea)-1),f=!0),n===t.rowEnd||t.isBlockRange?f?u(i,t.columnEnd):t.columnEnd:f?r(i,t.worksheet.getColumnCount(t.sheetArea)-1):t.worksheet.getColumnCount(t.sheetArea)-1):-1},f.prototype.getActualEndRowNOrder=function(n){var t=this,i,f;return n>=t.columnStart&&n<=t.columnEnd?(i=-1,f=!1,(t.options&1)>0&&t.block&&(i=r(i,t.rowEnd),f=!0),n===t.columnEnd||t.isBlockRange?f?u(i,t.rowEnd):t.rowEnd:f?r(i,t.worksheet.getRowCount(t.sheetArea)-1):t.worksheet.getRowCount(t.sheetArea)-1):-1},f.prototype.isNOrderOver=function(n,t){var i=this;if(i.isBlockRange)return n>=i.rowStart&&n<=i.getActualEndRow()&&t>=i.columnStart&&t<=i.actualEndColumn();else if(t>i.actualEndColumn()||t===i.actualEndColumn()&&(n<0||n>i.getActualEndRow())||t<i.columnStart||t===i.columnStart&&n<i.rowStart)return!1;return!0},f.prototype.current=function(){var n=this;return 0<=n.currentRow&&n.currentRow<n.worksheet.getRowCount(n.sheetArea)&&0<=n.currentColumn&&n.currentColumn<n.worksheet.getColumnCount(n.sheetArea)?new t.Cell(n.worksheet,n.currentRow,n.currentColumn,n.sheetArea):i},f}();t.CellsEnumerator=f;e=function(){function n(){var n=this;n.startSheetIndex=-1;n.endSheetIndex=-1;n.searchString=i;n.searchFlags=0;n.searchOrder=0;n.searchTarget=1;n.sheetArea=3;n.rowStart=-1;n.columnStart=-1;n.rowEnd=-1;n.columnEnd=-1;n.findBeginRow=-1;n.findBeginColumn=-1}return n}();t.SearchCondition=e;o=function(){function n(){var n=this;n.searchFoundFlag=0;n.foundSheetIndex=-1;n.foundRowIndex=-1;n.foundColumnIndex=-1;n.foundString=i}return n}();t.SearchResult=o,function(n){n[n.None=0]="None";n[n.IgnoreCase=1]="IgnoreCase";n[n.ExactMatch=2]="ExactMatch";n[n.UseWildCards=4]="UseWildCards";n[n.BlockRange=8]="BlockRange"}(t.SearchFlags||(t.SearchFlags={}));h=t.SearchFlags,function(n){n[n.ZOrder=0]="ZOrder";n[n.NOrder=1]="NOrder"}(t.SearchOrder||(t.SearchOrder={}));c=t.SearchOrder,function(n){n[n.None=0]="None";n[n.CellText=1]="CellText";n[n.CellFormula=8]="CellFormula"}(t.SearchFoundFlags||(t.SearchFoundFlags={}));l=t.SearchFoundFlags})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(n){var f,r,e;n.feature("binding",["core.common"]);var t=null,i="undefined",u=function(){function n(n){this._source=n;this.__cellBindingSource__=!0}return n.prototype.setValue=function(n,t){this._source&&n&&r.setValueByPath(this._source,n,t)},n.prototype.getValue=function(n){return this._source&&n?r.getValueByPath(this._source,n):t},n.prototype.getSource=function(){return this._source},n}();n.CellBindingSource=u;f=function(){function n(n){this._init();this._sheet=n}return n.prototype.bind=function(n){var t=this,i=t._dataSource;i&&$.isFunction(i.dispose)&&i.dispose();t._unSubscribeHandlers(t._dataSourceSubscriptions);t._unSubscribeHandlers(t._dataItemSubscriptions);t._init();t._dataSource=n;n&&(t._dataSourceType=t._getDataSourceType(n),t.getDataItemType(),t._sheet&&(n.subscribe&&t._dataSourceSubscriptions.push(n.subscribe(t._dataChangedhandler,t)),n.currentPosition&&n.currentPosition.subscribe&&t._dataSourceSubscriptions.push(n.currentPosition.subscribe(t._currentPositionChangedhandler,t)),t.doDataItemChanged()),t._fields=t._getFieldsInfo())},n.prototype.doDataItemChanged=function(){var n=this,r,f,e;if(n._sheet&&n._dataSource){var o=n._sheet,u=n._dataSource,s=n._dataSourceType;if(u&&$.type(window.ko)!==i&&(n._unSubscribeHandlers(n._dataItemSubscriptions),r=t,s===3?(u.currentPosition&&(f=o.getActiveRowIndex(),-1<=f&&f<u.count()&&u.currentPosition(f)),r=u.currentItem()):s===4||(r=u[o.getActiveColumnIndex()]),r))for(e in r)r[e]&&$.isFunction(r[e].subscribe)&&n._dataItemSubscriptions.push(r[e].subscribe(n._activeDataItemChangedhandler,t,t))}},n.prototype._activeDataItemChangedhandler=function(){this._sheet&&this._sheet.repaint()},n.prototype._unSubscribeHandlers=function(n){var i,t;if(n)for(i in n)t=n[i],t&&$.isFunction(t.dispose)&&t.dispose()},n.prototype.getRowCount=function(){return this._getDataLength()},n.prototype.getColumnCount=function(){var t,i,n;return this._fields?this._fields.length:(t=this._dataSource,t&&(i=t[0],n=$.type(i),n==="null"||n==="string"||n==="number"))?1:0},n.prototype.getSource=function(){return this._dataSource},n.prototype.getFields=function(){return this._fields},n.prototype.getDataItem=function(n){if(!this._dataSource)return t;var r=this._dataSource,i=this._dataSourceType;if(i===1)return r[n];else if(i===4)return t;else if(i===2)return r()[n];else if(i===3)return r.item(n);return t},n.prototype.getDataItemType=function(){var i,t,n;if(!this._dataItemType)for(i=this.getRowCount(),t=0;t<i;t++)if(n=this.getDataItem(t),n){n.entityAspect&&n.entityType&&(this._dataItemType=n.entityType);this._dataItemType=n.constructor;break}return this._dataItemType},n.prototype.getValue=function(n,u){var o=this,p,v,f;if(!o._dataSource)return t;var h=o._sheet,a="function",y="string",c=o._dataSource,l=o._dataSourceType,e,s;if(l!==4){if(n<0||o.getRowCount()<=n||(p=h?h.getColumnCount():o.getColumnCount(),u<0||p<=u))return t;h&&h._colInfos?(e=h._colInfos[u],e&&(s=e.name)):o._fields&&(s=o._fields[u])}if(l===1){if(f=c[n],typeof f===i||f===t)return t;if(e&&typeof e.value===a)return e.value(f);else if(s)return r.getValueByPath(f,s);else if(($.type(f)===y||$.isNumeric(f))&&u===0)return f}else if(l===2){if(f=c()[n],typeof f===i||f===t)return t;if(e&&typeof e.value===a)return e.value(f);else if(s)return r.getValueByPath(f,s);else if(($.type(f)===y||$.isNumeric(f))&&u===0)return f}else if(l===4){if(v=h?h.getBindingPath(n,u):t,v)return c.getValue(v)}else if(l===3){if(f=c.item(n),typeof f===i||f===t)return t;if(e&&typeof e.value===a)return e.value(f);else if(s)return c.getProperty(f,s)}return t},n.prototype.setValue=function(n,u,f){var h=this,b,s,p,e;if(!h._dataSource)return!1;var l=h._sheet,y="function",w="string",a=h._dataSource,v=h._dataSourceType,o,c;if(v!==4){if(n<0||h.getRowCount()<=n||(b=l?l.getColumnCount():h.getColumnCount(),u<0||b<=u))return!1;l&&l._colInfos?(o=l._colInfos[u],o&&(c=o.name)):h._fields&&(c=h._fields[u])}return s=!1,v===1?(e=a[n],e!==t&&typeof e!==i&&(o&&typeof o.value===y?(o.value(e,f),s=!0):c?(r.setValueByPath(e,c,f),s=!0):($.type(e)===w||$.isNumeric(e))&&u===0&&(a[n]=f,s=!0))):v===2?(e=a()[n],e!==t&&typeof e!==i&&(o&&typeof o.value===y?(o.value(e,f),s=!0):c?(r.setValueByPath(e,c,f),s=!0):($.type(e)===w||$.isNumeric(e))&&u===0&&(a()[n]=f,s=!0))):v===4?(p=l?l.getBindingPath(n,u):t,p&&(a.setValue(p,f),s=!0)):v===3&&(e=a.item(n),e!==t&&typeof e!==i&&(o&&typeof o.value===y?(o.value(e,f),s=!0):c&&(a.setProperty(e,c,f),s=!0))),s},n.prototype.addItems=function(n,i){var r=this,f,o;if(r._dataSource&&!(n>r.getRowCount())){var e=r._dataSource,s=r._dataSourceType,u=r.getDataItemType();if(s===3){if(!r._dataViewUpdating){if(r._updatingDataView=!0,u){for(f=0;f<i;f++)o=u.createEntity?u.createEntity():new u,e.add(o);e.commitEdit()}r._updatingDataView=!1}}else if(s!==4)for(f=0;f<i;f++)u?(o=u.createEntity?u.createEntity():new u,e.splice(n,0,o)):e.splice(n,0,t)}},n.prototype.removeItems=function(n,t){var i=this,r=i.getRowCount(),f;if(i._dataSource&&!(n>=r)){var u=i._dataSource,e=i._dataSourceType,o=Math.min(t,r-n);if(e===3){if(!i._dataViewUpdating){for(i._updatingDataView=!0,f=0;f<o;f++)u.remove(u.item(n));i._updatingDataView=!1}}else e===4||n<r&&u.splice(n,o)}},n.isDataViewSource=function(n){var t=window.wijmo;return t&&t.data&&t.data.isDataView(n)},n.isCellBindingSource=function(n){return u&&n instanceof u||n&&n.hasOwnProperty("__cellBindingSource__")},n.prototype._init=function(){var n=this;n._dataSource=t;n._dataSourceType=0;n._dataItemType=t;n._fields=t;n._dataSourceSubscriptions=[];n._dataItemSubscriptions=[]},n.prototype._getDataSourceType=function(t){if(t){var i=window.ko;if(n.isDataViewSource(t))return 3;else if(i&&i.isObservable(t))return 2;else if(n.isCellBindingSource(t))return 4;else if(t&&!isNaN(t.length))return 1}return 0},n.prototype._getDataLength=function(){var t=this._dataSource,i=this._dataSourceType,n;return t?(n=0,i===1?n=t.length:i===2?n=t().length:i===4||i===3&&(n=t.count()),n):0},n.prototype._getFieldsInfo=function(){var o=this,u=o._dataSource,s=o._dataSourceType,e=0,f=0,r=t,n,i;if(s===1){if(e=u.length,e>0&&(n=o._getProperties(u[0]),n&&n.length>0))for(f=n.length,r=[],i=0;i<f;i++)r.push(n[i])}else if(s===2){if(e=u().length,e>0&&(n=o._getProperties(u()[0]),n&&n.length>0))for(f=n.length,r=[],i=0;i<f;i++)r.push(n[i])}else if(s!==4&&s===3&&(e=u.count(),n=u.getProperties(),n&&n.length>0))for(f=n.length,r=[],i=0;i<f;i++)r.push(n[i].name);return r},n.prototype._getProperties=function(n){var u=window.ko,r=[];for(var t in n)$.isFunction(n[t])?typeof u!==i&&u.isObservable(n[t])&&r.push(t):r.push(t);return r},n.prototype._dataChangedhandler=function(n){var i=this,r;i._updatingDataView||i._sheet&&(r=i._sheet,r._bindToAutoRefresh(function(n){var u,f;if(n){if(i._dataViewUpdating=!0,!isNaN(n.length)&&(r.setRowCount(n.length),(i._fields===t||i._fields===undefined)&&$.isEmptyObject(r._colInfos)&&(i._fields=i._getFieldsInfo(),r.setColumnCount(i.getColumnCount()),r._colInfos={},u=i.getFields(),u)))for(f in u)r._colInfos[f]={name:u[f]};i._dataViewUpdating=!1}})(n))},n.prototype._currentPositionChangedhandler=function(n){var i=this,t,r;i._dataSource&&i._sheet&&(t=i._sheet,r=i._dataSource,t._bindToAutoRefresh(function(n){if(r.currentPosition){var i=r.currentPosition();t._activeRowIndex!==i&&t.setActiveCell(i,t._activeColIndex)}})(n))},n.prototype.toJSON=function(){var n=this._dataSource,i;return n?(i=this._dataSourceType,i===2?n=n():i===4?n=n.getSource():i===3&&(n=n.local),{type:i,source:n}):t},n.prototype.fromJSON=function(n){var t=n&&n.source,r,i;t&&(r=n.type,r===2?(i=window.ko,i&&i.observableArray&&this.bind(i.observableArray(t))):r===4?this.bind(new u(t)):this.bind(t))},n}();n._BindingManager=f;r=function(){function n(){}return n.setValueByPath=function(n,t,r){var f,u;if(n&&t){var e=window.ko,o="function",s=t.split("."),h=s.length;for(f=0;f<h;f++){if(u=s[f],!n)break;f===h-1?typeof n[u]===o?(typeof e===i||!e.isObservable(n[u])||e.isWriteableObservable(n[u]))&&n[u](r):n[u]=r:n=typeof n[u]===o?n[u]():n[u]}}},n.getValueByPath=function(n,r){var u;if(!n||!r)return t;var f=r.split("."),o=f.length,e=0;do if(u=f[e],n=typeof n[u]=="function"?n[u]():n[u],n===t||typeof n===i)return t;while(++e<o);return n},n}();n._BindingHelper=r,function(n){n[n.None=0]="None";n[n.Normal=1]="Normal";n[n.Knockout=2]="Knockout";n[n.DataView=3]="DataView";n[n.CellBinding=4]="CellBinding"}(n._DataSourceType||(n._DataSourceType={}));e=n._DataSourceType})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(n){var e,i,f,l,a;n.feature("table",["core.common","core.stringResource"]);var t=null,u=undefined,o=Math.min,s=Math.floor,v="function",r="undefined",h="Column",c=function(){function i(n,t,i,r,u,f){var o=this,s,h;for(o._init(),o._name=n,o._row=t,o._col=i,o._rowCount=r,o._colCount=u,o._style=f,o._columns=[],s=0;s<o._colCount;s++)h=new e(s+1),o._columns.push(h)}return i.prototype.range=function(){var t=this;return new n.Range(t._row,t._col,t._rowCount,t._colCount)},i.prototype.dataRange=function(){var t=this,r=t._showHeader?t._row+1:t._row,i=t._showHeader?t._rowCount-1:t._rowCount;return t._showFooter&&i--,new n.Range(r,t._col,i,t._colCount)},i.prototype.name=function(n){return arguments.length===0?this._name:(this._name=n,this)},i.prototype.headerIndex=function(){return this._showHeader?this._row:-1},i.prototype.footerIndex=function(){return this._showFooter?this._row+this._rowCount-1:-1},i.prototype.showHeader=function(n){var t=this,r,u,i;return arguments.length===0?t._showHeader:t._showHeader===n?t:(r=t._showHeader=n,r?(t._row>0&&(t._row=t._row-1,t._rowCount=t._rowCount+1),t._syncHeader()):(u=t._row,t._row=t._row+1,t._rowCount=t._rowCount-1,t._clearSheetRow(u),i=t._rowFilter,i&&(i.unfilter(),i.reset())),t)},i.prototype.showFooter=function(n){var t=this,r,i,u;return arguments.length===0?t._showFooter:t._showFooter===n?t:(r=t._showFooter=n,r?(i=t._getSheet(),(!i||t._row+t._rowCount<i.getRowCount())&&(t._rowCount=t._rowCount+1),t._syncFooter()):(u=t._row+t._rowCount-1,t._rowCount=t._rowCount-1,t._clearSheetRow(u)),t)},i.prototype.bandRows=function(n){return arguments.length===0?this._bandRows:(this._bandRows=n,this)},i.prototype.bandColumns=function(n){return arguments.length===0?this._bandColumns:(this._bandColumns=n,this)},i.prototype.highlightFirstColumn=function(n){return arguments.length===0?this._highlightFirstColumn:(this._highlightFirstColumn=n,this)},i.prototype.highlightLastColumn=function(n){return arguments.length===0?this._highlightLastColumn:(this._highlightLastColumn=n,this)},i.prototype.style=function(n){return arguments.length===0?this._style:(this._style=n,this)},i.prototype.rowFilter=function(){var t=this;return!t._rowFilter&&n.features.filter&&(t._rowFilter=new n._TableFilter(t),t._rowFilter._updateRange(t.dataRange())),t._rowFilter},i.prototype.refresh=function(){this._bindingManager&&this._loadData()},i.prototype.getColumnName=function(i){var u=this._columns,f,r;return u&&0<=i&&i<u.length&&(f=u[i],f)?(r=f.name(),r!==t&&(r=n.util.toString(r)),r):t},i.prototype.setColumnName=function(n,t){var i=this,u,r,f;return i._hasColumnName(t)?i:(u=i._columns,u&&0<=n&&n<u.length&&(r=u[n],r||(r=i._columns[n]=new e,r.id(i._newAutoId())),r.name(t),i._showHeader&&(f=i._getSheet(),f&&f.setText(i.headerIndex(),i._col+n,t))),i)},i.prototype.getColumnFormula=function(n){var r=this._columns,u,i;return r&&0<=n&&n<r.length&&(u=r[n],u)?(i=u.formula(),i?i.toUpperCase():i):t},i.prototype.setColumnFormula=function(n,t){var i=this,r=i._columns,u,f;return r&&0<=n&&n<r.length&&(t&&t[0]==="="&&(t=t.substring(1)),u=r[n],u&&u.formula(t),i._showFooter&&(f=i._getSheet(),f&&f.setFormula(i.footerIndex(),i._col+n,t))),i},i.prototype.setColumnDataFormula=function(n,t){var i=this._columns,r;return i&&0<=n&&n<i.length&&(t&&t[0]==="="&&(t=t.substring(1)),r=i[n],r&&this._setColumnDataAreaFormulaCore(r,t)),this},i.prototype.getColumnValue=function(n){var i=this,u=i._columns,r,f;return u&&0<=n&&n<u.length&&(r=u[n],r)?i._showFooter&&r.formula()&&(f=i._getSheet(),f)?f.getValue(i.footerIndex(),i._col+n):r.value():t},i.prototype.setColumnValue=function(n,t){var i=this,r=i._columns,u,f;return r&&0<=n&&n<r.length&&(u=r[n],u&&u.value(t),i._showFooter&&(f=i._getSheet(),f&&f.setValue(i.footerIndex(),i._col+n,t))),i},i.prototype._setColumnDataAreaFormulaCore=function(n,t,i){var r,u,s,f;if(typeof i=="undefined"&&(i=!1),i||n.dataAreaFormula()!==t){r=this;n.dataAreaFormula(t);u=r._owner.getSheet();s=!1;u.suspendCalcService();var h=r._getColumnIndex(n)+r._col,e=r._row,o=r._rowCount;for(r.showHeader()&&(e++,o--),r.showFooter()&&o--,f=e;f<e+o;f++)u.setFormula(f,h,t);u.resumeCalcService()}},i.prototype._getColumnIndex=function(n){for(var t=0;t<this._columns.length;t++)if(this._columns[t]===n)return t;return-1},i.prototype._setOwner=function(n){this._owner=n},i.prototype._getSheet=function(){return this._owner?this._owner.getSheet():t},i.prototype._init=function(){var n=this;n._name=t;n._row=-1;n._col=-1;n._rowCount=-1;n._colCount=-1;n._style=t;n._showHeader=!0;n._showFooter=!1;n._highlightFirstColumn=!1;n._highlightLastColumn=!1;n._bandRows=!0;n._bandColumns=!1;n._bindingManager=t;n._columns=t;n._rowFilter=t;n._owner=t},i.prototype._bind=function(n){var t=this,f,i,r,h,u,c;if(t._bindingManager&&(f=t._getSheet(),f&&(i=t.dataRange(),f.clear(i.row,i.col,i.rowCount,i.colCount,3,17)),r=t.range(),t._clear(r.row,r.col,r.rowCount,r.colCount)),t._bindingManager=n,n){var o=t._bindingManager,s=o.getRowCount(),l=o.getColumnCount();for(t._showHeader&&s++,t._showFooter&&s++,t._rowCount=s,t._colCount=l,t._columns=[],h=o.getFields(),u=0;u<t._colCount;u++)c=new e(u+1),t._columns.push(c),h&&c.name(h[u]);t._loadData()}},i.prototype._loadData=function(){var i=this,u,n,t;if(i._bindingManager&&(u=i._getSheet(),u)){var f=i._bindingManager,r=i.dataRange(),e=r.row,o=r.col,s=r.rowCount,h=r.colCount;for(n=0;n<s;n++)for(t=0;t<h;t++)u.setValue(e+n,o+t,f.getValue(n,t))}},i.prototype._compose=function(t,i,r){var u=this,f=u._style,l,ft,et,ot,st,ht,ct,b,lt,k,at,vt,h,d,y,g,nt,p,c,tt,it,yt;if(f&&(l=u._getSheet(),!l||!(l.getRowHeight(t)<=0))){var pt=u.headerIndex(),wt=u.footerIndex(),bt=u._showHeader?t===u._row+1:t===u._row,w=u._showFooter?t===u._row+u._rowCount-2:t===u._row+u._rowCount-1,s=i===u._col,e=i===u._col+u._colCount-1,rt=u._showHeader?t===pt:t===u._row,ut=u._showFooter?t===wt:t===u._row+u._rowCount-1,a=f.highlightLastColumnStyle(),v=f.highlightFirstColumnStyle();if(pt===t)ft=f.lastHeaderCellStyle(),e&&u._highlightLastColumn&&ft&&ft._compose(r,!0,!0,!0,!0),et=f.firstHeaderCellStyle(),s&&u._highlightFirstColumn&&et&&et._compose(r,!0,!0,!0,!0),ot=f.headerRowStyle(),ot&&ot._compose(r,!0,s,!0,e),e&&u._highlightLastColumn&&a&&a._compose(r,!0,!0,!1,!0),s&&u._highlightFirstColumn&&v&&v._compose(r,!0,!0,!1,!0);else if(wt===t)st=f.lastFooterCellStyle(),e&&u._highlightLastColumn&&st&&st._compose(r,!0,!0,!0,!0),ht=f.firstFooterCellStyle(),s&&u._highlightFirstColumn&&ht&&ht._compose(r,!0,!0,!0,!0),ct=f.footerRowStyle(),ct&&ct._compose(r,!0,s,!0,e),e&&u._highlightLastColumn&&a&&a._compose(r,!1,!0,!0,!0),s&&u._highlightFirstColumn&&v&&v._compose(r,!1,!0,!0,!0);else{if(e&&u._highlightLastColumn&&a&&a._compose(r,rt,!0,ut,!0),s&&u._highlightFirstColumn&&v&&v._compose(r,rt,!0,ut,!0),b=u._showHeader?t-u._row-1:t-u._row,lt=i-u._col,n._CatchMgr._catched&&n._CatchMgr._visibleRowIndexCatch){for(k=n._CatchMgr._visibleRowIndexCatch,h=u.dataRange().row;k[h]===-1;)h++;if(h>t)return;b=k[t]-k[h]}else if(l){for(at=0,vt=0,h=u.dataRange().row;h<t;h++)l.getRowHeight(h)>0&&at++;for(d=u._col;d<i;d++)l.getColumnWidth(d)>0&&vt++;b=at;lt=vt}if(u.bandRows()&&(y=f.firstRowStripSize(),c=y+f.secondRowStripSize(),c>0)){var o=b%c,kt=f.firstRowStripStyle(),dt=f.secondRowStripStyle();o<y&&kt?(g=o===0,nt=w||o===y-1,kt._compose(r,g,s,nt,e)):o>=y&&dt&&(g=o===y,nt=w||o===c-1,dt._compose(r,g,s,nt,e))}if(u.bandColumns()&&(p=f.firstColumnStripSize(),c=p+f.secondColumnStripSize(),c>0)){var o=lt%c,gt=f.firstColumnStripStyle(),ni=f.secondColumnStripStyle();o<p&>?(tt=o===0,it=e||o===p-1,gt._compose(r,bt,tt,w,it)):o>=p&&ni&&(tt=o===p,it=e||o===c-1,ni._compose(r,bt,tt,w,it))}}yt=f.wholeTableStyle();yt&&yt._compose(r,rt,s,ut,e)}},i.prototype._moveTo=function(t,i){var r=this,u;if(t!==r._row||i!==r._col){if(u=r._getSheet(),u){if(t<0||u.getRowCount()<t+r._rowCount)throw new Error(n.SR.Exp_TableMoveOutOfRange);if(i<0||u.getColumnCount()<i+r._colCount)throw new Error(n.SR.Exp_TableMoveOutOfRange);u.moveTo(r._row,r._col,t,i,r._rowCount,r._colCount,1)}r._row=t;r._col=i;r._updateFilter()}},i.prototype._resize=function(t,i){var r=this,f,v,o,h,u,s,c,l,y,a,p;if(t!==r._rowCount||i!==r._colCount){if(f=0,v=1,r._showHeader&&(f=f+1),r._showFooter&&(f=f+1),t<f||i<v)throw new Error(n.SR.Exp_TableResizeOutOfRange);if(o=r._getSheet(),o&&(r._row+t>o.getRowCount()||r._col+i>o.getColumnCount()))throw new Error(n.SR.Exp_TableResizeOutOfRange);if(h=r._columns,u=r._colCount,r._colCount=i,i>u){for(s=i-u,c=0;c<s;c++)l=new e,h.push(l),l.id(r._newAutoId());r._showHeader&&r._syncHeader(u,s);r._showFooter&&r._syncFooter(u,s)}else i<u&&(y=u-i,h.splice(i,y));t!==r._rowCount&&(a=r._showFooter,a&&(r._syncFooter(),p=r.footerIndex()),r._rowCount=t,a&&(r._syncSheetByFooter(),r._clearSheetRow(p)));r._updateFilter()}},i.prototype._updateFilter=function(){var t=this,n=t._rowFilter;n&&(n._updateRange(t.dataRange()),n.reFilter())},i.prototype._hasColumnName=function(i){var r,u;for(i!==t&&(i=n.util.toString(i)),r=0;r<this._colCount;r++)if(u=this.getColumnName(r),i===u)return!0;return!1},i.prototype._setHeader=function(n,t,i){var r=this,u,f,e;r._showHeader&&r.headerIndex()===n&&r._columns&&(u=t-r._col,f=r._columns,0<=u&&u<f.length&&(e=f[u],e&&e.name(i)))},i.prototype._setFooterFormula=function(n,t,i){var r=this,u,f,e;r._showFooter&&r.footerIndex()===n&&r._columns&&(u=t-r._col,f=r._columns,0<=u&&u<f.length&&(e=f[u],e&&e.formula(i)))},i.prototype._setFooterValue=function(n,t,i){var r=this,u,f,e;r._showFooter&&r.footerIndex()===n&&r._columns&&(u=t-r._col,f=r._columns,0<=u&&u<f.length&&(e=f[u],e&&e.value(i)))},i.prototype._getColumn=function(n){var i=this.range();return i.col<=n&&n<i.col+i.colCount?this._columns[n-i.col]:t},i.prototype._newAutoId=function(){var n;if(!this._columns||this._columns.length===0)return-1;var u=this._columns,i=[],r,t=u.length;for(n=0;n<t;n++)r=u[n],r&&r.isAutoId()&&i.push(r.id());if(i.sort(function(n,t){return n-t}),t=i.length,t>0){for(n=0;n<t;n++)if(i[n]!==n+1)return n+1;return t+1}return 1},i.prototype._syncHeader=function(n,i){var f=this,e,c,r;if(f._showHeader&&f._columns&&(e=f._getSheet())){var s=f.headerIndex(),h=f._col,l=f._columns,o;for((n===u||n===t)&&(n=0),(i===u||i===t)&&(i=l.length),r=n;r<i;r++)o=l[r],o&&(c=e.getText(s,h+r),e.setFormula(s,h+r,t),c?o.name(c):e.setText(s,h+r,o.name()))}},i.prototype._syncFooter=function(n,i){var f=this,o,l,c,r;if(f._showFooter&&f._columns&&(o=f._getSheet())){var s=f.footerIndex(),h=f._col,a=f._columns,e;for((n===u||n===t)&&(n=0),(i===u||i===t)&&(i=a.length),r=n;r<i;r++)e=a[r],e&&(l=o.getFormula(s,h+r),l?e.formula(l):o.setFormula(s,h+r,e.formula()),c=o.getValue(s,h+r),c!==u&&c!==t?e.value(c):o.setValue(s,h+r,e.value()))}},i.prototype._clearHeader=function(n,i){var r,e,s,f;if(this._showHeader&&this._columns)for(r=this._columns,(n===u||n===t)&&(n=0),(i===u||i===t)&&(i=r.length),s=o(r.length,n+i),f=n;f<s;f++)e=r[f],e&&e.name(t)},i.prototype._clearFooter=function(n,i){var r,f,s,e;if(this._showFooter&&this._columns)for(r=this._columns,(n===u||n===t)&&(n=0),(i===u||i===t)&&(i=r.length),s=o(r.length,n+i),e=n;e<s;e++)f=r[e],f&&(f.formula(t),f.value(t))},i.prototype._syncSheetByFooter=function(){var n=this,i,t;if(n._showFooter&&n._columns&&(i=n._getSheet(),i)){var f=n._columns,o=f.length,r,s=n._col,u,e=n.footerIndex();for(t=0;t<o;t++)r=f[t],r&&(u=s+t,i.setValue(e,u,r.value()),i.setFormula(e,u,r.formula()))}},i.prototype._clearSheetRow=function(n){var i=this._getSheet(),f,e,u,r;if(i&&!(n<0)&&!(i.getRowCount()<=n))for(f=this._col,e=this._colCount,r=0;r<e;r++)u=f+r,i.setFormula(n,u,t),i.setValue(n,u,t)},i.prototype._addRows=function(n,t){var i=this,u,r,s,e,h,f;if(!(n>=i._row+i._rowCount)){var o=i._columns,c=i._row,l=i._row+i._rowCount-1;if(n<=c)i._row+=t;else if(n<=l){for(i._rowCount+=t,u=i._owner.getSheet(),u.suspendCalcService(),r=0;r<o.length;r++)if(s=o[r],e=s.dataAreaFormula(),e)for(h=r+i._col,f=n;f<n+t;f++)u.setFormula(f,h,e);u.resumeCalcService()}i._rowFilter&&i._rowFilter._addRows(n,t)}},i.prototype._addColumns=function(n,t){var i=this,u,r,f;if(!(n>=i._col+i._colCount)){if(n<=i._col)i._col+=t;else if(n<i._col+i._colCount&&(i._colCount+=t,u=i._columns,u))for(r=0;r<t;r++)f=new e,u.splice(n+r-i._col,0,f),f.id(i._newAutoId());i._rowFilter&&i._rowFilter._addColumns(n,t)}},i.prototype._removeRows=function(n,t){var i=this,u,r;n>=i._row+i._rowCount||(u=i._row,r=i._row+i._rowCount-1,n<u?n+t>u||(i._row-=t):n===u?i._showHeader||(i._rowCount-=o(r-n+1,t)):n<=r&&(i._rowCount-=o(r-n+1,t),n===r&&i._showFooter&&(i._showFooter=!1)),i._rowFilter&&i._rowFilter._removeRows(n,t))},i.prototype._removeColumns=function(n,t){var i=this,r,f,u;n>=i._col+i._colCount||(r=i._col,f=i._col+i._colCount-1,n<r?n+t<=r?i._col-=t:(i._col=n,i._colCount-=n+t-r,u=i._columns,u&&u.splice(0,n+t-r)):(i._colCount-=o(f-n+1,t),u=i._columns,u&&u.splice(n-r,o(f-n+1,t))),i._rowFilter&&i._rowFilter._removeColumns(n,t))},i.prototype._clear=function(t,i,r,u){var f=this,s=r,h=u,l=f._getSheet(),p,c,w,e;l&&(s=l.getRowCount(),h=l.getColumnCount());var o=t<0?0:t,b=i<0?0:i,a=t<0?s:r,k=i<0?h:u,y=new n.Range(o,b,a,k),v=f.headerIndex();f._showHeader&&o<=v&&v<o+a&&(p=new n.Range(v,f._col,1,f._colCount),e=y.getIntersect(p,s,h),e&&f._clearHeader(e.col-f._col,e.colCount));c=f.footerIndex();f._showFooter&&o<=c&&c<o+a&&(w=new n.Range(c,f._col,1,f._colCount),e=y.getIntersect(w,s,h),e&&f._clearFooter(e.col-f._col,e.colCount));f._rowFilter&&f._rowFilter._clear(t,i,r,u)},i.prototype._copy=function(n,t,i,r,u,f){},i.prototype._move=function(n,t,i,r,u,f){},i.prototype._isDefaultValue=function(n,i){switch(n){case"name":return i===t;case"row":return i===-1;case"col":return i===-1;case"rowCount":return i===-1;case"colCount":return i===-1;case"showHeader":return i===!0;case"showFooter":return i===!1;case"highlightFirstColumn":return i===!1;case"highlightLastColumn":return i===!1;case"bandRows":return i===!0;case"bandColumns":return i===!1;case"style":return i===t;case"dataBinding":return i===t;case"columns":return i===t;case"rowFilter":return i===t;default:return!1}},i.prototype.toJSON=function(){var n=this,e={name:n._name,row:n._row,col:n._col,rowCount:n._rowCount,colCount:n._colCount,showHeader:n._showHeader,showFooter:n._showFooter,highlightFirstColumn:n._highlightFirstColumn,highlightLastColumn:n._highlightLastColumn,bandRows:n._bandRows,bandColumns:n._bandColumns,style:n._style?n._style.toJSON():t,dataBinding:n._bindingManager?n._bindingManager.toJSON():t,columns:n._columns,rowFilter:n._rowFilter?n._rowFilter.toJSON():t},r={},i,f;for(i in e)f=e[i],n._isDefaultValue(i,f)||(r[i]=f);return $.isEmptyObject(r)?u:r},i.prototype.fromJSON=function(t){var i,c,o,y,h;if(t){if(i=this,typeof t.name!==r&&(i._name=t.name),typeof t.row!==r&&(i._row=t.row),typeof t.col!==r&&(i._col=t.col),typeof t.rowCount!==r&&(i._rowCount=t.rowCount),typeof t.colCount!==r&&(i._colCount=t.colCount),typeof t.showHeader!==r&&(i._showHeader=t.showHeader),typeof t.showFooter!==r&&(i._showFooter=t.showFooter),typeof t.highlightFirstColumn!==r&&(i._highlightFirstColumn=t.highlightFirstColumn),typeof t.highlightLastColumn!==r&&(i._highlightLastColumn=t.highlightLastColumn),typeof t.bandRows!==r&&(i._bandRows=t.bandRows),typeof t.bandColumns!==r&&(i._bandColumns=t.bandColumns),t.style&&(c=new f,c.fromJSON(t.style),i._style=c),t.dataSource&&n.features.binding&&(i._bindingManager=new n._BindingManager,i._bindingManager.bind(t.dataSource)),t.dataBinding&&n.features.binding&&(i._bindingManager=new n._BindingManager,i._bindingManager.fromJSON(t.dataBinding)),t.columns){var a=t.columns,v=a.length,l=[],s,u;for(o=0;o<v;o++){u=a[o];s=new e;var p=u.id?u.id:u._id,w=u.name?u.name:u._name,b=u.fvalue?u.fvalue:u._fvalue,k=u.fformular?u.fformula:u._fformula,d=u.dataAreaFormula?u.dataAreaFormula:u._dataAreaFormula;s.id(p).name(w).value(b).formula(k).dataAreaFormula(d);l.push(s)}for(i._columns=l,o=0;o<v;o++)s=l[o],s.isAutoId()||s.id(i._newAutoId())}t.rowFilter&&n.features.filter&&(y=t.rowFilter,h=new n._TableFilter,h.table(i),h.fromJSON(y),i._rowFilter=h)}},i.prototype.startRow=function(){return this._row},i.prototype.startColumn=function(){return this._col},i.prototype.endRow=function(){return this._row+this._rowCount-1},i.prototype.endColumn=function(){return this._col+this._colCount-1},i.prototype.hasHeadersRow=function(){return this._showHeader},i.prototype.hasTotalsRow=function(){return this._showFooter},i.prototype.tableName=function(){return this._name},i.prototype.getColumnIndexInTable=function(n){for(var i,t=0;t<this._columns.length;t++)if(i=this._columns[t],i.name()===n||i.name().toString().toLowerCase()===n.toLowerCase())return t;return-1},i.prototype.source=function(){return this._owner.getSheet()._getSheetSource()},i}();n.SheetTable=c;e=function(){function n(n){var i=this;i._id=n;i._name=t;i._fformula=t;i._fvalue=t}return n.prototype.id=function(n){var t=this;return arguments.length===0?t._id:(t._id=n,t._name||(t._name=h+t._id),t)},n.prototype.isAutoId=function(){return this._id>0?!0:!1},n.prototype.name=function(n){var t=this;return arguments.length===0?t._name?t._name:h+t._id:(t._name=n,t)},n.prototype.value=function(n){return arguments.length===0?this._fvalue:(this._fvalue=n,this)},n.prototype.dataAreaFormula=function(n){return arguments.length===0?this._dataAreaFormula:(this._dataAreaFormula=n,this)},n.prototype.formula=function(n){return arguments.length===0?this._fformula:(this._fformula=n,this)},n.prototype._isDefaultValue=function(n,i){switch(n){case"name":return i===t;case"fformula":return i===t;case"fvalue":return i===t;default:return!1}},n.prototype.toJSON=function(){var n=this,f={id:n._id,name:n._name,fformula:n._fformula,dataAreaFormula:n._dataAreaFormula,fvalue:n._fvalue},i={},t,r;for(t in f)r=f[t],n._isDefaultValue(t,r)||(i[t]=r);return $.isEmptyObject(i)?u:i},n}();n._TableColumn=e;i=function(){function t(n,t,i,r,u,f,e,o,s){var h=this;h.backColor=n;h.foreColor=t;h.font=i;h.borderLeft=r;h.borderTop=u;h.borderRight=f;h.borderBottom=e;h.borderHorizontal=o;h.borderVertical=s}return t.prototype._compose=function(n,t,i,u,f){var e=this;typeof e.backColor!==r&&typeof n.backColor===r&&(n.backColor=e.backColor);typeof e.foreColor!==r&&typeof n.foreColor===r&&(n.foreColor=e.foreColor);typeof e.font!==r&&typeof n.font===r&&(n.font=e.font);i&&typeof e.borderLeft!==r&&typeof n.borderLeft===r&&(n.borderLeft=e.borderLeft);t&&typeof e.borderTop!==r&&typeof n.borderTop===r&&(n.borderTop=e.borderTop);f&&typeof e.borderRight!==r&&typeof n.borderRight===r&&(n.borderRight=e.borderRight);u&&typeof e.borderBottom!==r&&typeof n.borderBottom===r&&(n.borderBottom=e.borderBottom);u||typeof e.borderHorizontal===r||typeof n.borderBottom!==r||(n.borderBottom=e.borderHorizontal);f||typeof e.borderVertical===r||typeof n.borderRight!==r||(n.borderRight=e.borderVertical)},t.prototype.toJSON=function(){var n=this;return{backColor:n.backColor,foreColor:n.foreColor,font:n.font,borderLeft:n.borderLeft?n.borderLeft.toJSON():n.borderLeft,borderTop:n.borderTop?n.borderTop.toJSON():n.borderTop,borderRight:n.borderRight?n.borderRight.toJSON():n.borderRight,borderBottom:n.borderBottom?n.borderBottom.toJSON():n.borderBottom,borderHorizontal:n.borderHorizontal?n.borderHorizontal.toJSON():n.borderHorizontal,borderVertical:n.borderVertical?n.borderVertical.toJSON():n.borderVertical}},t.prototype.fromJSON=function(t){var i,u,f,e,o,s,h;t&&(i=this,typeof t.backColor!==r&&(i.backColor=t.backColor),typeof t.foreColor!==r&&(i.foreColor=t.foreColor),typeof t.font!==r&&(i.font=t.font),typeof t.borderLeft!==r&&(u=new n.LineBorder,u.fromJSON(t.borderLeft),i.borderLeft=u),typeof t.borderTop!==r&&(f=new n.LineBorder,f.fromJSON(t.borderTop),i.borderTop=f),typeof t.borderRight!==r&&(e=new n.LineBorder,e.fromJSON(t.borderRight),i.borderRight=e),typeof t.borderBottom!==r&&(o=new n.LineBorder,o.fromJSON(t.borderBottom),i.borderBottom=o),typeof t.borderHorizontal!==r&&(s=new n.LineBorder,s.fromJSON(t.borderHorizontal),i.borderHorizontal=s),typeof t.borderVertical!==r&&(h=new n.LineBorder,h.fromJSON(t.borderVertical),i.borderVertical=h))},t}();n.TableStyleInfo=i;f=function(){function n(){this._lastFooterCellStyle=t;this._init()}return n.prototype.name=function(n){return arguments.length===0?this._name:(this._name=n,this)},n.prototype.wholeTableStyle=function(n){return arguments.length===0?this._wholeTableStyle:(this._wholeTableStyle=n,this)},n.prototype.headerRowStyle=function(n){return arguments.length===0?this._headerRowStyle:(this._headerRowStyle=n,this)},n.prototype.footerRowStyle=function(n){return arguments.length===0?this._footerRowStyle:(this._footerRowStyle=n,this)},n.prototype.firstRowStripStyle=function(n){return arguments.length===0?this._firstRowStripStyle:(this._firstRowStripStyle=n,this)},n.prototype.secondRowStripStyle=function(n){return arguments.length===0?this._secondRowStripStyle:(this._secondRowStripStyle=n,this)},n.prototype.firstRowStripSize=function(n){return arguments.length===0?this._firstRowStripSize:(this._firstRowStripSize=n,this)},n.prototype.secondRowStripSize=function(n){return arguments.length===0?this._secondRowStripSize:(this._secondRowStripSize=n,this)},n.prototype.firstColumnStripStyle=function(n){return arguments.length===0?this._firstColumnStripStyle:(this._firstColumnStripStyle=n,this)},n.prototype.secondColumnStripStyle=function(n){return arguments.length===0?this._secondColumnStripStyle:(this._secondColumnStripStyle=n,this)},n.prototype.firstColumnStripSize=function(n){return arguments.length===0?this._firstColumnStripSize:(this._firstColumnStripSize=n,this)},n.prototype.secondColumnStripSize=function(n){return arguments.length===0?this._secondColumnStripSize:(this._secondColumnStripSize=n,this)},n.prototype.highlightFirstColumnStyle=function(n){return arguments.length===0?this._highlightFirstColumnStyle:(this._highlightFirstColumnStyle=n,this)},n.prototype.highlightLastColumnStyle=function(n){return arguments.length===0?this._highlightLastColumnStyle:(this._highlightLastColumnStyle=n,this)},n.prototype.firstHeaderCellStyle=function(n){return arguments.length===0?this._firstHeaderCellStyle:(this._firstHeaderCellStyle=n,this)},n.prototype.lastHeaderCellStyle=function(n){return arguments.length===0?this._lastHeaderCellStyle:(this._lastHeaderCellStyle=n,this)},n.prototype.firstFooterCellStyle=function(n){return arguments.length===0?this._firstFooterCellStyle:(this._firstFooterCellStyle=n,this)},n.prototype.lastFooterCellStyle=function(n){return arguments.length===0?this._lastFooterCellStyle:(this._lastFooterCellStyle=n,this)},n.prototype._init=function(){var n=this;n._name=t;n._headerRowStyle=t;n._footerRowStyle=t;n._wholeTableStyle=t;n._highlightLastColumnStyle=t;n._highlightFirstColumnStyle=t;n._firstRowStripStyle=t;n._secondRowStripStyle=t;n._firstColumnStripStyle=t;n._secondColumnStripStyle=t;n._firstHeaderCellStyle=t;n._lastHeaderCellStyle=t;n._firstFooterCellStyle=t;n._lastFooterCellStyle=t;n._firstRowStripSize=1;n._secondRowStripSize=1;n._firstColumnStripSize=1;n._secondColumnStripSize=1},n.prototype._isDefaultValue=function(n,i){switch(n){case"name":return i===t;case"headerRowStyle":return i===t;case"footerRowStyle":return i===t;case"wholeTableStyle":return i===t;case"highlightLastColumnStyle":return i===t;case"highlightFirstColumnStyle":return i===t;case"firstRowStripStyle":return i===t;case"secondRowStripStyle":return i===t;case"firstColumnStripStyle":return i===t;case"secondColumnStripStyle":return i===t;case"firstHeaderCellStyle":return i===t;case"lastHeaderCellStyle":return i===t;case"firstFooterCellStyle":return i===t;case"lastFooterCellStyle":return i===t;case"firstRowStripSize":return i===1;case"secondRowStripSize":return i===1;case"firstColumnStripSize":return i===1;case"secondColumnStripSize":return i===1;default:return!1}},n.prototype.toJSON=function(){var t=this,i={name:t._name,firstRowStripSize:t._firstRowStripSize,secondRowStripSize:t._secondRowStripSize,firstColumnStripSize:t._firstColumnStripSize,secondColumnStripSize:t._secondColumnStripSize},n=t._headerRowStyle,r,f,e;i.headerRowStyle=n?n.toJSON():n;n=t._footerRowStyle;i.footerRowStyle=n?n.toJSON():n;n=t._wholeTableStyle;i.wholeTableStyle=n?n.toJSON():n;n=t._highlightLastColumnStyle;i.highlightLastColumnStyle=n?n.toJSON():n;n=t._highlightFirstColumnStyle;i.highlightFirstColumnStyle=n?n.toJSON():n;n=t._firstRowStripStyle;i.firstRowStripStyle=n?n.toJSON():n;n=t._secondRowStripStyle;i.secondRowStripStyle=n?n.toJSON():n;n=t._firstColumnStripStyle;i.firstColumnStripStyle=n?n.toJSON():n;n=t._secondColumnStripStyle;i.secondColumnStripStyle=n?n.toJSON():n;n=t._firstHeaderCellStyle;i.firstHeaderCellStyle=n?n.toJSON():n;n=t._lastHeaderCellStyle;i.lastHeaderCellStyle=n?n.toJSON():n;n=t._firstFooterCellStyle;i.firstFooterCellStyle=n?n.toJSON():n;n=t._lastFooterCellStyle;i.lastFooterCellStyle=n?n.toJSON():n;r={};for(f in i)e=i[f],t._isDefaultValue(f,e)||(r[f]=e);return $.isEmptyObject(r)?u:r},n.prototype.fromJSON=function(n){var u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,t;n&&(u=this,f=typeof n.name!==r?n.name:n._name,typeof f!==r&&(u._name=f),e=typeof n.firstRowStripSize!==r?n.firstRowStripSize:n._firstRowStripSize,typeof e!==r&&(u._firstRowStripSize=e),o=typeof n.secondRowStripSize!==r?n.secondRowStripSize:n._secondRowStripSize,typeof o!==r&&(u._secondRowStripSize=o),s=typeof n.firstColumnStripSize!==r?n.firstColumnStripSize:n._firstColumnStripSize,typeof s!==r&&(u._firstColumnStripSize=s),h=typeof n.secondColumnStripSize!==r?n.secondColumnStripSize:n._secondColumnStripSize,typeof h!==r&&(u._secondColumnStripSize=h),c=typeof n.headerRowStyle!==r?n.headerRowStyle:n._headerRowStyle,typeof c!==r&&(t=new i,t.fromJSON(c),u._headerRowStyle=t),l=typeof n.footerRowStyle!==r?n.footerRowStyle:n._footerRowStyle,typeof l!==r&&(t=new i,t.fromJSON(l),u._footerRowStyle=t),a=typeof n.wholeTableStyle!==r?n.wholeTableStyle:n._wholeTableStyle,typeof a!==r&&(t=new i,t.fromJSON(a),u._wholeTableStyle=t),v=typeof n.highlightLastColumnStyle!==r?n.highlightLastColumnStyle:n._highlightLastColumnStyle,typeof v!==r&&(t=new i,t.fromJSON(v),u._highlightLastColumnStyle=t),y=typeof n.highlightFirstColumnStyle!==r?n.highlightFirstColumnStyle:n._highlightFirstColumnStyle,typeof y!==r&&(t=new i,t.fromJSON(y),u._highlightFirstColumnStyle=t),p=typeof n.firstRowStripStyle!==r?n.firstRowStripStyle:n._firstRowStripStyle,typeof p!==r&&(t=new i,t.fromJSON(p),u._firstRowStripStyle=t),w=typeof n.secondRowStripStyle!==r?n.secondRowStripStyle:n._secondRowStripStyle,typeof w!==r&&(t=new i,t.fromJSON(w),u._secondRowStripStyle=t),b=typeof n.firstColumnStripStyle!==r?n.firstColumnStripStyle:n._firstColumnStripStyle,typeof b!==r&&(t=new i,t.fromJSON(b),u._firstColumnStripStyle=t),k=typeof n.secondColumnStripStyle!==r?n.secondColumnStripStyle:n._secondColumnStripStyle,typeof k!==r&&(t=new i,t.fromJSON(k),u._secondColumnStripStyle=t),d=typeof n.firstHeaderCellStyle!==r?n.firstHeaderCellStyle:n._firstHeaderCellStyle,typeof d!==r&&(t=new i,t.fromJSON(d),u._firstHeaderCellStyle=t),g=typeof n.lastHeaderCellStyle!==r?n.lastHeaderCellStyle:n._lastHeaderCellStyle,typeof g!==r&&(t=new i,t.fromJSON(g),u._lastHeaderCellStyle=t),nt=typeof n.firstFooterCellStyle!==r?n.firstFooterCellStyle:n._firstFooterCellStyle,typeof nt!==r&&(t=new i,t.fromJSON(nt),u._firstFooterCellStyle=t),tt=typeof n.lastFooterCellStyle!==r?n.lastFooterCellStyle:n._lastFooterCellStyle,typeof tt!==r&&(t=new i,t.fromJSON(tt),u._lastFooterCellStyle=t))},n}();n.TableStyle=f;l=function(){function u(){}return u.light1=function(){return u._getLightStyle(1)},u.light2=function(){return u._getLightStyle(2)},u.light3=function(){return u._getLightStyle(3)},u.light4=function(){return u._getLightStyle(4)},u.light5=function(){return u._getLightStyle(5)},u.light6=function(){return u._getLightStyle(6)},u.light7=function(){return u._getLightStyle(7)},u.light8=function(){return u._getLightStyle(8)},u.light9=function(){return u._getLightStyle(9)},u.light10=function(){return u._getLightStyle(10)},u.light11=function(){return u._getLightStyle(11)},u.light12=function(){return u._getLightStyle(12)},u.light13=function(){return u._getLightStyle(13)},u.light14=function(){return u._getLightStyle(14)},u.light15=function(){return u._getLightStyle(15)},u.light16=function(){return u._getLightStyle(16)},u.light17=function(){return u._getLightStyle(17)},u.light18=function(){return u._getLightStyle(18)},u.light19=function(){return u._getLightStyle(19)},u.light20=function(){return u._getLightStyle(20)},u.light21=function(){return u._getLightStyle(21)},u.medium1=function(){return u._getMediumStyle(1)},u.medium2=function(){return u._getMediumStyle(2)},u.medium3=function(){return u._getMediumStyle(3)},u.medium4=function(){return u._getMediumStyle(4)},u.medium5=function(){return u._getMediumStyle(5)},u.medium6=function(){return u._getMediumStyle(6)},u.medium7=function(){return u._getMediumStyle(7)},u.medium8=function(){return u._getMediumStyle(8)},u.medium9=function(){return u._getMediumStyle(9)},u.medium10=function(){return u._getMediumStyle(10)},u.medium11=function(){return u._getMediumStyle(11)},u.medium12=function(){return u._getMediumStyle(12)},u.medium13=function(){return u._getMediumStyle(13)},u.medium14=function(){return u._getMediumStyle(14)},u.medium15=function(){return u._getMediumStyle(15)},u.medium16=function(){return u._getMediumStyle(16)},u.medium17=function(){return u._getMediumStyle(17)},u.medium18=function(){return u._getMediumStyle(18)},u.medium19=function(){return u._getMediumStyle(19)},u.medium20=function(){return u._getMediumStyle(20)},u.medium21=function(){return u._getMediumStyle(21)},u.medium22=function(){return u._getMediumStyle(22)},u.medium23=function(){return u._getMediumStyle(23)},u.medium24=function(){return u._getMediumStyle(24)},u.medium25=function(){return u._getMediumStyle(25)},u.medium26=function(){return u._getMediumStyle(26)},u.medium27=function(){return u._getMediumStyle(27)},u.medium28=function(){return u._getMediumStyle(28)},u.dark1=function(){return u._getDarkStyle(1)},u.dark2=function(){return u._getDarkStyle(2)},u.dark3=function(){return u._getDarkStyle(3)},u.dark4=function(){return u._getDarkStyle(4)},u.dark5=function(){return u._getDarkStyle(5)},u.dark6=function(){return u._getDarkStyle(6)},u.dark7=function(){return u._getDarkStyle(7)},u.dark8=function(){return u._getDarkStyle(8)},u.dark9=function(){return u._getDarkStyle(9)},u.dark10=function(){return u._getDarkStyle(10)},u.dark11=function(){return u._getDarkStyle(11)},u.customStyles=function(){var n=u._customStyles;return!n?t:n},u.addCustomStyles=function(t){var i,f,e,r;if(t){for(u._customStyles||(u._customStyles=[]),i=u._customStyles,f=i.length,r=0;r<f;r++)if(e=i[r],e.name()===t.name())throw new Error(n.SR.Exp_TableStyleAddCustomStyleError);i.push(t)}},u.removeCustomStyle=function(t){var i,r;return t?(i=u._customStyles,i&&(r=n.util.inArray(t,i),r>-1))?(i.splice(r,1),!0):!1:!1},u.removeCustomStyleByName=function(n){var i=u._customStyles,r,f,t;if(i)for(r=i.length,t=0;t<r;t++)if(f=i[t],f.name()===n)return i.splice(t,1),!0;return!1},u._getLightStyle=function(n){var f=n-1,i;if(typeof u._lights===r&&(u._lights={}),u._lights[f])return u._lights[f];i=t;switch(s(f/7)){case 0:i=u._createLightA(f%7);break;case 1:i=u._createLightB(f%7);break;case 2:i=u._createLightC(f%7);break}return i?(i.name("Light"+n),u._lights[f]=i,i):t},u._createLightA=function(t){var y=u._getTheme(t),p=y+" 80",r=y,e=new f,h=new i,o,a,c,l,v,s;return h.borderBottom=new n.LineBorder(r,1),h.font="bold 10pt arial",h.foreColor=r,e.headerRowStyle(h),o=new i,o.borderTop=new n.LineBorder(r,1),o.borderBottom=new n.LineBorder(r,1),o.foreColor=r,e.wholeTableStyle(o),a=new i,a.backColor=p,e.firstRowStripStyle(a),c=new i,c.font="bold 10pt arial",c.foreColor=r,e.highlightFirstColumnStyle(c),l=new i,l.font="bold 10pt arial",l.foreColor=r,e.highlightLastColumnStyle(l),v=new i,v.backColor=p,e.firstColumnStripStyle(v),s=new i,s.borderTop=new n.LineBorder(r,1),s.font="bold 10pt arial",s.foreColor=r,e.footerRowStyle(s),e},u._createLightB=function(t){var w=u._getTheme(t),r=w,e=new f,s=new i,o,c,l,a,v,y,p,h;return s.backColor=r,s.font="bold 10pt arial",s.foreColor="white",e.headerRowStyle(s),o=new i,o.borderLeft=new n.LineBorder(r,1),o.borderTop=new n.LineBorder(r,1),o.borderBottom=new n.LineBorder(r,1),o.borderRight=new n.LineBorder(r,1),e.wholeTableStyle(o),c=new i,c.borderTop=new n.LineBorder(r,1),e.firstRowStripStyle(c),l=new i,l.borderTop=new n.LineBorder(r,1),e.secondRowStripStyle(l),a=new i,a.borderLeft=new n.LineBorder(r,1),e.firstColumnStripStyle(a),v=new i,v.borderLeft=new n.LineBorder(r,1),e.secondColumnStripStyle(v),y=new i,y.font="bold 10pt arial",e.highlightFirstColumnStyle(y),p=new i,p.font="bold 10pt arial",e.highlightLastColumnStyle(p),h=new i,h.borderTop=new n.LineBorder(r,6),h.font="bold 10pt arial",e.footerRowStyle(h),e},u._createLightC=function(t){var y=u._getTheme(t),p=y+" 80",r=y,e=new f,h=new i,o,c,l,a,v,s;return h.borderBottom=new n.LineBorder(r,2),h.font="bold 10pt arial",e.headerRowStyle(h),o=new i,o.borderLeft=new n.LineBorder(r,1),o.borderTop=new n.LineBorder(r,1),o.borderRight=new n.LineBorder(r,1),o.borderBottom=new n.LineBorder(r,1),o.borderHorizontal=new n.LineBorder(r,1),o.borderVertical=new n.LineBorder(r,1),e.wholeTableStyle(o),c=new i,c.backColor=p,e.firstRowStripStyle(c),l=new i,l.backColor=p,e.firstColumnStripStyle(l),a=new i,a.font="bold 10pt arial",e.highlightFirstColumnStyle(a),v=new i,v.font="bold 10pt arial",e.highlightLastColumnStyle(v),s=new i,s.borderTop=new n.LineBorder(r,6),s.font="bold 10pt arial",e.footerRowStyle(s),e},u._getMediumStyle=function(n){var f=n-1,i;if(typeof u._mediums===r&&(u._mediums={}),u._mediums[f])return u._mediums[f];i=t;switch(s(f/7)){case 0:i=u._createMediumA(f%7);break;case 1:i=u._createMediumB(f%7);break;case 2:i=u._createMediumC(f%7);break;case 3:i=u._createMediumD(f%7);break}return i?(i.name("Medium"+n),u._mediums[f]=i,i):t},u._createMediumA=function(t){var c=u._getTheme(t),o=c+" 20",w=c,p=c+" 80",r=new f,h=new i,e,l,a,v,y,s;return h.backColor=w,h.font="bold 10pt arial",h.foreColor="white",r.headerRowStyle(h),e=new i,e.borderHorizontal=new n.LineBorder(o,1),e.borderLeft=new n.LineBorder(o,1),e.borderRight=new n.LineBorder(o,1),e.borderBottom=new n.LineBorder(o,1),e.borderTop=new n.LineBorder(o,1),r.wholeTableStyle(e),l=new i,l.backColor=p,r.firstRowStripStyle(l),a=new i,a.backColor=p,r.firstColumnStripStyle(a),v=new i,v.font="bold 10pt arial",r.highlightFirstColumnStyle(v),y=new i,y.font="bold 10pt arial",r.highlightLastColumnStyle(y),s=new i,s.borderTop=new n.LineBorder(o,6),s.font="bold 10pt arial",s.foreColor="black",r.footerRowStyle(s),r},u._createMediumB=function(t){var v=u._getTheme(t),o="white",a=v,w=v+" 60",b=v+" 80",r=new f,s=new i,h,y,p,c,l,e;return s.backColor=a,s.borderBottom=new n.LineBorder(o,2),s.borderVertical=new n.LineBorder(o,1),s.font="bold 10pt arial",s.foreColor="white",r.headerRowStyle(s),h=new i,h.borderHorizontal=new n.LineBorder(o,1),h.borderVertical=new n.LineBorder(o,1),h.backColor=b,r.wholeTableStyle(h),y=new i,y.backColor=w,r.firstRowStripStyle(y),p=new i,p.backColor=w,r.firstColumnStripStyle(p),c=new i,c.backColor=a,c.foreColor="white",c.font="bold 10pt arial",r.highlightFirstColumnStyle(c),l=new i,l.backColor=a,l.foreColor="white",l.font="bold 10pt arial",r.highlightLastColumnStyle(l),e=new i,e.borderTop=new n.LineBorder(o,2),e.borderVertical=new n.LineBorder(o,1),e.backColor=a,e.foreColor="white",e.font="bold 10pt arial",r.footerRowStyle(e),r},u._createMediumC=function(t){var k=u._getTheme(t),s=k,b="#D3D3D3",d="white",l=t===0?"black":"#D3D3D3",r=new f,o=new i,e,p,w,a,v,h,c,y;return o.backColor=s,o.borderTop=new n.LineBorder("black",2),o.borderBottom=new n.LineBorder("black",2),o.font="bold 10pt arial",o.foreColor="white",r.headerRowStyle(o),e=new i,e.borderLeft=new n.LineBorder(l,1),e.borderRight=new n.LineBorder(l,1),e.borderTop=new n.LineBorder("black",2),e.borderVertical=new n.LineBorder(l,1),t===0&&(e.borderHorizontal=new n.LineBorder(l,1)),e.borderBottom=new n.LineBorder("black",2),r.wholeTableStyle(e),p=new i,p.backColor=b,r.firstRowStripStyle(p),w=new i,w.backColor=b,r.firstColumnStripStyle(w),a=new i,a.backColor=s,a.foreColor="white",r.highlightFirstColumnStyle(a),v=new i,v.backColor=s,v.foreColor="white",r.highlightLastColumnStyle(v),h=new i,h.backColor=s,h.font="bold 10pt arial",h.foreColor="white",r.firstFooterCellStyle(h),c=new i,c.backColor=s,c.font="bold 10pt arial",c.foreColor="white",r.lastFooterCellStyle(c),y=new i,y.foreColor="black",y.borderTop=new n.LineBorder("black",6),r.footerRowStyle(y),r},u._createMediumD=function(t){var c=u._getTheme(t),b=c,r=c+" 40",p=c+" 80",w=c+" 60",k=c+" 80",h=new f,o=new i,s,l,a,v,y,e;return o.backColor=p,o.borderVertical=new n.LineBorder(r,1),o.borderLeft=new n.LineBorder(r,1),o.borderTop=new n.LineBorder(r,1),o.borderRight=new n.LineBorder(r,1),o.borderBottom=new n.LineBorder(r,1),o.font="bold 10pt arial",o.foreColor="black",h.headerRowStyle(o),s=new i,s.borderVertical=new n.LineBorder(r,1),s.borderHorizontal=new n.LineBorder(r,1),s.borderLeft=new n.LineBorder(r,1),s.borderTop=new n.LineBorder(r,1),s.borderRight=new n.LineBorder(r,1),s.borderBottom=new n.LineBorder(r,1),s.backColor=p,h.wholeTableStyle(s),l=new i,l.backColor=w,h.firstRowStripStyle(l),a=new i,a.backColor=w,h.firstColumnStripStyle(a),v=new i,v.font="bold 10pt arial",h.highlightFirstColumnStyle(v),y=new i,y.font="bold 10pt arial",h.highlightLastColumnStyle(y),e=new i,e.backColor=k,e.foreColor="black",e.font="bold 10pt arial",e.borderLeft=new n.LineBorder(r,1),e.borderTop=new n.LineBorder(b,2),e.borderRight=new n.LineBorder(r,1),e.borderBottom=new n.LineBorder(r,1),e.borderVertical=new n.LineBorder(r,1),h.footerRowStyle(e),h},u._getDarkStyle=function(n){var f=n-1,i;if(typeof u._darks===r&&(u._darks={}),u._darks[f])return u._darks[f];i=t;switch(s(f/7)){case 0:i=u._createDarkA(f%7);break;case 1:i=u._createDarkB(f%7);break}return i!=t?(i.name("Dark"+n),u._darks[f]=i,i):t},u._createDarkA=function(t){var e=u._getTheme(t),p="black",l=t===0?e+" 25":e+" -25",w=t===0?e+" 50":e,b=t===0?e:e+" -50",r=new f,c=new i,a,v,y,o,s,h;return c.backColor=p,c.font="bold 10pt arial",c.foreColor="white",c.borderBottom=new n.LineBorder("white",2),r.headerRowStyle(c),a=new i,a.backColor=w,a.foreColor="white",r.wholeTableStyle(a),v=new i,v.backColor=l,r.firstRowStripStyle(v),y=new i,y.backColor=l,r.firstColumnStripStyle(y),o=new i,o.font="bold 10pt arial",o.borderRight=new n.LineBorder("white",2),o.backColor=l,o.foreColor="white",r.highlightFirstColumnStyle(o),s=new i,s.font="bold 10pt arial",s.borderLeft=new n.LineBorder("white",2),s.backColor=l,s.foreColor="white",r.highlightLastColumnStyle(s),h=new i,h.backColor=b,h.font="bold 10pt arial",h.foreColor="white",h.borderTop=new n.LineBorder("white",2),r.footerRowStyle(h),r},u._createDarkB=function(t){var b=u._getTheme(t),p=u._getHeaderColor(t),v=u._getStripColor(t),y=u._getTableBackground(t),w=y,r=new f,o=new i,s,h,c,l,a,e;return o.backColor=p,o.foreColor="white",r.headerRowStyle(o),s=new i,s.backColor=y,r.wholeTableStyle(s),h=new i,h.backColor=v,r.firstRowStripStyle(h),c=new i,c.backColor=v,r.firstColumnStripStyle(c),l=new i,l.font="bold 10pt arial",r.highlightFirstColumnStyle(l),a=new i,a.font="bold 10pt arial",r.highlightLastColumnStyle(a),e=new i,e.backColor=w,e.font="bold 10pt arial",e.borderTop=new n.LineBorder("black",6),r.footerRowStyle(e),r},u._getTableBackground=function(n){if(n===0)return"Background 1 -15";else if(n===1)return"Accent 1 80";else if(n===2)return"Accent 3 80";else if(n===3)return"Accent 5 80";return""},u._getStripColor=function(n){if(n===0)return"Background 1 -35";else if(n===1)return"Accent 1 60";else if(n===2)return"Accent 3 60";else if(n===3)return"Accent 5 60";return""},u._getHeaderColor=function(n){if(n===0)return"Text 1";else if(n===1)return"Accent 2";else if(n===2)return"Accent 4";else if(n===3)return"Accent 6";return""},u._getTheme=function(n){return n===0?"Text 1":"Accent "+n},u}();n.TableStyles=l;a=function(){function i(n){this._sheet=n;this._tableList=[]}return i.prototype.getSheet=function(){return this._sheet},i.prototype.getCount=function(){return this._tableList.length},i.prototype.getTables=function(){return this._tableList},i.prototype.add=function(t){var i,f,u,r;if(t){for(i=this,f=i._tableList.length,r=0;r<f;r++)if(u=i._tableList[r],u&&u.name()===t.name())throw new Error(n.SR.Exp_TableHasSameNameError);return t._setOwner(i),i._tableList.push(t),t.showHeader()&&t._syncHeader(),t._syncFooter()&&t._syncFooter(),t}},i.prototype.remove=function(i){var e,u,f;if(i&&(e=n.util.inArray(i,this._tableList),e>-1)){this._tableList.splice(e,1);var r=i.range(),o=this._sheet,s=r.row,h=r.row+r.rowCount,c=r.col,l=r.col+r.colCount;for(u=s;u<h;u++)for(f=c;f<l;f++)o.setValue(u,f,t),o.setFormula(u,f,t)}},i.prototype.find=function(n,i){var e=this._tableList.length,f,u,r;if(e===0)return t;for(u=0;u<e;u++)if(f=this._tableList[u],r=f.range(),r.row<=n&&n<r.row+r.rowCount&&r.col<=i&&i<r.col+r.colCount)return f;return t},i.prototype.findByRange=function(n,i,r,u){var s=this._tableList.length,e,o,f;if(s===0)return t;for(e=[],f=0;f<s;f++)o=this._tableList[f],o.range().intersect(n,i,r,u)&&e.push(o);return e},i.prototype.findByName=function(n){for(var u=this._tableList.length,i,r=0;r<u;r++)if(i=this._tableList[r],i.name().toLowerCase()===n.toLowerCase())return i;return t},i.prototype.has=function(n,t,i,r){for(var e=this._tableList.length,f,u=0;u<e;u++)if(f=this._tableList[u],f.range().intersect(n,t,i,r))return!0;return!1},i.prototype.addRows=function(n,t){for(var u=this._tableList.length,r,i=0;i<u;i++)r=this._tableList[i],r._addRows(n,t)},i.prototype.addColumns=function(n,t){for(var u=this._tableList.length,r,i=0;i<u;i++)r=this._tableList[i],r._addColumns(n,t)},i.prototype.removeRows=function(n,t){for(var r,e,f=[],o=this._tableList.length,i,u=0;u<o;u++)i=this._tableList[u],r=i.range(),e=n<=r.row&&r.row+r.rowCount<=n+t,e||(i._removeRows(n,t),f.push(i));this._tableList=f},i.prototype.removeColumns=function(n,t){for(var r,e,f=[],o=this._tableList.length,i,u=0;u<o;u++)i=this._tableList[u],r=i.range(),e=n<=r.col&&r.col+r.colCount<=n+t,e||(i._removeColumns(n,t),f.push(i));this._tableList=f},i.prototype.clear=function(i,r,u,f,e){var c=this,a=new n.Range(i,r,u,f),h,s,l,o;if((e&1)==1){for(l=[],h=c._tableList.length,o=0;o<h;o++)s=c._tableList[o],a.containsRange(s.range())||l.push(s);for(h=l.length,o=0;o<h;o++)s=l[o],s._clear(i,r,u,f);c._tableList=l}if((e&2)==2)for(h=c._tableList.length,o=0;o<h;o++)s=c._tableList[o],a.containsRange(s.range())&&s.style(t)},i.prototype.copy=function(n,t,i,r,u,f){for(var s=this._tableList.length,o,e=0;e<s;e++)o=this._tableList[e],o._copy(n,t,i,r,u,f)},i.prototype.move=function(n,t,i,r,u,f){for(var s=this._tableList.length,o,e=0;e<s;e++)o=this._tableList[e],o._move(n,t,i,r,u,f)},i.prototype.toJSON=function(){return this._tableList.length===0?u:{tables:this._tableList}},i.prototype.fromJSON=function(n){var r,u,t,i;if(n&&(this._tableList=[],n.tables))for(r=n.tables,u=r.length,t=0;t<u;t++)i=new c,i._setOwner(this),i.fromJSON(r[t]),this._tableList.push(i)},i}();n._SheetTableManager=a})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(n){var p,o,c,a,r,s,u,v,y;n.feature("group",["core.common","core.stringResource"]);var t=null,f=undefined,i=Math.max,e=Math.min,h="undefined",l=Array.prototype;l.nextNonEmptyIndex=function(n){var r,i;for(n<0&&(n=-1),r=n+1,i=r;i<this.length;i++)if(this[i]!==f&&this[i]!==t)return i;return-1};l.clear=function(n,i){var u,r;if(!(n<0))for(u=0,r=0;u<i&&r<this.length;r++)this[n+r]=t,u++},function(n){n[n.Expanded=0]="Expanded";n[n.Collapsed=1]="Collapsed"}(n.GroupState||(n.GroupState={}));p=n.GroupState;o=function(){function n(n,i,r,u){var f=this;f.model=t;f.children=t;f.parent=t;f.start=0;f.end=0;f.level=0;f.model=n;f.start=i;f.end=r;f.level=u}return n.prototype.getState=function(){return this.model?this.model.getState(this):0},n.prototype.setState=function(n){this.model&&this.model.expand(this.level,n===0)},n.prototype.contains=function(n){return this.start<=n&&n<=this.end},n.prototype.addChild=function(n){var t=this;n&&(t.children||(t.children=[]),t.children.push(n),n.parent=t)},n}();n.RangeGroupInfo=o;c=function(){function n(){this.count=0}return n.prototype.addRef=function(){this.count++},n.prototype.release=function(){this.count--},n.prototype.isWorking=function(){return this.count>0},n}();n.WorkingState=c;a=function(){function i(n){var i=this;i.head=t;i.tail=t;i.items=t;i._rootCached=t;i.direction=1;i.suspendAddingGroup=new c;i.items=new Array(n);i._empty=!0}return i.prototype.setDirection=function(n){this.direction=n},i.prototype.getDirection=function(){return this.direction},i.prototype._getCount=function(){var n=this.items;return n?n.length:0},i.prototype.group=function(i,u){var f=this,e,s,o;if(!f._isIndexValid(i))throw new Error(n.SR.Exp_InvalidIndex);if(!f._isIndexValid(i+u-1))throw new Error(n.SR.Exp_InvalidCount);for(f._rootCached=t,e=0;e<u;e++)s=i+e,o=f._getModelIndexFromViewIndex(s),f.items[o]?f.items[o].level++:f.items[o]=new r;f._rootCached=f.createRangeGroup();f._empty=!1},i.prototype.ungroupRange=function(i,r){var u=this,k,g,v,nt,y,p,w;if(!u._isIndexValid(i))throw new Error(n.SR.Exp_InvalidIndex);if(!u._isIndexValid(i+r-1))throw new Error(n.SR.Exp_InvalidCount);var h=!1,e=t,c=-1;if(u.direction===1){if(c=i+r,h=u._isIndexValid(c),h){var l=i+r-1,b=l,o=t;do k=u._getModelIndexFromViewIndex(l),o=u.items[k],o!==f&&o!==t&&(b=l),l--;while((o===f||o===t)&&l>=i);o!==f&&o!==t&&(e=u._findImp(u._rootCached,b,o.level),e&&(c=e.end+1),h=e&&(e.end===i+r-1||u.getState(e)===1))}}else if(u.direction===0&&(c=i-1,h=u._isIndexValid(c),h)){var a=i,d=a,s=t;do g=u._getModelIndexFromViewIndex(a),s=u.items[g],s!==f&&s!==t&&(d=a),a++;while((s===f||s===t)&&a<i+r);s!==f&&s!==t&&(e=u._findImp(u._rootCached,d,s.level),e&&(c=e.start-1),h=e&&(e.start===i||u.getState(e)===1))}for(u._rootCached=t,v=0;v<r;v++)nt=i+v,y=u._getModelIndexFromViewIndex(nt),u.items[y]&&u.items[y].level>-1&&u.items[y].level--;h&&(p=u._getModelIndexFromViewIndex(c),w=u.items[p],w&&w.level===e.level&&(u.items[p]=t));u._rootCached=u.createRangeGroup()},i.prototype.ungroup=function(){var n=this,i;n._rootCached=t;i=n._getCount();n.items=new Array(i);n._rootCached=n.createRangeGroup();n._empty=!0},i.prototype._expand=function(t,i,r){if(!this._isIndexValid(t))throw new Error(n.SR.Exp_InvalidIndex);if(i<-1)throw new Error(n.SR.Exp_InvalidLevel);var u=this.find(t,i);u&&this.expandGroup(u,r)},i.prototype.expand=function(t,i){if(t<-1)throw new Error(n.SR.Exp_InvalidLevel);for(var r=new s(this);r.moveNext();)this._expand(r.current,t,i)},i.prototype.expandGroup=function(t,i){if(!t)throw new Error(n.SR.Exp_GroupInfoIsNull);var r=-1;switch(this.direction){case 0:r=t.start-1;break;case 1:r=t.end+1;break}this.setCollapsed(r,!i)},i.prototype.isCollapsed=function(n){var i=this.getLevel(n),t;if(i>-1)for(t=this._findImp(this._rootCached,n,i);t;){if(t.getState()===1)return!0;t=t.parent}return!1},i.prototype.find=function(i,r){var u=this._rootCached;if(u){if(r===-1)return u;if(!this._isIndexValid(i))throw new Error(n.SR.Exp_InvalidIndex);return this._findImp(u,i,r)}return t},i.prototype.getLevel=function(t){if(!this._isIndexValid(t))throw new Error(n.SR.Exp_InvalidIndex);var r=this._getModelIndexFromViewIndex(t),i=this.items[r];return i?i.level:-1},i.prototype.getCollapsed=function(n){var i=this._getModelIndexFromViewIndex(n),t=this.items[i];return t?!!t.collapsed:!1},i.prototype.setCollapsed=function(n,i){var u=this,s=!1,f,o;if(n<0)f=u.head,f||(f=u.head=new r),f.collapsed!==i&&(f.collapsed=i,s=!0);else if(n>-1&&n<u._getCount()){var h=u._getModelIndexFromViewIndex(n),c=u.items,e=c[h];e||(e=c[h]=new r,e.level=-1);e.collapsed!==i&&(e.collapsed=i,s=!0)}else n>=u._getCount()&&(o=u.tail,o||(o=u.tail=new r),o.collapsed!==i&&(o.collapsed=i,s=!0));s&&(u._rootCached=t,u.refresh())},i.prototype.getMaxLevel=function(){for(var t=-1,u=this.items,f=u.length,i,n,r=0;r<f;r++)i=u[r],n=i&&i.level,typeof n!==h&&n>t&&(t=n);return t},i.prototype._move=function(n,i,u){var f=this,o,e,c,s,h;if(u>0){if(n<0&&(n=0),i<0&&(i=0),n===i)return;for(o=[],e=f.items.nextNonEmptyIndex(n-1);e>=0&&e<n+u;)c=new r(f.items[e]),o.push({index:e-n,value:c}),e=f.items.nextNonEmptyIndex(e);if(f.items.clear(n,u),f.items.clear(i,u),o.length>0)for(s=0;s<o.length;s++)h=o[s],f.items[i+h.index]=h.value;f._rootCached=t;f.refresh()}},i.prototype._copy=function(n,i,u){var f=this,o,e,c,s,h;if(u>0){if(n<0&&(n=0),i<0&&(i=0),n===i)return;for(o=[],e=f.items.nextNonEmptyIndex(n-1);e>=0&&e<n+u;)c=new r(f.items[e]),o.push({index:e-n,value:c}),e=f.items.nextNonEmptyIndex(e);if(f.items.clear(i,u),o.length>0)for(s=0;s<o.length;s++)h=o[s],f.items[i+h.index]=h.value;f._rootCached=t;f.refresh()}},i.prototype._add=function(n,i){var u=this,e,s,h,c,f,o;if(i>0){for(e=u._getModelIndexFromViewIndex(n),s=e>1?u.items[e-1]:t,h=0;h<i;h++)u.items.splice(e,0,!s?t:new r(s));if(!u.suspendAddingGroup.isWorking&&n>0&&(c=u._getModelIndexFromViewIndex(n-1),f=t,f=c<0?u.head:u.items[c],f))for(o=0;o<i;o++)u.items[n+o]=new r({collapsed:f.collapsed,level:f.level});u._rootCached=t;u.refresh()}},i.prototype._remove=function(n,i){i>0&&(this.items.splice(n,i),this._rootCached=t,this.refresh())},i.prototype.equals=function(n){var t=this,i=n,r;if(i){if(!t.items&&i.items&&i.items.length>0||!i.items&&t.items&&t.items.length>0||!t.rangeGroupItemInfoEquals(t.head,i.head)||!t.rangeGroupItemInfoEquals(t.tail,i.tail))return!1;if(t.items&&i.items){if(t.direction!==i.direction||t.items.length!==i.items.length)return!1;for(r=0;r<t.items.length;r++)if(!t.items[r]&&i.items[r]||t.items[r]&&!i.items[r])return!1}return!0}return!1},i.prototype._isEmpty=function(){return this._empty},i.prototype.refresh=function(){this._isEmpty()||(this._rootCached=this.createRangeGroup())},i.prototype._setCount=function(n){var i=this,u,f,e;if(i.items||(i.items=new Array(n)),i._rootCached=t,u=i._getCount(),n<u)i.items.splice(n,u-n);else if(n>u)if(f=i.items[i.items.length-1],f)for(e=0;e<n;e++)i.items.push(new r(f));else i.items=i.items.concat(new Array(n));i.refresh()},i.prototype.getState=function(n){var r=this,i=-1,u,f,e;switch(r.direction){case 1:i=n.end+1;break;case 0:i=n.start-1;break}return u=t,f=r._getCount(),i<0&&(u=r.head),i>-1&&i<f?(e=r._getViewIndexFromModelIndex(i),u=r.items[e]):i>=f&&(u=r.tail),u&&u.collapsed?1:0},i.prototype._setLevel=function(n,i){var u=this,f;n<0?(u.head||(u.head=new r),u.head.level=i):n>-1&&n<u._getCount()?(f=u._getModelIndexFromViewIndex(n),u.items[f]||(u.items[f]=new r,u.items[f].level=-1),u.items[f].level=i):n>=u._getCount()&&(u.tail||(u.tail=new r),u.tail.level=i);u._rootCached=t;u.refresh()},i.prototype.suspendAdding=function(){this.suspendAddingGroup.addRef()},i.prototype.resumeAdding=function(){this.suspendAddingGroup.release()},i.prototype._getViewIndexFromModelIndex=function(n){return n},i.prototype._getModelIndexFromViewIndex=function(n){return n},i.prototype.rangeGroupItemInfoEquals=function(n,t){return n?t?n.level===t.level&&n.collapsed===t.collapsed:!1:!t},i.prototype.createRangeGroup=function(){for(var n=this,i=new o(n,0,n._getCount()-1,-1),r=new s(n),t;r.moveNext();)t=n._createRangeGroup(r,0),t&&t.level>-1&&i.addChild(t);return i},i.prototype._createRangeGroup=function(n,i){var f=this,u=t,h;do{var r=n.current,c=f._getModelIndexFromViewIndex(r),e=f.items[c],s=n.nextToCurrent();if(e.level<i)continue;else e.level>=i&&(u||(u=new o(f,r,r,i)));if(e.level>i&&(h=f._createRangeGroup(n,i+1),n.current>-1?(r=n.current,s=n.nextToCurrent()):(r=h.end,s=-1),u.addChild(h)),r>u.end&&(u.end=r),f.isGroupEnd(r,s,i))return u}while(n.moveNext());return u},i.prototype.isGroupEnd=function(n,t,i){var r=this,h=r._getModelIndexFromViewIndex(n),e=r.items[h],s,u,o,f;if(!r._isIndexValid(t)||(s=r._getModelIndexFromViewIndex(t),u=r.items[s],!u))return!0;if(u.level<e.level){if(o=e.level-u.level,f=e.level-i,o===f)return!1;if(f>=0&&f<o)return!0}return!1},i.prototype._isIndexValid=function(n){return n>=-1&&n<this._getCount()},i.prototype._findImp=function(n,i,r){var u,f,o,e;if(n)for(u=[],u.unshift(n);u.length>0;){if(n=u.pop(),n.level===r&&n.contains(i))return n;if(f=n.children,o=f&&f.length,o>0)for(e=0;e<o;e++)u.unshift(f[e])}return t},i.prototype.fromJSON=function(n){var i,e,h,s,u,o;if(n){if(i=this,e=n.itemsCount,(e===f||e===t)&&(e=i.items.length),i.items=new Array(e),n.itemsData)for(h=n.itemsData.length,s=0;s<h;s++)if(u=n.itemsData[s],u.count>0&&u.index>=0&&u.info){for(o=0;o<u.count;o++){if(u.index+o>=i.items.length)break;i.items[u.index+o]=new r(u.info)}i._empty=!1}n.direction!==t&&n.direction!==f&&(i.direction=n.direction);n.head&&(i.head=n.head);n.tail&&(i.tail=n.tail);i._rootCached=t;i.refresh()}},i.prototype.toJSON=function(){return this.toJSONCore()},i.prototype.toJSONCore=function(n){for(var s,e,o,h,t=this,u=[],c=t.items.length,i=-1,r=0;r<c;r++)t.items[r]&&(i>=0&&r===u[i].count+u[i].index&&t.items[r].level===u[i].info.level&&t.items[r].collapsed===u[i].info.collapsed?u[i].count++:(i++,u[i]={index:r,count:1,info:t.items[r]}));s={itemsCount:c,itemsData:u,direction:t.direction,head:t.head,tail:t.tail};e={};for(o in s)h=s[o],t._isDefaultValue(o,h,n)||(e[o]=h);return $.isEmptyObject(e)?f:e},i.prototype._isDefaultValue=function(n,i,r){switch(n){case"head":return i===t;case"tail":return i===t;case"direction":return i===1;case"itemsData":return i.length===0;case"itemsCount":if(r===!0)return i===200;else if(r===!1)return i===20;default:return!1}},i}();n.RangeGroup=a;r=function(){function n(n){var t=this;t!==n&&n&&(t.level=n.level,t.collapsed=n.collapsed);n||(t.level=0,t.collapsed=!1)}return n}();n.RangeGroupItemInfo=r;s=function(){function n(n){this.isEOF=!1;this.rangeGroup=t;this.current=-1;this.rangeGroup=n}return n.prototype.nextToCurrent=function(){return this.current+1},n.prototype.moveNext=function(){var n=this,i,t,r;if(n.isEOF||!n.rangeGroup||!n.rangeGroup.items)return!1;for(i=!1,t=n.current+1;t<n.rangeGroup.items.length;t++)if(r=n.rangeGroup._getModelIndexFromViewIndex(t),n.rangeGroup.items[r]){i=!0;n.current=t;break}return i||(n.current=-1),n.current>-1?!0:(n.isEOF=!0,!1)},n.prototype.reset=function(){this.isEOF=!1;this.current=-1},n}();n.GroupedItemIndexEnumerator=s;u={getThemeBackgroundColor:function(t,i){if(t.parent&&t.parent.useWijmoTheme){var r=n.Global.prototype.getWijmoThemeStyle(0);r&&r.backgroundColor&&r.backgroundColor!==""&&(i=r.backgroundColor)}return i},getThemeForeColor:function(t,i){if(t.parent&&t.parent.useWijmoTheme){var r=n.Global.prototype.getWijmoThemeStyle(0);r&&r.color&&r.color!==""&&(i=r.color)}return i}};v=function(){function r(n,i,r,u){var f=this;f._sheet=t;f._rowGroup=t;f._viewportIndex=1;f._maxLevel=-1;f.PADDING=2;f.LINE_SIZE=2;f.STARTLINE_SIZE=6;f._groupLineInfos=t;f._groupDotInfos=t;f._groupButtonInfos=t;f._sheet=n;f._rowGroup=i;f._viewportIndex=r;f._maxLevel=typeof u===h?i?n.rowRangeGroup.getMaxLevel():n.colRangeGroup.getMaxLevel():u}return r.prototype.createGroupInfo=function(){var n=this,i,r,t;if(n._groupLineInfos=[],n._groupDotInfos=[],n._groupButtonInfos=[],i=n._rowGroup,r=n._maxLevel,r!==-1){var u=n._sheet._getGroupLayout(),s=n._calcMinWidthOrHeight({width:u.width,height:u.height},i),f=n.getGroupsByLevel(0,i),e=f.length,o;if(e>0)for(t=0;t<e;t++)o=f[t],n._measureGroups(o,s)}},r.prototype.paintGroups=function(n){this._rowGroup?this._paintRowGroups(n):this._paintColumnGroups(n)},r.prototype._calcMinWidthOrHeight=function(n,t){var r=0,u=this._maxLevel;return r=t?(n.width-this.PADDING*2)/(u+2):(n.height-this.PADDING*2)/(u+2),i(0,r)},r.prototype._measureGroups=function(n,r){var h=this,ot=h._rowGroup,o=h.getGroupDirection(ot),v=h.getViewportStartIndex(ot),y=h.getViewportEndIndex(ot),l=n.start,a=n.end,f,u,s,b,k,d,g,st,c,p,w,tt,ht,it,rt,ut,ft,et,at,vt;if(n.getState()===0){if(b=!0,k=n.parent,k&&(o===0&&l===k.start||o===1&&a===k.end)&&(b=!1),b&&(f={isExpanded:!0,level:n.level,paintLine:!0},o===1?(u=a+1,u>=v&&u<=y&&(f.index=u,f.lineDirection=1,h._groupButtonInfos.push(f))):o===0&&(u=l-1,u>=v&&u<=y&&(f.index=u,f.lineDirection=0,h._groupButtonInfos.push(f)))),l<=y&&a>=v){for(d=i(v,l),g=e(y,a),b&&(st={start:d,end:g,level:n.level,startLine:t},(o===1&&d===l||o===0&&g===a)&&(st.startLine=!0),h._groupLineInfos.push(st)),c=[],s=d;s<=g;s++)c.push(s);if(p=n.children,w=p&&p.length,w>0)for(s=0;s<w;s++){var nt=p[s],ct=nt.start,lt=nt.end;if(nt.getState()===1)for(tt=ct;tt<=lt;tt++)c.remove(tt);o===1?c.remove(lt+1):o===0&&c.remove(ct-1);h._measureGroups(nt,r)}if(ht=!0,w>0)for(it=0;it<w;it++)if(rt=p[it],rt)if(ut=rt.start,ft=rt.end,ut===l&&ft===a){ht=!1;break}else if(o===1&&ft===a||o===0&&ut===l)for(et=ut;et<=ft;et++)c.remove(et);if(ht&&c.length>0)for(s=0;s<c.length;s++)at=c[s],vt={index:at,level:n.level+1},h._groupDotInfos.push(vt)}}else n.getState()===1&&(f={isExpanded:!1,level:n.level},o===1?(u=a+1,u>=v&&u<=y&&(f.index=u,f.lineDirection=1,h._groupButtonInfos.push(f))):o===0&&(u=l-1,u>=v&&u<=y&&(f.index=u,f.lineDirection=0,h._groupButtonInfos.push(f))))},r.prototype._paintRowGroups=function(n){var l=this,ii=l._maxLevel,et,pt,wt,dt,st,gt,ht,it,ct,w,k,rt,b,ni,ti,lt;if(ii!==-1){var p=l._sheet,f=p._getGroupLayout(),a=l._calcMinWidthOrHeight({width:f.width,height:f.height},!0);if(a!==0){n.save();var at=l.STARTLINE_SIZE,vt=l.PADDING,y=l.LINE_SIZE,ut=i(0,(a-at)/2)+vt,h,r,s,o,d=p._getRowLayout(l._viewportIndex,3),ft=l._groupDotInfos,yt=ft&&ft.length;if(yt>0)for(s=0;s<yt;s++)et=ft[s],o=d.findRow(et.index),o&&o.height>=y&&(h=et.level*a+ut,r=o.y+i(0,(o.height-y)/2),pt=y,wt=y,n.fillStyle=u.getThemeForeColor(p,"black"),n.fillRect(f.x+h+.5,f.y+r,pt,wt));var bt=p.rowRangeGroup.direction,ot=l._groupLineInfos,kt=ot&&ot.length;if(kt>0)for(s=0;s<kt;s++){var g=ot[s],nt=g.start,tt=g.end,v=t,c=t;do v=d.findRow(nt),nt++;while(!v&&nt<=tt);do c=d.findRow(tt),tt--;while(!c&&tt>=nt);if(v||c)!v&&c?v=c:v&&!c&&(c=v);else continue;h=g.level*a+ut;r=v.y;bt===1&&(r+=1);dt=y;st=i(0,c.y+c.height-v.y);n.fillStyle=u.getThemeForeColor(p,"black");n.fillRect(f.x+h+.5,f.y+r,dt,st);gt=g.startLine;gt&&(ht=e(at,a-y),ht>0&&(bt===0&&(r=r+st-y),r>=v.y&&r<c.y+c.height&&(n.fillStyle=u.getThemeForeColor(p,"black"),n.fillRect(f.x+h+.5,f.y+r,ht,y))))}if(it=l._groupButtonInfos,ct=it&&it.length,ct>0)for(s=0;s<ct;s++)(w=it[s],o=d.findRow(w.index),!o||o&&o.height<=0)||(k=i(0,(o.height-a)/2),h=w.level*a+vt,r=o.y+k,rt=a,b=e(a,o.height),n.strokeStyle="gray",n.lineWidth=1,n.strokeRect(f.x+h+.5,f.y+r,rt,b),w.isExpanded||n.fillRect(f.x+h+rt/2-1+.5,f.y+r+4,2,b-8),n.fillRect(f.x+h+4+.5,f.y+r+b/2-1,rt-8,2),ni=w.paintLine,ni&&b<o.height&&(h=w.level*a+ut,r=o.y,ti=y,lt=k,w.lineDirection===0&&(r+=k+b,lt=o.height-b-k),n.fillStyle=u.getThemeForeColor(p,"black"),n.fillRect(f.x+h+.5,f.y+r,ti,lt)));n.stroke();n.beginPath();n.restore()}}},r.prototype._paintColumnGroups=function(n){var l=this,ti=l._maxLevel,ut,at,ft,vt,yt,et,bt,kt,ot,st,dt,w,k,b,it,gt,ht,ni;if(ti!==-1){var p=l._sheet,f=p._getGroupLayout(),a=l._calcMinWidthOrHeight({width:f.width,height:f.height},!1);if(a!==0){var ct=l.STARTLINE_SIZE,lt=l.PADDING,y=l.LINE_SIZE,rt=i(0,(a-ct)/2)+lt,r,h,s,o,d=p._getColumnLayout(l._viewportIndex,3);for(n.save(),ut=l._groupDotInfos,at=ut.length,s=0;s<at;s++)ft=ut[s],o=d.findCol(ft.index),o&&o.width>=y&&(r=o.x+i(0,(o.width-y)/2),h=ft.level*a+rt,vt=y,yt=y,n.fillStyle=u.getThemeForeColor(p,"black"),n.fillRect(f.x+r,f.y+h+.5,vt,yt));var pt=p.colRangeGroup.direction,wt=l._groupLineInfos,ii=wt.length;for(s=0;s<ii;s++){var g=wt[s],nt=g.start,tt=g.end,v=t,c=t;do v=d.findCol(nt),nt++;while(!v&&nt<=tt);do c=d.findCol(tt),tt--;while(!c&&tt>=nt);if(v||c)!v&&c?v=c:v&&!c&&(c=v);else continue;r=v.x;pt===1&&(r+=1);h=g.level*a+rt;et=i(0,c.x+c.width-v.x);bt=y;n.fillStyle=u.getThemeForeColor(p,"black");n.fillRect(f.x+r,f.y+h+.5,et,bt);kt=g.startLine;kt&&(ot=e(ct,a-y),ot>0&&(pt===0&&(r=r+et-y),r>=v.x&&r<c.x+c.width&&(n.fillStyle=u.getThemeForeColor(p,"black"),n.fillRect(f.x+r,f.y+h+.5,y,ot))))}for(st=l._groupButtonInfos,dt=st.length,s=0;s<dt;s++)(w=st[s],o=d.findCol(w.index),!o||o&&o.width<=0)||(k=i(0,(o.width-a)/2),r=o.x+k,h=w.level*a+lt,b=e(a,o.width),it=a,n.strokeStyle="gray",n.lineWidth=1,n.strokeRect(f.x+r,f.y+h+.5,b,it),w.isExpanded||n.fillRect(f.x+r+b/2-1,f.y+h+4.5,2,it-8),n.fillRect(f.x+r+4,f.y+h+it/2-.5,b-8,2),gt=w.paintLine,gt&&b<o.width&&(r=o.x,h=w.level*a+rt,ht=k,ni=y,w.lineDirection===0&&(r+=k+b,ht=o.width-b-k),n.fillStyle=u.getThemeForeColor(p,"black"),n.fillRect(f.x+r,f.y+h+.5,ht,ni)));n.beginPath();n.restore()}}},r.prototype.getRowOrColumnStartIndex=function(n){var u=this._sheet,f=this._viewportIndex,t,o,r,s;if(n){if(t=u._getRowLayout(f),t&&t.length>0)return o=t[0].row,i(0,o-1)}else if(r=u._getColumnLayout(f),r&&r.length>0)return s=r[0].col,e(0,s-1);return-1},r.prototype.getRowOrColumnCount=function(n){var r=this._sheet,u=this._viewportIndex,t,f,i,o;if(n){if(t=r._getRowLayout(u),t&&t.length>0)return f=t[t.length-1].row,e(r.getRowCount(),f+2)}else if(i=r._getColumnLayout(u),i&&i.length>0)return o=i[i.length-1].col,e(r.getColumnCount(),o+2);return-1},r.prototype.getGroupsByLevel=function(n,t){for(var i=this,f=[],r=i.getRowOrColumnStartIndex(t),e=i.getRowOrColumnCount(t),o=t?i._sheet.rowRangeGroup:i._sheet.colRangeGroup,u;r<e;)u=o.find(r,n),u?(r=u.end+1,f.push(u)):r++;return f},r.prototype.getGroupDirection=function(n){return n?this._sheet.rowRangeGroup.direction:this._sheet.colRangeGroup.direction},r.prototype.getViewportStartIndex=function(n){var r=this._sheet,u=this._viewportIndex,t,i;if(n){if(t=r._getRowLayout(u),t&&t.length>0)return t[0].row}else if(i=r._getColumnLayout(u),i&&i.length>0)return i[0].col;return-1},r.prototype.getViewportEndIndex=function(n){var r=this._sheet,u=this._viewportIndex,t,i;if(n){if(t=r._getRowLayout(u),t&&t.length>0)return t[t.length-1].row}else if(i=r._getColumnLayout(u),i&&i.length>0)return i[i.length-1].col;return-1},r.prototype._processTouch=function(n){n&&this._sheet._isTouchMode&&(n.x-=2,n.y-=2,n.width+=4,n.height+=4)},r.prototype.getRowGroupButton=function(r,u){var f=this,g=f._maxLevel,c,l,o,b;if(g===-1)return t;var v=f._sheet,s=v._getGroupLayout(),h=f._calcMinWidthOrHeight({width:s.width,height:s.height},!0);if(h===0)return t;var y,p,nt=v._getRowLayout(f._viewportIndex,3),a=f._groupButtonInfos,w=a&&a.length;if(w>0)for(c=0;c<w;c++)if(l=a[c],o=nt.findRow(l.index),o&&(!o||!(o.height<=0))){b=i(0,(o.height-h)/2);y=l.level*h+f.PADDING;p=o.y+b;var k=h,tt=e(k,o.height),d=new n.Rect(s.x+y+.5,s.y+p+.5,k,tt);if(f._processTouch(d),d.contains(r,u))return l}return t},r.prototype.getColGroupButton=function(r,u){var f=this,g=f._maxLevel,c,l,o,b;if(g===-1)return t;var v=f._sheet,s=v._getGroupLayout(),h=f._calcMinWidthOrHeight({width:s.width,height:s.height},!1);if(h===0)return t;var y,p,nt=v._getColumnLayout(f._viewportIndex,3),a=f._groupButtonInfos,w=a&&a.length;if(w>0)for(c=0;c<w;c++)if(l=a[c],o=nt.findCol(l.index),o&&(!o||!(o.width<=0))){b=i(0,(o.width-h)/2);y=o.x+b;p=l.level*h+f.PADDING;var k=h,tt=e(k,o.width),d=new n.Rect(s.x+y+.5,s.y+p+.5,tt,k);if(f._processTouch(d),d.contains(r,u))return l}return t},r}();n._RangeGroupPresenter=v;y=function(){function r(n,i,r){var u=this;u._sheet=t;u._rowGroup=t;u._maxLevel=-1;u.PADDING=2;u._sheet=n;u._rowGroup=i;u._maxLevel=typeof r===h?i?n.rowRangeGroup.getMaxLevel():n.colRangeGroup.getMaxLevel():r}return r.prototype.paintGroupHeader=function(n){var h=this,o=h._sheet,k=h._maxLevel,b,y,p,s,f,c,l,a,v,w,r;if(o&&!(k<0)){var d=h._rowGroup,t=o._getGroupLayout(),e=h._calcMinWidthOrHeight({width:t.width,height:t.height},d);if(e!==0)if(b=k+2,r=o._getSheetLayout(),n.fillStyle=u.getThemeBackgroundColor(o,"#D7E6F7"),n.strokeStyle="gray",n.font="8.25pt Arial",n.lineWidth=1,d){if(n.fillRect(t.x,t.y,t.width,r.height),n.strokeRect(t.x-.5,t.y-.5,t.width,r.height+1),n.strokeRect(t.x-.5,r.headerY-.5,t.width,r.colHeaderHeight),n.fillStyle=u.getThemeForeColor(o,"black"),o.colHeaderVisible&&r.colHeaderHeight>=e)for(y=h.PADDING,p=i(0,r.headerY+(r.colHeaderHeight-e)/2),s=0;s<b;s++)f=e-1,c=t.x+y+.5,l=t.y+p,n.strokeRect(c,l,f,f),a=""+(s+1),v=n.measureText(a).width,w=o._getFontHeight(n.font),f>=v&&e>=w&&(n.textBaseline="middle",n.fillText(a,c+(f-v)/2,l+f/2)),y+=e}else if(n.fillRect(t.x,t.y,r.width,t.height),n.strokeRect(t.x-.5,t.y-.5,r.width+1,t.height),n.strokeRect(r.headerX-.5,t.y-.5,r.rowHeaderWidth,t.height),n.fillStyle=u.getThemeForeColor(o,"black"),o.rowHeaderVisible&&r.rowHeaderWidth>=e)for(y=i(0,r.headerX+(r.rowHeaderWidth-e)/2),p=h.PADDING,s=0;s<b;s++)f=e-1,c=t.x+y,l=t.y+p+.5,n.strokeRect(c,l,f,f),a=""+(s+1),v=n.measureText(a).width,w=o._getFontHeight(n.font),f>=v&&e>=w&&(n.textBaseline="middle",n.fillText(a,c+(f-v)/2,l+f/2)),p+=e}},r.prototype.getGroupButton=function(r,u){var s=this,c=s._sheet,p=s._maxLevel,y,l,a,e,v,o;if(!c||p<0)return t;var w=s._rowGroup,h=c._getGroupLayout(),f=s._calcMinWidthOrHeight({width:h.width,height:h.height},w);if(f===0)return t;if(y=p+2,o=c._getSheetLayout(),w){if(c.colHeaderVisible&&o.colHeaderHeight>=f)for(l=s.PADDING,a=i(0,o.headerY+(o.colHeaderHeight-f)/2),e=0;e<y;e++){if(v=new n.Rect(h.x+l,h.y+a,f,f),v.contains(r,u))return{index:e};l+=f}}else if(c.rowHeaderVisible&&o.rowHeaderWidth>=f)for(l=i(0,o.headerX+(o.rowHeaderWidth-f)/2),a=s.PADDING,e=0;e<y;e++){if(v=new n.Rect(h.x+l,h.y+a,f,f),v.contains(r,u))return{index:e};a+=f}return t},r.prototype._calcMinWidthOrHeight=function(n,t){var r=0,u=this._maxLevel;return r=t?(n.width-this.PADDING*2)/(u+2):(n.height-this.PADDING*2)/(u+2),i(0,r)},r}();n._RangeGroupHeaderPresenter=y})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){(function(n){function u(n,t,i,r,u){if(n)return u?u.call(t,t[i]):t[i];var f=t[i];return t[i]=r,u&&u.call(t,f!==r),t}function d(t,i){if(i&&t){var r=n._ThemeContext.getColor(i,t);if(r)return r}return t}function rt(n,t){return t===1?n.colCount:n.rowCount}function ut(n,t,i,r){return r===1?n.getValue(i.row,i.col+t):n.getValue(i.row+t,i.col)}function ft(n,t,i,r){return r===1?n.getColumnWidth(i.col+t)<=0||n.getRowHeight(i.row)<=0:n.getRowHeight(i.row+t)<=0||n.getColumnWidth(i.col)<=0}var g,nt,a,tt,it,s,h,v,c,p,w;n.feature("sparkline",["core.common","core.theme","core.sheet_model"]);var t=null,r=undefined,b=Math.min,o=Math.floor,l=Math.max,y=Math.abs,k=Math.PI,i="undefined",f={Black:"black",Blue:"Blue",Brown:"Brown"},e={FromArgb:function(t,i,r,u){return new n._Color(t,i,r,u).toString()}};n.__invalidValuePlaceHolder={},function(n){n[n.Gaps=0]="Gaps";n[n.Zero=1]="Zero";n[n.Connect=2]="Connect"}(n.EmptyValueStyle||(n.EmptyValueStyle={}));g=n.EmptyValueStyle,function(n){n[n.individual=0]="individual";n[n.group=1]="group";n[n.custom=2]="custom"}(n.SparklineAxisMinMax||(n.SparklineAxisMinMax={}));nt=n.SparklineAxisMinMax;a=function(){function n(n){var i=this,r;if(n)for(r in n)r&&(i[r]=n[r]);else i._axisColor=f.Black,i._firstMarkerColor=e.FromArgb(255,149,179,215),i._highMarkerColor=f.Blue,i._lastMarkerColor=e.FromArgb(255,149,179,215),i._lowMarkerColor=f.Blue,i._markersColor=e.FromArgb(255,36,64,98),i._negativeColor=f.Brown,i._seriesColor=e.FromArgb(255,36,64,98),i.displayEmptyCellsAs=0,i.rightToLeft=!1,i.displayHidden=!1,i.displayXAxis=!1,i._showFirst=!1,i._showHigh=!1,i._showLast=!1,i._showLow=!1,i._showNegative=!1,i._showMarkers=!1,i.manualMax=0,i.manualMin=0,i.maxAxisType=0,i.minAxisType=0,i.groupMaxValue=0,i.groupMinValue=0,i.lineWeight=1;i._worksheet=t}return n.prototype.axisColor=function(n){return u(arguments.length===0,this,"_axisColor",n)},n.prototype.firstMarkerColor=function(n){return u(arguments.length===0,this,"_firstMarkerColor",n)},n.prototype.highMarkerColor=function(n){return u(arguments.length===0,this,"_highMarkerColor",n)},n.prototype.lastMarkerColor=function(n){return u(arguments.length===0,this,"_lastMarkerColor",n)},n.prototype.lowMarkerColor=function(n){return u(arguments.length===0,this,"_lowMarkerColor",n)},n.prototype.markersColor=function(n){return u(arguments.length===0,this,"_markersColor",n)},n.prototype.negativeColor=function(n){return u(arguments.length===0,this,"_negativeColor",n)},n.prototype.seriesColor=function(n){return u(arguments.length===0,this,"_seriesColor",n)},n.prototype.showFirst=function(n){return u(arguments.length===0,this,"_showFirst",n)},n.prototype.showHigh=function(n){return u(arguments.length===0,this,"_showHigh",n)},n.prototype.showLast=function(n){return u(arguments.length===0,this,"_showLast",n)},n.prototype.showLow=function(n){return u(arguments.length===0,this,"_showLow",n)},n.prototype.showNegative=function(n){return u(arguments.length===0,this,"_showNegative",n)},n.prototype.showMarkers=function(n){return u(arguments.length===0,this,"_showMarkers",n)},n.prototype.clone=function(){var i=this,t=new n;return t._axisColor=i._axisColor,t._firstMarkerColor=i._firstMarkerColor,t._highMarkerColor=i._highMarkerColor,t._lastMarkerColor=i._lastMarkerColor,t._lowMarkerColor=i._lowMarkerColor,t._markersColor=i._markersColor,t._negativeColor=i._negativeColor,t._seriesColor=i._seriesColor,t.displayEmptyCellsAs=i.displayEmptyCellsAs,t.rightToLeft=i.rightToLeft,t.displayHidden=i.displayHidden,t.displayXAxis=i.displayXAxis,t._showFirst=i._showFirst,t._showHigh=i._showHigh,t._showLast=i._showLast,t._showLow=i._showLow,t._showNegative=i._showNegative,t._showMarkers=i._showMarkers,t.manualMax=i.manualMax,t.manualMin=i.manualMin,t.maxAxisType=i.maxAxisType,t.minAxisType=i.minAxisType,t.groupMaxValue=i.groupMaxValue,t.groupMinValue=i.groupMinValue,t.lineWeight=i.lineWeight,t},n.prototype._setThemeContext=function(n){this._worksheet=n},n.prototype._getActualColor=function(n){var i=this._worksheet;return i?d(this[n](),i):t},n.prototype._isDefaultValue=function(n,t){switch(n){case"axisColor":return t===f.Black;case"firstMarkerColor":return t===e.FromArgb(255,149,179,215);case"highMarkerColor":return t===f.Blue;case"lastMarkerColor":return t===e.FromArgb(255,149,179,215);case"lowMarkerColor":return t===f.Blue;case"markersColor":return t===e.FromArgb(255,36,64,98);case"negativeColor":return t===f.Brown;case"seriesColor":return t===e.FromArgb(255,36,64,98);case"displayEmptyCellsAs":return t===0;case"rightToLeft":return t===!1;case"displayHidden":return t===!1;case"displayXAxis":return t===!1;case"showFirst":return t===!1;case"showHigh":return t===!1;case"showLast":return t===!1;case"showLow":return t===!1;case"showNegative":return t===!1;case"showMarkers":return t===!1;case"manualMax":return t===0;case"manualMin":return t===0;case"maxAxisType":return t===0;case"minAxisType":return t===0;case"groupMaxValue":return t===0;case"groupMinValue":return t===0;case"lineWeight":return t===1;default:return!1}},n.prototype.toJSON=function(){var n=this,f={axisColor:n._axisColor,firstMarkerColor:n._firstMarkerColor,highMarkerColor:n._highMarkerColor,lastMarkerColor:n._lastMarkerColor,lowMarkerColor:n._lowMarkerColor,markersColor:n._markersColor,negativeColor:n._negativeColor,seriesColor:n._seriesColor,displayEmptyCellsAs:n.displayEmptyCellsAs,rightToLeft:n.rightToLeft,displayHidden:n.displayHidden,displayXAxis:n.displayXAxis,showFirst:n._showFirst,showHigh:n._showHigh,showLast:n._showLast,showLow:n._showLow,showNegative:n._showNegative,showMarkers:n._showMarkers,manualMax:n.manualMax,manualMin:n.manualMin,maxAxisType:n.maxAxisType,minAxisType:n.minAxisType,groupMaxValue:n.groupMaxValue,groupMinValue:n.groupMinValue,lineWeight:n.lineWeight},i={},t,u;for(t in f)u=f[t],n._isDefaultValue(t,u)||(i[t]=u);return $.isEmptyObject(i)?r:i},n}();n.SparklineSetting=a,function(n){n[n.line=0]="line";n[n.column=1]="column";n[n.winloss=2]="winloss"}(n.SparklineType||(n.SparklineType={}));tt=n.SparklineType,function(n){n[n.Vertical=0]="Vertical";n[n.Horizontal=1]="Horizontal"}(n.DataOrientation||(n.DataOrientation={}));it=n.DataOrientation;s=function(){function i(n,i){var r=this;r.displayDateAxis=!1;r._sparklineGroupManager=t;r._innerList=[];r._axisReference=t;r._axisOrientation=1;r.setting=i;r.sparklineType=n}return i.prototype.add=function(n){var t=this;n&&(t._innerList.push(n),n.group(t),t._adjustGroupMaxMinValue(),t.onGroupChanged())},i.prototype.remove=function(n){var t=this,i=t._innerList.remove(n);return n.onSparklineChanged(),n._group=t.clone(),t._adjustGroupMaxMinValue(),t.onGroupChanged(),i},i.prototype.contains=function(n){return this._innerList.contains(n)},i.prototype.onGroupChanged=function(){var n,t;if(this._innerList)for(n=0;n<this._innerList.length;n++)t=this._innerList[n],t&&t.onSparklineChanged()},i.prototype.clone=function(){var n=this,u=n.setting?n.setting.clone():t,r=new i(n.sparklineType,u);return r.displayDateAxis=n.displayDateAxis,r._axisReference=n._axisReference,r._axisOrientation=n._axisOrientation,r},i.prototype.dateAxisData=function(n){return arguments.length===0?u(!0,this,"_axisReference",n):u(!1,this,"_axisReference",n,function(n){n&&this.onGroupChanged()})},i.prototype.dateAxisOrientation=function(n){return arguments.length===0?u(!0,this,"_axisOrientation",n):u(!1,this,"_axisOrientation",n,function(n){n&&this.onGroupChanged()})},i.prototype.count=function(){return this._innerList.length},i.prototype._adjustGroupMaxMinValue=function(){var n=this,t;if(n.setting){n.setting.groupMaxValue=-Number.MAX_VALUE;n.setting.groupMinValue=Number.MAX_VALUE;var r=n.setting.maxAxisType===1,u=n.setting.minAxisType===1,i=!1;if(r||u)for(t=0;t<n._innerList.length;t++){var s=n._innerList[t],f=n._getMaxMinValues(s),e=f.min,o=f.max;r&&n.setting.groupMaxValue<o&&(n.setting.groupMaxValue=o,i=!0);u&&n.setting.groupMinValue>e&&(n.setting.groupMinValue=e,i=!0)}return i}},i.prototype._getMaxMinValues=function(t){var u=-Number.MAX_VALUE,f=Number.MAX_VALUE,s=t.data(),o,e,i,r;if(s)for(o=t._provideValues(s,t.dataOrientation(),!1),e=0;e<o.length;e++)i=o[e],i===n.__invalidValuePlaceHolder&&(i=0),typeof i=="number"&&(r=i,u=u<r?r:u,f=f>r?r:f);return{min:f,max:u}},i.prototype._isDefaultValue=function(n,i){switch(n){case"setting":return i===t;case"displayDateAxis":return i===!1;case"axisReference":return i===t;case"axisOrientation":return i===1;case"sparklines":return i.length===0;default:return!1}},i.prototype.toJSON=function(){var n=this,e={setting:n.setting?n.setting.toJSON():t,displayDateAxis:n.displayDateAxis,sparklineType:n.sparklineType,axisReference:n._axisReference,axisOrientation:n._axisOrientation,sparklines:n._innerList},u={},i,f;for(i in e)f=e[i],n._isDefaultValue(i,f)||(u[i]=f);return $.isEmptyObject(u)?r:u},i.prototype.fromJSON=function(n){var i,f,u,o,s,l,e,h;if(n){if(i=this,n.setting){i.setting=new a;f=n.setting;for(u in i.setting)i.setting.hasOwnProperty(u)&&(f.hasOwnProperty(u)?i.setting[u]=f[u]:u.substr(0,1)==="_"&&(o=u.substr(1),f.hasOwnProperty(o)&&(i.setting[u]=f[o])))}if(n.displayDateAxis!==r&&n.displayDateAxis!==t&&(i.displayDateAxis=n.displayDateAxis),n.sparklineType!==r&&n.sparklineType!==t&&(i.sparklineType=n.sparklineType),n.axisReference!==r&&n.axisReference!==t&&(i._axisReference=n.axisReference),n.axisOrientation!==r&&n.axisOrientation!==t&&(i._axisOrientation=n.axisOrientation),n.sparklines)for(i._innerList=[],s=n.sparklines,l=s.length,e=0;e<l;e++)h=new c,h.fromJSON(s[e]),i.add(h)}},i}();n.SparklineGroup=s;h=function(){function n(n,t,i,r){var u=this;u.X=n;u.Y=t;u.Width=i;u.Height=r;u.Left=u.X;u.Right=u.Left+u.Width;u.Top=u.Y;u.Bottom=u.Y+u.Height}return n}();n._PositionRect=h;v=function(){function f(n){this._minItemHeight=2;this.info=n;this._clearCache()}return f.prototype.sparklineInfo=function(n){return u(arguments.length===0,this,"info")},f.prototype.paint=function(n,t,i,r,u){var f=this;f._clearCache();var e=f._getWorksheet(),o=f.info,s=f._getCachedValues(),h=o.dateAxisData()?f._getCachedDatetimes():[],c=e._zoomFactor;o.setting()._setThemeContext(e);f._paintCore(n,t,i,r,u,s,h,c)},f.prototype._paintCore=function(n,t,i,r,u,f,e,o){n.save();n.rect(t,i,r,u);n.clip();n.beginPath();var s=this;s.info.sparklineType()===0&&s._paintLines(n,t,i,r,u,f,e,o);s._paintDataPoints(n,t,i,r,u,f,e,o);s._paintAxis(n,t,i,r,u,f,e,o);n.restore()},f.prototype._clearCache=function(){var n=this;n._cachedMinDatetime=Number.MAX_VALUE;n._cachedMaxDatetime=-Number.MAX_VALUE;n._cachedMinValue=Number.MAX_VALUE;n._cachedMaxValue=-Number.MAX_VALUE;n._cachedIndexMapping=t;n._cachedValues=t;n._cachedDatetimes=t},f.prototype._getWorksheet=function(){var n=this.info,t=n&&n.group(),i=t&&t._sparklineGroupManager;if(i)return i._sheet},f.prototype._getSpace=function(n,t){return this.info.sparklineType()===0?3+this._getLineWeight(t)+1:3},f.prototype._leftSpace=function(n){return this._getSpace("left",n)},f.prototype._rightSpace=function(n){return this._getSpace("right",n)},f.prototype._topSpace=function(n){return this._getSpace("top",n)},f.prototype._bottomSpace=function(n){return this._getSpace("bottom",n)},f.prototype._getCachedValues=function(){var n=this._cachedValues;if(!n){var t=this.info,i=t.data(),r=t.dataOrientation();n=this._cachedValues=t._provideValues(i,r)}return n},f.prototype._getCachedDatetimes=function(){var n=this._cachedDatetimes;if(!n){var t=this.info,i=t.group(),r=i.dateAxisData(),u=i.dateAxisOrientation();n=this._cachedDatetimes=t._provideValues(r,u,!0)}return n},f.prototype._getCachedIndexMaping=function(u,f){var s=this._cachedIndexMapping,l,v,o,e,p,h,c;if(s)return s;if(s=this._cachedIndexMapping=[],l=n.__invalidValuePlaceHolder,v=u.length,this.sparklineInfo().displayDateAxis()){var w=f.length,y=b(v,w),a=[];for(y>0&&(a=f.slice(0,y)),a.sort(function(n,t){return n===t?0:(n===l&&(n=0),t===l&&(t=0),n-t)}),p=a.length,o=0;o<p;o++)if(h=a[o],typeof h!==i&&h!==t){for(c=f.indexOf(h);s.contains(c);)c=f.indexOf(h,c+1);isNaN(h)||(e=u[c],e!==r&&e!==t&&isNaN(e)&&e!==l||s.push(c))}}else for(o=0;o<v;o++)e=u[o],typeof e!==i&&e!==t&&isNaN(e)&&e!==l||s.push(o);return s},f.prototype._getValue=function(r,u){var f=u[r];return typeof f===i||f===t?this.sparklineInfo().setting().displayEmptyCellsAs===1&&(f=0):f===n.__invalidValuePlaceHolder&&(f=0),f},f.prototype._paintLines=function(n,r,u,f,e,o,s,h){var l=this,y=l._getCachedIndexMaping(o,s),c,p,w,k=y.length-1,d,it,a,v,g,rt,ut,nt,b,ft,tt;for(k<0&&(k=0),d=l.linePos=[],ut=l.sparklineInfo().setting().displayEmptyCellsAs,c=0;c<k;c++)if(it=l._getValue(y[c],o),typeof it!==i&&it!==t){if(v=c+1,a=l._getValue(y[v],o),typeof a===i||a===t)if(ut===1)a=0;else if(ut===2)for(v=c+2;v<=k;v++)if(nt=o[y[v]],typeof nt!==i&&nt!==t){a=nt;break}typeof a!==i&&a!==t?(g=l._getDataPointPosition(y[c],{Width:f,Height:e},o,s,h),rt=l._getDataPointPosition(y[v],{Width:f,Height:e},o,s,h),b=g.Width/2,p={X:g.X+b,Y:g.Y+b},w={X:rt.X+b,Y:rt.Y+b},d[c]={P1:p,P2:w}):c++}if(ft=d.length,ft>0)for(n.strokeStyle=l.info.setting()._getActualColor("seriesColor"),n.lineCap="round",n.lineWidth=l._getLineWeight(h),c=0;c<ft;c++)(tt=d[c],tt)&&(n.beginPath(),p=tt.P1,w=tt.P2,n.moveTo(r+p.X,u+p.Y),n.lineTo(r+w.X,u+w.Y),n.stroke(),n.closePath())},f.prototype._getDataPointColor=function(n,u,f){var s=this,e=t,nt=Number.MAX_VALUE,tt=-Number.MAX_VALUE,h=s._getValue(n,u),o=s.info.setting(),a=s._cachedMinValue,v=s._cachedMaxValue,l=s._getCachedIndexMaping(u,f),y=l.length,p=s.info,w=p.group(),b,k,d,g,c;return typeof h!==i&&h!==t&&((a===Number.MAX_VALUE||v===-Number.MAX_VALUE)&&s._getMaxMinValue(u),b=a,h===b&&o.showLow()&&(e=o._getActualColor("lowMarkerColor")),(typeof e===i||e===t)&&(k=v,h===k&&o.showHigh()&&(e=o._getActualColor("highMarkerColor"))),(typeof e===i||e===t)&&(w.displayDateAxis?(d=l.indexOf(n),d===0&&o.showFirst()&&(e=o._getActualColor("firstMarkerColor"))):n===0&&o.showFirst()&&(e=o._getActualColor("firstMarkerColor"))),(typeof e===i||e===t)&&(w.displayDateAxis?(g=l.indexOf(n),g===y-1&&o.showLast()&&(e=o._getActualColor("lastMarkerColor"))):n===y-1&&o.showLast()&&(e=o._getActualColor("lastMarkerColor"))),(typeof e===i||e===t)&&h<0&&o.showNegative()&&(e=o._getActualColor("negativeColor")),(typeof e===i||e===t)&&(c=p.sparklineType(),c===0?o.showMarkers()&&(e=o._getActualColor("markersColor")):c===1?e=o._getActualColor("seriesColor"):c===2&&(e=o._getActualColor("seriesColor")))),e===r||e===t?"Transparent":e},f.prototype._paintDataPoints=function(n,t,i,r,u,f,e,s){for(var c=this,tt={Width:r,Height:u},p=c._getCachedIndexMaping(f,e),it=p.length,rt=c.info.sparklineType(),a,v,h,w,b,l,d,g,nt,y=0;y<it;y++)a=p[y],v=c._getDataPointColor(a,f,e),h=c._getDataPointPosition(a,tt,f,e,s),n.fillStyle!==v&&(n.fillStyle=v),rt===0?(n.save(),w=t+h.X+h.Width/2,b=i+h.Y+h.Height/2,n.translate(w,b),n.rotate(k/4),n.fillRect(0-h.Width/2,0-h.Height/2,h.Width,h.Height),n.restore()):(l=t+h.X+h.Width/4,l=o(l),d=i+h.Y,g=h.Width/2,nt=h.Height,n.fillRect(l,d,g,nt))},f.prototype._paintAxis=function(n,t,i,r,u,f,e,s){var h=this,l=h.info.setting();if(l.displayXAxis&&h._hasAxis(f,e)){var a={Width:r,Height:u},p=h._leftSpace(s),w=a.Width-h._rightSpace(s),v=o(h._getAxisY(a,f,s))+.5,b=v,y=l._getActualColor("axisColor"),c=s;c<1&&(c=1);n.strokeStyle!==y&&(n.strokeStyle=y);n.lineWidth!==c&&(n.lineWidth=c);n.beginPath();n.moveTo(t+p,i+v);n.lineTo(t+w,i+b);n.stroke()}},f.prototype._hasAxisNormal=function(n){var i=this._getActualMaxValue(n),t;return i!==-Number.MAX_VALUE&&(t=this._getActualMinValue(n),t!==Number.MAX_VALUE)?i===t||i*t<=0:!0},f.prototype._hasAxis=function(n,r){var f=this._hasAxisNormal(n),e,o,h,s,u;if(this.info.sparklineType()!==2)return f;if(e=this._getCachedIndexMaping(n,r),o=e.length,!f&&o>0)for(u=0;u<o;u++)if(h=e[u],s=n[h],typeof s!==i&&s!==t)return!0;return f},f.prototype._getMinDatetime=function(n,t){var i=this._cachedMinDatetime;return(isNaN(i)||i===Number.MAX_VALUE)&&this._getMaxMindatetimes(n,t),this._cachedMinDatetime},f.prototype._getMaxDatetime=function(n,t){var i=this._cachedMaxDatetime;return(isNaN(i)||i===-Number.MAX_VALUE)&&this._getMaxMindatetimes(n,t),this._cachedMaxDatetime},f.prototype._getMaxMindatetimes=function(n,r){for(var f=this,o=new Date(0,0,0),s=Number.MAX_VALUE,l=f._getCachedIndexMaping(n,r),a=l.length,h,u,e,c=0;c<a;c++)(h=l[c],u=r[h],isNaN(u))||(e=f._getValue(h,n),e!==t&&typeof e===i||isNaN(e))||typeof u!==i&&u!==t&&(u>o&&(o=u),u<s&&(s=u));f._cachedMaxDatetime=o;f._cachedMinDatetime=s},f.prototype._calcItemWidth=function(n,r,u,f){for(var s=this,b=s._getMinDatetime(r,u),k=s._getMaxDatetime(r,u),h=[],e,y,p=s._getCachedIndexMaping(r,u),d=p.length,a,c,v,w,l,o=0;o<d;o++)(y=p[o],e=u[y],typeof e===i||e===t||isNaN(e))||e&&h.push(e);if(h.sort(function(n,t){return n-t}),a=h.length,a>1&&b!==k){for(c=Number.MAX_VALUE,v=0,o=1;o<a;o++)w=h[o],e=w-h[o-1],e<c&&e>0&&(c=e),v+=e;return l=(n.Width-s._leftSpace(f)-s._rightSpace(f))*c/v/2,l<2&&(l=2),l}else return(n.Width-s._leftSpace(f)-s._rightSpace(f))/2},f.prototype._getItemWidth=function(n,t,i,r){var u=this,f;return u.info.displayDateAxis()?u._calcItemWidth(n,t,i,r):(f=u._getCachedIndexMaping(t,i).length,(n.Width-u._leftSpace(r)-u._rightSpace(r))/f)},f.prototype._getItemX=function(n,t,i,r,u){var f=this,e,s=f._leftSpace(u),c,h,l,a,v,y,p;return f.sparklineInfo().displayDateAxis()?(e=f._getItemWidth(n,i,r,u),c=f._getMaxDatetime(i,r),h=f._getMinDatetime(i,r),c===h)?s+e/2:(l=r[t],!l)?0:(a=n.Width-s-f._rightSpace(u),a-=e,v=c-h,s+o((l-h)/v*a)):(e=f._getItemWidth(n,i,r,u),y=f._getCachedIndexMaping(i,r).indexOf(t),p=s+e*y,o(p))},f.prototype._getCanvasSize=function(n,t){var i=this,u=n.Width-i._leftSpace(t)-i._rightSpace(t),r;return u=l(u,0),r=n.Height-i._topSpace(t)-i._bottomSpace(t),r=l(r,0),{Width:u,Height:r}},f.prototype._getMaxMinValue=function(n){for(var u=this,e=n.length,r,f=0;f<e;f++)r=n[f],typeof r!==i&&r!==t&&(typeof r!="number"&&(r=0),r<u._cachedMinValue&&(u._cachedMinValue=r),r>u._cachedMaxValue&&(u._cachedMaxValue=r))},f.prototype._getActualMaxValue=function(n){var t=this,i,r;if(t._cachedMaxValue!==-Number.MAX_VALUE&&t._cachedMaxValue||t._getMaxMinValue(n),i=t.info.setting(),r=i.maxAxisType,r===0)return t._cachedMaxValue;else if(r===1)return i.groupMaxValue;else if(r===2)return i.manualMax;return t._cachedMaxValue},f.prototype._getActualMinValue=function(n){var t=this,i,r;if(t._cachedMinValue!==Number.MAX_VALUE&&t._cachedMinValue||t._getMaxMinValue(n),i=t.info.setting(),r=i.minAxisType,r===0)return t._cachedMinValue;else if(r===1)return i.groupMinValue;else if(r===2)return i.manualMin},f.prototype._getItemHeightNormal=function(n,t,i,r){var h=this._getCanvasSize(n,r),u=this._getActualMaxValue(i),e=this._getActualMinValue(i),o=u-e,f,s;if(u===e){if(u===0)return 0;o=y(u)}return f=i[t],f||(f=0),s=h.Height/o,f*s},f.prototype._getItemHeight=function(n,r,u,f){var o=this,l=o.info,h=l.sparklineType(),e,s,c;if(h===0)return o._getItemHeightNormal(n,r,u,f);else if(h===1){if(e=u[r],(typeof e===i||e===t)&&l.setting().displayEmptyCellsAs===1)return 0;if(s=o._getItemHeightNormal(n,r,u,f),s>-o._minItemHeight&&s<o._minItemHeight)if(e>0)return s+o._minItemHeight;else if(e<0)return s-o._minItemHeight;return s}else if(h===2)return(e=u[r],typeof e===i||e===t||e===0||isNaN(e))?0:(c=o._getCanvasSize(n,f),e>=0?c.Height/2:-c.Height/2)},f.prototype._getAxisYNormal=function(n,t,i){var u=this,s=u._getCanvasSize(n,i),r=u._getActualMaxValue(t),f=u._getActualMinValue(t),e,o;if(r===-Number.MAX_VALUE||f===Number.MAX_VALUE)return n.Height/2;if(e=r-f,r===f){if(r===0)return n.Height/2;e=r;r<0&&(r=0)}return o=s.Height/e,u._topSpace(i)+r*o},f.prototype._getAxisY=function(n,t,i){return this.info.sparklineType()===2?n.Height/2:this._getAxisYNormal(n,t,i)},f.prototype._getItemVisibleHeightNormal=function(n,r,u,f){var h=this,a=h._getCanvasSize(n,f),o=h._getActualMaxValue(u),s=h._getActualMinValue(u),l=o-s,c,e,v;if(o===s){if(o===0)return 0;l=o}return c=a.Height/l,e=h._getValue(r,u),(typeof e===i||e===t)&&(e=0),o!==s&&o*s>0?(v=0,e>=0?(e-s)*c:(e-o)*c):e*c},f.prototype._getItemVisibleHeight=function(n,r,u,f){var e=this,c=e.info.sparklineType(),o,h,s;if(c===0)return e._getItemVisibleHeightNormal(n,r,u,f);else if(c===1)return(o=e._getItemVisibleHeightNormal(n,r,u,f),h=e._minItemHeight,o>-h&&o<h&&(s=e._getValue(r,u),(typeof s===i||s===t)&&(s=0),s!==0))?s>0?o+h:o-h:o;else if(c===2)return e._getItemHeight(n,r,u,f)},f.prototype._getDataPointPositionNormal=function(n,t,i,r,u){var f=this,s=f._getItemWidth(t,i,r,u),k=f._getItemX(t,n,i,r,u),a,e,b,v;s<0&&(s=0);s=o(s);s%2==1&&(s+=1);var p=f._getItemHeight(t,n,i,u),w=f._getAxisY(t,i,u),d=f._getActualMaxValue(i),g=f._getActualMinValue(i),c=0;return d<0&&g<0?c=l(f._topSpace(u),w):(c=w,p>=0&&(c=w-p)),a=f._getItemVisibleHeight(t,n,i,u),e=new h(k,c,s,y(a)),p!==0&&(b=f._topSpace(u),e.Y<b&&e.Bottom<b+1?e.Height=o(e.Height+1):(v=t.Height-f._bottomSpace(u),e.Bottom>v&&e.Y>v-1&&(e.Y=v-a,e.Height=a))),e},f.prototype._getLineWeight=function(n){var t=this.info.setting().lineWeight*n;return t<1&&(t=1),t},f.prototype._getDataPointPosition=function(n,r,u,f,e){var c=this,s=c._getLineWeight(e),o,l;if(s++,s<2&&(s=2),o=c._getDataPointPositionNormal(n,r,u,f,e),c.info.sparklineType()===0&&(o.X=o.X+(o.Width-s)/2,l=c._getValue(n,u),typeof l!==i&&l!==t?(l>=0?o.Y-=s/2:o.Y=o.Bottom-s/2,o.Width=s,o.Height=s):(o.Width=0,o.Height=0)),c.info.group().setting.rightToLeft){var a=o.X,v=r.Width-a,y=v-o.Width;o=new h(y,o.Y,o.Width,o.Height)}return o},f}();n.SparklineRender=v;c=function(){function i(n,t,i,r,u,f){var e=this;e.row=n;e.column=t;e._dataOrientation=r;e._data=i;e._group=new s(u,f);e._group.add(e);e._renderer=new v(e)}return i.prototype.group=function(n){var t=this,i;return arguments.length===0?(i=t._group,i||(i=new s,i.add(t),t._group=i),i):(n!==t._group&&(t._group&&t._group.remove(t),t._group=n,t._group&&(t._group.contains(t)||t._group.add(t)),t.onSparklineChanged()),t)},i.prototype.sparklineType=function(n){var t=this;return arguments.length===0?t.group().sparklineType:(t.group().sparklineType!==n&&(t.group().sparklineType=n,t.onSparklineChanged()),t)},i.prototype.onSparklineChanged=function(){var t=this._getWorksheet(),i;t&&(i=this,t._trigger(n.Events.SparklineChanged,{sheet:t,sheetName:t._name,sparkline:i}))},i.prototype.setting=function(n){return arguments.length===0?this.group().setting:(this.group().setting=n,this)},i.prototype.data=function(n){var t=this;return arguments.length===0?t._data:(t._data!==n&&(t._data=n,t.onSparklineChanged()),t)},i.prototype.dataOrientation=function(n){var t=this;return arguments.length===0?t._dataOrientation:(t._dataOrientation!==n&&(t._dataOrientation=n,t.onSparklineChanged()),t)},i.prototype.dateAxisData=function(n){return arguments.length===0?this.group().dateAxisData():(this.group().dateAxisData(n),this)},i.prototype.dateAxisOrientation=function(n){return arguments.length===0?this.group().dateAxisOrientation():(this.group().dateAxisOrientation(n),this)},i.prototype.displayDateAxis=function(n){return arguments.length===0?this.group().displayDateAxis:(this.group().displayDateAxis=n,this)},i.prototype.clone=function(){var t=this,n=new i;return n.row=t.row,n.column=t.column,n.data(t.data()),n.dataOrientation(t.dataOrientation()),n.group(t.group().clone()),n},i.prototype.paintSparkline=function(n,t,i,r,u){this._renderer.paint(n,t,i,r,u)},i.prototype._provideValues=function(i,u,f){var s=this._getWorksheet(),h=[],c,o,e;if(!s)return h;for(c=rt(i,u),o=0;o<c;o++)e=ut(s,o,i,u),!this.setting().displayHidden&&ft(s,o,i,u)?e=NaN:e!==t&&e!==r&&(f?e=typeof e=="number"?n._DateTimeHelper.fromOADate(e):Date.parse(e):typeof e!="number"&&(e=n.__invalidValuePlaceHolder)),h.push(e);return h},i.prototype._getWorksheet=function(){return this.group()&&this.group()._sparklineGroupManager?this.group()._sparklineGroupManager._sheet:t},i.prototype._isDefaultValue=function(n,i){switch(n){case"axisReference":return i===t;case"axisOrientation":return i===1;default:return!1}},i.prototype.toJSON=function(){var n=this,r={row:n.row,col:n.column,orientation:n._dataOrientation,data:n._data,type:n._group.sparklineType,setting:n._group.setting,axisReference:n._group._axisReference,axisOrientation:n._group._axisOrientation},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},i.prototype.fromJSON=function(i){var u,f;i&&(u=this,i.row!==r&&i.row!==t&&(u.row=i.row),i.col!==r&&i.col!==t&&(u.column=i.col),i.orientation!==r&&i.orientation!==t&&(u._dataOrientation=i.orientation),i.data&&(f=i.data,u._data=new n.Range(f.row,f.col,f.rowCount,f.colCount)))},i}();n.Sparkline=c;p=function(){function i(n,t){this._groups=[];this._sheet=n;this.evaluator=t}return i.prototype.groups=function(n){return u(arguments.length===0,this,"_groups")},i.prototype.add=function(n){this.groups().push(n);n._sparklineGroupManager=this;n._adjustGroupMaxMinValue()},i.prototype.remove=function(n){this.groups().remove(n)},i.prototype.contains=function(n){return this.groups().contains(n)},i.prototype.count=function(){return this.groups().length},i.prototype._addRows=function(n,t){for(var i,o,f,r,s,u=this,e=0;e<u._groups.length;e++)for(i=u._groups[e],i.displayDateAxis&&(o=u._addRowRange(n,t,i.dateAxisData()),i.dateAxisData(o)),f=0;f<i._innerList.length;f++)r=i._innerList[f],n<=r.row&&(r.row+=t),s=u._addRowRange(n,t,r.data()),r.data(s)},i.prototype._addColumns=function(n,t){for(var i,o,f,r,s,u=this,e=0;e<u._groups.length;e++)for(i=u._groups[e],i.displayDateAxis&&(o=u._addColumnRange(n,t,i.dateAxisData()),i.dateAxisData(o)),f=0;f<i._innerList.length;f++)r=i._innerList[f],n<=r.column&&(r.column+=t),s=u._addColumnRange(n,t,r.data()),r.data(s)},i.prototype._removeRows=function(n,i){for(var u,s,o,h,f,c,e=this,l=0;l<e._groups.length;l++){if(u=e._groups[l],u.displayDateAxis)if(s=e._removeRowRange(n,i,u.dateAxisData()),s!==t&&s!==r)u.dateAxisData(s);else{u.clear();e.remove(u);continue}for(o=[],o=o.concat(u._innerList),h=0;h<o.length;h++)f=o[h],f.row>=n&&f.row<n+i?u.remove(f):(n<=f.row&&(f.row-=i),c=e._removeRowRange(n,i,f.data()),c!==t&&c!==r?f.data(c):u.remove(f));u.count()<=0&&e.remove(u)}},i.prototype._removeColumns=function(n,i){for(var u,s,o,h,f,c,e=this,l=0;l<e._groups.length;l++){if(u=e._groups[l],u.displayDateAxis)if(s=e._removeColumnRange(n,i,u.dateAxisData()),s!==t&&s!==r)u.dateAxisData(s);else{u.clear();e.remove(u);continue}for(o=[],o=o.concat(u._innerList),h=0;h<o.length;h++)f=o[h],f.column>=n&&f.column<n+i?u.remove(f):(n<=f.column&&(f.column-=i),c=e._removeColumnRange(n,i,f.data()),c!==t&&c!==r?f.data(c):u.remove(f));u.count()<=0&&e.remove(u)}},i.prototype.clear=function(n,i,r,u){var f=this,e,l,o,s,h,c;if(arguments.length===0){for(e=0;e<f._groups.length;e++)l=f._groups[e],l&&(l.SparklineGroupManager=t);f._groups.clear();return}for(o=n;o<n+r;o++)for(s=i;s<i+u;s++)h=f._find(o,s),h&&(c=h.group(),c.remove(h),c.count()===0&&f.remove(c))},i.prototype._find=function(n,i){for(var e,f,r,u=0;u<this._groups.length;u++)for(e=this._groups[u],f=0;f<e.count();f++)if(r=e[f],r&&r.row===n&&r.column===i)return r;return t},i.prototype._copy=function(i,u,f,e,o,s,h){var w=this,v=w._sheet,d,a,y,p;if(v){for(var g=new n._GcSheetModel(o,s,t),b=f-i,k=e-u,nt=v._getModel(),l,tt=v.getRowCount(),it=v.getColumnCount(),c=0;c<o;c++)if(!h||!v.isRowFilterOut(f+c))for(l=0;l<s;l++)d=nt.getSparkline(i+c,u+l),d&&(a=d.clone(),a.row=f+c,a.column=e+l,y=a.dateAxisData(),y!==t&&y!==r&&w._canOffset(y,b,k,tt,it)&&a.dateAxisData(y.offset(k,b)),p=a.data(),p!==r&&p!==t&&w._canOffset(p,b,k,tt,it)&&a.data(p.offset(k,b)),w.add(a.group()),g.setValue(c,l,a));for(c=0;c<o;c++)if(!h||!v.isRowFilterOut(f+c))for(l=0;l<s;l++)nt.setSparkline(f+c,e+l,g.getValue(c,l))}},i.prototype._canOffset=function(n,t,i,r,u){var f=this._getExpressionRange(n);if(f){var e=f.row<0?0:f.row,o=f.col<0?0:f.col,s=f.row<0?r:f.rowCount,h=f.col<0?u:f.colCount;return!(e+t<0||o+i<0||e+s+t>r||o+h+i>u)}return!1},i.prototype._move=function(i,r,u,f,e,o){var v=this._sheet,l,a,s,h,c;if(v){for(this._moveDataRange(i,r,u,f,e,o),l=v._getModel(),a=new n._GcSheetModel(e,o,t),s=0;s<e;s++)for(h=0;h<o;h++)c=l.getSparkline(i+s,r+h),c&&(c.row=u+s,c.column=f+h,a.setValue(s,h,c)),l.setSparkline(i+s,r+h,t);for(s=0;s<e;s++)for(h=0;h<o;h++)l.setSparkline(u+s,f+h,a.getValue(s,h))}},i.prototype._moveDataRange=function(t,i,r,u,f,e){var s=this,h=new n.Range(t,i,f,e),k=r-t,a,c,v,l,o,y,p,w,b;for(t,a=u-i,c=0;c<s._groups.length;c++)for(v=s._groups[c],l=0;l<v._innerList.length;l++)(o=v._innerList[l],o)&&(y=o.dateAxisData(),p=s._getExpressionRange(y),p&&h.containsRange(p)&&h.contains(o.row,o.column)&&o.dateAxisData(y.offset(a,k)),w=o.data(),b=s._getExpressionRange(w),b&&h.containsRange(b)&&h.contains(o.row,o.column)&&o.data(w.offset(a,k)))},i.prototype._getExpressionRange=function(n){return n},i.prototype._swap=function(n,t,i,r,u,f){},i.prototype._exCopy=function(n,i,u,f,e,o,s,h){var y=this,v=y._sheet,l,a,d,c,p,w;if(v){if(n===v){y._copy(i,u,f,e,o,s);return}var b=f-i,k=e-u,it=n._getModel(),g=v._getModel(),nt=v.getRowCount(),tt=v.getColumnCount();for(l=0;l<o;l++)if(!h||!v.isRowFilterOut(f+l))for(a=0;a<s;a++)d=it.getSparkline(i+l,u+a),d?(c=d.clone(),c.row=f+l,c.column=e+a,p=c.dateAxisData(),p!==r&&p!==t&&y._canOffset(p,b,k,nt,tt)&&c.dateAxisData(p.offset(k,b)),w=c.data(),w!==r&&w!==t&&y._canOffset(w,b,k,nt,tt)&&c.data(w.offset(k,b)),y.add(c.group()),g.setSparkline(f+l,e+a,c)):g.setSparkline(f+l,e+a,t)}},i.prototype._exMove=function(n,i,r,u,f,e,o){var a=this,v=a._sheet,y,p,s,h,c,l,w;if(v){if(n===v){a._move(i,r,u,f,e,o);return}for(y=n._getModel(),p=v._getModel(),a._exMoveDataRange(n,i,r,u,f,e,o),s=0;s<e;s++)for(h=0;h<o;h++)c=y.getSparkline(i+s,r+h),c?(c.row=u+s,c.column=f+h,l=c.group(),w=l.clone(),l.remove(c),l.length<=0&&n._sparklineGroupManager.remove(l),w.add(c),a.add(w),p.setSparkline(u+s,f+h,c)):p.setSparkline(u+s,f+h,t),y.setSparkline(i+s,r+h,t)}},i.prototype._exMoveDataRange=function(t,i,r,u,f,e,o){var h=this,k=h._sheet,l,p,a,s,v,w,y,b;if(t&&k){if(t===k){h._moveDataRange(i,r,u,f,e,o);return}var c=new n.Range(i,r,e,o),d=u-i,g=f-r;for(l=0;l<t._sparklineGroupManager._groups.length;l++)for(p=t._sparklineGroupManager._groups[l],a=0;a<p._innerList.length;a++)(s=p._innerList[a],s)&&(v=s.dateAxisData(),w=h._getExpressionRange(v),w&&h._sameSource(t,v)&&c.containsRange(w)&&c.contains(s.row,s.column)&&s.dateAxisData(v.offset(g,d)),y=s.data(),b=h._getExpressionRange(y),b&&h._sameSource(t,y)&&c.containsRange(b)&&c.contains(s.row,s.column)&&s.data(y.offset(g,d)))}},i.prototype._sameSource=function(n,t){return!0},i.prototype._addRowRange=function(i,r,u){return u?i>u.row+u.rowCount-1?u:i>u.row?new n.Range(u.row,u.col,u.rowCount+r,u.colCount):new n.Range(u.row+r,u.col,u.rowCount,u.colCount):t},i.prototype._addColumnRange=function(i,r,u){return u?i>u.col+u.colCount-1?u:i>u.col?new n.Range(u.row,u.col,u.rowCount,u.colCount+r):new n.Range(u.row,u.col+r,u.rowCount,u.colCount):t},i.prototype._removeColumnRange=function(i,r,u){var f=this._rangeSubCat(u.col,u.col+u.colCount-1,i,i+r-1);return f?new n.Range(u.row,f.start,u.rowCount,f.end-f.start+1):t},i.prototype._removeRowRange=function(i,r,u){var f=this._rangeSubCat(u.row,u.row+u.rowCount-1,i,i+r-1);return f?new n.Range(f.start,u.col,f.end-f.start+1,u.colCount):t},i.prototype._rangeSubCat=function(n,i,r,u){var f=-1,o,e,h,l,c,s;if(u<n)return h=u-r+1,f=n-h,o=i-h,{start:f,end:o};if(r>i)return f=n,o=i,{start:f,end:o};if(r<=n){for(l=i-n+1,c=0,e=n;e<=u;e++)if(e<=i)c++;else break;return f=r,o=f+l-c-1,{start:f,end:o}}for(s=0,e=n;e<=i;e++)f===-1&&(e<r||e>u)&&(f=e),(e<r||e>u)&&s++;return f!==-1&&s>0?(o=f+s-1,{start:f,end:o}):t},i.prototype._isDefaultValue=function(n,t){switch(n){case"groups":return!t||t.length===0;default:return!1}},i.prototype.toJSON=function(){var f={groups:this._groups?this._groups:t},i={},n,u;for(n in f)u=f[n],this._isDefaultValue(n,u)||(i[n]=u);return $.isEmptyObject(i)?r:i},i.prototype.fromJSON=function(n){var i,u,t,r;if(n&&n.groups)for(this._groups=[],i=n.groups,u=i.length,t=0;t<u;t++)r=new s,r.fromJSON(i[t]),this.add(r)},i}();n.WorksheetSparklineGroupManager=p;w=function(n){function t(){n.apply(this,arguments)}return __extends(t,n),t}(c);n.SparklineValue=w})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){(function(n){var rt,ut,ft,et,ot,h,v,y,st,ht,ct,lt,at,p,vt;n.feature("touch",["core.common","core.sheet_action","core.sheet_model","core.sheet_border"]);var t=null,f=undefined,i=Math.abs,b=Math.min,yt=Math.pow,k=Math.atan2,s=Math.PI,e=Math.round,w=Math.sqrt,d=Math.atan,u="undefined",pt=100,wt=function(){function i(){var n=this;n._elements=[];n._pressedPointers={length:0};n._checkPointerIntervalId=-1;n._manipulationProcessor=new bt;n._tapEventProcesser=new kt}return i.prototype.ManipulationStarting=function(n){var t=this._manipulationProcessor;t&&(t.ManipulationStarting=n)},i.prototype.ManipulationStarted=function(n){var t=this._manipulationProcessor;t&&(t.ManipulationStarted=n)},i.prototype.ManipulationCompleted=function(n){var t=this,i=t._manipulationProcessor;i&&(i.ManipulationCompleted=function(i){if(n){n(i);var r=t._touchMouseMessageFilter;r&&r.postProcessManipulationComplete()}})},i.prototype.ManipulationInertiaStarting=function(n){var t=this._manipulationProcessor;t&&(t.ManipulationInertiaStarting=n)},i.prototype.ManipulationDelta=function(n){var t=this._manipulationProcessor;t&&(t.ManipulationDelta=n)},i.prototype.Tapped=function(n){var t=this._tapEventProcesser;t&&(t.Tapped=n)},i.prototype.DoubleTapped=function(n){var t=this._tapEventProcesser;t&&(t.DoubleTapped=n)},i.prototype.RightTapped=function(n){var t=this._tapEventProcesser;t&&(t.RightTapped=n)},i.prototype.TouchOperatorStart=function(n){this.touchOperatorStart=n},i.prototype.TouchOperatorEnd=function(n){this.touchOperatorEnd=n},i.prototype._getOffsetRelativeToDownElement=function(n,t){var i={left:0,top:0},r,u,f;return r=t?t.element:this._downElement.element,n!==r&&(u=$(n).offset(),f=$(r).offset(),i.left=u.left-f.left,i.top=u.top-f.top),i},i.prototype.msPointerDown=function(t,i){var u,f,e,o;(i.pointerType===i.MSPOINTER_TYPE_TOUCH||i.pointerType==="touch")&&(u=this._getOffsetRelativeToDownElement(i.target,t),f=this._down(t,i.target,i.pointerId,new r(i.offsetX+u.left,i.offsetY+u.top),i.timeStamp),f&&n.util.cancelDefault(i),this._downElement.eventFlag==="sheet"&&(e=i.pageX-(i.offsetX+u.left),o=i.pageY-(i.offsetY+u.top),window.gcGlobal.canvasOffset={top:o,left:e}))},i.prototype.msPointerMove=function(t){if(t.pointerType===t.MSPOINTER_TYPE_TOUCH||t.pointerType==="touch"){if(this._pressedPointers[t.pointerId]===f)return!1;var i=this._getOffsetRelativeToDownElement(t.target),u=this._move(t.pointerId,new r(t.offsetX+i.left,t.offsetY+i.top),t.timeStamp);u&&n.util.cancelDefault(t)}},i.prototype.msPointerUp=function(t){if(t.pointerType===t.MSPOINTER_TYPE_TOUCH||t.pointerType==="touch"){if(this._pressedPointers[t.pointerId]===f)return!1;var i=this._getOffsetRelativeToDownElement(t.target),u=this._up(t.pointerId,new r(t.offsetX+i.left,t.offsetY+i.top));u&&n.util.cancelDefault(t)}},i.prototype.msPointerCancel=function(t){if(t.pointerType===t.MSPOINTER_TYPE_TOUCH||t.pointerType==="touch"){if(this._pressedPointers[t.pointerId]===f)return!1;var i=this._getOffsetRelativeToDownElement(t.target),u=this._cancel(t.pointerId,new r(t.offsetX+i.left,t.offsetY+i.top));u&&n.util.cancelDefault(t)}},i.prototype._getElementOffset=function(n){var t=$(n).offset();return t?(isNaN(document.body.clientTop)||(t.top+=document.body.clientTop),isNaN(document.body.clientLeft)||(t.left+=document.body.clientLeft)):t={top:0,left:0},t},i.prototype.touchStart=function(t,i){for(var u,s,o=this._getElementOffset(t.element),f=!1,e=0;e<i.changedTouches.length;e++)u=i.changedTouches[e],s=$.browser.mozilla?(new Date).valueOf():i.timeStamp,f=this._down(t,i.target,u.identifier,new r(u.pageX-o.left,u.pageY-o.top),s)||f;f&&n.util.cancelDefault(i)},i.prototype.touchMove=function(t){for(var i,o,e=this._getElementOffset(this._downElement.element),u=!1,f=0;f<t.changedTouches.length;f++)i=t.changedTouches[f],o=$.browser.mozilla?(new Date).valueOf():t.timeStamp,u=this._move(i.identifier,new r(i.pageX-e.left,i.pageY-e.top),o)||u;u&&n.util.cancelDefault(t)},i.prototype.touchEnd=function(t){for(var i,e=this._getElementOffset(this._downElement.element),u=!1,f=0;f<t.changedTouches.length;f++)i=t.changedTouches[f],u=this._up(i.identifier,new r(i.pageX-e.left,i.pageY-e.top))||u;u&&n.util.cancelDefault(t)},i.prototype.touchCancel=function(t){for(var i,e=this._getElementOffset(this._downElement.element),u=!1,f=0;f<t.changedTouches.length;f++)i=t.changedTouches[f],u=this._cancel(i.identifier,new r(i.pageX-e.left,i.pageY-e.top))||u;u&&n.util.cancelDefault(t)},i.prototype._startCheckPointer=function(){this._checkPointerIntervalId===-1&&(this._checkPointerIntervalId=setInterval(this._checkCancelPointer,200))},i.prototype._endCheckPointer=function(){this._checkPointerIntervalId!==-1&&(clearInterval(this._checkPointerIntervalId),this._checkPointerIntervalId=-1)},i.prototype._checkCancelPointer=function(){var i=this,u,t;if(!i._manipulationProcessor||i._manipulationProcessor._process!==3){var e=(new Date).valueOf(),n=[],r=i._pressedPointers,f=0;for(u in r)e-r[u].time>200&&n.push(r[u]),f++;for(t=0;t<n.length;t++)i._cancel(n[t].id,n[t].position),delete r[n[t].id];f===n.length&&i._endCheckPointer()}},i.prototype._fixPosition=function(n){var t=this,i,r;if(t._downElement===t._manipulationElement)return n;i=$(t._downElement.element).offset();r=$(t._manipulationElement.element).offset();n.X+=i.left-r.left;n.Y+=i.top-r.top},i.prototype._setCaptureElement=function(n,i){var r=this,h=r._elements,f,u;for(r._manipulationElement=t,r._touchMouseMessageFilter=t,f=0;f<h.length;f++)if(h[f]===n){var o=h[f],e=t,s=t;if(o.canDoManipulation&&!o.canDoManipulation()){for(f=0;f<h.length;f++)if(u=h[f],u!==o&&u.level>=0&&u.level<o.level&&(!u.canDoManipulation||u.canDoManipulation())){e=u;break}if(e===t)return!1}if(o.canDoTap&&!o.canDoTap()){for(f=0;f<h.length;f++)if(u=h[f],u!==o&&u.level>=0&&u.level<o.level&&(!u.canDoTap||u.canDoTap())){s=u;break}if(s===t)return!1}e===t&&(e=o);s===t&&(s=o);r._downElement=o;r._manipulationElement=e;r._tapElement=s;r.ManipulationStarting(e.manipulationStarting||t);r.ManipulationStarted(e.manipulationStarted||t);r.ManipulationDelta(e.manipulationDelta||t);r.ManipulationInertiaStarting(e.manipulationInertiaStarting||t);r.ManipulationCompleted(e.manipulationCompleted||t);r.Tapped(s.tapped||t);r.DoubleTapped(s.doubleTapped||t);r.RightTapped(s.rightTapped||t);r.TouchOperatorStart(e.touchOperatorStart||t);r.TouchOperatorEnd(e.touchOperatorEnd||t);e.messageFilter&&(r._touchMouseMessageFilter=o.messageFilter);break}return!0},i.prototype._down=function(n,i,r,e,o){var s=this;return s._pressedPointers[r]!==f?!1:s._pressedPointers.length===0&&!s._setCaptureElement(n,i)?!1:s._manipulationElement===t||typeof s._manipulationElement===u?!1:s._pressedPointers.length>=s._manipulationElement.maxPointer?!0:s._touchMouseMessageFilter&&s._touchMouseMessageFilter.preProcessPointerDown()?!1:(s._fixPosition(e),s._touchMouseMessageFilter&&s._pressedPointers.length===0&&s._touchMouseMessageFilter.preProcessManipulationStarting(),s._pressedPointers[r]={id:r,time:(new Date).valueOf(),position:e},s._pressedPointers.length++,s._manipulationProcessor&&(s._manipulationProcessor.PreviewPointerDown(i,r,e,o),s._manipulationProcessor.PointerDown(r,e,s._pressedPointers.length,o)),s._pressedPointers.length===1&&s._tapEventProcesser&&s._tapEventProcesser.PointerDown(e),s._pressedPointers.length===1&&s.touchOperatorStart&&s.touchOperatorStart({Position:e}),!0)},i.prototype._move=function(n,t,i){var r=this;return r._pressedPointers[n]===f?!1:r._touchMouseMessageFilter&&r._touchMouseMessageFilter.preProcessPointerMove()?!1:(r._fixPosition(t),r._pressedPointers[n]={id:n,time:(new Date).valueOf(),position:t},r._manipulationProcessor&&r._manipulationProcessor.PointerMove(n,t,i),!0)},i.prototype._up=function(n,t){var i=this;return i._pressedPointers[n]===f?!1:(delete i._pressedPointers[n],i._pressedPointers.length--,i._touchMouseMessageFilter&&i._touchMouseMessageFilter.preProcessPointerUp())?!1:(i._fixPosition(t),i._manipulationProcessor&&(i._manipulationProcessor.PreviewPointerUp(n),i._manipulationProcessor.PointerUp(n)),i._pressedPointers.length===0&&i._tapEventProcesser&&(i._tapEventProcesser.PreviewPointerUp(t),i._tapEventProcesser.PointerUp(t)),i._pressedPointers.length===0&&i.touchOperatorEnd&&i.touchOperatorEnd({Position:t}),i._touchMouseMessageFilter&&i._pressedPointers.length===0&&i._manipulationProcessor._process===0&&i._touchMouseMessageFilter.postProcessManipulationComplete(),!0)},i.prototype._cancel=function(n,t){return this._up(n,t)},i.prototype.attachDettach=function(n,i){var r=this,e=n.element,s=r._elements,h=s.indexOf(n);if((!(h>=0)||!i)&&(!(h<0)||i)){var o="."+n.eventFlag,f=".gcSheet",c="MSPointerDown"+f,l="MSPointerMove"+f+o,a="MSPointerUp"+f+o,v="MSPointerCancel"+f+o,y="MSLostPointerCapture"+f+o,p="pointerdown"+f,w="pointermove"+f+o,b="pointerup"+f+o,k="LostPointerCapture"+f+o,d="pointercancel"+f+o,g="touchstart"+f,nt="touchmove"+f,tt="touchend"+f,it="touchcancel"+f;i?window.navigator.msPointerEnabled?(e.style.msTouchAction!==t&&typeof e.style.msTouchAction!==u&&(e.style.msTouchAction="none"),function(n,t){$(e).bind(c,function(t){r.msPointerDown(n,t.originalEvent)}).bind(p,function(t){r.msPointerDown(n,t.originalEvent)})}.call(r,n),$(document).bind(l,function(n){r.msPointerMove(n.originalEvent)}).bind(a,function(n){r.msPointerUp(n.originalEvent)}).bind(w,function(n){r.msPointerMove(n.originalEvent)}).bind(b,function(n){r.msPointerUp(n.originalEvent)}).bind(v,function(n){r.msPointerCancel(n.originalEvent)}).bind(y,function(n){r.msPointerCancel(n.originalEvent)}).bind(k,function(n){r.msPointerCancel(n.originalEvent)}).bind(d,function(n){r.msPointerCancel(n.originalEvent)})):(function(n,t){$(e).bind(g,function(t){r.touchStart(n,t.originalEvent)})}.call(r,n),$(e).bind(nt,function(n){r.touchMove(n.originalEvent)}).bind(tt,function(n){r.touchEnd(n.originalEvent)}).bind(it,function(n){r.touchCancel(n.originalEvent)})):window.navigator.msPointerEnabled?($(e).unbind(c).unbind(p),$(document).unbind(l).unbind(w).unbind(a).unbind(b).unbind(v).unbind(d).unbind(y).unbind(k)):$(e).unbind(g).unbind(nt).unbind(tt).unbind(it);i?s.push(n):s.splice(h,1)}},i.prototype.dispose=function(){for(var t=this._elements,n=t.length-1;n>=0;n--)this.attachDettach(t[n],!1)},i}();n.TouchEventProvider=wt;var bt=function(){function n(){var n=this;n._totalTranslateX=0;n._totalTranslateY=0;n._totalScale=1;n._totalRotation=0;n._totalExpansion=0;n._process=0;n._workingModes=511;n._manipulatorPointers=new ei;n._minimumScaleRotateRadius=20;n._deltaHistory=new ni}return n.prototype.PreviewPointerDown=function(n,t,i,r){var u=this,f;u._process===3&&u.Complete(!0);u._originalSource=n;f=new fi(t);f.PreviousPoint=i;f.InitialPoint=i;u._manipulatorPointers.Add(f);u._lastTime=r;u._manipulatorPointers.Count()>1&&(u.TranslateXLocked=!1,u.TranslateYLocked=!1,u._process===1&&u.StartManipulation())},n.prototype.PointerDown=function(n,t,i,r){this._process===0&&i===1&&this.Starting(this._manipulatorPointers.ItemAt(0).InitialPoint)},n.prototype.PointerMove=function(n,r,u){var f=this,c,l,a,h,e,s;if(f._workingModes!==0&&f._manipulatorPointers.Contains(n)){if(f._process===1&&f._manipulatorPointers.Count()===1){if(c=f.IsPinned(),!f.SupportsMode(1)&&!f.SupportsMode(2)&&!c)return;if(o.AreClose(r,f._manipulatorPointers.Find(n).InitialPoint))return;else l=i(r.X-f._manipulatorPointers.Find(n).InitialPoint.X),a=i(r.Y-f._manipulatorPointers.Find(n).InitialPoint.Y),f.SetTranslateRails(l,a)}if(!(u-f._lastTime<o.ManipulationDeltaInterval)){if(f._manipulatorPointers.Find(n).CurrentPoint=r,h=f._manipulatorPointers.Count(),h>1)for(e=0;e<h;e++)if(s=f._manipulatorPointers.ItemAt(e),!s.CurrentPoint)return;for(f.PointerMoveCore(u),f._lastTime=u,h=f._manipulatorPointers.Count(),e=0;e<h;e++)s=f._manipulatorPointers.ItemAt(e),s.PreviousPoint=s.CurrentPoint,s.CurrentPoint=t}}},n.prototype.PointerUp=function(n){var i=this;i._needFireEvents&&(i.OnManipulationCompleted(i._needFireEvents),i._needFireEvents=t)},n.prototype.PreviewPointerUp=function(n){var t=this;t._manipulatorPointers.Contains(n)&&(t._manipulatorPointers.Remove(n),t._process===2?t._manipulatorPointers.Count()===0&&(t.SupportsMode(64)||t.SupportsMode(256)||t.SupportsMode(128)?t.StartInertia():t.Complete(!0)):t._process===2||t._process===3?t.Complete(!0):t._process===1&&t.Complete(!1))},n.prototype.PointerMoveCore=function(n){var t=this,f,e,o,a,s,v,y=t.CalculateTranslate(),h,i,w,u,b,p;if(f=y.translateX,e=y.translateY,v=y.position,h=t.CalculateRotationAndScale(),s=h.rotation,a=h.scale,o=h.expansion,t._totalTranslateX+=f,t._totalTranslateY+=e,t._totalScale*=a,t._totalRotation+=s,t._totalExpansion+=o,i=new gt,i.expansion=o,i.rotation=s,i.timeStamp=n-t._lastTime,i.translateX=f,i.translateY=e,t._deltaHistory.Enqueue(i),t._lastPosition=v,t._process===1||t._process===2){if(t._process===1&&(w=t.StartManipulation(),w))return;if(u=new l,u.Expansion=o,u.Rotation=s,u.Scale=a,u.Translation=new r(f,e),b=new c(t._deltaHistory),p=new g(t._originalSource,t.GetCumulative(),u,!1,v,b),t.OnManipulationDelta(p),p.IsComplete){t.Complete(!0);return}}},n.prototype.StartManipulation=function(){var n=this,t;return(n._process=2,t=new ci(n._originalSource,n._manipulatorPointers.Count(),n.GetCumulative(),n._manipulatorPointers.ItemAt(0).InitialPoint),n.OnManipulationStarted(t),t.IsComplete)?(n.Complete(!0),!0):!1},n.prototype.SetTranslateRails=function(n,t){var i=dt.GetTranslateLocked(n,t);this.TranslateXLocked=i.translateXLocked;this.TranslateYLocked=i.translateYLocked},n.prototype.CalculateTranslate=function(){var t=0,i=0,u=this.GetAveragePoint(),n=u.currentAveragePoint,f=u.previousAveragePoint,e=new r(n.X,n.Y);return t=n.X-f.X,i=n.Y-f.Y,{translateX:t,translateY:i,position:e}},n.prototype.CalculateRotationAndScale=function(){var n=this,t=0,r=1,u=0,i;return n.SupportsMode(16)&&n._manipulatorPointers.Count()===1&&n.IsPinned()&&(t=n.CalculateSingleManipulatorRotation(n._manipulatorPointers.ItemAt(0).CurrentPoint,n._manipulatorPointers.ItemAt(0).PreviousPoint,n._pivot)),n._manipulatorPointers.Count()>1&&(i=n.CalculateMultiManipulatorRotationAndScale(),t=i.rotation,r=i.scale,u=i.expansion),t=t/s*180,{rotation:t,scale:r,expansion:u}},n.prototype.CalculateMultiManipulatorRotationAndScale=function(){for(var d,n=this,y=n.GetAveragePoint(),c=y.currentAveragePoint,l=y.previousAveragePoint,f=n.IsPinned(),t=f?n._pivot.Center:new r(0,0),e=0,p=1,w=0,a=0,o=0,s=0,v=0,g=n._manipulatorPointers.Count(),h=0;h<g;h++){var i=n._manipulatorPointers.ItemAt(h).CurrentPoint,u=n._manipulatorPointers.ItemAt(h).PreviousPoint,b=n.GetLength(i,c),k=n.GetLength(u,l),nt=f?new r(u.X-t.X,u.Y-t.Y):new r(u.X-l.X,u.Y-l.Y),tt=f?new r(i.X-t.X,i.Y-t.Y):new r(i.X-c.X,i.Y-c.Y),it=n.GetLength(u,t),rt=n.GetLength(i,t);k>=n._minimumScaleRotateRadius&&b>=n._minimumScaleRotateRadius&&(o++,s+=b,v+=k,(!f||it>=n._minimumScaleRotateRadius)&&rt>=n._minimumScaleRotateRadius&&(d=n.AngleBetween(nt,tt),e+=d,a++))}return e=a>0&&n.SupportsMode(16)?e/a:0,o>0&&n.SupportsMode(32)?(p=s/v,w=(s-v)/o,n._lastDistance=s/o):n._lastDistance=0,{rotation:e,scale:p,expansion:w}},n.prototype.CalculateSingleManipulatorRotation=function(n,t,i){var u=new r(i.Center.X,i.Center.Y),e=new r(t.X-u.X,t.Y-u.Y),o=new r(n.X-u.X,n.Y-u.Y),s=b(1,yt(this.GetLength(t,u)/i.Radius,4)),f=this.AngleBetween(e,o);return isNaN(f)?0:f*s},n.prototype.AngleBetween=function(n,t){var i=k(t.Y,t.X)-k(n.Y,n.X);return i>s?i-=s*2:i<-s&&(i+=s*2),i},n.prototype.SupportsMode=function(n){return(this._workingModes&n)!=0},n.prototype.GetLength=function(n,t){return w((t.X-n.X)*(t.X-n.X)+(t.Y-n.Y)*(t.Y-n.Y))},n.prototype.GetAveragePoint=function(){for(var t,s,h,u=0,f=0,e=0,o=0,n=this._manipulatorPointers.Count(),i=0;i<n;i++)t=this._manipulatorPointers.ItemAt(i),u+=t.PreviousPoint.X,f+=t.PreviousPoint.Y,e+=t.CurrentPoint.X,o+=t.CurrentPoint.Y;return s=new r(u/n,f/n),h=new r(e/n,o/n),{currentAveragePoint:h,previousAveragePoint:s}},n.prototype.IsPinned=function(){return this._pivot&&!isNaN(this._pivot.Radius)},n.prototype.Starting=function(n){var i=this,r=new li(i._originalSource,i._workingModes,t,n);return r.Mode=511,i.OnManipulationStarting(r),i.ManipulationMode=r.Mode,r.Mode===0?(i.Complete(!1),!1):(i._workingModes=r.Mode,i._pivot=r.Pivot,i._process=1,!0)},n.prototype.Complete=function(n){var i=this,f=i._process===3,u;i._process=0;i._inertiaTimer&&(clearInterval(i._inertiaTimer),i._inertiaTimer=t);n&&(u=new si(i._originalSource,i.GetCumulative(),f,r.Round(i._lastPosition),new c(i._deltaHistory)),i._process===3?i._needFireEvents=u:i.OnManipulationCompleted(u));i._deltaHistory.Clear();i._manipulatorPointers.Clear();i._pivot=t;i._totalTranslateX=0;i._totalTranslateY=0;i._totalScale=1;i._totalRotation=0;i._totalExpansion=0;i.TranslateXLocked=!1;i.TranslateYLocked=!1;i._workingModes=0},n.prototype.StartInertia=function(){var i=this,n=new ui,r=new c(i._deltaHistory),u,f;if(n.CurrentTranslateXVelocity=i.SupportsMode(64)?r.Linear().X:0,n.CurrentTranslateYVelocity=i.SupportsMode(64)?r.Linear().Y:0,n.CurrentExpansionVelocity=i.SupportsMode(256)?r.Expansion():0,n.CurrentRotationVelocity=i.SupportsMode(128)?r.Angular():0,n.CurrentTranslateXVelocity===0&&n.CurrentTranslateYVelocity===0&&n.CurrentExpansionVelocity===0&&n.CurrentRotationVelocity===0){i.Complete(!0);return}n.TranslateBehavior=new ri(n.CurrentTranslateXVelocity,n.CurrentTranslateYVelocity);n.ExpansionBehavior=new ti(n.CurrentExpansionVelocity);n.RotationBehavior=new ii(n.CurrentRotationVelocity);r=new c(t,n.CurrentTranslateXVelocity,n.CurrentTranslateYVelocity,n.CurrentRotationVelocity,n.CurrentExpansionVelocity);u=new hi(i._originalSource,i.GetCumulative(),new l,r,n.ExpansionBehavior,n.RotationBehavior,n.TranslateBehavior);i.OnManipulationInertiaStarting(u);n.TranslateBehavior=u.TranslationBehavior;n.ExpansionBehavior=u.ExpansionBehavior;n.RotationBehavior=u.RotationBehavior;n.TranslateBehavior.XDeceleration<=0&&n.TranslateBehavior.YDeceleration<=0&&n.TranslateBehavior.SetDecelerationInternal(.003);n.ExpansionBehavior.DecelerationInternal()<=0&&n.ExpansionBehavior.SetDecelerationInternal(.002);n.RotationBehavior.DecelerationInternal()<=0&&n.RotationBehavior.SetDecelerationInternal(.003);f=(new Date).valueOf();n.StartTime=f;n.LastTime=f;n.DeltaXRemainder=0;n.DeltaYRemainder=0;i._process=3;i._inertiaTimer=setInterval(function(){try{i.InertiaTick(n)}catch(t){}},20)},n.prototype.InertiaTick=function(n){var u=this,k=(new Date).valueOf(),rt=k-n.StartTime,f=k-n.LastTime,b,a,it,nt;if(f!==0){var v=n.CurrentTranslateXVelocity,y=n.CurrentTranslateYVelocity,p=n.CurrentExpansionVelocity,w=n.CurrentRotationVelocity;n.CurrentTranslateXVelocity=u.GetInertiaCurrentVelocity(f,n.TranslateBehavior.XDeceleration,n.CurrentTranslateXVelocity);n.CurrentTranslateYVelocity=u.GetInertiaCurrentVelocity(f,n.TranslateBehavior.YDeceleration,n.CurrentTranslateYVelocity);n.CurrentExpansionVelocity=u.GetInertiaCurrentVelocity(f,n.ExpansionBehavior.DecelerationInternal(),n.CurrentExpansionVelocity);n.CurrentRotationVelocity=u.GetInertiaCurrentVelocity(f,n.RotationBehavior.DecelerationInternal(),n.CurrentRotationVelocity);v=(v+n.CurrentTranslateXVelocity)/2;y=(y+n.CurrentTranslateYVelocity)/2;p=(p+n.CurrentExpansionVelocity)/2;w=(w+n.CurrentRotationVelocity)/2;n.LastTime=k;b=!1;u.IsZero(v)&&u.IsZero(y)&&u.IsZero(p)&&u.IsZero(w)&&(b=!0);var o=f*v,s=f*y,h=f*p,tt=f*w,d=1;if(u._lastDistance>0&&(u._lastDistance+h*2<0&&(h=-u._lastDistance/2+1),u._lastDistance!==0&&(d=(u._lastDistance+h*2)/u._lastDistance)),u._totalExpansion+=h,u._totalRotation+=tt,u._totalTranslateX+=o,u._totalTranslateY+=s,u._totalScale*=d,u._lastDistance+=h,u._lastPosition=new r(u._lastPosition.X+o,u._lastPosition.Y+s),n.DeltaXRemainder+=o,n.DeltaYRemainder+=s,b){if(o=e(n.DeltaXRemainder),s=e(n.DeltaYRemainder),u.IsZero(o)&&u.IsZero(s)){u.Complete(!0);return}}else i(n.DeltaXRemainder)>=1&&(o=n.DeltaXRemainder,n.DeltaXRemainder-=o),i(n.DeltaYRemainder)>=1&&(s=n.DeltaYRemainder,n.DeltaYRemainder-=s);if(a=new l,a.Translation=new r(o,s),a.Scale=d,a.Expansion=h,a.Rotation=tt,it=new c(t,n.CurrentTranslateXVelocity,n.CurrentTranslateYVelocity,n.CurrentRotationVelocity,n.CurrentExpansionVelocity),nt=new g(u._originalSource,u.GetCumulative(),a,!0,r.Round(u._lastPosition),it),u.OnManipulationDelta(nt),nt.IsComplete){u.Complete(!0);return}b&&u.Complete(!0)}},n.prototype.GetInertiaCurrentVelocity=function(n,t,i){if(this.IsZero(i))return 0;var r;return r=i<0?i+t*n:i-t*n,(r<0&&i>0||r>0&&i<0)&&(r=0),r},n.prototype.GetCumulative=function(){var n=this,t=new l;return t.Expansion=n._totalExpansion,t.Rotation=n._totalRotation,t.Scale=n._totalScale,t.Translation=new r(n._totalTranslateX,n._totalTranslateY),t},n.prototype.IsZero=function(n){return i(n)<=22204460492503131e-32},n.prototype.GetManipulationData=function(n,i,r,u){var f=this,e=new l,o=new l,s=0,h=0,a=0,v=0,p=f.SupportsMode(4)&&f.TranslateXLocked,w=f.SupportsMode(8)&&f.TranslateYLocked,y;return f.SupportsMode(1)&&!w&&(!n||f.SupportsMode(64))&&(e.Translation.X=i.Translation.X,o.Translation.X=r.Translation.X,s=u.Linear().X),f.SupportsMode(2)&&!p&&(!n||f.SupportsMode(64))&&(e.Translation.Y=i.Translation.Y,o.Translation.Y=r.Translation.Y,h=u.Linear().Y),f.SupportsMode(32)&&(!n||f.SupportsMode(256))?(e.Scale=i.Scale,e.Expansion=i.Expansion,o.Scale=r.Scale,o.Expansion=r.Expansion,v=u.Expansion()):(e.Scale=i.Scale,o.Scale=1),f.SupportsMode(16)&&(!n||f.SupportsMode(128))&&(e.Rotation=i.Rotation,o.Rotation=r.Rotation,a=u.Angular()),y=new c(t,s,h,a,v),new oi(e,o,y)},n.prototype.OnManipulationStarting=function(n){this.ManipulationStarting&&n&&this.ManipulationStarting(n)},n.prototype.OnManipulationStarted=function(n){this.ManipulationStarted&&n&&this.ManipulationStarted(n)},n.prototype.OnManipulationCompleted=function(n){if(this.ManipulationCompleted&&n){var t=this.GetManipulationData(!1,n.Cumulative,n.Cumulative,n.Velocities);n.Cumulative=t.Cumulative;n.Velocities=t.Velocities;this.ManipulationCompleted(n)}},n.prototype.OnManipulationInertiaStarting=function(n){if(this.ManipulationInertiaStarting&&n){var t=this.GetManipulationData(!1,n.Cumulative,n.Delta,n.Velocities);n.Cumulative=t.Cumulative;n.Delta=t.Delta;n.Velocities=t.Velocities;this.ManipulationInertiaStarting(n)}},n.prototype.OnManipulationDelta=function(n){if(this.ManipulationDelta&&n){var t=this.GetManipulationData(n.IsInertia,n.Cumulative,n.Delta,n.Velocities);n.Cumulative=t.Cumulative;n.Delta=t.Delta;n.Velocities=t.Velocities;this.ManipulationDelta(n)}},n}(),kt=function(){function n(){}return n.prototype.PointerDown=function(n){var t=this,i;(t._pointerCount++,t._pointerCount>1)||(i=(new Date).valueOf(),t._firstDownPosition&&o.AreClose(n,t._firstDownPosition)&&i-t._lastDownTimestamp<o.DoubleTappedTimeOffset?t._count++:(t._firstDownPosition=n,t._count=1),t._lastDownPosition=n,t._lastDownTimestamp=i)},n.prototype.PointerUp=function(n){var i=this;i._needFireEvents&&(i._needFireEvents instanceof nt?i.OnTapped(i._needFireEvents):i._needFireEvents instanceof tt&&i.OnRightTapped(i._needFireEvents),i._needFireEvents=t)},n.prototype.PreviewPointerUp=function(n){var i=this,r;(i._pointerCount--,i._pointerCount>0)||(r=(new Date).valueOf(),o.AreClose(n,i._lastDownPosition)?r-i._lastDownTimestamp>o.RightTappedTimeOffset?i._needFireEvents=new tt(i._lastDownPosition):i._count>1?(i._count=0,i.OnDoubleTapped(new ai(i._firstDownPosition)),i._firstDownPosition=t):i._needFireEvents=new nt(i._lastDownPosition):i._firstDownPosition=t)},n.prototype.PointerCancel=function(){this._firstDownPosition=t},n.prototype.OnTapped=function(n){this.Tapped&&n&&this.Tapped(n)},n.prototype.OnDoubleTapped=function(n){this.DoubleTapped&&n&&this.DoubleTapped(n)},n.prototype.OnRightTapped=function(n){this.RightTapped&&n&&this.RightTapped(n)},n}(),dt=function(){function n(){}return n.GetTranslateLocked=function(n,t){var u=!1,r=!1,i;return n!==0&&(i=d(t/n)/s*180,i<20&&(u=!0)),n===0?r=!0:(i=d(t/n)/s*180,i>75&&i<105&&(r=!0)),{translateXLocked:u,translateYLocked:r}},n}(),o=function(){function n(){}return n.AreClose=function(t,r){if(!t||!r)return!1;var e=n.TappedMaxOffset,o=n.TappedMaxOffset,s=n.TappedMaxDistance,h=n.TappedMaxDistance,u=t.X-r.X,f=t.Y-r.Y;return i(u)<e&&i(f)<o&&w(u*u+f*f)<b(s,h)},n.TappedMaxOffset=13,n.TappedMaxDistance=15,n.DoubleTappedTimeOffset=400,n.RightTappedTimeOffset=1e3,n.ManipulationDeltaInterval=20,n}(),r=function(){function n(n,t){this.X=n;this.Y=t}return n.Round=function(t){return t?new n(e(t.X),e(t.Y)):new n(-1,-1)},n}(),gt=function(){function n(){}return n}(),ni=function(){function n(){var n=this;n._count=0;n._start=0;n._maxCount=10;n._history=new Array(n._maxCount)}return n.prototype.GetVelocity=function(n){var t=this,i,r,u;if(t._count===0)return 0;var o=t.Item(t._count-1).timeStamp,f=0,e=(1+t._count)*t._count/2;for(i=t._count-1;i>=0;i--)r=0,n===0?r=t.Item(i).translateX:n===1?r=t.Item(i).translateY:n===2?r=t.Item(i).expansion:n===3&&(r=t.Item(i).rotation),u=t.GetSingleVelocity(r,t.Item(i).timeStamp),u*=i+1,f+=u;return f/e},n.prototype.GetSingleVelocity=function(n,t){return n/t},n.prototype.Item=function(n){return this._history[this.GetInnerListIndex(n)]},n.prototype.Last=function(){return this._history[this._count-1]},n.prototype.Enqueue=function(n){var t=this,r,i;for(t._count===10&&t.Dequeue(),t._count++,t._history[t.GetInnerListIndex(t._count-1)]=n,r=o.ManipulationDeltaInterval*t._maxCount,i=0;i<t._count;i++)n.timeStamp-t._history[i].timeStamp>r&&(t.Dequeue(),i--)},n.prototype.Dequeue=function(){var n=this;n._start++;n._start===n._maxCount&&(n._start=0);n._count--},n.prototype.Clear=function(){this._count=0},n.prototype.GetInnerListIndex=function(n){return(this._start+n)%this._maxCount},n}(),c=function(){function n(n,t,i,u,f){var e=this;n?e._history=n:(e._linear=new r(t,i),e._angular=u,e._expansion=f)}return n.prototype.Linear=function(){var n=this;return n._linear||(n._linear=new r(n._history.GetVelocity(0),n._history.GetVelocity(1))),n._linear},n.prototype.Angular=function(){var n=this;return(n._angular===t||typeof n._angular===u)&&(n._angular=n._history.GetVelocity(3)),n._angular},n.prototype.Expansion=function(){var n=this;return(n._expansion===t||typeof n._expansion===u)&&(n._expansion=n._history.GetVelocity(2)),n._expansion},n}(),ti=function(){function n(n){this._initialVelocity=n;this._decelerationInternal=0}return n.prototype.DecelerationInternal=function(){var n=this;return isNaN(n.DesiredExpansion)||n.DesiredExpansion===0?isNaN(n.DesiredDeceleration)?n._decelerationInternal:n.DesiredDeceleration:.5*n._initialVelocity*n._initialVelocity/n.DesiredExpansion},n.prototype.SetDecelerationInternal=function(n){this._decelerationInternal=n},n}(),ii=function(){function n(n){this._initialVelocity=n;this._decelerationInternal=0}return n.prototype.DecelerationInternal=function(){var n=this;return isNaN(n.DesiredRotation)||n.DesiredRotation===0?isNaN(n.DesiredDeceleration)?n._decelerationInternal:n.DesiredDeceleration:.5*n._initialVelocity*n._initialVelocity/n.DesiredRotation},n.prototype.SetDecelerationInternal=function(n){this._decelerationInternal=n},n}(),ri=function(){function n(n,t){var i=this;i._initialXVelocity=n;i._initialYVelocity=t;i.XDeceleration=0;i.YDeceleration=0;i._decelerationInternal=0;i._velocity=w(i._initialXVelocity*i._initialXVelocity+i._initialYVelocity*i._initialYVelocity)}return n.prototype.UpdateXYDecelerations=function(){var n=this;isNaN(n.DesiredDisplacement)||n.DesiredDisplacement===0?isNaN(n.DecelerationInternal())||n.DecelerationInternal()===0?(n.XDeceleration=0,n.YDeceleration=0):(n.XDeceleration=n.DecelerationInternal()*i(n._initialXVelocity)/n._velocity,n.YDeceleration=n.DecelerationInternal()*i(n._initialYVelocity)/n._velocity):(n.XDeceleration=.5*n._velocity*i(n._initialXVelocity)/n.DesiredDisplacement,n.YDeceleration=.5*n._velocity*i(n._initialYVelocity)/n.DesiredDisplacement)},n.prototype.SetDesiredDeceleration=function(n){this.DesiredDeceleration=n;this.UpdateXYDecelerations()},n.prototype.SetDesiredDisplacement=function(n){this.DesiredDisplacement=n;this.UpdateXYDecelerations()},n.prototype.DecelerationInternal=function(){return this.IsDefault()?this._decelerationInternal:this.DesiredDeceleration},n.prototype.SetDecelerationInternal=function(n){this._decelerationInternal=n;this.UpdateXYDecelerations()},n.prototype.IsDefault=function(){return isNaN(this.DesiredDeceleration)&&isNaN(this.DesiredDisplacement)},n}(),ui=function(){function n(){}return n}(),l=function(){function n(){var n=this;n.Translation=new r(0,0);n.Scale=0;n.Rotation=0;n.Expansion=0}return n}(),bi=function(){function n(n,t){this.Center=n;this.Radius=t}return n}(),fi=function(){function n(n){this.ID=n}return n}(),ei=function(){function n(){this._list=[]}return n.prototype.Contains=function(n){for(var i,t=0;t<this._list.length;t++)if(i=this._list[t],i.ID===n)return!0;return!1},n.prototype.Add=function(n){this._list.push(n)},n.prototype.Remove=function(n){for(var t=0;t<this._list.length;t++)if(this._list[t].ID===n){this._list.splice(t,1);break}},n.prototype.Count=function(){return this._list.length},n.prototype.ItemAt=function(n){return this._list[n]},n.prototype.Find=function(n){for(var r,i=0;i<this._list.length;i++)if(r=this._list[i],r.ID===n)return r;return t},n.prototype.Clear=function(){this._list.splice(0,this._list.length)},n}(),oi=function(){function n(n,t,i){this.Cumulative=n;this.Delta=t;this.Velocities=i}return n}(),a=function(){function n(n){this.OriginalSource=n}return n}(),si=function(n){function t(t,i,r,u,f){n.call(this,t);var e=this;e.Cumulative=i;e.IsInertia=r;e.Position=u;e.Velocities=f}return __extends(t,n),t}(a),g=function(n){function t(t,i,r,u,f,e){n.call(this,t);var o=this;o.Cumulative=i;o.Delta=r;o.IsInertia=u;o.Position=f;o.Velocities=e}return __extends(t,n),t}(a),hi=function(n){function t(t,i,r,u,f,e,o){n.call(this,t);var s=this;s.Cumulative=i;s.Delta=r;s.Velocities=u;s.ExpansionBehavior=f;s.RotationBehavior=e;s.TranslationBehavior=o}return __extends(t,n),t}(a),ci=function(n){function t(t,i,r,u){n.call(this,t);this.PointerCount=i;this.Cumulative=r;this.Position=u}return __extends(t,n),t}(a),li=function(n){function t(t,i,r,u){n.call(this,t);this.Mode=i;this.Pivot=r;this.Position=u}return __extends(t,n),t}(a),nt=function(){function n(n){this.Position=n}return n}(),tt=function(){function n(n){this.Position=n}return n}(),ai=function(){function n(n){this.Position=n}return n}(),it;(function(n){n[n.All=511]="All";n[n.None=0]="None";n[n.TranslateX=1]="TranslateX";n[n.TranslateY=2]="TranslateY";n[n.TranslateRailsX=4]="TranslateRailsX";n[n.TranslateRailsY=8]="TranslateRailsY";n[n.Rotate=16]="Rotate";n[n.Scale=32]="Scale";n[n.TranslateInertia=64]="TranslateInertia";n[n.RotateInertia=128]="RotateInertia";n[n.ScaleInertia=256]="ScaleInertia"})(it||(it={})),function(n){n[n.NotStart=0]="NotStart";n[n.Starting=1]="Starting";n[n.Started=2]="Started";n[n.InertiaStarted=3]="InertiaStarted"}(rt||(rt={})),function(n){n[n.TranslateX=0]="TranslateX";n[n.TranslateY=1]="TranslateY";n[n.Expansion=2]="Expansion";n[n.Rotation=3]="Rotation"}(ut||(ut={})),function(n){n[n.column=1]="column";n[n.row=2]="row";n[n.range=3]="range"}(ft||(ft={}));var vi=function(){function n(){}return n.prototype._getTouchCanvas=function(n,t){var i=document.createElement("canvas");return i.width=n,i.height=t,i},n.prototype.saveCanvas=function(n,t,i){var r=this,u=n.width,f=n.height,e=r._getTouchCanvas(u,f);e.getContext("2d").drawImage(n,0,0,u,f);r._canvas=e;r._oldSheetLayout=t;r._oldZoomFactor=i},n.prototype.restoreCanvas=function(n,t,i,r,u){var h=this,v=n.width,y=n.height,f=h._oldSheetLayout.frozenX,e=h._oldSheetLayout.frozenY,c=v-f,l=y-e,o=t/h._oldZoomFactor,s=n.getContext("2d"),a=h._canvas;s.save();s.fillStyle=i;s.fillRect(0,0,v,y);s.drawImage(a,f,e,c,l,f,e,c*o,l*o);r&&s.drawImage(a,0,e,f,l,0,e,f*o,l*o);u&&s.drawImage(a,f,0,c,e,f,0,c*o,e*o);r&&u&&s.drawImage(a,0,0,f,e,0,0,f*o,e*o);s.restore()},n}(),yi=function(){function t(){this._waittime=-1}return t.prototype._getTouchCanvas=function(n,t){var i=document.createElement("canvas");return i.width=n,i.height=t,i},t.prototype._translatePaint=function(n,t,i,r){t.width>0&&t.height>0&&(n.translate(i,r),this._paint(n,t),n.translate(-i,-r))},t.prototype._paint=function(n,t){var i=this._sheet,r=i._render;!n||i._layoutSuspended>0||(r.paintBody(n,t),this._paintAdornment(n,t))},t.prototype._paintAdornment=function(n,t){var f=this._sheet,e=f._render,o,i,r,u;if(n&&!(f._layoutSuspended>0)&&!f._hoverCell){for(o=f._getSheetLayout(),r=0;r<=2;r++)for(u=0;u<=2;u++)(i=o.viewportRect(r,u),i&&i.width!==0&&i.height!==0)&&(!t||i.intersectRect(t))&&e.paintSelection(n,r,u,t);e.paintResizeLine(n)}},t.prototype._restoreColHeaderFrozenRows=function(n,t,i){var r=0,u=0,f=n.canvas.width,e=i.viewportY;n.drawImage(t,r,u,f,e,r,u,f,e)},t.prototype._restorePartViewportScrollTop=function(t,i,r,u){var e=0,s=r.viewportY,h=s+u,o=t.canvas.width,f=r.viewportHeight-u;return f>0&&t.drawImage(i,e,s,o,f,e,h,o,f),new n.Rect(e,h,o,f)},t.prototype._restorePartViewportScrollBottom=function(t,i,r,u,f){var o=0,s=r.viewportY,c=s+u,h=t.canvas.width,e=r.viewportHeight-u-f;return e>0&&t.drawImage(i,o,c,h,e,o,s,h,e),new n.Rect(o,s,h,e)},t.prototype._restoreTrailingFrozenRows=function(n,t,i,r){var f=0,e=i.frozenTrailingY-r,o=n.canvas.width,u=i.frozenTrailingHeight+r;u>0&&n.drawImage(t,f,e,o,u,f,e,o,u)},t.prototype._restoreRowHeaderFrozenCols=function(n,t,i){var r=0,u=0,f=i.viewportX,e=n.canvas.height;n.drawImage(t,r,u,f,e,r,u,f,e)},t.prototype._restorePartViewportScrollLeft=function(t,i,r,u){var s=r.viewportX,h=s+u,e=0,f=r.viewportWidth-u,o=t.canvas.height;return f>0&&t.drawImage(i,s,e,f,o,h,e,f,o),new n.Rect(h,e,f,o)},t.prototype._restorePartViewportScrollRight=function(t,i,r,u,f){var o=r.viewportX,c=o+u,s=0,e=r.viewportWidth-u-f,h=t.canvas.height;return e>0&&t.drawImage(i,c,s,e,h,o,s,e,h),new n.Rect(o,s,e,h)},t.prototype._restoreTrailingFrozenCols=function(n,t,i,r){var f=i.frozenTrailingX-r,e=0,u=i.frozenTrailingWidth+r,o=n.canvas.height;u>0&&n.drawImage(t,f,e,u,o,f,e,u,o)},t.prototype.saveTopRowLeftCol=function(n){var t=this;t._lastTime=0;t._sheet=n;t.oldTopRow=n._scrollTopRow;t.oldLeftColumn=n._scrollLeftCol},t.prototype.saveCanvas=function(n){var t=n.width,i=n.height,r=this._getTouchCanvas(t,i);r.getContext("2d").drawImage(n,0,0,t,i);this._canvas=r},t.prototype.saveCanvasWithInertia=function(n){var t=n.width,i=n.height,r=this._getTouchCanvas(t,i);r.getContext("2d").drawImage(n,0,0,t,i);this._canvasWithInertia=r},t.prototype.restoreCanvas=function(t,r,u,f,e,o){var s=this,d=(new Date).valueOf(),h,rt;if(d-s._lastTime<s._waittime)return;else s._lastTime=d;if(s._canvas&&s._sheet){var y=s._sheet,l=s._canvas,c=y._getSheetLayout(),tt=t.width,it=t.height,p,w,a,v,b,k,g=y.getFrozenTrailingColumnCount()>0?1:0,nt=y.getFrozenTrailingRowCount()>0?1:0;(r!==0||u!==0)&&(h=t.getContext("2d"),h.save(),h.fillStyle=o,h.fillRect(0,0,tt,it),i(r)>i(u)?(w=0,v=it,r>0?(s._restorePartViewportScrollLeft(h,l,c,r),b=r-f,c.viewportWidth<=r&&(b=0),a=f,p=c.viewportX,y.invalidateLayout(),s._translatePaint(h,new n.Rect(p,w,a,v),b,0)):r<0&&(s._restorePartViewportScrollRight(h,l,c,i(r),g),b=r-f,c.viewportWidth<=i(r)&&(b=0),y.invalidateLayout(),a=i(f),p=c.frozenTrailingX-a-g,s._translatePaint(h,new n.Rect(p,w,a,v),b,0)),s._restoreRowHeaderFrozenCols(h,l,c),s._restoreTrailingFrozenCols(h,l,c,g)):(p=0,a=tt,u>0?(s._restorePartViewportScrollTop(h,l,c,u),k=u-e,c.viewportHeight<=u&&(k=0),v=e,w=c.viewportY,y.invalidateLayout(),s._translatePaint(h,new n.Rect(p,w,a,v),0,k)):u<0&&(s._restorePartViewportScrollBottom(h,l,c,i(u),nt),k=u-e,c.viewportHeight<=i(u)&&(k=0),y.invalidateLayout(),v=i(e),w=c.frozenTrailingY-v-nt,s._translatePaint(h,new n.Rect(p,w,a,v),0,k)),s._restoreColHeaderFrozenRows(h,l,c),s._restoreTrailingFrozenRows(h,l,c,nt)),h.restore(),s.saveCanvasWithInertia(t),s._waittime<0&&(rt=(new Date).valueOf()-d,s._waittime=rt<20?0:60))}},t.prototype.restoreCanvasWithInertia=function(t,r,u,f,e,o,s,h){var c=this,l,ft,ot,st,k,ct;if(c._canvasWithInertia&&c._sheet){var v=c._sheet,d=c._canvasWithInertia,a=v._getSheetLayout(),lt=t.width,at=t.height,y,p,w,b,g,nt,tt=v.getFrozenTrailingColumnCount()>0?1:0,it=v.getFrozenTrailingRowCount()>0?1:0;if(r!==0&&o!==0||u!==0&&s!==0){if(l=t.getContext("2d"),l.save(),l.fillStyle=h,l.fillRect(0,0,lt,at),i(r)>i(u)){if(p=0,b=at,r>0)k=c._restorePartViewportScrollLeft(l,d,a,o),g=r-f,w=f,y=a.viewportX,v.invalidateLayout(),ft=k.x-g,y+w>ft&&(w=ft-y+tt),c._translatePaint(l,new n.Rect(y,p,w,b),g,0);else if(r<0){k=c._restorePartViewportScrollRight(l,d,a,i(o),tt);g=r-f;v.invalidateLayout();w=i(f);y=a.frozenTrailingX-w-tt;var rt=k.x+k.width-g,vt=v._getScrollableColumn(v.getColumnCount(),!0),et=v._getViewportColumnLayout(1).findCol(vt);et&&(ot=et.x+et.width-g,rt>ot&&(rt=ot));y<rt&&(w=a.frozenTrailingX-rt,y=rt-tt);c._translatePaint(l,new n.Rect(y,p,w,b),g,0)}c._restoreRowHeaderFrozenCols(l,d,a);c._restoreTrailingFrozenCols(l,d,a,tt)}else{if(y=0,w=lt,u>0)k=c._restorePartViewportScrollTop(l,d,a,s),nt=u-e,b=e,p=a.viewportY,v.invalidateLayout(),st=k.y-nt,p+b>st&&(b=st-p+it),c._translatePaint(l,new n.Rect(y,p,w,b),0,nt);else if(u<0){k=c._restorePartViewportScrollBottom(l,d,a,i(s),it);nt=u-e;v.invalidateLayout();b=i(e);p=a.frozenTrailingY-b-it;var ut=k.y+k.height-nt,yt=v._getScrollableRow(v.getRowCount(),!0),ht=v._getViewportRowLayout(1).findRow(yt);ht&&(ct=ht.y+ht.height-nt,ut>ct&&(ut=ct));p<ut&&(b=a.frozenTrailingY-ut,p=ut-it);c._translatePaint(l,new n.Rect(y,p,w,b),0,nt)}c._restoreColHeaderFrozenRows(l,d,a);c._restoreTrailingFrozenRows(l,d,a,it)}l.restore();c.saveCanvasWithInertia(t)}}},t}(),pi=function(){function r(n){this._touchZoomManager=new vi;this._touchScrollManager=new yi;this.sheet=n}return r.prototype.doManipulationStarting=function(n){var t=this._touchHitTest(n.Position.X,n.Position.Y);n.Mode=t&&(t.resizeInfo||t.dragInfo&&t.dragInfo.side==="corner"||t.selectionHitInfo)?3:367},r.prototype.doManipulationStarted=function(n){var r=this,l,a,e,s;r._scrollInterval&&(clearInterval(r._scrollInterval),r._scrollInterval=t);var u=r.sheet,o=u._eventHandler,f=u._render,i=r._touchHitTest(n.Position.X,n.Position.Y);if(u._currentTarget=i,i.resizeInfo)o.startResizing(i);else if(i.dragInfo&&i.dragInfo.side==="corner")o.startDragFill(i);else if(i.selectionHitInfo){var h=i.selectionHitInfo,c=h.isHeader,v=h.isFirstIndicator,y=h.type;c&&o._startSelectingCore(i,!0);l=i.hitTestType;i.hitTestType=i.selectionHitInfo.type;o._startSelectingScroll(i);i.hitTestType=l;r._changeActiveCellBeforeSelect(c,v,y);f._showTouchSelectionIndicator=!1;f.refreshTouchSelectionIndicator()}else if(a=u._getSheetLayout(),e=f._getCtx(),e){if(!u.endEdit())return;f._showTouchSelectionIndicator=!1;f.refreshTouchSelectionIndicator();r._touchZoomManager.saveCanvas(e.canvas,a,u._zoomFactor);r._oldZoomFactor=u._zoomFactor;s=r._touchScrollManager;s.saveTopRowLeftCol(u);s.saveCanvas(e.canvas);s.saveCanvasWithInertia(e.canvas)}},r.prototype.doManipulationDelta=function(r,u){var o=this,f=o.sheet,tt=f._render,c=f._eventHandler,it=r.Position.X,rt=r.Position.Y,y,ut,d,p;if(f._currentTarget)if(y=f._currentTarget,y.resizeInfo)c.mousePosition={e:r,x:it,y:rt},c.continueResizing();else if(y.dragInfo&&y.dragInfo.side==="corner")c.mousePosition={e:r,x:it,y:rt},c.continueDragFill();else if(y.selectionHitInfo||c.isSelecting){if(ut=y.selectionHitInfo,ut){if(!c.startHitInfo||!c.isWorking)return;if(c._forceCancelSelectiong===!0)return;d=ut.type;c.mousePosition={e:r,x:it,y:rt};d===3?c.continueCellSelecting():d===2?c.continueRowSelecting():d===1&&c.continueColumnSelecting()}}else{var k=tt._getCtx(),at=r.Cumulative.Scale,ft=tt._getGrayAreaBackColor(!1),vt=f.getRowHeaderVisible(),yt=f.getColumnHeaderVisible();if(at!==1&&f.parent&&f.parent._allowUserZoom)p=o._getNewZoomFactor(at,f._zoomFactor),k&&o._touchZoomManager.restoreCanvas(k.canvas,p,ft,vt,yt),o._oldZoomFactor!==p&&(f._trigger(n.Events.UserZooming,{sheet:f,sheetName:f._name,oldZoomFactor:o._oldZoomFactor,newZoomFactor:p}),o._oldZoomFactor=p,tt._paintFloatingObject(t,p));else{var s=r.Cumulative.Translation.Y,h=r.Cumulative.Translation.X,w=r.Delta.Translation.Y,b=r.Delta.Translation.X,v=o._touchScrollManager,l,a,et,ot,st,ht,ct,lt,g=f.defaults.colWidth,nt=f.defaults.rowHeight;if(i(h)>i(s)){if(et=o._getNewLeftColumnInfo(h,v.oldLeftColumn),f._scrollLeftCol=et.col,f._syncHScollbarPosition(),l=et.width,st=f._getScrollableColumn(-1),ht=f._getScrollableColumn(f.getColumnCount(),!0),h>0&&v.oldLeftColumn===st&&f._scrollLeftCol===st?l=0:h<0&&v.oldLeftColumn===ht&&f._scrollLeftCol===ht&&(l=0),h>0&&h>l+g){if(h=l+g,b=0,o._reachMaxTranslationX&&r.IsInertia){r.IsComplete=!0;return}o._reachMaxTranslationX=!0}else if(h<0&&h<l-g){if(h=l-g,b=0,o._reachMaxTranslationX&&r.IsInertia){r.IsComplete=!0;return}o._reachMaxTranslationX=!0}else o._reachMaxTranslationX=!1;s=0;w=0;h=e(h);b=e(b);u||(o._xOffset=l-h,o._yOffset=0,o._lastDeltaEventArgs=r)}else{if(ot=o._getNewTopRowInfo(s,v.oldTopRow),f._scrollTopRow=ot.row,f._syncVScrollbarPosition(),a=ot.height,ct=f._getScrollableRow(-1),lt=f._getScrollableRow(f.getRowCount(),!0),s>0&&v.oldTopRow===ct&&f._scrollTopRow===ct?a=0:s<0&&v.oldTopRow===lt&&f._scrollTopRow===lt&&(a=0),s>0&&s>a+nt){if(s=a+nt,w=0,o._reachMaxTranslationY&&r.IsInertia){r.IsComplete=!0;return}o._reachMaxTranslationY=!0}else if(s<0&&s<a-nt){if(s=a-nt,w=0,o._reachMaxTranslationY&&r.IsInertia){r.IsComplete=!0;return}o._reachMaxTranslationY=!0}else o._reachMaxTranslationY=!1;h=0;b=0;s=e(s);w=e(w);u||(o._xOffset=0,o._yOffset=a-s,o._lastDeltaEventArgs=r)}k&&(r.IsInertia?v.restoreCanvasWithInertia(k.canvas,h,s,l,a,b,w,ft):v.restoreCanvas(k.canvas,h,s,l,a,ft))}}},r.prototype.doManipulationInertiaStarting=function(n){},r.prototype.doManipulationCompleted=function(n){var r=this,i=r.sheet,u=i._eventHandler,l=i._render,f,e,s;if(l._showTouchSelectionIndicator=!0,f=i._currentTarget,f.resizeInfo)u.stopResizing();else if(f.dragInfo&&u.isDraggingFill)u.endDragFill(),i.parent.touchToolStrip._closeAutoFillIndicator();else if(f.selectionHitInfo||u.isSelecting){if(u.stopSelecting(),e=f.selectionHitInfo,e){var v=e.isHeader,y=e.isFirstIndicator,p=e.type;r._changeActiveCellAfterSelect(v,y,p)}l.repaintSelection()}else if(s=n.Cumulative.Scale,s!==1&&i.parent&&i.parent._allowUserZoom)i._zoomFactor=r._getNewZoomFactor(s,i._zoomFactor),i.invalidateLayout(),i.repaint();else{var w=r._xOffset,b=r._yOffset,o=r._lastDeltaEventArgs;if(o){var h=160,c=20,a=h/c+1;r._scrollInterval=setInterval(function(){if(r._scrollInterval&&h<=0){i.invalidateLayout();i.repaint();i._syncHScollbarPosition();i._syncVScrollbarPosition();clearInterval(r._scrollInterval);r._scrollInterval=t;return}var n=o.Cumulative.Translation,u=o.Delta.Translation,f=b/a,e=w/a;n.Y+=f;u.Y=f;n.X+=e;u.X=e;r.doManipulationDelta(o,!0);h-=c},c)}}},r.prototype.doTapped=function(i){var h=this,r=h.sheet,d=!1,y,p,l,a,nt,v,it,w,b,k;h._clearTouchToolStripTimeout();typeof r.unSelectAllFloatingObjects=="function"&&r.unSelectAllFloatingObjects();y=r._commentManager;y&&y.deactivateComment();var f=r._eventHandler,u=h._touchHitTest(i.Position.X,i.Position.Y,!0),e=u.row,s=u.col,g=u.groupHitInfo;if(g)r.isEditing()||f._doClickRangeGroup(g);else if(r._currentTarget=u,u.filterButtonHitInfo){if(!r.endEdit())return;f._openFilterDialog(u.filterButtonHitInfo)}else if(!u.resizeInfo){if(p=r._render,p._existTouchDragFillIndicator&&!f.isDraggingFill&&r.parent.touchToolStrip._closeAutoFillIndicator(),l=r.getActiveRowIndex(),a=r.getActiveColumnIndex(),u.cellTypeHitInfo){if(e!==l||s!==a){if(nt=r.isPaintSuspended(),r.isPaintSuspended(!0),!r.endEdit())return;if(v={sheet:r,sheetName:r._name,row:l,col:a,cancel:!1},r._trigger(n.Events.LeaveCell,v),v&&v.cancel===!0)return;var rt=r._selectionModel.toArray(),tt=t,c=r._spanModel.find(e,s);tt=c?[new n.Range(c.row,c.col,c.rowCount,c.colCount)]:[new n.Range(e,s,1,1)];r._trigger(n.Events.SelectionChanging,{sheet:r,sheetName:r._name,oldSelections:rt,newSelections:tt});it=u.cellTypeHitInfo.isReservedLocation&&u.cellTypeHitInfo.isFocusAware;r._setActiveCellAndSelection(e,s,undefined,undefined,it);r._trigger(n.Events.EnterCell,{sheet:r,sheetName:r._name,row:e,col:s});r._trigger(n.Events.SelectionChanged,{sheet:r,sheetName:r._name});f._updateValidationUI(e,s);r.isPaintSuspended(nt);d=!0}else p.refreshTouchSelectionIndicator();w=r.getCellType(e,s,u.hitTestType);u.cellTypeHitInfo.sheet||(u.cellTypeHitInfo.sheet=r);w.processMouseDown(u.cellTypeHitInfo);w.processMouseUp(u.cellTypeHitInfo)}if(u.cellTypeHitInfo&&u.cellTypeHitInfo.isReservedLocation)return!0;else{r._trigger(n.Events.CellClick,{sheet:r,sheetName:r._name,sheetArea:u.hitTestType,row:u.row,col:u.col});try{if(f._hitTestResult=u,r.isEditing()&&l===r.getActiveRowIndex()&&a===r.getActiveColumnIndex()&&!r.endEdit())return}finally{f._hitTestResult=t}u.hitTestType===3&&f._updateValidationUI(e,s);h._isTouchSelected(e,s,u.hitTestType)&&!d?h._touchToolStripTimeout=setTimeout(function(){var t={x:u.x,y:u.y,handled:!1},i=r.parent.touchToolStrip;r._trigger(n.Events.TouchToolStripOpening,t);t.handled||i.open(u.x,u.y-pt);h._clearTouchToolStripTimeout()},o.DoubleTappedTimeOffset+20):(b=r._selectionModel.toArray(),f._startSelectingCore(u),k=r._selectionModel.toArray(),f._notEqualSelecions(b,k)&&r._trigger(n.Events.SelectionChanging,{sheet:r,sheetName:r._name,oldSelections:b,newSelections:k}),f.stopSelecting())}}},r.prototype.doDoubleTapped=function(t){var i=this.sheet,e,r,s,o,f,h,c,l,a,u;if(this._clearTouchToolStripTimeout(),o=i._currentTarget,o&&(i._trigger(n.Events.CellDoubleClick,{sheet:i,sheetName:i._name,sheetArea:o.hitTestType,row:o.row,col:o.col}),f=o.resizeInfo,f)){if(f.action==="sizeRow"){if(h=[],i._isRowSelected(f.index)){for(e=0;e<i._selectionModel.length;e++)if(r=i._selectionModel[e],r.col===-1)for(r=i._getActualRange(r),c=0;c<r.rowCount;c++)h.push({row:r.row+c})}else h.push({row:f.index});s=new n.UndoRedo.RowAutoFitUndoAction(i,h,f.sheetArea===1);i._doCommand(s)}else{if(l=[],i._isColumnSelected(f.index)){for(e=0;e<i._selectionModel.length;e++)if(r=i._selectionModel[e],r.row===-1)for(r=i._getActualRange(r),a=0;a<r.colCount;a++)l.push({col:r.col+a})}else l.push({col:f.index});s=new n.UndoRedo.ColumnAutoFitUndoAction(i,l,f.sheetArea===2);i._doCommand(s)}return}u=this._touchHitTest(t.Position.X,t.Position.Y,!0);u&&u.row>=0&&u.col>=0&&u.rowViewportIndex>=0&&u.colViewportIndex>=0&&!u.resizeInfo&&(i._clearSelectionImp(),i.addSelection(u.row,u.col,1,1),i._eventHandler.resumeFocus(!1),i._startEditImp(i._getCanvas(),u.row,u.col))},r.prototype.doRightTapped=function(n){},r.prototype.doTouchOperatorStart=function(n){var t=this.sheet,r=this._touchHitTest(n.Position.X,n.Position.Y),i;t.isEditing()?(r.row!==t._activeRowIndex||r.col!==t._activeColIndex)&&t._eventHandler.releaseFocus(r):(this._target=r,i=this._touchHitTest(n.Position.X,n.Position.Y,!0),i&&i.cellTypeHitInfo&&i.cellTypeHitInfo.isEditting||t._eventHandler.releaseFocus(i))},r.prototype.doTouchOperatorEnd=function(n){var r=this.sheet,t,i,u;r.isEditing()||(t=this._target,i=!0,t&&(t.cellTypeHitInfo&&t.cellTypeHitInfo.isReservedLocation?i=!1:(u=r.getCellType(t.row,t.col),u&&u.isEditting()&&(i=!1))),i&&r._eventHandler.resumeFocus())},r.prototype._touchHitTest=function(n,i,r){var h=this,e=h.sheet,a=e._render,u,l,o,s,c,v,y,p,w;return e._getSheetLayout(),u={x:n,y:i,rowViewportIndex:t,colViewportIndex:t,row:-1,col:-1,resizeInfo:t,hitTestType:t,groupHitInfo:t,filterButtonHitInfo:t,dragInfo:t,cellTypeHitInfo:t,selectionHitInfo:t},l=a.groupHitTest(n,i),l?u.groupHitInfo=l:(o=e._getRowViewportIndexFromY(i),s=e._getColumnViewportIndexFromX(n),u.rowViewportIndex=o,u.colViewportIndex=s,u.row=e._getRowIndexFromY(i,o),u.col=e._getColumnIndexFromX(n,s),o>=0&&o<=2&&s>=0&&(c=e._getCellLayoutByCell(o,s,f,u.row,u.col),c&&(u.row=c.row,u.col=c.col)),u.hitTestType=e._getSheetArea(o,s),(v=h._getTouchResizeInfo(u,n,i,10))?u.resizeInfo=v:a._existTouchDragFillIndicator&&(y=h._getDragFillInfo(u,n,i))?u.dragInfo=y:(p=e._getFilterButtonHitInfo(u,n,i))?u.filterButtonHitInfo=p:!r&&(w=h._getSelectionHitInfo(u,n,i))?u.selectionHitInfo=w:u.cellTypeHitInfo=e._getCellTypeHitInfo(u,n,i)),u},r.prototype._getTouchResizeInfo=function(n,i,r,u){var e=this.sheet,h=e._eventHandler,s=e.getSelections(),f=t;if(e._isTouchMode&&s.length>0){var o=s[s.length-1],c=o.row,a=o.row+o.rowCount-1,l=o.col,v=o.col+o.colCount-1;(!e.parent||e.parent._allowUserResize)&&(c!==-1&&l===-1&&n.rowViewportIndex>=0&&n.colViewportIndex<0&&e.rowHeaderVisible?(f=h._getResizeRowInfo(e,n,u,2,r),f&&f.action==="sizeRow"&&f.sheetArea===2&&f.index!==a&&(f=t)):c===-1&&l!==-1&&n.rowViewportIndex<0&&n.colViewportIndex>=0&&e.colHeaderVisible&&(f=h._getResizeColInfo(e,n,u,1,i),f&&f.action==="sizeCol"&&f.sheetArea===1&&f.index!==v&&(f=t)))}return f},r.prototype._getSelectionHitInfo=function(n,i,r){var s=this.sheet,c=s._render.getSelectionIndicatorRects(),h=s.getSelections(),o=3,f,e,u;for(s._isTouchMode&&h.length>0&&(f=h[h.length-1],f.row!==-1&&f.col!==-1?o=3:f.row!==-1?o=2:f.col!==-1&&(o=1)),e=0;e<c.length;e++)if(u=c[e],u.x-=u.width,u.y-=u.height,u.width*=3,u.height*=3,u.contains(i,r))return{x:i,y:r,type:o,isHeader:!1,isFirstIndicator:e===0};if(n.hitTestType===1)return{x:i,y:r,type:1,isHeader:!0};else if(n.hitTestType===2)return{x:i,y:r,type:2,isHeader:!0};return t},r.prototype._getDragFillInfo=function(n,i,r){var o=t,h=n.rowViewportIndex,c=n.colViewportIndex,f,p,l,v,a,y,e;if(typeof h===u||h===t||typeof c===u||c===t)return o;if(f=this.sheet,p=f._getActiveSelectedRange(),h>=0&&c>=0&&f._selectionModel.length===1){var s=f._getActualRange(p),w=f._frozenTrailingColCount,b=f._frozenTrailingRowCount,k=f.getColumnCount()-w,d=f.getRowCount()-b;if(c===1&&w>0&&s.col<k&&s.col+s.colCount>k&&(l=f._getColumnLayout(c),l&&l.length>0&&(v=l[l.length-1],i>v.x+v.width))||h===1&&b>0&&s.row<d&&s.row+s.rowCount>d&&(a=f._getRowLayout(h),a&&a.length>0&&(y=a[a.length-1],r>y.y+y.height)))return o}return e=f._render.getTouchDragFillIndicatorRect(),e&&(o||(e.x-=e.width,e.y-=e.height,e.width*=3,e.height*=3,e.contains(i,r)&&(o={action:"drag",side:"corner"})),f.canUserDragFill()||o&&o.side==="corner"&&(o.side=t)),o},r.prototype._getNewZoomFactor=function(n,t){var i=n*t;return i>4?i=4:i<.5&&(i=.5),i},r.prototype._getNewTopRowInfo=function(n,t){var r=this.sheet,f=r._getScrollableRow(-1),e=r._getScrollableRow(r.getRowCount(),!0),i=t,u=0;if(n>0){while(i>=f){if(u>=n)break;u+=r._getZoomRowHeight(i);i--}i<f&&(i=f)}else if(n<0){while(i<=e){if(u<=n)break;u-=r._getZoomRowHeight(i);i++}i>e&&(i=e)}return{row:i,height:u}},r.prototype._getNewLeftColumnInfo=function(n,t){var r=this.sheet,f=r._getScrollableColumn(-1),e=r._getScrollableColumn(r.getColumnCount(),!0),i=t,u=0;if(n>0){while(i>=f){if(u>=n)break;u+=r._getZoomColumnWidth(i);i--}i<f&&(i=f)}else if(n<0){while(i<=e){if(u<=n)break;u-=r._getZoomColumnWidth(i);i++}i>e&&(i=e)}return{col:i,width:u}},r.prototype._clearTouchToolStripTimeout=function(){this._touchToolStripTimeout&&(clearTimeout(this._touchToolStripTimeout),this._touchToolStripTimeout=t)},r.prototype._isTouchSelected=function(n,i,r){for(var u,e=!1,s=this.sheet,h=s._selectionModel,o=0,c=h.length;o<c;o++){if(u=h[o],r===3||typeof r===f||r===t)u=s._getActualRange(u),e=u.row<=n&&n<u.row+u.rowCount&&u.col<=i&&i<u.col+u.colCount;else if(r===2)e=u.col===-1&&u.row<=n&&n<u.row+u.rowCount;else if(r===1)e=u.row===-1&&u.col<=i&&i<u.col+u.colCount;else if(r===0)return e;if(e)return e}return e},r.prototype._changeActiveCellBeforeSelect=function(n,t,i){if(!n){var r=this.sheet,f=r.getSelections(),u=f[f.length-1];t?i===3?(r._activeRowIndex=u.row+u.rowCount-1,r._activeColIndex=u.col+u.colCount-1):i===2?(r._activeRowIndex=u.row+u.rowCount-1,r._activeColIndex=0):i===1&&(r._activeRowIndex=0,r._activeColIndex=u.col+u.colCount-1):i===3?(r._activeRowIndex=u.row,r._activeColIndex=u.col):i===2?(r._activeRowIndex=u.row,r._activeColIndex=0):i===1&&(r._activeRowIndex=0,r._activeColIndex=u.col)}},r.prototype._changeActiveCellAfterSelect=function(n,t,i){var r=this.sheet,f=r.getSelections(),u=f[f.length-1];(n||t)&&(i===3?(r._activeRowIndex=u.row,r._activeColIndex=u.col):i===2?(r._activeRowIndex=u.row,r._activeColIndex=0):i===1&&(r._activeRowIndex=0,r._activeColIndex=u.col))},r}(),wi=function(){function n(n,t,i){var r=this;r._touchEventProvider=i;r._touchMouseMessageFilter=new y(t);r._touchEventHandler=new pi(t);r._touchTarget=new p(n,"sheet",r._touchMouseMessageFilter,100,100);r._touchTarget.level=10;r._touchEventProvider.attachDettach(r._touchTarget,!0)}return n.prototype.attach=function(){var i=this._touchEventProvider,n=this._touchEventHandler,t=this._touchTarget;t.manipulationStarting=function(t){return n.doManipulationStarting(t)};t.manipulationStarted=function(t){return n.doManipulationStarted(t)};t.manipulationDelta=function(t){return n.doManipulationDelta(t)};t.manipulationInertiaStarting=function(t){return n.doManipulationInertiaStarting(t)};t.manipulationCompleted=function(t){return n.doManipulationCompleted(t)};t.tapped=function(t){return n.doTapped(t)};t.doubleTapped=function(t){return n.doDoubleTapped(t)};t.rightTapped=function(t){return n.doRightTapped(t)};t.touchOperatorStart=function(t){return n.doTouchOperatorStart(t)};t.touchOperatorEnd=function(t){return n.doTouchOperatorEnd(t)}},n.prototype.detach=function(){this._touchEventProvider.attachDettach(this._touchTarget,!1)},n.prototype.preProcessMouseDown=function(n){return this._touchMouseMessageFilter.preProcessMouseDown(n)},n.prototype.preProcessMouseUp=function(n){return this._touchMouseMessageFilter.preProcessMouseUp(n)},n.prototype.preProcessMouseMove=function(n){return this._touchMouseMessageFilter.preProcessMouseMove(n)},n}();n.TouchManager=wi,function(n){n[n.paste=0]="paste";n[n.cut=1]="cut";n[n.copy=2]="copy";n[n.autoFill=3]="autoFill"}(et||(et={}));ot=function(i){function r(n){i.call(this);var t=this;t._useWijmoTheme=!1;t._touchEventNamespace=".touchToolStrip";t._domButton="button";t._buttonClass="toolstrip-button";t._buttonStyleClass="toolstrip-button-style";t._textClass="toolstrip-text";t._imageClass="wijspread-toolstrip-image";t._itemClass="toolstrip-item";t._domSpan="span";t._seprateLineClass="touch-sperate-line";t._defaultSeprateLineColor="#CCC";t._domDiv="div";t._imageAreaHeight=32;t._separatorHeight=45;t._itemMinWidth=60;t.menuItems={};t.pasteName="wijspread_toolstrip_paste";t.copyName="wijspread_toolstrip_copy";t.cutName="wijspread_toolstrip_cut";t.autoFillName="wijspread_toolstrip_autofill";t._isOpen=!1;t.spreadHost=n;t._initDialog()}return __extends(r,i),r.prototype.open=function(n,i){var r=this,s=r.spreadHost.getActiveSheet(),f,e,u,o,h;if(s&&(window.gcGlobal.activeElement=t,f=$(s._getCanvas()).offset(),n+=f.left,i+=f.top,r._toolStripDialog.css({left:n,top:i}),r.show(),r._isOpen=!0,r.resetDialogPosition(),!r._isEmpty(r.menuItems))){e=r.menuItems;for(u in e)o=e[u],h=o.canExecute?o.canExecute.call(r):!0,h?$("#"+u).show():$("#"+u).hide()}},r.prototype.add=function(n){var t,u,r,f,i;n&&(t=this,u=t.menuItems,n instanceof v?(r=n.name(),r&&(u[r]=n,i=t._getMenuItemString(n,r),i&&t._addDom(i))):n instanceof h&&(f=n.name(),t.getItem(f)||(u[f]=n,i=t._getMenuItemString(n),i&&t._addDom(i))))},r.prototype.getItem=function(n){return this.menuItems[n]},r.prototype.getItems=function(){var n=this,i=[],r;if(!n._isEmpty(n.menuItems)){for(r in n.menuItems)i.push(n.menuItems[r]);return i}return t},r.prototype.remove=function(n){if(this.getItem(n)){$("#"+n).parent().remove();var i=this.menuItems[n];return delete this.menuItems[n],i}return t},r.prototype.clear=function(){this._toolStripDialog&&(this._toolStripDialog.find("td."+this._itemClass).remove(),this.menuItems={})},r.prototype.close=function(){var t=this,n,i,r;(window.gcGlobal.resumeEvent(),t._toolStripDialog&&t._toolStripDialog.hide(),t._isOpen=!1,t.closeOverlay(),n=t.spreadHost.getActiveSheet(),n)&&(i=n._render,n.setFocus(),r=n.getSelections(),i&&!i._existTouchDragFillIndicator&&r[0].row===-1&&r[0].col===-1&&n._clearSelectionImp())},r.prototype.imageAreaHeight=function(n){var t=this;return arguments.length===0?t._imageAreaHeight:n<=0?void 0:(t._imageAreaHeight=n,t._toolStripDialog.find("span."+t._imageClass).css("height",n+"px"),t)},r.prototype.itemHeight=function(n){var t=this._toolStripDialog.find("button."+this._buttonClass);return arguments.length===0?parseFloat(t.css("height")):n<=0?void 0:(t.css("height",n+"px"),this)},r.prototype.itemWidth=function(n){var t=this._toolStripDialog.find("button."+this._buttonClass),i;return arguments.length===0?parseFloat(t.css("width")):n<0?void 0:(i=parseFloat(t.css("min-width")),i>n&&t.css("min-width",n),t.css("width",n+"px"),this)},r.prototype.separatorHeight=function(n){var t=this;return arguments.length===0?t._separatorHeight:n<=0?void 0:(t._separatorHeight=n,t._toolStripDialog.find("div."+t._seprateLineClass).css("height",n+"px"),t)},r.prototype.useWijmoTheme=function(n){var r=this;if(typeof n=="undfined")return r._useWijmoTheme;if(typeof n=="boolean"&&r._useWijmoTheme!==n){i.prototype.useWijmoTheme.call(this,n);var u=r._toolStripDialog,c=u.find("span."+r._textClass),f=u.find("button."+r._buttonClass),l=u.find("div."+r._seprateLineClass),e="ui-state-default",o="toolstrip-default",s="ui-state-default ui-widget",h=r._buttonStyleClass;return u.removeClass(n?o:e),u.addClass(n?e:o),f.addClass(n?s:h),f.removeClass(n?h:s),l.css("background-color",n?c.css("color"):r._defaultSeprateLineColor),r}return t},r.prototype.repaint=function(){this.useWijmoTheme(this.spreadHost.useWijmoTheme)},r.prototype._createLayoutTable=function(){var n=$("<table>").css({padding:0,display:"table"}).attr({cellspacing:0,cellpadding:0});this._tableRow=$("<tr>").appendTo(n);n.appendTo(this._toolStripDialog)},r.prototype._dispose=function(){var n=this,i=n._toolStripDialog;i&&(n._isOpen&&window.gcGlobal.resumeEvent(),i.remove(),n.closeOverlay(),i=t)},r.prototype._isEmpty=function(n){return!n||JSON.stringify(n)==="{}"?!0:!1},r.prototype._initDialog=function(){var n=this;n._toolStripDialog||((n._toolStripDialog=n.getContainer()).addClass("toolstrip-default").appendTo(document.body).hide(),n._createLayoutTable(),n._setDefaultCellDomString(),n._attachEvent())},r.prototype._attachEvent=function(){var n=this;this._toolStripDialog.bind("click",function(t){var i=t.target,f=$(i).get(0).tagName.toLowerCase(),r,u;r=f==="button"?$(i).attr("id"):$(i).parents("button").attr("id");u=n.menuItems[r];r&&u&&u.command.call(n)})},r.prototype._addDom=function(n){var t=this.spreadHost.getActiveSheet();t&&this._toolStripDialog&&n&&$("<td>").append($(n)).appendTo(this._tableRow).addClass(this._itemClass)},r.prototype._setDefaultCellDomString=function(){var t=this,i=r._getImageSrc(0),u=r._getImageSrc(1),f=r._getImageSrc(2),e=r._getImageSrc(3);t._pasteItem=new h(t._getItemName(t.pasteName),n.SR.ToolStrip_PasteText,i,t._doTapPaste);t._cutItem=new h(t._getItemName(t.cutName),n.SR.ToolStrip_CutText,u,t._doTapCut);t._copyItem=new h(t._getItemName(t.copyName),n.SR.ToolStrip_CopyText,f,t._doTapCopy);t._autoFillItem=new h(t._getItemName(t.autoFillName),n.SR.ToolStrip_AutoFillText,e,t._showAutoFillIndicator,t._hideAutoFill);t.add(t._pasteItem);t.add(t._cutItem);t.add(t._copyItem);t.add(new v(t._hideAutoFill));t.add(t._autoFillItem)},r.prototype._hideAutoFill=function(){var r=this.spreadHost.getActiveSheet(),t,n,i;if(!r)return!1;for(t=r.getSelections(),n=0;n<t.length;n++)if(i=t[n],i.row===-1&&i.col===-1)return!1;return!0},r.prototype._showAutoFillIndicator=function(){var n,i,t;(this.close(),n=this.spreadHost.getActiveSheet(),n)&&((i=n.getSelections().length,i>1)||(t=n._render,t._existTouchDragFillIndicator=!0,t.repaintSelection()))},r.prototype._closeAutoFillIndicator=function(){var t=this.spreadHost.getActiveSheet(),n;t&&(n=t._render,n._existTouchDragFillIndicator=!1,n.repaintSelection())},r.prototype._doTapCopy=function(){var n=this.spreadHost.getActiveSheet();n&&(this._clipboardTouchData=n._doCopy(!0));this.close()},r.prototype._doTapCut=function(){var n=this.spreadHost.getActiveSheet();n&&(this._clipboardTouchData=n._doCut(!0));this.close()},r.prototype._doTapPaste=function(){var n=this,t=n.spreadHost.getActiveSheet();t&&typeof n._clipboardTouchData!==u&&t._doPaste(n._clipboardTouchData);n.close()},r.prototype._getMenuItemString=function(n,i){var r=this,u="",f="",e="",s="",o;if(n.name&&(i=n.name()),n.image&&(u=r._getDomElementString(r._domSpan,i+"Image",t,{"class":r._imageClass,style:'background-image: url("'+n.image()+'");background-repeat: no-repeat;display: block;height:'+r._imageAreaHeight+"px;background-position-x:50%"})),n._font&&(e+="font:"+n._font+";"),n.text&&i&&(f=r._getDomElementString(r._domSpan,i+"Text",n.text(),{"class":r._textClass,style:e})),u&&i)return o=r._useWijmoTheme?"ui-state-default ui-widget":r._buttonStyleClass,r._getDomElementString(r._domButton,i,u+f,{"class":r._buttonClass+" "+o,style:"border: 0px;padding:4px;margin:3px;min-width:"+r._itemMinWidth+"px;"});else if(n instanceof v)return r._getDomElementString(r._domDiv,i,t,{"class":r._seprateLineClass,style:"width:1px;height:"+r._separatorHeight+"px;display:inline-block;background-color:"+r._defaultSeprateLineColor+";margin-left:5px;margin-right:5px;opacity:0.6"})},r.prototype._getDomElementString=function(n,t,i,r,u){var e="<"+n+" ";return t&&(e+="id='"+t+"' "),r&&$.each(r,function(n,t){e+=n+"='"+t+"' "}),e+=i?">"+i+"<\/"+n+">":u===f?"><\/"+n+">":u===!0?">":"/>"},r.prototype._getItemName=function(n){for(var t=0,i=n+t;document.getElementById(i);)t++,i=n+t;return i},r.prototype._updateResource=function(){var t=this,i=t._textClass;$("#"+t._pasteItem._name).find("span."+i).text(n.SR.ToolStrip_PasteText);$("#"+t._cutItem._name).find("span."+i).text(n.SR.ToolStrip_CutText);$("#"+t._copyItem._name).find("span."+i).text(n.SR.ToolStrip_CopyText);$("#"+t._autoFillItem._name).find("span."+i).text(n.SR.ToolStrip_AutoFillText)},r._getImageSrc=function(n){switch(n){case 0:return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA8ElEQVRIS92VwQ3CMAxFe + qZERiHY8dgDI4cYYNOhDhwY4ayQviW4q / Eddu0KRe + 9CQ72P8rEpAmhPBT3ENLd76EiPv5HO5hSmK + KYTFsz + 04A4G9NZ0hAizn7jTos2MFRYYugFZQlscoFzRZsYKCwwNulAqnZddtJmxwiIZ3oT6WFh4S2tQHwsLb2kN6mNh4S2tQX0sLLwly4IyY4WFZ2gReV / ZhBOQH2ddgKcYwBAc7R / weL0ZgqO6gGPXE1E0JlBdwJx2CUhvkCL63xvw33QKUc0N + B5MIaq5gb5o8kotBszJDShFlkvQ + ZHBvoTmC + fiVfoq / m86AAAAAElFTkSuQmCC";case 1:return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAABkklEQVRIS7WTUXECQRBEcYCFOIiESAAH / OYPCcQBEogDJCABCUhAwqXf1QzVM0cojko + Xt3ObG / 33t7eYhiGf6UU68 + vneD5Mu4HpZDgKja + YCYH94NSSHAUg3glZC9k8zgAYwLmhuS6o / tBKUJ8CTGsoveIsin3g1LEAkxzAd / kXbihwxwatGys+ EEpEAT5LR6FuDmMb + t + UAoEwVL44h7CvB8lGxrn3A9KkaLAj8pDMD9HL / v0ZgfAQfSAk / WgXAT3g1K4MPCj2AoPhNvRJO4HpejigF1jxtjNy9Ek7gel6GIjfzoP + Ihewf2gFPcWNNL817 / c / aAUKXpbfy / FXlzFIM6gOYy3Gp + iz / xBPHeLQGLAMI2PNmYOw1uojZfdCyYNCXexiGcGpiljdp9hsBGjvnvBpCHhRbgBZChjAgj0eXrX7gWThoR992lAMGOOLMfJuIHuBZMGQuE75KN66Cpq14xH2L1g0kixyLNm3I8sNbwJulHfvWDSkJArmou4hlxXeh4AvBEBuZnnbtHfMix + AHqkr6wgQ4Q7AAAAAElFTkSuQmCC";case 2:return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA3UlEQVRIS72PwQ3CMAxFOwrjcOyZCTgyAjfWYCJO3JiCCVL / iFSO9W0MDTzpqYob + ztTKeWn0uJIadE6H8 / ljXsR96q6tzt4YogH / olPcQ2R8mp3CHRBwO3 + 6EKkvNodcDkSgyyoAx0iRz / AA / 8Op0sdtJuv1Va3Ct8FYHgL8dgUAGxIe41 + kRAH6CbdaGW86nFAhnaXLSLEAbqJCbxlUgEZ2DIgFaCbmMBbJhWQgS0DUgG6iQm8ZVIBGTYFsK21oN3F1yrEARnsIM / u8JeAT9S9nrQ4UlocKS2Os0wLtkPMdu9POt0AAAAASUVORK5CYII =";case 3:return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAXCAIAAABrvZPKAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwwAADsMBx2 + oZAAAAIdJREFUOE / tzEEKgCAQheEOWLdx351adYc8Qgs3rbuAUC9nkkF0BKNN9CMy0Xx25llf8Edr7d57j / tlP4wTHf4W / b7gsT0vLs7Sz9bFWfM9nrDXE9ITphlVPO512wkkM++FNF86vBfKeKR43rjLe5QwOvxPVPSoipHmkY5RxSMFo7rXY9 + eMSdet07b6c / bnwAAAABJRU5ErkJggg =="}},r}(n.BaseDialog);n.TouchToolStrip=ot;h=function(){function n(n,t,i,r,u){this._font="normal 12px Arial";var f=this;f._name=n;f._text=t;f._image=i;r&&(f.command=r);u&&(f.canExecute=u)}return n.prototype.name=function(n){var t=this;return arguments.length===0?t._name:($("#"+t._name).attr("id",n),$("#"+t._name+"Text").attr("id",n+"Text"),$("#"+t._name+"Image").attr("id",n+"Image"),t._name=n,t)},n.prototype.text=function(n){var t=this;return arguments.length===0?t._text:(t._text=n,$("#"+t.name()+"Text").text(n),t)},n.prototype.font=function(n){var t=this,i=$("#"+t.name()+"Text");return arguments.length===0?t._font:(t._font=n,i.css("font",n),t)},n.prototype.foreColor=function(n){var t=this,i=$("#"+t.name()+"Text");return arguments.length===0?t._foreColor?t._foreColor:i.css("color"):(i.css("color",n),t)},n.prototype.image=function(n){var t=this;return arguments.length===0?t._image:(t._image=n,$("#"+t.name()+"Image").css("background-image","url("+n+")"),t)},n}();n.TouchToolStripItem=h;v=function(){function n(n){this._name=this._getSeparatorName();n&&(this.canExecute=n)}return n.prototype.name=function(){return this._name},n.prototype._getSeparatorName=function(){for(var n=0,t="separator"+n;document.getElementById(t);)n++,t="separator"+n;return t},n}();n.TouchToolStripSeparator=v;y=function(){function n(n){this.owner=n}return n.prototype.preProcessManipulationStarting=function(){this.eventMode=2;this.owner._isTouchMode=!0},n.prototype.postProcessManipulationComplete=function(){this.eventMode=0;this.touchCompleteTimestamp=(new Date).valueOf()},n.prototype.preProcessPointerDown=function(){return this.eventMode===1},n.prototype.preProcessPointerUp=function(){return this.eventMode===1},n.prototype.preProcessPointerMove=function(){return this.eventMode===1},n.prototype.preProcessMouseDown=function(n){var t=this;if(t.eventMode===2)return!0;else if(t.touchCompleteTimestamp)if((new Date).valueOf()-t.touchCompleteTimestamp<=200)return t.mouseDownHandled++,!0;else t.touchCompleteTimestamp=0,t.mouseDownHandled=0,t.eventMode=1;else t.eventMode=1;return t.owner._isTouchMode=!1,!1},n.prototype.preProcessMouseUp=function(n){var t=this;return t.mouseDownHandled?(t.mouseDownHandled--,!0):t.eventMode===2?!0:(t.eventMode=0,!1)},n.prototype.preProcessMouseMove=function(n){return this.eventMode===2},n}();n.TouchMouseMessageFilter=y,function(n){n[n.None=0]="None";n[n.MouseMode=1]="MouseMode";n[n.TouchMode=2]="TouchMode"}(st||(st={}));ht=function(){function r(n){this._tab=n}return r.prototype.doManipulationStarting=function(n){},r.prototype.doManipulationStarted=function(n){var i=this,t=i._tab,s=t._spread.getActiveSheet();t._tabNameEditor&&t.endSheetTabEditing(s,!1);var h="resizeBar",c="tab",l="newTab",r=t._hitTest(n.Position.X,n.Position.Y);if(r.element===h)t.resizeTab=!0,t.activeX=n.Position.X;else if(r.element===c||r.element===l||r.element===""){var u=t.canvas,f=u.width,e=u.height,o=i._getTouchCanvas(f,e);o.getContext("2d").drawImage(u,0,0,f,e);i._canvas=o;i._oldFirstTab=t._firstTab}i._minFirstTabIndex=t._getNextVisibleIndex(-1);i._maxFirstTabIndex=t._reCalculateFirstTabIndex(t._getVisibleTabs())},r.prototype.doManipulationDelta=function(r){var w=this,f=w._tab,rt,ut,b,k,l,tt,h,s,c,a,e,v,g,y;if(f.resizeTab){var st=r.Position.X-f.activeX,p=f._spread,it=p._vp.clientWidth;p.setTabStripRatio(p._getActualTabStripRatio()+st/it,!0);rt=f._resizeBarWidth/it;ut=1;p._getActualTabStripRatio()<rt?(p.setTabStripRatio(rt,!0),f.activeX=f._resizeBarWidth):p._getActualTabStripRatio()>=ut?(p.setTabStripRatio(ut,!0),f.activeX=it):f.activeX=r.Position.X}else{if(b=w._canvas,k=w._oldFirstTab,!b||typeof k===u||k===t)return;var ft=w._minFirstTabIndex,et=w._maxFirstTabIndex,nt=f._newTabSize,d=f._getTabStartPosition(),o=r.Cumulative.Translation.X,ot=w._getNewFirstTabInfo(o,k);f._firstTab=ot.firstTab;l=ot.width;o>0&&k===ft&&f._firstTab===ft?l=0:o<0&&k===et&&f._firstTab===et&&(l=0);o>0&&o>l+nt?o=l+nt:o<0&&o<l-nt&&(o=l-nt);o!==0&&(tt=f.canvas,h=tt.getContext("2d"),h.save(),h.clearRect(0,0,tt.width,tt.height),s=f.getBounds(),h.fillStyle=f._getTabStripBackColor(h,s),h.fillRect(s.x,s.y,s.width,s.height),a=0,v=s.height,o>0?(c=d,g=c+o,e=s.x+s.width-f._resizeBarWidth-g,e>0&&h.drawImage(b,c,a,e,v,g,a,e,v),y=o-l,s.x+s.width-f._resizeBarWidth-d<=o&&(y=0),e=l,c=d,e>0&&(h.translate(y,0),f.paintTabs(h,new n.Rect(c,a,e,v)),h.translate(-y,0))):o<0&&(g=d,c=g+i(o),e=s.x+s.width-f._resizeBarWidth-c,e>0&&h.drawImage(b,c,a,e,v,g,a,e,v),y=o-l,s.x+s.width-f._resizeBarWidth-d<=i(o)&&(y=0),e=i(l),c=s.x+s.width-f._resizeBarWidth-e,e>0&&(h.translate(y,0),f.paintTabs(h,new n.Rect(c,a,e,v)),h.translate(-y,0))),c=0,e=d,h.drawImage(b,c,a,e,v,c,a,e,v),c=s.width-f._resizeBarWidth,e=f._resizeBarWidth,h.drawImage(b,c,a,e,v,c,a,e,v),h.restore())}},r.prototype.doManipulationInertiaStarting=function(n){},r.prototype.doManipulationCompleted=function(n){var t=this._tab;t.resizeTab?(t.resizeTab=!1,t._spread._doTabHSResize()):t.repaint()},r.prototype.doTapped=function(n){var t=this._tab,r=t._spread,f=r.getActiveSheet(),u;t._tabNameEditor&&t.endSheetTabEditing(f,!1);var e="navButton",o="tab",s="newTab",i=t._hitTest(n.Position.X,n.Position.Y);r._suspendSetFocus=!0;try{i.element===e?t.doNavButtonClick(i.index,!0):i.element===o?t.doSheetTabClick(i.index,i.position):i.element===s&&t.doNewTabClick(i.position)}finally{r._suspendSetFocus=!1;u=r.getActiveSheet();u!==f&&(u._isTouchMode=!0,u.setFocus())}},r.prototype.doDoubleTapped=function(n){return this._tab._doMouseDbClickImp(n.Position.X,n.Position.Y)},r.prototype.doRightTapped=function(n){},r.prototype._getTouchCanvas=function(n,t){var i=document.createElement("canvas");return i.width=n,i.height=t,i},r.prototype._getNewFirstTabInfo=function(n,t){var o=this._tab,e=o._tabSizes,f=this._minFirstTabIndex,u=this._maxFirstTabIndex,i=t,r=0;if(n>0){while(i>=f){if(r>n)break;r+=e[i];i--}i<f&&(i=f)}else if(n<0&&u!==-1){while(i<=u){if(r<n)break;r-=e[i];i++}i>u&&(i=u)}return{firstTab:i,width:r}},r}();ct=function(){function n(n,t,i){var f=this,r,u;f._touchMouseMessageFilter=new y(f);f._touchTarget=new p(n,"tabStrip",f._touchMouseMessageFilter,1,-1);f._touchEventProvider=i;f._touchEventHandler=new ht(t);r=f._touchEventHandler;u=f._touchTarget;u.manipulationStarting=function(n){return r.doManipulationStarting(n)};u.manipulationStarted=function(n){return r.doManipulationStarted(n)};u.manipulationDelta=function(n){return r.doManipulationDelta(n)};u.manipulationInertiaStarting=function(n){return r.doManipulationInertiaStarting(n)};u.manipulationCompleted=function(n){return r.doManipulationCompleted(n)};u.tapped=function(n){return r.doTapped(n)};u.doubleTapped=function(n){return r.doDoubleTapped(n)};u.rightTapped=function(n){return r.doRightTapped(n)}}return n.prototype.bindTouchEvents=function(){this._touchEventProvider&&this._touchEventProvider.attachDettach(this._touchTarget,!0)},n.prototype.unbindTouchEvents=function(){this._touchEventProvider&&this._touchEventProvider.attachDettach(this._touchTarget,!1)},n.prototype.preProcessMouseDown=function(n){return this._touchMouseMessageFilter.preProcessMouseDown(n)},n.prototype.preProcessMouseUp=function(n){return this._touchMouseMessageFilter.preProcessMouseUp(n)},n.prototype.preProcessMouseMove=function(n){return this._touchMouseMessageFilter.preProcessMouseMove(n)},n}();n.TabStripTouchManager=ct;lt=function(){function n(n,t,i){var f=this,u,r;f._touchMouseMessageFilter=new y(f);f._touchTarget=new p(n,"FL_"+t.name,f._touchMouseMessageFilter,1,200);f._touchEventProvider=i;f._touchEventHandler=new at(n,t);u=f._touchEventHandler;r=f._touchTarget;r.canDoManipulation=function(){return t.floatingObject().isSelected()};r.canDoTap=function(){return!0};r.manipulationStarting=function(n){return u.doManipulationStarting(n)};r.manipulationStarted=function(n){return u.doManipulationStarted(n)};r.manipulationDelta=function(n){return u.doManipulationDelta(n)};r.manipulationInertiaStarting=function(n){return u.doManipulationInertiaStarting(n)};r.manipulationCompleted=function(n){return u.doManipulationCompleted(n)};r.tapped=function(n){return u.doTapped(n)};r.doubleTapped=function(n){return u.doDoubleTapped(n)};r.rightTapped=function(n){return u.doRightTapped(n)}}return n.prototype.attach=function(){this._touchEventProvider&&this._touchEventProvider.attachDettach(this._touchTarget,!0)},n.prototype.detach=function(){this._touchEventProvider&&this._touchEventProvider.attachDettach(this._touchTarget,!1)},n.prototype.preProcessMouseDown=function(n){return this._touchMouseMessageFilter.preProcessMouseDown(n)},n.prototype.preProcessMouseUp=function(n){return this._touchMouseMessageFilter.preProcessMouseUp(n)},n.prototype.preProcessMouseMove=function(n){return this._touchMouseMessageFilter.preProcessMouseMove(n)},n}();n.FloatingObjectTouchManager=lt;at=function(){function n(n,t){this._floatingObjectRender=t;this._floatingObject=t.floatingObject();this._containerElement=n}return n.prototype._positionToPage=function(n,t){var u=new r(t.X,t.Y),i=$(this._containerElement).offset();return i&&(isNaN(document.body.clientTop)||(i.top+=document.body.clientTop),isNaN(document.body.clientLeft)||(i.left+=document.body.clientLeft),u.X+=i.left,u.Y+=i.top),u},n.prototype.doManipulationStarting=function(n){n.Mode=3},n.prototype.doManipulationStarted=function(n){var t=this._positionToPage(n.OriginalSource,n.Position);this._floatingObjectRender._doMouseDown({isTouch:!0,button:0,pageX:t.X,pageY:t.Y,stopPropagation:function(){}})},n.prototype.doManipulationDelta=function(n){var t=this._positionToPage(n.OriginalSource,n.Position);this._floatingObjectRender._doMouseMove({isTouch:!0,button:0,pageX:t.X,pageY:t.Y,stopPropagation:function(){}})},n.prototype.doManipulationInertiaStarting=function(n){},n.prototype.doManipulationCompleted=function(n){var t=this._positionToPage(n.OriginalSource,n.Position);this._floatingObjectRender._doMouseUp({isTouch:!0,button:0,pageX:t.X,pageY:t.Y,stopPropagation:function(){}})},n.prototype.doTapped=function(n){try{var t=this._floatingObjectRender._sheet,i=t.isPaintSuspended();t.isPaintSuspended(!0);this._floatingObject.isSelected()||(t.unSelectAllFloatingObjects(),this._floatingObject.isSelected(!0),window.gcGlobal.activeElement=t);t.clearSelection()}finally{t.isPaintSuspended(i)}},n.prototype.doDoubleTapped=function(n){},n.prototype.doRightTapped=function(n){},n}();p=function(){function n(n,t,i,r,u){var f=this;f.element=n;f.messageFilter=i;f.eventFlag=t;f.maxPointer=r;f.level=u}return n}();n.TouchTargetElement=p;vt=function(){function i(){}return i.prototype.simulateMouseEvent=function(i,r){var f=i.originalEvent,e,o;f.isPrimary!==!1&&(f.touches&&f.touches.length>=1&&f.targetTouches&&f.targetTouches.length>=1&&(f.touches[0].clientX!==f.targetTouches[0].clientX||f.touches[0].clientY!==f.targetTouches[0].clientY)||(n.util.cancelDefault(i),e=typeof f.changedTouches!==u?f.changedTouches[0]:f,o=document.createEvent("MouseEvents"),o.initMouseEvent(r,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,t),i.target.dispatchEvent(o)))},i.prototype.down=function(n){if(!n.pointerType||n.pointerType===n.MSPOINTER_TYPE_TOUCH||n.pointerType==="touch"){var t=n.data;if(t.touchHandled)return;t.touchHandled=!0;t._touchMoved=!1;t.simulateMouseEvent(n,"mouseover");t.simulateMouseEvent(n,"mousemove");t.simulateMouseEvent(n,"mousedown")}},i.prototype.move=function(n){if(!n.pointerType||n.pointerType===n.MSPOINTER_TYPE_TOUCH||n.pointerType==="touch"){var t=n.data;if(!t.touchHandled)return;t._touchMoved=!0;t.simulateMouseEvent(n,"mousemove")}},i.prototype.up=function(n){if(!n.pointerType||n.pointerType===n.MSPOINTER_TYPE_TOUCH||n.pointerType==="touch"){var t=n.data;if(!t.touchHandled)return;t.simulateMouseEvent(n,"mouseup");t.simulateMouseEvent(n,"mouseout");t._touchMoved||t.simulateMouseEvent(n,"click");t.touchHandled=!1}},i.prototype.bindUnBindTouchEvents=function(n,i,r){var f=this,p=r.charAt(0);p!=="."&&(r="."+r);var e="MSPointerDown"+r,o="MSPointerMove"+r,s="MSPointerUp"+r,h="pointerdown"+r,c="pointermove"+r,l="pointerup"+r,a="touchstart"+r,v="touchmove"+r,y="touchend"+r;i?window.navigator.msPointerEnabled?(n.style.msTouchAction!==t&&typeof n.style.msTouchAction!==u&&(n.style.msTouchAction="none"),$(n).bind(e,f,f.down).bind(h,f,f.down),$(document).bind(o,f,f.move).bind(c,f,f.move).bind(s,f,f.up).bind(l,f,f.up)):$(n).bind(a,f,f.down).bind(v,f,f.move).bind(y,f,f.up):window.navigator.msPointerEnabled?($(n).unbind(e).unbind(h),$(document).unbind(o).unbind(c).unbind(s).unbind(l)):$(n).unbind(a).unbind(v).unbind(y)},i}();n._SimulateMouseEvents=vt})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){(function(n){var ui,wt,a,rt,ut,ft,bt,et,v;n.feature("floatingObject",["core.common","core.stringResource","core.sheet_action","core.imageLoader"]);var i=null,t=undefined,e=Math.ceil,h=Math.floor,l=Math.max,r=Math.min,u=Math.abs,ot="#044062",fi=0,c=1,ei=2,st=9007199254740992,o=4,oi=7,kt=700,dt=701,y="position",p="absolute",ht="100%",ct="background",si="background-image",lt="floatingobject-selected",at="floatingobject-unselected",f="floatingobject-resize-indicator-select",w="floatingobject-resize-indicator-unSelect",s="floatingobject-none-user-select",b="floatingobject-content-container",gt="floatingobject-container",ni="floatingobject-moving-container",ti="floatingobject-moving-div",ii="floatingobject-background-cover",vt=".floatingobject-resize-indicator",k="div.floatingobject-resize-indicator.floatingobject-top.floatingobject-left",d="div.floatingobject-resize-indicator.middle.floatingobject-left",g="div.floatingobject-resize-indicator.floatingobject-bottom.floatingobject-left",yt="div.floatingobject-resize-indicator.floatingobject-top.floatingobject-center",pt="div.floatingobject-resize-indicator.floatingobject-bottom.floatingobject-center",nt="div.floatingobject-resize-indicator.floatingobject-top.floatingobject-right",tt="div.floatingobject-resize-indicator.middle.floatingobject-right",it="div.floatingobject-resize-indicator.floatingobject-bottom.floatingobject-right",ri='<div class="floatingobject-resize-indicator floatingobject-top floatingobject-left floatingobject-absolute"><\/div><div class="floatingobject-resize-indicator floatingobject-top floatingobject-center floatingobject-absolute"><\/div><div class="floatingobject-resize-indicator floatingobject-top floatingobject-right floatingobject-absolute"><\/div><div class="floatingobject-resize-indicator middle floatingobject-left floatingobject-absolute"><\/div><div class="floatingobject-resize-indicator middle floatingobject-right floatingobject-absolute"><\/div><div class="floatingobject-resize-indicator floatingobject-bottom floatingobject-left floatingobject-absolute"><\/div><div class="floatingobject-resize-indicator floatingobject-bottom floatingobject-center floatingobject-absolute"><\/div><div class="floatingobject-resize-indicator floatingobject-bottom floatingobject-right floatingobject-absolute"><\/div>',hi="input",ci=".gcFloatingObject";(function(n){n[n.CustomFloatingObject=0]="CustomFloatingObject";n[n.Picture=1]="Picture"})(n.FloatingObjectType||(n.FloatingObjectType={}));ui=n.FloatingObjectType;wt=function(r){function u(n){r.call(this);this._floatingObjectType=i;this._sheet=n}return __extends(u,r),u.prototype.ownerSheet=function(n){return arguments.length===0?this._sheet:(this._sheet=n,this)},u.prototype.find=function(n){var t=this._findItemIndex(n);return t>=0?this[t]:i},u.prototype.replace=function(r,u){if(u===i||u===t)throw new Error(n.SR.Exp_ValueIsNull);var f=this._findItemIndex(r);f>=0&&this.splice(f,1,u)},u.prototype.add=function(r){var u=r.name();if(u===i||u===t)throw new Error(n.SR.Exp_FloatingObjectNameEmptyError);this._checkObjectExists(u);r.owner(this._sheet);this.push(r)},u.prototype.remove=function(n){if(n!==i&&n!==t){var r=this._findItemIndex(n.name());return r>=0&&n.owner(i),this.splice(r,1),!0}return!1},u.prototype.addRows=function(n,t){for(var i=0,r=this.length;i<r;i++)this[i].addRows(n,t)},u.prototype.removeRows=function(n,t){for(var u=this,e=[],r,i=0,f=u.length;i<f;i++)r=u[i],u._isCoverRange(n,-1,n+t-1,u._sheet.getColumnCount(),r)&&(r.dynamicMove()||r.dynamicSize())?e.push(r):r.removeRows(n,t);for(i=0,f=e.length;i<f;i++)u.remove(e[i])},u.prototype.addColumns=function(n,t){for(var i=0,r=this.length;i<r;i++)this[i].addColumns(n,t)},u.prototype.removeColumns=function(n,t){for(var u=this,e=[],r,i=0,f=u.length;i<f;i++)r=u[i],u._isCoverRange(-1,n,u._sheet.getRowCount(),n+t-1,r)&&(r.dynamicMove()||r.dynamicSize())?e.push(r):r.removeColumns(n,t);for(i=0,f=e.length;i<f;i++)u.remove(e[i])},u.prototype._isCoverRange=function(n,t,i,r,u){var f=u.startRow(),e=u.startColumn(),o=u.endRow(),s=u.endColumn();return n<=f&&t<=e&&i>=o&&r>=s},u.prototype._checkObjectExists=function(t){if(this._sheet._findFloatingObjectInternal(t))throw new Error(n.SR.Exp_FloatingObjectHasSameNameError);},u.prototype._findItemIndex=function(n){for(var i=this.length,t=0;t<i;t++)if(this[t].name()===n)return t;return-1},u.prototype._updateFloatingsObjectlayoutOnColumnRowChanged=function(){for(var n,t=0,i=this.length;t<i;t++)n=this[t],n.dynamicMove()?n._updateFloatingObjectLocation():n._updateStartPosition(),n.dynamicSize()?n._updateFloatingObjectSize():n._updateEndPosition()},u.prototype.toJSON=function(){for(var i=[],n=0,r=this.length;n<r;n++)i.push(this[n].toJSON());return i.length===0?t:{floatingObjects:i}},u.prototype.fromJSON=function(n){var f,o,r,u,t,s,e;if(n&&n.floatingObjects)for(f=n.floatingObjects,o=f.length,r=0;r<o;r++)u=f[r],t=i,u&&(s=this._getFloatingObjectTypes(),e=s[u.floatingObjectType],e&&(t=new e,t.owner(this._sheet),t.fromJSON(u))),t&&this.push(t)},u.prototype._getFloatingObjectTypes=function(){if(!this._floatingObjectType){var n={};n[0]=rt;n[1]=ut;this._floatingObjectType=n}return this._floatingObjectType},u}(n._XArray);n._FloationgObjectArray=wt;a=function(){function r(i,r,u,f,e){this._cacheOffset={startRowOffset:t,startColumnOffset:t,endRowOffset:t,endColumnOffset:t};this._isFOColumnsOrRowsVisible=!0;var o=this;o._name=i;o._location=new n.Rect(typeof r=="number"?r:0,typeof u=="number"?u:0,typeof f=="number"?f:0,typeof e=="number"?e:0);o._canPrint=!0;o._isLocked=!0;o._isVisible=!0;o._isSelected=!1;o._dynamicMove=!0;o._dynamicSize=!0}return r.prototype.name=function(t){var i=this;if(arguments.length===0)return i._name;if(typeof t!="string"||t==="")throw new Error(n.SR.Exp_FloatingObjectNameEmptyError);return i._name!==t&&(i._name=t,i._trigger({sheet:i._sheet,sheetName:i._sheet?i._sheet._name:"",floatingObject:i,propertyName:"name"})),i},r.prototype.owner=function(n){var t=this;return arguments.length===0?t._sheet:(t._sheet=n,t._updateFloatingObjectCoorinates(),t)},r.prototype.isSelected=function(n){var t=this,i=t._sheet;return arguments.length===0?t._isSelected:(typeof n=="boolean"&&t._isSelected!==n&&(i?i._bindToAutoRefresh(function(n){t._isSelected=n})(n):t._isSelected=n,t._trigger({sheet:i,sheetName:i?i._name:"",floatingObject:t,propertyName:"isSelected"})),t)},r.prototype.isLocked=function(n){var t=this;return arguments.length===0?t._isLocked:(typeof n=="boolean"&&t._isLocked!==n&&(t._isLocked=n,t._trigger({sheet:t._sheet,sheetName:t._sheet?t._sheet._name:"",floatingObject:t,propertyName:"islocked"})),t)},r.prototype.canPrint=function(n){var t=this;return arguments.length===0?t._canPrint:(typeof n=="boolean"&&t._canPrint!==n&&(t._canPrint=n,t._trigger({sheet:t._sheet,sheetName:t._sheet?t._sheet._name:"",floatingObject:t,propertyName:"canPrint"})),t)},r.prototype.isVisible=function(n){var t=this,i=t._sheet;return arguments.length===0?t._isVisible:(typeof n=="boolean"&&t._isVisible!==n&&(i?i._bindToAutoRefresh(function(i){t._isVisible=n})(n):t._isVisible=n,t._trigger({sheet:i,sheetName:i?i._name:"",floatingObject:t,propertyName:"visible"})),t)},r.prototype.position=function(t){var i=this,r=i._sheet;return arguments.length===0?new n.Point(i._location.x,i._location.y):(t instanceof n.Point&&(i._location.x!==t.x||i._location.y!==t.y)&&(r?r._bindToAutoRefresh(function(n){i._location.x=n.x;i._location.y=n.y;i._adjustPosition();i._updateCoverRange()})(t):(i._location.x=t.x,i._location.y=t.y),i._trigger({sheet:r,sheetName:r?r._name:"",floatingObject:i,propertyName:"position"})),i)},r.prototype.height=function(n){var t=this,i=t._sheet;return arguments.length===0?t._location.height:(typeof n=="number"&&t._location.height!==n&&(i?i._bindToAutoRefresh(function(n){t._location.height=n;t._adjustSize();t._adjustPosition();t._updateCoverRange()})(n):t._location.height=n,t._trigger({sheet:i,sheetName:i?i._name:"",floatingObject:t,propertyName:"height"})),t)},r.prototype.width=function(n){var t=this,i=t._sheet;return arguments.length===0?t._location.width:(typeof n=="number"&&t._location.width!==n&&(i?i._bindToAutoRefresh(function(n){t._location.width=n;t._adjustSize();t._adjustPosition();t._updateCoverRange()})(n):t._location.width=n,t._trigger({sheet:i,sheetName:i?i._name:"",floatingObject:t,propertyName:"width"})),t)},r.prototype.startRow=function(n){var t=this;return arguments.length===0?t._startRow:(typeof n=="number"&&t._startRow!==n&&(n=e(n),t._sheet?t._sheet._bindToAutoRefresh(function(n){t._startRow=n;t._updateFloatingObjectLocation()})(n):t._startRow=n),t)},r.prototype.startRowOffset=function(n){var t=this;return arguments.length===0?t._startRowOffset:(typeof n=="number"&&t._startRowOffset!==n&&(t._sheet?t._sheet._bindToAutoRefresh(function(n){t._startRowOffset=n;t._updateFloatingObjectLocation()})(n):t._startRowOffset=n),t)},r.prototype.startColumn=function(n){var t=this;return arguments.length===0?t._startColumn:(typeof n=="number"&&t._startColumn!==n&&(n=e(n),t._sheet?t._sheet._bindToAutoRefresh(function(n){t._startColumn=n;t._updateFloatingObjectLocation()})(n):t._startColumn=n),t)},r.prototype.startColumnOffset=function(n){var t=this;return arguments.length===0?t._startColumnOffset:(typeof n=="number"&&t._startColumnOffset!==n&&(t._sheet?t._sheet._bindToAutoRefresh(function(n){t._startColumnOffset=n;t._updateFloatingObjectLocation()})(n):t._startColumnOffset=n),t)},r.prototype.endRow=function(n){var t=this;return arguments.length===0?t._endRow:(typeof n=="number"&&t._endRow!==n&&(t._sheet?t._sheet._bindToAutoRefresh(function(n){t._endRow=n;t._updateFloatingObjectSize()})(n):t._endRow=n),t)},r.prototype.endRowOffset=function(n){var t=this;return arguments.length===0?t._endRowOffset:(typeof n=="number"&&t._endRowOffset!==n&&(t._sheet?t._sheet._bindToAutoRefresh(function(n){t._endRowOffset=n;t._updateFloatingObjectSize()})(n):t._endRowOffset=n),t)},r.prototype.endColumn=function(n){var t=this;return arguments.length===0?t._endColumn:(typeof n=="number"&&t._endColumn!==n&&(n=e(n),t._sheet?t._sheet._bindToAutoRefresh(function(n){t._endColumn=n;t._updateFloatingObjectSize()})(n):t._endColumn=n),t)},r.prototype.endColumnOffset=function(n){var t=this;return arguments.length===0?t._endColumnOffset:(typeof n=="number"&&t._endColumnOffset!==n&&(t._sheet?t._sheet._bindToAutoRefresh(function(n){t._endColumnOffset=n;t._updateFloatingObjectSize()})(n):t._endColumnOffset=n),t)},r.prototype.dynamicMove=function(n){var t=this;return arguments.length===0?t._dynamicMove:(typeof n=="boolean"&&t._dynamicMove!==n&&(t._dynamicMove=n,t._trigger({sheet:t._sheet,sheetName:t._sheet?t._sheet._name:"",floatingObject:t,propertyName:"dynamicMove"})),t)},r.prototype.dynamicSize=function(n){var t=this;return arguments.length===0?t._dynamicSize:(typeof n=="boolean"&&t._dynamicSize!==n&&(t._dynamicSize=n,t._trigger({sheet:t._sheet,sheetName:t._sheet?t._sheet._name:"",floatingObject:t,propertyName:"dynamicSize"})),t)},r.prototype.addRows=function(n,t){var i=this;n=e(n);t=e(t);n<=i.startRow()?i.dynamicMove()&&(i.startRow(i.startRow()+t),i.endRow(i.endRow()+t)):n>i.startRow()&&n<i.endRow()&&i.dynamicSize()&&i.endRow(i.endRow()+t)},r.prototype.removeRows=function(n,t){var i=this,r=n+t-1,u,f;n<=i.startRow()?r<i.startRow()?i.dynamicMove()&&(i.startRow(i.startRow()-t),i.endRow(i.endRow()-t)):r<i.endRow()&&(u=r-i.startRow()+1,f=i.endRow()-i.startRow()+1-u,i.dynamicMove()&&(i.startRow(n),i.startRowOffset(0)),i.dynamicSize()&&i.endRow(n+f-1)):n<=i.endRow()&&(r<i.endRow()?i.dynamicSize()&&i.endRow(i.endRow()-t):i.dynamicSize()&&(i.endRow(n),i.endRowOffset(0)))},r.prototype.addColumns=function(n,t){var i=this;n=e(n);t=e(t);n<=i.startColumn()?i.dynamicMove()&&(i.startColumn(i.startColumn()+t),i.endColumn(i.endColumn()+t)):n>i.startColumn()&&n<i.endColumn()&&i.dynamicSize()&&i.endColumn(i.endColumn()+t)},r.prototype.removeColumns=function(n,t){var i=this,r,u,f;n=e(n);t=e(t);r=n+t-1;n<=i.startColumn()?r<i.startColumn()?i.dynamicMove()&&(i.startColumn(i.startColumn()-t),i.endColumn(i.endColumn()-t)):r<i.endColumn()&&(u=r-i.startColumn()+1,f=i.endColumn()-i.startColumn()+1-u,i.dynamicMove()&&(i.startColumn(n),i.startColumnOffset(0)),i.dynamicSize()&&i.endColumn(n+f-1)):n<=i.endColumn()&&(r<i.endColumn()?i.dynamicSize()&&i.endColumn(i.endColumn()-t):i.dynamicSize()&&(i.endColumn(n),i.endColumnOffset(0)))},r.prototype._isDefaultValue=function(n,t){switch(n){case"x":return t===0;case"y":return t===0;case"width":return t===0;case"height":return t===0;case"canPrint":return t===!0;case"isSelected":return t===!1;case"isLocked":return t==!0;case"isVisible":return t===!0;case"dynamicMove":return t===!0;case"dynamicSize":return t===!0;default:return!1}},r.prototype.toJSON=function(){var n=this,r={name:n._name,x:n._location.x,y:n._location.y,width:n._location.width,height:n._location.height,canPrint:n._canPrint,isSelected:n._isSelected,isLocked:n._isLocked,isVisible:n._isVisible,dynamicMove:n._dynamicMove,dynamicSize:n._dynamicSize},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},r.prototype.fromJSON=function(i){var r;if(i){r=this;r._name=i.name;var u=i.x!==t?i.x:0,f=i.y!==t?i.y:0,e=i.width!==t?i.width:0,o=i.height!==t?i.height:0;r._location=new n.Rect(u,f,e,o);i.canPrint!==t&&(r._canPrint=i.canPrint);i.isSelected!==t&&(r._isSelected=i.isSelected);i.isLocked!==t&&(r._isLocked=i.isLocked);i.isVisible!==t&&(r._isVisible=i.isVisible);i.dynamicMove!==t&&(r._dynamicMove=i.dynamicMove);i.dynamicSize!==t&&(r._dynamicSize=i.dynamicSize);r._updateCoverRange()}},r.prototype.clone=function(){var n=new r,t=JSON.stringify(this.toJSON());return n.fromJSON(JSON.parse(t)),n},r.prototype._adjustSize=function(){var n=this,t=n._getSheetHeight(),i=n._getSheetWidth();n._location.width>i&&(n._location.width=i);n._location.height>t&&(n._location.height=t)},r.prototype._adjustPosition=function(){var n=this,t=n._getSheetHeight(),i=n._getSheetWidth(),u=n._location.x+n._location.width,r;u>i&&(n._location.x=i-n._location.width);n._location.x<0&&(n._location.x=0);r=n._location.y+n._location.height;r>t&&(n._location.y=t-n._location.height);n._location.y<0&&(n._location.y=0)},r.prototype._updateFloatingObjectCoorinates=function(){var n=this;n._adjustSize();n._adjustPosition();n._startRow!==i&&n._startRow!==t&&n._startColumn!==i&&n._startColumn!==t?(n._startRowOffset||(n._startRowOffset=0),n._startColumnOffset||(n._startColumnOffset=0),n._updateFloatingObjectLocation()):n._updateStartPosition();n._endColumn!==i&&n._endColumn!==t&&n._endRow!==i&&n._endRow!==t?(n._endRowOffset||(n._endRowOffset=0),n._endColumnOffset||(n._endColumnOffset=0),n._updateFloatingObjectSize()):n._updateEndPosition()},r.prototype._getSheetHeight=function(){var e=this,n=e._sheet,u,f,r;if(n===i||n===t)return st;for(u=0,f=n.getRowCount(),r=0;r<f;r++)u+=n.getRowHeight(r,3);return u},r.prototype._getSheetWidth=function(){var e=this,n=e._sheet,u,f,r;if(n===i||n===t)return st;for(u=0,f=n.getColumnCount(),r=0;r<f;r++)u+=n.getColumnWidth(r,3);return u},r.prototype._updateStartRowOffset=function(){var n=this,u=n._startRowOffset,i=n._sheet.getRowHeight(n.startRow(),3),r=n._cacheOffset;i>0&&i--;u>i?(r.startRowOffset||(r.startRowOffset=u),n._startRowOffset=i):r.startRowOffset&&(r.startRowOffset<i?(n._startRowOffset=r.startRowOffset,r.startRowOffset=t):i<r.startRowOffset&&(n._startRowOffset=i))},r.prototype._updateStartColumnOffset=function(){var n=this,u=n._startColumnOffset,r=n._sheet.getColumnWidth(n.startColumn(),3),i=n._cacheOffset;r>0&&r--;u>r?(i.startColumnOffset||(i.startColumnOffset=u),n._startColumnOffset=r):i.startColumnOffset&&(i.startColumnOffset<r?(n._startColumnOffset=i.startColumnOffset,i.startColumnOffset=t):u<i.startColumnOffset&&(n._startColumnOffset=r))},r.prototype._updateEndRowOffset=function(){var n=this,u=n._endRowOffset,r=n._sheet.getRowHeight(n.endRow(),3),i=n._cacheOffset;r>0&&r--;u>r?(i.endRowOffset||(i.endRowOffset=u),n._endRowOffset=r):i.endRowOffset&&(i.endRowOffset<r?(n._endRowOffset=i.endRowOffset,i.endRowOffset=t):u<i.endRowOffset&&(n._endRowOffset=r))},r.prototype._updateEndColumnOffset=function(){var n=this,u=n._endColumnOffset,r=n._sheet.getColumnWidth(n.endColumn(),3),i=n._cacheOffset;r>0&&r--;u>r?(i.endColumnOffset||(i.endColumnOffset=u),n._endColumnOffset=r):i.endColumnOffset&&(i.endColumnOffset<r?(n._endColumnOffset=i.endColumnOffset,i.endColumnOffset=t):u<i.endColumnOffset&&(n._endColumnOffset=r))},r.prototype._updateFloatingObjectLocation=function(){var n=this,r=n._sheet,u,s,e,f,h,o;if(r!==i&&r!==t){for(u=0,s=n.startRow(),e=0;e<s;e++)u+=r.getRowHeight(e,3);for(n._updateStartRowOffset(),u+=n._startRowOffset,f=0,h=n.startColumn(),o=0;o<h;o++)f+=r.getColumnWidth(o,3);n._updateStartColumnOffset();f+=n._startColumnOffset;(n._location.x!==f||n._location.y!==u)&&(n._location.x=f,n._location.y=u,n._trigger({sheet:r,sheetName:r?r._name:"",floatingObject:n,propertyName:"location"}))}},r.prototype._updateFloatingObjectSize=function(){var n=this,r=n._sheet,e,a,v,o,y,p;if(r!==i&&r!==t){n._isFOColumnsOrRowsVisible===!1&&(n._isVisible=!0,n._isFOColumnsOrRowsVisible=!0);var u=0,s=n.startRow(),h=n.endRow();for(e=s;e<h;e++)u+=r.getRowHeight(e,3);a=u+r.getRowHeight(h,3);a===0&&n._isVisible===!0&&(n._isVisible=!1,n._isFOColumnsOrRowsVisible=!1);s===h?(n._updateEndRowOffset(),u=n.endRowOffset()-n.startRowOffset()):(v=r.getRowHeight(s,3),v>0&&(u-=n._startRowOffset),n._updateEndRowOffset(),u+=n._endRowOffset);var f=0,c=n.startColumn(),l=n.endColumn();for(o=c;o<l;o++)f+=r.getColumnWidth(o,3);y=f+r.getColumnWidth(l,3);y===0&&n._isVisible===!0&&(n._isVisible=!1,n._isFOColumnsOrRowsVisible=!1);c===l?(n._updateEndColumnOffset(),f=n.endColumnOffset()-n.startColumnOffset()):(p=r.getColumnWidth(c,3),p>0&&(f-=n._startColumnOffset),n._updateEndColumnOffset(),f+=n._endColumnOffset);f<0&&(f=0);u<0&&(u=0);n._location.width!==f&&(n._location.width=f,n._trigger({sheet:r,sheetName:r?r._name:"",floatingObject:n,propertyName:"width"}));n._location.height!==u&&(n._location.height=u,n._trigger({sheet:r,sheetName:r?r._name:"",floatingObject:n,propertyName:"height"}))}},r.prototype._updateStartPosition=function(){var n=this,r=n._sheet,u,f,e,o;r!==i&&r!==t&&(u=n._calcAnchorRow(n._location.y),n._startRow=u.row,n._startRowOffset=u.offsetY,n._startRowOffset===-1&&(n._startRow+=1,n._startRowOffset=0,f=r.getRowCount(),n._startRow===f&&(n._startRow=f-1)),e=n._calcAnchorColumn(n._location.x),n._startColumn=e.column,n._startColumnOffset=e.offsetX,n._startColumnOffset===-1&&(n._startColumn+=1,n._startColumnOffset=0,o=r.getColumnCount(),n._startColumn===o&&(n._startColumn=o-1)))},r.prototype._updateEndPosition=function(){var n=this,r,u;n._sheet!==i&&n._sheet!==t&&(r=n._calcAnchorRow(n._location.y+n._location.height),n._endRow=r.row,n._endRowOffset=r.offsetY,u=n._calcAnchorColumn(n._location.x+n._location.width),n._endColumn=u.column,n._endColumnOffset=u.offsetX)},r.prototype._updateCoverRange=function(){this._updateStartPosition();this._updateEndPosition()},r.prototype._calcAnchorRow=function(n){for(var f,r,e=0,u=0,o=this._sheet.getRowCount(),t=0;t<o;t++)if(f=this._sheet.getRowHeight(t,3),e+=f,r=e-n,r>0)return u=r>0?f-r:-1,{row:t,offsetY:u};else if(r===0)return u=0,{row:t+1,offsetY:0};return i},r.prototype._calcAnchorColumn=function(n){for(var f,r,e=0,u=0,o=this._sheet.getColumnCount(),t=0;t<o;t++)if(f=this._sheet.getColumnWidth(t,3),e+=f,r=e-n,r>0)return u=r>0?f-r:-1,{column:t,offsetX:u};else if(r===0)return u=0,{column:t+1,offsetX:0};return i},r.prototype._trigger=function(t){if(this._sheet&&(this._sheet._trigger(n.Events.FloatingObjectChanged,t),t.propertyName==="isSelected")){var i={sheet:t.sheet,sheetName:t.sheetName,floatingObject:t.floatingObject};this._sheet._trigger(n.Events.FloatingObjectSelectionChanged,i)}},r.prototype._createContentContainer=function(){var n=document.createElement("div"),t=$(n).addClass(b).addClass(s).css(y,p);return t.css(ct,ot),n},r}();n.FloatingObject=a;rt=function(n){function t(t,r,u,f,e){n.call(this,t,r,u,f,e);this._content=i}return __extends(t,n),t.prototype.Content=function(n){var t=this;if(arguments.length===0)return t._content;t.owner()?t.owner()._bindToAutoRefresh(function(n){t._content=n})(n):t._content=n;t._trigger({sheet:t.owner(),sheetName:t.owner()?t.owner()._name:"",customFloatingObject:t,propertyName:"content"})},t.prototype.toJSON=function(){var t=n.prototype.toJSON.call(this),i;return t.floatingObjectType=0,i=$("<div><\/div>").append(this.cloneContent()).html(),t.content=i,t},t.prototype.fromJSON=function(t){t&&(n.prototype.fromJSON.call(this,t),t.content&&(this._content=$(t.content).get(0)))},t.prototype.clone=function(){var n=new t,i=JSON.stringify(this.toJSON());return n.fromJSON(JSON.parse(i)),n._content=this.cloneContent(),n},t.prototype.cloneContent=function(){return this._content?$(this._content).clone().filter("*").removeAttr("id").get(0):i},t.prototype._createContentContainer=function(){var t=document.createElement("div"),o=$(t).addClass(b).addClass(s).css(y,p),n=this.cloneContent(),f=ht,e=ht,r="",u="",h;return n&&n.style&&(r=n.style.width,u=n.style.height),r!==""&&(f=r),u!==""&&(e=u),n!==i?h=$(n).css({width:f,height:e}).addClass(ii).addClass(s).appendTo(t):o.css(ct,ot),t},t}(a);n.CustomFloatingObject=rt;ut=function(r){function u(n,t,u,f,e,o){r.call(this,n,u,f,e,o);var s=this;s._pictureStretch=0;s._borderWidth=1;s._borderStyle="none";s._borderColor=i;s._borderRadius=-1;s._backColor=i;s._imageLoader=i;s._isImageLoaded=!1;s._isTakeOriginalSize=!1;typeof t=="string"&&s.src(t)}return __extends(u,r),u.prototype._trigger=function(t){if(this.owner()&&(t&&t.floatingObject&&(t.picture=t.floatingObject,delete t.floatingObject),this.owner()._trigger(n.Events.PictureChanged,t),t.propertyName==="isSelected")){var i={sheet:t.sheet,sheetName:t.sheetName,picture:t.picture};this.owner()._trigger(n.Events.PictureSelectionChanged,i)}},u.prototype.backColor=function(n){var t=this,i;return arguments.length===0?t._backColor:(typeof n=="string"&&t._backColor!==n&&(i=t.owner(),i?i._bindToAutoRefresh(function(n){t._backColor=n})(n):t._backColor=n,t._trigger({sheet:i,sheetName:i?i._name:"",picture:t,propertyName:"backColor"})),t)},u.prototype.borderRadius=function(n){var t=this,i;return arguments.length===0?t._borderRadius:(typeof n!="number"||isNaN(n)||t._borderRadius===n||(i=t.owner(),i?i._bindToAutoRefresh(function(n){t._borderRadius=n})(n):t._borderRadius=n,t._trigger({sheet:i,sheetName:i?i._name:"",picture:t,propertyName:"borderRadius"})),t)},u.prototype.borderWidth=function(n){var t=this,i;return arguments.length===0?t._borderWidth:(typeof n!="number"||isNaN(n)||t._borderWidth===n||(i=t.owner(),i?i._bindToAutoRefresh(function(n){t._borderWidth=n})(n):t._borderWidth=n,t._trigger({sheet:i,sheetName:i?i._name:"",picture:t,propertyName:"borderWidth"})),t)},u.prototype.borderStyle=function(n){var t=this,i;return arguments.length===0?t._borderStyle:(typeof n=="string"&&t._borderStyle!==n&&(i=t.owner(),i?i._bindToAutoRefresh(function(n){t._borderStyle=n})(n):t._borderStyle=n,t._isBorderStyleWork(n)||(t._borderWidth=0),t._trigger({sheet:i,sheetName:i?i._name:"",picture:t,propertyName:"borderStyle"})),t)},u.prototype.borderColor=function(n){var t=this,i;return arguments.length===0?t._borderColor:(typeof n=="string"&&t._borderColor!==n&&(i=t.owner(),i?i._bindToAutoRefresh(function(n){t._borderColor=n})(n):t._borderColor=n,t._trigger({sheet:i,sheetName:i?i._name:"",picture:t,propertyName:"borderColor"})),t)},u.prototype.pictureStretch=function(i){var r=this,u;return arguments.length===0?r._pictureStretch:(r._pictureStretch!==i&&n.ImageLayout[i]!==t&&(u=r.owner(),u?u._bindToAutoRefresh(function(n){r._pictureStretch=n})(i):r._pictureStretch=i,r._trigger({sheet:u,sheetName:u?u._name:"",picture:r,propertyName:"pictureStretch"})),r)},u.prototype.getOriginalWidth=function(){return this._originalWidth},u.prototype.getOriginalHeight=function(){return this._originalHeight},u.prototype.src=function(n){var t=this,i;return arguments.length===0?t._src:(typeof n=="string"&&t._src!==n&&(i=t.owner(),i?i._bindToAutoRefresh(function(n){t._src=n})(n):t._src=n,t._trigger({sheet:i,sheetName:i?i._name:"",picture:t,propertyName:"src"}),t._isImageLoaded=!1,t._loadImage()),t)},u.prototype._isDefaultValue=function(n,t){switch(n){case"backColor":return t===i;case"borderRadius":return t===-1;case"borderWidth":return t===1;case"borderStyle":return t==="none";case"borderColor":return t===i;case"pictureStretch":return t===0;default:return!1}},u.prototype.toJSON=function(){var i=this,n=r.prototype.toJSON.call(this),u,f,e;n.src=i._src;n.floatingObjectType=1;n.backColor=i._backColor;n.borderRadius=i._borderRadius;n.borderWidth=i._borderWidth;n.borderStyle=i._borderStyle;n.borderColor=i._borderColor;n.pictureStretch=i._pictureStretch;u={};for(f in n)e=n[f],i._isDefaultValue(f,e)||(u[f]=e);return $.isEmptyObject(u)?t:u},u.prototype.fromJSON=function(n){if(n){var i=this;r.prototype.fromJSON.call(this,n);n.src&&(i._src=n.src,i._isImageLoaded=!1,i._loadImage(),n.backColor!==t&&(i._backColor=n.backColor),n.borderRadius!==t&&(i._borderRadius=n.borderRadius),n.borderWidth!==t&&(i._borderWidth=n.borderWidth),n.borderStyle!==t&&(i._borderStyle=n.borderStyle),n.borderColor!==t&&(i._borderColor=n.borderColor),n.pictureStretch!==t&&(i._pictureStretch=n.pictureStretch),i._isBorderStyleWork(i._borderStyle)||(i._borderWidth=0))}},u.prototype.clone=function(){var n=new u,t=JSON.stringify(this.toJSON());return n.fromJSON(JSON.parse(t)),n},u.prototype._isBorderStyleWork=function(n){switch(n){case"dotted":case"dashed":case"solid":case"double":case"groove":case"ridge":case"inset":case"outset":return!0;default:return!1}},u.prototype._loadImage=function(){var t=this,i=t._src,r,u;t._imageLoader||(t._imageLoader=new n._GcImageLoader(function(){t._loadImage()}));try{t._imageLoader.getState(i)?(t._isImageLoaded=!0,r=t._imageLoader.getImage(i),t._originalWidth=r.width,t._originalHeight=r.height,t._isTakeOriginalSize&&(t.width(t._originalWidth),t.height(t._originalHeight),t._isTakeOriginalSize=!1),u=t.owner(),u&&u.repaint()):t._imageLoader.addImage(i)}catch(f){}},u.prototype._createContentContainer=function(){var n=document.createElement("div"),t=$(n).addClass(b).addClass(s).css(y,p);return n},u}(a);n.Picture=ut;ft=function(){function e(n,t){this._srcCache="";var i=this;i._floatingObject=n;i.name=i._floatingObject.name();i._sheet=t;i._isMouseCapture=!1}return e.prototype.floatingObject=function(){return this._floatingObject},e.prototype.render=function(t,i){var r=this,h=!1,o,u,f,e,c;r._rect=t;r._floatingObjectContainerDiv||(r._floatingObjectContainerDiv=r._createFloatingObjectContainer(r._floatingObject.name()),o=r._sheet.parent,o&&(r._containerDiv=o._getContainerDiv(),r._containerDiv&&$(r._containerDiv).append(r._floatingObjectContainerDiv)));r._floatingObjectContentDiv||(r._floatingObjectContentDiv=r._floatingObject._createContentContainer(),typeof r._floatingObject.borderWidth=="function"?(r._borderDiv=document.createElement("div"),$(r._borderDiv).addClass(s),r._floatingObjectContainerDiv.appendChild(r._borderDiv),r._borderDiv.appendChild(r._floatingObjectContentDiv)):(r._floatingObjectContainerDiv.appendChild(r._floatingObjectContentDiv),h=!0));r._borderDiv&&(r._applyBorderStyle(i,t),i.x=0,i.y=0);u=$(r._floatingObjectContainerDiv);f=$(r._floatingObjectContentDiv);u.css({top:t.y,left:t.x,width:t.width,height:t.height});f.css({top:i.y,left:i.x,width:i.width,height:i.height});r._borderDiv&&r._paintImage();r._floatingObject.isSelected()?(f.removeClass(at).addClass(lt),r._showResizeIndicator(u)):(f.removeClass(lt).addClass(at),r._hideResizeIndicator(u));h&&(e=r._sheet,c=$(r._floatingObjectContentDiv).children()[0],e._trigger(n.Events.CustomFloatingObjectLoaded,{sheet:e,sheetName:e._name,customFloatingObject:r._floatingObject,element:c}))},e.prototype.setFloatingObjectZIndex=function(n){$(this._floatingObjectContainerDiv).css("z-index",n)},e.prototype.getFloatingObjectZIndex=function(){var n=parseInt($(this._floatingObjectContainerDiv).css("z-index"));return isNaN(n)?-1:n},e.prototype._paintImage=function(){var u=this,r=u._floatingObject,e=r.src(),o=r.pictureStretch(),s=n._ThemeContext.getColor(r.owner(),r.backColor()),f;if(e&&u._floatingObjectContentDiv&&(f=$(u._floatingObjectContentDiv),u._srcCache!==e&&(u._srcCache=e,f.css("background-image","url('"+e+"')").css("background-repeat","no-repeat")),f.css("background-color",s),o!==i&&o!==t)&&r._isImageLoaded){var h=r.getOriginalWidth(),c=r.getOriginalHeight(),l=f.width(),a=f.height();n.util._applyBackgroundImageLayout(u._floatingObjectContentDiv,l,a,h,c,o)}},e.prototype._applyBorderStyle=function(t,i){var y=this._borderDiv,u=this._floatingObject,r=u.borderWidth(),c=u.borderStyle(),p=n._ThemeContext.getColor(u.owner(),u.borderColor()),w=u.borderRadius(),e=0;u._isBorderStyleWork(c)||(r=0);r<o&&(e=o-r);var s=e,h=e,a=e,v=e,f=l(r,o);t.x<0?s+=t.x-f:(s+=t.x<f?t.x-f:0,v=i.width-s-t.width-2-2*r);t.y<0?h+=t.y-f:(h+=t.y<f?t.y-f:0,a=i.height-h-t.height-2-2*r);$(y).css({position:"absolute",left:s,top:h,bottom:a,right:v,"border-width":r,"border-style":c,"border-color":p,"border-radius":w})},e.prototype._dispose=function(){var n=this;n._touchManager&&n._touchManager.detach();n._floatingObjectContainerDiv&&($(n._floatingObjectContainerDiv).remove(),n._floatingObjectContainerDiv=i);n._moveResizeContainerDiv&&($(n._moveResizeContainerDiv).remove(),n._moveResizeContainerDiv=i)},e.prototype._showResizeIndicator=function(n){var b=$(vt,n),u,p;b.removeClass(w);var t=this,s=t._getHTMLElementBounds(t._floatingObjectContainerDiv),v=t._floatingObjectContentDiv,c=t._floatingObject;t._borderDiv&&(v=t._borderDiv);var r=t._getHTMLElementBounds(v),h=r.x,e=r.y,l=s.height-r.y-r.height,y=s.width-r.x-r.width,i=0,a=o*2+1;typeof c.borderWidth=="function"&&(u=c.borderWidth(),p=c.borderStyle(),c._isBorderStyleWork(p)||(u=0),u>=o&&(i=u-o),l=s.height-e-r.height-u,y=s.width-h-r.width-u,h+=u,e+=u);h>0?(e>0?$(k,t._floatingObjectContainerDiv).css({top:i,left:i}).addClass(f):t._resizeIndicatorUnselect(k),s.height>0?$(d,t._floatingObjectContainerDiv).css({left:i,top:(r.height-a)/2+e}).addClass(f):t._resizeIndicatorUnselect(d),l>0?$(g,t._floatingObjectContainerDiv).css({left:i,bottom:i}).addClass(f):t._resizeIndicatorUnselect(g)):(t._resizeIndicatorUnselect(k),t._resizeIndicatorUnselect(d),t._resizeIndicatorUnselect(g));e>0?$(yt,t._floatingObjectContainerDiv).css({top:i,left:(r.width-a)/2+h}).addClass(f):t._resizeIndicatorUnselect(yt);l>0?$(pt,t._floatingObjectContainerDiv).css({left:(r.width-a)/2+h,bottom:i}).addClass(f):t._resizeIndicatorUnselect(pt);y>0?(e>0?$(nt,t._floatingObjectContainerDiv).css({right:i,top:i}).addClass(f):t._resizeIndicatorUnselect(nt),s.height>0?$(tt,t._floatingObjectContainerDiv).css({top:(r.height-a)/2+e,right:i}).addClass(f):t._resizeIndicatorUnselect(tt),l>0?$(it,t._floatingObjectContainerDiv).css({right:i,bottom:i}).addClass(f):t._resizeIndicatorUnselect(it)):(t._resizeIndicatorUnselect(nt),t._resizeIndicatorUnselect(tt),t._resizeIndicatorUnselect(it))},e.prototype._resizeIndicatorUnselect=function(n){$(n,this._floatingObjectContainerDiv).removeClass(f).addClass(w)},e.prototype._hideResizeIndicator=function(n){$(vt,n).removeClass(f).addClass(w)},e.prototype._createFloatingObjectContainer=function(t){var r=document.createElement("div"),u=$(r),i=this;return i._renderManager.reduceZIndex(),u.addClass(gt).addClass(s).css("z-index",kt).bind("mousedown",function(n){i._doMouseDown(n)}).bind("mousemove",function(n){i._doMouseMove(n)}).bind("mouseup",function(n){i._doMouseUp(n)}),r.addEventListener("mousewheel",function(n){i._doMouseWheel(n)},!1),r.addEventListener("DOMMouseScroll",function(n){i._doMouseWheel(n)},!1),u.append($(ri)),n.features.touch&&(i._touchManager=new n.FloatingObjectTouchManager(r,i,i._sheet.parent._touchEventProvider),i._touchManager.attach()),r},e.prototype._createMoveResizeContainer=function(){var n=this,s,f,i,r,t,h,e,o,c,u;if(n._floatingObjectContainerDiv&&n._layout&&!n._moveResizeDiv){for(n._moveResizeContainerDiv=document.createElement("div"),n._moveResizeDiv=document.createElement("div"),n._attachedMoveResizeDivDict={},s=n._renderManager._containerArray.length,f=0;f<s;f++)i=n._renderManager._containerArray[f],r=i._floatingObject,r&&r.name()!==n._floatingObject.name()&&r.isSelected()&&!n._attachedMoveResizeDivDict[r.name()]&&(n._attachedMoveResizeDivDict[r.name()]={offsetX:i._layout.x-n._layout.x,offsetY:i._layout.y-n._layout.y,height:i._layout.height,width:i._layout.width,moveResizeDiv:document.createElement("div")});t=n._getViewportRect(n._rowViewportIndex,n._columnViewportIndex);h=$(n._moveResizeContainerDiv);h.addClass(ni).css("z-index",dt).css({top:t.y,left:t.x,width:t.width,height:t.height}).bind("mousemove",function(t){n._doMouseMove(t)}).bind("mouseup",function(t){n._doMouseUp(t)});e=n._layout.y-t.y;o=n._layout.x-t.x;n._attachMoveResizeDivToContainer(n._moveResizeDiv,n._moveResizeContainerDiv,o,e,n._layout.width,n._layout.height);for(c in n._attachedMoveResizeDivDict)u=n._attachedMoveResizeDivDict[c],n._attachMoveResizeDivToContainer(u.moveResizeDiv,n._moveResizeContainerDiv,o+u.offsetX,e+u.offsetY,u.width,u.height);n._containerDiv&&$(n._containerDiv).append(n._moveResizeContainerDiv)}},e.prototype._handleDocumentMouseMove=function(){var n=this;n._isMouseCapture||($(document).bind("mousemove.gcSheet",function(t){n._doMouseMove(t)}),$(document).bind("mouseup.gcSheet",function(t){n._doMouseUp(t)}),n._isMouseCapture=!0)},e.prototype._unhandleDocumentMouseMove=function(){this._isMouseCapture&&(this._isMouseCapture=!1,$(document).unbind("mousemove.gcSheet"),$(document).unbind("mouseup.gcSheet"))},e.prototype._doMouseDown=function(t){var i=this,r=i._sheet,u,o,s,f,e;if((!r.isProtected||!i._floatingObject.isLocked())&&r.endEdit()){if(i._touchManager&&!t.isTouch&&i._touchManager.preProcessMouseDown(t)){n.util.cancelDefault(t);return}if(t.button===0||t.button===2){if(t.ctrlKey||t.shiftKey?i._floatingObject.isSelected()?i._floatingObject.isSelected(!1):(i._floatingObject.isSelected(!0),window.gcGlobal.activeElement=r):i._floatingObject.isSelected()||(r.unSelectAllFloatingObjects(),i._floatingObject.isSelected(!0),window.gcGlobal.activeElement=r),r._commentManager&&r._commentManager.deactivateComment(),r._saveAndClearSheetSelections(),t.button===2)return;u=r._eventHandler;o=u._getCanvasOffset();i._mouseLeftButtonDownPosition=new n.Point(t.pageX-o.left,t.pageY-o.top);i._mousePosition=i._mouseLeftButtonDownPosition;i._isMouseLeftButtonDown=!0;i._mouseDownHittestInfo=i._hitTest(i._mousePosition.x,i._mousePosition.y);i._mouseDownHittestInfo.inMoving?(i._moveInfo={},i._moveInfo.startTopRow=r.getViewportTopRow(i._rowViewportIndex),i._moveInfo.startLeftColumn=r.getViewportLeftColumn(i._columnViewportIndex)):(i._createMoveResizeContainer(),s=$(i._moveResizeDiv),i._resizeInfo={},f=i._getHTMLElementBounds(i._moveResizeDiv),i._resizeInfo.startX=f.x,i._resizeInfo.startY=f.y,i._resizeInfo.startWidth=f.width,i._resizeInfo.startHeight=f.height,i._resizeInfo.startTopRow=r.getViewportTopRow(i._rowViewportIndex),i._resizeInfo.startLeftColumn=r.getViewportLeftColumn(i._columnViewportIndex));i._handleDocumentMouseMove();e=r.hitTest(i._mousePosition.x,i._mousePosition.y);u.startHitInfo={scrollRowViewportIndex:e.rowViewportIndex,scrollColViewportIndex:e.colViewportIndex,hitTestType:e.hitTestType};u.mousePosition=i._mousePosition;u.startScroll();u.isFloatingObjectWorking=!0}return t.stopPropagation(),!1}},e.prototype._doMouseMove=function(t){var i=this,u=i._sheet,e;if(!u.isProtected||!i._floatingObject.isLocked()){if(i._touchManager&&!t.isTouch&&i._touchManager.preProcessMouseMove(t)){n.util.cancelDefault(t);return}if(u._isMouseDownInSheet)return i._floatingObjectContainerDiv&&(e=$(i._floatingObjectContainerDiv),e.css("cursor","default")),!0;var f=u._eventHandler,o=f._getCanvasOffset(),r=new n.Point(t.pageX-o.left,t.pageY-o.top);return i._isMouseLeftButtonDown?($(i._moveResizeContainerDiv).css("cursor",$(i._floatingObjectContainerDiv).css("cursor")),i._mouseDownHittestInfo.inMoving?(i._isMoving=!0,i._createMoveResizeContainer(),i._doMoveContainer(i._mousePosition,r)):(i._isResizing=!0,i._doResizeContainer(i._mousePosition,i._mouseDownHittestInfo)),i._mousePosition=r,f.mousePosition=r,f.continueScroll(),$(document.body).addClass(s)):i._updateCursor(r),t.stopPropagation(),!1}},e.prototype._doMouseUp=function(t){var r=this,u=r._sheet,f=u._eventHandler,h,e,o;if(u.isProtected&&r._floatingObject.isLocked()){n.util.cancelDefault(t);return}if(!r._touchManager||t.isTouch||!r._touchManager.preProcessMouseUp(t))return u._isMouseDownInSheet?(r._floatingObjectContainerDiv&&(h=$(r._floatingObjectContainerDiv),h.css("cursor","move")),!0):(f.isFloatingObjectWorking=!1,f.stopScroll(),e=f._getCanvasOffset(),o=new n.Point(t.pageX-e.left,t.pageY-e.top),r._mouseDownHittestInfo&&(r._mouseDownHittestInfo.inMoving&&r._isMoving?t.ctrlKey?r._doCopyFloatingObject(r._mouseLeftButtonDownPosition,o):r._doMoveFloatingObject(r._mouseLeftButtonDownPosition,o):r._isResizing&&r._doResizeFloatingObject(),$(document.body).removeClass(s)),r._resizeInfo=i,r._moveInfo=i,r._attachedMoveResizeDivDict=i,$(r._moveResizeContainerDiv).remove(),r._moveResizeDiv=i,r._isMouseLeftButtonDown=!1,r._unhandleDocumentMouseMove(),r._isMoving=!1,r._isResizing=!1,t.stopPropagation(),!1)},e.prototype._doMouseWheel=function(t){var i=this._sheet,r;if(i)return t=t?t:window.event,r=t.detail?t.detail:t.wheelDelta/-40,i._eventHandler.doMouseWheel(t,parseInt(r,10)),n.util.cancelDefault(t),!1},e.prototype._doCopyFloatingObject=function(t,i){var r=this,u=r._sheet,s,h;if(r._moveInfo){var e=r._getTwoRowDistance(r._moveInfo.startTopRow,u.getViewportTopRow(r._rowViewportIndex)),o=r._getTwoColumnDistance(r._moveInfo.startLeftColumn,u.getViewportLeftColumn(r._columnViewportIndex)),c=i.x-t.x+(i.x>t.x?o:-1*o),l=i.y-t.y+(i.y>t.y?e:-1*e),f=[];f.push(r._floatingObject.name());for(s in r._attachedMoveResizeDivDict)f.push(s);h=new n.UndoRedo.DragCopyFloatingObjectUndoAction(u,{names:f},{offsetX:c,offsetY:l});u._doCommand(h)}},e.prototype._doMoveFloatingObject=function(t,i){var r=this,u=r._sheet,f,c,l;if(r._moveInfo){var s=r._getTwoRowDistance(r._moveInfo.startTopRow,u.getViewportTopRow(r._rowViewportIndex)),h=r._getTwoColumnDistance(r._moveInfo.startLeftColumn,u.getViewportLeftColumn(r._columnViewportIndex)),e=i.x-t.x+(i.x>t.x?h:-1*h),o=i.y-t.y+(i.y>t.y?s:-1*s);e=e/u._zoomFactor;o=o/u._zoomFactor;f=[];f.push(r._floatingObject.name());for(c in r._attachedMoveResizeDivDict)f.push(c);l=new n.UndoRedo.MovingFloatingObjectUndoAction(u,{names:f},{offsetX:e,offsetY:o});u._doCommand(l)}},e.prototype._doResizeFloatingObject=function(){var t=this,i=t._sheet,r=i._zoomFactor,u,h,c;if(t._resizeInfo){var f=t._getTwoRowDistance(t._resizeInfo.startTopRow,i.getViewportTopRow(t._rowViewportIndex)),e=t._getTwoColumnDistance(t._resizeInfo.startLeftColumn,i.getViewportLeftColumn(t._columnViewportIndex)),o=t._resizeInfo.endX-t._resizeInfo.startX+(t._resizeInfo.endX>t._resizeInfo.startX?e:-1*e);o=o/r;u=t._resizeInfo.endY-t._resizeInfo.startY+(t._resizeInfo.endY>t._resizeInfo.startY?f:-1*f);u=u/r;var l=(t._resizeInfo.endWidth+e)/r-t._floatingObject.width(),a=(t._resizeInfo.endHeight+f)/r-t._floatingObject.height(),s=[];s.push(t._floatingObject.name());for(h in t._attachedMoveResizeDivDict)s.push(h);c=new n.UndoRedo.ResizingFloatingObjectUndoAction(i,{names:s},{offsetX:o,offsetY:u,offsetWidth:l,offsetHeight:a});i._doCommand(c)}},e.prototype._doMoveContainer=function(n,t){var i=this,f,e;if(i._moveResizeDiv){var o=$(i._moveResizeDiv),r=t.x-n.x,u=t.y-n.y;i._doMoveContainerImp(i._moveResizeDiv,r,u);for(f in i._attachedMoveResizeDivDict)e=i._attachedMoveResizeDivDict[f],i._doMoveContainerImp(e.moveResizeDiv,r,u)}},e.prototype._doMoveContainerImp=function(n,t,i){var r=$(n),u=r.position();r.css({top:u.top+i,left:u.left+t})},e.prototype._doResizeContainer=function(t,i){var r,u,e,l,a;if(i){r=this;e=r._getViewportRect(r._rowViewportIndex,r._columnViewportIndex);t=new n.Point(t.x-e.x,t.y-e.y);i.inTopNWSEResizing?u=r._getFloatingObjectTopLeftResizingRect(t):i.inTopNSResizing?u=r._getFloatingObjectTopCenterResizingRect(t):i.inTopNESWResizing?u=r._getFloatingObjectTopRightResizingRect(t):i.inLeftWEResizing?u=r._getFloatingObjectMiddleLeftResizingRect(t):i.inRightWEResizing?u=r._getFloatingObjectMiddleRightResizingRect(t):i.inBottomNESWResizing?u=r._getFloatingObjectBottomLeftResizingRect(t):i.inBottomNSReszing?u=r._getFloatingObjectBottomCenterResizingRect(t):i.inBottomNWSEReszing&&(u=r._getFloatingObjectBottomRightResizingRect(t));r._resizeInfo.endX=u.x;r._resizeInfo.endY=u.y;r._resizeInfo.endWidth=u.width;r._resizeInfo.endHeight=u.height;var v=$(r._moveResizeDiv),f=r._getHTMLElementBounds(r._moveResizeDiv),o=u.y-f.y,s=u.x-f.x,h=u.width-f.width,c=u.height-f.height;r._doResizeContainerImp(r._moveResizeDiv,s,o,h,c);for(l in r._attachedMoveResizeDivDict)a=r._attachedMoveResizeDivDict[l],r._doResizeContainerImp(a.moveResizeDiv,s,o,h,c)}},e.prototype._doResizeContainerImp=function(n,t,i,r,u){var e=$(n),f=this._getHTMLElementBounds(n);e.css({top:f.y+i,left:f.x+t,width:f.width+r,height:f.height+u})},e.prototype._attachMoveResizeDivToContainer=function(n,t,i,r,u,f){$(n).addClass(ti).css({top:r-1,left:i-1,width:u,height:f}).appendTo(t)},e.prototype._getHTMLElementBounds=function(t){var i=$(t),r=i.position();return new n.Rect(r.left,r.top,i.width(),i.height())},e.prototype._updateCursor=function(n){var r=this,u,t,f;r._floatingObjectContainerDiv&&(u=$(r._floatingObjectContainerDiv),t=r._hitTest(n.x,n.y),t!==i&&(f=t.inTopNWSEResizing?"nw-resize":t.inTopNSResizing?"n-resize":t.inTopNESWResizing?"ne-resize":t.inLeftWEResizing?"w-resize":t.inRightWEResizing?"w-resize":t.inBottomNESWResizing?"sw-resize":t.inBottomNSReszing?"n-resize":t.inBottomNWSEReszing?"se-resize":"move",u.css("cursor",f)))},e.prototype._getFloatingObjectTopLeftResizingRect=function(t){var i=this,f=r(i._resizeInfo.startX+i._resizeInfo.startWidth,t.x),e=r(i._resizeInfo.startY+i._resizeInfo.startHeight,t.y),o=u(t.x-i._resizeInfo.startX-i._resizeInfo.startWidth),s=u(t.y-i._resizeInfo.startY-i._resizeInfo.startHeight);return new n.Rect(f,e,o,s)},e.prototype._getFloatingObjectTopCenterResizingRect=function(t){var i=this,f=i._resizeInfo.startX,e=r(i._resizeInfo.startY+i._resizeInfo.startHeight,t.y),o=u(t.y-i._resizeInfo.startY-i._resizeInfo.startHeight),s=i._resizeInfo.startWidth;return new n.Rect(f,e,s,o)},e.prototype._getFloatingObjectTopRightResizingRect=function(t){var i=this,f=r(i._resizeInfo.startX,t.x),e=r(i._resizeInfo.startY+i._resizeInfo.startHeight,t.y),o=u(t.x-i._resizeInfo.startX),s=u(t.y-i._resizeInfo.startY-i._resizeInfo.startHeight);return new n.Rect(f,e,o,s)},e.prototype._getFloatingObjectMiddleLeftResizingRect=function(t){var i=this,f=r(i._resizeInfo.startX+i._resizeInfo.startWidth,t.x),e=i._resizeInfo.startY,o=u(t.x-i._resizeInfo.startX-i._resizeInfo.startWidth),s=i._resizeInfo.startHeight;return new n.Rect(f,e,o,s)},e.prototype._getFloatingObjectMiddleRightResizingRect=function(t){var i=this,f=r(i._resizeInfo.startX,t.x),e=i._resizeInfo.startY,o=u(t.x-i._resizeInfo.startX),s=i._resizeInfo.startHeight;return new n.Rect(f,e,o,s)},e.prototype._getFloatingObjectBottomLeftResizingRect=function(t){var i=this,f=r(i._resizeInfo.startX+i._resizeInfo.startWidth,t.x),e=r(i._resizeInfo.startY,t.y),o=u(t.x-i._resizeInfo.startX-i._resizeInfo.startWidth),s=u(t.y-i._resizeInfo.startY);return new n.Rect(f,e,o,s)},e.prototype._getFloatingObjectBottomCenterResizingRect=function(t){var i=this,f=i._resizeInfo.startX,e=r(i._resizeInfo.startY,t.y),o=u(t.y-i._resizeInfo.startY),s=i._resizeInfo.startWidth;return new n.Rect(f,e,s,o)},e.prototype._getFloatingObjectBottomRightResizingRect=function(t){var i=this,f=r(i._resizeInfo.startX,t.x),e=r(i._resizeInfo.startY,t.y),o=u(t.x-i._resizeInfo.startX),s=u(t.y-i._resizeInfo.startY);return new n.Rect(f,e,o,s)},e.prototype._getViewportRect=function(n,t){var w=this,i=w._sheet,u=i._getSheetLayout(),r=u.viewportRect(n,t),e,o,s,h,f,l=w._floatingObject,b=l.startRow(),k=l.startColumn(),d=l.endRow(),g=l.endColumn(),a=i.frozenRowCount,v=i.frozenColCount,y=i.getRowCount(3)-i.getFrozenTrailingRowCount()-1,p=i.getColumnCount(3)-i.getFrozenTrailingColumnCount()-1;return n===c?(a>0&&(e=i.getViewportTopRow(n),(b<a||e===a)&&(r.y-=u.frozenHeight,r.height+=u.frozenHeight)),i._frozenTrailingRowCount>0&&(o=i.getViewportBottomRow(n),d>y&&o===y&&(r.height+=u.frozenTrailingHeight))):n===c-1?(e=i.getViewportTopRow(n+1),(d>=e||e===a)&&(f=u.viewportRect(n+1,t),r.height+=f.height)):n===c+1&&(o=i.getViewportBottomRow(n-1),(b<=o||o===y)&&(f=u.viewportRect(n-1,t),r.y=f.y,r.height+=f.height)),t===c?(v>0&&(s=i.getViewportLeftColumn(t),(k<v||s===v)&&(r.x-=u.frozenWidth,r.width+=u.frozenWidth)),i._frozenTrailingColCount>0&&(h=i.getViewportRightColumn(t),(g>p||h===p)&&(r.width+=u.frozenTrailingWidth))):t===c-1?(s=i.getViewportLeftColumn(t+1),(g>=s||s===v)&&(f=u.viewportRect(n,t+1),r.width+=f.width)):t===c+1&&(h=i.getViewportRightColumn(t-1),(k<=h||h===p)&&(f=u.viewportRect(n,t-1),r.x=f.x,r.width+=f.width)),r},e.prototype._getTwoColumnDistance=function(n,t){for(var f=r(n,t),e=l(n,t),u=0,i=f;i<e;i++)u+=this._sheet.getColumnWidth(i,3);return u},e.prototype._getTwoRowDistance=function(n,t){for(var f=r(n,t),e=l(n,t),u=0,i=f;i<e;i++)u+=this._sheet.getRowHeight(i,3);return u},e.prototype._hitTest=function(t,r){var e=this,f,v,y,p,w,b,k,d,g;if(!e._layout)return i;if(f={inMoving:!1,inTopNWSEResizing:!1,inTopNSResizing:!1,inTopNESWResizing:!1,inLeftWEResizing:!1,inRightWEResizing:!1,inBottomNESWResizing:!1,inBottomNSReszing:!1,inBottomNWSEReszing:!1},!e._floatingObject.isSelected())return f.inMoving=!0,f;var u=o,c=10,s=e._layout.x,h=e._layout.y,l=e._layout.width,a=e._layout.height;return(e._floatingObject&&e._floatingObject.isSelected()&&(s-=u,h-=u,l+=2*u,a+=2*u),v=e._inflateRect(new n.Rect(s,h,u,u),c),v.contains(t,r))?(f.inTopNWSEResizing=!0,f):(y=e._inflateRect(new n.Rect(s+l/2-u,h,2*u,u),c),y.contains(t,r))?(f.inTopNSResizing=!0,f):(p=e._inflateRect(new n.Rect(s+l-u,h,u,u),c),p.contains(t,r))?(f.inTopNESWResizing=!0,f):(w=e._inflateRect(new n.Rect(s,h+a/2-u,u,2*u),c),w.contains(t,r))?(f.inLeftWEResizing=!0,f):(b=e._inflateRect(new n.Rect(s+l-u,h+a/2-u,u,2*u),c),b.contains(t,r))?(f.inRightWEResizing=!0,f):(k=e._inflateRect(new n.Rect(s,h+a-u,u,u),c),k.contains(t,r))?(f.inBottomNESWResizing=!0,f):(d=e._inflateRect(new n.Rect(s+l/2-u,h+a-u,2*u,u),c),d.contains(t,r))?(f.inBottomNSReszing=!0,f):(g=e._inflateRect(new n.Rect(s+l-u,h+a-u,u,u),c),g.contains(t,r))?(f.inBottomNWSEReszing=!0,f):(f.inMoving=!0,f)},e.prototype._inflateRect=function(t,i){var f=t.x-i,e=t.y-i,r=t.width+2*i,u=t.height+2*i;return new n.Rect(f,e,r>=0?r:0,u>=0?u:0)},e}();n._FloatingObjectRender=ft;bt=function(){function t(n){this._sheet=n;this._containerArray=new v}return t.prototype._dispose=function(){for(var t=this._containerArray.length,n=0;n<t;n++)this._containerArray[n]._dispose();this._containerArray.length=0},t.prototype._render=function(t,r,u){var nt,tt,ht,v,ct;if(!(t<0)&&!(r<0)){for(var s=this,ut=s._createViewportFloatingObjectLayoutModel(t,r,u),et=[],f=0,g=s._containerArray.length;f<g;f++)ut.find(s._containerArray[f].name)||et.push(s._containerArray[f]);for(f=0,g=et.length;f<g;f++)nt=et[f],nt._renderManager=i,s._containerArray.remove(nt.name),nt._dispose();for(f=0;f<ut.length;f++){var h=ut[f],b=s._sheet._findFloatingObjectInternal(h.name),e=o;b&&typeof b.borderWidth=="function"&&(tt=b.borderWidth(),ht=b.borderStyle(),b._isBorderStyleWork(ht)||(tt=0),tt>e&&(e=tt));var p=s._getViewportRect(t,r),y=1,k=h.x-e-y,d=h.y-e-y,lt=h.width+2*e+2*y,at=h.height+2*e+2*y,ot=l(p.y,d),st=l(p.x,k),it=at,rt=lt,c=e+y,a=e+y,w=-1*e-y;d<=0&&(c+=d<w?w:d);k<=0&&(a+=k<w?w:k);c=d-ot+c;a=k-st+a;c<=0?(it+=c,it+=w):c<e&&c>0&&(it-=e-c);a<=0?(rt+=a,rt+=w):a<e&&a>0&&(rt-=e-a);v=s._containerArray.find(h.name);v||(v=new ft(s._sheet._findFloatingObjectInternal(h.name),s._sheet),v._renderManager=s,s._containerArray.push(v));v._layout=h;v._rowViewportIndex=t;v._columnViewportIndex=r;ct=new n.Rect(p.x,p.y,p.width,p.height);v.render(new n.Rect(st,ot,rt,it).getIntersectRect(ct)||new n.Rect(st,ot,0,0),new n.Rect(a,c,h.width,h.height))}}},t.prototype.setFloatingObjectZIndex=function(n,t){var i=this._containerArray.find(n);i&&i.setFloatingObjectZIndex(t)},t.prototype.getFloatingObjectZIndex=function(n){var t=this._containerArray.find(n);return t?t.getFloatingObjectZIndex():-1},t.prototype.reduceZIndex=function(){for(var t,i,r=this._containerArray,n=0,u=r.length;n<u;n++)t=r[n],i=t.getFloatingObjectZIndex(),i!==-1&&t.setFloatingObjectZIndex(i-1)},t.prototype._getViewportRect=function(t,i){var c=this._sheet,o=c._getViewportColumnLayout(i),u=0,f=0,s=0,h=0,v,l,e,y,a,p,r;return o&&o.length>0&&(v=o[0],l=o[o.length-1],u=v.x,s=l.x+l.width-u),e=c._getViewportRowLayout(t),e&&e.length>0&&(y=e[0],a=e[e.length-1],f=y.y,h=a.y+a.height-f),p=c._getSheetLayout(),r=p.viewportRect(t,i),u=r.x<u?u:r.x,f=r.y<f?f:r.y,s=r.width<s?r.width:s,h=r.height<h?r.height:h,new n.Rect(u,f,s,h)},t.prototype._createViewportFloatingObjectLayoutModel=function(n,t,i){var l=this,u=l._sheet,a=new v,k=u._floatingObjectArray.length,o,r,f,s,e,c,w,b;if(u._floatingObjectArray.length===0)return a;var d=u._getSheetLayout(),y=l._getViewportRect(n,t),p=l._getViewportTopLeftCoordinates(n,t,i);for(o=0;o<k;o++)if(r=u._floatingObjectArray[o],r.isVisible()){for(f=0,s=0;s<r.startColumn();s++)f+=h(u.getColumnWidth(s,3)*i);for(f+=r.startColumnOffset()*i,e=0,c=0;c<r.startRow();c++)e+=h(u.getRowHeight(c,3)*i);e+=r.startRowOffset()*i;w=h(r.width()*i);b=h(r.height()*i);f-=p.x;e-=p.y;f+=y.x;e+=y.y;a.push(new et(r.name(),f,e,w,b))}return a},t.prototype._getViewportTopLeftCoordinates=function(t,i,r){for(var c,o,f,l=this,u=l._sheet,v=u._getSheetLayout(),a=u.getViewportTopRow(t),s=0,e=0;e<a;e++)s+=h(u.getRowHeight(e,3)*r);for(c=u.getViewportLeftColumn(i),o=0,f=0;f<c;f++)o+=h(u.getColumnWidth(f,3)*r);return new n.Point(o,s)},t}();n._FloatingObjectRenderManager=bt;et=function(){function n(n,t,i,r,u){var f=this;f.name=n;f.x=t;f.y=i;f.height=u;f.width=r}return n}();n._FloatingObjectLayout=et;v=function(n){function t(){n.call(this)}return __extends(t,n),t.prototype.remove=function(n){for(var t=0;t<this.length;t++)if(this[t].name===n){this.splice(t,1);return}},t.prototype.find=function(n){for(var t=0;t<this.length;t++)if(this[t].name===n)return this[t];return i},t.prototype.findByPropertyName=function(n){for(var t=0;t<this.length;t++)if(this[t]._name===n)return this[t];return i},t}(n._XArray);n._HelperArray=v})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){(function(n){var f,l,d,e,a,g,r,v,nt,o,tt,it,rt;n.feature("sparklineEx",["core.theme"]);var t=null,h=Math.floor,u=Math.PI,y=Math.sin,p=Math.cos,s=Math.min,c=Math.max,w=Math.round,b=Math.pow,ut=Math.sqrt,i="undefined",k=function(){function n(n,t){this.name=n;this.value=t}return n}();n.SparklineExValue=k;f=function(){function i(){var r=this.createFunction(),i,u;r&&(i=r.name,u=r.evaluate,r.evaluate=function(n){var r=u.call(this,n);return r?new k(i,r):t},this._name=i,i&&!n.Calc.Functions.findGlobalFunction(i)&&(n.Calc.Functions._customFunctions[i]=r))}return i.prototype.name=function(){return this._name},i.prototype.createFunction=function(){return t},i.prototype._paintSparkline=function(n,t,i,r,u,f,e){this.paint(n,t,i,r,u,f)},i.prototype.paint=function(n,t,i,r,u,f){},i}();n.SparklineEx=f;l=function(){function n(n,t){this.values=n;this.colors=t}return n}();n.PieSparklineValue=l;d=function(r){function f(){r.call(this)}return __extends(f,r),f.prototype._getValuesFromReference=function(r){var o=[],s,u,h,c,f,e;if(r instanceof n.Calc.Reference)for(s=r.getRangeCount(),u=0;u<s;u++)for(h=r.getRowCount(u),c=r.getColumnCount(u),f=0;f<h;f++)for(e=0;e<c;e++)o.push(r.getValue(u,f,e));else r!==t&&typeof r!==i&&o.push(r);return o},f.prototype.createFunction=function(){if(!n.util.hasCalc())return t;var i=new n.Calc.Functions.Function("PIESPARKLINE",1,255),r=this;return i.evaluate=function(n){var t=r._getValuesFromReference(n[0]),i=Array.prototype.slice.call(n,1);return new l(t,i)},i.acceptsReference=function(n){return n===0},i},f.prototype._fixValues=function(n){for(var u=[],r,f=0,e=0,o=n.length;f<o;f++)r=n[f],r!==t&&typeof r!==i&&!isNaN(r)&&isFinite(r)?(r<0&&(r=-r),u[e++]=r):u[e++]=0;return n.length===1&&u.length===1&&(u[1]=1-u[0]),u},f.prototype._fixColors=function(t,i){var f=[],u=i.length,a,e,o,s,c,l,r;if(t<=u)f=i.slice(0,t);else{for(u===0?(f.push("darkgray"),u=1):f=i.slice(0),a=[],l=t-u+1,r=0;r<u;r++)a[r]=n._Color.parse(f[r]);for(r=u;r<t;r++)e=a[r%u],o=e.r,s=e.g,c=e.b,o-=o/l*(r/u),s-=s/l*(r/u),c-=c/l*(r/u),f[r]=new n._Color(255,h(o),h(s),h(c)).toString()}return f},f.prototype.paint=function(n,t,i,r,f,e){for(var c=i+f/2,l=r+e/2,it=5,a=s(f,e)/2-it,h=-.5*u,w,b=c+a*p(h),k=l+a*y(h),g=[],nt=[],d=this._fixValues(t.values),v=d.length,rt=this._fixColors(v,t.colors),tt=0,o=0;o<v;o++)tt+=d[o];for(n.save(),o=0;o<v;o++)w=h+d[o]/tt*2*u,n.beginPath(),n.moveTo(c,l),n.lineTo(b,k),n.arc(c,l,a,h,w,!1),n.lineTo(c,l),n.fillStyle=rt[o],n.fill(),g.push(b),nt.push(k),h=w,b=c+a*p(h),k=l+a*y(h);for(n.strokeStyle="white",o=0;o<v;o++)n.beginPath(),n.moveTo(c,l),n.lineTo(g[o],nt[o]),n.stroke();n.restore()},f}(f);n.PieSparkline=d;e=function(){function n(n,t,i){this.x=n;this.y=t;this.value=i}return n}();a=function(){function n(n,t,i,r,u,f,e){var o=this;o.points=n;o.mini=t;o.maxi=i;o.line1=r;o.line2=u;o.colorPositive=f;o.colorNegative=e}return n}();n.AreaSparklineValue=a;g=function(r){function u(){r.call(this)}return __extends(u,r),u.prototype._getValuesFromReference=function(t){var f=[],e,i,o,s,r,u;if(t instanceof n.Calc.Reference)for(e=t.getRangeCount(),i=0;i<e;i++)for(o=t.getRowCount(i),s=t.getColumnCount(i),r=0;r<o;r++)for(u=0;u<s;u++)f.push(t.getValue(i,r,u));return f},u.prototype.createFunction=function(){if(!n.util.hasCalc())return t;var i=new n.Calc.Functions.Function("AREASPARKLINE",1,7),r=this;return i.evaluate=function(n){var t=r._getValuesFromReference(n[0]),i=n[1],u=n[2],f=n[3],e=n[4],o=n[5],s=n[6];return new a(t,i,u,f,e,o,s)},i.acceptsReference=function(n){return n===0},i},u.prototype._fixValues=function(n){for(var f=[],r,u=0,e=0,o=n.length;u<o;u++)r=n[u],f[e++]=r!==t&&typeof r!==i&&!isNaN(r)&&isFinite(r)?r:0;return f},u.prototype._rangeMin=function(n){for(var t=n[0],i,r=1,u=n.length;r<u;r++)i=n[r],t>i&&(t=i);return t},u.prototype._rangeMax=function(n){for(var t=n[0],i,r=1,u=n.length;r<u;r++)i=n[r],t<i&&(t=i);return t},u.prototype._getXInStraightLine=function(n,t,i,r,u){return((t-u)*i+(u-r)*n)/(t-r)},u.prototype.paint=function(n,r,u,f,o,h){var y,bt,d,g,ei,ft,et,ri,p,rt,ui;n.save();var ot=this,b=r.points,st=r.mini,ht=r.maxi,kt=r.line1,dt=r.line2,ct=r.colorPositive,lt=r.colorNegative,at=5,gt,ni,ti,ii,v,l,nt,tt,a,vt,it,ut,yt,pt,fi,k,wt;for(b=ot._fixValues(b),(ct===t||typeof ct===i)&&(ct="#787878"),(lt===t||typeof lt==i)&&(lt="#CB0000"),ti=ot._rangeMin(b),(st===t||typeof st===i)&&(st=ti),v=s(st,ti),ii=ot._rangeMax(b),(ht===t||typeof ht===i)&&(ht=ii),l=c(ht,ii),a=0,v>0&&(v=0),l<0&&(l=0),a>l&&(a=l),a<v&&(a=v-1),vt=b.length,it=u+at,ut=f+at,yt=o-2*at,pt=h-2*at,fi=yt/(vt-1),k=(l-v)/pt,y=[],ft=ut+(l-a)/k,p=0;p<vt;p++)bt=b[p],et=it+fi*p,ri=ut+(l-bt)/k,p===0&&y.push(new e(et,ft,a)),p>0&&bt*b[p-1]<0&&(g=y[y.length-1],g&&(ei=ot._getXInStraightLine(g.x,g.y,et,ri,ft),y.push(new e(ei,ft,a)))),y.push(new e(et,ri,bt)),p===vt-1&&y.push(new e(et,ft,a));for(n.beginPath(),rt=0,ui=y.length;rt<ui;rt++)d=y[rt],d&&(n.lineTo(d.x,d.y),g=y[rt-1],d.value===a&&g&&(n.fillStyle=g.value>a?ct:lt,n.fill(),rt!==ui-1&&(n.beginPath(),n.lineTo(d.x,d.y))));(kt!==t||typeof kt===i)&&(nt=kt,nt>l&&(nt=l),nt<v&&(nt=v),wt=k!==0?(l-nt)/k:pt/2,gt=w(ut+wt)-.5,n.beginPath(),n.moveTo(it,gt),n.lineTo(it+yt,gt),n.strokeStyle="blue",n.stroke());(dt!==t||typeof dt===i)&&(tt=dt,tt>l&&(tt=l),tt<v&&(tt=v),wt=k!==0?(l-tt)/k:pt/2,ni=w(ut+wt)-.5,n.beginPath(),n.moveTo(it,ni),n.lineTo(it+yt,ni),n.strokeStyle="blue",n.stroke());n.restore()},u}(f);n.AreaSparkline=g;r=function(){function n(n,t){this.x=n;this.y=t}return n}();v=function(){function n(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b){var k=this;k.points1=n;k.points2=t;k.minX=i;k.maxX=r;k.minY=u;k.maxY=f;k.hLine=e;k.vLine=o;k.xMinZone=s;k.xMaxZone=h;k.yMinZone=c;k.yMaxZone=l;k.tags=a;k.drawSymbol=v;k.drawLines=y;k.color1=p;k.color2=w;k.dash=b}return n}();n.ScatterSparklineValue=v;nt=function(f){function e(){f.call(this)}return __extends(e,f),e.prototype._getValuesFromReference=function(t){var u=[],f,e,o,i,r;if(t instanceof n.Calc.Reference&&(f=t.getRangeCount(),f>0))for(e=t.getRowCount(0),o=t.getColumnCount(0),i=0;i<e;i++)for(u[i]=[],r=0;r<o;r++)u[i].push(t.getValue(0,i,r));return u},e.prototype.createFunction=function(){if(!n.util.hasCalc())return t;var i=new n.Calc.Functions.Function("SCATTERSPARKLINE",1,18),r=this;return i.evaluate=function(n){var t=r._getValuesFromReference(n[0]),i=r._getValuesFromReference(n[1]),u=n[2],f=n[3],e=n[4],o=n[5],s=n[6],h=n[7],c=n[8],l=n[9],a=n[10],y=n[11],p=n[12],w=n[13],b=n[14],k=n[15],d=n[16],g=n[17];return new v(t,i,u,f,e,o,s,h,c,l,a,y,p,w,b,k,d,g)},i.acceptsReference=function(n){return n===0||n===1},i},e.prototype._getScatterPoints=function(n){var e=[],t,f,i,u;if(t=n.length,t>0)if(f=n[0].length,t<f){if(t>=2)for(i=0;i<f;i++)e.push(new r(n[0][i],n[1][i]))}else if(f>=2)for(u=0;u<t;u++)e.push(new r(n[u][0],n[u][1]));return e},e.prototype._getMinScatterPoint=function(n){for(var t=new r(Number.MAX_VALUE,Number.MAX_VALUE),f=n.length,i,u=0;u<f;u++)i=n[u],t.x>i.x&&(t.x=i.x),t.y>i.y&&(t.y=i.y);return t},e.prototype._getMaxScatterPoint=function(n){for(var t=new r(-Number.MAX_VALUE,-Number.MAX_VALUE),f=n.length,i,u=0;u<f;u++)i=n[u],t.x<i.x&&(t.x=i.x),t.y<i.y&&(t.y=i.y);return t},e.prototype._getXInStraightLine=function(n,t,i,r){return i/r*(t-n)+n},e.prototype._paintLine=function(n,t,i,u,f,e,o){var p,k,d,w,tt;if(o){var g=this,l=ut(b(u-t,2)+b(f-i,2)),h=0,it=6,rt=2,nt=4,a=[],v,y,s,c;for(t<=u?(v=t,y=u,s=t,c=i):(v=u,y=t,s=u,c=f),p=(f-i)/(u-t),k=i-p*t,a.push(new r(s,c));h<l;)h+=it,h<=l&&(s=g._getXInStraightLine(v,y,h,l),c=p*s+k,a.push(new r(s,c))),h+=nt,h<=l&&(s=g._getXInStraightLine(v,y,h,l),c=p*s+k,a.push(new r(s,c))),h+=rt,h<=l&&(s=g._getXInStraightLine(v,y,h,l),c=p*s+k,a.push(new r(s,c))),h+=nt,h<=l&&(s=g._getXInStraightLine(v,y,h,l),c=p*s+k,a.push(new r(s,c)));for(n.strokeStyle=e,d=0,tt=a.length;d<tt-1;d+=2)n.beginPath(),w=a[d],n.moveTo(w.x,w.y),w=a[d+1],n.lineTo(w.x,w.y),n.stroke()}else n.beginPath(),n.moveTo(t,i),n.lineTo(u,f),n.strokeStyle=e,n.stroke()},e.prototype.paint=function(n,r,f,e,o,h){var w=this,yi=r.points1,vt=r.points2,yt=r.minX,pt=r.maxX,wt=r.minY,bt=r.maxY,kt=r.hLine,dt=r.vLine,gt=r.xMinZone,ni=r.xMaxZone,ti=r.yMinZone,ii=r.yMaxZone,bi=r.tags,ri=r.drawSymbol,ki=r.drawLines,st=r.color1,ht=r.color2,di=r.dash,v=4,ui=5,it=f+ui,rt=e+ui,ut=o-2*ui,ft=h-2*ui,nt,tt,y,l,a,p,b,k,fi,ei,oi,si,hi,et,d,ot,g,ci,ct,li,lt,at;if(yi&&!(yi.length<=0)&&(nt=w._getScatterPoints(yi),!(nt.length<=0))&&(!vt||!(vt.length>0)||(tt=w._getScatterPoints(vt),!(tt.length<=0)))){if(n.save(),n.rect(f,e,o,h),n.clip(),n.beginPath(),(ri===t||typeof ri===i)&&(ri=!0),(st===t||typeof st===i)&&(st="#969696"),(ht===t||typeof ht===i)&&(ht="#CB0000"),y=wt!==t&&typeof wt!==i?wt:w._getMinScatterPoint(nt).y,l=bt!==t&&typeof bt!==i?bt:w._getMaxScatterPoint(nt).y,a=yt!==t&&typeof yt!==i?yt:w._getMinScatterPoint(nt).x,p=pt!==t&&typeof pt!==i?pt:w._getMaxScatterPoint(nt).x,a>=p&&(p=a+1),y>=l&&(l=y+1),gt!==t&&typeof gt!==i&&ni!==t&&typeof ni!==i&&ti!==t&&typeof ti!==i&&ii!==t&&typeof ii!==i&&a<=gt&><=p&&a<=ni&&ni<=p&&y<=ti&&ti<=l&&y<=ii&&ii<=l){var ai=c(a,gt),pi=s(p,ni),wi=c(y,ti),vi=s(l,ii);ai>=pi&&(pi=ai+1);wi>=vi&&(vi=wi+1);n.beginPath();n.fillStyle="#DCDCDC";n.fillRect(it+(ai-a)*ut/(p-a),rt+(l-vi)*ft/(l-y),(pi-ai)*ut/(p-a),(vi-wi)*ft/(l-y))}for(ci=-Number.MAX_VALUE,ct=-Number.MAX_VALUE,li=Number.MAX_VALUE,lt=Number.MAX_VALUE,b=0,fi=nt.length;b<fi-1;b++)k=nt[b],ei=k.x,oi=k.y,k=nt[b+1],si=k.x,hi=k.y,et=it+(ei-a)*ut/(p-a),ot=it+(si-a)*ut/(p-a),d=rt+(l-oi)*ft/(l-y),g=rt+(l-hi)*ft/(l-y),ki&&w._paintLine(n,et,d,ot,g,st,di),ri&&(b===0&&(n.beginPath(),n.strokeStyle=st,n.arc(et-v/2,d-v/2,v/2,0,u*2,!1),n.stroke()),n.beginPath(),n.strokeStyle=st,n.arc(ot-v/2,g-v/2,v/2,0,u*2,!1),n.stroke()),bi&&(b===0&&(d>ct&&(ci=et,ct=d),d<lt&&(li=et,lt=d)),g>ct&&(ci=ot,ct=g),g<lt&&(li=ot,lt=g));if(vt&&vt.length>0)for((wt===t||typeof wt===i)&&(y=w._getMinScatterPoint(tt).y),(bt===t||typeof bt===i)&&(l=w._getMaxScatterPoint(tt).y),(yt===t||typeof yt===i)&&(a=w._getMinScatterPoint(tt).x),(pt===t||typeof pt===i)&&(p=w._getMaxScatterPoint(tt).x),a>=p&&(p=a+1),y>=l&&(l=y+1),b=0,fi=tt.length;b<fi-1;b++)k=tt[b],ei=k.x,oi=k.y,k=tt[b+1],si=k.x,hi=k.y,et=it+(ei-a)*ut/(p-a),ot=it+(si-a)*ut/(p-a),d=rt+(l-oi)*ft/(l-y),g=rt+(l-hi)*ft/(l-y),ki&&w._paintLine(n,et,d,ot,g,ht,di),ri&&(b===0&&(n.beginPath(),n.strokeStyle=ht,n.strokeRect(et-v/2,d-v/2,v,v)),n.beginPath(),n.strokeStyle=ht,n.strokeRect(ot-v/2,g-v/2,v,v));bi&&(n.beginPath(),n.arc(ci-v/2,ct-v/2,v/2,0,u*2,!1),n.fillStyle="#CB0000",n.fill(),n.beginPath(),n.arc(li-v/2,lt-v/2,v/2,0,u*2,!1),n.fillStyle="#0000FF",n.fill());kt!==t&&typeof kt!==i&&y<=kt&&kt<=l&&(at=rt+(l-kt)*ft/(l-y),w._paintLine(n,it,at,it+ut,at,"#CB0000"));dt!==t&&typeof dt!==i&&a<=dt&&dt<=p&&(at=it+(dt-a)*ut/(p-a),w._paintLine(n,at,rt,at,rt+ft,"#CB0000"));n.restore()}},e}(f);n.ScatterSparkline=nt;o=function(r){function u(){r.call(this)}return __extends(u,r),u.prototype._getValuesFromReference=function(t){var u=[],f,e,o,i,r;if(t instanceof n.Calc.Reference&&(f=t.getRangeCount(),f>0))for(e=t.getRowCount(0),o=t.getColumnCount(0),i=0;i<e;i++)for(u[i]=[],r=0;r<o;r++)u[i].push(t.getValue(0,i,r));return u},u.prototype._parseSetting=function(n){var u={},c=!1,l=!0,e="",s="",h,a,r,o,f;if(n){for(n=n.substr(1,n.length-2),h=0,a=n.length;h<a;h++)r=n.charAt(h),r===":"?l=!1:r!==","||c?r==="'"||r==='"'||(r==="("?c=!0:r===")"&&(c=!1),l?e+=r:s+=r):(u[e]=s,e="",s="",l=!0);e&&(u[e]=s);for(o in u)f=u[o],f!==t&&typeof f!==i&&(f.toUpperCase()==="TRUE"?u[o]=!0:f.toUpperCase()==="FALSE"?u[o]=!1:!isNaN(f)&&isFinite(f)&&(u[o]=parseFloat(f)))}return u},u.prototype._createCustomFunction=function(r,u){var f=new n.Calc.Functions.Function(r,2,5),e=this;return f.evaluate=function(r){var s=r[0],v,f,w,a,l,b,k,o,c;if(s instanceof n.Calc.Reference&&(v=s.getRangeCount(),v>0)){var d=new n.Range(s.getRow(0),s.getColumn(0),s.getRowCount(0),s.getColumnCount(0)),g=r[1],h=r[2],p,y;if(h instanceof n.Calc.Reference&&(v=h.getRangeCount(),v>0&&(p=new n.Range(h.getRow(0),h.getColumn(0),h.getRowCount(0),h.getColumnCount(0)),y=r[3])),f=new n.SparklineSetting,w=r[4],w){a=e._parseSetting(w);b={AXISCOLOR:"_axisColor",FIRSTMARKERCOLOR:"_firstMarkerColor",HIGHMARKERCOLOR:"_highMarkerColor",LASTMARKERCOLOR:"_lastMarkerColor",LOWMARKERCOLOR:"_lowMarkerColor",MARKERSCOLOR:"_markersColor",NEGATIVECOLOR:"_negativeColor",SERIESCOLOR:"_seriesColor",DISPLAYEMPTYCELLSAS:"displayEmptyCellsAs",RIGHTTOLEFT:"rightToLeft",DISPLAYHIDDEN:"displayHidden",DISPLAYXAXIS:"displayXAxis",SHOWFIRST:"_showFirst",SHOWHIGH:"_showHigh",SHOWLAST:"_showLast",SHOWLOW:"_showLow",SHOWNEGATIVE:"_showNegative",SHOWMARKERS:"_showMarkers",MANUALMAX:"manualMax",MANUALMIN:"manualMin",MAXAXISTYPE:"maxAxisType",MINAXISTYPE:"minAxisType",LINEWEIGHT:"lineWeight"};for(o in a)o&&(l=b[o.toUpperCase()],l&&(f[l]=a[o]));k={AC:"_axisColor",FMC:"_firstMarkerColor",HMC:"_highMarkerColor",LASTMC:"_lastMarkerColor",LOWMC:"_lowMarkerColor",MC:"_markersColor",NC:"_negativeColor",SC:"_seriesColor",DECA:"displayEmptyCellsAs",RTL:"rightToLeft",DH:"displayHidden",DXA:"displayXAxis",SF:"_showFirst",SH:"_showHigh",SLAST:"_showLast",SLOW:"_showLow",SN:"_showNegative",SM:"_showMarkers",MMAX:"manualMax",MMIN:"manualMin",MAXAT:"maxAxisType",MINAT:"minAxisType",LW:"lineWeight"};for(o in a)o&&(l=k[o.toUpperCase()],l&&(f[l]=a[o]));f.maxAxisType===1&&(f.maxAxisType=0);f.minAxisType===1&&(f.minAxisType=0);f.rightToLeft=!!f.rightToLeft;f.displayHidden=!!f.displayHidden;f.displayXAxis=!!f.displayXAxis;f._showFirst=!!f._showFirst;f._showHigh=!!f._showHigh;f._showLast=!!f._showLast;f._showLow=!!f._showLow;f._showNegative=!!f._showNegative;f._showMarkers=!!f._showMarkers}return c=new n.SparklineValue(-1,-1,d,g,u,f),p&&typeof y!==i&&y!==t&&(c.dateAxisData(p),c.dateAxisOrientation(y),c.group().displayDateAxis=!0),c.cachedValues=e._getValuesFromReference(s),c.cachedDatetimes=e._getValuesFromReference(h),c}},f.acceptsReference=function(n){return n===0||n===2},f},u.prototype._fixValues=function(r,u,f,e,o,s){var a=[],l=o===1,c,v;if(e)for(c=0,v=l?e.colCount:e.rowCount;c<v;c++){var y=l?0:c,p=l?c:0,h=r[y][p];!f&&(u.getRowHeight(e.row+y)<=0||u.getColumnWidth(e.col+p)<=0)?h=NaN:h!==t&&typeof h!==i&&(s?h=typeof h=="number"?n._DateTimeHelper.fromOADate(h):Date.parse(h):typeof h!="number"&&(h=n.__invalidValuePlaceHolder));a.push(h)}return a},u.prototype._paintSparkline=function(t,i,r,u,f,e,o){if(n.features.sparkline){var s=i,h=s.cachedValues,c=s.cachedDatetimes,v=o._zoomFactor,y=new n.SparklineRender(s),l=s.setting(),a=l.displayHidden;h=this._fixValues(h,o,a,s.data(),s.dataOrientation());c=this._fixValues(c,o,a,s.dateAxisData(),s.dateAxisOrientation(),!0);l._setThemeContext(o);y._paintCore(t,r,u,f,e,h,c,v)}},u}(f);n.CompatibleSparkline=o;tt=function(i){function r(){i.apply(this,arguments)}return __extends(r,i),r.prototype.createFunction=function(){return!n.util.hasCalc()||!n.features.sparkline?t:i.prototype._createCustomFunction.call(this,"LINESPARKLINE",0)},r}(o);n.LineSparkline=tt;it=function(i){function r(){i.apply(this,arguments)}return __extends(r,i),r.prototype.createFunction=function(){return!n.util.hasCalc()||!n.features.sparkline?t:i.prototype._createCustomFunction.call(this,"COLUMNSPARKLINE",1)},r}(o);n.ColumnSparkline=it;rt=function(i){function r(){i.apply(this,arguments)}return __extends(r,i),r.prototype.createFunction=function(){return!n.util.hasCalc()||!n.features.sparkline?t:i.prototype._createCustomFunction.call(this,"WINLOSSSPARKLINE",2)},r}(o);n.WinlossSparkline=rt})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(n){var c,f,y,o,s,l,a;n.feature("comment",["core.common","core.sheet_action"]);var t=null,i=undefined,r=Math.max,u=Math.min,e=Math.floor,v=Math.atan2,h=Math.abs;(function(n){n[n.AlwaysShown=1]="AlwaysShown";n[n.HoverShown=2]="HoverShown"})(n.DisplayMode||(n.DisplayMode={}));c=n.DisplayMode;f=function(){function n(n,t,i,r){this.left=0;this.top=0;this.right=0;this.bottom=0;var u=this;arguments.length===1?u.top=u.right=u.bottom=u.left=n:arguments.length===4&&(u.top=n,u.right=t,u.bottom=i,u.left=r)}return n.prototype.toString=function(){var n=this;return n.top+"px "+n.right+"px "+n.bottom+"px "+n.left+"px"},n}();n.Padding=f,function(n){n[n.TopLeft=0]="TopLeft";n[n.TopRight=1]="TopRight";n[n.BottomLeft=2]="BottomLeft";n[n.BottomRight=3]="BottomRight";n[n.MiddleLeft=4]="MiddleLeft";n[n.MiddleRight=5]="MiddleRight";n[n.TopCenter=6]="TopCenter";n[n.BottomCenter=7]="BottomCenter"}(n.ResizeDirection||(n.ResizeDirection={}));y=n.ResizeDirection;o=function(){function r(){var i=this;i._defaultLocation=new n.Point(9,-18);i._text="";i._location=i._defaultLocation;i._displayMode=2;i._commentState=3;i._width=160;i._height=100;i._fontFamily="Arial";i._fontStyle="normal";i._fontSize="9pt";i._fontWeight="normal";i._textDecoration=0;i._foreColor="black";i._backColor="#FFFFE1";i._opacity=1;i._locked=!0;i._lockText=!0;i._dynamicMove=!0;i._dynamicSize=!0;i._horizontalAlign=0;i._autoSize=!1;i._borderWidth=1;i._borderStyle="solid";i._borderColor="black";i._padding=t;i._zIndex=-1;i._showShadow=!1;i._timeout=t;i._rowIndex=-1;i._colIndex=-1;i._sheet=t}return r.prototype.text=function(n){var t=this;return arguments.length===0?t._text:(t._text!==n&&t._changeProperty("text",n),t)},r.prototype.location=function(n){var t=this;return arguments.length===0?t._location:(n&&t._location!==n&&t._changeProperty("location",n),t)},r.prototype.width=function(n){var t=this;return arguments.length===0?t._width:(n>0&&t._width!==n&&(t._autoSize=!1,t._changeProperty("width",n)),t)},r.prototype.height=function(n){var t=this;return arguments.length===0?t._height:(n>0&&t._height!==n&&(t._autoSize=!1,t._changeProperty("height",n)),t)},r.prototype.fontFamily=function(n){var t=this;return arguments.length===0?t._fontFamily:(typeof n=="string"&&t._fontFamily!==n&&t._changeProperty("fontFamily",n),t)},r.prototype.fontStyle=function(n){var t=this;return arguments.length===0?t._fontStyle:(typeof n=="string"&&t._fontStyle!==n&&t._changeProperty("fontStyle",n),t)},r.prototype.fontSize=function(n){var t=this;return arguments.length===0?t._fontSize:(typeof n=="string"&&t._fontSize!==n&&t._changeProperty("fontSize",n),t)},r.prototype.fontWeight=function(n){var t=this;return arguments.length===0?t._fontWeight:(typeof n=="string"&&t._fontWeight!==n&&t._changeProperty("fontWeight",n),t)},r.prototype.textDecoration=function(t){var r=this;return arguments.length===0?r._textDecoration:(r._textDecoration!==t&&n.TextDecorationType[t]!=i&&r._changeProperty("textDecoration",t),r)},r.prototype.foreColor=function(n){var t=this;return arguments.length===0?t._foreColor:(n&&t._foreColor!==n&&t._changeProperty("foreColor",n),t)},r.prototype.locked=function(n){var t=this;return arguments.length===0?t._locked:(typeof n=="boolean"&&t._locked!==n&&t._changeProperty("locked",n),t)},r.prototype.lockText=function(n){var t=this;return arguments.length===0?t._lockText:(typeof n=="boolean"&&t._lockText!==n&&t._changeProperty("lockText",n),t)},r.prototype.horizontalAlign=function(t){var r=this;return arguments.length===0?r._horizontalAlign:(r._horizontalAlign!==t&&n.HorizontalAlign[t]!=i&&r._changeProperty("horizontalAlign",t),r)},r.prototype.autoSize=function(n){var t=this;return arguments.length===0?t._autoSize:(typeof n=="boolean"&&t._autoSize!==n&&t._changeProperty("autoSize",n),t)},r.prototype.dynamicSize=function(n){var t=this;return arguments.length===0?t._dynamicSize:(typeof n=="boolean"&&t._dynamicSize!==n&&t._changeProperty("dynamicSize",n),t)},r.prototype.dynamicMove=function(n){var t=this;return arguments.length===0?t._dynamicMove:(typeof n=="boolean"&&t._dynamicMove!==n&&t._changeProperty("dynamicMove",n),t)},r.prototype.backColor=function(n){var t=this;return arguments.length===0?t._backColor:(n&&t._backColor!==n&&t._changeProperty("backColor",n),t)},r.prototype.opacity=function(n){var t=this;return arguments.length===0?t._opacity:(typeof n=="number"&&n>=0&&n<=1&&t._opacity!==n&&t._changeProperty("opacity",n),t)},r.prototype.borderWidth=function(n){var t=this;return arguments.length===0?t._borderWidth:(typeof n=="number"&&n>0&&t._borderWidth!==n&&t._changeProperty("borderWidth",n),t)},r.prototype.borderStyle=function(n){var t=this;return arguments.length===0?t._borderStyle:(typeof n=="string"&&t._borderStyle!==n&&t._changeProperty("borderStyle",n),t)},r.prototype.borderColor=function(n){var t=this;return arguments.length===0?t._borderColor:(typeof n=="string"&&t._borderColor!==n&&t._changeProperty("borderColor",n),t)},r.prototype.padding=function(n){var t=this;return arguments.length===0?t._padding:((n===null||n instanceof f)&&t._padding!==n&&t._changeProperty("padding",n),t)},r.prototype.showShadow=function(n){var t=this;return arguments.length===0?t._showShadow:(typeof n=="boolean"&&t._showShadow!==n&&t._changeProperty("showShadow",n),t)},r.prototype.displayMode=function(n){var t=this;return arguments.length===0?t._displayMode:(t._displayMode!==n&&c[n]!==i&&t._changeProperty("displayMode",n),t)},r.prototype.commentState=function(t){var r=this;return arguments.length===0?r._commentState:(r._commentState!==t&&n.CommentState[t]!==i&&r._changeProperty("commentState",t),r)},r.prototype.zIndex=function(n){var t=this;return arguments.length===0?t._zIndex:(typeof n=="number"&&t._zIndex!==n&&t._changeProperty("zIndex",n),t)},r.prototype._changeProperty=function(n,t){var i=this,r=i._sheet,u="_"+n;r?r._bindToAutoRefresh(function(n){i.hasOwnProperty(u)&&(i[u]=n)})(t):i.hasOwnProperty(u)&&(i[u]=t);i._trigger({sheet:r,sheetName:r?r._name:"",comment:i,propertyName:n})},r.prototype._trigger=function(t){this._sheet&&this._sheet._trigger(n.Events.CommentChanged,t)},r.prototype.clone=function(){var t=this,i=new r;return i._text=t._text,i._location=new n.Point(t._location.x,t._location.y),t._defaultLocation&&(i._defaultLocation=new n.Point(t._defaultLocation.x,t._defaultLocation.y)),i._width=t._width,i._height=t._height,i._fontFamily=t._fontFamily,i._fontStyle=t._fontStyle,i._fontSize=t._fontSize,i._fontWeight=t._fontWeight,i._textDecoration=t._textDecoration,i._foreColor=t._foreColor,i._locked=t._locked,i._lockText=t._lockText,i._horizontalAlign=t._horizontalAlign,i._autoSize=t._autoSize,i._dynamicMove=t._dynamicMove,i._dynamicSize=t._dynamicSize,i._backColor=t._backColor,i._opacity=t._opacity,i._borderWidth=t._borderWidth,i._borderStyle=t._borderStyle,i._borderColor=t._borderColor,t._padding&&(i._padding=new f(t._padding.top,t._padding.right,t._padding.bottom,t._padding.left)),i._showShadow=t._showShadow,i._displayMode=t._displayMode,i._commentState=t._commentState,i._sheet=t._sheet,i._rowIndex=t._rowIndex,i._colIndex=t._colIndex,i._zIndex=t._zIndex,i},r.prototype.toJSON=function(){var n=this,r={text:n._text,location:n._location,displayMode:n._displayMode,commentState:n._commentState,width:n._width,height:n._height,fontFamily:n._fontFamily,fontStyle:n._fontStyle,fontSize:n._fontSize,fontWeight:n._fontWeight,textDecoration:n._textDecoration,foreColor:n._foreColor,backColor:n._backColor,opacity:n._opacity,locked:n._locked,lockText:n._lockText,dynamicMove:n._dynamicMove,dynamicSize:n._dynamicSize,horizontalAlign:n._horizontalAlign,autoSize:n._autoSize,borderWidth:n._borderWidth,borderStyle:n._borderStyle,borderColor:n._borderColor,padding:n._padding,zIndex:n._zIndex,showShadow:n._showShadow,rowIndex:n._rowIndex,colIndex:n._colIndex},u={},t,i;for(t in r)i=r[t],n._isDefaultValue(t,i)||(u[t]=i);return u},r.prototype._isDefaultValue=function(n,t){switch(n){case"text":return t==="";case"location":return t.x===9&&t.y===-18;case"displayMode":return t===2;case"commentState":return t===3;case"width":return t===160;case"height":return t===100;case"fontFamily":return t==="Arial";case"fontStyle":return t==="normal";case"fontSize":return t==="9pt";case"fontWeight":return t==="normal";case"textDecoration":return t===0;case"foreColor":return t==="black";case"backColor":return t==="#FFFFE1";case"opacity":return t===1;case"locked":return t===!0;case"lockText":return t===!0;case"dynamicMove":return t===!0;case"dynamicSize":return t===!0;case"horizontalAlign":return t===0;case"autoSize":return t===!1;case"borderWidth":return t===1;case"borderStyle":return t==="solid";case"borderColor":return t==="black";case"padding":return t===null;case"zIndex":return t===-1;case"showShadow":return t===!1;case"rowIndex":return t===-1;case"colIndex":return t===-1;default:return!1}},r.prototype.fromJSON=function(t){var r,e,u;t&&(r=this,t.text!==i&&(r._text=t.text),e=t.location,e!==i&&(r._location=new n.Point(e.x,e.y)),t.displayMode!==i&&(r._displayMode=t.displayMode),t.commentState!==i&&(r._commentState=t.commentState),t.width!==i&&(r._width=t.width),t.height!==i&&(r._height=t.height),t.fontFamily!==i&&(r._fontFamily=t.fontFamily),t.fontStyle!==i&&(r._fontStyle=t.fontStyle),t.fontSize!==i&&(r._fontSize=t.fontSize),t.fontWeight!==i&&(r._fontWeight=t.fontWeight),t.textDecoration!==i&&(r._textDecoration=t.textDecoration),t.foreColor!==i&&(r._foreColor=t.foreColor),t.backColor!==i&&(r._backColor=t.backColor),t.opacity!==i&&(r._opacity=t.opacity),t.locked!==i&&(r._locked=t.locked),t.lockText!==i&&(r._lockText=t.lockText),t.dynamicMove!==i&&(r._dynamicMove=t.dynamicMove),t.dynamicSize!==i&&(r._dynamicSize=t.dynamicSize),t.horizontalAlign!==i&&(r._horizontalAlign=t.horizontalAlign),t.autoSize!==i&&(r._autoSize=t.autoSize),t.borderWidth!==i&&(r._borderWidth=t.borderWidth),t.borderStyle!==i&&(r._borderStyle=t.borderStyle),t.borderColor!==i&&(r._borderColor=t.borderColor),u=t.padding,u!==i&&(r._padding=new f(u.top,u.right,u.bottom,u.left)),t.zIndex!==i&&(r._zIndex=t.zIndex),t.showShadow!==i&&(r._showShadow=t.showShadow),t.rowIndex!==i&&(r._rowIndex=t.rowIndex),t.colIndex!==i&&(r._colIndex=t.colIndex))},r}();n.Comment=o;s=function(){function f(n,t){this._rowViewportIndex=1;this._columnViewportIndex=1;var i=this,r=n&&n._sheet;i._comment=n;i._updateCommentViewportIndex();i._zoomFactor=r._zoomFactor;i._commentManager=t;i._editor=t._editorDom;i._init();i._absLocation=i._getAbsLocation();i._updateStartCoordinate();i._updateEndCoordinate()}return f.prototype._init=function(){var n=this;n._commentLayoutPanel=t;n._floatBlockCanvasContainer=t;n._floatBlockCanvas=t;n._hostContainer=t;n._host=t;n._lineCanvasContainer=t;n._lineCanvas=t;n._floatBlockCanvasContainerClassName="gc-spread-floatBlockCanvas-container";n._floatBlockCanvasClassName="gc-spread-floatBlockCanvas";n._hostContainerClassName="gc-spread-host-container";n._hostClassName="gc-spread-host";n._lineCanvasContainerClassName="gc-spread-lineCanvas-container";n._lineCanvasClassName="gc-spread-lineCanvas";n._floatBlockCanvasContainer=document.createElement("div");$(n._floatBlockCanvasContainer).addClass(n._floatBlockCanvasContainerClassName).css("position","absolute").css("overflow","hidden");n._floatBlockCanvas=document.createElement("canvas");$(n._floatBlockCanvas).addClass(n._floatBlockCanvasClassName).css("left",0).css("top",0).css("position","absolute");n._hostContainer=document.createElement("div");$(n._hostContainer).addClass(n._hostContainerClassName).css("position","absolute");n._host=document.createElement("div");$(n._host).addClass(n._hostClassName).css("left",0).css("top",0).css("width","100%").css("height","100%").css("position","absolute").css("word-wrap","break-word").css("word-break","normal").css("white-space","pre-wrap").css("overflow","hidden");$(n._hostContainer).append(n._host);$(n._floatBlockCanvasContainer).append(n._floatBlockCanvas,n._hostContainer);n._lineCanvasContainer=document.createElement("div");$(n._lineCanvasContainer).addClass(n._lineCanvasContainerClassName).css("position","absolute").css("overflow","hidden");n._lineCanvas=document.createElement("canvas");$(n._lineCanvas).addClass(n._lineCanvasClassName).css("left",0).css("right",0).css("position","absolute");$(n._lineCanvasContainer).append(n._lineCanvas);n._adornerDrawState=t;n._resizeHitRects=[];n._hostMargin=7;n._isMoving=!1;n._isResizing=!1},f.prototype.open=function(){var n=this,t=n._comment._sheet;(n._commentLayoutPanel||(t&&(n._commentLayoutPanel=t._commentRender._commentLayoutPanel),n._commentLayoutPanel))&&(n._commentLayoutPanel.appendChild(n._lineCanvasContainer),n._attachLineCanvasEventHandler(),n._commentLayoutPanel.appendChild(n._floatBlockCanvasContainer),n._attachFloatBlockCanvasEventHandler(),n._attachHostContainerEventHandler(),n.isEditing()?n._attachEditorEventHandler():n._attachHostEventHandler(),n.updateLayout())},f.prototype.close=function(){var n=this;n._floatBlockCanvasContainer&&n._lineCanvasContainer&&n._commentLayoutPanel&&(n._detachFloatBlockCanvasEventHandler(),n._detachHostContainerEventHandler(),n._detachHostEventHandler(),n._detachLineCanvasEventHandler(),n._detachEditorEventHandler(),$(n._floatBlockCanvasContainer).remove(),$(n._lineCanvasContainer).remove())},f.prototype.getComment=function(){return this._comment},f.prototype._getActualWidth=function(){return this._comment.width()*this._zoomFactor},f.prototype._getActualHeight=function(){return this._comment.height()*this._zoomFactor},f.prototype._getAbsLocation=function(){var n=this,t=n._comment;return t===n._commentManager.getHoverShownComment()&&t.commentState()===3?n._convertRelLocationToAbsLocation(t._defaultLocation):n._convertRelLocationToAbsLocation(t.location())},f.prototype._convertRelLocationToAbsLocation=function(i){var u=this,f=u._comment,e=f&&f._sheet,s=u._zoomFactor,h=t,r,o;return e&&(r=u._getCellRect(e,f._rowIndex,f._colIndex,u._rowViewportIndex,u._columnViewportIndex),r.x!==null&&r.x!==undefined&&r.y!==null&&r.y!==undefined&&r.width&&r.height&&(o=e._getSheetLayout(),h=new n.Point(r.x+r.width+i.x*s-o.rowHeaderWidth,r.y+i.y*s-o.colHeaderHeight))),h},f.prototype._getCellRect=function(t,i,f,e,o){for(var l,b=this,s=new n.Rect(0,0,0,0),h=t._getSheetLayout(),a=t.getViewportTopRow(e),v=t.getViewportLeftColumn(o),k=u(a,i),d=r(a,i),g=u(v,f),nt=r(v,f),y=0,p=0,c=b._zoomFactor,w=k;w<d;w++)p+=t.getRowHeight(w,3)*c;for(l=g;l<nt;l++)y+=t.getColumnWidth(l,3)*c;return s.y=i>=a?p:-p,s.x=f>=v?y:-y,s.width=t.getColumnWidth(f)*c,s.height=t.getRowHeight(i)*c,s.x+=h.rowHeaderWidth,s.y+=h.colHeaderHeight,e===1?s.y+=h.frozenHeight:e===2&&(s.y+=h.frozenHeight+h.viewportHeight),o===1?s.x+=h.frozenWidth:o===2&&(s.x+=h.frozenWidth+h.viewportWidth),s},f.prototype._convertAbsLocationToRelLocation=function(i){var u=this,f=u._comment,e=f&&f._sheet,o=u._zoomFactor,s=t,r;if(e&&(r=u._getCellRect(e,f._rowIndex,f._colIndex,u._rowViewportIndex,u._columnViewportIndex),r.x!==null&&r.x!==undefined&&r.y!==null&&r.y!==undefined&&r.width&&r.height)){var h=e._getSheetLayout(),c=(i.x-(r.x+r.width-h.rowHeaderWidth))/o,l=(i.y-(r.y-h.colHeaderHeight))/o;s=new n.Point(c,l)}return s},f.prototype.updateLayoutWhenAutosizeChanged=function(){var t=this,i=t._comment,n=t._host,u=n.style,f,e;if(i.autoSize()&&(u.width!=="auto"||u.height!=="auto")){t.isEditing()&&t.detachEditor();var o=5,s=i._sheet._getFontHeight(u.font),h=$(n).width(),c=$(n).height();$(n).css("width","auto").css("height","auto").css("word-wrap","normal");f=r($(n).width(),o);e=r($(n).height(),s);i._width+=f-h;i._height+=e-c}else i.autoSize()||u.width!=="auto"||u.height!=="auto"||(t.isEditing()&&t.detachEditor(),$(n).css("width",$(n).width()).css("height",$(n).height()).css("word-wrap","break-word"));t.updateLayout()},f.prototype.updateLayoutWhenLocationChanged=function(){var n=this;n._absLocation=n._getAbsLocation();n._updateStartCoordinate();n._updateEndCoordinate();n.updateLayout()},f.prototype.updateLayoutWhenWidthHeightChanged=function(){var n=this;n._absLocation=n._getAbsLocation();n._updateEndCoordinate()},f.prototype.updateLayoutWhenRowColumnChanged=function(){var n=this,t=n._comment,i;t.dynamicMove()?t.dynamicSize()?(n._updateSizeByCoordinate(),n._updateLocationByCoordinate()):(n._updateLocationByCoordinate(),n._updateEndCoordinate()):(n._updateStartCoordinate(),n._updateEndCoordinate(),i=n._convertAbsLocationToRelLocation(n._absLocation),t.location(i))},f.prototype.updateLayoutWhenSheetScroll=function(){var n=this;n._absLocation=n._getAbsLocation();n.updateLayout()},f.prototype._updateLocationByCoordinate=function(){var n=this,t=n._comment,r=t&&t._sheet,i=n._getLocationByCoordinate();n._absLocation=i;t._location=n._convertAbsLocationToRelLocation(i);n.updateLayout()},f.prototype._getLocationByCoordinate=function(){var t=this,c=t._comment,i=c&&c._sheet,f=t._zoomFactor,l=i.getViewportLeftColumn(t._columnViewportIndex),a=i.getViewportTopRow(t._rowViewportIndex),v=t._getViewportRect(t._rowViewportIndex,t._columnViewportIndex),r,e,s,u,o,h;for(t._columnViewportIndex===0?r=0:t._columnViewportIndex===1?r=i.getViewportWidth(0):t._columnViewportIndex===2&&(r=i.getViewportWidth(0)+i.getViewportWidth(1)),e=l;e<t._startColumn;e++)r+=i.getColumnWidth(e,3)*f;for(s=i.getColumnWidth(t._startColumn,3),s<t._startColumnOffset&&(t._startColumnOffset=s),r=r+t._startColumnOffset*f,t._rowViewportIndex===0?u=0:t._rowViewportIndex===1?u=i.getViewportHeight(0):t._rowViewportIndex===2&&(u=i.getViewportHeight(0)+i.getViewportHeight(1)),o=a;o<t._startRow;o++)u+=i.getRowHeight(o,3)*f;return h=i.getRowHeight(t._startRow,3),h<t._startRowOffset&&(t._startRowOffset=h),u=u+t._startRowOffset*f,new n.Point(r,u)},f.prototype._updateSizeByCoordinate=function(){for(var o,s,i,f,h,c,n=this,r=n._comment,t=r&&r._sheet,l=n._zoomFactor,u=0,e=n._startColumn;e<n._endColumn;e++)u+=t.getColumnWidth(e,3);for(o=t.getColumnWidth(n._startColumn,3),o<n._startColumnOffset&&(n._startColumnOffset=o),s=t.getColumnWidth(n._endColumn,3),s<n._endColumnOffset&&(n._endColumnOffset=s),u=u-n._startColumnOffset+n._endColumnOffset,i=0,f=n._startRow;f<n._endRow;f++)i+=t.getRowHeight(f,3);h=t.getRowHeight(n._startRow,3);h<n._startRowOffset&&(n._startRowOffset=h);c=t.getRowHeight(n._endRow,3);c<n._endRowOffset&&(n._endRowOffset=c);i=i-n._startRowOffset+n._endRowOffset;r.width(u);r.height(i)},f.prototype._updateStartCoordinate=function(){var t=this,v=t._comment,i=v&&v._sheet,f=t._zoomFactor,o,r,l,u,a;if(t._absLocation){var w=t._getViewportRect(t._rowViewportIndex,t._columnViewportIndex),y=i.getViewportLeftColumn(t._columnViewportIndex),p=i.getViewportTopRow(t._rowViewportIndex),e;t._columnViewportIndex===0?e=t._absLocation.x:t._columnViewportIndex===1?e=t._absLocation.x-i.getViewportWidth(0):t._columnViewportIndex===2&&(e=t._absLocation.x-(i.getViewportWidth(0)+i.getViewportWidth(1)));t._rowViewportIndex===0?o=t._absLocation.y:t._rowViewportIndex===1?o=t._absLocation.y-i.getViewportHeight(0):t._rowViewportIndex===2&&(o=t._absLocation.y-(i.getViewportHeight(0)+i.getViewportHeight(1)));var s=new n.Point(e,o),h=0,c=0;for(r=y;r<i.getColumnCount();r++)if(l=i.getColumnWidth(r,3)*f,h+l<s.x)h+=l;else{t._startColumn=r;t._startColumnOffset=(s.x-h)/f;break}for(u=p;u<i.getRowCount();u++)if(a=i.getRowHeight(u,3)*f,c+a<s.y)c+=a;else{t._startRow=u;t._startRowOffset=(s.y-c)/f;break}}},f.prototype._updateEndCoordinate=function(){var t=this,v=t._comment,i=v&&v._sheet,f=t._zoomFactor,o,r,l,u,a;if(t._absLocation){var w=t._getViewportRect(t._rowViewportIndex,t._columnViewportIndex),y=i.getViewportLeftColumn(t._columnViewportIndex),p=i.getViewportTopRow(t._rowViewportIndex),e;t._columnViewportIndex===0?e=t._absLocation.x+t._getActualWidth():t._columnViewportIndex===1?e=t._absLocation.x+t._getActualWidth()-i.getViewportWidth(0):t._columnViewportIndex===2&&(e=t._absLocation.x+t._getActualWidth()-(i.getViewportWidth(0)+i.getViewportWidth(1)));t._rowViewportIndex===0?o=t._absLocation.y+t._getActualHeight():t._rowViewportIndex===1?o=t._absLocation.y+t._getActualHeight()-i.getViewportHeight(0):t._rowViewportIndex===2&&(o=t._absLocation.y+t._getActualHeight()-(i.getViewportHeight(0)+i.getViewportHeight(1)));var s=new n.Point(e,o),h=0,c=0;for(r=y;r<i.getColumnCount();r++)if(l=i.getColumnWidth(r,3)*f,h+l<s.x)h+=l;else{t._endColumn=r;t._endColumnOffset=(s.x-h)/f;break}for(u=p;u<i.getRowCount();u++)if(a=i.getRowHeight(u,3)*f,c+a<s.y)c+=a;else{t._endRow=u;t._endRowOffset=(s.y-c)/f;break}}},f.prototype.addRows=function(n,t){var i=this,r=i._comment;n<=i._startRow?r.dynamicMove()&&(i._startRow+=t,i._endRow+=t):n>i._startRow&&n<=i._endRow&&r.dynamicSize()&&(i._endRow+=t);i._updateSizeByCoordinate();i._updateLocationByCoordinate()},f.prototype.addColumns=function(n,t){var i=this,r=i._comment;n<=i._startColumn?r.dynamicMove()&&(i._startColumn+=t,i._endColumn+=t):n>i._startColumn&&n<=i._endColumn&&r.dynamicSize()&&(i._endColumn+=t);i._updateSizeByCoordinate();i._updateLocationByCoordinate()},f.prototype.removeRows=function(n,t){var i=this,r=i._comment,u=n+t-1;n<i._startRow?u<i._startRow?r.dynamicMove()&&(i._startRow-=t,i._endRow-=t):u<i._endRow&&r.dynamicMove()&&(i._endRow-=r.dynamicSize()?t:i._startRow-n+1,i._startRow=n,i._startRowOffset=0):n<=i._endRow&&(u<i._endRow?r.dynamicSize()&&(i._endRow-=t):r.dynamicSize()&&(i._endRow=n,i._endRowOffset=0));i._updateSizeByCoordinate();i._updateLocationByCoordinate()},f.prototype.removeColumns=function(n,t){var i=this,r=i._comment,u=n+t-1;n<i._startColumn?u<i._startColumn?r.dynamicMove()&&(i._startColumn-=t,i._endColumn-=t):u<i._endColumn&&r.dynamicMove()&&(i._endColumn-=r.dynamicSize()?t:i._startColumn-n+1,i._startColumn=n,i._startColumnOffset=0):n<=i._endColumn&&(u<i._endColumn?r.dynamicSize()&&(i._endColumn-=t):r.dynamicSize()&&(i._endColumn=n,i._endColumnOffset=0));i._updateSizeByCoordinate();i._updateLocationByCoordinate()},f.prototype._updateCommentViewportIndex=function(){var e=this,t=e._comment,n=t&&t._sheet,i=t._rowIndex,r=t._colIndex,u=1,f=1,o=n.frozenRowCount,s=n.frozenColCount,h=n._frozenTrailingRowCount,c=n._frozenTrailingColCount,l=n.getRowCount(),a=n.getColumnCount();i<o?u=0:i>=o&&i<=l-h-1?u=1:i>l-h-1&&(u=2);r<s?f=0:r>=s&&r<=a-c-1?f=1:r>a-c-1&&(f=2);e._rowViewportIndex=u;e._columnViewportIndex=f},f.prototype.updateLayout=function(){var n=this,t=n._comment._sheet;n.isOpen()&&(n._zoomFactor!==t._zoomFactor?(n._zoomFactor=t._zoomFactor,n._absLocation=n._getLocationByCoordinate()):n._zoomFactor=t._zoomFactor,n._updateCommentViewportIndex(),n._formatComment(),n._updateLineContainerLayout(),n._updateAdornerLayout(),$.browser.chrome&&n._offsetCommentLayoutInChrome())},f.prototype._formatComment=function(){var n=this,i=n._comment,t=i.commentState()===2?n._editor:n._host;n._formatCommentState();n._formatCommentStyle(t);n._formatCommentText(t);n._formatCommentLocation();n._formatCommentSize(t);n._formatCommentProtection()},f.prototype._formatCommentText=function(n){var t=this,i=t._comment;n===t._host&&(n.innerHTML=i.text().replace(/\r\n|\n|\r/g,"<br/>"))},f.prototype._formatCommentLocation=function(){var n=this,s=n._comment,h=s&&s._sheet;if(n._absLocation){var o=n._hostMargin,f=n._getActualWidth(),e=n._getActualHeight(),i=n._absLocation.x,r=n._absLocation.y,t=n._getViewportRect(n._rowViewportIndex,n._columnViewportIndex);i<t.x?($(n._floatBlockCanvas).css("left",i-t.x),$(n._hostContainer).css("left",i+o-t.x),f+=i-t.x,i=t.x):i+f>t.x+t.width?($(n._floatBlockCanvas).css("left",0),$(n._hostContainer).css("left",o),f+=t.x+t.width-1-(i+f)):($(n._floatBlockCanvas).css("left",0),$(n._hostContainer).css("left",o));f=u(t.width-1,f);r<t.y?($(n._floatBlockCanvas).css("top",r-t.y),$(n._hostContainer).css("top",r+o-t.y),e+=r-t.y,r=t.y):r+e>t.y+t.height?($(n._floatBlockCanvas).css("top",0),$(n._hostContainer).css("top",o),e+=t.y+t.height-1-(r+e)):($(n._floatBlockCanvas).css("top",0),$(n._hostContainer).css("top",o));e=u(t.height-1,e);$(n._floatBlockCanvasContainer).css("left",i).css("top",r).css("width",f).css("height",e)}},f.prototype._formatCommentSize=function(n){var t=this,i=t._comment,e=t._getActualWidth(),o=t._getActualHeight(),u,f;$(t._hostContainer).css("width",r(0,e-2*t._hostMargin-2*i.borderWidth())).css("height",r(0,o-2*t._hostMargin-2*i.borderWidth()));u=0;f=0;i.padding()&&(u-=parseInt(i.padding().left)+parseInt(i.padding().right),f-=parseInt(i.padding().top)+parseInt(i.padding().bottom));$(n).css("width",r(0,$(t._hostContainer).width()+u)).css("height",r(0,$(t._hostContainer).height()+f))},f.prototype._formatCommentProtection=function(){var n=this,t=n._comment,i=t&&t._sheet;i.isProtected?(t.locked()?(n._detachFloatBlockCanvasEventHandler(),n._attachMouseWheelEvent(n._floatBlockCanvas),n._detachHostContainerEventHandler(),n._attachMouseWheelEvent(n._hostContainer),n._floatBlockCanvas.style.cursor="default",n._hostContainer.style.cursor="default"):(n._attachFloatBlockCanvasEventHandler(),n._attachHostContainerEventHandler()),t.lockText()?(n._detachHostEventHandler(),n._attachMouseWheelEvent(n._host),n._detachEditorEventHandler(),n._attachMouseWheelEvent(n._editor),n._comment.commentState(3),n._host.style.cursor=n._comment.locked()?"default":"move"):(n._attachHostEventHandler(),n._attachEditorEventHandler()),n._attachLineCanvasEventHandler()):(n._attachFloatBlockCanvasEventHandler(),n._attachHostContainerEventHandler(),n._attachLineCanvasEventHandler(),n._attachHostEventHandler(),n._attachEditorEventHandler())},f.prototype._formatCommentState=function(){var i=this,r=i._comment,u=i._commentManager,n=r&&r._sheet;switch(r.commentState()){case 1:u.activateComment(r);i.isEditing()&&i.detachEditor();n.getSelections().length>0&&n._saveAndClearSheetSelections();window.gcGlobal.activeElement=n;break;case 2:u.activateComment(r);i.isEditing()||i._attachEditor();n.getSelections().length>0&&n._saveAndClearSheetSelections();window.gcGlobal.activeElement=t;break;case 3:r===u.getActiveComment()&&(u.deactivateComment(),n.getSelections().length===0&&n._loadAndSetSheetSelections());break}},f.prototype._formatCommentStyle=function(t){var r=this,i=r._comment,u=$(t),f;u.css("font-family",i.fontFamily()).css("font-style",i.fontStyle()).css("font-size",i.fontSize()).css("font-weight",i.fontWeight());u.css("text-decoration",r._getTextDecorationString(i.textDecoration()));u.css("text-align",n.HorizontalAlign[i.horizontalAlign()]);i.padding()?u.css("padding",i.padding().toString()):u.css("padding","0px");u.css("background-color",i.backColor()).css("color",i.foreColor()).css("opacity",i.opacity());$(r._hostContainer).css("border-width",i.borderWidth()).css("border-style",i.borderStyle()).css("border-color",i.borderColor());f=r._commentManager.getCommentActualZIndex(i);$(r._lineCanvasContainer).css("z-index",f);$(r._floatBlockCanvasContainer).css("z-index",f)},f.prototype._getTextDecorationString=function(n){var t="";return n!==0?((n|1)===n&&(t+=" underline"),(n|2)===n&&(t+=" line-through"),(n|4)===n&&(t+=" overline")):t+="none",t},f.prototype._formatCommentDynamicMoveAndDynamicSize=function(){},f.prototype._offsetCommentLayoutInChrome=function(){var r=this,i=this._comment._sheet,n=$(r._hostContainer);if(i&&n){var t=i._eventHandler._getCanvasOffset(),u=t.left-Math.floor(t.left)>=.5?.5:0,f=t.top-Math.floor(t.top)>=.5?.5:0;n.css("left",parseFloat(n.css("left"))+u);n.css("top",parseFloat(n.css("top"))+f)}},f.prototype._updateLineContainerLayout=function(){var r=this,w=r._comment,k=w._sheet,b=r._getCellRect(k,w._rowIndex,w._colIndex,r._rowViewportIndex,r._columnViewportIndex),d=k._getSheetLayout(),f=t,tt=b.x+b.width-d.rowHeaderWidth,it=b.y-d.colHeaderHeight;f=new n.Point(tt,it);var e=t,o=$(r._floatBlockCanvasContainer).position(),s=$(r._hostContainer).position(),y=$(r._hostContainer);e=o.left+s.left>f.x?new n.Point(o.left+s.left,o.top+s.top):o.top+s.top+y.height()<f.y?new n.Point(o.left+s.left+y.width(),o.top+s.top+y.height()):new n.Point(o.left+s.left+y.width(),o.top+s.top);var p=r._hostMargin,c=h(f.x-e.x)+2*p,l=h(f.y-e.y)+2*p,a=u(f.x,e.x)-p,v=u(f.y,e.y)-p,g=a+c,nt=v+l,i=r._getViewportRect(r._rowViewportIndex,r._columnViewportIndex);a<i.x&&(c-=i.x-a,a=i.x);g>i.x+i.width&&(c-=g-(i.x+i.width));c=u(i.width,c);v<i.y&&(l-=i.y-v,v=i.y);nt>i.y+i.height&&(l-=nt-(i.y+i.height));l=u(i.height,l);$(r._lineCanvasContainer).css("left",a).css("top",v).css("width",c).css("height",l);r._lineCanvas.width=c;r._lineCanvas.height=l;f.x=f.x-a;f.y=f.y-v;e.x=e.x-a;e.y=e.y-v;r._drawLine(f,e)},f.prototype._updateAdornerLayout=function(){var n=this,t=n._comment;n._floatBlockCanvas.width=n._getActualWidth();n._floatBlockCanvas.height=n._getActualHeight();n._drawAdorner()},f.prototype._drawLine=function(n,t){var r=this,i,u,f;r._lineCxt||(r._lineCxt=r._lineCanvas.getContext("2d"));i=r._lineCxt;u=r._comment.borderColor();i.strokeStyle=u;i.clearRect(0,0,r._lineCanvas.width,r._lineCanvas.height);i.beginPath();i.moveTo(n.x,n.y);i.lineTo(t.x,t.y);i.stroke();i.save();i.translate(n.x,n.y);i.fillStyle=u;i.beginPath();f=v(t.y-n.y,t.x-n.x);i.rotate(f);i.moveTo(0,0);i.lineTo(7,-4);i.lineTo(7,4);i.lineTo(0,0);i.fill();i.closePath();i.restore()},f.prototype._drawAdorner=function(){var n=this,u=n._comment,s=u._sheet;n._adornerDrawState=n._comment.commentState();n._adornerCxt||(n._adornerCxt=n._floatBlockCanvas.getContext("2d"));var t=n._adornerCxt,i=n._floatBlockCanvas.width,r=n._floatBlockCanvas.height,f=$(n._hostContainer).outerWidth(),e=$(n._hostContainer).outerHeight(),o=n._hostMargin;t.clearRect(0,0,i,r);t.lineWidth=1;n._comment.showShadow()&&(n._drawShadowAdorner(t,o,f,e),n._drawStateAdorner(t,i,r));s.isProtected&&u.locked()||n._drawResizeAdorner(t,o,i,r,f,e);t.restore()},f.prototype._drawShadowAdorner=function(n,t,i,r){n.rect(t+2,t+2,i,r);n.fill()},f.prototype._drawStateAdorner=function(n,t,i){var u,r;switch(this._adornerDrawState){case 1:for(n.beginPath(),u=0;u<i;u++)for(r=u%2==0?1:3;r<t;)n.moveTo(r,u),n.lineTo(r+1,u+1),r=r+4;n.stroke();n.closePath();break;case 2:n.beginPath();for(var r=0,u=0,f=4;r<t+i;)n.moveTo(r+f,0),n.lineTo(0,u+f),r=r+f,u=u+f;n.stroke();n.closePath();break;default:}},f.prototype._drawResizeAdorner=function(i,r,u,f,o,s){var h=this,c,l,a,v,y,p,w,b;(h._adornerDrawState===1||h._adornerDrawState===2)&&(h._resizeHitRects.splice(0,h._resizeHitRects.length),c=new n.Rect(0,0,r,r),h._resizeHitRects.push(c),l=new n.Rect(u-r,0,r,r),h._resizeHitRects.push(l),a=new n.Rect(0,f-r,r,r),h._resizeHitRects.push(a),v=new n.Rect(u-r,f-r,r,r),h._resizeHitRects.push(v),s>=3*r?(y=new n.Rect(0,e(f/2-r/2),r,r),h._resizeHitRects.push(y),p=new n.Rect(u-r,e(f/2-r/2),r,r),h._resizeHitRects.push(p)):(h._resizeHitRects.push(t),h._resizeHitRects.push(t)),o>=3*r?(w=new n.Rect(e(u/2-r/2),0,r,r),h._resizeHitRects.push(w),b=new n.Rect(e(u/2-r/2),f-r,r,r),h._resizeHitRects.push(b)):(h._resizeHitRects.push(t),h._resizeHitRects.push(t)),i.save(),i.fillStyle="white",i.strokeStyle="#939393",i.linewidth=1,i.translate(.5,.5),$(h._resizeHitRects).each(function(){if(h){var n=this,t=n.x,r=n.y,u=n.width,f=n.height;i.beginPath();i.fillRect(t,r,u-1,f-1);i.strokeRect(t,r,u-1,f-1);i.stroke();i.closePath()}}))},f.prototype._drawMoveResizeContainer=function(){var n=this,u=n._commentManager;n._moveResizeContainerDom?$(n._moveResizeContainerDom).remove():n._moveResizeContainerDom=document.createElement("div");n._moveResizePanelDom?$(n._moveResizePanelDom).remove():n._moveResizePanelDom=document.createElement("div");var i=$(n._moveResizePanelDom),f=$(n._moveResizeContainerDom),e=u._mouseCapture,r=$(n._hostContainer),t=n._getViewportRect(n._rowViewportIndex,n._columnViewportIndex);i.css({position:"absolute",overflow:"hidden",top:t.y,left:t.x,width:t.width,height:t.height}).bind("mousemove",function(t){n._doMouseMove(t)}).bind("mouseup",function(t){n._doMouseUp(t)});f.addClass("gc-spread-moveResizeContainer").css("position","absolute").css("left",n._absLocation.x+n._hostMargin-t.x).css("top",n._absLocation.y+n._hostMargin-t.y).css("width",r.outerWidth()-2).css("height",r.outerHeight()-2).css("border","gray solid thin").css("z-index",900);i.append(n._moveResizeContainerDom);n._commentLayoutPanel&&n._commentLayoutPanel.appendChild(n._moveResizePanelDom)},f.prototype._doMoveResizeContainer=function(t){var b=this,a=b._comment._sheet,p=a._commentManager,y=b._zoomFactor,c=p._mouseCapture,h=p.getActiveComment(),v,w,s,l;if(c.capture&&h){var i=p.getCommentView(h),o=i._absLocation,e=i._hostMargin,k=i._moveInfo.startTopRow,d=a.getViewportTopRow(i._rowViewportIndex),g=i._moveInfo.startLeftColumn,nt=a.getViewportLeftColumn(i._columnViewportIndex),tt=i._getTwoRowDistance(a,k,d),it=i._getTwoColumnDistance(a,g,nt),u=t.pageX/y-c.x,f=t.pageY/y-c.y;if(nt>g?u+=it:u-=it,d>k?f+=tt:f-=tt,v=i._getViewportRect(i._rowViewportIndex,i._columnViewportIndex),u!==0||f!==0)if(w=$(i._moveResizeContainerDom),c.resizeDirct==-100)l=i._convertRelLocationToAbsLocation(new n.Point(c.cachedRect.x+u,c.cachedRect.y+f)),w.css("left",l.x+e-v.x).css("top",l.y+e-v.y);else{switch(c.resizeDirct){case 0:u=r(u,0-o.x-e);f=r(f,0-o.y-e);s=i._getCommentTopLeftResizeRect(u,f);break;case 1:u=r(u,0-o.x-h.width()+e);f=r(f,0-o.y-e);s=i._getCommentTopRightResizeRect(u,f);break;case 2:u=r(u,0-o.x-e);f=r(f,0-o.y-h.height()+e);s=i._getCommentBottomLeftResizeRect(u,f);break;case 3:u=r(u,0-o.x-h.width()+e);f=r(f,0-o.y-h.height()+e);s=i._getCommentBottomRightResizeRect(u,f);break;case 4:u=r(u,0-o.x-e);s=i._getCommentMiddleLeftResizeRect(u);break;case 5:u=r(u,0-o.x-h.width()+e);s=i._getCommentMiddleRightResizeRect(u);break;case 6:f=r(f,0-o.y-e);s=i._getCommentTopCenterResizeRect(f);break;case 7:f=r(f,0-o.y-h.height()+e);s=i._getCommentBottomCenterResizeRect(f);break}l=i._convertRelLocationToAbsLocation(new n.Point(s.x,s.y));w.css("left",l.x+e-v.x).css("top",l.y+e-v.y).css("width",s.width*y-2*e-2).css("height",s.height*y-2*e-2)}}},f.prototype._attachEditor=function(){var n=this,i=n._comment,t;n.isEditing()||(t=n._commentManager._editorDom,$(n._host).remove(),n._detachHostEventHandler(),$(t).remove(),$(n._hostContainer).append(t),n._setDomStyle(t),n._formatCommentSize(t),$(t).focus(),t.selectionStart=t.value.length,n._attachEditorEventHandler(),i.commentState()!==2&&i.commentState(2))},f.prototype.detachEditor=function(){var t=this,i=t._comment,u=i._sheet,r,f;t.isEditing()&&(r=t._commentManager._editorDom,$(r).remove(),t._detachEditorEventHandler(),$(t._hostContainer).append(t._host),t._setDomStyle(t._host),t._attachHostEventHandler(),i.commentState()===2&&i.commentState(3),$(r).val()!==i.text()&&(f=new n.UndoRedo.CommentPropertyUndoAction(u,i,i.text(),$(r).val(),"text"),u._doCommand(f)))},f.prototype._getSheetHeight=function(n){var u,f,r;if(n===t||n===i)return-1;for(u=0,f=n.getRowCount(),r=0;r<f;r++)u+=n.getRowHeight(r,3)*this._zoomFactor;return u},f.prototype._getSheetWidth=function(n){var u,f,r;if(n===t||n===i)return-1;for(u=0,f=n.getColumnCount(),r=0;r<f;r++)u+=n.getColumnWidth(r,3)*this._zoomFactor;return u},f.prototype._getViewportHeight=function(n){var r=this,u=r._comment,t=u&&u._sheet,i;if(n===0||n===2)return t.getViewportHeight(n);else if(n===1){var e=t.getViewportBottomRow(0)+1,o=t.getViewportTopRow(2),f=0;for(i=e;i<=o;i++)f+=t.getRowHeight(i,3)*r._zoomFactor;return f}return-1},f.prototype._getViewportWidth=function(n){var r=this,u=r._comment,t=u&&u._sheet,i;if(n===0||n===2)return t.getViewportWidth(n);else if(n===1){var e=t.getViewportRightColumn(0)+1,o=t.getViewportLeftColumn(2),f=0;for(i=e;i<=o;i++)f+=t.getColumnWidth(i,3)*r._zoomFactor;return f}return-1},f.prototype._getTwoColumnDistance=function(n,t,i){for(var o=u(t,i),s=r(t,i),e=0,f=o;f<s;f++)e+=n.getColumnWidth(f,3)*this._zoomFactor;return e},f.prototype._getTwoRowDistance=function(n,t,i){for(var o=u(t,i),s=r(t,i),e=0,f=o;f<s;f++)e+=n.getRowHeight(f,3)*this._zoomFactor;return e},f.prototype._getViewportRect=function(t,i){var f=this,e=f._comment,o=e._sheet,s=f._commentManager,h=s.getCommentView(e),r=o._getSheetLayout(),u=new n.Rect(0,0,0,0);return u=r.viewportRect(t,i),t===0&&i===0||t===0&&i===2||t===2&&i===0||t===2&&i===2?(u.x=0,u.y=0,u.width=r.frozenWidth+r.viewportWidth+r.frozenTrailingWidth,u.height=r.frozenHeight+r.viewportHeight+r.frozenTrailingHeight):t===0&&i===1||t===2&&i===1?(u.x=r.frozenWidth,u.y=0,u.width=r.viewportWidth,u.height=r.frozenHeight+r.viewportHeight+r.frozenTrailingHeight):t===1&&i===0||t===1&&i===2?(u.x=0,u.y=r.frozenHeight,u.width=r.frozenWidth+r.viewportWidth+r.frozenTrailingWidth,u.height=r.viewportHeight):t===1&&i===1&&(u.x=r.frozenWidth,u.y=r.frozenHeight,u.width=r.viewportWidth,u.height=r.viewportHeight),u},f.prototype._setDomStyle=function(n){var i=this,t=i._comment,r=$(n);(n===i._editor||n===i._host)&&(n===i._editor?n.value=t.text():n.innerHTML=t.text().replace(/\r\n|\n|\r/g,"<br/>"),r.css("font-family",t.fontFamily()).css("font-style",t.fontStyle()).css("font-size",t.fontSize()).css("font-weight",t.fontWeight()).css("color",t.foreColor()).css("background-color",t.backColor()).css("text-align",t.horizontalAlign()).css("text-decoration",t.textDecoration()),t.padding()?r.css("padding",t.padding().toString()):r.css("padding","0px"))},f.prototype.isOpen=function(){var n=this;return n._floatBlockCanvasContainer&&n._floatBlockCanvasContainer.parentNode?!0:!1},f.prototype.isActive=function(){var n=this;return n.isOpen()&&n._comment===n._commentManager.getActiveComment()?!0:!1},f.prototype.isEditing=function(){var n=this;return n.isActive()?$(n._hostContainer).find("textarea").length>0:!1},f.prototype.getCommentRect=function(){var i=this,u=i._comment,e=u&&u._sheet,o=i._zoomFactor,f=t,r;return i.isOpen()&&(r=i._comment._sheet._getSheetLayout(),f=new n.Rect(i._absLocation.x+r.headerX+r.rowHeaderWidth,i._absLocation.y+r.headerY+r.colHeaderHeight,i._getActualWidth(),i._getActualHeight())),f},f.prototype.getCommentEditAreaRect=function(){var i=this,u=i._comment,a=u&&u._sheet,o=i._zoomFactor,r,s,h,c,l,f,e;return i.isOpen()&&(r=i.getCommentRect(),r)?(f=(i._hostMargin+u.borderWidth())*o,e=(i._hostMargin+u.borderWidth())*o,s=r.x+f,h=r.y+e,c=r.width-2*f,l=r.height-2*e,new n.Rect(s,h,c,l)):t},f.prototype._setCursorState=function(n){var i=this,r=i._comment,u=r._sheet,t=n.target,f=i._commentManager._mouseCapture,e;if(f.capture){(t.className===i._hostClassName||t.className===i._floatBlockCanvasClassName||t.className===i._lineCanvasClassName||t.className==="gc-spread-floatPanel")&&(t.style.cursor=f.resizeDirct>=0?"crosshair":"move");return}else{if(t.className===i._hostClassName)if(u.isProtected&&r.lockText()){t.style.cursor=r.locked()?"default":"move";return}else{t.style.cursor="text";return}if(t.className===i._floatBlockCanvasClassName||t.className===i._hostContainerClassName)if(u.isProtected&&r.locked()){t.style.cursor="default";return}else{e=i._getResizeDirection(n);switch(e){case 0:t.style.cursor="nw-resize";return;case 1:t.style.cursor="ne-resize";return;case 2:t.style.cursor="sw-resize";return;case 3:t.style.cursor="se-resize";return;case 4:t.style.cursor="w-resize";return;case 5:t.style.cursor="e-resize";return;case 6:t.style.cursor="n-resize";return;case 7:t.style.cursor="s-resize";return;default:t.style.cursor="move";return}}}t.style.cursor="default"},f.prototype._doMouseDownToEdit=function(t){var r=this,i=r._comment,u=i&&i._sheet;return u.endEdit(),u.unSelectAllFloatingObjects(),r._commentManager.activateComment(i),i.commentState(2),r._doMouseUp(t),n.util.cancelDefault(t)},f.prototype._doMouseDownToDragOrResize=function(t){var i=this,r=i._comment,u=r&&r._sheet,h=i._zoomFactor,c=i._commentManager,f=c._mouseCapture;u.endEdit();u.unSelectAllFloatingObjects();f.x=t.pageX/h;f.y=t.pageY/h;f.cachedRect=new n.Rect(r.location().x,r.location().y,r.width(),r.height());f.resizeDirct=i._getResizeDirection(t);i._handleDocumentMouseMove();f.capture=!0;i._setCursorState(t);c.activateComment(r);r.commentState(1);u.isProtected&&r.locked()||(i._moveInfo={},i._moveInfo.startTopRow=u.getViewportTopRow(i._rowViewportIndex),i._moveInfo.startLeftColumn=u.getViewportLeftColumn(i._columnViewportIndex),i._drawMoveResizeContainer(),f.resizeDirct===-100?i._isMoving=!0:i._isResizing=!0);var e=u._eventHandler,l=e._getCanvasOffset(),o=new n.Point(t.pageX-l.left,t.pageY-l.top),s=u.hitTest(o.x,o.y);e.startHitInfo={scrollRowViewportIndex:s.rowViewportIndex,scrollColViewportIndex:s.colViewportIndex,hitTestType:s.hitTestType};e.mousePosition=o;e.startScroll();e.isCommentWorking=!0;t.stopPropagation()},f.prototype._getAjustedLocationWhenMovingComment=function(t){var i=this,h=i._comment,c=h&&h._sheet,r=i._hostMargin,u=c._getSheetLayout(),l=i._getViewportRect(i._rowViewportIndex,i._columnViewportIndex),a=i._getSheetWidth(c),v=i._getSheetHeight(c),w=i._getCellRect(c,0,0,i._rowViewportIndex,i._columnViewportIndex),o=t.x+(0-(w.x-u.rowHeaderWidth))+h.width()-r,s=t.y+(0-(w.y-u.colHeaderHeight))+h.height()-r,f=t.x,e=t.y,y,p;return i._columnViewportIndex===1?(t.x<l.x-r&&(f=l.x-r),y=i._getViewportWidth(2),o>a-y&&(f-=o-(a-y))):i._columnViewportIndex===0?(t.x<0-r&&(f=0-r),o>u.width-u.rowHeaderWidth&&(f-=o-(u.width-u.rowHeaderWidth))):i._columnViewportIndex===2&&(t.x<0-r&&(f=0-r),o>a&&(f-=o-a)),i._rowViewportIndex===1?(t.y<l.y-r&&(e=l.y-r),p=i._getViewportHeight(2),s>v-p&&(e-=s-(v-p))):i._rowViewportIndex===0?(t.y<0-r&&(e=0-r),s>u.height-u.colHeaderHeight&&(e-=s-(u.height-u.colHeaderHeight))):i._rowViewportIndex===2&&(t.y<0-r&&(e=0-r),s>v&&(e-=s-v)),new n.Point(f,e)},f.prototype._getAdjustedRectWhenResizingComment=function(t,i,r){var u=this,d=u._comment,p=d&&d._sheet,h=u._hostMargin,w=u._zoomFactor,a=p._getSheetLayout(),g=u._getViewportRect(u._rowViewportIndex,u._columnViewportIndex),nt=u._getSheetWidth(p),tt=u._getSheetHeight(p),it=u._getCellRect(p,0,0,u._rowViewportIndex,u._columnViewportIndex),b=t.x,k=t.y,c=i*w,l=r*w,v=t.x+(0-(it.x-a.rowHeaderWidth))+c-h,y=t.y+(0-(it.y-a.colHeaderHeight))+l-h,f,e,o,s,rt,ut;return u._columnViewportIndex===1?(f=g.x-h,t.x<f&&(b=f,c-=f-t.x),rt=u._getViewportWidth(2),o=nt-rt,v>o&&(c-=v-o)):u._columnViewportIndex===0?(f=0-h,t.x<f&&(b=f,c-=f-t.x),o=a.width-a.rowHeaderWidth,v>o&&(c-=v-o)):u._columnViewportIndex===2&&(f=0-h,t.x<f&&(b=f,c-=f-t.x),o=nt,v>o&&(c-=v-o)),u._rowViewportIndex===1?(e=g.y-h,t.y<e&&(k=e,l-=e-t.y),ut=u._getViewportHeight(2),s=tt-ut,y>s&&(l-=y-s)):u._rowViewportIndex===0?(e=0-h,t.y<e&&(k=e,l-=e-t.y),s=a.height-a.colHeaderHeight,y>s&&(l-=y-s)):u._rowViewportIndex===2&&(e=0-h,t.y<e&&(k=e,l-=e-t.y),s=tt,y>s&&(l-=y-s)),new n.Rect(b,k,c/w,l/w)},f.prototype._doMoveResizeComment=function(t){var a=this,v=a._comment,u=v&&v._sheet,y=a._zoomFactor,p=u._commentManager,s=p._mouseCapture,r=p.getActiveComment(),f;if(s.capture&&r){var i=u._commentManager.getCommentView(r),ft=i._absLocation,et=i._hostMargin,w=i._moveInfo.startTopRow,b=u.getViewportTopRow(i._rowViewportIndex),k=i._moveInfo.startLeftColumn,d=u.getViewportLeftColumn(i._columnViewportIndex),g=i._getTwoRowDistance(u,w,b),nt=i._getTwoColumnDistance(u,k,d),e=t.pageX/y-s.x,o=t.pageY/y-s.y;if(d>k?e+=nt:e-=nt,b>w?o+=g:o-=g,e!==0||o!==0)if(s.resizeDirct==-100){var it=s.cachedRect.x+e,rt=s.cachedRect.y+o,tt=i._convertRelLocationToAbsLocation(new n.Point(it,rt)),ut=i._getAjustedLocationWhenMovingComment(tt),h=i._convertAbsLocationToRelLocation(ut);(h.x!==r.location().x||h.x!==r.location().y)&&u._doCommand(new n.UndoRedo.CommentPropertyUndoAction(u,r,r.location().clone(),h,"location"))}else{r._autoSize=!1;switch(s.resizeDirct){case 0:f=i._getCommentTopLeftResizeRect(e,o);break;case 1:f=i._getCommentTopRightResizeRect(e,o);break;case 2:f=i._getCommentBottomLeftResizeRect(e,o);break;case 3:f=i._getCommentBottomRightResizeRect(e,o);break;case 4:f=i._getCommentMiddleLeftResizeRect(e);break;case 5:f=i._getCommentMiddleRightResizeRect(e);break;case 6:f=i._getCommentTopCenterResizeRect(o);break;case 7:f=i._getCommentBottomCenterResizeRect(o);break}var tt=i._convertRelLocationToAbsLocation(new n.Point(f.x,f.y)),c=i._getAdjustedRectWhenResizingComment(tt,f.width,f.height),h=i._convertAbsLocationToRelLocation(new n.Point(c.x,c.y)),l=new n.UndoRedo.CommentUndoTransaction;(h.x!==r.location().x||h.y!==r.location().y)&&l.add(new n.UndoRedo.CommentPropertyUndoAction(u,r,r.location().clone(),h,"location"));c.width!==r.width()&&l.add(new n.UndoRedo.CommentPropertyUndoAction(u,r,r.width(),c.width,"width"));c.height!==r.height()&&l.add(new n.UndoRedo.CommentPropertyUndoAction(u,r,r.height(),c.height,"height"));u._doCommand(l)}}},f.prototype._doMouseMove=function(t){var e=this,u=e._comment._sheet,i;if(this._setCursorState(t),!u.getSelections()||!(u.getSelections().length>0)){var f=e._commentManager,c=t.target,o=f.getActiveComment(),r=u._eventHandler,s=r._getCanvasOffset(),h=new n.Point(t.pageX-s.left,t.pageY-s.top);return c&&o&&f._mouseCapture.capture&&(i=f.getCommentView(o),i&&i._moveResizeContainerDom&&this._doMoveResizeContainer(t),i._rowViewportIndex===1&&(r.mousePosition.y=h.y),i._columnViewportIndex===1&&(r.mousePosition.x=h.x),r.continueScroll()),n.util.cancelDefault(t)}},f.prototype._doMouseUp=function(t){var r=this,u=r._comment._sheet,i;if(!u.getSelections()||!(u.getSelections().length>0)){var s=t.target,f=r._commentManager,e=f.getActiveComment(),o=u._eventHandler;return o.isCommentWorking=!1,o.stopScroll(),s&&e&&(r._doMoveResizeComment(t),i=f.getCommentView(e),i&&i._moveResizePanelDom&&($(i._moveResizePanelDom).remove(),i._moveResizePanelDom=null,i._isMoving=!1,i._isResizing=!1),r._unhandleDocumentMouseMove(),f._mouseCapture.capture=!1,r._setCursorState(t)),n.util.cancelDefault(t)}},f.prototype._getResizeDirection=function(n){var i=this;if(i._resizeHitRects.length>0&&(i._adornerDrawState===1||i._adornerDrawState===2)){var f=n.target,r=n.pageX-$(f).offset().left,u=n.pageY-$(f).offset().top,t=i._resizeHitRects[0];if(t&&t.contains(r,u))return 0;if(t=i._resizeHitRects[1],t&&t.contains(r,u))return 1;if(t=i._resizeHitRects[2],t&&t.contains(r,u))return 2;if(t=i._resizeHitRects[3],t&&t.contains(r,u))return 3;if(t=i._resizeHitRects[4],t&&t.contains(r,u))return 4;if(t=i._resizeHitRects[5],t&&t.contains(r,u))return 5;if(t=i._resizeHitRects[6],t&&t.contains(r,u))return 6;if(t=i._resizeHitRects[7],t&&t.contains(r,u))return 7}return-100},f.prototype._getCommentTopLeftResizeRect=function(t,i){var r=this,f,e,o,s,u=r._commentManager._mouseCapture,h=u.cachedRect.width-2*r._hostMargin-t,c=u.cachedRect.height-2*r._hostMargin-i;return h>=0?(f=u.cachedRect.x+t,o=h+2*r._hostMargin):(f=u.cachedRect.x+u.cachedRect.width-2*r._hostMargin,o=-h+2*r._hostMargin),c>=0?(e=u.cachedRect.y+i,s=c+2*r._hostMargin):(e=u.cachedRect.y+u.cachedRect.height-2*r._hostMargin,s=-c+2*r._hostMargin),new n.Rect(f,e,o,s)},f.prototype._getCommentTopRightResizeRect=function(t,i){var r=this,e,o,s,h,u=r._commentManager._mouseCapture,f=u.cachedRect.width-2*r._hostMargin+t,c=u.cachedRect.height-2*r._hostMargin-i;return f>=0?(e=u.cachedRect.x,s=f+2*r._hostMargin):(e=u.cachedRect.x+f,s=-f+2*r._hostMargin),c>=0?(o=u.cachedRect.y+i,h=c+2*r._hostMargin):(o=u.cachedRect.y+u.cachedRect.height-2*r._hostMargin,h=-c+2*r._hostMargin),new n.Rect(e,o,s,h)},f.prototype._getCommentBottomLeftResizeRect=function(t,i){var r=this,e,o,s,h,u=r._commentManager._mouseCapture,c=u.cachedRect.width-2*r._hostMargin-t,f=u.cachedRect.height-2*r._hostMargin+i;return c>=0?(e=u.cachedRect.x+t,s=c+2*r._hostMargin):(e=u.cachedRect.x+u.cachedRect.width-2*r._hostMargin,s=-c+2*r._hostMargin),f>=0?(o=u.cachedRect.y,h=f+2*r._hostMargin):(o=u.cachedRect.y+f,h=-f+2*r._hostMargin),new n.Rect(e,o,s,h)},f.prototype._getCommentBottomRightResizeRect=function(t,i){var r=this,o,s,h,c,u=r._commentManager._mouseCapture,f=u.cachedRect.width-2*r._hostMargin+t,e=u.cachedRect.height-2*r._hostMargin+i;return f>=0?(o=u.cachedRect.x,h=f+2*r._hostMargin):(o=u.cachedRect.x+f,h=-f+2*r._hostMargin),e>=0?(s=u.cachedRect.y,c=e+2*r._hostMargin):(s=u.cachedRect.y+e,c=-e+2*r._hostMargin),new n.Rect(o,s,h,c)},f.prototype._getCommentMiddleLeftResizeRect=function(t){var r=this,u,o,f,s,i=r._commentManager._mouseCapture,e=i.cachedRect.width-2*r._hostMargin-t;return e>=0?(u=i.cachedRect.x+t,f=e+2*r._hostMargin):(u=i.cachedRect.x+i.cachedRect.width-2*r._hostMargin,f=-e+2*r._hostMargin),o=i.cachedRect.y,s=i.cachedRect.height,new n.Rect(u,o,f,s)},f.prototype._getCommentMiddleRightResizeRect=function(t){var r=this,f,o,e,s,i=r._commentManager._mouseCapture,u=i.cachedRect.width-2*r._hostMargin+t;return u>=0?(f=i.cachedRect.x,e=u+2*r._hostMargin):(f=i.cachedRect.x+u,e=-u+2*r._hostMargin),o=i.cachedRect.y,s=i.cachedRect.height,new n.Rect(f,o,e,s)},f.prototype._getCommentTopCenterResizeRect=function(t){var r=this,o,u,s,f,i=r._commentManager._mouseCapture,e=i.cachedRect.height-2*r._hostMargin-t;return o=i.cachedRect.x,s=i.cachedRect.width,e>=0?(u=i.cachedRect.y+t,f=e+2*r._hostMargin):(u=i.cachedRect.y+i.cachedRect.height-2*r._hostMargin,f=-e+2*r._hostMargin),new n.Rect(o,u,s,f)},f.prototype._getCommentBottomCenterResizeRect=function(t){var r=this,o,f,s,e,i=r._commentManager._mouseCapture,u=i.cachedRect.height-2*r._hostMargin+t;return o=i.cachedRect.x,s=i.cachedRect.width,u>=0?(f=i.cachedRect.y,e=u+2*r._hostMargin):(f=i.cachedRect.y+u,e=-u+2*r._hostMargin),new n.Rect(o,f,s,e)},f.prototype._attachMouseWheelEvent=function(t){var r=this,u=this._comment._sheet,i;if(t){i="";switch(t){case r._floatBlockCanvas:i=".floatBlockCanvas";case r._hostContainer:i=".hostContainer";case r._lineCanvasContainer:i=".lineCanvasContainer";case r._host:i=".host";case r._editor:i=".editor"}i&&($(t).unbind("gcmousewheel"+i),$(t).bind("gcmousewheel"+i,function(t){u._mouseWheelDelegate(t.originalEvent);n.util.cancelDefault(t)}))}},f.prototype._attachFloatBlockCanvasEventHandler=function(){var n=this,i=n._comment,r=i&&i&&i._sheet,t;n._detachFloatBlockCanvasEventHandler();t=".floatBlockCanvas";$(n._floatBlockCanvas).bind("mousedown"+t,function(t){n._doMouseDownToDragOrResize(t)}).bind("mousemove"+t,function(t){n._doMouseMove(t)}).bind("mouseup"+t,function(t){n._doMouseUp(t)}).bind("gcmousewheel"+t,function(n){r&&r._mouseWheelDelegate(n.originalEvent)})},f.prototype._detachFloatBlockCanvasEventHandler=function(){var n=this;$(n._floatBlockCanvas).unbind(".floatBlockCanvas")},f.prototype._attachHostContainerEventHandler=function(){var n=this,i=n._comment,r=i&&i._sheet,t;n._detachHostContainerEventHandler();t=".hostContainer";$(n._hostContainer).bind("mousedown"+t,function(t){n._doMouseDownToDragOrResize(t)}).bind("mousemove"+t,function(t){n._doMouseMove(t)}).bind("mouseup"+t,function(t){n._doMouseUp(t)}).bind("gcmousewheel"+t,function(n){r&&r._mouseWheelDelegate(n.originalEvent)})},f.prototype._detachHostContainerEventHandler=function(){var n=this;$(n._hostContainer).unbind(".hostContainer")},f.prototype._attachLineCanvasEventHandler=function(){var t=this,u=t._comment,n=u&&u._sheet,i,r;(t._detachLineCanvasEventHandler(),n)&&(i=n._eventHandler._getCanvasOffset(),r=".lineCanvas",$(t._lineCanvas).bind("mousedown"+r,function(r){var o=n.hitTest(r.pageX-i.left,r.pageY-i.top),u=o.commentHitInfo,e,f;u?(e=u.comment,f=n._commentManager.getCommentView(e),u.area==="editArea"?f._doMouseDownToEdit(r):u.area==="moveResizeArea"&&f._doMouseDownToDragOrResize(r),$(f._floatBlockCanvasContainer).css("z-index",parseInt($(t._lineCanvasContainer).css("z-index")+1))):n._mouseDownDelegate(r)}).bind("mousemove"+r,function(r){var s=n.hitTest(r.pageX-i.left,r.pageY-i.top),u=s.commentHitInfo,e,o,f;u?(e=u.comment,o=n._commentManager.getCommentView(e),o._doMouseMove(r),u.area==="editArea"?t._lineCanvas.style.cursor="text":u.area==="moveResizeArea"&&(t._lineCanvas.style.cursor="move")):(n._mouseMoveDelegate(r),f=n._getCanvas(),f&&(t._lineCanvas.style.cursor=f.style.cursor))}).bind("mouseup"+r,function(t){var e=n.hitTest(t.pageX-i.left,t.pageY-i.top),r=e.commentHitInfo,u,f;r?(u=r.comment,f=n._commentManager.getCommentView(u),f._doMouseUp(t)):n._mouseUpDelegate(t)}).bind("dblclick"+r,function(t){n._dblClickDelegate(t)}).bind("gcmousewheel"+r,function(t){n._mouseWheelDelegate(t.originalEvent)}))},f.prototype._detachLineCanvasEventHandler=function(){var n=this;$(n._lineCanvas).unbind(".lineCanvas")},f.prototype._attachHostEventHandler=function(){var n=this,i=n._comment,r=i&&i._sheet,t;i.commentState()!==2&&n._host&&(n._detachHostEventHandler(),t=".host",$(n._host).bind("mousedown"+t,function(t){n._doMouseDownToEdit(t)}).bind("mousemove"+t,function(t){n._doMouseMove(t)}).bind("mouseup"+t,function(t){n._doMouseUp(t)}).bind("gcmousewheel"+t,function(n){r&&r._mouseWheelDelegate(n.originalEvent)}))},f.prototype._detachHostEventHandler=function(){var n=this,t=n._comment;t.commentState()!==2&&n._host&&$(n._host).unbind(".host")},f.prototype._attachEditorEventHandler=function(){var i=this,t=i._comment,r=t&&t._sheet,u=i._editor,n;t.commentState()===2&&u&&(this._detachEditorEventHandler(),n=".editor",$(u).bind("mousedown"+n,function(n){n.stopPropagation()}).bind("mousemove"+n,function(n){n.stopPropagation()}).bind("mouseup"+n,function(n){n.stopPropagation()}).bind("gcmousewheel"+n,function(n){r&&r._mouseWheelDelegate(n.originalEvent)}).bind("input"+n,function(n){t.autoSize()&&i._doAutoSizeEditor()}).bind("keydown"+n,function(n){(n.keyCode===27||n.keyCode===9)&&(t.commentState(1),window.gcGlobal.activeElement=r)}))},f.prototype._doAutoSizeEditor=function(){var c=this,n=c._comment,l=n&&n._sheet,t=c._editor,a=t.style,k=$(t).height(),d=$(t).width(),f,e,o=0,i,s,h,v,y,p;a.font?o=l._getFontHeight(a.font):(i="",n.fontStyle()&&(i+=" "+n.fontStyle()),n.fontWeight()&&(i+=" "+n.fontWeight()),n.fontSize()&&(i+=" "+n.fontSize()),n.fontFamily()&&(i+=" "+n.fontFamily()),o=l._getFontHeight(i));var w=o,b=5,u=[];if(u=t.value.split("\n"),u&&u.length>0){for(f=r(u.length*o,w),s=0,h=0;h<u.length;h++)v=l._getStringWidth(u[h],a.font),s<v&&(s=v);e=r(s,b)}else f=w,e=b;$(t).css("height",f).css("width",e);$(c._host).css("height","auto").css("width","auto");n._text=t.value;y=e-d;y!==0&&n._changeProperty("width",n.width()+y);p=f-k;p!==0&&n._changeProperty("height",n.height()+p)},f.prototype._detachEditorEventHandler=function(){var n=this,i=n._comment,t=n._editor;i.commentState()===2&&t&&$(t).unbind(".editor")},f.prototype._handleDocumentMouseMove=function(){var t=this,i=this._commentManager._mouseCapture,n;i.capture||(n=".gcComment",$(document).bind("mousemove"+n,function(n){t._doMouseMove(n)}).bind("mouseup"+n,function(n){t._doMouseUp(n)}),i.capture=!0)},f.prototype._unhandleDocumentMouseMove=function(){var n=this._commentManager._mouseCapture;n.capture&&(n.capture=!1,$(document).unbind(".gcComment"))},f}();n.CommentView=s;l=function(){function n(n){var i=this;i._sheet=n;i._mouseCapture={capture:!1,x:0,y:0,cachedRect:t,resizeDirct:-100};i._editorDom=t;i._hoverShowComment=t;i._activeComment=t;i._commentList=[];i._commentViewList=[];i.createEditDom()}return n.prototype.createEditDom=function(){var n=document.createElement("textarea");$(n).addClass("gc-comment-editor").css("left",0).css("top",0).css("position","absolute").css("margin",0).css("padding",0).css("word-wrap","break-word").css("word-break","normal").css("overflow","hidden").css("resize","none").css("outline","none").css("border","0px").attr("autocomplete","off").attr("gcUIElement","gcEditingInput");this._editorDom=n},n.prototype.getCommentList=function(){for(var t=this,i=[],n=0;n<t._commentList.length;n++)i.push(t._commentList[n]);return i},n.prototype.getHoverShownComment=function(){return this._hoverShowComment},n.prototype._addCommentView=function(n){var t=this;n&&t._commentViewList.indexOf(n)===-1&&this._commentViewList.push(n)},n.prototype._removeCommentView=function(n){this._commentViewList.splice(this._commentViewList.indexOf(n),1)},n.prototype.getCommentView=function(n){var i,r;if(!n)return t;for(i=0;i<this._commentViewList.length;i++)if(r=this._commentViewList[i],r.getComment()===n)return r;return t},n.prototype.hasComment=function(){return this._commentList.length>0},n.prototype.addComment=function(n,t,i){var r=this;i&&!r.containsComment(i)&&(i._sheet=r._sheet,i._rowIndex=n,i._colIndex=t,i._zIndex=898,r._updateCommentZIndex(),r._commentList.push(i),r._sheet.invalidate())},n.prototype._updateCommentZIndex=function(){for(var i=this,t=i._commentList,n=0;n<t.length;n++)t[n]._zIndex--},n.prototype._getTopCommentZIndex=function(){var n=this,t,i,r;if(n._commentList.length>0){for(t=n._commentList[0].zIndex(),i=1;i<n._commentList.length;i++)r=n._commentList[i],t<r.zIndex()&&(t=r.zIndex());return t}return 0},n.prototype.removeComment=function(n){var t=this,r=t._commentList,i;n&&(t.hideComment(n),r.splice(r.indexOf(n),1),i=t.getCommentView(n),i&&t._removeCommentView(i))},n.prototype.containsComment=function(n){var t=this;return t._commentList.indexOf(n)!==-1?!0:!1},n.prototype.clear=function(n,i,r,u){var h=this,f=h._sheet,c=f.isPaintSuspended(),e,o,s;for(f.isPaintSuspended(!0),e=0;e<r;e++)for(o=0;o<u;o++)s=f.getComment(e+n,o+i),s&&(h.removeComment(s),f.setComment(e+n,o+i,t));f.isPaintSuspended(c)},n.prototype.addRows=function(n,t){for(var r,u,f=this,e=f._commentList,o=f._commentViewList,i=0;i<e.length;i++)r=e[i],n<=r._rowIndex&&(r._rowIndex+=t);for(i=0;i<o.length;i++)u=o[i],u.isOpen()&&u.addRows(n,t)},n.prototype.addColumns=function(n,t){for(var r,u,f=this,e=f._commentList,o=f._commentViewList,i=0;i<e.length;i++)r=e[i],n<=r._colIndex&&(r._colIndex+=t);for(i=0;i<o.length;i++)u=o[i],u.isOpen()&&u.addColumns(n,t)},n.prototype.removeRows=function(n,t){for(var r,e,f=this,u=f._commentList,o=f._commentViewList,i=0;i<u.length;i++)r=u[i],r._rowIndex>=n&&r._rowIndex<n+t&&(f.removeComment(r),i--);for(i=0;i<u.length;i++)r=u[i],n<r._rowIndex&&(r._rowIndex-=t);for(i=0;i<o.length;i++)e=o[i],e.isOpen()&&e.removeRows(n,t)},n.prototype.removeColumns=function(n,t){for(var r,e,f=this,u=f._commentList,o=f._commentViewList,i=0;i<u.length;i++)r=u[i],r._colIndex>=n&&r._colIndex<n+t&&(f.removeComment(r),i--);for(i=0;i<u.length;i++)r=u[i],n<r._colIndex&&(r._colIndex-=t);for(i=0;i<o.length;i++)e=o[i],e.isOpen()&&e.removeColumns(n,t)},n.prototype.getActiveComment=function(){return this._activeComment},n.prototype.activateComment=function(n){var t=this;n&&n!==t._activeComment&&(t.deactivateComment(),t._activeComment=n)},n.prototype.deactivateComment=function(){var i=this,r=i._activeComment,n;r&&(n=i.getCommentView(r),!n||n._isMoving||n._isResizing||(n.isEditing()&&n.detachEditor(),r.commentState(3),i._activeComment=t))},n.prototype.showComment=function(n){var i=this,t;n&&(t=i.getCommentView(n),t||(t=new s(n,i),i._addCommentView(t)),t.open())},n.prototype.showAllComments=function(){for(var n=0;n<this._commentList.length;n++)this.showComment(this._commentList[n])},n.prototype.hideComment=function(n){var i=this,r=i.getCommentView(n);r&&r.isOpen()&&(r.close(),n===i._activeComment&&i._sheet._loadAndSetSheetSelections());clearTimeout(n._timeout);n._timeout=t},n.prototype.hideAllComments=function(){for(var n=0;n<this._commentList.length;n++)this.hideComment(this._commentList[n])},n.prototype.hoverShowComment=function(n){var i=this,r=i._activeComment;if(r)if(r.displayMode()===1){if(r.commentState()===2)return}else if(r.commentState()===2||r.commentState()===1)return;n!==i._hoverShowComment&&(i._hoverShowComment&&i.hideComment(i._hoverShowComment),n&&n.displayMode()==2?i._mouseCapture.capture||n._timeout||(i._hoverShowComment=n,n._timeout=setTimeout(function(){i.showComment(n)},200)):i._hoverShowComment=t)},n.prototype._isHitTestComment=function(n,t,i){var u=this.getCommentView(n),r;return u&&(r=u.getCommentRect(),r)?r.contains(t,i):!1},n.prototype._isHitTestCommentEditArea=function(n,t,i){var u=this.getCommentView(n),r;return u&&(r=u.getCommentEditAreaRect(),r)?r.contains(t,i):!1},n.prototype.getCommentHitInfo=function(n,i){for(var u,f=this,r=t,e=0;e<f._commentList.length;e++)u=f._commentList[e],f._isHitTestComment(u,n,i)&&(r?u.zIndex()>r.zIndex()&&(r=u):r=u);return r?f._isHitTestCommentEditArea(r,n,i)?{x:n,y:i,comment:r,area:"editArea"}:{x:n,y:i,comment:r,area:"moveResizeArea"}:t},n.prototype.getCommentActualZIndex=function(n){var t=this,r=t._sheet,i=t._getTopCommentZIndex();if(n===t._hoverShowComment)return i+2;else if(n===t._activeComment)return i+1;return n.zIndex()},n.prototype.updateCommentsLayoutWhenRowColumnChanged=function(){for(var i,t=this._commentViewList,n=0;n<t.length;n++)i=t[n],i.updateLayoutWhenRowColumnChanged()},n.prototype.updateCommentsLayoutWhenSheetScroll=function(){for(var i,t=this._commentViewList,n=0;n<t.length;n++)i=t[n],i.updateLayoutWhenSheetScroll()},n.prototype.fromJSON=function(n){var i,t;if(!n)return null;for(i=0;i<n.length;i++)t=new o,t.fromJSON(n[i]),(t.commentState()===1||t.commentState()===2)&&(this._activeComment=t),this._sheet.setComment(t._rowIndex,t._colIndex,t)},n.prototype.toJSON=function(){for(var n=[],t=0;t<this._commentList.length;t++)n.push(this._commentList[t].toJSON());return n.length===0?i:n},n}();n.CommentManager=l;a=function(){function n(n){this._sheet=t;var i=this;i._commentLayoutPanel=i._createCommentLayoutPanel();n.appendChild(i._commentLayoutPanel)}return n.prototype._createCommentLayoutPanel=function(){var t=this,n=document.createElement("div");return $(n).addClass("comment-layoutPanel").css("position","absolute").css("left",0).css("top",0).css("height",0).css("width",0).css("overflow","visible").css("z-index",701),n},n.prototype.renderCommentFloatPanel=function(n){var t=this,f=t._sheet||n,i,u,r;f._commentManager.hasComment()&&(i=n._getSheetLayout(),$(t._commentLayoutPanel).css("left",i.x+i.rowHeaderWidth).css("top",i.y+i.colHeaderHeight),t._sheet!==n&&(t._sheet&&(u=t._sheet._commentManager),u&&(r=u.getActiveComment(),r&&r.commentState()===2&&r._changeProperty("commentState",1)),t._sheet=n))},n.prototype.renderCommentCellAdorner=function(n,t,i){var c=i.row,l=i.col,u=i.x,f=i.y,r=i.width,o=i.height,s=this,h,e;t===3&&s._sheet&&(h=s._sheet.getComment(c,l),h&&(e=6,n&&r>0&&o>0&&(n.save(),n.rect(u,f,r,o),n.clip(),n.fillStyle="red",n.beginPath(),n.moveTo(u+r-e,f),n.lineTo(u+r,f),n.lineTo(u+r,f+e),n.lineTo(u+r-e,f),n.fill(),n.restore())))},n.prototype.renderComment=function(n){for(var i,r,f,e,o=this._sheet,s=n.getCommentList(),u=0;u<s.length;u++)i=s[u],r=n.getCommentView(i),this._canShowComment(n,i)?(i.displayMode()===1&&i===n.getHoverShownComment()&&(n._hoverShowComment=t),r&&r.isOpen()?r.updateLayout():n.showComment(i)):r&&r.isOpen()&&n.hideComment(i);f=n.getActiveComment();f&&(e=n.getCommentView(f),e&&e.isOpen()&&o.getSelections().length>0&&o._selectionModel.clear())},n.prototype._canShowComment=function(n,t){var i=this._sheet;if(i.getColumnWidth(t._colIndex)&&i.getRowHeight(t._rowIndex))switch(t.displayMode()){case 1:return!0;case 2:if(t.commentState()===2||t.commentState()===1)return n&&t!==n.getHoverShownComment()&&(n._hoverShowComment=t),!0}return!1},n}();n.CommentRender=a})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(t){var i,h;t.feature("formulatextbox",["core.common"]);var u=null,l=undefined,c=Math.max,a=Math.min,o=".gcFormulaTextBoxInternal",s=".gcFormulaTextBox",f="TextChanged",e="CaretChanged",v="AppendStarted",y="AppendEnded",r={left:37,right:39,up:38,down:40,tab:9,enter:13,pup:33,pdn:34,end:35,home:36,esc:27},p=function(){function l(n){this._init();n&&this._attachHost(n)}return l.prototype.destroy=function(){var n=this;n._isAppending=!1;n._appendingStart=-1;n._detachHost();n._detachSpread();$(n._funcsPopup).remove();$(n._funcHelpPopup).remove()},l.prototype.bind=function(n,t,i){var r=this._host;r&&n&&(n=n.split(/\s+/).join(s+" "),$(r).bind(n+s,t,i))},l.prototype.unbind=function(n,t){var i=this._host;i&&n&&(n=n.split(/\s+/).join(s+" "),$(i).unbind(n+s,t))},l.prototype.unbindAll=function(){var n=this._host;n&&$(n).unbind(s)},l.prototype.caret=function(n){var t=this,i=t._host;if(i){var f=document.activeElement,u=document.activeElement===i,r=$(i);if(arguments.length===0)return u?t._getCaret(i).end:r.data("caret-before");n!==t.caret()&&(u?(t._setCaret(i,n),r.data("caret-before",t._getCaret(i).end)):r.data("caret-before",n),t._trigger(e,{}))}},l.prototype._getCaret=function(n){var r=-1,u=-1,e=this._isInputElement(n),o=this._isEditableElement(n),f,i,t;return e?(r=n.selectionStart,u=n.selectionEnd):o&&(f=window.getSelection(),f.rangeCount>0&&(i=f.getRangeAt(0),t=i.cloneRange(),t.selectNodeContents(n),t.setEnd(i.endContainer,i.endOffset),u=t.toString().length,t=i.cloneRange(),t.selectNodeContents(n),t.setEnd(i.startContainer,i.startOffset),r=t.toString().length,t.detach())),{start:r,end:u}},l.prototype._setCaret=function(n,t){var f=this._isInputElement(n),e=this._isEditableElement(n),i,u,r;f?n.setSelectionRange(t,t):e&&(i=this._getColorNode(n,t),i&&(u=window.getSelection(),r=document.createRange(),r.setStart(i.node.firstChild,i.offset),r.collapse(!0),u.removeAllRanges(),u.addRange(r)))},l.prototype.text=function(n){var t=this,i=t._host,u,e,r;if(i){if(u=t._isInputElement(i),e=t._isEditableElement(i),arguments.length===0)return r="",u?r=i.value:e&&(r=i.textContent),r;(n===null||typeof n=="undefined")&&(n="");n!==t.text()&&(t._tokens=h.parse(n),u?i.value=n:e&&t._colorText(t._tokens),t._trigger(f,{}))}},l.prototype.autoComplete=function(n){if(arguments.length===0)return this._autoComplete;this._autoComplete=n},l.prototype.showHelp=function(n){if(arguments.length===0)return this._showHelp;this._showHelp=n},l.prototype.add=function(n){var i,t;if(n)if($.isArray(n))for(i=n.length,t=0;t<i;t++)this._add(n[t]);else this._add(n)},l.prototype._add=function(n){var r=n&&n.name&&n.name.toUpperCase(),i,f,t,u;if(r){for(i=this._funcs,f=i.length,t=0;t<f;t++)if(u=i[t].name.toUpperCase(),u===r)return;else if(u>r)break;i.splice(t,0,n)}},l.prototype.remove=function(n){var i,r,t;if(n)for(n=n.toUpperCase(),i=this._funcs,r=i.length,t=0;t<r;t++)if(i[t].name.toUpperCase()===n){i.splice(t,1);break}},l.prototype.spread=function(n){if(arguments.length===0)return this._spread;this._attachSpread(n)},l.prototype.getRanges=function(){var f=[],t=this._tokens,e=t&&t.length,r,u,o=0,s=0,n;if(e>0)for(n=0;n<e;n++)r=t[n],u=r.text,r.type===i.Range&&f.push({textOffset:o,text:u,index:s++}),o+=u.length;return f},l.prototype.getActiveRange=function(){var o=this._host,n=this.getRanges(),t,e,i,r,f;if(o&&n&&n.length>0)for(t=this.caret(),e=n.length,f=0;f<e;f++)if(i=n[f],r=i.textOffset,r<t&&t<=r+i.text.length)return i;else if(r>=t)break;return u},l.prototype.isActiveRange=function(n){if(!n)return!1;var t=this.caret(),r=n.text,i=n.textOffset;return i<t&&t<=i+r.length?!0:!1},l.prototype.getRangeColor=function(n){var s=this.getRanges(),h=s.length,i,f,u,t,e,r,o;if(n<0||h<=n)return"";for(i=[],u=0,t=0;t<h;t++){for(f=s[t],e=!1,r=0;r<i.length;r++)if(i[r].text.replace(/\s+/g,"").toUpperCase()===f.text.replace(/\s+/g,"").toUpperCase()){e=!0;break}if(e){if(n===t){u=r;break}}else if(i.push(f),n===t){u=i.length-1;break}}return o=l.DEFAULT_RANGE_COLORS,o[u%o.length]},l.prototype.canAppendRange=function(){var t,n,r;return this._isAppending?!0:(t=this._getToken(this.caret()),t)?(n=t.type,r=t.text,n===i.FormulaStart||n===i.ArgumentSeparator||n===i.Operator&&r!=="%"||n===i.ParenOpen||n===i.ArrayArgumentSeparator||n===i.Whitespace):!1},l.prototype.isAppending=function(){return this._isAppending},l.prototype.isAppendingRange=function(n){if(!n||!this._isAppending)return!1;var i=this._appendingStart,r=this.caret(),t=n.textOffset;return i<=t&&t<r?!0:!1},l.prototype.getAppendingRanges=function(){var i=[],r=this.getRanges(),u=r.length,t,n;if(u>0)for(n=0;n<u;n++)t=r[n],this.isAppendingRange(t)&&i.push(t);return i},l.prototype.appendRange=function(n,t,r){var u=this,w=u._host,y,o,c,p;if(n&&w){if(!u._isAppending){if(!u.canAppendRange())return;t=!1;u._isAppending=!0;u._appendingStart=u.caret();u._trigger(v,{})}var l=u._appendingStart,s=u.text(),e=u.caret(),a=e;r&&(t=!1,s=s.substr(0,l)+s.substr(e),u._tokens=h.parse(s),e=l,a=e);y=u._getToken(e);t?(o=s.substr(0,e),o=o.substr(0,o.length-y.text.length),o.length>=l&&(y.text=n,a=o.length+n.length)):(c=u._tokens,p=c.indexOf(y),e>l?(c.splice(p+1,0,{text:",",type:i.ArgumentSeparator}),c.splice(p+2,0,{text:n,type:i.Range}),n=","+n):c.splice(p+1,0,{text:n,type:i.Range}),a=e+n.length);u._updateHostValue();u._trigger(f,{});u.caret(a)}},l.prototype.stopAppending=function(){var n=this;n._isAppending&&(n._isAppending=!1,n._appendingStart=-1,n._trigger(y,{}))},l.prototype.repalceRange=function(n,t){var r=this,c=r._host,u;if(c&&!(n<0)&&t){var s=!1,h="",e=r._tokens,l=e&&e.length,o,a=0;for(u=0;u<l;u++){if(o=e[u],o.type===i.Range&&a++===n){e[u]={text:t,type:i.Range};s=!0;break}h+=o.text}s&&(r._updateHostValue(),r._trigger(f,{}),r.caret(h.length+t.length))}},l.prototype._attachSpread=function(t){var i,o,r,u;t&&(i=this,i._spread&&i._detachSpread(),o=i._host,t&&o&&(i._spread=t,r=n.spread.Events,o.setAttribute("gcUIElement","gcAttachedFormulaTextBox"),t._attachedFormulaTextBox=i,t.bind(r.EditStarted,i,i._onSpreadEditStarted),t.bind(r.EnterCell,i,i._onSpreadEnterCell),t.bind(r.EditEnded,i,i._onSpreadEditEnded),t.bind(r.ActiveSheetChanged,i,i._onSpreadActiveSheetChanged),t.bind(r.RangeChanged,i,i._onSpreadRangeChanged),t.bind("FormulaTextBoxTextChanged",i,i._onSpreadFormulaTextBoxTextChanged),t.bind("FormulaTextBoxCaretChanged",i,i._onSpreadFormulaTextBoxCaretChanged),u=t.getActiveSheet(),u&&i.text(i._getEditText(u,u._activeRowIndex,u._activeColIndex)),i._bind(f,i,i._onFormulaTextBoxTextChanged),i._bind(e,i,i._onFormulaTextBoxCaretChanged)))},l.prototype._detachSpread=function(){var t=this,i=t._spread,r;i&&(r=n.spread.Events,i._attachedFormulaTextBox=null,i.unbind(r.EditStarted,t._onSpreadEditStarted),i.unbind(r.EnterCell,t._onSpreadEnterCell),i.unbind(r.EditEnded,t,t._onSpreadEditEnded),i.unbind(r.ActiveSheetChanged,t,t._onSpreadActiveSheetChanged),i.unbind(r.RangeChanged,t,t._onSpreadRangeChanged),i.unbind("FormulaTextBoxTextChanged",t._onSpreadFormulaTextBoxTextChanged),i.unbind("FormulaTextBoxCaretChanged",t._onSpreadFormulaTextBoxCaretChanged),t._unbind(f,t._onFormulaTextBoxTextChanged),t._unbind(e,t._onFormulaTextBoxCaretChanged),t.text(""));t._spread=null},l.prototype._startingSpreadEdit=function(){var t=this,i,n;t._isWorking||(t._isWorking=!0,i=this._spread,n=i&&i.getActiveSheet(),n&&!n.isEditing()?(n._startEditImp(null,n._activeRowIndex,n._activeColIndex,null,null,!1,null),t._spreadEditStarting=!0):t._spreadEditStarting=!1,t._isWorking=!1)},l.prototype._startSpreadEdit=function(){var r=this,f=r._spread,t=f&&f.getActiveSheet(),i,s,l,u;if(t){if(r._spreadEditStarting){var h=t._formulaTextBox,e=h.text(),o=r.text();o!==e&&(i=r.caret(),s=t.getFormulaInformation(t.getActiveRowIndex(),t.getActiveColumnIndex()),r.text(e),s.isArrayFormula&&(i>=o.length&&(i=i-1),i=c(0,i-1)),r.caret(i))}l=n.spread.EditorStatus;u=t._editorStatus;u!==2&&(t._editorStatus=2,t._trigger("EditorStatusChanged",{sheet:t,sheetName:t._name,oldStatus:u,newStatus:2}))}},l.prototype._getEditText=function(n,t,i){var r="",u,f;return n&&(u=n.getFormulaInformation(t,i),u&&u.hasFormula?(r="="+u.formula,u.isArrayFormula&&(r="{"+r+"}")):(r=n.getText(t,i),f=n.parent?n.parent.canUserEditFormula():!0,r[0]==="="&&f&&(r="'"+r))),r},l.prototype._onSpreadActiveSheetChanged=function(n,t){var i=n.data,r;i._isWorking||(i._isWorking=!0,i.close(),t&&(r=t.newSheet,i.text(i._getEditText(r,r._activeRowIndex,r._activeColIndex))),i._isWorking=!1)},l.prototype._onSpreadEditStarted=function(n,t){var i=n.data;if(!i._isWorking){var r=i._spread,u=r&&r.getActiveSheet(),f=u&&u._formulaTextBox;f&&(i._isWorking=!0,i.text(f.text()),i._isWorking=!1)}},l.prototype._onSpreadEnterCell=function(n,t){var i=n.data;i._isWorking||(i._isWorking=!0,t&&i.text(i._getEditText(t.sheet,t.row,t.col)),i._isWorking=!1)},l.prototype._onSpreadRangeChanged=function(t,i){var r=t.data;if(!r._isWorking){if(r._isWorking=!0,i){var u=i.sheet,f=i.row,e=i.column,o=i.rowCount,s=i.columnCount;new n.spread.Range(f,e,o,s).contains(u._activeRowIndex,u._activeColIndex)&&r.text(r._getEditText(u,f,e))}r._isWorking=!1}},l.prototype._onSpreadEditEnded=function(n,t){var i=n.data;i._isWorking||(i._isWorking=!0,i.close(),t&&i.text(i._getEditText(t.sheet,t.row,t.col)),i._isWorking=!1)},l.prototype._onSpreadFormulaTextBoxTextChanged=function(n,t){var i=n.data,r;i._isWorking||(i._isWorking=!0,t&&(r=i.caret(),i.text(t.text),i.caret(r)),i._isWorking=!1)},l.prototype._onSpreadFormulaTextBoxCaretChanged=function(n,t){var i=n.data;i._isWorking||(i._isWorking=!0,t&&i.caret(t.caret),i._isWorking=!1)},l.prototype._onFormulaTextBoxTextChanged=function(n){var t=n.data,r,u,i,f;t._isWorking||(r=t._spread,u=r&&r.getActiveSheet(),u)&&(t._isWorking=!0,i=u._formulaTextBox,i&&(f=i.caret(),i.text(t.text()),i.caret(f)),t._isWorking=!1)},l.prototype._onFormulaTextBoxCaretChanged=function(n){var t=n.data,r,i,u;t._isWorking||(r=t._spread,i=r&&r.getActiveSheet(),i&&i.isEditing())&&(t._isWorking=!0,u=i._formulaTextBox,u&&(u.caret(t.caret()),t._openFuncHelp()),t._isWorking=!1)},l.prototype._init=function(){var n=this,t,i;n._isImeInputting=!1;n._isInputKey=!1;n._isAppending=!1;n._appendingStart=-1;n._funcs=[];n._autoComplete=!0;n._showHelp=!0;n._autoClose=!0;t=document.createElement("div");t.className="gcsj-func-ac-popup";t.style.display="none";t.setAttribute("gcUIElement","gcFuncACPopup");document.body.insertBefore(t,u);n._funcsPopup=t;n._isFuncsShown=!1;i=document.createElement("div");i.className="gcsj-func-help-popup";i.style.display="none";i.setAttribute("gcUIElement","gcFuncHelpPopup");document.body.insertBefore(i,u);n._funcHelpPopup=i;n._isFuncHelpShown=!1;$(t).mouseenter(function(){n._autoClose=!1}).mouseleave(function(){n._autoClose=!0});$(i).mouseenter(function(){n._autoClose=!1}).mouseleave(function(){n._autoClose=!0})},l.prototype._attachHost=function(n){var t,i,u,f;n&&(t=this,t._isInputElement(n)||t._isEditableElement(n))&&(i=$(n),t._host&&t._detachHost(),t._host=n,t._tokens=h.parse(t.text()),u=t._isEditableElement(n),u&&t._colorText(t._tokens),$.browser&&$.browser.msie?(f=parseInt($.browser.version,10)<10,u||f?(t._bind("focus",function(){i.data("text-before",t.text())}),t._bind("input keydown keyup cut paste",function(){t._checkInput()})):t._bind("input",function(){t._onInput()})):t._bind("input",function(){t._onInput()}),t._bind("keydown",function(n){var u=n.ctrlKey,f=n.shiftKey,e=n.altKey,o=n.metaKey,s=u||f||e||o,i=n.keyCode;t._isInputKey=!1;!s&&t._isFuncsShown&&(i===r.down?(t._selectFunc(1),n.preventDefault(),n.stopPropagation()):i===r.up?(t._selectFunc(-1),n.preventDefault(),n.stopPropagation()):i===r.tab&&(t._completeFunc(),n.preventDefault(),n.stopPropagation()));i===r.esc&&t.close();t._checkCaret(n)}),t._bind("keyup",function(n){if(t._isInputKey&&$.browser&&$.browser.qtMode){var r=t.caret();i.data("caret-before")!==r&&(i.data("caret-before",r),t._trigger(e,{}),t._openFuncs(),t._isFuncsShown||t._openFuncHelp())}t._checkCaret(n)}),t._bind("focus",function(n){t._checkCaret(n)}),t._bind("blur",function(n){t._autoClose&&t.close()}),t._bind("mousedown",function(n){t._startingSpreadEdit()}),t._bind("mouseup",function(n){t._startSpreadEdit()}),t._bind("click",function(n){t._isAppending&&t.stopAppending();var r=t._spread,u=r&&r.getActiveSheet(),i=u&&u._formulaTextBox;i&&i.isAppending()&&i.stopAppending();t._checkCaret(n)}),t._bind("compositionstart",function(n){t._isImeInputting=!0}),t._bind("compositionend",function(n){t._isImeInputting=!1}))},l.prototype._detachHost=function(){var n=this,i=n._host,t;i&&(t=$(i),t.removeData("text-before"),t.removeData("caret-before"),n._unbindAll(),n.unbindAll(),n._host=u)},l.prototype._checkInput=function(){var n=this,t=$(n._host),i=n.text();t.data("text-before")!==i&&(t.data("text-before",i),n._onInput())},l.prototype._checkCaret=function(n){var i=this,t=n.keyCode,u=t===r.left||t===r.right||t===r.home||t===r.end||t===r.pdn||t===r.pup||t===r.tab||t===r.enter,s,o;if(i._autoComplete||(u=u||t===r.up||t===r.down),s=typeof n.button!="undefined",u||s){var h=i._host,c=$(h),f=i._getCaret(h);if(f.start!==f.end)return;o=f.end;c.data("caret-before")!==o&&(c.data("caret-before",o),i._trigger(e,{}),i._openFuncHelp())}},l.prototype._onInput=function(){var n=this,i=n._host,r=$(i),t;n._isInputKey=!0;n._tokens=h.parse(n.text());n._isEditableElement(i)?n._isImeInputting||(t=n.caret(),n._colorText(n._tokens),n._trigger(f,{type:"input"}),n.caret(t)):n._trigger(f,{type:"input"});t=n.caret();r.data("caret-before")!==t&&(r.data("caret-before",t),n._trigger(e,{}));n._openFuncs();n._isFuncsShown||n._openFuncHelp()},l.prototype._updateHostValue=function(){var n=this,r=n._host,t=n._tokens,u,f,i;if(n._isInputElement(r)){for(u="",f=t&&t.length,i=0;i<f;i++)u+=t[i].text;r.value=u}else n._isEditableElement(r)&&n._colorText(t)},l.prototype._isInputElement=function(n){var t=n&&n.tagName;return t==="TEXTAREA"||t==="INPUT"},l.prototype._isEditableElement=function(n){return n&&n.tagName==="DIV"&&n.contentEditable==="true"},l.prototype._isFormula=function(n){return n&&n[0]==="="?!0:!1},l.prototype._bind=function(n,t,i){var r=this._host;r&&n&&(n=n.split(/\s+/).join(o+" "),$(r).bind(n+o,t,i))},l.prototype._unbind=function(n,t){var i=this._host;i&&n&&(n=n.split(/\s+/).join(o+" "),$(i).unbind(n+o,t))},l.prototype._unbindAll=function(){var n=this._host;n&&$(n).unbind(o)},l.prototype._trigger=function(n,t){var i=this._host;i&&$(i).trigger(n,t)},l.prototype._getToken=function(n){var t,r,f,e,i;if(n<=0)return u;if(t=this._tokens,r=t&&t.length,r>0)for(f=0,i=0;i<r;i++)if(e=t[i],f+=e.text.length,f>=n)return e;return u},l.prototype._getFuncs=function(){var n=this._spread,t=n&&n.getActiveSheet(),i=t&&t._formulaTextBox;return i?i._funcs:this._funcs},l.prototype._getFuncsStartWith=function(n){var t;n=n.toUpperCase();var u=[],i=this._getFuncs(),e=i&&i.length,f=!1,r;for(t=0;t<e;t++)if(r=i[t],r.name.toUpperCase().indexOf(n)===0)u.push(r),f=!0;else if(f)break;return u},l.prototype._getActiveFuncInfo=function(){for(var e,c=this.caret(),f=this._tokens,l=f&&f.length,r=[],h=0,n,t=0;t<l;t++){if(n=f[t],r.push(n),n.type===i.ParenClose)while(r.length>0)if(r.pop().type===i.FunctionName)break;if(h+=n.text.length,h>=c)break}if(r.length>0){for(e=0;r.length>0;)if(n=r.pop(),n.type===i.ArgumentSeparator)e++;else if(n.type===i.FunctionName)break;if(n.type===i.FunctionName){var a=n.text.toUpperCase(),o=this._getFuncs(),v=o&&o.length,s;for(t=0;t<v;t++)if(s=o[t],s.name.toUpperCase()===a)return{func:s,activeParamterIndex:e}}}return u},l.prototype._openFuncs=function(){var n=this,h=n._getToken(n.caret()),e=h&&h.text,i,c,o,l,r,u,s,t,f;if(e&&/[a-z_$]/i.test(e[0])&&(i=n._getFuncsStartWith(e)),c=n._autoComplete&&n._isFormula(n.text())&&i&&i.length>0&&!n._isAppending&&!n._isImeInputting,c){for(n._closeFuncHelp(),o="",l=i.length,u=0;u<l;u++)r=i[u],o+="<div class='gcsj-func-ac-row'><div class='gcsj-func-ac-row-name'>"+r.name.toUpperCase()+"<\/div><div class='gcsj-func-ac-row-description'>"+(r.shortDescription||r.description)+"<\/div><\/div>";s=$(n._funcsPopup);s.html(o).show();n._isFuncsShown=!0;t=s.find(".gcsj-func-ac-row");t.length>0&&(f="gcsj-ac-row-active",$(t[0]).addClass(f),t.hover(function(){t.removeClass(f);$(this).addClass(f)}),t.click(function(){n._completeFunc()}));n.position()}else n._closeFuncs()},l.prototype._closeFuncs=function(){$(this._funcsPopup).hide();this._isFuncsShown=!1},l.prototype._selectFunc=function(n){var r=$(this._funcsPopup).find(".gcsj-func-ac-row"),f=r.length,u,t,i;if(f!==0){if(u="gcsj-ac-row-active",t=0,n)for(i=0;i<f;i++)if($(r[i]).hasClass(u)){t=i+n;break}r.removeClass(u);t=c(t,0);t=a(t,f-1);$(r[t]).addClass(u)}},l.prototype._completeFunc=function(){var n=this,o=$(n._funcsPopup).find(".gcsj-ac-row-active .gcsj-func-ac-row-name").text(),c,l;if(o){for(var a=n.caret(),t=n._tokens,v=t&&t.length,s=0,h=0,r=0,e=u;r<v;){if(e=t[r],h=e.text.length,s+h>=a)break;r++;s+=h}e.text=o;e.type=i.FunctionName;c=r+1;l=t[c];l&&l.type===i.ParenOpen||t.splice(c,0,{text:"(",type:i.ParenOpen});n._closeFuncs();n._host.focus();n._updateHostValue();n._trigger(f,{});n.caret(s+o.length+1);n._openFuncHelp()}},l.prototype._openFuncHelp=function(){var n=this,u,c,r,i,h;if(n._isFuncsShown&&n._closeFuncs(),u=n._getActiveFuncInfo(),c=n._showHelp&&n._isFormula(n.text())&&u&&!n._isAppending&&!n._isImeInputting,c){var e=u.func,o=e.parameters,s=o&&o.length,v=a(s-1,u.activeParamterIndex),f,l="";for(r=0;r<s;r++)f=o[r],i=f.name,f.repeatable&&(i+=",..."),f.optional&&(i="["+i+"]"),h=r===s-1?"":", ",i=r===v?"<span class='gcsj-func-help-paramter gcsj-func-help-paramter-active'>"+i+"<\/span>"+h:"<span class='gcsj-func-help-paramter'>"+i+"<\/span>"+h,l+=i;var y="<div class='gcsj-func-help-title'><div class='gcsj-func-help-formula'><span class='gcsj-func-help-formula-name'>"+e.name.toUpperCase()+"<\/span><span class='gcsj-func-help-paramter-paren'>(<\/span>"+l+"<span class='gcsj-func-help-paramter-paren'>)<\/span><\/div><\/div>",p="<div class='gcsj-func-help-section'><div class='gcsj-func-help-section-title'>"+t.SR.Fbx_Summary+"<\/div><div class='gcsj-func-help-section-content'>"+e.description+"<\/div><\/div>",w="<div class='gcsj-func-help-section-content'>"+p+"<\/div>",b="<div class='gcsj-func-help-body'>"+w+"<\/div>",k=y+b;$(n._funcHelpPopup).html(k).show();n._isFuncHelpShown=!0;n.position()}else n._closeFuncHelp()},l.prototype._closeFuncHelp=function(){$(this._funcHelpPopup).hide();this._isFuncHelpShown=!1},l.prototype.close=function(){this._closeFuncs();this._closeFuncHelp()},l.prototype.isReservedKey=function(n){if(this._isAppending)return!1;var i=n.ctrlKey||n.shiftKey||n.altKey||n.metaKey,t=n.keyCode;return this._isFuncsShown&&!i&&(t===r.down||t===r.up||t===r.tab)?!0:!1},l.prototype.position=function(){var n=this,t=u,r;if(n._isFuncsShown?t=n._funcsPopup:n._isFuncHelpShown&&(t=n._funcHelpPopup),t){var f=$(n._host),e=$(t),i=f.offset(),o=i.top+f.outerHeight(),s={top:o,left:i.left},c=$(window).outerHeight(),h=e.outerHeight(),l=o+h;l>c&&(r=i.top-h,r>=0&&(s.top=r));e.css(s)}},l.prototype._colorText=function(n){for(var o,t,u=this,f="",s="",h=n&&n.length,c=0,r,e=0;e<h;e++)r=n[e],o="",r.type===i.Range&&(o=" style='color: "+u.getRangeColor(c++)+"'"),f+="<span"+o+" class='gcsj-func-color-text'>"+r.text+"<\/span>",s+=r.text;if(s||u.text())if(t=u._host,f)t.innerHTML="<span class='gcsj-func-color-content'>"+f+"<\/span>";else while(t.firstChild)t.removeChild(t.firstChild)},l.prototype._getColorNode=function(n,t){var e=$(n).find(".gcsj-func-color-content .gcsj-func-color-text"),o=e.length,i,r,f;if(o>0){for(t=c(0,t),f=0;f<o;f++)if(i=e[f],r=i.textContent,t-=r.length,t<=0)return{node:i,offset:r.length+t};return{node:i,offset:r.length}}return u},l.DEFAULT_RANGE_COLORS=["#0000ff","#008000","#9900cc","#800000","#00cc33","#cc6600","#cc0099"],l}();t.FormulaTextBox=p;i={FormulaStart:1,FunctionName:2,BraceOpen:3,BraceClose:4,ParenOpen:5,ParenClose:6,Operator:7,ArgumentSeparator:8,ArrayArgumentSeparator:9,ArrayGroupSeparator:10,Range:11,Boolean:12,Number:13,String:14,Whitespace:15,Error:16,Literal:17};h={rNumber:/^(\+|-)?((\d\d*\,?\d*)|(\d*\,?\d\d*))$/,rBoolean:/^(TRUE|FALSE)$/i,rRangeA1:/^(.*!)?((\$?[a-z]+\$?\d+(\s*:\s*\$?[a-z]+\$?\d+)?)|(\$?[a-z]+\s*:\s*\$?[a-z]+)|(\$?\d+\s*:\s*\$?\d+)|(\$?[a-z]+\$?\d+\s*:\s*\$?\d+)|(\$?\d+\s*:\s*\$?[a-z]+\$?\d+)|(\$?[a-z]+\$?\d+\s*:\s*\$?[a-z]+)|(\$?[a-z]+\s*:\s*\$?[a-z]+\$?\d+))$/i,rRangeR1C1:/^(.*!)?((R\[?[-+]?\d*\]?C\[?[-+]?\d*\]?\s*(:\s*R\[?[-+]?\d*\]?C\[?[-+]?\d*\]?)?)|(R\[?[-+]?\d*\]?\s*(:\s*R\[?[-+]?\d*\]?)?)|(C\[?[-+]?\d*\]?\s*(:\s*C\[?[-+]?\d*\]?)?)|(R\[?[-+]?\d*\]?C\[?[-+]?\d*\]?\s*(:\s*C\[?[-+]?\d*\]?)?)|(C\[?[-+]?\d*\]?\s*(:\s*R\[?[-+]?\d*\]?C\[?[-+]?\d*\]?))?|(R\[?[-+]?\d*\]?C\[?\[-+]?d*\]?\s*(:\s*R\[?[-+]?\d*\]?))?|(R\[?[-+]?\d*\]?\s*(:\s*R\[?[-+]?\d*\]?C\[?[-+]?\d*\]?))?)$/i,calcErrors:"#DIV/0! #N/A #NAME? #NULL! #NUM! #REF! #VALUE!".split(" "),parse:function(n){var u=[],f=this,e,h,a,y,s;if(n&&n[0]!=="=")return f.addToken(u,n,i.Literal),u;var o=n&&n.length,v=0,r,t="";for(e=0;e<o;e++){r=n[e];switch(r){case"'":t=f.addToken(u,t);h=!0;do t+=r,r=n[++e],r==="'"&&n[e+1]==="'"?(t+=r,r=n[++e]):h=r!=="'";while(h&&e<o-1);r!==l&&(t+=r);break;case'"':t=f.addToken(u,t);h=!0;do t+=r,r=n[++e],r==='"'&&n[e+1]==='"'?(t+=r,r=n[++e]):h=r!=='"';while(h&&e<o-1);r!==l&&(t+=r);t=f.addToken(u,t,i.String);break;case"\\":f.addToken(u,t);t=f.addToken(u,r,i.ArrayArgumentSeparator);break;case",":f.addToken(u,t);t=f.addToken(u,r,v>0?i.ArrayArgumentSeparator:i.ArgumentSeparator);break;case";":f.addToken(u,t);t=f.addToken(u,r,i.ArrayGroupSeparator);break;case"{":f.addToken(u,t);t=f.addToken(u,r,i.BraceOpen);v++;break;case"}":f.addToken(u,t);t=f.addToken(u,r,i.BraceClose);v--;break;case"(":f.addToken(u,t,i.FunctionName);t=f.addToken(u,r,i.ParenOpen);break;case")":f.addToken(u,t);t=f.addToken(u,r,i.ParenClose);break;case"=":f.addToken(u,t);t=e===0?f.addToken(u,r,i.FormulaStart):f.addToken(u,r,i.Operator);break;case"/":var p=t.toUpperCase(),s=e+1<o?n[e+1]:"",w=e+2<o?n[e+2]:"";p==="#DIV"&&s==="0"&&w==="!"||p==="#N"&&s.toUpperCase()==="A"?(t+=r+s,e++,"#DIV"===t&&(t+=w,e++),t=f.addToken(u,t)):(f.addToken(u,t),t=f.addToken(u,r,i.Operator));break;case"+":case"-":a=t.replace(/\s/g,"").toUpperCase();y=c(0,a.length-2);a.lastIndexOf("R[")>=y||a.lastIndexOf("C[")>=y?t+=r:(f.addToken(u,t),t=f.addToken(u,r,i.Operator));break;case"&":case"^":case"*":case"%":f.addToken(u,t);t=f.addToken(u,r,i.Operator);break;case"<":case">":t=f.addToken(u,t);t+=r;s=e+1<o?n[e+1]:"";(s==="="||r==="<"&&s===">")&&(t+=s,e++);t=f.addToken(u,t,i.Operator);break;case" ":case"\u00a0":case"\r":case"\n":case"\t":for(t=f.addToken(u,t),t+=r;e<o-1&&/^[\s]*$/.test(n[e+1]);)t+=n[++e];t=f.addToken(u,t,i.Whitespace);break;default:t+=r;break}}return f.addToken(u,t),u},addToken:function(n,t,r){var f=this,s,a,h,c,l,o,u,e;if(t){if(typeof r=="undefined"&&(r=f.calcErrors.indexOf(t.toUpperCase())>-1?i.Error:f.rNumber.test(t)?i.Number:f.rBoolean.test(t)?i.Boolean:f.rRangeA1.test(t)||f.rRangeR1C1.test(t)?i.Range:i.Literal),s=function(n){return n===i.Range||n===i.Literal||n===i.Number},s(r)){for(a=n.length,u="",o=a-1;o>=0;o--)if(h=n[o],c=h.type,l=h.text,u=l+u,c!==i.Whitespace&&l!==":")break;s(c)?(u+=t,e=u[u.length-1]===":"?u.substr(0,u.length-1):u,e=e.trim(),(f.rRangeA1.test(e)||f.rRangeR1C1.test(e))&&(n.splice(o),t=u,r=i.Range)):t[t.length-1]===":"&&(e=t.substr(0,t.length-1),(f.rRangeA1.test(e)||f.rRangeR1C1.test(e))&&(r=i.Range))}n.push({text:t,type:r})}return""}}})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={})),function(n){(function(n){var t,i;n.feature("formulatextbox_resource");t=function(){function n(){}return n.Functions=[{name:"ABS",description:"This function calculates the absolute value of the specified value.",parameters:[{name:"value"}]},{name:"ACCRINT",description:"This function calculates the accrued interest for a security that pays periodic interest.",parameters:[{name:"issue"},{name:"first"},{name:"settle"},{name:"rate"},{name:"par"},{name:"frequency"},{name:"basis"}]},{name:"ACCRINTM",description:"This function calculates the accrued interest at maturity for a security that pays periodic interest.",parameters:[{name:"issue"},{name:"maturity"},{name:"rate"},{name:"par"},{name:"basis"}]},{name:"ACOS",description:"This function calculates the arccosine, that is, the angle whose cosine is the specified value.",parameters:[{name:"value"}]},{name:"ACOSH",description:"This function calculates the inverse hyperbolic cosine of the specified value.",parameters:[{name:"value"}]},{name:"ADDRESS",description:"This function uses the row and column numbers to create a cell address in text.",parameters:[{name:"row"},{name:"column"},{name:"absnum"},{name:"a1style"},{name:"sheettext"}]},{name:"AMORDEGRC",description:"This function returns the depreciation for an accounting period, taking into consideration prorated depreciation, and applies a depreciation coefficient in the calculation based on the life of the assets.",parameters:[{name:"cost"},{name:"datepurchased"},{name:"firstperiod"},{name:"salvage"},{name:"period"},{name:"drate"},{name:"basis"}]},{name:"AMORLINC",description:"This function calculates the depreciation for an accounting period, taking into account prorated depreciation.",parameters:[{name:"cost"},{name:"datepurchased"},{name:"firstperiod"},{name:"salvage"},{name:"period"},{name:"drate"},{name:"basis"}]},{name:"AND",description:"Check whether all argumengts are True,and returns True if all argements are True.",parameters:[{name:"logical1"},{name:"logical2"}]},{name:"ASIN",description:"This function calculates the arcsine, that is, the angle whose sine is the specified value.",parameters:[{name:"value"}]},{name:"ASINH",description:"This function calculates the inverse hyperbolic sine of a number.",parameters:[{name:"value"}]},{name:"ATAN",description:"This function calculates the arctangent, that is, the angle whose tangent is the specified value.",parameters:[{name:"value"}]},{name:"ATAN2",description:"This function calculates the arctangent of the specified x- and y-coordinates.",parameters:[{name:"x"},{name:"y"}]},{name:"ATANH",description:"This function calculates the inverse hyperbolic tangent of a number.",parameters:[{name:"value"}]},{name:"AVEDEV",description:"This function calculates the average of the absolute deviations of the specified values from their mean.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"AVERAGE",description:"This function calculates the average of the specified numeric values.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"AVERAGEA",description:"This function calculates the average of the specified values, including text or logical values as well as numeric values.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"AVERAGEIF",description:"This function calculates the average of the specified numeric values provided that they meet the specified criteria.",parameters:[{name:"value1"},{name:"value2",repeatable:!0},{name:"condition"}]},{name:"AVERAGEIFS",description:"This function calculates the average of all cells that meet multiple specified criteria.",parameters:[{name:"value1"},{name:"condition1"},{name:"value2",repeatable:!0},{name:"condition2..."}]},{name:"BESSELI",description:"This function calculates the modified Bessel function of the first kind evaluated for purely imaginary arguments.",parameters:[{name:"value"},{name:"order"}]},{name:"BESSELJ",description:"This function calculates the Bessel function of the first kind.",parameters:[{name:"value"},{name:"order"}]},{name:"BESSELK",description:"This function calculates the modified Bessel function of the second kind evaluated for purely imaginary arguments.",parameters:[{name:"value"},{name:"order"}]},{name:"BESSELY",description:"This function calculates the Bessel function of the second kind.",parameters:[{name:"value"},{name:"order"}]},{name:"BETADIST",description:"This function calculates the cumulative beta distribution function.",parameters:[{name:"x"},{name:"alpha"},{name:"beta"},{name:"lower"},{name:"upper"}]},{name:"BETAINV",description:"This function calculates the inverse of the cumulative beta distribution function.",parameters:[{name:"prob"},{name:"alpha"},{name:"beta"},{name:"lower"},{name:"upper"}]},{name:"BIN2DEC",description:"This function converts a binary number to a decimal number",parameters:[{name:"number"}]},{name:"BIN2HEX",description:"This function converts a binary number to a hexadecimal number.",parameters:[{name:"number"},{name:"places"}]},{name:"BIN2OCT",description:"This function converts a binary number to an octal number.",parameters:[{name:"number"},{name:"places"}]},{name:"BINOMDIST",description:"This function calculates the individual term binomial distribution probability.",parameters:[{name:"x"},{name:"n"},{name:"p"},{name:"cumulative"}]},{name:"CEILING",description:"This function rounds a number up to the nearest multiple of a specified value.",parameters:[{name:"value"},{name:"signif"}]},{name:"CHAR",description:"This function returns the character specified by a number.",parameters:[{name:"value"}]},{name:"CHIDIST",description:"This function calculates the one-tailed probability of the chi-squared distribution.",parameters:[{name:"value"},{name:"deg"}]},{name:"CHIINV",description:"This function calculates the inverse of the one-tailed probability of the chi-squared distribution",parameters:[{name:"prob"},{name:"deg"}]},{name:"CHITEST",description:"This function calculates the test for independence from the chi-squared distribution.",parameters:[{name:"obs_array"},{name:"exp_array"}]},{name:"CHOOSE",description:"This function returns a value from a list of values.",parameters:[{name:"index"},{name:"value1"},{name:"value2",repeatable:!0}]},{name:"CLEAN",description:"This function removes all non-printable characters from text.",parameters:[{name:"text"}]},{name:"CODE",description:"This function returns a numeric code to represent the first character in a text string. The returned code corresponds to the Windows character set (ANSI).",parameters:[{name:"text"}]},{name:"COLUMN",description:"This function returns the column number of a reference.",parameters:[{name:"reference"}]},{name:"COLUMNS",description:"This function returns the number of columns in an array.",parameters:[{name:"array"}]},{name:"COMBIN",description:"This function calculates the number of possible combinations for a specified number of items.",parameters:[{name:"k"},{name:"n"}]},{name:"COMPLEX",description:"This function converts real and imaginary coefficients into a complex number.",parameters:[{name:"realcoeff"},{name:"imagcoeff"},{name:"suffix"}]},{name:"CONCATENATE",description:"This function combines multiple text strings or numbers into one text string.",parameters:[{name:"text1"},{name:"text2"},{name:"...."}]},{name:"CONFIDENCE",description:"This function returns confidence interval for a population mean.",parameters:[{name:"alpha"},{name:"stdev"},{name:"size"}]},{name:"CONVERT",description:"This function converts a number from one measurement system to its equivalent in another measurement system.",parameters:[{name:"number"},{name:"from-unit"},{name:"to-unit"}]},{name:"CORREL",description:"This function returns the correlation coefficient of the two sets of data.",parameters:[{name:"array1"},{name:"array2"}]},{name:"COS",description:"This function returns the cosine of the specified angle.",parameters:[{name:"angle"}]},{name:"COSH",description:"This function returns the hyperbolic cosine of the specified value.",parameters:[{name:"value"}]},{name:"COUNT",description:"This function returns the number of cells that contain numbers.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"COUNTA",description:"This function returns the number of number of cells that contain numbers, text, or logical values.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"COUNTBLANK",description:"This function returns the number of empty (or blank) cells in a range of cells on a sheet.",parameters:[{name:"cellrange"}]},{name:"COUNTIF",description:"This function returns the number of cells that meet a certain condition",parameters:[{name:"cellrange"},{name:"condition"}]},{name:"COUNTIFS",description:"This function returns the number of cells that meet multiple conditions.",parameters:[{name:"cellrange"},{name:"condition"}]},{name:"COUPDAYBS",description:"This function calculates the number of days from the beginning of the coupon period to the settlement date.",parameters:[{name:"settlement"},{name:"maturity"},{name:"frequency"},{name:"basis"}]},{name:"COUPDAYS",description:"This function returns the number of days in the coupon period that contains the settlement date.",parameters:[{name:"settlement"},{name:"maturity"},{name:"frequency"},{name:"basis"}]},{name:"COUPDAYSNC",description:"This function calculates the number of days from the settlement date to the next coupon date.",parameters:[{name:"settlement"},{name:"maturity"},{name:"frequency"},{name:"basis"}]},{name:"COUPNCD",description:"This function returns a date number of the next coupon date after the settlement date.",parameters:[{name:"settlement"},{name:"maturity"},{name:"frequency"},{name:"basi"}]},{name:"COUPNUM",description:"This function returns the number of coupons due between the settlement date and maturity date.",parameters:[{name:"settlement"},{name:"maturity"},{name:"frequency"},{name:"basis"}]},{name:"COUPPCD",description:"This function returns a date number of the previous coupon date before the settlement date.",parameters:[{name:"settlement"},{name:"maturity"},{name:"frequency"},{name:"basis"}]},{name:"COVAR",description:"This function returns the covariance, which is the average of the products of deviations for each data point pair in two sets of numbers.",parameters:[{name:"array1"},{name:"array2"}]},{name:"CRITBINOM",description:"This function returns the criterion binomial, the smallest value for which the cumulative binomial distribution is greater than or equal to a criterion value.",parameters:[{name:"n"},{name:"p"},{name:"alpha"}]},{name:"CUMIPMT",description:"This function returns the cumulative interest paid on a loan between the starting and ending periods.",parameters:[{name:"rate"},{name:"nper"},{name:"pval"},{name:"startperiod"},{name:"endperiod"},{name:"paytype"}]},{name:"CUMPRINC",description:"This function returns the cumulative principal paid on a loan between the start and end periods.",parameters:[{name:"rate"},{name:"nper"},{name:"pval"},{name:"startperiod"},{name:"endperiod"},{name:"paytype"}]},{name:"DATE",description:"This function returns the DateTime object for a particular date, specified by the year, month, and day.",parameters:[{name:"year"},{name:"month"},{name:"day"}]},{name:"DATEDIF",description:"This function returns the number of days, months, or years between two dates.",parameters:[{name:"date1"},{name:"date2"},{name:"outputcode"}]},{name:"DATEVALUE",description:"This function returns a DateTime object of the specified date.",parameters:[{name:"date_string"}]},{name:"DAVERAGE",description:"This function calculates the average of values in a column of a list or database that match the specified conditions.",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DAY",description:"This function returns the day number of the month (integer 1 to 31) that corresponds to the specified date.",parameters:[{name:"date"}]},{name:"DAYS360",description:"This function returns the number of days between two dates based on a 360-day year.",parameters:[{name:"startdate"},{name:"enddate"},{name:"method"}]},{name:"DB",description:"This function calculates the depreciation of an asset for a specified period using the fixed\u2011declining balance method",parameters:[{name:"cost"},{name:"salvage"},{name:"life"},{name:"period"},{name:"month"}]},{name:"DCOUNT",description:"This function counts the cells that contain numbers in a column of a list or database that match the specified conditions",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DCOUNTA",description:"This function counts the non-blank cells in a column of a list or database that match the specified conditions",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DDB",description:"This function calculates the depreciation of an asset for a specified period using the double-declining balance method or another method you specify.",parameters:[{name:"cost"},{name:"salvage"},{name:"life"},{name:"period"},{name:"factor"}]},{name:"DEC2BIN",description:"This function converts a decimal number to a binary number.",parameters:[{name:"number"},{name:"places"}]},{name:"DEC2HEX",description:"This function converts a decimal number to a hexadecimal number",parameters:[{name:"number"},{name:"places"}]},{name:"DEC2OCT",description:"This function converts a decimal number to an octal number",parameters:[{name:"number"},{name:"places"}]},{name:"DEGREES",description:"This function converts the specified value from radians to degrees",parameters:[{name:"angle"}]},{name:"DELTA",description:"This function identifies whether two values are equal. Returns 1 if they are equal; returns 0 otherwise.",parameters:[{name:"value1"},{name:"value2"}]},{name:"DEVSQ",description:"This function calculates the sum of the squares of deviations of data points (or of an array of data points) from their sample mean.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"DGET",description:"This function extracts a single value from a column of a list or database that matches the specified conditions.",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DISC",description:"This function calculates the discount rate for a security.",parameters:[{name:"settle"},{name:"mature"},{name:"pricep"},{name:"redeem"},{name:"basis"}]},{name:"DMAX",description:"This function returns the largest number in a column of a list or database that matches the specified conditions.",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DMIN",description:"This function returns the smallest number in a column of a list or database that matches the specified conditions.",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DOLLAR",description:"This function converts a number to text using currency format, with the decimals rounded to the specified place.",parameters:[{name:"value"},{name:"digits"}]},{name:"DOLLARDE",description:"This function converts a fraction dollar price to a decimal dollar price.",parameters:[{name:"fractionaldollar"},{name:"fraction"}]},{name:"DOLLARFR",description:"This function converts a decimal number dollar price to a fraction dollar price.",parameters:[{name:"decimaldollar"},{name:"fraction"}]},{name:"DPRODUCT",description:"This function multiplies the values in a column of a list or database that match the specified conditions.",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DSTDEV",description:"This function estimates the standard deviation of a population based on a sample by using the numbers in a column of a list or database that match the specified conditions.",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DSTDEVP",description:"This function calculates the standard deviation of a population based on the entire population using the numbers in a column of a list or database that match the specified conditions.",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DSUM",description:"This function adds the numbers in a column of a list or database that match the specified conditions.",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DURATION",description:"This function returns the Macauley duration for an assumed par value of $100.",parameters:[{name:"settlement"},{name:"maturity"},{name:"coupon"},{name:"yield"},{name:"frequency"},{name:"basis"}]},{name:"DVAR",description:"This function estimates the variance of a population based on a sample by using the numbers in a column of a list or database that match the specified conditions.",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DVARP",description:"This function calculates the variance of a population based on the entire population by using the numbers in a column of a list or database that match the specified conditions.",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"EDATE",description:"This function calculates the date that is the indicated number of months before or after a specified date.",parameters:[{name:"startdate"},{name:"months"}]},{name:"EFFECT",description:"This function calculates the effective annual interest rate for a given nominal annual interest rate and the number of compounding periods per year.",parameters:[{name:"nomrate"},{name:"comper"}]},{name:"EOMONTH",description:"This function calculates the date for the last day of the month (end of month) that is the indicated number of months before or after the starting date.",parameters:[{name:"startdate"},{name:"months"}]},{name:"ERF",description:"This function calculates the error function integrated between a lower and an upper limit.",parameters:[{name:"limit"},{name:"upperlimit"}]},{name:"ERFC",description:"This function calculates the complementary error function integrated between a lower limit and infinity.",parameters:[{name:"lowerlimit"}]},{name:"ERROR.TYPE",description:"This function returns a number corresponding to one of the error values.",parameters:[{name:"errorvalue"}]},{name:"EURO",description:"This function returns the equivalent of one Euro based on the ISO currency code.",parameters:[{name:"code"}]},{name:"EUROCONVERT",description:"This function converts currency from a Euro member currency (including Euros) to another Euro member currency (including Euros).",parameters:[{name:"currency"},{name:"source"},{name:"target"},{name:"fullprecision"},{name:"triangulation"}]},{name:"EVEN",description:"This function rounds the specified value up to the nearest even integer.",parameters:[{name:"value"}]},{name:"EXACT",description:"This function returns true if two strings are the same; otherwise, false.",parameters:[{name:"text1"},{name:"text2"}]},{name:"EXP",description:"This function returns e raised to the power of the specified value.",parameters:[{name:"value"}]},{name:"EXPONDIST",description:"This function returns the exponential distribution or the probability density",parameters:[{name:"value"},{name:"lambda"},{name:"cumulative"}]},{name:"FACT",description:"This function calculates the factorial of the specified number.",parameters:[{name:"number"}]},{name:"FACTDOUBLE",description:"This function calculates the double factorial of the specified number.",parameters:[{name:"number"}]},{name:"FALSE",description:"This function returns the value for logical FALSE.",parameters:[]},{name:"FDIST",description:"This function calculates the F probability distribution, to see degrees of diversity between two sets of data.",parameters:[{name:"value"},{name:"degnum"},{name:"degden"}]},{name:"FIND",description:"This function finds one text value within another and returns the text value\u2019s position in the text you searched.",parameters:[{name:"findtext"},{name:"intext"},{name:"start"}]},{name:"FINV",description:"This function returns the inverse of the F probability distribution.",parameters:[{name:"p"},{name:"degnum"},{name:"degden"}]},{name:"FISHER",description:"This function returns the Fisher transformation for a specified value",parameters:[{name:"value"}]},{name:"FISHERINV",description:"This function returns the inverse of the Fisher transformation for a specified value.",parameters:[{name:"value"}]},{name:"FIXED",description:"This function rounds a number to the specified number of decimal places, formats the number in decimal format using a period and commas (if so specified), and returns the result as text.",parameters:[{name:"num"},{name:"digits"},{name:"notcomma"}]},{name:"FLOOR",description:"This function rounds a number down to the nearest multiple of a specified value.",parameters:[{name:"value"},{name:"signif"}]},{name:"FORECAST",description:"This function calculates a future value using existing values.",parameters:[{name:"value"},{name:"Yarray"},{name:"Xarray"}]},{name:"FREQUENCY",description:"This function calculates how often values occur within a range of values. This function returns a vertical array of numbers",parameters:[{name:"dataarray"},{name:"binarray"}]},{name:"FTEST",description:"This function returns the result of an F-test, which returns the one-tailed probability that the variances in two arrays are not significantly different.",parameters:[{name:"array1"},{name:"array2"}]},{name:"FV",description:"This function returns the future value of an investment based on a present value, periodic payments, and a specified interest rate.",parameters:[{name:"rate"},{name:"numper"},{name:"paymt"},{name:"pval"},{name:"type"}]},{name:"FVSCHEDULE",description:"This function returns the future value of an initial principal after applying a series of compound interest rates. Calculate future value of an investment with a variable or adjustable rate.",parameters:[{name:"principal"},{name:"schedule"}]},{name:"GAMMADIST",description:"This function returns the gamma distribution.",parameters:[{name:"x"},{name:"alpha"},{name:"beta"},{name:"cumulative"}]},{name:"GAMMAINV",description:"This function returns the inverse of the gamma cumulative distribution.",parameters:[{name:"p"},{name:"alpha"},{name:"beta"}]},{name:"GAMMALN",description:"This function returns the natural logarithm of the Gamma function, G(x).",parameters:[{name:"value"}]},{name:"GCD",description:"This function returns the greatest common divisor of two numbers.",parameters:[{name:"number1"},{name:"number2"}]},{name:"GEOMEAN",description:"This function returns the geometric mean of a set of positive data.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"GESTEP",description:"This function, greater than or equal to step, returns an indication of whether a number is equal to a threshold.",parameters:[{name:"number"},{name:"step"}]},{name:"GROWTH",description:"This function calculates predicted exponential growth. This function returns the y values for a series of new x values that are specified by using existing x and y values.",parameters:[{name:"y"},{name:"x"},{name:"newx"},{name:"constant"}]},{name:"HARMEAN",description:"This function returns the harmonic mean of a data set.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"HEX2BIN",description:"This function converts a hexadecimal number to a binary number.",parameters:[{name:"number"},{name:" places"}]},{name:"HEX2DEC",description:"This function converts a hexadecimal number to a decimal number.",parameters:[{name:"number"}]},{name:"HEX2OCT",description:"This function converts a hexadecimal number to an octal number.",parameters:[{name:"number"},{name:" places"}]},{name:"HLOOKUP",description:"This function searches for a value in the top row and then returns a value in the same column from a specified row.",parameters:[{name:"value"},{name:"array"},{name:"row"},{name:"approx"}]},{name:"HOUR",description:"This function returns the hour that corresponds to a specified time.",parameters:[{name:"time"}]},{name:"HYPGEOMDIST",description:"This function returns the hypergeometric distribution.",parameters:[{name:"x"},{name:"n"},{name:"M"},{name:"N"}]},{name:"IF",description:"This function performs a comparison and returns one of two provided values based on that comparison.",parameters:[{name:"valueTest"},{name:"valueTrue"},{name:"valueFalse"}]},{name:"IFERROR",description:"This function evaluates a formula and returns a value you provide if there is an error or the formula result.",parameters:[{name:"value"},{name:"error"}]},{name:"IMABS",description:"This function returns the absolute value or modulus of a complex number.",parameters:[{name:"complexnum"}]},{name:"IMAGINARY",description:"This function returns the imaginary coefficient of a complex number.",parameters:[{name:"complexnum"}]},{name:"IMARGUMENT",description:"This function returns the argument theta, which is an angle expressed in radians.",parameters:[{name:"complexnum"}]},{name:"IMCONJUGATE",description:"This function returns the complex conjugate of a complex number.",parameters:[{name:"complexnum"}]},{name:"IMCOS",description:"This function returns the cosine of a complex number.",parameters:[{name:"complexnum"}]},{name:"IMDIV",description:"This function returns the quotient of two complex numbers.",parameters:[{name:"complexnum"},{name:"complexdenom"}]},{name:"IMEXP",description:"This function returns the exponential of a complex number.",parameters:[{name:"complexnum"}]},{name:"IMLN",description:"This function returns the natural logarithm of a complex number.",parameters:[{name:"complexnum"}]},{name:"IMLOG2",description:"This function returns the base-2 logarithm of a complex number.",parameters:[{name:"complexnum"}]},{name:"IMLOG10",description:"This function returns the common logarithm of a complex number.",parameters:[{name:"complexnum"}]},{name:"IMPOWER",description:"This function returns a complex number raised to a power.",parameters:[{name:"complexnum"},{name:"powernum"}]},{name:"IMPRODUCT",description:"This function returns the product of up to 29 complex numbers in the x+yi or x+yj text format",parameters:[{name:"complexnum1"},{name:"complexnum2",repeatable:!0}]},{name:"IMREAL",description:"This function returns the real coefficient of a complex number in the x+yi or x+yj text format.",parameters:[{name:"complexnum"}]},{name:"IMSIN",description:"This function returns the sine of a complex number in the x+yi or x+yj text format.",parameters:[{name:"complexnum"}]},{name:"IMSQRT",description:"This function returns the square root of a complex number in the x+yi or x+yj text format.",parameters:[{name:"complexnum"}]},{name:"IMSUB",description:"This function returns the difference of two complex numbers in the x+yi or x+yj text format.",parameters:[{name:"complexnum1"},{name:"complexnum2"}]},{name:"IMSUM",description:"This function returns the sum of two or more complex numbers in the x+yi or x+yj text format.",parameters:[{name:"complexnum1"},{name:"complexnum2",repeatable:!0}]},{name:"INDEX",description:"This function returns a value or the reference to a value from within an array or range.",parameters:[{name:"return"},{name:"row"},{name:"col"},{name:"area"}]},{name:"INT",description:"This function rounds a specified number down to the nearest integer.",parameters:[{name:"value"}]},{name:"INTERCEPT",description:"This function returns the coordinates of a point at which a line intersects the y-axis, by using existing x values and y values.",parameters:[{name:"dependent"},{name:"independent"}]},{name:"INTRATE",description:"This function calculates the interest rate for a fully invested security.",parameters:[{name:"settle"},{name:"mature"},{name:"invest"},{name:"redeem"},{name:"basis"}]},{name:"IPMT",description:"This function calculates the payment of interest on a loan.",parameters:[{name:"rate"},{name:"per"},{name:"nper"},{name:"pval"},{name:"fval"},{name:"type"}]},{name:"IRR",description:"This function returns the internal rate of return for a series of cash flows represented by the numbers in an array.",parameters:[{name:"arrayvals"},{name:"estimate"}]},{name:"ISBLANK",description:"This function tests whether a value, an expression, or contents of a referenced cell is empty.",parameters:[{name:"cellreference"}]},{name:"ISERR",description:"This function, Is Error Other Than Not Available, tests whether a value, an expression, or contents of a referenced cell has an error other than not available (#N/A).",parameters:[{name:"cellreference"}]},{name:"ISERROR",description:"This function, Is Error of Any Kind, tests whether a value, an expression, or contents of a referenced cell has an error of any kind.",parameters:[{name:"cellreference"}]},{name:"ISEVEN",description:"This function, Is Number Even, tests whether a value, an expression, or contents of a referenced cell is even.",parameters:[{name:"cellreference"}]},{name:"ISLOGICAL",description:"This function tests whether a value, an expression, or contents of a referenced cell is a logical (Boolean) value.",parameters:[{name:"cellreference"}]},{name:"ISNA",description:"This function, Is Not Available, tests whether a value, an expression, or contents of a referenced cell has the not available (#N/A) error value.",parameters:[{name:"cellreference"}]},{name:"ISNONTEXT",description:"This function tests whether a value, an expression, or contents of a referenced cell has any data type other than text.",parameters:[{name:"cellreference"}]},{name:"ISNUMBER",description:"This function tests whether a value, an expression, or contents of a referenced cell has numeric data.",parameters:[{name:"cellreference"}]},{name:"ISODD",description:"This function, Is Number Odd, tests whether a value, an expression, or contents of a referenced cell has numeric data.",parameters:[{name:"cellreference"}]},{name:"ISPMT",description:"This function calculates the interest paid during a specific period of an investment.",parameters:[{name:"rate"},{name:"per"},{name:"nper"},{name:"pv"}]},{name:"ISREF",description:"This function, Is Reference, tests whether a value, an expression, or contents of a referenced cell is a reference to another cell.",parameters:[{name:"cellreference"}]},{name:"ISTEXT",description:"This function tests whether a value, an expression, or contents of a referenced cell has text data.",parameters:[{name:"cellreference"}]},{name:"KURT",description:"This function returns the kurtosis of a data set.",parameters:[{name:"value1"},{name:"value2"},{name:"value3"},{name:"value4",repeatable:!0}]},{name:"LARGE",description:"This function returns the nth largest value in a data set, where n is specified.",parameters:[{name:"array"},{name:"n"}]},{name:"LCM",description:"This function returns the least common multiple of two numbers.",parameters:[{name:"number1"},{name:"number2"}]},{name:"LEFT",description:"This function returns the specified leftmost characters from a text value.",parameters:[{name:"mytext"},{name:"num_chars"}]},{name:"LEN",description:"This function returns the length of, the number of characters in, a text string.",parameters:[{name:"value"}]},{name:"LINEST",description:"This function calculates the statistics for a line.",parameters:[{name:"y"},{name:"x"},{name:"constant"},{name:"stats"}]},{name:"LN",description:"This function returns the natural logarithm of the specified number.",parameters:[{name:"value"}]},{name:"LOG",description:"This function returns the logarithm base Y of a number X.",parameters:[{name:"number"},{name:"base"}]},{name:"LOG10",description:"This function returns the logarithm base 10 of the number given.",parameters:[{name:"value"}]},{name:"LOGEST",description:"This function calculates an exponential curve that fits the data and returns an array of values that describes the curve.",parameters:[{name:"y"},{name:"x"},{name:"constant"},{name:"stats"}]},{name:"LOGINV",description:"This function returns the inverse of the lognormal cumulative distribution function of x, where LN(x) is normally distributed with the specified mean and standard deviation.",parameters:[{name:"prob"},{name:"mean"},{name:"stdev"}]},{name:"LOGNORMDIST",description:"This function returns the cumulative natural log normal distribution of x, where LN(x) is normally distributed with the specified mean and standard deviation. Analyze data that has been logarithmically transformed with this function.",parameters:[{name:"x"},{name:"mean"},{name:"stdev"}]},{name:"LOOKUP",description:"This function searches for a value and returns a value from the same location in a second area.",parameters:[{name:"lookupvalue"},{name:"lookupvector"},{name:"resultvector"}]},{name:"LOWER",description:"This function converts text to lower case letters.",parameters:[{name:"string"}]},{name:"MATCH",description:"This function returns the relative position of a specified item in a range.",parameters:[{name:"value1"},{name:"array"},{name:"type"}]},{name:"MAX",description:"This function returns the maximum value, the greatest value, of all the values in the arguments.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"MAXA",description:"This function returns the largest value in a list of arguments, including text and logical values.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"MDETERM",description:"This function returns the matrix determinant of an array.",parameters:[{name:"array"}]},{name:"MDURATION",description:"This function calculates the modified Macauley duration of a security with an assumed par value of $100.",parameters:[{name:"settlement"},{name:"maturity"},{name:"coupon"},{name:"yield"},{name:"frequency"},{name:"basis"}]},{name:"MEDIAN",description:"This function returns the median, the number in the middle of the provided set of numbers; that is, half the numbers have values that are greater than the median, and half have values that are less than the median.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"MID",description:"This function returns the requested number of characters from a text string starting at the position you specify.",parameters:[{name:"text"},{name:"start_num"},{name:"num_chars"}]},{name:"MIN",description:"This function returns the minimum value, the least value, of all the values in the arguments",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"MINA",description:"This function returns the minimum value in a list of arguments, including text and logical values.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"MINUTE",description:"This function returns the minute corresponding to a specified time.",parameters:[{name:"time"}]},{name:"MINVERSE",description:"This function returns the inverse matrix for the matrix stored in an array.",parameters:[{name:"array"}]},{name:"MIRR",description:"This function returns the modified internal rate of return for a series of periodic cash flows.",parameters:[{name:"arrayvals"},{name:"payment_int"},{name:"income_int"}]},{name:"MMULT",description:"This function returns the matrix product for two arrays.",parameters:[{name:"array1"},{name:"array2"}]},{name:"MOD",description:"This function returns the remainder of a division operation.",parameters:[{name:"dividend"},{name:"divisor"}]},{name:"MODE",description:"This function returns the most frequently occurring value in a set of data.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"MONTH",description:"This function returns the month corresponding to the specified date value.",parameters:[{name:"date"}]},{name:"MROUND",description:"This function returns a number rounded to the desired multiple.",parameters:[{name:"number"},{name:"multiple"}]},{name:"MULTINOMIAL",description:"This function calculates the ratio of the factorial of a sum of values to the product of factorials.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"N",description:"This function returns a value converted to a number.",parameters:[{name:"value"}]},{name:"NA",description:"This function returns the error value #N/A that means not available.",parameters:[]},{name:"NEGBINOMDIST",description:"This function returns the negative binomial distribution.",parameters:[{name:"x"},{name:"r"},{name:"p"}]},{name:"NETWORKDAYS",description:"This function returns the total number of complete working days between the start and end dates.",parameters:[{name:"startdate"},{name:"enddate"},{name:"holidays"}]},{name:"NOMINAL",description:"This function returns the nominal annual interest rate for a given effective rate and number of compounding periods per year.",parameters:[{name:"effrate"},{name:"comper"}]},{name:"NORMDIST",description:"This function returns the normal cumulative distribution for the specified mean and standard deviation.",parameters:[{name:"x"},{name:"mean"},{name:"stdev"},{name:"cumulative"}]},{name:"NORMINV",description:"This function returns the inverse of the normal cumulative distribution for the given mean and standard deviation.",parameters:[{name:"prob"},{name:"mean"},{name:"stdev"}]},{name:"NORMSDIST",description:"This function returns the standard normal cumulative distribution function.",parameters:[{name:"value"}]},{name:"NORMSINV",description:"This function returns the inverse of the standard normal cumulative distribution. The distribution has a mean of zero and a standard deviation of one.",parameters:[{name:"prob"}]},{name:"NOT",description:"This function reverses the logical value of its argument.",parameters:[{name:"value"}]},{name:"NOW",description:"This function returns the current date and time.",parameters:[]},{name:"NPER",description:"This function returns the number of periods for an investment based on a present value, future value, periodic payments, and a specified interest rate.",parameters:[{name:"rate"},{name:"paymt"},{name:"pval"},{name:"fval"},{name:"type"}]},{name:"NPV",description:"This function calculates the net present value of an investment by using a discount rate and a series of future payments and income.",parameters:[{name:"discount"},{name:"value1"},{name:"value2",repeatable:!0}]},{name:"OCT2BIN",description:"This function converts an octal number to a binary number.",parameters:[{name:"number"},{name:"places"}]},{name:"OCT2DEC",description:"This function converts an octal number to a decimal number.",parameters:[{name:"number"}]},{name:"OCT2HEX",description:"This function converts an octal number to a hexadecimal number.",parameters:[{name:"number"},{name:"places"}]},{name:"ODD",description:"This function rounds the specified value up to the nearest odd integer.",parameters:[{name:"value"}]},{name:"ODDFPRICE",description:"This function calculates the price per $100 face value of a security with an odd first period.",parameters:[{name:"settle"},{name:"maturity"},{name:"issue"},{name:"first"},{name:"rate"},{name:"yield"},{name:"redeem"},{name:"freq"},{name:"basis"}]},{name:"ODDFYIELD",description:"This function calculates the yield of a security with an odd first period.",parameters:[{name:"settle"},{name:"maturity"},{name:"issue"},{name:"first"},{name:"rate"},{name:"price"},{name:"redeem"},{name:"freq"},{name:"basis"}]},{name:"ODDLPRICE",description:"This function calculates the price per $100 face value of a security with an odd last coupon period.",parameters:[{name:"settle"},{name:"maturity"},{name:"last"},{name:"rate"},{name:"yield"},{name:"redeem"},{name:"freq"},{name:"basis"}]},{name:"ODDLYIELD",description:"This function calculates the yield of a security with an odd last period.",parameters:[{name:"settle"},{name:"maturity"},{name:"last"},{name:"rate"},{name:"price"},{name:"redeem"},{name:"freq"},{name:"basis"}]},{name:"OFFSET",description:"This function returns a reference to a range. The range is a specified number of rows and columns from a cell or range of cells. The function returns a single cell or a range of cells.",parameters:[{name:"reference"},{name:"rows"},{name:"cols"},{name:"height"},{name:"width"}]},{name:"OR",description:"This function calculates logical OR. It returns TRUE if any of its arguments are true; otherwise, returns FALSE if all arguments are false.",parameters:[{name:"argument1"},{name:"argument2..."}]},{name:"PEARSON",description:"This function returns the Pearson product moment correlation coefficient, a dimensionless index between -1.0 to 1.0 inclusive indicative of the linear relationship of two data sets.",parameters:[{name:"array_ind"},{name:"array_dep"}]},{name:"PERCENTILE",description:"This function returns the nth percentile of values in a range.",parameters:[{name:"array"},{name:"n"}]},{name:"PERCENTRANK",description:"This function returns the rank of a value in a data set as a percentage of the data set.",parameters:[{name:"array"},{name:"n"},{name:"sigdig"}]},{name:"PERMUT",description:"This function returns the number of possible permutations for a specified number of items.",parameters:[{name:"k"},{name:"n"}]},{name:"PI",description:"This function returns PI as 3.1415926536.",parameters:[]},{name:"PMT",description:"This function returns the payment amount for a loan given the present value, specified interest rate, and number of terms.",parameters:[{name:"rate"},{name:"nper"},{name:"pval"},{name:"fval"},{name:"type"}]},{name:"POISSON",description:"This function returns the Poisson distribution.",parameters:[{name:"nevents"},{name:"mean"},{name:"cumulative"}]},{name:"POWER",description:"This function raises the specified number to the specified power.",parameters:[{name:"number"},{name:"power"}]},{name:"PPMT",description:"This function returns the amount of payment of principal for a loan given the present value, specified interest rate, and number of terms.",parameters:[{name:"rate"},{name:"per"},{name:"nper"},{name:"pval"},{name:"fval"},{name:"type"}]},{name:"PRICE",description:"This function calculates the price per $100 face value of a periodic interest security",parameters:[{name:"settlement"},{name:"maturity"},{name:"rate"},{name:"yield"},{name:"redeem"},{name:"frequency"},{name:"basis"}]},{name:"PRICEDISC",description:"This function returns the price per $100 face value of a discounted security.",parameters:[{name:"settle"},{name:"mature"},{name:"discount"},{name:"redeem"},{name:"basis"}]},{name:"PRICEMAT",description:"This function returns the price at maturity per $100 face value of a security that pays interest.",parameters:[{name:"settle"},{name:"mature"},{name:"issue"},{name:"rate"},{name:"yield"},{name:"basis"}]},{name:"PROB",description:"This function returns the probability that values in a range are between two limits.",parameters:[{name:"array"},{name:"probs"},{name:"lower"},{name:"upper"}]},{name:"PRODUCT",description:"This function multiplies all the arguments and returns the product.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"PV",description:"This function returns the present value of an investment based on the interest rate, number and amount of periodic payments, and future value. The present value is the total amount that a series of future payments is worth now.",parameters:[{name:"rate"},{name:"numper"},{name:"paymt"},{name:"fval"},{name:"type"}]},{name:"QUARTILE",description:"This function returns which quartile (which quarter or 25 percent) of a data set a value is.",parameters:[{name:"array"},{name:"quart"}]},{name:"QUOTIENT",description:"This function returns the integer portion of a division. Use this to ignore the remainder of a division.",parameters:[{name:"numerator"},{name:"denominator"}]},{name:"RADIANS",description:"This function converts the specified number from degrees to radians.",parameters:[{name:"value"}]},{name:"RADIANS",description:"This function converts the specified number from degrees to radians.",parameters:[{name:"value"}]},{name:"RAND",description:"This function returns an evenly distributed random number between 0 and 1.",parameters:[]},{name:"RANDBETWEEN",description:"This function returns a random number between the numbers you specify.",parameters:[{name:"lower"},{name:"upper"}]},{name:"RANK",description:"This function returns the rank of a number in a set of numbers. If you were to sort the set, the rank of the number would be its position in the list.",parameters:[{name:"number"},{name:"array"},{name:"order"}]},{name:"RATE",description:"This function returns the interest rate per period of an annuity.",parameters:[{name:"nper"},{name:"pmt"},{name:"pval"},{name:"fval"},{name:"type"},{name:"guess"}]},{name:"RECEIVED",description:"This function returns the amount received at maturity for a fully invested security.",parameters:[{name:"settle"},{name:"mature"},{name:"invest"},{name:"discount"},{name:"basis"}]},{name:"REPLACE",description:"This function replaces part of a text string with a different text string.",parameters:[{name:"old_text"},{name:"start_char"},{name:"num_chars"},{name:"new_text"}]},{name:"REPT",description:"This function repeats text a specified number of times.",parameters:[{name:"text"},{name:"number"}]},{name:"RIGHT",description:"This function returns the specified rightmost characters from a text value.",parameters:[{name:"text"},{name:"num_chars"}]},{name:"ROMAN",description:"This function converts an arabic numeral to a roman numeral text equivalent.",parameters:[{name:"number"},{name:"style"}]},{name:"ROUND",description:"This function rounds the specified value to the nearest number, using the specified number of decimal places.",parameters:[{name:"value"},{name:"places"}]},{name:"ROUNDDOWN",description:"This function rounds the specified number down to the nearest number, using the specified number of decimal places.",parameters:[{name:"value"},{name:"places"}]},{name:"ROUNDUP",description:"This function rounds the specified number up to the nearest number, using the specified number of decimal places.",parameters:[{name:"value"},{name:"places"}]},{name:"ROW",description:"This function returns the number of a row from a reference.",parameters:[{name:"reference"}]},{name:"ROWS",description:"This function returns the number of rows in an array.",parameters:[{name:"array"}]},{name:"RSQ",description:"This function returns the square of the Pearson product moment correlation coefficient (R\u2011squared) through data points in known y\u2019s and known x\u2019s.",parameters:[{name:"array_dep"},{name:"array_ind"}]},{name:"SEARCH",description:"This function finds one text string in another text string and returns the index of the starting position of the found text.",parameters:[{name:"string1"},{name:"string2"}]},{name:"SECOND",description:"This function returns the seconds (0 to 59) value for a specified time.",parameters:[{name:"time"}]},{name:"SERIESSUM",description:"This function returns the sum of a power series.",parameters:[{name:"x"},{name:"n"},{name:"m"},{name:"coeff"}]},{name:"SIGN",description:"This function returns the sign of a number or expression.",parameters:[{name:"cellreference"}]},{name:"SIN",description:"This function returns the sine of the specified angle.",parameters:[{name:"angle"}]},{name:"SINH",description:"This function returns the hyperbolic sine of the specified number.",parameters:[{name:"value"}]},{name:"SKEW",description:"This function returns the skewness of a distribution.",parameters:[{name:"number1"},{name:"number2",repeatable:!0}]},{name:"SLN",description:"This function returns the straight-line depreciation of an asset for one period.",parameters:[{name:"cost"},{name:"salvage"},{name:"life"}]},{name:"SLOPE",description:"This function calculates the slope of a linear regression.",parameters:[{name:"array_dep"},{name:"array_ind"}]},{name:"SMALL",description:"This function returns the nth smallest value in a data set, where n is specified.",parameters:[{name:"array"},{name:"n"}]},{name:"SQRT",description:"This function returns the positive square root of the specified number.",parameters:[{name:"value"}]},{name:"SQRTPI",description:"This function returns the positive square root of a multiple of pi (p).",parameters:[{name:"multiple"}]},{name:"STANDARDIZE",description:"This function returns a normalized value from a distribution characterized by mean and standard deviation.",parameters:[{name:"x"},{name:"mean"},{name:"stdev"}]},{name:"STDEVA",description:"This function returns the standard deviation for a set of numbers, text, or logical values.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"STDEVP",description:"This function returns the standard deviation for an entire specified population (of numeric values).",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"STDEVPA",description:"This function returns the standard deviation for an entire specified population, including text or logical values as well as numeric values.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"STEYX",description:"This function returns the standard error of the predicted y value for each x. The standard error is a measure of the amount of error in the prediction of y for a value of x.",parameters:[{name:"array_dep"},{name:"array_ind"}]},{name:"SUBSTITUTE",description:"This function substitutes a new string for specified characters in an existing string.",parameters:[{name:"text"},{name:"old_piece"},{name:"new_piece"},{name:"instance"}]},{name:"SUBTOTAL",description:"This function calculates a subtotal of a list of numbers using a specified built-in function.",parameters:[{name:"functioncode"},{name:"value1"},{name:"value2",repeatable:!0}]},{name:"SUM",description:"This function returns the sum of cells or range of cells.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"SUMIF",description:"This function adds the cells using a given criteria.",parameters:[{name:"array"},{name:"condition"},{name:"sumrange"}]},{name:"SUMIFS",description:"This function adds the cells in a range using multiple criteria.",parameters:[{name:"array"},{name:"conditionarray"},{name:"condition",repeatable:!0}]},{name:"SUMPRODUCT",description:"This function returns the sum of products of cells. Multiplies corresponding components in the given arrays, and returns the sum of those products.",parameters:[{name:"array1"},{name:"array2",repeatable:!0}]},{name:"SUMSQ",description:"This function returns the sum of the squares of the arguments.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"SUMX2MY2",description:"This function returns the sum of the difference of the squares of corresponding values in two arrays.",parameters:[{name:"array_x"},{name:"array_y"}]},{name:"SUMX2PY2",description:"This function returns the sum of the sum of squares of corresponding values in two arrays.",parameters:[{name:"array_x"},{name:"array_y"}]},{name:"SUMXMY2",description:"This function returns the sum of the square of the differences of corresponding values in two arrays.",parameters:[{name:"array_x"},{name:"array_y"}]},{name:"SYD",description:"This function returns the sum-of-years\u2019 digits depreciation of an asset for a specified period.",parameters:[{name:"cost"},{name:"salvage"},{name:"life"},{name:"period"}]},{name:"T",description:"This function returns the text in a specified cell.",parameters:[{name:"value"}]},{name:"TAN",description:"This function returns the tangent of the specified angle.",parameters:[{name:"angle"}]},{name:"TANH",description:"This function returns the hyperbolic tangent of the specified number.",parameters:[{name:"value"}]},{name:"TBILLEQ",description:"This function returns the equivalent yield for a Treasury bill (or T-bill)",parameters:[{name:"settle"},{name:"mature"},{name:"discount"}]},{name:"TBILLPRICE",description:"This function returns the price per $100 face value for a Treasury bill (or T-bill).",parameters:[{name:"settle"},{name:"mature"},{name:"discount"}]},{name:"TBILLYIELD",description:"This function returns the yield for a Treasury bill (or T-bill).",parameters:[{name:"settle"},{name:"mature"},{name:"priceper"}]},{name:"TDIST",description:"This function returns the probability for the t-distribution.",parameters:[{name:"x"},{name:"deg"},{name:"tails"}]},{name:"TEXT",description:"This function formats a number and converts it to text.",parameters:[{name:"value"},{name:"text"}]},{name:"TIME",description:"This function returns the TimeSpan object for a specified time.",parameters:[{name:"hour"},{name:"minutes"},{name:"seconds"}]},{name:"TIMEVALUE",description:"This function returns the TimeSpan object of the time represented by a text string.",parameters:[{name:"time_string"}]},{name:"TINV",description:"This function returns the t-value of the student's t-distribution as a function of the probability and the degrees of freedom.",parameters:[{name:"prog"},{name:"deg"}]},{name:"TODAY",description:"This function returns the date and time of the current date.",parameters:[]},{name:"TRANSPOSE",description:"This function returns a vertical range of cells as a horizontal range or a horizontal range of cells as a vertical range.",parameters:[{name:"array"}]},{name:"TREND",description:"This function returns values along a linear trend. This function fits a straight line to the arrays known x and y values. Trend returns the y values along that line for the array of specified new x values.",parameters:[{name:"y"},{name:"x"},{name:"newx"},{name:"constant"}]},{name:"TRIM",description:"This function removes extra spaces from a string and leaves single spaces between words.",parameters:[{name:"text"}]},{name:"TRIMMEAN",description:"This function returns the mean of a subset of data excluding the top and bottom data.",parameters:[{name:"array"},{name:"percent"}]},{name:"TRUE",description:"This function returns the value for logical TRUE.",parameters:[]},{name:"TRUNC",description:"This function removes the specified fractional part of the specified number.",parameters:[{name:"value"},{name:"precision"}]},{name:"TTEST",description:"This function returns the probability associated with a t-test.",parameters:[{name:"array1"},{name:"array2"},{name:"tails"},{name:"type"}]},{name:"TYPE",description:"This function returns the type of value.",parameters:[{name:"value"}]},{name:"UPPER",description:"This function converts text to uppercase letters.",parameters:[{name:"string"}]},{name:"VALUE",description:"This function converts a text string that is a number to a numeric value.",parameters:[{name:"text"}]},{name:"VAR",description:"This function returns the variance based on a sample of a population, which uses only numeric values.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"VARA",description:"This function returns the variance based on a sample of a population, which includes numeric, logical, or text values.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"VARP",description:"This function returns variance based on the entire population, which uses only numeric values.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"VARPA",description:"This function returns variance based on the entire population, which includes numeric, logical, or text values.",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"VDB",description:"This function returns the depreciation of an asset for any period you specify using the variable declining balance method.",parameters:[{name:"cost"},{name:"salvage"},{name:"life"},{name:"start"},{name:"end"},{name:"factor"},{name:"switchnot"}]},{name:"VLOOKUP",description:"This function searches for a value in the leftmost column and returns a value in the same row from a column you specify.",parameters:[{name:"value"},{name:"array"},{name:"colindex"},{name:"approx"}]},{name:"WEEKDAY",description:"This function returns the number corresponding to the day of the week for a specified date.",parameters:[{name:"date"},{name:"type"}]},{name:"WEEKNUM",description:"This function returns a number that indicates the week of the year numerically.",parameters:[{name:"date"},{name:"weektype"}]},{name:"WEIBULL",description:"This function returns the two-parameter Weibull distribution, often used in reliability analysis.",parameters:[{name:"x"},{name:"alpha"},{name:"beta"},{name:"cumulative"}]},{name:"WORKDAY",description:"This function returns the number of working days before or after the starting date.",parameters:[{name:"startdate"},{name:"numdays"},{name:"holidays"}]},{name:"XIRR",description:"This function calculates the internal rate of return for a schedule of cash flows that may not be periodic.",parameters:[{name:"values"},{name:"dates"},{name:"guess"}]},{name:"XNPV",description:"This function calculates the net present value for a schedule of cash flows that may not be periodic.",parameters:[{name:"rate"},{name:"values"},{name:"dates"}]},{name:"YEAR",description:"This function returns the year as an integer for a specified date.",parameters:[{name:"date"}]},{name:"YEARFRAC",description:"This function returns the fraction of the year represented by the number of whole days between the start and end dates.",parameters:[{name:"startdate"},{name:"enddate"},{name:"basis"}]},{name:"YIELD",description:"This function calculates the yield on a security that pays periodic interest.",parameters:[{name:"settle"},{name:"maturity"},{name:"rate"},{name:"price"},{name:"redeem"},{name:"frequency"},{name:"basis"}]},{name:"YIELDDISC",description:"This function calculates the annual yield for a discounted security.",parameters:[{name:"settle"},{name:"maturity"},{name:"price"},{name:"redeem"},{name:"basis"}]},{name:"YIELDMAT",description:"This function calculates the annual yield of a security that pays interest at maturity.",parameters:[{name:"settle"},{name:"maturity"},{name:"issue"},{name:"issrate"},{name:"price"},{name:"basis"}]},{name:"ZTEST",description:"This function returns the significance value of a z-test. The z-test generates a standard score for x with respect to the set of data and returns the two-tailed probability for the normal distribution.",parameters:[{name:"array"},{name:"x"},{name:"sigma"}]},{name:"PIESPARKLINE",description:"This function returns a data set used for representing a pie sparkline",parameters:[{name:"range|percentage"},{name:"color",repeatable:!0}]},{name:"AREASPARKLINE",description:"This function returns a data set used for representing a area sparkline",parameters:[{name:"points"},{name:"mini"},{name:"maxi"},{name:"line1"},{name:"line2"},{name:"colorPositive"},{name:"colorNegative"}]},{name:"SCATTERSPARKLINE",description:"This function returns a data set used for representing a scatter sparkline",parameters:[{name:"points1"},{name:"points2"},{name:"minX"},{name:"maxX"},{name:"minY"},{name:"maxY"},{name:"hLine"},{name:"vLine"},{name:"xMinZone"},{name:"xMaxZone"},{name:"yMinZone"},{name:"yMaxZone"},{name:"tags"},{name:"drawSymbol"},{name:"drawLines"},{name:"color1"},{name:"color2"},{name:"dash"}]},{name:"LINESPARKLINE",description:"This function returns a data set used for representing a line sparkline",parameters:[{name:"data"},{name:"dataOrientation"},{name:"dateAxisData"},{name:"dateAxisOrientation"},{name:"setting"}]},{name:"COLUMNSPARKLINE",description:"This function returns a data set used for representing a column sparkline",parameters:[{name:"data"},{name:"dataOrientation"},{name:"dateAxisData"},{name:"dateAxisOrientation"},{name:"setting"}]},{name:"WINLOSSSPARKLINE",description:"This function returns a data set used for representing a win/loss sparkline",parameters:[{name:"data"},{name:"dataOrientation"},{name:"dateAxisData"},{name:"dateAxisOrientation"},{name:"setting"}]}],n}();n.FormulaTextBoxResource_EN=t;i=function(){function n(){}return n.Functions=[{name:"ABS",description:"\u6307\u5b9a\u3057\u305f\u5024\u306e\u7d76\u5bfe\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"ACCRINT",description:"\u5b9a\u671f\u7684\u306b\u5229\u606f\u304c\u652f\u6255\u308f\u308c\u308b\u8a3c\u5238\u306e\u672a\u53ce\u5229\u606f\u984d\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"issue"},{name:"first"},{name:"settle"},{name:"rate"},{name:"par"},{name:"frequency"},{name:"basis"}]},{name:"ACCRINTM",description:"\u6e80\u671f\u306b\u5229\u606f\u304c\u652f\u6255\u308f\u308c\u308b\u8a3c\u5238\u306e\u672a\u53ce\u5229\u606f\u984d\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"issue"},{name:"maturity"},{name:"rate"},{name:"par"},{name:"basis"}]},{name:"ACOS",description:"\u6307\u5b9a\u306e\u5024\u304c\u30b3\u30b5\u30a4\u30f3\u3068\u306a\u308b\u89d2\u5ea6\u3092\u8fd4\u3057\u307e\u3059\u3002\u623b\u308a\u5024\u306e\u89d2\u5ea6\u306f 0\uff5e\u03c0\uff08\u30e9\u30b8\u30a2\u30f3\u5358\u4f4d\uff09\u3067\u3059\u3002",parameters:[{name:"value"}]},{name:"ACOSH",description:"\u6307\u5b9a\u3057\u305f\u89d2\u5ea6\u306e\u30cf\u30a4\u30d1\u30fc\u30dc\u30ea\u30c3\u30af\u30b3\u30b5\u30a4\u30f3\u306e\u9006\u95a2\u6570\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"ADDRESS",description:"\u6307\u5b9a\u306e\u884c\u756a\u53f7\u304a\u3088\u3073\u5217\u756a\u53f7\u306b\u57fa\u3065\u304d\u3001\u30bb\u30eb \u30a2\u30c9\u30ec\u30b9\u3092\u8868\u3059\u30c6\u30ad\u30b9\u30c8\u3092\u751f\u6210\u3057\u307e\u3059\u3002",parameters:[{name:"row"},{name:"column"},{name:"absnum"},{name:"a1style"},{name:"sheettext"}]},{name:"AMORDEGRC",description:"\u65e5\u5272\u308a\u8a08\u7b97\u306b\u3088\u308b\u6e1b\u4fa1\u511f\u5374\u3092\u8003\u616e\u3057\u3001\u8cc7\u7523\u8010\u7528\u5e74\u6570\u306b\u57fa\u3065\u304f\u6e1b\u4fa1\u511f\u5374\u4fc2\u6570\u3092\u8a08\u7b97\u306b\u9069\u7528\u3057\u3066\u3001\u4f1a\u8a08\u671f\u3054\u3068\u306e\u6e1b\u4fa1\u511f\u5374\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"cost"},{name:"datepurchased"},{name:"firstperiod"},{name:"salvage"},{name:"period"},{name:"drate"},{name:"basis"}]},{name:"AMORLINC",description:"\u65e5\u5272\u308a\u8a08\u7b97\u306b\u3088\u308b\u6e1b\u4fa1\u6d88\u5374\u3092\u8003\u616e\u3057\u3001\u6307\u5b9a\u306e\u4f1a\u8a08\u671f\u306e\u6e1b\u4fa1\u511f\u5374\u8cbb\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"cost"},{name:"datepurchased"},{name:"firstperiod"},{name:"salvage"},{name:"period"},{name:"drate"},{name:"basis"}]},{name:"AND",description:"\u3059\u3079\u3066\u306e\u5f15\u6570\u304c\u771f\u3067\u3042\u308c\u3070 True \u3092\u3001\uff11\u3064\u4ee5\u4e0a\u306e\u5f15\u6570\u304c\u507d\u3067\u3042\u308c\u3070 False \u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"logical1"},{name:"logical2"}]},{name:"ASIN",description:"\u6307\u5b9a\u306e\u5024\u304c\u30b5\u30a4\u30f3\u3068\u306a\u308b\u89d2\u5ea6\u3092\u8fd4\u3057\u307e\u3059\u3002\u623b\u308a\u5024\u306e\u89d2\u5ea6\u306f -\u03c0/2\uff5e\u03c0/2\uff08\u30e9\u30b8\u30a2\u30f3\u5358\u4f4d\uff09\u3067\u3059\u3002",parameters:[{name:"value"}]},{name:"ASINH",description:"\u6307\u5b9a\u3057\u305f\u6570\u5024\u306e\u30cf\u30a4\u30d1\u30fc\u30dc\u30ea\u30c3\u30af\u30b5\u30a4\u30f3\u306e\u9006\u95a2\u6570\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"ATAN",description:"\u6307\u5b9a\u306e\u5024\u304c\u30bf\u30f3\u30b8\u30a7\u30f3\u30c8\u3068\u306a\u308b\u89d2\u5ea6\u3092\u8fd4\u3057\u307e\u3059\u3002\u623b\u308a\u5024\u306e\u89d2\u5ea6\u306f -\u03c0/2\uff5e\u03c0/2\uff08\u30e9\u30b8\u30a2\u30f3\u5358\u4f4d\uff09\u3067\u3059\u3002",parameters:[{name:"value"}]},{name:"ATAN2",description:"\u6307\u5b9a\u306e x \u5ea7\u6a19\u304a\u3088\u3073 y \u5ea7\u6a19\u306e\u30a2\u30fc\u30af\u30bf\u30f3\u30b8\u30a7\u30f3\u30c8\u3092\u8fd4\u3057\u307e\u3059\u3002\u623b\u308a\u5024\u306e\u89d2\u5ea6\u306f -\u03c0\uff5e\u03c0\uff08\u30e9\u30b8\u30a2\u30f3\u5358\u4f4d\u3001\u305f\u3060\u3057 -\u03c0 \u3092\u9664\u304f\uff09\u3067\u3059\u3002",parameters:[{name:"x"},{name:"y"}]},{name:"ATANH",description:"\u6307\u5b9a\u3057\u305f\u6570\u5024\u306e\u30cf\u30a4\u30d1\u30fc\u30dc\u30ea\u30c3\u30af\u30bf\u30f3\u30b8\u30a7\u30f3\u30c8\u306e\u9006\u95a2\u6570\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"AVEDEV",description:"\u6307\u5b9a\u306e\u30c7\u30fc\u30bf\u5168\u4f53\u306e\u5e73\u5747\u5024\u306b\u5bfe\u3059\u308b\u3001\u500b\u3005\u306e\u5024\u306e\u7d76\u5bfe\u504f\u5dee\u306e\u5e73\u5747\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"AVERAGE",description:"\u6307\u5b9a\u3057\u305f\u6570\u5024\u306e\u5e73\u5747\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"AVERAGEA",description:"\u6307\u5b9a\u3057\u305f\u6570\u5024\u306e\u5e73\u5747\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"AVERAGEIF",description:"\u6307\u5b9a\u3057\u305f\u57fa\u6e96\u3092\u6e80\u305f\u3059\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u5e73\u5747\u5024\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0},{name:"condition"}]},{name:"AVERAGEIFS",description:"\u6307\u5b9a\u3057\u305f\u8907\u6570\u306e\u57fa\u6e96\u3092\u6e80\u305f\u3059\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u5e73\u5747\u5024\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"condition1"},{name:"value2",repeatable:!0},{name:"condition2..."}]},{name:"BESSELI",description:"\u7d14\u865a\u6570\u3092\u5f15\u6570\u3068\u3057\u305f\u3068\u304d\u306e\u7b2c\uff11\u7a2e\u5909\u5f62\u30d9\u30c3\u30bb\u30eb\u95a2\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"order"}]},{name:"BESSELJ",description:"\u7b2c\uff11\u7a2e\u30d9\u30c3\u30bb\u30eb\u95a2\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"order"}]},{name:"BESSELK",description:"\u7d14\u865a\u6570\u3092\u5f15\u6570\u3068\u3057\u305f\u3068\u304d\u306e\u7b2c\uff12\u7a2e\u5909\u5f62\u30d9\u30c3\u30bb\u30eb\u95a2\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"order"}]},{name:"BESSELY",description:"\u7b2c\uff12\u7a2e\u30d9\u30c3\u30bb\u30eb\u95a2\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"order"}]},{name:"BETADIST",description:"\u7d2f\u7a4d\u03b2\u78ba\u7387\u5bc6\u5ea6\u95a2\u6570\u306e\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"x"},{name:"alpha"},{name:"beta"},{name:"lower"},{name:"upper"}]},{name:"BETAINV",description:"\u7d2f\u7a4d\u03b2\u78ba\u7387\u5bc6\u5ea6\u95a2\u6570\u306e\u9006\u95a2\u6570\u306e\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"prob"},{name:"alpha"},{name:"beta"},{name:"lower"},{name:"upper"}]},{name:"BIN2DEC",description:"\uff12\u9032\u6570\u5024\u3092 10 \u9032\u6570\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"number"}]},{name:"BIN2HEX",description:"\uff12\u9032\u6570\u5024\u3092 16 \u9032\u6570\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"number"},{name:"places"}]},{name:"BIN2OCT",description:"\uff12\u9032\u6570\u5024\u3092\uff18\u9032\u6570\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"number"},{name:"places"}]},{name:"BINOMDIST",description:"\u500b\u5225\u9805\u306e\u4e8c\u9805\u5206\u5e03\u306e\u78ba\u7387\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"x"},{name:"n"},{name:"p"},{name:"cumulative"}]},{name:"CEILING",description:"\u6307\u5b9a\u3057\u305f\u57fa\u6e96\u5024\u306e\u500d\u6570\u306b\u306a\u308b\u3088\u3046\u306b\u6570\u5024\u3092\u4e38\u3081\u3001\u5143\u306e\u5024\u306b\u6700\u3082\u8fd1\u3044\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"signif"}]},{name:"CHAR",description:"\u6307\u5b9a\u3057\u305f\u6570\u5024\u306b\u5bfe\u5fdc\u3059\u308b\u6587\u5b57\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"CHIDIST",description:"\u7247\u5074\u30ab\u30a4\uff12\u4e57\u5206\u5e03\u306e\u78ba\u7387\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"deg"}]},{name:"CHIINV",description:"\u7247\u5074\u30ab\u30a4\uff12\u4e57\u5206\u5e03\u78ba\u7387\u306e\u9006\u95a2\u6570\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"prob"},{name:"deg"}]},{name:"CHITEST",description:"\u30ab\u30a4\uff12\u4e57\u5206\u5e03\u304b\u3089\u306e\u72ec\u7acb\u6027\u3092\u691c\u5b9a\u3057\u307e\u3059\u3002",parameters:[{name:"obs_array"},{name:"exp_array"}]},{name:"CHOOSE",description:"\u5024\u30ea\u30b9\u30c8\u306e\u4e2d\u304b\u3089\u7279\u5b9a\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"index"},{name:"value1"},{name:"value2",repeatable:!0}]},{name:"CLEAN",description:"\u6307\u5b9a\u306e\u30c6\u30ad\u30b9\u30c8\u304b\u3089\u3001\u5370\u5237\u3067\u304d\u306a\u3044\u3059\u3079\u3066\u306e\u6587\u5b57\u3092\u524a\u9664\u3057\u307e\u3059\u3002",parameters:[{name:"text"}]},{name:"CODE",description:"\u30c6\u30ad\u30b9\u30c8\u5185\u306e\u5148\u982d\u6587\u5b57\u306b\u5bfe\u5fdc\u3059\u308b\u6570\u5024\u30b3\u30fc\u30c9\u3092\u8fd4\u3057\u307e\u3059\u3002\u8fd4\u3055\u308c\u308b\u30b3\u30fc\u30c9\u306f\u3001Unicode\u3067\u3059\u3002",parameters:[{name:"text"}]},{name:"COLUMN",description:"\u53c2\u7167\u306e\u5217\u756a\u53f7\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"reference"}]},{name:"COLUMNS",description:"\u914d\u5217\u5185\u306e\u5217\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array"}]},{name:"COMBIN",description:"\u7dcf\u6570\u304b\u3089\u6307\u5b9a\u306e\u500b\u6570\u3092\u629c\u304d\u53d6\u308b\u5834\u5408\u3001\u9078\u629e\u53ef\u80fd\u306a\u7d44\u307f\u5408\u308f\u305b\u306e\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"k"},{name:"n"}]},{name:"COMPLEX",description:"\u5b9f\u6570\u4fc2\u6570\u304a\u3088\u3073\u865a\u6570\u4fc2\u6570\u3092\u8907\u7d20\u6570\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"realcoeff"},{name:"imagcoeff"},{name:"suffix"}]},{name:"CONCATENATE",description:"\u6307\u5b9a\u306e\u6587\u5b57\u5217\u307e\u305f\u306f\u6570\u5024\u3092\uff11\u3064\u306e\u6587\u5b57\u5217\u306b\u7d71\u5408\u3057\u307e\u3059\u3002",parameters:[{name:"text1"},{name:"text2"},{name:"...."}]},{name:"CONFIDENCE",description:"\u6bcd\u96c6\u56e3\u306e\u5e73\u5747\u5024\u306b\u5bfe\u3059\u308b\u4fe1\u983c\u533a\u9593\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"alpha"},{name:"stdev"},{name:"size"}]},{name:"CONVERT",description:"\u3042\u308b\u8a08\u6e2c\u5358\u4f4d\u306e\u5024\u3092\u3001\u5225\u306e\u8a08\u6e2c\u5358\u4f4d\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"number"},{name:"from-unit"},{name:"to-unit"}]},{name:"CORREL",description:"\uff12\u7d44\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u9593\u306e\u76f8\u95a2\u4fc2\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array1"},{name:"array2"}]},{name:"COS",description:"\u6307\u5b9a\u3057\u305f\u89d2\u5ea6\u306e\u30b3\u30b5\u30a4\u30f3\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"angle"}]},{name:"COSH",description:"\u6307\u5b9a\u3057\u305f\u89d2\u5ea6\u306e\u30cf\u30a4\u30d1\u30fc\u30dc\u30ea\u30c3\u30af\u30b3\u30b5\u30a4\u30f3\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"COUNT",description:"\u6307\u5b9a\u3057\u305f\u8907\u6570\u306e\u5024\u306b\u6570\u5024\u304c\u4f55\u500b\u542b\u307e\u308c\u3066\u3044\u308b\u304b\u500b\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"COUNTA",description:"\u6307\u5b9a\u3057\u305f\u8907\u6570\u306e\u5024\u306b\u6570\u5024\u304c\u4f55\u500b\u542b\u307e\u308c\u3066\u3044\u308b\u304b\u500b\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"COUNTBLANK",description:"\u30b7\u30fc\u30c8\u4e0a\u306e\u6307\u5b9a\u306e\u30bb\u30eb\u7bc4\u56f2\u304b\u3089\u3001\u7a7a\u767d\u30bb\u30eb\u306e\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"cellrange"}]},{name:"COUNTIF",description:"\u7279\u5b9a\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u30bb\u30eb\u306e\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"cellrange"},{name:"condition"}]},{name:"COUNTIFS",description:"\u8907\u6570\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u30bb\u30eb\u306e\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"cellrange"},{name:"condition"}]},{name:"COUPDAYBS",description:"\u8a3c\u5238\u306e\u5229\u6255\u671f\u9593\u306e\uff11\u65e5\u76ee\u304b\u3089\u53d7\u6e21\u65e5\u307e\u3067\u306e\u65e5\u6570\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"settlement"},{name:"maturity"},{name:"frequency"},{name:"basis"}]},{name:"COUPDAYS",description:"\u8a3c\u5238\u306e\u5229\u6255\u671f\u9593\uff08\u53d7\u6e21\u65e5\u3092\u542b\u3080\uff09\u3092\u8868\u3059\u65e5\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"settlement"},{name:"maturity"},{name:"frequency"},{name:"basis"}]},{name:"COUPDAYSNC",description:"\u8a3c\u5238\u306e\u53d7\u6e21\u65e5\u304b\u3089\u6b21\u306e\u5229\u6255\u65e5\u307e\u3067\u306e\u65e5\u6570\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"settlement"},{name:"maturity"},{name:"frequency"},{name:"basis"}]},{name:"COUPNCD",description:"\u8a3c\u5238\u306e\u53d7\u6e21\u5f8c\u306e\u6b21\u56de\u306e\u5229\u6255\u65e5\u3092\u65e5\u4ed8\u5024\u3067\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"settlement"},{name:"maturity"},{name:"frequency"},{name:"basi"}]},{name:"COUPNUM",description:"\u8a3c\u5238\u306e\u53d7\u6e21\u65e5\u304b\u3089\u6e80\u671f\u65e5\u307e\u3067\u306e\u671f\u9593\u4e2d\u306e\u5229\u6255\u56de\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"settlement"},{name:"maturity"},{name:"frequency"},{name:"basis"}]},{name:"COUPPCD",description:"\u8a3c\u5238\u306e\u53d7\u6e21\u65e5\u76f4\u524d\u306e\u5229\u6255\u65e5\u3092\u65e5\u4ed8\u5024\u3067\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"settlement"},{name:"maturity"},{name:"frequency"},{name:"basis"}]},{name:"COVAR",description:"\uff12\u7d44\u306e\u5bfe\u5fdc\u3059\u308b\u30c7\u30fc\u30bf\u306e\u6a19\u6e96\u504f\u5dee\u306e\u7a4d\u306e\u5e73\u5747\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array1"},{name:"array2"}]},{name:"CRITBINOM",description:"\u7d2f\u7a4d\u4e8c\u9805\u5206\u5e03\u306e\u5024\u304c\u57fa\u6e96\u5024\u4ee5\u4e0a\u3068\u306a\u308b\u6700\u5c0f\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"n"},{name:"p"},{name:"alpha"}]},{name:"CUMIPMT",description:"\u958b\u59cb\u671f\u304b\u3089\u7d42\u4e86\u671f\u307e\u3067\u306e\u671f\u9593\u5185\u3067\u3001\u8cb8\u4ed8\u91d1\u306b\u5bfe\u3057\u3066\u652f\u6255\u308f\u308c\u308b\u5229\u606f\u306e\u7d2f\u8a08\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"rate"},{name:"nper"},{name:"pval"},{name:"startperiod"},{name:"endperiod"},{name:"paytype"}]},{name:"CUMPRINC",description:"\u958b\u59cb\u671f\u304b\u3089\u7d42\u4e86\u671f\u307e\u3067\u306e\u671f\u9593\u5185\u3067\u3001\u8cb8\u4ed8\u91d1\u306b\u5bfe\u3057\u3066\u652f\u6255\u308f\u308c\u308b\u5143\u91d1\u306e\u7d2f\u8a08\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"rate"},{name:"nper"},{name:"pval"},{name:"startperiod"},{name:"endperiod"},{name:"paytype"}]},{name:"DATE",description:"\u5e74\u3001\u6708\u3001\u65e5\u3067\u6307\u5b9a\u3057\u305f\u65e5\u4ed8\u306b\u5bfe\u3059\u308b\u65e5\u4ed8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"year"},{name:"month"},{name:"day"}]},{name:"DATEDIF",description:"\uff12\u3064\u306e\u65e5\u4ed8\u9593\u306e\u65e5\u6570\u3001\u6708\u6570\u3001\u307e\u305f\u306f\u5e74\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"date1"},{name:"date2"},{name:"outputcode"}]},{name:"DATEVALUE",description:"\u6307\u5b9a\u306e\u65e5\u4ed8\u306b\u5bfe\u3059\u308b\u65e5\u6642\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"date_string"}]},{name:"DAVERAGE",description:"\u30ea\u30b9\u30c8\u307e\u305f\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u6307\u5b9a\u306e\uff11\u5217\u306b\u304a\u3044\u3066\u3001\u6307\u5b9a\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u5024\u306e\u5e73\u5747\u5024\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DAY",description:"\u7279\u5b9a\u306e\u65e5\u4ed8\u306b\u5bfe\u5fdc\u3059\u308b\u3001\u6708\u5185\u306e\u65e5\uff081\uff5e31\uff09\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"date"}]},{name:"DAYS360",description:"\uff11\u5e74\u3092 360 \u65e5\uff08\uff11\u6708\u304c 30 \u65e5\uff09\u3068\u307f\u306a\u3057\u3001\uff12\u3064\u306e\u65e5\u4ed8\u9593\u306e\u65e5\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"startdate"},{name:"enddate"},{name:"method"}]},{name:"DB",description:"\u5b9a\u7387\u6cd5\u3092\u4f7f\u7528\u3057\u3066\u3001\u7279\u5b9a\u306e\u671f\u306e\u8cc7\u7523\u306e\u6e1b\u4fa1\u511f\u5374\u8cbb\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"cost"},{name:"salvage"},{name:"life"},{name:"period"},{name:"month"}]},{name:"DCOUNT",description:"\u30ea\u30b9\u30c8\u307e\u305f\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u6307\u5b9a\u306e\uff11\u5217\u306b\u304a\u3044\u3066\u3001\u6307\u5b9a\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u6570\u5024\u3092\u4fdd\u6301\u3059\u308b\u30bb\u30eb\u6570\u3092\u30ab\u30a6\u30f3\u30c8\u3057\u307e\u3059\u3002",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DCOUNTA",description:"\u30ea\u30b9\u30c8\u307e\u305f\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u6307\u5b9a\u306e\uff11\u5217\u306b\u304a\u3044\u3066\u3001\u6307\u5b9a\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u3001\u7a7a\u767d\u4ee5\u5916\u306e\u30bb\u30eb\u6570\u3092\u30ab\u30a6\u30f3\u30c8\u3057\u307e\u3059\u3002",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DDB",description:"\u500d\u7387\u6cd5\u3001\u307e\u305f\u306f\u305d\u306e\u4ed6\u306e\u6307\u5b9a\u306e\u8a08\u7b97\u65b9\u6cd5\u3092\u4f7f\u7528\u3057\u3066\u3001\u7279\u5b9a\u306e\u671f\u306e\u8cc7\u7523\u306e\u6e1b\u4fa1\u511f\u5374\u8cbb\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"cost"},{name:"salvage"},{name:"life"},{name:"period"},{name:"factor"}]},{name:"DEC2BIN",description:"10 \u9032\u6570\u5024\u3092\uff12\u9032\u6570\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"number"},{name:"places"}]},{name:"DEC2HEX",description:"10 \u9032\u6570\u5024\u3092 16 \u9032\u6570\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"number"},{name:"places"}]},{name:"DEC2OCT",description:"10 \u9032\u6570\u5024\u3092\uff18\u9032\u6570\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"number"},{name:"places"}]},{name:"DEGREES",description:"\u6307\u5b9a\u3057\u305f\u30e9\u30b8\u30a2\u30f3\u5358\u4f4d\u306e\u89d2\u5ea6\u306e\u5024\u3092\u5ea6\u5358\u4f4d\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"angle"}]},{name:"DELTA",description:"\uff12\u3064\u306e\u5024\u304c\u7b49\u3057\u3044\u304b\u3069\u3046\u304b\u3092\u8abf\u3079\u307e\u3059\u3002\uff12\u3064\u306e\u5024\u304c\u7b49\u3057\u3051\u308c\u3070\uff11\u3001\u305d\u3046\u3067\u306a\u3051\u308c\u3070\uff10\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2"}]},{name:"DEVSQ",description:"\u5e73\u5747\u5024\u306b\u5bfe\u3059\u308b\u500b\u3005\u306e\u30c7\u30fc\u30bf\u70b9\u306e\u504f\u5dee\u306e\u5e73\u65b9\u548c\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"DGET",description:"\u30ea\u30b9\u30c8\u307e\u305f\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u6307\u5b9a\u306e\uff11\u5217\u306b\u304a\u3044\u3066\u3001\u6307\u5b9a\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\uff11\u3064\u306e\u5024\u3092\u62bd\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DISC",description:"\u8a3c\u5238\u306e\u5272\u5f15\u7387\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"settle"},{name:"mature"},{name:"pricep"},{name:"redeem"},{name:"basis"}]},{name:"DMAX",description:"\u30ea\u30b9\u30c8\u307e\u305f\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u6307\u5b9a\u306e\uff11\u5217\u306b\u304a\u3044\u3066\u3001\u6307\u5b9a\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u6700\u5927\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DMIN",description:"\u30ea\u30b9\u30c8\u307e\u305f\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u6307\u5b9a\u306e\uff11\u5217\u306b\u304a\u3044\u3066\u3001\u6307\u5b9a\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u6700\u5c0f\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DOLLAR",description:"\u6570\u5024\u3092\u6307\u5b9a\u306e\u5c0f\u6570\u4f4d\u306b\u306a\u308b\u3088\u3046\u306b\u56db\u6368\u4e94\u5165\u3057\u3001\u901a\u8ca8\u66f8\u5f0f\u3092\u65bd\u3057\u305f\u6587\u5b57\u5217\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"digits"}]},{name:"DOLLARDE",description:"\u5206\u6570\u8868\u8a18\u3055\u308c\u305f\u30c9\u30eb\u5024\u3092\u3001\u5c0f\u6570\u8868\u8a18\u306e\u30c9\u30eb\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"fractionaldollar"},{name:"fraction"}]},{name:"DOLLARFR",description:"\u5c0f\u6570\u8868\u8a18\u3055\u308c\u305f\u30c9\u30eb\u5024\u3092\u3001\u5206\u6570\u8868\u8a18\u306e\u30c9\u30eb\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"decimaldollar"},{name:"fraction"}]},{name:"DPRODUCT",description:"\u30ea\u30b9\u30c8\u307e\u305f\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u6307\u5b9a\u306e\uff11\u5217\u306b\u304a\u3044\u3066\u3001\u6307\u5b9a\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u5024\u3092\u4e57\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DSTDEV",description:"\u30ea\u30b9\u30c8\u307e\u305f\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u6307\u5b9a\u306e\uff11\u5217\u306b\u304a\u3051\u308b\u3001\u6307\u5b9a\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u6570\u5024\u3092\u6a19\u672c\u3068\u3057\u3066\u4f7f\u7528\u3057\u3066\u3001\u6bcd\u96c6\u56e3\u306e\u6a19\u6e96\u504f\u5dee\u3092\u8a55\u4fa1\u3057\u307e\u3059",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DSTDEVP",description:"\u30ea\u30b9\u30c8\u307e\u305f\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u6307\u5b9a\u306e\uff11\u5217\u306b\u304a\u3051\u308b\u3001\u6307\u5b9a\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u6570\u5024\u3092\u4f7f\u7528\u3057\u3066\u3001\u6bcd\u96c6\u56e3\u5168\u4f53\u306b\u57fa\u3065\u304f\u6a19\u6e96\u504f\u5dee\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DSUM",description:"\u30ea\u30b9\u30c8\u307e\u305f\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u6307\u5b9a\u306e\uff11\u5217\u306b\u304a\u3044\u3066\u3001\u6307\u5b9a\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u6570\u5024\u3092\u52a0\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DURATION",description:"\u984d\u9762\u3092 $100 \u3068\u307f\u306a\u3057\u305f\u8a3c\u5238\u306e\u30de\u30b3\u30fc\u30ec\u30fc \u30c7\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"settlement"},{name:"maturity"},{name:"coupon"},{name:"yield"},{name:"frequency"},{name:"basis"}]},{name:"DVAR",description:"\u30ea\u30b9\u30c8\u307e\u305f\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u6307\u5b9a\u306e\uff11\u5217\u306b\u304a\u3051\u308b\u3001\u6307\u5b9a\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u6570\u5024\u3092\u6a19\u672c\u3068\u3057\u3066\u4f7f\u7528\u3057\u3066\u3001\u6bcd\u96c6\u56e3\u306e\u5206\u6563\u3092\u8a55\u4fa1\u3057\u307e\u3059\u3002",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"DVARP",description:"\u30ea\u30b9\u30c8\u307e\u305f\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u6307\u5b9a\u306e\uff11\u5217\u306b\u304a\u3051\u308b\u3001\u6307\u5b9a\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u6570\u5024\u3092\u4f7f\u7528\u3057\u3066\u3001\u6bcd\u96c6\u56e3\u5168\u4f53\u306b\u57fa\u3065\u304f\u5206\u6563\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"database"},{name:" field"},{name:" criteria"}]},{name:"EDATE",description:"\u6307\u5b9a\u306e\u65e5\u4ed8\u304b\u3089\u3001\u6307\u5b9a\u306e\u6708\u6570\u3060\u3051\u524d\u307e\u305f\u306f\u5f8c\u306e\u65e5\u6642\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"startdate"},{name:"months"}]},{name:"EFFECT",description:"\u6307\u5b9a\u306e\u540d\u76ee\u5e74\u5229\u7387\u3068\uff11\u5e74\u3042\u305f\u308a\u306e\u8907\u5229\u8a08\u7b97\u671f\u9593\u306b\u57fa\u3065\u304d\u3001\u5b9f\u52b9\u5e74\u5229\u7387\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"nomrate"},{name:"comper"}]},{name:"EOMONTH",description:"\u6307\u5b9a\u306e\u65e5\u4ed8\u304b\u3089\u3001\u6307\u5b9a\u306e\u6708\u6570\u3060\u3051\u524d\u307e\u305f\u306f\u5f8c\u306e\u6708\u306e\u6700\u7d42\u65e5\uff08\u6708\u672b\u65e5\uff09\u3068\u306a\u308b\u65e5\u6642\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"startdate"},{name:"months"}]},{name:"ERF",description:"\u4e0a\u9650\u304b\u3089\u4e0b\u9650\u306e\u7bc4\u56f2\u3067\u3001\u8aa4\u5dee\u95a2\u6570\u306e\u7a4d\u5206\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"limit"},{name:"upperlimit"}]},{name:"ERFC",description:"\u4e0b\u9650\u304b\u3089\u7121\u9650\u5927\u306e\u7bc4\u56f2\u3067\u3001\u76f8\u88dc\u8aa4\u5dee\u95a2\u6570\u306e\u7a4d\u5206\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"lowerlimit"}]},{name:"ERROR.TYPE",description:"\u30a8\u30e9\u30fc\u5024\u306b\u5bfe\u5fdc\u3059\u308b\u6570\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002\u30a8\u30e9\u30fc\u304c\u306a\u3044\u5834\u5408\u306f\u3001#N/A \u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"errorvalue"}]},{name:"EURO",description:"ISO \u901a\u8ca8\u30b3\u30fc\u30c9\u306b\u57fa\u3065\u304d\u3001\uff11\u30e6\u30fc\u30ed\u306b\u76f8\u5f53\u3059\u308b\u901a\u8ca8\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"code"}]},{name:"EUROCONVERT",description:"\u30e6\u30fc\u30ed\u52a0\u76df\u56fd\u901a\u8ca8\uff08\u30e6\u30fc\u30ed\u3092\u542b\u3080\uff09\u9593\u3067\u3001\u3042\u308b\u901a\u8ca8\u5024\u3092\u5225\u306e\u901a\u8ca8\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"currency"},{name:"source"},{name:"target"},{name:"fullprecision"},{name:"triangulation"}]},{name:"EVEN",description:"\u6307\u5b9a\u3057\u305f\u5024\u3092\u5207\u308a\u4e0a\u3052\u3001\u6700\u3082\u8fd1\u3044\u5076\u6570\u306e\u6574\u6570\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"EXACT",description:"\uff12\u3064\u306e\u6587\u5b57\u5217\u304c\u7b49\u3057\u3051\u308c\u3070 True \u3092\u3001\u305d\u3046\u3067\u306a\u3051\u308c\u3070 False \u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"text1"},{name:"text2"}]},{name:"EXP",description:"e\uff08\u81ea\u7136\u5bfe\u6570\u306e\u5e95\uff09\u3092\u5e95\u3068\u3059\u308b\u3001\u6307\u5b9a\u306e\u6570\u306e\u3079\u304d\u4e57 (ex) \u3092\u8fd4\u3057\u307e\u3059\u3002EXP \u95a2\u6570\u306f LN \u306e\u9006\u95a2\u6570\u3067\u3059\u3002",parameters:[{name:"value"}]},{name:"EXPONDIST",description:"\u6307\u6570\u5206\u5e03\u95a2\u6570\u307e\u305f\u306f\u78ba\u7387\u5bc6\u5ea6\u95a2\u6570\u306e\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"lambda"},{name:"cumulative"}]},{name:"FACT",description:"\u6307\u5b9a\u3057\u305f\u5024\u306e\u968e\u4e57\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"number"}]},{name:"FACTDOUBLE",description:"\u6570\u5024\u306e\uff12\u4e57\u968e\u4e57\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"number"}]},{name:"FALSE",description:"\u8ad6\u7406\u5024\uff10\uff08False\uff09\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[]},{name:"FDIST",description:"\uff12\u7d44\u306e\u30c7\u30fc\u30bf\u9593\u306e\u5206\u6563\u5ea6\u3092\u6bd4\u8f03\u3059\u308b F \u78ba\u7387\u5206\u5e03\u95a2\u6570\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"degnum"},{name:"degden"}]},{name:"FIND",description:"\u30c6\u30ad\u30b9\u30c8\u5185\u304b\u3089\u6307\u5b9a\u306e\u6587\u5b57\u3092\u691c\u7d22\u3057\u3001\u3053\u306e\u6587\u5b57\u306e\u4f4d\u7f6e\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"findtext"},{name:"intext"},{name:"start"}]},{name:"FINV",description:"F \u78ba\u7387\u5206\u5e03\u95a2\u6570\u306e\u9006\u95a2\u6570\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002p = FDIST(x,...) \u3067\u3042\u308b\u3068\u304d\u3001FINV(p,...) = x \u3068\u306a\u308a\u307e\u3059\u3002",parameters:[{name:"p"},{name:"degnum"},{name:"degden"}]},{name:"FISHER",description:"\u6307\u5b9a\u306e\u5024\u306b\u5bfe\u3059\u308b\u30d5\u30a3\u30c3\u30b7\u30e3\u30fc\u5909\u63db\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"FISHERINV",description:"\u30d5\u30a3\u30c3\u30b7\u30e3\u30fc\u5909\u63db\u306e\u9006\u95a2\u6570\u306e\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"FIXED",description:"\u6570\u5024\u3092\u6307\u5b9a\u306e\u5c0f\u6570\u4f4d\u306b\u306a\u308b\u3088\u3046\u306b\u56db\u6368\u4e94\u5165\u3057\u3001\u30d4\u30ea\u30aa\u30c9\u3068\u30b3\u30f3\u30de\uff08\u6307\u5b9a\u3057\u305f\u5834\u5408\uff09\u306b\u3088\u308b\u5c0f\u6570\u66f8\u5f0f\u3092\u9069\u7528\u3057\u305f\u7d50\u679c\u3092\u30c6\u30ad\u30b9\u30c8\u3068\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"num"},{name:"digits"},{name:"notcomma"}]},{name:"FLOOR",description:"\u6307\u5b9a\u3057\u305f\u57fa\u6e96\u5024\u306e\u500d\u6570\u306b\u306a\u308b\u3088\u3046\u306b\u6570\u5024\u3092\u5207\u308a\u6368\u3066\u3001\u5143\u306e\u5024\u306b\u6700\u3082\u8fd1\u3044\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"signif"}]},{name:"FORECAST",description:"\u65e2\u77e5\u306e\u5024\u3092\u4f7f\u7528\u3057\u3066\u4e88\u6e2c\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"Yarray"},{name:"Xarray"}]},{name:"FREQUENCY",description:"\u6307\u5b9a\u306e\u5024\u7bc4\u56f2\u5185\u3067\u5024\u304c\u51fa\u73fe\u3059\u308b\u983b\u5ea6\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002 \u3053\u306e\u95a2\u6570\u306f\u3001\u6570\u5024\u306e\u5782\u76f4\u914d\u5217\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"dataarray"},{name:"binarray"}]},{name:"FTEST",description:"F \u691c\u5b9a\u306e\u7d50\u679c\u3092\u8fd4\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u3001\uff12\u3064\u306e\u914d\u5217\u5185\u306e\u30c7\u30fc\u30bf\u306e\u5206\u6563\u306b\u6709\u610f\u306a\u5dee\u304c\u8a8d\u3081\u3089\u308c\u306a\u3044\u7247\u5074\u78ba\u7387\u306e\u7b97\u51fa\u7d50\u679c\u3067\u3059\u3002",parameters:[{name:"array1"},{name:"array2"}]},{name:"FV",description:"\u73fe\u5728\u4fa1\u5024\u3001\u5b9a\u671f\u6255\u3044\u3001\u304a\u3088\u3073\u7279\u5b9a\u306e\u5229\u7387\u3092\u6761\u4ef6\u3068\u3057\u3001\u6295\u8cc7\u306e\u5c06\u6765\u4fa1\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"rate"},{name:"numper"},{name:"paymt"},{name:"pval"},{name:"type"}]},{name:"FVSCHEDULE",description:"\u6295\u8cc7\u671f\u9593\u5185\u306e\u4e00\u9023\u306e\u91d1\u5229\u3092\u8907\u5408\u8a08\u7b97\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u521d\u671f\u6295\u8cc7\uff08\u5143\u91d1\uff09\u306e\u5c06\u6765\u4fa1\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"principal"},{name:"schedule"}]},{name:"GAMMADIST",description:"\u30ac\u30f3\u30de\u5206\u5e03\u95a2\u6570\u306e\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"x"},{name:"alpha"},{name:"beta"},{name:"cumulative"}]},{name:"GAMMAINV",description:"\u30ac\u30f3\u30de\u7d2f\u7a4d\u5206\u5e03\u95a2\u6570\u306e\u9006\u95a2\u6570\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002p = GAMMADIST(x,...) \u3067\u3042\u308b\u3068\u304d\u3001GAMMAINV(p,...) = x \u3068\u306a\u308a\u307e\u3059\u3002",parameters:[{name:"p"},{name:"alpha"},{name:"beta"}]},{name:"GAMMALN",description:"\u30ac\u30f3\u30de\u95a2\u6570\u306e\u5024\u306e\u81ea\u7136\u5bfe\u6570 (x) \u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"GCD",description:"\uff12\u3064\u306e\u6570\u5024\u9593\u306e\u6700\u5927\u516c\u7d04\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002\u6700\u5927\u516c\u7d04\u6570\u3068\u306f\u3001\u5bfe\u8c61\u3068\u306a\u308b\u3059\u3079\u3066\u306e\u5024\u3092\u4f59\u308a\u3092\u51fa\u3055\u305a\u306b\u5272\u308a\u5207\u308b\u3053\u3068\u306e\u3067\u304d\u308b\u6700\u5927\u306e\u6574\u6570\u3067\u3059\u3002",parameters:[{name:"number1"},{name:"number2"}]},{name:"GEOMEAN",description:"\u4e00\u7fa4\u306e\u6b63\u6570\u306e\u76f8\u4e57\u5e73\u5747\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"GESTEP",description:"\u6570\u5024\u304c\u3057\u304d\u3044\u5024\u306b\u7b49\u3057\u3044\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002\u6307\u5b9a\u3057\u305f\u6570\u5024\u304c\u3057\u304d\u3044\u5024\u3068\u7b49\u3057\u3044\u304b\u3001\u305d\u308c\u4ee5\u4e0a\u3067\u3042\u308c\u3070\uff11\u3001\u305d\u3046\u3067\u306a\u3044\u5834\u5408\u306f\uff10\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"number"},{name:"step"}]},{name:"GROWTH",description:"\u4e88\u6e2c\u3055\u308c\u308b\u6307\u6570\u66f2\u7dda\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"y"},{name:"x"},{name:"newx"},{name:"constant"}]},{name:"HARMEAN",description:"\u4e00\u7fa4\u306e\u6570\u5024\u306e\u8abf\u548c\u5e73\u5747\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"HEX2BIN",description:"16 \u9032\u6570\u5024\u3092\uff12\u9032\u6570\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"number"},{name:" places"}]},{name:"HEX2DEC",description:"16 \u9032\u6570\u5024\u3092 10 \u9032\u6570\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"number"}]},{name:"HEX2OCT",description:"16 \u9032\u6570\u5024\u3092\uff18\u9032\u6570\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"number"},{name:" places"}]},{name:"HLOOKUP",description:"\u6307\u5b9a\u7bc4\u56f2\u306e\u6700\u4e0a\u884c\u304b\u3089\u5024\u3092\u691c\u7d22\u3057\u3001\u6307\u5b9a\u306e\u884c\u304b\u3089\u3001\u3053\u306e\u5024\u3068\u540c\u3058\u5217\u5185\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"array"},{name:"row"},{name:"approx"}]},{name:"HOUR",description:"\u6307\u5b9a\u306e\u6642\u523b\u5024\u306b\u5bfe\u5fdc\u3059\u308b\u6642\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"time"}]},{name:"HYPGEOMDIST",description:"\u8d85\u5e7e\u4f55\u5206\u5e03\u95a2\u6570\u306e\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"x"},{name:"n"},{name:"M"},{name:"N"}]},{name:"IF",description:"\u8ad6\u7406\u5f0f\u306e\u7d50\u679c\u3092\u8868\u3059\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"valueTest"},{name:"valueTrue"},{name:"valueFalse"}]},{name:"IFERROR",description:"\u6570\u5f0f\u3092\u8a55\u4fa1\u3057\u3001\u30a8\u30e9\u30fc\u306e\u5834\u5408\u306b\u306f\u6307\u5b9a\u3057\u305f\u5024\u3001\u305d\u306e\u4ed6\u306e\u5834\u5408\u306b\u306f\u6570\u5f0f\u306e\u7d50\u679c\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"error"}]},{name:"IMABS",description:"\u8907\u7d20\u6570\u306e\u7d76\u5bfe\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"complexnum"}]},{name:"IMAGINARY",description:"\u8907\u7d20\u6570\u306e\u865a\u6570\u4fc2\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"complexnum"}]},{name:"IMARGUMENT",description:"\u30e9\u30b8\u30a2\u30f3\u5358\u4f4d\u306e\u89d2\u5ea6\u3067\u3042\u308b\u5f15\u6570\u03b8\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"complexnum"}]},{name:"IMCONJUGATE",description:"\u8907\u7d20\u6570\u306e\u8907\u7d20\u5171\u5f79\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"complexnum"}]},{name:"IMCOS",description:"\u8907\u7d20\u6570\u306e\u30b3\u30b5\u30a4\u30f3\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"complexnum"}]},{name:"IMDIV",description:"\uff12\u3064\u306e\u8907\u7d20\u6570\u306e\u5546\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"complexnum"},{name:"complexdenom"}]},{name:"IMEXP",description:"\u8907\u7d20\u6570\u306e\u6307\u6570\u95a2\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"complexnum"}]},{name:"IMLN",description:"\u8907\u7d20\u6570\u306e\u81ea\u7136\u5bfe\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"complexnum"}]},{name:"IMLOG2",description:"\u8907\u7d20\u6570\u306e\uff12\u3092\u5e95\u3068\u3059\u308b\u5bfe\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"complexnum"}]},{name:"IMLOG10",description:"\u8907\u7d20\u6570\u306e\u5e38\u7528\u5bfe\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"complexnum"}]},{name:"IMPOWER",description:"\u8907\u7d20\u6570\u306e\u6574\u6570\u4e57\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"complexnum"},{name:"powernum"}]},{name:"IMPRODUCT",description:'"x+yi" \u307e\u305f\u306f "x+yj" \u5f62\u5f0f\u306e\u30c6\u30ad\u30b9\u30c8\u3067\u6307\u5b9a\u3057\u305f\u3001\u6700\u5927 29 \u500b\u306e\u8907\u7d20\u6570\u306e\u7a4d\u3092\u8fd4\u3057\u307e\u3059\u3002',parameters:[{name:"complexnum1"},{name:"complexnum2",repeatable:!0}]},{name:"IMREAL",description:'"x+yi" \u307e\u305f\u306f "x+yj" \u5f62\u5f0f\u306e\u30c6\u30ad\u30b9\u30c8\u3067\u6307\u5b9a\u3057\u305f\u8907\u7d20\u6570\u306e\u5b9f\u6570\u4fc2\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002',parameters:[{name:"complexnum"}]},{name:"IMSIN",description:'"x+yi" \u307e\u305f\u306f "x+yj" \u5f62\u5f0f\u306e\u30c6\u30ad\u30b9\u30c8\u3067\u6307\u5b9a\u3057\u305f\u8907\u7d20\u6570\u306e\u30b5\u30a4\u30f3\u3092\u8fd4\u3057\u307e\u3059\u3002',parameters:[{name:"complexnum"}]},{name:"IMSQRT",description:'"x+yi" \u307e\u305f\u306f "x+yj" \u5f62\u5f0f\u306e\u30c6\u30ad\u30b9\u30c8\u3067\u6307\u5b9a\u3057\u305f\u8907\u7d20\u6570\u306e\u5e73\u65b9\u6839\u3092\u8fd4\u3057\u307e\u3059\u3002',parameters:[{name:"complexnum"}]},{name:"IMSUB",description:'"x+yi" \u307e\u305f\u306f "x+yj" \u5f62\u5f0f\u306e\u30c6\u30ad\u30b9\u30c8\u3067\u6307\u5b9a\u3057\u305f\uff12\u3064\u306e\u8907\u7d20\u6570\u306e\u5dee\u3092\u8fd4\u3057\u307e\u3059\u3002',parameters:[{name:"complexnum1"},{name:"complexnum2"}]},{name:"IMSUM",description:'x+yi" \u307e\u305f\u306f "x+yj" \u5f62\u5f0f\u306e\u30c6\u30ad\u30b9\u30c8\u3067\u6307\u5b9a\u3057\u305f\uff12\u3064\u4ee5\u4e0a\u306e\u8907\u7d20\u6570\u306e\u5408\u8a08\u3092\u8fd4\u3057\u307e\u3059\u3002',parameters:[{name:"complexnum1"},{name:"complexnum2",repeatable:!0}]},{name:"INDEX",description:"\u914d\u5217\u307e\u305f\u306f\u30bb\u30eb\u7bc4\u56f2\u306e\u4e2d\u304b\u3089\u3001\u7279\u5b9a\u306e\u5024\u307e\u305f\u306f\u5024\u3078\u306e\u53c2\u7167\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"return"},{name:"row"},{name:"col"},{name:"area"}]},{name:"INT",description:"\u6307\u5b9a\u3057\u305f\u5024\u306e\u5c0f\u6570\u90e8\u5206\u3092\u5207\u308a\u6368\u3066\u3001\u6700\u3082\u8fd1\u3044\u6574\u6570\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"INTERCEPT",description:"\u6307\u5b9a\u306e x \u5024\u3068 y \u5024\u3092\u4f7f\u7528\u3057\u3066\u5f97\u305f\u56de\u5e30\u76f4\u7dda\u304c y \u8ef8\u3068\u4ea4\u308f\u308b\u70b9\u3092\u6c42\u3081\u307e\u3059\u3002",parameters:[{name:"dependent"},{name:"independent"}]},{name:"INTRATE",description:"\u5168\u984d\u6295\u8cc7\u3055\u308c\u305f\u8a3c\u5238\u306e\u5229\u7387\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"settle"},{name:"mature"},{name:"invest"},{name:"redeem"},{name:"basis"}]},{name:"IPMT",description:"\u501f\u5165\u91d1\u8fd4\u6e08\u306b\u304a\u3044\u3066\u3001\u652f\u6255\u3046\u3079\u304d\u91d1\u5229\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"rate"},{name:"per"},{name:"nper"},{name:"pval"},{name:"fval"},{name:"type"}]},{name:"IRR",description:"\u4e00\u9023\u306e\u5b9a\u671f\u7684\u306a\u30ad\u30e3\u30c3\u30b7\u30e5\u30d5\u30ed\u30fc\uff08values \u5f15\u6570\u306e\u914d\u5217\u5024\u3067\u6307\u5b9a\uff09\u306b\u57fa\u3065\u304d\u3001\u5185\u90e8\u5229\u76ca\u7387\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"arrayvals"},{name:"estimate"}]},{name:"ISBLANK",description:"\u30bb\u30eb\u306a\u3069\u306e\u5024\u304c\u7a7a\u767d\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002",parameters:[{name:"cellreference"}]},{name:"ISERR",description:"\u30bb\u30eb\u306a\u3069\u306e\u5024\u304c\u3001#N/A\uff08\u5229\u7528\u4e0d\u53ef\uff09\u4ee5\u5916\u306e\u30a8\u30e9\u30fc\u5024\u3092\u53c2\u7167\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002",parameters:[{name:"cellreference"}]},{name:"ISERROR",description:"\u30bb\u30eb\u306a\u3069\u306e\u5024\u304c\u3001\u4efb\u610f\u306e\u30a8\u30e9\u30fc\u5024\u3092\u53c2\u7167\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002",parameters:[{name:"cellreference"}]},{name:"ISEVEN",description:"\u30bb\u30eb\u306a\u3069\u306e\u5024\u304c\u5076\u6570\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002",parameters:[{name:"cellreference"}]},{name:"ISLOGICAL",description:"\u30bb\u30eb\u306a\u3069\u306e\u5024\u304c\u8ad6\u7406\u5024\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002",parameters:[{name:"cellreference"}]},{name:"ISNA",description:"\u30bb\u30eb\u306a\u3069\u306e\u5024\u304c\u3001\u30a8\u30e9\u30fc\u5024 #N/A\uff08\u5229\u7528\u4e0d\u53ef\uff09\u3092\u53c2\u7167\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002",parameters:[{name:"cellreference"}]},{name:"ISNONTEXT",description:"\u30bb\u30eb\u306a\u3069\u306e\u5024\u304c\u3001\u30c6\u30ad\u30b9\u30c8\u4ee5\u5916\u306e\u30c7\u30fc\u30bf\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002",parameters:[{name:"cellreference"}]},{name:"ISNUMBER",description:"\u30bb\u30eb\u306a\u3069\u306e\u5024\u304c\u6570\u5024\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002",parameters:[{name:"cellreference"}]},{name:"ISODD",description:"\u30bb\u30eb\u306a\u3069\u306e\u5024\u304c\u5947\u6570\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002",parameters:[{name:"cellreference"}]},{name:"ISPMT",description:"\u6307\u5b9a\u306e\u6295\u8cc7\u671f\u9593\u306b\u652f\u6255\u308f\u308c\u308b\u91d1\u5229\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"rate"},{name:"per"},{name:"nper"},{name:"pv"}]},{name:"ISREF",description:"\u30bb\u30eb\u306a\u3069\u306e\u5024\u304c\u3001\u4ed6\u306e\u30bb\u30eb\u3078\u306e\u53c2\u7167\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002",parameters:[{name:"cellreference"}]},{name:"ISTEXT",description:"\u30bb\u30eb\u306a\u3069\u306e\u5024\u304c\u6587\u5b57\u5217\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002",parameters:[{name:"cellreference"}]},{name:"KURT",description:"\u30c7\u30fc\u30bf\u96c6\u5408\u306e\u5c16\u5ea6\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2"},{name:"value3"},{name:"value4",repeatable:!0}]},{name:"LARGE",description:"\u30c7\u30fc\u30bf\u96c6\u5408\u5185\u3067 n \u756a\u76ee\u306b\u5927\u304d\u3044\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array"},{name:"n"}]},{name:"LCM",description:"\u6307\u5b9a\u3057\u305f\u6574\u6570\u306e\u6700\u5c0f\u516c\u500d\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"number1"},{name:"number2"}]},{name:"LEFT",description:"\u30c6\u30ad\u30b9\u30c8\u5024\u304b\u3089\u5148\u982d\uff08\u5de6\u7aef\uff09\u306e\u6587\u5b57\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"mytext"},{name:"num_chars"}]},{name:"LEN",description:"\u30c6\u30ad\u30b9\u30c8\u306e\u6587\u5b57\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"LINEST",description:"\u76f4\u7dda\u306b\u57fa\u3065\u304f\u7d71\u8a08\u5024\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"y"},{name:"x"},{name:"constant"},{name:"stats"}]},{name:"LN",description:"\u6307\u5b9a\u3057\u305f\u6570\u306e\u81ea\u7136\u5bfe\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002LN \u306f EXP \u306e\u9006\u95a2\u6570\u3067\u3059\u3002",parameters:[{name:"value"}]},{name:"LOG",description:"Y \u3092\u5e95\u3068\u3059\u308b\u6570\u5024 X \u306e\u5bfe\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"number"},{name:"base"}]},{name:"LOG10",description:"10 \u3092\u5e95\u3068\u3059\u308b\u6570\u5024 X \u306e\u5bfe\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"LOGEST",description:"\u30c7\u30fc\u30bf\u306b\u9069\u5408\u3059\u308b\u6307\u6570\u66f2\u7dda\u3092\u8a08\u7b97\u3057\u3001\u3053\u306e\u66f2\u7dda\u3092\u8868\u3059\u5024\u306e\u914d\u5217\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"y"},{name:"x"},{name:"constant"},{name:"stats"}]},{name:"LOGINV",description:"x \u306e\u5bfe\u6570\u6b63\u898f\u7d2f\u7a4d\u5206\u5e03\u95a2\u6570\u306e\u9006\u95a2\u6570\u306e\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"prob"},{name:"mean"},{name:"stdev"}]},{name:"LOGNORMDIST",description:"x \u306e\u5bfe\u6570\u6b63\u898f\u7d2f\u7a4d\u5206\u5e03\u95a2\u6570\u306e\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"x"},{name:"mean"},{name:"stdev"}]},{name:"LOOKUP",description:"\uff11\u884c\u307e\u305f\u306f\uff11\u5217\u5185\u306e\u30bb\u30eb\u7bc4\u56f2\u3001\u307e\u305f\u306f\u914d\u5217\u304b\u3089\u5024\u3092\u691c\u7d22\u3057\u307e\u3059\u3002",parameters:[{name:"lookupvalue"},{name:"lookupvector"},{name:"resultvector"}]},{name:"LOWER",description:"\u30c6\u30ad\u30b9\u30c8\u3092\u5c0f\u6587\u5b57\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"string"}]},{name:"MATCH",description:"\u6307\u5b9a\u3055\u308c\u305f\u9805\u76ee\u306e\u7bc4\u56f2\u5185\u306b\u304a\u3051\u308b\u76f8\u5bfe\u4f4d\u7f6e\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"array"},{name:"type"}]},{name:"MAX",description:"\u5f15\u6570\u30ea\u30b9\u30c8\u306e\u4e2d\u304b\u3089\u6700\u5927\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"MAXA",description:"\u5f15\u6570\u30ea\u30b9\u30c8\u306e\u4e2d\u304b\u3089\u6700\u5927\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"MDETERM",description:"\u914d\u5217\u306e\u884c\u5217\u5f0f\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array"}]},{name:"MDURATION",description:"\u984d\u9762\u3092 $100 \u3068\u307f\u306a\u3057\u305f\u8a3c\u5238\u306e\u4fee\u6b63\u30de\u30b3\u30fc\u30ec\u30fc \u30c7\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"settlement"},{name:"maturity"},{name:"coupon"},{name:"yield"},{name:"frequency"},{name:"basis"}]},{name:"MEDIAN",description:"\u6307\u5b9a\u3057\u305f\u4e00\u7fa4\u306e\u6570\u5024\u306e\u4e2d\u304b\u3089\u30e1\u30b8\u30a2\u30f3\uff08\u4e2d\u592e\u5024\uff09\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"MID",description:"\u30c6\u30ad\u30b9\u30c8\u5185\u306e\u6307\u5b9a\u4f4d\u7f6e\u304b\u3089\u3001\u6307\u5b9a\u3057\u305f\u6570\u306e\u6587\u5b57\u3092\u53d6\u308a\u51fa\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"text"},{name:"start_num"},{name:"num_chars"}]},{name:"MIN",description:"\u5f15\u6570\u30ea\u30b9\u30c8\u306e\u4e2d\u304b\u3089\u6700\u5c0f\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"MINA",description:"\u5f15\u6570\u30ea\u30b9\u30c8\u306e\u4e2d\u304b\u3089\u6700\u5c0f\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"MINUTE",description:"\u5f15\u6570\u30ea\u30b9\u30c8\u306e\u4e2d\u304b\u3089\u6700\u5c0f\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"time"}]},{name:"MINVERSE",description:"\u914d\u5217\u306b\u6307\u5b9a\u3057\u305f\u884c\u5217\u306e\u9006\u884c\u5217\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array"}]},{name:"MIRR",description:"\u4e00\u9023\u306e\u5b9a\u671f\u7684\u306a\u30ad\u30e3\u30c3\u30b7\u30e5\u30d5\u30ed\u30fc\u306b\u57fa\u3065\u304d\u3001\u4fee\u6b63\u5185\u90e8\u5229\u76ca\u7387\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"arrayvals"},{name:"payment_int"},{name:"income_int"}]},{name:"MMULT",description:"\uff12\u3064\u306e\u914d\u5217\u306b\u6307\u5b9a\u3057\u305f\u884c\u5217\u306e\u7a4d\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array1"},{name:"array2"}]},{name:"MOD",description:"number \u5f15\u6570\uff08\u88ab\u9664\u6570\uff09\u3092 divisor \u5f15\u6570\uff08\u9664\u6570\uff09\u3067\u5272\u3063\u305f\u3068\u304d\u306e\u5270\u4f59\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"dividend"},{name:"divisor"}]},{name:"MODE",description:"\u6307\u5b9a\u306e\u5f15\u6570\u30ea\u30b9\u30c8\u306e\u4e2d\u3067\u3001\u6700\u3082\u983b\u7e41\u306b\u51fa\u73fe\u3059\u308b\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"MONTH",description:"\u6307\u5b9a\u306e\u65e5\u4ed8\u5024\u306b\u5bfe\u5fdc\u3059\u308b\u6708\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"date"}]},{name:"MROUND",description:"\u6307\u5b9a\u306e\u500d\u6570\u3068\u306a\u308b\u3088\u3046\u306b\u4e38\u3081\u305f\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"number"},{name:"multiple"}]},{name:"MULTINOMIAL",description:"\u6307\u5b9a\u3055\u308c\u305f\u5f15\u6570\u30ea\u30b9\u30c8\u306e\u591a\u9805\u4fc2\u6570\uff08\u30ea\u30b9\u30c8\u5185\u306e\u5024\u306e\u548c\u306e\u968e\u4e57\u3068\u3001\u5404\u5024\u306e\u968e\u4e57\u306e\u7a4d\u3068\u306e\u6bd4\uff09\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"N",description:"\u6570\u5024\u306b\u5909\u63db\u3057\u305f\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"NA",description:"\u300c\u5229\u7528\u4e0d\u53ef\u300d\u3092\u610f\u5473\u3059\u308b\u30a8\u30e9\u30fc\u5024 #N/A \u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[]},{name:"NEGBINOMDIST",description:"\u8ca0\u306e\u4e8c\u9805\u5206\u5e03\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"x"},{name:"r"},{name:"p"}]},{name:"NETWORKDAYS",description:"\u958b\u59cb\u65e5\u304b\u3089\u7d42\u4e86\u65e5\u307e\u3067\u306e\u671f\u9593\u5185\u3067\u3001\u5b8c\u5168\u306a\u7a3c\u50cd\u65e5\u306e\u5408\u8a08\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"startdate"},{name:"enddate"},{name:"holidays"}]},{name:"NOMINAL",description:"\u6307\u5b9a\u306e\u5b9f\u52b9\u5229\u7387\u3068\uff11\u5e74\u3042\u305f\u308a\u306e\u8907\u5229\u8a08\u7b97\u671f\u9593\u306b\u57fa\u3065\u304d\u3001\u540d\u76ee\u4e0a\u306e\u5e74\u5229\u7387\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"effrate"},{name:"comper"}]},{name:"NORMDIST",description:"\u6307\u5b9a\u306e\u5e73\u5747\u3068\u6a19\u6e96\u504f\u5dee\u306b\u5bfe\u3059\u308b\u6b63\u898f\u7d2f\u7a4d\u5206\u5e03\u95a2\u6570\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"x"},{name:"mean"},{name:"stdev"},{name:"cumulative"}]},{name:"NORMINV",description:"\u6307\u5b9a\u306e\u5e73\u5747\u3068\u6a19\u6e96\u504f\u5dee\u306b\u5bfe\u3059\u308b\u6b63\u898f\u7d2f\u7a4d\u5206\u5e03\u95a2\u6570\u306e\u9006\u95a2\u6570\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"prob"},{name:"mean"},{name:"stdev"}]},{name:"NORMSDIST",description:"\u6a19\u6e96\u6b63\u898f\u7d2f\u7a4d\u5206\u5e03\u95a2\u6570\u306e\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"NORMSINV",description:"\u6a19\u6e96\u6b63\u898f\u7d2f\u7a4d\u5206\u5e03\u95a2\u6570\u306e\u9006\u95a2\u6570\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002\u3053\u306e\u5206\u5e03\u3067\u306f\u3001\u5e73\u5747\u304c\uff10\u3001\u6a19\u6e96\u504f\u5dee\u304c\uff11\u3068\u306a\u308a\u307e\u3059\u3002",parameters:[{name:"prob"}]},{name:"NOT",description:"\u5f15\u6570\u306e\u8ad6\u7406\u5024\u3092\u9006\u306b\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"NOW",description:"\u73fe\u5728\u306e\u65e5\u4ed8\u3068\u6642\u523b\u3092\u8868\u3059\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[]},{name:"NPER",description:"\u73fe\u884c\u4fa1\u5024\u3001\u5c06\u6765\u4fa1\u5024\u3001\u5b9a\u671f\u6255\u3044\u3001\u304a\u3088\u3073\u7279\u5b9a\u306e\u5229\u7387\u3092\u6761\u4ef6\u3068\u3057\u3001\u6295\u8cc7\u306b\u5fc5\u8981\u306a\u671f\u9593\uff08\u652f\u6255\u56de\u6570\uff09\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"rate"},{name:"paymt"},{name:"pval"},{name:"fval"},{name:"type"}]},{name:"NPV",description:"\u5272\u5f15\u7387\u3068\u3001\u5c06\u6765\u884c\u308f\u308c\u308b\u4e00\u9023\u306e\u652f\u6255\u3044\u304a\u3088\u3073\u305d\u306e\u53ce\u76ca\u306b\u57fa\u3065\u3044\u3066\u3001\u6295\u8cc7\u306e\u6b63\u5473\u73fe\u5728\u4fa1\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"discount"},{name:"value1"},{name:"value2",repeatable:!0}]},{name:"OCT2BIN",description:"\uff18\u9032\u6570\u5024\u3092\uff12\u9032\u6570\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"number"},{name:"places"}]},{name:"OCT2DEC",description:"\uff18\u9032\u6570\u5024\u3092 10 \u9032\u6570\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"number"}]},{name:"OCT2HEX",description:"\uff18\u9032\u6570\u5024\u3092 16 \u9032\u6570\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"number"},{name:"places"}]},{name:"ODD",description:"\u6307\u5b9a\u3057\u305f\u5024\u3092\u5207\u308a\u4e0a\u3052\u3001\u6700\u3082\u8fd1\u3044\u5947\u6570\u306e\u6574\u6570\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"ODDFPRICE",description:"\uff11\u671f\u76ee\u306e\u65e5\u6570\u304c\u534a\u7aef\u306a\u8a3c\u5238\u306b\u5bfe\u3057\u3001\u984d\u9762 $100 \u3042\u305f\u308a\u306e\u4fa1\u683c\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"settle"},{name:"maturity"},{name:"issue"},{name:"first"},{name:"rate"},{name:"yield"},{name:"redeem"},{name:"freq"},{name:"basis"}]},{name:"ODDFYIELD",description:"\uff11\u671f\u76ee\u306e\u65e5\u6570\u304c\u534a\u7aef\u306a\u8a3c\u5238\u306e\u5229\u56de\u308a\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"settle"},{name:"maturity"},{name:"issue"},{name:"first"},{name:"rate"},{name:"price"},{name:"redeem"},{name:"freq"},{name:"basis"}]},{name:"ODDLPRICE",description:"\u6700\u7d42\u671f\u306e\u65e5\u6570\u304c\u534a\u7aef\u306a\u8a3c\u5238\u306b\u5bfe\u3057\u3001\u984d\u9762 $100 \u3042\u305f\u308a\u306e\u4fa1\u683c\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"settle"},{name:"maturity"},{name:"last"},{name:"rate"},{name:"yield"},{name:"redeem"},{name:"freq"},{name:"basis"}]},{name:"ODDLYIELD",description:"\u6700\u7d42\u671f\u306e\u65e5\u6570\u304c\u534a\u7aef\u306a\u8a3c\u5238\u306e\u5229\u56de\u308a\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"settle"},{name:"maturity"},{name:"last"},{name:"rate"},{name:"price"},{name:"redeem"},{name:"freq"},{name:"basis"}]},{name:"OFFSET",description:"\u3053\u306e\u95a2\u6570\u306f\u3001\u30bb\u30eb\u7bc4\u56f2\u3078\u306e\u53c2\u7167\u3092\u8fd4\u3057\u307e\u3059\u3002 \u8fd4\u3055\u308c\u308b\u30bb\u30eb\u7bc4\u56f2\u306f\u3001\u5358\u4e00\u306e\u30bb\u30eb\u307e\u305f\u306f\u30bb\u30eb\u7bc4\u56f2\u304b\u3089\u306e\u884c\u6570\u3068\u5217\u6570\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002 \u3053\u308c\u306b\u3088\u308a\u3001\u5358\u4e00\u306e\u30bb\u30eb\u307e\u305f\u306f\u30bb\u30eb\u7bc4\u56f2\u304c\u8fd4\u3055\u308c\u307e\u3059\u3002",parameters:[{name:"reference"},{name:"rows"},{name:"cols"},{name:"height"},{name:"width"}]},{name:"OR",description:"\u3044\u305a\u308c\u304b\u306e\u5f15\u6570\u304c\u771f\u3067\u3042\u308c\u3070\uff11\uff08True\uff09\u3092\u3001\u3059\u3079\u3066\u306e\u5f15\u6570\u304c\u507d\u3067\u3042\u308c\u3070\uff10\uff08False\uff09\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"argument1"},{name:"argument2..."}]},{name:"PEARSON",description:"\u30d4\u30a2\u30bd\u30f3\u306e\u7a4d\u7387\u76f8\u95a2\u4fc2\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002\u3053\u308c\u306f -1.0\uff5e1.0 \u306e\u7bc4\u56f2\u306e\u6570\u5024\u3067\u3042\u308a\u3001\uff12\u7d44\u306e\u30c7\u30fc\u30bf\u9593\u3067\u306e\u7dda\u5f62\u76f8\u95a2\u306e\u7a0b\u5ea6\u3092\u793a\u3057\u307e\u3059\u3002",parameters:[{name:"array_ind"},{name:"array_dep"}]},{name:"PERCENTILE",description:"\u3042\u308b\u7bc4\u56f2\u5185\u306e\u5024\u306e\u4e2d\u3067 n \u756a\u76ee\u306e\u767e\u5206\u4f4d\u3092\u6301\u3064\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array"},{name:"n"}]},{name:"PERCENTRANK",description:"\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e\u5024\u306e\u9806\u4f4d\u3092\u3001\u3053\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e\u767e\u5206\u7387\u3068\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array"},{name:"n"},{name:"sigdig"}]},{name:"PERMUT",description:"\u6307\u5b9a\u3057\u305f\u6570\u306e\u6a19\u672c\u3092\u629c\u304d\u53d6\u308b\u969b\u306e\u3001\u6709\u52b9\u306a\u9806\u5217\u306e\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"k"},{name:"n"}]},{name:"PI",description:"\u5186\u5468\u7387\uff08\u03c0\uff09\u3092 3.1415926536 \u3068\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002",parameters:[]},{name:"PMT",description:"\u73fe\u5728\u4fa1\u5024\u3001\u6307\u5b9a\u306e\u5229\u7387\u3001\u304a\u3088\u3073\u652f\u6255\u56de\u6570\u306b\u57fa\u3065\u304d\u3001\u501f\u5165\u91d1\u8fd4\u6e08\u3067\u306e\u5b9a\u671f\u652f\u6255\u984d\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"rate"},{name:"nper"},{name:"pval"},{name:"fval"},{name:"type"}]},{name:"POISSON",description:"\u30dd\u30a2\u30bd\u30f3\u78ba\u7387\u5206\u5e03\u306e\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"nevents"},{name:"mean"},{name:"cumulative"}]},{name:"POWER",description:"\u6307\u5b9a\u306e\u6570\uff08X\uff09\u3092\u5e95\u3068\u3059\u308b\u6307\u6570\uff08Y\uff09\u306e\u3079\u304d\u4e57\u3092\u6c42\u3081\u307e\u3059\u3002",parameters:[{name:"number"},{name:"power"}]},{name:"PPMT",description:"\u5143\u91d1\u306e\u8fd4\u6e08\u984d\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"rate"},{name:"per"},{name:"nper"},{name:"pval"},{name:"fval"},{name:"type"}]},{name:"PRICE",description:"\u5b9a\u671f\u7684\u306b\u5229\u606f\u304c\u652f\u6255\u308f\u308c\u308b\u8a3c\u5238\u306b\u5bfe\u3057\u3001\u984d\u9762 $100 \u3042\u305f\u308a\u306e\u4fa1\u683c\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"settlement"},{name:"maturity"},{name:"rate"},{name:"yield"},{name:"redeem"},{name:"frequency"},{name:"basis"}]},{name:"PRICEDISC",description:"\u5272\u5f15\u50b5\u306e\u984d\u9762 $100 \u3042\u305f\u308a\u306e\u4fa1\u683c\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"settle"},{name:"mature"},{name:"discount"},{name:"redeem"},{name:"basis"}]},{name:"PRICEMAT",description:"\u6e80\u671f\u65e5\u306b\u5229\u606f\u304c\u6255\u308f\u308c\u308b\u8a3c\u5238\u306b\u5bfe\u3057\u3001\u984d\u9762 $100 \u3042\u305f\u308a\u306e\u4fa1\u683c\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"settle"},{name:"mature"},{name:"issue"},{name:"rate"},{name:"yield"},{name:"basis"}]},{name:"PROB",description:"\u7279\u5b9a\u7bc4\u56f2\u5185\u306e\u5024\u304c\u4e0a\u9650\u3068\u4e0b\u9650\u306e\u9593\u306b\u53ce\u307e\u308b\u78ba\u7387\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array"},{name:"probs"},{name:"lower"},{name:"upper"}]},{name:"PRODUCT",description:"\u3059\u3079\u3066\u306e\u5f15\u6570\u5024\u3092\u4e57\u7b97\u3057\u3066\u5f97\u305f\u7a4d\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"PV",description:"\u7279\u5b9a\u306e\u5229\u7387\u3001\u5b9a\u671f\u6255\u3044\u306e\u56de\u6570\u3068\u652f\u6255\u984d\u3001\u304a\u3088\u3073\u5c06\u6765\u4fa1\u5024\u3092\u6761\u4ef6\u3068\u3057\u3066\u3001\u6295\u8cc7\u306e\u73fe\u5728\u4fa1\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"rate"},{name:"numper"},{name:"paymt"},{name:"fval"},{name:"type"}]},{name:"QUARTILE",description:"\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u304b\u3089\u3001\u6307\u5b9a\u3057\u305f\u56db\u5206\u4f4d\u6570\uff08\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e 1/4\uff3b25%\uff3d\uff09\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array"},{name:"quart"}]},{name:"QUOTIENT",description:"\u9664\u7b97\u3067\u5f97\u305f\u5546\u306e\u6574\u6570\u90e8\u5206\u3092\u8fd4\u3057\u307e\u3059\u3002QUOTIENT \u95a2\u6570\u306f\u3001\u5546\u306e\u4f59\u308a\uff08\u5270\u4f59\uff09\u3092\u7121\u8996\u3057\u305f\u3044\u5834\u5408\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002",parameters:[{name:"numerator"},{name:"denominator"}]},{name:"RADIANS",description:"\u5ea6\u5358\u4f4d\u306e\u89d2\u5ea6\u306e\u5024\u3092\u30e9\u30b8\u30a2\u30f3\u5358\u4f4d\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"RADIANS",description:"\u5ea6\u5358\u4f4d\u306e\u89d2\u5ea6\u306e\u5024\u3092\u30e9\u30b8\u30a2\u30f3\u5358\u4f4d\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"RAND",description:"\u5206\u5e03\u304c\u4e00\u69d8\u306a\u30010\u4ee5\u4e0a1\u672a\u6e80\u306e\u4e71\u6570\u3092\u767a\u751f\u3055\u305b\u307e\u3059\u3002RAND \u95a2\u6570\u306f\u3001\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u304c\u518d\u8a08\u7b97\u3055\u308c\u308b\u305f\u3073\u306b\u65b0\u305f\u306a\u4e71\u6570\u3092\u767a\u751f\u3055\u305b\u307e\u3059\u3002",parameters:[]},{name:"RANDBETWEEN",description:"\u6307\u5b9a\u3057\u305f\uff12\u3064\u306e\u6570\u5024\u9593\u306e\u7bc4\u56f2\u3067\u4e71\u6570\u3092\u767a\u751f\u3055\u305b\u307e\u3059\u3002RANDBETWEEN \u95a2\u6570\u306f\u3001\u30b7\u30fc\u30c8\u304c\u518d\u8a08\u7b97\u3055\u308c\u308b\u305f\u3073\u306b\u65b0\u305f\u306b\u4e71\u6570\u3092\u767a\u751f\u3055\u305b\u307e\u3059\u3002",parameters:[{name:"lower"},{name:"upper"}]},{name:"RANK",description:"\u6570\u5024\u30ea\u30b9\u30c8\u306e\u4e2d\u304b\u3089\u3001\u6307\u5b9a\u306e\u6570\u5024\u304c\u4f55\u756a\u76ee\u306b\u4f4d\u7f6e\u3059\u308b\u304b\u3092\u8fd4\u3057\u307e\u3059\u3002RANK \u95a2\u6570\u306e\u8fd4\u3059\u9806\u4f4d\u306f\u3001\u30ea\u30b9\u30c8\u5185\u306e\u6570\u5024\u3092\u4e26\u3079\u66ff\u3048\u305f\u5834\u5408\u306e\u6570\u5024\u306e\u9806\u4f4d\u3068\u306a\u308a\u307e\u3059\u3002",parameters:[{name:"number"},{name:"array"},{name:"order"}]},{name:"RATE",description:"\u6295\u8cc7\u671f\u9593\u3092\u901a\u3058\u305f\u5229\u7387\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"nper"},{name:"pmt"},{name:"pval"},{name:"fval"},{name:"type"},{name:"guess"}]},{name:"RECEIVED",description:"\u5168\u984d\u6295\u8cc7\u3055\u308c\u305f\u8a3c\u5238\u306b\u5bfe\u3057\u3066\u3001\u6e80\u671f\u306b\u652f\u6255\u308f\u308c\u308b\u91d1\u984d\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"settle"},{name:"mature"},{name:"invest"},{name:"discount"},{name:"basis"}]},{name:"REPLACE",description:"\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u5225\u306e\u6587\u5b57\u5217\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002",parameters:[{name:"old_text"},{name:"start_char"},{name:"num_chars"},{name:"new_text"}]},{name:"REPT",description:"\u6587\u5b57\u5217\u3092\u6307\u5b9a\u306e\u56de\u6570\u5206\u3001\u7e70\u308a\u8fd4\u3057\u8868\u793a\u3057\u307e\u3059\u3002",parameters:[{name:"text"},{name:"number"}]},{name:"RIGHT",description:"\u30c6\u30ad\u30b9\u30c8\u5024\u304b\u3089\u53f3\u7aef\u306e\u6587\u5b57\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"text"},{name:"num_chars"}]},{name:"ROMAN",description:"\u30a2\u30e9\u30d3\u30a2\u6570\u5b57\u3092\u3001\u30ed\u30fc\u30de\u6570\u5b57\u3092\u8868\u3059\u30c6\u30ad\u30b9\u30c8\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"number"},{name:"style"}]},{name:"ROUND",description:"\u6307\u5b9a\u306e\u6570\u5024\u3092\u3001\u6307\u5b9a\u306e\u6841\u6570\u306b\u306a\u308b\u3088\u3046\u306b\u56db\u6368\u4e94\u5165\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"places"}]},{name:"ROUNDDOWN",description:"\u6307\u5b9a\u306e\u6570\u5024\u3092\u3001\u6307\u5b9a\u306e\u6841\u6570\u306b\u306a\u308b\u3088\u3046\u306b\u5207\u308a\u6368\u3066\u307e\u3059\u3002",parameters:[{name:"value"},{name:"places"}]},{name:"ROUNDUP",description:"\u6307\u5b9a\u306e\u6570\u5024\u3092\u3001\u6307\u5b9a\u306e\u6841\u6570\u306b\u306a\u308b\u3088\u3046\u306b\u5207\u308a\u4e0a\u3052\u307e\u3059\u3002",parameters:[{name:"value"},{name:"places"}]},{name:"ROW",description:"\u53c2\u7167\u306e\u884c\u756a\u53f7\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"reference"}]},{name:"ROWS",description:"\u914d\u5217\u5185\u306e\u884c\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array"}]},{name:"RSQ",description:"\u65e2\u77e5\u306e x \u3068\u65e2\u77e5\u306e Y \u3092\u901a\u904e\u3059\u308b\u56de\u5e30\u76f4\u7dda\u306e\u30c7\u30fc\u30bf\u70b9\u3092\u4f7f\u7528\u3057\u3066\u3001\u30d4\u30a2\u30bd\u30f3\u7a4d\u7387\u76f8\u95a2\u4fc2\u6570\u306e\u4e8c\u4e57\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array_dep"},{name:"array_ind"}]},{name:"SEARCH",description:"\u30c6\u30ad\u30b9\u30c8\u5185\u304b\u3089\u6307\u5b9a\u306e\u6587\u5b57\u3092\u691c\u7d22\u3057\u3001\u30c6\u30ad\u30b9\u30c8\u5185\u306b\u304a\u3051\u308b\u3053\u306e\u6587\u5b57\u306e\u958b\u59cb\u4f4d\u7f6e\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"string1"},{name:"string2"}]},{name:"SECOND",description:"\u6307\u5b9a\u306e\u6642\u523b\u5024\u306b\u5bfe\u5fdc\u3059\u308b\u79d2\u306e\u5024\uff080\uff5e59\uff09\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"time"}]},{name:"SERIESSUM",description:"\u3079\u304d\u7d1a\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"x"},{name:"n"},{name:"m"},{name:"coeff"}]},{name:"SIGN",description:"\u6570\u5024\u306e\u7b26\u53f7\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"cellreference"}]},{name:"SIN",description:"\u6307\u5b9a\u3057\u305f\u89d2\u5ea6\u306e\u30b5\u30a4\u30f3\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"angle"}]},{name:"SINH",description:"\u6307\u5b9a\u3057\u305f\u6570\u5024\u306e\u30cf\u30a4\u30d1\u30fc\u30dc\u30ea\u30c3\u30af\u30b5\u30a4\u30f3\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"SKEW",description:"\u5206\u5e03\u306e\u6b6a\u5ea6\uff08\u5e73\u5747\u5024\u304b\u3089\u306e\u30c7\u30fc\u30bf\u306e\u504f\u308a\uff09\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"number1"},{name:"number2",repeatable:!0}]},{name:"SLN",description:"\u5b9a\u984d\u6cd5\u3092\u4f7f\u7528\u3057\u3066\u3001\uff11\u671f\u3042\u305f\u308a\u306e\u8cc7\u7523\u306e\u6e1b\u4fa1\u511f\u5374\u8cbb\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"cost"},{name:"salvage"},{name:"life"}]},{name:"SLOPE",description:"\u56de\u5e30\u76f4\u7dda\u306e\u50be\u304d\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"array_dep"},{name:"array_ind"}]},{name:"SMALL",description:"\u30c7\u30fc\u30bf\u96c6\u5408\u5185\u3067 n \u756a\u76ee\u306b\u5c0f\u3055\u3044\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array"},{name:"n"}]},{name:"SQRT",description:"\u6307\u5b9a\u3057\u305f\u6570\u5024\u306e\u6b63\u306e\u5e73\u65b9\u6839\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"SQRTPI",description:"\u6307\u5b9a\u306e\u6570\u5024\u3092\u5186\u5468\u7387\u306b\u639b\u3051\u305f\u5024\u306e\u6b63\u306e\u5e73\u65b9\u6839\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"multiple"}]},{name:"STANDARDIZE",description:"\u7279\u5b9a\u306e\u5e73\u5747\u5024\u3068\u6a19\u6e96\u504f\u5dee\u3067\u6c7a\u5b9a\u3055\u308c\u308b\u5206\u5e03\u3092\u6a19\u6e96\u5316\u3059\u308b\u305f\u3081\u306e\u5909\u91cf\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"x"},{name:"mean"},{name:"stdev"}]},{name:"STDEVA",description:"\u6307\u5b9a\u3057\u305f\u6570\u5024\u306e\u96c6\u5408\u304b\u3089\u6a19\u6e96\u504f\u5dee\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"STDEVP",description:"\u5f15\u6570\u3068\u3057\u3066\u6307\u5b9a\u3057\u305f\u6bcd\u96c6\u56e3\u5168\u4f53\u306e\u6a19\u6e96\u504f\u5dee\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"STDEVPA",description:"\u5f15\u6570\u3068\u3057\u3066\u6307\u5b9a\u3057\u305f\u6bcd\u96c6\u56e3\u5168\u4f53\u306e\u6a19\u6e96\u504f\u5dee\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"STEYX",description:"\u500b\u5225\u306e x \u306b\u5bfe\u3059\u308b y \u306e\u4e88\u6e2c\u5024\u306e\u6a19\u6e96\u8aa4\u5dee\u3092\u8fd4\u3057\u307e\u3059\u3002\u6a19\u6e96\u8aa4\u5dee\u3068\u306f\u3001x \u5024\u306b\u5bfe\u3057\u3066\u4e88\u6e2c\u3055\u308c\u308b y \u5024\u306e\u8aa4\u5dee\u306e\u91cf\u3092\u8868\u3059\u6307\u6a19\u3067\u3059\u3002",parameters:[{name:"array_dep"},{name:"array_ind"}]},{name:"SUBSTITUTE",description:"\u65e2\u5b58\u6587\u5b57\u5217\u5185\u306e\u6307\u5b9a\u306e\u6587\u5b57\u3092\u3001\u65b0\u898f\u6587\u5b57\u5217\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002",parameters:[{name:"text"},{name:"old_piece"},{name:"new_piece"},{name:"instance"}]},{name:"SUBTOTAL",description:"\u5c0f\u8a08\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"functioncode"},{name:"value1"},{name:"value2",repeatable:!0}]},{name:"SUM",description:"\u30bb\u30eb\u307e\u305f\u306f\u30bb\u30eb\u30d6\u30ed\u30c3\u30af\u306e\u548c\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"SUMIF",description:"\u6307\u5b9a\u306e\u57fa\u6e96\u306b\u57fa\u3065\u304d\u3001\u30bb\u30eb\u5024\u3092\u5408\u8a08\u3057\u307e\u3059\u3002",parameters:[{name:"array"},{name:"condition"},{name:"sumrange"}]},{name:"SUMIFS",description:"\u8907\u6570\u306e\u57fa\u6e96\u306b\u57fa\u3065\u304d\u3001\u30bb\u30eb\u5024\u3092\u5408\u8a08\u3057\u307e\u3059\u3002",parameters:[{name:"array"},{name:"conditionarray"},{name:"condition",repeatable:!0}]},{name:"SUMPRODUCT",description:"\u6307\u5b9a\u306e\u914d\u5217\u5185\u306e\u5bfe\u5fdc\u3059\u308b\u8981\u7d20\u306e\u7a4d\u3092\u7b97\u51fa\u3057\u3001\u3053\u308c\u3089\u306e\u7a4d\u306e\u5408\u8a08\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array1"},{name:"array2",repeatable:!0}]},{name:"SUMSQ",description:"\u5f15\u6570\u306b\u6307\u5b9a\u3057\u305f\u5024\u306e\uff12\u4e57\u306e\u5408\u8a08\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"SUMX2MY2",description:"\uff12\u3064\u306e\u914d\u5217\u5185\u306e\u5bfe\u5fdc\u3059\u308b\u8981\u7d20\u306e\u5e73\u65b9\u5dee\u3092\u5408\u8a08\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array_x"},{name:"array_y"}]},{name:"SUMX2PY2",description:"\uff12\u3064\u306e\u914d\u5217\u5185\u306e\u5bfe\u5fdc\u3059\u308b\u8981\u7d20\u306e\u5e73\u65b9\u548c\u3092\u5408\u8a08\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array_x"},{name:"array_y"}]},{name:"SUMXMY2",description:"\uff12\u3064\u306e\u914d\u5217\u5185\u306e\u5bfe\u5fdc\u3059\u308b\u8981\u7d20\u306e\u5dee\u3092\uff12\u4e57\u3057\u3066\u5408\u8a08\u3057\u307e\u3059\u3002",parameters:[{name:"array_x"},{name:"array_y"}]},{name:"SYD",description:"\u5b9a\u984d\u9013\u6e1b\u6cd5\u3092\u4f7f\u7528\u3057\u3066\u3001\u7279\u5b9a\u671f\u9593\u306e\u8cc7\u7523\u306e\u6e1b\u4fa1\u511f\u5374\u8cbb\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"cost"},{name:"salvage"},{name:"life"},{name:"period"}]},{name:"T",description:"\u30bb\u30eb\u5185\u306b\u30c6\u30ad\u30b9\u30c8\u304c\u4fdd\u6301\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306b\u3053\u306e\u30c6\u30ad\u30b9\u30c8\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"TAN",description:"\u6307\u5b9a\u3057\u305f\u89d2\u5ea6\u306e\u30bf\u30f3\u30b8\u30a7\u30f3\u30c8\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"angle"}]},{name:"TANH",description:"\u6307\u5b9a\u3057\u305f\u6570\u5024\u306e\u30cf\u30a4\u30d1\u30fc\u30dc\u30ea\u30c3\u30af\u30bf\u30f3\u30b8\u30a7\u30f3\u30c8\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"TBILLEQ",description:"\u7c73\u56fd\u8ca1\u52d9\u7701\u77ed\u671f\u8a3c\u5238\uff08TB\uff09\u306e\u50b5\u5238\u306b\u76f8\u5f53\u3059\u308b\u5229\u56de\u308a\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"settle"},{name:"mature"},{name:"discount"}]},{name:"TBILLPRICE",description:"\u7c73\u56fd\u8ca1\u52d9\u7701\u77ed\u671f\u8a3c\u5238\uff08TB\uff09\u306e\u984d\u9762 $100 \u3042\u305f\u308a\u306e\u4fa1\u683c\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"settle"},{name:"mature"},{name:"discount"}]},{name:"TBILLYIELD",description:"\u7c73\u56fd\u8ca1\u52d9\u7701\u77ed\u671f\u8a3c\u5238\uff08TB\uff09\u306e\u5229\u56de\u308a\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"settle"},{name:"mature"},{name:"priceper"}]},{name:"TDIST",description:"t \u5206\u5e03\u306e\u78ba\u7387\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"x"},{name:"deg"},{name:"tails"}]},{name:"TEXT",description:"\u6570\u5024\u3092\u66f8\u5f0f\u8a2d\u5b9a\u3057\u3001\u30c6\u30ad\u30b9\u30c8\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"text"}]},{name:"TIME",description:"\u6307\u5b9a\u306e\u6642\u9593\u306b\u5bfe\u3059\u308b DateTime \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"hour"},{name:"minutes"},{name:"seconds"}]},{name:"TIMEVALUE",description:"\u6587\u5b57\u5217\u3067\u8868\u3055\u308c\u308b\u6642\u523b\u306b\u5bfe\u5fdc\u3059\u308b\u6642\u9593\u9593\u9694\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"time_string"}]},{name:"TINV",description:"\u30b9\u30c1\u30e5\u30fc\u30c7\u30f3\u30c8\u306e t \u5206\u5e03\u306e\u5024\u3092\u3001\u78ba\u7387\u3068\u81ea\u7531\u5ea6\u3092\u4f7f\u7528\u3057\u305f\u95a2\u6570\u3068\u3057\u3066\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"prog"},{name:"deg"}]},{name:"TODAY",description:"\u73fe\u5728\u306e\u65e5\u4ed8\u3092\u8868\u3059\u9023\u7d9a\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[]},{name:"TRANSPOSE",description:"\u6c34\u5e73\u30bb\u30eb\u7bc4\u56f2\u3092\u5782\u76f4\u30bb\u30eb\u7bc4\u56f2\u3068\u3057\u3066\u8fd4\u3057\u3001\u5782\u76f4\u30bb\u30eb\u7bc4\u56f2\u3092\u6c34\u5e73\u30bb\u30eb\u7bc4\u56f2\u3068\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array"}]},{name:"TREND",description:"\u56de\u5e30\u76f4\u7dda\u306b\u5bfe\u3057\u3066\u4e88\u6e2c\u3055\u308c\u308b\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"y"},{name:"x"},{name:"newx"},{name:"constant"}]},{name:"TRIM",description:"\u6587\u5b57\u5217\u304b\u3089\u4f59\u5206\u306a\u30b9\u30da\u30fc\u30b9\u3092\u524a\u9664\u3057\u3001\u5358\u8a9e\u9593\u306b\uff11\u6587\u5b57\u5206\u306e\u30b9\u30da\u30fc\u30b9\u3092\u4fdd\u3061\u307e\u3059\u3002",parameters:[{name:"text"}]},{name:"TRIMMEAN",description:"\u4e0a\u4f4d\u304a\u3088\u3073\u4e0b\u4f4d\u306e\u30c7\u30fc\u30bf\u3092\u9664\u5916\u3057\u305f\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e\u4e2d\u9593\u30c7\u30fc\u30bf\u306e\u5e73\u5747\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"array"},{name:"percent"}]},{name:"TRUE",description:"\u8ad6\u7406\u5024\uff11\uff08True\uff09\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[]},{name:"TRUNC",description:"\u30b9\u30c1\u30e5\u30fc\u30c7\u30f3\u30c8\u306e t \u691c\u5b9a\u306b\u95a2\u9023\u3059\u308b\u78ba\u7387\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"precision"}]},{name:"TTEST",description:"\u30b9\u30c1\u30e5\u30fc\u30c7\u30f3\u30c8\u306e t \u691c\u5b9a\u306b\u95a2\u9023\u3059\u308b\u78ba\u7387\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array1"},{name:"array2"},{name:"tails"},{name:"type"}]},{name:"TYPE",description:"\u5024\u306e\u30c7\u30fc\u30bf\u578b\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"}]},{name:"UPPER",description:"\u30c6\u30ad\u30b9\u30c8\u3092\u5927\u6587\u5b57\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"string"}]},{name:"VALUE",description:"\u6570\u5024\u3092\u8868\u3059\u6587\u5b57\u5217\u3092\u6570\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002",parameters:[{name:"text"}]},{name:"VAR",description:"\u5f15\u6570\u5024\u3092\u6bcd\u96c6\u56e3\u306e\u6a19\u672c\u3068\u307f\u306a\u3057\u3001\u6bcd\u96c6\u56e3\u306e\u5206\u6563\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"VARA",description:"\u5f15\u6570\u5024\u3092\u6bcd\u96c6\u56e3\u306e\u6a19\u672c\u3068\u307f\u306a\u3057\u3001\u6bcd\u96c6\u56e3\u306e\u5206\u6563\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"VARP",description:"\u6bcd\u96c6\u56e3\u5168\u4f53\u306e\u5206\u6563\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"VARPA",description:"\u6bcd\u96c6\u56e3\u5168\u4f53\u306e\u5206\u6563\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"value1"},{name:"value2",repeatable:!0}]},{name:"VDB",description:"\u500d\u7387\u6cd5\u3092\u4f7f\u7528\u3057\u3066\u3001\u6307\u5b9a\u3057\u305f\u4efb\u610f\u306e\u671f\u9593\u306b\u304a\u3051\u308b\u8cc7\u7523\u306e\u6e1b\u4fa1\u511f\u5374\u8cbb\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002",parameters:[{name:"cost"},{name:"salvage"},{name:"life"},{name:"start"},{name:"end"},{name:"factor"},{name:"switchnot"}]},{name:"VLOOKUP",description:"\u6307\u5b9a\u7bc4\u56f2\u306e\u6700\u5de6\u5217\u304b\u3089\u5024\u3092\u691c\u7d22\u3057\u3001\u6307\u5b9a\u306e\u5217\u304b\u3089\u3001\u3053\u306e\u5024\u3068\u540c\u3058\u884c\u5185\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"value"},{name:"array"},{name:"colindex"},{name:"approx"}]},{name:"WEEKDAY",description:"\u6307\u5b9a\u306e\u65e5\u4ed8\u306b\u5bfe\u5fdc\u3059\u308b\u66dc\u65e5\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"date"},{name:"type"}]},{name:"WEEKNUM",description:"\u6307\u5b9a\u306e\u65e5\u4ed8\u304c\u305d\u306e\u5e74\u306e\u4f55\u9031\u76ee\u306b\u5f53\u305f\u308b\u304b\u3092\u8868\u3059\u6570\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"date"},{name:"weektype"}]},{name:"WEIBULL",description:"\uff12\u3064\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308b\u30ef\u30a4\u30d6\u30eb\u5206\u5e03\u306e\u5024\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u4fe1\u983c\u6027\u306e\u5206\u6790\u306a\u3069\u306b\u3088\u304f\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002",parameters:[{name:"x"},{name:"alpha"},{name:"beta"},{name:"cumulative"}]},{name:"WORKDAY",description:"\u958b\u59cb\u65e5\u3088\u308a\u6307\u5b9a\u306e\u65e5\u6570\u5206\u4ee5\u524d\u307e\u305f\u306f\u4ee5\u964d\u306e\u7a3c\u50cd\u65e5\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"startdate"},{name:"numdays"},{name:"holidays"}]},{name:"XIRR",description:"\u4e88\u5b9a\u3055\u308c\u3066\u3044\u308b\u30ad\u30e3\u30c3\u30b7\u30e5\u30d5\u30ed\u30fc\uff08\u5b9a\u671f\u7684\u3001\u307e\u305f\u306f\u4e0d\u5b9a\u671f\uff09\u306b\u57fa\u3065\u304d\u3001\u5185\u90e8\u5229\u76ca\u7387\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"values"},{name:"dates"},{name:"guess"}]},{name:"XNPV",description:"\u4e88\u5b9a\u3055\u308c\u3066\u3044\u308b\u30ad\u30e3\u30c3\u30b7\u30e5\u30d5\u30ed\u30fc\uff08\u5b9a\u671f\u7684\u3001\u307e\u305f\u306f\u4e0d\u5b9a\u671f\uff09\u306b\u57fa\u3065\u304d\u3001\u6b63\u5473\u73fe\u5728\u4fa1\u5024\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"rate"},{name:"values"},{name:"dates"}]},{name:"YEAR",description:"\u6307\u5b9a\u306e\u65e5\u4ed8\u306b\u5bfe\u5fdc\u3059\u308b\u5e74\u3092\u8868\u3059\u6574\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"date"}]},{name:"YEARFRAC",description:"\u958b\u59cb\u65e5\u304b\u3089\u7d42\u4e86\u65e5\u307e\u3067\u306e\u671f\u9593\u5185\u306e\u5b8c\u5168\u306a\u65e5\u6570\u304c\u3001\uff11\u5e74\u306e\u3069\u308c\u3060\u3051\u3092\u5360\u3081\u308b\u304b\u3092\u8868\u3059\u5272\u5408\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"startdate"},{name:"enddate"},{name:"basis"}]},{name:"YIELD",description:"\u5b9a\u671f\u7684\u306b\u5229\u606f\u304c\u652f\u6255\u308f\u308c\u308b\u8a3c\u5238\u306e\u5229\u56de\u308a\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"settle"},{name:"maturity"},{name:"rate"},{name:"price"},{name:"redeem"},{name:"frequency"},{name:"basis"}]},{name:"YIELDDISC",description:"\u5272\u5f15\u50b5\u306e\u5e74\u5229\u56de\u308a\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"settle"},{name:"maturity"},{name:"price"},{name:"redeem"},{name:"basis"}]},{name:"YIELDMAT",description:"\u6e80\u671f\u306b\u5229\u606f\u304c\u652f\u6255\u308f\u308c\u308b\u8a3c\u5238\u306e\u5e74\u5229\u56de\u308a\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002",parameters:[{name:"settle"},{name:"maturity"},{name:"issue"},{name:"issrate"},{name:"price"},{name:"basis"}]},{name:"ZTEST",description:"z \u691c\u5b9a\u306e\u6709\u610f\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002z \u691c\u5b9a\u3067\u306f\u3001\u4e00\u7fa4\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3059\u308b\u691c\u5b9a\u5024 x \u306e\u6a19\u6e96\u30b9\u30b3\u30a2\u3092\u751f\u6210\u3057\u3001\u6b63\u898f\u5206\u5e03\u306e\u4e21\u5074\u306e\u78ba\u7387\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002",parameters:[{name:"array"},{name:"x"},{name:"sigma"}]},{name:"PIESPARKLINE",description:"\u5186\u30b9\u30d1\u30fc\u30af\u30e9\u30a4\u30f3\u3092\u8868\u793a\u3059\u308b\u70ba\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u8fd4\u3057\u307e\u3059",parameters:[{name:"range|percentage"},{name:"color",repeatable:!0}]},{name:"AREASPARKLINE",description:"\u9762\u30b9\u30d1\u30fc\u30af\u30e9\u30a4\u30f3\u3092\u8868\u793a\u3059\u308b\u70ba\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u8fd4\u3057\u307e\u3059",parameters:[{name:"points"},{name:"mini"},{name:"maxi"},{name:"line1"},{name:"line2"},{name:"colorPositive"},{name:"colorNegative"}]},{name:"SCATTERSPARKLINE",description:"\u6563\u5e03\u56f3\u30b9\u30d1\u30fc\u30af\u30e9\u30a4\u30f3\u3092\u8868\u793a\u3059\u308b\u70ba\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u8fd4\u3057\u307e\u3059",parameters:[{name:"points1"},{name:"points2"},{name:"minX"},{name:"maxX"},{name:"minY"},{name:"maxY"},{name:"hLine"},{name:"vLine"},{name:"xMinZone"},{name:"xMaxZone"},{name:"yMinZone"},{name:"yMaxZone"},{name:"tags"},{name:"drawSymbol"},{name:"drawLines"},{name:"color1"},{name:"color2"},{name:"dash"}]},{name:"LINESPARKLINE",description:"\u6298\u308c\u7dda\u30b9\u30d1\u30fc\u30af\u30e9\u30a4\u30f3\u3092\u8868\u793a\u3059\u308b\u70ba\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u8fd4\u3057\u307e\u3059",parameters:[{name:"data"},{name:"dataOrientation"},{name:"dateAxisData"},{name:"dateAxisOrientation"},{name:"setting"}]},{name:"COLUMNSPARKLINE",description:"\u7e26\u68d2\u30b9\u30d1\u30fc\u30af\u30e9\u30a4\u30f3\u3092\u8868\u793a\u3059\u308b\u70ba\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u8fd4\u3057\u307e\u3059",parameters:[{name:"data"},{name:"dataOrientation"},{name:"dateAxisData"},{name:"dateAxisOrientation"},{name:"setting"}]},{name:"WINLOSSSPARKLINE",description:"\u52dd\u6557\u30b9\u30d1\u30fc\u30af\u30e9\u30a4\u30f3\u3092\u8868\u793a\u3059\u308b\u70ba\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u8fd4\u3057\u307e\u3059",parameters:[{name:"data"},{name:"dataOrientation"},{name:"dateAxisData"},{name:"dateAxisOrientation"},{name:"setting"}]}],n}();n.FormulaTextBoxResource_JP=i})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}))