<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[3761] sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets: WordCamp Spreadsheets: Delete the plugin.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/3761">3761</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/3761","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>iandunn</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-08-01 23:10:39 +0000 (Mon, 01 Aug 2016)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>WordCamp Spreadsheets: Delete the plugin.
This plugin was originally intended to replace the need for Google Sheets, but was never finished or used. The new Budget modules in the WordCamp Payments plugin is filling that need now, so there's no reason to keep this around.</pre>
<h3>Removed Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsTODOtxt">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/TODO.txt</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsbootstrapphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/bootstrap.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsclasseswcssspreadsheetphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/classes/wcss-spreadsheet.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsclasseswordcampspreadsheetsphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/classes/wordcamp-spreadsheets.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetscsswordcampspreadsheetscss">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/css/wordcamp-spreadsheets.css</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollbarhorizontalpng">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scrollbar-horizontal.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollbarverticalpng">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scrollbar-vertical.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollbuttonverticalpng">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scrollbutton-vertical.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollerdownarrowpng">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-down-arrow.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollerdownarrow_hoverpng">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-down-arrow_hover.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollerleftarrowpng">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-left-arrow.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollerleftarrow_hoverpng">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-left-arrow_hover.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollerrightarrowpng">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-right-arrow.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollerrightarrow_hoverpng">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-right-arrow_hover.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrolleruparrowpng">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-up-arrow.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrolleruparrow_hoverpng">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-up-arrow_hover.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_flat_0_2d5972_40x100png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_flat_0_2d5972_40x100.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_flat_0_4f4f4f_40x100png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_flat_0_4f4f4f_40x100.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_highlighthard_80_c4c4c4_1x100png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_highlight-hard_80_c4c4c4_1x100.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_highlightsoft_100_83b0ca_1x100png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_highlight-soft_100_83b0ca_1x100.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_highlightsoft_100_c0c0c0_1x100png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_highlight-soft_100_c0c0c0_1x100.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_highlightsoft_100_c4c4c4_1x100png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_highlight-soft_100_c4c4c4_1x100.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_highlightsoft_100_ccccd1_1x100png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_highlight-soft_100_ccccd1_1x100.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_insethard_65_85b2cb_1x100png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_inset-hard_65_85b2cb_1x100.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_insetsoft_95_fef1ec_1x100png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_inset-soft_95_fef1ec_1x100.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuiicons_2e83ff_256x240png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-icons_2e83ff_256x240.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuiicons_38667f_256x240png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-icons_38667f_256x240.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuiicons_616161_256x240png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-icons_616161_256x240.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuiicons_898989_256x240png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-icons_898989_256x240.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuiicons_cd0a0a_256x240png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-icons_cd0a0a_256x240.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuiicons_ffffff_256x240png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-icons_ffffff_256x240.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesverticalmenuitempng">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/vertical-menu-item.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimageswijmouiicons_000000_240x112png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/wijmo-ui-icons_000000_240x112.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimageswijmouiicons_ffffff_240x112png">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/wijmo-ui-icons_ffffff_240x112.png</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsjquerywijmocss">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/jquery-wijmo.css</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsjquerywijmowijspreadalljs">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/jquery.wijmo.wijspread.all.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsjquerywijmowijspreadcss">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/jquery.wijmo.wijspread.css</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsjavascriptwordcampspreadsheetsjs">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/javascript/wordcamp-spreadsheets.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsviewsspreadsheetcontainerphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/views/spreadsheet-container.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsTODOtxt"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/TODO.txt</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/TODO.txt 2016-08-01 21:35:00 UTC (rev 3760)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/TODO.txt 2016-08-01 23:10:39 UTC (rev 3761)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,12 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-# High priority:
-
-* Update to latest version of SpreadJS
-* Add WYSIWYG toolbar
-* Set read-only mode on front-end
-* Distraction free mode
-* Add stub for budget
-
-# Low priority:
-
-* Minify SpreadJS CSS includes
-* Load js,css on relevant front/back-end ages only
</del></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsbootstrapphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/bootstrap.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/bootstrap.php 2016-08-01 21:35:00 UTC (rev 3760)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/bootstrap.php 2016-08-01 23:10:39 UTC (rev 3761)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,20 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-/*
-Plugin Name: WordCamp Spreadsheets
-Description: Create and share spreadsheets
-Version: 0.1
-Author: WordCamp Central
-Author URI: http://wordcamp.org
-*/
-
-if ( ! defined( 'ABSPATH' ) ) {
- die( 'Access denied.' );
-}
-
-require_once( __DIR__ . '/classes/wordcamp-spreadsheets.php' );
-require_once( __DIR__ . '/classes/wcss-spreadsheet.php' );
-
-$GLOBALS['WordCamp_Spreadsheets'] = new WordCamp_Spreadsheets();
-$GLOBALS['WCSS_Spreadsheet'] = new WCSS_Spreadsheet();
-
-register_activation_hook( __FILE__, array( $GLOBALS['WordCamp_Spreadsheets'], 'activate' ) );
</del></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsclasseswcssspreadsheetphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/classes/wcss-spreadsheet.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/classes/wcss-spreadsheet.php 2016-08-01 21:35:00 UTC (rev 3760)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/classes/wcss-spreadsheet.php 2016-08-01 23:10:39 UTC (rev 3761)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,148 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/*
- * Register the WordCamp Spreadsheets custom post type and manage all of its functionality
- */
-
-class WCSS_Spreadsheet {
- const POST_TYPE_SLUG = 'wcss';
-
- /**
- * Constructor
- */
- public function __construct() {
- add_action( 'init', array( $this, 'create_post_type' ) );
- add_action( 'admin_init', array( $this, 'add_meta_boxes' ) );
- add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );
- add_filter( 'the_content', array( $this, 'display_spreadsheet_on_front_end' ) );
- }
-
- /**
- * Registers the custom post type
- */
- public function create_post_type() {
- if ( post_type_exists( self::POST_TYPE_SLUG ) ) {
- return;
- }
-
- $labels = array(
- 'name' => __( 'WordCamp Spreadsheets', 'wordcamporg' ),
- 'singular_name' => __( 'WordCamp Spreadsheet', 'wordcamporg' ),
- 'add_new' => __( 'Add New', 'wordcamporg' ),
- 'add_new_item' => __( 'Add New WordCamp Spreadsheet', 'wordcamporg' ),
- 'edit' => __( 'Edit', 'wordcamporg' ),
- 'edit_item' => __( 'Edit WordCamp Spreadsheet', 'wordcamporg' ),
- 'new_item' => __( 'New WordCamp Spreadsheet', 'wordcamporg' ),
- 'view' => __( 'View WordCamp Spreadsheets', 'wordcamporg' ),
- 'view_item' => __( 'View WordCamp Spreadsheet', 'wordcamporg' ),
- 'search_items' => __( 'Search WordCamp Spreadsheets', 'wordcamporg' ),
- 'not_found' => __( 'No WordCamp Spreadsheets found', 'wordcamporg' ),
- 'not_found_in_trash' => __( 'No WordCamp Spreadsheets found in Trash', 'wordcamporg' ),
- 'parent' => __( 'Parent WordCamp Spreadsheet', 'wordcamporg' ),
- );
-
- $post_type_params = array(
- 'labels' => $labels,
- 'singular_label' => __( 'WordCamp Spreadsheet', 'wordcamporg' ),
- 'public' => true,
- 'menu_position' => 20,
- 'hierarchical' => false,
- 'capability_type' => 'post',
- 'has_archive' => true,
- 'rewrite' => array( 'slug' => self::POST_TYPE_SLUG ),
- 'query_var' => true,
- 'supports' => array( 'title', 'author', 'revisions' )
- );
-
- register_post_type( self::POST_TYPE_SLUG, $post_type_params );
- }
-
- /**
- * Adds meta boxes for the custom post type
- */
- public function add_meta_boxes() {
- add_meta_box(
- 'wcss_editor',
- __( 'Spreadsheet', 'wordcamporg' ),
- array( $this, 'markup_meta_boxes' ),
- self::POST_TYPE_SLUG,
- 'normal',
- 'core'
- );
- }
-
- /**
- * Builds the markup for all meta boxes
- *
- * @param WP_Post $post
- * @param array $box
- */
- public function markup_meta_boxes( $post, $box ) {
- switch ( $box['id'] ) {
- case 'wcss_editor':
- $spreadsheet_data = get_post_meta( $post->ID, 'wcss_spreadsheet_data', true );
- $view = 'spreadsheet-container.php';
- break;
- }
-
- require_once( dirname( __DIR__ ) . '/views/'. $view );
- }
-
- /**
- * Save the spreadsheet data
- *
- * @param int $post_id
- * @param WP_Post $post
- */
- public function save_post( $post_id, $post ) {
- $ignored_actions = array( 'trash', 'untrash', 'restore' );
-
- if ( isset( $_GET['action'] ) && in_array( $_GET['action'], $ignored_actions ) ) {
- return;
- }
-
- if ( ! $post || $post->post_type != self::POST_TYPE_SLUG || ! current_user_can( 'edit_post', $post_id ) ) {
- return;
- }
-
- if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || $post->post_status == 'auto-draft' ) {
- return;
- }
-
- $this->save_post_meta( $post_id, $_POST );
- }
-
- /**
- * Save the post's meta fields
- *
- * @param int $post_id
- * @param array $new_values
- */
- protected function save_post_meta( $post_id, $new_values ) {
- if ( isset( $new_values[ 'wcss_spreadsheet_data' ] ) ) {
- update_post_meta( $post_id, 'wcss_spreadsheet_data', json_decode( stripslashes( $new_values[ 'wcss_spreadsheet_data' ] ) ) );
- } else {
- delete_post_meta( $post_id, 'wcss_spreadsheet_data' );
- }
- }
-
- /**
- * Renders the spreadsheet when viewing on the front end
- *
- * @param $content
- * @return string
- */
- public function display_spreadsheet_on_front_end( $content ) {
- global $post;
-
- if ( ! is_admin() && isset ( $post->post_type ) && self::POST_TYPE_SLUG == $post->post_type ) {
- $spreadsheet_data = get_post_meta( $post->ID, 'wcss_spreadsheet_data', true );
-
- ob_start();
- require_once( dirname( __DIR__ ) . '/views/spreadsheet-container.php' );
- $content = ob_get_clean();
- }
-
- return $content;
- }
-} // end WCSS_Spreadsheet
</del></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsclasseswordcampspreadsheetsphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/classes/wordcamp-spreadsheets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/classes/wordcamp-spreadsheets.php 2016-08-01 21:35:00 UTC (rev 3760)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/classes/wordcamp-spreadsheets.php 2016-08-01 23:10:39 UTC (rev 3761)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,110 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/*
- * Main controller to handle general functionality
- */
-
-class WordCamp_Spreadsheets {
- const VERSION = '0.1';
-
- /**
- * Constructor
- */
- public function __construct() {
- add_action( 'wp_enqueue_scripts', array( $this, 'load_resources' ) );
- add_action( 'admin_enqueue_scripts', array( $this, 'load_resources' ) );
- }
-
- /**
- * Prepares sites to use the plugin during single or network-wide activation
- *
- * @param bool $network_wide
- */
- public function activate( $network_wide ) {
- if ( $network_wide && is_multisite() ) {
- $sites = wp_get_sites( array( 'limit' => false ) );
-
- foreach ( $sites as $site ) {
- switch_to_blog( $site['blog_id'] );
- $this->single_activate();
- }
-
- restore_current_blog();
- } else {
- $this->single_activate();
- }
- }
-
- /**
- * Runs activation code on a new WPMS site when it's created
- *
- * @param int $blog_id
- */
- public function activate_new_site( $blog_id ) {
- switch_to_blog( $blog_id );
- $this->single_activate();
- restore_current_blog();
- }
-
- /**
- * Prepares a single blog to use the plugin
- */
- protected function single_activate() {
- /** @var $WCSS_Spreadsheet WCSS_Spreadsheet */
- global $WCSS_Spreadsheet;
-
- $WCSS_Spreadsheet->create_post_type();
- flush_rewrite_rules();
- }
-
- /**
- * Enqueues CSS, JavaScript, etc
- */
- public function load_resources() {
- wp_register_script(
- 'wordcamp-spreadsheets',
- plugins_url( 'javascript/wordcamp-spreadsheets.js', dirname( __FILE__ ) ),
- array( 'jquery' ),
- self::VERSION,
- true
- );
-
- wp_register_script(
- 'spreadjs',
- plugins_url( 'includes/spreadjs/jquery.wijmo.wijspread.all.js', dirname( __FILE__ ) ),
- array( 'jquery', 'jquery-ui-core', 'jquery-ui-dialog', 'wordcamp-spreadsheets' ),
- self::VERSION,
- true
- );
-
- wp_register_style(
- 'wijmo',
- plugins_url( 'includes/spreadjs/jquery-wijmo.css', dirname( __FILE__ ) ),
- array(),
- self::VERSION,
- 'all'
- );
-
- wp_register_style(
- 'spreadjs',
- plugins_url( 'includes/spreadjs/jquery.wijmo.wijspread.css', dirname( __FILE__ ) ),
- array( 'wijmo' ),
- self::VERSION,
- 'all'
- );
-
- wp_register_style(
- 'wordcamp-spreadsheets',
- plugins_url( 'css/wordcamp-spreadsheets.css', dirname( __FILE__ ) ),
- array( 'spreadjs' ),
- self::VERSION,
- 'all'
- );
-
- wp_enqueue_script( 'wordcamp-spreadsheets' );
- wp_enqueue_script( 'spreadjs' );
-
- wp_enqueue_style( 'spreadjs' );
- wp_enqueue_style( 'wordcamp-spreadsheets' );
- }
-} // end WordCamp_Spreadsheets
</del></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetscsswordcampspreadsheetscss"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/css/wordcamp-spreadsheets.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/css/wordcamp-spreadsheets.css 2016-08-01 21:35:00 UTC (rev 3760)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/css/wordcamp-spreadsheets.css 2016-08-01 23:10:39 UTC (rev 3761)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,3 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-#wcss_spreadsheet_container {
- height: 500px;
-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollbarhorizontalpng"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scrollbar-horizontal.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollbarverticalpng"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scrollbar-vertical.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollbuttonverticalpng"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scrollbutton-vertical.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollerdownarrowpng"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-down-arrow.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollerdownarrow_hoverpng"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-down-arrow_hover.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollerleftarrowpng"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-left-arrow.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollerleftarrow_hoverpng"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-left-arrow_hover.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollerrightarrowpng"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-right-arrow.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrollerrightarrow_hoverpng"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-right-arrow_hover.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrolleruparrowpng"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-up-arrow.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesscrolleruparrow_hoverpng"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/scroller-up-arrow_hover.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_flat_0_2d5972_40x100png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_flat_0_2d5972_40x100.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_flat_0_4f4f4f_40x100png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_flat_0_4f4f4f_40x100.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_highlighthard_80_c4c4c4_1x100png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_highlight-hard_80_c4c4c4_1x100.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_highlightsoft_100_83b0ca_1x100png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_highlight-soft_100_83b0ca_1x100.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_highlightsoft_100_c0c0c0_1x100png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_highlight-soft_100_c0c0c0_1x100.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_highlightsoft_100_c4c4c4_1x100png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_highlight-soft_100_c4c4c4_1x100.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_highlightsoft_100_ccccd1_1x100png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_highlight-soft_100_ccccd1_1x100.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_insethard_65_85b2cb_1x100png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_inset-hard_65_85b2cb_1x100.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuibg_insetsoft_95_fef1ec_1x100png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-bg_inset-soft_95_fef1ec_1x100.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuiicons_2e83ff_256x240png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-icons_2e83ff_256x240.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuiicons_38667f_256x240png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-icons_38667f_256x240.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuiicons_616161_256x240png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-icons_616161_256x240.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuiicons_898989_256x240png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-icons_898989_256x240.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuiicons_cd0a0a_256x240png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-icons_cd0a0a_256x240.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesuiicons_ffffff_256x240png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/ui-icons_ffffff_256x240.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimagesverticalmenuitempng"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/vertical-menu-item.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimageswijmouiicons_000000_240x112png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/wijmo-ui-icons_000000_240x112.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsimageswijmouiicons_ffffff_240x112png"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/images/wijmo-ui-icons_ffffff_240x112.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsjquerywijmocss"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/jquery-wijmo.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/jquery-wijmo.css 2016-08-01 21:35:00 UTC (rev 3760)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/jquery-wijmo.css 2016-08-01 23:10:39 UTC (rev 3761)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,2831 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/*
- *
- * Wijmo Aristo Theme
- * http://wijmo.com/
- *
- * Copyright(c) GrapeCity, Inc. All rights reserved.
- *
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * licensing@wijmo.com
- * http://www.wijmo.com/license
- *
- * Based on the Aristo theme concept created by 280 North and Pinvoke (https://github.com/280north/aristo).
- *
-*/
-
-/* Layout helpers
-----------------------------------*/
-.ui-helper-hidden {
- display: none;
-}
-
-.ui-helper-hidden-accessible {
- position: absolute !important;
- clip: rect(1px 1px 1px 1px);
- clip: rect(1px,1px,1px,1px);
-}
-
-.ui-helper-reset {
- margin: 0;
- padding: 0;
- border: 0;
- outline: 0;
- line-height: 1.3;
- text-decoration: none;
- font-size: 100%;
- list-style: none;
-}
-
-.ui-helper-clearfix:before, .ui-helper-clearfix:after {
- content: "";
- display: table;
-}
-
-.ui-helper-clearfix:after {
- clear: both;
-}
-
-.ui-helper-clearfix {
- zoom: 1;
-}
-
-.ui-helper-zfix {
- width: 100%;
- height: 100%;
- top: 0;
- left: 0;
- position: absolute;
- opacity: 0;
- filter: Alpha(Opacity=0);
-}
-
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-disabled {
- cursor: default !important;
-}
-
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon {
- display: block;
- text-indent: -99999px;
- overflow: hidden;
- background-repeat: no-repeat;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
-}
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
-}
-
-
-/*
- * jQuery UI CSS Framework @VERSION
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Theming/API
- *
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Arial,sans-serif&fwDefault=bold&fsDefault=100%25&cornerRadius=3px&bgColorHeader=c0c0c0&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=100&borderColorHeader=a8a8a8&fcHeader=333&iconColorHeader=898989&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=100&borderColorContent=a8a8a8&fcContent=4f4f4f&iconColorContent=616161&bgColorDefault=c4c4c4&bgTextureDefault=04_highlight_hard.png&bgImgOpacityDefault=80&borderColorDefault=a8a8a8&fcDefault=4f4f4f&iconColorDefault=ffffff&bgColorHover=83b0ca&bgTextureHover=04_highlight_soft.png&bgImgOpacityHover=100&borderColorHover=8ab0c6&fcHover=313131&iconColorHover=ffffff&bgColorActive=85b2cb&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=65&borderColorActive=7096ab&fcActive=1C4257&iconColorActive=ffffff
&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=666666&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=05_inset_soft.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=2d5972&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=4f4f4f&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
- */
-
-
-/* Component containers
-----------------------------------*/
-.ui-widget {
- font-family: Arial,sans-serif;
- font-size: 100%;
-}
-
- .ui-widget .ui-widget {
- font-size: 1em;
- }
-
- .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
- font-family: Arial,sans-serif;
- font-size: 1em;
- }
-
-.ui-widget-content {
- border: 1px solid #a8a8a8;
- background: #ffffff;
- color: #4f4f4f;
-}
-
- .ui-widget-content a {
- color: #4f4f4f;
- }
-
-.ui-widget-header {
- border: 1px solid #a8a8a8;
- background: #c0c0c0 url(images/ui-bg_highlight-soft_100_c0c0c0_1x100.png) top repeat-x;
- color: #333;
- font-weight: bold;
- text-shadow: 0px 1px 0px rgba(255,255,255,0.7);
-}
-
- .ui-widget-header a {
- color: #4f4f4f;
- }
-
- /* Interaction states
-----------------------------------*/
- .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
- border: 1px solid #a8a8a8;
- background: rgb(243,243,243); /* Old browsers */
- background: -moz-linear-gradient(top, rgba(243,243,243,1) 0%, rgba(204,204,204,1) 100%); /* FF3.6+ */
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(243,243,243,1)), color-stop(100%,rgba(204,204,204,1))); /* Chrome,Safari4+ */
- background: -webkit-linear-gradient(top, rgba(243,243,243,1) 0%,rgba(204,204,204,1) 100%); /* Chrome10+,Safari5.1+ */
- background: -o-linear-gradient(top, rgba(243,243,243,1) 0%,rgba(204,204,204,1) 100%); /* Opera 11.10+ */
- background: -ms-linear-gradient(top, rgba(243,243,243,1) 0%,rgba(204,204,204,1) 100%); /* IE10+ */
- background: linear-gradient(to bottom, rgba(243,243,243,1) 0%,rgba(204,204,204,1) 100%); /* W3C */
- font-weight: bold;
- color: #4f4f4f;
- text-shadow: 0px 1px 0px rgba(255,255,255,0.7);
- }
-
-.ui-state-default {
- -moz-box-shadow: inset 0px 1px 0px rgba(255,255,255,0.25);
- -webkit-box-shadow: inset 0px 1px 0px rgba(255,255,255,0.25);
- box-shadow: inset 0px 1px 0px rgba(255,255,255,0.25);
-}
-
- .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited {
- color: #4f4f4f;
- text-decoration: none;
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
- }
-
-.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
- background: #83b0ca url(images/ui-bg_highlight-soft_100_83b0ca_1x100.png) repeat-x top;
- border: solid 1px #8ab0c6;
- font-weight: bold;
- color: #313131;
- -moz-box-shadow: 0 0 3px #85b2cb;
- -webkit-box-shadow: 0px 0px 3px #85b2cb;
- box-shadow: 0px 0px 3px #85b2cb;
-}
-
-.ui-state-hover {
- -moz-box-shadow: 0px 0px 3px #85b2cb, inset 0px 1px 0px rgba(255,255,255,0.25);
- -webkit-box-shadow: 0px 0px 3px #85b2cb, inset 0px 1px 0px rgba(255,255,255,0.25);
- box-shadow: 0px 0px 3px #85b2cb, inset 0px 1px 0px rgba(255,255,255,0.25);
-}
-
- .ui-state-hover a, .ui-state-hover a:hover {
- color: #2f556a;
- text-decoration: none;
- }
-
-.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
- border: 1px solid #7096ab;
- background: rgb(131,176,202); /* Old browsers */
- background: -moz-linear-gradient(top, rgba(131,176,202,1) 0%, rgba(185,224,245,1) 100%); /* FF3.6+ */
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(131,176,202,1)), color-stop(100%,rgba(185,224,245,1))); /* Chrome,Safari4+ */
- background: -webkit-linear-gradient(top, rgba(131,176,202,1) 0%,rgba(185,224,245,1) 100%); /* Chrome10+,Safari5.1+ */
- background: -o-linear-gradient(top, rgba(131,176,202,1) 0%,rgba(185,224,245,1) 100%); /* Opera 11.10+ */
- background: -ms-linear-gradient(top, rgba(131,176,202,1) 0%,rgba(185,224,245,1) 100%); /* IE10+ */
- background: linear-gradient(to bottom, rgba(131,176,202,1) 0%,rgba(185,224,245,1) 100%); /* W3C */
- font-weight: bold;
- color: #1C4257;
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
-}
-
- .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {
- color: #2f556a;
- text-decoration: none;
- }
-
-.ui-widget :active {
- outline: none;
-}
-
-.ui-state-active {
- -moz-box-shadow: inset 0px 1px 0px rgba(255,255,255,0.25);
- -webkit-box-shadow: inset 0px 1px 0px rgba(255,255,255,0.25);
- box-shadow: inset 0px 1px 0px rgba(255,255,255,0.25);
-}
-/* Interaction Cues
-----------------------------------*/
-.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {
- border: 1px solid #666666;
- background: rgb(133,133,133); /* Old browsers */
- background: -moz-linear-gradient(top, rgba(133,133,133,1) 0%, rgba(168,168,168,1) 100%); /* FF3.6+ */
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(133,133,133,1)), color-stop(100%,rgba(168,168,168,1))); /* Chrome,Safari4+ */
- background: -webkit-linear-gradient(top, rgba(133,133,133,1) 0%,rgba(168,168,168,1) 100%); /* Chrome10+,Safari5.1+ */
- background: -o-linear-gradient(top, rgba(133,133,133,1) 0%,rgba(168,168,168,1) 100%); /* Opera 11.10+ */
- background: -ms-linear-gradient(top, rgba(133,133,133,1) 0%,rgba(168,168,168,1) 100%); /* IE10+ */
- background: linear-gradient(to bottom, rgba(133,133,133,1) 0%,rgba(168,168,168,1) 100%); /* W3C */
- color: #ffffff;
- text-shadow: 1px 1px 1px #333333;
-}
-
- .ui-state-highlight a, .ui-widget-content .ui-state-highlight a, .ui-widget-header .ui-state-highlight a {
- color: #363636;
- }
-
-.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {
- border: 1px solid #cd0a0a;
- background: rgb(254,241,236); /* Old browsers */
- background: -moz-linear-gradient(top, rgba(254,241,236,1) 0%, rgba(254,248,246,1) 100%); /* FF3.6+ */
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(254,241,236,1)), color-stop(100%,rgba(254,248,246,1))); /* Chrome,Safari4+ */
- background: -webkit-linear-gradient(top, rgba(254,241,236,1) 0%,rgba(254,248,246,1) 100%); /* Chrome10+,Safari5.1+ */
- background: -o-linear-gradient(top, rgba(254,241,236,1) 0%,rgba(254,248,246,1) 100%); /* Opera 11.10+ */
- background: -ms-linear-gradient(top, rgba(254,241,236,1) 0%,rgba(254,248,246,1) 100%); /* IE10+ */
- background: linear-gradient(to bottom, rgba(254,241,236,1) 0%,rgba(254,248,246,1) 100%); /* W3C */
- color: #cd0a0a;
-}
-
- .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a {
- color: #cd0a0a;
- }
-
-.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text {
- color: #cd0a0a;
-}
-
-.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary {
- font-weight: bold;
-}
-
-.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary {
- opacity: .7;
- filter: Alpha(Opacity=70);
- font-weight: normal;
-}
-
-.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled {
- opacity: .35;
- filter: Alpha(Opacity=35);
- background-image: none;
-}
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon {
- width: 16px;
- height: 16px;
- background-image: url(images/ui-icons_616161_256x240.png);
-}
-
-.ui-widget-content .ui-icon {
- background-image: url(images/ui-icons_616161_256x240.png);
-}
-
-.ui-widget-header .ui-icon {
- background-image: url(images/ui-icons_898989_256x240.png);
-}
-
-.ui-state-default .ui-icon {
- background-image: url(images/ui-icons_38667f_256x240.png);
-}
-
-.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {
- background-image: url(images/ui-icons_38667f_256x240.png);
-}
-
-.ui-state-active .ui-icon {
- background-image: url(images/ui-icons_38667f_256x240.png);
-}
-
-.ui-state-highlight .ui-icon {
- background-image: url(images/ui-icons_2e83ff_256x240.png);
-}
-
-.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {
- background-image: url(images/ui-icons_cd0a0a_256x240.png);
-}
-
-/* positioning */
-.ui-icon-carat-1-n {
- background-position: 0 0;
-}
-
-.ui-icon-carat-1-ne {
- background-position: -16px 0;
-}
-
-.ui-icon-carat-1-e {
- background-position: -32px 0;
-}
-
-.ui-icon-carat-1-se {
- background-position: -48px 0;
-}
-
-.ui-icon-carat-1-s {
- background-position: -64px 0;
-}
-
-.ui-icon-carat-1-sw {
- background-position: -80px 0;
-}
-
-.ui-icon-carat-1-w {
- background-position: -96px 0;
-}
-
-.ui-icon-carat-1-nw {
- background-position: -112px 0;
-}
-
-.ui-icon-carat-2-n-s {
- background-position: -128px 0;
-}
-
-.ui-icon-carat-2-e-w {
- background-position: -144px 0;
-}
-
-.ui-icon-triangle-1-n {
- background-position: 0 -16px;
-}
-
-.ui-icon-triangle-1-ne {
- background-position: -16px -16px;
-}
-
-.ui-icon-triangle-1-e {
- background-position: -32px -16px;
-}
-
-.ui-icon-triangle-1-se {
- background-position: -48px -16px;
-}
-
-.ui-icon-triangle-1-s {
- background-position: -64px -16px;
-}
-
-.ui-icon-triangle-1-sw {
- background-position: -80px -16px;
-}
-
-.ui-icon-triangle-1-w {
- background-position: -96px -16px;
-}
-
-.ui-icon-triangle-1-nw {
- background-position: -112px -16px;
-}
-
-.ui-icon-triangle-2-n-s {
- background-position: -128px -16px;
-}
-
-.ui-icon-triangle-2-e-w {
- background-position: -144px -16px;
-}
-
-.ui-icon-arrow-1-n {
- background-position: 0 -32px;
-}
-
-.ui-icon-arrow-1-ne {
- background-position: -16px -32px;
-}
-
-.ui-icon-arrow-1-e {
- background-position: -32px -32px;
-}
-
-.ui-icon-arrow-1-se {
- background-position: -48px -32px;
-}
-
-.ui-icon-arrow-1-s {
- background-position: -64px -32px;
-}
-
-.ui-icon-arrow-1-sw {
- background-position: -80px -32px;
-}
-
-.ui-icon-arrow-1-w {
- background-position: -96px -32px;
-}
-
-.ui-icon-arrow-1-nw {
- background-position: -112px -32px;
-}
-
-.ui-icon-arrow-2-n-s {
- background-position: -128px -32px;
-}
-
-.ui-icon-arrow-2-ne-sw {
- background-position: -144px -32px;
-}
-
-.ui-icon-arrow-2-e-w {
- background-position: -160px -32px;
-}
-
-.ui-icon-arrow-2-se-nw {
- background-position: -176px -32px;
-}
-
-.ui-icon-arrowstop-1-n {
- background-position: -192px -32px;
-}
-
-.ui-icon-arrowstop-1-e {
- background-position: -208px -32px;
-}
-
-.ui-icon-arrowstop-1-s {
- background-position: -224px -32px;
-}
-
-.ui-icon-arrowstop-1-w {
- background-position: -240px -32px;
-}
-
-.ui-icon-arrowthick-1-n {
- background-position: 0 -48px;
-}
-
-.ui-icon-arrowthick-1-ne {
- background-position: -16px -48px;
-}
-
-.ui-icon-arrowthick-1-e {
- background-position: -32px -48px;
-}
-
-.ui-icon-arrowthick-1-se {
- background-position: -48px -48px;
-}
-
-.ui-icon-arrowthick-1-s {
- background-position: -64px -48px;
-}
-
-.ui-icon-arrowthick-1-sw {
- background-position: -80px -48px;
-}
-
-.ui-icon-arrowthick-1-w {
- background-position: -96px -48px;
-}
-
-.ui-icon-arrowthick-1-nw {
- background-position: -112px -48px;
-}
-
-.ui-icon-arrowthick-2-n-s {
- background-position: -128px -48px;
-}
-
-.ui-icon-arrowthick-2-ne-sw {
- background-position: -144px -48px;
-}
-
-.ui-icon-arrowthick-2-e-w {
- background-position: -160px -48px;
-}
-
-.ui-icon-arrowthick-2-se-nw {
- background-position: -176px -48px;
-}
-
-.ui-icon-arrowthickstop-1-n {
- background-position: -192px -48px;
-}
-
-.ui-icon-arrowthickstop-1-e {
- background-position: -208px -48px;
-}
-
-.ui-icon-arrowthickstop-1-s {
- background-position: -224px -48px;
-}
-
-.ui-icon-arrowthickstop-1-w {
- background-position: -240px -48px;
-}
-
-.ui-icon-arrowreturnthick-1-w {
- background-position: 0 -64px;
-}
-
-.ui-icon-arrowreturnthick-1-n {
- background-position: -16px -64px;
-}
-
-.ui-icon-arrowreturnthick-1-e {
- background-position: -32px -64px;
-}
-
-.ui-icon-arrowreturnthick-1-s {
- background-position: -48px -64px;
-}
-
-.ui-icon-arrowreturn-1-w {
- background-position: -64px -64px;
-}
-
-.ui-icon-arrowreturn-1-n {
- background-position: -80px -64px;
-}
-
-.ui-icon-arrowreturn-1-e {
- background-position: -96px -64px;
-}
-
-.ui-icon-arrowreturn-1-s {
- background-position: -112px -64px;
-}
-
-.ui-icon-arrowrefresh-1-w {
- background-position: -128px -64px;
-}
-
-.ui-icon-arrowrefresh-1-n {
- background-position: -144px -64px;
-}
-
-.ui-icon-arrowrefresh-1-e {
- background-position: -160px -64px;
-}
-
-.ui-icon-arrowrefresh-1-s {
- background-position: -176px -64px;
-}
-
-.ui-icon-arrow-4 {
- background-position: 0 -80px;
-}
-
-.ui-icon-arrow-4-diag {
- background-position: -16px -80px;
-}
-
-.ui-icon-extlink {
- background-position: -32px -80px;
-}
-
-.ui-icon-newwin {
- background-position: -48px -80px;
-}
-
-.ui-icon-refresh {
- background-position: -64px -80px;
-}
-
-.ui-icon-shuffle {
- background-position: -80px -80px;
-}
-
-.ui-icon-transfer-e-w {
- background-position: -96px -80px;
-}
-
-.ui-icon-transferthick-e-w {
- background-position: -112px -80px;
-}
-
-.ui-icon-folder-collapsed {
- background-position: 0 -96px;
-}
-
-.ui-icon-folder-open {
- background-position: -16px -96px;
-}
-
-.ui-icon-document {
- background-position: -32px -96px;
-}
-
-.ui-icon-document-b {
- background-position: -48px -96px;
-}
-
-.ui-icon-note {
- background-position: -64px -96px;
-}
-
-.ui-icon-mail-closed {
- background-position: -80px -96px;
-}
-
-.ui-icon-mail-open {
- background-position: -96px -96px;
-}
-
-.ui-icon-suitcase {
- background-position: -112px -96px;
-}
-
-.ui-icon-comment {
- background-position: -128px -96px;
-}
-
-.ui-icon-person {
- background-position: -144px -96px;
-}
-
-.ui-icon-print {
- background-position: -160px -96px;
-}
-
-.ui-icon-trash {
- background-position: -176px -96px;
-}
-
-.ui-icon-locked {
- background-position: -192px -96px;
-}
-
-.ui-icon-unlocked {
- background-position: -208px -96px;
-}
-
-.ui-icon-bookmark {
- background-position: -224px -96px;
-}
-
-.ui-icon-tag {
- background-position: -240px -96px;
-}
-
-.ui-icon-home {
- background-position: 0 -112px;
-}
-
-.ui-icon-flag {
- background-position: -16px -112px;
-}
-
-.ui-icon-calendar {
- background-position: -32px -112px;
-}
-
-.ui-icon-cart {
- background-position: -48px -112px;
-}
-
-.ui-icon-pencil {
- background-position: -64px -112px;
-}
-
-.ui-icon-clock {
- background-position: -80px -112px;
-}
-
-.ui-icon-disk {
- background-position: -96px -112px;
-}
-
-.ui-icon-calculator {
- background-position: -112px -112px;
-}
-
-.ui-icon-zoomin {
- background-position: -128px -112px;
-}
-
-.ui-icon-zoomout {
- background-position: -144px -112px;
-}
-
-.ui-icon-search {
- background-position: -160px -112px;
-}
-
-.ui-icon-wrench {
- background-position: -176px -112px;
-}
-
-.ui-icon-gear {
- background-position: -192px -112px;
-}
-
-.ui-icon-heart {
- background-position: -208px -112px;
-}
-
-.ui-icon-star {
- background-position: -224px -112px;
-}
-
-.ui-icon-link {
- background-position: -240px -112px;
-}
-
-.ui-icon-cancel {
- background-position: 0 -128px;
-}
-
-.ui-icon-plus {
- background-position: -16px -128px;
-}
-
-.ui-icon-plusthick {
- background-position: -32px -128px;
-}
-
-.ui-icon-minus {
- background-position: -48px -128px;
-}
-
-.ui-icon-minusthick {
- background-position: -64px -128px;
-}
-
-.ui-icon-close {
- background-position: -80px -128px;
-}
-
-.ui-icon-closethick {
- background-position: -96px -128px;
-}
-
-.ui-icon-key {
- background-position: -112px -128px;
-}
-
-.ui-icon-lightbulb {
- background-position: -128px -128px;
-}
-
-.ui-icon-scissors {
- background-position: -144px -128px;
-}
-
-.ui-icon-clipboard {
- background-position: -160px -128px;
-}
-
-.ui-icon-copy {
- background-position: -176px -128px;
-}
-
-.ui-icon-contact {
- background-position: -192px -128px;
-}
-
-.ui-icon-image {
- background-position: -208px -128px;
-}
-
-.ui-icon-video {
- background-position: -224px -128px;
-}
-
-.ui-icon-script {
- background-position: -240px -128px;
-}
-
-.ui-icon-alert {
- background-position: 0 -144px;
-}
-
-.ui-icon-info {
- background-position: -16px -144px;
-}
-
-.ui-icon-notice {
- background-position: -32px -144px;
-}
-
-.ui-icon-help {
- background-position: -48px -144px;
-}
-
-.ui-icon-check {
- background-position: -64px -144px;
-}
-
-.ui-icon-bullet {
- background-position: -80px -144px;
-}
-
-.ui-icon-radio-off {
- background-position: -96px -144px;
-}
-
-.ui-icon-radio-on {
- background-position: -112px -144px;
-}
-
-.ui-icon-pin-w {
- background-position: -128px -144px;
-}
-
-.ui-icon-pin-s {
- background-position: -144px -144px;
-}
-
-.ui-icon-play {
- background-position: 0 -160px;
-}
-
-.ui-icon-pause {
- background-position: -16px -160px;
-}
-
-.ui-icon-seek-next {
- background-position: -32px -160px;
-}
-
-.ui-icon-seek-prev {
- background-position: -48px -160px;
-}
-
-.ui-icon-seek-end {
- background-position: -64px -160px;
-}
-
-.ui-icon-seek-start {
- background-position: -80px -160px;
-}
-/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
-.ui-icon-seek-first {
- background-position: -80px -160px;
-}
-
-.ui-icon-stop {
- background-position: -96px -160px;
-}
-
-.ui-icon-eject {
- background-position: -112px -160px;
-}
-
-.ui-icon-volume-off {
- background-position: -128px -160px;
-}
-
-.ui-icon-volume-on {
- background-position: -144px -160px;
-}
-
-.ui-icon-power {
- background-position: 0 -176px;
-}
-
-.ui-icon-signal-diag {
- background-position: -16px -176px;
-}
-
-.ui-icon-signal {
- background-position: -32px -176px;
-}
-
-.ui-icon-battery-0 {
- background-position: -48px -176px;
-}
-
-.ui-icon-battery-1 {
- background-position: -64px -176px;
-}
-
-.ui-icon-battery-2 {
- background-position: -80px -176px;
-}
-
-.ui-icon-battery-3 {
- background-position: -96px -176px;
-}
-
-.ui-icon-circle-plus {
- background-position: 0 -192px;
-}
-
-.ui-icon-circle-minus {
- background-position: -16px -192px;
-}
-
-.ui-icon-circle-close {
- background-position: -32px -192px;
-}
-
-.ui-icon-circle-triangle-e {
- background-position: -48px -192px;
-}
-
-.ui-icon-circle-triangle-s {
- background-position: -64px -192px;
-}
-
-.ui-icon-circle-triangle-w {
- background-position: -80px -192px;
-}
-
-.ui-icon-circle-triangle-n {
- background-position: -96px -192px;
-}
-
-.ui-icon-circle-arrow-e {
- background-position: -112px -192px;
-}
-
-.ui-icon-circle-arrow-s {
- background-position: -128px -192px;
-}
-
-.ui-icon-circle-arrow-w {
- background-position: -144px -192px;
-}
-
-.ui-icon-circle-arrow-n {
- background-position: -160px -192px;
-}
-
-.ui-icon-circle-zoomin {
- background-position: -176px -192px;
-}
-
-.ui-icon-circle-zoomout {
- background-position: -192px -192px;
-}
-
-.ui-icon-circle-check {
- background-position: -208px -192px;
-}
-
-.ui-icon-circlesmall-plus {
- background-position: 0 -208px;
-}
-
-.ui-icon-circlesmall-minus {
- background-position: -16px -208px;
-}
-
-.ui-icon-circlesmall-close {
- background-position: -32px -208px;
-}
-
-.ui-icon-squaresmall-plus {
- background-position: -48px -208px;
-}
-
-.ui-icon-squaresmall-minus {
- background-position: -64px -208px;
-}
-
-.ui-icon-squaresmall-close {
- background-position: -80px -208px;
-}
-
-.ui-icon-grip-dotted-vertical {
- background-position: 0 -224px;
-}
-
-.ui-icon-grip-dotted-horizontal {
- background-position: -16px -224px;
-}
-
-.ui-icon-grip-solid-vertical {
- background-position: -32px -224px;
-}
-
-.ui-icon-grip-solid-horizontal {
- background-position: -48px -224px;
-}
-
-.ui-icon-gripsmall-diagonal-se {
- background-position: -64px -224px;
-}
-
-.ui-icon-grip-diagonal-se {
- background-position: -80px -224px;
-}
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Corner radius */
-.ui-corner-tl {
- -moz-border-radius-topleft: 3px;
- -webkit-border-top-left-radius: 3px;
- border-top-left-radius: 3px;
-}
-
-.ui-corner-tr {
- -moz-border-radius-topright: 3px;
- -webkit-border-top-right-radius: 3px;
- border-top-right-radius: 3px;
-}
-
-.ui-corner-bl {
- -moz-border-radius-bottomleft: 3px;
- -webkit-border-bottom-left-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-
-.ui-corner-br {
- -moz-border-radius-bottomright: 3px;
- -webkit-border-bottom-right-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
-.ui-corner-top {
- -moz-border-radius-topleft: 3px;
- -webkit-border-top-left-radius: 3px;
- border-top-left-radius: 3px;
- -moz-border-radius-topright: 3px;
- -webkit-border-top-right-radius: 3px;
- border-top-right-radius: 3px;
-}
-
-.ui-corner-bottom {
- -moz-border-radius-bottomleft: 3px;
- -webkit-border-bottom-left-radius: 3px;
- border-bottom-left-radius: 3px;
- -moz-border-radius-bottomright: 3px;
- -webkit-border-bottom-right-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
-.ui-corner-right {
- -moz-border-radius-topright: 3px;
- -webkit-border-top-right-radius: 3px;
- border-top-right-radius: 3px;
- -moz-border-radius-bottomright: 3px;
- -webkit-border-bottom-right-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
-.ui-corner-left {
- -moz-border-radius-topleft: 3px;
- -webkit-border-top-left-radius: 3px;
- border-top-left-radius: 3px;
- -moz-border-radius-bottomleft: 3px;
- -webkit-border-bottom-left-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-
-.ui-corner-all {
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-.ui-round-all {
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
-}
-
-/* Overlays */
-.ui-widget-overlay {
- background: #2d5972 url(images/ui-bg_flat_0_2d5972_40x100.png) 50% 50% repeat-x;
- opacity: .30;
- filter: Alpha(Opacity=30);
-}
-
-.ui-widget-shadow {
- margin: -8px 0 0 -8px;
- padding: 8px;
- background: #4f4f4f url(images/ui-bg_flat_0_4f4f4f_40x100.png) 50% 50% repeat-x;
- opacity: .30;
- filter: Alpha(Opacity=30);
- -moz-border-radius: 8px;
- -webkit-border-radius: 8px;
- border-radius: 8px;
-}
-/*
- * jQuery UI Resizable @VERSION
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Resizable#theming
- */
-.ui-resizable {
- position: relative;
-}
-
-.ui-resizable-handle {
- position: absolute;
- font-size: 0.1px;
- z-index: 99999;
- display: block;
-}
-
-.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle {
- display: none;
-}
-
-.ui-resizable-n {
- cursor: n-resize;
- height: 7px;
- width: 100%;
- top: -5px;
- left: 0;
-}
-
-.ui-resizable-s {
- cursor: s-resize;
- height: 7px;
- width: 100%;
- bottom: -5px;
- left: 0;
-}
-
-.ui-resizable-e {
- cursor: e-resize;
- width: 7px;
- right: -5px;
- top: 0;
- height: 100%;
-}
-
-.ui-resizable-w {
- cursor: w-resize;
- width: 7px;
- left: -5px;
- top: 0;
- height: 100%;
-}
-
-.ui-resizable-se {
- cursor: se-resize;
- width: 12px;
- height: 12px;
- right: 1px;
- bottom: 1px;
-}
-
-.ui-resizable-sw {
- cursor: sw-resize;
- width: 9px;
- height: 9px;
- left: -5px;
- bottom: -5px;
-}
-
-.ui-resizable-nw {
- cursor: nw-resize;
- width: 9px;
- height: 9px;
- left: -5px;
- top: -5px;
-}
-
-.ui-resizable-ne {
- cursor: ne-resize;
- width: 9px;
- height: 9px;
- right: -5px;
- top: -5px;
-}
-/*
- * jQuery UI Selectable @VERSION
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Selectable#theming
- */
-.ui-selectable-helper {
- position: absolute;
- z-index: 100;
- border: 1px dotted black;
-}
-/*
- * jQuery UI Accordion @VERSION
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Accordion#theming
- */
-/* IE/Win - Fix animation bug - #4615 */
-.ui-accordion .ui-accordion-header {
- display: block;
- cursor: pointer;
- position: relative;
- margin-top: 2px;
- padding: .5em .5em .5em .7em;
- zoom: 1;
-}
-
-.ui-accordion .ui-accordion-icons {
- padding-left: 2.2em;
-}
-
-.ui-accordion .ui-accordion-noicons {
- padding-left: .7em;
-}
-
-.ui-accordion .ui-accordion-icons .ui-accordion-icons {
- padding-left: 2.2em;
-}
-
-.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
- position: absolute;
- left: .5em;
- top: 50%;
- margin-top: -8px;
-}
-
-.ui-accordion .ui-accordion-content {
- padding: 1em 2.2em;
- border-top: 0;
- overflow: auto;
- zoom: 1;
-}
-/*
- * jQuery UI Autocomplete @VERSION
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Autocomplete#theming
- */
-.ui-autocomplete {
- position: absolute;
- cursor: default;
-}
-
-
- .ui-autocomplete .ui-menu-item .ui-state-hover {
- background: none repeat scroll 0 0 #5F83B9;
- color: #FFFFFF !important;
- font-weight: bold;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
- border: solid 1px transparent;
- cursor: pointer;
- }
-
-
-/* workarounds */
-* html .ui-autocomplete {
- width: 1px;
-}
-/* without this, the menu expands to 100% in IE6 */
-
-/*
- * jQuery UI Menu @VERSION
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Menu#theming
- */
-.ui-menu {
- list-style: none;
- padding: 2px;
- margin: 0;
- display: block;
- float: left;
-}
-
- .ui-menu .ui-menu {
- margin-top: -3px;
- }
-
- .ui-menu .ui-menu-item {
- margin: 0;
- padding: 0;
- zoom: 1;
- float: left;
- clear: left;
- width: 100%;
- }
-
- .ui-menu .ui-menu-item a {
- text-decoration: none;
- display: block;
- padding: .2em .4em;
- line-height: 1.5;
- zoom: 1;
- }
-
- .ui-menu .ui-menu-item a.ui-state-hover, .ui-menu .ui-menu-item a.ui-state-active {
- font-weight: normal;
- margin: -1px;
- }
-/*
- * jQuery UI Button @VERSION
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Button#theming
- */
-.ui-button {
- display: inline-block;
- position: relative;
- padding: 0;
- margin-right: .1em;
- text-decoration: none !important;
- cursor: pointer;
- text-align: center;
- zoom: 1;
- overflow: visible;
-}
-/* the overflow property removes extra width in IE */
-.ui-button-icon-only {
- width: 2.2em;
-}
-/* to make room for the icon, a width needs to be set here */
-button.ui-button-icon-only {
- width: 2.4em;
-}
-/* button elements seem to need a little more width */
-.ui-button-icons-only {
- width: 3.4em;
-}
-
-button.ui-button-icons-only {
- width: 3.7em;
-}
-
-.ui-button-icon-only .ui-icon, .ui-button-text-icon .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon {
- margin-left: 6px;
- margin-top: -8px;
- position: absolute;
- top: 50%;
-}
-
-.ui-button-text-icon .ui-button-text, .ui-button-text-icons .ui-button-text {
- padding: 5px 12px 5px 25px;
-}
-
-/*button text element */
-.ui-button .ui-button-text {
- display: block;
- line-height: 1.4;
-}
-
-.ui-button-text-only .ui-button-text {
- padding: .4em 1em;
-}
-
-.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text {
- padding: .4em;
- text-indent: -9999999px;
-}
-
-.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text {
- padding: .4em 1em .4em 2.1em;
-}
-
-.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text {
- padding: .4em 2.1em .4em 1em;
-}
-
-.ui-button-text-icons .ui-button-text {
- padding-left: 2.1em;
- padding-right: 2.1em;
-}
-/* no icon support for input elements, provide padding by default */
-input.ui-button {
- padding: .4em 1em;
-}
-
-/*button icon element(s) */
-.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon {
- position: absolute;
- top: 50%;
- margin-top: -8px;
-}
-
-.ui-button-icon-only .ui-icon {
- left: 50%;
- margin-left: -8px;
-}
-
-.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary {
- left: .5em;
-}
-
-.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary {
- right: .5em;
-}
-
-.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary {
- right: .5em;
-}
-
-/*button sets*/
-.ui-buttonset {
- margin-right: 7px;
-}
-
- .ui-buttonset .ui-button {
- margin-left: 0;
- margin-right: -.3em;
- }
-
-/* workarounds */
-button.ui-button::-moz-focus-inner {
- border: 0;
- padding: 0;
-}
-/* reset extra padding in Firefox */
-/*
- * jQuery UI Dialog @VERSION
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Dialog#theming
- */
-.ui-dialog {
- position: absolute;
- padding: .2em;
- width: 300px;
- overflow: hidden;
- -moz-box-shadow: 0px 5px 10px rgba(0,0,0,0.8);
- -webkit-box-shadow: 0px 5px 10px rgba(0,0,0,0.8);
- box-shadow: 0px 5px 10px rgba(0,0,0,0.8);
-}
-
- .ui-dialog .ui-dialog-titlebar {
- padding: .5em 1em .3em;
- position: relative;
- }
-
- .ui-dialog .ui-dialog-title {
- float: left;
- margin: .1em 16px .2em 0;
- }
-
- .ui-dialog .ui-dialog-titlebar-close {
- position: absolute;
- right: .3em;
- top: 50%;
- width: 19px;
- margin: -10px 0 0 0;
- padding: 1px;
- height: 18px;
- -moz-border-radius: 10px;
- }
-
- .ui-dialog .ui-dialog-titlebar-close span {
- display: block;
- margin: 1px;
- }
-
- .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus {
- padding: 0;
- }
-
- .ui-dialog .ui-dialog-content {
- position: relative;
- border: 0;
- padding: .5em 1em;
- background: none;
- overflow: auto;
- zoom: 1;
- }
-
- .ui-dialog .ui-dialog-buttonpane {
- text-align: left;
- border-width: 1px 0 0 0;
- background-image: none;
- margin: .5em 0 0 0;
- padding: .3em 1em .5em .4em;
- }
-
- .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
- float: right;
- }
-
- .ui-dialog .ui-dialog-buttonpane button {
- margin: .5em .4em .5em 0;
- cursor: pointer;
- }
-
- .ui-dialog .ui-resizable-se {
- width: 14px;
- height: 14px;
- right: 3px;
- bottom: 3px;
- }
-
-.ui-draggable .ui-dialog-titlebar {
- cursor: move;
-}
-
-.ui-dialog {
- padding: 0;
-}
-
- .ui-dialog .ui-dialog-titlebar {
- border-top: none;
- border-right: none;
- border-left: none;
- -moz-border-radius: 0;
- -webkit-border-radius: 0;
- border-radius: 0;
- }
-
- .ui-dialog .ui-dialog-titlebar-close {
- }
-
-/*
- * jQuery UI Slider @VERSION
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Slider#theming
- */
-.ui-slider {
- position: relative;
- text-align: left;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
-}
-
- .ui-slider .ui-slider-handle {
- position: absolute;
- z-index: 2;
- width: 16px;
- height: 16px;
- cursor: default;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- }
-
- .ui-slider .ui-slider-range {
- position: absolute;
- z-index: 1;
- font-size: .7em;
- display: block;
- border: 0;
- background-position: 0 0;
- }
-
-
-.ui-slider {
- background: #cbcbcb;
- -moz-box-shadow: inset 0 2px 2px #8f8f8f;
- -webkit-box-shadow: inset 0 2px 2px #8f8f8f;
- box-shadow: inset 0 2px 2px #8f8f8f;
-}
-
- .ui-slider .ui-slider-range {
- background: #a3cae0;
- -moz-box-shadow: inset 0 2px 2px #7d9aab;
- -webkit-box-shadow: inset 0 2px 2px #7d9aab;
- box-shadow: inset 0 2px 2px #7d9aab;
- }
-
-.ui-slider-vertical {
- background: #cbcbcb;
- -moz-box-shadow: inset 0 2px 2px #8f8f8f;
- -webkit-box-shadow: inset 0 2px 2px #8f8f8f;
- box-shadow: inset 0 2px 2px #8f8f8f;
-}
-
- .ui-slider-vertical .ui-slider-range {
- background: #a3cae0;
- -moz-box-shadow: inset 2px 0 2px #7d9aab;
- -webkit-box-shadow: inset 2px 0 2px #7d9aab;
- box-shadow: inset 2px 0 2px #7d9aab;
- }
-
-
-.ui-slider .ui-slider-handle span {
- height: 16px !important;
- width: 16px !important;
- float: none !important;
- margin: 0 auto !important;
-}
-
-
-.ui-slider-horizontal {
- height: .4em;
-}
-
- .ui-slider-horizontal .ui-slider-handle {
- top: -.5em;
- margin-left: -.6em;
- }
-
- .ui-slider-horizontal .ui-slider-range {
- top: 0;
- height: 100%;
- }
-
- .ui-slider-horizontal .ui-slider-range-min {
- left: 0;
- }
-
- .ui-slider-horizontal .ui-slider-range-max {
- right: 0;
- }
-
-.ui-slider-vertical {
- width: .4em;
- height: 100px;
-}
-
- .ui-slider-vertical .ui-slider-handle {
- left: -.5em;
- margin-left: 0;
- margin-bottom: -.6em;
- }
-
- .ui-slider-vertical .ui-slider-range {
- left: 0;
- width: 100%;
- }
-
- .ui-slider-vertical .ui-slider-range-min {
- bottom: 0;
- }
-
- .ui-slider-vertical .ui-slider-range-max {
- top: 0;
- }
-
-.ui-slider .ui-slider-handle {
- background: #83b0ca url(images/ui-bg_highlight-soft_100_83b0ca_1x100.png) repeat-x top;
- border-color: #8ab0c6;
-}
-
-
-
-/*
- * jQuery UI Tabs @VERSION
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Tabs#theming
- */
-.ui-tabs {
- position: relative;
- padding: .2em;
- zoom: 1;
-}
- /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
- .ui-tabs .ui-tabs-nav {
- margin: 0;
- padding: .2em .2em 0;
- }
-
- .ui-tabs .ui-tabs-nav li {
- list-style: none;
- float: left;
- position: relative;
- top: 1px;
- margin: 0 .2em 1px 0;
- border: 1px solid #a8a8a8;
- border-bottom: 0 !important;
- padding: 0;
- white-space: nowrap;
- }
-
- .ui-tabs .ui-tabs-nav li a {
- float: left;
- padding: .5em 1em;
- text-decoration: none;
- }
-
- .ui-tabs .ui-tabs-nav li.ui-tabs-selected {
- margin-bottom: 0;
- padding-bottom: 1px;
- border: 1px solid #a8a8a8;
- border-bottom: 0 !important;
- }
-
- .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a {
- cursor: text;
- }
-
- .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a {
- cursor: pointer;
- }
- /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
- .ui-tabs .ui-tabs-panel {
- display: block;
- border-width: 0;
- padding: 1em 1.4em;
- background: none;
- }
-
- .ui-tabs .ui-tabs-hide {
- display: none !important;
- }
-
-.ui-tabs {
- padding: 0;
-}
-
- .ui-tabs .ui-tabs-nav {
- background: #A8A8A8;
- background: -moz-linear-gradient(top, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.8)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
- background: -webkit-linear-gradient(top, rgba(255,255,255,0.8) 0%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */
- background: -o-linear-gradient(top, rgba(255,255,255,0.8) 0%,rgba(255,255,255,0) 100%); /* Opera 11.10+ */
- background: -ms-linear-gradient(top, rgba(255,255,255,0.8) 0%,rgba(255,255,255,0) 100%); /* IE10+ */
- background: linear-gradient(to bottom, rgba(255,255,255,0.8) 0%,rgba(255,255,255,0) 100%); /* W3C */
- -moz-border-radius: 0;
- -webkit-border-radius: 0;
- border-radius: 0;
- }
-
-
- .ui-tabs .ui-tabs-nav .ui-tabs-selected {
- background: #fff;
- border-bottom: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
- }
-
-
-
-/*
- * jQuery UI Datepicker @VERSION
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Datepicker#theming
- */
-.ui-datepicker {
- width: 17em;
- padding: .2em .2em 0;
-}
-
- .ui-datepicker .ui-datepicker-header {
- position: relative;
- padding: .2em 0;
- }
-
- .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next {
- position: absolute;
- top: 2px;
- width: 1.8em;
- height: 1.8em;
- cursor: pointer;
- }
-
- .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover {
- top: 1px;
- }
-
- .ui-datepicker .ui-datepicker-prev {
- left: 2px;
- }
-
- .ui-datepicker .ui-datepicker-next {
- right: 2px;
- }
-
- .ui-datepicker .ui-datepicker-prev-hover {
- left: 1px;
- }
-
- .ui-datepicker .ui-datepicker-next-hover {
- right: 1px;
- }
-
- .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span {
- display: block;
- position: absolute;
- left: 50%;
- margin-left: -8px;
- top: 50%;
- margin-top: -8px;
- }
-
- .ui-datepicker .ui-datepicker-title {
- margin: 0 2.3em;
- line-height: 1.8em;
- text-align: center;
- }
-
- .ui-datepicker .ui-datepicker-title select {
- font-size: 1em;
- margin: 1px 0;
- }
-
- .ui-datepicker select.ui-datepicker-month-year {
- width: 100%;
- }
-
- .ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year {
- width: 49%;
- }
-
- .ui-datepicker table {
- width: 100%;
- font-size: .9em;
- border-collapse: collapse;
- margin: 0 0 .4em;
- }
-
- .ui-datepicker th {
- padding: .7em .3em;
- text-align: center;
- font-weight: bold;
- border: 0;
- }
-
- .ui-datepicker td {
- border: 0;
- padding: 1px;
- }
-
- .ui-datepicker td span, .ui-datepicker td a {
- display: block;
- padding: 2px 3px 3px;
- text-align: right;
- text-decoration: none;
- }
-
- .ui-datepicker .ui-datepicker-buttonpane {
- background-image: none;
- margin: .7em 0 0 0;
- padding: 0 .2em;
- border-left: 0;
- border-right: 0;
- border-bottom: 0;
- }
-
- .ui-datepicker .ui-datepicker-buttonpane button {
- float: right;
- margin: .5em .2em .4em;
- cursor: pointer;
- padding: .2em .6em .3em .6em;
- width: auto;
- overflow: visible;
- }
-
- .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
- float: left;
- }
-
-
- .ui-datepicker table {
- table-layout: fixed;
- }
-
- .ui-datepicker td {
- padding: 0;
- }
-
- .ui-datepicker table {
- margin: -19px 0 0;
- position: relative;
- z-index: 99;
- }
-/*@wijmo*/
-.ui-widget-header {
- background: #c0c0c0 url(images/ui-bg_highlight-soft_100_c0c0c0_1x100.png) top repeat-x;
- text-shadow: 0px 1px 0px rgba(255,255,255,0.7);
-}
-
-.ui-widget-header a {
- color: #4f4f4f;
-}
-
-.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
- text-shadow: 0px 1px 0px rgba(255,255,255,0.7);
-}
-
-.ui-state-default {
- -moz-box-shadow: inset 0px 1px 0px rgba(255,255,255,0.25);
- -webkit-box-shadow: inset 0px 1px 0px rgba(255,255,255,0.25);
- box-shadow: inset 0px 1px 0px rgba(255,255,255,0.25);
-}
-
-.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited {
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
-}
-
-.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
- background: #83b0ca url(images/ui-bg_highlight-soft_100_83b0ca_1x100.png) repeat-x top;
- -moz-box-shadow: 0 0 3px #85b2cb;
- -webkit-box-shadow: 0px 0px 3px #85b2cb;
- box-shadow: 0px 0px 3px #85b2cb;
-}
-
-.ui-state-hover {
- -moz-box-shadow: 0px 0px 3px #85b2cb, inset 0px 1px 0px rgba(255,255,255,0.25);
- -webkit-box-shadow: 0px 0px 3px #85b2cb, inset 0px 1px 0px rgba(255,255,255,0.25);
- box-shadow: 0px 0px 3px #85b2cb, inset 0px 1px 0px rgba(255,255,255,0.25);
-}
-
- .ui-state-hover a, .ui-state-hover a:hover {
- color: #2f556a;
- }
-
-.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
-}
-
- .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {
- color: #2f556a;
- }
-
-.ui-widget :active {
- outline: none;
-}
-
-.ui-state-active {
- -moz-box-shadow: inset 0px 1px 0px rgba(255,255,255,0.25);
- -webkit-box-shadow: inset 0px 1px 0px rgba(255,255,255,0.25);
- box-shadow: inset 0px 1px 0px rgba(255,255,255,0.25);
-}
-
-.ui-round-all {
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
-}
-
-
-.wijmo-wijcalendar-preview-wrapper div.wijmo-wijcalendar .ui-datepicker-header {
- width: 84.5%;
-}
-
-.wijmo-wijcalendar-preview-wrapper .wijmo-wijcalendar table.ui-datepicker-calendar {
- width: 85.8%;
-}
-
-.wijmo-wijcalendar .wijmo-wijcalendar-nextpreview-button {
-}
-
-.wijmo-wijcalendar .wijmo-wijcalendar-prevpreview-button, .wijmo-wijcalendar .wijmo-wijcalendar-nextpreview-button {
- margin-top: 18%;
-}
-
-.wijmo-wijcalendar .wijmo-wijcalendar-table .wijmo-wijcalendar-monthselector .ui-icon {
- height: 12px;
- margin-top: -8px;
- position: relative;
- top: 2px;
- width: 12px;
-}
-
-
-.ui-datepicker table tbody {
- border-left: solid 1px #A8A8A8;
-}
-
-.ui-datepicker table thead {
- border-left: solid 1px #A8A8A8;
- border-right: solid 1px #A8A8A8;
-}
-
-
-.ui-datepicker-calendar thead {
- color: #545454;
- text-shadow: 1px 1px 0 rgba(255,255,255,0.50);
- border-bottom: solid 1px #aaaeb6;
- position: relative;
- z-index: 5;
- font-size: 10px;
- line-height: 4px;
-}
-
-.ui-datepicker .ui-datepicker-calendar .ui-state-hover {
- color: #1C4257;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-
-.ui-datepicker .ui-datepicker-current-day .ui-state-highlight, .ui-datepicker .ui-datepicker-current-day .ui-state-default {
- background: #5F83B9;
- color: #FFFFFF !important;
- font-weight: bold;
- text-shadow: 0 1px 1px #234386;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-
-.ui-datepicker {
- padding: 0;
-}
-
- .ui-datepicker .ui-datepicker-header {
- border-right: none;
- border-left: none;
- border-top: none;
- -moz-border-radius: 0;
- -webkit-border-radius: 0;
- border-radius: 0;
- }
-
- .ui-datepicker .ui-datepicker-next-hover, .ui-datepicker .ui-datepicker-prev-hover {
- background: none;
- border: solid 1px transparent;
- -moz-box-shadow: none;
- }
-
-
- /* with multiple calendars */
- .ui-datepicker.ui-datepicker-multi {
- width: auto;
- }
-
-.ui-datepicker-multi .ui-datepicker-group {
- float: left;
-}
-
- .ui-datepicker-multi .ui-datepicker-group table {
- width: 95%;
- }
-
-.ui-datepicker-multi-2 .ui-datepicker-group {
- width: 50%;
-}
-
-.ui-datepicker-multi-3 .ui-datepicker-group {
- width: 33.3%;
-}
-
-.ui-datepicker-multi-4 .ui-datepicker-group {
- width: 25%;
-}
-
-.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header {
- border-left-width: 0;
-}
-
-.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
- border-left-width: 0;
-}
-
-.ui-datepicker-multi .ui-datepicker-buttonpane {
- clear: left;
-}
-
-.ui-datepicker-row-break {
- clear: both;
- width: 100%;
-}
-
-/* RTL support */
-.ui-datepicker-rtl {
- direction: rtl;
-}
-
- .ui-datepicker-rtl .ui-datepicker-prev {
- right: 2px;
- left: auto;
- }
-
- .ui-datepicker-rtl .ui-datepicker-next {
- left: 2px;
- right: auto;
- }
-
- .ui-datepicker-rtl .ui-datepicker-prev:hover {
- right: 1px;
- left: auto;
- }
-
- .ui-datepicker-rtl .ui-datepicker-next:hover {
- left: 1px;
- right: auto;
- }
-
- .ui-datepicker-rtl .ui-datepicker-buttonpane {
- clear: right;
- }
-
- .ui-datepicker-rtl .ui-datepicker-buttonpane button {
- float: left;
- }
-
- .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current {
- float: right;
- }
-
- .ui-datepicker-rtl .ui-datepicker-group {
- float: right;
- }
-
- .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header {
- border-right-width: 0;
- border-left-width: 1px;
- }
-
- .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
- border-right-width: 0;
- border-left-width: 1px;
- }
-
-/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
-.ui-datepicker-cover {
- display: none; /*sorry for IE5*/
- display: /**/ block; /*sorry for IE5*/
- position: absolute; /*must have*/
- z-index: -1; /*must have*/
- filter: mask(); /*must have*/
- top: -4px; /*must have*/
- left: -4px; /*must have*/
- width: 200px; /*must have*/
- height: 200px; /*must have*/
-}
-/*
- * jQuery UI Progressbar @VERSION
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Progressbar#theming
- */
-.ui-progressbar {
- height: 1.1em;
- text-align: left;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- -moz-box-shadow: inset 0 2px 2px #8f8f8f;
- -webkit-box-shadow: inset 0 2px 2px #8f8f8f;
- box-shadow: inset 0 2px 2px #8f8f8f;
-}
-
- .ui-progressbar .ui-progressbar-value {
- margin: -1px;
- height: 100%;
- }
-
- .ui-progressbar .ui-widget-header {
- background: #83b0ca url(images/ui-bg_highlight-soft_100_83b0ca_1x100.png) repeat-x top;
- border-color: #8ab0c6;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- }
-/*
- * jQuery UI AutoComplete @VERSION
- *
-*/
-.ui-autocomplete {
- -moz-box-shadow: 0px 5px 10px rgba(0,0,0,0.8);
- -webkit-box-shadow: 0px 5px 10px rgba(0,0,0,0.8);
- box-shadow: 0px 5px 10px rgba(0,0,0,0.8);
-}
-
-/* WIJMO */
-.wijmo-wijcalendar div.ui-datepicker-header {
- border: solid 1px #A8A8A8;
- padding-bottom: 12px;
- -moz-box-shadow: inset 0 1px 0 #fff;
- -webkit-box-shadow: inset 0 1px 0 #fff;
- box-shadow: inset 0 1px 0 #fff;
-}
-
- .wijmo-wijcalendar div.ui-datepicker-header .ui-datepicker-title {
- color: #545454;
- font-weight: 700;
- text-shadow: 1px 1px 0 rgba(255,255,255,0.75);
- }
-
-.wijmo-wijcalendar {
- border: none;
-}
-
-.ui-datepicker .ui-datepicker-calendar .ui-state-default {
- background: #dfdee2;
- border: none;
- border-bottom: solid 1px #a7aab3;
- border-right: solid 1px #a7aab3;
- color: #374452;
- -moz-box-shadow: inset 0 1px #fff;
-}
-
-.ui-datepicker .ui-datepicker-calendar .ui-state-hover {
- background: #5f83b9;
- color: #fff;
- text-shadow: 1px 1px 1px rgba(0,0,0,0.75);
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-
-.ui-datepicker .ui-datepicker-calendar .ui-state-active {
- background: #7389a5;
- color: #fff;
- text-shadow: 1px 1px 1px rgba(0,0,0,0.75);
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-
-.wijmo-wijcalendar td.wijmo-wijcalendar-gap {
- border-right: solid 1px #a7aab3;
- border-bottom: solid 1px #a7aab3;
-}
-
-.wijmo-wijinput, .wijmo-wijtextbox {
- background: #fff !important;
- -moz-box-shadow: inset 0 2px 2px rgba(143,143,143,0.50);
- -webkit-box-shadow: inset 0 2px 2px rgba(143,143,143,0.50);
- box-shadow: inset 0 2px 2px rgba(143,143,143,0.50);
-}
-
- .wijmo-wijinput.ui-state-focus, .wijmo-wijtextbox.ui-state-focus {
- background: #fff !important;
- -moz-box-shadow: 0 0 5px #85b2cb, inset 0 2px 2px #8f8f8f;
- -webkit-box-shadow: 0 0 5px #85b2cb, inset 0 2px 2px #8f8f8f;
- box-shadow: 0 0 5px #85b2cb, inset 0 2px 2px #8f8f8f;
- }
-
-.wijmo-wijmenu-ipod {
- background: #d9dee5;
- border: solid 1px transparent;
-}
-
- .wijmo-wijmenu-ipod .wijmo-wijmenu-item .wijmo-wijmenu-link.ui-state-hover {
- border: solid 1px #3f70b9;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
- background: transparent url(images/vertical-menu-item.png) repeat-x top;
- color: #fff;
- text-shadow: 1px 1px 1px #333;
- -moz-borer-radius: 0;
- -webkit-border-radius: 0;
- border-radius: 0;
- }
-
- .wijmo-wijmenu-ipod .ui-widget-header h3 {
- text-transform: uppercase;
- color: #627080;
- text-shadow: 1px 1px 0 rgba(255,255,255,0.95);
- font-weight: 700;
- }
-
- .wijmo-wijmenu-ipod .ui-widget-header {
- background: none;
- border: none;
- }
-/*
-*html .wijmo-wijmenu .wijmo-wijsuperpanel, *html .wijmo-wijmenu .wijmo-wijmenu-list {
- background: none;
-}
-
-*html .wijmo-wijmenu-horizontal .wijmo-wijmenu-child {
- background: #fff;
-}
-
-*html .wijmo-wijmenu .wijmo-wijmenu-link {
- filter: chroma(color=#c4c4c4);
- border-color: #c4c4c4;
-}*/
-
-.wijmo-wijtooltip {
- background: #000;
- background: rgba(0,0,0,0.8);
- border: none;
- color: #fff;
- -moz-box-shadow: 0 0 8px #85b2cb, inset 0 1px 0 #999;
- -webkit-box-shadow: 0 0 8px #85b2cb, inset 0 1px 0 #999;
- box-shadow: 0 0 8px #85b2cb, inset 0 1px 0 #999;
-}
-
-.wijmo-wijtooltip-arrow-lb .wijmo-wijtooltip-pointer-inner, .wijmo-wijtooltip-arrow-lc .wijmo-wijtooltip-pointer-inner, .wijmo-wijtooltip-arrow-lt .wijmo-wijtooltip-pointer-inner {
- border-right-color: #000 !important;
-}
-
-.wijmo-wijtooltip-arrow-rb .wijmo-wijtooltip-pointer-inner, .wijmo-wijtooltip-arrow-rc .wijmo-wijtooltip-pointer-inner, .wijmo-wijtooltip-arrow-rt .wijmo-wijtooltip-pointer-inner {
- border-left-color: #000 !important;
-}
-
-.wijmo-wijtooltip-arrow-br .wijmo-wijtooltip-pointer-inner, .wijmo-wijtooltip-arrow-bc .wijmo-wijtooltip-pointer-inner, .wijmo-wijtooltip-arrow-bl .wijmo-wijtooltip-pointer-inner {
- border-top-color: #000 !important;
-}
-
-.wijmo-wijtooltip-arrow-tb .wijmo-wijtooltip-pointer-inner, .wijmo-wijtooltip-arrow-tc .wijmo-wijtooltip-pointer-inner, .wijmo-wijtooltip-arrow-tt .wijmo-wijtooltip-pointer-inner {
- border-bottom-color: #000 !important;
-}
-
-.wijmo-wijtooltip .wijmo-wijtooltip-pointer {
- opacity: 0.8px;
-}
-
-.wijmo-dropdown-item.ui-state-hover {
- background: #5f83b9;
- color: #fff;
- text-shadow: 1px 1px 0 rgba(0,0,0,0.50);
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
- -moz-border-radius: 0;
- -webkit-border-radius: 0;
- border-radius: 0;
- padding-left: 14px !important;
- margin: 1px -4px !important;
-}
-
-.wijmo-wijlist-item.ui-state-hover, .wijmo-wijlist-item.ui-state-active {
- background: #5f83b9;
- color: #fff;
- text-shadow: 1px 1px 0 rgba(0,0,0,0.50);
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
- -moz-border-radius: 0;
- -webkit-border-radius: 0;
- border-radius: 0;
-}
-
-.wijmo-wijmenu-child .wijmo-wijmenu-link.ui-state-hover, .wijmo-wijmenu-child .wijmo-wijmenu-link.ui-state-active {
- background: #5f83b9;
- color: #fff;
- text-shadow: 1px 1px 0 rgba(0,0,0,0.50);
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
- -moz-border-radius: 0;
- -webkit-border-radius: 0;
- border-radius: 0;
- border-color: #5f83b9;
-}
-
- .wijmo-wijmenu-child .wijmo-wijmenu-link.ui-state-hover .ui-icon, .wijmo-wijmenu-child .wijmo-wijmenu-link.ui-state-active .ui-icon {
- width: 16px;
- height: 16px;
- background-image: url(images/ui-icons_ffffff_256x240.png);
- }
-
-.wijmo-wijcombobox-input {
- background: #fff !important;
- -moz-box-shadow: inset 0 2px 2px #8f8f8f;
- -webkit-box-shadow: inset 0 2px 2px #8f8f8f;
- box-shadow: inset 0 2px 2px #8f8f8f;
-}
-
-
-.wijmo-wijlist-ul .wijmo-wijcombobox-selecteditem, ul.wijmo-wijlist-ul li.wijmo-wijlist-item-selected {
- background: #7389a5;
-}
-
-.wijmo-checkbox .wijmo-checkbox-box, .wijmo-wijradio-box {
- -moz-box-shadow: 0 1px 1px rgba(0,0,0,0.25);
- -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.25);
- box-shadow: 0 1px 1px rgba(0,0,0,0.25);
-}
-
-.wijmo-wijsuperpanel-vbarcontainer .wijmo-wijsuperpanel-handle {
- background: url(images/scrollbar-vertical.png) repeat-y left;
- -moz-border-radius: 12px;
- -webkit-border-radius: 12px;
- border-radius: 12px;
- -moz-box-shadow: inset 1px 0 0 rgba(255,255,255,0.25);
- z-index: 9;
- border-color: #a5a9ae;
- margin: -5px 0;
-}
-
-.wijmo-wijsuperpanel-hbarcontainer .wijmo-wijsuperpanel-handle {
- background: url(images/scrollbar-horizontal.png) repeat-x top;
- -moz-border-radius: 12px;
- -webkit-border-radius: 12px;
- border-radius: 12px;
- -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
- z-index: 9;
- border-color: #a5a9ae;
- margin: 0 -5px;
-}
-
-.wijmo-wijsuperpanel-vbarcontainer {
- background: #f8f8f8;
- -moz-box-shadow: inset 3px 0 10px rgba(0,0,0,0.25);
- -webkit-box-shadow: inset 3px 0 10px rgba(0,0,0,0.25);
- box-shadow: inset 3px 0 10px rgba(0,0,0,0.25);
-}
-
-.wijmo-wijsuperpanel-hbarcontainer {
- background: #f8f8f8;
- -moz-box-shadow: inset 0 3px 10px rgba(0,0,0,0.25);
- -webkit-box-shadow: inset 0 3px 10px rgba(0,0,0,0.25);
- box-shadow: inset 0 3px 10px rgba(0,0,0,0.25);
-}
-
- .wijmo-wijsuperpanel-vbarcontainer .wijmo-wijsuperpanel-handle .ui-icon, .wijmo-wijsuperpanel-hbarcontainer .wijmo-wijsuperpanel-handle .ui-icon {
- display: none;
- }
-
-.wijmo-wijsuperpanel .wijmo-wijsuperpanel-vbarcontainer .wijmo-wijsuperpanel-vbar-buttontop {
- background: url(images/scroller-up-arrow.png) no-repeat top;
- border: none;
- height: 25px;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
- width: 18px;
-}
-
- .wijmo-wijsuperpanel .wijmo-wijsuperpanel-vbarcontainer .wijmo-wijsuperpanel-vbar-buttontop.ui-state-hover {
- background: url(images/scroller-up-arrow_hover.png) no-repeat top;
- }
-
-.wijmo-wijsuperpanel .wijmo-wijsuperpanel-vbarcontainer .wijmo-wijsuperpanel-vbar-buttonbottom {
- background: url(images/scroller-down-arrow.png) no-repeat bottom;
- height: 25px;
- border: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
- width: 18px;
-}
-
- .wijmo-wijsuperpanel .wijmo-wijsuperpanel-vbarcontainer .wijmo-wijsuperpanel-vbar-buttonbottom.ui-state-hover {
- background: url(images/scroller-down-arrow_hover.png) no-repeat top;
- }
-
-.wijmo-wijsuperpanel .wijmo-wijsuperpanel-hbarcontainer .wijmo-wijsuperpanel-hbar-buttonleft {
- background: url(images/scroller-left-arrow.png) no-repeat left;
- width: 25px;
- border: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
- height: 18px;
-}
-
- .wijmo-wijsuperpanel .wijmo-wijsuperpanel-hbarcontainer .wijmo-wijsuperpanel-hbar-buttonleft.ui-state-hover {
- background: url(images/scroller-left-arrow_hover.png) no-repeat top;
- }
-
-.wijmo-wijsuperpanel .wijmo-wijsuperpanel-hbarcontainer .wijmo-wijsuperpanel-hbar-buttonright {
- background: url(images/scroller-right-arrow.png) no-repeat right;
- width: 25px;
- border: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
- height: 18px;
-}
-
- .wijmo-wijsuperpanel .wijmo-wijsuperpanel-hbarcontainer .wijmo-wijsuperpanel-hbar-buttonright.ui-state-hover {
- background: url(images/scroller-right-arrow_hover.png) no-repeat top;
- }
-
-.wijmo-wijsuperpanel .wijmo-wijsuperpanel-vbarcontainer .wijmo-wijsuperpanel-vbar-buttonbottom .ui-icon {
- margin-top: 10px;
-}
-
-.wijmo-wijsuperpanel .wijmo-wijsuperpanel-hbarcontainer .wijmo-wijsuperpanel-hbar-buttonright .ui-icon {
- margin-left: 10px;
-}
-
-.wijmo-wijmenu-horizontal .wijmo-wijmenu-link.ui-state-hover, .wijmo-wijmenu-horizontal .wijmo-wijmenu-link.ui-state-active, .wijmo-wijmenu-horizontal .wijmo-wijmenu-link.ui-state-default, .wijmo-wijmenu .wijmo-wijmenu-link.ui-state-hover, .wijmo-wijmenu .wijmo-wijmenu-link.ui-state-active, .wijmo-wijmenu .wijmo-wijmenu-link.ui-state-focus {
- border: solid 1px #587e93;
-}
-
-.wijmo-wijmenu-child .wijmo-wijmenu-link.ui-state-focus {
- background: #7389a5;
- color: #fff;
- text-shadow: 1px 1px 1px rgba(0,0,0,0.50);
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
- -moz-border-radius: 0;
- border-radius: 0;
- -webkit-border-radius: 0;
-}
-
-
-.ui-tabs .ui-tabs-nav li.ui-state-default {
- border: solid 1px #8b8b8b;
-}
-
-.ui-tabs-bottom .ui-tabs-nav li.ui-state-default {
- border: solid 1px #8b8b8b !important;
- margin-top: -1px;
-}
-
-div.ui-tabs-bottom .ui-tabs-nav li.ui-tabs-selected {
- padding: 0;
-}
-
-.ui-tabs-left .ui-tabs-nav li.ui-state-default {
- border-bottom: solid 1px #8b8b8b !important;
- margin-right: 3px;
- border-right: none;
-}
-
-.ui-tabs-right .ui-tabs-nav li.ui-state-default {
- border-bottom: solid 1px #8b8b8b !important;
- margin-left: 0;
- border-left: none;
-}
-
-.wijmo-wijmenu-horizontal .wijmo-wijmenu-child .wijmo-wijmenu-link {
- margin-left: -4px;
- padding-left: 14px;
- width: 92%;
-}
-
-.ui-datepicker-calendar td.ui-datepicker-today a.ui-state-default {
- background: #7389a5;
- -moz-box-shadow: inset 0 0 5px #364f72;
- -webkit-box-shadow: inset 0 0 5px #364f72;
- box-shadow: inset 0 0 5px #364f72;
- color: #fff;
-}
-
-.ui-datepicker-calendar td a.ui-state-hover {
- background: #5f83b9;
-}
-
-.wijmo-wijgrid tr.wijmo-wijgrid-row {
- border-color: #dfdfdf;
-}
-
-.wijmo-wijgrid div.wijmo-wijgrid-footer {
- border-top: solid 1px #A8A8A8 !important;
- border-right: none;
-}
-
-.wijmo-wijgrid tr.wijmo-wijgrid-row:first {
- border-top: none;
-}
-
-.wijmo-wijgrid tr.wijmo-wijgrid-row.ui-state-hover, .wijmo-wijgrid .wijmo-wijgrid-current-cell, .wijmo-wijgrid td.wijmo-wijgrid-rowheader.ui-state-active {
- background: #5f83b9;
- color: #fff;
- text-shadow: 1px 1px 1px #333;
- border-color: transparent;
-}
-
-.wijmo-wijgrid tr.wijmo-wijgrid-row td.ui-state-highlight {
- background: #7389a5;
- border-color: transparent;
-}
-
-.wijmo-wijgrid tr.wijmo-wijgrid-row td.wijmo-wijgrid-current-cell {
- background: #5d7798;
- color: #FFFFFF !important;
- text-shadow: 0 1px 1px #234386;
- -moz-box-shadow: inset 0 0 5px rgba(0,0,0,0.50);
- -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.50);
- box-shadow: inset 0 0 5px rgba(0,0,0,0.50);
-}
-
-.wijmo-wijgrid-alternatingrow {
- background: #f2f5f9;
-}
-
-.wijmo-wijgrid th.wijmo-wijgrid-rowheader {
- border-left: none;
- border-top: none;
-}
-
-.wijmo-wijmenu-footer {
- height: 23px;
- line-height: 22px;
- margin-top: 3px;
-}
-
-.wijmo-wijtooltip-pointer {
- border-color: transparent;
-}
-
-.ui-datepicker-multi .ui-datepicker-group table {
- width: 100%;
-}
-
- .ui-datepicker-multi .ui-datepicker-group table thead {
- border-left: none;
- border-right: solid 1px #A8A8A8;
- }
-
-.ui-datepicker-group-first {
- border-left: solid 1px #A8A8A8;
- margin-left: -1px;
-}
-
-.ui-datepicker-multi .ui-datepicker-group-last table thead {
- border-right: none;
-}
-
-.ui-datepicker-group-last {
- border-right: solid 1px #A8A8A8;
- margin-right: -1px;
-}
-
-.ui-datepicker .wijmo-wijcalendar-header {
- -moz-border-radius: 0;
-}
-
-.ui-datepicker div.wijmo-wijcalendar-header-inner {
- border: none;
- background: none;
-}
-
-.wijmo-wijaccordion .ui-accordion-content-active {
- margin-bottom: 2px;
-}
-
-.wijmo-wijcalendar-preview-wrapper .wijmo-wijcalendar .ui-datepicker-header {
- width: 78.5%;
- margin-left: 16px;
-}
-
-.wijmo-wijcalendar .ui-datepicker-header .ui-state-default, .wijmo-wijmenu .ui-state-default, .wij-menu-ipod .wijmo-wijmenu-list, .wijmo-wijtooltip-close {
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-
- .wijmo-wijmenu-ipod .wijmo-wijmenu-item .wijmo-wijmenu-link.ui-state-hover .ui-icon, .wijmo-wijtooltip-close .ui-icon {
- background-image: url(images/ui-icons_ffffff_256x240.png);
- }
-
-.wijmo-wijmenu .wijmo-wijmenu-child, .wijmo-dropdown, .wijmo-wijgrid-filterlist {
- -moz-box-shadow: 0 5px 20px rgba(0,0,0,0.50);
- -webkit-box-shadow: 0 5px 20px rgba(0,0,0,0.50);
- box-shadow: 0 5px 20px rgba(0,0,0,0.50);
-}
-
-.ui-datepicker, .ui-accordion-content {
- -moz-border-radius: 0;
- -webkit-border-radius: 0;
- border-radius: 0;
-}
-
-.wijmo-wijcalendar .ui-datepicker-group .ui-datepicker-header, .ui-datepicker-multi .ui-datepicker-group table tbody {
- border-right: none;
- border-left: none;
-}
-
-.ui-datepicker tbody .ui-datepicker-week-col, td.wijmo-wijcalendar-outofrangeday {
- border: solid 1px #a8a8a8;
-}
-
-.ui-expander-top .ui-expander-content, .ui-accordion-top .ui-accordion-content {
- border-top: solid 1px #A8A8A8 !important;
- margin-bottom: -1px !important;
-}
-
-.ui-expander-right .ui-expander-content, .ui-accordion-right .ui-accordion-content {
- border-top: solid 1px #A8A8A8 !important;
- border-right: solid 1px #A8A8A8 !important;
- border-bottom: solid 1px #A8A8A8 !important;
- padding: 0 1em !important;
-}
-
-.ui-expander-left .ui-expander-content, .ui-accordion-left .ui-accordion-content {
- border-top: solid 1px #A8A8A8 !important;
- border-left: solid 1px #A8A8A8 !important;
- border-bottom: solid 1px #A8A8A8 !important;
- padding: 0 1em !important;
-}
-
-div.wijmo-wijcalendar table.wijmo-wijcalendar-mygrid {
- margin: 0;
- border-left: solid 1px #a8a8a8;
-}
-
-.wijmo-wijcalendar .ui-datepicker-group .ui-datepicker-header {
- border-right: solid 1px #a8a8a8;
-}
-
-div.wijmo-wijribbon .ui-icon, .wijmo-wijribbon-abbrevicon, div.wijmo-wijribbon-simple span.ui-icon, .wijmo-wijribbon .wijmo-wijribbon-group .ui-button:hover .ui-icon, div.wijmo-wijribbon-modes span.ui-icon, .wijmo-wijribbon-group .wijmo-wijribbon-abbrevgroup:hover .ui-icon, .wijmo-wijribbon-group .wijmo-wijribbon-abbrevgroup:hover .wijmo-wijribbon-abbrevicon {
- background-image: url("images/wijmo-ui-icons_000000_240x112.png");
-}
-
-.wijmo-wijinput .wijmo-wijinput-input {
- color: #313131;
-}
-
-
-/* WIJMO ACCORDION COMPATIBILITY */
-.wijmo-wijaccordion .ui-accordion-header {
- display: block;
- cursor: pointer;
- position: relative;
- margin-top: 2px;
- zoom: 1;
- padding: .5em .5em .5em .7em;
- width: auto !important;
-}
-
-.wijmo-wijaccordion .ui-accordion-icon {
- padding-left: 2.2em;
-}
-
-.wijmo-wijaccordion .ui-accordion-noicons {
- padding-left: .7em;
-}
-
-.wijmo-wijaccordion .ui-accordion-header a {
- padding-left: 1.2em;
- font-size: 1em;
- display: block;
-}
-
-.wijmo-wijaccordion .ui-accordion-header .ui-icon {
- position: absolute;
- left: .5em;
- top: 50%;
- margin-top: -8px;
-}
-
-.wijmo-wijaccordion .ui-accordion-content {
- overflow: auto;
- zoom: 1;
- padding: 1em 2.2em;
- display: none;
-}
-
- .wijmo-wijaccordion .ui-accordion-content.ui-accordion-content-active {
- display: block;
- }
-
-.wijmo-wijaccordion a {
- outline: none;
-}
-
-.wijmo-wijaccordion-bottom .ui-accordion-content-active {
- border-top: none;
-}
-
-.wijmo-wijaccordion-right .ui-accordion-header {
- margin-top: 0;
- margin-left: 1px;
- height: 12em;
- overflow: hidden;
- padding: .7em .5em .5em;
-}
-
-.wijmo-wijaccordion-right .ui-accordion-content-active {
- border-left: none;
-}
-
-.wijmo-wijaccordion-left .ui-accordion-header {
- margin-top: 0;
- margin-right: 1px;
- height: 12em;
- overflow: hidden;
- padding: .7em .5em .5em;
-}
-
-.wijmo-wijaccordion-left .ui-accordion-content-active {
- border-right: none;
-}
-
-.ui-accordion-top .ui-accordion-header {
- margin: 0 0 1px;
-}
-
-.wijmo-wijaccordion-top .ui-accordion-content-active {
- border-bottom: none;
-}
-
-.ui-accordion-right .ui-accordion-content, .ui-accordion-left .ui-accordion-content {
- width: 36em;
- height: 13em !important;
- margin: 0;
- padding: .7em 2.2em .5em;
-}
-
-.ui-accordion-right .ui-accordion-header a, .ui-accordion-left .ui-accordion-header a {
- text-align: center;
- padding: 1.2em .5em .5em !important;
-}
-
-.ui-accordion-right .ui-accordion-header .ui-icon, .ui-accordion-left .ui-accordion-header .ui-icon {
- top: .5em !important;
- left: 50%;
- margin-left: -9px;
- margin-top: 0;
-}
-/*@wijmo*/
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsjquerywijmowijspreadalljs"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/jquery.wijmo.wijspread.all.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/jquery.wijmo.wijspread.all.js 2016-08-01 21:35:00 UTC (rev 3760)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/jquery.wijmo.wijspread.all.js 2016-08-01 23:10:39 UTC (rev 3761)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,15 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/*
- *
- * SpreadJS Library 1.20133.8
- * http://wijmo.com/
- *
- * Copyright(c) GrapeCity, Inc. All rights reserved.
- *
- * Licensed under the Wijmo Commercial License. Also available under the GNU GPL Version 3 license.
- * licensing@wijmo.com
- * http://wijmo.com/widgets/license/
- *
- *
- **/
-
-var wijmo;(function(n){(function(n){function i(n,i){t.ensure(n);if(i&&i.length>0)if(!t.check(i)){var r=window.console;r&&r.error&&r.error("["+n+"]: One or more dependency in ["+i+"] are not found!")}}var r=jQuery,t=function(){function t(n,t,i){this.prop=n,this.getter=t,this.setter=i}return t.parse=function(i){var f,r,e,u;if(i!==undefined&&i!==null&&i.length>0){f=i.split("."),r=null;do e=f.shift(),u=new t(e,function(){return this.base?this.base.getter()[this.prop]:n.features[this.prop]},function(t){if(this.base){var i=this.base.getter();(i===null||i===undefined)&&this.base.setter(i={}),i[this.prop]=t}else n.features[this.prop]=t}),r&&(u.base=r),r=u;while(f.length>0);return r}return null},t.ensure=function(n){var i=t.parse(n);i&&i.setter(!0)},t.check=function(n){var i=!0;return r.each(n,function(n,r){var u=t.parse(r);if(u)if(!u.getter())return i=!1;return!0}),i},t}();n.feat
ure=i,n.features=function(n){return n?n:{core:{migrate:!1,mousewheel:!1,stringResource:!1,common:!1,imageLoader:!1,theme:!1,globalize:!1,spreadpanelex:!1,basecelltype:!1,sheet_model:!1,sheet_action:!1,sheet_event:!1,sheet_border:!1,sheet_render:!1,sheet_ui:!1,sheet:!1,spread:!1,spread_ui:!1},calc:{common:!1,functions:!1,functions_db:!1,functions_eng:!1,functions_fin:!1,functions_lookup:!1,functions_stat:!1},filter:!1,filter_ui:!1,sparkline:!1,table:!1,binding:!1,group:!1,celltype:!1,conditionalFormat:!1,dataValidator:!1,fill:!1,fill_ui:!1,formatter:!1,search:!1}}(n.features)})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(n){(function(t){n.feature("core.migrate"),function(n,t){var r=t().jquery?t().jquery.split("."):"",u,i,e,f;(parseInt(r[0],10)>1||parseInt(r[0],10)===1&&parseInt(r[1],10)>=9)&&(t.event.handle=t.event.dispatch,t.uaMatch=function(n){n=n.toLowerCase();var t=/(chrome)[ \/]
([\w.]+)/.exec(n)||/(webkit)[ \/]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[];return{browser:t[1]||"",version:t[2]||"0"}},t.browser||(u=t.uaMatch(navigator.userAgent),i={},u.browser&&(i[u.browser]=!0,i.version=u.version),i.chrome?i.webkit=!0:i.webkit&&(i.safari=!0),t.browser=i),e=t.fn.toggle,t.fn.toggle=function(n,i){if(!t.isFunction(n)||!t.isFunction(i))return e.apply(this,arguments);var f=arguments,o=n.guid||t.guid++,r=0,u;u=function(i){var u=(t._data(this,"lastToggle"+n.guid)||0)%r;return t._data(this,"lastToggle"+n.guid,u+1),i.preventDefault(),f[u].apply(this,arguments)||!1},u.guid=o;while(r<f.length)f[r++].guid=o;return this.click(u)},f=t.fn.andSelf||t.fn.addBack,t.fn.andSelf=function(){return f.apply(this,arguments)}),r=t.ui.dialog.version?t.ui.dialog.version.split("."):&q
uot;",(parseInt(r[0],10)>1||parseInt(r[0],10)===1&&parseInt(r[1],10)>=10)&&(t.extend(t.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(n){var t=n.attr("id");return t||(this.uuid+=1,t=this.uuid),"ui-dialog-title-"+t},overlay:function(n){this.$el=t.ui.dialog.overlay.create(n)}}),t.extend(t.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:t.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(n){return n+".dialog-overlay"}).join(" "),create:function(i){this.instances.length===0&&(setTimeout(function(){t.ui.dialog.overlay.instances.length&&t(document).bind(t.ui.dialog.overlay.events,function(n){if(t(n.target).zIndex()<t.ui.dialog.overlay.maxZ)return!1})},1),t(n).bind("resize.dialog-overlay",t.ui.dialog.overlay.resize));var r=this.oldInstances.pop()||t("<div>").addClass("ui-widget-overlay");return t(document).bind(&quo
t;keydown.dialog-overlay",function(n){var u=t.ui.dialog.overlay.instances;u.length!==0&&u[u.length-1]===r&&i.options.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===t.ui.keyCode.ESCAPE&&(i.close(n),n.preventDefault())}),r.appendTo(document.body).css({width:this.width(),height:this.height()}),t.fn.bgiframe&&r.bgiframe(),this.instances.push(r),r},destroy:function(i){var u=t.inArray(i,this.instances),r=0;u!==-1&&this.oldInstances.push(this.instances.splice(u,1)[0]),this.instances.length===0&&t([document,n]).unbind(".dialog-overlay"),i.height(0).width(0).remove(),t.each(this.instances,function(){r=Math.max(r,this.css("z-index"))}),this.maxZ=r},height:function(){var i,r;return t.ui.ie?(i=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),r=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),i<r?t(n).height()+"px":i+&qu
ot;px"):t(document).height()+"px"},width:function(){var i,r;return t.ui.ie?(i=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),r=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),i<r?t(n).width()+"px":i+"px"):t(document).width()+"px"},resize:function(){var n=t([]);t.each(t.ui.dialog.overlay.instances,function(){n=n.add(this)}),n.css({width:0,height:0}).css({width:t.ui.dialog.overlay.width(),height:t.ui.dialog.overlay.height()})}}),t.extend(t.ui.dialog.overlay.prototype,{destroy:function(){t.ui.dialog.overlay.destroy(this.$el)}}))}(window,jQuery)})(n.migrate||(n.migrate={}));var t=n.migrate})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(n){(function(t){n.feature("core.mousewheel",["core.migrate"]);var u="DOMMouseScroll",t="mousewheel",r="undefined",f="on",i=[u,t];typeof jQuery.event.
special.gcmousewheel===r&&function(n){function e(i){var f=[].slice.call(arguments,1),u=0,e=!0;return i=n.event.fix(i||window.event),i.type="gc"+t,(typeof i.wheelDelta===r||i.wheelDelta===null)&&(typeof i.detail===r||i.detail===null)&&(i.wheelDelta=i.originalEvent.wheelDelta,i.detail=i.originalEvent.detail),i.wheelDelta&&(u=i.wheelDelta/120),i.detail&&(u=-i.detail/3),f.unshift(i,u),n.event.handle.apply(i.target||i.srcElement,f)}n.event.special.gcmousewheel={setup:function(){var r,n;if(this.addEventListener)for(r=i.length;r;)n=i[--r],n===t&&this.addEventListener(u,e,!1),this.addEventListener(n,e,!1);else this.attachEvent(f+t,e)},teardown:function(){var r,n;if(this.removeEventListener)for(r=i.length;r;)n=i[--r],n===t&&this.removeEventListener(u,e,!1),this.removeEventListener(n,e,!1);else this.detachEvent(f+t,e)}},n.fn.extend({handlegcmousewheel:function(n){return n?this.bind(t,n):this.trigger(t)},unhandlegcmousewheel:fun
ction(n){return this.unbind(t,n)}})}(jQuery)})(n.mousewheel||(n.mousewheel={}));var t=n.mousewheel})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(n){var t,i;n.feature("core.stringResource"),t=function(){function n(){}return n.Exp_InvalidArgument="Invalid argument",n.Exp_InvalidCast="InvalidCastException",n.Exp_NotSupport="NotSupportException",n.Exp_FormulaInvalid="The formula you typed contains an invalid char: ",n.Exp_InvalidTokenAt="invalid token at ",n.Exp_InvalidArrayAt="Invalid array at ",n.Exp_InvalidCellReference="Invalid cell reference or name at ",n.Exp_InvalidFunctionName="Invalid function name",n.Exp_InvalidOverrideFunction="Cannot override built-in function",n.Exp_OverrideNotAllowed="Attempt to override function while override is not allowed",n.Exp_NoSyntax="no syntax '",n.Exp_MatchSyntax="'to match
the syntax '",n.SingleQuotesFullStop="'.",n.SingleQuote="'",n.Exp_IsValid="' is invalid.",n.Exp_InvalidArray="Invalid array",n.AtIndexOn="' at index on ",n.FullStop=".",n.SingleQuoteAt="' at ",n.Exp_InvalidParameters="Invalid function parameters at ",n.Exp_InvalidArrayColumns="The length of array columns are unequal at ",n.Exp_ExprIsNull="The argument 'expr' is null",n.Exp_RuleIsNull="The argument 'rule' is null",n.CopyCells="Copy Cells",n.FillSeries="Fill Series",n.FillFormattingOnly="Fill Formatting Only",n.FillWithoutFormatting="Fill Without Formatting",n.Exp_NumberOnly="Only works for Numbers",n.Exp_RangeContainsMergedCell="Range should not have merged cell.",n.Exp_ChangeMergedCell="Cannot change part of merged cell.",n.Exp_TargetContainsMergedCells="Target range should not have merged cells.
",n.Exp_MergedCellsIdentical="This operation requires the merged cells to be identically sized.",n.SortAscending="Sort Ascending",n.SortDescending="Sort Descending",n.OK="OK",n.Cancel="Cancel",n.Search="Search",n.CheckAll="Check all",n.UncheckAll="Uncheck all",n.Blanks="(Blanks)",n.Exp_FilterItemIsNull="FilterItem is null.",n.Exp_InvalidColumnIndex="Invalid column index.",n.Exp_TokenIsNull="token is null",n.Exp_InvalidBackslash="the '\\' cannot be evaluated",n.Exp_FormatIllegal="format is illegal.",n.Exp_ValueIsNull="value is null",n.Exp_PartIsNull="part is null",n.Exp_DuplicatedDescriptor="The type of descriptor was added.",n.Exp_TokenIllegal="token is illegal.",n.Exp_ValueIllegal="value is illegal.",n.Exp_StringIllegal="string is illegal.",n.Exp_InvalidNull="InvalidNullExcep
tion",n.Exp_InvalidOperation="InvalidOperationException",n.Exp_ArgumentNull="ArgumentNullException",n.Exp_CriteriaIsNull="criteria is null",n.Exp_InvalidString="Invalid string",n.Exp_InvalidDateFormat="Invalid date format pattern",n.Exp_InvalidOADate="invalid OADate",n.Exp_InvalidExponentFormat="invalid exponent format",n.Exp_InvalidSemicolons="invalid format: too many semicolons",n.Exp_InvalidNumberGroupSize="NumberGroupSize must be between 1 and 9.",n.Exp_BadFormatSpecifier="Bad Format Specifier",n.Exp_InvalidNumberFormat="Invalid number format pattern",n.Exp_InvalidIndex="Invalid index",n.Exp_InvalidCount="Invalid count",n.Exp_InvalidLevel="Invalid level",n.Exp_GroupInfoIsNull="groupInfo is null",n.Exp_SheetIsNull="sheet is null.",n.Exp_DestSheetIsNull="destSheet is null",n.Exp_PasteExtentIsNull="pasteE
xtent is null",n.Exp_InvalidPastedArea="The pasted area should have the same size as the copy or cut area.",n.Exp_ChangePartOfArray="Cannot change part of an array.",n.Exp_ColumnReadOnly="The column you are trying to change is protected and therefore read-only.",n.Exp_RowReadOnly="The row you are trying to change is protected and therefore read-only.",n.Exp_CellReadOnly="The row you are trying to change is protected and therefore read-only.",n.Exp_FillRangeContainsMergedCell="Cannot fill range that contains a merged cell.",n.Exp_FillCellsReadOnly="The cells you are trying to fill is protected and therefore read-only.",n.Exp_OverlappingSpans="This operation will cause overlapping spans.",n.Exp_InvalidAndSpace="Invalid ",n.ColonSpace=": ",n.MustBeBetween=" (must be between ",n.SpaceAndSpace=" and ",n.RightBracketFullStop=").",n.Exp_SrcIsNull="The
argument 'src' is null",n.Exp_DestIsNull="The argument 'dest' is null",n.Exp_InvalidCustomFunction="invalid custom function",n.Exp_InvalidCustomName="invalid custom name",n.Exp_IndexOutOfRange="Index is out of range!",n.Exp_InvalidRange="Invalid range",n.Exp_RangeIsNull="range is null",n.Exp_NotAFunction="is not a function",n.Exp_Format="Format",n.Exp_BraceMismatch="format: brace mis-match",n.Exp_InvalidFormat="invalid format",n.Exp_ArgumentOutOfRange="ArgumentOutOfRange",n.Exp_DragDropShiftTableCell="This operation is not allowed. The operation is attempting to shift cells in a table on your worksheet.",n.Exp_DragDropChangePartOfTable="Cannot complete operation: You are attempting to change a portion of a table row or column in a way that is not allowed.",n.Exp_TableEmptyNameError="The table name cannot be empty.",n.Exp_TableInvalidRow=&qu
ot;Invalid row index or row count.",n.Exp_TableInvalidColumn="Invalid column index or column count.",n.Exp_TableIntersectError="The tables cannot be intersected.",n.Exp_TableHasSameNameError="The current worksheet already exists in a table with the same name.",n.Exp_TableDataSourceNullError="Table datasource cannot be null.",n.Exp_TableStyleAddCustomStyleError="The style with the same name already exists in the styles.",n.Exp_TableMoveOutOfRange="The table cannot be moved out of the sheet.",n.Exp_TableResizeOutOfRange="The invalid row count, column count and table cannot be resize out of the sheet.",n.Exp_PasteSourceCellsLocked="Source sheet's cells are locked.",n.Exp_InvalidCopyPasteSize="The copy and paste areas are not the same size.",n.Exp_PasteDestinationCellsLocked="The cell you are trying to change is protected and therefore read-only.",n.Exp_PasteChangeMergeCell="Can
not change part of a merged cell.",n.Tip_Row="Row: ",n.Tip_Column="Column: ",n.Tip_Height="Height: ",n.Tip_Width="Width: ",n.Tip_pixels=" pixels",n.NewTab="New...",n.Exp_EmptyNamedStyle="The name of named style cannot be empty or null",n}(),n._ENStringResource=t,i=function(){function n(){}return n.Exp_InvalidArgument="\u7121\u52b9\u306a\u5f15\u6570",n.Exp_InvalidCast="\u4f8b\u5916:\u7121\u52b9\u306a\u30ad\u30e3\u30b9\u30c8",n.Exp_NotSupport="\u4f8b\u5916:\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u6a5f\u80fd\u306e\u5229\u7528\u3092\u8a66\u307f\u307e\u3057\u305f",n.Exp_FormulaInvalid="\u5165\u529b\u3055\u308c\u305f\u6570\u5f0f\u306f\u7121\u52b9\u306a\u6587\u5b57\u3092\u542b\u3093\u3067\u3044\u307e\u3059 : ",n.Exp_InvalidTokenAt="\u7121\u52b9\u306a\u30c8\u30fc\u30af\u30f3 : ",n.Exp_InvalidArrayAt="\u7121\u52b9\u306a\u914d\u5217 : ",n.
Exp_InvalidCellReference="\u30bb\u30eb\u540d\u3082\u3057\u304f\u306f\u30bb\u30eb\u53c2\u7167\u304c\u7121\u52b9\u3067\u3059 : ",n.Exp_InvalidFunctionName="\u7121\u52b9\u306a\u95a2\u6570\u540d",n.Exp_InvalidOverrideFunction="\u7d44\u8fbc\u95a2\u6570\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093",n.Exp_OverrideNotAllowed="\u8a31\u53ef\u3055\u308c\u3066\u3044\u306a\u3044\u95a2\u6570\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u306e\u5b9f\u884c\u3067\u3059",n.Exp_NoSyntax="\u69cb\u6587 '",n.Exp_MatchSyntax="' \u306f\u6b21\u306e\u69cb\u6587 '",n.SingleQuotesFullStop="' \u3068\u30de\u30c3\u30c1\u3057\u307e\u305b\u3093\u3067\u3057\u305f\u3002",n.SingleQuote="'",n.Exp_IsValid="' \u306f\u7121\u52b9\u3067\u3059\u3002",n.Exp_InvalidArray="\u7121\u52b9\u306a\u914d\u5217 : ",n.AtIndexOn="' \u8a72\u5f53\u3059\u308b\u30a4\u30f3\u30c7\u3
0c3\u30af\u30b9 : ",n.FullStop="",n.SingleQuoteAt="' \u4f4d\u7f6e : ",n.Exp_InvalidParameters="\u7121\u52b9\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u691c\u51fa : ",n.Exp_InvalidArrayColumns="\u914d\u5217\u306e\u30ab\u30e9\u30e0\u9577\u304c\u4e00\u81f4\u3057\u307e\u305b\u3093 \u4f4d\u7f6e : ",n.Exp_ExprIsNull="\u5f15\u6570 'expr' \u304c null \u3067\u3059",n.Exp_RuleIsNull="\u5f15\u6570 'rule' \u304c null \u3067\u3059",n.CopyCells="\u30bb\u30eb\u306e\u30b3\u30d4\u30fc",n.FillSeries="\u9023\u7d50\u30c7\u30fc\u30bf",n.FillFormattingOnly="\u66f8\u5f0f\u306e\u307f\u30b3\u30d4\u30fc",n.FillWithoutFormatting="\u66f8\u5f0f\u306a\u3057\u30b3\u30d4\u30fc",n.Exp_NumberOnly="\u6570\u5b57\u306e\u307f\u6709\u52b9\u3067\u3059",n.Exp_RangeContainsMergedCell="\u7d50\u5408\u3055\u308c\u305f\u30bb\u30eb\u304c\u7bc4\u56f2\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002",n.
Exp_ChangeMergedCell="\u7d50\u5408\u3055\u308c\u305f\u30bb\u30eb\u306e\u4e00\u90e8\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",n.Exp_TargetContainsMergedCells="\u7d50\u5408\u3055\u308c\u305f\u30bb\u30eb\u304c\u6307\u5b9a\u306e\u7bc4\u56f2\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002",n.Exp_MergedCellsIdentical="\u3053\u306e\u64cd\u4f5c\u306b\u306f\u540c\u3058\u30b5\u30a4\u30ba\u306e\u7d50\u5408\u30bb\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002",n.SortAscending="\u6607\u9806",n.SortDescending="\u964d\u9806",n.OK="OK",n.Cancel="\u30ad\u30e3\u30f3\u30bb\u30eb",n.Search="\u691c\u7d22",n.CheckAll="\u3059\u3079\u3066\u9078\u629e",n.UncheckAll="\u3059\u3079\u3066\u89e3\u9664",n.Blanks="(\u7a7a\u767d\u30bb\u30eb)",n.Exp_FilterItemIsNull="\u30d5\u30a3\u30eb\u30bf\u9805\u76ee\u304c null \u3067\u3059\u3002",n.Exp_InvalidColumnIn
dex="\u7121\u52b9\u306a\u5217\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3067\u3059\u3002",n.Exp_TokenIsNull="\u30c8\u30fc\u30af\u30f3\u304c null \u3067\u3059",n.Exp_InvalidBackslash="'\\' \u3092\u8a55\u4fa1\u3067\u304d\u307e\u305b\u3093\u3002",n.Exp_FormatIllegal="\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u304c\u4e0d\u6b63\u3067\u3059\u3002",n.Exp_ValueIsNull="\u5024\u306f null \u3067\u3059",n.Exp_PartIsNull="part \u306f null \u3067\u3059",n.Exp_DuplicatedDescriptor="\u305d\u306e\u7a2e\u985e\u306e\u8a18\u8ff0\u5b50\u306f\u65e2\u306b\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002",n.Exp_TokenIllegal="\u30c8\u30fc\u30af\u30f3\u304c\u4e0d\u6b63\u3067\u3059\u3002",n.Exp_ValueIllegal="\u5024\u304c\u4e0d\u6b63\u3067\u3059\u3002",n.Exp_StringIllegal="\u6587\u5b57\u5217\u304c\u4e0d\u6b63\u3067\u3059\u3002",n.Exp_InvalidNull="\u7121\u52b9\u306a null \u306b\u3088\u308b\u4f8b\u5916",n.Exp
_InvalidOperation="\u7121\u52b9\u306a\u64cd\u4f5c\u306b\u3088\u308b\u4f8b\u5916",n.Exp_ArgumentNull="null \u5f15\u6570\u306b\u3088\u308b\u4f8b\u5916",n.Exp_CriteriaIsNull="\u6761\u4ef6\u3068\u306a\u308b\u5f15\u6570\u304c null \u3067\u3059",n.Exp_InvalidString="\u7121\u52b9\u306a\u6587\u5b57\u5217",n.Exp_InvalidDateFormat="\u7121\u52b9\u306a\u65e5\u4ed8\u30d5\u30a9\u30fc\u30de\u30c3\u30c8",n.Exp_InvalidOADate="\u7121\u52b9\u306a OADate",n.Exp_InvalidExponentFormat="\u7121\u52b9\u306a\u6307\u6570\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u3059",n.Exp_InvalidSemicolons="\u7121\u52b9\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8: \u30bb\u30df\u30b3\u30ed\u30f3\u304c\u591a\u3059\u304e\u307e\u3059",n.Exp_InvalidNumberGroupSize="NumberGroupSize \u306f1\u304b\u30899\u306e\u5024\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002",n.Exp_BadFormatSpecifier="\u8aa4\u3063\u305f\u30d5\u
30a9\u30fc\u30de\u30c3\u30c8\u6307\u793a\u5b50",n.Exp_InvalidNumberFormat="\u7121\u52b9\u306a\u6570\u5024\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u3059",n.Exp_InvalidIndex="\u7121\u52b9\u306a\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3067\u3059",n.Exp_InvalidCount="\u7121\u52b9\u306a\u30ab\u30a6\u30f3\u30c8\u3067\u3059",n.Exp_InvalidLevel="\u7121\u52b9\u306a\u30ec\u30d9\u30eb\u3067\u3059",n.Exp_GroupInfoIsNull="groupInfo \u304c null \u3067\u3059",n.Exp_SheetIsNull="sheet \u304c null\u3067\u3059\u3002",n.Exp_DestSheetIsNull="destSheet \u304c null \u3067\u3059\u3002",n.Exp_PasteExtentIsNull="pasteExtent \u304c null \u3067\u3059",n.Exp_InvalidPastedArea="\u8cbc\u308a\u4ed8\u3051\u9818\u57df\u306f\u30b3\u30d4\u30fc/\u5207\u308a\u53d6\u308a\u7bc4\u56f2\u3068\u540c\u30b5\u30a4\u30ba\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002",n.Exp_ChangePartOfAr
ray="\u914d\u5217\u306e\u4e00\u90e8\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",n.Exp_ColumnReadOnly="\u5909\u66f4\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u5217\u306f\u4fdd\u8b77\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002",n.Exp_RowReadOnly="\u5909\u66f4\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u884c\u306f\u4fdd\u8b77\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002",n.Exp_CellReadOnly="\u5909\u66f4\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u30bb\u30eb\u306f\u4fdd\u8b77\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002",n.Exp_FillRangeContainsMergedCell="\u7d50\u5408\u3057\u305f\u30bb\u30eb\u304c\u542b\u307e\u308c\u308b\u7bc4\u5
6f2\u3092\u30d5\u30a3\u30eb\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",n.Exp_FillCellsReadOnly="\u30d5\u30a3\u30eb\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u7bc4\u56f2\u306f\u4fdd\u8b77\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002",n.Exp_OverlappingSpans="\u3053\u306e\u64cd\u4f5c\u306f\u7d50\u5408\u90e8\u5206\u306e\u91cd\u8907\u3092\u5f15\u304d\u8d77\u3053\u3057\u307e\u3059\u3002",n.Exp_InvalidAndSpace="\u7121\u52b9\u306a ",n.ColonSpace=" : ",n.MustBeBetween=" \u306f ",n.SpaceAndSpace=" \u304b\u3089 ",n.RightBracketFullStop=" \u306e\u9593\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002",n.Exp_SrcIsNull="\u5f15\u6570 'src' \u306f null \u3067\u3059",n.Exp_DestIsNull="\u5f15\u6570 'dest' \u306f null \u3067\u3059",n.Exp_InvalidCustomFunction="\u7121\u52b9
\u306a\u30ab\u30b9\u30bf\u30e0\u95a2\u6570",n.Exp_InvalidCustomName="\u7121\u52b9\u306a\u540d\u524d",n.Exp_IndexOutOfRange="\u7bc4\u56f2\u5916\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3067\u3059!",n.Exp_InvalidRange="\u7121\u52b9\u306a\u7bc4\u56f2",n.Exp_RangeIsNull="\u7bc4\u56f2\u304c null \u3067\u3059",n.Exp_NotAFunction="\u306f\u95a2\u6570\u3067\u306f\u3042\u308a\u307e\u305b\u3093",n.Exp_Format="\u30d5\u30a9\u30fc\u30de\u30c3\u30c8",n.Exp_BraceMismatch="\u30d5\u30a9\u30fc\u30de\u30c3\u30c8: \u62ec\u5f27\u306e\u500b\u6570\u304c\u4e00\u81f4\u3057\u3066\u3044\u307e\u305b\u3093",n.Exp_InvalidFormat="\u7121\u52b9\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8",n.Exp_ArgumentOutOfRange="\u7bc4\u56f2\u5916\u306e\u5f15\u6570",n.Exp_DragDropShiftTableCell="\u3053\u306e\u64cd\u4f5c\u306f\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u4e0a\u306e\u30c6\u30fc\u30d6\u30eb\u5185\u3067\u30bb\u30eb\u3092\u30b7\
u30d5\u30c8\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u305f\u3081\u8a31\u53ef\u3055\u308c\u307e\u305b\u3093\u3002",n.Exp_DragDropChangePartOfTable="\u64cd\u4f5c\u3092\u5b8c\u4e86\u3067\u304d\u307e\u305b\u3093\u3002\u8a31\u53ef\u3055\u308c\u3066\u3044\u306a\u3044\u65b9\u6cd5\u3067\u30c6\u30fc\u30d6\u30eb\u306e\u884c\u307e\u305f\u306f\u5217\u306e\u4e00\u90e8\u3092\u5909\u66f4\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u307e\u3059\u3002",n.Exp_TableEmptyNameError="\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u7a7a\u306b\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",n.Exp_TableInvalidRow="\u7121\u52b9\u306a\u884c\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3082\u3057\u304f\u306f\u884c\u6570\u3067\u3059\u3002",n.Exp_TableInvalidColumn="\u7121\u52b9\u306a\u5217\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3082\u3057\u304f\u306f\u5217\u6570\u3067\u3059\u3002",n.Exp_TableIntersectError="\u30c6\u30fc\u30d6\u30eb\u3092\u91cd\u306d\u5408\u30
8f\u305b\u308b\u3053\u3068\u306f\u51fa\u6765\u307e\u305b\u3093\u3002",n.Exp_TableHasSameNameError="\u3059\u3067\u306b\u540c\u540d\u306e\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u304c\u5b58\u5728\u3057\u307e\u3059\u3002",n.Exp_TableDataSourceNullError="\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3092 null \u306b\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",n.Exp_TableStyleAddCustomStyleError="\u3059\u3067\u306b\u540c\u540d\u306e\u30b9\u30bf\u30a4\u30eb\u540d\u304c\u5b58\u5728\u3057\u307e\u3059\u3002",n.Exp_TableMoveOutOfRange="\u30c6\u30fc\u30d6\u30eb\u3092\u30b7\u30fc\u30c8\u5916\u306b\u79fb\u52d5\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",n.Exp_TableResizeOutOfRange="\u7121\u52b9\u306a\u884c\u6570\u3001\u5217\u6570\u3067\u3059\u3002\u30c6\u30fc\u30d6\u30eb\u3092\u30b7\u30fc\u30c8\u7bc4\u56f2\u5916\u306b\u30ea\u30b5\u30a4\u30ba\u3059\u308b\u3053\u3068\u306f\u3067\u304d\
u307e\u305b\u3093\u3002",n.Exp_PasteSourceCellsLocked="\u53c2\u7167\u5143\u3068\u306a\u3063\u3066\u3044\u308b\u30b7\u30fc\u30c8\u306e\u30bb\u30eb\u306f\u30ed\u30c3\u30af\u3055\u308c\u3066\u3044\u307e\u3059\u3002",n.Exp_InvalidCopyPasteSize="\u30b3\u30d4\u30fc\u3068\u8cbc\u308a\u4ed8\u3051\u306e\u7bc4\u56f2\u30b5\u30a4\u30ba\u304c\u7570\u306a\u3063\u3066\u3044\u307e\u3059\u3002",n.Exp_PasteDestinationCellsLocked="\u5909\u66f4\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u30bb\u30eb\u306f\u4fdd\u8b77\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002",n.Exp_PasteChangeMergeCell="\u7d50\u5408\u3057\u305f\u30bb\u30eb\u306e\u4e00\u90e8\u306f\u5909\u66f4\u3067\u304d\u307e\u305b\u3093\u3002",n.Tip_Row="\u884c: ",n.Tip_Column="\u5217: ",n.Tip_Height="\u9ad8\u3055: ",n.Tip_Width="\u5e45: ",n.Tip_pixels=" \u30d4\u30af\u30
bb\u30eb",n.NewTab="New...",n.Exp_EmptyNamedStyle="\u540d\u524d\u4ed8\u304d\u30b9\u30bf\u30a4\u30eb\u306e\u540d\u79f0\u3092\u7a7a\u306b\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",n}(),n._JPStringResource=i,n._StringResource=t})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(t){function k(n){if(i.browser.safari)return n.font;var t="",r="normal",u="400";return n.fontStyle!==r&&(t=n.fontStyle),n.fontVariant!==r&&(t+=" "+n.fontVariant),n.fontWeight!==r&&n.fontWeight!==u&&(t+=" "+n.fontWeight),t+=" "+n.fontSize,n.lineHeight!==r&&(t+="/"+n.lineHeight),t+=" "+n.fontFamily}function bt(n){var t=document.createElement("span");return i(t).css("visibility","hidden").css("top","-10000px").css("left","-10000px").css
("position","absolute").attr("className","gcFontDetectSpanStyle").attr("gcUIElement","gcFontDetectSpan"),document.body.insertBefore(t,null),{span:t,dispose:function(){document.body.removeChild(t),delete this.span}}}var s,a,r,v,w,it,l,y,vi,f,ai,li,yi,bi,wi,pi,e,ei,u,fi,ui,oi,ci,hi,si,ki,or,er,fr,sr,lr,cr,kt,hr,nr,gi,di,tr,ur,rr,ir,st,ct,lt,vt,at,ht,et,ft,ot,yt,ni,gt,ti,ri,ii,wt,o,b,d,p,c,rt,ut,g,nt,tt,h;t.feature("core.common",["core.migrate","core.stringResource"]);var i=jQuery,dt="boolean",pt="date";typeof i.wijmo=="undefined"&&(i.wijmo=n),s=function(){function n(){}return n.createEventHandler=function(n,t){return function(){return t.apply(n,arguments)}},n.cancelDefault=function(n){return n.preventDefault?(n.preventDefault(),n.stopPropagation()):(n.cancelBubble=!1,n.returnValue=!1),!1},n._isStandardCanvas=function(){return typeof n.canvasApiFound=="un
defined"&&(n.canvasApiFound=typeof document.createElement("canvas").getContext!="undefined"),n.canvasApiFound},n._isSilverlightCanvas=function(){return n._isStandardCanvas()?!0:(typeof n.slCanvasApiFound=="undefined"&&(n.slCanvasApiFound=typeof window.slcanvas!="undefined"),n.slCanvasApiFound)},n._useDoubleBuffer=function(){return n._isStandardCanvas()||n._isSilverlightCanvas()},n.getHAlignByValueType=function(n,t){if(n===f.general){var i=(typeof t=="object"?Object.prototype.toString.call(t).slice(8,-1):typeof t).toLowerCase();n=i==="boolean"?f.center:i==="number"||i==="date"?f.right:f.left}return n},n.inArray=function(n,t,i){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,n,i);var r=t.length;for(i=i?i<0?Math.max(0,r+i):i:0;i<r;i++)if(i in t&&t[i]===n)return i}return-1},n.position=function(t,r){if(!r||!r.offset)return n._position.call(t,r);var u=r
.offset.split(" "),f=r.at.split(" ");return u.length===1&&(u[1]=u[0]),/^\d/.test(u[0])&&(u[0]="+"+u[0]),/^\d/.test(u[1])&&(u[1]="+"+u[1]),f.length===1&&(/left|center|right/.test(f[0])?f[1]="center":(f[1]=f[0],f[0]="center")),n._position.call(t,i.extend(r,{at:f[0]+u[0]+" "+f[1]+u[1],offset:""}))},n.hasCalc=function(){return t.features.calc&&t.features.calc.common},n.toString=function(n){return n=n===null||n===undefined?"":i.type(n)===dt?n.toString().toUpperCase():i.type(n)===pt?n.getHours()===0&&n.getMinutes()===0&&n.getSeconds()===0&&n.getMilliseconds()===0?new t._DateTimeHelper(n).format("M/d/yyyy"):new t._DateTimeHelper(n).format("M/d/yyyy h:mm:ss"):n.toString()},n._position=i.fn.position,n}(),t.util=s,a=function(){function n(){this._eventSuspended=0,typeof window.gcGlobal=="undefined"&&this.
_init()}return n.prototype._isIELessThan9=function(n,t){return n.browser.msie&&(typeof t=="undefined"||t<9)},n.prototype._createDummyObjects=function(){var i=n.prototype,t;i._dummyContent||(t=function(n){var t=document.createElement("span");return t.className=n,t.style.display="none",document.body.insertBefore(t,null),t},i._dummyHeader=t("ui-widget-header ui-state-default"),i._dummyContent=t("ui-widget-content"),i._dummyHover=t("ui-state-hover"),i._dummyHighlight=t("ui-state-highlight"))},n.prototype._init=function(){window.gcGlobal=this,this._eventSuspended=0;var t=n.prototype;this._isIELessThan9(i,document.documentMode)?(window.attachEvent("keydown",t.keyDown),window.attachEvent("keyup",t.keyUp),window.attachEvent("compositionstart",t.compositionStart),document.attachEvent("selectstart",t.docSelectStart)):(window.addEventListener("keydown",t.keyDown,!0
),window.addEventListener("keyup",t.keyUp,!0),window.addEventListener("compositionstart",t.compositionStart,!0),document.addEventListener("selectstart",t.docSelectStart,!0)),i(document).mousedown(function(n){var i=window.gcGlobal.activeElement,r;i&&(r=t.getUIElement(n.target),!r&&i._endEditImp&&(i._endEditImp(!1,!0),i.repaint()),!r&&i._disposeValidationUI&&i._disposeValidationUI(),r||(window.gcGlobal.activeElement=null,i._eventHandler&&i._eventHandler._destroyFocusHolder&&i._eventHandler._destroyFocusHolder()))}),i(document).ready(function(){n.prototype._createDummyObjects()})},n.prototype.keyDown=function(n){var u=window.gcGlobal,t,f,r;if(u._eventSuspended>0)return;t=u.activeElement;if(t&&t._validationSelect){f=i(t._validationSelect);if(f.is(":visible"))return}if(t&&t.getCellType&&t.getActiveRowIndex&&t.getActiveColumnIndex){r=t.getCellType(t.getActiveR
owIndex(),t.getActiveColumnIndex());if(r&&r.isReservedKey(n))return}t&&t.doKeyDown&&(t.doKeyDown(n),(n.keyCode===v.z||n.keyCode===v.y)&&n.ctrlKey&&!n.altKey&&s.cancelDefault(n))},n.prototype.keyUp=function(n){var r=window.gcGlobal,t,i;if(r._eventSuspended>0)return;t=r.activeElement;if(t&&t.getCellType&&t.getActiveRowIndex&&t.getActiveColumnIndex){i=t.getCellType(t.getActiveRowIndex(),t.getActiveColumnIndex());if(i&&i.isReservedKey(n))return}t&&t.doKeyUp&&t.doKeyUp(n)},n.prototype.compositionStart=function(n){var i=window.gcGlobal,t;if(i._eventSuspended>0)return;t=i.activeElement,t&&t.doCompositionStart&&t.doCompositionStart()},n.prototype.docSelectStart=function(n){return!document.all&&window.gcGlobal&&window.gcGlobal.activeElement&&s.cancelDefault(n),!1},n.prototype.getUIElement=function(n){var t=n,i;while(t&&t.tagName!=="BODY&qu
ot;){if(typeof t.getAttribute!="function")break;i=t.getAttribute("gcUIElement"),i||(i=t.gcUIElement);if(i)return t;t=t.parentNode}return null},n.prototype.getWijmoThemeStyle=function(t){var u=n.prototype,i=u._dummyHeader,r;return t===e.Highlight||t===e.Selected?i=u._dummyHighlight:t===e.Hover&&(i=u._dummyHover),r=i.currentStyle,document.defaultView&&document.defaultView.getComputedStyle&&(r=document.defaultView.getComputedStyle(i,"")),r},n.prototype.suspendEvent=function(){var n=window.gcGlobal;n._eventSuspended++},n.prototype.resumeEvent=function(){var n=window.gcGlobal;n._eventSuspended--,n._eventSuspended<0&&(n._eventSuspended=0)},n}(),t.Global=a,window.gcGlobal=new a,r=Array,r.prototype.remove=function(n){for(var t=0;t<this.length;t++)if(this[t]===n){this.splice(t,1);return}},r.prototype.contains=function(n){for(var t=0;t<this.length;t++)if(this[t]===n)return!0;return!1},r.prototype.indexOf=function(n,t){(t==
=undefined||t===null||isNaN(t))&&(t=0);for(var i=t;i<this.length;i++)if(this[i]===n)return i;return-1},r.prototype.map||(r.prototype.map=function(n,i){var s,f,r,u=window.Object(this),h=u.length>>>0,e,o;if(typeof n!="function")throw new TypeError(n+t._StringResource.Exp_NotAFunction);i&&(s=i),f=new Array(h),r=0;while(r<h)r in u&&(e=u[r],o=n.call(s,e,r,u),f[r]=o),r++;return f}),function(n){n[n.left=37]="left",n[n.right=39]="right",n[n.up=38]="up",n[n.down=40]="down",n[n.tab=9]="tab",n[n.enter=13]="enter",n[n.shift=16]="shift",n[n.ctrl=17]="ctrl",n[n.space=32]="space",n[n.altkey=18]="altkey",n[n.home=36]="home",n[n.end=35]="end",n[n.pup=33]="pup",n[n.pdn=34]="pdn",n[n.backspace=8]="backspace",n[n.del=46]="del",n[n.esc=27]="esc",n[n.c=67]="c",n[n.v=86]="v&q
uot;,n[n.x=88]="x",n[n.z=90]="z",n[n.y=89]="y"}(t.Key||(t.Key={})),v=t.Key,w=function(){function n(n,t,i,r,u){this.key=n,this.ctrl=t,this.shift=i,this.alt=r,this.action=u}return n}(),t.KeyMap=w,it=function(){function n(n,t){this.x=n,this.y=t}return n.prototype.clone=function(){return new n(this.x,this.y)},n}(),t.Point=it,l=function(){function n(n,t,i,r){var u=this;u.x=n,u.y=t,u.width=i,u.height=r}return n.prototype.intersect=function(n,t,i,r){var u=this;return n<u.x+u.width&&u.x<n+i&&t<u.y+u.height&&u.y<t+r},n.prototype.intersectRect=function(n){var t=this;return n.x<t.x+t.width&&t.x<n.x+n.width&&n.y<t.y+t.height&&t.y<n.y+n.height},n.prototype.contains=function(n,t){var i=this;return n<i.x+i.width&&i.x<n&&t<i.y+i.height&&i.y<t},n.prototype.getIntersectRect=function(t){var i=this;if(i.intersectRect(t)){var l=i.x,w=i.y,b=i.x+i.width,v=i.y+i.height,p
=t.x,y=t.y,c=t.x+t.width,k=t.y+t.height,r=Math.max(l,p),e=Math.max(w,y),h=Math.min(b,c),s=Math.min(v,k),o=r,a=e,f=h-r,u=s-e;if(f>0&&u>0)return new n(o,a,f,u)}return null},n.empty=function(){return new n(0,0,0,0)},n}(),t.Rect=l,y=function(){function n(n,t,i,r){var u=this;u.row=n,u.rowCount=i,u.col=t,u.colCount=r}return n.prototype.intersect=function(n,t,i,r){var u=this;return(n===-1||u.row===-1||u.row<n+i&&n<u.row+u.rowCount)&&(t===-1||u.col===-1||u.col<t+r&&t<this.col+u.colCount)},n.prototype.getIntersect=function(t,i,r){var u;if(t==null)return null;u=this;if(!u.intersect(t.row,t.col,t.rowCount,t.colCount))return null;var a=u.col==-1?r:u.col+u.colCount-1,l=t.col==-1?r:t.col+t.colCount-1,y=u.row==-1?i:u.row+u.rowCount-1,v=t.row==-1?i:t.row+t.rowCount-1,e=Math.max(u.col,t.col),c=Math.min(a,l),f=Math.max(u.row,t.row),h=Math.min(y,v),s=f==-1?-1:h-f+1,o=e==-1?-1:c-e+1;return new n(f,e,s,o)},n.prototype.contains=function(t,i,r,u){var f=thi
s;if(arguments.length===2)return(f.row===-1||f.row<=t&&t<f.row+f.rowCount)&&(f.col===-1||f.col<=i&&i<f.col+f.colCount);else if(arguments.length===4)return f.containsRange(new n(t,i,r,u));return!1},n.prototype.containsRange=function(n){var t=this;return(t.row===-1||t.row<=n.row&&n.row+n.rowCount<=t.row+t.rowCount)&&(t.col===-1||t.col<=n.col&&n.col+n.colCount<=t.col+t.colCount)},n.prototype.offset=function(t,i){var r=this,f=r.col,u=r.row;return r.col!==-1&&(f+=t),r.row!==-1&&(u+=i),new n(u,f,r.rowCount,r.colCount)},n.prototype.union=function(t){var i=this,u=Math.min(i.row,t.row),r=Math.min(i.col,t.col),e=Math.max(i.row+i.rowCount-1,t.row+t.rowCount-1),f=Math.max(i.col+i.colCount-1,t.col+t.colCount-1);return new n(u,r,e-u+1,f-r+1)},n.prototype.equals=function(t){var i=this;return t instanceof n?i.row===t.row&&i.col===t.col&&i.rowCount===t.rowCount&&i.colCount===t.colCount:!1}
,n}(),t.Range=y,function(n){n[n.up=1]="up",n[n.down=2]="down",n[n.left=3]="left",n[n.right=4]="right"}(t.Direction||(t.Direction={})),vi=t.Direction,function(n){n[n.left=0]="left",n[n.center=1]="center",n[n.right=2]="right",n[n.general=3]="general"}(t.HorizontalAlign||(t.HorizontalAlign={})),f=t.HorizontalAlign,function(n){n[n.top=0]="top",n[n.center=1]="center",n[n.bottom=2]="bottom"}(t.VerticalAlign||(t.VerticalAlign={})),ai=t.VerticalAlign,function(n){n[n.left=0]="left",n[n.center=1]="center",n[n.right=2]="right",n[n.nearest=3]="nearest"}(t.HorizontalPosition||(t.HorizontalPosition={})),li=t.HorizontalPosition,function(n){n[n.top=0]="top",n[n.center=1]="center",n[n.bottom=2]="bottom",n[n.nearest=3]="nearest"}(t.VerticalPosition||(t.VerticalPosition={})),yi=t.VerticalPosition,function(n){n[n.bl
ank=0]="blank",n[n.numbers=1]="numbers",n[n.letters=2]="letters"}(t.HeaderAutoText||(t.HeaderAutoText={})),bi=t.HeaderAutoText,function(n){n[n.All=0]="All",n[n.Values=1]="Values",n[n.Formatting=2]="Formatting",n[n.Formulas=3]="Formulas"}(t.ClipboardPasteOptions||(t.ClipboardPasteOptions={})),wi=t.ClipboardPasteOptions,function(n){n[n.None=0]="None",n[n.IncludeRowHeader=1]="IncludeRowHeader",n[n.IncludeColumnHeader=2]="IncludeColumnHeader",n[n.UnFormatted=8]="UnFormatted",n[n.ImportFormula=16]="ImportFormula"}(t.TextFileOpenFlags||(t.TextFileOpenFlags={})),pi=t.TextFileOpenFlags,function(n){n[n.Normal=0]="Normal",n[n.Highlight=1]="Highlight",n[n.Selected=2]="Selected",n[n.Active=3]="Active",n[n.Hover=4]="Hover"}(t.VisualState||(t.VisualState={})),e=t.VisualState,function(n){n[n.A1=0]="A1",n[n.R1C1=1]="
R1C1"}(t.ReferenceStyle||(t.ReferenceStyle={})),ei=t.ReferenceStyle,function(n){n[n.empty=0]="empty",n[n.thin=1]="thin",n[n.medium=2]="medium",n[n.dashed=3]="dashed",n[n.dotted=4]="dotted",n[n.thick=5]="thick",n[n.double=6]="double",n[n.hair=7]="hair",n[n.mediumDashed=8]="mediumDashed",n[n.dashDot=9]="dashDot",n[n.mediumDashDot=10]="mediumDashDot",n[n.dashDotDot=11]="dashDotDot",n[n.mediumDashDotDot=12]="mediumDashDotDot",n[n.slantedDashDot=13]="slantedDashDot"}(t.LineStyle||(t.LineStyle={})),u=t.LineStyle,function(n){n[n.corner=0]="corner",n[n.colHeader=1]="colHeader",n[n.rowHeader=2]="rowHeader",n[n.viewport=3]="viewport"}(t.SheetArea||(t.SheetArea={})),fi=t.SheetArea,function(n){n[n.Value=1]="Value",n[n.Formula=2]="Formula",n[n.RangeGroup=8]="RangeGroup",n[n.Sparkline=
16]="Sparkline",n[n.Span=32]="Span",n[n.Style=64]="Style",n[n.Tag=128]="Tag",n[n.BindingPath=256]="BindingPath",n[n.All=507]="All"}(t.CopyToOption||(t.CopyToOption={})),ui=t.CopyToOption,function(n){n[n.Single=0]="Single",n[n.Range=1]="Range",n[n.MultiRange=2]="MultiRange"}(t.SelectionPolicy||(t.SelectionPolicy={})),oi=t.SelectionPolicy,function(n){n[n.Cell=0]="Cell",n[n.Row=1]="Row",n[n.Column=2]="Column"}(t.SelectionUnit||(t.SelectionUnit={})),ci=t.SelectionUnit,function(n){n[n.CopyCells=0]="CopyCells",n[n.FillSeries=1]="FillSeries",n[n.FillFormattingOnly=2]="FillFormattingOnly",n[n.FillWithoutFormatting=3]="FillWithoutFormatting",n[n.ClearValues=4]="ClearValues"}(t.AutoFillType||(t.AutoFillType={})),hi=t.AutoFillType,function(n){n[n.Left=0]="Left",n[n.Right=1]="Right",n[n.Up=2]="Up",
n[n.Down=3]="Down"}(t.FillDirection||(t.FillDirection={})),si=t.FillDirection,function(n){n[n.Column=0]="Column",n[n.Row=1]="Row"}(t.FillSeries||(t.FillSeries={})),ki=t.FillSeries,function(n){n[n.Data=1]="Data",n[n.Style=2]="Style",n[n.Sparkline=16]="Sparkline",n[n.Axis=32]="Axis",n[n.BindingPath=64]="BindingPath"}(t.StorageType||(t.StorageType={})),or=t.StorageType,function(n){n[n.Left=0]="Left",n[n.Right=1]="Right",n[n.Up=2]="Up",n[n.Down=3]="Down",n[n.LeftClear=4]="LeftClear",n[n.UpClear=5]="UpClear"}(t.DragFillDirection||(t.DragFillDirection={})),er=t.DragFillDirection,function(n){n[n.Ready=0]="Ready",n[n.Enter=1]="Enter",n[n.Edit=2]="Edit"}(t.EditorStatus||(t.EditorStatus={})),fr=t.EditorStatus,function(n){n[n.AnyValue=0]="AnyValue",n[n.WholeNumber=1]="WholeNumber",n[n.DecimalValues=2]="
;DecimalValues",n[n.List=3]="List",n[n.Date=4]="Date",n[n.Time=5]="Time",n[n.TextLength=6]="TextLength",n[n.Custom=7]="Custom"}(t.CriteriaType||(t.CriteriaType={})),sr=t.CriteriaType,function(n){n[n.ForceApply=0]="ForceApply",n[n.Discard=1]="Discard",n[n.Retry=2]="Retry"}(t.DataValidationResult||(t.DataValidationResult={})),lr=t.DataValidationResult,function(n){n[n.Stop=0]="Stop",n[n.Warning=1]="Warning",n[n.Information=2]="Information"}(t.ErrorStyle||(t.ErrorStyle={})),cr=t.ErrorStyle,function(n){n[n.EqualsTo=0]="EqualsTo",n[n.NotEqualsTo=1]="NotEqualsTo",n[n.GreaterThan=2]="GreaterThan",n[n.GreaterThanOrEqualsTo=3]="GreaterThanOrEqualsTo",n[n.LessThan=4]="LessThan",n[n.LessThanOrEqualsTo=5]="LessThanOrEqualsTo"}(t.GeneralCompareType||(t.GeneralCompareType={})),kt=t.GeneralCompareType,function(n){n[n.Or=0]=&qu
ot;Or",n[n.And=1]="And"}(t.RelationCompareType||(t.RelationCompareType={})),hr=t.RelationCompareType,function(n){n[n.EqualsTo=0]="EqualsTo",n[n.NotEqualsTo=1]="NotEqualsTo",n[n.GreaterThan=2]="GreaterThan",n[n.GreaterThanOrEqualsTo=3]="GreaterThanOrEqualsTo",n[n.LessThan=4]="LessThan",n[n.LessThanOrEqualsTo=5]="LessThanOrEqualsTo",n[n.Between=6]="Between",n[n.NotBetween=7]="NotBetween"}(t.ComparisonOperator||(t.ComparisonOperator={})),nr=t.ComparisonOperator,function(n){n[n.Contains=0]="Contains",n[n.DoesNotContain=1]="DoesNotContain",n[n.BeginsWith=2]="BeginsWith",n[n.EndsWith=3]="EndsWith"}(t.TextComparisonOperator||(t.TextComparisonOperator={})),gi=t.TextComparisonOperator,function(n){n[n.EqualsTo=0]="EqualsTo",n[n.NotEqualsTo=1]="NotEqualsTo",n[n.BeginsWith=2]="BeginsWith",n[n.DoesNotBeginWith=3]="DoesNotBeginWi
th",n[n.EndsWith=4]="EndsWith",n[n.DoesNotEndWith=5]="DoesNotEndWith",n[n.Contains=6]="Contains",n[n.DoesNotContain=7]="DoesNotContain"}(t.TextCompareType||(t.TextCompareType={})),di=t.TextCompareType,function(n){n[n.BackgroundColor=0]="BackgroundColor",n[n.ForegroundColor=1]="ForegroundColor"}(t.ColorCompareType||(t.ColorCompareType={})),tr=t.ColorCompareType,function(n){n[n.Empty=0]="Empty",n[n.NonEmpty=1]="NonEmpty",n[n.Error=2]="Error",n[n.NonError=3]="NonError",n[n.Formula=4]="Formula"}(t.CustomValueType||(t.CustomValueType={})),ur=t.CustomValueType,function(n){n[n.EqualsTo=0]="EqualsTo",n[n.NotEqualsTo=1]="NotEqualsTo",n[n.Before=2]="Before",n[n.BeforeEqualsTo=3]="BeforeEqualsTo",n[n.After=4]="After",n[n.AfterEqualsTo=5]="AfterEqualsTo"}(t.DateCompareType||(t.DateCompareType={})),rr=t.DateCompareType,func
tion(n){n[n.Top=0]="Top",n[n.Bottom=1]="Bottom"}(t.Top10ConditionType||(t.Top10ConditionType={})),ir=t.Top10ConditionType,function(n){n[n.Today=0]="Today",n[n.Yesterday=1]="Yesterday",n[n.Tomorrow=2]="Tomorrow",n[n.Last7Days=3]="Last7Days",n[n.ThisMonth=4]="ThisMonth",n[n.LastMonth=5]="LastMonth",n[n.NextMonth=6]="NextMonth",n[n.ThisWeek=7]="ThisWeek",n[n.LastWeek=8]="LastWeek",n[n.NextWeek=9]="NextWeek"}(t.DateOccurringType||(t.DateOccurringType={})),st=t.DateOccurringType,function(n){n[n.Quarter1=0]="Quarter1",n[n.Quarter2=1]="Quarter2",n[n.Quarter3=2]="Quarter3",n[n.Quarter4=3]="Quarter4"}(t.QuarterType||(t.QuarterType={})),ct=t.QuarterType,function(n){n[n.None=0]="None",n[n.Ascending=1]="Ascending",n[n.Descending=2]="Descending"}(t.SortState||(t.SortState={})),lt=t.SortState,function(n){n[n.A
bove=0]="Above",n[n.Below=1]="Below",n[n.EqualOrAbove=2]="EqualOrAbove",n[n.EqualOrBelow=3]="EqualOrBelow",n[n.Above1StdDev=4]="Above1StdDev",n[n.Below1StdDev=5]="Below1StdDev",n[n.Above2StdDev=6]="Above2StdDev",n[n.Below2StdDev=7]="Below2StdDev",n[n.Above3StdDev=8]="Above3StdDev",n[n.Below3StdDev=9]="Below3StdDev"}(t.AverageConditionType||(t.AverageConditionType={})),vt=t.AverageConditionType,function(n){n[n.Number=0]="Number",n[n.LowestValue=1]="LowestValue",n[n.HighestValue=2]="HighestValue",n[n.Percent=3]="Percent",n[n.Percentile=4]="Percentile",n[n.Automin=5]="Automin",n[n.Formula=6]="Formula",n[n.Automax=7]="Automax"}(t.ScaleValueType||(t.ScaleValueType={})),at=t.ScaleValueType,function(n){n[n.LeftToRight=0]="LeftToRight",n[n.RightToLeft=1]="RightToLeft"}(t.BarDirection||(t.BarDir
ection={})),ht=t.BarDirection,function(n){n[n.Automatic=0]="Automatic",n[n.CellMidPoint=1]="CellMidPoint",n[n.None=2]="None"}(t.DataBarAxisPosition||(t.DataBarAxisPosition={})),et=t.DataBarAxisPosition,function(n){n[n.ThreeArrowsColored=0]="ThreeArrowsColored",n[n.ThreeArrowsGray=1]="ThreeArrowsGray",n[n.ThreeTriangles=2]="ThreeTriangles",n[n.ThreeStars=3]="ThreeStars",n[n.ThreeFlags=4]="ThreeFlags",n[n.ThreeTrafficLightsUnrimmed=5]="ThreeTrafficLightsUnrimmed",n[n.ThreeTrafficLightsRimmed=6]="ThreeTrafficLightsRimmed",n[n.ThreeSigns=7]="ThreeSigns",n[n.ThreeSymbolsCircled=8]="ThreeSymbolsCircled",n[n.ThreeSymbolsUncircled=9]="ThreeSymbolsUncircled",n[n.FourArrowsColored=10]="FourArrowsColored",n[n.FourArrowsGray=11]="FourArrowsGray",n[n.FourRedToBlack=12]="FourRedToBlack",n[n.FourRatings=13]="FourRatings",n[n.FourT
rafficLights=14]="FourTrafficLights",n[n.FiveArrowsColored=15]="FiveArrowsColored",n[n.FiveArrowsGray=16]="FiveArrowsGray",n[n.FiveRatings=17]="FiveRatings",n[n.FiveQuarters=18]="FiveQuarters",n[n.FiveBoxes=19]="FiveBoxes"}(t.IconSetType||(t.IconSetType={})),ft=t.IconSetType,function(n){n[n.Number=1]="Number",n[n.Percent=4]="Percent",n[n.Formula=7]="Formula",n[n.Percentile=5]="Percentile"}(t.IconValueType||(t.IconValueType={})),ot=t.IconValueType,function(n){n[n.Backward=0]="Backward",n[n.Forward=1]="Forward"}(t.RangeGroupDirection||(t.RangeGroupDirection={})),yt=t.RangeGroupDirection,function(n){n[n.None=0]="None",n[n.Column=1]="Column",n[n.Row=2]="Row",n[n.Both=3]="Both"}(t.ShowResizeTip||(t.ShowResizeTip={})),ni=t.ShowResizeTip,function(n){n[n.None=0]="None",n[n.Horizontal=1]="Horizontal",n[n.Vertical=2
]="Vertical",n[n.Both=3]="Both"}(t.ShowScrollTip||(t.ShowScrollTip={})),gt=t.ShowScrollTip,function(n){n[n.Cell=0]="Cell",n[n.CellWithHeader=1]="CellWithHeader"}(t.AutoFitType||(t.AutoFitType={})),ti=t.AutoFitType,function(n){n[n.Stretch=0]="Stretch",n[n.Center=1]="Center",n[n.Zoom=2]="Zoom",n[n.None=3]="None"}(t.ImageLayout||(t.ImageLayout={})),ri=t.ImageLayout,function(n){n[n.SetFormula=0]="SetFormula",n[n.CopyPaste=1]="CopyPaste",n[n.DragFill=2]="DragFill",n[n.DragDrop=3]="DragDrop"}(t.InvalidOperationType||(t.InvalidOperationType={})),ii=t.InvalidOperationType,function(n){n[n.CurrentCulture=0]="CurrentCulture",n[n.CurrentCultureIgnoreCase=1]="CurrentCultureIgnoreCase",n[n.InvariantCulture=2]="InvariantCulture",n[n.InvariantCultureIgnoreCase=3]="InvariantCultureIgnoreCase",n[n.Ordinal=4]="Ordinal",n[n.OrdinalIgno
reCase=5]="OrdinalIgnoreCase"}(t.StringComparison||(t.StringComparison={})),wt=t.StringComparison,o=function(){function n(n,t){this.color="black",this.style=u.empty,this.color=n,this.style=t}return n.prototype.width=function(n){var t=u;if(n&&n.style)switch(n.style){case t.dashDot:case t.thin:case t.dashed:case t.dotted:case t.hair:case t.dashDotDot:return 1;case t.medium:case t.mediumDashDot:case t.mediumDashDotDot:case t.mediumDashed:case t.slantedDashDot:return 2;case t.thick:case t.double:return 3}return 0},n.prototype._weight=function(n){var t=u;if(n&&n.style)switch(n.style){case t.dashDot:case t.dashed:case t.dotted:case t.dashDotDot:case t.hair:return 100;case u.thin:return 101;case t.slantedDashDot:case t.mediumDashed:case t.mediumDashDot:case t.mediumDashDotDot:return 198;case t.medium:return 199;case t.thick:return 300;case t.double:return 90;case t.empty:return 0}return-2},n.prototype.toJSON=function(){return{color:this.color,style:this.
style}},n.prototype.fromJSON=function(n){if(!n)return;typeof n.color!="undefined"&&(this.color=n.color),typeof n.style!="undefined"&&(this.style=n.style)},n}(),t.LineBorder=o,b=function(){var n={};return n["font-style"]=function(n,t){n&&i(t).css("fontStyle",n)},n["font-variant"]=function(n,t){n&&i(t).css("fontVariant",n)},n["font-weight"]=function(n,t){n&&i(t).css("fontWeight",n)},n["font-size"]=function(n,t){n&&i(t).css("fontSize",n)},n["line-height"]=function(n,t){n&&i(t).css("lineHeight",n)},n["font-family"]=function(n,t){n&&i(t).css("fontFamily",n)},n}(),d=function(){function n(n){this._sheet=n}return n.prototype.buildFont=function(n,t){var f="",r,u;if(n){r=bt(this._sheet);try{t&&i(r.span).css("font",t),i.each(b,function(t,i){i(n.hasOwnProperty(t)?n[t
]:null,r.span)})}finally{u=r.span.currentStyle,document.defaultView&&document.defaultView.getComputedStyle&&(u=document.defaultView.getComputedStyle(r.span,"")),f=k(u),r.dispose()}}return f},n}(),t.FontFactory=d,p=function(){function n(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b){var k=this;k.backgroundImage=p,k.backgroundImageLayout=b,k.backColor=n,k.foreColor=t,k.hAlign=i,k.vAlign=r,k.font=u,k.themeFont=f,k.formatter=e,k.borderLeft=o,k.borderTop=s,k.borderRight=h,k.borderBottom=c,k.locked=l,k.textIndent=a,k.wordWrap=v,k.shrinkToFit=y,k.validator=undefined,k.cellType=w}return n.prototype._initDefault=function(){var n=this;n.backgroundImage=undefined,n.backgroundImageLayout=undefined,n.backColor=undefined,n.foreColor=undefined,n.hAlign=undefined,n.vAlign=undefined,n.font=undefined,n.themeFont=undefined,n.formatter=undefined,n.validator=undefined,n.borderLeft=undefined,n.borderTop=undefined,n.borderRight=undefined,n.borderBottom=undefined,n.locked=undefined,n.textIn
dent=undefined,n.wordWrap=undefined,n.shrinkToFit=undefined,n.cellType=undefined,n.name=undefined,n.parentName=undefined},n.prototype.copyFrom=function(n){var t=this;t.backgroundImage=n.backgroundImage,t.backgroundImageLayout=n.backgroundImageLayout,t.backColor=n.backColor,t.foreColor=n.foreColor,t.hAlign=n.hAlign,t.vAlign=n.vAlign,t.font=n.font,t.themeFont=n.themeFont,t.formatter=n.formatter,t._autoFormatter=n._autoFormatter,t.validator=n.validator,t.borderLeft=n.borderLeft,t.borderTop=n.borderTop,t.borderRight=n.borderRight,t.borderBottom=n.borderBottom,t.locked=n.locked,t.textIndent=n.textIndent,t.wordWrap=n.wordWrap,t.shrinkToFit=n.shrinkToFit,t.cellType=n.cellType,t.name=n.name,t.parentName=n.parentName},n.prototype._cloneLineBorder=function(n){return n&&n instanceof o?new o(n.color,n.style):n},n.prototype.compose=function(n,t){var r="undefined",i=this,u=i._cloneLineBorder;t?(i._autoFormatter=n._autoFormatter,i.backgroundImage=n.backgroundImage,i.backgroundIma
geLayout=n.backgroundImageLayout,i.backColor=n.backColor,i.foreColor=n.foreColor,i.hAlign=n.hAlign,i.vAlign=n.vAlign,i.font=n.font,i.themeFont=n.themeFont,i.formatter=n.formatter,i.borderLeft=u(n.borderLeft),i.borderTop=u(n.borderTop),i.borderRight=u(n.borderRight),i.borderBottom=u(n.borderBottom),i.locked=n.locked,i.textIndent=n.textIndent,i.wordWrap=n.wordWrap,i.shrinkToFit=n.shrinkToFit,i.validator=n.validator,i.cellType=n.cellType,i.parentName=n.parentName):(typeof i.backgroundImage===r&&(i.backgroundImage=n.backgroundImage),typeof i.backgroundImageLayout===r&&(i.backgroundImageLayout=n.backgroundImageLayout),typeof i.backColor===r&&(i.backColor=n.backColor),typeof i.foreColor===r&&(i.foreColor=n.foreColor),typeof i.hAlign===r&&(i.hAlign=n.hAlign),typeof i.vAlign===r&&(i.vAlign=n.vAlign),typeof i.font===r&&(i.font=n.font),typeof i.themeFont===r&&(i.themeFont=n.themeFont),typeof i.formatter===r&&(i.formatter=
n.formatter),typeof i.validator===r&&(i.validator=n.validator),typeof i._autoFormatter===r&&(i._autoFormatter=n._autoFormatter),typeof i.borderLeft===r&&(i.borderLeft=u(n.borderLeft)),typeof i.borderTop===r&&(i.borderTop=u(n.borderTop)),typeof i.borderRight===r&&(i.borderRight=u(n.borderRight)),typeof i.borderBottom===r&&(i.borderBottom=u(n.borderBottom)),typeof i.locked===r&&(i.locked=n.locked),typeof i.textIndent===r&&(i.textIndent=n.textIndent),typeof i.wordWrap===r&&(i.wordWrap=n.wordWrap),typeof i.shrinkToFit===r&&(i.shrinkToFit=n.shrinkToFit),typeof i.cellType===r&&(i.cellType=n.cellType),typeof i.parentName===r&&(i.parentName=n.parentName))},n.prototype.clear=function(n){if(arguments.length===0){this._initDefault();return}n==="dataValidator"&&(n="validator"),this[n]=undefined},n.prototype.clone=function(){var t=this,r=t._cloneLineBorder,i=new n(t.backCol
or,t.foreColor,t.hAlign,t.vAlign,t.font,t.themeFont,t.formatter,t.borderLeft?r(t.borderLeft):t.borderLeft,t.borderTop?r(t.borderTop):t.borderTop,t.borderRight?r(t.borderRight):t.borderRight,t.borderBottom?r(t.borderBottom):t.borderBottom,t.locked,t.textIndent,t.wordWrap,t.shrinkToFit,t.backgroundImage,t.cellType,t.backgroundImageLayout);return i.name=t.name,i.parentName=t.parentName,i._autoFormatter=t._autoFormatter,i.validator=t.validator,i},n.prototype._normalize=function(n){var i=this,t,f,u,r;if(n)if(n.getColor)for(t=i.foreColor,t&&(t=n.getColor(t),t&&(i.foreColor=t)),t=i.backColor,t&&(t=n.getColor(t),t&&(i.backColor=t)),f=[i.borderLeft,i.borderTop,i.borderRight,i.borderBottom],u=0;u<f.length;u++)r=f[u],r&&r.color&&(t=n.getColor(r.color),t&&(r.color=t));return i.themeFont&&n&&n.getFont&&(i.font=c.composeFont(i.font,n.getFont(i.themeFont))),i},n}(),t.Style=p,c=function(){function n(){}return n.compo
seFont=function(t,i){return i?n.normalizeFont(t,i):t},n.normalizeFont=function(t,r){var f,e,o,u,s;if(!t&&!r)return t;f=n,this.measureSpan||f._createMeasureSpan(),e=f.measureSpan;if(t){o=r?t+"+"+r:t,u=f._fontStringCatch[o];if(u)return u;i(e).css("font",t)}else{o=r,u=f._fontStringCatch[o];if(u)return u;i(e).css("fontSize","10pt")}return r&&i(e).css("fontFamily",r),s=e.currentStyle,document.defaultView&&document.defaultView.getComputedStyle&&(s=document.defaultView.getComputedStyle(e,"")),u=k(s),f._fontStringCatch[o]=u,f._fontStringCatch[u]=u,u},n._scaleFont=function(t,i,r){var o,u,h,f,e,s;return i===1?t:(o=n,o.measureSpan||o._createMeasureSpan(),u=o.measureSpan,u.style.font=t,h=u.currentStyle,document.defaultView&&document.defaultView.getComputedStyle&&(h=document.defaultView.getComputedStyle(u,"")),f=h.fontSize,e="px",f.indexOf(e)!==-1&&(s=Math.max(1
,Math.floor(parseFloat(f.replace(e,""))*i)),r&&s===1&&(r.value=!0),f=""+s+e),u.style.fontSize=f,u.style.font)},n._createMeasureSpan=function(){var n=document.createElement("span");n.style.visibility="hidden",n.style.top="-10000px",n.style.left="-10000px",document.body.insertBefore(n,null),this.measureSpan=n},n._fontStringCatch={},n}(),t.StyleHelper=c,rt=function(){function n(n,t,i,r){this._name=n,this._baseRow=i,this._baseColumn=r,this._expr=t}return n.prototype.getName=function(){return this._name},n.prototype.getRow=function(){return this._baseRow},n.prototype.getColumn=function(){return this._baseColumn},n.prototype.getExpression=function(){return this._expr},n}(),t.NameInfo=rt,ut=function(){function n(n,t,i,r,u){this._init(n,t,i,r,u)}return n.prototype._init=function(n,t,i,r,u){this._bounds=new l(n,t,i,r),this._name=u},n.prototype.getBounds=function(){return this._bounds},n.prototype.setBounds=function(n
){var t=this._bounds;t.x=n.x,t.y=n.y,t.width=n.width,t.height=n.height},n.prototype._draw=function(n){var u,t,r,i;if(!n)return;u=this,t=u._bounds,n.save(),r=n.createLinearGradient(t.x,t.y,t.x,t.y+40),r.addColorStop(0,"#00ABEB"),r.addColorStop(1,"#fff"),n.fillStyle=r,n.fillRect(t.x,t.y,t.width,t.height),i=u._name,i&&i.length>0&&(n.fillStyle="darkblue",n.font="20pt Arial",n.fillText(i,t.x+36,t.y+28)),n.strokeStyle="black",n.strokeRect(t.x,t.y,t.width,t.height),n.restore()},n.prototype.size=function(n,t){var i=this._bounds;i.width=n,i.height=t},n.prototype.move=function(n,t){var i=this._bounds;i.x=n,i.y=t},n}(),t.GcUIElement=ut,g=function(){function n(n){this._owner=n,n&&(this._currentTheme=n.currentTheme())}return n.prototype.owner=function(n){var t=this;return arguments.length===0?t._owner:(t._owner=n,t._owner&&(t._currentTheme=t._owner.currentTheme()),t)},n.prototype.getColor=function(n){if(this._cu
rrentTheme){var t=this._currentTheme.colors();if(t)return t.getColor(n)}return n},n.prototype.getFont=function(n){if(n){if(this._currentTheme){var t=n;if(t==="Body")return this._currentTheme.bodyFont();else if(t==="Headings")return this._currentTheme.headerFont()}return n}return null},n}(),t._ThemeContext=g,nt=function(){function n(n){var t=this;t.host=n,t.interval=null,t.action=null,t.intervalId=null,t.result=null,t.working=!1,t._needIncrease=!1}return n.prototype.setAction=function(n){typeof n=="function"&&(this.action=n)},n.prototype.setInterval=function(n){var t=this,i;isNaN(n)||n===0?t.stop():(t._needIncrease=n>0?!0:!1,n=Math.abs(n),i=t.interval,t.interval=n,i!==n&&t.start())},n.prototype.start=function(){var n=this;n.clear(),isNaN(n.interval)||(n.intervalId=setInterval(function(){n.run()},n.interval))},n.prototype.run=function(){var n=this;n.working=!0,typeof n.action=="function"&&(n.result=n.action.call(n.host
,n._needIncrease))},n.prototype.stop=function(){var n=this;n.clear(),n.interval=null,n.intervalId=null,n.result=null,n.working=!1},n.prototype.clear=function(){this.intervalId&&clearInterval(this.intervalId)},n.prototype._dispose=function(){this.stop()},n}(),t.Timer=nt,tt=function(){function n(){}return n.ValidationError="ValidationError",n.CellClick="CellClick",n.CellDoubleClick="CellDoubleClick",n.EnterCell="EnterCell",n.LeaveCell="LeaveCell",n.ValueChanged="ValueChanged",n.TopRowChanged="TopRowChanged",n.LeftColumnChanged="LeftColumnChanged",n.InvalidOperation="InvalidOperation",n.RangeFiltering="RangeFiltering",n.RangeFiltered="RangeFiltered",n.RangeSorting="RangeSorting",n.RangeSorted="RangeSorted",n.ClipboardChanging="ClipboardChanging",n.ClipboardChanged="ClipboardChanged",n.ClipboardPasting="ClipboardPasting",
n.ClipboardPasted="ClipboardPasted",n.ColumnWidthChanging="ColumnWidthChanging",n.ColumnWidthChanged="ColumnWidthChanged",n.RowHeightChanging="RowHeightChanging",n.RowHeightChanged="RowHeightChanged",n.DragDropBlock="DragDropBlock",n.DragDropBlockCompleted="DragDropBlockCompleted",n.DragFillBlock="DragFillBlock",n.DragFillBlockCompleted="DragFillBlockCompleted",n.EditStarting="EditStarting",n.EditChange="EditChange",n.EditEnd="EditEnd",n.RangeGroupStateChanging="RangeGroupStateChanging",n.RangeGroupStateChanged="RangeGroupStateChanged",n.SelectionChanging="SelectionChanging",n.SelectionChanged="SelectionChanged",n.SheetTabClick="SheetTabClick",n.SheetTabDoubleClick="SheetTabDoubleClick",n.UserZooming="UserZooming",n.UserFormulaEntered="UserFormulaEntered",n.CellChanged="CellChanged
",n.ColumnChanged="ColumnChanged",n.RowChanged="RowChanged",n.ActiveSheetChanging="ActiveSheetChanging",n.ActiveSheetChanged="ActiveSheetChanged",n.SparklineChanged="SparklineChanged",n.RangeChanged="RangeChanged",n.ButtonClicked="ButtonClicked",n.EditorStatusChanged="EditorStatusChanged",n.CultureChanged="SpreadJSCultureChanged",n}(),t.Events=tt,h=function(){function n(){return Array.apply(this,arguments),[]}return n.prototype.pop=function(){return null},n.prototype.push=function(n){return 0},n.prototype.splice=function(n,t){for(var r=[],i=0;i<arguments.length-2;i++)r[i]=arguments[i+2];return null},n}(),t._XArray=h,h.prototype=[]})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(n){n.feature("core.imageLoader",["core.common"]);var t=function(){function n(n){this._imageCount=0,this._loadedCount=0,this.onLoadedComplete=n}r
eturn n.prototype.addImage=function(n){var i,t,r;this._imgs||(this._imgs={}),i=this._imgs[n],i||(i={},t=$("<img/>"),r=this,t.bind("load",function(){r.imageLoaded(n)}),t.bind("error",function(){r.imageLoaded(n)}),t.bind("abort",function(){r.imageLoaded(n)}),this._imageCount++,i.state=!1,i.img=t,this._imgs[n]=i,t[0].src=n)},n.prototype.getImage=function(n){return this._imgs[n].img[0]},n.prototype.getState=function(n){return this._imgs?this._imgs[n]?this._imgs[n].state:!1:!1},n.prototype.imageLoaded=function(n){this._loadedCount++,this._imgs[n].state=!0,this._loadedCount<this._imageCount||this.onLoadedComplete&&this.onLoadedComplete()},n}();n._GcImageLoader=t})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(t){function h(n){return n.split("\u00a0").join(" ").toUpperCase()}function f(n){for(var r=[],t=0,i=n.length;t<i;t++)r[t]=h(n[t]);return r}function y(n,t,i){
var f=h(n),r=new u(t).indexOf(f);return r===-1&&(r=new u(i).indexOf(f)),r}function w(i){if(arguments.length===0)return t._currentCulture;if(!i)return;var r=i.toLowerCase();if(t._currentCulture!==r){switch(r){case"ja-jp":n.spread._StringResource=n.spread._JPStringResource;break;case"en-us":default:n.spread._StringResource=n.spread._ENStringResource;break}t._currentCulture=i,b(i)}}function b(t){$("div[gcUIElement='gcSpread']").trigger(n.spread.Events.CultureChanged,[{CultureInfo:t}])}var u,r,p,s,l,o,i,e,c,v;t.feature("core.globalize",["core.stringResource","core.migrate"]),u=function(){function n(n){this._array=n}return n.__insert=function(n,t,i){n.splice(t,0,i)},n.__add=function(n,t){n[n.length]=t},n.__indexOf=function(n,t,i){var u,r;if(typeof t=="undefined")return-1;u=n.length;if(u!==0)for(i=+i,isNaN(i)?i=0:(isFinite(i)&&(i=i-i%1),i<0&&(i=Math.max(0,u+i))),r=i;r<u;r++)if(typeof n[r]!=
"undefined"&&n[r]===t)return r;return-1},n.prototype.add=function(t){n.__add(this._array,t)},n.prototype.insert=function(t,i){n.__insert(this._array,t,i)},n.prototype.indexOf=function(t,i){return n.__indexOf(this._array,t,i)},n.prototype.array=function(n){return arguments.length===0?this._array:this._array=n},n}(),t._ArrayHelper=u,r=function(){function n(n){this._value={},this._len=0,this._init(n)}return n.prototype._init=function(n){this._parts=typeof n!="undefined"&&n!==null&&n!==""?[n.toString()]:[],this._value={},this._len=0},n.prototype._insert=function(n){this._parts.splice(0,0,n)},n.prototype.insert=function(n,t){var i,u,r;(t===undefined||t===null)&&(t=0);if(t===0){this._insert(n);return}i=this.toString();if(t>=i.length){this.append(n);return}u=i.substring(0,t),r=i.substr(t),this._init(u+n+r)},n.prototype.append=function(n){this._parts[this._parts.length]=n},n.prototype.appendLine=function(n){this._parts[this._p
arts.length]=typeof n=="undefined"||n===null||n===""?"\r\n":n+"\r\n"},n.prototype.clear=function(){this._init()},n.prototype.isEmpty=function(){return this._parts.length===0?!0:this.toString()===""},n.prototype.toString=function(n){var t,r,i;n=n||"",t=this._parts,this._len!==t.length&&(this._value={},this._len=t.length),r=this._value;if(typeof r[n]=="undefined"){if(n!=="")for(i=0;i<t.length;)typeof t[i]=="undefined"||t[i]===""||t[i]===null?t.splice(i,1):i++;r[n]=this._parts.join(n)}return r[n]},n}(),t._StringBuilder=r,p=function(){function n(n){this.strValue="",n&&(this.strValue=n)}return n.prototype.Append=function(n){n&&(this.strValue+=n.toString())},n.prototype.toString=function(){return this.strValue.toString()},n.prototype.Length=function(){return this.strValue.length},n.prototype.ToString=function(n,t){var r=this.toString(),i;return arguments
.length===0?r:i=r.substr(n,t)},n.prototype.Remove=function(n,t){var i=this.toString();this.strValue=c.Remove(i,n,t)},n}(),t.StringBuilder=p,s=function(){function n(n){this.CurrencyDecimalDigits=2,this.CurrencyDecimalSeparator=".",this.IsReadOnly=!0,this.CurrencyGroupSizes=[3],this.NumberGroupSizes=[3],this.PercentGroupSizes=[3],this.CurrencyGroupSeparator=",",this.CurrencySymbol="\u00a4",this.NaNSymbol="NaN",this.CurrencyNegativePattern=0,this.NumberNegativePattern=1,this.PercentPositivePattern=0,this.PercentNegativePattern=0,this.NegativeInfinitySymbol="-Infinity",this.NegativeSign="-",this.NumberDecimalDigits=2,this.NumberDecimalSeparator=".",this.NumberGroupSeparator=",",this.CurrencyPositivePattern=0,this.PositiveInfinitySymbol="Infinity",this.PositiveSign="+",this.PercentDecimalDigits=2,this.PercentDecimalSeparator=".",this.PercentGroupSeparator=",",this.Perce
ntSymbol="%",this.PerMilleSymbol="\u2030",this.NativeDigits=["0","1","2","3","4","5","6","7","8","9"],this.DigitSubstitution=1,n&&n.length>0&&(this.IsReadOnly=!1,this.CurrencySymbol="$")}return n}(),t._NumberFormatInfo=s,l=function(){function n(){this.MinSupportedDateTime="@-62135568000000@",this.MaxSupportedDateTime="@253402300799999@",this.AlgorithmType=1,this.CalendarType=1,this.Eras=[1],this.TwoDigitYearMax=2029,this.IsReadOnly=!0}return n}(),t._Calendar=l,o=function(){function n(n){this.AMDesignator="AM",this.Calendar=new l,this.DateSeparator="/",this.FirstDayOfWeek=0,this.CalendarWeekRule=0,this.FullDateTimePattern="dddd, dd MMMM yyyy HH:mm:ss",this.LongDatePattern="dddd, dd MMMM yyyy",this.LongTimePattern="HH:mm:ss",this.MonthDayPattern="MMMM dd",this
.PMDesignator="PM",this.RFC1123Pattern="ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",this.ShortDatePattern="MM/dd/yyyy",this.ShortTimePattern="HH:mm",this.SortableDateTimePattern="yyyy'-'MM'-'dd'T'HH':'mm':'ss",this.TimeSeparator=":",this.UniversalSortableDateTimePattern="yyyy'-'MM'-'dd HH':'mm':'ss'Z'",this.YearMonthPattern="yyyy MMMM",this.AbbreviatedDayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],this.ShortestDayNames=["Su","Mo","Tu","We","Th","Fr","Sa"],this.DayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],this.AbbreviatedMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","
;Sep","Oct","Nov","Dec",""],this.MonthNames=["January","February","March","April","May","June","July","August","September","October","November","December",""],this.IsReadOnly=!0,this.NativeCalendarName="Gregorian Calendar",this.AbbreviatedMonthGenitiveNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],this.MonthGenitiveNames=["January","February","March","April","May","June","July","August","September","October","November","December",""],n&&n.length>0&&(this.Calendar.IsReadOnly=!1,this.FullDateTi
mePattern="dddd, MMMM dd, yyyy h:mm:ss tt",this.LongDatePattern="dddd, MMMM dd, yyyy",this.LongTimePattern="h:mm:ss tt",this.ShortDatePattern="M/d/yyyy",this.ShortTimePattern="h:mm tt",this.YearMonthPattern="MMMM, yyyy",this.IsReadOnly=!1)}return n}(),t._DateTimeFormatInfo=o,i=function(){function n(n,t,i){this.eras=[1,"A.D.",null,0],this.name=n,this.numberFormat=t,this.dateTimeFormat=i}return n.prototype.Name=function(){return this.name},n.prototype.NumberFormat=function(){return this.numberFormat},n.prototype.DateTimeFormat=function(){return this.dateTimeFormat},n.prototype._getDateTimeFormats=function(){return this._dateTimeFormats||(this._dateTimeFormats=["yy/MM/dd","yy/MM/d","yy/M/dd","yy/M/d","yyyy/MM/dd","yyyy/MM/d","yyyy/M/dd","yyyy/M/d","MM/dd/yyyy","MM/d/yyyy","M/dd/yyyy","M/d/yyyy",&quo
t;hh:mm:ss","hh:mm:s","hh:m:ss","hh:m:s","h:mm:ss","h:mm:s","h:m:ss","h:m:s","hh:mm:ss tt","hh:mm:s tt","hh:m:ss tt","hh:m:s tt","h:mm:ss tt","h:mm:s tt","h:m:ss tt","h:m:s tt","hh:mm","hh:m","h:mm","h:m","yy/MM/dd hh:mm:ss","yy/MM/dd hh:mm:s","yy/MM/dd hh:m:ss","yy/MM/dd hh:m:s","yy/MM/dd h:mm:ss","yy/MM/dd h:mm:s","yy/MM/dd h:m:ss","yy/MM/dd h:m:s","yy/MM/dd hh:mm:ss tt","yy/MM/dd hh:mm:s tt","yy/MM/dd hh:m:ss tt","yy/MM/dd hh:m:s tt","yy/MM/dd h:mm:ss tt","yy/MM/dd h:mm:s tt","yy/MM/dd h:m:ss tt","yy/MM/dd h:m:s tt","yy/MM/d hh:mm:ss","yy/MM/d hh:mm:s","yy/MM/d hh:m:ss","yy/MM/d hh:m:s","
;yy/MM/d hh:mm:ss","yy/MM/d h:mm:s","yy/MM/d h:m:ss","yy/MM/d h:m:s","yy/MM/d hh:mm:ss tt","yy/MM/d hh:mm:s tt","yy/MM/d hh:m:ss tt","yy/MM/d hh:m:s tt","yy/MM/d h:mm:ss tt","yy/MM/d h:mm:s tt","yy/MM/d h:m:ss tt","yy/MM/d h:m:s tt","yy/M/dd hh:mm:ss","yy/M/dd hh:mm:s","yy/M/dd hh:m:ss","yy/M/dd hh:m:s","yy/M/dd hh:mm:ss","yy/M/dd h:mm:s","yy/M/dd h:m:ss","yy/M/dd h:m:s","yy/M/dd hh:mm:ss tt","yy/M/dd hh:mm:s tt","yy/M/dd hh:m:ss tt","yy/M/dd hh:m:s tt","yy/M/dd h:mm:ss tt","yy/M/dd h:mm:s tt","yy/M/dd h:m:ss tt","yy/M/dd h:m:s tt","yy/M/d hh:mm:ss","yy/M/d hh:mm:s","yy/M/d hh:m:ss","yy/M/d hh:m:s","yy/M/d hh:mm:ss","yy/M/d h:mm:s","yy/M/d h:m:ss&qu
ot;,"yy/M/d h:m:s","yy/M/d hh:mm:ss tt","yy/M/d hh:mm:s tt","yy/M/d hh:m:ss tt","yy/M/d hh:m:s tt","yy/M/d h:mm:ss tt","yy/M/d h:mm:s tt","yy/M/d h:m:ss tt","yy/M/d h:m:s tt","yyyy/MM/dd hh:mm:ss","yyyy/MM/dd hh:mm:s","yyyy/MM/dd hh:m:ss","yyyy/MM/dd hh:m:s","yyyy/MM/dd hh:mm:ss","yyyy/MM/dd h:mm:s","yyyy/MM/dd h:m:ss","yyyy/MM/dd h:m:s","yyyy/MM/dd hh:mm:ss tt","yyyy/MM/dd hh:mm:s tt","yyyy/MM/dd hh:m:ss tt","yyyy/MM/dd hh:m:s tt","yyyy/MM/dd h:mm:ss tt","yyyy/MM/dd h:mm:s tt","yyyy/MM/dd h:m:ss tt","yyyy/MM/dd h:m:s tt","yyyy/MM/d hh:mm:ss","yyyy/MM/d hh:mm:s","yyyy/MM/d hh:m:ss","yyyy/MM/d hh:m:s","yyyy/MM/d hh:mm:ss","yyyy/MM/d h:mm:s","yyyy/MM/d h:m:ss","yyyy
/MM/d h:m:s","yyyy/MM/d hh:mm:ss tt","yyyy/MM/d hh:mm:s tt","yyyy/MM/d hh:m:ss tt","yyyy/MM/d hh:m:s tt","yyyy/MM/d h:mm:ss tt","yyyy/MM/d h:mm:s tt","yyyy/MM/d h:m:ss tt","yyyy/MM/d h:m:s tt","yyyy/M/dd hh:mm:ss","yyyy/M/dd hh:mm:s","yyyy/M/dd hh:m:ss","yyyy/M/dd hh:m:s","yyyy/M/dd hh:mm:ss","yyyy/M/dd h:mm:s","yyyy/M/dd h:m:ss","yyyy/M/dd h:m:s","yyyy/M/dd hh:mm:ss tt","yyyy/M/dd hh:mm:s tt","yyyy/M/dd hh:m:ss tt","yyyy/M/dd hh:m:s tt","yyyy/M/dd h:mm:ss tt","yyyy/M/dd h:mm:s tt","yyyy/M/dd h:m:ss tt","yyyy/M/dd h:m:s tt","yyyy/M/d hh:mm:ss","yyyy/M/d hh:mm:s","yyyy/M/d hh:m:ss","yyyy/M/d hh:m:s","yyyy/M/d hh:mm:ss","yyyy/M/d h:mm:s","yyyy/M/d h:m:ss","yyyy/M/d h:m:s
","yyyy/M/d hh:mm:ss tt","yyyy/M/d hh:mm:s tt","yyyy/M/d hh:m:ss tt","yyyy/M/d hh:m:s tt","yyyy/M/d h:mm:ss tt","yyyy/M/d h:mm:s tt","yyyy/M/d h:m:ss tt","yyyy/M/d h:m:s tt","MM/dd/yyyy hh:mm:ss","MM/dd/yyyy hh:mm:s","MM/dd/yyyy hh:m:ss","MM/dd/yyyy hh:m:s","MM/dd/yyyy hh:mm:ss","MM/dd/yyyy h:mm:s","MM/dd/yyyy h:m:ss","MM/dd/yyyy h:m:s","MM/dd/yyyy hh:mm:ss tt","MM/dd/yyyy hh:mm:s tt","MM/dd/yyyy hh:m:ss tt","MM/dd/yyyy hh:m:s tt","MM/dd/yyyy h:mm:ss tt","MM/dd/yyyy h:mm:s tt","MM/dd/yyyy h:m:ss tt","MM/dd/yyyy h:m:s tt","MM/d/yyyy hh:mm:ss","MM/d/yyyy hh:mm:s","MM/d/yyyy hh:m:ss","MM/d/yyyy hh:m:s","MM/d/yyyy hh:mm:ss","MM/d/yyyy h:mm:s","MM/d/yyyy h:m:ss","MM/d/yyyy
h:m:s","MM/d/yyyy hh:mm:ss tt","MM/d/yyyy hh:mm:s tt","MM/d/yyyy hh:m:ss tt","MM/d/yyyy hh:m:s tt","MM/d/yyyy h:mm:ss tt","MM/d/yyyy h:mm:s tt","MM/d/yyyy h:m:ss tt","MM/d/yyyy h:m:s tt","M/dd/yyyy hh:mm:ss","M/dd/yyyy hh:mm:s","M/dd/yyyy hh:m:ss","M/dd/yyyy hh:m:s","M/dd/yyyy hh:mm:ss","M/dd/yyyy h:mm:s","M/dd/yyyy h:m:ss","M/dd/yyyy h:m:s","M/dd/yyyy hh:mm:ss tt","M/dd/yyyy hh:mm:s tt","M/dd/yyyy hh:m:ss tt","M/dd/yyyy hh:m:s tt","M/dd/yyyy h:mm:ss tt","M/dd/yyyy h:mm:s tt","M/dd/yyyy h:m:ss tt","M/dd/yyyy h:m:s tt","M/d/yyyy hh:mm:ss","M/d/yyyy hh:mm:s","M/d/yyyy hh:m:ss","M/d/yyyy hh:m:s","M/d/yyyy hh:mm:ss","M/d/yyyy h:mm:s","M/d/yyyy h:m:ss","M/d/yyyy h:m:s"
,"M/d/yyyy hh:mm:ss tt","M/d/yyyy hh:mm:s tt","M/d/yyyy hh:m:ss tt","M/d/yyyy hh:m:s tt","M/d/yyyy h:mm:ss tt","M/d/yyyy h:mm:s tt","M/d/yyyy h:m:ss tt","M/d/yyyy h:m:s tt"]),this._dateTimeFormats},n.prototype._getMonthIndex=function(n){return this._upperMonths||(this._upperMonths=f(this.dateTimeFormat.MonthNames),this._upperMonthsGenitive=f(this.dateTimeFormat.MonthGenitiveNames)),y(n,this._upperMonths,this._upperMonthsGenitive)},n.prototype._getAbbrMonthIndex=function(n){return this._upperAbbrMonths||(this._upperAbbrMonths=f(this.dateTimeFormat.AbbreviatedMonthNames),this._upperAbbrMonthsGenitive=f(this.dateTimeFormat.AbbreviatedMonthGenitiveNames)),y(n,this._upperAbbrMonths,this._upperAbbrMonthsGenitive)},n.prototype._getDayIndex=function(n){return this._upperDays||(this._upperDays=f(this.dateTimeFormat.DayNames)),new u(this._upperDays).indexOf(h(n))},n.prototype._getAbbrDayIndex=function(n){return th
is._upperAbbrDays||(this._upperAbbrDays=f(this.dateTimeFormat.AbbreviatedDayNames)),new u(this._upperAbbrDays).indexOf(h(n))},n._parseCulture=function(t){var i=t.dateTimeFormat;return i&&!i.eras&&(i.eras=t.eras),new n(t.name,t.numberFormat,i)},n.prototype._parse=function(t){return n._parseCulture(t)},n.invariantCulture=new n("",new s(""),new o("")),n.currentCulture=new n("en-US",new s("en-US"),new o("en-US")),n}(),t._CultureInfo=i,e=function(){function n(n){this._str=n}return n.__toFormattedString=function(n,i){for(var e="",o=i[0],s,f,h,u,r=0;;){s=o.indexOf("{",r),f=o.indexOf("}",r);if(s<0&&f<0){e+=o.slice(r);break}if(f>0&&(f<s||s<0)){if(o.charAt(f+1)!=="}")throw new Error(t._StringResource.Exp_BraceMismatch);e+=o.slice(r,f+1),r=f+2;continue}e+=o.slice(r,s),r=s+1;if(o.charAt(r)==="{"){e+="{",r++;continue}if(f<0)thro
w new Error(t._StringResource.Exp_BraceMismatch);var c=o.substring(r,f),l=c.indexOf(":"),a=parseInt(l<0?c:c.substring(0,l),10)+1;if(isNaN(a))throw new Error(t._StringResource.Exp_InvalidFormat);h=l<0?"":c.substring(l+1),u=i[a],(typeof u=="undefined"||u===null)&&(u=""),e+=u.toFormattedString?u.toFormattedString(h):n&&u.localeFormat?u.localeFormat(h):u.format?u.format(h):u.toString(),r=f+1}return e},n.prototype.startsWith=function(n){return this._str.substr(0,n.length)===n},n.prototype.endsWith=function(n){return this._str.indexOf(n,this._str.length-n.length)!==-1},n.prototype.trim=function(){return this._str.replace(/^\s+|\s+$/g,"")},n.prototype.trimEnd=function(){return this._str.replace(/\s+$/,"")},n.prototype.trimStart=function(){return this._str.replace(/^\s+/,"")},n.prototype.format=function(t,i){var u=[],r;for(u.push(t),r=0;r<i.length;r++)u.push(i[r]);return n.__toFormattedString(!1,u
)},n}(),t._StringHelper=e,c=function(){function n(){}return n.Contains=function(n,t){return t===""||n.indexOf(t)>=0},n.IndexOf=function(n,i,r){if(r)if(r===t.StringComparison.CurrentCultureIgnoreCase){var f=n.toLowerCase(),u=i.toLowerCase();return f.indexOf(u)}else return n.indexOf(i);else return n.indexOf(i)},n.TrimStart=function(n,t){if(!t)return n;for(var i=n;;){if(i.substr(0,t.length)!==t)break;i=i.substr(t.length)}return i},n.TrimEnd=function(n,t){if(!t)return n;for(var i=n;;){if(i.substr(i.length-t.length,t.length)!==t)break;i=i.substr(0,i.length-t.length)}return i},n.Trim=function(t,i){var r=i;return i||(r=" "),t=n.TrimStart(t,r),t=n.TrimEnd(t,r)},n.Insert=function(n,t,i){if(t<0||t>n.length||i===null||i===undefined)throw new Error;var u=n.substr(0,t),r=n.substr(t,n.length-t);return u+i+r},n.Remove=function(n,t,i){(i===undefined||i===null)&&(i=n.length-t);if(t<0||i<0||t+i>n.length)throw new Error;var u=n.substr(0,t),r=n.substr(t+i,n
.length-t-i);return u+r},n.StartsWith=function(n,i,r){if(!i)throw new Error;if(i==="")return!0;if(i.length>n.length)return!1;var f=n,u=i;return r===t.StringComparison.CurrentCultureIgnoreCase&&(f=f.toLowerCase(),u=u.toLowerCase()),f.search(new RegExp("^"+u))>-1},n.EndsWith=function(n,i,r){if(!i)throw new Error;if(i==="")return!0;if(i.length>n.length)return!1;var f=n,u=i;return r===t.StringComparison.CurrentCultureIgnoreCase&&(f=f.toLowerCase(),u=u.toLowerCase()),f.search(new RegExp(u+"$"))>-1},n.Replace=function(n,t,i){if(!t||t==="")throw new Error;var r=new RegExp(t,"g");return n.replace(r,i)},n}(),t.StringHelper=c,v=function(){function n(n){this._date=n}return n.prototype.Hour=function(){return this._date.getHours()},n.prototype.Minute=function(){return this._date.getMinutes()},n.prototype.Second=function(){return this._date.getSeconds()},n.prototype.Millisecond=function(){return this._date.get
Milliseconds()},n.prototype.TotalDays=function(){return Math.floor(this.toOADate())},n.prototype.toOADate=function(){return n.___toOADate(this._date)},n.prototype.format=function(n){return this._toFormattedString(n,i.invariantCulture)},n.prototype.localeFormat=function(n){return this._toFormattedString(n,i.currentCulture)},n.prototype._toFormattedString=function(i,u){function g(){return c||k?c:(c=nt.test(i),k=!0,c)}function h(n,t){if(s)return s[t];switch(t){case 0:return n.getFullYear();case 1:return n.getMonth();case 2:return n.getDate()}}var e=u.DateTimeFormat(),w=e.Calendar.convert,p,d,a,v,f,o,c,k,nt,b,y,s;if(!i||!i.length||i==="i")return u&&u.Name().length?w?this._toFormattedString(e.FullDateTimePattern,u):(p=new Date(this._date.getTime()),d=n.__getEra(this._date,e.eras),p.setFullYear(n.__getEraYear(this._date,e,d)),p.toLocaleString()):this._date.toString();for(a=e.eras,v=i==="s",i=n.__expandFormat(e,i),f=new r,nt=/([^d]|^)(d|dd)([^d]|$)/g,b=0,y=n.__g
etTokenRegExp(),!v&&w&&(s=w.fromGregorian(this._date));;){var it=y.lastIndex,l=y.exec(i),tt=i.slice(it,l?l.index:i.length);b+=n.__appendPreOrPostMatch(tt,f);if(!l)break;if(b%2==1){f.append(l[0]);continue}switch(l[0]){case"dddd":f.append(e.DayNames[this._date.getDay()]);break;case"ddd":f.append(e.AbbreviatedDayNames[this._date.getDay()]);break;case"dd":c=!0,f.append(n.___addLeadingZero(h(this._date,2)));break;case"d":c=!0,f.append(h(this._date,2));break;case"MMMM":f.append(e.MonthGenitiveNames&&g()?e.MonthGenitiveNames[h(this._date,1)]:e.MonthNames[h(this._date,1)]);break;case"MMM":f.append(e.AbbreviatedMonthGenitiveNames&&g()?e.AbbreviatedMonthGenitiveNames[h(this._date,1)]:e.AbbreviatedMonthNames[h(this._date,1)]);break;case"MM":f.append(n.___addLeadingZero(h(this._date,1)+1));break;case"M":f.append(h(this._date,1)+1);break;case"yyyy":case"yyy":f.appen
d(n.___padYear(s?s[0]:n.__getEraYear(this._date,e,n.__getEra(this._date,a),v)));break;case"yy":f.append(n.___addLeadingZero((s?s[0]:n.__getEraYear(this._date,e,n.__getEra(this._date,a),v))%100));break;case"y":f.append(((s?s[0]:n.__getEraYear(this._date,e,n.__getEra(this._date,a),v))%100).toString());break;case"hh":o=this._date.getHours()%12,o===0&&(o=12),f.append(n.___addLeadingZero(o));break;case"h":o=this._date.getHours()%12,o===0&&(o=12),f.append(o);break;case"HH":f.append(n.___addLeadingZero(this._date.getHours()));break;case"H":f.append(this._date.getHours().toString());break;case"mm":f.append(n.___addLeadingZero(this._date.getMinutes()));break;case"m":f.append(this._date.getMinutes().toString());break;case"ss":f.append(n.___addLeadingZero(this._date.getSeconds()));break;case"s":f.append(this._date.getSeconds().toString());break;case"tt":f.append(this._d
ate.getHours()<12?e.AMDesignator:e.PMDesignator);break;case"t":f.append((this._date.getHours()<12?e.AMDesignator:e.PMDesignator).charAt(0));break;case"f":f.append(n.___addLeadingZeros(this._date.getMilliseconds()).charAt(0));break;case"ff":f.append(n.___addLeadingZeros(this._date.getMilliseconds()).substr(0,2));break;case"fff":f.append(n.___addLeadingZeros(this._date.getMilliseconds()));break;case"z":o=this._date.getTimezoneOffset()/60,f.append((o<=0?"+":"-")+Math.floor(Math.abs(o)));break;case"zz":o=this._date.getTimezoneOffset()/60,f.append((o<=0?"+":"-")+n.___addLeadingZero(Math.floor(Math.abs(o))));break;case"zzz":o=this._date.getTimezoneOffset()/60,f.append((o<=0?"+":"-")+n.___addLeadingZero(Math.floor(Math.abs(o)))+":"+n.___addLeadingZero(Math.abs(this._date.getTimezoneOffset()%60)));break;case"g":case"gg"
;:e.eras&&f.append(e.eras[n.__getEra(this._date,a)+1]);break;case"/":f.append(e.DateSeparator);break;case"[h]":f.append("[h]");break;case"[mm]":f.append("[mm]");break;case"[ss]":f.append("[ss]");break;default:throw new Error(t._StringResource.Exp_InvalidDateFormat);}}return f.toString()},n.parseLocale=function(t,r){var u;return u=r?[t,r]:[t],n._parseDate(t,i.currentCulture,u)},n.parseInvariant=function(t,r){return n._parseDate(t,i.invariantCulture,[t,r])},n.__appendPreOrPostMatch=function(n,t){for(var f=0,i=!1,u,r=0,e=n.length;r<e;r++){u=n.charAt(r);switch(u){case"'":case'"':i?t.append("'"):f++,i=!1;break;case"\\":i&&t.append("\\"),i=!i;break;default:t.append(u),i=!1;break}}return f},n.__expandFormat=function(n,i){i||(i="F");var r=i.length;if(r===1)switch(i){case"d":return n.ShortDatePattern;case"D":return n.LongDatePatte
rn;case"t":return n.ShortTimePattern;case"T":return n.LongTimePattern;case"f":return n.LongDatePattern+" "+n.ShortTimePattern;case"F":return n.FullDateTimePattern;case"M":case"m":return n.MonthDayPattern;case"s":return n.SortableDateTimePattern;case"Y":case"y":return n.YearMonthPattern;case"g":return n.ShortDatePattern+" "+n.ShortTimePattern;case"G":return n.ShortDatePattern+" "+n.LongTimePattern;case"R":case"r":return n.RFC1123Pattern;case"u":return n.UniversalSortableDateTimePattern;case"U":return n.FullDateTimePattern;case"o":case"O":return"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffff";default:throw new Error(t._StringResource.Exp_InvalidString);}else r===2&&i.charAt(0)==="%"&&(i=i.charAt(1));return i},n.__getEra=function(n,t){var r,f,i,u;if(!t)return 0
;for(f=n.getTime(),i=0,u=t.length;i<u;i+=4){r=t[i+2];if(r===null||f>=r)return i}return 0},n.__getEraYear=function(n,t,i,r){var u=n.getFullYear();return!r&&t.eras&&(u-=t.eras[i+3]),u},n.__expandYear=function(t,i){var u=new Date,f=n.__getEra(u),r;return i<100&&(r=n.__getEraYear(u,t,f),i+=r-r%100,i>t.Calendar.TwoDigitYearMax&&(i-=100)),i},n.__getTokenRegExp=function(){return/\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g|\[h\]|\[mm\]|\[ss\]/g},n.__getParseRegExp=function(i,f){var o,v,l,h;if(i._parseRegExp){if(i._parseRegExp[f])return i._parseRegExp[f]}else i._parseRegExp={};o=n.__expandFormat(i,f),o=o.replace("%M","M"),o=o.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");var e=new r("^"),a=new u([]),c=0,p=0,y=n.__getTokenRegExp(),s;while((s=y.exec(o))!==null){v=o.slice(c,s.index),c=y.lastIndex,p+=n.__appendPreOrPostMatch(v,e);if(p%2==1){e.append(s[0]);con
tinue}switch(s[0]){case"dddd":case"ddd":case"MMMM":case"MMM":case"gg":case"g":e.append("(\\D+)");break;case"tt":case"t":e.append("(\\D*)");break;case"yyyy":e.append("(\\d{4})");break;case"fff":e.append("(\\d{3})");break;case"ff":e.append("(\\d{2})");break;case"f":e.append("(\\d)");break;case"dd":case"d":case"MM":case"M":case"yy":case"y":case"HH":case"H":case"hh":case"h":case"mm":case"m":case"ss":case"s":e.append("(\\d\\d?)");break;case"zzz":e.append("([+-]?\\d\\d?:\\d{2})");break;case"zz":case"z":e.append("([+-]?\\d\\d?)");break;case"/":e.append("(\\"+i.DateSeparator+")");break;de
fault:throw new Error(t._StringResource.Exp_InvalidDateFormat);}a.add(s[0])}return n.__appendPreOrPostMatch(o.slice(c),e),e.append("$"),l=e.toString().replace(/\s+/g,"\\s+"),h={regExp:l,groups:a.array()},i._parseRegExp[f]=h,h},n._parseDateExact=function(t,i,r){var nt,at,u,st,it,b,k,d,vt,f,g,p,ft;t=$.trim(t);var c=r.DateTimeFormat(),lt=n.__getParseRegExp(c,i),ht=new RegExp(lt.regExp).exec(t);if(ht===null)return null;var ct=lt.groups,et=null,s=null,o=null,y=null,l=null,w=0,a,tt=0,ut=0,h=0,rt=null,ot=!1,v=!0;for(nt=0,at=ct.length;nt<at;nt++){u=ht[nt+1];if(u)switch(ct[nt]){case"dd":case"d":v=!1,y=parseInt(u,10);if(y<1||y>31)return null;break;case"MMMM":v=!1,o=r._getMonthIndex(u);if(o<0||o>11)return null;break;case"MMM":v=!1,o=r._getAbbrMonthIndex(u);if(o<0||o>11)return null;break;case"M":case"MM":case"%M":v=!1,o=parseInt(u,10)-1;if(o<0||o>11)return null;break;case"y&
quot;:case"yy":v=!1,s=n.__expandYear(c,parseInt(u,10));if(s<0||s>9999)return null;break;case"yyyy":v=!1,s=parseInt(u,10);if(s<0||s>9999)return null;break;case"h":case"hh":case"H":case"HH":w=parseInt(u,10);if(w<0||w>23)return null;break;case"m":case"mm":tt=parseInt(u,10);if(tt<0||tt>59)return null;break;case"s":case"ss":ut=parseInt(u,10);if(ut<0||ut>59)return null;break;case"tt":case"t":st=u.toUpperCase(),ot=st===c.PMDesignator.toUpperCase();if(!ot&&st!==c.AMDesignator.toUpperCase())return null;break;case"f":h=parseInt(u,10)*100;if(h<0||h>999)return null;break;case"ff":h=parseInt(u,10)*10;if(h<0||h>999)return null;break;case"fff":h=parseInt(u,10);if(h<0||h>999)return null;break;case"dddd":v=!1,l=r._getDayIndex(u);if(l<0||l>6)return null;break;case"ddd":v=!
1,l=r._getAbbrDayIndex(u);if(l<0||l>6)return null;break;case"zzz":it=u.split(/:/);if(it.length!==2)return null;a=parseInt(it[0],10);if(a<-12||a>13)return null;b=parseInt(it[1],10);if(b<0||b>59)return null;rt=a*60+(new e(u).startsWith("-")?-b:b);break;case"z":case"zz":a=parseInt(u,10);if(a<-12||a>13)return null;rt=a*60;break;case"g":case"gg":k=u;if(!k||!c.eras)return null;for(k=k.toLowerCase().trim(),d=0,vt=c.eras.length;d<vt;d+=4)if(k===c.eras[d+1].toLowerCase()){et=d;break}if(et===null)return null;break}}f=new Date,p=c.Calendar.convert,p&&(g=p.fromGregorian(f)),p||(g=[f.getFullYear(),f.getMonth(),f.getDate()]),s===null?s=g[0]:c.eras&&(s+=c.eras[(et||0)+3]),o===null&&(o=g[1]),y===null&&(y=g[2]);if(p){f=p.toGregorian(s,o,y);if(f===null)return null}else{f.setFullYear(s,o,y);if(f.getDate()!==y)return null;if(l!==null&&f.getDay()!==l)return null}return ot&&a
mp;w<12&&(w+=12),f.setHours(w,tt,ut,h),rt!==null&&(ft=f.getMinutes()-(rt+f.getTimezoneOffset()),f.setHours(f.getHours()+ft/60,ft%60)),f},n.___addLeadingZero=function(n){return n<10?"0"+n:n.toString()},n.___addLeadingZeros=function(n){return n<10?"00"+n:n<100?"0"+n:n.toString()},n.___padYear=function(n){return n<10?"000"+n:n<100?"00"+n:n<1e3?"0"+n:n.toString()},n._parseDate=function(t,i,r){for(var f,s,o,h=!1,u=1,e=r.length;u<e;u++){s=r[u];if(s){h=!0,f=n._parseDateExact(t,s,i);if(f)return f}}if(!h)for(o=i._getDateTimeFormats(),u=0,e=o.length;u<e;u++){f=n._parseDateExact(t,o[u],i);if(f)return f}return null},n.___toOADate=function(t){return t===undefined||t===null?0:(typeof t=="number"&&(t=new Date(t)),(t-n.___oaZeroDate)/n.___oneDayMillSeconds)},n._fromOADate=function(t){var i=new Date(n.___oaZeroDate);return i.setMilliseconds(t*n.___oneDayMillSeconds),i},n.parseExac
t=n._parseDateExact,n.fromOADate=n._fromOADate,n.___oaZeroDate=new Date(1899,11,30),n.___oaUTCZeroDate=new Date(Date.UTC(1899,11,30)),n.___oneDayMillSeconds=864e5,n.___oneMinuteMillSeconds=6e4,n}(),t._DateTimeHelper=v;var k=function(){function n(n,t,i){this.normal=n,this.negative=t,this.zero=i}return n}(),a=function(){function n(){this.intPart=null,this.decPart=null,this.group=!1,this.scale=0,this.percent=0,this.permile=0,this.exponent=null}return n}(),d=function(){function n(n){this._num=n}return n.prototype.format=function(n){return this._toFormattedString(n,i.invariantCulture)},n.prototype.localeFormat=function(n){return this._toFormattedString(n,i.currentCulture)},n.prototype._toFormattedString=function(t,i){return!t||t.length===0||t==="i"?i&&i.Name().length>0?this._num.toLocaleString():this._num.toString():n.__getStandardTokenRegExp().test(t)?this._toStandardFormattedString(t,i.NumberFormat()):this._toCustomFormattedString(t,i.NumberFormat())},n.prototype._
toStandardFormattedString=function(i,r){var e=Math.abs(this._num).toString(),u,f,o,c,l,s,a,h;i||(i="D"),u=-1,i.length>1&&(u=parseInt(i.slice(1),10));switch(i.charAt(0)){case"d":case"D":f="n",u!==-1&&(e=n.___zeroPad(""+e,u,!0)),this._num<0&&(e="-"+e);break;case"c":case"C":f=this._num<0?n.___currencyNegativePattern[r.CurrencyNegativePattern]:n.___currencyPositivePattern[r.CurrencyPositivePattern],u===-1&&(u=r.CurrencyDecimalDigits),e=n.___expandNumber(Math.abs(this._num),u,r.CurrencyGroupSizes,r.CurrencyGroupSeparator,r.CurrencyDecimalSeparator,r.NegativeSign);break;case"n":case"N":f=this._num<0?n.___numberNegativePattern[r.NumberNegativePattern]:"n",u===-1&&(u=r.NumberDecimalDigits),e=n.___expandNumber(Math.abs(this._num),u,r.NumberGroupSizes,r.NumberGroupSeparator,r.NumberDecimalSeparator,r.NegativeSign);break;case"p&q
uot;:case"P":f=this._num<0?n.___percentNegativePattern[r.PercentNegativePattern]:n.___percentPositivePattern[r.PercentPositivePattern],u===-1&&(u=r.PercentDecimalDigits),e=n.___expandNumber(Math.abs(this._num)*100,u,r.PercentGroupSizes,r.PercentGroupSeparator,r.PercentDecimalSeparator,r.NegativeSign);break;case"F":case"f":o=this._toFixedPoint(e,f,i,u,r),e=o[0],f=o[1];break;case"e":case"E":o=this._toScientificNotation(e,f,i,u,r),e=o[0],f=o[1];break;case"x":case"X":f="n",e=n.___toHexString(this._num,i.charAt(0)==="x",u===-1?0:u);break;case"g":case"G":c=this._num.toString(),o=[],o=c.indexOf("e")===-1&&c.indexOf("E")===-1?this._toFixedPoint(e,f,i,u,r):this._toScientificNotation(e,f,i.replace("g","e").replace("G","E"),u,r),e=o[0],f=o[1];break;default:throw new Error(t._StringResource.Exp_BadFormatSpeci
fier);}for(l=/n|\$|-|%/g,s="";;){a=l.lastIndex,h=l.exec(f),s+=f.slice(a,h?h.index:f.length);if(!h)break;switch(h[0]){case"n":s+=e;break;case"$":s+=r.CurrencySymbol;break;case"-":/[1-9]/.test(e)&&(s+=r.NegativeSign);break;case"%":s+=r.PercentSymbol;break;default:throw new Error(t._StringResource.Exp_InvalidNumberFormat);}}return s},n.prototype._toScientificNotation=function(t,i,r,u,f){return i="n",t=n.___toScientific(Math.abs(this._num),r.charAt(0),u===-1?6:u,f.NumberGroupSizes,f.NumberGroupSeparator,f.NumberDecimalSeparator,f.NegativeSign),this._num<0&&(t="-"+t),[t,i]},n.prototype._toFixedPoint=function(t,i,r,u,f){i=this._num<0?n.___numberNegativePattern[f.NumberNegativePattern]:"n",u===-1&&(u=2);var o=parseFloat(t),e=Math.floor(o),s=o-e;return t=n.___expandNumber(s,u,f.NumberGroupSizes,f.NumberGroupSeparator,f.NumberDecimalSeparator,f.NegativeSign),t=""+e+t.substr
ing(1),[t,i]},n.prototype._toCustomFormattedString=function(t,i){var f=n.___parseCustomNumberFormatter(t),u=null,r;return this._num===0?u=f.zero:this._num<0&&(u=f.negative),u||(u=f.normal),r=n.___formatNumber(this._num,u,i)+"",r.indexOf(i.NegativeSign)===1&&r.indexOf(i.CurrencySymbol)===0&&(r=r[1]+r[0]+r.substring(2)),r},n.parseLocale=function(t){return n.__parseNumber(t,i.currentCulture)},n.parseInvariant=function(t){return n.__parseNumber(t,i.invariantCulture)},n.__getStandardTokenRegExp=function(){return/^(C|c|D|d|E|e|F|f|G|g|N|n|P|p|R|r|X|x)(\d*)$/g},n.___getDigitLength=function(n,t){var e=Math.floor(Math.abs(n)),f={integer:1,decimal:0},h;while(e>=10)e=e/10,f.integer++;var r=n.toString(),o=r.search(/e/ig),u=r.indexOf(t),i;if(o!==-1){var c=r.substr(0,o),l=r.substr(o+1),s=0;u!==-1&&(s=c.substr(u+1).length),h=parseFloat(l),i=s-h,i<0&&(i=0),f.decimal=i}else i=0,u!==-1&&(i=r.substr(u+1).length),f.decimal=i;return f},n
.___parseExponentFormat=function(n){for(var r={symbol:n.charAt(0),sign:0,exp:0},u="",i=1;i<n.length;i++){u=n.charAt(i);if(u==="+")r.sign=1;else if(u==="-")r.sign=-1;else if(u==="0"){r.exp=n.length-i;break}else throw new Error(t._StringResource.Exp_InvalidExponentFormat);}return r},n.___parseCustomNumberFormatter=function(i){for(var h=null,c=null,v=null,e=new a,r="",it=!1,rt=!1,ut=!1,l=!1,p=!1,y=!1,nt=!1,g=!1,u=null,o=null,f=[],tt,d,b,s,w=0;w<i.length;w++){u=i.charAt(w);if(it){u!=="'"?r+=u:(f.push(r),r="",it=!1),o=u;continue}else if(rt){u!=='"'?r+=u:(f.push(r),r="",rt=!1),o=u;continue}else if(ut){f.push(r+u),r="",o=u;continue}else if(l){if(o==="E"||o==="e")if(u==="+"||u==="-"||u==="0"){r+=u;continue}else l=!1;else if(o==="+"||o==="-")if(u==="0"){r+=u;continue}else l=!1,f.push(r),r="";else if(o===
"0")if(u==="0"){r+=u;continue}else l=!1,nt||(nt=!0,e.exponent=n.___parseExponentFormat(r)),f.push(r),r=""}else if(u==="0"||u==="#"){g=!0;if(o==="0"||o==="#"){r+=u,o=u;continue}else r!==""&&(f.push(r),r="")}else(o==="0"||o==="#")&&u!=="0"&&u!=="#"&&(f.push(r),r="");if(u===";"){r!==""&&(l&&!nt&&(e.exponent=n.___parseExponentFormat(r)),f.push(r),r=""),p?e.decPart=u:e.intPart=f,f=[];if(h===undefined||h===null)h=e;else if(c===undefined||c===null)c=e;else if(v===undefined||v===null)v=e;else throw new Error(t._StringResource.Exp_InvalidSemicolons);p=!1,g=!1,y&&(e.group=!0,y=!1),e=new a}else if(u===".")r!==""&&(f.push(r),r=""),e.intPart=f,f=[],p=!0,g=!1,y&&(e.group=!0,y=!1);else if(u==="'")it=!0;else if(u=
=='"')rt=!0;else if(u==="%")e.percent++,f.push(u);else if(u==="\u2030")e.permile++,f.push(u);else if(u==="0"||u==="#")r+=u;else if(u===",")if(p)r!==""&&(f.push(r),r="");else{r!==""&&(f.push(r),r="");if(!g)continue;for(tt=!0,d="",b=w+1;b<i.length;b++){s=i.charAt(b);if(d!==""){(s==="'"||s==='"')&&(d="");continue}if(s==="'"||s==='"')d=s;else if(s==="0"||s==="#"){tt=!1;break}else if(s==="."||s===";")break}tt?e.scale++:y=!0}else u==="E"||u==="e"?(l=!0,r!==""&&f.push(r),r=u):r+=u;o=u}return r!==""&&(l&&!nt&&(e.exponent=n.___parseExponentFormat(r)),f.push(r)),y&&(e.group=!0),p?e.decPart=f:e.intPart=f,h===undefined||h===null?h=e:c===undefined||c===null?c=e:(v===undefined||v===null)&&(v=
e),new k(h,c,v)},n.___zeroPad=function(n,t,i){for(var r=n.length;r<t;r++)n=i?"0"+n:n+"0";return n},n.__insertGroupSeparator=function(n,i,u,f){var o=i[0],c=1,e=n.length-1,l=new r(""),s=0,h=!1;while(e>=0){if(o<1||o>9)throw new Error(t._StringResource.Exp_InvalidNumberGroupSize);/\d/ig.test(n[e])&&(h&&(l.insert(u,0),h=!1),s++),l.insert(n[e],0),s===o&&(h=!0,s=0,c<i.length&&(o=i[c],c++)),e--}return l.toString()},n.___expandNumber=function(t,i,r,u,f,e,o){var v=Math.pow(10,i),a=Math.round(t*v)/v,h,s,c,l;return isFinite(a)||(a=t),t=a,h=t.toString(),l=h.split(/e/i),h=l[0],c=l.length>1?parseInt(l[1],10):0,l=h.split("."),h=l[0],s=l.length>1?l[1]:"",c>0?(s=n.___zeroPad(s,c,!1),h+=s.slice(0,c),s=s.substr(c)):c<0&&(c=-c,h=t<0?e+n.___zeroPad(h.replace(e,""),c+1,!0):n.___zeroPad(h,c+1,!0),s=h.slice(-c,h.length)+s,h=h.slice(0,-c)),i>0?(s=s.length>i?s.slice(0,i):n.__
_zeroPad(s,i,!1),s=f+s):s="",o===!0?h+s:n.__insertGroupSeparator(h,r,u,e)+s},n.___formatNumber=function(t,i,u){var f=new r(""),s,e,o,y,k,a,b,v,h,d,c,nt,p,vt,ut,et,g,ft,l,ct,tt,ot,yt,it,pt,ht,st,at;t=t*Math.pow(100,i.percent),t=t*Math.pow(1e3,i.permile),t=t/Math.pow(10,i.scale*3),s=i.intPart,e=i.decPart;if(!s&&!e)return"";o=null,y=null;if(s)for(o="",k=0;k<s.length;k++)a=s[k],/^(0|#)+/g.test(a)&&(o+=a);if(e)for(y="",b=0;b<e.length;b++)v=e[b],/^(0|#)+/g.test(v)&&(y+=v);if(o||y)y||(y="");else return(s?s.join(""):"")+(e?e.join(""):"");d=0,c=n.___getDigitLength(t,u.NumberDecimalSeparator);if(i.exponent){nt=Math.abs(t),p=o?o.length:1;if(nt<1){if(nt<1&&nt>0){i.exponent.sign=-1,c.integer=p,c.decimal-=p,vt=Math.pow(10,p);while(nt*10<vt)nt*=10,d++;t*=Math.pow(10,d)}}else c.integer>p?(c.integer-=p,c.decimal+=p,t=t/Math.pow(10,c.integer),d=c.int
eger):d=c.integer<p?0:0,i.exponent.sign===-1&&(i.exponent.sign=0)}ut=y.lastIndexOf("0"),et=c.decimal,ut<0||(et=ut+1),e||(et=0),g=n.___expandNumber(t,et,u.NumberGroupSizes,u.NumberGroupSeparator,u.NumberDecimalSeparator,u.NegativeSign,!0);if(g==="")return(s?s.join(""):"")+(e?e.join(""):"");ft=!1;if(s){l=g.split(u.NumberDecimalSeparator)[0],ct=l.substr(0,1),ct===u.NegativeSign&&(l=l.substr(1));var w=0,lt="",rt=o.indexOf("0"),wt=rt===-1?l.length:o.length-rt;for(k=s.length-1;k>=0;k--){a=s[k];if(/^(0|#)+/g.test(a)){lt=a+lt;if(lt!==o){for(tt=a.length,ot=l.length-w-1;ot>=0&&tt>0;ot--)yt=l.charAt(ot),f._insert(yt),tt--,w++;w>=l.length&&w<wt&&tt>0&&(f._insert(new Array(tt+1).join("0")),w+=tt)}else it=l.substr(0,l.length-w),rt>=0&&rt<o.length-w-it.length&&(it=new Array(o.length-w-rt-it.length+1).join("0&quo
t;)+it),f._insert(it)}else i.exponent&&!ft&&/^((E(\+|-)?|e(\+|-)?)\d+)/g.test(a)?(ft=!0,h="",h+=i.exponent.symbol,h+=n.___signs[i.exponent.sign],h+=n.___zeroPad(d.toString(),i.exponent.exp,!0),f._insert(h)):f._insert(a)}ct===u.NegativeSign&&f._insert(ct),i.group===!0&&(pt=n.__insertGroupSeparator(f.toString(),u.NumberGroupSizes,u.NumberGroupSeparator,u.NegativeSign),f=new r(pt))}if(e)for(ht="",et>0?(st=g.indexOf(u.NumberDecimalSeparator),st!==-1&&(ht=g.substring(st+1),o===""&&f.append(g.substr(0,st)),f.append(u.NumberDecimalSeparator))):/^(#+)$/ig.test(y)&&e.join("").length===y.length||(f.append(u.NumberDecimalSeparator),ut>0&&(ht=new Array(ut+1).join("0"))),at=0,b=0;b<e.length;b++)v=e[b],/^(0|#)+/g.test(v)?(f.append(ht.substr(at,v.length)),at+=v.length):i.exponent&&!ft&&/^((E(\+|-)?|e(\+|-)?)\d+)/g.test(v)?(ft=!0,h="",h+=i.exponent.sym
bol,h+=n.___signs[i.exponent.sign],h+=n.___zeroPad(d.toString(),i.exponent.exp,!0),f.append(h)):f.append(v);return f.toString()},n.__parseNumberNegativePattern=function(n,t,i){var f=t.NegativeSign,u=t.PositiveSign,r=new e(n);(i===4||i===2)&&(f=" "+f,u=" "+u);if(i===4||i===3){if(r.endsWith(f))return["-",n.substr(0,n.length-f.length)];else if(r.endsWith(u))return["+",n.substr(0,n.length-u.length)]}else if(i===2||i===1){if(r.startsWith(f))return["-",n.substr(f.length)];else if(r.startsWith(u))return["+",n.substr(u.length)]}else if(i===0){if(r.startsWith("(")&&r.endsWith(")"))return["-",n.substr(1,n.length-2)]}else throw new Error("");return["",n]},n.__parseNumber=function(t,i){var w,a,l,s,b,k,d,u,g,c,h,v;t=t!==undefined&&t!==null?new e(t).trim():"";if(t.match(/^[+-]?infinity$/i))return parseFloat(t);if(t.match(/^0x[a-f0-9]+$/i))return parseInt(
t,10);var f=i.numberFormat,p=n.__parseNumberNegativePattern(t,f,f.NumberNegativePattern),y=p[0],o=p[1];return y===""&&f.NumberNegativePattern!==1&&(p=n.__parseNumberNegativePattern(t,f,1),y=p[0],o=p[1]),y===""&&(y="+"),o[0]===f.CurrencySymbol&&(o=o.substr(1)),l=o.indexOf("e"),l<0&&(l=o.indexOf("E")),l<0?(a=o,w=null):(a=o.substr(0,l),w=o.substr(l+1)),k=a.indexOf(f.NumberDecimalSeparator),k<0?(s=a,b=null):(s=a.substr(0,k),b=a.substr(k+f.NumberDecimalSeparator.length)),s=s.split(f.NumberGroupSeparator).join(""),d=f.NumberGroupSeparator.replace(/\u00A0/g," "),f.NumberGroupSeparator!==d&&(s=s.split(d).join("")),u=y+s,b!==null&&(u+="."+b),g=u[u.length-1],g===f.PercentSymbol&&(u=u.substr(0,u.length-1),u=new e(u).trimEnd(),c=u.indexOf(f.NumberDecimalSeparator),c===-1&&(c=u.length),h=new r(""),h.append(u.substr(0,
c-2)),h.append(f.NumberDecimalSeparator),h.append(u.substr(c-2,2)),h.append(u.substr(c+1)),u=h.toString()),w!==null&&(v=n.__parseNumberNegativePattern(w,f,1),v[0]===""&&(v[0]="+"),u+="e"+v[0]+v[1]),u.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/)?parseFloat(u):NaN},n.___toHexString=function(i,r,u){if(Math.abs(Math.floor(i)-i)!==0)throw new Error(t._StringResource.Exp_BadFormatSpecifier);var f=i>=0?i.toString(16):(n.___maxInt32+i+1).toString(16);return f=r?f.toLowerCase():f.toUpperCase(),u!==undefined&&u!==null&&f.length<u?n.___zeroPad(f,u,!0):f},n.___toScientific=function(t,i,r,u,f,e,o){var s=0,h=t>=1||t===0,l,c;while(s<1e3){l=Math.pow(10,s);if(h&&t/l<10||!h&&t*l>=1)break;s++}return t=h?Math.abs(t)/Math.pow(10,s):Math.abs(t)*Math.pow(10,s),c=n.___expandNumber(t,r,u,f,e,o),c+=i+(h?"+":"-")+n.___zeroPad(s.toString(),3,!0)},n.___signs={"1":"+","0":&qu
ot;","-1":"-"},n.___maxInt32=4294967295,n.___percentPositivePattern=["n %","n%","%n"],n.___percentNegativePattern=["-n %","-n%","-%n"],n.___numberNegativePattern=["(n)","-n","- n","n-","n -"],n.___currencyPositivePattern=["$n","n$","$ n","n $"],n.___currencyNegativePattern=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"],n}();t._NumberHelper=d,t._currentCulture,t.Culture=w,function(){var r=$("meta[name='spreadjs culture']"),i;r.length>0&&(i=$(r[r.length-1]).attr("content"),i!==null&&i!=undefined&&i.toLowerCase()==="ja-jp"&&(n.spre
ad._StringResource=n.spread._JPStringResource,t._currentCulture="ja-jp"))}()})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(t){function it(n){return parseInt(n,16)}function ut(n){return parseInt(n+n,16)}function l(n){return n.indexOf("%")>0?parseFloat(n)*2.55:n|0}function rt(n){var i=v(n),t=RegExp,r;if(b.test(i))return[t.$1,t.$2,t.$3].map(it);else if(w.test(i))return r=[t.$1,t.$2,t.$3].map(l),r.splice(0,0,parseFloat(t.$4)*255),r;else if(d.test(i))return[t.$1,t.$2,t.$3].map(l);else if(g.test(i))return[t.$1,t.$2,t.$3].map(ut);return null}function f(n){var t;if(n instanceof e)return n;var u=0,r=0,f=0,i=0;return n&&n!==""&&(t=rt(n),t&&(t.length===3?(u=255,r=t[0],f=t[1],i=t[2]):t.length===4&&(u=t[0],r=t[1],f=t[2],i=t[3]))),new e(u,r,f,i)}var e,o,i,u,h;t.feature("core.theme",["core.migrate","core.common"]),e=function(){function n(n,t,i,r){this.a=n
,this.r=t,this.g=i,this.b=r}return n.prototype.toString=function(){return this.a===255?"#"+this.getColorUnitString(this.r)+this.getColorUnitString(this.g)+this.getColorUnitString(this.b):"rgba("+this.r+","+this.g+","+this.b+","+this.a+")"},n.prototype.getBrightness=function(){return(this.r*299+this.g*587+this.b*114)/1e3},n.prototype.getColorUnitString=function(n){var t=n.toString(16);return t.length===1&&(t="0"+t),t},n.hueToRGB=function(n,t,i){return i<0&&(i+=240),i>240&&(i-=240),i<40?n+((t-n)*i+20)/40:i<120?t:i<160?n+((t-n)*(160-i)+20)/40:n},n.fromHLS=function(t,i,r){var e,o,s,f,u;return r===0?e=o=s=parseInt(i*255/240,10):(u=i>120?i+r-(i*r+120)/240:(i*(240+r)+120)/240,f=2*i-u,e=parseInt((n.hueToRGB(f,u,t+80)*255+120)/240,10),o=parseInt((n.hueToRGB(f,u,t)*255+120)/240,10),s=parseInt((n.hueToRGB(f,u,t-80)*255+120)/240,10)),new n(255,e,o,s)},n.parse=function(n){return f(n)},
n}(),t._Color=e,o=function(){function n(n){var u=n.r,f=n.g,e=n.b,i=Math.max(Math.max(u,f),e),h=Math.min(Math.min(u,f),e),r=i+h,t;this.luminosity=parseInt((r*240+255)/510,10),t=i-h;if(t===0)this.saturation=0,this.hue=160;else{this.saturation=this.luminosity>120?parseInt((t*240+(510-r)/2)/(510-r),10):parseInt((t*240+r/2)/r,10);var c=((i-u)*40+t/2)/t,o=((i-f)*40+t/2)/t,s=((i-e)*40+t/2)/t;this.hue=u===i?parseInt(s-o,10):f===i?parseInt(80+c-s,10):parseInt(160+o-c,10),this.hue<0&&(this.hue+=240),this.hue>240&&(this.hue-=240)}}return n.prototype.toColor=function(){return e.fromHLS(this.hue,this.luminosity,this.saturation)},n.prototype.getLighterColor=function(n){var t=this.luminosity,i=this.newLuma(this.luminosity,500,!0);return e.fromHLS(this.hue,t+(i-t)*n,this.saturation)},n.prototype.getDrakerColor=function(n){var t=this.newLuma(this.luminosity,-333,!0);return e.fromHLS(this.hue,t*(1-n),this.saturation)},n.prototype.newLuma=function(n,t,i){return t===0?n:i?t>
0?(n*(1e3-t)+241*t)/1e3:n*(t+1e3)/1e3:(n+=t*240/1e3,n<0&&(n=0),n>240&&(n=240),n)},n}(),t.HLSColor=o;var b=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,g=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,d=/^rgb\(([\s\d]*),([\s\d]*),([\s\d]*)\)$/i,w=/^rgba\(([\s\d]*),([\s\d]*),([\s\d]*),([\s\d]*)\)$/i,v=function(n){var i,t;return n?function(n){if(!t){var i=window.document.createElement("canvas");i&&i.getContext&&(t=i.getContext("2d"))}return t?(t.fillStyle=n,n=t.fillStyle):n}:function(n){return typeof i=="undefined"&&(i=$("<span></span>")),i.css("color",n),i.css("color")}}(n.spread.util._isStandardCanvas());var tt=function(n,t){if(t===0)return n;var i=new o(n),r=parseInt(t>0?(240-i.luminosity)*t:i.luminosity*t,10);return e.fromHLS(i.hue,i.luminosity+r,i.saturation)},k=0,ft=1,st=2,ht=3,et=4,ot=5,nt=6,y=7,p=8,a=9,c=10,s=11,r=function(){function n(n,t,i,r,u,e,o,s,h,c,l,a,v){this.
_name=n,this._colorList=[f(r),f(u),f(t),f(i),f(e),f(o),f(s),f(h),f(c),f(l),f(a),f(v)]}return n.prototype.name=function(n){return arguments.length===0?this._name:(this._name=n,this)},n.prototype.background1=function(n){return this._property(k,arguments.length===0,n)},n.prototype.background2=function(n){return this._property(ft,arguments.length===0,n)},n.prototype.textColor1=function(n){return this._property(st,arguments.length===0,n)},n.prototype.textColor2=function(n){return this._property(ht,arguments.length===0,n)},n.prototype.accent1=function(n){return this._property(et,arguments.length===0,n)},n.prototype.accent2=function(n){return this._property(ot,arguments.length===0,n)},n.prototype.accent3=function(n){return this._property(nt,arguments.length===0,n)},n.prototype.accent4=function(n){return this._property(y,arguments.length===0,n)},n.prototype.accent5=function(n){return this._property(p,arguments.length===0,n)},n.prototype.accent6=function(n){return this._property(a,arguments.
length===0,n)},n.prototype.hyperline=function(n){return this._property(c,arguments.length===0,n)},n.prototype.followedHyperline=function(n){return this._property(s,arguments.length===0,n)},n.prototype._property=function(n,t,i){return t?this._colorList[n]:(this._colorList[n]=f(i),this)},n.prototype.getColor=function(n){var i,t,r,f,u,e;if(n&&n!==""){i=-1,t=n.split(" ");if(t){if(t.length>1){if(t[0]===undefined||t[0]===null)return n;r=t[0].toLowerCase(),r==="background"?i=parseInt(t[1],10)-1:r==="text"?i=parseInt(t[1],10)+1:r==="accent"&&(i=parseInt(t[1],10)+3)}else if(t.length===1){if(t[0]===undefined||t[0]===null)return n;f=t[0].toLowerCase(),f==="hyperlink"?i=c:f==="followedHyperlink"&&(i=s)}u=0,t.length>2&&(u=parseInt(t[2],10));if(i>=0&&i<=11)return e=tt(this._colorList[i],u/100),e.toString()}}return n},n}();t.ThemeColor=r,i=function(){function n(){}return n.Defa
ult=new r("Default","#000000","#1F497D","#FFFFFF","#EEECE1","#4F81BD","#C0504D","#9BBB59","#8064A2","#4BACC6","#F79646","#0000FF","#800080"),n.Office=new r("Office","#000000","#1F497D","#FFFFFF","#EEECE1","#4F81BD","#C0504D","#9BBB59","#8064A2","#4BACC6","#F79646","#0000FF","#800080"),n.Apex=new r("Apex","#000000","#69676D","#FFFFFF","#C9C2D1","#CEB966","#9CB084","#6BB1C9","#6585CF","#7E6BC9","#A379BB","#410082","#932968"),n.Aspect=new r("Aspect","#000000","#323232","#FFFFFF","#E3DED1","#F07F09","#9F2936","#1B587C","
#4E8542","#604878","#C19859","#6B9F25","#B26B02"),n.Concourse=new r("Concourse","#000000","#464646","#FFFFFF","#DEF5FA","#2DA2BF","#DA1F28","#EB641B","#39639D","#474B78","#7D3C4A","#FF8119","#44B9E8"),n.Civic=new r("Civic","#000000","#646B86","#FFFFFF","#C5D1D7","#D16349","#CCB400","#8CADAE","#8C7B70","#8FB08C","#D19049","#00A3D6","#694F07"),n.Oriel=new r("Oriel","#000000","#575F6D","#FFFFFF","#FFF39D","#FE8637","#7598D9","#B32C16","#F5CD2D","#AEBAD5","#777C84","#D2611C","#3B435B"),n.Origin=new r("Origin","#000000","#464653",&
quot;#FFFFFF","#DDE9EC","#727CA3","#9FB8CD","#D2DA7A","#FADA7A","#B88472","#8E736A","#B292CA","#6B5680"),n.Paper=new r("Paper","#000000","#444D26","#FFFFFF","#FEFAC9","#A5B592","#F3A447","#E7BC29","#D092A7","#9C85C0","#809EC2","#8E58B6","#7F6F6F"),n.Solstice=new r("Solstice","#000000","#4F271C","#FFFFFF","#E7DEC9","#3891A7","#FEB80A","#C32D2E","#84AA33","#964305","#475A8D","#8DC765","#AA8A14"),n.Technic=new r("Technic","#000000","#3B3B3B","#FFFFFF","#D4D2D0","#6EA0B0","#CCAF0A","#8D89A4","#748560","#9E9273","#7E848D","#00
C8C3","#A116E0"),n.Trek=new r("Trek","#000000","#4E3B30","#FFFFFF","#FBEEC9","#F0A22E","#A5644E","#B58B80","#C3986D","#A19574","#C17529","#AD1F1F","#FFC42F"),n.Urban=new r("Urban","#000000","#424456","#FFFFFF","#DEDEDE","#53548A","#438086","#A04DA3","#C4652D","#8B5D3D","#5C92B5","#67AFBD","#C2A874"),n.Verve=new r("Verve","#000000","#666666","#FFFFFF","#D2D2D2","#FF388C","#E40059","#9C007F","#68007F","#005BD3","#00349E","#17BBFD","#FF79C2"),n.Equity=new r("Equity","#000000","#696464","#FFFFFF","#E9E5DC","#D34817","#9B2D1F&
quot;,"#A28E6A","#956251","#918485","#855D5D","#CC9900","#96A9A9"),n.Flow=new r("Flow","#000000","#04617B","#FFFFFF","#DBF5F9","#0F6FC6","#009DD9","#0BD0D9","#10CF9B","#7CCA62","#A5C249","#E2D700","#85DFD0"),n.Foundry=new r("Foundry","#000000","#676A55","#FFFFFF","#EAEBDE","#72A376","#B0CCB0","#A8CDD7","#C0BEAF","#CEC597","#E8B7B7","#DB5353","#903638"),n.Median=new r("Median","#000000","#775F55","#FFFFFF","#EBDDC3","#94B6D2","#DD8047","#A5AB81","#D8B25C","#7BA79D","#968C8C","#F7B615","#704404"),n.Metro=new r("Metro","#000000&q
uot;,"#4E5B6F","#FFFFFF","#D6ECFF","#7FD13B","#EA157A","#FEB80A","#00ADDC","#738AC8","#1AB39F","#EB8803","#5F7791"),n.Module=new r("Module","#000000","#5A6378","#FFFFFF","#D4D4D6","#F0AD00","#60B5CC","#E66C7D","#6BB76D","#E88651","#C64847","#168BBA","#680000"),n.Opulent=new r("Opulent","#000000","#B13F9A","#FFFFFF","#F4E7ED","#B83D68","#AC66BB","#DE6C36","#F9B639","#CF6DA4","#FA8D3D","#FFDE66","#D490C5"),n}(),t.ThemeColors=i,u=function(){function n(n,t,i,u){this._name=n,this._themeColor=t?t:new r(n),this._headingFont=i,this._bodyFont=u}return n.prototype.name=function(n){return arguments.length===0?this._name:(this._nam
e=n,this)},n.prototype.colors=function(n){return arguments.length===0?this._themeColor:(this._themeColor=n,this)},n.prototype.headerFont=function(n){return arguments.length===0?this._headingFont:(this._headingFont=n,this)},n.prototype.bodyFont=function(n){return arguments.length===0?this._bodyFont:(this._bodyFont=n,this)},n}(),t.SpreadTheme=u,h=function(){function n(){}return n.Default=new u("Default",i.Default,"Cambria","Calibri"),n.Office=new u("Office",i.Office,"Cambria","Calibri"),n.Apex=new u("Apex",i.Apex,"Lucida Sans","Book Antiqua"),n.Aspect=new u("Aspect",i.Aspect,"Verdana","Verdana"),n.Concourse=new u("Concourse",i.Concourse,"Lucida Sans Unicode","Lucida Sans Unicode"),n.Civic=new u("Civic",i.Civic,"Georgia","Georgia"),n.Oriel=new u("Oriel",i.Oriel,"Century Schoolbook","C
entury Schoolbook"),n.Origin=new u("Origin",i.Origin,"Bookman Old Style","Gill Sans MT"),n.Paper=new u("Paper",i.Paper,"Constantia","Constantia"),n.Solstice=new u("Solstice",i.Solstice,"Gill Sans MT","Gill Sans MT"),n.Technic=new u("Technic",i.Technic,"Franklin Gothic Book","Arial"),n.Trek=new u("Trek",i.Trek,"Franklin Gothic Medium","Franklin Gothic Book"),n.Urban=new u("Urban",i.Urban,"Trebuchet MS","Georgia"),n.Verve=new u("Verve",i.Verve,"Century Gothic","Century Gothic"),n.Equity=new u("Equity",i.Equity,"Franklin Gothic Book","Perpetua"),n.Flow=new u("Flow",i.Flow,"Calibri","Constantia"),n.Foundry=new u("Foundry",i.Foundry,"Rockwell","Rockwell"),n.Median=new u("Median"
,i.Median,"Tw Cen MT","Tw Cen MT"),n.Metro=new u("Metro",i.Metro,"Consolas","Corbel"),n.Module=new u("Module",i.Module,"Corbel","Corbel"),n.Opulent=new u("Opulent",i.Opulent,"Trebuchet MS","Trebuchet MS"),n}(),t.SpreadThemes=h})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));(function(n){wijmo.spread.feature("core.spreadpanelex"),"use strict";var c="wijmo-wijsuperpanel ui-widget ui-widget-content",e="ui-corner-all",t="ui-state-disabled",u="ui-state-hover",o="ui-state-active",r="ui-state-default",i="wijmo-wijsuperpanel-handle",f="wijmo-wijsuperpanel-hbarcontainer",h="wijmo-wijsuperpanel-vbarcontainer",v="<div class='wijmo-wijsuperpanel-statecontainer'><div class='wijmo-wijsuperpanel-contentwrapper'><div class='wijmo-wijsuperpanel-temp
lateouterwrapper'></div></div></div>",s="<div class='wijmo-wijsuperpanel-hbarcontainer ui-widget-header'><div class='wijmo-wijsuperpanel-handle ui-state-default ui-corner-all'><span class='ui-icon ui-icon-grip-solid-vertical'></span></div><div class='wijmo-wijsuperpanel-hbar-buttonleft ui-state-default ui-corner-bl'><span class='ui-icon ui-icon-triangle-1-w'></span></div><div class='wijmo-wijsuperpanel-hbar-buttonright ui-state-default ui-corner-br'><span class='ui-icon ui-icon-triangle-1-e'></span></div></div>",y="<div class='wijmo-wijsuperpanel-vbarcontainer ui-widget-header'><div class='wijmo-wijsuperpanel-handle ui-state-default ui-corner-all'><span class='ui-icon ui-icon-grip-solid-horizontal'></span></div><div class='wijmo-wijsuperpanel-vbar-buttontop ui-state-default ui-corner-tr'><span class='ui-icon ui-icon-trian
gle-1-n'></span></div><div class='wijmo-wijsuperpanel-vbar-buttonbottom ui-state-default ui-corner-br'><span class='ui-icon ui-icon-triangle-1-s'></span></div></div>",l="<div class='ui-state-default wijmo-wijsuperpanel-button wijmo-wijsuperpanel-buttonleft'><span class='ui-icon ui-icon-carat-1-w'></span></div><div class='ui-state-default wijmo-wijsuperpanel-button wijmo-wijsuperpanel-buttonright'><span class='ui-icon ui-icon-carat-1-e'></span></div>",a="<div class='ui-state-default wijmo-wijsuperpanel-button wijmo-wijsuperpanel-buttontop'><span class='ui-icon ui-icon-carat-1-n'></span></div><div class='ui-state-default wijmo-wijsuperpanel-button wijmo-wijsuperpanel-buttonbottom'><span class='ui-icon ui-icon-carat-1-s'></span></div>";n.widget("wijmo.wijspreadpanelex",{options:{allowResize:!1,autoRefresh:!1,anim
ationOptions:{queue:!1,disabled:!1,duration:250,easing:undefined},hScrollerActivating:null,hScroller:{scrollBarPosition:"bottom",scrollBarVisibility:"auto",scrollMode:"scrollBar",scrollValue:null,scrollMax:100,scrollMin:0,scrollLargeChange:null,scrollSmallChange:null,scrollMinDragLength:6,increaseButtonPosition:null,decreaseButtonPosition:null,hoverEdgeSpan:20,firstStepChangeFix:0},keyboardSupport:!1,keyDownInterval:100,mouseWheelSupport:!0,bubbleScrollingEvent:!0,resizableOptions:{handles:"all",helper:"ui-widget-content wijmo-wijsuperpanel-helper"},resized:null,dragStop:null,painted:null,scrolling:null,scroll:null,scrolled:null,showRounder:!0,vScrollerActivating:null,vScroller:{scrollBarPosition:"right",scrollBarVisibility:"auto",scrollMode:"scrollBar",scrollValue:null,scrollMax:100,scrollMin:0,scrollLargeChange:null,scrollSmallChange:null,scrollMinDragLength:6,increaseButtonPosition:null,decreaseButton
Position:null,hoverEdgeSpan:20,firstStepChangeFix:0}},_setOption:function(t,i){var r=this,o=r.options,s=r._fields(),e=s.hbarDrag,u=s.vbarDrag,f=s.resizer;t==="animationOptions"?i=n.extend(o.animationOptions,i):t==="hScroller"?(i.scrollLargeChange!==undefined&&i.scrollLargeChange!==null&&(r._autoHLarge=!1),i=n.extend(o.hScroller,i)):t==="vScroller"?(i.scrollLargeChange!==undefined&&i.scrollLargeChange!==null&&(r._autoVLarge=!1),i=n.extend(o.vScroller,i)):t==="resizableOptions"&&(i=n.extend(r.resizableOptions,i)),n.Widget.prototype._setOption.apply(r,arguments),n.isPlainObject(i)&&(r.options[t]=i);switch(t){case"allowResize":r._initResizer();break;case"disabled":i?(e!==undefined&&e.draggable("disable"),u!==undefined&&u.draggable("disable"),f!==undefined&&f.resizable("disable")):(e!==undefined&&e.draggable("enable
"),u!==undefined&&u.draggable("enable"),f!==undefined&&f.resizable("enable"));break;case"mouseWheelSupport":case"keyboardSupport":r._bindElementEvents(r,s,r.element,o);break}return r},_create:function(){var n=this,t=n.options;t.vScroller.dir="v",t.hScroller.dir="h",n.paintPanel(),n._initResizer(),n.options.disabled&&n.disable(),n._detectAutoRefresh()},_detectAutoRefresh:function(){var i=this,t=n.wijmo.wijspreadpanelex.panels;t===undefined&&(t=[],n.wijmo.wijspreadpanelex.panels=t),t.push(i),i.options.autoRefresh&&(n.wijmo.wijspreadpanelex.setAutoRefreshInterval||(n.wijmo.wijspreadpanelex.setAutoRefreshInterval=i._setAutoRefreshInterval,n.wijmo.wijspreadpanelex.setAutoRefreshInterval()))},_setAutoRefreshInterval:function(){var i=n.wijmo.wijspreadpanelex.autoRereshInterval,t=n.wijmo.wijspreadpanelex.panels,r=window.setInterval(function(){window.clearInterval(r);for(var c=t.length,s=
!1,i,o,h,f,u,e=0;e<c;e++)i=t[e],o=i.element[0],h=i.options.autoRefresh,h&&(s=!0),f=i.getContentElement(),u=i._paintedMark,i.options.autoRefresh&&f.is(":visible")&&(u===undefined||u.width!==f[0].offsetWidth||u.height!==f[0].offsetHeight||u.mainWidth!==o.offsetWidth||u.mainHeight!==o.offsetHeight)&&i.paintPanel();s&&window.setTimeout(n.wijmo.wijspreadpanelex.setAutoRefreshInterval,0)},i===undefined?500:i)},destroy:function(){var i=this,t=i._fields(),r=i.element,f,u;n.wijmo.wijspreadpanelex.panels=n.grep(n.wijmo.wijspreadpanelex.panels,function(n){return n!==i});if(!t.initialized)return;i._radiusKey&&i.element.css(i._radiusKey,""),t.intervalID!==undefined&&(window.clearInterval(t.intervalID),t.intervalID=undefined),t.resizer!==undefined&&t.resizer.resizable("destroy"),t.hbarContainer!==undefined&&(t.hbarDrag.remove(),t.hbarContainer.unbind("."+i.widgetName)),t.vbarContaine
r!==undefined&&(t.vbarDrag.remove(),t.vbarContainer.unbind("."+i.widgetName)),r.unbind("."+i.widgetName),t.contentWrapper.unbind("."+i.widgetName),f=t.stateContainer.find(">.wijmo-wijsuperpanel-button"),f.unbind("."+i.widgetName),u=t.templateWrapper,u.contents().each(function(n,t){r.append(t)}),t.stateContainer.remove(),t.tabindex&&r.removeAttr("tabindex"),r.removeClass(c+" "+e),n.Widget.prototype.destroy.apply(i,arguments)},_fields:function(){var t=this,i=t.element,r=t.widgetName+"-fields",n=t._fieldsStore;return n===undefined&&(n={},i.data(r,n),t._fieldsStore=n),n},_hasMode:function(t,i){var r=t.scrollMode.split(",");return r=n.map(r,function(t){return n.trim(t).toLowerCase()}),n.inArray(i.toLowerCase(),r)>-1},_bindElementEvents:function(n,t,i,r){var f=n._hasMode(r.hScroller,"edge"),e=n._hasMode(r.vScroller,"edge"),u=n.widgetName;f||e?n._mouse
moveBind===undefined&&(n._mousemoveBind=!0,i.bind("mousemove."+u,n,n._contentMouseMove),i.bind("mouseleave."+u,null,function(){n._clearInterval()})):(i.unbind("mousemove",n._contentMouseMove),n._mousemoveBind=undefined),r.mouseWheelSupport?n._mouseWheelBind===undefined&&(n._mouseWheelBind=!0,i.bind("mousewheel."+u,n,n._panelMouseWheel)):(n.element.unbind("mousewheel",n._panelMouseWheel),n._mouseWheelBind=undefined),r.keyboardSupport?n._keyboardBind===undefined&&(n._keyboardBind=!0,i.bind("keydown."+u,n,n._panelKeyDown)):(i.unbind("keydown",n._panelKeyDown),n._keyboardBind=undefined)},_dragStop:function(n,t,i){var r={dragHandle:i};t._trigger("dragStop",n,r)},_contentMouseMove:function(t){var i=t.data,v=i.options,a,l,e,k,b,p,c,o,u,f,s,h,w,y,r;if(v.disabled)return;a=v.hScroller,l=v.vScroller,e=n(t.currentTarget),k=i._fields(),b=i._hasMode(a,"edge"),p=i._hasMode(l,"edge
"),i._clearInterval(),c={X:t.pageX,Y:t.pageY},o=e.offset(),u=o.left,f=o.top,u=c.X-u,f=c.Y-f,s=a.hoverEdgeSpan,h=l.hoverEdgeSpan,w=e.innerHeight(),y=e.innerWidth(),r="",b&&(u<s&&(r="left"),u>y-s&&(r="right")),p&&(f<h&&(r="top"),f>w-h&&(r="bottom")),i._setScrollingInterval(k,r,i,!1)},_setScrollingInterval:function(n,t,i,r){var u=i.options;t.length>0&&(n.internalFuncID=window.setInterval(function(){i._doScrolling(t,i,r)},u.keyDownInterval))},_scrollButtonMouseOver:function(i){var r=i.data,f;if(r.options.disabled)return;f=n(i.currentTarget),f.hasClass(t)||(f.bind("mouseout."+r.widgetName,r,r._buttonMouseOut).bind("mousedown."+r.widgetName,r,r._buttonMouseDown).bind("mouseup."+r.widgetName,r,r._buttonMouseUp).addClass(u),r._buttonScroll(f,r,"buttonshover"))},_buttonScroll:function(n,t,i){var r="",e=t.options,o=t._f
ields(),u=t._hasMode(e.hScroller,i),f=t._hasMode(e.vScroller,i);n.hasClass("wijmo-wijsuperpanel-buttonleft")&&u?r="left":n.hasClass("wijmo-wijsuperpanel-buttonright")&&u?r="right":n.hasClass("wijmo-wijsuperpanel-buttontop")&&f?r="top":n.hasClass("wijmo-wijsuperpanel-buttonbottom")&&f&&(r="bottom"),r.length>0&&(t._clearInterval(),t._doScrolling(r,t,!0),t._setScrollingInterval(o,r,t,!0))},_buttonMouseDown:function(i){var u=i.data,r;if(u.options.disabled)return;r=n(i.currentTarget),r.hasClass(t)||(r.addClass(o),u._buttonScroll(r,u,"buttons"))},_buttonMouseUp:function(t){var r=t.data,i=n(t.currentTarget);i.removeClass("ui-state-active"),r._clearInterval()},_buttonMouseOut:function(t){var i=t.data,r=n(t.currentTarget);r.unbind("mouseout",i._buttonMouseOut).unbind("mousedown",i._buttonMouseDown).unbind("mouseup"
;,i._buttonMouseUp).removeClass(u).removeClass(o),i._clearInterval()},_panelKeyDown:function(t){var i=t.data,f=i.options,r,u;if(!f.keyboardSupport||f.disabled)return;r=t.shiftKey,u=t.keyCode,u===n.ui.keyCode.LEFT?i._doScrolling("left",i,r):u===n.ui.keyCode.RIGHT?i._doScrolling("right",i,r):u===n.ui.keyCode.UP?i._doScrolling("top",i,r):u===n.ui.keyCode.DOWN&&i._doScrolling("bottom",i,r),t.stopPropagation(),t.preventDefault()},_draggingInternal:function(n,t,i,r){var f=i.dir,h=f==="h",s=h?"left":"top",a=n.position[s]-t._getScrollContainerPadding(s),c=t._getTrackLen(f)-r[h?"outerWidth":"outerHeight"](!0),l=a/c,e=i.scrollMax-i.scrollLargeChange+1,u=l*e,o;u<i.scrollMin&&(u=i.scrollMin),u>e&&(u=e),o={oldValue:i.scrollValue,newValue:u,dir:f};if(!t._scrolling(!0,t,o))return;i.scrollValue=u,t._setDragAndContentPosition(!0,!1,f,"dragging")},_dragging:function(t,i,r)
{var e=r.options,u=n(t.target),o=u.parent();o.hasClass(f)?r._draggingInternal(i,r,e.hScroller,u):r._draggingInternal(i,r,e.vScroller,u)},_panelMouseWheel:function(t,i){var u=t.data,h=u.options,l,r,c,o,s,e;if(!h.mouseWheelSupport||h.disabled)return;l=n(t.srcElement||t.originalEvent.target),r="",c=l.closest("."+f,u.element).size()>0,o=h.hScroller,s=h.vScroller,(t.wheelDelta===undefined||t.wheelDelta===null)&&(t.detail===undefined||t.detail===null)&&(t.wheelDelta=t.originalEvent.wheelDelta,t.detail=t.originalEvent.detail),t.wheelDelta&&(i=t.wheelDelta/120),t.detail&&(i=-t.detail/3),r=i>0?c?"left":"top":c?"right":"bottom",r.length>0&&u._doScrolling(r,u),e=!1,r==="left"&&(e=!u.hNeedScrollBar||Math.abs(o.scrollValue-o.scrollMin)<.001),r==="right"&&(e=!u.hNeedScrollBar||Math.abs(o.scrollValue-(o.scrollMax-u._getHScrollBarLargeChange()+1))<.0
01),r==="top"&&(e=!u.vNeedScrollBar||Math.abs(s.scrollValue-s.scrollMin)<.001),r==="bottom"&&(e=!u.vNeedScrollBar||Math.abs(s.scrollValue-(s.scrollMax-u._getVScrollBarLargeChange()+1))<.001),e&&h.bubbleScrollingEvent&&r!=="left"&&r!=="right"||(t.stopPropagation(),t.preventDefault())},_documentMouseUp:function(t){var i=t.data.self,r=t.data.ele;r.removeClass(o),i._clearInterval(),n(document).unbind("mouseup",i._documentMouseUp)},_scrollerMouseOver:function(t){var i=t.data,o,e,s;if(i.options.disabled)return;o=n(t.srcElement||t.originalEvent.target),e=null,s=!1,o.hasClass(r)?(e=o,s=!0):o.parent().hasClass(r)?(e=o.parent(),s=!0):(o.hasClass(h)||o.hasClass(f))&&(e=o),e!==undefined&&(s&&e.addClass(u),e.bind("mouseout."+i.widgetName,i,i._elementMouseOut),e.bind("mousedown."+i.widgetName,i,i._elementMouseDown),e.bind("mouseup."+i.widgetName,i,i
._elementMouseUp))},_elementMouseUp:function(t){var i=n(t.currentTarget);i.removeClass("ui-state-active")},_elementMouseDown:function(t){var r=n(t.currentTarget),e=t.data,u,s,o,v,y,a,c,l;if(e.options.disabled||t.which!==1)return;u="",s=!1,o=!1;if(r.hasClass("wijmo-wijsuperpanel-vbar-buttontop"))u="top",o=!0;else if(r.hasClass("wijmo-wijsuperpanel-vbar-buttonbottom"))u="bottom",o=!0;else if(r.hasClass("wijmo-wijsuperpanel-hbar-buttonleft"))u="left",o=!0;else if(r.hasClass("wijmo-wijsuperpanel-hbar-buttonright"))u="right",o=!0;else if(r.hasClass(i)){r.addClass("ui-state-active");return}else r.hasClass(f)?(v=r.find("."+i),y=v.offset(),u=t.pageX<y.left?"left":"right",s=!0):r.hasClass(h)&&(a=r.find("."+i),c=a.offset(),u=t.pageY<c.top?"top":"bottom",s=!0);e._clearInterval(),e._doScrolling(u,e,s),l=e._fields(
),e._setScrollingInterval(l,u,e,s),o&&r.addClass("ui-state-active"),n(document).bind("mouseup."+e.widgetName,{self:e,ele:r},e._documentMouseUp)},doScrolling:function(n,t){this._doScrolling(n,this,t)},_setScrollerValue:function(n,t,i,r,u,f,e){var c=t.scrollMin,v=f?r:i,s=t.scrollValue,o,h,a,l;s||(s=c),o=0;if(u){h=t.scrollMax-r+1;if(Math.abs(s-h)<.001)return e._clearInterval(),!1;a=t.firstStepChangeFix,o=s+v,f||Math.abs(s-c)>=.0001||isNaN(a)||(o+=a),o>h&&(o=h)}else{if(Math.abs(s-c)<.001)return e._clearInterval(),!1;o=s-v,o<0&&(o=c)}return l={oldValue:t.scrollValue,newValue:o,direction:n,dir:t.dir},e._scrolling(!0,e,l)?(t.scrollValue=l.newValue,!0):!1},_doScrolling:function(n,t,i){var r=t.options,o=r.vScroller,s=r.hScroller,h=t._getVScrollBarSmallChange(),u=t._getVScrollBarLargeChange(),f=t._getHScrollBarLargeChange(),e=t._getHScrollBarSmallChange();if(n==="top"||n==="bottom"){if(!t._setScrollerValue(n,o,h,u,
n==="bottom",i,t))return;n="v"}else if(n==="left"||n==="right"){if(!t._setScrollerValue(n,s,e,f,n==="right",i,t))return;n="h"}t._setDragAndContentPosition(!0,!0,n)},_disableButtonIfNeeded:function(n){var i=n._fields(),r,e,c,o,h,a,y,f,s,p,v,u,l;i.intervalID>0&&window.clearInterval(i.intervalID),r=n.options,e=i.buttonLeft,c=i.buttonRight,o=i.buttonTop,h=i.buttonBottom,e!==undefined&&(a=n._getHScrollBarLargeChange(),y=r.hScroller.scrollMax-a+1,f=r.hScroller.scrollValue,s=r.hScroller.scrollMin,f===undefined&&(f=s),Math.abs(f-s)<.001||!i.hScrolling?e.addClass(t):e.removeClass(t),Math.abs(f-y)<.001||!i.hScrolling?c.addClass(t):c.removeClass(t)),o!==undefined&&(p=n._getVScrollBarLargeChange(),v=r.vScroller.scrollMax-p+1,u=r.vScroller.scrollValue,l=r.vScroller.scrollMin,u===undefined&&(u=l),Math.abs(u-l)<.001||!i.vScrolling?o.addClass(t):o.removeClass(t),Math.abs(u-v)<.001||!i.
vScrolling?h.addClass(t):h.removeClass(t))},_clearInterval:function(){var t=this._fields(),n=t.internalFuncID;n>0&&(window.clearInterval(n),t.internalFuncID=-1)},_elementMouseOut:function(t){var i=n(t.currentTarget),r=t.data;i.unbind("mouseout",r._elementMouseOut),i.unbind("mousedown",r._elementMouseDown),i.unbind("mouseup",r._elementMouseUp),i.removeClass(u)},_getScorllOffset:function(t){var h=n(t),l,f,v,i,e,r,o,a,s,c,u={left:null,top:null};return h.size()===0?u:(l=this._fields(),f=l.contentWrapper,v=l.templateWrapper,i=h.offset(),e=v.offset(),i.leftWidth=i.left+h.outerWidth(),i.topHeight=i.top+h.outerHeight(),r=f.offset(),r.leftWidth=r.left+f.outerWidth(),r.topHeight=r.top+f.outerHeight(),s=i.left-e.left,i.left<r.left?u.left=s:i.leftWidth>r.leftWidth&&(c=i.leftWidth-e.left-f.innerWidth(),u.left=s<c?s:c),o=i.top-e.top,i.top<r.top?u.top=o:i.topHeight>r.topHeight&&(a=i.topHeight-e.top-f.innerHeight(),u.top=o<a
?o:a),u)},needToScroll:function(n){var t=this._getScorllOffset(n);return t.top!==null||t.left!==null},scrollChildIntoView:function(n){var r=this._getScorllOffset(n),i=r.left,t=r.top;i!==null&&this.hScrollTo(i),t!==null&&this.vScrollTo(t)},hScrollTo:function(n){var t=this.options;t.hScroller.scrollValue=this.scrollPxToValue(n,"h"),this._setDragAndContentPosition(!0,!0,"h","nonestop")},vScrollTo:function(n){var t=this.options;t.vScroller.scrollValue=this.scrollPxToValue(n,"v"),this._setDragAndContentPosition(!0,!0,"v","nonestop")},scrollPxToValue:function(n,t){var f=this.options,v=t==="h"?"outerWidth":"outerHeight",a=t==="h"?"contentWidth":"contentHeight",o=t==="h"?"hScroller":"vScroller",e=this._fields(),s=e.contentWrapper,p=e[a],y=s[v](),u=f[o].scrollMin,l=f[o].scrollMax,h=l-u,c=t==="h"?this._getHScrollBarLarg
eChange():this._getVScrollBarLargeChange(),r=h-c+1,i=r*(n/(p-y));return i<u&&(i=u),i>r&&(i=r),i},scrollTo:function(n,t){this.hScrollTo(n),this.vScrollTo(t)},refresh:function(){this.paintPanel()},paintPanel:function(t){var i=this,f=i.element,o,e,r,u;return f.is(":visible")?(o=typeof document.activeElement!="unknown"?document.activeElement:undefined,e=i.options,r=i._fields(),r.initialized||i._initialize(r,f,i),i._resetLargeChange(i,r,e),i._bindElementEvents(i,r,f,e),u=r.templateWrapper,u.css({float:"left",left:"0px",top:"0px",width:"auto",height:"auto"}),u.hide(),u.show(),r.contentWidth=u.width(),r.contentHeight=u.height(),u.css("float",""),i._setRounder(i,f),i._setInnerElementsSize(r,f),i._testScroll(i,r,e)===!1?!1:(i._initScrollBars(i,r,e),i._initScrollButtons(i,r,e),i._trigger("painted"),i._paintedMark={date:new Date,mainWidth:f[0].offsetWidth,mainHeight:f[0].of
fsetHeight,width:r.contentWidth,height:r.contentWidth},o===undefined||t||n(o).focus(),!0)):!1},_resetLargeChange:function(n,t,r){var u;n._autoVLarge&&(r.vScroller.scrollLargeChange=null),n._autoHLarge&&(r.hScroller.scrollLargeChange=null),t.vTrackLen=undefined,t.hTrackLen=undefined,t.vbarContainer&&(u=t.vbarContainer.children("."+i+":eq(0)"),u.detach(),t.vbarContainer.remove(),t.vbarContainer=undefined),t.hbarContainer&&(u=t.hbarContainer.children("."+i+":eq(0)"),u.detach(),t.hbarContainer.remove(),t.hbarContainer=undefined)},_initialize:function(n,t,i){n.initialized=!0,t.addClass(c),n.oldHeight=t.css("height");var r=t.css("overflow");t.css("overflow",""),t.height(t.height()),t.css("overflow",r),i._createAdditionalDom(i,n,t)},getContentElement:function(){return this._fields().templateWrapper},_setButtonPosition:function(t,i,r,u,f,e,o){var s=u==="h",k=&q
uot;mouseover."+t.widgetName,y=s?"buttonLeft":"buttonTop",p=s?"buttonRight":"buttonBottom",c=e[y],v=e[p],b,w,h;t._hasMode(r,"buttons")||t._hasMode(r,"buttonshover")?(b=s?l:a,c===undefined&&(w=n(b).appendTo(o),w.bind(k,t,t._scrollButtonMouseOver),e[y]=c=o.children(s?".wijmo-wijsuperpanel-buttonleft":".wijmo-wijsuperpanel-buttontop"),e[p]=v=o.children(s?".wijmo-wijsuperpanel-buttonright":".wijmo-wijsuperpanel-buttonbottom")),h={my:s?"left":"top",of:f,at:s?"left":"top",collision:"none"},n.extend(h,r.decreaseButtonPosition),c.position(h),h={my:s?"right":"bottom",of:f,at:s?"right":"bottom",collision:"none"},n.extend(h,r.increaseButtonPosition),v.position(h)):c!==undefined&&(c.remove(),v.remove(),e[y]=e[p]=undefined)},_initScrollButtons:function(n,t,i){var u=t.contentWrap
per,r=t.stateContainer;n._setButtonPosition(n,i,i.hScroller,"h",u,t,r),n._setButtonPosition(n,i,i.vScroller,"v",u,t,r)},_getVScrollBarSmallChange:function(){var n=this.options,t;return n.vScroller.scrollSmallChange||(t=this._getVScrollBarLargeChange(),n.vScroller.scrollSmallChange=t/2),n.vScroller.scrollSmallChange},_getVScrollBarLargeChange:function(){return this._getLargeChange("v")},_getLargeChange:function(n){var f=this,a=f.options,l=f._fields(),i=n==="v",t=i?a.vScroller:a.hScroller,w=i?"innerHeight":"innerWidth",p=i?"contentHeight":"contentWidth",y=i?"_autoVLarge":"_autoHLarge",v,c,o,h,u,s,e,r;return t.scrollLargeChange?t.scrollLargeChange:(v=t.scrollMax,c=t.scrollMin,o=v-c,h=l.contentWrapper,u=h[w](),s=l[p],e=u/(s-u),r=(o+1)*e/(1+e),isNaN(r)&&(r=0),t.scrollLargeChange=r,f[y]=!0,t.scrollLargeChange)},_getHScrollBarSmallChange:function(){var n=this.options,t;return n.hScro
ller.scrollSmallChange||(t=this._getHScrollBarLargeChange(),n.hScroller.scrollSmallChange=t/2),n.hScroller.scrollSmallChange},_getHScrollBarLargeChange:function(){return this._getLargeChange("h")},_initScrollBars:function(n,t,i){var p=i.hScroller,g=p.scrollMax,b=p.scrollMin,k=g-b,y=i.vScroller,d=y.scrollMax,tt=y.scrollMin,nt=d-tt,r=t.hbarDrag,u=t.vbarDrag,w,f,o,v,e,l,s,c,a,h;n.hNeedScrollBar&&r.is(":visible")&&(w=n._getHScrollBarLargeChange(),f=n._getTrackLen("h"),o=n._getDragLength(k,w,f,i.hScroller.scrollMinDragLength),r.width(o),v=r.outerWidth(!0)-r.width(),r.width(o-v),e=r.children("span"),e.css("margin-left",(r.width()-e[0].offsetWidth)/2),f>r.outerWidth(!0)?r.show():r.hide()),n.vNeedScrollBar&&u.is(":visible")&&(l=n._getVScrollBarLargeChange(),s=n._getTrackLen("v"),c=n._getDragLength(nt,l,s,i.vScroller.scrollMinDragLength),u.height(c),a=u.outerHeight(!0)-u.height(),u.height
(c-a),h=u.children("span"),h.css("margin-top",(u.height()-h[0].offsetHeight)/2),s>u.outerHeight(!0)?u.show():u.hide()),n._setDragAndContentPosition(!1,!1,"both")},_getTrackLen:function(n){var f=this,t=f._fields(),u=n+"TrackLen",e,o,i,r;return t[u]!==undefined?t[u]:(e=t.hbarContainer,o=t.vbarContainer,i=0,r=0,n==="h"&&(r=f._getScrollContainerPadding("h"),i=e.innerWidth()),n==="v"&&(r=f._getScrollContainerPadding("v"),i=o.innerHeight()),t[u]=i-r)},_getScrollContainerPadding:function(n){var r=this,u=r._fields(),t=0,i,f;if(n==="h")t=r._getScrollContainerPadding("left")+r._getScrollContainerPadding("right");else if(n==="v")t=r._getScrollContainerPadding("top")+r._getScrollContainerPadding("bottom");else{i=n==="left"||n==="right"?u.hbarContainer:u.vbarContainer,f=n+"Padding";if(u[f]!==undefined)return t
=u[f];i&&i.css&&(t=parseFloat(i.css("padding-"+n))),u[f]=t}return t},_triggerScroll:function(n,t,i){var r={position:n,dir:t,animationOptions:i};this._trigger("scroll",null,r)},_contentDragAnimate:function(t,i,r,u,f,e,o){var s=this,l=s.options,c=t==="v",b=c?l.vScroller:l.hScroller,st=c?"outerHeight":"outerWidth",ht=c?"innerHeight":"innerWidth",yt=c?"contentHeight":"contentWidth",vt=c?"top":"left",tt=b.scrollMin,lt=b.scrollMax,ct=lt-tt,v=b.scrollValue===undefined?tt:b.scrollValue-tt,pt=s._getLargeChange(t),p=ct-pt+1,g=s._fields(),at=g.contentWrapper,y=g.templateWrapper,h,a,rt,et,ut,it,d,ft,w,k,ot,nt;v>p&&(v=p),h=(g[yt]-at[ht]())*(v/p),Math.abs(h)<.001&&(h=0),h=Math.round(h),a=-1,r!==undefined&&(i&&u.is(":animated")&&f!=="nonestop"&&u.stop(!0,!1),rt=s._getTrackLen(t),et=u[st](!0),ut=rt-et,
it=s._getScrollContainerPadding(vt),a=v/p*ut+it),i&&l.animationOptions&&!l.animationOptions.disabled?(a<0||o==="dragging"||(d=n.extend({},l.animationOptions),d.complete=undefined,ft=c?{top:a}:{left:a},u.animate(ft,d)),w=n.extend({},l.animationOptions),k=l.animationOptions.complete,w.complete=function(){s._scrollEnd(e,s,t),n.isFunction(k)&&k(arguments)},i&&y.is(":animated")&&f!=="nonestop"&&y.stop(!0,!1),ot=c?{top:-h}:{left:-h},y.animate(ot,w),s._triggerScroll(h,t,w)):(nt=c?"top":"left",a<0||o==="dragging"||(u[0].style[nt]=a+"px"),y[0].style[nt]=-h+"px",s._triggerScroll(h,t),s._scrollEnd(e,s,t))},_setDragAndContentPosition:function(n,t,i,r,u){var e=this,f=e._fields(),h=f.hbarContainer,c=f.hbarDrag,o=f.vbarContainer,s=f.vbarDrag;(i==="both"||i==="h")&&f.hScrolling&&e._contentDragAnimate("h",t,h,c,r,n,u),(i==
="both"||i==="v")&&f.vScrolling&&e._contentDragAnimate("v",t,o,s,r,n,u),f.intervalID>0&&window.clearInterval(f.intervalID),f.intervalID=window.setInterval(function(){e._disableButtonIfNeeded(e)},500)},_scrolling:function(n,t,i){var r=!0;return n&&(i.beforePosition=t.getContentElement().position(),t._beforePosition=i.beforePosition,r=t._trigger("scrolling",null,i)),r},_scrollEnd:function(n,t,i){n&&window.setTimeout(function(){var u=t.getContentElement(),r,n;if(!u.is(":visible"))return;r=t.getContentElement().position(),n={dir:i,beforePosition:t._beforePosition,afterPosition:r},t._trigger("scrolled",null,n)},0)},_getDragLength:function(n,t,i,r){var e=n/t,u=i/e,f=r;return u<f?u=f:u+1<i||(u=i-1),Math.round(u)},_needScrollbar:function(n,t){var u=this._hasMode(n,"scrollbar"),i=n.scrollBarVisibility;return u&&(i==="visible"||i==="auto"&&
t)},_bindBarEvent:function(t,i,r){var u=this;u._isDragging=!1,t.bind("mouseover."+u.widgetName,u,u._scrollerMouseOver),i.draggable({axis:r==="h"?"x":"y",start:function(n,t){u._isDragging=!0},drag:function(n,t){u._dragging(n,t,u)},containment:"parent",stop:function(t){u._dragStop(t,u,r),n(t.target).removeClass("ui-state-active"),u._isDragging=!1}})},_createBarIfNeeded:function(t,r,u,f,e){if(t){var c=this,y,v=c._fields(),w=u+"barContainer",p=u+"barDrag",o=u==="h",s=e[o?"innerHeight":"innerWidth"](),h=v[w]=n(f),l,a;r.append(h),l=h[0][o?"offsetHeight":"offsetWidth"],s=s-l,y={direction:o?"horizontal":"vertical",targetBarLen:l,contentLength:s};if(c._trigger(o?"hScrollerActivating":"vScrollerActivating",null,y)===!1)return!1;a=v[p]=h.find("."+i),c._bindBarEvent(h,a,u),e[o?"height":"width"](s)}
},_setScrollbarPosition:function(n,t,i,r,u,f,e,o,s,h,c){var l=h==="h",v,k,d,p,g,b,y,w,a;f?(v=r[0][l?"offsetHeight":"offsetWidth"],k=t._getScrollContainerPadding(h),d=l?"top":"left",p=l?{top:"0px",bottom:"auto",left:"auto",right:"auto"}:{left:"0px",right:"auto",top:"auto",bottom:"auto"},g=l?{top:v+"px"}:{left:v+"px"},b=l?{top:"auto",right:"auto",left:"auto",bottom:"0px"}:{left:"auto",right:"0px",top:"auto",bottom:"auto"},y=l?{top:""}:{left:""},w=i[l?"innerWidth":"innerHeight"](),o===d?(r.css(p),i.css(g),l?(r.children(".wijmo-wijsuperpanel-hbar-buttonleft").removeClass("ui-corner-bl").addClass("ui-corner-tl"),r.children(".wijmo-wijsuperpanel-hbar-buttonright").removeClass("ui
-corner-br").addClass("ui-corner-tr"),r.removeClass("ui-corner-bottom").addClass("ui-corner-top")):(r.children(".wijmo-wijsuperpanel-vbar-buttontop").removeClass("ui-corner-tr").addClass("ui-corner-tl"),r.children(".wijmo-wijsuperpanel-vbar-buttonbottom").removeClass("ui-corner-br").addClass("ui-corner-bl"),r.removeClass("ui-corner-right").addClass("ui-corner-left"))):(r.css(b),i.css(y),l?(r.children(".wijmo-wijsuperpanel-hbar-buttonleft").removeClass("ui-corner-tl").addClass("ui-corner-bl"),r.children(".wijmo-wijsuperpanel-hbar-buttonright").removeClass("ui-corner-bl").addClass("ui-corner-br"),r.removeClass("ui-corner-top").addClass("ui-corner-bottom")):(r.children(".wijmo-wijsuperpanel-vbar-buttontop").removeClass("ui-corner-tl").addClass("ui-corner-tr"),r.chi
ldren(".wijmo-wijsuperpanel-vbar-buttonbottom").removeClass("ui-corner-bl").addClass("ui-corner-br"),r.removeClass("ui-corner-left").addClass("ui-corner-right"))),a=0,e&&(a=u[0][l?"offsetWidth":"offsetHeight"],s==="left"?r.css("right","0px"):s==="right"?r.css("left","0px"):s==="top"?r.css("bottom","0px"):s==="bottom"&&r.css("top","0px")),!l&&e&&(a=0),r[l?"width":"height"](w-k),t._enableDisableScrollBar(h,r,!c)):n.css(l?"left":"top","")},_testScroll:function(n,t,i){var u=t.templateWrapper,f=t.contentWrapper,l=t.stateContainer,v=f.innerWidth(),p=f.innerHeight(),b=t.contentWidth,w=t.contentHeight,r,e,c,o,h,a;t.hScrolling=b>v,t.vScrolling=w>p,r=n.hNeedScrollBar=n._needScrollbar(i.hScroller,t.hScrolling);if(n._crea
teBarIfNeeded(r,l,"h",s,f)===!1)return!1;r&&!t.vScrolling&&(u.css("float","left"),t.contentHeight=u.height(),t.vScrolling=t.contentHeight>p-t.hbarContainer[0].offsetHeight,u.css("float","")),e=n.vNeedScrollBar=n._needScrollbar(i.vScroller,t.vScrolling);if(n._createBarIfNeeded(e,l,"v",y,f)===!1)return!1;if(e&&!t.hScrolling){u.css("float","left"),t.contentWidth=u.width(),t.hScrolling=t.contentWidth>v-t.vbarContainer[0].offsetWidth,u.css("float","");if(t.hScrolling&&!r){r=n.hNeedScrollBar=n._needScrollbar(i.hScroller,t.hScrolling);if(n._createBarIfNeeded(r,l,"h",s,f)===!1)return!1}}c=t.hbarContainer,o=t.vbarContainer,h=i.hScroller.scrollBarPosition,a=i.vScroller.scrollBarPosition,n._setScrollbarPosition(u,n,f,c,o,r,e,h,a,"h",t.hScrolling),n._setScrollbarPosition(u,n,f,o,c,e,r,a,h,"v",t.vScrolling)},_enableDisableScrollBa
r:function(n,u,f){n==="v"?(u[f?"addClass":"removeClass"]("wijmo-wijsuperpanel-vbarcontainer-disabled"),u.find("."+r)[f?"addClass":"removeClass"](t)):n==="h"&&(u[f?"addClass":"removeClass"]("wijmo-wijsuperpanel-hbarcontainer-disabled"),u.find("."+r)[f?"addClass":"removeClass"](t)),u.children("."+i)[f?"hide":"show"]()},_initResizer:function(){var t=this,f=t.options,r=t._fields(),e=r.resizer,i,u;!e&&f.allowResize&&(i=f.resizableOptions,u=i.stop,i.stop=function(i){t._resizeStop(i,t),n.isFunction(u)&&u(i)},r.resizer=e=t.element.resizable(i)),!f.allowResize&&r.resizer&&(e.resizable("destroy"),r.resizer=null)},_resizeStop:function(n,t){this.options.autoRefresh||t.paintPanel(!0),t._trigger("resized")},_createAdditionalDom:function(t,i,r){r.attr("tabind
ex")||(r.attr("tabindex","-1"),i.tabindex=!0);var u=i.stateContainer=n(v),f;i.contentWrapper=u.children(),f=i.templateWrapper=i.contentWrapper.children(),r.contents().each(function(t,r){var u=n(r);if(u.hasClass("wijmo-wijsuperpanel-header")){i.header=u;return}if(u.hasClass("wijmo-wijsuperpanel-footer")){i.footer=u;return}f[0].appendChild(r)}),i.header!==undefined&&r.prepend(i.header),r[0].appendChild(u[0]),i.footer!==undefined&&i.footer.insertAfter(u)},_setRounder:function(t,i){if(this.options.showRounder){i.addClass(e);if(t._rounderAdded)return;if(n.browser.msie)return;var r,u,o,f;r=u="",n.browser.webkit?(u="WebkitBorderTopLeftRadius",r="WebkitBorderRadius"):n.browser.mozilla?(u="MozBorderRadiusBottomleft",r="MozBorderRadius"):(u="border-top-left-radius",r="border-radius"),o=i.css(u),f=parseInt(o,10),i.css(r,f+1),t._rounderAdded=!0,t._radiusKey=r}else i
.removeClass(e)},_setInnerElementsSize:function(n,t){var o=n.stateContainer,s=n.contentWrapper,e=0,i,u,f,r;n.header!==undefined&&(e+=n.header.outerHeight()),n.footer!==undefined&&(e+=n.footer.outerHeight()),i=o[0].style,u=t.innerHeight()-e,f=t.innerWidth(),i.display="none",i.height=u+"px",i.width=f+"px",r=s[0].style,r.height=u+"px",r.width=f+"px",i.display=""}})})(jQuery);var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype,n.prototype=new r},wijmo;(function(n){(function(t){var c,l,f,et,ut,yt;t.feature("core.basecelltype",["core.common","core.globalize","core.theme"]);var v=window.document,pt="position",wt="absolute",vt="margin",nt="font",ni="class",i="left",y="right",a="top",g="botto
m",tt="middle",w="center",d="gcUIElement",h="none",it="0",rt="#9fa9c5",at="#F6FAFB",ct="#D2DBEB",b=".gcEditingInput",dt="keydown"+b,ai="keyup"+b,si="paste"+b,ui="mousedown"+b,s="width",r="height",lt="padding",gt="padding-left",fi="padding-right",oi="padding-top",ei="padding-bottom",p="text-align",u="hidden",ri="visibility",o="word-wrap",e="overflow",k="normal",ft="break-word",ht="overflow-y",vi="resize",li="border",hi="outline",ci="box-shadow",ii="box-sizing",bt="autocomplete",ot="color",kt="border-width",st="background-color",ti="z-index";(function(n){n[n.BaseCellType=0]="BaseCellType",n[n.Text
CellType=1]="TextCellType",n[n.ColumnHeaderCellType=2]="ColumnHeaderCellType",n[n.RowHeaderCellType=3]="RowHeaderCellType",n[n.CornerCellType=4]="CornerCellType",n[n.CheckBoxCellType=5]="CheckBoxCellType",n[n.ButtonCellType=6]="ButtonCellType",n[n.ComboBoxCellType=7]="ComboBoxCellType",n[n.HyperLinkCellType=8]="HyperLinkCellType"})(t.CellTypeKind||(t.CellTypeKind={})),c=t.CellTypeKind,l=function(){function n(){}return n.prototype.paint=function(n,t,i,r,u,f,e,o){},n.prototype.createEditorElement=function(){return null},n.prototype._getLocator=function(){var n=v.createElement("span");return $(n).css(pt,wt),$(n).css(ri,u),$(n).css(st,"#68E"),$(n).css(vt,it),$(n).css(lt,"2px"),$(n).css(nt,"normal 12px Arial"),$(n).css(ot,"white"),$(n).css(kt,it),$(n).attr(ni,"gc-input-locator"),n.setAttribute(d,"gcEditingLocator"),n},n.prototype.getEditorV
alue=function(n){return null},n.prototype._formatEditorValue=function(n,t,i){return i},n.prototype.setEditorValue=function(n,t){},n.prototype.parse=function(n,i){if(i===undefined||i===null||n===undefined||n===null)return n===undefined||n===null?"":n.toString();else try{if(t.features.formatter){var r=new t.GeneralFormatter(i);return r.Parse(n)}else return n.toString()}catch(u){return n.toString()}},n.prototype.format=function(n,i,r){if(i===undefined||i===null||n===undefined||n===null){if(n===undefined||n===null)return"";if(typeof n=="boolean"||n instanceof Boolean)return n.toString().toUpperCase();else if(n instanceof Date)return new t._DateTimeHelper(n).localeFormat("M/d/yyyy h:mm:ss");return n.toString()}else try{if(t.features.formatter){var u=null;return u=i instanceof t.AutoFormatter||i instanceof t.GeneralFormatter?i:new t.GeneralFormatter(i),u.Format(n,r)}else return n.toString()}catch(f){return n.toString()}},n.prototype.focus=function(n
){n&&n.focus&&n.focus()},n.prototype.getThemeStyle=function(n){return t.Global.prototype.getWijmoThemeStyle(n)},n.prototype.activateEditor=function(n,t,i){},n.prototype.deactivateEditor=function(n){},n.prototype.selectAll=function(n){n&&n.select&&n.select()},n.prototype.updateEditor=function(n,t,i){},n.prototype._updateEditorLocator=function(n){var t,u,r;n&&n.sheet&&(t=n,u=t.sheet,u.isEditing()&&u.showEditingLocator&&t._editingLocator&&(r=t._editingLocator,$(r).css(a,parseInt($(t).css(a),10)-18),$(r).css(i,parseInt($(t).css(i),10))))},n.prototype.getHitInfo=function(n,t,i,r,u,f,e){return null},n.prototype.processMouseDown=function(n){return!1},n.prototype.processMouseMove=function(n){return!1},n.prototype.processMouseUp=function(n){return!1},n.prototype.processMouseEnter=function(n){},n.prototype.processMouseLeave=function(n){},n.prototype.isReservedKey=function(n){return!1},n.prototype.isEditingValueChanged=fun
ction(n,t){return n!==t},n.prototype._getAutoFitWidth=function(n,t,i,r,u){return 0},n.prototype._getAutoFitHeight=function(n,t,i,r){return 0},n.prototype.isImeAware=function(){return!1},n.prototype.toJSON=function(){return{type:c.BaseCellType}},n.prototype.fromJSON=function(n){},n}(),t.BaseCellType=l,f=function(f){function l(){f.call(this)}return __extends(l,f),l.prototype.paint=function(n,i,r,u,f,e,o,s){var it,rt,v;if(!n)return;n.save(),n.rect(r,u,f,e),n.clip(),n.beginPath(),o&&o.backColor?(n.fillStyle=o.backColor,n.fillRect(r,u,f,e)):t.util._useDoubleBuffer()||(o&&s.visualState===t.VisualState.Selected?(n.fillStyle="#9fa9c5",n.fillRect(r,u,f,e)):o&&s.visualState===t.VisualState.Active&&(n.fillStyle="#9fafc5",n.fillRect(r,u,f,e)));try{if(o&&o.backgroundImage&&o.backgroundImage!==h)if(s.imageLoader)if(s.imageLoader.getState(o.backgroundImage)){var ut=s.imageLoader.getImage(o.backgroundImage),c=ut.width,l=ut.height,c
t=0,ht=0,d=c,g=l,tt=f,nt=e,ft=r,et=u;if(o.backgroundImageLayout!==null&&o.backgroundImageLayout!==undefined)switch(o.backgroundImageLayout){case t.ImageLayout.Stretch:break;case t.ImageLayout.Center:d=f>=c?c:f,g=e>=l?l:e,ft=f>c&&c>0?r+f/2-c/2:r,et=e>l&&l>0?u+e/2-l/2:u,tt=d,nt=g;break;case t.ImageLayout.Zoom:e>0&&l>0&&f/e>c/l?(tt=c/l*e,ft=r+f/2-tt/2):f>0&&c>0&&e/f>l/c&&(nt=l/c*f,et=u+e/2-nt/2);break;case t.ImageLayout.None:d=f>=c?c:f,g=e>=l?l:e,tt=d,nt=g;break;default:break}n.drawImage(ut,ct,ht,d,g,ft,et,tt,nt)}else s.imageLoader.addImage(o.backgroundImage)}catch(lt){}var w=s.sheet,y=s.row,p=s.col;if(t.features.conditionalFormat&&w&&y!==null&&y!==undefined&&p!==null&&p!==undefined){it=w._conditionalFormats;if(it&&it.count()>0){var ot=it.getRules(y,p),st=ot.length,k=null,b=null,a=null;if(st>0){for(ot.sort(function(n,t){return n
.priority()-t.priority()}),rt=0;rt<st;rt++){v=ot[rt];if(v){v instanceof t.DataBarRule&&!k?k=v:v instanceof t.IconSetRule&&!b&&(b=v);if(v.stopIfTrue()){a=v.evaluate(w,y,p,i);if(a)break}}}k&&(a=k.evaluate(w,y,p,i),a&&(k._paintDataBar(n,a,r,u,f,e),this._showBarOnly=a.showBarOnly)),b&&(a=b.evaluate(w,y,p,i),a&&(b._paintIconSet(n,a,r,u,f,e,o,s.imageLoader),this._showIconOnly=a.showIconOnly))}}}t.features.sparkline&&s.sparkline&&s.sparkline.paintSparkline(n,r,u,f,e),s.cellOverflowLayout||this._showBarOnly||this._showIconOnly||this.paintValue(n,i,r,u,f,e,o,s),this._showBarOnly=!1,this._showIconOnly=!1,n.restore()},l.prototype.paintValue=function(n,r,u,f,e,o,s,h){var v,nt,c,it,rt,l,p,d,b,ut,k;if(!n)return;n.save(),h.cellOverflowLayout?(v=h.cellOverflowLayout.layout,v&&(n.rect(v.x,v.y,v.width,v.height),n.clip(),n.beginPath())):(n.rect(u,f,e-2,o),n.clip(),n.beginPath()),nt={value:null},c=this.format(r,s.formatt
er?s.formatter:s._autoFormatter,nt);if(c!==undefined&&c!==null&&c.length>0){s.foreColor&&(n.fillStyle=s.foreColor),nt.value&&(n.fillStyle=nt.value),s.font&&(n.font=s.font),it=0,s.textIndent>0&&(it=s.textIndent*8),rt=this._getHAlignByValueType(s.hAlign,r,c),l=2,l+=it,n.textAlign=i,rt===t.HorizontalAlign.center?(l=e/2,n.textAlign=w):rt===t.HorizontalAlign.right&&(l=e-3,l-=it,n.textAlign=y),p=c.split(/\r\n|\r|\n/),d=0,s.wordWrap&&p.length>1&&s.vAlign!==t.VerticalAlign.top&&(d=(p.length-1)*h.lineHeight),b=2,n.textBaseline=a,s.vAlign===t.VerticalAlign.center?(b=(o-d)/2,n.textBaseline=tt):s.vAlign===t.VerticalAlign.bottom&&(b=o-d-2,n.textBaseline=g);if(s.wordWrap)for(ut=f+b,k=0;k<p.length;k++)n.fillText(p[k],u+l,ut),ut+=h.lineHeight;else n.fillText(c,u+l,f+b)}n.restore()},l.prototype._getHAlignByValueType=function(n,i,r){return t.util.getHAlignByValueType(n,i)},l.prototype.createEditorEleme
nt=function(){var i=v.createElement("div"),t=$(i),n;return t.css(pt,wt),t.css(ti,"2000"),n=$("<textarea></textarea>"),n.css(vt,it),n.css(lt,"1px"),n.css(ii,"content-box"),n.css(nt,"normal 10pt Arial"),n.css(o,"normal"),n.css(e,u),n.css(vi,h),n.css(li,"2px #5292f7 solid"),n.css(hi,h),n.css(ci,"1px 2px 5px rgba(0,0,0,0.4)"),n.attr(bt,"off"),n.attr(d,"gcEditingInput"),t.append(n),i},l.prototype.getEditorValue=function(n){if(n&&n.children[0]){var t=n.children[0].value;if(t!==undefined&&t!==null&&t.length>0)return t}return null},l.prototype.setEditorValue=function(n,t){if(n&&n.children[0]){var i=n&&n.sheet&&n.sheet._startEditByKeydown?!0:!1;n.children[0].value=t===null||t===undefined||i?"":t}},l.prototype.focus=function(n){if(n&&n.children[0]){var t=n.children[0];t.focus(),t.selectionStart=t.value.le
ngth}},l.prototype._formatEditorValue=function(n,i,r){var o,e;if(n&&n.sheet){var f=n.sheet,s=f._activeRowIndex,h=f._activeColIndex,u=i.formatter?i.formatter:i._autoFormatter;if(t.features.formatter&&r!==null&&r!==undefined)if(u instanceof t.AutoFormatter&&u._innerFormatter instanceof t.GeneralFormatter)r=u._innerFormatter.GetPreferredEditingFormatter(r).Format(r);else{o=null,typeof u=="string"&&(o=u,u=new t.GeneralFormatter(u));if(u)try{e=u.GetFormatType(r),e===t.NumberFormatType.Number||e===t.NumberFormatType.Text?u=new t.GeneralFormatter("General"):e===t.NumberFormatType.DateTime&&o&&(u=r.getHours()===0&&r.getMinutes()===0&&r.getSeconds()===0&&r.getMilliseconds()===0?new t.GeneralFormatter("yyyy/mm/dd"):new t.GeneralFormatter("yyyy/mm/dd hh:mm:ss"),f._editingTimeValue=!0),r=u.Format(r)}catch(c){r=f.getText(s,h)}else r=f.getText(s,h)}}return r!==null&&r!==
undefined&&(r=t.util.toString(r)),r},l.prototype.activateEditor=function(n,r,u){var h,f,e,s,o;if(n&&n.sheet){h=$(n),f=n.sheet,this.isImeAware()&&f._eventHandler&&f._eventHandler._resetFocusHolder();var c=f._eventHandler._getCanvasOffset(),l=c.top+f._bounds.y+u.y-2,y=c.left+f._bounds.x+u.x-2;h.css(a,l),h.css(i,y),e=this,s=n.children[0],s&&(o=$(s),o.bind(dt,function(i){var c=i.keyCode===229||i.keyCode===0;c||e._isImeInputing||e._updateEditorImp(n,r,u,i);if(e._processEditingWrap(i))return;var l=s.selectionStart===0&&i.keyCode===t.Key.left&&!i.ctrlKey&&!i.shiftKey&&!i.altKey,o=s.selectionStart===s.value.length&&i.keyCode===t.Key.right&&!i.ctrlKey&&!i.shiftKey&&!i.altKey,h=s.selectionStart===s.selectionEnd;h&&(l||o)&&f._editorStatus===t.EditorStatus.Edit&&t.util.cancelDefault(i)}),o.bind(ai,function(i){(i.keyCode===t.Key.del||i.keyCode===t.Key.backspace||(i.keyC
ode===t.Key.z||i.keyCode===t.Key.y)&&i.ctrlKey&&!i.altKey)&&e._updateEditorImp(n,r,u,i),(i.keyCode!==t.Key.enter&&i.keyCode!==t.Key.tab||i.ctrlKey||i.altKey)&&f._trigger(t.Events.EditChange,{sheet:f,sheetName:f._name,row:f._activeRowIndex,col:f._activeColIndex,editingText:e.getEditorValue(n)})}),o.bind(si,function(t){e._pasteInputSizingToken=window.setTimeout(function(){e._updateEditorImp(n,r,u,t),e._pasteInputSizingToken&&(window.clearTimeout(e._pasteInputSizingToken),delete e._pasteInputSizingToken)},10)}),o.bind(ui,function(n){f._editorStatus===t.EditorStatus.Enter&&(f._editorStatus=t.EditorStatus.Edit,f._trigger(t.Events.EditorStatusChanged,{sheet:f,sheetName:f._name,oldStatus:t.EditorStatus.Enter,newStatus:t.EditorStatus.Edit}))}),o.bind("compositionstart",function(n){e._isImeInputing=!0,e._oldValueBeforeImeInputting=o.val()}),o.bind("compositionupdate",function(t){e._updateEditorImp(n,r,u,t?t.originalE
vent:null)}),o.bind("compositionend",function(t){e._updateEditorImp(n,r,u,t?t.originalEvent:null),e._isImeInputing=!1})),this.isImeAware()||v.body.insertBefore(n,null),this._isEditing=!0}},l.prototype.deactivateEditor=function(n){n&&(n.children[0]&&$(n.children[0]).unbind(b),n._editingLocator&&v.body.removeChild(n._editingLocator),this.isImeAware()?n.sheet&&n.sheet._eventHandler&&n.sheet._eventHandler._destroyFocusHolder():v.body.removeChild(n)),this._isEditing=!1},l.prototype.selectAll=function(n){if(n&&n.children[0]){var t=n.children[0];t.select&&t.select()}},l.prototype._updateEditorImp=function(n,f,h,c){var a,v,tt,vt,lt,rt,ut,wt,it,yt,ni,g,d,at,dt;if(n&&n.sheet&&n.children[0]){var pt=n,l=pt.children[0],b=pt.sheet;if(b.isEditing()){a=null,v=null,f&&(a=t.util.getHAlignByValueType(f.hAlign,pt._originalValue),a===t.HorizontalAlign.left?$(l).css(p,i):a===t.HorizontalAlign.center?$(l).css(p,w):a=
==t.HorizontalAlign.right?$(l).css(p,y):$(l).css(p,i),f.backColor&&$(l).css(st,f.backColor),f.foreColor&&$(l).css(ot,f.foreColor),v=f.font?f.font:b._render._getDefaultFont(),v&&(b._zoomFactor>1&&(v=b._render._getZoomFont(v)),$(l).css(nt,v)));if(h){$(pt).width(h.width).height(h.height);var et=b._getSheetLayout(),ct=1,bt=1;ct=ct+parseInt($(l).css(gt),10)+parseInt($(l).css(fi),10),bt=bt+parseInt($(l).css(oi),10)+parseInt($(l).css(ei),10),d=h.width,h.x+h.width>et.width&&(d=et.width-h.x),$(l).css(s,d-ct),$(l).css(r,h.height-bt),a===undefined||a===null||a===t.HorizontalAlign.left?l.maxWidth=et.width-h.x-ct:a===t.HorizontalAlign.center?l.maxWidth=Math.max(0,Math.min(et.width-h.x-h.width-ct,h.x-et.rowHeaderWidth-ct))*2+h.width:a===t.HorizontalAlign.right&&(l.maxWidth=h.x+h.width-et.rowHeaderWidth-ct),l.maxHeight=et.height-h.y-bt,l.minWidth=parseInt(l.style.width,10),l.minHeight=parseInt(l.style.height,10)}tt=l.value,v=l.style.font,v||(v=
b._render._getZoomFont(b._render._getDefaultFont())),vt=b._getFontHeight(v);if(c){if(b._eventHandler.allowEnterEditing(c)){var kt=l.selectionStart,ti=tt.substr(0,kt),ii=tt.substr(kt,tt.length-kt);tt=ti+String.fromCharCode(c.keyCode)+ii}this._isImeInputing&&(tt=$.browser.msie?$(l).val():this._oldValueBeforeImeInputting+c.data)}lt=tt.split(/\r\n|\r|\n/),l.maxWidth<l.minWidth&&(l.minWidth=l.maxWidth),l.maxHeight<l.minHeight&&(l.minHeight=l.maxHeight);if(f&&f.wordWrap||lt.length>0){for(it=0,yt=[],rt=0;rt<lt.length;rt++)ni=lt[rt],ut=b._getStringWidth(ni,v),yt.push(ut),it=Math.max(it,ut);g=lt.length*vt;if(it>l.minWidth){if(it>l.minWidth&&it<=l.maxWidth)$(l).css(s,it),$(l).css(o,k),$(l).css(e,u);else if(it>l.maxWidth)for($(l).css(s,l.maxWidth),$(l).css(o,ft),$(l).css(e,u),g=0,rt=0;rt<yt.length;rt++)ut=yt[rt],ut>l.maxWidth?ut>l.maxWidth&&(wt=Math.ceil(ut/l.maxWidth),g+=vt*wt):g+=vt}else $(l).css(s,l.minWidth),$
(l).css(o,k),$(l).css(e,u);g>l.minHeight?g>l.minHeight&&g<=l.maxHeight?$(l).css(r,g):g>l.maxHeight&&($(l).css(r,l.maxHeight),$(l).css(ht,"scroll")):$(l).css(r,l.minHeight)}else d=b._getStringWidth(tt,v),d>l.minWidth&&d<=l.maxWidth?($(l).css(s,d),$(l).css(r,l.minHeight),$(l).css(o,k),$(l).css(e,u)):d>l.minWidth?d>l.maxWidth&&($(l).css(s,l.maxWidth),$(l).css(o,ft),wt=Math.ceil(d/l.maxWidth),at=vt*wt,at>l.minHeight?at>l.maxHeight?at>l.maxHeight&&($(l).css(r,l.maxHeight),$(l).css(ht,"scroll")):($(l).css(r,at),$(l).css(e,u)):($(l).css(r,l.minHeight),$(l).css(e,u))):($(l).css(s,l.minWidth),$(l).css(r,l.minHeight),$(l).css(o,k),$(l).css(e,u));a=$(l).css(p),dt=$(l).width()-l.minWidth,a!==undefined&&a!==null&&a!==i&&(a===w?$(l).css(i,l.originalLeft-dt/2):a===y&&$(l).css(i,l.originalLeft-dt)),this._updateEditorLocator(n)}}},l.prototype.updateEditor=function(n,t,i){this.
_updateEditorImp(n,t,i,null)},l.prototype.isReservedKey=function(n){var r=n.srcElement||n.target,i;if(r&&this._isEditing){i=r.getAttribute(d);if(i==="gcEditingInput")return n.keyCode===t.Key.enter&&(n.ctrlKey||n.altKey)||n.keyCode===t.Key.z&&n.ctrlKey&&!n.altKey||n.keyCode===t.Key.y&&n.ctrlKey&&!n.altKey}return!1},l.prototype._processEditingWrap=function(i){var r=i.srcElement||i.target,h,u,s,e;if(r){h=r.getAttribute(d);if(h==="gcEditingInput")if(i.keyCode===t.Key.enter&&(i.ctrlKey||i.altKey)){var f=r.selectionStart,o=r.value,c=o.substr(0,f),l=o.substr(f,o.length-f);return r.value=c+"\n"+l,r.selectionStart=f+1,r.selectionEnd=f+1,u=window.gcGlobal.activeElement,s=n.spread,u instanceof s.Sheet&&(e=u.getCellType(u._activeRowIndex,u._activeColIndex),e&&e.updateEditor(u._editor,null,null)),t.util.cancelDefault(i),!0}}return!1},l.prototype._getAutoFitWidth=function(n,i,r,u,f){var e=0,s,o,c
,h;if(typeof r=="string"&&r!==""){if(u.wordWrap)for(s=r.split(/\r\n|\r|\n/),o=0;o<s.length;o++)e=Math.max(e,n._getStringWidth(s[o],u.font)/n._zoomFactor);else e=n._getStringWidth(r,u.font)/n._zoomFactor;u.hAlign!==t.HorizontalAlign.center&&u.textIndent>0&&(e+=u.textIndent*8/n._zoomFactor),f&&(c=n._zoomFactor>1?1:n._zoomFactor,h=parseInt((n.defaults.rowHeight*c).toString(),10),e+=h)}return e},l.prototype._getAutoFitHeight=function(n,t,i,r){var f=0,u,e;return typeof i=="string"&&i!==""&&(u=n._getFontHeight(r.font)/n._zoomFactor,r.wordWrap?(e=i.split(/\r\n|\r|\n/),f=e.length*u):f=u),f},l.prototype.isImeAware=function(){return!0},l.prototype.toJSON=function(){return{type:c.TextCellType}},l}(l),t.TextCellType=f,et=function(r){function u(){r.call(this)}return __extends(u,r),u.prototype.paint=function(r,u,f,e,o,s,c,l){var v,st,nt,p,d,yt,lt,vt,k,ft,b,ut,ot,it,ht,et;if(!r)return;r.save(),r.rect(f
,e,o,s),r.clip(),r.beginPath(),v=null;if(l&&l.visualState!==undefined)if(l.useWijmoTheme)try{v=this.getThemeStyle(l.visualState),v&&v.backgroundColor&&v.backgroundColor!==""?(r.fillStyle=v.backgroundColor,r.fillRect(f,e,o,s)):v&&v.backgroundImage&&v.backgroundImage!==h&&v.backgroundImage!==""&&(st=new Image,nt=v.backgroundImage,nt=nt.replace('url("',""),nt=nt.replace('")',""),st.src=nt,r.drawImage(st,f,e,o,s))}catch(pt){}else p=r.createLinearGradient(f+o/2,e,f+o/2,e+s),l.visualState===t.VisualState.Normal&&(c.backColor?r.fillStyle=c.backColor:(p.addColorStop(.125,at),p.addColorStop(1,ct),r.fillStyle=p)),l.visualState===t.VisualState.Highlight&&(p.addColorStop(.125,"#ffd45a"),p.addColorStop(1,"#ffef72"),r.fillStyle=p),l.visualState===t.VisualState.Selected&&(r.fillStyle=rt),l.visualState===t.VisualState.Hover&&(p.addColorStop(.1
25,"#ffe165"),p.addColorStop(1,"#fff9a3"),r.fillStyle=p),r.fillRect(f,e,o,s);d=l.sheet,yt=!!(d.rowFilter()&&d.rowFilter().isFilterHeader(l.row,l.col,n.spread.SheetArea.colHeader)),yt&&(lt=d._zoomFactor>1?1:d._zoomFactor,vt=parseInt((d.defaults.rowHeight*lt).toString(),10),o-=vt),k=this.format(u,c.formatter);if(k!==undefined&&k!==null&&k.length>0){l&&l.useWijmoTheme&&v?r.fillStyle=v.color:c.foreColor&&(r.fillStyle=c.foreColor),c.font&&(r.font=c.font),ft=0,c.textIndent>0&&(ft=c.textIndent*8),b=2,b+=ft,r.textAlign=i,c.hAlign===t.HorizontalAlign.center?(b=o/2,r.textAlign=w):c.hAlign===t.HorizontalAlign.right&&(b=o-1,b-=ft,r.textAlign=y),ut=k.split(/\r\n|\r|\n/),ot=0,c.wordWrap&&ut.length>1&&c.vAlign!==t.VerticalAlign.top&&(ot=(ut.length-1)*l.lineHeight),it=3,r.textBaseline=a,c.vAlign===t.VerticalAlign.center?(it=(s-ot)/2+1,r.textBaseline=tt):c.vAlign===
t.VerticalAlign.bottom&&(it=s-ot-1,r.textBaseline=g);if(c.wordWrap)for(ht=e+it,et=0;et<ut.length;et++)r.fillText(ut[et],f+b,ht),ht+=l.lineHeight;else r.fillText(k,f+b,e+it)}r.restore()},u.prototype.toJSON=function(){return{type:c.ColumnHeaderCellType}},u.prototype._getAutoFitWidth=function(n,t,i,r,u){return f.prototype._getAutoFitWidth.apply(this,[n,t,i,r,u])},u.prototype._getAutoFitHeight=function(n,t,i,r){return f.prototype._getAutoFitHeight.apply(this,[n,t,i,r])},u}(l),t.ColumnHeaderCellType=et,ut=function(n){function r(){n.call(this)}return __extends(r,n),r.prototype.paint=function(n,r,u,f,e,o,s,c){var l,et,b,p,ut,v,k,it,d,ft,nt;if(!n)return;n.save(),n.rect(u,f,e,o),n.clip(),n.beginPath(),l=null;if(c&&c.visualState!==undefined)if(c.useWijmoTheme)try{l=this.getThemeStyle(c.visualState),l&&l.backgroundColor&&l.backgroundColor!==""?(n.fillStyle=l.backgroundColor,n.fillRect(u,f,e,o)):l&&l.backgroundImage&&l.backgroundImage
!==h&&l.backgroundImage!==""&&(et=new Image,b=l.backgroundImage,b=b.replace('url("',""),b=b.replace('")',""),et.src=b,n.drawImage(et,u,f,e,o))}catch(ot){}else c.visualState===t.VisualState.Normal&&(n.fillStyle=s.backColor?s.backColor:"#E4ECF7"),c.visualState===t.VisualState.Highlight&&(n.fillStyle="#ffdc61"),c.visualState===t.VisualState.Selected&&(n.fillStyle=rt),c.visualState===t.VisualState.Hover&&(n.fillStyle="#fde47b"),n.fillRect(u,f,e,o);p=this.format(r,s.formatter);if(p!==undefined&&p!==null&&p.length>0){c&&c.useWijmoTheme&&l?n.fillStyle=l.color:s.foreColor&&(n.fillStyle=s.foreColor),s.font&&(n.font=s.font),ut=0,s.textIndent>0&&(ut=s.textIndent*8),v=2,v+=ut,n.textAlign=i,s.hAlign===t.HorizontalAlign.center?(v=e/2,n.textAlign=w):s.hAlign===t.HorizontalAlign.right&&(v=e-1,v-=ut,n.textAlign=y),
k=p.split(/\r\n|\r|\n/),it=0,s.wordWrap&&k.length>1&&s.vAlign!==t.VerticalAlign.top&&(it=(k.length-1)*c.lineHeight),d=3,n.textBaseline=a,s.vAlign===t.VerticalAlign.center?(d=(o-it)/2+1,n.textBaseline=tt):s.vAlign===t.VerticalAlign.bottom&&(d=o-it-1,n.textBaseline=g);if(s.wordWrap)for(ft=f+d,nt=0;nt<k.length;nt++)n.fillText(k[nt],u+v,ft),ft+=c.lineHeight;else n.fillText(p,u+v,f+d)}n.restore()},r.prototype.toJSON=function(){return{type:c.RowHeaderCellType}},r.prototype._getAutoFitWidth=function(n,t,i,r,u){return f.prototype._getAutoFitWidth.apply(this,[n,t,i,r,u])},r.prototype._getAutoFitHeight=function(n,t,i,r){return f.prototype._getAutoFitHeight.apply(this,[n,t,i,r])},r}(l),t.RowHeaderCellType=ut,yt=function(n){function i(){n.call(this)}return __extends(i,n),i.prototype.paint=function(n,i,r,u,f,e,o,s){var c,p,a,v,w,l,y;if(!n)return;n.save(),n.rect(r,u,f,e),n.clip(),n.beginPath();if(s&&s.visualState!==undefined){if(s.useWijmoTheme)try{c=
this.getThemeStyle(s.visualState),c&&c.backgroundColor&&c.backgroundColor!==""?(n.fillStyle=c.backgroundColor,n.fillRect(r,u,f,e)):c&&c.backgroundImage&&c.backgroundImage!==h&&(p=new Image,a=c.backgroundImage,a=a.replace('url("',""),a=a.replace('")',""),p.src=a,n.drawImage(p,r,u,f,e))}catch(b){}else s.visualState===t.VisualState.Normal&&(n.fillStyle="#A9C4E9"),s.visualState===t.VisualState.Selected&&(n.fillStyle=rt),s.visualState===t.VisualState.Hover&&(n.fillStyle="#a1b0c8"),n.fillRect(r,u,f,e);v=n.createLinearGradient(r+f/2,u,r+f/2,u+e),v.addColorStop(.125,at),s&&s.useWijmoTheme?(w=this.getThemeStyle(t.VisualState.Hover),v.addColorStop(1,w.backgroundColor)):v.addColorStop(1,ct),n.fillStyle=v,n.beginPath(),l=3,y=e,f<e&&(y=f),n.moveTo(r+f-y+l,u+e-l),n.lineTo(r+f-l,u+e-l),n.lineTo(r+f-l,u+e-y+l),n.fill()}n.restore()},i.prototype.toJSON=functio
n(){return{type:c.CornerCellType}},i.prototype._getAutoFitWidth=function(n,t,i,r,u){return f.prototype._getAutoFitWidth.apply(this,[n,t,i,r,u])},i.prototype._getAutoFitHeight=function(n,t,i,r){return f.prototype._getAutoFitHeight.apply(this,[n,t,i,r])},i}(l),t.CornerCellType=yt})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype,n.prototype=new r},wijmo;(function(n){(function(t){function r(n,t){for(var r,i=0;i<n.length;i++){r=n[i];if(t(r))return r}return null}var i,l,u,c,a,y,v,e,f,o,h,s;t.feature("core.sheet_model",["core.common","core.stringResource"]),i="undefined",l=function(n){function i(){n.call(this)}return __extends(i,n),i.prototype.find=function(n,t){for(var u=this.length,i,r=0;r<u;r++){i=this[r];if(i&&i.contains(n,t))return i}return null},i.prototype.remove
=function(n){for(var t=0;t<this.length;t++)if(this[t]===n){this.splice(t,1);return}},i.prototype.copy=function(n,i,r,u,f,e){var l=!1,a=this.length,o,c,s,h;if(n===-1){for(h=[],s=0;s<a;s++)o=this[s],i<=o.col&&o.col<i+e?(h.push(new t.Range(o.row,u+o.col-i,o.rowCount,o.colCount)),l=!0):u<=o.col&&o.col<u+e&&(this.splice(s,1),s--,a--,l=!0);for(s=0;s<h.length;s++){c=h[s];if(!this.isValid(this,0,this.length,c))throw new Error(t._StringResource.Exp_OverlappingSpans);this.push(c)}}else if(i===-1){for(h=[],s=0;s<a;s++)o=this[s],n<=o.row&&o.row<n+f?(h.push(new t.Range(r+o.row-n,o.col,o.rowCount,o.colCount)),l=!0):r<=o.row&&o.row<r+f&&(this.splice(s,1),s--,a--,l=!0);for(s=0;s<h.length;s++){c=h[s];if(!this.isValid(this,0,this.length,c))throw new Error(t._StringResource.Exp_OverlappingSpans);this.push(c)}}else{for(h=[],s=0;s<a;s++)o=this[s],n<=o.row&&o.row<n+f&&i<=o.col&&o.col
<i+e?(h.push(new t.Range(r+o.row-n,u+o.col-i,o.rowCount,o.colCount)),l=!0):r<=o.row&&o.row<r+f&&u<=o.col&&o.col<u+e&&(this.splice(s,1),s--,a--,l=!0);for(s=0;s<h.length;s++){c=h[s];if(!this.isValid(this,0,this.length,c))throw new Error(t._StringResource.Exp_OverlappingSpans);this.push(c)}}},i.prototype.isValid=function(n,t,i,r){for(var f,u=t;u<i&&u<n.length;u++){f=n[u];if(f.intersect(r.row,r.col,r.rowCount,r.colCount))return!1}return!0},i.prototype.getEnumerator=function(n,t,i,r){return new u(this,n,t,i,r)},i.prototype.clear=function(n,t,i,r){for(var u,f=0;f<this.length;f++)u=this[f],(n===-1||n<=u.row&&u.row<n+i)&&(t===-1||t<=u.col&&u.col<t+r)&&this.splice(f--,1)},i.prototype.move=function(n,r,u,f,e,o){var a=!1,l=new i,v=[],y=this.length,s,h,c;if(n===-1)for(h=0;h<y;h++)s=this[h],r<=s.col&&s.col<r+o?(c=new t.Range(s.row,f+s.col-r,s.rowCount,s.colCount),v.push
(c),a=!0):f<s.col&&s.col<f+o?a=!0:l.push(s);else if(r===-1)for(h=0;h<y;h++)s=this[h],n<=s.row&&s.row<n+e?(c=new t.Range(u+s.row-n,s.col,s.rowCount,s.colCount),v.push(c),a=!0):u<=s.row&&s.row<u+e?a=!0:l.push(s);else for(h=0;h<y;h++)s=this[h],n<=s.row&&s.row<n+e&&r<=s.col&&s.col<r+o?(c=new t.Range(u+s.row-n,f+s.col-r,s.rowCount,s.colCount),v.push(c),a=!0):u<=s.row&&s.row<u+e&&f<=s.col&&s.col<f+o?a=!0:l.push(s);if(a){if(v.length>0)for(h=0;h<v.length;h++){c=v[h];if(!this.isValid(l,0,l.length,c))throw new Error(t._StringResource.Exp_OverlappingSpans);l.push(c)}for(this.length=0,h=0;h<l.length;h++)this.push(l[h])}},i.prototype.isEmpty=function(){return this.length<=0?!0:!1},i.prototype.addRows=function(n,i){for(var f=!1,e=this.length,r,u=0;u<e;u++)r=this[u],r.row<n?r.row<n&&n<r.row+r.rowCount&&(this[u]=new t.Range(r.row,r.col,r.row
Count+i,r.colCount),f=!0):(this[u]=new t.Range(r.row+i,r.col,r.rowCount,r.colCount),f=!0)},i.prototype.addColumns=function(n,i){for(var f=!1,e=this.length,r,u=0;u<e;u++)r=this[u],r.col<n?r.col<n&&n<r.col+r.colCount&&(this[u]=new t.Range(r.row,r.col,r.rowCount,r.colCount+i),f=!0):(this[u]=new t.Range(r.row,r.col+i,r.rowCount,r.colCount),f=!0)},i.prototype.removeRows=function(n,i){for(var e=!1,f=[],s=this.length,r,o,u=0;u<s;u++)r=this[u],r.row<n?r.row<n&&n<r.row+r.rowCount&&(this[u]=new t.Range(r.row,r.col,r.rowCount-Math.min(r.row+r.rowCount-n,i),r.colCount),this[u].rowCount===1&&this[u].colCount===1&&f.push(u),e=!0):r.row<n+i?(f.push(u),e=!0):(this[u]=new t.Range(r.row-i,r.col,r.rowCount,r.colCount),e=!0);for(u=0;u<f.length;u++)o=f[u],this.splice(o,1)},i.prototype.removeColumns=function(n,i){for(var e=!1,f=[],s=this.length,r,o,u=0;u<s;u++)r=this[u],r.col<n?r.col<n&&n<r.col+r.colCount&am
p;&(this[u]=new t.Range(r.row,r.col,r.rowCount,r.colCount-Math.min(r.col+r.colCount-n,i)),this[u].rowCount===1&&this[u].colCount===1&&f.push(u),e=!0):r.col<n+i?(f.push(u),e=!0):(this[u]=new t.Range(r.row,r.col-i,r.rowCount,r.colCount),e=!0);for(u=0;u<f.length;u++)o=f[u],this.splice(o,1)},i.prototype.toJSON=function(){for(var t=[],n=0;n<this.length;n++)t.push(this[n]);return t},i.prototype.fromJSON=function(n){var u,r,i;if(!n)return;for(u=n,r=0;r<u.length;r++)i=u[r],this.push(new t.Range(i.row,i.col,i.rowCount,i.colCount))},i}(t._XArray),t._SpanModel=l,u=function(){function n(n,t,i,r,u){this.model=n,this.row=t,this.column=i,this.rowCount=r,this.columnCount=u,this.currentIndex=-1,t===-1&&i===-1&&(this.all=!0)}return n.prototype.current=function(){return 0<=this.currentIndex&&this.currentIndex<this.model.length?this.model[this.currentIndex]:null},n.prototype.moveNext=function(){this.currentIndex++;if(!this.all)while(this.cur
rentIndex<this.model.length&&!this.model[this.currentIndex].intersect(this.row,this.column,this.rowCount,this.columnCount))this.currentIndex++;return this.currentIndex<this.model.length},n.prototype.reset=function(){this.currentIndex=-1},n}(),t._SpanEnumerator=u,c=function(n){function t(){n.call(this)}return __extends(t,n),t.prototype.find=function(n){return r(this,function(t){return t.contains(n)})},t}(t._XArray),t._CellOverflowLayoutModel=c,a=function(){function n(n,t,i,r,u,f,e){this.column=n,this.startCol=t,this.endCol=i,this.columnWidth=u,this.hAlign=f,this.columnPrevWidth=e}return n.prototype.contains=function(n){return n>=this.startCol&&n<=this.endCol},n.prototype.equals=function(n){return n?this.column===n.column&&this.startCol===n.startCol&&this.endCol===n.endCol&&this.columnWidth===n.columnWidth&&this.hAlign===n.hAlign&&this.columnPrevWidth===n.columnPrevWidth:!1},n}(),t._CellOverflowLayout=a,y=function(n){
function t(){n.call(this)}return __extends(t,n),t.prototype.find=function(n){return r(this,function(t){return t.contains(n)})},t.prototype.contains=function(n){for(var t=0;t<this.length;t++)if(this[t].equals(n))return!0;return!1},t.prototype.add=function(n){this.contains(n)||this.push(n)},t}(t._XArray),t._CellOverflowValueLayoutModel=y,v=function(){function n(n,t,i,r,u,f,e,o,s){this.data=n,this.row=t,this.col=i,this.x=r,this.y=u,this.width=f,this.height=e,this.sheetArea=o,this.cellOverflowLayout=s}return n.prototype.contains=function(n){return n===this.cellOverflowLayout.column},n.prototype.equals=function(n){return n?this.data===n.data&&this.row===n.row&&this.col===n.col&&this.x===n.x&&this.y===n.y&&this.width===n.width&&this.height===n.height&&this.sheetArea===n.sheetArea&&this.cellOverflowLayout.equals(n.cellOverflowLayout):!1},n}(),t._CellOverflowValueLayout=v,e=function(n){function u(){n.call(this),this.selectio
nPolicy=t.SelectionPolicy.MultiRange,this.selectionUnit=t.SelectionUnit.Cell}return __extends(u,n),u.prototype.find=function(n,t){return r(this,function(i){return i.contains(n,t)})},u.prototype.clear=function(){this.splice(0,this.length),this.activeSelectedRangeIndex=-1},u.prototype.add=function(n,i,r,u){this.selectionPolicy===t.SelectionPolicy.Single?(r=Math.min(r,1),u=Math.min(u,1),this.clear()):this.selectionPolicy===t.SelectionPolicy.Range&&this.clear(),this.selectionUnit===t.SelectionUnit.Row?(i=-1,u=-1):this.selectionUnit===t.SelectionUnit.Column&&(n=-1,r=-1);var f=new t.Range(n,i,r,u);this.push(f),this.activeSelectedRangeIndex=this.length-1},u.prototype.toArray=function(){for(var t=[],n=0;n<this.length;n++)t.push(this[n]);return t},u.prototype.toJSON=function(){return this},u.prototype.fromJSON=function(n){var e,f,u,r;if(!n)return;for(e=n,f=n.length,u=0;u<f;u++)r=e[u],this.push(new t.Range(r.row,r.col,r.rowCount,r.colCount));typeof n.activeSelectedRangeI
ndex!==i&&(this.activeSelectedRangeIndex=n.activeSelectedRangeIndex),typeof n.selectionPolicy!==i&&(this.selectionPolicy=n.selectionPolicy),typeof n.selectionUnit!==i&&(this.selectionUnit=n.selectionUnit)},u}(t._XArray),t._SelectionModel=e,f=function(n){function t(){n.call(this)}return __extends(t,n),t.prototype.findCell=function(n,t){for(var u=this.length,r,i=0;i<u;i++){r=this[i];if(r.contains(n,t))return r}return null},t.prototype.findRow=function(n){return r(this,function(t){return t.row===n})},t.prototype.findCol=function(n){return r(this,function(t){return t.col===n})},t.prototype.findX=function(n){return r(this,function(t){return t.containsX(n)})},t.prototype.findY=function(n){return r(this,function(t){return t.containsY(n)})},t.prototype.findNearX=function(n){var t=null;return this.length>0&&(t=this.findX(n),t||(t=n<this[0].x?this[0]:this[this.length-1])),t},t.prototype.findNearY=function(n){var t=null;return this.length>0&&
(t=this.findY(n),t||(t=n<this[0].y?this[0]:this[this.length-1])),t},t}(t._XArray),t._LayoutModel=f,o=function(){function n(n,t,i,r,u,f,e,o){this.rowCount=e,this.colCount=o,this.row=n,this.col=t,this.x=i,this.y=r,this.width=u,this.height=f}return n.prototype.contains=function(n,t){return n<this.row+this.rowCount&&this.row<=n&&t<this.col+this.colCount&&this.col<=t},n.prototype.intersect=function(n){return(this.x<0||n.x<this.x+this.width&&this.x<n.x+n.width)&&(this.y<0||n.y<this.y+this.height&&this.y<n.y+n.height)},n.prototype.containsX=function(n){return this.x<=n&&n<this.x+this.width},n.prototype.containsY=function(n){return this.y<=n&&n<this.y+this.height},n}(),t._Layout=o,h=function(){function r(n,t,i){this.rowCount=n!==null&&n!==undefined?n:200,this.colCount=t!==null&&t!==undefined?t:20,this.name=i,this.dataTable={},this._rowDataArray=[],this._columnDataArra
y=[],this._defaultDataNode=null,this.dirtyNodes={}}return r.prototype.getRowCount=function(){return this.rowCount},r.prototype.getColumnCount=function(){return this.colCount},r.prototype._updateDirty=function(n,t){if(n>=0&&t>=0){var i=this.dataTable[n];i.rs!=="n"&&(i.rs="e"),this.dirtyNodes[n]=i}},r.prototype.getValue=function(n,t){var i=this.getNode(n,t);return i&&i.value!==undefined&&i.value!==null?i.value:null},r.prototype.setValue=function(n,t,i){var r=this.getNode(n,t,!0);r.value!==i&&(r.value=i,this._updateDirty(n,t))},r.prototype.getBindingPath=function(n,t){var i=this.getNode(n,t);return i&&i.bindingPath!==undefined&&i.bindingPath!==null?i.bindingPath:null},r.prototype.setBindingPath=function(n,t,i){var r=this.getNode(n,t,!0);r.bindingPath!==i&&(r.bindingPath=i,this._updateDirty(n,t))},r.prototype.getSparkline=function(n,t){var i=this.getNode(n,t);return i&&i.sparkline?i.sparkli
ne:null},r.prototype.setSparkline=function(n,t,i){var r=this.getNode(n,t,!0);r.sparkline!==i&&(r.sparkline=i,this._updateDirty(n,t))},r.prototype.setFormula=function(n,t,i){var r=this.getNode(n,t,!0);r.formula!==i&&(r.formula=i,this._updateDirty(n,t))},r.prototype.getFormula=function(n,t){var i=this.getNode(n,t);if(i)return i.formula},r.prototype.getStyle=function(n,t){var i=this.getNode(n,t);if(i)return i.style},r.prototype.setStyle=function(n,t,i){var r=this.getNode(n,t,!0);r&&r.style!==i&&(r.style=i,this._updateDirty(n,t))},r.prototype.getVisualState=function(n,t){var i=this.getNode(n,t);if(i)return i.visualState},r.prototype.setVisualState=function(n,t,i){var r=this.getNode(n,t,!0);r.visualState!==i&&(r.visualState=i,this._updateDirty(n,t))},r.prototype.addRows=function(n,t){if(n<0||n>this.rowCount||t<0)return;this.addElements(this.dataTable,this.rowCount,n,t),this.addElements(this._rowDataArray,this.rowCount,n,t),this.addElements
(this.dirtyNodes,this.rowCount,n,t),this.rowCount+=t;for(var i=0;i<t;i++)this.dataTable[n+i]={rs:"n"},this.dirtyNodes[n+i]=this.dataTable[n+i]},r.prototype.deleteRows=function(n,t){var i=this.rowCount;if(n<0||n>=i||t<=0)return;n+t>i&&(t=i-n),this.deleteElements(this.dataTable,i,n,t),this.deleteElements(this._rowDataArray,i,n,t),this.deleteElements(this.dirtyNodes,i,n,t),this.rowCount-=t},r.prototype.addElements=function(n,t,i,r){var u,f,o,e,s;if(0<=i&&i<t){u=[];for(f in n)!n.hasOwnProperty(f)||isNaN(f)||f<i||u.push(f);for(u.sort(function(n,t){return n-t}),o=0;o<u.length;o++)e=u[u.length-o-1],s=n[e],n[e]=null,n[parseInt(e,10)+r]=s}},r.prototype.deleteElements=function(n,t,i,r){var f,u,o,e,s;if(0<=i&&i<t){f=[];for(u in n)n.hasOwnProperty(u)&&!isNaN(u)&&(i<=u&&u<i+r?n[u]=null:u<i+r||f.push(u));for(f.sort(function(n,t){return n-t}),o=0;o<f.length;o++)e=f[o],s=n[e],n[e]=null,n[parseInt(
e,10)-r]=s}},r.prototype.addColumns=function(n,t){var i,r;if(n<0||n>this.colCount||t<0)return;for(i=0;i<this.rowCount;i++)r=this.dataTable[i],r&&n<this.colCount&&this.addElements(r,this.colCount,n,t);this.addElements(this._columnDataArray,this.colCount,n,t),this.colCount+=t},r.prototype.deleteColumns=function(n,t){var u=this.colCount,i,r;if(n<0||n>=u||t<0)return;for(i=0;i<this.rowCount;i++)r=this.dataTable[i],r&&n<this.colCount&&this.deleteElements(r,this.colCount,n,t);this.deleteElements(this._columnDataArray,this.colCount,n,t),n+t>u&&(t=u-n),this.colCount-=t},r.prototype.getNode=function(n,t,i){var r,u;return n>=this.rowCount||t>=this.colCount?null:(r=null,n<0||t<0?n!==-1||t<0?n<0||t!==-1?n===-1&&t===-1&&(r=this._defaultDataNode,!r&&i&&(r=this._defaultDataNode={})):(r=this._rowDataArray[n],!r&&i&&(r=this._rowDataArray[n]={})):(r=this._columnDat
aArray[t],!r&&i&&(r=this._columnDataArray[t]={})):(u=this.dataTable[n],!u&&i&&(u=this.dataTable[n]={}),u&&(r=u[t],!r&&i&&(r=u[t]={}))),r)},r.prototype._setNode4Swap=function(n,t,i,r,u){if(i<0||r<0)i<0||r!==-1||n<0||t!==-1?r<0||i!==-1||t<0||n!==-1||(this._columnDataArray[r]=u):this._rowDataArray[i]=u;else{var f=this.dataTable[i];f||(f=this.dataTable[i]={}),f[r]=u,u&&u.cellCalc&&delete u.cellCalc}},r.prototype.swapNode=function(n,t,i,r){var f=this.getNode(n,t),u=this.getNode(i,r);f?this._setNode4Swap(n,t,i,r,f):u&&this._setNode4Swap(n,t,i,r,null),u?this._setNode4Swap(i,r,n,t,u):f&&this._setNode4Swap(i,r,n,t,null)},r.prototype.getDataRowIndex=function(n){return n},r.prototype.nextNonNullRow=function(n){n++;while(n>=0&&n<this.rowCount){if(this.dataTable[n])break;n++}return n<this.rowCount?n:-1},r.prototype.nextNonNullColumn=function(n,t){var i=null;n>=0&&
n<this.rowCount&&this.dataTable[n]&&(i=this.dataTable[n]);if(!i)return-1;t++;while(t>=0&&t<this.colCount){if(i[t])break;t++}return t<this.colCount?t:-1},r.prototype.clear=function(n,i,r,u,f){var o=[],e,h,c,s;if(n<0||i<0)if(n<0||i!==-1)if(n!==-1||i<0)n===-1&&i===-1&&(e=this._defaultDataNode,e&&o.push(e));else{i+u>this.colCount&&(u=this.colCount-i);if(u<=0)return;for(h=i;h<i+u;h++)e=this.getNode(-1,h),e&&o.push(e)}else{n+r>this.rowCount&&(r=this.rowCount-n);if(r<=0)return;for(c=n;c<n+r;c++)e=this.getNode(c,-1),e&&o.push(e)}else{n+r>this.rowCount&&(r=this.rowCount-n);if(r<=0)return;i+u>this.colCount&&(u=this.colCount-i);if(u<=0)return;for(c=n;c<n+r;c++)for(h=i;h<i+u;h++)e=this.getNode(c,h),e&&o.push(e)}for(s=0;s<o.length;s++)o[s]&&((f&t.StorageType.Style)>0&&(o[s].style=null),(f&t.StorageType.Da
ta)>0&&(o[s].value=null,o[s].formula=null),(f&t.StorageType.Sparkline)>0&&(o[s].sparkline=null),(f&t.StorageType.BindingPath)>0&&(o[s].bindingPath=null))},r.prototype.toJSON=function(){var r={name:this.name,rowCount:this.rowCount,colCount:this.colCount},c={},n=this.nextNonNullRow(-1),e,i,s,h,u,o,f,t;while(n>=0){e=c[n]={},i=this.dataTable[n],i&&i.rs!==undefined&&i.rs!==null&&(e.rs=i.rs),t=this.nextNonNullColumn(n,-1);while(t>=0)s=this.getNode(n,t),s&&(e[t]=this._toJSONNode(s)),t=this.nextNonNullColumn(n,t);n=this.nextNonNullRow(n)}for(r.dataTable=c,h=[],u=this._rowDataArray,n=0;n<this.rowCount;n++)u.hasOwnProperty(n)&&u[n]&&(h[n]=this._toJSONNode(u[n]));for(r._rowDataArray=h,o=[],f=this._columnDataArray,t=0;t<this.colCount;t++)f.hasOwnProperty(t)&&f[t]&&(o[t]=this._toJSONNode(f[t]));return r._columnDataArray=o,r._defaultDataNode=this._toJSONNode(this._defaultDataNode),
r},r.prototype.fromJSON=function(n){var u,h,f,c,o,t,e,i,s;if(!n)return;u=n,this.name=u.name,this.rowCount=u.rowCount,this.colCount=u.colCount,h=u.dataTable;if(h){f=new r(this.rowCount,this.colCount),f.dataTable=h,t=f.nextNonNullRow(-1);while(t>=0){i=f.nextNonNullColumn(t,-1);while(i>=0)c=f.getNode(t,i),c&&this._copyFromJSONNode(t,i,c),i=f.nextNonNullColumn(t,i);t=f.nextNonNullRow(t)}}o=u._rowDataArray;if(o)for(t=0;t<this.rowCount;t++)o.hasOwnProperty(t)&&o[t]&&this._copyFromJSONNode(t,-1,o[t]);e=u._columnDataArray;if(e)for(i=0;i<this.colCount;i++)e.hasOwnProperty(i)&&e[i]&&this._copyFromJSONNode(-1,i,e[i]);s=u._defaultDataNode,s&&this._copyFromJSONNode(-1,-1,s)},r.prototype._getCellTypeKinds=function(){if(!this._dict){var i={},t=n.spread,r=t.CellTypeKind;i[r.BaseCellType]=t.BaseCellType,i[r.TextCellType]=t.TextCellType,i[r.ColumnHeaderCellType]=t.ColumnHeaderCellType,i[r.RowHeaderCellType]=t.RowHeaderCellType,i[r.CornerCell
Type]=t.CornerCellType,i[r.CheckBoxCellType]=t.CheckBoxCellType,i[r.ButtonCellType]=t.ButtonCellType,i[r.ComboBoxCellType]=t.ComboBoxCellType,i[r.HyperLinkCellType]=t.HyperLinkCellType,this._dict=i}return this._dict},r.prototype._toJSONNode=function(n){if(!n)return null;var i={};return n.value!==undefined&&n.value!==null&&(i.value=n.value),n.formula!==undefined&&n.formula!==null&&(i.formula=n.formula),n.style!==undefined&&n.style!==null&&(i.style=n.style,n.style.font!==undefined&&n.style.font!==null&&(i.style.font=t.StyleHelper.normalizeFont(n.style.font))),n.visualState!==undefined&&n.visualState!==null&&(i.visualState=n.visualState),n.bindingPath!==undefined&&n.bindingPath!==null&&(i.bindingPath=n.bindingPath),i},r.prototype._copyFromJSONNode=function(r,u,f){var s,o,l,e,a,h,v,c;if(!f)return;s=r,o=u,typeof f.value!==i&&(f.value!=null&&f.value.hasOwnProperty("_calcErr
or")&&(l=n.spread.Calc.CalcError._parseCore(f.value._calcError),l!==undefined&&(f.value=l)),this.setValue(s,o,f.value)),typeof f.formula!==i&&this.setFormula(s,o,f.formula),typeof f.style!==i&&(e=null,typeof f.style=="string"?e=f.style:f.style&&(e=new t.Style,e.copyFrom(f.style),typeof f.style.validator!==i&&(t.features.dataValidator&&(a=new n.spread.DefaultDataValidator,a.fromJSON(f.style.validator)),e.validator=a),typeof f.style.cellType!==i&&(v=this._getCellTypeKinds(),c=v[f.style.cellType.type],c&&(h=new c,h.fromJSON(f.style.cellType)),e.cellType=h)),this.setStyle(s,o,e)),typeof f.visualState!==i&&this.setVisualState(s,o,f.visualState),typeof f.bindingPath!==i&&this.setBindingPath(s,o,f.bindingPath)},r}(),t._GcSheetModel=h,s=function(){function n(n,t,i){this.changed=null,this._context=n,parseInt(t.toString(),10)<0&&(t=2147483647),this._maxLength=t,this._allowUndo=i,t
his._undoStack=[],this._redoStack=[]}return n.prototype.context=function(){return this._context},n.prototype.canUndo=function(){return this._undoStack.length>0},n.prototype.canRedo=function(){return this._redoStack.length>0},n.prototype._shrinkUndoStack=function(n){for(var t=0;t<n;t++)this._undoStack.shift()},n.prototype._raiseChanged=function(){this.changed&&typeof this.changed=="function"&&this.changed(this)},n.prototype.doAction=function(n){var i,t;if(!n||!n.execute)return!1;i=!0;try{n.execute(this._context)}catch(r){t=window.console,t&&t.error&&t.error("[action]: "+r),i=!1}return this._allowUndo&&i&&n.canUndo()&&n.undo&&(this._maxLength>0&&this._undoStack.length>=this._maxLength&&this._shrinkUndoStack(this._undoStack.length-this._maxLength+1),this._undoStack.push(n),this._redoStack=[],this._raiseChanged()),i},n.prototype.undo=function(){var t=!0,n;if(this._allowUndo
&&this.canUndo()){n=this._undoStack[this._undoStack.length-1];try{n&&n.canUndo&&n.canUndo()&&n.undo&&(t=n.undo(this._context))}catch(i){t=!1}t&&(this._redoStack.push(this._undoStack.pop()),this._raiseChanged())}return t},n.prototype.redo=function(){var t=!0,n;if(this._allowUndo&&this.canRedo()){n=this._redoStack[this._redoStack.length-1];try{n&&n.execute&&n.execute(this._context)}catch(i){t=!1}t&&(this._undoStack.push(this._redoStack.pop()),this._raiseChanged())}return t},n.prototype.getUndoList=function(){return this._undoStack.slice(0)},n.prototype.getRedoList=function(){return this._redoStack.slice(0)},n}(),t._UndoManager=s})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype,n.prototype=new r},wijmo;(function(n){(function(t){function u(n
,i){return n&&n._editorStatus!==t.EditorStatus.Edit?(n.moveActiveCell(i,!1),!0):!1}function r(n,i,r,u){n&&n._editorStatus!==t.EditorStatus.Edit&&n.moveActiveCell(i,!1,r,u)}function i(n,i,r){n&&n._editorStatus!==t.EditorStatus.Edit&&(n.endEdit(),n._changeActiveSelectedRange(i,r))}t.feature("core.sheet_action",["core.common","core.sheet_model"]);var f=function(){function f(){}return f.navigationLeft=function(){var n=u(this,t.Direction.left);return{processed:n}},f.navigationRight=function(){var n=u(this,t.Direction.right);return{processed:n}},f.navigationUp=function(){var n=u(this,t.Direction.up);return{processed:n}},f.navigationDown=function(){var n=u(this,t.Direction.down);return{processed:n}},f.commitInputNavigationDown=function(){var n=this;n.moveActiveCell(t.Direction.down,!1)},f.commitInputNavigationUp=function(){var n=this;n.moveActiveCell(t.Direction.up,!1)},f.navigationHome=function(){var n=this;r(n,t.Direct
ion.right,n._activeRowIndex,n.frozenColCount?n.frozenColCount-1:-1)},f.navigationHome2=function(){var n=this;r(n,t.Direction.right,n._activeRowIndex,-1)},f.navigationEnd=function(){var n=this;r(this,t.Direction.left,n._activeRowIndex,n.getColumnCount()-n._frozenTrailingColCount)},f.navigationEnd2=function(){var n=this;r(n,t.Direction.left,n._activeRowIndex,n.getColumnCount())},f.navigationTop=function(){var n=this;r(n,t.Direction.down,-1,n._activeColIndex)},f.navigationBottom=function(){var n=this;r(n,t.Direction.up,n.getRowCount(),n._activeColIndex)},f.navigationPageUp=function(){var n=this,i,f,r,u;if(n._editorStatus===t.EditorStatus.Edit)return;else n._editorStatus===t.EditorStatus.Enter&&n.endEdit();i=n._getPrevPageTopRow();if(i===null||i===n._scrollTopRow)return;f=n._getRowLayout(1,t.SheetArea.viewport),r=n._getNextVisualRow(n._activeRowIndex-f.length),r<i&&(r=i),n._setActiveCellCore(r,null),n._leadingCellRow=r,u=n.moveActiveCell(),u?n._setTopRow(i):n._setTopR
ow(i,!0)},f.navigationPageDown=function(){var n=this,i,f,r,u;if(n._editorStatus===t.EditorStatus.Edit)return;else n._editorStatus===t.EditorStatus.Enter&&n.endEdit();i=n._getNextPageTopRow();if(i===null||i===n._scrollTopRow)return;f=n._getRowLayout(1,t.SheetArea.viewport),r=n._getPrevVisualRow(n._activeRowIndex+f.length),r<i&&(r=i),n._setActiveCellCore(r,null),n._leadingCellRow=r,u=n.moveActiveCell(),u?n._setTopRow(i):n._setTopRow(i,!0)},f.navigationNextSheet=function(){var u=this,t=u.parent,f=n.spread,r,i;(t||t instanceof f.Spread)&&(r=t.getSheetCount(),i=t.getActiveSheetIndex(),i<r-1&&(i++,t.setActiveSheetIndex(i),t.repaint()))},f.navigationPreviousSheet=function(){var r=this,t=r.parent,u=n.spread,i;(t||t instanceof u.Spread)&&(i=t.getActiveSheetIndex(),i>0&&(i--,t.setActiveSheetIndex(i),t.repaint()))},f.navigationPrevious=function(){},f.navigationNext=function(){},f.navigationFirst=function(){var n=this,r,i;if(n._editorStat
us===t.EditorStatus.Edit)return;r=n.frozenColCount?n.frozenColCount-1:-1,i=n.frozenRowCount?n.frozenRowCount-1:-1,n.moveActiveCell(t.Direction.right,!1,n._activeRowIndex,r),n.moveActiveCell(t.Direction.down,!1,i,n._activeColIndex),(n._frozenTrailingRowCount>0||n._frozenTrailingColCount>0)&&(n.invalidateLayout(),n.repaint())},f.navigationLast=function(){var n=this;if(n._editorStatus===t.EditorStatus.Edit)return;n.moveActiveCell(t.Direction.left,!1,n._activeRowIndex,n.getColumnCount()-n._frozenTrailingColCount),n.moveActiveCell(t.Direction.up,!1,n.getRowCount()-n._frozenTrailingRowCount,n._activeColIndex),(n._frozenTrailingRowCount>0||n._frozenTrailingColCount>0)&&(n.invalidateLayout(),n.repaint())},f.commitInputNavigationTabNext=function(){var n=this;n._isNavigateInSelection?n._moveActiveCellInSelection(t.Direction.right):n.moveActiveCell(t.Direction.right,!0)},f.commitInputNavigationTabPrevious=function(){var n=this;n._isNavigateInSelection?n._moveActiveC
ellInSelection(t.Direction.left):n.moveActiveCell(t.Direction.left,!0)},f.cancelInput=function(){var n=this,i;n.isEditing()&&(i=n.getValue(n._activeRowIndex,n._activeColIndex,t.SheetArea.viewport),n.endEdit(!0),n.setValue(n._activeRowIndex,n._activeColIndex,i,t.SheetArea.viewport,!0))},f.clear=function(){var n=this,r,i,f,u;if(!n.isEditing()){for(r=n.getSelections(),i=0;i<r.length;i++)if(n.isProtected&&n._isAnyCellInRangeLocked(r[i]))return;f=r.toArray(),u=new t.UndoRedo.ClearValueUndoAction(this,f),u.canExecute(this)&&n._doCommand(u)}},f.clearAndEditing=function(){var t=!1,n=this;return n.isEditing()||(n.startEdit(!0,""),t=!0),{processed:t}},f.copy=function(){var n=this;n._doCopy()},f.cut=function(){var n=this;n._doCut()},f.paste=function(){var n=this;n._doPaste()},f.selectionLeft=function(){i(this,t.Key.left)},f.selectionRight=function(){i(this,t.Key.right)},f.selectionUp=function(){i(this,t.Key.up)},f.selectionDown=function(){i(this,t.Key.down)
},f.selectionHome=function(){i(this,t.Key.left,!0)},f.selectionEnd=function(){i(this,t.Key.right,!0)},f.selectionPageUp=function(){i(this,t.Key.pup)},f.selectionPageDown=function(){i(this,t.Key.pdn)},f.selectionTop=function(){i(this,t.Key.up,!0)},f.selectionBottom=function(){i(this,t.Key.down,!0)},f.selectionFirst=function(){i(this,t.Key.home,!0)},f.selectionLast=function(){i(this,t.Key.end,!0)},f.undo=function(){var t=this,n=t.undoManager();t.isProtected===!1&&n.canUndo()&&n.undo()},f.redo=function(){var t=this,n=t.undoManager();t.isProtected===!1&&n.canRedo()&&n.redo()},f}();t.SpreadActions=f})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={})),function(n){(function(n){(function(t){var f=function(){function n(n,t,i){this.row=n,this.column=t,this.value=i}return n}(),rt=function(){function n(){}return n.prototype.saveDefaultStyle=function(n){this._defaultStyle=n,this._defaultStyleSaved=!0},n.prototype.getDefaultStyle=function(){return this._
defaultStyle},n.prototype.saveDefaultColumnWidth=function(n){this._defaultColumnWidth=n,this._defaultColumnWidthSaved=!0},n.prototype.getDefaultColumnWidth=function(){return this._defaultColumnWidth},n.prototype.saveDefaultRowHeight=function(n){this._defaultRowHeight=n,this._defaultRowHeightSaved=!0},n.prototype.getDefaultRowHeight=function(){return this._defaultRowHeight},n.prototype.saveColumnHeaderDefaultStyle=function(n){this._columnHeaderDefaultStyle=n,this._columnHeaderDefaultStyleSaved=!0},n.prototype.getColumnHeaderDefaultStyle=function(){return this._columnHeaderDefaultStyle},n.prototype.saveColumnHeaderDefaultRowHeight=function(n){this._columnHeaderDefaultRowHeight=n,this._columnHeaderDefaultRowHeightSaved=!0},n.prototype.getColumnHeaderDefaultRowHeight=function(){return this._columnHeaderDefaultRowHeight},n.prototype.saveRowHeaderDefaultStyle=function(n){this._rowHeaderDefaultStyle=n,this._rowHeaderDefaultStyleSaved=!0},n.prototype.getRowHeaderDefaultStyle=function(){retu
rn this._rowHeaderDefaultStyle},n.prototype.saveRowHeaderDefaultColumnWidth=function(n){this._rowHeaderDefaultColumnWidth=n,this._rowHeaderDefaultColumnWidthSaved=!0},n.prototype.getRowHeaderDefaultColumnWidth=function(){return this._rowHeaderDefaultColumnWidth},n.prototype.isDefaultStyleSaved=function(){return this._defaultStyleSaved},n.prototype.isDefaultColumnWidthSaved=function(){return this._defaultColumnWidthSaved},n.prototype.isDefaultRowHeightSaved=function(){return this._defaultRowHeightSaved},n.prototype.isColumnHeaderDefaultStyleSaved=function(){return this._columnHeaderDefaultStyleSaved},n.prototype.isColumnHeaderDefaultRowHeightSaved=function(){return this._columnHeaderDefaultRowHeightSaved},n.prototype.isRowHeaderDefaultStyleSaved=function(){return this._rowHeaderDefaultStyleSaved},n.prototype.isRowHeaderDefaultColumnWidthSaved=function(){return this._rowHeaderDefaultColumnWidthSaved},n}(),u=function(){function n(n,t){this._rowCount=n,this._columnCount=t,this._init()}r
eturn n.prototype._init=function(){this._values=[],this._formulas=[],this._sparklines=[],this._styles=[],this._tags=[],this._bindingPaths=[],this._spans=null,this._arrayFormulas=null,this._valueSaved=!1,this._formulaSaved=!1,this._sparklineSaved=!1,this._styleSaved=!1,this._tagSaved=!1,this._spanSaved=!1,this._arrayFormulaSaved=!1,this._bindingPathSaved=!1},n.prototype.saveValue=function(n,t,i){i!==undefined&&i!==null&&this._values.push(new f(n,t,i)),this._valueSaved=!0},n.prototype.getValues=function(){return this._values},n.prototype.saveFormula=function(n,t,i){i&&i!==""&&this._formulas.push(new f(n,t,i)),this._formulaSaved=!0},n.prototype.getFormulas=function(){return this._formulas},n.prototype.saveArrayFormula=function(n){this._arrayFormulas=n,this._arrayFormulaSaved=!0},n.prototype.getArrayFormula=function(){return this._arrayFormulas},n.prototype.saveSparkline=function(n,t,i){i&&this._sparklines.push(new f(n,t,i)),this._sparkl
ineSaved=!0},n.prototype.getSparklines=function(){return this._sparklines},n.prototype.saveStyle=function(n,t,i){i&&this._styles.push(new f(n,t,i)),this._styleSaved=!0},n.prototype.getStyles=function(){return this._styles},n.prototype.saveTag=function(n,t,i){i!==undefined&&i!==null&&this._tags.push(new f(n,t,i)),this._tagSaved=!0},n.prototype.getTags=function(){return this._tags},n.prototype.saveBindingPath=function(n,t,i){i!==undefined&&i!==null&&this._bindingPaths.push(new f(n,t,i)),this._bindingPathSaved=!0},n.prototype.getBindingPaths=function(){return this._bindingPaths},n.prototype.saveSpan=function(n){this._spans||(this._spans=[]),this._spans.push(n),this._spanSaved=!0},n.prototype.isValueSaved=function(){return this._valueSaved},n.prototype.isFormulaSaved=function(){return this._formulaSaved},n.prototype.isArrayFormulaSaved=function(){return this._arrayFormulaSaved},n.prototype.isSparklineSaved=function(){return this._sparklineSaved},n
.prototype.isStyleSaved=function(){return this._styleSaved},n.prototype.isTagSaved=function(){return this._tagSaved},n.prototype.isSpanSaved=function(){return this._spanSaved},n.prototype.isBindingPathSaved=function(){return this._bindingPathSaved},n}(),o,e,i,r,ut,ft,nt,tt,it,ht,ct,lt,et,ot,st,g,p,y,a,v,k,d,c,h,s,w,l,b;t.CopyMoveCellsInfo=u,o=function(){function n(n){this._columnCount=n,this._init()}return n.prototype._init=function(){this._widths={},this._visibles={},this._resizables={},this._tags={},this._viewportColumnStyles={},this._headerColumnStyles={},this._levels={},this._collapsed={},this._bindingFields={},this._widthSaved=!1,this._visibleSaved=!1,this._resizableSaved=!1,this._tagSaved=!1,this._viewportColumnStyleSaved=!1,this._headerColumnStyleSaved=!1,this._rangeGroupSaved=!1,this._bindingFieldSaved=!1},n.prototype.saveWidth=function(n,t){this._widths[n]!==null?this._widths[n]=t<0?null:t:t<0||(this._widths[n]=t),this._widthSaved=!0},n.prototype.getWidth=function(n){
return this._widths[n]!==null?this._widths[n]:-1},n.prototype.saveVisible=function(n,t){this._visibles[n]!==null?this._visibles[n]=t?null:t:t||(this._visibles[n]=t),this._visibleSaved=!0},n.prototype.getVisible=function(n){return this._visibles[n]!==null?this._visibles[n]:!0},n.prototype.saveResizable=function(n,t){this._resizables[n]!==null?this._resizables[n]=t?null:t:t||(this._resizables[n]=t),this._resizableSaved=!0},n.prototype.getResizable=function(n){return this._resizables[n]!==null?this._resizables[n]:!0},n.prototype.saveTag=function(n,t){this._tags[n]!==null?this._tags[n]=t===undefined||t===null?null:t:t!==null&&(this._tags[n]=t),this._tagSaved=!0},n.prototype.getTag=function(n){return this._tags[n]!==null?this._tags[n]:null},n.prototype.saveViewportColumnStyle=function(n,t){this._viewportColumnStyles[n]?this._viewportColumnStyles[n]=t?t:null:t&&(this._viewportColumnStyles[n]=t),this._viewportColumnStyleSaved=!0},n.prototype.getViewportColumnStyle=function(
n){return this._viewportColumnStyles[n]?this._viewportColumnStyles[n]:null},n.prototype.saveHeaderColumnStyle=function(n,t){this._headerColumnStyles[n]?this._headerColumnStyles[n]=t?t:null:t&&(this._headerColumnStyles[n]=t),this._headerColumnStyleSaved=!0},n.prototype.getHeaderColumnStyle=function(n){return this._headerColumnStyles[n]?this._headerColumnStyles[n]:null},n.prototype.saveRangeGroup=function(n,t,i){this._levels[n]!==null?this._levels[n]=t<0?null:t:t<0||(this._levels[n]=t),this._collapsed[n]!==null?this._collapsed[n]=i?i:null:i&&(this._collapsed[n]=i),this._rangeGroupSaved=!0},n.prototype.getRangeGroup=function(n,t){t.level=-1,t.collapsed=!1,this._levels[n]!==null&&(t.level=this._levels[n]),this._collapsed[n]!==null&&(t.collapsed=this._collapsed[n])},n.prototype.saveBindingField=function(n,t){this._bindingFields[n]=t,this._bindingFieldSaved=!0},n.prototype.getBindingField=function(n,t){return t.fieldName=null,this._bindingFields[n]!==
null?(t.fieldName=this._bindingFields[n],!0):!1},n.prototype.isWidthSaved=function(){return this._widthSaved},n.prototype.isVisibleSaved=function(){return this._visibleSaved},n.prototype.isResizableSaved=function(){return this._resizableSaved},n.prototype.isTagSaved=function(){return this._tagSaved},n.prototype.isViewportColumnStyleSaved=function(){return this._viewportColumnStyleSaved},n.prototype.isHeaderColumnStyleSaved=function(){return this._headerColumnStyleSaved},n.prototype.isRangeGroupSaved=function(){return this._rangeGroupSaved},n.prototype.isBindingFieldSaved=function(){return this._bindingFieldSaved},n}(),e=function(){function n(n){this._rowCount=n,this._init()}return n.prototype._init=function(){this._heights={},this._visibles={},this._resizables={},this._tags={},this._viewportRowStyles={},this._headerRowStyles={},this._levels={},this._collapsed={},this._heightSaved=!1,this._visibleSaved=!1,this._resizableSaved=!1,this._tagSaved=!1,this._viewportRowStyleSaved=!1,this._
headerRowStyleSaved=!1,this._rangeGroupSaved=!1},n.prototype.saveHeight=function(n,t){this._heights[n]!==null?this._heights[n]=t<0?null:t:t<0||(this._heights[n]=t),this._heightSaved=!0},n.prototype.getHeight=function(n){return this._heights[n]!==null?this._heights[n]:-1},n.prototype.saveVisible=function(n,t){this._visibles[n]!==null?this._visibles[n]=t?null:t:t||(this._visibles[n]=t),this._visibleSaved=!0},n.prototype.getVisible=function(n){return this._visibles[n]!==null?this._visibles[n]:!0},n.prototype.saveResizable=function(n,t){this._resizables[n]!==null?this._resizables[n]=t?null:t:t||(this._resizables[n]=t),this._resizableSaved=!0},n.prototype.getResizable=function(n){return this._resizables[n]!==null?this._resizables[n]:!0},n.prototype.saveTag=function(n,t){this._tags[n]!==null?this._tags[n]=t===undefined||t===null?null:t:t!==null&&(this._tags[n]=t),this._tagSaved=!0},n.prototype.getTag=function(n){return this._tags[n]!==null?this._tags[n]:null},n.prototype.sav
eViewportRowStyle=function(n,t){this._viewportRowStyles[n]?this._viewportRowStyles[n]=t?t:null:t&&(this._viewportRowStyles[n]=t),this._viewportRowStyleSaved=!0},n.prototype.getViewportRowStyle=function(n){return this._viewportRowStyles[n]?this._viewportRowStyles[n]:null},n.prototype.saveHeaderRowStyle=function(n,t){this._headerRowStyles[n]?this._headerRowStyles[n]=t?t:null:t&&(this._headerRowStyles[n]=t),this._headerRowStyleSaved=!0},n.prototype.getHeaderRowStyle=function(n){return this._headerRowStyles[n]?this._headerRowStyles[n]:null},n.prototype.saveRangeGroup=function(n,t,i){this._levels[n]!==null?this._levels[n]=t<0?null:t:t<0||(this._levels[n]=t),this._collapsed[n]!==null?this._collapsed[n]=i?i:null:i&&(this._collapsed[n]=i),this._rangeGroupSaved=!0},n.prototype.getRangeGroup=function(n,t){t.level=-1,t.collapsed=!1,this._levels[n]!==null&&(t.level=this._levels[n]),this._collapsed[n]!==null&&(t.collapsed=this._collapsed[n])},n.proto
type.isHeightSaved=function(){return this._heightSaved},n.prototype.isVisibleSaved=function(){return this._visibleSaved},n.prototype.isResizableSaved=function(){return this._resizableSaved},n.prototype.isTagSaved=function(){return this._tagSaved},n.prototype.isViewportRowStyleSaved=function(){return this._viewportRowStyleSaved},n.prototype.isHeaderRowStyleSaved=function(){return this._headerRowStyleSaved},n.prototype.isRangeGroupSaved=function(){return this._rangeGroupSaved},n}(),t.CopyMoveRowsInfo=e,i=function(){function t(){}return t.getStyleObject=function(n,t,i,r){return n.getStyleObject(t,i,r)},t.setStyleObject=function(n,t,i,r,u){n.setStyleObject(t,i,u,r)},t.saveSheetInfo=function(t,i,r){(r&n.CopyToOption.Style)>0&&(i.saveDefaultStyle(t.getDefaultStyle()),i.saveColumnHeaderDefaultStyle(t.getDefaultStyle(n.SheetArea.colHeader)),i.saveRowHeaderDefaultStyle(t.getDefaultStyle(n.SheetArea.rowHeader))),i.saveDefaultColumnWidth(t.defaults.colWidth),i.saveDefaultRowHeig
ht(t.defaults.rowHeight),i.saveColumnHeaderDefaultRowHeight(t.defaults.rowHeight),i.saveRowHeaderDefaultColumnWidth(t.defaults.rowHeaderColWidth)},t.saveColumnHeaderInfo=function(i,r,u,f,e){for(var a=r._rowCount,h=r._columnCount,o,v,l,c,s=0;s<a;s++)for(o=0;o<h;o++)(e&n.CopyToOption.Value)>0&&(v=i._getModel(n.SheetArea.colHeader).getValue(s,f+o),r.saveValue(s,o,v)),(e&n.CopyToOption.Style)>0&&r.saveStyle(s,o,t.getStyleObject(i,s,f+o,n.SheetArea.colHeader));if((e&n.CopyToOption.Value)>0)for(o=0;o<h;o++)i.isColumnBound(f+o)&&u.saveBindingField(o,i.getDataColumnName(f+o));if((e&n.CopyToOption.Span)>0){l=i._colHeaderSpanModel.getEnumerator(0,f,a,h);while(l.moveNext())r.saveSpan(l.current())}for(h=u._columnCount,o=0;o<h;o++)u.saveWidth(o,i._getActualColumnWidth(f+o)),u.saveVisible(o,i.getColumnVisible(f+o)),u.saveResizable(o,i.getColumnResizable(f+o));if((e&n.CopyToOption.Style)>0)for(o=0;o<h;o++)u.saveViewportColum
nStyle(o,t.getStyleObject(i,-1,f+o,n.SheetArea.viewport)),u.saveHeaderColumnStyle(o,t.getStyleObject(i,-1,f+o,n.SheetArea.colHeader));if((e&n.CopyToOption.RangeGroup)>0){c=i.colRangeGroup;if(c&&!c._isEmpty())for(o=0;o<h;o++)u.saveRangeGroup(o,c.getLevel(f+o),c.getCollapsed(f+o))}},t.saveRowHeaderInfo=function(i,r,u,f,e){var h,a,o,s,v,l,c;if((e&n.CopyToOption.All)<=0)return;for(h=r._rowCount,a=r._columnCount,o=0;o<h;o++)for(s=0;s<a;s++)(e&n.CopyToOption.Value)>0&&(v=i._getModel(n.SheetArea.rowHeader).getValue(f+o,s),r.saveValue(o,s,v)),(e&n.CopyToOption.Style)>0&&r.saveStyle(o,s,t.getStyleObject(i,f+o,s,n.SheetArea.rowHeader));if((e&n.CopyToOption.Span)>0){l=i._rowHeaderSpanModel.getEnumerator(f,0,h,a);while(l.moveNext())r.saveSpan(l.current())}for(h=u._rowCount,o=0;o<h;o++)u.saveHeight(o,i._getActualRowHeight(f+o)),u.saveVisible(o,i.getRowVisible(f+o)),u.saveResizable(o,i.getRowResizable(f+o));if((e&n.CopyToO
ption.Style)>0)for(o=0;o<h;o++)u.saveViewportRowStyle(o,t.getStyleObject(i,f+o,-1,n.SheetArea.viewport)),u.saveHeaderRowStyle(o,t.getStyleObject(i,f+o,-1,n.SheetArea.rowHeader));if((e&n.CopyToOption.RangeGroup)>0){c=i.rowRangeGroup;if(c&&!c._isEmpty())for(o=0;o<h;o++)u.saveRangeGroup(o,c.getLevel(f+o),c.getCollapsed(f+o))}},t.saveViewportInfo=function(i,r,u,f,e){var c,l,s,o,v,a;if((e&n.CopyToOption.All)<=0)return;for(c=r._rowCount,l=r._columnCount,s=0;s<c;s++)for(o=0;o<l;o++){(e&n.CopyToOption.Value)>0&&r.saveValue(s,o,i.getValue(u+s,f+o,n.SheetArea.viewport)),((e&n.CopyToOption.Value)>0||(e&n.CopyToOption.Formula)>0)&&(r.saveFormula(s,o,i.getFormula(u+s,f+o)),v=i._getsArrayFormulas(u,f,c,l),r.saveArrayFormula(v));if((e&n.CopyToOption.Sparkline)>0){var h=i.getSparkline(u+s,f+o),y=null,p=null;h&&(y=h.data(),p=h.dateAxisData()),h&&y?r.saveSparkline(s,o,h.clone()):r.saveSparkline(s,o,null)}
(e&n.CopyToOption.Style)>0&&r.saveStyle(s,o,t.getStyleObject(i,u+s,f+o,n.SheetArea.viewport)),(e&n.CopyToOption.BindingPath)>0&&r.saveBindingPath(s,o,i.getBindingPath(u+s,f+o,n.SheetArea.viewport))}if((e&n.CopyToOption.Span)>0){a=i._spanModel.getEnumerator(u,f,c,l);while(a.moveNext())r.saveSpan(a.current())}},t.undoCellsInfo=function(i,r,u,f,e){var ut=r._rowCount,rt=r._columnCount,o,w,ct,c,k,a,p,y,it,tt,st,et,nt,v,s,ht,b,ot,g,h,l,d,ft;i.suspendCalcService();try{for(p=0;p<ut;p++)for(y=0;y<rt;y++)r.isBindingPathSaved()&&i.setBindingPath(u+p,f+y,null,e),r.isFormulaSaved()&&e===n.SheetArea.viewport&&i.setFormula(u+p,f+y,null),r.isSparklineSaved()&&e===n.SheetArea.viewport&&i.removeSparkline(u+p,f+y),r.isValueSaved()&&i.setValue(u+p,f+y,null,e),r.isStyleSaved()&&t.setStyleObject(i,u+p,f+y,e,null);if(r.isBindingPathSaved())for(it=r.getBindingPaths(),o=0;o<it.length;o++)tt=it[o],i.setBindi
ngPath(u+tt.row,f+tt.column,tt.value,e);if(r.isFormulaSaved()&&e===n.SheetArea.viewport)for(st=r.getFormulas(),o=0;o<st.length;o++)c=st[o],i.setFormula(u+c.row,f+c.column,c.value);if(r.isSparklineSaved()&&e===n.SheetArea.viewport)for(et=r.getSparklines(),nt=0;nt<et.length;nt++)v=et[nt],s=v.value,s?s.dateAxisData()?i.setSparkline(u+v.row,f+v.column,s.data(),s.dataOrientation(),s.sparklineType(),s.setting(),s.dateAxisData(),s.dateAxisOrientation()):i.setSparkline(u+v.row,f+v.column,s.data(),s.dataOrientation(),s.sparklineType(),s.setting()):i.removeSparkline(u+v.row,f+v.column);if(r.isValueSaved())for(ht=r.getValues(),o=0;o<ht.length;o++)b=ht[o],i.setValue(u+b.row,f+b.column,b.value,e);if(r.isStyleSaved())for(ot=r.getStyles(),o=0;o<ot.length;o++)g=ot[o],t.setStyleObject(i,u+g.row,f+g.column,e,g.value);if(r.isArrayFormulaSaved()&&e===n.SheetArea.viewport){h=i._getsArrayFormulas(u,f,ut,rt);if(h&&h.length>0)for(k=h.getLength(0),a=0;a<k;a+
+)ct=h[a][0];h=r.getArrayFormula();if(h&&h.length>0)for(k=h.getLength(0),a=0;a<k;a++)ct=h[a][0],c=h[a][1],c.StartsWith("{")&&c.EndsWith("}")&&(c=c.substring(1,c.length-2))}}finally{i.resumeCalcService()}l=null,e===n.SheetArea.viewport?l=i._spanModel:e===n.SheetArea.colHeader?l=i._colHeaderSpanModel:e===n.SheetArea.rowHeader&&(l=i._rowHeaderSpanModel);if(l&&l.length>0){d=[],ft=l.getEnumerator(u,f,ut,rt);while(ft.moveNext())w=ft.current(),w&&d.push(w);for(o=0;o<d.length;o++)w=d[o],l.remove(w)}if(r.isSpanSaved())if(l)for(o=0;o<r._spans.length;o++)w=r._spans[o],l.push(w)},t.undoColumnsInfo=function(i,r,u){var e=r._columnCount,f,h,o,s;if(r.isBindingFieldSaved())for(h={fieldName:null},f=0;f<e;f++)r.getBindingField(f,h)&&i.bindColumn(u+f,h.fieldName);if(r.isWidthSaved())for(f=0;f<e;f++)i.setColumnWidth(u+f,r.getWidth(f),n.SheetArea.viewport);if(r.isVisibleSaved())for(f=0;f<e;f++)i.setColumnV
isible(u+f,r.getVisible(f),n.SheetArea.viewport);if(r.isResizableSaved())for(f=0;f<e;f++)i.setColumnResizable(u+f,r.getResizable(f),n.SheetArea.viewport);if(r.isViewportColumnStyleSaved())for(f=0;f<e;f++)t.setStyleObject(i,-1,u+f,n.SheetArea.viewport,r.getViewportColumnStyle(f));if(r.isHeaderColumnStyleSaved())for(f=0;f<e;f++)t.setStyleObject(i,-1,u+f,n.SheetArea.colHeader,r.getHeaderColumnStyle(f));if(r.isRangeGroupSaved()){o=i.colRangeGroup;if(o)for(s={level:null,collapsed:null},f=0;f<e;f++)r.getRangeGroup(f,s),o._setLevel(u+f,s.level),o.setCollapsed(u+f,s.collapsed)}},t.undoRowsInfo=function(i,r,u){var e=r._rowCount,f,s,o;if(r.isHeightSaved())for(f=0;f<e;f++)i.setRowHeight(u+f,r.getHeight(f),n.SheetArea.viewport);if(r.isVisibleSaved())for(f=0;f<e;f++)i.setRowVisible(u+f,r.getVisible(f),n.SheetArea.viewport);if(r.isResizableSaved())for(f=0;f<e;f++)i.setRowResizable(u+f,r.getResizable(f),n.SheetArea.viewport);if(r.isViewportRowStyleSaved())for(f=0;f<e;f++)t.
setStyleObject(i,u+f,-1,n.SheetArea.viewport,r.getViewportRowStyle(f));if(r.isHeaderRowStyleSaved())for(f=0;f<e;f++)t.setStyleObject(i,u+f,-1,n.SheetArea.rowHeader,r.getHeaderRowStyle(f));if(r.isRangeGroupSaved()){s=i.rowRangeGroup;if(s)for(o={level:null,collapsed:null},f=0;f<e;f++)r.getRangeGroup(f,o),s._setLevel(u+f,o.level),s.setCollapsed(u+f,o.collapsed)}},t.undoSheetInfo=function(t,i){i.isDefaultStyleSaved()&&t.setDefaultStyle(i.getDefaultStyle()),i.isDefaultColumnWidthSaved()&&(t.defaults.colWidth=i.getDefaultColumnWidth()),i.isDefaultRowHeightSaved()&&(t.defaults.rowHeight=i.getDefaultRowHeight()),i.isColumnHeaderDefaultStyleSaved()&&t.setDefaultStyle(i.getColumnHeaderDefaultStyle(),n.SheetArea.colHeader),i.isColumnHeaderDefaultRowHeightSaved()&&(t.defaults.rowHeight=i.getColumnHeaderDefaultRowHeight()),i.isRowHeaderDefaultStyleSaved()&&t.setDefaultStyle(i.getRowHeaderDefaultStyle(),n.SheetArea.rowHeader),i.isRowHeaderDefa
ultColumnWidthSaved()&&(t.defaults.rowHeaderColWidth=i.getRowHeaderDefaultColumnWidth())},t.getValues=function(n,t,i,r,u){var h,o,e,s;for(t<0&&(t=0,r=n.getRowCount()),i<0&&(i=0,u=n.getColumnCount()),h=[],o=0;o<r;o++)for(e=0;e<u;e++)s=n.getValue(t+o,i+e),s!==undefined&&s!==null&&h.push(new f(o,e,s));return h},t.raiseRangeDataChanged=function(n,t,i,r,u,f){if(!n)return;t<0&&(t=0,r=n.getRowCount()),i<0&&(i=0,u=n.getColumnCount()),n._raiseRangeDataChanged(t,i,r,u)},t.convertToKey=function(n,t){var i=0;return i=n,i<<=32,i|=t},t.remove=function(n,t,i){var f=null,u=-1,e=n.length,r;if(e>0)for(r=0;r<e;r++)if(n[r].row===t&&n[r].column===i){u=r;break}return u!==-1&&(f=n[u],n.splice(u,1)),f},t}(),t.CopyMoveHelper=i,r=function(){function n(){this.canExecuteChanged=null}return n.prototype.execute=function(n){},n.prototype.canExecute=function(n){return!0},n.prototype.canUndo=function(){return!0},n.
prototype.saveState=function(){},n.prototype.undo=function(n){return!0},n.prototype._raiseCanExecuteChanged=function(){this.canExecuteChanged&&typeof this.canExecuteChanged=="function"&&this.canExecuteChanged(this)},n.prototype._suspendInvalidate=function(n){n&&n._suspendInvalidate&&n._suspendInvalidate()},n.prototype._resumeInvalidate=function(n){n&&n._resumeInvalidate&&n._resumeInvalidate()},n}(),t.ActionBase=r,ut=function(t){function i(n,i,r,u){t.call(this),this._sheet=n,this._columns=i,this._size=r,this._rowHeader=u,this._oldSizes=[],this._oldVisibles=[]}return __extends(i,t),i.prototype.canExecute=function(n){return!0},i.prototype.execute=function(t){var i=this._sheet,c,s,u,f,o,h,r;if(i&&this._columns&&this._columns.length>0){this._suspendInvalidate(t),c=this._getColumnsReiszed(this._columns),s={sheet:i,sheetName:i._name,colList:c,header:this._rowHeader,cancel:!1},i._trigger(n.Events.ColumnWidthChangin
g,s);if(s&&s.cancel===!0){this._canUndo=!1,this._resumeInvalidate(t);return}else this._canUndo=!0;this.saveState();var a=this._rowHeader?i.getColumnCount(n.SheetArea.rowHeader):i.getColumnCount(n.SheetArea.viewport),e=i._scrollLeftCol,l=e;for(u=e-1;u>=i.frozenColCount;u--){if(i.getColumnVisible(u)&&i._getZoomColumnWidth(u)>0)break;i.getColumnResizable(u)&&(l=u)}for(f=Number.MAX_VALUE,o=0;o<this._columns.length;o++)for(h=this._columns[o],r=h.firstCol;r<=h.lastCol;r++)0<=r&&r<a&&(this._rowHeader&&i.getColumnResizable(r,n.SheetArea.rowHeader)&&this._size!==i.getColumnWidth(r,n.SheetArea.rowHeader)?i.setColumnWidth(r,this._size,n.SheetArea.rowHeader):i.getColumnResizable(r,n.SheetArea.viewport)&&this._size!==i.getColumnWidth(r,n.SheetArea.viewport)&&i.setColumnWidth(r,this._size,n.SheetArea.viewport),f=Math.min(r,f));f===Number.MAX_VALUE||f>e||l===e||(i._scrollLeftCol=l),this._resumeInvalidate(t
),i.invalidateLayout(),i.repaint(),i._trigger(n.Events.ColumnWidthChanged,{sheet:i,sheetName:i._name,colList:c,header:this._rowHeader}),i._syncHScollbarPosition()}},i.prototype.saveState=function(){var e=null,f=null,u=this._sheet,o,r,i,t;if(u&&this._columns&&this._columns.length>0)for(o=this._rowHeader?u.getColumnCount(n.SheetArea.rowHeader):u.getColumnCount(n.SheetArea.viewport),e=[this._columns.length],f=[this._columns.length],r=0;r<this._columns.length;r++)for(i=this._columns[r],e[r]=[i.lastCol-i.firstCol+1],f[r]=[i.lastCol-i.firstCol+1],t=i.firstCol;t<=i.lastCol;t++)0<=t&&t<o?(e[r][t-i.firstCol]=this._rowHeader?u.getColumnWidth(t,n.SheetArea.rowHeader):u.getColumnWidth(t,n.SheetArea.viewport),f[r][t-i.firstCol]=this._rowHeader?u.getColumnVisible(t,n.SheetArea.rowHeader):u.getColumnVisible(t,n.SheetArea.viewport)):(e[r][t-i.firstCol]=-1,f[r][t-i.firstCol]=!1);this._oldSizes=e,this._oldVisibles=f},i.prototype.undo=function(t){var o=!1,i=this.
_sheet,c,h,l,s,e,u,f,r;if(i&&this._columns&&this._columns.length>0){this._suspendInvalidate(t),c=this._getColumnsReiszed(this._columns),h={sheet:i,sheetName:i._name,colList:c,header:this._rowHeader,cancel:!1},i._trigger(n.Events.ColumnWidthChanging,h);if(h&&h.cancel===!0)return this._resumeInvalidate(t),!1;for(l=this._rowHeader?i.getColumnCount(n.SheetArea.rowHeader):i.getColumnCount(n.SheetArea.viewport),u=0;u<this._columns.length;u++)for(f=this._columns[u],r=f.firstCol;r<=f.lastCol;r++)s=this._oldSizes[u][r-f.firstCol],e=this._oldVisibles[u][r-f.firstCol],0<=r&&r<l&&s!==-1&&(this._rowHeader&&i.getColumnResizable(r,n.SheetArea.rowHeader)?(i.setColumnWidth(r,s,n.SheetArea.rowHeader),o=!0):i.getColumnResizable(r,n.SheetArea.viewport)&&(i.setColumnWidth(r,s,n.SheetArea.viewport),o=!0),this._rowHeader&&i.getColumnVisible(r,n.SheetArea.rowHeader)!==e?(i.setColumnVisible(r,e,n.SheetArea.rowHeader),o=!0
):i.getColumnVisible(r,n.SheetArea.viewport)!==e&&(i.setColumnVisible(r,e,n.SheetArea.viewport),o=!0));this._resumeInvalidate(t),i.invalidateLayout(),i.repaint(),i._trigger(n.Events.ColumnWidthChanged,{sheet:i,sheetName:i._name,colList:c,header:this._rowHeader})}return o},i.prototype._getColumnsReiszed=function(n){for(var u=[],r,t,i=0;i<n.length;i++)for(r=n[i],t=r.firstCol;t<=r.lastCol;t++)u.push(t);return u},i.prototype.canUndo=function(){return this._canUndo},i}(r),t.ColumnResizeUndoAction=ut,ft=function(t){function i(n,i,r,u){t.call(this),this._sheet=n,this._rows=i,this._size=r,this._columnHeader=u,this._oldSizes=[],this._oldVisibles=[]}return __extends(i,t),i.prototype.canExecute=function(n){return!0},i.prototype.execute=function(t){var i=this._sheet,c,s,u,f,o,h,r;if(i&&this._rows&&this._rows.length>0){this._suspendInvalidate(t),c=this._getRowsReiszed(this._rows),s={sheet:i,sheetName:i._name,rowList:c,header:this._columnHeader,cancel:!1},i._trigg
er(n.Events.RowHeightChanging,s);if(s&&s.cancel===!0){this._canUndo=!1,this._resumeInvalidate(t);return}else this._canUndo=!0;this.saveState();var a=this._columnHeader?i.getRowCount(n.SheetArea.colHeader):i.getRowCount(n.SheetArea.viewport),e=i._scrollTopRow,l=e;for(u=e-1;u>=i.frozenRowCount;u--){if(i.getRowVisible(u)&&i._getZoomRowHeight(u)>0)break;i.getRowResizable(u)&&(l=u)}for(f=Number.MAX_VALUE,o=0;o<this._rows.length;o++)for(h=this._rows[o],r=h.firstRow;r<=h.lastRow;r++)0<=r&&r<a&&(this._columnHeader&&i.getRowResizable(r,n.SheetArea.colHeader)&&this._size!==i.getRowHeight(r,n.SheetArea.colHeader)?i.setRowHeight(r,this._size,n.SheetArea.colHeader):i.getRowResizable(r,n.SheetArea.viewport)&&this._size!==i.getRowHeight(r,n.SheetArea.viewport)&&(i.setRowHeight(r,this._size,n.SheetArea.viewport),i.rowFilter()&&i.rowFilter()._addRowFilteredIn(r)),f=Math.min(r,f));f===Number.MAX_VALUE||f
>e||l===e||(i._scrollTopRow=l),this._resumeInvalidate(t),i.invalidateLayout(),i.repaint(),i._trigger(n.Events.RowHeightChanged,{sheet:i,sheetName:i._name,rowList:c,header:this._columnHeader}),i._syncVScrollbarPosition()}},i.prototype.saveState=function(){var e=null,f=null,u=this._sheet,o,r,i,t;if(u&&this._rows&&this._rows.length>0)for(o=this._columnHeader?u.getRowCount(n.SheetArea.colHeader):u.getRowCount(n.SheetArea.viewport),e=[this._rows.length],f=[this._rows.length],r=0;r<this._rows.length;r++)for(i=this._rows[r],e[r]=[i.lastRow-i.firstRow+1],f[r]=[i.lastRow-i.firstRow+1],t=i.firstRow;t<=i.lastRow;t++)0<=t&&t<o?(e[r][t-i.firstRow]=this._columnHeader?u.getRowHeight(t,n.SheetArea.colHeader):u.getRowHeight(t,n.SheetArea.viewport),f[r][t-i.firstRow]=this._columnHeader?u.getRowVisible(t,n.SheetArea.colHeader):u.getRowVisible(t,n.SheetArea.viewport)):(e[r][t-i.firstRow]=-1,f[r][t-i.firstRow]=!1);this._oldVisibles=f,this._oldSizes=e},i.prototyp
e.undo=function(t){var o=!1,i=this._sheet,c,h,l,s,e,u,f,r;if(i&&this._rows&&this._rows.length>0){this._suspendInvalidate(t),c=this._getRowsReiszed(this._rows),h={sheet:i,sheetName:i._name,rowList:c,header:this._columnHeader,cancel:!1},i._trigger(n.Events.RowHeightChanging,h);if(h&&h.cancel===!0)return this._resumeInvalidate(t),!1;for(l=this._columnHeader?i.getRowCount(n.SheetArea.colHeader):i.getRowCount(n.SheetArea.viewport),u=0;u<this._rows.length;u++)for(f=this._rows[u],r=f.firstRow;r<=f.lastRow;r++)s=this._oldSizes[u][r-f.firstRow],e=this._oldVisibles[u][r-f.firstRow],0<=r&&r<l&&s!==-1&&(this._columnHeader&&i.getRowResizable(r,n.SheetArea.colHeader)?(i.setRowHeight(r,s,n.SheetArea.colHeader),o=!0):i.getRowResizable(r,n.SheetArea.viewport)&&(i.setRowHeight(r,s,n.SheetArea.viewport),o=!0),this._columnHeader&&i.getRowVisible(r,n.SheetArea.colHeader)!==e?(i.setRowVisible(r,e,n.SheetArea.colHeader)
,o=!0):i.getRowVisible(r,n.SheetArea.viewport)!==e&&(i.setRowVisible(r,e,n.SheetArea.viewport),o=!0));this._resumeInvalidate(t),i.invalidateLayout(),i.repaint(),i._trigger(n.Events.RowHeightChanged,{sheet:i,sheetName:i._name,rowList:c,header:this._columnHeader})}return o},i.prototype._getRowsReiszed=function(n){for(var u=[],r,t,i=0;i<n.length;i++)for(r=n[i],t=r.firstRow;t<=r.lastRow;t++)u.push(t);return u},i.prototype.canUndo=function(){return this._canUndo},i}(r),t.RowResizeUndoAction=ft,nt=function(t){function i(i,r,u,f){t.call(this),this._sheet=i,this._columns=r,this._sheetArea=u?n.SheetArea.rowHeader:n.SheetArea.viewport,arguments.length===3&&(f=i._getAutoFitType()),this._autofitType=f,this._oldSizes=[],this._oldVisibles=[]}return __extends(i,t),i.prototype.canExecute=function(n){return this._sheet&&this._columns&&this._columns.length>0},i.prototype.execute=function(t){var i,u,c,s,e,f,r;if(this.canExecute(t)){i=this._sheet,u=this._sheetAr
ea,this._suspendInvalidate(t);var l=this._getColumnsReiszed(this._columns),h=u===n.SheetArea.rowHeader,o={sheet:i,sheetName:i._name,colList:l,header:h,cancel:!1};i._trigger(n.Events.ColumnWidthChanging,o);if(o&&o.cancel===!0){this._canUndo=!1,this._resumeInvalidate(t);return}else this._canUndo=!0;for(this.saveState(),c=i.getColumnCount(u),s=i.isPaintSuspended(),i.isPaintSuspended(!0),f=0;f<this._columns.length;f++)r=this._columns[f],0<=r.col&&r.col<c&&i.getColumnResizable(r.col,u)&&(e=this._getColumnAutoFitValue(r.col),e!==i.getColumnWidth(r.col,u)&&(i.setColumnWidth(r.col,e,u),i._trigger(n.Events.ColumnWidthChanged,{sheet:i,sheetName:i._name,colList:[r.col],header:h})));i.isPaintSuspended(s),this._resumeInvalidate(t),i.invalidateLayout(),i.repaint()}},i.prototype.saveState=function(){var i=null,r=null,u=this._sheet,f=this._sheetArea,e,n,t;if(u&&this._columns&&this._columns.length>0)for(e=u.getColumnCount(f),i=[this
._columns.length],r=[this._columns.length],n=0;n<this._columns.length;n++)t=this._columns[n],0<=t.col&&t.col<e?(i[n]=u.getColumnWidth(t.col,f),r[n]=u.getColumnVisible(t.col,f)):(i[n]=-1,r[n]=!1);this._oldSizes=i,this._oldVisibles=r},i.prototype.undo=function(t){var c=!1,u=this._sheetArea,s,i,h,f,a,o,v,l,r,e;if(this._sheet&&this._columns&&this._columns.length>0){s=u===n.SheetArea.rowHeader,i=this._sheet,this._suspendInvalidate(t),h=this._getColumnsReiszed(this._columns),f={sheet:i,sheetName:i._name,colList:h,header:s,cancel:!1},i._trigger(n.Events.ColumnWidthChanging,f);if(f&&f.cancel===!0)return this._resumeInvalidate(t),!1;for(a=i.getColumnCount(u),l=i.isPaintSuspended(),i.isPaintSuspended(!0),r=0;r<this._columns.length;r++)e=this._columns[r],o=this._oldSizes[r],v=this._oldVisibles[r],0<=r&&r<a&&o!==-1&&i.getColumnResizable(e.col,u)&&(i.setColumnWidth(e.col,o,u),i.setColumnVisible(e.col,v,u),c=!0);
i.isPaintSuspended(l),this._resumeInvalidate(t),i.invalidateLayout(),i.repaint(),i._trigger(n.Events.ColumnWidthChanged,{sheet:i,sheetName:i._name,colList:h,header:s})}return c},i.prototype._getColumnsReiszed=function(n){for(var r=[],i,t=0;t<n.length;t++)i=n[t],r.push(i.col);return r},i.prototype._nextAutoFitRow=function(n,t){for(var f=this._sheet,e=this._sheetArea,u=-1,s=f.getRowCount(e),o,r,i=n+1;i<s;i++){o=f.getText(i,t,e);if(o){u=i;break}r=f.getActualStyle(i,t,e);if(r&&r.cellType){u=i;break}}return u},i.prototype._getColumnAutoFitValue=function(t){var u=this._sheet,e=0,i=this._sheetArea,a=[i],h,f,l,w,s,v,c,o,y,p;for(this._autofitType==n.AutoFitType.CellWithHeader&&(i==n.SheetArea.viewport?a.push(n.SheetArea.colHeader):i==n.SheetArea.rowHeader&&a.push(n.SheetArea.corner)),h=0;h<a.length;h++){var r=0,i=a[h],b=u.getRowCount(i);while(r>=0&&r<b){f=u._getSpanModel(i).find(r,t);if(f&&(f.col<t||f.colCount>1)){r=f.row+f.rowCoun
t;continue}l=u.getActualStyle(r,t,i),w=l.font||u._render._getDefaultFont(i),l.font=u._render._getZoomFont(w),s=0,v=u.getCellType(r,t,i),v&&(c=!!(u.rowFilter()&&u.rowFilter().isFilterHeader(r,t,i)),c||i!==n.SheetArea.viewport||(o=u.findTable(r,t),o&&o.showHeader()&&o.headerIndex()===r&&o.rowFilter().showFilterButton&&(c=!0)),y=u.getText(r,t,i),p=u.getValue(r,t,i),s=v._getAutoFitWidth(u,p,y,l,c)),s>e&&(e=s),i==n.SheetArea.corner||i==n.SheetArea.colHeader?r++:r=this._nextAutoFitRow(r,t)}}return e===0?e=u.defaults.colWidth:e+=Math.ceil(4/u._zoomFactor),e},i.prototype.canUndo=function(){return this._canUndo},i}(r),t.ColumnAutoFitUndoAction=nt,tt=function(t){function i(i,r,u,f){t.call(this),this._sheet=i,this._rows=r,this._sheetArea=u?n.SheetArea.colHeader:n.SheetArea.viewport,arguments.length===3&&(f=i._getAutoFitType()),this._autofitType=f,this._oldSizes=[],this._oldVisibles=[]}return __extends(i,t),i.prototype.canExecut
e=function(n){return this._sheet&&this._rows&&this._rows.length>0},i.prototype.execute=function(t){var i,h,c,e,u,r;if(this.canExecute(t)){i=this._sheet,this._suspendInvalidate(t);var l=this._getRowsResized(this._rows),f=this._sheetArea,s=this._sheetArea===n.SheetArea.colHeader,o={sheet:i,sheetName:i._name,rowList:l,header:s,cancel:!1};i._trigger(n.Events.RowHeightChanging,o);if(o&&o.cancel===!0){this._canUndo=!1,this._resumeInvalidate(t);return}else this._canUndo=!0;for(this.saveState(),h=i.getRowCount(f),c=i.isPaintSuspended(),i.isPaintSuspended(!0),u=0;u<this._rows.length;u++)r=this._rows[u],0<=r.row&&r.row<h&&i.getRowResizable(r.row,f)&&(e=this._getRowAutoFitValue(r.row),e!==i.getRowHeight(r.row,f)&&(i.setRowHeight(r.row,e,f),i._trigger(n.Events.RowHeightChanged,{sheet:i,sheetName:i._name,rowList:[r.row],header:s})));i.isPaintSuspended(c),this._resumeInvalidate(t),i.invalidateLayout(),i.repaint()}},i.prototype.sa
veState=function(){var i=null,r=null,u=this._sheet,f=this._sheetArea,e,n,t;if(u&&this._rows&&this._rows.length>0)for(i=[this._rows.length],r=[this._rows.length],e=u.getRowCount(f),n=0;n<this._rows.length;n++)t=this._rows[n],0<=t.row&&t.row<e?(i[n]=u.getRowHeight(t.row,f),r[n]=u.getRowVisible(t.row,f)):(i[n]=-1,r[n]=!1);this._oldSizes=i,this._oldVisibles=r},i.prototype.undo=function(t){var c=!1,i=this._sheet,e=this._sheetArea,l=this._sheetArea===n.SheetArea.colHeader,s,u,o,a,v,h,r,f;if(i&&this._rows&&this._rows.length>0){this._suspendInvalidate(t),s=this._getRowsResized(this._rows),u={sheet:i,sheetName:i._name,rowList:s,header:l,cancel:!1},i._trigger(n.Events.RowHeightChanging,u);if(u&&u.cancel===!0)return this._resumeInvalidate(t),!1;for(v=i.getRowCount(e),h=i.isPaintSuspended(),i.isPaintSuspended(!0),r=0;r<this._rows.length;r++)f=this._rows[r],o=this._oldSizes[r],a=this._oldVisibles[r],0<=r&&r<v&&am
p;o!==-1&&i.getRowResizable(f.row,e)&&(i.setRowHeight(f.row,o,e),i.setRowVisible(f.row,a,e),c=!0);i.isPaintSuspended(h),this._resumeInvalidate(t),i.invalidateLayout(),i.repaint(),i._trigger(n.Events.RowHeightChanged,{sheet:i,sheetName:i._name,rowList:s,header:l})}return c},i.prototype._getRowsResized=function(n){for(var r=[],i,t=0;t<n.length;t++)i=n[t],r.push(i.row);return r},i.prototype._nextAutoFitColumn=function(t,i){for(var e=this._sheet,s=this._sheetArea,h=this._sheetArea===n.SheetArea.colHeader,f=e._nextNonNullColumn(t,i,h),r=-1,c=e.getColumnCount(s),o,u=i+1;u<c;u++){o=e.getActualStyle(t,u,s);if(o&&o.cellType){r=u;break}}return f<0||r<0?f<0?r<0?-1:r:f:Math.min(f,r)},i.prototype._getRowAutoFitValue=function(t){var u=this._sheet,e=0,i=this._sheetArea,w=this._sheetArea===n.SheetArea.colHeader,h=[i],c,r,y,f,s,p,o,l,v,a;for(this._autofitType==n.AutoFitType.CellWithHeader&&(i==n.SheetArea.viewport?h.push(n.SheetArea.rowHeader):i==n.S
heetArea.colHeader&&h.push(n.SheetArea.corner)),c=0;c<h.length;c++){i=h[c],r=0,y=u.getColumnCount(i);while(r>=0&&r<y){f=u._getSpanModel(i).find(t,r);if(f&&(f.row<t||f.rowCount>1)){r=f.col+f.colCount;continue}s=u.getActualStyle(t,r,i),p=s.font||u._render._getDefaultFont(i),s.font=u._render._getZoomFont(p),o=0,l=u.getCellType(t,r,i),l&&(v=u.getText(t,r,i),a=u.getValue(t,r,i),o=l._getAutoFitHeight(u,a,v,s)),o>e&&(e=o),i===n.SheetArea.viewport?r=this._nextAutoFitColumn(t,r):r++}}return e===0?e=u.defaults.rowHeight:e+=Math.ceil(4/u._zoomFactor),e},i.prototype.canUndo=function(){return this._canUndo},i}(r),t.RowAutoFitUndoAction=tt,it=function(){function n(n,t){this.index=n,this.count=t}return n}(),t.GroupExtent=it,ht=function(t){function i(n,i){t.call(this),this._sheet=n,this._columnGroupExtent=i,this._canUndo=!1}return __extends(i,t),i.prototype.canExecute=function(n){return!0},i.prototype.execute=function(t){var i=this._sheet,u,
r;n.features.group&&i&&this._columnGroupExtent&&i.colRangeGroup&&(this._suspendInvalidate(t),u=this._columnGroupExtent.index,r=this._columnGroupExtent.count,i.colRangeGroup.group(u,r),this._resumeInvalidate(t),i.invalidateLayout(),i.repaint(),this._canUndo=!0)},i.prototype.canUndo=function(){return this._canUndo},i.prototype.saveState=function(){},i.prototype.undo=function(t){var f=!1,i=this._sheet,u,r;return n.features.group&&i&&this._columnGroupExtent&&i.colRangeGroup&&(this._suspendInvalidate(t),u=this._columnGroupExtent.index,r=this._columnGroupExtent.count,i.colRangeGroup.ungroupRange(u,r),f=!0,this._resumeInvalidate(t),i.invalidateLayout(),i.repaint()),f},i}(r),t.ColumnGroupUndoAction=ht,ct=function(t){function i(n,i){t.call(this),this._sheet=n,this._columnUngroupExtent=i,this._canUndo=!1}return __extends(i,t),i.prototype.canExecute=function(n){return!0},i.prototype.execute=function(t){var i=this._sheet,r,u;n.feat
ures.group&&i&&this._columnUngroupExtent&&i.colRangeGroup&&(r=this._columnUngroupExtent.index,u=this._columnUngroupExtent.count,i.colRangeGroup.getLevel(r)<0&&i.colRangeGroup.getLevel(r+u-1)<0?this._canUndo=!1:(this._suspendInvalidate(t),this._canUndo=!0,i.colRangeGroup.ungroupRange(r,u),this._resumeInvalidate(t),i.invalidateLayout(),i.repaint()))},i.prototype.canUndo=function(){return this._canUndo},i.prototype.saveState=function(){},i.prototype.undo=function(t){var f=!1,i=this._sheet,u,r;return n.features.group&&this._canUndo===!0&&i&&this._columnUngroupExtent&&i.colRangeGroup&&(this._suspendInvalidate(t),u=this._columnUngroupExtent.index,r=this._columnUngroupExtent.count,i.colRangeGroup.group(u,r),f=!0,this._resumeInvalidate(t),i.invalidateLayout(),i.repaint()),f},i}(r),t.ColumnUngroupUndoAction=ct,lt=function(t){function i(n,i){t.call(this),this._sheet=n,this._rowGroupExtent=i,this._canUndo=!1}
return __extends(i,t),i.prototype.canExecute=function(n){return!0},i.prototype.execute=function(t){var i=this._sheet,u,r;n.features.group&&i&&this._rowGroupExtent&&i.rowRangeGroup&&(this._suspendInvalidate(t),u=this._rowGroupExtent.index,r=this._rowGroupExtent.count,i.rowRangeGroup.group(u,r),this._resumeInvalidate(t),i.invalidateLayout(),i.repaint(),this._canUndo=!0)},i.prototype.canUndo=function(){return this._canUndo},i.prototype.saveState=function(){},i.prototype.undo=function(t){var f=!1,i=this._sheet,u,r;return n.features.group&&i&&this._rowGroupExtent&&i.rowRangeGroup&&(this._suspendInvalidate(t),u=this._rowGroupExtent.index,r=this._rowGroupExtent.count,i.rowRangeGroup.ungroupRange(u,r),f=!0,this._resumeInvalidate(t),i.invalidateLayout(),i.repaint()),f},i}(r),t.RowGroupUndoAction=lt,et=function(t){function i(n,i){t.call(this),this._sheet=n,this._rowUngroupExtent=i,this._canUndo=!1}return __extends(i,t),i.prototyp
e.canExecute=function(n){return!0},i.prototype.execute=function(t){var i=this._sheet,r,u;n.features.group&&i&&this._rowUngroupExtent&&i.rowRangeGroup&&(r=this._rowUngroupExtent.index,u=this._rowUngroupExtent.count,i.rowRangeGroup.getLevel(r)<0&&i.rowRangeGroup.getLevel(r+u-1)<0?this._canUndo=!1:(this._suspendInvalidate(t),this._canUndo=!0,i.rowRangeGroup.ungroupRange(r,u),this._resumeInvalidate(t),i.invalidateLayout(),i.repaint()))},i.prototype.canUndo=function(){return this._canUndo},i.prototype.saveState=function(){},i.prototype.undo=function(t){var f=!1,i=this._sheet,u,r;return n.features.group&&this._canUndo===!0&&i&&this._rowUngroupExtent&&i.rowRangeGroup&&(this._suspendInvalidate(t),u=this._rowUngroupExtent.index,r=this._rowUngroupExtent.count,i.rowRangeGroup.group(u,r),f=!0,this._resumeInvalidate(t),i.invalidateLayout(),i.repaint()),f},i}(r),t.RowUngroupUndoAction=et,ot=function(t){function
i(n,i){t.call(this),this._sheet=n,this._columnExpandExtent=i,this._canUndo=!1}return __extends(i,t),i.prototype.canExecute=function(){return!0},i.prototype.execute=function(t){var i=this._sheet,u,r;n.features.group&&i&&this._columnExpandExtent&&i.colRangeGroup&&(this._suspendInvalidate(t),u=this._columnExpandExtent.index,r=this._columnExpandExtent.collapsed,i.colRangeGroup.setCollapsed(u,r),i._allowCellOverflow===!0&&i._clearCellOverflowModelCache(),this._resumeInvalidate(t),this._showColumnRangeGroup(r),i.invalidateLayout(),i.repaint(),this._canUndo=!0)},i.prototype.canUndo=function(){return this._canUndo},i.prototype.saveState=function(){},i.prototype.undo=function(t){var u=!1,i=this._sheet,f,r;return n.features.group&&i&&this._columnExpandExtent&&i.colRangeGroup&&(this._suspendInvalidate(t),f=this._columnExpandExtent.index,r=this._columnExpandExtent.collapsed,i.colRangeGroup.setCollapsed(f,!r),i._allowCellOve
rflow===!0&&i._clearCellOverflowModelCache(),u=!0,this._resumeInvalidate(t),this._showColumnRangeGroup(!r),i.invalidateLayout(),i.repaint()),u},i.prototype._showColumnRangeGroup=function(t){var i=this._sheet,f=this._columnExpandExtent.index,c,u,e,h,r,o,s,l;if(f<0||f>=i.getColumnCount())return;if(i.colRangeGroup.direction===n.RangeGroupDirection.Forward){c=i.colRangeGroup.find(f-1,this._columnExpandExtent.level);if(!c)return;u=c.start,e=f,h=1,t?u=f:u<i.frozenColCount&&(u=i.frozenColCount),r=i.getViewportLeftColumn(h),u<r&&(r=u),o=i.getViewportWidth(h),s=this._getColsTotalWidth(i,r,e),s>o&&(r=this._getNewLeftColumn(i,r,s-o)),i._scrollLeftCol=this._tryGetNextScrollableCol(i,r)}else{c=i.colRangeGroup.find(f+1,this._columnExpandExtent.level);if(!c)return;u=f,e=c.end,h=1,t?e=f:(l=i.getColumnCount(),e<l||(e=l-1)),r=i.getViewportLeftColumn(h),u<r?i._scrollLeftCol=this._tryGetNextScrollableCol(i,u):(o=i.getViewportWidth(h),s=this._getColsT
otalWidth(i,r,e),s>o&&(r=this._getNewLeftColumn(i,r,s-o),i._scrollLeftCol=this._tryGetNextScrollableCol(i,Math.min(u,r))))}i._syncHScollbarPosition()},i.prototype._getColsTotalWidth=function(n,t,i){for(var u=0,f=n.getColumnCount(),r=t;r<=i&&r<f;r++)u+=n.getColumnWidth(r)*n._zoomFactor;return u},i.prototype._getNewLeftColumn=function(n,t,i){for(var f=0,u=n.getColumnCount(),r=t;r<u&&f<i;r++)t++,f+=n.getColumnWidth(r)*n._zoomFactor;return t>=u?u-1:t},i.prototype._tryGetNextScrollableCol=function(n,t){var f=n.frozenColCount,r=n.getColumnCount()-1,i,u;if(t<f)return f;if(t>r)return r;for(i=t;i<=r;i++){u=n.getColumnWidth(i);if(u>0)return i}return-1},i}(r),t.ColumnGroupExpandUndoAction=ot,st=function(t){function i(n,i){t.call(this),this._sheet=n,this._rowExpandExtent=i,this._canUndo=!1}return __extends(i,t),i.prototype.canExecute=function(){return!0},i.prototype.execute=function(t){var i=this._sheet,u,r;n.features.group&&i&&a
mp;this._rowExpandExtent&&i.rowRangeGroup&&(this._suspendInvalidate(t),u=this._rowExpandExtent.index,r=this._rowExpandExtent.collapsed,i.rowRangeGroup.setCollapsed(u,r),this._resumeInvalidate(t),this._showRowRangeGroup(r),i.invalidateLayout(),i.repaint(),this._canUndo=!0)},i.prototype.canUndo=function(){return this._canUndo},i.prototype.saveState=function(){},i.prototype.undo=function(t){var u=!1,i=this._sheet,f,r;return n.features.group&&i&&this._rowExpandExtent&&i.rowRangeGroup&&(this._suspendInvalidate(t),f=this._rowExpandExtent.index,r=this._rowExpandExtent.collapsed,i.rowRangeGroup.setCollapsed(f,!r),u=!0,this._resumeInvalidate(t),this._showRowRangeGroup(!r),i.invalidateLayout(),i.repaint()),u},i.prototype._showRowRangeGroup=function(t){var i=this._sheet,f=this._rowExpandExtent.index,c,u,e,h,r,o,s,l;if(f<0||f>=i.getRowCount())return;if(i.rowRangeGroup.direction===n.RangeGroupDirection.Forward){c=i.rowRangeGroup.find(f-1,this
._rowExpandExtent.level);if(!c)return;u=c.start,e=f,h=1,t?u=f:u<i.frozenRowCount&&(u=i.frozenRowCount),r=i.getViewportTopRow(h),u<r&&(r=u),o=i.getViewportHeight(h),s=this._getRowsTotalHeight(i,r,e),s>o&&(r=this._getNewTopRow(i,r,s-o)),i._scrollTopRow=this._tryGetNextScrollableRow(i,r)}else{c=i.rowRangeGroup.find(f+1,this._rowExpandExtent.level);if(!c)return;u=f,e=c.end,h=1,t?e=f:(l=i.getRowCount(),e<l||(e=l-1)),r=i.getViewportTopRow(h),u<r?i._scrollTopRow=this._tryGetNextScrollableRow(i,u):(o=i.getViewportHeight(h),s=this._getRowsTotalHeight(i,r,e),s>o&&(r=this._getNewTopRow(i,r,s-o),i._scrollTopRow=this._tryGetNextScrollableRow(i,Math.min(u,r))))}i._syncVScrollbarPosition()},i.prototype._getRowsTotalHeight=function(n,t,i){for(var u=0,f=n.getRowCount(),r=t;r<=i&&r<f;r++)u+=n.getRowHeight(r)*n._zoomFactor;return u},i.prototype._getNewTopRow=function(n,t,i){for(var f=0,u=n.getRowCount(),r=t;r<=u&&f<i;r++)t++
,f+=n.getRowHeight(r)*n._zoomFactor;return t>=u?u-1:t},i.prototype._tryGetNextScrollableRow=function(n,t){var f=n.frozenRowCount,r=n.getRowCount()-1,i,u;if(t<f)return f;if(t>r)return r;for(i=t;i<=r;i++){u=n.getRowHeight(i);if(u>0)return i}return-1},i}(r),t.RowGroupExpandUndoAction=st,g=function(t){function i(n,i){t.call(this),this._sheet=n,this._columnGroupHeaderExpandExtent=i,this._oldStatus={},this._canUndo=!1}return __extends(i,t),i.prototype.canExecute=function(){return!0},i.prototype.execute=function(t){var i=this._sheet,u,r;if(n.features.group&&i&&this._columnGroupHeaderExpandExtent&&i.colRangeGroup){for(this._suspendInvalidate(t),this.saveState(),u=this._columnGroupHeaderExpandExtent.level,r=0;r<u;r++)i.colRangeGroup.expand(r,!0);i.colRangeGroup.expand(u,!1),this._resumeInvalidate(t),i.invalidateLayout(),i.repaint(),this._canUndo=!0}},i.prototype.canUndo=function(){return this._canUndo},i.prototype.saveState=function(){var f=null,i=th
is._sheet,o,e,t,r,s;if(i&&this._columnGroupHeaderExpandExtent&&i.colRangeGroup)for(o=this._columnGroupHeaderExpandExtent.level,f={},e=0;e<=o;e++){var u=0,c=i.getColumnCount(),h=i.colRangeGroup.direction;while(u<c){t=i.colRangeGroup.find(u,e);if(t){r=-1;switch(h){case n.RangeGroupDirection.Backward:r=t.start-1;break;case n.RangeGroupDirection.Forward:r=t.end+1;break;default:break}s=t.getState()===n.GroupState.Collapsed,f[r]||(f[r]=s),u+=t.end-t.start+1}u++}}this._oldStatus=f},i.prototype.undo=function(t){var u=!1,i=this._sheet,r;if(n.features.group&&i&&this._oldStatus&&i.colRangeGroup){this._suspendInvalidate(t);for(r in this._oldStatus)r&&(i.colRangeGroup.setCollapsed(r,this._oldStatus[r]),u=!0);this._resumeInvalidate(t),i.invalidateLayout(),i.repaint()}return u},i}(r),t.ColumnGroupHeaderExpandUndoAction=g,p=function(t){function i(n,i){t.call(this),this._sheet=n,this._rowGroupHeaderExpandExtent=i,this._oldStatus={},this._canUndo=
!1}return __extends(i,t),i.prototype.canExecute=function(){return!0},i.prototype.execute=function(t){var i=this._sheet,u,r;if(n.features.group&&i&&this._rowGroupHeaderExpandExtent&&i.rowRangeGroup){for(this._suspendInvalidate(t),this.saveState(),u=this._rowGroupHeaderExpandExtent.level,r=0;r<u;r++)i.rowRangeGroup.expand(r,!0);i.rowRangeGroup.expand(u,!1),this._resumeInvalidate(t),i.invalidateLayout(),i.repaint(),this._canUndo=!0}},i.prototype.canUndo=function(){return this._canUndo},i.prototype.saveState=function(){var f=null,i=this._sheet,o,e,t,r,s;if(i&&this._rowGroupHeaderExpandExtent&&i.rowRangeGroup)for(o=this._rowGroupHeaderExpandExtent.level,f={},e=0;e<=o;e++){var u=0,c=i.getRowCount(),h=i.rowRangeGroup.direction;while(u<c){t=i.rowRangeGroup.find(u,e);if(t){r=-1;switch(h){case n.RangeGroupDirection.Backward:r=t.start-1;break;case n.RangeGroupDirection.Forward:r=t.end+1;break;default:break}s=t.getState()===n.GroupState.Collapsed
,f[r]||(f[r]=s),u+=t.end-t.start+1}u++}}this._oldStatus=f},i.prototype.undo=function(t){var u=!1,i=this._sheet,r;if(n.features.group&&i&&this._oldStatus&&i.rowRangeGroup){this._suspendInvalidate(t);for(r in this._oldStatus)r&&(i.rowRangeGroup.setCollapsed(r,this._oldStatus[r]),u=!0);this._resumeInvalidate(t),i.invalidateLayout(),i.repaint()}return u},i}(r),t.RowGroupHeaderExpandUndoAction=p,y=function(){function n(n,t,i,r,u,f){this.fromRow=n,this.fromColumn=t,this.toRow=i,this.toColumn=r,this.rowCount=u,this.columnCount=f}return n}(),t.DragDropExtent=y,a=function(t){function r(n,i,r,u,f){t.call(this),this._sheet=n,this._dragDropExtent=i,this._copy=r,this._insert=u,this._option=f}return __extends(r,t),r.prototype.canExecute=function(n){return!0},r.prototype.execute=function(t){var r=this._sheet,u,e,f,s,o,k,b,v,y;if(!r._isValidRange(this._dragDropExtent.fromRow,this._dragDropExtent.fromColumn,this._dragDropExtent.rowCount,this._dragDropExtent.columnCoun
t,this._sheet.getRowCount(),this._sheet.getColumnCount()))return;if(!this._insert)if(!r._isValidRange(this._dragDropExtent.toRow,this._dragDropExtent.toColumn,this._dragDropExtent.rowCount,this._dragDropExtent.columnCount,this._sheet.getRowCount(),this._sheet.getColumnCount()))return;this.saveState();if(this._insert){k=this._dragDropExtent.fromRow,b=this._dragDropExtent.fromColumn;if(b>=0&&k<0){u=this._dragDropExtent.fromColumn,e=this._dragDropExtent.toColumn,f=this._dragDropExtent.columnCount,v=this._dragDropExtent.toColumn,this._suspendInvalidate(t);try{this._sheet.addColumns(e,f),this._copy?this._sheet.copyTo(-1,e<=u?u+f:u,-1,e,-1,f,this._option):(this._sheet.moveTo(-1,e<=u?u+f:u,-1,e,-1,f,this._option),this._sheet.deleteColumns(e<=u?u+f:u,f),u<e&&(v=e-f))}finally{this._resumeInvalidate(t)}r&&(s=r.getSelections().toArray(),r._clearSelectionImp(),r.addSelection(-1,v,r.getRowCount(),f),o=r.getSelections(),r._trigger(n.Events.SelectionChangi
ng,{sheet:r,sheetName:r._name,oldSelections:s,newSelections:o}),r._trigger(n.Events.SelectionChanged,{sheet:r,sheetName:r._name}),r._setActiveCellImp(r._getFirstVisualRow(),v,r.activeRowViewportIndex,r.activeColViewportIndex),r.invalidateLayout(),r._dragRect={},r.repaint())}else if(this._dragDropExtent.fromRow>=0&&this._dragDropExtent.fromColumn<0){u=this._dragDropExtent.fromRow,e=this._dragDropExtent.toRow,f=this._dragDropExtent.rowCount,y=this._dragDropExtent.toRow,this._suspendInvalidate(t);try{this._sheet.addRows(e,f),this._copy?this._sheet.copyTo(e<=u?u+f:u,-1,e,-1,f,-1,this._option):(this._sheet.moveTo(e<=u?u+f:u,-1,e,-1,f,-1,this._option),this._sheet.deleteRows(e<=u?u+f:u,f),u<e&&(y=e-f))}finally{this._resumeInvalidate(t)}r&&(s=r.getSelections().toArray(),r._clearSelectionImp(),r.addSelection(y,-1,f,r.getColumnCount()),o=r.getSelections(),r._trigger(n.Events.SelectionChanging,{sheet:r,sheetName:r._name,oldSelections:s,newSelections:o}
),r._trigger(n.Events.SelectionChanged,{sheet:r,sheetName:r._name}),r._setActiveCellImp(y,r._getFirstVisualColumn(),r.activeRowViewportIndex,r.activeColViewportIndex),r.invalidateLayout(),r._dragRect={},r.repaint())}}else{var w=this._dragDropExtent.fromRow,p=this._dragDropExtent.fromColumn,h=this._dragDropExtent.toRow,c=this._dragDropExtent.toColumn,l=this._dragDropExtent.rowCount,a=this._dragDropExtent.columnCount;this._suspendInvalidate(t);try{this._copy?this._sheet.copyTo(w,p,h,c,l,a,this._option):this._sheet.moveTo(w,p,h,c,l,a,this._option),r&&(s=r.getSelections().toArray(),r._clearSelectionImp(),r.addSelection(h,c,l,a),o=r.getSelections().toArray(),r._trigger(n.Events.SelectionChanging,{sheet:r,sheetName:r._name,oldSelections:s,newSelections:o}),r._trigger(n.Events.SelectionChanged,{sheet:r,sheetName:r._name}),r._setActiveCellImp(Math.max(r._getFirstVisualRow(),h),Math.max(r._getFirstVisualColumn(),c),r.activeRowViewportIndex,r.activeColViewportIndex),!this._copy&&a
mp;this._savedFromViewportCells&&this._savedFromViewportCells.isValueSaved()&&i.raiseRangeDataChanged(r,w,p,l,a,this._savedFromViewportCells.getValues()),this._savedToViewportCells&&this._savedToViewportCells.isValueSaved()&&i.raiseRangeDataChanged(r,h,c,l,a,this._savedToViewportCells.getValues()))}finally{this._resumeInvalidate(t)}r&&(r.invalidateLayout(),r._dragRect={},r.repaint())}},r.prototype.saveState=function(){var b,y,w,d,k,a,p,h,s,f;this.initSaveState();var c=this._dragDropExtent.fromRow<0?0:this._dragDropExtent.fromRow,v=this._dragDropExtent.fromColumn<0?0:this._dragDropExtent.fromColumn,l=this._dragDropExtent.toRow<0?0:this._dragDropExtent.toRow,g=this._dragDropExtent.toColumn<0?0:this._dragDropExtent.toColumn,t=this._dragDropExtent.fromRow<0?this._sheet.getRowCount():this._dragDropExtent.rowCount,r=this._dragDropExtent.fromColumn<0?this._sheet.getColumnCount():this._dragDropExtent.columnCount;this._insert?(this._d
ragDropExtent.fromColumn<0||this._dragDropExtent.fromRow<0)&&this._dragDropExtent.fromColumn<0&&(this._dragDropExtent.fromRow<0||this._copy||this._sheet._hasTable(l,-1,1,-1)&&(h=new u(t,this._sheet.getColumnCount(n.SheetArea.rowHeader)),s=new e(t),i.saveRowHeaderInfo(this._sheet,h,s,c,this._option),this._savedFromRowHeaderCells=h,this._savedFromRows=s,f=new u(t,r),i.saveViewportInfo(this._sheet,f,c,v,this._option),this._savedFromViewportCells=f)):(this._dragDropExtent.fromRow<0&&(b=new u(this._sheet.getRowCount(n.SheetArea.colHeader),r),y=new o(r),i.saveColumnHeaderInfo(this._sheet,b,y,g,this._option),this._savedToColumnHeaderCells=b,this._savedToColumns=y,this._copy||(w=new u(this._sheet.getRowCount(n.SheetArea.colHeader),r),d=new o(r),i.saveColumnHeaderInfo(this._sheet,w,d,v,this._option),this._savedFromColumnHeaderCells=w,this._savedFromColumns=d)),this._dragDropExtent.fromColumn<0&&(k=new u(t,this._sheet.getColumnCount(n.
SheetArea.rowHeader)),a=new e(t),i.saveRowHeaderInfo(this._sheet,k,a,l,this._option),this._savedToRowHeaderCells=k,this._savedToRows=a,this._copy||(h=new u(t,this._sheet.getColumnCount(n.SheetArea.rowHeader)),s=new e(t),i.saveRowHeaderInfo(this._sheet,h,s,c,this._option),this._savedFromRowHeaderCells=h,this._savedFromRows=s)),p=new u(t,r),i.saveViewportInfo(this._sheet,p,l,g,this._option),this._savedToViewportCells=p,this._copy||(f=new u(t,r),i.saveViewportInfo(this._sheet,f,c,v,this._option),this._savedFromViewportCells=f)),this._savedAcitveRowViewportIndex=this._sheet.activeRowViewportIndex,this._savedAcitveColumnViewportIndex=this._sheet.activeColViewportIndex,this._savedActiveRow=this._sheet._activeRowIndex,this._savedActiveColumn=this._sheet._activeColIndex},r.prototype.initSaveState=function(){this._savedFromColumnHeaderCells=null,this._savedFromColumns=null,this._savedFromViewportCells=null,this._savedFromRowHeaderCells=null,this._savedFromRows=null,this._savedToColumnHeaderC
ells=null,this._savedToColumns=null,this._savedToViewportCells=null,this._savedToRowHeaderCells=null,this._savedToRows=null,this._savedAcitveRowViewportIndex=-2,this._savedAcitveColumnViewportIndex=-2,this._savedActiveRow=-1,this._savedActiveColumn=-1},r.prototype.undo=function(t){var r=this._sheet,f,s,h,u,o,e,d,k,w;if(!r._isValidRange(this._dragDropExtent.fromRow,this._dragDropExtent.fromColumn,this._dragDropExtent.rowCount,this._dragDropExtent.columnCount,this._sheet.getRowCount(),this._sheet.getColumnCount()))return!1;if(!this._insert)if(!r._isValidRange(this._dragDropExtent.toRow,this._dragDropExtent.toColumn,this._dragDropExtent.rowCount,this._dragDropExtent.columnCount,this._sheet.getRowCount(),this._sheet.getColumnCount()))return!1;f=!1;if(this._insert){if(!(this._dragDropExtent.fromColumn>=0&&this._dragDropExtent.fromRow>=0))if(this._dragDropExtent.fromColumn<0){if(this._dragDropExtent.fromRow>=0){u=this._dragDropExtent.rowCount,k=this._dragDropExtent.fro
mRow,this._suspendInvalidate(t);try{this._copy?this._sheet.deleteRows(this._dragDropExtent.toRow,u):(o=this._dragDropExtent.toRow,e=this._dragDropExtent.fromRow,this._dragDropExtent.fromRow<this._dragDropExtent.toRow?o=this._dragDropExtent.toRow-u:e=this._dragDropExtent.fromRow+u,this._sheet.addRows(e,u),this._savedFromViewportCells&&(i.undoCellsInfo(this._sheet,this._savedFromViewportCells,e,0,n.SheetArea.viewport),f=!0),this._savedFromRowHeaderCells&&(i.undoCellsInfo(this._sheet,this._savedFromRowHeaderCells,e,0,n.SheetArea.rowHeader),f=!0),this._savedFromRows&&(i.undoRowsInfo(this._sheet,this._savedFromRows,e),f=!0),f||this._sheet.copyTo(e<=o?o+u:o,-1,e,-1,u,-1,this._option),this._sheet.deleteRows(e<=o?o+u:o,u),o<e&&(k=e-u))}finally{this._resumeInvalidate(t)}r&&(s=r.getSelections().toArray(),r._clearSelectionImp(),r.addSelection(k,-1,u,r.getColumnCount()),h=r.getSelections(),r._trigger(n.Events.SelectionChanging,{sheet:r,sheetNa
me:r._name,oldSelections:s,newSelections:h}),r._trigger(n.Events.SelectionChanged,{sheet:r,sheetName:r._name}),r.invalidateLayout(),r.repaint()),f=!0}}else{d=this._dragDropExtent.fromColumn,u=this._dragDropExtent.columnCount,this._suspendInvalidate(t);try{this._copy?this._sheet.deleteColumns(this._dragDropExtent.toColumn,u):(o=this._dragDropExtent.toColumn,e=this._dragDropExtent.fromColumn,this._dragDropExtent.fromColumn<this._dragDropExtent.toColumn?o=this._dragDropExtent.toColumn-u:e=this._dragDropExtent.fromColumn+u,this._sheet.addColumns(e,u),this._sheet.copyTo(-1,e<=o?o+u:o,-1,e,-1,u,this._option),this._sheet.deleteColumns(e<=o?o+u:o,u),o<e&&(d=e-u))}finally{this._resumeInvalidate(t)}r&&(s=r.getSelections().toArray(),r._clearSelectionImp(),r.addSelection(-1,d,r.getRowCount(),u),h=r.getSelections(),r._trigger(n.Events.SelectionChanging,{sheet:r,sheetName:r._name,oldSelections:s,newSelections:h}),r._trigger(n.Events.SelectionChanged,{sheet:r,sheetName:
r._name}),r.invalidateLayout(),r.repaint()),f=!0}}else{var a=this._dragDropExtent.fromRow<0?0:this._dragDropExtent.fromRow,c=this._dragDropExtent.fromColumn<0?0:this._dragDropExtent.fromColumn,l=this._dragDropExtent.toRow<0?0:this._dragDropExtent.toRow,v=this._dragDropExtent.toColumn<0?0:this._dragDropExtent.toColumn,y=this._dragDropExtent.fromRow<0?this._sheet.getRowCount():this._dragDropExtent.rowCount,p=this._dragDropExtent.fromColumn<0?this._sheet.getColumnCount():this._dragDropExtent.columnCount,g=null,b=null;!this._copy&&this._savedFromViewportCells&&this._savedFromViewportCells.isValueSaved()&&(b=i.getValues(this._sheet,a,c,y,p)),this._savedToViewportCells&&this._savedToViewportCells.isValueSaved()&&(g=i.getValues(this._sheet,l,v,y,p)),this._suspendInvalidate(t);try{this._savedToColumnHeaderCells&&(i.undoCellsInfo(this._sheet,this._savedToColumnHeaderCells,0,v,n.SheetArea.colHeader),f=!0),this._savedToColumns&a
mp;&(i.undoColumnsInfo(this._sheet,this._savedToColumns,v),f=!0),this._savedToViewportCells&&(i.undoCellsInfo(this._sheet,this._savedToViewportCells,l,v,n.SheetArea.viewport),f=!0),this._savedToRowHeaderCells&&(i.undoCellsInfo(this._sheet,this._savedToRowHeaderCells,l,0,n.SheetArea.rowHeader),f=!0),this._savedToRows&&(i.undoRowsInfo(this._sheet,this._savedToRows,l),f=!0),this._savedFromColumnHeaderCells&&(i.undoCellsInfo(this._sheet,this._savedFromColumnHeaderCells,0,c,n.SheetArea.colHeader),f=!0),this._savedFromColumns&&(i.undoColumnsInfo(this._sheet,this._savedFromColumns,c),f=!0),this._savedFromViewportCells&&(i.undoCellsInfo(this._sheet,this._savedFromViewportCells,a,c,n.SheetArea.viewport),f=!0),this._savedFromRowHeaderCells&&(i.undoCellsInfo(this._sheet,this._savedFromRowHeaderCells,a,0,n.SheetArea.rowHeader),f=!0),this._savedFromRows&&(i.undoRowsInfo(this._sheet,this._savedFromRows,a),f=!0)}finally{this._resu
meInvalidate(t)}f&&r&&(s=r.getSelections().toArray(),r._clearSelectionImp(),r.addSelection(this._dragDropExtent.fromRow,this._dragDropExtent.fromColumn,this._dragDropExtent.rowCount,this._dragDropExtent.columnCount),h=r.getSelections(),r._trigger(n.Events.SelectionChanging,{sheet:r,sheetName:r._name,oldSelections:s,newSelections:h}),r._trigger(n.Events.SelectionChanged,{sheet:r,sheetName:r._name}),g&&i.raiseRangeDataChanged(r,l,v,y,p,g),b&&i.raiseRangeDataChanged(r,a,c,y,p,b))}return f&&r&&(this._savedActiveRow!==-1&&this._savedActiveColumn!==-1&&(w=r.getSelections()[0],w.contains(this._savedActiveRow,this._savedActiveColumn)?r._setActiveCellImp(this._savedActiveRow,this._savedActiveColumn):r._setActiveCellImp(Math.max(r._getFirstVisualRow(),w.row),Math.max(r._getFirstVisualColumn(),w.col))),this._savedAcitveRowViewportIndex!==-2&&this._savedAcitveColumnViewportIndex!==-2&&this._savedActiveRow!==-1&&
amp;this._savedActiveColumn!==-1&&r.showCell(this._savedActiveRow,this._savedActiveColumn,n.VerticalPosition.nearest,n.HorizontalPosition.nearest),r.invalidateLayout(),r.repaint()),f},r}(r),t.DragDropUndoAction=a,v=function(t){function i(n,i){t.call(this),this._sheet=n,this._cellEditInfo=i,this._canUndo=!1}return __extends(i,t),i.prototype.canExecute=function(n){return!0},i.prototype.saveState=function(){var n=this._sheet.getFormula(this._cellEditInfo.row,this._cellEditInfo.col);n===null||n===""?(this._oldValue=this._sheet.getValue(this._cellEditInfo.row,this._cellEditInfo.col),this._oldValueIsFormula=!1):(this._oldValue=n,this._oldValueIsFormula=!0)},i.prototype.undo=function(t){var i=this._sheet,u=this._cellEditInfo.row,r=this._cellEditInfo.col,f;try{return this._suspendInvalidate(t),i._bind(n.Events.CellChanged,function(t,r){r.propertyName==="value"&&i._trigger(n.Events.ValueChanged,{sheet:r.sheet,sheetName:r.sheetName,row:r.row,col:r.col,oldVa
lue:r._oldValue,newValue:r.sheet.getValue(r.row,r.col)})}),this._oldValueIsFormula?i.setFormula(u,r,this._oldValue):(f=i.getFormula(u,r),f===null||f===""||i.setFormula(u,r,null),i.setValue(u,r,this._oldValue)),this._resumeInvalidate(t),this._sheet.repaint(),!0}catch(e){return!1}finally{i._unbind(n.Events.CellChanged)}},i.prototype.execute=function(t){this._suspendInvalidate(t),this.saveState();var i=this._sheet,r=i.isPaintSuspended();try{i.isPaintSuspended(!0),i._bind(n.Events.CellChanged,function(t,r){r.propertyName==="value"&&i._trigger(n.Events.ValueChanged,{sheet:r.sheet,sheetName:r.sheetName,row:r.row,col:r.col,oldValue:r._oldValue,newValue:r.sheet.getValue(r.row,r.col)})}),this.applyResult=this._applyEditing(t)}finally{this._sheet._unbind(n.Events.CellChanged),this._resumeInvalidate(t),i.isPaintSuspended(r)}this._canUndo=this.applyResult===n.DataValidationResult.ForceApply},i.prototype._applyEditing=function(t){var i=this._sheet,u=this._cellEditInfo
.row,r=this._cellEditInfo.col,f=this._cellEditInfo.newValue,y=this._cellEditInfo.hasOwnProperty("autoFormat")?this._cellEditInfo.autoFormat:!0,o=n.DataValidationResult.ForceApply,p=i.parent?i.parent.canUserEditFormula():!0,e,s,h,a,l,v,c;f&&f.length>0&&f[0]==="="?i.getDataValidator(u,r)&&(s=f.substring(1),s!==""&&s!==i.getFormula(u,r)&&(h=i.getCalcService(),h&&(a=h.parse(s,u>=0?u:0,r>=0?r:0),a&&(l=h.evaluateParsedFormula(i._getSheetSource(),a,u,r),i.isValid(u,r,l)||(o=i._validationError(u,r,l)))))):(e=this._getValueFromEditing(u,r,f,y),v=i.isValid(u,r,e),v||(o=i._validationError(u,r,f),i._eventHandler._forceCancelSelectiong=!0));if(!(o===n.DataValidationResult.Discard||o===n.DataValidationResult.Retry))if(o===n.DataValidationResult.ForceApply)if(p&&f&&f.length>0&&f[0]==="="){try{i.setFormula(u,r,f.substring(1))}catch(b){i._raiseInvalidOperation(n.Invalid
OperationType.SetFormula,typeof b=="string"?b:b.message);throw b;}i._trigger(n.Events.UserFormulaEntered,{sheet:i,sheetName:i._name,row:u,col:r,formula:f.substring(1).toUpperCase()})}else{i.hasFormula(u,r)&&i.setFormula(u,r,null);try{c=!1,/^('=)/ig.test(f)&&(f=f.substring(1),c=!0),(e===undefined||e===null||c)&&(e=this._getValueFromEditing(u,r,f,y)),i.setValue(u,r,e)}catch(w){i.setValue(u,r,f)}}return o},i.prototype.canUndo=function(){return this._canUndo},i.prototype._getValueFromEditing=function(t,i,r,u){var f,c,l,e,o,h,s;if(!n.features.formatter)return r;f=null,c=this._sheet.getActualStyle(t,i),c&&(c.formatter?(f=c.formatter,typeof f=="string"&&(f=new n.GeneralFormatter(f),this._sheet._editingTimeValue&&(f=new n.GeneralFormatter("yyyy/mm/dd hh:mm:ss")))):f=c._autoFormatter);if(!f||f instanceof n.AutoFormatter)if(u){e={},o=null;try{o=(new n.GeneralFormatter).GetPreferredDisplayFormatter(r,e)}catch(a){}ret
urn h=null,f&&f instanceof n.AutoFormatter&&e.value!==null&&o&&o.FormatString()!=="General"?h=new n.AutoFormatter(o):!f&&o&&(h=new n.AutoFormatter(o)),h&&(s=this._sheet.getStyle(t,i),s||(s=new n.Style),s._autoFormatter=h,this._sheet.setStyle(t,i,s)),e.hasOwnProperty("value")&&e.value!==undefined&&e.value!==null?e.value:r}else return r;else{l=null;try{l=f.Parse(r)}catch(a){}return l===undefined||l===null?r:l}},i}(r),t.CellEditUndoAction=v,k=function(n){function t(t,i){n.call(this),this._sheet=t,this._newName=i,this._oldName=null}return __extends(t,n),t.prototype.canUndo=function(){return!!this._oldName},t.prototype.canExecute=function(n){return this._sheet&&this._newName&&this._newName!==this._oldName},t.prototype.execute=function(n){var t=this._sheet;t&&this._newName&&this._newName!==this._oldName&&(this.saveState(),this._suspendInvalidate(n),t._name=th
is._newName,this._resumeInvalidate(n),t._refreshTabStrip())},t.prototype.saveState=function(){this._sheet&&(this._oldName=this._sheet._name)},t.prototype.undo=function(n){var t=this._sheet;return t?(this._suspendInvalidate(n),t._name=this._oldName,this._resumeInvalidate(n),t._refreshTabStrip(),!0):!1},t}(r),t.SheetRenameUndoAction=k,d=function(n){function t(t,i){n.call(this),this._sheet=t,i<.25?i=.25:i>4&&(i=4),this._zoomFactor=i,this._prevZoomFactor=-1}return __extends(t,n),t.prototype.canExecute=function(n){return this._sheet&&this._sheet.parent._allowUserZoom&&this._sheet._zoomFactor!==this._zoomFactor},t.prototype.execute=function(n){var t=this._sheet;this.saveState(),t&&(!t.parent||t.parent._allowUserZoom===!0)&&t._zoomFactor!==this._zoomFactor&&(t.isEditing()===!0&&t.endEdit(),this._suspendInvalidate(n),t.zoom(this._zoomFactor),this._resumeInvalidate(n),t.invalidateLayout(),t.repaint())},t.prototype.canUndo=
function(){return this._sheet&&this._prevZoomFactor>0},t.prototype.saveState=function(){this._sheet&&(this._prevZoomFactor=this._sheet._zoomFactor)},t.prototype.undo=function(n){var t=this._sheet;return t?(this._suspendInvalidate(n),t.zoom(this._prevZoomFactor),this._resumeInvalidate(n),t.invalidateLayout(),t.repaint(),!0):!1},t}(r),t.ZoomUndoAction=d,c=function(){function n(n,t){this.value=n,this.isFormula=t}return n}(),h=function(t){function r(n,i){t.call(this),this._sheet=n,this._clearRange=i,this._cachedFilteredColumns=null,this._cachedValues=null,this._cachedTables=null}return __extends(r,t),r.prototype.execute=function(t){var r,u,f;this.saveState(),r=this._sheet;if(r){u=r._getActualRange(this._clearRange);if(u.colCount>0&&u.rowCount>0)try{r._bind(n.Events.CellChanged,function(t,i){i.propertyName==="value"&&r._trigger(n.Events.ValueChanged,{sheet:i.sheet,sheetName:i.sheetName,row:i.row,col:i.col})}),f=r.isPaintSuspended(),r.isP
aintSuspended(!0),r.suspendEvent(),r.clear(u.row,u.col,u.rowCount,u.colCount,n.SheetArea.viewport,n.StorageType.Data),r.resumeEvent(),r.isPaintSuspended(f),r.repaint(),i.raiseRangeDataChanged(r,u.row,u.col,u.rowCount,u.colCount)}finally{this._sheet._unbind(n.Events.CellChanged)}}},r.prototype.canExecute=function(n){var t=this._sheet;return t.isProtected===!0&&t._isAnyCellInRangeLocked(this._clearRange)?!1:!0},r.prototype.canUndo=function(){return!!this._cachedValues},r.prototype.saveState=function(){var f=this._sheet,e,v,n,i,u,l,y,o,t,r,h,s,a;if(f){this._cachedTables=[],e=f.getTables();if(e&&e.length>0)for(r=0;r<e.length;r++)v=e[r],this._clearRange.containsRange(v.range())&&this._cachedTables.push(v);this._cachedFilteredColumns=[],n=f.rowFilter();if(n&&n.range&&n.isFiltered()){i=n.range.row,l=n.range.rowCount,n.showFilterButton&&(i=n.range.row-1,l=n.range.rowCount+1,i<0&&(i=-1,l=-1));if((this._clearRange.row===-1||this
._clearRange.row<=i&&i+l<=this._clearRange.row+this._clearRange.rowCount)&&(this._clearRange.col===-1||this._clearRange.col<=n.range.col&&n.range.col+n.range.colCount<=this._clearRange.col+this._clearRange.colCount))for(u=n.range.col<0?0:n.range.col,y=n.range.colCount<0?f.getColumnCount():n.range.colCount,o=0;o<y;o++)n.isColumnFiltered(u+o)&&this._cachedFilteredColumns.push(u+o)}t=f._getActualRange(this._clearRange);if(t.colCount>0&&t.rowCount>0)for(this._cachedValues=[t.row+t.rowCount],r=0;r<t.rowCount;r++)for(this._cachedValues[t.row+r]=[t.col+t.colCount],h=0;h<t.colCount;h++)i=t.row+r,u=t.col+h,s=f.getFormula(i,u),s&&s!==""?this._cachedValues[i][u]=new c(s,!0):(a=f.getValue(i,u),a!==undefined&&a!==null&&(this._cachedValues[i][u]=new c(a,!1)))}},r.prototype.undo=function(t){var r=this._sheet,l,u,a,v,f,h,e,o,s,c,y;if(r){l=!1;if(this._cachedTables&&this._cachedTables.le
ngth>0)for(a=this._cachedTables,v=a.length,u=0;u<v;u++)r._addTableInternal(a[u]);f=r._getActualRange(this._clearRange);if(this._cachedValues&&f.colCount>0&&f.rowCount>0)try{r._bind(n.Events.CellChanged,function(t,i){i.propertyName==="value"&&r._trigger(n.Events.ValueChanged,{sheet:i.sheet,sheetName:i.sheetName,row:i.row,col:i.col})});var p=f.rowCount,w=f.colCount,b=r.isPaintSuspended();for(r.isPaintSuspended(!0),r.suspendEvent(),u=0;u<p;u++)for(h=0;h<w;h++)e=f.row+u,o=f.col+h,this._cachedValues[e][o]?(s=this._cachedValues[e][o],s.isFormula?r.setFormula(e,o,s.value):(r.setFormula(e,o,null),r.setValue(e,o,s.value))):(r.setFormula(e,o,null),r.setValue(e,o,null));r.resumeEvent(),r.isPaintSuspended(b),i.raiseRangeDataChanged(r,f.row,f.col,f.rowCount,f.colCount),l=!0}finally{r._unbind(n.Events.CellChanged)}c=r.rowFilter();if(c&&this._cachedFilteredColumns&&this._cachedFilteredColumns.length>0)for(u=0;u<this._cachedF
ilteredColumns.length;u++)y=this._cachedFilteredColumns[u],c.filter(y);if(l)return r.repaint(),!0}return!1},r}(r),t.ClearRangeValueUndoAction=h,s=function(n){function t(t,i){n.call(this),this._cachedActions=[],this._sheet=t,this._cachedActions=null;if(i&&i.length>0){this._cachedActions=[];for(var r=0;r<i.length;r++)this._cachedActions[r]=new h(t,i[r])}}return __extends(t,n),t.prototype.canExecute=function(n){var t,i;if(this._cachedActions){for(t=0;t<this._cachedActions.length;t++){i=this._cachedActions[t];if(!i.canExecute(n))return!1}return!0}return!1},t.prototype.execute=function(n){var t,i;this.saveState();if(this._cachedActions){for(this._suspendInvalidate(n),t=0;t<this._cachedActions.length;t++)i=this._cachedActions[t],i.execute(n);this._resumeInvalidate(n),this._sheet.repaint()}},t.prototype.canUndo=function(){var n,t;if(this._cachedActions){for(n=0;n<this._cachedActions.length;n++){t=this._cachedActions[n];if(!t.canUndo())return!1}return!0}return!1},t.pr
ototype.saveState=function(){var n,t;if(this._cachedActions)for(n=0;n<this._cachedActions.length;n++)t=this._cachedActions[n],t.saveState()},t.prototype.undo=function(n){var t,r,i;if(this._cachedActions){for(t=this._cachedActions.length-1;t>=0;t--){r=this._cachedActions[t],this._suspendInvalidate(n),i=r.undo(n),this._resumeInvalidate(n);if(i)this._sheet.repaint();else return!1}return!0}return!1},t}(r),t.ClearValueUndoAction=s,w=function(t){function r(i,r){t.call(this),this._workSheet=i,this._dragFillExtent=r,this._dragFillExtent.autoFillType===n.AutoFillType.ClearValues?this._clearValueUndoAction=new s(i,[this._dragFillExtent.fillRange]):this.initWholeFilledRange(),this._fillSeries=this._dragFillExtent.fillDirection===n.FillDirection.Left||this._dragFillExtent.fillDirection===n.FillDirection.Right?n.FillSeries.Row:n.FillSeries.Column}return __extends(r,t),r.prototype.canExecute=function(t){return this._dragFillExtent.autoFillType===n.AutoFillType.ClearValues?this.canExecuteDra
gClear():this.canExecuteDragFill()},r.prototype.canExecuteDragClear=function(){return!0},r.prototype.canExecuteDragFill=function(){var n=this._dragFillExtent.startRange,t=this._dragFillExtent.fillRange;return!t.intersect(n.row,n.col,n.rowCount,n.colCount)},r.prototype.execute=function(n){if(this.canExecute(n)){var t=this._workSheet;try{this._suspendInvalidate(t),t.suspendCalcService(),this.saveState(),this._execute(t)}finally{t.resumeCalcService(),this._resumeInvalidate(t)}t.invalidateLayout(),t.repaint()}},r.prototype._execute=function(t){var r=this._workSheet,e=r.getSelections()?r.getSelections().toArray():null,u,f;this._dragFillExtent.autoFillType===n.AutoFillType.ClearValues?this.executeDragFillClear(t):this.executeDragFill(t),this._savedFilledViewportCells&&this._savedFilledViewportCells.isValueSaved()&&t===this._workSheet&&(u=this._dragFillExtent.fillRange,i.raiseRangeDataChanged(t,u.row,u.col,u.rowCount,u.colCount,this._savedFilledViewportCells.getValu
es())),f=r.getSelections()?r.getSelections().toArray():null,r._raiseSelectionChanging(e,f)&&r._raiseSelectionChanged()},r.prototype.executeDragFillClear=function(t){var r,u,i;this._clearValueUndoAction.execute(t),r=this._dragFillExtent.startRange,u=this._dragFillExtent.fillRange,r.equals(u)||(this._fillSeries===n.FillSeries.Column?(i=new n.Range(r.row,r.col,Math.max(1,r.rowCount-u.rowCount),r.colCount),t._setActiveCellImp(Math.max(t._getFirstVisualRow(),i.row),Math.max(t._getFirstVisualColumn(),i.col),t.activeRowViewportIndex,t.activeColViewportIndex),t._clearSelectionImp(),t.addSelection(i.row,i.col,i.rowCount,i.colCount)):(i=new n.Range(r.row,r.col,r.rowCount,Math.max(1,r.colCount-u.colCount)),t._setActiveCellImp(Math.max(t._getFirstVisualRow(),i.row),Math.max(t._getFirstVisualColumn(),i.col),t.activeRowViewportIndex,t.activeColViewportIndex),t._clearSelectionImp(),t.addSelection(i.row,i.col,i.rowCount,i.colCount)))},r.prototype.executeDragFill=function(t){var o=this._work
Sheet,r=this._dragFillExtent.startRange,s=this._dragFillExtent.fillRange,e,f,h,l,a,u,c;if(this._dragFillExtent.autoFillType===n.AutoFillType.FillSeries)this.clearData(s),h=this._dragFillExtent.fillDirection===n.FillDirection.Down||this._dragFillExtent.fillDirection===n.FillDirection.Right,h?o.fillAuto(r,this._wholeFillRange,this._fillSeries):o.fillLinear(r,this._wholeFillRange,this._fillSeries);else if(this._dragFillExtent.autoFillType===n.AutoFillType.CopyCells)this.copyCells(r,s,n.CopyToOption.All);else if(this._dragFillExtent.autoFillType===n.AutoFillType.FillFormattingOnly)this.copyCells(r,s,n.CopyToOption.Style);else if(this._dragFillExtent.autoFillType===n.AutoFillType.FillWithoutFormatting){this.clearData(s),l=r.rowCount===1&&r.colCount===1&&!(r.row===-1&&r.col!==-1)&&!(r.col===-1&&r.row!==-1);if(l)a=n.CopyToOption.Formula|n.CopyToOption.RangeGroup|n.CopyToOption.Span|n.CopyToOption.Sparkline|n.CopyToOption.Tag|n.CopyToOption.Value,this
.copyCells(r,s,a);else{for(u=this.adjustRange(this._wholeFillRange),c=new n._GcSheetModel(u.rowCount,u.colCount,null),e=0;e<u.rowCount;e++)for(f=0;f<u.colCount;f++)c.setStyle(e,f,i.getStyleObject(this._workSheet,u.row+e,u.col+f,n.SheetArea.viewport));for(h=this._dragFillExtent.fillDirection===n.FillDirection.Down||this._dragFillExtent.fillDirection===n.FillDirection.Right,h?o.fillAuto(r,this._wholeFillRange,this._fillSeries):o.fillLinear(r,this._wholeFillRange,this._fillSeries),e=0;e<u.rowCount;e++)for(f=0;f<u.colCount;f++)i.setStyleObject(this._workSheet,u.row+e,u.col+f,n.SheetArea.viewport,c.getStyle(e,f))}}o._setActiveCellImp(Math.max(t._getFirstVisualRow(),this._wholeFillRange.row),Math.max(t._getFirstVisualColumn(),this._wholeFillRange.col),t.activeRowViewportIndex,t.activeColViewportIndex),t._selectionModel&&t._clearSelectionImp(),o.addSelection(this._wholeFillRange.row,this._wholeFillRange.col,this._wholeFillRange.rowCount,this._wholeFillRange.colCount)},r
.prototype.clearData=function(t){var i=n.StorageType.Data;this._workSheet.clear(t.row,t.col,t.rowCount,t.colCount,n.SheetArea.viewport,i)},r.prototype.adjustRange=function(t){var u=t.row!==-1?t.row:0,f=t.col!==-1?t.col:0,i=t.rowCount!==-1?t.rowCount:this._workSheet.getRowCount(),r=t.colCount!==-1?t.colCount:this._workSheet.getColumnCount();return new n.Range(u,f,i,r)},r.prototype.copyCells=function(t,i,r){var p=this._workSheet,u=this.adjustRange(t),f=this.adjustRange(i),s,c,h,e,o,b,l,a,y,k,nt,v,tt,w,g,d;if(this._fillSeries===n.FillSeries.Column){for(y=Math.floor(f.rowCount/u.rowCount),s=0;s<y;s++)c=u.row,h=u.col,this._dragFillExtent.fillDirection===n.FillDirection.Down?e=f.row+s*u.rowCount:(b=f.row+f.rowCount,e=b-(s+1)*u.rowCount),o=f.col,l=u.rowCount,a=u.colCount,p.copyTo(c,h,e,o,l,a,r);k=f.rowCount%u.rowCount,k!==0&&(this._dragFillExtent.fillDirection===n.FillDirection.Down?c=u.row:(nt=u.rowCount-(f.rowCount-u.rowCount*y),c=u.row+nt),h=u.col,this._dragFillExtent.fillDir
ection===n.FillDirection.Down?e=f.row+u.rowCount*y:(b=f.row+f.rowCount,e=b-y*u.rowCount-k),o=f.col,l=k,a=u.colCount,p.copyTo(c,h,e,o,l,a,r))}else{for(v=Math.floor(f.colCount/u.colCount),s=0;s<v;s++)c=u.row,h=u.col,e=f.row,this._dragFillExtent.fillDirection===n.FillDirection.Right?o=f.col+s*u.colCount:(tt=f.col+f.colCount,o=tt-(s+1)*u.colCount),l=u.rowCount,a=u.colCount,p.copyTo(c,h,e,o,l,a,r);w=f.colCount%u.colCount,w!==0&&(c=u.row,this._dragFillExtent.fillDirection===n.FillDirection.Right?h=u.col:(g=u.colCount-(f.colCount-u.colCount*v),h=u.col+g),e=f.row,this._dragFillExtent.fillDirection===n.FillDirection.Right?o=f.col+u.colCount*v:(d=f.col+f.colCount,o=d-v*u.colCount-w),l=u.rowCount,a=w,p.copyTo(c,h,e,o,l,a,r))}},r.prototype.saveState=function(){this._dragFillExtent.autoFillType===n.AutoFillType.ClearValues?this.saveDragClearState():this.saveDragFillState()},r.prototype.saveDragClearState=function(){this._clearValueUndoAction.saveState()},r.prototype.saveDragFillState=
function(){this._savedFilledViewportCells=this.saveRangeStates(this._dragFillExtent.fillRange),this._savedStartViewportCells=this.saveRangeStates(this._dragFillExtent.startRange)},r.prototype.saveRangeStates=function(t){var r=this.adjustRange(t),f=new u(r.rowCount,r.colCount);return i.saveViewportInfo(this._workSheet,f,r.row,r.col,n.CopyToOption.All),f},r.prototype.undo=function(n){var i=this._workSheet,t=!1;try{t=this._undo(i)}finally{this._workSheet.resumeCalcService(),this._resumeInvalidate(i)}return t},r.prototype._undo=function(t){var f,o=t.getSelections()?t.getSelections().toArray():null,u=null,r=this._dragFillExtent.fillRange,e;return this._savedFilledViewportCells&&this._savedFilledViewportCells.isValueSaved()&&(u=i.getValues(this._workSheet,r.row,r.col,r.rowCount,r.colCount)),f=this._dragFillExtent.autoFillType===n.AutoFillType.ClearValues?this.undoDragClear(t):this.undoDragFill(t),t._skipCloseDragFillSmartTag!==!0&&t._closeDragFillPopup(),u&&
;i.raiseRangeDataChanged(t,r.row,r.col,r.rowCount,r.colCount,u),e=t.getSelections()?t.getSelections().toArray():null,t._raiseSelectionChanging(o,e)&&t._raiseSelectionChanged(),t.repaint(),f},r.prototype.undoDragClear=function(n){var t=this._clearValueUndoAction.undo(n);return n._setActiveCellImp(Math.max(n._getFirstVisualRow(),this._dragFillExtent.startRange.row),Math.max(n._getFirstVisualColumn(),this._dragFillExtent.startRange.col),n.activeRowViewportIndex,n.activeColViewportIndex),n._clearSelectionImp(),n.addSelection(this._dragFillExtent.startRange.row,this._dragFillExtent.startRange.col,this._dragFillExtent.startRange.rowCount,this._dragFillExtent.startRange.colCount),t},r.prototype.undoDragFill=function(n){this._suspendInvalidate(n),n.suspendCalcService();try{this.undoRangeStates(this._savedFilledViewportCells,this._dragFillExtent.fillRange),this.undoRangeStates(this._savedStartViewportCells,this._dragFillExtent.startRange),n._setActiveCellImp(Math.max(n._getFirstVisua
lRow(),this._dragFillExtent.startRange.row),Math.max(n._getFirstVisualColumn(),this._dragFillExtent.startRange.col),n.activeRowViewportIndex,n.activeColViewportIndex),n._clearSelectionImp(),n.addSelection(this._dragFillExtent.startRange.row,this._dragFillExtent.startRange.col,this._dragFillExtent.startRange.rowCount,this._dragFillExtent.startRange.colCount)}finally{n.resumeCalcService(),this._resumeInvalidate(n)}return n.invalidateLayout(),!0},r.prototype.undoRangeStates=function(t,r){var u=this.adjustRange(r);i.undoCellsInfo(this._workSheet,t,u.row,u.col,n.SheetArea.viewport)},r.prototype.initWholeFilledRange=function(){var u=0,f=0,e=0,o=0,i=this._dragFillExtent.fillDirection,t=this._dragFillExtent.startRange,r=this._dragFillExtent.fillRange;i===n.FillDirection.Left||i===n.FillDirection.Right?(u=t.row,f=t.rowCount,e=i===n.FillDirection.Left?r.col:t.col,o=t.colCount+r.colCount):(u=i===n.FillDirection.Up?r.row:t.row,f=t.rowCount+r.rowCount,e=t.col,o=t.colCount),this._wholeFillRange=n
ew n.Range(u,e,f,o)},r}(r),t.DragFillUndoAction=w,l=function(t){function r(n,i,r,u,f){t.call(this),this._sheet=n,this._fromSheet=i,this._toSheet=r,this._pasteExtent=u,this._pasteOption=f}return __extends(r,t),r.prototype.canUndo=function(){return!0},r.prototype.canExecute=function(n){return!0},r.prototype.saveState=function(){var d,tt,it,g,l,a,v,w,b,y,p,ut;this.initSaveState();var ht=this._pasteExtent.isCutting,s=r.convertPasteOption(this._pasteOption),t=this._pasteExtent.sourceRange,f=this._pasteExtent.targetRange;if(this._fromSheet&&t&&ht){var ft=t.row<0?0:t.row,et=t.col<0?0:t.col,nt=t.row<0?this._fromSheet.getRowCount():t.rowCount,k=t.col<0?this._fromSheet.getColumnCount():t.colCount;t.row<0&&t.col<0&&f.row<0&&f.col<0&&this._fromSheet._name!==this._toSheet._name&&(d=new rt,i.saveSheetInfo(this._fromSheet,d,s),this._savedFromSheetInfo=d),t.row<0&&(tt=new u(this._fromSheet.getRowCount(n.Sheet
Area.colHeader),k),it=new o(k),i.saveColumnHeaderInfo(this._fromSheet,tt,it,et,s),this._savedFromColumnHeaderCells=tt,this._savedFromColumns=it),t.col<0&&(g=new u(nt,this._fromSheet.getColumnCount(n.SheetArea.rowHeader)),l=new e(nt),i.saveRowHeaderInfo(this._fromSheet,g,l,ft,s),this._savedFromRowHeaderCells=g,this._savedFromRows=l),a=new u(nt,k),i.saveViewportInfo(this._fromSheet,a,ft,et,s),this._savedFromViewportCells=a}var st=f.row<0?0:f.row,ot=f.col<0?0:f.col,h=f.row<0?this._toSheet.getRowCount():f.rowCount,c=f.col<0?this._toSheet.getColumnCount():f.colCount;this._fromSheet&&t&&(t.row<0&&t.col<0&&f.row<0&&f.col<0&&this._fromSheet._name!==this._toSheet._name&&(v=new rt,i.saveSheetInfo(this._toSheet,v,s),this._savedToSheetInfo=v),t.row<0&&(w=new u(this._toSheet.getRowCount(n.SheetArea.colHeader),c),b=new o(c),i.saveColumnHeaderInfo(this._toSheet,w,b,ot,s),this._savedToColumnHeaderC
ells=w,this._savedToColumns=b),t.col<0&&(y=new u(h,this._toSheet.getColumnCount(n.SheetArea.rowHeader)),p=new e(h),i.saveRowHeaderInfo(this._toSheet,y,p,st,s),this._savedToRowHeaderCells=y,this._savedToRows=p)),ut=new u(h,c),i.saveViewportInfo(this._toSheet,ut,st,ot,s),this._savedToViewportCells=ut},r.prototype.initSaveState=function(){this._savedFromSheetInfo=null,this._savedFromColumnHeaderCells=null,this._savedFromColumns=null,this._savedFromViewportCells=null,this._savedFromRowHeaderCells=null,this._savedFromRows=null,this._savedToSheetInfo=null,this._savedToColumnHeaderCells=null,this._savedToColumns=null,this._savedToViewportCells=null,this._savedToRowHeaderCells=null,this._savedToRows=null},r.prototype.pasteOption=function(){return this._pasteOption},r.prototype.pasteRange=function(){return this._pasteExtent.targetRange},r.prototype.execute=function(n){var r=this._pasteExtent.sourceRange,t=this._pasteExtent.targetRange,u;if(this._fromSheet&&r&&!this
._fromSheet._isValidRange(r.row,r.col,r.rowCount,r.colCount,this._fromSheet.getRowCount(),this._fromSheet.getColumnCount()))return;if(!this._toSheet||!t)return;if(!this._toSheet._isValidRange(t.row,t.col,t.rowCount,t.colCount,this._toSheet.getRowCount(),this._toSheet.getColumnCount()))return;this.saveState(),this._suspendInvalidate(n);try{this._toSheet._clipboardPaste(this._fromSheet,r,this._toSheet,t,this._pasteExtent.isCutting,this._pasteExtent.clipboardText,this._pasteOption),u=this._sheet,u&&(this._pasteExtent.isCutting&&this._savedFromViewportCells&&this._savedFromViewportCells.isValueSaved()&&this._fromSheet&&i.raiseRangeDataChanged(this._fromSheet,r.row,r.col,r.rowCount,r.colCount,this._savedFromViewportCells.getValues()),this._savedToViewportCells&&this._savedToViewportCells.isValueSaved()&&this._toSheet&&i.raiseRangeDataChanged(this._toSheet,t.row,t.col,t.rowCount,t.colCount,this._savedToViewportCells.getValues
()))}finally{this._resumeInvalidate(n)}},r.prototype.undo=function(t){var u=this._pasteExtent.sourceRange,f=this._pasteExtent.targetRange,r,y;if(!this._toSheet||!f)return!1;if(!this._toSheet._isValidRange(f.row,f.col,f.rowCount,f.colCount,this._toSheet.getRowCount(),this._toSheet.getColumnCount()))return!1;if(this._fromSheet&&u){if(!this._fromSheet._isValidRange(u.row,u.col,u.rowCount,u.colCount,this._fromSheet.getRowCount(),this._fromSheet.getColumnCount()))return!1;if(this._fromSheet&&this._fromSheet._name===this._toSheet._name&&this._toSheet.parent&&!this._toSheet.parent.sheets.contains(this._fromSheet))return!1}this._suspendInvalidate(t),r=!1;try{var c=null,v=null,h=f.row<0?0:f.row,s=f.col<0?0:f.col,p=f.row<0?this._toSheet.getRowCount():f.rowCount,w=f.col<0?this._toSheet.getColumnCount():f.colCount;this._savedToSheetInfo&&(i.undoSheetInfo(this._toSheet,this._savedToSheetInfo),r=!0),this._savedToViewportCells&&this._save
dToViewportCells.isValueSaved()&&(c=i.getValues(this._toSheet,h,s,p,w)),this._savedToColumnHeaderCells&&(i.undoCellsInfo(this._toSheet,this._savedToColumnHeaderCells,0,s,n.SheetArea.colHeader),r=!0),this._savedToColumns&&(i.undoColumnsInfo(this._toSheet,this._savedToColumns,s),r=!0),this._savedToViewportCells&&(i.undoCellsInfo(this._toSheet,this._savedToViewportCells,h,s,n.SheetArea.viewport),r=!0),this._savedToRowHeaderCells&&(i.undoCellsInfo(this._toSheet,this._savedToRowHeaderCells,h,0,n.SheetArea.rowHeader),r=!0),this._savedToRows&&(i.undoRowsInfo(this._toSheet,this._savedToRows,h),r=!0);var e=0,o=0,l=0,a=0;this._fromSheet&&u&&(e=u.row<0?0:u.row,o=u.col<0?0:u.col,l=u.row<0?this._fromSheet.getRowCount():u.rowCount,a=u.col<0?this._fromSheet.getColumnCount():u.colCount,this._savedFromViewportCells&&this._savedFromViewportCells.isValueSaved()&&(v=i.getValues(this._fromSheet,e,o,l,a)),this._sa
vedFromColumnHeaderCells&&(i.undoCellsInfo(this._fromSheet,this._savedFromColumnHeaderCells,0,o,n.SheetArea.colHeader),r=!0),this._savedFromColumns&&(i.undoColumnsInfo(this._fromSheet,this._savedFromColumns,o),r=!0),this._savedFromViewportCells&&(i.undoCellsInfo(this._fromSheet,this._savedFromViewportCells,e,o,n.SheetArea.viewport),r=!0),this._savedFromRowHeaderCells&&(i.undoCellsInfo(this._fromSheet,this._savedFromRowHeaderCells,e,0,n.SheetArea.rowHeader),r=!0),this._savedFromRows&&(i.undoRowsInfo(this._fromSheet,this._savedFromRows,e),r=!0)),y=t,r&&y&&(c&&this._toSheet&&i.raiseRangeDataChanged(this._toSheet,h,s,p,w,c),v&&this._fromSheet&&i.raiseRangeDataChanged(this._fromSheet,e,o,l,a,v))}finally{this._resumeInvalidate(t)}return r},r.convertPasteOption=function(t){var i=0;return(t===n.ClipboardPasteOptions.All||t===n.ClipboardPasteOptions.Values)&&(i|=n.CopyToOption.Value),(t===n.Clipbo
ardPasteOptions.All||t===n.ClipboardPasteOptions.Formatting)&&(i|=n.CopyToOption.Style),(t===n.ClipboardPasteOptions.All||t===n.ClipboardPasteOptions.Formulas)&&(i|=n.CopyToOption.Formula),t===n.ClipboardPasteOptions.All&&(i|=n.CopyToOption.Span,i|=n.CopyToOption.Sparkline,i|=n.CopyToOption.BindingPath),i},r}(r),t.ClipboardPasteRangeUndoAction=l,b=function(t){function i(i,r,u,f,e){var o,s;t.call(this),this._sheet=i;if(!u)throw new Error(n._StringResource.Exp_DestSheetIsNull);if(!f)throw new Error(n._StringResource.Exp_PasteExtentIsNull);if(f.pastedRanges&&f.pastedRanges.length>0)for(this._cachedActions=[],o=0;o<f.pastedRanges.length;o++)s={sourceRange:f.fromRange,targetRange:f.pastedRanges[o],isCutting:f.isCutting,clipboardText:f.clipboardText},this._cachedActions[o]=new l(i,r,u,s,e)}return __extends(i,t),i.prototype.execute=function(n){var r,i,t,u;if(this._cachedActions){for(r=this._sheet,i=0;i<this._cachedActions.length;i++)t=this._cachedAc
tions[i],r?(u=r._raiseClipboardPasting(t.pasteRange(),t.pasteOption()),u||(t.execute(n),r._raiseClipboardPasted(t.pasteRange(),t.pasteOption()))):t.execute(n);this.refreshSelection(n),this.refreshUI(n)}},i.prototype.refreshSelection=function(n){var t=this._sheet,f,u,e,r,i;if(t)if(this._cachedActions){f=t.getSelections().toArray(),t._clearSelectionImp();if(this._cachedActions.length>1)for(u=0;u<this._cachedActions.length;u++)e=this._cachedActions[u],r=e.pasteRange(),t.addSelection(r.row,r.col,r.rowCount,r.colCount);else this._cachedActions.length>0&&(i=this._cachedActions[0].pasteRange(),t.addSelection(i.row,i.col,i.rowCount,i.colCount),i.contains(t._activeRowIndex,t._activeColIndex)||t._setActiveCellImp(Math.max(t._getFirstVisualRow(),i.row),Math.max(t._getFirstVisualColumn(),i.col),t.activeRowViewportIndex,t.activeColViewportIndex));t._raiseSelectionChanging(f,t.getSelections().toArray())&&t._raiseSelectionChanged()}},i.prototype.refreshUI=function(n){var t
=this._sheet;t&&(t.invalidateLayout(),t.repaint())},i.prototype.canExecute=function(n){var t,i;if(this._cachedActions){for(t=0;t<this._cachedActions.length;t++){i=this._cachedActions[t];if(!i.canExecute(n))return!1}return!0}return!1},i.prototype.canUndo=function(){var n,t;if(this._cachedActions){for(n=0;n<this._cachedActions.length;n++){t=this._cachedActions[n];if(!t.canUndo())return!1}return!0}return!1},i.prototype.saveState=function(){var n,t;if(this._cachedActions)for(n=0;n<this._cachedActions.length;n++)t=this._cachedActions[n],t.saveState()},i.prototype.undo=function(n){var i,t,r;if(this._cachedActions){for(i=!0,t=0;t<this._cachedActions.length;t++)r=this._cachedActions[t],i=i&&r.undo(n);return this.refreshUI(n),i}return!1},i}(r),t.ClipboardPasteUndoAction=b})(n.UndoRedo||(n.UndoRedo={}));var t=n.UndoRedo})(n.spread||(n.spread={}));var t=n.spread}(wijmo||(wijmo={}));var wijmo;(function(n){(function(t){var i,r,u;t.feature("core.sheet_event",
["core.migrate","core.common","core.sheet_action","core.stringResource"]),i=window.document,r=function(){function r(n){this.RESIZETOOLTIP_TOP=30,this.DRAGDROPTOOLTIP_OFFSET=5,this.DRAGFILLTOOLTIP_OFFSET=3,this.VSCROLLTOOLTIP_LEFT=100,this.HSCROLLTOOLTIP_LEFT=30,this.HSCROLLTOOLTIP_TOP=40,this.waittime=100,this.scrollTop=0,this.scrollLeft=0,this.oldLeft=0,this.oldTop=0,this._init(n)}return r.prototype._init=function(n){this._sheet=n,this._elem=null,this._eventSuspended=0},r.prototype._getElem=function(){return this._elem||(this._elem=i.createElement("input")),this._elem},r.prototype._dispose=function(){this._hScrollTimer&&this._hScrollTimer._dispose(),this._vScrollTimer&&this._vScrollTimer._dispose()},r.prototype._getHScrollTimer=function(){return this._hScrollTimer||(this._hScrollTimer=new t.Timer(this)),this._hScrollTimer},r.prototype._getVScrollTimer=function(){return this._vScrollTimer||(this._vScrollTimer=new t.Ti
mer(this)),this._vScrollTimer},r.prototype.doResize=function(){var t=this._sheet,n=t._getCanvas(),r,i;if(!n||!n.parentNode)return;if(n.parentNode.clientWidth===0||n.parentNode.clientHeight===0)return;r=0,i=0,n.style.display="none",n.width=Math.max(n.parentNode.clientWidth-r,0),n.height=Math.max(n.parentNode.clientHeight-i,0),n.style.display="",t._bounds.width=n.clientWidth||n.width,t._bounds.height=n.clientHeight||n.height,t.invalidateLayout(),t.repaint()},r.prototype._getCanvasOffset=function(){var t=this._sheet,n=$(t._getCanvas()).offset();return n?(isNaN(i.body.clientTop)||(n.top+=i.body.clientTop),isNaN(i.body.clientLeft)||(n.left+=i.body.clientLeft)):n={top:0,left:0},n},r.prototype.doMouseDown=function(n){var t,i,r;return n.button===2?!0:(t=this._sheet,t.inCanvas||this.handleDocumentMouseMove(),i=this._getCanvasOffset(),r=this.doMouseDownImp(n,n.pageX-i.left,n.pageY-i.top),t.isEditing()||r||this._setFocus(),t._isMouseDownInSheet=!0,!1)},r.prototype.handleDoc
umentMouseMove=function(){var n=this;this._isMouseCapture||($(i).bind("mousemove.gcSheet",function(t){n.doMouseMove(t)}),$(i).bind("mouseup.gcSheet",function(t){n.doMouseUp(t)}),this._isMouseCapture=!0)},r.prototype.unhandleDocumentMouseMove=function(){this._isMouseCapture&&(this._isMouseCapture=!1,$(i).unbind("mousemove.gcSheet"),$(i).unbind("mouseup.gcSheet"))},r.prototype.doMouseDownImp=function(n,i,r){var u=this._sheet,f=u.hitTest(i,r),d=f.groupHitInfo,w,l,a,c,o,e,b,h,k,y,p;if(d)u.isEditing()||this._doClickRangeGroup(d);else{u._currentTarget=f,this.isMouseDown=!0;if(f.resizeInfo)w=u.parent,w&&(l=w.showResizeTip(),(l===t.ShowResizeTip.Column&&f.resizeInfo.action==="sizeCol"||l===t.ShowResizeTip.Row&&f.resizeInfo.action==="sizeRow"||l===t.ShowResizeTip.Both)&&(r=r-this.RESIZETOOLTIP_TOP<0?r+this.RESIZETOOLTIP_TOP/2:r-this.RESIZETOOLTIP_TOP,this._showTooltip(this._getMouseDownResi
zeTooltipContent(),i,r))),u.endEdit(),this.isWorking=!0;else if(f.dragInfo&&f.dragInfo.side&&f.dragInfo.side!=="corner"){if(!u.endEdit())return;this.startDragDropping(f)}else if(f.dragInfo&&f.dragInfo.side==="corner"){if(!u.endEdit())return;this.startDragFill(f)}else if(f.filterButtonHitInfo){if(!u.endEdit())return;this._openFilterDialog(f.filterButtonHitInfo)}else{a=u.getActiveRowIndex(),c=u.getActiveColumnIndex();if(f.cellTypeHitInfo){o=f.row,e=f.col;if(o!==a||e!==c){b=u.isPaintSuspended(),u.isPaintSuspended(!0);try{if(!u.endEdit())return;h={sheet:u,sheetName:u._name,row:a,col:c,cancel:!1},u._trigger(t.Events.LeaveCell,h);if(h&&h.cancel===!0)return;var g=u._selectionModel.toArray(),v=null,s=u._spanModel.find(o,e);v=s?[new t.Range(s.row,s.col,s.rowCount,s.colCount)]:[new t.Range(o,e,1,1)],u._trigger(t.Events.SelectionChanging,{sheet:u,sheetName:u._name,oldSelections:g,newSelections:v}),u.setActiveCell(o,e),u._trigger(t.Events.Ente
rCell,{sheet:u,sheetName:u._name,row:o,col:e}),u._trigger(t.Events.SelectionChanged,{sheet:u,sheetName:u._name}),this._updateValidationUI(o,e)}finally{u.isPaintSuspended(b)}}k=u.getCellType(o,e,f.hitTestType),f.cellTypeHitInfo.sheet=u,k.processMouseDown(f.cellTypeHitInfo)}if(f.cellTypeHitInfo&&f.cellTypeHitInfo.isReservedLocation)return!0;else{this.setMetaKeyState(n);try{this._hitTestResult=f;if(u.isEditing()&&a===u.getActiveRowIndex()&&c===u.getActiveColumnIndex()&&!u.endEdit())return}finally{this._hitTestResult=null}if(f.row===undefined||f.row===null||f.col===undefined||f.col===null)return;f.hitTestType===t.SheetArea.viewport&&this._updateValidationUI(f.row,f.col),y=u._selectionModel.toArray(),this.startSelecting(f),p=u._selectionModel.toArray(),this._notEqualSelecions(y,p)&&u._trigger(t.Events.SelectionChanging,{sheet:u,sheetName:u._name,oldSelections:y,newSelections:p})}}}},r.prototype._openFilterDialog=function(n){if(!n||!t.featur
es.filter_ui)return;this._sheet._filterDialiog=new t._GcFilterDialog(this._sheet,n),this._sheet._filterDialiog.open()},r.prototype._doClickRangeGroup=function(i){var r=this._sheet,e,u,s,f,o,c,h;if(!r||!i||!t.features.group)return;i.what==="rgh"?r&&!r.isEditing()&&(e=i.info.index,u={sheet:r,sheetName:r._name,isRowGroup:!0,index:-1,level:e,cancel:!1},r._trigger(t.Events.RangeGroupStateChanging,u),u&&u.cancel===!1&&(s=new n.spread.UndoRedo.RowGroupHeaderExpandUndoAction(r,{level:e}),r._doCommand(s),r._trigger(t.Events.RangeGroupStateChanged,{sheet:r,sheetName:r._name,isRowGroup:!0,index:-1,level:e}))):i.what==="cgh"?r.isEditing()||(e=i.info.index,u={sheet:r,sheetName:r._name,isRowGroup:!1,index:-1,level:e,cancel:!1},r._trigger(t.Events.RangeGroupStateChanging,u),u&&u.cancel===!1&&(s=new t.UndoRedo.ColumnGroupHeaderExpandUndoAction(r,{level:e}),r._doCommand(s),r._trigger(t.Events.RangeGroupStateChanged,{sheet:r,sheetNam
e:r._name,isRowGroup:!1,index:-1,level:e}))):i.what==="rg"?r.rowRangeGroup&&(f=i.info.index,o=i.info.isExpanded,i.info.lineDirection===t.RangeGroupDirection.Forward?f--:f++,u={sheet:r,sheetName:r._name,isRowGroup:!0,index:f,level:i.info.level,cancel:!1},r._trigger(t.Events.RangeGroupStateChanging,u),u&&u.cancel===!1&&(c=new t.UndoRedo.RowGroupExpandUndoAction(r,{index:i.info.index,level:i.info.level,collapsed:o}),r._doCommand(c),r._trigger(t.Events.RangeGroupStateChanged,{sheet:r,sheetName:r._name,isRowGroup:!0,index:f,level:i.info.level}))):i.what==="cg"&&r.colRangeGroup&&(f=i.info.index,o=i.info.isExpanded,i.info.lineDirection===t.RangeGroupDirection.Forward?f--:f++,u={sheet:r,sheetName:r._name,isRowGroup:!1,index:f,level:i.info.level,cancel:!1},r._trigger(t.Events.RangeGroupStateChanging,u),u&&u.cancel===!1&&(h=new t.UndoRedo.ColumnGroupExpandUndoAction(r,{index:i.info.index,level:i.info.level,collapsed:o
}),r._doCommand(h),r._trigger(t.Events.RangeGroupStateChanged,{sheet:r,sheetName:r._name,isRowGroup:!1,index:f,level:i.info.level})))},r.prototype._isInvalidRect=function(n){var i=this._sheet,t;return i?(t=i._getSheetLayout(),n.x===null||n.x===undefined||n.y===null||n.y===undefined||n.width===null||n.width===undefined||n.height===null||n.height===undefined||n.x+n.width>t.viewportX+t.viewportWidth+t.frozenTrailingWidth||n.y+n.height>t.viewportY+t.viewportHeight+t.frozenTrailingHeight):!0},r.prototype._updateValidationUI=function(n,r){var u=this._sheet,d,k,v,e,y,w,a,b,tt,c,h;if(!u||!u.parent)return;u._disposeValidationUI(),d=u.parent.getActiveSheet();if(!d||u.getName()!==d.getName())return;var o=u.getDataValidator(n,r),l=this._getCanvasOffset(),f=u.getCellRect(n,r);if(this._isInvalidRect(f))return;o&&o.showInputMessage&&o.inputMessage&&(k=i.createElement("span"),$(k).css("position","absolute").css("border","1px
#C0C0C0 solid").css("padding","3px 8px 3px 8px").css("background-color","#FFFFFF").css("box-shadow","1px 2px 5px rgba(0,0,0,0.4)").css("font","normal normal normal 12px/normal Arial").width("auto").height("auto").css("top",f.y+f.height+l.top+5).css("left",f.x+f.width/2+l.left).html("<b>"+o.inputTitle+"</b><br/>"+o.inputMessage).attr("gcUIElement","gcValidationInputMessage").appendTo(i.body),u._validationInputMessage=k);if(o&&o.type===t.CriteriaType.List&&o.inCellDropdown){var g=o.condition.getValidList(u,n,r),p=g.length,s=i.createElement("select"),nt="";for(v=0;v<p;v++)e=g[v],e===null||e===undefined?e="":e instanceof Date&&(e=new t._DateTimeHelper(e).localeFormat("M/d/yyyy h:mm:ss")),nt+='<option value="'+e+'">'+e+"
</option>";y=u.getActualStyle(n,r),w=y&&y.font?y.font:u._render._getDefaultFont(),u._zoomFactor>1&&(w=u._render._getZoomFont(w)),$(s).html(nt).css("outline","none").css("position","absolute").css("font",w).width(f.width).height(p>8?140:"auto").css("top",f.y+f.height+l.top).css("left",f.x+l.left).attr("gcUIElement","gcValidationSelect").appendTo(i.body).attr("size",p>2?p:2).hide().val(u.getValue(n,r)).bind("click",function(){var h=$(s).val(),o=!1,i,f,e;u.isProtected&&(i=u.getActualStyle(n,r),i&&(o=i.locked)),h&&!o&&(f={row:n,col:r,newValue:h,autoFormat:!0},e=new t.UndoRedo.CellEditUndoAction(u,f),u._doCommand(e)),$(s).hide()}).bind("keydown",function(i){var o,e,f,c,h;i.keyCode!==t.Key.enter||i.ctrlKey||i.shiftKey||i.altKey?i.keyCode!==t.Key.esc||i.ctrlKey||i.shiftKey||i.altKey||$(s).hide()
:(o=$(s).val(),e=!1,u.isProtected&&(f=u.getActualStyle(n,r),f&&(e=f.locked)),o&&!e&&(c={row:n,col:r,newValue:o,autoFormat:!0},h=new t.UndoRedo.CellEditUndoAction(u,c),u._doCommand(h)),$(s).hide())}),u._validationSelect=s,a=u.getSpans(new t.Range(n,r,1,1)),b=1,a&&a.length>0&&a[0]&&(b=a[0].colCount),tt=r+b-1==u.getColumnCount()-1,c=i.createElement("input"),c.type="image",c.src=t._GcFilterDialog.getImageSrc(t._FilterButtonState.noSortFilter),c.alt="v",h=u.getRowHeight(n)*u._zoomFactor,h>15&&(h=15),$(c).css("position","absolute").width(h).height(h).css("top",f.y+f.height+l.top-(h+3)).css("left",f.x+f.width+l.left-(tt?h:0)).css("background-color","white").css("border","1px solid gray").attr("gcUIElement","gcValidationButton").appendTo(i.body).click(function(){u.isEditing()&&u.endEdit
(),$(u._validationSelect).toggle().focus()}),u._validationButton=c}},r.prototype.startScroll=function(){if(!this.startHitInfo)return;var n=this.startHitInfo.hitTestType;(n===t.SheetArea.viewport||n===t.SheetArea.rowHeader)&&this._getVScrollTimer().setAction(this.processVSScrolled),(n===t.SheetArea.viewport||n===t.SheetArea.colHeader)&&this._getHScrollTimer().setAction(this.processHSScrolled)},r.prototype.processVSScrolled=function(n){var o=this.adjustScrollRowViewport(),i,u,f;if(!o){var s=this.startHitInfo,t=this._sheet,e=s.scrollRowViewportIndex,r=t.getViewportTopRow(e),h=t.getViewportBottomRow(e);n?h<t.getRowCount()-t._frozenTrailingRowCount-1?t._setTopRow(t._getNextVisualRow(r)):(i=t._getRowLayout(e),i&&i.length>0&&(u=t._getSheetLayout(),f=i[i.length-1],f.y+f.height<u.viewportY+u.viewportHeight||t._setTopRow(t._getNextVisualRow(r)))):r>t.frozenRowCount&&t._setTopRow(t._getPrevVisualRow(r))}this.isSelecting&&this.continue
Selecting(),this.isDragDropping&&this.continueDragDropping(),this.isDraggingFill&&this.continueDragFill()},r.prototype.processHSScrolled=function(n){var o=this.adjustScrollColViewport(),i,f,u;if(!o){var t=this._sheet,s=this.startHitInfo,e=s.scrollColViewportIndex,r=t.getViewportLeftColumn(e),h=t.getViewportRightColumn(e);n?h<t.getColumnCount()-t._frozenTrailingColCount-1?t._setLeftColumn(t._getNextVisualColumn(r)):(i=t._getColumnLayout(e),i&&i.length>0&&(f=t._getSheetLayout(),u=i[i.length-1],u.x+u.width<f.viewportX+f.viewportWidth||t._setLeftColumn(t._getNextVisualColumn(r)))):r>t.frozenColCount&&t._setLeftColumn(t._getPrevVisualColumn(r))}this.isSelecting&&this.continueSelecting(),this.isDragDropping&&this.continueDragDropping(),this.isDraggingFill&&this.continueDragFill()},r.prototype.adjustScrollRowViewport=function(){var n=this._sheet,r=n._getSheetLayout(),o=this.mousePosition,f=this.startHitInfo,s=f.scr
ollRowViewportIndex,t,i,u;if(s===0){if(o.y>r.viewportY)return n._setTopRow(n._getFirstPageTopRow()),f.scrollRowViewportIndex=1,!0}else if(s===1){t=n._getRowLayout(1);if(t&&t.length>0){i=t[0];if(n.frozenRowCount>0&&o.y<r.viewportY&&i.row<=n._getFirstPageTopRow())return f.scrollRowViewportIndex=0,!0;i=t[t.length-1];if(n._frozenTrailingRowCount>0&&o.y>r.frozenTrailingY&&i.row>=n._getLastVisualRow()&&i.y+i.height<=r.frozenTrailingY)return f.scrollRowViewportIndex=2,!0}}else if(s===2){t=n._getRowLayout(1);if(t&&t.length>0&&o.y<r.frozenTrailingY){i=t[t.length-1];if(i.y+i.height>r.frozenTrailingY){var c=r.viewportHeight,e=n.getRowCount()-n._frozenTrailingRowCount-1,h=0;for(u=e;u>=n.frozenRowCount;u--){h+=n._getZoomRowHeight(u);if(h>c){e=Math.min(u+1,e);break}}n._setTopRow(n._getNextVisualRow(e-1))}return f.scrollRowViewportIndex=1,!0}}return!1},r.prototype.adjustScrollColViewport=funct
ion(){var n=this._sheet,r=n._getSheetLayout(),o=this.mousePosition,f=this.startHitInfo,s=f.scrollColViewportIndex,t,i,u;if(s===0){if(o.x>r.viewportX)return n._setLeftColumn(n._getFirstPageLeftColumn()),f.scrollColViewportIndex=1,!0}else if(s===1){t=n._getColumnLayout(1);if(t&&t.length>0){i=t[0];if(n.frozenColCount>0&&o.x<r.viewportX&&i.col<=n._getFirstPageLeftColumn())return f.scrollColViewportIndex=0,!0;i=t[t.length-1];if(n._frozenTrailingColCount>0&&o.x>r.frozenTrailingX&&i.col>=n._getLastVisualColumn()&&i.x+i.width<=r.frozenTrailingX)return f.scrollColViewportIndex=2,!0}}else if(s===2){t=n._getColumnLayout(1);if(t&&t.length>0&&o.x<r.frozenTrailingX){i=t[t.length-1];if(i.x+i.width>r.frozenTrailingX){var c=r.viewportWidth,e=n.getColumnCount()-n._frozenTrailingColCount-1,h=0;for(u=e;u>=n.frozenColCount;u--){h+=n._getZoomColumnWidth(u);if(h>c){e=Math.min(u+1,e);break}}n._setLeftC
olumn(n._getNextVisualColumn(e-1))}return f.scrollColViewportIndex=1,!0}}return!1},r.prototype.continueScroll=function(){var r,i;if(!this.isWorking)return;var s=this._sheet,e=s._getSheetLayout(),o=this.startHitInfo,f=o.scrollRowViewportIndex,u=o.scrollColViewportIndex,t=this.mousePosition,n=null;f<0||u<0?f<0?u<0||(n=e.colHeaderRect(u)):n=e.rowHeaderRect(f):n=e.viewportRect(f,u),n&&(r=0,i=0,t.x>n.x?t.x<n.x+n.width||(r=t.x-(n.x+n.width)):r=t.x-n.x,t.y>n.y?t.y<n.y+n.height||(i=t.y-(n.y+n.height)):i=t.y-n.y,this._getHScrollTimer().setInterval(this.getIntervalFromDistance(r)),this._getVScrollTimer().setInterval(this.getIntervalFromDistance(i)))},r.prototype.stopScroll=function(){this._getHScrollTimer().stop(),this._getVScrollTimer().stop()},r.prototype.startSelecting=function(n){var c=0,v=0,y=0,l=0,i=this._sheet,e,r,u,s,h,a,f,o;this._lastSelections=i._selectionModel.toArray(),this.ctrl||this.shift||i._clearSelectionImp(),this.startHitInfo={scrollRowViewpor
tIndex:n.rowViewportIndex,scrollColViewportIndex:n.colViewportIndex,hitTestType:n.hitTestType},this.startScroll();if(n.hitTestType===t.SheetArea.corner){if(!this.shift){e=i.frozenRowCount?i._getFirstVisualRow():i._scrollTopRow,h=i.frozenColCount?i._getFirstVisualColumn():i._scrollLeftCol,r={sheet:i,sheetName:i._name,row:i._activeRowIndex,col:i._activeColIndex,cancel:!1},i._trigger(t.Events.LeaveCell,r);if(r&&r.cancel===!0)return;i._setActiveCellImp(e,h,1,1),i._trigger(t.Events.EnterCell,{sheet:i,sheetName:i._name,row:e,col:h}),this._updateValidationUI(e,h)}this.ctrl||i._clearSelectionImp(),i._setSelectedRange(-1,-1,i.getRowCount(),i.getColumnCount(),!0),this.isWorking=!0}else if(n.hitTestType===t.SheetArea.colHeader){if(!this.shift){e=i.frozenRowCount?i._getFirstVisualRow():i._scrollTopRow,u=i._getAvailableActiveCell(e,n.col,!1),r={sheet:i,sheetName:i._name,row:i._activeRowIndex,col:i._activeColIndex,cancel:!1},i._trigger(t.Events.LeaveCell,r);if(r&&r.cancel===!0)ret
urn;i._setActiveCellImp(u.row,u.col,1,n.colViewportIndex),i._trigger(t.Events.EnterCell,{sheet:i,sheetName:i._name,row:u.row,col:u.col}),this._updateValidationUI(u.row,u.col)}this.shift?(c=Math.min(i._activeColIndex,n.col),l=Math.abs(i._activeColIndex-n.col)+1,i._replaceActiveSelectedRange(-1,c,i.getRowCount(),l,!0)):i._setSelectedRange(-1,i._activeColIndex,i.getRowCount(),1,!0),this.isWorking=!0}else if(n.hitTestType===t.SheetArea.rowHeader){if(!this.shift){a=i.frozenColCount?i._getFirstVisualColumn():i._scrollLeftCol,u=i._getAvailableActiveCell(n.row,a,!0),r={sheet:i,sheetName:i._name,row:i._activeRowIndex,col:i._activeColIndex,cancel:!1},i._trigger(t.Events.LeaveCell,r);if(r&&r.cancel===!0)return;s=i._activeRowIndex!==u.row,i._setActiveCellImp(u.row,u.col,n.rowViewportIndex,1),s&&i.doDataItemChanged(),i._trigger(t.Events.EnterCell,{sheet:i,sheetName:i._name,row:u.row,col:u.col}),this._updateValidationUI(u.row,u.col)}this.shift?(v=Math.min(i._activeRowIndex,n.row),
y=Math.abs(i._activeRowIndex-n.row)+1,i._replaceActiveSelectedRange(v,-1,y,i.getColumnCount(),!0)):i._setSelectedRange(i._activeRowIndex,-1,1,i.getColumnCount(),!0),this.isWorking=!0}else if(n.hitTestType===t.SheetArea.viewport)if(isNaN(n.row)||isNaN(n.col))i.isEditing()&&(o=i.getCellRect(i._activeRowIndex,i._activeColIndex,i.activeRowViewportIndex,i.activeColViewportIndex),i._render.update(o.x,o.y,o.width,o.height)),this.startHitInfo=null;else{if(!this.shift)if(i._activeRowIndex!==n.row||i._activeColIndex!==n.col){r={sheet:i,sheetName:i._name,row:i._activeRowIndex,col:i._activeColIndex,cancel:!1},i._trigger(t.Events.LeaveCell,r);if(r&&r.cancel===!0)return;s=i._activeRowIndex!==n.row,i._setActiveCellImp(n.row,n.col,n.rowViewportIndex,n.colViewportIndex),s&&i.doDataItemChanged(),i._trigger(t.Events.EnterCell,{sheet:i,sheetName:i._name,row:n.row,col:n.col}),this._updateValidationUI(n.row,n.col)}this.shift?i._extendSelectedRange(n.row,n.col,!0):(f=i._spanModel.f
ind(n.row,n.col),f?i._setSelectedRange(f.row,f.col,f.rowCount,f.colCount,!0):i._setSelectedRange(n.row,n.col,1,1,!0)),this.isWorking=!0}this.isSelecting=this.isWorking},r.prototype.continueSelecting=function(n){if(!this.startHitInfo||!this.isWorking)return;if(this._forceCancelSelectiong===!0)return;var i=this.startHitInfo.hitTestType;i===t.SheetArea.viewport?this.continueCellSelecting():i===t.SheetArea.rowHeader?this.continueRowSelecting():i===t.SheetArea.colHeader&&this.continueColumnSelecting()},r.prototype.continueCellSelecting=function(){var n=this._sheet,f=this.getHitRowIndex(),u=this.getHitColumnIndex(),i,r;f<0||u<0||(i=n._selectionModel.toArray(),n._extendSelectedRange(f,u,!0),r=n._selectionModel.toArray(),this._notEqualSelecions(i,r)&&n._trigger(t.Events.SelectionChanging,{sheet:n,sheetName:n._name,oldSelections:i,newSelections:r})),this.continueScroll()},r.prototype.continueRowSelecting=function(){var n=this._sheet,f=this.getHitRowIndex(),e,r,i;if(f>
;=0){var u=Math.min(n._activeRowIndex,f),o=Math.max(n._activeRowIndex,f)-u+1,s=-1,h=n.getColumnCount(),c=n.selectionPolicy();if(c===t.SelectionPolicy.Single)return;e=n.selectionUnit(),e===t.SelectionUnit.Column&&(u=-1,o=-1),r=n._selectionModel.toArray(),n._replaceActiveSelectedRange(u,s,o,h,!0),i=n._selectionModel.toArray(),this._notEqualSelecions(r,i)&&n._trigger(t.Events.SelectionChanging,{sheet:n,sheetName:n._name,oldSelections:r,newSelections:i})}this.continueScroll()},r.prototype.continueColumnSelecting=function(){var n=this._sheet,f=this.getHitColumnIndex(),e,r,i;if(f>=0){var u=Math.min(n._activeColIndex,f),o=Math.max(n._activeColIndex,f)-u+1,s=-1,h=n.getRowCount(),c=n.selectionPolicy();if(c===t.SelectionPolicy.Single)return;e=n.selectionUnit(),e===t.SelectionUnit.Row&&(u=-1,o=-1),r=n._selectionModel.toArray(),n._replaceActiveSelectedRange(s,u,h,o,!0),i=n._selectionModel.toArray(),this._notEqualSelecions(r,i)&&n._trigger(t.Events.SelectionCha
nging,{sheet:n,sheetName:n._name,oldSelections:r,newSelections:i})}this.continueScroll()},r.prototype.stopSelecting=function(){var i,n,r;this.startHitInfo=null,this.stopScroll(),this._forceCancelSelectiong=null,this.isWorking=!1,this.isSelecting=!1,i=this._sheet,n=!this._lastSelections,n||(r=i._selectionModel.toArray(),n=this._notEqualSelecions(this._lastSelections,r)),n&&i._trigger(t.Events.SelectionChanged,{sheet:this._sheet,sheetName:this._sheet._name})},r.prototype.startDragDropping=function(n){var f,u,h,s,r;if(this.isDragDropping)return;f=this._sheet,u=null,f._selectionModel.length===1?u=f._selectionModel[0]:f._selectionModel.length<1&&(h=f._spanModel.find(f._activeRowIndex,f._activeColIndex),u=h?h:new t.Range(f._activeRowIndex,f._activeColIndex,1,1));if(u){this.isDragDropping=!0,this.isWorking=!0,this._dragDropFromRange=u,s=f._getRangeRect(n.rowViewportIndex,n.colViewportIndex,u),r=f._dragRect,r.x=s.x,r.y=s.y,r.width=s.width-1,r.height=s.height-1,r.row=u.row
,r.col=u.col,r.rowCount=u.rowCount,r.colCount=u.colCount;var i=f._fixRange(u),e=n.row,o=n.col;e<i.row&&(e=i.row),e<i.row+i.rowCount||(e=i.row+i.rowCount-1),o<i.col&&(o=i.col),o<i.col+i.colCount||(o=i.col+i.colCount-1),r.hitRow=e,r.hitCol=o,r.rowOffset=e-i.row,r.colOffset=o-i.col,this.startHitInfo={scrollRowViewportIndex:n.rowViewportIndex,scrollColViewportIndex:n.colViewportIndex,hitTestType:n.hitTestType},this.startScroll()}},r.prototype.continueDragDropping=function(){var n,t;if(!this.startHitInfo||!this.isWorking)return;if(!this.isDragDropping||!this._dragDropFromRange)return;var i=this.mousePosition,u=this._sheet,r=u._dragRect;r.hitTarget={x:i.x,y:i.y},n=this.getHitRowIndex(),t=this.getHitColumnIndex(),n<0||t<0||this.updateDragDropRect(n,t),this.continueScroll()},r.prototype.updateDragDropRect=function(n,t){var r,f,o,h,s;if(!this.isDragDropping||!this._dragDropFromRange)return;var u=this._sheet,i=u._dragRect,e=u._getActiveSelectedRange();e.row==
=-1&&e.col!==-1?(i.row=-1,i.col=t):e.row!==-1&&e.col===-1?(i.row=n,i.col=-1):(i.row=i.row<0?-1:Math.max(0,Math.min(u.getRowCount()-i.rowCount,n-i.rowOffset)),i.col=i.col<0?-1:Math.max(0,Math.min(u.getColumnCount()-i.colCount,t-i.colOffset))),i.hitRow=n,i.hitCol=t,r=u._fixRange(i),f=u._oldDragRange;if(f)if(r.row===f.row&&r.col===f.col&&r.rowCount===f.rowCount&&r.colCount===f.colCount&&r.row>u._getFirstVisualRow()&&r.col>u._getFirstVisualColumn()&&r.row+r.rowCount-1<u._getLastVisualRow()&&r.col+r.colCount-1<u._getLastVisualColumn())return;u._actualDragRange=r,u._render.refreshDragDropIndicator(),u._oldDragRange=r,o=u.parent,o&&o.showDragDropTip()&&(h=i.x+i.width+this.DRAGDROPTOOLTIP_OFFSET,s=i.y+i.height+this.DRAGDROPTOOLTIP_OFFSET,this._showTooltip(this._getDragDropRectString(r),h,s))},r.prototype._getDragDropRectString=function(i){if(i&&t.util.hasCalc()){var o=this._shee
t,r=o._getActiveSelectedRange(),f=o.getActiveRowIndex(),u=o.getActiveColumnIndex(),e;return f=f<0?0:f,u=u<0?0:u,r.rowCount===1&&r.colCount===1?e=new n.spread.Calc.Expressions.CellExpression(i.row-f,i.col-u,!0,!0):(e=new n.spread.Calc.Expressions.RangeExpression,r.row!==-1||r.col<0?r.col!==-1||r.row<0?r.row<0||r.col<0||e.init(i.row-f,i.col-u,i.row-f+r.rowCount-1,i.col-u+r.colCount-1,!0,!0,!0,!0):e.initBand(i.row-f,i.row-f+r.rowCount-1,!0,!0,!0):e.initBand(i.col-u,i.col-u+r.colCount-1,!0,!0,!1)),o.getCalcService().unparse(e,f,u)}else return undefined},r.prototype.stopDragDrop=function(){var r=!1,h="",p=!1,i=this._sheet,y=null,l;this.startHitInfo=null,this.stopScroll(),l=i._getActiveSelectedRange(),y=l&&(l.rowCount>0||l.colCount>0)?{r:l.row,c:l.col,rc:l.rowCount,cc:l.colCount}:{r:i._activeRowIndex,c:i._activeColIndex,rc:1,cc:1};if(this.isDragDropping===!0&&this.isWorking===!0){var u=y.r,f=y.c,e=y.rc,s=y.cc,c=i._dragRect.row,o=i.
_dragRect.col,v,a,n;this._isDragInsert&&(u===-1||f===-1)?f>=0&&u<0?(this._isDragCopy&&(o<=f||o>=f+s)||!this._isDragCopy&&(o<f||o>f+s))&&((i._hasPartSpans(-1,f,-1,s)||i._hasPartSpans(-1,o,-1,0))&&(r=!0,h=t._StringResource.Exp_ChangeMergedCell),r||(i._hasPartArrayFormulas(-1,f,-1,s)||i._hasPartArrayFormulas(-1,o,-1,0))&&(r=!0,h=t._StringResource.Exp_ChangePartOfArray),!r&&i.isProtected&&(r=!0,h=t._StringResource.Exp_ColumnReadOnly),!r&&i._hasPartTable(-1,o,-1,1)&&(r=!0,h=t._StringResource.Exp_DragDropShiftTableCell),r||this._isDragCopy||!i._hasPartTable(-1,f,-1,s)||(r=!0,h=t._StringResource.Exp_DragDropChangePartOfTable),r||(n=new t.UndoRedo.DragDropExtent(-1,f,-1,o,-1,s),a=i._raiseDragDropBlock(n.fromRow,n.fromColumn,n.toRow,n.toColumn,n.rowCount,n.columnCount,this._isDragCopy,!0,t.CopyToOption.All),a||(v=new t.UndoRedo.DragDropUndoAction(i,n,this._isDragCopy,!0,t.CopyToOption.Al
l),i.doCommand(v),i._raiseDragDropBlockCompleted(n.fromRow,n.fromColumn,n.toRow,n.toColumn,n.rowCount,n.columnCount,this._isDragCopy,!0,t.CopyToOption.All),p=!0))):u>=0&&f<0&&(this._isDragCopy&&(c<=u||c>=u+e)||!this._isDragCopy&&(c<u||c>u+e))&&((i._hasPartSpans(u,-1,e,-1)||i._hasPartSpans(c,-1,0,-1))&&(r=!0,h=t._StringResource.Exp_ChangeMergedCell),r||(i._hasPartArrayFormulas(u,-1,e,-1)||i._hasPartArrayFormulas(c,-1,0,-1))&&(r=!0,h=t._StringResource.Exp_ChangePartOfArray),!r&&i.isProtected&&(r=!0,h=t._StringResource.Exp_RowReadOnly),r||this._isDragCopy||!i._hasPartTable(u,-1,e,-1)||(r=!0,h=t._StringResource.Exp_DragDropChangePartOfTable),r||(n=new t.UndoRedo.DragDropExtent(u,-1,c,-1,e,-1),a=i._raiseDragDropBlock(n.fromRow,n.fromColumn,n.toRow,n.toColumn,n.rowCount,n.columnCount,this._isDragCopy,!0,t.CopyToOption.All),a||(v=new t.UndoRedo.DragDropUndoAction(i,n,this._isDragCopy,!0,t.CopyToOption
.All),i.doCommand(v),i._raiseDragDropBlockCompleted(n.fromRow,n.fromColumn,n.toRow,n.toColumn,n.rowCount,n.columnCount,this._isDragCopy,!0,t.CopyToOption.All),p=!0))):(c!==u||o!==f)&&((i._hasPartSpans(u,f,e,s)||i._hasPartSpans(c,o,e,s))&&(r=!0,h=t._StringResource.Exp_ChangeMergedCell),r||(i._hasPartArrayFormulas(u,f,e,s)||i._hasPartArrayFormulas(c,o,e,s))&&(r=!0,h=t._StringResource.Exp_ChangePartOfArray),!r&&i.isProtected&&(!this._isDragCopy&&i._isAnyCellInRangeLocked(new t.Range(u,f,e,s))||i._isAnyCellInRangeLocked(new t.Range(c,o,e,s)))&&(r=!0,h=t._StringResource.Exp_CellReadOnly),r||(n=new t.UndoRedo.DragDropExtent(u,f,c,o,e,s),a=i._raiseDragDropBlock(n.fromRow,n.fromColumn,n.toRow,n.toColumn,n.rowCount,n.columnCount,this._isDragCopy,!1,t.CopyToOption.All),a||(v=new t.UndoRedo.DragDropUndoAction(i,n,this._isDragCopy,!1,t.CopyToOption.All),i.doCommand(v),i._raiseDragDropBlockCompleted(n.fromRow,n.fromColumn,n.toRow,n.toColumn
,n.rowCount,n.columnCount,this._isDragCopy,!1,t.CopyToOption.All),p=!0)))}this.isWorking=!1,this.isDragDropping=!1,this._dragDropFromRange=null,this._isDragInsert=!1,this._isDragCopy=!1,this._removeTooltip(),p===!1&&(i._dragRect={},i.repaint()),r&&i._raiseInvalidOperation(t.InvalidOperationType.DragDrop,h)},r.prototype.startDragFill=function(n){if(this.isDraggingFill===!0||this.isWorking===!0)return;this.updateDragFillStartRange();if(!this._dragFillStartRange)return;this.isWorking=!0,this.isDraggingFill=!0,this._dragStartRowViewport=n.rowViewportIndex,this._dragStartColumnViewport=n.colViewportIndex,this._dragToRowViewport=n.rowViewportIndex,this._dragToColumnViewport=n.colViewportIndex,this.updateDragStartRangeViewports(),this.startHitInfo={scrollRowViewportIndex:n.rowViewportIndex,scrollColViewportIndex:n.colViewportIndex,hitTestType:n.hitTestType},this.startScroll()},r.prototype.updateDragStartRangeViewports=function(){var t=this.dragFillStartTopRow(),n;t>=0&am
p;&t<this._sheet.frozenRowCount?this._dragFillStartTopRowViewport=0:t<this._sheet.frozenRowCount||t>this._sheet.getRowCount()||(this._dragFillStartTopRowViewport=1),this._dragFillStartBottomRowViewport=this.isDragFillWholeColumns()?1:this._dragStartRowViewport,n=this.dragFillStartLeftColumn(),n>=0&&n<this._sheet.frozenColCount?this._dragFillStartLeftColumnViewport=0:n<this._sheet.frozenColCount||n>this._sheet.getColumnCount()||(this._dragFillStartLeftColumnViewport=1),this._dragFillStartRightColumnViewport=this.isDragFillWholeRows()?1:this._dragStartColumnViewport},r.prototype.continueDragFill=function(){if(!this.startHitInfo||!this.isDraggingFill)return;if(!this.isWorking||!this._dragFillStartRange)return;this._dragToRowViewport=this.getHitRowViewportIndex(),this._dragToColumnViewport=this.getHitColumnViewportIndex(),this._dragToRow=this.getHitRowIndex(),this._dragToColumn=this.getHitColumnIndex();if(this._dragToRow>=0&&this._dragToColumn
>=0){this.updateCurrentFillSettings(),this.updateCurrentFillRange();var n=this._sheet.parent;n&&n.showDragFillTip()&&this._showDragFillTooltip(),this.refreshDragFill()}this.continueScroll()},r.prototype._getDragFillTooltipContent=function(){var o,r,n,c;if(!t.features.fill)return null;var u=this._sheet,s=this._dragFillStartRange,v=this._currentFillRange,l=this.getDragAutoFillType(),i=this.getCurrentFillDirection(),a=this.getDragFillFrameRange(),f;if(l===t.AutoFillType.FillSeries){f=i===t.FillDirection.Left||i===t.FillDirection.Right?t.FillSeries.Row:t.FillSeries.Column,o=new t.FillImp(u),r=null,r=i===t.FillDirection.Down||i===t.FillDirection.Right?o.fillAuto(a,f,!0):o.seriesTrendFillRange(a,f,t.FillType.Linear,!0);var n=this._getAvailableRange(i,v,s),e=u.getActualStyle(n.row,n.col),y=u.getCellTypeCore(e),h=e.formatter?e.formatter:e._autoFormatter;return r instanceof Date&&t.features.formatter&&(h=new t.GeneralFormatter("[$-409]m/d/yy hh:mm:ss A
M/PM;@",0)),y.format(r,h)}else return l===t.AutoFillType.CopyCells?(n=this._getAvailableRange(i,v,s),c=u.getFormula(n.row,n.col),c?null:u.getText(n.row,n.col)):null},r.prototype._getAvailableRange=function(n,i,r){var f=new t.Range(r.row,r.col,1,1),u;return n===t.FillDirection.Down?(u=i.rowCount%r.rowCount,u=u===0?r.row+r.rowCount-1:r.row+u-1,f.row=u,f.col=r.col):n===t.FillDirection.Right?(u=i.colCount%r.colCount,u=u===0?r.col+r.colCount-1:r.col+u-1,f.row=r.row,f.col=u):n===t.FillDirection.Left?(u=i.colCount%r.colCount,u=u===0?r.col:r.col+r.colCount-u,f.row=r.row,f.col=u):n===t.FillDirection.Up&&(u=i.rowCount%r.rowCount,u=u===0?r.row:r.row+r.rowCount-u,f.row=u,f.col=r.col),f},r.prototype._showDragFillTooltip=function(){var e=this.getDragAutoFillType();if(e===t.AutoFillType.ClearValues||this.isDragFillWholeRows()||this.isDragFillWholeColumns())return this._removeTooltip(),null;else{var r,i,f,s=this._sheet,u=this.getCurrentFillDirection(),o=this.getDragFillFrameRange(),n=s
._getRangeRect2(o);f=this._getDragFillTooltipContent(),u===t.FillDirection.Down?(r=n.x+n.width+this.DRAGFILLTOOLTIP_OFFSET,i=n.y+n.height+this.DRAGFILLTOOLTIP_OFFSET):u===t.FillDirection.Right?(r=n.x+n.width+this.DRAGFILLTOOLTIP_OFFSET,i=n.y+n.height+this.DRAGFILLTOOLTIP_OFFSET):u===t.FillDirection.Left?(r=n.x+this.DRAGFILLTOOLTIP_OFFSET,i=n.y+n.height+this.DRAGFILLTOOLTIP_OFFSET):u===t.FillDirection.Up&&(r=n.x+n.width+this.DRAGFILLTOOLTIP_OFFSET,i=n.y+this.DRAGFILLTOOLTIP_OFFSET),this._showTooltip(f,r,i)}},r.prototype.refreshDragFill=function(){var n;if($.browser.chrome||$.browser.safari){var t=this._sheet,f=t._render._getCtx(),u=t._render._getBufferCtx(),r=t._render._getBufferCtx2(),i=this.getDragFillFrameRange();this._oldDragFillFrameRange&&(n=null,n=i.containsRange(this._oldDragFillFrameRange)?t._getRangeRect2(i):t._getRangeRect2(this._oldDragFillFrameRange),n.x-=2,n.y-=2,n.width+=4,n.height+=4,t._render._copyDoubleBufferRect(n,null,null,null,u,r)),i&&(n=
t._getRangeRect2(i),this.refreshSelectionBorder(r),t._render.paintDragRectangle(r,n),n=!this._oldDragFillFrameRange||i.containsRange(this._oldDragFillFrameRange)?t._getRangeRect2(i):t._getRangeRect2(this._oldDragFillFrameRange),n.x-=2,n.y-=2,n.width+=4,n.height+=4,t._render._copyDoubleBufferRect(n,null,null,null,r,f)),this._oldDragFillFrameRange=i}else this.clearDragFill(),this.refreshSelectionBorder(),this.paintDragFill(),this._oldDragFillFrameRange=this.getDragFillFrameRange()},r.prototype.clearDragFill=function(){var t=this._sheet,n;this._oldDragFillFrameRange&&(n=t._getRangeRect2(this._oldDragFillFrameRange),n.x-=2,n.y-=2,n.width+=4,n.height+=4,t._render._copyDoubleBufferRect(n))},r.prototype.refreshSelectionBorder=function(n){var t=this._sheet;t._render.repaintSelection(this._dragFillStartRange,null,n)},r.prototype.paintDragFill=function(){var r=this._sheet,u=r._render,i=this.getDragFillFrameRange(),n,t;if(!i)return;n=u._getCtx(),t=r._getRangeRect2(i),n.save(),n.beginPa
th(),u.paintDragRectangle(n,t),n.restore()},r.prototype.updateCurrentFillRange=function(){this._currentFillRange=this.getCurrentFillRange()},r.prototype.isDragFillWholeRows=function(){return this._dragFillStartRange.col===-1&&this._dragFillStartRange.row!==-1},r.prototype.isDragFillWholeColumns=function(){return this._dragFillStartRange.row===-1&&this._dragFillStartRange.col!==-1},r.prototype.isDragClear=function(){return this._currentFillDirection===t.DragFillDirection.LeftClear||this._currentFillDirection===t.DragFillDirection.UpClear},r.prototype.getCurrentFillRange=function(){var i=-1,n=-1,u=-1,r=-1;switch(this._currentFillDirection){case t.DragFillDirection.Left:this.isDragFillWholeColumns()?(i=-1,u=-1):(i=this.dragFillStartTopRow(),u=this._dragFillStartRange.rowCount),n=this._dragToColumn,r=this.dragFillStartLeftColumn()-n;break;case t.DragFillDirection.Right:this.isDragFillWholeColumns()?(i=-1,u=-1):(i=this.dragFillStartTopRow(),u=this._dragFillStartRange.rowC
ount),n=this.dragFillStartRightColumn()+1,r=this._dragToColumn-n+1;break;case t.DragFillDirection.Up:i=this._dragToRow,u=this.dragFillStartTopRow()-i,this.isDragFillWholeRows()?(n=-1,r=-1):(n=this.dragFillStartLeftColumn(),r=this._dragFillStartRange.colCount);break;case t.DragFillDirection.Down:i=this.dragFillStartBottomRow()+1,u=this._dragToRow-i+1,this.isDragFillWholeRows()?(n=-1,r=-1):(n=this.dragFillStartLeftColumn(),r=this._dragFillStartRange.colCount);break;case t.DragFillDirection.UpClear:i=this._dragToRow,u=this.dragFillStartBottomRow()-i+1,this.isDragFillWholeRows()?(n=-1,r=-1):(n=this.dragFillStartLeftColumn(),r=this._dragFillStartRange.colCount);break;case t.DragFillDirection.LeftClear:this.isDragFillWholeColumns()?(i=-1,u=-1):(i=this._dragFillStartRange.row,u=this._dragFillStartRange.rowCount),n=this._dragToColumn,r=this.dragFillStartRightColumn()-n+1;break;default:break}return new t.Range(i,n,u,r)},r.prototype.dragFillStartBottomRowLayout=function(){var n=this.dragFillS
tartBottomRow();return n!==-1?this._sheet._getRowLayout(this._dragFillStartBottomRowViewport).findRow(n):null},r.prototype.dragFillToViewportBottomRowLayout=function(){return this._sheet._getRowLayout(this._dragToRowViewport).findRow(this.dragFillToViewportBottomRow())},r.prototype.dragFillToViewportBottomRow=function(){return this._sheet.getViewportBottomRow(this._dragToRowViewport)},r.prototype.dragFillStartRightColumnLayout=function(){var n=this.dragFillStartRightColumn();return n!==-1?this._sheet._getColumnLayout(this._dragFillStartRightColumnViewport).findCol(n):null},r.prototype.dragFillToViewportRightColumnLayout=function(){return this._sheet._getColumnLayout(this._dragToColumnViewport).findCol(this.dragFillToViewportRightColumn())},r.prototype.dragFillToViewportRightColumn=function(){return this._sheet.getViewportRightColumn(this._dragToColumnViewport)},r.prototype.updateCurrentFillSettings=function(){var c=this.isDragFillWholeRows(),h=this.isDragFillWholeColumns(),tt=$(this
._sheet._getCanvas()).offset(),g=this.mousePosition.e,rt=this.mousePosition.x,d=this.mousePosition.y,o=g.pageX-tt.left,e=g.pageY-tt.top,k=!1,i,n,r,f,nt,v,u;c||h?h?this._dragToColumn<this.dragFillStartLeftColumn()||this._dragToColumn>this.dragFillStartRightColumn()?this._dragToColumn<this.dragFillStartLeftColumn()?this._currentFillDirection=t.DragFillDirection.Left:this._dragToColumn>this.dragFillStartRightColumn()&&(this._currentFillDirection=t.DragFillDirection.Right):this._currentFillDirection=t.DragFillDirection.LeftClear:c&&(this._dragToRow<this.dragFillStartTopRow()||this._dragToRow>this.dragFillStartBottomRow()?this._dragToRow<this.dragFillStartTopRow()?this._currentFillDirection=t.DragFillDirection.Up:this._dragToRow>this.dragFillStartBottomRow()&&(this._currentFillDirection=t.DragFillDirection.Down):this._currentFillDirection=t.DragFillDirection.UpClear):this._dragToRow<this.dragFillStartTopRow()||this._dragToRow>this.dra
gFillStartBottomRow()?this._dragToRow<this.dragFillStartTopRow()?this._dragToColumn<this.dragFillStartLeftColumn()||this._dragToColumn>this.dragFillStartRightColumn()?this._dragToColumn<this.dragFillStartLeftColumn()?(i=Math.abs(this._dragToColumn-this.dragFillStartLeftColumn()),n=Math.abs(this._dragToRow-this.dragFillStartTopRow()),this._currentFillDirection=n<i?t.DragFillDirection.Left:t.DragFillDirection.Up):this._dragToColumn>this.dragFillStartRightColumn()&&(i=Math.abs(this._dragToColumn-this.dragFillStartRightColumn()),n=Math.abs(this._dragToRow-this.dragFillStartTopRow()),this._currentFillDirection=n<i?t.DragFillDirection.Right:t.DragFillDirection.Up):this._currentFillDirection=t.DragFillDirection.Up:this._dragToRow>this.dragFillStartBottomRow()&&(this._dragToColumn<this.dragFillStartLeftColumn()||this._dragToColumn>this.dragFillStartRightColumn()?this._dragToColumn<this.dragFillStartLeftColumn()?(i=Math.abs(this._dragToColumn-
this.dragFillStartLeftColumn()),n=Math.abs(this._dragToRow-this.dragFillStartBottomRow()),this._currentFillDirection=n<i?t.DragFillDirection.Left:t.DragFillDirection.Down):this._dragToColumn>this.dragFillStartRightColumn()&&(i=Math.abs(this._dragToColumn-this.dragFillStartRightColumn()),n=Math.abs(this._dragToRow-this.dragFillStartBottomRow()),this._currentFillDirection=n<i?t.DragFillDirection.Right:t.DragFillDirection.Down):this._currentFillDirection=t.DragFillDirection.Down):this._dragToColumn<this.dragFillStartLeftColumn()||this._dragToColumn>this.dragFillStartRightColumn()?this._dragToColumn<this.dragFillStartLeftColumn()?this._currentFillDirection=t.DragFillDirection.Left:this._dragToColumn>this.dragFillStartRightColumn()&&(this._currentFillDirection=t.DragFillDirection.Right):(i=Math.abs(this._dragToColumn-this.dragFillStartRightColumn()),n=Math.abs(this._dragToRow-this.dragFillStartBottomRow()),n>i?this._currentFillDirection=t.DragFillD
irection.UpClear:n<i?this._currentFillDirection=t.DragFillDirection.LeftClear:(r=this.dragFillStartBottomRowLayout(),r||(r=this.dragFillToViewportBottomRowLayout()),d>r.y+r.height?this._currentFillDirection=t.DragFillDirection.Down:(f=this.dragFillStartRightColumnLayout(),f||(f=this.dragFillToViewportRightColumnLayout()),nt=f.x+f.width-rt,v=r.y+r.height-d,o<f.x||o>f.x+f.width||e<r.y||e>r.y+r.height?k=!0:this._currentFillDirection=nt<v?t.DragFillDirection.UpClear:t.DragFillDirection.LeftClear))),u=this._sheet._dragFillIndicatorRect;if(u){var b=this.dragFillStartBottomRow(),l=this.dragFillStartRightColumn(),it=b+1,ft=l+1,ut=this._sheet.getRowHeight(b,t.SheetArea.viewport),et=this._sheet.getColumnWidth(l,t.SheetArea.viewport),st=this._sheet.getRowHeight(it,t.SheetArea.viewport),ot=this._sheet.getColumnWidth(ft,t.SheetArea.viewport),w=u.x+u.width/2-Math.min(10,et/2),p=u.x+u.width/2+Math.min(10,ot/2),y=u.y+u.height/2-Math.min(10,ut/2),a=u.y+u.height/2+Math.min(10,st/
2),s=!1;c||h?h?s=w<=o&&o<=p:c&&(s=y<=e&&e<=a):s=w<=o&&o<=p&&y<=e&&e<=a,s||k?(this._isDragAroundIndicator=!0,this._currentFillDirection=t.DragFillDirection.LeftClear):this._isDragAroundIndicator=!1}},r.prototype.dragFillStartTopRow=function(){return this._dragFillStartRange?this._dragFillStartRange.row===-1?0:this._dragFillStartRange.row:-1},r.prototype.dragFillStartBottomRow=function(){return this._dragFillStartRange?this._dragFillStartRange.row===-1?this._sheet.getRowCount()-1:this._dragFillStartRange.row+this._dragFillStartRange.rowCount-1:-1},r.prototype.dragFillStartLeftColumn=function(){return this._dragFillStartRange?this._dragFillStartRange.col===-1?0:this._dragFillStartRange.col:-1},r.prototype.dragFillStartRightColumn=function(){return this._dragFillStartRange?this._dragFillStartRange.col===-1?this._sheet.getColumnCount()-1:this._dragFillStartRange.col+this._dragFillStartRange.colCount-1:-1},r.prototype
.endDragFill=function(){var n,r,t,i;this.startHitInfo=null,this.stopScroll(),this._removeTooltip();if(!this.isDraggingFill||!this.isWorking){this.resetDragFill();return}this.isDraggingFill=!1,this.isWorking=!1,n=this.getDragFillFrameRange();if(!n)return;r=this.validateFillRange(n),!r||this._isDragAroundIndicator?(this.resetDragFill(),this.refreshSelection(n)):(t=this.getDragAutoFillType(),i=this.executeDragFillAction(this._currentFillRange,t),!i&&this.isDragFill()?this.showDragFillSmartTag(t):this.refreshSelection(n),this.resetDragFill())},r.prototype.showDragFillSmartTag=function(n){if(!t.features.fill_ui)return;var r=this._sheet,i=r._dragFillIndicatorRect,u={x:i.x+i.width,y:i.y+i.height,fillType:n};r._smartTag=new t._GcFillDialog(r,u),r._smartTag.open()},r.prototype.updateDragFillStartRange=function(){var n=this._sheet;n._selectionModel.length===1?this._dragFillStartRange=n._selectionModel[0]:n._activeRowIndex<0||n._activeColIndex<0||(this._dragFillStartRange=new t.R
ange(n._activeRowIndex,n._activeColIndex,1,1))},r.prototype.resetDragFill=function(){this.isWorking=!1,this.isDraggingFill=!1},r.prototype.refreshSelection=function(n){this._sheet._render.repaintSelection(n)},r.prototype.getDragAutoFillType=function(){if(this.isDragClear())return t.AutoFillType.ClearValues;var n=this._dragFillStartRange.rowCount===1&&this._dragFillStartRange.colCount===1&&!this.isDragFillWholeColumns()&&!this.isDragFillWholeRows();return n?this.isControlPressed?t.AutoFillType.FillSeries:t.AutoFillType.CopyCells:this.isControlPressed?t.AutoFillType.CopyCells:t.AutoFillType.FillSeries},r.prototype.getDragFillFrameRange=function(){if(!this._dragFillStartRange)return null;if(this.isDragClear())return this._dragFillStartRange;if(!this._currentFillRange)return null;var r=0,u=0,n=0,i=0;return this.isVerticalDragFill()?(r=this._currentFillDirection===t.DragFillDirection.Up?this._currentFillRange.row:this._dragFillStartRange.row,u=this._dragFillStartR
ange.rowCount+this._currentFillRange.rowCount,n=this._dragFillStartRange.col,i=this._dragFillStartRange.colCount):(r=this._dragFillStartRange.row,u=this._dragFillStartRange.rowCount,n=this._currentFillDirection===t.DragFillDirection.Left?this._currentFillRange.col:this._dragFillStartRange.col,i=this._dragFillStartRange.colCount+this._currentFillRange.colCount),new t.Range(r,n,u,i)},r.prototype.validateFillRange=function(n){var r=this._sheet,i=!0,u="";return r._hasSpans(n.row,n.col,n.rowCount,n.colCount)&&(i=!1,u=t._StringResource.Exp_FillRangeContainsMergedCell),i&&r.isProtected&&r._isAnyCellInRangeLocked(n)&&(i=!1,u=t._StringResource.Exp_FillCellsReadOnly),i||r._raiseInvalidOperation(t.InvalidOperationType.DragFill,u),i},r.prototype.executeDragFillAction=function(n,i){var u=this._sheet,f=u._getActualRange(n),r,o,e;return this._preFillCellsInfo=new t.UndoRedo.CopyMoveCellsInfo(f.rowCount,f.colCount),t.UndoRedo.CopyMoveHelper.saveViewportInfo
(u,this._preFillCellsInfo,f.row,f.col,t.CopyToOption.All),r={startRange:this._dragFillStartRange,fillRange:n,autoFillType:i,fillDirection:this.getCurrentFillDirection()},o=u._raiseDragFillBlock(r.fillRange,r.fillDirection,r.autoFillType),o?!0:(e=new t.UndoRedo.DragFillUndoAction(u,r),u.doCommand(e),u._raiseDragFillBlockCompleted(r.fillRange,r.fillDirection,r.autoFillType),!1)},r.prototype.isDragFill=function(){return this.isIncreaseFill()||this.isDecreaseFill()},r.prototype.isIncreaseFill=function(){return this._currentFillDirection===t.DragFillDirection.Down||this._currentFillDirection===t.DragFillDirection.Right},r.prototype.isDecreaseFill=function(){return this._currentFillDirection===t.DragFillDirection.Left||this._currentFillDirection===t.DragFillDirection.Up},r.prototype.isVerticalDragFill=function(){return this._currentFillDirection===t.DragFillDirection.Up||this._currentFillDirection===t.DragFillDirection.Down||this._currentFillDirection===t.DragFillDirection.UpClear},r.prot
otype.isDragToRowInView=function(){return this.isRowInViewport(this._dragToRowViewport,this._dragToRow)},r.prototype.isRowInViewport=function(n,t){var r=this._sheet.getViewportTopRow(n),i=this._sheet.getViewportBottomRow(n);return t<r||t>i?!1:!0},r.prototype.getCurrentDragToRowLayout=function(){return this._sheet._getRowLayout(this._dragToRowViewport).findRow(this._dragToRow)},r.prototype.isDragFillStartBottomRowInView=function(){return this.isRowInViewport(this._dragFillStartBottomRowViewport,this.dragFillStartBottomRow())},r.prototype.dragFillStartViewportBottomRowLayout=function(){return this._sheet._getRowLayout(this._dragStartRowViewport).findRow(this.dragFillStartViewportBottomRow())},r.prototype.dragFillStartViewportBottomRow=function(){return this._sheet.getViewportBottomRow(this._dragStartRowViewport)},r.prototype.getValidVerDragToRowLayout=function(){var n;return n=this.isIncreaseFill()?this.isDragToRowInView()?this.getCurrentDragToRowLayout():this.dragFillToViewport
BottomRowLayout():this.isDragFillStartBottomRowInView?this.dragFillStartBottomRowLayout():this.dragFillStartViewportBottomRowLayout()},r.prototype.isDragToColumnInView=function(){return this.isColumnInViewport(this._dragToColumnViewport,this._dragToColumn)},r.prototype.isColumnInViewport=function(n,t){var r=this._sheet.getViewportLeftColumn(n),i=this._sheet.getViewportRightColumn(n);return t<r||t>i?!1:!0},r.prototype.getCurrentDragToColumnLayout=function(){return this._sheet._getColumnLayout(this._dragToColumnViewport).findCol(this._dragToColumn)},r.prototype.isDragFillStartRightColumnInView=function(){return this.isColumnInViewport(this._dragFillStartRightColumnViewport,this.dragFillStartRightColumn())},r.prototype.dragFillStartViewportRightColumnLayout=function(){return this._sheet._getColumnLayout(this._dragStartColumnViewport).findCol(this.dragFillStartViewportRightColumn())},r.prototype.dragFillStartViewportRightColumn=function(){return this._sheet.getViewportRightColumn(
this._dragStartColumnViewport)},r.prototype.getValidHorDragToColumnLayout=function(){var n;return n=this.isIncreaseFill()?this.isDragToColumnInView()?this.getCurrentDragToColumnLayout():this.dragFillToViewportRightColumnLayout():this.isDragFillStartRightColumnInView()?this.dragFillStartRightColumnLayout():this.dragFillStartViewportRightColumnLayout()},r.prototype.dragFillToViewportTopRowLayout=function(){return this._sheet._getRowLayout(this._dragToRowViewport).findRow(this.dragFillToViewportTopRow())},r.prototype.dragFillToViewportTopRow=function(){return this._sheet.getViewportTopRow(this._dragToRowViewport)},r.prototype.dragFillToViewportLeftColumnLayout=function(){return this._sheet._getColumnLayout(this._dragToColumnViewport).findCol(this.dragFillToViewportLeftColumn())},r.prototype.dragFillToViewportLeftColumn=function(){return this._sheet.getViewportLeftColumn(this._dragToColumnViewport)},r.prototype.getCurrentFillDirection=function(){switch(this._currentFillDirection){case t
.DragFillDirection.Left:return t.FillDirection.Left;case t.DragFillDirection.Right:return t.FillDirection.Right;case t.DragFillDirection.Up:return t.FillDirection.Up;case t.DragFillDirection.Down:return t.FillDirection.Down;case t.DragFillDirection.LeftClear:return t.FillDirection.Left;case t.DragFillDirection.UpClear:return t.FillDirection.Up;default:break}return t.FillDirection.Down},r.prototype.getHitRowViewportIndex=function(){var i=this._sheet,t=i._getRowViewportIndexNearY(this.mousePosition.y),r=this.startHitInfo.scrollRowViewportIndex,n=i._getRowLayout(1);return t===0&&r>0&&n.length>0&&n[0].row>i._getFirstPageTopRow()?t=1:t===2&&r<2&&n.length>0&&n[n.length-1].row<i._getLastVisualRow()&&(t=1),t},r.prototype.getHitColumnViewportIndex=function(){var i=this._sheet,t=i._getColumnViewportIndexNearX(this.mousePosition.x),r=this.startHitInfo.scrollColViewportIndex,n=i._getColumnLayout(1);return t===0&&r
>0&&n.length>0&&n[0].col>i._getFirstPageLeftColumn()?t=1:t===2&&r<2&&n.length>0&&n[n.length-1].col<i._getLastVisualColumn()&&(t=1),t},r.prototype.getHitRowIndex=function(){var t=this._sheet,u=this.mousePosition.y,r=this.getHitRowViewportIndex(),f=t._getViewportRowLayoutNearY(r,u),i,n;return f?(i=t._getSheetLayout(),n=f.row,r===1&&u<i.viewportY&&n>t._getFirstPageTopRow()?t._getNextVisualRow(n)||n:r===1&&u>i.frozenTrailingY&&n>t._getLastFullyVisibleRow()?t._getPrevVisualRow(n)||n:n):-1},r.prototype.getHitColumnIndex=function(){var t=this._sheet,u=this.mousePosition.x,r=this.getHitColumnViewportIndex(),f=t._getViewportColumnLayoutNearX(r,u),i,n;return f?(i=t._getSheetLayout(),n=f.col,r===1&&u<i.viewportX&&n>t._getFirstPageLeftColumn()?t._getNextVisualColumn(n)||n:r===1&&u>i.frozenTrailingX&&n>t._getLastFullyVisibleColumn()?t._getPrevV
isualColumn(n)||n:n):-1},r.prototype.getIntervalFromDistance=function(n){var t=0,i;return isNaN(n)||n===0||(i=n<0,n=Math.abs(n),t=Math.ceil(500/n),t=Math.max(20,t*10),t>200&&(t=200),i&&(t=-t)),t},r.prototype.updateRange=function(n,i,r,u){if(r===0||u===0)return;var e=this._sheet,y=t.SheetArea.viewport,l=e._getRowLayout(0,y),a=e._getColumnLayout(0,y),s=e._getRowLayout(1,y),c=e._getColumnLayout(1,y),p=0;a&&a.length>0&&(p=a[a.length-1].col),c&&c.length>0&&(p=c[c.length-1].col);var h=this.getYForRow(n,i,r,u,!0,p,l,s),w=this.getYForRow(n,i,r,u,!1,p,l,s),b=0;l&&l.length>0&&(b=l[l.length-1].row),s&&s.length>0&&(b=s[s.length-1].row);var o=this.getXForCol(n,i,r,u,!0,b,a,c),v=this.getXForCol(n,i,r,u,!1,b,a,c),f=e._getSheetLayout();v>o&&w>h&&e._render.update(o-f.headerX-2,h-f.headerY-2,v-o+2*f.headerX+2,w-h+2*f.headerY+2),w>h&&e._render.update(f.headerX,h,f.rowHeade
rWidth,w-h),v>o&&(e._render.update(o,f.headerY,v-o,f.colHeaderHeight),e._render.update(o,f.footerY,v-o,f.colHeaderHeight))},r.prototype.getYForRow=function(n,t,i,r,u,f,e,o){var a=this._sheet,h=n,c,l,s;u||(h=n+i-1);if(h<a.frozenRowCount){if(e.length<1)return-1}else{if(o.length<1)return-1;u?h<o[0].row&&(h=o[0].row):h>o[o.length-1].row&&(h=o[o.length-1].row)}for(c=0,u&&(c=9e4),l=Math.max(a._scrollLeftCol,t);l<t+r&&l<=f;l++)s=a.getCellRect(h,l),s&&(u?s.y<c&&(c=s.y):c<s.y+s.height&&(c=s.y+s.height));return c},r.prototype.getXForCol=function(n,t,i,r,u,f,e,o){var a=this._sheet,h=t,c,l,s;u||(h=t+r-1);if(h<a.frozenColCount){if(e.length<1)return}else{if(o.length<1)return;u?h<o[0].col&&(h=o[0].col):h>o[o.length-1].col&&(h=o[o.length-1].col)}for(c=0,u&&(c=9e4),l=Math.max(a._scrollTopRow,n);l<n+i&&l<=f;l++)s=a.getCellRect(l,h),s&&(u?s.x<c&a
mp;&(c=s.x):c<s.x+s.width&&(c=s.x+s.width));return c},r.prototype.getResizingArea=function(){return 5},r.prototype._getPrevVisualRowBeforeFindRow=function(n,t){var r=this._sheet,i=n;return r._render._isCellHiddenByGroup(i,0,t)?(i=r._getPrevVisualRow(i,t),i!==null?i:n):n},r.prototype._getPrevVisualColBeforeFindCol=function(n,t){var r=this._sheet,i=n;return r._render._isCellHiddenByGroup(0,i,t)?(i=r._getPrevVisualColumn(i,t),i!==null?i:n):n},r.prototype._getResizeRowInfo=function(n,t,i,r,u){var e=null,o=n._getRowLayout(t.rowViewportIndex,r),f,h,l,s,c;return!o||isNaN(t.row)||isNaN(t.col)||(t.row=this._getPrevVisualRowBeforeFindRow(t.row,r),f=o.findRow(t.row),f&&(f.y+f.height-i>u||u>f.y+f.height+i?f.y-i>u||u>f.y+i||o.indexOf(f)>0&&(e={action:"sizeRow",index:t.row-1,sheetArea:r}):(e={action:"sizeRow",index:t.row,sheetArea:r},h=o[o.length-1].row,h<0||(l=n._getLastVisualRow(r),e.index===l&&e.index!==h&&(f.
y+f.height-i/2>u||(e={action:"sizeRow",index:h,sheetArea:r}))))),!e&&t.rowViewportIndex===1&&o.length>0&&(f=o[0],Math.max(0,f.y-i)>u||u>f.y+i||(s=t.row-1,c=n._getRowLayout(t.rowViewportIndex-1,r),s<0||!c||c.findRow(s)||n.getRowHeight(s)===0&&(e={action:"sizeRow",index:s,sheetArea:r})))),e&&!n.getRowResizable(e.index,r)&&(e=null),e},r.prototype._getResizeColInfo=function(n,t,i,r,u){var e=null,o=n._getColumnLayout(t.colViewportIndex,r),f,h,l,s,c;return!o||isNaN(t.col)||isNaN(t.row)||(t.col=this._getPrevVisualColBeforeFindCol(t.col,r),f=o.findCol(t.col),f&&(f.x+f.width-i>u||u>f.x+f.width+i?f.x-i>u||u>f.x+i||o.indexOf(f)>0&&(e={action:"sizeCol",index:t.col-1,sheetArea:r}):(e={action:"sizeCol",index:t.col,sheetArea:r},h=o[o.length-1].col,h<0||(l=n._getLastVisualColumn(r),e.index===l&&e.index!==h&&(f.x+f.width-i/2>u||(e={action:"s
izeCol",index:h,sheetArea:r}))))),!e&&t.colViewportIndex===1&&o.length>0&&(f=o[0],Math.max(0,f.x-i)>u||u>f.x+i||(s=t.col-1,c=n._getColumnLayout(t.colViewportIndex-1,r),s<0||!c||c(s)||n.getColumnWidth(s)===0&&(e={action:"sizeCol",index:s,sheetArea:r})))),e&&!n.getColumnResizable(e.index,r)&&(e=null),e},r.prototype.getResizingRowCol=function(n,i,r){var u=this._sheet,f=null,s,o,e,l,c,h;return(!u.parent||u.parent._allowUserResize)&&(e=this.getResizingArea(),l=u._getSheetLayout(),n.rowViewportIndex<0&&n.colViewportIndex>=0&&u.colHeaderVisible?(f=this._getResizeColInfo(u,n,e,t.SheetArea.colHeader,i),f||(f=this._getResizeRowInfo(u,n,e,t.SheetArea.colHeader,r))):n.rowViewportIndex>=0&&n.colViewportIndex<0&&u.rowHeaderVisible?(f=this._getResizeRowInfo(u,n,e,t.SheetArea.rowHeader,r),f||(f=this._getResizeColInfo(u,n,e,t.SheetArea.rowHeader,i))):n.rowViewportIndex<0&
amp;&n.colViewportIndex<0?u._getLastVisualRow(t.SheetArea.rowHeader)!==null||Math.abs(r-l.colHeaderHeight)>e?u._getLastVisualColumn(t.SheetArea.colHeader)!==null||Math.abs(i-l.rowHeaderWidth)>e||(h=u._getColumnLayout(1),h&&h.length>0&&(o=h[h.length-1].col),o<0||(f={action:"sizeCol",index:o,sheetArea:t.SheetArea.colHeader})):(c=u._getRowLayout(1),c&&c.length>0&&(s=c[c.length-1].row),s<0||(f={action:"sizeRow",index:s,sheetArea:t.SheetArea.rowHeader})):n.rowViewportIndex<0||n.colViewportIndex<0||(l.colHeaderHeight===0&&r<=e&&u.colHeaderVisible?(s=u.getRowCount(t.SheetArea.colHeader)-1,s<0||(f={action:"sizeRow",index:s,sheetArea:t.SheetArea.colHeader})):l.rowHeaderWidth===0&&i<=e&&u.rowHeaderVisible&&(o=u.getColumnCount(t.SheetArea.rowHeader)-1,o<0||(f={action:"sizeCol",index:o,sheetArea:t.SheetArea.rowHeader})))),f},r.prototype.getDr
agInfo=function(n,t,i){var u=null,h=n.rowViewportIndex,o=n.colViewportIndex,f,a,c,v,l,y,r,e;if(h===undefined||h===null||o===undefined||o===null)return u;f=this._sheet,a=f._getActiveSelectedRange();if(a.row===-1&&a.col===-1)return u;if(h>=0&&o>=0&&f._selectionModel.length===1){var s=f._getActualRange(a),p=f._frozenTrailingColCount,w=f._frozenTrailingRowCount,b=f.getColumnCount()-p,k=f.getRowCount()-w;if(o===1&&p>0&&s.col<b&&s.col+s.colCount>b){c=f._getColumnLayout(o);if(c&&c.length>0){v=c[c.length-1];if(t>v.x+v.width)return u}}if(h===1&&w>0&&s.row<k&&s.row+s.rowCount>k){l=f._getRowLayout(h);if(l&&l.length>0){y=l[l.length-1];if(i>y.y+y.height)return u}}r=f._getRangeRect(h,o,a),r.x-4<t&&t<r.x+4&&r.y<=i&&i<r.y+r.height&&(u={action:"drag",side:"left"}),u||(e=this._sheet._dragFillIndicatorRect,!e||e.x>
;t||t>e.x+e.width||e.y>i||i>e.y+e.height||(u={action:"drag",side:"corner"})),u||r.x+r.width-4<t&&t<r.x+r.width+4&&r.y<=i&&i<r.y+r.height&&(u={action:"drag",side:"right"}),u||r.y-4<i&&i<r.y+4&&r.x<=t&&t<r.x+r.width&&(u={action:"drag",side:"top"}),u||r.y+r.height-4<i&&i<r.y+r.height+4&&r.x<=t&&t<r.x+r.width&&(u={action:"drag",side:"bottom"}),u&&(t<r.x||t>r.x+r.width||i<r.y||i>r.y+r.height)&&(u.outside=!0)}return this._sheet.canUserDragDrop()||u&&u.side!=="corner"&&(u.side=null),this._sheet.canUserDragFill()||u&&u.side==="corner"&&(u.side=null),u},r.prototype.doMouseMove=function(n){var t=this._getCanvasOffset();this.doMouseMoveImp(n,n.pageX-t.left,n.pageY-t.top)},r.prototype.doMouseOut=fun
ction(n){var i=this._sheet,t=i._currentTarget,r;if(t&&t.cellTypeHitInfo){var u=t.row,e=t.col,f=i.getCellType(u,e,t.hitTestType);f.processMouseLeave(t.cellTypeHitInfo)}if(this.isMouseDown)return;r={x:-1e4,y:-1e4,rowViewportIndex:null,colViewportIndex:null,row:-1,col:-1,resizeInfo:null,hitTestType:null},i._setHoverCell(r)},r.prototype.doMouseMoveImp=function(n,i,r){var e,o,c,h,p,v,u,s,f,y,a,l;this.mousePosition={e:n,x:i,y:r},e=this._sheet,this.isMouseDown&&(window.gcGlobal.activeElement||(window.gcGlobal.activeElement=e));if(this.isMouseDown&&this.isWorking){o=e._currentTarget,c=o.resizeInfo;if(c){if(o.x===i&&o.y===r)return;h=this._updateResizeInfo(i,r),e._render.update(h.x,h.y,h.w,h.h,!0),p=e.parent,p&&(v=p.showResizeTip(),(v===t.ShowResizeTip.Column&&c.action==="sizeCol"||v===t.ShowResizeTip.Row&&c.action==="sizeRow"||v===t.ShowResizeTip.Both)&&this._refreshTooltip(this._getMouseMoveResizeTooltipCont
ent(c)))}else o.dragInfo&&o.dragInfo.side!=="corner"?this.continueDragDropping():o.dragInfo&&o.dragInfo.side==="corner"?this.continueDragFill():this.continueSelecting()}else{u=e.hitTest(i,r);if(!u)return;s=e._getCanvas();if(!s)return;f=e._currentTarget,y=!f||u.row!==f.row||u.col!==f.col||u.hitTestType!==f.hitTestType||u.resizeInfo&&!f.resizeInfo||!u.resizeInfo&&f.resizeInfo||u.resizeInfo&&u.resizeInfo.action!==f.resizeInfo.action||u.dragInfo&&!f.dragInfo||!u.dragInfo&&f.dragInfo||u.dragInfo&&u.dragInfo.action!==f.dragInfo.action;if(f&&y)if(f.cellTypeHitInfo){var d=f.row,g=f.col,w=e.getCellType(d,g,f.hitTestType);w.processMouseLeave(f.cellTypeHitInfo)}a=u.resizeInfo;if(a)s.style.cursor=a.action==="sizeCol"?"w-resize":a.action==="sizeRow"?"n-resize":"default";else{l=u.dragInfo;if(l&&l.action==="drag")l.side==="corner"
?s.style.cursor="crosshair":l.side&&(s.style.cursor="move");else{if(u.cellTypeHitInfo){var k=u.row,b=u.col,w=e.getCellType(k,b,u.hitTestType);u.cellTypeHitInfo.sheet=e,y&&w.processMouseEnter(u.cellTypeHitInfo),w.processMouseMove(u.cellTypeHitInfo)}!y&&u.cellTypeHitInfo&&u.cellTypeHitInfo.isReservedLocation||(s.style.cursor="default")}}u&&e._setHoverCell(u)}},r.prototype.doMouseUp=function(n){var i=this._sheet,t;i.inCanvas||this.unhandleDocumentMouseMove(),t=this._getCanvasOffset();if(i._isMouseDownInSheet)i._isMouseDownInSheet=!1;else return!0;return this.doMouseUpImp(n,n.pageX-t.left,n.pageY-t.top),!1},r.prototype.doMouseUpImp=function(n,i,r){var u=this._sheet,s=window.gcGlobal.activeElement,y,f,a,o,e,l,h,p,c,v;this.isMouseDown=!1,s&&s!==u&&s.endEdit&&(s.endEdit(),s.repaint()),y=u._currentTarget;if(u._currentTarget){f=y.resizeInfo;if(f){this._removeTooltip();if(f.action==="sizeRow&quo
t;){if(f.movingY!==undefined&&f.movingY!==null){a=Math.max(0,(f.movingY-f.startY)/u._zoomFactor),h=[];if(u._isRowSelected(f.index))for(o=0;o<u._selectionModel.length;o++)e=u._selectionModel[o],e.col===-1&&(e=u._getActualRange(e),h.push({firstRow:e.row,lastRow:e.row+e.rowCount-1}));else h.push({firstRow:f.index,lastRow:f.index});p=f.sheetArea===t.SheetArea.colHeader,l=new t.UndoRedo.RowResizeUndoAction(u,h,a,p),u._doCommand(l)}}else if(f.movingX!==undefined&&f.movingX!==null){a=Math.max(0,(f.movingX-f.startX)/u._zoomFactor),c=[];if(u._isColumnSelected(f.index))for(o=0;o<u._selectionModel.length;o++)e=u._selectionModel[o],e.row===-1&&(e=u._getActualRange(e),c.push({firstCol:e.col,lastCol:e.col+e.colCount-1}));else c.push({firstCol:f.index,lastCol:f.index});v=f.sheetArea===t.SheetArea.rowHeader,l=new t.UndoRedo.ColumnResizeUndoAction(u,c,a,v),u._doCommand(l)}this.isWorking=!1}else if(u._currentTarget.dragInfo&&!this.isDraggingFill)this.stop
DragDrop(),u._currentTarget=null;else if(u._currentTarget.dragInfo&&this.isDraggingFill===!0)this.endDragFill(),u._currentTarget=null;else{if(u._currentTarget.cellTypeHitInfo){var k=u._currentTarget.row,b=u._currentTarget.col,w=u.getCellType(k,b,u._currentTarget.hitTestType);u._currentTarget.cellTypeHitInfo.sheet=u,w.processMouseUp(u._currentTarget.cellTypeHitInfo)}u._currentTarget.cellTypeHitInfo&&u._currentTarget.cellTypeHitInfo.isReservedLocation||u._trigger(t.Events.CellClick,{sheet:u,sheetName:u._name,sheetArea:u._currentTarget.hitTestType,row:u._currentTarget.row,col:u._currentTarget.col})}}window.gcGlobal.activeElement=u,this.stopSelecting(),this.setMetaKeyState(n)},r.prototype.startEdit=function(n){var i=this._sheet,r=i._getCanvas(),t=this._getCanvasOffset();n.shiftKey||n.ctrlKey||i._doStartEdit(r,n.pageX-t.left,n.pageY-t.top)},r.prototype.doKeyDown=function(n){var r=this._sheet,i=!r.isEditing()&&!n.ctrlKey&&(n.keyCode===t.Key.pdn||n.keyCode==
=t.Key.pup||n.keyCode===t.Key.left||n.keyCode===t.Key.right||n.keyCode===t.Key.tab||n.keyCode===t.Key.up||n.keyCode===t.Key.down);if(i){if(this._keyPressed){this._keyPressedCount<5&&this._keyPressedCount++,t.util.cancelDefault(n);return}this._keyPressed=!0,this._keyPressedCount=1,this._repeatKeyDown(n)}else this._keyDownImp(n)},r.prototype._getMouseDownResizeTooltipContent=function(){var u=this._sheet,e=u._currentTarget,t=e.resizeInfo,o,i,f,r;return t.action==="sizeRow"?(o=u._getAllRowLayout(t.sheetArea),t.index=this._getPrevVisualRowBeforeFindRow(t.index,t.sheetArea),i=o.findRow(t.index),i||(i=o.findRow(e.row)),n.spread._StringResource.Tip_Height+i.height.toFixed(0)+n.spread._StringResource.Tip_pixels):(f=u._getAllColumnLayout(t.sheetArea),t.index=this._getPrevVisualColBeforeFindCol(t.index,t.sheetArea),r=f.findCol(t.index),r||(r=f.findCol(e.col)),n.spread._StringResource.Tip_Width+r.width.toFixed(0)+n.spread._StringResource.Tip_pixels)},r.prototype._getMouseMo
veResizeTooltipContent=function(n){return n.action==="sizeRow"?t._StringResource.Tip_Height+(n.movingY-n.startY).toFixed(0)+t._StringResource.Tip_pixels:t._StringResource.Tip_Width+(n.movingX-n.startX).toFixed(0)+t._StringResource.Tip_pixels},r.prototype._updateResizeInfo=function(n,t){var o=this._sheet,s=o._currentTarget,i=s.resizeInfo,r=o._getSheetLayout(),u,c,f,h,e;return i.action==="sizeRow"?(c=o._getAllRowLayout(i.sheetArea),i.index=this._getPrevVisualRowBeforeFindRow(i.index,i.sheetArea),f=c.findRow(i.index),f||(f=c.findRow(s.row)),i.startY=f.y,i.movingY=t,i.movingY<f.y&&(i.movingY=f.y),u=r.y+r.height,i.movingY>u&&(i.movingY=u),{x:r.x,y:i.startY,w:r.width,h:r.height-i.startY}):(h=o._getAllColumnLayout(i.sheetArea),i.index=this._getPrevVisualColBeforeFindCol(i.index,i.sheetArea),e=h.findCol(i.index),e||(e=h.findCol(s.col)),i.startX=e.x,i.movingX=n,i.movingX<e.x&&(i.movingX=e.x),u=r.x+r.width,i.movingX>u&&(i.movingX
=u),{x:i.startX,y:r.y,w:r.width-i.startX,h:r.height})},r.prototype._repeatKeyDown=function(n){if(!this._keyPressed)return;var t=this;t._keyDownImp(n),this._keyPressed&&window.setTimeout(function(){t._repeatKeyDown(n)},100/this._keyPressedCount)},r.prototype._startEditByKeyboard=function(){var n=this._sheet,r=n._getCanvas(),u,i;if(r){n._startEditByKeydown=!0;try{u=n.isEditing(),n._startEditImp(r,n._activeRowIndex,n._activeColIndex,null,null,!0),!u&&n.isEditing()&&(i=n.getCellType(n._activeRowIndex,n._activeColIndex),!i._triggerButtonClicked||event.keyCode!==t.Key.space||event.ctrlKey||event.shiftKey||event.altKey||i._triggerButtonClicked(n,n._activeRowIndex,n._activeColIndex),i._cancelDefaultKeydown&&i._cancelDefaultKeydown(event))}finally{n._startEditByKeydown=!1}}},r.prototype._keyDownImp=function(n){var i=this._sheet,r;this.setMetaKeyState(n),n.keyCode===t.Key.tab&&t.util.cancelDefault(n),i.isEditing()||n.keyCode!==t.Key.esc||n.altKey||n.ctr
lKey||n.shiftKey||!i._validationInputMessage||($(i._validationInputMessage).remove(),i._validationInputMessage=null),i.isEditing()||n.keyCode!==t.Key.pdn&&n.keyCode!==t.Key.pup&&n.keyCode!==t.Key.end&&n.keyCode!==t.Key.home&&n.keyCode!==t.Key.up&&n.keyCode!==t.Key.down||t.util.cancelDefault(n),i.isEditing()||n.keyCode!==t.Key.left&&n.keyCode!==t.Key.right||t.util.cancelDefault(n);if(!i._processKeyMap(n))return;r=n.keyCode===229||n.keyCode===0,this.allowEnterEditing(n)&&!r&&this._startEditByKeyboard()},r.prototype.doKeyUp=function(n){this._keyPressed=!1,this.setMetaKeyState(n)},r.prototype.doCompositionStart=function(){this._startEditByKeyboard()},r.prototype.allowEnterEditing=function(n){if(n.ctrlKey||n.altKey)return!1;if(n.keyCode<65||n.keyCode>90)if((n.keyCode<48||n.keyCode>57)&&(n.keyCode<96||n.keyCode>105))if(n.keyCode<186||n.keyCode>192)if((n.keyCode<220||n.keyCode>222)&&am
p;n.keyCode!==219)if(n.keyCode<106||n.keyCode>111){if(n.keyCode===32)return!0;else if(n.keyCode===61)return!0;else if(n.keyCode===173)return!0;else if(n.keyCode===229||n.keyCode===0)return!0}else return!0;else return!0;else return!0;else return!0;else return!0;return!1},r.prototype.setMetaKeyState=function(n){var i=this._sheet,r;this.shift=n.shiftKey&&!n.ctrlKey,this.ctrl=n.ctrlKey&&!n.shiftKey,i._isNavigateInSelection=!1,n.keyCode===t.Key.tab&&(i._selectionModel.length>1?i._isNavigateInSelection=!0:(r=i._getActiveSelectedRange(),r&&i._selectionModel.length>0&&(i._isNavigateInSelection=!(i._activeRowIndex===r.row&&i._activeColIndex===r.col&&i._activeRowCount===r.rowCount&&i._activeColCount===r.colCount))));if(this.isDragDropping===!0){var u=i._getActiveSelectedRange(),e=this._isDragInsert,f=this._isDragCopy;this._isDragInsert=u.row===-1||u.col===-1?n.shiftKey:!1,this._isDragCopy=n.ctrlKey,(e!==this._isDragIn
sert||f!==this._isDragCopy)&&i._render.refreshDragDropIndicator()}this.isShiftPressed=n.shiftKey,this.isControlPressed=n.ctrlKey},r.prototype.doMouseWheel=function(n,i){var r=this._sheet,e,u;if(!r.endEdit())return;if(n.ctrlKey){if(!r.parent||r.parent._allowUserZoom){var o=r._zoomFactor,f=r._zoomFactor-.05*i,s=new t.UndoRedo.ZoomUndoAction(r,f);r._doCommand(s),f=r._zoomFactor,o!==f&&r._trigger(t.Events.UserZooming,{sheet:r,sheetName:r._name,oldZoomFactor:o,newZoomFactor:f});return}}else e=r._scrollTopRow,r.frozenRowCount>0&&(r._scrollTopRow===0&&i>0?r._scrollTopRow=r.frozenRowCount:i<0&&r._scrollTopRow===r.frozenRowCount-i&&(r._scrollTopRow=0)),i<0?(u=r._getScrollableRow(r._scrollTopRow+i,!0),r._scrollTopRow=u!=-1?u:r._scrollTopRow+i):i>0&&(u=r._getScrollableRow(r._scrollTopRow+i),r._scrollTopRow=u!=-1?u:r._scrollTopRow+i),r._scrollTopRow<r._getFirstPageTopRow()?r._scrollTopRow=r._getFirstPageTopRow():r._scroll
TopRow>r._getLastVisualRow()&&(r._scrollTopRow=r._getLastVisualRow()),e!==r._scrollTopRow&&r._trigger(t.Events.TopRowChanged,{sheet:r,sheetName:r._name,oldTopRow:e,newTopRow:r._scrollTopRow}),this.scrolling=!0;r.invalidateLayout(),r.repaint(),r._syncVScrollbarPosition()},r.prototype.doVScroll=function(n){var u=this._sheet,r,i,f;if(!u.endEdit())return;this.scrolling=!0,u._scrollTopRow=n,r=u.parent,r&&(i=r.showScrollTip(),(i===t.ShowScrollTip.Vertical||i===t.ShowScrollTip.Both)&&this._refreshTooltip(this._getScrollTooltipContent(!0))),f=this,this.scrollTimer||(this.scrollTimer=window.setInterval(function(){f._scrollView()},this.waittime))},r.prototype.doHScroll=function(n){var u=this._sheet,r,i,f;if(!u.endEdit())return;this.scrolling=!0,u._scrollLeftCol=n,r=u.parent,r&&(i=r.showScrollTip(),(i===t.ShowScrollTip.Horizontal||i===t.ShowScrollTip.Both)&&this._refreshTooltip(this._getScrollTooltipContent(!1))),f=this,this.scrollTimer||(this
.scrollTimer=window.setInterval(function(){f._scrollView()},this.waittime))},r.prototype._scrollView=function(){var i;if(!this.scrolling){if(this.scrollTimer){window.clearInterval(this.scrollTimer),this.scrollTimer=null,this._sheet.invalidateLayout(),this._sheet.repaint(),i=this.oldTop!==this._sheet._scrollTopRow,this.oldTop=this._sheet._scrollTopRow,this.oldLeft=this._sheet._scrollLeftCol;if(i){var t=this._sheet.getViewportTopRow(1),r=this._sheet.getViewportBottomRow(1),n=Math.max(0,t-60);n<this._sheet.getRowCount()&&this._loadData(n,2*r-t)}}return}this.scrolling=!1,this._updateView()},r.prototype._showScrollTooltip=function(n,t){var r,i;n?(r=t.pageY,i=t.pageX-this.VSCROLLTOOLTIP_LEFT):(r=t.pageY-this.HSCROLLTOOLTIP_TOP,i=t.pageX-this.HSCROLLTOOLTIP_LEFT),this._showTooltip(this._getScrollTooltipContent(n),i,r,!0)},r.prototype._getScrollTooltipContent=function(i){var r=this._sheet,u;return u=i?t._StringResource.Tip_Row+(r._scrollTopRow+1):r.colHeaderAutoText===n.spread.He
aderAutoText.numbers?t._StringResource.Tip_Column+(r._scrollLeftCol+1):t._StringResource.Tip_Column+r._indexToLetters(r._scrollLeftCol+1)},r.prototype._getLoadingProgress=function(n){var o=n+"_loading",r=$("#"+o),e,u,f;return r&&r.length!==0||(e=i.createElement("div"),r=$(e),r.attr("id",o),r.css("textAlign","center"),r.css("background-color","#DCDCDC"),i.body.insertBefore(e,null)),r.css("position","absolute"),u=$("#"+n),f=t.util.position(u),r.css("left",f.left),r.css("top",f.top),r.css("width",u.width()),r.css("height",u.height()),{show:function(){r.fadeIn("fast"),r.append("postback and loading ...")},hide:function(){r.fadeOut("fast"),r.html("")}}},r.prototype._loadData=function(n,t){var r,i;if(!this._sheet.parent||!this._sheet.parent._host)return;this._sheet.dataContext&&this._sh
eet.dataContext.read?(r=this,this._dataContextLoadDelegate=function(n,t){return r._dataContextLoaded(n,t)},this.lastLoadedRowIndex=n):(i=this._sheet.parent._host.id,i&&i.length>0&&typeof window.WebForm_DoCallback!="undefined"&&(this.lastLoadedRowIndex=n,this._doLoadData(i,n,t)))},r.prototype._dataContextLoaded=function(n,t){var r=n.data,u,f,i;if(r&&r.length>0){u=this._sheet,f=u.getDataSource();if(f&&this.lastLoadedRowIndex===n.start)for(i=0;i<r.length;i++)f[n.start+i]=r[i];u.recalcAll(),u.repaint()}},r.prototype._doCallBack=function(n,t){var e=this._sheet.parent._host.id,u,s,f,o;if(e&&e.length>0&&typeof window.WebForm_DoCallback!="undefined"){u=$(i.forms);if(!u||u.length===0)return;u=u[0],u.__EVENTTARGET.value=e,u.__EVENTARGUMENT.value=n,this._sheet.parent.saveData(),window.__theFormPostCollection.length=0,window.__theFormPostData="",window.WebForm_InitCallback(),window.__theFormPostDat
a="gcallback=true&"+window.__theFormPostData,u.__EVENTVALIDATION&&(window.__theFormPostData+="&__EVENTVALIDATION="+r.WebForm_EncodeCallback(u.__EVENTVALIDATION.value)),s=u.action,f=this._getLoadingProgress(e),f&&f.show(),o=this,this._updateDelegate=function(n,t){return f.hide(),o._onUpdateCallback(n,t)},this._errorDelegate=function(n,t){f.hide()}}},r.prototype._doLoadData=function(n,t,u){var l={start:t,end:u},h=this._sheet.hasPendingChanges(),s=this,f,o,c,e;if(h){f=$(i.forms);if(!f||f.length===0)return;f=f[0],o="loadData,"+t+","+u,f.__EVENTTARGET.value=n,f.__EVENTARGUMENT.value=o,this._sheet.parent.saveData(),window.__theFormPostCollection.length=0,window.__theFormPostData="",window.WebForm_InitCallback(),window.__theFormPostData="gcallback=true&"+window.__theFormPostData,f.__EVENTVALIDATION&&(window.__theFormPostData+="&__EVENTVALIDATION="+r.WebForm_EncodeCallback(f.__EVENT
VALIDATION.value)),c=f.action,e=this._getLoadingProgress(n),e&&e.show(),this._updateDelegate=function(n,t){return e.hide(),s._onUpdateCallback(n,t)},this._errorDelegate=function(n,t){e.hide()}}else this._loadDataDelegate=function(n,t){return s._onLoadDataCallback(n,t)},this._sheet.parent.saveData(),window.__theFormPostCollection.length=0,window.__theFormPostData="",window.WebForm_InitCallback(),window.WebForm_DoCallback(n,"loadData,"+t+","+u,this._loadDataDelegate,l,null,!0)},r.WebForm_EncodeCallback=function(n){},r.prototype._onUpdateCallback=function(n,t){var o,e,f,r,u,s;this._sheet.clearPendingChanges(),o=i;try{o.selection.empty()}catch(h){}e=o.createElement("div");if(!e)return;e.innerHTML=n,f=$(i.forms);if(!f||f.length===0)return;f=f[0],f.__EVENTTARGET.value="",f.__EVENTARGUMENT.value="",r=o.getElementById("__VIEWSTATE"),u=this.getElementById(e,"__VIEWSTATE"),r&&u&&(r.value=u.
value),r=o.getElementById("__EVENTVALIDATION"),u=this.getElementById(e,"__EVENTVALIDATION"),r&&u&&(r.value=u.value),s=this._sheet.parent._host.id,r=i.getElementById(s+"_data"),u=this.getElementById(e,s+"_data"),r&&u&&(r.value=u.value),e.innerHTML="",this._sheet.parent._loadData(!0),this._sheet.parent.invalidateLayout(),this._sheet.parent.repaint()},r.prototype.getElementById=function(n,t){var i,r;if(!n)return null;i=n.firstChild;while(i){if(i.id===t||i.name===t)return i;r=this.getElementById(i,t);if(r)return r;i=i.nextSibling}return null},r.prototype._onLoadDataCallback=function(n,t){var i,f,s,r,c,l,e,a,o,u,h;if(!n)return;i=this._sheet,f=JSON.parse(n);if(!f)return;s=f.dataSource;if(s&&s.length>0){c=i.getDataSource();if(c&&this.lastLoadedRowIndex===t.start)for(l=JSON.parse(s),r=0;r<l.length;r++)c[t.start+r]=l[r]}e=f.data;if(e)if(this.lastLoadedRowIndex===t.start){for(r in e)typeof
r!="function"&&(i._dataModel.dataTable[r]=e[r]);if(f.rows)for(r in f.rows)typeof r!="function"&&(i._rowInfos[r]=f.rows[r]);i.suspendCalcService(),i.suspendEvent(),i.isPaintSuspended(!0),a=i.getColumnCount();for(r in e)if(typeof r!="function"){o=e[r];if(o)for(u=0;u<a;u++)h=null,o[u]&&(h=o[u].formula),h&&(o[u].formula=null,i.setFormula(parseInt(r,10),u,h))}i.resumeCalcService(),i.resumeEvent(),i.isPaintSuspended(!1)}i.suspendEvent(),i.isPaintSuspended(!0),i.recalcAll(),i.resumeEvent(),i.isPaintSuspended(!1),i.clearPendingChanges(),i.repaint()},r.prototype._updateView=function(){var n=this._sheet,t;if(this.painting)return;this.painting=!0,t=!1,this.oldTop!==n._scrollTopRow&&this.oldLeft===n._scrollLeftCol?(t=this._vScrollView(n),this.oldTop=n._scrollTopRow):this.oldTop===n._scrollTopRow&&this.oldLeft!==n._scrollLeftCol&&(t=this._hScrollView(n),this.oldLeft=n._scrollLeftCol),t||(n.invalidateLayout()
,n.repaint()),this.painting=!1},r.prototype._vScrollView=function(n){var o=!1,h=this.oldTop,i,s,u,r,f,e;if(n._scrollTopRow>h)s=n._getRowLayout(1,t.SheetArea.viewport),u=s.findRow(n._scrollTopRow),u&&(o=!0,i=n._getSheetLayout(),n._render.translateScreen(i.x,u.y,i.rowHeaderWidth+i.frozenWidth+i.viewportWidth+i.frozenTrailingWidth,i.viewportHeight-u.y,i.x,i.viewportY),n.invalidateLayout(),n._render.update(i.x,i.viewportY+i.viewportHeight-u.y,i.rowHeaderWidth+i.frozenWidth+i.viewportWidth+i.frozenTrailingWidth,u.y,!1));else{for(i=n._getSheetLayout(),r=0,f=n._scrollTopRow;f<h&&r<i.viewportHeight;f++)r+=n._getZoomRowHeight(f);r<i.viewportHeight&&(o=!0,e=i.viewportHeight-r,n.getFrozenTrailingRowCount()>0&&(e=e-1),n._render.translateScreen(i.x,i.viewportY,i.rowHeaderWidth+i.frozenWidth+i.viewportWidth+i.frozenTrailingWidth,e,i.x,i.viewportY+r),n.invalidateLayout(),n._render.update(i.x,i.viewportY,i.rowHeaderWidth+i.frozenWidth+i.viewportWidth+i
.frozenTrailingWidth,r,!1))}return o},r.prototype._hScrollView=function(n){var o=!1,h=this.oldLeft,i,s,u,r,f,e;if(n._scrollLeftCol>h)s=n._getColumnLayout(1,t.SheetArea.viewport),u=s.findCol(n._scrollLeftCol),u&&(o=!0,i=n._getSheetLayout(),n._render.translateScreen(u.x,i.y,i.viewportWidth-u.x,i.colHeaderHeight+i.frozenHeight+i.viewportHeight+i.frozenTrailingHeight,i.viewportX,i.y),n.invalidateLayout(),n._render.update(i.viewportX+i.viewportWidth-u.x,i.y,u.x,i.colHeaderHeight+i.frozenHeight+i.viewportHeight+i.frozenTrailingHeight,!1));else{for(i=n._getSheetLayout(),r=0,f=n._scrollLeftCol;f<h&&r<i.viewportWidth;f++)r+=n._getZoomColumnWidth(f);r<i.viewportWidth&&(o=!0,e=i.viewportWidth-r,n.getFrozenTrailingColumnCount()>0&&(e=e-1),n._render.translateScreen(i.viewportX,i.y,e,i.colHeaderHeight+i.frozenHeight+i.viewportHeight+i.frozenTrailingHeight,i.viewportX+r,i.y),n.invalidateLayout(),n._render.update(i.viewportX,i.y,r,i.colHeaderHeight+i.f
rozenHeight+i.viewportHeight+i.frozenTrailingHeight,!1))}return o},r.prototype._notEqualSelecions=function(n,t){var f=!0,r,i,u;if(n.length===t.length)for(r=0;r<n.length;r++){i=n[r],u=t[r];if(i.row!==u.row||i.col!==u.col||i.rowCount!==u.rowCount||i.colCount!==u.colCount){f=!0;break}else f=!1}return f},r.prototype._createFocusHolder=function(n){var u=n.isImeAware(),t,r;return this._destroyFocusHolder(!0),u&&(t=n.createEditorElement(),this._focusHolderOldCss||(this._focusHolderOldCss={overflow:"visible",border:"none"}),this._focusHolderOldCss.overflow=t.style.overflow,this._focusHolderOldCss.border=t.style.border,t.style.position="absolute",t.style.overflow="hidden",t.style.width="0px",t.style.height="0px",t.style.border="none",i.body.insertBefore(t,null),this._cellTypeFocusHolder=t),this._originalFocusHolder||(t=i.createElement("div"),t.style.position="absolute",t.style.overflow="
hidden",t.style.width="0px",t.style.height="0px",i.body.insertBefore(t,null),this._originalFocusHolder=t),this._focusElem||(r=i.createElement("textarea"),r.style.position="absolute",r.setAttribute("gcUIElement","gcSheetFocusInput"),this._originalFocusHolder.insertBefore(r,null),this._focusElem=r),u?this._cellTypeFocusHolder:this._originalFocusHolder},r.prototype._resetFocusHolder=function(){this._cellTypeFocusHolder&&this._focusHolderOldCss&&$(this._cellTypeFocusHolder).css("overflow",this._focusHolderOldCss.overflow).css("border",this._focusHolderOldCss.border)},r.prototype._destroyFocusHolder=function(n){this._cellTypeFocusHolder&&(this._focusElem&&!n&&this._focusElem.focus(),this._cellTypeFocusHolder.parentElement&&this._cellTypeFocusHolder.parentElement.removeChild(this._cellTypeFocusHolder),this._cellTypeFocusHolder=null)},r.prototype._setFocus=fu
nction(){var e,o,h,c,u,f,n,r,s;if(t.util._isSilverlightCanvas()&&!t.util._isStandardCanvas())return;this._hitTestResult?(e=this._hitTestResult.row,o=this._hitTestResult.col,h=this._hitTestResult.rowViewportIndex,c=this._hitTestResult.colViewportIndex):(e=this._sheet.getActiveRowIndex(),o=this._sheet.getActiveColumnIndex(),h=this._sheet.activeRowViewportIndex,c=this._sheet.activeColViewportIndex),u=this._sheet.getCellType(e,o),this._createFocusHolder(u),f=this._sheet.getCellRect(e,o,h,c),this._isInvalidRect(f)?(n=this._lastFocusHolderTop,r=this._lastFocusHolderLeft):(s=this._getCanvasOffset(),n=f.y+s.top-2,r=f.x+s.left-2,this._lastFocusHolderTop=n,this._lastFocusHolderLeft=r),this._tabStripHitTestResult&&(n=this._tabStripHitTestResult.top,r=this._tabStripHitTestResult.left),$(this._cellTypeFocusHolder).css("top",n).css("left",r),$(this._originalFocusHolder).css("top",n).css("left",r),i.body.focus(),n!==null&&n!==undefine
d&&r!==null&&r!==undefined&&(u.isImeAware()?u.focus(this._cellTypeFocusHolder):this._focusElem.focus()),window.gcGlobal.activeElement||(window.gcGlobal.activeElement=this._sheet),this._updateValidationUI(this._sheet._activeRowIndex,this._sheet._activeColIndex)},r.prototype._switchFocusForClipboard=function(n){this._focusElem&&(this._focusElem.value=n,this._focusElem.focus(),this._focusElem.select())},r.prototype._switchBackFocusAfterClipboard=function(){this._setFocus()},r.prototype._getClipboardData=function(){var u=this._focusElem?this._focusElem.value:"",n=new t.StringBuilder,i,r;if(u){var o='"',e=o.length,f=!1;for(i=0;i<u.length;i++)r=u[i],f||r!=="\n"||(r="\r\n"),n.Append(r),n.Length()<e||o!==n.ToString(n.Length()-e,e)||(f=!f)}return n.ToString()},r.prototype.bind=function(n,t,i){$(this._getElem()).bind(n,t,i)},r.prototype.unbind=function(n,t){$(this._getElem()).unbind(n,t)},r.prototype.trigger=function(n,t
){this._eventSuspended===0&&$(this._getElem()).trigger(n,t)},r.prototype._showTooltip=function(n,t,r,u){var o=this._sheet,e=o.parent,f;e&&!e._tooltip&&(f=i.createElement("div"),$(f).addClass("ui-widget-content"),$(f).addClass("ui-state-default"),$(f).css("position","absolute").css("padding","0px 3px 0px 3px").css("font","normal normal normal 10pt Arial").css("boxShadow","1px 2px 5px rgba(0,0,0,0.4)").css("border-radius","3px").width("auto").height("auto").appendTo(i.body),e._tooltip=f),this._refreshTooltip(n,t,r,u)},r.prototype._refreshTooltip=function(n,t,i,r){var o=this._sheet,e=o.parent,u,f;e&&(u=$(e._tooltip),u&&(n===undefined||n===null||n===""?u.hide():(u.html(n),u.show()),f=r?{top:0,left:0}:this._getCanvasOffset(),i!==null&&i!==undefined&&u.css("top",i+f.
top),t!==null&&t!==undefined&&u.css("left",t+f.left)))},r.prototype._removeTooltip=function(){var t=this._sheet,n=t.parent;n&&n._tooltip&&($(n._tooltip).remove(),n._tooltip=null)},r}(),t._SheetEventHandler=r,u=function(){function n(){this.top=!1,this.bottom=!1,this.left=!1,this.right=!1,this.distanceX=0,this.distanceY=0,this.nearMouseX=0,this.nearMouseY=0}return n}()})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype,n.prototype=new r},wijmo;(function(n){(function(n){var u,r,f,i,c,h;n.feature("core.sheet_border",["core.common"]),u={first:1,second:2},r=function(){function t(){}return t.prototype.adjust=function(n){n.orientation===0?(n.offsetEnd&&(this._x2+=n.offsetEnd),n.offsetStart&&(this._x1+=n.offsetStart)):n.orientation===1&&(n.of
fsetEnd&&(this._y2+=n.offsetEnd),n.offsetStart&&(this._y1+=n.offsetStart))},t.prototype.paint=function(n){var i=!1,t;n.lineWidth!==this._lineWidth&&(i=!0),t=this._color?this._color:"#9EB6CE",n.strokeStyle!==t&&(i=!0),i&&(n.closePath(),n.stroke(),n.beginPath(),n.lineWidth=this._lineWidth,n.strokeStyle=t),this.paintLine(n)},t.prototype.paintLine=function(n){n.moveTo(this._x1,this._y1),n.lineTo(this._x2,this._y2)},t.Create=function(t,r,u,e,o,s){(s===undefined||s===null)&&(s=n.LineStyle.thin);switch(s){case n.LineStyle.thin:return new f(t,r,u,e,o,1);case n.LineStyle.medium:return new f(t,r,u,e,o,2);case n.LineStyle.thick:return new f(t,r,u,e,o,3);case n.LineStyle.dashed:return new i(t,r,u,e,o,1,[3,1]);case n.LineStyle.dashDot:return new i(t,r,u,e,o,1,[8,2,2,2]);case n.LineStyle.dotted:return new i(t,r,u,e,o,1,[2,2]);case n.LineStyle.dashDotDot:return new i(t,r,u,e,o,1,[9,3,3,3,3,3]);case n.LineStyle.slantedDashDot:return new c(t,
r,u,e,o,t!==u,[11,1,5,1],[10,2,4,2]);case n.LineStyle.mediumDashDot:return new i(t,r,u,e,o,2,[9,3,3,3]);case n.LineStyle.mediumDashDotDot:return new i(t,r,u,e,o,2,[9,3,3,3,3,3]);case n.LineStyle.mediumDashed:return new i(t,r,u,e,o,2,[9,3]);case n.LineStyle.hair:return new i(t,r,u,e,o,1,[1]);case n.LineStyle.double:return new h(t,r,u,e,o,t!==u)}return null},t}(),n.Line=r,f=function(n){function t(t,i,r,u,f,e){n.call(this);var o=e%2;o||(t!==r?(i-=.5,u-=.5):(t-=.5,r-=.5)),this._x1=t,this._y1=i,this._x2=r,this._y2=u,this._color=f,this._lineWidth=e}return __extends(t,n),t}(r),n.SolidLine=f,i=function(n){function t(t,i,r,u,f,e,o){n.call(this);var s=e%2;s||(t!==r?(i-=.5,u-=.5):(t-=.5,r-=.5)),this._x1=t,this._y1=i,this._x2=r,this._y2=u,this._color=f,this._lineWidth=e,this._pattern=o}return __extends(t,n),t.prototype.paintLine=function(n){t.render(n,this._x1,this._y1,this._x2,this._y2,this._pattern)},t.render=function(n,t,i,r,u,f){var o=Math.sqrt(Math.pow(r-t,2)+Math.pow(u-i,2)),c={x:(r-t)/o,
y:(u-i)/o},h=0,l=0,e,s;f=f&&f.length?f:[4,4];while(h<o)e=Math.min(f[l++%f.length],o-h),s=l%2,h+=e,s&&n.moveTo(t,i),t+=e*c.x,i+=e*c.y,s&&n.lineTo(t,i)},t}(r),n.DashedLine=i,c=function(n){function t(t,i,r,u,f,e,o,s){n.call(this),e?(t-=1,r-=1):(i-=1,u-=1),this._x1=t,this._y1=i,this._x2=r,this._y2=u,this._color=f,this._horizental=e,this._lineWidth=1,this._pattern1=o,this._pattern2=s}return __extends(t,n),t.prototype.paintLine=function(n){var r=this._horizental?0:1,t=this._horizental?1:0;i.render(n,this._x1-r,this._y1-t,this._x2-r,this._y2-t,this._pattern1),i.render(n,this._x1,this._y1,this._x2,this._y2,this._pattern2)},t}(r),n.SlantedLine=c,h=function(n){function t(t,i,r,u,e,o){n.call(this);var h=o?0:1,s=o?1:0;this._line1=new f(t-h,i-s,r-h,u-s,e,1),this._line2=new f(t+h,i+s,r+h,u+s,e,1),this._color=e,this._horizental=o,this._lineWidth=1}return __extends(t,n),t.prototype.paintLine=function(n){this._line1.paintLine(n),this._line2.paintLine(n)},t.prototype.adjust
=function(n){n.lineSide?n.lineSide===u.first?this._line1.adjust(n):n.lineSide===u.second&&this._line2.adjust(n):(this._line1.adjust(n),this._line2.adjust(n))},t}(r),n.DoubleLine=h;var w=function(n,t){return 0},s=function(t,i){if(t){if(!i)return 1}else return i?-1:0;var u=n.LineBorder.prototype._weight(t),r=n.LineBorder.prototype._weight(i);return u===r?w(t.color,i.color):u-r},t=function(t){if(t){if(t.isGridLine)return 1;if(t.style)return n.LineBorder.prototype.width(t.style)}return 0},o=function(t){return t&&t.style===n.LineStyle.double},v=function(t){return t&&t.style===n.LineStyle.slantedDashDot},e=function(){var n={previous:-1,next:1},e=function(n,t){if(n){if(!t)return n}else return t?t:null;return s(n.style,t.style)>0?n:t},r=function(n,t){n&&n.line&&n.line.adjust(t)},f=function(n,t){if(n===null||n===undefined)return t===null||t===undefined?0:-1;else if(t===null||t===undefined)return 1;else{if(n.isGridLine)return t.isGridLine?0:-1;else i
f(t.isGridLine)return 1;return s(n.style,t.style)}},i=function(n){return n&&o(n.style)},c=function(n,t,r,u){if(!i(n)){var f=0;return f+=i(t)?1:0,f+=i(r)?1:0,f+=i(u)?1:0,f<2}return!0},v=function(t,i,e,o,s,h){var c={orientation:h?1:0,offsetStart:0,offsetEnd:0},a=f(t,e),l=f(t,o);a<0||l<0?l<0?a<0||(c.lineSide=u.first,c.offsetStart+=s):(c.lineSide=u.second,c.offsetStart+=s):a===0&&l===0?s!==n.previous&&s===n.next&&(c.offsetEnd-=s):s===n.previous?c.offsetStart-=s:s===s.next&&(c.offsetEnd-=2*s),r(t,c)},h=function(e,o,s,h,c,l,a,v,y){var w={orientation:v?1:0,lineSide:y?u.second:u.first,offsetStart:0,offsetEnd:0},p={orientation:v?1:0,lineSide:y?u.first:u.second,offsetStart:0,offsetEnd:0},tt=l===1?h:c,k=a===n.next?s:o,ot=i(k),ut,rt,ft,it,g;ot?(ut=f(e,tt),ut===0?(rt=f(e,k),rt===0?a===n.next&&(p.offsetEnd-=a):rt>0&&(a===n.previous?p.offsetStart-=2*a:a===n.next&&(p.offsetEnd-=2*a))):ut>0?(ft=f(e,k),ft===0?a===n.n
ext&&(p.offsetEnd-=a):ft>0&&(a===n.previous?p.offsetStart-=2*a:a===n.next&&(p.offsetEnd-=2*a))):(it=f(e,k),it===0?a===n.previous?w.offsetStart+=2*a:a===n.next&&(w.offsetEnd+=2*a):it>0&&(a===n.previous?w.offsetStart-=3*a:a===n.next&&(w.offsetEnd-=3*a)))):f(e,tt)<0?a===n.previous?w.offsetStart+=2*a:a===n.next&&(w.offsetEnd+=2*a):a===n.previous?p.offsetStart-=2*a:a===n.next&&(p.offsetEnd-=2*a);var et=l===1?2:1,d=et===1?h:c,nt=!1,b=0;!nt&&i(d)&&f(d,e)>0&&(nt=!0,g=t(d),f(d,tt)>0?g>0&&(b=a===n.next&&i(s)?g>=2?2:1:a===n.previous&&i(o)?g>=3?2:1:g===3?3:2):b=g===3?3:2),nt||i(k)||(!k||k.isGridLine)&&(!d||d.isGridLine)||(nt=!0,b=a===n.previous?2:1),nt&&(a===n.previous?(w.offsetStart+=a*b,p.offsetStart+=a*b):a===n.next&&(w.offsetEnd+=a*b,p.offsetEnd+=a*b)),(w.offsetStart||w.offsetEnd)&&r(e,w),(p.offsetStart||p.offsetEnd)&&
;r(e,p)},a=function(t,u,e,o,s,h){if(f(t,e)>=0&&f(t,o)>=0){var c={orientation:h?1:0,offsetStart:0,offsetEnd:0};s===n.previous?(c.offsetStart-=2*s,i(t)&&f(u,t)>0&&(c.offsetStart-=1)):s===n.next&&(c.offsetEnd-=2*s,i(t)&&f(u,t)>0&&(c.offsetEnd+=1)),r(t,c)}},l=function(u,f,o,s,h,c){var a,v,l;i(u)&&(a=e(o,s),a&&!a.isGridLine&&(v=t(a),v>0&&(l={orientation:c?1:0,offsetStart:0,offsetEnd:0},h===n.previous?l.offsetStart+=v*h:l.offsetEnd+=v*h,(l.offsetStart||l.offsetEnd)&&r(u,l))))};return{calcLayoutHorizontal:function(n,u,o,s,h,l,a){var v,y,p,w;(u||o||s)&&(p=e(o,s),c(n,u,o,s)?(y=f(p,n))>0?(v=t(p),i(n)&&(i(o)||i(s)||i(u))||v===3&&r(n,{orientation:0,offsetStart:1})):p&&y<0?(y=f(n,u))>0?(v=t(p),v===3||v===2?r(n,{orientation:0,offsetStart:-2}):v===1&&r(n,{orientation:0,offsetStart:-1})):y!==0&&f(u,p)>0&&(v=t(p),v===3&&r(n
,{orientation:0,offsetStart:1})):y===0&&(!u||f(n,u)>0)&&(v=t(p),v===3||v===2?r(n,{orientation:0,offsetStart:-2}):v===1&&r(n,{orientation:0,offsetStart:-1})):r(n,{orientation:0,offsetStart:1})),(h||l||a)&&(w=e(l,a),c(n,h,l,a)?(y=f(w,n))>0?(v=t(w),i(n)&&(i(l)||i(a)||i(h))||(v===3?r(n,{orientation:0,offsetEnd:-2}):(v===2||v===1)&&r(n,{orientation:0,offsetEnd:-1}))):y<0?(y=f(n,h))>0?(v=t(w),v===3&&r(n,{orientation:0,offsetEnd:1})):y!==0&&r(n,{orientation:0,offsetEnd:-1}):y===0&&((y=f(n,h))>0?(v=t(w),v===3&&r(n,{orientation:0,offsetEnd:1})):y!==0&&r(n,{orientation:0,offsetEnd:-1})):r(n,{orientation:0,offsetEnd:-2}))},calcLayoutVertical:function(n,u,o,s,h,l,a){var v,y,p,w;(u||o||s)&&(p=e(o,s),c(n,u,o,s)?(y=f(p,n))>0?(v=t(p),i(n)&&(i(o)||i(s)||i(u))||v===3&&r(n,{orientation:1,offsetStart:1})):y<0?(y=f(n,u))>0?(v=t(p),v===3||v===2?r(n,{orientation:1,offsetS
tart:-2}):v===1&&r(n,{orientation:1,offsetStart:-1})):y!==0&&f(u,p)>0&&(v=t(p),v===3&&r(n,{orientation:1,offsetStart:1})):y===0&&f(n,u)>0&&(v=t(p),v===3||v===2?r(n,{orientation:1,offsetStart:-2}):v===1&&r(n,{orientation:1,offsetStart:-1})):r(n,{orientation:1,offsetStart:1})),(h||l||a)&&(w=e(l,a),c(n,h,l,a)?(y=f(n,w))<0?(v=t(w),i(n)&&(i(l)||i(a)||i(h))||(v===3||v===2?r(n,{orientation:1,offsetEnd:-2}):v===1&&r(n,{orientation:1,offsetEnd:-1}))):w!==null&&y>0?(y=f(n,h))>0?(v=t(w),v===3&&r(n,{orientation:1,offsetEnd:1})):y!==0&&r(n,{orientation:1,offsetEnd:-1}):y===0&&((y=f(n,h))>0?(v=t(w),v===3&&r(n,{orientation:1,offsetEnd:1})):y!==0&&r(n,{orientation:1,offsetEnd:-1})):r(n,{orientation:1,offsetEnd:-2}))},calcDoubleLayout:function(t,r,u,f,e,o,s,c){var w;c?this.calcLayoutVertical(t,r,u,f,e,o,s):this.calcLayoutHorizontal(t,r,u,f,e,o,s);var p=i(u
),y=i(f),b=i(r);p&&y&&b?v(t,r,u,f,n.previous,c):p&&!y?h(t,r,e,u,f,1,n.previous,c,!0):!p&&y?h(t,r,e,u,f,2,n.previous,c,!1):p&&y&&!b?a(t,r,u,f,n.previous,c):b&&l(t,r,u,f,n.previous,c),p=i(o),y=i(s),w=i(e),p&&y&&w?v(t,e,o,s,n.next,c):p&&!y?h(t,r,e,o,s,1,n.next,c,!0):!p&&y?h(t,r,e,o,s,2,n.next,c,!1):p&&y&&!w?a(t,e,o,s,n.next,c):w&&l(t,e,o,s,n.next,c)}}}(),l={layoutHorizontal:function(n,t,i,r,u,f,o){e.calcLayoutHorizontal(n,t,i,r,u,f,o)},layoutVertical:function(n,t,i,r,u,f,o){e.calcLayoutVertical(n,t,i,r,u,f,o)}},a={layoutHorizontal:function(n,t,i,r,u,f,o){e.calcDoubleLayout(n,t,i,r,u,f,o,!1)},layoutVertical:function(n,t,i,r,u,f,o){e.calcDoubleLayout(n,t,i,r,u,f,o,!0)}},y={layoutHorizontal:function(n,t,i,r,u,f,e){},layoutVertical:function(n,t,i,r,u,f,e){}},p=function(){function t(n,t,i,r){this._isInitialized=!1,this._isMerged=!1,this._sheet=n,this._sheetArea=r,this._rowViewport
Index=t,this._colViewportIndex=i}return t.prototype._initialize=function(){var t,i;this._spanCells=[],this._rowIndecies=[],this._colIndecies=[],this._overflowedCells=[],this._adjustingRanges=[],this._hGridLine=[],this._vGridLine=[],this._hBorders=[],this._vBorders=[];var f=0,u=0,e=0,r=0;for(this._sheetArea===n.SheetArea.viewport?(f=this._sheet.getViewportLeftColumn(this._colViewportIndex),u=this._sheet.getViewportRightColumn(this._colViewportIndex),e=this._sheet.getViewportTopRow(this._rowViewportIndex),r=this._sheet.getViewportBottomRow(this._rowViewportIndex)):this._sheetArea===n.SheetArea.colHeader?(f=this._sheet.getViewportLeftColumn(this._colViewportIndex),u=this._sheet.getViewportRightColumn(this._colViewportIndex),r=this._sheet.getRowCount(this._sheetArea)):this._sheetArea===n.SheetArea.rowHeader&&(u=this._sheet.getColumnCount(this._sheetArea),e=this._sheet.getViewportTopRow(this._rowViewportIndex),r=this._sheet.getViewportBottomRow(this._rowViewportIndex)),t=e;t<=
r;t++)this._sheet.getRowVisible(t,this._sheetArea)&&this._rowIndecies.push(t);for(i=f;i<=u;i++)this._sheet.getColumnVisible(i,this._sheetArea)&&this._colIndecies.push(i);this._isInitialized=!0},t.prototype.addCellLines=function(n,t,i,r,u,f,e,o,s){var y,v,l,a,c,h;this._isInitialized||this._initialize(),s&&(y={row:n,startCol:s.startCol,endCol:s.endCol},this._overflowedCells.contains(y)||this._overflowedCells.push(y)),o?this._spanCells.push(o):(e&&(v=e.borderLeft,l=e.borderTop,a=e.borderRight,c=e.borderBottom,h=e.backColor,(h===undefined||h===null)&&(e._backColor!==undefined||e._backColor!==null)&&(h=e._backColor)),!h||v||a||l||c||this._adjustingRanges.push({r:n,c:t,rc:1,cc:1}),this._addCellLineImp(n,t,i,r,u,f,v,l,a,c,h))},t.prototype._addCellLineImp=function(n,t,i,r,u,f,e,o,s,h,c,l,a){var p=this._addCellLineSide(n,t,i,r-.5,i+u,r-.5,o,this._hBorders),w=this._addCellLineSide(n,t,i-.5,r,i-.5,r+f,e,this._vBorders),b=this._addCellLineSide(
n+1,t,i,r+f-.5,i+u,r+f-.5,h,this._hBorders),k=this._addCellLineSide(n,t+1,i+u-.5,r,i+u-.5,r+f,s,this._vBorders),v,y;c&&this._sheet.getRowHeight(n)!==0&&this._sheet.getColumnWidth(t)!==0||(v=!b&&!l,y=!k&&!a,(v||y)&&this._addGridLine(n,t,i,r,u,f,v,y)),(p||c!==undefined)&&this._removeLineItem(n-1,t,this._hGridLine),(w||c!==undefined)&&this._removeLineItem(n,t-1,this._vGridLine),!c||e||s||o||h||(this._adjustLineItem(n-1,t-1,this._vGridLine,!1),this._adjustLineItem(n-1,t-1,this._hGridLine,!0))},t.prototype._addCellLineSide=function(t,i,u,f,e,o,h,c){if(h){var l,a=this._queryLineItem(t,i,c,!0);return a.success?(l=a.lineItem,l.style.style!==n.LineStyle.double&&(h.style===n.LineStyle.double||s(h,l.style)>0)&&(l.line=r.Create(u,f,e,o,h.color,h.style),l.style=h)):(l=this._queryLineItem(t,i,c).lineItem,l.line=r.Create(u,f,e,o,h.color,h.style),l.style=h),l.line!==null}return!1},t.prototype._addGridLine=function(t,i,u,f,e,
o,s,h){var l=this._sheetArea===n.SheetArea.viewport,c=this._sheet.gridline,y,v,a;(!l||c)&&(y=l?c.color:"#9EB6CE",s&&(c.showHorizontalGridline||!l)&&(v=this._queryLineItem(t,i,this._hGridLine).lineItem,v.isGridLine=!0,v.line=r.Create(u,f+o-.5,u+e,f+o-.5,y)),h&&(c.showVerticalGridline||!l)&&(a=this._queryLineItem(t,i,this._vGridLine).lineItem,a.isGridLine=!0,a.line=r.Create(u+e-.5,f,u+e-.5,f+o,y)))},t.prototype._adjustLineItem=function(n,t,i,r){var f=this._queryLineItem(n,t,i,!0),u;f.success&&(u=f.lineItem,u&&u.line&&u.line.adjust({orientation:r?0:1,offsetEnd:-1}))},t.prototype._removeLineItem=function(n,t,i){var r,u;n<0||t<0||(r=i[n],r&&(u=r[t],u&&(r[t]=null)))},t.prototype._queryLineItem=function(n,t,i,r){var u,f;if(n===-1||t===-1)return{success:!1};u=i[n];if(!u){if(r)return{success:!1};i[n]=u=[]}f=u[t];if(!f){if(r)return{success:!1};u[t]=f={}}return{success:!0,lineItem:f}},t.prototype._p
rocessOverflowCells=function(){for(var n,t=0;t<this._overflowedCells.length;t++){var u=this._overflowedCells[t],r=u.row,f=u.startCol,e=u.endCol,i;for(n=f;n<e;n++)i=this._queryLineItem(r,n+1,this._vBorders,!0),i.success?this._removeLineItem(r,n+1,this._vBorders):(i=this._queryLineItem(r,n,this._vGridLine,!0),i.success&&this._removeLineItem(r,n,this._vGridLine))}},t.prototype._processSpans=function(){var n,t;if(this._spanCells.length>0)for(n=0;n<this._spanCells.length;n++)t=this._spanCells[n],this._processSpanCell(t)},t.prototype._processSpanCell=function(n){var k=n.row,b=n.col,tt=n.x,it=n.y,c,l,a,v,nt=this._sheet.getActualStyle(k,b,this._sheetArea),h=nt?nt.backColor:null,f,i,t,r,u,y,d,p,g,e,o=tt,s=it,w;if(n.rowCount===1)for(i=k,r=this._sheet._getZoomRowHeight(i,this._sheetArea),f=0;f<n.colCount;f++)y=f===0,p=f===n.colCount-1,t=b+f,u=this._sheet._getZoomColumnWidth(t,this._sheetArea),e=this._sheet.getActualStyle(i,t,this._sheetArea),e?(c=e.borderLeft,l=e.borderT
op,a=e.borderRight,v=e.borderBottom):c=l=a=v=null,y?this._addCellLineImp(i,t,o,s,u,r,c,l,null,v,h,!1,!0):p?this._addCellLineImp(i,t,o,s,u,r,null,l,a,v,h):this._addCellLineImp(i,t,o,s,u,r,null,l,null,v,h,!1,!0),o+=u;else if(n.colCount===1)for(t=b,u=this._sheet._getZoomColumnWidth(t,this._sheetArea),f=0;f<n.rowCount;f++)d=f===0,g=f===n.rowCount-1,i=k+f,r=this._sheet._getZoomRowHeight(i,this._sheetArea),e=this._sheet.getActualStyle(i,t,this._sheetArea),e?(c=e.borderLeft,l=e.borderTop,a=e.borderRight,v=e.borderBottom):c=l=a=v=null,d?this._addCellLineImp(i,t,o,s,u,r,c,l,a,null,h,!0,!1):g?this._addCellLineImp(i,t,o,s,u,r,c,null,a,v,h):this._addCellLineImp(i,t,o,s,u,r,c,null,a,null,h,!0,!1),s+=r;else for(f=0;f<n.rowCount;f++){for(i=k+f,d=f===0,g=f===n.rowCount-1,r=this._sheet._getZoomRowHeight(i,this._sheetArea),w=0;w<n.colCount;w++)t=b+w,y=w===0,p=w===n.colCount-1,u=this._sheet._getZoomColumnWidth(t,this._sheetArea),e=this._sheet.getActualStyle(i,t,this._sheetArea),e?(c=e.borderL
eft,l=e.borderTop,a=e.borderRight,v=e.borderBottom):c=l=a=v=null,d?y?this._addCellLineImp(i,t,o,s,u,r,c,l,null,null,h,!0,!0):p?this._addCellLineImp(i,t,o,s,u,r,null,l,a,null,h,!0,!1):this._addCellLineImp(i,t,o,s,u,r,null,l,null,null,h,!0,!0):g?y?this._addCellLineImp(i,t,o,s,u,r,c,null,null,v,h,!1,!0):p?this._addCellLineImp(i,t,o,s,u,r,null,null,a,v,h):this._addCellLineImp(i,t,o,s,u,r,null,null,null,v,h,!1,!0):y?this._addCellLineImp(i,t,o,s,u,r,c,null,null,null,h,!0,!0):p&&this._addCellLineImp(i,t,o,s,u,r,null,null,a,null,h,!0,!1),o+=u;o=tt,s+=r}!h||c||a||l||v||this._adjustingRanges.push({r:k,c:b,rc:n.rowCount,cc:n.colCount})},t.prototype._adjust=function(){(this._vBorders.length>0||this._hBorders.length>0)&&this._adjustBorders(),this._adjustingRanges.length>0&&this._adjustGridlines()},t.prototype._adjustGridlines=function(){for(var i,r,u,n,f=0;f<this._adjustingRanges.length;f++){var t=this._adjustingRanges[f],o=t.r,e=t.c,s=o,c=o-1,l=e-1,h=e;for(t.
rc>1&&(s+=t.rc-1),t.cc>1&&(h+=t.cc-1),i=!1,r=!1,u=0;u<this._adjustingRanges.length;u++){n=this._adjustingRanges[u],n.c===h+1&&n.r===o&&(r=!0),n.r===s+1&&n.c===e&&(i=!0);if(i&&r)break;if(n.r>o+1&&n.c>e+1)break}i||this._adjustLineItem(s,l,this._hGridLine,!0),r||this._adjustLineItem(c,h,this._vGridLine,!1)}},t.prototype._adjustBorders=function(){for(var n,r,i,t=0;t<=this._rowIndecies.length;t++)for(r=this._rowIndecies[t],r===undefined&&t===this._rowIndecies.length&&(r=this._rowIndecies[t-1]+1),n=0;n<=this._colIndecies.length;n++)i=this._colIndecies[n],i===undefined&&n===this._colIndecies.length&&(i=this._colIndecies[n-1]+1),this._adjustHorizontalBorderLine(t,n,r,i);for(n=0;n<=this._colIndecies.length;n++)for(i=this._colIndecies[n],i===undefined&&n===this._colIndecies.length&&(i=this._colIndecies[n-1]+1),t=0;t<=this._rowIndecies.length;t++)r=this._ro
wIndecies[t],r===undefined&&t===this._rowIndecies.length&&(r=this._rowIndecies[t-1]+1),this._adjustVerticalBorderLine(t,n,r,i)},t.prototype._adjustHorizontalBorderLine=function(n,t,i,r){var f,c,h,p,w,e,s,b=this._queryLineItem(i,r,this._hBorders,!0),u=0;if(b.success)u++;else{b=this._queryLineItem(i-1,r,this._hGridLine,!0);if(!b.success)return}f=b.lineItem,c=this._getLineItemImp(i,this._prevCol(t),!1),this._isBorderLineInLayout(c)&&u++,h=this._getLineItemImp(this._prevRow(n),r,!0),this._isBorderLineInLayout(h)&&u++,p=this._getLineItemImp(i,r,!0),this._isBorderLineInLayout(p)&&u++,w=this._getLineItemImp(i,this._nextCol(t),!1),this._isBorderLineInLayout(w)&&u++,e=this._getLineItemImp(this._prevRow(n),this._nextCol(t),!0),this._isBorderLineInLayout(e)&&u++,s=this._getLineItemImp(i,this._nextCol(t),!0),this._isBorderLineInLayout(s)&&u++,u>0&&(o(f.style)?a.layoutHorizontal(f,c,h,p,w,e,s):v(f.style)?y.layoutHorizonta
l(f,c,h,p,w,e,s):l.layoutHorizontal(f,c,h,p,w,e,s))},t.prototype._adjustVerticalBorderLine=function(n,t,i,r){var f,c,h,p,w,e,s,b=this._queryLineItem(i,r,this._vBorders,!0),u=0;if(b.success)u++;else{b=this._queryLineItem(i,r-1,this._vGridLine,!0);if(!b.success)return}f=b.lineItem,c=this._getLineItemImp(this._prevRow(n),r,!0),this._isBorderLineInLayout(c)&&u++,h=this._getLineItemImp(i,this._prevCol(t),!1),this._isBorderLineInLayout(h)&&u++,p=this._getLineItemImp(i,r,!1),this._isBorderLineInLayout(p)&&u++,w=this._getLineItemImp(this._nextRow(n),r,!0),this._isBorderLineInLayout(w)&&u++,e=this._getLineItemImp(this._nextRow(n),this._prevCol(t),!1),this._isBorderLineInLayout(e)&&u++,s=this._getLineItemImp(this._nextRow(n),r,!1),this._isBorderLineInLayout(s)&&u++,u>0&&(o(f.style)?a.layoutVertical(f,c,h,p,w,e,s):v(f.style)?y.layoutVertical(f,c,h,p,w,e,s):l.layoutVertical(f,c,h,p,w,e,s))},t.prototype._isBorderLineInLayout=function(n){
return n&&!n.isGridLine&&n.line},t.prototype._prevCol=function(n){return n<0?-1:this._colIndecies[n-1]},t.prototype._nextCol=function(n){var t=this._colIndecies[n+1];return t===undefined&&n+1>=this._colIndecies.length?this._colIndecies[this._colIndecies.length-1]+1:t},t.prototype._prevRow=function(n){return n<0?-1:this._rowIndecies[n-1]},t.prototype._nextRow=function(n){var t=this._rowIndecies[n+1];return t===undefined&&n+1>=this._rowIndecies.length?this._rowIndecies[this._rowIndecies.length-1]+1:t},t.prototype._getLineItemImp=function(n,t,i){if(n===undefined||n<0||t===undefined||t<0)return null;var u=i?this._vBorders:this._hBorders,r=this._queryLineItem(n,t,u,!0);if(r.success)return r.lineItem;u=i?this._vGridLine:this._hGridLine;if(i){t--;if(t<0)return null}else{n--;if(n<0)return null}return r=this._queryLineItem(n,t,u,!0),r.success?r.lineItem:null},t.prototype.paint=function(n,t){if(!this._isInitialized)return;this._isMerged|
|(this._processSpans(),this._processOverflowCells(),this._adjust(),this._isMerged=!0),n.save(),n.beginPath(),this._paint(n,t),n.closePath(),n.stroke(),n.restore()},t.prototype._paint=function(n,t){this._paintGridLine(n),this._paintBorderLines(n)},t.prototype._paintGridLine=function(n){this._paintLines(n,this._hGridLine),this._paintLines(n,this._vGridLine)},t.prototype._paintBorderLines=function(n){this._paintLines(n,this._hBorders),this._paintLines(n,this._vBorders)},t.prototype._paintLines=function(n,t){var u,i,f,r;if(t&&t.length>0)for(u in t)if(u){i=t[u];if(i&&i.length>0)for(f in i)f&&(r=i[f],r&&r.line&&r.line.paint(n))}},t}();n._GcBorders=p})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(t){t.feature("core.sheet_render",["core.common","core.sheet_border","core.sheet_action","core.sheet_model","core.imageLoader"]);var i=window.do
cument,r=function(){function r(n){this.ctx=null,this.buffer=null,this.buffer2=null,this.bufferCtx=null,this.bufferCtx2=null,this._rowGroups=null,this._columnGroups=null,this._init(n)}return r.prototype._init=function(n){this._sheet=n},r.prototype._getCtx=function(){this.ctx=null;var i=this._sheet,n=i._getCanvas();if(n){if(!n.getContext&&t.util._isSilverlightCanvas())if(!n.getContext)return;n.getContext&&(this.ctx=n.getContext("2d"))}return this.ctx&&(this.ctx.name="userContext"),this.ctx},r.prototype._getBufferCtx=function(){var u=this._sheet,r=u._bounds,n=this.buffer;n&&n.width===r.width&&n.height===r.height||(this.buffer=n=i.createElement("canvas"),n.width=r.width,n.height=r.height);if(n.getContext)this.bufferCtx=n.getContext("2d");else if(t.util._isSilverlightCanvas())if(n.getContext)this.bufferCtx=n.getContext("2d");else return;return this.bufferCtx&&(this.bufferCtx.beginPath(),this
.bufferCtx.font=this._getZoomFont(this._getDefaultFont()),this.bufferCtx.name="bufferContext"),this.bufferCtx},r.prototype._getBufferCtx2=function(){var u=this._sheet,r=u._bounds,n=this.buffer2;n&&n.width===r.width&&n.height===r.height||(this.buffer2=n=i.createElement("canvas"),n.width=r.width,n.height=r.height);if(n.getContext)this.bufferCtx2=n.getContext("2d");else if(t.util._isSilverlightCanvas())if(n.getContext)this.bufferCtx2=n.getContext("2d");else return;return this.bufferCtx2&&(this.bufferCtx2.beginPath(),this.bufferCtx2.font=this._getZoomFont(this._getDefaultFont()),this.bufferCtx2.name="bufferContext"),this.bufferCtx2},r.prototype._getDefaultFont=function(n){return n&&n!==t.SheetArea.viewport?"11pt "+this._sheet.currentTheme().bodyFont():"10pt Arial"},r.prototype._getDefaultBackground=function(){return"white"},r.prototype._getSpreadBackColor=function(){var u=this
._sheet,n=u.parent,f=n?n._backColor:this._getDefaultBackground(),i=new t._ThemeContext(u).getColor(f),r=n?n._backgroundImage:null;return r&&r!==""&&(i="transparent"),i},r.prototype._getGrayAreaBackColor=function(n){var f=this._sheet,i=f.parent,e=i?i._grayAreaBackColor:"gray",r=this._getThemeContentBackgroundColor(new t._ThemeContext(f).getColor(e)),u;return n?(u=i?i._backgroundImage:null,u&&u!==""&&(r="transparent"),r):r},r.prototype._getZoomFont=function(n){var i=this._sheet;return t.StyleHelper._scaleFont(n,i._zoomFactor)},r.prototype._copyDoubleBuffer=function(n,i,r,u,f,e,o,s,h){var v,c;if(!t.util._useDoubleBuffer())return;if(n!==undefined&&n!==null&&i!==undefined&&i!==null&&r>0&&u>0){var a=s?s:this._getBufferCtx(),y=h?h:this._getCtx(),l=null;if(this._sheet._canvas)if(o){v=new t.Rect(n,i,r,u),c=v.getIntersectRect(o);if(c)n=c.x,i=c.y,l=a.getImageData(c.x,
c.y,c.width,c.height);else return}else l=a.getImageData(n,i,r,u);else l=a.getImageData(0,0,r,u);(f===undefined||f===null)&&(f=n),(e===undefined||e===null)&&(e=i),y.putImageData(l,f,e)}},r.prototype._copyDoubleBufferRect=function(n,t,i,r,u,f){n&&this._copyDoubleBuffer(n.x,n.y,n.width,n.height,t,i,r,u,f)},r.prototype.translateScreen=function(n,t,i,r,u,f,e,o){try{var s=this._getCtx(),h=s.getImageData(n,t,i,r);s.putImageData(h,u,f)}catch(c){}},r.prototype.repaintSelection=function(i,r,u){var l,c,s,e,y,b,h;u||(u=this._getCtx());var k=!1,o=this._sheet,f=new n.spread.Range(-1,-1,-1,-1);if(i){f=o._allowCellOverflow?new n.spread.Range(i.row,0,i.rowCount,o.getColumnCount()):new n.spread.Range(i.row,i.col,i.rowCount,i.colCount);if(!o._isNavigateInSelection){if(f.col>=0){var v=f.col,p=f.col+f.colCount-1,d=o.getRowCount(t.SheetArea.colHeader);for(l=0;l<d;l++)s=o._colHeaderSpanModel.find(l,f.col),s&&(v=Math.min(s.col,v)),s=o._colHeaderSpanModel.find(l,f.col+f
.colCount-1),s&&(p=Math.max(s.col+s.colCount-1,p));f.col=v,f.colCount=p-v+1}if(f.row>=0){var a=f.row,w=f.row+f.rowCount-1,g=o.getColumnCount(t.SheetArea.rowHeader);for(c=0;c<g;c++)s=o._rowHeaderSpanModel.find(f.row,c),s&&(a=Math.min(s.row,a)),s=o._rowHeaderSpanModel.find(f.row+f.rowCount-1,c),s&&(w=Math.max(s.row+s.rowCount-1,w));f.row=a,f.rowCount=w-a+1}}}e=o._getRangeRect2(f);if(e.width>=0&&e.height>=0){e.x-=2,e.y-=2,e.width+=4,e.height+=4;if(r){y=e.getIntersectRect(r);if(y)e=y;else return}b=t.util._useDoubleBuffer(),b||(o._dirty=!0),e.width!=4&&e.height!=4&&this.paint(u,e),h=o._getSheetLayout(),e.height>0&&!o._isNavigateInSelection&&(o._dirty=!0,this.paint(u,new t.Rect(h.x,e.y,h.rowHeaderWidth,e.height))),e.width>0&&!o._isNavigateInSelection&&(o._dirty=!0,this.paint(u,new t.Rect(e.x,h.y,e.width,h.colHeaderHeight))),k=!0}return k},r.prototype.update=function(n,i,r,u,f){var o=this._she
et,e;if(o._layoutSuspended>0)return;e=this._getCtx(),e&&(f||(o._dirty=!0),this.paint(e,new t.Rect(n,i,r,u)))},r.prototype.repaint=function(n){var i=this._sheet,t;if(i._layoutSuspended>0)return;t=this._getCtx(),t&&(i._dirty=!0,this.paint(t,n))},r.prototype.paint=function(n,i){var f,r,h,e,u,s,o;if(!n)return;f=this._sheet,r=f._bounds,i||(i=r),h=t.util._useDoubleBuffer(),e=h?this._getBufferCtx():n,e||(h=!1,e=n),f._dirty&&(f._dirty=!1,h&&(e.clearRect(i.x,i.y,i.width,i.height),e.translate(-r.x,-r.y)),this.paintSheet(e,i),h&&e.translate(r.x,r.y));if(h){u=n,($.browser.chrome||$.browser.safari)&&(u=this._getBufferCtx2()),this._copyDoubleBufferRect(i,null,null,null,e,u);if(!f._hoverCell&&f._canvas){var a=f._getSheetLayout(),l=f._getRowLayout(1),v=f._getColumnLayout(1),y=l.length>0?l[l.length-1]:null,c=v.length>0?v[v.length-1]:null;for(s=0;s<=2;s++)for(o=0;o<=2;o++){r=a.viewportRect(s,o);if(!r||r.width===0||r.height===0)
continue;o===1&&c&&(r.width=Math.min(r.width,c.x+c.width-a.viewportX)),s===1&&y&&(r.height=Math.min(r.height,y.y+y.height-a.viewportY)),(!i||r.intersectRect(i))&&(u.save(),u.rect(r.x,r.y,r.width,r.height),u.clip(),u.beginPath(),this.paintSelection(u,s,o,i),u.beginPath(),u.restore())}this.paintResizeLine(u,i)}u!==n&&this._copyDoubleBufferRect(i,null,null,null,u,n)}},r.prototype.paintSheet=function(n,i){var s=this._sheet,o,e,u,r,l,y,p,w,f,v,h,a,c;if(!n||s._layoutSuspended>0)return;for(u=s._bounds,n.save(),i?n.rect(i.x,i.y,i.width,i.height):n.rect(u.x,u.y,u.width,u.height),n.clip(),n.beginPath(),n.fillStyle=this._getGrayAreaBackColor(!0),n.fillRect(u.x,u.y,u.width,u.height),r=s._getSheetLayout(),t.features.group&&this.paintGroup(n,i),e=0;e<=2;e++)l=r.colHeaderRect(e),l&&(i?(f=l.getIntersectRect(i),f&&this.paintColHeader(n,e,f)):this.paintColHeader(n,e,l));for(o=0;o<=2;o++)for(y=r.rowHeaderRect(o),y&&am
p;(i?(f=y.getIntersectRect(i),f&&this.paintRowHeader(n,o,f)):this.paintRowHeader(n,o,y)),e=0;e<=2;e++)p=r.viewportRect(o,e),p&&(i?(f=p.getIntersectRect(i),f&&this.paintViewport(n,o,e,f)):this.paintViewport(n,o,e,p));w=r.headerCornerRect(),w&&(i?(f=w.getIntersectRect(i),f&&this.paintColHeaderCorner(n,f)):this.paintColHeaderCorner(n,w)),v=s._getRowLayout(1),v.length>0&&(h=v[v.length-1],h.y+h.height<r.frozenTrailingY&&(n.fillStyle=this._getGrayAreaBackColor(!1),n.fillRect(r.headerX,h.y+h.height,r.width,r.frozenTrailingY-(h.y+h.height)))),a=s._getColumnLayout(1),a.length>0&&(c=a[a.length-1],c.x+c.width<r.frozenTrailingX&&(n.fillStyle=this._getGrayAreaBackColor(!1),n.fillRect(c.x+c.width,r.headerY,r.frozenTrailingX-(c.x+c.width),r.height))),this.paintFrozenLine(n),s.borderWidth>0&&(n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.strokeRect(u.x+n.lineWidth/2,u.y+n.lineWidth/2,Math.max
(0,u.width-n.lineWidth),Math.max(0,u.height-n.lineWidth))),n.beginPath(),n.restore()},r.prototype._getThemeContentBackgroundColor=function(n){var f=this._sheet,u,r;return f.parent&&f.parent.useWijmoTheme&&(u=t.Global.prototype._dummyContent,r=u.currentStyle,i.defaultView&&i.defaultView.getComputedStyle&&(r=i.defaultView.getComputedStyle(u,"")),r&&r.backgroundColor&&r.backgroundColor!==""&&(n=r.backgroundColor)),n},r.prototype.refreshDragDropIndicator=function(){var i=this._sheet,l=i._currentTarget,o,s;if(!l||!l.dragInfo)return;var c=this._getCtx(),f=i._getSheetLayout(),e=i._actualDragRange,r=i._dragRect,n=i._getRangeRect2(e),a=i._frozenTrailingColCount,h=i._frozenTrailingRowCount,v=i.getColumnCount()-a,y=i.getRowCount()-h,u=f.viewportRect(1,1);a>0&&e.col+e.colCount<=v&&n.x+n.width>u.x+u.width&&n.intersectRect(u)&&(n=n.getIntersectRect(u)),h>0&&e.row+e.rowCo
unt<=y&&n.y+n.height>u.y+u.height&&n.intersectRect(u)&&(n=n.getIntersectRect(u)),o=new t.Rect(f.frozenX,f.frozenY,f.frozenTrailingX+f.frozenTrailingWidth,f.frozenTrailingY+f.frozenTrailingHeight),n.width>0&&n.height>0?(r.x=n.x,r.y=n.y,r.width=n.width-1,r.height=n.height-1,this.paintDragDropIndicator(c,o)):(n.width===0||n.height===0)&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height,this.paintDragDropIndicator(c,o)),s=i._eventHandler._isDragInsert,i._dragOldRect=s===!0?i._insertDragRect:new t.Rect(r.x,r.y,r.width,r.height)},r.prototype.paintDragDropIndicator=function(n,i){var f=this._sheet,r=f._dragRect,y=f._eventHandler._isDragInsert,l=r.hitTarget,u,h,o,s,v,e,c,a;if(!f||!r||!l)return;n.save(),y===!0&&(r.row===-1||r.col===-1)?r.row===-1&&r.col!==-1?(o=f._getColumnLayout(0).findCol(r.hitCol),o||(o=f._getColumnLayout(1).findCol(r.hitCol)),o||(o=f._getColumnLayout(2).findCol(r.hitCol)),o&&(s=o.x,v=o.width,r.co
l=r.hitCol,l.x>s+v/2&&(r.col<f._getLastFullyVisibleColumn()||r.col===f._getLastVisualColumn())&&(s=o.x+o.width,r.col++),u=f._dragOldRect,u&&u.width===0||(u=f._dragRect),u&&(h=new t.Rect(u.x-2,u.y-2,u.width+4,u.height+4),this._copyDoubleBufferRect(h,null,null,i),this.repaintSelection(f._getActiveSelectedRange(),i)),f._insertDragRect=new t.Rect(s,r.y,0,r.height),n.rect(i.x,i.y,i.width,i.height),n.clip(),n.beginPath(),this.paintDragLine(n,s,r.y,s,r.y+r.height))):r.row!==-1&&r.col===-1&&(e=f._getRowLayout(0).findRow(r.hitRow),e||(e=f._getRowLayout(1).findRow(r.hitRow)),e||(e=f._getRowLayout(2).findRow(r.hitRow)),e&&(c=e.y,a=e.height,r.row=r.hitRow,l.y>c+a/2&&(r.row<f._getLastFullyVisibleRow()||r.row===f._getLastVisualRow())&&(c=e.y+e.height,r.row++),u=f._dragOldRect,u&&u.height===0||(u=f._dragRect),u&&(h=new t.Rect(u.x-2,u.y-2,u.width+4,u.height+4),this._copyDoubleBufferRect(h,null,null,i
),this.repaintSelection(f._getActiveSelectedRange(),i)),f._insertDragRect=new t.Rect(r.x,c,r.width,0),n.rect(i.x,i.y,i.width,i.height),n.clip(),n.beginPath(),this.paintDragLine(n,r.x,c,r.x+r.width,c))):(u=f._dragOldRect,u&&(h=new t.Rect(u.x-2,u.y-2,u.width+4,u.height+4),this._copyDoubleBufferRect(h,null,null,i),this.repaintSelection(f._getActiveSelectedRange(),i)),n.rect(i.x,i.y,i.width,i.height),n.clip(),n.beginPath(),this.paintDragRectangle(n,r)),n.beginPath(),n.restore()},r.prototype._union=function(n,i){var f=Math.min(n.x,i.x),e=Math.min(n.y,i.y),r=Math.max(n.x+n.width-1,i.x+i.width-1),u=Math.max(n.y+n.height-1,i.y+i.height-1);return new t.Rect(f,e,r,u)},r.prototype.paintDragRectangle=function(n,t){this.paintDragLine(n,t.x,t.y,t.x+t.width,t.y),this.paintDragLine(n,t.x,t.y+t.height,t.x+t.width,t.y+t.height),this.paintDragLine(n,t.x,t.y,t.x,t.y+t.height),this.paintDragLine(n,t.x+t.width,t.y,t.x+t.width,t.y+t.height)},r.prototype.paintDragLine=function(n,i,r,u,f){n.save();v
ar s,o,e;i===u?(n.rect(i-2,r,7,Math.abs(f-r)),n.clip(),n.beginPath(),r<f?(r-=3,f+=3):(r+=3,f-=3),s=t.Line.Create(i-1,r-1,u-1,f+1,"black",t.LineStyle.hair),o=t.Line.Create(i,r,u,f,"black",t.LineStyle.hair),e=t.Line.Create(i+1,r-1,u+1,f+1,"black",t.LineStyle.hair)):r===f&&(n.rect(i,r-2,Math.abs(u-i),7),n.clip(),n.beginPath(),i<u?(i-=3,u+=3):(i+=3,u-=3),s=t.Line.Create(i-1,r-1,u+1,f-1,"black",t.LineStyle.hair),o=t.Line.Create(i,r,u,f,"black",t.LineStyle.hair),e=t.Line.Create(i-1,r+1,u+1,f+1,"black",t.LineStyle.hair)),s.paintLine(n),o.paintLine(n),e.paintLine(n),n.stroke(),n.beginPath(),n.restore()},r.prototype.paintResizeLine=function(n,t){var r,i,o=this._sheet,e,u,f;if(!o._eventHandler.isMouseDown)return;e=o._currentTarget;if(!e)return;u=e.resizeInfo;if(u){f=o._getSheetLayout(),n.save(),n.strokeStyle="black",n.lineWidth=1,n.beginPath();if(u.action==="sizeRow")for(r=f.x;r<f.x+f.width;r+=2)i
=Math.max(0,u.startY-.5),n.moveTo(r,i),n.lineTo(r+1,i),n.moveTo(r,u.movingY-.5),n.lineTo(r+1,u.movingY-.5);else for(i=f.y;i<f.y+f.height;i+=2)r=Math.max(0,u.startX-.5),n.moveTo(r,i),n.lineTo(r,i+1),n.moveTo(u.movingX-.5,i),n.lineTo(u.movingX-.5,i+1);n.stroke(),n.restore()}},r.prototype.paintColHeaderCorner=function(n,i){var f=this._sheet,r,e,u;n.beginPath(),r=f._getSheetLayout().headerCornerRect(),e=f.getActualStyle(-1,-1,t.SheetArea.corner),this.paintCell(n,null,-1,-1,r.x,r.y,r.width,r.height,e,t.SheetArea.corner),u=new t._GcBorders(f,0,0,t.SheetArea.corner),u.addCellLines(0,0,r.x,r.y,r.width,r.height),u.paint(n,i)},r.prototype.paintFrozenLine=function(n){var r=this._sheet,i;(r.frozenRowCount||r.frozenColCount||r._frozenTrailingRowCount||r._frozenTrailingColCount)&&(i=r._getSheetLayout(),n.save(),n.strokeStyle=new t._ThemeContext(r).getColor(r._frozenlineColor),n.lineWidth=1,n.beginPath(),r.frozenColCount&&(n.moveTo(i.viewportX-.5,i.y),n.lineTo(i.viewportX-.5,i.y
+i.height)),r.frozenRowCount&&(n.moveTo(i.x,i.viewportY-.5),n.lineTo(i.x+i.width,i.viewportY-.5)),r._frozenTrailingColCount&&(n.moveTo(i.frozenTrailingX-.5,i.y),n.lineTo(i.frozenTrailingX-.5,i.y+i.height)),r._frozenTrailingRowCount&&(n.moveTo(i.x,i.frozenTrailingY-.5),n.lineTo(i.x+i.width,i.frozenTrailingY-.5)),n.stroke(),n.restore())},r.prototype.paintColHeader=function(n,i,r){this.paintViewportImp(n,-1,i,t.SheetArea.colHeader,r)},r.prototype.paintRowHeader=function(n,i,r){this.paintViewportImp(n,i,-1,t.SheetArea.rowHeader,r)},r.prototype.paintViewport=function(n,i,r,u){this.paintViewportImp(n,i,r,t.SheetArea.viewport,u)},r.prototype.paintSelection=function(n,i,r,u){var e=this._sheet,o=null,c,h,l,v,s;for(n.save(),u&&(n.rect(u.x,u.y,u.width,u.height),n.clip(),n.beginPath()),c=0;c<e._selectionModel.length;c++)h=e._selectionModel[c],l=e._spanModel.find(h.row,h.col),l&&l.containsRange(h)&&(h=l),o=e._getRangeRect(i,r,h),o&&o.wid
th>0&&o.height>0&&(n.fillStyle=new t._ThemeContext(e).getColor(e.selectionBackColor()),n.fillRect(o.x,o.y,o.width,o.height));var f=e.getCellRect(e._activeRowIndex,e._activeColIndex,i,r),y=e._getSheetLayout(),a=y.viewportRect(i,r);a.intersectRect(f)&&(f.x=Math.max(f.x,a.x),f.y=Math.max(f.y,a.y)),f&&f.x!==null&&f.x!==undefined&&f.y!==null&&f.y!==undefined&&f.width!==null&&f.width!==undefined&&f.height!==null&&f.height!==undefined||(f=null),u&&f&&f.intersectRect(u)&&(this._copyDoubleBuffer(f.x+1,f.y+1,f.width-2,f.height-2,f.x+1,f.y+1,null,null,n),e._selectionModel.length>1&&(n.strokeStyle="black",n.lineWidth=1,n.strokeRect(f.x+1.5,f.y+1.5,f.width-4,f.height-4))),e._selectionModel.length===1&&(e._eventHandler.isDraggingFill&&e._eventHandler.isDragClear()&&!e._eventHandler._isDragAroundIndicator&&(v=e._eventHandler.getC
urrentFillRange(),s=e._getRangeRect(i,r,v),s&&s.width>0&&s.height>0&&(n.fillStyle="rgba(110,110,110, 0.5)",n.fillRect(s.x,s.y,s.width,s.height))),this.paintSelectionBorder(n,i,r,o,u)),n.beginPath(),n.restore()},r.prototype.paintSelectionBorder=function(n,i,r,u,f){var e=this._sheet;if(u.width>=0&&u.height>=0&&(!f||u.intersect(f.x-1,f.y-1,f.width+2,f.height+2))){n.save(),f&&(n.rect(f.x,f.y,f.width,f.height),n.clip()),n.beginPath(),n.strokeStyle=new t._ThemeContext(e).getColor(e.selectionBorderColor()),n.lineWidth=2;if(u.width>0&&u.height>0){if(e._eventHandler.isDraggingFill)switch(e._eventHandler._currentFillDirection){case t.DragFillDirection.Up:n.moveTo(u.x+.5,u.y-.5),n.lineTo(u.x+u.width-1,u.y-.5);break;case t.DragFillDirection.Down:n.moveTo(u.x+.5,u.y+u.height-.5),n.lineTo(u.x+u.width-1,u.y+u.height-.5);break;case t.DragFillDirection.Left:n.moveTo(u.x-.5,u.y+.5),n.lineTo(u.x-.5,u.y+u.height-1);brea
k;case t.DragFillDirection.Right:n.moveTo(u.x+u.width-.5,u.y+.5),n.lineTo(u.x+u.width-.5,u.y+u.height-1);break;case t.DragFillDirection.UpClear:case t.DragFillDirection.LeftClear:break;default:break}else n.rect(u.x-.5,u.y-.5,u.width,u.height);n.stroke(),e.canUserDragFill()&&this.paintDragFillIndicator(n,i,r,u,f)}else(u.width===0||u.height===0)&&n.strokeRect(u.x-1,u.y-1,u.width+1,u.height+1);n.beginPath(),n.restore()}},r.prototype.getDragFillIndicatorRect=function(n){var f=this._sheet,r=f._getActiveSelectedRange(),u=f._getSheetLayout(),i=new t.Rect(-4,-4,4,4);return r.col===-1?(i.x=u.frozenX,i.y=n.y+n.height-.5-2):r.row===-1?(i.x=n.x+n.width-.5-2,i.y=u.frozenY):(i.x=n.x+n.width-.5-2,i.y=n.y+n.height-.5-2),i},r.prototype.paintDragFillIndicator=function(n,i,r,u,f){var s=this._sheet,c=s._getSheetLayout(),e=this.getDragFillIndicatorRect(u),h=c.viewportRect(i,r),o;(!f||e.intersectRect(f))&&e.intersectRect(h)&&(o=new t.Rect(e.x-1.5,e.y-1.5,e.width+2,e.height
+2),o.x=Math.max(o.x,h.x),o.y=Math.max(o.y,h.y),this._copyDoubleBufferRect(o,null,null,null,null,n),n.save(),f&&(n.rect(f.x,f.y,f.width,f.height),n.clip()),n.beginPath(),n.fillStyle=new t._ThemeContext(s).getColor(s.selectionBorderColor()),n.fillRect(e.x,e.y,e.width,e.height),s._dragFillIndicatorRect=new t.Rect(e.x,e.y,4,4),n.beginPath(),n.restore())},r.prototype.paintViewportImp=function(n,i,r,u,f){var ot,wt,rt,gt,kt,lt,ct,d,ft,ut,at,dt,p,c;n.save(),f&&(n.rect(f.x,f.y,f.width,f.height),n.clip()),n.beginPath();var s=this._sheet,k=s._getRowLayout(i,u),a=s._getColumnLayout(r,u),ti=s._getCellLayout(i,r,u),vt=t.util._useDoubleBuffer(),b=new t.Rect;vt&&k&&k.length>0&&a&&a.length>0&&(b.x=a[0].x,b.y=k[0].y,b.width=a[a.length-1].x+a[a.length-1].width-b.x,b.height=k[k.length-1].y+k[k.length-1].height-b.y,n.beginPath(),n.fillStyle=this._getSpreadBackColor(),n.fillRect(b.x,b.y,b.width,b.height));var nt=null,g=null,e=null,h,o,w=0,y=0
,v=0,l=0,et,it,ht=k.length,pt=a.length,ni=new t._GcBorders(s,i,r,u),yt=[],st=[],tt,bt;t.features.filter_ui&&(tt=new t._FilterButtonInfoModel,bt=s._getFilterButtonModel()),ot=new t._CellOverflowValueLayoutModel,wt=[];if(ht>0&&pt>0){rt=s._getModel(u),gt=s.getDefaultStyle(u);if(rt){for(kt=[],d=0;d<pt;d++)kt.push(rt.getStyle(-1,a[d].col));for(lt=[],c=0;c<ht;c++)lt.push(rt.getStyle(k[c].row,-1))}for(c=0;c<ht;c++)for(nt=k[c],ct=this._buildCellOverflowLayoutModel(nt.row,u),d=0;d<pt;d++){g=a[d];if(f&&!g.intersect(f))continue;e=ti.findCell(nt.row,g.col),e?(h=e.row,o=e.col,w=e.x,y=e.y,v=e.width,l=e.height):(h=nt.row,o=g.col,w=g.x,y=nt.y,v=g.width,l=nt.height),h<0||o<0||(et=s.getValue(h,o,u),it=!rt||lt[c]||kt[d]||rt.getStyle(h,o)||s.findTable(h,o)?s.getActualStyle(h,o,u):s.getActualStyleCore(h,o,u,!1,gt.clone())),ft=null,s._allowCellOverflow&&ct&&(ft=ct.find(o)),bt&&g.width>0&&nt.height>0&&(ut=bt.find
(h,o,u),tt&&ut&&tt.push(new t._FilterButtonInfo(ut.rowFilter,ut.row,ut.col,ut.sheetArea,w,y,v,l))),u===t.SheetArea.viewport&&s.parent&&s.parent.highlightInvalidData()&&!s.isValid(h,o,et)&&wt.push({x:w,y:y,width:v,height:l}),u===t.SheetArea.viewport&&e&&yt.contains(e)&&(e.row!==nt.row||e.col!==g.col)||(e&&yt.contains(e)||(at=it,this._isCellHidden(h,o,u)&&(at={_backColor:it.backColor}),ni.addCellLines(h,o,w,y,v,l,at,e,ft)),v>0&&l>0&&!e&&(vt||(n.fillStyle=this._getDefaultBackground(),n.fillRect(w,y,v,l)),this.paintCell(n,et,h,o,w,y,v,l,it,u,ft)),e&&(yt.push(e),st.push({row:h,col:o,x:w,y:y,width:v,height:l,data:et,style:it,cellOverflowLayout:ft})),s._allowCellOverflow&&l>0&&this._buildCellOverflowValueLayoutModel(n,et,h,o,w,y,v,l,u,ft,ot,a))}if(st.length>0)for(dt=st.length,c=0;c<dt;c++)p=st[c],vt||(n.fillStyle=this._getDefaultBackground()
,n.fillRect(w,y,v,l)),this.paintCell(n,p.data,p.row,p.col,p.x,p.y,p.width,p.height,p.style,u,p.cellOverflowLayout);ot.length>0&&this._paintCellOverflowValue(n,ot),tt&&tt.length>0&&this._paintFilterButton(n,tt)}ni.paint(n,f),this._paintValidationUI(n,wt),n.restore()},r.prototype._isHiddenByGroup=function(n,t){return!n||n._isEmpty()?!1:n.isCollapsed(t)},r.prototype._isCellHiddenByGroup=function(n,i,r){var u=this._sheet;if(r===undefined||r===null||r===t.SheetArea.viewport)return this._isHiddenByGroup(u.rowRangeGroup,n)||this._isHiddenByGroup(u.colRangeGroup,i);else if(r===t.SheetArea.colHeader)return this._isHiddenByGroup(u.colRangeGroup,i);else if(r===t.SheetArea.rowHeader)return this._isHiddenByGroup(u.rowRangeGroup,n)},r.prototype._isRowHiddenByFilter=function(n){var t=this._sheet;if(t.rowFilter())return!t.rowFilter().isRowFilteredOut(n)},r.prototype._isCellHidden=function(n,t,i){var r=this._sheet;return!r.getRowVisible(n,i)||!r.getColumnVisible(t,i)?!1
:this._isCellHiddenByGroup(n,t,i)},r.prototype._getFilterButtonRect=function(n){var i=this._sheet,e=i._zoomFactor>1?1:i._zoomFactor,t=parseInt((Math.min(20,i.defaults.rowHeight)*e).toString(),10),r=t,f=n.x+n.width-t,u=n.y+n.height-r;return{x:f,y:u,width:t,height:r}},r.prototype._paintFilterButton=function(n,i){var u=this._sheet,v,o,a,f;for(n.save(),n.lineWidth=1,n.fillStyle="#FFFFFF",n.strokeStyle="#CCCCCC",v=this._getCtx(),o=0;o<i.length;o++){var r=i[o],e=this._getFilterButtonRect(new t.Rect(r.x,r.y,r.width,r.height)),c=e.width,l=e.height,s=e.x,h=e.y;n.save(),n.rect(r.x,r.y,r.width,r.height),n.clip(),n.beginPath(),n.fillRect(s+1,h+1,c-3,l-3),n.strokeRect(s+1-.5,h+2-.5,c-3,l-4),a=r.getState(),f=t._GcFilterDialog.getImageSrc(a),u.imageLoader||(u.imageLoader=new t._GcImageLoader(function(){u.repaint()}));try{u.imageLoader.getState(f)?n.drawImage(u.imageLoader.getImage(f),s,h+1,c-3,l-3):u.imageLoader.addImage(f)}catch(y){}n.beginPath(),n.restore()}n.restore()}
,r.prototype._paintValidationUI=function(n,t){var p,s;if(t)for(p=t.length,s=0;s<p;s++){var h=t[s],r=h.x-4,f=h.y-4,v=h.width+8,a=h.height+8,y=.5522848,e=v/2*y,o=a/2*y,l=r+v,c=f+a,u=r+v/2,i=f+a/2;n.save(),n.lineWidth=2,n.strokeStyle="red",n.beginPath(),n.moveTo(r,i),n.bezierCurveTo(r,i-o,u-e,f,u,f),n.bezierCurveTo(u+e,f,l,i-o,l,i),n.bezierCurveTo(l,i+o,u+e,c,u,c),n.bezierCurveTo(u-e,c,r,i+o,r,i),n.closePath(),n.stroke(),n.restore()}},r.prototype.paintCell=function(i,r,u,f,e,o,s,h,c,l,a){var v=this._sheet,it=this.getVisualState(u,f,l),p="",b,g,nt,d,w,tt,y,k;c.font?(c.font=this._getZoomFont(c.font),p=c.font):(c.font=this._getZoomFont(this._getDefaultFont(l)),p=c.font);if(!c.wordWrap&&c.shrinkToFit){b=v.getText(u,f,l);if(b&&b!=="")for(g={value:!1},nt=0;nt<3&&g.value===!1;nt++){d=v._getStringWidth(b,p),w=Math.max(0,s-4),c.hAlign!==t.HorizontalAlign.center&&c.textIndent&&(w=Math.max(0,w-c.textIndent*8));if(w<d)p
=t.StyleHelper._scaleFont(p,w/d,g),c.font=p;else{c.font=p;break}}}s>0&&h>0&&(tt=v.getCellTypeCore(c,l),e--,o--,s++,h++,y={visualState:it,cellOverflowLayout:a,useWijmoTheme:v.parent&&v.parent.useWijmoTheme,sparkline:null,lineHeight:null,imageLoader:null,sheet:null,row:null,col:null},l===t.SheetArea.viewport&&(k=v.getSparkline(u,f),k&&(y.sparkline=k)),c.wordWrap&&(y.lineHeight=v._getFontHeight(p)),v.imageLoader||(v.imageLoader=new n.spread._GcImageLoader(function(){v.repaint()})),y.imageLoader=v.imageLoader,y.sheet=this._sheet,y.row=u,y.col=f,tt.paint(i,r,e,o,s,h,c,y))},r.prototype.getVisualState=function(n,i,r){var f=this._sheet,e=f._getModel(r),u=null;return e&&(u=e.getVisualState(n,i)),(u===undefined||u===null)&&(u=t.VisualState.Normal),r===undefined||r===null||r===t.SheetArea.viewport?!f.isEditing()&&f._isActiveCell(n,i)?u=t.VisualState.Active:f._isSelected(n,i,r)&&(u=t.VisualState.Selected):(f._
isSelected(n,i,r)&&(u=t.VisualState.Highlight,f._isAllSelected(n,i,r)&&(u=t.VisualState.Selected)),f._isHover(n,i,r)&&(u=t.VisualState.Hover)),u},r.prototype.paintLine=function(n,t,i,r,u,f){n.lineWidth=t.width(),n.strokeStyle=t.color,n.moveTo(i,r),n.lineTo(u,f)},r.prototype.paintGroup=function(n,i){var u=this._sheet,f=u._getGroupLayout(),r;if(f.width>0||f.height>0){for(n.save(),this.paintGroupHeader(n),this._rowGroups=[new t._RangeGroupPresenter(u,!0,0),new t._RangeGroupPresenter(u,!0,1),new t._RangeGroupPresenter(u,!0,2)],r=0;r<=2;r++)this._rowGroups[r].createGroupInfo(),this._rowGroups[r].paintGroups(n);for(this._columnGroups=[new t._RangeGroupPresenter(u,!1,0),new t._RangeGroupPresenter(u,!1,1),new t._RangeGroupPresenter(u,!1,2)],r=0;r<=2;r++)this._columnGroups[r].createGroupInfo(),this._columnGroups[r].paintGroups(n);n.beginPath(),n.restore()}},r.prototype.paintGroupHeader=function(n){var r=this._sheet,u=new t._RangeGroupHeaderPresenter(r,!1),
i;u.paintGroupHeader(n),i=new t._RangeGroupHeaderPresenter(r,!0),i.paintGroupHeader(n)},r.prototype.groupHitTest=function(n,i){var r,o,s,l,f,c,h;if(!t.features.group)return null;r=this._sheet,o=r._getGroupLayout();if(!o)return null;s=new t.Rect(o.x,o.y,o.width,r._bounds.height);if(!s.contains(n,i)){s=new t.Rect(o.x,o.y,r._bounds.width,o.height);if(!s.contains(n,i))return null}var e={what:"empty",info:null},a=new t._RangeGroupHeaderPresenter(r,!0),u=a.getGroupButton(n,i);u&&(e={what:"rgh",info:u}),e.what==="empty"&&(l=new t._RangeGroupHeaderPresenter(r,!1),u=l.getGroupButton(n,i),u&&(e={what:"cgh",info:u}));if(e.what==="empty")for(c=[new t._RangeGroupPresenter(r,!0,0),new t._RangeGroupPresenter(r,!0,1),new t._RangeGroupPresenter(r,!0,2)],f=0;f<=2;f++){c[f].createGroupInfo(),u=c[f].getRowGroupButton(n,i);if(u){e={what:"rg",info:u};break}}if(e.what==="empty")for(h=[new t._RangeGroupPresente
r(r,!1,0),new t._RangeGroupPresenter(r,!1,1),new t._RangeGroupPresenter(r,!1,2)],f=0;f<=2;f++){h[f].createGroupInfo(),u=h[f].getColGroupButton(n,i);if(u){e={what:"cg",info:u};break}}return e},r.prototype._paintCellOverflowValue=function(n,t){for(var i,r=0;r<t.length;r++)i=t[r],this.paintCellOverflowValue(n,i.data,i.row,i.col,i.x,i.y,i.width,i.height,i.sheetArea,i.cellOverflowLayout)},r.prototype._buildCellOverflowValueLayoutModel=function(n,i,r,u,f,e,o,s,h,c,l,a){var p=this._sheet,w,b,nt,y,v,it=isNaN(p.frozenColCount)?0:p.frozenColCount,d=isNaN(p._frozenTrailingColCount)?0:p._frozenTrailingColCount,k=p.getColumnCount(),g,tt;if(c&&l){g=!1,tt=!1,u<it&&(g=!0),u<k-d&&(tt=!0);if(c.column===u)w=f,b=w,c.hAlign===t.HorizontalAlign.right?b=f+o-c.columnWidth:c.hAlign===t.HorizontalAlign.center&&(b=f+o/2-c.columnPrevWidth),c.layout={x:b,y:e,width:c.columnWidth,height:s},nt=new t._CellOverflowValueLayout(i,r,c.column,w,e,o,s,h,c),l.add(nt);e
lse if(!g&&c.column<p._scrollLeftCol||!tt&&c.column<k-d){w=a[0].x,v=0;if(!tt&&c.column<k-d)for(y=k-d-1;y>=c.column;y--)v=p._getZoomColumnWidth(y,h),w-=v;else for(y=p._scrollLeftCol-1;y>=c.column;y--)v=p._getZoomColumnWidth(y,h),w-=v;b=w,c.hAlign===t.HorizontalAlign.right?b=w+v-c.columnWidth:c.hAlign===t.HorizontalAlign.center&&(b=w+v/2-c.columnPrevWidth),c.layout={x:b,y:e,width:c.columnWidth,height:s},i=p.getValue(r,c.column,h),nt=new t._CellOverflowValueLayout(i,r,c.column,w,e,v,s,h,c),l.add(nt)}else if(!g&&c.column<k-d&&c.column>p._getPageRightColumn()||g&&c.column>=it||tt&&c.column>=k-d){w=a[a.length-1].x+a[a.length-1].width,v=0;if(tt&&c.column>=k-d){for(y=k-d;y<c.column;y++)v=p._getZoomColumnWidth(y,h),w+=v;v=p._getZoomColumnWidth(c.column,h)}else if(g){for(y=it;y<c.column;y++)v=p._getZoomColumnWidth(y,h),w+=v;v=p._getZoomColumnWidth(c.column,h)}else{for(y=p._getPageRightC
olumn()+1;y<c.column;y++)v=p._getZoomColumnWidth(y,h),w+=v;v=p._getZoomColumnWidth(c.column,h)}b=w,c.hAlign===t.HorizontalAlign.right?b=w+v-c.columnWidth:c.hAlign===t.HorizontalAlign.center&&(b=w+v/2-c.columnPrevWidth),c.layout={x:b,y:e,width:c.columnWidth,height:s},i=p.getValue(r,c.column,h),nt=new t._CellOverflowValueLayout(i,r,c.column,w,e,v,s,h,c),l.add(nt)}}},r.prototype._buildCellOverflowLayoutModel=function(n,i){var u,e,r,c,h,o,s,f;if(i!==undefined&&i!==null&&i!==t.SheetArea.viewport)return null;u=this._sheet;if(!u._allowCellOverflow)return null;if(u.maxCellOverflowDistance===1)return null;e=null;if(u._cellOverflowModelCache){e=u._cellOverflowModelCache[n];if(e)return e}else u._cellOverflowModelCache={};for(e=new t._CellOverflowLayoutModel,r=0;r<u.getColumnCount(i);r++){c=u.getColumnVisible(r,i),h=u.getColumnWidth(r,i);if(c===!1||h<=0)continue;o=u.getActualStyle(n,r,t.SheetArea.viewport);if(o&&(o.shrinkToFit||o.wordWrap))continue;s=t.u
til.getHAlignByValueType(o.hAlign,u.getValue(n,r)),s===undefined||s===null||s===t.HorizontalAlign.left?(f=this._buildCellOverflowLayoutModelForLeft(n,r,i,o),f&&(e.push(f),r=f.endCol)):s===t.HorizontalAlign.right?(f=this._buildCellOverflowLayoutModelForRight(n,r,i,o),f&&(e.push(f),r=f.endCol)):s===t.HorizontalAlign.center&&(f=this._buildCellOverflowLayoutModelForCenter(n,r,i,o),f&&(e.push(f),r=f.endCol))}return u._cellOverflowModelCache[n]=e,e},r.prototype._buildCellOverflowLayoutModelForLeft=function(n,i,r,u){var f=this._sheet,l=f.getText(n,i,r),h,s,c,e,a,y;if(!l||l===""||f._spanModel.find(n,i)!==null)return null;if(f.getValue(n,i+1,r)!==null||f._spanModel.find(n,i+1)!==null)return null;var o=f._getZoomColumnWidth(i,r),p=!u||!u.font?this._getZoomFont(this._getDefaultFont(r)):this._getZoomFont(u.font),v=f._getStringWidth(l,p)+(u.textIndent?u.textIndent*8:0);if(v<=o)return null;for(h=i,s=f.getColumnCount(r),f.maxCellOverflowDistance&&am
p;(c=parseInt(f.maxCellOverflowDistance,10)+i,c<s&&(s=c)),e=i+1;e<s;e++){a=f.getValue(n,e,r),y=f._spanModel.find(n,e);if(a!==undefined&&a!==null||y||v<o)break;o+=f._getZoomColumnWidth(e,r),h=e}return h===i?null:new t._CellOverflowLayout(i,i,h,v,o-1,t.HorizontalAlign.left,null)},r.prototype._buildCellOverflowLayoutModelForRight=function(n,i,r,u){var f=this._sheet,l=f.getText(n,i,r),h,s,c,e,a,y;if(!l||l===""||f._spanModel.find(n,i)!==null)return null;if(f.getValue(n,i-1,r)!==null||f._spanModel.find(n,i-1)!==null)return null;var o=f._getZoomColumnWidth(i,r),p=!u||!u.font?this._getZoomFont(this._getDefaultFont(r)):this._getZoomFont(u.font),v=f._getStringWidth(l,p);if(v<=o)return null;for(h=i,s=-1,f.maxCellOverflowDistance&&(c=i-parseInt(f.maxCellOverflowDistance,10),c>s&&(s=c)),e=i-1;e>s;e--){a=f.getValue(n,e,r),y=f._spanModel.find(n,e);if(a!==undefined&&a!==null||y||v<o)break;o+=f._getZoomColumnWidth(e,r),h=e}return
h===i?null:new t._CellOverflowLayout(i,h,i,v,o-1,t.HorizontalAlign.right,null)},r.prototype._buildCellOverflowLayoutModelForCenter=function(n,i,r,u){var f=this._sheet,w=f.getText(n,i,r),b,e,s,c,l,h,p;if(!w||w===""||f._spanModel.find(n,i)!==null)return null;var y=f._getZoomColumnWidth(i,r),g=!u||!u.font?this._getZoomFont(this._getDefaultFont(r)):this._getZoomFont(u.font),v=f._getStringWidth(w,g);if(v<=y)return null;var a=y/2,k=i,d=0,o=-1;for(f.maxCellOverflowDistance&&(d=parseInt((parseInt(f.maxCellOverflowDistance,10)/2+.5).toString(),10),b=i-d,b>o&&(o=b)),e=i-1;e>o;e--){s=f.getValue(n,e,r),c=f._spanModel.find(n,e);if(s!==undefined&&s!==null||c||v/2<a)break;a+=f._getZoomColumnWidth(e,r),k=e}for(l=y/2,h=i,o=f.getColumnCount(r),f.maxCellOverflowDistance&&(p=parseInt(f.maxCellOverflowDistance,10)-d+1+i,p<o&&(o=p)),e=i+1;e<o;e++){s=f.getValue(n,e,r),c=f._spanModel.find(n,e);if(s!==undefined&&s!==null||c||v/2<
;l)break;l+=f._getZoomColumnWidth(e,r),h=e}return k===h?null:new t._CellOverflowLayout(i,k,h,v,a+l-1,t.HorizontalAlign.center,a)},r.prototype.paintCellOverflowValue=function(n,t,i,r,u,f,e,o,s,h){var c=this._sheet,l=c.getActualStyle(i,r,s),v,y,a;l.font=l.font?this._getZoomFont(l.font):this._getZoomFont(this._getDefaultFont(s)),v=this.getVisualState(i,r,s),y={visualState:v,cellOverflowLayout:h,useWijmoTheme:c.parent&&c.parent.useWijmoTheme,sheet:c,row:i,col:r},e>0&&o>0&&(a=c.getCellType(i,r,s),c.isEditing()&&i===c._activeRowIndex&&r===c._activeColIndex||(u--,f--,e++,o++,a.paintValue&&a.paintValue(n,t,u,f,e,o,l,y)))},r}();t._SheetRender=r})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(n){var g,nt;n.feature("core.sheet_ui",["core.common"]);var v="backColor",y="foreColor",l="hAlign",a="vAlign",p="themeFont",k="fo
nt",d="formatter",w="borderLeft",b="borderTop",c="borderRight",r="borderBottom",u="locked",t="textIndent",i="wordWrap",f="shrinkToFit",s="backgroundImage",h="backgroundImageLayout",e="validator",o="cellType",it="bindingPath",tt=function(){function g(t,i,r,u){this.sheet=t,this.row=i,this.row2=i,this.col=r,this.col2=r,(u===undefined||u===null)&&(u=n.SheetArea.viewport),this.sheetArea=u}return g.prototype.value=function(n){var i,t;if(arguments.length===0)return this.sheet.getValue(this.row,this.col,this.sheetArea);else{for(i=this.row;i<=this.row2;i++)for(t=this.col;t<=this.col2;t++)this._isValidIndex(i,t)&&this.sheet.setValue(i,t,n,this.sheetArea);return this}},g.prototype.text=function(n){var i,t;if(arguments.length===0)return this.sheet.getText(this.row,this.col,this.sheetArea);else{for(i=this.row;i<=this.row2;i++)fo
r(t=this.col;t<=this.col2;t++)this._isValidIndex(i,t)&&this.sheet.setText(i,t,n,this.sheetArea);return this}},g.prototype.formula=function(n){var i,t;if(arguments.length===0)return this.sheet.getFormula(this.row,this.col,this.sheetArea);else{for(i=this.row;i<=this.row2;i++)for(t=this.col;t<=this.col2;t++)this._isValidIndex(i,t)&&this.sheet.setFormula(i,t,n,this.sheetArea);return this}},g.prototype.bindingPath=function(n){var i,t;if(arguments.length===0)return this.sheet.getBindingPath(this.row,this.col,this.sheetArea);else{for(i=this.row;i<=this.row2;i++)for(t=this.col;t<=this.col2;t++)this._isValidIndex(i,t)&&this.sheet.setBindingPath(i,t,n,this.sheetArea);return this}},g.prototype.dataValidator=function(n){return arguments.length==0?this._getStyleProperty(e):this._setStyleProperty(e,n)},g.prototype.cellType=function(n){return arguments.length==0?this._getStyleProperty(o):this._setStyleProperty(o,n)},g.prototype.backgroundImage=function(n){ret
urn arguments.length==0?this._getStyleProperty(s):this._setStyleProperty(s,n)},g.prototype.backgroundImageLayout=function(n){return arguments.length==0?this._getStyleProperty(h):this._setStyleProperty(h,n)},g.prototype.backColor=function(n){return arguments.length===0?this._getStyleProperty(v):this._setStyleProperty(v,n)},g.prototype.foreColor=function(n){return arguments.length===0?this._getStyleProperty(y):this._setStyleProperty(y,n)},g.prototype.hAlign=function(n){return arguments.length===0?this._getStyleProperty(l):this._setStyleProperty(l,n)},g.prototype.vAlign=function(n){return arguments.length===0?this._getStyleProperty(a):this._setStyleProperty(a,n)},g.prototype.themeFont=function(n){return arguments.length===0?this._getStyleProperty(p):this._setStyleProperty(p,n)},g.prototype.font=function(n){return arguments.length===0?this._getStyleProperty(k):this._setStyleProperty(k,n)},g.prototype.formatter=function(n){return arguments.length===0?this._getStyleProperty(d):this._setSt
yleProperty(d,n)},g.prototype.borderLeft=function(n){return arguments.length===0?this._getStyleProperty(w):this._setStyleProperty(w,n)},g.prototype.borderTop=function(n){return arguments.length===0?this._getStyleProperty(b):this._setStyleProperty(b,n)},g.prototype.borderRight=function(n){return arguments.length===0?this._getStyleProperty(c):this._setStyleProperty(c,n)},g.prototype.borderBottom=function(n){return arguments.length===0?this._getStyleProperty(r):this._setStyleProperty(r,n)},g.prototype.locked=function(n){return arguments.length===0?this._getStyleProperty(u):this._setStyleProperty(u,n)},g.prototype.textIndent=function(n){return arguments.length===0?this._getStyleProperty(t):this._setStyleProperty(t,n)},g.prototype.wordWrap=function(n){return arguments.length===0?this._getStyleProperty(i):this._setStyleProperty(i,n)},g.prototype.shrinkToFit=function(n){return arguments.length===0?this._getStyleProperty(f):this._setStyleProperty(f,n)},g.prototype.clearStyleProperty=functio
n(n){for(var t,r,i=this.row;i<=this.row2;i++)for(t=this.col;t<=this.col2;t++)this._isValidIndex(i,t)&&(r=this.sheet.getStyle(i,t,this.sheetArea),r&&r.clear(n))},g.prototype._getStyleProperty=function(n){var t=this.sheet.getActualStyle(this.row,this.col,this.sheetArea);return t?t[n]:undefined},g.prototype._setStyleProperty=function(t,i){for(var r,f,u=this.row;u<=this.row2;u++)for(r=this.col;r<=this.col2;r++)this._isValidIndex(u,r)&&(f=this.sheet.getStyle(u,r,this.sheetArea),f||(f=new n.Style),f[t]=i,this.sheet.setStyle(u,r,f,this.sheetArea));return this},g.prototype._isValidIndex=function(n,t){if(this.sheet){var r=this.sheet.getRowCount(this.sheetArea),i=this.sheet.getColumnCount(this.sheetArea);if(0<=n&&n<r&&0<=t&&t<i)return!0}return!1},g}();n.Cell=tt,g=function(){function g(t,i,r){this.sheet=t,this.index=i,this.index2=i,(r===undefined||r===null)&&(r=n.SheetArea.viewport),this.sheetArea=r}return g.protot
ype.height=function(n){if(arguments.length===0)return this.sheet.getRowHeight(this.index,this.sheetArea);else{for(var t=this.index;t<=this.index2;t++)this._isValidIndex(t)&&this.sheet.setRowHeight(t,n,this.sheetArea);return this}},g.prototype.visible=function(n){if(arguments.length===0)return this.sheet.getRowVisible(this.index,this.sheetArea);else{for(var t=this.index;t<=this.index2;t++)this._isValidIndex(t)&&this.sheet.setRowVisible(t,n,this.sheetArea);return this}},g.prototype.resizable=function(n){if(arguments.length===0)return this.sheet.getRowResizable(this.index,this.sheetArea);else{for(var t=this.index;t<=this.index2;t++)this._isValidIndex(t)&&this.sheet.setRowResizable(t,n,this.sheetArea);return this}},g.prototype.dataValidator=function(n){return arguments.length==0?this._getStyleProperty(e):this._setStyleProperty(e,n)},g.prototype.cellType=function(n){return arguments.length==0?this._getStyleProperty(o):this._setStyleProperty(o,n)},g.protot
ype.backgroundImage=function(n){return arguments.length==0?this._getStyleProperty(s):this._setStyleProperty(s,n)},g.prototype.backgroundImageLayout=function(n){return arguments.length==0?this._getStyleProperty(h):this._setStyleProperty(h,n)},g.prototype.backColor=function(n){return arguments.length===0?this._getStyleProperty(v):this._setStyleProperty(v,n)},g.prototype.foreColor=function(n){return arguments.length===0?this._getStyleProperty(y):this._setStyleProperty(y,n)},g.prototype.hAlign=function(n){return arguments.length===0?this._getStyleProperty(l):this._setStyleProperty(l,n)},g.prototype.vAlign=function(n){return arguments.length===0?this._getStyleProperty(a):this._setStyleProperty(a,n)},g.prototype.themeFont=function(n){return arguments.length===0?this._getStyleProperty(p):this._setStyleProperty(p,n)},g.prototype.font=function(n){return arguments.length===0?this._getStyleProperty(k):this._setStyleProperty(k,n)},g.prototype.formatter=function(n){return arguments.length===0?th
is._getStyleProperty(d):this._setStyleProperty(d,n)},g.prototype.borderLeft=function(n){return arguments.length===0?this._getStyleProperty(w):this._setStyleProperty(w,n)},g.prototype.borderTop=function(n){return arguments.length===0?this._getStyleProperty(b):this._setStyleProperty(b,n)},g.prototype.borderRight=function(n){return arguments.length===0?this._getStyleProperty(c):this._setStyleProperty(c,n)},g.prototype.borderBottom=function(n){return arguments.length===0?this._getStyleProperty(r):this._setStyleProperty(r,n)},g.prototype.locked=function(n){return arguments.length===0?this._getStyleProperty(u):this._setStyleProperty(u,n)},g.prototype.textIndent=function(n){return arguments.length===0?this._getStyleProperty(t):this._setStyleProperty(t,n)},g.prototype.wordWrap=function(n){return arguments.length===0?this._getStyleProperty(i):this._setStyleProperty(i,n)},g.prototype.shrinkToFit=function(n){return arguments.length===0?this._getStyleProperty(f):this._setStyleProperty(f,n)},g.p
rototype.clearStyleProperty=function(t){for(var r,i=this.index;i<=this.index2;i++)this._isValidIndex(i)&&(r=this.sheet.getStyle(i,-1,this.sheetArea),r&&(r.clear(t),this.sheet._trigger(n.Events.RowChanged,{sheet:this.sheet,sheetName:this.sheet._name,row:i,sheetArea:this.sheetArea,propertyName:t})))},g.prototype._getStyleProperty=function(n){var t=this.sheet.getStyle(this.index,-1,this.sheetArea);return t?t[n]:undefined},g.prototype._setStyleProperty=function(t,i){for(var u,r=this.index;r<=this.index2;r++)this._isValidIndex(r)&&(u=this.sheet.getStyle(r,-1,this.sheetArea),u||(u=new n.Style),u[t]=i,this.sheet.setStyle(r,-1,u,this.sheetArea));return this},g.prototype._isValidIndex=function(n){if(this.sheet){var t=this.sheet.getRowCount(this.sheetArea);if(0<=n&&n<t)return!0}return!1},g}(),n.Row=g,nt=function(){function g(t,i,r){this.sheet=t,this.index=i,this.index2=i,(r===undefined||r===null)&&(r=n.SheetArea.viewport),this.sheetArea=r}re
turn g.prototype.width=function(n){if(arguments.length===0)return this.sheet.getColumnWidth(this.index,this.sheetArea);else{for(var t=this.index;t<=this.index2;t++)this._isValidIndex(t)&&this.sheet.setColumnWidth(t,n,this.sheetArea);return this}},g.prototype.visible=function(n){if(arguments.length===0)return this.sheet.getColumnVisible(this.index,this.sheetArea);else{for(var t=this.index;t<=this.index2;t++)this._isValidIndex(t)&&this.sheet.setColumnVisible(t,n,this.sheetArea);return this}},g.prototype.resizable=function(n){if(arguments.length===0)return this.sheet.getColumnResizable(this.index,this.sheetArea);else{for(var t=this.index;t<=this.index2;t++)this._isValidIndex(t)&&this.sheet.setColumnResizable(t,n,this.sheetArea);return this}},g.prototype.dataValidator=function(n){return arguments.length==0?this._getStyleProperty(e):this._setStyleProperty(e,n)},g.prototype.cellType=function(n){return arguments.length==0?this._getStyleProperty(o):this._set
StyleProperty(o,n)},g.prototype.backgroundImage=function(n){return arguments.length==0?this._getStyleProperty(s):this._setStyleProperty(s,n)},g.prototype.backgroundImageLayout=function(n){return arguments.length==0?this._getStyleProperty(h):this._setStyleProperty(h,n)},g.prototype.backColor=function(n){return arguments.length===0?this._getStyleProperty(v):this._setStyleProperty(v,n)},g.prototype.foreColor=function(n){return arguments.length===0?this._getStyleProperty(y):this._setStyleProperty(y,n)},g.prototype.hAlign=function(n){return arguments.length===0?this._getStyleProperty(l):this._setStyleProperty(l,n)},g.prototype.vAlign=function(n){return arguments.length===0?this._getStyleProperty(a):this._setStyleProperty(a,n)},g.prototype.themeFont=function(n){return arguments.length===0?this._getStyleProperty(p):this._setStyleProperty(p,n)},g.prototype.font=function(n){return arguments.length===0?this._getStyleProperty(k):this._setStyleProperty(k,n)},g.prototype.formatter=function(n){re
turn arguments.length===0?this._getStyleProperty(d):this._setStyleProperty(d,n)},g.prototype.borderLeft=function(n){return arguments.length===0?this._getStyleProperty(w):this._setStyleProperty(w,n)},g.prototype.borderTop=function(n){return arguments.length===0?this._getStyleProperty(b):this._setStyleProperty(b,n)},g.prototype.borderRight=function(n){return arguments.length===0?this._getStyleProperty(c):this._setStyleProperty(c,n)},g.prototype.borderBottom=function(n){return arguments.length===0?this._getStyleProperty(r):this._setStyleProperty(r,n)},g.prototype.locked=function(n){return arguments.length===0?this._getStyleProperty(u):this._setStyleProperty(u,n)},g.prototype.textIndent=function(n){return arguments.length===0?this._getStyleProperty(t):this._setStyleProperty(t,n)},g.prototype.wordWrap=function(n){return arguments.length===0?this._getStyleProperty(i):this._setStyleProperty(i,n)},g.prototype.shrinkToFit=function(n){return arguments.length===0?this._getStyleProperty(f):this
._setStyleProperty(f,n)},g.prototype.clearStyleProperty=function(t){for(var r,i=this.index;i<=this.index2;i++)this._isValidIndex(i)&&(r=this.sheet.getStyle(-1,i,this.sheetArea),r&&(r.clear(t),this.sheet._trigger(n.Events.ColumnChanged,{sheet:this.sheet,sheetName:this.sheet._name,col:i,sheetArea:this.sheetArea,propertyName:t})))},g.prototype._getStyleProperty=function(n){var t=this.sheet.getStyle(-1,this.index,this.sheetArea);return t?t[n]:undefined},g.prototype._setStyleProperty=function(t,i){for(var u,r=this.index;r<=this.index2;r++)this._isValidIndex(r)&&(u=this.sheet.getStyle(-1,r,this.sheetArea),u||(u=new n.Style),u[t]=i,this.sheet.setStyle(-1,r,u,this.sheetArea));return this},g.prototype._isValidIndex=function(n){if(this.sheet){var t=this.sheet.getColumnCount(this.sheetArea);if(0<=n&&n<t)return!0}return!1},g}(),n.Column=nt})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(t){function e(n,i
,r,u){throw new Error(t._StringResource.Exp_InvalidAndSpace+n+t._StringResource.ColonSpace+i+t._StringResource.MustBeBetween+r+t._StringResource.SpaceAndSpace+u+t._StringResource.RightBracketFullStop);}function st(n,t,i){for(var r in l)l[r]&&(n=n.replace(l[r],l[r].source));return t===!0?(n=n.replace(/~\?/g,ht.source),n=n.replace(/~\*/g,ot.source),n=n.replace(/\?/g,"."),n=i?n.replace(/\*/g,"((.|\\n)+)"):n.replace(/\*/g,"((.|\\n)*)"),n=n.replace(ht,"\\?"),n=n.replace(ot,"\\*")):(n=n.replace(/\?/g,"\\?"),n=n.replace(/\*/g,"\\*")),n}var g;t.feature("core.sheet",["core.common","core.stringResource","core.sheet_event","core.sheet_render","core.basecelltype","core.sheet_ui","core.sheet_model","core.sheet_action","core.sheet_border"]);var i="undefined",f="function",u="number",c="st
ring",o="boolean",h=window.document,et=window.ko,yt=function(){function n(n){var u=t.TextFileOpenFlags.IncludeRowHeader,f=t.TextFileOpenFlags.IncludeColumnHeader,i=t.TextFileOpenFlags.UnFormatted,r=t.TextFileOpenFlags.ImportFormula;this.rowHeader=(n&u)===u,this.columnHeader=(n&f)===f,this.unFormatted=(n&i)===i,this.formula=(n&r)===r,this.expandRows=!0,this.expandColumns=!0}return n.prototype.fixOptions=function(n){if(!n)return;n.getColumnCount(t.SheetArea.rowHeader)>0||(this.rowHeader=!1),n.getRowCount(t.SheetArea.colHeader)>0||(this.columnHeader=!1)},n}();var r=function(){function n(){}return n.copyTo=function(i,r,u,f,e,o,s,h,c){var v,a,l;n.checkArguments(i,r,u,f,e,o,s,h),i.suspendCalcService(),f.suspendCalcService(),v=null,(c&t.CopyToOption.BindingPath)>0&&(v=n.copyBindingPath(i,r,u,f,e,o,s,h));try{if((c&t.CopyToOption.Value)>0){n.copyValue(i,r,u,f,e,o,s,h),(c&t.CopyToOption.Formula)==0&&n.clearFormula(f,e,o,s,
h);if((c&t.CopyToOption.BindingPath)>0){var p=v.length,y=e<0?0:e,w=o<0?0:o;for(a=0;a<p;a++)l=v[a],f.setValue(y+l.row,w+l.col,l.value)}}(c&t.CopyToOption.Formula)>0&&n.copyFormula(i,r,u,f,e,o,s,h)}finally{i.resumeCalcService(),f.resumeCalcService()}(c&t.CopyToOption.Style)>0&&n.copyStyle(i,r,u,f,e,o,s,h),(c&t.CopyToOption.Sparkline)>0&&n.copySparkline(i,r,u,f,e,o,s,h),(c&t.CopyToOption.RangeGroup)>0&&(r<0&&n.copyColumnRangeGroup(i,u,f,o,h),u<0&&n.copyRowRangeGroup(i,r,f,e,s)),(c&t.CopyToOption.Span)>0&&n.copySpan(i,r,u,f,e,o,s,h),r<0&&n.copyColumnAxis(i,u,f,o,h,c),u<0&&n.copyRowAxis(i,r,f,e,s,c),r<0&&e<0&&u<0&&o<0&&n.copySheetInfo(i,f,c),f._raisePropertyChanged("[CopyTo]")},n.checkArguments=function(n,i,r,u,f,o,s,h){var l,v,c,a;if(!n)throw new Error(t._StringResource.Exp_SrcIsNull);if(!u)throw new
Error(t._StringResource.Exp_DestIsNull);(i<-1||i>=n.getRowCount())&&e("from row index",i,"-1",n.getRowCount()-1),(r<-1||r>=n.getColumnCount())&&e("from column index",r,"-1",n.getColumnCount()-1),(f<-1||f>=u.getRowCount())&&e("to row index",f,"-1",u.getRowCount()-1),(o<-1||o>=u.getColumnCount())&&e("to column index",o,"-1",u.getColumnCount()-1),l=r,r<0&&(l=0,h=n.getColumnCount()),v=o<0?0:o,(h<1||l+h>n.getColumnCount()||v+h>u.getColumnCount())&&e("column count",h,"1",Math.min(n.getColumnCount()-l,u.getColumnCount()-v)),c=i,i<0&&(c=0,s=n.getRowCount()),a=f<0?0:f,(s<1||c+s>n.getRowCount()||a+s>u.getRowCount())&&e("row count",s,"1",Math.min(n.getRowCount()-c,u.getRowCount()-a))},n.copyValue=function(i,r,u,f,e,o,s,h){var it=!(i===f&&i._name===f._n
ame),v,y,l,c,a,p,d,ft,tt,w,ut,rt;if(r<0){p=u,d=o,v=Math.min(i.getRowCount(t.SheetArea.colHeader),f.getRowCount(t.SheetArea.colHeader)),y=h,u<0&&(p=0,y=i.getColumnCount()),o<0&&(d=0);if(it)for(l=0;l<v;l++)for(c=0;c<y;c++)a=i.getValue(l,p+c,t.SheetArea.colHeader),(a===undefined||a===null)&&i.isColumnBound(p+c)&&(l===i.colHeaderAutoTextIndex||l===v-1&&i.colHeaderAutoTextIndex===-1)&&(a=i.getDataColumnName(p+c)),a===undefined||a===null?f._setValueInternal(l,d+c,t.SheetArea.colHeader,null,!0):f._setValueInternal(l,d+c,t.SheetArea.colHeader,n.cloneObject(a),!0);else{for(ft=new t._GcSheetModel(v,y,null),l=0;l<v;l++)for(c=0;c<y;c++)a=i._getModel(t.SheetArea.colHeader).getValue(l,p+c),(a===undefined||a===null)&&i.isColumnBound(p+c)&&(l===i.colHeaderAutoTextIndex||l===v-1&&i.colHeaderAutoTextIndex===-1)&&(a=i.getDataColumnName(p+c)),a!==undefined&&a!==null&&ft.setValue(l,c,n.cl
oneObject(a));for(l=0;l<v;l++)for(c=0;c<y;c++)f._setValueInternal(l,d+c,t.SheetArea.colHeader,ft.getValue(l,c),!0)}}if(u<0){tt=r,w=e,v=s,y=Math.min(i.getColumnCount(t.SheetArea.rowHeader),f.getColumnCount(t.SheetArea.rowHeader)),r<0&&(tt=0,v=i.getRowCount()),e<0&&(w=0);if(it)for(l=0;l<v;l++)for(c=0;c<y;c++)a=i.getValue(tt+l,c,t.SheetArea.rowHeader),a===undefined||a===null?f._setValueInternal(w+l,c,t.SheetArea.rowHeader,null,!0):f._setValueInternal(w+l,c,t.SheetArea.rowHeader,n.cloneObject(a),!0);else{for(ut=new t._GcSheetModel(v,y,null),l=0;l<v;l++)for(c=0;c<y;c++)a=i._getModel(t.SheetArea.rowHeader).getValue(tt+l,c),a!==undefined&&a!==null&&ut.setValue(l,c,n.cloneObject(a));for(l=0;l<v;l++)for(c=0;c<y;c++)f._setValueInternal(w+l,c,t.SheetArea.rowHeader,ut.getValue(l,c),!0)}}var ot=r,et=u,nt=e,g=o,b=s,k=h;r<0&&(ot=0,b=Math.min(i.getRowCount(),f.getRowCount())),u<0&&(et=0,k=Math.min(i.getColumnCoun
t(),f.getColumnCount())),e<0&&(nt=0),o<0&&(g=0);if(it)for(l=0;l<b;l++)for(c=0;c<k;c++)a=i.getValue(ot+l,et+c,t.SheetArea.viewport),a===undefined||a===null?f._setValueInternal(nt+l,g+c,t.SheetArea.viewport,null,!0):f._setValueInternal(nt+l,g+c,t.SheetArea.viewport,n.cloneObject(a),!0);else{for(rt=new t._GcSheetModel(b,k,null),l=0;l<b;l++)for(c=0;c<k;c++)a=i.getValue(ot+l,et+c,t.SheetArea.viewport),a!==undefined&&a!==null&&rt.setValue(l,c,n.cloneObject(a));for(l=0;l<b;l++)for(c=0;c<k;c++)f._setValueInternal(nt+l,g+c,t.SheetArea.viewport,rt.getValue(l,c),!0)}},n.copyBindingPath=function(n,i,r,u,f,e,o,s){var y=i,p=r,d=f,k=e,v=o,a=s,w,g,b,l,h,c;i<0&&(y=0,v=Math.min(n.getRowCount(),u.getRowCount())),r<0&&(p=0,a=Math.min(n.getColumnCount(),u.getColumnCount())),f<0&&(d=0),e<0&&(k=0),w=[],g=!(n===u&&n._name===u._name);if(g)for(h=0;h<v;h++)for(c=0;c<a;c++)l=n.getBindingPath(y+h,p+
c),u.setBindingPath(d+h,k+c,l),l&&w.push({row:h,col:c,value:n.getValue(y+h,p+c)});else{for(b=new t._GcSheetModel(v,a,null),h=0;h<v;h++)for(c=0;c<a;c++)l=n.getBindingPath(y+h,p+c),b.setBindingPath(h,c,l),l&&w.push({row:h,col:c,value:n.getValue(y+h,p+c)});for(h=0;h<v;h++)for(c=0;c<a;c++)u.setBindingPath(d+h,k+c,b.getBindingPath(h,c))}return w},n.cloneObject=function(t){var r,f;if(typeof t===u||typeof t===c||typeof t===o||typeof t===i)return r=t;else if(t instanceof Date)return r=new Date(t);else r=t instanceof Object?new t.constructor:new t.constructor(t.valueOf());for(f in t)t.hasOwnProperty(f)&&r[f]!==t[f]&&(r[f]=typeof this[f]=="object"?n.cloneObject(t[f]):t[f]);return r.toString=t.toString,r.valueOf=t.valueOf,r},n.clearFormula=function(n,t,i,r,u){var e,f;for(t<0&&(t=0,r=n.getRowCount()),i<0&&(i=0,u=n.getColumnCount()),e=t;e<r;e++)for(f=i;f<u;f++)n.setFormula(e,f,null)},n._copyExpression=function(i,r,
u){var e=i,l;if(!t.util.hasCalc())return e;var f=t.Calc.Expressions,a=t.Calc.Functions,s=t.Calc.Parser,o=t.Calc.Errors.Reference,h=f.ErrorExpression,c=f.ExternalErrorExpression;if(i instanceof f.ParenthesesExpression)e=$.extend(!0,new f.ParenthesesExpression,i),e.argument=n._copyExpression(i.argument,r,u);else if(i instanceof f.CellExpression){e=$.extend(!0,new f.CellExpression,i);if(i.rowRelative&&(i.row+r<0||i.row+r>s.maxRowCount))return new h(o);if(i.columnRelative&&(i.column+u<0||i.column+u>s.maxColumnCount))return new h(o)}else if(i instanceof f.ExternalCellExpression){e=$.extend(!0,new f.ExternalCellExpression,i);if(i.rowRelative&&(i.row+r<0||i.row+r>s.maxRowCount))return new c(i.source,o);if(i.columnRelative&&(i.column+u<0||i.column+u>s.maxColumnCount))return new c(i.source,o)}else if(i instanceof f.RangeExpression){e=$.extend(!0,new f.RangeExpression,i);if(i.startRowRelative&&(i.startRow+r<0||i.startRow+r>
s.maxRowCount))return new h(o);if(i.startColumnRelative&&(i.startColumn+u<0||i.startColumn+u>s.maxColumnCount))return new h(o);if(i.endRowRelative&&(i.endRow+r<0||i.endRow+r>s.maxRowCount))return new h(o);if(i.endColumnRelative&&(i.endColumn+u<0||i.endColumn+u>s.maxColumnCount))return new h(o)}else if(i instanceof f.ExternalRangeExpression){e=$.extend(!0,new f.ExternalRangeExpression,i);if(i.startRowRelative&&(i.startRow+r<0||i.startRow+r>s.maxRowCount))return new c(i.source,o);if(i.startColumnRelative&&(i.startColumn+u<0||i.startColumn+u>s.maxColumnCount))return new c(i.source,o);if(i.endRowRelative&&(i.endRow+r<0||i.endRow+r>s.maxRowCount))return new c(i.source,o);if(i.endColumnRelative&&(i.endColumn+u<0||i.endColumn+u>s.maxColumnCount))return new c(i.source,o)}else if(i instanceof f.UnaryOperatorExpression)e=$.extend(!0,new f.UnaryOperatorExpression,i),e.operand=n._copyExpression(i.o
perand,r,u);else if(i instanceof f.BinaryOperatorExpression)e=$.extend(!0,new f.BinaryOperatorExpression,i),e.left=n._copyExpression(i.left,r,u),e.right=n._copyExpression(i.right,r,u);else if(i instanceof f.FunctionExpression){e=$.extend(!0,new f.FunctionExpression(new a.Function),i);if(i.args&&i.args.length>0)for(l=0;l<i.args.length;l++)e.args[l]=n._copyExpression(i.args[l],r,u)}return e},n.copyFormula=function(i,r,u,f,e,o,s,h){var g=i._getCalcModel(),nt=f._getCalcModel(),rt,w,ut,k,c,l,b,d;if(!g||!nt)return;var it=r,tt=u,a=e,v=o,p=s,y=h;for(r<0&&(it=0,p=Math.min(i.getRowCount(),f.getRowCount())),u<0&&(tt=0,y=Math.min(i.getColumnCount(),f.getColumnCount())),e<0&&(a=0),o<0&&(v=0),rt=!(i===f&&i._name===f._name),w=f._getSheetSource(),w&&w.unlinkCellExpression(a,v,p,y),ut=new t._GcSheetModel(p,y,null),k=new t._GcSheetModel(p,y,null),c=0;c<p;c++)for(l=0;l<y;l++)k.setFormula(c,l,g.getFormula(c+it,l+tt));for(b=
f.getCalcService(),c=0;c<p;c++)for(l=0;l<y;l++)d=n._copyExpression(k.getFormula(c,l),c+a,l+v),b&&f._dataModel.setFormula(c+a,l+v,b.unparse(d,c+a,l+v)),nt.setFormula(c+a,l+v,d);w&&(w.linkCellExpression(a,v,p,y),w._addCellsToDirty(a,v,p,y))},n.copyStyle=function(i,r,u,f,e,o,s,h){var rt=!(i===f&&i._name===f._name),v,y,l,c,a,d,k,ft,nt,p,ut,it;if(r<0){d=u,k=o,v=Math.min(i.getRowCount(t.SheetArea.colHeader),f.getRowCount(t.SheetArea.colHeader)),y=h,u<0&&(d=0,y=i.getColumnCount()),o<0&&(k=0);if(rt)for(l=0;l<v;l++)for(c=0;c<y;c++)a=i.getCompositeStyle(l,d+c,t.SheetArea.colHeader),a?f.setStyle(l,k+c,n.cloneObject(a),t.SheetArea.colHeader):f.setStyle(l,k+c,null,t.SheetArea.colHeader);else{for(ft=new t._GcSheetModel(v,y,null),l=0;l<v;l++)for(c=0;c<y;c++)a=i.getCompositeStyle(l,d+c,t.SheetArea.colHeader),a&&ft.setValue(l,c,n.cloneObject(a));for(l=0;l<v;l++)for(c=0;c<y;c++)f.setStyle(l,k+c,ft.getValue(l,c),t.SheetAr
ea.colHeader)}}if(u<0){nt=r,p=e,v=s,y=Math.min(i.getColumnCount(t.SheetArea.rowHeader),f.getColumnCount(t.SheetArea.rowHeader)),r<0&&(nt=0,v=i.getRowCount()),e<0&&(p=0);if(rt)for(l=0;l<v;l++)for(c=0;c<y;c++)a=i.getCompositeStyle(nt+l,c,t.SheetArea.rowHeader),a?f.setStyle(p+l,c,n.cloneObject(a),t.SheetArea.rowHeader):f.setStyle(p+l,c,null,t.SheetArea.rowHeader);else{for(ut=new t._GcSheetModel(v,y,null),l=0;l<v;l++)for(c=0;c<y;c++)a=i.getCompositeStyle(nt+l,c,t.SheetArea.rowHeader),a&&ut.setValue(l,c,n.cloneObject(a));for(l=0;l<v;l++)for(c=0;c<y;c++)f.setStyle(p+l,c,ut.getValue(l,c),t.SheetArea.rowHeader)}}var ot=r,et=u,tt=e,g=o,w=s,b=h;r<0&&(ot=0,w=Math.min(i.getRowCount(),f.getRowCount())),u<0&&(et=0,b=Math.min(i.getColumnCount(),f.getColumnCount())),e<0&&(tt=0),o<0&&(g=0);if(rt)for(l=0;l<w;l++)for(c=0;c<b;c++)a=i.getCompositeStyle(ot+l,et+c,t.SheetArea.viewport),a?f.setStyle(tt+l,g+
c,n.cloneObject(a),t.SheetArea.viewport):f.setStyle(tt+l,g+c,null,t.SheetArea.viewport);else{for(it=new t._GcSheetModel(w,b,null),l=0;l<w;l++)for(c=0;c<b;c++)a=i.getCompositeStyle(ot+l,et+c,t.SheetArea.viewport),a&&it.setValue(l,c,n.cloneObject(a));for(l=0;l<w;l++)for(c=0;c<b;c++)f.setStyle(tt+l,g+c,it.getValue(l,c),t.SheetArea.viewport)}},n.copyColumnRangeGroup=function(t,i,r,u,f){var e=i,h=u,s=f,c,o;e<0&&(e=0,s=Math.min(t.getColumnCount(),r.getColumnCount())),u<0&&(h=0),c=!(t===r&&t._name===r._name),c?t.colRangeGroup&&r.colRangeGroup&&n.crossSheetCopyRangeGroup(t.colRangeGroup,e,r.colRangeGroup,h,s):(o=t.colRangeGroup,o&&o._copy(e,h,s))},n.crossSheetCopyRangeGroup=function(n,i,r,u,f){var o,e,s,h;i<0&&(i=0),u<0&&(u=0),o=[];if(n){e=n.items.nextNonEmptyIndex(i-1);while(e>=0&&e<i+f)o[e-i]=new t.RangeGroupItemInfo(n.items[e]),e=n.items.nextNonEmptyIndex(e)}if(r){r.items.clear(u
,f);if(o.length>0)for(s in o)o.hasOwnProperty(s)&&(h=o[s],r.items[u+s]=h)}},n.copySparkline=function(n,t,i,r,u,f,e,o){var l=t,a=i,v=u,y=f,h=e,c=o,p,s;t<0&&(l=0,h=Math.min(n.getRowCount(),r.getRowCount())),i<0&&(a=0,c=Math.min(n.getColumnCount(),r.getColumnCount())),u<0&&(v=0),f<0&&(y=0),p=!(n===r&&n._name===r._name),p?(s=r._sparklineGroupManager,s&&s._exCopy(n,l,a,v,y,h,c)):(s=n._sparklineGroupManager,s&&s._copy(l,a,v,y,h,c))},n.copyRowRangeGroup=function(t,i,r,u,f){var s=i,h=u,e=f,c,o;i<0&&(s=0,e=Math.min(t.getRowCount(),r.getRowCount())),u<0&&(h=0),c=!(t===r&&t._name===r._name),c?t.rowRangeGroup&&r.rowRangeGroup&&n.crossSheetCopyRangeGroup(t.rowRangeGroup,s,r.rowRangeGroup,h,e):(o=t.rowRangeGroup,o&&o._copy(s,h,e))},n.copySpan=function(i,r,u,f,e,o,s,h){var y=r,c=u,p=e,v=o,l=s,a=h,w,d,k,b;r<0&&(y=0,l=Math.min(i.getRowCount(),f.getRowCount()
)),c<0&&(c=0,a=Math.min(i.getColumnCount(),f.getColumnCount())),e<0&&(p=0),o<0&&(v=0),w=!(i===f&&i._name===f._name),r<0&&(w?n.crossSheetCopySpans(i._colHeaderSpanModel,-1,c,f._colHeaderSpanModel,-1,v,-1,a):(d=i._getSpanModel(t.SheetArea.colHeader),d&&d.copy(-1,c,-1,v,-1,a))),u<0&&(w?n.crossSheetCopySpans(i._rowHeaderSpanModel,y,-1,f._rowHeaderSpanModel,p,-1,l,-1):(k=i._getSpanModel(t.SheetArea.rowHeader),k&&k.copy(y,-1,p,-1,l,-1))),w?n.crossSheetCopySpans(i._spanModel,y,c,f._spanModel,p,v,l,a):(b=i._getSpanModel(t.SheetArea.viewport),b&&b.copy(y,c,p,v,l,a))},n.crossSheetCopySpans=function(i,r,u,f,e,o,s,h){var v=n.getSpans(i),y=n.getSpans(f),w=[],l,a,c,p,b;if(r===-1){if(v&&v.length>0)for(l=0;l<v.length;l++)c=v[l],c.col<u||c.col+c.colCount>u+h||w.push(new t.Range(c.row,o+c.col-u,c.rowCount,c.colCount));if(y&&y.length>0)for(l=0;l<y.length;l++){c=y[l];if(c.col>=o&a
mp;&c.col<o+h)for(a=0;a<f.length;a++){p=f[a];if(p.row===c.row&&p.col===c.col){f.splice(a,1);break}}}}else if(u===-1){if(v&&v.length>0)for(l=0;l<v.length;l++)c=v[l],r>c.row||c.row+c.rowCount>r+s||w.push(new t.Range(e+c.row-r,c.col,c.rowCount,c.colCount));if(y&&y.length>0)for(l=0;l<y.length;l++){c=y[l];if(c.row>=e&&c.row<e+s)for(a=0;a<f.length;a++){p=f[a];if(p.row===c.row&&p.col===c.col){f.splice(a,1);break}}}}else{if(v&&v.length>0)for(l=0;l<v.length;l++)c=v[l],r<=c.row&&c.row<r+s&&u<=c.col&&c.col<u+h&&w.push(new t.Range(e+c.row-r,o+c.col-u,c.rowCount,c.colCount));if(y&&y.length>0)for(l=0;l<y.length;l++){c=y[l];if(c.row>=e&&c.row<e+s&&c.col>=o&&c.col<o+h)for(a=0;a<f.length;a++){p=f[a];if(p.row===c.row&&p.col===c.col){f.splice(a,1);break}}}}if(w.length>0&&f)for(l=0;l<w.length;l++
)b=w[l],f.push(b)},n.getSpans=function(n){return n&&n.length>0?n.slice(0):null},n.copyColumnAxis=function(i,r,u,f,e,o){var a=r,c=f,b=e,h,s,w,y,l,k,v,p;for(r<0&&(a=0,b=Math.min(i.getColumnCount(),u.getColumnCount())),f<0&&(c=0),h=t.SheetArea.colHeader,s=0;s<b;s++)w=i._getActualColumnWidth(s+a),w!==undefined&&w!==null&&u.setColumnWidth(s+c,w),y=i.getColumnVisible(s+a),y!==undefined&&y!==null&&u.setColumnVisible(s+c,y),(o&t.CopyToOption.Style)>0&&(l=i.getActualStyle(-1,s+a),l?u.setStyle(-1,s+c,n.cloneObject(l)):u.setStyle(-1,s+c,null),l=i.getActualStyle(-1,s+a,h),l?u.setStyle(-1,s+c,n.cloneObject(l),h):u.setStyle(-1,s+c,null,h));for(k=Math.min(i.getRowCount(h),u.getRowCount(h)),v=0;v<k;v++)p=i._getActualRowHeight(v,h),p!==undefined&&p!==null&&u.setRowHeight(v,p,h)},n.cloneAxisInfo=function(n,t,i){for(var e=[],r,o,f,u=0;u<i;u++){r=n[t+u];if(r){o={};for(f in r)r.hasOwnProperty(f)&
&(o[f]=r[f]);e.push(o)}else e.push(null)}return e},n.getAxisInfo=function(n,t,i){for(var u=[],r=0;r<i;r++)u.push(n[t+r]);return u},n.setAxisInfo=function(n,t,i){if(t)for(var r=0;r<n.length;r++)t[i+r]=n[r]},n.copyRowAxis=function(i,r,u,f,e,o){var a=r,c=f,b=e,h,s,w,y,l,k,v,p;for(r<0&&(a=0,b=Math.min(i.getRowCount(),u.getRowCount())),f<0&&(c=0),h=t.SheetArea.rowHeader,s=0;s<b;s++)w=i._getActualRowHeight(s+a),w!==undefined&&w!==null&&u.setRowHeight(s+c,w),y=i.getRowVisible(s+a),y!==undefined&&y!==null&&u.setRowVisible(s+c,y),(o&t.CopyToOption.Style)>0&&(l=i.getActualStyle(s+a,-1),l?u.setStyle(s+c,-1,n.cloneObject(l)):u.setStyle(s+c,-1,null),l=i.getActualStyle(s+a,-1,h),l?u.setStyle(s+c,-1,n.cloneObject(l),h):u.setStyle(s+c,-1,null,h));for(k=Math.min(i.getColumnCount(h),u.getColumnCount(h)),v=0;v<k;v++)p=i._getActualColumnWidth(v,h),p!==undefined&&p!==null&&u.setColumnWidth(v,p,h)},n.copy
SheetInfo=function(i,r,u){if(!(i===r&&i._name===r._name)){if((u&t.CopyToOption.Style)>0){var e=t.SheetArea.colHeader,f=t.SheetArea.rowHeader;r.setDefaultStyle(n.cloneObject(i.getDefaultStyle())),r.setDefaultStyle(n.cloneObject(i.getDefaultStyle(e)),e),r.setDefaultStyle(n.cloneObject(i.getDefaultStyle(f)),f)}r.defaults.colWidth=i.defaults.colWidth,r.defaults.rowHeight=i.defaults.rowHeight,r.defaults.rowHeaderColWidth=i.defaults.rowHeaderColWidth}},n.moveTo=function(i,r,u,f,e,o,s,h,c){var p,a,v,y,w,l,b;n.checkArguments(i,r,u,f,e,o,s,h),i.suspendCalcService(),f.suspendCalcService(),p=null,(c&t.CopyToOption.BindingPath)>0&&(p=n.moveBindingPath(i,r,u,f,e,o,s,h));try{if((c&t.CopyToOption.Value)>0){n.moveValue(i,r,u,f,e,o,s,h),(c&t.CopyToOption.Formula)==0&&n.clearFormula(f,e,o,s,h);if((c&t.CopyToOption.BindingPath)>0){var g=p.length,d=e<0?0:e,k=o<0?0:o;for(a=0;a<g;a++)v=p[a],f.setValue(d+v.row,k+v.col,v.value)}}(c&t.Copy
ToOption.Formula)>0&&n.moveFormula(i,r,u,f,e,o,s,h)}finally{i.resumeCalcService(),f.resumeCalcService()}(c&t.CopyToOption.Style)>0&&n.moveStyle(i,r,u,f,e,o,s,h),(c&t.CopyToOption.Sparkline)>0&&n.moveSparkline(i,r,u,f,e,o,s,h),(c&t.CopyToOption.RangeGroup)>0&&(r<0&&n.moveColumnRangeGroup(i,u,f,o,h),u<0&&n.moveRowRangeGroup(i,r,f,e,s)),(c&t.CopyToOption.Span)>0&&n.moveSpan(i,r,u,f,e,o,s,h),r<0&&n.moveColumnAxis(i,u,f,o,h,c),u<0&&n.moveRowAxis(i,r,f,e,s,c),r<0&&e<0&&u<0&&o<0&&n.moveSheetInfo(i,f,c);if(r<0)for(y=u,w=h,u<0&&(y=0,w=Math.min(i.getColumnCount(),f.getColumnCount())),l=0;l<w;l++)i.isColumnBound(y+l)&&(i._colInfos[y+l]=null);b="[MoveTo]",i._raisePropertyChanged(b),f._raisePropertyChanged(b)},n.moveValue=function(n,i,r,u,f,e,o,s){var et=!(n===u&&n._name===u._name),w=t.SheetArea.c
olHeader,a,v,c,h,l,y,nt,st,p,k,tt,ot,ft;if(i<0){y=r,nt=e,a=Math.min(n.getRowCount(w),u.getRowCount(w)),v=s,r<0&&(y=0,v=n.getColumnCount()),e<0&&(nt=0);if(et)for(c=0;c<a;c++)for(h=0;h<v;h++)l=n._getModel(w).getValue(c,y+h),(l===undefined||l===null)&&n.isColumnBound(y+h)&&(c===n.colHeaderAutoTextIndex||c===a-1&&n.colHeaderAutoTextIndex===-1)&&(l=n.getDataColumnName(y+h)),l===undefined||l===null?u._setValueInternal(c,nt+h,w,null,!0):(u._setValueInternal(c,nt+h,w,l,!0),n._setValueInternal(c,y+h,w,null,!0));else{for(st=new t._GcSheetModel(a,v,null),c=0;c<a;c++)for(h=0;h<v;h++)l=n._getModel(w).getValue(c,y+h),(l===undefined||l===null)&&n.isColumnBound(y+h)&&(c===n.colHeaderAutoTextIndex||c===a-1&&n.colHeaderAutoTextIndex===-1)&&(l=n.getDataColumnName(y+h)),l!==undefined&&l!==null&&st.setValue(c,h,l),n._setValueInternal(c,y+h,w,null,!0);for(c=0;c<a;c++)for(h=0;h<v;h++)
u._setValueInternal(c,nt+h,w,st.getValue(c,h),!0)}}p=t.SheetArea.rowHeader;if(r<0){k=i,tt=f,a=o,v=Math.min(n.getColumnCount(p),u.getColumnCount(p)),i<0&&(k=0,a=n.getRowCount()),f<0&&(tt=0);if(et)for(c=0;c<a;c++)for(h=0;h<v;h++)l=n.getValue(k+c,h,p),l===undefined||l===null?u._setValueInternal(tt+c,h,p,null,!0):(u._setValueInternal(tt+c,h,p,l,!0),n._setValueInternal(k+c,h,p,null,!0));else{for(ot=new t._GcSheetModel(a,v,null),c=0;c<a;c++)for(h=0;h<v;h++)l=n._getModel(p).getValue(k+c,h),l!==undefined&&l!==null&&ot.setValue(c,h,l),n._setValueInternal(k+c,h,p,null,!0);for(c=0;c<a;c++)for(h=0;h<v;h++)u._setValueInternal(tt+c,h,p,ot.getValue(c,h),!0)}}var g=i,it=r,rt=f,ut=e,d=o,b=s;i<0&&(g=0,d=Math.min(n.getRowCount(),u.getRowCount())),r<0&&(it=0,b=Math.min(n.getColumnCount(),u.getColumnCount())),f<0&&(rt=0),e<0&&(ut=0);if(et)for(c=0;c<d;c++)for(h=0;h<b;h++)l=n.getValue(g+c,it+h),l==
=undefined||l===null?u._setValueInternal(rt+c,ut+h,null,null,!0):(u._setValueInternal(rt+c,ut+h,null,l,!0),n._setValueInternal(g+c,it+h,null,null,!0));else{for(ft=new t._GcSheetModel(d,b,null),c=0;c<d;c++)for(h=0;h<b;h++)l=n.getValue(g+c,it+h),l!==undefined&&l!==null&&ft.setValue(c,h,l);for(c=0;c<d;c++)for(h=0;h<b;h++)n._setValueInternal(g+c,it+h,null,null,!0);for(c=0;c<d;c++)for(h=0;h<b;h++)u._setValueInternal(rt+c,ut+h,null,ft.getValue(c,h),!0)}},n.moveFormula=function(n,t,i,r,u,f,e,o){var k=n._getCalcModel(),nt=r._getCalcModel(),d,g;if(!k||!nt)return;var y=t,p=i,b=u,w=f,l=e,c=o;t<0&&(y=0,l=Math.min(n.getRowCount(),r.getRowCount())),i<0&&(p=0,c=Math.min(n.getColumnCount(),r.getColumnCount())),u<0&&(b=0),f<0&&(w=0);var rt=!(n===r&&n._name===r._name),v=n._getSheetSource(),a=r._getSheetSource();v&&(v.unlinkCellExpression(y,p,l,c),v._addDependentsToAdjust(y,p,l,c)),a&&(a.unlinkCellExp
ression(b,w,l,c),a._addDependentsToAdjust(b,w,l,c));for(var it=n._getModel(),ut=r._getModel(),tt=[],h,s=0;s<l;s++)for(h=0;h<c;h++)tt.push(k.getFormula(s+y,h+p)),it.setFormula(s+y,h+p,null),k.setFormula(s+y,h+p,null);for(d=r.getCalcService(),s=0;s<l;s++)for(h=0;h<c;h++)g=tt.shift(),d&&ut.setFormula(s+b,h+w,d.unparse(g,s+b,h+w)),nt.setFormula(s+b,h+w,g);v&&v._addCellsToAdjust(y,p,l,c),a&&a._addCellsToAdjust(b,w,l,c),v&&v._controller&&v._controller.adjustFormulasOnMove(v,y,p,a,b,w,l,c),rt===!0&&a&&a._controller&&a._controller.adjustFormulasOnMove(v,y,p,a,b,w,l,c)},n.moveStyle=function(i,r,u,f,e,o,s,h){var st=!(i===f&&i._name===f._name),w=t.SheetArea.colHeader,v,y,l,c,a,k,rt,ot,p,b,it,ht,et;if(r<0){k=u,rt=o,v=Math.min(i.getRowCount(w),f.getRowCount(w)),y=h,u<0&&(k=0,y=i.getColumnCount()),o<0&&(rt=0);if(st)for(l=0;l<v;l++)for(c=0;c<y;c++)a=i.getCompositeStyle(l,k+c,w),a?(f.s
etStyle(l,rt+c,n.cloneObject(a),w),i.setStyle(l,k+c,null,w)):f.setStyle(l,rt+c,null,w);else{for(ot=new t._GcSheetModel(v,y,null),l=0;l<v;l++)for(c=0;c<y;c++)a=i.getCompositeStyle(l,k+c,w),a&&ot.setValue(l,c,n.cloneObject(a)),i.setStyle(l,k+c,null,w);for(l=0;l<v;l++)for(c=0;c<y;c++)f.setStyle(l,rt+c,ot.getValue(l,c),w)}}p=t.SheetArea.rowHeader;if(u<0){b=r,it=e,v=s,y=Math.min(i.getColumnCount(p),f.getColumnCount(p)),r<0&&(b=0,v=i.getRowCount()),e<0&&(it=0);if(st)for(l=0;l<v;l++)for(c=0;c<y;c++)a=i.getCompositeStyle(b+l,c,p),a?(f.setStyle(it+l,c,n.cloneObject(a),p),i.setStyle(b+l,c,null,p)):f.setStyle(it+l,c,null,p);else{for(ht=new t._GcSheetModel(v,y,null),l=0;l<v;l++)for(c=0;c<y;c++)a=i.getCompositeStyle(b+l,c,p),a&&ht.setValue(l,c,n.cloneObject(a)),i.setStyle(b+l,c,null,p);for(l=0;l<v;l++)for(c=0;c<y;c++)f.setStyle(it+l,c,ht.getValue(l,c),p)}}var g=r,d=u,ft=e,ut=o,nt=s,tt=h;r<0&&(g=0,nt=Math.min(i.getR
owCount(),f.getRowCount())),u<0&&(d=0,tt=Math.min(i.getColumnCount(),f.getColumnCount())),e<0&&(ft=0),o<0&&(ut=0);if(st)for(l=0;l<nt;l++)for(c=0;c<tt;c++)a=i.getCompositeStyle(g+l,d+c),a?(f.setStyle(ft+l,ut+c,n.cloneObject(a)),i.setStyle(g+l,d+c,null)):f.setStyle(ft+l,ut+c,null);else{for(et=new t._GcSheetModel(nt,tt,null),l=0;l<nt;l++)for(c=0;c<tt;c++)a=i.getCompositeStyle(g+l,d+c),a&&et.setValue(l,c,n.cloneObject(a)),i.setStyle(g+l,d+c,null);for(l=0;l<nt;l++)for(c=0;c<tt;c++)f.setStyle(ft+l,ut+c,et.getValue(l,c))}},n.moveSparkline=function(n,t,i,r,u,f,e,o){var l=t,a=i,v=u,y=f,h=e,c=o,p,s;t<0&&(l=0,h=Math.min(n.getRowCount(),r.getRowCount())),i<0&&(a=0,c=Math.min(n.getColumnCount(),r.getColumnCount())),u<0&&(v=0),f<0&&(y=0),p=!(n===r&&n._name===r._name),p?(s=r._sparklineGroupManager,s&&s._exMove(n,l,a,v,y,h,c)):(s=n._sparklineGroupManager,s&&s._move(l,a,v,y,
h,c))},n.moveColumnRangeGroup=function(t,i,r,u,f){var e=i,h=u,o=f,c,s;e<0&&(e=0,o=Math.min(t.getColumnCount(),r.getColumnCount())),u<0&&(h=0),c=!(t===r&&t._name===r._name),c?t.colRangeGroup&&r.colRangeGroup&&(n.crossSheetCopyRangeGroup(t.colRangeGroup,e,r.colRangeGroup,h,o),t.colRangeGroup.items.clear(e,o)):(s=t.colRangeGroup,s&&s._move(e,h,o))},n.moveRowRangeGroup=function(t,i,r,u,f){var o=i,h=u,e=f,c,s;i<0&&(o=0,e=Math.min(t.getRowCount(),r.getRowCount())),u<0&&(h=0),c=!(t===r&&t._name===r._name),c?t.rowRangeGroup&&r.rowRangeGroup&&(n.crossSheetCopyRangeGroup(t.rowRangeGroup,o,r.rowRangeGroup,h,e),t.rowRangeGroup.items.clear(o,e)):(s=t.rowRangeGroup,s&&s._move(o,h,e))},n.moveSpan=function(i,r,u,f,e,o,s,h){var v=r,c=u,p=e,y=o,l=s,a=h,w,d,k,b;r<0&&(v=0,l=Math.min(i.getRowCount(),f.getRowCount())),c<0&&(c=0,a=Math.min(i.getColumnCount(),f.getColumnCount())
),e<0&&(p=0),o<0&&(y=0),w=!(i===f&&i._name===f._name),r<0&&(w?(n.crossSheetCopySpans(i._colHeaderSpanModel,-1,c,f._colHeaderSpanModel,-1,y,-1,a),i._colHeaderSpanModel&&i._colHeaderSpanModel.clear(-1,c,-1,a)):(d=i._getSpanModel(t.SheetArea.colHeader),d&&d.move(-1,c,-1,y,-1,a))),u<0&&(w?(n.crossSheetCopySpans(i._rowHeaderSpanModel,v,-1,f._rowHeaderSpanModel,p,-1,l,-1),i._rowHeaderSpanModel&&i._rowHeaderSpanModel.clear(v,-1,l,-1)):(k=i._getSpanModel(t.SheetArea.rowHeader),k&&k.move(v,-1,p,-1,l,-1))),w?(n.crossSheetCopySpans(i._spanModel,v,c,f._spanModel,p,y,l,a),i._spanModel&&i._spanModel.clear(v,c,l,a)):(b=i._getSpanModel(),b&&b.move(v,c,p,y,l,a))},n.moveColumnAxis=function(i,r,u,f,e,o){var c=r,l=f,b=e,h,s,w,y,a,k,v,p;for(r<0&&(c=0,b=Math.min(i.getColumnCount(),u.getColumnCount())),f<0&&(l=0),h=t.SheetArea.colHeader,s=0;s<b;s++)w=i._getActualColumnWidth(s+c),w!=
=undefined&&w!==null&&(i.setColumnWidth(s+c,i.defaults.colWidth),u.setColumnWidth(s+l,w)),y=i.getColumnVisible(s+c),y!==undefined&&y!==null&&(i.setColumnVisible(s+c,!0),u.setColumnVisible(s+l,y)),(o&t.CopyToOption.Style)>0&&(a=i.getActualStyle(-1,s+c),a?(u.setStyle(-1,s+l,n.cloneObject(a)),i.setStyle(-1,s+c,null)):u.setStyle(-1,s+l,null),a=i.getActualStyle(-1,s+c,h),a?(u.setStyle(-1,s+l,n.cloneObject(a),h),i.setStyle(-1,s+c,null,h)):u.setStyle(-1,s+l,null,h));for(k=Math.min(i.getRowCount(h),u.getRowCount(h)),v=0;v<k;v++)p=i._getActualRowHeight(v,h),p!==undefined&&p!==null&&(i.setRowHeight(v,i.defaults.colHeaderRowHeight,h),u.setRowHeight(v,p,h))},n.moveRowAxis=function(i,r,u,f,e,o){var c=r,l=f,b=e,h,s,w,y,a,k,v,p;for(r<0&&(c=0,b=Math.min(i.getRowCount(),u.getRowCount())),f<0&&(l=0),h=t.SheetArea.rowHeader,s=0;s<b;s++)w=i._getActualRowHeight(s+c),w!==undefined&&w!==null&&(i.setR
owHeight(s+c,i.defaults.rowHeight),u.setRowHeight(s+l,w)),y=i.getRowVisible(s+c),y!==undefined&&y!==null&&(i.setRowVisible(s+c,!0),u.setRowVisible(s+l,y)),(o&t.CopyToOption.Style)>0&&(a=i.getActualStyle(s+c,-1),a?(u.setStyle(s+l,-1,n.cloneObject(a)),i.setStyle(s+c,-1,null)):u.setStyle(s+l,-1,null),a=i.getActualStyle(s+c,-1,h),a?(u.setStyle(s+l,-1,n.cloneObject(a),h),i.setStyle(s+c,-1,null,h)):u.setStyle(s+l,-1,null,h));for(k=Math.min(i.getColumnCount(h),u.getColumnCount(h)),v=0;v<k;v++)p=i._getActualColumnWidth(v,h),p!==undefined&&p!==null&&(i.setColumnWidth(v,i.defaults.rowHeaderColWidth,h),u.setColumnWidth(v,p,h))},n.moveSheetInfo=function(n,i,r){if(n!==i||n._name!==i._name){if((r&t.CopyToOption.Style)>0){var f=t.SheetArea.colHeader,u=t.SheetArea.rowHeader;i.setDefaultStyle(n.getDefaultStyle()),i.setDefaultStyle(n.getDefaultStyle(f),f),i.setDefaultStyle(n.getDefaultStyle(u),u),n.setDefaultStyle(null),n.setDefaultStyle(null,f
),n.setDefaultStyle(null,u)}i.defaults.colWidth=n.defaults.colWidth,i.defaults.rowHeight=n.defaults.rowHeight,i.defaults.rowHeaderColWidth=n.defaults.rowHeaderColWidth,n.defaults.colWidth=62,n.defaults.rowHeight=20,n.defaults.rowHeaderColWidth=40}},n.moveBindingPath=function(n,i,r,u,f,e,o,s){var l=i,a=r,d=f,k=e,p=o,y=s,w,g,b,v,h,c;i<0&&(l=0,p=Math.min(n.getRowCount(),u.getRowCount())),r<0&&(a=0,y=Math.min(n.getColumnCount(),u.getColumnCount())),f<0&&(d=0),e<0&&(k=0),w=[],g=!(n===u&&n._name===u._name);if(g)for(h=0;h<p;h++)for(c=0;c<y;c++)v=n.getBindingPath(l+h,a+c),u.setBindingPath(d+h,k+c,v),v&&w.push({row:h,col:c,value:n.getValue(l+h,a+c)}),n.setBindingPath(l+h,a+c,null);else{for(b=new t._GcSheetModel(p,y,null),h=0;h<p;h++)for(c=0;c<y;c++)v=n.getBindingPath(l+h,a+c),b.setBindingPath(h,c,v),v&&w.push({row:h,col:c,value:n.getValue(l+h,a+c)});for(h=0;h<p;h++)for(c=0;c<y;c++)n.setBindingPath(l+h,a+c,n
ull);for(h=0;h<p;h++)for(c=0;c<y;c++)u.setBindingPath(d+h,k+c,b.getBindingPath(h,c))}return w},n.setRangeText=function(i,r,u,f,o,s,h,c){if(!i)throw new Error(t._StringResource.Exp_SheetIsNull);(r<-1||r>=i.getRowCount())&&e("row",r,"-1",i.getRowCount()-1),(u<-1||u>=i.getColumnCount())&&e("column",u,"-1",i.getColumnCount()-1);if(f===undefined||f===null||f==="")return;r===-1&&(r=0),u===-1&&(u=0);var l=n.parseText(f,o,s,h);l&&l.length>0&&n.setSheetData(i,r,u,l,c)},n.getRangeText=function(n,i,r,u,f,o,s,h,c,l){var b,w,v,k,d,y,a,p;if(!n)throw new Error(t._StringResource.Exp_SheetIsNull);for((i<-1||i>=n.getRowCount())&&e("row",i,"-1",n.getRowCount()-1),(r<-1||i+r>n.getRowCount())&&e("rowCount",i,"-1",n.getRowCount()-i),(u<-1||u>=n.getColumnCount())&&e("column",u,"-1",n.getC
olumnCount()-1),(f<-1||u+f>n.getColumnCount())&&e("columnCount",u,"-1",n.getColumnCount()-u),b=-1,w=-1,i===-1&&u===-1&&r===-1&&f===-1?(i=0,u=0,b=n.getRowCount()-1,w=n.getColumnCount()-1):(i===-1&&(i=0),u===-1&&(u=0),r===-1&&(r=n.getRowCount()-i),f===-1&&(f=n.getColumnCount()-u),b=i+r-1,w=u+f-1),(o===undefined||o===null||o==="")&&(o="\r\n"),(s===undefined||s===null||s==="")&&(s="\t"),(h===undefined||h===null||h==="")&&(h='"'),v="",k=i;k<=b;k++){for(d=!0,y=u;y<=w;y++)d||(v+=s),d=!1,a="",p=n.getText(k,y),p!==undefined&&p!==null&&(a=p,a=a.replace(h,h+h)),v+=c||a.indexOf(h)!==-1||a.indexOf(s)!==-1||a.indexOf(o)!==-1?h+a+h:a;v+=o}return v.toString()},n.parseText=function(n,i,r,u){var o,a;if(n===undefined||n===null||n==="")return null;(i===undefined||i===null||i==="&q
uot;)&&(i="\r\n"),(r===undefined||r===null||r==="")&&(r="\t"),(u===undefined||u===null||u==="")&&(u='"'),t.StringHelper.EndsWith(n,i)||(n+=i);var v=[],l=[],f=new t.StringBuilder,s=!1,e=u.length,h=i.length,c=r.length;for(o=0;o<n.length;o++)f.Append(n[o]),f.Length()<e||u!==f.ToString(f.Length()-e,e)?s||f.Length()<c||r!==f.ToString(f.Length()-c,c)?s||f.Length()<h||i!==f.ToString(f.Length()-h,h)||(f.Remove(f.Length()-h,h),l.push(f.toString()),v.push(l),l=[],f.Remove(0,f.Length())):(f.Remove(f.Length()-c,c),l.push(f.toString()),f.Remove(0,f.Length())):s&&n.length>=o+1+e&&u===n.substr(o+1,e)?o+=e:s?(f.Remove(f.Length()-e,e),s=!1):(a=f.ToString(),a.indexOf(u)===0&&(f.Remove(f.Length()-e,e),s=!0));return v},n.setSheetData=function(i,r,u,f,e){var s=f.length,h=n.getMaxLength(f),o,l,c,a;if(s===0||h===0)return;o=new yt(e),o.fixOptions(i);var y=o.rowHeader?i.getColumnCount(t.SheetArea.rowH
eader):0,v=o.columnHeader?i.getRowCount(t.SheetArea.colHeader):0,p=0;for(h-=y,h>0||(h=0),s-=v,s>0||(p=0),s-=p,s>0||(s=0),o.expandRows&&r+s>i.getRowCount()&&i.setRowCount(r+s),o.expandColumns&&u+h>i.getColumnCount()&&i.setColumnCount(u+h),l=0,c=0;l<f.length;l++,c++){a=f[l];if(a.length<=0)continue;v>0&&l<v?n.setRowData(i,a,c,u,h,t.SheetArea.colHeader,o):s>0&&c<i.getRowCount()&&(l===v&&(c=r),n.setRowData(i,a,c,0,y,t.SheetArea.rowHeader,o),a.splice(0,y),n.setRowData(i,a,c,u,h,t.SheetArea.viewport,o))}},n.setRowData=function(t,i,r,u,f,e,o){for(var h=0,s=u;h<i.length;h++,s++)f>0&&s<t.getColumnCount(e)&&n.setCellData(t,e,r,s,i[h],o)},n.setCellData=function(n,i,r,u,f,e){var o=f,l=null,h,s,c;e.unFormatted===!1&&t.features.formatter&&(h={value:f},l=(new t.GeneralFormatter).GetPreferredDisplayFormatter(f,h),o=h.value);if(o===undefined||o===null)n.setValue(r,
u,o,i);else if(f!=="")if(e.formula&&f[0]==="=")try{n.setFormula(r,u,f.substr(1),i)}catch(a){n.setText(r,u,f,i)}else s=n.getActualStyle(r,u,i),s&&(e.unFormatted===!1&&t.features.formatter?s.formatter?s.formatter.toString()==="@"&&(o=f.toString()):(c=new t.AutoFormatter(l),n.getCell(r,u,i)._setStyleProperty("_autoFormatter",c)):s.formatter&&n.getCell(r,u,i).formatter(null)),n.setValue(r,u,o,i);else n.setValue(r,u,null,i)},n.getMaxLength=function(n){var i,t,r;if(n===undefined||n===null)return 0;for(i=0,t=0;t<n.length;t++)r=n[t],i=Math.max(r.length,i);return i},n.parseCsv=function(t,i,r,u){var h=null,o=n.parseText(t,i,r,u),f,e;if(o){var c=o.length,l=n.getMaxLength(o),s=[];for(f=0;f<c;f++)for(s[f]=[],e=0;e<l;e++)s[f][e]=e<o[f].length?o[f][e]:null;h=s}return h},n}(),l=[/\\/g,/\(/g,/\[/g,/\{/g,/\^/g,/\$/g,/\|/g,/\)/g,/\+/g,/\./g],ht=new RegExp("{113E2532-EAF5-444c-A5CB-3D7446971C4D}","
;g"),ot=new RegExp("{E21523B3-0F1F-458f-B547-23D25713D0EC}","g");g=function(){function n(n,t,i,r){this.read=n,this.create=t,this.update=i,this.remove=r}return n}(),t.DataContext=g;var s=".gcSheet",nt=".gcSheetInternal",tt="mousedown"+s,v="mousemove"+s,y="mouseup"+s,a="mouseout"+s,p="dblclick"+s,k="gcmousewheel"+s,d="resize"+s,w="value",vt="left",pt="top",bt="width",wt="height",b="hidden",ft="visibility",lt="POST",ut="json",it="application/json;charset=UTF-8",rt=new RegExp("^/Date\\((-?\\d+)([-+]{1}\\d+)?\\)/\\s*$"),ct=new RegExp("^/OADate\\(([-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)\\)/\\s*$"),at=function(){function e(n){this._name="",this.defaults=null,this.gridline=null,this.borderColor="black",this.borderWidth=0,this._zoomFa
ctor=1,this.frozenRowCount=0,this.frozenColCount=0,this.rowHeaderVisible=!0,this.colHeaderVisible=!0,this.rowHeaderAutoText=t.HeaderAutoText.numbers,this.colHeaderAutoText=t.HeaderAutoText.letters,this.rowHeaderAutoTextIndex=-1,this.colHeaderAutoTextIndex=-1,this.rowRangeGroup=null,this.colRangeGroup=null,this._activeRowIndex=0,this._activeColIndex=0,this.activeRowViewportIndex=0,this.activeColViewportIndex=0,this._allowCellOverflow=!1,this.maxCellOverflowDistance=100,this.showEditingLocator=!0,this.keyMap=null,this.isProtected=!1,this._allowUndo=!0,this._paintSuspended=!1,this._layoutSuspended=0,this.checkingChanges=!1,this.autoGenerateColumns=!0,this._allowEditorReservedLocations=!0,this._sheetTabColor=null,this._frozenlineColor="black",this._frozenTrailingRowCount=0,this._frozenTrailingColCount=0,this._GROUPBUTTON_WIDTH=15,this._GROUPBUTTON_HEIGHT=15,this._GROUPPADDING=2,this._rowLayoutCache=null,this._colLayoutCache=null,this._scrollCallback=null,this._dragRect=null,th
is._scrollTopRow=0,this._scrollLeftCol=0,this._activeRowDirty=!1,this._init(n)}return e.prototype.getDataSource=function(){return this._bindingManager?this._bindingManager.getSource():null},e.prototype.getBindingPath=function(n,i,r){(r===undefined||r===null)&&(r=t.SheetArea.viewport);if(r===t.SheetArea.viewport){var u=this._getModel(r);if(u)return u.getBindingPath(n,i)}return null},e.prototype.setBindingPath=function(n,i,r,u){return this._bindToAutoRefresh(function(n,i,r,u){(u===undefined||u===null)&&(u=t.SheetArea.viewport);if(u===t.SheetArea.viewport){var f=this._getModel(u);f&&f.setBindingPath(n,i,r)}return this})(n,i,r,u)},e.prototype._autoGenerateColumnCellType=function(n){var i,r;this._bindingManager&&this._colInfos&&this._colInfos[n]&&(i=this._bindingManager.getDataItem(0),i&&(r=i[this._colInfos[n].name],typeof r===o&&this.setCellType(-1,n,new t.CheckBoxCellType)))},e.prototype.setDataSource=function(n,i){if(!thi
s._bindingManager)return;this._bindToAutoRefresh(function(n,i){var r,u,f;(!n||i)&&this.reset(),r=this._bindingManager,r.bind(n);if(t._BindingManager.isCellBindingSource(n))return;this.setRowCount(r.getRowCount());if(this.autoGenerateColumns){this.setColumnCount(r.getColumnCount()),this._colInfos={},u=r.getFields();if(u)for(f in u)this._colInfos[f]={name:u[f]}}else this._colInfos||(this._colInfos={})})(n,i)},e.prototype.bindColumn=function(n,t){var i=this.isPaintSuspended();this.isPaintSuspended(!0);try{typeof t===c&&(t={name:t}),this._colInfos||(this._colInfos={}),this._colInfos[n]=t,t&&t.formatter&&this.setFormatter(-1,n,t.formatter),t&&t.cellType&&this.setCellType(-1,n,t.cellType)}finally{this.isPaintSuspended(i)}},e.prototype.bindColumns=function(n){var r=this.isPaintSuspended(),i,t;this.isPaintSuspended(!0);try{this._colInfos={};if(n)for(isNaN(n.length)||this.setColumnCount(n.length),i=0;i<n.length;i++)t=n[i],typeof t===c&&a
mp;(t={name:t}),this._colInfos[i]=t,t&&t.formatter&&this.setFormatter(-1,i,t.formatter),t&&t.cellType&&this.setCellType(-1,i,t.cellType)}finally{this.isPaintSuspended(r)}},e.prototype.getDataContext=function(){return this.dataContext},e.prototype.setDataContext=function(n){this.dataContext=n,this.load()},e.prototype.getDataItem=function(n){var e=this._bindingManager,t,i,r;if(!e||e.getRowCount()===0)return null;var s=this.getColumnCount(),o={},u=e.getDataItem(n);if(u)for(t in u)u.hasOwnProperty(t)&&typeof t!==f&&(o[t]=u[t]);if(this._colInfos)for(i=0;i<s;i++)r=this._colInfos[i],r&&r.name&&r.name.length>0&&(o[r.name]=this.getValue(n,i));return o},e.prototype.getDirtyRows=function(){var i=[],t=this._dataModel.dirtyNodes,u,r,n;if(t){u=this._bindingManager,r=this.getDataSource();for(n in t)t.hasOwnProperty(n)&&t[n]&&t[n].rs==="e"&&i.push({row:n,item:this.getDataItem(n),originalI
tem:r?u.getDataItem(n):null})}return i},e.prototype.getInsertRows=function(){var i=[],t=this._dataModel.dirtyNodes,n;if(t)for(n in t)t.hasOwnProperty(n)&&t[n]&&t[n].rs==="n"&&i.push({row:n,item:this.getDataItem(n)});return i},e.prototype._getDeleteRows=function(){var n=[];return this.deletedRows&&$.each(this.deletedRows,function(t,i){typeof i!==f&&i&&i.data!==undefined&&i.data!==null&&n.push({row:t,originalItem:i.data})}),n},e.prototype.hasPendingChanges=function(){var t=this._dataModel.dirtyNodes,n,i;if(t)for(n in t)if(t[n]&&(t[n].rs==="e"||t[n].rs==="n"))return!0;if(this.deletedRows)for(n in this.deletedRows)if(this.deletedRows[n]){i=this.deletedRows[n];if(typeof i!==f)return!0}return!1},e.prototype.clearPendingChanges=function(){function t(n){$.each(n,function(n,t){typeof n!==f&&t&&t.dirty&&(t.dirty=null)})}var i=this._dataModel.dirtyNodes,r,n;for(r in i)n
=i[r],n&&n.rs&&delete n.rs;this._dataModel.dirtyNodes={},this.deletedRows=[],t(this._rowInfos),t(this._colInfos)},e.prototype.load=function(){if(!this.dataContext||!this.dataContext.read)return;var n=this;this._dataReceivedDelegate=function(t){return n._onDataReceived(t)},$.getJSON(this.dataContext.read,this._dataReceivedDelegate)},e.prototype.updateRecord=function(){var i,u,f,n,r,t;if(!this.autoUpdate||!this.dataContext||!this.dataContext.update||this.dataContext.update==="")return;i=this._bindingManager,u=this.getDataSource();if(!u||i.getRowCount()===0)return;f=this,this._dataUpdatedDelegate=function(n){return f._onDataUpdated(n)},n=this._activeRowIndex,n<0||(r=this.getDataItem(n),t=this.dataContext.update,this._dataModel.dataTable&&this._dataModel.dataTable[n]&&this._dataModel.dataTable[n].rs==="n"&&(t=this.dataContext.create),$.ajax({url:t,type:lt,data:JSON.stringify(r),dataType:ut,contentType:it,success:this._dataUp
datedDelegate}))},e.prototype._onDataUpdated=function(n){},e.prototype._onDataReceived=function(n){var i,r,t;if(!n)return;i=n.data;if(!i)return;this.setDataSource(i),isNaN(n.total)||this.setRowCount(n.total);if(window.localStorage)for(r=this.getColumnCount(),t=0;t<r;t++)window.localStorage["col,"+t]&&this.setColumnWidth(t,parseInt(window.localStorage["col,"+t],10));this.parent&&this.parent._doResize(),this.invalidateLayout(),this.repaint()},e.prototype._getProperties=function(n){var r=[],t;if(n)for(t in n)typeof n[t]!==f?r.push(t):typeof et!==i&&et.isObservable(n[t])&&r.push(t);return r},e.prototype.referenceStyle=function(n){var r=t.ReferenceStyle,i=this.getCalcService();return arguments.length===0?i&&i.useR1C1?r.R1C1:r.A1:(i&&(i.useR1C1=n===r.R1C1),this)},e.prototype.recalcAll=function(){var n=this.getCalcService();n&&n.recalculateAll()},e.prototype._recalcCell=function(n,t,i){var r=this.getCalcService(
);r&&r.recalculate({target:this,model:n},t,i)},e.prototype.getCalcService=function(){return!this.calcService&&t.util.hasCalc()&&(this.calcService=new n.spread.Calc.Service(this)),this.calcService},e.prototype._getCalcContexts=function(){var n=[],t=this._getModel();return n.push({name:this._name,target:this,refModel:t}),n},e.prototype.updateCalcContexts=function(){var n=this.getCalcService();n&&n.contextChanged()},e.prototype.suspendCalcService=function(){this.calcService&&this.calcService.suspend()},e.prototype.resumeCalcService=function(){this.calcService&&this.calcService.resume()},e.prototype._getSheetSource=function(n){return n===undefined||n===null||n===t.SheetArea.viewport?this._vpSheetSource:null},e.prototype.getCustomFunction=function(n){return this._functions&&n&&n!==""?this._functions[n.toUpperCase()]:null},e.prototype.addCustomFunction=function(i){if(!t.util.hasCalc())return;if(!i||!(i instanceof n.
spread.Calc.Functions.Function))throw new Error(t._StringResource.Exp_InvalidCustomFunction);var r=i.name.toUpperCase();this._functions||(this._functions={}),this._functions[r]=i,this.recalcAll()},e.prototype.removeCustomFunction=function(n){this._functions&&n&&n!==""&&(n=n.toUpperCase(),this._functions.hasOwnProperty(n)&&(delete this._functions[n],this.recalcAll()))},e.prototype.clearCustomFunctions=function(){this._functions&&(delete this._functions,this.recalcAll())},e.prototype._findCustomFunction=function(n){if(!n||n==="")return null;var t=this.getCustomFunction(n);return!t&&this.parent&&this.parent.getCustomFunction&&(t=this.parent.getCustomFunction(n)),t},e.prototype.getCustomName=function(n){return this._names?this._names[n]:null},e.prototype.getCustomNames=function(){var n=[];return this._names&&$.each(this._names,function(t,i){n.push(i)}),n},e.prototype.addCustomName=function(n,t,i,
r){this._addCustomNameCore(n,t,i,r,!1)},e.prototype._addCustomNameCore=function(n,i,r,u,f){var o,h,s,e;if(!n||n===""||!i||i==="")throw new Error(t._StringResource.Exp_InvalidCustomName);this._names||(this._names={}),o=this.getCalcService(),h=this._getSheetSource();if(o&&h){if(f)try{s=o.parse(i,r,u)}catch(c){}else s=o.parse(i,r,u);this._names[n]=new t.NameInfo(n,s,r,u),e=h._getNameCalc(n,!0),e&&(e.updateListening(!0,!0),e.addToDirty()),this.recalcAll()}},e.prototype.removeCustomName=function(n){var i,t;this._names&&n&&n!==""&&this._names.hasOwnProperty(n)&&(delete this._names[n],i=this._getSheetSource(),i&&(t=i._getNameCalc(n),t&&(t.updateListening(!0,!1),t.addToDirty())),this.recalcAll())},e.prototype.clearCustomNames=function(){var i,r,u,n,t;if(this._names){i=this._names,delete this._names,r=this._getSheetSource();if(r)for(u=i.length,n=0;n<u;n++)t=r._getNameCalc(i[n]),t&&(t.upda
teListening(!0,!1),t.addToDirty());this.recalcAll()}},e.prototype._findCustomName=function(n){if(!n||n==="")return null;var t=this.getCustomName(n);return!t&&this.parent&&this.parent.getCustomName&&(t=this.parent.getCustomName(n)),t},e.prototype.setFormula=function(n,t,i,r){this._setFormulaCore(n,t,i,!1,r)},e.prototype._setFormulaCore=function(i,r,u,f,e){this._bindToAutoRefresh(function(i,r,u,e){var h,o,s;if(e===t.SheetArea.colHeader||e===t.SheetArea.rowHeader)return;(e===undefined||e===null)&&(e=t.SheetArea.viewport),h=n.spread.Events;if(i<0||i>=this.getRowCount()||r<0||r>=this.getColumnCount()){this._raiseInvalidOperation(t.InvalidOperationType.SetFormula,t._StringResource.Exp_IndexOutOfRange);return}if(e===t.SheetArea.viewport&&i>=0&&r>=0&&this._tableManager){o=this._tableManager.find(i,r);if(o){if(o.showHeader()&&i===o.headerIndex()&&u)return;o.showFooter()&&i===o.footerIn
dex()&&o._setFooterFormula(i,r,u)}}s=this._getSheetSource(),s&&(s.setFormula(i,r,u,f),this._conditionalFormats&&this._conditionalFormats._clearCache(),this._eventHandler._eventSuspended<1&&this._trigger(h.CellChanged,{sheet:this,sheetName:this._name,row:i,col:r,sheetArea:e,propertyName:"formula"}))})(i,r,u,e)},e.prototype.getFormula=function(n,i,r){if(r===undefined||r===null||r===t.SheetArea.viewport){var u=this._getSheetSource();if(u)return u.getFormula(n,i)}return null},e.prototype.hasFormula=function(n,i,r){if(r===undefined||r===null||r===t.SheetArea.viewport){var u=this._getSheetSource();if(u)return u.hasFormula(n,i)}return!1},e.prototype._findFormulas=function(n,t,i,r){},e.prototype._rebuildCalcNodes=function(){var t=this._getCalcModel(),u,i,r;if(!t)return;u=this._getSheetSource();if(!u)return;var n=t.nextNonNullRow(-1),f=t.getRowCount(),e=t.getColumnCount();while(0<=n&&n<f){i=t.nextNonNullColumn(n,-1);while(0<=i&
;&i<e)r=u._getCellCalc(n,i),r&&(r.stopListening(),r.startListening()),i=t.nextNonNullColumn(n,i);n=t.nextNonNullRow(n)}},e.prototype.toJSON=function(){var i=this,e={name:i._name,defaults:i.defaults,columns:i._toArray(i._colInfos,i.getColumnCount()),rows:i._toArray(i._rowInfos,i.getRowCount()),autoGenerateColumns:i.autoGenerateColumns,dataSource:this._bindingManager?i.getDataSource():null,frozenRowCount:i.frozenRowCount,frozenColCount:i.frozenColCount,frozenTrailingRowCount:i._frozenTrailingRowCount,frozenTrailingColCount:i._frozenTrailingColCount,rowCount:i.getRowCount(),columnCount:i.getColumnCount(),data:i._dataModel.toJSON(),sparklineGroupManager:i._sparklineGroupManager?i._sparklineGroupManager.toJSON():null,spans:i._spanModel.toJSON(),selections:i._selectionModel.toJSON(),selectionBackColor:i._selectionBackColor,selectionBorderColor:i._selectionBorderColor,activeRow:i._activeRowIndex,activeCol:i._activeColIndex,gridline:i.gridline,allowCellOverflow:i._allowCellOv
erflow,referenceStyle:i.referenceStyle(),_zoomFactor:i._zoomFactor,theme:i.currentTheme(),showRowRangeGroup:i._showRowRangeGroup,showColumnRangeGroup:i._showColumnRangeGroup,rowRangeGroup:i.rowRangeGroup?i.rowRangeGroup.toJSON():null,colRangeGroup:i.colRangeGroup?i.colRangeGroup.toJSON():null,rowFilter:i._rowFilter?i._rowFilter.toJSON():undefined,conditionalFormats:i.getConditionalFormats()?i.getConditionalFormats().toJSON():null,sheetTabColor:i._sheetTabColor,frozenlineColor:i._frozenlineColor,rowHeaderAutoText:i.rowHeaderAutoText,colHeaderAutoText:i.colHeaderAutoText,rowHeaderAutoTextIndex:i.rowHeaderAutoTextIndex,colHeaderAutoTextIndex:i.colHeaderAutoTextIndex,rowHeaderVisible:i.rowHeaderVisible,colHeaderVisible:i.colHeaderVisible,rowHeaderColCount:i.getColumnCount(t.SheetArea.rowHeader),colHeaderRowCount:i.getRowCount(t.SheetArea.colHeader),rowHeaderData:i._rowHeaderModel.toJSON(),colHeaderData:i._colHeaderModel.toJSON(),rowHeaderSpan:i._rowHeaderSpanModel.toJSON(),colHeaderSpan
:i._colHeaderSpanModel.toJSON(),rowHeaderColInfos:i._toArray(i._rowHeaderColInfos,i.getColumnCount(n.spread.SheetArea.rowHeader)),colHeaderRowInfos:i._toArray(i._colHeaderRowInfos,i.getRowCount(n.spread.SheetArea.colHeader)),clipBoardOptions:i._clipBoardOptions,isProtected:i.isProtected,borderColor:i.borderColor,borderWidth:i.borderWidth,allowDragDrop:i._allowDragDrop,allowDragFill:i._allowDragFill,allowUndo:i._allowUndo,allowEditorReservedLocations:i._allowEditorReservedLocations,tableManager:this._tableManager?this._tableManager.toJSON():null,names:null,namedStyles:null},h=[],c,u,f;if(this._namedStyles)for(c in this._namedStyles)h.push(this._namedStyles[c]);e.namedStyles=h,u=[];if(this._names&&this.calcService)for(f in this._names)if(this._names.hasOwnProperty(f)){var r=this._names[f],v=r.getName(),o=r.getRow(),s=r.getColumn(),a=r.getExpression(),l=this.calcService.unparse(a,o,s);u.push({name:v,formula:l,row:o,col:s})}return e.names=u,e},e.prototype.fromJSON=function(r,u){
var ri,yt,ii,h,dt,a,l,ot,gt,pt,ct,vt,kt,bt,y,p,s,it,ut,v,c,et,ft,wt;if(!r)return;arguments.length==1&&(u=!0),ri=this.isPaintSuspended(),this.isPaintSuspended(!0);try{var e=this,ti=r.rowCount,ni=r.columnCount;e._name=r.name,r.defaults&&(e.defaults=r.defaults),e.setRowCount(ti),e.setColumnCount(ni),e.setActiveCell(r.activeRow,r.activeCol),e.setFrozenRowCount(r.frozenRowCount),e.setFrozenColumnCount(r.frozenColCount),e.setFrozenTrailingRowCount(r.frozenTrailingRowCount),e.setFrozenTrailingColumnCount(r.frozenTrailingColCount),e.gridline=r.gridline,e._allowCellOverflow=r.allowCellOverflow,typeof r.autoGenerateColumns!==i&&(e.autoGenerateColumns=r.autoGenerateColumns),r.dataSource&&(yt=this._bindingManager,yt&&yt.bind(r.dataSource)),r.rows&&(e._rowInfos=r.rows,e._rowInfos.length=ti),r.columns&&(e._colInfos=r.columns,e._colInfos.length=ni);if(r.colStyles)for(h in r.colStyles)isNaN(h)||(ii=parseInt(h,10),e.setStyle(-1,ii,r.colStyles[h
],t.SheetArea.viewport));if(r.rowStyles)for(h in r.rowStyles)isNaN(h)||(dt=parseInt(h,10),e.setStyle(dt,-1,r.rowStyles[h],t.SheetArea.viewport));typeof r.rowHeaderAutoText!==i&&(e.rowHeaderAutoText=r.rowHeaderAutoText),typeof r.colHeaderAutoText!==i&&(e.colHeaderAutoText=r.colHeaderAutoText),typeof r.rowHeaderAutoTextIndex!==i&&(e.rowHeaderAutoTextIndex=r.rowHeaderAutoTextIndex),typeof r.colHeaderAutoTextIndex!==i&&(e.colHeaderAutoTextIndex=r.colHeaderAutoTextIndex),typeof r.rowHeaderVisible!==i&&(e.rowHeaderVisible=r.rowHeaderVisible),typeof r.colHeaderVisible!==i&&(e.colHeaderVisible=r.colHeaderVisible),typeof r.rowHeaderColCount!==i&&e.setColumnCount(r.rowHeaderColCount,t.SheetArea.rowHeader),typeof r.colHeaderRowCount!==i&&e.setRowCount(r.colHeaderRowCount,t.SheetArea.colHeader),r.rowHeaderData&&e._rowHeaderModel.fromJSON(r.rowHeaderData),r.colHeaderData&&e._colHeaderModel.fromJSON(r.colHeaderData),r
.rowHeaderSpan&&e._rowHeaderSpanModel.fromJSON(r.rowHeaderSpan),r.colHeaderSpan&&e._colHeaderSpanModel.fromJSON(r.colHeaderSpan),r.rowHeaderColInfos&&(e._rowHeaderColInfos=r.rowHeaderColInfos),r.colHeaderRowInfos&&(e._colHeaderRowInfos=r.colHeaderRowInfos),typeof r._zoomFactor!==i&&(e._zoomFactor=r._zoomFactor),r.spans&&e._spanModel.fromJSON(r.spans),r.selections&&(e._clearSelectionImp(),e._selectionModel.fromJSON(r.selections)),e.referenceStyle(n.spread.ReferenceStyle.A1);if(r.data){e._dataModel.fromJSON(r.data),a=r.data.dataTable;if(u&&a)for(l in a)if(typeof l!==f)for(ot in a[l])typeof ot!==f&&(gt=a[l][ot],pt=gt.formula,pt&&e._setFormulaCore(parseInt(l,10),parseInt(ot,10),pt,!0))}if(u&&r.sparklineGroupManager){ct=e._sparklineGroupManager;if(ct)for(ct.fromJSON(r.sparklineGroupManager),vt=ct.groups(),kt=e._getModel(),c=0;c<vt.length;c++)for(bt=vt[c]._innerList,p=0;p<bt.length;p++)y=bt[p],kt
.setSparkline(y.row,y.column,y)}if(r.theme){s=r.theme;if(typeof s=="string"||typeof s===i)e.currentTheme(s);else{var o=s._themeColor,vi=0,pi=1,bi=2,fi=3,wi=4,ai=5,yi=6,ci=7,li=8,hi=9,oi=10,si=11,k=o._colorList[bi],b=o._colorList[fi],d=o._colorList[vi],nt=o._colorList[pi],g=o._colorList[wi],w=o._colorList[ai],tt=o._colorList[yi],ht=o._colorList[ci],st=o._colorList[li],at=o._colorList[hi],lt=o._colorList[oi],rt=o._colorList[si],ei=new t.ThemeColor(o._name,new t._Color(k.a,k.r,k.g,k.b),new t._Color(b.a,b.r,b.g,b.b),new t._Color(d.a,d.r,d.g,d.b),new t._Color(nt.a,nt.r,nt.g,nt.b),new t._Color(g.a,g.r,g.g,g.b),new t._Color(w.a,w.r,w.g,w.b),new t._Color(tt.a,tt.r,tt.g,tt.b),new t._Color(ht.a,ht.r,ht.g,ht.b),new t._Color(st.a,st.r,st.g,st.b),new t._Color(at.a,at.r,at.g,at.b),new t._Color(lt.a,lt.r,lt.g,lt.b),new t._Color(rt.a,rt.r,rt.g,rt.b)),ui=new t.SpreadTheme(s._name,ei,s._headingFont,s._bodyFont);e.currentTheme(ui)}}typeof r.showRowRangeGroup!==i&&(e._showRowRangeGrou
p=r.showRowRangeGroup),typeof r.showColumnRangeGroup!==i&&(e._showColumnRangeGroup=r.showColumnRangeGroup),r.rowRangeGroup&&e.rowRangeGroup&&e.rowRangeGroup.fromJSON(r.rowRangeGroup),r.colRangeGroup&&e.colRangeGroup&&e.colRangeGroup.fromJSON(r.colRangeGroup),r.rowFilter&&t.features.filter&&(it=new t.HideRowFilter,this._rowFilter=it,it.sheet=e,it.fromJSON(r.rowFilter)),r.conditionalFormats&&t.features.conditionalFormat&&e.getConditionalFormats().fromJSON(r.conditionalFormats),r.sheetTabColor&&e.sheetTabColor(r.sheetTabColor),r.frozenlineColor&&e.frozenlineColor(r.frozenlineColor),typeof r.clipBoardOptions!==i&&(e._clipBoardOptions=r.clipBoardOptions),typeof r.isProtected!==i&&(e.isProtected=r.isProtected),r.borderColor&&(e.borderColor=r.borderColor),typeof r.borderWidth!==i&&(e.borderWidth=r.borderWidth),typeof r.allowDragDrop!==i&&(e._allowDragDrop=r.allowD
ragDrop),typeof r.allowDragFill!==i&&(e._allowDragFill=r.allowDragFill),typeof r.allowUndo!==i&&e.allowUndo(r.allowUndo),typeof r.allowEditorReservedLocations!==i&&e.allowEditorReservedLocations(r.allowEditorReservedLocations);if(u&&r.names){for(ut=0;ut<r.names.length;ut++)v=r.names[ut],this._addCustomNameCore(v.name,v.formula,v.row,v.col,!0);e._rebuildCalcNodes()}if(r.namedStyles)for(c=0;c<r.namedStyles.length;c++)et=r.namedStyles[c],ft=new t.Style,ft.copyFrom(et),typeof et.validator!==i&&(t.features.dataValidator&&(wt=new n.spread.DefaultDataValidator,wt.fromJSON(et.validator)),ft.validator=wt),this._addNamedStyleImp(ft,!1);r.selectionBackColor&&e.selectionBackColor(r.selectionBackColor),r.selectionBorderColor&&e.selectionBorderColor(r.selectionBorderColor),typeof r.tableManager!==i&&e._tableManager&&e._tableManager.fromJSON(r.tableManager),u&&typeof r.referenceStyle!==i&&e.refere
nceStyle(r.referenceStyle)}finally{this.isPaintSuspended(ri)}},e.prototype.formulaFromJSON=function(n){var a=this,c,u,t,r,l,w,p,e,y,b,v,s,o,h;if(n.names)for(c=0;c<n.names.length;c++)u=n.names[c],this._addCustomNameCore(u.name,u.formula,u.row,u.col,!0);if(n.data){t=n.data.dataTable;if(t)for(r in t)if(typeof r!==f)for(l in t[r])typeof l!==f&&(w=t[r][l],p=w.formula,p&&a._setFormulaCore(parseInt(r,10),parseInt(l,10),p,!0))}if(n.sparklineGroupManager){e=a._sparklineGroupManager;if(e)for(e.fromJSON(n.sparklineGroupManager),y=e.groups(),b=a._getModel(),o=0;o<y.length;o++)for(v=y[o]._innerList,h=0;h<v.length;h++)s=v[h],b.setSparkline(s.row,s.column,s)}typeof n.referenceStyle!==i&&a.referenceStyle(n.referenceStyle)},e.prototype._toArray=function(n,t){var r,i;if(!n)return null;for(r=[],i=0;i<t;i++)n[i]!==undefined&&(r[i]=n[i]);return r},e.prototype.isPaintSuspended=function(n){return arguments.length===0?this._paintSuspended:(this._paintSuspended!==
n&&(this._paintSuspended=n,n||this._layoutSuspended>0||(this.invalidateLayout(),this.repaint())),this)},e.prototype.getName=function(){return this._name},e.prototype.setName=function(n){if(!this._isValidSheetName(n))throw t._StringResource.Exp_NotSupport;this._name=n,this.parent&&this.parent._doTabHSResize&&this.parent._doTabHSResize()},e.prototype.allowCellOverflow=function(n){if(arguments.length===0)return this._allowCellOverflow;var t=this;return this._bindToAutoRefresh(function(n){return t._allowCellOverflow=n,t})(n)},e.prototype.allowUndo=function(n){if(arguments.length===0)return this._allowUndo;this._allowUndo=n;var t=this.undoManager();return t&&(t._allowUndo=n),this},e.prototype.allowEditorReservedLocations=function(n){return arguments.length===0?this._allowEditorReservedLocations:(this._allowEditorReservedLocations=n,this)},e.prototype.sheetTabColor=function(n){return arguments.length===0?this._sheetTabColor:(this._sheetTabColor=n,this.pa
rent&&this.parent._doTabHSResize&&this.parent._doTabHSResize(),this)},e.prototype.frozenlineColor=function(n){if(arguments.length===0)return this._frozenlineColor;var t=this;return this._bindToAutoRefresh(function(n){return n&&(t._frozenlineColor=n),t})(n)},e.prototype.addRows=function(n,i){var u,h,r,s,o,e,c,f;if(i<=0)return;u=this.getDataSource();if(u&&t._BindingManager.isDataViewSource(u)){if(!u.canAdd||!u.canAdd())return;n=this.getRowCount()}h=this.isPaintSuspended(),this.isPaintSuspended(!0);try{(n<0||n>this.getRowCount())&&(n=this.getRowCount()),r=this._getSheetSource();if(r)r.onBeforeAddRemoveRows(n);s=this._getModel(),s.addElements(this._rowInfos,this.getRowCount(),n,i),s.addRows(n,i),o=this._bindingManager,o&&o.addItems(n,i),e=this._getCalcModel(),e&&e.addRows(n,i),c=this._getModel(t.SheetArea.rowHeader),c.addRows(n,i),f=this._getSpanModel(t.SheetArea.rowHeader),f.addRows(n,i),f=this._getSpanModel(),f.addRows(n
,i),this._rowFilter&&this._rowFilter._addRows(n,i),this.rowRangeGroup&&this.rowRangeGroup._add(n,i),this._sparklineGroupManager&&this._sparklineGroupManager._addRows(n,i),this._conditionalFormats&&this._conditionalFormats._addRows(n,i),this._tableManager&&this._tableManager.addRows(n,i);if(r)r.onAfterAddRows(n,i);this._syncScrollbarSize(),this.invalidateLayout()}finally{this.isPaintSuspended(h)}},e.prototype._onDataDeleted=function(n){},e.prototype.deleteRows=function(n,i){var f,w,h,u,k,v,b,c,g,r,p,y,a,d,l,s,e,o;if(0>n||n>=this.getRowCount()||i<=0)return;f=this.getDataSource();if(f&&t._BindingManager.isDataViewSource(f))if(!f.canRemove||!f.canRemove())return;w=this.isPaintSuspended(),this.isPaintSuspended(!0);try{h=this._getSheetSource();if(h)h.onBeforeAddRemoveRows(n);u=this._getModel(),this.autoUpdate&&this.dataContext&&this.dataContext.remove&&f&&f.length>0&&(k=this,this._dataDelet
eDelegate=function(n){return k._onDataDeleted(n)},v=n,v<0||(b=this.getDataItem(v),$.ajax({url:this.dataContext.remove,type:lt,data:JSON.stringify(b),dataType:ut,contentType:it,success:this._dataDeleteDelegate}))),this.deletedRows||(this.deletedRows=[]),c=this._bindingManager;if(c){for(g=c.getRowCount(),r=0;r<i&&n+r<u.rowCount;r++)p=null,n+r<g&&(p=c.getDataItem(n+r)),y=null,u.dataTable&&u.dataTable[n+r]&&(y=u.dataTable[n+r].key),this.deletedRows.push({row:n+r,data:p,key:y});c.removeItems(n,i)}u.deleteElements(this._rowInfos,this.getRowCount(),n,i),u.deleteRows(n,i),a=this._getCalcModel(),a&&a.deleteRows(n,i),d=this._getModel(t.SheetArea.rowHeader),d.deleteRows(n,i),l=this._getSpanModel(t.SheetArea.rowHeader),l.removeRows(n,i),l=this._getSpanModel(),l.removeRows(n,i),this._rowFilter&&this._rowFilter._removeRows(n,i),this.rowRangeGroup&&this.rowRangeGroup._remove(n,i),this._sparklineGroupManager&&this._sparklin
eGroupManager._removeRows(n,i),this._conditionalFormats&&this._conditionalFormats._removeRows(n,i),this._tableManager&&this._tableManager.removeRows(n,i),s=this._scrollTopRow;if(s>=0){for(e=-1,o=s;o>=this.frozenRowCount;o--)if(this.getRowVisible(o)&&this._getZoomRowHeight(o)>0){e=o;break}e===-1&&(e=0),s!==e&&(this._trigger(t.Events.TopRowChanged,{sheet:this,sheetName:this._name,oldTopRow:s,newTopRow:e}),this._scrollTopRow=e,this._syncVScrollbarPosition())}if(h)h.onAfterRemoveRows(n,i);this._syncScrollbarSize(),this.invalidateLayout()}finally{this.isPaintSuspended(w)}},e.prototype.addColumns=function(n,i){if(i<=0)return;this._bindToAutoRefresh(function(n,i){var r,f,e,o,u;(n<0||n>this.getColumnCount())&&(n=this.getColumnCount());if(this.parent&&this.parent.gcSpreadsheet)return;r=this._getSheetSource();if(r)r.onBeforeAddRemoveColumns(n);f=this._getModel(),f.addElements(this._colInfos,this.getColumnCount(),n,i),f.
addColumns(n,i),e=this._getCalcModel(),e&&e.addColumns(n,i),o=this._getModel(t.SheetArea.colHeader),o.addColumns(n,i),u=this._getSpanModel(t.SheetArea.colHeader),u.addColumns(n,i),u=this._getSpanModel(),u.addColumns(n,i),this._rowFilter&&this._rowFilter._addColumns(n,i),this._allowCellOverflow===!0&&this._clearCellOverflowModelCache(),this.colRangeGroup&&this.colRangeGroup._add(n,i),this._sparklineGroupManager&&this._sparklineGroupManager._addColumns(n,i),this._conditionalFormats&&this._conditionalFormats._addColumns(n,i),this._tableManager&&this._tableManager.addColumns(n,i);if(r)r.onAfterAddColumns(n,i);this._syncScrollbarSize(),this.invalidateLayout()})(n,i)},e.prototype.deleteColumns=function(n,i){if(0>n||n>=this.getColumnCount()||i<=0)return;if(this.parent&&this.parent.gcSpreadsheet)return;this._bindToAutoRefresh(function(n,i){var e=this._getSheetSource(),h,s,c,o,f,r,u;if(e)e.onBeforeAddRemoveColumns(n);h=
this._getModel(),h.deleteElements(this._colInfos,this.getColumnCount(),n,i),h.deleteColumns(n,i),s=this._getCalcModel(),s&&s.deleteColumns(n,i),c=this._getModel(t.SheetArea.colHeader),c.deleteColumns(n,i),o=this._getSpanModel(t.SheetArea.colHeader),o.removeColumns(n,i),o=this._getSpanModel(t.SheetArea.viewport),o.removeColumns(n,i),this._rowFilter&&this._rowFilter._removeColumns(n,i),this._allowCellOverflow===!0&&this._clearCellOverflowModelCache(),this.colRangeGroup&&this.colRangeGroup._remove(n,i),this._sparklineGroupManager&&this._sparklineGroupManager._removeColumns(n,i),this._conditionalFormats&&this._conditionalFormats._removeColumns(n,i),this._tableManager&&this._tableManager.removeColumns(n,i),f=this._scrollLeftCol;if(f>=0){for(r=-1,u=f;u>=this.frozenColCount;u--)if(this.getColumnVisible(u)&&this._getZoomColumnWidth(u)>0){r=u;break}r===-1&&(r=0),f!==r&&(this._trigger(t.Events.LeftColumnC
hanged,{sheet:this,sheetName:this._name,oldLeftCol:f,newLeftCol:r}),this._scrollLeftCol=r,this._syncHScollbarPosition())}if(e)e.onAfterRemoveColumns(n,i);this._syncScrollbarSize(),this.invalidateLayout()})(n,i)},e.prototype.setFrozenCount=function(n,t){(n===undefined||n===null||n<0||isNaN(n))&&(n=0),(t===undefined||t===null||t<0||isNaN(t))&&(t=0),this._bindToAutoRefresh(function(n,t){var i=!1;this.frozenRowCount!==n&&(this._scrollTopRow+=n-this.frozenRowCount,this.frozenRowCount=n,i=!0),this.frozenColCount!==t&&(this._scrollLeftCol+=t-this.frozenColCount,this.frozenColCount=t,i=!0),i&&(this.invalidateLayout(),this._syncScrollbarSize())})(n,t)},e.prototype.setFrozenColumnCount=function(n){(n===undefined||n===null||n<0||isNaN(n))&&(n=0),this._bindToAutoRefresh(function(n){this.frozenColCount!==n&&(this._scrollLeftCol+=n-this.frozenColCount,this.frozenColCount=n,this._syncScrollbarSize())})(n)},e.prototype.setFrozenRowCou
nt=function(n){(n===undefined||n===null||n<0||isNaN(n))&&(n=0),this._bindToAutoRefresh(function(n){this.frozenRowCount!==n&&(this._scrollTopRow+=n-this.frozenRowCount,this.frozenRowCount=n,this._syncScrollbarSize())})(n)},e.prototype.setFrozenTrailingRowCount=function(n){(n===undefined||n===null||n<0||isNaN(n))&&(n=0);var t=this;t._bindToAutoRefresh(function(n){t._frozenTrailingRowCount!==n&&(t._frozenTrailingRowCount=n,this._syncScrollbarSize())})(n)},e.prototype.setFrozenTrailingColumnCount=function(n){(n===undefined||n===null||n<0||isNaN(n))&&(n=0);var t=this;t._bindToAutoRefresh(function(n){t._frozenTrailingColCount!==n&&(t._frozenTrailingColCount=n,this._syncScrollbarSize())})(n)},e.prototype.getRowCount=function(n){var t=this._getModel(n);return t?t.rowCount:0},e.prototype.getColumnCount=function(n){var t=this._getModel(n);return t?t.colCount:0},e.prototype.setRowCount=function(n,i){n=parseInt(n,10);if(isNaN(n))return;if
(n<0)return;this._bindToAutoRefresh(function(n,i){(i===undefined||i===null)&&(i=t.SheetArea.viewport);if(i===t.SheetArea.viewport||i===t.SheetArea.rowHeader)this._dataModel.rowCount>n&&this.deleteRows(n,this._dataModel.rowCount-n),this._dataModel.rowCount=this._rowHeaderModel.rowCount=n,this._calcDataModel&&(this._calcDataModel.rowCount=n),this.frozenRowCount>n&&this.setFrozenRowCount(n),this._rowInfos||(this._rowInfos={}),this.rowRangeGroup&&this.rowRangeGroup._setCount(n);else if(i===t.SheetArea.colHeader){this._colHeaderRowInfos||(this._colHeaderRowInfos={});var r=this._colHeaderModel;r.rowCount>n&&r.deleteElements(this._colHeaderRowInfos,r.rowCount,n,r.rowCount-n),r.rowCount=n}this.rowRangeGroup&&this.rowRangeGroup.refresh(),this._syncScrollbarSize(),this._activeRowIndex<n||i!==t.SheetArea.viewport&&i!==t.SheetArea.rowHeader||(this._clearSelectionImp(),this._setActiveCellImp(-1,-1,this.activeRowViewpo
rtIndex,this.activeColViewportIndex))})(n,i)},e.prototype.setColumnCount=function(n,i){n=parseInt(n,10);if(isNaN(n))return;if(n<0)return;this._bindToAutoRefresh(function(n,i){(i===undefined||i===null)&&(i=t.SheetArea.viewport);if(i===t.SheetArea.viewport||i===t.SheetArea.colHeader)this._dataModel.colCount>n&&this.deleteColumns(n,this._dataModel.colCount-n),this._dataModel.colCount=this._colHeaderModel.colCount=this._colFooterModel.colCount=n,this._calcDataModel&&(this._calcDataModel.colCount=n),this.frozenColCount>n&&this.setFrozenColumnCount(n),this._colInfos||(this._colInfos={}),this.colRangeGroup&&this.colRangeGroup._setCount(n);else if(i===t.SheetArea.rowHeader){this._rowHeaderColInfos||(this._rowHeaderColInfos={});var r=this._rowHeaderModel;r.colCount>n&&r.deleteElements(this._rowHeaderColInfos,r.colCount,n,r.colCount-n),r.colCount=n}this.colRangeGroup&&this.colRangeGroup.refresh(),this._syncScrollbarSize(),thi
s._activeColIndex<n||i!==t.SheetArea.viewport&&i!==t.SheetArea.colHeader||(this._clearSelectionImp(),this._setActiveCellImp(-1,-1,this.activeRowViewportIndex,this.activeColViewportIndex))})(n,i)},e.prototype.getText=function(n,i,r){var u;(r===undefined||r===null)&&(r=t.SheetArea.viewport),u=this.getValue(n,i,r);if(u===undefined||u===null)return"";else{var o=this.getCellType(n,i,r),f=this.getActualStyle(n,i,r),e=f.formatter?f.formatter:f._autoFormatter;return u=o.format(u,e)}},e.prototype.setText=function(n,i,r,u){this._bindToAutoRefresh(function(n,i,r,u){(u===undefined||u===null)&&(u=t.SheetArea.viewport);var o=r,e=this.getCellType(n,i,u),f=this.getCell(n,i,u).formatter();e&&f&&(o=e.parse(r,f)),this.setValue(n,i,o,u)})(n,i,r,u)},e.prototype.getValue=function(n,i,r){var e,u,f,h,o,s;return(r===undefined||r===null)&&(r=t.SheetArea.viewport),e=this._getModel(r),e?(u=this._getValueImp(e,n,i,r),h=window.ko,r===t.SheetArea.colHea
der?(u===undefined||u===null)&&(o=this.getDataSource(),o&&(t._BindingManager.isDataViewSource(o)||o.length>0||h&&h.isObservable(o))&&(s=this._colInfos[i],s&&(this.colHeaderAutoTextIndex>=0&&n===this.colHeaderAutoTextIndex||this.colHeaderAutoTextIndex===-1&&n===e.rowCount-1)&&(u=s.displayName||s.name)),(u===undefined||u===null)&&(f=this.colHeaderAutoTextIndex,(f<0||f>=e.rowCount)&&(f=e.rowCount-1),n===f&&(this.colHeaderAutoText===t.HeaderAutoText.letters?u=this._indexToLetters(i+1):this.colHeaderAutoText===t.HeaderAutoText.numbers&&(u=i+1)))):r===t.SheetArea.rowHeader&&(u===undefined||u===null)&&(f=this.rowHeaderAutoTextIndex,(f<0||f>=e.colCount)&&(f=e.colCount-1),i===f&&(this.rowHeaderAutoText===t.HeaderAutoText.letters?u=this._indexToLetters(n+1):this.rowHeaderAutoText===t.HeaderAutoText.numbers&&(u=n+1))),u):null},e.prototype.set
Value=function(n,i,r,u,f){this._bindToAutoRefresh(function(n,i,r,u,f){var o,l,a,e,h,v,s,c;(u===undefined||u===null)&&(u=t.SheetArea.viewport),o=this._getModel(u);if(!o)return;l=o.rowCount,a=o.colCount;if(n<0||n>=l||i<0||i>=a)return;r!==undefined&&r!==null&&r.constructor===Date&&(r="/OADate("+new t._DateTimeHelper(r).toOADate()+")/");if(u===t.SheetArea.viewport&&this._tableManager){e=this._tableManager.find(n,i);if(e)if(e.showHeader()&&n===e.headerIndex()){if(e._hasColumnName(r))return;e._setHeader(n,i,r)}else e.showFooter()&&n===e.footerIndex()&&e._setFooterValue(n,i,r)}h=this._getValueImp(o,n,i,u),v=window.ko,u===t.SheetArea.viewport?(s=!1,c=this._bindingManager,c&&(s=c.setValue(n,i,r)),(!s||this.checkingChanges)&&(o.setValue(n,i,r),this._activeRowDirty=!0)):o.setValue(n,i,r),u!==undefined&&u!==null&&u!==t.SheetArea.viewport||f||this._recalcCell(o,n,i),thi
s._allowCellOverflow&&this._clearCellOverflowModelCachebyRow(n,u),this._conditionalFormats&&this._conditionalFormats._clearCache(),h!==r&&this._trigger(t.Events.CellChanged,{sheet:this,sheetName:this._name,row:n,col:i,sheetArea:u,propertyName:w,_oldValue:h})})(n,i,r,u,f)},e.prototype.sortRange=function(n,i,u,f,e,o){return this._bindToAutoRefresh(function(n,i,u,f,e,o){var ct=this.isPaintSuspended(),st,rt,ot,b,k,s,h,p,y,ut,et,ft,g,d,tt,it;this.isPaintSuspended(!0);try{st=this.getSpans(new t.Range(n,i,u,f));if(st&&st.length>0)return!1;rt=this.getRowCount(),ot=this.getColumnCount(),n===-1&&(n=0),u===-1&&(u=rt),i===-1&&(i=0),f===-1&&(f=ot);if(n<0||n>=rt||i<0||i>=ot||u<0||n+u>rt||f<0||i+f>ot||!o)return!1;ut=this._quickSort(n,i,u,f,e,o);if(ut){var ht=this._getModel(),c=this._getCalcModel(),v=this._getSheetSource(),nt,a,l;if(e)for(k=n;k<n+u;k++){nt=this._getSwapIndex(ut,n,k);if(k===nt)continue;for(
s=k,p=nt,b=i;b<i+f;b++)h=b,et=this.getValue(s,h),ft=this.getValue(p,h),c&&v&&(g=v._getCellCalc(s,h,!1),g&&g.hasListeners()&&g.addListenersToAdjust(),d=v._getCellCalc(p,h,!1),d&&d.hasListeners()&&d.addListenersToAdjust(),c.swapNode(s,h,p,h),a=r._copyExpression(c.getFormula(s,h),s,h),c.setFormula(s,h,a),l=v._getCellCalc(s,h,!!a),l&&l.startListening(),a=r._copyExpression(c.getFormula(p,h),p,h),c.setFormula(p,h,a),l=v._getCellCalc(p,h,!!a),l&&l.startListening(),v._controller.adjustFormulasOnSwap(c,s,h,c,p,h,1,1)),ht.swapNode(s,h,p,h),this.setValue(s,h,ft),this.setValue(p,h,et)}else for(b=i;b<i+f;b++){nt=this._getSwapIndex(ut,i,b);if(b===nt)continue;for(h=b,y=nt,k=n;k<n+u;k++)s=k,et=this.getValue(s,h),ft=this.getValue(s,y),c&&v&&(g=v._getCellCalc(s,h,!1),g&&g.hasListeners()&&g.addListenersToAdjust(),d=v._getCellCalc(s,y,!1),d&&d.hasListeners()&&d.addListenersToAdjust()
,c.swapNode(s,h,s,y),a=r._copyExpression(c.getFormula(s,h),s,h),c.setFormula(s,h,a),l=v._getCellCalc(s,h,!!a),l&&l.startListening(),a=r._copyExpression(c.getFormula(s,y),s,y),c.setFormula(s,y,a),l=v._getCellCalc(s,y,!!a),l&&l.startListening(),v._controller.adjustFormulasOnSwap(c,s,h,c,s,y,1,1)),ht.swapNode(s,h,s,y),this.setValue(s,h,ft),this.setValue(s,y,et)}return!0}return!1}finally{for(this.resumeCalcService(),this.resumeEvent(),tt=0;tt<u;tt++)for(it=0;it<f;it++)this._raiseCellChanged(w,n+tt,i+it,t.SheetArea.viewport);this._raisePropertyChanged("[sort]"),this.isPaintSuspended(ct)}})(n,i,u,f,e,o)},e.prototype.getActualStyle=function(n,t,i,r){return this.getActualStyleCore(n,t,i,r)},e.prototype.getActualStyleCore=function(n,i,r,u,f){var e,v,h,c,a,l,s;(r===undefined||r===null)&&(r=t.SheetArea.viewport),e=new t.Style,v=f?f:this.getCompositeStyle(n,i,r);if(r===t.SheetArea.viewport)if(!u){h=v.formatter,h&&h.HasFormatedColor&&h.HasF
ormatedColor()&&(c={value:null},h.Format(this.getValue(n,i),c),c.value&&(e.foreColor=c.value)),a=this._conditionalFormats;if(t.features.conditionalFormat&&a&&a.count()>0){var y=a.getRules(n,i),p=y.length,o=null;if(p>0)for(y.sort(function(n,t){return n.priority()-t.priority()}),l=0;l<p;l++){s=y[l];if(s){s.isScaleRule()?(s instanceof t.TwoScaleRule||s instanceof t.ThreeScaleRule)&&(o=s.evaluate(this,n,i,this.getValue(n,i,r)),o&&!e.backColor&&(e.backColor=o)):(o=s.evaluate(this,n,i,this.getValue(n,i,r)),o!==null&&o!==undefined&&e.compose(o));if(s.stopIfTrue())if(o)break}}}}return e.compose(v),(e.locked===undefined||e.locked===null)&&(e.locked=!0),e._normalize(new t._ThemeContext(this))},e.prototype.getStyle=function(n,i,r){var o,u,e,f;(r===undefined||r===null)&&(r=t.SheetArea.viewport),o=this._getModel(r);if(o){u=o.getStyle(n,i);if(u instanceof t.Style)return u;else if(typeof u=="strin
g"){e=this._name2Style(u);if(e!==null)return f=new t.Style,f.compose(e),f}}return null},e.prototype.addNamedStyle=function(n){this._addNamedStyleImp(n,!1)},e.prototype._addNamedStyleImp=function(n,i){if(n!==null&&n!==undefined){if(n.name===null||n.name===undefined||n.name==="")throw new Error(t._StringResource.Exp_EmptyNamedStyle);if(i)this._bindToAutoRefresh(function(n){var t=n.name.toUpperCase();this._namedStyles[t]=n})(n);else{var r=n.name.toUpperCase();this._namedStyles[r]=n}}},e.prototype.getNamedStyle=function(n){if(this._namedStyles&&n!==undefined&&n!=null&&n!==""){n=n.toUpperCase();if(this._namedStyles.hasOwnProperty(n)&&this._namedStyles[n])return this._namedStyles[n]||null}return null},e.prototype.removeNamedStyle=function(n){this._namedStyles&&n!==undefined&&n!=null&&n!==""&&(n=n.toUpperCase(),this._namedStyles.hasOwnProperty(n)&&(delete this._namedStyles[n],
this._bindToAutoRefresh(function(){})()))},e.prototype.setStyle=function(n,t,i,r){this.setStyleObject(n,t,i,r)},e.prototype.getStyleObject=function(n,i,r){(r===undefined||r===null)&&(r=t.SheetArea.viewport);var u=null,f=this._getModel(r);if(f){u=f.getStyle(n,i);if(u!==undefined&&u!==null)return u}return null},e.prototype.setStyleObject=function(n,i,r,u){this._bindToAutoRefresh(function(n,i,r,u){var s,e,o;(u===undefined||u===null)&&(u=t.SheetArea.viewport),s=this._getModel(u),s&&(s.setStyle(n,i,r),r&&r.formatter&&t.features.formatter&&(e=r.formatter,typeof e===c&&(e=new t.GeneralFormatter(e)),e&&typeof e.Init===f&&e.Init()),o="[styleinfo]",n!==-1&&i!==-1?this._trigger(t.Events.CellChanged,{sheet:this,sheetName:this._name,row:n,col:i,sheetArea:u,propertyName:o}):n!==-1&&i===-1?this._trigger(t.Events.RowChanged,{sheet:this,sheetName:this._name,row:n,sheetArea:u,propertyName:o}):n==
=-1&&i!==-1&&this._trigger(t.Events.ColumnChanged,{sheet:this,sheetName:this._name,col:i,sheetArea:u,propertyName:o})),this._allowCellOverflow&&(u===t.SheetArea.colHeader||n===-1?this._clearCellOverflowModelCache():(u===t.SheetArea.viewport||i===-1)&&this._clearCellOverflowModelCachebyRow(n,u))})(n,i,r,u)},e.prototype.getDefaultStyle=function(n){var r,i,u;return(n===undefined||n===null)&&(n=t.SheetArea.viewport),r=this._getModel(n),r?(i=r.getStyle(-1,-1),typeof i=="string"&&(i=this._name2Style(i)),i||(i=new t.Style,r.setStyle(-1,-1,i)),u=n===t.SheetArea.colHeader||n===t.SheetArea.rowHeader,i.foreColor||(i.foreColor="black"),i.hAlign===undefined&&(i.hAlign=u?t.HorizontalAlign.center:t.HorizontalAlign.general),i.vAlign===undefined&&(i.vAlign=u?t.VerticalAlign.center:t.VerticalAlign.top),i):null},e.prototype.setDefaultStyle=function(n,i){(i===undefined||i===null)&&(i=t.SheetArea.viewport);var r=
this._getModel(i);r&&r.setStyle(-1,-1,n)},e.prototype._name2Style=function(n){var i=this.getNamedStyle(n),t;if(i)return i;return t=this.parent,t&&t.getNamedStyle?t.getNamedStyle(n):null},e.prototype._composeStyle=function(n,i){var f=new t.Style,r=null,u;for(n instanceof t.Style?(f.compose(n),r=this._name2Style(n.parent)):typeof n=="string"&&(u=this._name2Style(n),u!==null&&(f.compose(u),r=this._name2Style(u.parentName)));r!==null&&r!==undefined;r=this._name2Style(r.parentName))f.compose(r);i.compose(f)},e.prototype.getCompositeStyle=function(n,i,r){var a,l,f,c,s,h;(r===undefined||r===null)&&(r=t.SheetArea.viewport);var e=new t.Style,o=!1,u=this._getModel(r);return u&&(a=u.rowCount,l=u.colCount,0<=n&&n<a&&0<=i&&i<l&&(c=u.getStyle(n,i),c&&(this._composeStyle(c,e),o=!0)),this._tableManager&&this._tableManager.getCount()>0&&r===t.SheetArea.viewport&
;&(s=this._tableManager.find(n,i),s&&(s._compose(n,i,e),o=!0)),0<=n&&n<a&&(f=u.getStyle(n,-1),f&&(this._composeStyle(f,e),o=!0)),0<=i&&i<l&&(f=u.getStyle(-1,i),f&&(this._composeStyle(f,e),o=!0))),h=this.getDefaultStyle(r),h&&(this._composeStyle(h,e),o=!0),e},e.prototype.getCellType=function(n,t,i){var r=this.getActualStyle(n,t,i);return this.getCellTypeCore(r,i)},e.prototype.getCellTypeCore=function(n,i){return n&&n.cellType?n.cellType:(this._defaultCellType||(this._defaultCellType=new t.TextCellType),i===t.SheetArea.corner?new t.CornerCellType:i===t.SheetArea.colHeader?new t.ColumnHeaderCellType:i===t.SheetArea.rowHeader?new t.RowHeaderCellType:this._defaultCellType)},e.prototype.setCellType=function(n,i,r,u){var f=this.getStyle(n,i,u);f||(f=new t.Style),f.cellType=r,this.setStyle(n,i,f,u)},e.prototype.getFormatter=function(n,t,i){var r=this.getActualStyle(n,t,i);return r?r.formatter:undefined},
e.prototype.setFormatter=function(n,i,r,u){var f=this.getStyle(n,i,u);f||(f=new t.Style),f.formatter=r,this.setStyle(n,i,f,u)},e.prototype.getDataValidator=function(n,t,i){var r=this.getActualStyle(n,t,i);return r?r.validator:undefined},e.prototype.setDataValidator=function(n,i,r,u){var f,o,e;(u===undefined||u===null)&&(u=t.SheetArea.viewport),f=this.getStyle(n,i,u),f||(f=new t.Style),f.validator=r,this.setStyle(n,i,f,u),t.features.conditionalFormat&&r&&(r.condition instanceof t.FormulaCondition&&(r.condition._baseRow===undefined||r.condition._baseRow===null)&&(r.condition._baseRow=n!==-1?n:0),r.condition instanceof t.FormulaCondition&&(r.condition._baseCol===undefined||r.condition._baseCol===null)&&(r.condition._baseCol=i!==-1?i:0)),o=t.Events,e="validator",this._trigger(o.CellChanged,{sheet:this,sheetName:this._name,row:n,col:i,sheetArea:u,propertyName:e}),n!==-1&&i===-1?this._trigger(o.RowChanged,{sheet:thi
s,sheetName:this._name,row:n,sheetArea:u,propertyName:e}):n===-1&&i!==-1&&this._trigger(o.ColumnChanged,{sheet:this,sheetName:this._name,col:i,sheetArea:u,propertyName:e})},e.prototype.isValid=function(n,t,i){try{this._validatingRow=n,this._validatingColumn=t,this._validatingValue=i,this._isValidatingCell=!0;var r=this.getDataValidator(n,t);if(r)return r.isValid(this,n,t,i)}finally{this._validatingRow=-1,this._validatingColumn=-1,this._validatingValue=null,this._isValidatingCell=!1}return!0},e.prototype.addSelection=function(n,i,r,u){this._bindToAutoRefresh(function(n,i,r,u){var o=n,s=i,c=r,h=u,e,f;o!==-1&&s!==-1&&(e=this._getSpanModel().slice(0),e&&e.length>0&&(f=this._cellRangeInflate(e,new t.Range(n,i,r,u)),o=f.row,s=f.col,c=f.rowCount,h=f.colCount)),this._selectionModel.add(o,s,c,h)})(n,i,r,u)},e.prototype.setSelection=function(n,t,i,r){var e=this.getRowCount(),o=this.getColumnCount(),u,f;n<e||(n=e-1),u=n,u<0&&(u=0
),f=t,t<o||(t=o-1),f<0&&(f=0),this._clearSelectionImp(),this._setActiveCellImp(u,f),this.addSelection(n,t,i,r)},e.prototype.getSelections=function(){return this._selectionModel},e.prototype._addSpanImp=function(n,i,r,u,f){this._bindToAutoRefresh(function(n,i,r,u,f){var h,c,l,s,o,e;(f===undefined||f===null)&&(f=t.SheetArea.viewport),h=this._getSpanModel(f),h.clear(n,i,r,u),c=new t.Range(n,i,r,u),l=this._getActualRange(c,f),h.push(l);if(this._allowCellOverflow)for(s=n;s<n+r;s++)this._clearCellOverflowModelCachebyRow(s,f);for(o=this.getSelections(),e=0;e<o.length;e++)o[e].intersect(n,i,r,u)&&(o[e]=o[e].union(c))})(n,i,r,u,f)},e.prototype.addSpan=function(n,i,r,u,f){var o,e;if(r===1&&u===1)return;if(f===t.SheetArea.corner)return;var c=this._getSpanModel(f),h=c.getEnumerator(n,i,r,u),s=!0;while(h.moveNext()){o=h.current(),e=new t.Range(n,i,r,u);if(!e.containsRange(o)){s=!1;break}}if(!s)throw new Error(t._StringResource.Exp_InvalidRange);this._a
ddSpanImp(n,i,r,u,f)},e.prototype.removeSpan=function(n,i,r){this._bindToAutoRefresh(function(n,i,r){var o,f,u,e;for((r===undefined||r===null)&&(r=t.SheetArea.viewport),o=this._getSpanModel(r),f=0;f<o.length;f++){u=o[f];if(u.row===n&&u.col===i){o.splice(f,1);if(this._allowCellOverflow)for(e=u.row;e<u.row+u.rowCount;e++)this._clearCellOverflowModelCachebyRow(e,r);return}}})(n,i,r)},e.prototype.repaint=function(n){this._paintSuspended||this._render.repaint(n)},e.prototype.startEdit=function(n,t){this._startEditImp(this._getCanvas(),this._activeRowIndex,this._activeColIndex,null,null,n,t)},e.prototype.editorStatus=function(){return this._editorStatus?this._editorStatus:t.EditorStatus.Ready},e.prototype.isEditing=function(){return this._editorStatus===t.EditorStatus.Enter||this._editorStatus===t.EditorStatus.Edit},e.prototype.doKeyDown=function(n){this._eventHandler.doKeyDown(n)},e.prototype.doKeyUp=function(n){this._eventHandler.doKeyUp(n)},e.prototype.doCompositi
onStart=function(){this._eventHandler.doCompositionStart()},e.prototype.removeKeyMap=function(n,t,i,r,u){var e,f;if(!this.keyMap)return;for(e=0;e<this.keyMap.length;e++){f=this.keyMap[e];if(f&&f.key===n&&f.ctrl===t&&f.shift===i&&f.alt===r){this.keyMap.splice(e,1);break}}},e.prototype.addKeyMap=function(n,i,r,u,f){this.keyMap||(this.keyMap=[]);var e=this._getKeyAction(n,i,r,u);e?e.action=f:this.keyMap.push(new t.KeyMap(n,i,r,u,f))},e.prototype.moveActiveCell=function(n,i,r,u,f,e){var s={sheet:this,sheetName:this._name,row:this._activeRowIndex,col:this._activeColIndex,cancel:!1},h,c,o;return this._trigger(t.Events.LeaveCell,s),s&&s.cancel===!0?!1:this.endEdit()?(this._activeRowDirty&&(this.updateRecord(),this._activeRowDirty=!1),h=this._activeRowIndex,c=this._activeColIndex,(r===undefined||r===null)&&(r=this._activeRowIndex),(u===undefined||u===null)&&(u=this._activeColIndex),o=t.Direction,n===o.left?this._moveActiveCe
llLeft(r,u,i,!1,!1):n===o.right?this._moveActiveCellRight(r,u,i,!1,!1):n===o.up?this._moveActiveCellUp(r,u,i,!1,!1):n===o.down&&this._moveActiveCellDown(r,u,i,!1,!1),f=this.moveActiveCellEnd(n,h,c,f,e)):!1},e.prototype._moveActiveCellInSelection=function(n){var i={sheet:this,sheetName:this._name,row:this._activeRowIndex,col:this._activeColIndex,cancel:!1},u,r;this._trigger(t.Events.LeaveCell,i);if(i&&i.cancel===!0)return;this.endEdit(),this._activeRowDirty&&(this.updateRecord(),this._activeRowDirty=!1),u=this._activeRowIndex,r=this._activeColIndex,n===t.Direction.left?this._moveActiveCellLeftInSelection(this._activeRowIndex,this._activeColIndex):n===t.Direction.right&&this._moveActiveCellRightInSelection(this._activeRowIndex,this._activeColIndex),this.moveActiveCellEnd(n,u,r)},e.prototype.doDataItemChanged=function(){var n=this._bindingManager;n&&n.doDataItemChanged()},e.prototype.moveActiveCellEnd=function(n,i,r,u,f){var rt=this._selectionMod
el.toArray(),y,l,p,w,nt,tt,ft,k,v,a,h,o,d;this.shift||this._isNavigateInSelection||(y=this._fixRange(this._getActiveSelectedRange()),(this._selectionModel.length>1||y.rowCount>1||y.colCount>1)&&(u=!0),this._clearSelectionImp()),l=this._spanModel.find(this._activeRowIndex,this._activeColIndex),l?(this._activeRowCount=l.rowCount,this._activeColCount=l.colCount):(this._activeRowCount=1,this._activeColCount=1);if(!this._isNavigateInSelection){var e=this._getExtendedRange(this._activeRowIndex,this._activeColIndex),ut=this.selectionPolicy(),it=this.selectionUnit();ut===t.SelectionPolicy.Single?this._selectionModel.clear():ut===t.SelectionPolicy.Range&&this._selectionModel.clear(),it===t.SelectionUnit.Row?(e.col=-1,e.colCount=-1):it===t.SelectionUnit.Column&&(e.row=-1,e.rowCount=-1),this._replaceActiveSelectedRange(e.row,e.col,e.rowCount,e.colCount,!1),p=this._selectionModel.toArray(),this._eventHandler._notEqualSelecions(rt,p)&&(w=t.Events,this._tr
igger(w.SelectionChanging,{sheet:this,sheetName:this._name,oldSelections:rt,newSelections:p}),this._trigger(w.SelectionChanged,{sheet:this,sheetName:this._name}))}nt=this.frozenColCount?this._getNextVisualColumn(this.frozenColCount-1):this._getFirstVisualColumn(),tt=this.frozenRowCount?this._getNextVisualRow(this.frozenRowCount-1):this._getFirstVisualRow(),this._activeColIndex<this._scrollLeftCol&&this._activeColIndex>=nt&&(f=this._setLeftColumn(this._getPrevVisualColumn(this._activeColIndex+1))||f);if(this._activeColIndex>this._getLastFullyVisibleColumn()&&this._activeColIndex<=this._getLastVisualColumn()){var ot=0,s=this._activeColIndex,st=this._getSheetLayout();while(s>this._scrollLeftCol){ot+=this._getZoomColumnWidth(s);if(ot>st.viewportWidth)break;s--}ft=this._getNextVisualColumn(s),f=this._setLeftColumn(ft)||f}this._activeRowIndex<this._scrollTopRow&&this._activeRowIndex>=tt&&(f=this._setTopRow(this._getPrevVisual
Row(this._activeRowIndex+1))||f);if(this._activeRowIndex>this._getLastFullyVisibleRow()&&this._activeRowIndex<=this._getLastVisualRow()){var et=0,c=this._activeRowIndex,ct=this._getSheetLayout();while(c>this._scrollTopRow){et+=this._getZoomRowHeight(c);if(et>ct.viewportHeight)break;c--}k=this._getNextVisualRow(c),f=this._setTopRow(k)||f}this._activeRowIndex===this._getLastVisualRow()&&(f=this._setTopRow(this._getLastPageTopRow())||f),this._activeColIndex===this._getLastVisualColumn()&&(f=this._setLeftColumn(this._getLastPageLeftColumn())||f),i!=this._activeRowIndex&&this.doDataItemChanged(),u&&!f?(this.invalidateLayout(),this.repaint(),u=!0):u||f||(h=this._spanModel.find(i,r),h?(v=h.rowCount,a=h.colCount):(v=1,a=1),this._render.repaintSelection(new t.Range(i,r,v,a)),this._render.repaintSelection(new t.Range(this._activeRowIndex,this._activeColIndex,this._activeRowCount,this._activeColCount))),o=this._eventHandler,d=o.oldTop!==this.
_scrollTopRow,o.oldTop=this._scrollTopRow,o.oldLeft=this._scrollLeftCol;if(d){var b=this.getViewportTopRow(1),ht=this.getViewportBottomRow(1),g=Math.max(0,b-60);g<this.getRowCount()&&o._loadData(g,2*ht-b)}return this._trigger(t.Events.EnterCell,{sheet:this,sheetName:this._name,row:this._activeRowIndex,col:this._activeColIndex}),o._updateValidationUI(this._activeRowIndex,this._activeColIndex),u||f},e.prototype._endEditImp=function(n,i){var r,f,l,a,c,s,h;if(!this.isEditing())return!0;r=this._editor;if(r&&r.parentNode){var u=this.getCellType(this._activeRowIndex,this._activeColIndex),o=u.getEditorValue(r),e={sheet:this,sheetName:this._name,row:this._activeRowIndex,col:this._activeColIndex,editingText:o,cancel:!1};this._trigger(t.Events.EditEnd,e);if(e&&e.cancel===!0)return;if(this._activeRowIndex>=0&&this._activeColIndex>=0&&!n){l=r._oldValue;if(u.isEditingValueChanged(l,o)){a=u.hasOwnProperty("_autoFormatValue")?u._autoFormatV
alue:!0,c={row:this._activeRowIndex,col:this._activeColIndex,newValue:o,autoFormat:a},f=new t.UndoRedo.CellEditUndoAction(this,c),this._doCommand(f),s=f.applyResult===t.DataValidationResult.Retry;if(s===!0)return u.focus(r),!1}}this._dirty=!0,u.deactivateEditor(r)}return i||this._eventHandler._setFocus(),this._editingTimeValue=!1,this._editorStatus!==t.EditorStatus.Ready&&(h=this._editorStatus,this._editorStatus=t.EditorStatus.Ready,this._trigger(t.Events.EditorStatusChanged,{sheet:this,sheetName:this._name,oldStatus:h,newStatus:t.EditorStatus.Ready})),this._editor=null,f&&f.applyResult===t.DataValidationResult.Discard?!1:!0},e.prototype.endEdit=function(n){return this._endEditImp(n)},e.prototype.hitTest=function(n,t,i){var r,f,u;return this._getSheetLayout(),r={x:n,y:t,rowViewportIndex:null,colViewportIndex:null,row:-1,col:-1,resizeInfo:null,hitTestType:null,groupHitInfo:null,filterButtonHitInfo:null,dragInfo:null,cellTypeHitInfo:null},f=this._render.groupHitTest(n,
t),f?r.groupHitInfo=f:(r.rowViewportIndex=this._getRowViewportIndexFromY(t),r.colViewportIndex=this._getColumnViewportIndexFromX(n),r.row=this._getRowIndexFromY(t,r.rowViewportIndex),r.col=this._getColumnIndexFromX(n,r.colViewportIndex),r.rowViewportIndex<0||r.rowViewportIndex>2||r.colViewportIndex<0||(u=this._getCellLayoutByCell(r.rowViewportIndex,r.colViewportIndex,undefined,r.row,r.col),u&&i!==!0&&(r.row=u.row,r.col=u.col)),r.hitTestType=this._getSheetAreaFromHitTest(r),r.resizeInfo=this._eventHandler.getResizingRowCol(r,n,t),r.resizeInfo||(r.dragInfo=this._eventHandler.getDragInfo(r,n,t),r.dragInfo||(r.filterButtonHitInfo=this._getFilterButtonHitInfo(r,n,t),r.filterButtonHitInfo||(r.cellTypeHitInfo=this._getCellTypeHitInfo(r,n,t))))),r},e.prototype.getCellRect=function(n,i,r,u){var o=t.SheetArea.viewport,s,f;r===-1?o=t.SheetArea.colHeader:u===-1&&(o=t.SheetArea.rowHeader),s=this._getSheetLayout();if(r===-1&&u===-1)return new t.Rect(s.head
erX,s.headerY,s.rowHeaderWidth,s.colHeaderHeight);f=this._bounds,(r===undefined||r===null)&&(n<this.frozenRowCount?r=0:n<this.getRowCount()-this._frozenTrailingRowCount?r=1:n<this.getRowCount()&&(r=2)),(u===undefined||u===null)&&(i<this.frozenColCount?u=0:i<this.getColumnCount()-this._frozenTrailingColCount?u=1:i<this.getColumnCount()&&(u=2));var h=this._getRowLayout(r,o).findRow(n),c=this._getColumnLayout(u,o).findCol(i),e=this._getCellLayout(r,u,o).findCell(n,i);return e?new t.Rect(e.x-f.x,e.y-f.y,e.width,e.height):h&&c?new t.Rect(c.x-f.x,h.y-f.y,c.width,h.height):new t.Rect},e.prototype._setActiveCellCore=function(n,t){var i=!1;n!==null&&n!==undefined&&(this._activeRowIndex=n,i=!0),t!==null&&t!==undefined&&(this._activeColIndex=t,i=!0),this._eventHandler&&i&&this._eventHandler._setFocus()},e.prototype._setActiveCellImp=function(n,i,r,u){this._activeRowIndex!==n&&this.
_activeRowDirty&&(this.updateRecord(),this._activeRowDirty=!1);var f=this._spanModel.find(n,i);f?(this._activeRowCount=f.rowCount,this._activeColCount=f.colCount):(this._activeRowCount=1,this._activeColCount=1),this._render.repaintSelection(new t.Range(this._activeRowIndex,this._activeColIndex,1,1)),this.activeRowViewportIndex=r,this.activeColViewportIndex=u,this._setActiveCellCore(n,i),this._leadingCellRow=n,this._leadingCellCol=i},e.prototype.setActiveCell=function(n,t,i,r){this._bindToAutoRefresh(function(n,t,i,r){var f=this.getRowCount(),e=this.getColumnCount(),u;n<0?n=0:n<f||(n=f-1),t<0?t=0:t<e||(t=e-1),this._clearSelectionImp(),this._setActiveCellImp(n,t,i,r),u=this._spanModel.find(n,t),u?this._setSelectedRange(u.row,u.col,u.rowCount,u.colCount):this._setSelectedRange(n,t,1,1)})(n,t,i,r)},e.prototype.getActiveRowIndex=function(){return this._activeRowIndex},e.prototype.getActiveColumnIndex=function(){return this._activeColIndex},e.prototype.selectionPolicy=
function(n){return arguments.length===0?this._selectionModel.selectionPolicy:(this._selectionModel.selectionPolicy=n,this)},e.prototype.selectionUnit=function(n){return arguments.length===0?this._selectionModel.selectionUnit:(this._selectionModel.selectionUnit=n,this)},e.prototype.getRowResizable=function(n,i){(i===undefined||i===null)&&(i=t.SheetArea.viewport);var u=!0,r=this._getRowInfos(i);return r&&r[n]&&r[n].resizable!==undefined&&r[n].resizable!==null&&(u=r[n].resizable),u},e.prototype.setRowResizable=function(n,i,r){(r===undefined||r===null)&&(r=t.SheetArea.viewport);var u=this._getRowInfos(r);u[n]||(u[n]={}),u[n].resizable=i,u[n].dirty=!0,this._trigger(t.Events.RowChanged,{sheet:this,sheetName:this._name,row:n,sheetArea:r,propertyName:"resizable"})},e.prototype.getColumnResizable=function(n,i){(i===undefined||i===null)&&(i=t.SheetArea.viewport);var u=!0,r=this._getColumnInfos(i);return r&&r[n]&&
;r[n].resizable!==undefined&&r[n].resizable!==null&&(u=r[n].resizable),u},e.prototype.setColumnResizable=function(n,i,r){(r===undefined||r===null)&&(r=t.SheetArea.viewport);var u=this._getColumnInfos(r);u[n]||(u[n]={}),u[n].resizable=i,u[n].dirty=!0,this._trigger(t.Events.ColumnChanged,{sheet:this,sheetName:this._name,col:n,sheetArea:r,propertyName:"resizable"})},e.prototype.getRowHeight=function(n,i){var u,h,s,f,e,o,r;if(i===undefined||i===null||i===t.SheetArea.rowHeader||i===t.SheetArea.viewport){if(n<0||n>=this.getRowCount(i))return 0;if(this._rowFilter&&this._rowFilter.isHideRowFilter())if(this._rowFilter.isFiltered()&&this._rowFilter.isRowFilteredOut(n))return 0;u=this.getTables();if(u&&u.length>0)for(h=u.length,e=0;e<h;e++){s=u[e];if(!s)continue;f=s.rowFilter();if(f&&f.isHideRowFilter()&&f.isFiltered()&&f.isRowFilteredOut(n))return 0}if(this.rowRangeGroup&&!this.rowRangeGroup.
_isEmpty())if(this.rowRangeGroup.isCollapsed(n))return 0}o=this.defaults.rowHeight,i===t.SheetArea.colHeader&&(o=this.defaults.colHeaderRowHeight),r=this._getRowInfos(i);if(r&&r[n])if(r[n].visible===!1)return 0;else isNaN(r[n].size)||(o=parseInt(r[n].size,10));return o},e.prototype._getActualRowHeight=function(n,i){var u,r;if(i===undefined||i===null||i===t.SheetArea.rowHeader||i===t.SheetArea.viewport)if(n<0||n>=this.getRowCount(i))return 0;return u=this.defaults.rowHeight,i===t.SheetArea.colHeader&&(u=this.defaults.colHeaderRowHeight),r=this._getRowInfos(i),r&&r[n]&&(isNaN(r[n].size)||(u=parseInt(r[n].size,10))),u},e.prototype.setRowHeight=function(n,i,r){this._bindToAutoRefresh(function(n,i,r){(r===undefined||r===null)&&(r=t.SheetArea.viewport);var u=this._getRowInfos(r);u[n]||(u[n]={});if(u[n].size===i)return;u[n].size=i,u[n].dirty=!0,this._trigger(t.Events.RowChanged,{sheet:this,sheetName:this._name,row:n,sheetArea:r,property
Name:wt})})(n,i,r)},e.prototype.getRowVisible=function(n,i){var u,h,s,f,e,o,r;if(i===undefined||i===null||i===t.SheetArea.viewport||i===t.SheetArea.rowHeader){if(this._rowFilter&&this._rowFilter.isHideRowFilter())if(this._rowFilter.isFiltered()&&this._rowFilter.isRowFilteredOut(n))return!1;u=this.getTables();if(u&&u.length>0)for(h=u.length,e=0;e<h;e++){s=u[e];if(!s)continue;f=s.rowFilter();if(f&&f.isHideRowFilter()&&f.isFiltered()&&f.isRowFilteredOut(n))return!1}if(this.rowRangeGroup&&!this.rowRangeGroup._isEmpty())if(0<=n&&n<this.getRowCount(i)&&this.rowRangeGroup.isCollapsed(n))return!1}return o=!0,r=this._getRowInfos(i),r&&r[n]&&r[n].visible!==undefined&&r[n].visible!==null&&(o=r[n].visible),o},e.prototype.setRowVisible=function(n,i,r){this._bindToAutoRefresh(function(n,i,r){(r===undefined||r===null)&&(r=t.SheetArea.viewport);var u=this._getRowInfos(r);u[n]|
|(u[n]={});if(u[n].visible===i)return;u[n].visible=i,u[n].dirty=!0,this._trigger(t.Events.RowChanged,{sheet:this,sheetName:this._name,row:n,sheetArea:r,propertyName:"isVisible"})})(n,i,r)},e.prototype.getColumnWidth=function(n,i){var u=this.defaults.colWidth,r;i===t.SheetArea.rowHeader&&(u=this.defaults.rowHeaderColWidth);if(i===undefined||i===null||i===t.SheetArea.colHeader||i===t.SheetArea.viewport){if(n<0||n>=this.getColumnCount(i))return 0;if(this.colRangeGroup&&!this.colRangeGroup._isEmpty())if(this.colRangeGroup.isCollapsed(n))return 0}r=this._getColumnInfos(i);if(r&&r[n]){if(r[n].visible===!1)return 0;isNaN(r[n].size)||(u=parseInt(r[n].size,10))}return u},e.prototype._getActualColumnWidth=function(n,i){var u=this.defaults.colWidth,r;i===t.SheetArea.rowHeader&&(u=this.defaults.rowHeaderColWidth);if(i===undefined||i===null||i===t.SheetArea.colHeader||i===t.SheetArea.viewport)if(n<0||n>=this.getColumnCount(i))return 0;return
r=this._getColumnInfos(i),r&&r[n]&&(isNaN(r[n].size)||(u=parseInt(r[n].size,10))),u},e.prototype.setColumnWidth=function(n,i,r){this._bindToAutoRefresh(function(n,i,r){(r===undefined||r===null)&&(r=t.SheetArea.viewport);var u=this._getColumnInfos(r);u[n]||(u[n]={}),u[n].size=i,u[n].dirty=!0,this._trigger(t.Events.ColumnChanged,{sheet:this,sheetName:this._name,col:n,sheetArea:r,propertyName:bt}),this._allowCellOverflow&&this._clearCellOverflowModelCache()})(n,i,r)},e.prototype.getColumnVisible=function(n,i){if(i===undefined||i===null||i===t.SheetArea.colHeader||i===t.SheetArea.viewport)if(this.colRangeGroup&&!this.colRangeGroup._isEmpty())if(0<=n&&n<this.getColumnCount(i)&&this.colRangeGroup.isCollapsed(n))return!1;var u=!0,r=this._getColumnInfos(i);return r&&r[n]&&r[n].visible!==undefined&&r[n].visible!==null&&(u=r[n].visible),u},e.prototype.setColumnVisible=function(n,i,r){this._bindToAuto
Refresh(function(n,i,r){(r===undefined||r===null)&&(r=t.SheetArea.viewport);var u=this._getColumnInfos(r);u[n]||(u[n]={});if(u[n].visible===i)return;u[n].visible=i,u[n].dirty=!0,this._allowCellOverflow===!0&&this._clearCellOverflowModelCache(),this._trigger(t.Events.ColumnChanged,{sheet:this,sheetName:this._name,col:n,sheetArea:r,propertyName:"isVisible"})})(n,i,r)},e.prototype.zoom=function(n){n=parseFloat(n);if(isNaN(n)||!isFinite(n))return;n>4?n=4:n<.25&&(n=.25),this._bindToAutoRefresh(function(n){this.showEditingLocator&&this._showEditingLocator(),this._allowCellOverflow&&this._zoomFactor!==n&&this._clearCellOverflowModelCache(),this._zoomFactor=n})(n)},e.prototype.invalidateLayout=function(){this._layoutModel=null,this._cachedGroupLayout=null,this._rowLayoutCache={colHeader:null,viewport:null,colFooter:null},this._colLayoutCache={rowHeader:null,viewport:null},this._clearCellOverflowModelCache(),this._filterButtonsM
odel=null,this._eventHandler&&window.gcGlobal.activeElement===this&&this._eventHandler._updateValidationUI(this._activeRowIndex,this._activeColIndex),this._dirty=!0},e.prototype.getViewportHeight=function(n){var t=this._getSheetLayout();return n===0?t.frozenHeight:n===1?t.viewportHeight:n===2?t.frozenTrailingHeight:0},e.prototype.getViewportWidth=function(n){var t=this._getSheetLayout();return n===0?t.frozenWidth:n===1?t.viewportWidth:n===2?t.frozenTrailingWidth:0},e.prototype.getViewportTopRow=function(n){return n===0?0:n===1?Math.max(this.frozenRowCount,this._scrollTopRow):n===2?Math.max(this.frozenRowCount,this.getRowCount()-this._frozenTrailingRowCount):-1},e.prototype.getViewportBottomRow=function(n){var t;if(n===2)return this.getRowCount()-1;var f=this.getViewportTopRow(n),e=this.getViewportHeight(n),r=0,u=0,i=this.getRowCount()-this._frozenTrailingRowCount;for(n===0&&(i=Math.min(this.frozenRowCount,i)),t=f;t<i&&r<e;t++,u++)r+=this._getZoo
mRowHeight(t);return f+u-1},e.prototype.getViewportLeftColumn=function(n){return n===0?0:n===1?Math.max(this.frozenColCount,this._scrollLeftCol):n===2?Math.max(this.frozenColCount,this.getColumnCount()-this._frozenTrailingColCount):-1},e.prototype.getViewportRightColumn=function(n){var t;if(n===2)return this.getColumnCount()-1;var f=this.getViewportLeftColumn(n),e=this.getViewportWidth(n),r=0,u=0,i=this.getColumnCount()-this._frozenTrailingColCount;for(n===0&&(i=Math.min(this.frozenColCount,i)),t=f;t<i&&u<e;t++,r++)u+=this._getZoomColumnWidth(t);return f+r-1},e.prototype.clearSelection=function(){this._bindToAutoRefresh(function(){this._clearSelectionImp(),this._setActiveCellImp(0,0)})()},e.prototype._clearSelectionImp=function(){this._selectionModel.clear()},e.prototype._validationError=function(n,i,r){var f=this.getDataValidator(n,i),u={sheet:this,sheetName:this._name,row:n,col:i,validator:f,validationResult:t.DataValidationResult.ForceApply};return this._tri
gger(t.Events.ValidationError,u),u.validationResult},e.prototype.getSpans=function(n,i){var u,e,r,f;(i===undefined||i===null)&&(i=t.SheetArea.viewport),u=this._getSpanModel(i);if(!n)return u.slice(0);for(e=[],r=0;r<u.length;r++)f=u[r],(!n||f.intersect(n.row,n.col,n.rowCount,n.colCount))&&e.push(f);return e},e.prototype.getSpan=function(t,i,r){(r===undefined||r===null)&&(r=n.spread.SheetArea.viewport);var u=this._getSpanModel(r);return u.find(t,i)},e.prototype.getCell=function(n,i,r){return new t.Cell(this,n,i,r)},e.prototype.getCells=function(n,t,i,r,u){var f=this.getCell(n,t,u);return f.row2=i,f.col2=r,f},e.prototype.getRow=function(n,i){return new t.Row(this,n,i)},e.prototype.getRows=function(n,t,i){var r=this.getRow(n,i);return r.index2=t,r},e.prototype.getColumn=function(n,i){return new t.Column(this,n,i)},e.prototype.getColumns=function(n,t,i){var r=this.getColumn(n,i);return r.index2=t,r},e.prototype.setBorder=function(n,i,r,u){var a;(u===undefined||
u===null)&&(u=t.SheetArea.viewport),a=this.isPaintSuspended(),this.isPaintSuspended(!0);try{var l=this._getActualRange(n,u),s=l.row,o=l.col,c=l.rowCount,h=l.colCount,f,e;if(r.left||r.all||r.outline)for(f=0;f<c;f++)this.getCell(s+f,o,u).borderLeft(i);if(r.top||r.all||r.outline)for(e=0;e<h;e++)this.getCell(s,o+e,u).borderTop(i);if(r.right||r.all||r.outline)for(f=0;f<c;f++)this.getCell(s+f,o+h-1,u).borderRight(i);if(r.bottom||r.all||r.outline)for(e=0;e<h;e++)this.getCell(s+c-1,o+e,u).borderBottom(i);if(r.innerHorizontal||r.all||r.inside)for(f=0;f<c-1;f++)for(e=0;e<h;e++)this.getCell(s+f,o+e,u).borderBottom(i),this.getCell(s+f+1,o+e,u).borderTop(i);if(r.innerVertical||r.all||r.inside)for(e=0;e<h-1;e++)for(f=0;f<c;f++)this.getCell(s+f,o+e,u).borderRight(i),this.getCell(s+f,o+e+1,u).borderLeft(i)}finally{this.isPaintSuspended(a)}},e.prototype.search=function(n){var i,u,f,r;if(!n||!t.features.search)return null;if(!n.searchString||n.searchTarget===t.SearchFo
undFlags.None||this.getRowCount(n.sheetArea)<=0&&this.getColumnCount(n.sheetArea)<=0)return new t.SearchResult;n.rowStart===-1&&(n.rowStart=0),n.columnStart===-1&&(n.columnStart=0),n.findBeginRow===-1&&(n.findBeginRow=n.rowStart),n.findBeginColumn===-1&&(n.findBeginColumn=n.columnStart),n.rowEnd===-1&&(n.rowEnd=this.getRowCount(n.sheetArea)-1),n.columnEnd===-1&&(n.columnEnd=this.getColumnCount(n.sheetArea)-1),i=new t.SearchResult,u=new t.CellsEnumerator(this,n),(n.searchFlags&t.SearchFlags.BlockRange)>0&&(u.isBlockRange=!0);while(u.moveNext()){var o=u.currentRow,s=u.currentColumn,e=u.current();if(!e)continue;(n.searchTarget&t.SearchFoundFlags.CellText)>0&&(f=e.text(),this._trySearch(f,n.searchString,n.searchFlags)&&f!==""&&(i.searchFoundFlag|=t.SearchFoundFlags.CellText,i.foundString=f)),(n.searchTarget&t.SearchFoundFlags.CellFormula)>0&&(r=e.formula()
,r=typeof r===c?r.toString():null,this._trySearch(r,n.searchString,n.searchFlags)&&r!==""&&(i.searchFoundFlag|=t.SearchFoundFlags.CellFormula,i.foundString=r));if(i.searchFoundFlag!==t.SearchFoundFlags.None)return i.foundRowIndex=o,i.foundColumnIndex=s,i}return new t.SearchResult},e.prototype.showCell=function(n,i,r,u){var f,e,l;if(n<0||n>=this.getRowCount())return;if(i<0||i>=this.getColumnCount())return;var p=isNaN(this.frozenRowCount)?0:this.frozenRowCount,y=isNaN(this.frozenColCount)?0:this.frozenColCount,v=isNaN(this._frozenTrailingRowCount)?0:this._frozenTrailingRowCount,a=isNaN(this._frozenTrailingColCount)?0:this._frozenTrailingColCount,h=this._scrollTopRow,c=this._scrollLeftCol,o=1,s=1;n<p?(h=0,s=0):n<this.getRowCount()-v||(h=this.getRowCount()-v,s=2),i<y?(c=0,o=0):i<this.getColumnCount()-a||(c=this.getColumnCount()-a,o=2);if(o===1)if(u!==t.HorizontalPosition.left)if(u===t.HorizontalPosition.center)for(f=Math.floor((this.getV
iewportWidth(o)-Math.floor(this.getColumnWidth(i)*this._zoomFactor))/2);0<i;i--){f-=Math.floor(this.getColumnWidth(i-1)*this._zoomFactor);if(f<0)break}else if(u===t.HorizontalPosition.right)for(f=this.getViewportWidth(o)-Math.floor(this.getColumnWidth(i)*this._zoomFactor);0<i;i--){f-=Math.floor(this.getColumnWidth(i-1)*this._zoomFactor);if(f<0)break}else if(u===t.HorizontalPosition.nearest)if(i>=c)for(f=this.getViewportWidth(o)-Math.floor(this.getColumnWidth(i)*this._zoomFactor);c<i;i--){f-=Math.floor(this.getColumnWidth(i-1)*this._zoomFactor);if(f<0)break}if(s===1)if(r!==t.VerticalPosition.top)if(r===t.VerticalPosition.center)for(e=Math.floor((this.getViewportHeight(s)-Math.floor(this.getRowHeight(n)*this._zoomFactor))/2);0<n;n--){e-=Math.floor(this.getRowHeight(n-1)*this._zoomFactor);if(e<0)break}else if(r===t.VerticalPosition.bottom)for(e=this.getViewportHeight(s)-Math.floor(this.getRowHeight(n)*this._zoomFactor);0<n;n--){e-=Math.floor(this.getRowHei
ght(n-1)*this._zoomFactor);if(e<0)break}else if(r===t.VerticalPosition.nearest)if(!(n<h||h===-1))for(e=this.getViewportHeight(s)-Math.floor(this.getRowHeight(n)*this._zoomFactor);h<n;n--){e-=Math.floor(this.getRowHeight(n-1)*this._zoomFactor);if(e<0)break}l=!1,s===1&&n!==h&&(this._scrollTopRow=n,this._syncVScrollbarPosition(),l=!0),o===1&&i!==c&&(this._scrollLeftCol=i,this._syncHScollbarPosition(),l=!0),l&&(this.invalidateLayout(),this.repaint())},e.prototype.showColumn=function(n,i){this.showCell(this._scrollTopRow,n,t.VerticalPosition.top,i)},e.prototype.showRow=function(n,i){this.showCell(n,this._scrollLeftCol,i,t.HorizontalPosition.left)},e.prototype.bind=function(n,t,i){this._eventHandler.bind(n+s,t,i)},e.prototype.unbind=function(n,t){this._eventHandler.unbind(n+s,t)},e.prototype.unbindAll=function(){this._eventHandler.unbind(s)},e.prototype._bind=function(n,t,i){this._eventHandler.bind(n+nt,t,i)},e.prototype._unbind=function
(n,t){this._eventHandler.unbind(n+nt,t)},e.prototype._unbindAll=function(){this._eventHandler.unbind(nt)},e.prototype.suspendEvent=function(){this._eventHandler._eventSuspended++},e.prototype.resumeEvent=function(){this._eventHandler._eventSuspended--,this._eventHandler._eventSuspended<0&&(this._eventHandler._eventSuspended=0)},e.prototype.currentTheme=function(n){return arguments.length===0?(this._currentTheme||(this._currentTheme=t.SpreadThemes.Office),this._currentTheme):(typeof n===c&&(n=t.SpreadThemes.hasOwnProperty(n)?t.SpreadThemes[n]:new t.SpreadTheme(n)),this._bindToAutoRefresh(function(n){this._currentTheme=n})(n),this)},e.prototype.reset=function(){this.defaults={rowHeight:20,colWidth:62,rowHeaderColWidth:40,colHeaderRowHeight:20},this.gridline={color:"#D0D7E5",showVerticalGridline:!0,showHorizontalGridline:!0},this._rowLayoutCache={colHeader:null,viewport:null,colFooter:null},this._colLayoutCache={rowHeader:null,viewport:null},this._dragRect=
{},this._render=new t._SheetRender(this),this._eventHandler=new t._SheetEventHandler(this),this._dataModel=new t._GcSheetModel,this._dataModel.name=this._name,t.util.hasCalc()&&(this._calcDataModel=new t._GcSheetModel(this._dataModel.rowCount,this._dataModel.colCount,this._name+"_calc")),this._rowHeaderModel=new t._GcSheetModel(this._dataModel.rowCount,1),this._colHeaderModel=new t._GcSheetModel(1,this._dataModel.colCount),this._colFooterModel=new t._GcSheetModel(1,this._dataModel.colCount,this._name+"cf"),this._spanModel=new t._SpanModel,this._colHeaderSpanModel=new t._SpanModel,this._rowHeaderSpanModel=new t._SpanModel,this._selectionModel=new t._SelectionModel,this._selectionBackColor="rgba(180,180,200,0.2)",this._selectionBorderColor="black",t.util.hasCalc()&&(this._vpSheetSource=new n.spread.Calc._SheetSource(this,t.SheetArea.viewport)),this._cellOverflowModelCache=null,t.features.group&&(this.rowRangeGroup=new t.R
angeGroup(this.getRowCount()),this.colRangeGroup=new t.RangeGroup(this.getColumnCount())),this._showRowRangeGroup=!0,this._showColumnRangeGroup=!0,this._rowInfos=null,this._colInfos=null,this.dataContext=null,this.autoGenerateColumns=!0,this.autoUpdate=!0,this._rowFilter=null,this._initDefaultKeyMap(),this._scrollTopRow=0,this._scrollLeftCol=0,this.frozenRowCount=0,this.frozenColCount=0,this._frozenTrailingRowCount=0,this._frozenTrailingColCount=0,t.features.binding&&(this._bindingManager=new t._BindingManager(this)),t.features.sparkline&&(this._sparklineGroupManager=new t.WorksheetSparklineGroupManager(this,this)),t.features.table&&(this._tableManager=new t._SheetTableManager(this)),this._namedStyles={},this._syncScrollbarSize(),this.invalidateLayout(),this._dirty=!0},e.prototype.undoManager=function(){return this._undoManager||(this._undoManager=this.parent&&this.parent._undoManager?this.parent._undoManager:new t._UndoManager(this,-1,this.allowUndo(
))),this._undoManager},e.prototype.clipBoardOptions=function(n){return arguments.length===0?((this._clipBoardOptions===undefined||this._clipBoardOptions===null)&&(this._clipBoardOptions=t.ClipboardPasteOptions.All),this._clipBoardOptions):(this._clipBoardOptions=n,this)},e.prototype.doCommand=function(n){this._doCommand(n)},e.prototype.copyTo=function(n,t,i,u,f,e,o){var s=this.isPaintSuspended();this.isPaintSuspended(!0),this.suspendEvent(),r.copyTo(this,n,t,this,i,u,f,e,o),this.resumeEvent(),this.isPaintSuspended(s)},e.prototype.moveTo=function(n,t,i,u,f,e,o){var s=this.isPaintSuspended();this.isPaintSuspended(!0),this.suspendEvent(),r.moveTo(this,n,t,this,i,u,f,e,o),this.resumeEvent(),this.isPaintSuspended(s)},e.prototype.setCsv=function(n,t,i,u,f,e){var o=this.isPaintSuspended();this.isPaintSuspended(!0),this.suspendEvent(),r.setRangeText(this,n,t,i,u,f,'"',e),this.resumeEvent(),this.isPaintSuspended(o)},e.prototype.getCsv=function(n,i,u,f,e,o){return r.getRangeText(
this,n,u,i,f,e,o,'"',!0,t.TextFileOpenFlags.None)},e.prototype.canUserDragDrop=function(n){return arguments.length===0?(this.parent&&this.parent.canUserDragDrop?this._allowDragDrop=this.parent.canUserDragDrop():(this._allowDragDrop===undefined||this._allowDragDrop===null)&&(this._allowDragDrop=!0),this._allowDragDrop):(this.parent&&this.parent.canUserDragDrop?this.parent.canUserDragDrop(n):this._allowDragDrop=n,this)},e.prototype.canUserDragFill=function(n){if(arguments.length===0)return t.features.fill?(this.parent&&this.parent.canUserDragFill?this._allowDragFill=this.parent.canUserDragFill():(this._allowDragFill===undefined||this._allowDragFill===null)&&(this._allowDragFill=!0),this._allowDragFill):!1;else{var i=this.canUserDragFill();return i!==n&&(this.parent&&this.parent.canUserDragFill?this.parent.canUserDragFill(n):this._allowDragFill=n,this.getSelections().length===1&&this._render.repaintSelection(this.getS
elections().toArray()[0])),this}},e.prototype.isColumnBound=function(n){var i,t;if(n<0||n>=this.getColumnCount())return!1;i=this.getDataSource();if(i)if(this._colInfos)return t=this._colInfos[n],!!(t&&t.name);return!1},e.prototype.getDataColumnName=function(n){var i,t;if(n<0||n>=this.getColumnCount())return null;i=this.getDataSource();if(i)if(this._colInfos)return t=this._colInfos[n],t.displayName||t.name;return null},e.prototype.getSparkline=function(n,i){if(!this._sparklineGroupManager)return null;var u=t.SheetArea.viewport,r=this._getModel(u);return r.getSparkline(n,i)},e.prototype.setSparkline=function(n,i,r,u,f,e,o,s){return this._sparklineGroupManager?this._bindToAutoRefresh(function(n,i,r,u,f,e,o,s){var l=r,h=new t.Sparkline(n,i,l,u,f,e),c;return o&&s!==undefined&&s!==null&&(h.dateAxisData(o),h.dateAxisOrientation(s),h.group().displayDateAxis=!0),this.removeSparkline(n,i),c=this._getModel(),c.setSparkline(n,i,h),this._sparklineGroup
Manager.add(h.group()),this._raiseCellChanged("sparkline",n,i,t.SheetArea.viewport),h})(n,i,r,u,f,e,o,s):null},e.prototype.removeSparkline=function(n,i){if(!this._sparklineGroupManager)return;this._bindToAutoRefresh(function(n,i){var e=t.SheetArea.viewport,f=this._getModel(e),u=f.getSparkline(n,i),r;u&&(r=u.group(),r.remove(u),r.count()>0||this._sparklineGroupManager.remove(r)),f.setSparkline(n,i,null)})(n,i)},e.prototype.groupSparkline=function(n){return this._sparklineGroupManager?this._bindToAutoRefresh(function(n){for(var r=null,t,i,u=0;u<n.length;u++){t=n[u];if(!t)continue;if(!r){r=t.group();continue}i=t.group(),i.remove(t),r.add(t),i.count()>0||this._sparklineGroupManager.remove(i)}return r})(n):null},e.prototype.ungroupSparkline=function(n){if(!this._sparklineGroupManager)return;this._bindToAutoRefresh(function(n){var t,r,i,u;if(!n)return;for(t=[],t=t.concat(n._innerList),r=0;r<t.length;r++)i=t[r],i&&(n.remove(i),u=n.clone(),u.add(i),this
._sparklineGroupManager.add(u));this._sparklineGroupManager.remove(n)})(n)},e.prototype.fillAuto=function(n,i,r){if(!t.features.fill)return;if(!i)throw new Error(t._StringResource.Exp_RangeIsNull);if(!this._checkFillRange(n,i,r))return;this._bindToAutoRefresh(function(n,i,r){n&&(this._eventHandler._dragFillStartRange=n);var u=new t.FillImp(this);u.fillAuto(i,r)})(n,i,r)},e.prototype.fillAutobyDirection=function(n,i,r){if(!t.features.fill)return;if(!i)throw new Error(t._StringResource.Exp_RangeIsNull);if(!this._checkFillRange(n,i,null,r))return;this._bindToAutoRefresh(function(n,i,r){n&&(this._eventHandler._dragFillStartRange=n);var u=new t.FillImp(this);u.fillAutobyDirection(i,r)})(n,i,r)},e.prototype.fillLinear=function(n,i,r,u,f){if(!t.features.fill)return;if(!i)throw new Error(t._StringResource.Exp_RangeIsNull);if(!this._checkFillRange(n,i,r))return;this._bindToAutoRefresh(function(n,i,r,u,f){n&&(this._eventHandler._dragFillStartRange=n);var e=new t.FillIm
p(this);e.fillLinear(i,r,u,f)})(n,i,r,u,f)},e.prototype.fillGrowth=function(n,i,r,u,f){if(!t.features.fill)return;if(!i)throw new Error(t._StringResource.Exp_RangeIsNull);if(!this._checkFillRange(n,i,r))return;this._bindToAutoRefresh(function(n,i,r,u,f){n&&(this._eventHandler._dragFillStartRange=n);var e=new t.FillImp(this);e.fillGrowth(i,r,u,f)})(n,i,r,u,f)},e.prototype.fillDate=function(n,i,r,u,f,e){if(!t.features.fill)return;if(!i)throw new Error(t._StringResource.Exp_RangeIsNull);if(!this._checkFillRange(n,i,r))return;this._bindToAutoRefresh(function(n,i,r,u,f,e){n&&(this._eventHandler._dragFillStartRange=n);var s=new t.FillImp(this),o=null;e!==undefined&&e!==null&&(o=new t._DateTimeHelper(e).toOADate()),s.fillDate(i,r,u,f,o)})(n,i,r,u,f,e)},e.prototype._checkFillRange=function(n,i,r,u){if(!n||!i)return!1;if(!i.containsRange(n))return!1;if(r!==undefined&&r!==null)if(r===t.FillSeries.Row){if(n.row===i.row&&n.rowCount===i.rowCount)re
turn!0}else if(r===t.FillSeries.Column)if(n.col===i.col&&n.colCount===i.colCount)return!0;if(u!==undefined&&u!==null)if(u===t.FillDirection.Up||u===t.FillDirection.Down){if(n.col===i.col&&n.colCount===i.colCount)return!0}else if(u===t.FillDirection.Left||u===t.FillDirection.Right)if(n.row===i.row&&n.rowCount===i.rowCount)return!0;return!1},e.prototype.clear=function(n,i,r,u,f,e){this._bindToAutoRefresh(function(n,i,r,u,f,e){var h,c,o,s,p,v,b,l,a,y;this.suspendCalcService();try{p=t.SheetArea.viewport;if(f===undefined||f===null||f===p){if((e&t.StorageType.Data)===t.StorageType.Data){if(this.getDataSource()||this.dataContext){for(this.suspendEvent(),h=n;h<n+r;h++)for(c=i;c<i+u;c++)this.setValue(h,c,null,f);this.resumeEvent()}this._conditionalFormats&&this._conditionalFormats._clearCache(),this._rowFilter&&this._rowFilter.range&&this._rowFilter._clear(n,i,r,u)}(e&t.StorageType.Sparkline)===t.StorageType.Sparkline&
&this._sparklineGroupManager&&this._sparklineGroupManager.clear(n,i,r,u),this._tableManager&&this._tableManager.clear(n,i,r,u,e)}v=this._getModel(f),b=this._getCalcModel(f);if(v){h=n===-1?0:n,l=n===-1?v.rowCount:r,c=i===-1?0:i,a=i===-1?v.colCount:u,v.clear(h,c,l,a,e),b&&b.clear(h,c,l,a,e);if((e&t.StorageType.Style)===t.StorageType.Style)if(!(n>=0&&i>=0))if(i<0)if(n<0)this.setStyle(-1,-1,null,f);else for(o=0;o<l;o++)this.setStyle(h+o,-1,null,f);else for(s=0;s<a;s++)this.setStyle(-1,c+s,null,f);if((e&t.StorageType.Axis)===t.StorageType.Axis)if(!(n>=0&&i>=0))if(i<0)if(n<0){for(s=0;s<a;s++)this.setColumnVisible(c+s,!0,f),this.setColumnResizable(c+s,!0,f),this.setColumnWidth(c+s,f===t.SheetArea.rowHeader?this.defaults.rowHeaderColWidth:this.defaults.colWidth,f);for(o=0;o<l;o++)this.setRowVisible(h+o,!0,f),this.setRowResizable(h+o,!0,f),this.setRowHeight(h+o,f===t.SheetArea.colHeader?this.defaults.colH
eaderRowHeight:this.defaults.rowHeight,f)}else for(o=0;o<l;o++)this.setRowVisible(h+o,!0,f),this.setRowResizable(h+o,!0,f),this.setRowHeight(h+o,f===t.SheetArea.colHeader?this.defaults.colHeaderRowHeight:this.defaults.rowHeight,f);else for(s=0;s<a;s++)this.setColumnVisible(c+s,!0,f),this.setColumnResizable(c+s,!0,f),this.setColumnWidth(c+s,f===t.SheetArea.rowHeader?this.defaults.rowHeaderColWidth:this.defaults.colWidth,f);for(o=0;o<l;o++)for(s=0;s<a;s++)h=n+o,c=i+s,(e&t.StorageType.Data)===t.StorageType.Data&&this._raiseCellChanged(w,h,c,f),(e&t.StorageType.Style)===t.StorageType.Style&&this._raiseCellChanged("style",h,c,f),(e&t.StorageType.Sparkline)===t.StorageType.Sparkline&&this._raiseCellChanged("sparkline",h,c,f),(e&t.StorageType.Axis)===t.StorageType.Axis&&this._raiseCellChanged("axis",h,c,f),(e&t.StorageType.BindingPath)===t.StorageType.BindingPath&&this._raiseCellChanged(&q
uot;bindingPath",h,c,f)}(f===undefined||f===null||f===p)&&(e&t.StorageType.Data)===t.StorageType.Data&&(y=this._getSheetSource(),y&&y._addCellsToDirty(n,i,r,u))}finally{this.resumeCalcService()}})(n,i,r,u,f,e)},e.prototype.getConditionalFormats=function(){return!this._conditionalFormats&&t.features.conditionalFormat&&(this._conditionalFormats=new t.ConditionalFormats(this)),this._conditionalFormats},e.prototype.rowFilter=function(n){return arguments.length===0?this._rowFilter:this._bindToAutoRefresh(function(n){return this._rowFilter&&this._rowFilter.reset(),this._rowFilter=n,this._rowFilter&&(this._rowFilter.sheet=this),this})(n)},e.prototype.autoFitColumn=function(n){if(n<0||n>=this.getColumnCount())return;var i=new t.UndoRedo.ColumnAutoFitUndoAction(this,[{col:n}],!1);i.execute(this)},e.prototype.autoFitRow=function(n){if(n<0||n>=this.getRowCount())return;var i=new t.UndoRedo.RowAutoFitUndoAction(this,[{
row:n}],!1);i.execute(this)},e.prototype.setGridlineOptions=function(n){this._bindToAutoRefresh(function(n){n&&(this.gridline||(this.gridline={}),n.color&&(this.gridline.color=n.color),n.showVerticalGridline!==null&&n.showVerticalGridline!==undefined&&(this.gridline.showVerticalGridline=n.showVerticalGridline),n.showHorizontalGridline!==null&&n.showHorizontalGridline!==undefined&&(this.gridline.showHorizontalGridline=n.showHorizontalGridline))})(n)},e.prototype.getGridlineOptions=function(){this.gridline||(this.gridline={});var n={};return n.color=this.gridline.color,n.showVerticalGridline=this.gridline.showVerticalGridline,n.showHorizontalGridline=this.gridline.showHorizontalGridline,n},e.prototype.getFrozenRowCount=function(){return this.frozenRowCount},e.prototype.getFrozenColumnCount=function(){return this.frozenColCount},e.prototype.getFrozenTrailingRowCount=function(){return this._frozenTrailingRowCount},e.prototype.getFrozenTrai
lingColumnCount=function(){return this._frozenTrailingColCount},e.prototype.setRowHeaderVisible=function(n){this._bindToAutoRefresh(function(t){this.rowHeaderVisible=n})(n)},e.prototype.getRowHeaderVisible=function(){return this.rowHeaderVisible},e.prototype.setColumnHeaderVisible=function(n){this._bindToAutoRefresh(function(t){this.colHeaderVisible=n})(n)},e.prototype.getColumnHeaderVisible=function(){return this.colHeaderVisible},e.prototype.setRowHeaderAutoText=function(n){this._bindToAutoRefresh(function(n){this.rowHeaderAutoText=n})(n)},e.prototype.getRowHeaderAutoText=function(){return this.rowHeaderAutoText},e.prototype.setColumnHeaderAutoText=function(n){this._bindToAutoRefresh(function(n){this.colHeaderAutoText=n})(n)},e.prototype.getColumnHeaderAutoText=function(){return this.colHeaderAutoText},e.prototype.setRowHeaderAutoTextIndex=function(n){this._bindToAutoRefresh(function(n){this.rowHeaderAutoTextIndex=n})(n)},e.prototype.getRowHeaderAutoTextIndex=function(){return thi
s.rowHeaderAutoTextIndex},e.prototype.setColumnHeaderAutoTextIndex=function(n){this._bindToAutoRefresh(function(n){this.colHeaderAutoTextIndex=n})(n)},e.prototype.getColumnHeaderAutoTextIndex=function(){return this.colHeaderAutoTextIndex},e.prototype.setIsProtected=function(n){this._bindToAutoRefresh(function(t){this.isProtected=n})(n)},e.prototype.getIsProtected=function(){return this.isProtected},e.prototype.setArray=function(n,i,r,u){var e=this.getRowCount(),o=this.getColumnCount(),s,f;if(r&&0<=n&&n<e&&0<=i&&i<o){this.suspendCalcService(),s=this.isPaintSuspended(),this.isPaintSuspended(!0);try{f=this,$.each(r,function(r,s){if(s instanceof Array)$.each(s,function(s,h){var l=n+r,c=i+s;l<e&&c<o&&(u?f.setFormula(l,c,h,t.SheetArea.viewport):f.setValue(l,c,h,t.SheetArea.viewport,!0))});else{var c=n+r,h=i;c<e&&h<o&&(u?f.setFormula(c,h,s,t.SheetArea.viewport):f.setValue(c,h,s,t.SheetArea.viewport,!0))
}})}finally{this.resumeCalcService(),this.isPaintSuspended(s)}}},e.prototype.getArray=function(n,t,i,r,u){var o=[],h=this.getRowCount(),s=this.getColumnCount(),f,e;if(0<=n&&n<h&&0<=t&&t<s)for(n+i>h&&(i=h-n),t+r>s&&(r=s-t),f=0;f<i;f++)for(o[f]=[],e=0;e<r;e++)o[f][e]=u?this.getFormula(n+f,t+e):this.getValue(n+f,t+e);return o},e.prototype.showRowRangeGroup=function(n){return arguments.length===0?t.features.group?this._showRowRangeGroup:!1:(this._showRowRangeGroup!==n&&this._bindToAutoRefresh(function(n){this._showRowRangeGroup=n})(n),this)},e.prototype.showColumnRangeGroup=function(n){return arguments.length===0?t.features.group?this._showColumnRangeGroup:!1:(this._showColumnRangeGroup!==n&&this._bindToAutoRefresh(function(n){this._showColumnRangeGroup=n})(n),this)},e.prototype.addTable=function(n,i,r,u,f,e){if(!this._tableManager)return null;this._checkCanAddTable(n,i,r,u,f,!0),e===undefined&&(e=t.
TableStyles.medium2());var o=this.isPaintSuspended();this.isPaintSuspended(!0);try{return this._tableManager.add(new t.SheetTable(n,i,r,u,f,e))}finally{this.isPaintSuspended(o)}},e.prototype.addTableByDataSource=function(n,i,r,u,f){var s,e,o,c,h;if(!this._tableManager)return null;if(!t.features.binding)return null;if(!u)throw new Error(t._StringResource.Exp_TableDataSourceNullError);this._checkCanAddTable(n,i,r,1,1,!0),s=new t._BindingManager,s.bind(u),e=s.getRowCount(),o=s.getColumnCount(),e=e+1,i+e>this.getRowCount()&&this.setRowCount(i+e),r+o>this.getColumnCount()&&this.setColumnCount(r+o),this._checkCanAddTable(n,i,r,e,o,!0),f===undefined&&(f=t.TableStyles.medium2()),c=this.isPaintSuspended(),this.isPaintSuspended(!0);try{return h=this._tableManager.add(new t.SheetTable(n,i,r,e,o,f)),h._bind(s),h}finally{this.isPaintSuspended(c)}},e.prototype.findTable=function(n,t){return this._tableManager?this._tableManager.find(n,t):null},e.prototype.findTableBy
Name=function(n){return this._tableManager?this._tableManager.findByName(n):null},e.prototype.removeTable=function(n){if(!n||!this._tableManager)return this;var t=this.isPaintSuspended();this.isPaintSuspended(!0);try{return this._tableManager.remove(n),this}finally{this.isPaintSuspended(t)}},e.prototype.removeTableByName=function(n){var t=this.findTableByName(n);return t&&this.removeTable(t),this},e.prototype.moveTable=function(n,t,i){var u;if(!this._tableManager||!n||t<0||i<0)return this;var f=n.range(),o=f.rowCount,e=f.colCount,r=this._tableManager.findByRange(t,i,o,e);if(r)if(r.length>1)return this;else if(r.length===1&&r[0]!==n)return this;u=this.isPaintSuspended(),this.isPaintSuspended(!0);try{return n._moveTo(t,i),this}finally{this.isPaintSuspended(u)}},e.prototype.moveTableByName=function(n,t,i){var r=this.findTableByName(n);return r&&this.moveTable(r,t,i),this},e.prototype.resizeTable=function(n,t,i){var u;if(!this._tableManager||!n||t<0||
i<0)return this;var f=n.range(),o=f.row,e=f.col,r=this._tableManager.findByRange(o,e,t,i);if(r&&r.length>1)return this;u=this.isPaintSuspended(),this.isPaintSuspended(!0);try{return n._resize(t,i),this}finally{this.isPaintSuspended(u)}},e.prototype.resizeTableByName=function(n,t,i){var r=this.findTableByName(n);return r&&this.resizeTable(r,t,i),this},e.prototype.getTables=function(){if(this._tableManager)return this._tableManager.getTables()},e.prototype.selectionBackColor=function(n){if(arguments.length===0)return this._selectionBackColor;var t=this;return this._bindToAutoRefresh(function(n){return n&&(t._selectionBackColor=n),t})(n)},e.prototype.selectionBorderColor=function(n){if(arguments.length===0)return this._selectionBorderColor;var t=this;return this._bindToAutoRefresh(function(n){return n&&(t._selectionBorderColor=n),t})(n)},e.prototype._addTableInternal=function(n){if(!this._tableManager)return;var t=n.range();if(!this._checkCanAddTab
le(n.name(),t.row,t.col,t.rowCount,t.colCount))return;this._tableManager.add(n)},e.prototype._checkCanAddTable=function(n,i,r,u,f,e){if(!n){if(e)throw new Error(t._StringResource.Exp_TableEmptyNameError);return!1}if(i<0||u<1||i+u>this.getRowCount()){if(e)throw new Error(t._StringResource.Exp_TableInvalidRow);return!1}if(r<0||f<1||r+f>this.getColumnCount()){if(e)throw new Error(t._StringResource.Exp_TableInvalidColumn);return!1}if(this._hasTable(i,r,u,f)){if(e)throw new Error(t._StringResource.Exp_TableIntersectError);return!1}if(this.parent&&this.parent._findTable(n)||!this.parent&&this.findTableByName(n)){if(e)throw new Error(t._StringResource.Exp_TableHasSameNameError);return!1}return!0},e.prototype._bindToAutoRefresh=function(n,t){return t||(t=this),function(){var i=n.apply(t,arguments);return t._paintSuspended||(typeof t.invalidateLayout===f&&t.invalidateLayout(),typeof t.repaint===f&&t.repaint()),i}},e.prototype._isValidSheetNam
e=function(n){var r,t,i;if(!n||n==="")return!1;if(!this.parent)return!0;for(r=this.parent.sheets.length,t=0;t<r;t++){i=this.parent.sheets[t];if(i!==this)if(n===i._name)return!1}return!0},e.prototype._init=function(n){this._name=n,this._bounds=new t.Rect(0,0,0,0),this.reset()},e.prototype.applyOptions=function(n){var r,i,t;if(!n)return;typeof n.name===c&&n.name.length>0&&(this._name=n.name),n.data&&this.setDataSource(n.data),typeof n.defaultRowHeight===u&&(this.defaults.rowHeight=n.defaultRowHeight),typeof n.defaultColWidth===u&&(this.defaults.colWidth=n.defaultColWidth),typeof n.defaultRowHeaderColWidth===u&&(this.defaults.rowHeaderColWidth=n.defaultRowHeaderColWidth),typeof n.defaultColHeaderRowHeight===u&&(this.defaults.colHeaderRowHeight=n.defaultColHeaderRowHeight),typeof n.rowCount===u&&this.setRowCount(n.rowCount),typeof n.colCount===u&&this.setColumnCount(n.colCount),typeof n.frozenRowCoun
t===u&&(this.frozenRowCount=n.frozenRowCount),typeof n.frozenColCount===u&&(this.frozenColCount=n.frozenColCount),typeof n.frozenTrailingRowCount===u&&(this._frozenTrailingRowCount=n.frozenTrailingRowCount),typeof n.frozenTrailingColCount===u&&(this._frozenTrailingColCount=n.frozenTrailingColCount),n.gridlineColor&&(this.gridline.color=n.gridlineColor),typeof n.showVerticalGridline===o&&(this.gridline.showVerticalGridline=n.showVerticalGridline),typeof n.showHorizontalGridline===o&&(this.gridline.showHorizontalGridline=n.showHorizontalGridline),n.borderColor&&(this.borderColor=n.borderColor),typeof n.borderWidth===u&&(this.borderWidth=n.borderWidth),typeof n._zoomFactor===u&&(this._zoomFactor=n._zoomFactor),typeof n.rowHeaderVisible===o&&(this.rowHeaderVisible=n.rowHeaderVisible),typeof n.colHeaderVisible===o&&(this.colHeaderVisible=n.colHeaderVisible),typeof n.autoUpdate===o&&(th
is.autoUpdate=n.autoUpdate),typeof n.autoGenerateColumns===o&&(this.autoGenerateColumns=n.autoGenerateColumns),n.rowHeaderAutoText&&(this.rowHeaderAutoText=n.rowHeaderAutoText),n.colHeaderAutoText&&(this.colHeaderAutoText=n.colHeaderAutoText),typeof n._activeRowIndex===u&&(r=n._activeRowIndex),typeof n._activeColIndex===u&&(i=n._activeColIndex),this._setActiveCellCore(r,i),typeof n._allowCellOverflow===o&&(this._allowCellOverflow=n._allowCellOverflow),typeof n.isProtected===o&&(this.isProtected=n.isProtected),typeof n.allowUndo===o&&this.allowUndo(n.allowUndo),n.columns&&n.columns.length>0&&(this.autoGenerateColumns=!1,this.bindColumns(n.columns)),n.dataContext&&(t=new g(n.dataContext.read,n.dataContext.create,n.dataContext.update,n.dataContext.remove),this.setDataContext(t))},e.prototype._initDefaultKeyMap=function(){this.addKeyMap(t.Key.left,!1,!1,!1,t.SpreadActions.navigationLeft),this.addK
eyMap(t.Key.left,!0,!1,!1,t.SpreadActions.navigationHome2),this.addKeyMap(t.Key.right,!1,!1,!1,t.SpreadActions.navigationRight),this.addKeyMap(t.Key.right,!0,!1,!1,t.SpreadActions.navigationEnd2),this.addKeyMap(t.Key.up,!1,!1,!1,t.SpreadActions.navigationUp),this.addKeyMap(t.Key.up,!0,!1,!1,t.SpreadActions.navigationTop),this.addKeyMap(t.Key.down,!1,!1,!1,t.SpreadActions.navigationDown),this.addKeyMap(t.Key.down,!0,!1,!1,t.SpreadActions.navigationBottom),this.addKeyMap(t.Key.home,!1,!1,!1,t.SpreadActions.navigationHome),this.addKeyMap(t.Key.home,!0,!1,!1,t.SpreadActions.navigationFirst),this.addKeyMap(t.Key.end,!1,!1,!1,t.SpreadActions.navigationEnd),this.addKeyMap(t.Key.end,!0,!1,!1,t.SpreadActions.navigationLast),this.addKeyMap(t.Key.tab,!1,!1,!1,t.SpreadActions.commitInputNavigationTabNext),this.addKeyMap(t.Key.tab,!1,!0,!1,t.SpreadActions.commitInputNavigationTabPrevious),this.addKeyMap(t.Key.pup,!1,!1,!1,t.SpreadActions.navigationPageUp),this.addKeyMap(t.Key.pup,!0,!1,!1,t.Spre
adActions.navigationPreviousSheet),this.addKeyMap(t.Key.pdn,!1,!1,!1,t.SpreadActions.navigationPageDown),this.addKeyMap(t.Key.pdn,!0,!1,!1,t.SpreadActions.navigationNextSheet),this.addKeyMap(t.Key.del,!1,!1,!1,t.SpreadActions.clear),this.addKeyMap(t.Key.backspace,!1,!1,!1,t.SpreadActions.clearAndEditing),this.addKeyMap(t.Key.enter,!1,!1,!1,t.SpreadActions.commitInputNavigationDown),this.addKeyMap(t.Key.enter,!1,!0,!1,t.SpreadActions.commitInputNavigationUp),this.addKeyMap(t.Key.esc,!1,!1,!1,t.SpreadActions.cancelInput),this.addKeyMap(t.Key.left,!1,!0,!1,t.SpreadActions.selectionLeft),this.addKeyMap(t.Key.right,!1,!0,!1,t.SpreadActions.selectionRight),this.addKeyMap(t.Key.up,!1,!0,!1,t.SpreadActions.selectionUp),this.addKeyMap(t.Key.down,!1,!0,!1,t.SpreadActions.selectionDown),this.addKeyMap(t.Key.home,!1,!0,!1,t.SpreadActions.selectionHome),this.addKeyMap(t.Key.end,!1,!0,!1,t.SpreadActions.selectionEnd),this.addKeyMap(t.Key.pup,!1,!0,!1,t.SpreadActions.selectionPageUp),this.addKeyMa
p(t.Key.pdn,!1,!0,!1,t.SpreadActions.selectionPageDown),this.addKeyMap(t.Key.left,!0,!0,!1,t.SpreadActions.selectionHome),this.addKeyMap(t.Key.right,!0,!0,!1,t.SpreadActions.selectionEnd),this.addKeyMap(t.Key.up,!0,!0,!1,t.SpreadActions.selectionTop),this.addKeyMap(t.Key.down,!0,!0,!1,t.SpreadActions.selectionBottom),this.addKeyMap(t.Key.home,!0,!0,!1,t.SpreadActions.selectionFirst),this.addKeyMap(t.Key.end,!0,!0,!1,t.SpreadActions.selectionLast),this.addKeyMap(t.Key.c,!0,!1,!1,t.SpreadActions.copy),this.addKeyMap(t.Key.x,!0,!1,!1,t.SpreadActions.cut),this.addKeyMap(t.Key.v,!0,!1,!1,t.SpreadActions.paste),this.addKeyMap(t.Key.z,!0,!1,!1,t.SpreadActions.undo),this.addKeyMap(t.Key.y,!0,!1,!1,t.SpreadActions.redo)},e.prototype._setHost=function(n){var i=h.createElement("canvas"),r;i.setAttribute("id",n.getAttribute("id")+"_vp"),$(i).html("You need a browser which full supports HTML5 Canvas to run SpreadJS"),n.appendChild(i),i.gcObject=!
0,this._canvas&&($(this._canvas).unbind(tt),$(this._canvas).unbind(v),$(this._canvas).unbind(y),$(this._canvas).unbind(a),$(this._canvas).unbind(p),$(this._canvas).unbind(k),this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas)),this._canvas=i,i.setAttribute("renderMethod","auto"),r=this,this._mouseDownDelegate=function(n){return r._eventHandler.doMouseDown(n)},this._mouseMoveDelegate=function(n){if(r._eventHandler._isMouseCapture)return;r._eventHandler.doMouseMove(n)},this._mouseUpDelegate=function(n){if(!r._continueMouseUpBubble)return r._eventHandler._isMouseCapture?void 0:r._eventHandler.doMouseUp(n)},this._mouseOutDelegate=function(n){return r._eventHandler.doMouseOut(n)},this._dblClickDelegate=function(n){var i=r,e,u,c,a=i._currentTarget,f,h,s,o,l;if(i._currentTarget){i._trigger(t.Events.CellDoubleClick,{sheet:i,sheetName:i._name,sheetArea:i._currentTarget.hitTestType,row:i._currentTarget.row,col:i._currentTarget.col}),f
=a.resizeInfo;if(f){if(f.action==="sizeRow"){h=[];if(i._isRowSelected(f.index))for(e=0;e<i._selectionModel.length;e++){u=i._selectionModel[e];if(u.col===-1)for(u=i._getActualRange(u),s=0;s<u.rowCount;s++)h.push({row:u.row+s})}else h.push({row:f.index});c=new t.UndoRedo.RowAutoFitUndoAction(i,h,f.sheetArea===t.SheetArea.colHeader),i._doCommand(c)}else{o=[];if(i._isColumnSelected(f.index))for(e=0;e<i._selectionModel.length;e++){u=i._selectionModel[e];if(u.row===-1)for(u=i._getActualRange(u),l=0;l<u.colCount;l++)o.push({col:u.col+l})}else o.push({col:f.index});c=new t.UndoRedo.ColumnAutoFitUndoAction(i,o,f.sheetArea===t.SheetArea.rowHeader),i._doCommand(c)}return}}return r._eventHandler.startEdit(n)},$(i).bind(tt,this._mouseDownDelegate),$(i).bind(v,this._mouseMoveDelegate),$(i).bind(y,this._mouseUpDelegate),$(i).bind(a,this._mouseOutDelegate),$(i).bind(p,this._dblClickDelegate),this._mouseWheelDelegate=function(n){n=n?n:window.event;var i=n.detail?n.detail:n.whee
lDelta/-40;return r._eventHandler.doMouseWheel(n,parseInt(i,10)),t.util.cancelDefault(n),!1},$(i).bind(k,this._mouseWheelDelegate),$(window).unbind(d),$(window).bind(d,t.util.createEventHandler(this._eventHandler,this._eventHandler.doResize)),this._initializeActiveCell(),this._eventHandler.doResize(),this.parent&&this.parent._paintSpreadBackgroundImage()},e.prototype._disposeValidationUI=function(){this._validationInputMessage&&($(this._validationInputMessage).remove(),this._validationInputMessage=null),this._validationButton&&($(this._validationButton).remove(),this._validationButton=null),this._validationSelect&&($(this._validationSelect).remove(),this._validationSelect=null)},e.prototype._dispose=function(){this.isEditing()&&this.endEdit();var n=this._canvas;n&&($(n).unbind(tt),$(n).unbind(v),$(n).unbind(y),$(n).unbind(a),$(n).unbind(p),$(n).unbind(k),n.parentNode.removeChild(n)),this._eventHandler._dispose(),this._canvas=null,$(win
dow).unbind(d),this._filterDialiog&&this._filterDialiog.close(),this._smartTag&&this._smartTag.close(),this._editor&&$(this._editor).remove(),this._disposeValidationUI()},e.prototype._getModel=function(n){if(n===undefined||n===null||n===t.SheetArea.viewport)return this._dataModel;else if(n===t.SheetArea.rowHeader)return this._rowHeaderModel;else if(n===t.SheetArea.colHeader)return this._colHeaderModel;return null},e.prototype._getCalcModel=function(n){return n===undefined||n===null||n===t.SheetArea.viewport?this._calcDataModel:null},e.prototype._getValueImp=function(n,i,r,u){var h,e,s,o;(u===undefined||u===null)&&(u=t.SheetArea.viewport);if(u===t.SheetArea.viewport&&this.xSheet)return this.xSheet.getValue(i,r);var f=n.getValue(i,r),a=window.ko,l=this.getDataSource();return(f===undefined||f===null)&&l&&(u===undefined||u===null||u===t.SheetArea.viewport)&&(f=this._bindingManager.getValue(i,r)),h=!1,u===t.SheetArea.viewpor
t&&this._tableManager&&(e=this._tableManager.find(i,r),e&&e.showHeader()&&i===e.headerIndex()&&(s=e._getColumn(r),s&&(h=!0,(f===undefined||f===null)&&(f=s.name())))),$.type(f)===c&&(ct.test(f)?(o=f.match(ct),f=t._DateTimeHelper.fromOADate(parseFloat(o[1]))):rt.test(f)&&(o=f.match(rt),f=new Date(parseFloat(o[1])))),h&&f!==null&&f!==undefined&&(f=t.util.toString(f)),f},e.prototype._getSwapIndex=function(n,t,i){var r=n[i-t];while(r.index<i)r=n[r.index-t];return r.index},e.prototype._quickSortImp=function(n){var t,i;if(n.length<=1)return n;var o=Math.floor(n.length/2),e=n[o],r=[],u=[],f=[];for(t=0;t<n.length;t++)i=this._sortCompare(n[t],e),i<0?r.push(n[t]):i>0?u.push(n[t]):f.push(n[t]);return this._quickSortImp(r).concat(f,this._quickSortImp(u))},e.prototype._quickSort=function(n,t,i,r,u,f){var s=u?i:r,o=[],e;if(u)for(e=0;e<s;e++)o[e]={sheet:this,index:n+e,byRows:u,sortInfo:
f};else for(e=0;e<s;e++)o[e]={sheet:this,index:t+e,byRows:u,sortInfo:f};return o=this._quickSortImp(o)},e.prototype._isEquals=function(n,i){return n instanceof Date&&i instanceof Date?new t._DateTimeHelper(n).toOADate()===new t._DateTimeHelper(i).toOADate():n===i},e.prototype._isGreaterThan=function(n,i){return typeof n=="boolean"?n=n?1:0:n instanceof Date&&(n=new t._DateTimeHelper(n).toOADate()),typeof i=="boolean"?i=i?1:0:i instanceof Date&&(i=new t._DateTimeHelper(i).toOADate()),typeof n!=typeof i&&(typeof n=="number"||typeof i=="number")?typeof i=="number":n>i},e.prototype._sortCompare=function(n,t){var i,u,r,e,f,s,h,o;if(n.sortInfo&&n.sortInfo.length>0){for(i=0,s=0;s<n.sortInfo.length;s++){n.sortInfo[s]&&(h=n.sortInfo[s].ascending,o=n.sortInfo[s].index,0>o||(n.byRows?(u=n.sheet.getValue(n.index,o),r=t.sheet.getValue(t.index,o),e=u===undefined||u===null||u==="&qu
ot;,f=r===undefined||r===null||r==="",e||f?e&&f?i=0:e&&!f?i=1:!e&&f&&(i=-1):i=this._isEquals(u,r)?0:this._isGreaterThan(u,r)?h?1:-1:h?-1:1):(u=n.sheet.getValue(o,n.index),r=t.sheet.getValue(o,t.index),e=u===undefined||u===null||u==="",f=r===undefined||r===null||r==="",e||f?e&&f?i=0:e&&!f?i=1:!e&&f&&(i=-1):i=this._isEquals(u,r)?0:this._isGreaterThan(u,r)?h?1:-1:h?-1:1)));if(i!==0)break}return i}return 0},e.prototype._getActualRange=function(n,i){(i===undefined||i===null)&&(i=t.SheetArea.viewport);var r=new t.Range(-1,-1,-1,-1);return n===null||n===undefined?r:(r.col=n.col,r.row=n.row,r.colCount=n.colCount,r.rowCount=n.rowCount,r.col===-1&&(r.col=0,r.colCount=this.getColumnCount(i)),r.row===-1&&(r.row=0,r.rowCount=this.getRowCount(i)),r)},e.prototype._getActiveSelectionRect=function(n,t){return this._getRangeRect(n,t,this._getActiveSelectedRange())},e.prototype._getRan
geRect=function(n,i,r){var u=new t.Rect(-1,-1,-1,-1),o=this._getSheetLayout();if(o.width===0||o.height===0)return u;var y=this._getActualRange(r),b=this,a=function(n,t){for(var r=0,i=n;i<=t;i++)r+=b._getZoomColumnWidth(i);return r},v=function(n,t){for(var r=0,i=n;i<=t;i++)r+=b._getZoomRowHeight(i);return r},e=y.row,p=y.row+y.rowCount-1,f=y.col,w=y.col+y.colCount-1,nt=this.frozenRowCount,d=this.getRowCount()-this._frozenTrailingRowCount-1,k=this.frozenColCount,g=this.getColumnCount()-this._frozenTrailingColCount-1,c,s,h,l;return i===0?f<k&&(u.x=o.frozenX+a(0,f-1),u.width=a(f,w)):i===1?f>g||w<k||(c=this._getViewportColumnLayout(1),c&&c.length>0&&(h=c[0].col,u.x=f<h?o.viewportX-a(f,h-1):o.viewportX+a(h,f-1),u.width=a(f,w))):i===2&&w>g&&(c=this._getViewportColumnLayout(2),c&&c.length>0&&(h=c[0].col,u.x=f<h?o.frozenTrailingX-a(f,h-1):o.frozenTrailingX+a(h,f-1),u.width=a(f,w))),n===0?e<nt&&(u.
y=o.frozenY+v(0,e-1),u.height=v(e,p)):n===1?e>d||p<nt||(s=this._getViewportRowLayout(1),s&&s.length>0&&(l=s[0].row,u.y=e<l?o.viewportY-v(e,l-1):o.viewportY+v(l,e-1),u.height=v(e,p))):n===2&&p>d&&(s=this._getViewportRowLayout(2),s&&s.length>0&&(l=s[0].row,u.y=e<l?o.frozenTrailingY-v(e,l-1):o.frozenTrailingY+v(l,e-1),u.height=v(e,p))),u},e.prototype._getRangeRect2=function(n){var i=new t.Rect(0,0,0,0),v=this._getSheetLayout();if(v.width===0||v.height===0)return i;var w=this._getActualRange(n),b=isNaN(this.frozenColCount)?0:this.frozenColCount,k=isNaN(this.frozenRowCount)?0:this.frozenRowCount,y=isNaN(this._frozenTrailingColCount)?0:this._frozenTrailingColCount,p=isNaN(this._frozenTrailingRowCount)?0:this._frozenTrailingRowCount,d=this,h=function(n,t){for(var r=0,i=n;i<=t;i++)r+=d._getZoomColumnWidth(i);return r},l=function(n,t){for(var r=0,i=n;i<=t;i++)r+=d._getZoomRowHeight(i);return r},a=w.row,f=w.row+w.rowCo
unt-1,c=w.col,e=w.col+w.colCount-1,s=this.getRowCount(),o=this.getColumnCount(),u,r;return c<b?(i.x=v.frozenX+h(0,c-1),i.width=h(c,Math.min(e,b-1)),b<=e&&e<o-y?(u=this._getViewportColumnLayout(1),u&&u.length>0&&(i.width+=h(u[0].col,Math.min(e,u[u.length-1].col)))):e<o-y||(u=this._getViewportColumnLayout(2),u&&u.length>0&&(i.width=u[0].x-i.x,i.width+=h(o-y,Math.min(e,o-1))))):c<o-y?(u=this._getViewportColumnLayout(1),u&&u.length>0&&(i.x=v.viewportX+h(u[0].col,c-1)),b<=e&&e<o-y?u&&u.length>0&&(i.width=h(Math.max(c,u[0].col),Math.min(e,u[u.length-1].col))):e<o-y||(u=this._getViewportColumnLayout(2),u&&u.length>0&&(i.width=u[0].x-i.x,i.width+=h(o-y,Math.min(e,o-1))))):c<o&&(u=this._getViewportColumnLayout(2),u&&u.length>0&&(i.x=v.frozenTrailingX+h(u[0].col,c-1),i.width=h(c,Math.min(e,o-1)))),a<k?(i.y=v.frozenY+l(0,a-1),i.
height=l(a,Math.min(f,k-1)),k<=f&&f<s-p?(r=this._getViewportRowLayout(1),r&&r.length>0&&(i.height+=l(r[0].row,Math.min(f,r[r.length-1].row)))):f<s-p||(r=this._getViewportRowLayout(2),r&&r.length>0&&(i.height=r[0].y-i.y,i.height+=l(s-p,Math.min(f,s-1))))):a<s-p?(r=this._getViewportRowLayout(1),r&&r.length>0&&(i.y=v.viewportY+l(r[0].row,a-1)),k<=f&&f<s-p?r&&r.length>0&&(i.height=l(Math.max(a,r[0].row),Math.min(f,r[r.length-1].row))):f<s-p||(r=this._getViewportRowLayout(2),r&&r.length>0&&(i.height=r[0].y-i.y,i.height+=l(s-p,Math.min(f,s-1))))):a<s&&(r=this._getViewportRowLayout(2),r&&r.length>0&&(i.y=v.frozenTrailingY+l(r[0].row,a-1),i.height+=l(a,Math.min(f,s-1)))),i},e.prototype._getCanvas=function(){var n=this._canvas;return!n&&this.parent&&(n=this.parent.canvas),n&&!n.getContext&&n.firstChil
d&&(n.getContext=n.firstChild.getContext),n},e.prototype._draw=function(n,t){var i=this._render._getCtx();i&&this._render.paint(i,t)},e.prototype._getStringWidth=function(n,t){var r=this._getEditingSpan(),f,i,u;return r.style.font="",r.style.font=t?t:this._render._getZoomFont(this._render._getDefaultFont()),n=n+"",$(r).text(n),f=r.offsetWidth,i=this._getEditingPre(),i.style.font=t?t:this._render._getZoomFont(this._render._getDefaultFont()),$(i).text(n),u=i.offsetWidth,$.browser.mozilla?(f+=3,u+=3):$.browser.msie&&(f+=1,u+=1),Math.max(f,u)},e.prototype._getFontHeight=function(n){var t=this._getEditingSpan();return t.style.font=n?n:this._render._getDefaultFont(),t.innerHTML="H",t.offsetHeight},e.prototype._getEditingSpan=function(){if(!this._editingSpan){var n=h.createElement("span");n.style.visibility=b,n.style.top="-10000px",n.style.left="-10000px",n.style.position="absolute",n.className=&q
uot;gcStringWidthSpanStyle",n.setAttribute("gcUIElement","gcStringWidthSpan"),h.body.insertBefore(n,null),this._editingSpan=n}return this._editingSpan},e.prototype._getEditingPre=function(){if(!this._editingPre){var n=h.createElement("pre");n.style.visibility=b,n.style.top="-10000px",n.style.left="-10000px",n.style.position="absolute",n.className="gcStringWidthPreStyle",n.setAttribute("gcUIElement","gcStringWidthPre"),h.body.insertBefore(n,null),this._editingPre=n}return this._editingPre},e.prototype._getColumnViewportIndexFromX=function(n){var t=this._getSheetLayout(),i=null;return t.headerX<n&&n<t.headerX+t.rowHeaderWidth?i=-1:t.frozenX<n&&n<t.frozenX+t.frozenWidth?i=0:t.viewportX<n&&n<t.viewportX+t.viewportWidth?i=1:t.frozenTrailingX<n&&n<t.frozenTrailingX+t.frozenTrailingWidth&&(i=2),i},e.prototype._getRowViewportIndexFrom
Y=function(n){var t=this._getSheetLayout(),i=null;return t.headerY<n&&n<t.headerY+t.colHeaderHeight?i=-1:t.frozenY<n&&n<t.frozenY+t.frozenHeight?i=0:t.viewportY<n&&n<t.viewportY+t.viewportHeight?i=1:t.frozenTrailingY<n&&n<t.frozenTrailingY+t.frozenTrailingHeight&&(i=2),i},e.prototype._getRowIndexFromY=function(n,t){var i=null,r;i=t===-1?this._getColumnHeaderRowLayout():this._getViewportRowLayout(t);if(i){r=i.findY(n);if(r)return r.row}},e.prototype._getColumnIndexFromX=function(n,t){var i=null,r;i=t===-1?this._getRowHeaderColumnLayout():this._getViewportColumnLayout(t);if(i){r=i.findX(n);if(r)return r.col}},e.prototype._isActiveCell=function(n,t){return this._activeRowIndex<=n&&n<this._activeRowIndex+this._activeRowCount&&this._activeColIndex<=t&&t<this._activeColIndex+this._activeColCount},e.prototype._isColumnSelected=function(n){for(var t,r,i=0;i<this._selectionModel.length;i++)
{t=this._selectionModel[i],r=t.col===-1?0:t.col;if(t.row===-1&&n>=r&&n<r+t.colCount)return!0}return!1},e.prototype._isRowSelected=function(n){for(var t,r,i=0;i<this._selectionModel.length;i++){t=this._selectionModel[i],r=t.row===-1?0:t.row;if(t.col===-1&&n>=r&&n<r+t.rowCount)return!0}return!1},e.prototype._isSelected=function(n,i,r){for(var f=!1,o,u,e=0;e<this._selectionModel.length;e++){o=this._selectionModel[e],u=this._getActualRange(o),r===undefined||r===null||r===t.SheetArea.viewport?f=u.row<=n&&n<u.row+u.rowCount&&u.col<=i&&i<u.col+u.colCount:r===t.SheetArea.rowHeader?f=n===this._activeRowIndex||u.row<=n&&n<u.row+u.rowCount:r===t.SheetArea.colHeader?f=i===this._activeColIndex||u.col<=i&&i<u.col+u.colCount||i<0&&u.row===0&&u.col===0&&u.rowCount===this.getRowCount()&&u.colCount===this.getColumnCount():r===t.SheetArea.corner&&
(f=u.row===-1&&u.col===-1&&u.rowCount===this.getRowCount()&&u.colCount===this.getColumnCount());if(f)return f}return f},e.prototype._isAllSelected=function(n,i,r){for(var f=!1,h=this.getRowCount(),c=this.getColumnCount(),u,o,s,e=0;e<this._selectionModel.length;e++){u=this._selectionModel[e],r!==undefined&&r!==null&&r!==t.SheetArea.viewport&&(r===t.SheetArea.rowHeader?(o=u.row===-1?0:u.row,f=u.col===-1&&n>=o&&n<o+u.rowCount):r===t.SheetArea.colHeader?(s=u.col===-1?0:u.col,f=u.row===-1&&i>=s&&i<s+u.colCount):r===t.SheetArea.corner&&(f=u.row===-1&&u.col===-1&&u.rowCount===h&&u.colCount===c));if(f)return f}return f},e.prototype._isHover=function(n,i,r){var s=!1,u=this._currentTarget,f,e,o;if(this._currentTarget&&r!==undefined&&r!==null)if(r===t.SheetArea.colHeader)return f=!1,e=this._colHeaderSpanModel.find(u.row,u.col),e&&(f=e.contains(n
,i,1,1)),o=n===u.row&&i===u.col||f,u.hitTestType===r&&o;else if(r===t.SheetArea.rowHeader)return f=!1,e=this._rowHeaderSpanModel.find(u.row,u.col),e&&(f=e.contains(n,i,1,1)),o=n===u.row&&i===u.col||f,u.hitTestType===r&&o;else if(r===t.SheetArea.viewport)return u.hitTestType===r&&n===u.row&&i===u.col;else if(r===t.SheetArea.corner)return u.hitTestType===r;return s},e.prototype._indexToLetters=function(n){for(var u="A",r=u.charCodeAt(0),t="",i;n>0;n=(n-1)/26)i=parseInt((n-1)%26,10),(n===1||i>=0&&n>1)&&(t=String.fromCharCode(r+i)+t);return t},e.prototype._doStartEdit=function(n,t,i){var r=this.hitTest(t,i),s;if(!r)return;if(r.row>=0&&r.col>=0&&r.rowViewportIndex>=0&&r.colViewportIndex>=0&&!r.resizeInfo&&!r.dragInfo&&r.row===this._activeRowIndex&&r.col===this._activeColIndex){s=this.isEditing(),this._startEditImp(n,r.row
,r.col);if(!s&&this.isEditing()){var f=r.row,u=r.col,h=r.hitTestType,e=this.getCellType(r.row,r.col);if(e._triggerButtonClicked){var c=this.getCellRect(f,u),l=this.getActualStyle(f,u,h),o=e.getHitInfo(t,i,f,u,l,c,h);o&&o.isReservedLocation&&e._triggerButtonClicked(this,f,u)}}}},e.prototype._getSheetAreaFromHitTest=function(n){var i=n.rowViewportIndex,r=n.colViewportIndex;if(i<0||i>2||r<0)if(i<0||i>2||r>=0){if(i<0&&r>=0)return t.SheetArea.colHeader;else if(i<0&&r<0)return t.SheetArea.corner}else return t.SheetArea.rowHeader;else return t.SheetArea.viewport;return null},e.prototype._startEditImp=function(n,i,r,u,f,e,o){var w,y,v,c,p,b,s,nt,ft,tt,g,d,rt,it,a;if(this.isEditing())return;!window.gcGlobal.activeElement&&this._eventHandler&&this._eventHandler._setFocus();if(this.getRowHeight(i)<=0||this.getColumnWidth(r)<=0)return;this.showCell(this._activeRowIndex,this._activeColIndex,t.VerticalPosi
tion.nearest,t.HorizontalPosition.nearest),w=this.getActualStyle(i,r);if(this.isProtected&&w.locked!==!1)return;y=i,v=r;if(y>=0&&v>=0){c=this.getCellType(i,r);if(!c)return;c.isImeAware()?this._eventHandler&&(p=this._eventHandler._cellTypeFocusHolder):p=c.createEditorElement();if(!p)return;this._editor=p,Object.defineProperty(p,"sheet",{value:this,writable:!1}),b={sheet:this,sheetName:this._name,row:y,col:v,cancel:!1},this._trigger(t.Events.EditStarting,b);if(b&&b.cancel===!0)return;var et=this.getValue(y,v),ot=this.getFormula(y,v),st=this._editorStatus;this._editorStatus=this._startEditByKeydown?t.EditorStatus.Enter:(et===null||et===undefined)&&(ot===null||ot===undefined)?t.EditorStatus.Enter:t.EditorStatus.Edit,this._trigger(t.Events.EditorStatusChanged,{sheet:this,sheetName:this._name,oldStatus:st,newStatus:this._editorStatus});var k=this.getCellRect(y,v,u,f),ut=this._getSheetLayout(),l=n.currentStyle;h.defaultView&&h
.defaultView.getComputedStyle&&(l=h.defaultView.getComputedStyle(n,"")),l||(l=n.style),l.borderTopWidth===undefined||l.borderTopWidth===null||isNaN(l.borderTopWidth)||(k.y+=parseFloat(l.borderTopWidth)),l.borderLeftWidth===undefined||l.borderLeftWidth===null||isNaN(l.borderLeftWidth)||(k.x+=parseFloat(l.borderLeftWidth)),c.activateEditor(this._editor,w,k),s=this.getFormula(y,v),s&&(s="="+s),nt=s,s&&s.length!==0||(s=this.getValue(y,v),ft=this.parent?this.parent.canUserEditFormula():!0,s&&s.length>0&&/^=/ig.test(s)&&ft&&(s="'"+s),nt=s,s=c._formatEditorValue(this._editor,w,s)),this._editor._oldValue=s,o!==null&&o!==undefined&&(s=o),c.setEditorValue(this._editor,s),this._editor._originalValue=nt,c.updateEditor(this._editor,w,k),tt=t.SheetArea.colHeader,g=t.SheetArea.rowHeader,this.showEditingLocator&&(d=c._getLocator(),p._editingLocator=d,rt=this.getValue(this._getModel(tt).r
owCount-1,r,tt),it=this.getValue(i,this._getModel(g).colCount-1,g),d.innerHTML=rt+""+it,c._updateEditorLocator(this._editor),h.body.insertBefore(d,null)),c.focus(this._editor),e&&c.selectAll(this._editor),this._allowCellOverflow&&(a=this.getCellRect(i,r,u,f),a.x-=2,a.y-=2,a.width+=4,a.height+=4,a.x=ut.frozenX,a.width=ut.viewportWidth,this.repaint(a)),window.gcGlobal.activeElement=this}},e.prototype._showEditingLocator=function(){var i,r;if(this.isEditing()===!1)return;if(this._editor&&this._editor._editingLocator){var u=$(this._editor),n=parseInt(u.css(vt),10)+this.getColumnWidth(this._activeColIndex)/2,t=parseInt(u.css(pt),10)+this.getRowHeight(this._activeRowIndex)/2,f=$(this._getCanvas()).offset();n-=f.left,t-=f.top,i=this._getRowIndexFromY(t,this._getRowViewportIndexFromY(t)),r=this._getColumnIndexFromX(n,this._getColumnViewportIndexFromX(n)),i===this._activeRowIndex&&r===this._activeColIndex?$(this._editor._editingLocator).css(ft,b):$(t
his._editor._editingLocator).css(ft,"visible")}},e.prototype._getKeyAction=function(n,t,i,r){var e,f,u;if(!this.keyMap)return null;for(e=this.keyMap.length,f=0;f<e;f++){u=this.keyMap[f];if(u&&u.key===n&&u.ctrl===t&&u.shift===i&&u.alt===r)return u}return null},e.prototype._moveActiveCellUp=function(n,t,i,r,u){var e,o,f;if(n===0&&!i)return;e=this.getRowCount(),o=this.getColumnCount(),(this._leadingCellCol===undefined||this._leadingCellCol===null)&&(this._leadingCellCol=0),f=this._getPrevRow(n,this._leadingCellCol,r,u),i||this._adjustCell(f),n=f.r,t=f.c,n<0&&i&&(t=this._getPrevVisualColumn(t),(t<0||t===undefined||t===null)&&(t=this._getPrevVisualColumn(o)),this._leadingCellCol=t,f=this._getPrevRow(e,t,r,u),n=f.r,t=f.c),this._canMoveCurrentTo(n,t)&&(this._leadingCellRow=n,this._setActiveCellCore(n,t))},e.prototype._moveActiveCellDown=function(n,t,i,r,u){var e=this.getRowCount(),o=this.getC
olumnCount(),f;if(n===e-1&&!i)return;(this._leadingCellCol===undefined||this._leadingCellCol===null)&&(this._leadingCellCol=0),f=this._getNextRow(n,this._leadingCellCol,r,u),i||this._adjustCell(f),n=f.r,t=f.c,n===e&&i&&(t=this._getNextVisualColumn(t),t<o&&t!==undefined&&t!==null||(t=this._getNextVisualColumn(-1)),this._leadingCellCol=t,f=this._getNextRow(-1,t,r,u),n=f.r,t=f.c),this._canMoveCurrentTo(n,t)&&(this._leadingCellRow=n,this._setActiveCellCore(n,t))},e.prototype._moveActiveCellLeft=function(n,t,i,r,u){var e,o,f;if(t===0&&!i)return;e=this.getRowCount(),o=this.getColumnCount(),(this._leadingCellRow===undefined||this._leadingCellRow===null)&&(this._leadingCellRow=0),f=this._getPrevColumn(this._leadingCellRow,t,r,u),i||this._adjustCell(f),n=f.r,t=f.c,t<0&&i&&(n=this._getPrevVisualRow(n),(n<0||n===undefined||n===null)&&(n=this._getPrevVisualRow(e)),this._leadingCellRow=n,f=th
is._getPrevColumn(n,o,r,u),n=f.r,t=f.c),this._canMoveCurrentTo(n,t)&&(this._leadingCellCol=t,this._setActiveCellCore(n,t))},e.prototype._adjustCell=function(n){n.r<0?n.r=this._getFirstVisualRow():n.r<this.getRowCount()||(n.r=this._getLastVisualRow()),n.c<0?n.c=this._getFirstVisualColumn():n.c<this.getColumnCount()||(n.c=this._getLastVisualColumn())},e.prototype._fixRange=function(n){var u=n.row<0?0:n.row,f=n.col<0?0:n.col,i=n.row<0?this.getRowCount():n.rowCount,r=n.col<0?this.getColumnCount():n.colCount;return new t.Range(u,f,i,r)},e.prototype._moveActiveCellLeftInSelection=function(n,i){var r=this._fixRange(this._getActiveSelectedRange()),s=r.row,o=r.col,h=r.col+r.colCount-1,e=this._getPrevColumnInSelection(n,i,!1,!1),u,f;n=e.r,i=e.c;if(i<o){n-=1;if(n<s){r=this._fixRange(this._getActiveSelectedRange(t.Direction.left)),u=r.row+r.rowCount-1,f=r.col+r.colCount,f<this._scrollLeftCol?this._scrollLeftCol=f:f>this._getPageRightColumn()&&
(this._scrollLeftCol=f,this._setLeftColumn(this._getPrevPageLeftColumn())),u<this._scrollTopRow?this._setTopRow(u):u>this._getPageBottomRow()&&(this._scrollTopRow=u,this._setTopRow(this._getPrevPageTopRow())),this._moveActiveCellLeftInSelection(u,f);return}this._moveActiveCellLeftInSelection(n,h+1);return}n<0||(this._setActiveCellCore(n,i),this._leadingCellRow=n,this._leadingCellCol=i)},e.prototype._moveActiveCellRightInSelection=function(n,i){var r=this._fixRange(this._getActiveSelectedRange()),s=r.col,o=r.row+r.rowCount-1,h=r.col+r.colCount-1,e=this._getNextColumnInSelection(n,i,!1,!1),u,f;n=e.r,i=e.c;if(i>h){n+=1;if(n>o){r=this._fixRange(this._getActiveSelectedRange(t.Direction.right)),u=r.row,f=r.col,f<this._scrollLeftCol?this._setLeftColumn(this._getNextVisualColumn(f-1)):f>this._getPageRightColumn()&&(this._scrollLeftCol=f,this._setLeftColumn(this._getPrevPageLeftColumn())),u<this._scrollTopRow?this._setTopRow(this._getNextVisualRow(u-1)
):u>this._getPageBottomRow()&&(this._scrollTopRow=u,this._setTopRow(this._getPrevPageTopRow())),this._moveActiveCellRightInSelection(u,f-1);return}this._moveActiveCellRightInSelection(n,s-1);return}n<0||(this._setActiveCellCore(n,i),this._leadingCellRow=n,this._leadingCellCol=i)},e.prototype._moveActiveCellRight=function(n,t,i,r,u){var o=this.getRowCount(),e=this.getColumnCount(),f;if(t===e-1&&!i)return;(this._leadingCellRow===undefined||this._leadingCellRow===null)&&(this._leadingCellRow=0),f=this._getNextColumn(this._leadingCellRow,t,r,u);if(!i){if(f.c===e)return;this._adjustCell(f)}n=f.r,t=f.c,t===e&&i&&(n=this._getNextVisualRow(n),n<o&&n!==undefined&&n!==null||(n=this._getNextVisualRow(-1)),this._leadingCellRow=n,f=this._getNextColumn(n,-1,r,u),n=f.r,t=f.c),this._canMoveCurrentTo(n,t)&&(this._leadingCellCol=t,this._setActiveCellCore(n,t))},e.prototype._getPrevColumn=function(n,i,r,u){var o={r:n,c:i},e,f;whi
le(i>=0){i--;if(i<0)break;e=this.getSpans(new t.Range(n,i,1,1)),e&&e.length>0&&(f=e[0],i<f.col||(i=f.col,n=f.row));if(this._canMoveCurrentTo(n,i,o))return{r:n,c:i}}return{r:n,c:i}},e.prototype._getPrevColumnInSelection=function(n,t,i,r){var u,f;while(t>=0){t--;if(t<0)break;u=this._spanModel.find(n,t);if(u){f=this._getActiveSelectedRange();if(f.row>u.row||u.row+u.rowCount>f.row+f.rowCount||f.col>u.col||u.col+u.colCount>f.col+f.colCount)continue;else if(!(u.row===n&&u.col===t))continue;t<u.col||(t=u.col,n=u.row)}if(this._canMoveCurrentTo(n,t))return{r:n,c:t}}return{r:n,c:t}},e.prototype._getNextColumn=function(n,i,r,u){var s=this.getColumnCount(),h={r:n,c:i},o,e,f;while(i<s){o=this._spanModel.find(n,i),o?i+=o.colCount:i++;if(i>=s)break;e=this.getSpans(new t.Range(n,i,1,1)),e&&e.length>0&&(f=e[0],i>f.col?i=Math.max(i,f.col+f.colCount):n=f.row);if(this._canMoveCurrentTo(n,i,h))return{r:n,c:i}}return{r:n
,c:i}},e.prototype._getNextColumnInSelection=function(n,t,i,r){var o=this.getColumnCount(),e,u,f;while(t<o){e=this._spanModel.find(n,t),e?t+=e.colCount:t++;if(t>=o)break;u=this._spanModel.find(n,t);if(u){f=this._getActiveSelectedRange();if(f.row>u.row||u.row+u.rowCount>f.row+f.rowCount||f.col>u.col||u.col+u.colCount>f.col+f.colCount)continue;else if(!(u.row===n&&u.col===t))continue;t>u.col?t=Math.max(t,u.col+u.colCount):n=u.row}if(this._canMoveCurrentTo(n,t))return{r:n,c:t}}return{r:n,c:t}},e.prototype._canMoveCurrentTo=function(n,t,i){var r=!1,e=this.getRowVisible(n),o=this.getColumnVisible(t),u=this._getZoomRowHeight(n),f=this._getZoomColumnWidth(t);return r=n>=0&&n<this.getRowCount()&&t>=0&&t<this.getColumnCount()&&e&&o&&u>0&&f>0},e.prototype._getPrevRow=function(n,i,r,u){var o={r:n,c:i},e,f;while(n>=0){n--;if(n<0)break;e=this.getSpans(new t.Range(n,i,1,1)),e&&e.le
ngth>0&&(f=e[0],n<f.row||(n=f.row,i=f.col));if(this._canMoveCurrentTo(n,i,o))return{r:n,c:i}}return{r:n,c:i}},e.prototype._getNextRow=function(n,i,r,u){var s=this.getRowCount(),h={r:n,c:i},o,e,f;while(n<s){o=this._spanModel.find(n,i),o?n+=o.rowCount:n++;if(n>=s)break;e=this.getSpans(new t.Range(n,i,1,1)),e&&e.length>0&&(f=e[0],n>f.row?n=Math.max(n,f.row+f.rowCount):i=f.col);if(this._canMoveCurrentTo(n,i,h))return{r:n,c:i}}return{r:n,c:i}},e.prototype._setSelectedRange=function(n,t,i,r,u){this._selectionModel.add(n,t,i,r),u&&this._render.repaintSelection()},e.prototype._extendSelectedRange=function(n,i,r){var u=this._getExtendedRange(n,i),s=u.row,h=u.col,c=u.rowCount,f=u.colCount,e=this.selectionPolicy(),o=this.selectionUnit();if(e===t.SelectionPolicy.Single)return;else e===t.SelectionPolicy.Range&&this._selectionModel.clear();o===t.SelectionUnit.Row?(h=-1,f=-1):o===t.SelectionUnit.Column&&(s=-1,c=-1),this._replaceActi
veSelectedRange(s,h,c,f,r)},e.prototype._getExtendedRange=function(n,i){var s=new t.Range(this._activeRowIndex,this._activeColIndex,1,1),o=this._spanModel.find(this._activeRowIndex,this._activeColIndex),e,f,r,u;return o&&(s=o),e=new t.Range(n,i,1,1),f=this._spanModel.find(n,i),f&&(e=f),r=s.union(e),u=this.getSpans(),u&&u.length>0&&(r=this._inflateRangeToCoverSpans(u,r)),r},e.prototype._replaceActiveSelectedRange=function(n,i,r,u,f){var o=this._getActiveSelectedRange(),e,s;this._selectionModel.length>0?this._selectionModel.splice(this._selectionModel.activeSelectedRangeIndex,1,new t.Range(n,i,r,u)):this._selectionModel.add(n,i,r,u);if(f){e=this._getActiveSelectedRange();if(e.row===o.row&&e.col===o.col&&e.rowCount===o.rowCount&&e.colCount===o.colCount)return;s=this._render,o.containsRange(e)?s.repaintSelection(o):e.containsRange(o)?s.repaintSelection(e):(s.repaintSelection(o),s.repaintSelection(e))}},e.prototype._changeActi
veSelectedRange=function(n,i){var f,r,u,e;if(this._selectionModel.length<=0)return;f=this._getActiveSelectedRange(),r=new t.Range(f.row,f.col,f.rowCount,f.colCount),r.row<0&&(r.row=0,r.rowCount=this.getRowCount()),r.col<0&&(r.col=0,r.colCount=this.getColumnCount()),u=null,n===t.Key.left?u=i?this._searchSelectedRangebyLeftCtrl(r):this._searchSelectedRangebyLeft(r):n===t.Key.right?u=i?this._searchSelectedRangebyRightCtrl(r):this._searchSelectedRangebyRight(r):n===t.Key.up?u=i?this._searchSelectedRangebyUpCtrl(r):this._searchSelectedRangebyUp(r):n===t.Key.down?u=i?this._searchSelectedRangebyDownCtrl(r):this._searchSelectedRangebyDown(r):n===t.Key.home?u=i?this._searchSelectedRangebyHomeCtrl(r):this._searchSelectedRangebyHome(r):n===t.Key.end?u=i?this._searchSelectedRangebyEndCtrl(r):this._searchSelectedRangebyEnd(r):n===t.Key.pup?u=this._searchSelectedRangebyPageUp(r):n===t.Key.pdn&&(u=this._searchSelectedRangebyPageDown(r));if(u){f.row<0&&(u
.row=-1,u.rowCount=-1),f.col<0&&(u.col=-1,u.colCount=-1);var l=this._selectionModel.toArray(),h=u.row,a=u.col,v=u.rowCount,c=u.colCount,o=this.selectionPolicy(),s=this.selectionUnit();if(o===t.SelectionPolicy.Single)return;else o===t.SelectionPolicy.Range&&this._selectionModel.clear();s===t.SelectionUnit.Row?(a=-1,c=-1):s===t.SelectionUnit.Column&&(h=-1,v=-1),this._replaceActiveSelectedRange(h,a,v,c,!0),e=this._selectionModel.toArray(),this._eventHandler._notEqualSelecions(l,e)&&(this._trigger(t.Events.SelectionChanging,{sheet:this,sheetName:this._name,oldSelections:l,newSelections:e}),this._trigger(t.Events.SelectionChanged,{sheet:this,sheetName:this._name}))}},e.prototype._searchSelectedRangebyLeft=function(n){var u=n.col+n.colCount-1,a=0,c={r:n.row+n.rowCount-1,c:u},i,e,r,l,h,o,s,f;while(u>a){u--;if(!this._canMoveCurrentTo(c.r,u,c))continue;i=this._getExtendedRange(c.r,u),e=Math.min(n.row,i.row),r=Math.min(n.col,i.col),l=Math.max(n.row+n.rowC
ount-1,i.row+i.rowCount-1),h=Math.min(n.col+n.colCount-1,i.col+i.colCount-1),o=l-e+1,s=h-r+1;if(!(e===n.row&&r===n.col&&o===n.rowCount&&s===n.colCount))return f=this._getPrevVisualColumn(this._scrollLeftCol),(r===f||h===f)&&this._setLeftColumn(f),new t.Range(e,r,o,s)}return null},e.prototype._searchSelectedRangebyLeftCtrl=function(n,i){var l=this.frozenColCount?this._getNextVisualColumn(this.frozenColCount-1):this._getFirstVisualColumn(),u=i?l:this._getFirstVisualColumn(),r,e,f,c,h,s,o;if(u===undefined||u===null)return;else(this.frozenColCount<=0||i)&&this._setLeftColumn(u);return r=this._getExtendedRange(n.row,u),e=Math.min(n.row,r.row),f=Math.min(n.col,r.col),c=Math.max(n.row+n.rowCount-1,r.row+r.rowCount-1),h=Math.min(n.col+n.colCount-1,r.col+r.colCount-1),s=c-e+1,o=h-f+1,new t.Range(e,f,s,o)},e.prototype._searchSelectedRangebyRight=function(n){var f=n.col,v=this.getColumnCount()-1,l={r:n.row+n.rowCount-1,c:f},i,o,u,a,e,c,s,r,h;while(f&l
t;v){f++;if(!this._canMoveCurrentTo(l.r,f,l))continue;i=this._getExtendedRange(l.r,f),o=Math.min(n.row,i.row),u=Math.max(n.col,i.col),a=Math.max(n.row+n.rowCount-1,i.row+i.rowCount-1),e=Math.max(n.col+n.colCount-1,i.col+i.colCount-1),c=a-o+1,s=e-u+1;if(!(o===n.row&&u===n.col&&c===n.rowCount&&s===n.colCount))return r=this.frozenColCount?this._getNextVisualColumn(this.frozenColCount-1):null,h=this._getPageRightColumn(),r!==undefined&&r!==null&&(u===r||e===r)?this._setLeftColumn(r):(u===h||e===h)&&this._setLeftColumn(this._getNextVisualColumn(this._scrollLeftCol)),new t.Range(o,u,c,s)}return null},e.prototype._searchSelectedRangebyRightCtrl=function(n,i){var e=this._getLastPageLeftColumn(),o,r,f,u,c,l,s,h;if(e===undefined||e===null)return;else this._setLeftColumn(e);return o=this._getLastVisualColumn(),i||(o+=this._frozenTrailingColCount),r=this._getExtendedRange(n.row,o),f=Math.min(n.row,r.row),u=Math.max(n.col,r.col),c=Math.max(n.row+n.
rowCount-1,r.row+r.rowCount-1),l=Math.max(n.col+n.colCount-1,r.col+r.colCount-1),s=c-f+1,h=l-u+1,new t.Range(f,u,s,h)},e.prototype._searchSelectedRangebyUp=function(n){var u=n.row+n.rowCount-1,a=0,h={r:u,c:n.col+n.colCount-1},i,r,f,c,l,o,s,e;while(u>a){u--;if(!this._canMoveCurrentTo(u,h.c,h))continue;i=this._getExtendedRange(u,h.c),r=Math.min(n.row,i.row),f=Math.min(n.col,i.col),c=Math.min(n.row+n.rowCount-1,i.row+i.rowCount-1),l=Math.max(n.col+n.colCount-1,i.col+i.colCount-1),o=c-r+1,s=l-f+1;if(!(r===n.row&&f===n.col&&o===n.rowCount&&s===n.colCount))return e=this._getPrevVisualRow(this._scrollTopRow),(r===e||c===e)&&this._setTopRow(e),new t.Range(r,f,o,s)}return null},e.prototype._searchSelectedRangebyUpCtrl=function(n,i){var l=this.frozenRowCount?this._getNextVisualRow(this.frozenRowCount-1):this._getFirstVisualRow(),u=i?l:this._getFirstVisualRow(),r,e,f,c,h,s,o;if(u===undefined||u===null)return;else(this.frozenRowCount<=0||i)&&this._s
etTopRow(u);return r=this._getExtendedRange(u,n.col),e=Math.min(n.row,r.row),f=Math.min(n.col,r.col),c=Math.min(n.row+n.rowCount-1,r.row+r.rowCount-1),h=Math.max(n.col+n.colCount-1,r.col+r.colCount-1),s=c-e+1,o=h-f+1,new t.Range(e,f,s,o)},e.prototype._searchSelectedRangebyDown=function(n){var f=n.row,v=this.getRowCount()-1,l={r:f,c:n.col+n.colCount-1},i,r,o,e,a,c,s,u,h;while(f<v){f++;if(!this._canMoveCurrentTo(f,l.c,l))continue;i=this._getExtendedRange(f,l.c),r=Math.max(n.row,i.row),o=Math.min(n.col,i.col),e=Math.max(n.row+n.rowCount-1,i.row+i.rowCount-1),a=Math.max(n.col+n.colCount-1,i.col+i.colCount-1),c=e-r+1,s=a-o+1;if(r===n.row&&o===n.col&&c===n.rowCount&&s===n.colCount)continue;else return u=this.frozenRowCount?this._getNextVisualRow(this.frozenRowCount-1):null,h=this._getPageBottomRow(),u!==undefined&&u!==null&&(r===u||e===u)?this._setTopRow(u):(r===h||e===h)&&this._setTopRow(this._getNextVisualRow(this._scrollTopRow)),new t.
Range(r,o,c,s)}return null},e.prototype._searchSelectedRangebyDownCtrl=function(n,i){var e=this._getLastPageTopRow(),o,r,f,u,c,l,s,h;if(e===undefined||e===null)return;else this._setTopRow(e);return o=this._getLastVisualRow(),i||(o+=this._frozenTrailingRowCount),r=this._getExtendedRange(o,n.col),f=Math.max(n.row,r.row),u=Math.min(n.col,r.col),c=Math.max(n.row+n.rowCount-1,r.row+r.rowCount-1),l=Math.max(n.col+n.colCount-1,r.col+r.colCount-1),s=c-f+1,h=l-u+1,new t.Range(f,u,s,h)},e.prototype._searchSelectedRangebyHome=function(n){var r=this.frozenColCount?this.frozenColCount-1:-1,l=this._activeColIndex,e={r:n.row+n.rowCount-1,c:n.col},i,f,u,c,h,o,s;while(r<l){r++;if(!this._canMoveCurrentTo(e.r,r,e))continue;if(n.col<=r&&n.col+n.colCount-1===this._activeColIndex)break;return i=this._getExtendedRange(e.r,r),f=Math.min(n.row,i.row),u=Math.min(n.col,i.col),c=Math.max(n.row+n.rowCount-1,i.row+i.rowCount-1),h=Math.min(n.col+n.colCount-1,i.col+i.colCount-1),o=c-f+1,s=h-u+1,this.
_setLeftColumn(this._getFirstVisualColumn()),new t.Range(f,u,o,s)}return null},e.prototype._searchSelectedRangebyHomeCtrl=function(n){return n=this._searchSelectedRangebyLeftCtrl(n,!0),n=this._searchSelectedRangebyUpCtrl(n,!0)},e.prototype._searchSelectedRangebyEnd=function(n){var r=this.getColumnCount(),l=this._activeColIndex,e={r:n.row+n.rowCount-1,c:n.col+n.colCount-1},i,f,u,c,h,o,s;while(r>l){r--;if(!this._canMoveCurrentTo(e.r,r,e))continue;if(n.col+n.colCount-1>=r&&n.col===this._activeColIndex)break;return i=this._getExtendedRange(e.r,r),f=Math.min(n.row,i.row),u=Math.max(n.col,i.col),c=Math.max(n.row+n.rowCount-1,i.row+i.rowCount-1),h=Math.max(n.col+n.colCount-1,i.col+i.colCount-1),o=c-f+1,s=h-u+1,this._setLeftColumn(this._getLastPageLeftColumn()),new t.Range(f,u,o,s)}return null},e.prototype._searchSelectedRangebyEndCtrl=function(n){return n=this._searchSelectedRangebyRightCtrl(n,!0),n=this._searchSelectedRangebyDownCtrl(n,!0)},e.prototype._searchSelectedRangeby
PageUp=function(n){var u=this._getPrevPageTopRow(),r,f,e,h,o,s,c;if(u===undefined||u===null)return null;var a=this._getRowLayout(1),l=this._setTopRow(u),i=-1;return l?i=this._getNextVisualRow(n.row+n.rowCount-1-a.length):this.frozenRowCount>0||(i=this._getFirstVisualRow()),i<this._scrollTopRow?i=this._scrollTopRow:i<this._getPageBottomRow()||(i=this._getPrevVisualRow(this._getPageBottomRow())),r=this._getExtendedRange(i,n.col),f=Math.min(n.row,r.row),e=Math.min(n.col,r.col),h=Math.min(n.row+n.rowCount-1,r.row+r.rowCount-1),o=Math.max(n.col+n.colCount-1,r.col+r.colCount-1),s=h-f+1,c=o-e+1,new t.Range(f,e,s,c)},e.prototype._searchSelectedRangebyPageDown=function(n){var e=this._getNextPageTopRow(),c,i,r,u,f,l,h,o,s;return e===undefined||e===null?null:(c=this._getRowLayout(1),this._setTopRow(e),i=this._getPrevVisualRow(n.row+n.rowCount-1+c.length),i<this._scrollTopRow?i=this._scrollTopRow:i<this._getPageBottomRow()||(i=this._scrollTopRow<this._getLastPageTopRow()?this.
_getPrevVisualRow(this._getPageBottomRow()):this._getPageBottomRow()),r=this._getExtendedRange(i,n.col),u=Math.max(n.row,r.row),f=Math.min(n.col,r.col),l=Math.max(n.row+n.rowCount-1,r.row+r.rowCount-1),h=Math.max(n.col+n.colCount-1,r.col+r.colCount-1),o=l-u+1,s=h-f+1,new t.Range(u,f,o,s))},e.prototype._getPrevPageTopRow=function(){var i=this._getRowLayout(1);if(!i||i.length<=0)return null;var u=this.frozenRowCount?this._getNextVisualRow(this.frozenRowCount-1):this._getFirstVisualRow(),t=0,n=this._scrollTopRow,r=this._getSheetLayout();while(n>u){t+=this._getZoomRowHeight(n);if(t>r.viewportHeight)break;n--}return n},e.prototype._getPrevPageLeftColumn=function(){var t=this._getColumnLayout(1);if(!t||t.length<=0)return null;if(t[0].col===this._getFirstVisualColumn())return t[0].col;var i=0,n=this._scrollLeftCol,r=this._getSheetLayout();while(n>0){i+=this._getZoomColumnWidth(n);if(i>r.viewportWidth)break;n--}return n},e.prototype._getNextPageTopRow=function(){var n=this
._getRowLayout(1);return!n||n.length<=0?null:this._getLastVisualRow()===n[n.length-1].row?this._scrollTopRow:n[n.length-1].row},e.prototype._getLastPageTopRow=function(){var r,n,i,u,t;if(this._getLastVisualRow()===this._getPageBottomRow()){r=this._getSheetLayout(),n=this._getRowLayout(1);if(n&&n.length>=1){i=n[n.length-1];if(i.y+i.height<=r.viewportY+r.viewportHeight)return this._scrollTopRow}}u=this._scrollTopRow;try{return this._scrollTopRow=this._getLastVisualRow(),t=this._getPrevPageTopRow(),t=this._getNextVisualRow(t)}catch(f){}finally{this._scrollTopRow=u}},e.prototype._getLastPageLeftColumn=function(){var t,i,r,u,n;if(this._getLastVisualColumn()===this._getPageRightColumn()){t=this._getSheetLayout(),i=this._getColumnLayout(1);if(i&&i.length>=1){r=i[i.length-1];if(r.x+r.width<=t.viewportX+t.width)return this._scrollLeftCol}}t=this._getSheetLayout(),u=0,n=this._getLastVisualColumn();while(n>0){u+=this._getZoomColumnWidth(n);if(u>t.viewportWi
dth)break;n--}return n>0&&(n=this._getNextVisualColumn(n)),n},e.prototype._getPageBottomRow=function(){var n=this._getRowLayout(1);return!n||n.length<=0?null:n[n.length-1].row},e.prototype._getPageRightColumn=function(){var n=this._getColumnLayout(1);return!n||n.length<=0?null:n[n.length-1].col},e.prototype._getLastFullyVisibleRow=function(){var n=this._getRowLayout(1),i,t;return!n||n.length<=0?null:(i=this._getSheetLayout(),t=n.length-1,n[t].y+n[t].height>i.viewportY+i.viewportHeight?n[Math.max(t-1,0)].row:n[t].row)},e.prototype._getLastFullyVisibleColumn=function(){var n=this._getColumnLayout(1),i,t;return!n||n.length<=0?null:(i=this._getSheetLayout(),t=n.length-1,n[t].x+n[t].width>i.viewportX+i.viewportWidth?n[Math.max(t-1,0)].col:n[t].col)},e.prototype._getFirstVisualRow=function(){return this._getNextVisualRow(-1)},e.prototype._getLastVisualRow=function(n){(n===undefined||n===null)&&(n=t.SheetArea.viewport);var i=this.getRowCount(n);return(n
===t.SheetArea.viewport||n===t.SheetArea.rowHeader)&&(i=i-this._frozenTrailingRowCount),this._getPrevVisualRow(i,n)},e.prototype._getFirstVisualColumn=function(){return this._getNextVisualColumn(-1)},e.prototype._getLastVisualColumn=function(n){(n===undefined||n===null)&&(n=t.SheetArea.viewport);var i=this.getColumnCount(n);return(n===t.SheetArea.viewport||n===t.SheetArea.colHeader)&&(i=i-this._frozenTrailingColCount),this._getPrevVisualColumn(i,n)},e.prototype._getFirstPageLeftColumn=function(){var n=0,t=isNaN(this.frozenColCount)?0:this.frozenColCount;return n=t>0?this._getNextVisualColumn(t-1):this._getFirstVisualColumn()},e.prototype._getFirstPageTopRow=function(){var n=0,t=isNaN(this.frozenRowCount)?0:this.frozenRowCount;return n=t>0?this._getNextVisualRow(t-1):this._getFirstVisualRow()},e.prototype._getNextVisualRow=function(n){var t=this.getRowCount()-1-this._frozenTrailingRowCount;while(n<t){n++;if(this.getRowVisible(n)&&this._getZoom
RowHeight(n)>0)return n}return null},e.prototype._getPrevVisualRow=function(n,t){while(n>this.frozenRowCount){n--;if(this.getRowVisible(n,t)&&this._getZoomRowHeight(n,t)>0)return n}return null},e.prototype._getNextVisualColumn=function(n){var t=this.getColumnCount()-1-this._frozenTrailingColCount;while(n<t){n++;if(this.getColumnVisible(n)&&this._getZoomColumnWidth(n)>0)return n}return null},e.prototype._getPrevVisualColumn=function(n,t){while(n>this.frozenColCount){n--;if(this.getColumnVisible(n,t)&&this._getZoomColumnWidth(n,t)>0)return n}return null},e.prototype._inflateRangeToCoverSpans=function(n,t){var r,i;if(n&&n.length>0)for(r=0;r<n.length;r++){i=n[r];if(t.intersect(i.row,i.col,i.rowCount,i.colCount))return n.splice(r--,1),this._inflateRangeToCoverSpans(n,t.union(i))}return t},e.prototype._getActiveSelectedRange=function(n){var i=new t.Range(-1,-1,0,0);return this._selectionModel.length<=0?i:(n===t.Direction.left?(
this._selectionModel.activeSelectedRangeIndex--,this._selectionModel.activeSelectedRangeIndex<0&&(this._selectionModel.activeSelectedRangeIndex=this._selectionModel.length-1)):n===t.Direction.right&&(this._selectionModel.activeSelectedRangeIndex++,this._selectionModel.activeSelectedRangeIndex<this._selectionModel.length||(this._selectionModel.activeSelectedRangeIndex=0)),this._selectionModel.activeSelectedRangeIndex<0||(i=this._selectionModel[this._selectionModel.activeSelectedRangeIndex]),i)},e.prototype._initializeActiveCell=function(){var r;if(this._activeRowIndex===undefined||this._activeRowIndex===null||this._activeColIndex===undefined||this._activeColIndex===null||this._selectionModel.length<=0){var i=0,t=0,n=this._spanModel.find(i,t);n?(this._selectionModel.add(i,t,n.rowCount,n.colCount),this._activeRowIndex=i,this._activeColIndex=t,this._activeRowCount=n.rowCount,this._activeColCount=n.colCount):(this._selectionModel.add(i,t,1,1),this._activeRowIn
dex=i,this._activeColIndex=t,this._activeRowCount=1,this._activeColCount=1),this._selectionModel.length>0&&(r=this._selectionModel[0],this._render.repaintSelection(r))}},e.prototype._setHoverCell=function(n){var o=!1,r=this._currentTarget,e,s,f,u,i;r||(o=!0),o||n||(o=!0),o||(o=n.col!==r.col||n.row!==r.row||n.colViewportIndex!==r.colViewportIndex||n.rowViewportIndex!==r.rowViewportIndex||n.hitTestType!==r.hitTestType),this._currentTarget=n,o&&(this._hoverCell=!0,u=this._getSheetLayout(),i=null,r&&(r.rowViewportIndex<0||r.colViewportIndex<0)&&(i=this.getCellRect(r.row,r.col,r.rowViewportIndex,r.colViewportIndex),i&&i.width>0&&i.height>0&&(e=0,s=0,f=this._getGroupLayout(),f&&(e=f.width,s=f.height),(i.x<u.rowHeaderWidth+e||i.y<u.colHeaderHeight+s||i.y>=u.height-u.footerHeight)&&(r.colViewportIndex<0&&r.col===this.getColumnCount(t.SheetArea.rowHeader)-1?this._render.update(i.x-1,i.y
-1,i.width+1,i.height+2):r.row===this.getRowCount(t.SheetArea.colHeader)-1?this._render.update(i.x-1,i.y-1,i.width+2,i.height+1):this._render.update(i.x-1,i.y-1,i.width+2,i.height+2)))),n&&(n.rowViewportIndex<0||n.colViewportIndex<0)&&(i=this.getCellRect(n.row,n.col,n.rowViewportIndex,n.colViewportIndex),i&&i.width>0&&i.height>0&&(e=0,s=0,f=this._getGroupLayout(),f&&(e=f.width,s=f.height),(i.x<u.rowHeaderWidth+e||i.y<u.colHeaderHeight+s||i.y>=u.height-u.footerHeight)&&(n.colViewportIndex<0&&n.col===this.getColumnCount(t.SheetArea.rowHeader)-1?this._render.update(i.x-1,i.y-1,i.width+1,i.height+2):n.row===this.getRowCount(t.SheetArea.colHeader)-1?this._render.update(i.x-1,i.y-1,i.width+2,i.height+1):this._render.update(i.x-1,i.y-1,i.width+2,i.height+2)))),this._hoverCell=!1)},e.prototype._getAvailableActiveCell=function(n,t,i){var r=this._skipSpanCell(n,t,i);return this._skipInvisibleCell(r)},e.pro
totype._skipSpanCell=function(n,i,r){var u=this._spanModel.find(n,i);if(u){if(r&&u.rowCount===1||!r&&u.colCount===1)return u}else return new t.Range(n,i,1,1);return r?i++:n++,this._skipSpanCell(n,i,r)},e.prototype._skipInvisibleCell=function(n){for(var f=n.row,e=this.getRowCount(),r,u,i=f;i<e;i++)if(this.getRowVisible(i)===!0)break;for(i<e&&(f=i),r=n.col,u=this.getColumnCount(),i=r;i<u;i++)if(this.getColumnVisible(i)===!0)break;return i<u&&(r=i),new t.Range(f,r,n.rowCount,n.colCount)},e.prototype._processKeyMap=function(n){var i=!0,r=this._getKeyAction(n.keyCode,n.ctrlKey,n.shiftKey,n.altKey);return r&&typeof r.action===f&&(i=r.action.call(this),n.keyCode===t.Key.enter&&n.ctrlKey===!1&&n.altKey===!1&&t.util.cancelDefault(n),typeof i=="object"&&(i.processed&&t.util.cancelDefault(n),i=!1)),i},e.prototype._getRowInfos=function(n){if(n===undefined||n===null||n===t.SheetArea.view
port||n===t.SheetArea.rowHeader)return this._rowInfos||(this._rowInfos={}),this._rowInfos;else if(n===t.SheetArea.colHeader)return this._colHeaderRowInfos||(this._colHeaderRowInfos={}),this._colHeaderRowInfos},e.prototype._getZoomRowHeight=function(n,t){return parseInt(this.getRowHeight(n,t)*this._zoomFactor,10)},e.prototype._getColumnInfos=function(n){if(n===undefined||n===null||n===t.SheetArea.viewport||n===t.SheetArea.colHeader)return this._colInfos||(this._colInfos={}),this._colInfos;else if(n===t.SheetArea.rowHeader)return this._rowHeaderColInfos||(this._rowHeaderColInfos={}),this._rowHeaderColInfos;return null},e.prototype._getZoomColumnWidth=function(n,t){return parseInt(this.getColumnWidth(n,t)*this._zoomFactor,10)},e.prototype._getGroupLayout=function(){return this._cachedGroupLayout||(this._cachedGroupLayout=this._createGroupLayout()),this._cachedGroupLayout},e.prototype._createGroupLayout=function(){var i={x:0,y:0,width:0,height:0},t,u,n,r;return this.showRowRangeGroup()&
amp;&this.rowRangeGroup&&!this.rowRangeGroup._isEmpty()&&(t=this.rowRangeGroup.getMaxLevel(),t<0||(u=Math.min(this._GROUPBUTTON_WIDTH,this._GROUPBUTTON_WIDTH*this._zoomFactor),i.width=u*(t+2)+this._GROUPPADDING*2)),this.showColumnRangeGroup()&&this.colRangeGroup&&!this.colRangeGroup._isEmpty()&&(n=this.colRangeGroup.getMaxLevel(),n<0||(r=Math.min(this._GROUPBUTTON_HEIGHT,this._GROUPBUTTON_HEIGHT*this._zoomFactor),i.height=r*(n+2)+this._GROUPPADDING*2)),i},e.prototype._createLayout=function(){var o=new t.Rect(this._bounds.x+this.borderWidth,this._bounds.y+this.borderWidth,Math.max(0,this._bounds.width-2*this.borderWidth),Math.max(0,this._bounds.height-2*this.borderWidth)),s=o.width,e=o.height,n={x:o.x,y:o.y,width:o.width,height:o.height,rowHeaderWidth:0,colHeaderHeight:0,frozenWidth:0,frozenHeight:0,frozenTrailingWidth:0,frozenTrailingHeight:0,footerHeight:0,footerWidth:0,footerX:0,footerY:0,frozenX:0,frozenY:0,frozenTrailingX:0,froze
nTrailingY:0,viewportX:0,viewportY:0,viewportHeight:0,viewportWidth:0,headerX:0,headerY:0,headerCornerRect:function(){return new t.Rect(this.x,this.y,this.rowHeaderWidth,this.colHeaderHeight)},colHeaderRect:function(n){return n===0?new t.Rect(this.frozenX,this.y,this.frozenWidth,this.colHeaderHeight):n===1?new t.Rect(this.viewportX,this.y,this.viewportWidth,this.colHeaderHeight):n===2?new t.Rect(this.frozenTrailingX,this.y,this.frozenTrailingWidth,this.colHeaderHeight):null},rowHeaderRect:function(n){return n===0?new t.Rect(this.x,this.frozenY,this.rowHeaderWidth,this.frozenHeight):n===1?new t.Rect(this.x,this.viewportY,this.rowHeaderWidth,this.viewportHeight):n===2?new t.Rect(this.x,this.frozenTrailingY,this.rowHeaderWidth,this.frozenTrailingHeight):null},viewportRect:function(n,i){return n===0?i===0?new t.Rect(this.frozenX,this.frozenY,this.frozenWidth,this.frozenHeight):i===1?new t.Rect(this.viewportX,this.frozenY,this.viewportWidth,this.frozenHeight):i===2?new t.Rect(this.frozen
TrailingX,this.frozenY,this.frozenTrailingWidth,this.frozenHeight):null:n===1?i===0?new t.Rect(this.frozenX,this.viewportY,this.frozenWidth,this.viewportHeight):i===1?new t.Rect(this.viewportX,this.viewportY,this.viewportWidth,this.viewportHeight):i===2?new t.Rect(this.frozenTrailingX,this.viewportY,this.frozenTrailingWidth,this.viewportHeight):null:n===2?i===0?new t.Rect(this.frozenX,this.frozenTrailingY,this.frozenWidth,this.frozenTrailingHeight):i===1?new t.Rect(this.viewportX,this.frozenTrailingY,this.viewportWidth,this.frozenTrailingHeight):i===2?new t.Rect(this.frozenTrailingX,this.frozenTrailingY,this.frozenTrailingWidth,this.frozenTrailingHeight):null:null},footerRect:function(n){return n===0?new t.Rect(this.frozenX,this.footerY,this.frozenWidth,this.footerHeight):n===1?new t.Rect(this.viewportX,this.footerY,this.viewportWidth,this.footerHeight):n===2?new t.Rect(this.frozenTrailingX,this.footerY,this.frozenTrailingWidth,this.footerHeight):null},footerCornerRect:function(){re
turn new t.Rect(this.footerX,this.footerY,this.footerWidth,this.footerHeight)}},h=this._getGroupLayout(),i,f,r,u;n.x+=h.width,n.y+=h.height,s-=h.width,e-=h.height;if(this.rowHeaderVisible===null||this.rowHeaderVisible===undefined||this.rowHeaderVisible)for(u=this.getColumnCount(t.SheetArea.rowHeader),r=0;r<u;r++)n.rowHeaderWidth+=this._getZoomColumnWidth(r,t.SheetArea.rowHeader);if(this.colHeaderVisible===null||this.colHeaderVisible===undefined||this.colHeaderVisible)for(f=this.getRowCount(t.SheetArea.colHeader),i=0;i<f;i++)n.colHeaderHeight+=this._getZoomRowHeight(i,t.SheetArea.colHeader);if(this.frozenColCount>0)for(u=this.getColumnCount(),r=0;r<this.frozenColCount&&r<u;r++)this.getColumnVisible(r)&&(n.frozenWidth+=this._getZoomColumnWidth(r));if(this.frozenRowCount>0)for(f=this.getRowCount(),i=0;i<this.frozenRowCount&&i<f;i++)this.getRowVisible(i)&&(n.frozenHeight+=this._getZoomRowHeight(i));if(this._frozenTrailingColCount&g
t;0)for(u=this.getColumnCount(),r=Math.max(this.frozenColCount,u-this._frozenTrailingColCount);r<u;r++)n.frozenTrailingWidth+=this._getZoomColumnWidth(r);if(this._frozenTrailingRowCount>0)for(f=this.getRowCount(),i=Math.max(this.frozenRowCount,f-this._frozenTrailingRowCount);i<f;i++)n.frozenTrailingHeight+=this._getZoomRowHeight(i);return s-=n.rowHeaderWidth,e-=n.colHeaderHeight,s-=n.frozenWidth,e-=n.frozenHeight,s-=n.frozenTrailingWidth,e-=n.frozenTrailingHeight,e-=n.footerHeight,n.viewportWidth=Math.max(0,s),n.viewportHeight=Math.max(0,e),n.headerX=n.x,n.headerY=n.y,n.frozenX=n.headerX+n.rowHeaderWidth,n.frozenY=n.headerY+n.colHeaderHeight,n.viewportX=n.frozenX+n.frozenWidth,n.viewportY=n.frozenY+n.frozenHeight,n.frozenTrailingX=n.viewportX+n.viewportWidth,n.frozenTrailingY=n.viewportY+n.viewportHeight,n.footerX=n.headerX,n.footerY=n.y+n.height-n.footerHeight,n},e.prototype._getSheetLayout=function(){return this._layoutModel||(this._layoutModel=this._createLayout()),this.
_layoutModel},e.prototype._getColumnLayout=function(n,i){if(i===undefined||i===null||i===t.SheetArea.viewport||i===t.SheetArea.colHeader)return this._getViewportColumnLayout(n);else if(i===t.SheetArea.rowHeader)return this._getRowHeaderColumnLayout();return null},e.prototype._getRowHeaderColumnLayout=function(){return this._colLayoutCache.rowHeader||(this._colLayoutCache.rowHeader=this._createRowHeaderColumnLayout()),this._colLayoutCache.rowHeader},e.prototype._getViewportColumnLayout=function(n){return this._colLayoutCache.viewport||(this._colLayoutCache.viewport={}),this._colLayoutCache.viewport[n]||(this._colLayoutCache.viewport[n]=this._createViewportColumnLayout(n)),this._colLayoutCache.viewport[n]},e.prototype._createRowHeaderColumnLayout=function(){for(var r=new t._LayoutModel,f=this._getSheetLayout(),u=f.headerX,i,e=this.getColumnCount(t.SheetArea.rowHeader),n=0;n<e;n++)i=this._getZoomColumnWidth(n,t.SheetArea.rowHeader),r.push(new t._Layout(-1,n,u,-1,i,-1)),u+=i;return r
},e.prototype._createViewportColumnLayout=function(n){var o=new t._LayoutModel,e=this._getSheetLayout(),f=this.getColumnCount(),i,u,r,s,h;if(n===0)for(u=e.frozenX,f=isNaN(this.frozenColCount)?0:Math.min(this.frozenColCount,f),i=0;i<f;i++)r=this._getZoomColumnWidth(i),o.push(new t._Layout(-1,i,u,-1,r,-1)),u+=r;else if(n===1)for(u=e.viewportX,f=f-this._frozenTrailingColCount,s=e.viewportWidth,h=Math.max(this.frozenColCount,this._scrollLeftCol),i=h;s>0&&i<f;i++)r=this._getZoomColumnWidth(i),o.push(new t._Layout(-1,i,u,-1,r,-1)),u+=r,s-=r;else if(n===2)for(u=e.frozenTrailingX,i=Math.max(this.frozenColCount,f-this._frozenTrailingColCount);i<f;i++)r=this._getZoomColumnWidth(i),o.push(new t._Layout(-1,i,u,-1,r,-1)),u+=r;return o},e.prototype._getRowLayout=function(n,i){if(i===undefined||i===null||i===t.SheetArea.viewport||i===t.SheetArea.rowHeader)return this._getViewportRowLayout(n);else if(i===t.SheetArea.colHeader)return this._getColumnHeaderRowLayout();return null},
e.prototype._getAllRowLayout=function(n){for(var u=new t._LayoutModel,r,i=0;i<3;i++)r=this._getRowLayout(i,n),r&&r.length>0&&(u=$.merge(u,r));return u},e.prototype._getAllColumnLayout=function(n){for(var u=new t._LayoutModel,r,i=0;i<3;i++)r=this._getColumnLayout(i,n),r&&r.length>0&&(u=$.merge(u,r));return u},e.prototype._getColumnHeaderRowLayout=function(){return this._rowLayoutCache.colHeader||(this._rowLayoutCache.colHeader=this._createColumnHeaderRowLayout()),this._rowLayoutCache.colHeader},e.prototype._getViewportRowLayout=function(n){return this._rowLayoutCache.viewport||(this._rowLayoutCache.viewport={}),this._rowLayoutCache.viewport[n]||(this._rowLayoutCache.viewport[n]=this._createViewportRowLayout(n)),this._rowLayoutCache.viewport[n]},e.prototype._createColumnHeaderRowLayout=function(){for(var r=new t._LayoutModel,f=this._getSheetLayout(),u=f.headerY,i,e=this.getRowCount(t.SheetArea.colHeader),n=0;n<e;n++)i=this._getZoomRowHeig
ht(n,t.SheetArea.colHeader),r.push(new t._Layout(n,-1,-1,u,-1,i)),u+=i;return r},e.prototype._createViewportRowLayout=function(n){var o=new t._LayoutModel,e=this._getSheetLayout(),f=this.getRowCount(),i,u,r,s,h;if(n===0)for(u=e.frozenY,f=isNaN(this.frozenRowCount)?0:Math.min(this.frozenRowCount,f),i=0;i<f;i++)r=this._getZoomRowHeight(i),o.push(new t._Layout(i,-1,-1,u,-1,r)),u+=r;else if(n===1)for(u=e.viewportY,f=f-this._frozenTrailingRowCount,s=e.viewportHeight,h=Math.max(this.frozenRowCount,this._scrollTopRow),i=h;s>0&&i<f;i++)r=this._getZoomRowHeight(i),o.push(new t._Layout(i,-1,-1,u,-1,r)),u+=r,s-=r;else if(n===2)for(u=e.frozenTrailingY,i=Math.max(this.frozenRowCount,f-this._frozenTrailingRowCount);i<f;i++)r=this._getZoomRowHeight(i),o.push(new t._Layout(i,-1,-1,u,-1,r)),u+=r;return o},e.prototype._getCellLayout=function(n,i,r){var v=this.getRowCount(r),a=this.getColumnCount(r),u=this._getRowLayout(n,r),f=this._getColumnLayout(i,r),c=new t._LayoutModel;if(u&am
p;&u.length>0&&f&&f.length>0){var o=u[0].row,e=f[0].col,h=u[u.length-1].row,s=f[f.length-1].col,l=this.getSpans(new t.Range(o,e,h-o+1,s-e+1),r);this._addCellLayout(l,o,e,h,s,c,v,a,r,u,f),(r===undefined||r===null||r===t.SheetArea.viewport)&&(l=new t._SpanModel,this._addCellLayout(l,o,e,h,s,c,v,a,r,u,f))}return c},e.prototype._getCellLayoutByCell=function(t,i,r,u,f){var l=this.getRowCount(r),a=this.getColumnCount(r),o=this._getRowLayout(t,r),s=this._getColumnLayout(i,r),h=new n.spread._LayoutModel,c;if(o&&o.length>0&&s&&s.length>0){var v=o[0].row,y=s[0].col,e=this.getSpan(u,f,r);return e&&(c=[],c.push(e),this._addCellLayout(c,v,y,e.row+e.rowCount,e.col+e.colCount,h,l,a,r,o,s)),h.length>0?h[0]:null}return null},e.prototype._addCellLayout=function(t,i,r,u,f,e,o,s,h,c,l){for(var d=u+1,b=f+1,p=new Array(d),y=new Array(b),tt=new Array(b),it=new Array(d),k=0,w=0,rt,v,ut,ft,a=i-1;a>=0;a--)p[a]=this._getZoomRowHeigh
t(a,h),w-=p[a],it[a]=w;for(w=0,a=i;a<d;a++)it[a]=w,p[a]=this._getZoomRowHeight(a,h),w+=p[a];for(a=r-1;a>=0;a--)y[a]=this._getZoomColumnWidth(a,h),k-=y[a],tt[a]=k;for(k=0,a=r;a<b;a++)tt[a]=k,y[a]=this._getZoomColumnWidth(a,h),k+=y[a];for(rt=0;rt<t.length;rt++){v=t[rt];if(v.intersect(i,r,u-i+1,f-r+1)){ut=v.row+v.rowCount;if(ut>d){for(a=d;a<ut;a++)p.push(this._getZoomRowHeight(a,h)),it.push(it[a-1]+p[a]);d=ut}ft=v.col+v.colCount;if(ft>b){for(a=b;a<ft;a++)y.push(this._getZoomColumnWidth(a,h)),tt.push(tt[a-1]+y[a]);b=ft}for(var k=tt[v.col],w=it[v.row],et=0,ot=0,g,nt=v.col;nt<v.col+v.colCount&&nt<s;nt++)et+=y[nt];for(g=v.row;g<v.row+v.rowCount&&g<o;g++)ot+=p[g];e.push(new n.spread._Layout(v.row,v.col,l[0].x+k,c[0].y+w,et,ot,v.rowCount,v.colCount))}}},e.prototype._getRowViewportIndexNearY=function(n){var t=this._getSheetLayout();return this.frozenRowCount>0&&n<t.frozenY+t.frozenHeight?0:this._frozenTrailingRowCount>0&
&n>t.frozenTrailingY?2:1},e.prototype._getColumnViewportIndexNearX=function(n){var t=this._getSheetLayout();return this.frozenColCount>0&&n<t.frozenX+t.frozenWidth?0:this._frozenTrailingColCount>0&&n>t.frozenTrailingX?2:1},e.prototype._getViewportColumnLayoutNearX=function(n,t){var i=this._getColumnLayout(n);return i?i.findNearX(t):null},e.prototype._getViewportRowLayoutNearY=function(n,t){var i=this._getRowLayout(n);return i?i.findNearY(t):null},e.prototype._syncHScollbarPosition=function(){this._scrollCallback&&this._scrollCallback({action:"scroll",orientation:"horizontal"})},e.prototype._syncVScrollbarPosition=function(){this._scrollCallback&&this._scrollCallback({action:"scroll",orientation:"vertical"})},e.prototype._syncScrollbarSize=function(){this._scrollCallback&&this._scrollCallback({action:"resize"})},e.prototype._getScrollableRow=function(n,t){var r=this.getFrozenR
owCount(),u=this.getRowCount()-this.getFrozenTrailingRowCount()-1,i;if(t){n>u&&(n=u),i=this._getPrevVisualRow(n+1);if(i!=null&&i>=r)return i}else{n<r&&(n=r),i=this._getNextVisualRow(n-1);if(i!=null&&i<=u)return i}return-1},e.prototype._getScrollableColumn=function(n,t){var r=this.getFrozenColumnCount(),u=this.getColumnCount()-this.getFrozenTrailingColumnCount()-1,i;if(t){n>u&&(n=u),i=this._getPrevVisualColumn(n+1);if(i!=null&&i>=r)return i}else{n<r&&(n=r),i=this._getNextVisualColumn(n-1);if(i!=null&&i<=u)return i}return-1},e.prototype._setTopRow=function(n,i){var b,e,s,c,l,p,v,h,u,w,o,a,rt,tt,k,it,g,nt,r;if(i||n!==undefined&&n!==null&&n>=this._getFirstPageTopRow()&&n<=this._getLastVisualRow()&&n!==this._scrollTopRow){this._trigger(t.Events.TopRowChanged,{sheet:this,sheetName:this._name,oldTopRow:this._scrollTopRow,newTopRow:n}),b=!1;if(t.util._useDoubleBuffer
()){var d=this._render._getBufferCtx(),y=this._scrollTopRow,f=null,u=this._getRowLayout(1,t.SheetArea.viewport);this._scrollTopRow=n,p=this._bounds;if(this._scrollTopRow>y&&u){v=u.findRow(this._scrollTopRow);if(v){b=!0,f=this._getSheetLayout();if(u.length<=0)return!1;var r=u.length-1,it=u[r],o=u[r].height+2;u[r].y+u[r].height>f.viewportHeight&&(o+=u[r-1].height);if(f.viewportHeight-v.y-o>0){for(e=p?p.x:f.x,s=v.y,c=f.rowHeaderWidth+f.frozenWidth+f.viewportWidth+f.frozenTrailingWidth,l=f.viewportHeight-v.y-o,this._render.translateScreen(e,s,c,l,e,f.viewportY),this._render._copyDoubleBufferRect(new t.Rect(e,s,c,l),e,f.viewportY,null,d,d),r=y;r<this._scrollTopRow;r++)this._clearCellOverflowModelCachebyRow(r);g=this._cellOverflowModelCache,this.invalidateLayout(),this._cellOverflowModelCache=g,u=this._getRowLayout(1,t.SheetArea.viewport);if(!u||u.length<=0)return!1;for(nt=u[u.length-1],r=it.row+1;r<=nt.row+1;r++)this._render._buildCellOverflowLayoutMo
del(r,t.SheetArea.viewport);this._render.update(e,f.viewportY+l,c,s+o,!1)}else this.invalidateLayout(),this.repaint()}}else{for(f=this._getSheetLayout(),h=0,r=this._scrollTopRow;r<y&&h<f.viewportHeight;r++)h+=this._getZoomRowHeight(r);if(h<f.viewportHeight){b=!0,u=this._getRowLayout(1,t.SheetArea.viewport);if(!u)return!1;w=u.findRow(y);if(w){for(o=w.height+2,a=this.getActiveColumnIndex(),a>=0&&a<this.getColumnCount()&&(rt=this._getColumnLayout(1,t.SheetArea.viewport).findCol(a),rt&&(tt=this.getCellRect(w.row,a),tt&&(o=tt.height+2))),k=f.viewportHeight-h,this.getFrozenTrailingRowCount()>0&&(k=k-1),e=p?p.x:f.x,s=f.viewportY,c=f.rowHeaderWidth+f.frozenWidth+f.viewportWidth+f.frozenTrailingWidth,l=k-o,this._render.translateScreen(e,s+o,c,l,e,s+h+o),this._render._copyDoubleBufferRect(new t.Rect(e,s+o,c,l),e,s+h+o,null,d,d),r=this._scrollTopRow;r<y;r++)this._render._buildCellOverflowLayoutModel(r,t.SheetArea.viewport);if
(u.length<=0)return!1;it=u[u.length-1],g=this._cellOverflowModelCache,this.invalidateLayout(),this._cellOverflowModelCache=g,u=this._getRowLayout(1,t.SheetArea.viewport);if(!u||u.length<=0)return!1;for(nt=u[u.length-1],r=nt.row+1;r<=it.row;r++)this._clearCellOverflowModelCachebyRow(r);this._render.update(e,s,c,h+o,!1)}}}}else this._scrollTopRow=n;return b||(this.invalidateLayout(),this.repaint()),this._syncVScrollbarPosition(),!0}},e.prototype._setLeftColumn=function(n,i){if(i||n!==undefined&&n!==null&&n>=this._getFirstPageLeftColumn()&&n<=this._getLastVisualColumn()&&n!==this._scrollLeftCol)return this._trigger(t.Events.LeftColumnChanged,{sheet:this,sheetName:this._name,oldLeftCol:this._scrollLeftCol,newLeftCol:n}),this._scrollLeftCol=n,this.invalidateLayout(),this.repaint(),this._syncHScollbarPosition(),!0},e.prototype._getSpanModel=function(n){if(n===undefined||n===null||n===t.SheetArea.viewport)return this._spanModel;else if(n===t.S
heetArea.colHeader)return this._colHeaderSpanModel;else if(n===t.SheetArea.rowHeader)return this._rowHeaderSpanModel},e.prototype._clipboardCopy=function(n,i,u){var o,e,s;if(!n)return;var h="\t",c="\r\n",l='"',f=new t.Range(n.row,n.col,n.rowCount,n.colCount);f.row===-1&&(f.row=0),f.col===-1&&(f.col=0),f.rowCount===-1&&(f.rowCount=this.getRowCount()-f.row),f.colCount===-1&&(f.colCount=this.getColumnCount()-f.col),o=r.getRangeText(this,f.row,f.rowCount,f.col,f.colCount,c,h,l,!1,t.TextFileOpenFlags.None),e=this._getClipboardHelper(),e.fromSheet=this,e.range=n,e.isCutting=i;try{s={sheet:this,sheetName:this._name,copyData:o,cancel:!1},this._trigger(t.Events.ClipboardChanging,s),s&&s.cancel===!1?(this._eventHandler&&!u&&this._eventHandler._switchFocusForClipboard(o),this._trigger(t.Events.ClipboardChanged,{sheet:this,sheetName:this._name,copyData:o}),setTimeout(function(){this._eventHandler&&!u&&a
mp;this._eventHandler._switchBackFocusAfterClipboard()},100)):(e.fromSheet=null,e.range=null)}catch(a){}finally{return o}},e.prototype._trySearch=function(n,i,r){var u,f,h,l,c,s,o,e;return n?(u=t.SearchFlags,n=n.toString(),i=i.toString(),f=(r&u.ExactMatch)>0,f&&(r&u.UseWildCards)==0?(r&u.IgnoreCase)>0?(h=n.toLowerCase(),l=i.toLowerCase(),h===l):n===i:(c=(r&u.IgnoreCase)>0,s=(r&u.UseWildCards)>0,o=c?new RegExp(st(i,s,f),"i"):new RegExp(st(i,s,f)),e=n.search(o)>-1,f&&e&&i.search(/\*/)<=-1&&(e=n.length===i.length),e)):!1},e.prototype._getFilterButtonModel=function(){return!this._filterButtonsModel&&t.features.filter_ui&&(this._filterButtonsModel=this._createFilterButtonModle()),this._filterButtonsModel},e.prototype._createFilterButtonModle=function(){var v=new t._FilterButtonInfoModel,e=this.rowFilter(),a,o,s,y,u,h,r,n,l,f,i;if(e&&e.range&&e.showFilterButton){var n=e.range,f=
n.col<0?0:n.col,p=n.col<0?this.getColumnCount():n.col+n.colCount,r,c;n.row<1?(r=this.getRowCount(t.SheetArea.colHeader)-1,c=t.SheetArea.colHeader):(r=n.row-1,c=t.SheetArea.viewport);if(r>=0)while(f<p)i=new t._FilterButtonInfo(e),i.sheetArea=c,i.row=r,a=this.getSpans(new t.Range(r,f,1,1),c),a&&a.length>0?(o=a[0],i.row=o.row,i.col=o.col,f+=o.colCount):(i.col=f,f++),v.push(i)}for(s=this.getTables(),y=s?s.length:0,h=0;h<y;h++){u=s[h];if(u&&u.showHeader()&&u.rowFilter().showFilterButton){r=u.headerIndex();if(r>=0)for(n=u.range(),l=0;l<n.colCount;l++)f=n.col+l,i=new t._FilterButtonInfo(u.rowFilter(),r,f,t.SheetArea.viewport),v.push(i)}}return v},e.prototype._getFilterButtonHitInfo=function(n,i,r){var v,a,c,h,l,e,y,u;if(!t.features.filter_ui)return null;v=n.rowViewportIndex,a=n.colViewportIndex,n.hitTestType===t.SheetArea.colHeader?(c=this._getColumnHeaderRowLayout().findY(r),h=this._getViewportColumnLayout(a).findX(i),l=t.SheetArea.colHea
der):n.hitTestType===t.SheetArea.viewport&&(c=this._getViewportRowLayout(v).findY(r),h=this._getViewportColumnLayout(a).findX(i),l=t.SheetArea.viewport);if(!c||!h)return null;var s=c.row,o=h.col,f=this.getSpan(s,o,l);if(f){if(s!==f.row+f.rowCount-1||o!==f.col+f.colCount-1)return null;s=f.row,o=f.col}e=this._getFilterButtonModel().find(s,o,l);if(e){y=this.getCellRect(s,o,v,a),u=this._render._getFilterButtonRect(y);if(u.x<=i&&i<=u.x+u.width&&u.y<=r&&r<=u.y+u.height)return new t._FilterButtonInfo(e.rowFilter,e.row,e.col,e.sheetArea,u.x,u.y,u.width,u.height)}return null},e.prototype._getCellTypeHitInfo=function(n,t,i){var f=n.row,e=n.col,r=n.hitTestType,s=this.getCellRect(f,e),u=this.getActualStyle(f,e,r),o=this.getCellTypeCore(u,r);return this.isProtected&&u.locked?null:this._allowEditorReservedLocations?o.getHitInfo(t,i,f,e,u,s,r):null},e.prototype._clearCellOverflowModelCachebyRow=function(n,i){this._cellOverflowModelCache&&
(i===undefined||i===null||i===t.SheetArea.viewport)&&(this._cellOverflowModelCache[n]=null)},e.prototype._clearCellOverflowModelCache=function(){this._cellOverflowModelCache&&(this._cellOverflowModelCache=null)},e.prototype._trigger=function(n,t){this._eventHandler.trigger(n,t)},e.prototype._disposeUserEvents=function(){this.unbindAll(),this._unbindAll()},e.prototype._doCommand=function(n){var t=this.undoManager();t.doAction(n)},e.prototype._refreshTabStrip=function(){this.parent&&this.parent._tab&&this.parent._tab.repaint&&this.parent._tab.repaint()},e.prototype._isAnyCellInRangeLocked=function(n){for(var t=this._getActualRange(n),i,u,r=t.row;r<t.row+t.rowCount;r++)for(i=t.col;i<t.col+t.colCount;i++){u=this.getActualStyle(r,i);if(u.locked===!0)return!0}return!1},e.prototype._isValidRange=function(n,t,i,r,u,f){if(-1<=n&&n<u&&-1<=t&&t<f)if(n===-1&&t===-1)return!0;else if(n===-1){if(r!==0&&am
p;t+r<=f)return!0}else if(t===-1){if(i!==0&&n+i<=u)return!0}else if(r!==0&&t+r<=f&&i!==0&&n+i<=u)return!0;return!1},e.prototype._setValueInternal=function(n,t,i,r,u){this.setValue(n,t,r,i,!1)},e.prototype._hasPartSpans=function(n,t,i,r){var f,u,s,o,e,h;if(n<0&&t<0)return!1;else if(n<0){s=this._colHeaderSpanModel;if(s&&s.length!==0){f=s.getEnumerator(-1,t,-1,r),u=null;while(f.moveNext()){u=f.current();if(u.col<t||u.col+u.colCount>t+r)return!0}}}else if(t<0){o=this._rowHeaderSpanModel;if(o&&o.length!==0){f=o.getEnumerator(n,-1,i,-1),u=null;while(f.moveNext()){u=f.current();if(u.row<n||u.row+u.rowCount>n+i)return!0}}}e=this._spanModel;if(e&&e.length!==0){h=e.getEnumerator(n,t,i,r),u=null;while(h.moveNext()){u=h.current();if(n!==-1)if(u.row<n||u.row+u.rowCount>n+i)return!0;if(t!==-1)if(u.col<t||u.col+u.colCount>t+r)return!0}}return!1},e.prototype._hasSpans=function(n,t,i,r){va
r f=this._spanModel,u,e;if(f)for(u=0;u<f.length;u++){e=f[u];if(e.intersect(n,t,i,r))return!0}return!1},e.prototype._hasPartTable=function(n,i,r,u){var o=this.getTables(),s,h,f,e;if(o&&o.length>0)for(s=new t.Range(n,i,r,u),h=o.length,e=0;e<h;e++){f=o[e].range();if(s.intersect(f.row,f.col,f.rowCount,f.colCount)&&!s.containsRange(f))return!0}return!1},e.prototype._hasTable=function(n,t,i,r){return this._tableManager&&this._tableManager.has(n,t,i,r)?!0:!1},e.prototype._hasPartArrayFormulas=function(n,t,i,r){var e=this._getsArrayFormulas(n,t,i,r),o,f,u;if(e&&e.length>0)for(o=e.length,f=0;f<o;f++){u=e[f][0];if(n!==-1)if(u.row<n||u.row+u.rowCount>n+i)return!0;if(t!==-1)if(u.col<t||u.col+u.colCount>t+r)return!0}return!1},e.prototype._getsArrayFormulas=function(n,t,i,r){var e=this._findFormulas(n,t,i,r),f,o;if(e&&e.length>0){for(var s=[],h=[],c=e.length,u=0;u<c;u++)f=e[u][1],f&&f!==""&&f[0]===&
quot;{"&&f[f.length-1]==="}"&&(h.push(e[u][0]),s.push(f));if(s.length>0){for(o={},u=0;u<s.length;u++)o[u][0]=h[u],o[u][1]=s[u];return o}}return null},e.prototype._raiseDragDropBlock=function(n,i,r,u,f,e,o,s,h){var c={sheet:this,sheetName:this._name,fromRow:n,fromCol:i,toRow:r,toCol:u,rowCount:f,colCount:e,copy:o,insert:s,copyOption:h,cancel:!1};return this._trigger(t.Events.DragDropBlock,c),c&&c.cancel===!0},e.prototype._raiseDragDropBlockCompleted=function(n,i,r,u,f,e,o,s,h){var c={sheet:this,sheetName:this._name,fromRow:n,fromCol:i,toRow:r,toCol:u,rowCount:f,colCount:e,copy:o,insert:s,copyOption:h};this._trigger(t.Events.DragDropBlockCompleted,c)},e.prototype._raiseInvalidOperation=function(n,i){var r={sheet:this,sheetName:this._name,invalidType:n,message:i};this._trigger(t.Events.InvalidOperation,r)},e.prototype._suspendInvalidate=function(){this._layoutSuspended++},e.prototype._resumeInvalidate=function(){this._layoutSuspended--,this.
_layoutSuspended>0||(this.isPaintSuspended()||(this.invalidateLayout(),this.repaint()),this._layoutSuspended=0)},e.prototype._raiseSelectionChanging=function(n,i){var r=this._eventHandler._notEqualSelecions(n,i);return r===!0?(this._trigger(t.Events.SelectionChanging,{sheet:this,sheetName:this._name,oldSelections:n,newSelections:i}),!0):!1},e.prototype._raiseSelectionChanged=function(){this._trigger(t.Events.SelectionChanged,{sheet:this,sheetName:this._name})},e.prototype._raiseDragFillBlock=function(n,i,r){var u={sheet:this,sheetName:this._name,fillRange:n,autoFillType:r,fillDirection:i,cancel:!1};return this._trigger(t.Events.DragFillBlock,u),u&&u.cancel===!0},e.prototype._raiseDragFillBlockCompleted=function(n,i,r){var u={sheet:this,sheetName:this._name,fillRange:n,autoFillType:r,fillDirection:i};this._trigger(t.Events.DragFillBlockCompleted,u)},e.prototype._raiseCellChanged=function(n,i,r,u){var f={sheet:this,sheetName:this._name,row:i,col:r,sheetArea:u,propertyName:n
};this._trigger(t.Events.CellChanged,f)},e.prototype._raisePropertyChanged=function(n){},e.prototype._nextNonNullRow=function(n,i){var f=this._bindingManager,e=this.getDataSource(),u,r;n++,u=i?this._getModel(t.SheetArea.rowHeader):this._getModel(t.SheetArea.viewport),r=u.rowCount,i===!1&&e&&(r=Math.max(r,f.getRowCount()));while(n>=0&&n<r){if(u.dataTable.hasOwnProperty(n)&&u.dataTable[n])break;if(i===!1&&e)if(f.getDataItem(n))break;n++}return n<r?n:-1},e.prototype._nextNonNullColumn=function(n,i,r){var o=this._bindingManager,s=this.getDataSource(),u=null,f=r?this._getModel(t.SheetArea.colHeader):this._getModel(t.SheetArea.viewport),e;n>=0&&n<f.rowCount&&f.dataTable.hasOwnProperty(n)&&(u=f.dataTable[n]),r===!1&&!u&&s&&n>=0&&n<o.getRowCount()&&(u=o.getDataItem(n));if(!u)return-1;i++;while(i>=0&&(i<f.colCount||i<u.length)){if(u.hasOwnProperty(i)&a
mp;&u[i])break;if(r===!1&&s){e=this._getValueImp(f,n,i);if(e!==undefined&&e!==null)break}i++}return i<f.colCount||r===!1&&u&&i<u.length?i:-1},e.prototype._closeDragFillPopup=function(){this._smartTag&&this._smartTag.close()},e.prototype._cellRangeInflate=function(n,t){var r,i;if(n&&n.length>0)for(r=0;r<n.length;r++){i=n[r];if(t.intersect(i.row,i.col,i.rowCount,i.colCount))return n.splice(r--,1),this._cellRangeInflate(n,this._unionCellRange(t,i))}return t},e.prototype._unionCellRange=function(t,i){var u=Math.min(t.row,i.row),r=Math.min(t.col,i.col),e=Math.max(t.row+t.rowCount-1,i.row+i.rowCount-1),f=Math.max(t.col+t.colCount-1,i.col+i.colCount-1);return u<0||r<0?u<0?r<0?new n.spread.Range(-1,-1,-1,-1):new n.spread.Range(-1,r,-1,f-r+1):new n.spread.Range(u,-1,e-u+1,-1):new n.spread.Range(u,r,e-u+1,f-r+1)},e.prototype._getClipboardHelper=function(){return!this._clipboardHelper&&this.parent&&this
.parent._clipboardHelper?this._clipboardHelper=this.parent._clipboardHelper:this._clipboardHelper||(this._clipboardHelper={fromSheet:null,range:null,isCutting:!1}),this._clipboardHelper},e.prototype._checkPastedRange=function(n,i,r,u,f,e){var tt=t._StringResource.Exp_PasteSourceCellsLocked,d=t._StringResource.Exp_InvalidCopyPasteSize,nt=t._StringResource.Exp_PasteDestinationCellsLocked,b=t._StringResource.Exp_PasteChangeMergeCell,w=t._StringResource.Exp_ChangePartOfArray,o,l,c,g,k,v,y;e.pastedInternal=!1,e.pastedRange=null;if(!n&&(!f||f===""))return!1;o=this;if(this._isPastedInternal(n,i,o,f)||!f){e.pastedInternal=!0;if(u&&n.isProtected&&n._isAnyCellInRangeLocked(i))return this._raiseInvalidOperation(t.InvalidOperationType.CopyPaste,tt),!1;e.pastedRange=this._getPastedRange(n,i,o,r,u)}else e.pastedRange=this._getPastedRangefromText(r,f);if(!e.pastedRange)return this._raiseInvalidOperation(t.InvalidOperationType.CopyPaste,d),!1;if(o.isProtected&&
amp;o._isAnyCellInRangeLocked(e.pastedRange))return this._raiseInvalidOperation(t.InvalidOperationType.CopyPaste,nt),!1;if(e.pastedInternal){if(n._hasPartSpans(i.row,i.col,i.rowCount,i.colCount))return this._raiseInvalidOperation(t.InvalidOperationType.CopyPaste,b),!1;if(n._hasPartArrayFormulas(i.row,i.col,i.rowCount,i.colCount))return this._raiseInvalidOperation(t.InvalidOperationType.CopyPaste,w),!1;var p=e.pastedRange.row<0?o.getRowCount():e.pastedRange.rowCount,a=e.pastedRange.col<0?o.getColumnCount():e.pastedRange.colCount,h=i.row<0?n.getRowCount():i.rowCount,s=i.col<0?n.getColumnCount():i.colCount;if(p>h||a>s)for(l=r.row,c=r.col,r.row<0&&h<o.getRowCount()&&(l=0),r.col<0&&s<o.getColumnCount()&&(c=0),(p%h!=0||a%s!=0)&&(p=h,a=s,e.pastedRange=new t.Range(l,c,p,a)),g=Math.floor(p/h),k=Math.floor(a/s),v=0;v<g;v++)for(y=0;y<k;y++){if(o._hasPartSpans(l<0?-1:l+v*h,c<0?-1:c+y*s,l<0?-1:h,c<0?-1:s))ret
urn this._raiseInvalidOperation(t.InvalidOperationType.CopyPaste,b),!1;if(o._hasPartArrayFormulas(l<0?-1:l+v*h,c<0?-1:c+y*s,l<0?-1:h,c<0?-1:s))return this._raiseInvalidOperation(t.InvalidOperationType.CopyPaste,w),!1}else{if(o._hasPartSpans(e.pastedRange.row,e.pastedRange.col,e.pastedRange.rowCount,e.pastedRange.colCount))return this._raiseInvalidOperation(t.InvalidOperationType.CopyPaste,b),!1;if(o._hasPartArrayFormulas(e.pastedRange.row,e.pastedRange.col,e.pastedRange.rowCount,e.pastedRange.colCount))return this._raiseInvalidOperation(t.InvalidOperationType.CopyPaste,w),!1}}else{if(o._hasPartSpans(e.pastedRange.row,e.pastedRange.col,e.pastedRange.rowCount,e.pastedRange.colCount))return this._raiseInvalidOperation(t.InvalidOperationType.CopyPaste,b),!1;if(o._hasPartArrayFormulas(e.pastedRange.row,e.pastedRange.col,e.pastedRange.rowCount,e.pastedRange.colCount))return this._raiseInvalidOperation(t.InvalidOperationType.CopyPaste,w),!1;if(e.pastedRange.row+e.pastedRange.ro
wCount>o.getRowCount()||e.pastedRange.col+e.pastedRange.colCount>o.getColumnCount())return this._raiseInvalidOperation(t.InvalidOperationType.CopyPaste,d),!1}return!0},e.prototype._isPastedInternal=function(n,i,u,f){if(n&&i&&u){var o=r.getRangeText(n,i.row,i.rowCount,i.col,i.colCount,"\r\n","\t",'"',!1,t.TextFileOpenFlags.None),e=o===f;return!e&&($.browser.chrome||$.browser.safari||$.browser.webkit)&&(e=o===f+"\r\n"),e}return!1},e.prototype._getPastedRange=function(n,i,r,u,f){var a=i.row<0?0:i.row,v=i.col<0?0:i.col,e=i.row<0?n.getRowCount():i.rowCount,o=i.col<0?n.getColumnCount():i.colCount,l=u.row<0?0:u.row,c=u.col<0?0:u.col,h=u.row<0?r.getRowCount():u.rowCount,s=u.col<0?r.getColumnCount():u.colCount,y;(f||h%e!=0||s%o!=0)&&(h=e,s=o);if(!this._isValidRange(a,v,e,o,n.getRowCount(),n.getColumnCount()))return null;if(!this._isValidRange(l,c,h,s,r.getRowCount(),r.getColumnCount()))re
turn null;y=new t.Range(l,c,h,s);if(!f&&n._name===r._name)if(y.contains(a,v,e,o)){if((a-l)%e!=0||(v-c)%o!=0)return null}else if(y.intersect(a,v,e,o))if(h>e||s>o)return null;return u.row===-1&&(l=-1,h=-1),u.col===-1&&(c=-1,s=-1),new t.Range(l,c,h,s)},e.prototype._getPastedRangefromText=function(n,i){var o=null,u=r.parseCsv(i,"\r\n","\t",'"');if(u){var h=n.row<0?0:n.row,s=n.col<0?0:n.col,e=u.length,f=r.getMaxLength(u);e>0&&f>0&&(o=new t.Range(h,s,e,f))}return o},e.prototype._clipboardPaste=function(n,i,u,f,e,o,s){var l,a,h,c,y,v,b,w,p,nt,g,k,d;if(n&&u._name===n._name&&u.parent&&!u.parent.sheets.contains(n))return;if(n&&i){b=t.UndoRedo.ClipboardPasteRangeUndoAction.convertPasteOption;if(e)r.moveTo(n,i.row,i.col,u,f.row,f.col,i.rowCount,i.colCount,b(s));else{w=f.row<0?u.getRowCount():f.rowCount,p=f.col<0?u.getColumnCount():f.colCount,h=i.row<0?n.getRowCount():i.row
Count,c=i.col<0?n.getColumnCount():i.colCount;if(w>h||p>c){l=f.row,a=f.col,f.row<0&&h<u.getRowCount()&&(l=0),f.col<0&&c<u.getColumnCount()&&(a=0),(w%h!=0||p%c!=0)&&(w=h,p=c),nt=Math.floor(w/h),g=Math.floor(p/c),n.suspendCalcService(),u.suspendCalcService();try{for(y=0;y<nt;y++)for(v=0;v<g;v++)r.copyTo(n,i.row,i.col,u,l<0?-1:l+y*h,a<0?-1:a+v*c,l<0?-1:h,a<0?-1:c,b(s))}finally{n.resumeCalcService(),u.resumeCalcService()}}else r.copyTo(n,i.row,i.col,u,f.row,f.col,i.rowCount,i.colCount,b(s))}}else{l=f.row,a=f.col,h=f.rowCount,c=f.colCount,k=u._spanModel.getEnumerator(l,a,h,c);while(k.moveNext())d=k.current(),d&&u._spanModel.remove(d);if(o&&o!=="")u.setCsv(l,a,o,"\r\n","\t",t.TextFileOpenFlags.ImportFormula);else for(y=0;y<h;y++)for(v=0;v<c;v++)u.setValue(l+y,a+v,null)}},e.prototype._raiseClipboardPasting=function(n,i){var r={sheet:this,sheetName:this._name,ce
llRange:n,pastOption:i,cancel:!1};return this._trigger(t.Events.ClipboardPasting,r),r.cancel===!0},e.prototype._raiseClipboardPasted=function(n,i){var r={sheet:this,sheetName:this._name,cellRange:n,pastOption:i};this._trigger(t.Events.ClipboardPasted,r)},e.prototype._raiseValueChanged=function(n,i){var r={sheet:this,sheetName:this._name,row:n,col:i};this._trigger(t.Events.ValueChanged,r)},e.prototype._raiseRangeDataChanged=function(n,i,r,u){var f={sheet:this,sheetName:this._name,row:n,column:i,rowCount:r,columnCount:u};this._trigger(t.Events.RangeChanged,f)},e.prototype._copyFormula=function(n,t,i,u,f,e){r.copyFormula(this,n,t,this,i,u,f,e)},e.prototype._getAutoFitType=function(){if(this.parent!=null){var n=this.parent;return n.autoFitType()}return t.AutoFitType.Cell},e.prototype._doCut=function(n){if(!this.isEditing()){var t=this.getSelections();if(t&&t.length===1)return this._clipboardCopy(t[0],!0,n)}return null},e.prototype._doCopy=function(n){if(!this.isEditing()){var t=
this.getSelections();if(t&&t.length===1)return this._clipboardCopy(t[0],!1,n)}return null},e.prototype._doPaste=function(n,i){var r;if(this.isEditing())return;var o=t._StringResource.Exp_InvalidPastedArea,e=this._getClipboardHelper(),u=e.fromSheet,f=e.range;this._eventHandler&&!n&&this._eventHandler._switchFocusForClipboard(""),r=this,setTimeout(function(){var a=n,c,y,p,b,w;r._eventHandler&&!n&&(a=r._eventHandler._getClipboardData(),r._eventHandler._switchBackFocusAfterClipboard()),c=e.isCutting,c&&(e.fromSheet=null,e.range=null,e.isCutting=!1),c&&u&&f&&u.isProtected&&u._isAnyCellInRangeLocked(f)&&(c=!1);var h={pastedRange:null,pastedInternal:!1},v=[],l=r.getSelections(),s;if(l.length>1)for(y=0;y<l.length;y++){s=l[y];if(!r._checkPastedRange(u,f,s,c,a,h))return;if(s.containsRange(h.pastedRange)&&!s.equals(h.pastedRange)){r._raiseInvalidOperation(t.InvalidOperationType.CopyP
aste,o);return}v.push(h.pastedRange)}else if(l.length>0){s=l[0];if(!r._checkPastedRange(u,f,s,c,a,h))return;v.push(h.pastedRange)}else{s=r._getSpanModel().find(r._activeRowIndex,r._activeColIndex),s||(s=new t.Range(r._activeRowIndex,r._activeColIndex,1,1));if(!r._checkPastedRange(u,f,s,c,a,h))return;v.push(h.pastedRange)}v.length>0&&(h.pastedInternal||(u=null,f=null),p=r.clipBoardOptions(),c&&(p=t.ClipboardPasteOptions.All),b={fromRange:f,pastedRanges:v.slice(0),isCutting:c,clipboardText:a},w=new t.UndoRedo.ClipboardPasteUndoAction(r,u,r,b,p),r._doCommand(w)),i&&i()},100)},e}();t.Sheet=at})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(t){t.feature("core.spread",["core.common","core.theme","core.sheet_event","core.sheet_action","core.sheet","core.spreadpanelex","core.stringResource","core.imageLoader"]);var i="un
defined",u=window.document,s="refresh",h="scroll",k="resize",ei="horizontal",fi="vertical",oi="input",c="div",r="px",e="0",et="3000",l="hidden",d="visible",hi="top",si="none",a="wijspreadpanelexscrolling",ti="wijspreadpanelexdragstop",o="wijmo-wijspreadpanelex",f=".gcSpread",ni="_data",b="wijmo-wijsuperpanel-handle",ii="mousedown",ui="mouseup",bi=function(){function v(i,r,u){this._scrollbarSize=18,this._host=null,this._allowUndo=!0,this._paintSuspended=!1,this._availableSheetIndex=-1,this.sheets=null,this.name=null,this._tabStripRatio=.5,this._tabStripRatioUserSet=.5,this._activeSheetIndex=0,this._allowUserZoom=!0,this._allowUserResize=!0,this._tabStripVisible=!0,this._tabEditable=!0,this._newTabVisible=!0,this.useWijmoTheme=!1,this._canUserEditFormula=!0,this._
highlightInvalidData=!1,this._autoFitType=n.spread.AutoFitType.Cell,this._tooltip=null,this._showVerticalScrollbar=!0,this._showHorizontalScrollbar=!0,this._backColor="white",this._backgroundImage=null,this._backgroundImageLayout=t.ImageLayout.Stretch,this._grayAreaBackColor="gray",this._imageLoader=null,this._init(i,r,u)}return v.prototype._init=function(i,r,f){var e,o,s;for(this.name=i,t.util.hasCalc()&&(this.calcService=new n.spread.Calc.Service(this)),this._userEvents=[],this._userEventsElem=u.createElement(oi),this._eventSuspended=0,this._undoManager=new t._UndoManager(this,-1,this.allowUndo()),this._clipboardHelper={fromSheet:null,range:null,isCutting:!1},this.sheets=[],this._namedStyles={},e=0;e<r;e++)this.sheets.push(this._createSheet(this._getDefaultSheetName(e)));if(this.sheets.length>0&&t.util.hasCalc()){for(o=null,e=0;!o&&e<this.sheets.length;e++)o=this.sheets[e]._getSheetSource();if(o)for(e=0;e<this.sheets.length;e
++)s=this.sheets[e]._getSheetSource(),s&&s.shareCalculations(o)}f&&this._setHost(f)},v.prototype._getDefaultSheetName=function(n){var i,u,r,t,f;this._availableSheetIndex<this.getSheetCount()?this._availableSheetIndex=this.getSheetCount():this._availableSheetIndex++,(n===undefined||n===null||n<this._availableSheetIndex)&&(n=this._availableSheetIndex),i=!1;do{u="Sheet"+(n+1),r=this.sheets.length;if(r>0)for(t=0;t<r;t++)if(t in this.sheets){f=this.sheets[t];if(f._name===u){n++,i=!0;break}else i&&(i=!1)}}while(i);return u},v.prototype._createSheet=function(n,i,r){var u=new t.Sheet(n);return u.isPaintSuspended(!0),u.setRowCount(i?i:200),u.setColumnCount(r?r:20),u.calcService=this.calcService,u.parent=this,u.isPaintSuspended(!1),u},v.prototype._setHost=function(i){var rt,a,b,y,ot,it,w,nt,p,tt,ht,st,v,g,ft,ut;this._host=i;if(i){for(rt=[],g=this,a=0;a<i.children.length;a++)rt.push(i.children[a]);i.innerHTML="<table cellspacing=
0 cellpadding=0 border=0><tr><td></td><td></td></tr><tr><td></td><td></td></tr></table>",y=i.firstChild,$(i).bind(n.spread.Events.CultureChanged,this,this._onCultureChanged);while(rt.length>0)i.insertBefore(rt.pop(),y);for(this._vp=u.createElement(c),this._vp.id=i.id+"vp",y.rows[0].cells[0].insertBefore(this._vp,null),ot="100%",y.style.width=ot,y.style.height=ot,y.style.border=e,y.style.margin=e,a=0;a<y.rows.length;a++)for(b=0;b<y.rows[a].cells.length;b++)y.rows[a].cells[b].style.padding=e,y.rows[a].cells[b].style.border=e;for(this._vs=u.createElement(c),this._vs.id=i.id+"vs",this._vs.style.overflowY=h,this._vs.style.overflowX=l,this._vs.style.border=e,y.rows[0].cells[1].insertBefore(this._vs,null),$(this._vs).bind(h+f,this,this._vscrollDelegate),$(this._vs).bind(ti+f,this,this._vScrollStop),$(this._vs).bind(ii+f,this,this._vScrollMouseDown),$(this._vs).bind(u
i+f,this,this._scrollMouseUp),it=u.createElement(c),it.id=i.id+"vsDummy",this._vs.appendChild(it),it.style.height=et+r,it.style.width="1"+r,y.rows[1].cells[0].innerHTML="<table cellspacing=0 cellpadding=0 border=0><tr><td></td><td></td></tr></table>",w=y.rows[1].cells[0].firstChild,w.style.border=e,w.style.margin=e,$(w).css("user-select","none"),a=0;a<w.rows.length;a++)for(b=0;b<w.rows[a].cells.length;b++)w.rows[a].cells[b].style.padding=e,w.rows[a].cells[b].style.border=e;this._tabs=u.createElement(c),this._tabs.style.width=""+this._getActualTabStripRatio()*this._host.clientWidth+r,this._tabs.style.height=""+this._scrollbarSize+r,w.rows[0].cells[0].insertBefore(this._tabs,null),this._tab=new wi(i.getAttribute("id")+"_tabStrip"),this._tab.setOwner(this),this._tab._setHost(this._tabs),this._hs=u.createElement(c),this._hs.id=i.id+"hs"
;,this._hs.style.overflowX=h,this._hs.style.overflowY=l,this._hs.style.border=e,w.rows[0].cells[1].insertBefore(this._hs,null),$(this._hs).bind(h+f,this,this._hscrollDelegate),$(this._hs).bind(ti+f,this,this._hScrollStop),$(this._hs).bind(ii+f,this,this._hScrollMouseDown),$(this._hs).bind(ui+f,this,this._scrollMouseUp),nt=u.createElement(c),nt.id=i.id+"hsDummy",this._hs.appendChild(nt),nt.style.width=et+r,nt.style.height="1"+r,$(window).bind(k+f,t.util.createEventHandler(this,this._doResize)),($.browser.chrome||$.browser.safari)&&(p=u.createElement(c),p.id=i.id+"vsTest",p.style.overflowY=h,p.style.overflowX=l,p.style.border=e,p.style.height="200"+r,p.style.width="26"+r,p.style.position="absolute",p.style.left="-1000"+r,this._dummyScrollbar=p,u.body.insertBefore(p,null),tt=u.createElement(c),tt.id=i.id+"dummyPanel",p.appendChild(tt),tt.style.height=et+r,tt.style.width="1"+r,ht={allowResi
ze:!1,keyboardSupport:!1,bubbleScrollingEvent:!1,hScroller:{scrollBarVisibility:l},vScroller:{scrollSmallChange:1,scrollLargeChange:10,scrollMin:0,scrollMax:100,scrollBarVisibility:d}},st=$(this._dummyScrollbar),st.css("overflowY",""),st.wijspreadpanelex(ht)),v=this.getActiveSheet(),v&&(v._setHost(this._vp),$(window).unbind("resize.gcSheet"),g=this,v._scrollCallback=function(n){if(g.getActiveSheet()!==v)return;if(n.action===h){if(n.orientation===fi){var r=$(g._vs),f=r.wijspreadpanelex().data(o).options,t=v._getScrollableRow(v._scrollTopRow);t!==-1&&t!=v._scrollTopRow&&(v._scrollTopRow=t),f.vScroller.scrollValue=v._scrollTopRow,r.wijspreadpanelex(s),g._refreshScrollbar()}else if(n.orientation===ei){var u=$(g._hs),e=u.wijspreadpanelex().data(o).options,i=v._getScrollableColumn(v._scrollLeftCol);i!=-1&&i!=v._scrollLeftCol&&(v._scrollLeftCol=i),e.hScroller.scrollValue=v._scrollLeftCol,u.wijspreadpanelex(s),g._refreshS
crollbar()}}else n.action===k&&g._doResize()}),this._doResize(),this._loadData(),ft=this._getFunction(this._host.id+"_onLoad"),ft&&ft(this),ut=$(u.forms).get(0),ut&&this._submitDelegate(ut)}},v.prototype._onCultureChanged=function(n,t){var u=n.data,f,e,r,o,i;for(u.invalidateLayout(),u.repaint(),f=!1,e=!1,r=0,o=u.sheets.length;r<o;r++)i=u.sheets[r],i._filterDialiog&&!f&&(i._filterDialiog._updateResource(),f=!0),i._smartTag&&!e&&(i._smartTag._updateResource(),e=!0)},v.prototype._submitDelegate=function(n){var t=n.onsubmit;n.onsubmit=function(){this.saveData(),typeof t=="function"&&t.apply()}},v.prototype._hscrollDelegate=function(t,i){var e=t.data,u=e.getActiveSheet(),r,f;u&&(r=parseInt(i.newValue,10),(i.oldValue===undefined||i.oldValue===null)&&(i.oldValue=0),i.oldValue=parseInt(i.oldValue,10),i.direction==="left"?(i.oldValue-i.newValue==10&&(r=u._getPrevPageLeftCo
lumn()),f=u._getScrollableColumn(r,!0),f!=-1&&f!=r&&(r=f)):i.direction==="right"&&(i.newValue-i.oldValue==10&&(r=u._getPageRightColumn()),f=u._getScrollableColumn(r),f!=-1&&f!=r&&(r=f)),i.newValue!==r&&(i.newValue=r),i.oldValue!==i.newValue&&(u._eventHandler.doHScroll(r),u._trigger(n.spread.Events.LeftColumnChanged,{sheet:u,sheetName:u._name,oldLeftCol:i.oldValue,newLeftCol:i.newValue})))},v.prototype._hScrollStop=function(n){var i=n.data,t=i.getActiveSheet();if(t){var f=$(i._hs),u=f.wijspreadpanelex().data(o).options,e=u.hScroller.scrollValue,r=!1;e<t._getFirstPageLeftColumn()&&(u.hScroller.scrollValue=t._getFirstPageLeftColumn(),r=!0),r&&(f.wijspreadpanelex(s),i._refreshScrollbar()),t._eventHandler._removeTooltip()}},v.prototype._hScrollMouseDown=function(n){var f=n.data,u=f.showScrollTip(),i,r;(u===t.ShowScrollTip.Horizontal||u===t.ShowScrollTip.Both)&&(i=$(n.srcElement?n.srcEleme
nt:n.target),r=i.parent(),i&&(i.hasClass(b)||r&&r.hasClass(b))&&f.getActiveSheet()._eventHandler._showScrollTooltip(!1,n))},v.prototype._vscrollDelegate=function(t,i){var e=t.data,u=e.getActiveSheet(),r,f;u&&i&&(r=parseInt(i.newValue,10),(i.oldValue===undefined||i.oldValue===null)&&(i.oldValue=0),i.oldValue=parseInt(i.oldValue,10),i.direction===hi?(i.oldValue-i.newValue==10&&(r=u._getPrevPageTopRow()),f=u._getScrollableRow(r,!0),f!=-1&&f!=r&&(r=f)):i.direction==="bottom"&&(i.newValue-i.oldValue==10&&(r=u._getPageBottomRow()),f=u._getScrollableRow(r),f!=-1&&f!=r&&(r=f)),i.newValue!==r&&(i.newValue=r),i.oldValue!==r&&(u._eventHandler.doVScroll(r),u._trigger(n.spread.Events.TopRowChanged,{sheet:u,sheetName:u._name,oldTopRow:i.oldValue,newTopRow:r})))},v.prototype._initPaint=function(){var u=n.spread.util._isStandardCanvas(),r,t,i;if(u)return;r=this.getActive
Sheet();if(!r)return;t=r._getCanvas(),t&&t.firstChild&&t.firstChild.loaded?(this.invalidateLayout(),this.repaint()):(i=this,window.setTimeout(function(){i._initPaint.call(i)},10))},v.prototype._vScrollStop=function(n){var u=n.data,t=u.getActiveSheet();if(t){var f=$(u._vs),i=f.wijspreadpanelex().data(o).options,e=i.vScroller.scrollValue,r=!1;e<t._getFirstPageTopRow()?(i.vScroller.scrollValue=t._getFirstPageTopRow(),r=!0):e>t._getLastPageTopRow()&&(i.vScroller.scrollValue=t._getLastPageTopRow(),r=!0),r&&(f.wijspreadpanelex(s),u._refreshScrollbar()),t._eventHandler._removeTooltip()}},v.prototype._vScrollMouseDown=function(n){var f=n.data,u=f.showScrollTip(),i,r;(u===t.ShowScrollTip.Vertical||u===t.ShowScrollTip.Both)&&(i=$(n.srcElement?n.srcElement:n.target),i&&(r=i.parent(),(i.hasClass(b)||r&&r.hasClass(b))&&f.getActiveSheet()._eventHandler._showScrollTooltip(!0,n)))},v.prototype._scrollMouseUp=function(n){var t=n.d
ata;t.getActiveSheet()._eventHandler._removeTooltip()},v.prototype._refreshScrollbar=function(){if(this._dummyScrollbar){var n=$(this._dummyScrollbar);n.wijspreadpanelex(s)}},v.prototype._loadData=function(n){var ot=this._host.id,nt=u.getElementById(ot+ni),c,e,y,f,o,h,p,v,ut,d,k,r,it,rt,b,ft,a,g,l,w,tt;if(!nt||nt.value==="")return;c=typeof JSON!="undefined"&&JSON.parse?JSON.parse(nt.value):null;if(c===undefined||c===null)return;this.suspendEvent(),this.isPaintSuspended(!0),e=null,c.length>0&&(e=JSON.parse(c[0])),this.calcService&&this.calcService.suspend(),this.setSheetCount(e.sheetCount),c.length>0&&e.referenceStyle!==null&&e.referenceStyle!==undefined&&this.referenceStyle(e.referenceStyle);if(c.length>1)for(ut=[],o=1;o<c.length;o++){r=JSON.parse(c[o]),f=this.sheets[o-1],it=r.name,d=r.rowCount,k=r.columnCount,f._allowCellOverflow=e.allowCellOverflow,y=r.data;if(y){if(n)for(h in y)typeof h!="functio
n"&&(f._dataModel.dataTable[h]=y[h]);else f._dataModel.dataTable=y;f._dataModel.dataTable.length=d}r.dataSource&&r.dataSource.length>0&&(rt=JSON.parse(r.dataSource),rt&&(f._dataSource=rt)),r.rows&&(f._rowInfos=r.rows),r.columns&&(f._colInfos=r.columns,f._colInfos.length=k);if(r.spans)for(h=0;h<r.spans.length;h++)b=r.spans[h],f._addSpanImp(b.Row,b.Column,b.RowCount,b.ColumnCount);if(r.colStyles)for(p in r.colStyles)isNaN(p)||(v=parseInt(p,10),f.setStyle(-1,v,r.colStyles[p]));if(r.rowStyles)for(p in r.rowStyles)isNaN(p)||(ft=parseInt(p,10),f.setStyle(ft,-1,r.rowStyles[p],t.SheetArea.viewport));r.rowHeaderAutoText!==null&&r.rowHeaderAutoText!==undefined&&(f.rowHeaderAutoText=r.rowHeaderAutoText),r.colHeaderAutoText!==null&&r.colHeaderAutoText!==undefined&&(f.colHeaderAutoText=r.colHeaderAutoText),r.referenceStyle!==null&&r.referenceStyle!==undefined&&f.referenceStyle(r.referenceSt
yle),r.gridline!==null&&r.gridline!==undefined&&(f.gridline=r.gridline),f._dataModel.name=it,f._name=it,f.setRowCount(d),f.setColumnCount(k),f.setActiveCell(r.ar,r.ac),f.setFrozenRowCount(r.frozenRowCount),f.setFrozenColumnCount(r.frozenColCount),f.setFrozenTrailingRowCount(r.frozenTrailingRowCount),f.setFrozenTrailingColumnCount(r.frozenTrailingColCount),ut[o]=y}if(c.length>0){this.setActiveSheetIndex(e.activeSheetIndex),typeof e.tabStripRatio!="undefined"&&this.setTabStripRatio(e.tabStripRatio),typeof e.tabStripVisible!="undefined"&&(this._tabStripVisible=e.tabStripVisible),typeof e.tabEditable!="undefined"&&(this._tabEditable=e.tabEditable),typeof e.newTabVisible!="undefined"&&(this._newTabVisible=e.newTabVisible),this.gcSpreadsheet=e.gcSpreadsheet,f=this.getActiveSheet();if(f){a=e.theme;if(typeof a=="string"||typeof a===i)f.currentTheme(a);else{var s=a.themeColor,et=new t.ThemeCo
lor(a.name,s.text1,s.text2,s.background1,s.background2,s.accent1,s.accent2,s.accent3,s.accent4,s.accent5,s.accent6,s.link,s.followedLink),st=new t.SpreadTheme(a.name,et,a.headingFont,a.bodyFont);f.currentTheme(st)}}e.useWijmoTheme&&(this.useWijmoTheme=e.useWijmoTheme);if(e.names)for(g=0;g<e.names.length;g++)l=e.names[g],l.sn?(f=this.getSheetFromName(l.sn),f&&f.addCustomName(l.name,l.formula,l.row,l.col)):this.addCustomName(l.name,l.formula,l.row,l.col);for(o=1;o<c.length;o++){y=ut[o],f=this.sheets[o-1],d=f.getRowCount(),k=f.getColumnCount();for(h in y)if(typeof h!="function"){w=y[h];if(w)for(v=0;v<k;v++)tt=null,w[v]&&(tt=w[v].formula),tt&&(w[v].formula=null,f.setFormula(parseInt(h,10),v,tt))}}}for(this.calcService&&this.calcService.resume(),this._recalcAll(),o=0;o<this.sheets.length;o++)f=this.sheets[o],f.clearPendingChanges();this.resumeEvent(),this.isPaintSuspended(!1),nt.value=""},v.prototype._getFunction=fun
ction(n){if(n===undefined||n===null||n==="")return null;try{return window[n]}catch(t){}return null},v.prototype._dispose=function(){$(window).unbind(k+f),$(this._vs).unbind(h+f),$(this._hs).unbind(h+f),this._disposeUserEvents();var t=this.getActiveSheet();t&&t._dispose(),this._host&&(this._host.innerHTML="",this._host.removeAttribute("gcUIElement"),$(this._host).unbind(n.spread.Events.CultureChanged)),($.browser.chrome||$.browser.safari)&&$("#"+this._host.id+"vsTest").remove()},v.prototype._disposeUserEvents=function(){var n,t;for($(this._userEventsElem).unbind(f),n=0;n<this.sheets.length;n++)t=this.sheets[n],t._disposeUserEvents()},v.prototype._getCalcContexts=function(){for(var i=[],r,n,t=0;t<this.sheets.length;t++){r=this.sheets[t],n=r._getCalcContexts();if(n)while(n.length>0)i.push(n.pop())}return i},v.prototype._doResize=function(){var c,k,f,v,h,nt,tt,p,y,n,i,t,u,rt,it,g;if($.browser.msie&&am
p;$.browser.version<9){c=this.canvas;if(c){var b=c.parentElement,e=b.parentElement,w=c.firstChild;w&&e&&(k=function(n){return n===""||n==="auto"||/%$/ig.test(n)},k(b.style.width)&&e.offsetWidth>12&&(w.width=e.offsetWidth-12),k(b.style.height&&e.offsetHeight>10)&&(w.height=e.offsetHeight-10))}}f=this._scrollbarSize,v=this._host;if(!v)return;h=v.clientWidth,nt=v.clientHeight,this._vp.style.width=this.showVerticalScrollbar()?""+(h-f)+r:""+h+r,this._vp.style.height=this.showHorizontalScrollbar()||this._tabStripVisible?""+(nt-f)+r:""+nt+r,tt=$(this._vp).width(),p=this._getActualTabStripRatio()*tt,this._tabs.style.width=""+(p-1)+r,this._vs.style.width=""+f+r,this._vs.style.height=this._vp.style.height,y=h-(this._tabStripVisible?p:0)-(this.showVerticalScrollbar()?f:0),this._hs.style.width=""+(y>0?y:1)+r,this._hs.style.height=""+f+r,
n=this.getActiveSheet(),n&&(n._scrollTopRow===0&&(n._scrollTopRow=n._getFirstPageTopRow()),n._scrollLeftCol===0&&(n._scrollLeftCol=n._getFirstPageLeftColumn())),i=$(this._vs),t=i.data(o)?i.data(o).options:null,t||(t={allowResize:!1,keyboardSupport:!0,bubbleScrollingEvent:!0,hScroller:{scrollBarVisibility:l},vScroller:{scrollSmallChange:1,scrollLargeChange:10,scrollMin:0,scrollBarVisibility:d}}),n&&(t.vScroller.scrollMin=n._getFirstPageTopRow(),t.vScroller.scrollMax=n.getRowCount()-n._frozenTrailingRowCount+t.vScroller.scrollLargeChange-2,t.vScroller.scrollValue<n._scrollTopRow&&(t.vScroller.scrollValue=n._scrollTopRow)),i.css("overflowY",""),i.wijspreadpanelex(t),i.unbind(a,this._vscrollDelegate),i.bind(a,this,this._vscrollDelegate),i.wijspreadpanelex(s),u=$(this._hs),t=u.data(o)?u.data(o).options:null,t||(t={allowResize:!1,keyboardSupport:!0,bubbleScrollingEvent:!0,vScroller:{scrollBarVisibility:l},hScroller:{scrollSmal
lChange:1,scrollLargeChange:10,scrollMin:0,scrollBarVisibility:d}}),n&&(t.hScroller.scrollMin=n._getFirstPageLeftColumn(),t.hScroller.scrollMax=n.getColumnCount()-n._frozenTrailingColCount+t.hScroller.scrollLargeChange-2,t.hScroller.scrollValue<n._scrollLeftCol&&(t.hScroller.scrollValue=n._scrollLeftCol)),u.css("overflowX",""),u.wijspreadpanelex(t),u.unbind(a,this._hscrollDelegate),u.bind(a,this,this._hscrollDelegate),u.wijspreadpanelex(s),n&&n._eventHandler.doResize(),this._tabStripVisible===!0?$(this._tabs).show():$(this._tabs).hide(),this._tab.doResize(),rt=$(this._vp).width(),it=$(this._tabs).width(),it>rt+1&&!this._haveLayoutFixing&&(this._haveLayoutFixing=!0,g=this,setTimeout(function(){delete g._haveLayoutFixing,g._doResize()},1))},v.prototype._doTabHSResize=function(){var f=this._scrollbarSize,e=this._host,u,n,i,t;if(!e)return;var v=e.clientWidth,c=$(this._vp).width(),h=this._getActualTabStripRatio()*c;this._t
abs.style.width=""+(h-1)+r,u=v-(this._tabStripVisible?h:0)-(this.showVerticalScrollbar()?f:0),this._hs.style.width=""+(u>0?u:1)+r,this._hs.style.height=""+f+r,n=this.getActiveSheet(),n&&n._scrollLeftCol===0&&(n._scrollLeftCol=n._getFirstPageLeftColumn()),i=$(this._hs),t=i.data(o)?i.data(o).options:null,t||(t={allowResize:!1,keyboardSupport:!0,bubbleScrollingEvent:!0,vScroller:{scrollBarVisibility:l},hScroller:{scrollSmallChange:1,scrollLargeChange:10,scrollMin:0,scrollBarVisibility:d}}),n&&(t.hScroller.scrollMin=n._getFirstPageLeftColumn(),t.hScroller.scrollMax=n.getColumnCount()-n._frozenTrailingColCount+t.hScroller.scrollLargeChange-2,t.hScroller.scrollValue<n._scrollLeftCol&&(t.hScroller.scrollValue=n._scrollLeftCol)),i.css("overflowX",""),i.wijspreadpanelex(t),i.unbind(a,this._hscrollDelegate),i.bind(a,this,this._hscrollDelegate),i.wijspreadpanelex(s),this._tabStripVisible===!0?$(this._tabs).
show():$(this._tabs).hide(),this._tab.doResize()},v.prototype._trigger=function(n,t){this._eventSuspended===0&&$(this._userEventsElem).trigger(n,[t])},v.prototype._copyUserEvents=function(n){var i,t;for(n._eventHandler._eventSuspended=this._eventSuspended,i=0;i<this._userEvents.length;i++)t=this._userEvents[i],n.bind(t.type,t.data,t.fn)},v.prototype._suspendInvalidate=function(){var n=this.getActiveSheet();n._suspendInvalidate()},v.prototype._resumeInvalidate=function(){var n=this.getActiveSheet();n._resumeInvalidate()},v.prototype._paintSpreadBackgroundImage=function(){var a=this.getActiveSheet(),i,n,f,e;if(a){if(!this._backgroundImage)return;i=$(a._getCanvas()),i.css("background-image","url("+this._backgroundImage+")").css("background-repeat","no-repeat");if(this._backgroundImageLayout===null||this._backgroundImageLayout===undefined)return;var u=i.width(),r=i.height(),v=this._backgroundImageLayout,c=this._backgroundImage
,y=this;this._imageLoader||(this._imageLoader=new t._GcImageLoader(function(){y._paintSpreadBackgroundImage()}));try{if(this._imageLoader.getState(c)){n=this._imageLoader.getImage(c);switch(v){case t.ImageLayout.Stretch:i.css("background-position","0% 0%").css("background-size","100% 100%");break;case t.ImageLayout.Center:f="50%",e="50%",n.width>u&&(f="0%"),n.height>r&&(e="0%"),i.css("background-position",f+" "+e).css("background-size","auto auto");break;case t.ImageLayout.Zoom:var o=0,s=0,l=u,h=r;r>0&&n.height>0&&u/r>n.width/n.height?(l=n.width/n.height*r,o=o+u/2-l/2):u>0&&n.width>0&&r/u>n.height/n.width&&(h=n.height/n.width*u,s=s+r/2-h/2),i.css("background-position",o+"px "+s+"px").css("background-size",l+"px "+h+"px");break;
case t.ImageLayout.None:i.css("background-position","0% 0%").css("background-size","auto auto");break;default:break}}else this._imageLoader.addImage(c)}catch(p){}}},v.prototype.showVerticalScrollbar=function(n){return arguments.length===0?this._showVerticalScrollbar:(this._showVerticalScrollbar=n,n?$(this._vs).show():$(this._vs).hide(),this._doResize(),this)},v.prototype.showHorizontalScrollbar=function(n){return arguments.length===0?this._showHorizontalScrollbar:(this._showHorizontalScrollbar=n,n?($(this._hs).show(),this.setTabStripRatio(this.getTabStripRatio())):($(this._hs).hide(),this._setActualTabStripRatio(1)),this._doResize(),this)},v.prototype.allowUserZoom=function(n){return arguments.length===0?this._allowUserZoom:(this._allowUserZoom=n,this)},v.prototype.allowUserResize=function(n){return arguments.length===0?this._allowUserResize:(this._allowUserResize=n,this)},v.prototype.tabStripVisible=function(n){return arguments.length===0?thi
s._tabStripVisible:(this._tabStripVisible=n,this._doResize(),this)},v.prototype.tabEditable=function(n){return arguments.length===0?this._tabEditable:(this._tabEditable=n,this)},v.prototype.newTabVisible=function(n){return arguments.length===0?this._newTabVisible:(this._newTabVisible=n,this._doTabHSResize(),this)},v.prototype.canUserEditFormula=function(n){return arguments.length===0?t.util.hasCalc()&&this._canUserEditFormula:(this._canUserEditFormula=n,this)},v.prototype.autoFitType=function(n){return arguments.length===0?this._autoFitType:(this._autoFitType=n,this)},v.prototype.startSheetIndex=function(n){return arguments.length===0?this._tab?this._tab._firstTab:0:(this._tab&&0<=n&&n<this.getSheetCount()&&(this._tab._firstTab=n),this._doTabHSResize(),this)},v.prototype.highlightInvalidData=function(n){if(arguments.length===0)return this._highlightInvalidData;var t=this,i=this.getActiveSheet();if(i)return i._bindToAutoRefresh(function(n){return
t._highlightInvalidData=n,t})(n);else t._highlightInvalidData=n},v.prototype.isPaintSuspended=function(n){if(arguments.length===0)return this._paintSuspended;else{if(this._paintSuspended!==n){this._paintSuspended=n;for(var t=0;t<this.sheets.length;t++)this.sheets[t].isPaintSuspended(n)}return this}},v.prototype.repaint=function(){this._tab&&this._tab.repaint();var n=this.getActiveSheet();n&&(n.invalidateLayout(),n.repaint())},v.prototype.invalidateLayout=function(){this._doResize();var n=this.getActiveSheet();n&&n.invalidateLayout()},v.prototype.getActiveSheet=function(){return this.sheets.length>0?this.sheets[this._activeSheetIndex]:null},v.prototype.getActiveSheetIndex=function(){return this._activeSheetIndex},v.prototype.setActiveSheetIndex=function(n){if(typeof n!="number")return;if(n===this._activeSheetIndex)return;var t=this.getActiveSheet();t&&t._dispose(),this._activeSheetIndex=n,t=this.getActiveSheet(),t&&this._setAct
iveSheetImp(t),this._doResize()},v.prototype.addNamedStyle=function(n){this._addNamedStyleImp(n,!0)},v.prototype._addNamedStyleImp=function(n,i){var r;if(n!==null&&n!==undefined){if(n.name===null||n.name===undefined||n.name==="")throw new Error(t._StringResource.Exp_EmptyNamedStyle);if(i){var f=this,r=n.name.toUpperCase(),u=this.getActiveSheet();u?u._bindToAutoRefresh(function(n){f._namedStyles[r]=n})(n):this._namedStyles[r]=n}else r=n.name.toUpperCase(),this._namedStyles[r]=n}},v.prototype.getNamedStyle=function(n){if(this._namedStyles&&n!==undefined&&n!=null&&n!==""){n=n.toUpperCase();if(this._namedStyles.hasOwnProperty(n)&&this._namedStyles[n])return this._namedStyles[n]||null}return null},v.prototype.removeNamedStyle=function(n){if(this._namedStyles&&n!==undefined&&n!=null&&n!==""){n=n.toUpperCase();if(this._namedStyles.hasOwnProperty(n)){delete this._namedStyles[n];var t=this.getActive
Sheet();t&&t._bindToAutoRefresh(function(){})()}}},v.prototype._setActiveSheetImp=function(n){n._setHost(this._vp);var t=this;n._scrollCallback=function(i){var u,e,r,f;if(t.getActiveSheet()!==n)return;i.action===h?i.orientation===fi?(u=$(t._vs),e=u.wijspreadpanelex().data(o).options,e.vScroller.scrollValue=n._scrollTopRow,u.wijspreadpanelex(s),t._refreshScrollbar()):i.orientation===ei&&(r=$(t._hs),f=r.wijspreadpanelex().data(o).options,f.hScroller.scrollValue=n._scrollLeftCol,r.wijspreadpanelex(s),t._refreshScrollbar()):i.action===k&&t._doResize()},window.gcGlobal.activeElement=n,n._syncHScollbarPosition(),n._syncVScrollbarPosition()},v.prototype.addSheet=function(n,i){var r,h,u,o,f;for((i===undefined||i===null)&&(i=this._createSheet(this._getDefaultSheetName(n),200,20)),(i._name===undefined||i._name===null||i._name==="")&&(i._name=this._getDefaultSheetName(n)),h=this.sheets.length,r=0;r<h;r++)if(this.sheets[r]._name===i._name)thr
ow t._StringResource.Exp_NotSupport;this._copyUserEvents(i),u=null;if(this.sheets.length>0)for(r=0;!u&&r<this.sheets.length;r++)u=this.sheets[r]._getSheetSource();var s=this.getActiveSheet(),l=this._activeSheetIndex,c=this.sheets.length-n,e=[];for(r=0;r<c&&this.sheets.length>0;r++)e.push(this.sheets.pop());this.isPaintSuspended()!==i.isPaintSuspended()&&i.isPaintSuspended(this.isPaintSuspended()),this.sheets.push(i),i.parent=this,i.calcService=this.calcService,i.updateCalcContexts(),u&&(o=i._getSheetSource(),o&&o.shareCalculations(u));while(e.length>0)this.sheets.push(e.pop());this.sheets.length===1?(this._vp&&i._setHost(this._vp),this._activeSheetIndex=0):this._activeSheetIndex=l,f=this.getActiveSheet(),f!==s&&(s&&s._dispose(),f&&this._setActiveSheetImp(f),this._doResize()),this._tab&&this._tab.repaint()},v.prototype.removeSheet=function(n){var u,i,r;if(isNaN(n)||n<0||n>=this.sheets
.length)throw new Error(t._StringResource.Exp_IndexOutOfRange);u=n<=this._activeSheetIndex||n===this.sheets.length-1,i=this.getActiveSheet(),n<this._activeSheetIndex&&this._activeSheetIndex--,r=this.sheets[n],r._disposeUserEvents(),this.sheets.splice(n,1),this.sheets.length===0?this._activeSheetIndex=-1:this._activeSheetIndex<this.sheets.length||(this._activeSheetIndex=this.sheets.length-1),u&&(i&&i._dispose(),this._activeSheetIndex>-1&&this._setActiveSheetImp(this.sheets[this._activeSheetIndex])),this.calcService&&this.calcService.contextChanged(),this._tab&&(this._tab._firstTab<this.sheets.length||(this._tab._firstTab=this.sheets.length-1),this._tab._firstTab<0&&(this._tab._firstTab=0),this._tab.repaint())},v.prototype.clearSheets=function(){for(var n=0;n<this.sheets.length;n++)this.sheets[n]._disposeUserEvents(),this.sheets[n]._dispose();this.sheets.splice(0,this.sheets.length),this.calcService&&
this.calcService.contextChanged(),this._activeSheetIndex=-1,this._tab&&(this._tab._firstTab=0,this._tab.repaint())},v.prototype.getSheet=function(n){return n>=0&&n<this.sheets.length?this.sheets[n]:null},v.prototype.getSheetFromName=function(n){for(var t=0;t<this.sheets.length;t++)if(this.sheets[t].getName()===n)return this.sheets[t];return null},v.prototype.getSheetCount=function(){return this.sheets.length},v.prototype.setSheetCount=function(n){if(n<0)throw t._StringResource.Exp_ArgumentOutOfRange;else n===0&&this.clearSheets();var r=this.sheets.length,i;if(n<r)for(i=r-1;i>=n;i--)this.removeSheet(i);else if(n>r)for(i=r;i<n;i++)this.addSheet(i)},v.prototype.search=function(n){var u,r,f,i;if(!n||!t.features.search)return null;u=t.SearchFoundFlags.None;if(!n.searchString||n.searchTarget===u||this.getSheetCount()<=0)return new t.SearchResult;n.startSheetIndex===-1&&(n.startSheetIndex=0),n.endSheetIndex===-1&&(n.endShee
tIndex=this.getSheetCount()-1);if(n.endSheetIndex>=n.startSheetIndex&&0<=n.startSheetIndex&&n.startSheetIndex<this.getSheetCount()&&0<=n.endSheetIndex&&n.endSheetIndex<this.getSheetCount())for(r=n.startSheetIndex;r<=n.endSheetIndex;r++){f=this.getSheet(r),i=f.search(n);if(i&&i.searchFoundFlag!==u)return i.foundSheetIndex=r,i}return new t.SearchResult},v.prototype.showCell=function(n,t,i,r){var u=this.getActiveSheet();u&&u.showCell(n,t,i,r)},v.prototype.showColumn=function(n,t){var i=this.getActiveSheet();i&&i.showColumn(n,t)},v.prototype.showRow=function(n,t){var i=this.getActiveSheet();i&&i.showRow(n,t)},v.prototype.showActiveCell=function(n,t){var i=this.getActiveSheet();i&&i.showCell(i._activeRowIndex,i._activeColIndex,n,t)},v.prototype.getCustomName=function(n){return this._names?this._names[n]:null},v.prototype.getCustomNames=function(){var n=[];return this._names&&$.each(this._nam
es,function(t,i){n.push(i)}),n},v.prototype.addCustomName=function(n,i,r,u){if(n===undefined||n===null||n===""||i===undefined||i===null||i==="")throw new Error(t._StringResource.Exp_InvalidCustomName);this._names||(this._names={});if(this.calcService){var f=this.calcService.parse(i,r,u);this._names[n]=new t.NameInfo(n,f,r,u),this._recalcAll()}},v.prototype.removeCustomName=function(n){this._names&&n!==undefined&&n!==null&&n!==""&&this._names.hasOwnProperty(n)&&(delete this._names[n],this._recalcAll())},v.prototype.clearCustomNames=function(){this._names&&(delete this._names,this._recalcAll())},v.prototype._findCustomName=function(n){if(n===undefined||n===null||n==="")return null;return this.getCustomName(n)},v.prototype.addCustomFunction=function(n){if(!t.util.hasCalc())return;if(n===undefined||n===null||!(n instanceof t.Calc.Functions.Function))throw new Error(t._StringResource.Exp_InvalidCustom
Function);var i=n.name.toUpperCase();this._functions||(this._functions=[]),this._functions[i]=n,this._recalcAll()},v.prototype.getCustomFunction=function(n){return this._functions&&n!==undefined&&n!==null&&n!==""?this._functions[n.toUpperCase()]:null},v.prototype.removeCustomFunction=function(n){this._functions&&n!==undefined&&n!==null&&n!==""&&(n=n.toUpperCase(),this._functions.hasOwnProperty(n)&&(delete this._functions[n],this._recalcAll()))},v.prototype.clearCustomFunctions=function(){var t,n;if(this._functions){t=[];for(n in this._functions)this._functions.hasOwnProperty(n)&&t.push(n);delete this._functions,this._recalcAll()}},v.prototype._recalcAll=function(){this.calcService&&this.calcService.recalculateAll()},v.prototype.referenceStyle=function(n){var r=t.ReferenceStyle.R1C1,i=t.ReferenceStyle.A1;return arguments.length===0?this.calcService?this.calcService.useR1C1?r:i:i:(this.
calcService&&(this.calcService.useR1C1=n===r),this)},v.prototype.bind=function(n,t,i){var r,u;for(this._userEvents.push({type:n,data:t,fn:i}),$(this._userEventsElem).bind(n+f,t,i),r=0;r<this.sheets.length;r++)u=this.sheets[r],u.bind(n,t,i)},v.prototype.unbind=function(n,t){for(var e,r,u,i=0;i<this._userEvents.length;i++)e=this._userEvents[i],e.type===n&&this._userEvents.splice(i,1);for($(this._userEventsElem).unbind(n+f,t),r=0;r<this.sheets.length;r++)u=this.sheets[r],u.unbind(n,t)},v.prototype.unbindAll=function(){var n,t;for(this._userEvents.length=0,$(this._userEventsElem).unbind(f),n=0;n<this.sheets.length;n++)t=this.sheets[n],t.unbindAll()},v.prototype.suspendEvent=function(){var n,t;for(this._eventSuspended++,n=0;n<this.sheets.length;n++)t=this.sheets[n],t.suspendEvent()},v.prototype.resumeEvent=function(){var n,t;for(this._eventSuspended--,this._eventSuspended<0&&(this._eventSuspended=0),n=0;n<this.sheets.length;n++)t=this.sheets[n
],t.resumeEvent()},v.prototype.saveData=function(){var v,e,i,n,c,o,t,r,h,f,l;if(!this._host)return;v=this._host.id,e=u.getElementById(v+ni);if(e===undefined||e===null)return;var a=this.getSheetCount(),s=[],y={activeSheetIndex:this.getActiveSheetIndex(),sheetCount:a,tabStripRatio:this.getTabStripRatio(),tabStripVisible:this._tabStripVisible,tabEditable:this._tabEditable,newTabVisible:this._newTabVisible,allowCellOverflow:this.getActiveSheet()?this.getActiveSheet()._allowCellOverflow:!1,theme:this.getActiveSheet().currentTheme().name()};for(s.push(JSON.stringify(y)),i=0;i<a;i++){n=this.getSheet(i),c="",n.deletedRows&&(c=JSON.stringify(n.deletedRows)),o={};for(t in n._rowInfos)typeof t!="function"&&(r=n._rowInfos[t],r&&r.dirty&&(o[t]=r));h={};for(t in n._colInfos)typeof t!="function"&&(f=n._colInfos[t],f&&f.dirty&&(h[t]=f));l={name:n._name,ar:n._activeRowIndex,ac:n._activeColIndex,columns:h,rows:o,
rowCount:n.getRowCount(),columnCount:n.getColumnCount(),data:n._dataModel.dirtyNodes,deletedRows:c,spans:n._getSpanModel(),rowHeaderAutoText:n.rowHeaderAutoText,colHeaderAutoText:n.colHeaderAutoText,referenceStyle:n.referenceStyle(),gridline:n.gridline,frozenRowCount:n.frozenRowCount,frozenColCount:n.frozenColCount,frozenTrailingRowCount:n._frozenTrailingRowCount,frozenTrailingColCount:n._frozenTrailingColCount},s.push(JSON.stringify(l))}e.value=JSON.stringify(s)},v.prototype.doCommand=function(n){this._undoManager.doAction(n)},v.prototype.allowUndo=function(n){return arguments.length===0?this._allowUndo:(this._allowUndo=n,this._undoManager&&(this._undoManager._allowUndo=n),this)},v.prototype.undoManager=function(){return this._undoManager||(this._undoManager=new t._UndoManager(this,-1,this.allowUndo())),this._undoManager},v.prototype.canUserDragDrop=function(n){return arguments.length===0?((this._allowDragDrop===undefined||this._allowDragDrop===null)&&(this._allowDr
agDrop=!0),this._allowDragDrop):(this._allowDragDrop=n,this)},v.prototype.canUserDragFill=function(n){if(arguments.length===0)return t.features.fill?((this._allowDragFill===undefined||this._allowDragFill===null)&&(this._allowDragFill=!0),this._allowDragFill):!1;else{if(this._allowDragFill!==n){this._allowDragFill=n;var i=this.getActiveSheet();i&&i.getSelections().length===1&&i._render.repaintSelection(i.getSelections().toArray()[0])}return this}},v.prototype.toJSON=function(){for(var c=this.getSheetCount(),r={version:"1.0",activeSheetIndex:this.getActiveSheetIndex(),sheetCount:c,tabStripRatio:this.getTabStripRatio(),tabStripVisible:this._tabStripVisible,tabEditable:this._tabEditable,newTabVisible:this._newTabVisible,referenceStyle:this.referenceStyle(),useWijmoTheme:this.useWijmoTheme,canUserEditFormula:this._canUserEditFormula,startSheetIndex:this.startSheetIndex(),allowUndo:this._allowUndo,allowUserZoom:this._allowUserZoom,allowUserResize:this._al
lowUserResize,allowDragDrop:this._allowDragDrop,allowDragFill:this._allowDragFill,highlightInvalidData:this._highlightInvalidData,autoFitType:this._autoFitType,sheets:null,names:null,showScrollTip:this._showScrollTip,showResizeTip:this._showResizeTip,showDragDropTip:this._showDragDropTip,showDragFillTip:this._showDragFillTip,showHorizontalScrollbar:this._showHorizontalScrollbar,showVerticalScrollbar:this._showVerticalScrollbar,backColor:this._backColor,backgroundImage:this._backgroundImage,backgroundImageLayout:this._backgroundImageLayout,grayAreaBackColor:this._grayAreaBackColor,namedStyles:null},o={},i,e,l,f,u,n=0;n<c;n++)i=this.getSheet(n),o[i._name]=i.toJSON(),o[i._name]._index=n;r.sheets=o,e=[];if(this._namedStyles)for(l in this._namedStyles)e.push(this._namedStyles[l]);r.namedStyles=e,f=[];if(this._names&&this.calcService)for(u in this._names)if(this._names.hasOwnProperty(u)){var t=this._names[u],y=t.getName(),h=t.getRow(),s=t.getColumn(),v=t.getExpression(),a=this.
calcService.unparse(v,h,s);f.push({name:y,formula:a,row:h,col:s})}return r.names=f,r},v.prototype.fromJSON=function(r){var v,c,l,a,u,e,h,s,o,f;if(!r)return;v=this.isPaintSuspended(),this.isPaintSuspended(!0);try{t.util.hasCalc()&&(this.calcService=new n.spread.Calc.Service(this)),this._availableSheetIndex=-1,this.clearSheets(),this.setSheetCount(r.sheetCount),this.referenceStyle(n.spread.ReferenceStyle.A1);if(r.namedStyles)for(u=0;u<r.namedStyles.length;u++)c=r.namedStyles[u],l=new t.Style,l.copyFrom(c),typeof c.validator!==i&&(t.features.dataValidator&&(a=new n.spread.DefaultDataValidator,a.fromJSON(c.validator)),l.validator=a),this._addNamedStyleImp(l,!1);u=0;if(r.sheets)for(o in r.sheets)typeof o=="string"&&(f=r.sheets[o],e=f._index!=undefined?this.sheets[f._index]:this.sheets[u],e.fromJSON(f,!1),u++);this.setActiveSheetIndex(r.activeSheetIndex),typeof r.tabStripRatio!==i&&this.setTabStripRatio(r.tabStripRatio),typeof r.tabStri
pVisible!==i&&(this._tabStripVisible=r.tabStripVisible),typeof r.tabEditable!==i&&(this._tabEditable=r.tabEditable),typeof r.newTabVisible!==i&&(this._newTabVisible=r.newTabVisible),this.gcSpreadsheet=r.gcSpreadsheet,typeof r.useWijmoTheme!==i&&(this.useWijmoTheme=r.useWijmoTheme),typeof r.canUserEditFormula!==i&&(this._canUserEditFormula=r.canUserEditFormula),typeof r.startSheetIndex!==i&&this.startSheetIndex(r.startSheetIndex),typeof r.allowUndo!==i&&this.allowUndo(r.allowUndo),typeof r.allowUserZoom!==i&&(this._allowUserZoom=r.allowUserZoom),typeof r.allowUserResize!==i&&(this._allowUserResize=r.allowUserResize),typeof r.allowDragDrop!==i&&(this._allowDragDrop=r.allowDragDrop),typeof r.allowDragFill!==i&&(this._allowDragFill=r.allowDragFill),typeof r.highlightInvalidData!==i&&(this._highlightInvalidData=r.highlightInvalidData),typeof r.autoFitType!==i&&this.autoFitType(r.autoFi
tType),typeof r.showResizeTip!==i&&(this._showResizeTip=r.showResizeTip),typeof r.showScrollTip!==i&&(this._showScrollTip=r.showScrollTip),typeof r.showDragDropTip!==i&&(this._showDragDropTip=r.showDragDropTip),typeof r.showDragFillTip!==i&&(this._showDragFillTip=r.showDragFillTip),typeof r.showHorizontalScrollbar!==i&&this.showHorizontalScrollbar(r.showHorizontalScrollbar),typeof r.showVerticalScrollbar!==i&&this.showVerticalScrollbar(r.showVerticalScrollbar),typeof r.backColor!==i&&this.backColor(r.backColor),typeof r.backgroundImage!==i&&this.backgroundImage(r.backgroundImage),typeof r.backgroundImageLayout!==i&&this.backgroundImageLayout(r.backgroundImageLayout),typeof r.grayAreaBackColor!==i&&this.grayAreaBackColor(r.grayAreaBackColor),this.calcService&&this.calcService.suspend(),this.clearCustomNames();if(r.names)for(h=0;h<r.names.length;h++)s=r.names[h],this.addCustomName(s.name,s.formu
la,s.row,s.col);u=0;if(r.sheets)for(o in r.sheets)typeof o=="string"&&(f=r.sheets[o],e=f._index!=undefined?this.sheets[f._index]:this.sheets[u],e.formulaFromJSON(f),u++);r.referenceStyle!==null&&r.referenceStyle!==undefined&&this.referenceStyle(r.referenceStyle),this.calcService&&this.calcService.resume()}finally{this.isPaintSuspended(v)}},v.prototype.setTabStripRatio=function(n,i){var r,e,f,u;typeof i=="undefined"&&(i=!1);if(isNaN(r=n))throw t._StringResource.Exp_InvalidArgument;e=this._vp.clientWidth,f=this._tab._resizeBarWidth/e,this._tabStripRatio=r<f?f:r>1?1:r,this._tabStripRatioUserSet=r<0?0:r>1?1:r,this._doTabHSResize(),i||(u=$(this._hs),u.wijspreadpanelex&&u.wijspreadpanelex(s),this._refreshScrollbar())},v.prototype.getTabStripRatio=function(){return this._tabStripRatioUserSet},v.prototype._getActualTabStripRatio=function(){return this.showHorizontalScrollbar()?this._tabStripRatio:1},v.prototype.
_setActualTabStripRatio=function(n){this._tabStripRatio=n},v.prototype.showScrollTip=function(n){return arguments.length===0?((this._showScrollTip===undefined||this._showScrollTip===null)&&(this._showScrollTip=t.ShowScrollTip.None),this._showScrollTip):(this._showScrollTip=n,this)},v.prototype.showResizeTip=function(n){return arguments.length===0?((this._showResizeTip===undefined||this._showResizeTip===null)&&(this._showResizeTip=t.ShowResizeTip.None),this._showResizeTip):(this._showResizeTip=n,this)},v.prototype.showDragDropTip=function(n){return arguments.length===0?t.util.hasCalc()?((this._showDragDropTip===undefined||this._showDragDropTip===null)&&(this._showDragDropTip=!0),this._showDragDropTip):!1:(this._showDragDropTip=n,this)},v.prototype.showDragFillTip=function(n){return arguments.length===0?t.features.fill?((this._showDragFillTip===undefined||this._showDragFillTip===null)&&(this._showDragFillTip=!0),this._showDragFillTip):!1:(this._showDrag
FillTip=n,this)},v.prototype.grayAreaBackColor=function(n){if(arguments.length===0)return this._grayAreaBackColor;var t=this,i=this.getActiveSheet();if(i)return i._bindToAutoRefresh(function(n){return t._grayAreaBackColor=n,t})(n);else t._grayAreaBackColor=n},v.prototype.backColor=function(n){if(arguments.length===0)return this._backColor;var t=this,i=this.getActiveSheet();if(i)return i._bindToAutoRefresh(function(n){return t._backColor=n,t})(n);else t._backColor=n},v.prototype.backgroundImage=function(n){if(arguments.length===0)return this._backgroundImage;var t=this,i=this.getActiveSheet();return i?i._bindToAutoRefresh(function(n){return t._backgroundImage=n,t._paintSpreadBackgroundImage(),t})(n):(this._backgroundImage=n,this)},v.prototype.backgroundImageLayout=function(n){return arguments.length===0?this._backgroundImageLayout:(this._backgroundImageLayout=n,this._paintSpreadBackgroundImage(),this)},v.prototype._findTable=function(n){var r,u,t,f,i;if(!this.sheets||this.sheets.leng
th===0)return null;for(r=this.sheets,u=r.length,t=0;t<u;t++){f=r[t],i=f.findTableByName(n);if(i)return i}return null},v}();t.Spread=bi;var w=".gcTab",tt=".tabNameEditor",ri=".spliter",v="mouse",ki="down",ai="move",vi="up",di="out",nr="focusin",gi="focusout",pi="keydown",li=v+ai+ri,ci=v+vi+ri,yi=pi+tt,gt=nr+tt,lt=gi+tt,ut=v+ki+w,rt=v+ai+w,st=v+vi+w,ht=v+di+w,ot="dblclick"+w,at="canvas",ct="2d",g="resizeBar",nt="navButton",p="tab",it="newTab",y="#FFFFFF",bt="#D8E7FA",kt="#D5E5F9",dt="#B6D2F5",wt="#D9E7F9",vt="#688CAF",yt="#92A5C7",pt="black",ft="white",wi=function(){function f(n){this._spread=null,this._activeIndex=0,this._firstTab=0,this._tabStartPos=74,this._tabLeftPadding=12,this._tabRightPadding=8,this._tabSpace=
3,this._activePos=70,this._hoverNavButton=-1,this._hoverTab=-1,this._navButtonSize=18,this._newTabSize=48,this._firstTabSpace=5,this._font="10pt Arial",this._resizeBarWidth=8,this._tabSizes=[],this._init(n)}return f.prototype._init=function(n){this._bounds=new t.Rect(0,0,200,20),this.name=n},f.prototype._setHost=function(i){var f=u.createElement(at),r;f.setAttribute("id",this.name),i.appendChild(f),f.gcObject=!0,this.canvas&&(r=$(this.canvas),r.unbind(ut),r.unbind(rt),r.unbind(st),r.unbind(ht),r.unbind(ot),this.canvas.parentNode.removeChild(this.canvas)),this.canvas=f,!n.spread.util._isStandardCanvas()&&n.spread.util._isSilverlightCanvas()&&(f.setAttribute("renderMethod","auto"),f.setAttribute("onload",this._test(this))),r=$(f),r.bind(ut,t.util.createEventHandler(this,this.doMouseDown)),r.bind(rt,t.util.createEventHandler(this,this.doMouseMove)),r.bind(st,t.util.createEventHandler(this,this.doMouseUp)),r.bind(
ht,t.util.createEventHandler(this,this.doMouseOut)),r.bind(ot,t.util.createEventHandler(this,this.doMouseDbClick)),this.doResize()},f.prototype._test=function(n){return n._spread.initPaint(n._spread)},f.prototype.setOwner=function(n){this._spread=n,n&&n._font&&n._font.length>0&&(this._font=n._font)},f.prototype._dispose=function(){var n=this.canvas;n&&($(n).unbind(ut),$(n).unbind(rt),$(n).unbind(st),$(n).unbind(ot),$(n).unbind(ht),n.parentNode.removeChild(n))},f.prototype.getBounds=function(){return this._bounds},f.prototype.setBounds=function(n){this._bounds.x=n.x,this._bounds.y=n.y,this._bounds.width=n.width,this._bounds.height=n.height},f.prototype.doNavButtonClick=function(n){var t=this._firstTab,r=this,i=200;switch(n){case 0:t=0;break;case 1:t-=1,t>0&&(this._repeatDown=window.setTimeout(function(){r.doNavButtonClick(1)},i)),t<0&&(t=0);break;case 2:t+=1,t<this._spread.sheets.length-1&&(this._repeatDown=window.se
tTimeout(function(){r.doNavButtonClick(2)},i)),t<this._spread.sheets.length||(t=this._spread.sheets.length-1),t<0&&(t=0);break;case 3:t=this._spread.sheets.length-1,t<0&&(t=0);break;default:return}t!==this._firstTab&&(this._firstTab=t,this.repaint())},f.prototype._hitTest=function(n,t){var u=this.getBounds(),e,i,r,f;if(u.x+u.width-this._resizeBarWidth<n&&n<u.x+u.width)if(this._spread.showHorizontalScrollbar())return{element:g};for(e=-1,i=0,r=0;r<4;r++){if(i<=n&&n<i+this._navButtonSize){e=r;break}i+=this._navButtonSize}if(e!==-1)return{element:nt,index:r};i=this._tabStartPos;if(this._firstTab>0){if(i<n&&n<i+this._firstTabSpace+this._tabSpace)return{element:p,index:this._firstTab-1,position:i};i+=this._firstTabSpace}f=0;if(this._firstTab>-1)for(r=this._firstTab;r<this._spread.sheets.length&&r<this._tabSizes.length;r++){f=this._tabSizes[r];if(i<n&&n<i+f+this._tabSpace)return{
element:p,index:r,position:i};i+=f+this._tabSpace}if(this._spread._newTabVisible)if(n>i&&n<i+this._newTabSize)return{element:it,position:i};return{element:""}},f.prototype.doMouseDown=function(t){var l=$(this._getCanvas()).offset(),v=t.pageX-l.left,a=t.pageY-l.top,i=this._spread.getActiveSheet(),r,f,u,o,s,h,c,e;this._tabNameEditor&&this.endSheetTabEditing(i,!1),u=this._hitTest(v,a),o=n.spread.Events;if(t.button===0){if(u.element===g)this.resizeTab=!0,this.activeX=t.pageX,this.handleDocumentMouseMove();else if(u.element===nt)this.doNavButtonClick(u.index);else if(u.element===p)s=u.index,h=u.position,this._activeIndex=s,this._activePos=h,r=this._spread.getSheet(s),this._spread._trigger(o.SheetTabClick,{sheet:r,sheetName:r._name,sheetTabIndex:s}),s!==this._spread._activeSheetIndex&&(f={oldSheet:i,newSheet:r,cancel:!1},this._spread._trigger(o.ActiveSheetChanging,f),f&&f.cancel===!1&&(this._spread.setActiveSheetIndex(s),this._spread
._trigger(o.ActiveSheetChanged,{oldSheet:i,newSheet:r}),this._activeIndex<this._firstTab?this._firstTab--:this._activeIndex>this._firstTab&&this._activePos+this._tabSizes[this._activeIndex]>this.getBounds().width-this._resizeBarWidth&&this._firstTab++,this.repaint()));else if(u.element===it){c=this._spread,c._trigger(o.SheetTabClick,{sheet:null,sheetName:null,sheetTabIndex:-1}),e=this._spread.sheets.length,r=this._spread._createSheet(this._spread._getDefaultSheetName(e)),this._spread.addSheet(e,r),this._activeIndex=e,this._activePos=u.position,f={oldSheet:i,newSheet:r,cancel:!1},this._spread._trigger(o.ActiveSheetChanging,f);if(f&&f.cancel===!1){r._eventHandler&&r._eventHandler._doCallBack("activeSheetChanged,"+this._spread._activeSheetIndex+","+e,{oldValue:this._spread._activeSheetIndex,newValue:e}),this._spread.setActiveSheetIndex(e),this._spread._trigger(o.ActiveSheetChanged,{oldSheet:i,newSheet:r});while(this._activeIn
dex>this._firstTab&&this._activePos+this._tabSizes[this._activeIndex]+this._newTabSize>this.getBounds().width-this._resizeBarWidth)this._activePos-=this._tabSizes[this._firstTab],this._firstTab++;this.repaint()}}i=this._spread.getActiveSheet();if(i&&!i.isEditing()&&i._eventHandler)try{i._eventHandler._tabStripHitTestResult={left:t.pageX,top:t.pageY},i._eventHandler._setFocus()}finally{i._eventHandler._tabStripHitTestResult=null}}return this._isMouseDownInTab=!0,!1},f.prototype.doMouseMove=function(n){var s="default",o="w-resize",r,u;if(this.resizeTab){this.canvas.style.cursor=o;var h=n.pageX-this.activeX,f=this._spread._vp.clientWidth,i=this._spread;i.setTabStripRatio(i._getActualTabStripRatio()+h/f,!0),r=this._resizeBarWidth/f,u=1,i._getActualTabStripRatio()<r?(i.setTabStripRatio(r,!0),this.activeX=this._resizeBarWidth):i._getActualTabStripRatio()<u?this.activeX=n.pageX:(i.setTabStripRatio(u,!0),this.activeX=f)}else{this._hove
rNavButton=-1,this._hoverTab=-1;var e=$(this._getCanvas()).offset(),l=n.pageX-e.left,c=n.pageY-e.top,t=this._hitTest(l,c);if(t.element==="")return this.canvas.style.cursor=s,this.repaint(),!1;else t.element===g?this.canvas.style.cursor=o:(this.canvas.style.cursor=s,t.element===nt?this._hoverNavButton=t.index:t.element===p?this._hoverTab=t.index:t.element===it&&(this._hoverTab=-2));this.repaint()}return!1},f.prototype.doMouseUp=function(n){if(this.resizeTab){this.resizeTab=!1;var t=$(this._spread._hs);t.wijspreadpanelex&&t.wijspreadpanelex(s),this._spread._doTabHSResize()}return this._repeatDown&&(window.clearTimeout(this._repeatDown),this._repeatDown=null),this.unhandleDocumentMouseMove(),this._isMouseDownInTab?(this._isMouseDownInTab=!1,!1):!0},f.prototype.doMouseOut=function(n){var i=this._hoverNavButton,t;return this._hoverNavButton=-1,t=this._hoverTab,this._hoverTab=-1,(this._hoverNavButton!==i||this._hoverTab!==t)&&this.repaint(),!1},f.
prototype.doMouseDbClick=function(i){var o,f,h;if(!this._spread._tabEditable)return!1;var l=$(this._getCanvas()).offset(),y=i.pageX-l.left,v=i.pageY-l.top,w=this._hitTest(y,v);if(w.element===p){o=window.gcGlobal.activeElement,o&&o.endEdit&&o.endEdit(),window.gcGlobal.activeElement=null,o._eventHandler&&o._eventHandler._destroyFocusHolder&&o._eventHandler._destroyFocusHolder();var c=this._activeIndex,s=this._spread.sheets[c],b=this._tabSizes[c],a=$(this._getCanvas()).offset();this._spread._trigger(n.spread.Events.SheetTabDoubleClick,{sheet:s,sheetName:s._name,sheetTabIndex:c}),f=u.createElement(oi),f.type="text",f.value=s._name,f.setAttribute("contentEditable","true"),f.setAttribute("autocomplete","off"),f.style.position="absolute",f.style.margin=e,f.style.padding=e,f.style.margin=e,f.style.left=a.left+this._activePos+this._tabLeftPadding+r,f.style.top=a.top+1+r,f.style.width=b-this._tabLeftPa
dding-this._tabRightPadding+2+r,f.style.backgroundColor=ft,f.style.borderWidth="0px",f.style.outline=si,u.body.insertBefore(f,null),this._tabNameEditor=f,h=this,$(f).addClass("sheetTabEditor"),$(f).bind(yi,function(n){if(n.keyCode===t.Key.enter)return h.endSheetTabEditing(s,!1),!1;else if(n.keyCode===t.Key.esc)return h.endSheetTabEditing(s,!0),!1}),$(f).bind(gt,function(n){f.selectionStart=0,f.selectionEnd=f.value.length}),$(f).bind(lt,function(n){h.endSheetTabEditing(s,!1)}),f.focus()}return!1},f.prototype._isValidSheetName=function(n){var r,t,i;if(n===undefined||n===null||n==="")return!1;for(r=this._spread.sheets.length,t=0;t<r;t++){i=this._spread.sheets[t];if(i!==this._spread.getActiveSheet())if(n===i._name)return!1}return!0},f.prototype.endSheetTabEditing=function(n,i){var r,u;this._tabNameEditor&&(r=this._tabNameEditor.value,i===!1&&r!==undefined&&r!==null&&r!==""&&this._isValidSheetName(r)&&
amp;(u=new t.UndoRedo.SheetRenameUndoAction(n,r),n._doCommand(u)),$(this._tabNameEditor).unbind(yi),$(this._tabNameEditor).unbind(gt),$(this._tabNameEditor).unbind(lt),this._tabNameEditor.parentNode.removeChild(this._tabNameEditor),delete this._tabNameEditor)},f.prototype.handleDocumentMouseMove=function(){var t,n;this._isCapture||(t=this,$(u).bind(li,function(n){t.doMouseMove(n)}),$(u).bind(ci,function(n){t.doMouseUp(n)}),n=this._spread.getActiveSheet(),n&&(n._continueMouseUpBubble=!0),this._isCapture=!0)},f.prototype.unhandleDocumentMouseMove=function(){if(this._isCapture){this._isCapture=!1,$(u).unbind(li),$(u).unbind(ci);var n=this._spread.getActiveSheet();n&&delete n._continueMouseUpBubble}},f.prototype.repaint=function(t){var r=this._getCanvas();if(r){if(!r.getContext&&n.spread.util._isSilverlightCanvas())if(!r.getContext)return;r.getContext||typeof window.FlashCanvas===i||window.FlashCanvas.initElement(r),r.getContext&&this.paint(r.getContext(c
t),t)}},f.prototype.doResize=function(){var n=this._getCanvas();if(!n||!n.parentNode)return;if(n.parentNode.clientWidth===0||n.parentNode.clientHeight===0)return;n.style.display=si,n.width=Math.max(n.parentNode.clientWidth,0),n.height=Math.max(n.parentNode.clientHeight,0),n.style.display="",this._bounds.width=n.clientWidth,this._bounds.height=n.clientHeight,this.repaint()},f.prototype.paint=function(i,r){var f=this.getBounds(),o,a,y,e,v,h,s,c,l;if(r){if(r.x>=f.x+f.width)return;if(r.y>=f.y+f.height)return;if(r.x+r.width>f.width){r.width=f.width-r.x;if(r.width<=0)return}if(r.y+r.height>f.height){r.height=f.height-r.y;if(r.height<=0)return}if(r.width<=0||r.height<=0)return}a=n.spread.util._useDoubleBuffer();if(a){y=this,e=this.buffer,e&&e.width===f.width&&e.height===f.height||(this.buffer=e=u.createElement(at),e.width=f.width,e.height=f.height);if(!e.getContext)if(n.spread.util._isSilverlightCanvas()){if(!e.getContext)return}else if(typ
eof window.FlashCanvas!="undefined"){v=this._getCanvas(),window.FlashCanvas.initElement(v);if(!e.getContext)return}}o=a?this.buffer.getContext(ct):i,o.clearRect(0,0,f.width,f.height),o.translate(-f.x,-f.y),this.paintTabs(o,r),o.translate(f.x,f.y);if(a){h=f.x>=0?0:-f.x,s=f.y>=0?0:-f.y,r&&(h=f.x+r.x,s=f.y+r.y,f=new t.Rect(f.x+r.x,f.y+r.y,r.width,r.height)),o=this.buffer.getContext(ct),c=null;try{r?c=o.getImageData(r.x,r.y,r.width,r.height):(l=this._getCanvas(),c=l?o.getImageData(h,s,Math.min(f.width-h,Math.max(l.width-f.x,3)),Math.min(f.height-s,Math.max(l.height-f.y,3))):o.getImageData(h,s,Math.max(f.width-h,0),Math.max(f.height-s,0)))}catch(p){return}h=f.x>=0?f.x:0,s=f.y>=0?f.y:0,c&&f.width>0&&f.height>0&&i.putImageData(c,h,s)}},f.prototype._getCanvas=function(){var n=this.canvas;return n&&!n.getContext&&n.firstChild&&(n.getContext=n.firstChild.getContext),n},f.prototype.paintTabs=function(n,i){var r
,s,y,e,h,v,a,l,w,p,c,k,b;if(!n||!this._spread)return;for(r=this.getBounds(),n.save(),n.font=this._font,n.rect(r.x,r.y,r.width,r.height),n.clip(),n.beginPath(),s=null,this._spread.useWijmoTheme?(s=n.createLinearGradient(r.x,r.y,r.width,r.height),y=window.gcGlobal.getWijmoThemeStyle(t.VisualState.Normal),s.addColorStop(0,"#DDDDDD"),s.addColorStop(1,y.backgroundColor)):(s=n.createLinearGradient(r.x+.7*r.height,r.y+0,.7*r.height,r.height),s.addColorStop(0,"#7FA1D1"),s.addColorStop(.3,"#A1BADD"),s.addColorStop(1,"#9AB5DB")),n.fillStyle=s,n.fillRect(r.x,r.y,r.width,r.height),h=60,v=this._tabStartPos,this._tabSizes=[],e=0;e<this._spread.sheets.length;e++)h=n.measureText(this._spread.sheets[e]._name).width+this._tabRightPadding+this._tabLeftPadding,this._tabSizes.push(h);a=[],this._firstTab>0&&(v+=this._firstTabSpace);if(this._firstTab>=0)for(e=this._firstTab;e<this._spread.sheets.length;e++)h=this._tabSizes[e],a.push({i:e,x:v,w:h,
t:this._spread.sheets[e]._name}),v+=h+this._tabSpace;this._spread._newTabVisible&&(this._newTabSize=n.measureText(t._StringResource.NewTab).width+this._tabLeftPadding,this.drawTab(n,v,0,this._newTabSize,r.height,5,!1,this._hoverTab===-2,t._StringResource.NewTab)),this._activeIndex=this._spread.getActiveSheetIndex();if(this._spread.sheets.length>0){for(e=a.length-1;e>=0;e--)l=a[e],l.i!==this._activeIndex&&this.drawTab(n,l.x,0,l.w,r.height,5,!1,l.i===this._hoverTab,l.t);this._firstTab>0&&(w=this._firstTab-1,h=this._tabSizes[w],this.drawTab(n,this._tabStartPos+this._firstTabSpace-h-this._tabSpace,0,h,r.height,5,this._activeIndex===w,this._hoverTab===w,"")),this._activeIndex>=this._firstTab&&this._activeIndex<this._spread.sheets.length&&(p=a[this._activeIndex-this._firstTab],this.drawTab(n,p.x,0,p.w,r.height,5,!0,!1,p.t))}n.fillStyle=yt,n.fillRect(r.x,r.y,this._tabStartPos-1,r.height);var u=5,f=9,o=9;this.drawNavButton(n,f
,o,f+u,o+u,f+u,o-u,!0,f-u,this._hoverNavButton===0),f+=this._navButtonSize,this.drawNavButton(n,f,o,f+u,o+u,f+u,o-u,!0,null,this._hoverNavButton===1),f+=this._navButtonSize,this.drawNavButton(n,f,o,f-u,o+u,f-u,o-u,!1,null,this._hoverNavButton===2),f+=this._navButtonSize,this.drawNavButton(n,f,o,f-u,o+u,f-u,o-u,!1,f+4,this._hoverNavButton===3),this._spread.useWijmoTheme?(k=window.gcGlobal.getWijmoThemeStyle,b=k(t.VisualState.Hover),y=k(t.VisualState.Normal),this._spread.showHorizontalScrollbar()&&(c=this._resizeBarWidth,n.fillStyle=y.backgroundColor,n.fillRect(r.x+r.width-c,r.y,c,r.height),n.fillStyle=b.backgroundColor,n.fillRect(r.x+r.width-7,r.y+1,6,r.height-2),n.fillStyle=b.color,n.fillRect(r.x+r.width-5,r.y+4,2,r.height-8))):this._spread.showHorizontalScrollbar()&&(c=this._resizeBarWidth,n.fillStyle=vt,n.fillRect(r.x+r.width-c,r.y,c,r.height),n.fillStyle="#D7E6F7",n.fillRect(r.x+r.width-7,r.y+1,6,r.height-2),n.fillStyle=ft,n.fillRect(r.x+r.width-5,r.y+4,
4,r.height-8),n.fillStyle=vt,n.fillRect(r.x+r.width-5,r.y+4,1,r.height-8)),n.beginPath(),n.restore()},f.prototype.drawNavButton=function(n,i,r,u,f,e,o,s,h,c){var p,a;n.save();var w=null,v=null,l=this.getBounds();this._spread.useWijmoTheme?(p=window.gcGlobal.getWijmoThemeStyle,w=p(t.VisualState.Hover),v=p(t.VisualState.Normal),c?(n.fillStyle=w.backgroundColor,n.fillRect(i-7,l.y+2,14,l.height-4)):(n.fillStyle=v.backgroundColor,n.fillRect(i-9,l.y+1,this._navButtonSize,l.height-2))):c?(n.fillStyle="orange",n.fillRect(i-8,l.y+1,16,l.height-2),n.fillStyle="lightyellow",n.fillRect(i-7,l.y+2,14,l.height-4)):(a=n.createLinearGradient(l.x+.7*l.height,l.y+0,.7*l.height,l.height),a.addColorStop(0,y),a.addColorStop(.1,bt),a.addColorStop(.45,kt),a.addColorStop(.45,dt),a.addColorStop(.9,wt),a.addColorStop(1,y),n.fillStyle=a,n.fillRect(i-9,l.y+1,this._navButtonSize,l.height-2)),n.fillStyle=this._spread.useWijmoTheme?c?w.color:v.color:pt,h!==undefined&&h!==null&&n
.fillRect(h,Math.min(f,o),1,Math.max(f,o)-Math.min(f,o)),s?(i-=2,u-=2,e-=2):(i+=2,u+=2,e+=2),n.beginPath(),n.moveTo(i,r),n.lineTo(u,f),n.lineTo(e,o),n.lineTo(i,r),n.fill(),n.restore()},f.prototype.drawTab=function(n,i,r,u,f,e,o,s,h){var a,d,g,nt,l,b,k,it,tt;n.save(),n.beginPath(),n.moveTo(i,r),n.lineTo(i,r+f-e),n.arcTo(i,r+f,i+u,r+f,e),n.lineTo(i+u,r+f),n.lineTo(i+u+f,r),o||n.lineTo(i,r);var w=null,p=this.getBounds(),c=n.createLinearGradient(p.x+.7*p.height,p.y+0,.7*p.height,p.height),v=this._spread.getSheetFromName(h);h===""&&this._firstTab>0&&(v=this._spread.getSheet(this._firstTab-1)),a=!1,this._spread.useWijmoTheme?(g=t.VisualState.Normal,(o||s)&&(g=t.VisualState.Hover),w=window.gcGlobal.getWijmoThemeStyle(g),c.addColorStop(0,w.backgroundColor),a=!0):v&&v._sheetTabColor&&(nt="rgba(0, 0, 0, 0)",n.fillStyle=nt,n.fillStyle=new t._ThemeContext(v).getColor(v._sheetTabColor),l=n.fillStyle,l===nt?a=!1:(s||o?(c.addColorStop(
0,y),c.addColorStop(.45,"#F1F6FD"),c.addColorStop(.9,l),c.addColorStop(1,y)):(c=l,d=l),a=!0)),a||(s||o?(c.addColorStop(0,y),c.addColorStop(.6,"#F1F6FD"),c.addColorStop(.9,"#BCD5F6"),c.addColorStop(1,y)):(c.addColorStop(0,bt),c.addColorStop(.45,kt),c.addColorStop(.6,dt),c.addColorStop(1,wt))),n.fillStyle=c,n.fill(),n.strokeStyle=yt,n.stroke(),n.textBaseline=hi,this._spread.useWijmoTheme&&w?n.fillStyle=w.color:(b=pt,d&&(k=t._Color.parse(d),k&&k.getBrightness()<255/2&&(b=ft)),n.fillStyle=b),it=this._tabLeftPadding,tt=1,n.fillText(h,i+it,r+tt),n.restore()},f}()})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(t){var f,i;t.feature("core.spread_ui",["core.migrate","core.common","core.spread"]);var o="string",r="boolean",e="number",u=jQuery,s=function(){function n(){this.sheetCount=1,this.name="",this
.font="10pt Arial",this.allowUserZoom=!0,this.allowUserResize=!0,this.tabStripVisible=!0,this.tabEditable=!0,this.newTabVisible=!0,this.useWijmoTheme=!1,this.tabStripRatio=.5,this.activeSheetIndex=0,this.sheets=[]}return n}();t.WijspreadOptions=s,f=new s,u.widget("wijmo.wijspread",{_init:function(){var s=this.element.context,i,n,f,l,h,c;if(s){i=new t.Spread(s.id,this.options.sheetCount),this.element.data("spread",i),s.setAttribute("gcUIElement","gcSpread"),t.Global.prototype._createDummyObjects(),n=this.options,typeof n.name===o&&n.name.length>0&&(i.name=n.name),typeof n.font===o&&n.font.length>0&&(i._font=n.font),typeof n.allowUserZoom===r&&(i._allowUserZoom=n.allowUserZoom),typeof n.allowUserResize===r&&(i._allowUserResize=n.allowUserResize),typeof n.tabStripVisible===r&&(i._tabStripVisible=n.tabStripVisible),typeof n.tabEditable===r&&(i._tabEditable=n.tabEditabl
e),typeof n.newTabVisible===r&&(i._newTabVisible=n.newTabVisible),typeof n.useWijmoTheme===r&&(i.useWijmoTheme=n.useWijmoTheme),typeof n.tabStripRatio===e&&(i._tabStripRatio=n.tabStripRatio),typeof n.activeSheetIndex===e&&(i._activeSheetIndex=n.activeSheetIndex),!t.util._isStandardCanvas()&&t.util._isSilverlightCanvas()?(f=document.createElement("canvas"),f.setAttribute("width",""+s.clientWidth),f.setAttribute("height",""+s.clientHeight),s.appendChild(f),i.canvas=f,f.setAttribute("renderMethod","auto"),f.setAttribute("gcSpreadsheet","true"),f.setAttribute("onload",'$("#'+s.id+'").wijspread("initPaint");'),u(window).bind("resize.gcSpread",t.util.createEventHandler(i,i._doResize))):i._setHost(s);if(n.sheets&&n.sheets.length>0){if(i.getSheetCount()<n.sheets.length){h=i.getSheetCount();while(h<n.sheets.
length)l=i._createSheet(i._getDefaultSheetName(h)),i.addSheet(h,l),h=i.getSheetCount()}for(c=0;c<n.sheets.length;c++)l=i.getSheet(c),l.applyOptions(n.sheets[c])}t.util._isStandardCanvas()?(i.invalidateLayout(),i.repaint()):t.util._isSilverlightCanvas()&&window.slcanvas&&window.slcanvas.autoLoad&&window.slcanvas.autoLoad()}},initPaint:function(){var u=t.util._isStandardCanvas(),n,i,r;if(u)return;n=this,n._initPaintTimeout!==undefined&&n._initPaintTimeout!==null&&window.clearTimeout(n._initPaintTimeout),i=n.spread().canvas.firstChild,i&&i.loaded?(r=i.Content.SpreadsheetObject,n.spread().attachSpreadsheetObject(r)):n._initPaintTimeout=window.setTimeout(function(){n.initPaint.call(n)},10)},spread:function(){return this.element.data("spread")},destroy:function(){u(window).unbind("resize.gcSpread"),this.spread()._dispose()},refresh:function(){var n=this.spread();n._doResize(),n.repaint()},repaint:function(){this.spread
().repaint()},options:f}),u.wijmo.wijspread=n.spread,i=window.ko,i&&(i.wijmo=i.wijmo||{},i.wijmo.wijspreadBinding={init:function(n,t,i,r){u("#"+n.id).wijspread(t())},update:function(n,t,i,r){}},i.bindingHandlers.wijspread=i.wijmo.wijspreadBinding)})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype,n.prototype=new r},wijmo;(function(n){(function(t){(function(i){function ft(n,t,i,r,u){(i===undefined||i===null)&&(i=0);if(!u&&t instanceof a)return n.call(t);else if(t instanceof w)return n.call(t,i);return r}function gt(n,t){return(n===undefined||n===null)&&(t===undefined||t===null)?!0:(n===undefined||n===null)&&t!==undefined&&t!==null||n!==undefined&&n!==null&&(t===undefined||t===null)?!1:n.toLowerCase()===t.toLowerCase()}function yu(n,t){var i={row
:this.row,column:this.column,rowCount:1,columnCount:1};return this.rowRelative&&(i.row+=n,i.row=i.row>=p.maxRowCount?i.row%p.maxRowCount:i.row),this.columnRelative&&(i.column+=t,i.column=i.column>=p.maxColumnCount?i.column%p.maxColumnCount:i.column),i}function hr(n,t){var f={row:-1,column:-1,rowCount:-1,columnCount:-1},e,u,i,r;return this.isFullRow?(f.column=-1,f.columnCount=-1):(this.startColumnRelative?(i=this.startColumn+t,i=i>=p.maxColumnCount?i%p.maxColumnCount:i):i=this.startColumn,this.endColumnRelative?(r=this.endColumn+t,r=r>=p.maxColumnCount?r%p.maxColumnCount:r):r=this.endColumn,f.column=i<=r?i:r,f.columnCount=Math.abs(r-i)+1),this.isFullColumn?(f.row=-1,f.rowCount=-1):(this.startRowRelative?(e=this.startRow+n,e=e>=p.maxRowCount?e%p.maxRowCount:e):e=this.startRow,this.endRowRelative?(u=this.endRow+n,u=u>=p.maxRowCount?u%p.maxRowCount:u):u=this.endRow,f.row=e<=u?e:u,f.rowCount=Math.abs(u-e)+1),f}function ht(n){return n<=255}functi
on or(n){return n<=127}function sr(n){var t=n.charCodeAt(0);return ht(t)?t>=48&&t<=57:!1}function ui(n){var t=n.charCodeAt(0);return ht(t)?or(t)?(t|=32,t>=96&&t<=122):k[t]===d.UppercaseLetter||k[t]===d.LowercaseLetter:!1}function di(n){var t=n.charCodeAt(0);return ht(t)?or(t)?t<=57?t>=48:(t|=32,t>=96&&t<=122):k[t]===d.UppercaseLetter||k[t]===d.LowercaseLetter:!1}function vu(n){var t=n.charCodeAt(0);return ht(t)?k[t]===d.MathSymbol||k[t]===d.CurrencySymbol||k[t]===d.ModifierSymbol||k[t]===d.OtherSymbol:!1}function lt(n){var t=n.charCodeAt(0);return ht(t)?or(t)?t>=48&&t<=57:k[t]===d.DecimalDigitNumber||k[t]===d.OtherNumber:!1}function du(n,t,i){for(var e=n.length,r=c.None,u,f=t;f<e;f++){u=n.charAt(f);if(sr(u))r===c.None?r=c.Int:r===c.Dot?r=c.Decimal:r===c.Sign?r=c.Int:(r===c.Exponent||r===c.SignExponent)&&(r=c.ScientificNotation);else if(u===i)if(r===c.Int)r=c.Decimal;else if(r===c.None||r===c.Sign)r=c.Dot;els
e return{result:!1};else if(u==="+"||u==="-")if(r===c.None)r=c.Sign;else if(r===c.Exponent)r=c.SignExponent;else return{result:!0,endIndex:f-1};else if(u==="E"||u==="e")if(r===c.Int||r===c.Decimal)r=c.Exponent;else return{result:!1};else if(r===c.Int||r===c.Decimal||r===c.ScientificNotation)return{result:!0,endIndex:f-1}}return r===c.Int||r===c.Decimal||r===c.ScientificNotation?{result:!0,endIndex:e-1}:{result:!1}}function ai(n,i,r,u){for(var h=n.length,s=r===u?0:1,o="",e,f=i+1;f<h;f++){e=n.charAt(f),e===r&&s++;if(e===u){s--;if(r===u&&f+2<h&&n.charAt(f+1)===r)o+=r,f++;else if(s!==0)o+=e;else return{result:o,endIndex:f}}else o+=e}throw t._StringResource.Exp_NoSyntax+u+t._StringResource.Exp_MatchSyntax+r+t._StringResource.SingleQuotesFullStop;}function cu(n,i){for(var e=n.length,o=e-i,r,f,u=0;u<dt.length;u++){r=dt[u];if(i+r.length>e)continue;f=n.slice(i,i+r.length);if(r.length<=o&&(r===f||
r===f.toUpperCase()))return{result:r,endIndex:i+r.length-1}}throw t._StringResource.SingleQuote+n.slice(i)+t._StringResource.Exp_IsValid;}function at(n){return n==="^"||n===":"?1:n==="*"||n==="/"||n===" "?2:n==="+"||n==="-"||n===","?3:n==="&"?4:5}function hu(n){if(n.subType===f.RangeOp)return l.range;else if(n.subType===f.Union)return l.union;else if(n.subType===f.Intersection)return l.intersection;var t=n.value;if(t==="^")return l.exponent;else if(t==="*")return l.multiply;else if(t==="/")return l.divide;else if(t==="+")return l.add;else if(t==="-")return l.subtract;else if(t==="&")return l.concatenate;else if(t==="<")return l.lessThan;else if(t==="=")return l.equal;else if(t===">")return l.greaterThan;else if(t===">=")return l.greaterThanOrEqual;else if(t==="<=")re
turn l.lessThanOrEqual;else if(t==="<>")return l.notEqual;else if(t===":"||t==="!")return l.range;else if(t===" "||t===",")return l.intersection;return l.add}function bi(n,t,i){return n&&n.hasOwnProperty(t)?n[t]:i}function su(n,t){var i=t+1;return n<0?n%i+i:n>t?n%i:n}function it(n,t,i){n.hasOwnProperty(t)&&n[t]||(n[t]=[]),n[t].push(i)}function rt(n,t,i){var u=n[t],r;if(u)for(r=0;r<u.length;r++)if(u[r]===i){u.splice(r,1);return}}function yt(n,t,i){$(t).each(function(t,r){n[r]&&$(n[r]).each(function(n,t){t[i]()})})}function ef(n,t,i,r,u){return(n.row===-1||t===-1||n.row<t+r&&t<n.row+n.rowCount)&&(n.column===-1||i===-1||n.column<i+u&&i<n.column+n.columnCount)}function rf(n,t,i){return(n.row===-1||n.row<=t&&t<n.row+n.rowCount)&&(n.column===-1||n.column<=i&&i<n.column+n.columnCount)}function bu(n,t){if(t.action===oi)return ef(n,t
.row,t.column,t.rowCount,t.columnCount);else if(t.action===fi)return rf(n,t.row,t.column);return!1}function ci(n,t,i,r){$(t).each(function(t,u){n[u]&&$(n[u]).each(function(n,t){bu(t,i)&&t.listener[r]()})})}function ff(n,t){for(var i=0;i<t.length;i++)if(n.hasOwnProperty(t[i])&&n[t[i]].length>0)return!0;return!1}function dr(n,t){var r=Math.max(n.row,t.row),i=Math.max(n.column,t.column),f=Math.min(n.row+n.rowCount,t.row+t.rowCount),u=Math.min(n.column+n.columnCount,t.column+t.columnCount);return r>=f||i>=u?null:{row:r,column:i,rowCount:f-r,columnCount:u-i,intersectWith:dr}}function gu(n,t,i,r){return n===-1&&r>127||t===-1&&i>127||i*r>127}var h,a,bt,pu,rr,ir,au,w,hi,ut,nr,fu,lu,eu,ct,b,gi,l,ni,e,vt,p,si,ou,vi,oi,fi,pi,ii,ar,uu;t.feature("calc.common",["core.migrate","core.stringResource","core.common","core.globalize"]);var et="undefined",er="number",y="
;string",ri="boolean",kt="TRUE",pt="FALSE",wt="ARRAY",st="ARRAYROW",kr="#NULL!",ru="#DIV/0!",pr="#VALUE!",ur="#REF!",yr="#NAME?",vr="#N/A",cr="#NUM!",dt=[kr,ru,pr,ur,yr,vr,cr],tf=[0,7,15,23,29,42,36],li=[1,26,676];i.missingArgument={},h=function(){function n(n,t){this._error=n,this._code=t}return n.prototype.toString=function(){return this._error},n.parse=function(t){var i=n._parseCore(t);if(i===undefined)throw"Incorrect error!";return i},n._parseCore=function(t){var i,r;if(typeof t!="undefined"&&t!==null&&t!=="")for(i=0;i<dt.length;i++){r=dt[i];if(r===t||r===t.toUpperCase())return new n(r,tf[i])}return undefined},n}(),i.CalcError=h,i.Error=h;var uf=new h(kr,0),ei=new h(ru,7),v=new h(pr,15),o=new h(ur,23),ot=new h(yr,29),fr=new h(vr,42),tr=new h(cr,36),hf=function(){function n(){}return n.Null=uf,n.DivideByZero=
ei,n.Value=v,n.Reference=o,n.Name=ot,n.NotAvailable=fr,n.Number=tr,n}();i.Errors=hf,a=function(){function n(){}return n.prototype.getRowCount=function(){return 1},n.prototype.getColumnCount=function(){return 1},n.prototype.length=function(){return this.getRowCount()*this.getColumnCount()},n.prototype.getValueByIndex=function(n){var t=this.getColumnCount(),r=parseInt(n/t,10),i=n%t;return this.getValue(r,i)},n.prototype.getValue=function(n,t){return null},n}(),i.CalcArray=a,i.Array=a,bt=function(n){function t(t,i){n.call(this),this._array=t,this._rowCount=t.length;if(arguments.length<2){i=0;for(var r=0;r<t.length;r++)i=Math.max(t[r].length,i)}this._columnCount=i}return __extends(t,n),t.prototype.getRowCount=function(){return this._rowCount},t.prototype.getColumnCount=function(){return this._columnCount},t.prototype.getValue=function(n,t){return this._array[n][t]},t}(a),i._ConcreteArray=bt,pu=function(n){function t(t,i,r,u,f){n.call(this),this._array=t,this._row=i,this._column=r,
this._rowCount=u,this._columnCount=f}return __extends(t,n),t.prototype.getRowCount=function(){return this._rowCount},t.prototype.getColumnCount=function(){return this._columnCount},t.prototype.getValue=function(n,t){return gi.getValue(this._array,this._row+n,this._column+t)},t}(a),i._SliceArray=pu,rr=function(n){function t(t){n.call(this),this._value=t}return __extends(t,n),t.prototype.getRowCount=function(){return this._value.getRowCount(0)},t.prototype.getColumnCount=function(){return this._value.getColumnCount(0)},t.prototype.getValue=function(n,t){return this._value.getValue(0,n,t)},t}(a),i._ArrayWrappingRange=rr,ir=function(n){function t(t){n.call(this),this._value=t}return __extends(t,n),t.prototype.getRowCount=function(){return 1},t.prototype.getColumnCount=function(){return 1},t.prototype.getValue=function(n,t){return this._value},t}(a),i._ArrayWrappingScalar=ir,au=function(n){function t(t){n.call(this),this._value=t}return __extends(t,n),t.prototype.getRowCount=function(){r
eturn this._value.length},t.prototype.getColumnCount=function(){return 1},t.prototype.getValue=function(n,t){return this._value[n]},t}(a),i._OneDimensionalArray=au,w=function(){function n(){}return n.prototype.getRangeCount=function(){return 1},n.prototype.getRow=function(n){return 0},n.prototype.getColumn=function(n){return 0},n.prototype.getRowCount=function(n){return 0},n.prototype.getColumnCount=function(n){return 0},n.prototype.getValue=function(n,t,i){return null},n.prototype.isSubtotal=function(n,t,i){return!1},n.prototype.getSource=function(){return null},n}(),i.Reference=w,hi=function(n){function i(i){var f,e,u,r;n.call(this);if(!i||i.length===0)throw t._StringResource.Exp_InvalidArgument;for(f=null,e=0;e<i.length;e++){u=i[e];if(f){if(u.getRangeCount()!==f.getRangeCount())throw t._StringResource.Exp_InvalidArgument;for(r=0;r<u.getRangeCount();r++)if(u.getColumn(r)!==f.getColumn(r)||u.getColumnCount(r)!==f.getColumnCount(r)||u.getRow(r)!==f.getRow(r)||u.getRowCount(r)!
==f.getRowCount(r))throw t._StringResource.Exp_InvalidArgument;}else f=u}this._references=i.slice(0)}return __extends(i,n),i.prototype.getSheetCount=function(){return this._references.length},i.prototype.getRangeCount=function(){return this._references[0].getRangeCount()},i.prototype.getRow=function(n){return this._references[0].getRow(n)},i.prototype.getColumn=function(n){return this._references[0].getColumn(n)},i.prototype.getRowCount=function(n){return this._references[0].getRowCount(n)},i.prototype.getColumnCount=function(n){return this._references[0].getColumnCount(n)},i.prototype.getValue=function(n,t,i){return null},i.prototype.isSubtotal=function(n,t,i){return!1},i.prototype.getSource=function(){return null},i}(w),i._SheetRangeReference=hi,function(n){n.getSource=function(n){return this._references[n].getSource()},n.getValue=function(n,t,i,r){return(typeof n=="undefined"||n===null)&&(n=0),this._references[n].getValue(t,i,r)},n.isSubtotal=function(n,t,i,r){r
eturn(typeof n=="undefined"||n===null)&&(n=0),this._references[n].isSubtotal(t,i,r)}}(hi.prototype),ut=function(n){function t(t,i){n.call(this),this._source=t,this._ranges=i}return __extends(t,n),t.prototype.getRangeCount=function(){return this._ranges.length},t.prototype.getRow=function(n){return this._ranges[n].row},t.prototype.getColumn=function(n){return this._ranges[n].col},t.prototype.getRowCount=function(n){return this._ranges[n].rowCount},t.prototype.getColumnCount=function(n){return this._ranges[n].colCount},t.prototype.getValue=function(n,t,i){return this.getActualValue(n,t,i)},t.prototype.getActualValue=function(n,t,i){var r=this._source;return r.getValue(n,this.getRow(n)-r.getRow(n)+t,this.getColumn(n)-r.getColumn(n)+i)},t.prototype.isSubtotal=function(n,t,i){var r=this._source;return r.isSubtotal(n,this.getRow(n)-r.getRow(n)+t,this.getColumn(n)-r.getColumn(n)+i)},t.prototype.getSource=function(){return this._source},t}(w),i._ConcreteReference=ut,nr=fun
ction(n){function t(t){n.call(this),this._sheet=t}return __extends(t,n),t.prototype.getRangeCount=function(){return 1},t.prototype.getRow=function(n){return 0},t.prototype.getColumn=function(n){return 0},t.prototype.getRowCount=function(n){return this._sheet.getRowCount()},t.prototype.getColumnCount=function(n){return this._sheet.getColumnCount()},t.prototype.getValue=function(n,t,i){return t>=0||i>=0?this._sheet.getValue(t,i):o},t.prototype.isSubtotal=function(n,t,i){var f=this._sheet,u;return n===0&&t<f.getRowCount()&&i<f.getColumnCount()?(u=f.getExpression(t,i),u&&u instanceof r.FunctionExpression&&u.getFunctionName().toUpperCase()==="SUBTOTAL"):!1},t.prototype.getSource=function(){return new t(this._sheet)},t}(w),i._SheetReference=nr,fu=function(n){function i(i,r,u,f,e,o,s,h){n.call(this,i,[new t.Range(r,u,f,e)]),this.Action=o,this.Operand1=s,this.Operand2=h}return __extends(i,n),i.prototype.getValue=function(n,t,i){return th
is.Action(this.getActualValue(n,t,i),this.Operand1,this.Operand2)},i}(ut),i._TernaryCompositeConcreteReference=fu,lu=function(n){function i(i,r,u,f,e,o){n.call(this,i,[new t.Range(r,u,f,e)]),this.Action=o}return __extends(i,n),i.prototype.getValue=function(n,t,i){return this.Action(this.getActualValue(n,t,i))},i}(ut),i._UnaryCompositeConcreteReference=lu,eu=function(n){function i(i,r,u,f,e,o,s,h){n.call(this,i,[new t.Range(r,u,f,e)]),this.Action=o,this.Operand1=s,this.SwitchOrder=h}return __extends(i,n),i.prototype.getValue=function(n,t,i){var r=this.getActualValue(n,t,i);return this.SwitchOrder?this.Action(this.Operand1,r):this.Action(r,this.Operand1)},i}(ut),i._BinaryCompositeConcreteReference=eu,ct=function(){function i(){}return i.isNumber=function(n){return typeof n===er||!isNaN(n)&&!isNaN(parseFloat(n))||n instanceof Date},i.isError=function(n){return n instanceof h},i._isCalcArray=function(n){return n instanceof a},i._isCalcReference=function(n){return n instanceof w}
,i.toResult=function(n){return isNaN(n)||!isFinite(n)?tr:n},i._toArray=function(n){if(n instanceof a)return n;else if(n instanceof w){if(n.getRangeCount()===1)return new rr(n)}else return new ir(n)},i._isNaNOrInfinite=function(n){return isNaN(n)||!isFinite(n)},i.toInt=function(n){var r=i.toDouble(n);if(Math.abs(r)<1e21)return parseInt(r,10);throw t._StringResource.Exp_InvalidCast;},i.toDouble=function(n){var r={value:0};if(i.tryToDouble(n,r))return r.value;throw t._StringResource.Exp_InvalidCast;},i.tryToDouble=function(t,r){var u=null,e,f;if(typeof t===et||t===null)return r.value=0,!0;e=typeof t;try{if(e===er){u=new Number(t).valueOf();if(i._isNaNOrInfinite(u))return!1}else if(e===y){f=n.spread._DateTimeHelper.parseLocale(t);if(typeof f!==et&&f!==null)u=new n.spread._DateTimeHelper(f).toOADate();else{u=new Number(t).valueOf();if(i._isNaNOrInfinite(u))return!1}}else if(e===ri)u=t?1:0;else if(t instanceof Date)u=new n.spread._DateTimeHelper(t).toOADate();else return!1}catc
h(o){return!1}return r.value=u,!0},i.toBool=function(n){if(typeof n===et||n===null)return!1;else if(typeof n===ri)return n;else if(n instanceof Date)return new t._DateTimeHelper(n).toOADate()!==0;else if(i.isNumber(n))return n!==0;else throw t._StringResource.Exp_InvalidCast;},i.toString=function(n){try{if(typeof n===et||n===null)return"";else if(typeof n===ri)return n?kt:pt;else if(typeof n===y)return n;else if(n instanceof Date)return new t._DateTimeHelper(n).localeFormat("M/d/yyyy h:mm:ss");else if(n instanceof a)throw t._StringResource.Exp_InvalidCast;else return n.toString()}catch(i){throw t._StringResource.Exp_InvalidCast;}},i.toDateTime=function(n){if(typeof n===et||n===null)return t._DateTimeHelper.fromOADate(0);else if(n instanceof Date)return new Date(n);else if(typeof n===y){var i=t._DateTimeHelper.parseLocale(n);typeof i!==et&&i!==null||isNaN(n)||(i=t._DateTimeHelper.fromOADate(parseFloat(n)));if(i===undefined||i===null)throw t._StringResource
.Exp_InvalidArgument;return i}else if(typeof n===er)return t._DateTimeHelper.fromOADate(n);else throw t._StringResource.Exp_InvalidCast;},i}(),i.Convert=ct,b=function(){function n(){}return n._argumentExists=function(n,t){return n&&t<n.length&&n[t]!==i.missingArgument},n.getArrayValue=function(n,t,i){return typeof n===et||n===null?v:t<n.getRowCount()&&i<n.getColumnCount()?n.getValue(t,i):i>=n.getColumnCount()&&n.getColumnCount()===1&&t<n.getRowCount()?n.getValue(t,0):t>=n.getRowCount()&&n.getColumnCount()===1&&i<n.getColumnCount()?n.getValue(0,i):v},n.tryExtractToSingleValue=function(n){if(n instanceof w){var t=ct._toArray(n);n=t.getRowCount()===1&&t.getColumnCount()===1?t.getValue(0,0):t}return n instanceof a&&n.getRowCount()===1&&n.getColumnCount()===1&&(n=n.getValue(0,0)),{value:n,success:!(n instanceof a)}},n}(),i._Helper=b,gi=function(){function n(){}return n.isArrayOrRe
ference=function(n){return n instanceof a||n instanceof w},n.getRangeCount=function(n){return n instanceof w?n.getRangeCount():1},n.getLength=function(n,t){return ft(function(){return arguments.length===0?n.getRowCount()*n.getColumnCount():n.getRowCount(arguments[0])*n.getColumnCount(arguments[0])},n,t,1)},n.getRowCount=function(n,t){return ft(n.getRowCount,n,t,1)},n.getColumnCount=function(n,t){return ft(n.getColumnCount,n,t,1)},n.getValueByIndex=function(n,t,i){return ft(function(){if(arguments.length===0)return n.getValueByIndex(t);var i=n.getColumnCount(arguments[0]);return n.getValue(arguments[0],parseInt(t/i,10),t%i)},n,i,n)},n.getValue=function(n,t,i,r){return ft(function(){return arguments.length===0?n.getValue(t,i):n.getValue(arguments[0],t,i)},n,r,n)},n.isSubtotalByIndex=function(n,t,i){return ft(function(){var i=n.getColumnCount(arguments[0]);return n.isSubtotal(arguments[0],t/i,t%i)},n,i,!1,!0)},n.isSubtotal=function(n,t,i,r){return ft(function(){return n.isSubtotal(argu
ments[0],t,i)},n,r,!1,!0)},n}(),i._ArrayHelper=gi,function(n){function u(n,t){return n===t?!0:Math.abs(n-t)<Math.abs(n)/281474976710656}var f=function(){function n(n){this.name=n}return n.prototype.getName=function(){return this.name},n.prototype.compareTo=function(n){return gt(this.name,n.name)},n.prototype.toString=function(){return this.getName()},n}(),r,t;n.Operator=f,r=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype._evaluateSingle=function(n,t){},t.prototype._evaluateImp=function(n,t){var r=null,e,u,f;n instanceof i.CalcArray&&(r=n),n instanceof i.Reference&&(r=i.Convert._toArray(n));if(r===undefined||r===null)return this._evaluateSingle(n,t);if(r.length()<1)return tr;for(e=[],u=0;u<r.getRowCount();u++)for(e[u]=[],f=0;f<r.getColumnCount();f++)e[u][f]=this._evaluateSingle(r.getValue(u,f),t);return new i._ConcreteArray(e,r.getColumnCount())},t.prototype.evaluate=function(n,t){return this._evaluateImp(n,t)},t}(f),n.UnaryOpera
tor=r,n.plus=new r("+"),n.plus._evaluateSingle=function(n,t){return n===undefined||n===null?0:i.Convert.toDouble(n)},n.negate=new r("-"),n.negate._evaluateSingle=function(n,t){return n===undefined||n===null?0:-i.Convert.toDouble(n)},n.percent=new r("%"),n.percent._evaluateSingle=function(n,t){return n===undefined||n===null?0:i.Convert.toDouble(n)/100},t=function(n){function t(t,i){n.call(this,t),this.acceptsReference=i}return __extends(t,n),t.prototype._evaluateSingle=function(n,t,i){},t.prototype.evaluate=function(n,t,r){var o=i._Helper.tryExtractToSingleValue(n),s=i._Helper.tryExtractToSingleValue(t),c,e,h;if(o.success&&s.success)return this._evaluateSingle(o.value,s.value);n=o.value,t=s.value;var y=o.success?-1:n.getRowCount(),v=o.success?-1:n.getColumnCount(),a=s.success?-1:t.getRowCount(),l=s.success?-1:t.getColumnCount(),f=-1,u=-1;for(o.success||(f=y,u=v),s.success||(f=f===-1?a:a>1?f>1?Math.min(a,f):a:f,u=u===-1?l:l>1?u>1?Math.
min(l,u):l:u),c=[],e=0;e<f;e++)for(c[e]=[],h=0;h<u;h++)c[e][h]=this._evaluateSingle(o.success?n:i._Helper.getArrayValue(n,e,h),s.success?t:i._Helper.getArrayValue(t,e,h));return new i._ConcreteArray(c,u)},t}(f),n.BinaryOperator=t,n.add=new t("+",!1),n.add._evaluateSingle=function(n,t,r){return i.Convert.isError(n)?n:i.Convert.isError(t)?t:((n===undefined||n===null)&&(n=0),(t===undefined||t===null)&&(t=0),i.Convert.toDouble(n)+i.Convert.toDouble(t))},n.subtract=new t("-",!1),n.subtract._evaluateSingle=function(n,t,r){return i.Convert.isError(n)?n:i.Convert.isError(t)?t:((n===undefined||n===null)&&(n=0),(t===undefined||t===null)&&(t=0),i.Convert.toDouble(n)-i.Convert.toDouble(t))},n.multiply=new t("*",!1),n.multiply._evaluateSingle=function(n,t,r){return i.Convert.isError(n)?n:i.Convert.isError(t)?t:((n===undefined||n===null)&&(n=0),(t===undefined||t===null)&&(t=0),i.Convert.toDouble(n)*i.Convert.toDou
ble(t))},n.divide=new t("/",!1),n.divide._evaluateSingle=function(n,t,r){if(t===undefined||t===null||t===""||t===0)return ei;if(i.Convert.isError(n))return n;if(i.Convert.isError(t))return t;return(n===undefined||n===null)&&(n=0),(t=i.Convert.toDouble(t))===0?ei:i.Convert.toDouble(n)/t},n.exponent=new t("^",!1),n.exponent._evaluateSingle=function(n,t,r){if(i.Convert.isError(n))return n;if(i.Convert.isError(t))return t;return(n===undefined||n===null)&&(n=0),(t===undefined||t===null)&&(t=0),n===0&&t<0?ei:Math.pow(i.Convert.toDouble(n),i.Convert.toDouble(t))},n.concatenate=new t("&",!1),n.concatenate._evaluateSingle=function(n,t,r){return i.Convert.isError(n)?n:i.Convert.isError(t)?t:((n===undefined||n===null)&&(n=""),(t===undefined||t===null)&&(t=""),n.toString()+t.toString())},n.equal=new t("=",!1),n.equal._evaluateSingle=function(n,t,r){if(i.Convert.isError(n)
)return n;if(i.Convert.isError(t))return t;(n===undefined||n===null)&&(n=typeof t===y?"":0),(t===undefined||t===null)&&(t=typeof n===y?"":0);if(typeof n===y||typeof t===y)return n.toString().toUpperCase()===t.toString().toUpperCase();else{var e=i.Convert.toDouble(n),f=i.Convert.toDouble(t);return u(e,f)}},n.notEqual=new t("<>",!1),n.notEqual._evaluateSingle=function(t,i,r){var u=n.equal._evaluateSingle.call(this,t,i,r);return typeof u===ri?!u:u},n.lessThan=new t("<",!1),n.lessThan._evaluateSingle=function(n,t,r){if(i.Convert.isError(n))return n;if(i.Convert.isError(t))return t;(n===undefined||n===null)&&(n=0),(t===undefined||t===null)&&(t=0);if(typeof n===y||typeof t===y)return n.toString().toUpperCase()<t.toString().toUpperCase();else{var e=i.Convert.toDouble(n),f=i.Convert.toDouble(t);return e<f&&!u(e,f)}},n.greaterThan=new t(">",!1),n.greaterThan._evaluateSingle=function(n,
t,r){if(i.Convert.isError(n))return n;if(i.Convert.isError(t))return t;(n===undefined||n===null)&&(n=0),(t===undefined||t===null)&&(t=0);if(typeof n===y||typeof t===y)return n.toString().toUpperCase()>t.toString().toUpperCase();else{var e=i.Convert.toDouble(n),f=i.Convert.toDouble(t);return e>f&&!u(e,f)}},n.lessThanOrEqual=new t("<=",!1),n.lessThanOrEqual._evaluateSingle=function(n,t,r){if(i.Convert.isError(n))return n;if(i.Convert.isError(t))return t;(n===undefined||n===null)&&(n=0),(t===undefined||t===null)&&(t=0);if(typeof n===y||typeof t===y)return n.toString().toUpperCase()<=t.toString().toUpperCase();else{var e=i.Convert.toDouble(n),f=i.Convert.toDouble(t);return e<f||u(e,f)}},n.greaterThanOrEqual=new t(">=",!1),n.greaterThanOrEqual._evaluateSingle=function(n,t,r){if(i.Convert.isError(n))return n;if(i.Convert.isError(t))return t;(n===undefined||n===null)&&(n=0),(t===undefined||t===null)&&
amp;(t=0);if(typeof n===y||typeof t===y)return n.toString().toUpperCase()>=t.toString().toUpperCase();else{var e=i.Convert.toDouble(n),f=i.Convert.toDouble(t);return e>f||u(e,f)}},n.range=new t(":",!0),n.range.evaluate=function(n,t,r){var u;if(n===undefined||n===null||t===undefined||t===null||n.getRangeCount()!==1||t.getRangeCount()!==1)return v;u=n.getSource();if(!u||u!==t.getSource())return v;var s=n.getRow(0),h=n.getColumn(0),c=t.getRow(0),f=t.getColumn(0),e=Math.min(s,c),o=Math.min(h,f),a=Math.max(s+n.getRowCount(0),c+t.getRowCount(0))-e,l=Math.max(h+n.getColumnCount(0),f+t.getColumnCount(0))-o;return new i._ConcreteReference(u,[{row:e,col:o,rowCount:a,colCount:l}])},n.union=new t(",",!0),n.union.evaluate=function(n,t,r){if(n===undefined||n===null||t===undefined||t===null||n.getRangeCount()!==1||t.getRangeCount()!==1)return v;for(var f=[],u=0,u=0;u<n.getRangeCount();u++)f.push({row:n.getRow(u),col:n.getColumn(u),rowCount:n.getRowCount(u),colCount:n.g
etColumnCount(u)});for(u=0;u<t.getRangeCount();u++)f.push({row:t.getRow(u),col:t.getColumn(u),rowCount:t.getRowCount(u),colCount:t.getColumnCount(u)});return new i._ConcreteReference(n.getSource(),f)},n.intersection=new t(" ",!0),n.intersection.evaluate=function(n,t,r){var u;if(n===undefined||n===null||t===undefined||t===null||n.getRangeCount()!==1||t.getRangeCount()!==1)return v;u=n.getSource();if(!u||u!==t.getSource())return v;var s=n.getRow(0),h=n.getColumn(0),c=t.getRow(0),f=t.getColumn(0),e=Math.max(s,c),o=Math.max(h,f),a=Math.min(s+n.getRowCount(0),c+t.getRowCount(0))-e,l=Math.min(h+n.getColumnCount(0),f+t.getColumnCount(0))-o;return new i._ConcreteReference(u,[{row:e,col:o,rowCount:a,colCount:l}])}}(i.Operators||(i.Operators={})),l=i.Operators,function(n){function r(i,r,u){var f,e;if(i===undefined||i===null)throw t._StringResource.Exp_InvalidFunctionName;i=i.toUpperCase();if(n.Functions._builtInFunctions.hasOwnProperty(i))throw t._StringResource.Exp_InvalidOverri
deFunction;if(n.Functions._customFunctions.hasOwnProperty(i)){f=n.Functions._customFunctions[i];if(f){if(!u||!u.override)throw t._StringResource.Exp_OverrideNotAllowed;}else n.Functions._customFunctions[i]=new n.Functions.Function(i,0,255),f=n.Functions[i.toUpperCase()]}else f=new n.Functions.Function(i,0,255),n.Functions._customFunctions[i]=f;r&&typeof r=="function"&&(f.evaluate=r);if(u)for(e in u)u.hasOwnProperty(e)&&e!=="override"&&(f[e]=u[e]);return f}function i(t){if(t===undefined||t===null)return null;return t=t.toUpperCase(),n.Functions._builtInFunctions&&n.Functions._builtInFunctions.hasOwnProperty(t)?n.Functions._builtInFunctions[t]:n.Functions._customFunctions.hasOwnProperty(t)?n.Functions._customFunctions[t]:null}var u=function(){function t(n,t,i){this._init(n,arguments.length<2?0:t,arguments.length<3?0:i)}return t.prototype._init=function(n,t,i){this.name=n,this.minArgs=t,this.maxArgs=i},t.prototype.accept
sArray=function(n){return!1},t.prototype.acceptsReference=function(n){return!1},t.prototype.acceptsError=function(n){return!1},t.prototype.acceptsMissingArgument=function(n){return!1},t.prototype.isVolatile=function(){return!1},t.prototype.isContextSensitive=function(){return!1},t.prototype.isBranch=function(){return!1},t.prototype.findTestArgument=function(){return-1},t.prototype.findBranchArgument=function(n){return-1},t.prototype.evaluate=function(n){},t.prototype.evaluateWithContext=function(n,t){return this.evaluate(n)},t.prototype.toString=function(){return this.name},t._create=function(t,i,r){var f=new n.Functions.Function(t,0,255),u;i&&typeof i=="function"&&(f.evaluate=i);if(r)for(u in r)r.hasOwnProperty(u)&&u!=="override"&&(f[u]=r[u]);return f},t}();n.Function=u,n._customFunctions={},n._builtInFunctions={},n.defineGlobalCustomFunction=r,n.findGlobalFunction=i,$.extend({ce:{createFunction:function(t,i,r){return n.Functions.
Function._create(t,i,r)},defineGlobalCustomFunction:function(t,i,r){return n.Functions.defineGlobalCustomFunction(t,i,r)},findGlobalFunction:function(t){return n.Functions.findGlobalFunction(t)}}})}(i.Functions||(i.Functions={})),ni=i.Functions,e={cell:0,row:1,column:2,sheet:3},function(n){var r=function(){function n(){}return n}(),rt,ut,h,ft,nt,t,tt,it,ht,f,ct,lt,et,ot,st,s,w,v,u,o,l,b,k,c,p,g,d,a;n.Expression=r,rt=function(n){function t(t){n.call(this),this.argument=t}return __extends(t,n),t}(r),n.ParenthesesExpression=rt,ut=function(n){function t(t,i){n.call(this),this.fn=t,this.args=i}return __extends(t,n),t.prototype.argCount=function(){return this.args?this.args.length:0},t.prototype.getArg=function(n){return this.args?this.args[n]:null},t.prototype.getFunctionName=function(){return typeof this.fn===y?this.fn:this.fn.name},t}(r),n.FunctionExpression=ut,h=function(n){function t(t){n.call(this),this.name=t}return __extends(t,n),t}(r),n.NameExpression=h,ft=function(n){function t(
t){n.call(this,t)}return __extends(t,n),t}(h),n.BangNameExpression=ft,nt=function(n){function t(t,i){n.call(this,i),this.source=t}return __extends(t,n),t}(h),n.ExternalNameExpression=nt,t=function(n){function t(t){n.call(this),this.value=t}return __extends(t,n),t}(r),n.ConstantExpression=t,tt=function(n){function t(t){n.call(this,t)}return __extends(t,n),t}(t),n.BooleanExpression=tt,it=function(n){function t(t,i){n.call(this,t),this.originalValue=i}return __extends(t,n),t}(t),n.DoubleExpression=it,ht=function(n){function t(t){n.call(this,t)}return __extends(t,n),t}(t),n.StringExpression=ht,f=function(n){function t(t){n.call(this,t)}return __extends(t,n),t}(t),n.ErrorExpression=f,ct=function(n){function t(t,i){n.call(this,i),this.source=t}return __extends(t,n),t}(f),n.ExternalErrorExpression=ct,lt=function(n){function t(t,i,r){n.call(this,r),this.startSource=t,this.endSource=i}return __extends(t,n),t}(f),n.SheetRangeErrorExpression=lt,et=function(n){function t(t){n.call(this,t)}retur
n __extends(t,n),t}(f),n.BangErrorExpression=et,ot=function(n){function t(t){n.call(this,new i._ConcreteArray(t))}return __extends(t,n),t}(t),n.ArrayExpression=ot,st=function(n){function t(){n.call(this,i.missingArgument)}return __extends(t,n),t}(t),n.MissingArgumentExpression=st,s=function(n){function t(t){n.call(this),this.operator=t}return __extends(t,n),t}(r),n.OperatorExpression=s,w=function(n){function t(t,i){n.call(this,t),this.operand=i}return __extends(t,n),t}(s),n.UnaryOperatorExpression=w,v=function(n){function t(t,i,r){n.call(this,t),this.left=i,this.right=r}return __extends(t,n),t}(s),n.BinaryOperatorExpression=v,u=function(n){function t(){n.call(this)}return __extends(t,n),t.prototype.getRange=function(n,t){return null},t}(r),n.ReferenceExpression=u,o=function(n){function t(t){n.call(this),this.source=t}return __extends(t,n),t}(u),n.ExternalReferenceExpression=o,l=function(n){function t(t,i,r,u){n.call(this),this.row=t,this.column=i,this.rowRelative=r,this.columnRelati
ve=u}return __extends(t,n),t.prototype.getRange=function(n,t){return yu.call(this,n,t)},t}(u),n.CellExpression=l,b=function(n){function t(t,i,r,u){n.call(this,t,i,r,u)}return __extends(t,n),t}(l),n.BangCellExpression=b,k=function(n){function t(t,i,r,u,f){n.call(this,t),this.row=i,this.column=r,this.rowRelative=u,this.columnRelative=f}return __extends(t,n),t.prototype.getRange=function(n,t){return yu.call(this,n,t)},t}(o),n.ExternalCellExpression=k,c=function(n){function t(t,i,r,u,f,e,o,s){n.call(this),arguments.length===0?this._initDefault():this.init(t,i,r,u,f,e,o,s)}return __extends(t,n),t.prototype._initDefault=function(){var n=i.Parser.BAND_INDEX_CONST;this.init(n,n,n,n,!1,!1,!1,!1),this.isFullRow=!0,this.isFullColumn=!0},t.prototype.init=function(n,t,i,r,u,f,e,o){n>i?(this.startRow=i,this.endRow=n,this.startRowRelative=e,this.endRowRelative=u):(this.startRow=n,this.endRow=i,this.startRowRelative=u,this.endRowRelative=e),t>r?(this.startColumn=r,this.endColumn=t,this.startC
olumnRelative=o,this.endColumnRelative=f):(this.startColumn=t,this.endColumn=r,this.startColumnRelative=f,this.endColumnRelative=o),this.isFullRow=!1,this.isFullColumn=!1},t.prototype.initBand=function(n,t,r,u,f){var o,e;n>t&&(o=n,n=t,t=o,e=r,r=u,u=e),f?(this.startRow=n,this.startColumn=i.Parser.BAND_INDEX_CONST,this.endRow=t,this.endColumn=i.Parser.BAND_INDEX_CONST,this.startRowRelative=r,this.startColumnRelative=!1,this.endRowRelative=u,this.endColumnRelative=!1,this.isFullRow=!0,this.isFullColumn=!1):(this.startRow=i.Parser.BAND_INDEX_CONST,this.startColumn=n,this.endRow=i.Parser.BAND_INDEX_CONST,this.endColumn=t,this.startRowRelative=!1,this.startColumnRelative=r,this.endRowRelative=!1,this.endColumnRelative=u,this.isFullRow=!1,this.isFullColumn=!0)},t.prototype._getRangeType=function(){return this.isFullRow&&this.isFullColumn?e.sheet:this.isFullRow?e.row:this.isFullColumn?e.column:e.cell},t.prototype.getRange=function(n,t){return hr.call(this,n,t)},t}(u),n.Ra
ngeExpression=c,p=function(n){function t(t,i,r,u,f,e,o,s){n.call(this,t,i,r,u,f,e,o,s)}return __extends(t,n),t}(c),n.BangRangeExpression=p,g=function(n){function t(t,i,r,u,f,e,o,s,h){n.call(this,null),arguments.length===1?this._initDefault(t):this.init(t,i,r,u,f,e,o,s,h)}return __extends(t,n),t.prototype._initDefault=function(n){var t=i.Parser.BAND_INDEX_CONST;this.init(n,t,t,t,t,!1,!1,!1,!1),this.isFullRow=!0,this.isFullColumn=!0},t.prototype.init=function(n,t,i,r,u,f,e,o,s){this.source=n,t>r?(this.startRow=r,this.endRow=t,this.startRowRelative=o,this.endRowRelative=f):(this.startRow=t,this.endRow=r,this.startRowRelative=f,this.endRowRelative=o),i>u?(this.startColumn=u,this.endColumn=i,this.startColumnRelative=s,this.endColumnRelative=e):(this.startColumn=i,this.endColumn=u,this.startColumnRelative=e,this.endColumnRelative=s)},t.prototype.initBand=function(n,t,r,u,f,e){var s,o;this.source=n,t>r&&(s=t,t=r,r=s,o=u,u=f,f=o),e?(this.startRow=t,this.startColumn=i.Parser
.BAND_INDEX_CONST,this.endRow=r,this.endColumn=i.Parser.BAND_INDEX_CONST,this.startRowRelative=u,this.startColumnRelative=!1,this.endRowRelative=f,this.endColumnRelative=!1,this.isFullRow=!0):(this.startRow=i.Parser.BAND_INDEX_CONST,this.startColumn=t,this.endRow=i.Parser.BAND_INDEX_CONST,this.endColumn=r,this.startRowRelative=!1,this.startColumnRelative=u,this.endRowRelative=!1,this.endColumnRelative=f,this.isFullColumn=!0)},t.prototype._getRangeType=function(){return this.isFullRow&&this.isFullColumn?e.sheet:this.isFullRow?e.row:this.isFullColumn?e.column:e.cell},t.prototype.getRange=function(n,t){return hr.call(this,n,t)},t}(o),n.ExternalRangeExpression=g,d=function(n){function t(t,i,r,u,f,e,o,s,h,c){n.call(this),this.init(t,i,r,u,f,e,o,s,h,c)}return __extends(t,n),t.prototype.init=function(n,t,i,r,u,f,e,o,s,h){this.startSource=n,this.endSource=t,i>u?(this.startRow=u,this.endRow=i,this.startRowRelative=s,this.endRowRelative=e):(this.startRow=i,this.endRow=u,this.startR
owRelative=e,this.endRowRelative=s),r>f?(this.startColumn=f,this.endColumn=r,this.startColumnRelative=h,this.endColumnRelative=o):(this.startColumn=r,this.endColumn=f,this.startColumnRelative=o,this.endColumnRelative=h)},t.prototype.initBand=function(n,t,r,u,f,e,o){var h,s;this.startSource=n,this.endSource=t,r>u&&(h=r,r=u,u=h,s=f,f=e,e=s),o?(this.startRow=r,this.startColumn=i.Parser.BAND_INDEX_CONST,this.endRow=u,this.endColumn=i.Parser.BAND_INDEX_CONST,this.startRowRelative=f,this.startColumnRelative=!1,this.endRowRelative=e,this.endColumnRelative=!1,this.isFullRow=!0):(this.startRow=i.Parser.BAND_INDEX_CONST,this.startColumn=r,this.endRow=i.Parser.BAND_INDEX_CONST,this.endColumn=u,this.startRowRelative=!1,this.startColumnRelative=f,this.endRowRelative=!1,this.endColumnRelative=e,this.isFullColumn=!0)},t.prototype.getRange=function(n,t){return hr.call(this,n,t)},t}(u),n.SheetRangeExpression=d,a=function(n){function t(t){n.call(this),this.structReference=t}return __ext
ends(t,n),t}(u),n.StructReferenceExpression=a}(i.Expressions||(i.Expressions={}));var r=i.Expressions,c={None:0,Sign:1,Int:2,Dot:3,Decimal:4,Exponent:5,SignExponent:6,ScientificNotation:7,Number:8},d={UppercaseLetter:0,LowercaseLetter:1,DecimalDigitNumber:8,OtherNumber:10,SpaceSeparator:11,Control:14,ConnectorPunctuation:18,DashPunctuation:19,OpenPunctuation:20,ClosePunctuation:21,InitialQuotePunctuation:22,FinalQuotePunctuation:23,OtherPunctuation:24,MathSymbol:25,CurrencySymbol:26,ModifierSymbol:27,OtherSymbol:28},k=[14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,11,24,24,24,26,24,24,24,20,21,24,25,24,19,24,24,8,8,8,8,8,8,8,8,8,8,24,24,25,25,25,24,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,24,21,27,18,27,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,20,25,21,25,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,11,24,26,26,26,26,28,28,27,28,1,22,25,19,28,27,28,25,1
0,10,27,1,28,24,27,10,1,23,10,10,10,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,25,1,1,1,1,1,1,1,1];var u={Operand:0,Function:1,Subexpression:2,Argument:3,OperatorPrefix:4,OperatorInfix:5,OperatorPostfix:6,Whitespace:7,Unknown:8},f={Nothing:0,Start:1,Stop:2,Text:3,Number:4,Logical:5,Error:6,RangeOrName:7,Concatenation:8,Intersection:9,Union:10,RangeOp:11},s=function(){function n(n,t,i,r){(r===undefined||r===null)&&(r=f.Nothing),this.value=n,this.type=t,this.index=i,this.subType=r,this.children=[]}return n}(),wu=function(){function n(){this._index=-1,this._tokens=[]}return n.prototype.count=function(){return this._tokens.length},n.prototype.BOF=function(){return this._index<=0},n.prototype.EOF=function(){return this._index>=this._tokens.length-1},n.prototype.current=function(){return this._index===-1?null:this._tokens[this._index]},n.prototype.next=function(){return this.EOF()?null:this._tokens[this._
index+1]},n.prototype.previous=function(){return this._index<1?null:this._tokens[this._index-1]},n.prototype.add=function(n){return this._tokens.push(n),n},n.prototype.removeAt=function(n){this._tokens.splice(n,1)},n.prototype.moveNext=function(){return this.EOF()?!1:(this._index++,!0)},n.prototype.reset=function(){this._index=-1},n.prototype.getItem=function(n){return n<0||n>=this.count()?null:this._tokens[n]},n}(),ku=function(){function n(){this._stack=[]}return n.prototype.push=function(n){this._stack.push(n)},n.prototype.pop=function(){if(this._stack.length===0)return null;var n=this._stack.pop();return new s("",n.type,n.index,f.Stop)},n.prototype.current=function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},n}();vt=function(){function n(n,t,i,r){this.useR1C1=n,this.row=t,this.column=i,this.option=r}return n.prototype.getExternalSource=function(n,t){return null},n.prototype.getExternalSourceToken=function(n){return""},n}()
,i.ParserContext=vt,p=function(){function n(n){this._init(n)}return n.prototype._init=function(n){this.listSeparator=bi(n,"listSeparator",","),this.numberDecimalSeparator=bi(n,"numberDecimalSeparator","."),this.arrayGroupSeparator=bi(n,"arrayGroupSeparator",";"),this._arrayArgumentSepatator=this.listSeparator===this.arrayGroupSeparator?"\\":this.listSeparator,this._operatorInfix="\\+-*/^&=><: "+this.listSeparator},n.prototype.parse=function(n,t){t||(t=new vt(!1,0,0)),t.option&&this._init(t.option);var i=this._parseToToken(n);return this._buildExpressionTree(t,i)},n.prototype.unparse=function(n,t){if(!n)return"";t||(t=new vt(!1,0,0)),t.option&&this._init(t.option);var i={content:""};return this._unparseExpression(n,t,i),i.content},n.prototype._unparseExpression=function(n,i,u){if(n instanceof r.ConstantExpression)this._unparseConstantExpression(n,i,u);else if(
n instanceof r.OperatorExpression)this._unParseOperatorExpressions(n,i,u);else if(n instanceof r.ReferenceExpression)this._unParseRefenceExpressions(n,i,u);else if(n instanceof r.BangNameExpression)u.content+="!",u.content+=n.name;else if(n instanceof r.NameExpression)u.content+=n.name;else if(n instanceof r.ExternalNameExpression)this._unparseSource(n.source,i,u),u.content+="!",u.content+=n.name;else if(n instanceof r.ParenthesesExpression)u.content+="(",this._unparseExpression(n.argument,i,u),u.content+=")";else if(n instanceof r.FunctionExpression){u.content+=n.getFunctionName(),u.content+="(";for(var f=0;f<n.argCount();f++)f!==0&&(u.content+=this.listSeparator),this._unparseExpression(n.getArg(f),i,u);u.content+=")"}else throw t._StringResource.Exp_NotSupport;},n.prototype._unparseSource=function(n,t,i){t.getExternalSourceToken&&(i.content+=this._getValidSource(t.getExternalSourceToken(n),t.useR1C1))}
,n.prototype._unparseSource2=function(n,t,i,r){var f={content:""};this._unparseSource(n,i,f);var o=this._removeApostrophe(f),s=this._removeWorkbook(f),h=s.success,e=s.workBookName,u={content:""};this._unparseSource(t,i,u),o|=this._removeApostrophe(u),e=this._removeWorkbook(u).workBookName,o?(r.content+="'",h&&(r.content+=e),r.content+=f.content,r.content+=":",r.content+=u.content,r.content+="'"):(h&&(r.content+=e),r.content+=f.content,r.content+=":",r.content+=u.content)},n.prototype._getValidSource=function(n,t){if(n===undefined||n===null||n==="")return"";var i=this._readSheetReference(n,t,!0);if(i.success)return n.charAt(0)==="'"&&n.charAt(n.length-1)==="'"&&(n=n.substr(1,n.length-2),n=n.replace("'","''"),n="'"+n+"'"),n;return i=this._readSheetReference("'"+n+"'",t,!0),i.success?(n=n.replace(
"'","''"),n="'"+n+"'"):""},n.prototype._unParseRefenceExpressions=function(n,i,u){var c=i.row,h=i.column,a,v,l,s,o,e,f;if(n instanceof r.BangCellExpression)u.content+="!",a=n,this._unParseCell(i.useR1C1,c,h,a.row,a.column,a.rowRelative,a.columnRelative,u);else if(n instanceof r.CellExpression)v=n,this._unParseCell(i.useR1C1,c,h,v.row,v.column,v.rowRelative,v.columnRelative,u);else if(n instanceof r.ExternalCellExpression)l=n,this._unparseSource(l.source,i,u),u.content+="!",this._unParseCell(i.useR1C1,c,h,l.row,l.column,l.rowRelative,l.columnRelative,u);else if(n instanceof r.BangRangeExpression)u.content+="!",s=n,this._unParseRange(i.useR1C1,c,h,s.startRow,s.startColumn,s.endRow,s.endColumn,s.startRowRelative,s.startColumnRelative,s.endRowRelative,s.endColumnRelative,u,s._getRangeType());else if(n instanceof r.RangeExpression)o=n,this._unParseRange(i.useR1C1,c,h,o.startRow,o.startColumn,o.endRow,o.endCol
umn,o.startRowRelative,o.startColumnRelative,o.endRowRelative,o.endColumnRelative,u,o._getRangeType());else if(n instanceof r.ExternalRangeExpression)e=n,this._unparseSource(e.source,i,u),u.content+="!",this._unParseRange(i.useR1C1,c,h,e.startRow,e.startColumn,e.endRow,e.endColumn,e.startRowRelative,e.startColumnRelative,e.endRowRelative,e.endColumnRelative,u,e._getRangeType());else if(n instanceof r.SheetRangeExpression)f=n,this._unparseSource2(f.startSource,f.endSource,i,u),u.content+="!",this._unParseRange(i.useR1C1,c,h,f.startRow,f.startColumn,f.endRow,f.endColumn,f.startRowRelative,f.startColumnRelative,f.endRowRelative,f.endColumnRelative,u,f._getRangeType());else if(n instanceof r.StructReferenceExpression)u.content+=n.structReference;else throw t._StringResource.Exp_NotSupport;},n.prototype._removeApostrophe=function(n){return n.content.charAt(n.content.length-1)==="'"?(n.content=n.content.substr(1,n.content.length-2),!0):!1},n.prototype._remove
Workbook=function(n){if(n.content.charAt(0)!=="[")return{success:!1,workBookName:""};var t=n.content.indexOf("]"),i=n.content.substr(0,t+1);return n.content=n.content.substr(t),{success:!0,workBookName:i}},n.prototype._unParseCell=function(t,i,r,u,f,s,h,c,l){var d,w,b,v,a,y,p,k;(l===undefined||l===null)&&(l=e.cell),d=n.BAND_INDEX_CONST,w=n.maxRowCount-1,(l===e.cell||l===e.row)&&u!==d&&u>-w&&u<=2*w&&(u+=s?i:0,u=su(u,w)),b=n.maxColumnCount-1,(l===e.cell||l===e.column)&&f!==d&&f>-b&&f<=2*b&&(f+=h?r:0,f=su(f,b));if(this._isCellIndexsError(i,r,u,f,s,h,l)){c.content+=o.toString();return}v="",a="";if(t){v="R",u<0||i===u&&s||(s?v=v+"["+(u-i)+"]":(u++,v=v+u));if(f<0){c.content+=v;return}a="C",r===f&&h||(h?a=a+"["+(f-r)+"]":(f++,a=a+f));if(s&&u<0||!s&&u<=0){c
.content+=a;return}c.content+=v,c.content+=a}else{u++,v=""+u,s||(v="$"+u);if(f<0){c.content+=v;return}for(y=f,p=1;p<li.length;p++)k=li[li.length-p],f=parseInt(y/k,10),y=y%k,f!==0&&(a=a+String.fromCharCode(f+65-1));a=a+String.fromCharCode(y+65),h||(a="$"+a);if(u<=0){c.content+=a;return}c.content+=a,c.content+=v}},n.prototype._isCellIndexsError=function(n,t,i,r,u,f,o){var s=!1;switch(o){case e.sheet:break;case e.cell:s|=i<0,s|=r<0;break;case e.row:s|=i<0;break;case e.column:s|=r<0;break}return s},n.prototype._unParseRange=function(t,i,r,u,f,o,s,h,c,l,a,v,y){(y===undefined||y===null)&&(y=e.cell),this._unParseCell(t,i,r,u,f,h,c,v,y);var p=n.BAND_INDEX_CONST;if(t&&u===o&&f===s&&(o===p||s===p))return;(o!==p||s!==p)&&(v.content+=":",this._unParseCell(t,i,r,o,s,l,a,v,y))},n.prototype._unParseOperatorExpressions=function(n,i,u){var o,e,f;if(n instanceof r.UnaryOperatorExpression)o=n.o
perator,o===l.percent?(this._unparseExpression(n.operand,i,u),u.content+=o.name):(u.content+=o.name,this._unparseExpression(n.operand,i,u));else if(n instanceof r.BinaryOperatorExpression){e={content:""},f={content:""},this._unparseExpression(n.right,i,f);var h=n.left instanceof r.BinaryOperatorExpression,c=n.right instanceof r.BinaryOperatorExpression,s=at(n.operator.name);h&&at(n.left.operator.name)>s?(e.content+="(",this._unparseExpression(n.left,i,e),e.content+=")"):this._unparseExpression(n.left,i,e),c&&at(n.right.operator.name)>s&&(f.content+="(",this._unparseExpression(n.right,i,f),f.content+="("),u.content+=e.content,u.content+=n.operator instanceof l.UnaryOperator?this.listSeparator:n.operator.name,u.content+=f.content}else throw t._StringResource.Exp_NotSupport;},n.prototype._unparseConstantExpression=function(i,u,f){var c=t._StringResource.Exp_InvalidArray,o,l,a,h,s,e;if(i instanceof
r.StringExpression)f.content+='"',f.content+=i.value,f.content+='"';else if(i instanceof r.DoubleExpression)f.content+=i.originalValue;else if(i instanceof r.BooleanExpression)f.content+=i.value?kt:pt;else if(i instanceof r.ArrayExpression){f.content+="{",o=i.value;if(o.getRowCount()<=0)throw c;for(l=n.BAND_INDEX_CONST,a=l,h=0;h<o.getRowCount();h++)for(h<1||(f.content+=this.arrayGroupSeparator),s=0;s<o.getColumnCount();s++){if(a!==l&&(a!==o.getColumnCount()||o.getColumnCount()===0))throw c;s!==0&&(f.content+=this._arrayArgumentSepatator),e=o.getValue(h,s);if(e===undefined||e===null)throw c;e instanceof r.Expression?this._unparseExpression(e,u,f):e instanceof String?(f.content+='"',f.content+=e,f.content+='"'):f.content+=e instanceof Boolean?e?kt:pt:e.toString()}f.content+="}"}else if(i instanceof r.ExternalErrorExpression)this._unparseSource(i.source,u,f),f.content+="!",f.content+=i.value.toString();else
if(i instanceof r.SheetRangeErrorExpression)this._unparseSource2(i.startSource,i.endSource,u,f),f.content+="!",f.content+=i.value.toString();else if(i instanceof r.BangErrorExpression)f.content+="!",f.content+=i.value.toString();else if(i instanceof r.ErrorExpression)f.content+=i.value.toString();else if(!(i instanceof r.MissingArgumentExpression))throw t._StringResource.Exp_NotSupport;},n.prototype._parseToToken=function(n){var p=n.length,e=new wu,c=new ku,r="",g=t._StringResource.AtIndexOn,h=0,w=0,i,o,y,b,nt,l,rt,v,tt,it,k,a,d;while(w<p&&n.charAt(w)===" ")w++;for(n.charAt(w)==="="&&w++,i=w;i<p;i++){o=n.charAt(i);if(o==='"')y=ai(n,i,'"','"'),e.add(new s(y.result,u.Operand,i,f.Text)),i=y.endIndex,h=i+1;else if(o==="'")y=ai(n,i,"'","'"),r+="'",r+=y.result,r+="'",i=y.endIndex;else if(o==="[")y=ai(n,i,"[","]"),r+="[&
quot;,r+=y.result,r+="]",i=y.endIndex;else if(o==="\r"||o==="\n")continue;else if(o==="#")b=cu(n,i),nt=i<p?n.charAt(i+1):"\x00",i>0&&n.charAt(i-1)==="!"?r+=b.result:ur===b.result.toUpperCase()&&i<p&&(di(nt)||nt==="$")?r+=b.result:(e.add(new s(b.result,u.Operand,i,f.Error)),h=i+1),i=b.endIndex;else if(o==="+"||o==="-")l=e.getItem(e.count()-1),r.length!==0?(e.add(new s(r,u.Operand,h)),e.add(new s(o,u.OperatorInfix,i)),r="",h=i+1):(l&&l.type===u.Whitespace&&(e.removeAt(e.count()-1),l=e.getItem(e.count()-1)),l&&(l.type===u.Function&&l.subType===f.Stop||l.type===u.Subexpression&&l.subType===f.Stop||l.type===u.OperatorPostfix||l.type===u.Operand)?(e.add(new s(o,u.OperatorInfix,i)),h=i+1):(e.add(new s(o,u.OperatorPrefix,i)),h=i+1));else if(o===this.numberDecimalSeparator||sr(o))if(r.length>0)r+=o;else if((rt=du(n,i,t
his.numberDecimalSeparator)).result){v=rt.endIndex,tt=n.slice(i,v+1);while(v<=p-2&&n.charAt(v+1)===" ")v++;v>p-2||n.charAt(v+1)!==":"?e.add(new s(tt,u.Operand,i,f.Number)):(r+=tt,r+=":",v++),h=i+1,i=v}else r+=o;else if(o==="{"){if(r.length>0)throw t._StringResource.Exp_FormulaInvalid+t._StringResource.SingleQuote+"{"+g+i+t._StringResource.FullStop;c.push(e.add(new s(wt,u.Function,i,f.Start))),c.push(e.add(new s(st,u.Function,i,f.Start))),h=i+1}else if(o===this.arrayGroupSeparator&&c.current()&&(c.current().value===wt||c.current().value===st)){r.length>0&&(e.add(new s(r,u.Operand,h)),r="");if(!c.current())throw t._StringResource.Exp_FormulaInvalid+t._StringResource.SingleQuote+o+g+i+t._StringResource.FullStop;e.add(c.pop()),e.add(new s(this.listSeparator,u.Argument,i)),c.push(e.add(new s(st,u.Function,i+1,f.Start))),h=i+1}else if(o==="}"){r.length>0&&(e.add(new
s(r,u.Operand,h)),r="");if(!c.current())throw t._StringResource.Exp_FormulaInvalid+t._StringResource.SingleQuote+o+g+i+t._StringResource.FullStop;e.add(c.pop()),e.add(c.pop()),h=i+1}else if(o===" "){it=i,i++;while(i<p&&r.charAt(r.length-1)===" ")i++;r.length>0&&r.charAt(r.length-1)!==":"&&i<p&&n.charAt(i)!==":"&&(e.add(new s(r,u.Operand,h)),r="",e.add(new s("",u.Whitespace,it)),h=i),i--}else if((i+2>p||o!=="<"||n.charAt(i+1)!=="=")&&(o!==">"||n.charAt(i+1)!=="=")&&(o!=="<"||n.charAt(i+1)!==">"))if(o==="%")r.length>0&&(e.add(new s(r,u.Operand,h)),r=""),e.add(new s(n.charAt(i),u.OperatorPostfix,i)),h=i+1;else if(o==="+"||o==="-"||o==="*"||o==="/"||o==="="||o===">"||o==="<"
||o==="&"||o==="^")r.length>0&&(e.add(new s(r,u.Operand,h)),r=""),e.add(new s(o,u.OperatorInfix,i)),h=i+1;else if(o==="(")r.length>0?(k=r.charAt(r.length-1),k===":"||k===this.listSeparator||k===" "?(r=r.slice(0,r.length-1),e.add(new s(r,u.Operand,h,f.RangeOrName)),e.add(new s(k,u.OperatorInfix,i-1,f.Nothing)),c.push(e.add(new s("",u.Subexpression,i,f.Start)))):(a=r.indexOf(":"),d=":",a===-1&&(a=r.indexOf(this.listSeparator),d=this.listSeparator),a===-1&&(a=r.indexOf(" "),d=" "),a!==-1&&a>0?(e.add(new s(r.substr(0,a),u.Operand,h,f.RangeOrName)),e.add(new s(d,u.OperatorInfix,a,f.Nothing)),r=r.slice(a+1),c.push(e.add(new s(r.toUpperCase(),u.Function,i,f.Start)))):c.push(e.add(new s(r.toUpperCase(),u.Function,i,f.Start)))),r=""):c.push(e.add(new s("",u.Subexpression,i,f.Start))),h=i+1;else if(o===this.listSeparator
||o===this.arrayGroupSeparator)r.length>0&&(e.add(new s(r,u.Operand,h)),r=""),c.current()&&c.current().type===u.Function?e.add(new s(this._arrayArgumentSepatator,u.Argument,i)):e.add(new s(this.listSeparator,u.OperatorInfix,i,f.Union)),h=i+1;else if(o===")"){r.length>0&&(e.add(new s(r,u.Operand,h)),r="");if(!c.current())throw t._StringResource.Exp_FormulaInvalid+t._StringResource.SingleQuote+o+g+i+t._StringResource.FullStop;e.add(c.pop()),h=i+1}else o===":"?r.length===0&&e.getItem(e.count()-1).subType===f.Stop?(e.add(new s(":",u.OperatorInfix,i,f.RangeOp)),h=i+1):r+=":":r+=o;else r.length>0&&(e.add(new s(r,u.Operand,h)),r=""),e.add(new s(n.slice(i,i+2),u.OperatorInfix,i,f.Logical)),i++,h=i+1}return r.length>0&&e.add(new s(r,u.Operand,h)),this._processTokens(e)},n.prototype._processTokens=function(n){var c=this._removeWhiteSpace(n),e=[],v=new s(""
;,u.Unknown,0,f.Start),l,i,r,o,h,a;e.push(v);while(c.moveNext()){i=c.current();if(!i)continue;r=c.previous(),o=c.next(),i.type===u.Operand&&i.subType===f.Nothing?(h=i.value.toUpperCase(),h===kt||h===pt?(i.subType=f.Logical,i.value=h):i.subType=f.RangeOrName):i.type===u.Function&&i.value.length>0&&i.value.charAt(0)==="@"&&(i.value=i.value.substr(1));if(e.length===0)throw t._StringResource.Exp_InvalidTokenAt+i.index+t._StringResource.FullStop;l=e[e.length-1];if(l.value===st)if(i.type!==u.Argument&&i.subType!==f.Error&&i.subType!==f.Stop&&i.subType!==f.Logical&&i.subType!==f.Number&&i.subType!==f.Text&&i.type!==u.OperatorPrefix)throw t._StringResource.Exp_InvalidArrayAt+i.index+t._StringResource.FullStop;switch(i.type){case u.Operand:if(r&&(r.type===u.Operand||r.type===u.OperatorPostfix||r.type===u.Function&&r.subType===f.Stop||r.type===u.Subexpression&&r.subType===f.Sto
p))throw t._StringResource.Exp_InvalidTokenAt+i.index+t._StringResource.FullStop;break;case u.Function:case u.Subexpression:if(i.value!==wt||i.type!==u.Function||i.subType!==f.Start||r){if(i.subType===f.Stop&&(!r||r.type===u.OperatorPrefix||r.type===u.OperatorInfix)||i.subType===f.Start&&r&&(!o||r.type===u.OperatorPostfix||r.subType===f.Stop))throw t._StringResource.Exp_InvalidTokenAt+i.index+t._StringResource.FullStop;}else break;if(i.subType===f.Stop&&i.type===u.Subexpression&&r.subType===f.Start)throw t._StringResource.Exp_InvalidTokenAt+i.index+t._StringResource.FullStop;if(i.subType===f.Stop&&i.type===u.Function&&r.type===u.Subexpression&&r.subType===f.Start)throw t._StringResource.Exp_InvalidTokenAt+i.index+t._StringResource.FullStop;break;case u.Argument:if(!o||!r||r.type===u.OperatorInfix||r.type===u.OperatorPrefix)throw t._StringResource.Exp_InvalidTokenAt+i.index+t._StringResource.FullStop;break;case u.Operato
rPrefix:if(!o||r&&r.type===u.OperatorPostfix)throw t._StringResource.Exp_InvalidTokenAt+i.index+t._StringResource.FullStop;break;case u.OperatorInfix:if(!o||!r||r.type===u.OperatorInfix||r.type===u.OperatorPrefix||r.type===u.Argument||r.type===u.Function&&r.subType===f.Start||r.type===u.Subexpression&&r.subType===f.Start)throw t._StringResource.Exp_InvalidTokenAt+i.index+t._StringResource.FullStop;break;case u.OperatorPostfix:if(!r||r.type===u.OperatorPrefix||r.type===u.OperatorInfix||r.type===u.Function&&r.subType===f.Start||r.type===u.Subexpression&&r.subType===f.Start)throw t._StringResource.Exp_InvalidTokenAt+i.index+t._StringResource.FullStop;break;default:throw t._StringResource.Exp_InvalidTokenAt+i.index+t._StringResource.FullStop;}if(i.subType===f.Start)e.push(i),l.children.push(i);else if(i.subType===f.Stop){if(e.length===0){a=i.value===wt||i.value===st?"}":")";throw t._StringResource.Exp_FormulaInvalid+t._StringRe
source.SingleQuote+a+t._StringResource.SingleQuoteAt+i.index+t._StringResource.FullStop;}e.pop()}else l.children.push(i)}return v.children},n.prototype._removeWhiteSpace=function(n){var e=new wu,r,t,i;while(n.moveNext()){r=n.current();if(!r)continue;if(r.type!==u.Whitespace){e.add(r);continue}if(n.BOF()||n.EOF())continue;t=n.previous(),i=n.next();if(!t||!i)continue;(t.type===u.Function&&t.subType===f.Stop||t.type===u.Subexpression&&t.subType===f.Stop||t.type===u.Operand)&&(i.type===u.Function&&i.subType===f.Start||i.type===u.Subexpression&&i.subType===f.Start||i.type===u.Operand)&&e.add(new s(" ",u.OperatorInfix,r.index,f.Intersection))}return e},n.prototype._buildExpressionNode=function(n,t){var i;return t.type===u.Function?i=t.value===wt?this._buildArraryExpression(n,t):this._buildFunctionExpression(n,t):t.type===u.Subexpression?i=this._buildSubExpression(n,t):t.type===u.Operand&&(t.subType===f.Number?i=new r.Double
Expression(parseFloat(t.value),t.value):t.subType===f.Error?i=new r.ErrorExpression(h.parse(t.value)):t.subType===f.Logical?gt(t.value,kt)?i=new r.BooleanExpression(!0):gt(t.value,pt)&&(i=new r.BooleanExpression(!1)):i=t.subType===f.RangeOrName?this._buildCellReferenceOrNameExpressions(n,t.value,t.index):new r.StringExpression(t.value)),i},n.prototype._buildExpressionTree=function(n,t){for(var f=this._parseToBinaryOperatorList(n,t),e,h,c,s,o,i=3;i<f.length;){s=f[i],o=f[i-2];if(s&&s.type===u.OperatorInfix){while(i>=3&&at(s.value)>=at(o.value))h=f[i-3],c=f[i-1],e=new r.BinaryOperatorExpression(hu(o),h,c),f.splice(i-3,1),f.splice(i-3,1),f.splice(i-3,1),f.splice(i-3,0,e),i-=2,i<3||(o=f[i-2]);i+=2}else i++}if(f.length===1)return f[0];else{for(i=f.length-2;i>0;i-=2)h=f[i-1],c=f[i+1],e=new r.BinaryOperatorExpression(hu(f[i]),h,c),f.splice(i-1,1),f.splice(i-1,1),f.splice(i-1,1),f.push(e);return e}},n.prototype._parseToBinaryOperatorList=function(n,t){f
or(var f=[],e,i,s,c,h,o=0;o<t.length;o++){i=t[o];if(i.type===u.OperatorPrefix){s=[];while(i.type===u.OperatorPrefix)s.push(i.value==="+"?l.plus:l.negate),o++,i=t[o];c=t[o],e=new r.UnaryOperatorExpression(s.pop(),this._buildExpressionNode(n,c));while(s.length>0)e=new r.UnaryOperatorExpression(s.pop(),e);f.push(e)}else i.type===u.OperatorPostfix?(h=f[f.length-1],e=new r.UnaryOperatorExpression(l.percent,h),f.pop(),f.push(e)):i.type===u.OperatorInfix?f.push(i):(e=this._buildExpressionNode(n,i),f.push(e))}return f},n.prototype._buildFunctionExpression=function(n,i){for(var f=[],e=[],h,o,s=0;s<i.children.length;s++)h=i.children[s],h.type!==u.Argument?e.push(h):e.length===0?f.push(new r.MissingArgumentExpression):(f.push(this._buildExpressionTree(n,e)),e=[]);e.length!==0?f.push(this._buildExpressionTree(n,e)):i.children.length!==0&&f.push(new r.MissingArgumentExpression),o=ni.findGlobalFunction(i.value);if(o){if(f.length<o.minArgs||f.length>o.maxArgs)throw
t._StringResource.Exp_InvalidParameters+i.index+t._StringResource.FullStop;return new r.FunctionExpression(o,f)}else return new r.FunctionExpression(i.value,f)},n.prototype._buildSubExpression=function(n,t){return new r.ParenthesesExpression(this._buildExpressionTree(n,t.children))},n.prototype._buildArraryExpression=function(n,f){for(var l=[],b=-1,e,v,p,y,c,o,s,a,w,h=0;h<f.children.length;h++){e=f.children[h],v=h===0?null:f.children[h-1];if(e.type===u.Argument){if(!v||v.type===u.Argument||h===f.children.length-1)throw t._StringResource.Exp_InvalidArrayAt+e.index+t._StringResource.FullStop;continue}else if(v&&v.type!==u.Argument)throw t._StringResource.Exp_InvalidArrayAt+e.index+t._StringResource.FullStop;else if(e.type!==u.Function||e.value!==st)throw t._StringResource.Exp_InvalidArrayAt+e.index+t._StringResource.FullStop;else if(b!==-1&&e.children.length!==b)throw t._StringResource.Exp_InvalidArrayColumns+e.index+t._StringResource.FullStop;else b=e.children.len
gth;for(p=[],l.push(p),y=e.children.length,c=null,o=0;o<y;o++){s=e.children[o];if(s.type===u.Argument)c&&c.type!==u.Argument&&o!==y-1||p.push(i.missingArgument);else if(c&&c.type!==u.Argument)throw t._StringResource.Exp_InvalidArrayAt+e.index;else{if(s.type===u.OperatorPrefix){if(o+1>=y)throw t._StringResource.Exp_InvalidArrayAt+e.index;a=e.children[o+1],a.value=""+s.value+a.value,s=a,o++}else o+1<y&&e.children[o+1].type===u.OperatorPostfix&&(a=e.children[o+1],s.value=""+s.value+a.value,o++);w=this._buildExpressionNode(n,s),w&&p.push(w.value)}c=s}}if(l.length===0||l[0]===undefined||l[0]===null||l[0].length===0)throw t._StringResource.Exp_InvalidArrayAt+e.index;return new r.ArrayExpression(l)},n.prototype._buildCellReferenceOrNameExpressions=function(n,i,u){var s=this._buildCellReferenceOrNameExpressions2(n,i,u),f=s.endIndex,e=s.expression,o,c,h;if(!e)throw t._StringResource.Exp_InvalidCellReference+u+t._Str
ingResource.FullStop;if(f<=0||f>=i.length)return e;if(i.charAt(f)!==":")throw t._StringResource.Exp_InvalidCellReference+u+t._StringResource.FullStop;f++,o=[],o.push(e);while(f++&&f<i.length){c=f,s=this._buildCellReferenceOrNameExpressions2(n,i.substr(f),u),f=s.endIndex,e=s.expression;if(!e)throw t._StringResource.Exp_InvalidCellReference+u+t._StringResource.FullStop;o.push(e),f+=c;if(f<i.length&&i.charAt(f)!==":")throw t._StringResource.Exp_InvalidCellReference+u+t._StringResource.FullStop;f++}for(e=o[0],h=1;h<o.length;h++)e=new r.BinaryOperatorExpression(l.range,e,o[h]);return e},n.prototype._buildCellReferenceOrNameExpressions2=function(n,t,u){var h,w,g,y,it,tt,d,b,et,ft,nt,l,rt,ut;if(t===undefined||t===null||t==="")return{endIndex:0,expression:null};h=t.length;if(t.match("^#REF"))return{endIndex:h,expression:new r.ErrorExpression(o)};w=t.charAt(0)==="!",g=w?1:0;if(h<1)return{endIndex:0,expression
:null};var v=-1,k="",f=0;if(w)v=g;else if(t.charAt(0)==="'")v=t.indexOf("!")+1,k=t.substr(0,v-1);else{y=t.indexOf("!"),l=t.indexOf(":");if(y!==-1){it=t.substr(g,y-g);if(l<0||y<l)y<h-1&&(k=it,v=y+1);else{tt=this._parseToCellReference(n,it,w);if(tt.expression)return tt;else y<h-1&&(k=it,v=y+1);f=tt.endIndex}}}var p="",c="",a="";if(v!==-1&&k&&k!==""){d=this._readSheetReference(k,n.useR1C1,!1);if(!d.success)return{endIndex:f,expression:null};p=d.workBookName,c=d.startSheetName,a=d.endSheetName}else v=g;nt=!1;if(p&&p!==""||c&&c!==""){nt=!0;if(n.getExternalSource){et=n.getExternalSource(p,c);if(!et)return{endIndex:f,expression:new r.ErrorExpression(o)}}}if(a&&a!==""){nt=!0;if(n.getExternalSource){ft=n.getExternalSource(p,a);if(!ft)return{endIndex:f,expression:new r.ErrorExpression(o)}}}var s=t.substr(v),
ot=this._parseToCellReference(n,s,w,et,ft),e=ot.expression;f=ot.endIndex;if(e)if(!nt||e instanceof r.SheetRangeExpression||e instanceof r.ExternalReferenceExpression||e instanceof r.ExternalErrorExpression||e instanceof r.SheetRangeErrorExpression||e instanceof r.ExternalNameExpression)if(f<s.length-1){f=h-(s.length-1);if(t.charAt(f)!==":"){if(c&&c!==""){if(a&&a!=="")return{endIndex:f,expression:null};if(!n.getExternalSource)return{endIndex:f,expression:new r.ErrorExpression(o)};b=n.getExternalSource(p,c);if(!b)return{endIndex:f,expression:new r.ErrorExpression(o)};e=new r.ExternalNameExpression(b,s)}else e=new r.NameExpression(s);f=h}}else f=h;else return{endIndex:h,expression:new r.ErrorExpression(o)};else{l=t.indexOf(":");if(w)e=new r.BangNameExpression(s);else if(c&&c!==""){if(a&&a!=="")return{endIndex:f,expression:null};if(!n.getExternalSource)return{endIndex:f,expression:new r.ErrorE
xpression(o)};b=n.getExternalSource(p,c);if(!b)return{endIndex:f,expression:new r.ErrorExpression(o)};e=new r.ExternalNameExpression(b,s)}else l>0?(rt=t.substr(0,l),e=this._validateName(rt)?new i.Expressions.BinaryOperatorExpression(i.Operators.range,new i.Expressions.NameExpression(rt),this._buildCellReferenceOrNameExpressions(n,t.substr(l+1),u+l+1)):null):e=new r.NameExpression(s);f=h}if(e instanceof r.NameExpression||e instanceof r.ExternalNameExpression){ut=this._createStructExpression(s);if(ut)e=ut;else if(!this._validateName(s))return{endIndex:f,expression:null}}return{endIndex:f,expression:e}},n.prototype._parseToCellReference=function(t,i,r,u,f){var a=0,c,s,e,o,l;if(i.charAt(0)==="#"){c=cu(i,0),a=c.endIndex+1,s=h.parse(c.result);if(s)return{endIndex:a,expression:this._createExternalErrorExpression(s,r,u,f)}}e=t.useR1C1?this._isR1C1CellReferance(i,t.row,t.column):this._isA1CellReferance(i),o=n.BAND_INDEX_CONST;if(e.success&&t.useR1C1&&e.startRow!=
=o&&e.startColumn===o&&e.endRow===o&&e.endColumn===o)e.endRow=e.startRow,e.endRowRelative=e.startRowRelative;else if(e.success&&t.useR1C1&&e.startColumn!==o&&e.startRow===o&&e.endRow===o&&e.endColumn===o)e.endColumn=e.startColumn,e.endColumnRelative=e.startColumnRelative;else if(!e.success||e.startRow===o&&(e.startColumn===o||e.endColumn===o)||e.startColumn===o&&e.endRow===o)return{endIndex:e.endIndex,expression:null};return l=this._createCellReferenceExpression(t,t.row,t.column,e.startRow,e.startColumn,e.endRow,e.endColumn,e.startRowRelative,e.startColumnRelative,e.endRowRelative,e.endColumnRelative,r,u,f),{endIndex:e.endIndex,expression:l}},n.prototype._createExternalErrorExpression=function(n,t,i,u){return t?new r.BangErrorExpression(n):i&&u?new r.SheetRangeErrorExpression(i,u,n):i?new r.ExternalErrorExpression(i,n):new r.ErrorExpression(n)},n.prototype._createCellReferenceExpression=function(
t,i,u,f,e,o,s,h,c,l,a,v,y,p){var b=n.BAND_INDEX_CONST,w;return y&&p?(w=new r.SheetRangeExpression(y,p),f===b?(e-=c?u:0,s-=a?u:0,w.initBand(y,p,e,s,c,a,!1)):e===b?(f-=h?i:0,o-=l?i:0,w.initBand(y,p,f,o,h,l,!0)):(f-=h?i:0,e-=c?u:0,o-=l?i:0,s-=a?u:0,w.init(y,p,f,e,o,s,h,c,l,a)),w):o===b&&s===b?(f-=h?i:0,e-=c?u:0,v?y||p?null:new r.BangCellExpression(f,e,h,c):y?new r.ExternalCellExpression(y,f,e,h,c):new r.CellExpression(f,e,h,c)):v?y&&p?null:(w=new r.BangRangeExpression,f===b?(e-=c?u:0,s-=a?u:0,w.initBand(e,s,c,a,!1)):e===b?(f-=h?i:0,o-=l?i:0,w.initBand(f,o,h,l,!0)):(f-=h?i:0,e-=c?u:0,o-=l?i:0,s-=a?u:0,w.init(f,e,o,s,h,c,l,a)),w):y?(w=new r.ExternalRangeExpression,f===b?(e-=c?u:0,s-=a?u:0,w.initBand(y,e,s,c,a,!1)):e===b?(f-=h?i:0,o-=l?i:0,w.initBand(y,f,o,h,l,!0)):(f-=h?i:0,e-=c?u:0,o-=l?i:0,s-=a?u:0,w.init(y,f,e,o,s,h,c,l,a)),w):(w=new r.RangeExpression,f===b?(e-=c?u:0,s-=a?u:0,w.initBand(e,s,c,a,!1)):e===b?(f-=h?i:0,o-=l?i:0,w.initBand(f,o,h,l,!0)):(f-=h?i:0,e-=
c?u:0,o-=l?i:0,s-=a?u:0,w.init(f,e,o,s,h,c,l,a)),w)},n.prototype._readSheetReference=function(n,t,i){var r={success:!1,startSheetName:"",endSheetName:"",workBookName:""},o=!1,u,s,f,e;return n.charAt(0)==="'"&&n.charAt(n.length-1)==="'"&&(o=!0,n=n.substr(1,n.length-2)),u=n.indexOf("["),u!==-1&&(u!==0&&(r.workBookName=n.substr(0,u),r.workBookName.charAt(u-1)!=="\\"&&(r.workBookName=r.workBookName+"\\")),s=ai(n,u,"[","]"),r.workBookName=r.workBookName+s.result,n=n.substr(s.endIndex+1)),f=n.indexOf(":"),f===-1?r.startSheetName=n:(r.startSheetName=n.substr(0,f),r.endSheetName=n.substr(f+1)),!r.startSheetName||r.startSheetName===""?(r.success=!1,r):(e=this._validateWorkbook(r.workBookName,o),e=this._validateSheetName(r.startSheetName,t,o),e&=this._validateSheetName(r.endSheetName,t,o),i&&(r.startSheetName&&(r.st
artSheetName=r.startSheetName.replace("'","''")),r.endSheetName&&(r.endSheetName=r.endSheetName.replace("'","''"))),r.success=e,r)},n.prototype._isStartWithCellReference=function(n,t){return t?this._isR1C1CellReferance(n):this._isA1CellReferance(n)},n.prototype._isA1CellReferance=function(t){var o=n.BAND_INDEX_CONST,i={startRow:o,startColumn:o,endRow:o,endColumn:o,startRowRelative:!0,startColumnRelative:!0,endRowRelative:!0,endColumnRelative:!0,success:!1,endIndex:0},s,u,r,c,l,h,f,e;t=t.replace(" ",""),s=t.length,u=this._readOneA1Element(t,0),i.endIndex=u.endIndex;if(!u.success||i.endIndex>s)return i;if(u.isRow)return i.startRow=u.elementIndex,i.startRowRelative=u.isRelative,t.charAt(i.endIndex)===":"?(i.endIndex++,r=this._readOneA1Element(t,i.endIndex),i.endIndex=r.endIndex,!r.success||!r.isRow?i:(i.endRow=r.elementIndex,i.endRowRelative=r.isRelative,i.success=!0,i)):i;else{i.startColumn=u.elementIndex
,i.startColumnRelative=u.isRelative;if(t.charAt(i.endIndex)===":")return i.endIndex++,r=this._readOneA1Element(t,i.endIndex),i.endIndex=r.endIndex,!r.success||r.isRow?i:(i.endColumn=r.elementIndex,i.endColumnRelative=r.isRelative,i.success=!0,i)}if(lt(t.charAt(i.endIndex))||t.charAt(i.endIndex)==="$"){r=this._readOneA1Element(t,i.endIndex),i.endIndex=r.endIndex;if(!r.success||!r.isRow)return i;i.startRow=r.elementIndex,i.startRowRelative=r.isRelative,c=i.endIndex;if(i.endIndex<s-1&&t.charAt(i.endIndex)===":"){if(t.charAt(i.endIndex+1)==="'")return i.success=!0,i;l=t.indexOf("!",i.endIndex+1),h=t.indexOf(":",i.endIndex+1);if(l!==-1&&(h===-1||h>l))return i.success=!0,i;i.endIndex++,f=this._readOneA1Element(t,i.endIndex);if(!f.success||f.isRow)return i.endIndex=c,i.success=!0,i;else i.endIndex=f.endIndex;i.endColumn=f.elementIndex,i.endColumnRelative=f.isRelative,e=this._readOneA1Element(t,i.endIndex);if(
e.success&&e.isRow)i.endIndex=e.endIndex;else return i.endIndex=c,i.success=!0,i;return i.endRow=e.elementIndex,i.endRowRelative=e.isRelative,i.success=!0,i}else return i.success=!0,i}else return i},n.prototype._isR1C1CellReferance=function(t,i,r){var c=n.BAND_INDEX_CONST,u={startRow:c,startColumn:c,endRow:c,endColumn:c,startRowRelative:!0,startColumnRelative:!0,endRowRelative:!0,endColumnRelative:!0,success:!1,endIndex:0},h,e,f,a,l,v,o,s;t=t.replace(" ",""),h=t.length,e=this._readOneR1C1Element(t,i,r,0),u.endIndex=e.endIndex;if(!e.success)return u;if(e.isRow){u.startRow=e.elementIndex,u.startRowRelative=e.isRelative;if(u.endIndex>=h)return u.success=!0,u;if(t.charAt(u.endIndex)===":")return u.endIndex++,f=this._readOneR1C1Element(t,i,r,u.endIndex),u.endIndex=f.endIndex,!f.success||!f.isRow?u:(u.endRow=f.elementIndex,u.endRowRelative=f.isRelative,u.success=!0,u)}else return u.startColumn=e.elementIndex,u.startColumnRelative=e.isRelative,u.end
Index>=h?(u.success=!0,u):t.charAt(u.endIndex)===":"?(u.endIndex++,f=this._readOneR1C1Element(t,i,r,u.endIndex),u.endIndex=f.endIndex,!f.success||f.isRow?u:(u.endColumn=f.elementIndex,u.endColumnRelative=f.isRelative,u.success=!0,u)):u;if(t.charAt(u.endIndex)==="C"||t.charAt(u.endIndex)==="c"){f=this._readOneR1C1Element(t,i,r,u.endIndex),u.endIndex=f.endIndex;if(!f.success||f.isRow)return u;u.startColumn=f.elementIndex,u.startColumnRelative=f.isRelative,a=u.endIndex;if(u.endIndex<h-1&&t.charAt(u.endIndex)===":"){if(t.charAt(u.endIndex+1)==="'")return u.success=!0,u;l=t.indexOf("!",u.endIndex+1),v=t.indexOf(":",u.endIndex+1);if(l!==-1&&(v===-1||v>l))return u.success=!0,u;u.endIndex++,o=this._readOneR1C1Element(t,i,r,u.endIndex);if(o.success&&o.isRow)u.endIndex=o.endIndex;else return u.endIndex=a,u.success=!0,u;u.endRow=o.elementIndex,u.endRowRelative=o.isRelative,s=this._readOneR1C1
Element(t,i,r,u.endIndex);if(!s.success||s.isRow)return u.endIndex=a,u.success=!0,u;else u.endIndex=s.endIndex;return u.endColumn=s.elementIndex,u.endColumnRelative=s.isRelative,u.success=!0,u}else return u.success=!0,u}else return u},n.prototype._readOneA1Element=function(t,i){var c=n.BAND_INDEX_CONST,r={endIndex:i,elementIndex:c,isRow:!0,isRelative:!0,success:!1},s=t.length,u,f,e,o,h;if(i>=s)return r;t.charAt(i)==="$"&&(r.isRelative=!1,i++);if(i>=s)return r;u=i,e=t.charAt(u);if(lt(e)&&e!=="0"){r.isRow=!0;while(u<s&<(e))u++,u<s&&(e=t.charAt(u));f=parseInt(t.substr(i,u-i),10);if(f>=1&&f<=n.maxRowCount)return r.elementIndex=f-1,r.endIndex=u,r.success=!0,r}else if(ui(e)){r.isRow=!1;while(u<s&&ui(e))u++,u<s&&(e=t.charAt(u));o=t.substr(i,u-i);if(o.length>3)return r;for(o=o.toUpperCase(),f=0,h=o.length-1;h>=0;h--)f+=(o.charCodeAt(h)-64)*li[o.length-h-1];if(f<=n.maxColumnCount)re
turn r.elementIndex=f-1,r.endIndex=u,r.success=!0,r}return r},n.prototype._readOneR1C1Element=function(t,i,r,u){var a=n.BAND_INDEX_CONST,f={endIndex:u,elementIndex:a,isRow:!0,isRelative:!1,success:!1},h=t.length,e,o,c,l,s;if(u>=h)return f;e=u,o=t.charAt(e);if(o==="R"||o==="r")f.isRow=!0,c=i;else if(o==="C"||o==="c")f.isRow=!1,c=r;else return f;u++,e++;if(u>=h)return f.endIndex=u,f.elementIndex=c,f.isRelative=!0,f.success=!0,f;o=t.charAt(e),o==="["&&(u++,e++,f.isRelative=!0);if(u>=h)return f;l=!1,o=t.charAt(e),f.isRelative&&o==="-"&&(u++,e++,l=!0);if(u>=h)return f;o=t.charAt(e);if(lt(o)){while(e<h&<(o))e++,e<h&&(o=t.charAt(e));s=parseInt(t.substr(u,e-u),10);if(f.isRelative){if(e>=h||t.charAt(e)!=="]")return f;e++}if(s<(f.isRow?n.maxRowCount:n.maxColumnCount))return f.isRelative?(s=l?-s:s,f.elementIndex=s+c):f.elementIndex=s-1,f.endIndex=e,f.success=!
0,f}else return f.isRelative?f:(f.endIndex=u,f.elementIndex=c,f.isRelative=!0,f.success=!0,f)},n.prototype._validateWorkbook=function(n,t){var i,r;if(n===undefined||n===null||n==="")return!0;for(r=0;r<n.length;r++){i=n[r];if(t){if(i==="*"||i===":"||i==="["||i==="]"||i==="?")return!1;if(i==="'")if(r===0||r>=n.length-1||n.charAt(r+1)!=="'")return!1}else if(i==="'"||i==="["||i==="]"||i==="?"||i==="%"||this._operatorInfix.indexOf(i)!==-1)return!1}return!0},n.prototype._validateSheetName=function(n,t,i){var f,r,u;if(n===undefined||n===null||n==="")return!0;if(!i&&sr(n.charAt(0)))return!1;f=this._isStartWithCellReference(n,t);if(!i&&f.success&&f.endIndex===n.length)return!1;for(u=0;u<n.length;u++){r=n.charAt(u);if(i){if(r==="*"||r===":"||r==="["||r==="]"||r==="?"||r===&
quot;\\"||r==="/")return!1}else if(r==="'"||r==="["||r==="]"||r==="?"||r==="\\"||r==="%"||r==='"'||this._operatorInfix.indexOf(r)!==-1)return!1}return!0},n.prototype._createStructExpression=function(n){return n.charAt(n.length-1)==="]"?new r.StructReferenceExpression(n):null},n.prototype._validateName=function(n){var t,i;if(n===undefined||n===null||n==="")return!1;if(n.length===1&&(n==="R"||n==="r"||n==="C"||n==="c"))return!1;t=n.charAt(0);if(!(t==="_"||t==="\\"||ui(t)||vu(t)))return!1;for(i=1;i<n.length;i++){t=n.charAt(i);if(!(t==="_"||t==="\\"||t==="?"||t==="."||di(t)||vu(t)))return!1}return!0},n.BAND_INDEX_CONST=-2147483648,n.maxRowCount=1048576,n.maxColumnCount=16384,n._isLetter=ui,n._isLetterOrDigit=di,n}(),i.Parser=p,si=function(){function n(n,t,i,r,u,f){this._expandArr
ayToMultiCallCount=0,this.source=n,this.arrayFormulaMode=arguments.length>=2?t:!1,this.row=arguments.length>=3?i:0,this.column=arguments.length>=4?r:0,this.rowCount=arguments.length>=5?u:1,this.columnCount=arguments.length>=6?f:1}return n.prototype.getValue=function(n,t,i){return n?n.getValue(t,i):o},n.prototype.getReference=function(n,t,i,r,u){return n?n.getReference(t,i,r,u):o},n.prototype.getFunction=function(n){return this.source&&this.source.getFunction?this.source.getFunction(n):null},n.prototype.getName=function(n){return this.source&&this.source.getName?this.source.getName(n,this.row,this.column):null},n.prototype._isExpandArrayToMultiCall=function(){return this._expandArrayToMultiCallCount>0},n.prototype._beginExpandArrayToMultiCall=function(){this._expandArrayToMultiCallCount++},n.prototype._endExpandArrayToMultiCall=function(){this._expandArrayToMultiCallCount--},n.prototype._offset=function(t,i){return new n(this.source,this.arrayFormula
Mode,this.row+t,this.column+i,this.rowCount,this.columnCount)},n}(),i.EvaluateContext=si,ou=new p,vi=function(){function n(){}return n.prototype.evaluateFormula=function(n,t,i){return this.evaluateExpression(ou.parse(n,t),i)},n.prototype.evaluateExpression=function(n,t){return this._evaluate(n,t,!1,!1)},n.prototype._evaluate=function(n,i,u,f){if(!n)throw t._StringResource.Exp_ExprIsNull;while(n instanceof r.ParenthesesExpression)n=n.argument;if(n instanceof r.ConstantExpression)return this._evaluateConst(n,i,u);else if(n instanceof r.ReferenceExpression)return this._evaluateReference(n,i,f);else if(n instanceof r.ExternalNameExpression){var o,e=null;return(o=n.source.getCalcService())&&(e=o._getEvaluatorContext4Cell(n.source._sheet,i.row,i.column,i.arrayFormulaMode)),e?this._evaluateName(n.name,e,i,u,f):ot}else if(n instanceof r.NameExpression)return this._evaluateName(n.name,i,i,u,f);else if(n instanceof r.UnaryOperatorExpression)return this._evaluateUnaryOperation(n,i,u);e
lse if(n instanceof r.BinaryOperatorExpression)return this._evaluateBinaryOperation(n,i,u);else if(n instanceof r.FunctionExpression)return this._evaluateFunction(n,i,u,f);throw t._StringResource.Exp_NotSupport;},n.prototype._extractValueFromReference=function(n,t,i){var r,u,e,f;if(n instanceof hi&&n.getSheetCount()!==1)return o;r=n.getRowCount(0),u=n.getColumnCount(0);if(n.getRangeCount()<=0||r<=0||u<=0)return o;try{if(n.getRangeCount()!==1||r>1&&u>1)return v;return e=t-n.getRow(0),f=i-n.getColumn(0),r===1&&u===1?n.getValue(0,0,0):r===1&&u===1&&f>=0&&f<u?n.getValue(0,0,f):r>1&&u===1&&r>=0&&e<r?n.getValue(0,e,0):v}catch(s){return v}},n.prototype._evaluateConst=function(n,t,i){var r=n.value;return r instanceof a?i||t&&(t.arrayFormulaMode||t._isExpandArrayToMultiCall())?r:b.getArrayValue(r,0,0):r},n.prototype._evaluateReference=function(n,t,i){var h,f,e,s,c;if(!t)return v;if(n
instanceof r.StructReferenceExpression)return o;h=t.source,n instanceof r.ExternalReferenceExpression&&(h=n.source);var a=t.row,l=t.column,u=n.getRange(a,l);if(i||t.arrayFormulaMode)return t.getReference(h,u.row,u.column,u.rowCount,u.columnCount);f=u.row,e=u.column;if(u.rowCount>1||u.columnCount>1){s=t.row>=u.row&&t.row<u.row+u.rowCount,c=t.column>=u.column&&t.column<u.column+u.columnCount;if(s||c)if(s&&!c&&u.columnCount===1)f=t.row;else if(!s&&c&&u.rowCount===1)e=t.column;else if(u.rowCount===1||u.columnCount===1)f=t.row,e=t.column;else return o;else return o}else if(u.row===-1&&u.rowCount===-1){if(u.columnCount!==1)return o;f=t.row}else if(u.column===-1&&u.columnCount===-1){if(u.rowCount!==1)return o;e=t.column}return t.getValue(h,f,e)},n.prototype._evaluateName=function(n,t,i,r,u){if(!t||!i)return ot;var f=t.getName(n);return f?this._evaluate(f,i,r,u):ot},n.prototype._evaluateOperationArg=f
unction(n,t,r,u){var f=this._evaluate(n,t,r,u);return f instanceof h?f:f===i.missingArgument?fr:f},n.prototype._evaluateUnaryOperation=function(n,t,i){var r=this._evaluateOperationArg(n.operand,t,i,!1);try{return n.operator.evaluate(r,t)}catch(u){return v}},n.prototype._evaluateBinaryOperation=function(n,t,i){var u=this._evaluateOperationArg(n.left,t,i,n.operator.acceptsReference),r;if(u instanceof h)return u;r=this._evaluateOperationArg(n.right,t,i,n.operator.acceptsReference);if(r instanceof h)return r;try{return n.operator.evaluate(u,r,t)}catch(f){return v}},n.prototype._evaluateFunction=function(n,t,i,r){var o=this._prepareFunctionArguments(n,t),f,d,it,rt,s,e,p,y,nt,c,k,b,g;if(!o||!o.success||!o.fn||!o.args)return o.error;var w=n.argCount(),l=o.args,tt=o.fn;if(t&&t.arrayFormulaMode)return w>0?this._evaluateFunctionWithArrayFormulaMode(tt,l,t,i,r):this._evaluateFunctionImp(tt,l,t,i,r,0,0);f=o.arrayIndex;if(t&&t._isExpandArrayToMultiCall()&&f&&f.
length>0){for(var h=[],v=[],ut=!0,u=0;u<w;u++)f.contains(u)?(d=l[u],d instanceof a?d.length()===1?(h[u]=d.getValueByIndex(0),v[u]=!0):(h[u]=d,v[u]=!1):(h[u]=null,v[u]=!0)):v[u]=!0;if(!ut){for(it=[],rt=[],u=0;u<w;u++)v[u]?(it[u]=-1,rt[u]=-1):(it[u]=h[u].getRowCount(),rt[u]=h[u].getColumnCount());for(s=-1,e=-1,u=0;u<w;u++)v[u]||(p=it[u],y=rt[u],s=s===-1?p:p>1?s>1?Math.min(p,s):p:s,e=e===-1?y:y>1?e>1?Math.min(y,e):y:e);for(nt=[],c=0;c<s;c++)for(k=nt[c],(k===undefined||k===null)&&(nt[c]=k=[]),b=0;b<e;b++){for(g=[],u=0;u<w;u++)g[u]=l[u];for(u=0;u<f.length;u++)g[f[u]]=h[f[u]];k[b]=this._evaluateFunctionImp(tt,g,t,i,r,c,b)}return new bt(nt,e)}for(u=0;u<f.length;u++)l[f[u]]=h[f[u]]}return this._evaluateFunctionImp(tt,l,t,i,r,0,0)},n.prototype._tryGetFunction=function(n,t){var r=n.argCount(),i=n.fn;if(!(i instanceof ni.Function)){if(!t)return{success:!1,error:ot};i=t.getFunction(i);if(!i||!(i instanceof ni.Function))return{success:!1,error:ot};i
f(r<i.minArgs||i.maxArgs<r)return{success:!1,error:v}}return{success:!0,fn:i}},n.prototype._evaluateFunctionWithArrayFormulaMode=function(n,t,i,r,u){return!t||t.length===0?this._evaluateFunctionImp(n,t,i,r,u,0,0):n.maxArgs===1?this._evaluateFunctionOneArg(n,t[0],i,r,u):this._evaluateFunctionTwoOrMoreArgs(n,t,i,r,u)},n.prototype._evaluateFunctionTwoOrMoreArgs=function(n,t,i,r,u){for(var w=t.length,l=[],tt=!0,k,d,nt,rt,it,ut,o,e,c,v,p,y,h,g,s,f=0;f<w;f++)d=n.acceptsReference&&n.acceptsReference(f),nt=b.tryExtractToSingleValue(t[f]),k=d||nt.success,tt=tt&&k,l[f]=k,d||(t[f]=nt.value);if(tt)return this._evaluateFunctionImp(n,t,i,r,u,0,0);for(rt=[],it=[],f=0;f<w;f++)ut=t[f]instanceof a,rt[f]=l||!ut?-1:t[f].getRowCount(),it[f]=l||!k?-1:t[f].getColumnCount();for(o=-1,e=-1,f=0;f<w;f++)l[f]||(c=rt[f],v=it[f],o=o===-1?c:c>1?o>1?Math.min(c,o):c:o,e=e===-1?v:v>1?e>1?Math.min(v,e):v:e);for(p=[],i._beginExpandArrayToMultiCall(),f=0;f<o;f++)for(y=p[f],(
y===undefined||y===null)&&(p[f]=y=[]),h=0;h<e;h++){for(g=[],s=0;s<w;s++)g[s]=l[s]?t[s]:b.getArrayValue(t[s],f,h);y[h]=this._evaluateFunctionImp(n,g,i,r,u,f,h)}return i._endExpandArrayToMultiCall(),new bt(p,e)},n.prototype._evaluateFunctionOneArg=function(n,t,i,r,u){var s,e,o,f;if(n.acceptsReference(0))return this._evaluateFunctionImp(n,[t],i,r,u,0,0);s=b.tryExtractToSingleValue(t);if(s.success)return this._evaluateFunctionImp(n,[s.value],i,r,u,0,0);var h=s.value,c=[],a=h.getRowCount(),l=h.getColumnCount();for(e=0;e<a;e++)for(o=c[e],(o===undefined||o===null)&&(c[e]=o=[]),f=0;f<l;f++)o[f]=this._evaluateFunctionImp(n,[h.getValue(e,f)],i,r,u,f,f);return new bt(c,l)},n.prototype._evaluateFunctionImp=function(n,t,i,r,u,f,e){try{var s=f!==0&&e!==0?i?i._offset(f,e):null:i,o=n.isContextSensitive()?n.evaluate(t,s):n.evaluate(t);return o instanceof w?s&&(s.arrayFormulaMode?i._isExpandArrayToMultiCall()&&(o=b.getArrayValue(ct._toArray(o),f,e))
:u||(o=this._extractValueFromReference(o,s.row,s.column))):o instanceof a&&(i?i.arrayFormulaMode?i._isExpandArrayToMultiCall()&&(o=b.getArrayValue(o,f,e)):!r&&i._isExpandArrayToMultiCall()&&(o=b.getArrayValue(o,f,e)):o=b.getArrayValue(o,f,e)),o}catch(h){return v}},n.prototype._prepareFunctionArguments=function(n,t){var g=this._tryGetFunction(n,t),y,p,k,e;if(!g.success)return g;var f=g.fn,s=[],nt=n.argCount(),l=[],u,r,o;if(f.isBranch()){u=f.findTestArgument();if(u>=0&&u<nt){o=this._evaluateFunctionArgument(n.getArg(u),t,f.acceptsArray(u),f.acceptsReference(u),f.acceptsError(u),f.acceptsMissingArgument(u)),r=o.value;if(!o.success)return{success:!1,error:r};if(t&&!t.arrayFormulaMode)if(r instanceof w){r=this._extractValueFromReference(r,t.row,t.column);if(!f.acceptsError(u)&&r instanceof h)return{success:!1,error:r};f.acceptsMissingArgument(u)||r!==i.missingArgument||(r=null)}else if(r instanceof a&&!f.acceptsArray(u
))if(t._isExpandArrayToMultiCall())s.push(u);else{r=b.getArrayValue(r,0,0);if(!f.acceptsError(u)&&r instanceof h)return{success:!1,error:r};f.acceptsMissingArgument(u)||r!==i.missingArgument||(r=null)}l[u]=r}var c=[],d=ct._toArray(l[u]),it=d.getRowCount(),tt=d.getColumnCount();for(y=0;y<it;y++)for(p=0;p<tt;p++){k=f.findBranchArgument(d.getValue(y,p));if(k===-1)continue;c.contains(k)||c.push(k);if(c.length>=f.maxArgs-1)break}if(c.length===0)return{success:!1,error:v};for(u=0;u<c.length;u++){e=c[u];if(e>=0&&e<nt){o=this._evaluateFunctionArgument(n.getArg(e),t,f.acceptsArray(e),f.acceptsReference(e),f.acceptsError(e),f.acceptsMissingArgument(e)),r=o.value;if(!o.success)return{success:!1,error:r};if(t&&!t.arrayFormulaMode)if(r instanceof a&&!f.acceptsArray(e))if(t._isExpandArrayToMultiCall())s.push(e);else{r=b.getArrayValue(r,0,0);if(!f.acceptsError(e)&&r instanceof h)return{success:!1,error:r};f.acceptsMissingArgument(e)||r!==i.
missingArgument||(r=null)}l[e]=r}}s.length>0&&s.sort(function(n,t){return n-t})}else for(u=0;u<nt;u++){o=this._evaluateFunctionArgument(n.getArg(u),t,f.acceptsArray(u),f.acceptsReference(u),f.acceptsError(u),f.acceptsMissingArgument(u)),r=o.value;if(!o.success)return{success:!1,error:r};if(t&&!t.arrayFormulaMode)if(r instanceof a&&!f.acceptsArray(u))if(t._isExpandArrayToMultiCall())s.push(u);else{r=b.getArrayValue(r,0,0);if(!f.acceptsError(u)&&r instanceof h)return{success:!1,error:r};f.acceptsMissingArgument(u)||r!==i.missingArgument||(r=null)}l[u]=r}return{success:!0,args:l,fn:f,arrayIndex:s}},n.prototype._evaluateFunctionArgumentImp=function(n,t,r,u,f,e){var o=this._evaluate(n,t,r,u);if(!f&&o instanceof h)return{success:!1,value:o};if(!e&&o===i.missingArgument)return{success:!0,value:null};if(t&&!t.arrayFormulaMode){if(o instanceof a&&!r&&!t._isExpandArrayToMultiCall())return o.length()>0?{success:!0
,value:o.getValueByIndex(0)}:{success:!1,value:fr};if(o instanceof w&&!u){o=this._extractValueFromReference(o,0,0),(o===undefined||o===null)&&(o=0);if(!f&&o instanceof h)return{success:!1,value:o};if(!e&&o===i.missingArgument)return{success:!0,value:null}}}return{success:!0,value:o}},n.prototype._evaluateFunctionArgument=function(n,t,i,r,u,f){if(t&&(i||t._isExpandArrayToMultiCall())&&!t.arrayFormulaMode){t._beginExpandArrayToMultiCall();var e=this._evaluateFunctionArgumentImp(n,t,i,r,u,f);return t._endExpandArrayToMultiCall(),e}return this._evaluateFunctionArgumentImp(n,t,i,r,u,f)},n}(),i.Evaluator=vi,oi="intersects",fi="contains";var nt="cellListeners",g="rowListeners",tt="columnListeners",ki="rowSliceListeners",wi="columnSliceListeners",lr="addToAdjust",yi="addToDirty",tu="incrementDelay",nu="decrementDelay",ti=function(){fun
ction n(){}return n.prototype.hasListeners=function(){return ff(this,this._listeners)},n.prototype.addCellListener=function(n){it(this,nt,n)},n.prototype.removeCellListener=function(n){rt(this,nt,n)},n.prototype.addRowListener=function(n){it(this,g,n)},n.prototype.removeRowListener=function(n){rt(this,g,n)},n.prototype.addColumnListener=function(n){it(this,tt,n)},n.prototype.removeColumnListener=function(n){rt(this,tt,n)},n.prototype.addListenersToAdjust=function(){yt(this,this._listeners,lr)},n.prototype.addListenersToDirty=function(){yt(this,this._listeners,yi)},n.prototype.incrementDelayOfListeners=function(){yt(this,this._listeners,tu)},n.prototype.decrementDelayOfListeners=function(){yt(this,this._listeners,nu)},n}(),cf=function(n){function t(t,i,r){n.call(this),this.sheetSource=t,this.row=i,this.column=r,this.delay=0,this._listeners=[nt,g,tt]}return __extends(t,n),t.prototype.incrementDelay=function(){this.delay+=1},t.prototype.decrementDelay=function(){this.delay-=1},t.protot
ype.startListening=function(){this.sheetSource.linkCellExpression(this.row,this.column,1,1)},t.prototype.stopListening=function(){this.sheetSource.unlinkCellExpression(this.row,this.column,1,1)},t.prototype.addToAdjust=function(){this.sheetSource._controller.addAdjustCell(this)},t.prototype.addToDirty=function(){this.sheetSource._controller.addDirtyCell(this)},t}(ti),of=function(n){function t(t,i){n.call(this),this.sheetSource=t,this.row=i,this._listeners=[nt,g,ki,tt]}return __extends(t,n),t.prototype.incrementDelay=function(){this.sheetSource.incrementDelay(this.row,-1,1,-1)},t.prototype.incrementDelay2=function(n,t){this.sheetSource.incrementDelay(this.row,n,1,t)},t.prototype.decrementDelay=function(){this.sheetSource.decrementDelay(this.row,-1,1,-1)},t.prototype.decrementDelay2=function(n,t){this.sheetSource.decrementDelay(this.row,n,1,t)},t.prototype.startListening=function(){this.sheetSource.linkRowExpression(this.row,1)},t.prototype.stopListening=function(){this.sheetSource.un
linkRowExpression(this.row,1)},t.prototype.addRowListener2=function(n,t){it(this,ki,{row:n,columnOffset:t,columnCount:1})},t.prototype.removeRowListenser2=function(n,t){rt(this,ki,{row:n,columnOffset:t,columnCount:1})},t.prototype.addToAdjust=function(){this.sheetSource._controller.addAdjustRow(this)},t.prototype.addToDirty=function(){this.sheetSource._controller.addDirtyRow(this)},t}(ti),sf=function(n){function t(t,i){n.call(this),this.sheetSource=t,this.column=i,this._listeners=[nt,g,tt,wi]}return __extends(t,n),t.prototype.incrementDelay=function(){this.sheetSource.incrementDelay(-1,this.column,-1,1)},t.prototype.incrementDelay2=function(n,t){this.sheetSource.incrementDelay(n,this.column,t,1)},t.prototype.decrementDelay=function(){this.sheetSource.decrementDelay(-1,this.column,-1,1)},t.prototype.decrementDelay2=function(n,t){this.sheetSource.decrementDelay(n,this.column,t,1)},t.prototype.startListening=function(){this.sheetSource.linkColumnExpression(this.column,1)},t.prototype.s
topListening=function(){this.sheetSource.unlinkColumnExpression(this.column,1)},t.prototype.addColumnListener2=function(n,t){it(this,wi,{column:n,rowOffset:t,rowCount:1})},t.prototype.removeColumnListenser2=function(n,t){rt(this,wi,{column:n,rowOffset:t,rowCount:1})},t.prototype.addToAdjust=function(){this.sheetSource._controller.addAdjustColumn(this)},t.prototype.addToDirty=function(){this.sheetSource._controller.addDirtyColumn(this)},t}(ti),iu=function(n){function t(t){n.call(this),this.name=t,this._listeners=[nt,g,tt]}return __extends(t,n),t.prototype.incrementDelay=function(){this.delay+=1},t.prototype.decrementDelay=function(){this.delay-=1},t.prototype.updateListening=function(n,t){var i=this;$(this._listeners).each(function(r,u){i[u]&&$(i[u]).each(function(i,r){n&&r.stopListening(),t&&r.startListening()})})},t.prototype.addToDirty=function(){yt(this,this._listeners,yi)},t}(ti),gr="cell",br="row",wr="column",nf=function(){f
unction n(n){this.sheetSource=n,this._listeners=[nt,g,tt]}return n.prototype.addCellListener=function(n,t,i,r,u){it(this,nt,{type:gr,row:n,column:t,rowCount:i,columnCount:r,listener:u})},n.prototype.removeCellListener=function(n,t,i,r,u){rt(this,nt,{type:gr,row:n,column:t,rowCount:i,columnCount:r,listener:u})},n.prototype.addRowListener=function(n,t,i,r,u,f,e,o){it(this,g,{type:br,row:n,column:t,rowCount:i,columnCount:r,listener:u})},n.prototype.removeRowListener=function(n,t,i,r,u,f,e,o){rt(this,g,{type:br,row:n,column:t,rowCount:i,columnCount:r,listener:u})},n.prototype.addColumnListener=function(n,t,i,r,u,f,e,o){it(this,tt,{type:wr,row:n,column:t,rowCount:i,columnCount:r,listener:u})},n.prototype.removeColumnListener=function(n,t,i,r,u,f,e,o){rt(this,tt,{type:wr,row:n,column:t,rowCount:i,columnCount:r,listener:u})},n.prototype.addListenersToAdjust=function(n,t,i,r){ci(this,this._listeners,{action:oi,row:n,column:t,rowCount:i,columnCount:r},lr)},n.prototype.addListenersToDirty=fun
ction(n,t,i,r){ci(this,this._listeners,{action:oi,row:n,column:t,rowCount:i,columnCount:r},yi)},n.prototype.incrementDelayOfListeners=function(n,t){ci(this,this._listeners,{action:fi,row:n,column:t},tu)},n.prototype.decrementDelayOfListeners=function(n,t){ci(this,this._listeners,{action:fi,row:n,column:t},nu)},n}();pi=function(){function n(n,t,i,r,u,f,e,o){this._fromModel=n,this._fromRow=t,this._fromColumn=i,this._toModel=r,this._toRow=u,this._toColumn=f,this._rowCount=e,this._columnCount=o}return n.prototype.getRowOffset=function(){return this._toRow-this._fromRow},n.prototype.getColumnOffset=function(){return this._toColumn-this._fromColumn},n.prototype.sourceContains=function(n,t,i,r,u){return this._fromModel===n&&(this._fromRow===-1||this._fromRow<=t&&t+r<=this._fromRow+this._rowCount)&&(this._fromColumn===-1||this._fromColumn<=i&&i+u<=this._fromColumn+this._columnCount)},n.prototype.destinationContains=function(n,t,i,r,u){return this.
_toModel===n&&(this._toRow===-1||this._toRow<=t&&t+r<=this._toRow+this._rowCount)&&(this._toColumn===-1||this._toColumn<=i&&i+u<=this._toColumn+this._columnCount)},n.prototype.sourceIntersectWith=function(n,t,i,r,u){if(this._toModel!==n)return null;var e=this._createValidCellRange(n,t,i,r,u),f=this._createValidCellRange(n,this._fromRow,this._fromColumn,r,u);return f.intersectWith(e)},n.prototype._createValidCellRange=function(n,t,i,r,u){var o=t===-1?0:t,s=t===-1||r===-1?n.rowCount:r,f=i===-1?0:i,e=i===-1||u===-1?n.columnCount:u;return{row:o,column:f,rowCount:s,columnCount:e,intersectWith:dr}},n}(),ii=function(){function n(){this.autoCalculation=!0,this.iteration=!1,this.maximumIterations=1,this.maximumChange=.01,this._dataModels=[],this._customFunctions=[],this._customNames=[],this.clearDirties()}return n.prototype.attachDataModel=function(n){this._dataModels.contains(n)||this._dataModels.push(n)},n.prototype.detachDataModel=function(n){fo
r(var o=null,f,t,e,r,u,i=this._headDirtyCells;i;i=o)o=i.nextDirty,i.sheetSource===n&&this.removeDirtyCell(i);for(f=null,t=this._headDirtyRows;t;t=f)f=t.nextDirty,t.sheetSource===n&&this.removeDirtyRow(t);for(e=null,r=this._headDirtyColumns;r;r=e)e=r.nextDirty,r.sheetSource===n&&this.removeDirtyColumn(r);for(u=0;u<this._dataModels.length;u++)if(this._dataModels[u]===n){this._dataModels.splice(u,1);break}},n.prototype.addCustomFunctions=function(n){var t,i;if(n===undefined||n===null||n.length<=0)return;for(t=0;t<n.length;t++)i=n[t],this._customFunctions.push(i)},n.prototype.addCustomNames=function(n){var t,i;if(n===undefined||n===null||n.length<=0)return;for(t=0;t<n.length;t++)i=n[t],this._customNames.push(i)},n.prototype.isDirtyCell=function(n){return n.previousDirty||n===this._headDirtyCells},n.prototype.addDirtyCell=function(n){n&&!this.isDirtyCell(n)&&n.row<n.sheetSource.getRowCount()&&n.column<n.sheetSource.getC
olumnCount()&&(this._headDirtyCells?this._tailDirtyCells.nextDirty=n:this._headDirtyCells=n,n.previousDirty=this._tailDirtyCells,n.nextDirty=null,this._tailDirtyCells=n)},n.prototype.removeDirtyCell=function(n){if(this.isDirtyCell(n)){var i=n.previousDirty,t=n.nextDirty;i?i.nextDirty=t:this._headDirtyCells=t,t?t.previousDirty=i:this._tailDirtyCells=i,n.previousDirty=null,n.nextDirty=null}},n.prototype.isDirtyRow=function(n){return n.previousDirty||n===this._headDirtyRows},n.prototype.addDirtyRow=function(n){n&&!this.isDirtyRow(n)&&n.row<n.sheetSource.getRowCount()&&(this._headDirtyRows?this._tailDirtyRows.nextDirty=n:this._headDirtyRows=n,n.previousDirty=this._tailDirtyRows,n.nextDirty=null,this._tailDirtyRows=n)},n.prototype.removeDirtyRow=function(n){if(this.isDirtyRow(n)){var i=n.previousDirty,t=n.nextDirty;i?i.nextDirty=t:this._headDirtyRows=t,t?t.previousDirty=i:this._tailDirtyRows=i,n.previousDirty=null,n.nextDirty=null}},n.prototype.isDirtyC
olumn=function(n){return n.previousDirty||n===this._headDirtyColumns},n.prototype.addDirtyColumn=function(n){n&&!this.isDirtyColumn(n)&&n.column<n.sheetSource.getColumnCount()&&(this._headDirtyColumns?this._tailDirtyColumns.nextDirty=n:this._headDirtyColumns=n,n.previousDirty=this._tailDirtyColumns,n.nextDirty=null,this._tailDirtyColumns=n)},n.prototype.removeDirtyColumn=function(n){if(this.isDirtyColumn(n)){var i=n.previousDirty,t=n.nextDirty;i?i.nextDirty=t:this._headDirtyColumns=t,t?t.previousDirty=i:this._tailDirtyColumns=i,n.previousDirty=null,n.nextDirty=null}},n.prototype.isVolatileCell=function(n){return n.previousVolatile||n===this._headVolatileCells},n.prototype.addVolatileCell=function(n){n&&!this.isVolatileCell(n)&&n.row<n.sheetSource.getRowCount()&&n.column<n.sheetSource.getColumnCount()&&(this._headVolatileCells?this._tailVolatileCells.nextDirty=n:this._headVolatileCells=n,n.previousDirty=this._tailVolati
leCells,n.nextDirty=null,this._tailVolatileCells=n)},n.prototype.removeVolatileCell=function(n){if(this.isVolatileCell(n)){var i=n.previousDirty,t=n.nextDirty;i?i.nextDirty=t:this._headVolatileCells=t,t?t.previousDirty=i:this._tailVolatileCells=i,n.previousDirty=null,n.nextDirty=null}},n.prototype.isAdjustCell=function(n){return n.previousAdjust||n===this._headAdjustCells},n.prototype.addAdjustCell=function(n){n&&!this.isAdjustCell(n)&&n.row<n.sheetSource.getRowCount()&&n.column<n.sheetSource.getColumnCount()&&(this._headAdjustCells?this._tailAdjustCells.nextAdjust=n:this._headAdjustCells=n,n.previousAdjust=this._tailAdjustCells,n.nextAdjust=null,this._tailAdjustCells=n)},n.prototype.removeAdjustCell=function(n){if(this.isAdjustCell(n)){var i=n.previousAdjust,t=n.nextAdjust;i?i.nextAdjust=t:this._headAdjustCells=t,t?t.previousAdjust=i:this._tailAdjustCells=i,n.previousAdjust=null,n.nextAdjust=null}},n.prototype.isAdjustRow=function(n){return n.p
reviousAdjust||n===this._headAdjustRows},n.prototype.addAdjustRow=function(n){n&&!this.isAdjustRow(n)&&n.row<n.sheetSource.getRowCount()&&(this._headAdjustRows?this._tailAdjustRows.nextAdjust=n:this._headAdjustRows=n,n.previousAdjust=this._tailAdjustRows,n.nextAdjust=null,this._tailAdjustRows=n)},n.prototype.removeAdjustRow=function(n){if(this.isAdjustRow(n)){var i=n.previousAdjust,t=n.nextAdjust;i?i.nextAdjust=t:this._headAdjustRows=t,t?t.previousAdjust=i:this._tailAdjustRows=i,n.previousAdjust=null,n.nextAdjust=null}},n.prototype.isAdjustColumn=function(n){return n.previousAdjust||n===this._headAdjustColumns},n.prototype.addAdjustColumn=function(n){n&&!this.isAdjustColumn(n)&&n.column<n.sheetSource.getColumnCount()&&(this._headAdjustColumns?this._tailAdjustColumns.nextAdjust=n:this._headAdjustColumns=n,n.previousAdjust=this._tailAdjustColumns,n.nextAdjust=null,this._tailAdjustColumns=n)},n.prototype.removeAdjustColumn=function(
n){if(this.isAdjustColumn(n)){var i=n.previousAdjust,t=n.nextAdjust;i?i.nextAdjust=t:this._headAdjustColumns=t,t?t.previousAdjust=i:this._tailAdjustColumns=i,n.previousAdjust=null,n.nextAdjust=null}},n.prototype.recalculate=function(){var c=null,p=!1,t,r,i,h,l,v,a,n,u,e,f,s,y,o,b,w;while(this._headVolatileCells)this.addDirtyCell(this._headVolatileCells),this.removeVolatileCell(this._headVolatileCells);while(this._headDirtyRows){for(t=this._headDirtyRows.sheetSource,a=t.getColumnCount(),i=0;i<a;i++)this.addDirtyCell(t._getCellCalc(this._headDirtyRows.row,i,!0));this.removeDirtyRow(this._headDirtyRows)}while(this._headDirtyColumns){for(t=this._headDirtyColumns.sheetSource,v=t.getRowCount(),r=0;r<v;r++)this.addDirtyCell(t._getCellCalc(r,this._headDirtyColumns.column,!0));this.removeDirtyColumn(this._headDirtyColumns)}for(n=this._headDirtyCells;n;n=n.nextDirty){t=n.sheetSource,h=n.row,l=n.column,u=t._getRowCalc(h,!1),e=t._getColumnCalc(l,!1),f=t._getRangeCalc(!1),n.addListenersToD
irty(),u&&u.addListenersToDirty(l),e&&e.addListenersToDirty(h),f&&f.addListenersToDirty(h,l,1,1);while(this._headDirtyRows){for(t=this._headDirtyRows.sheetSource,a=t.getColumnCount(),i=0;i<a;i++)this.addDirtyCell(t._getCellCalc(this._headDirtyRows.row,i,!0));this.removeDirtyRow(this._headDirtyRows)}while(this._headDirtyColumns){for(t=this._headDirtyColumns.sheetSource,v=t.getRowCount(),r=0;r<v;r++)this.addDirtyCell(t._getCellCalc(r,this._headDirtyColumns.column,!0));this.removeDirtyColumn(this._headDirtyColumns)}}for(n=this._headDirtyCells;n;n=c)t=n.sheetSource,c=n.nextDirty,n.row<t.getRowCount()&&n.column<t.getColumnCount()?n.delay=0:this.removeDirtyCell(n);for(n=this._headDirtyCells;n;n=n.nextDirty)t=n.sheetSource,r=n.row,i=n.column,u=t._getRowCalc(r,!1),e=t._getColumnCalc(i,!1),f=t._getRangeCalc(!1),n.incrementDelayOfListeners(),u&&u.incrementDelayOfListeners(i),e&&e.incrementDelayOfListeners(r),f&&f.incrementDel
ayOfListeners(r,i);do for(p=!1,n=this._headDirtyCells;n;n=c)c=n.nextDirty,n.delay===0&&(t=n.sheetSource,r=n.row,i=n.column,u=t._getRowCalc(r,!1),e=t._getColumnCalc(i,!1),f=t._getRangeCalc(!1),t.recalculateCell(r,i),this.removeDirtyCell(n),n.decrementDelayOfListeners(),u&&u.decrementDelayOfListeners(i),e&&e.decrementDelayOfListeners(r),f&&f.decrementDelayOfListeners(r,i),p=!0);while(p);if(this.iteration&&this._headDirtyCells)for(s=!0,y=0;s&&y<this.maximumIterations;y++)for(s=!1,n=this._headDirtyCells;n;n=n.nextDirty)o=n.sheetSource,r=n.row,i=n.column,b=o.getValue(r,i),o.recalculateCell(r,i),w=o.getValue(r,i),this._iterationChange(b,w)<this.maximumChange||(s=!0)},n.prototype._iterationChange=function(n,t){var r=parseFloat(n),i=parseFloat(t);return Math.abs(i-r)},n.prototype.clearDirties=function(){this._headAdjustCells=null,this._tailAdjustCells=null,this._headAdjustRows=null,this._tailAdjustRows=null,this._headAdjustColumns=null,t
his._tailAdjustColumns=null,this._headDirtyCells=null,this._tailDirtyCells=null,this._headDirtyRows=null,this._tailDirtyRows=null,this._headDirtyColumns=null,this._tailDirtyColumns=null,this._headVolatileCells=null,this._tailVolatileCells=null},n.prototype._adjustIndexOnAdd=function(n,t,i,r,u,f,e,o){if(i>=0||!u){var s=r+(u?i:0);return f===n&&(e+o>i||(s-=u?o:0)),f===t&&(e>s||(s+=o)),s-=u?i:0}return r},n.prototype._adjustCellExpressionOnAddRow=function(n,t,i,u,f,e,o,s){var c,h;if(t){c=f.rowRelative;if(i>=0||!c){h=this._adjustIndexOnAdd(n,t,i,f.row,f.rowRelative,e,o,s);if(h!==f.row)return n===t?new r.CellExpression(h,f.column,c,f.columnRelative):new r.ExternalCellExpression(t,h,f.column,c,f.columnRelative)}}return f},n.prototype._adjustRangeExpressionOnAddRow=function(n,t,i,u,f,o,s,h){var p,l,c,y,a,v;if(t){p=f._getRangeType();if(p===e.sheet||p===e.column)return f;l=f.startRowRelative,c=f.endRowRelative;if(i>=0||!l||!c)return y=this._adjustIndexOnAdd(n,t,i
,f.startRow,l,o,s,h),a=this._adjustIndexOnAdd(n,t,i,f.endRow,c,o,s,h),p===e.row?(n===t?(v=new r.RangeExpression,v.initBand(y,a,l,c,!0)):(v=new r.ExternalRangeExpression,v.initBand(t,y,a,l,c,!0)),v):n===t?new r.RangeExpression(y,f.startColumn,a,f.endColumn,l,f.startColumnRelative,c,f.endColumnRelative):new r.ExternalRangeExpression(t,y,f.startColumn,a,f.endColumn,l,f.startColumnRelative,c,f.endColumnRelative)}return f},n.prototype._adjustCellExpressionOnAddColumn=function(n,t,i,u,f,e,o,s){var c,h;if(t){c=f.columnRelative;if(u>=0||!c){h=this._adjustIndexOnAdd(n,t,u,f.column,f.columnRelative,e,o,s);if(h!==f.column)return n===t?new r.CellExpression(f.row,h,f.rowRelative,c):new r.ExternalCellExpression(t,f.row,h,f.rowRelative,c)}}return f},n.prototype._adjustRangeExpressionOnAddColumn=function(n,t,i,u,f,o,s,h){var p,l,c,y,a,v;if(t){p=f._getRangeType();if(p===e.sheet||p===e.row)return f;l=f.startColumnRelative,c=f.endColumnRelative;if(u>=0||!l||!c)return y=this._adjustIndexOnAdd(n,t
,u,f.startColumn,l,o,s,h),a=this._adjustIndexOnAdd(n,t,u,f.endColumn,c,o,s,h),p===e.column?(n===t?(v=new r.RangeExpression,v.initBand(y,a,l,c,!1)):(v=new r.ExternalRangeExpression,v.initBand(t,y,a,l,c,!1)),v):n===t?new r.RangeExpression(f.startRow,y,f.endRow,a,f.startRowRelative,l,f.endRowRelative,c):new r.ExternalRangeExpression(t,f.startRow,y,f.endRow,a,f.startRowRelative,l,f.endRowRelative,c)}return f},n.prototype.adjustFormulaOnAddRows=function(n,t,i,u,f,e,o){var c=u,h,p,y,l,a,s,v;if(u instanceof r.CellExpression)c=this._adjustCellExpressionOnAddRow(n,n,t,i,u,f,e,o);else if(u instanceof r.RangeExpression)c=this._adjustRangeExpressionOnAddRow(n,n,t,i,u,f,e,o);else if(u instanceof r.ExternalCellExpression)c=this._adjustCellExpressionOnAddRow(n,u.source,t,i,u,f,e,o);else if(u instanceof r.ExternalRangeExpression)c=this._adjustRangeExpressionOnAddRow(n,u.source,t,i,u,f,e,o);else if(u instanceof r.ParenthesesExpression)h=this.adjustFormulaOnAddRows(n,t,i,u.argument,f,e,o),h!==u.argum
ent&&(c=new r.ParenthesesExpression(h));else if(u instanceof r.UnaryOperatorExpression)h=this.adjustFormulaOnAddRows(n,t,i,u.operand,f,e,o),h!==u.operand&&(c=new r.UnaryOperatorExpression(u.operator,h));else if(u instanceof r.BinaryOperatorExpression)p=this.adjustFormulaOnAddRows(n,t,i,u.left,f,e,o),y=this.adjustFormulaOnAddRows(n,t,i,u.right,f,e,o),(p!==u.left||y!==u.right)&&(c=new r.BinaryOperatorExpression(u.operator,p,y));else if(u instanceof r.FunctionExpression){for(l=null,v=u.argCount(),s=0;s<v;s++){a=u.getArg(s),h=this.adjustFormulaOnAddRows(n,t,i,a,f,e,o);if(h!==a){l=[],l[s]=h;break}}if(l){for(s=0;s<v;s++)a=u.getArg(s),(l[s]===undefined||l[s]===null)&&(l[s]=this.adjustFormulaOnAddRows(n,t,i,a,f,e,o));c=new r.FunctionExpression(u.fn,l)}}return c},n.prototype.adjustFormulasOnAddRows=function(n,t,i){for(var s,r,f,u,e,o=0;o<this._customNames.length;o++)s=this._customNames[o].value,s.expression=this.adjustFormulaOnAddRows(null,-1,-1,s.exp
ression,n,t,i);while(this._headAdjustCells)r=this._headAdjustCells.sheetSource,f=this._headAdjustCells.row,u=this._headAdjustCells.column,e=r.getExpression(f,u),e?r.setExpression(f,u,this.adjustFormulaOnAddRows(r,f,u,e,n,t,i)):(r.getRowExpression&&r.getRowExpression(f)||r.getColumnExpression&&r.getColumnExpression(u))&&r._addCellsToDirty(f,u,1,1),this.removeAdjustCell(this._headAdjustCells);while(this._headAdjustRows)r=this._headAdjustRows.sheetSource,f=this._headAdjustRows.row,r.getExpression&&(e=r.getRowExpression(f),e&&r.setRowExpression&&r.setRowExpression(f,this.adjustFormulaOnAddRows(r,f,-1,e,n,t,i))),this.removeAdjustRow(this._headAdjustRows);while(this._headAdjustColumns)r=this._headAdjustColumns.sheetSource,u=this._headAdjustColumns.column,r.getColumnExpression&&(e=r.getColumnExpression(u),e&&r._setColumnExpression&&r._setColumnExpression(u,this.adjustFormulaOnAddRows(r,-1,u,e,n,t,i))),this.removeAdjust
Row(this._headAdjustColumns)},n.prototype.adjustFormulaOnAddColumns=function(n,t,i,u,f,e,o){var c=u,h,p,y,l,a,s,v;if(u instanceof r.CellExpression)c=this._adjustCellExpressionOnAddColumn(n,n,t,i,u,f,e,o);else if(u instanceof r.RangeExpression)c=this._adjustRangeExpressionOnAddColumn(n,n,t,i,u,f,e,o);else if(u instanceof r.ExternalCellExpression)c=this._adjustCellExpressionOnAddColumn(n,u.source,t,i,u,f,e,o);else if(u instanceof r.ExternalRangeExpression)c=this._adjustRangeExpressionOnAddColumn(n,u.source,t,i,u,f,e,o);else if(u instanceof r.ParenthesesExpression)h=this.adjustFormulaOnAddColumns(n,t,i,u.argument,f,e,o),h!==u.argument&&(c=new r.ParenthesesExpression(h));else if(u instanceof r.UnaryOperatorExpression)h=this.adjustFormulaOnAddColumns(n,t,i,u.operand,f,e,o),h!==u.operand&&(c=new r.UnaryOperatorExpression(u.operator,h));else if(u instanceof r.BinaryOperatorExpression)p=this.adjustFormulaOnAddColumns(n,t,i,u.left,f,e,o),y=this.adjustFormulaOnAddColumns(n,t,i
,u.right,f,e,o),(p!==u.left||y!==u.right)&&(c=new r.BinaryOperatorExpression(u.operator,p,y));else if(u instanceof r.FunctionExpression){for(l=null,v=u.argCount(),s=0;s<v;s++){a=u.getArg(s),h=this.adjustFormulaOnAddColumns(n,t,i,a,f,e,o);if(h!==a){l=[],l[s]=h;break}}if(l){for(s=0;s<v;s++)a=u.getArg(s),(l[s]===undefined||l[s]===null)&&(l[s]=this.adjustFormulaOnAddColumns(n,t,i,a,f,e,o));c=new r.FunctionExpression(u.fn,l)}}return c},n.prototype.adjustFormulasOnAddColumns=function(n,t,i){for(var s,r,f,u,e,o=0;o<this._customNames.length;o++)s=this._customNames[o].value,s.expression=this.adjustFormulaOnAddColumns(null,-1,-1,s.expression,n,t,i);while(this._headAdjustCells)r=this._headAdjustCells.sheetSource,f=this._headAdjustCells.row,u=this._headAdjustCells.column,e=r.getExpression(f,u),e?r.setExpression(f,u,this.adjustFormulaOnAddColumns(r,f,u,e,n,t,i)):(r.getRowExpression&&r.getRowExpression(f)||r.getColumnExpression&&r.getColumnExpression(u))&a
mp;&r._addCellsToDirty(f,u,1,1),this.removeAdjustCell(this._headAdjustCells);while(this._headAdjustRows)r=this._headAdjustRows.sheetSource,f=this._headAdjustRows.row,r.getRowExpression&&(e=r.getRowExpression(f),e&&r._setRowExpression&&r._setRowExpression(f,this.adjustFormulaOnAddColumns(r,f,-1,e,n,t,i))),this.removeAdjustRow(this._headAdjustRows);while(this._headAdjustColumns)r=this._headAdjustColumns.sheetSource,u=this._headAdjustColumns.column,r.getColumnExpression&&(e=r.getColumnExpression(u),e&&r._setColumnExpression&&r._setColumnExpression(u,this.adjustFormulaOnAddColumns(r,-1,u,e,n,t,i))),this.removeAdjustColumn(this._headAdjustColumns)},n.prototype._adjustIndexOnRemove=function(n,t,i,r,u,f,e,s){if(i>=0||!u){var h=r+(u?i:0);f===n&&(e>i||(h+=u?s:0));if(f===t)if(e+s>h){if(e<h)return o}else h-=s;return h-=u?i:0}return r},n.prototype._adjustCellExpressionOnRemoveRow=function(n,t,i,u,f,e,o,s){var l,c;if(t){l=f.
rowRelative;if(i>=0||!l){c=this._adjustIndexOnRemove(n,t,i,f.row,f.rowRelative,e,o,s);if(c instanceof h)return new r.ErrorExpression(c);if(c!==f.row)return n===t?new r.CellExpression(c,f.column,l,f.columnRelative):new r.ExternalCellExpression(t,c,f.column,l,f.columnRelative)}}return f},n.prototype._adjustRangeExpressionOnRemoveRow=function(n,t,i,u,f,o,s,c){var w,y,v,l,a,p;if(t){w=f._getRangeType();if(w===e.sheet||w===e.column)return f;y=f.startRowRelative,v=f.endRowRelative;if(i>=0||!y||!v){l=this._adjustIndexOnRemove(n,t,i,f.startRow,y,o,s,c);if(l instanceof h)return new r.ErrorExpression(l);return a=this._adjustIndexOnRemove(n,t,i,f.endRow,v,o,s,c),a instanceof h?new r.ErrorExpression(a):w===e.column?(n===t?(p=new r.RangeExpression,p.initBand(l,a,y,v,!1)):(p=new r.ExternalRangeExpression,p.initBand(t,l,a,y,v,!1)),p):n===t?new r.RangeExpression(l,f.startColumn,a,f.endColumn,y,f.startColumnRelative,v,f.endColumnRelative):new r.ExternalRangeExpression(t,l,f.startColumn,a,f.endC
olumn,y,f.startColumnRelative,v,f.endColumnRelative)}}return f},n.prototype._adjustCellExpressionOnRemoveColumn=function(n,t,i,u,f,e,o,s){var l,c;if(t){l=f.columnRelative;if(u>=0||!l){c=this._adjustIndexOnRemove(n,t,u,f.column,f.columnRelative,e,o,s);if(c instanceof h)return new r.ErrorExpression(c);if(c!==f.column)return n===t?new r.CellExpression(f.row,c,f.rowRelative,l):new r.ExternalCellExpression(t,f.row,c,f.rowRelative,l)}}return f},n.prototype._adjustRangeExpressionOnRemoveColumn=function(n,t,i,u,f,o,s,c){var w,y,v,l,a,p;if(t){w=f._getRangeType();if(w===e.sheet||w===e.row)return f;y=f.startColumnRelative,v=f.endColumnRelative;if(u>=0||!y||!v){l=this._adjustIndexOnRemove(n,t,u,f.startColumn,y,o,s,c);if(l instanceof h)return new r.ErrorExpression(l);return a=this._adjustIndexOnRemove(n,t,u,f.endColumn,v,o,s,c),a instanceof h?new r.ErrorExpression(a):w===e.column?(n===t?(p=new r.RangeExpression,p.initBand(l,a,y,v,!1)):(p=new r.ExternalRangeExpression,p.initBand(t,l,a,y,v,!
1)),p):n===t?new r.RangeExpression(f.startRow,l,f.endRow,a,f.startRowRelative,y,f.endRowRelative,v):new r.ExternalRangeExpression(t,f.startRow,l,f.endRow,a,f.startRowRelative,y,f.endRowRelative,v)}}return f},n.prototype.adjustFormulaOnRemoveRows=function(n,t,i,u,f,e,o){var c=u,h,a,s,y,p,l,v;if(u instanceof r.CellExpression)c=this._adjustCellExpressionOnRemoveRow(n,n,t,i,u,f,e,o);else if(u instanceof r.RangeExpression)c=this._adjustRangeExpressionOnRemoveRow(n,n,t,i,u,f,e,o);else if(u instanceof r.ExternalCellExpression)c=this._adjustCellExpressionOnRemoveRow(n,u.source,t,i,u,f,e,o);else if(u instanceof r.ExternalRangeExpression)c=this._adjustRangeExpressionOnRemoveRow(n,u.source,t,i,u,f,e,o);else if(u instanceof r.ParenthesesExpression)h=this.adjustFormulaOnRemoveRows(n,t,i,u.argument,f,e,o),h!==u.argument&&(c=new r.ParenthesesExpression(h));else if(u instanceof r.UnaryOperatorExpression)h=this.adjustFormulaOnRemoveRows(n,t,i,u.operand,f,e,o),h!==u.operand&&(c=new r.
UnaryOperatorExpression(u.operator,h));else if(u instanceof r.BinaryOperatorExpression)y=this.adjustFormulaOnRemoveRows(n,t,i,u.left,f,e,o),p=this.adjustFormulaOnRemoveRows(n,t,i,u.right,f,e,o),(y!==u.left||p!==u.right)&&(c=new r.BinaryOperatorExpression(u.operator,y,p));else if(u instanceof r.FunctionExpression){for(l=null,v=u.argCount(),s=0;s<v;s++){a=u.getArg(s),h=this.adjustFormulaOnRemoveRows(n,t,i,a,f,e,o);if(h!==a){l=[],l[s]=h;break}}if(l){for(s=0;s<v;s++)a=u.getArg(s),(l[s]===undefined||l[s]===null)&&(l[s]=this.adjustFormulaOnRemoveRows(n,t,i,a,f,e,o));c=new r.FunctionExpression(u.fn,l)}}return c},n.prototype.adjustFormulasOnRemoveRows=function(n,t,i){for(var s,r,f,u,e,o=0;o<this._customNames.length;o++)s=this._customNames[o].value,s.expression=this.adjustFormulaOnRemoveRows(null,-1,-1,s.expression,n,t,i);while(this._headAdjustCells)r=this._headAdjustCells.sheetSource,f=this._headAdjustCells.row,u=this._headAdjustCells.column,e=r.getExpression(f,u),e
?r.setExpression(f,u,this.adjustFormulaOnRemoveRows(r,f,u,e,n,t,i)):(r.getRowExpression&&r.getRowExpression(f)||r.getColumnExpression&&r.getColumnExpression(u))&&r._addCellsToDirty(f,u,1,1),this.removeAdjustCell(this._headAdjustCells);while(this._headAdjustRows)r=this._headAdjustRows.sheetSource,f=this._headAdjustRows.row,r.getRowExpression&&(e=r.getRowExpression(f),e&&r.setRowExpression&&r.setRowExpression(f,this.adjustFormulaOnRemoveRows(r,f,-1,e,n,t,i))),this.removeAdjustRow(this._headAdjustRows);while(this._headAdjustColumns)r=this._headAdjustColumns.sheetSource,u=this._headAdjustColumns.column,r.getColumnExpression&&(e=r.getColumnExpression(u),e&&r.setColumnExpression&&r.setColumnExpression(u,this.adjustFormulaOnRemoveRows(r,-1,u,e,n,t,i))),this.removeAdjustRow(this._headAdjustColumns)},n.prototype.adjustFormulaOnRemoveColumns=function(n,t,i,u,f,e,o){var c=u,h,a,s,y,p,l,v;if(u instanceof r.CellExpression)c=
this._adjustCellExpressionOnRemoveColumn(n,n,t,i,u,f,e,o);else if(u instanceof r.RangeExpression)c=this._adjustRangeExpressionOnRemoveColumn(n,n,t,i,u,f,e,o);else if(u instanceof r.ExternalCellExpression)c=this._adjustCellExpressionOnRemoveColumn(n,u.source,t,i,u,f,e,o);else if(u instanceof r.ExternalRangeExpression)c=this._adjustRangeExpressionOnRemoveColumn(n,u.source,t,i,u,f,e,o);else if(u instanceof r.ParenthesesExpression)h=this.adjustFormulaOnRemoveColumns(n,t,i,u.argument,f,e,o),h!==u.argument&&(c=new r.ParenthesesExpression(h));else if(u instanceof r.UnaryOperatorExpression)h=this.adjustFormulaOnRemoveColumns(n,t,i,u.operand,f,e,o),h!==u.operand&&(c=new r.UnaryOperatorExpression(u.operator,h));else if(u instanceof r.BinaryOperatorExpression)y=this.adjustFormulaOnRemoveColumns(n,t,i,u.left,f,e,o),p=this.adjustFormulaOnRemoveColumns(n,t,i,u.right,f,e,o),(y!==u.left||p!==u.right)&&(c=new r.BinaryOperatorExpression(u.operator,y,p));else if(u instanceof r.
FunctionExpression){for(l=null,v=u.argCount(),s=0;s<v;s++){a=u.getArg(s),h=this.adjustFormulaOnRemoveColumns(n,t,i,a,f,e,o);if(h!==a){l=[],l[s]=h;break}}if(l){for(s=0;s<v;s++)a=u.getArg(s),(l[s]===undefined||l[s]===null)&&(l[s]=this.adjustFormulaOnRemoveColumns(n,t,i,a,f,e,o));c=new r.FunctionExpression(u.fn,l)}}return c},n.prototype.adjustFormulasOnRemoveColumns=function(n,t,i){for(var r,f,u,e,s,o=0;o<this._customNames.length;o++)s=this._customNames[o].value,s.expression=this.adjustFormulaOnRemoveColumns(null,-1,-1,s.expression,n,t,i);while(this._headAdjustCells)r=this._headAdjustCells.sheetSource,f=this._headAdjustCells.row,u=this._headAdjustCells.column,e=r.getExpression(f,u),e?r.setExpression(f,u,this.adjustFormulaOnRemoveColumns(r,f,u,e,n,t,i)):(r.getRowExpression&&r.getRowExpression(f)||r.getColumnExpression&&r.getColumnExpression(u))&&r._addCellsToDirty(f,u,1,1),this.removeAdjustCell(this._headAdjustCells);while(this._headAdjustRows)r=
this._headAdjustRows.sheetSource,f=this._headAdjustRows.row,r.getRowExpression&&(e=r.getRowExpression(f),e&&r._setRowExpression&&r._setRowExpression(f,this.adjustFormulaOnRemoveColumns(r,f,-1,e,n,t,i))),this.removeAdjustRow(this._headAdjustRows);while(this._headAdjustColumns)r=this._headAdjustColumns.sheetSource,u=this._headAdjustColumns.column,r.getColumnExpression&&(e=r.getColumnExpression(u),e&&r._setColumnExpression&&r._setColumnExpression(u,this.adjustFormulaOnRemoveColumns(r,-1,u,e,n,t,i))),this.removeAdjustColumn(this._headAdjustColumns)},n.prototype.adjustFormulaOnRemoveSheet=function(n,t,i){var s=t,f,h,u,a,v,l,e,c;if(t instanceof r.ExternalReferenceExpression)a=t.source,(n!==i&&a===i||n===i&&a!==i)&&(s=new r.ErrorExpression(o));else if(t instanceof r.ParenthesesExpression)f=this.adjustFormulaOnRemoveSheet(n,t.argument,i),f!==t.argument&&(s=new r.ParenthesesExpression(f));else if(t instanceof r.U
naryOperatorExpression)f=this.adjustFormulaOnRemoveSheet(n,t.operand,i),f!==t.operand&&(s=new r.UnaryOperatorExpression(t.operator,f));else if(t instanceof r.BinaryOperatorExpression)v=this.adjustFormulaOnRemoveSheet(n,t.left,i),l=this.adjustFormulaOnRemoveSheet(n,t.right,i),(v!==t.left||l!==t.right)&&(s=new r.BinaryOperatorExpression(t.operator,v,l));else if(t instanceof r.FunctionExpression){for(e=null,c=t.argCount(),u=0;u<c;u++){h=t.getArg(u),f=this.adjustFormulaOnRemoveSheet(n,h,i);if(f!==h){e=[],e[u]=f;break}}if(e){for(u=0;u<c;u++)h=t.getArg(u),(e[u]===undefined||e[u]===null)&&(e[u]=this.adjustFormulaOnRemoveSheet(n,h,i));s=new r.FunctionExpression(t.fn,e)}}return s},n.prototype.adjustFormulasOnRemoveSheet=function(n){for(var e,t,u,r,i,f=0;f<this._customNames.length;f++)e=this._customNames[f].value,e.expression=this.adjustFormulaOnRemoveSheet(null,e.expression,n);while(this._headAdjustCells)t=this._headAdjustCells.sheetSource,u=this._headAdjustC
ells.row,r=this._headAdjustCells.column,i=t.getExpression(u,r),i&&t.setExpression(u,r,this.adjustFormulaOnRemoveSheet(t,i,n)),this.removeAdjustCell(this._headAdjustCells);while(this._headAdjustRows)t=this._headAdjustRows.sheetSource,u=this._headAdjustRows.row,t.getRowExpression&&(i=t.getRowExpression(u),i&&t.setRowExpression&&t.setRowExpression(u,this.adjustFormulaOnRemoveSheet(t,i,n))),this.removeAdjustRow(this._headAdjustRows);while(this._headAdjustColumns)t=this._headAdjustColumns.sheetSource,r=this._headAdjustColumns.column,t.getColumnExpression&&(i=t.getColumnExpression(r),i&&t.setColumnExpression&&t.setColumnExpression(r,this.adjustFormulaOnRemoveSheet(t,i,n))),this.removeAdjustColumn(this._headAdjustColumns)},n.prototype._adjustCellExpressionOnMove=function(n,t,i,u,f){var p=u instanceof r.ExternalReferenceExpression,l=p?u.source:n,h=u.rowRelative,c=u.columnRelative,e,s,y,a,v;if(t<0&&h||i<=0&&c)if(t&
lt;0&&h||i!==-1){if(t===-1&&i>=0&&!c){s=u.column+(c?i:0),f.destinationContains(n,t,i,1,1)&&(s-=c?f.getColumnOffset():0);if(f.sourceContains(l,e,s,1,1))s+=f.getColumnOffset();else if(f.destinationContains(l,e,s,1,1))return new r.ErrorExpression(o);s-=c?i:0;if(e!==u.row||s!==u.column)if(u instanceof r.CellExpression)return new r.CellExpression(u.row,s,u.rowRelative,c);else if(u instanceof r.ExternalCellExpression)return new r.ExternalCellExpression(u.source,u.row,s,u.rowRelative,c)}}else{e=u.row+(h?t:0),f.destinationContains(n,t,i,1,1)&&(e-=h?f.getRowOffset():0);if(f.sourceContains(l,e,-1,h,-1))e+=f.getRowOffset();else if(f.destinationContains(l,e,-1,1,-1))return new r.ErrorExpression(o);e-=h?t:0;if(e!==u.row)if(u instanceof r.CellExpression)return new r.CellExpression(e,u.column,h,u.columnRelative);else if(u instanceof r.ExternalCellExpression)return new r.ExternalCellExpression(u.source,e,u.column,h,u.columnRelative)}else{e=u.row+(h?t:0),s=
u.column+(c?i:0),f.destinationContains(n,t,i,1,1)&&(e-=h?f.getRowOffset():0,s-=c?f.getColumnOffset():0);if(f.sourceContains(p?l:f._fromModel,e,s,1,1))e+=f.getRowOffset(),s+=f.getColumnOffset(),v=f._toModel!==f._fromModel,y=v&&f._toModel===n,a=v&&f._fromModel===n;else if(f.destinationContains(l,e,s,1,1))return new r.ErrorExpression(o);e-=h?t:0,s-=c?i:0;if(e!==u.row||s!==u.column||y||a)return u instanceof r.CellExpression&&a||u instanceof r.ExternalCellExpression&&!y?new r.ExternalCellExpression(a?f._toModel:u.source,e,s,h,c):new r.CellExpression(e,s,h,c)}return u},n.prototype._adjustRangeExpressionOnMove=function(n,t,i,u,f){var k=u instanceof r.ExternalReferenceExpression?u.source:n,lt=u._getRangeType(),a,y,v,p,s,c,h,l,w,b,g,d,rt,ut,tt,it,ct,ft,vt,at,nt,et,ht,st,ot;if(lt===e.cell){a=u.startRowRelative,y=u.startColumnRelative,v=u.endRowRelative,p=u.endColumnRelative;if(t<0&&a&&v||i<0&&y&&p)if(t<0&&
;a&&v||i!==-1){if(t===-1&&(i>=0||!y||!p)){h=u.startColumn+(y?i:0),l=u.endColumn+(p?i:0);if(h>l)return new r.ErrorExpression(o);f.destinationContains(n,t,i,1,1)&&(tt=y?f.getColumnOffset():0,it=p?f.getColumnOffset():0,h-=tt,l-=it),b=l-h;if(f.sourceContains(k,-1,h,-1,b))d=f.getColumnOffset(),h+=d,l+=d;else if(f.destinationContains(k,-1,h,-1,b))return new r.ErrorExpression(o);h-=y?i:0,l-=p?i:0;if(h!==u.startColumn||l!==u.endColumn)if(u instanceof r.RangeExpression)return new r.RangeExpression(u.startRow,h,u.endRow,l,u.startRowRelative,y,u.endRowRelative,p);else if(u instanceof r.ExternalRangeExpression)return new r.ExternalRangeExpression(u.source,u.startRow,h,u.endRow,l,u.startRowRelative,y,u.endRowRelative,p)}}else{s=u.startRow+(a?t:0),c=u.endRow+(v?t:0);if(s>c)return new r.ErrorExpression(o);f.destinationContains(n,t,i,1,1)&&(rt=a?f.getRowOffset():0,ut=v?f.getRowOffset():0,s-=rt,c-=ut),w=c-s;if(f.sourceContains(k,s,-1,w,-1))g=f.getRowOffset(),
s+=g,c+=g;else if(f.destinationContains(k,s,-1,w,-1))return new r.ErrorExpression(o);s-=a?t:0,c-=v?t:0;if(s!==u.startRow||c!==u.endRow)if(u instanceof r.RangeExpression)return new r.RangeExpression(s,u.startColumn,c,u.endColumn,a,u.startColumnRelative,v,u.endColumnRelative);else if(u instanceof r.ExternalRangeExpression)return new r.ExternalRangeExpression(u.source,s,u.startColumn,c,u.endColumn,a,u.startColumnRelative,v,u.endColumnRelative)}else{s=u.startRow+(a?t:0),c=u.endRow+(v?t:0),h=u.startColumn+(y?i:0),l=u.endColumn+(p?i:0);if(s>c||h>l)return new r.ErrorExpression(o);f.destinationContains(n,t,i,1,1)&&(rt=a?f.getRowOffset():0,ut=v?f.getRowOffset():0,tt=y?f.getColumnOffset():0,it=p?f.getColumnOffset():0,s-=rt,c-=ut,h-=tt,l-=it),w=c-s+1,b=l-h+1,vt=!1;if(f.sourceContains(k,s,h,w,b))g=f.getRowOffset(),d=f.getColumnOffset(),s+=g,c+=g,h+=d,l+=d,at=f._toModel!==f._fromModel,ct=at&&f._toModel===n,ft=at&&f._fromModel===n;else if(f.destinationContains(k,s,h,
w,b)){nt=f.sourceIntersectWith(k,s,h,w,b);if(nt&&(nt.rowCount===w||nt.columnCount===b))s=nt.row+f.getRowOffset(),h=nt.column+f.getColumnOffset(),c=s+nt.rowCount,l=h+nt.columnCount,vt=!0;else return new r.ErrorExpression(o)}s-=a?t:0,c-=v?t:0,h-=y?i:0,l-=p?i:0;if(s!==u.startRow||h!==u.startColumn||c!==u.endRow||l!==u.endColumn||ct||ft||vt)return u instanceof r.RangeExpression&&ft||u instanceof r.ExternalRangeExpression&&!ct?new r.ExternalRangeExpression(ft?f._toModel:u.source,s,h,c,l,a,y,v,p):new r.RangeExpression(s,h,c,l,a,y,v,p)}}else if(lt===e.row){a=u.startRowRelative,v=u.endRowRelative;if(t>=0||!a||!v){s=u.startRow+(a?t:0),c=u.endRow+(v?t:0);if(s>c)return new r.ErrorExpression(o);f.destinationContains(n,t,i,1,1)&&(rt=a?f.getRowOffset():0,ut=v?f.getRowOffset():0,s-=rt,c-=ut),w=c-s;if(f.sourceContains(k,s,-1,w,-1))g=f.getRowOffset(),s+=g,c+=g;else if(f.destinationContains(k,s,-1,w,-1))return new r.ErrorExpression(o);s-=a?t:0,c-=v?t:0;if(s!==u.s
tartRow||c!==u.endRow)if(u instanceof r.RangeExpression)return et=new r.RangeExpression,et.initBand(s,c,a,v,!0),et;else if(u instanceof r.ExternalRangeExpression)return ht=new r.ExternalRangeExpression,ht.initBand(u.source,s,c,a,v,!0),ht}}else if(lt===e.column){y=u.startColumnRelative,p=u.endColumnRelative,h=u.startColumn+(y?i:0),l=u.endColumn+(p?i:0);if(h<l)return new r.ErrorExpression(o);f.destinationContains(n,t,i,1,1)&&(tt=y?f.getColumnOffset():0,it=p?f.getColumnOffset():0,h-=tt,l-=it),b=l-h;if(f.sourceContains(k,-1,h,-1,b))d=f.getColumnOffset(),h+=d,l+=d;else if(f.destinationContains(k,-1,h,-1,b))return new r.ErrorExpression(o);h-=y?i:0,l-=p?i:0;if(h!==u.startColumn||l!==u.endColumn)if(u instanceof r.RangeExpression)return st=new r.RangeExpression,st.initBand(h,l,y,p,!1),st;else if(u instanceof r.ExternalRangeExpression)return ot=new r.ExternalRangeExpression,ot.initBand(u.source,h,l,y,p,!1),ot}return u},n.prototype.adjustFormulaOnMove=function(n,t,i,u,f){var h=u,o,v
,a,s,c,e,l;if(u instanceof r.CellExpression||u instanceof r.ExternalCellExpression)h=this._adjustCellExpressionOnMove(n,t,i,u,f);else if(u instanceof r.RangeExpression||u instanceof r.ExternalRangeExpression)h=this._adjustRangeExpressionOnMove(n,t,i,u,f);else if(u instanceof r.ParenthesesExpression)o=this.adjustFormulaOnMove(n,t,i,u.argument,f),o!==u.argument&&(h=new r.ParenthesesExpression(o));else if(u instanceof r.UnaryOperatorExpression)o=this.adjustFormulaOnMove(n,t,i,u.operand,f),o!==u.operand&&(h=new r.UnaryOperatorExpression(u.operator,o));else if(u instanceof r.BinaryOperatorExpression)v=this.adjustFormulaOnMove(n,t,i,u.left,f),a=this.adjustFormulaOnMove(n,t,i,u.right,f),(v!==u.left||a!==u.right)&&(h=new r.BinaryOperatorExpression(u.operator,v,a));else if(u instanceof r.FunctionExpression){for(s=null,l=u.argCount(),e=0;e<l;e++){c=u.getArg(e),o=this.adjustFormulaOnMove(n,t,i,c,f);if(o!==c){s=[],s[e]=o;break}}if(s){for(e=0;e<l;e++)c=u.getArg(e),(
s[e]===undefined||s[e]===null)&&(s[e]=this.adjustFormulaOnMove(n,t,i,c,f));h=new r.FunctionExpression(u.fn,s)}}return h},n.prototype.adjustFormulasOnMove=function(n,t,i,r,u,f,e,o){for(var a=new pi(n,t,i,r,u,f,e,o),y,s,h,c,l,v=0;v<this._customNames.length;v++)y=this._customNames[v].value,y.expression=this.adjustFormulaOnMove(null,-1,-1,y.expression,a);while(this._headAdjustCells)s=this._headAdjustCells.sheetSource,h=this._headAdjustCells.row,c=this._headAdjustCells.column,l=s.getExpression(h,c),l?s.setExpression(h,c,this.adjustFormulaOnMove(s,h,c,l,a)):(s.getRowExpression&&s.getRowExpression(h)||s.getColumnExpression&&s.getColumnExpression(c))&&s._addCellsToDirty(h,c,1,1),this.removeAdjustCell(this._headAdjustCells);while(this._headAdjustRows)s=this._headAdjustRows.sheetSource,h=this._headAdjustRows.row,s.getRowExpression&&(l=s.getRowExpression(h),l&&s.setRowExpression&&s.setRowExpression(h,this.adjustFormulaOnMove(s,h,-1,l,a
))),this.removeAdjustRow(this._headAdjustRows);while(this._headAdjustColumns)s=this._headAdjustColumns.sheetSource,c=this._headAdjustColumns.column,s.getColumnExpression&&(l=s.getColumnExpression(c),l&&s.setColumnExpression&&s.setColumnExpression(c,this.adjustFormulaOnMove(s,-1,c,l,a))),this.removeAdjustColumn(this._headAdjustColumns)},n.prototype._adjustCellExpressionOnSwap=function(n,t,i,u,f){var c=u instanceof r.ExternalReferenceExpression?u.source:n,h=u.rowRelative,s=u.columnRelative,e,o;if(t<0&&h||i<0&&s)if(t<0&&h||i!==-1){if(t===-1&&i>=0&&!s){o=u.column+(s?i:0),f.destinationContains(n,-1,i,-1,1)?o-=s?f.getColumnOffset():0:f.sourceContains(n,-1,o,-1,1)&&(o+=s?f.getColumnOffset():0),f.sourceContains(c,-1,o,-1,1)?o+=f.getColumnOffset():f.destinationContains(c,-1,o,-1,1)&&(o-=f.getColumnOffset()),o-=s?i:0;if(e!==u.row||o!==u.column)if(u instanceof r.CellExpression)return new r.CellExpressio
n(u.row,o,u.rowRelative,s);else if(u instanceof r.ExternalCellExpression)return new r.ExternalCellExpression(u.source,u.row,o,u.rowRelative,s)}}else{e=u.row+(h?t:0),f.destinationContains(n,t,-1,1,-1)?e-=h?f.getRowOffset():0:f.sourceContains(n,e,-1,1,-1)&&(e+=h?f.getRowOffset():0),f.sourceContains(c,e,-1,1,-1)?e+=f.getRowOffset():f.destinationContains(c,e,-1,1,-1)&&(e-=f.getRowOffset()),e-=h?t:0;if(e!==u.row||o!==u.column)if(u instanceof r.CellExpression)return new r.CellExpression(e,u.column,h,u.columnRelative);else if(u instanceof r.ExternalCellExpression)return new r.ExternalCellExpression(u.source,e,u.column,h,u.columnRelative)}else{e=u.row+(h?t:0),o=u.column+(s?i:0),f.destinationContains(n,t,i,1,1)?(e-=h?f.getRowOffset():0,o-=s?f.getColumnOffset():0):f.sourceContains(n,e,o,1,1)&&(e+=h?f.getRowOffset():0,o+=s?f.getColumnOffset():0),f.sourceContains(c,e,o,1,1)?(e+=f.getRowOffset(),o+=f.getColumnOffset()):f.destinationContains(c,e,o,1,1)&&(e-=f.getRo
wOffset(),o-=f.getColumnOffset()),e-=h?t:0,o-=s?i:0;if(e!==u.row||o!==u.column)if(u instanceof r.CellExpression)return new r.CellExpression(e,o,h,s);else if(u instanceof r.ExternalCellExpression)return new r.ExternalCellExpression(u.source,e,o,h,s)}return u},n.prototype._adjustRangeExpressionOnSwap=function(n,t,i,u,f){var tt=u instanceof r.ExternalReferenceExpression?u.source:n,ot=u._getRangeType(),h,c,s,l,rt,it,a,v,p,y,b,w,g,d,k,nt,st,et,ut,ft;if(ot===e.cell){a=u.startRowRelative,v=u.startColumnRelative,p=u.endRowRelative,y=u.endColumnRelative;if(t<0&&a&&p||i<0&&v&&y)if(t<0&&a&&p||i!==-1){if(t===-1&&(i>=0||!v||!y)){s=u.startColumn+(v?i:0),l=u.endColumn+(y?i:0);if(s<l)return new r.ErrorExpression(o);f.destinationContains(n,-1,i,-1,1)?(d=v?f.getColumnOffset():0,nt=y?f.getColumnOffset():0,s-=d,l-=nt):f.sourceContains(n,-1,i,-1,1)&&(d=v?f.getColumnOffset():0,nt=y?f.getColumnOffset():0,s+=d,l+=nt),it=l-s,f.so
urceContains(tt,-1,s,-1,it)?(w=f.getColumnOffset(),s+=w,l+=w):f.destinationContains(tt,-1,s,-1,it)&&(w=f.getColumnOffset(),s-=w,l-=w),s-=v?i:0,l-=y?i:0;if(s!==u.startColumn||l!==u.endColumn)if(u instanceof r.RangeExpression)return new r.RangeExpression(u.startRow,s,u.endRow,l,u.startRowRelative,v,u.endRowRelative,y);else if(u instanceof r.ExternalRangeExpression)return new r.ExternalRangeExpression(u.source,u.startRow,s,u.endRow,l,u.startRowRelative,v,u.endRowRelative,y)}}else{h=u.startRow+(a?t:0),c=u.endRow+(p?t:0);if(h<c)return new r.ErrorExpression(o);f.destinationContains(n,t,-1,1,-1)?(g=a?f.getRowOffset():0,k=a?f.getRowOffset():0,h-=g,c-=k):f.sourceContains(n,t,-1,1,-1)&&(g=a?f.getRowOffset():0,k=a?f.getRowOffset():0,h+=g,c+=k),rt=c-h,f.sourceContains(tt,h,-1,rt,-1)?(b=f.getRowOffset(),h+=b,c+=b):f.destinationContains(tt,h,-1,rt,-1)&&(b=f.getRowOffset(),h-=b,c-=b),h-=a?t:0,c-=p?t:0;if(h!==u.startRow||c!==u.endRow)if(u instanceof r.RangeExpression)retu
rn new r.RangeExpression(h,u.startColumn,c,u.endColumn,a,u.startColumnRelative,p,u.endColumnRelative);else if(u instanceof r.ExternalRangeExpression)return new r.ExternalRangeExpression(u.source,h,u.startColumn,c,u.endColumn,a,u.startColumnRelative,p,u.endColumnRelative)}else{h=u.startRow+(a?t:0),c=u.endRow+(p?t:0),s=u.startColumn+(v?i:0),l=u.endColumn+(y?i:0),rt=c-h,it=l-s,f.destinationContains(n,t,i,1,1)?(g=a?f.getRowOffset():0,d=v?f.getColumnOffset():0,k=p?f.getRowOffset():0,nt=y?f.getColumnOffset():0,h-=g,c-=k,s-=d,l-=nt):f.sourceContains(n,h,s,rt,it)&&(g=a?f.getRowOffset():0,d=v?f.getColumnOffset():0,k=p?f.getRowOffset():0,nt=y?f.getColumnOffset():0,h+=g,c+=k,s+=d,l+=nt),f.sourceContains(tt,h,s,rt,it)?(b=f.getRowOffset(),w=f.getColumnOffset(),h+=b,c+=b,s+=w,l+=w):f.destinationContains(tt,h,s,rt,it)&&(b=f.getRowOffset(),w=f.getColumnOffset(),h-=b,c-=b,s-=w,l-=w),h-=a?t:0,c-=p?t:0,s-=v?i:0,l-=y?i:0;if(h!==u.startRow||s!==u.startColumn||c!==u.endRow||l!==u.endColum
n)if(u instanceof r.RangeExpression)return new r.RangeExpression(h,s,c,l,a,v,p,y);else if(u instanceof r.ExternalRangeExpression)return new r.ExternalRangeExpression(u.source,h,s,c,l,a,v,p,y)}}else if(ot===e.row){a=u.startRowRelative,p=u.endRowRelative;if(t>=0||!a||!p){h=u.startRow+(a?t:0),c=u.endRow+(p?t:0);if(h<c)return new r.ErrorExpression(o);f.destinationContains(n,t,-1,1,-1)?(g=a?f.getRowOffset():0,k=p?f.getRowOffset():0,h-=g,c-=k):f.sourceContains(n,t,-1,1,-1)&&(g=a?f.getRowOffset():0,k=p?f.getRowOffset():0,h+=g,c+=k),rt=c-h,f.sourceContains(tt,h,-1,rt,-1)?(b=f.getRowOffset(),h+=b,c+=b):f.destinationContains(tt,h,-1,rt,-1)&&(b=f.getRowOffset(),h-=b,c-=b),h-=a?t:0,c-=p?t:0;if(h!==u.startRow||c!==u.endRow)if(u instanceof r.RangeExpression)return st=new r.RangeExpression,st.initBand(h,c,a,p,!0),st;else if(u instanceof r.ExternalRangeExpression)return et=new r.ExternalRangeExpression,et.initBand(u.source,h,c,a,p,!0),et}}else if(ot===e.column){v=u.startColumn
Relative,y=u.endColumnRelative,s=u.startColumn+(v?i:0),l=u.endColumn+(y?i:0);if(s>l)return new r.ErrorExpression(o);f.destinationContains(n,-1,i,-1,1)?(d=v?f.getColumnOffset():0,nt=y?f.getColumnOffset():0,s-=d,l-=nt):f.sourceContains(n,-1,i,-1,1)&&(d=v?f.getColumnOffset():0,nt=y?f.getColumnOffset():0,s+=d,l+=nt),it=l-s,f.sourceContains(tt,-1,s,-1,it)?(w=f.getColumnOffset(),s+=w,l+=w):f.destinationContains(tt,-1,s,-1,it)&&(w=f.getColumnOffset(),s-=w,l-=w),s-=v?i:0,l-=y?i:0;if(s!==u.startColumn||l!==u.endColumn)if(u instanceof r.RangeExpression)return ut=new r.RangeExpression,ut.initBand(s,l,v,y,!1),ut;else if(u instanceof r.ExternalRangeExpression)return ft=new r.ExternalRangeExpression,ft.initBand(u.source,s,l,v,y,!1),ft}return u},n.prototype.adjustFormulaOnSwap=function(n,t,i,u,f){var h=u,o,v,a,s,c,e,l;if(u instanceof r.CellExpression||u instanceof r.ExternalCellExpression)h=this._adjustCellExpressionOnSwap(n,t,i,u,f);else if(u instanceof r.RangeExpression||u ins
tanceof r.ExternalRangeExpression)h=this._adjustRangeExpressionOnSwap(n,t,i,u,f);else if(u instanceof r.ParenthesesExpression)o=this.adjustFormulaOnSwap(n,t,i,u.argument,f),o!==u.argument&&(h=new r.ParenthesesExpression(o));else if(u instanceof r.UnaryOperatorExpression)o=this.adjustFormulaOnSwap(n,t,i,u.operand,f),o!==u.operand&&(h=new r.UnaryOperatorExpression(u.operator,o));else if(u instanceof r.BinaryOperatorExpression)v=this.adjustFormulaOnSwap(n,t,i,u.left,f),a=this.adjustFormulaOnSwap(n,t,i,u.right,f),(v!==u.left||a!==u.right)&&(h=new r.BinaryOperatorExpression(u.operator,v,a));else if(u instanceof r.FunctionExpression){for(s=null,l=u.argCount(),e=0;e<l;e++){c=u.getArg(e),o=this.adjustFormulaOnSwap(n,t,i,c,f);if(o!==c){s=[],s[e]=o;break}}if(s){for(e=0;e<l;e++)c=u.getArg(e),(s[e]===undefined||s[e]===null)&&(s[e]=this.adjustFormulaOnSwap(n,t,i,c,f));h=new r.FunctionExpression(u.fn,s)}}return h},n.prototype.adjustFormulasOnSwap=function(n,t
,i,r,u,f,e,o){for(var a=new pi(n,t,i,r,u,f,e,o),y,s,h,c,l,v=0;v<this._customNames.length;v++)y=this._customNames[v].value,y.expression=this.adjustFormulaOnSwap(null,-1,-1,y.expression,a);while(this._headAdjustCells)s=this._headAdjustCells.sheetSource,h=this._headAdjustCells.row,c=this._headAdjustCells.column,l=s.getExpression(h,c),l?s.setExpression(h,c,this.adjustFormulaOnSwap(s,h,c,l,a)):(s.getRowExpression&&s.getRowExpression(h)||s.getColumnExpression&&s.getColumnExpression(c))&&s._addCellsToDirty(h,c,1,1),this.removeAdjustCell(this._headAdjustCells);while(this._headAdjustRows)s=this._headAdjustRows.sheetSource,h=this._headAdjustRows.row,s.getRowExpression&&(l=s.getRowExpression(h),l&&s.setRowExpression&&s.setRowExpression(h,this.adjustFormulaOnSwap(s,h,-1,l,a))),this.removeAdjustRow(this._headAdjustRows);while(this._headAdjustColumns)s=this._headAdjustColumns.sheetSource,c=this._headAdjustColumns.column,s.getColumnExpression&
&(l=s.getColumnExpression(c),l&&s.setColumnExpression&&s.setColumnExpression(c,this.adjustFormulaOnSwap(s,-1,c,l,a))),this.removeAdjustColumn(this._headAdjustColumns)},n}(),i._Controller=ii,ar=function(){function n(n,t){this._sheet=n,this._sheetArea=t,this._controller=new ii,this._controller.attachDataModel(this)}return n.prototype._getSheetReference=function(){return this._reference=this._reference||new nr(this)},n.prototype.getValue=function(n,t){if(n<0||t<0)return v;n<this.getRowCount()||(n=n%this.getRowCount()),t<this.getColumnCount()||(t=t%this.getColumnCount());var i=this._sheet;return i._isValidatingCell&&i._validatingRow===n&&i._validatingColumn===t?i._validatingValue:i.getValue(n,t)},n.prototype.getReference=function(n,t,i,r){return n===-1&&t===-1?this._getSheetReference():n===-1?new ut(this._getSheetReference(),[{row:0,rowCount:this.getRowCount(),col:t,colCount:r}]):t===-1?new ut(this._getSheetReference(),[{row:n,rowC
ount:i,col:0,colCount:this.getColumnCount()}]):new ut(this._getSheetReference(),[{row:n,rowCount:i,col:t,colCount:r}])},n.prototype.getFunction=function(n){return this._sheet?this._sheet._findCustomFunction(n):null},n.prototype.getName=function(n,t,i){var r=this._sheet?this._sheet._findCustomName(n):null;return r?r.getExpression():null},n.prototype.getColumnCount=function(){return this._sheet.getColumnCount()},n.prototype.getRowCount=function(){return this._sheet.getRowCount()},n.prototype.getCalcService=function(){return this._sheet?this._sheet.getCalcService():null},n.prototype.hasFormula=function(n,t){return n=n!==undefined?n:-1,t=t!==undefined?t:-1,!!this.getExpression(n,t)},n.prototype.setFormula=function(n,t,i,r){var u,f,e;i&&i.length===0&&(i=null),u=this.getFormula(n,t);if(u!==i&&!(u===""&&!i||!u&&i==="")){f=this.getCalcService();if(f)try{e=i?f.parse(i,n>=0?n:0,t>=0?t:0):null,this.setExpression(n,t,e)}catch(o){
if(!r)throw o;}n<0||t<0||this._sheet._getModel(this._sheetArea).setFormula(n,t,i)}},n.prototype.getFormula=function(n,t){var r=this.getCalcService(),i;return r?(i=this.getExpression(n,t),i?r.unparse(i,n,t):null):null},n.prototype.getRowFormula=function(n){return this.getFormula(n,-1)},n.prototype.setRowFormula=function(n,t){this.setFormula(n,-1,t)},n.prototype.getColumnFormula=function(n){this.getFormula(-1,n)},n.prototype.setColumnFormula=function(n,t){this.setFormula(-1,n,t)},n.prototype.getExpression=function(n,t){var i=null,u,e,f,r=this._sheet._getCalcModel(this._sheetArea);return this._sheet?(u=r.getNode(n,t),u&&(i=u.formula),!i&&n<r.getRowCount()&&(e=r.getNode(n,-1),e&&(i=e.formula)),!i&&t<r.getColumnCount()&&(f=r.getNode(-1,t),f&&(i=f.formula))):n<0||t!==-1?n!==-1||t<0?n===-1&&t===-1&&(u=r.getNode(-1,-1),u&&(i=u.formula)):i&&t<r.getColumnCount()&&(f=r.getNode(-
1,t),f&&(i=f.formula)):!i&&n<r.getRowCount()&&(e=r.getNode(n,-1),e&&(i=e.formula)),i},n.prototype.setExpression=function(n,t,i){n<0||t<0?n<0||t!==-1?n!==-1||t<0||this._setColumnExpression(t,i):this._setRowExpression(n,i):this._setCellExpression(n,t,i);var r=this.getCalcService();this._controller.autoCalculation&&!r.IsSuspended()&&this._controller.recalculate()},n.prototype.getRowExpression=function(n){return this.getExpression(n,-1)},n.prototype.getColumnExpression=function(n){return this.getExpression(-1,n)},n.prototype._setCellExpression=function(n,t,i){var r=this._getCellCalc(n,t,!0),u;r&&(r.stopListening(),u=this._sheet._getCalcModel(this._sheetArea).getNode(n,t,!0),u.formula=i,r.startListening(),this._controller.addDirtyCell(r))},n.prototype._setRowExpression=function(n,t){var r=this._getRowCalc(n,!0),u,i;r&&(r.stopListening(),u=this._sheet._getCalcModel(this._sheetArea),i=u._rowDataArray[n],i||(u._r
owDataArray[n]=i={}),i.formula=t,r.startListening(),this._controller.addDirtyRow(r))},n.prototype._setColumnExpression=function(n,t){var r=this._getColumnCalc(n,!0),u,i;r&&(r.stopListening(),u=this._sheet._getCalcModel(this._sheetArea),i=u._columnDataArray[n],i||(u._columnDataArray[n]=i={}),i.formula=t,r.startListening(),this._controller.addDirtyRow(r))},n.prototype.onBeforeAddRemoveRows=function(n){var t=this.getRowCount(),i=this.getColumnCount();this.unlinkCellExpression(n,0,t-n,i),this.unlinkRowExpression(n,t-n),this._addDependentsToAdjust(n,-1,t-n,-1)},n.prototype.onAfterAddRows=function(n,t){var r=this.getRowCount(),i=this.getColumnCount();this._addCellsToDirty(n,0,t,i),this._addCellsToAdjust(n,0,r-n,i),this._addRowsToAdjust(n,r-n),this._controller.adjustFormulasOnAddRows(this,n,t),this._controller.autoCalculation&&this._controller.recalculate()},n.prototype.onAfterRemoveRows=function(n,t){var i=this.getRowCount(),r=this.getColumnCount();this._addCellsToAdjust(n
,0,i-n,r),this._addRowsToAdjust(n,i-n),this._controller.adjustFormulasOnRemoveRows(this,n,t),this._controller.autoCalculation&&this._controller.recalculate()},n.prototype.onBeforeAddRemoveColumns=function(n){var i=this.getRowCount(),t=this.getColumnCount();this.unlinkCellExpression(0,n,i,t-n),this.unlinkColumnExpression(n,t-n),this._addDependentsToAdjust(-1,n,-1,t-n)},n.prototype.onAfterAddColumns=function(n,t){var r=this.getRowCount(),i=this.getColumnCount();this._addCellsToDirty(0,n,r,t),this._addCellsToAdjust(0,n,r,i-n),this._addColumnsToAdjust(n,i-n),this._controller.adjustFormulasOnAddColumns(this,n,t)},n.prototype.onAfterRemoveColumns=function(n,t){var r=this.getRowCount(),i=this.getColumnCount();this._addCellsToAdjust(0,n,r,i-n),this._addColumnsToAdjust(n,i-n),this._controller.adjustFormulasOnRemoveColumns(this,n,t),this._controller.autoCalculation&&this._controller.recalculate()},n.prototype._buildAction=function(n,t,i){return n[t+""+i]},n.prototype
._dealWithExpression=function(n,t,i,u){var p,b,y,w,v,k,ft,ut,a,d,g,f,c,l,o,h,s,nt,it,tt,et,rt;while(i instanceof r.ParenthesesExpression)i=i.argument;if(i instanceof r.CellExpression||i instanceof r.ExternalCellExpression){s=i instanceof r.CellExpression?this:i.source;if(0>n||0>t)if(0>n||t!==-1){if(n===-1&&0<=t){p=i.row,b=i.column+(i.columnRelative?t:0),g=this._getColumnCalc(t,!0);if(i.rowRelative){l=s._getColumnCalc(b,!0);if(!l)return;this._buildAction(l,u,"ColumnListener2").call(l,g,-p)}else{f=s._getCellCalc(p,b,!0);if(!f)return;this._buildAction(f,u,"ColumnListener").call(f,g)}}}else{p=i.row+(i.rowRelative?n:0),b=i.column,d=this._getRowCalc(n,!0);if(i.columnRelative){c=s._getRowCalc(p,!0);if(!c)return;this._buildAction(c,u,"RowListener2").call(c,d,-b)}else{f=s._getCellCalc(p,b,!0);if(!f)return;this._buildAction(f,u,"RowListener").call(f,d)}}else{p=i.row+(i.rowRelative?n:0),b=i.column+(i.columnRelative?t:0),a=this._getCel
lCalc(n,t,!0),f=s._getCellCalc(p,b,!0);if(!f)return;this._buildAction(f,u,"CellListener").call(f,a)}}else if(i instanceof r.RangeExpression||i instanceof r.ExternalRangeExpression){s=i instanceof r.RangeExpression?this:i.source,nt=i._getRangeType();if(nt===e.cell)if(0>n||0>t)if(0>n||t!==-1){if(n===-1&&0<=t)for(y=i.startRow+(i.startRowRelative?n:0),v=i.startColumn+(i.startColumnRelative?t:0),w=i.endRow+(i.endRowRelative?n:0),k=i.endColumn+(i.endColumnRelative?t:0),g=this._getColumnCalc(t,!0),o=y;o<=w;o++)for(h=v;h<=k;h++)i.startRowRelative||i.endRowRelative?(l=s._getColumnCalc(o,!0),l&&this._buildAction(l,u,"ColumnListener2").call(l,g,-o)):(f=s._getCellCalc(o,h,!0),f&&this._buildAction(f,u,"ColumnListener").call(f,g))}else for(y=i.startRow+(i.startRowRelative?n:0),v=i.startColumn+(i.startColumnRelative?t:0),w=i.endRow+(i.endRowRelative?n:0),k=i.endColumn+(i.endColumnRelative?t:0),d=this._getRowCalc(n,!0),o=y;o<
;=w;o++)for(h=v;h<=k;h++)i.startColumnRelative||i.endColumnRelative?(c=s._getRowCalc(o,!0),c&&this._buildAction(c,u,"RowListener2").call(c,d,-h)):(f=s._getCellCalc(o,h,!0),f&&this._buildAction(f,u,"RowListener").call(f,d));else{y=i.startRow+(i.startRowRelative?n:0),v=i.startColumn+(i.startColumnRelative?t:0),w=i.endRow+(i.endRowRelative?n:0),k=i.endColumn+(i.endColumnRelative?t:0),ft=Math.abs(w-y)+1,ut=Math.abs(k-v)+1,a=this._getCellCalc(n,t,!0);if(gu(p,b,ft,ut)){it=s._getRangeCalc(!0);if(!it)return;this._buildAction(it,u,"CellListener").call(it,y,v,ft,ut,a)}else for(o=y;o<=w;o++)for(h=v;h<=k;h++)f=s._getCellCalc(o,h,!0),f&&this._buildAction(f,u,"CellListener").call(f,a)}else if(nt===e.row)if(0>n||0>t)(0>n||t!==-1)&&n===-1&&0<=t;else for(y=i.startRow+(i.startRowRelative?n:0),w=i.endRow+(i.endRowRelative?n:0),a=this._getCellCalc(n,t,!0),o=y;o<=w;o++)c=s._getRowCalc(o,!0),c&&
;this._buildAction(c,u,"CellListener").call(c,a);else if(nt===e.column)if(0>n||0>t)(0>n||t!==-1)&&n===-1&&0<=t;else for(v=i.startColumn+(i.startColumnRelative?t:0),k=i.endColumn+(i.endColumnRelative?t:0),a=this._getCellCalc(n,t,!0),h=v;h<=k;h++)l=s._getColumnCalc(h,!0),l&&this._buildAction(l,u,"CellListener").call(l,a);else nt===e.sheet&&(0>n||0>t)&&(0>n||t!==-1)&&n===-1&&0<=t}else if(i instanceof r.UnaryOperatorExpression)this._dealWithExpression(n,t,i.operand,u);else if(i instanceof r.BinaryOperatorExpression)this._dealWithExpression(n,t,i.left,u),this._dealWithExpression(n,t,i.right,u);else if(i instanceof r.NameExpression||i instanceof r.ExternalNameExpression){s=i instanceof r.NameExpression?this:i.source,a=this._getCellCalc(n,t,!0),tt=s._getNameCalc(i.name,!0);if(!tt)return;this._buildAction(tt,u,"CellListener").call(tt,a),this._dealWithExpression(n,t,s.getName(i.na
me,n,t),u)}else if(i instanceof r.FunctionExpression)for(et=i.argCount(),rt=0;rt<et;rt++)this._dealWithExpression(n,t,i.getArg(rt),u)},n.prototype.linkExpression=function(n,t,i){this._dealWithExpression(n,t,i,"add")},n.prototype.unlinkExpression=function(n,t,i){this._dealWithExpression(n,t,i,"remove")},n.prototype._dealWithCellExpression=function(n,t,i,r,u){for(var s=this._sheet._getCalcModel(this._sheetArea),e,o,f=n;f!==-1&&f<n+i;f=s.nextNonNullRow(f))for(e=t;e!==-1&&e<t+r;e=s.nextNonNullColumn(f,e))o=s.getFormula(f,e),o&&u.call(this,f,e,o)},n.prototype.linkCellExpression=function(n,t,i,r){this._dealWithCellExpression(n,t,i,r,this.linkExpression)},n.prototype.unlinkCellExpression=function(n,t,i,r){this._dealWithCellExpression(n,t,i,r,this.unlinkExpression)},n.prototype.linkRowExpression=function(n,t){},n.prototype.unlinkRowExpression=function(n,t){},n.prototype.linkColumnExpression=function(n,t){},n.prototype.unlinkColumnExpressi
on=function(n,t){},n.prototype._addColumnsToDirty=function(n,t){var u=this._sheet._getCalcModel(this._sheetArea),i,r,f;if(u._columnDataArray)for(i=n;i!==-1&&i<n+t&&i<u._columnDataArray.length;i++){r=u._columnDataArray[i];if(!r||!r.columnCalc&&!r.formula)continue;f=this._getColumnCalc(i,!0),this._controller.addDirtyColumn(f)}},n.prototype._addRowsToDirty=function(n,t){var u=this._sheet._getCalcModel(this._sheetArea),i,r,f;if(u._rowDataArray)for(i=n;i!==-1&&i<n+t&&i<u._rowDataArray.length;i++){r=u._rowDataArray[i];if(!r||!r.rowCalc&&!r.formula)continue;f=this._getRowCalc(i,!0),this._controller.addDirtyRow(f)}},n.prototype._addCellsToDirty=function(n,t,i,r){for(var o=this._sheet._getCalcModel(this._sheetArea),f,e,s,u=n;u!==-1&&u<n+i;u=o.nextNonNullRow(u))for(f=t;f!==-1&&f<t+r;f=o.nextNonNullColumn(u,f)){e=o.getNode(u,f,!1);if(!e||!e.cellCalc&&!e.formula)continue;s=this._getCellCalc(u,f,!0),this._c
ontroller.addDirtyCell(s)}this._addRowsToDirty(n,i),this._addColumnsToDirty(t,r)},n.prototype._addDependentsToAdjust=function(n,t,i,r){this._addDependents(n,t,i,r,!0,!1)},n.prototype._iterateEachCell=function(n,t,i,r,u,f,e){for(var s,h,o=t;o!==-1&&o<t+r;o=n.nextNonNullRow(o))for(s=i;s!==-1&&s<i+u;s=n.nextNonNullColumn(o,s))h=this._getCellCalc(o,s,!1),h&&(f&&h.addListenersToAdjust(),e&&h.addListenersToDirty())},n.prototype._iterateEachRow=function(n,t,i,r,u){var f,e,o;if(n._rowDataArray)for(f=t;f!==-1&&f<t+i&&f<n._rowDataArray.length;f++){e=n._rowDataArray[f];if(!e||!e.rowCalc)continue;o=e.rowCalc,r&&o.addListenersToAdjust(),u&&o.addListenersToDirty()}},n.prototype._iterateEachColumn=function(n,t,i,r,u){var f,e,o;if(n._columnDataArray)for(f=t;f!==-1&&f<t+i&&f<n._columnDataArray.length;f++){e=n._columnDataArray[f];if(!e||!e.columnCalc)continue;o=e.columnCalc,r&&o.addListen
ersToAdjust(),u&&o.addListenersToDirty()}},n.prototype._addDependents=function(n,t,i,r,u,f){var e,s,o;(u||f)&&(e=this._sheet._getCalcModel(this._sheetArea),0>n||0>t?0>n||t!==-1?n!==-1||0>t?n===-1&&t===-1&&(s=this.getRowCount(),o=this.getColumnCount(),this._iterateEachCell(e,0,0,s,o,u,f),this._iterateEachRow(e,0,s,u,f),this._iterateEachColumn(e,0,o,u,f),this._rangeCalc&&(u&&this._rangeCalc.addListenersToAdjust(n,t,i,r),f&&this._rangeCalc.addListenersToDirty(n,t,i,r))):(this._iterateEachCell(e,0,t,this.getRowCount(),r,u,f),this._iterateEachColumn(e,t,r,u,f),this._rangeCalc&&(u&&this._rangeCalc.addListenersToAdjust(n,t,i,r),f&&this._rangeCalc.addListenersToDirty(n,t,i,r))):(this._iterateEachCell(e,n,0,i,this.getColumnCount(),u,f),this._iterateEachRow(e,n,i,u,f),this._rangeCalc&&(u&&this._rangeCalc.addListenersToAdjust(n,t,i,r),f&&this._rangeCalc.addListenersToDirty(n,t,i,
r))):(this._iterateEachCell(e,n,t,i,r,u,f),this._iterateEachRow(e,n,i,u,f),this._iterateEachColumn(e,t,r,u,f),this._rangeCalc&&(u&&this._rangeCalc.addListenersToAdjust(n,t,i,r),f&&this._rangeCalc.addListenersToDirty(n,t,i,r))))},n.prototype._addCellsToAdjust=function(n,t,i,r){for(var o=this._sheet._getCalcModel(this._sheetArea),f,e,s,u=n;u!==-1&&u<n+i;u=o.nextNonNullRow(u))for(f=t;f!==-1&&f<t+r;f=o.nextNonNullColumn(u,f)){e=o.getNode(u,f,!1);if(!e||!e.cellCalc&&!e.formula)continue;e.cellCalc&&(e.cellCalc=null),s=this._getCellCalc(u,f,!0),this._controller.addAdjustCell(s)}},n.prototype._addColumnsToAdjust=function(n,t){var u=this._sheet._getCalcModel(this._sheetArea),i,r,f;if(u._columnDataArray)for(i=n;i!==-1&&i<n+t&&i<u._columnDataArray.length;i++){r=u._columnDataArray[i];if(!r||!r.columnCalc&&!r.formula)continue;f=this._getColumnCalc(i,!0),this._controller.addAdjustColumn(f)}},n.prototype._a
ddRowsToAdjust=function(n,t){var u=this._sheet._getCalcModel(this._sheetArea),i,r,f;if(u._rowDataArray)for(i=n;i!==-1&&i<n+t&&i<u._rowDataArray.length;i++){r=u._rowDataArray[i];if(!r||!r.rowCalc&&!r.formula)continue;f=this._getRowCalc(i,!0),this._controller.addAdjustRow(f)}},n.prototype._getCellCalc=function(n,t,i){var u=null,f,r;return n<0||t<0||(f=this._sheet._getCalcModel(this._sheetArea),r=f.getNode(n,t,i),r&&(u=r.cellCalc,!u&&i&&(r.cellCalc=u=new cf(this,n,t)))),u},n.prototype._getRowCalc=function(n,t){var r=null,u,i;return n<0||(u=this._sheet._getCalcModel(this._sheetArea),i=u.getNode(n,-1,t),i&&(r=i.rowCalc,!r&&t&&(i.rowCalc=r=new of(this,n)))),r},n.prototype._getColumnCalc=function(n,t){var r=null,u,i;return n<0||(u=this._sheet._getCalcModel(this._sheetArea),i=u.getNode(-1,n,t),i&&(r=i.columnCalc,!r&&t&&(i.columnCalc=r=new sf(this,n)))),r},n.prototype._getRangeCa
lc=function(n){var t=this._sheet._getCalcModel(this._sheetArea);return!t._rangeCalc&&n&&(t._rangeCalc=new nf(this)),t._rangeCalc},n.prototype._getNameCalc=function(n,t){var r=null,i,u;return this._sheet.getCustomName(n)?(i=this._sheet._getCalcModel(this._sheetArea),i._names||(i._names={}),r=i._names[n],!r&&t&&(r=i._names[n]=new iu(n))):(u=this._sheet.getCalcService(),u&&u._getNameCalc&&(r=u._getNameCalc(n,t)),r||(i=this._sheet._getCalcModel(this._sheetArea),i._names||(i._names={}),r=i._names[n],!r&&t&&(r=i._names[n]=new iu(n)))),r},n.prototype.recalculateCell=function(n,t){var u=this.getExpression(n,t),r,i;if(u){r=this._sheet.getValue(n,t),i=this._sheet.getCalcService().evaluateParsedFormula(this,u,n,t);if(r===i)return;else if(r instanceof Date&&i instanceof Date)if(r.valueOf()===i.valueOf())return;this._sheet._getModel().setValue(n,t,i)}},n.prototype.shareCalculations=function(n){if(this._controller===n._contro
ller)return;this._controller.detachDataModel(this);if(this._controller._dataModels.length>0){var t=this._controller._dataModels[0];t&&t.shareCalculations(n)}n._controller.addCustomFunctions(this._controller._customFunctions),n._controller.addCustomNames(this._controller._customNames),this._controller=n._controller,this._controller.attachDataModel(this)},n.prototype.unshareCalculations=function(){this._addCellsToAdjust(0,0,this.getRowCount(),this.getColumnCount()),this._addRowsToAdjust(0,this.getRowCount()),this._addColumnsToAdjust(0,this.getColumnCount()),this._addDependentsToAdjust(-1,-1,-1,-1),this._controller.adjustFormulasOnRemoveSheet(this),this._controller.autoCalculation&&this._controller.recalculate(),this._controller.detachDataModel(this),this._controller=new ii,this._controller.attachDataModel(this)},n}(),i._SheetSource=ar,uu=function(){function t(n){this.context=n,this.parser=new p,this.evaluator=new vi,this.useR1C1=!1,this._suspended=0}return t.prototy
pe.contextChanged=function(){this.cachedContexts=null},t.prototype._getExternalSource=function(t,i){var r,u,f;if(!this.context)return null;if(t&&(!(this.context instanceof n.spread.Spread)||this.context.name!==t))return null;r=this.getSheetContexts();if(r&&r.length>0)for(u=0;u<r.length;u++){f=r[u];if(gt(f.name,i))return f.target._getSheetSource()}return null},t.prototype._getExternalSourceToken=function(n){return n._sheet._name},t.prototype._getParserContext=function(n,t){var i=new vt(this.useR1C1,n,t,null),r=this;return i.getExternalSource=function(n,t){return r._getExternalSource(n,t)},i.getExternalSourceToken=function(n){return r._getExternalSourceToken(n)},i},t.prototype._getEvaluatorContext4Cell=function(n,t,i,r){return new si(n._getSheetSource(),r,t,i)},t.prototype._getEvaluatorContext4Range=function(n,t,i,r,u,f){return new si(n._getSheetSource(),f,t,i,r,u)},t.prototype.getSheetContexts=function(){return this.cachedContexts||this.createSheetContexts(),thi
s.cachedContexts},t.prototype.createSheetContexts=function(){if(!this.context)return;this.cachedContexts=this.context._getCalcContexts()},t.prototype.parse=function(n,t,i){var r=this._getParserContext(t,i);return r.row=t,r.column=i,this.parser.parse(n,r)},t.prototype.unparse=function(n,t,i){var r=this._getParserContext(t,i);return r.row=t,r.column=i,this.parser.unparse(n,r)},t.prototype.evaluateParsedFormula=function(n,t,i,r,u){var l=this._getEvaluatorContext4Cell(n._sheet,i,r,u),f=this.evaluator.evaluateExpression(t,l),s,e,h,c;if(u)return f;if(f instanceof w){s=f.getRowCount(0),e=f.getColumnCount(0);if(f.getRangeCount()>0&&s>0&&e>0)if(f.getRangeCount()!==1||s>1&&e>1)return v;else try{return h=i-f.getRow(0),c=r-f.getColumn(0),s===1&&e===1?f.getValue(0,0,0):s===1&&e>1&&c>=0&&c<e?f.getValue(0,0,c):s>1&&e===1&&h>=0&&h<s?f.getValue(0,h,0):v}catch(y){return v}else return o}els
e if(f instanceof a)return f.getValueByIndex(0);return f},t.prototype.evaluate=function(n,t,i,r){return this.evaluator.evaluateFormula(t,this._getParserContext(i,r),this._getEvaluatorContext4Cell(n._sheet,i,r,!1))},t.prototype.recalculate=function(n,t,i){var u=n.target,r;u&&(r=u._getSheetSource(),r&&(r._addCellsToDirty(t,i,1,1),this._suspended===0&&r._controller.recalculate()))},t.prototype.recalculateAll=function(n){var e=this.getSheetContexts(),r,i,t,f,u;if(e)for(r=0;r<e.length;r++)i=e[r].target,i&&(t=i._getSheetSource(),t&&(n!==!1&&(f=i.getColumnCount(),u=i.getRowCount(),t._addColumnsToDirty(0,f),t._addRowsToDirty(0,u),t._addCellsToDirty(0,0,u,f)),this._suspended===0&&t._controller.recalculate()))},t.prototype.suspend=function(){this._suspended++},t.prototype.resume=function(){this._suspended--,this._suspended<0&&(this._suspended=0),this._suspended===0&&this.recalculateAll(!1)},t.prototype.IsSuspended=f
unction(){return this._suspended>0},t}(),i.Service=uu})(t.Calc||(t.Calc={}));var i=t.Calc})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(t){(function(i){(function(r){function oi(n,i,u){var f,e;if(n===undefined||n===null)throw t._StringResource.Exp_InvalidFunctionName;n=n.toUpperCase();if(r.Functions._builtInFunctions.hasOwnProperty(n)){f=r.Functions._builtInFunctions[n];if(f){if(!u||!u.override)throw t._StringResource.Exp_OverrideNotAllowed;}else r.Functions._builtInFunctions[n]=new r.Functions.Function(n,0,255),f=r.Functions[n.toUpperCase()]}else f=new r.Functions.Function(n,0,255),r.Functions._builtInFunctions[n]=f;i&&typeof i=="function"&&(f.evaluate=i);if(u)for(e in u)u.hasOwnProperty(e)&&e!=="override"&&(f[e]=u[e]);return f}function u(n){return!0}function ht(n){return n!==0}function o(n){return n===1}function e(n){return n===2}function st(n){return n===0||n===2}function ct(n)
{return n===0||n%2==1}function k(n){return n===3}function c(){return!0}function a(n){return n===1||n===2}function si(){return!0}function ot(n){return n===0}function y(n,i,r){var h=t.Calc.Convert,u,f,e,o,s;if(h.isError(n))return r.value=n,!1;else if(h._isCalcReference(n)){for(u=0;u<n.getRangeCount();u++)for(f=0;f<n.getRowCount(u);f++)for(e=0;e<n.getColumnCount(u);e++)if(n instanceof t.Calc._SheetRangeReference){for(o=0;o<n.getSheetCount();o++)if(r.includeSubtotal||!n.isSubtotal(o,u,f,e))if(i(n.getValue(o,u,f,e),r)===!1)return!1}else if(r.includeSubtotal||!n.isSubtotal(u,f,e))if(i(n.getValue(u,f,e),r)===!1)return!1}else if(h._isCalcArray(n)){for(s=0;s<n.length();s++)if(i(n.getValueByIndex(s),r)===!1)return!1}else if(pt.isArray(n))pt.each(n,function(n,t){return i(t,r)});else if(i(n,r)===!1)return!1;return!0}function fi(){return 0}function wi(n){var r=t.Calc.Convert,i;if(r.isError(n))return-1;i=!1;try{i=r.toBool(n)}catch(u){}return i?1:2}function et(n){return n>0}funct
ion vi(n){return n===1}function vt(n){return n===1||n===2||n===3}function nu(n){return n===2}function sr(n){return n===0||n===2}function yr(n){return n===0||n===1}function rh(n){return n===0||n%2==1}function tt(n){return n===0}function d(n){return n===0||n===1||n===2}function ih(n){return n%2==0}function ps(n){return n===3}function it(n){return n!==3}function lh(n){return n===3||n===4}function bh(n){return n!==1}function io(n){return n===3||n===4}function oo(n){return n>0}function ve(n){return n===4}function ce(n){return n===4||n===5}function we(n){return n===5}function ns(n){return n===6}function vo(n){return n===8}function ao(n){return n===7}function co(n){return n!==2}function wo(n){return n===5||n===6}function po(n){return n===4||n===6||n===7}function bo(n){return n===3||n===4||n===5}function go(n){return n>=1}function ko(n){return n===2||n===3||n===4}function lo(n){return n===1||n===2||n===3}function yo(n){if(n===""||n===undefined||n===null)return n;for(var t in
v)v.hasOwnProperty(t)&&(n=n.replace(v[t],v[t].source));return n=n.replace("~?","{113E2532-EAF5-444c-A5CB-3D7446971C4D}"),n=n.replace("~*","{E21523B3-0F1F-458f-B547-23D25713D0EC}"),n=n.replace("?","."),n=n.replace("*","((.|\\n)*)"),n=n.replace("{113E2532-EAF5-444c-A5CB-3D7446971C4D}","\\?"),n=n.replace("{E21523B3-0F1F-458f-B547-23D25713D0EC}","\\*"),n.toString()}function os(n){var r,i=t.Calc.Convert;return isNaN(r=i.toDouble(n[0]))?t.Calc.Errors.Value:i.toResult(Math.abs(r))}function es(n){var i=parseFloat(n[0]);return i===undefined||i===null?t.Calc.Errors.Value:r.Functions._MathHelper.approxFloor(i)}function ss(n){var f=t.Calc.Convert,u=f.toDouble(n[0]),i=f.toDouble(n[1]);return isNaN(u)||isNaN(i)?t.Calc.Errors.Value:u===0||i===0?0:u>0&&i<0?t.Calc.Errors.Number:u<0&&0<i?(i=-i,r.Functions._MathHelper.approxFloor(u/i)*i):r.Functio
ns._MathHelper.approxCeiling(u/i)*i}function cs(n){var u=parseFloat(n[0]),i=parseFloat(n[1]),f,r;if(isNaN(u)||isNaN(i))return t.Calc.Errors.Value;if(u<0||i<0||u<i)return t.Calc.Errors.Number;for(f=1,i=Math.min(u-i,i),r=1;r<=i;r++)f*=u-r+1,f/=r;return t.Calc.Convert.toResult(f)}function hs(n){var i;return isNaN(i=parseFloat(n[0]))?t.Calc.Errors.Value:180*i/Math.PI}function is(n){var t=parseFloat(n[0]);return t<0?(t=Math.floor(t),t%2!=0&&(t-=1)):(t=Math.ceil(t),t%2!=0&&(t+=1)),t}function ts(n){var r=parseInt(n[0],10),u=1,i;if(isNaN(r))return t.Calc.Errors.Value;if(r<0||170<r)return t.Calc.Errors.Number;for(i=1;i<=r;i++)u*=i;return u}function rs(n){var r=parseInt(n[0],10),u=1,i;if(isNaN(r))return t.Calc.Errors.Value;if(r<0||300<r)return t.Calc.Errors.Number;for(i=r;i>1;i-=2)u*=i;return u}function fs(n){var i=parseFloat(n[0]);return i===undefined||i===null?t.Calc.Errors.Value:i<=0?t.Calc.Errors.Number:t.Calc.Convert.toResult(Math.log(i
))}function us(n){var i=parseFloat(n[0]),t=parseFloat(n[1]);return t===0?"#DIV/0!":i-t*Math.floor(i/t)}function ho(n){var t=parseFloat(n[0]);return t<0?(t=Math.floor(t),t%2==0&&(t-=1)):(t=Math.ceil(t),t%2==0&&(t+=1)),t}function pe(n){return Math.PI}function ye(n){var i=parseFloat(n[0]),t=parseFloat(n[1]);return Math.pow(i,t)}function ft(n,i){var u=t.Calc.Convert,r;if(u.isError(n))return i.value=n,!1;else if(u._isCalcReference(n)||u._isCalcArray(n)||pt.isArray(n))return y(n,ft,i);else r=parseFloat(n),!isNaN(r)&&isFinite(n)&&(i.value+=r);return!0}function ke(n){var r,i;if(!n||n.length<1)throw t._StringResource.Exp_InvalidArgument;for(r={value:0,includeSubtotal:!0},i=0;i<n.length;i++)if(y(n[i],ft,r)===!1)break;return r.value}function be(n){var t=parseFloat(n[0]);return t>0?1:t===0?0:-1}function rt(n,t){while(t!==0){var i=n%t;n=t,t=i}return n}function he(n){for(var r=0,l=n.length,e=t.Calc.Convert,s=t.Calc._ArrayHelper,c,f,u,h,o,i=0;i
<l;i++){if(e.isError(n[i]))return n[i];if(s.isArrayOrReference(n[i]))for(c=s.getLength(n[i]),f=0;f<c;f++){u=s.getValueByIndex(n[i],f);if(e.isError(u))return u;else{h=e.toInt(u);if(h<0)return t.Calc.Errors.Number;r=rt(r,h)}}else{o=e.toInt(n[i]);if(o<0)return t.Calc.Errors.Number;r=rt(r,o)}}return r}function le(n){for(var h=1,s=[],o=t.Calc.Convert,c=t.Calc._ArrayHelper,u,f,e,r,i=0;i<n.length;i++){if(o.isError(n[i]))return n[i];if(c.isArrayOrReference(n[i]))for(u=0;u<c.getLength(n[i]);u++){f=c.getValueByIndex(n[i],u);if(o.isError(f))return f;else s.push(o.toInt(f))}else s.push(o.toInt(n[i]));for(e=0;e<s.length;e++){r=s[e];if(r<0)return t.Calc.Errors.Number;else if(r===0)return 0;h/=rt(h,r),h*=r}}return h}function dt(n,i){for(var v=1,a=0,o=t.Calc.Convert,c,l,e,u,f,y,s,h,r=0;r<n.length;r++){if(o.isError(n[r]))return n[r];if(o._isCalcArray(n[r]))for(l=n[r].getColumnCount(),c=n[r].getRowCount(),u=0;u<l;u++)for(e=0;e<c;e++){f=n[r].getValue(e,u);if(o.isNumber
(f))v*=o.toDouble(f),a++;else if(o.isError(f))return f}else if(o._isCalcReference(n[r]))for(y=n[r].getRangeCount(),l=0,c=0,s=0;s<y;s++)for(l=n[r].getColumnCount(s),u=0;u<l;u++)for(c=n[r].getRowCount(s),e=0;e<c;e++){if(n[r]instanceof t.Calc._SheetRangeReference)for(h=0;h<n[r].getSheetCount();h++)(i||!n[r].isSubtotal(h,s,e,u))&&(f=n[r].getValue(h,s,e,u));else(i||!n[r].isSubtotal(s,e,u))&&(f=n[r].getValue(s,e,u));if(o.isNumber(f))v*=o.toDouble(f),a++;else if(o.isError(f))return f}else{if(isNaN(o.toDouble(n[r])))return t.Calc.Errors.Value;v*=n[r],a++}}return o.toResult(a>0?v:0)}function ae(n){return dt(n,!0)}function de(n){var i=parseFloat(n[0]);return i<0?t.Calc.Errors.Number:Math.sqrt(i)}function fo(n){var r=t.Calc.Convert,u,i;if(r.isError(n[0]))return n[0];if(r.isError(n[1]))return n[1];return u=r.toDouble(n[0]),i=r.toDouble(n[1]),isNaN(u)||isNaN(i)?t.Calc.Errors.Value:i===0?t.Calc.Errors.DivideByZero:parseInt((u/i).toString(),10)}function uo(n){for(
var i=t.Calc.Convert.toInt(n[0]),r=[],s,u,o,e,f=1;f<n.length;f++)r[f-1]=n[f];s=t.Calc.Functions,u=s._StatHelper;if(i===1||i===101)return u.__averageIncludeSubtotals(r,!1);else if(i===2||i===102)return u.__countIncludeSubtotals(r,!1);else if(i===3||i===103)return u.__countaIncludeSubtotals(r,!1);else if(i===4||i===104)return u.__maxIncludeSubtotals(r,!1);else if(i===5||i===105)return u.__minIncludeSubtotals(r,!1);else if(i===6||i===106)return dt(r,!1);else if(i===7||i===107)return u.__stdevIncludeSubtotals(r,!1);else if(i===8||i===108)return u.__stdevpIncludeSubtotals(r,!1);else if(i===9||i===109){if(!r||r.length<1)throw t._StringResource.Exp_InvalidArgument;for(o={value:0,includeSubtotal:!1},e=0;e<r.length;e++)if(y(r[e],ft,o)===!1)break;return o.value}else if(i===10||i===110)return u.__varrIncludeSubtotals(r,!1);else if(i===11||i===111)return u.__varpIncludeSubtotals(r,!1);return t.Calc.Errors.Value}function eo(n){var e=t.Calc.Convert,u=e.toDouble(n[0]),i=e.toDouble(n[1]),f
;if(isNaN(u)||isNaN(i))return t.Calc.Errors.Value;if(u===0||i===0)return 0;if(u>0&&i<0)return t.Calc.Errors.Number;return f=r.Functions._MathHelper,u<0&&0<i?(i=-i,f.approxCeiling(u/i)*i):f.approxFloor(u/i)*i}function so(n){var f=t.Calc.Convert,u=f.toDouble(n[0]),i=f.toDouble(n[1]);return isNaN(u)||isNaN(i)?t.Calc.Errors.Value:u===0||i===0?0:u<0&&0<i||i<0&&0<u?t.Calc.Errors.Number:r.Functions._MathHelper.approxFloor(u/i+.5)*i}function nt(n){var f=t.Calc.Convert,i=f.toDouble(n[0]);if(isNaN(i))return t.Calc.Errors.Value;var o=f.toInt(n[1]),e=r.Functions._MathHelper,u=e.pow10(Math.abs(o));return o<0?i/=u:i*=u,i=i<0?e.approxCeiling(i-.5):e.approxFloor(i+.5),o<0?i*=u:i/=u,f.toResult(i)}function no(n){var f=t.Calc.Convert,i=f.toDouble(n[0]);if(isNaN(i))return t.Calc.Errors.Value;var o=f.toInt(n[1]),e=r.Functions._MathHelper,u=e.pow10(Math.abs(o));return o<0?i/=u:i*=u,i=i<0?e.approxCeiling(i):e.approxFloor(i),o<0?i*=u
:i/=u,f.toResult(i)}function ge(n){var f=t.Calc.Convert,i=f.toDouble(n[0]);if(isNaN(i))return t.Calc.Errors.Value;var o=f.toInt(n[1]),e=r.Functions._MathHelper,u=e.pow10(Math.abs(o));return o<0?i/=u:i*=u,i=i<0?e.approxFloor(i):e.approxCeiling(i),o<0?i*=u:i/=u,f.toResult(i)}function to(n){var f=t.Calc.Convert,i=f.toDouble(n[0]);if(isNaN(i))return t.Calc.Errors.Value;var o=t.Calc._Helper._argumentExists(n,1)?f.toInt(n[1]):0,e=r.Functions._MathHelper,u=e.pow10(Math.abs(o));return o<0?i/=u:i*=u,i=i<0?e.approxCeiling(i):e.approxFloor(i),o<0?i*=u:i/=u,f.toResult(i)}function ro(n){var r,i=t.Calc.Convert;return isNaN(r=i.toDouble(n[0]))?t.Calc.Errors.Value:i.toResult(Math.exp(r))}function tc(n){var r=t.Calc.Convert,u=r.toDouble(n[0]),i;if(isNaN(u))return t.Calc.Errors.Value;if(t.Calc._Helper._argumentExists(n,1)){i=r.toDouble(n[1]);if(isNaN(i))return t.Calc.Errors.Value}else i=10;return u<=0||i<=0?t.Calc.Errors.Number:i===1?t.Calc.Errors.DivideByZero:r.toResult(l.log
(u,i))}function kh(n){var r=t.Calc.Convert,i=r.toDouble(n[0]);return isNaN(i)?t.Calc.Errors.Value:i<=0?t.Calc.Errors.Number:r.toResult(l.log10(i))}function w(n,i,u){var c=0,o,h,e;if(n===undefined||n===null)return c;var s=t.Calc.Convert,f=t.Calc._ArrayHelper,l=r.Functions._MathHelper.parseCriteria(n);if(f.getRowCount(i)!==f.getRowCount(u)||f.getColumnCount(i)!==f.getColumnCount(u))return t.Calc.Errors.Value;for(o=0;o<f.getLength(i);o++){h=f.getValueByIndex(i,o);if(s.isError(h))return h;if(l&&l(h)){e=f.getValueByIndex(u,o);if(s.isNumber(e))c+=s.toDouble(e);else if(s.isError(e))return e}}return s.toResult(c)}function dh(n){var h=n[0],c=n[1],u,l,e,f;if(c===undefined||c===null)throw t._StringResource.Exp_CriteriaIsNull;var s=t.Calc._Helper._argumentExists(n,2)?n[2]:n[0],a=t.Calc.Convert,i=n[1],o,r;if(a._isCalcReference(i))return o=i.getRowCount(0),r=i.getColumnCount(0),o===1&&r===1?w(i.getValue(0,0,0),h,s):new t.Calc._TernaryCompositeConcreteReference(i.getSource(),
i.getRow(0),i.getColumn(0),o,r,w,h,s);u=n[1];if(a._isCalcArray(u)){for(o=u.getRowCount(),r=u.getColumnCount(),l=new t.Calc._ConcreteArray(u,r),e=0;e<o;e++)for(f=0;f<r;f++)l._array[e][f]=w(u.getValue(e,f),h,s);return l}return w(c,h,s)}function nc(n){var r,u,i;if(n.length<3||n.length%2!=1)return!1;for(r=t.Calc._ArrayHelper.getRowCount(n[0]),u=t.Calc._ArrayHelper.getColumnCount(n[0]),i=1;i<n.length;i=i+2){if(r!==t.Calc._ArrayHelper.getRowCount(n[i]))return!1;if(u!==t.Calc._ArrayHelper.getColumnCount(n[i]))return!1}return!0}function gh(n){var u,o,i,f;if(!nc(n))return t.Calc.Errors.Value;var c=0,a=n[0],e=t.Calc.Convert,s=t.Calc._ArrayHelper,v=s.getLength(n[0]);for(u=0;u<v;u++){for(o=!0,i=1;i<n.length;i=i+2){var y=n[i],p=n[i+1],h=r.Functions._MathHelper.parseCriteria(p),l=s.getValueByIndex(y,u);o=h&&h(l);if(!o)break}if(o){f=s.getValueByIndex(a,u);if(e.isNumber(f))c+=e.toDouble(f);else if(e.isError(f))return f}}return e.toResult(c)}function vh(n){for(var l=0,h=t.C
alc.Convert,u=t.Calc._ArrayHelper,a=u.getRowCount(n[0]),c=u.getColumnCount(n[0]),s,e,o,f,i,r=1;r<n.length;r++){if(a!==u.getRowCount(n[r]))return t.Calc.Errors.Value;if(c!==u.getColumnCount(n[r]))return t.Calc.Errors.Value}for(s=0;s<a;s++)for(e=0;e<c;e++){for(o=1,f=0;f<n.length;f++){i=u.getValue(n[f],s,e);if(h.isError(i))return i;else h.isNumber(i)?o*=h.toDouble(i):o=0}l+=o}return h.toResult(l)}function ah(n){for(var u,o=0,r=t.Calc.Convert,s=t.Calc._ArrayHelper,e,f,i=0;i<n.length;i++){if(r.isError(n[i]))return n[i];if(s.isArrayOrReference(n[i]))for(e=0;e<s.getLength(n[i]);e++){f=s.getValueByIndex(n[i],e);if(r.isNumber(f))u=r.toDouble(f),o+=u*u;else if(r.isError(f))return f}else{if(isNaN(u=r.toDouble(n[i])))return t.Calc.Errors.Value;o+=u*u}}return r.toResult(o)}function yh(n){var h=0,f,u,i=t.Calc.Convert,r=t.Calc._ArrayHelper,s,e,o;if(r.getLength(n[0])!==r.getLength(n[1]))return t.Calc.Errors.NotAvailable;if(i.isError(n[0]))return n[0];if(i.isError(n[1]))return n[1]
;if(r.isArrayOrReference(n[0]))for(s=0;s<r.getLength(n[0]);s++){e=r.getValueByIndex(n[0],s),o=r.getValueByIndex(n[1],s);if(i.isNumber(e)&&i.isNumber(o))f=i.toDouble(e),u=i.toDouble(o),h+=f*f-u*u;else if(i.isError(e))return e;else if(i.isError(o))return o}else{if(isNaN(f=i.toDouble(n[0]))||isNaN(u=i.toDouble(n[1])))return t.Calc.Errors.Value;h+=f*f-u*u}return h}function wh(n){var h=0,f,u,i=t.Calc.Convert,r=t.Calc._ArrayHelper,s,e,o;if(r.getLength(n[0])!==r.getLength(n[1]))return t.Calc.Errors.NotAvailable;if(i.isError(n[0]))return n[0];if(i.isError(n[1]))return n[1];if(r.isArrayOrReference(n[0]))for(s=0;s<r.getLength(n[0]);s++){e=r.getValueByIndex(n[0],s),o=r.getValueByIndex(n[1],s);if(i.isNumber(e)&&i.isNumber(o))f=i.toDouble(e),u=i.toDouble(o),h+=f*f+u*u;else if(i.isError(e))return e;else if(i.isError(o))return o}else{if(isNaN(f=i.toDouble(n[0]))||isNaN(u=i.toDouble(n[1])))return t.Calc.Errors.Value;h+=f*f+u*u}return i.toResult(h)}function ph(n){var h=0,f,u,i=
t.Calc.Convert,r=t.Calc._ArrayHelper,s,e,o;if(r.getLength(n[0])!==r.getLength(n[1]))return t.Calc.Errors.NotAvailable;if(i.isError(n[0]))return n[0];if(i.isError(n[1]))return n[1];if(r.isArrayOrReference(n[0]))for(s=0;s<r.getLength(n[0]);s++){e=r.getValueByIndex(n[0],s),o=r.getValueByIndex(n[1],s);if(i.isNumber(e)&&i.isNumber(o))f=i.toDouble(e),u=i.toDouble(o),h+=(f-u)*(f-u);else if(i.isError(e))return e;else if(i.isError(o))return o}else{if(isNaN(f=i.toDouble(n[0]))||isNaN(u=i.toDouble(n[1])))return t.Calc.Errors.Value;h+=(f-u)*(f-u)}return i.toResult(h)}function fc(n){var o,s,c,i=t.Calc.Convert,h=t.Calc._ArrayHelper,f,u,r,e;if(isNaN(o=i.toDouble(n[0]))||isNaN(c=i.toInt(n[1]))||isNaN(s=i.toInt(n[2])))return t.Calc.Errors.Value;for(f=n[3],u=0,r=0;r<h.getLength(f);r++){if(isNaN(e=i.toDouble(h.getValueByIndex(f,r))))return t.Calc.Errors.Value;u+=e*Math.pow(o,c+r*s)}return i.toResult(u)}function sc(n){var i,r=t.Calc.Convert;return isNaN(i=r.toDouble(n[0]))?t.Calc.Errors.V
alue:i<0?t.Calc.Errors.Number:r.toResult(Math.sqrt(i*Math.PI))}function oc(n){var i;return isNaN(i=t.Calc.Convert.toDouble(n[0]))?t.Calc.Errors.Value:Math.PI*i/180}function hc(n){var r,i=t.Calc.Convert;return isNaN(r=i.toDouble(n[0]))?t.Calc.Errors.Value:i.toResult(Math.cos(r))}function lc(n){var i,r=t.Calc.Convert;return isNaN(i=r.toDouble(n[0]))?t.Calc.Errors.Value:i<-1||1<i?t.Calc.Errors.Number:r.toResult(Math.acos(i))}function cc(n){var i,r=t.Calc.Convert;return isNaN(i=r.toDouble(n[0]))?t.Calc.Errors.Value:r.toResult((Math.exp(i)+Math.exp(-i))/2)}function rc(n){var i,r=t.Calc.Convert;return isNaN(i=r.toDouble(n[0]))?t.Calc.Errors.Value:i<1?t.Calc.Errors.Number:r.toResult(Math.log(i+Math.sqrt(i*i-1)))}function ic(n){var r,i=t.Calc.Convert;return isNaN(r=i.toDouble(n[0]))?t.Calc.Errors.Value:i.toResult(Math.sin(r))}function uc(n){var i,r=t.Calc.Convert;return isNaN(i=r.toDouble(n[0]))?t.Calc.Errors.Value:i<-1||1<i?t.Calc.Errors.Number:r.toResult(Math.asin(i))}fu
nction ec(n){var i,r=t.Calc.Convert;return isNaN(i=r.toDouble(n[0]))?t.Calc.Errors.Value:r.toResult((Math.exp(i)-Math.exp(-i))/2)}function gu(n){var i,r=t.Calc.Convert;return isNaN(i=r.toDouble(n[0]))?t.Calc.Errors.Value:r.toResult(Math.log(i+Math.sqrt(i*i+1)))}function bs(n){var r,i=t.Calc.Convert;return isNaN(r=i.toDouble(n[0]))?t.Calc.Errors.Value:i.toResult(Math.tan(r))}function ws(n){var r,i=t.Calc.Convert;return isNaN(r=i.toDouble(n[0]))?t.Calc.Errors.Value:i.toResult(Math.atan(r))}function ks(n){var u,r,i=t.Calc.Convert;return isNaN(u=i.toDouble(n[0]))||isNaN(r=i.toDouble(n[1]))?t.Calc.Errors.Value:u===0&&r===0?t.Calc.Errors.DivideByZero:i.toResult(Math.atan2(r,u))}function gs(n){var u,f=t.Calc.Convert,i,r;return isNaN(u=f.toDouble(n[0]))?t.Calc.Errors.Value:(i=Math.exp(u),r=Math.exp(-u),f.toResult(i-r)/(i+r))}function ds(n){var i,r=t.Calc.Convert;return isNaN(i=r.toDouble(n[0]))?t.Calc.Errors.Value:i<=-1||1<=i?t.Calc.Errors.Number:r.toResult(Math.log((1+i)/(1-i
))/2)}function as(n){var y=t.Calc.Convert,v=y._toArray(n[0]),u,r,s,l,c,w,i,p,o,f,b,e,k,h,a;if(v.getRowCount()!==v.getColumnCount())return t.Calc.Errors.Value;for(u=v.getRowCount(),r=[],s=0;s<u;s++)for(r[s]=[u],l=0;l<u;l++){c=v.getValue(s,l);if(y.isError(c))return c;if(!y.isNumber(c))return t.Calc.Errors.Value;r[s][l]=y.toDouble(c)}for(w=1,i=0;i<u-1;i++){if(r[i][i]===0){for(p=!1,o=i+1;!p&&o<u;o++)if(r[o][i]!==0){for(f=i;f<u;f++)b=r[i][f],r[i][f]=r[o][f],r[o][f]=b;w*=-1,p=!0}if(!p)return 0}for(e=i+1;e<u;e++)if(r[e][i]!==0)for(k=r[e][i]/r[i][i],h=i;h<u;h++)r[e][h]-=k*r[i][h]}for(a=0;a<u;a++)w*=r[a][a];return w}function ls(n){var d=t.Calc.Convert,g=d._toArray(n[0]),l,w,v,a,p,i,nt,o,s,ut,h,it,e,tt,y,b,c,rt,k;if(g.getRowCount()!==g.getColumnCount())return t.Calc.Errors.Value;var r=g.getRowCount(),u=[],f=[];for(l=0;l<r;l++)for(u[l]=[r],w=0;w<r;w++){v=g.getValue(l,w);if(d.isError(v))return v;if(!d.isNumber(v))return t.Calc.Errors.Value;u[l][w]=d.toDoubl
e(v)}for(a=0;a<r;a++)for(f[a]=[r],p=0;p<r;p++)f[a][p]=a===p?1:0;for(i=0;i<r;i++){if(u[i][i]===0){for(nt=!1,o=i+1;!nt&&o<r;o++)if(u[o][i]!==0){for(s=i;s<r;s++)ut=u[i][s],u[i][s]=u[o][s],u[o][s]=ut;for(h=1;h<r;h++)it=f[i][h],f[i][h]=f[o][h],f[o][h]=it;nt=!0}if(!nt)return t.Calc.Errors.Number}for(e=0;e<r;e++)if(e!==i&&u[e][i]!==0){for(tt=u[e][i]/u[i][i],y=i;y<r;y++)u[e][y]-=tt*u[i][y];for(b=0;b<r;b++)f[e][b]-=tt*f[i][b]}}for(c=0;c<r;c++)for(rt=u[c][c],k=0;k<r;k++)f[c][k]/=rt;return new t.Calc._ConcreteArray(f)}function vs(n){var i=t.Calc.Convert,v=i._toArray(n[0]),y=i._toArray(n[1]),nt=v.getRowCount(),g=v.getColumnCount(),d=y.getRowCount(),a=y.getColumnCount(),r,e,s,u,h,o,f,c,p,l;if(g!==d)return t.Calc.Errors.Value;var k=[],b=[],w=[];for(r=0;r<nt;r++)for(k[r]=[g],e=0;e<g;e++){s=v.getValue(r,e);if(i.isError(s))return s;if(!i.isNumber(s))return t.Calc.Errors.Value;k[r][e]=i.toDouble(s)}for(u=0;u<d;u++)for(b[u]=[a],h=0;h<a;h++){
o=y.getValue(u,h);if(i.isError(o))return o;if(!i.isNumber(o))return t.Calc.Errors.Value;b[u][h]=i.toDouble(o)}for(f=0;f<nt;f++)for(w[f]=[a],c=0;c<a;c++){for(p=0,l=0;l<d;l++)p+=k[f][l]*b[l][c];w[f][c]=p}return new t.Calc._ConcreteArray(w)}function ut(n){for(var i=1,t=n;t>1;t--)i*=t;return i}function ys(n){for(var f=0,c=1,s=t.Calc.Convert,h=t.Calc._ArrayHelper,o,e,u,r,i=0;i<n.length;i++){if(s.isError(n[i]))return n[i];if(h.isArrayOrReference(n[i]))for(o=0;o<h.getLength(n[i]);o++){e=h.getValueByIndex(n[i],o);if(s.isError(e))return e;else{u=s.toInt(e);if(u<0||170<u)return t.Calc.Errors.Number;f+=u,c*=ut(u)}}else{r=s.toInt(n[i]);if(r<0||170<r)return t.Calc.Errors.Number;f+=r,c*=ut(r)}}return f<0||170<f?t.Calc.Errors.Number:ut(f)/c}function nh(n){var i=Math.random(),t=-1+i*2;return Math.abs(t)}function oh(n){var i=t.Calc.Convert,r,u,f;return i.isError(n[1])?n[1]:i.isError(n[0])?n[0]:isNaN(r=i.toInt(n[0]))||isNaN(u=i.toInt(n[1]))?t.Calc.Errors.Value:u<
;r?t.Calc.Errors.Number:(f=Math.random(),i.toInt(r+f*(u-r+1)))}function eh(){var n=[];return n.push(new s("M",1e3)),n.push(new s("D",500)),n.push(new s("C",100)),n.push(new s("L",50)),n.push(new s("X",10)),n.push(new s("V",5)),n.push(new s("I",1)),n}function sh(n){var h=t.Calc.Convert,y=t.Calc._Helper,u,s,f,i,r,e,c,v,o,l,a;if(h.isError(n[0]))return n[0];u=h.toInt(n[0]),s=0;if(y._argumentExists(n,1)){if(h.isError(n[1]))return n[1];s=typeof n[1]=="boolean"?n[1]?0:4:h.toInt(n[1])}f=[];if(u<0||3999<u||s<0||4<s)return t.Calc.Errors.Value;for(i=eh(),r=0;r<i.length;r+=2){if(2<=r&&i[r-2].Value-i[r].Value<=u){for(e=r,c=r-2,v=0;v<s&&e+1<i.length&&i[c].Value-i[e+1].Value<=u;v++)e++;f.push(i[e].Key),f.push(i[c].Key),u+=i[e].Value,u-=i[c].Value}1>r||i[r-1].Value>u||(f.push(i[r-1].Key),u-=i[r-1].Value);if(1<=r&&i[r-1].Value-i[r].Value<=u){for(o=
r,l=r-1,a=0;a<s&&o+1<i.length&&i[l].Value-i[o+1].Value<=u;a++)o++;f.push(i[o].Key),f.push(i[l].Key),u+=i[o].Value,u-=i[l].Value}while(i[r].Value<=u)f.push(i[r].Key),u-=i[r].Value}return f.join("")}function ch(n){for(var e=!0,h=t.Calc.Convert,s=t.Calc._ArrayHelper,f,r,u,o,i=0;i<n.length;i++)for(f=n[i],r=0;r<s.getLength(f);r++){u=s.getValueByIndex(f,r);if(u!==undefined&&u!==null){try{o=h.toBool(u)}catch(c){return t.Calc.Errors.Value}e&=o}else return!1}return!!e}function hh(n){for(var e=!1,h=t.Calc.Convert,s=t.Calc._ArrayHelper,f,r,u,o,i=0;i<n.length;i++)for(f=n[i],r=0;r<s.getLength(f);r++){u=s.getValueByIndex(f,r);if(u!==undefined&&u!==null){try{o=h.toBool(u)}catch(c){return t.Calc.Errors.Value}e|=o}}return!!e}function g(n){try{var i=t.Calc.Convert.toBool(n);return!i}catch(r){return t.Calc.Errors.Value}}function th(n){var f=t.Calc.Convert,i,r;if(f._isCalcReference(n[0]))return n[0].getRangeCount()>1?t.Calc.Errors
.Value:new t.Calc._UnaryCompositeConcreteReference(n[0].getSource(),n[0].getRow(0),n[0].getColumn(0),n[0].getRowCount(0),n[0].getColumnCount(0),g);if(f._isCalcArray(n[0])){var u=[],o=n[0].getRowCount(),e=n[0].getColumnCount();for(i=0;i<o;i++)for(u[i]=[e],r=0;r<e;r++)u[i][r]=g(n[0].getValue(i,r));return new t.Calc._ConcreteArray(u)}return g(n[0])}function ni(n,i,r){try{var f=t.Calc.Convert.toBool(n),u=f?i:r;return u!==undefined&&u!==null?u:0}catch(e){return t.Calc.Errors.Value}}function fh(n){var e=n[0],o=n[1],f=t.Calc._Helper,s=f._argumentExists(n,2)?n[2]:!1,i=f.tryExtractToSingleValue(e),l,r,u;if(i.success)return e=i.value,ni(e,o,s);i=f.tryExtractToSingleValue(o),o=i.value,l=i.success,i=f.tryExtractToSingleValue(s),s=i.value;var v=i.success,a=e.getRowCount(),c=e.getColumnCount(),h=[];for(r=0;r<a;r++)for(h[r]=[c],u=0;u<c;u++)h[r][u]=ni(e.getValue(r,u),l?o:f.getArrayValue(o,r,u),v?s:f.getArrayValue(s,r,u));return new t.Calc._ConcreteArray(h)}function uh(n,i){retur
n t.Calc.Convert.isError(n)?i!==undefined&&i!==null?i:0:n!==undefined&&n!==null?n:0}function se(n){var r=t.Calc.Convert,u=r.isError(n[0]),i;return!u&&r._isCalcReference(n[0])?(i=n[0],i.getRangeCount()>1?t.Calc.Errors.Value:new t.Calc._BinaryCompositeConcreteReference(i.getSource(),i.getRow(0),i.getColumn(0),i.getRowCount(0),i.getColumnCount(0),uh,n[1])):u?n[1]!==undefined&&n[1]!==null?n[1]:0:n[0]!==undefined&&n[0]!==null?n[0]:0}function ar(n){return!0}function lr(n){return!1}function vr(n){var r,i,e,f,u;try{r=t.Calc.Convert;if(isNaN(i=r.toInt(n[0]))||isNaN(e=r.toInt(n[1]))||isNaN(f=r.toInt(n[2])))return t.Calc.Errors.Value;if(i<0||9999<i)return t.Calc.Errors.Number;return i>1899||(i+=1900),u=new Date(i,e-1,f),u<new Date(1899,11,30)?t.Calc.Errors.Number:u}catch(o){return t.Calc.Errors.Number}}function pr(i){var e,o,f,u,r;try{u=t.Calc.Convert;if(isNaN(e=u.toInt(i[0]))||isNaN(o=u.toInt(i[1]))||isNaN(f=u.toInt(i[2])))return t.Calc.E
rrors.Value;return r=n.spread._DateTimeHelper.fromOADate(0),r.setHours(e),r.setMinutes(o),r.setSeconds(f),r.setMilliseconds(0),r.getHours()<0&&r.getMinutes()<0&&r.getSeconds()<0?t.Calc.Errors.Number:r}catch(s){return t.Calc.Errors.Number}}function h(n){return n%400==0||n%4==0&&n%100!=0||n===1900}function or(i){var s=t.Calc.Convert.toString(i[0]),o,f,u,e;if(s===undefined||s===null||s==="")return t.Calc.Errors.Value;try{o=n.spread._DateTimeHelper.parseLocale(s),f=o.getFullYear();if(f<1900)return t.Calc.Errors.Value;var c=o.getMonth(),l=o.getDate(),r=0;for(u=1900;u<f;u++)r+=h(u)?366:365;for(e=0;e<c;e++)switch(e){case 0:case 2:case 4:case 6:case 7:case 9:case 11:r+=31;break;case 1:r+=h(f)?29:28;break;case 3:case 5:case 8:case 10:r+=30;break}return r+=l}catch(a){return t.Calc.Errors.Value}}function er(i){try{return n.spread._DateTimeHelper.parseLocale(i)}catch(r){return t.Calc.Errors.Value}}function ti(n){var i=t.Calc.Convert.toString(n
[0]);if(i===undefined||i===null||i==="")return t.Calc.Errors.Value;try{var r=er(i),f=(r.getHours()*60+r.getMinutes())*60+r.getSeconds(),u=86400;return f/u}catch(e){return t.Calc.Errors.Value}}function cr(n){return new Date}function hr(n){var t=new Date;return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t}function wr(n){try{var i=t.Calc.Convert.toDateTime(n[0]);return i.getHours()}catch(r){return t.Calc.Errors.Value}}function iu(n){try{var i=t.Calc.Convert.toDateTime(n[0]);return i.getMinutes()}catch(r){return t.Calc.Errors.Value}}function tu(n){try{var i=t.Calc.Convert.toDateTime(n[0]);return i.getSeconds()}catch(r){return t.Calc.Errors.Value}}function ru(n){try{var i=t.Calc.Convert.toDateTime(n[0]);return i.getDate()}catch(r){return t.Calc.Errors.Value}}function fu(n){try{var i=t.Calc.Convert.toDateTime(n[0]);return i.getMonth()+1}catch(r){return t.Calc.Errors.Value}}function uu(n){try{var i=t.Calc.Convert.toDateTime(n[0]);return i.getFullYear()}cat
ch(r){return t.Calc.Errors.Value}}function kr(n){for(var u=n.getFullYear(),r=n.getMonth(),f=n.getDate(),t=0,i=0;i<r;i++)switch(i){case 0:case 2:case 4:case 6:case 7:case 9:case 11:t+=31;break;case 1:t+=h(u)?29:28;break;case 3:case 5:case 8:case 10:t+=30;break}return t+=f}function br(n,i){var f=kr(n),u=new Date(n.getFullYear(),0,1).getDay(),r;return i===2&&(u-=1,u<0&&(u=6)),r=f-1-(6-u),r<0&&(r=0),1+t.Calc.Convert.toInt(r/7)+(r%7!=0?1:0)}function dr(n){var u,r=t.Calc.Convert,i,e;try{u=r.toDateTime(n[0])}catch(f){return t.Calc.Errors.Value}if(isNaN(i=r.toInt(t.Calc._Helper._argumentExists(n,1)?n[1]:1)))return t.Calc.Errors.Value;switch(i){case 1:case 2:return br(u,i);default:return t.Calc.Errors.Number}}function at(n){var r,u,i;try{r=t.Calc.Convert.toDateTime(n[0])}catch(f){return t.Calc.Errors.Value}if(isNaN(u=t.Calc.Convert.toInt(t.Calc._Helper._argumentExists(n,1)?n[1]:1)))return t.Calc.Errors.Value;switch(u){case 1:i=r.getDay()+1;break;case 2:i=r.ge
tDay()===0?7:r.getDay();break;case 3:i=r.getDay()===0?6:r.getDay()-1;break;default:return t.Calc.Errors.Number}return i}function gr(n){var i,u,r=t.Calc.Convert;try{i=r.toDateTime(n[0])}catch(f){return t.Calc.Errors.Value}return isNaN(u=r.toInt(n[1]))?t.Calc.Errors.Value:(i.setMonth(i.getMonth()+u),i)}function fr(n,t){switch(t){case 0:case 2:case 4:case 6:case 7:case 9:case 11:return 31;case 1:return h(n)?29:28;case 3:case 5:case 8:case 10:return 30}}function yi(n){var i,f,u=t.Calc.Convert,r;try{i=u.toDateTime(n[0])}catch(e){return t.Calc.Errors.Value}return isNaN(f=u.toInt(n[1]))?t.Calc.Errors.Value:(i.setMonth(i.getMonth()+f),r=fr(i.getFullYear(),i.getMonth()),i.setDate(r),i)}function gt(n,t){return n-t}function yt(n,t){for(var u=n.length,r,i=0;i<u;i++){r=n[i];if(gt(r,t)===0)return!0}return!1}function pi(i){for(var e=t.Calc.Convert,a=t.Calc._Helper,l=t.Calc._ArrayHelper,u=e.toDateTime(i[0]),f=e.toInt(i[1]),v=a._argumentExists(i,2)?l.getLength(i[2]):0,c=[],s,h,r,o=0;o<v;o++)c.
push(e.toDateTime(l.getValueByIndex(i[2],o)));s=[],s[0]=u,s[1]=3,h=at(s);if(e.isError(h))return h;for(r=e.toInt(h);f<0;++f){try{u.setDate(u.getDate()-1)}catch(p){return t.Calc.Errors.Number}r===0?r=6:r--,r===5||r===6?f--:yt(c,u)&&f--}for(;f>0;--f){try{u.setDate(u.getDate()+1)}catch(y){return t.Calc.Errors.Number}r===6?r=0:r++,r===5||r===6?f++:yt(c,u)&&f++}return new n.spread._DateTimeHelper(u).toOADate()}function ui(n){var e=t.Calc.Convert,a=t.Calc._Helper,f=e.toDateTime(n[0]),o=e.toDateTime(n[1]),c=a._argumentExists(n,2)?e.toBool(n[2]):!1,i=f.getDate(),r=o.getDate(),l=f.getMonth(),u=o.getMonth(),h=f.getFullYear(),s=o.getFullYear();return c?(r=r===31?30:r,i=i===31?30:i):(i=i===31?30:i,r===31&&(i<30?(r=1,u++,u>12&&(u=1,s++)):r=30)),((s-h)*12+(u-l))*30+(r-i)}function hi(n){return n.getDay()===6||n.getDay()===0}function ai(i,r,u,f){for(var a=t.Calc.Convert,l=t.Calc._Helper,c=t.Calc._ArrayHelper,v=l._argumentExists(i,2)?c.getLength(i[2]):0,s=[
],e,h,o=0;o<v;o++)e=a.toDateTime(c.getValueByIndex(i[2],o)),h=new n.spread._DateTimeHelper(e).toOADate(),yt(s,e)||hi(e)||h<r||h>u||s.push(e);return f-=s.length}function ci(i,r,u){var o=t.Calc.Convert,h=n.spread._DateTimeHelper,f=o.toInt(new h(r).toOADate()-new h(i).toOADate())%7,c=o.toInt(at([i,2])+f),e,s;return f=c>5?c-5:0,e=i.getDay()===0?1:2,f=f>e?e:f,u-=f,s=o.toInt(u/7*2),u-=s}function li(i){var o=t.Calc.Convert,c=n.spread._DateTimeHelper,e=o.toDateTime(i[0]),s=o.toDateTime(i[1]),u=o.toInt(new c(e).toOADate()),f=o.toInt(new c(s).toOADate()),l=!1,a,h,r;return u>f&&(a=e,h=u,u=f,f=h,e=s,s=a,l=!0),r=f-u+1,r=ci(e,s,r),r<=0?0:(r=ai(i,u,f,r),r=l?-r:r)}function ir(i,r,u){var d=t.Calc.Functions,w=d._FinancialHelper,l=t.Calc.Convert,c=w.__days_between_basis(i,r,u),y,b,o,e,f,k,s,v,a,p;return c<0&&(c=-c,b=i,i=r,r=b),u===1?(o=i.getFullYear(),e=r.getFullYear(),f=i,f.setFullYear(f.getFullYear()+1),gt(r,f)>0?(v=e+1-o,f=new Date(o,0,1),k=new Date(e+1,0,
1),a=n.spread._DateTimeHelper,s=l.toInt(new a(k).toOADate()-new a(f).toOADate())-365*(e+1-o)):(v=1,s=h(o)&&i.getMonth()<3||h(e)&&r.getMonth()*256+r.getDate()>=541?1:0),p=l.toDouble(s)/l.toDouble(v),y=365+p):y=w.__annual_year_basis(new Date,u),c/y}function ii(n){var r=t.Calc.Convert,u=t.Calc._Helper,e=r.toDateTime(n[0]),f=r.toDateTime(n[1]),i=u._argumentExists(n,2)?r.toInt(n[2]):0;return i<0||i>4?t.Calc.Errors.Number:ir(e,f,i)}function ur(){var n=[];return n[0]=function(n,t){return t.getFullYear()-n.getFullYear()+(t.getMonth()<n.getMonth()||t.getMonth()===n.getMonth()&&t.getDate()<n.getDate()?-1:0)},n[1]=function(n,t){return 12*(t.getFullYear()-n.getFullYear())+(t.getMonth()-n.getMonth())+(t.getDate()<n.getDate()?-1:0)},n[2]=function(n,t){return(t.getTime()-n.getTime())/864e5},n[3]=function(n,t){var i=new Date(t.getFullYear(),t.getMonth()+t.getDate()<n.getDate()?-1:0,n.getDate());return(t.getTime()-i.getTime())/864e5},n[4]=function(n,t)
{return t.getMonth()-n.getMonth()+(t.getMonth()<n.getMonth()||t.getMonth()===n.getMonth()&&t.getDate()<n.getDate()?12:0)+(t.getDate()<n.getDate()?-1:0)},n[5]=function(n,t){var i=new Date(t.getFullYear()+(t.getMonth()<n.getMonth()||t.getMonth()===n.getMonth()&&t.getDate()<n.getDate()?-1:0),n.getMonth(),n.getDate());return(t-i)/864e5},n}function rr(n,i){var r;switch(i){case"Y":r=0;break;case"M":r=1;break;case"D":r=2;break;case"MD":r=3;break;case"YM":r=4;break;case"YD":r=5;break;default:throw t._StringResource.Exp_NotSupport;}return n[r]}function nr(n){var r=t.Calc.Convert,f=r.toDateTime(n[0]),e=r.toDateTime(n[1]),o=r.toString(n[2]).toLocaleUpperCase(),u,i;if(e<f)return t.Calc.Errors.Number;u=ur(),i=rr(u,o);if(i)try{return i(f,e)}catch(s){return t.Calc.Errors.Value}return t.Calc.Errors.Number}function ki(n){return 0<=n&&n<=31||127===n||128<=n&&n<=159}function bi(n){
for(var r=t.Calc.Convert.toString(n[0]),u=[],i=0;i<r.length;i++)ki(r.charCodeAt(i))||u.push(r[i]);return u.join("")}function wt(n){return n===" "||n==="\t"||n==="\n"}function gi(n){for(var f=t.Calc.Convert.toString(n[0]).trim(),u=[],e=!0,r,i=0;i<f.length;i++)r=f.charAt(i),(!wt(r)||e)&&u.push(r),e=!wt(r);return u.join("")}function kt(n){var u=n.toString(),e="",f,i,r;n<0&&(u=u.substr(1),e="-"),f=u.split(".");if(f.length<1||f.length>2)return t.Calc.Errors.Value;for(i=[],f.length===2&&(i.push(f[1]),i.push(".")),u=f[0],r=u.length-3;r>=0;r=r-3)i.push(u.substr(r,3)),r>0&&i.push(",");return i.push(u.substring(0,r+3)),i.reverse(),e+i.join("")}function di(n){var i=kt(n),t;return n<0&&(i=i.substr(1)),t=[],t.push("$"),t.push(i),n<0&&(t.push(")"),t.unshift("(")),t.join("")}f
unction tr(n){var i,u=t.Calc.Convert,f=t.Calc._Helper,r;if(isNaN(i=u.toDouble(n[0])))return t.Calc.Errors.Value;return r=f._argumentExists(n,1)?u.toInt(n[1]):2,r>99?t.Calc.Errors.Value:(i=u.toDouble(nt([i,r])),di(i))}function yf(n){var i,u=t.Calc.Convert,o=t.Calc._Helper;if(isNaN(i=u.toDouble(n[0])))return t.Calc.Errors.Value;var f=o._argumentExists(n,1)?u.toInt(n[1]):2,s=o._argumentExists(n,2)?u.toBool(n[2]):!1,r=[],e=0;return f<0?(e=u.toInt(Math.pow(10,Math.abs(f))),i/=e,r[0]=i,r[1]=0):(r[0]=i,r[1]=f),i=u.toDouble(nt(r)),f<0&&(i*=e),s?i.toString():kt(i)}function vf(n){var t,i,u,r;if(n.indexOf("[")!==-1&&n.indexOf("]")!==-1){t=n.indexOf("["),i=n.indexOf("]",t);while(t!==-1&&i!==-1)u=n.substring(0,t-1),r=n.substring(i+1),n=u.concat(r),t=n.indexOf("["),i=t===-1?-1:n.indexOf("]",t)}return n}function pf(n){var r=n[0],f=t.Calc.Convert,o=t._StandardDateTimeFormatter,s=t._StandardNumberFormatter,i
=t.Calc.Convert.toString(n[1]),u;if(i===""||i===null||i===undefined)return f.toString(r);(r===null||r===undefined)&&(r=0),i=vf(i);try{return u=new t.GeneralFormatter(i),u.Format(r)}catch(e){return t.Calc.Errors.Value}}function bf(i){var e=t.Calc.Convert,o=n.spread._DateTimeHelper,s=e.toString(i[0]),r=o.parseLocale(s),u,f;return r!==undefined&&r!==null?(u=new o(r).toOADate(),e.isError(u)?ti([r]):u):isNaN(f=parseFloat(s))?t.Calc.Errors.Value:f}function wf(n){var i=t.Calc.Convert.toString(n[0]);return i.toLowerCase()}function hf(n){var i=t.Calc.Convert.toString(n[0]);return i.toUpperCase()}function sf(n){var i=t.Calc.Convert.toInt(n[0]);return i<1||255<i?t.Calc.Errors.Value:String.fromCharCode(i)}function cf(n){var i=t.Calc.Convert.toString(n[0]);if(i===""||i===undefined||i===null)return t.Calc.Errors.Value;try{return i[0].charCodeAt(0)}catch(r){return t.Calc.Errors.Value}}function af(n){var u=t.Calc.Convert,f=u.toString(n[0]),i=u.toInt(n[1]),r
=u.toInt(n[2]),s=u.toString(n[3]),e,o;return i<1||r<0?t.Calc.Errors.Value:(i=Math.min(i,f.length+1),r=Math.min(r,f.length-i+1),e=f.substring(0,i-1),o=f.substr(i-1+r),e.concat(s).concat(o))}function lf(n){var f=t.Calc.Convert,u=f.toString(n[0]),i=f.toString(n[1]),l=f.toString(n[2]),s,o,r,e,c,h;if(i===""||i===undefined||i===null)return u;if(n.length>3){o=f.toInt(n[3]),r=0;if(o<1)return t.Calc.Errors.Value;for(e=0;e<o;e++){r=u.indexOf(i,r);if(r===-1)return u;r+=i.length}r-=i.length,c=u.substring(0,r),h=u.substr(r+i.length),s=c.concat(l).concat(h)}else s=u.replace(i,l);return s}function kf(n){for(var e=[],h=n.length,s=t.Calc.Convert,f=t.Calc._ArrayHelper,o,u,r,i=0;i<h;i++)for(o=f.getLength(n[i]),u=0;u<o;u++)r=f.getValueByIndex(n[i],u),r!==undefined&&r!==null&&e.push(s.toString(r));return e.join("")}function ue(n){var u=t.Calc.Convert,f=t.Calc._Helper,i=u.toString(n[0]),r=f._argumentExists(n,1)?u.toInt(n[1]):1;return r<0?t.Calc.
Errors.Value:r<i.length?i.substr(0,r):i}function re(n){var f=t.Calc.Convert,r=f.toString(n[0]),i=f.toInt(n[1])-1,u=f.toInt(n[2]);return i<0||u<0?t.Calc.Errors.Value:i<r.length?r.length<i+u?r.substr(i):r.substr(i,u):""}function fe(n){var u=t.Calc.Convert,f=t.Calc._Helper,i=u.toString(n[0]),r=f._argumentExists(n,1)?u.toInt(n[1]):1;return r<0?t.Calc.Errors.Value:i.length<r?i:i.substr(i.length-r,r)}function oe(n){var e=t.Calc.Convert,f=e.toString(n[0]),i=e.toInt(n[1]),r,u;if(i<0||32767<i*f.length)return t.Calc.Errors.Value;for(r=[],u=0;u<i;u++)r.push(f);return r.join("")}function ee(n){return t.Calc.Convert.toString(n[0]).length}function gf(n){var u=t.Calc.Convert,o=t.Calc._Helper,e=u.toString(n[0]),f=u.toString(n[1]),r=o._argumentExists(n,2)?u.toInt(n[2]):1,i;if(r<1||f.length<r)return t.Calc.Errors.Value;return i=f.indexOf(e,r-1),i===-1?t.Calc.Errors.Value:i+1}function df(n){var e=t.Calc.Convert,h=t.Calc._Helper,r=e.toString(n[0])
,o=e.toString(n[1]),u=h._argumentExists(n,2)?e.toInt(n[2]):1,i;u--;if(u<0)return t.Calc.Errors.Value;i=-1;try{if(r.indexOf("*")===-1&&r.indexOf("?")===-1)i=o.toLowerCase().indexOf(r.toLowerCase(),u);else{var c=yo(r).toLowerCase(),s=new RegExp(c,"i"),f=s.exec(o);i=f!==undefined&&f!==null?f.index:-1}}catch(l){}return i===-1?t.Calc.Errors.Value:i+1}function ne(n){var i=t.Calc.Convert,u=i.toString(n[0]),r=i.toString(n[1]);return u===r}function ie(n){var t=n[0];return typeof t=="string"?t:""}function te(n,i){if(t.Calc.Convert.isError(n))i.value=!0;else if(typeof n===p){var r=t.Calc.Error._parseCore(n);i.value=r!==undefined&&r!==null}i.value=!1}function of(n,i){if(t.Calc.Convert.isError(n)&&n._code!==t.Calc.Errors.NotAvailable._code)i.value=!0;else if(typeof n===p){var r=t.Calc.Error._parseCore(n);i.value=r!==undefined&&r!==null&&r!==t.Calc.Errors.NotAvailable}i.value=!1}function f(n){if(n
===undefined||n===null)throw t._StringResource.Exp_InvalidArgument;else if(n.length<1||n.length>1)throw t._StringResource.Exp_InvalidArgument;}function au(n){f(n);var i={value:!1};return t.Calc.Convert.isError(n[0])?i.value=!0:y(n[0],te,i),i.value}function lu(n){f(n);var r=t.Calc.Convert,i={value:!1};return r.isError(n[0])&&n[0]._code!==t.Calc.Errors.NotAvailable._code?i.value=!0:r.isError(n[0])&&n[0]._code===t.Calc.Errors.NotAvailable._code?i.value=!1:y(n[0],of,i),i.value}function vu(n){return f(n),t.Calc.Convert.isError(n[0])?n[0]._code===t.Calc.Errors.NotAvailable._code:!1}function pu(n){f(n);var i=n[0];if(i!==undefined&&i!==null)if(t.Calc.Convert.isError(i))switch(i._code){case t.Calc.Errors.Null._code:return 1;case t.Calc.Errors.DivideByZero._code:return 2;case t.Calc.Errors.Value._code:return 3;case t.Calc.Errors.Reference._code:return 4;case t.Calc.Errors.Name._code:return 5;case t.Calc.Errors.Number._code:return 6;case t.Calc.Errors.NotAvailable
._code:return 7;default:break}return t.Calc.Errors.NotAvailable}function yu(n){return f(n),t.Calc.Convert.isNumber(n[0])}function ou(n){f(n);var i;return isNaN(i=t.Calc.Convert.toDouble(n[0]))?t.Calc.Errors.Value:r.Functions._MathHelper.approxFloor(Math.abs(i))%2==0}function eu(n){f(n);var i;return isNaN(i=t.Calc.Convert.toDouble(n[0]))?t.Calc.Errors.Value:r.Functions._MathHelper.approxFloor(Math.abs(i))%2!=0}function su(n){f(n);var i=n[0],r=t.Calc.Convert;if(r.isNumber(i))return r.toDouble(i);else if(typeof i===lt)return i?1:0;else if(r.isError(i))return i;return 0}function cu(n){return f(n),n[0]===undefined||n[0]===null}function hu(n){return f(n),typeof n[0]===lt}function wu(n){return f(n),typeof n[0]===p}function rf(n){return f(n),typeof n[0]!==p}function tf(n){return f(n),t.Calc.Convert._isCalcReference(n[0])}function uf(n){f(n);var i=n[0],r=t.Calc.Convert;return r.isNumber(i)?1:typeof i===p?2:typeof i===lt?4:r.isError(i)?16:r._isCalcArray(i)?64:t.Calc.Errors.Value}function ef(n
){return t.Calc.Errors.NotAvailable}function ff(n){for(var c=t.Calc.Convert,ft=t.Calc._Helper,l=c._toArray(n[0]),s=new i.CalcArray,u,v,f,o,p,h,b,y,k,a,rt,e,nt,it,s=ft._argumentExists(n,1)?c._toArray(n[1]):l,w=ft._argumentExists(n,2)?c._toArray(n[2]):s,ut=ft._argumentExists(n,3)?c.toBool(n[3]):!0,r=0;r<l.getRowCount();r++)for(u=0;u<l.getColumnCount();u++)if(!c.isNumber(l.getValue(r,u)))return t.Calc.Errors.Value;for(r=0;r<s.getRowCount();r++)for(u=0;u<s.getColumnCount();u++)if(!c.isNumber(s.getValue(r,u)))return t.Calc.Errors.Value;for(r=0;r<w.getRowCount();r++)for(u=0;u<w.getColumnCount();u++)if(!c.isNumber(w.getValue(r,u)))return t.Calc.Errors.Value;if(l.getRowCount()===s.getRowCount()&&l.getColumnCount()===s.getColumnCount()){p=s.getRowCount()*s.getColumnCount();var d=0,g=0,et=0,tt=0,ot;for(r=0;r<s.getRowCount();r++)for(u=0;u<s.getColumnCount();u++){if(isNaN(h=c.toDouble(s.getValue(r,u)))||isNaN(b=c.toDouble(l.getValue(r,u))))return t.Calc.Errors.Va
lue;d+=h,g+=h*h,et+=b,tt+=h*b}for(ut?(o=(p*tt-d*et)/(p*g-d*d),ot=(et*g-d*tt)/(p*g-d*d)):(o=tt/g,ot=0),y=[],r=0;r<w.getRowCount();r++)for(y[r]=[],u=0;u<w.getColumnCount();u++){if(isNaN(h=c.toDouble(w.getValue(r,u))))return t.Calc.Errors.Value;y[r][u]=o*h+ot}return y}else if(l.getColumnCount()===1&&l.getRowCount()===s.getRowCount()||l.getRowCount()===1&&l.getColumnCount()===s.getColumnCount()){b=[],h=[];if(l.getColumnCount()===1){for(p=s.getRowCount(),o=s.getColumnCount(),r=0;r<p;r++){if(isNaN(v=c.toDouble(l.getValue(r,0))))return t.Calc.Errors.Value;b[r]=v}for(r=0;r<p;r++)for(h[r]=[],u=0;u<o;u++){if(isNaN(v=c.toDouble(s.getValue(r,u))))return t.Calc.Errors.Value;h[r][u]=v}}else{for(p=s.getColumnCount(),o=s.getRowCount(),h=[],b=[],r=0;r<p;r++){if(isNaN(v=c.toDouble(l.getValue(0,r))))return t.Calc.Errors.Value;b[r]=v}for(r=0;r<p;r++)for(h[r]=[],u=0;u<o;u++){if(isNaN(v=c.toDouble(s.getValue(u,r))))return t.Calc.Errors.Value;h[r][u]=v}}for(e=[],f=0
;f<o+1;f++)e[f]=[];for(nt=0;nt<o+1;nt++)for(it=0;it<o+2;it++)e[nt][it]=0;for(f=0;f<p;f++)for(e[0][o+1]=e[0][o+1]+b[f],r=0;r<o;r++)for(e[0][r+1]=e[0][r+1]+h[f][r],e[r+1][0]=e[0][r+1],e[r+1][o+1]=e[r+1][o+1]+h[f][r]*b[f],u=r;u<o;u++)e[u+1][r+1]=e[u+1][r+1]+h[f][r]*h[f][u],e[r+1][u+1]=e[u+1][r+1];e[0][0]=p;if(ut)for(r=0;r<o+1;r++){if(e[r][r]===0){for(k=!1,u=r+1;!k&&u<o+1;u++)if(e[u][r]!==0){for(f=0;f<o+2;f++)rt=e[r][f],e[r][f]=e[u][f],e[u][f]=rt;k=!0}if(!k)return t.Calc.Errors.NotAvailable}for(a=1/e[r][r],f=0;f<o+2;f++)e[r][f]=e[r][f]*a;for(u=0;u<o+1;u++)if(u!==r)for(a=-e[u][r],f=0;f<o+2;f++)e[u][f]=e[u][f]+a*e[r][f]}else for(r=1;r<o+1;r++){if(e[r][r]===0){for(k=!1,u=r+1;!k&&u<o+1;u++)if(e[u][r]!==0){for(f=0;f<o+2;f++)rt=e[r][f],e[r][f]=e[u][f],e[u][f]=rt;k=!0}if(!k)return t.Calc.Errors.NotAvailable}for(a=1/e[r][r],f=1;f<o+2;f++)e[r][f]=e[r][f]*a;for(u=1;u<o+1;u++)if(u!==r)for(a=-e[u][r],f=1;f<o+2;f++)e[u][f]=e[u][f]
+a*e[r][f];e[0][o+1]=0}if(l.getColumnCount()===1){for(y=[],r=0;r<w.getRowCount();r++){for(y[r]=[],a=e[0][o+1],u=0;u<o;u++){if(isNaN(v=c.toDouble(w.getValue(r,u))))return t.Calc.Errors.Value;a+=e[u+1][o+1]*v}y[r][0]=a}return y}else{for(y=[],y[0]=[],r=0;r<w.getColumnCount;r++){for(a=e[0][o+1],u=0;u<o;u++){if(isNaN(v=c.toDouble(w.getValue(u,r))))return t.Calc.Errors.Value;a+=e[u+1][o+1]*v}y[0][r]=a}return y}}return t.Calc.Errors.NotAvailable}function ku(n){for(var c=t.Calc.Convert,ut=t.Calc._Helper,a=c._toArray(n[0]),h=[],w,k,r,f,p,l,v,d,it,y,s,e,o,u,nt,h=ut._argumentExists(n,1)?c._toArray(n[1]):a,b=ut._argumentExists(n,2)?c._toArray(n[2]):h,ft=ut._argumentExists(n,3)?c.toBool(n[3]):!0,i=0;i<a.getRowCount();i++)for(r=0;r<a.getColumnCount();r++){e=a.getValue(i,r);if(c.isError(e))return e;else if(c.isNumber(e)){if(c.toDouble(e)<=0)return t.Calc.Errors.Number}else return t.Calc.Errors.Value}for(i=0;i<h.getRowCount();i++)for(r=0;r<h.getColumnCount();r++){e=h.getV
alue(i,r);if(c.isError(e))return e;else if(!c.isNumber(e))return t.Calc.Errors.Value}for(i=0;i<b.getRowCount();i++)for(r=0;r<b.getColumnCount();r++){e=b.getValue(i,r);if(c.isError(e))return e;else if(!c.isNumber(e))return t.Calc.Errors.Value}if(a.getRowCount()===h.getRowCount()&&a.getColumnCount()===h.getColumnCount()){p=h.getRowCount()*h.getColumnCount();var g=0,tt=0,et=0,rt=0,ot;for(i=0;i<h.getRowCount();i++)for(r=0;r<h.getColumnCount();r++){if(isNaN(l=c.toDouble(h.getValue(i,r)))||isNaN(v=c.toDouble(a.getValue(i,r))))return t.Calc.Errors.Value;v=Math.log(v),g+=l,tt+=l*l,et+=v,rt+=l*v}for(ft?(f=(p*rt-g*et)/(p*tt-g*g),ot=(et*tt-g*rt)/(p*tt-g*g)):(f=rt/tt,ot=0),y=[],i=0;i<b.getRowCount();i++)for(y[i]=[],r=0;r<b.getColumnCount();r++){if(isNaN(l=c.toDouble(b.getValue(i,r))))return t.Calc.Errors.Value;y[i][r]=Math.exp(f*l+ot)}return y}else if(a.getColumnCount()===1&&a.getRowCount()===h.getRowCount()||a.getRowCount()===1&&a.getColumnCount()===h.
getColumnCount()){v=[],l=[];if(a.getColumnCount()===1){for(p=h.getRowCount(),f=h.getColumnCount(),i=0;i<p;i++){if(isNaN(w=c.toDouble(a.getValue(i,0))))return t.Calc.Errors.Value;v[i]=Math.log(w)}for(i=0;i<p;i++)for(l[i]=[],r=0;r<f;r++){if(isNaN(w=c.toDouble(h.getValue(i,r))))return t.Calc.Errors.Value;l[i][r]=w}}else{for(p=h.getColumnCount(),f=h.getRowCount(),l=[],v=[],i=0;i<p;i++){if(isNaN(w=c.toDouble(a.getValue(0,i))))return t.Calc.Errors.Value;v[i]=w}for(i=0;i<p;i++)for(l[i]=[],r=0;r<f;r++){if(isNaN(w=c.toDouble(h.getValue(r,i))))return t.Calc.Errors.Value;l[i][r]=w}}for(u=[],d=0;d<f+1;d++)for(u[d]=[],it=0;it<f+2;it++)u[d][it]=0;for(nt=[],d=0;d<f+2;d++)nt[d]=0;for(k=0;k<p;k++)for(nt[f+1]=nt[f+1]+v[k]*v[k],u[0][f+1]=u[0][f+1]+v[k],nt[0]=u[0][f+1],i=0;i<f;i++)for(u[0][i+1]=u[0][i+1]+l[k][i],u[i+1][0]=u[0][i+1],u[i+1][f+1]=u[i+1][f+1]+l[k][i]*v[k],nt[i+1]=u[i+1][f+1],r=i;r<f;r++)u[r+1][i+1]=u[r+1][i+1]+l[k][i]*l[k][r],u[i+1][r+1]=u[r+1][i+1];u[0]
[0]=p;if(ft)for(s=0;s<f+1;s++){i=s;while(i<f+1&&u[i][s]===0)i++;if(i>=f+1)return t.Calc.Errors.NotAvailable;for(o=0;o<f+2;o++)e=u[s][o],u[s][o]=u[i][o],u[i][o]=e;for(e=1/u[s][s],o=0;o<f+2;o++)u[s][o]=u[s][o]*e;for(i=0;i<f+1;i++)if(i!==s)for(e=-u[i][s],o=0;o<f+2;o++)u[i][o]=u[i][o]+e*u[s][o]}else for(s=1;s<f+1;s++){i=s;while(i<f+1&&u[i][s]===0)i++;if(i>=f+1)return t.Calc.Errors.NotAvailable;for(o=1;o<f+2;o++)e=u[s][o],u[s][o]=u[i][o],u[i][o]=e;for(e=1/u[s][s],u[s][o]=u[s][o]*e,i=1;i<f+1;i++)i!==s&&(e=-u[i][s],u[i][o]=u[i][o]+e*u[s][o]);u[0][f+1]=0}if(a.getColumnCount()===1){for(y=[],i=0;i<b.getRowCount();i++){for(y[i]=[],e=u[0][f+1],r=0;r<f;r++){if(isNaN(w=c.toDouble(b.getValue(i,r))))return t.Calc.Errors.Value;e+=u[r+1][f+1]*w}y[i][0]=Math.exp(e)}return y}else{for(y=[],y[0]=[],i=0;i<b.getColumnCount();i++){for(e=u[0][f+1],r=0;r<f;r++){if(isNaN(w=c.toDouble(b.getValue(r,i))))return t.Calc.Errors.Value;e+=u[r+1][f
+1]*w}y[0][i]=Math.exp(e)}return y}}return t.Calc.Errors.NotAvailable}function bu(n){var y,i=t.Calc.Convert,h=t.Calc._ArrayHelper,r,f,o,e;if(isNaN(y=i.toDouble(n[0])))return t.Calc.Errors.Value;var c,s,v=0,u=0,l=0,b=0,w,a,p=h.getLength(n[1]);if(p!==h.getLength(n[2]))return t.Calc.Errors.NotAvailable;for(r=0,f=0;f<p;f++){o=h.getValueByIndex(n[1],f),e=h.getValueByIndex(n[2],f);if(i.isNumber(o)&&i.isNumber(e))c=i.toDouble(o),s=i.toDouble(e),v+=c,u+=s,l+=s*s,b+=s*c,r++;else if(i.isError(o))return o;else if(i.isError(e))return e}return r===0?t.Calc.Errors.DivideByZero:r*l-u*u==0?t.Calc.Errors.DivideByZero:(a=(r*b-u*v)/(r*l-u*u),w=v/r-a*(u/r),i.toResult(w+a*y))}function du(n){return b.__averageIncludeSubtotals(n,!0)}function nf(n){return b.__stdevIncludeSubtotals(n,!0)}function ri(n){var o,r=t.Calc.Convert,c=t.Calc._ArrayHelper,i,s,e,f,u,h;if(isNaN(o=r.toDouble(n[1])))return t.Calc.Errors.Value;i=[];if(r.isError(n[0]))return n[0];if(c.isArrayOrReference(n[0]))for(e=0;e<c.get
Length(n[0]);e++){f=c.getValueByIndex(n[0],e);if(r.isNumber(f))s=r.toDouble(f),i.push(s);else if(r.isError(f))return f}else{if(isNaN(s=r.toDouble(n[0])))return t.Calc.Errors.Value;i.push(s)}return i.sort(function(n,t){return n-t}),i.length===0?t.Calc.Errors.Number:o<0||1<o?t.Calc.Errors.Number:(u=o*(i.length-1),h=u%1,u=parseInt(u.toString(),10),h===0?i[u]:r.toDouble(i[u])+h*(r.toDouble(i[u+1])-r.toDouble(i[u])))}var ei,s,v,bt,b,l;t.feature("calc.functions",["calc.common"]);var pt=jQuery,ac="undefined",p="string",lt="boolean";r.Functions=t.Calc.Functions,r._builtInFunctions=r.Functions._builtInFunctions||{},r._defineBuildInFunction=oi,r.def=oi,ei=function(){function n(){}return n.days360=ui,n.yearfrac=ii,n}(),r._DateHelper=ei,r.acceptsAny=u,r.acceptsNotZero=ht,r.acceptsOne=o,r.acceptsTwo=e,r.acceptsZeroTwo=st,r.acceptsZeroOdd=ct,r.acceptsThree=k,r.isVolatile=c,r.acceptsOneTwo=a,r.isBranch=si,r.acceptsZero=ot,r.findTestArgument=f
i,r.acceptAboveZero=et,r.acceptsSecond=vi,r.acceptsSecondOrThirdOrFourth=vt,r.acceptsThird=nu,r.acceptsFirstOrThird=sr,r.acceptsFirstOrOne=yr,r.acceptsFirstOrOdd=rh,r.acceptsFirst=tt,r.acceptsFirstOrSecondOrThird=d,r.acceptsEven=ih,r.acceptsFourth=ps,r.acceptsNotFourth=it,r.acceptsFourthOrFifth=lh,r.acceptsNotSecond=bh,r.acceptsThreeFour=io,r.acceptsPositive=oo,r.acceptsFour=ve,r.acceptsFourFive=ce,r.acceptsFive=we,r.acceptsSix=ns,r.acceptsEight=vo,r.acceptsSeven=ao,r.acceptsNotTwo=co,r.acceptsFiveSix=wo,r.acceptsFourSixSeven=po,r.acceptsThreeFourFive=bo,r.acceptsMoreThanOne=go,r.acceptsTwoThreeFour=ko,r.acceptsOneTwoThree=lo,s=function(){function n(n,t){this.Key=n,this.Value=t}return n}(),v=[/\\/g,/\(/g,/\[/g,/\{/g,/\^/g,/\$/g,/\|/g,/\)/g,/\+/g,/\./g],bt=function(){function i(){}return i.__isLeapYear=function(n){return n%400==0||n%4==0&&n%100!=0||n===1900},i.__compareDateTime=function(n,t){return n-t},i.__toOADate=function(t){return new n.spread._DateTimeHelper(t).toOADate(
)},i.__annual_year_basis=function(n,t){var r;switch(t){case 0:return 360;case 1:return r=i.__isLeapYear(n.getFullYear()),r?366:365;case 2:return 360;case 3:return 365;case 4:return 360;default:return-1}},i.__getDaysInMonth=function(n,t){switch(t){case 0:case 2:case 4:case 6:case 7:case 9:case 11:return 31;case 1:return i.__isLeapYear(n)?29:28;break;case 3:case 5:case 8:case 10:return 30}},i.__Days_Between_BASIS_30E_360=function(n,t){var e,f,i,o,u,r;return e=n.getFullYear(),f=n.getMonth(),i=n.getDate(),o=t.getFullYear(),u=t.getMonth(),r=t.getDate(),i===31&&(i=30),r===31&&(r=30),(o-e)*360+(u-f)*30+(r-i)},i.__Days_Between_BASIS_30Ep_360=function(n,t){var e,f,i,o,u,r;return e=n.getFullYear(),f=n.getMonth(),i=n.getDate(),o=t.getFullYear(),u=t.getMonth(),r=t.getDate(),i===31&&(i=30),r===31&&(r=1,u++),(o-e)*360+(u-f)*30+(r-i)},i.__Days_Between_BASIS_MSRB_30_360_SYM=function(n,t){var o,e,r,s,f,u;return o=n.getFullYear(),e=n.getMonth(),r=n.getDate(),s=t.getFul
lYear(),f=t.getMonth(),u=t.getDate(),e===2&&i.__getDaysInMonth(o,e)===r&&(r=30),f===2&&i.__getDaysInMonth(s,f)===u&&(u=30),u!==31||r<30||(u=30),r===31&&(r=30),(s-o)*360+(f-e)*30+(u-r)},i.__Days_Between_BASIS_MSRB_30_360=function(n,t){var o,e,r,s,f,u;return o=n.getFullYear(),e=n.getMonth(),r=n.getDate(),s=t.getFullYear(),f=t.getMonth(),u=t.getDate(),e===2&&i.__getDaysInMonth(o,e)===r&&f===2&&i.__getDaysInMonth(s,f)===u&&(r=30,u=30),u!==31||r<30||(u=30),r===31&&(r=30),(s-o)*360+(f-e)*30+(u-r)},i.__days_between_basis=function(n,r,u){var f=1,e;i.__compareDateTime(n,r)>0&&(e=n,n=r,r=e,f=-1);switch(u){case 1:case 2:case 3:return f*t.Calc.Convert.toInt(i.__toOADate(r)-i.__toOADate(n));case 4:return f*i.__Days_Between_BASIS_30E_360(n,r);case 5:return f*i.__Days_Between_BASIS_30Ep_360(n,r);case 6:return f*i.__Days_Between_BASIS_MSRB_30_360_SYM(n,r);default:return f*i.__Days_Between_BASIS_MSRB_30_
360(n,r)}},i}(),r._FinancialHelper=bt,b=function(){function n(){}return n.__dev1=function(n,i,r){for(var o=t.Calc.Convert,c=t.Calc._ArrayHelper,e,f,h,s,u=0;u<n.length;u++)if(o.isError(n[u]))return n[u];else if(c.isArrayOrReference(n[u])){for(e=0;e<c.getLength(n[u]);e++)if(r||!c.isSubtotalByIndex(n[u],e)){f=c.getValueByIndex(n[u],e);if(o.isNumber(f))h=o.toDouble(f),i.sumx+=h,i.sumx2+=h*h,i.n++;else if(o.isError(f))return f}}else{if(isNaN(s=o.toDouble(n[u])))return t.Calc.Errors.Value;i.sumx+=s,i.sumx2+=s*s,i.n++}},n.st_normsdist=function(n){var f,o=t.Calc.Convert,e,i,u,r;return isNaN(f=o.toDouble(n[0]))?t.Calc.Errors.Value:(e=6,f===0?u=0:(i=.5*Math.abs(f),i<e*.5?i<1?(r=i*i,u=((((((((.000124818987*r-.001075204047)*r+.005198775019)*r-.019198292004)*r+.059054035642)*r-.151968751364)*r+.319152932694)*r-.5319230073)*r+.797884560593)*i*2):(i-=2,u=(((((((((((((-45255659e-12*i+.00015252929)*i-19538132e-12)*i-.000676904986)*i+.001390604284)*i-.00079462082)*i-.002034254874)*i+.0065
49791214)*i-.010557625006)*i+.011630447319)*i-.009279453341)*i+.005353579108)*i-.002141268741)*i+.000535310849)*i+.999936657524):u=1),f>0?(u+1)*.5:(1-u)*.5)},n.__averageIncludeSubtotals=function(n,i){for(var c=0,h=0,f=t.Calc.Convert,s=t.Calc._ArrayHelper,u,e,o,l,r=0;r<n.length;r++){if(f.isError(n[r]))return n[r];if(s.isArrayOrReference(n[r])){for(u=0;u<s.getRangeCount(n[r]);u++)for(e=0;e<s.getLength(n[r],u);e++)if(i||!s.isSubtotalByIndex(n[r],e,u)){o=s.getValueByIndex(n[r],e,u);if(f.isNumber(o))c+=f.toDouble(o),h++;else if(f.isError(o))return o}}else{if(isNaN(l=f.toDouble(n[r])))return t.Calc.Errors.Value;c+=l,h++}}return h===0?t.Calc.Errors.DivideByZero:f.toResult(c/h)},n.__countIncludeSubtotals=function(n,i){for(var l=0,o=t.Calc.Convert,c,h,u,f,v,e,a,s,r=0;r<n.length;r++)if(o._isCalcArray(n[r]))for(h=n[r].getColumnCount(),c=n[r].getRowCount(),f=0;f<h;f++)for(u=0;u<c;u++)o.isNumber(n[r].getValue(u,f))&&l++;else if(o._isCalcReference(n[r]))for(v=n[r].get
RangeCount(),h=0,c=0,e=0;e<v;e++)for(h=n[r].getColumnCount(e),f=0;f<h;f++)for(c=n[r].getRowCount(e),u=0;u<c;u++){if(n[r]instanceof t.Calc._SheetRangeReference)for(s=0;s<n[r].getSheetCount();s++)(i||!n[r].isSubtotal(s,e,u,f))&&(a=n[r].getValue(s,e,u,f));else(i||!n[r].isSubtotal(e,u,f))&&(a=n[r].getValue(e,u,f));o.isNumber(a)&&l++}else o.isNumber(n[r])&&l++;return o.toResult(l)},n.__countaIncludeSubtotals=function(n,i){for(var o=0,h=t.Calc.Convert,e=t.Calc._ArrayHelper,u,f,s,r=0;r<n.length;r++)if(e.isArrayOrReference(n[r]))for(u=0;u<e.getRangeCount(n[r]);u++)for(f=0;f<e.getLength(n[r],u);f++)(i||!e.isSubtotalByIndex(n[r],f,u))&&(s=e.getValueByIndex(n[r],f,u),s!==undefined&&s!==null&&o++);else n[r]!==undefined&&n[r]!==null&&o++;return h.toResult(o)},n.__maxIncludeSubtotals=function(n,i){for(var h=!1,e=0,o=t.Calc.Convert,c=t.Calc._ArrayHelper,f,u,l,s,r=0;r<n.length;r++){if(o.isError(n[r]))ret
urn n[r];if(c.isArrayOrReference(n[r])){for(f=0;f<c.getLength(n[r]);f++)if(i||!c.isSubtotalByIndex(n[r],f)){u=c.getValueByIndex(n[r],f);if(o.isNumber(u))l=o.toDouble(u),(!h||l>e)&&(e=l),h=!0;else if(o.isError(u))return u}}else{s=o.toDouble(n[r]);if(isNaN(s))return t.Calc.Errors.Value;(!h||s>e)&&(e=s),h=!0}}return e},n.__minIncludeSubtotals=function(n,i){for(var c=!1,o=0,u,s=t.Calc.Convert,h=t.Calc._ArrayHelper,e,f,r=0;r<n.length;r++){if(s.isError(n[r]))return n[r];if(h.isArrayOrReference(n[r])){for(e=0;e<h.getLength(n[r]);e++)if(i||!h.isSubtotalByIndex(n[r],e)){f=h.getValueByIndex(n[r],e);if(s.isNumber(f))u=s.toDouble(f),(!c||u<o)&&(o=u),c=!0;else if(s.isError(f))return f}}else{if(isNaN(u=s.toDouble(n[r])))return t.Calc.Errors.Value;(!c||u<o)&&(o=u),c=!0}}return o},n.__stdevIncludeSubtotals=function(i,r){var u={sumx:0,sumx2:0,n:0},e=n.__dev1(i,u,r),f=t.Calc.Convert;return f.isError(e)?e:u.n<=1?t.Calc.Errors.DivideByZero:f.toRes
ult(Math.sqrt(Math.max(0,(u.n*u.sumx2-u.sumx*u.sumx)/(u.n*(u.n-1)))))},n.__stdevpIncludeSubtotals=function(i,r){var u={sumx:0,sumx2:0,n:0},e=n.__dev1(i,u,r),f=t.Calc.Convert;return f.isError(e)?e:u.n<=0?t.Calc.Errors.DivideByZero:f.toResult(Math.sqrt(Math.max(0,(u.n*u.sumx2-u.sumx*u.sumx)/(u.n*u.n))))},n.__varrIncludeSubtotals=function(i,r){var u={sumx:0,sumx2:0,n:0},e=n.__dev1(i,u,r),f=t.Calc.Convert;return f.isError(e)?e:u.n<=1?t.Calc.Errors.DivideByZero:f.toResult(Math.max(0,(u.n*u.sumx2-u.sumx*u.sumx)/(u.n*(u.n-1))))},n.__varpIncludeSubtotals=function(i,r){var u={sumx:0,sumx2:0,n:0},e=n.__dev1(i,u,r),f=t.Calc.Convert;return f.isError(e)?e:u.n<=0?t.Calc.Errors.DivideByZero:f.toResult(Math.max(0,(u.n*u.sumx2-u.sumx*u.sumx)/(u.n*u.n)))},n.st_percentile=ri,n}(),r._StatHelper=b,l=function(){function n(){}return n.log=function(n,t){return isNaN(n)?n:isNaN(t)?t:t!==1&&n===1||t!==0&&t!==Number.POSITIVE_INFINITY?Math.log(n)/Math.log(t):NaN},n.log10=function(t){re
turn n.log(t,10)},n}(),r._MathHelper=function(){function e(n){var t=Math.floor(n);return r.Functions._MathHelper.approxEqual(n,t+1)?t+1:t}function f(n){var t=Math.ceil(n);return r.Functions._MathHelper.approxEqual(n,t-1)?t-1:t}function v(n,t){return n===t?!0:Math.abs(n-t)<Math.abs(n)/281474976710656}function a(){var n=[];return n[0]=1,n[1]=10,n[2]=100,n[3]=1e3,n[4]=1e4,n[5]=1e5,n[6]=1e6,n[7]=1e7,n[8]=1e8,n[9]=1e9,n[10]=1e10,n[11]=1e11,n[12]=1e12,n[13]=1e13,n[14]=1e14,n[15]=1e15,n[16]=1e16,n}function u(n){var i=a(),t=i[n];return t!==undefined&&t!==null?t:Math.pow(10,parseFloat(n))}function n(n,i){var u,r,e,f;switch(n){case 0:u=function(n,t){return n<=t},r=function(n,t){return n<=t};break;case 1:u=function(n,t){return n>=t},r=function(n,t){return n>=t};break;case 2:u=function(n,t){return n!==t},r=function(n,t){return n!==t};break;case 3:u=function(n,t){return n<t},r=function(n,t){return n<t};break;case 4:u=function(n,t){return n===t},r=function(n,t){return
n===t};break;case 5:u=function(n,t){return n>t},r=function(n,t){return n>t};break;default:return function(n){return!1}}e=-1,f=!0;try{i===undefined||i===null?e=0:isNaN(e=t.Calc.Convert.toDouble(i.toString()))&&(f=!1)}catch(o){f=!1}return function(n){if(n===undefined||n===null)return!1;if(f){var o=-1;try{if(!isNaN(o=t.Calc.Convert.toDouble(n)))return r(o,e)}catch(s){}}return u(n.toString().toUpperCase(),i!==undefined&&i!==null?i.toString().toUpperCase():"")}}function p(i){var f,e;if(t.Calc.Convert.isNumber(i))return n(4,i);var o="=><",r=i!==undefined&&i!==null?i.toString().toUpperCase():"",u="\x00";for(f=0;f<2&&f<r.length;f++){e=r[f];if(o.indexOf(e)!==-1)if(e==="=")switch(u){case"<":return n(0,r.substring(2));case">":return n(1,r.substring(2));default:return n(4,u==="\x00"?r.substring(1):i)}else{if(u==="\x00"){u=e;continue}if(u==="<
")return e===">"?n(2,r.substring(2)):n(3,r.substring(1));else if(u===">")return n(5,r.substring(1))}else switch(u){case"<":return n(3,r.substring(1));case">":return n(5,r.substring(1));default:break}}return n(4,i)}function y(n,i){if(isNaN(n))return t.Calc.Errors.Value;var r=u(Math.abs(i));return i<0?n/=r:n*=r,n=n<0?f(n-.5):e(n+.5),i<0?n*=r:n/=r,t.Calc.Convert.toResult(n)}function c(n,i){var u,r;if(isNaN(n)||isNaN(i))return t.Calc.Errors.Value;if(n<0||i<0||n<i)return t.Calc.Errors.Number;for(u=1,i=Math.min(n-i,i),r=1;r<=i;r++)u*=n-r+1,u/=r;return t.Calc.Convert.toResult(u)}function i(n){return Math.log(1+n)-(1+n-1-n)/(1+n)}function s(n,t){var r;return r=Math.abs(n)>.5?Math.pow(1+n,t):Math.exp(t*i(n)),isFinite(r)?isNaN(r)&&(r=494065645841247e-338):r===Number.POSITIVE_INFINITY?r=179769e303:r===Number.NEGATIVE_INFINITY&&(r=-179769e303),r}function o(n){return(Math.exp(n)+Math.exp(-n))/2}funct
ion h(n){return(Math.exp(n)-Math.exp(-n))/2}return{approxFloor:e,approxCeiling:f,approxEqual:v,pow10:u,parseCriteria:p,round:y,combin:c,log10:l.log10,log:l.log,pow1p:s,log1p:i,cosh:o,sinh:h}}(),r.def("ABS",os,{minArgs:1,maxArgs:1}),r.def("ACOS",lc,{minArgs:1,maxArgs:1}),r.def("ASIN",uc,{minArgs:1,maxArgs:1}),r.def("ATAN",ws,{minArgs:1,maxArgs:1}),r.def("ATAN2",ks,{minArgs:2,maxArgs:2}),r.def("COS",hc,{minArgs:1,maxArgs:1}),r.def("CEILING",ss,{minArgs:2,maxArgs:2}),r.def("ODD",ho,{minArgs:1,maxArgs:1}),r.def("EVEN",is,{minArgs:1,maxArgs:1}),r.def("FLOOR",eo,{minArgs:2,maxArgs:2}),r.def("LN",fs,{minArgs:1,maxArgs:1}),r.def("SQRT",de,{minArgs:1,maxArgs:1}),r.def("SIN",ic,{minArgs:1,maxArgs:1}),r.def("TAN",bs,{minArgs:1,maxArgs:1}),r.def("SIGN",be,{minArgs:1,maxArgs:1}),r.def("GCD",he,{minArgs:1,acceptsReference:u,acceptsArray:u}
),r.def("LCM",le,{minArgs:1,acceptsReference:u,acceptsArray:u}),r.def("PRODUCT",ae,{minArgs:1,acceptsReference:u,acceptsArray:u}),r.def("POWER",ye,{minArgs:2,maxArgs:2}),r.def("MOD",us,{minArgs:2,maxArgs:2}),r.def("QUOTIENT",fo,{minArgs:2,maxArgs:2}),r.def("SUBTOTAL",uo,{minArgs:2,acceptsReference:ht,acceptsArray:ht}),r.def("INT",es,{minArgs:1,maxArgs:1}),r.def("MROUND",so,{minArgs:2,maxArgs:2}),r.def("ROUND",nt,{minArgs:2,maxArgs:2}),r.def("ROUNDDOWN",no,{minArgs:2,maxArgs:2}),r.def("ROUNDUP",ge,{minArgs:2,maxArgs:2}),r.def("TRUNC",to,{minArgs:1,maxArgs:2,acceptsMissingArgument:o}),r.def("EXP",ro,{minArgs:1,maxArgs:1}),r.def("LOG",tc,{minArgs:1,maxArgs:2,acceptsMissingArgument:o}),r.def("LOG10",kh,{minArgs:1,maxArgs:1}),r.def("SUM",ke,{minArgs:1,acceptsReference:u,acceptsArray:u}),r.def("SUMIF",dh,{minArgs:2,maxArg
s:3,acceptsMissingArgument:e,acceptsReference:st,acceptsArray:st}),r.def("SUMIFS",gh,{minArgs:3,acceptsReference:ct,acceptsArray:ct}),r.def("SUMPRODUCT",vh,{minArgs:1,acceptsReference:u,acceptsArray:u}),r.def("SUMSQ",ah,{minArgs:1,acceptsReference:u,acceptsArray:u}),r.def("SUMX2MY2",yh,{minArgs:2,maxArgs:2,acceptsReference:u,acceptsArray:u}),r.def("SUMX2PY2",wh,{minArgs:2,maxArgs:2,acceptsReference:u,acceptsArray:u}),r.def("SUMXMY2",ph,{minArgs:2,maxArgs:2,acceptsReference:u,acceptsArray:u}),r.def("SERIESSUM",fc,{minArgs:4,maxArgs:4,acceptsReference:k,acceptsArray:k}),r.def("PI",pe,{minArgs:0,maxArgs:0}),r.def("SQRTPI",sc,{minArgs:1,maxArgs:1}),r.def("DEGREES",hs,{minArgs:1,maxArgs:1}),r.def("RADIANS",oc,{minArgs:1,maxArgs:1}),r.def("COSH",cc,{minArgs:1,maxArgs:1}),r.def("ACOSH",rc,{minArgs:1,maxArgs:1}),r.def("SINH",ec,{minArgs:1,maxArgs:1}),r.
def("ASINH",gu,{minArgs:1,maxArgs:1}),r.def("TANH",gs,{minArgs:1,maxArgs:1}),r.def("ATANH",ds,{minArgs:1,maxArgs:1}),r.def("MDETERM",as,{minArgs:1,maxArgs:1,acceptsArray:u,acceptsReference:u}),r.def("MINVERSE",ls,{minArgs:1,maxArgs:1,acceptsArray:u,acceptsReference:u}),r.def("MMULT",vs,{minArgs:2,maxArgs:2,acceptsArray:u,acceptsReference:u}),r.def("FACT",ts,{minArgs:1,maxArgs:1}),r.def("FACTDOUBLE",rs,{minArgs:1,maxArgs:1}),r.def("MULTINOMIAL",ys,{minArgs:1,acceptsArray:u,acceptsReference:u}),r.def("RAND",nh,{minArgs:0,maxArgs:0,isVolatile:c}),r.def("RANDBETWEEN",oh,{minArgs:2,maxArgs:2,isVolatile:c}),r.def("COMBIN",cs,{minArgs:2,maxArgs:2}),r.def("ROMAN",sh,{minArgs:1,maxArgs:2,acceptsMissingArgument:o}),r.def("AND",ch,{minArgs:1,acceptsReference:u,acceptsArray:u}),r.def("OR",hh,{minArgs:1,acceptsReference:u,acceptsArray:u}),r.def(&qu
ot;NOT",th,{minArgs:1,maxArgs:1}),r.def("IF",fh,{minArgs:2,maxArgs:3,acceptsReference:a,acceptsArray:a,acceptsError:a,acceptsMissingArgument:e,isBranch:si,findTestArgument:fi,findBranchArgument:wi}),r.def("IFERROR",se,{minArgs:2,maxArgs:2,acceptsReference:ot,acceptsError:ot}),r.def("TRUE",ar,{minArgs:0,maxArgs:0}),r.def("FALSE",lr,{minArgs:0,maxArgs:0}),r.def("DATE",vr,{minArgs:3,maxArgs:3}),r.def("TIME",pr,{minArgs:3,maxArgs:3}),r.def("DATEVALUE",or,{minArgs:1,maxArgs:1}),r.def("TIMEVALUE",ti,{minArgs:1,maxArgs:1}),r.def("NOW",cr,{minArgs:0,maxArgs:0,isVolatile:c}),r.def("TODAY",hr,{minArgs:0,maxArgs:0,isVolatile:c}),r.def("HOUR",wr,{minArgs:1,maxArgs:1}),r.def("MINUTE",iu,{minArgs:1,maxArgs:1}),r.def("SECOND",tu,{minArgs:1,maxArgs:1}),r.def("DAY",ru,{minArgs:1,maxArgs:1}),r.def("MONTH",fu,{minArgs:1,maxArgs:1}),r.def("YEAR&
quot;,uu,{minArgs:1,maxArgs:1}),r.def("WEEKNUM",dr,{minArgs:1,maxArgs:2,acceptsMissingArgument:o}),r.def("WEEKDAY",at,{minArgs:1,maxArgs:2,acceptsMissingArgument:o}),r.def("EDATE",gr,{minArgs:2,maxArgs:2}),r.def("EOMONTH",yi,{minArgs:2,maxArgs:2}),r.def("WORKDAY",pi,{minArgs:2,maxArgs:3,acceptsMissingArgument:e,acceptsArray:e,acceptsReference:e}),r.def("DAYS360",ui,{minArgs:2,maxArgs:3,acceptsMissingArgument:e}),r.def("NETWORKDAYS",li,{minArgs:2,maxArgs:3,acceptsMissingArgument:e,acceptsArray:e,acceptsReference:e}),r.def("YEARFRAC",ii,{minArgs:2,maxArgs:3,acceptsMissingArgument:e}),r.def("DATEDIF",nr,{minArgs:3,maxArgs:3}),r.def("CLEAN",bi,{minArgs:1,maxArgs:1}),r.def("TRIM",gi,{minArgs:1,maxArgs:1}),r.def("DOLLAR",tr,{minArgs:1,maxArgs:2,acceptsMissingArgument:o}),r.def("FIXED",yf,{minArgs:1,maxArgs:3,acceptsMissingArgument:a}),r.def("TEXT",pf,
{minArgs:2,maxArgs:2}),r.def("VALUE",bf,{minArgs:1,maxArgs:1}),r.def("LOWER",wf,{minArgs:1,maxArgs:1}),r.def("UPPER",hf,{minArgs:1,maxArgs:1}),r.def("CHAR",sf,{minArgs:1,maxArgs:1}),r.def("CODE",cf,{minArgs:1,maxArgs:1}),r.def("REPLACE",af,{minArgs:4,maxArgs:4,acceptsMissingArgument:e}),r.def("SUBSTITUTE",lf,{minArgs:3,maxArgs:4,acceptsMissingArgument:k}),r.def("CONCATENATE",kf,{minArgs:2,acceptsArray:u}),r.def("LEFT",ue,{minArgs:1,maxArgs:2,acceptsMissingArgument:o}),r.def("MID",re,{minArgs:3,maxArgs:3}),r.def("RIGHT",fe,{minArgs:1,maxArgs:2,acceptsMissingArgument:o}),r.def("REPT",oe,{minArgs:2,maxArgs:2}),r.def("LEN",ee,{minArgs:1,maxArgs:1}),r.def("FIND",gf,{minArgs:2,maxArgs:3,acceptsMissingArgument:e}),r.def("SEARCH",df,{minArgs:2,maxArgs:3,acceptsMissingArgument:e}),r.def("EXACT",ne,{minArgs:2,maxArgs:2}),r.def("T&
quot;,ie,{minArgs:1,maxArgs:1}),r.def("ISERROR",au,{minArgs:1,maxArgs:1,acceptsError:u}),r.def("ISERR",lu,{minArgs:1,maxArgs:1,acceptsError:u}),r.def("ISNA",vu,{minArgs:1,maxArgs:1,acceptsError:u}),r.def("ERROR.TYPE",pu,{minArgs:1,maxArgs:1,acceptsError:u}),r.def("ISNUMBER",yu,{minArgs:1,maxArgs:1,acceptsError:u}),r.def("ISEVEN",ou,{minArgs:1,maxArgs:1}),r.def("ISODD",eu,{minArgs:1,maxArgs:1}),r.def("N",su,{minArgs:1,maxArgs:1}),r.def("ISBLANK",cu,{minArgs:1,maxArgs:1,acceptsError:u}),r.def("ISLOGICAL",hu,{minArgs:1,maxArgs:1,acceptsError:u}),r.def("ISTEXT",wu,{minArgs:1,maxArgs:1,acceptsError:u}),r.def("ISNONTEXT",rf,{minArgs:1,maxArgs:1,acceptsError:u}),r.def("ISREF",tf,{minArgs:1,maxArgs:1,acceptsError:u,acceptsReference:u}),r.def("TYPE",uf,{minArgs:1,maxArgs:1,acceptsArray:u,acceptsError:u}),r.def("NA",ef,{minArgs:0,maxArgs:0}),r.d
ef("TREND",ff,{minArgs:1,maxArgs:4,acceptsReference:d,acceptsArray:d,acceptsMissingArgument:vt}),r.def("GROWTH",ku,{minArgs:1,maxArgs:4,acceptsReference:it,acceptsArray:it,acceptsMissingArgument:vt}),r.def("FORECAST",bu,{minArgs:3,maxArgs:3,acceptsArray:et,acceptsReference:et}),r.def("AVERAGE",du,{minArgs:1,acceptsArray:u,acceptsReference:u}),r.def("STDEV",nf,{minArgs:1,acceptsArray:u,acceptsReference:u}),r.def("PERCENTILE",ri,{minArgs:2,maxArgs:2,acceptsArray:tt,acceptsReference:tt})})(i.Functions||(i.Functions={}));var r=i.Functions})(t.Calc||(t.Calc={}));var i=t.Calc})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype,n.prototype=new r},wijmo;(function(n){(function(t){function u(n,t){var r,i,u;if(n===undefined||n===null)return t==="null";if(!t)ret
urn!1;r={undefined:"undefined",number:"number",boolean:"boolean",string:"string"};if(r[typeof n]===t)return!0;if(t==="function"&&/^\s*\bfunction\b/.test(""+n))return!0;if(Object.prototype.toString.call(n).slice(8,-1).toLowerCase()===t.toLowerCase())return!0;if(n&&n._classNames){for(i=0;i<n._classNames.length;i++){u=n._classNames[i];if(u===t)return!0}return!1}else{if(n===undefined||n===null)return!1;if(t==="DateTime"||t==="TimeSpan")return n instanceof Date}if(typeof t=="string")if(r[t])return!1;return n instanceof t}function s(n,t){return u(n,t)?n:null}var r,ft,v,e,a,l,i,o,f,k,d,b,ut,g,w;t.feature("formatter",["core.common","core.globalize","core.stringResource"]),r={Empty:"",Format:function(){for(var u=[],i,n,r,t=0;t<arguments.length-0;t++)u[t]=arguments[t+0];if(arguments.length===0)return null;for(i=u[0],n=1;n<argument
s.length;n++)r=new RegExp("\\{"+(n-1)+"\\}","gm"),i=i.replace(r,arguments[n]);return i},IsNullOrEmpty:function(n){return!n||n===r.Empty}},function(n){n[n.None=0]="None",n[n.AllowLeadingWhite=1]="AllowLeadingWhite",n[n.AllowTrailingWhite=2]="AllowTrailingWhite",n[n.AllowInnerWhite=4]="AllowInnerWhite",n[n.AllowWhiteSpaces=7]="AllowWhiteSpaces",n[n.NoCurrentDateDefault=8]="NoCurrentDateDefault",n[n.AdjustToUniversal=16]="AdjustToUniversal",n[n.AssumeLocal=32]="AssumeLocal",n[n.AssumeUniversal=64]="AssumeUniversal",n[n.RoundtripKind=128]="RoundtripKind"}(ft||(ft={})),v={IsDigit:function(n){var t=n.charCodeAt(0);return t>=48&&t<=57},IsWhiteSpace:function(n){var t=n.charCodeAt(0);return t>=9&&t<=13||t===32||t===133||t===160}},function(n){n[n.CustomMode=0]="CustomMode",n[n.StandardDateTimeMode=1]="StandardDateTimeMode&
quot;,n[n.StandardNumericMode=2]="StandardNumericMode"}(t.FormatMode||(t.FormatMode={})),e=t.FormatMode,function(n){n[n.General=0]="General",n[n.Number=1]="Number",n[n.DateTime=2]="DateTime",n[n.Text=3]="Text"}(t.NumberFormatType||(t.NumberFormatType={})),a=t.NumberFormatType,function(n){n[n.Hour=0]="Hour",n[n.Minute=1]="Minute",n[n.Second=2]="Second"}(l||(l={})),i=function(){function n(){}return n.Filter=function(n,t,i){var e,r,u,f;if(n===undefined||n===null||n==="")return n;for(e="",r=0,u=0;u<n.length;u++)f=n[u],f===t?r++:f===i?(r--,r<0&&(r=0)):r===0&&(e+=f);return e.toString()},n.TrimSquareBracket=function(i){return!i||i===r.Empty?i:(i[0]===n.LeftSquareBracket&&(i=t.StringHelper.TrimStart(i,n.LeftSquareBracket)),i[i.length-1]===n.RightSquareBracket&&(i=t.StringHelper.TrimEnd(i,n.RightSquareBracket)),i)},n.IsOperator=function(t){return t===n.Les
sThanSign||t===n.GreaterThanSign||t===n.EqualsThanSign},n.TrimEscape=function(i){for(var o=i.length,f=!1,e=new t.StringBuilder,u,r=0;r<o;r++)u=i.charAt(r),u===n.ReverseSolidusSign?(f=!f,f||e.Append(u)):(f=!1,e.Append(u));return e.toString()},n.AddSquareBracket=function(i){if(!i)throw new Error(t._StringResource.Exp_TokenIsNull);return(i.length===0||i[0]!==n.LeftSquareBracket)&&(i=t.StringHelper.Insert(i,0,n.LeftSquareBracket.toString())),(i.length===0||i[i.length-1]!==n.RightSquareBracket)&&(i=t.StringHelper.Insert(i,i.length,n.RightSquareBracket.toString())),i},n.IsEquals=function(n,t,i){return n||t?n&&t?i?n.toLowerCase()===t.toLowerCase():n===t:!1:!0},n.ReplaceKeyword=function(n,i,u){var f,o,e;if(!n||n===r.Empty||this.IsEquals(i,u,!0))return n;f=n,o=0;for(;;){e=t.StringHelper.IndexOf(f,i,t.StringComparison.CurrentCultureIgnoreCase);if(e>-1)f=t.StringHelper.Remove(f,e,i.length),f=t.StringHelper.Insert(f,e,u),o=e+u.length;else break}return f},n.IsDecima
l=function(t,i){var r=n.DecimalSeparator;return i&&(r=i.NumberDecimalSeparator),t.indexOf(r)>-1},n.DoubleQuote='"',n.SingleQuote="'",n.Tab="\t",n.LeftSquareBracket="[",n.RightSquareBracket="]",n.LessThanSign="<",n.GreaterThanSign=">",n.EqualsThanSign="=",n.PlusSign="+",n.HyphenMinus="-",n.UnderLine="_",n.LeftParenthesis="(",n.RightParenthesis=")",n.Dollar="$",n.Comma=";",n.Space=" ",n.SolidusSign="/",n.ReverseSolidusSign="\\",n.Zero="0",n.QuestionMark="?",n.Colon=":",n.Semicolon=";",n.Sharp="#",n.CommercialAt="@",n.NumberSign="#",n.Asterisk="*",n.Exponential1="E+",n.Exponential2="E-",n.DecimalSeparator=".",n.NumberGroupSeparator=",",n.PercentSymbol="%",n.NaNSymbol=&q
uot;NaN",n.FormatSeparator=";",n.NegativeSign="-",n.ReplacePlaceholder="@",n.ExponentialSymbol="E",n.DateTimeFormatInfo=t._CultureInfo.currentCulture.DateTimeFormat(),n.NumberFormatInfo=new t._NumberFormatInfo("en-us"),n}(),o=function(){function n(){}return n.IsNumber=function(n){return u(n,"number")||u(n,"DateTime")||u(n,"TimeSpan")||n&&!u(n,"boolean")&&!isNaN(n)},n.ToDouble=function(n){return n===null||n===undefined||n===""?0:u(n,"number")?n:u(n,"string")&&!isNaN(n)?t._NumberHelper.parseLocale(n):u(n,"boolean")?n?1:0:u(n,"DateTime")?new t._DateTimeHelper(n).toOADate():u(n,"TimeSpan")?new t._DateTimeHelper(n).TotalDays():parseFloat(n)},n.toString=function(n){try{return n===null||n===undefined?"":typeof n=="boolean"?n?"TRUE":"FALSE":typeof n=="string"?n:n.to
String()}catch(t){return""}},n}(),t.FormatConverter=o,f=function(){function n(n,t){this._classNames=["NumberFormatBase","IFormatter","IFormatProviderSupport"],this.numberFormatInfo=null,this.dateTimeFormatInfo=null,this._initFileds(),this.partLocaleID=n,this.partDbNumberFormat=t}return n.prototype._initFileds=function(){this.numberStringConverter=null,this.numberFormatInfo=null,this.dateTimeFormatInfo=null,this.partLocaleID=null,this.partDbNumberFormat=null},n.prototype.NumberStringConverter=function(n){return arguments.length===0?this.numberStringConverter?this.numberStringConverter:null:(this.numberStringConverter=n,n)},n.prototype.PartLocaleID=function(){return s(this.partLocaleID,"LocaleIDFormatPart")},n.prototype.PartDBNumberFormat=function(){return s(this.partDbNumberFormat,"DBNumberFormatPart")},n.prototype.DateTimeFormatInfo=function(n){return arguments.length===0?this.dateTimeFormatInfo:(this.dateTimeFormatInfo=n,n
)},n.prototype.NumberFormatInfo=function(n){return arguments.length===0?this.numberFormatInfo:(this.numberFormatInfo=n,n)},n.prototype.NumberGroupSeparator=function(){return this.NumberFormatInfo()?this.NumberFormatInfo().NumberGroupSeparator:i.NumberGroupSeparator},n.prototype.PercentSymbol=function(){return this.NumberFormatInfo()?this.NumberFormatInfo().PercentSymbol:i.PercentSymbol},n.prototype.PositiveSign=function(){return this.NumberFormatInfo()?this.NumberFormatInfo().PositiveSign:i.NumberFormatInfo.PositiveSign},n.prototype.NegativeSign=function(){return this.NumberFormatInfo()?this.NumberFormatInfo().NegativeSign:i.NegativeSign},n.prototype.DecimalSeparator=function(){return this.NumberFormatInfo()?this.NumberFormatInfo().NumberDecimalSeparator:i.DecimalSeparator},n.prototype.NaNSymbol=function(){return this.NumberFormatInfo()?this.NumberFormatInfo().NaNSymbol:i.NaNSymbol},n.TrimNotSupportSymbol=function(i,r){var o,s,u,f,e;for(arguments.length===1&&(r=!0),o=!1,s=ne
w t.StringBuilder,u=0;u<i.length;u++)f=i[u],e=!0,f==='"'?o=!o:o||(r||(f==="?"&&(n.IsTransform(i,u)||(e=!1)),f==="/"&&(n.IsTransform(i,u)||(e=!1))),f==="_"?n.IsTransform(i,u)||(e=!1,u++):f==="*"&&(n.IsTransform(i,u)||(e=!1))),e&&s.Append(f);return s.toString()},n.IsTransform=function(n,i){if(n[i]==="\\")throw new Error(t._StringResource.Exp_InvalidBackslash);if(i-1>0&&i-1<n.length)if(n[i-1]==="\\")if(i-2<0)return!0;else if(i-2>0&&i-2<n.length)return n[i-2]!=="\\";return!1},n.ContainsKeywords=function(n,u){var e,f,c,o,h;if(!n||n===r.Empty)return!1;var l=new t.StringBuilder,s=!1,a=null;for(e=0;e<n.length;e++)f=n[e],f==='"'?s=!s:s||f!==i.UnderLine&&a!==i.UnderLine&&l.Append(f),a=f;for(c=l.toString().toLowerCase(),o=0;o<u.length;o++){h=u[o];if(t.StringHelper.Contains(c,h))return!0}return!1},n.prototype.Format=function(n){r
eturn""},n.prototype.Parse=function(n){return null},n.prototype.FormatString=function(){return""},n.prototype.ExcelCompatibleFormatString=function(){return""},n.General="General",n}(),k=function(){function n(n){this.ShortDatePattern="d",this.LongDatePattern="D",this.FullDatePatternShortTime="f",this.FullDatePatternLongTime="F",this.GeneralDatePatternLongTimeShortTime="g",this.GeneralDatePatternLongTimeLongTime="G",this.MonthDayPattern1="m",this.MonthDayPattern2="M",this.RoundTripDatePattern1="o",this.RoundTripDatePattern2="O",this.RFC1123Pattern1="r",this.RFC1123Pattern2="R",this.SortableDatePattern="s",this.ShortTimePattern="t",this.LongTimePattern="T",this.UniversalSortableDatePattern="u",this.UniversalFullDatePattern="U",this.YearMonthPattern1="y",this.YearMonthPa
ttern2="Y",this._classNames=["StandardDateTimeFormatter","IFormatter"],this._formatString=n}return n.prototype.EvaluateFormat=function(n){return n===this.ShortDatePattern||n===this.LongDatePattern||n===this.FullDatePatternShortTime||n===this.FullDatePatternLongTime||n===this.GeneralDatePatternLongTimeShortTime||n===this.GeneralDatePatternLongTimeLongTime||n===this.MonthDayPattern1||n===this.MonthDayPattern2||n===this.RoundTripDatePattern1||n===this.RoundTripDatePattern2||n===this.RFC1123Pattern1||n===this.RFC1123Pattern2||n===this.SortableDatePattern||n===this.ShortTimePattern||n===this.LongTimePattern||n===this.UniversalSortableDatePattern||n===this.UniversalFullDatePattern||n===this.YearMonthPattern1||n===this.YearMonthPattern2?!0:!1},n.prototype.Format=function(n){try{return n===undefined||n===null||n===""?"":new t._DateTimeHelper(n).localeFormat(this._formatString)}catch(i){return n.toString()}},n.prototype.Parse=function(n){try{
return!n||n===""?null:t._DateTimeHelper.parseLocale(n,this._formatString)}catch(i){return new Date(n)}},n.prototype.FormatString=function(){return this._formatString},n}(),t._StandardDateTimeFormatter=k,d=function(){function n(n){this.CurrencyPattern1="c",this.CurrencyPattern2="C",this.DecimalPattern1="d",this.DecimalPattern2="D",this.ScientificPattern1="e",this.ScientificPattern2="E",this.FixedPointPattern1="f",this.FixedPointPattern2="F",this.GeneralPattern1="g",this.GeneralPattern2="G",this.NumberPattern1="n",this.NumberPattern2="N",this.PercentPattern1="p",this.PercentPattern2="P",this.RoundTripPattern1="r",this.RoundTripPattern2="R",this.HexadecimalPattern1="x",this.HexadecimalPattern2="X",this._classNames=["StandardNumberFormatter","IFormatter"],this._formatString=n}retu
rn n.prototype.EvaluateFormat=function(n){if(n&&n!==r.Empty&&n.length>0){var t=n.substr(0,1);if(t===this.CurrencyPattern1||t===this.CurrencyPattern2||t===this.DecimalPattern1||t===this.DecimalPattern2||t===this.ScientificPattern1||t===this.ScientificPattern2||t===this.FixedPointPattern1||t===this.FixedPointPattern2||t===this.GeneralPattern1||t===this.GeneralPattern2||t===this.NumberPattern1||t===this.NumberPattern2||t===this.PercentPattern1||t===this.PercentPattern2||t===this.RoundTripPattern1||t===this.RoundTripPattern2||t===this.HexadecimalPattern1||t===this.HexadecimalPattern2)return!0}return!1},n.prototype.Format=function(n){try{return!n||n===""?"":new t._NumberHelper(n).localeFormat(this._formatString)}catch(i){return n.toString()}},n.prototype.Parse=function(n){try{return!n||n===""?null:t._NumberHelper.parseLocale(n)}catch(r){var i=parseFloat(n);return isNaN(i)||!isFinite(i)?null:i}},n.prototype.FormatString=function(){return th
is._formatString},n}(),t._StandardNumberFormatter=d,b=function(r){function u(n,t,u){r.call(this,t,u),this._classNames=["NumberFormatText","IFormatter"];var e=f.TrimNotSupportSymbol(n,!1);t&&(e=i.ReplaceKeyword(e,this.PartLocaleID().OriginalToken(),this.PartLocaleID().CurrencySymbol())),e=i.Filter(e,i.LeftSquareBracket,i.RightSquareBracket),e=i.TrimEscape(e),this._formatString=e}return __extends(u,r),u.prototype.Format=function(i){try{var r=n.spread.Calc.Convert.toString(i),u=t.StringHelper.Replace(this._formatString,'"',"");return u&&(r=t.StringHelper.Replace(u,"@",r)),r}catch(f){return""}},u.prototype.Parse=function(n){return n?n:""},u.prototype.FormatString=function(){return this._formatString},u.EvaluateFormat=function(n){return!0},u.prototype.DefaultDateTimeNumberStringConverter=function(){},u}(f),ut=function(){function n(n){this._innerFormatter=n}return n.prototype.FormatString=function(){return th
is._innerFormatter?this._innerFormatter.FormatString():""},n.prototype.innerFormatter=function(n){return arguments.length===0?this._innerFormatter:(this._innerFormatter=n,this)},n.prototype.Parse=function(n){return this._innerFormatter?this._innerFormatter.Parse(n):n},n.prototype.Format=function(n){return this._innerFormatter?this._innerFormatter.Format(n):n===undefined||n===null?"":n.toString()},n.prototype.toJSON=function(){return null},n}(),t.AutoFormatter=ut,g=function(){function n(n){this.conditionFormatPart=null,this.colorFormatPart=null,this.localeIDFormatPart=null,this.dbNumberFormatPart=null,this.numberFormat=null,this.dateTimeFormatInfo=null,this.numberFormatInfo=null,this.formatCached=null,this._classNames=["CustomNumberFormat","IFormatter","IFormatProviderSupport"],arguments.length===0?(this.formatCached=f.General,this.numberFormat=new h):this.Init(n)}return n.prototype.Init=function(n){var y,a,d,l,o,k;if(n===null||n===un
defined)throw new Error(t._StringResource.Exp_FormatIllegal);this.formatCached=n;var e=null,f=null,v=!1,w=[];for(y=0;y<n.length;y++){a=n[y];if(a===i.LeftSquareBracket){if(v)throw new Error(t._StringResource.Exp_FormatIllegal);else f&&(e||(e=new t.StringBuilder),e.Append(f.toString()),f=null),f=new t.StringBuilder,f.Append(a);v=!0}else if(a===i.RightSquareBracket){if(v)if(f){f||(f=new t.StringBuilder),f.Append(a),d=f.toString(),l=s(c.Create(d),"FormatPartBase");if(l&&!u(l,"ABSTimeFormatPart"))this.AddPart(l);else if(u(l,"ABSTimeFormatPart"))w.push(s(l,"ABSTimeFormatPart")),e||(e=new t.StringBuilder),e.Append(f.toString());else throw new Error(t._StringResource.Exp_FormatIllegal);f=null}else throw new Error(t._StringResource.Exp_FormatIllegal);else throw new Error(t._StringResource.Exp_FormatIllegal);v=!1}else f||(f=new t.StringBuilder),f.Append(a)}if(f)if(v)throw new Error(t._StringResource.Exp_FormatIllegal);else e||(e=new t
.StringBuilder),e.Append(f.toString());o=e?e.toString():r.Empty;if(h.EvaluateFormat(o))this.numberFormat=new h(o,this.LocaleIDFormatPart(),this.dbNumberFormatPart);else if(it.EvaluateFormat(o))k=w.length>0?w:null,this.numberFormat=new it(o,k,this.LocaleIDFormatPart(),this.dbNumberFormatPart);else if(p.EvaluateFormat(o))this.numberFormat=new p(n,this.LocaleIDFormatPart(),this.dbNumberFormatPart);else if(b.EvaluateFormat(o))this.numberFormat=new b(n,this.LocaleIDFormatPart(),this.dbNumberFormatPart);else throw new Error(t._StringResource.Exp_FormatIllegal);},n.prototype.FormatString=function(){var n=new t.StringBuilder;return this.numberFormat&&this.numberFormat.FormatString()&&(this.ColorFormatPart()&&n.Append(this.ColorFormatPart().toString()),this.ConditionFormatPart()&&n.Append(this.ConditionFormatPart().toString()),this.DBNumberFormatPart()&&n.Append(this.DBNumberFormatPart().toString()),this.LocaleIDFormatPart()&&n.Append(this.L
ocaleIDFormatPart().toString()),n.Append(this.numberFormat.FormatString())),n.toString()},n.prototype.ConditionFormatPart=function(){return this.conditionFormatPart},n.prototype.ColorFormatPart=function(){return this.colorFormatPart},n.prototype.LocaleIDFormatPart=function(){return this.localeIDFormatPart},n.prototype.DBNumberFormatPart=function(){return this.dbNumberFormatPart},n.prototype.NumberStringConverter=function(n){if(arguments.length===0)return this.numberFormat?this.numberFormat.NumberStringConverter():null;else this.numberFormat&&this.numberFormat.NumberStringConverter(n)},n.prototype.ExcelCompatibleFormatString=function(){var n=new t.StringBuilder;return this.numberFormat&&this.numberFormat.ExcelCompatibleFormatString()&&(u(this.numberFormat,"NumberFormatDigital")||(this.DBNumberFormatPart()&&n.Append(this.DBNumberFormatPart().toString()),this.LocaleIDFormatPart()&&n.Append(this.LocaleIDFormatPart().toString()),this.Cond
itionFormatPart()&&n.Append(this.ConditionFormatPart().toString()),this.ColorFormatPart()&&n.Append(this.ColorFormatPart().toString())),n.Append(this.numberFormat.ExcelCompatibleFormatString())),n.toString()},n.prototype.Formatter=function(){return this.numberFormat},n.prototype.DateTimeFormatInfo=function(n){return arguments.length===0?this.Formatter().DateTimeFormatInfo():(this.Formatter().DateTimeFormatInfo(n),this.dateTimeFormatInfo=n,n)},n.prototype.NumberFormatInfo=function(n){return arguments.length===0?this.Formatter().NumberFormatInfo():(this.Formatter().NumberFormatInfo(n),this.numberFormatInfo=n,n)},n.prototype.AddPart=function(n){if(!n)throw new Error(t._StringResource.Exp_PartIsNull);if(u(n,"ConditionFormatPart"))if(this.conditionFormatPart)throw new Error(t._StringResource.Exp_DuplicatedDescriptor);else this.conditionFormatPart=s(n,"ConditionFormatPart");else if(u(n,"ColorFormatPart"))if(this.colorFormatPart)throw new Error
(t._StringResource.Exp_DuplicatedDescriptor);else this.colorFormatPart=s(n,"ColorFormatPart");else if(u(n,"LocaleIDFormatPart"))if(this.localeIDFormatPart)throw new Error(t._StringResource.Exp_DuplicatedDescriptor);else this.localeIDFormatPart=s(n,"LocaleIDFormatPart");else if(u(n,"DBNumberFormatPart"))if(this.dbNumberFormatPart)throw new Error(t._StringResource.Exp_DuplicatedDescriptor);else this.dbNumberFormatPart=s(n,"DBNumberFormatPart")},n.prototype.Format=function(n){return this.numberFormat.Format(n)},n.prototype.Parse=function(n){return this.numberFormat.Parse(n)},n}(),w=function(){function n(n,t){this.formatters=null,this.formatModeType=e.CustomMode,this.dateTimeFormatInfo=null,this.numberFormatInfo=null,this.isSingleFormatterInfo=!0,this.isDefault=!0,this.isConstructed=!1,this.PropertyChanged=[],this._classNames=["GeneralFormatter","IFormatter","INotifyPropertyChanged","IColorFormatter&quo
t;],r.IsNullOrEmpty(n)&&(n=f.General),t||(t=e.CustomMode),this.formatCached=n,this.formatModeType=t,this.isDefault=this.formatCached.toLowerCase()===f.General.toLowerCase(),this.isConstructed=!1}return n.DefaultNumberFormatter=function(){return this.defaultNumberFormatter||(this.defaultNumberFormatter=new n("###################0.################")),this.defaultNumberFormatter},n.DefaultGeneralFormatter=function(){return this.defaultGeneralFormatter||(this.defaultGeneralFormatter=new n),this.defaultGeneralFormatter},n.DefaultShortDatePatternFormatter=function(){return this.defaultShortDatePatternFormatter||(this.defaultShortDatePatternFormatter=new n(i.DateTimeFormatInfo.ShortDatePattern)),this.defaultShortDatePatternFormatter},n.DefaultSXDatetimePatternFormatter=function(){return this.defaultSXDatetimePatternFormatter||(this.defaultSXDatetimePatternFormatter=new n("m/d/yyyy h:mm:ss tt")),this.defaultSXDatetimePatternFormatter},n.DefaultLongTimePatternForm
atter=function(){return this.defaultLongTimePatternFormatter||(this.defaultLongTimePatternFormatter=new n(i.DateTimeFormatInfo.LongTimePattern)),this.defaultLongTimePatternFormatter},n.DefaultDMMMFormatter=function(){return this.defaultDMMMFormatter||(this.defaultDMMMFormatter=new n("d-mmm")),this.defaultDMMMFormatter},n.DefaultMMMYYFormatter=function(){return this.defaultMMMYYFormatter||(this.defaultMMMYYFormatter=new n("mmm-yy")),this.defaultMMMYYFormatter},n.DefaultHMMFormatter=function(){return this.defaultHMMFormatter||(this.defaultHMMFormatter=new n("h:mm")),this.defaultHMMFormatter},n.DefaultHMMSSFormatter=function(){return this.defaultHMMSSFormatter||(this.defaultHMMSSFormatter=new n("h:mm:ss")),this.defaultHMMSSFormatter},n.DefaultHMMSS0Formatter=function(){return this.defaultHMMSS0Formatter||(this.defaultHMMSS0Formatter=new n("h:mm:ss.0")),this.defaultHMMSS0Formatter},n.DefaultComboNumberFormatter1=function(){return this.de
faultComboNumberFormatter1||(this.defaultComboNumberFormatter1=new n(r.Format("{0}#,##0.00;[Red]({0}#,##0.00)",i.NumberFormatInfo.CurrencySymbol))),this.defaultComboNumberFormatter1},n.DefaultComboNumberFormatter2=function(){return this.defaultComboNumberFormatter2||(this.defaultComboNumberFormatter2=new n(r.Format("{0}#,##0;[Red]({0}#,##0)",i.NumberFormatInfo.CurrencySymbol))),this.defaultComboNumberFormatter2},n.DefaultStandardNumberFormatter=function(){return this.defaultStandardNumberFormatter||(this.defaultStandardNumberFormatter=new n("0.00E+00")),this.defaultStandardNumberFormatter},n.DefaultStandardPercentFormatter1=function(){return this.defaultStandardPercentFormatter1||(this.defaultStandardPercentFormatter1=new n("0.00%")),this.defaultStandardPercentFormatter1},n.DefaultStandardPercentFormatter2=function(){return this.defaultStandardPercentFormatter2||(this.defaultStandardPercentFormatter2=new n("0%")),this.defaultStandard
PercentFormatter2},n.DefaultStandardGroupNumberFormatter1=function(){return this.defaultStandardGroupNumberFormatter1||(this.defaultStandardGroupNumberFormatter1=new n("#,##0.00")),this.defaultStandardGroupNumberFormatter1},n.DefaultStandardGroupNumberFormatter2=function(){return this.defaultStandardGroupNumberFormatter2||(this.defaultStandardGroupNumberFormatter2=new n("#,##0")),this.defaultStandardGroupNumberFormatter2},n.prototype.findDateTimeGeneralFormatter=function(n,i,r,u){var e,o,f;if(r&&r.length>0)for(e in r)if(r.hasOwnProperty(e)){o=r[e],f=t._DateTimeHelper.parseLocale(n,o);if(f&&f-i==0)return u()}return null},n.prototype.toJSON=function(){return{formatters:this.formatters}},n.prototype.HasFormatedColor=function(){return this.isDefault?!1:this.PositiveExpression()&&this.PositiveExpression().ColorFormatPart()?!0:this.NegativeExpression()&&this.NegativeExpression().ColorFormatPart()?!0:this.ZeroExpression()&&this
.ZeroExpression().ColorFormatPart()?!0:this.TextExpression()&&this.TextExpression().ColorFormatPart()?!0:!1},n.prototype.IsDefaultFormat=function(){return this.isDefault},n.prototype.FormatString=function(n){var o,s,h,c;if(arguments.length===0){this.Init(),o=null;switch(this.FormatMode()){case e.CustomMode:if(this.formatters)for(s=0;s<this.formatters.length;s++)h=this.formatters[s],u(h,"CustomNumberFormat")&&(o?o.Append(i.FormatSeparator):o=new t.StringBuilder,c=h.FormatString(),o.Append(c));break;case e.StandardDateTimeMode:if(u(this.formatters[0],"StandardDateTimeFormatter"))return this.formatters[0].FormatString();break;case e.StandardNumericMode:if(u(this.formatters[0],"StandardNumberFormatter"))return this.formatters[0].FormatString();break}return o?o.toString():r.Empty}else{if(!n)throw new Error(t._StringResource.Exp_ValueIsNull);this.formatters=null,this.formatCached=n,this.isDefault=this.formatCached.toLowerCase()===f.General.
toLowerCase(),this.isConstructed=!1,this.Init(),this.RaisePropertyChanged("FormatString")}},n.prototype.DateTimeFormatInfo=function(n){var t,r,f;if(arguments.length===0)return this.Init(),this.dateTimeFormatInfo?this.dateTimeFormatInfo:i.DateTimeFormatInfo;else{this.Init(),this.dateTimeFormatInfo=n;if(this.formatters)for(t=0;t<this.formatters.length;t++)r=this.formatters[t],u(r,"IFormatProviderSupport")&&(f=r,f.DateTimeFormatInfo(n));return this.RaisePropertyChanged("DateTimeFormatInfo"),n}},n.prototype.NumberFormatInfo=function(n){var t,r,f;if(arguments.length===0)return this.Init(),this.numberFormatInfo?this.numberFormatInfo:i.NumberFormatInfo;else{this.Init(),this.numberFormatInfo=n;if(this.formatters)for(t=0;t<this.formatters.length;t++)r=this.formatters[t],u(r,"IFormatProviderSupport")&&(f=r,f.NumberFormatInfo(n));return this.RaisePropertyChanged("NumberFormatInfo"),n}},n.prototype.FormatMode=function(n){re
turn arguments.length===0?this.formatModeType:(this.formatModeType=n,this.RaisePropertyChanged("FormatMode"),n)},n.prototype.ExcelCompatibleFormatString=function(){var n,f,o,s;this.Init(),n=null;switch(this.FormatMode()){case e.CustomMode:if(this.formatters)for(f=0;f<this.formatters.length;f++)o=this.formatters[f],u(o,"CustomNumberFormat")&&(n?n.Append(i.FormatSeparator):n=new t.StringBuilder,s=o.ExcelCompatibleFormatString(),n.Append(s));break;case e.StandardDateTimeMode:if(u(this.formatters[0],"StandardDateTimeFormatter"))return this.formatters[0].ExcelCompatibleFormatString();break;case e.StandardNumericMode:if(u(this.formatters[0],"StandardNumberFormatter"))return this.formatters[0].ExcelCompatibleFormatString();break}return n?n.toString():r.Empty},n.prototype.PositiveExpression=function(){return this.Init(),this.formatters&&this.formatters.length>0?s(this.formatters[0],"CustomNumberFormat"):null},n.prototyp
e.NegativeExpression=function(){return this.Init(),this.formatters&&this.formatters.length>1?s(this.formatters[1],"CustomNumberFormat"):null},n.prototype.ZeroExpression=function(){return this.Init(),this.formatters&&this.formatters.length>2?s(this.formatters[2],"CustomNumberFormat"):null},n.prototype.TextExpression=function(){return this.Init(),this.formatters&&this.formatters.length>3?s(this.formatters[3],"CustomNumberFormat"):null},n.prototype.GetFormatType=function(n){var t,i;this.Init(),t=this.GetFormatInfo(n);if(u(t,"CustomNumberFormat")){i=t.Formatter();if(u(i,"NumberFormatDigital"))return a.Number;else if(u(i,"NumberFormatDateTime"))return a.DateTime;else if(u(i,"NumberFormatText"))return a.Text}else if(u(t,"NumberFormatDigital")||u(t,"StandardNumberFormatter"))return a.Number;else if(u(t,"NumberFormatDateTime")||u(t,"StandardDateTimeFormat
ter"))return a.DateTime;else if(u(t,"NumberFormatText"))return a.Text;return a.General},n.prototype.GetPreferredEditingFormatter=function(i){var r,f;return this.Init(),u(i,"DateTime")?(r=new t._DateTimeHelper(i),r.Hour()===0&&r.Minute()===0&&r.Second()===0&&r.Millisecond()===0?n.DefaultShortDatePatternFormatter():n.DefaultSXDatetimePatternFormatter()):u(i,"TimeSpan")?n.DefaultLongTimePatternFormatter():o.IsNumber(i)?(f=o.ToDouble(i),f>1e20?new n("0.##E+00"):n.DefaultNumberFormatter()):u(i,"string")?n.DefaultGeneralFormatter():n.DefaultGeneralFormatter()},n.prototype.GetPreferredDisplayFormatter=function(f,e){var s;e||(e={value:null}),e.value=null,this.Init();if(r.IsNullOrEmpty(f))return new n;var l=f,c=e.value=this.Parse(l),a=this;if(u(c,"DateTime")||u(c,"TimeSpan")){if(s=this.findDateTimeGeneralFormatter(f,c,h.GeneralMonthDay(),function(){return n.DefaultDMMMFormatter()}))return s;
if(s=this.findDateTimeGeneralFormatter(f,c,h.GeneralYearMonth(),function(){return n.DefaultMMMYYFormatter()}))return s;if(s=this.findDateTimeGeneralFormatter(f,c,h.GeneralYearMonthDay(),function(){return n.DefaultShortDatePatternFormatter()}))return s;if(s=this.findDateTimeGeneralFormatter(f,c,h.GeneralHourMinute(),function(){return n.DefaultHMMFormatter()}))return s;if(s=this.findDateTimeGeneralFormatter(f,c,h.GeneralHourMinuteSecond(),function(){return n.DefaultHMMSSFormatter()}))return s;if(s=this.findDateTimeGeneralFormatter(f,c,h.GeneralHourMinuteSecondSubSecond(),function(){return n.DefaultHMMSS0Formatter()}))return s;if(s=this.findDateTimeGeneralFormatter(f,c,h.GeneralHourMinuteWithDate(),function(){return n.defaultShortDatePatternHMMFormatter||(n.defaultShortDatePatternHMMFormatter=new n(a.DateTimeFormatInfo().ShortDatePattern+" h:mm")),n.defaultShortDatePatternHMMFormatter}))return s;if(s=this.findDateTimeGeneralFormatter(f,c,h.GeneralHourMinuteSecondWithDate(),fu
nction(){return n.defaultShortDatePatternHMMSSFormatter||(n.defaultShortDatePatternHMMSSFormatter=new n(a.DateTimeFormatInfo().ShortDatePattern+" h:mm:ss")),n.defaultShortDatePatternHMMSSFormatter}))return s;if(s=this.findDateTimeGeneralFormatter(f,c,h.GeneralHourMinuteSecondSubSecondWithDate(),function(){return n.defaultShortDatePatternHMMSS0Formatter||(n.defaultShortDatePatternHMMSS0Formatter=new n(a.DateTimeFormatInfo().ShortDatePattern+" h:mm:ss.0")),n.defaultShortDatePatternHMMSS0Formatter}))return s}else if(o.IsNumber(c))if(l[0]===i.NumberFormatInfo.CurrencySymbol[0])return t.StringHelper.Contains(l,i.DecimalSeparator)?n.DefaultComboNumberFormatter1():n.DefaultComboNumberFormatter2();else if(t.StringHelper.IndexOf(l,"e",t.StringComparison.CurrentCultureIgnoreCase)>-1)return n.DefaultStandardNumberFormatter();else if(l[0].toString()===i.PercentSymbol||l[l.length-1].toString()===i.PercentSymbol)return t.StringHelper.Contains(l,i.DecimalSeparator)
?n.DefaultStandardPercentFormatter1():n.DefaultStandardPercentFormatter2();else if(t.StringHelper.Contains(l,i.NumberGroupSeparator))return t.StringHelper.Contains(l,i.DecimalSeparator)?n.DefaultStandardGroupNumberFormatter1():n.DefaultStandardGroupNumberFormatter2();return n.DefaultGeneralFormatter()},n.prototype.Format=function(n,t){var f,a,h,l,e,c;if(u(n,"boolean"))return n.toString().toUpperCase();t&&(t.value=null),this.Init(),f=this.GetFormatInfo(n),u(f,"CustomNumberFormat")&&(a=f.ColorFormatPart(),t&&a&&(t.value=a.ForeColor())),h=0,l=o.IsNumber(n),l&&(h=o.ToDouble(n));if(f){e=null;if(l&&f===this.NegativeExpression())e=f.Format(Math.abs(h)),u(f,"CustomNumberFormat")&&(c=s(f,"CustomNumberFormat"),c&&c.ConditionFormatPart()&&c.ConditionFormatPart().Value()>0&&h<0&&(e=i.NegativeSign+e));else try{e=f.Format(n)}catch(v){u(n,"string")&&am
p;(e=n.toString())}return e?e:r.Empty}else return l&&h<0?i.HyphenMinus.toString():u(n,"string")?n.toString():n===undefined||n===null?r.Empty:n.toString()},n.prototype.Parse=function(n){return this.Init(),this.formatters&&this.formatters.length>0?this.formatters[0].Parse(n):null},n.prototype.Init=function(){if(!this.isConstructed){this.isConstructed=!0;switch(this.formatModeType){case e.CustomMode:this.InitExcelCompatibleMode(this.formatCached);break;case e.StandardDateTimeMode:this.InitStandardDateTimeMode(this.formatCached);break;case e.StandardNumericMode:this.InitStandardNumericMode(this.formatCached);break}}},n.prototype.InitStandardDateTimeMode=function(n){var i=new k(n);if(i.EvaluateFormat(n))this.formatters=[],this.formatters.push(i);else throw new Error(t._StringResource.Exp_FormatIllegal);},n.prototype.InitStandardNumericMode=function(n){var i=new d(n);if(i.EvaluateFormat(n))this.formatters=[],this.formatters.push(i);else throw new Error(t._S
tringResource.Exp_FormatIllegal);},n.prototype.InitExcelCompatibleMode=function(n){var u,o,f,e;if(r.IsNullOrEmpty(n))throw new Error(t._StringResource.Exp_FormatIllegal);this.formatters=[];if(this.isDefault)this.formatters.push(new g);else{this.isSingleFormatterInfo=!t.StringHelper.Contains(n,i.FormatSeparator.toString()),u=n.split(i.FormatSeparator);if(!u)throw new Error(t._StringResource.Exp_FormatIllegal);if(u.length<1||u.length>5)throw new Error(t._StringResource.Exp_FormatIllegal);for(o=0,f=0;f<u.length;f++){o++;if(o>4)break;e=new g(u[f]),e&&this.formatters.push(e)}if(!this.PositiveExpression())throw new Error(t._StringResource.Exp_FormatIllegal);}},n.prototype.GetFormatInfo=function(n){if(this.FormatMode()===e.CustomMode){if(typeof n=="string"&&isNaN(n))return this.TextExpression()?this.TextExpression():this.PositiveExpression();else if(o.IsNumber(n)||u(n,"boolean")){var f=this.PositiveExpression(),r=this.NegativeExpression(),i=o
.ToDouble(n),s=f&&f.ConditionFormatPart(),h=r&&r.ConditionFormatPart(),t=this.isSingleFormatterInfo?this.PositiveExpression():null;return this.PositiveExpression()&&(s?f.ConditionFormatPart().IsMeetCondition(i)&&(t=f):(i>0||i===0&&!this.ZeroExpression())&&(t=f)),!t&&this.NegativeExpression()&&(h?r.ConditionFormatPart().IsMeetCondition(i)&&(t=r):i<0&&(t=r)),!t&&this.ZeroExpression()&&i===0&&(t=this.ZeroExpression()),!t&&this.ZeroExpression()&&(t=this.ZeroExpression()),!t&&this.NegativeExpression()&&(t=this.NegativeExpression()),t}}else if(this.FormatMode()===e.StandardDateTimeMode||this.FormatMode()===e.StandardNumericMode)if(this.formatters&&this.formatters.length===1)return this.formatters[0];return null},n.prototype.RaisePropertyChanged=function(n){var t,i;if(this.PropertyChanged)for(t=0;t<this.PropertyChanged.length;t++)i=this.Pr
opertyChanged[t],typeof i=="function"&&i(this,n)},n.defaultNumberFormatter=null,n.defaultGeneralFormatter=null,n.defaultShortDatePatternFormatter=null,n.defaultLongTimePatternFormatter=null,n.defaultSXDatetimePatternFormatter=null,n.defaultDMMMFormatter=null,n.defaultMMMYYFormatter=null,n.defaultHMMFormatter=null,n.defaultHMMSSFormatter=null,n.defaultHMMSS0Formatter=null,n.defaultShortDatePatternHMMFormatter=null,n.defaultShortDatePatternHMMSSFormatter=null,n.defaultShortDatePatternHMMSS0Formatter=null,n.defaultComboNumberFormatter1=null,n.defaultComboNumberFormatter2=null,n.defaultStandardNumberFormatter=null,n.defaultStandardPercentFormatter1=null,n.defaultStandardPercentFormatter2=null,n.defaultStandardGroupNumberFormatter1=null,n.defaultStandardGroupNumberFormatter2=null,n}(),t.GeneralFormatter=w;var c=function(){function n(n){this._classNames=["FormatPartBase"],this.originalToken=n}return n.prototype.OriginalToken=function(){return this.originalToken
},n.prototype.SupportedPartFormat=function(){return n._supportedPartFormat||(n._supportedPartFormat=["ConditionFormatPart","ColorFormatPart","LocaleIDFormatPart"]),n._supportedPartFormat},n.Create=function(n){return nt.EvaluateFormat(n)?new nt(n):rt.EvaluateFormat(n)?new rt(n):tt.EvaluateFormat(n)?new tt(n):ot.EvaluateFormat(n)?new ot(n):et.EvaluateFormat(n)?new et(n):null},n}(),nt=function(n){function u(u){var s,l,a,h;n.call(this,u),c.call(this,u),this._classNames.push("ConditionFormatPart"),this._initFileds(),s=i.TrimSquareBracket(u);if(r.IsNullOrEmpty(s))throw new Error(t._StringResource.Exp_TokenIllegal);for(var f=null,o=0,e=null;o<s.length;o++){e=s[o];if(i.IsOperator(e))f||(f=new t.StringBuilder),f.Append(e);else break}if(!f)throw new Error(t._StringResource.Exp_TokenIllegal);l=f.toString(),f=null;switch(l){case"<":this.compareOperator=t.GeneralCompareType.LessThan;break;case"<=":this.compareOperator=t.General
CompareType.LessThanOrEqualsTo;break;case"=":this.compareOperator=t.GeneralCompareType.EqualsTo;break;case">=":this.compareOperator=t.GeneralCompareType.GreaterThanOrEqualsTo;break;case">":this.compareOperator=t.GeneralCompareType.GreaterThan;break;case"<>":this.compareOperator=t.GeneralCompareType.NotEqualsTo;break;default:throw new Error(t._StringResource.Exp_TokenIllegal);}for(;o<s.length;o++){e=s[o];if(i.IsOperator(e))throw new Error(t._StringResource.Exp_TokenIllegal);f||(f=new t.StringBuilder),f.Append(e)}if(!f)throw new Error(t._StringResource.Exp_TokenIllegal);a=f.toString(),h=parseFloat(a);if(isNaN(h))throw new Error(t._StringResource.Exp_TokenIllegal);else this.value=h}return __extends(u,n),u.prototype._initFileds=function(){this.value=0,this.compareOperator=null},u.prototype.CompareOperator=function(){return this.compareOperator},u.prototype.Value=function(){return this.value},u.prototype.toString=function(){var n=new
t.StringBuilder,r;switch(this.compareOperator){case t.GeneralCompareType.EqualsTo:n.Append("=");break;case t.GeneralCompareType.GreaterThan:n.Append(">");break;case t.GeneralCompareType.GreaterThanOrEqualsTo:n.Append(">=");break;case t.GeneralCompareType.LessThan:n.Append("<");break;case t.GeneralCompareType.LessThanOrEqualsTo:n.Append("<=");break;case t.GeneralCompareType.NotEqualsTo:n.Append("<>");break;default:throw new Error;}return n.Append(this.value.toString()),r=i.AddSquareBracket(n.toString())},u.prototype.IsMeetCondition=function(n){switch(this.compareOperator){case t.GeneralCompareType.EqualsTo:return n===this.value;case t.GeneralCompareType.GreaterThan:return n>this.value;case t.GeneralCompareType.GreaterThanOrEqualsTo:return n>=this.value;case t.GeneralCompareType.LessThan:return n<this.value;case t.GeneralCompareType.LessThanOrEqualsTo:return n<=this.value;case t.GeneralCompareTy
pe.NotEqualsTo:return n!==this.value}return!1},u.EvaluateFormat=function(n){if(!n||n===r.Empty)return!1;var t=i.TrimSquareBracket(n);return!t||t===r.Empty?!1:i.IsOperator(t[0])},u}(c),et=function(n){function u(u){var f,e,o;n.call(this,u),this.foreColor="black",this.index=-1,this.colorName=null,c.call(this,u),this._classNames.push("ColorFormatPart"),f=i.TrimSquareBracket(u);if(!f||f===r.Empty)throw new Error(t._StringResource.Exp_TokenIllegal);try{this.foreColor=f,this.colorName=f;return}catch(s){}if(f.length>"Color".length){f=t.StringHelper.Remove(f,0,"Color".length),e=-1,o=parseInt(f,10);if(!isNaN(o)){e=o;if(e>=1&&e<=56)return}}throw new Error(t._StringResource.Exp_TokenIllegal);}return __extends(u,n),u.prototype.ForeColor=function(){return this.foreColor},u.prototype.toString=function(){if(this.index>-1)return i.AddSquareBracket("Color"+this.index);else if(this.colorName)return i.AddSquareBracket(this.colorName)
;throw new Error;},u.EvaluateFormat=function(n){if(!n||n===r.Empty)return!1;var u=i.TrimSquareBracket(n);return!u||u===r.Empty?!1:u.length<3?!1:isNaN(n[n.length-1])?n[0]!==n[1]:t.StringHelper.StartsWith(n,"Color",t.StringComparison.CurrentCultureIgnoreCase)},u}(c),ot=function(n){function u(i){var f,r;n.call(this,i),c.call(this,i),this._classNames.push("ABSTimeFormatPart"),this._initFileds();if(u.EvaluateFormat(i)){this.token=i.toLowerCase();if(this.token[1]===u.HoursABSContent)this.type=l.Hour;else if(this.token[1]===u.MinuteABSContent)this.type=l.Minute;else if(this.token[1]===u.SecondABSContent)this.type=l.Second;else throw new Error(t._StringResource.Exp_TokenIllegal);}else throw new Error(t._StringResource.Exp_TokenIllegal);for(f=new t.StringBuilder,r=0;r<this.token.length-2;r++)f.Append("0");this.formatString=f.toString()}return __extends(u,n),u.prototype._initFileds=function(){this.token=null,this.type=null,this.formatString=null},u.prototyp
e.FormatString=function(){return this.formatString},u.prototype.TimePartType=function(){return this.type},u.prototype.Token=function(){return this.token},u.EvaluateFormat=function(n){var t,f,e,o;if(!n||n===r.Empty)return!1;t=i.TrimSquareBracket(n);if(!t||t===r.Empty)return!1;for(t=t.toLowerCase(),f=null,e=0;e<t.length;e++){f||(f=t[e]),o=u;if(f!==o.HoursABSContent&&f!==o.MinuteABSContent&&f!==o.SecondABSContent)return!1;if(f!==t[e])return!1}return!0},u.HoursABSContent="h",u.MinuteABSContent="m",u.SecondABSContent="s",u}(c),ht=function(){function n(n,t){this._classNames=["DBNumber"];var u=null,i=null;if(n){this.units=[];for(u in n)u&&(i=n[u],i===0?this.units.push(r.Empty):this.units.push(i.toString()))}if(t){this.numbers=[];for(u in t)u&&(i=t[u],i===0?this.numbers.push(r.Empty):this.numbers.push(i.toString()))}}return n.prototype.Units=function(){return this.units},n.prototype.Numbers=function(){return this.num
bers},n}(),rt=function(n){function u(r){n.call(this,r),this.token=null,this.type=0,this._classNames.push("DBNumberFormatPart");if(u.EvaluateFormat(r)){this.token=r;var e=i.TrimSquareBracket(r),f=t.StringHelper.Remove(e,0,"dbnum".length);this.type=parseInt(f,10);if(this.type<0||this.type>3)throw new Error(t._StringResource.Exp_TokenIllegal);}else throw new Error(t._StringResource.Exp_TokenIllegal);}return __extends(u,n),u.prototype.Token=function(){return this.token?this.token:r.Empty},u.prototype.Type=function(){return this.type},u.prototype.ReplaceNumberString=function(n,u,f){var h,y;if(!n||n===r.Empty)return n;var s=n,p=n,o=-1,e=-1,v=!1,c=null,a=null,l=null;for(h=n.length-1;h>=0;h--)y=p[h],isNaN(y)&&(!i.IsEquals(y,i.DecimalSeparator,!1)||v)?e>-1&&o>-1&&(c=p.substr(e,o-e+1),a=parseFloat(c),isNaN(a)||(l=this.NumberString(c,u,f),s=t.StringHelper.Remove(s,e,o-e+1),s=t.StringHelper.Insert(s,e,l)),o=-1,e=-1,v=!1):(i.IsEquals(y,i
.DecimalSeparator,!1)&&(v=!0),o===-1&&(o=h),e=h);return e>-1&&o>-1&&(c=p.substr(e,o-e+1),a=parseFloat(c),isNaN(a)||(l=this.NumberString(c,u,f),s=t.StringHelper.Remove(s,e,o-e+1),s=t.StringHelper.Insert(s,e,l)),o=-1,e=-1,v=!1),s},u.prototype.NumberString=function(n,i,r){var f=n.split("."),o,e;if(f)if(f.length===1)return u.FormatNumberString(f[0],r?i.Units():null,i.Numbers());else if(f.length===2)return o=u.FormatNumberString(f[0],r?i.Units():null,i.Numbers()),e=u.FormatNumberString(f[1],i.Numbers()),o+"."+e;throw new Error(t._StringResource.Exp_ValueIllegal);},u.prototype.toString=function(){if(this.type>-1)return i.AddSquareBracket("DBNum"+this.type);throw new Error;},u.EvaluateFormat=function(n){if(!n||n===r.Empty)return!1;var u=i.TrimSquareBracket(n);return!u||u===r.Empty?!1:t.StringHelper.StartsWith(u,"DBNum",t.StringComparison.CurrentCultureIgnoreCase)?!0:!1},u.FormatNumberString=function(n,i,f){var
b=n,y=0,a=null,v=0,d,tt,nt,w,e,c,h,it,k;if(arguments.length===2){for(d=new t.StringBuilder,y=0;y<b.length;y++)a=b.substr(y,1),v=parseInt(a,10),d.Append(f[v]);return d.toString()}else if(arguments.length===3){if(!i)return u.FormatNumberString(n,f);var o=0,g=null,l=b.length,p=!1,s=[];for(y=0;y<l;y++)tt=i.length-1-y,tt>-1?s.push(i[tt].toString()):s.push(r.Empty);for(nt=[],e=s.length-1;e>=0;e--)nt[s.length-e-1]=s[e];for(s=nt,w=!1,e=0;e<l;e++)a=b.substr(e,1),v=parseInt(a,10),c=r.Empty,h=r.Empty,l-e-16>0?(c=f[v],h="",w=!0):e!==l-1&&e!==l-5&&e!==l-9&&e!==l-13?a==="0"?(c="",h="",o=o+1):a!=="0"&&o!==0?(c=f[0]+f[v],h=s[e],o=0):(c=f[v],h=s[e],o=0):a!=="0"&&o!==0?(c=f[0]+f[v],h=s[e],o=0):a!=="0"&&o===0||w?(c=f[v],h=s[e],o=0,w=!1):a!=="0"||o<3?l<11?(c="",h=s[e],o=o+1):(c="",o=o+1):(c="",h="",o=o+1),it=c+h=
==r.Empty,it||(p=!1),e!==l-13||p||(h=s[e],p=!0),e!==l-9||p||(h=s[e],p=!0),e===l-1&&(h=s[e],p=!0),g=g+c+h;k=parseInt(n,10);if(!isNaN(k))if(k===0)return f[0];return g}},u}(c),y=function(){function n(){}return n.ParseHexString=function(n){if(!n||n===r.Empty)throw new Error(t._StringResource.Exp_StringIllegal);return parseInt(n,16)},n.FixJapaneseChars=function(n){return n},n.GetFraction=function(n,t,i,r,u){var c=0,w=0,p=0,f=0,o,s,h,l,e;for(n>0?(f=n-Math.ceil(n)+1,f==1?(f=0,c=n):c=Math.ceil(n)-1):n<0&&(c=Math.ceil(n),f=Math.ceil(n)-n),o=2,s=9,o=Math.pow(10,t-1),s=Math.pow(10,t)-1,o<2&&(o=2),s<2&&(s=2),h=!1,l=0,e=o;e<=s;e++){var b=e*f,a=Math.round(b),y=a/e,v=Math.abs(y-f);if(h?v<Math.abs(l-f):!0){h=!0,l=y,w=a,p=e;if(v<.0005)break}}return i.value=c,r.value=w,u.value=p,h},n}(),tt=function(n){function u(u){var f,e;n.call(this,u),this.currencySymbol=null,this.locateID=-1,this.cultureInfo=null,this.content=null,c.call(this,u),this._className
s.push("LocaleIDFormatPart");if(!u)throw new Error(t._StringResource.Exp_TokenIsNull);if(u===r.Empty)throw new Error(t._StringResource.Exp_TokenIllegal);this.content=i.TrimSquareBracket(u),f=this.content;if(!f||f===r.Empty)throw new Error(t._StringResource.Exp_TokenIllegal);if(i.IsEquals(f[0],i.Dollar,!1))f=t.StringHelper.Remove(f,0,1);else throw new Error(t._StringResource.Exp_TokenIllegal);e=f.indexOf(i.HyphenMinus);if(e>-1)this.currencySymbol=f.substr(0,e),f=t.StringHelper.Remove(f,0,e);else{this.currencySymbol=f;return}if(i.IsEquals(f[0],i.HyphenMinus,!1))f=t.StringHelper.Remove(f,0,1);else throw new Error(t._StringResource.Exp_TokenIllegal);if(f.length>0)this.locateID=y.ParseHexString(f);else throw new Error(t._StringResource.Exp_TokenIllegal);}return __extends(u,n),u.prototype.CurrencySymbol=function(){return this.currencySymbol?this.EncodeSymbol(this.currencySymbol):r.Empty},u.prototype.AllowScience=function(){return!0},u.prototype.GetDBNumber=function(n){var
t=this.locateID&255;return null},u.prototype.toString=function(){return this.content?i.AddSquareBracket(this.content):r.Empty},u.prototype.EncodeSymbol=function(n){return t.StringHelper.Replace(n,"\\.","'.'")},u.prototype.CultureInfo=function(){return this.cultureInfo},u.EvaluateFormat=function(n){if(!n||n===r.Empty)return!1;var t=i.TrimSquareBracket(n);return!t||t===r.Empty?!1:i.IsEquals(t[0],i.Dollar,!1)},u}(c),it=function(e){function s(n,r,u,o){e.call(this,u,o),this.validDateTimeFormatString=null,this.formatString=null,this.hasJD=!1,this.absoluteTime=null,this.absTimeParts=null,this.hasYearDelay=!1,this.exactlyMatch=!1,this._init=function(n,r,u,f){var e={value:this.formatString},c,o,h;if(s.EvaluateFormat(e.value)){c=this.ProcessAMPM(e),this.hasJD=this.Replace(e.value,s.MonthJD,'"'+s.PlaceholderMonthJD+'"',!0,!1,e,!1,!1),this.Replace(e.value,s.MonthUnabbreviated,s.StandardMonthUnabbreviated,!0,!1,e,!1,!1),this.Replace(e.value,s.MonthAbbreviation,s
.StandardMonthAbbreviation,!0,!1,e,!1,!1),this.Replace(e.value,s.MonthTwoDigit,s.StandardMonthTwoDigit,!0,!1,e,!1,!1),this.Replace(e.value,s.MonthSingleDigit,s.StandardMonthSingleDigit,!0,!1,e,!1,!1),this.Replace(e.value,s.DayWeekDayAbbreviation,s.StandardDayWeekDayAbbreviation,!0,!0,e,!1,!0),this.Replace(e.value,s.DayWeekDayUnabbreviated,s.StandardDayWeekDayUnabbreviated,!0,!0,e,!1,!0),this.Replace(e.value,s.MinuteSingleDigit,s.StandardMinuteSingleDigit,!1,!0,e,!1,!1),c||(this.Replace(e.value,s.HoursSingleDigit,s.StandardHourSingleDigit,!0,!0,e,!1,!1),this.Replace(e.value,s.HoursTwoDigit,s.StandardHourTwoDigit,!0,!0,e,!1,!1)),this.Replace(e.value,s.SecondSingleDigit,s.StandardSecondSingleDigit,!0,!0,e,!1,!0),this.PartDBNumberFormat()&&this.PartLocaleID()&&(this.hasYearDelay|=this.Replace(e.value,s.YearFourDigit,'"'+i.ReplacePlaceholder+s.YearFourDigit+'"',!0,!1,e,!1,!0),this.hasYearDelay|=this.Replace(e.value,s.YearTwoDigit,'"'+i.ReplacePlaceholder+s.
YearTwoDigit+'"',!0,!1,e,!1,!0)),this.Replace(e.value,s.EraYear,s.YearFourDigit,!0,!1,e,!1,!0),this.Replace(e.value,s.EraYear+s.EraYear,s.YearFourDigit,!0,!1,e,!1,!0),this.Replace(e.value,s.EraYear+s.EraYear+s.EraYear,s.YearFourDigit,!0,!1,e,!1,!0),this.Replace(e.value,s.YearSingleDigit,s.StandardYearSingleDigit,!0,!1,e,!1,!0);if(this.absTimeParts)for(o=0;o<this.absTimeParts.length;o++)h=this.absTimeParts[o],this.Replace(e.value,h.token,i.ReplacePlaceholder+h.token,!0,!0,e,!1,!0);this.validDateTimeFormatString=e.value}else throw new Error(t._StringResource.Exp_FormatIllegal);},this.baseNumberStringConverter=f.prototype.NumberStringConverter,this.baseDateTimeFormatInfo=f.prototype.DateTimeFormatInfo,this._classNames.push("NumberFormatDateTime"),this.exactlyMatch=!1,this.formatString=this.FixFormat(f.TrimNotSupportSymbol(n)),this.absTimeParts=r,this._init(n,r,u,o)}return __extends(s,e),s.EvaluateFormat=function(n){return f.ContainsKeywords(n,s.keywords)},s.prototype.
NumberStringConverter=function(n){return arguments.length===0?this.baseNumberStringConverter()?this.baseNumberStringConverter():s.defaultNumberStringConverter:(this.baseNumberStringConverter(n),n)},s.prototype.AbsoluteTime=function(){return this.absoluteTime?this.absoluteTime:s.defaultAbsoluteTime},s.prototype.FormatString=function(){return this.formatString},s.prototype.DateTimeFormatInfo=function(n){return arguments.length===0?this.baseDateTimeFormatInfo()?this.baseDateTimeFormatInfo():i.DateTimeFormatInfo:(this.baseDateTimeFormatInfo(n),n)},s.prototype.ExcelCompatibleFormatString=function(){var t=this.formatString,n={value:t};return this.Replace(t,s.StandardAMPMSingleDigit,this.CurrentAMPM(),!0,!0,n,!1,!0),this.Replace(t,s.StandardMonthUnabbreviated,s.MonthUnabbreviated,!0,!1,n,!1,!0),this.Replace(t,s.StandardMonthAbbreviation,s.MonthAbbreviation,!0,!1,n,!1,!0),this.Replace(t,s.StandardMonthTwoDigit,s.MonthTwoDigit,!0,!1,n,!1,!0),this.Replace(t,s.StandardMonthSingleDigit,s.MonthS
ingleDigit,!0,!1,n,!1,!0),this.Replace(t,s.StandardDayWeekDayAbbreviation,s.DayWeekDayAbbreviation,!0,!0,n,!1,!0),this.Replace(t,s.StandardDayWeekDayUnabbreviated,s.DayWeekDayUnabbreviated,!0,!0,n,!1,!0),this.Replace(t,s.StandardMinuteSingleDigit,s.MinuteSingleDigit,!1,!0,n,!1,!0),this.Replace(t,s.StandardHourSingleDigit,s.HoursSingleDigit,!0,!0,n,!1,!1),this.Replace(t,s.StandardHourTwoDigit,s.HoursTwoDigit,!0,!0,n,!1,!1),this.Replace(t,s.StandardSecondSingleDigit,s.SecondSingleDigit,!0,!0,n,!1,!0),this.Replace(t,s.StandardSubSecondThreeDigit,s.SubSecondThreeDigit,!0,!0,n,!1,!0),this.Replace(t,s.StandardSubSecondTwoDigit,s.SubSecondTwoDigit,!0,!0,n,!1,!0),this.Replace(t,s.StandardSubSecondSingleDigit,s.SubSecondSingleDigit,!0,!0,n,!1,!0),this.Replace(t,s.YearFourDigit,s.EraYear,!0,!1,n,!1,!0),this.Replace(t,s.StandardYearSingleDigit,s.YearSingleDigit,!0,!0,n,!1,!0),n.value},s.prototype.CurrentAMPM=function(){var n=null,t;return n=this.DateTimeFormatInfo()?this.DateTimeFormatInfo():i
.DateTimeFormatInfo,n&&n.AMDesignator&&n.AMDesignator!==r.Empty&&n.PMDesignator&&n.PMDesignator!==r.Empty?t=r.Format("{0}/{1}",n.AMDesignator,n.PMDesignator):s.AMPMTwoDigit},s.prototype.Format=function(f){var e,c,v,h,k,p,y,w,a,b;if(u(f,"boolean"))return f.toString().toUpperCase();e=r.Empty,c=new Date;try{try{c=n.spread.Calc.Convert.toDateTime(f);if(!c)return f.toString()}catch(g){return f.toString()}v=this.validDateTimeFormatString,h=this.validDateTimeFormatString.replace(/%/g,""),h==="H"||h==="h"||h==="m"||h==="M"||h==="d"||h==="s"||h==="y"?(v="%"+h,this.validDateTimeFormatString=v):v=h,e=new t._DateTimeHelper(c).localeFormat(v),this.hasJD&&(k=this._getMonthName(c.getMonth()),e=t.StringHelper.Replace(e,s.PlaceholderMonthJD,k.substr(0,1)));if(this.absTimeParts)for(p=c-this.AbsoluteTime(),y=0;y<this.absTimeParts.length;y++){w=this.ab
sTimeParts[y],a=null;switch(w.TimePartType()){case l.Hour:a=Math.floor(p/36e5);break;case l.Minute:a=Math.floor(p/6e4);break;case l.Second:a=Math.floor(p/1e3);break}a&&(b=w.token.replace("[","\\[").replace("]","\\]"),e=t.StringHelper.Replace(e,i.ReplacePlaceholder+b,a))}}catch(d){e=o.toString(f)}return this.NumberStringConverter()&&this.hasYearDelay&&(e=t.StringHelper.Replace(e,i.ReplacePlaceholder+s.YearFourDigit,c.toString(s.YearFourDigit)),e=t.StringHelper.Replace(e,i.ReplacePlaceholder+s.YearTwoDigit,c.toString(s.YearTwoDigit))),e},s.prototype._getMonthName=function(n){var t=["January","February","March","April","May","June","July","August","September","October","November","December"];return t[n]},s.prototype.Parse=function(i){var u,o,e,f;if(!i||i===r.Empty)return null;u=y.FixJapaneseChars(i),o=u.t
oLowerCase();if(o==="true")return!0;else if(o==="false")return!1;if(this.validDateTimeFormatString){e=t._DateTimeHelper.parseExact(u,this.validDateTimeFormatString,n.spread._CultureInfo.currentCulture);if(e)return e}if(!this.exactlyMatch)try{return f=n.spread.Calc.Convert.toDateTime(u),f&&!isNaN(f)?f:u}catch(s){return u}return null},s.prototype.FixFormat=function(n){for(var u=n,o=new t.StringBuilder,e=!1,h=t.StringHelper.IndexOf(u,s.HoursSingleDigit[0],t.StringComparison.CurrentCultureIgnoreCase)>-1||t.StringHelper.IndexOf(u,s.SecondSingleDigit[0],t.StringComparison.CurrentCultureIgnoreCase)>-1,c=t.StringHelper.IndexOf(u,s.YearTwoDigit[0],t.StringComparison.CurrentCultureIgnoreCase)>-1||t.StringHelper.IndexOf(u,s.DaySingleDigit[0],t.StringComparison.CurrentCultureIgnoreCase)>-1,r,f=0;f<u.length;f++)r=u[f],r==='"'?e=!e:e||(r==="Y"||r==="D"||r==="S"||r==="E"||r==="G"?r=r.toLowerCase():r==
="M"&&(f>1?i.IsEquals("A",u[f-1],!0)||i.IsEquals("P",u[f-1],!0)||(r=r.toLowerCase()):r=r.toLowerCase())),o.Append(r);return o.toString()},s.prototype.ProcessAMPM=function(n){var u=!1,i,f,r;return t.StringHelper.Contains(n.value,s.AMPMTwoDigit)&&(n.value=t.StringHelper.Replace(n.value,s.AMPMTwoDigit,s.StandardAMPMSingleDigit),u=!0),i=this.DateTimeFormatInfo(),t.StringHelper.Contains(n.value,s.AMPMSingleDigit)&&(n.value=t.StringHelper.Replace(n.value,s.AMPMSingleDigit,s.StandardAMPMSingleDigit),i&&(i.AMDesignator=s.AMPMSingleDigit.substr(0,1),i.PMDesignator=s.AMPMSingleDigit.substr(2,1)),u=!0),f=this.CurrentAMPM(),t.StringHelper.Contains(n.value,f)&&(n.value=t.StringHelper.Replace(n.value,f,s.StandardAMPMSingleDigit),r=f.split("/"),r&&r.length===2&&(i.AMDesignator=r[0],i.PMDesignator=r[1]),u=!0),u},s.prototype.Replace=function(n,r,u,f,e,o,h,c){var a,p,y,b,nt,v,g;o.value=n;if(f||e){var k=
[],w=!0,it=t.StringHelper.IndexOf(o.value,s.HoursSingleDigit[0],t.StringComparison.CurrentCultureIgnoreCase)>-1||t.StringHelper.IndexOf(o.value,s.SecondSingleDigit[0],t.StringComparison.CurrentCultureIgnoreCase)>-1,rt=t.StringHelper.IndexOf(o.value,s.YearTwoDigit[0],t.StringComparison.CurrentCultureIgnoreCase)>-1||t.StringHelper.IndexOf(o.value,s.DaySingleDigit[0],t.StringComparison.CurrentCultureIgnoreCase)>-1;!rt&&it&&(w=!1);for(var d=!1,tt=0,l=0;l<o.value.length;l++){a=o.value[l],i.IsEquals(a,s.HoursSingleDigit[0],!0)||i.IsEquals(a,s.SecondSingleDigit[0],!0)?w=!1:(i.IsEquals(a,s.YearTwoDigit[0],!0)||i.IsEquals(a,s.DaySingleDigit[0],!0))&&(w=!0);if(f&&i.IsEquals(a,r[tt],c)&&w||e&&i.IsEquals(a,r[tt],c)&&!w){for(p=!0,y=0;y<r.length;y++)if(y+l>=n.length||!i.IsEquals(r[y],o.value[y+l],c)){p=!1;break}b=l+r.length-1;if(p&&b+1<o.value.length){for(nt=o.value[b],v=-1,v=b+1;v<o.value.length;v++)if(!i.
IsEquals(nt,o.value[v],c))break;v>b+1&&(l=v,p=!1)}p&&!d&&new t._ArrayHelper(k).insert(0,l)}a==='"'&&(d=!d)}if(k.length>0){if(!h)for(l=0;l<k.length;l++)g=k[l],o.value=t.StringHelper.Remove(o.value,g,r.length),o.value=t.StringHelper.Insert(o.value,g,u);return!0}else return!1}return!1},s.defaultNumberStringConverter=null,s.YearTwoDigit="yy",s.YearSingleDigit="y",s.YearFourDigit="yyyy",s.MonthSingleDigit="m",s.MonthTwoDigit="mm",s.MonthAbbreviation="mmm",s.MonthUnabbreviated="mmmm",s.MonthJD="mmmmm",s.DaySingleDigit="d",s.DayTwoDigit="dd",s.DayWeekDayAbbreviation="aaa",s.DayWeekDayUnabbreviated="aaaa",s.HoursSingleDigit="h",s.HoursTwoDigit="hh",s.MinuteSingleDigit="m",s.MinuteTwoDigit="mm",s.SecondSingleDigit="s",s.SecondTwoDigit="ss",s.SubSecondSingleDigit=".
0",s.SubSecondTwoDigit=".00",s.SubSecondThreeDigit=".000",s.EraYear="e",s.AMPMTwoDigit="AM/PM",s.AMPMSingleDigit="A/P",s.StandardYearSingleDigit="%y",s.StandardMonthSingleDigit="%M",s.StandardMonthTwoDigit="MM",s.StandardMonthAbbreviation="MMM",s.StandardMonthUnabbreviated="MMMM",s.StandardAMPMSingleDigit="tt",s.StandardMinuteSingleDigit="%m",s.StandardHourSingleDigit="H",s.StandardHourTwoDigit="HH",s.StandardSecondSingleDigit="%s",s.StandardSubSecondSingleDigit=".f",s.StandardSubSecondTwoDigit=".ff",s.StandardSubSecondThreeDigit=".fff",s.StandardDayWeekDayAbbreviation="ddd",s.StandardDayWeekDayUnabbreviated="dddd",s.PlaceholderMonthJD=i.ReplacePlaceholder+"mmmmm",s.defaultAbsoluteTime=new Date(1899,11,30,0,0,0,0),s.keywords=[s.YearTwoDigit,s.YearFourDigit,s.MonthSingleDi
git,s.MonthTwoDigit,s.MonthAbbreviation,s.MonthUnabbreviated,s.MonthJD,s.DaySingleDigit,s.DayTwoDigit,s.DayWeekDayAbbreviation,s.DayWeekDayUnabbreviated,s.HoursSingleDigit,s.HoursTwoDigit,s.MinuteSingleDigit,s.MinuteTwoDigit,s.SecondSingleDigit,s.SecondTwoDigit],s}(f),st=function(){function n(){}return n.prototype.ConvertTo=function(n,t,i,r,u){if(r!=null&&u!=null){var f=r.GetDBNumber(u.Type);if(f!=null)return u.ReplaceNumberString(n,f,i)}return n},n}(),p=function(n){function e(u,e,o){var s,a,v,c,h,l;n.call(this,e,o),this.numberFormatString=null,this.fullFormatString=null,this.isGeneralNumber=!1,this.fractionIntegerFormat=null,this.fractionNumeratorFormat=null,this.fractionDenominatorFormat=null,this.excelFormatString=r.Empty,this.baseNumberStringConverter=f.prototype.NumberStringConverter,this.baseNumberFormatInfo=f.prototype.NumberFormatInfo,this._classNames.push("NumberFormatDigital"),s=f.TrimNotSupportSymbol(u),this.fullFormatString=i.Filter(u,i.LeftSquareBracke
t,i.RightSquareBracket),this.excelFormatString=s,e&&(a=s,s=i.ReplaceKeyword(a,this.PartLocaleID().OriginalToken(),this.PartLocaleID().CurrencySymbol())),this.PartDBNumberFormat()&&(this.excelFormatString=i.ReplaceKeyword(this.excelFormatString,this.PartDBNumberFormat().OriginalToken(),this.PartDBNumberFormat().toString())),s=i.Filter(s,i.LeftSquareBracket,i.RightSquareBracket),v=s.indexOf(i.SolidusSign),v>-1&&(s=t.StringHelper.Replace(s,"\\"+i.QuestionMark,i.Zero),c=s.split(i.SolidusSign),c&&c.length===2&&(this.fractionDenominatorFormat=c[1],h=c[0],h&&(l=h.lastIndexOf(i.Space),l>-1?(this.fractionIntegerFormat=h.substr(0,l),this.fractionNumeratorFormat=h.substr(l+1,h.length-l-1)):this.fractionNumeratorFormat=h))),this.numberFormatString=s}return __extends(e,n),e.prototype.NumberStringConverter=function(n){return arguments.length===0?this.baseNumberStringConverter()?this.baseNumberStringConverter():e.defaultNumberStringCo
nverter:(this.baseNumberStringConverter(n),n)},e.prototype.FormatString=function(){return this.fullFormatString},e.prototype.NumberFormatInfo=function(n){return arguments.length===0?this.baseNumberFormatInfo()?this.baseNumberFormatInfo():this.PartLocaleID()&&this.PartLocaleID().CultureInfo()?this.PartLocaleID().CultureInfo().NumberFormat():i.NumberFormatInfo:(this.baseNumberFormatInfo(n),n)},e.prototype.IsGeneralNumber=function(n){return arguments.length===0?this.isGeneralNumber:(this.isGeneralNumber=n,n)},e.prototype.ExcelCompatibleFormatString=function(){return this.excelFormatString},e.prototype.Format=function(n){var l,a,f,k,v,d,h,g,nt;if(u(n,"boolean"))return n.toString().toUpperCase();l=o.ToDouble(n);if(isNaN(l)||!isFinite(l)||isNaN(n))return typeof n=="string"?n:null;a=this.NaNSymbol(),f=null;if(this.fractionNumeratorFormat&&this.fractionDenominatorFormat){var b={value:0},s={value:0},c={value:0},tt=this.fractionDenominatorFormat.length;if(e
.GetFraction(l,tt,b,s,c))if(this.fractionIntegerFormat){f=new t.StringBuilder,b.value!==0&&(f.Append(b.value.toString(this.fractionIntegerFormat,this.NumberFormatInfo())),f.Append(i.Space)),k=this.fractionDenominatorFormat,v=parseFloat(k),isNaN(v)||v>0&&(s.value*=v/c.value,k=r.Empty,c.value=v,d=Math.ceil(s.value)-s.value,s.value=d<=.5&&d>0?parseFloat((s.value+1).toString()):parseFloat(s.value.toString())),h=this.fractionNumeratorFormat,g=parseFloat(h);if(!isNaN(g))if(g===0){var p=h.length,w=s.value.toString(),y=w.length;p>y?h=h.substr(0,h.length-(p-y)):p<y&&(w=w.substr(0,y-(y-p)),s.value=parseInt(w,10))}return s.value!==0&&(f.Append(s.value.toString(h,this.NumberFormatInfo())),f.Append(i.SolidusSign),f.Append(c.value.toString(k,this.NumberFormatInfo()))),f.toString()}else return f=new t.StringBuilder,nt=b.value*c.value+s.value,f.Append(nt.toString(this.fractionNumeratorFormat,this.NumberFormatInfo())),f.Append(i.SolidusSign),f.A
ppend(c.value.toString(this.fractionDenominatorFormat,this.NumberFormatInfo())),f.toString();else return l.toString()}else a=new t._NumberHelper(l).localeFormat(this.EncodeNumberFormat(this.numberFormatString)),this.NumberStringConverter()&&(a=this.NumberStringConverter().ConvertTo(a,n,this.isGeneralNumber,this.PartLocaleID(),this.PartDBNumberFormat()));return a},e.prototype.Parse=function(n){var d,a,e,f,v,c,nt,k,g,u,h,p,l;n=this.TrimSpecialSymbol(n),n=this.TrimCurrencySymbol(n);if(!n||n===r.Empty)return null;if(t.StringHelper.EndsWith(n,i.NumberGroupSeparator))return n;d=y.FixJapaneseChars(n);if(n.toLowerCase()==="true")return!0;else if(n.toLowerCase()==="false")return!1;var s=i.IsDecimal(d,this.NumberFormatInfo()),b=t.StringHelper.IndexOf(d,i.ExponentialSymbol,t.StringComparison.CurrentCultureIgnoreCase),o=b>-1;if(this.numberFormatString){a={value:0},n=this.TrimPercentSign(n,a),e=n,o&&(e=n.substr(0,b)),e[0]===i.NumberFormatInfo.PositiveSign&a
mp;&(e=e.substr(1),n=n.substr(1)),f=t.StringHelper.Replace(e,i.NumberGroupSeparator,""),v=f.indexOf(i.DecimalSeparator);if(v===f.lastIndexOf(i.DecimalSeparator)){c=new t.StringBuilder("#,##0");if(v!==-1)for(c.Append("."),nt=f.length-v-1,k=0;k<nt;k++)c.Append("0");g=new w(c.toString()).Format(f),g===e&&(n=o?f+n.substr(b):f)}u=parseFloat(n),h=null,u.toString()!==n&&(p=this.NumberFormatInfo(),l=i.DecimalSeparator,p&&(l=p.NumberDecimalSeparator),s||o?s&&!o?h=new RegExp("^((\\+|-)?\\d*)"+l+"(\\d*)$","ig"):!s&&o?h=new RegExp("^((\\+|-)?\\d+)((E(\\+|-)?|e(\\+|-)?)\\d+)$","ig"):s&&o&&(h=new RegExp("^((\\+|-)?\\d*)"+l+"(\\d*)((E(\\+|-)?|e(\\+|-)?)\\d+)$","ig")):h=new RegExp("^((\\+|-)?\\d+)$","ig"));if(!isNaN(u)&&isFinite(u)&&(!h||h.test(n)))return a.value>0&&(u=u/p
arseFloat((100*a.value).toString())),u!==0&&Math.abs(u-Math.floor(u))!==0&&(s=!0),o&&(s=!0),this.ToObject(u,s)}return null},e.prototype.EncodeNumberFormat=function(n){var r,u,i;if(n){for(r=n.split(""),u=new t.StringBuilder,i=0;i<r.length-1;)r[i]==="\\"?(u.Append(r[i+1]),i+=2):(u.Append(r[i]),i++);i===r.length-1&&r[i]!=="\\"&&u.Append(r[i]),n=u.toString()}return n},e.prototype.ToObject=function(n,t){return t?n:n>1e22?n:n},e.prototype.TrimPercentSign=function(n,u){u.value=0;if(!n||n===r.Empty)return n;var e=n,f=i.PercentSymbol,o=n.indexOf(f);return o===n.length-1&&o===n.lastIndexOf(f)&&(e=t.StringHelper.Replace(e,f,""),u.value+=(n.length-e.length)/f.length),e},e.prototype.TrimSpecialSymbol=function(n){var u,h,s,c,e,f,o;if(!n||n===r.Empty)return n;for(u=n,h=-1,s=0;s<u.length;s++)if(v.IsDigit(u[s])){h=s;break}for(c=-1,e=u.length-1;e>-1;e--)if(v.IsDigit(u[e])){c=e;break}for(f=u.len
gth-1;f>-1;f--){o=u[f];if(this.IsSpecialSymbol(o))v.IsWhiteSpace(o)?(f<h||c<f)&&(u=t.StringHelper.Remove(u,f,1)):u=t.StringHelper.Remove(u,f,1);else if(o==="-"||o==="+")if(f>0)if(u[f-1]!=="e"&&u[f-1]!=="E"&&u[f-1]!=="("&&u[f-1].toString()!==i.NumberFormatInfo.CurrencySymbol)break}return u},e.prototype.IsStandardNumberSymbol=function(n){var r=this.NumberFormatInfo()?this.NumberFormatInfo():i.NumberFormatInfo,t;if(r){t=n.toString();if(t===r.CurrencyDecimalSeparator||t===r.CurrencyGroupSeparator||t===r.CurrencySymbol||t===r.NaNSymbol||t===r.NegativeInfinitySymbol||t===r.NegativeSign||t===r.NumberDecimalSeparator||t===r.NumberGroupSeparator||t===r.PercentDecimalSeparator||t===r.PercentGroupSeparator||t===r.PercentSymbol||t===r.PerMilleSymbol||t===r.PositiveInfinitySymbol||t===r.PositiveSign)return!0}return!1},e.prototype.IsSpecialSymbol=function(n){return this.IsStandardNumberSymbol(n)?!1:v.IsW
hiteSpace(n)?!0:!1},e.prototype.TrimCurrencySymbol=function(n){var u=this.NumberFormatInfo()?this.NumberFormatInfo():i.NumberFormatInfo,t,r;return u&&(t=u.CurrencySymbol,r=n.indexOf(t),r===0&&r===n.lastIndexOf(t)&&(n=n.substr(1))),n},e.EvaluateFormat=function(n){return f.ContainsKeywords(n,e.keywords)},e.GetFraction=function(n,t,i,r,u){return y.GetFraction(n,t,i,r,u)},e.defaultNumberStringConverter=new st,e.keywords=[i.Exponential1,i.Exponential2,i.NumberSign,i.DecimalSeparator,i.NumberGroupSeparator,i.PercentSymbol,i.Zero,i.SolidusSign],e}(f),h=function(n){function e(r,u,o){n.call(this,u,o),this.digitalFormat=null,this.exponentialDigitalFormat=null,this.fullFormatString=null,this._classNames.push("NumberFormatGeneral");if(arguments.length>0)if(e.EvaluateFormat(r)){if(r.indexOf(i.Zero)>=0||r.indexOf(i.NumberSign)>=0||r.indexOf(i.DecimalSeparator)>=0||r.indexOf(i.CommercialAt)>=0)throw t._StringResource.Exp_FormatIllegal;this.fullForma
tString=r}else throw t._StringResource.Exp_FormatIllegal;else this.fullFormatString=f.General}return __extends(e,n),e.prototype.DigitalFormat=function(){if(!this.digitalFormat){var n=this.fullFormatString;n=i.ReplaceKeyword(n,f.General,e.GeneralNumber),this.digitalFormat=new p(n,this.PartLocaleID(),this.PartDBNumberFormat()),this.digitalFormat.IsGeneralNumber(!0)}return this.digitalFormat},e.prototype.ExponentialDigitalFormat=function(){return this.exponentialDigitalFormat||(this.exponentialDigitalFormat=new p("0.#####E+00",this.PartLocaleID(),this.PartDBNumberFormat()),this.exponentialDigitalFormat.IsGeneralNumber(!0)),this.exponentialDigitalFormat},e.prototype.FormatString=function(){return t.StringHelper.Replace(this.fullFormatString,e.GeneralPlaceholder,f.General)},e.prototype.Format=function(n){var e,r,f;if(o.IsNumber(n)){e=this.PartLocaleID()?this.PartLocaleID().AllowScience():!0,r=o.ToDouble(n);if(r!==undefined&&r!==null)return Math.abs(r)>99999999999&
;&e||Math.abs(r)<1e-11&&r!==0?this.ExponentialDigitalFormat().Format(n):this.DigitalFormat().Format(n)}else if(u(n,"string"))return f=t.StringHelper.Replace(this.FormatString(),'"',""),f=i.TrimEscape(f),f?t.StringHelper.Replace(f,"General",n):n;else if(u(n,"boolean"))return n.toString().toUpperCase();return""},e.prototype.Parse=function(n){var h,c,l,s;if(r.IsNullOrEmpty(n))return null;h=!1,c=t.StringHelper.IndexOf(n,"-"),c>0&&(i.IsEquals(n.charAt(c-1),i.ExponentialSymbol,!0)||(h=!0));if(t.StringHelper.Contains(n,"/")||h||t.StringHelper.Contains(n,":")){l=t._DateTimeHelper.parseLocale(n);if(l)return l}var e=n,f=null,o=null;e.charAt(0)===i.NegativeSign?o=!0:e.charAt(0)===i.NumberFormatInfo.PositiveSign&&(o=!1),s=!1,o&&e.length>3&&e.charAt(1)===i.LeftParenthesis&&e.charAt(e.length-1)===i.RightParenthesis&&(s=!0);if(o&&s){f=thi
s.DigitalFormat().Parse(t.StringHelper.Remove(n,0,1));if(f)return u(f,"number")?Math.abs(f)*(o?-1:1):f}else{f=this.DigitalFormat().Parse(n);if(f!==undefined&&f!==null)return f}return n},e.GeneralMonthDay=function(){return["M/d","MMM/d","MMMM/d","d/M","d/MMM","d/MMMM","M-d","MMM-d","MMMM-d","d-M","d-MMM","d-MMMM"]},e.GeneralYearMonth=function(){return["M/y","MMM/y","M/yyyy","MMM/yyyy","M-y","MMM-y","M-yyyy","MMM-yyyy"]},e.GeneralYearMonthDay=function(){return["M/d/y","MMM/d/y","MMMM/d/y","M/d/yyyy","MMM/d/yyyy","MMMM/d/yyyy","d/M/y","d/MMM/y","d/MMMM/y","d/M/yyyy","d/MMM/yyyy","d/MMMM/yyyy","yyyy/M/d","M-d-y","MMM-d-y",&qu
ot;MMMM-d-y","M-d-yyyy","MMM-d-yyyy","MMMM-d-yyyy","d-M-y","d-MMM-y","d-MMMM-y","d-M-yyyy","d-MMM-yyyy","d-MMMM-yyyy","yyyy-M-d"]},e.GeneralHourMinute=function(){return["H:m","h:m tt"]},e.GeneralHourMinuteWithDate=function(){return["M/d H:m","MMM/d H:m","MMMM/d H:m","d/M H:m","d/MMM H:m","d/MMMM H:m","M/y H:m","MMM/y H:m","M/yyyy H:m","MMM/yyyy H:m","M/d/y H:m","MMM/d/y H:m","MMMM/d/y H:m","M/d/yyyy H:m","MMM/d/yyyy H:m","MMMM/d/yyyy H:m","M-d H:m","MMM-d H:m","MMMM-d H:m","d-M H:m","d-MMM H:m","d-MMMM H:m","M-y H:m","MMM-y H:m","M-yyyy H:m","MMM-yyyy H:m","M-d-y H:m","MMM-d-y H:m",&qu
ot;MMMM-d-y H:m","M-d-yyyy H:m","MMM-d-yyyy H:m","MMMM-d-yyyy H:m","M/d h:m tt","MMM/d h:m tt","MMMM/d h:m tt","d/M h:m tt","d/MMM h:m tt","d/MMMM h:m tt","M/y h:m tt","MMM/y h:m tt","M/yyyy h:m tt","MMM/yyyy h:m tt","M/d/y h:m tt","MMM/d/y h:m tt","MMMM/d/y h:m tt","M/d/yyyy h:m tt","MMM/d/yyyy h:m tt","MMMM/d/yyyy h:m tt","M-d h:m tt","MMM-d h:m tt","MMMM-d h:m tt","d-M h:m tt","d-MMM h:m tt","d-MMMM h:m tt","M-y h:m tt","MMM-y h:m tt","M-yyyy h:m tt","MMM-yyyy h:m tt","M-d-y h:m tt","MMM-d-y h:m tt","MMMM-d-y h:m tt","M-d-yyyy h:m tt","MMM-d-yyyy h:m tt","MMMM-d-yyyy h:m tt"]},e.GeneralHourMinuteSecond=function(){return["H:m:s
","h:m:s tt","H:m:s","h:mm:ss tt"]},e.GeneralHourMinuteSecondSubSecond=function(){return["H:m:s.FFF","h:m:s.FFF tt"]},e.GeneralHourMinuteSecondWithDate=function(){return["M/d H:m:s","MMM/d H:m:s","MMMM/d H:m:s","d/M H:m:s","d/MMM H:m:s","d/MMMM H:m:s","M/y H:m:s","MMM/y H:m:s","M/yyyy H:m:s","MMM/yyyy H:m:s","M/d/y H:m:s","MMM/d/y H:m:s","MMMM/d/y H:m:s","M/d/yyyy H:m:s","MMM/d/yyyy H:m:s","MMMM/d/yyyy H:m:s","d/M/y H:m:s","d/MMM/y H:m:s","d/MMMM/y H:m:s","d/M/yyyy H:m:s","d/MMM/yyyy H:m:s","d/MMMM/yyyy H:m:s","yyyy/M/d H:m:s","M-d H:m:s","MMM-d H:m:s","MMMM-d H:m:s","d-M H:m:s","d-MMM H:m:s","d-MMMM H:m:s","M-y H:m:s","MMM-y H:m
:s","M-yyyy H:m:s","MMM-yyyy H:m:s","M-d-y H:m:s","MMM-d-y H:m:s","MMMM-d-y H:m:s","M-d-yyyy H:m:s","MMM-d-yyyy H:m:s","MMMM-d-yyyy H:m:s","d-M-y H:m:s","d-MMM-y H:m:s","d-MMMM-y H:m:s","d-M-yyyy H:m:s","d-MMM-yyyy H:m:s","d-MMMM-yyyy H:m:s","yyyy-M-d H:m:s","M/d h:m:s tt","MMM/d h:m:s tt","MMMM/d h:m:s tt","d/M h:m:s tt","d/MMM h:m:s tt","d/MMMM h:m:s tt","M/y h:m:s tt","MMM/y h:m:s tt","M/yyyy h:m:s tt","MMM/yyyy h:m:s tt","M/d/y h:m:s tt","MMM/d/y h:m:s tt","MMMM/d/y h:m:s tt","M/d/yyyy h:m:s tt","MMM/d/yyyy h:m:s tt","MMMM/d/yyyy h:m:s tt","d/M/y h:m:s tt","d/MMM/y h:m:s tt","d/MMMM/y h:m:s tt","d/M/yyyy h:m:s tt","d/MMM/yyyy
h:m:s tt","d/MMMM/yyyy h:m:s tt","yyyy/M/d h:m:s tt","M/d/yyyy h:mm:ss tt","M-d h:m:s tt","MMM-d h:m:s tt","MMMM-d h:m:s tt","d-M h:m:s tt","d-MMM h:m:s tt","d-MMMM h:m:s tt","M-y h:m:s tt","MMM-y h:m:s tt","M-yyyy h:m:s tt","MMM-yyyy h:m:s tt","M-d-y h:m:s tt","MMM-d-y h:m:s tt","MMMM-d-y h:m:s tt","M-d-yyyy h:m:s tt","MMM-d-yyyy h:m:s tt","MMMM-d-yyyy h:m:s tt","d-M-y h:m:s tt","d-MMM-y h:m:s tt","d-MMMM-y h:m:s tt","d-M-yyyy h:m:s tt","d-MMM-yyyy h:m:s tt","d-MMMM-yyyy h:m:s tt","yyyy-M-d h:m:s tt"]},e.GeneralHourMinuteSecondSubSecondWithDate=function(){return["M/d H:m:s.FFF","MMM/d H:m:s.FFF","MMMM/d H:m:s.FFF","d/M H:m:s.FFF","d/MMM H:m:s.FFF","d/MMMM H:m:s.FFF&q
uot;,"M/y H:m:s.FFF","MMM/y H:m:s.FFF","M/yyyy H:m:s.FFF","MMM/yyyy H:m:s.FFF","d/M/y H:m","d/MMM/y H:m","d/MMMM/y H:m","d/M/yyyy H:m","d/mmm/yyyy H:m","d/MMMM/yyyy H:m","yyyy/M/d H:m","M/d/y H:m:s.FFF","MMM/d/y H:m:s.FFF","MMMM/d/y H:m:s.FFF","M/d/yyyy H:m:s","MMM/d/yyyy H:m:s.FFF","MMMM/d/yyyy H:m:s.FFF","d/M/y H:m:s.FFF","d/MMM/y H:m:s.FFF","d/MMMM/y H:m:s.FFF","d/M/yyyy H:m:s.FFF","d/MMM/yyyy H:m:s.FFF","d/MMMM/yyyy H:m:s.FFF","yyyy/M/d H:m:s.FFF","M-d H:m:s.FFF","MMM-d H:m:s.FFF","MMMM-d H:m:s.FFF","d-M H:m:s.FFF","d-MMM H:m:s.FFF","d-MMMM H:m:s.FFF","M-y H:m:s.FFF","MMM-y H:m:s.FFF","M-yyyy H:m:s.FFF","MMM-Yyyy H:m:s.FFF","d-M-y H:m"
,"d-MMM-y H:m","d-MMMM-y H:m","d-M-yyyy H:m","d-MMM-yyyy H:m","d-MMMM-yyyy H:m","yyyy-M-d H:m","M-d-y H:m:s.FFF","MMM-d-y H:m:s.FFF","MMMM-d-y H:m:s.FFF","M-d-yyyy H:m:s","MMM-d-yyyy H:m:s.FFF","MMMM-d-yyyy H:m:s.FFF","D-M-y H:m:s.FFF","d-MMM-y H:m:s.FFF","d-MMMM-y H:m:s.FFF","D-M-yyyy H:m:s.FFF","d-MMM-yyyy H:m:s.FFF","d-MMMM-yyyy H:m:s.FFF","yyyy-M-d H:m:s.FFF","M/d h:m:s.FFF tt","MMM/d h:m:s.FFF tt","MMMM/d h:m:s.FFF tt","d/M h:m:s.FFF tt","d/MMM h:m:s.FFF tt","d/MMMM h:m:s.FFF tt","M/y h:m:s.FFF tt","MMM/y h:m:s.FFF tt","M/yyyy h:m:s.FFF tt","MMM/yyyy h:m:s.FFF tt","d/M/y h:m tt","d/MMM/y h:m tt","d/MMMM/y h:m tt","d/M/yyyy h:m tt","d/mmm/yyyy h:m tt
","d/MMMM/yyyy h:m tt","yyyy/M/d h:m tt","M/d/y h:m:s.FFF tt","MMM/d/y h:m:s.FFF tt","MMMM/d/y h:m:s.FFF tt","M/d/yyyy h:m:s tt","MMM/d/yyyy h:m:s.FFF tt","MMMM/d/yyyy h:m:s.FFF tt","d/M/y h:m:s.FFF tt","d/MMM/y h:m:s.FFF tt","d/MMMM/y h:m:s.FFF tt","d/M/yyyy h:m:s.FFF tt","d/MMM/yyyy h:m:s.FFF tt","d/MMMM/yyyy h:m:s.FFF tt","yyyy/M/d h:m:s.FFF tt","M-d h:m:s.FFF tt","MMM-d h:m:s.FFF tt","MMMM-d h:m:s.FFF tt","d-M h:m:s.FFF tt","d-MMM h:m:s.FFF tt","d-MMMM h:m:s.FFF tt","M-y h:m:s.FFF tt","MMM-y h:m:s.FFF tt","M-yyyy h:m:s.FFF tt","MMM-Yyyy h:m:s.FFF tt","d-M-y h:m tt","d-MMM-y h:m tt","d-MMMM-y h:m tt","d-M-yyyy h:m tt","d-MMM-yyyy h:m tt","d-MMMM-yyyy h:m tt","yyyy-M
-d h:m tt","M-d-y h:m:s.FFF tt","MMM-d-y h:m:s.FFF tt","MMMM-d-y h:m:s.FFF tt","M-d-yyyy H:m:s tt","MMM-d-yyyy H:m:s.FFF tt","MMMM-d-yyyy h:m:s.FFF tt","d-M-y h:m:s.FFF tt","d-MMM-y h:m:s.FFF tt","d-MMMM-y h:m:s.FFF tt","d-M-yyyy h:m:s.FFF tt","d-MMM-yyyy h:m:s.FFF tt","d-MMMM-yyyy h:m:s.FFF tt","yyyy-M-d h:m:s.FFF tt"]},e.EvaluateFormat=function(n){return!n||n===r.Empty?!1:f.ContainsKeywords(n,[f.General.toLowerCase()])},e.GeneralPlaceholder="@NumberFormat",e.GeneralNumber="##################0.################",e}(f)})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype,n.prototype=new r},wijmo;(function(n){(function(t){var r,i,e,c,tt,s,ht,it,g,ct,rt,et,l,ot,ut,lt,ft,
h,v,p,a,k,d,u,o,b,y,w,f,nt,st,at;t.feature("conditionalFormat",["core.common","core.globalize","core.stringResource","core.theme","formatter"]),function(n){n[n.RelationCondition=0]="RelationCondition",n[n.NumberCondition=1]="NumberCondition",n[n.TextCondition=2]="TextCondition",n[n.ColorCondition=3]="ColorCondition",n[n.FormulaCondition=4]="FormulaCondition",n[n.DateCondition=5]="DateCondition",n[n.DateExCondition=6]="DateExCondition",n[n.TextLengthCondition=7]="TextLengthCondition",n[n.Top10Condition=8]="Top10Condition",n[n.UniqueCondition=9]="UniqueCondition",n[n.AverageCondition=10]="AverageCondition",n[n.CellValueCondition=11]="CellValueCondition",n[n.AreaCondition=12]="AreaCondition"}(t.ConditionType||(t.ConditionType={})),r=t.ConditionType,function(n){n[n.ConditionRuleBase=0]="Conditio
nRuleBase",n[n.CellValueRule=1]="CellValueRule",n[n.SpecificTextRule=2]="SpecificTextRule",n[n.FormulaRule=3]="FormulaRule",n[n.DateOccurringRule=4]="DateOccurringRule",n[n.Top10Rule=5]="Top10Rule",n[n.UniqueRule=6]="UniqueRule",n[n.DuplicateRule=7]="DuplicateRule",n[n.AverageRule=8]="AverageRule",n[n.ScaleRule=9]="ScaleRule",n[n.TwoScaleRule=10]="TwoScaleRule",n[n.ThreeScaleRule=11]="ThreeScaleRule",n[n.DataBarRule=12]="DataBarRule",n[n.IconSetRule=13]="IconSetRule"}(t.RuleType||(t.RuleType={})),i=t.RuleType,e=function(){function t(n){this.condition=null,this.ranges=null,this.style=null,this._priority=1,this._stopIfTrue=!1,this.style=n}return t.prototype.hasNoReference=function(){return!(this.ranges&&this.ranges.length>0)},t.prototype.evaluate=function(n,t,i,r){var u,f;return this.contains(t,i)?(this.initCondition(),u={baseRow:0,baseCol:0
},this.getBaseCoordinate(u),this.condition.adjustOffset(t-u.baseRow,i-u.baseCol),f=null,this.condition.evaluate(n,t,i,r)&&(f=this.getExpected()),this.condition.adjustOffset(0,0),f):null},t.prototype.contains=function(n,t){var i,r;if(this.ranges)for(i=0;i<this.ranges.length;i++){r=this.ranges[i];if(r.contains(n,t))return!0}return!1},t.prototype.createCondition=function(){},t.prototype.initCondition=function(){this.condition||(this.condition=this.createCondition())},t.prototype.priority=function(){return this._priority},t.prototype.stopIfTrue=function(n){return arguments.length===0?this._stopIfTrue:(this._stopIfTrue=n,this)},t.prototype.getExpected=function(){return this.style},t.prototype.reset=function(){this.ranges=null,this.condition=null,this.style=null,this._stopIfTrue=!1,this._priority=1},t.prototype.intersects=function(n,t,i,r){var u,f;if(this.ranges)for(u=0;u<this.ranges.length;u++){f=this.ranges[u];if(f.intersect(n,t,i,r))return!0}return!1},t.prototype.isScaleR
ule=function(){return!1},t.prototype.getBaseCoordinate=function(n){var t,i;n.baseRow=Number.MAX_VALUE,n.baseCol=Number.MAX_VALUE;if(this.ranges&&this.ranges.length>0)for(t=0;t<this.ranges.length;t++)i=this.ranges[t],n.baseRow=Math.min(i.row,n.baseRow),n.baseCol=Math.min(i.col,n.baseCol);else n.baseRow=0,n.baseCol=0},t.prototype._addRows=function(t,i){var f,u,r;if(this.ranges)for(f=this.ranges.length,u=0;u<f;u++)r=this.ranges[u],r.row<t?r.row<t&&t<r.row+r.rowCount&&(this.ranges[u]=new n.spread.Range(r.row,r.col,r.rowCount+i,r.colCount)):this.ranges[u]=new n.spread.Range(r.row+i,r.col,r.rowCount,r.colCount)},t.prototype._addColumns=function(t,i){var f,u,r;if(this.ranges)for(f=this.ranges.length,u=0;u<f;u++)r=this.ranges[u],r.col<t?r.col<t&&t<r.col+r.colCount&&(this.ranges[u]=new n.spread.Range(r.row,r.col,r.rowCount,r.colCount+i)):this.ranges[u]=new n.spread.Range(r.row,r.col+i,r.rowCount,r.colCount)},t.prototype._r
emoveRows=function(t,i){var f,h,u,r,o,c,e,s;if(this.ranges){for(f=[],h=this.ranges.length,u=0;u<h;u++)r=this.ranges[u],r.row>t?r.row+r.rowCount>t+i?this.ranges[u]=new n.spread.Range(r.row-i,r.col,r.rowCount,r.colCount):f.push(r):r.row<=t&&t<r.row+r.rowCount&&(o=new n.spread.Range(r.row,r.col,r.rowCount-Math.min(r.row+r.rowCount-t,i),r.colCount),o.colCount===0||o.rowCount===0?f.push(r):this.ranges[u]=o);for(c=f.length,e=0;e<c;e++)s=f[e],this.ranges.remove(s)}},t.prototype._removeColumns=function(t,i){var f,h,u,r,o,c,e,s;if(this.ranges){for(f=[],h=this.ranges.length,u=0;u<h;u++)r=this.ranges[u],r.col>t?r.col+r.colCount>t+i?this.ranges[u]=new n.spread.Range(r.row,r.col-i,r.rowCount,r.colCount):f.push(r):r.col<=t&&t<r.col+r.colCount&&(o=new n.spread.Range(r.row,r.col,r.rowCount,r.colCount-Math.min(r.col+r.colCount-t,i)),o.colCount===0||o.rowCount===0?f.push(r):this.ranges[u]=o);for(c=f.length,e=0;e<c;e++)s=f[e],this.ran
ges.remove(s)}},t.prototype.toJSON=function(){},t.prototype.fromJSON=function(n){},t}(),t.ConditionRuleBase=e,c=function(){function n(n,i,r){this.conditionType="RelationCondition",this.compareType=t.RelationCompareType.And,this.item1=null,this.item2=null,this.ignoreBlank=!1,this._dict=null,this.compareType=n,this.item1=i,this.item2=r}return n.prototype.adjustOffset=function(n,t){},n.prototype.create=function(t,i,r){return new n(t,i,r)},n.prototype._getActualValue=function(n,i,r,u,f){if(n&&i)if(i.conditionType==="ColorCondition"){var e=n.getActualStyle(r,u);e&&(i.compareType===t.ColorCompareType.BackgroundColor?f=e.backColor:i.compareType===t.ColorCompareType.ForegroundColor&&(f=e.foreColor))}return f},n.prototype.evaluate=function(n,i,r,u,f){var s,h,e,o;this.item1&&(this.item1.ignoreBlank=this.ignoreBlank,s=arguments.length<5?this._getActualValue(n,this.item1,i,r,u):u),this.item2&&(this.item2.ignoreBlank=this.ignoreBlank
,h=arguments.length<5?this._getActualValue(n,this.item2,i,r,u):f);if(this.compareType===t.RelationCompareType.And)return e=this.item1===undefined||this.item1===null?!1:this.item1.evaluate(n,i,r,s),e?o=this.item2===undefined||this.item2===null?!1:this.item2.evaluate(n,i,r,h):!1;else if(this.compareType===t.RelationCompareType.Or)return e=this.item1===undefined||this.item1===null?!1:this.item1.evaluate(n,i,r,s),e?!0:o=this.item2===undefined||this.item2===null?!1:this.item2.evaluate(n,i,r,h);return!1},n.prototype.reset=function(){this.ignoreBlank=!1,this.compareType=t.RelationCompareType.And,this.item1=null,this.item2=null},n.prototype._getConditionTypeDictionary=function(){if(!this._dict){var t={};t[r.RelationCondition]=n,t[r.NumberCondition]=ht,t[r.TextCondition]=g,t[r.ColorCondition]=ct,t[r.FormulaCondition]=et,t[r.DateCondition]=l,t[r.DateExCondition]=ut,t[r.TextLengthCondition]=lt,t[r.Top10Condition]=h,t[r.UniqueCondition]=a,t[r.AverageCondition]=d,t[r.CellValueCondition]=s,t[r
.AreaCondition]=st,this._dict=t}return this._dict},n.prototype.toJSON=function(){return{compareType:this.compareType,item1:this.item1?this.item1.toJSON():null,item2:this.item2?this.item2.toJSON():null,conType:r.RelationCondition,ignoreBlank:this.ignoreBlank}},n.prototype.fromJSON=function(n){if(!n)return;n.compareType!==null&&n.compareType!==undefined&&(this.compareType=n.compareType);if(n.item1!==null&&n.item1!==undefined){var t=null,r=this._getConditionTypeDictionary(),i=r[n.item1.conType];i&&(t=new i,t.fromJSON(n.item1)),this.item1=t}if(n.item2!==null&&n.item2!==undefined){var t=null,r=this._getConditionTypeDictionary(),i=r[n.item2.conType];i&&(t=new i,t.fromJSON(n.item2)),this.item2=t}n.ignoreBlank!==null&&n.ignoreBlank!==undefined&&(this.ignoreBlank=n.ignoreBlank)},n}(),t.RelationCondition=c,tt=function(r){function u(n,t,i,u){r.call(this,u),this.operator=n,this.value1=typeof t=="string"?$.trim(t):t,this.v
alue2=typeof i=="string"?$.trim(i):i}return __extends(u,r),u.prototype.createCondition=function(){var e=this.isFormula(this.value1)?this.value1.replace("=",""):null,h=this.isFormula(this.value1)?null:this.value1,o=this.isFormula(this.value2)?this.value2.replace("=",""):null,l=this.isFormula(this.value2)?null:this.value2,u,r,n=this.operator,i=null,f;if(n===t.ComparisonOperator.Between)return u=new s(t.GeneralCompareType.GreaterThanOrEqualsTo,this.value1,e),u.treatNullValueAsZero=!0,r=new s(t.GeneralCompareType.LessThanOrEqualsTo,this.value2,o),r.treatNullValueAsZero=!0,new c(t.RelationCompareType.And,u,r);else if(n===t.ComparisonOperator.NotBetween)return u=new s(t.GeneralCompareType.LessThan,this.value1,e),u.treatNullValueAsZero=!0,r=new s(t.GeneralCompareType.GreaterThan,this.value2,o),r.treatNullValueAsZero=!0,new c(t.RelationCompareType.Or,u,r);else n===t.ComparisonOperator.EqualsTo?i=t.GeneralCompareType.EqualsTo:n===t.Comparison
Operator.GreaterThan?i=t.GeneralCompareType.GreaterThan:n===t.ComparisonOperator.GreaterThanOrEqualsTo?i=t.GeneralCompareType.GreaterThanOrEqualsTo:n===t.ComparisonOperator.LessThan?i=t.GeneralCompareType.LessThan:n===t.ComparisonOperator.LessThanOrEqualsTo?i=t.GeneralCompareType.LessThanOrEqualsTo:n===t.ComparisonOperator.NotEqualsTo&&(i=t.GeneralCompareType.NotEqualsTo);return i!==null?(f=new s(i,this.value1,e),f.treatNullValueAsZero=!0,f):null},u.prototype.reset=function(){this.operator=t.ComparisonOperator.Between,this.value1=null,this.value2=null,this.style=null,this._stopIfTrue=!1,this._priority=1},u.prototype.isFormula=function(n){return n!==undefined&&n!==null&&n[0]==="="},u.prototype.toJSON=function(){return{ruleType:i.CellValueRule,ranges:this.ranges,style:this.style,operator:this.operator,value1:this.value1,value2:this.value2,priority:this._priority,stopIfTrue:this._stopIfTrue}},u.prototype.fromJSON=function(t){var r,i;if(!t)return;if(t.r
anges)for(this.ranges=[],r=0;r<t.ranges.length;r++)i=t.ranges[r],this.ranges.push(new n.spread.Range(i.row,i.col,i.rowCount,i.colCount));t.style&&(this.style=new n.spread.Style,this.style.copyFrom(t.style)),t.operator!==null&&t.operator!==undefined&&(this.operator=t.operator),t.value1!==null&&t.value1!==undefined&&(this.value1=t.value1),t.value2!==null&&t.value2!==undefined&&(this.value2=t.value2),t.priority!==null&&t.priority!==undefined&&(this._priority=t.priority),t.stopIfTrue!==null&&t.stopIfTrue!==undefined&&(this._stopIfTrue=t.stopIfTrue)},u}(e),t.CellValueRule=tt,s=function(){function i(n,t,i){this.compareType=null,this.treatNullValueAsZero=!1,this.compareType=n,this.expected=t,this.formula=i}return i.prototype.adjustOffset=function(n,t){},i.prototype.getExpected=function(n,t,i,r){var u,f;return this.formula&&this.formula.length>0?(u=n.getCalcService(),u?(f=u.parse(this.formu
la,t,i),u.evaluateParsedFormula(n._getSheetSource(),f,t,i)):this.expected):this.expected},i.prototype.evaluate=function(n,t,i,r){var u=this.getExpected(n,t,i);return this.checkCondition(u,r)},i.prototype.isSatisfyingCondition=function(n){var t=this.getExpected(null,0,0);return this.checkCondition(t,n)},i.prototype.checkCondition=function(i,r){var u=0,h=!1,s,f,e,o;if(typeof i=="boolean"){s=i;switch(this.compareType){case t.GeneralCompareType.EqualsTo:return r===i;case t.GeneralCompareType.NotEqualsTo:return r!==i;case t.GeneralCompareType.GreaterThan:return this._compareBool(s,r)<0;case t.GeneralCompareType.GreaterThanOrEqualsTo:return this._compareBool(s,r)<=0;case t.GeneralCompareType.LessThan:return this._compareBool(s,r)>0;case t.GeneralCompareType.LessThanOrEqualsTo:return!!this._compareBool(s,r);default:break}}try{u=n.spread.Calc.Convert.toDouble(r),h=!isNaN(u)}catch(l){h=!1}if((r===undefined||r===null)&&(i===undefined||i===null))switch(this.compareTy
pe){case t.GeneralCompareType.EqualsTo:case t.GeneralCompareType.GreaterThanOrEqualsTo:case t.GeneralCompareType.LessThanOrEqualsTo:return!0;case t.GeneralCompareType.NotEqualsTo:case t.GeneralCompareType.GreaterThan:case t.GeneralCompareType.LessThan:return!1;default:return!1}this.treatNullValueAsZero&&(r===undefined||r===null)&&(h=!0,u=0);if(h){f=0;try{f=n.spread.Calc.Convert.toDouble(i)}catch(c){switch(this.compareType){case t.GeneralCompareType.EqualsTo:return!1;case t.GeneralCompareType.NotEqualsTo:return!0}return!1}switch(this.compareType){case t.GeneralCompareType.EqualsTo:return u===f;case t.GeneralCompareType.NotEqualsTo:return u!==f;case t.GeneralCompareType.GreaterThan:return u>f;case t.GeneralCompareType.GreaterThanOrEqualsTo:return u>=f;case t.GeneralCompareType.LessThan:return u<f;case t.GeneralCompareType.LessThanOrEqualsTo:return u<=f}}else if(typeof r=="string"){e=null;if(typeof i=="string")e=i;else{switch(this.compare
Type){case t.GeneralCompareType.EqualsTo:return!1;case t.GeneralCompareType.NotEqualsTo:return!0}return!1}o=r;switch(this.compareType){case t.GeneralCompareType.EqualsTo:return o===e;case t.GeneralCompareType.NotEqualsTo:return o!==e;case t.GeneralCompareType.GreaterThan:return e<o;case t.GeneralCompareType.GreaterThanOrEqualsTo:return e<=o;case t.GeneralCompareType.LessThan:return e>o;case t.GeneralCompareType.LessThanOrEqualsTo:return e>=o}}return!1},i.prototype._compareBool=function(n,t){return n===t?0:n===!1&&t===!0?-1:1},i.prototype.toJSON=function(){return{compareType:this.compareType,expected:this.expected,formula:this.formula,conType:r.CellValueCondition,treatNullValueAsZero:this.treatNullValueAsZero}},i.prototype.fromJSON=function(n){if(!n)return;n.compareType!==null&&n.compareType!==undefined&&(this.compareType=n.compareType),n.expected!==null&&n.expected!==undefined&&(this.expected=n.expected),n.formula!==null&&n
.formula!==undefined&&(this.formula=n.formula),n.treatNullValueAsZero!==null&&n.treatNullValueAsZero!==undefined&&(this.treatNullValueAsZero=n.treatNullValueAsZero)},i}(),t.CellValueCondition=s,ht=function(){function n(n,i,r){this.compareType=t.GeneralCompareType.EqualsTo,this.conditionType="NumberCondition",this.ignoreBlank=!1,this.integerValue=!1,this.compareType=n,this.expected=i,this.formula=typeof r=="string"?$.trim(r).replace("=",""):r}return n.prototype.evaluate=function(n,t,i,r){var u=this.getExpected(n,t,i);return this.integerValue&&(u=isNaN(u)?null:parseInt(u,10)),this.checkCondition(u,r)},n.prototype.checkCondition=function(n,i){var r,u;if((i===undefined||i===null||i==="")&&this.ignoreBlank)return!0;if(isNaN(i))return!1;if(n===undefined||n===null)if(this.ignoreBlank)return!0;else n=0;r=0;try{r=parseFloat(i)}catch(f){return!1}if(this.integerValue===!0){u=r-Math.floor(r)==0;if(u===!1)r
eturn!1}switch(this.compareType){case t.GeneralCompareType.EqualsTo:return r===n;case t.GeneralCompareType.NotEqualsTo:return r!==n;case t.GeneralCompareType.GreaterThan:return r>n;case t.GeneralCompareType.GreaterThanOrEqualsTo:return r>=n;case t.GeneralCompareType.LessThan:return r<n;case t.GeneralCompareType.LessThanOrEqualsTo:return r<=n}return!1},n.prototype.getExpected=function(n,t,i){if(this.formula&&this.formula.length>0){var r=n.getCalcService();return r?r.evaluate(n._getSheetSource(),this.formula,t,i):this.expected}else return this.expected},n.prototype.reset=function(){this.expected=null,this.ignoreBlank=!1,this.compareType=t.GeneralCompareType.EqualsTo,this.integerValue=!1},n.prototype.toJSON=function(){return{compareType:this.compareType,expected:this.expected,formula:this.formula,conType:r.NumberCondition,ignoreBlank:this.ignoreBlank,integerValue:this.integerValue}},n.prototype.fromJSON=function(n){if(!n)return;n.compareType!==null&&n.com
pareType!==undefined&&(this.compareType=n.compareType),n.expected!==null&&n.expected!==undefined&&(this.expected=n.expected),n.formula!==null&&n.formula!==undefined&&(this.formula=n.formula),n.ignoreBlank!==null&&n.ignoreBlank!==undefined&&(this.ignoreBlank=n.ignoreBlank),n.integerValue!==null&&n.integerValue!==undefined&&(this.integerValue=n.integerValue)},n}(),t.NumberCondition=ht,it=function(r){function u(n,t,i){r.call(this,i),this.text=t,this.operator=n}return __extends(u,r),u.prototype.createCondition=function(){var n,i;switch(this.operator){case t.TextComparisonOperator.BeginsWith:n=t.TextCompareType.BeginsWith;break;case t.TextComparisonOperator.EndsWith:n=t.TextCompareType.EndsWith;break;case t.TextComparisonOperator.Contains:n=t.TextCompareType.Contains;break;case t.TextComparisonOperator.DoesNotContain:n=t.TextCompareType.DoesNotContain;break;default:n=t.TextCompareType.EqualsTo;break}return i=new g(n,
this.text,null),i.ignoreCase=!0,i},u.prototype.reset=function(){this.operator=t.TextComparisonOperator.Contains,this.text="",this.style=null,this._stopIfTrue=!1,this._priority=1},u.prototype.toJSON=function(){return{ruleType:i.SpecificTextRule,ranges:this.ranges,style:this.style,operator:this.operator,text:this.text,priority:this._priority,stopIfTrue:this._stopIfTrue}},u.prototype.fromJSON=function(t){var r,i;if(!t)return;if(t.ranges)for(this.ranges=[],r=0;r<t.ranges.length;r++)i=t.ranges[r],this.ranges.push(new n.spread.Range(i.row,i.col,i.rowCount,i.colCount));t.style&&(this.style=new n.spread.Style,this.style.copyFrom(t.style)),t.operator!==null&&t.operator!==undefined&&(this.operator=t.operator),t.text!==null&&t.text!==undefined&&(this.text=t.text),t.priority!==null&&t.priority!==undefined&&(this._priority=t.priority),t.stopIfTrue!==null&&t.stopIfTrue!==undefined&&(this._stopIfTrue=t.stopIfTrue)
},u}(e),t.SpecificTextRule=it,g=function(){function n(n,t,i){this.forceValue2Text=!1,this.useWildCards=!0,this.regex=null,this.ignoreCase=!1,this.conditionType="TextCondition",this.questionMarkWildcard="?",this.questionMarkWildcardRegularExpression=".",this.asteriskWildcard="*",this.asteriskWildcardRegularExpression="[.\n]*",this.ignoreBlank=!1,this.compareType=n,this.expected=t,this.formula=typeof i=="string"?$.trim(i).replace("=",""):i}return n.prototype.adjustOffset=function(n,t){},n.prototype.evaluate=function(n,i,r,u){var f=null,e;if(this.forceValue2Text===!0||typeof u=="string"||typeof u=="number")f=u!==undefined&&u!==null?u.toString():"";else{if(u instanceof Date)return this.compareType===t.TextCompareType.BeginsWith||this.compareType===t.TextCompareType.EndsWith||this.compareType===t.TextCompareType.Contains?!1:this.compareType===t.TextCompareType.DoesNotBegi
nWith||this.compareType===t.TextCompareType.DoesNotEndWith||this.compareType===t.TextCompareType.DoesNotContain;f=u!==undefined&&u!==null?u.toString():""}if(this.ignoreBlank&&(f===undefined||f===null||f===""))return!0;e=this.getExpectedString(n,i,r);if(this.hasWildcard(e))if(typeof u=="number")return this.compareType===t.TextCompareType.DoesNotBeginWith||this.compareType===t.TextCompareType.DoesNotContain||this.compareType===t.TextCompareType.DoesNotEndWith||this.compareType===t.TextCompareType.NotEqualsTo;switch(this.compareType){case t.TextCompareType.EqualsTo:return this.isEquals(e,f);case t.TextCompareType.NotEqualsTo:return!this.isEquals(e,f);case t.TextCompareType.BeginsWith:return this.isStartWith(e,f);case t.TextCompareType.DoesNotBeginWith:return!this.isStartWith(e,f);case t.TextCompareType.EndsWith:return this.isEndWith(e,f);case t.TextCompareType.DoesNotEndWith:return!this.isEndWith(e,f);case t.TextCompareType.Contains:return
this.isContains(e,f);case t.TextCompareType.DoesNotContain:return!this.isContains(e,f)}return!1},n.prototype.getExpectedString=function(n,t,i){var r=this.getExpected(n,t,i);return r===undefined||r===null?null:r.toString()},n.prototype.getExpected=function(n,t,i){var r,u;return this.formula&&this.formula.length>0?(r=n.getCalcService(),r?(u=r.parse(this.formula,t,i),r.evaluateParsedFormula(n._getSheetSource(),u,t,i)):this.expected):this.expected},n.prototype.hasWildcard=function(n){return n===undefined||n===null||n===""?!1:n.indexOf(this.asteriskWildcard)>-1||n.indexOf(this.questionMarkWildcard)>-1},n.prototype.isEquals=function(n,t){var r,i,u;if(this.useWildCards&&this.hasWildcard(n)){r=this.createEqualsRegex(n);if(r){i=t===undefined&&t===null?"":t,r.lastIndex=-1;if(i!==undefined&&i!==null)return i.search(r)>-1}return!1}else return t!==undefined&&t!==null&&t!==""?(u=n!==undefined&&n!==nu
ll?n:"",this.ignoreCase?u.toLowerCase()===t.toLowerCase():u===t):n===undefined||n===null||n===""},n.prototype.createEqualsRegex=function(n){var t,i,r,u;if(this.regex)return this.regex;n=this.encodeExpression(n),t=n,i=new RegExp("\\"+this.questionMarkWildcard,"g"),t=t.replace(i,this.questionMarkWildcardRegularExpression),i=new RegExp("\\"+this.asteriskWildcard,"g"),t=t.replace(i,this.asteriskWildcardRegularExpression),r=null;try{u=this.ignoreCase?"ig":"g",r=new RegExp("^"+t+"$",u)}catch(f){return null}return r},n.prototype.encodeExpression=function(n){if(!n)return null;var t=n;return t=t.replace(/\^/g,"\\^"),t=t.replace(/\$/g,"\\$"),t=t.replace(/\(/g,"\\("),t=t.replace(/\)/g,"\\)"),t=t.replace(/\[/g,"\\["),t=t.replace(/\]/g,"\\]"),t=t.replace(/\{/g,"\\{"),t=t.replace(/\}/g,"\\}"),t=t.replace(/\./g,"\\.
"),t=t.replace(/\+/g,"\\+"),t=t.replace(/\|/g,"\\|")},n.prototype.isStartWith=function(n,t){var i,f,u,r;if(this.useWildCards&&this.hasWildcard(n)){f=this.createStartWithRegex(n);if(f){i=t===undefined||t===null?"":t,f.lastIndex=-1;if(i!==undefined&&i!==null)return i.search(f)>-1}return!1}else return t!==undefined&&t!==null&&t!==""?n===undefined||n===null?!1:(u=n,i=t,this.ignoreCase&&(u=u.toLowerCase(),i=i.toLowerCase()),r=i.match("^"+u),r!==undefined&&r!==null&&r.length>0?r[0]===u:!1):n===undefined||n===null||n===""},n.prototype.createStartWithRegex=function(n){var t,r,i,u;if(this.regex)return this.regex;n=this.encodeExpression(n),t=n,r=new RegExp("\\"+this.questionMarkWildcard,"g"),t=t.replace(r,this.questionMarkWildcardRegularExpression),r=new RegExp("\\"+this.asteriskWildcard,"g"),t=t.replace(r,this.asteriskWildcardR
egularExpression),i=null;try{u=this.ignoreCase?"ig":"g",i=n[0]===this.asteriskWildcard?new RegExp(t,u):new RegExp("^"+t,u)}catch(f){return null}return i},n.prototype.isEndWith=function(n,t){var i,f,u,r;if(this.useWildCards&&this.hasWildcard(n)){f=this.createEndWithRegex(n);if(f){i=t===undefined||t===null?"":t,f.lastIndex=-1;if(i!==undefined&&i!==null)return i.search(f)>-1}return!1}else return t!==undefined&&t!==null&&t!==""?n===undefined||n===null?!1:(u=n,i=t,this.ignoreCase&&(u=u.toLowerCase(),i=i.toLowerCase()),r=i.match(u+"$"),r!==undefined&&r!==null&&r.length>0?r[0]===u:!1):n===undefined||n===null||n===""},n.prototype.createEndWithRegex=function(n){var t,r,i,u;if(this.regex)return this.regex;n=this.encodeExpression(n),t=n,r=new RegExp("\\"+this.questionMarkWildcard,"g"),t=t.replace(r,this.questionMarkWildcardRegularExpression),r=
new RegExp("\\"+this.asteriskWildcard,"g"),t=t.replace(r,this.asteriskWildcardRegularExpression),i=null;try{u=this.ignoreCase?"ig":"g",i=n[n.length-1]===this.asteriskWildcard?new RegExp(t,u):new RegExp(t+"$",u)}catch(f){return null}return i},n.prototype.isContains=function(n,t){var i,u,r;if(this.useWildCards&&this.hasWildcard(n)){u=this.createContainsRegex(n);if(u){i=t===undefined||t===null?"":t,u.lastIndex=-1;if(i!==undefined&&i!==null)return i.search(u)>-1}return!1}else return t!==undefined&&t!==null&&t!==""?n===undefined||n===null?!1:(r=n,i=t,this.ignoreCase&&(r=r.toLowerCase(),i=i.toLowerCase()),i.indexOf(r)>-1):n===undefined||n===null||n===""},n.prototype.createContainsRegex=function(n){var t,i,r,u;if(this.regex)return this.regex;n=this.encodeExpression(n),t=n,i=new RegExp("\\"+this.questionMarkWildcard,"g"),t=t.replace(i,this.questio
nMarkWildcardRegularExpression),i=new RegExp("\\"+this.asteriskWildcard,"g"),t=t.replace(i,this.asteriskWildcardRegularExpression),r=null;try{u=this.ignoreCase?"ig":"g",r=new RegExp(t,u)}catch(f){return null}return r},n.prototype.reset=function(){this.expected=null,this.ignoreBlank=!1,this.compareType=t.TextCompareType.EqualsTo,this.useWildCards=!0,this.ignoreCase=!1,this.forceValue2Text=!1},n.prototype.toJSON=function(){return{compareType:this.compareType,expected:this.expected,formula:this.formula,forceValue2Text:this.forceValue2Text,useWildCards:this.useWildCards,ignoreCase:this.ignoreCase,regex:this.regex,conType:r.TextCondition,ignoreBlank:this.ignoreBlank}},n.prototype.fromJSON=function(n){if(!n)return;n.compareType!==null&&n.compareType!==undefined&&(this.compareType=n.compareType),n.expected!==null&&n.expected!==undefined&&(this.expected=n.expected),n.formula!==null&&n.formula!==undefined&&am
p;(this.formula=n.formula),n.forceValue2Text!==null&&n.forceValue2Text!==undefined&&(this.forceValue2Text=n.forceValue2Text),n.useWildCards!==null&&n.useWildCards!==undefined&&(this.useWildCards=n.useWildCards),n.ignoreCase!==null&&n.ignoreCase!==undefined&&(this.ignoreCase=n.ignoreCase),n.regex!==null&&n.regex!==undefined&&(this.regex=n.regex),n.ignoreBlank!==null&&n.ignoreBlank!==undefined&&(this.ignoreBlank=n.ignoreBlank)},n}(),t.TextCondition=g,ct=function(){function n(n,t){this.conditionType="ColorCondition",this.ignoreBlank=!1,this.compareType=n,this.expected=t}return n.prototype.evaluate=function(n,t,i,r){return this.isEqualsColor(n,r)},n.prototype.isEqualsColor=function(n,i){var r=this.getColorFromString(this.expected),u,f;if(r!==undefined&&r!==null&&r!==""){u=this.getColorFromString(i);if(u!==undefined&&u!==null&&u!=="")return u.a===r
.a&&u.r===r.r&&u.g===r.g&&u.b===r.b;else{this.compareType===t.ColorCompareType.BackgroundColor?n&&n.getDefaultStyle&&(f=n.getDefaultStyle().backColor):this.compareType===t.ColorCompareType.ForegroundColor&&n&&n.getDefaultStyle&&(f=n.getDefaultStyle().foreColor);if(f)return r.a===f.a&&r.r===f.r&&r.g===f.g&&r.b===f.b}}else if(this.ignoreBlank)return!0;return!1},n.prototype.getColorFromString=function(n){return n===undefined||n===null||n===""?null:t._Color.parse(n)},n.prototype.reset=function(){this.expected=null,this.ignoreBlank=!1,this.compareType=t.ColorCompareType.BackgroundColor},n.prototype.toJSON=function(){return{compareType:this.compareType,expected:this.expected,conType:r.ColorCondition,ignoreBlank:this.ignoreBlank}},n.prototype.fromJSON=function(n){if(!n)return;n.compareType!==null&&n.compareType!==undefined&&(this.compareType=n.compareType),n.expected!==null&
;&n.expected!==undefined&&(this.expected=n.expected),n.ignoreBlank!==null&&n.ignoreBlank!==undefined&&(this.ignoreBlank=n.ignoreBlank)},n}(),t.ColorCondition=ct,rt=function(r){function u(t,i){r.call(this,i);if(t&&typeof t!="string")throw new Error(n.spread._StringResource.Exp_InvalidArgument);this.formula=t}return __extends(u,r),u.prototype.createCondition=function(){var n=new et(t.CustomValueType.Formula,!this.formula||this.formula===""?null:this.formula);return this.ranges&&this.ranges.length>0&&(n._baseRow=this.ranges[0].row,n._baseCol=this.ranges[0].col),n},u.prototype.reset=function(){this.formula=null,this.style=null,this._stopIfTrue=!1,this._priority=1},u.prototype.isFormula=function(n){return n&&n[0]==="="},u.prototype.toJSON=function(){return{ruleType:i.FormulaRule,ranges:this.ranges,style:this.style,formula:this.formula,priority:this._priority,stopIfTrue:this._stopIfTrue}},u.protot
ype.fromJSON=function(t){var r,i;if(!t)return;if(t.ranges)for(this.ranges=[],r=0;r<t.ranges.length;r++)i=t.ranges[r],this.ranges.push(new n.spread.Range(i.row,i.col,i.rowCount,i.colCount));t.style&&(this.style=new n.spread.Style,this.style.copyFrom(t.style)),t.formula!==null&&t.formula!==undefined&&(this.formula=t.formula),t.priority!==null&&t.priority!==undefined&&(this._priority=t.priority),t.stopIfTrue!==null&&t.stopIfTrue!==undefined&&(this._stopIfTrue=t.stopIfTrue)},u}(e),t.FormulaRule=rt,et=function(){function i(n,t){var i,r;this.expected=null,this.ignoreBlank=!1,this.conditionType="FormulaCondition",this._baseRow=null,this._baseCol=null,this._expr=null,this.customValueType=n,i=t,typeof i=="string"&&(r=$.trim(i),i=r[0]==="="?r.substr(1):r),this.formula=i}return i.prototype.adjustOffset=function(n,t){},i.prototype.evaluate=function(i,r,u,f){var e,o;if(!t.util.hasCalc())return!1;if(t
his.customValueType===t.CustomValueType.Formula){e=this.getExpected(i,r,u);if(this.ignoreBlank&&(e===undefined||e===null||e===""))return!0;try{return n.spread.Calc.Convert.toBool(e)}catch(s){return!1}}else{o=n.spread.Calc.Convert.isError;switch(this.customValueType){case t.CustomValueType.Empty:return f===undefined||f===null||f==="";case t.CustomValueType.NonEmpty:return f!==undefined&&f!==null&&f!=="";case t.CustomValueType.Error:return o(f);case t.CustomValueType.NonError:return!o(f)}}return!1},i.prototype.getExpected=function(t,i,r){var c,u,s,h,o,f,e,a,l;if(this.formula&&this.formula.length>0){c=t.getCalcService();if(!c)return this.expected;this._expr||((this._baseRow===undefined||this._baseRow===null)&&(this._baseCol===undefined||this._baseCol===null)&&(this._baseRow=i,this._baseCol=r),this._expr=c.parse(this.formula,this._baseRow,this._baseCol)),u=c.evaluateParsedFormula(t._getSheetSource(),this._e
xpr,i,r,!0);if(u instanceof n.spread.Calc.Reference){for(s=u.getRowCount(0),h=u.getColumnCount(0),o=[],f=0;f<s;f++)for(o[f]=[],e=0;e<h;e++)o[f][e]=u.getValue(0,f,e);u=o}else if(u instanceof n.spread.Calc.Array){for(s=u.getRowCount(),h=u.getColumnCount(),o=[],f=0;f<s;f++)for(o[f]=[],e=0;e<h;e++)o[f][e]=u.getValue(f,e);u=o}return u instanceof Array?(s=u.length,h=u[0].length,s===1&&h===1?u[0][0]:(a=i-this._baseRow,l=r-this._baseCol,a<s&&l<h?u[a][l]:n.spread.Calc.Errors.NotAvailable)):u}else return this.expected},i.prototype.reset=function(){this.expected=null,this.ignoreBlank=!1,this.customValueType=t.CustomValueType.Empty,this._expr=null,this._baseRow=null,this._baseCol=null},i.prototype.toJSON=function(){return{customValueType:this.customValueType,expected:this.expected,formula:this.formula,conType:r.FormulaCondition,ignoreBlank:this.ignoreBlank}},i.prototype.fromJSON=function(n){if(!n)return;n.customValueType!==null&&n.customValueType!==unde
fined&&(this.customValueType=n.customValueType),n.expected!==null&&n.expected!==undefined&&(this.expected=n.expected),n.formula!==null&&n.formula!==undefined&&(this.formula=n.formula),n.ignoreBlank!==null&&n.ignoreBlank!==undefined&&(this.ignoreBlank=n.ignoreBlank)},i}(),t.FormulaCondition=et,l=function(){function n(n,t,i){this.conditionType="DateCondition",this.ignoreBlank=!1,this.compareType=n,this.expected=t,this.formula=typeof i=="string"?$.trim(i).replace("=",""):i}return n.prototype.evaluate=function(n,i,r,u){if(u===undefined||u===null||u==="")if(this.ignoreBlank)return!0;if(!(u instanceof Date))return!1;var f=this.getExpectedDateTime(n,i,r);if(f===undefined||f===null)return!!this.ignoreBlank;switch(this.compareType){case t.DateCompareType.EqualsTo:return this.isEquals(f,u);case t.DateCompareType.NotEqualsTo:return!this.isEquals(f,u);case t.DateCompareType.After:return thi
s.isAfter(f,u);case t.DateCompareType.AfterEqualsTo:return this.isAfter(f,u)||this.isEquals(f,u);case t.DateCompareType.Before:return this.isBefore(f,u);case t.DateCompareType.BeforeEqualsTo:return this.isBefore(f,u)||this.isEquals(f,u)}return!1},n.prototype.getExpectedDateTime=function(n,i,r){var u=this.getExpected(n,i,r);if(u instanceof Date)return u;else if(typeof u=="string")return t._DateTimeHelper.parseLocale(u);return null},n.prototype.getExpected=function(n,t,i){var r,u;return this.formula&&this.formula.length>0?(r=n.getCalcService(),r?(u=r.parse(this.formula,t,i),r.evaluateParsedFormula(n._getSheetSource(),u,t,i)):this.expected):this.expected},n.prototype.isEquals=function(n,t){return n.getYear()===t.getYear()&&n.getMonth()===t.getMonth()&&n.getDate()===t.getDate()},n.prototype.isAfter=function(n,t){var i=this.createDayEnding(n);return t>i},n.prototype.createDayEnding=function(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate(
),23,59,59,999)},n.prototype.isBefore=function(n,t){var i=this.createDayBeginning(n);return t<i},n.prototype.createDayBeginning=function(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0)},n.prototype.reset=function(){this.expected=null,this.ignoreBlank=!1,this.compareType=t.DateCompareType.EqualsTo},n.prototype.toJSON=function(){return{compareType:this.compareType,expected:this.expected,formula:this.formula,conType:r.DateCondition,ignoreBlank:this.ignoreBlank}},n.prototype.fromJSON=function(n){if(!n)return;n.compareType!==null&&n.compareType!==undefined&&(this.compareType=n.compareType),n.expected!==null&&n.expected!==undefined&&(this.expected=$.type(n.expected)==="string"?new Date(n.expected):n.expected),n.formula!==null&&n.formula!==undefined&&(this.formula=n.formula),n.ignoreBlank!==null&&n.ignoreBlank!==undefined&&(this.ignoreBlank=n.ignoreBlank)},n}(),t.DateCondition=l,ot=function(r)
{function u(n,t){r.call(this,t),this.type=n}return __extends(u,r),u.prototype.createCondition=function(){return new ut(this.type)},u.prototype.reset=function(){this.type=t.DateOccurringType.Today,this.style=null,this._stopIfTrue=!1,this._priority=1},u.prototype.toJSON=function(){return{ruleType:i.DateOccurringRule,ranges:this.ranges,style:this.style,type:this.type,priority:this._priority,stopIfTrue:this._stopIfTrue}},u.prototype.fromJSON=function(t){var r,i;if(!t)return;if(t.ranges)for(this.ranges=[],r=0;r<t.ranges.length;r++)i=t.ranges[r],this.ranges.push(new n.spread.Range(i.row,i.col,i.rowCount,i.colCount));t.style&&(this.style=new n.spread.Style,this.style.copyFrom(t.style)),t.type!==null&&t.type!==undefined&&(this.type=t.type),t.priority!==null&&t.priority!==undefined&&(this._priority=t.priority),t.stopIfTrue!==null&&t.stopIfTrue!==undefined&&(this._stopIfTrue=t.stopIfTrue)},u}(e),t.DateOccurringRule=ot,ut=function(){fu
nction i(n){this.ignoreBlank=!1,this.formula=null,this.expectTypeId=0,this.conditionType="DateExCondition",this.expected=n}return i.prototype.adjustOffset=function(n,t){},i.prototype.evaluate=function(n,t,i,r){var u=this.getExpectedInt(n,t,i);return u!==undefined&&u!==null?this.checkCondition(u,r):!1},i.prototype.getExpectedInt=function(n,t,i){var r=this.getExpected(n,t,i);return r=parseInt(r,10),isNaN(r)?null:r},i.prototype.getExpected=function(n,t,i){var r,u;return this.formula&&this.formula.length>0?(r=n.getCalcService(),r?(u=r.parse(this.formula,t,i),r.evaluateParsedFormula(n._getSheetSource(),u,t,i)):this.expected):this.expected},i.prototype.checkCondition=function(i,r){var h=r,e,g,d,k,it,tt,nt,y,b,w,a,p,v;if(this.ignoreBlank&&(h===undefined||h===null||h===""))return!0;try{h=n.spread.Calc.Convert.toDateTime(h)}catch(et){return!1}if(this.expectTypeId===0){var o=null,s=null,f=new Date,u=new Date(f.getFullYear(),f.getMonth(),f.getDate
(),f.getHours(),f.getMinutes(),f.getSeconds(),f.getMilliseconds());switch(i){case t.DateOccurringType.Last7Days:u.setDate(u.getDate()-6),o=new Date(u.getFullYear(),u.getMonth(),u.getDate(),0,0,0,0),s=new Date(f.getFullYear(),f.getMonth(),f.getDate(),23,59,59,999);break;case t.DateOccurringType.Yesterday:u.setDate(u.getDate()-1),o=new Date(u.getFullYear(),u.getMonth(),u.getDate(),0,0,0,0),s=new Date(u.getFullYear(),u.getMonth(),u.getDate(),23,59,59,999);break;case t.DateOccurringType.Today:o=new Date(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0,0),s=new Date(f.getFullYear(),f.getMonth(),f.getDate(),23,59,59,999);break;case t.DateOccurringType.Tomorrow:u.setDate(u.getDate()+1),o=new Date(u.getFullYear(),u.getMonth(),u.getDate(),0,0,0,0),s=new Date(u.getFullYear(),u.getMonth(),u.getDate(),23,59,59,999);break;case t.DateOccurringType.LastWeek:g=f,g.setDate(f.getDate()-f.getDay()-7),d=u,d.setDate(u.getDate()-u.getDay()-1),o=new Date(g.getFullYear(),g.getMonth(),g.getDate(),0,0,0,0),s=n
ew Date(d.getFullYear(),d.getMonth(),d.getDate(),23,59,59,999);break;case t.DateOccurringType.ThisWeek:k=f,k.setDate(f.getDate()-f.getDay()),it=u,it.setDate(u.getDate()-u.getDay()+6),o=new Date(k.getFullYear(),k.getMonth(),k.getDate(),0,0,0,0),s=new Date(it.getFullYear(),it.getMonth(),it.getDate(),23,59,59,999);break;case t.DateOccurringType.NextWeek:tt=f,tt.setDate(f.getDate()-f.getDay()+7),nt=u,nt.setDate(u.getDate()-u.getDay()+13),o=new Date(tt.getFullYear(),tt.getMonth(),tt.getDate(),0,0,0,0),s=new Date(nt.getFullYear(),nt.getMonth(),nt.getDate(),23,59,59,999);break;case t.DateOccurringType.LastMonth:y=f,y.setDate(1),y.setMonth(f.getMonth()-1),b=u,b.setDate(0),o=new Date(y.getFullYear(),y.getMonth(),y.getDate(),0,0,0,0),s=new Date(b.getFullYear(),b.getMonth(),b.getDate(),23,59,59,999);break;case t.DateOccurringType.ThisMonth:w=f,w.setDate(1),a=u,a.setDate(1),a.setMonth(u.getMonth()+1),a.setDate(0),o=new Date(w.getFullYear(),w.getMonth(),w.getDate(),0,0,0,0),s=new Date(a.getFullY
ear(),a.getMonth(),a.getDate(),23,59,59,999);break;case t.DateOccurringType.NextMonth:p=f,p.setDate(1),p.setMonth(f.getMonth()+1),v=u,v.setDate(1),v.setMonth(u.getMonth()+2),v.setDate(0),o=new Date(p.getFullYear(),p.getMonth(),p.getDate(),0,0,0,0),s=new Date(v.getFullYear(),v.getMonth(),v.getDate(),23,59,59,999);break}if(o!==undefined&&o!==null&&s!==undefined&&s!==null){var ft=new l(t.DateCompareType.AfterEqualsTo,o,null),ut=new l(t.DateCompareType.BeforeEqualsTo,s,null),rt=new c(t.RelationCompareType.And,ft,ut);return rt.evaluate(null,0,0,h)}}else if(this.expectTypeId===1){e=this.getExpectedInt(null,0,0);if(e!==undefined&&e!==null)return this.isEqualsYear(e,h)}else if(this.expectTypeId===2){e=this.getExpectedInt(null,0,0);if(e!==undefined&&e!==null)return this.isEqualsQuarter(e,h)}else if(this.expectTypeId===3){e=this.getExpectedInt(null,0,0);if(e!==undefined&&e!==null)return this.isEqualsMonth(e,h)}else if(this.expectTypeId===4){e=th
is.getExpectedInt(null,0,0);if(e!==undefined&&e!==null)return this.isEqualsWeek(e,h)}else if(this.expectTypeId===5){e=this.getExpectedInt(null,0,0);if(e!==undefined&&e!==null)return this.isEqualsDay(e,h)}return!1},i.prototype.isEqualsYear=function(n,t){return n===t.getFullYear()},i.prototype.isEqualsQuarter=function(n,i){switch(n){case t.QuarterType.Quarter1:return i.getMonth()>=1&&i.getMonth()<=3;case t.QuarterType.Quarter2:return i.getMonth()>=4&&i.getMonth()<=6;case t.QuarterType.Quarter3:return i.getMonth()>=7&&i.getMonth()<=9;case t.QuarterType.Quarter4:return i.getMonth()>=10&&i.getMonth()<=12}return!1},i.prototype.isEqualsMonth=function(n,t){return n===t.getMonth()},i.prototype.isEqualsWeek=function(n,t){return n===t.getDay()},i.prototype.isEqualsDay=function(n,t){return n===t.getDate()},i.prototype.reset=function(){this.expected=null,this.ignoreBlank=!1,this.expectTypeId=0},i.prototype.toJSON=function(){
return{ignoreBlank:this.ignoreBlank,formula:this.formula,expected:this.expected,expectTypeId:this.expectTypeId,conType:r.DateExCondition}},i.prototype.fromJSON=function(n){if(!n)return;n.ignoreBlank!==null&&n.ignoreBlank!==undefined&&(this.ignoreBlank=n.ignoreBlank),n.formula!==null&&n.formula!==undefined&&(this.formula=n.formula),n.expected!==null&&n.expected!==undefined&&(this.expected=n.expected),n.expectTypeId!==null&&n.expectTypeId!==undefined&&(this.expectTypeId=n.expectTypeId)},i.fromDay=function(n){var t=new i(n);return t.expectTypeId=5,t},i.fromMonth=function(n){var t=new i(n);return t.expectTypeId=3,t},i.fromQuarter=function(n){var t=new i(n);return t.expectTypeId=2,t},i.fromWeek=function(n){var t=new i(n);return t.expectTypeId=4,t},i.fromYear=function(n){var t=new i(n);return t.expectTypeId=1,t},i}(),t.DateExCondition=ut,lt=function(){function n(n,t,i){this.ignoreBlank=!1,this.conditionType="TextLengthCo
ndition",this.compareType=n,this.expected=t,this.formula=typeof i=="string"?$.trim(i).replace("=",""):i}return n.prototype.evaluate=function(n,i,r,u){if(u===undefined||u===null||u==="")return this.ignoreBlank;var e=u===undefined||u===null?0:u.length,f=this.getExpectedInt(n,i,r);if(typeof f=="number")switch(this.compareType){case t.GeneralCompareType.EqualsTo:return e===f;case t.GeneralCompareType.GreaterThan:return e>f;case t.GeneralCompareType.GreaterThanOrEqualsTo:return e>=f;case t.GeneralCompareType.LessThan:return e<f;case t.GeneralCompareType.LessThanOrEqualsTo:return e<=f;case t.GeneralCompareType.NotEqualsTo:return e!==f}return!1},n.prototype.getExpectedInt=function(n,t,i){var r=this.getExpected(n,t,i);return r=parseInt(r,10),isNaN(r)?null:r},n.prototype.getExpected=function(n,t,i){var r,u;return this.formula&&this.formula.length>0?(r=n.getCalcService(),r?(u=r.parse(this.formula,t,i),r.evaluatePars
edFormula(n._getSheetSource(),u,t,i)):this.expected):this.expected},n.prototype.reset=function(){this.expected=null,this.ignoreBlank=!1,this.compareType=t.GeneralCompareType.EqualsTo},n.prototype.toJSON=function(){return{compareType:this.compareType,expected:this.expected,formula:this.formula,conType:r.TextLengthCondition,ignoreBlank:this.ignoreBlank}},n.prototype.fromJSON=function(n){if(!n)return;n.compareType!==null&&n.compareType!==undefined&&(this.compareType=n.compareType),n.expected!==null&&n.expected!==undefined&&(this.expected=n.expected),n.formula!==null&&n.formula!==undefined&&(this.formula=n.formula),n.ignoreBlank!==null&&n.ignoreBlank!==undefined&&(this.ignoreBlank=n.ignoreBlank)},n}(),t.TextLengthCondition=lt,ft=function(r){function u(n,t,i){r.call(this,i),this.type=n,this.rank=t}return __extends(u,r),u.prototype.createCondition=function(){return new h(this.type,this.rank,this.ranges)},u.prototype.reset=fun
ction(){this.type=t.Top10ConditionType.Top,this.rank=10,this.style=null,this._stopIfTrue=!1,this._priority=1},u.prototype.toJSON=function(){return{ruleType:i.Top10Rule,ranges:this.ranges,style:this.style,type:this.type,rank:this.rank,priority:this._priority,stopIfTrue:this._stopIfTrue}},u.prototype.fromJSON=function(t){var r,i;if(!t)return;if(t.ranges)for(this.ranges=[],r=0;r<t.ranges.length;r++)i=t.ranges[r],this.ranges.push(new n.spread.Range(i.row,i.col,i.rowCount,i.colCount));t.style&&(this.style=new n.spread.Style,this.style.copyFrom(t.style)),t.type!==null&&t.type!==undefined&&(this.type=t.type),t.rank!==null&&t.rank!==undefined&&(this.rank=t.rank),t.priority!==null&&t.priority!==undefined&&(this._priority=t.priority),t.stopIfTrue!==null&&t.stopIfTrue!==undefined&&(this._stopIfTrue=t.stopIfTrue)},u}(e),t.Top10Rule=ft,h=function(){function i(n,t,i){this.isPercent=!1,this.ignoreBlank=!1,this.conditionType
="Top10Condition",this.formula=null,this.expected=t,this.type=n,this.ranges=i}return i.prototype.adjustOffset=function(n,t){},i.prototype.evaluate=function(n,i,r,u){var e,f,o;if(u===undefined||u===null||u==="")return this.ignoreBlank;e=this.getExpectedInt(n,i,r);if(e!==undefined&&e!==null){f=null,this.type===t.Top10ConditionType.Top?f=this.getMaxValues(n,e,this.ranges):this.type===t.Top10ConditionType.Bottom&&(f=this.getMinValues(n,e,this.ranges));if(f){o=0;try{o=this._toDouble(u)}catch(s){return!1}if(f.contains(o))return!0}}return!1},i.prototype.getExpectedInt=function(n,t,i){var r=this.getExpected(n,t,i);return r=parseInt(r,10),isNaN(r)||!isFinite(r)?null:r},i.prototype.getExpected=function(n,t,i){var r,u;return this.formula&&this.formula.length>0?(r=n.getCalcService(),r?(u=r.parse(this.formula,t,i),r.evaluateParsedFormula(n._getSheetSource(),u,t,i)):this.expected):this.expected},i.prototype.getMaxValues=function(n,t,i){var f=[],r,a,h
,o,c,v,s,e;if(i)for(r=Number.MAX_VALUE,a=0,h=0;h<i.length;h++)for(o=i[h],c=0;c<o.rowCount;c++)for(v=c+o.row,s=0;s<o.colCount;s++){var y=s+o.col,l=n.getValue(v,y),u=this._toDouble(l);if(l!==undefined&&l!==null&&u!==undefined&&u!==null)try{if(a<t)f.push(u),u<r&&(r=u),a++;else if(u>r){f.remove(r),f.push(u);if(f.indexOf(r)<0)for(r=u,e=0;e<f.length;e++)f[e]<r&&(r=f[e])}}catch(p){}}return f},i.prototype.getMinValues=function(n,t,i){var f=[],r,a,h,o,c,v,s,e;if(i)for(r=-Number.MAX_VALUE,a=0,h=0;h<i.length;h++)for(o=i[h],c=0;c<o.rowCount;c++)for(v=c+o.row,s=0;s<o.colCount;s++){var y=s+o.col,l=n.getValue(v,y),u=this._toDouble(l);if(l!==undefined&&l!==null&&u!==undefined&&u!==null)try{if(a<t)f.push(u),u>r&&(r=u),a++;else if(u<r){f.remove(r),f.push(u);if(f.indexOf(r)<0)for(r=u,e=0;e<f.length;e++)f[e]>r&&(r=f[e])}}catch(p){}}return f},i.prototype.reset=function(){
this.expected=null,this.ignoreBlank=!1,this.type=t.Top10ConditionType.Top,this.isPercent=!1,this.ranges=null},i.prototype._toDouble=function(i){return(typeof i=="number"||i instanceof Date)&&t.util.hasCalc()?n.spread.Calc.Convert.toDouble(i):null},i.prototype.toJSON=function(){return{expected:this.expected,formula:this.formula,type:this.type,isPercent:this.isPercent,ignoreBlank:this.ignoreBlank,ranges:this.ranges,conType:r.Top10Condition}},i.prototype.fromJSON=function(t){var r,i;if(!t)return;t.expected!==null&&t.expected!==undefined&&(this.expected=t.expected),t.formula!==null&&t.formula!==undefined&&(this.formula=t.formula),t.type!==null&&t.type!==undefined&&(this.type=t.type),t.isPercent!==null&&t.isPercent!==undefined&&(this.isPercent=t.isPercent),t.ignoreBlank!==null&&t.ignoreBlank!==undefined&&(this.ignoreBlank=t.ignoreBlank);if(t.ranges)for(this.ranges=[],r=0;r<t.ranges.length
;r++)i=t.ranges[r],this.ranges.push(new n.spread.Range(i.row,i.col,i.rowCount,i.colCount))},i}(),t.Top10Condition=h,v=function(t){function r(n){t.call(this,n)}return __extends(r,t),r.prototype.createCondition=function(){return new a(!1,this.ranges)},r.prototype.toJSON=function(){return{ruleType:i.UniqueRule,ranges:this.ranges,style:this.style,priority:this._priority,stopIfTrue:this._stopIfTrue}},r.prototype.fromJSON=function(t){var r,i;if(!t)return;if(t.ranges)for(this.ranges=[],r=0;r<t.ranges.length;r++)i=t.ranges[r],this.ranges.push(new n.spread.Range(i.row,i.col,i.rowCount,i.colCount));t.style&&(this.style=new n.spread.Style,this.style.copyFrom(t.style)),t.priority!==null&&t.priority!==undefined&&(this._priority=t.priority),t.stopIfTrue!==null&&t.stopIfTrue!==undefined&&(this._stopIfTrue=t.stopIfTrue)},r}(e),t.UniqueRule=v,p=function(t){function r(n){t.call(this,n)}return __extends(r,t),r.prototype.createCondition=function(){return new a
(!0,this.ranges)},r.prototype.toJSON=function(){return{ruleType:i.DuplicateRule,ranges:this.ranges,style:this.style,priority:this._priority,stopIfTrue:this._stopIfTrue}},r.prototype.fromJSON=function(t){var r,i;if(!t)return;if(t.ranges)for(this.ranges=[],r=0;r<t.ranges.length;r++)i=t.ranges[r],this.ranges.push(new n.spread.Range(i.row,i.col,i.rowCount,i.colCount));t.style&&(this.style=new n.spread.Style,this.style.copyFrom(t.style)),t.priority!==null&&t.priority!==undefined&&(this._priority=t.priority),t.stopIfTrue!==null&&t.stopIfTrue!==undefined&&(this._stopIfTrue=t.stopIfTrue)},r}(e),t.DuplicateRule=p,a=function(){function i(n,t){this.conditionType="UniqueCondition",this.ignoreBlank=!1,this.formula=null,this.expected=n,this.ranges=t}return i.prototype.adjustOffset=function(n,t){},i.prototype.evaluate=function(i,r,u,f){var e=f,h,o,s;if(e===undefined||e===null||e==="")return this.ignoreBlank;return t.util.hasCalc()&
&(h=n.spread.Calc.Convert,h.isNumber(e)&&(e=h.toDouble(e))),o=this.getExpectedBoolean(i,r,u),o!==undefined&&o!==null?(s=this.getDuplicated(i,this.ranges),s!==undefined&&s!==null?s.contains(e)?o===!0:o!==!0:o!==!0):!1},i.prototype.getExpectedBoolean=function(t,i,r){var u=this.getExpected(t,i,r);try{return n.spread.Calc.Convert.toBool(u)}catch(f){return null}},i.prototype.getExpected=function(n,t,i){var r,u;return this.formula&&this.formula.length>0?(r=n.getCalcService(),r?(u=r.parse(this.formula,t,i),r.evaluateParsedFormula(n._getSheetSource(),u,t,i)):this.expected):this.expected},i.prototype.getDuplicated=function(i,r){var l=[],c=[],a,o,f,s,v,e,y,u,h;if(r)for(a=r.length,o=0;o<a;o++)for(f=r[o],s=0;s<f.rowCount;s++)for(v=s+f.row,e=0;e<f.colCount;e++)y=e+f.col,u=i.getValue(v,y,3),u!==undefined&&u!==null&&(t.util.hasCalc()&&(h=n.spread.Calc.Convert,h.isNumber(u)&&(u=h.toDouble(u))),this._containsKey(l,u)?c.c
ontains(u)||c.push(u):l.push({key:u,value:!1}));return c},i.prototype._containsKey=function(n,t){for(var r=n.length,i=0;i<r;i++)if(n[i].key===t)return!0;return!1},i.prototype.reset=function(){this.expected=null,this.ignoreBlank=!1,this.ranges=null},i.prototype.toJSON=function(){return{expected:this.expected,formula:this.formula,ranges:this.ranges,conType:r.UniqueCondition,ignoreBlank:this.ignoreBlank}},i.prototype.fromJSON=function(t){var r,i;if(!t)return;t.expected!==null&&t.expected!==undefined&&(this.expected=t.expected),t.formula!==null&&t.formula!==undefined&&(this.formula=t.formula);if(t.ranges)for(this.ranges=[],r=0;r<t.ranges.length;r++)i=t.ranges[r],this.ranges.push(new n.spread.Range(i.row,i.col,i.rowCount,i.colCount));t.ignoreBlank!==null&&t.ignoreBlank!==undefined&&(this.ignoreBlank=t.ignoreBlank)},i}(),t.UniqueCondition=a,k=function(r){function u(n,t){r.call(this,t),this.type=n}return __extends(u,r),u.prototype.creat
eCondition=function(){return new d(this.type,this.ranges)},u.prototype.reset=function(){this.type=t.AverageConditionType.Above,this.style=null,this._stopIfTrue=!1,this._priority=1},u.prototype.toJSON=function(){return{ruleType:i.AverageRule,ranges:this.ranges,style:this.style,type:this.type,priority:this._priority,stopIfTrue:this._stopIfTrue}},u.prototype.fromJSON=function(t){var r,i;if(!t)return;if(t.ranges)for(this.ranges=[],r=0;r<t.ranges.length;r++)i=t.ranges[r],this.ranges.push(new n.spread.Range(i.row,i.col,i.rowCount,i.colCount));t.style&&(this.style=new n.spread.Style,this.style.copyFrom(t.style)),t.type!==null&&t.type!==undefined&&(this.type=t.type),t.priority!==null&&t.priority!==undefined&&(this._priority=t.priority),t.stopIfTrue!==null&&t.stopIfTrue!==undefined&&(this._stopIfTrue=t.stopIfTrue)},u}(e),t.AverageRule=k,d=function(){function i(n,t){this.conditionType="AverageCondition",this.ignoreBlank=!1,t
his._expr=null,this._stdevExpr=null,this.type=n,this.ranges=t}return i.prototype.adjustOffset=function(n,t){},i.prototype.evaluate=function(i,r,u,f){var c,l,s;if(!t.util.hasCalc())return!1;if(this.ignoreBlank&&(f===undefined||f===null||f===""))return!0;c=n.spread.Calc.Convert,l=c.toDouble,this._rebuildFormula();var o=this.getExpectedDouble(i,r,u),e=null,h=this._stdevExpr?this._getExpectedByExpression(i,this._stdevExpr,r,u):null;if(h!==undefined&&h!==null)try{e=l(h)}catch(a){e=NaN}if(c.isNumber(f)){s=l(f);if(!isNaN(o))switch(this.type){case t.AverageConditionType.Above:return s>o;case t.AverageConditionType.Below:return s<o;case t.AverageConditionType.EqualOrAbove:return s>=o;case t.AverageConditionType.EqualOrBelow:return s<=o;case t.AverageConditionType.Above1StdDev:return isNaN(e)?!1:s>o+e;case t.AverageConditionType.Below1StdDev:return isNaN(e)?!1:s<o-e;case t.AverageConditionType.Above2StdDev:return isNaN(e)?!1:s>o+2*e;case t.Averag
eConditionType.Below2StdDev:return isNaN(e)?!1:s<o-2*e;case t.AverageConditionType.Above3StdDev:return isNaN(e)?!1:s>o+3*e;case t.AverageConditionType.Below3StdDev:return isNaN(e)?!1:s<o-3*e}}return!1},i.prototype._rebuildFormula=function(){this.ranges&&(this._expr=this._createExpression("AVERAGE",this.ranges),(this.type===t.AverageConditionType.Above1StdDev||this.type===t.AverageConditionType.Below1StdDev||this.type===t.AverageConditionType.Above2StdDev||this.type===t.AverageConditionType.Below2StdDev||this.type===t.AverageConditionType.Above3StdDev||this.type===t.AverageConditionType.Below3StdDev)&&(this._stdevExpr=this._createExpression("STDEV",this.ranges)))},i.prototype._createExpression=function(i,r){var e,s,f,u;if(!t.util.hasCalc())return null;var o=n.spread.Calc.Expressions,l=n.spread.Calc.Functions,c=n.spread.Calc.Convert,h=l.findGlobalFunction(i);if(h){for(e=[],s=r.length,f=0;f<s;f++){u=r[f];if(u instanceof o.Expression)e[f]=
u;else if(u instanceof t.Range)e[f]=new o.RangeExpression(u.row,u.col,u.row+u.rowCount-1,u.col+u.colCount-1);else if(c.isNumber(u)&&!isNaN(u=c.toDouble(u)))e[f]=new o.DoubleExpression(u,u.toString());else throw n.spread._StringResource.Exp_NotSupport;}return new o.FunctionExpression(h,e)}return null},i.prototype.getExpectedDouble=function(t,i,r){var u=this.getExpected(t,i,r);try{return n.spread.Calc.Convert.toDouble(u)}catch(f){return NaN}},i.prototype.getExpected=function(n,t,i){var r=n.getCalcService(),u;return r?(u=r.unparse(this._expr,t,i),this._expr=r.parse(u,t,i),r.evaluateParsedFormula(n._getSheetSource(),this._expr,t,i)):null},i.prototype._getExpectedByExpression=function(n,t,i,r){var u=n.getCalcService(),f;return u?(f=u.unparse(t,i,r),t=u.parse(f,i,r),u.evaluateParsedFormula(n._getSheetSource(),t,i,r)):null},i.prototype.reset=function(){this.ignoreBlank=!1,this.type=t.AverageConditionType.Above,this.ranges=null,this._expr=null,this._stdevExpr=null},i.prototype.toJSO
N=function(){return{type:this.type,ranges:this.ranges,conType:r.AverageCondition,ignoreBlank:this.ignoreBlank}},i.prototype.fromJSON=function(t){var r,i;if(!t)return;t.type!==null&&t.type!==undefined&&(this.type=t.type);if(t.ranges)for(this.ranges=[],r=0;r<t.ranges.length;r++)i=t.ranges[r],this.ranges.push(new n.spread.Range(i.row,i.col,i.rowCount,i.colCount));t.ignoreBlank!==null&&t.ignoreBlank!==undefined&&(this.ignoreBlank=t.ignoreBlank)},i}(),t.AverageCondition=d,u=function(){function n(n,t){this.type=n,this.value=t}return n}(),t.ScaleValue=u,o=function(i){function r(n,t,r){i.call(this,null),this.expected=[],this.lowestValueCached=null,this.highestValueCached=null,this.cached=!1,this._oldRanges=null,this.scales=[n,t,r]}return __extends(r,i),r.prototype.stopIfTrue=function(){return this._stopIfTrue},r.prototype.isScaleRule=function(){return!0},r.prototype.createCondition=function(){return null},r.prototype._calculateLowestValueEx=function(n){var
t=(new h).getMinValues(n,1,this.ranges);return t&&t.length>0?t[0]:null},r.prototype._calculateHighestValueEx=function(n){var t=(new h).getMaxValues(n,1,this.ranges);return t&&t.length>0?t[0]:null},r.prototype._cloneRanges=function(t){for(var u=[],f=t.length,i,r=0;r<f;r++)i=t[r],u.push(new n.spread.Range(i.row,i.col,i.rowCount,i.colCount));return u},r.prototype._rangesChanged=function(){this._oldRanges||(this._oldRanges=this._cloneRanges(this.ranges));if(this._oldRanges.length!==this.ranges.length)return!0;for(var n=0;n<this._oldRanges.length;n++)if(!this._oldRanges[n].equals(this.ranges[n]))return!0;return!1},r.prototype._tryCache=function(n){this._rangesChanged()&&(this._clearCache(),this._oldRanges=this._cloneRanges(this.ranges)),this.cached===!1&&(this.lowestValueCached=this._calculateLowestValueEx(n),this.highestValueCached=this._calculateHighestValueEx(n),this.cached=!0)},r.prototype._clearCache=function(){this.lowestValueCached=null
,this.highestValueCached=null,this.cached=!1},r.prototype._calculateFormula=function(n,t,i,r){var u,f;return r&&r.length>0?(u=n.getCalcService(),u?(f=u.parse(r,t,i),u.evaluateParsedFormula(n._getSheetSource(),f,t,i)):null):null},r.prototype._isFormula=function(n){return n&&n[0]==="="},r.prototype._trimFormula=function(n){return n===undefined||n===null||n===""?null:n[0]==="="?n.substr(1):n},r.prototype._calculateValue=function(t,i,r,u){var f=null;if(this._isFormula(u))f=this._calculateFormula(t,i,r,this._trimFormula(u.toString()));else try{f=n.spread.Calc.Convert.toDouble(u)}catch(e){f=NaN}return f},r.prototype._getHighestValue=function(n){return this._tryCache(n),this.highestValueCached},r.prototype._getLowestValue=function(n){return this._tryCache(n),this.lowestValueCached},r.prototype._calculatePercent=function(n,t,i,r){var e=this._calculateValue(n,t,i,r),u,f;if(!isNaN(e))if(0<=e&&e<=100){u=this._getLowestValue(n),f=th
is._getHighestValue(n);if(u!==undefined&&u!==null&&f!==undefined&&f!==null)return u+(f-u)*e/100}return null},r.prototype._calculatePercentile=function(t,i,r,u){var e=this._calculateValue(t,i,r,u),h,l,f,c;if(!isNaN(e))if(0<=e&&e<=100){for(h=0,l=this.ranges.length,f=0;f<l;f++){var o=this._createExpression("PERCENTILE",[this.ranges[f],e/100]),s=t.getCalcService(),a=s.unparse(o,i,r);o=s.parse(a,i,r),c=s.evaluateParsedFormula(t._getSheetSource(),o,i,r);try{h+=n.spread.Calc.Convert.toDouble(c)}catch(v){}}return h/this.ranges.length}return null},r.prototype._getActualValue=function(n,i,r,u,f){var e=this.scales[u],s,o;if(e)switch(e.type){case t.ScaleValueType.Formula:return this._calculateValue(n,i,r,e.value);case t.ScaleValueType.HighestValue:return this._getHighestValue(n);case t.ScaleValueType.LowestValue:return this._getLowestValue(n);case t.ScaleValueType.Number:return this._calculateValue(n,i,r,e.value);case t.ScaleValueType.Percent:r
eturn this._calculatePercent(n,i,r,e.value);case t.ScaleValueType.Percentile:return this._calculatePercentile(n,i,r,e.value);case t.ScaleValueType.Automax:return s=this._getHighestValue(n),s<0?0:s;case t.ScaleValueType.Automin:return o=this._getLowestValue(n),o>0?0:o}return null},r.prototype._evaluate2Scale=function(n,t,i){return n<=t?0:n>=i?1:(n-t)/(i-t)},r.prototype.evaluate=function(t,i,r,u){var h;this._tryCache(t);if(this.contains(i,r)){if(u===undefined||u===null)return null;try{var o=n.spread.Calc.Convert.toDouble(u),f=this._getActualValue(t,i,r,0),s=this._getActualValue(t,i,r,1),e=this._getActualValue(t,i,r,2);if(isNaN(s)){if(!isNaN(f)&&!isNaN(e))return f>e?null:this._evaluate2Scale(o,f,e)}else if(!isNaN(f)&&!isNaN(e)&&!isNaN(s))return f>e?null:o<f?0:o>=e?2:(h=this._evaluate2Scale(s,f,e),f>o||o>s?1+this._evaluate2Scale(o,f,e):this._evaluate2Scale(o,f,s))}catch(c){return null}}return null},r.prototype._evaluateColor=function
(n,i,r){if(0<=n&&n<=1){var f=t._Color.parse(i),u=t._Color.parse(r),s=f.a*(1-n)+u.a*n,h=f.r*(1-n)+u.r*n,e=f.g*(1-n)+u.g*n,o=f.b*(1-n)+u.b*n;return new t._Color(parseFloat(s/255),parseInt(h,10),parseInt(e,10),parseInt(o,10)).toString()}return null},r.prototype._createExpression=function(i,r){var e,s,f,u;if(!t.util.hasCalc())return null;var o=n.spread.Calc.Expressions,l=n.spread.Calc.Functions,c=n.spread.Calc.Convert,h=l.findGlobalFunction(i);if(h){for(e=[],s=r.length,f=0;f<s;f++){u=r[f];if(u instanceof o.Expression)e[f]=u;else if(u instanceof t.Range)e[f]=new o.RangeExpression(u.row,u.col,u.row+u.rowCount-1,u.col+u.colCount-1);else if(c.isNumber(u)&&!isNaN(u=c.toDouble(u)))e[f]=new o.DoubleExpression(u,u.toString());else throw n.spread._StringResource.Exp_NotSupport;}return new o.FunctionExpression(h,e)}return null},r.prototype._addRows=function(n,t){i.prototype._addRows.call(this,n,t),this._clearCache()},r.prototype._addColumns=function(n,t){i.prototype._addC
olumns.call(this,n,t),this._clearCache()},r.prototype._removeRows=function(n,t){i.prototype._removeRows.call(this,n,t),this._clearCache()},r.prototype._removeColumns=function(n,t){i.prototype._removeColumns.call(this,n,t),this._clearCache()},r}(e),t.ScaleRule=o,b=function(r){function f(n,t,i,f,e,o){var h=new u(n,t),s=new u(f,e);r.call(this,h,null,s),this.expected[0]=i,this.expected[2]=o}return __extends(f,r),f.prototype.evaluate=function(t,i,r,u){var o,e,f,s;if(u!==undefined&&u!==null){o=NaN;try{n.spread.Calc.Convert.isNumber(u)&&(o=n.spread.Calc.Convert.toDouble(u))}catch(h){return null}if(isNaN(o))return null;e=this._getActualValue(t,i,r,0),f=this._getActualValue(t,i,r,2);if(e!==undefined&&e!==null&&f!==undefined&&f!==null)return s=this._evaluate2Scale(o,e,f),this._evaluateColor(s,this.expected[0],this.expected[2])}return null},f.prototype._init=function(){this.scales=new Array(3),this.scales[0]=new u(t.ScaleValueType.LowestValue,null),this.
scales[2]=new u(t.ScaleValueType.HighestValue,null),this.expected=new Array(3),this.expected[0]=new t._Color(0,255,255,255).toString(),this.expected[2]=new t._Color(255,99,190,123).toString()},f.prototype.reset=function(){this.ranges=null,this.condition=null,this.style=null,this._stopIfTrue=!1,this._priority=1,this._init()},f.prototype.getMinimumType=function(){return this.scales&&this.scales.length===3?this.scales[0].type:null},f.prototype.setMinimumType=function(n){this.scales&&this.scales.length===3&&(this.scales[0].type=n)},f.prototype.getMinimumValue=function(){return this.scales&&this.scales.length===3?this.scales[0].value:null},f.prototype.setMinimumValue=function(n){this.scales&&this.scales.length===3&&(this.scales[0].value=n)},f.prototype.getMinimumColor=function(){return this.expected&&this.expected.length===3?this.expected[0]:null},f.prototype.setMinimumColor=function(n){this.expected&&this.expected.length===
3&&(this.expected[0]=n)},f.prototype.getMaximumType=function(){return this.scales&&this.scales.length===3?this.scales[2].type:null},f.prototype.setMaximumType=function(n){this.scales&&this.scales.length===3&&(this.scales[2].type=n)},f.prototype.getMaximumValue=function(){return this.scales&&this.scales.length===3?this.scales[2].value:null},f.prototype.setMaximumValue=function(n){this.scales&&this.scales.length===3&&(this.scales[2].value=n)},f.prototype.getMaximumColor=function(){return this.expected&&this.expected.length===3?this.expected[2]:null},f.prototype.setMaximumColor=function(n){this.expected&&this.expected.length===3&&(this.expected[2]=n)},f.prototype.toJSON=function(){return{ruleType:i.TwoScaleRule,ranges:this.ranges,minType:this.getMinimumType(),minValue:this.getMinimumValue(),minColor:this.getMinimumColor(),maxType:this.getMaximumType(),maxValue:this.getMaximumValue(),maxColor:this.getMaximum
Color(),priority:this._priority,stopIfTrue:this._stopIfTrue}},f.prototype.fromJSON=function(t){var r,i;if(!t)return;if(t.ranges)for(this.ranges=[],r=0;r<t.ranges.length;r++)i=t.ranges[r],this.ranges.push(new n.spread.Range(i.row,i.col,i.rowCount,i.colCount));t.minType!==null&&t.minType!==undefined&&this.setMinimumType(t.minType),t.minValue!==null&&t.minValue!==undefined&&this.setMinimumValue(t.minValue),t.minColor!==null&&t.minColor!==undefined&&this.setMinimumColor(t.minColor),t.maxType!==null&&t.maxType!==undefined&&this.setMaximumType(t.maxType),t.maxValue!==null&&t.maxValue!==undefined&&this.setMaximumValue(t.maxValue),t.maxColor!==null&&t.maxColor!==undefined&&this.setMaximumColor(t.maxColor),t.priority!==null&&t.priority!==undefined&&(this._priority=t.priority),t.stopIfTrue!==null&&t.priority!==undefined&&(this._stopIfTrue=!1)},f}(o),t.TwoScaleRule
=b,y=function(r){function f(n,t,i,f,e,o,s,h,c){r.call(this,new u(n,t),new u(f,e),new u(s,h)),this._evaluator=null,this.expected[0]=i,this.expected[1]=o,this.expected[2]=c}return __extends(f,r),f.prototype.evaluate=function(t,i,r,u){var f,h;this._evaluator=t;if(u!==undefined&&u!==null){f=NaN;try{n.spread.Calc.Convert.isNumber(u)&&(f=n.spread.Calc.Convert.toDouble(u))}catch(c){return null}if(isNaN(f))return null;var e=this._getActualValue(t,i,r,0),s=this._getActualValue(t,i,r,1),o=this._getActualValue(t,i,r,2);if(e!==undefined&&e!==null&&o!==undefined||o!==null&&s!==undefined&&s!==null)return e>o?null:f<e?this.expected[0]:f>=o?this.expected[2]:e>f||f>s?(h=this._evaluate2Scale(f,s,o),this._evaluateColor(h,this.expected[1],this.expected[2])):(h=this._evaluate2Scale(f,e,s),this._evaluateColor(h,this.expected[0],this.expected[1]))}return null},f.prototype._init=function(){this.scales=new Array(3),this.scales[0]=new u(t.ScaleVa
lueType.LowestValue,null),this.scales[1]=new u(t.ScaleValueType.Percentile,50),this.scales[2]=new u(t.ScaleValueType.HighestValue,null),this.expected=new Array(3),this.expected[0]=new t._Color(255,248,105,107).toString(),this.expected[1]=new t._Color(255,255,235,132).toString(),this.expected[2]=new t._Color(255,99,190,123).toString()},f.prototype.reset=function(){this.ranges=null,this.condition=null,this.style=null,this._init(),this._evaluator=null,this._stopIfTrue=!1,this._priority=1},f.prototype.getMinimumType=function(){return this.scales&&this.scales.length===3?this.scales[0].type:null},f.prototype.setMinimumType=function(n){this.scales&&this.scales.length===3&&(this.scales[0].type=n)},f.prototype.getMinimumValue=function(){return this.scales&&this.scales.length===3?this.scales[0].value:null},f.prototype.setMinimumValue=function(n){this.scales&&this.scales.length===3&&(this.scales[0].value=n)},f.prototype.getMinimumColor=function()
{return this.expected&&this.expected.length===3?this.expected[0]:null},f.prototype.setMinimumColor=function(n){this.expected&&this.expected.length===3&&(this.expected[0]=n)},f.prototype.getMidpointType=function(){return this.scales&&this.scales.length===3?this.scales[1].type:null},f.prototype.setMidpointType=function(n){this.scales&&this.scales.length===3&&(this.scales[1].type=n)},f.prototype.getMidpointValue=function(){if(this.scales&&this.scales.length===3){if(this._evaluator)if(this.scales[1].type===t.ScaleValueType.HighestValue)return this._getHighestValue(this._evaluator);else if(this.scales[1].type===t.ScaleValueType.LowestValue)return this._getLowestValue(this._evaluator);return this.scales[1].value}return null},f.prototype.setMidpointValue=function(n){this.scales&&this.scales.length===3&&(this.scales[1].value=n)},f.prototype.getMidpointColor=function(){return this.expected&&this.expected.length==
=3?this.expected[1]:null},f.prototype.setMidpointColor=function(n){this.expected&&this.expected.length===3&&(this.expected[1]=n)},f.prototype.getMaximumType=function(){return this.scales&&this.scales.length===3?this.scales[2].type:null},f.prototype.setMaximumType=function(n){this.scales&&this.scales.length===3&&(this.scales[2].type=n)},f.prototype.getMaximumValue=function(){return this.scales&&this.scales.length===3?this.scales[2].value:null},f.prototype.setMaximumValue=function(n){this.scales&&this.scales.length===3&&(this.scales[2].value=n)},f.prototype.getMaximumColor=function(){return this.expected&&this.expected.length===3?this.expected[2]:null},f.prototype.setMaximumColor=function(n){this.expected&&this.expected.length===3&&(this.expected[2]=n)},f.prototype.toJSON=function(){return{ruleType:i.ThreeScaleRule,ranges:this.ranges,minType:this.getMinimumType(),minValue:this.getMinimumValue(),min
Color:this.getMinimumColor(),midType:this.getMidpointType(),midValue:this.getMidpointValue(),midColor:this.getMidpointColor(),maxType:this.getMaximumType(),maxValue:this.getMaximumValue(),maxColor:this.getMaximumColor(),priority:this._priority,stopIfTrue:this._stopIfTrue}},f.prototype.fromJSON=function(t){var r,i;if(!t)return;if(t.ranges)for(this.ranges=[],r=0;r<t.ranges.length;r++)i=t.ranges[r],this.ranges.push(new n.spread.Range(i.row,i.col,i.rowCount,i.colCount));t.minType!==null&&t.minType!==undefined&&this.setMinimumType(t.minType),t.minValue!==null&&t.minValue!==undefined&&this.setMinimumValue(t.minValue),t.minColor!==null&&t.minColor!==undefined&&this.setMinimumColor(t.minColor),t.midType!==null&&t.midType!==undefined&&this.setMidpointType(t.midType),t.midValue!==null&&t.midValue!==undefined&&this.setMidpointValue(t.midValue),t.midColor!==null&&t.midColor!==undefined&&this.setMi
dpointColor(t.midColor),t.maxType!==null&&t.maxType!==undefined&&this.setMaximumType(t.maxType),t.maxValue!==null&&t.maxValue!==undefined&&this.setMaximumValue(t.maxValue),t.maxColor!==null&&t.maxColor!==undefined&&this.setMaximumColor(t.maxColor),t.priority!==null&&t.priority!==undefined&&(this._priority=t.priority),t.stopIfTrue!==null&&t.priority!==undefined&&(this._stopIfTrue=!1)},f}(o),t.ThreeScaleRule=y,w=function(r){function f(n,t,i,f,e){var s=new u(n,t),o=new u(i,f);r.call(this,s,null,o),this._init(e)}return __extends(f,r),f.prototype._init=function(n){this._gradient=!0,this._color=n,this._showBorder=!1,this._borderColor="black",this._dataBarDirection=t.BarDirection.LeftToRight,this._negativeFillColor="red",this._useNegativeFillColor=!0,this._negativeBorderColor="black",this._useNegativeBorderColor=!1,this._axisPosition=t.DataBarAxisPosition.Automatic,this._axisColor=
"black",this._showBarOnly=!1},f.prototype.reset=function(){this.ranges=null,this.condition=null,this.style=null,this._init(new t._Color(255,99,142,198).toString()),this._stopIfTrue=!1,this._priority=1,this.scales=[],this.scales[0]=new u(t.ScaleValueType.Automin,null),this.scales[2]=new u(t.ScaleValueType.Automax,null),this.expected=[]},f.prototype._calcuteMinValue=function(n,i,r,u,f){var s=this.scales[u],o=null,e;if(s)if(s.type===t.ScaleValueType.Formula||s.type===t.ScaleValueType.Percentile){for(e=0;e<this.ranges.length;e++)if(this.ranges[e].intersect(i,-1,1,-1)){o=this.ranges[e];break}if(o)return this._getActualValue(n,o.row,o.col,0,f)}else return this._getActualValue(n,i,r,0,f);return null},f.prototype._calcuteMaxValue=function(n,i,r,u,f){var s=this.scales[u],o=null,e;if(s)if(s.type===t.ScaleValueType.Formula||s.type===t.ScaleValueType.Percentile){for(e=0;e<this.ranges.length;e++)if(this.ranges[e].intersect(i,-1,1,-1)){o=this.ranges[e];break}if(o)return this._getA
ctualValue(n,o.row,o.col,2,f)}else return this._getActualValue(n,i,r,2,f);return null},f.prototype._evaluateNoneScale=function(n,t,i,r){return r=0,i===t?n<t?[0,r]:n>i?[1,r]:[.5,r]:n<i?n>t?[(n-t)/(i-t),r]:[0,r]:[1,r]},f.prototype._evaluateMidScale=function(n,t,i,r){var e,f,u;r=.5,e=Math.abs(i-t);if(i>0&&t>=0)return i===t?[.5,r]:n<i?n>t?[Math.abs(n/i)*.5,r]:[t/i*.5,r]:[.5,r];else if(i>0&&t<0)return f=i>Math.abs(t)?.5:i/e,u=i>Math.abs(t)?t/e:-.5,n>0?n<i?[n/i*f,r]:[f,r]:n<0?n>t?[n/t*u,r]:[u,r]:[0,r];else if(i<=0&&t<0)return i===t?[-.5,r]:n<i?n>t?[-n/t*.5,r]:[-.5,r]:[-i/t*.5,r];else if(i===0&&t===0)return[0,r];return r=-1,[-1,r]},f.prototype._evaluateAutoScale=function(n,t,i,r){var u=Math.abs(i-t);if(i>0&&t>=0)return r=0,t===i?n<t?[0,r]:n>i?[1,r]:[.5,r]:n>t?n<i?[(n-t)/u,r]:[1,r]:[0,r];else if(i>0&&t<0)return r=Math.abs(t)/u,n<i?n>t?n===0?[0,r]:[+n/u,r]
:[-r,r]:[1-r,r];else if(i<=0&&t<0)return r=1,i===t?n<t?[-1,r]:n>i?[0,r]:[-.5,r]:n<i?n>t?[(n-i)/u,r]:[-1,r]:[-0,r];else if(i===0&&t===0)return r=.5,n>0?[.5,r]:n<0?[-.5,r]:[0,r];return r=-1,[-1,r]},f.prototype._evaluateScale=function(n,i,r,u){return this._axisPosition===t.DataBarAxisPosition.Automatic?this._evaluateAutoScale(n,i,r,u):this._axisPosition===t.DataBarAxisPosition.CellMidPoint?this._evaluateMidScale(n,i,r,u):this._evaluateNoneScale(n,i,r,u)},f.prototype._paintDataBar=function(n,i,r,u,f,e){var y=new t.Rect(r+2,u+2,f-4,e-4),s=y.x,l=y.y,o=parseInt(Math.abs(y.width*i.scale).toString(),10),h=y.height,v,a,c;if(i.axisLocation===0)i.scale>0||(o=0);else if(i.axisLocation===1)i.scale<0?s=s+y.width-o:o=0;else{var p=parseInt((y.width*i.axisLocation+s).toString(),10)+.5,w=y.y,nt=1,it=e-1;for(n.lineWidth=nt,n.strokeStyle=i.axisColor,n.beginPath(),v=0;v<=it;v+=2)i.direction===t.BarDirection.RightToLeft?(n.moveTo(2*r+f-p,w+v),n.lineTo(2*r+f
-p,w+v+1)):(n.moveTo(p,w+v),n.lineTo(p,w+v+1));n.stroke(),i.scale>0?s=p+nt:i.scale<0?s=p-o:o=0}i.showBorder&&(s=parseInt(s.toString(),10)+.5,o-=1,l+=.5,h-=1);if(o>=0&&h>=0){a=i.fillColor;if(i.isGradient){c=.9,a=i.direction===t.BarDirection.RightToLeft?n.createLinearGradient(2*r+f-s-o,l,2*r+f-s,l+h):n.createLinearGradient(s,l,s+o,l+h);var b=t._Color.parse(i.fillColor),g=new t._Color(b.a,parseInt((255*c+b.r*(1-c)).toString(),10),parseInt((255*c+b.g*(1-c)).toString(),10),parseInt((255*c+b.b*(1-c)).toString(),10)).toString(),k=i.scale<0?1-c:c,d=i.fillColor,tt=i.scale<0?1:0;i.direction===t.BarDirection.RightToLeft?(a.addColorStop(k,d),a.addColorStop(tt,g)):(a.addColorStop(k,g),a.addColorStop(tt,d))}n.fillStyle=a,i.direction===t.BarDirection.RightToLeft?n.fillRect(2*r+f-s-o,l,o,h):n.fillRect(s,l,o,h),i.showBorder&&o>0&&h>0&&(n.strokeStyle=i.borderColor,i.direction===t.BarDirection.RightToLeft?n.strokeRect(2*r+f-s-o,l,o,h):n.s
trokeRect(s,l,o,h))}},f.prototype.evaluate=function(i,r,u,f){var c=f,s,e,o,y,l,h,p,a,v;if(c!==null&&c!==undefined){s=NaN;try{n.spread.Calc.Convert.isNumber(c)&&(s=n.spread.Calc.Convert.toDouble(c))}catch(w){return null}if(isNaN(s))return null;e=this._calcuteMinValue(i,r,u,0,f),o=this._calcuteMaxValue(i,r,u,2,f),e instanceof Date&&(e=new t._DateTimeHelper(e).toOADate()),o instanceof Date&&(o=new t._DateTimeHelper(o).toOADate());if(e!==null&&e!==undefined&&o!==null&&o!==undefined)return e>o&&(y=o,o=e,e=y),h=this._evaluateScale(s,e,o,l),!h||h.length<2?null:(p=h[0],l=h[1],a=s<0&&this._useNegativeFillColor?this._negativeFillColor:this._color,v=s<0&&this._useNegativeBorderColor?this._negativeBorderColor:this._borderColor,{fillColor:a,borderColor:v,showBorder:this._showBorder,axisColor:this._axisColor,isGradient:this._gradient,direction:this._dataBarDirection,axisLocation:l,scale:p,showBarOnly:this.
_showBarOnly})}return null},f.prototype.minimumType=function(n){return arguments.length===0?this.scales&&this.scales.length===3?this.scales[0].type:null:(this.scales&&this.scales.length===3&&(this.scales[0].type=n),this)},f.prototype.minimumValue=function(n){return arguments.length===0?this.scales&&this.scales.length===3?this.scales[0].value:null:(this.scales&&this.scales.length===3&&(this.scales[0].value=n),this)},f.prototype.maximumType=function(n){return arguments.length===0?this.scales&&this.scales.length===3?this.scales[2].type:null:(this.scales&&this.scales.length===3&&(this.scales[2].type=n),this)},f.prototype.maximumValue=function(n){return arguments.length===0?this.scales&&this.scales.length===3?this.scales[2].value:null:(this.scales&&this.scales.length===3&&(this.scales[2].value=n),this)},f.prototype.gradient=function(n){return arguments.length===0?this._gradient:(this._gradient
=n,this)},f.prototype.color=function(n){return arguments.length===0?this._color:(this._color=n,this)},f.prototype.showBorder=function(n){return arguments.length===0?this._showBorder:(this._showBorder=n,this)},f.prototype.borderColor=function(n){return arguments.length===0?this._borderColor:(this._borderColor=n,this)},f.prototype.dataBarDirection=function(n){return arguments.length===0?this._dataBarDirection:(this._dataBarDirection=n,this)},f.prototype.negativeFillColor=function(n){return arguments.length===0?this._negativeFillColor:(this._negativeFillColor=n,this)},f.prototype.useNegativeFillColor=function(n){return arguments.length===0?this._useNegativeFillColor:(this._useNegativeFillColor=n,this)},f.prototype.negativeBorderColor=function(n){return arguments.length===0?this._negativeBorderColor:(this._negativeBorderColor=n,this)},f.prototype.useNegativeBorderColor=function(n){return arguments.length===0?this._useNegativeBorderColor:(this._useNegativeBorderColor=n,this)},f.prototype
.axisPosition=function(n){return arguments.length===0?this._axisPosition:(this._axisPosition=n,this)},f.prototype.axisColor=function(n){return arguments.length===0?this._axisColor:(this._axisColor=n,this)},f.prototype.showBarOnly=function(n){return arguments.length===0?this._showBarOnly:(this._showBarOnly=n,this)},f.prototype.toJSON=function(){return{ruleType:i.DataBarRule,ranges:this.ranges,minType:this.minimumType(),minValue:this.minimumValue(),maxType:this.maximumType(),maxValue:this.maximumValue(),gradient:this.gradient(),color:this.color(),showBorder:this.showBorder(),borderColor:this.borderColor(),dataBarDirection:this.dataBarDirection(),negativeFillColor:this.negativeFillColor(),useNegativeFillColor:this.useNegativeFillColor(),negativeBorderColor:this.negativeBorderColor(),useNegativeBorderColor:this.useNegativeBorderColor(),axisPosition:this.axisPosition(),axisColor:this.axisColor(),showBarOnly:this.showBarOnly(),priority:this._priority,stopIfTrue:this._stopIfTrue}},f.protot
ype.fromJSON=function(t){var r,i;if(!t)return;if(t.ranges)for(this.ranges=[],r=0;r<t.ranges.length;r++)i=t.ranges[r],this.ranges.push(new n.spread.Range(i.row,i.col,i.rowCount,i.colCount));t.minType!==null&&t.minType!==undefined&&this.minimumType(t.minType),t.minValue!==null&&t.minValue!==undefined&&this.minimumValue(t.minValue),t.maxType!==null&&t.maxType!==undefined&&this.maximumType(t.maxType),t.maxValue!==null&&t.maxValue!==undefined&&this.maximumValue(t.maxValue),t.gradient!==null&&t.gradient!==undefined&&this.gradient(t.gradient),t.color!==null&&t.color!==undefined&&this.color(t.color),t.showBorder!==null&&t.showBorder!==undefined&&this.showBorder(t.showBorder),t.borderColor!==null&&t.borderColor!==undefined&&this.borderColor(t.borderColor),t.dataBarDirection!==null&&t.dataBarDirection!==undefined&&this.dataBarDirection(t.dataBarDir
ection),t.negativeFillColor!==null&&t.negativeFillColor!==undefined&&this.negativeFillColor(t.negativeFillColor),t.useNegativeFillColor!==null&&t.useNegativeFillColor!==undefined&&this.useNegativeFillColor(t.useNegativeFillColor),t.negativeBorderColor!==null&&t.negativeBorderColor!==undefined&&this.negativeBorderColor(t.negativeBorderColor),t.useNegativeBorderColor!==null&&t.useNegativeBorderColor!==undefined&&this.useNegativeBorderColor(t.useNegativeBorderColor),t.axisPosition!==null&&t.axisPosition!==undefined&&this.axisPosition(t.axisPosition),t.axisColor!==null&&t.axisColor!==undefined&&this.axisColor(t.axisColor),t.showBarOnly!==null&&t.showBarOnly!==undefined&&this.showBarOnly(t.showBarOnly),t.priority!==null&&t.priority!==undefined&&(this._priority=t.priority),t.stopIfTrue!==null&&t.priority!==undefined&&(this._stopIfTrue=!1)},f}(o),t
.DataBarRule=w,f=function(){function n(n,t,i){this.isGreaterThanOrEqualTo=n,this.iconValueType=t,this.iconValue=i}return n}(),t.IconCriterion=f,nt=function(r){function u(n){r.call(this,null,null,null),this._init(n)}return __extends(u,r),u.prototype._initIconSetType=function(n){this._iconSetType=n,this._iconSetType<t.IconSetType.ThreeArrowsColored||this._iconSetType>t.IconSetType.ThreeSymbolsUncircled?this._iconSetType<t.IconSetType.FourArrowsColored||this._iconSetType>t.IconSetType.FourTrafficLights?this._iconSetType<t.IconSetType.FiveArrowsColored||this._iconSetType>t.IconSetType.FiveBoxes?this._iconSetType>t.IconSetType.FiveBoxes&&(this._iconCriteria=[]):(this._iconCriteria=new Array(4),this._iconCriteria[0]=new f(!0,t.IconValueType.Percent,20),this._iconCriteria[1]=new f(!0,t.IconValueType.Percent,40),this._iconCriteria[2]=new f(!0,t.IconValueType.Percent,60),this._iconCriteria[3]=new f(!0,t.IconValueType.Percent,80)):(this._iconCriteria=new Array(3),
this._iconCriteria[0]=new f(!0,t.IconValueType.Percent,25),this._iconCriteria[1]=new f(!0,t.IconValueType.Percent,50),this._iconCriteria[2]=new f(!0,t.IconValueType.Percent,75)):(this._iconCriteria=new Array(2),this._iconCriteria[0]=new f(!0,t.IconValueType.Percent,33),this._iconCriteria[1]=new f(!0,t.IconValueType.Percent,67))},u.prototype._init=function(n){this._showIconOnly=!1,this._reverseIconOrder=!1,this._initIconSetType(n)},u.prototype._modifyIconIndex=function(n){var t=this._iconCriteria.length+1;return this._reverseIconOrder&&t>2?t-1-n:n},u.prototype._getActualValue=function(n,i,r,u){var f=this._iconCriteria[u];if(f)switch(f.iconValueType){case t.IconValueType.Formula:return this._calculateValue(n,i,r,f.iconValue);case t.IconValueType.Number:return this._calculateValue(n,i,r,f.iconValue);case t.IconValueType.Percent:return this._calculatePercent(n,i,r,f.iconValue);case t.IconValueType.Percentile:return this._calculatePercentile(n,i,r,f.iconValue)}return null},u.p
rototype._paintIconSet=function(n,i,r,f,e,o,s,h){var v=r+1,y=f+2,a=16,l=16,c;i.showIconOnly&&(s.hAlign==t.HorizontalAlign.center?v=r+e/2-a/2:s.hAlign==t.HorizontalAlign.right&&(v=r+e-a-2)),s.vAlign==t.VerticalAlign.center?y=f+o/2-l/2:s.vAlign==t.VerticalAlign.bottom&&(y=f+o-l-2),c=u.getIcon(i.iconSetType,i.iconIndex);try{c&&h&&($.type(c)==="string"?h.getState(c)?n.drawImage(h.getImage(c),v,y,a,l):h.addImage(c):h.getState(c.image)?n.drawImage(h.getImage(c.image),c.x,c.y,c.w,c.h,v,y,a,l):h.addImage(c.image))}catch(p){}},u.prototype.evaluate=function(i,r,u,f){var l=f,o,c,a,e,s,h;if(l===null||l===undefined)return null;o=NaN;try{n.spread.Calc.Convert.isNumber(l)&&(o=n.spread.Calc.Convert.toDouble(l))}catch(v){return null}if(isNaN(o))return null;c=0,this._iconSetType<t.IconSetType.ThreeArrowsColored||this._iconSetType>t.IconSetType.ThreeSymbolsUncircled?this._iconSetType<t.IconSetType.FourArrowsColored||this._iconSetType&g
t;t.IconSetType.FourTrafficLights?this._iconSetType<t.IconSetType.FiveArrowsColored||this._iconSetType>t.IconSetType.FiveBoxes||(c=5):c=4:c=3;if(!this._iconCriteria)return 0;for(a=Number.MAX_VALUE,e=c-1;e>0;e--)if(e<this._iconCriteria.length+1){s=this._iconCriteria[e-1];if(s&&s.iconValue!==null&&s.iconValue!==undefined){h=this._getActualValue(i,r,u,e-1);if(h!==null&&h!==undefined){if(s.isGreaterThanOrEqualTo){if(o<a&&o>=h)return{iconSetType:this._iconSetType,iconIndex:this._modifyIconIndex(e),showIconOnly:this._showIconOnly}}else if(o<a&&o>h)return{iconSetType:this._iconSetType,iconIndex:this._modifyIconIndex(e),showIconOnly:this._showIconOnly}}else return{iconSetType:this._iconSetType,iconIndex:this._modifyIconIndex(0),showIconOnly:this._showIconOnly}}else return{iconSetType:this._iconSetType,iconIndex:this._modifyIconIndex(0),showIconOnly:this._showIconOnly}}else return{iconSetType:this._iconSetType,iconIndex:this._mo
difyIconIndex(0),showIconOnly:this._showIconOnly};return{iconSetType:this._iconSetType,iconIndex:this._modifyIconIndex(0),showIconOnly:this._showIconOnly}},u.prototype.reset=function(){this.ranges=null,this.condition=null,this.style=null,this._showIconOnly=!1,this._reverseIconOrder=!1,this._iconSetType=t.IconSetType.ThreeArrowsColored,this._iconCriteria=null,this._stopIfTrue=!1,this._priority=1,this.scales=[],this.expected=[]},u.prototype.iconSetType=function(n){return arguments.length===0?this._iconSetType:(this._initIconSetType(n),this)},u.prototype.reverseIconOrder=function(n){return arguments.length===0?this._reverseIconOrder:(this._reverseIconOrder=n,this)},u.prototype.showIconOnly=function(n){return arguments.length===0?this._showIconOnly:(this._showIconOnly=n,this)},u.prototype.iconCriteria=function(){return this._iconCriteria},u.prototype.toJSON=function(){return{ruleType:i.IconSetRule,ranges:this.ranges,iconSetType:this.iconSetType(),iconCriteria:this.iconCriteria(),showIco
nOnly:this.showIconOnly(),reverseIconOrder:this.reverseIconOrder(),priority:this._priority,stopIfTrue:this._stopIfTrue}},u.prototype.fromJSON=function(t){var r,e,i,u;if(!t)return;if(t.ranges)for(this.ranges=[],i=0;i<t.ranges.length;i++)r=t.ranges[i],this.ranges.push(new n.spread.Range(r.row,r.col,r.rowCount,r.colCount));t.iconSetType!==null&&t.iconSetType!==undefined&&this._initIconSetType(t.iconSetType);if(t.iconCriteria!==null&&t.iconCriteria!==undefined)for(e=t.iconCriteria.length,i=0;i<e;i++)u=t.iconCriteria[i],this._iconCriteria[i]=new f(u.isGreaterThanOrEqualTo,u.iconValueType,u.iconValue);t.showIconOnly!==null&&t.showIconOnly!==undefined&&this.showIconOnly(t.showIconOnly),t.reverseIconOrder!==null&&t.reverseIconOrder!==undefined&&this.reverseIconOrder(t.reverseIconOrder),t.priority!==null&&t.priority!==undefined&&(this._priority=t.priority),t.stopIfTrue!==null&&t.priority!==undefined&&am
p;(this._stopIfTrue=!1)},u._getImageSrc=function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAQgCAYAAADvxtzfAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAANyVJREFUeF7tfQl8TFf7/6CvVsXaIkqrtVZqKxq0SCyxxxpr0ailtUYoYilCrLWEqC0h9i2xJyKSEJSiUcQWW4tGFRFEJJlkMs//+Z577yzJzGQm+v5/fd93ns/n+7nnnvN8v2e59z5z7ty5Z1R/u7m4uDR1dXWlFi1aDJOzrDeFfPv2bbJZxJCswGqRnOSYmJg8RZjjgTKxk5MMREVHmRVRyDoBzmhnKBIVFU2RR45QRMThXCIKWckTArCcIhERERQeFk4HDhwwEgFu3bqVnksAllPkwP4DtHfvXgoNDdHlGSKXACynSEhIKO3YsYO2bt1KGzdtovXB6ykwMNC8ACynCMibNm2k4PUSefXq1ZYFYIYiIK8PDtaRf/zxR6sEdOeG0myFvDxguWUBQzKgI69cSQHLA8jff5l5Ac50MSRbQi6Bnj17FkKmLZCpdjM0UwNlCTJNb3wO6C7XvGBSAKaIKJctAswRjg+HDh2i/fv3U4h8dZoVgBm2JDIyksLDw2nf3n20a9cu2rJlS94CiD6KQNjBg7R3zx7auWMnbd68mdavW2dZwJAM7N4dStu3b6dNGzdSUFAQreRrwqxATnJoaCht27aNNmzYQGsD1/LVuJKWLfM3LZCTrPQ3eH2wLs8QRgI5yTu4v5u4v+vk/ioEQx+dQE6y0t9A7q+hMx+ZdoaxQidgSNb1d60UOA3JwplNEdEJGKoCa9asMUtWjPNF4JF3c4tYIiuGACQnJTMUyYts1hSRfJHt9k+xlLUuHi8DmxPj5KMVLg5ytnUmyEEuROnXKWXN57aJGJIVvFjlbJ1I
TrL2N2+9yIp6JkVeBroEpaxuLF1MLwObGZEF7ozR5T33/8RIhNPBzxZUpBcrG0oCogVrmuhFmKy9PZLxjV5kcVUhAnLy/Aoi78WKuvrLGSIpqz7Ti4B8czDRjYG6vGcLP6Dk+e+R9uWldOw/X1ZTLwCDyIuAunqRmwOIEvqQ9noPXZ4hnnGrZKreIPLcv6bOSXutO9E1d6LLbYniWxBdakp00VkS+KFSbgEYRJ4trqIXudKWtPEtZXIjogv1RX7yvPKmBWBChEdaCMhkrSB/StrztUX+U793zQukrnWplzy/vNQKmaxFzb8y+bzUxaezipsWkMjvSWQANf/KZNQcx+Rfqon8pJlvmxjEda4uuprzwJPphXMLvPixPr0IqMNnX01xmDDSyQsqUPLcMpQ8uxQ99S1GSTOKUNL3henJ1ILmx+B/2XCN4zLFlYaLRTeQfNbhxMGxx+HDETA5iAgUyhmYF3AkZJqxKde8ctlKAWYUaW8N5cubr9BrHpIAH06ZktskEelsVMhaJmuv9SDt1Q4iH+eE7G5sCF2IPgggQkCuWcs1a68wGZc15+PEkil6U8gIYXASAmg2ggpqBvliY0mAz06ZJpmOzEFUT+5vVLOWydrz9SQBPsVlqp6MMK4jJ3Czr/OAgSznGUIXkXRk/iBRCkWzMdoGZBxewytVFxNBxkeZUpBztCXnKoQoZRgrcMUqAsZkbrbos5wHR5CFM5sSrXDZiwwUGn20GZAR5g3JiiHwIHbIu7lFAHzQmCKbNUMRfNTZRFZMiPCHbb7Idvs3WIl1Dh4l1xWNKx74tu0zd5BLrCt675vY4VR8zduJxVfYIGJIXnEhiLAttvytxLcXWyGSk9zuWCedSNEfCie+PfdN8yKG5ICLgdQ6pr2AGwP7yH9r1r8S35xhQsSIfGkNuUS65cLyS2uFSOFpbyS+6VNIL2JIXh6/mh1X0zJGk3BXhovYIh95KIPfG98VSizkLYvwoaISgYw1R
an4yrep2yl38o9fSZ/u/5zqy/C/vFLkF570Bv1rfCF6w7sgFRptZn7gsPQtWnplBTmFNqRPQj8jp92f8X4AFfZ5wzQhpxX94S1acnUZVdlRl6pur8Ooy/vL0WzrBN6e9yYtvuZP72+uSe9vceKtEy25tpQKjbVySlNkdmFalLCEym2oRuWCq1FZBvYLjbJS4K0ZhemHG4uoVNBHVHrdR2K7iPcLDi9gnUDhqW+wwA9UfO0HOmC/wDfWCkwqRAtvLsyFAkNV1gn8i0cbA4bjjGYX+JYB8mArBexm+TtF2cWywdHwyxgFNgsoDyuAfAlERUXRkagjdOSI9LTDZoGIQ4cE8E1mvgQOHDwgnnAoTzlsFti9e7cO+RLAk40d2yWYFTD3hTwImzdtok2MzZs26wRyQogoX3+dOXNGOCrAl5HrghgGX0oC8IM/eEIAllNk9epVtGr1avFgQoFZsmI5RQJWBFBAwAqxzZOsWE6Rpf7SN7hWkRXLKWITWTFDEZvJiiki+SLbTW/KIPI1U1jOss0g8FoiIBueCzaLgJjzbDQSQWZegIBZEUMHSwiUHxfkElEETp0+TcdPnKDomGg6FBEhPU8KCRHPWzdsCGaBtbRq5apcIiYEYsQz5/0HJIFtEBDPWyGwklYEGMcGvcApFjgutUAIyC2AQHDwBrkF0uMhky3IC6bGQDeIeUERyUW2xhSBfJFhIOWbDAMx32TYa5FhfLYZPwqym3WGyxQjn68jYEi2+QTKSbbpFDZFxjzRKhFTZMwNxRyRY4NFEVNkZW6o4CDPF82K5CQryDlHVJBLBDs5AUdpfrjdaI6YE9z63NcJCkDYvFmaH27irSIgu1g2RSAIc8R1QQL5Eli9ynh+aLOANEeUkC8B/6VLeY64lPzleaLNAosXL9YhXwI5YZOAOcgudrPGHgz7ksxBdrFsfwzuQ3TnTi5YLXB3YHdByAoJ1QH797/ubZ3A7T7ukgDHgqxtOyhz23ax/3
v/btYJ3OjRRhAyN26izA0SsH+zZ3vrBK65uwqCek0QqXlupF4TKPavd25pncDldl8IQsayFZSxPIC3AWL/cvum1glccmssCOkLf6CMBYsYP4h95Msuervi4uRw+YtamguNaz6EA4DDBUKa72xK9/VjzBb7yD/a+BOBsHJvvTzw7hsJQuSScw0PEFOjDgtHBWlTpgm8mjzNKD9x5TIKr+5Ie0v+q7YQgJ2p/ZHHL80+pZeRh4TTq/ETGBNlID1B5P+hI6v0ZMVO1HD0+Mm5JqVEhEsio8cKpDIE+Ud/82TFoj8o7QGnF4cOClLq8FHG5KIWyIodciwiRJ6HH7C+5py2r3Qhj32lCj2+7jPW+ppz2u4SKtESm2q2W25LXd+SHk1W5f+p18v1LpQS+HlWvkVeBjWjjMshlBL0Rf5EXq7l4JJ+XRIJNCHy1NeBnvqVpuR5ZSl5QUV6trgyPfevQS8CalPKygaCqDx/NCmSNLOIzsESxMNr3uYSefJ9YcnpXCXpxxnna5MWP1S55CI98cUDazyHxaPzO3xl5hRJmvaGTkAbV50F6pD2gjNp4zkyX20vfkYjHiFD4PYo3U+NhMjqxq9USVMLGrfgV24BC9AlV+nhrWELWEDfgqaaRz6qdqonU1SSQB4wGoPVzhJZjAELPJlSgJ5wV5Kmv0U4KniqnzwXR6WCICgiSD//sZ6ebI09W/i+jvzMv6ZtZBiecAvyDx/aTobhNwZP5znmjwxL9itF+SbbLf9WhOHJCGHEyUAaeSizaM6MhOrVq1OvXr1o2rRpAkgjD2Wyj0nzKlKkiGb8+PEUGxsrgFtfQNlHGXzgK1H05la0aFENfk4NR/zIecWKFTRr1iyazViwYIH4pTTK4ANfcCSqZPFo6rFjx2jVqlXk5+dHM2fOpKnTptKECRPIy8uLxo4dS/Pnzxc+8AVHoqpUTcuXLy/U8TPjuXPnSuSpEnnMmDE0bNgw6t9/APXt00c8a4AvOOB
CwAeDBOUlS5aQr69vDvJQGsDkHh49qEP79uTNLYEvOOBCwB9NxA/b0cRpCnm0XPOA/tSjh0Ru4eJCLfjeCb7ggAsBPzhitOfNm0cTDZo9QCF3aM83XS7UyNmZGtSvL3xRzlxfCAxu3bq1aNaiRYtYmclDQeZmi5o76Mh1atchV24FfMFhLk4uVRk+LGp80YABQtNRs4eoGWRXHbkGn0w4nPAFB1wIwPxdZGUMZN++fUWfDcnVq1UjrzFewge+4EhUyUow4keMGCEOEe7cO7u7i2a6NGsmtkv5Xhpl8IGvzDGyCoyzzlwjfrcOZ4z2zp07RBp5KIMP4wMQTBmutnGMRFw87twKQL6QEhkTZB+rzInRUQbSdrPWFi9eXISvd89Jk3xCvL2940aOHBk3ePDQkP79+3t6eHhYPgIcSJynT5+e4OMzmcaNG0cjR42kIUOGiOuiZ8+e1KlTp4Q2bdqYjokcvryYrPGZ7CPIo0aOoiFDh/DlPIB6MblzZ3dya+NGzZo11TRs1Mg4JnIQcZv+/XTNZF3NTBY19+eae4mTqY2bGzVv3ozPxs/42qit+bjqx/qYyDXHKzWP5JqHDuEoJDe7c+fO1IZrbt68uUSuw1dljepUqVIlKSbOmDGjqb7Zxn1GzW5t2lAzQearEuTqNejDDz8kR46JpUqVaqqaxMNtasBwNbq5tdHXXLeuiAcgI6C+88475ODg4KPiQ+U/Stdng5q5z81En6Waq9eoQZU+rCTIpd8pTcWKFaO33nrLX8XXtx9GW0/uLJqtG7A6XLMgKzXryFSoUCFfFdc8WN9sJivN/oxrrss1iz5LNb9T+h09+Q3xuxxP1aBBg8p49PJQS2RltA0GrJJM5j4r5DcKCbI+Jrp3cvfHoVJGu658qKQBc6TSBjXLZEAfEznmleAzLP4zpWbus+Fo68hSs4HcMbFx48YV6tSpfdbwUJWWyW++9aZhzeZjYsWKFYvwGTbO0dEx0XjAxC+h
bIuJfJI4FS5cuCMfKntMtMYmz91J5mBNuXA4dvpWLigOeZXbBWQHc7Cm/PXNlLICa8rz7GNe5XYB2cEcrCm3299hpkZXgTXleR7nvMrtArKDOVhT/jdYrRAyCzZTNSsQfDj2mH4tFwwFLI6BXYANjubABkdzEHy7/Q1manQVWFOe53HOq9wuIDuYgzXlf4OZugoVWFOOhKV4kGe5XUByMAtryu32d5ip0VXAZuoqVCD4cLR0nOFoMR7YBdjgaA5scDQHwX99M1WzAmvKkbA0BnmW2wUkB7Owptxuf4eZGl0F1pQjYfE451VuF5AczMKa8tc3U8oKrClHwmIf8yq3C0gOZmFNud3+Zjt9+nSRY8eOecbExIQciYqKi4w8EhcRERESFhHhuXPnTstPuaKPH3eOPno0AW+W4YcaypKoeCHk4MGDtP/AgYQ9e/aYfu58NDbWK+boUY1EjiaumSIOH6bwcJDDQKa9e/fhnQ4Nt8T4uXNsbKwbyGKhxegoOnwkUiIfCqeDYUyWl0XFCyF4VW3Hjh2abdu26Z87Mzle1CzIR+iwIHPNOrKoWZCxhiJ+TrF161bpuTMPWFOFHKnUjGYb1byHdoWE6slbtopfBW3cuLGpKioqxicqWu4zD1juPu+hkF1M3rmLtm8zIlNwcLCPKjIqyl+MtqiZ+wzy/v26mrGi684du2ib1GzxasrGDZtow/pg/PDFXxUZGemnb/ZB8SuXfQYDJmqWm70JZFHzBrGOZNDaIF8VH+PBumYb9Fki6waMm72FyZvEao7r162ndYFBtHbtWk8IlOGa1YK8T+rzLh15h9xnJotmo2YmBzF5zVo1d0F67sxkf5M1K2RpwGTyOvGm4drVa/XPnXft2lUiNDQ0XiyBC/I2ueZNClmqOShQR45fs2aN8XNnrrXC9h07zhoN2IaN4u1Kw5qZeJZh+rkzixTZunnrOD5UiQp5nb7mRK55An4lIrtbNh4gp6CgoI7AulXr7
M+d/27rues1Xpr0vPyNl2f8tydHXBlh29qKMJAHXf6WAJtFvrw01Kv/xcHU/+IQgQEXB6cNuDhM/4Zdz7hhuX5nppjHuYFeveIGUK+4gRJ+Gaj2OP+V/tezXX7qWa/z6d6P3X/uLX5rZ2idT/X24jJS4H6qt9r9dB89uc3Jrg3cjnV+6hbbhdyOd9a4He+iE2kd29mrzfEupID31a2OuRv/brdptJvHF0faaJpFtSWgKdKRbT2bH2nrpc9jRLVRM0z/6LfBIRePBuHNNQ3DXahhmCuDt5xuoKTDXNT1w1zxYw7z5rTP2eOTvY00tfY2ptr7GhO2tXjLaXWtfc6WyYpV3VnPo3rop5rqIQ2oemh9qhZaX11tZ33ryIp9tK22x0fba2s+3F5H/eG22p3lbNvso511nSvvcjL7E0K7/Q+Yt6pIMa9insXGFAtx8CoWByCNPJTJXqatuHdxZ4cxxRNqza9N3bd7kPfx8QJIIw9l8JHdjY1r8Xp3QhnN8KhRtP0pz0oYwY830XqGso8y+MBXpklWfExxt7ITy2mW3lwuHBf+sUQEzl7nB1C3c33I41x/Gn9lMv2YuJZmXp5DZSeV04Aj01F78Xg0dWvSDvru1mT68tIg6vkrk8/2oU6ne5BzREuqtK0WtQh3p+o7G1Dbg10IHEF2GOPQ9KMZlUXN3170ovanulObE12o5bFOIo2Y8P7WT2jiuen0KiuNttzZSZ2P9iFwwGWB4j4YpLm3fxCO3572piGnRtOH22tTlZ31RI377oeTYuF/HCH3o73FwIKrcvAq7j/s8Lc08+Yc6n98mHBKzXpFLbm5bSO6093U+yIvMzuTZp6fLyppF92DwAEXo+/31YFBLDBXFEb/FSsIf6U/ogxNhkgnvnpAnSJ7i/JK3LK1f64ncJjrizEY3CrQjbY93Un1DjQVTb6ZclsQYUf/PEGf7GpMH/AgglxrdxMx2OCIk8thtEOZMhPKqoMSg2nitWlUZd
en9Pn+tvQo/QnNvbhEV+tH2+uK9NBzowm+4IArHQnui+uaFkK5+09fCkKNnQ1FrR/tqMsDWofJtajlYXfa8mQ7wVf0X7FSk0qVwHH9OnyIOJxjLk2gzw66UtWQ+ixQh2qGNqaRv44XZfCBLzgyXbIi3kUqOIwpdrZxwOcUcGelcF71IIgRKNLIQxl8So0pZSbgSlfiOK4hERdPx42dBJBGHpdNyPOKVIwHyKnY2GIdAaTlbLtZZf+9MXHmrTmiDD7wtSkmunGIc4lpT/3ODKYt7ANfcATZMCbOubeQ+jG5F5O7MrkjyMc7k8vRDvR5ZGsx8cKFBt9cMREBZciVEdRTNLuvnhzTgZqAfMiF6h74nBqHu3FLd+aOiesfb5T6jJpP9RCR2RU1H0HNrlSHyTX3NKJqfInjCs0VEzHaSs0go89odgNB/oLJzlR1V336kOOD2ZjYk0fb7YTc7CNu3Gwm72fybj3ZYkycnDBDrpnJXHNdJjtxzdWYbHVM7HtmkFSz3Gz02eaY6H3Zh5zDWthj4v+YubpPoGETlmORyeGMh2KxSQl7VF+rashu5g0C7JzIzhHFllegxodb0ldXh1KdjQ2J8+5xmTPDjRHLOCnT9CYLnCwZ+CEBjQ+3EgIuh9sgX80icSh3+rGW8JNpesst0JI8IRDBAtwCXAvdfulL7aM6WyvQShI43FYS2JYfgWtDpC4Igdq2CshdkAUqWdsChyXlQYjg9HDeXqi+8hMjAbdD7S0IsCMXXuWtp6qnqpBqkMqF02c572GFoBrUYEsjkB9yHt6iMDYICJGcNlhVlQlxjBjGbyxq+qo0K2BoPVXm14qzSsCS/ZcIfDthZf4F7KZS4d01oE+fPjR0kCd9NbCfeMer35cDqFcfvkPr0ZO6dOlGHTq0o1ZuralzJ3fhD+gE/P2XC3zJpJ4e3cm9Uwdq2bIlOTdqQnXq1KLKH1Wn9xzLU/GSJfDKMhVQFdQL9O3dh5Yt9ceODu+
3rET1vBqS88zPqYanE5Wq9Y5ROdDFvSu2KtWQrwfTgC/7i8wi775NLX5sS/1+5aneuYHU9ee+1OEkT3tiu1DV4TWpwBtijWUB+X1Xleqrr74Sr+Uis9Wa9jTg1yH0zeUxNCLem/qeG0Rtj3cjV572fMEzl/cHVJYFClJz12aSAAasU6dOVLlzNep3fhCNuvIdBf21kXYl76ZZt+dTh+M9xLSnMd+Ef3HIjRxqFKeCqgLk6iIL9OvXj1q1akVNFrhQ73Nf0XfXp9Ke5wfoYEoEreRb/k7He9JnPGdyPtSCWh11pxoTa4tW6LrQu3dvaty4MTVf05q6nO5Nnue/pSX3Aijo4UYad3kKNYtsLyZcEMFY1JrbgFQFVOTq2lwSQP9r165N9b535v52FU4dTvSkTid6UdPIdnxL/AV9sreR6EL7E93ooxHVjbvQpUsXqlKlCpVtXp5aHO0ovsFsFNGKGhxsTvW45tr7moh5cqujnVigO735/tviPGjuKncB7zU7OjqKfjVc+QU1j24nRrwJi+BDphkLolXuP/WkGt+L/xsQwHuA4OPVPCpeXPw1ChUuWZg+W9mM2vGhAzqc7E6dfvKgtrFdqco4Jx0Z0B1GnJI4PZUCoIyrI33i14BqL/mMPvL6mN6qaFwOuHcxuBYKFCjA/VKJbSHZAfsYbeSJrZyvwOhiUoBjC7g2x7aFvG0mRhyvcKPM0F8I2O1vNu3p00U0EZGe2WHhIZr9++M0obvjMnfsDFFv2eKpzeu5szY62jn78JGE7PBDpNl/gDS795Bm5y7K2rKNsjZsoMy1gQmZq1aZvnfWHIn20hyO1GSHHaJshbxDIW9kchBlrlxNGcuWazIWLTG+d86KjnYTZK5ZIu+lLJmcCXJgEKmZrF4WQBmLl1D6vAWadN85+ntnJsdLzT5ImtAcNTM5c+UqHTlj/kJK95tLaTNmSvfOdCiqqQY17zNutlIzmq1etlxHzvCbQ+kzZlLa1O8p
bdKkpipN2CEfZcCy5AHLDEaf13GzpZrVi5YyeQFlzAbZl9IFeTKljZvko+I++wuyqHkrZYGsq5nJSrMFmWue9j2lT5pCad9NpFRvb39VVsheP+OaMWByzYJsULMgc81MfuU9nl6NGeurUm/fOdi4ZkOyUrOv1GcfmTyWyV5jKXXUKE8Vn11l1MEb1FLN8qFCn+fxgBn0OV0hSzVT6sjR6pTRo6V7Z/Xadf6i2csxYPJoz56rr1lp9thxgvxq1BiufbT+3pnWrCmR4b88XjpUC/g465stDdgErhlkb0FmxCcPy/Fs7tXixRXS5y08q/RZd6i45jRudppS88gxZ9PGjDF976xdvLhI2gzfcelTpyXqmi1qxoCNTuRBm6D19rbu3jll/Hin1LHjO6aOGtuRB8t+75xPQ+jC3xEDpsOYGRtWvXr1F127dqXvvvtOAGnkoUxyMW2Ob7/99hEsZRAWFiaWLYmPjxdAGnkogw98JYqBFStW7CgWHo2OjqbHjx/L3+3rDXkogw98ZZrOhqGpR48epczMTJmS21AGEfgyZ7hEVamK8PTmGZqYlJQku5q3J0+eiO6Aw1zxEL8pBun06dOyS952/PhxMbDMbQIBz2+//ZYuX74sF+dtFy9eJHDAFQKYK1+9elUuztsuXbpE4CgCTTF1wXK31hq6K69uKrpQhI9tMv4qITU1VXYxbykpKeJvFcBhru6XEMO/+OILoZydnS275jaNRkM//fQTwRcciaq3GCym8fPPP5tsCfJAhg98JYqxYV2c2AYNGtD69euFM44McPLkSbHsD8rgI/uaNVwwT6tWrUrt2rUTQBp5cpnVlu/L2W56+4fEROwjjOU7JnKRAM5C/MTM5pjIZTpgdRKI2BQTudwIn376qW0xUSEaAkuhWR0TFZIhsPSZPSbaY6LdrDd7TJSNy3T4X42JCskQWF/R6piokAyxcOFC62OiQlKARbjwI3CrYyKX6VC4cGGxvqJNMZHzB
bD0F8g2x0QsuIg/MLDHxP9Us8dE2bhMh//2mCivEWsVTMbE2bNn53I0B5MxEXEOUUdxMgeLMRHKb0gLDZqEVTERi/OaaolNMTEwMFA4Ix7aY+J/uv0fx0SELqRtjokIWfIZZwSrYiJOV8Q93jeJPGNi3bp1c5FywmxMxKWsOOUFkzFRXvrZKthjoj0m2u1vsNdejQVE4/VgbDSbBeCoQNm3WcCQ8B8ggAIFyr7NApYIOfdzWV6EnPsiQ4Eph7z2bSbk3P9vEVCQn3275cNeexBBNDqMtprNAnBUoOzbLGDxTMzL/v8LoECBsm+zgCVCzv1clhch577xei9seRFy7guBMTsfvp7A4FV3X0/AcI2bvAg594VAu5EXXk9ABzYUKLBm3275sNceRBCND6ONZrMAHBUo+zYLWD4T87D/AwET14bNAl67rA8wuY2JIzcn2iAARwXy/rC192wTMIyJ2H619I5tAoYxEds+c27YJmC07hdvu025apuAYUzEtpP3JdsEdDCxD0cFpvbtlg977UEE0fgw2mi2C5g4L2wWsBQf8jYmjtr65+sJjNhoPsDkNjgqkPeHBd63TcCwz9h+veJ32wQMYyK2A5bctiCAAgXyvmFMxLbvvJuWBSzFRGx7zrxuWcBSTMS26+QrlgUsxURsO38Xb1nAUkzEtqOX+RgpHHSwYh9EBaLcbvmwHINquzFxjOHFZrMxcfR2fYDJ2+CoQN4fufmBbQI548O3wX/YJmAYE7EdGmhwuedp7GgYE7H9eqXB1ZvLUKBA3jeMidgO9DeIF7mMCyzFRGy/XHjLsoClmIitUcARCQXyvqWYiK3HDH2IExm2xERsjSIWErbERGy7TLhsLGBLTMS20ziDfSRsiYnYth9z0VhAh/zs2y23na6oKnKshMozpqQq5GhJVRyANPJQJruZtujiKmcmJPzyeW26NWYo/bUmQABp5KEMPrK7sXGh1/H3imoeLJ1P9McfEn77TYK8jz
L4wFemScaqbicqFtO8OhkrHLWXL1P2kSjSHJBfmGNknz0ryuADX3BkukoVU0IVj6bS/fukPfUzZR+SX08MZfL2HZS1cTNlBq2jLN6ne/dEt8AR5GOlVE1Pf/K+1MwLF0m8JLhvP2WFhJJm23Ymb5LeLvxxJWX4+5Mm8ojwBQdcVUwplQ8Gie7/wc0+IsiakBAmyy8Irg2kzB9/pIwl/pSxYCGpeYuWggMumu//x8LZRHd+o+y9+0izK0R6NTF4A6nXBJJ6BZMX4+XAhZQxy4/Sv59B2uvXCRxwIeB3d6YPC9yRyVspcz3IaykzYIUgp+P9Ppmc5jOFtDduEDjM9VUdLaEafLVfV9GsrF2hlLUumDJXryH18hXSW3bzFlC672xKmzZdvJ6Hd97gCw5OLtUJB1WZ4xWKqTOv8KE7cZLUq1YzeTllLFpMGXPnCXL6VCZPmkyvxk+gTD4S8AUHXHEk0JfLvTqKQ5S1Yyepf1gkkWfOkt7tm8jkcd/xUVhGdPcuwVf0X7GoUqoSnBF/f850cYiy+FCpecTTpk5jsg/3fTpl7T8oyuADX3BkumTRpVUV+BQ9e7GTK6WfOS2ctdeuCSCNPJTBh8mm3+3D1caDOo6RiIsnYciXAuJC4jyueUKeV6Ri3CInrq0jgLScbbd/q/3ernXju1066c8uE/ZbB7fm97p2WCTv6g3k5G++yUr1Hk/3unUKkrONDORnI0ZohE/XjivkbMn+GtD/Ac51wJSIQlZ8UsaM1d5s16KKXKxSYefpkMFppkRykl96jaXf3duMF0RDyykC3O/RJcwqsmKmRKwmKyZEhg7NMCSnjh1nHRkm+jx8RLahAGDu6BjZ7U6tWxn2WbyabK1ITjL6fLdLh7k5x8SkiCmy0mdTA5tLxPBEMjXaEEka/PUrxSfXiXSrTZv32SHV0qFSRED+vVO7EXK23iDyW8f2Q+VdkwaR253aDJJ37fZvs3/WPFGbkCCg7Fs9T8w6HEn
pPKXBdAZAOisqSpRZnifevSf9yjkzkzJ4aqcIZPJEk7RaqYx9zM4Ts3hymXVMWpAVBIgIsmyZmD+yD3xNzBPvU/qcuaLGrJM/SQylVjaQRXfYx+Q8UXvtuq7JQPZvv8tUoqwzZ43K4JtrnojRVhwMmy1M7o5OwNw8EWsf5OqzQXcgAh+z88SssHBdv5U+AzqR7GwxiObniXyIsniyaUg2FEEZfPKeJx4My30iHYoQZTbOE68LIG2fJ/7HWlh1x3bh1R0pvEZZ4whkjSnkRzu2kM0iCvnZsWjS3rxF6Rd+tV5EISfHHn2Qfeq0uIPNPn/eOhHDmjUnTgiyAiHy63nzIjry0SjKijlKmbgB3cq3v1hsBneyjOxz51gkLreIjhxzRIR0NW62Bdbxjfc6g/0g0vBlnR73i15kl0pVCDs3p06g7MtXxL2hBL75NIKSt4y0t27RX6sChIhowaGqjk7YeRC0WoT1ND++6dRhrgwpreGBTYo+cgr+aLkQgCki2VeuUtaRKEqbPJVeTeYbT94qQPOf7dktajYiK6aI3AsOvJEVESktYwN4jSNN7Al6tnuXebJiiojmwgXKCj9EqcNHUVZ0DD3btSNvsmK6MeGByk64YbrPeZkicmPUMOtrzmmKSL7IdnsNwwpFtHy5Z/aixSGaOfPjNLNmx2mmfB+i/m6SZ54rE2mXr3LW+i9P0P6wmLLnzScmU9bU7ylr4iTK5NNZ/c3IhMzBg03PE7UBP3plL12myTYkT2PyBB8me5P62xGU8fUQSu83QJPRvbdxRNIGBLgJ8iImz51P2b6zSWNEHklqiUxpHr3pVacumpdt2uvnidn+y+KVmkHOmjadMtHsMTJ5EJO/HEDpTE5z70av2nSgV64t5bXC/P2b6sjcbMOaM9FsJmd8OZDSe3DN7l1lcit6+XkzSmnQqKlKs3CRj+gzasaACTIPGNeskNMMyKlMTv28Ob1s0JhS6jTwUXGf/QVZ1IzR1jdb
1CyarZBbM7kZvWzI5LoN6PnHdfxVWb6z/dBnHXn4CKnP/bhmXZ/bU6pLa3rZBM0GuT6l1KxDL6rV9FVppk4fbDTag4ZKA8bNTuskDZhCFs3mml9IZHpRuZqnSjt5chn1aG915nCpzzhU6R69mMzNbis3uwn3Gc2uo5Cd6NmH1dQpjlXltcK+HeEvnSRKs+U+o2b9gFGKE5OrOtHzytXp+QdVDNYKGzasRFrfAfEYMP1oy2S5ZqnPTP5IkOOTK1fOsVaYh0eFNPcuZ41qVsioWfS5Oj37oMpZJptZK6yxR5GXrq3G8YAlpih9lslcc+KzDypPuF+xonXzxJR69ZxefFy344tqH3dM+aCqfZ6Yl2Fh3hHjA+hQdcfh4dUcH+LTSEK5PRE13rNunW12TgyvVi7i6eQpRHvDKDtkH931HID8ewerlXMOr1rWLax6udiwauVMr/CMAnyUqxcsIS0LaFngGV+hLKpmxKH86uCBwk+m6c1IYCEEwvUC3IKMOQtIG7qfkpcvz1sgQwgYtMBWAakFLBDKAhxYbW8Bj4EYRBZ4PmFiDoEAywJ/9uuLQYsQh7N6uQtXunUUAmpZ4PEPP5gXgCMfpqvs4InJJ89OXPhcOIvzInmiD/0xBUfE8SGXW7/O9uEqZapKh9Axhsm/YcojFxmbOQFD2+XkZF9n25KBbF9n+zVNWaX3n7XOdtcmTWj+V560YfQYmty1GzWW3vM0gsl1th1LlaLDfn6kwaPjA/spa9cuysST36B1tLCHBxUuVEgnYHKd7WhM92KiKPvCz5R98QxpIsNJjWew0oq2NLNdB1nAxDrbX7VuTVlhHM5+OUXaZ78TpdwnzaWfKXPDBkHGA9xXywKo/vvvm15neycH0ax9+yn7zAnSJv9O2hf3SPPrKb5/DqR0noxmLFoi7qUDBwwUrci1znYs912sLbt/L2lOHyPNmVjKDN1JGTzA6XPnUQaLZK4Ppv0jRppeZzuYZ2p4VC76v
I7v2teulcnzKW32HHHjnblxMy3p3sP0OtvdGjTk0V4vDRju1LlG1JzGN91ovhplLFDt3XfFeWByne1Ib54nL1/BNfPtPh6ZM7CPp+H4EmLLQPGmtYDJdbZLvv02hQz9htSr1kgLEgdLRHXwRgrgpsNHgcV1tjt+Uou2ff01RfGZuLpnL6pRpoxROWBfZ/t/w0aMGOEAyLu225gxY/wAedc28/b2rjBx4sRUAGk523obPXp00L59+whAWs62zry8vOpNnTpV8+DBAwKQRp5cbNrYoQb3tx9jIeMq/uP62rVrAkgjTy7rB1+ZJpo6nTNfzpkzRywuhb9oPn/+PD18+FCs1AMgjTyUwQe+4ICLwSrCiZNYFAFrAiUkJNCZM2fFGkEghB8Kp5ijMSIPZfCBLzjgilYM4/tGzriA/3S+e/cuhXNoxz8t79u7T2zxT9Ph4WGiDD5cexw4gqwYC5RhJGCNixs3boh/WDYE8lAGH/jKNGPjgnZYOOH27du0afNm8QfJmzdvElvkYSEF+MjuuW3UqFGeG/hTCAsrhYaG0sWLF8QaukjHx18ilMFHds9t3DdfnDh//vkn/fbbb2KwAKSRhzL4yO65jQs3YZBQE4/wS95fDCCNPHkAN8nuuY37d5LxlDGdSaXlbBzq0siTy3JP9xVj9X6WLl+UwUfetZs19mhGmdeLiU9nl8p/TEzyK10heWHF/MfEp34lg9JjvPIXE5/5laiXvKSqRpsUZX1MfDLrnRpP55TslzS75MKns0tezfh5BtFfG/OOiUyYzs19+Xx1fUrd04vST/Bc8fpqouRo0v7uk3dMvL+4YpEkv5InX4V5Ej0/wbVuIO29WaS9PYq0NwZaFxOT55cqkTS71IW0qJFET0JJe60Laa+4CVgdE1PmOJThriSkH59A9DCQtL/WJPrVybaYyCdOu5QNLtyNYKIzJUl7tpRtMTHJr4Rn6t4+RPf9iM7XILo307aY+NSvlC9OHkqOpO
w/9xMG1qaYyAKbMJBoxdN5777ko2NbTMThTPIr9RTnxvMZxW2PiTgTcQnLu7nMHhPzYRhQS4OapyEmAvKubabERABpOdt6U2IigLScbZ0ZxkQAaeTJxabNXEwEkEaeKGMf+Mq0vGMigDTyUAYf+IIDrumYeF8fEwXujBZxEmXwgS844IpW5IqJV5WY2EZsCVuOkyiDD1/2ceAIsmI5YyLiofZ8TYYTpzk+ch7K4ANfmWZs+pi4nojjIZ0xAMfJlI0teDBL2RYTBX7lNOehDD6ye24zFRMBpJEnnVSlbIuJANLIkwfQ9piINPJEGfvI2bktr5iIMvjIu3b7/2IVvSsWKfM6QbXspHKxZSeWixP/qmmrlZ1Ytt8XK5oSUGaiY6418iwamv3BtEoPVt8LpDX3g+j97yslc3d0Z2aeVnai47zB4UMp8NF6CnoUTEiXm1hupVxs2cpPKv/BJ/NqZW5+tI3GJ/jQuIRJtPnxNnKaV0tT5rv3LEdmWLmJjlu/PzeDZt+ZT1/+8jX1Y/jdWUDIKzfJEQtQmrcyk8o3bbG2Fa3jUO5+oje1j+1O7WJ7UNeTfWjD4y3UdGVzdKWj7J7D+FA5Ti5/cdmtFfTV2W+oUXhLRisdhsaNpkXXl5LjpPK3nGaYeFyCQ9V9hwctuLOEPg51phohn8ngdOhnVDO0ES29t4LgU25SOR+ZJhkOUeUZVZLXPdhALQ93Fv/lbApto3oQfCrPqJxaekpF/QcuDlHv0L7ib5jx/9U//L7MJIIebhA+Hjt78Vg4bpXpOO7lrr43pQI1XPqZVYAvH5GHMl26aMr7lG9gC17rIrPbv8OOOZVxCPu4fANbsNPwZwR4khnh9D791NHFKsAXT0dluvhx39Yr3/H05s4d4tsz8W6fKfCNo/C55jMWz171EepgtYoVohpWT828eIHwF3xZm7dSpsAWgSwFBw8SfNg3+bBTjhjJTfK57D2ctHyXhpfi1KvXUMaqNeJbfgV
avv2FD54KyzS94ZlqeI3yt15EHaas0N2UsXARpctAOnP7Tko9fozCP37vIp4KyzRj4351PNOzI0/prlH67LmUNm0GpeF1vFmzxRj80r87116+qexu2nhAjzzavpkyQ3ZLr6F4f0eZu0IJeRhs2c28hVV7r94xlwaa7GtXKU38PnEaIX2sxWeZByqXN/M/7zkMh+j2vJmUffIn8WtRpPlcmScX5204RJF1KydnxJ2j9HNn6HCdyg9wtsrF1hkO1c892hMQXrWs7RMr8etRPHevXg5ryObP0Gyji8ZudvtnW9IcB6cns0o0sAWPZhSvKpFnlViZNLsE5QuzSszju/biJ8Wd6sMfbYI2cS0EwvjuvXhs1vnBRNf7MwbI25xQ8rEdQFpG5s8DuRXF9/PtbvHeT2aXOM1NirMFaPljv2JmJp12s9v/ud33VhV5NKWg55MpBUKeTCkYJ6FACPJQJruZtqQpKufHUwomPFtRh1IPDKaMX5YKII08lMFHdje2x9MKej2Z6aBJPzWHKP22hFdXGDy9k/dRBh/4yjTJkiYXcnviW0KjSYySnF8ck677xHlE92cyfIme7hNl8IEvODJdpeJ+xqOplH6T6MkOogeLmYw36KYT3Z3Ak8vRRLeGSGJpN0S3wBHkR1NVTZN/+ECq+VkkkxcR/YF3174n+h1knsHe4oCT0JcIX8j9yS1jX3DAVT2ZWtAHg0Tpt6Rm/+FHdG8ak79j8giim4OY3Ifoameiy2687SpaCg643PwC/uknuGmv4pk8m5s8lei38US3hzPZk0NYLya5M7kV0cUviH5tQJTyM4EDLreggF9aDDcVAnenMHksk7/hSfdXTO7J5I5E8S2Z/DmT6xOd/4To5S8EDgv4qh5PLTg4ZTv3DV24x7XfGsZkBE8PoisdmNyCyY2Z/ClRnBOnG/FA3iRwcHKp/pysKsMfFGpt8nkivkOnGxx9r3VncnsmuxJdALke0S81ic5V4Up42su+
4IArjgT6krKFa+NDRPgS9kpbokvNmcy1/VqHawa5Mgtzq9ISCL6i/4olT1KVwHFNi+Uu4HDiUF1uw/0FuQaLNOTzgg8vl8EHvuDIdMn4HK/A43H2xXpX0jyMlYR4tCnltEgjD2XwYbLpOTOuNnYYx0jExfNyd18BcSFxHtc8Ic8rUrGkySqnx1MKdQSQlrPtZoul7Clc8+Xmt/oDSMvZ1ltaWMG9GdEqyohREdJytvWWduhfezOO/osApOVs6y09oujejNiipGYgLWdbb+mRpfeqT7xD6hOlCWk523pLi3IMzDxVgQCk5WzrLf3oR7Mzf67Ks7GqhLScbb1lnq71TdYvdSjrXB1CWs623rLON+qcdb4xZcUxOC1nW2+Z8a4umostKfNc82yk5ez/JEuPVg3JiFKdAZCWs603Jt0U1wIDaTnbenvtFtjtNewfNk/kmYiAvG/9PPGv9ZQa60ipx0oLpJ/iicXDtaLM8jyRJw90x0tMa1KOvEmkzSSt+k96dexdniN8xpMuniuyj/l54p8rpDlRvIskIJYsSGOBd1iAZ2fnearzx0Lha2KeyLPUaz14auMipjeSgJYo6wULlJbmSedrcxnPm3iSlXue+PKcTG4m5oMpUUWYryFtxp88reEugIwnwHEfm5knYrQxsbrYlNGEXkY7cPPVpH2VwM5lmczzQ8zUfqlubp7IXbjCM1ImY3b26mhJrvkd3hanjJOO0kwtjsmY9pmdJz7wl6d2DSn9eBk+CEmU/fw0qU++xzXzbO1cNZ6Ez7E0T+TDiEPFU9r04+9S9st40vy1gwW4BSBf50m3VfPEB0tJfbqKIKpPlqOsM1x74hJRlo95IoPT9nniP97wMtDICQH0dKbD8Ke+Dg8ZJDCz6J4ns4pZ924fkxOTfB0iNBEF+UaLrw2OSuqYjsR595JmFHdO8i3qljSzaCxvTb9VhgI6oSIBIRBM2Ze+hoCaxeNQ/mqPu/CTaXozKxAvBO7RW
Y5Y92ZS1qXp1grw3Sl34fUEHrGA1IV7dC6/LVAEzlayTiDrYCEQInA4eXshLfQLWUBqQWbcJEsCDvee+ha9mjSrmCftUhVK9nVw4f2zOC80RyvwtN8D58bDpzOLWf9uH743xSFkYgyfA78lzXDI/7t9NENlf7fPkoFsf7fvNU15M+if9W5ftzZVaOGkJrRpoStNHV6HmtR716gcMP1uX5miFLmRJ1t3xktTvhs8XxDf5PWgxRM+ocL/KqgTMPlu39GtHiJ40KNgxmZOT+eJRW9p+nO5Hc0ZrbxlaOLdPs8ePA+6PZZnpat5JnKV5wW3iB5v5Rb047ljGwHN5W7UwKm46Xf7QgLciG6NkCacaVdYgCdejzdx83tKU0BuASUMpLUzpT9NzfVu38ltPE/C14B3vCWRh2u4RWO45tY8e+PZGb6gu/E17VnW0PS7fZsWfC7Vhhkrvg7Et3rx+CKSyRd4rnylk5iELfSuavrdvh5tKrITvvrEV4FMxKxVnvbRRe7C9b6kTRhE1T+QzgOT7/Zd2MPNvcIfbVc6Sn1G8zGAmOLdHEqhS+oJP8Dku31lS79JcaFMuDGI4SmNCW+1CV/Txjm1dWTA4rt9vdqWp7CVjejnbU1p24K6VLtaUaNywP5un92sskczVI4WP9bzssdTC2wV94b5MdyVPp1fnp4tc3qFuxk523rju5O4jLhllHkrhO9WCuT9+xNDezK5YL/nq52JMn4XSNneVbpPtsZ44Bxwf5R1ew9pf/MWyH5yhu8Ti1+SXSzb4ykF5qFG1Ky9PYIxXKRfRXoRWia7mTbczj3h2Tlq1HIgMULKVXq6oMJDtFB2z20YrLSYSVLtHFC117rJWw6unIdBRQtld2MTX0Qs/ojo1U3SXm4tQPJWSvNnBos8W90o85GPSnpwrxj1VBXiE+ZCxnn+LGAnPMnRcijXIiIbprks6244Pfn+X+EyVTI+5sN0hy2uFtF5BfjSgSHy5DT7vNzdj7
tSSHpsLg7btDcSoSwErAAGmSfld8R1In1rpXxjlQemFozlgV6jwOyXUtabSvX/AOf1iiJEERHsAAAAAElFTkSuQmCC"},u.getIcon=function(n,t){var f=[["0,160,16,16","0,180,16,16","0,80,16,16",null,null],["0,100,16,16","0,120,16,16","0,140,16,16",null,null],["0,900,16,16","0,920,16,16","0,880,16,16",null,null],["0,820,16,16","0,840,16,16","0,860,16,16",null,null],["0,780,16,16","0,1000,16,16","0,420,16,16",null,null],["0,680,16,16","0,940,16,16","0,400,16,16",null,null],["0,800,16,16","0,1020,16,16","0,440,16,16",null,null],["0,740,16,16","0,1040,16,16","0,400,16,16",null,null],["0,720,16,16","0,980,16,16","0,380,16,16",null,null],["0,700,16,16","0,960,16,16","0,360,16,16",null,null],["0,160,16,16",&
quot;0,40,16,16","0,60,16,16","0,80,16,16",null],["0,100,16,16","0,0,16,16","0,20,16,16","0,140,16,16",null],["0,220,16,16","0,340,16,16","0,460,16,16","0,760,16,16",null],["0,600,16,16","0,620,16,16","0,640,16,16","0,660,16,16",null],["0,200,16,16","0,680,16,16","0,940,16,16","0,400,16,16",null],["0,160,16,16","0,40,16,16","0,180,16,16","0,60,16,16","0,80,16,16"],["0,100,16,16","0,0,16,16","0,120,16,16","0,20,16,16","0,140,16,16"],["0,580,16,16","0,600,16,16","0,620,16,16","0,640,16,16","0,660,16,16"],["0,480,16,16","0,500,16,16","0,520,16,16","0,540,16,16","0,560,16,16"],["0,240,16,16","0
,260,16,16","0,280,16,16","0,300,16,16","0,320,16,16"]],e=u._getImageSrc(),r=f[n][t],i;return r?(i=r.split(","),{image:e,x:i[0],y:i[1],w:i[2],h:i[3]}):null},u}(o),t.IconSetRule=nt,st=function(){function n(n,t){this.ignoreBlank=!1,this.expected=n,this.formula=typeof t=="string"?$.trim(t).replace("=",""):t}return n.prototype._concatArray=function(n,t){var i,r;if(t.length===1){i=t[0];if(i instanceof Array)for(r=0;r<i.length;r++)n.push(i[r]);else n.push(i)}else for(r=0;r<t.length;r++)i=t[r],i instanceof Array?i.length>0&&n.push(i[0]):n.push(i)},n.prototype.getValidList=function(n,i,r){var e=[],s,c,h,l,o,f,u;if(this.formula&&this.formula.length>0)s=this.getExpected(n,i,r),s instanceof Array?this._concatArray(e,s):e.push(s);else if(this.expected&&this.expected.length>0){c=this.expected,h=c.split(",");if(h)for(l=new t.GeneralFormatter,o=0;o<h.length;o++){f=h[o];if(
f===undefined||f===null||f==="")continue;u=$.trim(f);if(u!==undefined&&u!==null&&u!=="")try{e.push(l.Parse(u))}catch(a){e.push(u)}}}return e},n.prototype._equals=function(n,t){return n instanceof Date&&t instanceof Date?n.valueOf()===t.valueOf():n===t},n.prototype.evaluate=function(n,t,i,r){var f,e,u;if(r===undefined||r===null||r==="")return this.ignoreBlank===!0;f=this.getValidList(n,t,i);if(f)for(e=0;e<f.length;e++){u=f[e];if((u===undefined||u===null)&&(r===undefined||r===null))return!0;else if(u!==undefined&&u!==null&&this._equals(u,r))return!0}return!1},n.prototype.getExpected=function(n,i,r){var c,s,u,f,o,h,l,e;if(this.formula){o=[],h=n.getCalcService();if(!h)return this.expected;l=h.parse(this.formula,i,r),e=h.evaluateParsedFormula(n._getSheetSource(),l,i,r,!0);if(e instanceof t.Calc.Reference)for(c=e.getRowCount(0),s=e.getColumnCount(0),u=0;u<c;u++)for(o[u]=[],f=0;f<s;f++)o[u][f]=e.getValue
(0,u,f);else if(e instanceof t.Calc.Array)for(c=e.getRowCount(),s=e.getColumnCount(),u=0;u<c;u++)for(o[u]=[],f=0;f<s;f++)o[u][f]=e.getValue(u,f);return o}else return this.expected},n.prototype.toJSON=function(){return{expected:this.expected,formula:this.formula,conType:r.AreaCondition,ignoreBlank:this.ignoreBlank}},n.prototype.fromJSON=function(n){if(!n)return;n.expected!==null&&n.expected!==undefined&&(this.expected=n.expected),n.formula!==null&&n.formula!==undefined&&(this.formula=n.formula),n.ignoreBlank!==null&&n.ignoreBlank!==undefined&&(this.ignoreBlank=n.ignoreBlank)},n.fromSource=function(t){return new n(t,null)},n.fromFormula=function(t){return new n("",t)},n}(),t.AreaCondition=st,at=function(){function t(n){this.rules=[],this._ruleTypes=null,this.worksheet=n}return t.prototype.getRule=function(n){return this.rules[n]},t.prototype.count=function(){return this.rules.length},t.prototype._cloneRanges=function(n){f
or(var i=[],r=n.length,t=0;t<r;t++)i.push(this.worksheet._getActualRange(n[t]));return i},t.prototype.addSpecificTextRule=function(n,t,i,r){var u=new it(n,t,i);return u.ranges=r,this.addRule(u)},t.prototype.addCellValueRule=function(n,t,i,r,u){var f=new tt(n,t,i,r);return f.ranges=u,this.addRule(f)},t.prototype.addDateOccurringRule=function(n,t,i){var r=new ot(n,t);return r.ranges=i,this.addRule(r)},t.prototype.addFormulaRule=function(n,t,i){var r=new rt(n,t);return r.ranges=i,this.addRule(r)},t.prototype.addTop10Rule=function(n,t,i,r){var u=new ft(n,t,i);return u.ranges=r,this.addRule(u)},t.prototype.addUniqueRule=function(n,t){var i=new v(n);return i.ranges=t,this.addRule(i)},t.prototype.addDuplicateRule=function(n,t){var i=new p(n);return i.ranges=t,this.addRule(i)},t.prototype.addAverageRule=function(n,t,i){var r=new k(n,t);return r.ranges=i,this.addRule(r)},t.prototype.add3ScaleRule=function(n,t,i,r,u,f,e,o,s,h){var c=new y(n,t,i,r,u,f,e,o,s);return c.ranges=h,this.addRule(c
)},t.prototype.add2ScaleRule=function(n,t,i,r,u,f,e){var o=new b(n,t,i,r,u,f);return o.ranges=e,this.addRule(o)},t.prototype.addDataBarRule=function(n,t,i,r,u,f){var e=new w(n,t,i,r,u);return e.ranges=f,this.addRule(e)},t.prototype.addIconSetRule=function(n,t){var i=new nt(n);return i.ranges=t,this.addRule(i)},t.prototype.addRule=function(t){if(this.worksheet){var i=this;return this.worksheet._bindToAutoRefresh(function(t){if(!t)throw new Error(n.spread._StringResource.Exp_RuleIsNull);for(var r=0;r<i.rules.length;r++)i.rules[r]._priority++;return t._priority=1,t.ranges=i._cloneRanges(t.ranges),i.rules.push(t),t})(t)}},t.prototype.removeRule=function(n){if(this.worksheet){var t=this;this.worksheet._bindToAutoRefresh(function(n){n&&t.rules.remove(n)})(n)}},t.prototype._removeRange=function(t,i,r,u,f){var g,d,tt,nt,w,p,k,b;if(!t.intersect(i,r,u,f))return[t];var o=t.row,v=t.row+t.rowCount-1,e=t.col,y=t.col+t.colCount-1,l=i,s=i+u-1,h=r,c=r+f-1,a=[];return o!==-1&&e!==-
1&&l!==-1&&h!==-1&&(h-e>0&&l-o>0&&(g=new n.spread.Range(o,e,l-o,h-e),a.push(g)),Math.min(c,y)-Math.max(h,e)>=0&&l-o>0&&(d=new n.spread.Range(o,Math.max(h,e),l-o,Math.min(c,y)-Math.max(h,e)+1),a.push(d)),y-c>0&&l-o>0&&(tt=new n.spread.Range(o,c+1,l-o,y-c),a.push(tt)),h-e>0&&Math.min(s,v)-Math.max(l,o)>=0&&(nt=new n.spread.Range(Math.max(l,o),e,Math.min(s,v)-Math.max(l,o)+1,h-e),a.push(nt)),y-c>0&&Math.min(s,v)-Math.max(l,o)>=0&&(w=new n.spread.Range(Math.max(l,o),c+1,Math.min(s,v)-Math.max(l,o)+1,y-c),a.push(w)),h-e>0&&v-s>0&&(p=new n.spread.Range(s+1,e,v-s,h-e),a.push(p)),Math.min(c,y)-Math.max(h,e)>=0&&v-s>0&&(k=new n.spread.Range(s+1,Math.max(h,e),v-s,Math.min(c,y)-Math.max(h,e)+1),a.push(k)),y-c>0&&v-s>0&&(b=new n.spread.Range(s+1,c+1,v-s,y-c),a.push(b))),a.length>0?a:null},t.prot
otype.removeRuleByRange=function(n,t,i,r){if(this.worksheet){var u=this;this.worksheet._bindToAutoRefresh(function(n,t,i,r){var l=[],h,v,f,e,s,y,p,c,o,a;if(u.rules)for(h=0,v=u.rules.length;h<v;h++){f=u.rules[h];if(f&&f.ranges&&f.intersects(n,t,i,r)){for(e=[],s=0,y=f.ranges.length;s<y;s++)p=f.ranges[s],c=u._removeRange(p,n,t,i,r),c&&(e=e.concat(c));e.length>0?f.ranges=e:l.push(f)}}for(o=0,a=l.length;o<a;o++)u.rules.remove(l[o])})(n,t,i,r)}},t.prototype.clearRule=function(){if(this.worksheet){var n=this;this.worksheet._bindToAutoRefresh(function(){n.rules.length=0})()}},t.prototype.getRules=function(n,t){var u=[],r,i;if(this.rules)for(r=0;r<this.rules.length;r++)i=this.rules[r],i&&(arguments.length===0?u.push(i):i.intersects(n,t,1,1)&&u.push(i));return u},t.prototype.containsRule=function(n,t,i){if(n)if(this.rules.contains(n))return n.contains(t,i);return!1},t.prototype._clearNullRefRules=function(){var n,t;if(this.rules)for(n=thi
s.count()-1;n>-1;n--)t=this.rules[n],t.hasNoReference()&&this.removeRule(t)},t.prototype._addRows=function(n,t){var u,i,r;if(this.rules&&this.worksheet)for(u=this.rules.length,i=0;i<u;i++)r=this.rules[i],r&&r._addRows(n,t)},t.prototype._addColumns=function(n,t){var u,i,r;if(this.rules&&this.worksheet)for(u=this.rules.length,i=0;i<u;i++)r=this.rules[i],r&&r._addColumns(n,t)},t.prototype._removeRows=function(n,t){var u,i,r;if(this.rules&&this.worksheet)for(u=this.rules.length,i=0;i<u;i++)r=this.rules[i],r&&r._removeRows(n,t)},t.prototype._removeColumns=function(n,t){var u,i,r;if(this.rules&&this.worksheet)for(u=this.rules.length,i=0;i<u;i++)r=this.rules[i],r&&r._removeColumns(n,t)},t.prototype._clearCache=function(){var n,t;if(this.rules!=null)for(n=0;n<this.rules.length;n++)t=this.rules[n],t instanceof o&&t._clearCache()},t.prototype.toJSON=function(){for(var i=[],t,n=0;n<this.rules.l
ength;n++)t=this.rules[n],i.push(t?t.toJSON():null);return{rules:i}},t.prototype.fromJSON=function(n){var r,i,t,f,u;if(!n)return;if(n.rules)for(this.rules=[],r=0;r<n.rules.length;r++)i=n.rules[r],t=null,i&&(f=this._getRuleTypes(),u=f[i.ruleType],u&&(t=new u,t.fromJSON(i))),t&&this.rules.push(t)},t.prototype._getRuleTypes=function(){if(!this._ruleTypes){var n={};n[i.ConditionRuleBase]=e,n[i.CellValueRule]=tt,n[i.SpecificTextRule]=it,n[i.FormulaRule]=rt,n[i.DateOccurringRule]=ot,n[i.Top10Rule]=ft,n[i.UniqueRule]=v,n[i.DuplicateRule]=p,n[i.AverageRule]=k,n[i.ScaleRule]=o,n[i.TwoScaleRule]=b,n[i.ThreeScaleRule]=y,n[i.DataBarRule]=w,n[i.IconSetRule]=nt,this._ruleTypes=n}return this._ruleTypes},t}(),t.ConditionalFormats=at})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(n){function r(n){if(n===undefined||n===null)return 0;else if(typeof n=="number")return n;else if(typeof n=="string"){var t=pars
eFloat(n);if(!isNaN(t))if(t.toString()===n.toString())return t}return null}function i(n){if(n instanceof Date)return n;else if(typeof n=="string")return new Date(n);return null}n.feature("dataValidator",["core.common","conditionalFormat"]);var t=function(){function t(t){this.condition=null,this.type=n.CriteriaType.AnyValue,this.errorStyle=n.ErrorStyle.Stop,this.ignoreBlank=!0,this.inCellDropdown=!0,this.showInputMessage=!0,this.showErrorMessage=!0,this.inputTitle="",this.errorTitle="",this.inputMessage="",this.errorMessage="",this.comparisonOperator=null,this._init(),this.condition=t,this.condition&&(this.condition.ignoreBlank=this.ignoreBlank),this.type=n.CriteriaType.Custom}return t.prototype.IgnoreBlank=function(n){return arguments.length>0?(this.ignoreBlank=n,this.condition&&(this.condition.ignoreBlank=n),this):this.ignoreBlank},t.prototype._init=function(){this.errorStyle=n.ErrorS
tyle.Stop,this.ignoreBlank=!0,this.inCellDropdown=!0,this.showInputMessage=!0,this.showErrorMessage=!0,this.inputTitle="",this.errorTitle="",this.inputMessage="",this.errorMessage="",this.comparisonOperator=n.ComparisonOperator.Between},t.prototype.value1=function(){var n=this.condition&&this.condition.item1?this.condition.item1:this.condition;return n?n.formula&&n.formula.length>0?"="+n.formula.toString().toUpperCase():n.expected:null},t.prototype.value2=function(){var n=this.condition&&this.condition.item2?this.condition.item2:this.condition;return n?n.formula&&n.formula.length>0?"="+n.formula.toString().toUpperCase():n.expected:null},t.prototype.isValid=function(t,u,f,e){if(this.condition){this.IgnoreBlank(this.ignoreBlank);if(this.condition.ignoreBlank&&(e===undefined||e===null||e===""))return!0;var s=e,o;if(e!==undefined&&e!==null)switch(this.type){case n.
CriteriaType.AnyValue:return!0;case n.CriteriaType.DecimalValues:case n.CriteriaType.WholeNumber:o=r(e),o!==undefined&&o!==null&&(s=o);break;case n.CriteriaType.Date:case n.CriteriaType.Time:o=i(e),o!==undefined&&o!==null&&(s=o);break;case n.CriteriaType.Custom:case n.CriteriaType.List:case n.CriteriaType.TextLength:break}return this.condition.evaluate(t,u,f,s,s)}return!0},t.prototype.reset=function(){this._init(),this.type=n.CriteriaType.Custom,this.condition=null},t.prototype.getValidList=function(t,i,r){return this.condition!=null&&this.type===n.CriteriaType.List&&this.condition instanceof n.AreaCondition?this.condition.getValidList(t,i,r):null},t.prototype.toJSON=function(){return{errorStyle:this.errorStyle,ignoreBlank:this.ignoreBlank,inCellDropdown:this.inCellDropdown,showInputMessage:this.showInputMessage,showErrorMessage:this.showErrorMessage,inputTitle:this.inputTitle,errorTitle:this.errorTitle,inputMessage:this.inputMessage,e
rrorMessage:this.errorMessage,comparisonOperator:this.comparisonOperator,type:this.type,condition:this.condition}},t.prototype.fromJSON=function(n){if(!n)return;if(n.condition!==null&&n.condition!==undefined){var t=null,r=this._getConditionTypes(),i=r[n.condition.conType];i&&(t=new i,t.fromJSON(n.condition)),this.condition=t}n.type!==null&&n.type!==undefined&&(this.type=n.type),n.comparisonOperator!==null&&n.comparisonOperator!==undefined&&(this.comparisonOperator=n.comparisonOperator),n.errorStyle!==null&&n.errorStyle!==undefined&&(this.errorStyle=n.errorStyle),n.ignoreBlank!==null&&n.ignoreBlank!==undefined&&(this.ignoreBlank=n.ignoreBlank),n.inCellDropdown!==null&&n.inCellDropdown!==undefined&&(this.inCellDropdown=n.inCellDropdown),n.showInputMessage!==null&&n.showInputMessage!==undefined&&(this.showInputMessage=n.showInputMessage),n.showErrorMessage!==null&&n.s
howErrorMessage!==undefined&&(this.showErrorMessage=n.showErrorMessage),n.inputTitle!==null&&n.inputTitle!==undefined&&(this.inputTitle=n.inputTitle),n.errorTitle!==null&&n.errorTitle!==undefined&&(this.errorTitle=n.errorTitle),n.inputMessage!==null&&n.inputMessage!==undefined&&(this.inputMessage=n.inputMessage),n.errorMessage!==null&&n.errorMessage!==undefined&&(this.errorMessage=n.errorMessage)},t.prototype._getConditionTypes=function(){if(!this._dict){var t={};t[n.ConditionType.RelationCondition]=n.RelationCondition,t[n.ConditionType.NumberCondition]=n.NumberCondition,t[n.ConditionType.TextCondition]=n.TextCondition,t[n.ConditionType.ColorCondition]=n.ColorCondition,t[n.ConditionType.FormulaCondition]=n.FormulaCondition,t[n.ConditionType.DateCondition]=n.DateCondition,t[n.ConditionType.DateExCondition]=n.DateExCondition,t[n.ConditionType.TextLengthCondition]=n.TextLengthCondition,t[n.ConditionType.Top10Condit
ion]=n.Top10Condition,t[n.ConditionType.UniqueCondition]=n.UniqueCondition,t[n.ConditionType.AverageCondition]=n.AverageCondition,t[n.ConditionType.CellValueCondition]=n.CellValueCondition,t[n.ConditionType.AreaCondition]=n.AreaCondition,this._dict=t}return this._dict},t.isFormula=function(n){return n&&n[0]==="="},t.createNumberValidator=function(i,r,u,f){var h=t.isFormula(r)?r.replace("=",""):null,c=t.isFormula(r)?null:r,w=t.isFormula(u)?u.replace("=",""):null,y=t.isFormula(u)?null:u,e=null,a,l,s=n.ComparisonOperator,o=n.GeneralCompareType,p=n.RelationCompareType,v;switch(i){case s.Between:a=new n.NumberCondition(o.GreaterThanOrEqualsTo,c,h),a.integerValue=f,l=new n.NumberCondition(o.LessThanOrEqualsTo,y,w),l.integerValue=f,e=new n.RelationCondition(p.And,a,l);break;case s.NotBetween:a=new n.NumberCondition(o.LessThan,c,h),a.integerValue=f,l=new n.NumberCondition(o.GreaterThan,y,w),l.integerValue=f,e=new n.RelationCondition(
p.Or,a,l);break;case s.EqualsTo:e=new n.NumberCondition(o.EqualsTo,c,h),e.integerValue=f;break;case s.NotEqualsTo:e=new n.NumberCondition(o.NotEqualsTo,c,h),e.integerValue=f;break;case s.GreaterThan:e=new n.NumberCondition(o.GreaterThan,c,h),e.integerValue=f;break;case s.GreaterThanOrEqualsTo:e=new n.NumberCondition(o.GreaterThanOrEqualsTo,c,h),e.integerValue=f;break;case s.LessThan:e=new n.NumberCondition(o.LessThan,c,h),e.integerValue=f;break;case s.LessThanOrEqualsTo:e=new n.NumberCondition(o.LessThanOrEqualsTo,c,h),e.integerValue=f;break}return v=new t(e),v.type=f?n.CriteriaType.WholeNumber:n.CriteriaType.DecimalValues,v.comparisonOperator=i,v},t.createDateValidator=function(i,r,u){var s=t.isFormula(r)?r.replace("=",""):null,h=t.isFormula(r)?null:r,p=t.isFormula(u)?u.replace("=",""):null,v=t.isFormula(u)?null:u,e=null,a,c,o=n.ComparisonOperator,f=n.DateCompareType,y=n.RelationCompareType,l;switch(i){case o.Between:a=new n.DateCondition(f.A
fterEqualsTo,h,s),c=new n.DateCondition(f.BeforeEqualsTo,v,p),e=new n.RelationCondition(y.And,a,c);break;case o.NotBetween:a=new n.DateCondition(f.Before,h,s),c=new n.DateCondition(f.After,v,p),e=new n.RelationCondition(y.Or,a,c);break;case o.EqualsTo:e=new n.DateCondition(f.EqualsTo,h,s);break;case o.NotEqualsTo:e=new n.DateCondition(f.NotEqualsTo,h,s);break;case o.GreaterThan:e=new n.DateCondition(f.After,h,s);break;case o.GreaterThanOrEqualsTo:e=new n.DateCondition(f.AfterEqualsTo,h,s);break;case o.LessThan:e=new n.DateCondition(f.Before,h,s);break;case o.LessThanOrEqualsTo:e=new n.DateCondition(f.BeforeEqualsTo,h,s);break}return l=new t(e),l.type=n.CriteriaType.Date,l.comparisonOperator=i,l},t.createTextLengthValidator=function(i,r,u){var s=t.isFormula(r)?r.replace("=",""):null,h=t.isFormula(r)?null:r,p=t.isFormula(u)?u.replace("=",""):null,v=t.isFormula(u)?null:u,e=null,a,c,o=n.ComparisonOperator,f=n.GeneralCompareType,y=n.RelationCompare
Type,l;switch(i){case o.Between:a=new n.TextLengthCondition(f.GreaterThanOrEqualsTo,h,s),c=new n.TextLengthCondition(f.LessThanOrEqualsTo,v,p),e=new n.RelationCondition(y.And,a,c);break;case o.NotBetween:a=new n.TextLengthCondition(f.LessThan,h,s),c=new n.TextLengthCondition(f.GreaterThan,v,p),e=new n.RelationCondition(y.Or,a,c);break;case o.EqualsTo:e=new n.TextLengthCondition(f.EqualsTo,h,s);break;case o.NotEqualsTo:e=new n.TextLengthCondition(f.NotEqualsTo,h,s);break;case o.GreaterThan:e=new n.TextLengthCondition(f.GreaterThan,h,s);break;case o.GreaterThanOrEqualsTo:e=new n.TextLengthCondition(f.GreaterThanOrEqualsTo,h,s);break;case o.LessThan:e=new n.TextLengthCondition(f.LessThan,h,s);break;case o.LessThanOrEqualsTo:e=new n.TextLengthCondition(f.LessThanOrEqualsTo,h,s);break}return l=new t(e),l.type=n.CriteriaType.TextLength,l.comparisonOperator=i,l},t.createFormulaValidator=function(i){var r=i,u;return r&&r.charAt(0)==="="&&(r=r.substr(1)),u=new t(new
n.FormulaCondition(n.CustomValueType.Formula,r)),u.type=n.CriteriaType.Custom,u},t.createFormulaListValidator=function(i){var r=new t(n.AreaCondition.fromFormula(i));return r.type=n.CriteriaType.List,r},t.createListValidator=function(i){var r=new t(n.AreaCondition.fromSource(i));return r.type=n.CriteriaType.List,r},t}();n.DefaultDataValidator=t})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype,n.prototype=new r},wijmo;(function(n){(function(n){var u,i,s,ht,ct,kt,yt;n.feature("celltype",["core.common","core.sheet_action","core.basecelltype"]);var ii="undefined",t=window.document,e="position",h="absolute",w="margin",c="font",r="left",ot="right",f="top",vt="bottom",st="middle",wt=&
quot;center",nt="gcUIElement",l="none",o="0",vi="#F6FAFB",ei="#D2DBEB",it="#34B4E3",at="#A6F4FF",p=".gcEditingInput",lt="keydown"+p,ti="keyup"+p,ni="mousedown"+p,bt="mouseup"+p,hi="mouseout"+p,si="mousemove"+p,ri="click"+p,rt="width",dt="height",tt="padding",b="hidden",pi="visibility",yi="word-wrap",d="overflow",gt="resize",k="border",g="outline",et="box-shadow",v="box-sizing",y="color",oi="border-width",ai="border-style",pt="border-color",ft="white-space",a="background-color",li="max-width",ci="max-height";(function(n){n[n.Text=0]="Text",n[n.Index=1]="Index",n[n.Value=2]="Value"})(n.EditorValueType||(n.E
ditorValueType={})),u=n.EditorValueType,function(n){n[n.top=0]="top",n[n.bottom=1]="bottom",n[n.left=2]="left",n[n.right=3]="right"}(n.CheckBoxTextAlign||(n.CheckBoxTextAlign={})),i=n.CheckBoxTextAlign,function(n){n[n.Blank=0]="Blank",n[n.Self=1]="Self",n[n.Parent=2]="Parent",n[n.Top=3]="Top"}(n.HyperLinkTargetType||(n.HyperLinkTargetType={})),s=n.HyperLinkTargetType,ht=function(u){function s(){u.call(this),this._checkboxSize=12,this._caption="",this._textTrue="",this._textIndeterminate="",this._textFalse="",this._textAlign=i.right,this._isThreeState=!1}return __extends(s,u),s.prototype.paintValue=function(t,u,e,o,s,h,c,l){var d;if(!t)return;t.save();var p=this._getDisplayText(u),nt=0,k=0;l.sheet&&(nt=l.sheet._getStringWidth(p,c.font),k=l.sheet._getFontHeight(c.font),p&&(d=p.split(/\r\n|\r|\n/),k*=d.length));var a=this._checkboxSize/2,g=new n.Rect(+
+e,++o,--s,--h),y=parseInt((e+this._getCheckBoxLeft(c,g,nt)).toString()),v=parseInt((o+this._getCheckBoxTop(c,g,k)).toString()),w=r,b=y+1;c.hAlign===n.HorizontalAlign.center?(w=wt,b+=a):c.hAlign===n.HorizontalAlign.right&&(w=ot,b+=a*2),c.font&&(t.font=c.font),c.foreColor&&(t.fillStyle=c.foreColor),this._textAlign===i.left?(t.textAlign=ot,t.textBaseline=st,t.fillText(p,y+1-2,v+a)):this._textAlign===i.top&&(t.textAlign=w,t.textBaseline=vt,t.fillText(p,b,v-2)),t.strokeStyle="black",t.strokeRect(y+.5,v+.5,a*2+.05,a*2+.05),t.fillStyle="white",t.fillRect(y+1,v+1,a*2-1,a*2-1),this._isThreeState&&(u===null||u===undefined)?(t.beginPath(),t.fillStyle="green",t.rect(y+3,v+3,(a-2.5)*2,(a-2.5)*2),t.fill()):!!u==!0&&(t.beginPath(),t.lineWidth=2.5,t.moveTo(y+3,v+a),t.lineTo(y+a,v+a*2-3.5),t.lineTo(y+a*2-1.5,v+3),t.stroke()),c.foreColor&&(t.fillStyle=c.foreColor),this._textAlign===i.right?(t.textAlign=r,t.textBase
line=st,t.fillText(p,y+1+a*2+2,v+a)):this._textAlign===i.bottom&&(t.textAlign=w,t.textBaseline=f,t.fillText(p,b,v+a*2+2)),t.restore()},s.prototype.focus=function(n){n&&n.focus()},s.prototype._formatEditorValue=function(n,t,i){return i},s.prototype._getCheckBoxLeft=function(t,r,u,f){var o=r.x-1,h=r.width+1,s=0,e=0,c;return this._textAlign===i.top||this._textAlign===i.bottom?(e=o+5,t.hAlign===n.HorizontalAlign.center?e=o+h/2-this._checkboxSize/2:t.hAlign===n.HorizontalAlign.right&&(e=o+h-5-this._checkboxSize)):this._textAlign===i.left?(s=this._checkboxSize+u,e=o+5+u,t.hAlign===n.HorizontalAlign.center?e=o+h/2-s/2+u:t.hAlign===n.HorizontalAlign.right&&(e=o+h-5-s+u)):(s=this._checkboxSize+u,e=o+5,t.hAlign===n.HorizontalAlign.center?e=o+h/2-s/2:t.hAlign===n.HorizontalAlign.right&&(e=o+h-5-s)),c=e-o,f&&$.browser.msie&&(c-=3),c},s.prototype._getCheckBoxTop=function(t,r,u,f){var o=r.y-1,h=r.height+1,s=0,e=0,c;return this._textAlign===i
.top?(s=this._checkboxSize+u,e=o+5+u,t.vAlign===n.VerticalAlign.center?e=o+h/2-s/2+u:t.vAlign===n.VerticalAlign.bottom&&(e=o+h-5-s+u)):this._textAlign===i.bottom?(s=this._checkboxSize+u,e=o+5,t.vAlign===n.VerticalAlign.center?e=o+h/2-s/2:t.vAlign===n.VerticalAlign.bottom&&(e=o+h-5-s)):(e=o+5,t.vAlign===n.VerticalAlign.center?e=o+h/2-this._checkboxSize/2:t.vAlign===n.VerticalAlign.bottom&&(e=o+h-5-this._checkboxSize)),c=e-o,f&&$.browser.msie&&(c-=3),c},s.prototype.createEditorElement=function(){var f=t.createElement("div"),n=$(f),u,i,r;return n.css(e,h),n.css(w,o),n.css(tt,o),n.css(d,b),n.css(gt,l),n.css(k,"2px #5292f7 solid"),n.css(g,l),n.css(et,"1px 2px 5px rgba(0,0,0,0.4)"),n.css(v,"content-box"),n.attr("tabindex",1),n.attr(nt,"gcEditingInput"),u=$("<input/>"),u.attr("type","checkbox"),n.append(u),i=$("<span></span>"),i.css(e
,h),i.css(c,"normal 10pt Arial"),i.css("cursor","default"),i.css(ft,"nowrap"),n.append(i),r=$("<div></div>"),r.css(e,h),r.css(a,"green"),r.css(rt,(this._checkboxSize/2-2.5)*2),r.css(dt,(this._checkboxSize/2-2.5)*2),n.append(r),f},s.prototype._getNextState=function(n){var t;return t=this._isThreeState?n===null||n===undefined?!1:!!n==!0?null:!0:!n},s.prototype.setEditorValue=function(n,t){if(n&&n.children[0]&&n.children[1]&&n.children[2]){var i=n.sheet&&n.sheet._startEditByKeydown&&!this._isSpaceKeyDown;i||(t=this._getNextState(t)),this._isThreeState?t===null||t===undefined?(n.children[0].checked=!1,$(n.children[2]).show()):(n.children[0].checked=!!t,$(n.children[2]).hide()):n.children[0].checked=!!t,$(n.children[1]).text(this._getDisplayText(t))}},s.prototype.getEditorValue=function(n){return n&&n.children[0]&&n.children[1]&&n.children[2]?this._isThr
eeState?$(n.children[2]).is(":visible")?null:n.children[0].checked:n.children[0].checked:null},s.prototype._triggerButtonClicked=function(t,i,r){t.parent&&t.parent._trigger(n.Events.ButtonClicked,{sheet:t,sheetName:t._name,row:i,col:r})},s.prototype.activateEditor=function(i,u,e){var o;if(i&&i.sheet){var s=i.sheet,h=$(i),c=s._eventHandler._getCanvasOffset(),l=c.top+s._bounds.y+e.y-2,v=c.left+s._bounds.x+e.x-2;h.css(f,l),h.css(r,v),h.css(a,u.backColor?u.backColor:"white"),o=this,h.bind(ni,function(t){n.util.cancelDefault(t)}),h.bind(bt,function(n){var t=o.getEditorValue(i);o.setEditorValue(i,t),o.updateEditor(i,u,e),o._triggerButtonClicked(s,s._activeRowIndex,s._activeColIndex)}),h.bind(lt,function(t){if(t.keyCode!==n.Key.space||t.ctrlKey||t.shiftKey||t.altKey)t.keyCode!==n.Key.backspace||t.ctrlKey||t.shiftKey||t.altKey||n.util.cancelDefault(t);else return o._isKeyDown=!0,n.util.cancelDefault(t),!1}),h.bind(ti,function(t){if(o._isKeyDown&&t
.keyCode===n.Key.space&&!t.ctrlKey&&!t.shiftKey&&!t.altKey){o._isKeyDown=!1;var r=o.getEditorValue(i);o.setEditorValue(i,r),o.updateEditor(i,u,e),o._triggerButtonClicked(s,s._activeRowIndex,s._activeColIndex)}}),i.children[0]&&$(i.children[0]).bind("click",function(t){n.util.cancelDefault(t)}),t.body.insertBefore(i,null)}},s.prototype.updateEditor=function(t,u,e){var p,it,b,k,h,l,v,g,s,a,w,d,nt;if(t&&t.sheet){$(t).width(e.width).height(e.height),p=t.sheet,it=$(t);if(t.children[0]&&t.children[1]&&t.children[2]){b=$(t.children[1]),k=b.text(),u.foreColor&&b.css(y,u.foreColor),h=null,h=u.font?u.font:p._render._getDefaultFont(),p._zoomFactor>1&&(h=p._render._getZoomFont(h)),b.css(c,h),l=p._getStringWidth(k,h),v=p._getFontHeight(h),k&&(g=k.split(/\r\n|\r|\n/),v*=g.length);var rt=this._getCheckBoxLeft(u,e,l,!0),tt=this._getCheckBoxTop(u,e,v,!0),o=t.children[0];$(o).css("margin-left",rt).c
ss("margin-top",tt),s=0,a=0,this._textAlign===i.top?(s=o.offsetLeft,u.hAlign===n.HorizontalAlign.center?s=o.offsetLeft+this._checkboxSize/2-l/2:u.hAlign===n.HorizontalAlign.right&&(s=o.offsetLeft+this._checkboxSize-l),a=o.offsetTop-v):this._textAlign===i.bottom?(s=o.offsetLeft,u.hAlign===n.HorizontalAlign.center?s=o.offsetLeft+this._checkboxSize/2-l/2:u.hAlign===n.HorizontalAlign.right&&(s=o.offsetLeft+this._checkboxSize-l),a=o.offsetTop+o.offsetHeight):this._textAlign===i.left?(s=o.offsetLeft-l-2,a=o.offsetTop+this._checkboxSize/2-v/2):(s=o.offsetLeft+o.offsetWidth+2,a=o.offsetTop+this._checkboxSize/2-v/2),$.browser.msie&&(s+=3,a+=3),b.css(r,s).css(f,a),w=t.children[2],this._isThreeState?(d=o.offsetLeft+(o.offsetWidth-w.offsetWidth)/2,nt=o.offsetTop+(o.offsetHeight-w.offsetHeight)/2,$(w).css(r,d).css(f,nt).toggle().toggle()):$(w).hide()}}},s.prototype.caption=function(n){return arguments.length===0?this._caption:(this._caption=n,this)},s.prototype.
textTrue=function(n){return arguments.length===0?this._textTrue:(this._textTrue=n,this)},s.prototype.textIndeterminate=function(n){return arguments.length===0?this._textIndeterminate:(this._textIndeterminate=n,this)},s.prototype.textFalse=function(n){return arguments.length===0?this._textFalse:(this._textFalse=n,this)},s.prototype._getDisplayText=function(n){return this._isThreeState&&(n===null||n===undefined)?this._textIndeterminate||this._caption:!!n==!0?this._textTrue||this._caption:this._textFalse||this._caption},s.prototype.textAlign=function(n){return arguments.length===0?this._textAlign:(this._textAlign=n,this)},s.prototype.isThreeState=function(n){return arguments.length===0?this._isThreeState:(this._isThreeState=n,this)},s.prototype.getHitInfo=function(t,i,r,u,f,e,o){return o===null||o===undefined||o===n.SheetArea.viewport?{x:t,y:i,row:r,col:u,cellRect:e,sheetArea:o,isReservedLocation:!0}:null},s.prototype.processMouseDown=function(n){if(!n)return!1;n.isReservedLoca
tion&&(this._isMouseDownReservedLocation=!0)},s.prototype.processMouseUp=function(t){var r;if(!t)return!1;r=t.sheet;if(this._isMouseDownReservedLocation&&r&&t.isReservedLocation){this._isMouseDownReservedLocation=!1;var u=t.row,f=t.col,e=t.sheetArea,i=r._getModel(e).getNode(u,f,!0);if(i._isFirstMouseUp)delete i._isFirstMouseUp,i._mouseupToken&&(window.clearTimeout(i._mouseupToken),delete i._mouseupToken);else{var h=r.getValue(u,f,e),c=this._getNextState(h),o={row:u,col:f,newValue:c,autoFormat:!0},s=new n.UndoRedo.CellEditUndoAction(r,o);return r._doCommand(s),this._triggerButtonClicked(r,u,f),i._isFirstMouseUp=!0,i._mouseupToken=window.setTimeout(function(){delete i._isFirstMouseUp,i._mouseupToken&&(window.clearTimeout(i._mouseupToken),delete i._mouseupToken)},250),!0}}return!1},s.prototype.processMouseLeave=function(n){if(!n)return!1;this._isMouseDownReservedLocation=!1},s.prototype.isReservedKey=function(t){return this._isSpaceKeyDown=t.keyC
ode===n.Key.space&&!t.ctrlKey&&!t.shiftKey&&!t.altKey,!1},s.prototype._getAutoFitWidth=function(t,r,u,f,e){var o=n.TextCellType.prototype._getAutoFitWidth.apply(this,[t,r,this._getDisplayText(r),f,e]);return this._textAlign===i.top||this._textAlign===i.bottom?o=Math.max(o,this._checkboxSize):o+=this._checkboxSize,o+5+2},s.prototype._getAutoFitHeight=function(t,r,u,f){var e=n.TextCellType.prototype._getAutoFitHeight.apply(this,[t,r,this._getDisplayText(r),f]);return this._textAlign===i.top||this._textAlign===i.bottom?e+=this._checkboxSize:e=Math.max(e,this._checkboxSize),e+5},s.prototype._cancelDefaultKeydown=function(t){t.keyCode!==n.Key.space||t.ctrlKey||t.shiftKey||t.altKey||n.util.cancelDefault(t)},s.prototype.isImeAware=function(){return!1},s.prototype.toJSON=function(){return{type:n.CellTypeKind.CheckBoxCellType,caption:this.caption(),textTrue:this.textTrue(),textIndeterminate:this.textIndeterminate(),textFalse:this.textFalse(),textAlign:this.textAlign()
,isThreeState:this.isThreeState()}},s.prototype.fromJSON=function(n){if(!n)return;n.caption&&this.caption(n.caption),n.textTrue&&this.textTrue(n.textTrue),n.textIndeterminate&&this.textIndeterminate(n.textIndeterminate),n.textFalse&&this.textFalse(n.textFalse),n.textAlign!==null&&n.textAlign!==undefined&&this.textAlign(n.textAlign),n.isThreeState!==null&&n.isThreeState!==undefined&&this.isThreeState(n.isThreeState)},s}(n.TextCellType),n.CheckBoxCellType=ht,ct=function(i){function u(){i.call(this),this._marginTop=2,this._marginRight=2,this._marginBottom=2,this._marginLeft=2,this._text="",this._buttonBackColor=null,this._buttonBorderColor="#707070"}return __extends(u,i),u.prototype.paintValue=function(t,i,r,u,f,e,o,s){var l;if(!t)return;t.save();var v=r+this._marginLeft,a=u+this._marginTop,h=f-this._marginLeft-this._marginRight,c=e-this._marginTop-this._marginBottom;h-2>0&&c-2>0&&
(t.strokeStyle=this._buttonBorderColor,t.strokeRect(v+.5,a+.5,h-1,c-1),this._buttonBackColor?t.fillStyle=this._buttonBackColor:(l=t.createLinearGradient(r+f/2,u,r+f/2,u+e),l.addColorStop(.125,vi),l.addColorStop(1,ei),t.fillStyle=l),t.fillRect(v+1,a+1,h-2,c-2),n.TextCellType.prototype.paintValue.apply(this,[t,this._text,v,a,h,c,o,s])),t.restore()},u.prototype.focus=function(n){n&&n.focus()},u.prototype._formatEditorValue=function(n,t,i){return i},u.prototype.createEditorElement=function(){var u=t.createElement("div"),n=$(u),i,r;return n.css(e,h),n.css(w,o),n.css(tt,o),n.css(d,b),n.css(gt,l),n.css(k,"2px #5292f7 solid"),n.css(g,l),n.css(et,"1px 2px 5px rgba(0,0,0,0.4)"),n.css(v,"content-box"),n.css("user-select","none"),n.attr("tabindex",1),n.attr(nt,"gcEditingInput"),i=$("<div></div>"),i.css(e,h),i.css(d,b),i.css(k,"1px "+this._buttonBorderColor+" solid"),
n.append(i),r=$("<span></span>"),r.css(e,h),r.css(ft,"nowrap"),r.css(c,"normal 10pt Arial"),r.css("cursor","default"),i.append(r),u},u.prototype.setEditorValue=function(n,t){n&&n.children[0]&&n.children[0].children[0]&&$(n.children[0].children[0]).html(this._text)},u.prototype.getEditorValue=function(n){return n?n._oldValue:null},u.prototype._triggerButtonClicked=function(t,i,r){t.parent&&t.parent._trigger(n.Events.ButtonClicked,{sheet:t,sheetName:t._name,row:i,col:r})},u.prototype._setButtonBackgroundColor=function(n,t){n.removeClass("gradientButton"),t?n.css(a,t):n.addClass("gradientButton")},u.prototype.activateEditor=function(i,u,e){var o,l,s;if(i&&i.sheet){var h=i.sheet,c=$(i),v=h._eventHandler._getCanvasOffset(),p=v.top+h._bounds.y+e.y-2,y=v.left+h._bounds.x+e.x-2;c.css(f,p),c.css(r,y),c.css(a,u.backColor?u.backColor:"white"),o=this,l=i.children[0
],l&&(s=$(l),c.bind(lt,function(t){if(t.keyCode!==n.Key.space||t.ctrlKey||t.shiftKey||t.altKey)t.keyCode!==n.Key.backspace||t.ctrlKey||t.shiftKey||t.altKey||n.util.cancelDefault(t);else return o._isKeyDown||o._setButtonBackgroundColor(s,it),o._isKeyDown=!0,n.util.cancelDefault(t),!1}),c.bind(ti,function(t){!o._isKeyDown||t.keyCode!==n.Key.space||t.ctrlKey||t.shiftKey||t.altKey||(o._isKeyDown=!1,o._setButtonBackgroundColor(s,o._buttonBackColor),o._triggerButtonClicked(h,h._activeRowIndex,h._activeColIndex))}),s.bind(ni,function(n){n.button!==2&&(o._isMouseDown=!0,o._setButtonBackgroundColor(s,it))}),s.bind(bt,function(n){n.button!==2&&(o._isMouseDown=!1,o._setButtonBackgroundColor(s,at))}),s.bind(ri,function(n){o._triggerButtonClicked(h,h._activeRowIndex,h._activeColIndex)}),s.bind(si,function(n){o._isMouseDown?o._setButtonBackgroundColor(s,it):o._setButtonBackgroundColor(s,at)}),s.bind(hi,function(n){var t=n.relatedTarget;t!==l&&t!==l.children[0]&
&o._setButtonBackgroundColor(s,o._buttonBackColor)})),t.body.insertBefore(i,null)}},u.prototype.updateEditor=function(t,i,u){var s,w,o,v,e,p,h,b,a,l;t&&t.sheet&&(s=t.sheet,w=$(t),w.width(u.width).height(u.height),t.children[0]&&(o=$(t.children[0]),o.width(u.width-this._marginLeft-this._marginRight).height(u.height-this._marginTop-this._marginBottom).css("margin-top",this._marginTop-1).css("margin-left",this._marginLeft-1),this._setButtonBackgroundColor(o,this._buttonBackColor),t.children[0].children[0]&&(v=$(t.children[0].children[0]),i.foreColor&&v.css(y,i.foreColor),e=null,e=i.font?i.font:s._render._getDefaultFont(),s._zoomFactor>1&&(e=s._render._getZoomFont(e)),v.css(c,e),p=s._getStringWidth(this._text,e),h=s._getFontHeight(e),this._text&&(b=this._text.split(/\r\n|\r|\n/),h*=b.length),a=0,i.vAlign===n.VerticalAlign.center?a=o.height()/2-h/2:i.vAlign===n.VerticalAlign.bottom&&(a=o.height()-h
),l=0,i.hAlign===n.HorizontalAlign.center?l=o.width()/2-p/2:i.hAlign===n.HorizontalAlign.right&&(l=o.width()-p),v.css(f,a).css(r,l))))},u.prototype.marginTop=function(n){return arguments.length===0?this._marginTop:(this._marginTop=n,this)},u.prototype.marginRight=function(n){return arguments.length===0?this._marginRight:(this._marginRight=n,this)},u.prototype.marginBottom=function(n){return arguments.length===0?this._marginBottom:(this._marginBottom=n,this)},u.prototype.marginLeft=function(n){return arguments.length===0?this._marginLeft:(this._marginLeft=n,this)},u.prototype.text=function(n){return arguments.length===0?this._text:(this._text=n,this)},u.prototype.buttonBackColor=function(n){return arguments.length===0?this._buttonBackColor:(this._buttonBackColor=n,this)},u.prototype.getHitInfo=function(t,i,r,u,f,e,o){if((o===null||o===undefined||o===n.SheetArea.viewport)&&e){var l=e.x+this._marginLeft,c=e.x+e.width-this._marginRight,a=e.y+this._marginTop,h=e.y+e.heigh
t-this._marginBottom,s={x:t,y:i,row:r,col:u,cellRect:e,sheetArea:o};return l>t||t>c||a>i||i>h||(s.isReservedLocation=!0),s}return null},u.prototype.processMouseDown=function(n){if(!n)return!1;var t=n.sheet;return t&&n.isReservedLocation&&!this._isMouseDownReservedLocation?(this._originButtonBackColor=this._buttonBackColor,this._isMouseDownReservedLocation=!0,this._buttonBackColor=it,t.repaint(n.cellRect),!0):!1},u.prototype.processMouseUp=function(n){var i;if(!n)return!1;i=n.sheet;if(this._isMouseDownReservedLocation&&i&&n.isReservedLocation){this._buttonBackColor=this._originButtonBackColor,i.repaint(n.cellRect),this._isMouseDownReservedLocation=!1;var r=n.row,u=n.col,f=n.sheetArea,t=i._getModel(f).getNode(r,u,!0);if(t._isFirstMouseUp)delete t._isFirstMouseUp,t._mouseupToken&&(window.clearTimeout(t._mouseupToken),delete t._mouseupToken);else return this._triggerButtonClicked(i,r,u),t._isFirstMouseUp=!0,t._mouseupToken=window.setTi
meout(function(){delete t._isFirstMouseUp,t._mouseupToken&&(window.clearTimeout(t._mouseupToken),delete t._mouseupToken)},250),!0}return!1},u.prototype.processMouseLeave=function(n){if(!n)return!1;var t=n.sheet;t&&this._isMouseDownReservedLocation&&(this._buttonBackColor=this._originButtonBackColor,t.repaint(n.cellRect),this._isMouseDownReservedLocation=!1)},u.prototype._getAutoFitWidth=function(t,i,r,u,f){var e=n.TextCellType.prototype._getAutoFitWidth.apply(this,[t,i,this._text,u,f]);return e+this._marginLeft+this._marginRight},u.prototype._getAutoFitHeight=function(t,i,r,u){var f=n.TextCellType.prototype._getAutoFitHeight.apply(this,[t,i,this._text,u]);return f+this._marginTop+this._marginBottom},u.prototype._cancelDefaultKeydown=function(t){t.keyCode!==n.Key.space||t.ctrlKey||t.shiftKey||t.altKey||n.util.cancelDefault(t)},u.prototype.isImeAware=function(){return!1},u.prototype.toJSON=function(){return{type:n.CellTypeKind.ButtonCellType,marginTop:this.marg
inTop(),marginRight:this.marginRight(),marginBottom:this.marginBottom(),marginLeft:this.marginLeft(),text:this.text(),buttonBackColor:this.buttonBackColor()}},u.prototype.fromJSON=function(n){if(!n)return;n.marginTop!==null&&n.marginTop!==undefined&&this.marginTop(n.marginTop),n.marginRight!==null&&n.marginRight!==undefined&&this.marginRight(n.marginRight),n.marginBottom!==null&&n.marginBottom!==undefined&&this.marginBottom(n.marginBottom),n.marginLeft!==null&&n.marginLeft!==undefined&&this.marginLeft(n.marginLeft),n.text&&this.text(n.text),n.buttonBackColor&&this.buttonBackColor(n.buttonBackColor)},u}(n.TextCellType),n.ButtonCellType=ct;var ut=17,ui=20,fi=function(i){function s(){i.call(this),this._editorValueType=u.Text,this._items=null,this._autoFormatValue=!1,this._hasInPlaceEditor=!1}return __extends(s,i),s.prototype.getHitInfo=function(t,i,r,u,f,e,o){if(this._hasInPlaceEditor)return null;if((o===nu
ll||o===undefined||o===n.SheetArea.viewport)&&e){var h=e.x+e.width,s={x:t,y:i,row:r,col:u,cellStyle:f,cellRect:e,sheetArea:o};return h-ut<=t&&t<h&&(s.isReservedLocation=!0),s}return null},s.prototype.processMouseDown=function(n){if(!n||!n.sheet||this._hasInPlaceEditor)return;n.isReservedLocation&&this._expandItems(n)},s.prototype.isReservedKey=function(t){if(this._hasInPlaceEditor){var i=t.ctrlKey||t.shiftKey||t.altKey;return!i&&(t.which===n.Key.enter||t.which===n.Key.esc||t.which===n.Key.tab||t.which===n.Key.left||t.which===n.Key.right)?!1:!0}return!1},s.prototype._expandItems=function(i,u){var k,s,p;if(!i||!i.sheet)return;typeof u===ii&&(u=ui);var o=i.sheet,nt=i.row,d=i.col,b=i.cellRect,it=i.sheetArea,w=i.cellStyle,h=this.createEditorElement(),e=$(h),tt=o._eventHandler._getCanvasOffset(),ut=tt.top+o._bounds.y+b.y+b.height,ft=tt.left+o._bounds.x+b.x-1;e.css(f,ut),e.css(r,ft),e.css(v,"content-box"),e.css(rt,b.width-2),e
.css(g,l),w.backColor&&e.css(a,w.backColor),w.foreColor&&e.css(y,w.foreColor),k=w&&w.font?w.font:o._render._getDefaultFont(),o._zoomFactor>1&&(k=o._render._getZoomFont(k)),e.css(c,k),s=this,s._renderItems(h,s._items),h.length>u?e.prop("size",u):e.prop("size",Math.max(2,h.length)),s.setEditorValue(h,o.getValue(nt,d,it)),p=function(i){e.unbind("blur"),e.unbind("click"),e.unbind("keydown"),t.body.removeChild(h),s._hasInPlaceEditor=!1;if(i)o.repaint(b);else{var f=s.getEditorValue(h),u={row:nt,col:d,newValue:f,autoFormat:s._autoFormatValue},r=new n.UndoRedo.CellEditUndoAction(o,u);o._doCommand(r)}},e.bind("keydown",function(t){if(t.ctrlKey||t.shiftKey||t.altKey)return;t.which===n.Key.esc?p(!0):t.which===n.Key.enter?p():t.which===n.Key.left?(t.preventDefault(),p(),n.SpreadActions.navigationLeft.apply(o)):t.which===n.Key.right&&(t.preventDefault(),p(),n.SpreadActions.navigationRight.ap
ply(o))}),e.bind("click",function(n){(n.target.tagName==="SELECT"||n.target.tagName==="OPTION")&&p()}),e.bind("blur",function(){p()}),t.body.insertBefore(h,null),e.focus(),s._hasInPlaceEditor=!0,o.repaint(b)},s.prototype.paintValue=function(n,t,r,u,f,e,o,s){var h=ut,c=Math.max(0,f-h-1);i.prototype.paintValue.call(this,n,t,r,u,c,e,o,s),n.save(),this._hasInPlaceEditor&&s.sheet.getActiveRowIndex()===s.row&&s.sheet.getActiveColumnIndex()===s.col?(n.beginPath(),n.rect(r+f-h-.5,u+1.5+.05,h-1,e-3+.05),n.fillStyle="#DDEDFC",n.fill(),n.lineWidth=1,n.strokeStyle="#7EB4EA",n.stroke(),n.beginPath(),n.lineWidth=2,n.strokeStyle="black",n.moveTo(r+f-h+5,u+1+(e-2)/2-1.5),n.lineTo(r+f-h+8.5,u+1+(e-2)/2+2),n.lineTo(r+f-h+12,u+1+(e-2)/2-1.5),n.stroke()):(n.beginPath(),n.lineWidth=2,n.fillStyle="#B2B2B2",n.moveTo(r+f-h+5,u+1+(e-2)/2-2),n.lineTo(r+f-h+8.5,u+1+(e-2)/2+2),n.lineTo(r+f-h+12,u+1+(e-2)/2-2
),n.fill()),n.restore()},s.prototype._getHAlignByValueType=function(t,i,r){return t===n.HorizontalAlign.general?n.HorizontalAlign.left:t},s.prototype.createEditorElement=function(){var i=t.createElement("select"),n=$(i);return n.css(e,h),n.css(w,o),n.attr(nt,"gcEditor"),i},s.prototype.setEditorValue=function(n,t){var o,e,f,s,i,r;if(!n||!this._items)return;o=n;if(this._editorValueType===u.Text){var h=t!==undefined&&t!==null?t.toString().toLowerCase():null,f=-1,s=this._items.length;for(i=0;i<s;i++){r=this._items[i],e=r&&r.hasOwnProperty("text")?r.text:r,e=e!==undefined&&e!==null?e.toString().toLowerCase():null;if(e===h){f=i;break}}o.selectedIndex=f}else if(this._editorValueType===u.Index)f=parseInt(t,10),o.selectedIndex=isNaN(f)?-1:f;else if(this._editorValueType===u.Value){for(f=-1,s=this._items.length,i=0;i<s;i++){r=this._items[i];if(r&&r.hasOwnProperty("value")&&r.value===t){f=i;break}}o.selectedI
ndex=f}},s.prototype.getEditorValue=function(n){var r,i,t;if(!n||!this._items)return null;r=n.sheet,r&&r.isEditing()&&r._eventHandler._setFocus(),i=n.selectedIndex;if(i>=0)if(this._editorValueType===u.Text)return t=this._items[i],t&&t.hasOwnProperty("text")?t.text:t;else if(this._editorValueType===u.Index)return i;else if(this._editorValueType===u.Value){t=this._items[i];if(t&&t.hasOwnProperty("value"))return t.value}return null},s.prototype.activateEditor=function(i,u,e){if(!i||!i.sheet)return;var h=i,o=i.sheet,s=$(h),c=o._eventHandler._getCanvasOffset(),y=c.top+o._bounds.y+e.y-1,a=c.left+o._bounds.x+e.x-1;s.css(f,y),s.css(r,a),s.css(v,"content-box"),s.css(k,"1px solid black"),s.css(g,l),this._renderItems(h,this._items),s.bind("keydown",function(t){t.keyCode!==n.Key.backspace||t.ctrlKey||t.shiftKey||t.altKey||n.util.cancelDefault(t);if(t.ctrlKey||t.shiftKey||t.altKey)return;o.isEditing()&&o
.editorStatus()===n.EditorStatus.Enter&&(t.which===n.Key.left?(t.preventDefault(),o.endEdit(),n.SpreadActions.navigationLeft.apply(o)):t.which===n.Key.right&&(t.preventDefault(),o.endEdit(),n.SpreadActions.navigationRight.apply(o)))}),t.body.insertBefore(h,null),s.focus(),this._hasInPlaceEditor=!0},s.prototype.deactivateEditor=function(n){if(n){var t=n;$(t).unbind("keydown")}this._hasInPlaceEditor=!1,i.prototype.deactivateEditor.call(this,n),n&&n.sheet&&n.sheet.repaint()},s.prototype.updateEditor=function(n,t,i){var u;if(!n||!n.sheet)return;var e=n,f=n.sheet,r=$(e);t&&(t.backColor&&r.css(a,t.backColor),t.foreColor&&r.css(y,t.foreColor),u=t.font?t.font:f._render._getDefaultFont(),f._zoomFactor>1&&(u=f._render._getZoomFont(u)),r.css(c,u)),i&&(r.css(rt,i.width-1),r.css(dt,i.height-1))},s.prototype._formatEditorValue=function(n,t,i){return i},s.prototype.format=function(n,t,r){var s,o,e,f;if(this._edito
rValueType!==u.Text)if(this._editorValueType===u.Index)o=this._items?this._items.length:0,s=parseInt(n),0<=s&&s<o&&(f=this._items[s],f!==undefined&&f!==null&&(n=f.hasOwnProperty("text")?f.text:f));else if(this._editorValueType===u.Value)for(o=this._items?this._items.length:0,e=0;e<o;e++){f=this._items[e];if(f&&f.hasOwnProperty("value")&&f.value===n){n=f.hasOwnProperty("text")?f.text:f;break}}return i.prototype.format.call(this,n,t,r)},s.prototype.parse=function(n,t){var n=i.prototype.parse.call(this,n,t),e,f,r;if(this._editorValueType===u.Text)return n;else if(this._editorValueType===u.Index)for(e=this._items?this._items.length:0,f=0;f<e;f++){r=this._items[f];if(r&&r.hasOwnProperty("text")&&r.text===n||r===n)return f}else if(this._editorValueType===u.Value)for(e=this._items?this._items.length:0,f=0;f<e;f++){r=this._items[f];if(r&&r.hasOwnProperty("text&
quot;)&&r.text===n||r===n)return r.value}return n},s.prototype.editorValueType=function(n){return arguments.length===0?this._editorValueType:(this._editorValueType=n,this)},s.prototype.items=function(n){return arguments.length===0?this._items:(this._items=n,this)},s.prototype._renderItems=function(n,t){var f,u,r,i;if(!t||!n)return;for(f=t.length,u=0;u<f;u++)r=new window.Option,i=t[u],i!==undefined&&i!==null&&(r.text=i.hasOwnProperty("text")?i.text:i),n.add(r)},s.prototype._getAutoFitWidth=function(t,i,r,u,f){var e=n.TextCellType.prototype._getAutoFitWidth.apply(this,arguments);return e+ut},s.prototype._getAutoFitHeight=function(t,i,r,u){return n.TextCellType.prototype._getAutoFitHeight.apply(this,arguments)},s.prototype.isImeAware=function(){return!1},s.prototype.toJSON=function(){return{type:n.CellTypeKind.ComboBoxCellType,editorValueType:this.editorValueType(),items:this.items()}},s.prototype.fromJSON=function(n){if(!n)return;n.editorValueType!
==null&&n.editorValueType!==undefined&&this.editorValueType(n.editorValueType),n.items!==null&&n.items!==undefined&&this.items(n.items)},s}(n.TextCellType);n.ComboBoxCellType=fi,kt=function(i){function u(){i.call(this),this._link="",this._linkColor="#0066CC",this._visitedLinkColor="#3399FF",this._text="",this._linkToolTip="",this._id=u._getUniqueId(),this._target=s.Blank}return __extends(u,i),u.prototype.paintValue=function(t,i,u,e,o,s,h,c){var y,d,w,p,a,g,v,k,b,l,nt;if(this._actived||!t)return;y=this._text||i;if(!y)return;y=y.toString(),y=y.replace(/\s+/g," "),d=!1,w=c.sheet._getModel().getNode(c.row,c.col),w&&w.hyperlinkInfo&&(this._id===w.hyperlinkInfo.id?d=w.hyperlinkInfo.visited:delete w.hyperlinkInfo),t.save(),c.cellOverflowLayout?(p=c.cellOverflowLayout.layout,p&&(t.rect(p.x,p.y,p.width,p.height),t.clip(),t.beginPath())):(t.rect(u,e,o,s),t.clip(),t.beginPath()),
t.fillStyle=d?this._visitedLinkColor:this._linkColor,h.font&&(t.font=h.font),a=this._getLinkRect(y,h.hAlign,h.vAlign,h.font,new n.Rect(u,e,o,s)),g=2,t.textAlign=r,h.hAlign===n.HorizontalAlign.center?a.width<o-3&&(g=o/2,t.textAlign=wt):h.hAlign===n.HorizontalAlign.right&&a.width<o-3&&(g=o-2,t.textAlign=ot),v=$.browser.mozilla?5:2,t.textBaseline=f,h.vAlign===n.VerticalAlign.center?a.height<s&&(v=$.browser.mozilla?s/2+1:$.browser.msie?s/2+.5:s/2,parseInt(v.toString(),10)!==v&&(v=v+.5),t.textBaseline=st):h.vAlign===n.VerticalAlign.bottom&&(v=s-2.5,t.textBaseline=vt),t.fillText(y,u+g,e+v),i&&(k=u+a.x,b=u+a.x+a.width,h.hAlign!==n.HorizontalAlign.right&&(k=k+1,b=b+1),l=e+a.y+a.height,h.vAlign===n.VerticalAlign.bottom&&(l=l-.5),l=l-Math.max(0,Math.round(a.height/9)-1),parseInt(l,10)===l&&(l=l+.5),nt=l,t.beginPath(),t.strokeStyle=d?this._visitedLinkColor:this._linkColor,t.lineWidth=1,t.moveTo(k,l
),t.lineTo(b,nt),t.stroke()),t.restore()},u.prototype.createEditorElement=function(){var r=t.createElement("div"),i=$(r),u,n;i.css(w,o),i.css(tt,o),i.css(k,l),i.css(e,h),i.css(d,b),i.css(v,"content-box"),i.css(ft,"nowrap"),i.attr(nt,"gcEditor"),u=t.createElement("a"),n=$(u),n.css(w,o);switch(this._target){case s.Blank:n.attr("target","_blank");break;case s.Self:n.attr("target","_self");break;case s.Parent:n.attr("target","_parent");break;case s.Top:n.attr("target","_top");break}return n.css(g,l),n.css("display","block"),n.appendTo(i),r},u.prototype._triggerButtonClicked=function(t,i,r){t.parent&&(t._startEditByKeydown||t.parent._trigger(n.Events.ButtonClicked,{sheet:t,sheetName:t._name,row:i,col:r}))},u.prototype.activateEditor=function(i,u,s){var g,p,tt,k,c;if(!i||!s)return;var rt=i,l=rt.sheet,it=$(rt);if(l){var ut=l._eventHan
dler._getCanvasOffset(),et=ut.top+l._bounds.y+s.y,ft=ut.left+l._bounds.x+s.x;it.css(f,et).css(r,ft)}it.bind("keydown",function(t){t.keyCode!==n.Key.backspace||t.ctrlKey||t.shiftKey||t.altKey||n.util.cancelDefault(t)}),g=it.children()[0],g&&(p=this,tt=$(g),tt.bind("click",function(){tt.css(y,p._visitedLinkColor);if(l){var t=l._activeRowIndex,n=l._activeColIndex,i=l._getModel().getNode(t,n,!0);i.hyperlinkInfo={id:p._id,visited:!0},p._triggerButtonClicked(l,t,n)}})),k=t.createElement("div"),c=$(k),c.css(w,o),c.css(e,h),c.css(d,b),c.css(v,"content-box"),c.attr(nt,"gcEditingInput"),c.css(oi,"1px"),c.css(ai,"solid"),c.css(a,"transparent"),t.body.insertBefore(k,null),this._clip=k,t.body.insertBefore(rt,null),this._actived=!0},u.prototype.deactivateEditor=function(n){this._clip&&t.body.removeChild(this._clip);if(n){$(n).unbind("keydown");var r=$(n).children()[0];r&&$(r).unbind(&
quot;click")}i.prototype.deactivateEditor.call(this,n),this._actived=!1,n&&n.sheet&&n.sheet.repaint()},u.prototype.focus=function(n){n&&n.focus()},u.prototype.updateEditor=function(n,t,i){var e,a,v,h,o,l;if(!n||!i)return;var u=n.sheet,g=n,s=$(g),k=s.children()[0];k&&(e=$(k),this._link&&e.attr("href",this._link),a=this._text||this._link,a&&e.text(a),e.attr("title",this._linkToolTip),v=!1,h=u?u._getModel().getNode(u._activeRowIndex,u._activeColIndex):null,h&&h.hyperlinkInfo&&(this._id===h.hyperlinkInfo.id?v=h.hyperlinkInfo.visited:delete h.hyperlinkInfo),v?e.css(y,this._visitedLinkColor):e.css(y,this._linkColor),o=t&&t.font?t.font:null,!o&&u&&(o=u._render._getDefaultFont()),u&&u._zoomFactor>1&&(o=u._render._getZoomFont(o)),o&&e.css(c,o));if(t&&u){s.css(li,i.width-2),s.css(ci,i.height-2);var w=u._eventHandler._getCanvasOffset(),d=w.top+u._b
ounds.y+i.y,p=w.left+u._bounds.x+i.x,b=this._calcPosition(i,s.width(),s.height(),t.hAlign,t.vAlign);s.css(f,d+b.y).css(r,p+b.x),this._clip&&(l=$(this._clip),l.css(f,d).css(r,p),l.height(i.height-3).width(i.width-3),t.backColor?l.css(pt,t.backColor):l.css(pt,"white"))}},u.prototype.getEditorValue=function(n){return this._link},u.prototype.setEditorValue=function(n,t){this._link=t},u.prototype._formatEditorValue=function(n,t,i){return i},u.prototype.getHitInfo=function(t,i,r,u,f,e,o){return(o===null||o===undefined||o===n.SheetArea.viewport)&&f&&e?{x:t,y:i,row:r,col:u,cellStyle:f,cellRect:e,sheetArea:o}:null},u.prototype.processMouseDown=function(n){if(!n)return;var t=n.sheet;if(!t||t.isEditing())return;n.isReservedLocation=this._isHitHyperlink(n,t)?!0:!1,n.isReservedLocation&&(this._isMouseDownLink=!0)},u.prototype.processMouseUp=function(n){var t,i,r;if(!n)return;t=n.sheet;if(!t||t.isEditing())return;n.isReservedLocation=this._isHitHyperlink(
n,t)?!0:!1;if(n.isReservedLocation&&this._isMouseDownLink){i=t.getValue(n.row,n.col,n.sheetArea);if(i)switch(this._target){case s.Blank:window.open(i,"_blank");break;case s.Self:window.open(i,"_self");break;case s.Parent:window.open(i,"_parent");break;case s.Top:window.open(i,"_top");break}r=t._getModel(n.sheetArea).getNode(n.row,n.col,!0),r.hyperlinkInfo={id:this._id,visited:!0},t.repaint(n.cellRect),this._triggerButtonClicked(t,n.row,n.col)}this._isMouseDownLink=!1},u.prototype.processMouseMove=function(n){var t,r,i;if(!n)return;t=n.sheet;if(!t)return;if(t.isEditing()&&t.getActiveRowIndex()===n.row&&t.getActiveColumnIndex()===n.col)return;n.isReservedLocation=this._isHitHyperlink(n,t)?!0:!1,n.isReservedLocation?(this._showLinkToolTip(t,n),i=t._getCanvas(),i&&(r=t.getValue(n.row,n.col,n.sheetArea),i.style.cursor=r?"pointer":"text")):(this._hideLinkToolTip(),i=t._getCanvas(),i&&(i.sty
le.cursor="default"))},u.prototype.processMouseLeave=function(n){var i,t;this._isMouseDownLink=!1,this._hideLinkToolTip(),i=n.sheet,i&&(t=i._getCanvas(),t&&(t.style.cursor="default"))},u.prototype._isHitHyperlink=function(n,t){var u=n.cellStyle,i=n.cellRect,o=n.x,s=n.y,e=this._text||this._link,f;e||(e=t.getValue(n.row,n.col,n.sheetArea)),f=u&&u.font?u.font:t._render._getDefaultFont(),t._zoomFactor>1&&(f=t._render._getZoomFont(f));var r=this._getLinkRect(e,u.hAlign,u.vAlign,f,i),l=i.x+r.x,a=Math.min(i.x+r.x+r.width,i.x+i.width),h=i.y+r.y,c=Math.min(i.y+r.y+r.height,i.y+i.height);return l<=o&&o<a&&h<=s&&s<c?!0:!1},u.prototype._showLinkToolTip=function(n,i){var e,u;if(this._linkToolTip){e=this._getLinkToolTipElement(),u=$(e),u.text(this._linkToolTip);var o=n._eventHandler._getCanvasOffset(),h=o.left+i.x,s=o.top+i.y+20;u.parent().length===0&&(t.body.insertBefore(e,null),u.css(f,s).css(r,h)
)}},u.prototype._hideLinkToolTip=function(){this._linkToolTipElement&&(t.body.removeChild(this._linkToolTipElement),this._linkToolTipElement=null)},u.prototype._getLinkToolTipElement=function(){if(!this._linkToolTipElement){var i=t.createElement("div"),n=$(i);i.className="gcHyperLinkCellTypeToolTip",n.css(e,h),n.css(w,o),n.css(tt,2),n.css(k,"1px #C0C0C0 solid"),n.css(et,"1px 2px 5px rgba(0,0,0,0.4)"),n.css(v,"content-box"),n.css(a,"#FFFFFF"),n.css(c,"9pt Arial"),this._linkToolTipElement=i}return this._linkToolTipElement},u.prototype._getLinkRect=function(n,t,i,r,f){var y=u._getEditorElement(),h=$(y),a=h.children()[0],e,s;a&&(e=$(a),e.text(n?n:""),r&&e.css(c,r));var v=h.width(),l=h.height(),o={x:0,y:0,width:v,height:l};return f&&(s=this._calcPosition(f,v,l,t,i),o.x=s.x,o.y=s.y),o},u.prototype._calcPosition=function(t,i,r,u,f){var o=1,e=1,h=t.width-3,s=t.height-3;return u===
n.HorizontalAlign.center?o=o+Math.max(0,(h-i)/2):u===n.HorizontalAlign.right&&(o=o+Math.max(0,h-i)),f===n.VerticalAlign.center?e=e+Math.max(0,(s-r)/2):f===n.VerticalAlign.bottom&&(e=e+Math.max(0,s-r)),{x:o,y:e}},u.prototype.linkColor=function(n){return arguments.length===0?this._linkColor:(this._linkColor=n,this)},u.prototype.visitedLinkColor=function(n){return arguments.length===0?this._visitedLinkColor:(this._visitedLinkColor=n,this)},u.prototype.text=function(n){return arguments.length===0?this._text:(this._text=n,this)},u.prototype.linkToolTip=function(n){return arguments.length===0?this._linkToolTip:(this._linkToolTip=n,this)},u.prototype.target=function(n){return arguments.length===0?this._target:(this._target=n,this)},u.prototype._getAutoFitWidth=function(n,t,i,r,u){var i=this._text||t,e=r&&r.font?r.font:n._render._getZoomFont(n._render._getDefaultFont()),f=this._getLinkRect(i,r.hAlign,r.vAlign,e);return f.width},u.prototype._getAutoFitHeight=function(
n,t,i,r){var i=this._text||t,u=r&&r.font?r.font:n._render._getDefaultFont(),f;return n._zoomFactor>1&&(u=n._render._getZoomFont(u)),f=this._getLinkRect(i,r.hAlign,r.vAlign,u),f.height},u.prototype.isImeAware=function(){return!1},u.prototype.toJSON=function(){return{type:n.CellTypeKind.HyperLinkCellType,linkColor:this._linkColor,visitedLinkColor:this._visitedLinkColor,text:this._text,linkToolTip:this._linkToolTip,target:this._target}},u.prototype.fromJSON=function(n){if(!n)return;n.linkColor!==undefined&&n.linkColor!==null&&(this._linkColor=n.linkColor),n.visitedLinkColor!==undefined&&n.visitedLinkColor!==null&&(this._visitedLinkColor=n.visitedLinkColor),n.text!==undefined&&n.text!==null&&(this._text=n.text),n.linkToolTip!==undefined&&n.linkToolTip!==null&&(this._linkToolTip=n.linkToolTip),n.target!==undefined&&n.target!==null&&(this._target=n.target)},u._getUniqueId=function(){var n=th
is;return(n._id===undefined||n._id===null)&&(n._id=0),"id_"+n._id++},u._getEditorElement=function(){var i=this,n;return i._editorElement||(n=u.prototype.createEditorElement(),t.body.insertBefore(n,null),n.style.visibility=b,n.style.top="-10000px",n.style.left="-10000px",n.className="gcHyperLinkCellTypeEditor",i._editorElement=n),i._editorElement},u}(n.TextCellType),n.HyperLinkCellType=kt,yt=function(i){function r(){i.call(this)}return __extends(r,i),r.prototype.paintValue=function(t,i,r,u,f,e,o,s){n.TextCellType.prototype.paintValue.apply(this,arguments)},r.prototype._getHAlignByValueType=function(t,i,r){return n.TextCellType.prototype._getHAlignByValueType.apply(this,arguments)},r.prototype.paint=function(t,i,r,u,f,e,o,s){n.TextCellType.prototype.paint.apply(this,arguments)},r.prototype.createEditorElement=function(){},r.prototype.getEditorValue=function(n){},r.prototype.setEditorValue=function(n,t){},r.prototype.activateEditor=functi
on(n,i,r){var f,u;if(n&&n.sheet){f=$(n),u=n.sheet,this.isImeAware()&&u._eventHandler&&u._eventHandler._resetFocusHolder();var e=u._eventHandler._getCanvasOffset(),s=e.top+u._bounds.y+r.y-2,o=e.left+u._bounds.x+r.x-2;f.css("top",s),f.css("left",o),this.isImeAware()||t.body.insertBefore(n,null)}},r.prototype.deactivateEditor=function(n){n&&(n._editingLocator&&t.body.removeChild(n._editingLocator),this.isImeAware()?n.sheet&&n.sheet._eventHandler&&n.sheet._eventHandler._destroyFocusHolder():t.body.removeChild(n))},r.prototype.updateEditor=function(n,t,i){n&&$(n).width(i.width).height(i.height)},r.prototype.getHitInfo=function(n,t,i,r,u,f,e){},r.prototype.processMouseDown=function(n){},r.prototype.processMouseMove=function(n){},r.prototype.processMouseUp=function(n){},r.prototype.processMouseEnter=function(n){},r.prototype.processMouseLeave=function(n){},r.prototype.isReservedKey=function(n){return!1},r.p
rototype.isEditingValueChanged=function(n,t){return n!==t},r.prototype._getAutoFitWidth=function(n,t,i,r,u){var o=this.getAutoFitWidth(t,i,r,n._zoomFactor),e,f;return u&&(e=n._zoomFactor>1?1:n._zoomFactor,f=parseInt((n.defaults.rowHeight*e).toString(),10),o+=f),o},r.prototype._getAutoFitHeight=function(n,t,i,r){return this.getAutoFitHeight(t,i,r,n._zoomFactor)},r.prototype.getAutoFitWidth=function(n,t,i,r){return 0},r.prototype.getAutoFitHeight=function(n,t,i,r){return 0},r.prototype.isImeAware=function(){return!1},r}(n.BaseCellType),n.CustomCellType=yt})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype,n.prototype=new r},wijmo;(function(n){(function(t){var r,i,u;t.feature("filter",["core.common","conditionalFormat"]),r=function(){function i(n){this.range=n,this.reset()}return
i.prototype.setShowFilterButton=function(n){this.showFilterButton=n},i.prototype.getShowFilterButton=function(){return this.showFilterButton},i.prototype.addFilterItem=function(n,i){var u,r;if(i===undefined||i===null)throw new Error(t._StringResource.Exp_FilterItemIsNull);if(n<-1||n>=this.sheet.getColumnCount())throw new Error(t._StringResource.Exp_InvalidColumnIndex);if(!this.range)return;u=this.sheet._getActualRange(this.range);if(n<u.col||n>=u.col+u.colCount)return;r=this.filterItemMap[n],r||(r=[]),r.push(i),this.filterItemMap[n]=r},i.prototype.addAverageFilter=function(t,i){var r=new n.spread.AverageCondition(i);this.addFilterItem(t,r)},i.prototype.addBackgroundFilter=function(n,i){var r=new t.ColorCondition(t.ColorCompareType.BackgroundColor,i);this.addFilterItem(n,r)},i.prototype.addDateFilter=function(n,i,r){var u=new t.DateCondition(i,r);this.addFilterItem(n,u)},i.prototype.addForegroundFilter=function(n,i){var r=new t.ColorCondition(t.ColorCompareType.Foreground
Color,i);this.addFilterItem(n,r)},i.prototype.addNumberFilter=function(n,i,r){var u=new t.NumberCondition(i,r);this.addFilterItem(n,u)},i.prototype.addTextFilter=function(n,i,r){var u=new t.TextCondition(i,r);this.addFilterItem(n,u)},i.prototype.addTop10Filter=function(n,i,r){var u=new t.Top10Condition(i,r);this.addFilterItem(n,u)},i.prototype.removeFilterItems=function(n){this.filterItemMap[n]&&this.filterItemMap.splice(n,1,null),this.unfilter(n)},i.prototype.unfilter=function(n){if(this.sheet){var t=this;this.sheet._bindToAutoRefresh(function(n){if(n!==null&&n!==undefined)t._unfilterColumn(n);else if(t.filteredColMap)for(var i=0;i<t.filteredColMap.length;i++)t._unfilterColumn(t.filteredColMap[i])})(n)}},i.prototype._filterColumn=function(n){var i,r,u,t;this._unfilterColumn(n);if(this.filterItemMap[n]){if(this.range&&this.range.col!==-1&&(n<this.range.col||n>this.range.col+this.range.colCount-1))return;for(u=this.sheet.getRowCount(),this.ran
ge&&(i=this.range.row,r=this.range.rowCount,i===-1&&(i=0,r=u)),t=0;t<u;t++){if(this.range&&(t<i||t>=i+r)){this._addRowFilteredIn(t);continue}this._filterRowByCell(t,n)}this._setColumnFilteredState(n,!0)}},i.prototype.filter=function(n){if(this.sheet){var t=this;this.sheet._bindToAutoRefresh(function(n){if(n!==null&&n!==undefined)t._filterColumn(n);else if(t.filterItemMap)for(var i=0;i<t.filterItemMap.length;i++)t.filterItemMap[i]&&t.filterItemMap[i].length>0&&t._filterColumn(i)})(n)}},i.prototype.isHideRowFilter=function(){return!1},i.prototype.isFiltered=function(){return this.filteredColMap.length>0},i.prototype.isColumnFiltered=function(n){return this.filteredColMap.contains(n)},i.prototype.isRowFilteredOut=function(n){return this.isFiltered()?!this.filterInRows.contains(n):!1},i.prototype.reset=function(){this.filterInRows=[],this.filterItemMap=[],this.filteredColMap=[],this.filteredItems=[],this.filteredInRowsWit
hColIndexs={},this.showFilterButton=!0,this.sortInfo=null},i.prototype.isFilterHeader=function(n,i,r){var f=!1,u;return this.range&&(u=this.sheet._getActualRange(this.range,r),r===t.SheetArea.colHeader&&n===this.sheet.getRowCount(r)-1&&u.row-1<0?i>=u.col&&i<u.col+u.colCount&&(f=!0):r===t.SheetArea.viewport&&n===u.row-1&&i>=u.col&&i<u.col+u.colCount&&(f=!0)),f},i.prototype.isLastFilteredColumn=function(n){var t=this.filteredColMap.length;return t>0?this.filteredColMap[t-1]===n:!1},i.prototype.getFilterItems=function(n){var t=this.filterItemMap[n];return t||(t=[]),t},i.prototype.getFilteredItems=function(){return this.filteredItems},i.prototype.sortColumn=function(n,t){if(this.sheet){var i=this;this.sheet._bindToAutoRefresh(function(n,t){var r=i.sheet._getActualRange(i.range),f=i.sheet.isPaintSuspended(),u;i.sheet.isPaintSuspended(!0),u=i.sheet.sortRange(r.row,r.col,r.rowCount,r.colCount,!0,[{ind
ex:n,ascending:t}]),i.sheet.isPaintSuspended(f),u&&(i.sortInfo={index:n,ascending:t},i.isColumnFiltered(n)&&i.reFilter())})(n,t)}},i.prototype.getSortState=function(n){var i=t.SortState.None;return this.sortInfo&&this.sortInfo.index===n&&(i=this.sortInfo.ascending?t.SortState.Ascending:t.SortState.Descending),i},i.prototype.reFilter=function(){var n,t;this.filteredInRowsWithColIndexs={},(this.filteredItems||this.filteredItems.length>0)&&(this.filteredItems.length=0);if(this.filteredColMap||this.filteredColMap.length>0)for(n=[],n=n.concat(this.filteredColMap),this.filteredColMap.length=0,t=0;t<n.length;t++)this.filter(n[t])},i.prototype._addRowFilteredIn=function(n){this.filterInRows.contains(n)||this.filterInRows.push(n)},i.prototype._addFilteredInRowsWithColumnIndex=function(n,t){var i=this.filteredInRowsWithColIndexs[n];i===undefined||i===null?i=[t]:(i.contains(t)&&i.remove(t),i.push(t)),this.filteredInRowsWithColIndexs[n]=i
},i.prototype._addFilteredItem=function(n){this.filteredItems.contains(n)||this.filteredItems.push(n)},i.prototype._unfilterColumn=function(n){var i,t,u,r;if(!this.range)return;i=this.sheet._getActualRange(this.range);if(this.isColumnFiltered(n)){if(!(this.filteredColMap.length>1&&n===this.filteredColMap[0]))for(t=i.row;t<i.row+i.rowCount;t++)u=this._isRowfilteredOutByColumn(t,n),u&&this._addRowFilteredIn(t);this._setColumnFilteredState(n,!1),this._removeFilteredInRowsWithColumnIndex(n),this._removeFilteredItems(n)}else for(t=i.row;t<i.row+i.rowCount;t++)r=this.isRowFilteredOut(t),r||this._addRowFilteredIn(t)},i.prototype._setColumnFilteredState=function(n,t){if(t){if(this.filteredColMap.length>0)if(this.filteredColMap[this.filteredColMap.length-1]===n)return;else this.filteredColMap.remove(n);this.filteredColMap.push(n)}else this.filteredColMap.remove(n)},i.prototype._removeFilteredItems=function(n){var i,r,t,u;if(!this.filterItemMap[n])return;for(i=[],r
=[],t=0;t<this.filterItemMap.length;t++)t===n?i=i.concat(this.filterItemMap[t]):r=r.concat(this.filterItemMap[t]);for(t=0;t<i.length;t++)u=i[t],r.contains(u)||this.filteredItems.remove(u)},i.prototype._removeFilteredInRowsWithColumnIndex=function(n){var i,t;for(i in this.filteredInRowsWithColIndexs)i&&(t=this.filteredInRowsWithColIndexs[i],t&&t.contains(n)&&t.remove(n))},i.prototype._filterRowByCell=function(n,i){for(var o=this.filterItemMap[i],r,f,e,u=0;u<o.length;u++){r=o[u],r.conditionType==="RelationCondition"||r instanceof t.RelationCondition?(r.item1&&(f=this._getActualValue(r.item1,n,i),r.item1.conditionType==="Top10Condition"||r.item1 instanceof t.Top10Condition?r.item1.ranges=this._getReviseRanges(i,this.range):(r.item1.conditionType==="AverageCondition"||r.item1 instanceof t.AverageCondition)&&(r.item1.ranges=this._getReviseRanges(i,this.range))),r.item2&&(e=this._getActualValue(r.item2,
n,i),r.item2.conditionType==="Top10Condition"||r.item2 instanceof t.Top10Condition?r.item2.ranges=this._getReviseRanges(i,this.range):(r.item2.conditionType==="AverageCondition"||r.item2 instanceof t.AverageCondition)&&(r.item2.ranges=this._getReviseRanges(i,this.range)))):(f=this._getActualValue(r,n,i),r.conditionType==="Top10Condition"||r instanceof t.Top10Condition?r.ranges=this._getReviseRanges(i,this.range):(r.conditionType==="AverageCondition"||r instanceof t.AverageCondition)&&(r.ranges=this._getReviseRanges(i,this.range)));if(r.evaluate(this.sheet,n,i,f,e)){this._addRowFilteredIn(n),this._addFilteredInRowsWithColumnIndex(n,i),this._addFilteredItem(r);break}else this.filterInRows.remove(n)}},i.prototype._getReviseRanges=function(t,i){var u=[],r;return i&&(r=this.sheet._getActualRange(i),r.col<=t&&t<r.col+r.colCount&&u.push(new n.spread.Range(r.row,t,r.rowCount,1))),u},i.prototype._getActualV
alue=function(n,i,r){var u=null,f;return n.conditionType==="TextCondition"||n.conditionType==="TextLengthCondition"?u=this.sheet.getText(i,r):n.conditionType==="ColorCondition"?(f=this.sheet.getActualStyle(i,r),f&&(n.compareType===t.ColorCompareType.BackgroundColor?u=f.backColor:n.compareType===t.ColorCompareType.ForegroundColor&&(u=f.foreColor))):u=this.sheet.getValue(i,r),u},i.prototype._getCandindateDataItems=function(n,i){var f=[],e=this.sheet._getActualRange(this.range),o,r,u;if(n<e.col||n>e.col+e.colCount-1)return f;for(o=!1,r=e.row;r<e.row+e.rowCount;r++){u=this.sheet.getText(r,n);if(u===""){o=!0;continue}f.contains(u)||(this.isRowFilteredOut(r)?!this.isFiltered()||this.isLastFilteredColumn(n)&&this._isRowfilteredOutByColumn(r,n)?f.push(u):this.sheet.getRowHeight(r,t.SheetArea.viewport)>0&&f.push(u):this.sheet.getRowHeight(r,t.SheetArea.viewport)>0&&f.push(u))}return o&&i&am
p;&(i.hasBlank=!0),f},i.prototype._isRowfilteredOutByColumn=function(n,t){var r,u,i;return this.filteredColMap.length===0?!1:this.filteredInRowsWithColIndexs?(r=-1,u=this.filteredColMap.indexOf(t),u>0&&(r=this.filteredColMap[u-1]),i=this.filteredInRowsWithColIndexs[n],r>-1?i&&i.length!==0?r===i[i.length-1]:!1:this.filteredColMap.length===1?!i||i.length===0:!1):!1},i.prototype._addRows=function(t,i){var e,r,f,u,s,o;if(!this.range)return;e=this.sheet.getRowCount()-i-1,this.range.row>-1&&(r=this.range,e=r.row+r.rowCount-1,r.row<t?r.row<t&&t<r.row+r.rowCount&&this._setRangeInternal(new n.spread.Range(r.row,r.col,r.rowCount+i,r.colCount)):this._setRangeInternal(new n.spread.Range(r.row+i,r.col,r.rowCount,r.colCount)));if(this.isFiltered()&&this.filterInRows)for(f=this.filterInRows.length-1;f>=0;f--)u=this.filterInRows[f],u<t||u>e||(s=this.filterInRows[u],o=u+i,this.filterInRows[o]=s,this.filterInRows.remove(u)
);this.reFilter()},i.prototype._addColumns=function(t,i){var u,h,s,l,c,e;if(!this.range)return;if(t>=0&&this._isSortted()){for(h=0,s=0;s<i;s++)u=s+t,u>this._sorttedColumn()||h++;this._sorttedColumn(this._sorttedColumn()+h)}var f=-1,o=0,r=this.range;for(r.col>-1&&(r.col<t?r.col<t&&t<r.col+r.colCount&&(f=t,o=r.colCount-(t-r.col),this._setRangeInternal(new n.spread.Range(r.row,r.col,r.rowCount,r.colCount+i))):(f=this.range.col,this._setRangeInternal(new n.spread.Range(r.row,r.col+i,r.rowCount,r.colCount)),o=this.range.colCount)),f<0&&(f=0,o=this.sheet.getColumnCount()-i),u=f+o-1;u>=f;u--)u<t||(l=u+i,c=this.filteredColMap.indexOf(u),c<0||(this.filteredColMap[c]=l),e=this.filterItemMap[u],e&&e.length>0&&(this.filterItemMap.remove(u),this.filterItemMap[l]=e));this.reFilter()},i.prototype._removeRows=function(t,i){var o,s,r,u,f,e,h;if(!this.range)return;o=0,s=this.sheet.getRowCount()+i-1,this.range.
row>-1&&(r=this.range,o=r.row,s=r.row+r.rowCount-1,r.row<t?r.row<t&&t<r.row+r.rowCount&&this._setRangeInternal(new n.spread.Range(r.row,r.col,r.rowCount-Math.min(r.row+r.rowCount-t,i),r.colCount)):r.row===t+1?this._setRangeInternal(null):r.row+r.rowCount>t+i?r.row<t+i?this._setRangeInternal(new n.spread.Range(t,r.col,r.row+r.rowCount-(t+i),r.colCount)):this._setRangeInternal(new n.spread.Range(r.row-i,r.col,r.rowCount,r.colCount)):this._setRangeInternal(null));if(this.isFiltered()&&this.filterInRows)for(u=o;u<=s;u++)u<t||(u<t+i?this.filterInRows.remove(u):(f=u,e=this.filterInRows[f],e!==undefined&&e!==null&&(h=f-i,this.filterInRows[h]=e,this.filterInRows.remove(f))));this.reFilter()},i.prototype._setRangeInternal=function(n){this.range=n},i.prototype._updateRange=function(n){var i=this.range,o,t,f;if(i)if(n){if(!n.equals(i)){var s=i.col,a=i.colCount,r=n.col,c=n.colCount;if(s>=0||r>=0)if(this.isFiltered(
))for(s<0&&(s=0,a=this.sheet.getColumnCount()),r<0&&(r=0,c=this.sheet.getColumnCount()),t=0;t<a;t++)o=s+t,(r>o||o>=r+c)&&this.removeFilterItems(o);var e=i.row,l=i.rowCount,u=n.row,h=n.rowCount;if(e>=0||u>=0)if(this.isFiltered()&&this.filteredInRowsWithColIndexs)for(e<0&&(e=0,l=this.sheet.getRowCount()),u<0&&(u=0,h=this.sheet.getRowCount()),t=0;t<l;t++)f=e+t,(u>f||f>=u+h)&&(this.filteredInRowsWithColIndexs[f]=undefined)}}else this.reset();this._isSortted()&&(n&&n.contains(-1,this._sorttedColumn())||(this.sortInfo=null)),this._setRangeInternal(n)},i.prototype._removeColumns=function(t,i){var f,u,c,h,o;if(!this.range)return;t>=0&&this._isSortted()&&(t<=this._sorttedColumn()&&this._sorttedColumn()<t+i?this._sorttedColumn(-1):this._sorttedColumn()<t||this._sorttedColumn(this._sorttedColumn()-i));var r=this.range,e=r.col,s=r.colCount;for(e<0?(e
=0,s=this.sheet.getColumnCount()+i):s=this.range.colCount,f=t+i,u=e;u<e+s;u++)u<t||(u<f?this.removeFilterItems(u):(c=u-i,h=this.filteredColMap.indexOf(u),h<0||(this.filteredColMap[h]=c),o=this.filterItemMap[u],o&&o.length>0&&(this.filterItemMap.remove(u),this.filterItemMap[c]=o)));r.col<0||(t<r.col?f>r.col?f>r.col+r.colCount?this._setRangeInternal(null):this._setRangeInternal(new n.spread.Range(r.row,t,r.rowCount,r.col+r.colCount-f)):this._setRangeInternal(new n.spread.Range(r.row,r.col-i,r.rowCount,r.colCount)):t<r.col+r.colCount&&(f>r.col+r.colCount?this._setRangeInternal(new n.spread.Range(r.row,r.col,r.rowCount,t-r.col)):this._setRangeInternal(new n.spread.Range(r.row,r.col,r.rowCount,r.colCount-i)))),this.reFilter()},i.prototype._isSortted=function(){return this.sortInfo?this.sortInfo.index>-1&&this.getSortState(this.sortInfo.index)!==t.SortState.None:!1},i.prototype._sorttedColumn=function(n){return arguments.
length===0?this.sortInfo?this.sortInfo.index:-1:(this.sortInfo?this.sortInfo.index=n:this.sortInfo={index:n,ascending:!1},this)},i.prototype._clear=function(t,i,r,u){var o,f,e;if(!this.range)return;o=new n.spread.Range(t,i,r,u),this.showFilterButton?(f=this.range.row-1,e=this.range.rowCount+1,f<0&&(f=-1,e=-1),o.containsRange(new n.spread.Range(f,this.range.col,e,this.range.colCount))&&this.unfilter()):o.containsRange(this.range)&&this.unfilter()},i.prototype._getConditionTypeDictionary=function(){if(!this._ruleTypeDictionary){var n={};n[t.ConditionType.RelationCondition]=t.RelationCondition,n[t.ConditionType.NumberCondition]=t.NumberCondition,n[t.ConditionType.TextCondition]=t.TextCondition,n[t.ConditionType.ColorCondition]=t.ColorCondition,n[t.ConditionType.FormulaCondition]=t.FormulaCondition,n[t.ConditionType.DateCondition]=t.DateCondition,n[t.ConditionType.DateExCondition]=t.DateExCondition,n[t.ConditionType.TextLengthCondition]=t.TextLengthCondition,n
[t.ConditionType.Top10Condition]=t.Top10Condition,n[t.ConditionType.UniqueCondition]=t.UniqueCondition,n[t.ConditionType.AverageCondition]=t.AverageCondition,n[t.ConditionType.CellValueCondition]=t.CellValueCondition,n[t.ConditionType.AreaCondition]=t.AreaCondition,this._ruleTypeDictionary=n}return this._ruleTypeDictionary},i.prototype.fromJSON=function(n){var r,o,s,e,u,c,h,i,f;if(!n)return;n.range&&(r=n.range,this.range=new t.Range(r.row,r.col,r.rowCount,r.colCount));if(n.filterItemMap)for(i=0;i<n.filterItemMap.length;i++){o=n.filterItemMap[i].conditions;if(o)for(s=0;s<o.length;s++)e=o[s],u=null,e&&(c=this._getConditionTypeDictionary(),h=c[e.conType],h&&(u=new h,u.fromJSON(e),this.addFilterItem(n.filterItemMap[i].index,u)))}if(n.filteredColMap)for(i=0;i<n.filteredColMap.length;i++)f=n.filteredColMap[i],f!==undefined&&f!==null&&this._filterColumn(f);n.sortInfo&&this.sortColumn(n.sortInfo.index,n.sortInfo.ascending),n.showFilte
rButton!==null&&n.showFilterButton!==undefined&&(this.showFilterButton=n.showFilterButton)},i.prototype.toJSON=function(){for(var f=[],i,r,t,u,n=0,e=0;n<this.filterItemMap.length;n++){i=this.filterItemMap[n];if(i){for(r=[],t=0;t<i.length;t++)u=i[t],r.push(u?u.toJSON():null);f[e++]={index:n,conditions:r}}}return{range:this.range,filterItemMap:f,filteredColMap:this.filteredColMap,sortInfo:this.sortInfo,showFilterButton:this.showFilterButton}},i}(),t.RowFilterBase=r,i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.isHideRowFilter=function(){return!0},t}(r),t.HideRowFilter=i,u=function(n){function t(t){n.call(this),this._table=t,t&&(this.sheet=t._getSheet())}return __extends(t,n),t.prototype.table=function(n){if(arguments.length===0)return this._table;this._table=n,n&&(this.sheet=n._getSheet())},t.prototype._addRows=function(t,i){n.prototype._addRows.call(this,t,i),this._table&&this._setRangeInternal(this._table.d
ataRange())},t.prototype._removeRows=function(t,i){n.prototype._removeRows.call(this,t,i),this._table&&this._setRangeInternal(this._table.dataRange())},t}(i),t._TableFilter=u})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype,n.prototype=new r},wijmo;(function(n){(function(t){function i(n,t,i,r,u){var f="<"+n+" ";return t&&(f+="id='"+t+"' "),r&&$.each(r,function(n,t){f+=n+"='"+t+"' "}),f+=i?">"+i+"</"+n+">":u===!0?">":"/>"}var r,v,h,e,a,c,s;t.feature("filter_ui",["core.common","core.stringResource","conditionalFormat","filter"]);var u="div",y="table",o="tr",f="td",p="img"
;,g="ul",w="li",nt="select",b="input";(function(n){n[n.noSortFilter=0]="noSortFilter",n[n.ascend=1]="ascend",n[n.descend=2]="descend",n[n.filter=3]="filter",n[n.filterAscend=4]="filterAscend",n[n.filterDescend=5]="filterDescend",n[n.sortAscending=6]="sortAscending",n[n.sortDescending=7]="sortDescending"})(t._FilterButtonState||(t._FilterButtonState={})),r=t._FilterButtonState,v=function(){function n(n,t,i,r,u,f,e,o){this.rowFilter=n,this.row=t,this.col=i,this.sheetArea=r,this.x=u,this.y=f,this.width=e,this.height=o}return n.prototype.getState=function(){var n=r.noSortFilter,u=this.rowFilter,i;return u?(i=u.getSortState(this.col),u.isColumnFiltered(this.col)?i===t.SortState.None?n=r.filter:i===t.SortState.Ascending?n=r.filterAscend:i===t.SortState.Descending&&(n=r.filterDescend):i===t.SortState.None?n=r.noSortFilter:i===t.SortState.Ascending?n=r.ascend:i===t
.SortState.Descending&&(n=r.descend),n):n},n}(),t._FilterButtonInfo=v,h=function(n){function t(){n.call(this)}return __extends(t,n),t.prototype.find=function(n,t,i){for(var f=this.length,r,u=0;u<f;u++){r=this[u];if(r&&r.row===n&&r.col===t&&r.sheetArea===i)return r}return null},t}(t._XArray),t._FilterButtonInfoModel=h,e="ui-menu",a=function(){function s(n,t){this.sheet=n,this.filterButtonInfo=t,this._init()}return s.prototype._init=function(){var n,f,i,s,t;this.dialogID="gc_filterDialog",this.topMenuID="gc_filterTopMenu",this.sortAscID="gc_sortAsc",this.sortDesID="gc_sortDes",this.itemListID="gc_filterItemList",this.okID="gc_filterOK",this.cancelID="gc_filterCancel",this.superPanelID="gc_filterSuperPanel",this.activeCheckItemClass="gc_filterActiveCheckItem",this.filterCheckItemName="multiselect_gc_filterItemList",this.allItemsLength=-1,n=thi
s,this._creatDom(),f=$("#"+this.dialogID),this.dialog=f.wijsheetfilterdialog({show:"blind",_filterDialog:null}),f.wijsheetfilterdialog("option","_filterDialog",this),this.dialog.parent().css("boxShadow","2px 4px 5px rgba(0,0,0,0.4)"),i=$("#"+this.topMenuID),i.menu({select:function(t,i){var r=$(i.item).attr("id");r===n.sortAscID?n._sortByUser(!0):r===n.sortDesID&&n._sortByUser(!1),n.close()}})[0].tabIndex=-1,s=i.data(e)._activate,i.data(e)._activate=function(n){this.active&&s.apply(this,arguments)};var o=$("#"+this.itemListID),r=$("#"+this.okID),u=$("#"+this.cancelID);this.itemList=o.wijsheetmultiselect().wijsheetmultiselectfilter(),r.button(),u.button(),r.unbind("click"),r.click(function(){n.dialog.wijsheetfilterdialog("close");var t=n._getCheckedValuesByUser();n._updateData(t),n._filter(t)}),u.unbind("click"),u.click(function(){
n.dialog.wijsheetfilterdialog("close")}),o.unbind("change"),o.bind("change",function(){n._setButtonState()}),$("#"+this.superPanelID).wijspreadpanelex(),t=$(".ui-multiselect-filter > input"),t.unbind(".gcSheetInternal"),t.bind("keyup.gcSheetInternal",function(){$("#"+n.superPanelID).wijspreadpanelex("refresh")}),t.bind("search.gcSheetInternal",function(){n.itemList.wijsheetmultiselect("refresh"),n.itemList.wijsheetmultiselectfilter("updateCache"),$("#"+n.superPanelID).wijspreadpanelex("refresh")})},s.prototype._setButtonState=function(){var n=this.itemList.wijsheetmultiselect("getChecked").length;n>0?$("#"+this.okID).button("option","disabled",!1):$("#"+this.okID).button("option","disabled",!0)},s.prototype._sortByUser=function(t){var r=this.filterButtonInfo.rowFilter,i;
if(!r)return;i=this.filterButtonInfo.col,this.sheet._trigger(n.spread.Events.RangeSorting,{sheet:this.sheet,sheetName:this.sheet._name,col:i,ascending:t}),r.sortColumn(i,t),this.sheet._trigger(n.spread.Events.RangeSorted,{sheet:this.sheet,sheetName:this.sheet._name,col:i,ascending:t}),this.sheet.invalidateLayout(),this.sheet.repaint()},s.prototype._getCheckedValuesByUser=function(){var n=[];return this.itemList.wijsheetmultiselect("getChecked").each(function(){n.push(this.value)}),this.allItemsLength===n.length&&(n=[]),n},s.prototype._getDomString=function(){return i(u,this.dialogID,i(y,null,i(o,null,i(f,null,i(u,null,i(u,null,"",{style:"height: 10px"})+i(u,null,i(p,null,null,{src:s.getImageSrc(r.sortAscending)},!0))+i(u,null,"",{style:"height: 5px"})+i(u,null,i(p,null,null,{src:s.getImageSrc(r.sortDescending)})),{style:"text-align: left"}),{style:"border-right: 1px solid #CCC;vertical-align: top"})+i(f,nu
ll,i(y,null,i(o,null,i(f,null,i(u,null,i(g,this.topMenuID,i(w,this.sortAscID,"<a style='cursor:default'>"+t._StringResource.SortAscending+"</a>",{style:"width: 195px",tabindex:0})+i(w,this.sortDesID,"<a style='cursor:default'>"+t._StringResource.SortDescending+"</a>",{tabindex:0}),{style:"border-width: 0;"}),{style:"text-align: left"}),{style:"border-bottom: 1px solid #CCC"}))+i(o,null,i(f,null,i(nt,this.itemListID,""))))+i(u,null,i(b,this.okID,null,{type:"button",value:t._StringResource.OK,style:"width: 80px;"})+i(b,this.cancelID,null,{type:"button",value:t._StringResource.Cancel,style:"width: 80px;"}),{style:"text-align: right;"})))),{style:"font-size: 10pt;padding: 0;display: none; overflow: hidden"})},s.prototype._hasDom=function(){return!!window.document.getElementById(this.dialogID)},s.prototype._creatDom=
function(){var i=this.sheet._getCanvas(),t,n;i&&!this._hasDom()&&(t=this._getDomString(),n=$(t)[0],i.appendChild(n))},s.prototype._initData=function(n){var u=this.filterButtonInfo.rowFilter,t,i,r;if(!u)return;t=this._getAllData(n),t.sort(function(n,t){return n>t?1:n<t?-1:0}),this._bindData(t),i=[],i=u.isColumnFiltered(n)?this._getCheckedData(n):t,r=this._getActualValues(t,i),this._setCheckedValues(r),this.itemList.wijsheetmultiselect("refresh",!0),this.itemList.wijsheetmultiselectfilter("updateCache")},s.prototype._updateData=function(n){var f=this.filterButtonInfo.col,u=this.filterButtonInfo.rowFilter,i,r,e;if(!u)return;for(u.unfilter(f),u.removeFilterItems(f),i=0;i<n.length;i++)r=n[i],r===t._StringResource.Blanks&&(r=""),e=new t.TextCondition(t.TextCompareType.EqualsTo,r,null),u.addFilterItem(f,e)},s.prototype._filter=function(t){var i=this.filterButtonInfo.rowFilter;if(!i)return;t&&t.length>0&&this.
sheet._trigger(n.spread.Events.RangeFiltering,{sheet:this.sheet,sheetName:this.sheet._name,col:this.filterButtonInfo.col,filterValues:t}),i.filter(this.filterButtonInfo.col),t&&t.length>0&&this.sheet._trigger(n.spread.Events.RangeFiltered,{sheet:this.sheet,sheetName:this.sheet._name,col:this.filterButtonInfo.col,filterValues:t}),this.sheet.invalidateLayout(),this.sheet.repaint()},s.prototype._setCheckedValues=function(n){$("#"+this.itemListID+" option").each(function(){var t=$(this).val();n.contains(t)?$(this).attr("aria-selected","true"):$(this).attr("aria-selected","false")})},s.prototype._getActualValues=function(n,i){for(var f=[],r,u=0;u<i.length;u++)r=i[u],(r===undefined||r===null||r==="")&&(r=t._StringResource.Blanks),n.contains(r)&&!f.contains(r)&&f.push(r);return f},s.prototype._bindData=function(n){var r=$("#"+this.itemListID)[0],t,i;for(r.options.le
ngth=0,t=0;t<n.length;t++)i=n[t],r.options.add(new window.Option(i,i));this.allItemsLength=r.options.length},s.prototype._getAllData=function(n){var i=[],f=this.filterButtonInfo.rowFilter,r,u;if(!f)return i;return r=this.sheet._getActualRange(f.range),n<r.col||n>r.col+r.colCount-1?i:(u={hasBlank:!1},i=f._getCandindateDataItems(n,u),u.hasBlank&&i.push(t._StringResource.Blanks),i)},s.prototype._getCheckedData=function(n){var u=[],t=this.filterButtonInfo.rowFilter,e,o,i,f,r;if(!t)return u;if(t.isColumnFiltered(n))for(e=t.range.row===-1?0:t.range.row,o=t.range.rowCount===-1?this.sheet.getRowCount():t.range.rowCount,i=e;i<e+o;i++)t.isRowFilteredOut(i)||(f=this.sheet.getValue(i,n),r=null,r=f instanceof Date?f:this.sheet.getText(i,n),u.contains(r)||u.push(r));return u},s.prototype.open=function(){var i,h,o,t,n,f,s;if(this.dialog){i=this,this._initData(this.filterButtonInfo.col);var e=$(this.sheet._getCanvas()).offset(),c=this.dialog.wijsheetfilterdialog("option&quo
t;,"width"),l=this.dialog.wijsheetfilterdialog("option","height"),u=this.filterButtonInfo.x+this.filterButtonInfo.width-c,r=this.filterButtonInfo.y+this.filterButtonInfo.height;u+=e.left-8,r+=e.top,h=$(window.document).scrollLeft(),o=$(window.document).scrollTop(),u-=h,r-=o,this.dialog.wijsheetfilterdialog({show:"blind",position:[u,r],open:function(){window.gcGlobal.suspendEvent(),$("#"+i.superPanelID).wijspreadpanelex("refresh")},close:function(){window.gcGlobal.resumeEvent(),i.sheet&&i.sheet._eventHandler._setFocus()}}),this.dialog.wijsheetfilterdialog("open"),$(".ui-multiselect-filter > input").val(""),this.itemList.wijsheetmultiselectfilter("initFirstOpenCache"),$("#"+this.dialogID+" *").removeClass("ui-state-hover"),t=this.dialog.find("ul").last(),n=0,t.find("span").each(function(t,i){n=Math.max(n,i.offsetWidth)}),f=t.f
ind("label").width(),s=t.find("input").outerWidth(!0),n+=s,n>f&&this.dialog.find("ul").last().find("label").width(n)}},s.prototype.close=function(){this.dialog&&this.dialog.wijsheetfilterdialog("close"),this.sheet&&this.sheet._eventHandler._setFocus()},s.prototype.isOpen=function(){return this.dialog?this.dialog.wijsheetfilterdialog("isOpen"):!1},s.prototype._updateResource=function(){$("#gc_filterOK").val(n.spread._StringResource.OK),$("#gc_filterCancel").val(n.spread._StringResource.Cancel),$("#gc_sortAsc a").text(n.spread._StringResource.SortAscending),$("#gc_sortDes a").text(n.spread._StringResource.SortDescending),$(".ui-multiselect-filter input[type='search']").attr("placeholder",n.spread._StringResource.Search),$(".ui-multiselect-all span:last").text(n.spread._StringResource.CheckAll),$(".ui-multiselect-none span:las
t").text(n.spread._StringResource.UncheckAll)},s.getImageSrc=function(n){if(n===r.noSortFilter)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/m
PQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEcto
upHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg
9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAMOSURBVHjaXJNdaJRHFIbfM7PfGremUTfkpxgpiheiBOmFtYUgRXNRqNnd75sEhBoIKhrwQpFUUSsihhIQ41+FNrUGqYhRY43STZqgARNRTIzRaFqz6xJTtals3K8xRQ3x7UV215+LB2bOxTNn3jMDs+mEIgmS+LwQiqSQ9JG03FHX54666pn7TLmJEZ
VIjCCRGMkYGxvNiI9FvaENZzLw/PmqtCDFV/4WkERw8TI03K6XqqrNWLBgPoafDmNwMCbd3TestpMDHpJAuIcWSZjSUrnS0SFOWamXJLpuDYAkAiYAkioYDCIej0+Lx12QrervFxOemjWfCvIyIcmTVeLVC1986OkUklhRtlgutLYrkpnOKlt1dl0BSfTHmnCnm5oTm0AS6I0xLaDLrK1PusTp/cb7/rUAyH8kSL+Vqt0ebpuGP699LCRROAdqf/suGforCpLi4DMpAOQQLAEgfE2sRDZIv5cknGxi74HDFnZ/32olk9f//vOTPIj05ZnKZpp14QlnfZgpTOXvNGsvjrvuH9MnOwAOYlhQ/UPYmxRkJVvzPHw8JF8EdrKoZEeapSt2cHDo4Sxn7R0hiV8/hEQe3Ad21jZNJQnbDklSBBas0ddvRj2Fi4qZIhaL+Q3ni8N0ZohGe4Dv6sKZfFP0kvkSWLZdGvLpiUTuTS9cVMxI5H5+fz+UfXyOto/Ns5bUL7dyjsBjTsKDbbVnM0iqYNHXYi9ZLiSlaRbFn089zlzvwN1IzkDlmDhfdiin5KgOBY5qO9iojX1K9+VRcOCXnlySsFkOkjj/WGschtR0Kt/Ga9D2aYj5DWKaIeYSxTlFMS2T66udBDbXHS94Z97ZUB8Ayt7+iVVddlkzl5LCvrklvQ9dr1fnF0IQbng5O/VQsmAJSfnxSLuqCG3Rxxpfz3xbXv0IEkzm5YR7lXOCGs6+PVNJYjaQnoKwSgBIDSqkjjPUuv3QLP9ImW+hG1/lKJtzp5jaCmW2nrNAUpOUkqrWrJUb23T5rhZf0eoWhbeEKX7O4eTPHe8DSTjF59T/AwCfnhbaDaIICgAAAABJRU5ErkJggg==";else if(n===r.ascend)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAC
XBIWXMAAA7DAAAOwwHHb6hkAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAq
lCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xT
iFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vz
DoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAALLSURBVHjadJNtaNVlGMav+/kfjy3GTDfcsQW1CMrhWSZ6AsmXmflFDts5/0eYA52i02M6tdBIRQQJBLX8Yg4xYlMEJaHphzxKzoiaZptN0MBtacyXoYIobUgT/fXhtOMS+vBw89wXXPfLdd0CLNxwyACF648YYH7tnuEYAeQbv3CA/EeHBcivazbAUo1fv6hwfYtJEjDy2XP//8vpGbA9ZiE7xQ6USs3S7sUx9YHNbMqYn1IerGmQ3pr8uYXsNUAqnZ+LvqHJAA2BeIoGT6DJbMqBbAwArR77vs4/uhOje9BxlXEcww13pXDvtwaoes1MB6iz8xfxGkIIiLCUIEXaDTxiFJOmKp5YxDcciS6jVpRi8g1H8
7PVgLYslwO0GYzf+x377ubwXoLKafXEE/WUTfC9tBIhwNTJdAPkw4R1fdkkOmJW1/LAYNBV54iDJK8HH7NPd+/9MTqeWER//62YHxrrJvCDydd99Z/tpjLboz7znQF2/vSfufwY9Ne1e9r9JtHKaUvxqWY3UgXX23dNbccOlhQUFxUN9GweVsaWIQNZRfkeByidrnDxRD19N29U5AnChkMO0BMYAwRA4GkPAKuZc/2F8JWTDlB716sCIm9PXcz1K9+/lCc4erstABQmP3U8LBvlV2VJr8yyIHMSv+LUk1QmCzADBjQnrB0dT9TT0/243NfqXx8szwaAzq6Q1bDJnWnrmlKV3EZVchvvJbfQ2nqmDLDqD0/YXFqs8t0l/Haxu3j+vOPDO9ifu4P9jwPAeSk6RE/RpHc+4KefL8waYWEDrOPX9ol/cycA1KH7pvCTsxFAPxZGXQ1YmDhlgNIHsoWQd5wONw4JxgfhwmeKXSUjXbq0Oi/j80el28UjqpdqK1ivcCB7KJwXTuHKcwWAPtPCoJkShy7kjKU3dIXLAvQyVdq1C3WVXNbE2RgUOphuqVXH3T8DAFTcPgRQEEuLAAAAAElFTkSuQmCC";else if(n===r.descend)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZ
XACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm
65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyF
vFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa
49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAJKSURBVHjanJJfSJNhFMaf9/02R9MFCVZLUOgfpLMCmwrd7KIIm6X4fXoTY1oXltaN86oEi4xodtNNeNMHJZQ0gpDQmUKEyUAiyKCFW4PNtSFMoyKJSp4uputbJIUX5+K855zfe85zDkhiza4u2+HXn4M64dcBvw5BTotLtyDJ49KvI2fapK/Q/8qkwAjYiEHj4rrBG+ft4p+AB51f8pKazxxDY/djhLYj95bJLKG5fR+w5whUVxNUtR6qOiHUrmABNH3AkgcoqsBM11O56gvVUy2GV6CQNA/WjFdkMpnyhYV0NjZOAf6ksQMZCGQL3e526fUWm0kKrlAJRT7CUXeac+Gp3bRTaJpHXsReoLl3yGQAKPUtlaJh8yHxKI0s+C3xLHHXwjIqlbXtTKc/lKTScaRSFItMAWReB4WtdfdMJCVJTI18xihLNzFCyWXC4WxjMpksjiOK5BytjXIGUH0XCowjkFsESeF27BQLSy9F/2FK0ip6wa2VtV7OxxNF8XgciUQCKpMCZFoaRdQ6PXIHshvQDtACUJDARA/tVTVe6rHrSs97mMPh16j3vQECvpKc4iSLWzrGqXWMrahnx6h1jP5oPRf8Ho1FLA5nG/c7vayq8TIajdoikRi0nqCEdn9gDaC
QLNVOXZOuk310nbhCV0Mvhx+OWlbhykGnh+Hou20sy2rUdLtbAJxUfs9PwW9PQM4qjuqjfDEd6ssX+VP56kdZ/+s80H9nZJcBYDxT6x8b+vspDw4Fbf+TuC7gpn7ZtoFCSdJE0vxrAN8Jcr/DWZzEAAAAAElFTkSuQmCC";else if(n===r.filter)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8V
iJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0
693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4
uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAMuSURBVHjaZJN/aNR1GMefz+f7/d6P3aZGDGVKERLDbXdMJAQhlr+ujWo62g5DpUBiEyJjpxi0ZRtyDSQvV0cDd2uw213b1
EHiFjbGZq5bIbc5dTuyybRyK+ZCDrG0evWHdwfWHx8+PDwPz/vzeb2fR451DGvpQB2ODJvnP24zDkewD7Zct6h9qD1j4TzPWNgsip80isbCxuS7vzinGm5aZwcwbwVPGoAhgAIEsAAN2NKxSscmYKRvE1iRPrY3Vt7Ski4WQKaJOmbjyF3WS//3jfr4hVXGEA55J5aXc+ZMdF0yOZWbFtCAKtx5zCUQLQBk32svPFJ8eHN16u+fCn6fv+MErKWlRWdvPzr9QpUVnIroxravlYz0tTvWdi9XRFGA6ugKOMPh7qHu7u5Ue3s7ra2tBIMnaG4+Sl1dHTU1NZSXl7P42x39zRxKYl82mYD8Q0wA8bjFmv855Xqzdu/swsICDx78xfz8r0xMXKa+/iBer5fx8W+PDi22PjH43pKSoi2bzIS+reVlUYCVn18q11hl9vb2GIFAgFQqxczMDKFQCK/Xy8WLF4ozkN2e00o8O07YA1KpxCUCyKYSUX1fxDQgc3NzRjAY/DMej+Pz+ejpiTkzAAEpqfpEJHeP2PZJXO32VBsbKryydY3IPZB1a3IVIH6/n1AoREVFBWmQjzknK7aLHm4bWXs5cel48uq0ziQGolE9e/uG8vsPceDttygrK8s2cBfkZ9zQ8syGbeaVyQmp3v8VNXWDvFo3SPX+8/hqzxEPjqiD9X5eqqoiN8fFjzeu5wHidh9xZTjIgZr1BqAaWi6Zm3e8z/OVDZS90kBv74AdUH7/IbZu3oJps0h8N7N62IXpLt2VnVbZWfKc+jTx+aM/3bti85RuZ3RsvBjQxFgWO9VnTSebzB+SMyvhtMMTFsv9+l4r26Czq0sxcV9F+3eprnOJwumr14ozpMMfnLV/duQjPdeDmiTiaGrutLs3Nhjujc86sxD/uHs/DxCPjFrbXly0N7ZEbR9GcPb0jz4NS/q/1P/nwlOFlYpOrZ4UkeUiOt8nRk6xyGNzT3YXTGBZeqEcgP53ACxeTB
jELwuFAAAAAElFTkSuQmCC";else if(n===r.filterAscend)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRS
swA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFi
aTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF
5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAMNSURBVHjalJNfaFt1FMfP796bm9hublCwa93AVd3W5d67ddisFFw1lovUl7r0jx2rWWW6prpCkzfrUwjVFx0LwSrYPtiO0YJPDsuwIOJKq1PL0q43iZ3OuUp04p8owmbl40PXMgaCPnzhcPjCOef7PV8BxD6WETrKjXcviUbjTlW870/ta9mqfiqv1kuRQePjk68pkj4FSfX66HRA8ujfDPapvveWN4n1xKAC5H
9CB3SRo767m9uhvRxQUGXAEXOt3uCodViWpT4Yi+tC1Rrhj99/luV8QQ43unrkxWaNVSqvXSNgHSeQSqU2A4Zt2xUdHR3bp6amwp8uTNU91jRgij2PAWg1da+sTwmeGTv768TExN8jIyOk0xlOnTpNMpkiFovR3t6O67rcuPHDJkCtr6U7zVH/gffPKrwravLzC75EIkGxWOTWrVWKxR+Zn79EPB7HdV3m5uYaAK12/xfmxm0P1uwW62D36p77nzdXVr4Txwn5h4aGVkqlEp6XJ5PJ4LouMzMzDYAGiPXkGwGJLGIAyqmPYod6sEM9vziRF0xALMvS0+n0zdnZWTo7O5mcnNwHaNevi27bqN0v+w1pWyj5AOUEjygn1I3VeLzaund/xfj4uAASi8WWM5kMLS0tAAYgV69+K5cvvyq/zZ7TpG1hzZaqbZbsDR3DPnSi2n6ka0uhUJB8Pt+QSCTo7++nqamJ204YXV1PG5aF2nFxUgn7PlGAWIefVXYoihVufcBWorLZrOTz+YMDAwN/tba2UlZWRi6Xq7itmQbb9JnU25qMvvmRAKrmoafEqY/edOqf2bljV/iebDYrgPT29q6Ew2FM06RQKFQMDw+L4ziabaP3nXwpIBy9oACVnBblHOh52N4Vqaxr7jYAFQwGty4uLm72PE/3PK8yt+QZuawnjgSN0TOiDj36nCmP9364pjiY1hJ67RX8F5dMBUjtW7Xav+Xh3PRnIiK6CF/qd/66886YHvW3Sfh8lQHfy11Z2MCegBgioknbCZQTPr1l71di/IcUqjsgLfHzvn8GACNDKumTxWELAAAAAElFTkSuQmCC";else if(n===r.filterDescend)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKTWlDQ1BQaG90b3
Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslE
D1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3M
HBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5
n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAANBSURBVHjaXJNfSGR1HMXP73fvdcYdo7Vy1KRlZ9DdnOvv5uTODK0s1mxDyKIYSRYoUwQikkgzPUS0RuW6QRCEuIiM/XuxNdiH6m17WnZFCMSHtjuOszONf0ZnGgW1iLbw9DBl0sPhy3k5HDjfD0h6w/VvSJJC8a5sOPeUYQ1TIjAuPOc+kN6Kae2JthodGBCVrSEdpmXAd8pJUrb2julgiWgJ9MMXABIXYADApQA0ACLc8Jjg9bAkKbhbD5LimDTgNQn15sc6SZD1onyPZIAUSyQOSS124oLzDxL7hwRJjaTIFbYcUJ5xB0lYp29oZ8+OypZnPhfvkXiHdGz8nHHs7++6e+vede6UiiiVio69vR2v1+2S5slqQRJ4XvdXkBS7O+uuUv43bO79UvPZp4nfr8/N/T
k7O8urVz9cu3x5zH6x76Xvuru7f+zq6joIhUKFYrHYSBJA4yVBUm5sbWPm15nqH1bvOpRScnBwcL1QKPD+/b+4vV3k0tIy4/E4I5EIFxcXu0nKckDwWUlSV6peqGCUW/mvJUmoNr82MTHBg4MD2rbNqakpRiIR3r59a5ykzOc3QBJob5txkZSbuQ00h/q5ub7htZSJ9NYmlDLF5OQkFxYW2NfXx/n5+YskhWk2G0p9IV5BXgDBAZ1k5Z07tx6wAlHmcjlHjrUim13D8vIaYrEYr12bZmdnJ0k6ygvVHi0GOD2SpHGPhApGmclkKjKZ15HJpHHzJrV4PM6RkRF2dHQwm83WeTweMTw8cCwA1YKkUwWjVMEofaFXeS99w1CksKwWIxaLsaenh1VVVUyn0yf8fmBoKCpIoqeBAr3n50DywdXVlWorEGUqufp0imnpM8eEaZpaPB5nOBymrutMpVKuM2dGdQvjGh+icfFxCCA0YJB0tKC9Mpn8qTKZhLSS0BOJUWmaprBtu8K2bW1lZeVR27alUq3SwpDBh2t1fAUN/eepkYfCOvW26/grWxNB6XukvYJJwgKE+c1zUs270TQdkmq4WeKtTwS+hETiCgUJafrb/89CWTU9/8JT9k2UnP7HN1Ag+OQV8Ps6Yb78vigj/a08ahGCaGzql/zIrbmhy/9IzAmSztMvzJz8ewAvdf7cUVI5hQAAAABJRU5ErkJggg==";else if(n===r.sortAscending)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAABy0lEQVR42pyST2gTQRTGv9nEpCnqTasHES8VLCioiF
DIYYum+I/ebFXQm1BbsdSDhKgoXhS8tLQSqAhexIInETwJIqJiexJEZXupwRJNbRsy2Z3dzHxesjGEChs/eMx7A+837817giQAYCD3cZuScqG8Wtj19tG5n/iHhBAkKcLYCh3fdSd04HXCq5xHG2oAdOAdNIG3qAJ5tW1A/9hrm8ZsV+7vDLTe2nsmP9AWwATuXe27330lLwvLkloHY5EBR0dexkB0xxKp9Ieno8MbOjYP1ZRMHz77YE8kAMk35V/fkpWSc6L3dL7Tl6uPAaAm155EAYhwjFHVOsY4AEwPXXkG7W+0EqmCodlRW17oCkrO5Pjc55lon7i2mBqenc7ETTmLFWdvaenLpijJDUBcywsAYFRwu/jja1dMWNfWKf2WEOJ43T8ihLgHACAJkpgZvNQ3kTnJG/u6Z8O7ZgNwAACbzCb5dxNVLPnQW3aKyY7EKABM2XZPcwUk5wG8qIfvSL5qtJAfHLnvF+Z2GsPr2fefipPH0luq5aXsOi3frJ+5xhSm+k/1VErOxRWlqgkrfujO/t191ZqxLeB5azbJeSFELnz9v/agVX8GAIjG5r9I9yjkAAAAAElFTkSuQmCC";else if(n===r.sortDescending)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsSAAALEgHS3X78AAAAGXRFWHRTb2Z0d2FyZQBQYWludC5ORVQgVjMuNS41Tib51gAAAXlJREFUOE9jYACCqRH5a6eGZu6cHl00d2pUwa6J7r4Xe4w1U0ByWMB/DLHJnoHbQIKzI1PEp3r6vKjVU72HQzNIGNOA6W5uYiCZmUHxM+v0Vf836KuHkWQASPGci
GznSe6+/+v01Vbh0YzdBeBwiC560GWi+aLVXEccxJ/i6KhNdBjMCM/u7be3+99hpJEK0jTJ01a0y1hjKVEGTHH31e4w1vxSrqP0tVZPbXazodqKSl2VV9W6KnOJMoCAf4mLRpAq/+pTEh4F+79aJSwGxwjJseBZdHCVa/b2/1YR00vJMsAtd+c957T1D42De17iMKARKO4NTUiuQLoLrs694IAT0PbvNrFzNYwDOv9bRc4IwGKIMVQzKCWCsBNcDVDzaafUdbfMwiZNMwnq/mIeNvkgDldsgWo+hqyZ2TVr+0egIRIgQcuomb7G/h3/zaOmaeFxBcJ2l6xtx8xDJ/6wDJ+cYhU2g8vYv/M9yABj//aLOFxRTUbU49YCALt6h216b0oVAAAAAElFTkSuQmCC";return""},s}(),t._GcFilterDialog=a;var l="ui-dialog ui-widget ui-widget-content ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},tt={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},k=$.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};$.widget("wijmo.wijsheetfilterdialog",{options:{autoOpen:!1,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!1,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:235,mo
dal:!0,position:{my:"center",at:"center",collision:"fit",using:function(n){var t=$(this).css(n).offset().top;t<0&&$(this).css("top",n.top-t)}},resizable:!1,show:null,stack:!0,title:"",width:235,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var t=this,n=t.options,f=n.title||" ",r=$.ui.dialog.getTitleId(t.element),i=(t.uiDialog=$("<div></div>")).appendTo(window.document.body).hide().addClass(l+n.dialogClass).css({zIndex:n.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){n.closeOnEscape&&i.keyCode&&i.keyCode===$.ui.keyCode.ESCAPE&&(t.close(i),i.preventDefault())}).attr({role:"dialog","aria-labelledby":r}).mousedown(functi
on(n){t.moveToTop(!1,n)}),u=t.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(i);$.isFunction(n.beforeclose)&&!$.isFunction(n.beforeClose)&&(n.beforeClose=n.beforeclose),n.draggable&&$.fn.draggable&&t._makeDraggable(),n.resizable&&$.fn.resizable&&t._makeResizable(),t._createButtons(n.buttons),t._isOpen=!1,$.fn.bgiframe&&i.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var n=this;return n.overlay&&n.overlay.destroy(),n.uiDialog.hide(),n.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),n.uiDialog.remove(),n.originalTitle&&n.element.attr("title",n.originalTitle),n},widget:function(){return this.uiDialog},close:function(n){var t=this,r,u,i;if(!1!==t._trigger("beforeClose",n))ret
urn i=t.options._filterDialog,i&&($("#"+i.dialogID+" *").removeClass("ui-state-hover"),$("#"+i.dialogID+" *").removeClass("ui-state-focus"),$("#"+i.superPanelID).unbind("wijspreadpanelexscrolled")),t.overlay&&(t.overlay.$el.unbind("mousedown.wijsheetfilterdialog-overlay"),t.overlay.destroy()),$(document).unbind("keydown.ui-dialog"),t.uiDialog.unbind("mousewheel.ui-dialog"),t.uiDialog.unbind("mouseover.wijsheetfilterdialog-overlay"),t._isOpen=!1,t.options.hide?t.uiDialog.hide(t.options.hide,function(){t._trigger("close",n)}):(t.uiDialog.hide(),t._trigger("close",n)),$.ui.dialog.overlay.resize(),t.options.modal&&(r=0,$(".ui-dialog").each(function(){this!==t.uiDialog[0]&&(u=$(this).css("z-index"),isNaN(u)||(r=Math.max(r,u)))}),$.ui.dialog.maxZ=r),t},isOpen:function(){return this._isOpen},moveToTop
:function(n,t){var i=this,r=i.options,u;return r.modal&&!n||!r.stack&&!r.modal?i._trigger("focus",t):(r.zIndex>$.ui.dialog.maxZ&&($.ui.dialog.maxZ=r.zIndex),i.overlay&&($.ui.dialog.maxZ+=1,i.overlay.$el.css("z-index",$.ui.dialog.overlay.maxZ=$.ui.dialog.maxZ)),u={scrollTop:i.element.attr("scrollTop"),scrollLeft:i.element.attr("scrollLeft")},$.ui.dialog.maxZ+=1,i.uiDialog.css("z-index",$.ui.dialog.maxZ),i.element.attr(u),i._trigger("focus",t),i)},open:function(){if(this._isOpen)return;var n=this,r=n.options,i=n.uiDialog;return n.overlay=r.modal?new $.ui.dialog.overlay(n):null,n._size(),n._position(r.position),i.show(r.show),n.moveToTop(!0),r.modal&&($(document).bind("keydown.ui-dialog",function(t){var r=n.options._filterDialog,e,k,y,g,s,b,l,v,d,h,p,w,a;if(!(r&&r.dialogID))return;e=null,e===null&&(s=$("#"+r.dialogID+" .ui-state-hover"),s.
length>0&&(k=$(s[0]).children("input"),k.length>0&&(y=k[0],y.name&&y.name.toLowerCase()==="multiselect_gc_filteritemlist"&&(e=y)),e===null&&(g=s[0].parentNode,(g.id==="gc_sortAsc"||g.id==="gc_sortDes")&&(e=s[0].parentNode)),e===null&&(e=s[0]))),e===null&&(s=$("#"+r.dialogID+" .ui-state-focus"),s.length>0&&(e=s[0])),e===null&&(e=t.target);if(t.keyCode===$.ui.keyCode.ENTER){b=e.id,b===r.sortAscID?(r._sortByUser(!0),r.close()):b===r.sortDesID&&(r._sortByUser(!1),r.close());return}else if(t.keyCode!==$.ui.keyCode.TAB&&t.keyCode!==$.ui.keyCode.DOWN&&t.keyCode!==$.ui.keyCode.UP)return;l=!0;switch(t.keyCode){case $.ui.keyCode.TAB:t.shiftKey&&(l=!1);break;case $.ui.keyCode.UP:l=!1;break}var o=$(":tabbable",n.uiDialog[0]),f=$.inArray(e,o),u=null,c=f>=0?o[f]:null;if(c&&c.name&&c.name===
r.filterCheckItemName)if(t.keyCode===$.ui.keyCode.TAB){for(v=null,d=null,h=0;h<o.length;h++)p=o[h],p.name&&p.name===r.filterCheckItemName&&(v===null&&(v=o[h-1]),d=o[h+1]);u=l?d:v}return u===null&&(f=f!==-1?l?f===o.length-1?0:f+1:f===0?o.length-1:f-1:0,u=o[f],u.name&&u.name===r.filterCheckItemName&&(c&&c.name&&c.name===r.filterCheckItemName||(w=$("#"+r.superPanelID+" ."+r.activeCheckItemClass),w.length>0&&(u=$(w[0]).children("input")[0])))),$("#"+r.dialogID+" *").removeClass("ui-state-hover"),$("#"+r.dialogID+" *").removeClass("ui-state-focus"),u.name&&u.name===r.filterCheckItemName?(a=u.parentNode,$("#"+r.superPanelID+" *").removeClass(r.activeCheckItemClass),$(a).addClass("ui-state-hover "+r.activeCheckItemClass),$("#"+r.superPanelID).wijspreadpanelex("needToScroll
",a)?($("#"+r.superPanelID).wijspreadpanelex("scrollChildIntoView",a),i.focus()):$(u).focus().addClass("ui-state-focus ui-state-hover"),!1):u.id==="gc_sortAsc"||u.id==="gc_sortDes"?(n.uiDialog.focus(1),$(u).children("a").addClass("ui-state-focus ui-state-hover"),!1):($(u).focus(1).addClass("ui-state-focus"),!1)}),n.options._filterDialog&&$("#"+n.options._filterDialog.superPanelID).bind("wijspreadpanelexscrolled",function(){var r=n.options._filterDialog,u=$("#"+r.dialogID+" .ui-state-hover"),t,i;u.length>0&&(t=$(u[0]).children("input"),t.length>0&&(i=t[0],i.name&&i.name===r.filterCheckItemName&&($("#"+r.superPanelID).wijspreadpanelex("needToScroll",t[0])||$(t[0]).focus().addClass("ui-state-focus ui-state-hover"))))}),i.bind("mousewheel.ui-dialog",function(n){return!1
}),i.bind("mouseover.wijsheetfilterdialog-overlay",function(t){var u=n.options._filterDialog,h,e,f,s;if(!(u&&u.dialogID))return;$("#"+u.dialogID+" .ui-state-hover").removeClass("ui-state-hover"),$("#"+u.dialogID+" .ui-state-focus").removeClass("ui-state-focus"),document.activeElement&&document.activeElement.nodeName.toLowerCase()==="input"&&document.activeElement.type.toLowerCase()==="search"||i.focus(),h=function(){var n=$(t.target);$(this).find(".ui-state-default").each(function(){if(n.closest(this).length>0){$(this).addClass("ui-state-hover");return}})},$("#"+u.dialogID+" .wijmo-wijsuperpanel-vbarcontainer").each(h),$("#"+u.dialogID+" .wijmo-wijsuperpanel-hbarcontainer").each(h);var o=$(":tabbable",this),c=$.inArray(t.target,o),r=null;if(c!==-1)r=o[c];else{e=$(t.target).children("input"
),e.length>0&&(f=e[0],f.name&&f.name===u.filterCheckItemName&&(r=f)),r===null&&(e=$(t.target.parentNode).children("input"),e.length>0&&(f=e[0],f.name&&f.name===u.filterCheckItemName&&(r=f)));if(r===null)for(s=0;s<o.length;s++)if($(t.target).closest(o[s]).length>0){r=o[s];break}}if(r!==null){if(r.nodeName.toLowerCase()==="input"&&r.type.toLowerCase()==="search")return;if(r.name&&r.name===u.filterCheckItemName){$(r.parentNode).addClass("ui-state-hover");return}if(r.id==="gc_sortAsc"||r.id==="gc_sortDes"){$(r).children("a").addClass("ui-state-hover");return}$(r).addClass("ui-state-hover")}}),n.overlay.$el.css({opacity:0}),n.overlay.$el.bind("mousedown.wijsheetfilterdialog-overlay",function(i){n.isOpen()&&(n.close(),t.util.cancelDefault(i))}),$(window).trigger("resize.dialog-overlay")),$(
n.element.find(":tabbable").get().concat(i.find(".ui-dialog-buttonpane :tabbable").get().concat(i.get()))).eq(0).focus(),n._isOpen=!0,n._trigger("open"),i.focus(1),n.options._filterDialog&&$("#"+n.options._filterDialog.superPanelID).wijspreadpanelex("scrollTo",0,0),n},_createButtons:function(n){var t=this,r=!1,i=$("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),u=$("<div></div>").addClass("ui-dialog-buttonset").appendTo(i);t.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof n=="object"&&n!==null&&$.each(n,function(){return!(r=!0)}),r&&($.each(n,function(n,i){i=$.isFunction(i)?{click:i,text:n}:i;var r=$('<button type="button"></button>').click(function(){i.click.apply(t.element[0],arguments)}).appendTo(u);$.each(i,function(n,t){if(n==="click")retur
n;n in k?r[n](t):r.attr(n,t)}),$.fn.button&&r.button()}),i.appendTo(t.uiDialog))},_makeDraggable:function(){function t(n){return{position:n.position,offset:n.offset}}var n=this,u=n.options,i=$(window.document),r;n.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(i,f){r=u.height==="auto"?"auto":$(this).css("height"),$(this).height($(this).height()).addClass("ui-dialog-dragging"),n._trigger("dragStart",i,t(f))},drag:function(i,r){n._trigger("drag",i,t(r))},stop:function(f,e){u.position=[e.position.left-i.scrollLeft(),e.position.top-i.scrollTop()],$(this).removeClass("ui-dialog-dragging").css("height",r),n._trigger("dragStop",f,t(e)),$.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function r(n){return{originalPosition:n.originalPosition,originalSize:n.origi
nalSize,position:n.position,size:n.size}}n=n===undefined?this.options.resizable:n;var t=this,i=t.options,u=t.uiDialog.css("position"),f=typeof n=="string"?n:"n,e,s,w,se,sw,ne,nw";t.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:t.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:t._minHeight(),handles:f,start:function(n,i){$(this).addClass("ui-dialog-resizing"),t._trigger("resizeStart",n,r(i))},resize:function(n,i){t._trigger("resize",n,r(i))},stop:function(n,u){$(this).removeClass("ui-dialog-resizing"),i.height=$(this).height(),i.width=$(this).width(),t._trigger("resizeStop",n,r(u)),$.ui.dialog.overlay.resize()}}).css("position",u).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var n=this.options;return n.height==="auto"?n.minHeight:Ma
th.min(n.minHeight,n.height)},_position:function(n){var i=[],u=[0,0],r;n?((typeof n=="string"||typeof n=="object"&&"0"in n)&&(i=n.split?n.split(" "):[n[0],n[1]],i.length===1&&(i[1]=i[0]),$.each(["left","top"],function(n,t){+i[n]===i[n]&&(u[n]=i[n],i[n]=t)}),n={my:i.join(" "),at:i.join(" "),offset:u.join(" ")}),n=$.extend({},$.ui.dialog.prototype.options.position,n)):n=$.ui.dialog.prototype.options.position,r=this.uiDialog.is(":visible"),r||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}),t.util.position(this.uiDialog,$.extend({of:window},n)),r||this.uiDialog.hide()},_setOptions:function(n){var r=this,t={},i=!1;$.each(n,function(n,u){r._setOption(n,u),n in d&&(i=!0),n in tt&&(t[n]=u)}),i&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",t)},_setOption:function(n,
t){var r=this,i=r.uiDialog,f,u;switch(n){case"beforeclose":n="beforeClose";break;case"buttons":r._createButtons(t);break;case"dialogClass":i.removeClass(r.options.dialogClass).addClass(l+t);break;case"disabled":t?i.addClass("ui-dialog-disabled"):i.removeClass("ui-dialog-disabled");break;case"draggable":f=i.is(":data(draggable)"),f&&!t&&i.draggable("destroy"),!f&&t&&r._makeDraggable();break;case"position":r._position(t);break;case"resizable":u=i.is(":data(resizable)"),u&&!t&&i.resizable("destroy"),u&&typeof t=="string"&&i.resizable("option","handles",t),u||t===!1||r._makeResizable(t);break}$.Widget.prototype._setOption.apply(r,arguments)},_size:function(){var n=this.options,i,t,u=this.uiDialog.is(":visible"),r;this.element.show().css({width:&qu
ot;auto",minHeight:0,height:0}),n.minWidth>n.width&&(n.width=n.minWidth),i=this.uiDialog.css({height:"auto",width:n.width}).height(),t=Math.max(0,n.minHeight-i),n.height==="auto"?$.support.minHeight?this.element.css({minHeight:t,height:"auto"}):(this.uiDialog.show(),r=this.element.css("height","auto").height(),u||this.uiDialog.hide(),this.element.height(Math.max(r,t))):this.element.height(Math.max(n.height-i,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),c=0,$.widget("wijmo.wijsheetmultiselect",{options:{header:!0,height:175,minWidth:200,classes:"",checkAllText:t._StringResource.CheckAll,uncheckAllText:t._StringResource.UncheckAll,noneSelectedText:"Select options",selectedText:"# selected",selectedList:0,show:"",hide:"",autoOpen:!1,multiple:!0,position:{}},_cre
ate:function(){var f=this.element.hide(),n=this.options;this.speed=$.fx.speeds._default,this._isOpen=!1;var i=(this.menu=$("<div />")).addClass("ui-multiselect-menu ui-widget ui-corner-all").addClass(n.classes).insertAfter(f),u=(this.header=$("<div />")).addClass("ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix").appendTo(i),o=(this.headerLinkContainer=$('<ul style="cursor: pointer" />')).addClass("ui-helper-reset").html(function(){return n.header===!0?'<li><a class="ui-multiselect-all"><span class="ui-icon ui-icon-check"></span><span>'+t._StringResource.CheckAll+'</span></a></li><li><a class="ui-multiselect-none"><span class="ui-icon ui-icon-closethick"></span><span>'+t._StringResource.UncheckAll+"</span></a></li>":typeof n.header=="
string"?"<li>"+n.header+"</li>":""}).appendTo(u),r=$("<div id='gc_filterSuperPanel' />").addClass("ui-multiselect-superpanel").appendTo(i),e=(this.checkboxContainer=$("<ul />")).addClass("ui-multiselect-checkboxes ui-helper-reset").appendTo(r);this._bindEvents(),this.refresh(!0),n.multiple||i.addClass("ui-multiselect-single")},_init:function(){this.options.header===!1&&this.header.hide(),this.options.multiple||this.headerLinkContainer.find(".ui-multiselect-all, .ui-multiselect-none").hide(),this.options.autoOpen&&this.open(),this.element.is(":disabled")&&this.disable()},refresh:function(n){var u=this.element,f=this.options,e=this.menu,o=this.checkboxContainer,i=[],t=[],r=u.attr("id")||c++;u.find("option").each(function(n){var y=$(this),c=this.parentNode,l=this.innerHTML,v=this.title,a=this.value,s=this.id||"
ui-multiselect-"+r+"-option-"+n,e=this.disabled,h=y.attr("aria-selected"),o=["ui-corner-all"],u;c.tagName.toLowerCase()==="optgroup"&&(u=c.getAttribute("label"),$.inArray(u,i)===-1&&(t.push('<li class="ui-multiselect-optgroup-label"><a href="#">'+u+"</a></li>"),i.push(u))),e&&o.push("ui-state-disabled"),h&&!f.multiple&&o.push("ui-state-active"),t.push('<li class="'+(e?"ui-multiselect-disabled":"")+'">'),t.push('<label for="'+s+'" title="'+v+'" class="'+o.join(" ")+'">'),t.push('<input id="'+s+'" name="multiselect_'+r+'" type="'+(f.multiple?"checkbox":"radio")+'" value="'+a+'" title="'+l+'"'),h==="true"&&(t.push(' checked="checked"'),t.pu
sh(' aria-selected="true"')),e&&(t.push(' disabled="disabled"'),t.push(' aria-disabled="true"')),t.push(' /><span style="font-weight:normal">'+l+"</span></label></li>")}),o.html(t.join("")),this.labels=e.find("label"),n||this._trigger("refresh")},update:function(){var n=this.options,u=this.labels.find("input"),r=u.filter("[checked]"),i=r.length,t;return t=i===0?n.noneSelectedText:$.isFunction(n.selectedText)?n.selectedText.call(this,i,u.length,r.get()):/\d/.test(n.selectedList)&&n.selectedList>0&&i<=n.selectedList?r.map(function(){return $(this).next().text()}).get().join(", "):n.selectedText.replace("#",i).replace("#",u.length)},_bindEvents:function(){function t(){return n[n._isOpen?"close":"open"](),!1}var n=this;this.header.delegate("a","click.multiselect",
function(t){$(this).hasClass("ui-multiselect-close")?n.close():(n[$(this).hasClass("ui-multiselect-all")?"checkAll":"uncheckAll"](),n.element.trigger("change")),t.preventDefault()}),this.menu.delegate("li.ui-multiselect-optgroup-label a","click.multiselect",function(t){t.preventDefault();var f=$(this),i=f.parent().nextUntil("li.ui-multiselect-optgroup-label").find("input:visible:not(:disabled)"),r=i.get(),u=f.parent().text();if(n._trigger("beforeoptgrouptoggle",t,{inputs:r,label:u})===!1)return;n._toggleChecked(i.filter("[checked]").length!==i.length,i),n._trigger("optgrouptoggle",t,{inputs:r,label:u,checked:r[0].checked})}).delegate("label","mouseenter.multiselect",function(){$(this).hasClass("ui-state-disabled")||n.labels.removeClass("ui-state-hover")}).delegate("label","keydown.multiselect",function(n){
n.preventDefault();switch(n.which){case 9:case 27:break;case 38:case 40:case 37:case 39:break;case 13:$(this).find("input")[0].click();break}}).delegate('input[type="checkbox"], input[type="radio"]',"click.multiselect",function(t){var r=$(this),u=this.value,i=this.checked,f=n.element.find("option");if(this.disabled||n._trigger("click",t,{value:u,text:this.title,checked:i})===!1){t.preventDefault();return}r.focus(),r.attr("aria-selected",i),$("#gc_filterSuperPanel *").removeClass("gc_filterActiveCheckItem"),$(this.parentNode).addClass("gc_filterActiveCheckItem"),f.each(function(){this.value===u?this.selected=i:n.options.multiple||(this.selected=!1)}),n.options.multiple||(n.labels.removeClass("ui-state-active"),r.closest("label").toggleClass("ui-state-active",i),n.close()),n.element.trigger("change"),window.setTimeout($.proxy(n.update,n),10)}),$(w
indow.document).bind("mousedown.multiselect",function(t){!n._isOpen||$.contains(n.menu[0],t.target)||$.contains(n.button[0],t.target)||t.target===n.button[0]||n.close()}),$(this.element[0].form).bind("reset.multiselect",function(){window.setTimeout($.proxy(n.refresh,n),10)})},_traverse:function(n,t){var f=$(t),i=n===38||n===37,u=f.parent()[i?"prevAll":"nextAll"]("li:not(.ui-multiselect-disabled, .ui-multiselect-optgroup-label)")[i?"last":"first"](),r;u.length?u.find("label").trigger("mouseover"):(r=this.menu.find("ul").last(),this.menu.find("label")[i?"last":"first"]().trigger("mouseover"),r.scrollTop(i?r.height():0))},_toggleState:function(n,t){return function(){this.disabled||(this[n]=t),t?this.setAttribute("aria-selected",!0):this.removeAttribute("aria-selected")}},_toggleChecked:function(n,t){var i=t&&t.length?t:t
his.labels.find("input"),u=this,r;i.each(this._toggleState("checked",n)),i.eq(0).focus(),this.update(),r=i.map(function(){return this.value}).get(),this.element.find("option").each(function(){!this.disabled&&$.inArray(this.value,r)>-1&&u._toggleState("selected",n).call(this)}),i.length&&this.element.trigger("change")},_toggleDisabled:function(n){this.button.attr({disabled:n,"aria-disabled":n})[n?"addClass":"removeClass"]("ui-state-disabled"),this.menu.find("input").attr({disabled:n,"aria-disabled":n}).parent()[n?"addClass":"removeClass"]("ui-state-disabled"),this.element.attr({disabled:n,"aria-disabled":n})},open:function(n){var h=this,r=this.button,u=this.menu,e=this.speed,i=this.options;if(this._trigger("beforeopen")===!1||r.hasClass("ui-state-disabled")||this._isOpen)return;var s=u.find
("ul").last(),f=i.show,o=r.offset();$.isArray(i.show)&&(f=i.show[0],e=i.show[1]||h.speed),s.scrollTop(0).height(i.height),$.ui.position&&!$.isEmptyObject(i.position)?(i.position.of=i.position.of||r,u.show(),t.util.position(u,i.position),u.hide().show(f,e)):u.css({top:o.top+r.outerHeight(),left:o.left}).show(f,e),this.labels.eq(0).trigger("mouseover").trigger("mouseenter").find("input").trigger("focus"),r.addClass("ui-state-active"),this._isOpen=!0,this._trigger("open")},close:function(){if(this._trigger("beforeclose")===!1)return;var n=this.options,i=n.hide,t=this.speed;$.isArray(n.hide)&&(i=n.hide[0],t=n.hide[1]||this.speed),this.menu.hide(i,t),this.button.removeClass("ui-state-active").trigger("blur").trigger("mouseleave"),this._isOpen=!1,this._trigger("close")},enable:function(){this._toggleDisabled(!1)},disable:function(){this._toggleDis
abled(!0)},checkAll:function(n){this._toggleChecked(!0),this._trigger("checkAll")},uncheckAll:function(){this._toggleChecked(!1),this._trigger("uncheckAll")},getChecked:function(){return this.menu.find("input:checked")},destroy:function(){return $.Widget.prototype.destroy.call(this),this.menu.remove(),this.element.show(),this},isOpen:function(){return this._isOpen},widget:function(){return this.menu},_setOption:function(n,t){var i=this.menu;switch(n){case"header":i.find("div.ui-multiselect-header")[t?"show":"hide"]();break;case"checkAllText":i.find("a.ui-multiselect-all span").eq(-1).text(t);break;case"uncheckAllText":i.find("a.ui-multiselect-none span").eq(-1).text(t);break;case"height":i.find("ul").last().height(parseInt(t,10));break;case"minWidth":this.options[n]=parseInt(t,10),this._setButtonWidth(),this._setMenuWidth();break;case"selec
tedText":case"selectedList":case"noneSelectedText":this.options[n]=t,this.update();break;case"classes":i.add(this.button).removeClass(this.options.classes).addClass(t);break}$.Widget.prototype._setOption.apply(this,arguments)}}),s=/[\-\[\]{}()*+?.,\\\^$|#\s]/g,$.widget("wijmo.wijsheetmultiselectfilter",{options:{label:"",width:165,placeholder:t._StringResource.Search,autoReset:!1},_create:function(){var n=this,i=this.options,r=this.instance=$(this.element).data("wijmo-wijsheetmultiselect"),e=this.header=r.menu.find(".ui-multiselect-header").addClass("ui-multiselect-hasfilter"),f=this.wrapper=$('<div class="ui-multiselect-filter">'+(i.label.length?i.label:"")+'<input placeholder="'+t._StringResource.Search+'" type="search"'+(/\d/.test(i.width)?'style="width:'+i.width+'px"':"")+" /></div>").prependTo(this.header),u
;this.inputs=r.menu.find('input[type="checkbox"], input[type="radio"]'),this.input=f.find("input").bind({keydown:function(n){n.which===13&&n.preventDefault()},keyup:function(t){switch(t.keyCode){case $.ui.keyCode.TAB:case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:return;default:$.proxy(n._handler(t),n)}}}),this.updateCache(),r._toggleChecked=function(t,i){var r=i&&i.length?i:this.labels.find("input"),f=this,e=n.instance._isOpen?":disabled, :hidden":":disabled",u;r=r.not(e).each(this._toggleState("checked",t)),this.update(),u=r.map(function(){return this.value}).get(),this.element.find("option").filter(function(){!this.disabled&&$.inArray(this.value,u)>-1&&f._toggleState("selected",t).call(this)})},u=$(window.document).bind("wijsheetmultiselectrefresh",function(){n.updateCache(),n._handler()}),this.options.a
utoReset&&u.bind("wijsheetmultiselectclose",$.proxy(this._reset,this))},_handler:function(n){var f=$.trim(this.input[0].value.toLowerCase()),i=this.rows,t=i.find("input"),e=this.cache,r,u;f?(i.hide(),t.prop("checked",!1),u=new RegExp(f.replace(s,"\\$&"),"gi"),this._trigger("filter",n,$.map(e,function(n,r){if(n.search(u)!==-1){i.eq(r).show();var f=t.get(r);return $(f).prop("checked",!0),f}return null}))):(i.show(),this._firstOpenCache?(t.prop("checked",!1),r=this,$.each(t,function(n,t){$.inArray(t.value,r._firstOpenCache)!==-1&&$(t).prop("checked",!0)})):this.initFirstOpenCache()),this.instance.menu.find(".ui-multiselect-optgroup-label").each(function(){var n=$(this),t=n.nextUntil(".ui-multiselect-optgroup-label").filter(function(){return $.css(this,"display")!=="none"}).length;n[t?"show":"hide"]()}),this.instance.el
ement.trigger("change")},initFirstOpenCache:function(){var t=this.rows,i=t.find("input"),n;this._firstOpenCache=[],n=this,$.each(i,function(t,i){$(i).prop("checked")===!0&&n._firstOpenCache.push(i.value)})},_reset:function(){this.input.val("").trigger("keyup")},updateCache:function(){this.rows=this.instance.menu.find(".ui-multiselect-checkboxes li:not(.ui-multiselect-optgroup-label)"),this.cache=this.element.children().map(function(){var n=$(this);return this.tagName.toLowerCase()==="optgroup"&&(n=n.children()),n.map(function(){return this.innerHTML.toLowerCase()}).get()}).get()},widget:function(){return this.wrapper},destroy:function(){$.Widget.prototype.destroy.call(this),this.input.val("").trigger("keyup"),this.wrapper.remove()}})})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(t){function r(t,i,r,u){return new n.spread.Range(t,
i,r,u)}function h(n){return new t._DateTimeHelper(n)}function o(n){return typeof n=="string"?!1:t.FormatConverter.IsNumber(n)}function c(n){return t._DateTimeHelper.fromOADate(n)}function l(i,r,u,f,e,o){return function(i,u,f,e){if(!t.util.hasCalc())return null;var s=n.spread.Calc.Functions.findGlobalFunction(r),o=s.evaluate([u,f,e]);return o[0][0]}(u,f,e,o)}var i,s,u,v,e,f,a;t.feature("fill",["core.common","core.globalize","core.stringResource","formatter"]),function(n){n[n.Direction=0]="Direction",n[n.Linear=1]="Linear",n[n.Growth=2]="Growth",n[n.Date=3]="Date",n[n.Auto=4]="Auto"}(t.FillType||(t.FillType={})),i=t.FillType,function(n){n[n.Day=0]="Day",n[n.Weekday=1]="Weekday",n[n.Month=2]="Month",n[n.Year=3]="Year"}(t.FillDateUnit||(t.FillDateUnit={})),s=t.FillDateUnit,u=Math.floor,v=function(){function n(n){this._sheet=n}return n}(),e
=function(){function i(n){this._indexes=[],this._innerValues=[],this._type=null,this._startIndex=n===undefined||n===null?-1:n}return i.prototype.dataCount=function(){return this._innerValues.length},i.prototype.values=function(){var r,n,i,t;if(this._innerValues.length>0){for(r=[],n=0;n<this._innerValues.length;n++)i=this._innerValues[n],t=this._type==="object"?this.toDateTime(i):i,r.push(t);return r}return[]},i.prototype.indexes2=function(){var r=this._indexes.length,f,u,i;if(r>0&&t.util.hasCalc()){for(f=this._startIndex,f===-1&&(f=this._indexes[0]),u=new Array(1),u[0]=new Array(r),i=0;i<r;i++)u[0][i]=this._indexes[i]-f+1;return new n.spread.Calc._ConcreteArray(u,r)}return null},i.prototype.values2=function(){var r=this._innerValues.length,i;return r>0&&t.util.hasCalc()?(i=[this._innerValues],new n.spread.Calc._ConcreteArray(i,r)):null},i.prototype.insert=function(n,i,r){if(!o(r))throw new Error(t._StringResource.Exp_NumberOnly);(this
._type===undefined||this._type===null)&&(this._type=r instanceof Date?"date":"number"),new t._ArrayHelper(this._indexes).insert(n,i),new t._ArrayHelper(this._innerValues).insert(n,this.toDouble(r))},i.prototype.add=function(n,t){(this._type===undefined||this._type===null)&&(this._type=t instanceof Date?"date":"number"),this._indexes.push(n),this._innerValues.push(this.toDouble(t))},i.prototype.toActualValue=function(n){var t;return t=this._type==="date"?this.toDateTime(n):n},i.prototype.toDouble=function(n){return t.FormatConverter.ToDouble(n)},i.prototype.toDateTime=function(i){var r=null;if(i instanceof Date)r=i;else if(t.util.hasCalc())try{r=n.spread.Calc.Convert.toDateTime(i)}catch(u){r=i}return r},i}(),f=function(){function n(){}return n.TREND=function(n,t,i,r){return l(this,"Trend",n,t,i,r)},n.GROWTH=function(n,t,i,r){return l(this,"Growth",n,t,i,r)},n.FORECAST=function(n,t,i,r){return l(this
,"Forecast",n,t,i,r)},n}(),a=function(){function l(n){this._worksheet=n,this._fillCache=new v(n)}return l.prototype.fillLinear=function(n,t,r,u){(r===undefined||r===null)&&(u===undefined||u===null)?this.seriesTrendFillRange(n,t,i.Linear):this.seriesFillRange(n,t,i.Linear,r,u,null)},l.prototype.fillGrowth=function(n,t,r,u){(r===undefined||r===null)&&(u===undefined||u===null)?this.seriesTrendFillRange(n,t,i.Growth):this.seriesFillRange(n,t,i.Growth,r,u,null)},l.prototype.fillDate=function(n,t,r,u,f){this.seriesFillRange(n,t,i.Date,u,f,r)},l.prototype.seriesTrendFillRange=function(n,i,r,u){var v=this.fixRange(n),c=v.row,l=v.col,y=v.rowCount,a=v.colCount,f,e,o,s,h;if(this.hasSpans(c,l,y,a))throw new Error(t._StringResource.Exp_RangeContainsMergedCell);if(i===t.FillSeries.Row)for(s=c;s<c+y;s++){f=this.getSeriesSource(s,l,1,a,i);if(f&&f.dataCount()>0){e=this.calcSeriesTrendData(f,a,r);if(e&&e.length>0)for(o=0;o<e.length;o++)if(u)return
f.toActualValue(e[o]);else this.copyCell(this._worksheet,s,f._indexes[0],s,l+o,f.toActualValue(e[o]),r)}}else if(i===t.FillSeries.Column)for(h=l;h<l+a;h++){f=this.getSeriesSource(c,h,y,1,i);if(f&&f.dataCount()>0){e=this.calcSeriesTrendData(f,y,r);if(e&&e.length>0)for(o=0;o<e.length;o++)if(u)return f.toActualValue(e[o]);else this.copyCell(this._worksheet,f._indexes[0],h,c+o,h,f.toActualValue(e[o]),r)}}},l.prototype.getSeriesSource=function(n,i,r,u,f){var s=null,h,l,c;if(f===t.FillSeries.Row){l=i+u-1;while(l>=i)h=this._worksheet.getValue(n,l),o(h)&&(s||(s=new e(i)),s.insert(0,l,h)),l--}else if(f===t.FillSeries.Column){c=n+r-1;while(c>=n)h=this._worksheet.getValue(c,i),o(h)&&(s||(s=new e(n)),s.insert(0,c,h)),c--}return s},l.prototype.calcSeriesTrendData=function(n,r,u){var o,e;if(n&&n.dataCount()>0&&t.util.hasCalc())if(u===i.Linear||u===i.Growth){for(o=[],n.dataCount()===1&&(u===i.Linear?n.add(n._indexes[0]+1
,n.toActualValue(n._innerValues[0]+1)):u===i.Growth&&n.add(n._indexes[0]+1,n.values()[0])),e=0;e<r;e++)u===i.Linear?o.push(f.TREND(this._worksheet,n.values2(),n.indexes2(),e+1)):u===i.Growth&&o.push(f.GROWTH(this._worksheet,n.values2(),n.indexes2(),e+1));return o}return null},l.prototype.fillAuto=function(n,i,r){var s=this._worksheet,f=this.fixRange(n),h=f.row,c=f.col,o=f.rowCount,e=f.colCount,u=this.fixRange(s._eventHandler._dragFillStartRange);if(u){if(this.hasPartSpans(u.row,u.col,u.rowCount,u.colCount)||this.hasPartSpans(h,c,o,e))throw new Error(t._StringResource.Exp_ChangeMergedCell);return this.autoFillRange(u,o,e,i,r)}},l.prototype.fixRange=function(n){var i=n.row,t=n.col,f=n.rowCount,u=n.colCount;return i===-1&&(i=0,f=this._worksheet.getRowCount()),t===-1&&(t=0,u=this._worksheet.getColumnCount()),r(i,t,f,u)},l.prototype.autoFillRange=function(n,f,e,o,s){var h,c,a,l;if(o===t.FillSeries.Row){h=u(e/n.colCount),c=e%n.colCount;if(h>1&&
;!s)for(l=1;l<h;l++)a=r(n.row,n.col+l*n.colCount,n.rowCount,n.colCount),this.copyRange(n,a,o,i.Auto,s);s&&h>1&&c===0&&(h=h-1,c=n.colCount);if(h>0&&c>0)return a=r(n.row,n.col+h*n.colCount,n.rowCount,c),this.copyRange(n,a,o,i.Auto,s)}else if(o===t.FillSeries.Column){h=u(f/n.rowCount),c=f%n.rowCount;if(h>1&&!s)for(l=1;l<h;l++)a=r(n.row+l*n.rowCount,n.col,n.rowCount,n.colCount),this.copyRange(n,a,o,i.Auto,s);s&&h>1&&c===0&&(h=h-1,c=n.rowCount);if(h>0&&c>0)return a=r(n.row+h*n.rowCount,n.col,c,n.colCount),this.copyRange(n,a,o,i.Auto,s)}},l.prototype.copyRange=function(n,r,u,f,s){var k=this._worksheet,v,w,a,l,b,p,c,tt,g,nt,h=null,d=null,y;if(u===t.FillSeries.Row)for(v=0;v<n.rowCount;v++){h=null,d=null,l=n.row+v,b=r.row+v,w=0;while(w<n.colCount){a=n.col+w,p=r.col+w,c=null,tt=k.getFormula(l,a),tt&&tt!==""||(c=k.getValue(l,a));if(f===i.Auto)if(o(c)){h||(h=new e),g=null,g
=c instanceof Date?"date":"number",d||(d=g);if(d===g){h.add(a,c),w++;continue}}if(c&&h&&h.dataCount()>0){y=this.autoFillRowTrendValues(n,r,l,b,h,s);if(s&&y!==null)return y;h=null,d=null;continue}nt=k._spanModel.find(l,a);if(nt){if(nt.row===l)if(s){if(p===r.col+r.colCount-1)return c}else p<r.col+r.colCount&&this.copyCell(k,l,a,b,p,c,f);w+=nt.colCount}else{if(s){if(p===r.col+r.colCount-1)return c}else p<r.col+r.colCount&&this.copyCell(k,l,a,b,p,c,f);w++}}if(h&&h.dataCount()>0){y=this.autoFillRowTrendValues(n,r,l,b,h,s);if(s&&y!==null)return y}}else if(u===t.FillSeries.Column)for(w=0;w<n.colCount;w++){h=null,d=null,a=n.col+w,p=r.col+w,v=0;while(v<n.rowCount){l=n.row+v,b=r.row+v,c=null,tt=k.getFormula(l,a),tt&&tt!==""||(c=k.getValue(l,a));if(f===i.Auto)if(o(c)){h||(h=new e),g=null,g=c instanceof Date?"date":"number",d||(d=g);if(d===g){h.add(l,c),v++;continu
e}}if(c&&h&&h.dataCount()>0){y=this.autoFillColumnTrendValues(n,r,a,p,h,s);if(s&&y!==null)return y;h=null,d=null;continue}nt=k._spanModel.find(l,a);if(nt){if(nt.col===a)if(s){if(b===r.row+r.rowCount-1)return c}else b<r.row+r.rowCount&&this.copyCell(k,l,a,b,p,c,f);v+=nt.rowCount}else{if(s){if(b===r.row+r.rowCount-1)return c}else b<r.row+r.rowCount&&this.copyCell(k,l,a,b,p,c,f);v++}}if(h&&h.dataCount()>0){y=this.autoFillColumnTrendValues(n,r,a,p,h,s);if(s&&y!==null)return y}}return null},l.prototype.autoFillRowTrendValues=function(r,u,e,o,s,h){var b=this._worksheet,l,c,y,v,a,p,d,w,g,k;if(s&&s.dataCount()>0&&t.util.hasCalc()){p=(u.col-r.col)/r.colCount;if(this.isArithmeticProgression(s._indexes,s._innerValues)){for(d=s.values2(),w=new Array(1),l=s.dataCount(),w[0]=new Array(l),c=0;c<l;c++)w[0][c]=c+1;for(g=new n.spread.Calc._ConcreteArray(w,l),c=0;c<l;c++){y=f.TREND(b,d,g,l*p+c+1),v=s._indexes[
c],a=v+p*r.colCount;if(h){if(a===u.col+u.colCount-1)return s.toActualValue(y)}else a<u.col+u.colCount&&this.copyCell(b,e,v,o,a,s.toActualValue(y),i.Auto)}}else for(k=s._indexes[0],l=s._indexes[s.dataCount()-1]-k+1,s.dataCount()===1&&s.add(s._indexes[0]+1,s.toActualValue(s._innerValues[0]+1)),c=0;c<l;c++){y=f.TREND(b,s.values2(),s.indexes2(),l*p+c+1),v=k+c,a=v+p*r.colCount;if(h){if(a===u.col+u.colCount-1)return s.toActualValue(y)}else a<u.col+u.colCount&&this.copyCell(b,e,v,o,a,s.toActualValue(y),i.Auto)}}return null},l.prototype.copyCell=function(r,u,f,e,o,s,h){var v,l,a,c;(r.hasFormula(u,f)||r.hasFormula(e,o))&&(r.setFormula(e,o,null),(h===i.Direction||h===i.Auto)&&(v=r.getFormula(u,f),v&&r._copyFormula(u,f,e,o,1,1))),r.setValue(e,o,s),l=r.getCompositeStyle(u,f),l?(a=new n.spread.Style,a.copyFrom(l),r.setStyle(e,o,a,t.SheetArea.viewport)):r.setStyle(e,o,null,t.SheetArea.viewport),r._spanModel.isEmpty()||(r.removeSpan(e,o,t.Sh
eetArea.viewport),c=r._spanModel.find(u,f),c&&r._addSpanImp(e,o,c.rowCount,c.colCount,t.SheetArea.viewport))},l.prototype.autoFillColumnTrendValues=function(r,u,e,o,s,h){var k=this._worksheet,l,c,v,p,a,y,d,w,g,b;if(s&&s.dataCount()>0&&t.util.hasCalc()){y=(u.row-r.row)/r.rowCount;if(this.isArithmeticProgression(s._indexes,s._innerValues)){for(d=s.values2(),w=new Array(1),l=s.dataCount(),w[0]=new Array(l),c=0;c<l;c++)w[0][c]=c+1;for(g=new n.spread.Calc._ConcreteArray(w,l),c=0;c<l;c++){v=f.TREND(k,d,g,l*y+c+1),p=s._indexes[c],a=p+y*r.rowCount;if(h){if(a===u.row+u.rowCount-1)return s.toActualValue(v)}else a<u.row+u.rowCount&&this.copyCell(k,p,e,a,o,s.toActualValue(v),i.Auto)}}else for(b=s._indexes[0],l=s._indexes[s.dataCount()-1]-b+1,s.dataCount()===1&&s.add(s._indexes[0]+1,s.toActualValue(s._innerValues[0]+1)),c=0;c<l;c++){v=f.TREND(k,s.values2(),s.indexes2(),l*y+c+1),p=b+c,a=p+y*r.rowCount;if(h){if(a===u.row+u.rowCount-1)return s.
toActualValue(v)}else a<u.row+u.rowCount&&this.copyCell(k,b,e,a,o,s.toActualValue(v),i.Auto)}}return null},l.prototype.isArithmeticProgression=function(n,t){var r,u,f,i;if(n.length!==t.length)return!1;r=t.length;if(r>1)if(r===2)return!0;else{for(u=n[1]-n[0],f=t[1]-t[0],i=2;i<r;i++){if(n[i]-n[i-1]!==u)return!1;if(t[i]-t[i-1]!==f)return!1}return!0}else return!1},l.prototype.fillAutobyDirection=function(n,t){var i=this.fixRange(n),e=i.row,o=i.col,f=i.rowCount,r=i.colCount,u=this.getDirectionFillSourceRange(e,o,f,r,t);u&&this.directionFillRange(u,e,o,f,r,t)},l.prototype.directionFillRange=function(n,f,e,o,s,h){var y=t._StringResource.Exp_TargetContainsMergedCells,p=t._StringResource.Exp_MergedCellsIdentical,l,v,a,c;if(h===t.FillDirection.Left){if(this.hasSpans(f,e,o,s-n.colCount))throw new Error(y);l=u(s/n.colCount),v=s%n.colCount;if(v!==0)throw new Error(p);if(l>1)for(c=1;c<l;c++)a=r(n.row,n.col-c*n.colCount,n.rowCount,n.colCount),this.copyRange(n,a,t.Fil
lSeries.Row,i.Direction)}else if(h===t.FillDirection.Right){if(this.hasSpans(f,e+n.colCount,o,s-n.colCount))throw new Error(y);l=u(s/n.colCount),v=s%n.colCount;if(v!==0)throw new Error(p);if(l>1)for(c=1;c<l;c++)a=r(n.row,n.col+c*n.colCount,n.rowCount,n.colCount),this.copyRange(n,a,t.FillSeries.Row,i.Direction)}else if(h===t.FillDirection.Up){if(this.hasSpans(f,e,o-n.rowCount,s))throw new Error(y);l=u(o/n.rowCount),v=o%n.rowCount;if(v!==0)throw new Error(p);if(l>1)for(c=1;c<l;c++)a=r(n.row-c*n.rowCount,n.col,n.rowCount,n.colCount),this.copyRange(n,a,t.FillSeries.Column,i.Direction)}else if(h===t.FillDirection.Down){if(this.hasSpans(f+n.rowCount,e,o-n.rowCount,s))throw new Error(y);l=u(o/n.rowCount),v=o%n.rowCount;if(v!==0)throw new Error(p);if(l>1)for(c=1;c<l;c++)a=r(n.row+c*n.rowCount,n.col,n.rowCount,n.colCount),this.copyRange(n,a,t.FillSeries.Column,i.Direction)}},l.prototype.getDirectionFillSourceRange=function(n,i,u,f,e){var o=null;return e===t.FillDirection.Le
ft?o=r(n,i+f-1,u,1):e===t.FillDirection.Right?o=r(n,i,u,1):e===t.FillDirection.Up?o=r(n+u-1,i,1,f):e===t.FillDirection.Down&&(o=r(n,i,1,f)),this.inflateCellRange(o)},l.prototype.inflateCellRange=function(n){var t=this._worksheet.getSpans();return t&&n&&(n=this._worksheet._cellRangeInflate(t,n)),n},l.prototype.hasPartSpans=function(n,t,i,r){var f=this._worksheet._spanModel.getEnumerator(n,t,i,r),u;while(f.moveNext()){u=f.current();if(u.row<n||u.row+u.rowCount>n+i)return!0;if(u.col<t||u.col+u.colCount>t+r)return!0}return!1},l.prototype.hasSpans=function(n,t,i,r){var u=this._worksheet._spanModel.getEnumerator(n,t,i,r);return u.moveNext()},l.prototype.seriesFillRange=function(n,i,r,u,f,e){var y=this.fixRange(n),a=y.row,v=y.col,w=y.rowCount,p=y.colCount,o,h,s,c,l;if(this.hasSpans(a,v,w,p))throw new Error(t._StringResource.Exp_RangeContainsMergedCell);if(i===t.FillSeries.Row)for(c=a;c<a+w;c++){o=this.getSeriesSource(c,v,1,1,i);if(o&&o.dataCou
nt()>0){h=this.calcSeriesData(o,p,r,u,f,e);if(h&&h.length>0)for(s=0;s<h.length;s++)this.copyCell(this._worksheet,c,o._indexes[0],c,v+s,o.toActualValue(h[s]),r)}}else if(i===t.FillSeries.Column)for(l=v;l<v+p;l++){o=this.getSeriesSource(a,l,1,1,i);if(o&&o.dataCount()>0){h=this.calcSeriesData(o,w,r,u,f,e);if(h&&h.length>0)for(s=0;s<h.length;s++)this.copyCell(this._worksheet,o._indexes[0],l,a+s,l,o.toActualValue(h[s]),r)}}},l.prototype.calcSeriesData=function(n,t,r,u,f,e){var s;if(n&&n.dataCount()>0){var c=[],h=n._innerValues[0],o=h;for(s=0;s<t;s++)f!==undefined&&f!==null&&o>f||(c.push(o),r===i.Linear?o+=u:r===i.Growth?o*=u:r===i.Date&&e!==undefined&&e!==null&&(o=this.getNextDateValue(e,h,o,u,s+1)));return c}return null},l.prototype.getNextDateValue=function(n,t,i,r,f){var l=i,e,o;if(n===s.Day)e=c(i),l=h(e.setDate(e.getDate()+r)).toOADate();else if(n===s.Weekday){e=c(i),o=Math.abs(r);wh
ile(o>0)r>0?e.setDate(e.getDate()+Math.min(1,o)):e.setDate(e.getDate()-Math.min(1,o)),e.getDay()!==6&&e.getDay()!==0&&(o-=1);l=h(e).toOADate()}else n===s.Month?(e=c(t),l=h(e.setMonth(e.getMonth()+u(f*r))).toOADate()):n===s.Year&&(e=c(t),l=h(e.setFullYear(e.getFullYear()+u(f*r))).toOADate());return l},l}(),t.FillImp=a})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(t){function r(n,t,i,r,u){var f="<"+n+" ";return t&&(f+="id='"+t+"' "),r&&$.each(r,function(n,t){f+=n+"='"+t+"' "}),f+=i?">"+i+"</"+n+">":u===!0?">":"/>"}var f;t.feature("fill_ui",["core.common","core.sheet_action","core.stringResource","filter_ui"]),function(n){n[n.Tag=0]="Tag",n[n.Down=1]="Down"}(t._FillSmartTag||(t._FillSmartTag={})),
f=t._FillSmartTag;var e="div",v="img",p="label",w="input",i="auto",u="gc_smartTag",o="gc_smartTagDown",s="gc_smartMenu",c="gc_smartMenuItem",a="gc_fillTypeRadioLable",l="gc_fillTypeText",h="gc_fillTypeRadio",y=function(){function y(n,t){this.sheet=n,this.fillInfo=t,this._init()}return y.prototype._init=function(){this._creatDom();var t=$("#"+u),n=$("#"+s);this.dialogTag=t.wijsheetfilterdialog({height:i,width:i,minHeight:i,minWidth:i}),this.dialogTag.removeClass("ui-dialog-content"),this.dialogTag.parent().removeClass("ui-widget-content"),this.dialog=n.wijsheetfilterdialog({height:i,width:i,minHeight:i,minWidth:i,show:i}),this.dialog.removeClass("ui-dialog-content"),this.dialog.parent().removeClass("ui-widget-content"),t.addClass("ui-widget-header"),n.addClass("ui-widget-content")},y.pro
totype._getMenuItemDomString=function(n,t,i,u){var s={name:"gc_fillType","class":h,type:"radio",value:t,checked:null},o,f;return u&&(s.checked=""),o=r(e,null,r(w,n,null,s,!0),{"class":a}),f=r(e,null,r(p,null,i,{"class":l})),r(e,null,o+f,{"class":c})},y.prototype._getDomString=function(){var i=r(e,u,r(v,null,null,{style:"vertical-align: bottom;float:left",src:y.getImageSrc(f.Tag)})+r(v,o,null,{style:"vertical-align: bottom;float:left",src:y.getImageSrc(f.Down)})),t=r(e,s,this._getMenuItemDomString("gc_smartMenuCopyCells","0",n.spread._StringResource.CopyCells,!0)+this._getMenuItemDomString("gc_smartMenuFillSeries","1",n.spread._StringResource.FillSeries)+this._getMenuItemDomString("gc_smartMenuFillFormattingOnly","2",n.spread._StringResource.FillFormattingOnly)+this._getMenuItemDomString("gc_smartMenuFillWithoutFormatting&q
uot;,"3",n.spread._StringResource.FillWithoutFormatting));return i+t},y.prototype._hasDom=function(){var n=window.document.getElementById(u);return!!n},y.prototype._creatDom=function(){var t=this.sheet._getCanvas(),n;t&&!this._hasDom()&&(n=this._getDomString(),$(n).appendTo(t),this._prepareLayout())},y.prototype._prepareLayout=function(){var i,r,n,t;$("#"+o).hide(),i=$("#"+s),i.hide(),i.css({width:"170px",boxShadow:"1px 2px 5px rgba(0,0,0,0.4)"}),r=$("."+c),r.css({width:"150px",height:"20px"}),r.addClass("ui-state-default"),n=$("."+h),n.css({display:"none"}),n.parent().css({width:"16px",height:"16px",margin:"1px",float:"left"}),$("."+h+"[checked]").parent().addClass("ui-icon ui-icon-check"),t=$("."+l),t.parent().css({paddingTop:"3px",paddingLeft:"20px"}),t.css(
{fontSize:"9pt",fontFamily:"Arial",fontWeight:"normal",float:"left"}),$("#"+u).css({width:"18px",height:"18px",padding:"0px",overflow:"hidden"})},y.prototype._registerEvent=function(){var t=this,n=$("#"+u),i,r;n.unbind(),n.hover(function(){var n=t.dialog.wijsheetfilterdialog("isOpen");if(n)return;$(this).css({width:"32px",height:"18px"}),$(this).addClass("ui-state-hover"),$("#"+o).show()},function(){var n=t.dialog.wijsheetfilterdialog("isOpen");if(n)return;$(this).css({width:"18px",height:"18px"}),$(this).removeClass("ui-state-hover"),$("#"+o).hide()}),n.toggle(function(){$(this).addClass("ui-state-active"),t._openMenu()},function(){$(this).removeClass("ui-state-active"),t._closeMenu()}),i=$("."+c),i.unbind(),i.hover(function(){$(this).addClass("ui-sta
te-hover")},function(){$(this).removeClass("ui-state-hover")}),i.click(function(){var u=$(this).find(":radio"),r=u[0],i;r.checked=!0,u.change(),n.click(),n.mouseleave(),i=parseInt(r.value,10),window.setTimeout(function(){t._changeFill(i)},10)}),r=$("#"+s+" :radio"),r.unbind(),r.change(function(){$("."+a).removeClass("ui-icon ui-icon-check"),$(this).parent().addClass("ui-icon ui-icon-check")})},y.prototype._changeFill=function(n){var i=this.sheet;i._skipCloseDragFillSmartTag=!0,t.SpreadActions.undo.call(i),i._skipCloseDragFillSmartTag=!1,i._eventHandler.executeDragFillAction(i._eventHandler._currentFillRange,n)},y.prototype._initData=function(){var t=this.fillInfo.fillType,n=this.dialog.find(":radio")[t];n&&n.checked===!1&&(n.checked=!0,$(n).change())},y.prototype.open=function(){var f,r,i;if(this.dialogTag){f=this,this._registerEvent(),this._initData();var u=$(this.sheet._getCanvas()
).offset(),t=this.fillInfo.x,n=this.fillInfo.y;t+=u.left-3,n+=u.top-3,r=$(window.document).scrollLeft(),i=$(window.document).scrollTop(),t-=r,n-=i,this.dialogTag.wijsheetfilterdialog({position:[t,n],open:function(){},close:function(){f.close()}}),this.reset(),this.dialogTag.wijsheetfilterdialog("open")}},y.prototype._openMenu=function(){if(this.dialog){var f=this,t=$(this.dialogTag).offset(),i=t.left-2.5,n=t.top+17.5,r=$(window.document).scrollLeft(),u=$(window.document).scrollTop();i-=r,n-=u,this.dialog.wijsheetfilterdialog({position:[i,n],modal:!1}),this.dialog.wijsheetfilterdialog("open")}},y.prototype._closeMenu=function(){this.dialog&&this.dialog.wijsheetfilterdialog("close")},y.prototype.reset=function(){if(this.dialog){var t=this.dialog.wijsheetfilterdialog("isOpen"),n=$("#"+u);t&&n.click(),n.mouseleave()}},y.prototype.close=function(){this.reset(),this.isOpen()&&(this.dialog.wijsheetfilterdialog("
close"),this.dialogTag.wijsheetfilterdialog("close")),this.sheet&&this.sheet._eventHandler._setFocus()},y.prototype.isOpen=function(){return this.dialogTag?this.dialogTag.wijsheetfilterdialog("isOpen"):!1},y.prototype._updateResource=function(){$("#gc_smartMenuCopyCells").parent().siblings().find(".gc_fillTypeText").text(n.spread._StringResource.CopyCells),$("#gc_smartMenuFillSeries").parent().siblings().find(".gc_fillTypeText").text(n.spread._StringResource.FillSeries),$("#gc_smartMenuFillFormattingOnly").parent().siblings().find(".gc_fillTypeText").text(n.spread._StringResource.FillFormattingOnly),$("#gc_smartMenuFillWithoutFormatting").parent().siblings().find(".gc_fillTypeText").text(n.spread._StringResource.FillWithoutFormatting)},y.getImageSrc=function(n){if(n===f.Tag)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAA7EAAAOx
AGVKw4bAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cg
I5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZ
nw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7J
vttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFJJREFUeNrclEEKACAIBOfp/Xy7i4WSRnRYBIVRVhFJVIhyEAxllQa5E/wBSnsU6Rza2nugqNmASi57C/KKNg/Iqn+iVWzx6M4bOdUEAAD//wMAAYRMfiNaiqEAAAAASUVORK5CYII=";else if(n===f.Down)return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAASCAYAAACXScT7AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVC
kidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3
YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3
U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+3
9QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAGCSURBVHjafNFPKKRxHAbw5/v7GYdBYUQjLm5SkoNykCQHtcx431/KgdKumJvSrAO7Nwc3RQ5kd3OkHJC/hUJREluonVcToqRh3sRFPA6M1Mbhc3z6Pj1fkMRHQNJL0uPeul731lU37o1y49cqHr8GvvgWQRLBsmpM/P0j4XAXiooKcXl1CZDEzl4EJBEwAZBUwWAQsVgsFSRR11gmM8trimSa3WypzZ31l5v2/vfk/4oAcv9aSGyUSz4gg/AIAOET0YQswIQWaNrnH+2OeSaY0BJN2+wDTi/OpCrwkxX1vW8q63p5cnaaB+Z/09u7x0nFJTVMiEajPsNCQaC6Ryb8THKcw/Tikho6zj//0RGUNV6gMZ1H8fmpH5iTHDlwsiOhO7FrN5RdP6aBIUj/pvJ2bkFbkxAzBzELELNCQQqgrJ5ST1/jqmYOJcHa7dYYGV5TrQ3d+vfUU+b7IfrOIRCGBYD0o1VGmaHaB6DZkqvMD2hUfF1UAISkvE/+y
qbCZ89+HgBtwgFOrBUzJgAAAABJRU5ErkJggg==";return""},y}();t._GcFillDialog=y})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(t){var i,f,e,o,s,r,u;t.feature("search",["core.common","core.sheet_ui","core.stringResource"]),function(n){n[n.All=0]="All",n[n.HasValue=1]="HasValue",n[n.HasStyle=2]="HasStyle"}(t.EnumeratorOption||(t.EnumeratorOption={})),i=t.EnumeratorOption,f=function(){function u(t,r){this.actualEndRow=-1,this.isActualEndRowSet=!1,this.isBlockRange=!1,this.options=i.HasValue;if(!t)throw new Error(n.spread._StringResource.Exp_SheetIsNull);this.worksheet=t,this.sheetArea=r.sheetArea,this.searchOrder=r.searchOrder,this.rowStart=r.rowStart,this.columnStart=r.columnStart,this.rowEnd=r.rowEnd,this.columnEnd=r.columnEnd,this.findBeginRow=r.findBeginRow,this.findBeginColumn=r.findBeginColumn,this.init(),this.block=this.worksheet._getModel(this.sheetAre
a)}return u.prototype.init=function(){this.currentRow=-1,this.currentColumn=-1},u.prototype.moveNext=function(){if(this.currentRow===-1&&this.currentColumn===-1)if(this.rowStart<=this.rowEnd&&this.columnStart<=this.columnEnd){this.currentRow=this.findBeginRow,this.currentColumn=this.findBeginColumn;if(this.isIndexAcceptable(this.currentRow,this.currentColumn))if(!this.skipCurrent())return!0}if(this.rowStart<=this.rowEnd&&this.columnStart<=this.columnEnd)while(this.tryMoveNext())if(!this.skipCurrent())return!0;return this.currentRow=-1,this.currentColumn=-1,!1},u.prototype.isIndexAcceptable=function(n,t){if((this.options&i.HasValue)>0)if(this.block)if(this.block.getValue(n,t)!==null||this.block.getFormula(n,t)!==null)return!0;return this.options===i.All},u.prototype.skipCurrent=function(){return!1},u.prototype.tryMoveNext=function(){var r=this.currentRow,u=this.currentColumn,f=!1,t,n;return(this.options&i.HasValue)>0&&(t={valu
e:r},n={value:u},this.nextValue(t,n)&&(r=t.value,u=n.value,f=!0)),this.options===i.HasValue&&(f?(this.currentRow=r,this.currentColumn=u):(this.currentRow=-1,this.currentColumn=-1)),!(this.currentRow===-1&&this.currentColumn===-1)},u.prototype.nextValue=function(n,t){while(this.next(n,t))if(this.isIndexAcceptable(n.value,t.value))return!0;return!1},u.prototype.nextZOrder=function(n,t,i){var f,u,r;if(n){f=this.getNextNonEmptyColumnInRow(n,t.value,i.value+1);if(f!==-1){i.value=f;if(this.isZOrderOver(t.value,i.value))return!0}do{u=n.nextNonNullRow(t.value),u===-1||u>this.rowEnd?t.value=-1:(u!==-1&&(t.value=u),u!==-1&&u<t.value&&(t.value=u));if(t.value!==-1){i.value=t.value===this.rowStart||this.isBlockRange?this.columnStart-1:-1;do{r=this.getNextNonEmptyColumnInRow(n,t.value,i.value+1),r===-1||r>this.columnEnd?i.value=-1:(r!==-1&&(i.value=r),r!==-1&&r<i.value&&(i.value=r));if(i.value!==-1)return this.isZ
OrderOver(t.value,i.value)}while(i.value!==-1)}}while(t.value!==-1)}return!1},u.prototype.getNextNonEmptyColumnInRow=function(n,t,i){for(var r=i;r<=this.columnEnd;r++)if(n.getValue(t,r)!==null)return r;return-1},u.prototype.isZOrderOver=function(n,t){if(this.isBlockRange)return n>=this.rowStart&&n<=this.getActualEndRow()&&t>=this.columnStart&&t<=this.actualEndColumn();else{if(n>this.getActualEndRow())return!1;if(n===this.getActualEndRow())if(t<0||t>this.actualEndColumn())return!1;if(n<this.rowStart)return!1;if(n===this.rowStart)if(t<this.columnStart)return!1}return!0},u.prototype.getActualEndRow=function(){var n,t,r;return this.isActualEndRowSet?this.actualEndRow:(n=-1,t=!1,(this.options&i.HasValue)>0&&this.block&&(r=this.block.getRowCount()-1,n=Math.max(n,r),t=!0),n=t?Math.min(n,this.rowEnd):this.rowEnd,this.actualEndRow=n,this.isActualEndRowSet=!0,this.actualEndRow)},u.prototype.actualEndColumn=function()
{return this.columnEnd},u.prototype.next=function(n,t){var u,i;if(this.searchOrder===r.ZOrder)return u=this.getActualEndColumnZOrder(n.value),t.value+1>u?n.value+1>this.getActualEndRow()?!1:(n.value+=1,t.value=this.isBlockRange?this.columnStart:0,this.isZOrderOver(n.value,t.value)):(t.value+=1,this.isZOrderOver(n.value,t.value));else if(this.searchOrder===r.NOrder)return i=this.getActualEndRowNOrder(t.value),n.value+1>i?t.value+1>this.actualEndColumn()?!1:(t.value+=1,n.value=this.isBlockRange?this.rowStart:0,this.isNOrderOver(n.value,t.value)):(n.value+=1,this.isNOrderOver(n.value,t.value));return!1},u.prototype.getActualEndColumnZOrder=function(n){if(n<this.rowStart||n>this.rowEnd)return-1;else{var t=-1,r=!1;return(this.options&i.HasValue)>0&&this.block&&(t=Math.max(t,this.block.getColumnCount()-1),r=!0),t=n===this.rowEnd||this.isBlockRange?r?Math.min(t,this.columnEnd):this.columnEnd:r?Math.max(t,this.worksheet.getColumnCount(this.sheetArea)
-1):this.worksheet.getColumnCount(this.sheetArea)-1}},u.prototype.getActualEndRowNOrder=function(n){if(n<this.columnStart||n>this.columnEnd)return-1;else{var t=-1,r=!1;return(this.options&i.HasValue)>0&&this.block&&(t=Math.max(t,this.rowEnd),r=!0),t=n===this.columnEnd||this.isBlockRange?r?Math.min(t,this.rowEnd):this.rowEnd:r?Math.max(t,this.worksheet.getRowCount(this.sheetArea)-1):this.worksheet.getRowCount(this.sheetArea)-1}},u.prototype.isNOrderOver=function(n,t){if(this.isBlockRange)return n>=this.rowStart&&n<=this.getActualEndRow()&&t>=this.columnStart&&t<=this.actualEndColumn();else{if(t>this.actualEndColumn())return!1;if(t===this.actualEndColumn())if(n<0||n>this.getActualEndRow())return!1;if(t<this.columnStart)return!1;if(t===this.columnStart)if(n<this.rowStart)return!1}return!0},u.prototype.current=function(){return 0<=this.currentRow&&this.currentRow<this.worksheet.getRowCount(this
.sheetArea)&&0<=this.currentColumn&&this.currentColumn<this.worksheet.getColumnCount(this.sheetArea)?new t.Cell(this.worksheet,this.currentRow,this.currentColumn,this.sheetArea):null},u}(),t.CellsEnumerator=f,e=function(){function n(){this.startSheetIndex=-1,this.endSheetIndex=-1,this.searchString=null,this.searchFlags=s.None,this.searchOrder=r.ZOrder,this.searchTarget=u.CellText,this.sheetArea=t.SheetArea.viewport,this.rowStart=-1,this.columnStart=-1,this.rowEnd=-1,this.columnEnd=-1,this.findBeginRow=-1,this.findBeginColumn=-1}return n}(),t.SearchCondition=e,o=function(){function n(){this.searchFoundFlag=u.None,this.foundSheetIndex=-1,this.foundRowIndex=-1,this.foundColumnIndex=-1,this.foundString=null}return n}(),t.SearchResult=o,function(n){n[n.None=0]="None",n[n.IgnoreCase=1]="IgnoreCase",n[n.ExactMatch=2]="ExactMatch",n[n.UseWildCards=4]="UseWildCards",n[n.BlockRange=8]="BlockRange"}(t.SearchFlags||(t.Searc
hFlags={})),s=t.SearchFlags,function(n){n[n.ZOrder=0]="ZOrder",n[n.NOrder=1]="NOrder"}(t.SearchOrder||(t.SearchOrder={})),r=t.SearchOrder,function(n){n[n.None=0]="None",n[n.CellText=1]="CellText",n[n.CellFormula=8]="CellFormula"}(t.SearchFoundFlags||(t.SearchFoundFlags={})),u=t.SearchFoundFlags})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(n){var f,t;n.feature("binding",["core.common"]);var u="undefined",e="null",i="string",r=function(){function n(n){this._source=n,this.__cellBindingSource__=!0}return n.prototype.setValue=function(n,i){this._source&&n&&t.setValueByPath(this._source,n,i)},n.prototype.getValue=function(n){return this._source&&n?t.getValueByPath(this._source,n):null},n.prototype.getSource=function(){return this._source},n}();n.CellBindingSource=r,f=function(){function n(n){this._init(),this._sheet=
n}return n.prototype.bind=function(n){var t=this._dataSource;t&&$.isFunction(t.dispose)&&t.dispose(),this._unSubscribeHandlers(this._dataSourceSubscriptions),this._unSubscribeHandlers(this._dataItemSubscriptions),this._init(),this._dataSource=n,n&&(this._sheet&&(n.subscribe&&this._dataSourceSubscriptions.push(n.subscribe(this._dataChangedhandler,this)),n.currentPosition&&n.currentPosition.subscribe&&this._dataSourceSubscriptions.push(n.currentPosition.subscribe(this._currentPositionChangedhandler,this)),this.doDataItemChanged()),this._fields=this._getFieldsInfo(n))},n.prototype.doDataItemChanged=function(){var e,t,i,r,f;if(!this._sheet||!this._dataSource)return;e=this._sheet,t=this._dataSource;if(t&&$.type(window.ko)!==u){this._unSubscribeHandlers(this._dataItemSubscriptions),i=null,n.isDataViewSource(t)?(t.currentPosition&&(r=e.getActiveRowIndex(),-1<=r&&r<t.count()&&t.currentPosition(r)),
i=t.currentItem()):n.isCellBindingSource(t)||(i=t[e.getActiveColumnIndex()]);if(i)for(f in i)i[f]&&$.isFunction(i[f].subscribe)&&this._dataItemSubscriptions.push(i[f].subscribe(this._activeDataItemChangedhandler,null,null))}},n.prototype._activeDataItemChangedhandler=function(){this._sheet&&this._sheet.repaint()},n.prototype._unSubscribeHandlers=function(n){var i,t;if(n)for(i in n)t=n[i],t&&$.isFunction(t.dispose)&&t.dispose()},n.prototype.getRowCount=function(){return this._getDataLength()},n.prototype.getColumnCount=function(){var t,n;if(this._fields)return this._fields.length;t=this._dataSource;if(t){n=t[0];if($.type(n)===e||$.type(n)===i||$.isNumeric(n))return 1}return 0},n.prototype.getSource=function(){return this._dataSource},n.prototype.getFields=function(){return this._fields},n.prototype.getDataItem=function(t){if(!this._dataSource)return null;var r=window.ko,i=this._dataSource;return n.isDataViewSource(i)?i.item(t):r&&r.isOb
servable(i)?i()[t]:n.isCellBindingSource(i)?null:i[t];return null},n.prototype.getDataItemType=function(){for(var i=this.getRowCount(),n,t=0;t<i;t++){n=this.getDataItem(t);if(n)return n.entityAspect&&n.entityType?n.entityType:n.constructor}return null},n.prototype.getValue=function(r,u){var a,c,l,f;if(!this._dataSource)return null;var h=this._sheet,s=this._dataSource,e,o,v=n.isCellBindingSource(s);if(!v){if(r<0||this.getRowCount()<=r)return null;a=h?h.getColumnCount():this.getColumnCount();if(u<0||a<=u)return null;h&&h._colInfos?(e=h._colInfos[u],e&&(o=e.name)):this._fields&&(o=this._fields[u])}c=window.ko;if(n.isDataViewSource(s)){f=s.item(r);if(f===undefined||f===null)return null;if(e&&$.isFunction(e.value))return e.value(f);else if(o&&o.length>0)return s.getProperty(f,o)}else if(c&&c.isObservable(s)){f=s()[r];if(f===undefined||f===null)return null;if(e&&$.isFunction(e.value))return e.value(f);else i
f(o&&o.length>0)return t.getValueByPath(f,o);else if($.type(f)===i||$.isNumeric(f))if(u===0)return f}else if(v){l=h?h.getBindingPath(r,u):null;if(l)return s.getValue(l)}else if(!isNaN(s.length)){f=s[r];if(f===undefined||f===null)return null;if(e&&$.isFunction(e.value))return e.value(f);else if(o&&o.length>0)return t.getValueByPath(f,o);else if($.type(f)===i||$.isNumeric(f))if(u===0)return f}return null},n.prototype.setValue=function(r,u,f){var p,s,a,v,e;if(!this._dataSource)return!1;var l=this._sheet,c=this._dataSource,o,h,y=n.isCellBindingSource(c);if(!y){if(r<0||this.getRowCount()<=r)return!1;p=l?l.getColumnCount():this.getColumnCount();if(u<0||p<=u)return!1;l&&l._colInfos?(o=l._colInfos[u],o&&(h=o.name)):this._fields&&(h=this._fields[u])}return s=!1,a=window.ko,n.isDataViewSource(c)?(e=c.item(r),e!==null&&e!==undefined&&(o&&$.isFunction(o.value)?(o.value(e,f),s=!0):h&&h.length>0&a
mp;&(c.setProperty(e,h,f),s=!0))):a&&a.isObservable(c)?(e=c()[r],e!==null&&e!==undefined&&(o&&$.isFunction(o.value)?(o.value(e,f),s=!0):h&&h.length>0?(t.setValueByPath(e,h,f),s=!0):($.type(e)===i||$.isNumeric(e))&&u===0&&(c()[r]=f,s=!0))):y?(v=l?l.getBindingPath(r,u):null,v&&(c.setValue(v,f),s=!0)):(e=c[r],e!==null&&e!==undefined&&(o&&$.isFunction(o.value)?(o.value(e,f),s=!0):h&&h.length>0?(t.setValueByPath(e,h,f),s=!0):($.type(e)===i||$.isNumeric(e))&&u===0&&(c[r]=f,s=!0))),s},n.prototype.addItems=function(t,i){var u,r,f,e;if(!this._dataSource||t>this.getRowCount())return;u=this._dataSource,r=this.getDataItemType();if(n.isDataViewSource(u)){if(!this._dataViewUpdating){this._updatingDataView=!0;if(r){for(f=0;f<i;f++)e=r.createEntity?r.createEntity():new r,u.add(e);u.commitEdit()}this._updatingDataView=!1}}else if(!n.isCellBindingSource(u))for(f=0;f<i;f++
)r?(e=r.createEntity?r.createEntity():new r,u.splice(t,0,e)):u.splice(t,0,null)},n.prototype.removeItems=function(t,i){var e=this.getRowCount(),r,f,u;if(!this._dataSource||t>=e)return;r=this._dataSource,f=Math.min(i,e-t);if(n.isDataViewSource(r)){if(!this._dataViewUpdating){for(this._updatingDataView=!0,u=0;u<f;u++)r.remove(r.item(t));this._updatingDataView=!1}}else n.isCellBindingSource(r)||t<e&&r.splice(t,f)},n.isDataViewSource=function(n){var t=window.wijmo;return t&&t.data&&t.data.isDataView(n)},n.isCellBindingSource=function(n){return r&&n instanceof r||n&&n.hasOwnProperty("__cellBindingSource__")},n.prototype._init=function(){this._dataSource=null,this._fields=null,this._dataSourceSubscriptions=[],this._dataItemSubscriptions=[]},n.prototype._getDataLength=function(){var t=this._dataSource,i,r;return t?(i=0,r=window.ko,n.isDataViewSource(t)?i=t.count():r&&r.isObservable(t)?i=t().length:n.isCellBindingSource(t)||
t&&!isNaN(t.length)&&(i=t.length),i):0},n.prototype._getFieldsInfo=function(t){var o=window.ko,e=0,f=0,u=null,i,r;if(n.isDataViewSource(t)){e=t.count(),i=t.getProperties();if(i&&i.length>0)for(f=i.length,u=[],r=0;r<f;r++)u.push(i[r].name)}else if(o&&o.isObservable(t)){e=t().length;if(e>0){i=this._getProperties(t()[0]);if(i&&i.length>0)for(f=i.length,u=[],r=0;r<f;r++)u.push(i[r].name)}}else if(!n.isCellBindingSource(t))if(t&&!isNaN(t.length)){e=t.length;if(e>0){i=this._getProperties(t[0]);if(i&&i.length>0)for(f=i.length,u=[],r=0;r<f;r++)u.push(i[r])}}return u},n.prototype._getProperties=function(n){var r=window.ko,i=[],t;for(t in n)$.isFunction(n[t])?$.type(r)!==u&&r.isObservable(n[t])&&i.push(t):i.push(t);return i},n.prototype._dataChangedhandler=function(n){if(this._updatingDataView)return;if(!this._sheet)return;var i=this,t=this._sheet;t._bindToAutoRefresh(function(n){n&&(i._dat
aViewUpdating=!0,isNaN(n.length)||t.setRowCount(n.length),i._dataViewUpdating=!1)})(n)},n.prototype._currentPositionChangedhandler=function(n){if(!this._dataSource||!this._sheet)return;var t=this._sheet,i=this._dataSource;t._bindToAutoRefresh(function(n){if(i.currentPosition){var r=i.currentPosition();t._activeRowIndex!==r&&t.setActiveCell(r,t._activeColIndex)}})(n)},n}(),n._BindingManager=f,t=function(){function n(){}return n.setValueByPath=function(n,t,i){var e,o,f,r;if(!n||!t)return;for(e=window.ko,o=t.split("."),f=0;f<o.length;f++){r=o[f];if(!n)break;f===o.length-1?$.isFunction(n[r])?($.type(e)===u||!e.isObservable(n[r])||e.isWriteableObservable(n[r]))&&n[r](i):n[r]=i:n=$.isFunction(n[r])?n[r]():n[r]}},n.getValueByPath=function(n,t){var r,u,i;if(!n||!t)return null;r=t.split("."),u=0;do{i=r[u],n=$.isFunction(n[i])?n[i]():n[i];if(n===null||n===undefined)return null}while(++u<r.length);return n},n}(),n._BindingHelper=t})(n.spread||(n.spread
={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(n){var u,t,r,f,e;n.feature("table",["core.common","binding"]);var h="function",i="undefined",s="Column",o=function(){function t(n,t,i,r,f,e){var o,s;for(this._init(),this._name=n,this._row=t,this._col=i,this._rowCount=r,this._colCount=f,this._style=e,this._columns=[],o=0;o<this._colCount;o++)s=new u(o+1),this._columns.push(s)}return t.prototype.range=function(){return new n.Range(this._row,this._col,this._rowCount,this._colCount)},t.prototype.dataRange=function(){var i=this._showHeader?this._row+1:this._row,t=this._showHeader?this._rowCount-1:this._rowCount;return this._showFooter&&t--,new n.Range(i,this._col,t,this._colCount)},t.prototype.name=function(n){return arguments.length===0?this._name:(this._name=n,this)},t.prototype.headerIndex=function(){return this._showHeader?this._row:-1},t.prototype.footerIndex=function(){return this._showF
ooter?this._row+this._rowCount-1:-1},t.prototype.showHeader=function(n){var i,t;return arguments.length===0?this._showHeader:this._showHeader===n?this:(i=this._showHeader=n,i?(this._row>0&&(this._row=this._row-1,this._rowCount=this._rowCount+1),this._syncHeader()):(t=this._row,this._row=this._row+1,this._rowCount=this._rowCount-1,this._clearSheetRow(t),this._rowFilter&&(this._rowFilter.unfilter(),this._rowFilter.reset())),this)},t.prototype.showFooter=function(n){var r,t,i;return arguments.length===0?this._showFooter:this._showFooter===n?this:(r=this._showFooter=n,r?(t=this._getSheet(),(!t||this._row+this._rowCount<t.getRowCount())&&(this._rowCount=this._rowCount+1),this._syncFooter()):(i=this._row+this._rowCount-1,this._rowCount=this._rowCount-1,this._clearSheetRow(i)),this)},t.prototype.bandRows=function(n){return arguments.length===0?this._bandRows:(this._bandRows=n,this)},t.prototype.bandColumns=function(n){return arguments.length===0?this._bandColu
mns:(this._bandColumns=n,this)},t.prototype.highlightFirstColumn=function(n){return arguments.length===0?this._highlightFirstColumn:(this._highlightFirstColumn=n,this)},t.prototype.highlightLastColumn=function(n){return arguments.length===0?this._highlightLastColumn:(this._highlightLastColumn=n,this)},t.prototype.style=function(n){return arguments.length===0?this._style:(this._style=n,this)},t.prototype.rowFilter=function(){return!this._rowFilter&&n.features.filter&&(this._rowFilter=new n._TableFilter(this),this._rowFilter._updateRange(this.dataRange())),this._rowFilter},t.prototype.refresh=function(){this._bindingManager&&this._loadData()},t.prototype.getColumnName=function(t){var r=this._columns,u,i;if(r)if(0<=t&&t<r.length){u=r[t];if(u)return i=u.name(),i!==null&&(i=n.util.toString(i)),i}return null},t.prototype.setColumnName=function(n,t){var r,i,f;return this._hasColumnName(t)?this:(r=this._columns,r&&0<=n&&n<r
.length&&(i=r[n],i||(i=this._columns[n]=new u,i.id(this._newAutoId())),i.name(t),this._showHeader&&(f=this._getSheet(),f&&f.setText(this.headerIndex(),this._col+n,t))),this)},t.prototype.getColumnFormula=function(n){var i=this._columns,r,t;if(i&&0<=n&&n<i.length){r=i[n];if(r)return t=r.formula(),t?t.toUpperCase():t}return null},t.prototype.setColumnFormula=function(n,t){var u=this._columns,r,i;return u&&0<=n&&n<u.length&&(t&&t[0]==="="&&(t=t.substring(1)),r=u[n],r&&r.formula(t),this._showFooter&&(i=this._getSheet(),i&&i.setFormula(this.footerIndex(),this._col+n,t))),this},t.prototype.getColumnValue=function(n){var r=this._columns,t,i;if(r&&0<=n&&n<r.length){t=r[n];if(t){if(this._showFooter&&t.formula()){i=this._getSheet();if(i)return i.getValue(this.footerIndex(),this._col+n)}return t.value()}}return null},t.prototype.setColumnVa
lue=function(n,t){var u=this._columns,r,i;return u&&0<=n&&n<u.length&&(r=u[n],r&&r.value(t),this._showFooter&&(i=this._getSheet(),i&&i.setValue(this.footerIndex(),this._col+n,t))),this},t.prototype._setOwner=function(n){this._owner=n},t.prototype._getSheet=function(){return this._owner?this._owner.getSheet():null},t.prototype._init=function(){this._name=null,this._row=-1,this._col=-1,this._rowCount=-1,this._colCount=-1,this._style=null,this._showHeader=!0,this._showFooter=!1,this._highlightFirstColumn=!1,this._highlightLastColumn=!1,this._bandRows=!0,this._bandColumns=!1,this._bindingManager=null,this._columns=null,this._rowFilter=null,this._owner=null},t.prototype._bind=function(t){var h,f,i,e,r,o;this._bindingManager&&(h=this._getSheet(),h&&(f=this.dataRange(),h.clear(f.row,f.col,f.rowCount,f.colCount,n.SheetArea.viewport,n.StorageType.Data|n.StorageType.Sparkline)),i=this.range(),this._clear(i.row,i.col,i.rowCo
unt,i.colCount)),this._bindingManager=t;if(t){var s=this._bindingManager,c=s.getRowCount(),l=s.getColumnCount();for(this._showHeader&&c++,this._showFooter&&c++,this._rowCount=c,this._colCount=l,this._columns=[],e=s.getFields(),r=0;r<this._colCount;r++)o=new u(r+1),this._columns.push(o),e&&o.name(e[r]);this._loadData()}},t.prototype._loadData=function(){var r,n,t;if(!this._bindingManager)return;r=this._getSheet();if(!r)return;var u=this._bindingManager,i=this.dataRange(),o=i.row,f=i.col,s=i.rowCount,e=i.colCount;for(n=0;n<s;n++)for(t=0;t<e;t++)r.setValue(o+n,f+t,u.getValue(n,t))},t.prototype._compose=function(n,t,i){var o,d,k,b,g,s,h,a,l,e,r,c,v;if(!this._style)return;o=this._getSheet();if(o&&o.getRowHeight(n)<=0)return;var tt=this.headerIndex(),it=this.footerIndex(),nt=this._showHeader?n===this._row+1:n===this._row,y=this._showFooter?n===this._row+this._rowCount-2:n===this._row+this._rowCount-1,f=t===this._col,u=t===this._col+this._colCoun
t-1,w=this._showHeader?n===tt:n===this._row,p=this._showFooter?n===it:n===this._row+this._rowCount-1;if(tt===n)u&&this._highlightLastColumn&&this._style.lastHeaderCellStyle()&&this._style.lastHeaderCellStyle()._compose(i,!0,!0,!0,!0),f&&this._highlightFirstColumn&&this._style.firstHeaderCellStyle()&&this._style.firstHeaderCellStyle()._compose(i,!0,!0,!0,!0),this._style.headerRowStyle()&&this._style.headerRowStyle()._compose(i,!0,f,!0,u),u&&this._highlightLastColumn&&this._style.highlightLastColumnStyle()&&this._style.highlightLastColumnStyle()._compose(i,!0,!0,!1,!0),f&&this._highlightFirstColumn&&this._style.highlightFirstColumnStyle()&&this._style.highlightFirstColumnStyle()._compose(i,!0,!0,!1,!0);else if(it===n)u&&this._highlightLastColumn&&this._style.lastFooterCellStyle()&&this._style.lastFooterCellStyle()._compose(i,!0,!0,!0,!0),f&&this._high
lightFirstColumn&&this._style.firstFooterCellStyle()&&this._style.firstFooterCellStyle()._compose(i,!0,!0,!0,!0),this._style.footerRowStyle()&&this._style.footerRowStyle()._compose(i,!0,f,!0,u),u&&this._highlightLastColumn&&this._style.highlightLastColumnStyle()&&this._style.highlightLastColumnStyle()._compose(i,!1,!0,!0,!0),f&&this._highlightFirstColumn&&this._style.highlightFirstColumnStyle()&&this._style.highlightFirstColumnStyle()._compose(i,!1,!0,!0,!0);else{u&&this._highlightLastColumn&&this._style.highlightLastColumnStyle()&&this._style.highlightLastColumnStyle()._compose(i,w,!0,p,!0),f&&this._highlightFirstColumn&&this._style.highlightFirstColumnStyle()&&this._style.highlightFirstColumnStyle()._compose(i,w,!0,p,!0),d=this._showHeader?n-this._row-1:n-this._row,k=t-this._col;if(o){for(b=0,g=0,s=this.dataRange().row;s<n;s++)o.getRowHeight(s)>0&&b
++;for(h=this._col;h<t;h++)o.getColumnWidth(h)>0&&g++;d=b,k=g}this.bandRows()&&(e=this._style.firstRowStripSize()+this._style.secondRowStripSize(),e>0&&(r=d%e,r<this._style.firstRowStripSize()&&this._style.firstRowStripStyle()?(a=r===0,l=y||r===this._style.firstRowStripSize()-1,this._style.firstRowStripStyle()._compose(i,a,f,l,u)):r>=this._style.firstRowStripSize()&&this._style.secondRowStripStyle()&&(a=r===this._style.firstRowStripSize(),l=y||r===e-1,this._style.secondRowStripStyle()._compose(i,a,f,l,u)))),this.bandColumns()&&(e=this._style.firstColumnStripSize()+this._style.secondColumnStripSize(),e>0&&(r=k%e,r<this._style.firstColumnStripSize()&&this._style.firstColumnStripStyle()?(c=r===0,v=u||r===this._style.firstColumnStripSize()-1,this._style.firstColumnStripStyle()._compose(i,nt,c,y,v)):r>=this._style.firstColumnStripSize()&&this._style.secondColumnStripStyle()&&(c
=r===this._style.firstColumnStripSize(),v=u||r===e-1,this._style.secondColumnStripStyle()._compose(i,nt,c,y,v))))}this._style.wholeTableStyle()&&this._style.wholeTableStyle()._compose(i,w,f,p,u)},t.prototype._moveTo=function(t,i){if(t===this._row&&i===this._col)return;var r=this._getSheet();if(r){if(t<0||r.getRowCount()<t+this._rowCount)throw new Error(n._StringResource.Exp_TableMoveOutOfRange);if(i<0||r.getColumnCount()<i+this._colCount)throw new Error(n._StringResource.Exp_TableMoveOutOfRange);r.moveTo(this._row,this._col,t,i,this._rowCount,this._colCount,n.CopyToOption.Value)}this._row=t,this._col=i,this._updateFilter()},t.prototype._resize=function(t,i){var f,v,o,c,r,e,s,h,y,l,a;if(t===this._rowCount&&i===this._colCount)return;f=0,v=1,this._showHeader&&(f=f+1),this._showFooter&&(f=f+1);if(t<f||i<v)throw new Error(n._StringResource.Exp_TableResizeOutOfRange);o=this._getSheet();if(o)if(this._row+t>o.getRowCount()||this._
col+i>o.getColumnCount())throw new Error(n._StringResource.Exp_TableResizeOutOfRange);c=this._columns,r=this._colCount,this._colCount=i;if(i>r){for(e=i-r,s=0;s<e;s++)h=new u,c.push(h),h.id(this._newAutoId());this._showHeader&&this._syncHeader(r,e),this._showFooter&&this._syncFooter(r,e)}else i<r&&(y=r-i,c.splice(i,y));t!==this._rowCount&&(l=this._showFooter,l&&(this._syncFooter(),a=this.footerIndex()),this._rowCount=t,l&&(this._syncSheetByFooter(),this._clearSheetRow(a))),this._updateFilter()},t.prototype._updateFilter=function(){this._rowFilter&&(this._rowFilter._updateRange(this.dataRange()),this._rowFilter.reFilter())},t.prototype._hasColumnName=function(t){var i,r;for(t!==null&&(t=n.util.toString(t)),i=0;i<this._colCount;i++){r=this.getColumnName(i);if(t===r)return!0}return!1},t.prototype._setHeader=function(n,t,i){var r,f,u;if(!this._showHeader||this.headerIndex()!==n||!this._columns)return;r=t-this.
_col,f=this._columns,0<=r&&r<f.length&&(u=f[r],u&&u.name(i))},t.prototype._setFooterFormula=function(n,t,i){var r,f,u;if(!this._showFooter||this.footerIndex()!==n||!this._columns)return;r=t-this._col,f=this._columns,0<=r&&r<f.length&&(u=f[r],u&&u.formula(i))},t.prototype._setFooterValue=function(n,t,i){var r,f,u;if(!this._showFooter||this.footerIndex()!==n||!this._columns)return;r=t-this._col,f=this._columns,0<=r&&r<f.length&&(u=f[r],u&&u.value(i))},t.prototype._getColumn=function(n){var t=this.range();return t.col<=n&&n<t.col+t.colCount?this._columns[n-t.col]:null},t.prototype._newAutoId=function(){var n;if(!this._columns||this._columns.length===0)return-1;var u=this._columns,r=[],i,t=u.length;for(n=0;n<t;n++)i=u[n],i&&i.isAutoId()&&r.push(i.id());r.sort(function(n,t){return n-t}),t=r.length;if(t>0){for(n=0;n<t;n++)if(r[n]!==n+1)return n+1;return t+1}retu
rn 1},t.prototype._syncHeader=function(n,t){var u,f,i;if(!this._showHeader||!this._columns||!(u=this._getSheet()))return;var e=this.headerIndex(),o=this._col,s=this._columns,r;for((n===undefined||n===null)&&(n=0),(t===undefined||t===null)&&(t=s.length),i=n;i<t;i++)r=s[i],r&&(f=u.getText(e,o+i),u.setFormula(e,o+i,null),f?r.name(f):u.setText(e,o+i,r.name()))},t.prototype._syncFooter=function(n,t){var u,s,f,i;if(!this._showFooter||!this._columns||!(u=this._getSheet()))return;var o=this.footerIndex(),e=this._col,h=this._columns,r;for((n===undefined||n===null)&&(n=0),(t===undefined||t===null)&&(t=h.length),i=n;i<t;i++)r=h[i],r&&(s=u.getFormula(o,e+i),s?r.formula(s):u.setFormula(o,e+i,r.formula()),f=u.getValue(o,e+i),f!==undefined&&f!==null?r.value(f):u.setValue(o,e+i,r.value()))},t.prototype._clearHeader=function(n,t){var r,u,f,i;if(!this._showHeader||!this._columns)return;for(r=this._columns,(n===undefined||n===null)&&
;(n=0),(t===undefined||t===null)&&(t=r.length),f=Math.min(r.length,n+t),i=n;i<f;i++)u=r[i],u&&u.name(null)},t.prototype._clearFooter=function(n,t){var u,r,f,i;if(!this._showFooter||!this._columns)return;for(u=this._columns,(n===undefined||n===null)&&(n=0),(t===undefined||t===null)&&(t=u.length),f=Math.min(u.length,n+t),i=n;i<f;i++)r=u[i],r&&(r.formula(null),r.value(null))},t.prototype._syncSheetByFooter=function(){var i,n;if(!this._showFooter||!this._columns)return;i=this._getSheet();if(!i)return;var f=this._columns,e=f.length,t,o=this._col,r,u=this.footerIndex();for(n=0;n<e;n++)t=f[n],t&&(r=o+n,i.setValue(u,r,t.value()),i.setFormula(u,r,t.formula()))},t.prototype._clearSheetRow=function(n){var i=this._getSheet(),u,f,r,t;if(!i)return;if(n<0||i.getRowCount()<=n)return;for(u=this._col,f=this._colCount,t=0;t<f;t++)r=u+t,i.setFormula(n,r,null),i.setValue(n,r,null)},t.prototype._addRows=function(n,t){if(n>=this._row+thi
s._rowCount)return;var r=this._row,i=this._row+this._rowCount-1;n>r?n>i||(this._rowCount+=t):this._row+=t,this._rowFilter&&this._rowFilter._addRows(n,t)},t.prototype._addColumns=function(n,t){var f,i,r;if(n>=this._col+this._colCount)return;if(n>this._col){if(n<this._col+this._colCount){this._colCount+=t,f=this._columns;if(f)for(i=0;i<t;i++)r=new u,f.splice(n+i-this._col,0,r),r.id(this._newAutoId())}}else this._col+=t;this._rowFilter&&this._rowFilter._addColumns(n,t)},t.prototype._removeRows=function(n,t){if(n>=this._row+this._rowCount)return;var r=this._row,i=this._row+this._rowCount-1;n<r?n+t>r||(this._row-=t):n===r?this._showHeader||(this._rowCount-=Math.min(i-n+1,t)):n>i||(this._rowCount-=Math.min(i-n+1,t),n===i&&this._showFooter&&(this._showFooter=!1)),this._rowFilter&&this._rowFilter._removeRows(n,t)},t.prototype._removeColumns=function(n,t){var r,u,i;if(n>=this._col+this._colCount)return;r=this._col,u=thi
s._col+this._colCount-1,n<r?n+t>r?(this._col=n,this._colCount-=n+t-r,i=this._columns,i&&i.splice(0,n+t-r)):this._col-=t:(this._colCount-=Math.min(u-n+1,t),i=this._columns,i&&i.splice(n-r,Math.min(u-n+1,t))),this._rowFilter&&this._rowFilter._removeColumns(n,t)},t.prototype._clear=function(t,i,r,u){var s=r,h=u,l=this._getSheet(),v,o,y,f;l&&(s=l.getRowCount(),h=l.getColumnCount());var e=t<0?0:t,w=i<0?0:i,a=t<0?s:r,b=i<0?h:u,p=new n.Range(e,w,a,b),c=this.headerIndex();this._showHeader&&e<=c&&c<e+a&&(v=new n.Range(c,this._col,1,this._colCount),f=p.getIntersect(v,s,h),f&&this._clearHeader(f.col-this._col,f.colCount)),o=this.footerIndex(),this._showFooter&&e<=o&&o<e+a&&(y=new n.Range(o,this._col,1,this._colCount),f=p.getIntersect(y,s,h),f&&this._clearFooter(f.col-this._col,f.colCount)),this._rowFilter&&this._rowFilter._clear(t,i,r,u)},t.prototype._copy=funct
ion(n,t,i,r,u,f){},t.prototype._move=function(n,t,i,r,u,f){},t.prototype.toJSON=function(){return{name:this._name,row:this._row,col:this._col,rowCount:this._rowCount,colCount:this._colCount,showHeader:this._showHeader,showFooter:this._showFooter,highlightFirstColumn:this._highlightFirstColumn,highlightLastColumn:this._highlightLastColumn,bandRows:this._bandRows,bandColumns:this._bandColumns,style:this._style?this._style.toJSON():null,dataSource:this._bindingManager?this._bindingManager.getSource():null,columns:this._columns,rowFilter:this._rowFilter?this._rowFilter.toJSON():null}},t.prototype.fromJSON=function(t){var h,i,l,o;if(!t)return;this._name=t.name,this._row=t.row,this._col=t.col,this._rowCount=t.rowCount,this._colCount=t.colCount,this._showHeader=t.showHeader,this._showFooter=t.showFooter,this._highlightFirstColumn=t.highlightFirstColumn,this._highlightLastColumn=t.highlightLastColumn,this._bandRows=t.bandRows,this._bandColumns=t.bandColumns,t.style&&(h=new r,h.fromJ
SON(t.style),this._style=h),t.dataSource&&(this._bindingManager=new n._BindingManager(t.dataSource));if(t.columns){var a=t.columns,c=a.length,s=[],f,e;for(i=0;i<c;i++)e=a[i],f=new u,f.id(e._id).name(e._name).value(e._fvalue).formula(e._fformula),s.push(f);for(this._columns=s,i=0;i<c;i++)f=s[i],f.isAutoId()||f.id(this._newAutoId())}t.rowFilter&&n.features.filter&&(l=t.rowFilter,o=new n._TableFilter,o.table(this),o.fromJSON(l),this._rowFilter=o)},t}();n.SheetTable=o,u=function(){function n(n){this._id=n,this._name=null,this._fformula=null,this._fvalue=null}return n.prototype.id=function(n){return arguments.length===0?this._id:(this._id=n,this)},n.prototype.isAutoId=function(){return this._id>0?!0:!1},n.prototype.name=function(n){return arguments.length===0?this._name?this._name:s+this._id:(this._name=n,this)},n.prototype.value=function(n){return arguments.length===0?this._fvalue:(this._fvalue=n,this)},n.prototype.formula=function(n){return arguments.le
ngth===0?this._fformula:(this._fformula=n,this)},n}(),n._TableColumn=u,t=function(){function t(n,t,i,r,u,f,e,o,s){this.backColor=n,this.foreColor=t,this.font=i,this.borderLeft=r,this.borderTop=u,this.borderRight=f,this.borderBottom=e,this.borderHorizontal=o,this.borderVertical=s}return t.prototype._compose=function(n,t,r,u,f){typeof this.backColor!==i&&typeof n.backColor===i&&(n.backColor=this.backColor),typeof this.foreColor!==i&&typeof n.foreColor===i&&(n.foreColor=this.foreColor),typeof this.font!==i&&typeof n.font===i&&(n.font=this.font),r&&typeof this.borderLeft!==i&&typeof n.borderLeft===i&&(n.borderLeft=this.borderLeft),t&&typeof this.borderTop!==i&&typeof n.borderTop===i&&(n.borderTop=this.borderTop),f&&typeof this.borderRight!==i&&typeof n.borderRight===i&&(n.borderRight=this.borderRight),u&&typeof this.borderBottom!==i&&typeof n.borderBott
om===i&&(n.borderBottom=this.borderBottom),u||typeof this.borderHorizontal===i||typeof n.borderBottom!==i||(n.borderBottom=this.borderHorizontal),f||typeof this.borderVertical===i||typeof n.borderRight!==i||(n.borderRight=this.borderVertical)},t.prototype.toJSON=function(){return{backColor:this.backColor,foreColor:this.foreColor,font:this.font,borderLeft:this.borderLeft?this.borderLeft.toJSON():this.borderLeft,borderTop:this.borderTop?this.borderTop.toJSON():this.borderTop,borderRight:this.borderRight?this.borderRight.toJSON():this.borderRight,borderBottom:this.borderBottom?this.borderBottom.toJSON():this.borderBottom,borderHorizontal:this.borderHorizontal?this.borderHorizontal.toJSON():this.borderHorizontal,borderVertical:this.borderVertical?this.borderVertical.toJSON():this.borderVertical}},t.prototype.fromJSON=function(t){var e,o,s,r,u,f;if(!t)return;typeof t.backColor!==i&&(this.backColor=t.backColor),typeof t.foreColor!==i&&(this.foreColor=t.foreColor),t
ypeof t.font!==i&&(this.font=t.font),typeof t.borderLeft!==i&&(e=new n.LineBorder,e.fromJSON(t.borderLeft),this.borderLeft=e),typeof t.borderTop!==i&&(o=new n.LineBorder,o.fromJSON(t.borderTop),this.borderTop=o),typeof t.borderRight!==i&&(s=new n.LineBorder,s.fromJSON(t.borderRight),this.borderRight=s),typeof t.borderBottom!==i&&(r=new n.LineBorder,r.fromJSON(t.borderBottom),this.borderBottom=r),typeof t.borderHorizontal!==i&&(u=new n.LineBorder,u.fromJSON(t.borderHorizontal),this.borderHorizontal=u),typeof t.borderVertical!==i&&(f=new n.LineBorder,f.fromJSON(t.borderVertical),this.borderVertical=f)},t}(),n.TableStyleInfo=t,r=function(){function n(){this._lastFooterCellStyle=null,this._init()}return n.prototype.name=function(n){return arguments.length===0?this._name:(this._name=n,this)},n.prototype.wholeTableStyle=function(n){return arguments.length===0?this._wholeTableStyle:(this._wholeTableStyle=n,this)},n.prototype.headerRow
Style=function(n){return arguments.length===0?this._headerRowStyle:(this._headerRowStyle=n,this)},n.prototype.footerRowStyle=function(n){return arguments.length===0?this._footerRowStyle:(this._footerRowStyle=n,this)},n.prototype.firstRowStripStyle=function(n){return arguments.length===0?this._firstRowStripStyle:(this._firstRowStripStyle=n,this)},n.prototype.secondRowStripStyle=function(n){return arguments.length===0?this._secondRowStripStyle:(this._secondRowStripStyle=n,this)},n.prototype.firstRowStripSize=function(n){return arguments.length===0?this._firstRowStripSize:(this._firstRowStripSize=n,this)},n.prototype.secondRowStripSize=function(n){return arguments.length===0?this._secondRowStripSize:(this._secondRowStripSize=n,this)},n.prototype.firstColumnStripStyle=function(n){return arguments.length===0?this._firstColumnStripStyle:(this._firstColumnStripStyle=n,this)},n.prototype.secondColumnStripStyle=function(n){return arguments.length===0?this._secondColumnStripStyle:(this._secon
dColumnStripStyle=n,this)},n.prototype.firstColumnStripSize=function(n){return arguments.length===0?this._firstColumnStripSize:(this._firstColumnStripSize=n,this)},n.prototype.secondColumnStripSize=function(n){return arguments.length===0?this._secondColumnStripSize:(this._secondColumnStripSize=n,this)},n.prototype.highlightFirstColumnStyle=function(n){return arguments.length===0?this._highlightFirstColumnStyle:(this._highlightFirstColumnStyle=n,this)},n.prototype.highlightLastColumnStyle=function(n){return arguments.length===0?this._highlightLastColumnStyle:(this._highlightLastColumnStyle=n,this)},n.prototype.firstHeaderCellStyle=function(n){return arguments.length===0?this._firstHeaderCellStyle:(this._firstHeaderCellStyle=n,this)},n.prototype.lastHeaderCellStyle=function(n){return arguments.length===0?this._lastHeaderCellStyle:(this._lastHeaderCellStyle=n,this)},n.prototype.firstFooterCellStyle=function(n){return arguments.length===0?this._firstFooterCellStyle:(this._firstFooterCel
lStyle=n,this)},n.prototype.lastFooterCellStyle=function(n){return arguments.length===0?this._lastFooterCellStyle:(this._lastFooterCellStyle=n,this)},n.prototype._init=function(){this._name=null,this._headerRowStyle=null,this._footerRowStyle=null,this._wholeTableStyle=null,this._highlightLastColumnStyle=null,this._highlightFirstColumnStyle=null,this._firstRowStripStyle=null,this._secondRowStripStyle=null,this._firstColumnStripStyle=null,this._secondColumnStripStyle=null,this._firstHeaderCellStyle=null,this._lastHeaderCellStyle=null,this._firstFooterCellStyle=null,this._lastFooterCellStyle=null,this._firstRowStripSize=1,this._secondRowStripSize=1,this._firstColumnStripSize=1,this._secondColumnStripSize=1},n.prototype.toJSON=function(){var t={_name:this._name,_firstRowStripSize:this._firstRowStripSize,_secondRowStripSize:this._secondRowStripSize,_firstColumnStripSize:this._firstColumnStripSize,_secondColumnStripSize:this._secondColumnStripSize},n=this._headerRowStyle;return t._headerR
owStyle=n?n.toJSON():n,n=this._footerRowStyle,t._footerRowStyle=n?n.toJSON():n,n=this._wholeTableStyle,t._wholeTableStyle=n?n.toJSON():n,n=this._highlightLastColumnStyle,t._highlightLastColumnStyle=n?n.toJSON():n,n=this._highlightFirstColumnStyle,t._highlightFirstColumnStyle=n?n.toJSON():n,n=this._firstRowStripStyle,t._firstRowStripStyle=n?n.toJSON():n,n=this._secondRowStripStyle,t._secondRowStripStyle=n?n.toJSON():n,n=this._firstColumnStripStyle,t._firstColumnStripStyle=n?n.toJSON():n,n=this._secondColumnStripStyle,t._secondColumnStripStyle=n?n.toJSON():n,n=this._firstHeaderCellStyle,t._firstHeaderCellStyle=n?n.toJSON():n,n=this._lastHeaderCellStyle,t._lastHeaderCellStyle=n?n.toJSON():n,n=this._firstFooterCellStyle,t._firstFooterCellStyle=n?n.toJSON():n,n=this._lastFooterCellStyle,t._lastFooterCellStyle=n?n.toJSON():n,t},n.prototype.fromJSON=function(n){var r;if(!n)return;typeof n._name!==i&&(this._name=n._name),typeof n._firstRowStripSize!==i&&(this._firstRowStripS
ize=n._firstRowStripSize),typeof n._secondRowStripSize!==i&&(this._secondRowStripSize=n._secondRowStripSize),typeof n._firstColumnStripSize!==i&&(this._firstColumnStripSize=n._firstColumnStripSize),typeof n._secondColumnStripSize!==i&&(this._secondColumnStripSize=n._secondColumnStripSize),typeof n._headerRowStyle!==i&&(r=new t,r.fromJSON(n._headerRowStyle),this._headerRowStyle=r),typeof n._footerRowStyle!==i&&(r=new t,r.fromJSON(n._footerRowStyle),this._footerRowStyle=r),typeof n._wholeTableStyle!==i&&(r=new t,r.fromJSON(n._wholeTableStyle),this._wholeTableStyle=r),typeof n._highlightLastColumnStyle!==i&&(r=new t,r.fromJSON(n._highlightLastColumnStyle),this._highlightLastColumnStyle=r),typeof n._highlightFirstColumnStyle!==i&&(r=new t,r.fromJSON(n._highlightFirstColumnStyle),this._highlightFirstColumnStyle=r),typeof n._firstRowStripStyle!==i&&(r=new t,r.fromJSON(n._firstRowStripStyle),this._firstRowStripStyle=r)
,typeof n._secondRowStripStyle!==i&&(r=new t,r.fromJSON(n._secondRowStripStyle),this._secondRowStripStyle=r),typeof n._firstColumnStripStyle!==i&&(r=new t,r.fromJSON(n._firstColumnStripStyle),this._firstColumnStripStyle=r),typeof n._secondColumnStripStyle!==i&&(r=new t,r.fromJSON(n._secondColumnStripStyle),this._secondColumnStripStyle=r),typeof n._firstHeaderCellStyle!==i&&(r=new t,r.fromJSON(n._firstHeaderCellStyle),this._firstHeaderCellStyle=r),typeof n._lastHeaderCellStyle!==i&&(r=new t,r.fromJSON(n._lastHeaderCellStyle),this._lastHeaderCellStyle=r),typeof n._firstFooterCellStyle!==i&&(r=new t,r.fromJSON(n._firstFooterCellStyle),this._firstFooterCellStyle=r),typeof n._lastFooterCellStyle!==i&&(r=new t,r.fromJSON(n._lastFooterCellStyle),this._lastFooterCellStyle=r)},n}(),n.TableStyle=r,f=function(){function u(){}return u.light1=function(){return u._getLightStyle(1)},u.light2=function(){return u._getLightStyle(2)},u.light3=fun
ction(){return u._getLightStyle(3)},u.light4=function(){return u._getLightStyle(4)},u.light5=function(){return u._getLightStyle(5)},u.light6=function(){return u._getLightStyle(6)},u.light7=function(){return u._getLightStyle(7)},u.light8=function(){return u._getLightStyle(8)},u.light9=function(){return u._getLightStyle(9)},u.light10=function(){return u._getLightStyle(10)},u.light11=function(){return u._getLightStyle(11)},u.light12=function(){return u._getLightStyle(12)},u.light13=function(){return u._getLightStyle(13)},u.light14=function(){return u._getLightStyle(14)},u.light15=function(){return u._getLightStyle(15)},u.light16=function(){return u._getLightStyle(16)},u.light17=function(){return u._getLightStyle(17)},u.light18=function(){return u._getLightStyle(18)},u.light19=function(){return u._getLightStyle(19)},u.light20=function(){return u._getLightStyle(20)},u.light21=function(){return u._getLightStyle(21)},u.medium1=function(){return u._getMediumStyle(1)},u.medium2=function(){re
turn u._getMediumStyle(2)},u.medium3=function(){return u._getMediumStyle(3)},u.medium4=function(){return u._getMediumStyle(4)},u.medium5=function(){return u._getMediumStyle(5)},u.medium6=function(){return u._getMediumStyle(6)},u.medium7=function(){return u._getMediumStyle(7)},u.medium8=function(){return u._getMediumStyle(8)},u.medium9=function(){return u._getMediumStyle(9)},u.medium10=function(){return u._getMediumStyle(10)},u.medium11=function(){return u._getMediumStyle(11)},u.medium12=function(){return u._getMediumStyle(12)},u.medium13=function(){return u._getMediumStyle(13)},u.medium14=function(){return u._getMediumStyle(14)},u.medium15=function(){return u._getMediumStyle(15)},u.medium16=function(){return u._getMediumStyle(16)},u.medium17=function(){return u._getMediumStyle(17)},u.medium18=function(){return u._getMediumStyle(18)},u.medium19=function(){return u._getMediumStyle(19)},u.medium20=function(){return u._getMediumStyle(20)},u.medium21=function(){return u._getMediumStyle(2
1)},u.medium22=function(){return u._getMediumStyle(22)},u.medium23=function(){return u._getMediumStyle(23)},u.medium24=function(){return u._getMediumStyle(24)},u.medium25=function(){return u._getMediumStyle(25)},u.medium26=function(){return u._getMediumStyle(26)},u.medium27=function(){return u._getMediumStyle(27)},u.medium28=function(){return u._getMediumStyle(28)},u.dark1=function(){return u._getDarkStyle(1)},u.dark2=function(){return u._getDarkStyle(2)},u.dark3=function(){return u._getDarkStyle(3)},u.dark4=function(){return u._getDarkStyle(4)},u.dark5=function(){return u._getDarkStyle(5)},u.dark6=function(){return u._getDarkStyle(6)},u.dark7=function(){return u._getDarkStyle(7)},u.dark8=function(){return u._getDarkStyle(8)},u.dark9=function(){return u._getDarkStyle(9)},u.dark10=function(){return u._getDarkStyle(10)},u.dark11=function(){return u._getDarkStyle(11)},u.customStyles=function(){var n=u._customStyles;return!n?null:n},u.addCustomStyles=function(t){var r,f,e,i;if(!t)return
;for(u._customStyles||(u._customStyles=[]),r=u._customStyles,f=r.length,i=0;i<f;i++){e=r[i];if(e.name()===t.name())throw new Error(n._StringResource.Exp_TableStyleAddCustomStyleError);}r.push(t)},u.removeCustomStyle=function(t){var i,r;if(!t)return!1;i=u._customStyles;if(i){r=n.util.inArray(t,i);if(r>-1)return i.splice(r,1),!0}return!1},u.removeCustomStyleByName=function(n){var i=u._customStyles,r,f,t;if(i)for(r=i.length,t=0;t<r;t++){f=i[t];if(f.name()===n)return i.splice(t,1),!0}return!1},u._getLightStyle=function(n){var r=n-1,t;typeof u._lights===i&&(u._lights={});if(u._lights[r])return u._lights[r];t=null;switch(Math.floor(r/7)){case 0:t=u._createLightA(r%7);break;case 1:t=u._createLightB(r%7);break;case 2:t=u._createLightC(r%7);break}return t?(t.name("Light"+n),u._lights[r]=t,t):null},u._createLightA=function(i){var s=u._getTheme(i),o=s+" 80",e=s,f=new r;return f.headerRowStyle(new t),f.headerRowStyle().borderBottom=new n.LineBorder(e,n.LineS
tyle.thin),f.headerRowStyle().font="bold 10pt arial",f.headerRowStyle().foreColor=e,f.wholeTableStyle(new t),f.wholeTableStyle().borderTop=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderBottom=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().foreColor=e,f.firstRowStripStyle(new t),f.firstRowStripStyle().backColor=o,f.highlightFirstColumnStyle(new t),f.highlightFirstColumnStyle().font="bold 10pt arial",f.highlightFirstColumnStyle().foreColor=e,f.highlightLastColumnStyle(new t),f.highlightLastColumnStyle().font="bold 10pt arial",f.highlightLastColumnStyle().foreColor=e,f.firstColumnStripStyle(new t),f.firstColumnStripStyle().backColor=o,f.footerRowStyle(new t),f.footerRowStyle().borderTop=new n.LineBorder(e,n.LineStyle.thin),f.footerRowStyle().font="bold 10pt arial",f.footerRowStyle().foreColor=e,f},u._createLightB=function(i){var o=u._getTheme(i),e=o,f=new r;return f.headerRowStyle(new t),f.headerRowStyle().backColor=e,f
.headerRowStyle().font="bold 10pt arial",f.headerRowStyle().foreColor="white",f.wholeTableStyle(new t),f.wholeTableStyle().borderLeft=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderTop=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderBottom=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderRight=new n.LineBorder(e,n.LineStyle.thin),f.firstRowStripStyle(new t),f.firstRowStripStyle().borderTop=new n.LineBorder(e,n.LineStyle.thin),f.secondRowStripStyle(new t),f.secondRowStripStyle().borderTop=new n.LineBorder(e,n.LineStyle.thin),f.firstColumnStripStyle(new t),f.firstColumnStripStyle().borderLeft=new n.LineBorder(e,n.LineStyle.thin),f.secondColumnStripStyle(new t),f.secondColumnStripStyle().borderLeft=new n.LineBorder(e,n.LineStyle.thin),f.highlightFirstColumnStyle(new t),f.highlightFirstColumnStyle().font="bold 10pt arial",f.highlightLastColumnStyle(new t),f.highlightLastColumnStyle().font="bold 10pt arial&qu
ot;,f.footerRowStyle(new t),f.footerRowStyle().borderTop=new n.LineBorder(e,n.LineStyle.double),f.footerRowStyle().font="bold 10pt arial",f},u._createLightC=function(i){var s=u._getTheme(i),o=s+" 80",e=s,f=new r;return f.headerRowStyle(new t),f.headerRowStyle().borderBottom=new n.LineBorder(e,n.LineStyle.medium),f.headerRowStyle().font="bold 10pt arial",f.wholeTableStyle(new t),f.wholeTableStyle().borderLeft=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderTop=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderRight=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderBottom=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderHorizontal=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderVertical=new n.LineBorder(e,n.LineStyle.thin),f.firstRowStripStyle(new t),f.firstRowStripStyle().backColor=o,f.firstColumnStripStyle(new t),f.firstColumnStripStyle().backColor=o,f.highlightFirstColumnStyle(new t)
,f.highlightFirstColumnStyle().font="bold 10pt arial",f.highlightLastColumnStyle(new t),f.highlightLastColumnStyle().font="bold 10pt arial",f.footerRowStyle(new t),f.footerRowStyle().borderTop=new n.LineBorder(e,n.LineStyle.double),f.footerRowStyle().font="bold 10pt arial",f},u._getMediumStyle=function(n){var r=n-1,t;typeof u._mediums===i&&(u._mediums={});if(u._mediums[r])return u._mediums[r];t=null;switch(Math.floor(r/7)){case 0:t=u._createMediumA(r%7);break;case 1:t=u._createMediumB(r%7);break;case 2:t=u._createMediumC(r%7);break;case 3:t=u._createMediumD(r%7);break}return t?(t.name("Medium"+n),u._mediums[r]=t,t):null},u._createMediumA=function(i){var o=u._getTheme(i),e=o+" 20",h=o,s=o+" 80",f=new r;return f.headerRowStyle(new t),f.headerRowStyle().backColor=h,f.headerRowStyle().font="bold 10pt arial",f.headerRowStyle().foreColor="white",f.wholeTableStyle(new t),f.wholeTableStyle().borderHorizo
ntal=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderLeft=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderRight=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderBottom=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderTop=new n.LineBorder(e,n.LineStyle.thin),f.firstRowStripStyle(new t),f.firstRowStripStyle().backColor=s,f.firstColumnStripStyle(new t),f.firstColumnStripStyle().backColor=s,f.highlightFirstColumnStyle(new t),f.highlightFirstColumnStyle().font="bold 10pt arial",f.highlightLastColumnStyle(new t),f.highlightLastColumnStyle().font="bold 10pt arial",f.footerRowStyle(new t),f.footerRowStyle().borderTop=new n.LineBorder(e,n.LineStyle.double),f.footerRowStyle().font="bold 10pt arial",f.footerRowStyle().foreColor="black",f},u._createMediumB=function(i){var s=u._getTheme(i),e="white",o=s,h=s+" 60",c=s+" 80",f=new r;return f.headerRowStyle(new t),f.header
RowStyle().backColor=o,f.headerRowStyle().borderBottom=new n.LineBorder(e,n.LineStyle.medium),f.headerRowStyle().borderVertical=new n.LineBorder(e,n.LineStyle.thin),f.headerRowStyle().font="bold 10pt arial",f.headerRowStyle().foreColor="white",f.wholeTableStyle(new t),f.wholeTableStyle().borderHorizontal=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderVertical=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().backColor=c,f.firstRowStripStyle(new t),f.firstRowStripStyle().backColor=h,f.firstColumnStripStyle(new t),f.firstColumnStripStyle().backColor=h,f.highlightFirstColumnStyle(new t),f.highlightFirstColumnStyle().backColor=o,f.highlightFirstColumnStyle().foreColor="white",f.highlightFirstColumnStyle().font="bold 10pt arial",f.highlightLastColumnStyle(new t),f.highlightLastColumnStyle().backColor=o,f.highlightLastColumnStyle().foreColor="white",f.highlightLastColumnStyle().font="bold 10pt arial",f.foot
erRowStyle(new t),f.footerRowStyle().borderTop=new n.LineBorder(e,n.LineStyle.medium),f.footerRowStyle().borderVertical=new n.LineBorder(e,n.LineStyle.thin),f.footerRowStyle().backColor=o,f.footerRowStyle().foreColor="white",f.footerRowStyle().font="bold 10pt arial",f},u._createMediumC=function(i){var h=u._getTheme(i),e=h,s="#D3D3D3",c="white",o=i===0?"black":"#D3D3D3",f=new r;return f.headerRowStyle(new t),f.headerRowStyle().backColor=e,f.headerRowStyle().borderTop=new n.LineBorder("black",n.LineStyle.medium),f.headerRowStyle().borderBottom=new n.LineBorder("black",n.LineStyle.medium),f.headerRowStyle().font="bold 10pt arial",f.headerRowStyle().foreColor="white",f.wholeTableStyle(new t),f.wholeTableStyle().borderLeft=new n.LineBorder(o,n.LineStyle.thin),f.wholeTableStyle().borderRight=new n.LineBorder(o,n.LineStyle.thin),f.wholeTableStyle().borderTop=new n.LineBorder("black"
;,n.LineStyle.medium),f.wholeTableStyle().borderVertical=new n.LineBorder(o,n.LineStyle.thin),i===0&&(f.wholeTableStyle().borderHorizontal=new n.LineBorder(o,n.LineStyle.thin)),f.wholeTableStyle().borderBottom=new n.LineBorder("black",n.LineStyle.medium),f.firstRowStripStyle(new t),f.firstRowStripStyle().backColor=s,f.firstColumnStripStyle(new t),f.firstColumnStripStyle().backColor=s,f.highlightFirstColumnStyle(new t),f.highlightFirstColumnStyle().backColor=e,f.highlightFirstColumnStyle().foreColor="white",f.highlightLastColumnStyle(new t),f.highlightLastColumnStyle().backColor=e,f.highlightLastColumnStyle().foreColor="white",f.firstFooterCellStyle(new t),f.firstFooterCellStyle().backColor=e,f.firstFooterCellStyle().font="bold 10pt arial",f.firstFooterCellStyle().foreColor="white",f.lastFooterCellStyle(new t),f.lastFooterCellStyle().backColor=e,f.lastFooterCellStyle().font="bold 10pt arial",f.lastFooterCellStyle().f
oreColor="white",f.footerRowStyle(new t),f.footerRowStyle().foreColor="black",f.footerRowStyle().borderTop=new n.LineBorder("black",n.LineStyle.double),f},u._createMediumD=function(i){var o=u._getTheme(i),c=o,e=o+" 40",h=o+" 80",s=o+" 60",l=o+" 80",f=new r;return f.headerRowStyle(new t),f.headerRowStyle().backColor=h,f.headerRowStyle().borderVertical=new n.LineBorder(e,n.LineStyle.thin),f.headerRowStyle().borderLeft=new n.LineBorder(e,n.LineStyle.thin),f.headerRowStyle().borderTop=new n.LineBorder(e,n.LineStyle.thin),f.headerRowStyle().borderRight=new n.LineBorder(e,n.LineStyle.thin),f.headerRowStyle().borderBottom=new n.LineBorder(e,n.LineStyle.thin),f.headerRowStyle().font="bold 10pt arial",f.headerRowStyle().foreColor="black",f.wholeTableStyle(new t),f.wholeTableStyle().borderVertical=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderHorizontal=new n.LineBorder(e,n.LineStyle.thi
n),f.wholeTableStyle().borderLeft=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderTop=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderRight=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().borderBottom=new n.LineBorder(e,n.LineStyle.thin),f.wholeTableStyle().backColor=h,f.firstRowStripStyle(new t),f.firstRowStripStyle().backColor=s,f.firstColumnStripStyle(new t),f.firstColumnStripStyle().backColor=s,f.highlightFirstColumnStyle(new t),f.highlightFirstColumnStyle().font="bold 10pt arial",f.highlightLastColumnStyle(new t),f.highlightLastColumnStyle().font="bold 10pt arial",f.footerRowStyle(new t),f.footerRowStyle().backColor=l,f.footerRowStyle().foreColor="black",f.footerRowStyle().font="bold 10pt arial",f.footerRowStyle().borderLeft=new n.LineBorder(e,n.LineStyle.thin),f.footerRowStyle().borderTop=new n.LineBorder(c,n.LineStyle.medium),f.footerRowStyle().borderRight=new n.LineBorder(e,n.LineStyle.thin),f.foo
terRowStyle().borderBottom=new n.LineBorder(e,n.LineStyle.thin),f.footerRowStyle().borderVertical=new n.LineBorder(e,n.LineStyle.thin),f},u._getDarkStyle=function(n){var r=n-1,t;typeof u._darks===i&&(u._darks={});if(u._darks[r])return u._darks[r];t=null;switch(Math.floor(r/7)){case 0:t=u._createDarkA(r%7);break;case 1:t=u._createDarkB(r%7);break}return t!=null?(t.name("Dark"+n),u._darks[r]=t,t):null},u._createDarkA=function(i){var e=u._getTheme(i),s="black",o=i===0?e+" 25":e+" -25",c=i===0?e+" 50":e,h=i===0?e:e+" -50",f=new r;return f.headerRowStyle(new t),f.headerRowStyle().backColor=s,f.headerRowStyle().font="bold 10pt arial",f.headerRowStyle().foreColor="white",f.headerRowStyle().borderBottom=new n.LineBorder("white",n.LineStyle.medium),f.wholeTableStyle(new t),f.wholeTableStyle().backColor=c,f.wholeTableStyle().foreColor="white",f.firstRowStripStyle(new t),f.firstRowStripS
tyle().backColor=o,f.firstColumnStripStyle(new t),f.firstColumnStripStyle().backColor=o,f.highlightFirstColumnStyle(new t),f.highlightFirstColumnStyle().font="bold 10pt arial",f.highlightFirstColumnStyle().borderRight=new n.LineBorder("white",n.LineStyle.medium),f.highlightFirstColumnStyle().backColor=o,f.highlightFirstColumnStyle().foreColor="white",f.highlightLastColumnStyle(new t),f.highlightLastColumnStyle().font="bold 10pt arial",f.highlightLastColumnStyle().borderLeft=new n.LineBorder("white",n.LineStyle.medium),f.highlightLastColumnStyle().backColor=o,f.highlightLastColumnStyle().foreColor="white",f.footerRowStyle(new t),f.footerRowStyle().backColor=h,f.footerRowStyle().font="bold 10pt arial",f.footerRowStyle().foreColor="white",f.footerRowStyle().borderTop=new n.LineBorder("white",n.LineStyle.medium),f},u._createDarkB=function(i){var c=u._getTheme(i),h=u._getHeaderColor(i),e=u._getStrip
Color(i),o=u._getTableBackground(i),s=o,f=new r;return f.headerRowStyle(new t),f.headerRowStyle().backColor=h,f.headerRowStyle().foreColor="white",f.wholeTableStyle(new t),f.wholeTableStyle().backColor=o,f.firstRowStripStyle(new t),f.firstRowStripStyle().backColor=e,f.firstColumnStripStyle(new t),f.firstColumnStripStyle().backColor=e,f.highlightFirstColumnStyle(new t),f.highlightFirstColumnStyle().font="bold 10pt arial",f.highlightLastColumnStyle(new t),f.highlightLastColumnStyle().font="bold 10pt arial",f.footerRowStyle(new t),f.footerRowStyle().backColor=s,f.footerRowStyle().font="bold 10pt arial",f.footerRowStyle().borderTop=new n.LineBorder("black",n.LineStyle.double),f},u._getTableBackground=function(n){if(n===0)return"Background 1 -15";else if(n===1)return"Accent 1 80";else if(n===2)return"Accent 3 80";else if(n===3)return"Accent 5 80";return""},u._getStripColor=function(n){if(n
===0)return"Background 1 -35";else if(n===1)return"Accent 1 60";else if(n===2)return"Accent 3 60";else if(n===3)return"Accent 5 60";return""},u._getHeaderColor=function(n){if(n===0)return"Text 1";else if(n===1)return"Accent 2";else if(n===2)return"Accent 4";else if(n===3)return"Accent 6";return""},u._getTheme=function(n){return n===0?"Text 1":"Accent "+n},u}(),n.TableStyles=f,e=function(){function t(n){this._sheet=n,this._tableList=[]}return t.prototype.getSheet=function(){return this._sheet},t.prototype.getCount=function(){return this._tableList.length},t.prototype.getTables=function(){return this._tableList},t.prototype.add=function(t){var u,r,i;if(!t)return;for(u=this._tableList.length,i=0;i<u;i++){r=this._tableList[i];if(r&&r.name()===t.name())throw new Error(n._StringResource.Exp_TableHasSameNameError);}return t._setOwner(this),this._tableList.push(
t),t.showHeader()&&t._syncHeader(),t._syncFooter()&&t._syncFooter(),t},t.prototype.remove=function(t){var f,u,r;if(!t)return;f=n.util.inArray(t,this._tableList);if(f>-1){this._tableList.splice(f,1);var i=t.range(),e=this._sheet,o=i.row,h=i.row+i.rowCount,c=i.col,s=i.col+i.colCount;for(u=o;u<h;u++)for(r=c;r<s;r++)e.setValue(u,r,null),e.setFormula(u,r,null)}},t.prototype.find=function(n,t){var f=this._tableList.length,u,r,i;if(f===0)return null;for(r=0;r<f;r++){u=this._tableList[r],i=u.range();if(i.row<=n&&n<i.row+i.rowCount&&i.col<=t&&t<i.col+i.colCount)return u}return null},t.prototype.findByRange=function(n,t,i,r){var o=this._tableList.length,e,f,u;if(o===0)return null;for(e=[],u=0;u<o;u++)f=this._tableList[u],f.range().intersect(n,t,i,r)&&e.push(f);return e},t.prototype.findByName=function(n){for(var r=this._tableList.length,i,t=0;t<r;t++){i=this._tableList[t];if(i.name()===n)return i}return null},t.prot
otype.has=function(n,t,i,r){for(var e=this._tableList.length,f,u=0;u<e;u++){f=this._tableList[u];if(f.range().intersect(n,t,i,r))return!0}return!1},t.prototype.addRows=function(n,t){for(var u=this._tableList.length,r,i=0;i<u;i++)r=this._tableList[i],r._addRows(n,t)},t.prototype.addColumns=function(n,t){for(var u=this._tableList.length,r,i=0;i<u;i++)r=this._tableList[i],r._addColumns(n,t)},t.prototype.removeRows=function(n,t){for(var f=[],o=this._tableList.length,i,u,e,r=0;r<o;r++)i=this._tableList[r],u=i.range(),e=n<=u.row&&u.row+u.rowCount<=n+t,e||(i._removeRows(n,t),f.push(i));this._tableList=f},t.prototype.removeColumns=function(n,t){for(var f=[],o=this._tableList.length,i,u,e,r=0;r<o;r++)i=this._tableList[r],u=i.range(),e=n<=u.col&&u.col+u.colCount<=n+t,e||(i._removeColumns(n,t),f.push(i));this._tableList=f},t.prototype.clear=function(t,i,r,u,f){var c=new n.Range(t,i,r,u),s,o,h,e;if((f&n.StorageType.Data)===n.StorageType.Data){for(h
=[],s=this._tableList.length,e=0;e<s;e++)o=this._tableList[e],c.containsRange(o.range())||h.push(o);for(s=h.length,e=0;e<s;e++)o=h[e],o._clear(t,i,r,u);this._tableList=h}if((f&n.StorageType.Style)===n.StorageType.Style)for(s=this._tableList.length,e=0;e<s;e++)o=this._tableList[e],c.containsRange(o.range())&&o.style(null)},t.prototype.copy=function(n,t,i,r,u,f){for(var s=this._tableList.length,o,e=0;e<s;e++)o=this._tableList[e],o._copy(n,t,i,r,u,f)},t.prototype.move=function(n,t,i,r,u,f){for(var s=this._tableList.length,o,e=0;e<s;e++)o=this._tableList[e],o._move(n,t,i,r,u,f)},t.prototype.toJSON=function(){return{tables:this._tableList}},t.prototype.fromJSON=function(n){var r,u,t,i;if(!n)return;this._tableList=[];if(n.tables)for(r=n.tables,u=r.length,t=0;t<u;t++)i=new o,i._setOwner(this),i.fromJSON(r[t]),this._tableList.push(i)},t}(),n._SheetTableManager=e})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(n){v
ar s,r,e,h,c,t,f,i,u,o;n.feature("group",["core.common"]),s=Array.prototype,s.nextNonEmptyIndex=function(n){var i,t;for(n<0&&(n=-1),i=n+1,t=i;t<this.length;t++)if(this[t]!==undefined&&this[t]!==null)return t;return-1},s.clear=function(n,t){var r,i;if(n<0)return;for(r=0,i=0;r<t&&i<this.length;i++)this[n+i]=null,r++},function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed"}(n.GroupState||(n.GroupState={})),r=n.GroupState,e=function(){function n(n,t,i,r){this.model=null,this.children=null,this.parent=null,this.start=0,this.end=0,this.level=0,this.model=n,this.start=t,this.end=i,this.level=r}return n.prototype.getState=function(){return this.model?this.model.getState(this):r.Expanded},n.prototype.setState=function(n){this.model&&this.model.expand(this.level,n===r.Expanded)},n.prototype.contains=function(n){return this.start<=n&&n<=this.end},n.prototype.addChild=function(n){n&a
mp;&(this.children||(this.children=[]),this.children.push(n),n.parent=this)},n}(),n.RangeGroupInfo=e,h=function(){function n(){this.count=0}return n.prototype.addRef=function(){this.count++},n.prototype.release=function(){this.count--},n.prototype.isWorking=function(){return this.count>0},n}(),n.WorkingState=h,c=function(){function i(t){this.head=null,this.tail=null,this.items=null,this._rootCached=null,this.direction=n.RangeGroupDirection.Forward,this.suspendAddingGroup=new h,this.items=new Array(t),this._empty=!0}return i.prototype.setDirection=function(n){this.direction=n},i.prototype.getDirection=function(){return this.direction},i.prototype._getCount=function(){return this.items?this.items.length:0},i.prototype.group=function(i,r){var f,e,u;if(!this._isIndexValid(i))throw new Error(n._StringResource.Exp_InvalidIndex);if(!this._isIndexValid(i+r-1))throw new Error(n._StringResource.Exp_InvalidCount);for(this._rootCached=null,f=0;f<r;f++)e=i+f,u=this._getModelIndexFromVi
ewIndex(e),this.items[u]?this.items[u].level++:this.items[u]=new t;this._rootCached=this.createRangeGroup(),this._empty=!1},i.prototype.ungroupRange=function(t,i){var p,b,a,d,l,v,y;if(!this._isIndexValid(t))throw new Error(n._StringResource.Exp_InvalidIndex);if(!this._isIndexValid(t+i-1))throw new Error(n._StringResource.Exp_InvalidCount);var o=!1,u=null,s=-1;if(this.direction===n.RangeGroupDirection.Forward){s=t+i,o=this._isIndexValid(s);if(o){var c=t+i-1,w=c,e=null;do p=this._getModelIndexFromViewIndex(c),e=this.items[p],e!==undefined&&e!==null&&(w=c),c--;while((e===undefined||e===null)&&c>=t);e!==undefined&&e!==null&&(u=this._findImp(this._rootCached,w,e.level),u&&(s=u.end+1),o=u&&(u.end===t+i-1||this.getState(u)===r.Collapsed))}}else if(this.direction===n.RangeGroupDirection.Backward){s=t-1,o=this._isIndexValid(s);if(o){var h=t,k=h,f=null;do b=this._getModelIndexFromViewIndex(h),f=this.items[b],f!==undefined&&f!=
=null&&(k=h),h++;while((f===undefined||f===null)&&h<t+i);f!==undefined&&f!==null&&(u=this._findImp(this._rootCached,k,f.level),u&&(s=u.start-1),o=u&&(u.start===t||this.getState(u)===r.Collapsed))}}for(this._rootCached=null,a=0;a<i;a++)d=t+a,l=this._getModelIndexFromViewIndex(d),this.items[l]&&this.items[l].level>-1&&this.items[l].level--;o&&(v=this._getModelIndexFromViewIndex(s),y=this.items[v],y&&y.level===u.level&&(this.items[v]=null)),this._rootCached=this.createRangeGroup()},i.prototype.ungroup=function(){this._rootCached=null;var n=this._getCount();this.items=new Array(n),this._rootCached=this.createRangeGroup(),this._empty=!0},i.prototype._expand=function(t,i,r){if(!this._isIndexValid(t))throw new Error(n._StringResource.Exp_InvalidIndex);if(i<-1)throw new Error(n._StringResource.Exp_InvalidLevel);var u=this.find(t,i);u&&this.expandGroup(u,r)},i.prototype.expand=function
(t,i){if(t<-1)throw new Error(n._StringResource.Exp_InvalidLevel);var r=new f(this);while(r.moveNext())this._expand(r.current,t,i)},i.prototype.expandGroup=function(t,i){if(!t)throw new Error(n._StringResource.Exp_GroupInfoIsNull);var r=-1;switch(this.direction){case n.RangeGroupDirection.Backward:r=t.start-1;break;case n.RangeGroupDirection.Forward:r=t.end+1;break}this.setCollapsed(r,!i)},i.prototype.isCollapsed=function(t){var u,i,f;if(!this._isIndexValid(t))throw new Error(n._StringResource.Exp_InvalidIndex);u=this.getLevel(t);if(u>-1)for(i=this.find(t,u),f=-1;f<=u;f++)if(i){if(i.getState()===r.Collapsed)return!0;i=i.parent;if(!i)break}return!1},i.prototype.find=function(t,i){if(this._rootCached){if(i===-1)return this._rootCached;if(!this._isIndexValid(t))throw new Error(n._StringResource.Exp_InvalidIndex);return this._findImp(this._rootCached,t,i)}return null},i.prototype.getLevel=function(t){if(!this._isIndexValid(t))throw new Error(n._StringResource.Exp_InvalidIndex);
var r=this._getModelIndexFromViewIndex(t),i=this.items[r];return i?i.level:-1},i.prototype.getCollapsed=function(n){var i=this._getModelIndexFromViewIndex(n),t=this.items[i];return t?!!t.collapsed:!1},i.prototype.setCollapsed=function(n,i){if(n<0)this.head||(this.head=new t),this.head.collapsed=i;else if(n>-1&&n<this._getCount()){var r=this._getModelIndexFromViewIndex(n);this.items[r]||(this.items[r]=new t,this.items[r].level=-1),this.items[r].collapsed=i}else n<this._getCount()||(this.tail||(this.tail=new t),this.tail.collapsed=i);this._rootCached=null,this.refresh()},i.prototype.getMaxLevel=function(){for(var i=-1,r=this.items,u=r.length,n,t=0;t<u;t++)n=r[t],n&&n.level!==undefined&&n.level>i&&(i=n.level);return i},i.prototype._move=function(n,i,r){var f,u,s,e,o;if(r>0){n<0&&(n=0),i<0&&(i=0);if(n===i)return;f=[],u=this.items.nextNonEmptyIndex(n-1);while(u>=0&&u<n+r)s=new t(this.items[u]),f.push
({index:u-n,value:s}),u=this.items.nextNonEmptyIndex(u);this.items.clear(n,r),this.items.clear(i,r);if(f.length>0)for(e=0;e<f.length;e++)o=f[e],this.items[i+o.index]=o.value;this._rootCached=null,this.refresh()}},i.prototype._copy=function(n,i,r){var f,u,s,e,o;if(r>0){n<0&&(n=0),i<0&&(i=0);if(n===i)return;f=[],u=this.items.nextNonEmptyIndex(n-1);while(u>=0&&u<n+r)s=new t(this.items[u]),f.push({index:u-n,value:s}),u=this.items.nextNonEmptyIndex(u);this.items.clear(i,r);if(f.length>0)for(e=0;e<f.length;e++)o=f[e],this.items[i+o.index]=o.value;this._rootCached=null,this.refresh()}},i.prototype._add=function(n,i){var f,e,o,s,r,u;if(i>0){for(f=this._getModelIndexFromViewIndex(n),e=f>1?this.items[f-1]:null,o=0;o<i;o++)this.items.splice(f,0,!e?null:new t(e));if(!this.suspendAddingGroup.isWorking)if(n>0){s=this._getModelIndexFromViewIndex(n-1),r=null,r=s<0?this.head:this.items[s];if(r)for(u=0;u<i;u++)this.items[n+u]=new t(
{collapsed:r.collapsed,level:r.level})}this._rootCached=null,this.refresh()}},i.prototype._remove=function(n,t){t>0&&(this.items.splice(n,t),this._rootCached=null,this.refresh())},i.prototype.equals=function(n){var t=n,i;if(t){if(!this.items&&t.items&&t.items.length>0)return!1;if(!t.items&&this.items&&this.items.length>0)return!1;if(!this.rangeGroupItemInfoEquals(this.head,t.head))return!1;if(!this.rangeGroupItemInfoEquals(this.tail,t.tail))return!1;if(this.items&&t.items){if(this.direction!==t.direction)return!1;if(this.items.length!==t.items.length)return!1;for(i=0;i<this.items.length;i++)if(!this.items[i]&&t.items[i]||this.items[i]&&!t.items[i])return!1}return!0}return!1},i.prototype._isEmpty=function(){return this._empty},i.prototype.refresh=function(){this._isEmpty()||(this._rootCached=this.createRangeGroup())},i.prototype._setCount=function(n){var i,u,r;this.items||(this.items=new Array(n)),this._rootC
ached=null,i=this._getCount();if(n<i)this.items.splice(n,i-n);else if(n>i){u=this.items[this.items.length-1];if(u)for(r=0;r<n;r++)this.items.push(new t(u));else this.items=this.items.concat(new Array(n))}},i.prototype.getState=function(t){var i=-1,u,f;switch(this.direction){case n.RangeGroupDirection.Forward:i=t.end+1;break;case n.RangeGroupDirection.Backward:i=t.start-1;break}return u=null,i<0&&(u=this.head),i>-1&&i<this._getCount()?(f=this._getViewIndexFromModelIndex(i),u=this.items[f]):i<this._getCount()||(u=this.tail),u&&u.collapsed?r.Collapsed:r.Expanded},i.prototype._setLevel=function(n,i){if(n<0)this.head||(this.head=new t),this.head.level=i;else if(n>-1&&n<this._getCount()){var r=this._getModelIndexFromViewIndex(n);this.items[r]||(this.items[r]=new t,this.items[r].level=-1),this.items[r].level=i}else n<this._getCount()||(this.tail||(this.tail=new t),this.tail.level=i);this._rootCached=null,this.refresh()},i.pro
totype.suspendAdding=function(){this.suspendAddingGroup.addRef()},i.prototype.resumeAdding=function(){this.suspendAddingGroup.release()},i.prototype._getViewIndexFromModelIndex=function(n){return n},i.prototype._getModelIndexFromViewIndex=function(n){return n},i.prototype.rangeGroupItemInfoEquals=function(n,t){return n?t?n.level===t.level&&n.collapsed===t.collapsed:!1:!t},i.prototype.createRangeGroup=function(){var t=new e(this,0,this._getCount()-1,-1),i=new f(this),n;while(i.moveNext())n=this._createRangeGroup(i,0),n&&n.level>-1&&t.addChild(n);return t},i.prototype._createRangeGroup=function(n,t){var r=null,f;do{var i=n.current,s=this._getModelIndexFromViewIndex(i),o=this.items[s],u=n.nextToCurrent();if(o.level<t)continue;else o.level<t||r||(r=new e(this,i,i,t));o.level>t&&(f=this._createRangeGroup(n,t+1),n.current>-1?(i=n.current,u=n.nextToCurrent()):(i=f.end,u=-1),r.addChild(f)),i>r.end&&(r.end=i);if(this.isGroupEnd(i,u,t)
)return r}while(n.moveNext());return r},i.prototype.isGroupEnd=function(n,t,i){var s=this._getModelIndexFromViewIndex(n),e=this.items[s],o,r,f,u;if(!this._isIndexValid(t))return!0;o=this._getModelIndexFromViewIndex(t),r=this.items[o];if(!r)return!0;if(r.level<e.level){f=e.level-r.level,u=e.level-i;if(f===u)return!1;if(u>=0&&u<f)return!0}return!1},i.prototype._isIndexValid=function(n){return n>=-1&&n<this._getCount()},i.prototype._findImp=function(n,t,i){var r,f,u;if(n)if(n.contains(t)&&n.level===i)return n;else if(n.children&&n.children.length>0)for(r=0;r<n.children.length;r++){f=n.children[r],u=this._findImp(f,t,i);if(u)return u}return null},i.prototype.fromJSON=function(n){var f,u,i,r;if(!n)return;if(n.itemsCount!==null&&n.itemsCount!==undefined){this.items=new Array(n.itemsCount);if(n.itemsData)for(f=n.itemsData.length,u=0;u<f;u++){i=n.itemsData[u];if(i.count>0&&i.index>=0&&i.info){for(r=0;r<
i.count;r++){if(i.index+r>=this.items.length)break;this.items[i.index+r]=new t(i.info)}this._empty=!1}}}n.direction!==null&&n.direction!==undefined&&(this.direction=n.direction),n.head&&(this.head=n.head),n.tail&&(this.tail=n.tail),this.refresh()},i.prototype.toJSON=function(){for(var i=[],r=this.items.length,t=-1,n=0;n<r;n++)this.items[n]&&(t<0||n!==i[t].count+i[t].index||this.items[n].level!==i[t].info.level||this.items[n].collapsed!==i[t].info.collapsed?(t++,i[t]={index:n,count:1,info:this.items[n]}):i[t].count++);return{itemsCount:r,itemsData:i,direction:this.direction,head:this.head,tail:this.tail}},i}(),n.RangeGroup=c,t=function(){function n(n){this!==n&&n&&(this.level=n.level,this.collapsed=n.collapsed),n||(this.level=0,this.collapsed=!1)}return n}(),n.RangeGroupItemInfo=t,f=function(){function n(n){this.isEOF=!1,this.rangeGroup=null,this.current=-1,this.rangeGroup=n}return n.prototype.nextToCurrent=function(){r
eturn this.current+1},n.prototype.moveNext=function(){var t,n,i;if(this.isEOF||!this.rangeGroup||!this.rangeGroup.items)return!1;for(t=!1,n=this.current+1;n<this.rangeGroup.items.length;n++){i=this.rangeGroup._getModelIndexFromViewIndex(n);if(this.rangeGroup.items[i]){t=!0,this.current=n;break}}return t||(this.current=-1),this.current>-1?!0:(this.isEOF=!0,!1)},n.prototype.reset=function(){this.isEOF=!1,this.current=-1},n}(),n.GroupedItemIndexEnumerator=f,i={getThemeBackgroundColor:function(t,i){if(t.parent&&t.parent.useWijmoTheme){var r=n.Global.prototype.getWijmoThemeStyle(n.VisualState.Normal);r&&r.backgroundColor&&r.backgroundColor!==""&&(i=r.backgroundColor)}return i},getThemeForeColor:function(t,i){if(t.parent&&t.parent.useWijmoTheme){var r=n.Global.prototype.getWijmoThemeStyle(n.VisualState.Normal);r&&r.color&&r.color!==""&&(i=r.color)}return i}},u=function(){function t(n,t,i){this._sheet
=null,this._rowGroup=null,this._viewportIndex=1,this.PADDING=2,this.LINE_SIZE=2,this.STARTLINE_SIZE=6,this._groupLineInfos=null,this._groupDotInfos=null,this._groupButtonInfos=null,this._sheet=n,this._rowGroup=t,this._viewportIndex=i}return t.prototype.createGroupInfo=function(){var i,u,t,r;this._groupLineInfos=[],this._groupDotInfos=[],this._groupButtonInfos=[],i=this._rowGroup,u=this.getMaxLevel(i);if(u!==-1){var f=this._sheet._getGroupLayout(),e=this._calcMinWidthOrHeight({width:f.width,height:f.height},i),n=this.getGroupsByLevel(0,i);if(n&&n.length>0)for(t=0;t<n.length;t++)r=n[t],this._measureGroups(r,e)}},t.prototype.paintGroups=function(n){this._rowGroup?this._paintRowGroups(n):this._paintColumnGroups(n)},t.prototype._calcMinWidthOrHeight=function(n,t){var i=0,r=this.getMaxLevel(t);return i=t?(n.width-this.PADDING*2)/(r+2):(n.height-this.PADDING*2)/(r+2),i=Math.max(0,i)},t.prototype._measureGroups=function(t,i){var tt=this._rowGroup,o=this.getGroupDirection(tt),l
=this.getViewportStartIndex(tt),a=this.getViewportEndIndex(tt),y=t.start,v=t.end,f,u,e,d,g,k,nt,rt,s,c,b,it,w,h,p,ft,ut;if(t.getState()===r.Expanded){d=!0,g=t.parent,g&&(o===n.RangeGroupDirection.Backward&&t.start===g.start||o===n.RangeGroupDirection.Forward&&t.end===g.end)&&(d=!1),d&&(f={isExpanded:!0,level:t.level,paintLine:!0},o===n.RangeGroupDirection.Forward?(u=v+1,u<l||u>a||(f.index=u,f.lineDirection=n.RangeGroupDirection.Forward,this._groupButtonInfos.push(f))):o===n.RangeGroupDirection.Backward&&(u=y-1,u<l||u>a||(f.index=u,f.lineDirection=n.RangeGroupDirection.Backward,this._groupButtonInfos.push(f))));if(y<=a&&v>=l){for(k=Math.max(l,y),nt=Math.min(a,v),d&&(rt={start:k,end:nt,level:t.level,startLine:null},(o===n.RangeGroupDirection.Forward&&k===y||o===n.RangeGroupDirection.Backward&&nt===v)&&(rt.startLine=!0),this._groupLineInfos.push(rt)),s=[],e=k;e<=nt;e++)s.push(e)
;if(t.children&&t.children.length>0)for(e=0;e<t.children.length;e++){c=t.children[e];if(c.getState()===r.Collapsed)for(b=c.start;b<=c.end;b++)s.remove(b);o===n.RangeGroupDirection.Forward?s.remove(c.end+1):o===n.RangeGroupDirection.Backward&&s.remove(c.start-1),this._measureGroups(c,i)}it=!0;if(t.children)for(w=0;w<t.children.length;w++){h=t.children[w];if(h)if(h.start===t.start&&h.end===t.end){it=!1;break}else if(o===n.RangeGroupDirection.Forward&&h.end===t.end||o===n.RangeGroupDirection.Backward&&h.start===t.start)for(p=h.start;p<=h.end;p++)s.remove(p)}if(it&&s.length>0)for(e=0;e<s.length;e++)ft=s[e],ut={index:ft,level:t.level+1},this._groupDotInfos.push(ut)}}else t.getState()===r.Collapsed&&(f={isExpanded:!1,level:t.level},o===n.RangeGroupDirection.Forward?(u=v+1,u<l||u>a||(f.index=u,f.lineDirection=n.RangeGroupDirection.Forward,this._groupButtonInfos.push(f))):o===n.RangeGroupDirection.Backward&am
p;&(u=y-1,u<l||u>a||(f.index=u,f.lineDirection=n.RangeGroupDirection.Backward,this._groupButtonInfos.push(f))))},t.prototype._paintRowGroups=function(t){var ct=this.getMaxLevel(!0),u,o,k,h,r,e,f,v,nt,st,ht,rt,ot,it,et,g,l,y,w,a,ut,ft,tt;if(ct===-1)return;u=this._sheet._getGroupLayout(),o=this._calcMinWidthOrHeight({width:u.width,height:u.height},!0);if(o===0)return;t.save(),k=Math.max(0,(o-this.STARTLINE_SIZE)/2)+this.PADDING,v=this._sheet._getRowLayout(this._viewportIndex,n.SheetArea.viewport);if(this._groupDotInfos&&this._groupDotInfos.length>0)for(e=0;e<this._groupDotInfos.length;e++)nt=this._groupDotInfos[e],f=v.findRow(nt.index),f&&f.height>=this.LINE_SIZE&&(h=nt.level*o+k,r=f.y+Math.max(0,(f.height-this.LINE_SIZE)/2),st=this.LINE_SIZE,ht=this.LINE_SIZE,t.fillStyle=i.getThemeForeColor(this._sheet,"black"),t.fillRect(u.x+h+.5,u.y+r,st,ht));rt=this._sheet.rowRangeGroup.direction;if(this._groupLineInfos&&this._groupLineI
nfos.length>0)for(e=0;e<this._groupLineInfos.length;e++){var d=this._groupLineInfos[e],b=d.start,p=d.end,c=null,s=null;do c=v.findRow(b),b++;while(!c&&b<=p);do s=v.findRow(p),p--;while(!s&&p>=b);if(c||s)!c&&s?c=s:c&&!s&&(s=c);else continue;h=d.level*o+k,r=c.y,rt===n.RangeGroupDirection.Forward&&(r+=1),ot=this.LINE_SIZE,it=Math.max(0,s.y+s.height-c.y),t.fillStyle=i.getThemeForeColor(this._sheet,"black"),t.fillRect(u.x+h+.5,u.y+r,ot,it),et=d.startLine,et&&(g=Math.min(this.STARTLINE_SIZE,o-this.LINE_SIZE),g>0&&(rt===n.RangeGroupDirection.Backward&&(r=r+it-this.LINE_SIZE),r>=c.y&&r<s.y+s.height&&(t.fillStyle=i.getThemeForeColor(this._sheet,"black"),t.fillRect(u.x+h+.5,u.y+r,g,this.LINE_SIZE))))}if(this._groupButtonInfos&&this._groupButtonInfos.length>0)for(e=0;e<this._groupButtonInfos.length;e++){l=this._groupButtonInfos[e],f=v.findRow(l.index);i
f(!f||f&&f.height<=0)continue;y=Math.max(0,(f.height-o)/2),h=l.level*o+this.PADDING,r=f.y+y,w=o,a=Math.min(o,f.height),t.strokeStyle="gray",t.lineWidth=1,t.strokeRect(u.x+h+.5,u.y+r,w,a),l.isExpanded||t.fillRect(u.x+h+w/2-1+.5,u.y+r+4,2,a-8),t.fillRect(u.x+h+4+.5,u.y+r+a/2-1,w-8,2),ut=l.paintLine,ut&&a<f.height&&(h=l.level*o+k,r=f.y,ft=this.LINE_SIZE,tt=y,l.lineDirection===n.RangeGroupDirection.Backward&&(r+=y+a,tt=f.height-a-y),t.fillStyle=i.getThemeForeColor(this._sheet,"black"),t.fillRect(u.x+h+.5,u.y+r,ft,tt))}t.stroke(),t.beginPath(),t.restore()},t.prototype._paintColumnGroups=function(t){var ct=this.getMaxLevel(!1),u,h,k,r,s,e,f,v,nt,ht,et,rt,it,ot,st,g,l,y,a,w,ft,tt,ut;if(ct===-1)return;u=this._sheet._getGroupLayout(),h=this._calcMinWidthOrHeight({width:u.width,height:u.height},!1);if(h===0)return;for(k=Math.max(0,(h-this.STARTLINE_SIZE)/2)+this.PADDING,v=this._sheet._getColumnLayout(this._viewportIndex,n.SheetArea.vie
wport),t.save(),e=0;e<this._groupDotInfos.length;e++)nt=this._groupDotInfos[e],f=v.findCol(nt.index),f&&f.width>=this.LINE_SIZE&&(r=f.x+Math.max(0,(f.width-this.LINE_SIZE)/2),s=nt.level*h+k,ht=this.LINE_SIZE,et=this.LINE_SIZE,t.fillStyle=i.getThemeForeColor(this._sheet,"black"),t.fillRect(u.x+r,u.y+s+.5,ht,et));for(rt=this._sheet.colRangeGroup.direction,e=0;e<this._groupLineInfos.length;e++){var d=this._groupLineInfos[e],b=d.start,p=d.end,c=null,o=null;do c=v.findCol(b),b++;while(!c&&b<=p);do o=v.findCol(p),p--;while(!o&&p>=b);if(c||o)!c&&o?c=o:c&&!o&&(o=c);else continue;r=c.x,rt===n.RangeGroupDirection.Forward&&(r+=1),s=d.level*h+k,it=Math.max(0,o.x+o.width-c.x),ot=this.LINE_SIZE,t.fillStyle=i.getThemeForeColor(this._sheet,"black"),t.fillRect(u.x+r,u.y+s+.5,it,ot),st=d.startLine,st&&(g=Math.min(this.STARTLINE_SIZE,h-this.LINE_SIZE),g>0&&(rt===n.RangeGroupDirection.B
ackward&&(r=r+it-this.LINE_SIZE),r>=c.x&&r<o.x+o.width&&(t.fillStyle=i.getThemeForeColor(this._sheet,"black"),t.fillRect(u.x+r,u.y+s+.5,this.LINE_SIZE,g))))}for(e=0;e<this._groupButtonInfos.length;e++){l=this._groupButtonInfos[e],f=v.findCol(l.index);if(!f||f&&f.width<=0)continue;y=Math.max(0,(f.width-h)/2),r=f.x+y,s=l.level*h+this.PADDING,a=Math.min(h,f.width),w=h,t.strokeStyle="gray",t.lineWidth=1,t.strokeRect(u.x+r,u.y+s+.5,a,w),l.isExpanded||t.fillRect(u.x+r+a/2-1,u.y+s+4.5,2,w-8),t.fillRect(u.x+r+4,u.y+s+w/2-.5,a-8,2),ft=l.paintLine,ft&&a<f.width&&(r=f.x,s=l.level*h+k,tt=y,ut=this.LINE_SIZE,l.lineDirection===n.RangeGroupDirection.Backward&&(r+=y+a,tt=f.width-a-y),t.fillStyle=i.getThemeForeColor(this._sheet,"black"),t.fillRect(u.x+r,u.y+s+.5,tt,ut))}t.beginPath(),t.restore()},t.prototype.getRowOrColumnStartIndex=function(n){var i,t;return n?(i=this._sheet.getViewportTopRow(this._
viewportIndex),Math.max(0,i-1)):(t=this._sheet.getViewportLeftColumn(this._viewportIndex),Math.min(0,t-1))},t.prototype.getRowOrColumnCount=function(n){var i,t;return n?(i=this._sheet.getViewportBottomRow(this._viewportIndex),Math.min(this._sheet.getRowCount(),i+2)):(t=this._sheet.getViewportRightColumn(this._viewportIndex),Math.min(this._sheet.getColumnCount(),t+2))},t.prototype.getGroupsByLevel=function(n,t){var u=[],r=this.getRowOrColumnStartIndex(t),f=this.getRowOrColumnCount(t),i;while(r<f)i=null,i=t?this._sheet.rowRangeGroup.find(r,n):this._sheet.colRangeGroup.find(r,n),i?(r=i.end+1,u.push(i)):r++;return u},t.prototype.getMaxLevel=function(n){var t=-1;return t=n?this._sheet.rowRangeGroup.getMaxLevel():this._sheet.colRangeGroup.getMaxLevel()},t.prototype.getGroupDirection=function(n){return n?this._sheet.rowRangeGroup.direction:this._sheet.colRangeGroup.direction},t.prototype.getViewportStartIndex=function(n){return n?this._sheet.getViewportTopRow(this._viewportIndex):this._
sheet.getViewportLeftColumn(this._viewportIndex)},t.prototype.getViewportEndIndex=function(n){return n?this._sheet.getViewportBottomRow(this._viewportIndex):this._sheet.getViewportRightColumn(this._viewportIndex)},t.prototype.getRowGroupButton=function(t,i){var y=this.getMaxLevel(!0),f,u,h,c,l,o,e,r,s;if(y===-1)return null;f=this._sheet._getGroupLayout(),u=this._calcMinWidthOrHeight({width:f.width,height:f.height},!0);if(u===0)return null;l=this._sheet._getRowLayout(this._viewportIndex,n.SheetArea.viewport);if(this._groupButtonInfos&&this._groupButtonInfos.length>0)for(o=0;o<this._groupButtonInfos.length;o++){e=this._groupButtonInfos[o],r=l.findRow(e.index);if(!r||r&&r.height<=0)continue;s=Math.max(0,(r.height-u)/2),h=e.level*u+this.PADDING,c=r.y+s;var p=u,a=Math.min(u,r.height),v=new n.Rect(f.x+h+.5,f.y+c+.5,p,a);if(v.contains(t,i))return e}return null},t.prototype.getColGroupButton=function(t,i){var y=this.getMaxLevel(!1),f,u,h,c,l,o,e,r,s;if(y===-1)return
null;f=this._sheet._getGroupLayout(),u=this._calcMinWidthOrHeight({width:f.width,height:f.height},!1);if(u===0)return null;l=this._sheet._getColumnLayout(this._viewportIndex,n.SheetArea.viewport);if(this._groupButtonInfos&&this._groupButtonInfos.length>0)for(o=0;o<this._groupButtonInfos.length;o++){e=this._groupButtonInfos[o],r=l.findCol(e.index);if(!r||r&&r.width<=0)continue;s=Math.max(0,(r.width-u)/2),h=r.x+s,c=e.level*u+this.PADDING;var p=Math.min(u,r.width),a=u,v=new n.Rect(f.x+h+.5,f.y+c+.5,p,a);if(v.contains(t,i))return e}return null},t}(),n._RangeGroupPresenter=u,o=function(){function t(n,t){this._sheet=null,this._rowGroup=null,this.PADDING=2,this._sheet=n,this._rowGroup=t}return t.prototype.paintGroupHeader=function(n){var y,p,t,u,w,l,a,e,f,o,s,c,h,v,r;if(!this._sheet)return;y=this._rowGroup,p=this.getMaxLevel(y);if(p!==-1){t=this._sheet._getGroupLayout(),u=this._calcMinWidthOrHeight({width:t.width,height:t.height},y);if(u===0)return;w=p+2,r=this._s
heet._getSheetLayout(),n.fillStyle=i.getThemeBackgroundColor(this._sheet,"#D7E6F7"),n.strokeStyle="gray",n.font="8.25pt Arial",n.lineWidth=1;if(y){n.fillRect(t.x,t.y,t.width,r.height),n.strokeRect(t.x-.5,t.y-.5,t.width,r.height+1),n.strokeRect(t.x-.5,r.headerY-.5,t.width,r.colHeaderHeight),n.fillStyle=i.getThemeForeColor(this._sheet,"black");if(this._sheet.colHeaderVisible&&r.colHeaderHeight>=u)for(l=this.PADDING,a=Math.max(0,r.headerY+(r.colHeaderHeight-u)/2),e=0;e<w;e++)f=u-1,o=t.x+l+.5,s=t.y+a,n.strokeRect(o,s,f,f),c=""+(e+1),h=n.measureText(c).width,v=this._sheet._getFontHeight(n.font),f<h||u<v||n.fillText(c,o+(f-h)/2,s+11),l+=u}else{n.fillRect(t.x,t.y,r.width,t.height),n.strokeRect(t.x-.5,t.y-.5,r.width+1,t.height),n.strokeRect(r.headerX-.5,t.y-.5,r.rowHeaderWidth,t.height),n.fillStyle=i.getThemeForeColor(this._sheet,"black");if(this._sheet.rowHeaderVisible&&r.rowHeaderWidth>=u)for(l=Math
.max(0,r.headerX+(r.rowHeaderWidth-u)/2),a=this.PADDING,e=0;e<w;e++)f=u-1,o=t.x+l,s=t.y+a+.5,n.strokeRect(o,s,f,f),c=""+(e+1),h=n.measureText(c).width,v=this._sheet._getFontHeight(n.font),f<h||u<v||n.fillText(c,o+(f-h)/2,s-.5+11),a+=u}}},t.prototype.getGroupButton=function(t,i){var c,l,f,r,a,s,o,u,h,e;if(!this._sheet)return null;c=this._rowGroup,l=this.getMaxLevel(c);if(l!==-1){f=this._sheet._getGroupLayout(),r=this._calcMinWidthOrHeight({width:f.width,height:f.height},c);if(r===0)return null;a=l+2,e=this._sheet._getSheetLayout();if(c)for(s=this.PADDING,o=Math.max(0,e.headerY+(e.colHeaderHeight-r)/2),u=0;u<a;u++){h=new n.Rect(f.x+s,f.y+o,r,r);if(h.contains(t,i))return{index:u};s+=r}else for(s=Math.max(0,e.headerX+(e.rowHeaderWidth-r)/2),o=this.PADDING,u=0;u<a;u++){h=new n.Rect(f.x+s,f.y+o,r,r);if(h.contains(t,i))return{index:u};o+=r}}return null},t.prototype._calcMinWidthOrHeight=function(n,t){var i=0,r=this.getMaxLevel(t);return i=t?(n.width-this.PADDING*2)
/(r+2):(n.height-this.PADDING*2)/(r+2),i=Math.max(0,i)},t.prototype.getMaxLevel=function(n){var t=-1;return t=n?this._sheet.rowRangeGroup.getMaxLevel():this._sheet.colRangeGroup.getMaxLevel()},t}(),n._RangeGroupHeaderPresenter=o,o.prototype._calcMinWidthOrHeight=u.prototype._calcMinWidthOrHeight,o.prototype.getMaxLevel=u.prototype.getMaxLevel})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(t){function i(n,t,i,r,u){if(n)return u?u.call(t,t[i]):t[i];var f=t[i];return t[i]=r,u&&u.call(t,f!==r),t}function w(n,t){if(t&&n&&n!=="")if(t.getColor){var i=t.getColor(n);if(i)return i}return n}function k(n,t){return t===o.Horizontal?n.colCount:n.rowCount}function d(n,t,i,r){return r===o.Horizontal?n.getValue(i.row,i.col+t):n.getValue(i.row+t,i.col)}function b(n,t,i,r){return r===o.Horizontal?n.getColumnWidth(i.col+t)<=0||n.getRowHeight(i.row)<=0:n.getRowHeight(i.row+t)<=0||n.getColumnWidth(i.col)<=0}var
e,u,y,r,o,s,l,v,a,p;t.feature("sparkline",["core.common","core.sheet_model"]);var c={Black:"black",Blue:"Blue",Brown:"Brown"},h={FromArgb:function(n,i,r,u){return new t._Color(n,i,r,u).toString()}},f={};(function(n){n[n.Gaps=0]="Gaps",n[n.Zero=1]="Zero",n[n.Connect=2]="Connect"})(t.EmptyValueStyle||(t.EmptyValueStyle={})),e=t.EmptyValueStyle,function(n){n[n.individual=0]="individual",n[n.group=1]="group",n[n.custom=2]="custom"}(t.SparklineAxisMinMax||(t.SparklineAxisMinMax={})),u=t.SparklineAxisMinMax,y=function(){function n(n){if(n)for(var t in n)t&&(this[t]=n[t]);else this._axisColor=c.Black,this._firstMarkerColor=h.FromArgb(255,149,179,215),this._highMarkerColor=c.Blue,this._lastMarkerColor=h.FromArgb(255,149,179,215),this._lowMarkerColor=c.Blue,this._markersColor=h.FromArgb(255,36,64,98),this._negativeColor=c.Brown,this._seriesColor=h.FromArgb(255,36,6
4,98),this.displayEmptyCellsAs=e.Gaps,this.rightToLeft=!1,this.displayHidden=!1,this.displayXAxis=!1,this._showFirst=!1,this._showHigh=!1,this._showLast=!1,this._showLow=!1,this._showNegative=!1,this._showMarkers=!1,this.manualMax=0,this.manualMin=0,this.maxAxisType=u.individual,this.minAxisType=u.individual,this.groupMaxValue=0,this.groupMinValue=0,this.lineWeight=1;this._worksheet=null}return n.prototype.axisColor=function(n){return i(arguments.length===0,this,"_axisColor",n)},n.prototype.firstMarkerColor=function(n){return i(arguments.length===0,this,"_firstMarkerColor",n)},n.prototype.highMarkerColor=function(n){return i(arguments.length===0,this,"_highMarkerColor",n)},n.prototype.lastMarkerColor=function(n){return i(arguments.length===0,this,"_lastMarkerColor",n)},n.prototype.lowMarkerColor=function(n){return i(arguments.length===0,this,"_lowMarkerColor",n)},n.prototype.markersColor=function(n){return i(arguments.length===0,this
,"_markersColor",n)},n.prototype.negativeColor=function(n){return i(arguments.length===0,this,"_negativeColor",n)},n.prototype.seriesColor=function(n){return i(arguments.length===0,this,"_seriesColor",n)},n.prototype.showFirst=function(n){return i(arguments.length===0,this,"_showFirst",n)},n.prototype.showHigh=function(n){return i(arguments.length===0,this,"_showHigh",n)},n.prototype.showLast=function(n){return i(arguments.length===0,this,"_showLast",n)},n.prototype.showLow=function(n){return i(arguments.length===0,this,"_showLow",n)},n.prototype.showNegative=function(n){return i(arguments.length===0,this,"_showNegative",n)},n.prototype.showMarkers=function(n){return i(arguments.length===0,this,"_showMarkers",n)},n.prototype.clone=function(){var t=new n;return t._axisColor=this._axisColor,t._firstMarkerColor=this._firstMarkerColor,t._highMarkerColor=this._highMarkerColor,t._lastMarkerColor=this
._lastMarkerColor,t._lowMarkerColor=this._lowMarkerColor,t._markersColor=this._markersColor,t._negativeColor=this._negativeColor,t._seriesColor=this._seriesColor,t.displayEmptyCellsAs=this.displayEmptyCellsAs,t.rightToLeft=this.rightToLeft,t.displayHidden=this.displayHidden,t.displayXAxis=this.displayXAxis,t._showFirst=this._showFirst,t._showHigh=this._showHigh,t._showLast=this._showLast,t._showLow=this._showLow,t._showNegative=this._showNegative,t._showMarkers=this._showMarkers,t.manualMax=this.manualMax,t.manualMin=this.manualMin,t.maxAxisType=this.maxAxisType,t.minAxisType=this.minAxisType,t.groupMaxValue=this.groupMaxValue,t.groupMinValue=this.groupMinValue,t.lineWeight=this.lineWeight,t},n.prototype._setThemeContext=function(n){this._worksheet=n},n.prototype._getActualColor=function(n){var i=this._worksheet;return i?w(this[n](),new t._ThemeContext(i)):null},n.prototype.toJSON=function(){return{_axisColor:this._axisColor,_firstMarkerColor:this._firstMarkerColor,_highMarkerColor:
this._highMarkerColor,_lastMarkerColor:this._lastMarkerColor,_lowMarkerColor:this._lowMarkerColor,_markersColor:this._markersColor,_negativeColor:this._negativeColor,_seriesColor:this._seriesColor,displayEmptyCellsAs:this.displayEmptyCellsAs,rightToLeft:this.rightToLeft,displayHidden:this.displayHidden,displayXAxis:this.displayXAxis,_showFirst:this._showFirst,_showHigh:this._showHigh,_showLast:this._showLast,_showLow:this._showLow,_showNegative:this._showNegative,_showMarkers:this._showMarkers,manualMax:this.manualMax,manualMin:this.manualMin,maxAxisType:this.maxAxisType,minAxisType:this.minAxisType,groupMaxValue:this.groupMaxValue,groupMinValue:this.groupMinValue,lineWeight:this.lineWeight}},n}(),t.SparklineSetting=y,function(n){n[n.line=0]="line",n[n.column=1]="column",n[n.winloss=2]="winloss"}(t.SparklineType||(t.SparklineType={})),r=t.SparklineType,function(n){n[n.Vertical=0]="Vertical",n[n.Horizontal=1]="Horizontal"}(t.DataOrien
tation||(t.DataOrientation={})),o=t.DataOrientation,s=function(){function n(n,t){this.displayDateAxis=!1,this._sparklineGroupManager=null,this._innerList=[],this._axisReference=null,this._axisOrientation=o.Horizontal,this.setting=t,this.sparklineType=n}return n.prototype.add=function(n){n&&(this._innerList.push(n),n.group(this),this._adjustGroupMaxMinValue(),this.onGroupChanged())},n.prototype.remove=function(n){var t=this._innerList.remove(n);return n.onSparklineChanged(),n._group=this.clone(),this._adjustGroupMaxMinValue(),this.onGroupChanged(),t},n.prototype.contains=function(n){return this._innerList.contains(n)},n.prototype.onGroupChanged=function(){var n,t;if(this._innerList)for(n=0;n<this._innerList.length;n++)t=this._innerList[n],t&&t.onSparklineChanged()},n.prototype.clone=function(){var i=this.setting?this.setting.clone():null,t=new n(this.sparklineType,i);return t.displayDateAxis=this.displayDateAxis,t._axisReference=this._axisReference,t._axisOrientati
on=this._axisOrientation,t},n.prototype.dateAxisData=function(n){return arguments.length===0?i(!0,this,"_axisReference",n):i(!1,this,"_axisReference",n,function(n){n&&this.onGroupChanged()})},n.prototype.dateAxisOrientation=function(n){return arguments.length===0?i(!0,this,"_axisOrientation",n):i(!1,this,"_axisOrientation",n,function(n){n&&this.onGroupChanged()})},n.prototype.count=function(){return this._innerList.length},n.prototype._adjustGroupMaxMinValue=function(){var n;if(!this.setting)return;this.setting.groupMaxValue=Number.MIN_VALUE,this.setting.groupMinValue=Number.MAX_VALUE;var o=this.setting.maxAxisType===u.group,e=this.setting.minAxisType===u.group,t=!1;if(o||e)for(n=0;n<this._innerList.length;n++){var s=this._innerList[n],i=this._getMaxMinValues(s),r=i.min,f=i.max;o&&this.setting.groupMaxValue<f&&(this.setting.groupMaxValue=f,t=!0),e&&this.setting.groupMinValue>r&&(this.set
ting.groupMinValue=r,t=!0)}return t},n.prototype._getMaxMinValues=function(n){var u=Number.MIN_VALUE,e=Number.MAX_VALUE,s=n.data(),o,r,i,t;if(s)for(o=n._provideValues(s,n.dataOrientation(),!1),r=0;r<o.length;r++)i=o[r],i===f&&(i=0),typeof i=="number"&&(t=i,u=u<t?t:u,e=e>t?t:e);return{min:e,max:u}},n.prototype.toJSON=function(){return{setting:this.setting?this.setting.toJSON():null,displayDateAxis:this.displayDateAxis,sparklineType:this.sparklineType,axisReference:this._axisReference,axisOrientation:this._axisOrientation,sparklines:this._innerList}},n.prototype.fromJSON=function(n){var r,u,t,i;if(!n)return;n.setting&&(this.setting=new y(n.setting)),n.displayDateAxis!==undefined&&n.displayDateAxis!==null&&(this.displayDateAxis=n.displayDateAxis),n.sparklineType!==undefined&&n.sparklineType!==null&&(this.sparklineType=n.sparklineType),n.axisReference!==undefined&&n.axisReference!==null&&(this._ax
isReference=n.axisReference),n.axisOrientation!==undefined&&n.axisOrientation!==null&&(this._axisOrientation=n.axisOrientation);if(n.sparklines)for(this._innerList=[],r=n.sparklines,u=r.length,t=0;t<u;t++)i=new a,i.fromJSON(r[t]),this.add(i)},n}(),t.SparklineGroup=s,l=function(){function n(n,t,i,r){this.X=n,this.Y=t,this.Width=i,this.Height=r,this.Left=this.X,this.Right=this.Left+this.Width,this.Top=this.Y,this.Bottom=this.Y+this.Height}return n}(),t._PositionRect=l,v=function(){function n(n){this._minItemHeight=2,this.info=n,this._clearCache()}return n.prototype.sparklineInfo=function(n){return i(arguments.length===0,this,"info")},n.prototype.paint=function(n,t,i,u,f){this._clearCache(),this.info.sparklineType()===r.line&&this._paintLines(n,t,i,u,f),this._paintDataPoints(n,t,i,u,f),this._paintAxis(n,t,i,u,f)},n.prototype._clearCache=function(){this._cachedMinDatetime=Number.MAX_VALUE,this._cachedMaxDatetime=Number.MIN_VALUE,this._cachedMinValue=
Number.MAX_VALUE,this._cachedMaxValue=Number.MIN_VALUE,this._cachedIndexMapping=null,this._cachedValues=null,this._cachedDatetimes=null},n.prototype._getWorksheet=function(){if(this.info&&this.info.group()&&this.info.group()._sparklineGroupManager)return this.info.group()._sparklineGroupManager._sheet},n.prototype._getSpace=function(n){return this.info.sparklineType()===r.line?3+this._getLineWeight()+1:3},n.prototype._leftSpace=function(){return this._getSpace("left")},n.prototype._rightSpace=function(){return this._getSpace("right")},n.prototype._topSpace=function(){return this._getSpace("top")},n.prototype._bottomSpace=function(){return this._getSpace("bottom")},n.prototype._getCachedValues=function(){if(!this._cachedValues){var t=this.info.data(),n=this.info.dataOrientation();this._cachedValues=this.info._provideValues(t,n)}return this._cachedValues},n.prototype._getCachedDatetimes=function(){if(!this._cachedDatetimes){var t
=this.info.group().dateAxisData(),n=this.info.group().dateAxisOrientation();this._cachedDatetimes=this.info._provideValues(t,n,!0)}return this._cachedDatetimes},n.prototype._getCachedIndexMaping=function(){var t,n,i,r;if(this._cachedIndexMapping)return this._cachedIndexMapping;if(this.sparklineInfo().displayDateAxis()){this._cachedIndexMapping=[];var s=this._getCachedValues().length,o=this._getCachedDatetimes().length,e=Math.min(s,o),u=[];for(e>0&&(u=this._getCachedDatetimes().slice(0,e)),u.sort(function(n,t){return n===t?0:(n===f&&(n=0),t===f&&(t=0),n-t)}),t=0;t<u.length;t++){i=u[t];if(i===undefined||i===null)continue;r=this._getCachedDatetimes().indexOf(i);while(this._cachedIndexMapping.contains(r))r=this._getCachedDatetimes().indexOf(i,r+1);isNaN(i)||(n=this._getCachedValues()[r],n!==undefined&&n!==null&&isNaN(n)&&n!==f||this._cachedIndexMapping.push(r))}}else for(this._cachedIndexMapping=[],t=0;t<this._getCachedValues().le
ngth;t++)n=this._getCachedValues()[t],n!==undefined&&n!==null&&isNaN(n)&&n!==f||this._cachedIndexMapping.push(t);return this._cachedIndexMapping},n.prototype._getValue=function(n){var i=this._getCachedValues(),t=i[n];return t===undefined||t===null?this.sparklineInfo().setting().displayEmptyCellsAs===e.Zero&&(t=0):t===f&&(t=0),t},n.prototype._paintLines=function(n,t,i,r,u){var f,h,c,v=this._getCachedIndexMaping().length-1,w,o,s,b,a,p,y;for(v<0&&(v=0),this.linePos=[],f=0;f<v;f++){w=this._getValue(this._getCachedIndexMaping()[f]);if(w!==undefined&&w!==null){o=f+1,s=this._getValue(this._getCachedIndexMaping()[o]);if(s===undefined||s===null){b=this.sparklineInfo().setting().displayEmptyCellsAs;if(b===e.Zero)s=0;else if(b===e.Connect)for(o=f+2;o<=v;o++){a=this._getCachedValues()[this._getCachedIndexMaping()[o]];if(a!==undefined&&a!==null){s=a;break}}}if(s!==undefined&&s!==null){var k=this._getDataPointPositio
n(this._getCachedIndexMaping()[f],{Width:r,Height:u}),d=this._getDataPointPosition(this._getCachedIndexMaping()[o],{Width:r,Height:u}),l=k.Width/2;h={X:k.X+l,Y:k.Y+l},c={X:d.X+l,Y:d.Y+l},this.linePos[f]={P1:h,P2:c}}else f++}}if(this.linePos.length>0)for(p=this._getWorksheet(),p&&this.info.setting()._setThemeContext(p),n.strokeStyle=this.info.setting()._getActualColor("seriesColor"),n.lineCap="round",n.lineWidth=this._getLineWeight(),f=0;f<this.linePos.length;f++){y=this.linePos[f];if(!y)continue;n.beginPath(),h=y.P1,c=y.P2,n.moveTo(t+h.X,i+h.Y),n.lineTo(t+c.X,i+c.Y),n.stroke(),n.closePath()}},n.prototype._getDataPointColor=function(n){var t=null,i=this._getValue(n),h=this._getWorksheet(),f,s,o,e,u;return i!==undefined&&i!==null&&(this.info.setting()._setThemeContext(h),(this._cachedMinValue===Number.MAX_VALUE||this._cachedMaxValue===Number.MIN_VALUE)&&this._getMaxMinValue(),f=this._cachedMinValue,i===f&&this.info.sett
ing().showLow()&&(t=this.info.setting()._getActualColor("lowMarkerColor")),(t===undefined||t===null)&&(s=this._cachedMaxValue,i===s&&this.info.setting().showHigh()&&(t=this.info.setting()._getActualColor("highMarkerColor"))),(t===undefined||t===null)&&(this.info.group().displayDateAxis?(o=this._getCachedIndexMaping().indexOf(n),o===0&&this.info.setting().showFirst()&&(t=this.info.setting()._getActualColor("firstMarkerColor"))):n===0&&this.info.setting().showFirst()&&(t=this.info.setting()._getActualColor("firstMarkerColor"))),(t===undefined||t===null)&&(this.info.group().displayDateAxis?(e=this._getCachedIndexMaping().indexOf(n),e===this._getCachedIndexMaping().length-1&&this.info.setting().showLast()&&(t=this.info.setting()._getActualColor("lastMarkerColor"))):n===this._getCachedIndexMaping().length-1&&this.info.setting().showLast
()&&(t=this.info.setting()._getActualColor("lastMarkerColor"))),(t===undefined||t===null)&&i<0&&this.info.setting().showNegative()&&(t=this.info.setting()._getActualColor("negativeColor")),(t===undefined||t===null)&&(u=this.info.sparklineType(),u===r.line?this.info.setting().showMarkers()&&(t=this.info.setting()._getActualColor("markersColor")):u===r.column?t=this.info.setting()._getActualColor("seriesColor"):u===r.winloss&&(t=this.info.setting()._getActualColor("seriesColor")))),t===undefined||t===null?"Transparent":t},n.prototype._paintDataPoints=function(n,t,i,u,f){for(var w={Width:u,Height:f},c,h,o,s=0;s<this._getCachedIndexMaping().length;s++){var l=this._getCachedIndexMaping()[s],p=this._getDataPointColor(l),e=this._getDataPointPosition(l,w);n.fillStyle=p;if(this.info.sparklineType()===r.line)n.save(),c=t+e.X+e.Width/2,h=i+e.Y+e.Height/2,n.translate(c,h),n.
rotate(Math.PI/4),n.fillRect(0-e.Width/2,0-e.Height/2,e.Width,e.Height),n.restore();else{o=t+e.X+e.Width/4,o=Math.floor(o);var y=i+e.Y,a=e.Width/2,v=e.Height;n.fillRect(o,y,a,v)}}},n.prototype._paintAxis=function(n,t,i,r,u){if(!this.info.setting().displayXAxis||!this._hasAxis())return;var o={Width:r,Height:u},h=this._leftSpace(),c=o.Width-this._rightSpace(),f=this._getAxisY(o);f=Math.floor(f)+.5;var l=f,s=this.info.setting()._getActualColor("axisColor"),e=this._getWorksheet()._zoomFactor;e<1&&(e=1),n.strokeStyle=s,n.lineWidth=e,n.beginPath(),n.moveTo(t+h,i+f),n.lineTo(t+c,i+l),n.stroke()},n.prototype._hasAxisNormal=function(){var t=this._getActualMaxValue(),n;if(t!==Number.MIN_VALUE){n=this._getActualMinValue();if(n!==Number.MAX_VALUE)return t===n||t*n<=0}return!0},n.prototype._hasAxis=function(){var i=this._hasAxisNormal(),t,u,n;if(this.info.sparklineType()!==r.winloss)return i;if(!i&&this._getCachedIndexMaping().length>0)for(t in this._getCachedI
ndexMaping())if(t){u=this._getCachedIndexMaping()[t],n=this._getCachedValues()[u];if(n!==undefined&&n!==null)return!0}return i},n.prototype._getMinDatetime=function(){return(isNaN(this._cachedMinDatetime)||this._cachedMinDatetime===Number.MAX_VALUE)&&this._getMaxMindatetimes(),this._cachedMinDatetime},n.prototype._getMaxDatetime=function(){return(isNaN(this._cachedMaxDatetime)||this._cachedMaxDatetime===Number.MIN_VALUE)&&this._getMaxMindatetimes(),this._cachedMaxDatetime},n.prototype._getMaxMindatetimes=function(){for(var r=new Date(0,0,0),u=Number.MAX_VALUE,f,n,t,i=0;i<this._getCachedIndexMaping().length;i++){f=this._getCachedIndexMaping()[i],n=this._getCachedDatetimes()[f];if(isNaN(n))continue;t=this._getValue(f);if(t!==null&&t===undefined||isNaN(t))continue;if(n===undefined||n===null)continue;n>r&&(r=n),n<u&&(u=n)}this._cachedMaxDatetime=r,this._cachedMinDatetime=u},n.prototype._calcItemWidth=function(n){for(var c=this._ge
tMinDatetime(),h=this._getMaxDatetime(),r=[],t,s,u,e,o,f,i=0;i<this._getCachedIndexMaping().length;i++){s=this._getCachedIndexMaping()[i],t=this._getCachedDatetimes()[s];if(t===undefined||t===null||isNaN(t))continue;if(!t)continue;r.push(t)}r.sort(function(n,t){return n-t});if(r.length>1&&c!==h){for(u=Number.MAX_VALUE,e=0,i=1;i<r.length;i++)o=r[i],t=o-r[i-1],t<u&&t>0&&(u=t),e+=t;return f=(n.Width-this._leftSpace()-this._rightSpace())*u/e/2,f<2&&(f=2),f}else return(n.Width-this._leftSpace()-this._rightSpace())/2},n.prototype._getItemWidth=function(n){if(this.info.displayDateAxis())return this._calcItemWidth(n);else{var i=this._getCachedIndexMaping().length;return(n.Width-this._leftSpace()-this._rightSpace())/i}},n.prototype._getItemX=function(n,t){var i,f,u,o,e,s,h,r;if(this.sparklineInfo().displayDateAxis()){i=this._getItemWidth(n),f=this._getMaxDatetime(),u=this._getMinDatetime();if(f===u)return this._leftSpace()+i/2;return o=this._
getCachedDatetimes()[t],o?(e=n.Width-this._leftSpace()-this._rightSpace(),e-=i,s=f-u,this._leftSpace()+Math.floor((o-u)/s*e)):0}else return i=this._getItemWidth(n),h=this._getCachedIndexMaping().indexOf(t),r=this._leftSpace()+i*h,r=Math.floor(r)},n.prototype._getCanvasSize=function(n){var i=n.Width-this._leftSpace()-this._rightSpace(),t;return i=Math.max(i,0),t=n.Height-this._topSpace()-this._bottomSpace(),t=Math.max(t,0),{Width:i,Height:t}},n.prototype._getMaxMinValue=function(){for(var n,t=0;t<this._getCachedValues().length;t++){n=this._getCachedValues()[t];if(n===undefined)continue;n!==undefined&&n!==null&&(typeof n!="number"&&(n=0),n<this._cachedMinValue&&(this._cachedMinValue=n),n>this._cachedMaxValue&&(this._cachedMaxValue=n))}},n.prototype._getActualMaxValue=function(){this._cachedMaxValue!==Number.MIN_VALUE&&this._cachedMaxValue||this._getMaxMinValue();var n=this.info.setting().maxAxisType;if(n===u.individual
)return this._cachedMaxValue;else if(n===u.group)return this.info.setting().groupMaxValue;else if(n===u.custom)return this.info.setting().manualMax;return this._cachedMaxValue},n.prototype._getActualMinValue=function(){this._cachedMinValue!==Number.MAX_VALUE&&this._cachedMinValue||this._getMaxMinValue();var n=this.info.setting().minAxisType;if(n===u.individual)return this._cachedMinValue;else if(n===u.group)return this.info.setting().groupMinValue;else if(n===u.custom)return this.info.setting().manualMin},n.prototype._getItemHeightNormal=function(n,t){var o=this._getCanvasSize(n),r=this._getActualMaxValue(),e=this._getActualMinValue(),f=r-e,i,u;if(r===e){if(r===0)return 0;f=Math.abs(r)}return i=this._getCachedValues()[t],i||(i=0),u=o.Height/f,i*u},n.prototype._getItemHeight=function(n,t){var o=this.info.sparklineType(),i,u,f;if(o===r.line)return this._getItemHeightNormal(n,t);else if(o===r.column){i=this._getCachedValues()[t];if(i===undefined||i===null)if(this.info.setting()
.displayEmptyCellsAs===e.Zero)return 0;u=this._getItemHeightNormal(n,t);if(u>-this._minItemHeight&&u<this._minItemHeight)if(i>0)return u+this._minItemHeight;else if(i<0)return u-this._minItemHeight;return u}else if(o===r.winloss)return i=this._getCachedValues()[t],i===undefined||i===null||i===0||isNaN(i)?0:(f=this._getCanvasSize(n),i<0?-f.Height/2:f.Height/2)},n.prototype._getAxisYNormal=function(n){var f=this._getCanvasSize(n),t=this._getActualMaxValue(),r=this._getActualMinValue(),i,u;if(t===Number.MIN_VALUE||r===Number.MAX_VALUE)return n.Height/2;i=t-r;if(t===r){if(t===0)return n.Height/2;i=t,t<0&&(t=0)}return u=f.Height/i,this._topSpace()+t*u},n.prototype._getAxisY=function(n){return this.info.sparklineType()===r.winloss?n.Height/2:this._getAxisYNormal(n)},n.prototype._getItemVisibleHeightNormal=function(n,t){var s=this._getCanvasSize(n),r=this._getActualMaxValue(),u=this._getActualMinValue(),o=r-u,e,i,f;if(r===u){if(r===0)return 0;o=r}return e=
s.Height/o,i=this._getValue(t),(i===undefined||i===null)&&(i=0),r!==u&&r*u>0?(f=0,f=i<0?(i-r)*e:(i-u)*e):i*e},n.prototype._getItemVisibleHeight=function(n,t){var f=this.info.sparklineType(),i,u;if(f===r.line)return this._getItemVisibleHeightNormal(n,t);else if(f===r.column){i=this._getItemVisibleHeightNormal(n,t);if(i>-this._minItemHeight&&i<this._minItemHeight){u=this._getValue(t),(u===undefined||u===null)&&(u=0);if(u!==0)return u>0?i+this._minItemHeight:i-this._minItemHeight}return i}else if(f===r.winloss)return this._getItemHeight(n,t)},n.prototype._getDataPointPositionNormal=function(n,t){var r=this._getItemWidth(t),c=this._getItemX(t,n),f,i,e;r<0&&(r=0),r=Math.floor(r),r%2==1&&(r+=1);var o=this._getItemHeight(t,n),s=this._getAxisY(t),h=this._getActualMaxValue(),a=this._getActualMinValue(),u=0;return h<0&&a<0?u=Math.max(this.info._topSpace(),s):(u=s,o<0||(u=s-o)),f=this._getItemVisibleHeight(t,n),
i=new l(c,u,r,Math.abs(f)),o!==0&&(i.Y<this._topSpace()&&i.Bottom<this._topSpace()+1?i.Height=Math.floor(i.Height+1):(e=t.Height-this._bottomSpace(),i.Bottom>e&&i.Y>e-1&&(i.Y=e-f,i.Height=f))),i},n.prototype._getLineWeight=function(){var n=this.info.setting().lineWeight*this._getWorksheet()._zoomFactor;return n<1&&(n=1),n},n.prototype._getDataPointPosition=function(n,t){var u=this._getLineWeight(),i,f;u++,u<2&&(u=2),i=this._getDataPointPositionNormal(n,t),this.info.sparklineType()===r.line&&(i.X=i.X+(i.Width-u)/2,f=this._getValue(n),f!==undefined&&f!==null?(f<0?i.Y=i.Bottom-u/2:i.Y-=u/2,i.Width=u,i.Height=u):(i.Width=0,i.Height=0));if(this.info.group().setting.rightToLeft){var s=i.X,o=t.Width-s,e=o-i.Width;i=new l(e,i.Y,i.Width,i.Height)}return i},n}(),t.SparklineRender=v,a=function(){function t(n,t,i,r,u,f){this.row=n,this.column=t,this._dataOrientation=r,this._data=i,this._group=new s(u,f),this._g
roup.add(this),this._renderer=new v(this)}return t.prototype.group=function(n){if(arguments.length===0){if(this._group===undefined||this._group===null){var t=new s;t.add(this),this._group=t}return this._group}else return n!==this._group&&(this._group&&this._group.remove(this),this._group=n,this._group&&(this._group.contains(this)||this._group.add(this)),this.onSparklineChanged()),this},t.prototype.sparklineType=function(n){return arguments.length===0?this.group().sparklineType:(this.group().sparklineType!==n&&(this.group().sparklineType=n,this.onSparklineChanged()),this)},t.prototype.onSparklineChanged=function(){var t=this._getWorksheet(),i;t&&(i=this,t._trigger(n.spread.Events.SparklineChanged,{sheet:t,sheetName:t._name,sparkline:i}))},t.prototype.setting=function(n){return arguments.length===0?this.group().setting:(this.group().setting=n,this)},t.prototype.data=function(n){return arguments.length===0?this._data:(this._data!==n&&(thi
s._data=n,this.onSparklineChanged()),this)},t.prototype.dataOrientation=function(n){return arguments.length===0?this._dataOrientation:(this._dataOrientation!==n&&(this._dataOrientation=n,this.onSparklineChanged()),this)},t.prototype.dateAxisData=function(n){return arguments.length===0?this.group().dateAxisData():(this.group().dateAxisData(n),this)},t.prototype.dateAxisOrientation=function(n){return arguments.length===0?this.group().dateAxisOrientation():(this.group().dateAxisOrientation(n),this)},t.prototype.displayDateAxis=function(n){return arguments.length===0?this.group().displayDateAxis:(this.group().displayDateAxis=n,this)},t.prototype.clone=function(){var n=new t;return n.row=this.row,n.column=this.column,n.data(this.data()),n.dataOrientation(this.dataOrientation()),n.group(this.group().clone()),n},t.prototype.paintSparkline=function(n,t,i,r,u){this._renderer.paint(n,t,i,r,u)},t.prototype._provideValues=function(t,i,r){var o=this._getWorksheet(),s=[],h,e,u;if(!o)retur
n s;for(h=k(t,i),e=0;e<h;e++)u=d(o,e,t,i),!this.setting().displayHidden&&b(o,e,t,i)?u=NaN:u!==null&&u!==undefined&&(r?u=typeof u=="number"?n.spread._DateTimeHelper.fromOADate(u):Date.parse(u):typeof u!="number"&&(u=f)),s.push(u);return s},t.prototype._getWorksheet=function(){return this.group()&&this.group()._sparklineGroupManager?this.group()._sparklineGroupManager._sheet:null},t.prototype.toJSON=function(){return{row:this.row,col:this.column,orientation:this._dataOrientation,data:this._data,type:this._group.sparklineType,setting:this._group.setting,axisReference:this._group._axisReference,axisOrientation:this._group._axisOrientation}},t.prototype.fromJSON=function(t){if(!t)return;t.row!==undefined&&t.row!==null&&(this.row=t.row),t.col!==undefined&&t.col!==null&&(this.column=t.col),t.orientation!==undefined&&t.orientation!==null&&(this._dataOrientation=t.orientation);if(t.
data){var i=t.data;this._data=new n.spread.Range(i.row,i.col,i.rowCount,i.colCount)}},t}(),t.Sparkline=a,p=function(){function r(n,t){this._groups=[],this._sheet=n,this.evaluator=t}return r.prototype.groups=function(n){return i(arguments.length===0,this,"_groups")},r.prototype.add=function(n){this.groups().push(n),n._sparklineGroupManager=this},r.prototype.remove=function(n){this.groups().remove(n)},r.prototype.contains=function(n){return this.groups().contains(n)},r.prototype.count=function(){return this.groups().length},r.prototype._addRows=function(n,t){for(var i,o,u,r,e,f=0;f<this._groups.length;f++)for(i=this._groups[f],i.displayDateAxis&&(o=this._addRowRange(n,t,i.dateAxisData()),i.dateAxisData(o)),u=0;u<i._innerList.length;u++)r=i._innerList[u],n>r.row||(r.row+=t),e=this._addRowRange(n,t,r.data()),r.data(e)},r.prototype._addColumns=function(n,t){for(var i,o,u,r,e,f=0;f<this._groups.length;f++)for(i=this._groups[f],i.displayDateAxis&&(o=th
is._addColumnRange(n,t,i.dateAxisData()),i.dateAxisData(o)),u=0;u<i._innerList.length;u++)r=i._innerList[u],n>r.column||(r.column+=t),e=this._addColumnRange(n,t,r.data()),r.data(e)},r.prototype._removeRows=function(n,t){for(var i,s,u,e,r,f,o=0;o<this._groups.length;o++){i=this._groups[o];if(i.displayDateAxis){s=this._removeRowRange(n,t,i.dateAxisData());if(s!==null&&s!==undefined)i.dateAxisData(s);else{i.clear(),this.remove(i);continue}}for(u=[],u=u.concat(i._innerList),e=0;e<u.length;e++)r=u[e],r.row>=n&&r.row<n+t?i.remove(r):(n>r.row||(r.row-=t),f=this._removeRowRange(n,t,r.data()),f!==null&&f!==undefined?r.data(f):i.remove(r));i.count()>0||this.remove(i)}},r.prototype._removeColumns=function(n,t){for(var i,s,u,e,r,f,o=0;o<this._groups.length;o++){i=this._groups[o];if(i.displayDateAxis){s=this._removeColumnRange(n,t,i.dateAxisData());if(s!==null&&s!==undefined)i.dateAxisData(s);else{i.clear(),this.remove(i);continue}}for(u
=[],u=u.concat(i._innerList),e=0;e<u.length;e++)r=u[e],r.column>=n&&r.column<n+t?i.remove(r):(n>r.column||(r.column-=t),f=this._removeColumnRange(n,t,r.data()),f!==null&&f!==undefined?r.data(f):i.remove(r));i.count()>0||this.remove(i)}},r.prototype.clear=function(n,t,i,r){var o,h,s,u,f,e;if(arguments.length===0){for(o=0;o<this._groups.length;o++)h=this._groups[o],h&&(h.SparklineGroupManager=null);this._groups.clear();return}for(s=n;s<n+i;s++)for(u=t;u<t+r;u++)f=this._find(s,u),f&&(e=f.group(),e.remove(f),e.count()===0&&this.remove(e))},r.prototype._find=function(n,t){for(var f,u,i,r=0;r<this._groups.length;r++)for(f=this._groups[r],u=0;u<f.count();u++){i=f[u];if(i&&i.row===n&&i.column===t)return i}return null},r.prototype._copy=function(n,i,r,u,f,e){var c=this._sheet,p,h,l,a;if(!c)return;for(var b=new t._GcSheetModel(f,e,null),v=r-n,y=u-i,w=c._getModel(),o,s=0;s<f;s++)for(o=0;o<e;o++)p=w.getS
parkline(n+s,i+o),p&&(h=p.clone(),h.row=r+s,h.column=u+o,l=h.dateAxisData(),l!==null&&l!==undefined&&this._canOffset(l,v,y,c.getRowCount(),c.getColumnCount())&&h.dateAxisData(l.offset(y,v)),a=h.data(),a!==undefined&&a!==null&&this._canOffset(a,v,y,c.getRowCount(),c.getColumnCount())&&h.data(a.offset(y,v)),this.add(h.group()),b.setValue(s,o,h));for(s=0;s<f;s++)for(o=0;o<e;o++)w.setSparkline(r+s,u+o,b.getValue(s,o))},r.prototype._canOffset=function(n,t,i,r,u){var f=this._getExpressionRange(n);if(f){var o=f.row<0?0:f.row,e=f.col<0?0:f.col,h=f.row<0?r:f.rowCount,s=f.col<0?u:f.colCount;return!(o+t<0||e+i<0||o+h+t>r||e+s+i>u)}return!1},r.prototype._move=function(n,i,r,u,f,e){var a=this._sheet,c,l,s,o,h;if(!a)return;for(this._moveDataRange(n,i,r,u,f,e),c=a._getModel(),l=new t._GcSheetModel(f,e,null),s=0;s<f;s++)for(o=0;o<e;o++)h=c.getSparkline(n+s,i+o),h&&(h.row=r+s,h.column=u+o,l.setValue(s
,o,h)),c.setSparkline(n+s,i+o,null);for(s=0;s<f;s++)for(o=0;o<e;o++)c.setSparkline(r+s,u+o,l.getValue(s,o))},r.prototype._moveDataRange=function(t,i,r,u,f,e){var s=new n.spread.Range(t,i,f,e),b=r-t,p,c,w,h,o,y,v,a,l;for(t,p=u-i,c=0;c<this._groups.length;c++)for(w=this._groups[c],h=0;h<w._innerList.length;h++){o=w._innerList[h];if(!o)continue;y=o.dateAxisData(),v=this._getExpressionRange(y),v&&s.containsRange(v)&&s.contains(o.row,o.column)&&o.dateAxisData(y.offset(p,b)),a=o.data(),l=this._getExpressionRange(a),l&&s.containsRange(l)&&s.contains(o.row,o.column)&&o.data(a.offset(p,b))}},r.prototype._getExpressionRange=function(n){return n},r.prototype._swap=function(n,t,i,r,u,f){},r.prototype._exCopy=function(n,t,i,r,u,f,e){var h=this._sheet,c,s,p,o,l,a;if(!h)return;if(n===h){this._copy(t,i,r,u,f,e);return}var y=r-t,v=u-i,b=n._getModel(),w=h._getModel();for(c=0;c<f;c++)for(s=0;s<e;s++)p=b.getSparkline(t+c,i+s),p?(o=p.clon
e(),o.row=r+c,o.column=u+s,l=o.dateAxisData(),l!==undefined&&l!==null&&this._canOffset(l,y,v,h.getRowCount(),h.getColumnCount())&&o.dateAxisData(l.offset(v,y)),a=o.data(),a!==undefined&&a!==null&&this._canOffset(a,y,v,h.getRowCount(),h.getColumnCount())&&o.data(a.offset(v,y)),this.add(o.group()),w.setSparkline(r+c,u+s,o)):w.setSparkline(r+c,u+s,null)},r.prototype._exMove=function(n,t,i,r,u,f,e){var a=this._sheet,v,y,s,h,o,c,l;if(!a)return;if(n===a){this._move(t,i,r,u,f,e);return}for(v=n._getModel(),y=a._getModel(),this._exMoveDataRange(n,t,i,r,u,f,e),s=0;s<f;s++)for(h=0;h<e;h++)o=v.getSparkline(t+s,i+h),o?(o.row=r+s,o.column=u+h,c=o.group(),l=c.clone(),c.remove(o),c.length>0||n._sparklineGroupManager.remove(c),l.add(o),this.add(l),y.setSparkline(r+s,u+h,o)):y.setSparkline(r+s,u+h,null),v.setSparkline(t+s,i+h,null)},r.prototype._exMoveDataRange=function(t,i,r,u,f,e,o){var k=this._sheet,h,w,c,s,l,y,a,p;if(!t||!k)return;if(t===k)
{this._moveDataRange(i,r,u,f,e,o);return}var v=new n.spread.Range(i,r,e,o),b=u-i,d=f-r;for(h=0;h<t._sparklineGroupManager._groups.length;h++)for(w=t._sparklineGroupManager._groups[h],c=0;c<w._innerList.length;c++){s=w._innerList[c];if(!s)continue;l=s.dateAxisData(),y=this._getExpressionRange(l),y&&this._sameSource(t,l)&&v.containsRange(y)&&v.contains(s.row,s.column)&&s.dateAxisData(l.offset(d,b)),a=s.data(),p=this._getExpressionRange(a),p&&this._sameSource(t,a)&&v.containsRange(p)&&v.contains(s.row,s.column)&&s.data(a.offset(d,b))}},r.prototype._sameSource=function(n,t){return!0},r.prototype._addRowRange=function(t,i,r){return r?t>r.row+r.rowCount-1?r:t>r.row?new n.spread.Range(r.row,r.col,r.rowCount+i,r.colCount):new n.spread.Range(r.row+i,r.col,r.rowCount,r.colCount):null},r.prototype._addColumnRange=function(t,i,r){return r?t>r.col+r.colCount-1?r:t>r.col?new n.spread.Range(r.row,r.col,r.rowCount,r.c
olCount+i):new n.spread.Range(r.row,r.col+i,r.rowCount,r.colCount):null},r.prototype._removeColumnRange=function(t,i,r){var u=this._rangeSubCat(r.col,r.col+r.colCount-1,t,t+i-1);return u?new n.spread.Range(r.row,u.start,r.rowCount,u.end-u.start+1):null},r.prototype._removeRowRange=function(t,i,r){var u=this._rangeSubCat(r.row,r.row+r.rowCount-1,t,t+i-1);return u?new n.spread.Range(u.start,r.col,u.end-u.start+1,r.colCount):null},r.prototype._rangeSubCat=function(n,t,i,r){var f=-1,e,u,h,c,s,o;if(r<n)return h=r-i+1,f=n-h,e=t-h,{start:f,end:e};if(i>t)return f=n,e=t,{start:f,end:e};if(i<=n){for(c=t-n+1,s=0,u=n;u<=r;u++)if(u>t)break;else s++;return f=i,e=f+c-s-1,{start:f,end:e}}for(o=0,u=n;u<=t;u++)f===-1&&(u<i||u>r)&&(f=u),(u<i||u>r)&&o++;return f!==-1&&o>0?(e=f+o-1,{start:f,end:e}):null},r.prototype.toJSON=function(){return{groups:this._groups?this._groups:null}},r.prototype.fromJSON=function(n){var r,u,t,i;if(!n)return;if
(n.groups)for(this._groups=[],r=n.groups,u=r.length,t=0;t<u;t++)i=new s,i.fromJSON(r[t]),this.add(i)},r}(),t.WorksheetSparklineGroupManager=p})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(n){(function(t){(function(t){function a(t){var r,f;if(!t[0]||!t[1]||!t[2])throw n._StringResource.Exp_ArgumentNull;var s=n.Calc.Convert._toArray(t[0]),h=t[1],c=n.Calc.Convert._toArray(t[2]),o=0,u=0,e=new i(s,h,c);while(e.moveNext()){r=e.current();if(n.Calc.Convert.isNumber(r)){if(isNaN(f=n.Calc.Convert.toDouble(r)))return n.Calc.Errors.Value;o+=f,u++}else if(n.Calc.Convert.isError(r))return r}return 0===u?n.Calc.Errors.DivideByZero:n.Calc.Convert.toResult(o/u)}function l(t){var f;if(!t[0]||!t[1]||!t[2])throw n._StringResource.Exp_ArgumentNull;var e=n.Calc.Convert._toArray(t[0]),s=t[1],o=n.Calc.Convert._toArray(t[2]),u=0,r=null;if(n.Calc._Helper._argumentExists(t,1)){r=new i(e,s,o);while(r.moveNext())f=r.current(),n.Calc.Convert.isNumber(f)&&a
mp;u++}else{r=new i(e,o);while(r.moveNext())u++}return n.Calc.Convert.toResult(u)}function c(t){var f;if(!t[0]||!t[1]||!t[2])throw n._StringResource.Exp_ArgumentNull;var e=n.Calc.Convert._toArray(t[0]),s=t[1],o=n.Calc.Convert._toArray(t[2]),u=0,r=null;if(n.Calc._Helper._argumentExists(t,1)){r=new i(e,s,o);while(r.moveNext())f=r.current(),f&&u++}else{r=new i(e,o);while(r.moveNext())u++}return n.Calc.Convert.toResult(u)}function p(t){if(!t[0]||!t[1]||!t[2])throw n._StringResource.Exp_ArgumentNull;var e=n.Calc.Convert._toArray(t[0]),f=t[1],o=n.Calc.Convert._toArray(t[2]),u=null,r=new i(e,f,o);if(r.moveNext()){u=r.current();if(r.moveNext())return n.Calc.Errors.Number}else return n.Calc.Errors.Value;return u}function y(t){var r,f;if(!t[0]||!t[1]||!t[2])throw n._StringResource.Exp_ArgumentNull;var s=n.Calc.Convert._toArray(t[0]),h=t[1],c=n.Calc.Convert._toArray(t[2]),e=!1,u=-179769e303,o=new i(s,h,c);while(o.moveNext()){r=o.current();if(n.Calc.Convert.isNumber(r)){if(isNaN(f=n.Cal
c.Convert.toDouble(r)))return n.Calc.Errors.Value;(!e||f>u)&&(u=f),e=!0}else if(n.Calc.Convert.isError(r))return r}return e?n.Calc.Convert.toResult(u):n.Calc.Errors.Value}function v(t){var r,f;if(!t[0]||!t[1]||!t[2])throw n._StringResource.Exp_ArgumentNull;var s=n.Calc.Convert._toArray(t[0]),h=t[1],c=n.Calc.Convert._toArray(t[2]),e=!1,u=179769e303,o=new i(s,h,c);while(o.moveNext()){r=o.current();if(n.Calc.Convert.isNumber(r)){if(isNaN(f=n.Calc.Convert.toDouble(r)))return n.Calc.Errors.Value;(!e||f<u)&&(u=f),e=!0}else if(n.Calc.Convert.isError(r))return r}return e?n.Calc.Convert.toResult(u):n.Calc.Errors.Value}function e(t){var r,e;if(!t[0]||!t[1]||!t[2])throw n._StringResource.Exp_ArgumentNull;var s=n.Calc.Convert._toArray(t[0]),h=t[1],o=n.Calc.Convert._toArray(t[2]),u=1,f=new i(s,h,o);while(f.moveNext()){r=f.current();if(n.Calc.Convert.isNumber(r)){if(isNaN(e=n.Calc.Convert.toDouble(r)))return n.Calc.Errors.Value;u*=e}else if(n.Calc.Convert.isError(r))return r
}return n.Calc.Convert.toResult(u)}function f(t){var u,f;if(!t[0]||!t[1]||!t[2])throw n._StringResource.Exp_ArgumentNull;var c=n.Calc.Convert._toArray(t[0]),l=t[1],h=n.Calc.Convert._toArray(t[2]),e=0,s=0,r=0,o=new i(c,l,h);while(o.moveNext()){u=o.current();if(n.Calc.Convert.isNumber(u)){if(isNaN(f=n.Calc.Convert.toDouble(u)))return n.Calc.Errors.Value;e+=f,s+=f*f,r++}else if(n.Calc.Convert.isError(u))return u}return r<=1?n.Calc.Errors.DivideByZero:n.Calc.Convert.toResult(Math.sqrt(Math.max(0,(r*s-e*e)/(r*(r-1)))))}function u(t){var u,f;if(!t[0]||!t[1]||!t[2])throw n._StringResource.Exp_ArgumentNull;var c=n.Calc.Convert._toArray(t[0]),l=t[1],h=n.Calc.Convert._toArray(t[2]),e=0,s=0,r=0,o=new i(c,l,h);while(o.moveNext()){u=o.current();if(n.Calc.Convert.isNumber(u)){if(isNaN(f=n.Calc.Convert.toDouble(u)))return n.Calc.Errors.Value;e+=f,s+=f*f,r++}else if(n.Calc.Convert.isError(u))return u}return r<=0?n.Calc.Errors.DivideByZero:n.Calc.Convert.toResult(Math.sqrt(Math.max(0,(r*s-e*e)
/(r*r))))}function h(t){var r,e;if(!t[0]||!t[1]||!t[2])throw n._StringResource.Exp_ArgumentNull;var s=n.Calc.Convert._toArray(t[0]),h=t[1],o=n.Calc.Convert._toArray(t[2]),u=0,f=new i(s,h,o);while(f.moveNext()){r=f.current();if(n.Calc.Convert.isNumber(r)){if(isNaN(e=n.Calc.Convert.toDouble(r)))return n.Calc.Errors.Value;u+=e}else if(n.Calc.Convert.isError(r))return r}return n.Calc.Convert.toResult(u)}function s(t){var u,f;if(!t[0]||!t[1]||!t[2])throw n._StringResource.Exp_ArgumentNull;var c=n.Calc.Convert._toArray(t[0]),l=t[1],h=n.Calc.Convert._toArray(t[2]),e=0,s=0,r=0,o=new i(c,l,h);while(o.moveNext()){u=o.current();if(n.Calc.Convert.isNumber(u)){if(isNaN(f=n.Calc.Convert.toDouble(u)))return n.Calc.Errors.Value;e+=f,s+=f*f,r++}else if(n.Calc.Convert.isError(u))return u}return r<=1?n.Calc.Errors.DivideByZero:n.Calc.Convert.toResult(Math.max(0,(r*s-e*e)/(r*(r-1))))}function o(t){var u,f;if(!t[0]||!t[1]||!t[2])throw n._StringResource.Exp_ArgumentNull;var c=n.Calc.Convert._toArray(t
[0]),l=t[1],h=n.Calc.Convert._toArray(t[2]),e=0,s=0,r=0,o=new i(c,l,h);while(o.moveNext()){u=o.current();if(n.Calc.Convert.isNumber(u)){if(isNaN(f=n.Calc.Convert.toDouble(u)))return n.Calc.Errors.Value;e+=f,s+=f*f,r++}else if(n.Calc.Convert.isError(u))return u}return r<=1?n.Calc.Errors.DivideByZero:n.Calc.Convert.toResult(Math.max(0,(r*s-e*e)/(r*r)))}n.feature("calc.functions_db",["calc.functions"]);var r=function(){function t(n,t){this.criteriaOperator=n,this.criteriaValue=t}return t.prototype.evaluate=function(t){var i=this.criteriaOperator.evaluate(t,this.criteriaValue,null);return typeof i=="boolean"?n.Calc.Convert.toBool(i):!1},t}(),i=function(){function t(t,i,r){this.row=0,this.database=t,this.field=i,this.criteria=r;if(arguments.length===3){this.column=this.columnIndex(t,i);if(t.getRowCount()<2||t.getColumnCount()<1)throw n._StringResource.Exp_InvalidCast;if(r.getRowCount()<2||r.getColumnCount()<1)throw n._StringResource.Exp_Invali
dCast;if(this.column<0||this.database.getColumnCount()<=this.column)throw n._StringResource.Exp_InvalidCast;}else if(arguments.length===2){this.column=-1;if(t.getRowCount()<2||t.getColumnCount()<1)throw n._StringResource.Exp_InvalidCast;if(r.getRowCount()<2||r.getColumnCount()<1)throw n._StringResource.Exp_InvalidCast;}else throw n._StringResource.Exp_InvalidNull;}return t.prototype.columnIndex=function(t,i){var r,u;if(typeof i=="string"){for(r=0;r<t.getColumnCount();r++){u=n.Calc.Convert.toString(t.getValue(0,r));if(u&&this.ignoreCaseEqual(u,i))return r}return-1}else return n.Calc.Convert.toInt(i)-1},t.prototype.current=function(){if(this.row<=0||this.database.getRowCount()<=this.row)throw n._StringResource.Exp_InvalidOperation;return this.database.getValue(this.row,this.column)},t.prototype.moveNext=function(){var n=!1;while(!n&&this.row<this.database.getRowCount())this.row++,this.row<this.database.getRowCount()&&(
n=this.rowMeetsCriteria());return n},t.prototype.createEvaluator=function(i){var f;if(typeof i=="string"){var u=n.Calc.Convert.toString(i),o=new n._StringHelper(u),e=0;for(f=0;f<t.operators.length;f++)if(o.startsWith(t.operators[f].getName()))return u=u.substring(t.operators[f].getName().length),i=isNaN(e=n._NumberHelper.parseInvariant(u))?this.ignoreCaseEqual("true",u)?!0:this.ignoreCaseEqual("false",u)?!1:u:e,new r(t.operators[f],i);return new r(n.Calc.Operators.equal,i)}else if(i)return new r(n.Calc.Operators.equal,i);return null},t.prototype.rowMeetsCriteria=function(){for(var t=!1,n,r,f,u,i=1;!t&&i<this.criteria.getRowCount();i++)for(t=!0,n=0;t&&n<this.criteria.getColumnCount();n++)r=this.createEvaluator(this.criteria.getValue(i,n)),r&&(f=this.columnIndex(this.database,this.criteria.getValue(0,n)),u=this.database.getValue(this.row,f),t=r.evaluate(u));return t},t.prototype.reset=function(){this.row=0},t.prototype.ign
oreCaseEqual=function(n,t){return n=n.toLowerCase(),t=t.toLowerCase(),n===t},t.operators=[n.Calc.Operators.equal,n.Calc.Operators.notEqual,n.Calc.Operators.lessThanOrEqual,n.Calc.Operators.greaterThanOrEqual,n.Calc.Operators.lessThan,n.Calc.Operators.greaterThan],t}();t.def("DAVERAGE",a,{minArgs:3,maxArgs:3,acceptsReference:t.acceptsNotSecond,acceptsArray:t.acceptsNotSecond}),t.def("DCOUNT",l,{minArgs:3,maxArgs:3,acceptsReference:t.acceptsNotSecond,acceptsArray:t.acceptsNotSecond}),t.def("DCOUNTA",c,{minArgs:3,maxArgs:3,acceptsReference:t.acceptsNotSecond,acceptsArray:t.acceptsNotSecond}),t.def("DGET",p,{minArgs:3,maxArgs:3,acceptsReference:t.acceptsNotSecond,acceptsArray:t.acceptsNotSecond}),t.def("DMAX",y,{minArgs:3,maxArgs:3,acceptsReference:t.acceptsNotSecond,acceptsArray:t.acceptsNotSecond}),t.def("DMIN",v,{minArgs:3,maxArgs:3,acceptsReference:t.acceptsNotSecond,acceptsArray:t.acceptsNotSecond}),t.def("DPRODUCT&qu
ot;,e,{minArgs:3,maxArgs:3,acceptsReference:t.acceptsNotSecond,acceptsArray:t.acceptsNotSecond}),t.def("DSTDEV",f,{minArgs:3,maxArgs:3,acceptsReference:t.acceptsNotSecond,acceptsArray:t.acceptsNotSecond}),t.def("DSTDEVP",u,{minArgs:3,maxArgs:3,acceptsReference:t.acceptsNotSecond,acceptsArray:t.acceptsNotSecond}),t.def("DSUM",h,{minArgs:3,maxArgs:3,acceptsReference:t.acceptsNotSecond,acceptsArray:t.acceptsNotSecond}),t.def("DVAR",s,{minArgs:3,maxArgs:3,acceptsReference:t.acceptsNotSecond,acceptsArray:t.acceptsNotSecond}),t.def("DVARP",o,{minArgs:3,maxArgs:3,acceptsReference:t.acceptsNotSecond,acceptsArray:t.acceptsNotSecond})})(t.Functions||(t.Functions={}));var i=t.Functions})(n.Calc||(n.Calc={}));var t=n.Calc})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(n){(function(t){(function(t){function ge(n){var f,i,o,t,u,r,e=1,s=[1,.57721566490153287,-.65587807152025379,-.0420026350340952,.166
53861138229151,-.0421977345555443,-.009621971527877,.007218943246663,-.0011651675918591,-.0002152416741149,.0001280502823882,-201348547807e-16,-12504934821e-16,1133027232e-15,-2056338417e-16,6116095e-15,50020075e-16,-11812746e-16,1043427e-16,77823e-16,-36968e-16,51e-14,-206e-16,-54e-16,14e-16];if(n>171)return 1e308;if(n===parseInt(n,10))if(n>0)for(t=1,f=2;f<n;f++)t*=f;else t=1e308;else{if(Math.abs(n)>1){for(r=Math.abs(n),o=parseInt(r,10),e=1,i=1;i<=o;i++)e*=r-i;r-=o}else r=n;for(u=s[24],i=23;i>=0;i--)u=u*r+s[i];t=1/(u*r),Math.abs(n)>1&&(t*=e,n<0&&(t=-Math.PI/(n*t*Math.sin(Math.PI*n))))}return t}function de(n){var t,o,s,f,r,i,u=0,e=[.083333333333333329,-.0027777777777777779,.00079365079365079365,-.00059523809523809518,.00084175084175084182,-.0019175269175269181,.00641025641025641,-.029550653594771239,.17964437236883071,-1.3924322169059];t=n;if(n>0)if(n===1||n===2)return 0;else n>7||(u=parseInt((7-n).toString(),10),t=n+u);else return 1e308
;for(o=1/(t*t),s=2*Math.PI,r=e[9],i=8;i>=0;i--)r=r*o+e[i];f=r/t+.5*Math.log(s)+(t-.5)*Math.log(t)-t;if(n<=7)for(i=1;i<=u;i++)f-=Math.log(t-1),t-=1;return f}function be(n,t){var i,u,r,f;return n=Math.abs(n),t<0&&(n=-n),r=.0078125*Math.floor(128*n+.5),f=n-r,i=r*r,u=2*r*f+f*f,t<0&&(i=-i,u=-u),i+u>Math.log(e)?rf:i=Math.exp(i)*Math.exp(u)}function f(n,t,i){var r,f,u=0;r=parseFloat(t[u++]),f=i;do r=r*n+parseFloat(t[u++]);while(--f!=0);return r}function a(n,t,i){var r,f,u=0;r=n+parseFloat(t[u++]),f=i-1;do r=r*n+parseFloat(t[u++]);while(--f!=0);return r}function b(n){var s=[],e,t,u,r,h,i,p,w,b,l,o,c,y;s[0]=.00079693672929734706,s[1]=.08283523921074408,s[2]=1.2395337164641429,s[3]=5.4472500305876874,s[4]=8.74716500199817,s[5]=5.3032403823539491,s[6]=1,e=[],e[0]=.00092440881055886367,e[1]=.08562884743544745,e[2]=1.2535274390105895,e[3]=5.4709774033041709,e[4]=8.7619088323706951,e[5]=5.3060528823539466,e[6]=1,t=[],t[0]=-.011366383889846916,t[1]=-1.282527186705
0931,t[2]=-19.553954425773597,t[3]=-93.206015212376826,t[4]=-177.68116798048806,t[5]=-147.07750515495118,t[6]=-51.410532676659933,t[7]=-6.0501435060072852,u=[],u[0]=64.3178256118178,u[1]=856.43002597698057,u[2]=3882.4018360540163,u[3]=7240.4677419565251,u[4]=5930.7270118731694,u[5]=2062.0933166032783,u[6]=242.0057402402914,r=[],r[0]=15592.436785523574,r[1]=-14663929.590397161,r[2]=5435264770.5187654,r[3]=-982136065717.9115,r[4]=87590639439536.7,r[5]=-0xc5090e8ec6601,r[6]=0x9d4a5b305a0010,r[7]=-0x41b52d6418d9ec,h=[],h[0]=1041.2835366425984,h[1]=626107.330137135,h[2]=268919633.39381415,h[3]=86400248710.3935,h[4]=20297961275010.555,h[5]=3171577528429750.5,h[6]=0x37a4bf79f36ba00;var d=5.7831859629467841,k=30.471262343662087,v=[];return v[0]=-4794432209.7820177,v[1]=1956174919465.5657,v[2]=-249248344360967.72,v[3]=9708622510473064,i=[],i[0]=499.563147152651,i[1]=173785.40167637469,i[2]=48440965.833996207,i[3]=11185553704.535683,i[4]=2112775201154.8921,i[5]=310518229857422.56,i[6]=0x71050
5f9ecba70,i[7]=0x17be34c7b662cc00,p=.78539816339744828,w=.79788456080286541,n<0&&(n=-n),n<=5?(l=n*n,n<1e-5?1-l/4:(o=(l-d)*(l-k),o=o*f(l,v,3)/a(l,i,8))):(b=5/n,c=25/(n*n),o=f(c,s,6)/f(c,e,6),c=f(c,t,7)/a(c,u,7),y=n-p,o=o*Math.cos(y)-b*c*Math.sin(y),o*w/Math.sqrt(n))}function y(n){var h=[],u,i,o,s,e;h[0]=-899971225.70555937,h[1]=452228297998.19403,h[2]=-72749424522181.828,h[3]=0xd15a1534be241,u=[],u[0]=620.83647811805429,u[1]=256987.25675774884,u[2]=83514679.143194929,u[3]=22151159547.979248,u[4]=4749141220799.9141,u[5]=784369607876235.87,u[6]=89522233618462736,u[7]=0x49de55d9c0a4e400,i=[],i[0]=.051086259475017659,i[1]=4.9821387295123341,i[2]=75.823828413254532,i[3]=366.7796093601508,i[4]=710.85630499892613,i[5]=597.48961240061362,i[6]=211.68875710057213,i[7]=25.207020585802372,o=[],o[0]=74.237327703567516,o[1]=1056.4488603826283,o[2]=4986.4105833765361,o[3]=9562.3189240475622,o[4]=7997.0416044735066,o[5]=2826.1927851763908,o[6]=336.0936078106983,s=[],s[0]=.0007621256
1620817314,s[1]=.073139705694091756,s[2]=1.1271960812968493,s[3]=5.1120795114680764,s[4]=8.424045901417724,s[5]=5.2145159868236153,s[6]=1,e=[],e[0]=.00057132312807254865,e[1]=.068845590875449544,e[2]=1.105142326340617,e[3]=5.0738638612860152,e[4]=8.3998555432760416,e[5]=5.2098284868236178,e[6]=1;var w=14.681970642123893,b=49.2184563216946,t,r,c,v,l,p=.79788456080286541,y=2.3561944901923448;return t=n,n<0&&(t=-n),t<=5?(r=n*n,t=f(r,h,3)/a(r,u,8),t=t*n*(r-w)*(r-b)):(t=5/n,r=t*t,c=f(r,s,6)/f(r,e,6),v=f(r,i,7)/a(r,o,7),l=n-y,c=c*Math.cos(l)-t*v*Math.sin(l),c*p/Math.sqrt(n))}function ke(n,t){var s,f,i,h,o,r,e,u,c=11102230246251565e-32;n<0?(n=-n,u=(n&1)==0?1:-1):u=1,t<0&&((n&1)!=0&&(u=-u),t=-t);if(n===0)return u*b(t);if(n===1)return u*y(t);if(n===2)return u*(2*y(t)/t-b(t));if(t<c)return 0;e=56,i=2*(n+e),r=i,h=t*t;do i-=2,r=i-h/r;while(--e>0);r=t/r,i=1,f=1/r,e=n-1,o=2*e;do s=(f*o-i*t)/t,i=f,f=s,o-=2;while(--e>0);return r=Math.abs(i)>Ma
th.abs(f)?y(t)/i:b(t)/f,u*r}function gu(n,t,i){n=Math.exp(-t)*Math.sqrt(Math.PI/(2*t))*i}function nf(n,t,i,r,u,f,o,s,h,c,l,a,v,y){if(n>Math.log(e))return 0;i=t,r=4*i*i,u=1,f=8*n,o=1,s=1,h=s,c=e,l=0;do a=r-u*u,s=s*a/(o*f),y=Math.abs(s),l>=t&&y>c&&gu(v,n,h),c=y,h+=s,o+=1,u+=2,l+=1;while(Math.abs(s/h)>ni)}function tf(n,t){var f,w,a,g,k,u,i,p,d,c,y,o,l,h,b,v,s,r;r=n<0?-n:n;if(r>31)return e;if(t<=0)return e;t>9.55&&nf(t,r,f,o,l,p,y,u,i,g,s,d,c,a),c=0,p=.25*t*t,y=1,o=0,h=1,v=2/t;if(r>0){for(o=-ti,f=1,s=1;s<r;s++)o+=1/f,f+=1,y*=f;h=v;if(r===1)c=1/t;else{for(a=y/r,w=1,i=a,d=-p,k=1,s=1;s<r;s++){a=a/(r-s),w=w*s,k*=d,u=a*k/w,i+=u;if(e-Math.abs(u)<Math.abs(i))return e;if(v>1&&e/v<h)return e;h*=v}i*=.5,u=Math.abs(i);if(h>1&&e/h<u)return e;if(u>1&&e/u<h)return e;c=i*h}}b=2*Math.log(.5*t),l=-ti,r===0?(o=l,u=1):(o=o+1/r,u=1/y),i=(l+o-b)*u,f=1;do u*=p/(f*(f+r)),l+=1/f,o+=1/(f+r),i+=(l+o-b)*u,f+=1;wh
ile(Math.abs(u/i)>ni);return i=.5*i/h,(r&1)!=0&&(i=-i),c+=i}function wt(n){var c,h,l,p,v,o=[],r,i,u,s,t;return o[0]=.051086259475017659,o[1]=4.9821387295123341,o[2]=75.823828413254532,o[3]=366.7796093601508,o[4]=710.85630499892613,o[5]=597.48961240061362,o[6]=211.68875710057213,o[7]=25.207020585802372,r=[],r[0]=74.237327703567516,r[1]=1056.4488603826283,r[2]=4986.4105833765361,r[3]=9562.3189240475622,r[4]=7997.0416044735066,r[5]=2826.1927851763908,r[6]=336.0936078106983,i=[],i[0]=.00076212561620817314,i[1]=.073139705694091756,i[2]=1.1271960812968493,i[3]=5.1120795114680764,i[4]=8.424045901417724,i[5]=5.2145159868236153,i[6]=1,u=[],u[0]=.00057132312807254865,u[1]=.068845590875449544,u[2]=1.105142326340617,u[3]=5.0738638612860152,u[4]=8.3998555432760416,u[5]=5.2098284868236178,u[6]=1,s=[],s[0]=1263204747.9017804,s[1]=-647355876379.16028,s[2]=114509511541823.73,s[3]=-8127702555013251,s[4]=0x2cf35a16e6cd620,s[5]=-0xacf20aeef158b80,t=[],t[0]=594.30159234612825,t[1]=235564.
09294306856,t[2]=73481194.445972174,t[3]=18760131610.870617,t[4]=3882312774962.3857,t[5]=620557727146953.75,t[6]=0xf41f1e2a3d2440,t[7]=0x3721e321ece8fe00,n<=5?n<=0?-e:(h=n*n,c=n*(f(h,s,5)/a(h,t,8)),c+=gt*(y(n)*Math.log(n)-1/n)):(c=5/n,h=c*c,l=f(h,i,6)/f(h,u,6),p=f(h,o,7)/a(h,r,7),v=n-uf,l=l*Math.sin(v)+c*p*Math.cos(v),l*dt/Math.sqrt(n))}function bt(n){var c,s,l,y,v,h=[],r,t,u,i,o;return h[0]=.00079693672929734706,h[1]=.08283523921074408,h[2]=1.2395337164641429,h[3]=5.4472500305876874,h[4]=8.74716500199817,h[5]=5.3032403823539491,h[6]=1,r=[],r[0]=.00092440881055886367,r[1]=.08562884743544745,r[2]=1.2535274390105895,r[3]=5.4709774033041709,r[4]=8.7619088323706951,r[5]=5.3060528823539466,r[6]=1,t=[],t[0]=-.011366383889846916,t[1]=-1.2825271867050931,t[2]=-19.553954425773597,t[3]=-93.206015212376826,t[4]=-177.68116798048806,t[5]=-147.07750515495118,t[6]=-51.410532676659933,t[7]=-6.0501435060072852,u=[],u[0]=64.3178256118178,u[1]=856.43002597698057,u[2]=3882.4018360540163,u[3]=7240
.4677419565251,u[4]=5930.7270118731694,u[5]=2062.0933166032783,u[6]=242.0057402402914,i=[],i[0]=15592.436785523574,i[1]=-14663929.590397161,i[2]=5435264770.5187654,i[3]=-982136065717.9115,i[4]=87590639439536.7,i[5]=-0xc5090e8ec6601,i[6]=0x9d4a5b305a0010,i[7]=-0x41b52d6418d9ec,o=[],o[0]=1041.2835366425984,o[1]=626107.330137135,o[2]=268919633.39381415,o[3]=86400248710.3935,o[4]=20297961275010.555,o[5]=3171577528429750.5,o[6]=0x37a4bf79f36ba00,n<=5?n<=0?-e:(s=n*n,c=f(s,i,7)/a(s,o,7),c+=gt*Math.log(n)*b(n)):(c=5/n,s=25/(n*n),l=f(s,h,6)/f(s,r,6),y=f(s,t,7)/a(s,u,7),v=n-ff,l=l*Math.sin(v)+c*y*Math.cos(v),l*dt/Math.sqrt(n))}function hf(n,t){var f,u,o,s,r,i;n<0?(n=-n,i=(n&1)==0?1:-1):i=1;if(n===0)return i*bt(t);if(n===1)return i*wt(t);if(t<=0)return-e;o=bt(t),u=wt(t),r=1,s=2*r;do f=s*u/t-o,o=u,u=f,s+=2,++r;while(r<n);return i*f}function cf(n){for(var i=1,t=n;t>1;t--)i*=t;return i}function kt(n,t,i){var r,a,f,e,h,c,u,s,o,l;if(t<0)return NaN;o=100,r=n*.5,a=r*r,r=Math.
pow(r,parseFloat(t)),f=cf(t),h=0,e=1,c=parseFloat(t),u=r/f,s=u*.9;if(i)while(u!==s&&o!==0)r*=a,h++,f*=h,c++,e*=c,s=u,u+=r/f/e,o--;else{l=!1;while(u!==s&&o!==0)r*=a,h++,f*=h,c++,e*=c,s=u,l?u+=r/f/e:u-=r/f/e,o--,l=!l}return u}function l(t,i){var u=Math.pow(i,10),r=parseInt(t,i);return isNaN(r)?n.Calc.Errors.Number:(u/2>r||(r-=u),r)}function h(n,t,i){var r,f,u;n<0&&(n+=Math.pow(t,10)),r=n.toString(t);if(r.length<i)for(f=i-r.length,u=0;u<f;u++)r="0"+r;return r.toUpperCase()}function ut(n){for(var t=0;et[t].str;t++)if(n.localeCompare(et[t].str)===0)return!1;return!0}function ft(n,t,i){var r,o,s,e,u,f;for(v=0,w=1,r=0;n[r].str;r++)if(i.localeCompare(n[r].str)===0)return v=n[r].c,!0;o=0;if(t)for(r=0;t[r].str;r++)s=i.substr(0,1).toLowerCase(),e=t[r].str.substr(0,1).toLowerCase(),s===e&&ut(i)&&(w=t[r].c,o++);for(r=0;n[r].str;r++){u=i.substr(1,n[r].str.Length),f=n[r].str.substr(0,n[r].str.Length);if(u===f&&ut(i))return v=n[r
].c,!0}return!1}function s(n,t,i,r,u){var e,s,h,f,l,c;return e=0,s=0,f=0,h=0,l=ft(n,t,i),e=v,s=w,c=ft(n,t,r),f=w,h=v,l?c?e===0||f===0?!1:(o=u*s/e*h/f,!0):!1:!1}function li(t){var u=parseFloat(t[0]),i,r;if(isNaN(u))return n.Calc.Errors.Value;i=n.Calc.Convert.toString(t[1]),r=n.Calc.Convert.toString(t[2]);if(i&&i!==""&&r&&r!==""){if((i.localeCompare("C")===0||i.localeCompare("cel")===0)&&r.localeCompare("C")===0||r.localeCompare("cel")===0)return u;else if((i.localeCompare("F")===0||i.localeCompare("fah")===0)&&(r.localeCompare("F")===0||r.localeCompare("fah")===0))return u;else if((i.localeCompare("K")===0||i.localeCompare("kel")===0)&&(r.localeCompare("K")===0||r.localeCompare("kel")===0))return u;else if((i.localeCompare("C")===0||i.localeCompare("cel")===0)&&(r.localeC
ompare("F")===0||r.localeCompare("fah")===0))return u*9/5+32;else if((i.localeCompare("F")===0||i.localeCompare("fah")===0)&&(r.localeCompare("C")===0||r.localeCompare("cel")===0))return(u-32)*5/9;else if((i.localeCompare("F")===0||i.localeCompare("fah")===0)&&(r.localeCompare("F")===0||r.localeCompare("fah")===0))return u;else if((i.localeCompare("F")===0||i.localeCompare("fah")===0)&&(r.localeCompare("K")===0||r.localeCompare("kel")===0))return(u-32)*5/9+p;else if((i.localeCompare("K")===0||i.localeCompare("kel")===0)&&(r.localeCompare("F")===0||r.localeCompare("fah")===0))return(u-p)*9/5+32;else if((i.localeCompare("C")===0||i.localeCompare("cel")===0)&&(r.localeCompare("K")===0||r.localeCompare("kel")===0))return u+p;else i
f((i.localeCompare("K")===0||i.localeCompare("kel")===0)&&(r.localeCompare("C")===0||r.localeCompare("cel")===0))return u-p}else return n.Calc.Errors.NotAvailable;return s(eu,c,i,r,u)?o:s(ki,c,i,r,u)?o:s(wi,null,i,r,u)?o:s(yi,c,i,r,u)?o:s(pi,c,i,r,u)?o:s(di,c,i,r,u)?o:s(ir,c,i,r,u)?o:s(st,c,i,r,u)?o:s(tr,c,i,r,u)?o:s(st,c,i,r,u)?o:n.Calc.Errors.NotAvailable}function ai(t){var r=n.Calc.Convert.toDouble(t[0]),i;if(isNaN(r))return n.Calc.Errors.Value;return i=n.Calc.Convert.toInt(t[1]),isNaN(i)?n.Calc.Errors.Value:i<0?n.Calc.Errors.Number:n.Calc.Convert.toResult(kt(r,i,!0))}function vi(t){var r=n.Calc.Convert.toDouble(t[0]),i;if(isNaN(r))return n.Calc.Errors.Value;return i=n.Calc.Convert.toInt(t[1]),isNaN(i)?n.Calc.Errors.Value:i<0?n.Calc.Errors.Number:n.Calc.Convert.toResult(kt(r,i,!1))}function si(t){var r=n.Calc.Convert.toDouble(t[0]),i;if(isNaN(r))return n.Calc.Errors.Value;return i=n.Calc.Convert.toInt(t[1]),isNaN(i)?n.Calc.Err
ors.Value:r<=0?n.Calc.Errors.Number:i<0?n.Calc.Errors.Number:n.Calc.Convert.toResult(tf(i,r))}function hi(t){var r=n.Calc.Convert.toDouble(t[0]),i;if(isNaN(r))return n.Calc.Errors.Value;return i=n.Calc.Convert.toInt(t[1]),isNaN(i)?n.Calc.Errors.Value:r<=0?n.Calc.Errors.Number:i<0?n.Calc.Errors.Number:n.Calc.Convert.toResult(hf(i,r))}function dr(t){var r=n.Calc.Convert.toString(t[0]),i;if(r.length>10)return n.Calc.Errors.Number;return i=l(r,2),i.length<r.length?n.Calc.Errors.Number:i}function gr(t){var f=n.Calc.Convert.toString(t[0]),r=n.Calc._Helper._argumentExists(t,1)?n.Calc.Convert.toInt(t[1]):1,i,u;if(f.length>10)return n.Calc.Errors.Number;if(r<1||10<r)return n.Calc.Errors.Number;i=l(f,2);if(i.length<f.length)return n.Calc.Errors.Number;return u=h(i,16,r),r<u.length&&0<=i&&n.Calc._Helper._argumentExists(t,1)?n.Calc.Errors.Number:u}function bi(t){var f=n.Calc.Convert.toString(t[0]),r=n.Calc._Helper._argumentExists(t,1)?n.Calc.C
onvert.toInt(t[1]):1,i,u;if(10<f.length)return n.Calc.Errors.Number;if(r<1||10<r)return n.Calc.Errors.Number;i=l(f,2);if(i.length<f.length)return n.Calc.Errors.Number;return u=h(i,8,r),0<=i&&r<u.length&&n.Calc._Helper._argumentExists(t,1)?n.Calc.Errors.Number:u}function br(t){var u=n.Calc.Convert.toDouble(t[0]),i=n.Calc._Helper._argumentExists(t,1)?n.Calc.Convert.toInt(t[1]):1,r;if(u<-512||511<u)return n.Calc.Errors.Number;if(i<1||10<i)return n.Calc.Errors.Number;return r=h(u,2,i),0<=r&&i<r.length&&n.Calc._Helper._argumentExists(t,1)?n.Calc.Errors.Number:r}function nu(t){var u=n.Calc.Convert.toDouble(t[0]),i=n.Calc._Helper._argumentExists(t,1)?n.Calc.Convert.toInt(t[1]):1,r;if(u<-549755813888||549755813887<u)return n.Calc.Errors.Number;if(i<1||10<i)return n.Calc.Errors.Number;return r=h(u,16,i),0<=r&&i<r.length&&n.Calc._Helper._argumentExists(t,1)?n.Calc.Errors.Number:r}function fu(
t){var u=n.Calc.Convert.toDouble(t[0]),i=n.Calc._Helper._argumentExists(t,1)?n.Calc.Convert.toInt(t[1]):1,r;if(u<-536870912||536870911<u)return n.Calc.Errors.Number;if(i<1||10<i)return n.Calc.Errors.Number;return r=h(u,8,i),0<=r&&i<r.length&&n.Calc._Helper._argumentExists(t,1)?n.Calc.Errors.Number:r}function tu(t){var f=n.Calc.Convert.toString(t[0]),r=n.Calc._Helper._argumentExists(t,1)?n.Calc.Convert.toInt(t[1]):1,i,u;if(10<f.length)return n.Calc.Errors.Number;if(r<1||10<r)return n.Calc.Errors.Number;i=l(f.toLowerCase(),16);if(i.length<f.length)return n.Calc.Errors.Number;if(i<-512||511<i)return n.Calc.Errors.Number;return u=h(i,2,r),0<=i&&r<u.length&&n.Calc._Helper._argumentExists(t,1)?n.Calc.Errors.Number:u}function sr(t){var r=n.Calc.Convert.toString(t[0]),i;if(10<r.length)return n.Calc.Errors.Number;return i=l(r.toLowerCase(),16),i.length<r.length?n.Calc.Errors.Number:n.Calc.Convert.toResult(i)}func
tion er(t){var f=n.Calc.Convert.toString(t[0]),r=n.Calc._Helper._argumentExists(t,1)?n.Calc.Convert.toInt(t[1]):1,i,u;if(10<f.length)return n.Calc.Errors.Number;if(r<1||10<r)return n.Calc.Errors.Number;i=l(f,16);if(i.length<f.length)return n.Calc.Errors.Number;if(i<-536870912||536870911<i)return n.Calc.Errors.Number;return u=h(i,8,r),0<=i&&r<u.length&&n.Calc._Helper._argumentExists(t,1)?n.Calc.Errors.Number:u}function ur(t){var f=n.Calc.Convert.toString(t[0]),r=n.Calc._Helper._argumentExists(t,1)?n.Calc.Convert.toInt(t[1]):1,i,u;if(10<f.length)return n.Calc.Errors.Number;if(r<1||10<r)return n.Calc.Errors.Number;i=l(f,8);if(i.length<f.length)return n.Calc.Errors.Number;if(i<-512||511<i)return n.Calc.Errors.Number;return u=h(i,2,r),0<=i&&r<u.length&&n.Calc._Helper._argumentExists(t,1)?n.Calc.Errors.Number:u}function hr(t){var r=n.Calc.Convert.toString(t[0]),i;if(10<r.length)return n.Calc.Errors.Number;r
eturn i=l(r,8),i.length<r.length?n.Calc.Errors.Number:n.Calc.Convert.toResult(i)}function yr(t){var f=n.Calc.Convert.toString(t[0]),r=n.Calc._Helper._argumentExists(t,1)?n.Calc.Convert.toInt(t[1]):1,i,u;if(10<f.length)return n.Calc.Errors.Number;if(r<1||10<r)return n.Calc.Errors.Number;i=l(f,8);if(i.length<f.length)return n.Calc.Errors.Number;if(i<-549755813888||549755813887<i)return n.Calc.Errors.Number;return u=h(i,16,r),0<=i&&r<u.length&&n.Calc._Helper._argumentExists(t,1)?n.Calc.Errors.Number:u}function ot(i){var f=n.Calc.Convert.toDouble(i[0]),u,e,r,o;if(isNaN(f))return n.Calc.Errors.Value;u=0;if(n.Calc._Helper._argumentExists(i,1)){u=n.Calc.Convert.toDouble(i[1]);if(isNaN(u))return n.Calc.Errors.Value}if(f<0||u<0)return n.Calc.Errors.Number;if(f>27||u>27)return n.Calc.Errors.Number;r=t.Functions._StatHelper.st_normsdist([f*Math.sqrt(2)]);if(typeof r==typeof n.Calc.Errors)return NaN;e=parseFloat(r)*2-1;if(n.Calc._Helper._ar
gumentExists(i,1)){r=t.Functions._StatHelper.st_normsdist([u*Math.sqrt(2)]);if(typeof r==typeof n.Calc.Errors)return NaN;o=parseFloat(r)*2-1,e=o-e}return e}function ru(t){var r=n.Calc.Convert.toDouble(t[0]),i;if(isNaN(r))return n.Calc.Errors.Value;if(r<0)return n.Calc.Errors.Number;return i=ot([r]),typeof i==typeof n.Calc.Errors?NaN:1-parseFloat(i)}function wr(i){var u=n.Calc.Convert.toDouble(i[0]),r;if(isNaN(u))return n.Calc.Errors.Value;r=0;if(n.Calc._Helper._argumentExists(i,1)){r=n.Calc.Convert.toDouble(i[1]);if(isNaN(r))return n.Calc.Errors.Value}return t.Functions._MathHelper.approxEqual(u,r)?1:0}function oi(t){var r=n.Calc.Convert.toDouble(t[0]),i;if(isNaN(r))return n.Calc.Errors.Value;i=0;if(n.Calc._Helper._argumentExists(t,1)){i=n.Calc.Convert.toDouble(t[1]);if(isNaN(i))return n.Calc.Errors.Value}return r>=i?1:0}function nr(t){var f=n.Calc.Convert.toDouble(t[0]),e=n.Calc.Convert.toDouble(t[1]),i;if(isNaN(f)||isNaN(e))return n.Calc.Errors.Value;return i=n.Calc._Helper.
_argumentExists(t,2)?n.Calc.Convert.toString(t[2]):"i",i!=="i"&&i!=="j"?n.Calc.Errors.Value:r._toResult(new u(f,e),i)}function iu(t){var f=r._toComplex(t[0]),u=f.real(),i=f.imag();return n.Calc.Convert.toResult(Math.sqrt(u*u+i*i))}function fr(t){var i=r._toComplex(t[0]);return n.Calc.Convert.toResult(i.imag())}function lr(t){var f=r._toComplex(t[0]),u=f.real(),i=f.imag();return u===0&&i===0?n.Calc.Errors.DivideByZero:n.Calc.Convert.toResult(Math.atan2(i,u))}function ar(n){var t=r._toComplex(n[0]),f=t.real(),i=t.imag();return r._toResult(new u(f,-i))}function vr(n){var e=r._toComplex(n[0]),f=e.real(),i=e.imag();return r._toResult(new u(Math.cos(f)*t.Functions._MathHelper.cosh(i),-Math.sin(f)*t.Functions._MathHelper.sinh(i)))}function or(t){var e=r._toComplex(t[0]),s=r._toComplex(t[1]),o=e.real(),h=e.imag(),f=s.real(),i=s.imag();return f===0&&i===0?n.Calc.Errors.Number:r._toResult(new u((o*f+h*i)/(f*f+i*i),(h*f-o*i)/(f*f+i*i)))}fun
ction pr(n){var f=r._toComplex(n[0]),i=f.real(),t=f.imag();return r._toResult(new u(Math.exp(i)*Math.cos(t),Math.exp(i)*Math.sin(t)))}function uu(t){var s=r._toComplex(t[0]),f=s.real(),i=s.imag(),o,e;return f===0&&i===0?n.Calc.Errors.Number:(o=Math.sqrt(f*f+i*i),e=Math.atan2(i,f),r._toResult(new u(Math.log(o),e)))}function kr(i){var s=r._toComplex(i[0]),e=s.real(),f=s.imag();if(e===0&&f===0)return n.Calc.Errors.Number;var h=Math.sqrt(e*e+f*f),c=Math.atan2(f,e),o=t.Functions._MathHelper.log10(Math.E);return r._toResult(new u(o*Math.log(h),o*c))}function ci(i){var s=r._toComplex(i[0]),e=s.real(),f=s.imag();if(e===0&&f===0)return n.Calc.Errors.Number;var h=Math.sqrt(e*e+f*f),c=Math.atan2(f,e),o=t.Functions._MathHelper.log(Math.E,2);return r._toResult(new u(o*Math.log(h),o*c))}function ui(t){var h=r._toComplex(t[0]),i=parseFloat(t[1]),e,f,s,o;if(isNaN(i))return n.Calc.Errors.Value;return e=h.real(),f=h.imag(),e===0&&f===0?i>0?r._toResult(new u(0,0)):n.
Calc.Errors.Number:(s=Math.sqrt(e*e+f*f),o=Math.atan2(f,e),r._toResult(new u(Math.pow(s,i)*Math.cos(i*o),Math.pow(s,i)*Math.sin(i*o))))}function ri(t){for(var c=1,l=0,s,h,f,i,o,y,v,a,e=0;e<t.length;e++)if(t[e].constructor===n.Calc.CalcArray)for(y=t[e],v=0;v<y.rowCount;v++)for(a=0;a<y.columnCount;a++)s=r._toComplex(y.getValue(v,a)),h=c,f=l,i=s.real(),o=s.imag(),c=h*i-f*o,l=h*o+f*i;else s=r._toComplex(t[e]),h=c,f=l,i=s.real(),o=s.imag(),c=h*i-f*o,l=h*o+f*i;return r._toResult(new u(c,l))}function fi(t){var i=r._toComplex(t[0]);return n.Calc.Convert.toResult(i.real())}function ei(n){var e=r._toComplex(n[0]),f=e.real(),i=e.imag();return r._toResult(new u(Math.sin(f)*t.Functions._MathHelper.cosh(i),Math.cos(f)*t.Functions._MathHelper.sinh(i)))}function gi(n){var o=r._toComplex(n[0]),i=o.real(),t=o.imag(),e,f;return i===0&&t===0?r._toResult(new u(0,0)):(e=Math.sqrt(i*i+t*t),f=Math.atan2(t,i),r._toResult(new u(Math.sqrt(e)*Math.cos(f/2),Math.sqrt(e)*Math.sin(f/2))))}functio
n rr(n){var i=r._toComplex(n[0]),t=r._toComplex(n[1]),o=i.real(),s=i.imag(),f=t.real(),e=t.imag();return r._toResult(new u(o-f,s-e))}function cr(t){for(var e=0,o=0,i,a,l,y,v,h,s,c,f=0;f<t.length;f++)if(t[f].constructor===n.Calc.CalcArray)for(h=t[f],s=0;s<h.rowCount;s++)for(c=0;c<h.columnCount;c++)i=r._toComplex(h.getValue(s,c)),a=e,l=o,y=i.real(),v=i.imag(),e=a+y,o=l+v;else i=r._toComplex(t[f]),a=e,l=o,y=i.real(),v=i.imag(),e=a+y,o=l+v;return r._toResult(new u(e,o))}n.feature("calc.functions_eng",["calc.functions"]);var rf=17976931348623157e292,e=17976931348623157e292,dt=.79788456080286541,uf=2.3561944901923448,gt=.63661977236758138,ff=.78539816339744828,ni=11102230246251565e-32,ti=.57721566490153287;var u=function(){function t(n,t){this._real=n,this._imag=t}return t.prototype.real=function(){return this._real},t.prototype.imag=function(){return this._imag},t.prototype.toString=function(t){t||(t="i");var i=new n._StringBuilder;return(this._real
!==0||this._imag===0)&&i.append(this._real.toString()),this._imag===-1?i.append("-"):this._real!==0&&this._imag>0&&i.append("+"),this._imag!==-1&&this._imag!==0&&this._imag!==1&&i.append(this._imag.toString()),this._imag!==0&&i.append(t),i.toString()},t._parse=function(i){var c=0,s=0,e=!1,o=!1,h=!1,u=0,f=0,r=0;if(!i)throw n._StringResource.Exp_ArgumentNull;if(i.length===0)throw n._StringResource.Exp_Format;r<i.length&&(i.charAt(r)==="+"||i.charAt(r)==="-")&&r++;while(r<i.length&&!isNaN(Number(i.charAt(r))))r++,e=!0;r<i.length&&i.charAt(r)==="."&&r++;while(r<i.length&&!isNaN(Number(i.charAt(r))))r++,e=!0;if(r<i.length&&(i.charAt(r)==="E"||i.charAt(r)==="e")){r++,e=!1,r<i.length&&(i.charAt(r)==="+"||i.charAt(r)==="-")&&r++;while(r<i.length&&am
p;!isNaN(Number(i.charAt(r))))r++,e=!0}if(r<i.length&&(i.charAt(r)==="+"||i.charAt(r)==="-")){u=r,r++;while(r<i.length&&!isNaN(Number(i.charAt(r))))r++,o=!0;r<i.length&&i.charAt(r)==="."&&r++;while(r<i.length&&!isNaN(Number(i.charAt(r))))r++,o=!0;if(r<i.length&&(i.charAt(r)==="E"||i.charAt(r)==="e")){r++,o=!1,r<i.length&&(i.charAt(r)==="+"||i.charAt(r)==="-")&&r++;while(r<i.length&&!isNaN(Number(i.charAt(r))))r++,o=!0}r<i.length&&(i.charAt(r)==="i"||i.charAt(r)==="j")&&(r++,h=!0),f=r-u}else r<i.length&&(i.charAt(r)==="i"||i.charAt(r)==="j")?(r++,f=r,o=e,h=!0,e=!1):u=r;if(r<i.length)throw n._StringResource.Exp_Format;if(u>0)if(e)c=parseInt(i.substr(0,u),10);else throw n._StringResource.Exp_Format;if(f>0){if(!h)throw n._StringResource.Exp_Format;i
f(f===1)s=1;else if(f===2&&i.charAt(u)==="+")s=1;else if(f===2&&i.charAt(u)==="-")s=-1;else if(o)s=parseInt(i.substr(u,f-1),10);else throw n._StringResource.Exp_Format;}return new t(c,s)},t}(),r=function(){function t(){}return t._toComplex=function(t){try{if(t)if(t.constructor===Number)return new u(parseFloat(t),0);else if(t.constructor===String)return u._parse(t);else throw n._StringResource.Exp_InvalidCast;else return new u(0,0)}catch(i){throw n._StringResource.Exp_InvalidCast;}},t._toResult=function(t,i){return isNaN(t.real())||t.real()===Number.POSITIVE_INFINITY||isNaN(t.imag())||t.imag()===Number.POSITIVE_INFINITY?n.Calc.Errors.Number:t.toString(i)},t}(),lf=6852205001e-14,ef=.002204622915,of=602217e18,sf=.035273972,du=1/1852,ii=1e4/254,pt=ii/12,tt=pt/3,cu=tt/1760,lu=1e10,au=2834.645669,ou=.001,g=365.25,d=24*g,rt=60*d,su=60*rt,nt=9869233e-12,hu=.00750061708,it=1e5,wu=.224808924,k=745.701,bu=9999995.193,ku=.239006249,vu=.238846191,lt=62146e14,c
t=1/(3600*k),at=1/3600,yu=23.73042222,yt=.000947815,pu=1e4,p=273.15,af=1/3,se=1/6,he=1/48,vt=1/96,ce=1/192,fe=1/768,ht=.004929994,ee=.008675585,oe=1e24,ye=1e21,pe=1e18,we=1e15,ae=1e12,ve=1e9,le=1e6,ue=1e3,wf=100,bf=10,kf=.1,vf=.01,yf=.001,pf=1e-6,te=1e-9,ie=1e-12,re=1e-15,df=1e-18,gf=1e-21,ne=1e-24,i=function(){function n(n,t){this.str=n,this.c=t}return n}(),eu=[new i("g",1),new i("sg",lf),new i("lbm",ef),new i("u",of),new i("ozm",sf),new i(null,0)],ki=[new i("m",1),new i("mi",cu),new i("Nmi",du),new i("in",ii),new i("ft",pt),new i("yd",tt),new i("ang",lu),new i("Pica",au),new i("km",ou),new i(null,0)],wi=[new i("yr",1),new i("day",g),new i("hr",d),new i("mn",rt),new i("sec",su),new i(null,0)],yi=[new i("Pa",1),new i("atm",nt),new i("mmHg",hu),new i("p",1),
new i("at",nt),new i(null,0)],pi=[new i("N",1),new i("dyn",it),new i("lbf",wu),new i("dy",it),new i(null,0)],di=[new i("J",1),new i("e",bu),new i("c",ku),new i("cal",vu),new i("eV",lt),new i("HPh",ct),new i("Wh",at),new i("flb",yu),new i("BTU",yt),new i("ev",lt),new i("hh",ct),new i("wh",at),new i("btu",yt),new i(null,0)],ir=[new i("HP",1),new i("W",k),new i("h",1),new i("w",k),new i(null,0)],st=[new i("T",1),new i("ga",pu),new i(null,0)],tr=[new i("tsp",1),new i("tbs",af),new i("oz",se),new i("cup",he),new i("pt",vt),new i("qt",ce),new i("gal",fe),new i("l",ht),new i("uk_pt",ee),new i("us_pt",vt),new i("lt",ht),new i(null,0)],c=[new i(&qu
ot;Y",oe),new i("Z",ye),new i("E",pe),new i("P",we),new i("T",ae),new i("G",ve),new i("M",le),new i("k",ue),new i("h",wf),new i("e",bf),new i("d",kf),new i("c",vf),new i("m",yf),new i("u",pf),new i("n",te),new i("p",ie),new i("f",re),new i("a",df),new i("z",gf),new i("y",ne),new i(null,0)],v=0,w=0,o=0,et=["cup","mmHg","J","sec","cel","kel","hh","Wh","wh","flb","BTU"];t.def("BESSELI",ai,{minArgs:2,maxArgs:2}),t.def("BESSELJ",vi,{minArgs:2,maxArgs:2}),t.def("BESSELK",si,{minArgs:2,maxArgs:2}),t.def("BESSELY",hi,{minArgs:2,maxArgs:2}),t.def("BIN2DEC",dr,{minArgs:1,maxArgs:1}),t.def("BIN2HEX",gr,{minArgs:1,maxArgs:2,acceptsMissi
ngArgument:t.acceptsOne}),t.def("BIN2OCT",bi,{minArgs:1,maxArgs:2,acceptsMissingArgument:t.acceptsOne}),t.def("DEC2BIN",br,{minArgs:1,maxArgs:2,acceptsMissingArgument:t.acceptsOne}),t.def("DEC2HEX",nu,{minArgs:1,maxArgs:2,acceptsMissingArgument:t.acceptsOne}),t.def("DEC2OCT",fu,{minArgs:1,maxArgs:2,acceptsMissingArgument:t.acceptsOne}),t.def("HEX2BIN",tu,{minArgs:1,maxArgs:2,acceptsMissingArgument:t.acceptsOne}),t.def("HEX2DEC",sr,{minArgs:1,maxArgs:1}),t.def("HEX2OCT",er,{minArgs:1,maxArgs:2,acceptsMissingArgument:t.acceptsOne}),t.def("OCT2BIN",ur,{minArgs:1,maxArgs:2,acceptsMissingArgument:t.acceptsOne}),t.def("OCT2DEC",hr,{minArgs:1,maxArgs:1}),t.def("OCT2HEX",yr,{minArgs:1,maxArgs:2,acceptsMissingArgument:t.acceptsOne}),t.def("ERF",ot,{minArgs:1,maxArgs:2,acceptsMissingArgument:t.acceptsOne}),t.def("ERFC",ru,{minArgs:1,maxArgs:1}),t.def("DELTA",wr,{mi
nArgs:1,maxArgs:2,acceptsMissingArgument:t.acceptsOne}),t.def("GESTEP",oi,{minArgs:1,maxArgs:2,acceptsMissingArgument:t.acceptsOne}),t.def("COMPLEX",nr,{minArgs:2,maxArgs:3,acceptsMissingArgument:t.acceptsTwo}),t.def("IMABS",iu,{minArgs:1,maxArgs:1}),t.def("IMAGINARY",fr,{minArgs:1,maxArgs:1}),t.def("IMARGUMENT",lr,{minArgs:1,maxArgs:1}),t.def("IMCONJUGATE",ar,{minArgs:1,maxArgs:1}),t.def("IMCOS",vr,{minArgs:1,maxArgs:1}),t.def("IMDIV",or,{minArgs:2,maxArgs:2}),t.def("IMEXP",pr,{minArgs:1,maxArgs:1}),t.def("IMLN",uu,{minArgs:1,maxArgs:1}),t.def("IMLOG10",kr,{minArgs:1,maxArgs:1}),t.def("IMLOG2",ci,{minArgs:1,maxArgs:1}),t.def("IMPOWER",ui,{minArgs:2,maxArgs:2}),t.def("IMPRODUCT",ri,{minArgs:1,maxArgs:255,acceptsMissingArgument:t.acceptsNotZero}),t.def("IMREAL",fi,{minArgs:1,maxArgs:1}),t.def("IMSIN",ei,{minArgs:1,maxArgs:1}),
t.def("IMSQRT",gi,{minArgs:1,maxArgs:1}),t.def("IMSUB",rr,{minArgs:2,maxArgs:2}),t.def("IMSUM",cr,{minArgs:1,maxArgs:255,acceptsMissingArgument:t.acceptsNotZero}),t.def("CONVERT",li,{minArgs:3,maxArgs:3})})(t.Functions||(t.Functions={}));var i=t.Functions})(n.Calc||(n.Calc={}));var t=n.Calc})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(n){(function(t){(function(t){function o(n,i,r){var w,v,o,y,c,p,e,a,h,b,s,l,f;o=n.getFullYear(),v=n.getMonth(),w=n.getDate(),p=i.getFullYear(),c=i.getMonth(),y=i.getDate(),h=p-o,e=c-v,a=y-w,e=h*12+e,b=yu(o);switch(r){case 0:return f=[],f[0]=n,f[1]=i,t.Functions._DateHelper.days360(f);case 1:case 2:case 3:return l=u(n),s=u(i),s-l;case 4:return e*30+a;default:return-1}}function at(n,t,i,r,u){var e,f;return n===0?e=(i+r)/t:(f=Math.pow(1+n,t),e=u>0?(r*n/(f-1)+i*n/(1-1/f))/(1+n):r*n/(f-1)+i*n/(1-1/f)),-e}function d(n,t,i,r,u){var e,f;return n===0?e=r+i*t:(f=Math.pow
(1+n,t),e=u>0?r*f+i*(1+n)*(f-1)/n:r*f+i*(f-1)/n),-e}function pu(t,i){var r=Math.pow(1+t,i);return isNaN(r)||!isFinite(r)?n.Calc.Errors.Number:r}function vu(t,i){if(t===0)return i;else{var u=Math.pow(1+t,i),f=u-1,r=f/t;return isNaN(r)||!isFinite(r)?n.Calc.Errors.Number:r}}function yt(t,i,r,u,f){var o,s;o=pu(t,i),s=vu(t,i);var l=-r*o-u,h=1+t*n.Calc.Convert.toDouble(f),c=h*s,e=l/c;return isNaN(e)||!isFinite(e)?n.Calc.Errors.Number:e}function pt(t,i,r,u){var e=Math.pow(1+r,u),o=e-1,f=-(t*e*r+i*o);return isNaN(f)||!isFinite(f)?n.Calc.Errors.Number:f}function h(n,t,r,u){var s,e,h,f=new Date(1,0,1),o;f.setFullYear(1),o=0,h=t.getDate()===b(t.getFullYear(),t.getMonth()),s=12/r,e=t.getFullYear()-n.getFullYear(),e>0&&(e=(e-1)*r);do f=new Date(t.getFullYear(),t.getMonth(),t.getDate()),e++,f.setMonth(f.getMonth()-e*s),h&&(o=b(f.getFullYear(),f.getMonth()),f=new Date(f.getFullYear(),f.getMonth(),o));while(i(n,f)<0);return u&&(f=new Date(t.getFullYear(),t.getMonth(
),t.getDate()),e--,f.setMonth(f.getMonth()-e*s),h&&(o=b(f.getFullYear(),f.getMonth()),f=new Date(f.getFullYear(),f.getMonth(),o))),f}function tt(n,t,i,r){var u=h(n,t,i,!1);return f(u,n,r)}function s(n,t,i,r){var e,u;switch(r){case 0:case 2:case 4:case 5:return 360/i;case 3:return 365/i;default:return u=h(n,t,i,!0),e=h(n,t,i,!1),f(e,u,1)}}function g(n,t,i,r){var u=h(n,t,i,!0);return f(n,u,r)}function lu(n,t,i){var r=h(n,t,i,!0);return u(r)}function w(n,t,i){var u,r=new Date(t.getFullYear(),t.getMonth(),t.getDate());u=t.getMonth()-n.getMonth()+12*(t.getFullYear()-n.getFullYear()),r.setMonth(r.getMonth()-u);if(t.getDate()===b(t.getFullYear(),t.getMonth()))while(r.getDate()!==b(r.getFullYear(),r.getMonth()))r.setDate(r.getDate()+1);return n.getDate()<r.getDate()||u--,parseInt((1+u/(12/i)).toString(),10)}function au(n,t,i){var r=h(n,t,i,!1);return u(r)}function gt(t,i,r,u,f,e,o){var h=0,s,l=0,c=100,a=n.Calc.Convert;for(r*=c/a.toDouble(f),u/=f,u+=1,s=1;s<o;s++)h+=s*r/Math.po
w(u,s);for(h+=o*(r+c)/Math.pow(u,o),s=1;s<o;s++)l+=r/Math.pow(u,s);return l+=(r+c)/Math.pow(u,o),h/=l,h/=a.toDouble(f)}function k(n){return n.havexpos=n.havexneg=!1,n.xmin=-1e10,n.xmax=1e10,n.precision=1e-10,n}function r(n,t,i){return t>0?(i.havexpos?i.havexneg?Math.abs(n-i.xneg)<Math.abs(i.xpos-i.xneg)&&(i.xpos=n,i.ypos=t):t<i.ypos&&(i.xpos=n,i.ypos=t):(i.xpos=n,i.ypos=t,i.havexpos=!0),[!1,i]):t<0?(i.havexneg?i.havexpos?Math.abs(n-i.xpos)<Math.abs(i.xpos-i.xneg)&&(i.xneg=n,i.yneg=t):-t<-i.yneg&&(i.xneg=n,i.yneg=t):(i.xneg=n,i.yneg=t,i.havexneg=!0),[!1,i]):(i.root=n,[!0,i])}function kt(n,t,i,r,u,f,e){for(var d,b,p=tt(n,t,f,e),v=g(n,t,f,e),o=s(n,t,f,e),l=parseInt(w(n,t,f).toString(),10),y=0,a=100*i/f,c=1+r/f,k=v/o,h=0;h<l;h++)y+=a/Math.pow(c,k+h);return d=u/Math.pow(c,l-1+v/o),b=p/o*a,d+y-b}function e(n,t,r,u,e){var o,c,l;o=h(n,r,u,!0),c=h(n,r,u,!1);if(i(o,t)>=0)return f(n,t,e)/s(c,o,u,e);l=f(n,o,e)/s(c,o,u,e);for(;;){c=new D
ate(o.getFullYear(),o.getMonth(),o.getDate()),o.setMonth(o.getMonth()+12/u);if(i(o,t)>=0)return l+=f(c,t,e)/s(c,o,u,e);l+=1}}function bt(n,t,r,u,o,h,c,l,a){var nt=f(r,n,a),k=f(n,u,a),it=f(r,u,a),v=s(n,t,l,a),p=parseInt(w(n,t,l).toString(),10),et=100*o/l,b=1+h/l,ut,ft,rt,g,y,tt,d;if(k>v)switch(a){case 0:case 4:g=f(u,t,a),p=1+parseInt(Math.ceil(g/v).toString(),10);break;default:for(y=new Date(u.getFullYear(),u.getMonth(),u.getDate()),tt=32767,p=0;p<tt;p++){d=new Date(y.getFullYear(),y.getMonth(),y.getDate()),y.setMonth(y.getMonth()+12/l);if(i(y,t)>=0){p+=parseInt((Math.ceil(f(d,t,a))/s(d,y,l,a)).toString(),10)+1;break}}nt=v*e(r,n,u,l,a),k=v*e(n,u,u,l,a),it=v*e(r,u,u,l,a);break}return ft=c/Math.pow(b,p-1+k/v),rt=it/v/Math.pow(b,k/v),ut=Math.pow(b,-k/v)*(Math.pow(b,-p)-1/b)/(1/b-1),ft+et*(rt+ut-nt/v)}function nt(n,i){var r=n.substr(0,3),u=t.Functions._MathHelper.round;switch(n[0]){case"A":if(r==="ATS")return u(13.7603,i);break;case"B":if(r===&qu
ot;BEF")return u(40.3399,i);break;case"D":if(r==="DEM")return u(1.95583,i);break;case"E":if(r==="ESP")return u(166.386,i);else if(r==="EUR")return u(1,i);break;case"F":if(r==="FIM")return u(5.94573,i);else if(r==="FRF")return u(6.55957,i);break;case"G":if(r==="GRD")return u(340.75,i);break;case"I":if(r==="IEP")return u(.787564,i);else if(r==="ITL")return u(1936.27,i);break;case"L":if(r==="LUX"||r==="LUF")return u(40.3399,i);break;case"N":if(r==="NLG")return u(2.20371,i);break;case"P":if(r==="PTE")return u(200.482,i);break;default:break}return-1}function wu(n){var t=n.substr(0,3);switch(n[0]){case"A":if(t==="ATS")return 2;break;case"B":if(t==="BEF")return 0;break;case"D":if(t==="DEM")return 2;break;case"E":if(t===
"ESP")return 0;else if(t==="EUR")return 2;break;case"F":if(t==="FIM")return 2;else if(t==="FRF")return 2;break;case"G":if(t==="GRD")return 2;break;case"I":if(t==="IEP")return 2;else if(t==="ITL")return 0;break;case"L":if(t==="LUX"||t==="LUF")return 0;break;case"N":if(t==="NLG")return 2;break;case"P":if(t==="PTE")return 1;break;default:break}return 2}function gu(n){var t=n.substr(0,3);switch(n[0]){case"A":if(t==="ATS")return 2;break;case"B":if(t==="BEF")return 0;break;case"D":if(t==="DEM")return 2;break;case"E":if(t==="ESP")return 0;else if(t==="EUR")return 2;break;case"F":if(t==="FIM")return 2;else if(t==="FRF")return 2;break;case"G":if(t==="GRD")return 2;break;case"I"
:if(t==="IEP")return 2;else if(t==="ITL")return 0;break;case"L":if(t==="LUX"||t==="LUF")return 0;break;case"N":if(t==="NLG")return 2;break;case"P":if(t==="PTE")return 2;break;default:break}return 2}function nf(t){var i=n.Calc.Convert,e=n.Calc._Helper,r=i.toDouble(t[0]),u=i.toDouble(t[1]),s=i.toDouble(t[2]),o=e._argumentExists(t,3)?i.toDouble(t[3]):0,f=e._argumentExists(t,4)?i.toDouble(t[4]):0;return f!==0&&(f=1),r===0?i.toResult(-(s*u+o)):i.toResult(-(o*Math.pow(1+r,u)+s*(1+r*f)*(Math.pow(1+r,u)-1)/r))}function du(t){for(var f=n.Calc.Convert,e=n.Calc._ArrayHelper,u=f.toDouble(t[0]),r,i=0;i<e.getLength(t[1]);i++)r=f.toDouble(e.getValueByIndex(t[1],i)),u*=1+r;return u}function bu(t){for(var r=n.Calc.Convert,e=n.Calc._ArrayHelper,c=r.toDouble(t[0]),h=0,s=1,o=0,f,u,i=1;i<t.length;i++){if(r.isError(t[i]))return t[i];if(e.isArrayOrReference(t[i]))for(f=0;f<e.getLength(t[i]);f++){u=e.
getValueByIndex(t[i],f);if(r.isError(u))return u;if(r.isNumber(u))o=r.toDouble(e.getValueByIndex(t[i],f)),h+=o/Math.pow(1+c,s),s++;else if(r.isError(u))return u}else o=r.toDouble(t[i]),h+=o/Math.pow(1+c,s),s++}return h}function ku(t){var i=n.Calc.Convert,e=n.Calc._Helper,r=i.toDouble(t[0]),u=i.toDouble(t[1]),s=i.toDouble(t[2]),o=e._argumentExists(t,3)?i.toDouble(t[3]):0,f=e._argumentExists(t,4)?i.toDouble(t[4]):0;return f!==0&&(f=1),r===0?i.toResult(-(s*u+o)):r===-1?n.Calc.Errors.DivideByZero:i.toResult(-(o+s*(1+r*f)*(Math.pow(1+r,u)-1)/r)/Math.pow(1+r,u))}function cu(t){var r=n.Calc.Convert,v=n.Calc._Helper,h=r.toDateTime(t[0]),a=r.toDateTime(t[1]),c=r.toDouble(t[2]),l=r.toDouble(t[3]),u=v._argumentExists(t,4)?r.toInt(t[4]):0,e,f,s;if(i(h,a)>=0)return n.Calc.Errors.Number;if(c<=0||l<=0||u<0||4<u)return n.Calc.Errors.Number;e=o(h,a,u),f=p(h,u);if(e<=0||f<=0)return n.Calc.Errors.Number;return s=1-l*e/f,s<=0?n.Calc.Errors.Number:c/s}function iu(t){var s
=n.Calc.Convert,f=n.Calc._ArrayHelper,o=f.getLength(t[1]),c=f.getLength(t[2]),i,r;if(o!==c)return n.Calc.Errors.Number;var a=s.toDouble(t[0]),l=[],e=[],h=0;for(i=0;i<o;i++)l[i]=s.toDouble(f.getValueByIndex(t[1],i));for(i=0;i<c;i++)e[i]=s.toDateTime(f.getValueByIndex(t[2],i));for(r=0;r<o;r++)h+=l[r]/Math.pow(1+a,(u(e[r])-u(e[0]))/365);return h}function ru(n,t,i,r,u,f){var s,e,o;for(s=at(n,t,i,0,f),e=0,r===1&&(f>0||(e=-i),r++),o=r;o<=u;o++)e+=f>0?d(n,o-2,s,i,1)-s:d(n,o-1,s,i,0);return e*=n}function tu(t){var i=n.Calc.Convert,o=i.toDouble(t[0]),e=i.toInt(t[1]),s=i.toDouble(t[2]),r=i.toInt(t[3]),u=i.toInt(t[4]),f=i.toInt(t[5]);return r<1||u<r||o<=0||u>e||e<=0||s<=0||f!==0&&f!==1?n.Calc.Errors.Number:ru(o,e,s,r,u,f)}function gr(n,t,i,r,u,f){var e,o,s;for(e=at(n,t,i,0,f),o=0,r===1&&(o=f>0?e:e+i*n,r++),s=r;s<=u;s++)o+=f>0?e-(d(n,s-2,e,i,1)-e)*n:e-d(n,s-1,e,i,0)*n;return o}function nu(t){var i=n.Calc.Convert,o=i.toDouble(t
[0]),e=i.toInt(t[1]),s=i.toDouble(t[2]),r=i.toInt(t[3]),u=i.toInt(t[4]),f=i.toInt(t[5]);return r<1||u<r||o<=0||u>e||e<=0||s<=0||f!==0&&f!==1?n.Calc.Errors.Number:gr(o,e,s,r,u,f)}function uu(t){var i=n.Calc.Convert,s=n.Calc._Helper,o=i.toDouble(t[0]),r=i.toDouble(t[1]),u=i.toDouble(t[2]),f=i.toDouble(t[3]),h=s._argumentExists(t,4)?i.toDouble(t[4]):0,c=s._argumentExists(t,5)?i.toInt(t[5]):0,e;return r<1||r>=u+1||u<1?n.Calc.Errors.Number:(e=yt(o,u,f,h,c),pt(f,e,o,r-1))}function su(t){var i=n.Calc.Convert,f=i.toDouble(t[0]),e=i.toInt(t[1]),r=i.toInt(t[2]),u=i.toDouble(t[3]);return r===0?n.Calc.Errors.DivideByZero:i.toResult(u*f*(i.toDouble(e)/i.toDouble(r)-1))}function hu(t){var i=n.Calc.Convert,e=n.Calc._Helper,u=i.toDouble(t[0]),r=i.toDouble(t[1]),s=i.toDouble(t[2]),o=e._argumentExists(t,3)?i.toDouble(t[3]):0,f=e._argumentExists(t,4)?i.toDouble(t[4]):0;return f!==0&&(f=1),u===0?r===0?n.Calc.Errors.DivideByZero:i.toResult(-(s+o)/r):r===0?n.Cal
c.Errors.DivideByZero:i.toResult(-(s*Math.pow(1+u,r)+o)/((1+u*f)*(Math.pow(1+u,r)-1)/u))}function ou(t){var i=n.Calc.Convert,o=n.Calc._Helper,s=i.toDouble(t[0]),u=i.toDouble(t[1]),h=i.toDouble(t[2]),f=i.toDouble(t[3]),l=o._argumentExists(t,4)?i.toDouble(t[4]):0,c=o._argumentExists(t,5)?i.toBool(t[5]):!1,r,e;return u<1||u>=h+1?n.Calc.Errors.Number:(r=yt(s,h,f,l,c?1:0),e=pt(f,r,s,u-1),r-e)}function fu(t){var u=n.Calc.Convert,h=n.Calc._Helper,o=u.toDateTime(t[0]),s=u.toDateTime(t[1]),r=u.toInt(t[2]),f=h._argumentExists(t,3)?u.toInt(t[3]):0,e=n.Calc.Errors.Number;return f<0||f>4?e:r!==1&&r!==2&&r!==4?e:i(o,s)>=0?e:tt(o,s,r,f)}function eu(t){var u=n.Calc.Convert,c=n.Calc._Helper,o=u.toDateTime(t[0]),h=u.toDateTime(t[1]),r=u.toInt(t[2]),f=c._argumentExists(t,3)?u.toInt(t[3]):0,e=n.Calc.Errors.Number;return f<0||f>4?e:r!==1&&r!==2&&r!==4?e:i(o,h)>=0?e:s(o,h,r,f)}function bf(t){var u=n.Calc.Convert,s=n.Calc._Helper,e=u.toDateTime(t[0])
,o=u.toDateTime(t[1]),r=u.toInt(t[2]),f=s._argumentExists(t,3)?u.toInt(t[3]):0;return f<0||f>4?n.Calc.Errors.Number:r!==1&&r!==2&&r!==4?n.Calc.Errors.Number:i(e,o)>=0?n.Calc.Errors.Number:g(e,o,r,f)}function kf(t){var u=n.Calc.Convert,s=n.Calc._Helper,o=u.toDateTime(t[0]),e=u.toDateTime(t[1]),r=u.toInt(t[2]),f=s._argumentExists(t,3)?u.toInt(t[3]):0;return f<0||f>4?n.Calc.Errors.Number:r!==1&&r!==2&&r!==4?n.Calc.Errors.Number:i(o,e)>=0?n.Calc.Errors.Number:lu(o,e,r)}function wf(t){var u=n.Calc.Convert,s=n.Calc._Helper,o=u.toDateTime(t[0]),e=u.toDateTime(t[1]),r=u.toInt(t[2]),f=s._argumentExists(t,3)?u.toInt(t[3]):0;return f<0||f>4?n.Calc.Errors.Number:r!==1&&r!==2&&r!==4?n.Calc.Errors.Number:i(o,e)>=0?n.Calc.Errors.Number:w(o,e,r)}function yf(t){var u=n.Calc.Convert,s=n.Calc._Helper,o=u.toDateTime(t[0]),e=u.toDateTime(t[1]),r=u.toInt(t[2]),f=n.Calc._Helper._argumentExists(t,3)?u.toInt(t[3]):0;return f<0||f&
gt;4?n.Calc.Errors.Number:r!==1&&r!==2&&r!==4?n.Calc.Errors.Number:i(o,e)>=0?n.Calc.Errors.Number:au(o,e,r)}function pf(t){var r=n.Calc.Convert,c=n.Calc._Helper,o=r.toDateTime(t[0]),e=r.toDateTime(t[1]),h=r.toDouble(t[2]),l=r.toDouble(t[3]),u=r.toInt(t[4]),f=c._argumentExists(t,5)?r.toInt(t[5]):0,s;return f<0||f>4?n.Calc.Errors.Number:u!==1&&u!==2&&u!==4?n.Calc.Errors.Number:i(o,e)>0?n.Calc.Errors.Number:(s=w(o,e,u),gt(o,e,h,l,u,f,s))}function df(t,i,r,u,f,e,o){var s=gt(t,i,r,u,f,e,o);return s/=1+u/n.Calc.Convert.toDouble(f)}function ie(t){var r=n.Calc.Convert,c=n.Calc._Helper,o=r.toDateTime(t[0]),e=r.toDateTime(t[1]),h=r.toDouble(t[2]),l=r.toDouble(t[3]),u=r.toInt(t[4]),f=c._argumentExists(t,5)?r.toInt(t[5]):0,s;return f<0||f>4?n.Calc.Errors.Number:u!==1&&u!==2&&u!==4?n.Calc.Errors.Number:i(o,e)>0?n.Calc.Errors.Number:(s=w(o,e,u),df(o,e,h,l,u,f,s))}function re(t){var r=n.Calc.Convert,e=n.Calc._Helper,i=r.toDouble(
t[0]),f=r.toDouble(t[1]),s=r.toDouble(t[2]),o=e._argumentExists(t,3)?r.toDouble(t[3]):0,u=e._argumentExists(t,4)?r.toDouble(t[4]):0;return u!==0&&(u=1),i===0?f===0?n.Calc.Errors.DivideByZero:r.toResult(-(s+o)/f):i<=-1?n.Calc.Errors.Number:r.toResult(Math.log((f*(1+i*u)-o*i)/(s*i+f*(1+i*u)))/Math.log(1+i))}function y(n,t,i,r,u,f,e,o,s){return t=kt(i,r,u,n,e,o,s)-f,[!0,t]}function ct(n,t,i,r,u,f,e,o,s,h,c){var v,p,l,w=0,b=0,a;v=n-i,v<r.xmin&&(v=n),p=n+i,p>r.xmax&&(p=n);if(v===p)return[!1,t,r];a=y(v,w,u,f,e,o,s,h,c),w=a[1],l=a[0];if(!l)return[l,t,r];return a=y(p,b,u,f,e,o,s,h,c),b=a[1],l=a[0],l?(t=(b-w)/(p-v),[!0,t,r]):[l,t,r]}function te(n,t,i,u,f,e,o,s,h){for(var l,g=n.precision/2,p,d,v,a,c,w,b,k=0;k<20;k++){v=0,a=0;if(h<n.xmin||h>n.xmax)return[!1,n];c=y(h,v,t,i,u,f,e,o,s),v=c[1],l=c[0];if(!l)return[l,n];c=r(h,v,n),n=c[1];if(c[0])return[!0,n];w=Math.abs(h)<1e-10?n.havexneg&&n.havexpos?Math.abs(n.xpos-n.xneg)/1e6:(n.xmax-n.xmin)/1e6
:Math.abs(h)/1e6,b=ct(h,a,w,n,t,i,u,f,e,o,s),n=b[2],a=b[1],l=b[0];if(!l)return[l,n];if(a===0)return[!1,n];p=h-1.000001*v/a;if(p===h)return n.root=h,[!0,n];d=Math.abs(p-h)/(Math.abs(h)+Math.abs(p)),h=p;if(d<g)return n.root=h,[!0,n]}return[!1,n]}function gf(n,t,i,u,f,e,o,s,h){var l,a=0,c;if(h<n.xmin||h>n.xmax)return[!1,n];c=y(h,a,t,i,u,f,e,o,s),a=c[1],l=c[0];if(!l)return[l,n];return c=r(h,a,n),n=c[1],c[0]?[!0,n]:[!1,n]}function ft(n,t,i,u,f,e,o,s,h,c,l,a,v,p){var nt,tt,g,d;switch(p){case 0:l=n.xpos-n.ypos*((n.xneg-n.xpos)/(n.yneg-n.ypos));break;case 1:l=(n.xpos+n.xneg)/2,tt=y(l,a,t,i,u,f,e,o,s),a=tt[1],v=tt[0];if(!v)return[null,n,c,l,a,p];if(a===0)return n=r(l,a,n)[1],[!0,n,c,l,a,p];nt=Math.sqrt(a*a-n.ypos*n.yneg);if(nt===0)return[null,n,c,l,a,p];l+=(l-n.xpos)*a/nt;break;case 3:l=(n.xpos+n.xneg)/2;break;case 2:var w=0,b=0,it=0,k=0;if(h>.1)return p=3,ft(n,t,i,u,f,e,o,s,h,c,l,a,v,p);switch(c++%4){case 0:w=n.xpos,w=n.ypos;break;case 2:w=n.xneg,b=n.yneg;break;default:case 3:ca
se 1:w=(n.xpos+n.xneg)/2,g=y(w,b,t,i,u,f,e,o,s),b=g[1],v=g[0];if(!v)return[null,n,c,l,a,p];break}it=Math.abs(n.xpos-n.xneg)/1e6,d=ct(w,k,it,n,t,i,u,f,e,o,s),n=d[2],k=d[1],v=d[0];if(!v)return[null,n,c,l,a,p];if(k===0)return[null,n,c,l,a,p];l=w-1.01*b/k;if(l<n.xpos&&l<n.xneg||l>n.xpos&&l>n.xneg)return[null,n,c,l,a,p];break;default:break}return[!1,n,c,l,a,p]}function ne(n,t,i,u,f,e,o,s){var a,v,d=0,c,h,k,b,l,p,w;if(!n.havexpos||!n.havexneg)return[!1,n];for(v=Math.abs(n.xpos-n.xneg)/(Math.abs(n.xpos)+Math.abs(n.xneg)),a=0;a<108;a++){c=0,h=0,b=a%4==0?1:a%4==2?2:3,l=ft(n,t,i,u,f,e,o,s,v,d,c,h,k,b),n=l[1],d=l[2],c=l[3],h=l[4],b=l[5];if(l[0]){if(l[0])return[!0,n]}else continue;p=y(c,h,t,i,u,f,e,o,s),h=p[1],k=p[0];if(!k)continue;w=r(c,h,n),n=w[1];if(w[0])return[!0,n];v=Math.abs(n.xpos-n.xneg)/(Math.abs(n.xpos)+Math.abs(n.xneg));if(v<n.precision)return n.yneg<h&&(h=n.yneg,c=n.xneg),n.ypos<h&&(h=n.ypos,c=n.xpos),n.root=c,[!0,n]}return[!1,
n]}function vf(t){var h=n.Calc.Convert,rt=n.Calc._Helper,o=h.toDateTime(t[0]),e=h.toDateTime(t[1]),c=h.toDouble(t[2]),v=h.toDouble(t[3]),y=h.toDouble(t[4]),u=h.toInt(t[5]),f=rt._argumentExists(t,6)?h.toInt(t[6]):0,d,r,p,a,l;if(f<0||f>4||!(u===1||u===2||u===4)||i(o,e)>0)return n.Calc.Errors.Number;if(c<0||v<0||y<=0)return n.Calc.Errors.Number;d=w(o,e,u);if(d>1){r={},a=.1,r.xmin=0,r.xmax=0,r.precision=0,r.havexpos=!1,r.xpos=0,r.ypos=0,r.havexneg=!1,r.xneg=0,r.yneg=0,r.root=0,r=k(r),r.xmin=Math.max(r.xmin,0),r.xmax=Math.min(r.xmax,1e3),l=te(r,o,e,c,v,y,u,f,a),r=l[1],p=l[0];if(!p){for(a=1e-10;a<r.xmax;a*=2)r=gf(r,o,e,c,v,y,u,f,a)[1];l=ne(r,o,e,c,v,y,u,f),r=l[1],p=l[0]}return p?r.root:n.Calc.Errors.Number}else{var nt=tt(o,e,u,f),et=g(o,e,u,f),b=s(o,e,u,f),ut=u*b/et,it=y/100+c/u-(v/100+nt/b*c/u),ft=v/100+nt/b*c/u;return it/ft*ut}}function ff(r){var u=n.Calc.Convert,a=n.Calc._Helper,h=u.toDateTime(r[0]),c=u.toDateTime(r[1]),l=u.toDouble(r[2]),e=u.toDouble(r[3]),f=a.
_argumentExists(r,4)?u.toInt(r[4]):0,s,o;return f<0||f>4?n.Calc.Errors.Number:e<=0||l<=0||i(h,c)>=0?n.Calc.Errors.Number:(s=e/l-1,o=t.Functions._DateHelper.yearfrac([h,c,f]),s/o)}function ef(n,i,r,u,f,e){var s=t.Functions._DateHelper.yearfrac,l=s([r,i,e]),h=s([r,n,e]),c=s([n,i,e]),o=1+l*u;return o/=f/100+h*u,o--,o/=c}function uf(t){var i=n.Calc.Convert,s=n.Calc._Helper,o=i.toDateTime(t[0]),f=i.toDateTime(t[1]),h=i.toDateTime(t[2]),u=i.toDouble(t[3]),e=i.toDouble(t[4]),r=s._argumentExists(t,5)?i.toInt(t[5]):0;return r<0||r>4||u<0?n.Calc.Errors.Number:ef(o,f,h,u,e,r)}function a(n,t,i,r,u,f,e,o,s,h,c){return t=bt(i,r,u,f,e,n,s,h,c)-o,[!0,t]}function ot(n,t,i,r,u,f,e,o,s,h,c,l,v){var w,b,y,k=0,d=0,p;w=n-i,w<r.xmin&&(w=n),b=n+i,b>r.xmax&&(b=n);if(w===b)return[!1,t,r];p=a(w,k,u,f,e,o,s,h,c,l,v),k=p[1],y=p[0];if(!y)return[y,t,r];return p=a(b,d,u,f,e,o,s,h,c,l,v),d=p[1],y=p[0],y?(t=(d-k)/(b-w),[!0,t,r]):[y,t,r]}function tf(n,t,i,u,f,e,o,s,h,c,l)
{for(var y,tt=n.precision/2,b,nt,p,w,v,d,k,g=0;g<20;g++){p=0,w=0;if(l<n.xmin||l>n.xmax)return[!1,n];v=a(l,p,t,i,u,f,e,o,s,h,c),p=v[1],y=v[0];if(!y)return[y,n];v=r(l,p,n),n=v[1];if(v[0])return[!0,n];d=Math.abs(l)<1e-10?n.havexneg&&n.havexpos?Math.abs(n.xpos-n.xneg)/1e6:(n.xmax-n.xmin)/1e6:Math.abs(l)/1e6,k=ot(l,w,d,n,t,i,u,f,e,o,s,h,c),n=k[2],w=k[1],y=k[0];if(!y)return[y,n];if(w===0)return[!1,n];b=l-1.000001*p/w;if(b===l)return n.root=l,[!0,n];nt=Math.abs(b-l)/(Math.abs(l)+Math.abs(b)),l=b;if(nt<tt)return n.root=l,[!0,n]}return[!1,n]}function rf(n,t,i,u,f,e,o,s,h,c,l){var y,p=0,v;if(l<n.xmin||l>n.xmax)return[!1,n];v=a(l,p,t,i,u,f,e,o,s,h,c),p=v[1],y=v[0];if(!y)return[y,n];return v=r(l,p,n),n=v[1],v[0]?[!0,n]:[!1,n]}function et(n,t,i,u,f,e,o,s,h,c,l,v,y,p,w,b){var rt,it,tt,nt;switch(b){case 0:y=n.xpos-n.ypos*((n.xneg-n.xpos)/(n.yneg-n.ypos));break;case 1:y=(n.xpos+n.xneg)/2,it=a(y,p,t,i,u,f,e,o,s,h,c),p=it[1],w=it[0];if(!w)return[null,n,v,y,p,b];if(p===0)r
eturn n=r(y,p,n)[1],[!0,n,v,y,p,b];rt=Math.sqrt(p*p-n.ypos*n.yneg);if(rt===0)return[null,n,v,y,p,b];y+=(y-n.xpos)*p/rt;break;case 3:y=(n.xpos+n.xneg)/2;break;case 2:var k=0,g=0,ut=0,d=0;if(l>.1)return b=3,et(n,t,i,u,f,e,o,s,h,c,l,v,y,p,w,b);switch(v++%4){case 0:k=n.xpos,k=n.ypos;break;case 2:k=n.xneg,g=n.yneg;break;default:case 3:case 1:k=(n.xpos+n.xneg)/2,tt=a(k,g,t,i,u,f,e,o,s,h,c),g=tt[1],w=tt[0];if(!w)return[null,n,v,y,p,b];break}ut=Math.abs(n.xpos-n.xneg)/1e6,nt=ot(k,d,ut,n,t,i,u,f,e,o,s,h,c),n=nt[2],d=nt[1],w=nt[0];if(!w)return[null,n,v,y,p,b];if(d===0)return[null,n,v,y,p,b];y=k-1.01*g/d;if(y<n.xpos&&y<n.xneg||y>n.xpos&&y>n.xneg)return[null,n,v,y,p,b];break;default:break}return[!1,n,v,y,p,b]}function of(n,t,i,u,f,e,o,s,h,c){var p,w,nt=0,y,l,g,d,v,b,k;if(!n.havexpos||!n.havexneg)return[!1,n];for(w=Math.abs(n.xpos-n.xneg)/(Math.abs(n.xpos)+Math.abs(n.xneg)),p=0;p<108;p++){y=0,l=0,d=p%4==0?1:p%4==2?2:3,v=et(n,t,i,u,f,e,o,s,h,c,w,nt,y,l,g,d),n=v[1
],nt=v[2],y=v[3],l=v[4],d=v[5];if(v[0]===undefined||v[0]===null)continue;else if(v[0])return[!0,n];b=a(y,l,t,i,u,f,e,o,s,h,c),l=b[1],g=b[0];if(!g)continue;k=r(y,l,n),n=k[1];if(k[0])return[!0,n];w=Math.abs(n.xpos-n.xneg)/(Math.abs(n.xpos)+Math.abs(n.xneg));if(w<n.precision)return n.yneg<l&&(l=n.yneg,y=n.xneg),n.ypos<l&&(l=n.ypos,y=n.xpos),n.root=y,[!0,n]}return[!1,n]}function lf(t){var u=n.Calc.Convert,b=n.Calc._Helper,h=u.toDateTime(t[0]),v=u.toDateTime(t[1]),a=u.toDateTime(t[2]),c=u.toDateTime(t[3]),y=u.toDouble(t[4]),w=u.toDouble(t[5]),p=u.toDouble(t[6]),f=u.toInt(t[7]),s=b._argumentExists(t,8)?u.toInt(t[8]):0,o=.1,r={},e,l;if(s<0||s>4||!(f===1||f===2||f===4)||i(a,h)>0||i(h,c)>0||i(c,v)>0)return n.Calc.Errors.Number;if(y<0||w<=0||p<=0)return n.Calc.Errors.Number;r.xmin=0,r.xmax=0,r.precision=0,r.havexpos=!1,r.xpos=0,r.ypos=0,r.havexneg=!1,r.xneg=0,r.yneg=0,r.root=0,r=k(r),r.xmin=Math.max(r.xmin,0),r.xmax=Math.min(r.xmax,1e3),e=tf(r,
h,v,a,c,y,w,p,f,s,o),r=e[1],l=e[0];if(l){for(o=1e-10;o<r.xmax;o*=2)r=rf(r,h,v,a,c,y,w,p,f,s,o)[1];e=of(r,h,v,a,c,y,w,p,f,s),r=e[1],l=e[0]}return l?r.root:n.Calc.Errors.Number}function af(n,t,r,u,f,o,s,h){var c=new Date(r.getFullYear(),r.getMonth(),r.getDate()),a,v,l;do c.setMonth(c.getMonth()+12/s);while(i(c,t)<0);return a=e(r,n,c,s,h),v=e(r,t,c,s,h),l=e(n,t,c,s,h),(s*(o-f)+100*u*(v-a))/(l*f+100*u*a*l/s)}function cf(t){var r=n.Calc.Convert,a=n.Calc._Helper,e=r.toDateTime(t[0]),c=r.toDateTime(t[1]),s=r.toDateTime(t[2]),l=r.toDouble(t[3]),h=r.toDouble(t[4]),o=r.toDouble(t[5]),u=r.toInt(t[6]),f=a._argumentExists(t,7)?r.toInt(t[7]):0;return f<0||f>4||!(u===1||u===2||u===4)||i(e,c)>0||i(s,e)>0?n.Calc.Errors.Number:l<0||h<0||o<=0?n.Calc.Errors.Number:af(e,c,s,l,h,o,u,f)}function sf(t){var f=n.Calc.Convert,c=f.toDateTime(t[0]),s=f.toDateTime(t[1]),o=f.toDouble(t[2]),e,h,r;if(i(c,s)>=0)return n.Calc.Errors.Number;if(o<=0)return n.Calc.Errors.Number;e=u(s)-u(
c);if(e>365)return n.Calc.Errors.Number;h=365*o,r=360-o*e;if(r===0)return n.Calc.Errors.DivideByZero;else if(r<0)return n.Calc.Errors.Number;return f.toResult(h/r)}function hf(t){var e=n.Calc.Convert,o=e.toDateTime(t[0]),s=e.toDateTime(t[1]),r=e.toDouble(t[2]),f;if(i(o,s)>=0)return n.Calc.Errors.Number;if(r<=0)return n.Calc.Errors.Number;return f=u(s)-u(o),f>365?n.Calc.Errors.Number:(100-r)/r*(360/f)}function v(n,t,i){for(var e=i.length,f=0,u=1,o=1/(n+1),r=0;r<e;r++)f+=i[r]*u,u*=o;return t=f,[!0,t]}function dr(n,t,i){for(var e=i.length,f=0,u=1,o=1/(n+1),r=1;r<e;r++)f+=i[r]*-r*u,u*=o;return t=f,[!0,t]}function hi(n,t,i){for(var l=n.precision/2,s,c,f,e,o,u,h=0;h<20;h++){e=0,o=0;if(i<n.xmin||i>n.xmax)return[!1,n];u=v(i,e,t),e=u[1],f=u[0];if(!f)return[f,n];u=r(i,e,n),n=u[1];if(u[0])return[!0,n];u=dr(i,o,t),o=u[1],f=u[0];if(!f)return[f,n];if(o===0)return[!1,n];s=i-1.000001*e/o;if(s===i)return n.root=i,[!0,n];c=Math.abs(s-i)/(Math.abs(i)+Math.abs(s)),i=s;if(c
<l)return n.root=i,[!0,n]}return[!1,n]}function vt(n,t,i){var f,e=0,u;if(i<n.xmin||i>n.xmax)return[!1,n];u=v(i,e,t),e=u[1],f=u[0];if(!f)return[f,n];return u=r(i,e,n),n=u[1],u[0]?[!0,n]:[!1,n]}function oi(n,t,i,r,u){var o,s,f,h=0,c=0,e;o=n-i,o<r.xmin&&(o=n),s=n+i,s>r.xmax&&(s=n);if(o===s)return[!1,t,r];e=v(o,h,u),h=e[1],f=e[0];if(!f)return[f,t,r];return e=v(s,c,u),c=e[1],f=e[0],f?(t=(c-h)/(s-o),[!0,t,r]):[f,t,r]}function wt(n,t,i,u,f,e,o,s){var w,p,h,b,l,c,y,a;switch(s){case 0:f=n.xpos-n.ypos*((n.xneg-n.xpos)/(n.yneg-n.ypos));break;case 1:f=(n.xpos+n.xneg)/2,p=v(f,e,t),e=p[1],o=p[0];if(!o)return[null,n,u,f,e,s];if(e===0)return n=r(f,e,n)[1],[!0,n,u,f,e,s];w=Math.sqrt(e*e-n.ypos*n.yneg);if(w===0)return[null,n,u,f,e,s];f+=(f-n.xpos)*e/w;break;case 3:f=(n.xpos+n.xneg)/2;break;case 2:l=0,c=0;if(i>.1)return s=3,wt(n,t,i,u,f,e,o,s);switch(u++%4){case 0:h=n.xpos,h=n.ypos;break;case 2:h=n.xneg,l=n.yneg;break;default:case 3:case 1:h=(n.xpos+n.xneg)/2,y=v(h,l,
t),l=y[1],o=y[0];if(!o)return[null,n,u,f,e,s];break}b=Math.abs(n.xpos-n.xneg)/1e6,a=oi(h,c,b,n,t),n=a[2],c=a[1],o=a[0];if(!o)return[null,n,u,f,e,s];if(c===0)return[null,n,u,f,e,s];f=h-1.01*l/c;if(f<n.xpos&&f<n.xneg||f>n.xpos&&f>n.xneg)return[null,n,u,f,e,s];break;default:return[!1,n,u,f,e,s]}return[!1,n,u,f,e,s]}function fi(n,t){var o,h,l=0,f,i,c,s,u,e;if(!n.havexpos||!n.havexneg)return[!1,n];for(h=Math.abs(n.xpos-n.xneg)/(Math.abs(n.xpos)+Math.abs(n.xneg)),o=0;o<160;o++){i=0,s=0,s=o%4==0?1:o%4==2?2:3,u=wt(n,t,h,l,f,i,c,s),n=u[1],l=u[2],f=u[3],i=u[4],s=u[5];if(u[0]===null)continue;else if(u[0])return[!0,n];e=v(f,i,t),i=e[1],c=e[0];if(!c)continue;e=r(f,i,n),n=e[1];if(e[0])return[!0,n];h=Math.abs(n.xpos-n.xneg)/(Math.abs(n.xpos)+Math.abs(n.xneg));if(h<n.precision)return n.yneg<i&&(i=n.yneg,f=n.xneg),n.ypos<i&&(i=n.ypos,f=n.xpos),n.root=f,[!0,n]}return[!1,n]}function ei(t){var i={},l,b,r,p,w,o,e,h,u,a,f;i.xmin=0,i.xmax=0,i.precisi
on=0,i.havexpos=!1,i.xpos=0,i.ypos=0,i.havexneg=!1,i.xneg=0,i.yneg=0,i.root=0,i=k(i);var v=t[0],c=n.Calc.Convert,d=n.Calc._Helper,y=n.Calc._ArrayHelper,s=d._argumentExists(t,1)?c.toDouble(t[1]):.1;Math.abs(s)>1&&(s=.1),l=y.getLength(v);if(!y.isArrayOrReference(v)||l<2)return n.Calc.Errors.Number;for(b=179769e303,r=[],i.xmin=-1,i.xmax=Math.min(i.xmax,Math.pow(b/1e10,1/l)-1),p=!1,w=!1,o=0;o<l;o++){e=y.getValueByIndex(v,o);if(c.isNumber(e))h=c.toDouble(e),r[o]=h,h>0&&(p=!0),h<0&&(w=!0);else if(c.isError(e))return e}if(!p||!w)return n.Calc.Errors.Number;u=hi(i,r,s),i=u[1],a=u[0];if(!a){for(f=2;!(i.havexneg&&i.havexpos)&&f<100;f*=2)i=vt(i,r,s*f)[1],i=vt(i,r,s/f)[1];u=fi(i,r),i=u[1],a=u[0]}return a?i.root:n.Calc.Errors.Number}function vi(t){var f=n.Calc.Convert,h=n.Calc._ArrayHelper,k=f.toDouble(t[1]),o=f.toDouble(t[2]),v=0,y=0,e=0,a=0,l=0,d=h.getLength(t[0]),w=[],b,r,u,c,i,s,p;if(!h.isArrayOrReference(t[0]))return n.Calc.Errors.Di
videByZero;for(b=h.getLength(t[0]),r=0;r<b;r++){u=h.getValueByIndex(t[0],r);if(f.isNumber(u))c=f.toDouble(u),w[r]=c,c<0?y++:v++;else if(f.isError(u))return u}for(e=y+v,i=0;i<e;i++)s=w[i],s<0?l+=s/Math.pow(1+k,i):a+=s/Math.pow(1+o,i);return l===0||a===0||o<=-1?n.Calc.Errors.DivideByZero:p=Math.pow(-a*Math.pow(1+o,e)/(l*(1+o)),1/(e-1))-1}function c(n,i,r,f){for(var e=0,h=f.length,s,o=0;o<h;o++){s=u(r[o])-u(r[0]);if(s<0)return[!1,i];e+=f[o]/t.Functions._MathHelper.pow1p(n,s/365)}return isFinite(e)?i=isNaN(e)?494065645841247e-338:e:e===Number.POSITIVE_INFINITY?i=179769e303:e===Number.NEGATIVE_INFINITY&&(i=-179769e303),[!0,i]}function ht(n,t,i,r,u,f){var s,h,e,l=0,a=0,o;s=n-i,s<r.xmin&&(s=n),h=n+i,h>r.xmax&&(h=n);if(s===h)return[!1,t,r];o=c(s,l,u,f),l=o[1],e=o[0];if(!e)return[e,t,r];return o=c(h,a,u,f),a=o[1],e=o[0],e?(t=(a-l)/(h-s),[!0,t,r]):[e,t,r]}function ci(n,t,i,u){for(var f,p=n.precision/2,h,a,v=0;v<20;v++){var o,y,l=0,s=0,e=c(
u,l,t,i);l=e[1],f=e[0];if(!f)return[f,n];e=r(u,l,n),n=e[1];if(e[0])return[!0,n];h=Math.abs(u)<1e-10?n.havexneg&&n.havexpos?Math.abs(n.xpos-n.xneg)/1e6:(n.xmax-n.xmin)/1e6:Math.abs(u)/1e6,a=ht(u,s,h,n,t,i),f=a[0],s=a[1],n=a[2];if(!f)return[f,n];if(s===0)return[!1,n];o=u-1.000001*l/s;if(o===u)return n.root=u,[!0,n];y=Math.abs(o-u)/(Math.abs(u)+Math.abs(o)),u=o;if(y<p)return n.root=u,[!0,n]}return[!1,n]}function rt(n,t,i,u,f){var o,s=0,e;if(t<n.xmin||t>n.xmax)return[!1,n,i];e=c(t,i,u,f),i=e[1],o=e[0];if(!o)return[o,n,i];return e=r(t,s,n),n=e[1],e[0]?[!0,n,i]:[!1,n,i]}function it(n,t,i,u,f,e,o,s,h){var w,b,p,v;switch(h){case 0:e=n.xpos-n.ypos*((n.xneg-n.xpos)/(n.yneg-n.ypos));break;case 1:e=(n.xpos+n.xneg)/2,b=c(e,o,t,i),o=b[1],s=b[0];if(!s)return[null,n,f,e,o,h];if(o===0)return n=r(e,o,n)[1],[!0,n,f,e,o,h];w=Math.sqrt(o*o-n.ypos*n.yneg);if(w===0)return[null,n,f,e,o,h];e+=(e-n.xpos)*o/w;break;case 3:e=(n.xpos+n.xneg)/2;break;case 2:var l=0,y=0,k=0,a=0;if(u>.1)retu
rn h=3,it(n,t,i,u,f,e,o,s,h);switch(f++%4){case 0:l=n.xpos,l=n.ypos;break;case 2:l=n.xneg,y=n.yneg;break;default:case 3:case 1:l=(n.xpos+n.xneg)/2,p=c(l,y,t,i),y=p[1],s=p[0];if(!s)return[null,n,f,e,o,h];break}k=Math.abs(n.xpos-n.xneg)/1e6,v=ht(l,a,k,n,t,i),n=v[2],a=v[1],s=v[0];if(!s)return[null,n,f,e,o,h];if(a===0)return[null,n,f,e,o,h];e=l-1.01*y/a;if(e<n.xpos&&e<n.xneg||e>n.xpos&&e>n.xneg)return[null,n,f,e,o,h];break;default:break}return[!1,n,f,e,o,h]}function li(n,t,i){var s,h,v=0,f,u,a,l,e,o;if(!n.havexpos||!n.havexneg)return[!1,n];for(h=Math.abs(n.xpos-n.xneg)/(Math.abs(n.xpos)+Math.abs(n.xneg)),s=0;s<108;s++){f=0,u=0,l=s%4==0?1:s%4==2?2:3,e=it(n,t,i,h,v,f,u,a,l),n=e[1],v=e[2],f=e[3],u=e[4],l=e[5];if(e[0]){if(e[0])return[!0,n]}else continue;o=c(f,u,t,i),u=o[1],a=o[0];if(!a)continue;o=r(f,u,n),n=o[1];if(o[0])return[!0,n];h=Math.abs(n.xpos-n.xneg)/(Math.abs(n.xpos)+Math.abs(n.xneg));if(h<n.precision)return n.yneg<u&&(u=n.yneg,f=n.xneg)
,n.ypos<u&&(u=n.ypos,f=n.xpos),n.root=f,[!0,n]}return[!1,n]}function ui(t){var v=n.Calc._ArrayHelper.getLength(t[0]),a=n.Calc._ArrayHelper.getLength(t[1]),o=[],s=[],c=n.Calc._Helper._argumentExists(t,2)?n.Calc.Convert.toDouble(t[2]):.1,r,i,l,f,y,h;if(v!==a)return n.Calc.Errors.Number;for(r=0;r<v;r++)o[r]=n.Calc.Convert.toDouble(n.Calc._ArrayHelper.getValueByIndex(t[0],r));for(r=0;r<a;r++)s[r]=n.Calc.Convert.toDateTime(n.Calc._ArrayHelper.getValueByIndex(t[1],r));i={},i.xmin=0,i.xmax=0,i.precision=0,i.havexpos=!1,i.xpos=0,i.ypos=0,i.havexneg=!1,i.xneg=0,i.yneg=0,i.root=0,i=k(i),i.xmin=-1,i.xmax=Math.min(1e3,i.xmax),l=ci(i,s,o,c),i=l[1];if(l[0])return i.root;else{for(f=1;f<=1024;f+=f){var p=n.Calc.Convert.toDouble(f),u=9/(p+9),e=rt(i,c,u,s,o);i=e[1],u=e[2],u=p,e=rt(i,c,u,s,o),i=e[1],u=e[2],h=li(i,s,o),i=h[1],y=h[0];if(y)return i.root}return n.Calc.Errors.Number}}function ii(i,r,u,f,e,o,s){var a,c,h,y,l,v,p;l=1/o,c=l<3?1:l<5?1.5:l>6?2.5:2,o*=c,v=t.Functions
._DateHelper.yearfrac([r,u,s]);if(n.Calc.Convert.isError(v))return 0;for(p=v,h=Math.floor(p*o*i+.5),i-=h,y=i-f,a=0;a<e;a++){h=Math.floor(o*i+.5),y-=h;if(y<0)switch(e-a){case 0:case 1:return Math.floor(i*.5+.5);default:return 0}i-=h}return h}function ri(t){var h=n.Calc.Convert.toDouble(t[0]),e=n.Calc.Convert.toDateTime(t[1]),o=n.Calc.Convert.toDateTime(t[2]),s=n.Calc.Convert.toDouble(t[3]),c=n.Calc.Convert.toInt(t[4]),f=n.Calc.Convert.toDouble(t[5]),u=n.Calc._Helper._argumentExists(t,6)?n.Calc.Convert.toInt(t[6]):0,r=1/f;return r>0&&r<1||r>1&&r<2||r>2&&r<3||r>4&&r<5?n.Calc.Errors.Number:i(e,o)>0?n.Calc.Errors.Number:u<0||u>4||f<=0||u===2?n.Calc.Errors.Number:ii(h,e,o,s,c,f,u)}function ti(i,r,u,f,e,o,s){var c=i*o,p=i-f,y=t.Functions._DateHelper.yearfrac([r,u,s]);if(n.Calc.Convert.isError(y))return 0;var w=y,l=w*o*i,v=(i-f-l)/c,a=n.Calc.Convert.toInt((i-f-l)/c),h;return h=e===0?l:e>a?e===a+1?p-c*a-l:0:c*(v<
1?v:1)}function ni(t){var s=n.Calc.Convert.toDouble(t[0]),e=n.Calc.Convert.toDateTime(t[1]),u=n.Calc.Convert.toDateTime(t[2]),o=n.Calc.Convert.toDouble(t[3]),h=n.Calc.Convert.toInt(t[4]),f=n.Calc.Convert.toDouble(t[5]),r=n.Calc._Helper._argumentExists(t,6)?n.Calc.Convert.toInt(t[6]):0;return i(e,u)>0?n.Calc.Errors.Number:r<0||r>4||f<=0||r===2?n.Calc.Errors.Number:ti(s,e,u,o,h,f,r)}function cr(i){var r=n.Calc.Convert.toDouble(i[0]),l=n.Calc.Convert.toDouble(i[1]),o=n.Calc.Convert.toInt(i[2]),c=n.Calc.Convert.toInt(i[3]),u=n.Calc._Helper._argumentExists(i,4)?n.Calc.Convert.toInt(i[4]):12,a=o+(u<12?1:0),e;if(r<0||o<1||c<1||a<c||u<1||12<u)return n.Calc.Errors.Number;if(r===0)return 0;var h=t.Functions._MathHelper.round(1-Math.pow(l/r,1/o),3),s=0,f=0;for(e=1;e<=c;e++)f=e===1?r*h*u/12:e===o+1?(r-s)*h*(12-u)/12:(r-s)*h,s+=f;return f}function lr(t){var r=n.Calc.Convert.toDouble(t[0]),s=n.Calc.Convert.toDouble(t[1]),e=n.Calc.Convert.toInt(t[2]),o=n.Calc.Co
nvert.toInt(t[3]),h=n.Calc._Helper._argumentExists(t,4)?n.Calc.Convert.toDouble(t[4]):2,u=0,i=0,f;if(e<=0||r<0)return n.Calc.Errors.Number;if(e<o)return n.Calc.Errors.Number;if(h<=0)return n.Calc.Errors.Number;if(o<=0)return n.Calc.Errors.Number;if(r<=s)return 0;for(f=1;f<=o;f++)i=(r-u)*(h/e),i=Math.min(i,r-u-s),u+=i;return i}function ar(t){var r=n.Calc.Convert.toDouble(t[0]),u=n.Calc.Convert.toDouble(t[1]),i=n.Calc.Convert.toInt(t[2]);return i===0?n.Calc.Errors.DivideByZero:(r-u)/i}function or(t){var f=n.Calc.Convert.toDouble(t[0]),u=n.Calc.Convert.toDouble(t[1]),i=n.Calc.Convert.toInt(t[2]),r=n.Calc.Convert.toInt(t[3]);return u<0||i<1||r<=0||r>i?n.Calc.Errors.Number:(f-u)*(i-r+1)*2/(i*(i+1))}function dt(n,t,i,r,u){var o,e,f,s;return e=u/i,e<1?f=n*Math.pow(1-e,r-1):(e=1,f=r===1?n:0),s=n*Math.pow(1-e,r),o=s<t?f-t:f-s,o<0&&(o=0),o}function ut(t,i,r,u,f,e){for(var y=0,a=Math.ceil(f),v=n.Calc.Convert.toInt(a),s,p=t-i,l=!1,c,h=0,o=1;o<
;=v;o++)l?s=h:(c=dt(t,i,r,o,e),h=p/(u-(o-1)),h>c?(s=h,l=!0):(s=c,p-=c)),o===v&&(s*=f+1-a),y+=s;return y}function sr(t,i,r,u,f,e,o){var c,p=Math.floor(u),y=Math.ceil(f),s,w=n.Calc.Convert.toInt(p),v=n.Calc.Convert.toInt(y),h,l,a;c=0;if(o)for(s=w+1;s<=v;s++)h=dt(t,i,r,s,e),s===w+1?h*=Math.min(f,p+1)-u:s===v&&(h*=f+1-y),c+=h;else l=r,u!==Math.floor(u)&&e>1&&(u<r/2||(a=u-r/2,u=r/2,f-=a,l+=1)),t-=ut(t,i,r,l,u,e),c=ut(t,i,r,r-u,f-u,e);return c}function hr(t){var u=n.Calc.Convert.toDouble(t[0]),f=n.Calc.Convert.toDouble(t[1]),e=n.Calc.Convert.toInt(t[2]),r=n.Calc.Convert.toDouble(t[3]),i=n.Calc.Convert.toDouble(t[4]),s=n.Calc._Helper._argumentExists(t,5)?n.Calc.Convert.toDouble(t[5]):2,o=n.Calc._Helper._argumentExists(t,6)?n.Calc.Convert.toBool(t[6]):!1;return u<0||f<0||e<0||r<0||i<0||i<r?n.Calc.Errors.Number:u<f&&r===0&&i===1?u-f:sr(u,f,e,r,i,s,o)}function wr(t){var e=n.Calc.Convert.toDateTime(t[0]),y=n.Calc.
Convert.toDateTime(t[1]),l=n.Calc.Convert.toDateTime(t[2]),v=n.Calc.Convert.toDouble(t[3]),a=n.Calc._Helper._argumentExists(t,4)?n.Calc.Convert.toDouble(t[4]):1e3,r=n.Calc.Convert.toInt(t[5]),u=n.Calc._Helper._argumentExists(t,6)?n.Calc.Convert.toInt(t[6]):0,w=n.Calc._Helper._argumentExists(t,7)?n.Calc.Convert.toBool(t[7]):!0,f,s,h,c;if(v<=0||a<=0)return n.Calc.Errors.Number;if(u<0||4<u)return n.Calc.Errors.Number;if(!(r===1||r===2||r===4))return n.Calc.Errors.Number;if(i(e,l)>=0)return n.Calc.Errors.Number;return f=o(e,l,u),s=p(e,u),f<0||s<=0?n.Calc.Errors.Number:(h=a*v/n.Calc.Convert.toDouble(r),c=f/s,h*n.Calc.Convert.toDouble(r)*c)}function br(t){var e=n.Calc.Convert.toDateTime(t[0]),c=n.Calc.Convert.toDateTime(t[1]),s=n.Calc.Convert.toDouble(t[2]),h=n.Calc._Helper._argumentExists(t,3)?n.Calc.Convert.toDouble(t[3]):1e3,r=n.Calc._Helper._argumentExists(t,4)?n.Calc.Convert.toInt(t[4]):0,u,f;if(s<=0||h<=0||r<0||4<r)return n.Calc.Errors.Number;if(i(e,
c)>0)return n.Calc.Errors.Number;return u=o(e,c,r),f=p(e,r),u<0||f<=0?n.Calc.Errors.Number:h*s*u/f}function kr(t){var e=n.Calc.Convert.toDateTime(t[0]),c=n.Calc.Convert.toDateTime(t[1]),h=n.Calc.Convert.toDouble(t[2]),u=n.Calc.Convert.toDouble(t[3]),r=n.Calc._Helper._argumentExists(t,4)?n.Calc.Convert.toInt(t[4]):0,f,s;if(i(e,c)>=0)return n.Calc.Errors.Number;if(h<=0||u<=0||r<0||4<r)return n.Calc.Errors.Number;return s=p(e,r),f=o(e,c,r),f<=0||s<=0?n.Calc.Errors.Number:(u-h)/u*(s/f)}function vr(t){var r=n.Calc.Convert.toDouble(t[0]),i=n.Calc.Convert.toInt(t[1]);return r<=0||i<1?n.Calc.Errors.Number:Math.pow(1+r/i,i)-1}function yr(t){var e=n.Calc.Convert.toDateTime(t[0]),c=n.Calc.Convert.toDateTime(t[1]),s=n.Calc.Convert.toDouble(t[2]),h=n.Calc.Convert.toDouble(t[3]),r=n.Calc._Helper._argumentExists(t,4)?n.Calc.Convert.toInt(t[4]):0,f,u;if(i(e,c)>=0)return n.Calc.Errors.Number;if(s<=0||h<=0||r<0||4<r)return n.Calc.Errors.Number;return
f=o(e,c,r),u=p(e,r),f<=0||u<=0?n.Calc.Errors.Number:(h-s)/s*(u/f)}function pr(t){var r=n.Calc.Convert.toDouble(t[0]),i=n.Calc.Convert.toInt(t[1]);return r<=0||i<1?n.Calc.Errors.Number:i*(Math.pow(1+r,1/i)-1)}function l(n,t,i){if(n>-1&&n!==0){var r=i,f=Math.pow(1+n,r.nper),u=(Math.pow(1+n,r.nper)-1)/n;return t=r.pv*f+r.pmt*(1+n*r.type)*u+r.fv,[!0,t,i]}else return[!1,t,i]}function si(n,t,i){if(n>-1&&n!==0){var r=i,f=Math.pow(1+n,r.nper-1),u=(Math.pow(1+n,r.nper)-1)/n;return t=-r.pmt*u/n+f*r.nper*(r.pv+r.pmt*(r.type+1/n)),[!0,t,i]}else return[!1,t,i]}function ki(n,t,i){for(var v=n.precision/2,s,a,f,o,e,u,c,h=0;h<100;h++){o=0,e=0;if(i<n.xmin||i>n.xmax)return[!1,n,t];u=l(i,o,t),t=u[2],o=u[1],f=u[0];if(!f)return[f,n,t];c=r(i,o,n),n=c[1];if(c[0])return[!0,n,t];u=si(i,e,t),t=u[2],e=u[1],f=u[0];if(!f)return[f,n,t];if(e===0)return[!1,n,t];s=i-1.000001*o/e;if(s===i)return n.root=i,[!0,n,t];a=Math.abs(s-i)/(Math.abs(i)+Math.abs(s)),i=s;if(a<v)retur
n n.root=i,[!0,n,t]}return[!1,n,t]}function st(n,t,i){var e,o=0,u,f;if(i<n.xmin||i>n.xmax)return[!1,n,t];u=l(i,o,t),t=u[2],o=u[1],e=u[0];if(!e)return[e,n,t];return f=r(i,o,n),n=f[1],f[0]?[!0,n,t]:[!1,n,t]}function di(n,t,i,r,u){var e,s,o,h=0,c=0,f;e=n-i,e<r.xmin&&(e=n),s=n+i,s>r.xmax&&(s=n);if(e===s)return[!1,t,r,u];f=l(e,h,u),u=f[2],h=f[1],o=f[0];if(!o)return[o,t,r,u];return f=l(s,c,u),u=f[2],c=f[1],o=f[0],o?(t=(c-h)/(s-e),[!0,t,r,u]):[o,t,r,u]}function lt(n,t,i,u,f,e,o,s){var p,h,c,w,a,v,y;switch(s){case 0:f=n.xpos-n.ypos*((n.xneg-n.xpos)/(n.yneg-n.ypos));break;case 1:f=(n.xpos+n.xneg)/2,h=l(f,e,t),t=h[2],e=h[1],o=h[0];if(!o)return[null,n,t,u,f,e,s];if(e===0)return n=r(f,e,n)[1],[!0,n,t,u,f,e,s];p=Math.sqrt(e*e-n.ypos*n.yneg);if(p===0)return[null,n,t,u,f,e,s];f+=(f-n.xpos)*e/p;break;case 3:f=(n.xpos+n.xneg)/2;break;case 2:a=0,v=0;if(i>.1)return s=3,lt(n,t,i,u,f,e,o,s);switch(u++%4){case 0:c=n.xpos,c=n.ypos;break;case 2:c=n.xneg,a=n.yneg;break;default
:case 3:case 1:c=(n.xpos+n.xneg)/2,h=l(c,a,t),t=h[2],a=h[1],o=h[0];if(!o)return[null,n,t,u,f,e,s];break}w=Math.abs(n.xpos-n.xneg)/1e6,y=di(c,v,w,n,t),t=y[3],n=y[2],v=y[1],o=y[0];if(!o)return[null,n,t,u,f,e,s];if(v===0)return[null,n,t,u,f,e,s];f=c-1.01*a/v;if(f<n.xpos&&f<n.xneg||f>n.xpos&&f>n.xneg)return[null,n,t,u,f,e,s];break;default:return[!1,n,t,u,f,e,s]}return[!1,n,t,u,f,e,s]}function gi(n,t){var e,h,v=0,f,i,c,o,u,s,a;if(!n.havexpos||!n.havexneg)return[!1,n,t];for(h=Math.abs(n.xpos-n.xneg)/(Math.abs(n.xpos)+Math.abs(n.xneg)),e=0;e<160;e++){i=0,o=0,o=e%4==0?1:e%4==2?2:3,u=lt(n,t,h,v,f,i,c,o),n=u[1],t=u[2],v=u[3],f=u[4],i=u[5],o=u[6];if(u[0]){if(u[0])return[!0,n,t]}else continue;s=l(f,i,t),t=s[2],i=s[1],c=s[0];if(!c)continue;a=r(f,i,n),n=a[1];if(a[0])return[!0,n,t];h=Math.abs(n.xpos-n.xneg)/(Math.abs(n.xpos)+Math.abs(n.xneg));if(h<n.precision)return n.yneg<i&&(i=n.yneg,f=n.xneg),n.ypos<i&&(i=n.ypos,f=n.xpos),n.root=f,[!0,n,t]
}return[!1,n,t]}function pi(t){var i={},s=n.Calc.Convert.toDouble(t[0]),a=n.Calc.Convert.toDouble(t[1]),l=n.Calc.Convert.toDouble(t[2]),c=n.Calc._Helper._argumentExists(t,3)?n.Calc.Convert.toDouble(t[3]):0,o=n.Calc._Helper._argumentExists(t,4)?n.Calc.Convert.toInt(t[4]):0,h=n.Calc._Helper._argumentExists(t,5)?n.Calc.Convert.toDouble(t[5]):.1,r,u,e,f;if(s<=0)return n.Calc.Errors.Number;if(o<0)return n.Calc.Errors.Value;o>1&&(o=1),i.xmin=0,i.xmax=0,i.precision=0,i.havexpos=!1,i.xpos=0,i.ypos=0,i.havexneg=!1,i.xneg=0,i.yneg=0,i.root=0,i=k(i),i.xmin=Math.max(i.xmin,-Math.pow(17976931348623157e292/1e10,1/s)+1),i.xmax=Math.min(i.xmax,Math.pow(17976931348623157e292/1e10,1/s)-1),r={},r.nper=s,r.pmt=a,r.pv=l,r.fv=c,r.type=n.Calc.Convert.toInt(o),u=ki(i,r,h),r=u[2],i=u[1],e=u[0];if(!e){for(f=2;!(i.havexneg&&i.havexpos)&&f<100;f*=2)u=st(i,r,h*f),r=u[2],i=u[1],u=st(i,r,h/f),r=u[2],i=u[1];u=gi(i,r),r=u[2],i=u[1],e=u[0]}return e?i.root:n.Calc.Errors.Number}func
tion wi(i){var u=n.Calc.Convert.toDouble(i[0]),r=n.Calc.Convert.toInt(i[1]);if(r===0)return n.Calc.Errors.DivideByZero;if(r<0)return n.Calc.Errors.Number;var f=u<0?Math.ceil(u):Math.floor(u),o=u-f,e=Math.pow(10,Math.ceil(t.Functions._MathHelper.log10(r)));return n.Calc.Convert.toResult(f+o*e/r)}function ur(i){var u=n.Calc.Convert.toDouble(i[0]),r=n.Calc.Convert.toInt(i[1]);if(r===0)return n.Calc.Errors.DivideByZero;if(r<0)return n.Calc.Errors.Number;var f=u<0?Math.ceil(u):Math.floor(u),o=u-f,e=Math.pow(10,Math.ceil(t.Functions._MathHelper.log10(r)));return n.Calc.Convert.toResult(f+o*r/e)}function fr(t){var f=n.Calc.Convert.toDateTime(t[0]),s=n.Calc.Convert.toDateTime(t[1]),e=n.Calc.Convert.toDouble(t[2]),h=n.Calc.Convert.toDouble(t[3]),o=n.Calc.Convert.toDouble(t[4]),r=n.Calc.Convert.toInt(t[5]),u=n.Calc._Helper._argumentExists(t,6)?n.Calc.Convert.toInt(t[6]):0;return h<0||e<0||o===0?n.Calc.Errors.Number:u<0||u>4?n.Calc.Errors.Number:r!==1&&r!==2&
;&r!==4?n.Calc.Errors.Number:i(f,s)>0?n.Calc.Errors.Number:kt(f,s,e,h,o,r,u)}function tr(t){var e=n.Calc.Convert.toDateTime(t[0]),c=n.Calc.Convert.toDateTime(t[1]),h=n.Calc.Convert.toDouble(t[2]),u=n.Calc.Convert.toDouble(t[3]),r=n.Calc._Helper._argumentExists(t,4)?n.Calc.Convert.toInt(t[4]):0,f,s;if(i(e,c)>=0)return n.Calc.Errors.Number;if(h<=0||u<=0||r<0||4<r)return n.Calc.Errors.Number;return f=o(e,c,r),s=p(e,r),f<=0||s<=0?n.Calc.Errors.Number:u-h*u*f/s}function ir(t){var f=n.Calc.Convert.toDateTime(t[0]),c=n.Calc.Convert.toDateTime(t[1]),y=n.Calc.Convert.toDateTime(t[2]),l=n.Calc.Convert.toDouble(t[3]),v=n.Calc.Convert.toDouble(t[4]),r=n.Calc._Helper._argumentExists(t,5)?n.Calc.Convert.toInt(t[5]):0,s,u,e,h,a;if(i(f,c)>=0)return n.Calc.Errors.Number;if(l<0||v<0||r<0||4<r)return n.Calc.Errors.Number;e=o(f,c,r),h=o(y,c,r),s=o(y,f,r),u=p(f,r);if(s<=0||u<=0||e<=0||h<=0)return n.Calc.Errors.Number;return a=1+e/u*v,a===0?n.Calc.Er
rors.Number:(100+h/u*l*100)/a-s/u*l*100}function nr(t){var e=n.Calc.Convert.toDateTime(t[0]),o=n.Calc.Convert.toDateTime(t[1]),s=n.Calc.Convert.toDateTime(t[2]),u=n.Calc.Convert.toDateTime(t[3]),c=n.Calc.Convert.toDouble(t[4]),l=n.Calc.Convert.toDouble(t[5]),h=n.Calc.Convert.toDouble(t[6]),r=n.Calc.Convert.toInt(t[7]),f=n.Calc._Helper._argumentExists(t,8)?n.Calc.Convert.toInt(t[8]):0;return f<0||f>4||!(r===1||r===2||r===4)||i(s,e)>0||i(e,u)>0||i(u,o)>0?n.Calc.Errors.Number:c<0||l<0||h<=0?n.Calc.Errors.Number:bt(e,o,s,u,c,l,h,r,f)}function rr(n,t,r,u,f,o,s,h){var c=new Date(r.getFullYear(),r.getMonth(),r.getDate()),a,v,l;do c.setMonth(c.getMonth()+12/s);while(i(c,t)<0);return a=e(r,n,c,s,h),v=e(r,t,c,s,h),l=e(n,t,c,s,h),(o*s+100*u*(v-a*(1+f*l/s)))/(f*l+s)}function bi(t){var f=n.Calc.Convert.toDateTime(t[0]),h=n.Calc.Convert.toDateTime(t[1]),s=n.Calc.Convert.toDateTime(t[2]),o=n.Calc.Convert.toDouble(t[3]),c=n.Calc.Convert.toDouble(t[4]),e=n.Calc.Convert.toD
ouble(t[5]),r=n.Calc.Convert.toInt(t[6]),u=n.Calc._Helper._argumentExists(t,7)?n.Calc.Convert.toInt(t[7]):0;return u<0||u>4||!(r===1||r===2||r===4)||i(f,h)>0||i(s,f)>0?n.Calc.Errors.Number:o<0||c<0||e<=0?n.Calc.Errors.Number:rr(f,h,s,o,c,e,r,u)}function er(t){var o=n.Calc.Convert.toDateTime(t[0]),f=n.Calc.Convert.toDateTime(t[1]),e=n.Calc.Convert.toDouble(t[2]),r;if(i(o,f)>=0)return n.Calc.Errors.Number;if(e<=0)return n.Calc.Errors.Number;return r=u(f)-u(o),r>365?n.Calc.Errors.Number:100*(1-e*r/360)}function ai(t){var r=n.Calc.Convert.toString(t[0]),i=nt(r,2);return i<0?n.Calc.Errors.Number:i}function yi(i){var l=n.Calc.Convert.toDouble(i[0]),s=n.Calc.Convert.toString(i[1]),h=n.Calc.Convert.toString(i[2]),c=n.Calc._Helper._argumentExists(i,3)?n.Calc.Convert.toBool(i[3]):!1,u=n.Calc._Helper._argumentExists(i,4)?n.Calc.Convert.toInt(i[4]):3,e=0;if(u<3)return n.Calc.Errors.Value;c||(e=gu(h)),n.Calc._Helper._argumentExists(i,4)||(u=wu(s));var r=0,f=nt
(s,u),o=nt(h,u);if(f<0||o<0)return n.Calc.Errors.Value;else r=l*o/f;return c||(r=t.Functions._MathHelper.round(r,e)),r}n.feature("calc.functions_fin",["calc.functions"]);var fe="undefined",yu=t._FinancialHelper.__isLeapYear,i=t._FinancialHelper.__compareDateTime,u=t._FinancialHelper.__toOADate,p=t._FinancialHelper.__annual_year_basis,b=t._FinancialHelper.__getDaysInMonth,ue=t._FinancialHelper.__Days_Between_BASIS_30E_360,se=t._FinancialHelper.__Days_Between_BASIS_30Ep_360,oe=t._FinancialHelper.__Days_Between_BASIS_MSRB_30_360_SYM,ee=t._FinancialHelper.__Days_Between_BASIS_MSRB_30_360,f=t._FinancialHelper.__days_between_basis;t.def("FV",nf,{minArgs:3,maxArgs:5,acceptsMissingArgument:t.acceptsThreeFour}),t.def("FVSCHEDULE",du,{minArgs:2,maxArgs:2,acceptsArray:t.acceptsOne,acceptsReference:t.acceptsOne}),t.def("NPV",bu,{minArgs:2,acceptsArray:t.acceptsPositive,acceptsReference:t.acceptsPositive}),t.def("PV",ku,
{minArgs:3,maxArgs:5,acceptsMissingArgument:t.acceptsThreeFour}),t.def("RECEIVED",cu,{minArgs:4,maxArgs:5,acceptsMissingArgument:t.acceptsFour}),t.def("XNPV",iu,{minArgs:3,maxArgs:3,acceptsArray:t.acceptsNotZero,acceptsReference:t.acceptsNotZero}),t.def("CUMIPMT",tu,{minArgs:6,maxArgs:6}),t.def("CUMPRINC",nu,{minArgs:6,maxArgs:6}),t.def("IPMT",uu,{minArgs:4,maxArgs:6,acceptsMissingArgument:t.acceptsFourFive}),t.def("ISPMT",su,{minArgs:4,maxArgs:4}),t.def("PMT",hu,{minArgs:3,maxArgs:5,acceptsMissingArgument:t.acceptsThreeFour}),t.def("PPMT",ou,{minArgs:4,maxArgs:6,acceptsMissingArgument:t.acceptsFourFive}),t.def("COUPDAYBS",fu,{minArgs:3,maxArgs:4,acceptsMissingArgument:t.acceptsThree}),t.def("COUPDAYS",eu,{minArgs:3,maxArgs:4,acceptsMissingArgument:t.acceptsThree}),t.def("COUPDAYSNC",bf,{minArgs:3,maxArgs:4,acceptsMissingArgument:t.acceptsThree}),t.def("COUPNCD",kf
,{minArgs:3,maxArgs:4,acceptsMissingArgument:t.acceptsThree}),t.def("COUPNUM",wf,{minArgs:3,maxArgs:4,acceptsMissingArgument:t.acceptsThree}),t.def("COUPPCD",yf,{minArgs:3,maxArgs:4,acceptsMissingArgument:t.acceptsThree}),t.def("DURATION",pf,{minArgs:5,maxArgs:6,acceptsMissingArgument:t.acceptsFive}),t.def("MDURATION",ie,{minArgs:5,maxArgs:6,acceptsMissingArgument:t.acceptsFive}),t.def("NPER",re,{minArgs:3,maxArgs:5,acceptsMissingArgument:t.acceptsThreeFour}),t.def("YIELD",vf,{minArgs:6,maxArgs:7,acceptsMissingArgument:t.acceptsSix}),t.def("YIELDDISC",ff,{minArgs:4,maxArgs:5,acceptsMissingArgument:t.acceptsFour}),t.def("YIELDMAT",uf,{minArgs:5,maxArgs:6,acceptsMissingArgument:t.acceptsFive}),t.def("ODDFYIELD",lf,{minArgs:8,maxArgs:9,acceptsMissingArgument:t.acceptsEight}),t.def("ODDLYIELD",cf,{minArgs:7,maxArgs:8,acceptsMissingArgument:t.acceptsSeven}),t.def("TBILLEQ",sf,{mi
nArgs:3,maxArgs:3}),t.def("TBILLYIELD",hf,{minArgs:3,maxArgs:3}),t.def("IRR",ei,{minArgs:1,maxArgs:2,acceptsMissingArgument:t.acceptsOne,acceptsArray:t.acceptsZero,acceptsReference:t.acceptsZero}),t.def("MIRR",vi,{minArgs:3,maxArgs:3,acceptsArray:t.acceptsZero,acceptsReference:t.acceptsZero}),t.def("XIRR",ui,{minArgs:2,maxArgs:3,acceptsMissingArgument:t.acceptsTwo,acceptsArray:t.acceptsNotTwo,acceptsReference:t.acceptsNotTwo}),t.def("AMORDEGRC",ri,{minArgs:6,maxArgs:7,acceptsMissingArgument:t.acceptsSix}),t.def("AMORLINC",ni,{minArgs:6,maxArgs:7,acceptsMissingArgument:t.acceptsSix}),t.def("DB",cr,{minArgs:4,maxArgs:5,acceptsMissingArgument:t.acceptsFour}),t.def("DDB",lr,{minArgs:4,maxArgs:5,acceptsMissingArgument:t.acceptsFour}),t.def("SLN",ar,{minArgs:3,maxArgs:3}),t.def("SYD",or,{minArgs:4,maxArgs:4}),t.def("VDB",hr,{minArgs:5,maxArgs:7,acceptsMissingArgument:t.acceptsFive
Six}),t.def("ACCRINT",wr,{minArgs:6,maxArgs:8,acceptsMissingArgument:t.acceptsFourSixSeven}),t.def("ACCRINTM",br,{minArgs:3,maxArgs:5,acceptsMissingArgument:t.acceptsThreeFour}),t.def("DISC",kr,{minArgs:4,maxArgs:5,acceptsMissingArgument:t.acceptsFour}),t.def("EFFECT",vr,{minArgs:2,maxArgs:2}),t.def("INTRATE",yr,{minArgs:4,maxArgs:5,acceptsMissingArgument:t.acceptsFour}),t.def("NOMINAL",pr,{minArgs:2,maxArgs:2}),t.def("RATE",pi,{minArgs:3,maxArgs:6,acceptsMissingArgument:t.acceptsThreeFourFive}),t.def("DOLLARDE",wi,{minArgs:2,maxArgs:2}),t.def("DOLLARFR",ur,{minArgs:2,maxArgs:2}),t.def("PRICE",fr,{minArgs:6,maxArgs:7,acceptsMissingArgument:t.acceptsSix}),t.def("PRICEDISC",tr,{minArgs:4,maxArgs:5,acceptsMissingArgument:t.acceptsFour}),t.def("PRICEMAT",ir,{minArgs:5,maxArgs:6,acceptsMissingArgument:t.acceptsFive}),t.def("ODDFPRICE",nr,{minArgs:8,maxArgs:9,a
cceptsMissingArgument:t.acceptsEight}),t.def("ODDLPRICE",bi,{minArgs:7,maxArgs:8,acceptsMissingArgument:t.acceptsSeven}),t.def("TBILLPRICE",er,{minArgs:3,maxArgs:3}),t.def("EURO",ai,{minArgs:1,maxArgs:1}),t.def("EUROCONVERT",yi,{minArgs:3,maxArgs:5,acceptsMissingArgument:t.acceptsThreeFour})})(t.Functions||(t.Functions={}));var i=t.Functions})(n.Calc||(n.Calc={}));var t=n.Calc})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype,n.prototype=new r},wijmo;(function(n){(function(t){(function(i){(function(r){function b(n,i,r){var f,u;return n===undefined||n===null?null:t.Calc._ArrayHelper.isArrayOrReference(n)?(i>t.Calc._ArrayHelper.getColumnCount(n)&&(f=i,i=r,r=f),u=r*t.Calc._ArrayHelper.getColumnCount(n)+i,t.Calc._ArrayHelper.getValueByIndex(n,u,0)):n}function a(n,i){retu
rn i===undefined||i===null?!1:t.Calc.Convert.isNumber(n)&&t.Calc.Convert.isNumber(i)?!0:typeof n=="bool"&&typeof i=="bool"?!0:typeof n=="string"&&typeof i=="string"?!0:!1}function rt(n,t,i,r,e){if(n<0)return-1;if(t<0)return-1;if(t<n)return-1;if(i<n)return-1;if(i>t)return-1;if(e)return d=n,k=t,u=i,w=i,f=r,c=r,u;if(f){u++;if(u>k&&f===c)u=w-1,f=!1;else if(u>k&&f!==c)return-1}else{u--;if(u<d&&f===c)u=w+1,f=!0;else if(u<d&&f!==c)return-1}return u}function s(i,r,u){var f,e,s,o;if(i===r)return 0;f=null;if(typeof i=="string")return r||i.toString().length!==0?t.Calc.Convert.isNumber(r)?1:typeof r=="bool"?2:typeof r=="string"?(e=u?i.toString().localeCompare(r.toString()):i.toLowerCase().localeCompare(r.toLowerCase()),e===0?0:e>0?1:2):r instanceof Date?(f=n.spread._DateTimeHelper._parseDate(i),isNaN(f)?1:f===r?0:f>r?1:2):-1:0;else if(typ
eof r=="string")return i||r.toString().length!==0?t.Calc.Convert.isNumber(i)?2:typeof i=="bool"?1:i instanceof Date?(f=n.spread._DateTimeHelper._parseDate(i),isNaN(f)?2:f===r?0:f>r?1:2):-1:0;return typeof i=="bool"&&t.Calc.Convert.isNumber(r)?1:typeof r=="bool"&&t.Calc.Convert.isNumber(i)?2:(s=t.Calc.Convert.toDouble(i),o=t.Calc.Convert.toDouble(r),s===o?0:s<o?2:1)}function e(n,t,i){var r=b(n,t,i);return r?r:0}function l(n,r,u,f){var c=-1,l,y=0,k=-1,o=-1,h,d,v,w,p;l=f?t.Calc._ArrayHelper.getRowCount(r):t.Calc._ArrayHelper.getColumnCount(r),l--;if(l<y)return-1;while(y<=l){h=null,u>=1!=(c===2)&&(k=o),o=t.Calc.Convert.toInt((y+l)/2),o=rt(y,l,o,u>=0,!0),d=o,v=n,n instanceof i.CalcArray?v=n.getValue(0,0):n instanceof t.Calc._SheetRangeReference?v=n.getValue(0,0,0,0):n instanceof t.Calc.Reference&&(v=n.getValue(0,0,0));while(!a(v,h)&&o!==-1){w=!1,h=f?b(r,0,o):b(r,o,0);if(a(v,h))break;o=rt(0,0
,0,!1,!1),w||u<0||o>=d?!w&&u<0&&o>d&&(y=o,w=!0):(l=o,w=!0)}if(o===-1&&u>=1!=(c===2))return k;else if(o===-1)return-1;c=s(v,h,!1);if(u<1||c!==1)if(u<1||c!==2)if(u>-1||c!==1)if(u>-1||c!==2){if(c===0){while(u<=-1&&o>y||u>=0&&o<l){p=0,p=u<0?o-1:o+1,h=f?e(r,0,p):e(r,p,0);if(!h)return-1;if(!a(v,h))break;c=s(v,h,!1);if(c!==0)break;o=p}return o}}else y=o+1;else l=o-1;else l=o-1;else y=o+1}return u>=1!=(c===2)?o:k}function v(n,r,u,f){for(var y=null,o,h=-1,c,v,p=f?t.Calc._ArrayHelper.getRowCount(r):t.Calc._ArrayHelper.getColumnCount(r),l=0;l<p;l++){c=f?e(r,0,l):e(r,l,0);if(!c)return-1;v=n,n instanceof i.CalcArray?v=n.getValue(0,0):n instanceof t.Calc.Reference&&(v=n.getValue(0,0,0));if(!a(v,c))continue;o=s(v,c,!1);if(u<1||o!==1)if(u>-1||o!==2){if(o===0)return l}else o=-1,h<0||(o=s(c,y,!1)),(h<0||h>=0&&o===2)&&(h=l,y=c);else o=-1,h<0||(o=s(c,y,!1)),(h<0||
h>=0&&o===1)&&(h=l,y=c)}return h}function ni(n){var i,t;if(!n||n==="")return n;i=[/\(/,/\[/,/\{/,/\\/,/\^/,/\$/,/\|/,/\)/,/\+/,/\./];for(t in i)t&&(n=n.replace(i[t],i[t].source));return n=n.replace("~?","{113E2532-EAF5-444c-A5CB-3D7446971C4D}"),n=n.replace("~*","{E21523B3-0F1F-458f-B547-23D25713D0EC}"),n=n.replace("?","."),n=n.replace("*","((.|\\n)*)"),n=n.replace("{113E2532-EAF5-444c-A5CB-3D7446971C4D}","\\?"),n=n.replace("{E21523B3-0F1F-458f-B547-23D25713D0EC}","\\*"),n.toString()}function ut(){return!0}function ti(n,i,r){var e,f,u;if(t.Calc.Convert.isError(n))return r.value=n,!1;else if(t.Calc.Convert._isCalcReference(n)){for(e=0;e<n.getRowCount(0);e++)for(f=0;f<n.getColumnCount(0);f++)if(!i(n.getValue(0,e,f),r))return!1}else if(t.Calc.Convert._isCalcArray(n)){for(u=0;u<n.length();u++)if(!i(n.getValueByIndex(u),r))re
turn!1}else if(p.isArray(n))p.each(n,function(n,t){return i(t,r)});else if(!i(n,r))return!1;return!0}function wt(n){if(t.Calc.Convert.isError(n))return-1;try{return t.Calc.Convert.toInt(n)}catch(i){}return-1}function h(n){if(n){if(n.length<1||n.length>1)throw t._StringResource.Exp_InvalidArgument;}else throw t._StringResource.Exp_InvalidArgument;}function pt(n,i){h([n]);if(!i)return t.Calc.Errors.Value;var u=i.arrayFormulaMode,r=t.Calc._Helper._argumentExists(n,0)?n[0]:i.getReference(i.source,i.row,i.column,i.rowCount,i.columnCount);return!r||r.getRangeCount()!==1?t.Calc.Errors.Value:u?new y(r.getSource(),r.getRow(0),r.getColumn(0),r.getRowCount(0),r.getColumnCount(0),o.row):r.getRow(0)+1}function yt(n,i){h([n]);if(!i)return t.Calc.Errors.Value;var u=i.arrayFormulaMode,r=t.Calc._Helper._argumentExists(n,0)?n[0]:i.getReference(i.source,i.row,i.column,i.rowCount,i.columnCount);return!r||r.getRangeCount()!==1?t.Calc.Errors.Value:u?new y(r.getSource(),r.getRow(0),r.getColumn(0),r.
getRowCount(0),r.getColumnCount(0),o.column):r.getColumn(0)+1}function bt(n){return h([n]),t.Calc._ArrayHelper.getRowCount(n[0])}function gt(n){return h([n]),t.Calc._ArrayHelper.getColumnCount(n[0])}function dt(n){return h([n]),new nt(n[0])}function tt(n){var s=n[0],f=n[1],r=t.Calc.Convert.toInt(n[2]),o=t.Calc._Helper._argumentExists(n,3)?t.Calc.Convert.toBool(n[3]):!0,i=-1,u;if(r<=0)return t.Calc.Errors.Value;if(r>t.Calc._ArrayHelper.getRowCount(f))return t.Calc.Errors.Reference;return i=o?l(n[0],n[1],1,!1):v(n[0],n[1],0,!1),i>=0?u=e(n[1],i,r-1):t.Calc.Errors.NotAvailable}function g(n){var s=n[0],f=n[1],r=t.Calc.Convert.toInt(n[2]),o=t.Calc._Helper._argumentExists(n,3)?t.Calc.Convert.toBool(n[3]):!0,i=-1,u;if(r<=0)return t.Calc.Errors.Value;if(r>t.Calc._ArrayHelper.getColumnCount(f))return t.Calc.Errors.Reference;return i=o?l(n[0],n[1],1,!0):v(n[0],n[1],0,!0),i>=0?u=e(n[1],r-1,i):t.Calc.Errors.NotAvailable}function kt(n){var s=-1,i,f=t.Calc._ArrayHelper.getColumnC
ount(n[1]),u=t.Calc._ArrayHelper.getRowCount(n[1]),r,h,c,o;if(n.length>2)i=n[2];else return r=null,f>u?(r=tt([n[0],n[1],u]),r instanceof t.Calc.Error?t.Calc.Errors.NotAvailable:r):(r=g([n[0],n[1],f]),r instanceof t.Calc.Error?t.Calc.Errors.NotAvailable:r);if(i){h=t.Calc._ArrayHelper.getColumnCount(i),c=t.Calc._ArrayHelper.getRowCount(i);if(h>1&&c>1)return t.Calc.Errors.NotAvailable}else i=n[1];return s=l(n[0],n[1],1,f>u?!1:!0),s>=0?(o=null,f=t.Calc._ArrayHelper.getColumnCount(i),u=t.Calc._ArrayHelper.getRowCount(i),o=f>u?e(i,s,u-1):e(i,f-1,s)):t.Calc.Errors.NotAvailable}function vt(n){var i=t.Calc.Convert.toInt(n[0]);return i<1||n.length<=i?t.Calc.Errors.Value:n[i]?n[i]:0}function ft(n,i){for(var e=t.Calc._ArrayHelper.getLength(n),r=0;r<e;r++)if(r>0){var o=t.Calc._ArrayHelper.getValueByIndex(n,r-1),u=t.Calc._ArrayHelper.getValueByIndex(n,r),f=s(o,u,!1);if(f===2&&!i)return!1}return!0}function ot(n){var f=t.Calc._ArrayHelper.getColumnCo
unt(n[1]),u=t.Calc._ArrayHelper.getRowCount(n[1]),r=t.Calc._Helper._argumentExists(n,2)?t.Calc.Convert.toInt(n[2]):1,i;if(f>1&&u>1)return t.Calc.Errors.NotAvailable;if(r!==1||ft(n[1],!0)){if(r===-1&&!ft(n[1],!1))return t.Calc.Errors.NotAvailable}else return t.Calc.Errors.NotAvailable;return i=-1,r===1?i=l(n[0],n[1],1,u>1):r===0?i=v(n[0],n[1],0,u>1):r===-1&&(i=l(n[0],n[1],-1,u>1)),i===-1?t.Calc.Errors.NotAvailable:i+1}function it(n,t,i,r){n.append(t),r?i!==0&&(n.append("["),n.append(i.toString()),n.append("]")):n.append(i)}function lt(n,t,i){return i||n.append("$"),n.append(t),n}function at(n,t,i){i||n.append("$");for(var r=n.toString().length;t>.1;t=(t-1)/26)n.insert(String.fromCharCode("A".charCodeAt(0)+(t-1)%26),r);return n}function ht(n,i){var u,r;if(i&&0<i.length){for(u=!t.Calc.Parser._isLetter(i[0])&&i[0]!=="_",r=1;!u&&r<i.length;r++)u=!t.C
alc.Parser._isLetterOrDigit(i[r])&&i[r]!=="_";u?(n.append("'"),n.append(i.replace("'","''")),n.append("'")):n.append(i),n.append("!")}return n}function et(n){var u=t.Calc.Convert.toInt(n[0]),f=t.Calc.Convert.toInt(n[1]),i=t.Calc._Helper._argumentExists(n,2)?t.Calc.Convert.toInt(n[2]):1,s=t.Calc._Helper._argumentExists(n,3)?t.Calc.Convert.toBool(n[3]):!0,h=t.Calc._Helper._argumentExists(n,4)?t.Calc.Convert.toString(n[4]):"",o=i===3||i===4||i===7||i===8,e=i===2||i===4||i===6||i===8,r=new t._StringBuilder;return u<1&&(s||!o)||u>t.Calc.Parser.maxRowCount?t.Calc.Errors.Value:f<1&&(s||!e)||f>t.Calc.Parser.maxColumnCount?t.Calc.Errors.Value:i<1||8<i?t.Calc.Errors.Value:(ht(r,h),s?(at(r,f,e),lt(r,u,o)):(it(r,"R",u,o),it(r,"C",f,e)),r.toString())}function ct(n){var i=n[0],f=t.Calc._ArrayHelper.getRowCount(i),e=t.Calc._ArrayHelper.getColumnCount(i),o;if(n.length=
==2)return o=t.Calc._Helper._argumentExists(n,1)?t.Calc.Convert.toInt(n[1]):0,f!==1&&e!==1?t.Calc.Errors.Reference:o<0?t.Calc.Errors.Value:f*e<o?t.Calc.Errors.Reference:o===0?new t.Calc._SliceArray(i,0,0,f,e):t.Calc._ArrayHelper.getValueByIndex(i,o-1);else{var r=t.Calc._Helper._argumentExists(n,1)?t.Calc.Convert.toInt(n[1]):0,u=t.Calc._Helper._argumentExists(n,2)?t.Calc.Convert.toInt(n[2]):0,s=t.Calc._Helper._argumentExists(n,3)?t.Calc.Convert.toInt(n[3]):1;return r<0||u<0||s<1?t.Calc.Errors.Value:f<r||e<u||1<s?t.Calc.Errors.Reference:r===0&&u===0?new t.Calc._SliceArray(i,0,0,f,e):r===0?new t.Calc._SliceArray(i,0,u-1,f,1):u===0?new t.Calc._SliceArray(i,r-1,0,1,e):t.Calc._ArrayHelper.getValue(i,r-1,u-1)}}function st(n){var r=n[0];if(!r||r.getRangeCount()!==1)return t.Calc.Errors.Value;var s=t.Calc.Convert.toInt(n[1]),h=t.Calc.Convert.toInt(n[2]),o=t.Calc._Helper._argumentExists(n,3)?t.Calc.Convert.toInt(n[3]):r.getRowCount(0),e=t.Calc._Helper._
argumentExists(n,4)?t.Calc.Convert.toInt(n[4]):r.getColumnCount(0),i=r.getSource(),f=r.getRow(0)+s,u=r.getColumn(0)+h;return o<=0||e<=0?t.Calc.Errors.Reference:f<i.getRow(0)||i.getRow(0)+i.getRowCount(0)<f+o?t.Calc.Errors.Reference:u<i.getColumn(0)||i.getColumn(0)+i.getColumnCount(0)<u+e?t.Calc.Errors.Reference:new t.Calc._ConcreteReference(i,[{row:f,col:u,rowCount:o,colCount:e}])}var p,d,k,u,w,f,c,o,y,nt;t.feature("calc.functions_lookup",["calc.functions"]),p=jQuery,function(n){n[n.row=0]="row",n[n.column=1]="column"}(o||(o={})),y=function(t){function i(i,r,u,f,e,o){t.call(this,i,[new n.spread.Range(r,u,f,e)]),this._row=r,this._column=u,this._rowCount=f,this._columnCount=e,this._type=o}return __extends(i,t),i.prototype.type=function(){return this._type},i.prototype.getValue=function(n,t,i){switch(this._type){case o.row:return this.getRow(0)+1+t;case o.column:return this.getColumn(0)+1+i;default:return this.getActualValue(n,t
,i)}},i}(t.Calc._ConcreteReference),nt=function(n){function i(t){n.call(this),this._array=t}return __extends(i,n),i.prototype.rowCount=function(){return t.Calc._ArrayHelper.getColumnCount(this._array)},i.prototype.columnCount=function(){return t.Calc._ArrayHelper.getRowCount(this._array)},i.prototype.getValue=function(n,i){return t.Calc._ArrayHelper.getValue(this._array,i,n)},i}(t.Calc.CalcArray),r.def("ADDRESS",et,{minArgs:2,maxArgs:5,acceptsMissingArgument:r.acceptsTwoThreeFour}),r.def("INDEX",ct,{minArgs:2,maxArgs:4,acceptsReference:r.acceptsZero,acceptsArray:r.acceptsZero,acceptsMissingArgument:r.acceptsOneTwoThree}),r.def("OFFSET",st,{minArgs:3,maxArgs:5,acceptsMissingArgument:r.acceptsThreeFour,acceptsReference:r.acceptsZero,acceptsArray:r.acceptsZero,isVolatile:r.isVolatile}),r.def("ROW",pt,{minArgs:0,maxArgs:1,acceptsReference:r.acceptsAny,isContextSensitive:ut}),r.def("COLUMN",yt,{minArgs:0,maxArgs:1,acceptsMissingArgument:r
.acceptsZero,acceptsReference:r.acceptsAny,isContextSensitive:ut}),r.def("ROWS",bt,{minArgs:1,maxArgs:1,acceptsReference:r.acceptsAny,acceptsArray:r.acceptsAny}),r.def("COLUMNS",gt,{minArgs:1,maxArgs:1,acceptsReference:r.acceptsAny,acceptsArray:r.acceptsAny}),r.def("TRANSPOSE",dt,{minArgs:1,maxArgs:1,acceptsReference:r.acceptsAny,acceptsArray:r.acceptsAny}),r.def("LOOKUP",kt,{minArgs:2,maxArgs:3,acceptsArray:r.acceptsNotZero,acceptsReference:r.acceptsNotZero}),r.def("HLOOKUP",tt,{minArgs:3,maxArgs:4,acceptsMissingArgument:r.acceptsThree,acceptsArray:r.acceptsOne,acceptsReference:r.acceptsOne}),r.def("VLOOKUP",g,{minArgs:3,maxArgs:4,acceptsMissingArgument:r.acceptsThree,acceptsArray:r.acceptsOne,acceptsReference:r.acceptsOne}),r.def("CHOOSE",vt,{minArgs:2,maxArgs:255,acceptsError:r.acceptsMoreThanOne,isBranch:r.isBranch,findTestArgument:r.findTestArgument,findBranchArgument:wt}),r.def("MATCH",ot,{minArgs:
2,maxArgs:3,acceptsMissingArgument:r.acceptsTwo,acceptsReference:r.acceptsOne,acceptsArray:r.acceptsOne})})(i.Functions||(i.Functions={}));var r=i.Functions})(t.Calc||(t.Calc={}));var i=t.Calc})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}));var wijmo;(function(n){(function(n){(function(t){(function(i){function su(n){return yu(n,!0)}function uu(t){for(var e=!1,f=0,i,o=n.Calc.Convert,h=n.Calc._ArrayHelper,s,u,r=0;r<t.length;r++){if(o.isError(t[r]))return t[r];if(h.isArrayOrReference(t[r]))for(s=0;s<h.getLength(t[r]);s++){u=h.getValueByIndex(t[r],s);if(o.isNumber(u)||typeof u===c)i=o.toDouble(u),(!e||i>f)&&(f=i),e=!0;else if(typeof u===l)i=0,(!e||i>f)&&(f=i),e=!0;else if(o.isError(u))return u}else{if(isNaN(i=o.toDouble(t[r])))return n.Calc.Errors.Value;(!e||i>f)&&(f=i),e=!0}}return f}function pr(n){return vu(n,!0)}function cr(t){for(var e=!1,f=0,i,o=n.Calc.Convert,h=n.Calc._ArrayHelper,s,u,r=0;r<t.length;r++){if(o.isError(t[r]))r
eturn t[r];if(h.isArrayOrReference(t[r]))for(s=0;s<h.getLength(t[r]);s++){u=h.getValueByIndex(t[r],s);if(o.isNumber(u)||typeof u===c)i=o.toDouble(u),(!e||i<f)&&(f=i),e=!0;else if(typeof u===l)i=0,(!e||i<f)&&(f=i),e=!0;else if(o.isError(u))return u}else{if(isNaN(i=o.toDouble(t[r])))return n.Calc.Errors.Value;(!e||i<f)&&(f=i),e=!0}}return f}function kr(t){var r=n.Calc.Convert,s=n.Calc._ArrayHelper,e,i,o,f,u;if(r.isError(t[0]))return t[0];if(r.isError(t[1]))return t[1];e=r.toInt(t[1]),i=[];if(s.isArrayOrReference(t[0]))for(f=0;f<s.getLength(t[0]);f++){u=s.getValueByIndex(t[0],f);if(r.isNumber(u))o=r.toDouble(u),i.push(o);else if(r.isError(u))return u}else{if(isNaN(o=r.toDouble(t[0])))return n.Calc.Errors.Value;i.push(o)}return i.sort(function(n,t){return n-t}),e<=0||i.length<e?n.Calc.Errors.Number:i[i.length-e]}function dr(t){var i=n.Calc.Convert,s=n.Calc._ArrayHelper,e,r,o,f,u;if(i.isError(t[0]))return t[0];if(i.isError(t[1]))return t[1];if
(isNaN(e=i.toInt(t[1])))return n.Calc.Errors.Value;r=[];if(s.isArrayOrReference(t[0]))for(f=0;f<s.getLength(t[0]);f++){u=s.getValueByIndex(t[0],f);if(i.isNumber(u))o=i.toDouble(u),r.push(o);else if(i.isError(u))return u}else{if(isNaN(o=i.toDouble(t[0])))return n.Calc.Errors.Value;r.push(o)}return r.sort(function(n,t){return n-t}),e<=0||r.length<e?n.Calc.Errors.Number:r[e-1]}function br(t){for(var o=0,f=0,u=n.Calc.Convert,s=n.Calc._ArrayHelper,e,r,h,i=0;i<t.length;i++){if(u.isError(t[i]))return t[i];if(s.isArrayOrReference(t[i]))for(e=0;e<s.getLength(t[i]);e++){r=s.getValueByIndex(t[i],e);if(u.isNumber(r)||typeof r===c)o+=u.toDouble(r),f++;else if(typeof r===l)o+=0,f++;else if(u.isError(r))return r}else{if(isNaN(h=u.toDouble(t[i])))return n.Calc.Errors.Value;o+=h,f++}}return f===0?n.Calc.Errors.DivideByZero:u.toResult(o/f)}function y(t,r,u){var a=0,h=0,c=i.Functions._MathHelper.parseCriteria(r),s=n.Calc.Convert,f=n.Calc._ArrayHelper,e,l,o;if(f.getRowCount(t)!==f.getRow
Count(u)||f.getColumnCount(t)!==f.getColumnCount(u))return n.Calc.Errors.Value;for(e=0;e<f.getLength(t);e++){l=f.getValueByIndex(t,e);if(c&&c(l)){o=f.getValueByIndex(u,e);if(s.isNumber(o))a+=s.toDouble(o),h++;else if(s.isError(o))return o}}return h===0?n.Calc.Errors.DivideByZero:s.toResult(a/h)}function wr(t){var h=t[0],a=t[1],c=n.Calc._Helper._argumentExists(t,2)?t[2]:t[0],l=n.Calc.Convert,s=t[1],o,e,u,i,r,f;if(l._isCalcReference(s)){for(o=s.getRowCount(0),e=s.getColumnCount(0),u=[],i=0;i<o;i++)for(u[i]=[],r=0;r<e;r++)u[i][r]=y(h,s.getValue(0,i,r),c);return new n.Calc._ConcreteArray(u)}f=t[1];if(l._isCalcArray(f)){for(o=f.getRowCount(),e=f.getColumnCount(),u=[],i=0;i<o;i++)for(u[i]=[],r=0;r<e;r++)u[i][r]=y(h,f.getValue(i,r),c);return new n.Calc._ConcreteArray(u)}return y(h,a,c)}function iu(t){for(var c=0,h=0,y=t[0],o=n.Calc.Convert,s=n.Calc._ArrayHelper,p=s.getLength(t[0]),r,e,u,f=0;f<p;f++){for(e=!0,u=1;u<t.length;u=u+2){var v=t[u],a=t[u+1],l=i.Functio
ns._MathHelper.parseCriteria(a);r=s.getValueByIndex(v,f),e=l(r);if(!e)break}if(e){r=s.getValueByIndex(y,f);if(o.isNumber(r))c+=o.toDouble(r),h++;else if(o.isError(r))return r}}return h===0?n.Calc.Errors.DivideByZero:o.toResult(c/h)}function ru(t){for(var i=[],o,u=n.Calc.Convert,s=n.Calc._ArrayHelper,e,f,r=0;r<t.length;r++){if(u.isError(t[r]))return t[r];if(s.isArrayOrReference(t[r]))for(e=0;e<s.getLength(t[r]);e++){f=s.getValueByIndex(t[r],e);if(u.isNumber(f))o=u.toDouble(f),i.push(o);else if(u.isError(f))return f}else{if(isNaN(o=u.toDouble(t[r])))return n.Calc.Errors.Value;i.push(o)}}return i.sort(function(n,t){return n-t}),i.length===0?n.Calc.Errors.Number:i.length%2==0?(u.toDouble(i[i.length/2-1])+u.toDouble(i[i.length/2]))/2:i[parseInt((i.length/2).toString(),10)]}function tu(t){for(var l=null,c=0,u=[],f=n.Calc.Convert,h=n.Calc._ArrayHelper,r,o,e,s,i=0;i<t.length;i++){if(f.isError(t[i]))return t[i];if(h.isArrayOrReference(t[i]))for(r=0;r<h.getLength(t[i]);r++){e=h.ge
tValueByIndex(t[i],r);if(f.isNumber(e))o=f.toDouble(e),u.push(o);else if(f.isError(e))return e}else{if(isNaN(o=f.toDouble(t[i])))return n.Calc.Errors.Value;u.push(o)}}for(i=0;i<u.length;i++){for(s=0,r=0;r<u.length;r++)r!==i&&f.toDouble(u[r])===f.toDouble(u[i])&&s++;s>c&&(c=s,l=u[i])}return c===0?n.Calc.Errors.NotAvailable:l}function gr(t){for(var u,h=1,o=0,r=n.Calc.Convert,s=n.Calc._ArrayHelper,e,f,i=0;i<t.length;i++){if(r.isError(t[i]))return t[i];if(s.isArrayOrReference(t[i]))for(e=0;e<s.getLength(t[i]);e++){f=s.getValueByIndex(t[i],e);if(r.isNumber(f)){u=r.toDouble(f);if(u<=0)return n.Calc.Errors.Number;h*=u,o++}else if(r.isError(f))return f}else{if(isNaN(u=r.toDouble(t[i])))return n.Calc.Errors.Value;if(u<=0)return n.Calc.Errors.Number;h*=u,o++}}return o<=0?n.Calc.Errors.DivideByZero:r.toResult(Math.pow(h,1/o))}function nu(t){for(var u,o=0,s=0,r=n.Calc.Convert,h=n.Calc._ArrayHelper,e,f,i=0;i<t.length;i++){if(r.isError(t[i]))retu
rn t[i];if(h.isArrayOrReference(t[i]))for(e=0;e<h.getLength(t[i]);e++){f=h.getValueByIndex(t[i],e);if(r.isNumber(f)){u=r.toDouble(f);if(u<=0)return n.Calc.Errors.Number;o+=1/u,s++}else if(r.isError(f))return f}else{if(isNaN(u=r.toDouble(t[i])))return n.Calc.Errors.Value;if(u<=0)return n.Calc.Errors.Number;o+=1/u,s++}}return o===0?n.Calc.Errors.DivideByZero:r.toResult(s/o)}function yr(t){var o,u=n.Calc.Convert,c=n.Calc._ArrayHelper,h,r,i,e,f,s;if(isNaN(o=u.toDouble(t[1])))return n.Calc.Errors.Value;h=0,r=[];if(o<0||1<=o)return n.Calc.Errors.Number;if(u.isError(t[0]))return t[0];if(c.isArrayOrReference(t[0]))for(i=0;i<c.getLength(t[0]);i++){f=c.getValueByIndex(t[0],i);if(u.isNumber(f))e=u.toDouble(f),r.push(e);else if(u.isError(f))return f}else{if(isNaN(e=u.toDouble(t[0])))return n.Calc.Errors.Value;r.push(e)}for(r.sort(function(n,t){return n-t}),s=parseInt((r.length*o/2).toString(),10),i=s;i<r.length-s;i++)h+=u.toDouble(r[i]);return h/(r.length-2*s)}function or(t
){for(var f=n.Calc.Convert,l=f._toArray(t[0]),c=f._toArray(t[1]),e=0,r,u,b=c.getRowCount(),p=c.getColumnCount(),v,y,w,s,o,i=0;i<b;i++)for(r=0;r<p;r++){u=c.getValue(i,r);if(f.isError(u))return u;f.isNumber(u)&&e++}for(v=l.getRowCount(),y=l.getColumnCount(),i=0;i<v;i++)for(r=0;r<y;r++){u=l.getValue(i,r);if(f.isError(u))return u}var a=[],h=[],k=e+1;for(e=0,i=0;i<b;i++)for(r=0;r<p;r++)u=c.getValue(i,r),f.isNumber(u)&&(a[e++]=f.toDouble(u));for(a.sort(function(n,t){return n-t}),i=0;i<k;i++)h[i]=0;for(i=0;i<v;i++)for(r=0;r<y;r++){u=l.getValue(i,r);if(f.isNumber(u)){for(w=f.toDouble(u),s=!1,o=0;!s&&o<e;o++)w>a[o]||(h[o]++,s=!0);s||h[e]++}}return new n.Calc._OneDimensionalArray(h)}function sr(t){var r=n.Calc.Convert,h=n.Calc._ArrayHelper,o,s,e,i,f,u;if(isNaN(o=r.toDouble(t[0])))return n.Calc.Errors.Value;s=t[1],e=0;if(n.Calc._Helper._argumentExists(t,2))if(isNaN(e=r.toDouble(t[2])))return n.Calc.Errors.Value;var c=0,l=0,a=0;for(i=0;i&
lt;h.getLength(s);i++)f=h.getValueByIndex(t[1],i),r.isNumber(f)&&(u=r.toDouble(f),u<o?c++:o<u?a++:l++);return l===0?n.Calc.Errors.NotAvailable:e===0?a+1:c+1}function er(t){for(var u,h=0,v=0,a=0,l,c,i=0,e=n.Calc.Convert,s=n.Calc._ArrayHelper,o,f,r=0;r<t.length;r++)if(s.isArrayOrReference(t[r]))for(o=0;o<s.getLength(t[r]);o++){f=s.getValueByIndex(t[r],o);if(e.isNumber(f))u=e.toDouble(f),h+=u,v+=u*u,i++;else if(e.isError(f))return f}else{if(isNaN(u=e.toDouble(t[r])))return n.Calc.Errors.Value;h+=u,v+=u*u,i++}if(i<=3)return n.Calc.Errors.DivideByZero;l=h/i,c=Math.sqrt((i*v-h*h)/(i*(i-1)));if(c===0)return n.Calc.Errors.DivideByZero;for(r=0;r<t.length;r++)if(s.isArrayOrReference(t[r]))for(o=0;o<s.getLength(t[r]);o++){f=s.getValueByIndex(t[r],o);if(e.isNumber(f))u=e.toDouble(f),a+=Math.pow((u-l)/c,4);else if(e.isError(f))return f}else{if(isNaN(u=e.toDouble(t[r])))return n.Calc.Errors.Value;a+=Math.pow((u-l)/c,4)}return e.toResult(i*(i+1)*a/((i-1)*(i-2)*(i-3))-3
*(i-1)*(i-1)/((i-2)*(i-3)))}function ur(t){var b=t[0],k,s=n.Calc.Convert,w=n.Calc._ArrayHelper,c,f,v,a,y,o,p;if(isNaN(k=s.toDouble(t[1])))return n.Calc.Errors.Value;c=3;if(n.Calc._Helper._argumentExists(t,2))if(isNaN(c=s.toInt(t[2])))return n.Calc.Errors.Value;f=k;var r=0,e=0,u=0,h=f,l=f;if(c<1)return n.Calc.Errors.Number;for(a=0;a<w.getLength(b);a++){y=w.getValueByIndex(b,a);if(y!==undefined&&y!==null){if(isNaN(o=s.toDouble(y)))return n.Calc.Errors.Value;o<f?(r++,(h===f||h<o)&&(h=o)):o>f?(e++,(l===f||l>o)&&(l=o)):u++}}if(r+u===0||e+u===0)return n.Calc.Errors.NotAvailable;else if(e===0&&r===0&&u!==0)return 1;return r=s.toDouble(r),e=s.toDouble(e),u=s.toDouble(u),u===1?v=r/(r+e):u===0?(p=(f-h)/(l-h),v=(r+p-1)/(e+r-1)):v=(r+.5*u)/(r+u+e),i.Functions._MathHelper.round(v,c>15?15:c)}function fr(t){var e=t[0],u=n.Calc.Convert,f=u.toInt(t[1]),r=0;switch(f){case 0:r=0;break;case 1:r=.25;break;case 2:r=.5;break;case 3:r=.75;break;c
ase 4:r=1;break;default:return n.Calc.Errors.Number}return i._StatHelper.st_percentile([e,r])}function ar(n){return rr(n,!0)}function vr(n){return au(n,!0)}function lr(t){for(var f=0,e=n.Calc.Convert,u=n.Calc._ArrayHelper,r,i=0;i<u.getRangeCount(t[0]);i++)for(r=0;r<u.getLength(t[0],i);r++)u.getValueByIndex(t[0],r,i)===null&&f++;return e.toDouble(f)}function ft(t,r){for(var o=0,s=i.Functions._MathHelper.parseCriteria(r),c=n.Calc.Convert,e=n.Calc._ArrayHelper,f,h,u=0;u<e.getRangeCount(t);u++)for(f=0;f<e.getLength(t,u);f++)h=e.getValueByIndex(t,f,u),s&&s(h)&&o++;return c.toResult(o)}function hr(t){var a=t[0],u=t[1],c=n.Calc.Convert,e=n.Calc._ArrayHelper,i,r,f,l,h;if(e.isArrayOrReference(u)){var v=e.getRowCount(u),o=e.getColumnCount(u),s=[];for(i=0;i<v;i++)for(s[i]=[o],r=0;r<o;r++){f=ft(a,e.getValue(u,i,r));if(c.isError(f))return f;if(isNaN(l=c.toDouble(f)))return n.Calc.Errors.Value;s[i][r]=l}for(h=0,i=0;i<v;i++)for(r=0;r<o;r++)h+=s[i][r]
;return h}return ft(a,u)}function cu(t){for(var s=0,l=n.Calc.Convert,o=n.Calc._ArrayHelper,a=o.getLength(t[0]),f,r,u=0;u<a;u++){for(f=!0,r=0;r<t.length;r=r+2){var v=t[r],h=t[r+1],e=i.Functions._MathHelper.parseCriteria(h),c=o.getValueByIndex(v,u);f=e&&e(c);if(!f)break}f&&s++}return l.toResult(s)}function s(t,i){for(var e=n.Calc.Convert,s=n.Calc._ArrayHelper,r,o,f,u=0;u<t.length;u++)if(e.isError(t[u]))return t[u];else if(s.isArrayOrReference(t[u]))for(o=0;o<s.getLength(t[u]);o++){f=s.getValueByIndex(t[u],o);if(e.isNumber(f)||typeof f===c)r=e.toDouble(f),i.sumx+=r,i.sumx2+=r*r,i.n++;else if(typeof f===l)r=0,i.sumx+=r,i.sumx2+=r*r,i.n++;else if(e.isError(f))return f}else{if(isNaN(r=e.toDouble(t[u])))return n.Calc.Errors.Value;i.sumx+=r,i.sumx2+=r*r,i.n++}}function ku(t){for(var f,c,h=0,l=0,s=0,e,u,r=n.Calc.Convert,o=n.Calc._ArrayHelper,i=0;i<t.length;i++){if(r.isError(t[i]))return t[i];if(o.isArrayOrReference(t[i]))for(e=0;e<o.getLength(t[i]);e++){u=o.
getValueByIndex(t[i],e);if(r.isNumber(u))f=r.toDouble(u),h+=f,s++;else if(r.isError(u))return u}else{if(isNaN(f=r.toDouble(t[i])))return n.Calc.Errors.Value;h+=f,s++}}for(c=h/s,i=0;i<t.length;i++){if(r.isError(t[i]))return t[i];if(o.isArrayOrReference(t[i]))for(e=0;e<o.getLength(t[i]);e++){u=o.getValueByIndex(t[i],e);if(r.isNumber(u))f=r.toDouble(u),l+=Math.abs(f-c);else if(r.isError(u))return u}else{if(isNaN(f=r.toDouble(t[i])))return n.Calc.Errors.Value;l+=Math.abs(f-c)}}return s===0?n.Calc.Errors.DivideByZero:r.toResult(l/s)}function du(t){var i={sumx:0,sumx2:0,n:0},u=s(t,i),r=n.Calc.Convert;return r.isError(u)?u:i.n<=1?n.Calc.Errors.DivideByZero:r.toResult(Math.sqrt(Math.max(0,(i.n*i.sumx2-i.sumx*i.sumx)/(i.n*(i.n-1)))))}function bu(n){return eu(n,!0)}function pu(t){var i={sumx:0,sumx2:0,n:0},u=s(t,i),r=n.Calc.Convert;return r.isError(u)?u:i.n<=0?n.Calc.Errors.DivideByZero:r.toResult(Math.sqrt(Math.max(0,(i.n*i.sumx2-i.sumx*i.sumx)/(i.n*i.n))))}function wu(n){return
ou(n,!0)}function gu(t){var i={sumx:0,sumx2:0,n:0},u=s(t,i),r=n.Calc.Convert;return r.isError(u)?u:i.n<=1?n.Calc.Errors.DivideByZero:r.toResult(Math.max(0,(i.n*i.sumx2-i.sumx*i.sumx)/(i.n*(i.n-1))))}function rf(n){return hu(n,!0)}function uf(t){var i={sumx:0,sumx2:0,n:0},u=s(t,i),r=n.Calc.Convert;return r.isError(u)?u:i.n<=0?n.Calc.Errors.DivideByZero:r.toResult(Math.max(0,(i.n*i.sumx2-i.sumx*i.sumx)/(i.n*i.n)))}function nf(t){var e,o,p,a,y=0,v=0,l=0,i=n.Calc.Convert,s=n.Calc._ArrayHelper,c=s.getLength(t[0]),h,f,u,r;if(c===0)return n.Calc.Errors.DivideByZero;if(c!==s.getLength(t[1]))return n.Calc.Errors.NotAvailable;h=0;if(s.isArrayOrReference(t[0]))for(f=0;f<c;f++){u=s.getValueByIndex(t[0],f),r=s.getValueByIndex(t[1],f);if(i.isNumber(u)&&i.isNumber(r))e=i.toDouble(u),o=i.toDouble(r),y+=e,v+=o,h++;else if(i.isError(u))return u;else if(i.isError(r))return r}else{if(isNaN(e=i.toDouble(t[0]))||isNaN(o=i.toDouble(t[1])))return n.Calc.Errors.Value;y+=e,v+=o,h++}p=y/h,a=v
/h;if(s.isArrayOrReference(t[0]))for(f=0;f<c;f++){u=s.getValueByIndex(t[0],f),r=s.getValueByIndex(t[1],f);if(i.isNumber(u)&&i.isNumber(r))e=i.toDouble(u),o=i.toDouble(r),l+=(e-p)*(o-a);else if(i.isError(u))return u;else if(i.isError(r))return r}else{if(isNaN(e=i.toDouble(t[0]))||isNaN(o=i.toDouble(t[1])))return n.Calc.Errors.Value;l+=(e-p)*(o-a)}return h<=1?n.Calc.Errors.DivideByZero:i.toResult(l/h)}function tf(t){for(var f,s,l=0,c=0,h=0,r,e,u=n.Calc.Convert,o=n.Calc._ArrayHelper,i=0;i<t.length;i++){if(u.isError(t[i]))return t[i];if(o.isArrayOrReference(t[i]))for(r=0;r<o.getLength(t[i]);r++){e=o.getValueByIndex(t[i],r);if(u.isNumber(e))f=u.toDouble(o.getValueByIndex(t[i],r)),l+=f,h++;else if(u.isError(e))return e}else{if(isNaN(f=u.toDouble(t[i])))return n.Calc.Errors.Value;l+=f,h++}}for(s=l/h,i=0;i<t.length;i++)if(o.isArrayOrReference(t[i]))for(r=0;r<o.getLength(t[i]);r++){e=o.getValueByIndex(t[i],r);if(u.isNumber(e))f=u.toDouble(o.getValueByIndex(t[i],r)),
c+=(f-s)*(f-s);else if(u.isError(e))return e}else{if(isNaN(f=u.toDouble(t[i])))return n.Calc.Errors.Value;c+=(f-s)*(f-s)}return u.toResult(c)}function p(t){var e,f,i,r=n.Calc.Convert,s,o;if(isNaN(e=r.toDouble(t[0]))||isNaN(f=r.toDouble(t[1]))||isNaN(i=r.toDouble(t[2])))return n.Calc.Errors.Value;try{s=r.toBool(t[3])}catch(h){return n.Calc.Errors.Value}return i<=0?n.Calc.Errors.Number:s?(o=[],o[0]=(e-f)/i,u(o)):r.toResult(Math.exp(-((e-f)*(e-f))/(2*i*i))/(Math.sqrt(2*Math.PI)*i))}function b(t){var f,h,o,e=n.Calc.Convert,u,i,r;if(isNaN(f=e.toDouble(t[0]))||isNaN(h=e.toDouble(t[1]))||isNaN(o=e.toDouble(t[2])))return n.Calc.Errors.Value;if(f<0||1<f)return n.Calc.Errors.Number;if(o<=0)return n.Calc.Errors.Number;u=f-.5;if(Math.abs(u)>.42){i=f,u>0&&(i=1-f);if(i>22204460492503131e-32)i=Math.sqrt(-Math.log(i)),r=(((2.32121276858*i+4.85014127135)*i-2.29796479134)*i-2.78718931138)/((1.63706781897*i+3.54388924762)*i+1),u<0&&(r=-r);else return i>1e-300
?(r=-2*Math.log(f),i=Math.log(6.2831853071795862*r),i=i/r+(2-i)/(r*r)+(-14+6*i-i*i)/(2*r*r*r),r=Math.sqrt(r*(1-i)),u<0&&(r=-r),r):u<0?-179769e303:179769e303}else i=u*u,r=u*(((-25.44106049637*i+41.39119773534)*i-18.61500062529)*i+2.50662823884)/((((3.13082909833*i-21.06224101826)*i+23.08336743743)*i+-8.4735109309)*i+1);var c=+r/1,l=.3989422804014327*Math.exp(-.5*c*c)/1,s=p([r,0,1,!0]);return e.isError(s)?s:(r=r-(s-f)/l,h+o*r)}function o(t){var i,r=n.Calc.Convert;return isNaN(i=r.toDouble(t[0]))?n.Calc.Errors.Value:i<0||1<i?n.Calc.Errors.Number:b([i,0,1])}function fu(t){var u,f,r=n.Calc.Convert,s,e,i;if(isNaN(u=r.toDouble(t[0]))||isNaN(f=r.toDouble(t[1])))return n.Calc.Errors.Value;s=r.toInt(t[2]);if(u<=0||u>=1)return n.Calc.Errors.Number;if(f<=0)return n.Calc.Errors.Number;if(s<1)return n.Calc.Errors.Number;return e=[],e[0]=u/2,i=o(e),r.isError(i)?i:(i=r.toDouble(i),-i*(f/Math.sqrt(s)))}function w(n){var r,i,t,u;return r=n,i=r+5.5,i=i-(r+.5)*Math.log(i
),t=1.0000000001900149+76.180091729471457/(n+1),t-=86.505320329416776/(n+2),t+=24.014098240830911/(n+3),t-=1.231739572450155/(n+4),t+=.001208650973866179/(n+5),t-=5395239384953e-18/(n+6),u=Math.log(2.5066282746310011*t/r),u-i}function g(n,t,i){var e,s,h,o,u,r,l,a,v,c,p=300,f=1e-50,y=1e-20;for(a=n+t,c=n+1,v=n-1,u=1,r=1-a*i/c,Math.abs(r)<f&&(r=f),r=1/r,h=r,e=1;e<=p;e++){s=e+e,o=(t-e)*e*i/((v+s)*(n+s)),r=1+o*r,Math.abs(r)<f&&(r=f),u=1+o/u,Math.abs(u)<f&&(u=f),r=1/r,h*=r*u,o=0-(n+e)*(a+e)*i/((n+s)*(c+s)),r=1+o*r,Math.abs(r)<f&&(r=f),u=1+o/u,Math.abs(u)<f&&(u=f),r=1/r,l=r*u,h*=l;if(Math.abs(l-1)<y)break}return h}function ct(t){for(var u=n.Calc.Convert,a=n.Calc._Helper,c,r,i,f,e,h,l,s=0;s<t.length;s++)if(u.isError(t[s]))return t[s];if(isNaN(c=u.toDouble(t[0]))||isNaN(r=u.toDouble(t[1]))||isNaN(i=u.toDouble(t[2])))return n.Calc.Errors.Value;f=0;if(a._argumentExists(t,3))if(isNaN(f=u.toDouble(t[3])))return n.Calc.Errors.Value;e
=1;if(a._argumentExists(t,4))if(isNaN(e=u.toDouble(t[4])))return n.Calc.Errors.Value;if(r<=0||i<=0)return n.Calc.Errors.Number;if(c<f||e<c||f===e)return n.Calc.Errors.Number;var o=(c-f)/(e-f),b=!1,k=w(r+i),d=w(r),v=w(i),y=Math.log(o),p=Math.log(1-o);return l=Math.exp(k-d-v+r*y+i*p),h=o<(r+1)/(r+i+2)?l*g(i,r,1-o)/i:1-l*g(i,r,1-o)/i,b&&(h=-1),u.toResult(h)}function r(n){var t=[];t[0]=2;switch(n){case 1:return 22250738585072014e-324;case 2:return 17976931348623157e292;case 3:return Math.pow(2,-53);case 4:return Math.pow(2,-52);case 5:return i.Functions._MathHelper.log10(t);default:return 0}}function lt(t,i,r){var u,f,e,o;if(i<1)return 0;for(e=0,u=0,o=n.Calc.Convert,f=1;f<=i;f++){u=i-f,e+=Math.abs(o.toDouble(t[u]));if(e>r)return u}return u}function ot(t,i,r){var e,o,u,h,f,s;if(r<1||r>1e3)return NaN;if(t<-1.1||t>1.1)return NaN;for(h=t*2,u=o=0,e=0,s=n.Calc.Convert,f=1;f<=r;f++)u=o,o=e,e=h*o-u+s.toDouble(i[r-f]);return(e-u)*.5}function e(n){va
r t=[];t[0]=.16663894804518634,t[1]=-13849481760675638e-21,t[2]=981082564692473e-23,t[3]=-18091294755724941e-27,t[4]=62210980418926055e-30,t[5]=-3399615005417722e-31,t[6]=26831819984826989e-34,t[7]=-28680424353346431e-36,t[8]=39628370610464347e-38,t[9]=-68318887539857674e-40,t[10]=14292273559424982e-41,t[11]=-35475981581010704e-43,t[12]=10256800580104709e-44,t[13]=-34011022543167484e-46,t[14]=1276642195630063e-46;var u=0,f=0,e=0,i;return u===0&&(u=lt(t,15,r(3)),f=1/Math.sqrt(r(3)),e=Math.exp(Math.min(Math.log(r(2)/12),-Math.log(12*r(1))))),n<10?NaN:n<e?n<f?(i=10/n,ot(i*i*2-1,t,u)/n):1/(n*12):22204460492503131e-32*22204460492503131e-32}function ht(n){var t=[],i,u;return t[0]=1.037869356274377,t[1]=-.13364301504908918,t[2]=.019408249135520562,t[3]=-.0030107551127535777,t[4]=.00048694614797154852,t[5]=-81054881893175362e-21,t[6]=13778847799559525e-21,t[7]=-2380221089435897e-21,t[8]=41640416213865184e-23,t[9]=-73595828378075992e-24,t[10]=13117611876241675e-24,t[11]=-235
46709317742423e-25,t[12]=42522773276035e-23,t[13]=-771908941348408e-25,t[14]=1407574648135907e-26,t[15]=-25769072058024682e-28,t[16]=47342406666294419e-29,t[17]=-87249012674742641e-30,t[18]=16124614902740551e-30,t[19]=-29875652015665774e-31,t[20]=55480701209082887e-32,t[21]=-10324619158271569e-32,t[22]=19250239203049852e-33,t[23]=-35955073465265147e-34,t[24]=6726454253787686e-34,t[25]=-1260262416873522e-34,t[26]=23644884408606211e-36,t[27]=-44419377050807936e-37,t[28]=83546594464034255e-38,t[29]=-15731559416479563e-38,t[30]=29653128740247425e-39,t[31]=-55949583481815949e-40,t[32]=10566354268835681e-40,t[33]=-19972483680670205e-41,t[34]=37782977818839361e-42,t[35]=-71531586889081743e-43,t[36]=13552488463674214e-43,t[37]=-25694673048487566e-44,t[38]=48747756066216946e-45,t[39]=-9254211253084972e-45,t[40]=17578597841760237e-46,t[41]=-3341002667773101e-46,t[42]=63533936180236182e-48,i=0,u=0,i===0&&(i=lt(t,43,.1*r(3)),u=-1+Math.sqrt(r(4))),n<=-1?NaN:Math.abs(n)>.375?Math.lo
g(n+1):n*(1-n*ot(n/.375,t,i))}function h(t){var e,r,h,i,f,u,s=1,c=[1,.57721566490153287,-.65587807152025379,-.0420026350340952,.16653861138229151,-.0421977345555443,-.009621971527877,.007218943246663,-.0011651675918591,-.0002152416741149,.0001280502823882,-201348547807e-16,-12504934821e-16,1133027232e-15,-2056338417e-16,6116095e-15,50020075e-16,-11812746e-16,1043427e-16,77823e-16,-36968e-16,51e-14,-206e-16,-54e-16,14e-16],o;if(t>171)return 1e308;o=n.Calc.Convert;if(t===o.toInt(t))if(t>0)for(i=1,e=2;e<t;e++)i*=e;else i=1e308;else{if(Math.abs(t)>1){for(u=Math.abs(t),h=o.toInt(u),s=1,r=1;r<=h;r++)s*=u-r;u-=h}else u=t;for(f=c[24],r=23;r>=0;r--)f=f*u+c[r];i=1/(f*u),Math.abs(t)>1&&(i*=s,t<0&&(i=-Math.PI/(t*i*Math.sin(Math.PI*t))))}return i}function lu(t){var i,c,h,e,u,r,f=0,o=[.083333333333333329,-.0027777777777777779,.00079365079365079365,-.00059523809523809518,.00084175084175084182,-.0019175269175269181,.00641025641025641,-.029550653594771239,.179
64437236883071,-1.3924322169059],s;i=t,s=n.Calc.Convert;if(t>0)if(t===1||t===2)return 0;else t>7||(f=s.toInt(7-t),i=t+f);else return 1e308;for(c=1/(i*i),h=2*Math.PI,u=o[9],r=8;r>=0;r--)u=u*c+o[r];e=u/i+.5*Math.log(h)+(i-.5)*Math.log(i)-i;if(t<=7)for(r=1;r<=f;r++)e-=Math.log(i-1),i-=1;return e}function f(t){var i,r=n.Calc.Convert;return isNaN(i=r.toDouble(t[0]))?n.Calc.Errors.Value:i<=0?n.Calc.Errors.Number:lu(i)}function a(t,i){var o,r,u,l,c,s;r=u=t,i<r&&(r=i),i>u&&(u=i);if(r<0)return NaN;else if(r===0)return 179769e303;if(r<10)if(u<10){var y=h(r),v=h(u),a=h(r+u);return Math.log(y*(v/a))}else return o=e(u)-e(r+u),l=[],l[0]=r,c=f(l),s=n.Calc.Convert,s.isError(c)?NaN:s.toDouble(c)+o+r-r*Math.log(r+u)+(u-.5)*ht(-r/(r+u));else return o=e(r)+e(u)-e(r+u),Math.log(u)*-.5+.91893853320467278+o+(r-.5)*Math.log(r/(r+u))+u*ht(-r/(r+u))}function et(t,i,u){var o,tt,k,f,p,it,e,h,c,v,s,y,l,w,b=0,rt=0,g=0,d=0,nt;b===0&&(b=r(3),rt=Math.log(b),g
=r(1),d=Math.log(g)),s=t,f=i,e=u,f/(f+e)<t&&(s=1-s,f=u,e=i);if((f+e)*s/(f+1)<b)o=0,c=f*Math.log(Math.max(s,g))-Math.log(f)-a(f,e),c>d&&s!==0&&(o=Math.exp(c)),(s!==t||f!==i)&&(o=1-o);else{p=e-Math.floor(e),p===0&&(p=1),c=f*Math.log(s)-a(p,f)-Math.log(f),o=0,nt=n.Calc.Convert;if(c>=d){o=Math.exp(c),h=o*f;if(p!==1)for(y=nt.toInt(Math.max(rt/Math.log(s),4)),l=1;l<=y;l++)v=l,h=h*(v-p)*s/v,o=o+h/(f+v)}if(e>1){for(c=f*Math.log(s)+e*Math.log(1-s)-a(f,e)-Math.log(e),w=nt.toInt(Math.max(c/d,0)),h=Math.exp(c-w*d),tt=1/(1-s),it=e*tt/(f+e-1),k=0,y=nt.toInt(e),e===y&&(y=y-1),l=1;l<=y;l++){if(it<=1&&h/b<=k)break;v=l,h=(e-v+1)*tt*h/(f+e-v),h>1&&(w=w-1,h=h*g),w===0&&(k=k+h)}o=o+k}(s!==t||f!==i)&&(o=1-o),o=Math.max(Math.min(o,1),0)}return o}function of(n,t,i){return t<=0||i<=0?NaN:n<=0?0:n>=1?1:et(n,t,i)}function st(t){for(var l=n.Calc.Convert,yt=n.Calc._Helper,s,p,b,c,k,at,d=0;d&
lt;t.length;d++)if(l.isError(t[d]))return t[d];if(isNaN(s=l.toDouble(t[0]))||isNaN(p=l.toDouble(t[1]))||isNaN(b=l.toDouble(t[2])))return n.Calc.Errors.Value;c=0;if(yt._argumentExists(t,3))if(isNaN(c=l.toDouble(t[3])))return n.Calc.Errors.Value;k=1;if(yt._argumentExists(t,4))if(isNaN(k=l.toDouble(t[4])))return n.Calc.Errors.Value;if(s<=0||1<=s)return n.Calc.Errors.Number;if(p<=0||b<=0)return n.Calc.Errors.Number;var bt=2.30753,gt=.27061,ii=.99229,ti=.04481,h=0,vt=3e-308,dt=1e-300,pt=vt,wt=1-222e-18,ni=5,kt=6,ht=2,w,ct,lt,v,g,tt,st,nt,u,it,e,f,ot,r,y,ft,o,rt,ut,i;i=s;if(p<h||b<h||s<h||s>1)return NaN;if(s===h||s===1)return s;for(tt=a(p,b),s>.5?(v=1-s,u=b,e=p,w=1):(v=s,u=p,e=b,w=0),f=Math.sqrt(-Math.log(v*v)),o=f-(bt+gt*f)/(1+(ii+ti*f)*f),u>1&&e>1?(f=(o*o-3)/6,ot=1/(u+u-1),r=1/(e+e-1),nt=2/(ot+r),ft=o*Math.sqrt(nt+f)/nt-(r-ot)*(f+ni/kt-ht/(3*nt)),i=u/(u+e*Math.exp(ft+ft))):(f=e+e,r=1/(9*e),r=f*Math.pow(1-r+o*Math.sqrt(r),3),r>h?(r=(4*u+f-ht)/r
,i=r>1?1-ht/(r+1):Math.exp((Math.log(v*u)+tt)/u)):i=1-Math.exp((Math.log((1-v)*e)+tt)/e)),f=1-u,r=1-e,rt=h,g=1,i<pt?i=pt:i>wt&&(i=wt),ut=Math.max(dt,Math.pow(10,-13-2.5/(u*u)-.5/(v*v))),y=it=h,ct=0;ct<1e3;ct++){for(o=et(i,u,e),o=(o-v)*Math.exp(tt+f*Math.log(i)+r*Math.log(1-i)),o*rt>h||(it=Math.max(Math.abs(g),vt)),st=1,lt=0;lt<1e3;lt++){g=st*o;if(Math.abs(g)<it){y=i-g;if(y>=h&&y<=1){if(it<=ut)return w!==0&&(i=1-i),l.toResult((k-c)*i+c);if(Math.abs(o)<=ut)return w!==0&&(i=1-i),l.toResult((k-c)*i+c);if(y!==h&&y!==1)break}}st/=3}at=y;if(at===i)return w!==0&&(i=1-i),l.toResult((k-c)*i+c);i=y,rt=o}return w!==0&&(i=1-i),l.toResult((k-c)*i+c)}function dt(t){var o,u,f=n.Calc.Convert,e,c,s,i,r,h;if(isNaN(o=f.toInt(t[0]))||isNaN(u=f.toInt(t[1])))return n.Calc.Errors.Value;if(isNaN(e=f.toDouble(t[2])))return n.Calc.Errors.Value;try{c=f.toBool(t[3])}catch(l){return n.Calc.Errors.Value}if(o<0||u<0||u&l
t;o||e<0||1<e)return n.Calc.Errors.Number;if(c)if(u===o)return 1;else{s=1-e,i=Math.pow(s,u);if(i===0){i=Math.pow(e,u);if(i===0)return n.Calc.Errors.Number;else{for(h=1-i,r=0;r<u-o&&i>0;r++)i*=f.toDouble(u-r)/f.toDouble((r+1)*s/e),h-=i;return h<0?0:h}}else{for(h=i,r=0;r<o&&i>0;r++)i*=f.toDouble(u-r)/f.toDouble((r+1)*e/s),h+=i;return h}}else{s=1-e,i=Math.pow(s,u);if(i===0){i=Math.pow(e,u);if(i===0)return n.Calc.Errors.Number;else{for(r=0;r<u-o&&i>0;r++)i*=f.toDouble(u-r)/f.toDouble((r+1)*s/e);return i}}else{for(r=0;r<o&&i>0;r++)i*=f.toDouble(u-r)/f.toDouble((r+1)*e/s);return i}}}function ti(t){var o,f,r=n.Calc.Convert,u,e;if(isNaN(o=r.toInt(t[0]))||isNaN(f=r.toInt(t[1])))return n.Calc.Errors.Value;if(isNaN(u=r.toDouble(t[2])))return n.Calc.Errors.Value;if(u<0||u>=1)return n.Calc.Errors.Number;if(o+f-1<=0)return n.Calc.Errors.Number;e=i.Functions._MathHelper.combin(o+f-1,f-1);if(r.isError(e))return e;var c=r.toDo
uble(e),h=Math.pow(u,f),s=Math.pow(1-u,o);return r.toResult(c*h*s)}function ni(t){var f,u=n.Calc.Convert,e,s,h,r,o,i;if(isNaN(f=u.toInt(t[0])))return n.Calc.Errors.Value;if(isNaN(e=u.toDouble(t[1]))||isNaN(s=u.toDouble(t[2])))return n.Calc.Errors.Value;if(f<0||e<0||1<e||s<=0||1<=s)return n.Calc.Errors.Number;else{h=1-e,r=Math.pow(h,f);if(r===0){r=Math.pow(e,f);if(r===0)return n.Calc.Errors.Number;else{for(o=1-r,i=0;i<f&&o>=s;i++)r*=u.toDouble(f-i)/u.toDouble((i+1)*h/e),o-=r;return u.toDouble(f-i)}}else{for(o=r,i=0;i<f&&o<s;i++)r*=u.toDouble(f-i)/u.toDouble((i+1)*e/h),o+=r;return u.toDouble(i)}}}function k(t){for(var l=n.Calc.Convert,y,f,h,p,v,b,a=0;a<t.length;a++)if(l.isError(t[a]))return t[a];if(isNaN(y=l.toDouble(t[0]))||isNaN(f=l.toDouble(t[1])))return n.Calc.Errors.Value;if(y<0)return n.Calc.Errors.Number;if(f<1||f>Math.pow(10,10))return n.Calc.Errors.Number;var d=Math.log(Math.sqrt(Math.PI)),k=1/Math.sqrt(Math.PI),i,c,r,o,e
,w=0,s=y;e=.5*s,h=f%2==0,f>1&&(w=Math.exp(-e)),p=[],p[0]=-Math.sqrt(s),v=u(p);if(l.isError(v))return v;b=l.toDouble(v),c=h?w:2*b;if(f>2){s=.5*(f-1),r=h?1:.5;if(e>20){i=h?0:d,o=Math.log(e);while(r<=s)i=Math.log(r)+i,c+=Math.exp(o*r-e-i),r+=1;return c}else{i=h?1:k/Math.sqrt(e),o=0;while(r<=s)i=i*(e/r),o=o+i,r+=1;return o*w+c}}else return c}function d(t){var i,r,b,s=n.Calc.Convert,et,nt,ut,ft;if(isNaN(i=s.toDouble(t[0]))||isNaN(r=s.toDouble(t[1]))||isNaN(b=s.toDouble(t[2])))return n.Calc.Errors.Value;try{et=s.toBool(t[3])}catch(pt){return n.Calc.Errors.Value}if(i<0||r<=0||b<=0)return n.Calc.Errors.Number;if(et===!1){nt=Math.pow(b,r);if(isNaN(nt)||!isFinite(nt))return n.Calc.Errors.DivideByZero;var yt=1/(nt*h(r)),at=Math.pow(i,r-1),ct=Math.exp(-(i/b)),lt=at*ct;return yt*lt}else{var y,d,a,v,tt,it,o,l,g,c,w,rt,u,e,vt=1/3,ht=1e8,k=1e37,st=1e3,ot=-88;i=i/b;if(i<=0)return n.Calc.Errors.Number;if(r>st)return y=Math.sqrt(r)*3*(Math.pow(i/r,vt)+1/(r*9)-1),e
=p([y,0,1,!0]),s.isError(e)?e:s.toDouble(e);if(i>ht)return 1;if(i<=1||i<r){ut=[],ut[0]=r+1,e=f(ut);if(s.isError(e))return e;o=r*Math.log(i)-i-s.toDouble(e),l=1,u=1,c=r;do c=c+1,l=l*i/c,u=u+l;while(l>22204460492503131e-32);o=o+Math.log(u),u=0,o<ot||(u=Math.exp(o))}else{ft=[],ft[0]=r,e=f(ft);if(s.isError(e))return e;for(o=r*Math.log(i)-i-s.toDouble(e),c=1-r,w=c+i+1,l=0,y=1,d=i,a=i+1,v=i*w,u=a/v;;){c=c+1,w=w+2,l=l+1,rt=c*l,tt=w*a-rt*y,it=w*v-rt*d;if(Math.abs(it)>0){g=tt/it;if(Math.abs(u-g)<=Math.min(22204460492503131e-32,22204460492503131e-32*g))break;u=g}y=a,d=v,a=tt,v=it,Math.abs(tt)<k||(y=y/k,d=d/k,a=a/k,v=v/k)}o=o+Math.log(u),u=1,o<ot||(u=1-Math.exp(o))}return u}}function tt(t){var e,s,k,c=n.Calc.Convert,nt,u;if(isNaN(e=c.toDouble(t[0]))||isNaN(s=c.toDouble(t[1]))||isNaN(k=c.toDouble(t[2])))return n.Calc.Errors.Value;var et=4.67,si=6.66,ot=6.73,oi=13.32,ei=60,li=70,vt=84,ci=105,hi=120,ii=127,ti=140,ni=1175,ct=210,fi=252,ui=2264,ri=294,ai=346,yt=420,nr=462
,gi=606,di=672,rr=707,ir=735,tr=889,pi=932,yi=966,kt=1141,vi=1182,ki=1278,bi=1740,tt=2520,ft=5040,wi=5e-7,wt=.01,pt=5e-7,dt=20,gt=2e-6,bt=.999998,r,l,o,i,p,h,v,y,w,g,ht,ut,st,lt,at,a,rt,it;if(e<0||1<e||s<=0||k<=0)return n.Calc.Errors.Number;if(e<gt)return 0;if(e>bt)return 179769e303;v=2*s,o=s-1,nt=[],nt[0]=s,u=f(nt);if(c.isError(u))return u;p=c.toDouble(u);if(v<-1.24*Math.log(e)){i=Math.pow(e*s*Math.exp(p+s*.69314718055994529),1/s);if(i<wi)return NaN}else if(v>.32){u=b([e,0,1]);if(c.isError(u))return u;rt=c.toDouble(u),h=.222222/v,i=v*Math.pow(rt*Math.sqrt(h)+1-h,3),i>2.2*v+6&&(i=-2*(Math.log(1-e)-o*Math.log(.5*i)+p))}else{i=.4,r=Math.log(1-e)+p+o*.69314718055994529;do w=i,h=1+i*(et+i),y=i*(ot+i*(si+i)),a=-.5+(et+2*i)/h-(ot+i*(oi+3*i))/y,i-=(1-Math.exp(r+.5*i)*y/h)/a;while(Math.abs(w/i-1)>wt)}for(it=1;it<=dt;it++){w=i,h=.5*i,u=d([h,s,1,!0]);if(c.isError(u))return u;y=e-c.toDouble(u),a=y*Math.exp(s*.69314718055994529+p+h-o*Math.log(i)),l=a/
i,r=.5*a-l*o,g=(ct+r*(ti+r*(ci+r*(vt+r*(li+ei*r)))))/yt,ht=(yt+r*(ir+r*(yi+r*(kt+ki*r))))/tt,ut=(ct+r*(nr+r*(rr+pi*r)))/tt,st=(fi+r*(di+vi*r)+o*(ri+r*(tr+bi*r)))/ft,lt=(vt+ui*r+o*(ni+gi*r))/tt,at=(hi+o*(ai+ii*o))/ft,i=i+a*(1+.5*a*g-l*o*(g-l*(ht-l*(ut-l*(st-l*(lt-l*at))))));if(Math.abs(w/i-1)>pt)return.5*k*i}return.5*k*i}function kt(t){for(var f=n.Calc.Convert,u,r,o,e,i=0;i<t.length;i++)if(f.isError(t[i]))return t[i];return isNaN(u=f.toDouble(t[0]))?n.Calc.Errors.Value:isNaN(r=f.toInt(t[1]))?n.Calc.Errors.Value:u<0||u>1?n.Calc.Errors.Number:r<1||r>Math.pow(10,10)?n.Calc.Errors.Number:(o=1-u,e=tt([o,.5*r,2]),f.toDouble(e))}function bt(t){var v=0,l,h=n.Calc.Convert,u=n.Calc._ArrayHelper,i=u.getRowCount(t[0]),r=u.getColumnCount(t[0]),o,e,c,s,a,f;if(i!==u.getRowCount(t[1])||r!==u.getColumnCount(t[1]))return n.Calc.Errors.NotAvailable;if(i>1&&r>1)l=(i-1)*(r-1);else if(i>1&&r===1)l=i-1;else if(i===1&&r>1)l=r-1;else return n.Calc.Errors.
NotAvailable;for(o=0;o<i;o++)for(e=0;e<r;e++){c=u.getValue(t[0],o,e);if(h.isError(c))return c;s=u.getValue(t[1],o,e);if(h.isError(s))return s;if(isNaN(a=h.toDouble(c))||isNaN(f=h.toDouble(s)))return n.Calc.Errors.Value;if(f===0)return n.Calc.Errors.DivideByZero;v+=(a-f)*(a-f)/f}return k([v,l])}function wt(t){var c=0,l=0,b=0,d=0,k=0,w,p,y,a,r=n.Calc.Convert,o=n.Calc._ArrayHelper,v=o.getLength(t[0]),i,u,h,s,e,f;if(v!==o.getLength(t[1]))return n.Calc.Errors.NotAvailable;for(i=0,u=0;u<v;u++){e=o.getValueByIndex(t[0],u),f=o.getValueByIndex(t[1],u);if(r.isNumber(e)&&r.isNumber(f))h=r.toDouble(e),s=r.toDouble(f),c+=h,l+=s,b+=h*h,d+=s*s,i++;else if(r.isError(e))return e;else if(r.isError(f))return f}if(i<=1)return n.Calc.Errors.DivideByZero;w=c/i,p=l/i,y=Math.sqrt((i*b-c*c)/(i*(i-1))),a=Math.sqrt((i*d-l*l)/(i*(i-1)));if(y===0||a===0)return n.Calc.Errors.DivideByZero;for(u=0;u<v;u++)e=o.getValueByIndex(t[0],u),f=o.getValueByIndex(t[1],u),r.isNumber(e)&&r.isNumb
er(f)&&(h=r.toDouble(e),s=r.toDouble(f),k+=(h-w)*(s-p));return r.toResult(k/r.toDouble((i-1)*y*a))}function gt(t){for(var r=n.Calc.Convert,e,u,o,f,i=0;i<t.length;i++)if(r.isError(t[i]))return t[i];return isNaN(e=r.toDouble(t[0]))||isNaN(u=r.toDouble(t[1]))?n.Calc.Errors.Value:isNaN(o=r.toDouble(t[2]))?n.Calc.Errors.Value:e<0?n.Calc.Errors.Number:u<=0?n.Calc.Errors.Number:(f=Math.exp(-u*e),r.toResult(o?1-f:u*f))}function it(t){var f,i,u,r=n.Calc.Convert;if(isNaN(f=r.toDouble(t[0]))||isNaN(i=r.toDouble(t[1]))||isNaN(u=r.toDouble(t[2])))return n.Calc.Errors.Value;if(f<0||i<1||i>=Math.pow(10,10)||u<1||u>=Math.pow(10,10))return n.Calc.Errors.Number;var h=i*f/(i*f+u),o=.5*i,s=.5*u,e=ct([h,o,s]);return r.isError(e)?e:1-r.toDouble(e)}function yt(t){var e,u,i,r=n.Calc.Convert,o,f;if(isNaN(e=r.toDouble(t[0]))||isNaN(u=r.toDouble(t[1]))||isNaN(i=r.toDouble(t[2])))return n.Calc.Errors.Value;if(e<0||1<e||u<1||u>=Math.pow(10,10)||i<1||i>=Math.pow(
10,10))return n.Calc.Errors.Number;return o=1-e,f=st([1-o,i/2,u/2]),r.isError(f)?f:(1/r.toDouble(f)-1)*(i/u)}function vt(t){var i,r=n.Calc.Convert;return isNaN(i=r.toDouble(t[0]))?n.Calc.Errors.Value:i<=-1||1<=i?n.Calc.Errors.Number:Math.log((1+i)/(1-i))/2}function pt(t){var u,f=n.Calc.Convert,i,r;if(isNaN(u=f.toDouble(t[0])))return n.Calc.Errors.Value;return i=Math.exp(2*u)-1,r=Math.exp(2*u)+1,!isFinite(i)&&i>0&&!isFinite(r)&&r>0?1:i/r}function rt(t,i){for(var o,e,f,h=n.Calc.Convert,u=n.Calc._ArrayHelper,c=u.getLength(i),s,r=0;r<u.getLength(i);r++)s=u.getValueByIndex(i,r),h.isNumber(s)&&(o=h.toDouble(u.getValueByIndex(i,r)),e=o-t.M,f=e/(t.N+1),t.M+=f,t.Q+=t.N*e*f,t.N++,t.sum+=o)}function wi(t){for(var a=t[0],l=t[1],o=n.Calc.Convert,s=n.Calc._ArrayHelper,u,i,h,c,f,v,y,e,r=0;r<s.getLength(a);r++){u=s.getValueByIndex(a,r);if(o.isError(u))return u}for(r=0;r<s.getLength(l);r++){u=s.getValueByIndex(l,r);if(o.isError(u))return u}i={N:0,
M:0,Q:0,afun_flag:!1,sum:0},rt(i,a),v=i.N-1;if(i.N===1)return n.Calc.Errors.DivideByZero;h=i.Q/(i.N-1);if(h===0)return n.Calc.Errors.DivideByZero;i.N=0,i.M=0,i.Q=0,i.afun_flag=!1,i.sum=0,rt(i,l),y=i.N-1;if(i.N===1)return n.Calc.Errors.DivideByZero;c=i.Q/(i.N-1);if(c===0)return n.Calc.Errors.DivideByZero;return e=it([h/c,v,y]),o.isError(e)?e:(f=(1-o.toDouble(e))*2,f>1&&(f=2-f),f)}function bi(t){var u=n.Calc.Convert,s=u.toInt(t[0]),o=u.toInt(t[1]),e=u.toInt(t[2]),f=u.toInt(t[3]),r,l,c,h;if(s<0||s>Math.min(o,e))return n.Calc.Errors.Number;if(s<Math.max(0,o-f+e))return n.Calc.Errors.Number;if(o<0||o>f)return n.Calc.Errors.Number;if(e<0||e>f)return n.Calc.Errors.Number;if(f<0)return n.Calc.Errors.Number;r=i.Functions._MathHelper.combin(e,s);if(u.isError(r))return r;l=u.toDouble(r),r=i.Functions._MathHelper.combin(f-e,o-s);if(u.isError(r))return r;return c=u.toDouble(r),r=i.Functions._MathHelper.combin(f,o),u.isError(r)?r:(h=u.toDouble(r),u.toResult(l*c/
h))}function pi(t){var f,o,i,r=n.Calc.Convert,e;return isNaN(f=r.toDouble(t[0]))||isNaN(o=r.toDouble(t[1]))||isNaN(i=r.toDouble(t[2]))?n.Calc.Errors.Value:f<=0||i<=0?n.Calc.Errors.Number:(e=[],e[0]=(Math.log(f)-o)/i,u(e))}function vi(t){var u,h,e,i=n.Calc.Convert,f,r,s;if(isNaN(u=i.toDouble(t[0]))||isNaN(h=i.toDouble(t[1]))||isNaN(e=i.toDouble(t[2])))return n.Calc.Errors.Value;if(e<=0||u<0||u>1)return n.Calc.Errors.Number;return f=[],f[0]=u,r=o(f),i.isError(r)?r:(s=i.toDouble(r),i.toResult(Math.exp(h+e*s)))}function yi(t){var u=0,r=0,c=0,a=0,p=0,h=n.Calc.Convert,s=n.Calc._ArrayHelper,y=s.getLength(t[0]),i,o,v,l,e,f;if(y!==s.getLength(t[1]))return n.Calc.Errors.NotAvailable;for(i=0,o=0;o<y;o++)v=s.getValueByIndex(t[0],o),l=s.getValueByIndex(t[1],o),h.isNumber(v)&&h.isNumber(l)&&(e=h.toDouble(v),f=h.toDouble(l),u+=e,r+=f,c+=e*e,a+=f*f,p+=e*f,i++);return i*c-u*u==0||i*a-r*r==0?n.Calc.Errors.DivideByZero:(i*p-u*r)/Math.sqrt((i*c-u*u)*(i*a-r*r))}function
ki(t){var p=t[0],w=t[1],o=0,h=0,y=0,b=0,k=0,e=0,r=n.Calc.Convert,s=n.Calc._ArrayHelper,d=s.getLength(w),i,c,l,f,u,a,v;if(d!==s.getLength(p))return n.Calc.Errors.NotAvailable;for(i=0;i<d;i++)c=s.getValueByIndex(w,i),l=s.getValueByIndex(p,i),r.isNumber(c)&&r.isNumber(l)&&(f=r.toDouble(c),u=r.toDouble(l),o+=f,h+=u,y+=f*f,b+=u*u,k+=f*u,e++);return a=Math.sqrt((e*y-o*o)*(e*b-h*h)),a===0?n.Calc.Errors.DivideByZero:(v=(e*k-o*h)/a,r.toResult(v*v))}function ut(n){for(var i=1,t=n;t>1;t--)i*=t;return i}function tr(t){var u,e=n.Calc.Convert,i,o,f,r;if(isNaN(u=e.toInt(t[0])))return n.Calc.Errors.Value;if(isNaN(i=e.toDouble(t[1])))return n.Calc.Errors.Value;try{o=e.toBool(t[2])}catch(s){return n.Calc.Errors.Value}f=0;if(u<=0||i<=0)return n.Calc.Errors.Number;if(o)for(r=0;r<=u;r++)f+=Math.exp(-i)*Math.pow(i,r)/ut(r);else f=Math.exp(-i)*Math.pow(i,u)/ut(u);return e.toResult(f)}function ir(t){var o,f=n.Calc.Convert,r=n.Calc._ArrayHelper,s,i,e,u;if(isNaN(o=f.toDouble(t
[2])))return n.Calc.Errors.Value;s=o;if(n.Calc._Helper._argumentExists(t,3))if(isNaN(s=f.toDouble(t[3])))return n.Calc.Errors.Value;var h=0,c=0,l=r.getLength(t[0]);if(l!==r.getLength(t[1]))return n.Calc.Errors.NotAvailable;for(i=0;i<l;i++)if(r.getValueByIndex(t[0],i)!==null&&r.getValueByIndex(t[1],i)!==null){if(isNaN(e=f.toDouble(r.getValueByIndex(t[0],i)))||isNaN(u=f.toDouble(r.getValueByIndex(t[1],i))))return n.Calc.Errors.Value;if(u<=0||1<u)return n.Calc.Errors.Number;o>e||e>s||(h+=u),c+=u}return c!==1?n.Calc.Errors.Number:h}function nr(t){var c;if(t[0]===undefined||t[0]===null)throw n._StringResource.Exp_InvalidArgument;for(var h=0,y=0,v=0,a,l,r=0,e,o,f,u=n.Calc.Convert,s=n.Calc._ArrayHelper,i=0;i<t.length;i++)if(s.isArrayOrReference(t[i]))for(e=0;e<s.getLength(t[i]);e++){f=s.getValueByIndex(t[i],e);if(u.isNumber(f))o=u.toDouble(f),h+=o,y+=o*o,r++;else if(u.isError(f))return f}else if(u.isError(t[i]))return t[i];else{if(isNaN(c=u.toDouble(t[i])))retu
rn n.Calc.Errors.Value;h+=c,y+=c*c,r++}if(r<=2)return n.Calc.Errors.DivideByZero;a=h/r,l=Math.sqrt((r*y-h*h)/(r*(r-1)));if(l===0)return n.Calc.Errors.DivideByZero;for(i=0;i<t.length;i++)if(s.isArrayOrReference(t[i]))for(e=0;e<s.getLength(t[i]);e++){f=s.getValueByIndex(t[i],e);if(u.isNumber(f))o=u.toDouble(f),v+=Math.pow((o-a)/l,3);else if(u.isError(f))return f}else{if(isNaN(o=u.toDouble(t[i])))return n.Calc.Errors.Value;v+=Math.pow((o-a)/l,3)}return u.toResult(r*v/((r-1)*(r-2)))}function di(t){var f,u,i,r=n.Calc.Convert;return isNaN(f=r.toDouble(t[0]))||isNaN(u=r.toDouble(t[1]))||isNaN(i=r.toDouble(t[2]))?n.Calc.Errors.Value:i<=0?n.Calc.Errors.Number:(f-u)/i}function gi(t){var u,s=n.Calc.Convert,h,f,c,o,e;if(isNaN(u=s.toDouble(t[0])))return n.Calc.Errors.Value;if(isNaN(h=s.toInt(t[1]))||isNaN(f=s.toInt(t[2])))return n.Calc.Errors.Value;if(h<1||f!==1&&f!==2||u<0)return n.Calc.Errors.Number;var i=h,v=u/Math.sqrt(i),l=i/(i+u*u),y=i-2,p=i%2,r=1,a=1;i=1,c=2+p,o=
c;if(y>=2)for(e=s.toInt(c);e<=y;e=e+2){a=a*l*(o-1)/o,r+=a;if(r===i)break;i=r,o+=2}return p!==1?f*(1-(.5+.5*v*Math.sqrt(l)*r)):(h===1&&(r=0),f*(1-(.5+(v*l*r+Math.atan(v))*.3183098862)))}function fi(t){var v,c=n.Calc.Convert,r,k,e,l,h,y,nt,f,s,u,i,d,g,a,b,w,p;if(isNaN(v=c.toDouble(t[0])))return n.Calc.Errors.Value;if(isNaN(r=c.toInt(t[1])))return n.Calc.Errors.Value;k=1e-12;if(v<0||1<v||r<1||r>Math.pow(10,10))return n.Calc.Errors.Number;g=v/2,a=g;if(r>1e20)return b=[],b[0]=g,o(b);a<.5?(d=0,f=2*a):(d=1,f=2*(1-a));if(Math.abs(r-2)<k)s=f>0?Math.sqrt(2/(f*(2-f))-2):179769e303;else if(c.toDouble(r)<1+k)f>0?(nt=(f+1)*1.5707963267948966,s=-Math.tan(nt)):s=179769e303;else{e=1/(r-.5),l=48/(e*e),h=((20700*e/l-98)*e-16)*e+96.36,y=((94.5/(l+h)-3)/l+1)*Math.sqrt(e*1.5707963267948966)*r,i=Math.pow(y*f,2/r);if(i>.05+e){w=[],w[0]=.5*f,p=o(w);if(c.isError(p))return p;u=c.toDouble(p),i=u*u,r<5&&(h=h+.3*(r-4.5)*(u+.6)),h=(((.05*y*u-5)*u-7)*u-2)*u
+l+h,i=(((((.4*i+6.3)*i+36)*i+94.5)/h-i-3)/l+1)*u,i=e*i*i,i=i>.002?Math.exp(i)-1:.5*i*i+i}else i=((1/(((r+6)/(r*i)-.089*y-.822)*(r+2)*3)+.5/(r+4))*i-1)*(r+1)/(r+2)+1/i;s=Math.sqrt(r*i)}return d!==0&&(s=-s),c.toResult(s)}function nt(t,i){for(var f,e,u,s=n.Calc.Convert,o=n.Calc._ArrayHelper,h=o.getLength(i),r=0;r<h;r++)f=s.toDouble(o.getValueByIndex(i,r)),e=f-t.M,u=e/(t.N+1),t.M+=u,t.Q+=t.N*e*u,t.N++,t.sum+=f}function v(n){var f=[76.180091729471457,-86.505320329416776,24.014098240830911,-1.231739572450155,.001208650973866179,-5395239384953e-18],u=n,r=n+5.5,i,t;for(r-=(n+.5)*Math.log(r),i=1.0000000001900149,t=0;t<=5;t++)i+=f[t]/++u;return-r+Math.log(2.5066282746310007*i/n)}function ei(t,i){var s=n.Calc.Convert,u=n.Calc._ArrayHelper,h=u.getLength(t),c=u.getLength(i),f,r,e,o;if(h!==c)return n.Calc.Errors.NotAvailable;for(f=[],r=0;r<h;r++){if(isNaN(e=s.toDouble(u.getValueByIndex(t,r)))||isNaN(o=s.toDouble(u.getValueByIndex(i,r))))return n.Calc.Errors.Value;f[r]=e-o}ret
urn f}function ui(t,i,r){var g=r===0||r===1?0:Math.exp(v(t+i)-v(t)-v(i)+t*Math.log(r)+i*Math.log(1-r)),p=r<(t+1)/(t+i+2),y,c,w,o,s,h,l,a;p&&(y=t,t=i,i=y,r=1-r);var f=44501477170144028e-324,nt=100,k=t+i,b=t+1,d=t-1,e=1,u=1-k*r/b;for(Math.abs(u)<f&&(u=f),u=1/u,c=u,w=n.Calc.Convert,o=1,s=2;o<=nt;o++,s+=2){h=o*(i-o)*r/((d+s)*(t+s)),u=1+h*u,Math.abs(u)<f&&(u=f),e=1+h/e,Math.abs(e)<f&&(e=f),u=1/u,c*=u*e,h=-(t+o)*(k+o)*r/((t+s)*(b+s)),u=1+h*u,Math.abs(u)<f&&(u=f),e=1+h/e,Math.abs(e)<f&&(e=f),u=1/u,l=u*e,c*=l;if(Math.abs(w.toDouble(l-1))<494065645841247e-338)return a=g*c/t,p?1-a:a}return n.Calc.Errors.Number}function ii(t){var f=t[0],ht=t[1],ot=t[2],ft=t[3],r=n.Calc.Convert,d,y,a,it,tt,u,st,v,g,c,l;if(!r.isNumber(ot)||!r.isNumber(ft))return n.Calc.Errors.Value;var rt=r.toInt(ot),b=r.toInt(ft),k,et,e,w,p,ut,o,i={N:0,M:0,Q:0,sum:0,afun_flag:!1},s,h;if(rt!==1&&rt!==2||b<1||3<b)return n.Calc.Errors.Number;if(b
===1){f=ei(f,ht);if(r.isError(f))return f;for(y=a=it=tt=u=d=0,st=f.length,v=0;v<st;v++){if(isNaN(g=r.toDouble(f[v])))return n.Calc.Errors.Value;y=g-it,a=y/(u+1),it+=a,tt+=u*y*a,u++,d+=g}if(u-1==0||u===0)return n.Calc.Errors.DivideByZero;w=Math.sqrt(tt/(u-1));if(isNaN(w)||!isFinite(w))return n.Calc.Errors.Number;k=d/u,e=k/(w/Math.sqrt(u)),o=u-1}else i.N=0,i.M=0,i.Q=0,i.afun_flag=!1,i.sum=0,nt(i,f),p=i.Q/(i.N-1),k=i.sum/i.N,s=i.N,i.N=0,i.M=0,i.Q=0,i.afun_flag=!1,i.sum=0,nt(i,ht),ut=i.Q/(i.N-1),et=i.sum/i.N,h=i.N,b!==2?(c=p/s/(p/s+ut/h),o=1/(c*c/r.toDouble(s-1)+(1-c)*(1-c)/r.toDouble(h-1))):o=r.toDouble(s+h-2),e=(k-et)/Math.sqrt(p/r.toDouble(s)+ut/r.toDouble(h));return e=Math.abs(e),l=ui(.5*o,.5,o/(o+e*e)),r.isError(l)?l:.5*rt*r.toDouble(l)}function ri(t){var w,r=n.Calc.Convert,c=n.Calc._ArrayHelper,a,s,o,l,h;if(isNaN(w=r.toDouble(t[1])))return n.Calc.Errors.Value;a=0;if(n.Calc._Helper._argumentExists(t,2))if(isNaN(a=r.toDouble(t[2])))return n.Calc.Errors.Value;var e=0,y=0,p,v,i=0,f
;if(c.isArrayOrReference(t[0]))for(s=0;s<c.getLength(t[0]);s++){o=c.getValueByIndex(t[0],s);if(r.isNumber(o))f=r.toDouble(o),e+=f,y+=f*f,i++;else if(r.isError(o))return o}else{if(isNaN(f=r.toDouble(t[0])))return n.Calc.Errors.Value;e+=f,y+=f*f,i++}if(i===0)return n.Calc.Errors.NotAvailable;if(i===1)return n.Calc.Errors.DivideByZero;p=e/i,v=n.Calc._Helper._argumentExists(t,2)?a:Math.sqrt((i*y-e*e)/(i*(i-1)));if(v===0)return n.Calc.Errors.DivideByZero;return l=[],l[0]=(p-w)/(v/Math.sqrt(i)),h=u(l),r.isError(h)?h:r.toResult(1-r.toDouble(h))}function oi(t){var f,i,u,r=n.Calc.Convert,e;if(isNaN(f=r.toDouble(t[0]))||isNaN(i=r.toDouble(t[1]))||isNaN(u=r.toDouble(t[2])))return n.Calc.Errors.Value;try{e=r.toBool(t[3])}catch(o){return n.Calc.Errors.Value}return f<0||i<=0||u<=0?n.Calc.Errors.Number:e?r.toResult(1-Math.exp(-Math.pow(f/u,i))):r.toResult(i/Math.pow(u,i)*Math.pow(f,i-1)*Math.exp(-Math.pow(f/u,i)))}function li(t){var i=n.Calc.Convert,u=i.toDouble(i.toInt(t[0])),f=i.toDo
uble(i.toInt(t[1])),e=1,r;if(u<0||f<0||u<f)return n.Calc.Errors.Number;for(r=u-f+1;r<=u;r++)e*=r;return i.toResult(e)}function ai(t){var l,s,c=0,u=0,a=0,y=0,v,r=n.Calc.Convert,h=n.Calc._ArrayHelper,p=h.getLength(t[0]),i,o,e,f;if(p!==h.getLength(t[1]))return n.Calc.Errors.NotAvailable;for(i=0,o=0;o<p;o++){e=h.getValueByIndex(t[0],o),f=h.getValueByIndex(t[1],o);if(r.isNumber(e)&&r.isNumber(f))l=r.toDouble(e),s=r.toDouble(f),c+=l,u+=s,a+=s*s,y+=s*l,i++;else if(r.isError(e))return e;else if(r.isError(f))return f}return i===0?n.Calc.Errors.DivideByZero:i*a-u*u==0?n.Calc.Errors.DivideByZero:(v=(i*y-u*c)/(i*a-u*u),r.toResult(c/i-v*(u/i)))}function ci(i){for(var l=n.Calc.Convert,dt=n.Calc._Helper,y=l._toArray(i[0]),a=new t.CalcArray,it,f,u,e,h,p,b,v,d,o,ut,rt,k,ot,s,g,c,nt,vt,ct,a=dt._argumentExists(i,1)?l._toArray(i[1]):y,ht=dt._argumentExists(i,2)?l.toBool(i[2]):!0,w=dt._argumentExists(i,3)?l.toBool(i[3]):!1,r=0;r<y.getRowCount();r++)for(f=0;f<y.getColumnCount
();f++)if(l.isError(y.getValue(r,f)))return y.getValue(r,f);else if(!l.isNumber(y.getValue(r,f)))return n.Calc.Errors.Value;for(r=0;r<a.getRowCount();r++)for(f=0;f<a.getColumnCount();f++){if(l.isError(a.getValue(r,f)))return a.getValue(r,f);if(!l.isNumber(a.getValue(r,f)))return n.Calc.Errors.Value}if(y.getRowCount()===a.getRowCount()&&y.getColumnCount()===a.getColumnCount()&&(ht||!w)){h=l.toDouble(a.getRowCount()*a.getColumnCount());var tt=0,et=0,ft=0,kt=0,st=0,at;for(r=0;r<a.getRowCount();r++)for(f=0;f<a.getColumnCount();f++){if(isNaN(p=l.toDouble(a.getValue(r,f)))||isNaN(b=l.toDouble(y.getValue(r,f))))return n.Calc.Errors.Value;tt+=p,et+=p*p,ft+=b,kt+=b*b,st+=p*b}ht?(e=(h*st-tt*ft)/(h*et-tt*tt),at=(ft*et-tt*st)/(h*et-tt*tt)):(e=st/et,at=0),o=[],o[0]=[],o[0][0]=e,o[0][1]=at;if(w){o[1]=[],o[2]=[],o[3]=[],o[4]=[];var lt=h*et-tt*tt,bt=h*kt-ft*ft,yt=h*st-tt*ft,pt=kt-at*ft-e*st,wt=yt*yt/(lt*bt);h<3?(o[1][0]=n.Calc.Errors.Number,o[1][1]=n.Calc.Errors.Numbe
r,o[2][1]=n.Calc.Errors.Number,o[3][0]=n.Calc.Errors.Number):(o[1][0]=Math.sqrt(pt*h/(lt*(h-2))),o[1][1]=Math.sqrt(pt*et/(lt*(h-2))),o[2][1]=Math.sqrt((bt-yt*yt/lt)/(h*(h-2))),o[3][0]=wt===1?n.Calc.Errors.Number:wt*(h-2)/(1-wt)),o[2][0]=wt,o[3][1]=h-2,o[4][0]=bt/h-pt,o[4][1]=pt}return o}else if(y.getColumnCount()===1&&y.getRowCount()===a.getRowCount()||y.getRowCount()===1&&y.getColumnCount()===a.getColumnCount()){b=[],p=[];if(y.getColumnCount()===1){for(h=a.getRowCount(),e=a.getColumnCount(),r=0;r<h;r++){if(isNaN(it=l.toDouble(y.getValue(r,0))))return n.Calc.Errors.Value;b[r]=it}for(r=0;r<h;r++)for(p[r]=[],f=0;f<e;f++){if(isNaN(it=l.toDouble(a.getValue(r,f))))return n.Calc.Errors.Value;p[r][f]=it}}else{for(h=a.getColumnCount(),e=a.getRowCount(),p=[],b=[],r=0;r<h;r++){if(isNaN(it=l.toDouble(y.getValue(0,r))))return n.Calc.Errors.Value;b[r]=it}for(r=0;r<h;r++)for(p[r]=[],f=0;f<e;f++){if(isNaN(it=l.toDouble(a.getValue(f,r))))return n.Calc.Errors.Value;
p[r][f]=it}}for(s=[],u=0;u<e+1;u++)s[u]=[];for(v=0;v<e+1;v++)for(d=0;d<e+2;d++)s[v][d]=0;for(g=[],v=0;v<e+2;v++)g[v]=0;for(c=w?[]:null,u=0;u<h;u++)for(g[e+1]=g[e+1]+b[u]*b[u],s[0][e+1]=s[0][e+1]+b[u],g[0]=s[0][e+1],r=0;r<e;r++)for(s[0][r+1]=s[0][r+1]+p[u][r],s[r+1][0]=s[0][r+1],s[r+1][e+1]=s[r+1][e+1]+p[u][r]*b[u],g[r+1]=s[r+1][e+1],f=r;f<e;f++)s[f+1][r+1]=s[f+1][r+1]+p[u][r]*p[u][f],s[r+1][f+1]=s[f+1][r+1];s[0][0]=h;if(w){for(v=0;v<e+1;v++)for(c[v]=[],d=0;d<e+1;d++)c[v][d]=0;for(r=0;r<e+1;r++)c[r][r]=1}if(ht)for(r=0;r<e+1;r++){if(s[r][r]===0){for(ut=!1,f=r+1;!ut&&f<e+1;f++)if(s[f][r]!==0){for(u=0;u<e+2;u++)rt=s[r][u],s[r][u]=s[f][u],s[f][u]=rt;if(w)for(u=0;u<e+1;u++)rt=c[r][u],c[r][u]=c[f][u],c[f][u]=rt;ut=!0}if(!ut)return n.Calc.Errors.Number}for(k=1/s[r][r],u=0;u<e+2;u++)s[r][u]=s[r][u]*k;if(w)for(u=0;u<e+1;u++)c[r][u]=c[r][u]*k;for(f=0;f<e+1;f++)if(f!==r){for(k=-s[f][r],u=0;u<e+2;u++)s[f][u]=s[f][u]+k*s[r][u];if(w)for
(u=0;u<e+1;u++)c[f][u]=c[f][u]+k*c[r][u]}}else for(r=1;r<e+1;r++){if(s[r][r]===0){for(ut=!1,f=r+1;!ut&&f<e+1;f++)if(s[f][r]!==0){for(u=0;u<e+2;u++)rt=s[r][u],s[r][u]=s[f][u],s[f][u]=rt;if(w)for(u=0;u<e+1;u++)rt=c[r][u],c[r][u]=c[f][u],c[f][u]=rt;ut=!0}if(!ut)return n.Calc.Errors.Number}for(k=1/s[r][r],u=1;u<e+2;u++)s[r][u]=s[r][u]*k;if(w)for(u=1;u<e+1;u++)c[r][u]=c[r][u]*k;for(f=1;f<e+1;f++)if(f!==r){for(k=-s[f][r],u=1;u<e+2;u++)s[f][u]=s[f][u]+k*s[r][u];if(w)for(u=1;u<e+1;u++)c[f][u]=c[f][u]+k*c[r][u]}s[0][e+1]=0}for(o=[w?5:1,e+1],o[0]=[],r=0;r<e+1;r++)o[0][r]=s[e-r][e+1];if(w){for(v=1;v<5;v++)for(o[v]=[],d=0;d<e+1;d++)o[v][d]=0;for(vt=g[e+1]-g[0]*g[0]/h,nt=g[e+1],r=0;r<e+1;r++)nt-=s[r][e+1]*g[r];ct=vt-nt,o[2][0]=vt===0?n.Calc.Errors.Number:ct/vt,o[4][0]=ct,o[4][1]=nt;if(ht){if(h-e-1==0)for(o[2][1]=n.Calc.Errors.Number,r=0;r<e+1;r++)o[1][r]=n.Calc.Errors.Number;else{for(ot=nt/(h-e-1),r=0;r<e+1;r++)o[1][e-r]=Math.sqrt(ot*c[r][r
]);o[2][1]=Math.sqrt(ot)}o[3][0]=nt===0?n.Calc.Errors.Number:l.toDouble(h-e-1)*ct/(nt*l.toDouble(e)),o[3][1]=l.toDouble(h-e-1)}else{if(h-e==0){for(r=0;r<e+1;r++)o[1][r]=n.Calc.Errors.Number;o[2][1]=n.Calc.Errors.Number}else{for(ot=nt/l.toDouble(h-e),o[1][e]=n.Calc.Errors.NotAvailable,r=1;r<e+1;r++)o[1][e-r]=Math.sqrt(ot*c[r][r]);o[2][1]=Math.sqrt(ot)}o[3][0]=nt===0?n.Calc.Errors.Number:l.toDouble(h-e)*ct/(nt*l.toDouble(e)),o[3][1]=l.toDouble(h-e)}for(r=2;r<5;r++)for(f=2;f<e+1;f++)o[r][f]=n.Calc.Errors.NotAvailable}return o}return n.Calc.Errors.Number}function si(t){var p=t[0],w=t[1],y=0,i=0,l=0,v=0,o=0,r=n.Calc.Convert,e=n.Calc._ArrayHelper,a=e.getLength(t[0]),f,h,s,c,u;if(a!==e.getLength(t[1]))return n.Calc.Errors.NotAvailable;for(f=0;f<a;f++)h=e.getValueByIndex(p,f),s=e.getValueByIndex(w,f),r.isNumber(h)&&r.isNumber(s)&&(c=r.toDouble(h),u=r.toDouble(s),y+=c,i+=u,l+=u*u,v+=u*c,o++);return o*l-i*i==0?n.Calc.Errors.DivideByZero:r.toResult((o*v-i*y)/(o*l
-i*i))}function hi(t){for(var c=n.Calc.Convert,kt=n.Calc._Helper,a=c._toArray(t[0]),l=kt._argumentExists(t,1)?c._toArray(t[1]):a,ct=kt._argumentExists(t,2)?c.toBool(t[2]):!0,b=kt._argumentExists(t,3)?c.toBool(t[3]):!1,u,rt,r,f,s,v,y,p,tt,e,w,it,nt,ot,o,k,h,g,lt,st,i=0;i<a.getRowCount();i++)for(u=0;u<a.getColumnCount();u++)if(c.isError(a.getValue(i,u)))return a.getValue(i,u);else if(!c.isNumber(a.getValue(i,u)))return n.Calc.Errors.Value;for(i=0;i<l.getRowCount();i++)for(u=0;u<l.getColumnCount();u++)if(c.isError(l.getValue(i,u)))return l.getValue(i,u);else if(!c.isNumber(l.getValue(i,u)))return n.Calc.Errors.Value;if(a.getRowCount()===l.getRowCount()&&a.getColumnCount()===l.getColumnCount()&&(ct||!b)){s=l.getRowCount()*l.getColumnCount();var d=0,ft=0,ut=0,bt=0,et=0,ht;for(i=0;i<l.getRowCount();i++)for(u=0;u<l.getColumnCount();u++){if(isNaN(v=c.toDouble(l.getValue(i,u)))||isNaN(y=c.toDouble(a.getValue(i,u))))return n.Calc.Errors.Value;y=Math.log(y),d+
=v,ft+=v*v,ut+=y,bt+=y*y,et+=v*y}ct?(f=(s*et-d*ut)/(s*ft-d*d),ht=(ut*ft-d*et)/(s*ft-d*d)):(f=et/ft,ht=0),e=[],e[0]=[],e[0][0]=Math.exp(f),e[0][1]=Math.exp(ht);if(b){e[1]=[],e[2]=[],e[3]=[],e[4]=[];var yt=s*ft-d*d,wt=s*bt-ut*ut,vt=s*et-d*ut,pt=bt-ht*ut-f*et,at=vt*vt/(yt*wt);s<3?(e[1][0]=n.Calc.Errors.Number,e[1][1]=n.Calc.Errors.Number,e[2][1]=n.Calc.Errors.Number,e[3][0]=n.Calc.Errors.Number):(e[1][0]=Math.sqrt(pt*s/(yt*(s-2))),e[1][1]=Math.sqrt(pt*ft/(yt*(s-2))),e[2][1]=Math.sqrt((wt-vt*vt/yt)/(s*(s-2))),e[3][0]=at===1?n.Calc.Errors.Number:at*(s-2)/(1-at)),e[2][0]=at,e[3][1]=s-2,e[4][0]=wt/s-pt,e[4][1]=pt}return e}else if(a.getColumnCount()===1&&a.getRowCount()===l.getRowCount()||a.getRowCount()===1&&a.getColumnCount()===l.getColumnCount()){y=[],v=[];if(a.getColumnCount()===1){for(s=l.getRowCount(),f=l.getColumnCount(),i=0;i<s;i++){if(isNaN(rt=c.toDouble(a.getValue(i,0))))return n.Calc.Errors.Value;y[i]=Math.log(rt)}for(i=0;i<s;i++)for(v[i]=[],u=0;u<f;u+
+){if(isNaN(rt=c.toDouble(l.getValue(i,u))))return n.Calc.Errors.Value;v[i][u]=rt}}else{for(s=l.getColumnCount(),f=l.getRowCount(),v=[],y=[],i=0;i<s;i++){if(isNaN(rt=c.toDouble(a.getValue(0,i))))return n.Calc.Errors.Value;y[i]=Math.log(rt)}for(i=0;i<s;i++)for(v[i]=[],u=0;u<f;u++){if(isNaN(rt=c.toDouble(l.getValue(u,i))))return n.Calc.Errors.Value;v[i][u]=rt}}for(o=[],p=0;p<f+1;p++)for(o[p]=[],tt=0;tt<f+2;tt++)o[p][tt]=0;for(k=[],p=0;p<f+2;p++)k[p]=0;for(h=b?[]:null,r=0;r<s;r++)for(k[f+1]=k[f+1]+y[r]*y[r],o[0][f+1]=o[0][f+1]+y[r],k[0]=o[0][f+1],i=0;i<f;i++)for(o[0][i+1]=o[0][i+1]+v[r][i],o[i+1][0]=o[0][i+1],o[i+1][f+1]=o[i+1][f+1]+v[r][i]*y[r],k[i+1]=o[i+1][f+1],u=i;u<f;u++)o[u+1][i+1]=o[u+1][i+1]+v[r][i]*v[r][u],o[i+1][u+1]=o[u+1][i+1];o[0][0]=s;if(b){for(p=0;p<f+1;p++)for(h[p]=[],tt=0;tt<f+1;tt++)h[p][tt]=0;for(i=0;i<f+1;i++)h[i][i]=1}if(ct)for(i=0;i<f+1;i++){if(o[i][i]===0){for(nt=!1,u=i+1;!nt&&u<f+1;u++)if(o[u][i]!==0){for(r=0;r&l
t;f+2;r++)it=o[i][r],o[i][r]=o[u][r],o[u][r]=it;if(b)for(r=0;r<f+1;r++)it=h[i][r],h[i][r]=h[u][r],h[u][r]=it;nt=!0}if(!nt)return n.Calc.Errors.Number}for(w=1/o[i][i],r=0;r<f+2;r++)o[i][r]=o[i][r]*w;if(b)for(r=0;r<f+1;r++)h[i][r]=h[i][r]*w;for(u=0;u<f+1;u++)if(u!==i){for(w=-o[u][i],r=0;r<f+2;r++)o[u][r]=o[u][r]+w*o[i][r];if(b)for(r=0;r<f+1;r++)h[u][r]=h[u][r]+w*h[i][r]}}else for(i=1;i<f+1;i++){if(o[i][i]===0){for(nt=!1,u=i+1;!nt&&u<f+1;u++)if(o[u][i]!==0){for(r=0;r<f+2;r++)it=o[i][r],o[i][r]=o[u][r],o[u][r]=it;if(b)for(r=0;r<f+1;r++)it=h[i][r],h[i][r]=h[u][r],h[u][r]=it;nt=!0}if(!nt)return n.Calc.Errors.Number}for(w=1/o[i][i],r=1;r<f+2;r++)o[i][r]=o[i][r]*w;if(b)for(r=1;r<f+1;r++)h[i][r]=h[i][r]*w;for(u=1;u<f+1;u++)if(u!==i){for(w=-o[u][i],r=1;r<f+2;r++)o[u][r]=o[u][r]+w*o[i][r];if(b)for(r=1;r<f+1;r++)h[u][r]=h[u][r]+w*h[i][r]}o[0][f+1]=0}for(e=[],e[0]=[],i=0;i<f+1;i++)e[0][i]=Math.exp(o[f-i][f+1]);if(b){for(e[1]=[],e[2]=[],e[3]
=[],e[4]=[],lt=k[f+1]-k[0]*k[0]/s,g=k[f+1],i=0;i<f+1;i++)g-=o[i][f+1]*k[i];st=lt-g,e[2][0]=lt===0?n.Calc.Errors.Number:st/lt,e[4][0]=st,e[4][1]=g;if(ct){if(s-f-1==0)for(e[2][1]=n.Calc.Errors.Number,i=0;i<f+1;i++)e[1][i]=n.Calc.Errors.Number;else{for(ot=g/(s-f-1),i=0;i<f+1;i++)e[1][f-i]=Math.sqrt(ot*h[i][i]);e[2][1]=Math.sqrt(ot)}e[3][0]=g===0?n.Calc.Errors.Number:c.toDouble(s-f-1)*st/(g*c.toDouble(f)),e[3][1]=c.toDouble(s-f-1)}else{if(s-f==0){for(i=0;i<f+1;i++)e[1][i]=n.Calc.Errors.Number;e[2][1]=n.Calc.Errors.Number}else{for(ot=g/c.toDouble(s-f),e[1][f]=n.Calc.Errors.NotAvailable,i=1;i<f+1;i++)e[1][f-i]=Math.sqrt(ot*h[i][i]);e[2][1]=Math.sqrt(ot)}e[3][0]=g===0?n.Calc.Errors.Number:c.toDouble(s-f)*st/(g*c.toDouble(f)),e[3][1]=c.toDouble(s-f)}for(i=2;i<5;i++)for(u=2;u<f+1;u++)e[i][u]=n.Calc.Errors.NotAvailable}return e}return n.Calc.Errors.Number}function at(t){var h,s,c=0,y=0,r=0,v=0,a=0,i=0,u=n.Calc.Convert,l=n.Calc._ArrayHelper,p=l.getLength(t[0]),o,e,f;if(p!=
=l.getLength(t[1]))return n.Calc.Errors.NotAvailable;for(o=0;o<p;o++){e=l.getValueByIndex(t[0],o),f=l.getValueByIndex(t[1],o);if(u.isNumber(e)&&u.isNumber(f))s=u.toDouble(e),h=u.toDouble(f),c+=s,y+=s*s,r+=h,v+=h*h,a+=h*s,i++;else if(u.isError(e))return e;else if(u.isError(f))return f}return i*(i-2)==0?n.Calc.Errors.DivideByZero:i*v-r*r==0?n.Calc.Errors.DivideByZero:Math.sqrt((i*y-c*c-(i*a-r*c)*(i*a-r*c)/(i*v-r*r))/(i*(i-2)))}n.feature("calc.functions_stat",["calc.functions"]);var ef="undefined",c="boolean",l="string",ff=i._StatHelper.__dev1,u=i._StatHelper.st_normsdist,rr=i._StatHelper.__countIncludeSubtotals,au=i._StatHelper.__countaIncludeSubtotals,yu=i._StatHelper.__maxIncludeSubtotals,vu=i._StatHelper.__minIncludeSubtotals,eu=i._StatHelper.__stdevpIncludeSubtotals,ou=i._StatHelper.__varrIncludeSubtotals,hu=i._StatHelper.__varpIncludeSubtotals;i.def("MAX",su,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReferenc
e:i.acceptsAny}),i.def("MAXA",uu,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("MIN",pr,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("MINA",cr,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("LARGE",kr,{minArgs:2,maxArgs:2,acceptsArray:i.acceptsFirst,acceptsReference:i.acceptsFirst}),i.def("SMALL",dr,{minArgs:2,maxArgs:2,acceptsArray:i.acceptsFirst,acceptsReference:i.acceptsFirst}),i.def("AVERAGEA",br,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("AVERAGEIF",wr,{minArgs:2,maxArgs:3,acceptsMissingArgument:i.acceptsThird,acceptsArray:i.acceptsFirstOrThird,acceptsReference:i.acceptsFirstOrThird}),i.def("AVERAGEIFS",iu,{minArgs:3,acceptsArray:i.acceptsFirstOrOdd,acceptsReference:i.acceptsFirstOrOdd}),i.def("MEDIAN",ru,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny})
,i.def("MODE",tu,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("GEOMEAN",gr,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("HARMEAN",nu,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("TRIMMEAN",yr,{minArgs:2,maxArgs:2,acceptsArray:i.acceptsFirst,acceptsReference:i.acceptsFirst}),i.def("FREQUENCY",or,{minArgs:2,maxArgs:2,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("RANK",sr,{minArgs:2,maxArgs:3,acceptsMissingArgument:i.acceptsThird,acceptsArray:i.acceptsSecond,acceptsReference:i.acceptsSecond}),i.def("KURT",er,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("PERCENTRANK",ur,{minArgs:2,maxArgs:3,acceptsMissingArgument:i.acceptsThird,acceptsArray:i.acceptsFirst,acceptsReference:i.acceptsFirst}),i.def("QUARTILE",fr,{minArgs:2,maxArgs:2,acceptsArray:i.acceptsFirst,accep
tsReference:i.acceptsFirst}),i.def("COUNT",ar,{minArgs:1,acceptsError:i.acceptsAny,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("COUNTA",vr,{minArgs:1,acceptsError:i.acceptsAny,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("COUNTBLANK",lr,{minArgs:1,maxArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("COUNTIF",hr,{minArgs:2,maxArgs:2,acceptsArray:i.acceptsFirst,acceptsReference:i.acceptsFirst}),i.def("COUNTIFS",cu,{minArgs:2,acceptsArray:i.acceptsEven,acceptsReference:i.acceptsEven}),i.def("AVEDEV",ku,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("STDEVA",du,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("STDEVP",bu,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("STDEVPA",pu,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def(&quo
t;VAR",wu,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("VARA",gu,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("VARP",rf,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("VARPA",uf,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("COVAR",nf,{minArgs:2,maxArgs:2,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("DEVSQ",tf,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("CONFIDENCE",fu,{minArgs:3,maxArgs:3}),i.def("INTERCEPT",ai,{minArgs:2,maxArgs:2,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("LINEST",ci,{minArgs:1,maxArgs:4,acceptsReference:i.acceptsFirstOrOne,acceptsArray:i.acceptsFirstOrOne,acceptsMissingArgument:i.acceptsSecondOrThirdOrFourth}),i.def("SLOPE",si,{minArgs:2,maxArgs:2,acceptsArray:i.acceptsAny,acceptsRefe
rence:i.acceptsAny}),i.def("LOGEST",hi,{minArgs:1,maxArgs:4,acceptsReference:i.acceptsFirstOrOne,acceptsArray:i.acceptsFirstOrOne,acceptsMissingArgument:i.acceptsSecondOrThirdOrFourth}),i.def("STEYX",at,{minArgs:2,maxArgs:2,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("BETADIST",ct,{minArgs:3,maxArgs:5,acceptsMissingArgument:i.acceptsFourthOrFifth}),i.def("BETAINV",st,{minArgs:3,maxArgs:5,acceptsMissingArgument:i.acceptsFourthOrFifth}),i.def("BINOMDIST",dt,{minArgs:4,maxArgs:4}),i.def("NEGBINOMDIST",ti,{minArgs:3,maxArgs:3}),i.def("CRITBINOM",ni,{minArgs:3,maxArgs:3}),i.def("CHIDIST",k,{minArgs:2,maxArgs:2}),i.def("CHIINV",kt,{minArgs:2,maxArgs:2}),i.def("CHITEST",bt,{minArgs:2,maxArgs:2,acceptsReference:i.acceptsAny,acceptsArray:i.acceptsAny}),i.def("CORREL",wt,{minArgs:2,maxArgs:2,acceptsReference:i.acceptsAny,acceptsArray:i.acceptsAny}),i.def("EXPO
NDIST",gt,{minArgs:3,maxArgs:3}),i.def("FDIST",it,{minArgs:3,maxArgs:3}),i.def("FINV",yt,{minArgs:3,maxArgs:3}),i.def("FISHER",vt,{minArgs:1,maxArgs:1}),i.def("FISHERINV",pt,{minArgs:1,maxArgs:1}),i.def("FTEST",wi,{minArgs:2,maxArgs:2,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("GAMMADIST",d,{minArgs:4,maxArgs:4}),i.def("GAMMAINV",tt,{minArgs:3,maxArgs:3}),i.def("GAMMALN",f,{minArgs:1,maxArgs:1}),i.def("HYPGEOMDIST",bi,{minArgs:4,maxArgs:4}),i.def("LOGNORMDIST",pi,{minArgs:3,maxArgs:3}),i.def("LOGINV",vi,{minArgs:3,maxArgs:3}),i.def("NORMDIST",p,{minArgs:4,maxArgs:4}),i.def("NORMINV",b,{minArgs:3,maxArgs:3}),i.def("NORMSDIST",u,{minArgs:1,maxArgs:1}),i.def("NORMSINV",o,{minArgs:1,maxArgs:1}),i.def("PEARSON",yi,{minArgs:2,maxArgs:2,acceptsReference:i.acceptsAny,acceptsArray:i.acceptsAny}),i.def("R
SQ",ki,{minArgs:2,maxArgs:2,acceptsReference:i.acceptsFirstOrOne,acceptsArray:i.acceptsFirstOrOne}),i.def("POISSON",tr,{minArgs:3,maxArgs:3}),i.def("PROB",ir,{minArgs:3,maxArgs:4,acceptsMissingArgument:i.acceptsFourth,acceptsReference:i.acceptsFirstOrOne,acceptsArray:i.acceptsFirstOrOne}),i.def("SKEW",nr,{minArgs:1,acceptsArray:i.acceptsAny,acceptsReference:i.acceptsAny}),i.def("STANDARDIZE",di,{minArgs:3,maxArgs:3}),i.def("TDIST",gi,{minArgs:3,maxArgs:3}),i.def("TINV",fi,{minArgs:2,maxArgs:2}),i.def("TTEST",ii,{minArgs:4,maxArgs:4,acceptsReference:i.acceptsFirstOrOne,acceptsArray:i.acceptsFirstOrOne}),i.def("WEIBULL",oi,{minArgs:4,maxArgs:4}),i.def("ZTEST",ri,{minArgs:2,maxArgs:3,acceptsReference:i.acceptsFirst,acceptsArray:i.acceptsFirst,acceptsMissingArgument:i.acceptsThird}),i.def("PERMUT",li,{minArgs:2,maxArgs:2})})(t.Functions||(t.Functions={}));var i=t.Functions})(n.Calc||
(n.Calc={}));var t=n.Calc})(n.spread||(n.spread={}));var t=n.spread})(wijmo||(wijmo={}))
</del></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsincludesspreadjsjquerywijmowijspreadcss"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/jquery.wijmo.wijspread.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/jquery.wijmo.wijspread.css 2016-08-01 21:35:00 UTC (rev 3760)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/includes/spreadjs/jquery.wijmo.wijspread.css 2016-08-01 23:10:39 UTC (rev 3761)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,252 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/*
- *
- * SpreadJS Library 1.20133.8
- * http://wijmo.com/
- *
- * Copyright(c) GrapeCity, Inc. All rights reserved.
- *
- * Licensed under the Wijmo Commercial License. Also available under the GNU GPL Version 3 license.
- * licensing@wijmo.com
- * http://wijmo.com/widgets/license/
- *
- *
- **/
-#gc_filterTopMenu a.ui-state-hover
-{
- margin: -1px
-}
-div.ui-multiselect-filter input::-ms-clear
-{
- display: none
-}
-.ui-gciconset
-{
- background-image: url(images/iconset.png);
- display: none;
- width: 0;
- height: 0
-}
-.gradientButton
-{
- background-color: #ddd;/* fallback color if gradients are not supported */background-image: -webkit-linear-gradient(top,#f6fafb,#d2dbeb);/* For Chrome and Safari */background-image: -moz-linear-gradient(top,#f6fafb,#d2dbeb);/* For old Fx (3.6 to 15) */background-image: -ms-linear-gradient(top,#f6fafb,#d2dbeb);/* For pre-releases of IE 10*/background-image: -o-linear-gradient(top,#f6fafb,#d2dbeb);/* For old Opera (11.1 to 12.0) */background-image: linear-gradient(to bottom,#f6fafb,#d2dbeb);/* Standard syntax; must be last */}
-.sheetTabEditor::-ms-clear
-{
- display: none
-}
-.gc_filterActiveCheckItem input
-{
- outline: #292929 dotted thin
-}
-.ui-multiselect
-{
- padding: 2px 0 2px 4px;
- text-align: left
-}
-.ui-multiselect span.ui-icon
-{
- float: right
-}
-.ui-multiselect-single .ui-multiselect-checkboxes input
-{
- position: absolute !important;
- top: auto !important;
- left: -9999px
-}
-.ui-multiselect-single .ui-multiselect-checkboxes label
-{
- padding: 5px !important
-}
-.ui-multiselect-header
-{
- margin-bottom: 3px;
- padding: 3px 0 3px 4px;
- width: 187px
-}
-.ui-multiselect-header ul
-{
- font-size: .9em
-}
-.ui-multiselect-header ul li
-{
- float: left;
- padding: 0 9px 0 0
-}
-.ui-multiselect-header a
-{
- text-decoration: none
-}
-.ui-multiselect-header a:hover
-{
- text-decoration: underline
-}
-.ui-multiselect-header span.ui-icon
-{
- float: left
-}
-.ui-multiselect-header li.ui-multiselect-close
-{
- float: right;
- text-align: right;
- padding-right: 0
-}/*.ui-multiselect-menu { display:none; padding:3px; position:absolute; z-index:10000 }*/
-.ui-multiselect-menu
-{
- padding: 3px 2px 3px 3px
-}
-.ui-multiselect-checkboxes
-{
- position: relative;/* fixes bug in IE6/7 *//*height: 150px;*//*width: 191px;*/}
-.ui-multiselect-superpanel
-{
- position: relative;/* fixes bug in IE6/7 */height: 150px;
- width: 191px
-}
-.ui-multiselect-checkboxes label
-{
- cursor: default;
- display: block;
- border: 1px solid transparent;
- padding: 3px 1px
-}
-.ui-multiselect-checkboxes label input
-{
- position: relative;
- top: 1px
-}
-.ui-multiselect-checkboxes li
-{
- clear: both;
- font-size: .9em;
- padding-right: 3px
-}
-.ui-multiselect-checkboxes li.ui-multiselect-optgroup-label
-{
- text-align: center;
- font-weight: bold;
- border-bottom: 1px solid
-}
-.ui-multiselect-checkboxes li.ui-multiselect-optgroup-label a
-{
- display: block;
- padding: 3px;
- margin: 1px 0;
- text-decoration: none
-}/* remove label borders in IE6 because IE6 does not support transparency */
-* html .ui-multiselect-checkboxes label
-{
- border: none
-}
-.ui-multiselect-hasfilter ul
-{
- position: relative;
- top: 2px
-}
-.ui-multiselect-filter
-{
- float: left;
- margin-right: 10px;
- font-size: 11px
-}
-.ui-multiselect-filter input
-{
- width: 100px;
- font-size: 12px;
- margin-left: 0;
- height: 15px;
- padding: 2px;
- border: 1px solid #292929;
- -webkit-appearance: textfield;
- -webkit-box-sizing: content-box
-}/* SuperPanel
-----------------------------------*/
-.wijmo-wijsuperpanel
-{
- overflow: hidden;
- outline: none;
- background-image: none
-}
-.wijmo-wijsuperpanel-statecontainer
-{
- overflow: hidden;
- position: relative;
- zoom: 1
-}
-.wijmo-wijsuperpanel-contentwrapper
-{
- position: absolute;
- overflow: hidden
-}
-.wijmo-wijsuperpanel-hbarcontainer, .wijmo-wijsuperpanel-vbarcontainer
-{
- font-size: 0;
- border: 0
-}
-.wijmo-wijsuperpanel-templateouterwrapper
-{
- position: relative;/* overflow:auto; */zoom: 1
-}
-.wijmo-wijsuperpanel-vbarcontainer .ui-state-default, .wijmo-wijsuperpanel-hbarcontainer .ui-state-default
-{
- width: 16px;
- height: 16px;
- position: absolute
-}
-.wijmo-wijsuperpanel .wijmo-wijsuperpanel-vbarcontainer
-{
- position: absolute;
- width: 18px;
- padding-top: 18px;
- padding-bottom: 18px;
- border: none
-}
-.wijmo-wijsuperpanel .wijmo-wijsuperpanel-hbarcontainer
-{
- position: absolute;
- height: 18px;
- padding-left: 18px;
- padding-right: 18px;
- border: none
-}
-.wijmo-wijsuperpanel-handle
-{
- position: absolute;
- font-size: 0;
- overflow: hidden
-}
-.wijmo-wijsuperpanel-handle *
-{
- font-size: 0
-}
-.wijmo-wijsuperpanel-helper
-{
- border-style: dotted;
- background: transparent
-}
-.wijmo-wijsuperpanel-button
-{
- position: absolute;
- padding: 4px
-}
-.wijmo-wijsuperpanel .ui-icon-gripsmall-diagonal-se
-{
- background: none;
- width: 7px;
- height: 7px
-}
-.wijmo-wijsuperpanel-hbar-buttonleft
-{
- left: 0
-}
-.wijmo-wijsuperpanel-hbar-buttonright
-{
- right: 0
-}
-.wijmo-wijsuperpanel-vbar-buttontop
-{
- top: 0
-}
-.wijmo-wijsuperpanel-vbar-buttonbottom
-{
- bottom: 0
-}
-
</del></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsjavascriptwordcampspreadsheetsjs"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/javascript/wordcamp-spreadsheets.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/javascript/wordcamp-spreadsheets.js 2016-08-01 21:35:00 UTC (rev 3760)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/javascript/wordcamp-spreadsheets.js 2016-08-01 23:10:39 UTC (rev 3761)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,50 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-// Enable jQuery noConflict mode so SpreadJS doesn't crash
-var $ = jQuery.noConflict();
-
-
-/*
- * Manage client-side interactions with the spreadsheet
- */
-jQuery( document ).ready( function( $ ) {
-
- var WordCamp_Spreadsheets = {
-
- /**
- * Constructor
- */
- init: function () {
- this.renderSpreadsheet();
- this.registerEventHandlers();
- },
-
- /**
- * Register Event Handlers
- */
- renderSpreadsheet : function() {
- this.container = $( '#wcss_spreadsheet_container' );
- this.container.wijspread( { sheetCount: 1 } );
- this.spreadsheet = this.container.wijspread( 'spread' );
- this.spreadsheet.fromJSON( wcssSpreadSheetData );
- },
-
- /**
- * Register Event Handlers
- */
- registerEventHandlers : function() {
- $( document ).keyup( this.exportSpreadSheetData ); // todo look for better event to hook into. there should be something specific to spreadjs, when a cell changes
- },
-
- /**
- * Export the spreadsheet's data whenever it changes
- *
- * @param event
- */
- exportSpreadSheetData : function( event ) {
- wcssSpreadSheetData = JSON.stringify( WordCamp_Spreadsheets.spreadsheet.toJSON() );
- $( '#wcss_spreadsheet_data' ).val( wcssSpreadSheetData );
- }
-
- }; // end WordCamp_Spreadsheets
-
- WordCamp_Spreadsheets.init();
-} );
</del></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampspreadsheetsviewsspreadsheetcontainerphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/views/spreadsheet-container.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/views/spreadsheet-container.php 2016-08-01 21:35:00 UTC (rev 3760)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-spreadsheets/views/spreadsheet-container.php 2016-08-01 23:10:39 UTC (rev 3761)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,9 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<div id="wcss_spreadsheet_container"></div>
-
-<?php if ( is_admin() ) : ?>
- <input id="wcss_spreadsheet_data" name="wcss_spreadsheet_data" type="hidden" value="<?php echo esc_attr( json_encode( $spreadsheet_data ) ); ?>" />
-<?php endif; ?>
-
-<script type="text/javascript">
- var wcssSpreadSheetData = <?php echo json_encode( $spreadsheet_data ); ?>; <?php // todo make sure json_encode() is enough sanitization here and above ?>
-</script>
</del></span></pre>
</div>
</div>
</body>
</html>