text: /** 
   * Kendo UI v2016.1.226 (http://www.telerik.com/kendo-ui)                                                                                                                                               
   * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
   *                                                                                                                                                                                                      
   * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
   * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
   * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                         
                                                                                                                                                                                                         
                                                                                                                                                                                                         
                                                                                                                                                                                                         
                                                                                                                                                                                                         
                                                                                                                                                                                                         
                                                                                                                                                                                                         
                                                                                                                                                                                                         
                                                                                                                                                                                                         
                                                                                                                                                                                                         
                                                                                                                                                                                                         
                                                                                                                                                                                                         
                                                                                                                                                                                                         
                                                                                                                                                                                                         
                                                                                                                                                                                                         
  
  */
  !function(e,define){define("util/undoredostack.min",["kendo.core.min"],e)}(function(){!function(e){var t=e.Observable.extend({init:function(t){e.Observable.fn.init.call(this,t),this.clear()},events:["undo","redo"],push:function(e){this.stack=this.stack.slice(0,this.currentCommandIndex+1),this.currentCommandIndex=this.stack.push(e)-1},undo:function(){if(this.canUndo()){var e=this.stack[this.currentCommandIndex--];e.undo(),this.trigger("undo",{command:e})}},redo:function(){if(this.canRedo()){var e=this.stack[++this.currentCommandIndex];e.redo(),this.trigger("redo",{command:e})}},clear:function(){this.stack=[],this.currentCommandIndex=-1},canUndo:function(){return this.currentCommandIndex>=0},canRedo:function(){return this.currentCommandIndex!=this.stack.length-1}});e.deepExtend(e,{util:{UndoRedoStack:t}})}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("util/main.min",["kendo.core.min"],e)}(function(){return function(){function e(e){return typeof e!==P}function t(e,t){var i=n(t);return T.round(e*i)/i}function n(e){return e?T.pow(10,e):1}function i(e,t,n){return T.max(T.min(e,n),t)}function r(e){return e*N}function o(e){return e/N}function s(e){return"number"==typeof e&&!isNaN(e)}function a(t,n){return e(t)?t:n}function l(e){return e*e}function u(e){var t,n=[];for(t in e)n.push(t+e[t]);return n.sort().join("")}function c(e){var t,n=2166136261;for(t=0;e.length>t;++t)n+=(n<<1)+(n<<4)+(n<<7)+(n<<8)+(n<<24),n^=e.charCodeAt(t);return n>>>0}function h(e){return c(u(e))}function d(e){var t,n=e.length,i=I,r=z;for(t=0;n>t;t++)r=T.max(r,e[t]),i=T.min(i,e[t]);return{min:i,max:r}}function f(e){return d(e).min}function p(e){return d(e).max}function m(e){return v(e).min}function g(e){return v(e).max}function v(e){var t,n,i,r=I,o=z;for(t=0,n=e.length;n>t;t++)i=e[t],null!==i&&isFinite(i)&&(r=T.min(r,i),o=T.max(o,i));return{min:r===I?void 0:r,max:o===z?void 0:o}}function b(e){return e?e[e.length-1]:void 0}function w(e,t){return e.push.apply(e,t),e}function y(e){return B.template(e,{useWithBlock:!1,paramName:"d"})}function _(t,n){return e(n)&&null!==n?" "+t+"='"+n+"' ":""}function x(e){var t,n="";for(t=0;e.length>t;t++)n+=_(e[t][0],e[t][1]);return n}function k(t){var n,i,r="";for(n=0;t.length>n;n++)i=t[n][1],e(i)&&(r+=t[n][0]+":"+i+";");return""!==r?r:void 0}function C(e){return"string"!=typeof e&&(e+="px"),e}function F(e){var t,n,i=[];if(e)for(t=B.toHyphens(e).split("-"),n=0;t.length>n;n++)i.push("k-pos-"+t[n]);return i.join(" ")}function R(t){return""===t||null===t||"none"===t||"transparent"===t||!e(t)}function S(e){for(var t={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"},n=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],i="";e>0;)n[0]>e?n.shift():(i+=t[n[0]],e-=n[0]);return i}function A(e){var t,n,i,r,o;for(e=e.toLowerCase(),t={i:1,v:5,x:10,l:50,c:100,d:500,m:1e3},n=0,i=0,r=0;e.length>r;++r){if(o=t[e.charAt(r)],!o)return null;n+=o,o>i&&(n-=2*i),i=o}return n}function M(e){var t=Object.create(null);return function(){var n,i="";for(n=arguments.length;--n>=0;)i+=":"+arguments[n];return i in t?t[i]:e.apply(this,arguments)}}function E(e){for(var t,n,i=[],r=0,o=e.length;o>r;)t=e.charCodeAt(r++),t>=55296&&56319>=t&&o>r?(n=e.charCodeAt(r++),56320==(64512&n)?i.push(((1023&t)<<10)+(1023&n)+65536):(i.push(t),r--)):i.push(t);return i}function D(e){return e.map(function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)}).join("")}var T=Math,B=window.kendo,L=B.deepExtend,N=T.PI/180,I=Number.MAX_VALUE,z=-Number.MAX_VALUE,P="undefined",$=Date.now;$||($=function(){return(new Date).getTime()}),L(B,{util:{MAX_NUM:I,MIN_NUM:z,append:w,arrayLimits:d,arrayMin:f,arrayMax:p,defined:e,deg:o,hashKey:c,hashObject:h,isNumber:s,isTransparent:R,last:b,limitValue:i,now:$,objectKey:u,round:t,rad:r,renderAttr:_,renderAllAttr:x,renderPos:F,renderSize:C,renderStyle:k,renderTemplate:y,sparseArrayLimits:v,sparseArrayMin:m,sparseArrayMax:g,sqr:l,valueOrDefault:a,romanToArabic:A,arabicToRoman:S,memoize:M,ucs2encode:D,ucs2decode:E}}),B.drawing.util=B.util,B.dataviz.util=B.util}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("util/text-metrics.min",["kendo.core.min","util/main.min"],e)}(function(){!function(e){function t(){return{width:0,height:0,baseline:0}}function n(e,t,n){return h.current.measure(e,t,n)}function i(e,t){var n=[];if(e.length>0&&document.fonts){try{n=e.map(function(e){return document.fonts.load(e)})}catch(i){o.logToConsole(i)}Promise.all(n).then(t,t)}else t()}var r=document,o=window.kendo,s=o.Class,a=o.util,l=a.defined,u=s.extend({init:function(e){this._size=e,this._length=0,this._map={}},put:function(e,t){var n=this,i=n._map,r={key:e,value:t};i[e]=r,n._head?(n._tail.newer=r,r.older=n._tail,n._tail=r):n._head=n._tail=r,n._length>=n._size?(i[n._head.key]=null,n._head=n._head.newer,n._head.older=null):n._length++},get:function(e){var t=this,n=t._map[e];return n?(n===t._head&&n!==t._tail&&(t._head=n.newer,t._head.older=null),n!==t._tail&&(n.older&&(n.older.newer=n.newer,n.newer.older=n.older),n.older=t._tail,n.newer=null,t._tail.newer=n,t._tail=n),n.value):void 0}}),c=e("<div style='position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space: nowrap!important;' />")[0],h=s.extend({init:function(e){this._cache=new u(1e3),this._initOptions(e)},options:{baselineMarkerSize:1},measure:function(n,i,o){var s,u,h,d,f,p,m,g;if(!n)return t();if(s=a.objectKey(i),u=a.hashKey(n+s),h=this._cache.get(u),h)return h;d=t(),f=o?o:c,p=this._baselineMarker().cloneNode(!1);for(m in i)g=i[m],l(g)&&(f.style[m]=g);return e(f).text(n),f.appendChild(p),r.body.appendChild(f),(n+"").length&&(d.width=f.offsetWidth-this.options.baselineMarkerSize,d.height=f.offsetHeight,d.baseline=p.offsetTop+this.options.baselineMarkerSize),d.width>0&&d.height>0&&this._cache.put(u,d),f.parentNode.removeChild(f),d},_baselineMarker:function(){return e("<div class='k-baseline-marker' style='display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;' />")[0]}});h.current=new h,o.util.TextMetrics=h,o.util.LRUCache=u,o.util.loadFonts=i,o.util.measureText=n}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("util/parse-xml.min",["kendo.core.min","util/main.min"],e)}(function(){"use strict";function e(e){var t,n=[];for(t=0;e.length>t;++t)n.push(e.charCodeAt(t));return n}function t(e,t){t>65535?(t-=65536,e.push(t>>>10&1023|55296,56320|1023&t)):e.push(t)}function n(e,n){function C(n){var i=e[W++];240&i^240?224&i^224?192&i^192?n.push(i):t(n,(31&i)<<6|63&e[W++]):t(n,(15&i)<<12|(63&e[W++])<<6|63&e[W++]):t(n,(3&i)<<18|(63&e[W++])<<12|(63&e[W++])<<6|63&e[W++])}function F(e){throw Error(e+", at "+W)}function R(t){for(var n=[];e.length>W&&t(e[W]);)n.push(e[W++]);return n}function S(e){return i.apply(0,R(e))}function A(){R(D)}function M(t){var n,i=W;for(n=0;t.length>n;++n)if(e[W++]!=t[n])return W=i,!1;return t}function E(e){M(e)||F("Expecting "+e.join(", "))}function D(e){return 9==e||10==e||13==e||32==e}function T(e){return e>=48&&57>=e}function B(e){return e>=48&&57>=e||(e|=32)>=97&&102>=e}function L(e){return 58==e||95==e||(e|=32)>=97&&122>=e}function N(e){return 45==e||T(e)||L(e)}function I(){for(var t=[];e.length>W;){if(M(a))return j("comment",i.apply(0,t));C(t)}}function z(){var e,t;M(d)?V():M(l)?I():(e=$(),t=U(e),q.push(t),M(u)?j("enter",e,t,!0):(E(p),j("enter",e,t),P(e),e!=$()&&F("Bad closing tag"),j("leave",e,t),A(),E(p)),q.pop())}function P(t){for(var n=[];e.length>W;){if(M(c))return n.length&&j("text",i.apply(0,n));if(M(o))for(;e.length>W&&!M(s);)C(n);else M(f)?(n.length&&j("text",i.apply(0,n)),z(),n=[]):M(v)?O(n):C(n)}F("Unclosed tag "+t)}function $(){return L(e[W])||F("Expecting XML name"),S(N)}function H(){var t,n=M(b)||M(w);for(n||F("Expecting string"),t=[];e.length>W;){if(M(n))return i.apply(0,t);M(v)?O(t):C(t)}F("Unfinished string")}function O(e){var n,i;M(y)?(n=M(_)||M(x)?parseInt(S(B),16):parseInt(S(T),10),isNaN(n)&&F("Bad numeric entity")):(i=$(),n=r[i],void 0===n&&F("Unknown entity "+i)),t(e,n),E(m)}function V(){j("decl",$(),U()),E(h)}function U(t){for(var n,i={$tag:t};e.length>W&&(A(),n=e[W],63!=n&&62!=n&&47!=n);)i[$()]=(E(g),H());return i}function j(e,t,i,r){var o=n&&n[e];o&&o.call(J,t,i,r)}var W=0,q=[],J={is:function(e){for(var t=q.length,n=e.length;--t>=0&&--n>=0;)if(q[t].$tag!=e[n]&&"*"!=e[n])return!1;return 0>n?q[q.length-1]:null},exit:function(){throw k},stack:q},K=[];for(C(K),65279!=K[0]&&(W=0);e.length>W;)A(),E(f),z(),A()}var i=String.fromCharCode,r={amp:38,lt:60,gt:62,quot:34,nbsp:160},o=e("<![CDATA["),s=e("]]>"),a=e("-->"),l=e("!--"),u=e("/>"),c=e("</"),h=e("?>"),d=e("?"),f=e("<"),p=e(">"),m=e(";"),g=e("="),v=e("&"),b=e('"'),w=e("'"),y=e("#"),_=e("x"),x=e("X"),k={};kendo.util.parseXML=function(){try{return n.apply(this,arguments)}catch(e){if(e!==k)throw e}}},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("util/base64.min",["util/main.min"],e)}(function(){return function(){function e(e){var n,i,r,s,a,l,u,c="",h=0;for(e=t(e);e.length>h;)n=e.charCodeAt(h++),i=e.charCodeAt(h++),r=e.charCodeAt(h++),s=n>>2,a=(3&n)<<4|i>>4,l=(15&i)<<2|r>>6,u=63&r,isNaN(i)?l=u=64:isNaN(r)&&(u=64),c=c+o.charAt(s)+o.charAt(a)+o.charAt(l)+o.charAt(u);return c}function t(e){var t,n,i="";for(t=0;e.length>t;t++)n=e.charCodeAt(t),128>n?i+=r(n):2048>n?(i+=r(192|n>>>6),i+=r(128|63&n)):65536>n&&(i+=r(224|n>>>12),i+=r(128|n>>>6&63),i+=r(128|63&n));return i}var n=window.kendo,i=n.deepExtend,r=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i(n.util,{encodeBase64:e,encodeUTF8:t})}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("mixins/observers.min",["kendo.core.min"],e)}(function(){return function(e){var t=Math,n=window.kendo,i=n.deepExtend,r=e.inArray,o={observers:function(){return this._observers=this._observers||[]},addObserver:function(e){return this._observers?this._observers.push(e):this._observers=[e],this},removeObserver:function(e){var t=this.observers(),n=r(e,t);return-1!=n&&t.splice(n,1),this},trigger:function(e,t){var n,i,r=this._observers;if(r&&!this._suspended)for(i=0;r.length>i;i++)n=r[i],n[e]&&n[e](t);return this},optionsChange:function(e){this.trigger("optionsChange",e)},geometryChange:function(e){this.trigger("geometryChange",e)},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=t.max((this._suspended||0)-1,0),this},_observerField:function(e,t){this[e]&&this[e].removeObserver(this),this[e]=t,t.addObserver(this)}};i(n,{mixins:{ObserversMixin:o}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/commands.min",["kendo.core.min","kendo.binder.min","kendo.window.min","kendo.list.min","kendo.tabstrip.min"],e)}(function(){!function(e){var t,n,i,r,o,s;e.support.browser.msie&&9>e.support.browser.version||(t=e.jQuery,n=e.spreadsheet.Command=e.Class.extend({init:function(e){this.options=e,this._workbook=e.workbook,this._property=e&&e.property,this._state={}},range:function(e){return void 0!==e&&(this._range=e),this._range},redo:function(){this.exec()},undo:function(){this.range().setState(this._state)},getState:function(){this._state=this.range().getState(this._property)},_forEachCell:function(e){var t=this.range(),n=t._ref;n.forEach(function(n){t.sheet().forEach(n.toRangeRef(),e.bind(this))}.bind(this))}}),i=e.spreadsheet.PropertyChangeCommand=n.extend({init:function(e){n.fn.init.call(this,e),this._value=e.value},exec:function(){var e=this.range();this.getState(),e[this._property](this._value)}}),e.spreadsheet.ClearContentCommand=n.extend({exec:function(){this.getState(),this.range().clearContent()}}),e.spreadsheet.EditCommand=i.extend({init:function(e){e.property="input",i.fn.init.call(this,e)},rejectState:function(e){return this.undo(),{title:e.title,body:e.message,reason:"error",type:"validationError"}},exec:function(){var t,n=this.range(),i=this._value;this.getState();try{if(n.input(i),t=n._getValidationState())return this.rejectState(t)}catch(r){if(!(r instanceof e.spreadsheet.calc.ParseError))throw r;try{if(n.input(i+")"),t=n._getValidationState())return this.rejectState(t)}catch(o){if(o instanceof e.spreadsheet.calc.ParseError)return n.input("'"+i),{title:"Error in formula",body:r+"",reason:"error"}}}}}),e.spreadsheet.TextWrapCommand=i.extend({init:function(e){e.property="wrap",i.fn.init.call(this,e),this._value=e.value},getState:function(){var e={};this.range().forEachRow(function(t){var n=t.topLeft().row;e[n]=t.sheet().rowHeight(n)}),this._state=this.range().getState(this._property),this._rowHeight=e},undo:function(){var e,t=this.range().sheet(),n=this._rowHeight;this.range().setState(this._state);for(e in n)t.rowHeight(e,n[e])}}),e.spreadsheet.AdjustDecimalsCommand=n.extend({init:function(e){this._decimals=e.value,e.property="format",n.fn.init.call(this,e)},exec:function(){var t=this.range().sheet(),n=this._decimals,i=e.spreadsheet.formatting;this.getState(),t.batch(function(){this.range().forEachCell(function(e,r,o){var s=o.format;(s||n>0)&&(s=i.adjustDecimals(s||"#",n),t.range(e,r).format(s))})}.bind(this))}}),e.spreadsheet.BorderChangeCommand=n.extend({init:function(e){e.property="border",n.fn.init.call(this,e),this._type=e.border,this._style=e.style},exec:function(){this.getState(),this[this._type](this._style)},noBorders:function(){var e=this.range();e.sheet().batch(function(){e.borderLeft(null).borderTop(null).borderRight(null).borderBottom(null)}.bind(this),{})},allBorders:function(e){var t=this.range();t.sheet().batch(function(){t.borderLeft(e).borderTop(e).borderRight(e).borderBottom(e)}.bind(this),{})},leftBorder:function(e){this.range().leftColumn().borderLeft(e)},rightBorder:function(e){this.range().rightColumn().borderRight(e)},topBorder:function(e){this.range().topRow().borderTop(e)},bottomBorder:function(e){this.range().bottomRow().borderBottom(e)},outsideBorders:function(e){var t=this.range();t.sheet().batch(function(){t.leftColumn().borderLeft(e),t.topRow().borderTop(e),t.rightColumn().borderRight(e),t.bottomRow().borderBottom(e)}.bind(this),{})},insideBorders:function(e){this.range().sheet().batch(function(){this.allBorders(e),this.outsideBorders(null)}.bind(this),{})},insideHorizontalBorders:function(e){var t=this.range();t.sheet().batch(function(){t.borderBottom(e),t.bottomRow().borderBottom(null)}.bind(this),{})},insideVerticalBorders:function(e){var t=this.range();t.sheet().batch(function(){t.borderRight(e),t.rightColumn().borderRight(null)}.bind(this),{})}}),e.spreadsheet.MergeCellCommand=n.extend({init:function(e){n.fn.init.call(this,e),this._type=e.value},exec:function(){this.getState(),this[this._type]()},activate:function(e){this.range().sheet().activeCell(e)},getState:function(){this._state=this.range().getState()},undo:function(){"unmerge"!==this._type&&(this.range().unmerge(),this.activate(this.range().topLeft())),this.range().setState(this._state)},cells:function(){var e=this.range(),t=e._ref;e.merge(),this.activate(t)},horizontally:function(){var e=this.range().topRow()._ref;this.range().forEachRow(function(e){e.merge()}),this.activate(e)},vertically:function(){var e=this.range().leftColumn()._ref;this.range().forEachColumn(function(e){e.merge()}),this.activate(e)},unmerge:function(){var e=this.range(),t=e._ref.topLeft;e.unmerge(),this.activate(t)}}),e.spreadsheet.FreezePanesCommand=n.extend({init:function(e){n.fn.init.call(this,e),this._type=e.value},exec:function(){this.getState(),this._topLeft=this.range().topLeft(),this[this._type]()},getState:function(){this._state=this.range().sheet().getState()},undo:function(){this.range().sheet().setState(this._state)},panes:function(){var e=this._topLeft,t=this.range().sheet();t.frozenColumns(e.col).frozenRows(e.row)},rows:function(){var e=this._topLeft,t=this.range().sheet();t.frozenRows(e.row)},columns:function(){var e=this._topLeft,t=this.range().sheet();t.frozenColumns(e.col)},unfreeze:function(){var e=this.range().sheet();e.frozenRows(0).frozenColumns(0)}}),e.spreadsheet.PasteCommand=n.extend({init:function(e){n.fn.init.call(this,e),this._clipboard=this._workbook.clipboard()},getState:function(){this._range=this._workbook.activeSheet().range(this._clipboard.pasteRef()),this._state=this._range.getState()},exec:function(){var e,t=this._clipboard.canPaste();if(this._clipboard.menuInvoked=!0,t.canPaste)this.getState(),this._clipboard.paste(),e=this._workbook.activeSheet().range(this._clipboard.pasteRef()),e._adjustRowHeight();else{if(t.menuInvoked)return{reason:"useKeyboard"};if(t.pasteOnMerged)return{reason:"modifyMerged"}}}}),e.spreadsheet.AdjustRowHeightCommand=n.extend({exec:function(){var e=this.options,t=this._workbook.activeSheet(),n=e.range||t.range(e.rowIndex);n._adjustRowHeight()}}),e.spreadsheet.ToolbarPasteCommand=n.extend({exec:function(){return e.support.clipboard.paste?(this._workbook._view.clipboard.focus().select(),void document.execCommand("paste")):{reason:"useKeyboard"}}}),e.spreadsheet.CopyCommand=n.extend({init:function(e){n.fn.init.call(this,e),this._clipboard=e.workbook.clipboard()},undo:t.noop,exec:function(){var e=this._clipboard.canCopy();if(this._clipboard.menuInvoked=!0,e.canCopy)this._clipboard.copy();else{if(e.menuInvoked)return{reason:"useKeyboard"};if(e.multiSelection)return{reason:"unsupportedSelection"}}}}),e.spreadsheet.ToolbarCopyCommand=n.extend({init:function(e){n.fn.init.call(this,e),this._clipboard=e.workbook.clipboard()},undo:t.noop,exec:function(){var n,i;return e.support.clipboard.copy?(n=this._workbook._view.clipboard,i=document.createElement("textarea"),t(i).addClass("k-spreadsheet-clipboard").val(n.html()).appendTo(document.body).focus().select(),document.execCommand("copy"),n.trigger("copy"),t(i).remove(),void 0):{reason:"useKeyboard"}}}),e.spreadsheet.CutCommand=n.extend({init:function(e){n.fn.init.call(this,e),this._clipboard=e.workbook.clipboard()},exec:function(){this._clipboard.canCopy()&&(this.getState(),this._clipboard.cut())}}),e.spreadsheet.AutoFillCommand=n.extend({init:function(e){n.fn.init.call(this,e)},origin:function(e){this._origin=e},exec:function(){this.getState(),this.range().fillFrom(this._origin)}}),e.spreadsheet.ToolbarCutCommand=n.extend({init:function(e){n.fn.init.call(this,e),this._clipboard=e.workbook.clipboard()},exec:function(){var n,i;return e.support.clipboard.copy?(n=this._workbook._view.clipboard,i=document.createElement("textarea"),t(i).val(n.html()).appendTo(document.body).focus().select(),document.execCommand("copy"),n.trigger("cut"),t(i).remove(),void 0):{reason:"useKeyboard"}}}),e.spreadsheet.FilterCommand=n.extend({undo:function(){this.range().filter(this._state)},exec:function(){var e=this.range();if(this._state=e.hasFilter(),e.hasFilter())e.filter(!1);else{if(e.intersectingMerged().length)return{reason:"error",type:"filterRangeContainingMerges"};e.filter(!0)}}}),e.spreadsheet.SortCommand=n.extend({undo:function(){var e=this.range().sheet();e.setState(this._state)},exec:function(){var e=this.range(),t=e.sheet(),n=t.activeCell(),i=this.options.sheet?n.topLeft.col:this.options.column||0,r="asc"===this.options.value?!0:!1;return this._state=t.getState(),this.options.sheet&&(e=this.expandRange()),e.intersectingMerged().length?{reason:"error",type:"sortRangeContainingMerges"}:void e.sort({column:i,ascending:r})},expandRange:function(){var t=this.range().sheet();return new e.spreadsheet.Range(t._sheetRef,t)}}),r=e.spreadsheet.ApplyFilterCommand=n.extend({column:function(){return this.options.column||0},undo:function(){var e=this.range().sheet();e.clearFilter(this.column()),this._state.length&&this.range().filter(this._state)},getState:function(){var e=this.range().sheet(),t=e.filter();t&&(this._state=t.columns.filter(function(e){return e.index==this.column()}.bind(this)))},exec:function(){var t,n,i=this.range(),r=this.column(),o=i.sheet().filter(),s=!1;this.options.valueFilter?n={column:r,filter:new e.spreadsheet.ValueFilter(this.options.valueFilter)}:this.options.customFilter&&(n={column:r,filter:new e.spreadsheet.CustomFilter(this.options.customFilter)}),this.getState(),o&&o.ref.eq(i._ref)&&o.columns.length?(o.columns.forEach(function(e){e.index===r&&(s=!0)}),t=o.columns.map(function(e){return e.index===r?n:{column:e.index,filter:e.filter}}),s||t.push(n)):t=n,i.filter(t)}}),e.spreadsheet.ClearFilterCommand=r.extend({exec:function(){var e=this.range(),t=this.column();this.getState(),e.clearFilter(t)}}),e.spreadsheet.HideLineCommand=n.extend({init:function(e){n.fn.init.call(this,e),this.axis=e.axis},undo:function(){var e=this.range().sheet();e.setAxisState(this._state)},exec:function(){var e=this.range().sheet();this._state=e.getAxisState(),"row"==this.axis?e.axisManager().hideSelectedRows():e.axisManager().hideSelectedColumns()}}),e.spreadsheet.UnHideLineCommand=e.spreadsheet.HideLineCommand.extend({exec:function(){var e=this.range().sheet();this._state=e.getAxisState(),"row"==this.axis?e.axisManager().unhideSelectedRows():e.axisManager().unhideSelectedColumns()}}),o=e.spreadsheet.DeleteCommand=n.extend({undo:function(){var e=this.range().sheet();e.setState(this._state)}}),e.spreadsheet.DeleteRowCommand=o.extend({exec:function(){var e=this.range().sheet();this._state=e.getState(),e.axisManager().deleteSelectedRows()}}),e.spreadsheet.DeleteColumnCommand=o.extend({exec:function(){var e=this.range().sheet();this._state=e.getState(),e.axisManager().deleteSelectedColumns()}}),s=n.extend({init:function(e){n.fn.init.call(this,e),this._value=e.value},undo:function(){var e=this.range().sheet();e.setState(this._state)}}),e.spreadsheet.AddColumnCommand=s.extend({exec:function(){var e=this.range().sheet();this._state=e.getState(),"left"===this._value?e.axisManager().addColumnLeft():e.axisManager().addColumnRight()}}),e.spreadsheet.AddRowCommand=s.extend({exec:function(){var e=this.range().sheet();return e.axisManager().canAddRow()?(this._state=e.getState(),void("above"===this._value?e.axisManager().addRowAbove():e.axisManager().addRowBelow())):{reason:"error",type:"shiftingNonblankCells"}}}),e.spreadsheet.EditValidationCommand=n.extend({init:function(e){n.fn.init.call(this,e),this._value=e.value},exec:function(){this.range().validation(this._value)}}),e.spreadsheet.OpenCommand=n.extend({exec:function(){var e=this.options.file;return null===e.name.match(/.xlsx$/i)?{reason:"error",type:"openUnsupported"}:void this.options.workbook.fromFile(this.options.file)}}),e.spreadsheet.SaveAsCommand=n.extend({exec:function(){var e=this.options.name+this.options.extension;".xlsx"===this.options.extension?this.options.workbook.saveAsExcel({fileName:e}):".pdf"===this.options.extension&&this.options.workbook.saveAsPDF(t.extend(this.options.pdf,{workbook:this.options.workbook,fileName:e}))}}))}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/formulabar.min",["kendo.core.min"],e)}(function(){!function(e){var t,n,i;e.support.browser.msie&&9>e.support.browser.version||(t=e.jQuery,n={wrapper:"k-spreadsheet-formula-bar"},i=e.ui.Widget.extend({init:function(n,r){e.ui.Widget.call(this,n,r),n=this.element.addClass(i.classNames.wrapper),this.formulaInput=new e.spreadsheet.FormulaInput(t("<div/>").appendTo(n))},destroy:function(){this.formulaInput&&this.formulaInput.destroy(),this.formulaInput=null}}),e.spreadsheet.FormulaBar=i,t.extend(!0,i,{classNames:n}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/formulainput.min",["kendo.core.min"],e)}(function(){!function(e,t){function n(e){return"("==e||"["==e||"{"==e}function i(e){return")"==e||"]"==e||"}"==e}function r(e,t){return"("==t?")"==e:"["==t?"]"==e:"{"==t?"}"==e:!1}function o(e,t){return t.begin>=e.begin&&e.end>=t.end}function s(t){return e.spreadsheet.calc.runtime.FUNCS[t.toLowerCase()]}function a(e,t){return e&&t?"ref"==e.type&&"ref"==t.type?e.ref.eq(t.ref):e.value===t.value:!1}var l,u,c,h,d,f,p,m,g;e.support.browser.msie&&9>e.support.browser.version||(l=e.jQuery,u=e.ui.Widget,c=".kendoFormulaInput",h=e.keys,d={wrapper:"k-spreadsheet-formula-input",listWrapper:"k-spreadsheet-formula-list"},f=["font-family","font-size","font-stretch","font-style","font-weight","letter-spacing","text-transform","line-height"],p={27:"esc",37:"left",39:"right",35:"end",36:"home",32:"spacebar"},m=/(^_|[^a-z0-9]$)/i,g=u.extend({init:function(e,t){u.call(this,e,t),e=this.element,e.addClass(g.classNames.wrapper).attr("contenteditable",!0).attr("spellcheck",!1),this.options.autoScale&&e.on("input",this.scale.bind(this)),this._highlightedRefs=[],this._staticTokens=[],this._formulaSource(),this._formulaList(),this._popup(),this._tooltip(),e.on("keydown",this._keydown.bind(this)).on("keyup",this._keyup.bind(this)).on("blur",this._blur.bind(this)).on("input click",this._input.bind(this)).on("focus",this._focus.bind(this))},options:{name:"FormulaInput",autoScale:!1,filterOperator:"startswith",scalePadding:30,minLength:1},events:["keyup","focus"],enable:function(e){return void 0===e?"false"===this.element.attr("contenteditable")?!1:!0:void this.element.attr("contenteditable",e).toggleClass("k-state-disabled",!e)},getPos:function(){function e(e,t){try{!function r(n){if(n===e)throw t;if(1==n.nodeType)for(var i=n.firstChild;i;i=i.nextSibling)r(i);else 3==n.nodeType&&(t+=n.nodeValue.length)}(i)}catch(n){return n}}var n,i=this.element[0],r=t.getSelection(),o=e(r.focusNode,r.focusOffset),s=e(r.anchorNode,r.anchorOffset);return null!=o&&null!=s?(o>s&&(n=o,o=s,s=n),{begin:o,end:s,collapsed:o==s}):void 0},setPos:function(e,n){function i(e,t){try{!function i(e){var n,r;if(3==e.nodeType){if(n=e.nodeValue.length,n>=t)throw e;t-=n}else if(1==e.nodeType)for(r=e.firstChild;r;r=r.nextSibling)i(r)}(e)}catch(n){return{node:n,pos:t}}}var r,o,s=this.element[0];e=i(s,e),n=null!=n?i(s,n):e,e&&n&&(r=document.createRange(),r.setStart(e.node,e.pos),r.setEnd(n.node,n.pos),o=t.getSelection(),o.removeAllRanges(),o.addRange(r))},end:function(){this.setPos(this.length())},home:function(){this.setPos(0)},length:function(){return this.value().length},_formulaSource:function(){var t,n,i=[];for(n in e.spreadsheet.calc.runtime.FUNCS)m.test(n)||(t=n.toUpperCase(),i.push({value:t,text:t}));this.formulaSource=new e.data.DataSource({data:i})},_formulaList:function(){this.list=new e.ui.StaticList(l("<ul />").addClass(g.classNames.listWrapper).insertAfter(this.element),{autoBind:!1,selectable:!0,change:this._formulaListChange.bind(this),dataSource:this.formulaSource,dataValueField:"value",template:"#:data.value#"}),this.list.element.on("mousedown",function(e){e.preventDefault()})},_formulaListChange:function(){var e,t,n,i=this._tokenContext();i&&!this._mute&&(e=i.token,t=this.list.value()[0],n={replace:!0,token:e,end:e.end},i.nextToken&&"("==i.nextToken.value||(t+="("),this._replaceAt(n,t),this.popup.close())},_popup:function(){this.popup=new e.ui.Popup(this.list.element,{anchor:this.element})},_blur:function(){this.popup.close(),clearTimeout(this._focusId)},_isFormula:function(){return/^=/.test(this.value())},_keydown:function(e){var t=e.keyCode;p[t]?(this.popup.close(),this._navigated=!0):this._move(t)&&(this._navigated=!0,e.preventDefault()),this._keyDownTimeout=setTimeout(this._syntaxHighlight.bind(this))},_keyup:function(){var e,t=this.popup;this._isFormula()&&!this._navigated&&(e=((this._tokenContext()||{}).token||{}).value,this.filter(e),e&&this.formulaSource.view().length?(t[t.visible()?"position":"open"](),this.list.focusFirst()):t.close()),this._navigated=!1,this._syntaxHighlight(),this.trigger("keyup")},_input:function(){this._syntaxHighlight()},_focus:function(){this._focusTimeout=setTimeout(this._syntaxHighlight.bind(this)),this.trigger("focus")},_move:function(e){var t=this.list,n=!1,i=this.popup;return e===h.DOWN?(t.focusNext(),t.focus()||t.focusFirst(),n=!0):e===h.UP?(t.focusPrev(),t.focus()||t.focusLast(),n=!0):e===h.ENTER?(i.visible()&&t.select(t.focus()),i.close(),n=!0):e===h.TAB?(t.select(t.focus()),i.close(),n=!0):e===h.PAGEUP?(t.focusFirst(),n=!0):e===h.PAGEDOWN&&(t.focusLast(),n=!0),n},_tokenContext:function(){var t,n,i,r=this.getPos(),s=this.value();if(!s||!r||!r.collapsed)return null;for(t=e.spreadsheet.calc.tokenize(s,this.row(),this.col()),i=0;t.length>i;++i)if(n=t[i],o(n,r)&&/^(?:str|sym|func)$/.test(n.type))return{token:n,nextToken:t[i+1]};return null},_sync:function(){this._editorToSync&&this.isActive()&&this._editorToSync.value(this.value())},_textContainer:function(){var t=e.getComputedStyles(this.element[0],f);t.position="absolute",t.visibility="hidden",t.whiteSpace="pre",t.top=-3333,t.left=-3333,this._span=l("<span/>").css(t).insertAfter(this.element)},_tooltip:function(){this._cellTooltip=l('<div class="k-widget k-tooltip" style="position:absolute; display:none">A1</div>').insertAfter(this.element)},tooltip:function(e){this._cellTooltip.text(e)},toggleTooltip:function(e){this._cellTooltip.toggle(e)},isActive:function(){return this.element[0]===e._activeElement()},filter:function(e){!e||this.options.minLength>e.length||(this._mute=!0,this.list.select(-1),this._mute=!1,this.formulaSource.filter({field:this.list.options.dataValueField,operator:this.options.filterOperator,value:e}))},hide:function(){this.element.hide(),this._cellTooltip.hide()},show:function(){this.element.show()},row:function(){return this.activeCell?this.activeCell.row:void 0},col:function(){return this.activeCell?this.activeCell.col:void 0},position:function(e){e&&(this.element.show().css({top:e.top+1+"px",left:e.left+1+"px"}),this._cellTooltip.css({top:e.top-this._cellTooltip.height()-10+"px",left:e.left}))},resize:function(e){e&&this.element.css({width:e.width-1,height:e.height-1})},canInsertRef:function(e){var t,n=this._canInsertRef(e),i=n&&n.token;if(i)for(t=0;this._staticTokens.length>t;t++)if(a(i,this._staticTokens[t]))return null;return n},_canInsertRef:function(t){function i(e){return e.begin>l.begin}function r(e){if(e){if(/^(?:num|str|bool|sym|ref)$/.test(e.type))return{replace:!0,token:e,end:e.end};if(/^(?:op|punc|startexp)$/.test(e.type))return e.end==l.end?s(e,u[h+1]):s(u[h-1],e)}}function s(e,t){if(null==e)return null;if(null==t)return/^(?:op|startexp)$/.test(e.type)||n(e.value)?{token:e,end:l.end}:null;if(a){if("op"==e.type&&/^(?:punc|op)$/.test(t.type))return{token:e,end:l.end}}else{if("startexp"==e.type)return{token:e,end:l.end};if(/^(?:ref|op|punc)$/.test(e.type))return{token:e,end:l.end};if(/^(?:punc|op)$/.test(e.type))return/^[,;({]$/.test(e.value)?{token:e,end:l.end}:null}return!1}var a,l,u,c,h;if(this.popup.visible())return null;if(a=t,l=this.getPos(),l&&this._isFormula()){if(0===l.begin)return null;for(u=e.spreadsheet.calc.tokenize(this.value(),this.row(),this.col()),h=0;u.length>h;++h){if(c=u[h],o(c,l))return r(c);if(i(c))return s(u[h-1],c)}return s(c,null)}return null},refAtPoint:function(e){var t=this._canInsertRef();t&&this._replaceAt(t,""+e.simplify())},_replaceAt:function(e,t){var n,i=this.value(),r=e.token,o=i.substr(e.end);i=i.substr(0,e.replace?r.begin:e.end)+t,n=i.length,i+=o,this._value(i),this.setPos(n),this.scale(),this._syntaxHighlight(),this._sync()},syncWith:function(e){var t="input"+c;this._editorToSync=e,this.element.off(t).on(t,this._sync.bind(this))},scale:function(){var e,t=this.element;this._span||this._textContainer(),this._span.html(t.html()),e=this._span.width()+this.options.scalePadding,e>t.width()&&t.width(e);
  },_value:function(e){this.element.text(e)},value:function(e){return void 0===e?this.element.text():(this._value(e),void this._syntaxHighlight())},highlightedRefs:function(){return this._highlightedRefs.slice()},_syntaxHighlight:function(){var t,a=this.getPos(),l=this.value(),u=e.spreadsheet.Pane.classNames.series,c=[],h=0,d=[],f=[];(!a||a.collapsed)&&(/^=/.test(l)?(f=e.spreadsheet.calc.tokenize(l,this.row(),this.col()),f.forEach(function(e){if(e.active=!1,e.cls=["k-syntax-"+e.type],"ref"==e.type&&(e.colorClass=u[h++%u.length],e.cls.push(e.colorClass),c.push(e)),a&&"punc"==e.type)if(n(e.value))d.unshift(e);else if(i(e.value)){var l=d.shift();l?r(e.value,l.value)?(o(e,a)||o(l,a))&&(e.cls.push("k-syntax-paren-match"),l.cls.push("k-syntax-paren-match")):(e.cls.push("k-syntax-error"),l.cls.push("k-syntax-error")):e.cls.push("k-syntax-error")}a&&o(e,a)&&(e.cls.push("k-syntax-at-point"),e.active=!0,t=e),"func"!=e.type||s(e.value)||a&&o(e,a)||e.cls.push("k-syntax-error")}),f.reverse().forEach(function(t){var n=t.begin,i=t.end,r=e.htmlEncode(l.substring(n,i));l=l.substr(0,n)+"<span class='"+t.cls.join(" ")+"'>"+r+"</span>"+l.substr(i)}),this.element.html(l)):(this.element.text(l),this.popup&&this.popup.close()),a&&this.setPos(a.begin,a.end),t&&/^(?:startexp|op|punc)$/.test(t.type)&&this._setStaticTokens(f),this._highlightedRefs=c)},_setStaticTokens:function(e){var t,n;for(this._staticTokens=[],t=0;e.length>t;t++)n=e[t],/^(?:num|str|bool|sym|ref)$/.test(n.type)&&this._staticTokens.push(n)},destroy:function(){this._editorToSync=null,this.element.off(c),clearTimeout(this._focusTimeout),clearTimeout(this._keyDownTimeout),this._cellTooltip=null,this._span=null,this.popup.destroy(),this.popup=null,u.fn.destroy.call(this)}}),e.spreadsheet.FormulaInput=g,l.extend(!0,g,{classNames:d}))}(kendo,window)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/eventlistener.min",["kendo.core.min"],e)}(function(){!function(e){var t,n,i,r,o,s;e.support.browser.msie&&9>e.support.browser.version||(t=e.jQuery,n={8:"backspace",9:"tab",13:"enter",27:"esc",37:"left",38:"up",39:"right",40:"down",35:"end",36:"home",32:"spacebar",33:"pageup",34:"pagedown",46:"delete",113:":edit"},i=navigator.platform.toUpperCase().indexOf("MAC")>=0,r=function(e){return e>47&&58>e||e>64&&91>e||e>95&&112>e||e>185&&193>e||e>218&&223>e?!0:!1},o=function(e){var t=n[e];return!t&&r(e)&&(t=":alphanum"),t},s=e.Class.extend({init:function(e,n,i){if(this._handlers={},this.target=e,this._observer=n||window,this.keyDownProxy=this.keyDown.bind(this),this.mouseProxy=this.mouse.bind(this),this.threshold=5,this._pressLocation=null,e.on("keydown",this.keyDownProxy),e.on("contextmenu mousedown cut copy paste scroll wheel click dblclick focus",this.mouseProxy),t(document.documentElement).on("mousemove mouseup",this.mouseProxy),i)for(var r in i)this.on(r,i[r])},keyDown:function(e){this.handleEvent(e,o(e.keyCode))},mouse:function(e){var t,n,i,r,o;e.which?t=3==e.which:e.button&&(t=2==e.button),n=e.type,"mousedown"===n&&(t?n="rightmousedown":this._pressLocation={x:e.pageX,y:e.pageY}),"mouseup"===n&&(t||(this._pressLocation=null)),"mousemove"===n&&this._pressLocation&&(i=this._pressLocation.x-e.pageX,r=this._pressLocation.y-e.pageY,o=Math.sqrt(i*i+r*r),o>this.threshold&&(n="mousedrag")),this.handleEvent(e,n)},handleEvent:function(e,t){var n,r,o="";e.mod=i?e.metaKey:e.ctrlKey,e.shiftKey&&(o+="shift+"),e.ctrlKey&&(o+="ctrl+"),o+=t,n=this._handlers["*+"+t],n&&n.call(this._observer,e,o),r=this._handlers[o],r&&r.call(this._observer,e,o)},on:function(e,t){var n=this._handlers;"string"==typeof t&&(t=this._observer[t]),"string"==typeof e&&(e=e.split(",")),e.forEach(function(e){n[e]=t})},destroy:function(){this.target.off("keydown",this.keyDownProxy),this.target.off("keydown",this.mouseProxy),t(document.documentElement).off("mousemove mouseup",this.mouseProxy)}}),e.spreadsheet.EventListener=s)}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/rangelist.min",["kendo.core.min"],e)}(function(){!function(e){function t(e){return e}function n(e){if(e.left.level===e.level){var t=e;e=e.left,t.left=e.right,e.right=t}return e}function i(e){if(e.right.right.level===e.level){var t=e;e=e.right,t.right=e.left,e.left=t,e.level+=1}return e}function r(e,t){return e===c?new u(1,t,c,c):(e.value.start-t.start>0?e.left=r(e.left,t):e.right=r(e.right,t),i(n(e)))}function o(e,t){var r,s;if(e===c)return e;if(r=e.value.start-t.start,0===r)if(e.left!==c&&e.right!==c){for(s=e.left;s.right!==c;)s=s.right;e.value=s.value,e.left=o(e.left,e.value)}else e=e.left===c?e.right:e.left;else r>0?e.left=o(e.left,t):e.right=o(e.right,t);return(e.level-1>e.left.level||e.level-1>e.right.level)&&(e.level-=1,e.right.level>e.level&&(e.right.level=e.level),e=n(e),e.right=n(e.right),e.right.right=n(e.right.right),e=i(e),e.right=i(e.right)),e}function s(e,t){e!==c&&(s(e.left,t),t.push(e.value),s(e.right,t))}function a(e,t,n){if(e!==c){var i=e.value;i.start>t.start&&a(e.left,t,n),i.intersects(t)&&n.push(i),t.end>i.end&&a(e.right,t,n)}}function l(e,t,n){t!==c&&(l(e,t.left,n),e.insert(n(t.value)),l(e,t.right,n))}var u,c,h,d,f,p,m;e.support.browser.msie&&9>e.support.browser.version||(u=e.Class.extend({init:function(e,t,n,i){this.level=e,this.value=t,this.left=n,this.right=i}}),c=new function(){this.left=this,this.right=this,this.level=0},h=e.Class.extend({init:function(e,t,n){this.start=e,this.end=t,this.value=n},intersects:function(e){return this.end>=e.start&&e.end>=this.start}}),d=e.Class.extend({init:function(){this.root=c},insert:function(e){this.root=r(this.root,e)},remove:function(e){this.root=o(this.root,e)},findrange:function(e){for(var t=this.root;t!=c;)if(t.value.start>e)t=t.left;else{if(!(e>t.value.end))return t.value;t=t.right}return null},values:function(){var e=[];return s(this.root,e),e},intersecting:function(e,t){var n=[];return a(this.root,new h(e,t),n),n},map:function(e){var t=new d;return l(t,this.root,e),t},clone:function(){return this.map(t)},first:function(){for(var e=this.root;e.left!=c;)e=e.left;return e},last:function(){for(var e=this.root;e.right!=c;)e=e.right;return e}}),f=e.Class.extend({init:function(e,t,n){void 0===t?this.tree=e:(this.tree=new d,this.tree.insert(new h(e,t,n)))},values:function(){return this.tree.values()},map:function(e){return new f(this.tree.map(e))},intersecting:function(e,t){return this.tree.intersecting(e,t)},first:function(){return this.tree.first().value},last:function(){return this.tree.last().value},insert:function(e,t,n){return this.tree.insert(new h(e,t,n))},value:function(e,t,n){var i,r,o,s,a,l,u,c,h;if(void 0===n)return void 0===t&&(t=e),this.intersecting(e,t)[0].value;if(i=this.tree.intersecting(e-1,t+1),i.length)for(r=i[0],o=i[i.length-1],e>r.end&&(r.value===n?e=r.start:i.shift()),o.start>t&&(o.value===n?t=o.end:i.pop()),s=0,a=i.length;a>s;s++)l=i[s],u=l.value,c=l.start,h=l.end,this.tree.remove(l),e>c&&(u!==n?this.insert(c,e-1,u):e=c),h>t&&(u!==n?this.insert(t+1,h,u):t=h);this.insert(e,t,n)},expandedValues:function(e,t){var n,i=this.intersecting(e,t),r=[],o=0;for(n=e;t>=n;n++)n>i[o].end&&o++,r.push({index:n-e,value:i[o].value});return r},sortedIndices:function(e,t,n,i){var r=this.expandedValues(e,t),o=function(e,t){return e.value===t.value?e.index-t.index:n(e.value,t.value)};return i&&(o=function(e,t){var r=i[e.index],o=i[t.index];return r.value===o.value?n(e.value,t.value):e.index-t.index}),r.sort(o),r},sort:function(e,t,n){var i,r,o;if(1!==this.intersecting(e,t).length)for(i=this.expandedValues(e,t),r=0,o=n.length;o>r;r++)this.value(r+e,r+e,i[n[r].index].value)},copy:function(e,t,n){var i,r,o,s,a,l=this.intersecting(e,t),u=n;for(r=0,o=l.length;o>r;r++)s=l[r].start,e>s&&(s=e),a=l[r].end,a>t&&(a=t),i=u+(a-s),this.value(u,i,l[r].value),u=++i},iterator:function(e,t){return new p(e,t,this.intersecting(e,t))},getState:function(){return this.tree.clone()},setState:function(e){this.tree=e}}),p=e.Class.extend({init:function(e,t,n){this.start=e,this.end=t,this.index=0,this.ranges=n},unique:function(){return this.ranges.map(function(e){return e.value})},at:function(e){for(;e>this.ranges[this.index].end;)this.index++;return this.ranges[this.index].value},forEach:function(e){for(var t=this.start;this.end>=t;t++)e(this.at(t),t);this.index=0}}),m=f.extend({init:function(e,t,n){this.tree=new d,this.range=new h(e,t,n)},intersecting:function(e,t){var n,i,r,o=this.tree.intersecting(e,t),s=[];if(!o.length)return[this.range];for(i=0,r=o.length;r>i;i++)n=o[i],n.start>e&&s.push(new h(e,n.start-1,this.range.value)),s.push(n),e=n.end+1;return t>n.end&&s.push(new h(n.end+1,t,this.range.value)),s},insert:function(e,t,n){n!==this.range.value&&this.tree.insert(new h(e,t,n))},lastRangeStart:function(){var e=this.tree.root;if(e===c)return this.range.start;for(;e.right!==c;)e=e.right;return e.value.end+1}}),e.spreadsheet.RangeTree=d,e.spreadsheet.RangeList=f,e.spreadsheet.SparseRangeList=m,e.spreadsheet.ValueRange=h)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/propertybag.min",["kendo.core.min"],e)}(function(){!function(e){function t(e){return e.replace(/M/g,"m").replace(/'/g,'"').replace(/tt/,"am/pm")}var n,i,r,o;e.support.browser.msie&&9>e.support.browser.version||(n=e.jQuery,i=e.Class.extend({init:function(e){this.list=e},get:function(e){return this.parse(this.list.value(e,e))},set:function(e,t,n){void 0===n&&(n=t,t=e),this.list.value(e,t,n)},parse:function(e){return e},copy:function(e,t,n){this.list.copy(e,t,n)},iterator:function(e,t){return this.list.iterator(e,t)}}),r=i.extend({set:function(e,t,n){this.list.value(e,t,JSON.stringify(n))},parse:function(e){return JSON.parse(e)}}),o=i.extend({init:function(e,t,n){i.prototype.init.call(this,e),this.validations=n,this.formats=t},set:function(n,i,r){r instanceof Date&&(r=e.spreadsheet.dateToNumber(r),this.formats.value(n,i,t(e.culture().calendar.patterns.d))),this.list.value(n,i,r)}}),e.spreadsheet.PropertyBag=e.Class.extend({specs:[{property:o,name:"value",value:null,sortable:!0,serializable:!0,depends:"format"},{property:i,name:"format",value:null,sortable:!0,serializable:!0},{property:i,name:"formula",value:null,sortable:!0,serializable:!0},{property:i,name:"background",value:null,sortable:!0,serializable:!0},{property:r,name:"borderBottom",value:null,sortable:!1,serializable:!0},{property:r,name:"borderRight",value:null,sortable:!1,serializable:!0},{property:r,name:"borderLeft",value:null,sortable:!1,serializable:!0},{property:r,name:"borderTop",value:null,sortable:!1,serializable:!0},{property:i,name:"color",value:null,sortable:!0,serializable:!0},{property:i,name:"fontFamily",value:null,sortable:!0,serializable:!0},{property:i,name:"underline",value:null,sortable:!0,serializable:!0},{property:i,name:"fontSize",value:null,sortable:!0,serializable:!0},{property:i,name:"italic",value:null,sortable:!0,serializable:!0},{property:i,name:"bold",value:null,sortable:!0,serializable:!0},{property:i,name:"textAlign",value:null,sortable:!0,serializable:!0},{property:i,name:"verticalAlign",value:null,sortable:!0,serializable:!0},{property:i,name:"wrap",value:null,sortable:!0,serializable:!0},{property:i,name:"validation",value:null,sortable:!1,serializable:!0},{property:i,name:"enable",value:null,sortable:!1,serializable:!0}],init:function(t){this.properties={},this.lists={},this.specs.forEach(function(n){this.lists[n.name]=new e.spreadsheet.SparseRangeList(0,t,n.value)},this),this.specs.forEach(function(e){this.properties[e.name]=new e.property(this.lists[e.name],this.lists[e.depends])},this)},getState:function(){var e={};return this.specs.forEach(function(t){e[t.name]=this.lists[t.name].getState()},this),e},setState:function(e){this.specs.forEach(function(t){this.lists[t.name].setState(e[t.name])},this)},get:function(e,t){return void 0===t?this.lists[e]:this.properties[e].get(t)},set:function(e,t,n,i){this.properties[e].set(t,n,i)},fromJSON:function(e,t){var n,i;for(n=0;this.specs.length>n;n++)i=this.specs[n],i.serializable&&void 0!==t[i.name]&&this.set(i.name,e,e,t[i.name],!1)},copy:function(e,t,n){this.specs.forEach(function(i){this.properties[i.name].copy(e,t,n)},this)},iterator:function(e,t,n){return this.properties[e].iterator(t,n)},sortable:function(){return this.specs.filter(function(e){return e.sortable}).map(function(e){return this.lists[e.name]},this)},iterators:function(e,t){var n=this.specs.filter(function(e){return e.serializable});return n.map(function(n){var i=this.iterator(n.name,e,t);return{name:n.name,value:n.value,at:function(e){return n.property.fn.parse(i.at(e))}}},this)},forEach:function(e,t,n){var i,r,o,s,a,l=this.iterators(e,t);for(i=e;t>=i;i++){for(r={},o=0;l.length>o;o++)s=l[o],a=s.at(i),a!==s.value&&(r[s.name]=a);n(r)}},forEachProperty:function(e){for(var t in this.properties)e(this.properties[t])}}),e.spreadsheet.ALL_PROPERTIES=n.map(e.spreadsheet.PropertyBag.prototype.specs,function(e){return e.name}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/references.min",["kendo.core.min"],e)}(function(){"use strict";function e(t){var n=Math.floor(t/26)-1;return(n>=0?e(n):"")+String.fromCharCode(65+t%26)}function t(e){return/^[a-z0-9_]*$/i.test(e)?e:"'"+e.replace(/\x27/g,"\\'")+"'"}function n(n,i,r,o){var s="";return++i,isFinite(i)?null==o||2&o||(i="$"+i):i="",isFinite(r)?(s=e(r),null==o||1&o||(s="$"+s)):r="",n?t(n)+"!"+s+i:s+i}var i,r,o,s,a,l,u,c;kendo.support.browser.msie&&kendo.support.browser.version<9||(i=kendo.spreadsheet,r=kendo.Class,o=r.extend({type:"ref",hasSheet:function(){return this._hasSheet},simplify:function(){return this},setSheet:function(e,t){return this.sheet=e,null!=t&&(this._hasSheet=t),this},absolute:function(){return this},relative:function(){return this},adjust:function(){return this},toString:function(){return this.relative(0,0,3,3).print(0,0)},forEach:function(e,t){e.call(t,this)},map:function(e,t){return e.call(t,this)},intersects:function(e){return this.intersect(e)!==s},isCell:function(){return!1},toRow:function(){return this},toColumn:function(){return this},first:function(){return this},lastRange:function(){return this},size:function(){return 1},rangeAt:function(){return this},nextRangeIndex:function(){return 0},previousRangeIndex:function(){return 0},eq:function(e){var t,n,i,r,o=this,a=e;if(o===s||a===s)return o===a;if((a instanceof l||a instanceof u&&!(o instanceof l))&&(o=e,a=this),o instanceof l)return a=a.simplify(),a instanceof l&&o.row==a.row&&o.col==a.col&&o.sheet==a.sheet;if(o instanceof u){if(a instanceof u)return a.topLeft.eq(o.topLeft)&&a.bottomRight.eq(o.bottomRight);if(a instanceof c)return a.single()&&o.eq(a.refs[0])}else if(o instanceof c&&a instanceof c){if(t=o.refs,n=a.refs,t.length!=n.length)return!1;for(i=0,r=t.length;r>i;i++)if(!t[i].eq(n[i]))return!1;return!0}return o===a},concat:function(e){return new c([this,e])},replaceAt:function(e,t){return t},forEachColumnIndex:function(e){this.forEachAxisIndex("col",e)},forEachRowIndex:function(e){this.forEachAxisIndex("row",e)},forEachAxisIndex:function(e,t){var n=[],i="row"===e?"forEachRow":"forEachColumn";this[i](function(t){var i=t.first()[e];-1===n.indexOf(i)&&n.push(i)}),n.sort(function(e,t){return e>t?1:t>e?-1:0}).forEach(t)},valid:function(){return!1}}),o.display=n,s=new(o.extend({init:function(){},print:function(){return"#NULL!"},clone:function(){return this},eq:function(e){return e===this},forEach:function(){}})),a=o.extend({ref:"name",init:function(e){this.name=e},print:function(){var e=t(this.name);return this.hasSheet()&&(e=t(this.sheet)+"!"+e),e}}),l=o.extend({ref:"cell",init:function(e,t,n){this.row=e,this.col=t,this.rel=n||0},clone:function(){return new l(this.row,this.col,this.rel).setSheet(this.sheet,this.hasSheet())},intersect:function(e){return e instanceof l?this.eq(e)?this:s:e.intersect(this)},print:function(e,t){var i,r=this.col,o=this.row,s=this.rel;return null==e?(r=isFinite(r)?1&s?"C["+r+"]":"C"+(r+1):"",o=isFinite(o)?2&s?"R["+o+"]":"R"+(o+1):"",o+r):(i=this.absolute(e,t),i.valid()?n(this._hasSheet&&this.sheet,i.row,i.col,s):"#REF!")},absolute:function(e,t){var n=this.clone();return n.rel&!1?n:(1&n.rel&&(n.col+=t),2&n.rel&&(n.row+=e),n.rel=0,n)},toRangeRef:function(){return new u(this,this)},relative:function(e,t,n){var i,r;return null==n&&(n=this.rel),i=2&n?this.row-e:this.row,r=1&n?this.col-t:this.col,new l(i,r,n).setSheet(this.sheet,this.hasSheet())},height:function(){return 1},width:function(){return 1},toString:function(){return n(null,this.row,this.col,3)},isCell:function(){return!0},leftColumn:function(){return this},rightColumn:function(){return this},topRow:function(){return this},bottomRow:function(){return this},forEachRow:function(e){e(this.toRangeRef())},forEachColumn:function(e){e(this.toRangeRef())},adjust:function(e,t,n,i,r,o,a){var l=this.absolute(e,t);if(r){if(l.row>=o){if(0>a&&o-a>l.row)return s;l.row+=a}}else if(l.col>=o){if(0>a&&o-a>l.col)return s;l.col+=a}return null!=n&&null!=i&&(l=l.relative(n,i,this.rel)),l},valid:function(){if(this.rel)throw Error("valid() called on relative reference");var e=this.col,t=this.row;return!(isFinite(e)&&0>e||isFinite(t)&&0>t)}}),u=o.extend({ref:"range",init:function(e,t){e._hasSheet&&t._hasSheet&&e.sheet.toLowerCase()!=t.sheet.toLowerCase()&&(this.endSheet=t.sheet),this.topLeft=new l(e.row,e.col,e.rel),this.bottomRight=new l(t.row,t.col,t.rel),this.normalize()},clone:function(){return new u(this.topLeft.clone(),this.bottomRight.clone()).setSheet(this.sheet,this.hasSheet())},_containsRange:function(e){return this._containsCell(e.topLeft)&&this._containsCell(e.bottomRight)},_containsCell:function(e){return e.sheet==this.sheet&&e.row>=this.topLeft.row&&e.col>=this.topLeft.col&&this.bottomRight.row>=e.row&&this.bottomRight.col>=e.col},contains:function(e){if(e instanceof Array){var t=this;return e.some(function(e){return t.contains(e)})}return e instanceof l?this._containsCell(e):e instanceof u?this._containsRange(e):!1},_intersectRange:function(e){var t,n,i,r,o,a,c,h;return this.sheet!=e.sheet?s:(t=this.topLeft.col,n=this.topLeft.row,i=this.bottomRight.col,r=this.bottomRight.row,o=e.topLeft.col,a=e.topLeft.row,c=e.bottomRight.col,h=e.bottomRight.row,c>=t&&i>=o&&h>=n&&r>=a?new u(new l(Math.max(n,a),Math.max(t,o)),new l(Math.min(r,h),Math.min(i,c))).setSheet(this.sheet,this.hasSheet()):s)},intersect:function(e){if(e===s)return e;if(e instanceof l)return this._containsCell(e)?e:s;if(e instanceof u)return this._intersectRange(e).simplify();if(e instanceof c)return e.intersect(this);throw Error("Unknown reference")},simplify:function(){return this.isCell()?new l(this.topLeft.row,this.topLeft.col,this.topLeft.rel).setSheet(this.sheet,this.hasSheet()):this},normalize:function(){var e,t=this.topLeft,n=this.bottomRight,i=t.row,r=t.col,o=n.row,s=n.col,a=2&t.rel,u=1&t.rel,c=2&n.rel,h=1&n.rel,d=!1;return i>o&&(d=!0,e=i,i=o,o=e,e=a,a=c,c=e),r>s&&(d=!0,e=r,r=s,s=e,e=u,u=h,h=e),d&&(this.topLeft=new l(i,r,u|a),this.bottomRight=new l(o,s,h|c)),this},print:function(e,n){var i,r=this.absolute(e,n);return r.valid()?(i=this.topLeft.print(e,n)+":"+this.bottomRight.print(e,n),this.hasSheet()&&(i=t(this.sheet)+(this.endSheet?":"+t(this.endSheet):"")+"!"+i),i):"#REF!"},absolute:function(e,t){return new u(this.topLeft.absolute(e,t),this.bottomRight.absolute(e,t)).setSheet(this.sheet,this.hasSheet())},relative:function(e,t,n,i){return null==i&&(i=n),new u(this.topLeft.relative(e,t,n),this.bottomRight.relative(e,t,i)).setSheet(this.sheet,this.hasSheet())},height:function(){if(this.topLeft.rel!=this.bottomRight.rel)throw Error("Mixed relative/absolute references");return this.bottomRight.row-this.topLeft.row+1},width:function(){if(this.topLeft.rel!=this.bottomRight.rel)throw Error("Mixed relative/absolute references");return this.bottomRight.col-this.topLeft.col+1},collapse:function(){return this.topLeft.toRangeRef()},leftColumn:function(){return new u(this.topLeft,new l(this.bottomRight.row,this.topLeft.col))},rightColumn:function(){return new u(new l(this.topLeft.row,this.bottomRight.col),this.bottomRight)},topRow:function(){return new u(this.topLeft,new l(this.topLeft.row,this.bottomRight.col))},bottomRow:function(){return new u(new l(this.bottomRight.row,this.topLeft.col),this.bottomRight)},toRangeRef:function(){return this},toRow:function(e){return new u(new l(this.topLeft.row+e,this.topLeft.col),new l(this.topLeft.row+e,this.bottomRight.col))},toColumn:function(e){return new u(new l(this.topLeft.row,this.topLeft.col+e),new l(this.bottomRight.row,this.topLeft.col+e))},forEachRow:function(e){var t,n=this.topLeft.row,i=this.bottomRight.row,r=this.topLeft.col,o=this.bottomRight.col;for(t=n;i>=t;t++)e(new u(new l(t,r),new l(t,o)))},forEachColumn:function(e){var t,n=this.topLeft.row,i=this.bottomRight.row,r=this.topLeft.col,o=this.bottomRight.col;for(t=r;o>=t;t++)e(new u(new l(n,t),new l(i,t)))},intersecting:function(e){return e.filter(function(e){return e.toRangeRef().intersects(this)},this)},union:function(e,t){var n,i=this.intersecting(e),r=this.topLeft.row,o=this.topLeft.col,s=this.bottomRight.row,a=this.bottomRight.col,c=!1;return i.forEach(function(e){e=e.toRangeRef(),r>e.topLeft.row&&(c=!0,r=e.topLeft.row),o>e.topLeft.col&&(c=!0,o=e.topLeft.col),e.bottomRight.row>s&&(c=!0,s=e.bottomRight.row),e.bottomRight.col>a&&(c=!0,a=e.bottomRight.col),t&&t(e)}),n=new u(new l(r,o),new l(s,a)),c?n.union(e,t):n},resize:function(e){function t(e){return e||0}var n=Math.max.bind(Math,0),i=this.topLeft.row+t(e.top),r=this.topLeft.col+t(e.left),o=this.bottomRight.row+t(e.bottom),a=this.bottomRight.col+t(e.right);return 0>r&&0>a||0>i&&0>o?s:o>=i&&a>=r?new u(new l(n(i),n(r)),new l(n(o),n(a))):s},move:function(e,t){return new u(new l(this.topLeft.row+e,this.topLeft.col+t),new l(this.bottomRight.row+e,this.bottomRight.col+t))},first:function(){return this.topLeft},isCell:function(){return!this.endSheet&&this.topLeft.eq(this.bottomRight)},toString:function(){return this.topLeft+":"+this.bottomRight},adjust:function(e,t,n,i,r,o,a){var l=this.topLeft.adjust(e,t,n,i,r,o,a),c=this.bottomRight.adjust(e,t,n,i,r,o,a);return l===s&&c===s?s:(l===s?(l=this.topLeft.absolute(e,t),r?l.row=o:l.col=o,null!=n&&null!=i&&(l=l.relative(n,i,this.topLeft.rel))):c===s&&(c=this.bottomRight.absolute(e,t),r?c.row=o-1:c.col=o-1,null!=n&&null!=i&&(c=c.relative(n,i,this.bottomRight.rel))),new u(l,c).setSheet(this.sheet,this.hasSheet()).simplify())},valid:function(){return this.topLeft.valid()&&this.bottomRight.valid()}}),c=o.extend({init:function(e){this.refs=e,this.length=this.refs.length},intersect:function(e){var t,n,i=[];for(t=0;this.length>t;++t)n=e.intersect(this.refs[t]),n!==s&&i.push(n);return i.length>0?new c(i).simplify():s},simplify:function(){var e=new c(this.refs.reduce(function(e,t){return t=t.simplify(),t!==s&&e.push(t),e},[]));return e.empty()?s:e.single()?e.refs[0]:e},absolute:function(e,t){return new c(this.refs.map(function(n){return n.absolute(e,t)}))},forEach:function(e,t){this.refs.forEach(e,t)},toRangeRef:function(){return this.refs[0].toRangeRef()},contains:function(e){return this.refs.some(function(t){return t.contains(e)})},map:function(e,t){return new c(this.refs.map(e,t))},first:function(){return this.refs[0].first()},lastRange:function(){return this.refs[this.length-1]},size:function(){return this.length},single:function(){return 1==this.length},empty:function(){return 0===this.length},isCell:function(){return this.single()&&this.refs[0].isCell()},rangeAt:function(e){return this.refs[e]},nextRangeIndex:function(e){return e===this.length-1?0:e+1},previousRangeIndex:function(e){return 0===e?this.length-1:e-1},concat:function(e){return new c(this.refs.concat([e]))},print:function(e,t){return this.refs.map(function(n){return n.print(e,t)}).join(",")},replaceAt:function(e,t){var n=this.refs.slice();return n.splice(e,1,t),new c(n)},leftColumn:function(){return this.map(function(e){return e.leftColumn()})},rightColumn:function(){return this.map(function(e){return e.rightColumn()})},topRow:function(){return this.map(function(e){return e.topRow()})},bottomRow:function(){return this.map(function(e){return e.bottomRow()})},forEachRow:function(e){this.forEach(function(t){t.forEachRow(e)})},forEachColumn:function(e){this.forEach(function(t){t.forEachColumn(e)})},adjust:function(e,t,n,i,r,o,s){return this.map(function(a){return a.adjust(e,t,n,i,r,o,s)}).simplify()},toString:function(){return this.refs.map(function(e){return""+e}).join(", ")},valid:function(){for(var e=this.refs.length;--e>=0;)if(this.refs[e].valid())return!1;return!0}}),i.NULLREF=s,i.SHEETREF=new u(new l(0,0),new l(1/0,1/0)),i.FIRSTREF=new l(0,0),i.Ref=o,i.NameRef=a,i.CellRef=l,i.RangeRef=u,i.UnionRef=c,i.SHEETREF.print=function(){return"#SHEET"})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/autofillcalculator.min",["kendo.core.min"],e)}(function(){!function(e){var t,n,i;e.support.browser.msie&&9>e.support.browser.version||(t=e.spreadsheet.RangeRef,n=e.spreadsheet.CellRef,i=e.Class.extend({init:function(e){this._grid=e},rectIsVertical:function(e,t,n,i){var r=this._grid.rectangle(e.toRangeRef()),o=this._grid.rectangle(t.toRangeRef());return Math.abs(o[i]-r[i])>Math.abs(r[n]-o[n])},autoFillDest:function(e,i){var r,o,s,a,l,u,c,h=e.topLeft,d=e.bottomRight,f=i.row>=h.row,p=i.col>=h.col;return r=f?p?4:3:p?2:1,4===r?(o=h,s=d,l=i.row>s.row||i.col>s.col,l&&(i=new n(Math.max(i.row,s.row),Math.max(i.col,s.col))),a=this.rectIsVertical(s,i,"right","bottom")?new n(i.row,s.col):new n(s.row,i.col)):3===r?(u=new n(h.col,d.row),i.row>d.row&&this.rectIsVertical(u,i,"left","bottom")?(o=h,a=new n(i.row,d.col)):(o=d,a=new n(h.row,i.col))):2===r?(c=new n(h.row,d.col),i.col>d.col&&!this.rectIsVertical(c,i,"right","top")?(o=h,a=new n(d.row,i.col)):(o=d,a=new n(i.row,h.col))):(o=d,a=this.rectIsVertical(h,i,"left","top")?new n(i.row,h.col):new n(h.row,i.col)),this._grid.normalize(new t(o,a))}}),e.spreadsheet.AutoFillCalculator=i)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/navigator.min",["kendo.core.min","spreadsheet/autofillcalculator.min"],e)}(function(){!function(e){var t,n,i,r;e.support.browser.msie&&9>e.support.browser.version||(t=e.spreadsheet.RangeRef,n=e.spreadsheet.CellRef,i=e.Class.extend({init:function(e,t,n,i){this.rangeGetter=n,this.prevLeft=function(n){var r=i(this.range(n)),o=this.range(t.prevVisible(r.topLeft[e]));return i(o).topLeft[e]},this.nextRight=function(n){var r=i(this.range(n)),o=this.range(t.nextVisible(r.bottomRight[e]));return i(o).bottomRight[e]},this.nextLeft=function(n){var r=i(this.range(n));return t.nextVisible(r.bottomRight[e])},this.prevRight=function(n){var r=i(this.range(n));return t.prevVisible(r.topLeft[e])}},boundary:function(e,t){this.top=e,this.bottom=t},range:function(e){return this.rangeGetter(e,this.top,this.bottom)}}),r=e.Class.extend({init:function(t){this._sheet=t,this.columns=this._sheet._grid._columns,this.autoFillCalculator=new e.spreadsheet.AutoFillCalculator(t._grid),this.colEdge=new i("col",this._sheet._grid._columns,this.columnRange.bind(this),this.union.bind(this)),this.rowEdge=new i("row",this._sheet._grid._rows,this.rowRange.bind(this),this.union.bind(this))},height:function(e){this._viewPortHeight=e},union:function(e){return this._sheet.unionWithMerged(e)},columnRange:function(e,t,n){return this._sheet._ref(t,e,n-t,1)},rowRange:function(e,t,n){return this._sheet._ref(e,t,1,n-t)},selectionIncludesMergedCells:function(){return this._sheet.select().contains(this._sheet._mergedCells)},setSelectionValue:function(e){var t=this._sheet.selection();setTimeout(function(){t.value(e())})},selectAll:function(){this._sheet.select(this._sheet._sheetRef)},select:function(e,t,n){e=this.refForMode(e,t),n&&(e=this._sheet.select().concat(e)),this._sheet.select(e)},refForMode:function(e,t){var n=this._sheet._grid;switch(t){case"range":e=n.normalize(e);break;case"row":e=n.rowRef(e.row);break;case"column":e=n.colRef(e.col);break;case"sheet":e=this._sheet._sheetRef}return e},startSelection:function(e,t,n){"autofill"==t?this._sheet.startAutoFill():(this._sheet.startSelection(),this.select(e,t,n))},completeSelection:function(){this._sheet.completeSelection()},selectForContextMenu:function(e,t){var n=this._sheet;n.select().contains(this.refForMode(e,t))||this.select(e,t)},modifySelection:function(e){var n,i,r=this.determineDirection(e),o=this._sheet,s=this._viewPortHeight,a=o._grid._rows,l=o._grid._columns,u=o.currentOriginalSelectionRange(),c=o.select().toRangeRef(),h=o.activeCell(),d=u.topLeft.clone(),f=u.bottomRight.clone();switch(this.colEdge.boundary(c.topLeft.row,c.bottomRight.row),this.rowEdge.boundary(c.topLeft.col,c.bottomRight.col),r){case"expand-left":d.col=this.colEdge.prevLeft(d.col),n=d;break;case"shrink-right":d.col=this.colEdge.nextLeft(d.col),n=d;break;case"expand-right":f.col=this.colEdge.nextRight(f.col),n=f;break;case"shrink-left":f.col=this.colEdge.prevRight(f.col),n=f;break;case"expand-up":d.row=this.rowEdge.prevLeft(d.row),n=d;break;case"shrink-down":d.row=this.rowEdge.nextLeft(d.row),n=d;break;case"expand-down":f.row=this.rowEdge.nextRight(f.row),n=f;break;case"shrink-up":f.row=this.rowEdge.prevRight(f.row),n=f;break;case"expand-page-up":d.row=a.prevPage(d.row,s);break;case"shrink-page-up":f.row=a.prevPage(f.row,s);break;case"expand-page-down":f.row=a.nextPage(f.row,s);break;case"shrink-page-down":d.row=a.nextPage(d.row,s);break;case"first-col":d.col=l.firstVisible(),f.col=h.bottomRight.col,n=d;break;case"last-col":f.col=l.lastVisible(),d.col=h.topLeft.col,n=f;break;case"first-row":d.row=a.firstVisible(),f.row=h.bottomRight.row,n=d;break;case"last-row":f.row=a.lastVisible(),d.row=h.topLeft.row,n=f;break;case"last":f.row=a.lastVisible(),f.col=l.lastVisible(),d=h.topLeft,n=f;break;case"first":d.row=a.firstVisible(),d.col=l.firstVisible(),f=h.bottomRight,n=d}return i=new t(d,f),this.union(i).intersects(h)?(n&&o.focus(n),void this.updateCurrentSelectionRange(i)):void this.modifySelection(r.replace("shrink","expand"))},moveActiveCell:function(e){var t=this._sheet,i=t.activeCell(),r=i.topLeft,o=i.bottomRight,s=t.originalActiveCell(),a=t._grid._rows,l=t._grid._columns,u=s.row,c=s.col;switch(e){case"left":c=l.prevVisible(r.col);break;case"up":u=a.prevVisible(r.row);break;case"right":c=l.nextVisible(o.col);break;case"down":u=a.nextVisible(o.row);break;case"first-col":c=l.firstVisible();break;case"last-col":c=l.lastVisible();break;case"first-row":u=a.firstVisible();break;case"last-row":u=a.lastVisible();break;case"last":u=a.lastVisible(),c=l.lastVisible();break;case"first":u=a.firstVisible(),c=l.firstVisible();break;case"next-page":u=a.nextPage(o.row,this._viewPortHeight);break;case"prev-page":u=a.prevPage(o.row,this._viewPortHeight)}t.select(new n(u,c))},navigateInSelection:function(e){for(var t,i=this._sheet,r=i.activeCell(),o=r.topLeft,s=i.originalActiveCell(),a=i._grid._rows,l=i._grid._columns,u=s.row,c=s.col,h=i.currentNavigationRange(),d=h.topLeft,f=h.bottomRight,p=!1,m=o.col,g=o.row;!p;){switch(t=new n(u,c),e){case"next":f.eq(t)?(h=i.nextNavigationRange(),u=h.topLeft.row,c=h.topLeft.col):(c=l.nextVisible(m,!0),c>f.col&&(c=d.col,u=a.nextVisible(u,!0)));break;case"previous":d.eq(t)?(h=i.previousNavigationRange(),u=h.bottomRight.row,c=h.bottomRight.col):(c=l.prevVisible(m,!0),d.col>c&&(c=f.col,u=a.prevVisible(u,!0)));break;case"lower":f.eq(t)?(h=i.nextNavigationRange(),u=h.topLeft.row,c=h.topLeft.col):(u=a.nextVisible(g,!0),u>f.row&&(u=d.row,c=l.nextVisible(c,!0)));break;case"upper":d.eq(t)?(h=i.previousNavigationRange(),u=h.bottomRight.row,c=h.bottomRight.col):(u=a.prevVisible(g,!0),d.row>u&&(u=f.row,c=l.prevVisible(c,!0)));break;default:throw Error("Unknown entry navigation: "+e)}p=!this.shouldSkip(u,c),m=c,g=u}i.singleCellSelection()?i.select(new n(u,c)):i.activeCell(new n(u,c))},extendSelection:function(e,n){var i,r=this._sheet,o=r._grid;
  return"autofill"===n?void this.resizeAutoFill(e):("range"===n?e=o.normalize(e):"row"===n?e=o.rowRef(e.row).bottomRight:"column"===n&&(e=o.colRef(e.col).bottomRight),i=r.originalActiveCell().toRangeRef(),void this.updateCurrentSelectionRange(new t(i.topLeft,e)))},shouldSkip:function(e,t){var i=new n(e,t),r=!1;return this._sheet.forEachMergedCell(function(e){e.intersects(i)&&!e.collapse().eq(i)&&(r=!0)}),r},resizeAutoFill:function(e){var t,n,i,r,o,s=this._sheet,a=s.select(),l=s._autoFillOrigin,u=this.autoFillCalculator.autoFillDest(a,e),c=this.punch(a,u);c||(r=s.range(u)._previewFillFrom(s.range(l)),r&&(n=r.direction,o=r.props,0===n||1==n?(i=o[o.length-1],t=i[i.length-1].value):2===n?(i=o[0],t=i[i.length-1].value):3===n&&(i=o[o.length-1],t=i[0].value))),s.updateAutoFill(u,c,t,n)},determineDirection:function(e){var t=this._sheet.currentSelectionRange(),n=this._sheet.activeCell(),i=n.topLeft.col==t.topLeft.col,r=n.bottomRight.col==t.bottomRight.col,o=n.topLeft.row==t.topLeft.row,s=n.bottomRight.row==t.bottomRight.row;switch(e){case"left":e=r?"expand-left":"shrink-left";break;case"right":e=i?"expand-right":"shrink-right";break;case"up":e=s?"expand-up":"shrink-up";break;case"down":e=o?"expand-down":"shrink-down";break;case"prev-page":e=s?"expand-page-up":"shrink-page-up";break;case"next-page":e=o?"expand-page-down":"shrink-page-down"}return e},updateCurrentSelectionRange:function(e){var t=this._sheet;t.select(t.originalSelect().replaceAt(t.selectionRangeIndex(),e),!1)},punch:function(e,i){var r,o,s;return i.topLeft.eq(e.topLeft)&&(e.bottomRight.row>i.bottomRight.row?(o=this.rowEdge.nextRight(i.bottomRight.row),r=new t(new n(o,e.topLeft.col),e.bottomRight)):e.bottomRight.col>i.bottomRight.col&&(s=this.colEdge.nextRight(i.bottomRight.col),r=new t(new n(e.topLeft.row,s),e.bottomRight))),r}}),e.spreadsheet.SheetNavigator=r)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/axismanager.min",["kendo.core.min"],e)}(function(){!function(e){if(!(e.support.browser.msie&&9>e.support.browser.version)){var t=e.Class.extend({init:function(e){this._sheet=e},forEachSelectedColumn:function(e){var t=this._sheet;t.batch(function(){t.select().forEachColumnIndex(function(n,i){e(t,n,i)})},{layout:!0,recalc:!0})},forEachSelectedRow:function(e){var t=this._sheet;t.batch(function(){t.select().forEachRowIndex(function(n,i){e(t,n,i)})},{layout:!0,recalc:!0})},includesHiddenColumns:function(e){return this._sheet._grid._columns.includesHidden(e.topLeft.col,e.bottomRight.col)},includesHiddenRows:function(e){return this._sheet._grid._rows.includesHidden(e.topLeft.row,e.bottomRight.row)},selectionIncludesHiddenColumns:function(){return this.includesHiddenColumns(this._sheet.select())},selectionIncludesHiddenRows:function(){return this.includesHiddenRows(this._sheet.select())},deleteSelectedColumns:function(){this.forEachSelectedColumn(function(e,t,n){e.deleteColumn(t-n)})},deleteSelectedRows:function(){this.forEachSelectedRow(function(e,t,n){e.deleteRow(t-n)})},hideSelectedColumns:function(){this.forEachSelectedColumn(function(e,t){e.hideColumn(t)})},hideSelectedRows:function(){this.forEachSelectedRow(function(e,t){e.hideRow(t)})},unhideSelectedColumns:function(){this.forEachSelectedColumn(function(e,t){e.unhideColumn(t)})},unhideSelectedRows:function(){this.forEachSelectedRow(function(e,t){e.unhideRow(t)})},addColumnLeft:function(){this.forEachSelectedColumn(function(e,t,n){e.insertColumn(t-n)})},addColumnRight:function(){this.forEachSelectedColumn(function(e,t,n){e.insertColumn(t+(n+1))})},canAddRow:function(){var e=this._sheet.select().toRangeRef(),t=e.height();return this._sheet.canInsertRow(0,t)},addRowAbove:function(){this.forEachSelectedRow(function(e,t,n){e.insertRow(t-n)})},addRowBelow:function(){this.forEachSelectedRow(function(e,t,n){e.insertRow(t+(n+1))})}});e.spreadsheet.AxisManager=t}}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/clipboard.min",["kendo.core.min"],e)}(function(){!function(e){var t,n,i,r;e.support.browser.msie&&9>e.support.browser.version||(t=e.jQuery,n=e.spreadsheet.RangeRef,i=e.spreadsheet.CellRef,r=e.Class.extend({init:function(t){this.workbook=t,this.origin=e.spreadsheet.NULLREF,this.iframe=document.createElement("iframe"),this.iframe.className="k-spreadsheet-clipboard-paste",this.menuInvoked=!0,this._external={},this._uid=e.guid(),document.body.appendChild(this.iframe)},canCopy:function(){var t={canCopy:!0},n=this.workbook.activeSheet().select();return n===e.spreadsheet.NULLREF&&(t.canCopy=!1),n instanceof e.spreadsheet.UnionRef&&(t.canCopy=!1,t.multiSelection=!0),this.menuInvoked&&(t.canCopy=!1,t.menuInvoked=!0),t},canPaste:function(){var t,n=this.workbook.activeSheet(),i=this.pasteRef(),r={canPaste:!0};return i===e.spreadsheet.NULLREF?(t=this._external.hasOwnProperty("html")||this._external.hasOwnProperty("plain"),r.pasteOnMerged=this.intersectsMerged(),r.canPaste=r.pasteOnMerged?!1:t,r):(i.eq(n.unionWithMerged(i))||(r.canPaste=!1,r.pasteOnMerged=!0),this.menuInvoked&&(r.canPaste=!1,r.menuInvoked=!0),r)},intersectsMerged:function(){var e,t=this.workbook.activeSheet(),n=this.parse(this._external);return this.origin=this.stateRangeRef(n),e=this.pasteRef(),!e.eq(t.unionWithMerged(e))},copy:function(){var e=this.workbook.activeSheet();this.origin=e.select(),this.contents=e.selection().getState()},cut:function(){var e=this.workbook.activeSheet();this.copy(),e.range(e.select()).clear()},pasteRef:function(){var e=this.workbook.activeSheet(),t=e.activeCell().first(),n=this.origin.first(),i=n.row-t.row,r=n.col-t.col;return this.origin.relative(i,r,3)},stateRangeRef:function(e){var t,r,o,s,a=[],l=[];for(t in e)"mergedCells"!==t&&"ref"!==t&&(r=t.split(","),a.push(r[0]),l.push(r[1]));return o=new i(Math.min.apply(null,a),Math.min.apply(null,l)),s=new i(Math.max.apply(null,a),Math.max.apply(null,l)),new n(o,s)},destroy:function(){document.body.removeChild(this.iframe)},paste:function(){var e,t={},n=this.workbook.activeSheet();this._isInternal()?t=this.contents:(t=this.parse(this._external),this.origin=this.stateRangeRef(t)),e=this.pasteRef(),n.range(e).clear().setState(t),n.triggerChange({recalc:!0,ref:e})},external:function(e){return e.html||e.plain?void(this._external=e):this._external},parse:function(e){var n,r,o,s={ref:new i(0,0,0),mergedCells:[]};return e.html?(n=this.iframe.contentWindow.document,n.open(),n.write(e.html),n.close(),r=t(n).find("table:first"),r.length?s=this._parseHTML(r.find("tbody:first")):e.plain?s=this._parseTSV(e.plain):(o=t(n.body).find(":not(style)"),s["0,0"]=this._cellState(o.text()))):s=this._parseTSV(e.plain),s},_parseHTML:function(e){var n=this,r={ref:new i(0,0,0),mergedCells:[]};return e.find("tr").each(function(n,i){t(i).find("td").each(function(r,o){var s,a,l,u,c,h=parseInt(t(o).attr("rowspan"),10)-1||0,d=parseInt(t(o).attr("colspan"),10)-1||0,f="<td/>";if(h){for(a=n+h,l=n;a>=l;l++)if(u=e.find("tr").eq(l),l>n&&(f="<td class='rowspan'></td>",0===r?u.find("td").eq(r).after(f):(c=Math.min(u.find("td").length,r),u.find("td").eq(c-1).after(f))),d)for(s=r;d+r>s;s++)f="<td class='rowspan colspan'></td>",u.find("td").eq(s).after(f)}else if(d)for(s=r;d+r>s;s++)f="<td class='colspan'></td>",t(i).find("td").eq(s).after(f)})}),e.find("tr").each(function(e,i){t(i).find("td").each(function(i,o){var s,a,l,u=e+","+i,c=parseInt(t(o).attr("rowspan"),10)-1||0,h=parseInt(t(o).attr("colspan"),10)-1||0,d=n._cellState(t(o));r[u]=d,(c||h)&&(s=String.fromCharCode(65+i),a=String.fromCharCode(65+i+h),l=s+(e+1)+":"+a+(e+1+c),r.mergedCells.push(l))})}),r},_parseTSV:function(e){var t,n,r,o,s={ref:new i(0,0,0),mergedCells:[]};if(-1===e.indexOf("	")&&-1==e.indexOf("\n"))s["0,0"]={value:e};else for(t=e.split("\n"),n=0;t.length>n;n++)for(r=t[n].split("	"),o=0;r.length>o;o++)s[n+","+o]={value:r[o]};return s},_isInternal:function(){var e,n;return void 0===this._external.html?!0:(e=t("<div/>").html(this._external.html).find("table.kendo-clipboard-"+this._uid).length?!0:!1,n=t("<div/>").html(this._external.plain).find("table.kendo-clipboard-"+this._uid).length?!0:!1,e||n?!0:!1)},_cellState:function(e){var t=window.getComputedStyle(e[0]),n=e.text(),i=this._borderObject(t),r={value:""===n?null:n,borderBottom:i.borderBottom,borderRight:i.borderRight,borderLeft:i.borderLeft,borderTop:i.borderTop,fontSize:parseInt(t["font-size"],10)};return"rgb(0, 0, 0)"!==t["background-color"]&&"rgba(0, 0, 0, 0)"!==t["background-color"]&&(r.background=t["background-color"]),"rgb(0, 0, 0)"!==t.color&&"rgba(0, 0, 0, 0)"!==t.color&&(r.color=t.color),"underline"==t["text-decoration"]&&(r.underline=!0),"italic"==t["font-style"]&&(r.italic=!0),"bold"==t["font-weight"]&&(r.bold=!0),"right"!==this._strippedStyle(t["text-align"])&&(r.textAlign=this._strippedStyle(t["text-align"])),"middle"!==t["vertical-align"]&&(r.verticalAlign=t["vertical-align"]),"normal"!==t["word-wrap"]&&(r.wrap=!0),r},_strippedStyle:function(e){var t=["-ms-","-moz-","-webkit-"];return t.forEach(function(t){e=e.replace(t,"")}),e},_borderObject:function(e){var t={},n=["borderBottom","borderRight","borderLeft","borderTop"];return n.forEach(function(n){return"none"==e[n+"Style"]?void(t[n]=null):void(t[n]={size:1,color:e[n+"Color"]})}),t}}),e.spreadsheet.Clipboard=r)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/range.min",["kendo.core.min","util/text-metrics.min"],e)}(function(){!function(e){function t(e){return e.replace(/M/g,"m").replace(/'/g,'"').replace(/tt/,"am/pm")}function n(t){return!/^=/.test(t)&&/number|percent/.test(e.spreadsheet.calc.parse(null,0,0,t).type)}function i(t,n,i,r){var o={baselineMarkerSize:0,width:n+"px","font-size":(i||12)+"px","word-break":r===!0?"break-all":"normal","white-space":r===!0?"pre-wrap":"pre"};return e.util.measureText(t,o,u).height}var r,o,s,a,l,u;e.support.browser.msie&&9>e.support.browser.version||(r=e.jQuery,o=e.spreadsheet.UnionRef,s=["color","fontFamily","underline","italic","bold","textAlign","verticalAlign","background"],a={borderTop:{complement:"borderBottom",direction:{top:-1,bottom:-1}},borderLeft:{complement:"borderRight",direction:{left:-1,right:-1}},borderRight:{complement:"borderLeft",direction:{left:1,right:1}},borderBottom:{complement:"borderTop",direction:{top:1,bottom:1}}},l=e.Class.extend({init:function(e,t){this._sheet=t,this._ref=e},_normalize:function(e){return this._sheet._grid.normalize(e)},_set:function(e,t,n){var i=this._sheet;return this._ref.forEach(function(n){i._set(n.toRangeRef(),e,t)}),n||i.triggerChange({recalc:"formula"==e||"value"==e||"validation"==e,value:t,ref:this._ref}),this},_get:function(e){return this._sheet._get(this._ref.toRangeRef(),e)},_property:function(e,t){return void 0===t?this._get(e):this._set(e,t)},value:function(e){return void 0!==e&&this._set("formula",null,!0),this._property("value",e)},resize:function(e){var t=this._resizedRef(e);return new l(t,this._sheet)},_resizedRef:function(e){return this._ref.map(function(t){return t.toRangeRef().resize(e)})},_border:function(t,n){var i,r=a[t].complement,o=a[t].direction,s=this._sheet;return s.batch(function(){i=this._property(t,n),void 0!==n&&this._resizedRef(o).forEach(function(t){t!==e.spreadsheet.NULLREF&&new l(t,s)._property(r,null)})}.bind(this),{}),i},_collapsedBorder:function(t){var n=this._property(t),i=a[t].complement,r=a[t].direction;return this._resizedRef(r).forEach(function(t){if(!n&&t!==e.spreadsheet.NULLREF){var r=new l(t,this._sheet);n=r._property(i)}}.bind(this)),n},borderTop:function(e){return this._border("borderTop",e)},borderRight:function(e){return this._border("borderRight",e)},borderBottom:function(e){return this._border("borderBottom",e)},borderLeft:function(e){return this._border("borderLeft",e)},collapsedBorderTop:function(){return this._collapsedBorder("borderTop")},collapsedBorderRight:function(){return this._collapsedBorder("borderRight")},collapsedBorderBottom:function(){return this._collapsedBorder("borderBottom")},collapsedBorderLeft:function(){return this._collapsedBorder("borderLeft")},input:function(i){var r,o,s,a,l;return void 0!==i?(r=this._ref.toRangeRef().topLeft,o=e.spreadsheet.calc.parse(this._sheet.name(),r.row,r.col,i),this._sheet.batch(function(){var n=null;"exp"==o.type?n=e.spreadsheet.calc.compile(o):o.format?this.format(o.format):"date"==o.type?this.format(t(e.culture().calendar.patterns.d)):"percent"==o.type&&this.format(100*o.value==(100*o.value|0)?"0%":"0.00%"),this.formula(n),n||this.value(o.value)}.bind(this),{recalc:!0,value:i,ref:this._ref,editorChange:this._sheet.isInEditMode()}),this):(i=this._get("value"),s=this._get("format"),a=this._get("formula"),l=s&&!a&&e.spreadsheet.formatting.type(i,s),a?i="="+a:"date"===l?i=e.toString(e.spreadsheet.numberToDate(i),e.culture().calendar.patterns.d):"percent"===l?i=100*i+"%":"string"==typeof i&&(/^[=']/.test(i)||/^(?:true|false)$/i.test(i)||n(i))&&(i="'"+i),i)},enable:function(e){return void 0===e?(e=!0,this._sheet.forEach(this._ref.toRangeRef(),function(t,t,n){n.enable===!1&&(e=!1)}),e):void this._property("enable",e)},format:function(e){return this._property("format",e)},formula:function(e){if(void 0===e){var t=this._get("formula");return t?""+t:null}return this._property("formula",e)},validation:function(e){if(void 0===e){var t=this._get("validation");return t?t.toJSON():null}return this._property("validation",e)},_getValidationState:function(){var e,t,n,i=this._ref.toRangeRef(),r=i.topLeft.row,o=i.topLeft.col,s=i.bottomRight.row,a=i.bottomRight.col;for(e=o;a>=e;e++)for(t=r;s>=t;t++)if(n=this._sheet._validation(t,e),n&&"reject"===n.type&&n.value===!1)return n;return!1},merge:function(){return this._ref=this._sheet._merge(this._ref),this},unmerge:function(){var e=this._sheet._mergedCells;return this._ref.forEach(function(t){t.toRangeRef().intersecting(e).forEach(function(t){e.splice(e.indexOf(t),1)})}),this._sheet.triggerChange({}),this},select:function(){return this._sheet.select(this._ref),this},values:function(t){var n,i,r,s,a,l,u,c,h,d;if(this._ref instanceof o)throw Error("Unsupported for multiple ranges.");if(this._ref===e.spreadsheet.NULLREF){if(void 0!==t)throw Error("Unsupported for NULLREF.");return[]}if(n=this._ref.toRangeRef(),i=n.topLeft.row,r=n.topLeft.col,s=n.bottomRight.row,a=n.bottomRight.col,void 0===t){for(t=Array(n.height()),c=0;t.length>c;c++)t[c]=Array(n.width());for(l=r;a>=l;l++)for(u=i;s>=u;u++)t[u-i][l-r]=this._sheet._value(u,l);return t}for(l=r;a>=l;l++)for(u=i;s>=u;u++)h=t[u-i],h&&(d=h[l-r],void 0!==d&&this._sheet._value(u,l,d));return this._sheet.triggerChange({recalc:!0}),this},_properties:function(t){var n,i,r,s,a,l,u,c,h,d,f;if(this._ref instanceof o)throw Error("Unsupported for multiple ranges.");if(this._ref===e.spreadsheet.NULLREF){if(void 0!==t)throw Error("Unsupported for NULLREF.");return[]}if(n=this._ref.toRangeRef(),i=n.topLeft.row,r=n.topLeft.col,s=n.bottomRight.row,a=n.bottomRight.col,c=this._sheet,void 0===t)return t=Array(n.height()),c.forEach(n,function(e,n,o){e-=i,n-=r;var s=t[e]||(t[e]=[]);s[n]=o}),t;for(n=n.clone(),d=function(e){var t=h[e];n.topLeft.row=n.bottomRight.row=u,n.topLeft.col=n.bottomRight.col=l,c._set(n,e,t)},l=r;a>=l;l++)for(u=i;s>=u;u++)f=t[u-i],f&&(h=f[l-r],h&&Object.keys(h).forEach(d));return c.triggerChange({recalc:!0,ref:this._ref}),this},clear:function(e){var t=!e||!Object.keys(e).length,n=this._sheet,i={recalc:t||e&&e.contentsOnly===!0,ref:this._ref};return n.batch(function(){i.recalc&&this.formula(null),t&&this.validation(null),(t||e&&e.formatOnly===!0)&&(s.forEach(function(e){this[e](null)}.bind(this)),this.format(null),this.unmerge())}.bind(this),i),this},clearContent:function(){return this.clear({contentsOnly:!0})},clearFormat:function(){return this.clear({formatOnly:!0})},isSortable:function(){return!(this._ref instanceof o||this._ref===e.spreadsheet.NULLREF)},sort:function(t){if(this._ref instanceof o)throw Error("Unsupported for multiple ranges.");if(this._ref===e.spreadsheet.NULLREF)throw Error("Unsupported for NULLREF.");return void 0===t&&(t={column:0}),t=t instanceof Array?t:[t],this._sheet._sortBy(this._ref.toRangeRef(),t.map(function(e,t){return"number"==typeof e&&(e={column:e}),{index:void 0===e.column?t:e.column,ascending:void 0===e.ascending?!0:e.ascending}})),this},isFilterable:function(){return!(this._ref instanceof o)},filter:function(e){if(this._ref instanceof o)throw Error("Unsupported for multiple ranges.");return e===!1?this.clearFilters():(e=e===!0?[]:e instanceof Array?e:[e],this._sheet._filterBy(this._ref.toRangeRef(),e.map(function(e,t){return{index:void 0===e.column?t:e.column,filter:e.filter}}))),this},clearFilter:function(e){this._sheet.clearFilter(e)},clearFilters:function(){var e,t=this._sheet.filter(),n=[];if(t){for(e=0;t.columns.length>e;e++)n.push(e);this._sheet.batch(function(){this.clearFilter(n),this._filter=null},{layout:!0,filter:!0})}},hasFilter:function(){var e=this._sheet.filter();return!!e},leftColumn:function(){return new l(this._ref.leftColumn(),this._sheet)},rightColumn:function(){return new l(this._ref.rightColumn(),this._sheet)},topRow:function(){return new l(this._ref.topRow(),this._sheet)},bottomRow:function(){return new l(this._ref.bottomRow(),this._sheet)},column:function(e){return new l(this._ref.toColumn(e),this._sheet)},row:function(e){return new l(this._ref.toRow(e),this._sheet)},forEachRow:function(e){this._ref.forEachRow(function(t){e(new l(t,this._sheet))}.bind(this))},forEachColumn:function(e){this._ref.forEachColumn(function(t){e(new l(t,this._sheet))}.bind(this))},sheet:function(){return this._sheet},topLeft:function(){return this._ref.toRangeRef().topLeft},intersectingMerged:function(){var e=this._sheet,t=[];return e._mergedCells.forEach(function(e){e.intersects(this._ref)&&t.push(""+e)}.bind(this)),t},getState:function(t){var n,i={ref:this._ref.first()};return t?n="input"===t?["value","formula"]:"border"===t?["borderLeft","borderTop","borderRight","borderBottom"]:[t]:(n=e.spreadsheet.ALL_PROPERTIES,i.mergedCells=this.intersectingMerged()),this.forEachCell(function(e,t,r){var o=i[e+","+t]={};n.forEach(function(e){o[e]=r[e]||null})}),i},setState:function(e){var t=this._sheet,n=this._ref.first(),i=e.ref.row-n.row,r=e.ref.col-n.col;t.batch(function(){e.mergedCells&&this.unmerge(),this.forEachCell(function(n,o){var s,a=e[n+i+","+(o+r)],l=t.range(n,o);for(s in a)"value"!=s&&l._set(s,a[s]);a.formula||l._set("value",a.value)}),e.mergedCells&&e.mergedCells.forEach(function(e){e=t._ref(e).relative(i,r,3),t.range(e).merge()},this)}.bind(this),{recalc:!0})},_adjustRowHeight:function(){var t,n=this._sheet,i=this.getState(),r=[];for(t=0;i.mergedCells.length>t;t++)r.push(n.range(i.mergedCells[t]));this.forEachRow(function(t){var i=t.sheet().rowHeight(t.topLeft().row);t.forEachCell(function(t,o,s){var a,l,u=n.range(t,o),c=0;for(a=0;r.length>a;a++)if(u._ref.intersects(r[a]._ref)){c+=s.width;break}l=Math.max(n.columnWidth(o),c),i=Math.max(i,e.spreadsheet.util.getTextHeight(s.value,l,s.fontSize,s.wrap))}),n.rowHeight(t.topLeft().row,Math.max(n.rowHeight(t.topLeft().row),i))})},forEachCell:function(e){this._ref.forEach(function(t){this._sheet.forEach(t.toRangeRef(),e.bind(this))}.bind(this))},hasValue:function(){var e=!1;return this.forEachCell(function(t,n,i){0!==Object.keys(i).length&&(e=!0)}),e},wrap:function(t){return void 0===t?!!this._property("wrap"):(this.forEachRow(function(t){var n=t.sheet().rowHeight(t.topLeft().row);t.forEachCell(function(t,i,r){var o=this._sheet.columnWidth(i);null!==r.value&&void 0!==r.value&&(n=Math.max(n,e.spreadsheet.util.getTextHeight(r.value,o,r.fontSize,!0)))}),t.sheet().rowHeight(t.topLeft().row,n)}.bind(this)),this._property("wrap",t),this)},fontSize:function(t){return void 0===t?this._property("fontSize"):(this.forEachRow(function(n){var i=n.sheet().rowHeight(n.topLeft().row);n.forEachCell(function(n,r,o){var s=this._sheet.columnWidth(r);null!==o.value&&void 0!==o.value&&(i=Math.max(i,e.spreadsheet.util.getTextHeight(o.value,s,t,o.wrap)))}),n.sheet().rowHeight(n.topLeft().row,i)}.bind(this)),this._property("fontSize",t),this)},draw:function(e,t){this._sheet.draw(this,e,t)}}),r.each(s,function(e,t){l.prototype[t]=function(e){return this._property(t,e)}}),u=r('<div style="position: absolute !important; top: -4000px !important; height: auto !important;padding: 1px !important; margin: 0 !important; border: 1px solid black !important;line-height: normal !important; visibility: hidden !important;white-space: pre-wrap !important; word-break: break-all !important;" />')[0],e.spreadsheet.util={getTextHeight:i},e.spreadsheet.Range=l)}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/runtime.min",["spreadsheet/references.min"],e)}(function(){"use strict";function e(t){return t instanceof e?t:void(this.code=t)}function t(e,t,n){for(var i,r=n(e),o=e;++e<t;)i=n(e),i>r&&(r=i,o=e);return o}function n(t,n){function i(e){var t,n,l,u;return a=e[0],t="{ ",Array.isArray(a)?(c+="while (i < args.length) { ",h+="while (i < args.length) { ",t+="xargs.push(tmp = []); stack.push(xargs); xargs = tmp; ",t+="while (i < args.length) { ",t+=e.map(i).join(""),t+="} ",t+="xargs = stack.pop(); ",h+="} ",c+="} "):"+"==a?(c+="while (i < args.length) { ",h+="while (i < args.length) { ",t+="xargs.push(tmp = []); stack.push(xargs); xargs = tmp; ",t+="do { ",t+=e.slice(1).map(i).join(""),t+="} while (i < args.length); ",t+="xargs = stack.pop(); ",h+="} ",c+="} "):"?"==a?t+="if (!("+s(e[1])+")) return new CalcError(err); ":(n=e[1],Array.isArray(n)&&/^#?collect/.test(n[0])?(l=n[2],r(),t+="try {var $"+a+" = this.cellValues(args.slice(i",l&&(t+=", i + "+l),t+=")).filter(function($"+a+"){ ","collect"==n[0]&&(t+="if ($"+a+" instanceof CalcError) throw $"+a+"; "),t+="return "+s(n[1])+"; }, this); ",t+=l?"i += "+l+"; ":"i = args.length; ",t+="xargs.push($"+a+")} catch(ex) { if (ex instanceof CalcError) return ex; throw ex; } ",h+="toResolve.push(args.slice(i)); "):"rest"==n?t+="xargs.push(args.slice(i)); i = args.length; ":((p=/^\*/.test(a))&&(m=!0,a=a.substr(1)),t+="var $"+a+" = args[i++]; ",u=!1,/!$/.test(n)?(n=n.substr(0,n.length-1),u=!0):t+="if ($"+a+" instanceof CalcError) return $"+a+"; ",t+=o(n,u)+"xargs.push($"+a+"); ")),t+="} "}function r(){return l?"$"+a:(f=!0,l=!0,h+="toResolve.push(args[i++]); ","($"+a+" = this.force($"+a+"))")}function o(e,t){l=!1;var n="if (!("+s(e)+")) { ";return l&&!t&&(n+=" if ($"+a+" instanceof CalcError) return $"+a+"; "),n+="return new CalcError(err); } ",l||(h+="i++; "),c+=p?"var $"+a+" = this.asMatrix(args[i]); if ($"+a+") { xargs.push($"+a+"); width = Math.max(width, $"+a+".width); height = Math.max(height, $"+a+".height); arrays.push(true) } else { xargs.push(args[i]); arrays.push(false); } i++; ":"xargs.push(args[i++]); arrays.push(false); ",n}function s(e){if(Array.isArray(e)){if("or"==e[0])return"("+e.slice(1).map(s).join(") || (")+")";if("and"==e[0])return"("+e.slice(1).map(s).join(") && (")+")";if("values"==e[0])return"("+e.slice(1).map(function(e){return r()+" === "+e}).join(") || (")+")";if("null"==e[0])return"("+s("null")+" ? (($"+a+" = "+e[1]+"), true) : false)";if("between"==e[0]||"[between]"==e[0])return"("+r()+" >= "+e[1]+" && $"+a+" <= "+e[2]+" ? true : ((err = 'NUM'), false))";if("(between)"==e[0])return"("+r()+" > "+e[1]+" && $"+a+" < "+e[2]+" ? true : ((err = 'NUM'), false))";if("(between]"==e[0])return"("+r()+" > "+e[1]+" && $"+a+" <= "+e[2]+" ? true : ((err = 'NUM'), false))";if("[between)"==e[0])return"("+r()+" >= "+e[1]+" && $"+a+" < "+e[2]+" ? true : ((err = 'NUM'), false))";if("assert"==e[0]){var t=e[2]||"N/A";return"(("+e[1]+") ? true : (err = "+JSON.stringify(t)+", false))"}if("not"==e[0])return"!("+s(e[1])+")";throw Error("Unknown array type condition: "+e[0])}if("number"==e)return"(typeof "+r()+" == 'number' || typeof $"+a+" == 'boolean')";if("integer"==e)return"((typeof "+r()+" == 'number' || typeof $"+a+" == 'boolean') ? ($"+a+" |= 0, true) : false)";if("date"==e)return"((typeof "+r()+" == 'number') ? ($"+a+" |= 0, true) : false)";if("datetime"==e)return"(typeof "+r()+" == 'number')";if("divisor"==e)return"((typeof "+r()+" == 'number' || typeof $"+a+" == 'boolean') && ($"+a+" == 0 ? ((err = 'DIV/0'), false) : true))";if("number+"==e)return"((typeof "+r()+" == 'number' || typeof $"+a+" == 'boolean') && ($"+a+" >= 0 ? true : ((err = 'NUM'), false)))";if("integer+"==e)return"((typeof "+r()+" == 'number' || typeof $"+a+" == 'boolean') && (($"+a+" |= 0) >= 0 ? true : ((err = 'NUM'), false)))";if("number++"==e)return"((typeof "+r()+" == 'number' || typeof $"+a+" == 'boolean') && ($"+a+" > 0 ? true : ((err = 'NUM'), false)))";if("integer++"==e)return"((typeof "+r()+" == 'number' || typeof $"+a+" == 'boolean') && (($"+a+" |= 0 ) > 0) ? true : ((err = 'NUM'), false))";if("string"==e)return"(typeof "+r()+" == 'string')";if("boolean"==e)return"(typeof "+r()+" == 'boolean')";if("logical"==e)return"(typeof "+r()+" == 'boolean' || (typeof $"+a+" == 'number' ? ($"+a+" = !!$"+a+", true) : false))";if("matrix"==e)return r(),"((m = this.asMatrix($"+a+")) ? ($"+a+" = m) : false)";if("#matrix"==e)return"((m = this.asMatrix($"+a+")) ? ($"+a+" = m) : false)";if("ref"==e)return"($"+a+" instanceof kendo.spreadsheet.Ref)";if("area"==e)return"($"+a+" instanceof kendo.spreadsheet.CellRef || $"+a+" instanceof kendo.spreadsheet.RangeRef)";if("cell"==e)return"($"+a+" instanceof kendo.spreadsheet.CellRef)";if("null"==e)return"("+r()+" == null)";if("anyvalue"==e)return"("+r()+" != null && i <= args.length)";if("forced"==e)return"("+r()+", i <= args.length)";if("anything"==e)return"(i <= args.length)";if("blank"==e)return"("+r()+" == null || $"+a+" === '')";throw Error("Can't check for type: "+e)}var a,l,u,c="function arrayArgs(args) { var xargs = [], width = 0, height = 0, arrays = [], i = 0; ",h="function resolve(args, callback) { var toResolve = [], i = 0; ",d="'use strict'; function check(args) { var stack = [], tmp, xargs = [], i = 0, m, err = 'VALUE'; ",f=!1,p=!1,m=!1;return d+=n.map(i).join(""),d+="if (i < args.length) return new CalcError('N/A'); ",d+="return xargs; } ",c+="return { args: xargs, width: width, height: height, arrays: arrays }; } ",f?(h+="this.resolveCells(toResolve, callback); } ",u=Function("CalcError",d+h+c+" return { resolve: resolve, check: check, arrayArgs: arrayArgs };")):u=Function("CalcError",d+" return { check: check };"),u=u(e),m||delete u.arrayArgs,u}function i(t,n,i){if(i instanceof e)return i;try{return n.apply(t,i)}catch(r){if(r instanceof e)return r;throw r}}function r(e,t,n,r){return function(o,s){function a(){var t,a,l,u,c,h,d;if(r&&(t=r.call(this,s),s=t.args,t.width>0&&t.height>0)){for(a=new E(this),l=0;t.height>l;++l)for(u=0;t.width>u;++u){for(c=[],h=0;s.length>h;++h)t.arrays[h]?(d=s[h],c[h]=d.get(l%d.height,u%d.width)):c[h]=s[h];c=n.call(this,c),a.set(l,u,i(this,e,c))}return o(a)}c=n.call(this,s),o(i(this,e,c))}t?t.call(this,s,a):a.call(this)}}function o(t,n,i,r){return function(o,s){function a(){var n,a,l,u,c,h,d,f,p;if(r&&(n=r.call(this,s),s=n.args,n.width>0&&n.height>0))for(a=new E(this),l=n.width*n.height,u=function(e,t){return function(n){return a.set(e,t,n),--l,0===l?o(a):void 0}},c=0;n.height>c&&l>0;++c)for(h=0;n.width>h&&l>0;++h){for(d=[],f=0;s.length>f;++f)n.arrays[f]?(p=s[f],d[f]=p.get(c%p.height,h%p.width)):d[f]=s[f];if(d=i.call(this,d),d instanceof e){if(a.set(c,h,d),--l,0===l)return o(a)}else d.unshift(u(c,h)),t.apply(this,d)}else n=i.call(this,s),n instanceof e?o(n):(n.unshift(o),t.apply(this,n))}n?n.call(this,s,a):a.call(this)}}function s(e,t){return e=e.toLowerCase(),T[e]=t,{args:function(i,o){var s,a=n(e,i);return o&&(a.arrayArgs&&console.log(""+a.arrayArgs),a.resolve&&console.log(""+a.resolve),a.check&&console.log(""+a.check)),s=T[e]=r(t,a.resolve,a.check,a.arrayArgs),s.kendoSpreadsheetArgs=i,this},argsAsync:function(i,r){var s,a=n(e,i);return r&&(a.arrayArgs&&console.log(""+a.arrayArgs),a.resolve&&console.log(""+a.resolve),a.check&&console.log(""+a.check)),s=T[e]=o(t,a.resolve,a.check,a.arrayArgs),s.kendoSpreadsheetArgs=i,this}}}function a(e,t,n){return t++,(1461*(e+4800+((t-14)/12|0))/4|0)+(367*(t-2-12*((t-14)/12|0))/12|0)-(3*((e+4900+((t-14)/12|0))/100|0)/4|0)+n-32075}function l(e){var t,n,i,r,o,s,a;return t=e+68569,n=4*t/146097|0,t-=(146097*n+3)/4|0,r=4e3*(t+1)/1461001|0,t=t-(1461*r/4|0)+31,i=80*t/2447|0,s=t-(2447*i/80|0),t=i/11|0,o=i+2-12*t,a=100*(n-49)+r+t,o--,{year:a,month:o,date:s,day:(e+1)%7,ord:N[u(a)][o]+s}}function u(e){return e%4?0:e%100?1:e%400?0:1}function c(e){return u(e)?366:365}function h(e,t){return u(e)&&1==t?29:L[t]}function d(e){return l((0|e)+B)}function f(e,t,n){return a(e,t,n)-B}function p(e){var t,n,i,r,o=e-(0|e);return 0>o&&o++,t=Math.round(P*o),n=Math.floor(t/z),t-=n*z,i=Math.floor(t/I),t-=i*I,r=Math.floor(t/1e3),t-=1e3*r,{hours:n,minutes:i,seconds:r,milliseconds:t}}function m(e){var t=d(e),n=p(e);return new Date(t.year,t.month,t.date,n.hours,n.minutes,n.seconds,n.milliseconds)}function g(e,t,n,i){return(e+(t+(n+i/1e3)/60)/60)/24}function v(e){var t=g(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());return e=f(e.getFullYear(),e.getMonth(),e.getDate()),0>e?e-1+t:e+t}function b(e){return kendo.parseDate(e,["MM/dd/yyyy","MM-dd-yyyy","MM/dd/yy","MM-dd-yy","MMMM dd yyyy","MMMM dd yy","MMM dd yyyy","MMM dd yy","dd MMMM yyyy","dd MMMM yy","dd MMM yyyy","dd MMM yy","MMMM dd, yyyy","MMMM dd, yy","MMM dd, yyyy","MMM dd, yy","MMMM dd","MMM dd","MMMM yyyy","MMM yyyy","dd MMMM","dd MMM","MM-dd","MM/dd"])||kendo.parseDate(e)}function w(t){return function(n,i){return"string"==typeof n&&"string"!=typeof i&&(i=null==i?"":i+""),"string"!=typeof n&&"string"==typeof i&&(n=null==n?"":n+""),"number"==typeof n&&null==i&&(i=0),"number"==typeof i&&null==n&&(n=0),"string"==typeof n&&"string"==typeof i&&(n=n.toLowerCase(),i=i.toLowerCase()),typeof i==typeof n?t(n,i):new e("VALUE")}}var y,_,x,k,C,F,R,S,A,M,E,D,T,B,L,N,I,z,P,$,H,O;kendo.support.browser.msie&&kendo.support.browser.version<9||(y={},_=kendo.spreadsheet,_.calc=y,x=y.runtime={},k=kendo.Class,C=_.Ref,F=_.CellRef,R=_.RangeRef,S=_.UnionRef,A=_.NULLREF,e.prototype.toString=function(){return"#"+this.code+("NAME"==this.code?"?":"!")},M=k.extend({init:function(e,t,n,i){this.callback=e,this.formula=t,this.ss=n,this.parent=i},resolve:function(e){var t=this;e instanceof C?t.resolveCells([e],function(){e=t.getRefData(e),Array.isArray(e)&&(e=e[0]),t._resolve(e)}):t._resolve(e)},_resolve:function(e){void 0===e&&(e=null);var t=this.formula;t.value=e,this.ss.onFormula(t)&&this.callback&&this.callback.call(t,e)},resolveCells:function(e,t){function n(e){e.formula.exec(s.ss,function(){--r||t.call(s)},s)}function i(e){var t,n;for(t=0;e.length>t;++t)n=e[t],n.formula&&a.push(n);return!0}var r,o,s=this,a=[];if(function l(e){var t,n;for(t=0;e.length>t;++t)n=e[t],n instanceof C&&i(s.getRefCells(n)),Array.isArray(n)&&l(n)}(e),!a.length)return t.call(s);for(r=a.length,o=0;a.length>o;++o)n(a[o])},cellValues:function(e,t){var n,i,r=[];for(n=0;e.length>n;++n)i=e[n],i instanceof C?(i=this.getRefData(i),r=r.concat(i)):Array.isArray(i)?r=r.concat(this.cellValues(i)):i instanceof E?r=r.concat(this.cellValues(i.data)):r.push(i);return t?t.apply(this,r):r},force:function(e){return e instanceof C?this.getRefData(e):e},func:function(t,n,i){t=t.toLowerCase();var r=T[t];return r?r.call(this,n,i):void n(new e("NAME"))},bool:function(e){return e instanceof C&&(e=this.getRefData(e)),"string"==typeof e?"true"==e.toLowerCase():"number"==typeof e?0!==e:"boolean"==typeof e?e:null!=e},asMatrix:function(e){var t,n,i,r,o,s,a;return e instanceof E?e:(t=this,e instanceof R?(n=e.topLeft,i=n.row,r=n.col,o=t.getRefCells(e),s=new E(t),isFinite(e.width())&&(s.width=e.width()),isFinite(e.height())&&(s.height=e.height()),isFinite(i)||(i=0),isFinite(r)||(r=0),o.forEach(function(e){s.set(e.row-i,e.col-r,e.value)}),s):Array.isArray(e)&&e.length>0?(s=new E(t),a=0,e.forEach(function(e){var n=0,i=1;e.forEach(function(e){var r=e instanceof R;e instanceof C&&!r&&(e=t.getRefData(e)),
  (r||Array.isArray(e))&&(e=t.asMatrix(e)),e instanceof E?(e.each(function(e,t,i){s.set(a+t,n+i,e)}),i=Math.max(i,e.height),n+=e.width):s.set(a,n++,e)}),a+=i}),s):void 0)},getRefCells:function(e,t){return this.ss.getRefCells(e,t)},getRefData:function(e){return this.ss.getData(e)},workbook:function(){return this.ss.workbook}}),E=k.extend({init:function(e){this.context=e,this.height=0,this.width=0,this.data=[]},clone:function(){var e=new E(this.context);return e.height=this.height,e.width=this.width,e.data=this.data.map(function(e){return e.slice()}),e},get:function(e,t){var n=this.data[e],i=n?n[t]:null;return i instanceof C?this.context.getRefData(i):i},set:function(e,t,n){var i=this.data[e];null==i&&(i=this.data[e]=[]),i[t]=n,e>=this.height&&(this.height=e+1),t>=this.width&&(this.width=t+1)},each:function(e,t){var n,i,r;for(n=0;this.height>n;++n)for(i=0;this.width>i;++i)if(r=this.get(n,i),(t||null!=r)&&(r=e.call(this.context,r,n,i),void 0!==r))return r},map:function(e,t){var n=new E(this.context);return this.each(function(t,i,r){n.set(i,r,e.call(this,t,i,r))},t),n},eachRow:function(e){var t,n;for(t=0;this.height>t;++t)if(n=e.call(this.context,t),void 0!==n)return n},eachCol:function(e){var t,n;for(t=0;this.width>t;++t)if(n=e.call(this.context,t),void 0!==n)return n},mapRow:function(e){var t=new E(this.context);return this.eachRow(function(n){t.set(n,0,e.call(this.context,n))}),t},mapCol:function(e){var t=new E(this.context);return this.eachCol(function(n){t.set(0,n,e.call(this.context,n))}),t},toString:function(){return JSON.stringify(this.data)},transpose:function(){var e=new E(this.context);return this.each(function(t,n,i){e.set(i,n,t)}),e},unit:function(e){var t,n,i,r;for(this.width=this.height=e,t=this.data=Array(e),n=e;--n>=0;)for(i=t[n]=Array(e),r=e;--r>=0;)i[r]=n==r?1:0;return this},multiply:function(t){var n,i,r,o,s,a,l=this,u=new E(l.context);for(n=0;l.height>n;++n)for(i=0;t.width>i;++i){for(r=0,o=0;l.width>o;++o){if(s=l.get(n,o),a=t.get(o,i),"number"!=typeof s||"number"!=typeof a)throw new e("VALUE");r+=s*a}u.set(n,i,r)}return u},adds:function(e,t){var n,i,r,o,s=this,a=new E(s.context),l=t?-1:1;for(n=0;s.height>n;++n)for(i=0;s.width>i;++i)r=s.get(n,i),o=e.get(n,i),a.set(n,i,r+l*o);return a},determinant:function(){var e,t,n,i,r,o=this.clone().data,s=o.length,a=1;for(e=0;s>e;e++){for(t=e;s>t&&!o[t][e];t++);if(t==s)return 0;if(t!=e)for(a=-a,i=e;s>i;i++)r=o[e][i],o[e][i]=o[t][i],o[t][i]=r;for(n=e+1;s>n;n++)for(i=e+1;s>i;i++)o[n][i]-=o[e][i]*o[n][e]/o[e][e];a*=o[e][e]}return a},inverse:function(){var e,n,i,r,o,s,a=this.width,l=this.augment(new E(this.context).unit(a)),u=l.data;for(n=0;a>n;++n){if(i=t(n,a,function(e){return u[e][n]}),!u[i][n])return null;for(n!=i&&(e=u[n],u[n]=u[i],u[i]=e),r=n+1;a>r;++r){for(o=n+1;2*a>o;++o)u[r][o]-=u[n][o]*u[r][n]/u[n][n];u[r][n]=0}}for(r=0;a>r;++r)for(s=u[r][r],o=0;2*a>o;++o)u[r][o]/=s;for(n=a;--n>=0;)for(r=n;--r>=0;)if(u[r][n])for(o=2*a;--o>=a;)u[r][o]-=u[n][o]*u[r][n];return l.slice(0,a,a,a)},augment:function(e){var t=this.clone(),n=t.width;return e.each(function(e,i,r){t.set(i,r+n,e)}),t},slice:function(e,t,n,i){var r,o,s=new E(this.context);for(r=0;n>r;++r)for(o=0;i>o;++o)s.set(r,o,this.get(e+r,t+o));return s}}),D=k.extend({init:function(e,t,n,i,r,o){this.refs=e,this.handler=t,this.print=n,this.absrefs=null,this.sheet=i,this.row=r,this.col=o,this.onReady=[],this.pending=!1},clone:function(e,t,n){var i=e.toLowerCase(),r=this.refs;return i!=this.sheet.toLowerCase()&&(r=r.map(function(t){return t.hasSheet()||t.sheet.toLowerCase()==i||(t=t.clone().setSheet(e)),t})),new D(r,this.handler,this.print,e,t,n)},resolve:function(e){this.pending=!1,this.onReady.forEach(function(t){t(e)})},exec:function(t,n,i){if("value"in this)n&&n(this.value);else{n&&this.onReady.push(n);for(var r=new M(this.resolve,this,t,i);i;){if(i.formula===this)return this.pending=!1,void r.resolve(new e("CIRCULAR"));i=i.parent}if(this.pending)return;this.pending=!0,this.absrefs||(this.absrefs=this.refs.map(function(e){return e.absolute(this.row,this.col)},this)),this.handler.call(r)}},reset:function(){this.onReady=[],this.pending=!1,delete this.value},renameSheet:function(e,t){e=e.toLowerCase(),this.absrefs=null,this.sheet.toLowerCase()==e&&(this.sheet=t),this.refs.forEach(function(n){n.sheet.toLowerCase()==e&&(n.sheet=t)})},adjust:function(e,t,n,i){var r,o,s,a,l,u;e=e.toLowerCase(),r=this.row,o=this.col,s=this.sheet.toLowerCase(),a=!1,s==e&&("row"==t&&r>=n&&(this.row+=i,a=!0),"col"==t&&o>=n&&(this.col+=i,a=!0)),l=this.row,u=this.col,this.absrefs=null,this.refs=this.refs.map(function(s){return s===A?s:s.sheet.toLowerCase()!=e?(a&&("row"==t&&r>=n&&(s=s.relative(i,0)),"col"==t&&o>=n&&(s=s.relative(0,i))),s):s.adjust(r,o,l,u,"row"==t,n,i)},this)},toString:function(){return this.print(this.row,this.col)}}),T=Object.create(null),T["if"]=function(t,n){var i=this,r=n[0],o=n[1],s=n[2];this.resolveCells([r],function(){var n=i.asMatrix(r);n?o(function(r){s(function(o){var s=i.asMatrix(r),a=i.asMatrix(o);t(n.map(function(t,n,l){return t instanceof e?t:i.bool(t)?s?s.get(n,l):r:a?a.get(n,l):o}))})}):(r=this.force(r),r instanceof e?t(r):i.bool(r)?o(t):s(t))})},T["φ"]=function(e){e((1+Math.sqrt(5))/2)},B=a(1900,0,-1),L=[31,28,31,30,31,30,31,31,30,31,30,31],N=[[0,31,59,90,120,151,181,212,243,273,304,334],[0,31,60,91,121,152,182,213,244,274,305,335]],I=6e4,z=60*I,P=24*z,x.CalcError=e,x.Formula=D,x.Matrix=E,x.packDate=f,x.unpackDate=d,x.packTime=g,x.unpackTime=p,x.serialToDate=m,x.dateToSerial=v,x.daysInMonth=h,x.isLeapYear=u,x.daysInYear=c,x.parseDate=b,_.dateToNumber=v,_.numberToDate=m,_.defineFunction=s,_.CalcError=e,x.defineFunction=s,x.defineAlias=function(e,t){var n=T[t];if(!n)throw Error("Function "+t+" is not yet defined");n.kendoSpreadsheetAliases||(n.kendoSpreadsheetAliases=[t]),n.kendoSpreadsheetAliases.push(e),T[e]=n},x.FUNCS=T,$=["or","number",["null",0]],H=[["*a",$],["*b",$]],O=[["*a",["or","anyvalue",["null",0]]],["*b",["or","anyvalue",["null",0]]]],s("binary+",function(e,t){return e+t}).args(H),s("binary-",function(e,t){return e-t}).args(H),s("binary*",function(e,t){return e*t}).args(H),s("binary/",function(e,t){return e/t}).args([["*a",$],["*b","divisor"]]),s("binary^",function(e,t){return Math.pow(e,t)}).args(H),s("binary&",function(e,t){return null==e&&(e=""),null==t&&(t=""),""+e+t}).args([["*a",["or","number","string","boolean","null"]],["*b",["or","number","string","boolean","null"]]]),s("binary=",function(e,t){return e===t}).args(O),s("binary<>",function(e,t){return e!==t}).args(O),s("binary<",w(function(e,t){return t>e})).args(O),s("binary<=",w(function(e,t){return t>=e})).args(O),s("binary>",w(function(e,t){return e>t})).args(O),s("binary>=",w(function(e,t){return e>=t})).args(O),s("unary+",function(e){return e}).args([["*a",$]]),s("unary-",function(e){return-e}).args([["*a",$]]),s("unary%",function(e){return e/100}).args([["*a",$]]),s("binary:",function(e,t){return new R(e,t).setSheet(e.sheet||this.formula.sheet,e.hasSheet())}).args([["a","cell"],["b","cell"]]),s("binary,",function(e,t){return new S([e,t])}).args([["a","ref"],["b","ref"]]),s("binary ",function(e,t){return e.intersect(t)}).args([["a","ref"],["b","ref"]]),s("not",function(e){return!this.bool(e)}).args([["*a",["or","anyvalue",["null",0]]]]),s("isblank",function(e){return e instanceof F?(e=this.getRefData(e),null==e):!1}).args([["*value","anything!"]]),s("iserror",function(t){return t instanceof e}).args([["*value","forced!"]]),s("iserr",function(t){return t instanceof e&&"N/A"!=t.code}).args([["*value","forced!"]]),s("isna",function(t){return t instanceof e&&"N/A"==t.code}).args([["*value","forced!"]]),s("islogical",function(e){return"boolean"==typeof e}).args([["*value","forced!"]]),s("isnontext",function(e){return"string"!=typeof e}).args([["*value","forced!"]]),s("istext",function(e){return"string"==typeof e}).args([["*value","forced!"]]),s("isnumber",function(e){return"number"==typeof e}).args([["*value","forced!"]]),s("isref",function(e){return e instanceof F||e instanceof R}).args([["*value","anything!"]]))},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/validation.min",["spreadsheet/runtime.min"],e)}(function(){"use strict";function e(e,t,r,a){var u,c,h,d;if("string"==typeof a&&(a=JSON.parse(a)),a.from&&("list"===a.dataType&&(a.from=kendo.format(o,a.from)),"date"===a.dataType&&(h=i.runtime.parseDate(a.from),h&&(a.from=kendo.format(s,a.from),a.fromIsDateValue=!0)),a.from=i.compile(i.parseFormula(e,t,r,a.from))),a.to&&("date"===a.dataType&&(d=i.runtime.parseDate(a.to),d&&(a.to=kendo.format(s,a.to),a.toIsDateValue=!0)),a.to=i.compile(i.parseFormula(e,t,r,a.to))),c="custom"==a.dataType?n.validationComparers.custom:"list"==a.dataType?n.validationComparers.list:n.validationComparers[a.comparerType],!c)throw kendo.format("'{0}' comparer is not implemented.",a.comparerType);return u=function(e){var t,n=this.to&&this.to.value?this.to.value:void 0;return null===e||""===e?this.value=this.allowNulls?!0:!1:"custom"==this.dataType?this.value=c(e,this.from.value,n):"list"==this.dataType?(t=this._getListData(),this.value=c(e,t,n)):this.value=c(e,this.from.value,n),this.value},new kendo.spreadsheet.validation.Validation(l.extend(a,{handler:u,sheet:e,row:t,col:r}))}var t,n,i,r,o,s,a,l=kendo.jQuery;kendo.support.browser.msie&&kendo.support.browser.version<9||(t=kendo.spreadsheet,n={},t.validation=n,i=t.calc,r=kendo.Class,o="_matrix({0})",s='DATEVALUE("{0}")',i.runtime.defineFunction("_matrix",function(e){return e}).args([["m","matrix"]]),a=r.extend({init:function(e){this.handler=e.handler,this.from=e.from,this.to=e.to,this.dataType=e.dataType,this.comparerType=e.comparerType,this.type=e.type?e.type:"warning",this.allowNulls=e.allowNulls?!0:!1,this.fromIsDateValue=e.fromIsDateValue?!0:!1,this.toIsDateValue=e.toIsDateValue?!0:!1,this.sheet=e.sheet,this.row=e.row,this.col=e.col,e.tooltipMessageTemplate&&(this.tooltipMessageTemplate=e.tooltipMessageTemplate),e.tooltipTitleTemplate&&(this.tooltipTitleTemplate=e.tooltipTitleTemplate),e.messageTemplate&&(this.messageTemplate=e.messageTemplate),e.titleTemplate&&(this.titleTemplate=e.titleTemplate)},_formatMessages:function(e){var t=this.from?this.from.value:"",n=this.to?this.to.value:"",i=this.from?""+this.from:"",r=this.to?""+this.to:"",o=this.dataType,s=this.type,a=this.comparerType;return kendo.format(e,t,n,i,r,o,s,a)},_setMessages:function(){this.title="",this.message="",this.tooltipTitleTemplate&&(this.tooltipTitle=this._formatMessages(this.tooltipTitleTemplate)),this.tooltipMessageTemplate&&(this.tooltipMessage=this._formatMessages(this.tooltipMessageTemplate)),this.titleTemplate&&(this.title=this._formatMessages(this.titleTemplate)),this.messageTemplate&&(this.message=this._formatMessages(this.messageTemplate))},_getListData:function(){var e,t,n,i,r;if(!this.from.value||!this.from.value.data)return[];for(e=this.from.value.data,i=[],t=0;e.length>t;t++)if(r=e[t])for(n=0;r.length>n;n++)i.push(r[n]);return i},clone:function(e,t,n){var i=this._getOptions();return i.from&&(i.from=i.from.clone(e,t,n)),i.to&&(i.to=i.to.clone(e,t,n)),new a(l.extend(i,{handler:this.handler},{sheet:e,row:t,col:n}))},exec:function(e,t,n,i){var r=this,o=function(){r.value=r.handler.call(r,t,n),r._setMessages(),i&&i(r.value)};r.to?r.to.exec(e,function(){r.from.exec(e,o)}):r.from.exec(e,o)},reset:function(){this.from&&this.from.reset(),this.to&&this.to.reset(),delete this.value},adjust:function(e,t,n,i){var r,o;if(this.from&&this.from.adjust(e,t,n,i),this.to&&this.to.adjust(e,t,n,i),this.sheet.toLowerCase()==e.toLowerCase())switch(r=this.row,o=this.col,t){case"row":r>=n&&(this.row+=i);break;case"col":o>=n&&(this.col+=i)}},toJSON:function(){var e=this._getOptions();return e.from&&(e.from=""+e.from,"list"===e.dataType&&(e.from=e.from.replace(/^_matrix\((.*)\)$/i,"$1")),"date"===e.dataType&&this.fromIsDateValue&&(e.from=e.from.replace(/^DATEVALUE\("(.*)"\)$/i,"$1"))),e.to&&(e.to=""+e.to,"date"===e.dataType&&this.toIsDateValue&&(e.to=e.to.replace(/^DATEVALUE\("(.*)"\)$/i,"$1"))),e},_getOptions:function(){return{from:this.from,to:this.to,dataType:this.dataType,type:this.type,comparerType:this.comparerType,row:this.row,col:this.col,sheet:this.sheet,allowNulls:this.allowNulls,tooltipMessageTemplate:this.tooltipMessageTemplate,tooltipTitleTemplate:this.tooltipTitleTemplate,messageTemplate:this.messageTemplate,titleTemplate:this.titleTemplate}}}),n.compile=e,n.validationComparers={greaterThan:function(e,t){return e>t},lessThan:function(e,t){return t>e},between:function(e,t,n){return e>t&&n>e},equalTo:function(e,t){return e==t},notEqualTo:function(e,t){return e!=t},greaterThanOrEqualTo:function(e,t){return e>=t},lessThanOrEqualTo:function(e,t){return t>=e},notBetween:function(e,t,n){return t>e||e>n},custom:function(e,t){return t},list:function(e,t){return t.indexOf(e)>-1}},n.Validation=a)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/sheet.min",["kendo.core.min","kendo.color.min","spreadsheet/runtime.min","spreadsheet/validation.min","spreadsheet/references.min"],e)}(function(){!function(e){var t,n,i,r,o;e.support.browser.msie&&9>e.support.browser.version||(t=e.spreadsheet.RangeRef,n=e.spreadsheet.CellRef,i=e.spreadsheet.Range,r=e.Class.extend({init:function(t){this._sheet=t,this.selection=e.spreadsheet.FIRSTREF.toRangeRef(),this.originalSelection=e.spreadsheet.FIRSTREF.toRangeRef(),this._activeCell=e.spreadsheet.FIRSTREF.toRangeRef(),this.originalActiveCell=e.spreadsheet.FIRSTREF},currentSelectionRange:function(){return this.selection.rangeAt(this.selectionRangeIndex).toRangeRef()},currentOriginalNavigationRange:function(){return this.originalSelection.rangeAt(this.selectionRangeIndex).toRangeRef()},currentNavigationRange:function(){return this.singleCellSelection()?this._sheet._sheetRef:this.selection.rangeAt(this.selectionRangeIndex).toRangeRef()},nextNavigationRange:function(){return this.singleCellSelection()||(this.selectionRangeIndex=this.selection.nextRangeIndex(this.selectionRangeIndex)),this.currentNavigationRange()},previousNavigationRange:function(){return this.singleCellSelection()||(this.selectionRangeIndex=this.selection.previousRangeIndex(this.selectionRangeIndex)),this.currentNavigationRange()},activeCell:function(e){return e&&(this.originalActiveCell=e,this._activeCell=this._sheet.unionWithMerged(e.toRangeRef()),this._sheet.focus(e),this._sheet.triggerChange({activeCell:!0,selection:!0})),this._activeCell},select:function(e,t,n){if(e){if(e.eq(this.originalSelection))return;this.originalSelection=e,this.selection=t,n!==!1?(this.activeCell(e.isCell()?e:this.selection.lastRange().first()),this.selectionRangeIndex=this.selection.size()-1):this._sheet.triggerChange({selection:!0})}return this.selection},singleCellSelection:function(){return this._activeCell.eq(this.selection)}}),o=e.Observable.extend({init:function(t,n,i,o,s,a){e.Observable.prototype.init.call(this);var l=t*n-1;this._rows=new e.spreadsheet.Axis(t,i),this._columns=new e.spreadsheet.Axis(n,o),this._mergedCells=[],this._frozenRows=0,this._frozenColumns=0,this._suspendChanges=!1,this._filter=null,this._grid=new e.spreadsheet.Grid(this._rows,this._columns,t,n,s,a),this._sheetRef=this._grid.normalize(e.spreadsheet.SHEETREF),this._properties=new e.spreadsheet.PropertyBag(l),this._sorter=new e.spreadsheet.Sorter(this._grid,this._properties.sortable()),this._viewSelection=new r(this),this._editSelection=new r(this),this._formulaSelections=[],this.options={showGridLines:!0}},_selectionState:function(){return this._inEdit?this._editSelection:this._viewSelection},navigator:function(){return this._navigator||(this._navigator=new e.spreadsheet.SheetNavigator(this)),this._navigator},axisManager:function(){return this._axisManager||(this._axisManager=new e.spreadsheet.AxisManager(this)),this._axisManager},_name:function(e){return e?(this._sheetName=e,this):this._sheetName},name:function(){return this._name()},_property:function(e,t,n){return void 0===t?e():(e(t),this.triggerChange(n))},_field:function(e,t,n){return void 0===t?this[e]:(this[e]=t,this.triggerChange(n))},suspendChanges:function(e){return void 0===e?this._suspendChanges:(this._suspendChanges=e,this)},triggerChange:function(e){return this._suspendChanges||this.trigger("change",e),this},setDataSource:function(t,n){this.dataSourceBinder&&this.dataSourceBinder.destroy(),this.dataSourceBinder=new e.spreadsheet.SheetDataSourceBinder({dataSource:t,sheet:this,columns:n})},hideColumn:function(e){return this._property(this._columns.hide.bind(this._columns),e,{layout:!0})},unhideColumn:function(e){return this._property(this._columns.unhide.bind(this._columns),e,{layout:!0})},isHiddenColumn:function(e){return this._grid._columns.hidden(e)},_copyRange:function(e,t){var n=this._grid,i=n.rowCount,r=n.normalize(e.topLeft),o=n.normalize(e.bottomRight),s=r.col*i+r.row,a=o.col*i+o.row,l=t.col*i+t.row;this._properties.copy(s,a,l)},_adjustReferences:function(t,n,i,r){var o,s;this._mergedCells=r.reduce(function(r,o){return o=o.adjust(null,null,null,null,"row"==t,n,i),o!==e.spreadsheet.NULLREF&&r.push(o),r},[]),this._workbook&&(o=this._name(),this._workbook._sheets.forEach(function(e){e._forFormulas(function(e){e.adjust(o,t,n,i)}),e._forValidations(function(e){e.adjust(o,t,n,i)})}),this._workbook.adjustNames(o,"row"==t,n,i)),s=this.select(),s=s.adjust(null,null,null,null,"row"==t,n,i),s!==e.spreadsheet.NULLREF&&this.select(s)},_forFormulas:function(e){var t=this._properties,n=t.get("formula").values(),i=n.length;n.forEach(function(t,n){e.call(this,t.value,n,i)},this)},_forValidations:function(e){var t=this._properties;t.get("validation").values().forEach(function(t){e.call(this,t.value)},this)},canInsertRow:function(e,t){var n,i;return t=t||1,n=this._grid,i=this.range(n.rowCount-t,0,t,n.columnCount),!i.hasValue()},insertRow:function(e){if(!this.canInsertRow(e))throw Error("Shifting nonblank cells off the worksheet is not supported!");return this.batch(function(){var r,o,s,a,l,u,c=this._grid,h=c.columnCount,d=c.rowCount,f=this.frozenRows();for(f>e&&this.frozenRows(f+1),r=this._mergedCells.slice(),o=0;h>o;o++)s=new t(new n(e,o),new n(e,o)),a=c.normalize(s.topLeft),l=c.normalize(s.bottomRight),u=new t(new n(a.row,a.col),new n(d-2,l.col)),this._copyRange(u,new n(a.row+1,a.col)),new i(s,this).clear();this._adjustReferences("row",e,1,r)},{recalc:!0,layout:!0}),this.trigger("insertRow",{index:e}),this},isEnabledRow:function(e){var r=new t(new n(e,0),new n(e,this._grid.columnCount));return new i(r,this).enable()},deleteRow:function(e){return this.isEnabledRow(e)?(this.batch(function(){var r,o,s,a,l,u,c,h=this._grid,d=h.columnCount,f=this.frozenRows();for(f>e&&this.frozenRows(f-1),r=this._mergedCells.slice(),o=0;d>o;o++)s=new t(new n(e,o),new n(e,o)),new i(s,this).clear(),a=h.normalize(s.topLeft),l=h.normalize(s.bottomRight),u=new t(new n(a.row+1,a.col),new n(1/0,l.col)),this._copyRange(u,a),c=h.normalize(u.bottomRight),new i(new t(c,c),this).clear();this._adjustReferences("row",e,-1,r)},{recalc:!0,layout:!0}),this.trigger("deleteRow",{index:e}),this):this},insertColumn:function(e){return this.batch(function(){var r,o,s,a,l,u,c=this._grid,h=c.columnCount,d=this.frozenColumns();for(d>e&&this.frozenColumns(d+1),r=this._mergedCells.slice(),o=h;o>=e&&(s=new t(new n(0,o),new n(1/0,o)),new i(s,this).clear(),o!=e);o--)a=c.normalize(s.topLeft),l=c.normalize(s.bottomRight),u=new t(new n(a.row,a.col-1),new n(l.row,l.col-1)),this._copyRange(u,a);this._adjustReferences("col",e,1,r)},{recalc:!0,layout:!0}),this},isEnabledColumn:function(e){var r=new t(new n(0,e),new n(1/0,e));return new i(r,this).enable()},deleteColumn:function(e){return this.isEnabledColumn(e)?(this.batch(function(){var r,o,s,a,l,u,c=this._grid,h=c.columnCount,d=this.frozenColumns();for(d>e&&this.frozenColumns(d-1),r=this._mergedCells.slice(),o=e;h>o&&(s=new t(new n(0,o),new n(1/0,o)),new i(s,this).clear(),o!=h-1);o++)a=c.normalize(s.topLeft),l=c.normalize(s.bottomRight),u=new t(new n(a.row,a.col+1),new n(l.row,l.col+1)),this._copyRange(u,a);this._adjustReferences("col",e,-1,r)},{recalc:!0,layout:!0}),this):this},hideRow:function(e){return this._property(this._rows.hide.bind(this._rows),e,{layout:!0})},unhideRow:function(e){return this._property(this._rows.unhide.bind(this._rows),e,{layout:!0})},isHiddenRow:function(e){return this._grid._rows.hidden(e)},columnWidth:function(e,t){return this._property(this._columns.value.bind(this._columns,e,e),t,{layout:!0})},rowHeight:function(e,t){return this._property(this._rows.value.bind(this._rows,e,e),t,{layout:!0})},frozenRows:function(e){return this._field("_frozenRows",e,{layout:!0})},frozenColumns:function(e){return this._field("_frozenColumns",e,{layout:!0})},_ref:function(i,r,o,s){var a=null;return i instanceof e.spreadsheet.Ref?i:i instanceof e.spreadsheet.Range?i._ref.toRangeRef():("string"==typeof i?a=e.spreadsheet.calc.parseReference(i):(o||(o=1),s||(s=1),a=new t(new n(i,r),new n(i+o-1,r+s-1))),a)},range:function(e,t,n,r){return new i(this._ref(e,t,n,r),this)},forEachMergedCell:function(e,t){var n=!1;void 0===t&&(t=e,n=!0),this._mergedCells.forEach(function(i){(n||i.intersects(e))&&t(i)})},forEachFilterHeader:function(e,t){var n,i=!1;void 0===t&&(t=e,i=!0),this._filter&&(n=[],this._filter.ref.forEachColumn(function(t){(i||t.intersects(e))&&n.push(t.topLeft)}),this._mergedCells.forEach(function(e){n=n.map(function(t){return e.intersects(t)?e:t})}),n.reduce(function(e,t){return e.indexOf(t)<0&&e.push(t),e},[]).forEach(t))},forEach:function(e,n){var i,r,o,s,a,l;for(e instanceof t||(e=this._ref(e)),i=this._grid.normalize(e.topLeft),r=this._grid.normalize(e.bottomRight),o=i.col;r.col>=o;o++)s=i.row,a=this._grid.index(s,o),l=this._grid.index(r.row,o),this._properties.forEach(a,l,function(e){n(s++,o,e)})},startResizing:function(e){this._initialPosition=e,this._resizeInProgress=!0},startAutoFill:function(){this._autoFillInProgress=!0;var e=this.select();this._autoFillOrigin=e,this._autoFillDest=e,this.triggerChange({selection:!0})},updateAutoFill:function(e,t,n,i){this._autoFillDest=e,this._autoFillPunch=t,this._autoFillHint=n,this._autoFillDirection=i,this.triggerChange({selection:!0})},autoFillRef:function(){return this._autoFillDest},autoFillPunch:function(){return this._autoFillPunch},autoFillInProgress:function(){return this._autoFillInProgress},resizingInProgress:function(){return this._resizeInProgress},completeResizing:function(){var e,t;this._resizeInProgress&&(this._resizeInProgress=!1,e=this.resizeHintPosition(),this._initialPosition&&e?(t=this.resizeHandlePosition(),t.col!==-(1/0)?this.columnWidth(t.col,this.columnWidth(t.col)-(this._initialPosition.x-e.x)):this.rowHeight(t.row,this.rowHeight(t.row)-(this._initialPosition.y-e.y))):this.trigger("change",{resize:!0}))},resizeHandlePosition:function(){return this._resizeHandlePosition},resizeHintPosition:function(e){return void 0!==e&&(this._resizeHintPosition=e,this.trigger("change",{resize:!0})),this._resizeHintPosition},removeResizeHandle:function(){this._resizeHandlePosition&&(this._resizeHintPosition=void 0,this._resizeHandlePosition=void 0,this._initialPosition=void 0,this.trigger("change",{resize:!0}))},positionResizeHandle:function(e){this._resizeHandlePosition=e,this.trigger("change",{resize:!0})},startSelection:function(){this._selectionInProgress=!0},completeSelection:function(){var e,t;this._selectionInProgress&&(this._selectionInProgress=!1,this._resizeHintPosition=void 0,this.trigger("change",{selection:!0})),this._autoFillInProgress&&(this._autoFillInProgress=!1,e=this._autoFillDest,t=this._autoFillOrigin,this._autoFillPunch?this._workbook.execute({command:"ClearContentCommand",options:{operatingRange:this.range(this._autoFillPunch)}}):e.eq(t)?this.triggerChange({selection:!0}):this._workbook.execute({command:"AutoFillCommand",options:{operatingRange:this.range(e),origin:this.range(t)}}),this._autoFillDest=null,this._autoFillPunch=null,this._autoFillOrigin=null,this.select(e))},selectionInProgress:function(){return this._selectionInProgress},select:function(e,t){var n,i=this._selectionState();return e&&(e=this._ref(e),n=this._grid.isAxis(e)?e:this.unionWithMerged(e)),i.select(e,n,t)},originalSelect:function(){return this._selectionState().originalSelection},currentSelectionRange:function(){return this._selectionState().currentSelectionRange()},currentOriginalSelectionRange:function(){return this._selectionState().currentOriginalNavigationRange()},currentNavigationRange:function(){return this._selectionState().currentNavigationRange()},nextNavigationRange:function(){return this._selectionState().nextNavigationRange()},previousNavigationRange:function(){return this._selectionState().previousNavigationRange()},selectionRangeIndex:function(){return this._selectionState().selectionRangeIndex},activeCell:function(e){return this._selectionState().activeCell(e)},originalActiveCell:function(){return this._selectionState().originalActiveCell},singleCellSelection:function(){return this._selectionState().singleCellSelection()},unionWithMerged:function(e){var t=this._mergedCells;return e.map(function(e){return e.toRangeRef().union(t)})},trim:function(e){var t=[],n=this._grid;return this._properties.forEachProperty(function(i){t.push(n.trim(e,i.list))}),this.unionWithMerged(e.topLeft.toRangeRef().union(t))},focus:function(e){if(!e){var t=this._focus;return this._focus=null,t}this._focus=e.toRangeRef()},activeCellSelection:function(){return new i(this._grid.normalize(this.activeCell()),this)},selection:function(){return new i(this._grid.normalize(this._selectionState().selection),this)},selectedHeaders:function(){var e=this.select(),t={},n={},i=!1,r=!1;return e.forEach(function(e){var o,s,a,l,u="partial",c="partial";if(e=e.toRangeRef(),s=e.bottomRight,a=s.col===1/0,l=s.row===1/0,l&&(r=!0,c="full"),a&&(i=!0,u="full"),!l)for(o=e.topLeft.row;s.row>=o;o++)"full"!==t[o]&&(t[o]=u);if(!a)for(o=e.topLeft.col;s.col>=o;o++)"full"!==n[o]&&(n[o]=c)}),{rows:t,cols:n,allRows:r,allCols:i,all:r&&i}},isInEditMode:function(e){return void 0===e?this._inEdit:(this._inEdit=e,void(e&&(this._editSelection.selection=this._viewSelection.selection.clone(),this._editSelection.originalSelection=this._viewSelection.originalSelection.clone(),this._editSelection._activeCell=this._viewSelection._activeCell.clone(),this._editSelection.originalActiveCell=this._viewSelection.originalActiveCell.clone())))},_setFormulaSelections:function(e){this._formulaSelections=(e||[]).slice(),this.triggerChange({selection:!0})},_viewActiveCell:function(){return this._viewSelection._activeCell.toRangeRef()},toJSON:function(){var t,n={},i=this._rows.toJSON("height",n),r=this._columns.toJSON("width",{}),o=this._viewSelection;return this.forEach(e.spreadsheet.SHEETREF,function(t,r,o){if(0!==Object.keys(o).length){var s=n[t];void 0===s&&(s=i.length,i.push({index:t}),n[t]=s),t=i[s],o.index=r,void 0===t.cells&&(t.cells=[]),o.formula&&(o.formula=""+o.formula),o.validation&&(o.validation=o.validation.toJSON()),o.color&&(o.color=e.parseColor(o.color).toCss()),o.background&&(o.background=e.parseColor(o.background).toCss()),o.borderTop&&o.borderTop.color&&(o.borderTop.color=e.parseColor(o.borderTop.color).toCss()),o.borderBottom&&o.borderBottom.color&&(o.borderBottom.color=e.parseColor(o.borderBottom.color).toCss()),o.borderRight&&o.borderRight.color&&(o.borderRight.color=e.parseColor(o.borderRight.color).toCss()),o.borderLeft&&o.borderLeft.color&&(o.borderLeft.color=e.parseColor(o.borderLeft.color).toCss()),t.cells.push(o)}}),t={name:this._name(),rows:i,columns:r,selection:""+o.selection,activeCell:""+o.activeCell(),frozenRows:this.frozenRows(),frozenColumns:this.frozenColumns(),mergedCells:this._mergedCells.map(function(e){return""+e})},this._sort&&(t.sort={ref:""+this._sort.ref,columns:this._sort.columns.map(function(e){return{index:e.index,ascending:e.ascending}})}),this._filter&&(t.filter={ref:""+this._filter.ref,columns:this._filter.columns.map(function(e){var t=e.filter.toJSON();return t.index=e.index,t})}),t},fromJSON:function(t){this.batch(function(){var n,i,r,o,s,a,l,u,c;if(void 0!==t.name&&this._name(t.name),void 0!==t.frozenColumns&&this.frozenColumns(t.frozenColumns),void 0!==t.frozenRows&&this.frozenRows(t.frozenRows),void 0!==t.columns&&this._columns.fromJSON("width",t.columns),void 0!==t.rows)for(this._rows.fromJSON("height",t.rows),n=0;t.rows.length>n;n++)if(i=t.rows[n],r=i.index,void 0===r&&(r=n),i.cells)for(o=0;i.cells.length>o;o++)s=i.cells[o],a=s.index,void 0===a&&(a=o),s.formula&&(s.formula=this._compileFormula(r,a,s.formula)),s.validation&&(s.validation=this._compileValidation(r,a,s.validation)),this._properties.fromJSON(this._grid.index(r,a),s);t.selection&&(this._viewSelection.selection=this._viewSelection.originalSelection=this._ref(t.selection)),t.activeCell&&(l=this._ref(t.activeCell),this._viewSelection._activeCell=l.toRangeRef(),this._viewSelection.originalActiveCell=l),t.mergedCells&&t.mergedCells.forEach(function(e){this.range(e).merge()},this),t.sort&&(this._sort={ref:this._ref(t.sort.ref),columns:t.sort.columns.slice(0)}),t.filter&&(u=t.filter.ref,c=void 0===t.filter.columns?[]:t.filter.columns,u?(this._filter={ref:this._ref(u),columns:c.map(function(t){return{index:t.index,filter:e.spreadsheet.Filter.create(t)}})},this._refreshFilter()):e.logToConsole("Dropping filter for sheet '"+t.name+"' due to missing ref"))})},formula:function(e){return this._properties.get("formula",this._grid.cellRefIndex(e))},validation:function(e){return this._properties.get("validation",this._grid.cellRefIndex(e))},resetFormulas:function(){this._forFormulas(function(e){e.reset()})},resetValidations:function(){this._forValidations(function(e){e.reset()})},recalc:function(e,t){function n(){o--,s!=r||o||t()}var i=this._properties.get("formula").values(),r=i.length,o=0,s=0;if(!r&&t)return t();for(;r>s;)o++,i[s++].value.exec(e,t?n:null)},revalidate:function(e){var i=this;this._forValidations(function(r){var o=new n(r.row,r.col),s=new t(o,o);r.exec(e,i._get(s,"value"),i._get(s,"format"))})},_value:function(e,t,n){var i=this._grid.index(e,t);return void 0===n?this._properties.get("value",i):void this._properties.set("value",i,i,n)},_validation:function(e,t){var n=this._grid.index(e,t);return this._properties.get("validation",n)},_compileValidation:function(t,n,i){return(null!==i.from||void 0!==i.from)&&(i.from=(i.from+"").replace(/^=/,"")),(null!==i.to||void 0!==i.to)&&(i.to=(i.to+"").replace(/^=/,"")),e.spreadsheet.validation.compile(this._name(),t,n,i)},_compileFormula:function(t,n,i){return i=i.replace(/^=/,""),i=e.spreadsheet.calc.parseFormula(this._name(),t,n,i),e.spreadsheet.calc.compile(i)},_copyValuesInRange:function(e,t,n,i){var r,o,s,a,l;for(r=e.col;t.col>=r;r++)for(o=this._grid.index(e.row,r),s=this._grid.index(t.row,r),a=o,l=e.row;s>=a;++a,++l)n=n.clone(this._name(),l,r),this._properties.set(i,a,a,n);return n},_set:function(e,t,n){var i,r,o,s=this._grid.normalize(e.topLeft),a=this._grid.normalize(e.bottomRight);if(n&&"formula"==t)"string"==typeof n&&(n=this._compileFormula(s.row,s.col,n)),n=this._copyValuesInRange(s,a,n,"formula");else if(n&&"validation"==t)n=this._compileValidation(s.row,s.col,n),n=this._copyValuesInRange(s,a,n,"validation");else for(i=s.col;a.col>=i;i++)r=this._grid.index(s.row,i),o=this._grid.index(a.row,i),this._properties.set(t,r,o,n),"formula"==t&&this._properties.set("value",r,o,null)},_get:function(e,t){var n=this._grid.normalize(e.topLeft),i=this._grid.index(n.row,n.col);return this._properties.get(t,i)},batch:function(e,t){var n=this.suspendChanges();return this.suspendChanges(!0),e.call(this),this.suspendChanges(n).triggerChange(t)},_sortBy:function(e,t){var n=null;t.forEach(function(t){n=this._sorter.sortBy(e,t.index,this._properties.get("value"),t.ascending,n)},this),this._sort={ref:e,columns:t},this._refreshFilter(),this.triggerChange({recalc:!0})},_refreshFilter:function(){this._filter&&this._filterBy(this._filter.ref,this._filter.columns)},_filterBy:function(t,n){this.batch(function(){
  for(var i=t.topLeft.row;t.bottomRight.row>=i;i++)this._rows.hidden(i)&&this._rows.unhide(i);n.forEach(function(n){var i,r,o,s=t.resize({top:1}).toColumn(n.index),a=[];if(s!==e.spreadsheet.NULLREF)for(this.forEach(s,function(e,t,n){n.row=e,a.push(n)}),n.filter.prepare(a),i=0;a.length>i;i++)r=a[i],o=n.filter.value(r),n.filter.matches(o)===!1&&this.hideRow(r.row)},this),this._filter={ref:t,columns:n}},{layout:!0,filter:!0})},filterColumn:function(e){var t=this.filter().ref;return e.toRangeRef().topLeft.col-t.topLeft.col},filter:function(){return this._filter},clearFilter:function(e){this._clearFilter(e instanceof Array?e:[e])},_clearFilter:function(e){this._filter&&this.batch(function(){this._filter.columns=this._filter.columns.filter(function(t){return e.indexOf(t.index)<0}),this._refreshFilter()},{layout:!0,filter:!0})},getAxisState:function(){return{rows:this._rows.getState(),columns:this._columns.getState()}},setAxisState:function(e){this._rows.setState(e.rows),this._columns.setState(e.columns),this.triggerChange({layout:!0})},getState:function(){return{rows:this._rows.getState(),columns:this._columns.getState(),mergedCells:this._mergedCells.map(function(e){return e.clone()}),properties:this._properties.getState()}},setState:function(t){this._rows.setState(t.rows),this._columns.setState(t.columns),this._mergedCells=t.mergedCells,this._properties.setState(t.properties),this.triggerChange(e.spreadsheet.ALL_REASONS)},_merge:function(t){var n,r=this._mergedCells,o=this;return this.batch(function(){n=t.map(function(t){var n,s,a,l,u,c,h;return t instanceof e.spreadsheet.CellRef?t:(n=t.toRangeRef().union(r,function(e){r.splice(r.indexOf(e),1)}),s=new i(n,o),a=s._get("formula"),l=s.value(),u=s.format(),c=s.background(),s.value(null),s.format(null),s.background(null),h=new i(n.collapse(),o),a?h._set("formula",a):h.value(l),h.format(u),h.background(c),r.push(n),n)});var s=o._viewSelection;s.selection=o.unionWithMerged(s.originalSelection),s._activeCell=o.unionWithMerged(s.originalActiveCell)},{activeCell:!0,selection:!0}),n}}),e.spreadsheet.Sheet=o)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/sheetsbar.min",["kendo.core.min","kendo.sortable.min"],e)}(function(){!function(e){var t,n,i,r,o;e.support.browser.msie&&9>e.support.browser.version||(t=e.jQuery,n=".",i=" ",r={sheetsBarWrapper:"k-widget k-header",sheetsBarSheetsWrapper:"k-tabstrip k-floatwrap k-tabstrip-bottom",sheetsBarActive:"k-spreadsheet-sheets-bar-active",sheetsBarInactive:"k-spreadsheet-sheets-bar-inactive",sheetsBarAdd:"k-spreadsheet-sheets-bar-add",sheetsBarRemove:"k-spreadsheet-sheets-remove",sheetsBarItems:"k-spreadsheet-sheets-items",sheetsBarEditor:"k-spreadsheet-sheets-editor",sheetsBarScrollable:"k-tabstrip-scrollable",sheetsBarNext:"k-tabstrip-next",sheetsBarPrev:"k-tabstrip-prev",sheetsBarKItem:"k-item k-state-default",sheetsBarKActive:"k-state-active k-state-tab-on-top",sheetsBarKTextbox:"k-textbox",sheetsBarKLink:"k-link",sheetsBarKIcon:"k-icon",sheetsBarKFontIcon:"k-font-icon",sheetsBarKButton:"k-button k-button-icon",sheetsBarKButtonBare:"k-button-bare",sheetsBarKArrowW:"k-i-arrow-w",sheetsBarKArrowE:"k-i-arrow-e",sheetsBarKReset:"k-reset k-tabstrip-items",sheetsBarKIconX:"k-i-x",sheetsBarKSprite:"k-sprite",sheetsBarKIconPlus:"k-i-plus",sheetsBarHintWrapper:"k-widget k-tabstrip k-tabstrip-bottom k-spreadsheet-sheets-items-hint",sheetsBarKResetItems:"k-reset k-tabstrip-items"},o=e.ui.Widget.extend({init:function(t,i){var r=o.classNames;e.ui.Widget.call(this,t,i),t=this.element,t.addClass(r.sheetsBarWrapper),this._tree=new e.dom.Tree(t[0]),this._tree.render([this._addButton(),this._createSheetsWrapper([])]),this._toggleScrollEvents(!0),this._createSortable(),this._sortable.bind("start",this._onSheetReorderStart.bind(this)),this._sortable.bind("end",this._onSheetReorderEnd.bind(this)),t.on("click",n+r.sheetsBarRemove,this._onSheetRemove.bind(this)),t.on("click","li",this._onSheetSelect.bind(this)),t.on("dblclick","li"+n+r.sheetsBarActive,this._createEditor.bind(this)),t.on("click",n+r.sheetsBarAdd,this._onAddSelect.bind(this))},options:{name:"SheetsBar",scrollable:{distance:200}},events:["select","reorder","rename"],_createEditor:function(){this._editor||(this._renderSheets(this._sheets,this._selectedIndex,!0),this._editor=this.element.find(e.format("input{0}{1}",n,o.classNames.sheetsBarEditor)).focus().on("keydown",this._onEditorKeydown.bind(this)).on("blur",this._onEditorBlur.bind(this)))},_destroyEditor:function(){this._editor.off(),this._editor=null,this._renderSheets(this._sheets,this._selectedIndex,!1)},renderSheets:function(e,t){!e||0>t||this._renderSheets(e,t,!1)},_renderSheets:function(t,r,s){var a,l,u,c,h,d,f,p,m,g,v,b=this,w=o.classNames;b._isRtl=e.support.isRtl(b.element),b._sheets=t,b._selectedIndex=r,b._renderHtml(s,!0),b._scrollableAllowed()&&(u=b._sheetsWrapper(),c=u.children(n+w.sheetsBarPrev),h=u.children(n+w.sheetsBarNext),d=2,f=b.element.find(n+w.sheetsBarAdd),p=f.outerWidth()+f.position().left+d,m=c.outerWidth()+d,g=b._sheetsGroup(),c.css({left:p}),u.addClass(w.sheetsBarScrollable+i+w.sheetsBarSheetsWrapper),g.css({marginLeft:p}),a=u[0].offsetWidth,l=g[0].scrollWidth,l+p>a?(v=Math.ceil(e.parseFloat(h.css("right"))),b._scrollableModeActive||(b._nowScrollingSheets=!1,b._scrollableModeActive=!0),g.css({marginLeft:m+p,marginRight:h.outerWidth()+v+d})):b._scrollableModeActive&&a>=l?(b._scrollableModeActive=!1,g.css({marginLeft:p,marginRight:""})):g.css({marginLeft:p}),b._toggleScrollButtons())},_toggleScrollButtons:function(e){var t=this,i=t._sheetsGroup(),r=t._sheetsWrapper(),s=i.scrollLeft(),a=r.find(n+o.classNames.sheetsBarPrev),l=r.find(n+o.classNames.sheetsBarNext);e===!1?(a.toggle(!1),l.toggle(!1)):(a.toggle(t._isRtl?i[0].scrollWidth-i[0].offsetWidth-1>s:0!==s),l.toggle(t._isRtl?0!==s:i[0].scrollWidth-i[0].offsetWidth-1>s))},_toggleScrollEvents:function(e){var t=this,i=o.classNames,r=t.options,s=t._sheetsWrapper(),a=s.children(n+i.sheetsBarPrev),l=s.children(n+i.sheetsBarNext);e?(a.on("mousedown",function(){t._nowScrollingSheets=!0,t._scrollSheetsByDelta(r.scrollable.distance*(t._isRtl?1:-1))}),l.on("mousedown",function(){t._nowScrollingSheets=!0,t._scrollSheetsByDelta(r.scrollable.distance*(t._isRtl?-1:1))}),a.add(l).on("mouseup",function(){t._nowScrollingSheets=!1})):(a.off(),l.off())},_renderHtml:function(t,n){var r,s,a,l,u,c,h=[],d=e.dom,f=d.element,p=this._sheets,m=this._selectedIndex,g=o.classNames;for(r=0;p.length>r;r++)s=p[r],a=r===m,l={className:g.sheetsBarKItem+i},u=[],l.className+=a?g.sheetsBarKActive+i+g.sheetsBarActive:g.sheetsBarInactive,a&&t?u.push(f("input",{type:"text",value:s.name(),className:g.sheetsBarKTextbox+i+g.sheetsBarEditor,maxlength:50},[])):(u.push(f("span",{className:g.sheetsBarKLink,title:s.name()},[d.text(s.name())])),c=f("span",{className:g.sheetsBarKIcon+i+g.sheetsBarKFontIcon+i+g.sheetsBarKIconX},[]),u.push(f("span",{className:g.sheetsBarKLink+i+g.sheetsBarRemove},[c]))),h.push(f("li",l,u));this._tree.render([this._addButton(),this._createSheetsWrapper(h,n)])},_createSheetsWrapper:function(t,n){var r,s=e.dom.element,a=o.classNames,l=[s("ul",{className:a.sheetsBarKReset},t)];return n=!0,n&&(r=a.sheetsBarKButton+i+a.sheetsBarKButtonBare+i,l.push(s("span",{className:r+a.sheetsBarPrev},[s("span",{className:a.sheetsBarKIcon+i+a.sheetsBarKArrowW},[])])),l.push(s("span",{className:r+a.sheetsBarNext},[s("span",{className:a.sheetsBarKIcon+i+a.sheetsBarKArrowE},[])]))),s("div",{className:a.sheetsBarItems},l)},_createSortable:function(){var i=o.classNames;this._sortable=new e.ui.Sortable(this.element,{filter:e.format("ul li.{0},ul li.{1}",i.sheetsBarActive,i.sheetsBarInactive),container:n+i.sheetsBarItems,axis:"x",animation:!1,ignore:"input",end:function(){this.draggable.hint&&this.draggable.hint.remove()},hint:function(e){var n=t(e).clone();return n.wrap("<div class='"+i.sheetsBarHintWrapper+"'><ul class='"+i.sheetsBarKResetItems+"'></ul></div>").closest("div")}})},_onEditorKeydown:function(e){this._editor&&(13===e.which&&(this._destroyEditor(),this._onSheetRename(t(e.target).val())),27===e.which&&(this._destroyEditor(),this._onSheetRename()))},_onEditorBlur:function(e){this._editor&&(this._destroyEditor(),this._onSheetRename(t(e.target).val()))},_onSheetReorderEnd:function(e){e.preventDefault(),this.trigger("reorder",{oldIndex:e.oldIndex,newIndex:e.newIndex})},_onSheetReorderStart:function(e){this._editor&&e.preventDefault()},_onSheetRemove:function(e){var n=t(e.target).closest("li").text();this._editor&&(this._destroyEditor(),this._onSheetRename(this._editor.val())),this.trigger("remove",{name:n})},_onSheetSelect:function(e){var i,r=t(e.target).text();return t(e.target).is(n+o.classNames.sheetsBarEditor)||!r?void e.preventDefault():(this._editor&&(i=this._editor.val(),this._destroyEditor(),this._onSheetRename(i)),this._scrollSheetsToItem(t(e.target).closest("li")),void this.trigger("select",{name:r,isAddButton:!1}))},_onSheetRename:function(e){this.trigger("rename",{name:e,sheetIndex:this._selectedIndex})},_onAddSelect:function(){this.trigger("select",{isAddButton:!0})},_addButton:function(){var t=e.dom.element,n=o.classNames;return t("a",{className:n.sheetsBarAdd+i+n.sheetsBarKButton},[t("span",{className:n.sheetsBarKSprite+i+n.sheetsBarKIcon+i+n.sheetsBarKFontIcon+i+n.sheetsBarKIconPlus},[])])},destroy:function(){this._sortable.destroy()},_scrollableAllowed:function(){var e=this.options;return e.scrollable&&!isNaN(e.scrollable.distance)},_scrollSheetsToItem:function(e){var t,n,i,r,o,s,a,l=this;l._scrollableModeActive&&(t=l._sheetsGroup(),n=t.scrollLeft(),i=e.outerWidth(),r=l._isRtl?e.position().left:e.position().left-t.children().first().position().left,o=t[0].offsetWidth,s=Math.ceil(parseFloat(t.css("padding-left"))),l._isRtl?0>r?a=n+r-(o-n)-s:r+i>o&&(a=n+r-i+2*s):r+i>n+o?a=r+i-o+2*s:n>r&&(a=r-s),t.finish().animate({scrollLeft:a},"fast","linear",function(){l._toggleScrollButtons()}))},_sheetsGroup:function(){return this._sheetsWrapper().children("ul")},_sheetsWrapper:function(){return this.element.find(n+o.classNames.sheetsBarItems)},_scrollSheetsByDelta:function(e){var t=this,n=t._sheetsGroup(),i=n.scrollLeft();n.finish().animate({scrollLeft:i+e},"fast","linear",function(){t._nowScrollingSheets?t._scrollSheetsByDelta(e):t._toggleScrollButtons()})}}),e.spreadsheet.SheetsBar=o,t.extend(!0,o,{classNames:r}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/calc.min",["spreadsheet/runtime.min"],e)}(function(){"use strict";function e(e){e=e.toUpperCase();for(var t=0,n=0;e.length>n;++n)t=26*t+e.charCodeAt(n)-64;return t-1}function t(e){return parseInt(e,10)-1}function n(n,i){var r,o,s,a,u,c;if("#sheet"==n.toLowerCase())return f.SHEETREF;e:{if(!(r=/^(\$)?([a-z]+)(\$)?(\d+)$/i.exec(n))){for(a=l(n,{}),u=[];;){if(c=a.next(),c instanceof m)c.rel=0;else{if(!(c instanceof p))break e;c.topLeft.rel=0,c.bottomRight.rel=0}if(u.push(c),a.eof())break;if(!a.is("op",","))break e;a.next()}return 1==u.length?u[0]:new f.UnionRef(u)}if(o=t(r[4]),s=e(r[2]),1048576>=o&&16383>=s)return new m(t(r[4]),e(r[2]))}if(!i)throw Error("Cannot parse reference: "+n)}function i(e,t,n,i){function r(e){return e.index=b.length,b.push(e),e}function o(e,t){if(v(e,t))return i.next();var n=i.peek();i.croak(n?"Expected "+e+" «"+t+"» but found "+n.type+" «"+n.value+"»":"Expected "+e+" «"+t+"»")}function s(e){return m(f(h(e)),0,e)}function a(e){return"TRUE"==e.upper||"FALSE"==e.upper?"TRUE"==e.upper?_:x:r(new g(e.value))}function u(){var e,t=i.next();if(t=t.value,o("punc","("),e=[],!v("punc",")"))for(;;)if(v("op",","))e.push({type:"null"}),i.next();else{if(e.push(s(!1)),i.eof()||v("punc",")"))break;o("op",",")}return o("punc",")"),{type:"func",func:t,args:e}}function c(t){return t.hasSheet()||t.setSheet(e),r(t)}function h(e){var t;return v("ref")?t=c(i.next()):v("func")?t=u():v("punc","(")?(i.next(),t=s(!0),o("punc",")")):v("punc","{")?(i.next(),t=d(),o("punc","}")):v("num")||v("str")?t=i.next():v("sym")?t=a(i.next()):v("op","+")||v("op","-")?t={type:"prefix",op:i.next().value,exp:s(e)}:i.croak(i.peek()?"Parse error":"Incomplete expression"),p(t)}function d(){for(var e=[],t=[e],n=!0;!i.eof()&&!v("punc","}");)n?n=!1:v("punc",";")?(t.push(e=[]),i.next()):o("op",","),e.push(s(!1));return{type:"matrix",value:t}}function f(e){return v("punc","(")||v("ref")||v("num")||v("func")?{type:"binary",op:" ",left:e,right:s(!1)}:e}function p(e){return v("op","%")?(i.next(),p({type:"postfix",op:"%",exp:e})):e}function m(e,t,n){var r,o,s=v("op");return s&&(n||","!=s.value)&&(r=w[s.value],r>t)?(i.next(),o=m(h(n),r,n),m({type:"binary",op:s.value,left:e,right:o},t,n)):e}var v,b=[];return i=l(i,{row:t,col:n}),v=i.is,{type:"exp",ast:s(!0),refs:b,sheet:e,row:t,col:n}}function r(e){function t(e,r){switch(e.type){case"num":case"bool":return JSON.stringify(e.value);case"str":return JSON.stringify(JSON.stringify(e.value));case"ref":return"this.refs["+e.index+"].print(row, col)";case"prefix":return i(e.op,r,function(){return JSON.stringify(e.op)+" + "+t(e.exp,w[e.op])});case"postfix":return i(e.op,r,function(){return t(e.exp,w[e.op])+" + "+JSON.stringify(e.op)});case"binary":return i(e.op,r,function(){var i=n(t(e.left,w[e.op]),e.left instanceof g&&":"==e.op),r=n(t(e.right,w[e.op]),e.right instanceof g&&":"==e.op);return i+" + "+JSON.stringify(e.op)+" + "+r});case"func":return JSON.stringify(e.func+"(")+" + "+(e.args.length>0?e.args.map(function(e){return t(e,0)}).join(" + ', ' + "):"''")+" + ')'";case"matrix":return"'{ ' + "+e.value.map(function(e){return e.map(function(e){return t(e,0)}).join(" + ', ' + ")}).join(" + '; ' + ")+"+ ' }'";case"null":return"''"}throw Error("Cannot make printer for node "+e.type)}function n(e,t){return t?"'(' + "+e+" + ')'":e}function i(e,t,i){var r=t>w[e]||!t&&","==e;return n(i(),r)}return k("function(row, col){return("+t(e.ast,0)+")}")}function o(e,t){function n(e,t){switch(e.type){case"ref":case"num":case"str":case"null":case"bool":return i(e,t);case"prefix":case"postfix":return r(e,t);case"binary":return o(e,t);case"func":return u(e,t);case"lambda":return c(e,t);case"matrix":return h(e.value,t,!0)}throw Error("Cannot CPS "+e.type)}function i(e,t){return t(e)}function r(e,t){return n({type:"func",func:"unary"+e.op,args:[e.exp]},t)}function o(e,t){return n({type:"func",func:"binary"+e.op,args:[e.left,e.right]},t)}function s(e,t,i,r){return n(e,function(e){var o=d(r),s=f("T"),a=f("E");return{type:"func",func:"if",args:[o,e,{type:"lambda",vars:[s],body:n(t||_,function(e){return{type:"call",func:{type:"var",name:s},args:[e]}})},{type:"lambda",vars:[a],body:n(i||x,function(e){return{type:"call",func:{type:"var",name:a},args:[e]}})}]}})}function a(e,t){return 0===e.length?i(_,t):n({type:"func",func:"IF",args:[e[0],{type:"func",func:"AND",args:e.slice(1)},x]},t)}function l(e,t){return 0===e.length?i(x,t):n({type:"func",func:"IF",args:[e[0],_,{type:"func",func:"OR",args:e.slice(1)}]},t)}function u(e,t){switch(e.func.toLowerCase()){case"if":return s(e.args[0],e.args[1],e.args[2],t);case"and":return a(e.args,t);case"or":return l(e.args,t);case"true":return t(_);case"false":return t(x)}return function i(t,r){return r==e.args.length?{type:"func",func:e.func,args:t}:n(e.args[r],function(e){return i(t.concat([e]),r+1)})}([d(t)],0)}function c(e,t){var i=f("K"),r=n(e.body,function(e){return{type:"call",func:{type:"var",value:i},args:[e]}});return t({type:"lambda",vars:[i].concat(e.vars),body:r})}function h(e,t,i){var r=[];return function o(s){return s==e.length?t({type:"matrix",value:r}):(i?h:n)(e[s],function(e){return r[s]=e,o(s+1)})}(0)}function d(e){var t=f("R");return{type:"lambda",vars:[t],body:e({type:"var",name:t})}}function f(e){return e||(e=""),e="_"+e,e+ ++p}var p=0;return n(e,t)}function s(e){function t(e){var i=e.type;if("num"==i)return e.value+"";if("str"==i)return JSON.stringify(e.value);if("return"==i)return"context.resolve("+t(e.value)+")";if("func"==i)return"context.func("+JSON.stringify(e.func)+", "+t(e.args[0])+", "+n(e.args.slice(1))+")";if("call"==i)return t(e.func)+"("+e.args.map(t).join(", ")+")";if("ref"==i)return"refs["+e.index+"]";if("bool"==i)return""+e.value;if("if"==i)return"(context.bool("+t(e.co)+") ? "+t(e.th)+" : "+t(e.el)+")";if("lambda"==i)return"(function("+e.vars.join(", ")+"){ return("+t(e.body)+") })";if("var"==i)return e.name;if("matrix"==i)return n(e.value);if("null"==i)return"null";throw Error("Cannot compile expression "+i)}function n(e){return"[ "+e.map(t).join(", ")+" ]"}var i,s=r(e),a=s.call(e),l=C[a];return l?l.clone(e.sheet,e.row,e.col):(i=t(o(e.ast,function(e){return{type:"return",value:e}})),i=["function(){","var context = this, refs = context.formula.absrefs",i,"}"].join(";\n"),l=new b.Formula(e.refs,k(i),s,e.sheet,e.row,e.col),C[a]=l,l)}function a(e){return e}function l(n,i){function r(e,t){var n=o();return null==n||null!=e&&n.type!==e||null!=t&&n.value!==t?null:n}function o(){return null==C&&(C=l()),C}function s(){if(null!=C){var e=C;return C=null,e}return l()}function l(){var e,t=n.peek();return t&&(("sym"==t.type||"rc"==t.type||"num"==t.type)&&(e=x(8,d)||x(6,f)||x(6,v)||x(4,b)||x(4,w)||x(2,y)||x(2,_)),e||(e=n.next())),e}function h(r,o){var s,a,l,u,c;if("rc"==r.type)return!r.rel||i.forEditor||null!=i.row&&null!=i.col||n.croak("Cannot read relative cell in RC notation"),new m(r.row,r.col,r.rel);if("num"==r.type)return 1048577>=r.value?F(new m(t(r.value),o?-(1/0):+(1/0),2)):null;if(s=r.value,a=/^(\$)?([a-z]+)(\$)?(\d+)$/i.exec(s))return l=t(a[4]),u=e(a[2]),1048576>=l&&16383>=u?F(new m(t(a[4]),e(a[2]),(a[1]?0:1)|(a[3]?0:2))):null;if(c="$"==s.charAt(0),c&&(s=s.substr(1)),/^\d+$/.test(s)){if(l=t(s),1048576>=l)return F(new m(t(s),o?-(1/0):+(1/0),c?0:2))}else if(u=e(s),16383>=u)return F(new m(o?-(1/0):+(1/0),e(s),c?0:1))}function d(e,t,n,i,r,o,s,a){if("sym"==e.type&&"op"==t.type&&":"==t.value&&"sym"==n.type&&"punc"==i.type&&"!"==i.value&&("sym"==r.type||"rc"==r.type||"num"==r.type&&r.value==r.value|0)&&"op"==o.type&&":"==o.value&&("sym"==s.type||"rc"==s.type||"num"==s.type&&s.value==s.value|0)&&s.type==r.type&&("punc"!=a.type||"("!=a.value||s.space)){var l=h(r,!0),u=h(s,!1);if(l&&u)return k(7),R(new p(l.setSheet(e.value,!0),u.setSheet(n.value,!0)).setSheet(e.value,!0),e,s)}}function f(e,t,n,i,r,o){var s,a;return"sym"==e.type&&"op"==t.type&&":"==t.value&&"sym"==n.type&&"punc"==i.type&&"!"==i.value&&("sym"==r.type||"rc"==r.type||"num"==r.type&&r.value==r.value|0)&&("punc"!=o.type||"("!=o.value||r.space)&&(s=h(r))?(k(5),a=s.clone(),R(new p(s.setSheet(e.value,!0),a.setSheet(n.value,!0)).setSheet(e.value,!0),e,r)):void 0}function v(e,t,n,i,r,o){if("sym"==e.type&&"punc"==t.type&&"!"==t.value&&("sym"==n.type||"rc"==n.type||"num"==n.type&&n.value==n.value|0)&&"op"==i.type&&":"==i.value&&("sym"==r.type||"rc"==r.type||"num"==r.type&&r.value==r.value|0)&&("punc"!=o.type||"("!=o.value||r.space)){var s=h(n,!0),a=h(r,!1);if(s&&a)return k(5),R(new p(s,a).setSheet(e.value,!0),e,r)}}function b(e,t,n,i){if("sym"==e.type&&"punc"==t.type&&"!"==t.value&&("sym"==n.type||"rc"==n.type||"num"==n.type&&n.value==n.value|0)&&("punc"!=i.type||"("!=i.value||n.space)){k(3);var r=h(n);return r||(r=new g(n.value)),R(r.setSheet(e.value,!0),e,n)}}function w(e,t,n,i){if(("sym"==e.type||"rc"==e.type||"num"==e.type&&e.value==e.value|0)&&"op"==t.type&&":"==t.value&&("sym"==n.type||"rc"==n.type||"num"==n.type&&n.value==n.value|0)&&("punc"!=i.type||"("!=i.value||n.space)){var r=h(e,!0),o=h(n,!1);if(r&&o)return k(3),R(new p(r,o),e,n)}}function y(e,t){if(("sym"==e.type||"rc"==e.type)&&("punc"!=t.type||"("!=t.value||e.space)){var n=h(e);if(n&&isFinite(n.row)&&isFinite(n.col))return k(1),R(n,e,e)}}function _(e,t){return"sym"!=e.type||"punc"!=t.type||"("!=t.value||e.space?void 0:(e.type="func",k(1),e)}var x,k,C,F,R;return n=u(c(n),i),x=n.ahead,k=n.skip,C=null,F=null!=i.row&&null!=i.col?function(e){return 1&e.rel&&(e.col-=i.col),2&e.rel&&(e.row-=i.row),e}:a,R=i.forEditor?function(e,t,n){return e.begin=t.begin,e.end=n.end,e}:a,{peek:o,next:s,croak:n.croak,eof:n.eof,is:r}}function u(e,t){function n(e){return/[0-9]/i.test(e)}function i(e){return/[a-z$_]/i.test(e)||e.toLowerCase()!=e.toUpperCase()}function r(e){return i(e)||n(e)||"."==e}function o(e){return e in w}function s(e){return"!;(){}[]".indexOf(e)>=0}function a(e){return" 	\n ".indexOf(e)>=0}function l(){var e=!1,t=R(function(t){return"."==t?e?!1:(e=!0,!0):n(t)});return{type:"num",value:parseFloat(t)}}function u(t,n){return{type:"sym",value:t,upper:t.toUpperCase(),space:a(e.peek()),quote:n}}function c(e,t,n){var i,r;return!e&&!n||e&&n?(i=e&&/-$/.test(e),r=parseInt(t,10),i&&(r=-r),e||r--,r):void 0}function h(){var t,n,i=e.lookingAt(/^R(\[-?)?([0-9]+)(\])?C(\[-?)?([0-9]+)(\])?/i);return i&&(t=c(i[1],i[2],i[3]),n=c(i[4],i[5],i[6]),null!=t&&null!=n)?(e.skip(i),{type:"rc",row:t,col:n,rel:(i[4]?1:0)|(i[1]?2:0)}):u(R(r))}function d(){return e.next(),{type:"str",value:e.readEscaped('"')}}function f(){return e.next(),u(e.readEscaped("'"),!0)}function p(){return{type:"op",value:R(function(e,t){return t+e in w})}}function m(){return{type:"punc",value:e.next()}}function g(){if(e.eof())return null;var r,a=e.peek();return'"'==a?d():"'"==a?f():n(a)?l():i(a)?h():o(a)?p():s(a)?m():(r=e.lookingAt(/^#([a-z\/]+)[?!]/i))?(e.skip(r),{type:"error",value:r[1]}):(t.forEditor||e.croak("Can't handle character: "+a),{type:"error",value:e.next()})}function v(){for(var n,i;C>=k.length;)R(a),n=e.pos(),i=g(),t.forEditor&&i&&(i.begin=n,i.end=e.pos()),k.push(i);return k[C]}function b(){var e=v();return e&&C++,e}function y(e,t){for(var n=C,i=[];e-- >0;)i.push(b()||F);return C=n,t.apply(i,i)}function _(e){C+=e}function x(){return null==v()}var k=[],C=0,R=e.readWhile;return{next:b,peek:v,eof:x,croak:e.croak,ahead:y,skip:_}}function c(e){function t(){return h}function n(){var t=e.charAt(h++);return"\n"==t?(d++,f=0):f++,t}function i(){return e.charAt(h)}function r(){return""===i()}function o(e){throw new y(e,h)}function s(t){if("string"==typeof t)e.substr(h,t.length)!=t&&o("Expected "+t),a(t.length);else if(t instanceof RegExp){var n=t.exec(e.substr(h));if(n)return a(n[0].length),n}else a(t[0].length)}function a(e){for(;e-- >0;)n()}function l(e){for(var t,i=!1,o="";!r();)if(t=n(),i)o+=t,i=!1;else if("\\"==t)i=!0;else{if(t==e)break;o+=t}return o}function u(e){for(var t="";!r()&&e(i(),t);)t+=n();return t}function c(t){return t.exec(e.substr(h))}var h=0,d=1,f=0;return{next:n,peek:i,eof:r,croak:o,readWhile:u,readEscaped:l,lookingAt:c,skip:s,forward:a,pos:t}}function h(e,t,n){function i(){var i=e.next();return"sym"==i.type?"TRUE"==i.upper?(i.type="bool",i.value=!0):"FALSE"==i.upper&&(i.type="bool",i.value=!1):"ref"==i.type&&(i={type:"ref",ref:null!=t&&null!=n?i.absolute(t,n):i,begin:i.begin,end:i.end}),i}var r,o=[];for(e=l(e,{forEditor:!0,row:t,col:n});!e.eof();)o.push(i());return r=o[0],"op"==r.type&&"="==r.value&&(r.type="startexp"),o}function d(e,t){for(var n="";t-- >0;)n+=e;return n}var f,p,m,g,v,b,w,y,_,x,k,C,F,R,S;kendo.support.browser.msie&&kendo.support.browser.version<9||(f=kendo.spreadsheet,p=f.RangeRef,m=f.CellRef,g=f.NameRef,v=f.calc,b=v.runtime,w=Object.create(null),y=kendo.Class.extend({init:function(e,t){this.message=e,this.pos=t},toString:function(){return this.message}}),function(e){e.forEach(function(t,n){t.forEach(function(t){w[t]=e.length-n})})}([[":"],[" "],[","],["%"],["^"],["*","/"],["+","-"],["&"],["=","<",">","<=",">=","<>"]]),_={type:"bool",value:!0},x={type:"bool",value:!1},k=function(e){return function(t){var n=e[t];return n||(n=e[t]=Function("'use strict';return("+t+")")()),n}}(Object.create(null)),C=Object.create(null),F={type:"eof"},R=[],S=v.registerFormatParser=function(e){R.push(e)},v.parse=function(e,t,n,r){var o,s,a,l,u;if(r instanceof Date)return{type:"date",value:b.dateToSerial(r)};if("number"==typeof r)return{type:"number",value:r};if("boolean"==typeof r)return{type:"boolean",value:r};if(r+="",/^'/.test(r))return{type:"string",value:r.substr(1)};if(/^[0-9.]+%$/.test(r)&&(o=r.substr(0,r.length-1),s=parseFloat(o),!isNaN(s)&&s==o))return{type:"percent",value:s/100};if(/^=/.test(r))return r=r.substr(1),/\S/.test(r)?i(e,t,n,r):{type:"string",value:"="+r};for(a=0;R.length>a;++a)if(l=R[a](r))return l;return"true"==r.toLowerCase()?{type:"boolean",value:!0}:"false"==r.toLowerCase()?{type:"boolean",value:!1}:(u=b.parseDate(r))?{type:"date",value:b.dateToSerial(u)}:(s=parseFloat(r),!isNaN(s)&&r.length>0&&s==r?{type:"number",value:s}:{type:"string",value:r})},v.parseFormula=i,v.parseReference=n,v.compile=s,v.InputStream=c,v.ParseError=y,v.tokenize=h,S(function(e){var t,n,i,r,o;return(t=/^(\d+):(\d+)$/.exec(e))?(n=parseInt(t[1],10),i=parseInt(t[2],10),{type:"date",format:"hh:mm",value:b.packTime(n,i,0,0)}):(t=/^(\d+):(\d+)(\.\d+)$/.exec(e))?(i=parseInt(t[1],10),r=parseInt(t[2],10),o=1e3*parseFloat(t[3]),{type:"date",format:"mm:ss.00",value:b.packTime(0,i,r,o)}):(t=/^(\d+):(\d+):(\d+)$/.exec(e))?(n=parseInt(t[1],10),i=parseInt(t[2],10),r=parseInt(t[3],10),{type:"date",format:"hh:mm:ss",value:b.packTime(n,i,r,0)}):(t=/^(\d+):(\d+):(\d+)(\.\d+)$/.exec(e))?(n=parseInt(t[1],10),i=parseInt(t[2],10),r=parseInt(t[3],10),o=1e3*parseFloat(t[4]),{type:"date",format:"hh:mm:ss.00",value:b.packTime(n,i,r,o)}):void 0}),S(function(e){var t,n,i,r=kendo.culture(),o=r.numberFormat[","],s=r.numberFormat["."],a=r.numberFormat.currency.symbol,l=RegExp("^(\\"+a+"\\s*)?(\\d+(\\"+o+"\\d{3})*(\\"+s+"\\d+)?)(\\s*\\"+a+")?$");return(t=l.exec(e))?(n=t[2].replace(RegExp("\\"+o,"g"),"").replace(s,"."),i="#",(t[1]||t[3]||t[5])&&(i+=",#"),t[4]&&(i+="."+d("0",t[1]||t[5]?2:t[4].length-1)),t[1]&&(i='"'+t[1]+'"'+i),t[5]&&(i=i+'"'+t[5]+'"'),{type:"number",format:i,value:parseFloat(n)}):void 0}))},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/excel-reader.min",["kendo.core.min","kendo.color.min","util/parse-xml.min","spreadsheet/calc.min"],e)}(function(){"use strict";function e(e,n,i){var r=new FileReader;r.onload=function(e){var r=new JSZip(e.target.result);t(r,n,i)},r.readAsArrayBuffer(e)}function t(e,t,i){var s=h(e),a=d(e,"workbook.xml"),l=p(e,a.byType.theme[0]),u=f(e,l),v=[],b=0;c(e,"xl/workbook.xml",{enter:function(n,i){var r,l,c,h;this.is(M)?(r=i["r:id"],l=a.byId[r],c=i.name,h=o(e,l),v.push({workbook:t,zip:e,strings:s,styles:u,file:l,options:{name:c,rows:Math.max(t.options.rows||0,h.rows),columns:Math.max(t.options.columns||0,h.cols),columnWidth:h.columnWidth,rowHeight:h.rowHeight}})):this.is(L)&&i.activeTab&&(b=m(i.activeTab))},text:function(e){var n,i=this.is(k);!i||g(i["function"])||g(i.vbProcedure)||(n=y(e,!0),t.defineName(i.name,n,g(i.hidden)))}}),n(v,t,i).then(function(){var e=t.sheets();r(e),t.activeSheet(e[b])})}function n(e,t,n){var r,o=(new b.Deferred).resolve();for(r=0;e.length>r;r++)!function(r,s){o=o.then(function(){var o,a,l=t.insertSheet(r.options);return l.suspendChanges(!0),o=i(l,r),n&&(a={sheet:l,progress:s/(e.length-1)},o.then(function(){n.notify(a)})),o})}(e[r],r);return n&&o.then(function(){n.resolve()}),o}function i(e,t){var n=new b.Deferred;return setTimeout(function(){l(t.zip,t.file,e,t.strings,t.styles),n.resolve()},0),n}function r(e){for(var t=0;e.length>t;t++)e[t].suspendChanges(!1).triggerChange({recalc:!0})}function o(e,t){var n={rows:0,cols:0};return c(e,"xl/"+t,{enter:function(e,t){if("dimension"==e){var i=y(t.ref);i.bottomRight&&(n.cols=i.bottomRight.col+1,n.rows=i.bottomRight.row+1)}else"sheetFormatPr"===e?(t.defaultColWidth&&(n.columnWidth=s(parseFloat(t.defaultColWidth))),t.defaultRowHeight&&(n.rowHeight=a(parseFloat(t.defaultRowHeight)))):this.is(S)&&this.exit()}}),n}function s(e){var t=7,n=(256*e+Math.floor(128/t))/256;return Math.floor(n)*t}function a(e){return 1.5625*e}function l(e,t,n,i,r){var o,l,h,d,f,p=n._columns._count,v=null;c(e,"xl/"+t,{enter:function(e,t){var i,c,b,w,k,C,M,E;if(this.is(_))h=null,d=null,f=null,o=t.r,null==o&&(o=y(v),o.col++,o=""+o),v=o,l=t.t,i=t.s,null!=i&&u(n,o,r,i);else if(this.is(F))n.range(t.ref).merge();else if(this.is(x)){if(c=m(t.min)-1,b=Math.min(p,m(t.max))-1,t.width&&(w=s(parseFloat(t.width)),n._columns.values.value(c,b,w)),"1"===t.hidden)for(k=c;b>=k;k++)n.hideColumn(k)}else this.is(S)?(C=m(t.r)-1,t.ht&&(M=a(parseFloat(t.ht)),n._rows.values.value(C,C,M)),"1"===t.hidden&&n.hideRow(C)):this.is(A)?t.activeCell&&(E=y(t.activeCell),n.select(E,!0)):this.is(R)?"frozen"==t.state&&(t.xSplit&&n.frozenColumns(m(t.xSplit)),t.ySplit&&n.frozenRows(m(t.ySplit))):this.is(N)&&(n.options.showGridLines=g(t.showGridLines,!0))},leave:function(e){if(this.is(_)){if(null!=d)try{n.range(f||o).formula(d)}catch(t){n.range(f||o).value(d).background("#ffaaaa")}else if(null!=h){var r=n.range(o);"str"==l?r.formula(h):r._get("formula")||(l&&"n"!=l?"s"==l?h=i[m(h)]:"b"==l?h="1"===h:"d"==l&&(h=kendo.parseDate(h)):h=parseFloat(h),r.value(h))}}else"cols"==e?n._columns._refresh():"sheetData"==e&&n._rows._refresh()},text:function(e){var t;this.is(B)||this.is(E)?h=e:(t=this.is(C))&&(d=e,"shared"==t.t&&(f=t.ref))}})}function u(e,t,n,i){function r(e){var t="string"==typeof e?e:e.formatCode;null==t||/^general$/i.test(t)||(t=t.replace(/^\[\$-[0-9]+\]/,""),h.format(t))}function o(e){"solid"==e.type&&h.background(e.color)}function s(e){h.fontFamily(e.name),h._property("fontSize",e.size),e.bold&&h.bold(!0),e.italic&&h.italic(!0)}function a(e){function t(t,n){var i,r,o=e[t];o&&(i=I[o.style],0!==i&&(r=o.color,null==r&&(r="#000"),h._property(n,{size:i,color:r})))}t("left","borderLeft"),t("top","borderTop"),t("right","borderRight"),t("bottom","borderBottom")}function l(e,t){var n=d[e];if(null!=n&&!n)return!1;if(c=d[t],u&&null==c){if(n=u[e],null!=n&&!n)return!1;c=u[t]}return null!=c}var u,c,h=e.range(t),d=n.inlineStyles[i];d.xfId&&(u=n.namedStyles[d.xfId]),l("applyBorder","borderId")&&a(n.borders[c]),l("applyFont","fontId")&&s(n.fonts[c]),l("applyAlignment","textAlign")&&h.textAlign(c),l("applyAlignment","verticalAlign")&&h.verticalAlign(c),l("applyAlignment","wrapText")&&h._property("wrap",c),l("applyFill","fillId")&&o(n.fills[c]),l("applyNumberFormat","numFmtId")&&r(n.numFmts[c]||z[c])}function c(e,t,n){var i=e.files[t];i&&w(i.asUint8Array(),n)}function h(e){var t,n=[];return c(e,"xl/sharedStrings.xml",{enter:function(){this.is(T)&&(t="")},leave:function(){this.is(T)&&n.push(t)},text:function(e){this.is(D)&&(t+=e)}}),n}function d(e,t){var n={byId:{},byType:{theme:[]}};return c(e,"xl/_rels/"+t+".rels",{enter:function(e,t){var i,r;"Relationship"==e&&(n.byId[t.Id]=t.Target,i=t.Type.match(/\w+$/)[0],r=n.byType[i]||[],r.push(t.Target),n.byType[i]=r)}}),n}function f(e,t){function n(e){function t(t){null!=e[t]&&(n[t]=g(e[t]))}var n={borderId:m(e.borderId),fillId:m(e.fillId),fontId:m(e.fontId),numFmtId:m(e.numFmtId),pivotButton:g(e.pivotButton),quotePrefix:g(e.quotePrefix),xfId:m(e.xfId)};return t("applyAlignment"),t("applyBorder"),t("applyFill"),t("applyFont"),t("applyNumberFormat"),t("applyProtection"),n}function i(e){var n,i,r;return e.rgb?v(e.rgb):e.indexed?j[m(e.indexed)]:e.theme?(n=t.colorScheme[m(e.theme)],i=kendo.parseColor(n),e.tint&&(i=i.toHSL(),r=parseFloat(e.tint),i.l=0>r?i.l*(1+r):i.l*(1-r)+(100-100*(1-r))),i.toCssRgba()):void 0}var r={fonts:[],numFmts:{},fills:[],borders:[],namedStyles:[],inlineStyles:[]},o=null,s=null,a=null,l=null;return c(e,"xl/styles.xml",{enter:function(e,t,u){if(this.is(U))r.numFmts[t.numFmtId]=t;else if(this.is(H))r.fonts.push(o={});else if(o)"sz"==e?o.size=parseFloat(t.val):"name"==e?o.name=t.val:"b"==e?o.bold=g(t.val,!0):"i"==e&&(o.italic=g(t.val,!0));else if(this.is($))r.fills.push(s={});else if(s)"patternFill"==e?s.type=t.patternType:"fgColor"==e&&"solid"===s.type?s.color=i(t):"bgColor"==e&&"solid"!==s.type&&(s.color=i(t));else if(this.is(P))r.borders.push(a={});else if(a){if(/^(?:left|top|right|bottom)$/.test(e)&&t.style&&(a[e]={style:t.style}),"color"==e){var c=this.stack[this.stack.length-2].$tag;a[c].color=i(t)}}else this.is(V)?(l=n(t),r.namedStyles.push(l),u&&(l=null)):this.is(O)?(l=n(t),r.inlineStyles.push(l),u&&(l=null)):l&&"alignment"==e&&(/^(?:left|center|right|justify)$/.test(t.horizontal)&&(l.textAlign=t.horizontal),
  /^(?:top|center|bottom)$/.test(t.vertical)&&(l.verticalAlign=t.vertical),null!=t.wrapText&&(l.wrapText=g(t.wrapText)))},leave:function(e){this.is(H)?o=null:this.is($)?s=null:this.is(P)?a=null:"xf"==e&&(l=null)}}),r}function p(e,t){function n(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}var i=[],r={colorScheme:i},o="xl/"+t;return e.files[o]&&(c(e,o,{enter:function(e,t){this.is(q)?i.push(v("window"==t.val?"FFFFFFFF":"FF000000")):this.is(W)&&i.push(v("FF"+t.val))}}),i.length>3&&(n(i,0,1),n(i,2,3))),r}function m(e){return null==e?null:parseInt(e,10)}function g(e,t){return null==e?t:"true"==e||e===!0||1==e}function v(e){var t=/^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);return"rgba("+parseInt(t[2],16)+", "+parseInt(t[3],16)+", "+parseInt(t[4],16)+", "+parseInt(t[1],16)/255+")"}var b,w,y,_,x,k,C,F,R,S,A,M,E,D,T,B,L,N,I,z,P,$,H,O,V,U,j,W,q;kendo.support.browser.msie&&kendo.support.browser.version<9||(b=kendo.jQuery,w=kendo.util.parseXML,y=kendo.spreadsheet.calc.parseReference,_=["sheetData","row","c"],x=["cols","col"],k=["definedNames","definedName"],C=["sheetData","row","c","f"],F=["mergeCells","mergeCell"],R=["sheetViews","sheetView","pane"],S=["sheetData","row"],A=["sheetViews","sheetView","selection"],M=["sheets","sheet"],E=["sheetData","row","c","is"],D=["t"],T=["si"],B=["sheetData","row","c","v"],L=["bookViews","workbookView"],N=["sheetViews","sheetView"],I={none:0,thin:1,medium:2,dashed:1,dotted:1,thick:3,"double":3,hair:1,mediumDashed:2,dashDot:1,mediumDashDot:2,dashDotDot:1,mediumDashDotDot:2,slantDashDot:1},z={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"mm-dd-yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@"},P=["borders","border"],$=["fills","fill"],H=["fonts","font"],O=["cellXfs","xf"],V=["cellStyleXfs","xf"],U=["numFmts","numFmt"],j=[v("FF000000"),v("FFFFFFFF"),v("FFFF0000"),v("FF00FF00"),v("FF0000FF"),v("FFFFFF00"),v("FFFF00FF"),v("FF00FFFF"),v("FF000000"),v("FFFFFFFF"),v("FFFF0000"),v("FF00FF00"),v("FF0000FF"),v("FFFFFF00"),v("FFFF00FF"),v("FF00FFFF"),v("FF800000"),v("FF008000"),v("FF000080"),v("FF808000"),v("FF800080"),v("FF008080"),v("FFC0C0C0"),v("FF808080"),v("FF9999FF"),v("FF993366"),v("FFFFFFCC"),v("FFCCFFFF"),v("FF660066"),v("FFFF8080"),v("FF0066CC"),v("FFCCCCFF"),v("FF000080"),v("FFFF00FF"),v("FFFFFF00"),v("FF00FFFF"),v("FF800080"),v("FF800000"),v("FF008080"),v("FF0000FF"),v("FF00CCFF"),v("FFCCFFFF"),v("FFCCFFCC"),v("FFFFFF99"),v("FF99CCFF"),v("FFFF99CC"),v("FFCC99FF"),v("FFFFCC99"),v("FF3366FF"),v("FF33CCCC"),v("FF99CC00"),v("FFFFCC00"),v("FFFF9900"),v("FFFF6600"),v("FF666699"),v("FF969696"),v("FF003366"),v("FF339966"),v("FF003300"),v("FF333300"),v("FF993300"),v("FF993366"),v("FF333399"),v("FF333333"),v("FF000000"),v("FFFFFFFF")],W=["a:clrScheme","*","a:srgbClr"],q=["a:clrScheme","*","a:sysClr"],kendo.spreadsheet.readExcel=e,kendo.spreadsheet._readSheet=l,kendo.spreadsheet._readStrings=h,kendo.spreadsheet._readStyles=f,kendo.spreadsheet._readTheme=p,kendo.spreadsheet._readWorkbook=t)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/workbook.min",["kendo.core.min","spreadsheet/runtime.min","spreadsheet/references.min","spreadsheet/excel-reader.min"],e)}(function(){!function(e){var t,n;e.support.browser.msie&&9>e.support.browser.version||(t=e.jQuery,n=e.Observable.extend({init:function(t,n){e.Observable.fn.init.call(this),this.options=t,this._view=n,this._sheets=[],this._sheetsSearchCache={},this._sheet=this.insertSheet({rows:this.options.rows,columns:this.options.columns,rowHeight:this.options.rowHeight,columnWidth:this.options.columnWidth,headerHeight:this.options.headerHeight,headerWidth:this.options.headerWidth,dataSource:this.options.dataSource}),this.undoRedoStack=new e.util.UndoRedoStack,this.undoRedoStack.bind(["undo","redo"],this._onUndoRedo.bind(this)),this._context=new e.spreadsheet.FormulaContext(this),this._validationContext=new e.spreadsheet.ValidationFormulaContext(this),this._names=Object.create(null),this.fromJSON(this.options)},clipboard:function(){return this._clipboard||(this._clipboard=new e.spreadsheet.Clipboard(this)),this._clipboard},destroy:function(){this.unbind(),this._clipboard&&this._clipboard.destroy()},events:["change","excelImport","excelExport"],_sheetChange:function(e){this.trigger("change",e)},_inputForRef:function(t){return new e.spreadsheet.Range(t,this._sheet).input()},_onUndoRedo:function(e){e.command.range().select()},execute:function(n){var i,r=t.extend({workbook:this},n.options),o=new e.spreadsheet[n.command](r),s=this.activeSheet();return r.origin&&o.origin(r.origin),o.range(r.operatingRange?r.operatingRange:r.editActiveCell?s.activeCellSelection():s.selection()),i=o.exec(),i&&"error"===i.reason||this.undoRedoStack.push(o),i},resetFormulas:function(){this._sheets.forEach(function(e){e.resetFormulas()})},resetValidations:function(){this._sheets.forEach(function(e){e.resetValidations()})},refresh:function(e){e.recalc&&(this.resetFormulas(),this.resetValidations(),this._sheet.recalc(this._context),this._sheet.revalidate(this._validationContext))},activeSheet:function(t){return void 0===t?this._sheet:void(this.sheetByName(t.name())&&(this._sheet=t,t.triggerChange(e.spreadsheet.ALL_REASONS)))},moveSheetToIndex:function(e,t){var n=this.sheetIndex(e),i=this._sheets;-1!==n&&(this._sheetsSearchCache={},i.splice(t,0,i.splice(n,1)[0]),this.trigger("change",{sheetSelection:!0}))},insertSheet:function(t){var n,i,r,o,s,a;return t=t||{},n=this,i="number"==typeof t.index?t.index:n._sheets.length,o=n._sheets,s=function(e){e=e?e:1;var t="Sheet"+e;return n.sheetByName(t)?s(e+1):t},t.name&&n.sheetByName(t.name)?void 0:(this._sheetsSearchCache={},r=t.name||s(),a=new e.spreadsheet.Sheet(t.rows||this.options.rows,t.columns||this.options.columns,t.rowHeight||this.options.rowHeight,t.columnWidth||this.options.columnWidth,t.headerHeight||this.options.headerHeight,t.headerWidth||this.options.headerWidth),a._workbook=this,a._name(r),a.bind("change",this._sheetChange.bind(this)),o.splice(i,0,a),t.data&&a.fromJSON(t.data),t.dataSource&&a.setDataSource(t.dataSource),this.trigger("change",{sheetSelection:!0}),a)},sheets:function(){return this._sheets.slice()},sheetByName:function(e){return this._sheets[this.sheetIndex(e)]},sheetByIndex:function(e){return this._sheets[e]},sheetIndex:function(e){var t,n=this._sheets,i=("string"==typeof e?e:e.name()).toLowerCase(),r=this._sheetsSearchCache[i];if(r>=0)return r;for(r=0;n.length>r;r++)if(t=n[r].name().toLowerCase(),this._sheetsSearchCache[t]=r,t===i)return r;return-1},renameSheet:function(e,t){var n=e.name();if(t&&n!==t&&(e=this.sheetByName(n)))return this._sheetsSearchCache={},this._sheets.forEach(function(e){e._forFormulas(function(e){e.renameSheet(n,t)})}),e._name(t),this.trigger("change",{sheetSelection:!0}),e},removeSheet:function(e){var t,n=this,i=n._sheets,r=e.name(),o=n.sheetIndex(e);1!==i.length&&(this._sheetsSearchCache={},o>-1&&(e.unbind(),i.splice(o,1),n.activeSheet().name()===r?(t=i[o===i.length?o-1:o],n.activeSheet(t)):this.trigger("change",{recalc:!0,sheetSelection:!0})))},fromJSON:function(e){var t,n,i;if(e.sheets)for(t=0;e.sheets.length>t;t++)n=this.sheetByIndex(t),n||(n=this.insertSheet()),n.fromJSON(e.sheets[t]),i=e.sheets[t].dataSource,i&&n.setDataSource(i);e.activeSheet&&this.activeSheet(this.sheetByName(e.activeSheet))},toJSON:function(){return this.resetFormulas(),this.resetValidations(),{activeSheet:this.activeSheet().name(),sheets:this._sheets.map(function(e){return e.recalc(this._context),e.toJSON()},this)}},fromFile:function(n){var i,r=new t.Deferred,o=r.promise(),s={file:n,promise:o};if(n&&!this.trigger("excelImport",s)){for(i=0;this._sheets.length>i;i++)this._sheets[i].unbind();this._sheets=[],this._sheetsSearchCache={},e.spreadsheet.readExcel(n,this,r)}else r.reject();return o},saveAsExcel:function(n){var i,r;n=t.extend({},this.options.excel,n),i=this.toJSON(),this.trigger("excelExport",{workbook:i})||(r=new e.ooxml.Workbook(i),e.saveAs({dataURI:r.toDataURL(),fileName:i.fileName||n.fileName,proxyURL:n.proxyURL,forceProxy:n.forceProxy}))},draw:function(t,n){"function"!=typeof t||n||(n=t,t={});var i=[],r=this._sheets;!function o(s){if(r.length>s)r[s].draw(e.spreadsheet.SHEETREF,t,function(e){i.push(e),o(s+1)});else{var a=i[0];for(s=1;i.length>s;++s)a.children=a.children.concat(i[s].children);n(a)}}(0)},defineName:function(e,t,n){this._names[e]={value:t,hidden:n}},undefineName:function(e){delete this._names[e]},nameValue:function(e){return e in this._names?this._names[e].value:null},adjustNames:function(t,n,i,r){t=t.toLowerCase(),Object.keys(this._names).forEach(function(o){var s=this.nameValue(o);s instanceof e.spreadsheet.Ref&&s.sheet.toLowerCase()==t&&(s=s.adjust(null,null,null,null,n,i,r),this.defineName(o,s))},this)},options:{}}),e.spreadsheet.Workbook=n,e.PDFMixin&&(e.PDFMixin.extend(n.prototype),n.prototype.saveAsPDF=function(n){var i=new t.Deferred,r=i.promise(),o={promise:r};if(!this.trigger("pdfExport",o))return this._drawPDF(n,i).then(function(t){return e.drawing.exportPDF(t)}).done(function(t){e.saveAs({dataURI:t,fileName:n.fileName,proxyURL:n.proxyURL,forceProxy:n.forceProxy,proxyTarget:n.proxyTarget}),i.resolve()}).fail(function(e){i.reject(e)}),r},n.prototype._drawPDF=function(e){var n=new t.Deferred,i=function(e){n.resolve(e)};switch(e.area){case"workbook":e.workbook.draw(e,i);break;case"sheet":e.workbook.activeSheet().draw(e,i);break;case"selection":e.workbook.activeSheet().selection().draw(e,i)}return n.promise()}))}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/formulacontext.min",["kendo.core.min"],e)}(function(){var e,t,n,i,r,o,s,a;kendo.support.browser.msie&&kendo.support.browser.version<9||(e=kendo.spreadsheet,t=e.CellRef,n=e.RangeRef,i=e.UnionRef,r=e.NameRef,o=e.Ref,s=kendo.Class.extend({init:function(e){this.workbook=e},getRefCells:function(e,s){var a,l,u,c,h,d,f,p,m,g,v,b,w,y,_,x,k;if(e instanceof t)return a=this.workbook.sheetByName(e.sheet),a&&e.valid()?(l=a.formula(e),u=a.range(e.row,e.col).value(),null!=l||null!=u?[{formula:l,value:u,row:e.row,col:e.col,sheet:e.sheet,hidden:s?0===a.columnWidth(e.col)||0===a.rowHeight(e.row):!1}]:[]):[{value:new kendo.spreadsheet.calc.runtime.CalcError("REF")}];if(e instanceof n){if(c=this.workbook.sheetIndex(e.sheet),h=[],d=c,e.endSheet&&(d=this.workbook.sheetIndex(e.endSheet),c>d&&(f=c,c=d,d=f)),0>c||0>d||!e.valid())return[{value:new kendo.spreadsheet.calc.runtime.CalcError("REF")}];for(;d>=c;)for(a=this.workbook.sheetByIndex(c++),p=a._grid.normalize(e.topLeft),m=a._grid.normalize(e.bottomRight),g=a._grid.cellRefIndex(p),v=a._grid.cellRefIndex(m),b=a._properties.iterator("value",g,v),w=p.col;m.col>=w;++w)for(y=p.row;m.row>=y;++y)_=a._grid.index(y,w),l=a._properties.get("formula",_),u=b.at(_),(null!=l||null!=u)&&h.push({formula:l,value:u,row:y,col:w,sheet:a.name(),hidden:s?0===a.columnWidth(w)||0===a.rowHeight(y):!1});return h}if(e instanceof i){for(x=[],c=0;e.refs.length>c;++c)x=x.concat(this.getRefCells(e.refs[c],s));return x}return e instanceof r?(k=this.workbook.nameValue(e.name),k instanceof o?this.getRefCells(k,s):[{value:new kendo.spreadsheet.calc.runtime.CalcError("NAME")}]):[]},getData:function(e){var n,i=e instanceof t;return e instanceof r&&(i=this.workbook.nameValue(e)instanceof t),n=this.getRefCells(e).map(function(e){return e.value}),i?n[0]:n},onFormula:function(e){var t=this.workbook.sheetByName(e.sheet),n=e.row,i=e.col,r=e.value,o=t.formula({row:n,col:i});return o!==e?!1:(r instanceof kendo.spreadsheet.calc.runtime.Matrix?r.each(function(e,r,o){t._value(n+r,i+o,e)}):t._value(n,i,r),!0)}}),a=s.extend({onFormula:function(){return!0}}),e.FormulaContext=s,e.ValidationFormulaContext=a)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/controller.min",["kendo.core.min"],e)}(function(){!function(e){"use strict";function t(e){return e.map(function(e){return'[data-action="'+e+'"]'}).join(",")}var n,i,r,o,s,a,l,u,c,h,d,f,p,m,g,v,b;if(!(e.support.browser.msie&&9>e.support.browser.version)){n=e.jQuery,i=/:alphanum$/,r={up:"up",down:"down",left:"left",right:"right",home:"first-col","ctrl+left":"first-col",end:"last-col","ctrl+right":"last-col","ctrl+up":"first-row","ctrl+down":"last-row","ctrl+home":"first","ctrl+end":"last",pageup:"prev-page",pagedown:"next-page"},o={tab:"next","shift+tab":"previous",enter:"lower","shift+enter":"upper","delete":"clearContents",backspace:"clearContents","shift+:alphanum":"edit",":alphanum":"edit","ctrl+:alphanum":"ctrl",":edit":"edit"},s={wheel:"onWheel","*+mousedown":"onMouseDown",contextmenu:"onContextMenu","*+mousedrag":"onMouseDrag","*+mouseup":"onMouseUp","*+dblclick":"onDblClick",mousemove:"onMouseMove"},a={"*+pageup":"onPageUp","*+pagedown":"onPageDown",mouseup:"onMouseUp","*+cut":"onCut","*+paste":"onPaste","*+copy":"onCopy"},l={esc:"onEditorEsc",enter:"onEditorBlur","shift+enter":"onEditorBlur",tab:"onEditorBlur","shift+tab":"onEditorBlur"},u=n.extend({focus:"onEditorBarFocus"},l),c=n.extend({focus:"onEditorCellFocus"},l),h={cell:"range",rowheader:"row",columnheader:"column",topcorner:"sheet",autofill:"autofill"},d=t(["cut","copy","paste","insert-left","insert-right","insert-above","insert-below"]),f=t(["unhide-row","unhide-column"]),p=[],m=[],g=[];for(v in r)p.push(v),m.push("shift+"+v);for(v in o)g.push(v);a[p]="onAction",a[m]="onShiftAction",a[g]="onEntryAction",c[p]="onEditorAction",c[m]="onEditorShiftAction",b=e.Class.extend({init:function(t,i){this.view=t,this.workbook(i),this.container=n(t.container),this.clipboardElement=n(t.clipboard),this.cellContextMenu=t.cellContextMenu,this.rowHeaderContextMenu=t.rowHeaderContextMenu,this.colHeaderContextMenu=t.colHeaderContextMenu,this.scroller=t.scroller,this.tabstrip=t.tabstrip,this.sheetsbar=t.sheetsbar,this.editor=t.editor,this.editor.bind("change",this.onEditorChange.bind(this)),this.editor.bind("activate",this.onEditorActivate.bind(this)),this.editor.bind("deactivate",this.onEditorDeactivate.bind(this)),this.editor.bind("update",this.onEditorUpdate.bind(this)),n(t.scroller).on("scroll",this.onScroll.bind(this)),this.listener=new e.spreadsheet.EventListener(this.container,this,s),this.keyListener=new e.spreadsheet.EventListener(this.clipboardElement,this,a),this.barKeyListener=new e.spreadsheet.EventListener(this.editor.barElement(),this,u),this.inputKeyListener=new e.spreadsheet.EventListener(this.editor.cellElement(),this,c),this.sheetsbar&&(this.sheetsbar.bind("select",this.onSheetBarSelect.bind(this)),this.sheetsbar.bind("reorder",this.onSheetBarReorder.bind(this)),this.sheetsbar.bind("rename",this.onSheetBarRename.bind(this)),this.sheetsbar.bind("remove",this.onSheetBarRemove.bind(this))),this.cellContextMenu.bind("select",this.onContextMenuSelect.bind(this)),this.rowHeaderContextMenu.bind("select",this.onContextMenuSelect.bind(this)),this.colHeaderContextMenu.bind("select",this.onContextMenuSelect.bind(this)),this.cellContextMenu.element.add(this.rowHeaderContextMenu.element).add(this.colHeaderContextMenu.element).on("contextmenu",!1),this.tabstrip&&(this.tabstrip.bind("action",this.onCommandRequest.bind(this)),this.tabstrip.bind("dialog",this.onDialogRequest.bind(this)))},_execute:function(e){var t=this._workbook.execute(e);return"EditCommand"!==e.command||t||this._workbook.trigger("change",{editorClose:!0}),t&&("error"===t.reason?this.view.showError(t):this.view.openDialog(t.reason)),t},_activeTooltip:function(){return""+this._workbook.activeSheet().activeCell().simplify()},onContextMenuSelect:function(e){var t,i=n(e.item).data("action");switch(i){case"cut":t={command:"ToolbarCutCommand",options:{workbook:this._workbook}};break;case"copy":t={command:"ToolbarCopyCommand",options:{workbook:this._workbook}};break;case"paste":t={command:"ToolbarPasteCommand",options:{workbook:this._workbook}};break;case"unmerge":t={command:"MergeCellCommand",options:{value:"unmerge"}};break;case"merge":this.view.openDialog("merge");break;case"hide-row":t={command:"HideLineCommand",options:{axis:"row"}};break;case"hide-column":t={command:"HideLineCommand",options:{axis:"column"}};break;case"unhide-row":t={command:"UnHideLineCommand",options:{axis:"row"}};break;case"unhide-column":t={command:"UnHideLineCommand",options:{axis:"column"}};break;case"delete-row":t={command:"DeleteRowCommand"};break;case"delete-column":t={command:"DeleteColumnCommand"}}t&&this._execute(t)},onSheetBarRemove:function(e){var t=this._workbook.sheetByName(e.name);t&&this._workbook.removeSheet(t)},destroy:function(){this.listener.destroy(),this.keyListener.destroy(),this.inputKeyListener.destroy()},onSheetBarSelect:function(e){var t,n=this._workbook;t=e.isAddButton?n.insertSheet():n.sheetByName(e.name),n.activeSheet().name()!==t.name()&&n.activeSheet(t)},onSheetBarReorder:function(e){var t=this._workbook.sheetByIndex(e.oldIndex);this._workbook.moveSheetToIndex(t,e.newIndex),this._workbook.activeSheet(t)},onSheetBarRename:function(e){var t=this._workbook.sheetByIndex(e.sheetIndex);this._workbook.renameSheet(t,e.name),this.clipboardElement.focus()},sheet:function(e){this.navigator=e.navigator(),this.axisManager=e.axisManager()},workbook:function(e){this._workbook=e,this.clipboard=e.clipboard()},refresh:function(){var e=this.editor,t=this._workbook,n=t.activeSheet();this._viewPortHeight=this.view.scroller.clientHeight,this.navigator.height(this._viewPortHeight),e.isActive()||(e.enable(n.selection().enable()!==!1),e.value(t._inputForRef(n.activeCell())))},onScroll:function(){this.view.render()},onWheel:function(e){var t=e.originalEvent.deltaX,n=e.originalEvent.deltaY;1===e.originalEvent.deltaMode&&(t*=10,n*=10),this.scrollWith(t,n),e.preventDefault()},onAction:function(e,t){this.navigator.moveActiveCell(r[t]),e.preventDefault()},onPageUp:function(){this.scrollDown(-this._viewPortHeight)},onPageDown:function(){this.scrollDown(this._viewPortHeight)},onEntryAction:function(e,t){var n,r,s;if(e.mod){switch(n=!0,r=String.fromCharCode(e.keyCode)){case"A":this.navigator.selectAll();break;case"Y":this._workbook.undoRedoStack.redo();break;case"Z":this._workbook.undoRedoStack.undo();break;default:n=!1}n&&e.preventDefault()}else if(s=this._workbook.activeSheet().selection().enable()===!1,"delete"==t||"backspace"==t){if(s)return;this._execute({command:"ClearContentCommand"}),e.preventDefault()}else if(i.test(t)||":edit"===t){if(s)return;":edit"!==t&&this.editor.value(""),this.editor.activate({range:this._workbook.activeSheet()._viewActiveCell(),rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()}).focus()}else this.navigator.navigateInSelection(o[t]),e.preventDefault()},onShiftAction:function(e,t){this.navigator.modifySelection(r[t.replace("shift+","")],this.appendSelection),e.preventDefault()},onMouseMove:function(e){var t,n=this._workbook.activeSheet();n.resizingInProgress()||n.selectionInProgress()||(t=this.objectAt(e),"columnresizehandle"===t.type||"rowresizehandle"===t.type?n.positionResizeHandle(t.ref):n.removeResizeHandle())},onMouseDown:function(e){var t,n=this.objectAt(e);return n.pane&&(this.originFrame=n.pane),this.editor.canInsertRef(!1)&&n.ref?(this._workbook.activeSheet()._setFormulaSelections(this.editor.highlightedRefs()),this.navigator.startSelection(n.ref,this._selectionMode,this.appendSelection),void e.preventDefault()):(this.editor.deactivate(),this.editor.isActive()?void e.preventDefault():(t=this._workbook.activeSheet(),"columnresizehandle"===n.type||"rowresizehandle"===n.type?(t.startResizing({x:n.x,y:n.y}),void e.preventDefault()):"filtericon"===n.type?(this.openFilterMenu(e),void e.preventDefault()):(this._selectionMode=h[n.type],this.appendSelection=e.mod,void this.navigator.startSelection(n.ref,this._selectionMode,this.appendSelection))))},onContextMenu:function(t){var n,i,r,o,s,a,l=this._workbook.activeSheet();l.resizingInProgress()||(t.preventDefault(),this.cellContextMenu.close(),this.colHeaderContextMenu.close(),this.rowHeaderContextMenu.close(),i={pageX:t.pageX,pageY:t.pageY},r=this.objectAt(i),"columnresizehandle"!==r.type&&"rowresizehandle"!==r.type&&(this.navigator.selectForContextMenu(r.ref,h[r.type]),o=this.navigator._sheet.select()instanceof e.spreadsheet.UnionRef,s=!1,a=!1,"columnheader"==r.type?(n=this.colHeaderContextMenu,s=!o&&this.axisManager.selectionIncludesHiddenColumns()):"rowheader"==r.type?(n=this.rowHeaderContextMenu,s=!o&&this.axisManager.selectionIncludesHiddenRows()):(n=this.cellContextMenu,a=this.navigator.selectionIncludesMergedCells()),n.element.find(d).toggle(!o),n.element.find(f).toggle(s),n.element.find("[data-action=unmerge]").toggle(a),setTimeout(function(){n.open(t.pageX,t.pageY)})))},prevent:function(e){e.preventDefault()},constrainResize:function(e,t){var n=this._workbook.activeSheet(),i=n.resizeHandlePosition();return!i||"outside"===e||"topcorner"===e||i.col>t.col||i.row>t.row},onMouseDrag:function(e){var t,n,i,r;if("sheet"!==this._selectionMode){if(t={pageX:e.pageX,pageY:e.pageY},n=this.objectAt(t),i=this._workbook.activeSheet(),i.resizingInProgress())return void(this.constrainResize(n.type,n.ref)||i.resizeHintPosition({x:n.x,y:n.y}));if("outside"===n.type)return void this.startAutoScroll(n);this.originFrame===n.pane?this.selectToLocation(t):(r=this.originFrame._grid,n.x>r.right&&this.scrollLeft(),n.y>r.bottom&&this.scrollTop(),r.top>n.y||r.left>n.x?this.startAutoScroll(n,t):this.selectToLocation(t)),e.preventDefault()}},onMouseUp:function(e){var t,n,i,r=this._workbook.activeSheet();if(r.completeResizing(),this.navigator.completeSelection(),this.stopAutoScroll(),t=this.editor.activeEditor()){for(n=e.target;n;){if(n===t.element[0])return;n=n.parentNode}i=this.objectAt(e),i&&i.ref&&t.canInsertRef(!1)&&(t.refAtPoint(r.selection()._ref),r._setFormulaSelections(t.highlightedRefs()))}},onDblClick:function(e){var t=this.objectAt(e),n=this._workbook.activeSheet().selection().enable()===!1;"cell"!==t.type||n||(this.editor.activate({range:this._workbook.activeSheet()._viewActiveCell(),rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()}).focus(),this.onEditorUpdate())},onCut:function(e){if(e){var t=this.clipboardElement.find("table.kendo-clipboard-"+this.clipboard._uid).detach();this.clipboardElement.append(t.clone(!1)),setTimeout(function(){this.clipboardElement.empty().append(t)}.bind(this))}this._execute({command:"CutCommand",options:{workbook:this.view._workbook}})},clipBoardValue:function(){return this.clipboardElement.html()},onPaste:function(t){var n,i,r,o="",s="";if(this.clipboard.menuInvoked=void 0===t,t){if(!t.originalEvent.clipboardData||!t.originalEvent.clipboardData.getData)return r=this.clipboardElement.find("table.kendo-clipboard-"+this.clipboard._uid).detach(),this.clipboardElement.empty(),void setTimeout(function(){var e=this.clipboardElement.html(),t=window.clipboardData.getData("Text").trim();(e||t)&&(this.clipboard.external({html:e,plain:t}),this.clipboardElement.empty().append(r),this._execute({command:"PasteCommand",options:{workbook:this.view._workbook}}),this.clipboard.menuInvoked=!0)}.bind(this));t.preventDefault(),n=!1,i=!1,window.DOMStringList&&t.originalEvent.clipboardData.types instanceof window.DOMStringList?(n=t.originalEvent.clipboardData.types.contains("text/html"),i=t.originalEvent.clipboardData.types.contains("text/plain")):(n=/text\/html/.test(t.originalEvent.clipboardData.types),i=/text\/plain/.test(t.originalEvent.clipboardData.types)),n&&(o=t.originalEvent.clipboardData.getData("text/html")),i&&(s=t.originalEvent.clipboardData.getData("text/plain").trim())}else{if(e.support.browser.msie)return this.clipboardElement.focus().select(),void document.execCommand("paste");this.clipboard.menuInvoked=!0}(o||s)&&(this.clipboard.external({html:o,plain:s}),this._execute({command:"PasteCommand",options:{workbook:this.view._workbook}}))},onCopy:function(e){this.clipboard.menuInvoked=void 0===e,this._execute({command:"CopyCommand",options:{workbook:this.view._workbook}})},scrollTop:function(){this.scroller.scrollTop=0},scrollLeft:function(){this.scroller.scrollLeft=0},scrollDown:function(e){this.scroller.scrollTop+=e},scrollRight:function(e){this.scroller.scrollLeft+=e},scrollWith:function(e,t){this.scroller.scrollTop+=t,this.scroller.scrollLeft+=e},objectAt:function(e){var t=this.container.offset(),n={left:e.pageX-t.left,top:e.pageY-t.top};return this.view.objectAt(n.left,n.top)},selectToLocation:function(e){var t=this.objectAt(e);t.pane&&(this.extendSelection(t),this.lastKnownCellLocation=e,this.originFrame=t.pane),this.stopAutoScroll()},extendSelection:function(e){this.navigator.extendSelection(e.ref,this._selectionMode,this.appendSelection)},autoScroll:function(){var e=this._autoScrollTarget.x,t=this._autoScrollTarget.y,n=this.originFrame._grid,i=this.view.scroller,r=8,o=i.scrollLeft,s=i.scrollTop;n.left>e&&this.scrollRight(-r),e>n.right&&this.scrollRight(r),n.top>t&&this.scrollDown(-r),t>n.bottom&&this.scrollDown(r),s===i.scrollTop&&o===i.scrollLeft?this.selectToLocation(this.finalLocation):this.extendSelection(this.objectAt(this.lastKnownCellLocation))},startAutoScroll:function(e,t){this._scrollInterval||(this._scrollInterval=setInterval(this.autoScroll.bind(this),50)),this.finalLocation=t||this.lastKnownCellLocation,this._autoScrollTarget=e},stopAutoScroll:function(){clearInterval(this._scrollInterval),this._scrollInterval=null},openFilterMenu:function(e){var t=this.objectAt(e),n=this._workbook.activeSheet(),i=n.filterColumn(t.ref),r=this.view.createFilterMenu(i);r.bind("action",this.onCommandRequest.bind(this)),r.bind("action",r.close.bind(r)),r.openFor(e.target)},onEditorChange:function(e){this._workbook.activeSheet().isInEditMode(!1);var t=this._execute({command:"EditCommand",options:{editActiveCell:!0,value:e.value}});t&&"error"===t.reason&&e.preventDefault()},onEditorActivate:function(){var e=this._workbook,t=e.activeSheet();t._setFormulaSelections(this.editor.highlightedRefs()),t.isInEditMode(!0)},onEditorDeactivate:function(){var e=this._workbook.activeSheet();e.isInEditMode(!1),e._setFormulaSelections([])},onEditorUpdate:function(){this._workbook.activeSheet()._setFormulaSelections(this.editor.highlightedRefs())},onEditorBarFocus:function(){this.editor.activate({range:this._workbook.activeSheet()._viewActiveCell(),rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()})},onEditorCellFocus:function(){this.editor.scale()},onEditorEsc:function(){this.editor.value(this._workbook._inputForRef(this._workbook.activeSheet()._viewActiveCell())),this.editor.deactivate(),this.clipboardElement.focus()},onEditorBlur:function(e,t){this.editor.isFiltered()||(this.editor.deactivate(),this.editor.isActive()||(this.clipboardElement.focus(),this.navigator.navigateInSelection(o[t])))},onEditorAction:function(e,t){var n=this.editor,i=this._workbook.activeSheet();n.canInsertRef(!0)&&(this.navigator.moveActiveCell(r[t]),n.activeEditor().refAtPoint(i.selection()._ref),i._setFormulaSelections(n.highlightedRefs()),e.preventDefault())},onEditorShiftAction:function(e,t){var n=this.editor,i=this._workbook.activeSheet();n.canInsertRef(!0)&&(this.navigator.modifySelection(r[t.replace("shift+","")],this.appendSelection),n.activeEditor().refAtPoint(i.selection()._ref),i._setFormulaSelections(n.highlightedRefs()),e.preventDefault())},onCommandRequest:function(e){e.command?this._execute(e):this._workbook.undoRedoStack[e.action]()},onDialogRequest:function(e){var t={pdfExport:this._workbook.options.pdf,excelExport:this._workbook.options.excel};e.options?n.extend(!0,e.options,t):e.options=t,this.view.openDialog(e.name,e.options)}}),e.spreadsheet.Controller=b}}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/view.min",["kendo.core.min","kendo.menu.min","spreadsheet/sheetsbar.min"],e)}(function(){!function(e){function t(e){var t,n=window.getSelection();n.removeAllRanges(),t=document.createRange(),t.selectNodeContents(e),n.addRange(t)}function n(e,t){var n=e.trs[t].children;return n[n.length-2]}function i(e,t){var n=e.trs[t-1],i=e.trs[t].children.length-1;return n&&i>=0?n.children[i]:void 0}function r(e){return["solid",(e.size||1)+"px",e.color||"#000"].join(" ")}function o(t,n,i,o,s,a){var l,u,c,h,d,f,p,m,g,v,b,w,_,x,k;if(i||e.spreadsheet.draw.shouldDrawCell(n)){if(l=n.left,u=n.top,c=n.width+1,h=n.height+1,d={},f=n.background,p=null,f&&(p=f,a&&(p=e.parseColor(p).toHSV(),p.v*=.9,p=p.toCssRgba()),p=r({color:p})),f&&(d.backgroundColor=f),n.color&&(d.color=n.color),n.fontFamily&&(d.fontFamily=n.fontFamily),n.underline&&(d.textDecoration="underline"),n.italic&&(d.fontStyle="italic"),n.textAlign&&(d.textAlign=n.textAlign),n.bold&&(d.fontWeight="bold"),n.fontSize&&(d.fontSize=n.fontSize+"px"),n.wrap===!0&&(d.whiteSpace="pre-wrap",d.wordBreak="break-all"),n.borderLeft?(d.borderLeft=r(n.borderLeft),s&&(s[n.left]=!0)):p&&s&&!s[n.left]?d.borderLeft=p:(l++,c--),n.borderTop?(d.borderTop=r(n.borderTop),o&&(o[n.top]=!0)):p&&o&&!o[n.top]?d.borderTop=p:(u++,h--),n.borderRight?(d.borderRight=r(n.borderRight),s&&(s[n.right]=!0)):p&&s&&!s[n.right]?d.borderRight=p:c--,n.borderBottom?(d.borderBottom=r(n.borderBottom),o&&(o[n.bottom]=!0)):p&&o&&!o[n.bottom]?d.borderBottom=p:h--,d.left=l+"px",d.top=u+"px",d.width=c+"px",d.height=h+"px",m=n.value,g=typeof m,n.format&&null!==m?(m=e.spreadsheet.formatting.format(m,n.format),m.__dataType&&(g=m.__dataType)):null!==m&&void 0!==m&&(m=e.dom.text(m)),!d.textAlign)switch(g){case"number":case"date":case"percent":d.textAlign="right";break;case"boolean":d.textAlign="center"}return v=[y.cell],i&&v.push(i),n.enable===!1&&v.push("k-state-disabled"),n.merged&&v.push("k-spreadsheet-merged-cell"),b=n.verticalAlign||"bottom",b&&m&&(m=e.dom.element("div",{className:"k-vertical-align-"+b},[m])),w=m?[m]:[],_={style:d},x=n.validation,x&&!x.value&&(w.push(e.dom.element("span",{className:"k-dirty"})),v.push("k-dirty-cell"),_.title=x._getOptions().messageTemplate),_.className=v.join(" "),k=e.dom.element("div",_,w),t.push(k),k}}function s(t,o,s){var a,l,u,c,h,d,f={};if(s.background&&(f.backgroundColor=s.background),s.color&&(f.color=s.color),s.fontFamily&&(f.fontFamily=s.fontFamily),s.underline&&(f.textDecoration="underline"),s.italic&&(f.fontStyle="italic"),s.textAlign&&(f.textAlign=s.textAlign),s.verticalAlign&&(f.verticalAlign="center"===s.verticalAlign?"middle":s.verticalAlign),s.bold&&(f.fontWeight="bold"),s.fontSize&&(f.fontSize=s.fontSize+"px"),s.wrap===!0&&(f.whiteSpace="pre-wrap",f.wordBreak="break-all"),s.borderRight?f.borderRight=r(s.borderRight):s.background&&(f.borderRightColor=s.background),s.borderBottom?f.borderBottom=r(s.borderBottom):s.background&&(f.borderBottomColor=s.background),a=s.value,l=typeof a,s.format&&null!==a&&(a=e.spreadsheet.formatting.format(a,s.format),a.__dataType&&(l=a.__dataType)),!f.textAlign)switch(l){case"number":case"date":case"percent":f.textAlign="right";break;case"boolean":f.textAlign="center"}return u=null,s.enable===!1&&(u="k-state-disabled"),c=t.addCell(o,a,f,u,s.validation),s.borderLeft?(d=n(t,o),h=r(s.borderLeft),d&&h&&(d.attr.style.borderRight=h)):s.background&&(f.borderLeftColor=s.background),s.borderTop?(d=i(t,o),h=r(s.borderTop),d&&h&&(d.attr.style.borderBottom=h)):s.background&&(f.borderTopColor=s.background),c}function a(e,t,n){return e>=t&&n>=e}var l,u,c,h,d,f,p,m,g,v,b,w,y,_;e.support.browser.msie&&9>e.support.browser.version||(l=e.jQuery,u=e.spreadsheet.CellRef,c=".",h=7,d={view:"k-spreadsheet-view",fixedContainer:"k-spreadsheet-fixed-container",scroller:"k-spreadsheet-scroller",viewSize:"k-spreadsheet-view-size",clipboard:"k-spreadsheet-clipboard",cellEditor:"k-spreadsheet-cell-editor",barEditor:"k-spreadsheet-editor",topCorner:"k-spreadsheet-top-corner",filterHeadersWrapper:"k-filter-wrapper",filterRange:"k-filter-range",
  filterButton:"k-spreadsheet-filter",filterButtonActive:"k-state-active",icon:"k-icon k-font-icon",iconFilterDefault:"k-i-arrow-s",sheetsBar:"k-spreadsheet-sheets-bar",sheetsBarActive:"k-spreadsheet-sheets-bar-active",sheetsBarInactive:"k-spreadsheet-sheets-bar-inactive",cellContextMenu:"k-spreadsheet-cell-context-menu",rowHeaderContextMenu:"k-spreadsheet-row-header-context-menu",colHeaderContextMenu:"k-spreadsheet-col-header-context-menu"},f=e.spreadsheet.messages.view={errors:{openUnsupported:"Unsupported format. Please select an .xlsx file.",shiftingNonblankCells:"Cannot insert cells due to data loss possibility. Select another insert location or delete the data from the end of your worksheet.",filterRangeContainingMerges:"Cannot create a filter within a range containing merges",sortRangeContainingMerges:"Cannot sort a range containing merges",validationError:"The value that you entered violates the validation rules set on the cell."},tabs:{home:"Home",insert:"Insert",data:"Data"}},p=e.Class.extend({init:function(){this.cols=[],this.trs=[],this._height=0,this._width=0},addColumn:function(t){this._width+=t;var n=e.dom.element("col",{style:{width:t+"px"}});n.visible=t>0,this.cols.push(n)},addRow:function(t){var n,i=null;i={style:{height:t+"px"}},this._height+=t,n=e.dom.element("tr",i),n.visible=t>0,this.trs.push(n)},addCell:function(t,n,i,r,o){var s,a,l;return(null===n||void 0===n)&&(n=""),n instanceof e.dom.Node||(n=e.dom.text(n)),s=[n],a={style:i},o&&!o.value&&(s.push(e.dom.element("span",{className:"k-dirty"})),r=(r||"")+(r?" ":"")+"k-dirty-cell",a.title=o._getOptions().messageTemplate),r&&(a.className=r),l=e.dom.element("td",a,s),this.trs[t].children.push(l),l},toDomTree:function(t,n,i){this.trs=this.trs.filter(function(e){return e.visible});var r=0;return this.cols=this.cols.filter(function(e,t){return e.visible||(this.trs.forEach(function(e){e.children.splice(t-r,1)}),r++),e.visible},this),e.dom.element("table",{style:{left:t+"px",top:n+"px",height:this._height+"px",width:this._width+"px"},className:i},[e.dom.element("colgroup",null,this.cols),e.dom.element("tbody",null,this.trs)])}}),m='<ul class="#=classNames.cellContextMenu#"><li data-action=cut>Cut</li><li data-action=copy>Copy</li><li data-action=paste>Paste</li><li class="k-separator"></li><li data-action=merge>Merge</li><li data-action=unmerge>Unmerge</li></ul>',g='<ul class="#=classNames.rowHeaderContextMenu#"><li data-action=cut>Cut</li><li data-action=copy>Copy</li><li data-action=paste>Paste</li><li class="k-separator"></li><li data-action="delete-row">Delete</li><li data-action="hide-row">Hide</li><li data-action="unhide-row">Unhide</li></ul>',v='<ul class="#=classNames.colHeaderContextMenu#"><li data-action=cut>Cut</li><li data-action=copy>Copy</li><li data-action=paste>Paste</li><li class="k-separator"></li><li data-action="delete-column">Delete</li><li data-action="hide-column">Hide</li><li data-action="unhide-column">Unhide</li></ul>',e.spreadsheet.ContextMenu=e.ui.ContextMenu,b=e.template('<div class="#=classNames.view#"><div class="#=classNames.fixedContainer#"></div><div class="#=classNames.scroller#"><div class="#=classNames.viewSize#"></div></div><div tabindex="0" class="#=classNames.clipboard#" contenteditable=true></div><div class="#=classNames.cellEditor#"></div></div><div class="#=classNames.sheetsBar#"></div>'+m+g+v),w=e.Class.extend({init:function(t,n){var i,r,o=w.classNames;this.element=t,this.options=l.extend(!0,{},this.options,n),this._chrome(),this._dialogs=[],t.append(b({classNames:o})),this._formulaInput(),this.wrapper=t.find(c+o.view),this.container=t.find(c+o.fixedContainer)[0],this.scroller=t.find(c+o.scroller)[0],this.clipboard=t.find(c+o.clipboard),this.viewSize=l(this.scroller.firstChild),this.tree=new e.dom.Tree(this.container),this.clipboardContents=new e.dom.Tree(this.clipboard[0]),this.editor=new e.spreadsheet.SheetEditor(this),this._sheetsbar(),i={target:t,animation:!1,showOn:"never"},this.cellContextMenu=new e.spreadsheet.ContextMenu(t.find(c+o.cellContextMenu),i),this.colHeaderContextMenu=new e.spreadsheet.ContextMenu(t.find(c+o.colHeaderContextMenu),i),this.rowHeaderContextMenu=new e.spreadsheet.ContextMenu(t.find(c+o.rowHeaderContextMenu),i),r=e.support.scrollbar(),l(this.container).css({width:this.wrapper[0].clientWidth-r,height:this.wrapper[0].clientHeight-r})},_resize:function(){var e=this.tabstrip?this.tabstrip.element.outerHeight():0,t=this.formulaBar?this.formulaBar.element.outerHeight():0,n=this.sheetsbar?this.sheetsbar.element.outerHeight():0;this.wrapper.height(this.element.height()-(e+t+n)),this.tabstrip&&this.tabstrip.quickAccessAdjust()},_chrome:function(){var t=l("<div />").prependTo(this.element);this.formulaBar=new e.spreadsheet.FormulaBar(t),this.options.toolbar&&this._tabstrip()},_formulaInput:function(){var t=this.element.find(c+w.classNames.cellEditor);this.formulaInput=new e.spreadsheet.FormulaInput(t,{autoScale:!0})},_sheetsbar:function(){this.options.sheetsbar&&(this.sheetsbar=new e.spreadsheet.SheetsBar(this.element.find(c+w.classNames.sheetsBar),l.extend(!0,{},this.options.sheetsbar)))},_tabstrip:function(){var t,n=f.tabs,i=l.extend(!0,{home:!0,insert:!0,data:!0},this.options.toolbar),r=[];this.tabstrip&&(this.tabstrip.destroy(),this.element.children(".k-tabstrip").remove());for(t in i)(i[t]===!0||i[t]instanceof Array)&&r.push({id:t,text:n[t],content:""});this.tabstrip=new e.spreadsheet.TabStrip(l("<div />").prependTo(this.element),{animation:!1,dataTextField:"text",dataContentField:"content",dataSource:r,toolbarOptions:i,view:this}),this.tabstrip.select(0)},_executeCommand:function(e){this._workbook.execute(e)},workbook:function(e){this._workbook=e},sheet:function(e){this._sheet=e},activeCellRectangle:function(){return this.cellRectangle(this._sheet._viewActiveCell())},_rectangle:function(e,t){return e._grid.boundingRectangle(t.toRangeRef())},isColumnResizer:function(e,t,n){var i,r,o=this._rectangle(t,n);return e-=this._sheet._grid._headerWidth,i=h/2,r=o.right-this.scroller.scrollLeft,e>=r-i&&r+i>=e},isRowResizer:function(e,t,n){var i,r,o=this._rectangle(t,n);return e-=this._sheet._grid._headerHeight,i=h/2,r=o.bottom-this.scroller.scrollTop,e>=r-i&&r+i>=e},isFilterIcon:function(e,t,n,i){var r=!1;return e-=this._sheet._grid._headerWidth-this.scroller.scrollLeft,t-=this._sheet._grid._headerHeight-this.scroller.scrollTop,this._sheet.forEachFilterHeader(i,function(i){var o=this._rectangle(n,i);r=r||n.filterIconRect(o).intersects(e,t)}.bind(this)),r},isAutoFill:function(e,t,n){var i,r=this._sheet.select();return r.size>1?!1:(e-=this._sheet._grid._headerWidth,t-=this._sheet._grid._headerHeight,n._grid.columns.frozen||(e+=this.scroller.scrollLeft),n._grid.rows.frozen||(t+=this.scroller.scrollTop),i=this._rectangle(n,r),Math.abs(i.right-e)<8&&Math.abs(i.bottom-t)<8)},objectAt:function(e,t){var n,i,r,o,s,a,l=this._sheet._grid;return 0>e||0>t||e>this.scroller.clientWidth||t>this.scroller.clientHeight?n={type:"outside"}:l._headerWidth>e&&l._headerHeight>t?n={type:"topcorner"}:(i=this.paneAt(e,t),r=i._grid.rows.index(t,this.scroller.scrollTop),o=i._grid.columns.index(e,this.scroller.scrollLeft),s="cell",a=new u(r,o),this.isAutoFill(e,t,i)?s="autofill":this.isFilterIcon(e,t,i,a)?s="filtericon":l._headerWidth>e?(a=new u(r,-(1/0)),s=this.isRowResizer(t,i,a)?"rowresizehandle":"rowheader"):l._headerHeight>t&&(a=new u(-(1/0),o),s=this.isColumnResizer(e,i,a)?"columnresizehandle":"columnheader"),n={type:s,ref:a}),n.pane=i,n.x=e,n.y=t,n},paneAt:function(e,t){return this.panes.filter(function(n){var i=n._grid;return a(t,i.top,i.bottom)&&a(e,i.left,i.right)})[0]},containingPane:function(e){return this.panes.filter(function(t){return t._grid.contains(e)?!0:!1})[0]},cellRectangle:function(e){var t=this.containingPane(e)._grid,n=this._sheet._grid.rectangle(e);return n.offset(t.headerWidth-this.scroller.scrollLeft,t.headerHeight-this.scroller.scrollTop)},refresh:function(e){var t,n,i=this._sheet;this.tabstrip&&this.tabstrip.refreshTools(i.range(i.activeCell())),e.sheetSelection&&this.sheetsbar&&this.sheetsbar.renderSheets(this._workbook.sheets(),this._workbook.sheetIndex(this._sheet)),this._resize(),this.viewSize[0].style.height=i._grid.totalHeight()+"px",this.viewSize[0].style.width=i._grid.totalWidth()+"px",e.layout&&(t=i.frozenColumns(),n=i.frozenRows(),this.panes=[this._pane(n,t)],t>0&&this.panes.push(this._pane(n,0,null,t)),n>0&&this.panes.push(this._pane(0,t,n,null)),n>0&&t>0&&this.panes.push(this._pane(0,0,n,t))),e.filter&&this._destroyFilterMenu(),e.activeCell&&(this._focus=i.activeCell().toRangeRef())},createFilterMenu:function(t){var n,i,r,o,s,a;return this._filterMenu&&this._filterMenu.options.column==t?this._filterMenu:(this._destroyFilterMenu(),n=this._sheet,i=n.filter().ref,r=new e.spreadsheet.Range(i,n),o=l("<div />").appendTo(this.element),s={column:t,range:r},a=new e.spreadsheet.FilterMenu(o,s),this._filterMenu=a,a)},selectClipBoardContents:function(){this.clipboard.focus(),t(this.clipboard[0])},scrollIntoView:function(e){var t=!1,n=this.containingPane(e)._grid,i=n.scrollBoundaries(e),r=this.scroller,o=n.rows.frozen?0:r.scrollTop,s=n.columns.frozen?0:r.scrollLeft;return o>i.top&&(t=!0,r.scrollTop=i.scrollTop),i.bottom>o&&(t=!0,r.scrollTop=i.scrollBottom),s>i.left&&(t=!0,r.scrollLeft=i.scrollLeft),i.right>s&&(t=!0,r.scrollLeft=i.scrollRight),t},_destroyDialog:function(){this._dialogs.pop()},openDialog:function(t,n){var i=this._sheet,r=i.activeCell(),o=new e.spreadsheet.Range(r,i),s=e.spreadsheet.dialogs.create(t,n);return s?(s.bind("action",this._executeCommand.bind(this)),s.bind("deactivate",this._destroyDialog.bind(this)),this._dialogs.push(s),s.open(o),s):void 0},showError:function(e){var t=f.errors;this.openDialog("message",{title:e.title||"Error",text:e.body?e.body:t[e.type],activate:function(){this.dialog().element.find(".k-button").focus()},close:function(){this.editor.focusLastActive()}.bind(this)})},destroy:function(){this._dialogs.forEach(function(e){e.destroy()}),this.cellContextMenu.destroy(),this.rowHeaderContextMenu.destroy(),this.colHeaderContextMenu.destroy(),this.tabstrip&&this.tabstrip.destroy(),this._destroyFilterMenu()},_destroyFilterMenu:function(){this._filterMenu&&(this._filterMenu.destroy(),this._filterMenu=void 0,this._filterMenuColumn=void 0)},render:function(){var t,n,i,r,o,s,a,l;this.element.is(":visible")&&(t=this._sheet,n=t.focus(),n&&this.scrollIntoView(n)||(i=t._grid,r=this.scroller.scrollTop,o=this.scroller.scrollLeft,0>r&&(r=0),0>o&&(o=0),s=this.panes.map(function(e){return e.render(o,r)},this),a=[],a=Array.prototype.concat.apply(a,s),l=e.dom.element("div",{style:{width:i._headerWidth+"px",height:i._headerHeight+"px"},className:w.classNames.topCorner}),a.push(l),t.resizeHandlePosition()&&t.resizeHintPosition()&&a.push(this.renderResizeHint()),this.tree.render(a),this.editor.isActive()?this.editor.toggleTooltip(this.activeCellRectangle()):t.selectionInProgress()||t.resizingInProgress()||t.isInEditMode()||this.renderClipboardContents()))},renderResizeHint:function(){var t,n,i=this._sheet,r=i.resizeHandlePosition(),o=r.col!==-(1/0);return t=o?{height:this.scroller.clientHeight+"px",width:h+"px",left:i.resizeHintPosition().x+"px",top:"0px"}:{height:h+"px",width:this.scroller.clientWidth+"px",top:i.resizeHintPosition().y+"px",left:"0px"},n=_.classNames,e.dom.element("div",{className:n.resizeHint+(o?"":" "+n.resizeHintVertical),style:t},[e.dom.element("div",{className:n.resizeHintHandle}),e.dom.element("div",{className:n.resizeHintMarker})])},renderClipboardContents:function(){var e,t,n,i,r=this._sheet,o=r._grid,a=r.select().toRangeRef(),l=this._workbook.clipboard().canCopy();return l.canCopy===!1&&l.multiSelection?(this.clipboardContents.render([]),void this.selectClipBoardContents()):(a=r.trim(a),e=new p,t=o.rangeDimensions(a),t.rows.forEach(function(t){e.addRow(t)}),t.columns.forEach(function(t){e.addColumn(t)}),n={},i={},r.forEachMergedCell(a,function(e){var t=e.topLeft;o.forEach(e,function(r){t.eq(r)?n[r.print()]=e:i[r.print()]=!0})}),r.forEach(a,function(t,r,o){var l,c,h=new u(t,r).print();i[h]||(l=s(e,t-a.topLeft.row,o),c=n[h],c&&(l.attr.colspan=c.width(),l.attr.rowspan=c.height()))}),this.clipboardContents.render([e.toDomTree(0,0,"kendo-clipboard-"+this._workbook.clipboard()._uid)]),void this.selectClipBoardContents())},_pane:function(e,t,n,i){var r=new _(this._sheet,this._sheet._grid.pane({row:e,column:t,rowCount:n,columnCount:i}));return r.refresh(this.scroller.clientWidth,this.scroller.clientHeight),r}}),y={cell:"k-spreadsheet-cell",vaxis:"k-spreadsheet-vaxis",haxis:"k-spreadsheet-haxis",rowHeader:"k-spreadsheet-row-header",columnHeader:"k-spreadsheet-column-header",pane:"k-spreadsheet-pane",data:"k-spreadsheet-data",mergedCell:"k-spreadsheet-merged-cell",mergedCellsWrapper:"k-merged-cells-wrapper",activeCell:"k-spreadsheet-active-cell",selection:"k-spreadsheet-selection",selectionWrapper:"k-selection-wrapper",autoFillWrapper:"k-auto-fill-wrapper",single:"k-single",top:"k-top",right:"k-right",bottom:"k-bottom",left:"k-left",resizeHandle:"k-resize-handle",resizeHint:"k-resize-hint",resizeHintHandle:"k-resize-hint-handle",resizeHintMarker:"k-resize-hint-marker",resizeHintVertical:"k-resize-hint-vertical",selectionHighlight:"k-spreadsheet-selection-highlight",series:["k-series-a","k-series-b","k-series-c","k-series-d","k-series-e","k-series-f"]},_=e.Class.extend({init:function(e,t){this._sheet=e,this._grid=t},refresh:function(e,t){this._grid.refresh(e,t)},isVisible:function(e,t,n){return this._grid.view(e,t).ref.intersects(n)},render:function(t,n){var i,r,o,s,a,l,u=_.classNames,c=this._sheet,h=this._grid,d=h.view(t,n);return this._currentView=d,this._currentRect=this._rectangle(d.ref),this._selectedHeaders=c.selectedHeaders(),i=[],i.push(this.renderData()),i.push(this.renderSelection()),i.push(this.renderAutoFill()),i.push(this.renderEditorSelection()),i.push(this.renderFilterHeaders()),h.hasRowHeader&&(r=e.dom.element("div",{className:u.rowHeader,style:{width:h.headerWidth+"px",top:d.rowOffset+"px"}}),i.push(r),c.forEach(d.ref.leftColumn(),function(t){if(!c.isHiddenRow(t)){var n=t+1,i=c.rowHeight(t);r.children.push(e.dom.element("div",{className:this.headerClassName(t,"row"),style:{width:h.headerWidth+"px",height:i+"px"}},[e.dom.element("div",{className:"k-vertical-align-center"},[e.dom.text(n+"")])]))}}.bind(this))),h.hasColumnHeader&&(o=e.dom.element("div",{className:u.columnHeader,style:{top:"0px",left:d.columnOffset+"px",width:this._currentRect.width+"px",height:h.headerHeight+"px"}}),i.push(o),s=0,c.forEach(d.ref.topRow(),function(t,n){if(!c.isHiddenColumn(n)){var i=e.spreadsheet.Ref.display(null,1/0,n),r=c.columnWidth(n);o.children.push(e.dom.element("div",{className:this.headerClassName(n,"col"),style:{position:"absolute",left:s+"px",width:r+"px",height:h.headerHeight+"px"}},[e.dom.element("div",{className:"k-vertical-align-center"},[e.dom.text(i+"")])])),s+=r}}.bind(this))),c.resizeHandlePosition()&&(h.hasColumnHeader||h.hasRowHeader)&&(a=c._grid.normalize(c.resizeHandlePosition()),d.ref.intersects(a)&&(c.resizeHintPosition()||i.push(this.renderResizeHandler()))),l=[u.pane],h.hasColumnHeader&&l.push(u.top),h.hasRowHeader&&l.push(u.left),e.dom.element("div",{style:h.style,className:l.join(" ")},i)},headerClassName:function(e,t){var n,i,r,o=this._selectedHeaders;return"row"===t?(n=o.rows[e],i=o.allRows):(n=o.cols[e],i=o.allCols),r=n||(o.all?"full":i?"partial":"none"),r&&(r="k-selection-"+r),r},renderData:function(){var t,n,i,r=this._currentView,s=e.dom.element("div",{className:_.classNames.data,style:{position:"relative",left:r.columnOffset+"px",top:r.rowOffset+"px"}}),a=this._currentRect,l=e.spreadsheet.draw.doLayout(this._sheet,r.ref,{forScreen:!0}),u=this._sheet.options.showGridLines;return u&&(t=null,l.xCoords.forEach(function(n){n!==t&&(t=n,s.children.push(e.dom.element("div",{className:y.vaxis,style:{left:n+"px",height:a.height+"px"}})))}),t=null,l.yCoords.forEach(function(n){n!==t&&(t=n,s.children.push(e.dom.element("div",{className:y.haxis,style:{top:n+"px",width:a.width+"px"}})))})),n={},i={},l.cells.forEach(function(e){var t=i[e.col]||(i[e.col]={}),r=n[e.row]||(n[e.row]={});o(s.children,e,null,t,r,u)}),s},renderResizeHandler:function(){var t,n=this._sheet,i=n.resizeHandlePosition(),r=this._rectangle(i);return t=i.col!==-(1/0)?{height:this._grid.headerHeight+"px",width:h+"px",left:r.right-h/2+"px",top:"0px"}:{height:h+"px",width:this._grid.headerWidth+"px",top:r.bottom-h/2+"px",left:"0px"},e.dom.element("div",{className:_.classNames.resizeHandle,style:t})},filterIconRect:function(t){var n=16,i=3;return new e.spreadsheet.Rectangle(t.right-n-i,t.top+i,n,n)},renderFilterHeaders:function(){function t(t){return e.dom.element("span",{className:o.icon+" "+t})}function n(n,i,r){var o,a={left:i.left+"px",top:i.top+"px"},l=s&&s.columns.some(function(e){return e.index===r}),u=n.filterButton;return l&&(u+=" "+n.filterButtonActive),o=e.dom.element("span",{className:u,style:a},[t(n.iconFilterDefault)])}var i=this._sheet,r=[],o=w.classNames,s=i.filter();return s&&this._addDiv(r,s.ref,o.filterRange),i.forEachFilterHeader(this._currentView.ref,function(e){var t=this._rectangle(e),i=this.filterIconRect(t),s=this._sheet.filterColumn(e),a=n(o,i,s);r.push(a)}.bind(this)),e.dom.element("div",{className:o.filterHeadersWrapper},r)},renderEditorSelection:function(){var t=_.classNames,n=this._sheet,i=[];return n._formulaSelections.forEach(function(n){var r=n.ref;r!==e.spreadsheet.NULLREF&&this._addDiv(i,r,t.selectionHighlight+" "+n.colorClass)}.bind(this)),e.dom.element("div",{className:t.selectionWrapper},i)},renderSelection:function(){var t=_.classNames,n=[],i=[t.activeCell],r=[t.selection],o=this._sheet,s=o.activeCell().toRangeRef(),a=this._activeFormulaColor(),l=o.select();return i=i.concat(a,this._directionClasses(s)),r=r.concat(a),o.singleCellSelection()&&i.push(t.single),1===l.size()&&r.push("k-single-selection"),this._sheet.autoFillPunch()&&r.push("k-dim-auto-fill-handle"),l.forEach(function(t){t!==e.spreadsheet.NULLREF&&this._addDiv(n,t,r.join(" "))}.bind(this)),this._addTable(n,s,i.join(" ")),e.dom.element("div",{className:t.selectionWrapper},n)},renderAutoFill:function(){var t,n,i,r,o,s,a,l=[];if(this._sheet.autoFillInProgress())if(t=this._sheet.autoFillRef(),n=this._sheet.autoFillPunch(),i=this._sheet._autoFillDirection,this._addDiv(l,t,"k-auto-fill"),n)this._addDiv(l,n,"k-auto-fill-punch");else if(void 0!==i){switch(i){case 0:r=t.bottomRight,o="k-auto-fill-br-hint";break;case 1:r=t.bottomRight,o="k-auto-fill-br-hint";break;case 2:r=new u(t.topLeft.row,t.bottomRight.col),o="k-auto-fill-tr-hint";break;case 3:r=new u(t.bottomRight.row,t.topLeft.col),o="k-auto-fill-bl-hint"}s=e.dom.element("span",{className:"k-tooltip"},[e.dom.text(this._sheet._autoFillHint)]),a=this._addDiv(l,r,o),a&&a.children.push(s)}return e.dom.element("div",{className:_.classNames.autoFillWrapper},l)},_addDiv:function(e,t,n){var i,r=this._currentView;return r.ref.intersects(t)&&(i=this._rectangle(t).resize(1,1).toDiv(n),e.push(i)),i},_addTable:function(e,t,n){var i=this._sheet,r=this._currentView;r.ref.intersects(t)&&i.forEach(t.collapse(),function(i,r,s){var a=this._rectangle(t);s.left=a.left,s.top=a.top,s.width=a.width,s.height=a.height,o(e,s,n,null,null,!0)}.bind(this))},_activeFormulaColor:function(){var e,t=[];return this._sheet.isInEditMode()&&(e=this._sheet._formulaSelections.filter(function(e){return e.active&&"ref"==e.type})[0],e&&t.push(e.colorClass)),t},_directionClasses:function(e){var t=[],n=_.classNames,i=this._currentView.ref;return e.move(0,-1).intersects(i)||t.push(n.left),e.move(-1,0).intersects(i)||t.push(n.top),e.move(0,1).intersects(i)||t.push(n.right),e.move(1,0).intersects(i)||t.push(n.bottom),t},_rectangle:function(e){return this._grid.boundingRectangle(e.toRangeRef()).offset(-this._currentView.mergedCellLeft,-this._currentView.mergedCellTop)}}),e.spreadsheet.View=w,e.spreadsheet.Pane=_,e.spreadsheet.drawCell=o,l.extend(!0,w,{classNames:d}),l.extend(!0,_,{classNames:y}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/grid.min",["kendo.core.min","spreadsheet/references.min"],e)}(function(){!function(e){var t,n,i,r,o,s;e.support.browser.msie&&9>e.support.browser.version||(t=e.spreadsheet.CellRef,n=e.spreadsheet.RangeRef,i=e.spreadsheet.UnionRef,r=e.Class.extend({init:function(e,t,n,i){this.left=e,this.width=n,this.right=e+n,this.top=t,this.height=i,this.bottom=t+i},offset:function(e,t){return new r(this.left+e,this.top+t,this.width,this.height)},resize:function(e,t){return new r(this.left,this.top,this.width+e,this.height+t)},intersects:function(e,t){return e>this.left&&this.left+this.width>e&&t>this.top&&this.top+this.height>t},toDiv:function(t){return e.dom.element("div",{className:t,style:{width:this.width+"px",height:this.height+"px",top:this.top+"px",left:this.left+"px"}})}}),o=e.Class.extend({init:function(e,t,n,i,r,o){this.rowCount=n,this.columnCount=i,this._columns=t,this._rows=e,this._headerHeight=r,this._headerWidth=o},isAxis:function(e){var t,n;return e=e.toRangeRef(),t=e.topLeft,n=e.bottomRight,0===t.row&&n.row===this.rowCount-1||0===t.col&&n.col===this.columnCount-1},width:function(e,t){return this._columns.sum(e,t)},height:function(e,t){return this._rows.sum(e,t)},totalHeight:function(){return this._rows.total+this._headerHeight},totalWidth:function(){return this._columns.total+this._headerWidth},index:function(e,t){return t*this.rowCount+e},cellRef:function(e){return new t(e%this.rowCount,e/this.rowCount>>0)},rowRef:function(e){return new n(new t(e,0),new t(e,this.columnCount-1))},colRef:function(e){return new n(new t(0,e),new t(this.rowCount-1,e))},cellRefIndex:function(e){return this.index(e.row,e.col)},normalize:function(e){if(e instanceof n)return new n(this.normalize(e.topLeft),this.normalize(e.bottomRight)).setSheet(e.sheet,e.hasSheet());if(e instanceof i)return e.map(function(e){return this.normalize(e)},this);var t=e.clone();return t.col=Math.max(0,Math.min(this.columnCount-1,e.col)),t.row=Math.max(0,Math.min(this.rowCount-1,e.row)),t},rectangle:function(e){var t=this.normalize(e.topLeft),n=this.normalize(e.bottomRight);return new r(this.width(0,t.col-1),this.height(0,t.row-1),this.width(t.col,n.col),this.height(t.row,n.row))},pane:function(t){return new s(new e.spreadsheet.PaneAxis(this._rows,t.row,t.rowCount,this._headerHeight),new e.spreadsheet.PaneAxis(this._columns,t.column,t.columnCount,this._headerWidth),this)},rangeDimensions:function(e){return{rows:this._rows.values.iterator(e.topLeft.row,e.bottomRight.row),columns:this._columns.values.iterator(e.topLeft.col,e.bottomRight.col)}},forEach:function(e,n){var i,r,o=this.normalize(e.topLeft),s=this.normalize(e.bottomRight);for(i=o.col;s.col>=i;i++)for(r=o.row;s.row>=r;r++)n(new t(r,i))},trim:function(e,i){var r,o,s,a,l,u=e.topLeft,c=e.bottomRight,h=u.row,d=u.col;for(r=u.col;c.col>=r;r++)o=this.index(u.row,r),s=this.index(c.row,r),a=i.tree.intersecting(o,s),a.length&&(l=this.cellRef(a[a.length-1].end),h=Math.max(h,l.row),d=r);return new n(e.topLeft,new t(Math.min(h,e.bottomRight.row),d))}}),s=e.Class.extend({init:function(e,t,n){this.rows=e,this.columns=t,this._grid=n,this.headerHeight=e.headerSize,this.headerWidth=t.headerSize,this.hasRowHeader=t.hasHeader,this.hasColumnHeader=e.hasHeader},refresh:function(e,t){var n,i;this.columns.viewSize(e),this.rows.viewSize(t),n=this.columns.paneSegment(),i=this.rows.paneSegment(),this.left=n.offset,this.top=i.offset,this.right=n.offset+n.length,this.bottom=i.offset+i.length,this.style={top:i.offset+"px",left:n.offset+"px",height:i.length+"px",width:n.length+"px"}},view:function(e,i){var r=this.rows.visible(i),o=this.columns.visible(e);return{rows:r,columns:o,rowOffset:r.offset,columnOffset:o.offset,mergedCellLeft:o.start,mergedCellTop:r.start,ref:new n(new t(r.values.start,o.values.start),new t(r.values.end,o.values.end))}},contains:function(e){return this.rows.contains(e.topLeft.row,e.bottomRight.row)&&this.columns.contains(e.topLeft.col,e.bottomRight.col)},index:function(e,t){return this._grid.index(e,t)},boundingRectangle:function(e){return this._grid.rectangle(e)},cellRefIndex:function(e){return this._grid.cellRefIndex(e)},scrollBoundaries:function(e){var t=this.boundingRectangle(e),n={top:Math.max(0,t.top-this.top+(this.hasColumnHeader?0:this.headerHeight)),left:Math.max(0,t.left-this.left+(this.hasRowHeader?0:this.headerWidth)),right:t.right-this.columns._viewSize+this.headerWidth,bottom:t.bottom-this.rows._viewSize+this.headerHeight},i=this.columns.defaultValue/2,r=this.rows.defaultValue/2;return n.scrollTop=n.top-r,n.scrollBottom=n.bottom+r,n.scrollLeft=n.left-i,n.scrollRight=n.right+i,n}}),e.spreadsheet.Grid=o,e.spreadsheet.PaneGrid=s,e.spreadsheet.Rectangle=r)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/axis.min",["kendo.core.min"],e)}(function(){!function(e){var t,n;e.support.browser.msie&&9>e.support.browser.version||(t=e.Class.extend({init:function(t,n){this._value=n,this._count=t,this.values=new e.spreadsheet.RangeList(0,t-1,n),this._hidden=new e.spreadsheet.RangeList(0,t-1,0),this.scrollBarSize=e.support.scrollbar(),this._refresh()},toJSON:function(e,t){var n,i,r,o,s=[],a=this.values.iterator(0,this._count-1);for(n=0;this._count>n;n++)i=a.at(n),i!==this._value&&(r=t[n],void 0===r&&(r=s.length,o={index:n},o[e]=i,s.push(o),t[n]=r));return s},fromJSON:function(e,t){var n,i,r;for(n=0;t.length>n;n++)i=t[n][e],r=t[n].index,void 0===r&&(r=n),this.value(r,r,i)},hide:function(e){if(!this.hidden(e)){var t=this.value(e,e);this._hidden.value(e,e,t),this.value(e,e,0)}},hidden:function(e){return 0!==this._hidden.value(e,e)},includesHidden:function(e,t){return this._hidden.intersecting(e,t).length>1},nextVisible:function(e,t){var n,i=this._count-1;return e===i?t?e+1:e:(e+=1,n=this._hidden.intersecting(e,e)[0],0!==n.value?n.end===i?e-1:n.end+1:e)},nextPage:function(e,t){return this.index(this.sum(0,e-1)+t)},prevPage:function(e,t){return this.index(this.sum(0,e)-t)},firstVisible:function(){var e=this._hidden.first();return 0===e.value?0:e.end+1},lastVisible:function(){var e=this._hidden.last();return 0===e.value?this._count-1:e.start-1},prevVisible:function(e,t){if(0===e)return t?-1:0;e-=1;var n=this._hidden.intersecting(e,e)[0];return 0!==n.value?0===n.start?e+1:n.start-1:e},unhide:function(e){if(this.hidden(e)){var t=this._hidden.value(e,e);this._hidden.value(e,e,0),this.value(e,e,t)}},value:function(e,t,n){return void 0===n?this.values.iterator(e,t).at(0):(this.values.value(e,t,n),void this._refresh())},sum:function(e,t){var n,i=this.values.iterator(e,t),r=0;for(n=e;t>=n;n++)r+=i.at(n);return r},visible:function(e,t){var n,i,r,o,s,a,l=null,u=null,c=!1;return t>=this.total+this.scrollBarSize&&(c=!0),n=this._pixelValues.intersecting(e,t),l=n[0],u=n[n.length-1],i=e-l.start,r=(i/l.value.value>>0)+l.value.start,o=i-(r-l.value.start)*l.value.value,s=t-u.start,a=(s/u.value.value>>0)+u.value.start,a>u.value.end&&(a=u.value.end),c&&(o+=u.value.value-(s-(a-u.value.start)*u.value.value)),o=Math.min(-o,0),{values:this.values.iterator(r,a),offset:o}},index:function(e){for(var t=0,n=this.values.iterator(0,this._count-1),i=n.at(0);e>i&&this._count-1>t;)i+=n.at(++t);return t},_refresh:function(){var t=0;this._pixelValues=this.values.map(function(n){var i,r=t;return t+=(n.end-n.start+1)*n.value,i=t-1,new e.spreadsheet.ValueRange(r,i,n)}),this.total=t},getState:function(){return{values:this.values.getState(),hidden:this._hidden.getState()}},setState:function(e){this.values.setState(e.values),this._hidden.setState(e.hidden),this._refresh()}}),n=e.Class.extend({init:function(e,t,n,i){this._axis=e,this._start=t,this._count=n,this.hasHeader=0===t,this.headerSize=i,this.defaultValue=e._value,this.frozen=n>0},viewSize:function(e){this._viewSize=e},sum:function(e,t){return this._axis.sum(e,t-1)},start:function(){return this.sum(0,this._start)},size:function(){return this.sum(this._start,this._start+this._count)},index:function(e,t){return this._axis.index(e+(this.frozen?0:t)-this.headerSize)},paneSegment:function(){var e,t=this.start();return this.hasHeader||(t+=this.headerSize),this.frozen?(e=this.size(),this.hasHeader?e+=this.headerSize:e-=this.headerSize):e=this._viewSize-t,{offset:t,length:e}},visible:function(e){var t,n,i=this.start();return this.frozen?(t=this.size(),this.hasHeader||(t-=this.headerSize)):(t=this._viewSize-i-this.headerSize,i+=e),n=this._axis.visible(i,i+t-1),this.frozen&&(n.offset=0),n.start=i,this.hasHeader&&(n.offset+=this.headerSize,n.start-=this.headerSize),n},contains:function(e,t){return this.frozen?e>this._start+this._count?!1:this._start>t?!1:!0:t>=this._start}}),e.spreadsheet.Axis=t,e.spreadsheet.PaneAxis=n)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/filter.min",["kendo.core.min","kendo.data.min"],e)}(function(){!function(e){function t(e){var t=e.getMonth()+1;return t>=1&&3>=t?1:t>=4&&6>=t?2:t>=7&&9>=t?3:4}function n(t,n){if(t instanceof Date){var i=e.date.today();return i.setFullYear(i.getFullYear()+n),i.getFullYear()===t.getFullYear()}return!1}function i(t,n){if(t instanceof Date){var i=e.date.firstDayOfMonth(e.date.today());return i.setMonth(i.getMonth()+n,1),i.getTime()===e.date.firstDayOfMonth(t).getTime()}return!1}function r(t,n){var i,r;return n instanceof Date?(i=e.date.dayOfWeek(e.date.getDate(t),1),r=e.date.dayOfWeek(e.date.getDate(n),1),i.getTime()===r.getTime()):!1}if(!(e.support.browser.msie&&9>e.support.browser.version)){var o=e.spreadsheet.Filter=e.Class.extend({prepare:function(){},value:function(e){return e.value},matches:function(){throw Error("The 'matches' method is not implemented.")},toJSON:function(){throw Error("The 'toJSON' method is not implemented.")}});o.create=function(t){var n,i=t.filter;if(!i)throw Error("Filter type not specified.");if(n=e.spreadsheet[i.charAt(0).toUpperCase()+i.substring(1)+"Filter"],!n)throw Error("Filter type not recognized.");return new n(t)},e.spreadsheet.ValueFilter=o.extend({_values:[],_dates:[],_blanks:!1,init:function(e){void 0!==e.values&&(this._values=e.values),void 0!==e.blanks&&(this._blanks=e.blanks),void 0!==e.dates&&(this._dates=e.dates)},value:function(t){var n,i=t.value;return this._dates.length>0&&t.format&&"number"==typeof i&&(n=e.spreadsheet.formatting.type(i,t.format),"date"===n&&(i=e.spreadsheet.numberToDate(i))),i},matches:function(e){return null===e||void 0===e?this._blanks:e instanceof Date?this._dates.some(function(t){return!(t.year!==e.getFullYear()||void 0!==t.month&&t.month!==e.getMonth()||void 0!==t.day&&t.day!==e.getDate()||void 0!==t.hours&&t.hours!==e.getHours()||void 0!==t.minutes&&t.minutes!==e.getMinutes()||void 0!==t.seconds&&t.seconds!==e.getSeconds())}):this._values.indexOf(e)>=0},toJSON:function(){return{filter:"value",values:this._values.slice(0)}}}),e.spreadsheet.CustomFilter=o.extend({_logic:"and",init:function(t){if(void 0!==t.logic&&(this._logic=t.logic),void 0===t.criteria)throw Error("Must specify criteria.");this._criteria=t.criteria;var n=e.data.Query.filterExpr({logic:this._logic,filters:this._criteria}).expression;this._matches=Function("d","return "+n)},matches:function(e){return null===e?!1:this._matches(e)},value:function(t){var n=t.value,i=this._criteria[0].value,r=i instanceof Date?"date":typeof i,o=typeof n;return t.format&&(o=e.spreadsheet.formatting.type(n,t.format)),o!=r?"string"==r&&(t.format&&(n=e.spreadsheet.formatting.text(n,t.format)),n+=""):"date"==o&&(n=e.spreadsheet.numberToDate(n)),n},toJSON:function(){return{filter:"custom",logic:this._logic,criteria:this._criteria}}}),e.spreadsheet.TopFilter=o.extend({init:function(e){this._type=e.type,this._value=e.value,this._values=[]},prepare:function(e){var t,n=e.map(this.value).sort().filter(function(e,t,n){return 0===t||e!==n[t-1]});n.sort("topNumber"===this._type||"topPercent"==this._type?function(e,t){return t-e}:function(e,t){return e-t}),t=this._value,
  ("topPercent"===this._type||"bottomPercent"===this._type)&&(t=n.length*t/100>>0),this._values=n.slice(0,t)},matches:function(e){return this._values.indexOf(e)>=0},toJSON:function(){return{filter:"top",type:this._type,value:this._value}}}),e.spreadsheet.DynamicFilter=o.extend({init:function(e){if(this._type=e.type,this._predicate=this[e.type],"function"!=typeof this._predicate)throw Error("DynamicFilter type '"+e.type+"' not recognized.")},value:function(t){var n,i=t.value;return t.format&&(n=e.spreadsheet.formatting.type(i,t.format),"date"===n&&(i=e.spreadsheet.numberToDate(i))),i},prepare:function(e){var t,n,i=0,r=0;for(t=0;e.length>t;t++)n=this.value(e[t]),"number"==typeof n&&(i+=n,r++);this._average=r>0?i/r:0},matches:function(e){return this._predicate(e)},aboveAverage:function(t){return t instanceof Date&&(t=e.spreadsheet.dateToNumber(t)),"number"!=typeof t?!1:t>this._average},belowAverage:function(t){return t instanceof Date&&(t=e.spreadsheet.dateToNumber(t)),"number"!=typeof t?!1:this._average>t},tomorrow:function(t){if(t instanceof Date){var n=e.date.addDays(e.date.today(),1);return e.date.getDate(t).getTime()===n.getTime()}return!1},today:function(t){return t instanceof Date?e.date.isToday(t):!1},yesterday:function(t){if(t instanceof Date){var n=e.date.addDays(e.date.today(),-1);return e.date.getDate(t).getTime()===n.getTime()}return!1},nextWeek:function(t){return r(e.date.addDays(e.date.today(),7),t)},thisWeek:function(t){return r(e.date.today(),t)},lastWeek:function(t){return r(e.date.addDays(e.date.today(),-7),t)},nextMonth:function(e){return i(e,1)},thisMonth:function(e){return i(e,0)},lastMonth:function(e){return i(e,-1)},nextQuarter:function(n){var i,r;return n instanceof Date?(i=e.date.today(),r=t(n)-t(i),1===r&&i.getFullYear()===n.getFullYear()||-3==r&&i.getFullYear()+1===n.getFullYear()):!1},thisQuarter:function(n){var i,r;return n instanceof Date?(i=e.date.today(),r=t(n)-t(i),0===r&&i.getFullYear()===n.getFullYear()):!1},lastQuarter:function(n){var i,r;return n instanceof Date?(i=e.date.today(),r=t(i)-t(n),1===r&&i.getFullYear()===n.getFullYear()||-3==r&&i.getFullYear()-1===n.getFullYear()):!1},nextYear:function(e){return n(e,1)},thisYear:function(e){return n(e,0)},lastYear:function(e){return n(e,-1)},yearToDate:function(t){if(t instanceof Date){var n=e.date.today();return t.getFullYear()===n.getFullYear()&&n>=t}return!1},toJSON:function(){return{filter:"dynamic",type:this._type}}}),[1,2,3,4].forEach(function(n){e.spreadsheet.DynamicFilter.prototype["quarter"+n]=function(e){return e instanceof Date?t(e)===n:!1}}),e.cultures["en-US"].calendar.months.names.forEach(function(t,n){e.spreadsheet.DynamicFilter.prototype[t.toLowerCase()]=function(e){return e instanceof Date?e.getMonth()===n:!1}})}}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/sorter.min",["kendo.core.min"],e)}(function(){!function(e){if(!(e.support.browser.msie&&9>e.support.browser.version)){var t=e.Class.extend({init:function(e,t){this._grid=e,this._lists=t},indices:function(e,n,i,r){var o=t.ascendingComparer;return i===!1&&(o=t.descendingComparer),n.sortedIndices(this._grid.cellRefIndex(e.topLeft),this._grid.cellRefIndex(e.bottomRight),o,r)},sortBy:function(e,t,n,i,r){var o,s,a,l,u=this.indices(e.toColumn(t),n,i,r);for(o=e.topLeft.col;e.bottomRight.col>=o;o++)for(s=this._grid.index(e.topLeft.row,o),a=this._grid.index(e.bottomRight.row,o),l=0;this._lists.length>l;l++)s<this._lists[l].lastRangeStart()&&this._lists[l].sort(s,a,u);return u}});t.ascendingComparer=function(t,n){var i,r;if(null===t&&null===n)return 0;if(null===t)return 1;if(null===n)return-1;if(i=typeof t,r=typeof n,"number"===i)return"number"===r?t-n:-1;if("string"===i)switch(r){case"number":return 1;case"string":return t.localeCompare(n);default:return-1}if("boolean"===i)switch(r){case"number":return 1;case"string":return 1;case"boolean":return t-n;default:return-1}if(t instanceof e.spreadsheet.calc.runtime.CalcError)return n instanceof e.spreadsheet.calc.runtime.CalcError?0:1;throw Error("Cannot compare "+t+" and "+n)},t.descendingComparer=function(e,n){return null===e&&null===n?0:null===e?1:null===n?-1:t.ascendingComparer(n,e)},e.spreadsheet.Sorter=t}}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/numformat.min",["spreadsheet/calc.min","kendo.dom.min"],e)}(function(){"use strict";function e(e){function t(){u.push({cond:"text",body:[{type:"text"}]})}function n(){var t=e.skip(c);return t?t[1].toLowerCase():void 0}function i(){var t,n=e.skip(h);return n&&(t=parseFloat(n[2]),!isNaN(t))?{op:n[1],value:t}:void 0}function r(){for(var t,n=[],i=null;!e.eof()&&(t=s());)"date"==t.type?i&&/^(el)?time$/.test(i.type)&&"h"==i.part&&"m"==t.part&&3>t.format&&(t.type="time"):/^(el)?time$/.test(t.type)&&"s"==t.part&&i&&"date"==i.type&&"m"==i.part&&3>i.format&&(i.type="time"),/^(?:str|space|fill)$/.test(t.type)||(i=t),n.push(t);return n}function o(t){if("date"!=t.type||"m"==t.part&&3>t.format){var n=e.skip(/^\.(0+)/);n&&(t.fraction=n[1].length,"date"==t.type&&(t.type="time"))}return t}function s(){var t,n;if(n=e.skip(/^([#0?]+),([#0?]+)/))return{type:"digit",sep:!0,format:n[1]+n[2],decimal:f};if(n=e.skip(/^[#0?]+/))return{type:"digit",sep:!1,format:n[0],decimal:f};if(n=e.skip(/^(e)([+-])/i))return{type:"exp",ch:n[1],sign:n[2]};if(n=e.skip(/^(d{1,4}|m{1,5}|yyyy|yy)/i))return n=n[1].toLowerCase(),o({type:"date",part:n.charAt(0),format:n.length});if(n=e.skip(/^(hh?|ss?)/i))return n=n[1].toLowerCase(),o({type:"time",part:n.charAt(0),format:n.length});if(n=e.skip(/^\[(hh?|mm?|ss?)\]/i))return n=n[1].toLowerCase(),o({type:"eltime",part:n.charAt(0),format:n.length});if(n=e.skip(/^(am\/pm|a\/p)/i))return n=n[1].split("/"),{type:"ampm",am:n[0],pm:n[1]};switch(t=e.next()){case";":return null;case"\\":return{type:"str",value:e.next()};case'"':return{type:"str",value:e.readEscaped(t)};case"@":return{type:"text"};case"_":return{type:"space",value:e.next()};case"*":return{type:"fill",value:e.next()};case".":return e.lookingAt(/^\s*[#0?]/)?(f=!0,{type:"dec"}):{type:"str",value:"."};case"%":return{type:"percent"};case",":return{type:"comma"}}return{type:"str",value:t}}function a(){f=!1;var e=n(),t=i();return!e&&t&&(e=n()),{color:e,cond:t,body:r()}}var u,d,f,p;for(e=l.InputStream(e),u=[],d=!1;!e.eof();)p=a(),u.push(p),p.cond&&(d=!0);return d?t():1==u.length?(u[0].cond="num",t()):2==u.length?(u[0].cond={op:">=",value:0},u[1].cond={op:"<",value:0},t()):u.length>=3&&(u[0].cond={op:">",value:0},u[1].cond={op:"<",value:0},u[2].cond={op:"=",value:0},t(),u.length>3&&(u[3].cond="text",u=u.slice(0,4))),u}function t(e){function t(e){var t="";return e.color&&(t+="["+e.color+"]"),e.cond&&"text"!=e.cond&&"num"!=e.cond&&(t+="["+e.cond.op+e.cond.value+"]"),t+=e.body.map(i).join("")}function n(e,t){return t.fraction&&(e+="."+s("",t.fraction,"0")),e}function i(e){return"digit"==e.type?e.sep?e.format.charAt(0)+","+e.format.substr(1):e.format:"exp"==e.type?e.ch+e.sign:"date"==e.type||"time"==e.type?n(s("",e.format,e.part),e):"eltime"==e.type?n("["+s("",e.format,e.part)+"]",e):"ampm"==e.type?e.am+"/"+e.pm:"str"==e.type?JSON.stringify(e.value):"text"==e.type?"@":"space"==e.type?"_"+e.value:"fill"==e.type?"*"+e.value:"dec"==e.type?".":"percent"==e.type?"%":"comma"==e.type?",":void 0}return e.map(t).join(";")}function n(e,t){e.forEach(function(e){var n,i,r,o,a,l=t;if("text"!=e.cond){for(n=e.body,i=!1,r=n.length;0!==l&&--r>=0;)if(o=n[r],"digit"==o.type){if(o.decimal&&(i=!0,l>0?o.format+=s("",l,"0"):0>l&&(a=o.format.length,o.format=o.format.substr(0,a+l),l+=a-o.format.length),0===o.format.length))for(n.splice(r,1);--r>=0;){if(o=n[r],"digit"==o.type&&o.decimal){++r;break}if("dec"==o.type){n.splice(r,1);break}}if(l>0)break}!i&&l>0&&n.splice(r+1,0,{type:"dec"},{type:"digit",sep:!1,decimal:!0,format:s("",l,"0")})}})}function i(e){var t=0;return{next:function(){return e[t++]},eof:function(){return t>=e.length},ahead:function(n,i){if(e.length>=t+n){var r=i.apply(null,e.slice(t,t+n));return r&&(t+=n),r}},restart:function(){t=0}}}function r(e){function t(e,t){("digit"==e.type&&"comma"==t.type||"comma"==e.type&&e.hidden&&"comma"==t.type)&&(t.hidden=!0,c++)}var n,r,o=i(e.body),s=!1,a=!1,l=!1,u=0,c=0,h="",d=!1,f=0,p=[],m=[],g=e.cond,v="";for("text"==g?v="if (typeof value == 'string' || value instanceof kendo.spreadsheet.CalcError) { ":"num"==g?v="if (typeof value == 'number') { ":g&&(n="="==g.op?"==":g.op,v="if (typeof value == 'number' && value "+n+" "+g.value+") { ",h+="value = Math.abs(value); "),e.color&&(h+="result.color = "+JSON.stringify(e.color)+"; ");!o.eof();)o.ahead(2,t),r=o.next(),"percent"==r.type?u++:"digit"==r.type?r.decimal?(f+=r.format.length,m.push(r.format)):(p.push(r.format),r.sep&&(d=!0)):"time"==r.type?a=!0:"date"==r.type?s=!0:"ampm"==r.type&&(l=a=!0);for(u>0&&(h+="value *= "+Math.pow(100,u)+"; "),c>0&&(h+="value /= "+Math.pow(1e3,c)+"; "),p.length&&(h+="var intPart = runtime.formatInt(culture, value, "+JSON.stringify(p)+", "+f+", "+d+"); "),m.length&&(h+="var decPart = runtime.formatDec(value, "+JSON.stringify(m)+", "+f+"); "),(p.length||m.length)&&(h+="type = 'number'; "),s&&(h+="var date = runtime.unpackDate(value); "),a&&(h+="var time = runtime.unpackTime(value); "),(s||a)&&(h+="type = 'date'; "),(u>0||c>0||p.length||m.length||s||a)&&(v||(v="if (typeof value == 'number') { ")),o.restart();!o.eof();)r=o.next(),"dec"==r.type?h+="output += culture.numberFormat['.']; ":"comma"!=r.type||r.hidden?"percent"==r.type?(h+="type = 'percent'; ",h+="output += culture.numberFormat.percent.symbol; "):"str"==r.type?h+="output += "+JSON.stringify(r.value)+"; ":"text"==r.type?(h+="type = 'text'; ",h+="output += value; "):"space"==r.type?(h+="if (output) result.body.push(output); ",h+="output = ''; ",h+="result.body.push({ type: 'space', value: "+JSON.stringify(r.value)+" }); "):"fill"==r.type?h+="output += runtime.fill("+JSON.stringify(r.value)+"); ":"digit"==r.type?h+="output += "+(r.decimal?"decPart":"intPart")+".shift(); ":"date"==r.type?h+="output += runtime.date(culture, date, "+JSON.stringify(r.part)+", "+r.format+"); ":"time"==r.type?h+="output += runtime.time(time, "+JSON.stringify(r.part)+", "+r.format+", "+l+", "+r.fraction+"); ":"eltime"==r.type?h+="output += runtime.eltime(value, "+JSON.stringify(r.part)+", "+r.format+", "+r.fraction+"); ":"ampm"==r.type&&(h+="output += time.hours < 12 ? "+JSON.stringify(r.am)+" : "+JSON.stringify(r.pm)+"; "):h+="output += ','; ";return h+="if (output) result.body.push(output); ",h+="result.type = type; ",h+="return result; ",v&&(h=v+h+"}"),h}function o(t){var n,i,o=d[t];return o||(n=e(t),i=n.map(r).join("\n"),i="'use strict'; return function(value, culture){ if (!culture) culture = kendo.culture(); var output = '', type = null, result = { body: [] }; "+i+"; return result; };",o=d[t]=Function("runtime",i)(f)),o}function s(e,t,n){for(e+="";t>e.length;)e=n+e;return e}function a(e){var t,n,i=e.body,r="";for(t=0;i.length>t;++t)n=i[t],"string"==typeof n?r+=n:"space"==n.type&&(r+=" ");return r}var l,u,c,h,d,f;kendo.support.browser.msie&&kendo.support.browser.version<9||(l=kendo.spreadsheet.calc,u=kendo.dom,c=/^\[(black|green|white|blue|magenta|yellow|cyan|red)\]/i,h=/^\[(<=|>=|<>|<|>|=)(-?[0-9.]+)\]/,d=Object.create(null),f={unpackDate:l.runtime.unpackDate,unpackTime:l.runtime.unpackTime,date:function(e,t,n,i){switch(n){case"d":switch(i){case 1:return t.date;case 2:return s(t.date,2,"0");case 3:return e.calendars.standard.days.namesAbbr[t.day];case 4:return e.calendars.standard.days.names[t.day]}break;case"m":switch(i){case 1:return t.month+1;case 2:return s(t.month+1,2,"0");case 3:return e.calendars.standard.months.namesAbbr[t.month];case 4:return e.calendars.standard.months.names[t.month];case 5:return e.calendars.standard.months.names[t.month].charAt(0)}break;case"y":switch(i){case 2:return t.year%100;case 4:return t.year}}return"##"},time:function(e,t,n,i,r){var o,a;switch(t){case"h":o=s(i?e.hours%12||12:e.hours,n,"0"),r&&(a=(e.minutes+(e.seconds+e.milliseconds/1e3)/60)/60);break;case"m":o=s(e.minutes,n,"0"),r&&(a=(e.seconds+e.milliseconds/1e3)/60);break;case"s":o=s(e.seconds,n,"0"),r&&(a=e.milliseconds/1e3)}return a&&(o+=a.toFixed(r).replace(/^0+/,"")),o},eltime:function(e,t,n,i){var r,o;switch(t){case"h":r=24*e;break;case"m":r=24*e*60;break;case"s":r=24*e*60*60}return i&&(o=r-(0|r)),r=s(0|r,n,"0"),o&&(r+=o.toFixed(i).replace(/^0+/,"")),r},fill:function(e){return e},formatInt:function(e,t,n,i,r){function o(t){r&&l&&l%3===0&&" "!=t&&(u=e.numberFormat[","]+u),u=t+u,l++}var s,a,l,u,c,h,d,f;for(t=t.toFixed(i).replace(/\..*$/,""),i>0&&("0"===t?t="":"-0"===t&&(t="-")),s=t.length-1,a=[],l=0,c=n.length;--c>=0;){for(h=n[c],u="",d=h.length;--d>=0;)f=h.charAt(d),0>s?"0"==f?o("0"):"?"==f&&o(" "):o(t.charAt(s--));if(0===c)for(;s>=0;)o(t.charAt(s--));a.unshift(u)}return a},formatDec:function(e,t,n){var i,r,o,s,a,l,u,c;for(e=e.toFixed(n),i=e.indexOf("."),e=i>=0?e.substr(i+1).replace(/0+$/,""):"",r=0,o=[],s=0;t.length>s;++s){for(a=t[s],l="",u=0;a.length>u;++u)c=a.charAt(u),e.length>r?l+=e.charAt(r++):"0"==c?l+="0":"?"==c&&(l+=" ");o.push(l)}return o}},kendo.spreadsheet.formatting={compile:o,parse:e,format:function(e,t,n){var i,r,s,a=o(t)(e,n),l=u.element("span");for(l.__dataType=a.type,i=a.body,a.color&&(l.attr.style={color:a.color}),r=0;i.length>r;++r)s=i[r],"string"==typeof s?l.children.push(u.text(s)):"space"==s.type&&l.children.push(u.element("span",{style:{visibility:"hidden"}},[u.text(s.value)]));return l},text:function(e,t,n){var i=o(t)(e,n);return a(i)},textAndColor:function(e,t,n){var i=o(t)(e,n);return{text:a(i),color:i.color,type:i.type}},type:function(e,t){return o(t)(e).type},adjustDecimals:function(i,r){var o=e(i);return n(o,r),t(o)}})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/runtime.functions.min",["spreadsheet/runtime.min","util/main.min"],e)}(function(){"use strict";function e(e){return(Math.exp(e)+Math.exp(-e))/2}function t(e){return(Math.exp(e)-Math.exp(-e))/2}function n(n){return t(n)/e(n)}function i(e,t){for(;t;){var n=e%t;e=t,t=n}return e}function r(e,t){return Math.abs(e*t)/i(e,t)}function o(e,t){for(var n,i,r,o=[],s=0,a=e[0];e.length>s;)o.push({matrix:e[s++],pred:W(e[s++])});for(n=0;a.height>n;++n)e:for(i=0;a.width>i;++i){for(s=0;o.length>s;++s)if(r=o[s].matrix.get(n,i),!o[s].pred(null==r||""===r?0:r))continue e;t(n,i)}}function s(e){return e.reduce(function(e,t){return e+t},0)/e.length}function a(e,t,n){return null==n&&(n=s(e)),e.reduce(function(e,t){return e+Math.pow(t-n,2)},0)/t}function l(e,t){return Math.sqrt(a(e,t))}function u(e,t,n){var i=0,r=0,o=null,s=null,a=!1;return e.forEach(function(e){t>e?(i++,o=null==o?e:Math.max(o,e)):e>t?(r++,s=null==s?e:Math.min(s,e)):a=!0}),i||r?a?n?(i+1)/(e.length+1):i/(i+r):((s-t)*u(e,o,n)+(t-o)*u(e,s,n))/(s-o):new S("N/A")}function c(e,t,n){var i,r=0,o=s(e),a=s(t),l=e.length;for(i=0;l>i;++i)r+=(e[i]-o)*(t[i]-a);return r/n}function h(e,t){var n,i,r;return e.sort(w),n=e.length,i=0|t,r=t-i,0===i?e[0]:i>=n?e[n-1]:(--i,e[i]+r*(e[i+1]-e[i]))}function d(e,t){var n=t*(e.length-1)+1;return h(e,n)}function f(e,t){var n=t*(e.length+1);return h(e,n)}function p(e,t,n){var i=[],r=1,o=2,s=4;return function a(t){if(t instanceof T)e.getRefCells(t,!0).forEach(function(e){var t,a=e.value;if(!(n&r&&e.hidden)){if(e.formula){if(t=e.formula.print(e.row,e.col),/^\s*(?:aggregate|subtotal)\s*\(/i.test(t)&&!(n&s))return;"value"in e.formula&&(a=e.formula.value)}n&o&&a instanceof S||("number"==typeof a||a instanceof S)&&i.push(a)}});else if(Array.isArray(t))for(var l=0;t.length>l;++l)a(t[l]);else t instanceof D?t.each(a):"number"==typeof t?i.push(t):t instanceof S&&!(n&o)&&i.push(t)}(t),i}function m(e,t,n,i){var r,o;if(i){for(r=0,o=0;e>=o;++o)r+=V(t,o)*Math.pow(n,o)*Math.pow(1-n,t-o);return r}return V(t,e)*Math.pow(n,e)*Math.pow(1-n,t-e)}function g(e){var t=N(L(e,0,1));return 4==t.day||3==t.day&&C.isLeapYear(e)?53:52}function v(e,t,n){var i=N(e),r=N(t);return n?(31==i.date&&(i.date=30),31==r.date&&(r.date=30)):(1==i.month&&1==r.month&&i.date==B(i.year,1)&&r.date==B(r.year,1)&&(r.date=30),i.date==B(i.year,i.month)?(i.date=30,31==r.date&&(r.date=30)):30==i.date&&31==r.date&&(r.date=30)),360*(r.year-i.year)+30*(r.month-i.month)+(r.date-i.date)}function b(e){return"number"==typeof e||"boolean"==typeof e||null==e||""===e}function w(e,t){return e===t?0:t>e?-1:1}function y(e,t){return e===t?0:t>e?1:-1}var _,x,k,C,F,R,S,A,M,E,D,T,B,L,N,I,z,P,$,H,O,V,U,j,W;kendo.support.browser.msie&&kendo.support.browser.version<9||(_=kendo.util,x=kendo.spreadsheet,k=x.calc,C=k.runtime,F=C.defineFunction,R=C.defineAlias,S=C.CalcError,A=x.RangeRef,M=x.CellRef,E=x.UnionRef,D=C.Matrix,T=x.Ref,B=C.daysInMonth,L=C.packDate,N=C.unpackDate,I=C.daysInYear,["abs","cos","sin","acos","asin","tan","atan","exp","sqrt"].forEach(function(e){F(e,Math[e]).args([["*n","number"]])}),F("ln",Math.log).args([["*n","number"]]),F("log",function(e,t){return Math.log(e)/Math.log(t)}).args([["*num","number++"],["*base",["or","number++",["null",10]]],["?",["assert","$base != 1","DIV/0"]]]),F("log10",function(e){return Math.log(e)/Math.log(10)}).args([["*num","number++"]]),F("pi",function(){return Math.PI}).args([]),F("sqrtpi",function(e){return Math.sqrt(e*Math.PI)}).args([["*num","number+"]]),F("degrees",function(e){return 180*e/Math.PI%360}).args([["*radians","number"]]),F("radians",function(e){return Math.PI*e/180}).args([["*degrees","number"]]),F("cosh",e).args([["*num","number"]]),F("acosh",function(e){return Math.log(e+Math.sqrt(e-1)*Math.sqrt(e+1))}).args([["*num","number"],["?",["assert","$num >= 1"]]]),F("sinh",t).args([["*num","number"]]),F("asinh",function(e){return Math.log(e+Math.sqrt(e*e+1))}).args([["*num","number"]]),F("sec",function(e){return 1/Math.cos(e)}).args([["*num","number"]]),F("sech",function(t){return 1/e(t)}).args([["*num","number"]]),F("csc",function(e){return 1/Math.sin(e)}).args([["*num","number"]]),F("csch",function(e){return 1/t(e)}).args([["*num","number"]]),F("atan2",function(e,t){return Math.atan(t/e)}).args([["*x","divisor"],["*y","number"]]),F("tanh",n).args([["*num","number"]]),F("atanh",function(e){return Math.log(Math.sqrt(1-e*e)/(1-e))}).args([["*num",["and","number",["(between)",-1,1]]]]),F("cot",function(e){return 1/Math.tan(e)}).args([["*num","divisor"]]),F("coth",function(e){return 1/n(e)}).args([["*num","divisor"]]),F("acot",function(e){return Math.PI/2-Math.atan(e)}).args([["*num","number"]]),F("acoth",function(e){return Math.log((e+1)/(e-1))/2}).args([["*num","number"],["?",["or",["assert","$num < -1"],["assert","$num > 1"]]]]),F("power",function(e,t){return Math.pow(e,t)}).args([["*a","number"],["*b","number"]]),F("mod",function(e,t){return e%t}).args([["*a","number"],["*b","divisor"]]),F("quotient",function(e,t){return Math.floor(e/t)}).args([["*a","number"],["*b","divisor"]]),F("ceiling",function(e,t){return t?t*Math.ceil(e/t):0}).args([["*number","number"],["*significance","number"],["?",["assert","$significance >= 0 || $number < 0"]]]),F("ceiling.precise",function(e,t){return t=Math.abs(t),t?t*Math.ceil(e/t):0}).args([["*number","number"],["*significance",["or","number",["null",1]]]]),R("iso.ceiling","ceiling.precise"),F("ceiling.math",function(e,t,n){return t&&e?(0>e&&(!n&&0>t||n&&t>0)&&(t=-t),t?t*Math.ceil(e/t):0):0}).args([["*number","number"],["*significance",["or","number",["null","$number < 0 ? -1 : 1"]]],["*mode",["or","logical",["null",0]]]]),F("floor",function(e,t){return t?t*Math.floor(e/t):0}).args([["*number","number"],["*significance","number"],["?",["assert","$significance >= 0 || $number < 0"]]]),F("floor.precise",function(e,t){return t=Math.abs(t),t?t*Math.floor(e/t):0}).args([["*number","number"],["*significance",["or","number",["null",1]]]]),F("floor.math",function(e,t,n){return t&&e?(0>e&&(!n&&0>t||n&&t>0)&&(t=-t),t?t*Math.floor(e/t):0):0}).args([["*number","number"],["*significance",["or","number",["null","$number < 0 ? -1 : 1"]]],["*mode",["or","logical",["null",0]]]]),F("int",Math.floor).args([["*number","number"]]),F("mround",function(e,t){return t?t*Math.round(e/t):0}).args([["*number","number"],["*multiple","number"]]),F("round",function(e,t){var n=0>e?-1:1;return 0>n&&(e=-e),t=Math.pow(10,t),e*=t,e=Math.round(e),n*e/t}).args([["*number","number"],["*digits","number"]]),F("roundup",function(e,t){return t=Math.pow(10,t),e*=t,e=0>e?Math.floor(e):Math.ceil(e),e/t}).args([["*number","number"],["*digits","number"]]),F("rounddown",function(e,t){return t=Math.pow(10,t),e*=t,e=0>e?Math.ceil(e):Math.floor(e),e/t}).args([["*number","number"],["*digits","number"]]),F("even",function(e){var t=0>e?Math.floor(e):Math.ceil(e);return t%2?t+(0>t?-1:1):t}).args([["*number","number"]]),F("odd",function(e){var t=0>e?Math.floor(e):Math.ceil(e);return t%2?t:t+(0>t?-1:1)}).args([["*number","number"]]),F("sign",function(e){return 0>e?-1:e>0?1:0}).args([["*number","number"]]),F("gcd",function(e){var t,n=e[0];for(t=1;e.length>t;++t)n=i(n,e[t]);return n}).args([["numbers",["collect","number"]]]),F("lcm",function(e){var t,n=e[0];for(t=1;e.length>t;++t)n=r(n,e[t]);return n}).args([["numbers",["collect","number"]]]),F("sum",function(e){return e.reduce(function(e,t){return e+t},0)}).args([["numbers",["collect","number"]]]),F("product",function(e){return e.reduce(function(e,t){return e*t},1)}).args([["numbers",["collect","number"]]]),F("sumproduct",function(e,t){var n=0;return e.each(function(e,i,r){var o,s;if("number"==typeof e){for(o=0;t.length>o;++o){if(s=t[o].get(i,r),"number"!=typeof s)return;e*=s}n+=e}}),n}).args([["a1","matrix"],["+",["a2",["and","matrix",["assert","$a2.width == $a1.width"],["assert","$a2.height == $a1.height"]]]]]),F("sumsq",function(e){return e.reduce(function(e,t){return e+t*t},0)}).args([["numbers",["collect","number"]]]),F("sumx2my2",function(e,t){var n=0;return e.each(function(e,i,r){var o=t.get(i,r);"number"==typeof e&&"number"==typeof o&&(n+=e*e-o*o)}),n}).args([["a","matrix"],["b",["and","matrix",["assert","$b.width == $a.width"],["assert","$b.height == $a.height"]]]]),F("sumx2py2",function(e,t){var n=0;return e.each(function(e,i,r){var o=t.get(i,r);"number"==typeof e&&"number"==typeof o&&(n+=e*e+o*o)}),n}).args([["a","matrix"],["b",["and","matrix",["assert","$b.width == $a.width"],["assert","$b.height == $a.height"]]]]),F("sumxmy2",function(e,t){var n=0;return e.each(function(e,i,r){var o=t.get(i,r);"number"==typeof e&&"number"==typeof o&&(n+=(e-o)*(e-o))}),n}).args([["a","matrix"],["b",["and","matrix",["assert","$b.width == $a.width"],["assert","$b.height == $a.height"]]]]),F("seriessum",function(e,t,n,i){var r=0;return i.each(function(i){if("number"!=typeof i)throw new S("VALUE");r+=i*Math.pow(e,t),t+=n}),r}).args([["x","number"],["y","number"],["m","number"],["a","matrix"]]),F("min",function(e){return Math.min.apply(Math,e)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","N/A"]]]),F("max",function(e){return Math.max.apply(Math,e)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","N/A"]]]),F("counta",function(e){return e.length}).args([["values",["#collect","anyvalue"]]]),F("count",function(e){return e.length}).args([["numbers",["#collect","number"]]]),F("countunique",function(e){var t=0,n=[];return e.forEach(function(e){n.indexOf(e)<0&&(t++,n.push(e))}),t}).args([["values",["#collect","anyvalue"]]]),F("countblank",function(e){function t(e){(null==e||""===e)&&i++}function n(e){var n,i;for(n=0;e.length>n;++n)i=e[n],i instanceof D?i.each(t,!0):t(i)}var i=0;return n(e),i}).args([["+",["args",["or","matrix","anyvalue"]]]]),F("iseven",function(e){return e%2===0}).args([["*number","number"]]),F("isodd",function(e){return e%2!==0}).args([["*number","number"]]),F("n",function(e){return"boolean"==typeof e?e?1:0:"number"==typeof e?e:0}).args([["*value","anyvalue"]]),F("na",function(){return new S("N/A")}).args([]),z=[["m1","matrix"],["c1","anyvalue"],[["m2",["and","matrix",["assert","$m1.width == $m2.width"],["assert","$m1.height == $m2.height"]]],["c2","anyvalue"]]],F("countifs",function(e,t,n){var i=0;return n.unshift(e,t),o(n,function(){i++}),i}).args(z),P=[["range","matrix"]].concat(z),F("sumifs",function(e,t,n,i){i.unshift(e,b,t,n);var r=0;return o(i,function(t,n){var i=e.get(t,n);i&&(r+=i)}),r}).args(P),F("averageifs",function(e,t,n,i){i.unshift(e,b,t,n);var r=0,s=0;return o(i,function(t,n){var i=e.get(t,n);(null==i||""===i)&&(i=0),r+=i,s++}),s?r/s:new S("DIV/0")}).args(P),F("countif",function(e,t){t=W(t);var n=0;return e.each(function(e){t(e)&&n++}),n}).args([["range","matrix"],["*criteria","anyvalue"]]),$=[["range","matrix"],["*criteria","anyvalue"],["sumRange",["or",["and","matrix",["assert","$sumRange.width == $range.width"],["assert","$sumRange.height == $range.height"]],["null","$range"]]]],F("sumif",function(e,t,n){var i=0;return t=W(t),e.each(function(e,r,o){if(t(e)){var s=n.get(r,o);b(s)&&(i+=s||0)}}),i}).args($),F("averageif",function(e,t,n){var i=0,r=0;return t=W(t),e.each(function(e,o,s){if(t(e)){var a=n.get(o,s);b(a)&&(i+=a||0,r++)}}),r?i/r:new S("DIV/0")}).args($),function(e){e("large",function(e,t){return e.sort(y)[t]}),e("small",function(e,t){return e.sort(w)[t]})}(function(e,t){F(e,function(e,n){var i=[],r=e.each(function(e){return e instanceof S?e:void("number"==typeof e&&i.push(e))});return r?r:n>i.length?new S("NUM"):t(i,n-1)}).args([["array","matrix"],["*nth","number++"]])}),F("stdev.s",function(e){return l(e,e.length-1)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]),F("stdev.p",function(e){return l(e,e.length)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]),F("var.s",function(e){return a(e,e.length-1)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]),F("var.p",function(e){return a(e,e.length)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]),F("median",function(e){var t=e.length;return e.sort(w),t%2?e[t>>1]:(e[t>>1]+e[t>>2])/2}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","N/A"]]]),F("mode.sngl",function(e){var t,n,i,r,o,s;for(e.sort(w),t=null,n=0,i=1,r=null,o=0;e.length>o;++o)s=e[o],s!=t?(n=1,t=s):n++,n>i&&(i=n,r=s);return null==r?new S("N/A"):r}).args([["numbers",["collect","number"]]]),F("mode.mult",function(e){var t,n=Object.create(null),i=2,r=[];return e.forEach(function(e){var t=n[e]||0;n[e]=++t,t==i?r.push(e):t>i&&(i=t,r=[e])}),t=new D(this),r.forEach(function(e,n){t.set(n,0,e)}),t}).args([["numbers",["collect","number"]]]),F("geomean",function(e){var t=e.length,n=e.reduce(function(e,t){if(0>t)throw new S("NUM");return e*t},1);return Math.pow(n,1/t)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","NUM"]]]),F("harmean",function(e){var t=e.length,n=e.reduce(function(e,t){if(!t)throw new S("DIV/0");return e+1/t},0);return t/n}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","NUM"]]]),F("trimmean",function(e,t){var n,i,r,o=e.length;for(e.sort(w),n=Math.floor(o*t),n%2&&--n,n/=2,i=0,r=n;o-n>r;++r)i+=e[r];return i/(o-2*n)}).args([["numbers",["collect","number",1]],["percent",["and","number",["[between)",0,1]]],["?",["assert","$numbers.length > 0","NUM"]]]),F("frequency",function(e,t){function n(t){for(var n=0;e.length>r&&e[r]>i&&t>=e[r];)++n,++r;return n}var i,r,o;return e.sort(w),t.sort(w),i=-(1/0),r=0,o=new D(this),t.forEach(function(e,t){var r=n(e);i=e,o.set(t,0,r)}),o.set(o.height,0,e.length-r),o}).args([["data",["collect","number",1]],["bins",["collect","number",1]]]),F("rank.eq",function(e,t,n){t.sort(n?w:y);var i=t.indexOf(e);return 0>i?new S("N/A"):i+1}).args([["value","number"],["numbers",["collect","number"]],["order",["or","logical",["null",!1]]]]),R("rank","rank.eq"),F("rank.avg",function(e,t,n){var i,r;if(t.sort(n?w:y),i=t.indexOf(e),0>i)return new S("N/A");for(r=i;t[r]==e;++r);return(i+r+1)/2}).args([["value","number"],["numbers",["collect","number"]],["order",["or","logical",["null",!1]]]]),F("kurt",function(e){var t=e.length,n=s(e),i=a(e,t-1,n),r=Math.sqrt(i),o=e.reduce(function(e,t){return e+Math.pow((t-n)/r,4)},0);return t*(t+1)/((t-1)*(t-2)*(t-3))*o-3*Math.pow(t-1,2)/((t-2)*(t-3))}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 4","NUM"]]]),H=[["array",["collect","number",1]],["x","number"],["significance",["or",["null",3],"integer++"]],["?",["assert","$array.length > 0","NUM"]]],F("percentrank.inc",function(e,t,n){var i=u(e,t,0);return i=i.toFixed(n+1),parseFloat(i.substr(0,i.length-1))}).args(H),F("percentrank.exc",function(e,t,n){var i=u(e,t,1);return i=i.toFixed(n+1),parseFloat(i.substr(0,i.length-1))}).args(H),R("percentrank","percentrank.inc"),F("covariance.p",function(e,t){return c(e,t,e.length)}).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array1.length == $array2.length","N/A"]],["?",["assert","$array1.length > 0","DIV/0"]]]),F("covariance.s",function(e,t){return c(e,t,e.length-1)}).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array1.length == $array2.length","N/A"]],["?",["assert","$array1.length > 1","DIV/0"]]]),R("covar","covariance.p"),O=_.memoize(function(e){for(var t=2,n=1;e>=t;++t)n*=t;return n}),F("fact",O).args([["*n","integer+"]]),F("factdouble",function(e){for(var t=2+(1&e),n=1;e>=t;t+=2)n*=t;return n}).args([["*n","integer+"]]),F("multinomial",function(e){var t=1,n=0;return e.forEach(function(e){if(0>e)throw new S("NUM");n+=e,t*=O(e)}),O(n)/t}).args([["numbers",["collect","number"]]]),V=_.memoize(function(e,t){for(var n=t+1,i=1,r=1,o=1;e-t>=i;++n,++i)r*=n,o*=i;return r/o}),F("combin",V).args([["*n","integer++"],["*k",["and","integer",["[between]",0,"$n"]]]]),F("combina",function(e,t){return V(e+t-1,e-1)}).args([["*n","integer++"],["*k",["and","integer",["[between]",1,"$n"]]]]),F("average",function(e){var t=e.reduce(function(e,t){return e+t},0);return t/e.length}).args([["numbers",["collect",["and","number",["not","boolean"]]]],["?",["assert","$numbers.length > 0","DIV/0"]]]),F("averagea",function(e){var t=0,n=0;return e.forEach(function(e){"string"!=typeof e&&(t+=e),++n}),n?t/n:new S("DIV/0")}).args([["values",["collect","anyvalue"]]]),F("percentile.inc",d).args([["numbers",["collect","number",1]],["p",["and","number",["[between]",0,1]]]]),F("percentile.exc",f).args([["numbers",["collect","number",1]],["p",["and","number",["(between)",0,1]]]]),F("quartile.inc",function(e,t){return d(e,t/4)}).args([["numbers",["collect","number",1]],["quarter",["values",0,1,2,3,4]]]),F("quartile.exc",function(e,t){return f(e,t/4)}).args([["numbers",["collect","number",1]],["quarter",["values",0,1,2,3,4]]]),R("quartile","quartile.inc"),R("percentile","percentile.inc"),U=["AVERAGE","COUNT","COUNTA","MAX","MIN","PRODUCT","STDEV.S","STDEV.P","SUM","VAR.S","VAR.P","MEDIAN","MODE.SNGL","LARGE","SMALL","PERCENTILE.INC","QUARTILE.INC","PERCENTILE.EXC","QUARTILE.EXC"],F("aggregate",function(e,t,n,i){var r=this;r.resolveCells(i,function(){var o,s;if(t>12){if(o=p(r,i[0],n),s=i[1],s instanceof M&&(s=r.getRefData(s)),"number"!=typeof s)return e(new S("VALUE"))}else o=p(r,i,n);r.func(U[t-1],e,o)})}).argsAsync([["funcId",["values",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]],["options",["or",["null",0],["values",0,1,2,3,4,5,6,7]]],["args","rest"]]),F("subtotal",function(e,t){var n,i,r=this,o=t>100;for(o&&(t-=100),n=[],i=2;i<arguments.length;++i)n.push(arguments[i]);r.resolveCells(n,function(){var i=p(r,n,o?1:0);r.func(U[t-1],e,i)})}).argsAsync([["funcId",["values",1,2,3,4,5,6,7,8,9,10,11,101,102,103,104,105,106,107,108,109,110,111]],["+",["ref",["or","ref","#matrix"]]]]),F("avedev",function(e){var t=e.reduce(function(e,t){return e+t},0)/e.length;return e.reduce(function(e,n){return e+Math.abs(n-t)},0)/e.length}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]),F("binom.dist",m).args([["successes","integer+"],["trials",["and","integer",["assert","$trials >= $successes"]]],["probability",["and","number",["[between]",0,1]]],["cumulative","logical"]]),
  R("binomdist","binom.dist"),F("binom.inv",function(e,t,n){for(var i=0;e>=i;++i)if(m(i,e,t,!0)>=n)return i;return new S("N/A")}).args([["trials","integer+"],["probability",["and","number",["[between]",0,1]]],["alpha",["and","number",["[between]",0,1]]]]),R("critbinom","binom.inv"),F("binom.dist.range",function(e,t,n,i){var r,o=0;for(r=n;i>=r;++r)o+=V(e,r)*Math.pow(t,r)*Math.pow(1-t,e-r);return o}).args([["trials","integer+"],["probability",["and","number",["[between]",0,1]]],["successes_min",["and","integer",["[between]",0,"$trials"]]],["successes_max",["or",["and","integer",["[between]","$successes_min","$trials"]],["null","$successes_min"]]]]),F("negbinom.dist",function(e,t,n,i){if(i){for(var r=0;e>=0;)r+=V(e+t-1,e)*Math.pow(n,t)*Math.pow(1-n,e),e--;return r}return V(e+t-1,e)*Math.pow(n,t)*Math.pow(1-n,e)}).args([["number_f","integer+"],["number_s","integer+"],["probability_s",["and","number",["[between]",0,1]]],["cumulative","logical"]]),R("negbinomdist","negbinom.dist"),F("address",function(e,t,n,i,r){var o=new M(e-1,t-1,n-1);return r&&o.setSheet(r,!0),i?o.print(0,0):o.print()}).args([["row","integer++"],["col","integer++"],["abs",["or",["null",1],["values",1,2,3,4]]],["a1",["or",["null",!0],"logical"]],["sheet",["or","null","string"]]]),F("areas",function(e){var t=0;return function n(e){e instanceof M||e instanceof A?t++:e instanceof E&&e.refs.forEach(n)}(e),t}).args([["ref","ref"]]),F("choose",function(e,t){return e>t.length?new S("N/A"):t[e-1]}).args([["*index","integer"],["+",["value","anything"]]]),F("column",function(e){return e?e instanceof M?e.col+1:this.asMatrix(e).mapCol(function(t){return t+e.topLeft.col+1}):this.formula.col+1}).args([["ref",["or","area","null"]]]),F("columns",function(e){return e instanceof T?e.width():e.width}).args([["ref",["or","area","#matrix"]]]),F("formulatext",function(e){var t=this.getRefCells(e)[0];return t.formula?t.formula.print(t.row,t.col):new S("N/A")}).args([["ref","ref"]]),F("hlookup",function(e,t,n,i){var r=null;return t.eachCol(function(n){var o=t.get(0,n);if(i){if(o>e)return!0;r=n}else if(o===e)return r=n,!0}),null==r?new S("N/A"):t.get(n-1,r)}).args([["value","anyvalue"],["range","matrix"],["row","integer++"],["approx",["or","logical",["null",!0]]]]),F("index",function(e,t,n){if(null==t&&null==n)return new S("N/A");if(e.width>1&&e.height>1){if(null!=t&&null!=n)return e.get(t-1,n-1);if(null==t)return e.mapRow(function(t){return e.get(t,n-1)});if(null==n)return e.mapCol(function(n){return e.get(t-1,n)})}return 1==e.width?e.get(t-1,0):1==e.height?e.get(0,n-1):new S("REF")}).args([["range","matrix"],["row",["or","integer++","null"]],["col",["or","integer++","null"]]]),F("indirect",function(e){var t,n;try{if(t=this.formula,n=k.parseFormula(t.sheet,t.row,t.col,e),!(n.ast instanceof T))throw 1;return n.ast.absolute(t.row,t.col)}catch(i){return new S("REF")}}).args([["thing","string"]]),F("match",function(e,t,n){var i,r=1;return 0===n?i=W(e):-1===n?i=W("<="+e):1===n&&(i=W(">="+e)),t.each(function(t){return null!=t&&i(t)?(0!==n&&e!=t&&--r,!0):void r++},!0)&&r>0?r:new S("N/A")}).args([["value","anyvalue"],["range","matrix"],["type",["or",["values",-1,0,1],["null",1]]]]),F("offset",function(e,t,n,i,r){var o=(e instanceof M?e:e.topLeft).clone();return o.row+=t,o.col+=n,0>o.row||0>o.col?new S("VALUE"):i>1||r>1?new A(o,new M(o.row+i-1,o.col+r-1)).setSheet(e.sheet,e.hasSheet()):o}).args([["ref","area"],["*rows","integer"],["*cols","integer"],["*height",["or","integer++",["null","$ref.height()"]]],["*width",["or","integer++",["null","$ref.width()"]]]]),F("row",function(e){return e?e instanceof M?e.row+1:this.asMatrix(e).mapRow(function(t){return t+e.topLeft.row+1}):this.formula.row+1}).args([["ref",["or","area","null"]]]),F("rows",function(e){return e instanceof T?e.height():e.height}).args([["ref",["or","area","#matrix"]]]),F("vlookup",function(e,t,n,i){var r=null;return t.eachRow(function(n){var o=t.get(n,0);if(i){if(o>e)return!0;r=n}else if(o===e)return r=n,!0}),null==r?new S("N/A"):t.get(r,n-1)}).args([["value","anyvalue"],["range","matrix"],["col","integer++"],["approx",["or","logical",["null",!0]]]]),F("date",function(e,t,n){return L(e,t-1,n)}).args([["*year","integer"],["*month","integer"],["*date","integer"]]),F("day",function(e){return N(e).date}).args([["*date","date"]]),F("month",function(e){return N(e).month+1}).args([["*date","date"]]),F("year",function(e){return N(e).year}).args([["*date","date"]]),F("weekday",function(e){return N(e).day+1}).args([["*date","date"]]),F("weeknum",function(e,t){var n,i=L(N(e).year,0,1),r=N(i);return 21==t?(n=3-(r.day+6)%7,0>n&&(n+=7),i+=n,r.date+=n,r.day=4,t=1):t=1==t?0:2==t?1:(t-10)%7,n=r.day-t,0>n&&(n+=7),i-=n,Math.ceil((e+1-i)/7)}).args([["*date","date"],["*type",["or",["null",1],["values",1,2,11,12,13,14,15,16,17,21]]]]),F("isoweeknum",function(e){var t=N(e),n=t.day||7,i=Math.floor((t.ord-n+10)/7);return 1>i?g(t.year-1):53==i&&i>g(t.year)?1:i}).args([["*date","date"]]),F("now",function(){return C.dateToSerial(new Date)}).args([]),F("today",function(){return 0|C.dateToSerial(new Date)}).args([]),F("time",function(e,t,n){return C.packTime(e,t,n,0)}).args([["*hours","integer"],["*minutes","integer"],["*seconds","integer"]]),F("hour",function(e){return C.unpackTime(e).hours}).args([["*time","datetime"]]),F("minute",function(e){return C.unpackTime(e).minutes}).args([["*time","datetime"]]),F("second",function(e){return C.unpackTime(e).seconds}).args([["*time","datetime"]]),F("edate",function(e,t){var n=N(e),i=n.month+t,r=n.year+Math.floor(i/12);return i%=12,0>i&&(i+=12),n=Math.min(n.date,B(r,i)),L(r,i,n)}).args([["*start_date","date"],["*months","integer"]]),F("eomonth",function(e,t){var n=N(e),i=n.month+t,r=n.year+Math.floor(i/12);return i%=12,0>i&&(i+=12),n=B(r,i),L(r,i,n)}).args([["*start_date","date"],["*months","integer"]]),F("workday",function(e,t,n){var i,r=t>0?1:-1;for(t=Math.abs(t),i=N(e).day;t>0;)e+=r,i=(i+r)%7,i>0&&6>i&&n.indexOf(e)<0&&--t;return e}).args([["start_date","date"],["days","integer"],["holidays",["collect","date"]]]),F("networkdays",function(e,t,n){var i,r,o;for(e>t&&(i=e,e=t,t=i),r=0,o=N(e).day;t>=e;)o>0&&6>o&&n.indexOf(e)<0&&r++,e++,o=(o+1)%7;return r}).args([["start_date","date"],["end_date","date"],["holidays",["collect","date"]]]),F("days",function(e,t){return t-e}).args([["*start_date","date"],["*end_date","date"]]),C._days_360=v,F("days360",v).args([["*start_date","date"],["*end_date","date"],["*method",["or","logical",["null","false"]]]]),F("yearfrac",function(e,t,n){switch(n){case 0:return v(e,t,!1)/360;case 1:return(t-e)/I(N(e).year);case 2:return(t-e)/360;case 3:return(t-e)/365;case 4:return v(e,t,!0)/360}}).args([["*start_date","date"],["*end_date","date"],["*method",["or",["null",0],["values",0,1,2,3,4]]]]),F("datevalue",function(e){var t=C.parseDate(e);return t?C.dateToSerial(t):new S("VALUE")}).args([["*text","string"]]),F("timevalue",function(e){var t,n,i,r,o=e.toLowerCase().match(/(\d+):(\d+)(:(\d+)(\.(\d+))?)?\s*(am?|pm?)?/);return o?(t=parseFloat(o[1]),n=parseFloat(o[2]),i=o[3]?parseFloat(o[4]):0,r=o[7],r&&(t>12||1>t)?new S("VALUE"):(/^p/.test(r)&&(t+=12),C.packTime(t,n,i,0))):new S("VALUE")}).args([["*text","string"]]),F("mdeterm",function(e){var t=e.each(function(e){return"number"!=typeof e?new S("VALUE"):void 0},!0);return t||e.determinant()}).args([["m",["and","matrix",["assert","$m.width == $m.height"]]]]),F("transpose",function(e){return e.transpose()}).args([["range","matrix"]]),F("mmult",function(e,t){return e.multiply(t)}).args([["a","matrix"],["b",["and","matrix",["assert","$b.height == $a.width"]]]]),F("munit",function(e){return new D(this).unit(e)}).args([["n","integer+"]]),F("minverse",function(e){var t=e.each(function(e){return"number"!=typeof e?new S("VALUE"):void 0},!0);return t||e.inverse()||new S("VALUE")}).args([["m",["and","matrix",["assert","$m.width == $m.height"]]]]),F("rand",function(){return Math.random()}).args([]),F("randbetween",function(e,t){return e+Math.floor((t-e+1)*Math.random())}).args([["min","integer"],["max",["and","integer",["assert","$max >= $min"]]]]),F("true",function(){return!0}).args([]),F("false",function(){return!0}).args([]),F("roman",function(e){return _.arabicToRoman(e).toUpperCase()}).args([["*number","integer"]]),F("arabic",function(e){var t=_.romanToArabic(e);return null==t?new S("VALUE"):t}).args([["*roman","string"]]),F("base",function(e,t,n){for(var i=e.toString(t).toUpperCase();n>i.length;)i="0"+i;return i}).args([["*number","integer"],["*radix",["and","integer",["[between]",2,36]]],["*minLen",["or","integer+",["null",0]]]]),F("decimal",function(e,t){var n,i,r;for(e=e.toUpperCase(),n=0,i=0;e.length>i;++i){if(r=e.charCodeAt(i),r>=48&&57>=r)r-=48;else{if(!(r>=65&&55+t>r))return new S("VALUE");r-=55}n=n*t+r}return n}).args([["*text","string"],["*radix",["and","integer",["[between]",2,36]]]]),F("char",function(e){return String.fromCharCode(e)}).args([["*code","integer+"]]),j=/[\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,F("clean",function(e){return e.replace(j,"")}).args([["*text","string"]]),F("code",function(e){return e.charAt(0)}).args([["*text","string"]]),R("unichar","char"),R("unicode","code"),F("concatenate",function(){var e,t="";for(e=0;e<arguments.length;++e)t+=arguments[e];return t}).args([["+",["*text","string"]]]),F("dollar",function(e,t){for(var n="$#,##0.DECIMALS;($#,##0.DECIMALS)",i="";t-- >0;)i+="0";return n=n.replace(/DECIMALS/g,i),x.formatting.text(e,n)}).args([["*number","number"],["*decimals",["or","integer++",["null",2]]]]),F("exact",function(e,t){return e===t}).args([["*text1","string"],["*text2","string"]]),F("find",function(e,t,n){var i=t.indexOf(e,n-1);return 0>i?new S("VALUE"):i+1}).args([["*substring","string"],["*string","string"],["*start",["or","integer++",["null",1]]]]),F("fixed",function(e,t,n){for(var i=n?"0.DECIMALS":"#,##0.DECIMALS",r="";t-- >0;)r+="0";return i=i.replace(/DECIMALS/g,r),x.formatting.text(e,i)}).args([["*number","number"],["*decimals",["or","integer++",["null",2]]],["*noCommas",["or","boolean",["null",!1]]]]),F("left",function(e,t){return e.substr(0,t)}).args([["*text","string"],["*length",["or","integer+",["null",1]]]]),F("right",function(e,t){return e.substr(-t)}).args([["*text","string"],["*length",["or","integer+",["null",1]]]]),F("len",function(e){return e.length}).args([["*text","string"]]),F("lower",function(e){return e.toLowerCase()}).args([["*text","string"]]),F("upper",function(e){return e.toUpperCase()}).args([["*text","string"]]),F("ltrim",function(e){return e.replace(/^\s+/,"")}).args([["*text","string"]]),F("rtrim",function(e){return e.replace(/\s+$/,"")}).args([["*text","string"]]),F("trim",function(e){return e.replace(/^\s+|\s+$/,"")}).args([["*text","string"]]),F("mid",function(e,t,n){return e.substr(t-1,n)}).args([["*text","string"],["*start","integer++"],["*length","integer+"]]),F("proper",function(e){return e.toLowerCase().replace(/\b./g,function(e){return e.toUpperCase()})}).args([["*text","string"]]),F("replace",function(e,t,n,i){return e.substr(0,--t)+i+e.substr(t+n)}).args([["*text","string"],["*start","integer++"],["*length","integer+"],["*newText","string"]]),F("rept",function(e,t){for(var n="";t-- >0;)n+=e;return n}).args([["*text","string"],["*number","integer+"]]),F("search",function(e,t,n){var i=t.toLowerCase().indexOf(e.toLowerCase(),n-1);return 0>i?new S("VALUE"):i+1}).args([["*substring","string"],["*string","string"],["*start",["or","integer++",["null",1]]]]),F("substitute",function(e,t,n,i){function r(){e=e.substring(0,o)+n+e.substring(o+t.length)}if(t===n)return e;for(var o=-1;(o=e.indexOf(t,o+1))>=0;)if(null==i)r();else if(0===--i){r();break}return e}).args([["*text","string"],["*oldText","string"],["*newText","string"],["*nth",["or","integer++","null"]]]),F("t",function(e){return"string"==typeof e?e:""}).args([["*value","anyvalue"]]),F("text",function(e,t){return x.formatting.text(e,t)}).args([["*value","anyvalue"],["*format","string"]]),F("value",function(e){return"number"==typeof e?e:"boolean"==typeof e?+e:(e=(e+"").replace(/[$€,]/g,""),e=parseFloat(e),isNaN(e)?new S("VALUE"):e)}).args([["*value","anyvalue"]]),F("iferror",function(e,t){return e instanceof S?t:e}).args([["*value","forced!"],["*value_if_error","anyvalue"]]),W=function(){function e(e,t){if("string"==typeof t){var n=parseFloat(t);isNaN(n)||(t=n)}return function(n){var i=t;return"string"==typeof n&&"string"==typeof i&&(n=n.toLowerCase(),i=i.toLowerCase()),e(n,i)}}function t(e){return"string"==typeof e?e.toLowerCase():e}function n(e,n){return t(e)<t(n)}function i(e,n){return t(e)<=t(n)}function r(e,n){return t(e)>t(n)}function o(e,n){return t(e)>=t(n)}function s(e,n){return t(e)!=t(n)}function a(e,n){return n instanceof RegExp?n.test(e):t(e)==t(n)}var l=Object.create(null);return function(t){var u,c;return"function"==typeof t?t:(u=/^=(.*)$/.exec(t))?e(a,u[1]):(u=/^<>(.*)$/.exec(t))?e(s,u[1]):(u=/^<=(.*)$/.exec(t))?e(i,u[1]):(u=/^<(.*)$/.exec(t))?e(n,u[1]):(u=/^>=(.*)$/.exec(t))?e(o,u[1]):(u=/^>(.*)$/.exec(t))?e(r,u[1]):/[?*]/.exec(t)?(c=l[t],c||(c=t.replace(/(~\?|~\*|[\]({\+\.\|\^\$\\})\[]|[?*])/g,function(e){switch(e){case"~?":return"\\?";case"~*":return"\\*";case"?":return".";case"*":return".*";default:return"\\"+e}}),c=l[t]=RegExp("^"+c+"$","i")),e(a,c)):e(a,t)}}())},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/runtime.functions.2.min",["spreadsheet/runtime.min"],e)}(function(){"use strict";function e(e){var n,i,r,o;if(ut(e)>=3.3)return 1-t(e);for(n=e>0?1:-1,-1==n&&(e=-e),i=0,r=1,o=1;100>o;o++)i+=r,r*=2*e*e/(2*o+1);return 2*n/Math.sqrt(Math.PI)*e*Math.exp(-e*e)*i}function t(t){var n,i,r;if(ut(t)<3.3)return 1-e(t);for(n=1,0>t&&(n=-1,t=-t),i=t,r=8;r>=1;r-=.5)i=t+r/i;return i=1/(t+i),1==n?Math.exp(-t*t)/Math.sqrt(Math.PI)*i:2-Math.exp(-t*t)/Math.sqrt(Math.PI)*i}function n(e){var t,n=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],i=e,r=e+5.5,o=n[0];for(r-=(e+.5)*Math.log(r),t=1;6>=t;t++)i+=1,o+=n[t]/i;return-r+Math.log(Math.sqrt(2*Math.PI)*o/e)}function i(e){if(e>0)return Math.exp(n(e));var t=Math.PI,r=-e;return-t/(r*i(r)*Math.sin(t*r))}function r(e,t){return n(e)+n(t)-n(e+t)}function o(e,t){return Math.exp(r(e,t))}function s(e,t){return e+1>t?a(e,t):1-l(e,t)}function a(e,t){var i,r=1/e,o=r,s=e,a=n(e);for(i=1;st>=i&&(s++,o*=t/s,r+=o,!(ut(o)<ut(r)*at));i++);return r*Math.exp(-t+e*Math.log(t)-a)}function l(e,t){var i,r,o=lt,s=o,a=0,l=1,u=t+1-e,c=n(e);for(i=1;st>=i&&(a=u+l*a,ut(a)<lt&&(a=lt),s=u+l/s,ut(s)<lt&&(s=lt),a=1/a,r=s*a,o*=r,!(ut(r-1)<at));i++)u+=2,l=-i*(i-e);return o*Math.exp(-t-c+e*Math.log(t))}function u(e,t,n,r){return r?s(t,e/n):Math.pow(e/n,t-1)*Math.exp(-e/n)/(n*i(t))}function c(e,t,n){var i,r,o,s,a,l;if(0===e)return 0;if(1==e)return 1/0;for(i=0,r=10,o=0,s=t*n,s>1&&(r*=s),a=0;st>a&&(o=.5*(i+r),l=u(o,t,n,!0),!(ut(e-l)<1e-16));a++)l>e?r=o:i=o;return o}function h(t,n){return n?.5+.5*e(t/Math.sqrt(2)):Math.exp(-t*t/2)/Math.sqrt(2*Math.PI)}function d(e){var t,n,i=[-39.69683028665376,220.9460984245205,-275.9285104469687,138.357751867269,-30.66479806614716,2.506628277459239],r=[-54.47609879822406,161.5858368580409,-155.6989798598866,66.80131188771972,-13.28068155288572],o=[-.007784894002430293,-.3223964580411365,-2.400758277161838,-2.549732539343734,4.374664141464968,2.938163982698783],s=[.007784695709041462,.3224671290700398,2.445134137142996,3.754408661907416],a=.02425,l=1-a;return a>e?(t=Math.sqrt(-2*Math.log(e)),(((((o[0]*t+o[1])*t+o[2])*t+o[3])*t+o[4])*t+o[5])/((((s[0]*t+s[1])*t+s[2])*t+s[3])*t+1)):e>l?(t=Math.sqrt(-2*Math.log(1-e)),-(((((o[0]*t+o[1])*t+o[2])*t+o[3])*t+o[4])*t+o[5])/((((s[0]*t+s[1])*t+s[2])*t+s[3])*t+1)):(t=e-.5,n=t*t,(((((i[0]*n+i[1])*n+i[2])*n+i[3])*n+i[4])*n+i[5])*t/(((((r[0]*n+r[1])*n+r[2])*n+r[3])*n+r[4])*n+1))}function f(e,t,n,i){return i?h((e-t)/n,!0):Math.exp(-(e-t)*(e-t)/(2*n*n))/(n*Math.sqrt(2*Math.PI))}function p(e,t,n){return t+n*d(e)}function m(e,t,n){return Math.exp((t-1)*Math.log(e)+(n-1)*Math.log(1-e)-r(t,n))}function g(e,t,n){var i=Math.exp(t*Math.log(e)+n*Math.log(1-e)-r(t,n));return(t+1)/(t+n+2)>e?i*v(t,n,e)/t:1-i*v(n,t,1-e)/n}function v(e,t,n){var i,r,o,s,a,l=e+t,u=e+1,c=e-1,h=1,d=1-l*n/u;for(ut(d)<lt&&(d=lt),d=1/d,a=d,i=1;st>=i&&(r=2*i,o=i*(t-i)*n/((c+r)*(e+r)),d=1+o*d,ut(d)<lt&&(d=lt),h=1+o/h,ut(h)<lt&&(h=lt),d=1/d,a*=d*h,o=-(e+i)*(l+i)*n/((e+r)*(u+r)),d=1+o*d,ut(d)<lt&&(d=lt),h=1+o/h,ut(h)<lt&&(h=lt),d=1/d,s=d*h,a*=s,!(ut(s-1)<at));i++);return a}function b(e,t,n){var i,r,o=0,s=1,a=0;for(i=0;st>i&&(a=.5*(o+s),r=g(a,t,n),!(ut(e-r)<at));i++)r>e?s=a:o=a;return a}function w(e,t,n,i,r){return g((e-i)/(r-i),t,n)}function y(e,t,n,i,r,o){return i?g((e-r)/(o-r),t,n):m((e-r)/(o-r),t,n)/(o-r)}function _(e,t,n,i,r){return i+(r-i)*b(e,t,n)}function x(e,t,n){return u(e,t/2,2,n)}function k(e,t){return 1-x(e,t,!0)}function C(e,t){return c(e,t/2,2)}function F(e,t){return C(1-e,t)}function R(e,t){var n,i,r,o,s,a=e.length,l=e[0].length,u=0;for(n=0;a>n;n++)for(i=0;l>i;i++)r=t[n][i],o=e[n][i]-r,o*=o,u+=o/r;return s=(a-1)*(l-1),k(u,s)}function S(e,t,n){return n?1-Math.exp(-t*e):t*Math.exp(-t*e)}function A(e,t,n){var i,r;if(n)return 1-x(2*t,2*(e+1),!0);for(i=0,r=2;e>=r;r++)i+=Math.log(r);return Math.exp(e*Math.log(t)-t-i)}function M(e,t,n,i){if(i)return g(t*e/(n+t*e),t/2,n/2);var r=t/n;return t/=2,n/=2,r/o(t,n)*Math.pow(r*e,t-1)/Math.pow(1+r*e,t+n)}function E(e,t,n){return 1-M(e,t,n,!0)}function D(e,t,n){return n/t*(1/_(e,n/2,t/2,0,1)-1)}function T(e,t,n){return n/t*(1/_(1-e,n/2,t/2,0,1)-1)}function B(e){var t,n=0,i=e.length;for(t=0;i>t;t++)n+=e[t];return n/i}function L(e,t){var n,i,r=0,o=e.length;for(n=0;o>n;n++)i=e[n]-t,r+=i*i;return r/(o-1)}function N(e,t){var n=e.length-1,i=t.length-1,r=L(e,B(e)),o=L(t,B(t));if(!r||!o)throw new Ze("DIV/0");return 2*M(r/o,n,i,!0)}function I(e){return.5*Math.log((1+e)/(1-e))}function z(e){var t=Math.exp(2*e);return(t-1)/(t+1)}function P(e,t,n){return n?1-.5*g(t/(e*e+t),t/2,.5):1/(Math.sqrt(t)*o(.5,t/2))*Math.pow(1+e*e/t,-(t+1)/2)}function $(e,t){return 1-P(e,t,!0)}function H(e,t){return 0>e&&(e=-e),2*$(e,t)}function O(e,t){var n=b(2*Math.min(e,1-e),t/2,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}function V(e,t){return O(1-e/2,t)}function U(e,t,n,i){var r,o,s,a,l,u,c,h,d,f,p,m,g,v,b,w,y=e.length,_=t.length;if(1==i){for(s=0,a=0,l=0;y>l;l++)u=e[l]-t[l],s+=u,a+=u*u;return c=s/y,r=c/Math.sqrt((a-s*c)/(y*(y-1))),1==n?$(r,y-1):H(r,y-1)}return h=B(e),d=B(t),f=L(e,h),p=L(t,d),3==i?(m=f/y,g=p/_,v=m+g,b=m/v,w=g/v,o=1/(b*b/(y-1)+w*w/(_-1)),r=ut(h-d)/Math.sqrt(v),1==n?$(r,o):H(r,o)):(o=y+_-2,r=ut(h-d)*Math.sqrt(o*y*_/((y+_)*((y-1)*f+(_-1)*p))),1==n?$(r,o):H(r,o))}function j(e,t,n){return-O(e/2,n-1)*t/Math.sqrt(n)}function W(e,t,n){return-d(e/2)*t/Math.sqrt(n)}function q(e){return h(e,!0)-.5}function J(e){return h(e)}function K(t,n,i,r){if(r)return.5+.5*e((Math.log(t)-n)/(i*Math.sqrt(2)));var o=Math.log(t)-n;return Math.exp(-o*o/(2*i*i))/(t*i*Math.sqrt(2*Math.PI))}function G(e,t,n){return Math.exp(p(e,t,n))}function Y(e,t,n,i){var r,o,s,a=e.length,l=0;for(r=0;a>r;r++){if(0>=t[r]||t[r]>1)throw new Ze("NUM");l+=t[r]}if(1!=l)throw new Ze("NUM");for(o=0,r=0;a>r;r++)s=e[r],s>=n&&i>=s&&(o+=t[r]);return o}function Q(e,t){var n,i,r,o=B(t),s=B(e),a=0,l=0;for(n=0,i=e.length;i>n;n++)r=t[n]-o,a+=r*(e[n]-s),l+=r*r;return a/l}function X(e,t){var n,i,r,o=B(t),s=B(e),a=0,l=0;for(n=0,i=e.length;i>n;n++)r=t[n]-o,a+=r*(e[n]-s),l+=r*r;return s-a*o/l}function Z(e,t){var n,i,r,o,s=B(e),a=B(t),l=0,u=0,c=0;for(n=0,i=e.length;i>n;n++)r=e[n]-s,o=t[n]-a,l+=r*o,u+=r*r,c+=o*o;return l/Math.sqrt(u*c)}function ee(e,t){var n=Z(e,t);return n*n}function te(e,t){var n,i,r,o=t.length,s=B(t),a=B(e),l=0,u=0,c=0;for(n=0;o>n;n++)i=t[n]-s,r=e[n]-a,l+=r*r,u+=i*r,c+=i*i;return Math.sqrt((l-u*u/c)/(o-2))}function ne(e,t,n){var i,r,o,s,a,l,u=B(n),c=B(t),h=0,d=0;for(i=0,r=n.length;r>i;i++)o=n[i]-u,s=t[i]-c,h+=o*s,d+=o*o;if(0===d)throw new Ze("N/A");return a=h/d,l=c-a*u,l+a*e}function ie(e){var t,n=e.height,i=0;for(t=0;n>t;t++)i+=e.data[t][0];return i/n}function re(e,t){var n,i,r=e.height,o=0;for(n=0;r>n;n++)i=e.data[n][0]-t,o+=i*i;return o}function oe(e,t,n,i){var r,o,s,a,l,u,c,h,d,f,p,m,g,v,b,w,y,_,x=0;for(t||(t=e.map(function(){return++x})),n&&(t=t.clone(),t.eachRow(function(e){t.data[e].unshift(1)}),++t.width),r=t.transpose(),o=r.multiply(t).inverse().multiply(r).multiply(e),s=[],x=o.height-1;x>=0;x--)s.push(o.data[x][0]);if(n||s.push(0),!i)return this.asMatrix([s]);for(a=t.multiply(o),l=e.adds(a,!0),u=n?ie(a):0,c=re(a,u),h=n?ie(l):0,d=re(l,h),f=[],f.push(c,d),p=c/(c+d),m=e.height-t.width,g=Math.sqrt(d/m),v=[],v.push(p,g),b=n?c/(t.width-1)/(d/m):p/t.width/((1-p)/m),w=[],w.push(b,m),y=r.multiply(t).inverse(),_=[],x=y.height-1;x>=0;x--)_.push(Math.sqrt(y.data[x][x]*d/m));return this.asMatrix([s,_,v,w,f])}function se(e,t,n,i){return oe.call(this,e.map(Math.log),t,n,i).map(Math.exp)}function ae(e,t,n,i){var r,o,s=0;return t||(t=e.map(function(){return++s})),i&&(t=t.clone(),t.eachRow(function(e){t.data[e].unshift(1)}),++t.width),r=t.transpose(),o=r.multiply(t).inverse().multiply(r).multiply(e),n?i&&(n=n.clone(),n.eachRow(function(e){n.data[e].unshift(1)}),++n.width):n=t,n.multiply(o)}function le(e,t,n,i){return ae.call(this,e.map(Math.log),t,n,i).map(Math.exp)}function ue(e,t,n,i){var r,o,s,a,l,u=n||20,c=i||1e-7,h=t;for(r=1;u>=r;r++)if(o=e(h),s=o[0],a=o[1],l=s/a,h-=l,Math.abs(l)<c)return h;return new Ze("NUM")}function ce(e,t,n,i,r){var o=Math.pow(1+e,t),s=e?(o-1)/e:t;return-(i*o+n*s*(1+e*r))}function he(e,t,n,i,r){if(!e)return-i-n*t;var o=Math.pow(1+e,t);return-(i+n*(o-1)/e*(1+e*r))/o}function de(e,t,n,i,r){if(!e)return-(i+n)/t;var o=Math.pow(1+e,t);return-e*(i+n*o)/((1+e*r)*(o-1))}function fe(e,t,n,i,r){if(!e)return-(i+n)/t;var o=t*(1+e*r);return Math.log((o-i*e)/(o+n*e))/Math.log(1+e)}function pe(e,t,n,i,r,o){function s(o){var s=Math.pow(1+o,e-1),a=s*(1+o);return[n*a+t*(1/o+r)*(a-1)+i,e*n*s+t*(-(a-1)/(o*o)+(1/o+r)*e*s)]}return ue(s,o)}function me(e,t,n,i,r,o){var s,a;return 1==o&&1==t?0:(s=de(e,n,i,r,o),a=ce(e,t-1,s,i,o)*e,o?a/(1+e):a)}function ge(e,t,n,i,r,o){var s=de(e,n,i,r,o);return s-me(e,t,n,i,r,o)}function ve(e,t,n,i,r,o){var s,a,l,u,c,h;return 1==o&&(i--,r--),s=Math.pow(1+e,t),a=Math.pow(1+e,i-1),l=Math.pow(1+e,r),u=e*n*s/(s-1),c=a*n-(a-1)/e*u,h=l*n-(l-1)/e*u,h-c}function be(e,t,n,i,r,o){var s,a=0;for(s=i;r>=s;s++)a+=me(e,s,t,n,0,o);return a}function we(e,t){var n,i,r=0;for(n=0,i=t.length;i>n;n++)r+=t[n]*Math.pow(1+e,-n-1);return r}function ye(e,t){function n(t){var n,i,r=0,o=0;for(n=0,i=e.length;i>n;n++)r+=e[n]*Math.pow(1+t,-n-1),o+=-n*e[n]*Math.pow(1+t,-n-2);return[r,o]}return ue(n,t)}function _e(e,t){return Math.pow(1+e/t,t)-1}function xe(e,t){return t*(Math.pow(e+1,1/t)-1)}function ke(e,t,n){var i,r,o=0;for(i=0,r=t.length;r>i;i++)o+=t[i]*Math.pow(1+e,(n[0]-n[i])/365);return o}function Ce(e,t,n){function i(n){var i,r,o,s=e[0],a=0;for(i=1,r=e.length;r>i;i++)o=(t[0]-t[i])/365,s+=e[i]*Math.pow(1+n,o),a+=o*e[i]*Math.pow(1+n,o-1);return[s,a]}return ue(i,n)}function Fe(e,t,n,i){var r=-i*e;return r*(1-t/n)}function Re(e,t,n,i,r){var o,s,a=1-Math.pow(t/e,1/n);if(a=Math.floor(1e3*a+.5)/1e3,o=e*a*r/12,1==i)return o;for(s=1;n>s;s++){if(s==i-1)return(e-o)*a;o+=(e-o)*a}return(e-o)*a*(12-r)/12}function Se(e,t,n,i,r){var o=r/n,s=-e*(Math.pow(1-o,i-1)-1),a=(e-s)*o;return a=Math.min(a,Math.max(0,e-s-t))}function Ae(e,t,n){return(e-t)/n}function Me(e,t,n,i){return(e-t)*(n-i+1)*2/(n*(n+1))}function Ee(e,t,n,i,r,o,s){function a(e,n){var i,r,o;return r=1==f?1==n?e:0:e*Math.pow(1-f,n-1),o=e*Math.pow(1-f,n),i=t>o?r-t:r-o,0>i?0:i}function l(e,n,i){var r,o,s,l=e-t,u=Math.ceil(i),c=0,h=0,d=!1;for(o=1;u>=o;o++)d?r=c:(s=a(e,o),c=l/(n-o+1),c>s?(r=c,d=!0):(r=s,l-=s)),o==u&&(r*=i+1-u),h+=r;return h}var u,c,h,d,f=o>=n?1:o/n,p=Math.floor(i),m=Math.ceil(r),g=0;if(s)for(u=p+1;m>=u;u++)c=a(e,u),u==p+1?c*=Math.min(r,p+1)-i:u==m&&(c*=r+1-m),g+=c;else h=n,i!=Math.floor(i)&&o>1&&i>=n/2&&(d=i-n/2,i=n/2,r-=d,h+=1),e-=l(e,h,i),g=l(e,n-i,r-i);return g}function De(e,t){var n=tt(e),i=n.month+t,r=n.year+Math.floor(i/12);return i%=12,0>i&&(i+=12),n=Math.min(n.date,it(r,i)),et(r,i,n)}function Te(e,t,n){return 1==n||2==n||3==n?t-e:rt(e,t,n)}function Be(e,t,n){var i,r,o,s=tt(e),a=tt(t),l=a.year-s.year;l>0&&(l=(l-1)*n),o=12/n;do l++,i=De(t,-l*o);while(i>e);return l--,r=De(t,-l*o),[i,r]}function Le(e,t,n){var i,r,o,s=tt(t),a=tt(e),l=s.year-a.year;for(l>0&&(l=(l-1)*n),i=e,o=12/n;t>i;)r=i,l++,i=De(e,l*o);return[r,i]}function Ne(e,t,n,i){var r=Be(e,t,n)[0];return Te(r,e,i)}function Ie(e,t,n,i){if(1==i){var r=Be(e,t,n);return Te(r[0],r[1],1)}return 3==i?365/n:360/n}function ze(e,t,n,i){var r=Be(e,t,n)[1];return Te(e,r,i)}function Pe(e,t,n){return Be(e,t,n)[0]}function $e(e,t,n){return Be(e,t,n)[1]}function He(e,t,n){var i=tt(e),r=tt(t),o=12*(r.year-i.year)+r.month-i.month;return 1+(o*n/12|0)}function Oe(e,t){return 3==t?365:1==t?nt(e)?366:365:360}function Ve(e,t,n,i,r){var o=Oe(tt(t).year,r);return n*i*Te(e,t,r)/o}function Ue(e,t,n,i,r,o,s,a){function l(e,t){return(t-e)*o/v|0}var u,c,h,d,f,p,m=0,g=r*i/o,v=s%2===0?360:365;return t>=n?(u=Be(n,t,o),c=u[0],h=u[1],e>=c?g*Te(e,n,s)/Te(c,h,s):(u=Be(e,c,o),d=u[0],f=u[1],p=l(f,n),g*(p+Te(e,f,s)/Te(d,f,s)+(h>n?Te(c,n,s)/Te(c,h,s):0)))):(u=Le(t,n,o),c=u[0],h=u[1],p=l(t,n),m=h==n?g*p:g*(p+Te(c,n,s)/Te(c,h,s)),a?(u=Be(e,t,o),c=u[0],h=u[1],p=l(e,t),m+=g*(p+Te(e,h,s)/Te(c,h,s))):m)}function je(e,t,n,i,r){var o=r%2===0?360:nt(tt(e).year)?366:365;return(i-n)/i*o/Te(e,t,r)}function We(e,t,n,i,r){var o=r%2===0?360:nt(tt(e).year)?366:365;return(i-n)/n*o/Te(e,t,r)}function qe(e,t,n,i,r){var o=r%2===0?360:nt(tt(e).year)?366:365;return n/(1-i*Te(e,t,r)/o)}function Je(e,t,n,i,r,o,s){var a=1+((t-e)*o/(s%2===0?360:365)|0),l=Be(e,t,o),u=l[0],c=l[1],h=Te(u,e,s),d=Te(e,c,s),f=Te(u,c,s),p=100*n/o,m=i/o,g=d/f;return 1==a?(r+p)/(1+g*m)-h/f*p:r/Math.pow(1+m,a-1+g)+p*Math.pow(1+m,1-a-g)*(Math.pow(1+m,a)-1)/m-h/f*p}function Ke(e,t,n,i,r){var o=Te(e,t,r),s=Oe(tt(t).year,r);return i-n*i*o/s}var Ge,Ye,Qe,Xe,Ze,et,tt,nt,it,rt,ot,st,at,lt,ut;kendo.support.browser.msie&&kendo.support.browser.version<9||(Ge=kendo.spreadsheet,Ye=Ge.calc,Qe=Ye.runtime,Xe=Qe.defineFunction,Ze=Qe.CalcError,et=Qe.packDate,tt=Qe.unpackDate,nt=Qe.isLeapYear,it=Qe.daysInMonth,rt=Qe._days_360,Xe("ERF",function(t,n){return null==n?e(t):e(n)-e(t)}).args([["lower_limit","number"],["upper_limit",["or","number","null"]]]),Xe("ERFC",t).args([["x","number"]]),Xe("GAMMALN",n).args([["x","number++"]]),Xe("GAMMA",i).args([["x","number"]]),Xe("GAMMA.DIST",u).args([["x","number+"],["alpha","number++"],["beta","number++"],["cumulative","logical"]]),Xe("GAMMA.INV",c).args([["p",["and","number",["[between]",0,1]]],["alpha","number++"],["beta","number++"]]),Xe("NORM.S.DIST",h).args([["z","number"],["cumulative","logical"]]),Xe("NORM.S.INV",d).args([["p",["and","number",["[between]",0,1]]]]),Xe("NORM.DIST",f).args([["x","number"],["mean","number"],["stddev","number++"],["cumulative","logical"]]),Xe("NORM.INV",p).args([["p",["and","number",["[between]",0,1]]],["mean","number"],["stddev","number++"]]),Xe("BETADIST",w).args([["x","number"],["alpha","number++"],["beta","number++"],["A",["or","number",["null",0]]],["B",["or","number",["null",1]]],["?",["assert","$x >= $A","NUM"]],["?",["assert","$x <= $B","NUM"]],["?",["assert","$A < $B","NUM"]]]),Xe("BETA.DIST",y).args([["x","number"],["alpha","number++"],["beta","number++"],["cumulative","logical"],["A",["or","number",["null",0]]],["B",["or","number",["null",1]]],["?",["assert","$x >= $A","NUM"]],["?",["assert","$x <= $B","NUM"]],["?",["assert","$A < $B","NUM"]]]),Xe("BETA.INV",_).args([["p",["and","number",["[between]",0,1]]],["alpha","number++"],["beta","number++"],["A",["or","number",["null",0]]],["B",["or","number",["null",1]]]]),Xe("CHISQ.DIST",x).args([["x","number+"],["deg_freedom","integer++"],["cumulative","logical"]]),Xe("CHISQ.DIST.RT",k).args([["x","number+"],["deg_freedom","integer++"]]),Xe("CHISQ.INV",C).args([["p",["and","number",["[between]",0,1]]],["deg_freedom","integer++"]]),Xe("CHISQ.INV.RT",F).args([["p",["and","number",["[between]",0,1]]],["deg_freedom","integer++"]]),Xe("CHISQ.TEST",function(e,t){return R(e.data,t.data)}).args([["actual_range","matrix"],["expected_range","matrix"],["?",["assert","$actual_range.width == $expected_range.width"]],["?",["assert","$actual_range.height == $expected_range.height"]]]),
  Xe("EXPON.DIST",S).args([["x","number+"],["lambda","number++"],["cumulative","logical"]]),Xe("POISSON.DIST",A).args([["x","integer+"],["mean","number+"],["cumulative","logical"]]),Xe("F.DIST",M).args([["x","number+"],["deg_freedom1","integer++"],["deg_freedom2","integer++"],["cumulative","logical"]]),Xe("F.DIST.RT",E).args([["x","number+"],["deg_freedom1","integer++"],["deg_freedom2","integer++"]]),Xe("F.INV",T).args([["p",["and","number",["[between]",0,1]]],["deg_freedom1","integer++"],["deg_freedom2","integer++"]]),Xe("F.INV.RT",D).args([["p",["and","number",["[between]",0,1]]],["deg_freedom1","integer++"],["deg_freedom2","integer++"]]),Xe("F.TEST",N).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array1.length >= 2","DIV/0"]],["?",["assert","$array2.length >= 2","DIV/0"]]]),Xe("FISHER",I).args([["x",["and","number",["(between)",-1,1]]]]),Xe("FISHERINV",z).args([["y","number"]]),Xe("T.DIST",P).args([["x","number"],["deg_freedom","integer++"],["cumulative","logical"]]),Xe("T.DIST.RT",$).args([["x","number"],["deg_freedom","integer++"]]),Xe("T.DIST.2T",H).args([["x","number+"],["deg_freedom","integer++"]]),Xe("T.INV",O).args([["p",["and","number",["(between]",0,1]]],["deg_freedom","integer++"]]),Xe("T.INV.2T",V).args([["p",["and","number",["(between]",0,1]]],["deg_freedom","integer++"]]),Xe("T.TEST",U).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["tails",["and","integer",["values",1,2]]],["type",["and","integer",["values",1,2,3]]],["?",["assert","$type != 1 || $array1.length == $array2.length","N/A"]],["?",["assert","$array1.length >= 2","DIV/0"]],["?",["assert","$array2.length >= 2","DIV/0"]]]),Xe("CONFIDENCE.T",j).args([["alpha",["and","number",["(between)",0,1]]],["standard_dev","number++"],["size",["and","integer++",["assert","$size != 1","DIV/0"]]]]),Xe("CONFIDENCE.NORM",W).args([["alpha",["and","number",["(between)",0,1]]],["standard_dev","number++"],["size",["and","integer++"]]]),Xe("GAUSS",q).args([["z","number"]]),Xe("PHI",J).args([["x","number"]]),Xe("LOGNORM.DIST",K).args([["x","number++"],["mean","number"],["standard_dev","number++"],["cumulative","logical"]]),Xe("LOGNORM.INV",G).args([["probability",["and","number",["(between)",0,1]]],["mean","number"],["standard_dev","number++"]]),Xe("PROB",Y).args([["x_range",["collect","number",1]],["prob_range",["collect","number",1]],["lower_limit","number"],["upper_limit",["or","number",["null","$lower_limit"]]],["?",["assert","$prob_range.length == $x_range.length","N/A"]]]),Xe("SLOPE",Q).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]]]),Xe("INTERCEPT",X).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]]]),Xe("PEARSON",Z).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array2.length == $array1.length","N/A"]],["?",["assert","$array2.length > 0 && $array1.length > 0","N/A"]]]),Xe("RSQ",ee).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]],["?",["assert","$known_x.length != 1 && $known_y.length != 1","N/A"]]]),Xe("STEYX",te).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length >= 3 && $known_y.length >= 3","DIV/0"]]]),Xe("FORECAST",ne).args([["x","number"],["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]]]),Xe("LINEST",oe).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]],["stats",["or","logical",["null",!1]]]]),Xe("LOGEST",se).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]],["stats",["or","logical",["null",!1]]]]),Xe("TREND",ae).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["new_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]]]),Xe("GROWTH",le).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["new_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]]]),Xe("FV",ce).args([["rate","number"],["nper","number"],["pmt",["or","number",["null",0]]],["pv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$pmt || $pv"]]]),Xe("PV",he).args([["rate","number"],["nper","number"],["pmt",["or","number",["null",0]]],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$pmt || $fv"]]]),Xe("PMT",de).args([["rate","number"],["nper","number"],["pmt","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]]]),Xe("NPER",fe).args([["rate","number"],["pmt","number"],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]]]),Xe("RATE",pe).args([["nper","number"],["pmt",["or","number",["null",0]]],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["guess",["or","number++",["null",.01]]],["?",["assert","$pmt || $fv"]]]),Xe("IPMT",me).args([["rate","number"],["per","number++"],["nper","number++"],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$per >= 1 && $per <= $nper"]]]),Xe("PPMT",ge).args([["rate","number"],["per","number++"],["nper","number++"],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$per >= 1 && $per <= $nper"]]]),Xe("CUMPRINC",ve).args([["rate","number++"],["nper","number++"],["pv","number++"],["start_period","number++"],["end_period","number++"],["type",["or",["values",0,1],["null",0]]],["?",["assert","$end_period >= $start_period","NUM"]]]),Xe("CUMIPMT",be).args([["rate","number++"],["nper","number++"],["pv","number++"],["start_period","number++"],["end_period","number++"],["type",["or",["values",0,1],["null",0]]],["?",["assert","$end_period >= $start_period","NUM"]]]),Xe("NPV",we).args([["rate","number"],["values",["collect","number"]],["?",["assert","$values.length > 0","N/A"]]]),Xe("IRR",ye).args([["values",["collect","number",1]],["guess",["or","number",["null",.1]]]]),Xe("EFFECT",_e).args([["nominal_rate","number++"],["npery","integer++"]]),Xe("NOMINAL",xe).args([["effect_rate","number++"],["npery","integer++"]]),Xe("XNPV",ke).args([["rate","number"],["values",["collect","number",1]],["dates",["collect","date",1]],["?",["assert","$values.length == $dates.length","NUM"]]]),Xe("XIRR",Ce).args([["values",["collect","number",1]],["dates",["collect","date",1]],["guess",["or","number",["null",.1]]],["?",["assert","$values.length == $dates.length","NUM"]]]),Xe("ISPMT",Fe).args([["rate","number"],["per","number++"],["nper","number++"],["pv","number"],["?",["assert","$per >= 1 && $per <= $nper"]]]),Xe("DB",Re).args([["cost","number"],["salvage","number"],["life","number++"],["period","number++"],["month",["or","number",["null",12]]]]),Xe("DDB",Se).args([["cost","number"],["salvage","number"],["life","number++"],["period","number++"],["factor",["or","number",["null",2]]]]),Xe("SLN",Ae).args([["cost","number"],["salvage","number"],["life","number++"]]),Xe("SYD",Me).args([["cost","number"],["salvage","number"],["life","number++"],["per","number++"]]),Xe("VDB",Ee).args([["cost","number+"],["salvage","number+"],["life","number++"],["start_period","number+"],["end_period","number+"],["factor",["or","number+",["null",2]]],["no_switch",["or","logical",["null",!1]]],["?",["assert","$end_period >= $start_period","NUM"]]]),ot=[["settlement","date"],["maturity","date"],["frequency",["and","integer",["values",1,2,4]]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]],Xe("COUPDAYBS",Ne).args(ot),Xe("COUPDAYS",Ie).args(ot),Xe("COUPDAYSNC",ze).args(ot),Xe("COUPPCD",Pe).args(ot),Xe("COUPNCD",$e).args(ot),Xe("COUPNUM",He).args(ot),Xe("ACCRINTM",Ve).args([["issue","date"],["settlement","date"],["rate","number++"],["par",["or",["null",1e3],"number++"]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$issue < $settlement","NUM"]]]),Xe("ACCRINT",Ue).args([["issue","date"],["first_interest","date"],["settlement","date"],["rate","number++"],["par",["or",["null",1e3],"number++"]],["frequency",["and","integer",["values",1,2,4]]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["calc_method",["or","logical",["null",!0]]],["?",["assert","$issue < $settlement","NUM"]]]),Xe("DISC",je).args([["settlement","date"],["maturity","date"],["pr","number++"],["redemption","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]),Xe("INTRATE",We).args([["settlement","date"],["maturity","date"],["investment","number++"],["redemption","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]),Xe("RECEIVED",qe).args([["settlement","date"],["maturity","date"],["investment","number++"],["discount","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]),Xe("PRICE",Je).args([["settlement","date"],["maturity","date"],["rate","number++"],["yld","number++"],["redemption","number++"],["frequency",["and","integer",["values",1,2,4]]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]),Xe("PRICEDISC",Ke).args([["settlement","date"],["maturity","date"],["discount","number++"],["redemption","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]),st=300,at=2.2204e-16,lt=1e-30,ut=Math.abs)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/borderpalette.min",["kendo.core.min","kendo.colorpicker.min","kendo.popup.min"],e)}(function(){!function(e){var t,n,i,r,o;e.support.browser.msie&&9>e.support.browser.version||(t=e.jQuery,n=["allBorders","insideBorders","insideHorizontalBorders","insideVerticalBorders","outsideBorders","leftBorder","topBorder","rightBorder","bottomBorder","noBorders"],i=e.spreadsheet.messages.borderPalette={allBorders:"All borders",insideBorders:"Inside borders",insideHorizontalBorders:"Inside horizontal borders",insideVerticalBorders:"Inside vertical borders",outsideBorders:"Outside borders",leftBorder:"Left border",topBorder:"Top border",rightBorder:"Right border",bottomBorder:"Bottom border",noBorders:"No border",reset:"Reset color",customColor:"Custom color...",apply:"Apply",cancel:"Cancel"},r=e.ui.Widget.extend({init:function(t,n){e.ui.Widget.call(this,t,n),this.element=t,this.color=n.color,this._resetButton(),this._colorPalette(),this._customColorPalette(),this._customColorButton(),this.resetButton.on("click",this.resetColor.bind(this)),this.customColorButton.on("click",this.customColor.bind(this))},options:{name:"ColorChooser"},events:["change"],destroy:function(){e.unbind(this.dialog.element.find(".k-action-buttons")),this.dialog.destroy(),this.colorPalette.destroy(),this.resetButton.off("click"),this.customColorButton.off("click")},value:function(e){return void 0===e?this.color:(this.color=e,this.customColorButton.find(".k-icon").css("background-color",this.color),this.colorPalette.value(null),this.flatColorPicker.value(this.color),void 0)},_change:function(e){this.color=e,this.trigger("change",{value:e})},_colorPalette:function(){var e=t("<div />",{"class":"k-spreadsheet-color-palette"}),n=this.colorPalette=t("<div />").kendoColorPalette({palette:["#ffffff","#000000","#d6ecff","#4e5b6f","#7fd13b","#ea157a","#feb80a","#00addc","#738ac8","#1ab39f","#f2f2f2","#7f7f7f","#a7d6ff","#d9dde4","#e5f5d7","#fad0e4","#fef0cd","#c5f2ff","#e2e7f4","#c9f7f1","#d8d8d8","#595959","#60b5ff","#b3bcca","#cbecb0","#f6a1c9","#fee29c","#8be6ff","#c7d0e9","#94efe3","#bfbfbf","#3f3f3f","#007dea","#8d9baf","#b2e389","#f272af","#fed46b","#51d9ff","#aab8de","#5fe7d5","#a5a5a5","#262626","#003e75","#3a4453","#5ea226","#af0f5b","#c58c00","#0081a5","#425ea9","#138677","#7f7f7f","#0c0c0c","#00192e","#272d37","#3f6c19","#750a3d","#835d00","#00566e","#2c3f71","#0c594f"],value:this.color,change:function(e){this.customColorButton.find(".k-icon").css("background-color","transparent"),this.flatColorPicker.value(null),this._change(e.value)}.bind(this)}).data("kendoColorPalette");e.append(n.wrapper).appendTo(this.element)},_customColorPalette:function(){var n,r,o=t("<div />",{"class":"k-spreadsheet-window",html:"<div></div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>"+i.apply+"</button><button class='k-button' data-bind='click: close'>"+i.cancel+"</button></div>"}),s=this.dialog=o.appendTo(document.body).kendoWindow({animation:!1,scrollable:!1,resizable:!1,maximizable:!1,modal:!0,visible:!1,width:268,open:function(){this.center()}}).data("kendoWindow");s.one("activate",function(){this.element.find("[data-role=flatcolorpicker]").data("kendoFlatColorPicker")._hueSlider.resize()}),n=this.flatColorPicker=s.element.children().first().kendoFlatColorPicker().data("kendoFlatColorPicker"),r=e.observable({apply:function(){this.customColorButton.find(".k-icon").css("background-color",n.value()),this.colorPalette.value(null),this._change(n.value()),s.close()}.bind(this),close:function(){n.value(null),s.close()}}),e.bind(s.element.find(".k-action-buttons"),r)},_resetButton:function(){this.resetButton=t("<a class='k-button k-reset-color' href='#'><span class='k-icon k-font-icon k-i-reset-color'></span>"+i.reset+"</a>").appendTo(this.element)},_customColorButton:function(){this.customColorButton=t("<a class='k-button k-custom-color' href='#'><span class='k-icon'></span>"+i.customColor+"</a>").appendTo(this.element)},resetColor:function(){this.colorPalette.value(null),this.flatColorPicker.value(null),this._change(null)},customColor:function(){this.dialog.open()}}),o=e.ui.Widget.extend({init:function(t,n){e.ui.Widget.call(this,t,n),this.element=t,this.color="#000",this.element.addClass("k-spreadsheet-border-palette"),this._borderTypePalette(),this._borderColorPalette(),this.element.on("click",".k-spreadsheet-border-type-palette .k-button",this._click.bind(this))},options:{name:"BorderPalette"},events:["change"],destroy:function(){this.colorChooser.destroy(),this.element.off("click")},_borderTypePalette:function(){var r=i,o=n.map(function(t){return'<a title="'+r[t]+'" href="#" data-border-type="'+t+'" class="k-button k-button-icon"><span class="k-sprite k-font-icon k-icon k-i-'+e.toHyphens(t)+'"></span></a>'}).join(""),s=t("<div />",{"class":"k-spreadsheet-border-type-palette",html:o});s.appendTo(this.element)},_borderColorPalette:function(){var e=t("<div />",{"class":"k-spreadsheet-border-color-palette"});e.appendTo(this.element),this.colorChooser=new r(e,{color:this.color,change:this._colorChange.bind(this)})},_click:function(e){this.type=t(e.currentTarget).data("borderType"),this.trigger("change",{type:this.type,color:this.color})},_colorChange:function(e){this.color=e.value,this.type&&this.trigger("change",{type:this.type,color:this.color})}}),e.spreadsheet.ColorChooser=r,e.spreadsheet.BorderPalette=o)}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/toolbar.min",["kendo.toolbar.min","kendo.colorpicker.min","kendo.combobox.min","kendo.dropdownlist.min","kendo.popup.min","spreadsheet/borderpalette.min"],e)}(function(){!function(e){var t,n,i,r,o,s,a,l,u,c,h,d,f,p,m,g,v,b,w,y,_,x,k,C,F,R,S,A,M,E,D,T,B,L,N;e.support.browser.msie&&9>e.support.browser.version||(t=e.jQuery,n=e.ui.ToolBar,i=e.spreadsheet.messages.toolbar={addColumnLeft:"Add column left",addColumnRight:"Add column right",addRowAbove:"Add row above",addRowBelow:"Add row below",alignment:"Alignment",alignmentButtons:{justtifyLeft:"Align left",justifyCenter:"Center",justifyRight:"Align right",justifyFull:"Justify",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom"},backgroundColor:"Background",bold:"Bold",borders:"Borders",colorPicker:{reset:"Reset color",customColor:"Custom color..."},copy:"Copy",cut:"Cut",deleteColumn:"Delete column",deleteRow:"Delete row",filter:"Filter",fontFamily:"Font",fontSize:"Font size",format:"Custom format...",formatTypes:{automatic:"Automatic",number:"Number",percent:"Percent",financial:"Financial",currency:"Currency",date:"Date",time:"Time",dateTime:"Date time",duration:"Duration",moreFormats:"More formats..."},formatDecreaseDecimal:"Decrease decimal",formatIncreaseDecimal:"Increase decimal",freeze:"Freeze panes",freezeButtons:{freezePanes:"Freeze panes",freezeRows:"Freeze rows",freezeColumns:"Freeze columns",unfreeze:"Unfreeze panes"},italic:"Italic",merge:"Merge cells",mergeButtons:{mergeCells:"Merge all",mergeHorizontally:"Merge horizontally",mergeVertically:"Merge vertically",unmerge:"Unmerge"},open:"Open...",paste:"Paste",quickAccess:{redo:"Redo",undo:"Undo"},exportAs:"Export...",sortAsc:"Sort ascending",sortDesc:"Sort descending",sortButtons:{sortSheetAsc:"Sort sheet A to Z",sortSheetDesc:"Sort sheet Z to A",sortRangeAsc:"Sort range A to Z",sortRangeDesc:"Sort range Z to A"},textColor:"Text Color",textWrap:"Wrap text",underline:"Underline",validation:"Data validation..."},r={home:["open","exportAs",["cut","copy","paste"],["bold","italic","underline"],"backgroundColor","textColor","borders","fontSize","fontFamily","alignment","textWrap",["formatDecreaseDecimal","formatIncreaseDecimal"],"format","merge","freeze","filter"],insert:[["addColumnLeft","addColumnRight","addRowBelow","addRowAbove"],["deleteColumn","deleteRow"]],data:["sort","filter","validation"]},o={open:{type:"open",overflow:"never",iconClass:"xlsa"},exportAs:{type:"exportAsDialog",dialogName:"exportAs",overflow:"never",text:"",iconClass:"xlsa"},bold:{type:"button",command:"PropertyChangeCommand",property:"bold",value:!0,iconClass:"bold",togglable:!0},italic:{type:"button",command:"PropertyChangeCommand",property:"italic",value:!0,iconClass:"italic",togglable:!0},underline:{type:"button",command:"PropertyChangeCommand",property:"underline",value:!0,iconClass:"underline",togglable:!0},formatDecreaseDecimal:{type:"button",command:"AdjustDecimalsCommand",value:-1,iconClass:"decrease-decimal"},formatIncreaseDecimal:{type:"button",command:"AdjustDecimalsCommand",value:1,iconClass:"increase-decimal"},textWrap:{type:"button",command:"TextWrapCommand",property:"wrap",value:!0,iconClass:"text-wrap",togglable:!0},cut:{type:"button",command:"ToolbarCutCommand",iconClass:"cut"},copy:{type:"button",command:"ToolbarCopyCommand",iconClass:"copy"},paste:{type:"button",command:"ToolbarPasteCommand",iconClass:"paste"},separator:{type:"separator"},alignment:{type:"alignment",iconClass:"justify-left"},backgroundColor:{type:"colorPicker",property:"background",iconClass:"background"},textColor:{type:"colorPicker",property:"color",iconClass:"text"},fontFamily:{type:"fontFamily",property:"fontFamily",iconClass:"text"},fontSize:{type:"fontSize",property:"fontSize",iconClass:"font-size"},format:{type:"format",property:"format",iconClass:"format-number"},filter:{type:"filter",property:"hasFilter",iconClass:"filter"},merge:{type:"merge",iconClass:"merge-cells"},freeze:{type:"freeze",iconClass:"freeze-panes"},borders:{type:"borders",iconClass:"all-borders"},formatCells:{type:"dialog",dialogName:"formatCells",overflow:"never"},addColumnLeft:{type:"button",command:"AddColumnCommand",value:"left",iconClass:"add-column-left"},addColumnRight:{type:"button",command:"AddColumnCommand",value:"right",iconClass:"add-column-right"},addRowBelow:{type:"button",command:"AddRowCommand",value:"below",iconClass:"add-row-below"},addRowAbove:{type:"button",command:"AddRowCommand",value:"above",iconClass:"add-row-above"},deleteColumn:{type:"button",command:"DeleteColumnCommand",iconClass:"delete-column"},deleteRow:{type:"button",command:"DeleteRowCommand",iconClass:"delete-row"},sort:{type:"sort",iconClass:"sort-desc"},validation:{type:"dialog",dialogName:"validation",iconClass:"exception",overflow:"never"}},s=n.extend({init:function(e,t){t.items=this._expandTools(t.tools||s.prototype.options.tools[t.toolbarName]),n.fn.init.call(this,e,t);var i=this._click.bind(this);this.element.addClass("k-spreadsheet-toolbar"),this._addSeparators(this.element),this.bind({click:i,toggle:i})},_addSeparators:function(e){var t=e.children(".k-widget, a.k-button, .k-button-group");t.before("<span class='k-separator' />")},_expandTools:function(e){function n(e){var r=t.isPlainObject(e)?e:o[e]||{},s="k-icon k-font-icon k-i-"+r.iconClass,a=r.type,l={splitButton:{spriteCssClass:s},button:{showText:"overflow"},colorPicker:{toolIcon:s}},u=t.extend({name:r.name||e,text:i[r.name||e],spriteCssClass:s,attributes:{title:i[r.name||e]}},l[a],r);return"splitButton"==a&&(u.menuButtons=u.menuButtons.map(n)),u.attributes["data-tool"]=e,r.property&&(u.attributes["data-property"]=r.property),u}return e.reduce(function(e,i){return e.push(t.isArray(i)?{type:"buttonGroup",buttons:i.map(n)}:n.call(this,i)),e},[])},_click:function(e){var t,n=e.target.attr("data-tool"),i=o[n]||{},r=i.command;r&&(t={command:r,options:{property:i.property||null,value:i.value||null}},"boolean"==typeof t.options.value&&(t.options.value=e.checked?!0:null),this.action(t))},events:["click","toggle","open","close","overflowOpen","overflowClose","action","dialog"],options:{name:"SpreadsheetToolBar",resizable:!0,tools:r},action:function(e){this.trigger("action",e)},dialog:function(e){this.trigger("dialog",e)},refresh:function(t){function n(e,t){var n,i=e.toolbar,r=e.overflow,o=i&&i.options.togglable||r&&r.options.togglable;o&&(n=!1,"boolean"==typeof t?n=t:"string"==typeof t&&(n=i.options.value===t),i.toggle(n),r&&r.toggle(n))}function i(e,t){var n=e.toolbar,i=e.overflow;n&&n.update&&n.update(t),i&&i.update&&i.update(t)}var r,o,s,a,l=t,u=this._tools();for(r=0;u.length>r;r++)o=u[r].property,s=u[r].tool,a=e.isFunction(l[o])?l[o]():l,"button"===s.type?n(s,a):i(s,a)},_tools:function(){return this.element.find("[data-property]").toArray().reduce(function(e,n){n=t(n);var i=n.attr("data-property");return e.push({property:i,tool:this._getItem(n)}),e}.bind(this),[])},destroy:function(){this.element.find("[data-command],.k-button").each(function(){var e=t(this),n=e.data("instance");n&&n.destroy&&n.destroy()}),n.fn.destroy.call(this)}}),e.spreadsheet.ToolBar=s,a=e.toolbar.Item.extend({init:function(e,n){var i=t("<select />").kendoDropDownList({height:"auto"}).data("kendoDropDownList");this.dropDownList=i,this.element=i.wrapper,this.options=e,this.toolbar=n,this.attributes(),this.addUidAttr(),this.addOverflowAttr(),i.bind("open",this._open.bind(this)),i.bind("change",this._change.bind(this)),this.element.width(e.width).attr({"data-command":"PropertyChangeCommand","data-property":e.property})},_open:function(){var t,n=this.dropDownList,i=n.list;i.css({whiteSpace:"nowrap",width:"auto"}),t=i.width(),t?t+=20:t=n._listWidth,i.css("width",t+e.support.scrollbar()),n._listWidth=t},_change:function(e){var t=e.sender,n=t.value(),i=t.dataItem(),r=i?i.popup:void 0;r?this.toolbar.dialog({name:r}):this.toolbar.action({command:"PropertyChangeCommand",options:{property:this.options.property,value:"null"==n?null:n}})},value:function(e){return void 0===e?this.dropDownList.value():void this.dropDownList.value(e)}}),l=e.toolbar.Item.extend({init:function(e,n){this.element=t("<a href='#' class='k-button k-button-icon'><span class='"+e.spriteCssClass+"'></span><span class='k-icon k-i-arrow-s'></span></a>"),this.element.on("click",this.open.bind(this)).attr("data-command",e.command),this.options=e,this.toolbar=n,this.attributes(),this.addUidAttr(),this.addOverflowAttr(),this._popup()},destroy:function(){this.popup.destroy()},open:function(){this.popup.toggle()},_popup:function(){var e=this.element;this.popup=t("<div class='k-spreadsheet-popup' />").appendTo(e).kendoPopup({anchor:e}).data("kendoPopup")}}),e.toolbar.registerComponent("dialog",e.toolbar.ToolBarButton.extend({init:function(t,n){e.toolbar.ToolBarButton.fn.init.call(this,t,n),this._dialogName=t.dialogName,this.element.bind("click",this.open.bind(this)).data("instance",this)},open:function(){this.toolbar.dialog({name:this._dialogName})}})),e.toolbar.registerComponent("exportAsDialog",e.toolbar.Item.extend({init:function(e,n){this._dialogName=e.dialogName,this.toolbar=n,this.element=t("<button class='k-button k-button-icon' title='"+e.attributes.title+"'><span class='k-icon k-font-icon k-i-xls' /></button>").data("instance",this),this.element.bind("click",this.open.bind(this)).data("instance",this)},open:function(){this.toolbar.dialog({name:this._dialogName})}})),u=e.toolbar.OverflowButton.extend({init:function(t,n){e.toolbar.OverflowButton.fn.init.call(this,t,n),this.element.on("click",this._click.bind(this)),this.message=this.options.text;var i=this.element.data("button");this.element.data(this.options.type,i)},_click:t.noop}),c=l.extend({init:function(t,n){l.fn.init.call(this,t,n),this.popup.element.addClass("k-spreadsheet-colorpicker"),this.colorChooser=new e.spreadsheet.ColorChooser(this.popup.element,{change:this._colorChange.bind(this)}),this.element.attr({"data-property":t.property}),this.element.data({type:"colorPicker",colorPicker:this,instance:this})},destroy:function(){this.colorChooser.destroy(),l.fn.destroy.call(this)},update:function(e){this.value(e)},value:function(e){this.colorChooser.value(e)},_colorChange:function(e){this.toolbar.action({command:"PropertyChangeCommand",options:{property:this.options.property,value:e.sender.value()}}),this.popup.close()}}),h=u.extend({init:function(e,t){e.iconName="text",u.fn.init.call(this,e,t)},_click:function(){this.toolbar.dialog({name:"colorPicker",options:{title:this.options.property,property:this.options.property}})}}),e.toolbar.registerComponent("colorPicker",c,h),d=[8,9,10,11,12,13,14,16,18,20,22,24,26,28,36,48,72],f=12,p=e.toolbar.Item.extend({init:function(e,n){var i=t("<input />").kendoComboBox({change:this._valueChange.bind(this),dataSource:e.fontSizes||d,value:f}).data("kendoComboBox");this.comboBox=i,this.element=i.wrapper,this.options=e,this.toolbar=n,this.attributes(),this.addUidAttr(),this.addOverflowAttr(),this.element.width(e.width).attr({"data-command":"PropertyChangeCommand","data-property":e.property}),this.element.data({type:"fontSize",fontSize:this})},_valueChange:function(t){this.toolbar.action({command:"PropertyChangeCommand",options:{property:this.options.property,value:e.parseInt(t.sender.value())}})},update:function(t){this.value(e.parseInt(t)||f)},value:function(e){return void 0===e?this.comboBox.value():void this.comboBox.value(e)}}),m=u.extend({_click:function(){this.toolbar.dialog({name:"fontSize",options:{sizes:d,defaultSize:f}})},update:function(e){this._value=e||f,this.element.find(".k-text").text(this.message+" ("+this._value+") ...")}}),e.toolbar.registerComponent("fontSize",p,m),g=["Arial","Courier New","Georgia","Times New Roman","Trebuchet MS","Verdana"],v="Arial",b=a.extend({init:function(e,t){a.fn.init.call(this,e,t);var n=this.dropDownList;n.setDataSource(e.fontFamilies||g),n.value(v),this.element.data({type:"fontFamily",fontFamily:this})},update:function(e){this.value(e||v)}}),w=u.extend({_click:function(){this.toolbar.dialog({name:"fontFamily",options:{fonts:g,defaultFont:v}})},update:function(e){this._value=e||v,this.element.find(".k-text").text(this.message+" ("+this._value+") ...")}}),e.toolbar.registerComponent("fontFamily",b,w),y=e.spreadsheet.formats={automatic:null,number:"#,0.00",percent:"0.00%",financial:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',currency:"$#,##0.00;[Red]$#,##0.00",date:"m/d/yyyy",time:"h:mm:ss AM/PM",dateTime:"m/d/yyyy h:mm",duration:"[h]:mm:ss"},_=a.extend({_revertTitle:function(e){e.sender.value(""),e.sender.wrapper.width("auto")},init:function(e,t){var n,r;a.fn.init.call(this,e,t),n=this.dropDownList,r="<span class='k-icon k-font-icon k-i-"+e.iconClass+"' style='line-height: 1em; width: 1.35em;'></span>",n.bind("change",this._revertTitle.bind(this)),n.bind("dataBound",this._revertTitle.bind(this)),n.setOptions({dataValueField:"format",dataTextField:"name",dataValuePrimitive:!0,valueTemplate:r,template:"# if (data.sample) { #<span class='k-spreadsheet-sample'>#: data.sample #</span># } ##: data.name #"}),n.text(r),n.setDataSource([{format:y.automatic,name:i.formatTypes.automatic},{format:y.number,name:i.formatTypes.number,sample:"1,499.99"},{format:y.percent,name:i.formatTypes.percent,sample:"14.50%"},{format:y.financial,name:i.formatTypes.financial,sample:"(1,000.12)"},{format:y.currency,name:i.formatTypes.currency,sample:"$1,499.99"},{format:y.date,name:i.formatTypes.date,sample:"4/21/2012"},{format:y.time,name:i.formatTypes.time,sample:"5:49:00 PM"},{format:y.dateTime,name:i.formatTypes.dateTime,sample:"4/21/2012 5:49:00"},{format:y.duration,name:i.formatTypes.duration,sample:"168:05:00"},{popup:"formatCells",name:i.formatTypes.moreFormats}]),this.element.data({type:"format",format:this})}}),x=u.extend({_click:function(){this.toolbar.dialog({name:"formatCells"})}}),e.toolbar.registerComponent("format",_,x),k=l.extend({init:function(e,t){l.fn.init.call(this,e,t),this._borderPalette(),this.element.data({type:"borders",instance:this})},destroy:function(){this.borderPalette.destroy(),l.fn.destroy.call(this)},_borderPalette:function(){var n=t("<div />").appendTo(this.popup.element);this.borderPalette=new e.spreadsheet.BorderPalette(n,{change:this._action.bind(this)})},_action:function(e){this.toolbar.action({command:"BorderChangeCommand",options:{border:e.type,style:{size:1,color:e.color}}})}}),C=u.extend({_click:function(){this.toolbar.dialog({name:"borders"})}}),e.toolbar.registerComponent("borders",k,C),F=l.extend({init:function(e,n){l.fn.init.call(this,e,n),this.element.attr({"data-property":"alignment"}),this._commandPalette(),this.popup.element.on("click",".k-button",function(e){this._action(t(e.currentTarget))}.bind(this)),this.element.data({type:"alignment",alignment:this,instance:this})},buttons:[{property:"textAlign",value:"left",iconClass:"justify-left",text:i.alignmentButtons.justtifyLeft},{property:"textAlign",value:"center",iconClass:"justify-center",text:i.alignmentButtons.justifyCenter},{property:"textAlign",value:"right",iconClass:"justify-right",text:i.alignmentButtons.justifyRight},{property:"textAlign",value:"justify",iconClass:"justify-full",text:i.alignmentButtons.justifyFull},{property:"verticalAlign",value:"top",iconClass:"align-top",text:i.alignmentButtons.alignTop},{property:"verticalAlign",value:"center",iconClass:"align-middle",text:i.alignmentButtons.alignMiddle},{property:"verticalAlign",value:"bottom",iconClass:"align-bottom",text:i.alignmentButtons.alignBottom}],destroy:function(){this.popup.element.off(),l.fn.destroy.call(this)},update:function(e){var t=e.textAlign(),n=e.verticalAlign();this.popup.element.find(".k-button").removeClass("k-state-active"),t&&this.popup.element.find(".k-button[data-value="+t+"]").addClass("k-state-active"),n&&this.popup.element.find(".k-button[data-value="+n+"]").addClass("k-state-active")},_commandPalette:function(){var e=this.buttons,n=t("<div />").appendTo(this.popup.element);e.forEach(function(i,r){var o="<a title='"+i.text+"' data-property='"+i.property+"' data-value='"+i.value+"' class='k-button k-button-icon'><span class='k-icon k-font-icon k-i-"+i.iconClass+"'></span></a>";0!==r&&e[r-1].property!==i.property&&n.append(t("<span class='k-separator' />")),
  n.append(o)})},_action:function(e){var t=e.attr("data-property"),n=e.attr("data-value");this.toolbar.action({command:"PropertyChangeCommand",options:{property:t,value:n}})}}),R=u.extend({_click:function(){this.toolbar.dialog({name:"alignment"})}}),e.toolbar.registerComponent("alignment",F,R),S=l.extend({init:function(e,n){l.fn.init.call(this,e,n),this._commandPalette(),this.popup.element.on("click",".k-button",function(e){this._action(t(e.currentTarget))}.bind(this)),this.element.data({type:"merge",merge:this,instance:this})},buttons:[{value:"cells",iconClass:"merge-cells",text:i.mergeButtons.mergeCells},{value:"horizontally",iconClass:"merge-horizontally",text:i.mergeButtons.mergeHorizontally},{value:"vertically",iconClass:"merge-vertically",text:i.mergeButtons.mergeVertically},{value:"unmerge",iconClass:"normal-layout",text:i.mergeButtons.unmerge}],destroy:function(){this.popup.element.off(),l.fn.destroy.call(this)},_commandPalette:function(){var e=t("<div />").appendTo(this.popup.element);this.buttons.forEach(function(t){var n="<a title='"+t.text+"' data-value='"+t.value+"' class='k-button k-button-icontext'><span class='k-icon k-font-icon k-i-"+t.iconClass+"'></span>"+t.text+"</a>";e.append(n)})},_action:function(e){var t=e.attr("data-value");this.toolbar.action({command:"MergeCellCommand",options:{value:t}})}}),A=u.extend({_click:function(){this.toolbar.dialog({name:"merge"})}}),e.toolbar.registerComponent("merge",S,A),M=l.extend({init:function(e,n){l.fn.init.call(this,e,n),this._commandPalette(),this.popup.element.on("click",".k-button",function(e){this._action(t(e.currentTarget))}.bind(this)),this.element.data({type:"freeze",freeze:this,instance:this})},buttons:[{value:"panes",iconClass:"freeze-panes",text:i.freezeButtons.freezePanes},{value:"rows",iconClass:"freeze-row",text:i.freezeButtons.freezeRows},{value:"columns",iconClass:"freeze-col",text:i.freezeButtons.freezeColumns},{value:"unfreeze",iconClass:"normal-layout",text:i.freezeButtons.unfreeze}],destroy:function(){this.popup.element.off(),l.fn.destroy.call(this)},_commandPalette:function(){var e=t("<div />").appendTo(this.popup.element);this.buttons.forEach(function(t){var n="<a title='"+t.text+"' data-value='"+t.value+"' class='k-button k-button-icontext'><span class='k-icon k-font-icon k-i-"+t.iconClass+"'></span>"+t.text+"</a>";e.append(n)})},_action:function(e){var t=e.attr("data-value");this.toolbar.action({command:"FreezePanesCommand",options:{value:t}})}}),E=u.extend({_click:function(){this.toolbar.dialog({name:"freeze"})}}),e.toolbar.registerComponent("freeze",M,E),D=a.extend({_revertTitle:function(e){e.sender.value(""),e.sender.wrapper.width("auto")},init:function(e,t){a.fn.init.call(this,e,t);var n=this.dropDownList;n.bind("change",this._revertTitle.bind(this)),n.bind("dataBound",this._revertTitle.bind(this)),n.setOptions({valueTemplate:"<span class='k-icon k-font-icon k-i-"+e.iconClass+"' style='line-height: 1em; width: 1.35em;'></span>",template:"<span class='k-icon k-font-icon k-i-#= iconClass #' style='line-height: 1em; width: 1.35em;'></span>#=text#",dataTextField:"text",dataValueField:"value"}),n.setDataSource([{value:"asc",sheet:!1,text:i.sortButtons.sortRangeAsc,iconClass:"sort-asc"},{value:"desc",sheet:!1,text:i.sortButtons.sortRangeDesc,iconClass:"sort-desc"}]),n.select(0),this.element.data({type:"sort",sort:this})},_change:function(e){var t=e.sender,n=t.dataItem();n&&this.toolbar.action({command:"SortCommand",options:{value:n.value,sheet:n.sheet}})},value:t.noop}),T=u.extend({_click:function(){this.toolbar.dialog({name:"sort"})}}),e.toolbar.registerComponent("sort",D,T),B=e.toolbar.ToolBarButton.extend({init:function(t,n){t.showText="overflow",e.toolbar.ToolBarButton.fn.init.call(this,t,n),this.element.on("click",this._click.bind(this)),this.element.data({type:"filter",filter:this})},_click:function(){this.toolbar.action({command:"FilterCommand"})},update:function(e){this.toggle(e)}}),L=u.extend({init:function(e,t){u.fn.init.call(this,e,t),this.element.data({type:"filter",filter:this})},_click:function(){this.toolbar.action({command:"FilterCommand"})},update:function(e){this.toggle(e)}}),e.toolbar.registerComponent("filter",B,L),N=e.toolbar.Item.extend({init:function(e,n){this.toolbar=n,this.element=t("<div class='k-button k-upload-button k-button-icon'><span class='k-icon k-font-icon k-i-folder-open' /></div>").data("instance",this),this._title=e.attributes.title,this._reset()},_reset:function(){this.element.remove("input"),t("<input type='file' autocomplete='off' accept='.xlsx'/>").attr("title",this._title).one("change",this._change.bind(this)).appendTo(this.element)},_change:function(e){this.toolbar.action({command:"OpenCommand",options:{file:e.target.files[0]}}),this._reset()}}),e.toolbar.registerComponent("open",N),e.spreadsheet.TabStrip=e.ui.TabStrip.extend({init:function(n,i){e.ui.TabStrip.fn.init.call(this,n,i),n.addClass("k-spreadsheet-tabstrip"),this._quickAccessButtons(),this.quickAccessToolBar.on("click",".k-button",function(e){var n=t(e.currentTarget).attr("title").toLowerCase();this.trigger("action",{action:n})}.bind(this)),this.toolbars={};var r=i.dataSource;this.contentElements.each(function(e,n){this._toolbar(t(n),r[e].id,i.toolbarOptions[r[e].id])}.bind(this)),this.one("activate",function(){this.toolbars[this.options.dataSource[0].id].resize()})},events:e.ui.TabStrip.fn.events.concat(["action","dialog"]),destroy:function(){this.quickAccessToolBar.off("click"),e.ui.TabStrip.fn.destroy.call(this);for(var t in this.toolbars)this.toolbars[t].destroy()},action:function(e){this.trigger("action",e)},dialog:function(e){this.trigger("dialog",e)},refreshTools:function(e){var t,n=this.toolbars;for(t in n)n.hasOwnProperty(t)&&n[t].refresh(e)},_quickAccessButtons:function(){var n=[{title:i.quickAccess.undo,iconClass:"undo-large",action:"undo"},{title:i.quickAccess.redo,iconClass:"redo-large",action:"redo"}],r=e.template("<a href='\\#' title='#= title #' data-action='#= action #' class='k-button k-button-icon'><span class='k-icon k-font-icon k-i-#=iconClass#'></span></a>");this.quickAccessToolBar=t("<div />",{"class":"k-spreadsheet-quick-access-toolbar",html:e.render(r,n)}).insertBefore(this.wrapper),this.quickAccessToolBar.on("click",".k-button",function(e){e.preventDefault();var n=t(e.currentTarget).attr("title").toLowerCase();this.action({action:n})}.bind(this)),this.quickAccessAdjust()},quickAccessAdjust:function(){this.tabGroup.css("padding-left",this.quickAccessToolBar.outerWidth())},_toolbar:function(t,n,i){var r,o;this.toolbars[n]&&(this.toolbars[n].destroy(),t.children(".k-toolbar").remove()),i&&(r=t.html("<div />").children("div"),o={tools:"boolean"==typeof i?void 0:i,toolbarName:n,action:this.action.bind(this),dialog:this.dialog.bind(this)},this.toolbars[n]=new e.spreadsheet.ToolBar(r,o))}}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/dialogs.min",["kendo.core.min","kendo.binder.min","kendo.validator.min"],e)}(function(){!function(e){function t(t,n){return e.spreadsheet.formatting.text(t,n)}function n(e,t){var n,r=[],o=[];for(n=0;t.length>n;n++)-1==i.inArray(t[n][e],o)&&(r.push(t[n]),o.push(t[n][e]));return r}var i,r,o,s,a,l,u,c,h,d,f,p,m,g,v,b,w,y,_,x,k,C,F;e.support.browser.msie&&9>e.support.browser.version||(i=e.jQuery,r=e.data.ObservableObject,o=e.spreadsheet.messages.dialogs={apply:"Apply",save:"Save",cancel:"Cancel",remove:"Remove",okText:"OK",formatCellsDialog:{title:"Format",categories:{number:"Number",currency:"Currency",date:"Date"}},fontFamilyDialog:{title:"Font"},fontSizeDialog:{title:"Font size"},bordersDialog:{title:"Borders"},alignmentDialog:{title:"Alignment",buttons:{justtifyLeft:"Align left",justifyCenter:"Center",justifyRight:"Align right",justifyFull:"Justify",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom"}},mergeDialog:{title:"Merge cells",buttons:{mergeCells:"Merge all",mergeHorizontally:"Merge horizontally",mergeVertically:"Merge vertically",unmerge:"Unmerge"}},freezeDialog:{title:"Freeze panes",buttons:{freezePanes:"Freeze panes",freezeRows:"Freeze rows",freezeColumns:"Freeze columns",unfreeze:"Unfreeze panes"}},validationDialog:{title:"Data Validation",hintMessage:"Please enter a valid {0} value {1}.",hintTitle:"Validation {0}",criteria:{any:"Any value",number:"Number",text:"Text",date:"Date",custom:"Custom Formula",list:"List"},comparers:{greaterThan:"greater than",lessThan:"less than",between:"between",notBetween:"not between",equalTo:"equal to",notEqualTo:"not equal to",greaterThanOrEqualTo:"greater than or equal to",lessThanOrEqualTo:"less than or equal to"},comparerMessages:{greaterThan:"greater than {0}",lessThan:"less than {0}",between:"between {0} and {1}",notBetween:"not between {0} and {1}",equalTo:"equal to {0}",notEqualTo:"not equal to {0}",greaterThanOrEqualTo:"greater than or equal to {0}",lessThanOrEqualTo:"less than or equal to {0}",custom:"that satisfies the formula: {0}"},labels:{criteria:"Criteria",comparer:"Comparer",min:"Min",max:"Max",value:"Value",start:"Start",end:"End",onInvalidData:"On invalid data",rejectInput:"Reject input",showWarning:"Show warning",showHint:"Show hint",hintTitle:"Hint title",hintMessage:"Hint message",ignoreBlank:"Ignore blank"},placeholders:{typeTitle:"Type title",typeMessage:"Type message"}},exportAsDialog:{title:"Export...",labels:{scale:"Scale",fit:"Fit to page",fileName:"File name",saveAsType:"Save as type",exportArea:"Export",paperSize:"Paper size",margins:"Margins",orientation:"Orientation",print:"Print",guidelines:"Guidelines",center:"Center",horizontally:"Horizontally",vertically:"Vertically"}},modifyMergedDialog:{errorMessage:"Cannot change part of a merged cell."},useKeyboardDialog:{title:"Copying and pasting",errorMessage:"These actions cannot be invoked through the menu. Please use the keyboard shortcuts instead:",labels:{forCopy:"for copy",forCut:"for cut",forPaste:"for paste"}},unsupportedSelectionDialog:{errorMessage:"That action cannot be performed on multiple selection."}},s={},e.spreadsheet.dialogs={register:function(e,t){s[e]=t},create:function(e,t){var n=s[e];return n?new n(t):void 0}},a=e.spreadsheet.SpreadsheetDialog=e.Observable.extend({init:function(t){e.Observable.fn.init.call(this,t),this.options=i.extend(!0,{},this.options,t),this.bind(this.events,t)},events:["close","activate"],dialog:function(){return this._dialog||(this._dialog=i("<div class='k-spreadsheet-window k-action-window' />").addClass(this.options.className||"").append(this.options.template).appendTo(document.body).kendoWindow({scrollable:!1,resizable:!1,maximizable:!1,modal:!0,visible:!1,width:this.options.width||320,title:this.options.title,open:function(){this.center()},close:this._onDialogClose.bind(this),activate:this._onDialogActivate.bind(this),deactivate:this._onDialogDeactivate.bind(this)}).data("kendoWindow")),this._dialog},_onDialogClose:function(){this.trigger("close")},_onDialogActivate:function(){this.trigger("activate")},_onDialogDeactivate:function(){this.trigger("deactivate"),this.destroy()},destroy:function(){this._dialog&&(this._dialog.destroy(),this._dialog=null)},open:function(){this.dialog().open()},apply:function(){this.close()},close:function(){this.dialog().close()}}),l=e.spreadsheet.FormatCellsViewModel=r.extend({init:function(e){r.fn.init.call(this,e),this.useCategory(this.category)},useCategory:function(e){var t=e&&e.type||"number",n="currency"==t;this.category=e,this.set("showCurrencyFilter",n&&this.currencies.length>1),n?this.currency(this.currencies[0]):this.set("formats",this.allFormats[t+"Formats"]),this.useFirstFormat()},useFirstFormat:function(){this.formats.length&&this.set("format",this.formats[0].value)},currency:function(e){var n,i;return void 0!==e&&(this._currency=e,n=e.value,i=[{currency:n,decimals:!0},{currency:n,decimals:!0,iso:!0},{currency:n,decimals:!1}],i=i.map(function(e){return e=l.convert.currency(e),{value:e,name:t(1e3,e)}}),this.set("formats",i),this.useFirstFormat()),this._currency||this.currencies[0]},categoryFilter:function(e){return void 0!==e&&this.useCategory(e),this.category},preview:function(){var e=this.get("format"),n=this.value||0;return e&&e.length?t(n,e):n}}),l.convert={currency:function(e){function t(e,t){return Array(t+1).join(e)}var n=e.currency,i=n.pattern[1];return e.decimals&&(i=i.replace(/n/g,"n"+n["."]+t("0",n.decimals))),i=e.iso?'"'+n.abbr+'" '+i.replace(/\s*\$\s*/g,""):i.replace(/\$/g,n.symbol),i=i.replace(/n/g,"?")},date:function(e){return/T|Z/.test(e)?"":e.toLowerCase().replace(/tt/g,"AM/PM").replace(/'/g,'"')}},u=a.extend({init:function(e){a.fn.init.call(this,e),this._generateFormats()},options:{title:o.formatCellsDialog.title,className:"k-spreadsheet-format-cells",categories:[{type:"number",name:o.formatCellsDialog.categories.number},{type:"currency",name:o.formatCellsDialog.categories.currency},{type:"date",name:o.formatCellsDialog.categories.date}],template:"<div class='k-root-tabs' data-role='tabstrip' data-text-field='name' data-bind='source: categories, value: categoryFilter' data-animation='false' /><div class='k-spreadsheet-preview' data-bind='text: preview' /><script type='text/x-kendo-template' id='format-item-template'>#: data.name #</script><select data-role='dropdownlist' class='k-format-filter' data-text-field='description' data-value-field='value.name' data-bind='visible: showCurrencyFilter, value: currency, source: currencies' /><ul data-role='staticlist' tabindex='0' class='k-list k-reset' data-template='format-item-template' data-value-primitive='true' data-value-field='value' data-bind='source: formats, value: format' /><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>"+o.apply+"</button><button class='k-button' data-bind='click: close'>"+o.cancel+"</button></div>"},_generateFormats:function(){var r,o=this.options;o.currencies||(o.currencies=u.currenciesFrom(e.cultures)),o.numberFormats||(o.numberFormats=[{value:"#.00%",name:"100.00%"},{value:"#%",name:"100%"},{value:"#.00",name:"1024.00"},{value:"#,###.00",name:"1,024.00"}]),o.dateFormats||(r=e.cultures.current.calendars.standard.patterns,o.dateFormats=n("value",i.map(r,function(e){return(e=l.convert.date(e))?{value:e,name:t(34567.7678,e)}:void 0})))},open:function(t){var n,i,r=this.options,o=t.value(),s=r.categories.slice(0);this.viewModel=new l({currencies:r.currencies.slice(0),allFormats:{numberFormats:r.numberFormats.slice(0),dateFormats:r.dateFormats.slice(0)},categories:s,format:t.format(),category:o instanceof Date?s[2]:s[0],apply:this.apply.bind(this),close:this.close.bind(this),value:o}),a.fn.open.call(this),n=this.dialog().element,e.bind(n,this.viewModel),i=n.find("select.k-format-filter").data("kendoDropDownList"),r.currencies.length>10&&i.setOptions({filter:"contains"}),n.find(e.roleSelector("staticlist")).parent().addClass("k-list-wrapper")},apply:function(){var e=this.viewModel.format;a.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:"format",value:e}})}}),u.currenciesFrom=function(t){return n("description",i.map(t,function(t,n){var i,r;if(/-/.test(n))return i=t.numberFormat.currency,r=e.format("{0} ({1}, {2})",i.name,i.abbr,i.symbol),{description:r,value:i}}))},e.spreadsheet.dialogs.register("formatCells",u),e.spreadsheet.dialogs.FormatCellsDialog=u,c=a.extend({options:{className:"k-spreadsheet-message",title:"",text:"",template:"<div class='k-spreadsheet-message-content' data-bind='text: text' /><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: close, text: okText' /></div>"},open:function(){a.fn.open.call(this),e.bind(this.dialog().element,{text:this.options.text,okText:o.okText,close:this.close.bind(this)})}}),e.spreadsheet.dialogs.register("message",c),h=a.extend({init:function(e){a.fn.init.call(this,e),this._list()},options:{title:o.fontFamilyDialog.title,template:"<ul class='k-list k-reset'></ul>"},_list:function(){var t=this.dialog().element.find("ul"),n=this.options.fonts,i=this.options.defaultFont;this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:n}),template:"#:data#",value:i,change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){a.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:"fontFamily",value:e.sender.value()[0]}})}}),e.spreadsheet.dialogs.register("fontFamily",h),d=a.extend({init:function(e){a.fn.init.call(this,e),this._list()},options:{title:o.fontSizeDialog.title,template:"<ul class='k-list k-reset'></ul>"},_list:function(){var t=this.dialog().element.find("ul"),n=this.options.sizes,i=this.options.defaultSize;this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:n}),template:"#:data#",value:i,change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(t){a.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:"fontSize",value:e.parseInt(t.sender.value()[0])}})}}),e.spreadsheet.dialogs.register("fontSize",d),f=a.extend({init:function(t){a.fn.init.call(this,t),this.element=this.dialog().element,this._borderPalette(),this.viewModel=e.observable({apply:this.apply.bind(this),close:this.close.bind(this)}),e.bind(this.element.find(".k-action-buttons"),this.viewModel)},options:{title:o.bordersDialog.title,width:177,template:"<div></div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>"+o.apply+"</button><button class='k-button' data-bind='click: close'>"+o.cancel+"</button></div>"},apply:function(){a.fn.apply.call(this);var e=this.value();this.trigger("action",{command:"BorderChangeCommand",options:{border:e.type,style:{size:1,color:e.color}}})},_borderPalette:function(){var t=this.dialog().element.find("div:first");this.borderPalette=new e.spreadsheet.BorderPalette(t,{change:this.value.bind(this)})},value:function(e){return void 0===e?this._state:void(this._state=e)}}),e.spreadsheet.dialogs.register("borders",f),p=a.extend({init:function(t){a.fn.init.call(this,t),this.element=this.dialog().element,this.property=t.property,this.options.title=t.title,this.viewModel=e.observable({apply:this.apply.bind(this),close:this.close.bind(this)}),e.bind(this.element.find(".k-action-buttons"),this.viewModel)},options:{template:"<div></div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>"+o.apply+"</button><button class='k-button' data-bind='click: close'>"+o.cancel+"</button></div>"},apply:function(){a.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:this.property,value:this.value()}})},value:function(e){return void 0===e?this._value:void(this._value=e.value)}}),m=p.extend({init:function(e){e.width=177,p.fn.init.call(this,e),this._colorPalette()},_colorPalette:function(){var e=this.dialog().element.find("div:first");this.colorPalette=e.kendoColorPalette({palette:["#ffffff","#000000","#d6ecff","#4e5b6f","#7fd13b","#ea157a","#feb80a","#00addc","#738ac8","#1ab39f","#f2f2f2","#7f7f7f","#a7d6ff","#d9dde4","#e5f5d7","#fad0e4","#fef0cd","#c5f2ff","#e2e7f4","#c9f7f1","#d8d8d8","#595959","#60b5ff","#b3bcca","#cbecb0","#f6a1c9","#fee29c","#8be6ff","#c7d0e9","#94efe3","#bfbfbf","#3f3f3f","#007dea","#8d9baf","#b2e389","#f272af","#fed46b","#51d9ff","#aab8de","#5fe7d5","#a5a5a5","#262626","#003e75","#3a4453","#5ea226","#af0f5b","#c58c00","#0081a5","#425ea9","#138677","#7f7f7f","#0c0c0c","#00192e","#272d37","#3f6c19","#750a3d","#835d00","#00566e","#2c3f71","#0c594f"],change:this.value.bind(this)}).data("kendoColorPalette")}}),e.spreadsheet.dialogs.register("colorPicker",m),g=p.extend({init:function(e){e.width=268,p.fn.init.call(this,e),this.dialog().setOptions({animation:!1}),this.dialog().one("activate",this._colorPicker.bind(this))},_colorPicker:function(){var e=this.dialog().element.find("div:first");this.colorPicker=e.kendoFlatColorPicker({change:this.value.bind(this)}).data("kendoFlatColorPicker")}}),e.spreadsheet.dialogs.register("customColor",g),v=a.extend({init:function(e){a.fn.init.call(this,e),this._list()},options:{title:"Alignment",template:"<ul class='k-list k-reset'></ul>",buttons:[{property:"textAlign",value:"left",iconClass:"justify-left",text:o.alignmentDialog.buttons.justtifyLeft},{property:"textAlign",value:"center",iconClass:"justify-center",text:o.alignmentDialog.buttons.justifyCenter},{property:"textAlign",value:"right",iconClass:"justify-right",text:o.alignmentDialog.buttons.justifyRight},{property:"textAlign",value:"justify",iconClass:"justify-full",text:o.alignmentDialog.buttons.justifyFull},{property:"verticalAlign",value:"top",iconClass:"align-top",text:o.alignmentDialog.buttons.alignTop},{property:"verticalAlign",value:"center",iconClass:"align-middle",text:o.alignmentDialog.buttons.alignMiddle},{property:"verticalAlign",value:"bottom",iconClass:"align-bottom",text:o.alignmentDialog.buttons.alignBottom}]},_list:function(){var t=this.dialog().element.find("ul");this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:this.options.buttons}),template:"<a title='#=text#' data-property='#=property#' data-value='#=value#'><span class='k-icon k-font-icon k-i-#=iconClass#'></span>#=text#</a>",change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){var t=e.sender.value()[0];a.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:t.property,value:t.value}})}}),e.spreadsheet.dialogs.register("alignment",v),b=a.extend({init:function(e){a.fn.init.call(this,e),this._list()},options:{title:o.mergeDialog.title,template:"<ul class='k-list k-reset'></ul>",buttons:[{value:"cells",iconClass:"merge-cells",text:o.mergeDialog.buttons.mergeCells},{value:"horizontally",iconClass:"merge-horizontally",text:o.mergeDialog.buttons.mergeHorizontally},{value:"vertically",iconClass:"merge-vertically",text:o.mergeDialog.buttons.mergeVertically},{value:"unmerge",iconClass:"normal-layout",text:o.mergeDialog.buttons.unmerge}]},_list:function(){var t=this.dialog().element.find("ul");this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:this.options.buttons}),template:"<a title='#=text#' data-value='#=value#'><span class='k-icon k-font-icon k-i-#=iconClass#'></span>#=text#</a>",change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){var t=e.sender.value()[0];a.fn.apply.call(this),this.trigger("action",{command:"MergeCellCommand",options:{value:t.value}})}}),e.spreadsheet.dialogs.register("merge",b),w=a.extend({init:function(e){a.fn.init.call(this,e),this._list()},options:{title:o.freezeDialog.title,template:"<ul class='k-list k-reset'></ul>",buttons:[{value:"panes",iconClass:"freeze-panes",text:o.freezeDialog.buttons.freezePanes},{value:"rows",iconClass:"freeze-row",text:o.freezeDialog.buttons.freezeRows},{value:"columns",iconClass:"freeze-col",text:o.freezeDialog.buttons.freezeColumns},{value:"unfreeze",iconClass:"normal-layout",text:o.freezeDialog.buttons.unfreeze}]},_list:function(){var t=this.dialog().element.find("ul");this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:this.options.buttons}),template:"<a title='#=text#' data-value='#=value#'><span class='k-icon k-font-icon k-i-#=iconClass#'></span>#=text#</a>",change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){var t=e.sender.value()[0];a.fn.apply.call(this),this.trigger("action",{command:"FreezePanesCommand",options:{value:t.value}})}}),e.spreadsheet.dialogs.register("freeze",w),y=e.spreadsheet.ValidationCellsViewModel=r.extend({init:function(e){r.fn.init.call(this,e),this.bind("change",function(e){"criterion"===e.field&&(this.reset(),("custom"===this.criterion||"list"===this.criterion)&&this.setHintMessageTemplate()),"comparer"===e.field&&this.setHintMessageTemplate(),"hintMessage"!=e.field&&"hintTitle"!=e.field||this._mute||(this.shouldBuild=!1),"from"!=e.field&&"to"!=e.field&&"hintMessageTemplate"!=e.field&&"type"!=e.field||!this.shouldBuild||this.buildMessages()}.bind(this)),this.reset()},buildMessages:function(){this._mute=!0,this.set("hintTitle",this.hintTitleTemplate?e.format(this.hintTitleTemplate,this.type):""),this.set("hintMessage",this.hintMessageTemplate?e.format(this.hintMessageTemplate,this.from,this.to):""),this._mute=!1},reset:function(){this.setComparers(),this.set("comparer",this.comparers[0].type),this.set("from",null),this.set("to",null),this.set("useCustomMessages",!1),this.shouldBuild=!0,this.hintTitleTemplate=this.defaultHintTitle,this.buildMessages()},setComparers:function(){var e,t,n=this.defaultComparers,i=[];if("text"===this.criterion)for(e=["equalTo","notEqualTo"],t=0;n.length>t;t++)e[0]==n[t].type&&(i.push(n[t]),e.shift());else i=n.slice();this.set("comparers",i)},setHintMessageTemplate:function(){"custom"!==this.criterion&&"list"!==this.criterion?this.set("hintMessageTemplate",e.format(this.defaultHintMessage,this.criterion,this.comparerMessages[this.comparer])):(this.set("hintMessageTemplate",""),this.set("hintMessage",""))},isAny:function(){return"any"===this.get("criterion")},isNumber:function(){return"number"===this.get("criterion")},showToForNumber:function(){return this.showTo()&&this.isNumber()},showToForDate:function(){return this.showTo()&&this.isDate()},isText:function(){return"text"===this.get("criterion")},isDate:function(){return"date"===this.get("criterion")},isList:function(){return"list"===this.get("criterion")},isCustom:function(){return"custom"===this.get("criterion")},showRemove:function(){return this.get("hasValidation")},showTo:function(){return"between"==this.get("comparer")||"notBetween"==this.get("comparer")},update:function(e){this.set("hasValidation",!!e),e&&this.fromValidationObject(e)},fromValidationObject:function(e){this.set("criterion",e.dataType),this.set("comparer",e.comparerType),this.set("from",e.from),this.set("to",e.to),this.set("type",e.type),this.set("ignoreBlank",e.allowNulls),e.messageTemplate||e.titleTemplate?(this.hintMessageTemplate=e.messageTemplate,this.hintMessage=e.messageTemplate,this.hintTitleTemplate=e.titleTemplate,this.hintTitle=e.titleTemplate,this.useCustomMessages=!0,this.buildMessages()):this.useCustomMessages=!1},toValidationObject:function(){if("any"===this.criterion)return null;var e={type:this.type,dataType:this.criterion,comparerType:this.comparer,from:this.from,to:this.to,allowNulls:this.ignoreBlank};return this.useCustomMessages&&(e.messageTemplate=this.shouldBuild?this.hintMessageTemplate:this.hintMessage,e.titleTemplate=this.hintTitle),e}}),_=a.extend({init:function(e){a.fn.init.call(this,e)},options:{width:420,title:o.validationDialog.title,criterion:"any",type:"reject",ignoreBlank:!0,hintMessage:o.validationDialog.hintMessage,hintTitle:o.validationDialog.hintTitle,useCustomMessages:!1,criteria:[{type:"any",name:"Any value"},{type:"number",name:"Number"},{type:"text",name:"Text"},{type:"date",name:"Date"},{type:"custom",name:"Custom Formula"},{type:"list",name:"List"}],comparers:[{type:"greaterThan",name:o.validationDialog.comparers.greaterThan},{type:"lessThan",name:o.validationDialog.comparers.lessThan},{type:"between",name:o.validationDialog.comparers.between},{type:"notBetween",name:o.validationDialog.comparers.notBetween},{type:"equalTo",name:o.validationDialog.comparers.equalTo},{type:"notEqualTo",name:o.validationDialog.comparers.notEqualTo},{type:"greaterThanOrEqualTo",name:o.validationDialog.comparers.greaterThanOrEqualTo},{type:"lessThanOrEqualTo",name:o.validationDialog.comparers.lessThanOrEqualTo}],comparerMessages:o.validationDialog.comparerMessages,errorTemplate:'<div class="k-widget k-tooltip k-tooltip-validation" style="margin:0.5em"><span class="k-icon k-warning"> </span>#=message#<div class="k-callout k-callout-n"></div></div>',template:'<div class="k-edit-form-container"><div class="k-edit-label"><label>'+o.validationDialog.labels.criteria+':</label></div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: criterion, source: criteria" /></div><div data-bind="visible: isNumber"><div class="k-edit-label"><label>'+o.validationDialog.labels.comparer+':</label></div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: comparer, source: comparers" /></div><div class="k-edit-label"><label>'+o.validationDialog.labels.min+':</label></div><div class="k-edit-field"><input name="'+o.validationDialog.labels.min+'" placeholder="e.g. 10" class="k-textbox" data-bind="value: from, enabled: isNumber" required="required" /></div><div data-bind="visible: showTo"><div class="k-edit-label"><label>'+o.validationDialog.labels.max+':</label></div><div class="k-edit-field"><input name="'+o.validationDialog.labels.max+'" placeholder="e.g. 100" class="k-textbox" data-bind="value: to, enabled: showToForNumber" required="required" /></div></div></div><div data-bind="visible: isText"><div class="k-edit-label"><label>'+o.validationDialog.labels.comparer+':</label></div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: comparer, source: comparers" /></div><div class="k-edit-label"><label>'+o.validationDialog.labels.value+':</label></div><div class="k-edit-field"><input name="'+o.validationDialog.labels.value+'" class="k-textbox" data-bind="value: from, enabled: isText" required="required" /></div></div><div data-bind="visible: isDate"><div class="k-edit-label"><label>'+o.validationDialog.labels.comparer+':</label></div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: comparer, source: comparers" /></div><div class="k-edit-label"><label>'+o.validationDialog.labels.start+':</label></div><div class="k-edit-field"><input name="'+o.validationDialog.labels.start+'" class="k-textbox" data-bind="value: from, enabled: isDate" required="required" /></div><div data-bind="visible: showTo"><div class="k-edit-label"><label>'+o.validationDialog.labels.end+':</label></div><div class="k-edit-field"><input name="'+o.validationDialog.labels.end+'" class="k-textbox" data-bind="value: to, enabled: showToForDate" required="required" /></div></div></div><div data-bind="visible: isCustom"><div class="k-edit-label"><label>'+o.validationDialog.labels.value+':</label></div><div class="k-edit-field"><input name="'+o.validationDialog.labels.value+'" class="k-textbox" data-bind="value: from, enabled: isCustom" required="required" /></div></div><div data-bind="visible: isList"><div class="k-edit-label"><label>'+o.validationDialog.labels.value+':</label></div><div class="k-edit-field"><input name="'+o.validationDialog.labels.value+'" class="k-textbox" data-bind="value: from, enabled: isList" required="required" /></div></div><div data-bind="invisible: isAny"><div class="k-edit-label"><label>'+o.validationDialog.labels.ignoreBlank+':</label></div><div class="k-edit-field"><input type="checkbox" name="ignoreBlank" id="ignoreBlank" class="k-checkbox" data-bind="checked: ignoreBlank"/><label class="k-checkbox-label" for="ignoreBlank"></label></div></div><div data-bind="invisible: isAny"><div class="k-action-buttons"></div><div class="k-edit-label"><label>'+o.validationDialog.labels.onInvalidData+':</label></div><div class="k-edit-field"><input type="radio" id="validationTypeReject" name="validationType" value="reject" data-bind="checked: type" class="k-radio" /><label for="validationTypeReject" class="k-radio-label">'+o.validationDialog.labels.rejectInput+'</label> <input type="radio" id="validationTypeWarning" name="validationType" value="warning" data-bind="checked: type" class="k-radio" /><label for="validationTypeWarning" class="k-radio-label">'+o.validationDialog.labels.showWarning+'</label></div></div><div data-bind="invisible: isAny"><div class="k-edit-label"><label>'+o.validationDialog.labels.showHint+':</label></div><div class="k-edit-field"><input type="checkbox" name="useCustomMessages" id="useCustomMessages" class="k-checkbox" data-bind="checked: useCustomMessages" /><label class="k-checkbox-label" for="useCustomMessages"></label></div><div data-bind="visible: useCustomMessages"><div class="k-edit-label"><label>'+o.validationDialog.labels.hintTitle+':</label></div><div class="k-edit-field"><input class="k-textbox" placeholder="'+o.validationDialog.placeholders.typeTitle+'" data-bind="value: hintTitle" /></div><div class="k-edit-label"><label>'+o.validationDialog.labels.hintMessage+':</label></div><div class="k-edit-field"><input class="k-textbox" placeholder="'+o.validationDialog.placeholders.typeMessage+'" data-bind="value: hintMessage" /></div></div></div><div class="k-action-buttons"><button class="k-button" data-bind="visible: showRemove, click: remove">'+o.remove+'</button><button class="k-button k-primary" data-bind="click: apply">'+o.apply+'</button><button class="k-button" data-bind="click: close">'+o.cancel+"</button></div></div>"
  },open:function(t){var n,i=this.options;this.viewModel=new y({type:i.type,defaultHintMessage:i.hintMessage,defaultHintTitle:i.hintTitle,defaultComparers:i.comparers.slice(0),comparerMessages:i.comparerMessages,criteria:i.criteria.slice(0),criterion:i.criterion,ignoreBlank:i.ignoreBlank,apply:this.apply.bind(this),close:this.close.bind(this),remove:this.remove.bind(this)}),this.viewModel.update(t.validation()),a.fn.open.call(this),n=this.dialog().element,this.validatable&&this.validatable.destroy(),e.bind(n,this.viewModel),this.validatable=new e.ui.Validator(n.find(".k-edit-form-container"),{validateOnBlur:!1,errorTemplate:this.options.errorTemplate||void 0})},apply:function(){this.validatable.validate()&&(a.fn.apply.call(this),this.trigger("action",{command:"EditValidationCommand",options:{value:this.viewModel.toValidationObject()}}))},remove:function(){this.viewModel.set("criterion","any"),this.apply()}}),e.spreadsheet.dialogs.register("validation",_),e.spreadsheet.dialogs.ValidationDialog=_,x=a.extend({init:function(t){a.fn.init.call(this,t),this.viewModel=e.observable({title:this.options.title,name:this.options.name,extension:this.options.extension,fileFormats:this.options.fileFormats,excel:t.excelExport,pdf:{proxyURL:t.pdfExport.proxyURL,forceProxy:t.pdfExport.forceProxy,title:t.pdfExport.title,author:t.pdfExport.author,subject:t.pdfExport.subject,keywords:t.pdfExport.keywords,creator:t.pdfExport.creator,date:t.pdfExport.date,fitWidth:this.options.pdf.fitWidth,area:this.options.pdf.area,areas:this.options.pdf.areas,paperSize:this.options.pdf.paperSize,paperSizes:this.options.pdf.paperSizes,margin:this.options.pdf.margin,margins:this.options.pdf.margins,landscape:this.options.pdf.landscape,guidelines:this.options.pdf.guidelines,hCenter:this.options.pdf.hCenter,vCenter:this.options.pdf.vCenter},apply:this.apply.bind(this),close:this.close.bind(this)}),this.viewModel.bind("change",function(e){"extension"===e.field&&this.set("showPdfOptions",".pdf"===this.extension?!0:!1)}),e.bind(this.dialog().element,this.viewModel)},options:{title:o.exportAsDialog.title,name:"Workbook",extension:".xlsx",fileFormats:[{description:"Excel Workbook (.xlsx)",extension:".xlsx"},{description:"Portable Document Format(.pdf)",extension:".pdf"}],pdf:{fitWidth:!0,area:"workbook",areas:[{area:"workbook",text:"Entire Workbook"},{area:"sheet",text:"Active Sheet"},{area:"selection",text:"Selection"}],paperSize:"a4",paperSizes:[{value:"a2",text:"A2 (420 mm × 594 mm)     "},{value:"a3",text:"A3 (297 mm x 420 mm)     "},{value:"a4",text:"A4 (210 mm x 297 mm)     "},{value:"a5",text:"A5 (148 mm x 210 mm)     "},{value:"b3",text:"B3 (353 mm × 500 mm)     "},{value:"b4",text:"B4 (250 mm x 353 mm)     "},{value:"b5",text:"B5 (176 mm x 250 mm)     "},{value:"folio",text:'Folio (8.5" x 13")       '},{value:"legal",text:'Legal (8.5" x 14")       '},{value:"letter",text:'Letter (8.5" x 11")      '},{value:"tabloid",text:'Tabloid (11" x 17")      '},{value:"executive",text:'Executive (7.25" x 10.5")'}],margin:{bottom:"0.75in",left:"0.7in",right:"0.7in",top:"0.75in"},margins:[{value:{bottom:"0.75in",left:"0.7in",right:"0.7in",top:"0.75in"},text:"Normal"},{value:{bottom:"0.75in",left:"0.25in",right:"0.25in",top:"0.75in"},text:"Narrow"},{value:{bottom:"1in",left:"1in",right:"1in",top:"1in"},text:"Wide"}],landscape:!0,guidelines:!0,hCenter:!0,vCenter:!0},width:520,template:"<div class='k-edit-label'><label>"+o.exportAsDialog.labels.fileName+":</label></div><div class='k-edit-field'><input class='k-textbox' data-bind='value: name' /></div><div ><div class='k-edit-label'><label>"+o.exportAsDialog.labels.saveAsType+":</label></div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-text-field='description' data-value-field='extension' data-bind='value: extension, source: fileFormats' /></div></div><div class='export-config' data-bind='visible: showPdfOptions'><div class='k-edit-label'><label>"+o.exportAsDialog.labels.exportArea+":</label></div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-text-field='text' data-value-field='area' data-bind='value: pdf.area, source: pdf.areas' /></div><div class='k-edit-label'><label>"+o.exportAsDialog.labels.paperSize+":</label></div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-text-field='text' data-value-field='value' data-bind='value: pdf.paperSize, source: pdf.paperSizes' /></div><div class='k-edit-label'><label>"+o.exportAsDialog.labels.margins+":</label></div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-value-primitive='true'data-text-field='text' data-value-field='value' data-bind='value: pdf.margin, source: pdf.margins' /></div><div class='k-edit-label'><label>"+o.exportAsDialog.labels.orientation+":</label></div><div class='k-edit-field'><input type='radio' id='k-orientation-portrait' name='orientation' data-type='boolean' data-bind='checked: pdf.landscape' value='false' /><label class='k-orientation-label k-orientation-portrait-label' for='k-orientation-portrait'></label><input type='radio' id='k-orientation-landscape' name='orientation' data-type='boolean' data-bind='checked: pdf.landscape' value='true' /><label class='k-orientation-label k-orientation-landscape-label' for='k-orientation-landscape'></label></div><div class='k-edit-label'><label>"+o.exportAsDialog.labels.print+":</label></div><div class='k-edit-field'><input class='k-checkbox' id='guidelines' type='checkbox' data-bind='checked: pdf.guidelines'/><label class='k-checkbox-label' for='guidelines'>"+o.exportAsDialog.labels.guidelines+"</label></div><div class='k-edit-label'><label>"+o.exportAsDialog.labels.scale+":</label></div><div class='k-edit-field'><input class='k-checkbox' id='fitWidth' type='checkbox' data-bind='checked: pdf.fitWidth'/><label class='k-checkbox-label' for='fitWidth'>"+o.exportAsDialog.labels.fit+"</label></div><div class='k-edit-label'><label>"+o.exportAsDialog.labels.center+":</label></div><div class='k-edit-field'><input class='k-checkbox' id='hCenter' type='checkbox' data-bind='checked: pdf.hCenter'/><label class='k-checkbox-label' for='hCenter'>"+o.exportAsDialog.labels.horizontally+"</label><input class='k-checkbox' id='vCenter' type='checkbox' data-bind='checked: pdf.vCenter'/><label class='k-checkbox-label' for='vCenter'>"+o.exportAsDialog.labels.vertically+"</label></div><div class='k-page-orientation' data-bind='css: {k-page-landscape: pdf.landscape}'><div class='k-margins-horizontal'></div><div class='k-margins-vertical'></div></div></div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>"+o.save+"</button><button class='k-button' data-bind='click: close'>"+o.cancel+"</button></div>"},apply:function(){a.fn.apply.call(this),this.trigger("action",{command:"SaveAsCommand",options:this.viewModel})}}),e.spreadsheet.dialogs.register("exportAs",x),k=c.extend({init:function(e){a.fn.init.call(this,e)},options:{template:o.modifyMergedDialog.errorMessage+"<div class=\"k-action-buttons\"><button class='k-button k-primary' data-bind='click: close, text: okText' /></div>"}}),e.spreadsheet.dialogs.register("modifyMerged",k),C=c.extend({init:function(e){a.fn.init.call(this,e)},options:{title:o.useKeyboardDialog.title,template:o.useKeyboardDialog.errorMessage+"<div>Ctrl+C "+o.useKeyboardDialog.labels.forCopy+"</div><div>Ctrl+X "+o.useKeyboardDialog.labels.forCut+"</div><div>Ctrl+V "+o.useKeyboardDialog.labels.forPaste+"</div><div class=\"k-action-buttons\"><button class='k-button k-primary' data-bind='click: close, text: okText' /></div>"}}),e.spreadsheet.dialogs.register("useKeyboard",C),F=c.extend({init:function(e){a.fn.init.call(this,e)},options:{template:o.unsupportedSelectionDialog.errorMessage+"<div class=\"k-action-buttons\"><button class='k-button k-primary' data-bind='click: close, text: okText' /></div>"}}),e.spreadsheet.dialogs.register("unsupportedSelection",F))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/sheetbinder.min",["kendo.core.min","kendo.data.min","spreadsheet/sheet.min"],e)}(function(){!function(e){if(!(e.support.browser.msie&&9>e.support.browser.version)){var t=e.Class.extend({init:function(e){this.options=$.extend({},this.options,e),this.columns=this._normalizeColumns(this.options.columns),this._sheet(),this._dataSource(),this._header(),this.dataSource.fetch()},_sheet:function(){this.sheet=this.options.sheet,this._sheetChangeHandler=this._sheetChange.bind(this),this._sheetDeleteRowHandler=this._sheetDeleteRow.bind(this),this._sheetInsertRowHandler=this._sheetInsertRow.bind(this),this.sheet.bind("change",this._sheetChangeHandler).bind("deleteRow",this._sheetDeleteRowHandler).bind("insertRow",this._sheetInsertRowHandler)},_sheetInsertRow:function(e){void 0!==e.index&&this.dataSource.insert(Math.max(e.index-1,0),{})},_sheetDeleteRow:function(e){var t,n;void 0!==e.index&&(t=this.dataSource,n=t.view()[e.index-1],n&&t.remove(n))},_header:function(){this.sheet.batch(function(){this.columns.forEach(function(e,t){this.sheet.range(0,t).value(e.title)}.bind(this))}.bind(this))},_sheetChange:function(e){var t,n,i,r;e.recalc&&e.ref&&(t=this.dataSource,n=t.view(),i=this.columns,!i.length&&n.length&&(i=Object.keys(n[0].toJSON())),this._skipRebind=!0,r=this.sheet.range(e.ref).values(),e.ref.forEach(function(e){var o,s,a,l,u;for(e=e.toRangeRef(),s=0,a=e.topLeft.row;e.bottomRight.row>=a;a++){for(o=n[a-1],o||(o=t.insert(a-1,{}),n=t.view()),l=0,u=e.topLeft.col;e.bottomRight.col>=u&&i.length>u;u++)o.set(i[u].field,r[s][l++]);s++}}),this._skipRebind=!1)},_normalizeColumns:function(e){return e.map(function(e){var t=e.field||e;return{field:t,title:e.title||t}})},_dataSource:function(){var t=this.options,n=t.dataSource;n=Array.isArray(n)?{data:n}:n,this.dataSource&&this._changeHandler?this.dataSource.unbind("change",this._changeHandler):this._changeHandler=this._change.bind(this),this.dataSource=e.data.DataSource.create(n).bind("change",this._changeHandler)},_change:function(){var t,n,i;this._skipRebind||(t=this.dataSource.view(),n=this.columns,!n.length&&t.length&&(this.columns=n=this._normalizeColumns(Object.keys(t[0].toJSON())),this._header()),i=n.map(function(t){return e.getter(t.field)}),this.sheet.batch(function(){var e,n,r;for(e=0,n=t.length;n>e;e++)for(r=0;i.length>r;r++)this.sheet.range(e+1,r).value(i[r](t[e]))}.bind(this)))},destroy:function(){this.dataSource.unbind("change",this._changeHandler),this.sheet.unbind("change",this._sheetChangeHandler).unbind("deleteRow",this._sheetDeleteRowHandler).unbind("insertRow",this._sheetInsertRowHandler)},options:{columns:[]}});e.spreadsheet.SheetDataSourceBinder=t}}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/filtermenu.min",["kendo.core.min","kendo.popup.min","kendo.treeview.min","kendo.numerictextbox.min","kendo.datepicker.min","kendo.datetimepicker.min"],e)}(function(){!function(e){function t(e){var t,n={},i=[];for(t=0;e.length>t;t++)n[e[t].value]?!n[e[t].value].checked&&e[t].checked&&(n[e[t].value].checked=!0):(n[e[t].value]=e[t],i.push(e[t]));return i}function n(t,i){var r,o,s,a,l,u=!1,c=t instanceof e.data.HierarchicalDataSource&&t.data();for(r=0;c.length>r;r++)o=c[r],s=(""+o.text).toLowerCase(),a=i===!0||""===i||s.indexOf(i)>=0,l=n(o.children,a||i),u=u||l||a,o.hidden=!a&&!l,o.checked=!o.hidden;return c&&t.filter({field:"hidden",operator:"neq",value:!0}),u}function i(t){var n,r,o=t instanceof e.data.HierarchicalDataSource&&t.data();for(n=0;o.length>n;n++)r=o[n],r.checked=!1,r.hasChildren&&i(r.children)}function r(e){var t,n,i=u.operators,r=[];for(t in e)if(e.hasOwnProperty(t))for(n in e[t])e[t].hasOwnProperty(n)&&r.push({text:i[t][n],value:n,unique:t+"_"+n,type:t});return r}var o,s,a,l,u,c,h,d,f;e.support.browser.msie&&9>e.support.browser.version||(o=e.jQuery,s=e.ui.Widget,a={details:"k-details",button:"k-button",detailsSummary:"k-details-summary",detailsContent:"k-details-content",icon:"k-icon k-font-icon",iconCollapse:"k-i-collapse-se",iconExpand:"k-i-expand-e",iconSearch:"k-i-search",textbox:"k-textbox",wrapper:"k-spreadsheet-filter-menu",filterByCondition:"k-spreadsheet-condition-filter",filterByValue:"k-spreadsheet-value-filter",valuesTreeViewWrapper:"k-spreadsheet-value-treeview-wrapper",actionButtons:"k-action-buttons"},l=s.extend({init:function(t,n){s.fn.init.call(this,t,n),this.element.addClass(f.classNames.details),this._summary=this.element.find("."+f.classNames.detailsSummary).on("click",this._toggle.bind(this));var i=n.expanded?f.classNames.iconCollapse:f.classNames.iconExpand;this._icon=o("<span />",{"class":f.classNames.icon+" "+i}).prependTo(this._summary),this._container=e.wrap(this._summary.next(),!0),n.expanded||this._container.hide()},options:{name:"Details"},events:["toggle"],visible:function(){return this.options.expanded},toggle:function(t){var n=e.fx(this._container).expand("vertical");n.stop()[t?"reverse":"play"](),this._icon.toggleClass(f.classNames.iconExpand,t).toggleClass(f.classNames.iconCollapse,!t),this.options.expanded=!t},_toggle:function(){var e=this.visible();this.toggle(e),this.trigger("toggle",{show:e})}}),u=e.spreadsheet.messages.filterMenu={sortAscending:"Sort range A to Z",sortDescending:"Sort range Z to A",filterByValue:"Filter by value",filterByCondition:"Filter by condition",apply:"Apply",search:"Search",addToCurrent:"Add to current selection",clear:"Clear",blanks:"(Blanks)",operatorNone:"None",and:"AND",or:"OR",operators:{string:{contains:"Text contains",doesnotcontain:"Text does not contain",startswith:"Text starts with",endswith:"Text ends with"},date:{eq:"Date is",neq:"Date is not",lt:"Date is before",gt:"Date is after"},number:{eq:"Is equal to",neq:"Is not equal to",gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"}}},e.data.binders.spreadsheetFilterValue=e.data.Binder.extend({init:function(t,n,i){e.data.Binder.fn.init.call(this,t,n,i),this._change=o.proxy(this.change,this),o(this.element).on("change",this._change)},refresh:function(){var e=this,t=e.bindings.spreadsheetFilterValue.get();o(e.element).val(t instanceof Date?"":t)},change:function(){var e=this.element.value;this.bindings.spreadsheetFilterValue.set(e)}}),e.data.binders.widget.spreadsheetFilterValue=e.data.Binder.extend({init:function(t,n,i){e.data.Binder.fn.init.call(this,t.element[0],n,i),this.widget=t,this._change=o.proxy(this.change,this),this.widget.first("change",this._change)},refresh:function(){var e=this.bindings.spreadsheetFilterValue,t=e.get(),n=o(this.widget.element).data("filterType");this.widget.value("date"===n&&t instanceof Date||"number"===n&&!isNaN(t)?t:null)},change:function(){var e=this.widget.value(),t=this.bindings.spreadsheetFilterValue;t.set(e)}}),c={filterByValue:"<div class='"+a.detailsSummary+"'>#= messages.filterByValue #</div><div class='"+a.detailsContent+"'><div class='k-textbox k-space-right'><input placeholder='#= messages.search #' data-#=ns#bind='events: { input: filterValues }' /><span class='k-icon k-font-icon k-i-search' /></div><div data-#=ns#bind='visible: hasActiveSearch'><input class='k-checkbox' type='checkbox' data-#=ns#bind='checked: appendToSearch' id='_#=guid#' /><label class='k-checkbox-label' for='_#=guid#'>#= messages.addToCurrent #</label></div><div class='"+a.valuesTreeViewWrapper+"'><div data-#=ns#role='treeview' data-#=ns#checkboxes='{ checkChildren: true }' data-#=ns#bind='source: valuesDataSource, events: { check: valuesChange, select: valueSelect }' /></div></div>",filterByCondition:"<div class='"+a.detailsSummary+"'>#= messages.filterByCondition #</div><div class='"+a.detailsContent+'\'><div><select data-#=ns#role="dropdownlist"data-#=ns#bind="value: operator, source: operators, events: { change: operatorChange } "data-value-primitive="false"data-option-label="#=messages.operatorNone#"data-height="auto"data-text-field="text"data-value-field="unique"></select></div><div data-#=ns#bind="visible: isString"><input data-filter-type="string" data-#=ns#bind="spreadsheetFilterValue: customFilter.criteria[0].value" class="k-textbox" /></div><div data-#=ns#bind="visible: isNumber"><input data-filter-type="number" data-#=ns#role="numerictextbox" data-#=ns#bind="spreadsheetFilterValue: customFilter.criteria[0].value" /></div><div data-#=ns#bind="visible: isDate"><input data-filter-type="date" data-#=ns#role="datepicker" data-#=ns#bind="spreadsheetFilterValue: customFilter.criteria[0].value" /></div></div>',menuItem:"<li data-command='#=command#' data-dir='#=dir#'><span class='k-icon k-font-icon k-i-#=iconClass#'></span>#=text#</li>",actionButtons:"<button data-#=ns#bind='click: apply' class='k-button k-primary'>#=messages.apply#</button><button data-#=ns#bind='click: clear' class='k-button'>#=messages.clear#</button>"},h=e.spreadsheet.FilterMenuViewModel=e.data.ObservableObject.extend({valuesChange:function(t){var n=t?t.sender.dataSource:this.valuesDataSource,i=function(e){return e.checked&&e.value},r=function(t){return"date"===t.dataType?e.spreadsheet.dateToNumber(t.value):t.value},o=function(e,t,n){return n.lastIndexOf(e)===t},s=n.data(),a=s[0].children.data().toJSON(),l=a.filter(function(e){return"blank"===e.dataType});l=l.length?l[0].checked:!1,a=a.filter(i).map(r),this.appendToSearch&&this.valueFilter&&this.valueFilter.values.length&&(a=a.concat(this.valueFilter.values.toJSON()).sort().filter(o)),this.set("valueFilter",{values:a,blanks:l})},valueSelect:function(e){e.preventDefault();var t=e.sender.dataItem(e.node);t.set("checked",!t.checked)},hasActiveSearch:!1,appendToSearch:!1,filterValues:function(e){var t="string"==typeof e?e:o(e.target).val().toLowerCase(),r=this.valuesDataSource;this.set("hasActiveSearch",!!t),i(r),n(r,t)},reset:function(){this.set("customFilter",{logic:"and",criteria:[{operator:null,value:null}]}),this.set("valueFilter",{values:[]})},operatorChange:function(e){var t=e.sender.dataItem();this.set("operatorType",t.type),this.set("customFilter.criteria[0].operator",t.value)},isNone:function(){return void 0===this.get("operatorType")},isString:function(){return"string"===this.get("operatorType")},isNumber:function(){return"number"===this.get("operatorType")},isDate:function(){return"date"===this.get("operatorType")}}),d=e.spreadsheet.FilterMenuController={valuesTree:function(e,t){return[{text:"All",expanded:!0,checked:!0,items:this.values(e.resize({top:1}),t)}]},values:function(n,i){var r=[],o=u,s=n.column(i),a=n.sheet();return s.forEachCell(function(t,n,i){i.dataType=void 0===i.value?"blank":i.format?e.spreadsheet.formatting.type(i.value,i.format):typeof i.value,i.text=null!==i.value&&i.format?e.spreadsheet.formatting.text(i.value,i.format):i.value?i.value:o.blanks,"percent"===i.dataType&&(i.dataType="number"),"date"===i.dataType&&(i.value=e.spreadsheet.numberToDate(i.value)),i.hasOwnProperty("wrap")&&delete i.wrap,i.checked=!a.isHiddenRow(t),r.push(i)}),r=t(r),r.sort(function(e,t){return e.dataType===t.dataType?0:"blank"===e.dataType||"blank"===t.dataType?"blank"===e.dataType?-1:1:"number"===e.dataType||"number"===t.dataType?"number"===e.dataType?-1:1:"date"===e.dataType||"date"===t.dataType?"date"===e.dataType?-1:1:0}),r},filterType:function(e,t){var n,i,r,o=e.sheet(),s=this.filterForColumn(t,o);return s=s&&s.filter.toJSON(),s&&"custom"==s.filter&&(i=s.criteria[0].value,i instanceof Date?n="date":"string"==typeof i?n="string":"number"==typeof i&&(n="number")),n||(r=this.values(e.row(1),t)[0],n=r&&r.dataType,"blank"==n&&(n=null)),n},filterForColumn:function(e,t){var n,i=t.filter();return i&&(n=i.columns.filter(function(t){return t.index===e})[0]),n},filter:function(e,t){var n,i,r,o,s=this.filterForColumn(e,t);if(s)return n=s.filter.toJSON(),i=n.filter,delete n.filter,r={type:i,options:n},o=n.criteria,o&&o.length&&(r.operator=o[0].operator),r}},f=s.extend({init:function(e,t){s.call(this,e,t),this.element.addClass(f.classNames.wrapper),this.viewModel=new h({active:"value",operator:null,operators:r(this.options.operators),clear:this.clear.bind(this),apply:this.apply.bind(this)}),this._filterInit(),this._popup(),this._sort(),this._filterByCondition(),this._filterByValue(),this._actionButtons()},options:{name:"FilterMenu",column:0,range:null,operators:{string:{contains:"Text contains",doesnotcontain:"Text does not contain",startswith:"Text starts with",endswith:"Text ends with"},date:{eq:"Date is",neq:"Date is not",lt:"Date is before",gt:"Date is after"},number:{eq:"Is equal to",neq:"Is not equal to",gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"}}},events:["action"],destroy:function(){s.fn.destroy.call(this),this.menu.destroy(),this.valuesTreeView.destroy(),this.popup.destroy()},openFor:function(e){this.popup.setOptions({anchor:e}),this.popup.open()},close:function(){this.popup.close()},clear:function(){this.action({command:"ClearFilterCommand",options:{column:this.options.column}}),this.viewModel.reset(),this.close()},apply:function(){var e,t,n;this._active(),e={operatingRange:this.options.range,column:this.options.column},"value"===this.viewModel.active?(this.viewModel.valuesChange({sender:this.valuesTreeView}),t=this.viewModel.valueFilter.toJSON(),t.values&&t.values.length&&(e.valueFilter=t)):"custom"===this.viewModel.active&&(n=this.viewModel.customFilter.toJSON(),n.criteria.length&&null!==n.criteria[0].value&&(e.customFilter=n)),(e.valueFilter||e.customFilter)&&this.action({command:"ApplyFilterCommand",options:e})},action:function(e){this.trigger("action",o.extend({},e))},_filterInit:function(){var e,t=this.options.column,n=this.options.range,i=n.sheet(),r=d.filter(t,i);r?(e=d.filterType(n,t),this.viewModel.set("active",r.type),this.viewModel.set(r.type+"Filter",r.options),"custom"==r.type&&(this.viewModel.set("operator",e+"_"+r.operator),this.viewModel.set("operatorType",e))):this.viewModel.reset()},_popup:function(){this.popup=this.element.kendoPopup({copyAnchorStyles:!1}).data("kendoPopup")},_sort:function(){var t=e.template(f.templates.menuItem),n=u,i=[{command:"sort",dir:"asc",text:n.sortAscending,iconClass:"sort-asc"},{command:"sort",dir:"desc",text:n.sortDescending,iconClass:"sort-desc"}],r=o("<ul />",{html:e.render(t,i)}).appendTo(this.element);this.menu=r.kendoMenu({orientation:"vertical",select:function(e){var t=o(e.item).data("dir"),n=this.options.range.resize({top:1}),i={value:t,sheet:!1,operatingRange:n,column:this.options.column};n.isSortable()?this.action({command:"SortCommand",options:i}):this.close()}.bind(this)}).data("kendoMenu")},_appendTemplate:function(t,n,i,r){var s=e.template(t),a=o("<div class='"+n+"'/>").html(s({messages:u,guid:e.guid(),ns:e.ns}));return this.element.append(a),i&&(i=new l(a,{expanded:r,toggle:this._detailToggle.bind(this)})),e.bind(a,this.viewModel),a},_detailToggle:function(e){this.element.find("[data-role=details]").not(e.sender.element).data("kendoDetails").toggle(!e.show)},_filterByCondition:function(){var e="custom"===this.viewModel.active;this._appendTemplate(f.templates.filterByCondition,f.classNames.filterByCondition,!0,e)},_filterByValue:function(){var t,n="value"===this.viewModel.active,i=this._appendTemplate(f.templates.filterByValue,f.classNames.filterByValue,!0,n);this.valuesTreeView=i.find("[data-role=treeview]").data("kendoTreeView"),t=d.valuesTree(this.options.range,this.options.column),this.viewModel.set("valuesDataSource",new e.data.HierarchicalDataSource({data:t}))},_actionButtons:function(){this._appendTemplate(f.templates.actionButtons,f.classNames.actionButtons,!1)},_active:function(){var e=this.element.find("[data-role=details]").filter(function(e,t){return o(t).data("kendoDetails").visible()});e.hasClass(f.classNames.filterByValue)?this.viewModel.set("active","value"):e.hasClass(f.classNames.filterByCondition)&&this.viewModel.set("active","custom")}}),e.spreadsheet.FilterMenu=f,o.extend(!0,f,{classNames:a,templates:c}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/editor.min",["kendo.core.min"],e)}(function(){!function(e){function t(e,t){return e&&(e.top!==t.top||e.left!==t.left)}if(!(e.support.browser.msie&&9>e.support.browser.version)){var n=e.Observable.extend({init:function(t){e.Observable.fn.init.call(this),this.view=t,this.formulaBar=t.formulaBar,this.barInput=t.formulaBar.formulaInput,this.cellInput=t.formulaInput,this.barInput.syncWith(this.cellInput),this.cellInput.syncWith(this.barInput),this.barInput.bind("keyup",this._triggerUpdate.bind(this)),this.cellInput.bind("keyup",this._triggerUpdate.bind(this)),this.barInput.bind("focus",this._focus.bind(this)),this.cellInput.bind("focus",this._focus.bind(this))},events:["activate","deactivate","change","update"],_focus:function(e){this.lastActive=e.sender==this.barInput?"bar":"cell"},_triggerUpdate:function(){this.trigger("update",{value:this.value()})},activeEditor:function(){var t=null,n=e._activeElement();return this.barElement()[0]===n?t=this.barInput:this.cellElement()[0]===n&&(t=this.cellInput),t},activate:function(e){return this._active=!0,this._rect=e.rect,this.cellInput.position(e.rect),this.cellInput.resize(e.rect),this.cellInput.tooltip(e.tooltip),this.cellInput.activeCell=this.barInput.activeCell=e.range.topLeft,this.trigger("activate"),this},deactivate:function(){var e=this.cellInput;this._active&&(e.value()!=this._value&&this.trigger("change",{value:e.value()})||(this._active=!1,this._rect=null,e.hide(),this.trigger("deactivate")))},enable:function(e){this.barInput.enable(e)},barElement:function(){return this.barInput.element},cellElement:function(){return this.cellInput.element},focusLastActive:function(){this.focus(this.lastActive)},focus:function(e){e=e||"cell","cell"===e?(this.cellInput.element.focus(),this.cellInput.end()):this.barInput.element.focus()},isActive:function(){return this._active},isFiltered:function(){return this.barInput.popup.visible()||this.cellInput.popup.visible()},canInsertRef:function(e){var t=this.activeEditor();return t&&t.canInsertRef(e)},highlightedRefs:function(){var e=this.activeEditor(),t=[];return e&&(t=e.highlightedRefs()),t},scale:function(){this.cellInput.scale()},toggleTooltip:function(e){this.cellInput.toggleTooltip(t(this._rect,e))},value:function(e){return void 0===e?this.barInput.value():(null===e&&(e=""),this._value=e,this.barInput.value(e),void this.cellInput.value(e))}});e.spreadsheet.SheetEditor=n}}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/autofill.min",["spreadsheet/runtime.min","spreadsheet/range.min"],e)}(function(){"use strict";function e(e){var t,n,i,r,o,s=e.length,a=(s+1)/2,l=e.reduce(function(e,t){return e+t},0)/s,u=0,c=0;for(t=0;s>t;t++)n=t+1-a,i=e[t]-l,u+=n*i,c+=n*n;return c?(r=u/c,o=l-r*a,function(e){return o+r*(e+1)}):function(t){return e[t%e.length]}}function t(t){function o(e){var t,n=e[1]-e[0];for(t=2;e.length>t;++t)if(e[t]-e[t-1]!=n)return null;return n}function s(e){return e.map(function(e){return e.number})}var a=[],l=t.map(function(e){return e.formula||e.value});return r(l,function(i,r,u,c){var h,d,f,p,m;for("number"==u?(d=s(c),1==d.length&&(i>0||l.length>r||"date"==n(d[0],t[i].format))&&d.push(d[0]+1),h=e(d)):"string"==u||"formula"==u||"boolean"==u?h=function(e,t){return l[t]}:Array.isArray(u)?1==c.length?h=function(e){return u[(c[0].number+e)%u.length]}:(f=o(s(c)),h=null==f?function(e){return c[e%c.length].value}:function(e){var t=c[0].number+f*e;return u[t%u.length]}):"null"!=u?(d=s(c),1==d.length&&d.push(d[0]+1),d=e(d),h=function(e,t){return l[t].replace(/^(.*\D)\d+/,"$1"+d(e,t))}):h=function(){return null},p={f:h,begin:i,end:r,len:r-i},m=i;r>m;++m)a[m]=p}),function(e,n){var r=a[n],o=e/l.length|0,s=e%l.length,u=o*r.len+s-r.begin,c=r.f(u,n),h=i(t[n]);return c instanceof d?h.formula=c:h.value=c,h}}function n(e,t){return null!=t?u.formatting.type(e,t):void 0}function i(e){var t={};return Object.keys(e||{}).forEach(function(n){t[n]=e[n]}),t}function r(e,t){var n,i,r=null,s=0,a=[];for(i=0;e.length>i;++i)n=o(e[i]),a.push(n),null!=r&&n.type!==r.type&&(t(s,i,r.type,a.slice(s,i)),s=i),r=n;t(s,i,r.type,a.slice(s,i))}function o(e){var t,n;if("number"==typeof e)return{type:"number",number:e};if("string"==typeof e)return(t=a(e))?t:(n=/^(.*\D)(\d+)/.exec(e),n?(e=e.replace(/^(.*\D)\d+/,"$1-######"),{type:e,match:n,number:parseFloat(n[2])}):{type:"string"});if("boolean"==typeof e)return{type:"boolean"};if(null==e)return{type:"null"};if(e instanceof d)return{type:"formula"};throw window.console.error(e),Error("Cannot fill data")}function s(){var e=kendo.culture();return[e.calendars.standard.days.namesAbbr,e.calendars.standard.days.names,e.calendars.standard.months.namesAbbr,e.calendars.standard.months.names]}function a(e){var t,n,i,r,o=e.toLowerCase(),a=s();for(t=0;a.length>t;++t)for(n=a[t],i=n.length;--i>=0;)if(r=n[i].toLowerCase(),r==o)return{type:n,number:i,value:e}}function l(e){var t,n,i=e.length,r=e[0].length,o=[];for(t=0;r>t;++t)for(o[t]=[],n=0;i>n;++n)o[t][n]=e[n][t];return o}var u,c,h,d,f,p;kendo.support.browser.msie&&kendo.support.browser.version<9||(u=kendo.spreadsheet,c=u.Range,h=u.calc.runtime,d=h.Formula,f="Incompatible ranges in fillFrom",p="Cannot determine fill direction",c.prototype._previewFillFrom=function(e,n){var i,r,o,s,a,u,c,h,d,m,g,v,b,w,y=this,_=y._sheet;if("string"==typeof e&&(e=_.range(e)),i=e._ref.toRangeRef(),r=y._ref.toRangeRef(),i.intersects(r)){if(i.eq(r))return null;if(r=r.clone(),i.topLeft.eq(r.topLeft))if(i.width()==r.width())r.topLeft.row+=i.height(),n=0;else{if(i.height()!=r.height())throw Error(f);r.topLeft.col+=i.width(),n=1}else{if(!i.bottomRight.eq(r.bottomRight))throw Error(f);if(i.width()==r.width())r.bottomRight.row-=i.height(),n=2;else{if(i.height()!=r.height())throw Error(f);r.bottomRight.col-=i.width(),n=3}}return _.range(r)._previewFillFrom(e,n)}if(null==n)if(i.topLeft.col==r.topLeft.col)n=r.topLeft.row>i.topLeft.row?0:2;else{if(i.topLeft.row!=r.topLeft.row)throw Error(p);n=r.topLeft.col>i.topLeft.col?1:3}if(o=1&n,s=2&n,o&&i.height()!=r.height()||!o&&i.width()!=r.width())throw Error(f);for(a=e._properties(),o?u=r.width():(a=l(a),u=r.height()),c=Array(a.length),h=0;a.length>h;++h)for(d=a[h],m=t(d),g=c[h]=Array(u),v=0;u>v;++v)b=s?-v-1:d.length+v,w=s?d.length-v%d.length-1:v%d.length,g[s?u-v-1:v]=m(b,w);return o||(c=l(c)),{props:c,direction:n,dest:y}},c.prototype.fillFrom=function(e,t){var n=this._previewFillFrom(e,t);return n.dest._properties(n.props),n.dest})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/print.min",["kendo.pdf.min","spreadsheet/sheet.min","spreadsheet/range.min","spreadsheet/references.min","spreadsheet/numformat.min","util/text-metrics.min"],e)}(function(){"use strict";function e(e,t){var n=0,i=[],r=.2*t,o=t;return e.forEach(function(e){t&&n+e>o&&(r>o-n&&(n=t*Math.ceil(n/t)),o+=t*Math.ceil(e/t)),i.push(n),n+=e}),i.push(n),i}function t(e,t){var n=e._grid,i={},r={};return e.forEachMergedCell(t,function(e){var o=e.topLeft;n.forEach(e,function(n){o.eq(n)?i[n.print()]=e:t.contains(n)&&(r[n.print()]=o)})}),{primary:i,secondary:r}}function n(n,a,l){var u,c,h,d,f,m,g,v,b=[],w=[],y=[],_=t(n,a),x=-1,k=-1;return n.forEach(a,function(e,t,i){var r,s,u,c=e-a.topLeft.row,h=t-a.topLeft.col;h||w.push(n.rowHeight(e)),c||y.push(n.columnWidth(t)),n.isHiddenColumn(t)||n.isHiddenRow(e)||(r=l.forScreen||o(i),(l.emptyCells||r)&&(s=new p(e,t).print(),_.secondary[s]||(r?(x=Math.max(x,c),k=Math.max(k,h)):i.empty=!0,u=_.primary[s],u?(delete _.primary[s],i.merged=!0,i.rowspan=u.height(),i.colspan=u.width(),l.forScreen&&(i.width=n._columns.sum(u.topLeft.col,u.bottomRight.col),i.height=n._rows.sum(u.topLeft.row,u.bottomRight.row))):(i.rowspan=1,i.colspan=1),i.row=c,i.col=h,b.push(i))))}),w=w.slice(0,x+1),y=y.slice(0,k+1),u=l.pageWidth,c=l.pageHeight,h=1,l.fitWidth&&(d=y.reduce(i,0),d>u&&(h=u/d,u/=h,c/=h)),f=e(w,c||0),m=e(y,u||0),g=0,v=0,b=b.filter(function(e){return e.empty&&(e.row>x||e.col>k)?!1:(e.left=m[e.col],
  e.top=f[e.row],e.merged?l.forScreen?(e.right=e.left+e.width,e.bottom=e.top+e.height):(e.right=r(m,e.col+e.colspan),e.bottom=r(f,e.row+e.rowspan),e.width=e.right-e.left,e.height=e.bottom-e.top):(e.width=y[e.col],e.height=w[e.row],e.bottom=e.top+e.height,e.right=e.left+e.width),g=Math.max(g,e.right),v=Math.max(v,e.bottom),!0)}),Object.keys(_.primary).forEach(function(e){var t=_.primary[e];n.forEach(t.topLeft.toRangeRef(),function(e,i,r){var o=e-a.topLeft.row,s=i-a.topLeft.col;r.merged=!0,r.colspan=t.height(),r.rowspan=t.width(),r.top=0>o?-n._rows.sum(e,e-o-1):f[o],r.left=0>s?-n._columns.sum(i,i-s-1):m[s],r.height=n._rows.sum(t.topLeft.row,t.bottomRight.row),r.width=n._columns.sum(t.topLeft.col,t.bottomRight.col),r.right=r.left+r.width,r.bottom=r.top+r.height,b.push(r)})}),{width:g,height:v,cells:b.sort(s),scale:h,xCoords:m,yCoords:f}}function i(e,t){return e+t}function r(e,t){return e.length>t?e[t]:e[e.length-1]}function o(e){return null!=e.value||e.merged||null!=e.background||null!=e.borderTop||null!=e.borderRight||null!=e.borderBottom||null!=e.borderLeft}function s(e,t){return t.top>e.top?-1:e.top==t.top?t.left>e.left?-1:e.left==t.left?0:1:1}function a(e,t,n){function i(i,r){var o,s,a,h,d,f=r*u,p=f+u,g=i*c,w=g+c,y=0,_=0,x=e.cells.filter(function(e){return f>=e.right||e.left>=p||g>=e.bottom||e.top>=w?!1:(y=Math.max(e.bottom,y),_=Math.max(e.right,_),!0)});x.length>0&&(o=new m.Group,t.append(o),o.clip(m.Path.fromRect(new v.Rect([0,0],[n.pageWidth,n.pageHeight]))),s=new m.Group,o.append(s),a=v.Matrix.scale(e.scale,e.scale).multiplyCopy(v.Matrix.translate(-f,-g)),(n.hCenter||n.vCenter)&&(a=a.multiplyCopy(v.Matrix.translate(n.hCenter?(p-_)/2:0,n.vCenter?(w-y)/2:0))),s.transform(a),n.guidelines&&(h=null,e.xCoords.forEach(function(e){e=Math.min(e,_),e!==h&&e>=f&&p>=e&&(h=e,s.append((new m.Path).moveTo(e,g).lineTo(e,y).close().stroke("#999",b)))}),h=null,e.yCoords.forEach(function(e){e=Math.min(e,y),e!==h&&e>=g&&w>=e&&(h=e,s.append((new m.Path).moveTo(f,e).lineTo(_,e).close().stroke("#999",b)))})),d=new m.Group,x.forEach(function(e){l(e,s,d,n)}),s.append(d))}var r,o,s=Math.ceil(e.width/n.pageWidth),a=Math.ceil(e.height/n.pageHeight),u=n.pageWidth/e.scale,c=n.pageHeight/e.scale;for(r=0;s>r;++r)for(o=0;a>o;++o)i(o,r)}function l(e,t,n,i){var r,o,s,a,l,c,h=new m.Group;if(t.append(h),r=new v.Rect([e.left,e.top],[e.width,e.height]),(e.background||e.merged)&&(o=r,i.guidelines&&(o=r.clone(),o.origin.x+=b/2,o.origin.y+=b/2,o.size.width-=b,o.size.height-=b),h.append(new m.Rect(o).fill(e.background||"#fff").stroke(null))),e.borderLeft&&n.append((new m.Path).moveTo(e.left,e.top).lineTo(e.left,e.bottom).close().stroke(e.borderLeft.color,e.borderLeft.size)),e.borderTop&&n.append((new m.Path).moveTo(e.left,e.top).lineTo(e.right,e.top).close().stroke(e.borderTop.color,e.borderTop.size)),e.borderRight&&n.append((new m.Path).moveTo(e.right,e.top).lineTo(e.right,e.bottom).close().stroke(e.borderRight.color,e.borderRight.size)),e.borderBottom&&n.append((new m.Path).moveTo(e.left,e.bottom).lineTo(e.right,e.bottom).close().stroke(e.borderBottom.color,e.borderBottom.size)),s=e.value,null!=s){if(a="number"==typeof s?"number":null,l=new m.Group,l.clip(m.Path.fromRect(r)),h.append(l),e.format?(c=g.textAndColor(s,e.format),s=c.text,c.type&&(a=c.type)):s+="",!e.textAlign)switch(a){case"number":case"date":case"percent":e.textAlign="right";break;case"boolean":e.textAlign="center"}u(s,c&&c.color||e.color||"#000",e,l)}}function u(e,t,n,i){var r,o,s,a,l=n.left+2,u=n.top+2,d=n.width-4,f=n.height-4,p=h(n),g={font:p},b={font:p,fill:{color:t}},w=[],y=0,_=u;switch(n.wrap?(c(e,g,d).forEach(function(e){var t=new m.Text(e.text,[l,_],b);_+=e.box.height,w.push({el:t,box:e.box})}),y=_-u):(r=new m.Text(e,[l,_],b),o=kendo.util.measureText(e,g),w.push({el:r,box:o}),y=o.height),s=new m.Group,i.append(s),a=0,n.verticalAlign){case"center":a=f-y>>1;break;case void 0:case null:case"bottom":a=f-y}0>a&&(a=0),w.forEach(function(e){s.append(e.el);var t=0;switch(n.textAlign){case"center":t=d-e.box.width>>1;break;case"right":t=d-e.box.width}0>t&&(t=0),(t||a)&&e.el.transform(v.Matrix.translate(t,a))})}function c(e,t,n){function i(o,a,l){var u=e.substring(s,a).trim(),c=kendo.util.measureText(u,t);n>=c.width?l-1>a?i(a,a+l>>1,l):(r.push({text:u,box:c}),s=a):a>o&&i(o,o+a>>1,a)}for(var r=[],o=e.length,s=0;o>s;)i(s,o,o);return r}function h(e){var t=[];return e.italic&&t.push("italic"),e.bold&&t.push("bold"),t.push((e.fontSize||12)+"px"),t.push(e.fontFamily||"Arial"),t.join(" ")}function d(e,t,i,r){var o,s,l,u,c;null==i&&null==r&&(r=t,i={},t=f.SHEETREF),null==r&&(r=i,t instanceof f.Range||t instanceof f.Ref||"string"==typeof t?i={}:(i=t,t=f.SHEETREF)),i=kendo.jQuery.extend({paperSize:"A4",landscape:!0,margin:"1cm",guidelines:!0,emptyCells:!0,fitWidth:!1,center:!1},i),o=new m.Group,s=kendo.pdf.getPaperOptions(i),o.options.set("pdf",{author:i.author,creator:i.creator,date:i.date,keywords:i.keywords,margin:s.margin,multiPage:!0,paperSize:s.paperSize,subject:i.subject,title:i.title}),l=s.paperSize[0],u=s.paperSize[1],s.margin&&(l-=s.margin.left+s.margin.right,u-=s.margin.top+s.margin.bottom),i.pageWidth=l,i.pageHeight=u,c=n(e,e._ref(t),i),a(c,o,i),r(o)}var f,p,m,g,v,b;kendo.support.browser.msie&&kendo.support.browser.version<9||(f=kendo.spreadsheet,p=f.CellRef,m=kendo.drawing,g=f.formatting,v=kendo.geometry,b=.8,f.Sheet.prototype.draw=function(e,t,n){var i=this;i._workbook?i.recalc(i._workbook._context,function(){d(i,e,t,n)}):d(i,e,t,n)},f.draw={doLayout:n,drawLayout:a,shouldDrawCell:o})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.spreadsheet.min",["util/undoredostack.min","util/text-metrics.min","util/parse-xml.min","kendo.excel.min","kendo.progressbar.min","kendo.pdf.min","spreadsheet/commands.min","spreadsheet/formulabar.min","spreadsheet/formulainput.min","spreadsheet/eventlistener.min","spreadsheet/rangelist.min","spreadsheet/propertybag.min","spreadsheet/references.min","spreadsheet/navigator.min","spreadsheet/axismanager.min","spreadsheet/clipboard.min","spreadsheet/range.min","spreadsheet/sheet.min","spreadsheet/sheetsbar.min","spreadsheet/excel-reader.min","spreadsheet/workbook.min","spreadsheet/formulacontext.min","spreadsheet/controller.min","spreadsheet/view.min","spreadsheet/grid.min","spreadsheet/axis.min","spreadsheet/filter.min","spreadsheet/sorter.min","spreadsheet/runtime.min","spreadsheet/calc.min","spreadsheet/numformat.min","spreadsheet/runtime.functions.min","spreadsheet/runtime.functions.2.min","spreadsheet/toolbar.min","spreadsheet/dialogs.min","spreadsheet/sheetbinder.min","spreadsheet/filtermenu.min","spreadsheet/editor.min","spreadsheet/autofill.min","spreadsheet/print.min"],e)}(function(){!function(e,t){var n,i,r,o,s,a,l,u,c;e.support.browser.msie&&9>e.support.browser.version||(n=e.jQuery,i=e.ui.Widget,r=e.spreadsheet.Workbook,o=e.spreadsheet.Controller,s=e.spreadsheet.View,a=".kendoSpreadsheet",l={recalc:!0,selection:!0,activeCell:!0,layout:!0,sheetSelection:!0,resize:!0,editorChange:!1,editorClose:!1},u={wrapper:"k-widget k-spreadsheet"},c=e.ui.Widget.extend({init:function(e,t){i.fn.init.call(this,e,t),this.element.addClass(c.classNames.wrapper),this._view=new s(this.element,{toolbar:this.options.toolbar,sheetsbar:this.options.sheetsbar}),this._workbook=new r(this.options,this._view),this._controller=new o(this._view,this._workbook),this._autoRefresh=!0,this._bindWorkbookEvents(),this._view.workbook(this._workbook),this.refresh(),this._resizeHandler=function(){this.resize()}.bind(this),n(window).on("resize"+a,this._resizeHandler)},_resize:function(){this.refresh({layout:!0})},_workbookChange:function(t){if(this._autoRefresh&&this.refresh(t),t.recalc&&t.ref){var n=new e.spreadsheet.Range(t.ref,this.activeSheet());this.trigger("change",{range:n})}},activeSheet:function(e){return this._workbook.activeSheet(e)},moveSheetToIndex:function(e,t){return this._workbook.moveSheetToIndex(e,t)},insertSheet:function(e){return this._workbook.insertSheet(e)},sheets:function(){return this._workbook.sheets()},removeSheet:function(e){return this._workbook.removeSheet(e)},sheetByName:function(e){return this._workbook.sheetByName(e)},sheetIndex:function(e){return this._workbook.sheetIndex(e)},sheetByIndex:function(e){return this._workbook.sheetByIndex(e)},renameSheet:function(e,t){return this._workbook.renameSheet(e,t)},refresh:function(e){return e||(e=l),e.editorClose||(this._view.sheet(this._workbook.activeSheet()),this._controller.sheet(this._workbook.activeSheet()),this._workbook.refresh(e)),e.editorChange||(this._view.refresh(e),this._controller.refresh(),this._view.render(),this.trigger("render")),this},openDialog:function(e,t){return this._view.openDialog(e,t)},autoRefresh:function(e){return e!==t?(this._autoRefresh=e,e===!0&&this.refresh(),this):this._autoRefresh},toJSON:function(){return this._workbook.toJSON()},fromJSON:function(e){e.sheets?(this._workbook.destroy(),this._workbook=new r(n.extend({},this.options,e)),this._bindWorkbookEvents(),this._view.workbook(this._workbook),this._controller.workbook(this._workbook),this.activeSheet(this.activeSheet())):this.refresh()},fromFile:function(e,t){return this._workbook.fromFile(e,t)},saveAsPDF:function(e){this._workbook.saveAsPDF(n.extend({},this.options.pdf,e,{workbook:this._workbook}))},saveAsExcel:function(e){this._workbook.saveAsExcel(e)},draw:function(e,t){this._workbook.draw(e,t)},_workbookExcelExport:function(e){this.trigger("excelExport",e)&&e.preventDefault()},_workbookExcelImport:function(e){this.trigger("excelImport",e)?e.preventDefault():this._initProgress(e.promise)},_initProgress:function(t){var i=n("<div class='k-loading-mask' style='width: 100%; height: 100%; top: 0;'><div class='k-loading-color'/></div>").appendTo(this.element),r=n("<div class='k-loading-progress'>").appendTo(i).kendoProgressBar({type:"chunk",chunkCount:10,min:0,max:1,value:0}).data("kendoProgressBar");t.progress(function(e){r.value(e.progress)}).always(function(){e.destroy(i),i.remove()})},_workbookPdfExport:function(e){this.trigger("pdfExport",e)&&e.preventDefault()},_bindWorkbookEvents:function(){this._workbook.bind("change",this._workbookChange.bind(this)),this._workbook.bind("excelExport",this._workbookExcelExport.bind(this)),this._workbook.bind("excelImport",this._workbookExcelImport.bind(this)),this._workbook.bind("pdfExport",this._workbookPdfExport.bind(this))},destroy:function(){e.ui.Widget.fn.destroy.call(this),this._workbook.destroy(),this._controller.destroy(),this._view.destroy(),this._resizeHandler&&n(window).off("resize"+a,this._resizeHandler)},options:{name:"Spreadsheet",toolbar:!0,sheetsbar:!0,rows:200,columns:50,rowHeight:20,columnWidth:64,headerHeight:20,headerWidth:32,excel:{proxyURL:"",fileName:"Workbook.xlsx"},pdf:{area:"workbook",fileName:"Workbook.pdf",proxyURL:"",paperSize:"a4",landscape:!0,margin:null,title:null,author:null,subject:null,keywords:null,creator:"Kendo UI PDF Generator v."+e.version,date:null}},events:["pdfExport","excelExport","excelImport","change","render"]}),e.spreadsheet.ALL_REASONS=l,e.ui.plugin(c),n.extend(!0,c,{classNames:u}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});
  //# sourceMappingURL=kendo.spreadsheet.min.js.map
  