2016-12-31 08:20:45 +00:00
/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
2017-03-31 21:46:02 +00:00
var XLSX = { } ; ( function make _xlsx ( XLSX ) { XLSX . version = "0.9.8" ; var current _codepage = 1200 , current _cptable ; if ( typeof module !== "undefined" && typeof require !== "undefined" ) { if ( typeof cptable === "undefined" ) cptable = require ( "./dist/cpexcel.js" ) ; current _cptable = cptable [ current _codepage ] } function reset _cp ( ) { set _cp ( 1200 ) } var set _cp = function ( cp ) { current _codepage = cp } ; function char _codes ( data ) { var o = [ ] ; for ( var i = 0 , len = data . length ; i < len ; ++ i ) o [ i ] = data . charCodeAt ( i ) ; return o } var debom = function ( data ) { var c1 = data . charCodeAt ( 0 ) , c2 = data . charCodeAt ( 1 ) ; if ( c1 == 255 && c2 == 254 ) return data . substr ( 2 ) ; if ( c1 == 254 && c2 == 255 ) return data . substr ( 2 ) ; if ( c1 == 65279 ) return data . substr ( 1 ) ; return data } ; var _getchar = function _gc1 ( x ) { return String . fromCharCode ( x ) } ; if ( typeof cptable !== "undefined" ) { set _cp = function ( cp ) { current _codepage = cp ; current _cptable = cptable [ cp ] } ; debom = function ( data ) { if ( data . charCodeAt ( 0 ) === 255 && data . charCodeAt ( 1 ) === 254 ) { return cptable . utils . decode ( 1200 , char _codes ( data . substr ( 2 ) ) ) } return data } ; _getchar = function _gc2 ( x ) { if ( current _codepage === 1200 ) return String . fromCharCode ( x ) ; return cptable . utils . decode ( current _codepage , [ x & 255 , x >> 8 ] ) [ 0 ] } } var Base64 = function make _b64 ( ) { var map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" ; return { encode : function ( input , utf8 ) { var o = "" ; var c1 , c2 , c3 , e1 , e2 , e3 , e4 ; for ( var i = 0 ; i < input . length ; ) { c1 = input . charCodeAt ( i ++ ) ; c2 = input . charCodeAt ( i ++ ) ; c3 = input . charCodeAt ( i ++ ) ; e1 = c1 >> 2 ; e2 = ( c1 & 3 ) << 4 | c2 >> 4 ; e3 = ( c2 & 15 ) << 2 | c3 >> 6 ; e4 = c3 & 63 ; if ( isNaN ( c2 ) ) { e3 = e4 = 64 } else if ( isNaN ( c3 ) ) { e4 = 64 } o += map . charAt ( e1 ) + map . charAt ( e2 ) + map . charAt ( e3 ) + map . charAt ( e4 ) } return o } , decode : function b64 _decode ( input , utf8 ) { var o = "" ; var c1 , c2 , c3 ; var e1 , e2 , e3 , e4 ; input = input . replace ( /[^A-Za-z0-9\+\/\=]/g , "" ) ; for ( var i = 0 ; i < input . length ; ) { e1 = map . indexOf ( input . charAt ( i ++ ) ) ; e2 = map . indexOf ( input . charAt ( i ++ ) ) ; e3 = map . indexOf ( input . charAt ( i ++ ) ) ; e4 = map . indexOf ( input . charAt ( i ++ ) ) ; c1 = e1 << 2 | e2 >> 4 ; c2 = ( e2 & 15 ) << 4 | e3 >> 2 ; c3 = ( e3 & 3 ) << 6 | e4 ; o += String . fromCharCode ( c1 ) ; if ( e3 != 64 ) { o += String . fromCharCode ( c2 ) } if ( e4 != 64 ) { o += String . fromCharCode ( c3 ) } } return o } } } ( ) ; var has _buf = typeof Buffer !== "undefined" ; function new _raw _buf ( len ) { return new ( has _buf ? Buffer : Array ) ( len ) } function s2a ( s ) { if ( has _buf ) return new Buffer ( s , "binary" ) ; return s . split ( "" ) . map ( function ( x ) { return x . charCodeAt ( 0 ) & 255 } ) } var bconcat = function ( bufs ) { return [ ] . concat . apply ( [ ] , bufs ) } ; var chr0 = /\u0000/g , chr1 = /[\u0001-\u0006]/ ; var SSF = { } ; var make _ssf = function make _ssf ( SSF ) { SSF . version = "0.9.0" ; function _strrev ( x ) { var o = "" , i = x . length - 1 ; while ( i >= 0 ) o += x . charAt ( i -- ) ; return o } function fill ( c , l ) { var o = "" ; while ( o . length < l ) o += c ; return o } function pad0 ( v , d ) { var t = "" + v ; return t . length >= d ? t : fill ( "0" , d - t . length ) + t } function pad _ ( v , d ) { var t = "" + v ; return t . length >= d ? t : fill ( " " , d - t . length ) + t } function rpad _ ( v , d ) { var t = "" + v ; return t . length >= d ? t : t + fill ( " " , d - t . length ) } function pad0r1 ( v , d ) { var t = "" + Math . round ( v ) ; return t . length >= d ? t : fill ( "0" , d - t . length ) + t } function pad0r2 ( v , d ) { var t = "" + v ; return t . length >= d ? t : fill ( "0" , d - t . length ) + t } var p2 _32 = Math . pow ( 2 , 32 ) ; function pad0r ( v , d ) { if ( v > p2 _32 || v < - p2 _32 ) return pad0r1 ( v , d ) ; var i = Math . round ( v ) ; return pad0r2 ( i , d ) } function isgeneral ( s , i ) { i = i || 0 ; return s . length >= 7 + i && ( s . charCodeAt ( i ) | 32 ) === 103 && ( s . charCodeAt ( i + 1 ) | 32 ) === 101 && ( s . charCodeAt ( i + 2 ) | 32 ) === 110 && ( s . charCodeAt ( i + 3 ) | 32 ) === 101 && ( s . charCodeAt ( i + 4 ) | 32 ) === 114 && ( s . charCodeAt ( i + 5 ) | 32 ) === 97 && ( s . charCodeAt ( i + 6 ) | 32 ) === 108 } var opts _fmt = [ [ "date1904" , 0 ] , [ "output" , "" ] , [ "WTF" , false ] ] ; function fixopts ( o ) { for ( var y = 0 ; y != opts _fmt . length ; ++ y ) if ( o [ opts _fmt [ y ] [ 0 ] ] === undefined ) o [ opts _fmt [ y ] [ 0 ] ] = opts _fmt [ y ] [ 1 ] } SSF . opts = opts _fmt ; var table _fmt = { 0 : "General" , 1 : "0" , 2 : "0.00" , 3 : "#,##0" , 4 : "#,##0.00" , 9 : "0%" , 10 : "0.00%" , 11 : "0.00E+00" , 12 : "# ?/?" , 13 : "# ??/??" , 14 : "m/d/yy" , 15 : "d-mmm-yy" , 16 : "d-mmm" , 17 : "mmm-yy" , 18 : "h:mm AM/PM" , 19 : "h:mm:ss AM/PM" , 20 : "h:mm" , 21 : "h:mm:ss" , 22 : "m/d/yy h:mm" , 37 : "#,##0 ;(#,##0)" , 38 : "#,##0 ;[Red](#,##0)" , 39 : "#,##0.00;(#,##0.00)" , 40 : "#,##0.00;[Red](#,##0.00)" , 45 : "mm:ss" , 46 : "[h]:mm:ss" , 47 : "mmss.0" , 48 : "##0.0E+0" , 49 : "@" , 56 : '"上午/下午 "hh"時"mm"分"ss"秒 "' , 65535 : "General" } ; var days = [ [ "Sun" , "Sunday" ] , [ "Mon" , "Monday" ] , [ "Tue" , "Tuesday" ] , [ "Wed" , "Wednesday" ] , [ "Thu" , " Thurs
dad [ R ] = dad [ i ] ; q . push ( R ) } } for ( i = 1 ; i !== pl ; ++ i ) if ( dad [ i ] === i ) { if ( R !== - 1 && dad [ R ] !== R ) dad [ i ] = dad [ R ] ; else if ( L !== - 1 && dad [ L ] !== L ) dad [ i ] = dad [ L ] } for ( i = 1 ; i < pl ; ++ i ) { if ( FI [ i ] . type === 0 ) continue ; j = dad [ i ] ; if ( j === 0 ) FP [ i ] = FP [ 0 ] + "/" + FP [ i ] ; else while ( j !== 0 ) { FP [ i ] = FP [ j ] + "/" + FP [ i ] ; j = dad [ j ] } dad [ i ] = 0 } FP [ 0 ] += "/" ; for ( i = 1 ; i < pl ; ++ i ) { if ( FI [ i ] . type !== 2 ) FP [ i ] += "/" ; FPD [ FP [ i ] ] = FI [ i ] } } function make _find _path ( FullPaths , Paths , FileIndex , files , root _name ) { var UCFullPaths = new Array ( FullPaths . length ) ; var UCPaths = new Array ( Paths . length ) , i ; for ( i = 0 ; i < FullPaths . length ; ++ i ) UCFullPaths [ i ] = FullPaths [ i ] . toUpperCase ( ) . replace ( chr0 , "" ) . replace ( chr1 , "!" ) ; for ( i = 0 ; i < Paths . length ; ++ i ) UCPaths [ i ] = Paths [ i ] . toUpperCase ( ) . replace ( chr0 , "" ) . replace ( chr1 , "!" ) ; return function find _path ( path ) { var k ; if ( path . charCodeAt ( 0 ) === 47 ) { k = true ; path = root _name + path } else k = path . indexOf ( "/" ) !== - 1 ; var UCPath = path . toUpperCase ( ) . replace ( chr0 , "" ) . replace ( chr1 , "!" ) ; var w = k === true ? UCFullPaths . indexOf ( UCPath ) : UCPaths . indexOf ( UCPath ) ; if ( w === - 1 ) return null ; return k === true ? FileIndex [ w ] : files [ Paths [ w ] ] } } function sleuth _fat ( idx , cnt , sectors , ssz , fat _addrs ) { var q ; if ( idx === ENDOFCHAIN ) { if ( cnt !== 0 ) throw new Error ( "DIFAT chain shorter than expected" ) } else if ( idx !== - 1 ) { var sector = sectors [ idx ] , m = ( ssz >>> 2 ) - 1 ; if ( ! sector ) return ; for ( var i = 0 ; i < m ; ++ i ) { if ( ( q = _ _readInt32LE ( sector , i * 4 ) ) === ENDOFCHAIN ) break ; fat _addrs . push ( q ) } sleuth _fat ( _ _readInt32LE ( sector , ssz - 4 ) , cnt - 1 , sectors , ssz , fat _addrs ) } } function get _sector _list ( sectors , start , fat _addrs , ssz , chkd ) { var sl = sectors . length ; var buf , buf _chain ; if ( ! chkd ) chkd = new Array ( sl ) ; var modulus = ssz - 1 , j , jj ; buf = [ ] ; buf _chain = [ ] ; for ( j = start ; j >= 0 ; ) { chkd [ j ] = true ; buf [ buf . length ] = j ; buf _chain . push ( sectors [ j ] ) ; var addr = fat _addrs [ Math . floor ( j * 4 / ssz ) ] ; jj = j * 4 & modulus ; if ( ssz < 4 + jj ) throw new Error ( "FAT boundary crossed: " + j + " 4 " + ssz ) ; if ( ! sectors [ addr ] ) break ; j = _ _readInt32LE ( sectors [ addr ] , jj ) } return { nodes : buf , data : _ _toBuffer ( [ buf _chain ] ) } } function make _sector _list ( sectors , dir _start , fat _addrs , ssz ) { var sl = sectors . length , sector _list = new Array ( sl ) ; var chkd = new Array ( sl ) , buf , buf _chain ; var modulus = ssz - 1 , i , j , k , jj ; for ( i = 0 ; i < sl ; ++ i ) { buf = [ ] ; k = i + dir _start ; if ( k >= sl ) k -= sl ; if ( chkd [ k ] === true ) continue ; buf _chain = [ ] ; for ( j = k ; j >= 0 ; ) { chkd [ j ] = true ; buf [ buf . length ] = j ; buf _chain . push ( sectors [ j ] ) ; var addr = fat _addrs [ Math . floor ( j * 4 / ssz ) ] ; jj = j * 4 & modulus ; if ( ssz < 4 + jj ) throw new Error ( "FAT boundary crossed: " + j + " 4 " + ssz ) ; if ( ! sectors [ addr ] ) break ; j = _ _readInt32LE ( sectors [ addr ] , jj ) } sector _list [ k ] = { nodes : buf , data : _ _toBuffer ( [ buf _chain ] ) } } return sector _list } function read _directory ( dir _start , sector _list , sectors , Paths , nmfs , files , FileIndex ) { var blob ; var minifat _store = 0 , pl = Paths . length ? 2 : 0 ; var sector = sector _list [ dir _start ] . data ; var i = 0 , namelen = 0 , name , o , ctime , mtime ; for ( ; i < sector . length ; i += 128 ) { blob = sector . slice ( i , i + 128 ) ; prep _blob ( blob , 64 ) ; namelen = blob . read _shift ( 2 ) ; if ( namelen === 0 ) continue ; name = _ _utf16le ( blob , 0 , namelen - pl ) ; Paths . push ( name ) ; o = { name : name , type : blob . read _shift ( 1 ) , color : blob . read _shift ( 1 ) , L : blob . read _shift ( 4 , "i" ) , R : blob . read _shift ( 4 , "i" ) , C : blob . read _shift ( 4 , "i" ) , clsid : blob . read _shift ( 16 ) , state : blob . read _shift ( 4 , "i" ) } ; ctime = blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) ; if ( ctime !== 0 ) { o . ctime = ctime ; o . ct = read _date ( blob , blob . l - 8 ) } mtime = blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) ; if ( mtime !== 0 ) { o . mtime = mtime ; o . mt = read _date ( blob , blob . l - 8 ) } o . start = blob . read _shift ( 4 , "i" ) ; o . size = blob . read _shift ( 4 , "i" ) ; if ( o . type === 5 ) { minifat _store = o . start ; if ( nmfs > 0 && minifat _store !== ENDOFCHAIN ) sector _list [ minifat _store ] . name = "!StreamData" } else if ( o . size >= 4096 ) { o . storage = "fat" ; if ( sector _list [ o . start ] === undefined ) sector _list [ o . start ] = get _sector _list ( sectors , o . start , sector _list . fat _addrs , sector _list . ssz ) ; sector _list [ o . start ] . name = o . name ; o . content = sector _list [ o . start ] . data . slice ( 0 , o . size ) ; prep _blob ( o . content , 0 ) } else { o . storage = "minifat" ; if ( minifat _store !== ENDOFCHAIN && o . start !== ENDOFCHAIN ) { o . content = sector _list [ minifat _store ] . data . slice ( o . start * MSSZ , o . start * MSSZ + o . size ) ; prep _blob ( o . content , 0 ) } } files [ name ] = o ; FileIndex . push ( o ) } } function read _date ( blob , offset ) { return new Date ( ( _ _readUInt32LE ( blob , offset + 4 ) / 1e7 * Math . pow ( 2
n : "LastPrinted" , t : VT _FILETIME } , 12 : { n : "CreatedDate" , t : VT _FILETIME } , 13 : { n : "ModifiedDate" , t : VT _FILETIME } , 14 : { n : "PageCount" , t : VT _I4 } , 15 : { n : "WordCount" , t : VT _I4 } , 16 : { n : "CharCount" , t : VT _I4 } , 17 : { n : "Thumbnail" , t : VT _CF } , 18 : { n : "ApplicationName" , t : VT _LPSTR } , 19 : { n : "DocumentSecurity" , t : VT _I4 } , 255 : { } } ; var SpecialProperties = { 2147483648 : { n : "Locale" , t : VT _UI4 } , 2147483651 : { n : "Behavior" , t : VT _UI4 } , 1919054434 : { } } ; ( function ( ) { for ( var y in SpecialProperties ) if ( SpecialProperties . hasOwnProperty ( y ) ) DocSummaryPIDDSI [ y ] = SummaryPIDSI [ y ] = SpecialProperties [ y ] } ) ( ) ; var CountryEnum = { 1 : "US" , 2 : "CA" , 3 : "" , 7 : "RU" , 20 : "EG" , 30 : "GR" , 31 : "NL" , 32 : "BE" , 33 : "FR" , 34 : "ES" , 36 : "HU" , 39 : "IT" , 41 : "CH" , 43 : "AT" , 44 : "GB" , 45 : "DK" , 46 : "SE" , 47 : "NO" , 48 : "PL" , 49 : "DE" , 52 : "MX" , 55 : "BR" , 61 : "AU" , 64 : "NZ" , 66 : "TH" , 81 : "JP" , 82 : "KR" , 84 : "VN" , 86 : "CN" , 90 : "TR" , 105 : "JS" , 213 : "DZ" , 216 : "MA" , 218 : "LY" , 351 : "PT" , 354 : "IS" , 358 : "FI" , 420 : "CZ" , 886 : "TW" , 961 : "LB" , 962 : "JO" , 963 : "SY" , 964 : "IQ" , 965 : "KW" , 966 : "SA" , 971 : "AE" , 972 : "IL" , 974 : "QA" , 981 : "IR" , 65535 : "US" } ; var XLSFillPattern = [ null , "solid" , "mediumGray" , "darkGray" , "lightGray" , "darkHorizontal" , "darkVertical" , "darkDown" , "darkUp" , "darkGrid" , "darkTrellis" , "lightHorizontal" , "lightVertical" , "lightDown" , "lightUp" , "lightGrid" , "lightTrellis" , "gray125" , "gray0625" ] ; function rgbify ( arr ) { return arr . map ( function ( x ) { return [ x >> 16 & 255 , x >> 8 & 255 , x & 255 ] } ) } var XLSIcv = rgbify ( [ 0 , 16777215 , 16711680 , 65280 , 255 , 16776960 , 16711935 , 65535 , 0 , 16777215 , 16711680 , 65280 , 255 , 16776960 , 16711935 , 65535 , 8388608 , 32768 , 128 , 8421376 , 8388736 , 32896 , 12632256 , 8421504 , 10066431 , 10040166 , 16777164 , 13434879 , 6684774 , 16744576 , 26316 , 13421823 , 128 , 16711935 , 16776960 , 65535 , 8388736 , 8388608 , 32896 , 255 , 52479 , 13434879 , 13434828 , 16777113 , 10079487 , 16751052 , 13408767 , 16764057 , 3368703 , 3394764 , 10079232 , 16763904 , 16750848 , 16737792 , 6710937 , 9868950 , 13158 , 3381606 , 13056 , 3355392 , 10040064 , 10040166 , 3355545 , 3355443 , 16777215 , 0 ] ) ; var ct2type = { "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" : "workbooks" , "application/vnd.ms-excel.binIndexWs" : "TODO" , "application/vnd.ms-excel.intlmacrosheet" : "TODO" , "application/vnd.ms-excel.binIndexMs" : "TODO" , "application/vnd.openxmlformats-package.core-properties+xml" : "coreprops" , "application/vnd.openxmlformats-officedocument.custom-properties+xml" : "custprops" , "application/vnd.openxmlformats-officedocument.extended-properties+xml" : "extprops" , "application/vnd.openxmlformats-officedocument.customXmlProperties+xml" : "TODO" , "application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty" : "TODO" , "application/vnd.ms-excel.comments" : "comments" , "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml" : "comments" , "application/vnd.ms-excel.pivotTable" : "TODO" , "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml" : "TODO" , "application/vnd.ms-office.chartcolorstyle+xml" : "TODO" , "application/vnd.ms-office.chartstyle+xml" : "TODO" , "application/vnd.ms-excel.calcChain" : "calcchains" , "application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml" : "calcchains" , "application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings" : "TODO" , "application/vnd.ms-office.activeX" : "TODO" , "application/vnd.ms-office.activeX+xml" : "TODO" , "application/vnd.ms-excel.attachedToolbars" : "TODO" , "application/vnd.ms-excel.connections" : "TODO" , "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml" : "TODO" , "application/vnd.ms-excel.externalLink" : "TODO" , "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml" : "TODO" , "application/vnd.ms-excel.sheetMetadata" : "TODO" , "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml" : "TODO" , "application/vnd.ms-excel.pivotCacheDefinition" : "TODO" , "application/vnd.ms-excel.pivotCacheRecords" : "TODO" , "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml" : "TODO" , "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml" : "TODO" , "application/vnd.ms-excel.queryTable" : "TODO" , "application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml" : "TODO" , "application/vnd.ms-excel.userNames" : "TODO" , " application / vnd . ms - excel . revision
if ( ( flags & 257 ) === 257 ) moniker = parse _HyperlinkString ( blob , end - blob . l ) ; if ( ( flags & 257 ) === 1 ) oleMoniker = parse _HyperlinkMoniker ( blob , end - blob . l ) ; if ( flags & 8 ) location = parse _HyperlinkString ( blob , end - blob . l ) ; if ( flags & 32 ) guid = blob . read _shift ( 16 ) ; if ( flags & 64 ) fileTime = parse _FILETIME ( blob , 8 ) ; blob . l = end ; var target = targetFrameName || moniker || oleMoniker ; if ( location ) target += "#" + location ; return { Target : target } } ; function parse _LongRGBA ( blob , length ) { var r = blob . read _shift ( 1 ) , g = blob . read _shift ( 1 ) , b = blob . read _shift ( 1 ) , a = blob . read _shift ( 1 ) ; return [ r , g , b , a ] } function parse _LongRGB ( blob , length ) { var x = parse _LongRGBA ( blob , length ) ; x [ 3 ] = 0 ; return x } function parse _XLSCell ( blob , length ) { var rw = blob . read _shift ( 2 ) ; var col = blob . read _shift ( 2 ) ; var ixfe = blob . read _shift ( 2 ) ; return { r : rw , c : col , ixfe : ixfe } } function parse _frtHeader ( blob ) { var rt = blob . read _shift ( 2 ) ; var flags = blob . read _shift ( 2 ) ; blob . l += 8 ; return { type : rt , flags : flags } } function parse _OptXLUnicodeString ( blob , length , opts ) { return length === 0 ? "" : parse _XLUnicodeString2 ( blob , length , opts ) } var HIDEOBJENUM = [ "SHOWALL" , "SHOWPLACEHOLDER" , "HIDEALL" ] ; var parse _HideObjEnum = parseuint16 ; function parse _XTI ( blob , length ) { var iSupBook = blob . read _shift ( 2 ) , itabFirst = blob . read _shift ( 2 , "i" ) , itabLast = blob . read _shift ( 2 , "i" ) ; return [ iSupBook , itabFirst , itabLast ] } function parse _RkRec ( blob , length ) { var ixfe = blob . read _shift ( 2 ) ; var RK = parse _RkNumber ( blob ) ; return [ ixfe , RK ] } function parse _AddinUdf ( blob , length , opts ) { blob . l += 4 ; length -= 4 ; var l = blob . l + length ; var udfName = parse _ShortXLUnicodeString ( blob , length , opts ) ; var cb = blob . read _shift ( 2 ) ; l -= blob . l ; if ( cb !== l ) throw new Error ( "Malformed AddinUdf: padding = " + l + " != " + cb ) ; blob . l += cb ; return udfName } function parse _Ref8U ( blob , length ) { var rwFirst = blob . read _shift ( 2 ) ; var rwLast = blob . read _shift ( 2 ) ; var colFirst = blob . read _shift ( 2 ) ; var colLast = blob . read _shift ( 2 ) ; return { s : { c : colFirst , r : rwFirst } , e : { c : colLast , r : rwLast } } } function parse _RefU ( blob , length ) { var rwFirst = blob . read _shift ( 2 ) ; var rwLast = blob . read _shift ( 2 ) ; var colFirst = blob . read _shift ( 1 ) ; var colLast = blob . read _shift ( 1 ) ; return { s : { c : colFirst , r : rwFirst } , e : { c : colLast , r : rwLast } } } var parse _Ref = parse _RefU ; function parse _FtCmo ( blob , length ) { blob . l += 4 ; var ot = blob . read _shift ( 2 ) ; var id = blob . read _shift ( 2 ) ; var flags = blob . read _shift ( 2 ) ; blob . l += 12 ; return [ id , ot , flags ] } function parse _FtNts ( blob , length ) { var out = { } ; blob . l += 4 ; blob . l += 16 ; out . fSharedNote = blob . read _shift ( 2 ) ; blob . l += 4 ; return out } function parse _FtCf ( blob , length ) { var out = { } ; blob . l += 4 ; blob . cf = blob . read _shift ( 2 ) ; return out } var FtTab = { 21 : parse _FtCmo , 19 : parsenoop , 18 : function ( blob , length ) { blob . l += 12 } , 17 : function ( blob , length ) { blob . l += 8 } , 16 : parsenoop , 15 : parsenoop , 13 : parse _FtNts , 12 : function ( blob , length ) { blob . l += 24 } , 11 : function ( blob , length ) { blob . l += 10 } , 10 : function ( blob , length ) { blob . l += 16 } , 9 : parsenoop , 8 : function ( blob , length ) { blob . l += 6 } , 7 : parse _FtCf , 6 : function ( blob , length ) { blob . l += 6 } , 4 : parsenoop , 0 : function ( blob , length ) { blob . l += 4 } } ; function parse _FtArray ( blob , length , ot ) { var s = blob . l ; var fts = [ ] ; while ( blob . l < s + length ) { var ft = blob . read _shift ( 2 ) ; blob . l -= 2 ; try { fts . push ( FtTab [ ft ] ( blob , s + length - blob . l ) ) } catch ( e ) { blob . l = s + length ; return fts } } if ( blob . l != s + length ) blob . l = s + length ; return fts } var parse _FontIndex = parseuint16 ; function parse _BOF ( blob , length ) { var o = { BIFFVer : 0 , dt : 0 } ; o . BIFFVer = blob . read _shift ( 2 ) ; length -= 2 ; if ( length >= 2 ) { o . dt = blob . read _shift ( 2 ) ; blob . l -= 2 } switch ( o . BIFFVer ) { case 1536 : case 1280 : case 2 : case 7 : break ; default : if ( length > 6 ) throw new Error ( "Unexpected BIFF Ver " + o . BIFFVer ) } blob . read _shift ( length ) ; return o } function parse _InterfaceHdr ( blob , length ) { if ( length === 0 ) return 1200 ; var q ; if ( ( q = blob . read _shift ( 2 ) ) !== 1200 ) { } return 1200 } function parse _WriteAccess ( blob , length , opts ) { if ( opts . enc ) { blob . l += length ; return "" } var l = blob . l ; var UserName = parse _XLUnicodeString ( blob , 0 , opts ) ; blob . read _shift ( length + l - blob . l ) ; return UserName } function parse _BoundSheet8 ( blob , length , opts ) { var pos = blob . read _shift ( 4 ) ; var hidden = blob . read _shift ( 1 ) & 3 ; var dt = blob . read _shift ( 1 ) ; switch ( dt ) { case 0 : dt = "Worksheet" ; break ; case 1 : dt = "Macrosheet" ; break ; case 2 : dt = "Chartsheet" ; break ; case 6 : dt = "VBAModule" ; break } var name = parse _ShortXLUnicodeString ( blob , 0 , opts ) ; if ( name . length === 0 ) name = "
write _record ( ba , "BrtEndSst" ) ; return ba . end ( ) } function _JS2ANSI ( str ) { if ( typeof cptable !== "undefined" ) return cptable . utils . encode ( 1252 , str ) ; var o = [ ] , oo = str . split ( "" ) ; for ( var i = 0 ; i < oo . length ; ++ i ) o [ i ] = oo [ i ] . charCodeAt ( 0 ) ; return o } function parse _Version ( blob , length ) { var o = { } ; o . Major = blob . read _shift ( 2 ) ; o . Minor = blob . read _shift ( 2 ) ; return o } function parse _EncryptionHeader ( blob , length ) { var o = { } ; o . Flags = blob . read _shift ( 4 ) ; var tmp = blob . read _shift ( 4 ) ; if ( tmp !== 0 ) throw "Unrecognized SizeExtra: " + tmp ; o . AlgID = blob . read _shift ( 4 ) ; switch ( o . AlgID ) { case 0 : case 26625 : case 26126 : case 26127 : case 26128 : break ; default : throw "Unrecognized encryption algorithm: " + o . AlgID } parsenoop ( blob , length - 12 ) ; return o } function parse _EncryptionVerifier ( blob , length ) { return parsenoop ( blob , length ) } function parse _RC4CryptoHeader ( blob , length ) { var o = { } ; var vers = o . EncryptionVersionInfo = parse _Version ( blob , 4 ) ; length -= 4 ; if ( vers . Minor != 2 ) throw "unrecognized minor version code: " + vers . Minor ; if ( vers . Major > 4 || vers . Major < 2 ) throw "unrecognized major version code: " + vers . Major ; o . Flags = blob . read _shift ( 4 ) ; length -= 4 ; var sz = blob . read _shift ( 4 ) ; length -= 4 ; o . EncryptionHeader = parse _EncryptionHeader ( blob , sz ) ; length -= sz ; o . EncryptionVerifier = parse _EncryptionVerifier ( blob , length ) ; return o } function parse _RC4Header ( blob , length ) { var o = { } ; var vers = o . EncryptionVersionInfo = parse _Version ( blob , 4 ) ; length -= 4 ; if ( vers . Major != 1 || vers . Minor != 1 ) throw "unrecognized version code " + vers . Major + " : " + vers . Minor ; o . Salt = blob . read _shift ( 16 ) ; o . EncryptedVerifier = blob . read _shift ( 16 ) ; o . EncryptedVerifierHash = blob . read _shift ( 16 ) ; return o } function crypto _CreatePasswordVerifier _Method1 ( Password ) { var Verifier = 0 , PasswordArray ; var PasswordDecoded = _JS2ANSI ( Password ) ; var len = PasswordDecoded . length + 1 , i , PasswordByte ; var Intermediate1 , Intermediate2 , Intermediate3 ; PasswordArray = new _raw _buf ( len ) ; PasswordArray [ 0 ] = PasswordDecoded . length ; for ( i = 1 ; i != len ; ++ i ) PasswordArray [ i ] = PasswordDecoded [ i - 1 ] ; for ( i = len - 1 ; i >= 0 ; -- i ) { PasswordByte = PasswordArray [ i ] ; Intermediate1 = ( Verifier & 16384 ) === 0 ? 0 : 1 ; Intermediate2 = Verifier << 1 & 32767 ; Intermediate3 = Intermediate1 | Intermediate2 ; Verifier = Intermediate3 ^ PasswordByte } return Verifier ^ 52811 } var crypto _CreateXorArray _Method1 = function ( ) { var PadArray = [ 187 , 255 , 255 , 186 , 255 , 255 , 185 , 128 , 0 , 190 , 15 , 0 , 191 , 15 , 0 ] ; var InitialCode = [ 57840 , 7439 , 52380 , 33984 , 4364 , 3600 , 61902 , 12606 , 6258 , 57657 , 54287 , 34041 , 10252 , 43370 , 20163 ] ; var XorMatrix = [ 44796 , 19929 , 39858 , 10053 , 20106 , 40212 , 10761 , 31585 , 63170 , 64933 , 60267 , 50935 , 40399 , 11199 , 17763 , 35526 , 1453 , 2906 , 5812 , 11624 , 23248 , 885 , 1770 , 3540 , 7080 , 14160 , 28320 , 56640 , 55369 , 41139 , 20807 , 41614 , 21821 , 43642 , 17621 , 28485 , 56970 , 44341 , 19019 , 38038 , 14605 , 29210 , 60195 , 50791 , 40175 , 10751 , 21502 , 43004 , 24537 , 18387 , 36774 , 3949 , 7898 , 15796 , 31592 , 63184 , 47201 , 24803 , 49606 , 37805 , 14203 , 28406 , 56812 , 17824 , 35648 , 1697 , 3394 , 6788 , 13576 , 27152 , 43601 , 17539 , 35078 , 557 , 1114 , 2228 , 4456 , 30388 , 60776 , 51953 , 34243 , 7079 , 14158 , 28316 , 14128 , 28256 , 56512 , 43425 , 17251 , 34502 , 7597 , 13105 , 26210 , 52420 , 35241 , 883 , 1766 , 3532 , 4129 , 8258 , 16516 , 33032 , 4657 , 9314 , 18628 ] ; var Ror = function ( Byte ) { return ( Byte / 2 | Byte * 128 ) & 255 } ; var XorRor = function ( byte1 , byte2 ) { return Ror ( byte1 ^ byte2 ) } ; var CreateXorKey _Method1 = function ( Password ) { var XorKey = InitialCode [ Password . length - 1 ] ; var CurrentElement = 104 ; for ( var i = Password . length - 1 ; i >= 0 ; -- i ) { var Char = Password [ i ] ; for ( var j = 0 ; j != 7 ; ++ j ) { if ( Char & 64 ) XorKey ^= XorMatrix [ CurrentElement ] ; Char *= 2 ; -- CurrentElement } } return XorKey } ; return function ( password ) { var Password = _JS2ANSI ( password ) ; var XorKey = CreateXorKey _Method1 ( Password ) ; var Index = Password . length ; var ObfuscationArray = new _raw _buf ( 16 ) ; for ( var i = 0 ; i != 16 ; ++ i ) ObfuscationArray [ i ] = 0 ; var Temp , PasswordLastChar , PadIndex ; if ( ( Index & 1 ) === 1 ) { Temp = XorKey >> 8 ; ObfuscationArray [ Index ] = XorRor ( PadArray [ 0 ] , Temp ) ; -- Index ; Temp = XorKey & 255 ; PasswordLastChar = Password [ Password . length - 1 ] ; ObfuscationArray [ Index ] = XorRor ( PasswordLastChar , Temp ) } while ( Index > 0 ) { -- Index ; Temp = XorKey >> 8 ; ObfuscationArray [ Index ] = XorRor ( Password [ Index ] , Temp ) ; -- Index ; Temp = XorKey & 255 ; ObfuscationArray [ Index ] = XorRor ( Password [ Index ] , Temp ) } Index = 15 ; PadIndex = 15 - Password . length ; while ( PadIndex > 0 ) { Temp = XorKey >> 8 ; ObfuscationArray [ Index ] = XorRor ( PadArray [ PadIndex ] , Temp ) ; -- Inde
} function parse _ExtProp ( blob , length ) { var extType = blob . read _shift ( 2 ) ; var cb = blob . read _shift ( 2 ) ; var o = [ extType ] ; switch ( extType ) { case 4 : case 5 : case 7 : case 8 : case 9 : case 10 : case 11 : case 13 : o [ 1 ] = parse _FullColorExt ( blob , cb ) ; break ; case 6 : o [ 1 ] = parse _XFExtGradient ( blob , cb ) ; break ; case 14 : case 15 : o [ 1 ] = blob . read _shift ( cb === 5 ? 1 : 2 ) ; break ; default : throw new Error ( "Unrecognized ExtProp type: " + extType + " " + cb ) } return o } function parse _XFExt ( blob , length ) { var end = blob . l + length ; blob . l += 2 ; var ixfe = blob . read _shift ( 2 ) ; blob . l += 2 ; var cexts = blob . read _shift ( 2 ) ; var ext = [ ] ; while ( cexts -- > 0 ) ext . push ( parse _ExtProp ( blob , end - blob . l ) ) ; return { ixfe : ixfe , ext : ext } } function update _xfext ( xf , xfext ) { xfext . forEach ( function ( xfe ) { switch ( xfe [ 0 ] ) { case 4 : break ; case 5 : break ; case 6 : break ; case 7 : break ; case 8 : break ; case 9 : break ; case 10 : break ; case 11 : break ; case 13 : break ; case 14 : break ; case 15 : break } } ) } function parse _cc _xml ( data , opts ) { var d = [ ] ; if ( ! data ) return d ; var l = 0 , i = 1 ; ( data . match ( tagregex ) || [ ] ) . forEach ( function ( x ) { var y = parsexmltag ( x ) ; switch ( y [ 0 ] ) { case "<?xml" : break ; case "<calcChain" : case "<calcChain>" : case "</calcChain>" : break ; case "<c" : delete y [ 0 ] ; if ( y . i ) i = y . i ; else y . i = i ; d . push ( y ) ; break } } ) ; return d } function write _cc _xml ( data , opts ) { } function parse _BrtCalcChainItem$ ( data , length ) { var out = { } ; out . i = data . read _shift ( 4 ) ; var cell = { } ; cell . r = data . read _shift ( 4 ) ; cell . c = data . read _shift ( 4 ) ; out . r = encode _cell ( cell ) ; var flags = data . read _shift ( 1 ) ; if ( flags & 2 ) out . l = "1" ; if ( flags & 8 ) out . a = "1" ; return out } function parse _cc _bin ( data , opts ) { var out = [ ] ; var pass = false ; recordhopper ( data , function hopper _cc ( val , R , RT ) { switch ( R . n ) { case "BrtCalcChainItem$" : out . push ( val ) ; break ; case "BrtBeginCalcChain$" : break ; case "BrtEndCalcChain$" : break ; default : if ( ! pass || opts . WTF ) throw new Error ( "Unexpected record " + RT + " " + R . n ) } } ) ; return out } function write _cc _bin ( data , opts ) { } function parse _drawing ( data , rels ) { if ( ! data ) return "??" ; var id = ( data . match ( /<c:chart [^>]*r:id="([^"]*)"/ ) || [ "" , "" ] ) [ 1 ] ; return rels [ "!id" ] [ id ] . Target } function parse _comments ( zip , dirComments , sheets , sheetRels , opts ) { for ( var i = 0 ; i != dirComments . length ; ++ i ) { var canonicalpath = dirComments [ i ] ; var comments = parse _cmnt ( getzipdata ( zip , canonicalpath . replace ( /^\// , "" ) , true ) , canonicalpath , opts ) ; if ( ! comments || ! comments . length ) continue ; var sheetNames = keys ( sheets ) ; for ( var j = 0 ; j != sheetNames . length ; ++ j ) { var sheetName = sheetNames [ j ] ; var rels = sheetRels [ sheetName ] ; if ( rels ) { var rel = rels [ canonicalpath ] ; if ( rel ) insertCommentsIntoSheet ( sheetName , sheets [ sheetName ] , comments ) } } } } function insertCommentsIntoSheet ( sheetName , sheet , comments ) { comments . forEach ( function ( comment ) { var cell = sheet [ comment . ref ] ; if ( ! cell ) { cell = { } ; sheet [ comment . ref ] = cell ; var range = safe _decode _range ( sheet [ "!ref" ] || "BDWGO1000001:A1" ) ; var thisCell = decode _cell ( comment . ref ) ; if ( range . s . r > thisCell . r ) range . s . r = thisCell . r ; if ( range . e . r < thisCell . r ) range . e . r = thisCell . r ; if ( range . s . c > thisCell . c ) range . s . c = thisCell . c ; if ( range . e . c < thisCell . c ) range . e . c = thisCell . c ; var encoded = encode _range ( range ) ; if ( encoded !== sheet [ "!ref" ] ) sheet [ "!ref" ] = encoded } if ( ! cell . c ) cell . c = [ ] ; var o = { a : comment . author , t : comment . t , r : comment . r } ; if ( comment . h ) o . h = comment . h ; cell . c . push ( o ) } ) } function parse _comments _xml ( data , opts ) { if ( data . match ( /<(?:\w+:)?comments *\/>/ ) ) return [ ] ; var authors = [ ] ; var commentList = [ ] ; var authtag = data . match ( /<(?:\w+:)?authors>([^\u2603]*)<\/(?:\w+:)?authors>/ ) ; if ( authtag && authtag [ 1 ] ) authtag [ 1 ] . split ( /<\/\w*:?author>/ ) . forEach ( function ( x ) { if ( x === "" || x . trim ( ) === "" ) return ; var a = x . match ( /<(?:\w+:)?author[^>]*>(.*)/ ) ; if ( a ) authors . push ( a [ 1 ] ) } ) ; var cmnttag = data . match ( /<(?:\w+:)?commentList>([^\u2603]*)<\/(?:\w+:)?commentList>/ ) ; if ( cmnttag && cmnttag [ 1 ] ) cmnttag [ 1 ] . split ( /<\/\w*:?comment>/ ) . forEach ( function ( x , index ) { if ( x === "" || x . trim ( ) === "" ) return ; var cm = x . match ( /<(?:\w+:)?comment[^>]*>/ ) ; if ( ! cm ) return ; var y = parsexmltag ( cm [ 0 ] ) ; var comment = { author : y . authorId && authors [ y . authorId ] ? authors [ y . authorId ] : undefined , ref : y . ref , guid : y . guid } ; var cell = decode _cell ( y . ref ) ; if ( opts . sheetRows && opts . sheetRows <= cell . r ) return ; var textMatch = x . match ( /<(?:\w+:)?text>([^\u2603]*)<\/(?:\w+:)?text>/ ) ; if ( ! textMatch || ! textMatch [ 1 ] ) return ; var rt = parse _si ( textMatch [ 1 ] ) ; if ( ! rt ) return ; comment . r = r
393 : "AUTO.OUTLINE" , 394 : "TAB.ORDER" , 395 : "SHOW.DIALOG" , 396 : "SELECT.ALL" , 397 : "UNGROUP.SHEETS" , 398 : "SUBTOTAL.CREATE" , 399 : "SUBTOTAL.REMOVE" , 400 : "RENAME.OBJECT" , 412 : "WORKBOOK.SCROLL" , 413 : "WORKBOOK.NEXT" , 414 : "WORKBOOK.PREV" , 415 : "WORKBOOK.TAB.SPLIT" , 416 : "FULL.SCREEN" , 417 : "WORKBOOK.PROTECT" , 420 : "SCROLLBAR.PROPERTIES" , 421 : "PIVOT.SHOW.PAGES" , 422 : "TEXT.TO.COLUMNS" , 423 : "FORMAT.CHARTTYPE" , 424 : "LINK.FORMAT" , 425 : "TRACER.DISPLAY" , 430 : "TRACER.NAVIGATE" , 431 : "TRACER.CLEAR" , 432 : "TRACER.ERROR" , 433 : "PIVOT.FIELD.GROUP" , 434 : "PIVOT.FIELD.UNGROUP" , 435 : "CHECKBOX.PROPERTIES" , 436 : "LABEL.PROPERTIES" , 437 : "LISTBOX.PROPERTIES" , 438 : "EDITBOX.PROPERTIES" , 439 : "PIVOT.REFRESH" , 440 : "LINK.COMBO" , 441 : "OPEN.TEXT" , 442 : "HIDE.DIALOG" , 443 : "SET.DIALOG.FOCUS" , 444 : "ENABLE.OBJECT" , 445 : "PUSHBUTTON.PROPERTIES" , 446 : "SET.DIALOG.DEFAULT" , 447 : "FILTER" , 448 : "FILTER.SHOW.ALL" , 449 : "CLEAR.OUTLINE" , 450 : "FUNCTION.WIZARD" , 451 : "ADD.LIST.ITEM" , 452 : "SET.LIST.ITEM" , 453 : "REMOVE.LIST.ITEM" , 454 : "SELECT.LIST.ITEM" , 455 : "SET.CONTROL.VALUE" , 456 : "SAVE.COPY.AS" , 458 : "OPTIONS.LISTS.ADD" , 459 : "OPTIONS.LISTS.DELETE" , 460 : "SERIES.AXES" , 461 : "SERIES.X" , 462 : "SERIES.Y" , 463 : "ERRORBAR.X" , 464 : "ERRORBAR.Y" , 465 : "FORMAT.CHART" , 466 : "SERIES.ORDER" , 467 : "MAIL.LOGOFF" , 468 : "CLEAR.ROUTING.SLIP" , 469 : "APP.ACTIVATE.MICROSOFT" , 470 : "MAIL.EDIT.MAILER" , 471 : "ON.SHEET" , 472 : "STANDARD.WIDTH" , 473 : "SCENARIO.MERGE" , 474 : "SUMMARY.INFO" , 475 : "FIND.FILE" , 476 : "ACTIVE.CELL.FONT" , 477 : "ENABLE.TIPWIZARD" , 478 : "VBA.MAKE.ADDIN" , 480 : "INSERTDATATABLE" , 481 : "WORKGROUP.OPTIONS" , 482 : "MAIL.SEND.MAILER" , 485 : "AUTOCORRECT" , 489 : "POST.DOCUMENT" , 491 : "PICKLIST" , 493 : "VIEW.SHOW" , 494 : "VIEW.DEFINE" , 495 : "VIEW.DELETE" , 509 : "SHEET.BACKGROUND" , 510 : "INSERT.MAP.OBJECT" , 511 : "OPTIONS.MENONO" , 517 : "MSOCHECKS" , 518 : "NORMAL" , 519 : "LAYOUT" , 520 : "RM.PRINT.AREA" , 521 : "CLEAR.PRINT.AREA" , 522 : "ADD.PRINT.AREA" , 523 : "MOVE.BRK" , 545 : "HIDECURR.NOTE" , 546 : "HIDEALL.NOTES" , 547 : "DELETE.NOTE" , 548 : "TRAVERSE.NOTES" , 549 : "ACTIVATE.NOTES" , 620 : "PROTECT.REVISIONS" , 621 : "UNPROTECT.REVISIONS" , 647 : "OPTIONS.ME" , 653 : "WEB.PUBLISH" , 667 : "NEWWEBQUERY" , 673 : "PIVOT.TABLE.CHART" , 753 : "OPTIONS.SAVE" , 755 : "OPTIONS.SPELL" , 808 : "HIDEALL.INKANNOTS" } ; var Ftab = { 0 : "COUNT" , 1 : "IF" , 2 : "ISNA" , 3 : "ISERROR" , 4 : "SUM" , 5 : "AVERAGE" , 6 : "MIN" , 7 : "MAX" , 8 : "ROW" , 9 : "COLUMN" , 10 : "NA" , 11 : "NPV" , 12 : "STDEV" , 13 : "DOLLAR" , 14 : "FIXED" , 15 : "SIN" , 16 : "COS" , 17 : "TAN" , 18 : "ATAN" , 19 : "PI" , 20 : "SQRT" , 21 : "EXP" , 22 : "LN" , 23 : "LOG10" , 24 : "ABS" , 25 : "INT" , 26 : "SIGN" , 27 : "ROUND" , 28 : "LOOKUP" , 29 : "INDEX" , 30 : "REPT" , 31 : "MID" , 32 : "LEN" , 33 : "VALUE" , 34 : "TRUE" , 35 : "FALSE" , 36 : "AND" , 37 : "OR" , 38 : "NOT" , 39 : "MOD" , 40 : "DCOUNT" , 41 : "DSUM" , 42 : "DAVERAGE" , 43 : "DMIN" , 44 : "DMAX" , 45 : "DSTDEV" , 46 : "VAR" , 47 : "DVAR" , 48 : "TEXT" , 49 : "LINEST" , 50 : "TREND" , 51 : "LOGEST" , 52 : "GROWTH" , 53 : "GOTO" , 54 : "HALT" , 55 : "RETURN" , 56 : "PV" , 57 : "FV" , 58 : "NPER" , 59 : "PMT" , 60 : "RATE" , 61 : "MIRR" , 62 : "IRR" , 63 : "RAND" , 64 : "MATCH" , 65 : "DATE" , 66 : "TIME" , 67 : "DAY" , 68 : "MONTH" , 69 : "YEAR" , 70 : "WEEKDAY" , 71 : "HOUR" , 72 : "MINUTE" , 73 : "SECOND" , 74 : "NOW" , 75 : "AREAS" , 76 : "ROWS" , 77 : "COLUMNS" , 78 : "OFFSET" , 79 : "ABSREF" , 80 : "RELREF" , 81 : "ARGUMENT" , 82 : "SEARCH" , 83 : "TRANSPOSE" , 84 : "ERROR" , 85 : "STEP" , 86 : "TYPE" , 87 : "ECHO" , 88 : "SET.NAME" , 89 : "CALLER" , 90 : "DEREF" , 91 : "WINDOWS" , 92 : "SERIES" , 93 : "DOCUMENTS" , 94 : "ACTIVE.CELL" , 95 : "SELECTION" , 96 : "RESULT" , 97 : "ATAN2" , 98 : "ASIN" , 99 : "ACOS" , 100 : "CHOOSE" , 101 : "HLOOKUP" , 102 : "VLOOKUP" , 103 : "LINKS" , 104 : "INPUT" , 105 : "ISREF" , 106 : "GET.FORMULA" , 107 : "GET.NAME" , 108 : "SET.VALUE" , 109 : "LOG" , 110 : "EXEC" , 111 : "CHAR" , 112 : "LOWER" , 113 : "UPPER" , 114 : "PROPER" , 115 : "LEFT" , 116 : "RIGHT" , 117 : "EXACT" , 118 : "TRIM" , 119 : "REPLACE" , 120 : "SUBSTITUTE" , 121 : "CODE" , 122 : "NAMES" , 123 : "DIRECTORY" , 124 : "FIND" , 125 : "CELL" , 126 : "ISERR" , 127 : "ISTEXT" , 128 : "ISNUMBER" , 129 : "ISBLANK" , 130 : "T" , 131 : "N" , 132 : "FOPEN" , 133 : "FCLOSE" , 134 : "FSIZE" , 135 : "FREADLN" , 136 : "FREAD" , 137 : "FWRITELN" , 138 : "FWRITE" , 139 : "FPOS" , 140 : "DATEVALUE" , 141 : "TIMEVALUE" , 142 : "SLN" , 143 : "SYD" , 144 : "DDB" , 145 : "GET.DEF" , 146 : "REFTEXT" , 147 : "TEXTREF" , 148 : "INDIRECT" , 149 : "REGISTER" , 150 : "CALL" , 151 : "ADD.BAR" , 152 : "ADD.MENU" , 153 : "ADD.COMMAND" , 154 : "ENABLE.COMMAND" , 155 : "CHECK.COMMAND" , 156 : "RENAME.COMMAND" , 157 : "SHOW.BAR" , 158 : "DELETE.MENU" , 159 : "DELETE.COMMAND" , 160 : "GET.CHART.ITEM" , 161 : "DIALOG.BOX" , 162 : "CLEAN" , 163 : "MDETERM" , 164 : "MINVERSE" , 165 : "MMULT" , 166 : "FILES" , 167 : "IPMT" , 168 : "PPMT" , 169 : "COUNTA" , 1
var supbooks = [ [ ] ] ; supbooks . sharedf = shared _formulae ; supbooks . arrayf = array _formulae ; opts . supbooks = supbooks ; for ( var i = 0 ; i < wb . Names [ "!names" ] . length ; ++ i ) supbooks [ 0 ] [ i + 1 ] = wb . Names [ wb . Names [ "!names" ] [ i ] ] ; var colinfo = [ ] , rowinfo = [ ] ; var defwidth = 0 , defheight = 0 ; var seencol = false ; recordhopper ( data , function ws _parse ( val , Record ) { if ( end ) return ; switch ( Record . n ) { case "BrtWsDim" : ref = val ; break ; case "BrtRowHdr" : row = val ; if ( opts . sheetRows && opts . sheetRows <= row . r ) end = true ; rr = encode _row ( row . r ) ; opts [ "!row" ] = row . r ; break ; case "BrtFmlaBool" : case "BrtFmlaError" : case "BrtFmlaNum" : case "BrtFmlaString" : case "BrtCellBool" : case "BrtCellError" : case "BrtCellIsst" : case "BrtCellReal" : case "BrtCellRk" : case "BrtCellSt" : p = { t : val [ 2 ] } ; switch ( val [ 2 ] ) { case "n" : p . v = val [ 1 ] ; break ; case "s" : sstr = strs [ val [ 1 ] ] ; p . v = sstr . t ; p . r = sstr . r ; break ; case "b" : p . v = val [ 1 ] ? true : false ; break ; case "e" : p . v = val [ 1 ] ; p . w = BErr [ p . v ] ; break ; case "str" : p . t = "s" ; p . v = utf8read ( val [ 1 ] ) ; break } if ( cf = styles . CellXf [ val [ 0 ] . iStyleRef ] ) safe _format ( p , cf . ifmt , null , opts , themes , styles ) ; s [ encode _col ( C = val [ 0 ] . c ) + rr ] = p ; if ( opts . cellFormula ) { af = false ; for ( ai = 0 ; ai < array _formulae . length ; ++ ai ) { var aii = array _formulae [ ai ] ; if ( row . r >= aii [ 0 ] . s . r && row . r <= aii [ 0 ] . e . r ) if ( C >= aii [ 0 ] . s . c && C <= aii [ 0 ] . e . c ) { p . F = encode _range ( aii [ 0 ] ) ; af = true } } if ( ! af && val . length > 3 ) p . f = val [ 3 ] } if ( refguess . s . r > row . r ) refguess . s . r = row . r ; if ( refguess . s . c > C ) refguess . s . c = C ; if ( refguess . e . r < row . r ) refguess . e . r = row . r ; if ( refguess . e . c < C ) refguess . e . c = C ; if ( opts . cellDates && cf && p . t == "n" && SSF . is _date ( SSF . _table [ cf . ifmt ] ) ) { var _d = SSF . parse _date _code ( p . v ) ; if ( _d ) { p . t = "d" ; p . v = new Date ( Date . UTC ( _d . y , _d . m - 1 , _d . d , _d . H , _d . M , _d . S , _d . u ) ) } } break ; case "BrtCellBlank" : if ( ! opts . sheetStubs ) break ; p = { t : "z" , v : undefined } ; s [ encode _col ( C = val [ 0 ] . c ) + rr ] = p ; if ( refguess . s . r > row . r ) refguess . s . r = row . r ; if ( refguess . s . c > C ) refguess . s . c = C ; if ( refguess . e . r < row . r ) refguess . e . r = row . r ; if ( refguess . e . c < C ) refguess . e . c = C ; break ; case "BrtBeginMergeCells" : break ; case "BrtEndMergeCells" : break ; case "BrtMergeCell" : mergecells . push ( val ) ; break ; case "BrtHLink" : var rel = rels [ "!id" ] [ val . relId ] ; if ( rel ) { val . Target = rel . Target ; if ( val . loc ) val . Target += "#" + val . loc ; val . Rel = rel } for ( R = val . rfx . s . r ; R <= val . rfx . e . r ; ++ R ) for ( C = val . rfx . s . c ; C <= val . rfx . e . c ; ++ C ) { addr = encode _cell ( { c : C , r : R } ) ; if ( ! s [ addr ] ) s [ addr ] = { t : "s" , v : undefined } ; s [ addr ] . l = val } break ; case "BrtArrFmla" : if ( ! opts . cellFormula ) break ; array _formulae . push ( val ) ; s [ encode _col ( C ) + rr ] . f = stringify _formula ( val [ 1 ] , refguess , { r : row . r , c : C } , supbooks , opts ) ; s [ encode _col ( C ) + rr ] . F = encode _range ( val [ 0 ] ) ; break ; case "BrtShrFmla" : if ( ! opts . cellFormula ) break ; shared _formulae [ encode _cell ( val [ 0 ] . s ) ] = val [ 1 ] ; s [ encode _col ( C ) + rr ] . f = stringify _formula ( val [ 1 ] , refguess , { r : row . r , c : C } , supbooks , opts ) ; break ; case "BrtColInfo" : { if ( ! opts . cellStyles ) break ; while ( val . e >= val . s ) { colinfo [ val . e -- ] = { width : val . w / 256 } ; if ( ! seencol ) { seencol = true ; find _mdw _colw ( val . w / 256 ) } process _col ( colinfo [ val . e + 1 ] ) } } break ; case "BrtBeginSheet" : break ; case "BrtWsProp" : break ; case "BrtSheetCalcProp" : break ; case "BrtBeginWsViews" : break ; case "BrtBeginWsView" : break ; case "BrtPane" : break ; case "BrtSel" : break ; case "BrtEndWsView" : break ; case "BrtEndWsViews" : break ; case "BrtACBegin" : break ; case "BrtRwDescent" : break ; case "BrtACEnd" : break ; case "BrtWsFmtInfoEx14" : break ; case "BrtWsFmtInfo" : break ; case "BrtBeginColInfos" : break ; case "BrtEndColInfos" : break ; case "BrtBeginSheetData" : break ; case "BrtEndSheetData" : break ; case "BrtSheetProtection" : break ; case "BrtPrintOptions" : break ; case "BrtMargins" : break ; case "BrtPageSetup" : break ; case "BrtFRTBegin" : pass = true ; break ; case "BrtFRTEnd" : pass = false ; break ; case "BrtEndSheet" : break ; case "BrtDrawing" : break ; case "BrtLegacyDrawing" : break ; case "BrtLegacyDrawingHF" : break ; case "BrtPhoneticInfo" : break ; case "BrtBeginHeaderFooter" : break ; case "BrtEndHeaderFooter" : break ; case "BrtBrk" : break ; case "BrtBeginRwBrk" : break ; case "BrtEndRwBrk" : break ; case "BrtBeginColBrk" : break ; case "BrtEndColBrk" : break ; case "BrtBeginUserShViews" : break ; case "BrtBeginUserShView" : break ; case "BrtEndUserShView" : break ; case "BrtEndUserShViews" : break ; case "BrtBkHim" : break ; case "BrtBeginOleObjects" : break ; case "BrtOleObject" : break ; case "BrtEndOleObjects" : break ; case "BrtBeginListParts" : break ; case "BrtListPart" : break ; case "BrtEndListParts" : break ; case "BrtBeginSortState" : break ; ca
stag . Interior = xlml _parsexmltag ( Rn [ 0 ] ) ; break ; case "Protection" : break ; case "Author" : case "Title" : case "Description" : case "Created" : case "Keywords" : case "Subject" : case "Category" : case "Company" : case "LastAuthor" : case "LastSaved" : case "LastPrinted" : case "Version" : case "Revision" : case "TotalTime" : case "HyperlinkBase" : case "Manager" : if ( Rn [ 0 ] . slice ( - 2 ) === "/>" ) break ; else if ( Rn [ 1 ] === "/" ) xlml _set _prop ( Props , Rn [ 3 ] , str . slice ( pidx , Rn . index ) ) ; else pidx = Rn . index + Rn [ 0 ] . length ; break ; case "Paragraphs" : break ; case "Styles" : case "Workbook" : if ( Rn [ 1 ] === "/" ) { if ( ( tmp = state . pop ( ) ) [ 0 ] !== Rn [ 3 ] ) throw new Error ( "Bad state: " + tmp . join ( "|" ) ) } else state . push ( [ Rn [ 3 ] , false ] ) ; break ; case "Comment" : if ( Rn [ 1 ] === "/" ) { if ( ( tmp = state . pop ( ) ) [ 0 ] !== Rn [ 3 ] ) throw new Error ( "Bad state: " + tmp . join ( "|" ) ) ; xlml _clean _comment ( comment ) ; comments . push ( comment ) } else { state . push ( [ Rn [ 3 ] , false ] ) ; tmp = xlml _parsexmltag ( Rn [ 0 ] ) ; comment = { a : tmp . Author } } break ; case "Name" : break ; case "ComponentOptions" : case "DocumentProperties" : case "CustomDocumentProperties" : case "OfficeDocumentSettings" : case "PivotTable" : case "PivotCache" : case "Names" : case "MapInfo" : case "PageBreaks" : case "QueryTable" : case "DataValidation" : case "AutoFilter" : case "Sorting" : case "Schema" : case "data" : case "ConditionalFormatting" : case "SmartTagType" : case "SmartTags" : case "ExcelWorkbook" : case "WorkbookOptions" : case "WorksheetOptions" : if ( Rn [ 1 ] === "/" ) { if ( ( tmp = state . pop ( ) ) [ 0 ] !== Rn [ 3 ] ) throw new Error ( "Bad state: " + tmp . join ( "|" ) ) } else if ( Rn [ 0 ] . charAt ( Rn [ 0 ] . length - 2 ) !== "/" ) state . push ( [ Rn [ 3 ] , true ] ) ; break ; default : if ( state . length == 0 && Rn [ 3 ] == "document" ) return parse _fods ( str , opts ) ; if ( state . length == 0 && Rn [ 3 ] == "UOF" ) return parse _fods ( str , opts ) ; var seen = true ; switch ( state [ state . length - 1 ] [ 0 ] ) { case "OfficeDocumentSettings" : switch ( Rn [ 3 ] ) { case "AllowPNG" : break ; case "RemovePersonalInformation" : break ; case "DownloadComponents" : break ; case "LocationOfComponents" : break ; case "Colors" : break ; case "Color" : break ; case "Index" : break ; case "RGB" : break ; case "PixelsPerInch" : break ; case "TargetScreenSize" : break ; case "ReadOnlyRecommended" : break ; default : seen = false } break ; case "ComponentOptions" : switch ( Rn [ 3 ] ) { case "Toolbar" : break ; case "HideOfficeLogo" : break ; case "SpreadsheetAutoFit" : break ; case "Label" : break ; case "Caption" : break ; case "MaxHeight" : break ; case "MaxWidth" : break ; case "NextSheetNumber" : break ; default : seen = false } break ; case "ExcelWorkbook" : switch ( Rn [ 3 ] ) { case "WindowHeight" : break ; case "WindowWidth" : break ; case "WindowTopX" : break ; case "WindowTopY" : break ; case "TabRatio" : break ; case "ProtectStructure" : break ; case "ProtectWindows" : break ; case "ActiveSheet" : break ; case "DisplayInkNotes" : break ; case "FirstVisibleSheet" : break ; case "SupBook" : break ; case "SheetName" : break ; case "SheetIndex" : break ; case "SheetIndexFirst" : break ; case "SheetIndexLast" : break ; case "Dll" : break ; case "AcceptLabelsInFormulas" : break ; case "DoNotSaveLinkValues" : break ; case "Date1904" : break ; case "Iteration" : break ; case "MaxIterations" : break ; case "MaxChange" : break ; case "Path" : break ; case "Xct" : break ; case "Count" : break ; case "SelectedSheets" : break ; case "Calculation" : break ; case "Uncalced" : break ; case "StartupPrompt" : break ; case "Crn" : break ; case "ExternName" : break ; case "Formula" : break ; case "ColFirst" : break ; case "ColLast" : break ; case "WantAdvise" : break ; case "Boolean" : break ; case "Error" : break ; case "Text" : break ; case "OLE" : break ; case "NoAutoRecover" : break ; case "PublishObjects" : break ; case "DoNotCalculateBeforeSave" : break ; case "Number" : break ; case "RefModeR1C1" : break ; case "EmbedSaveSmartTags" : break ; default : seen = false } break ; case "WorkbookOptions" : switch ( Rn [ 3 ] ) { case "OWCVersion" : break ; case "Height" : break ; case "Width" : break ; default : seen = false } break ; case "WorksheetOptions" : switch ( Rn [ 3 ] ) { case "Visible" : if ( Rn [ 0 ] . slice ( - 2 ) === "/>" ) { } else if ( Rn [ 1 ] === "/" ) switch ( str . slice ( pidx , Rn . index ) ) { case "SheetHidden" : wsprops . Hidden = 1 ; break ; case "SheetVeryHidden" : wsprops . Hidden = 2 ; break } else pidx = Rn . index + Rn [ 0 ] . length ; break ; case "Unsynced" : break ; case "Print" : break ; case "Panes" : break ; case "Scale" : break ; case "Pane" : break ; case "Number" : break ; case "Layout" : break ; case "Header" : break ; case "Footer" : break ; case "PageSetup" : break ; case "PageMargins" : break ; case "Selected" : break ; case "ProtectObjects" : break ; case "EnableSelection" : break ; case "ProtectScenarios" : break ; case "ValidPrinterInfo" : break ; case "
} , 2 : { n : "BrtCellRk" , f : parse _BrtCellRk } , 3 : { n : "BrtCellError" , f : parse _BrtCellError } , 4 : { n : "BrtCellBool" , f : parse _BrtCellBool } , 5 : { n : "BrtCellReal" , f : parse _BrtCellReal } , 6 : { n : "BrtCellSt" , f : parse _BrtCellSt } , 7 : { n : "BrtCellIsst" , f : parse _BrtCellIsst } , 8 : { n : "BrtFmlaString" , f : parse _BrtFmlaString } , 9 : { n : "BrtFmlaNum" , f : parse _BrtFmlaNum } , 10 : { n : "BrtFmlaBool" , f : parse _BrtFmlaBool } , 11 : { n : "BrtFmlaError" , f : parse _BrtFmlaError } , 16 : { n : "BrtFRTArchID$" , f : parse _BrtFRTArchID$ } , 19 : { n : "BrtSSTItem" , f : parse _RichStr } , 20 : { n : "BrtPCDIMissing" , f : parsenoop } , 21 : { n : "BrtPCDINumber" , f : parsenoop } , 22 : { n : "BrtPCDIBoolean" , f : parsenoop } , 23 : { n : "BrtPCDIError" , f : parsenoop } , 24 : { n : "BrtPCDIString" , f : parsenoop } , 25 : { n : "BrtPCDIDatetime" , f : parsenoop } , 26 : { n : "BrtPCDIIndex" , f : parsenoop } , 27 : { n : "BrtPCDIAMissing" , f : parsenoop } , 28 : { n : "BrtPCDIANumber" , f : parsenoop } , 29 : { n : "BrtPCDIABoolean" , f : parsenoop } , 30 : { n : "BrtPCDIAError" , f : parsenoop } , 31 : { n : "BrtPCDIAString" , f : parsenoop } , 32 : { n : "BrtPCDIADatetime" , f : parsenoop } , 33 : { n : "BrtPCRRecord" , f : parsenoop } , 34 : { n : "BrtPCRRecordDt" , f : parsenoop } , 35 : { n : "BrtFRTBegin" , f : parsenoop } , 36 : { n : "BrtFRTEnd" , f : parsenoop } , 37 : { n : "BrtACBegin" , f : parsenoop } , 38 : { n : "BrtACEnd" , f : parsenoop } , 39 : { n : "BrtName" , f : parse _BrtName } , 40 : { n : "BrtIndexRowBlock" , f : parsenoop } , 42 : { n : "BrtIndexBlock" , f : parsenoop } , 43 : { n : "BrtFont" , f : parse _BrtFont } , 44 : { n : "BrtFmt" , f : parse _BrtFmt } , 45 : { n : "BrtFill" , f : parsenoop } , 46 : { n : "BrtBorder" , f : parsenoop } , 47 : { n : "BrtXF" , f : parse _BrtXF } , 48 : { n : "BrtStyle" , f : parsenoop } , 49 : { n : "BrtCellMeta" , f : parsenoop } , 50 : { n : "BrtValueMeta" , f : parsenoop } , 51 : { n : "BrtMdb" , f : parsenoop } , 52 : { n : "BrtBeginFmd" , f : parsenoop } , 53 : { n : "BrtEndFmd" , f : parsenoop } , 54 : { n : "BrtBeginMdx" , f : parsenoop } , 55 : { n : "BrtEndMdx" , f : parsenoop } , 56 : { n : "BrtBeginMdxTuple" , f : parsenoop } , 57 : { n : "BrtEndMdxTuple" , f : parsenoop } , 58 : { n : "BrtMdxMbrIstr" , f : parsenoop } , 59 : { n : "BrtStr" , f : parsenoop } , 60 : { n : "BrtColInfo" , f : parse _ColInfo } , 62 : { n : "BrtCellRString" , f : parsenoop } , 63 : { n : "BrtCalcChainItem$" , f : parse _BrtCalcChainItem$ } , 64 : { n : "BrtDVal" , f : parsenoop } , 65 : { n : "BrtSxvcellNum" , f : parsenoop } , 66 : { n : "BrtSxvcellStr" , f : parsenoop } , 67 : { n : "BrtSxvcellBool" , f : parsenoop } , 68 : { n : "BrtSxvcellErr" , f : parsenoop } , 69 : { n : "BrtSxvcellDate" , f : parsenoop } , 70 : { n : "BrtSxvcellNil" , f : parsenoop } , 128 : { n : "BrtFileVersion" , f : parsenoop } , 129 : { n : "BrtBeginSheet" , f : parsenoop } , 130 : { n : "BrtEndSheet" , f : parsenoop } , 131 : { n : "BrtBeginBook" , f : parsenoop , p : 0 } , 132 : { n : "BrtEndBook" , f : parsenoop } , 133 : { n : "BrtBeginWsViews" , f : parsenoop } , 134 : { n : "BrtEndWsViews" , f : parsenoop } , 135 : { n : "BrtBeginBookViews" , f : parsenoop } , 136 : { n : "BrtEndBookViews" , f : parsenoop } , 137 : { n : "BrtBeginWsView" , f : parsenoop } , 138 : { n : "BrtEndWsView" , f : parsenoop } , 139 : { n : "BrtBeginCsViews" , f : parsenoop } , 140 : { n : "BrtEndCsViews" , f : parsenoop } , 141 : { n : "BrtBeginCsView" , f : parsenoop } , 142 : { n : "BrtEndCsView" , f : parsenoop } , 143 : { n : "BrtBeginBundleShs" , f : parsenoop } , 144 : { n : "BrtEndBundleShs" , f : parsenoop } , 145 : { n : "BrtBeginSheetData" , f : parsenoop } , 146 : { n : "BrtEndSheetData" , f : parsenoop } , 147 : { n : "BrtWsProp" , f : parse _BrtWsProp } , 148 : { n : "BrtWsDim" , f : parse _BrtWsDim , p : 16 } , 151 : { n : "BrtPane" , f : parsenoop } , 152 : { n : "BrtSel" , f : parsenoop } , 153 : { n : "BrtWbProp" , f : parse _BrtWbProp } , 154 : { n : "BrtWbFactoid" , f : parsenoop } , 155 : { n : "BrtFileRecover" , f : parsenoop } , 156 : { n : "BrtBundleSh" , f : parse _BrtBundleSh } , 157 : { n : "BrtCalcProp" , f : parsenoop } , 158 : { n : "BrtBookView" , f : parsenoop } , 159 : { n : "BrtBeginSst" , f : parse _BrtBeginSst } , 160 : { n : "BrtEndSst" , f : parsenoop } , 161 : { n : "BrtBeginAFilter" , f : parsenoop } , 162 : { n : "BrtEndAFilter" , f : parsenoop } , 163 : { n : "BrtBeginFilterColumn" , f : parsenoop } , 164 : { n : "BrtEndFilterColumn" , f : parsenoop } , 165 : { n : "BrtBeginFilters" , f : parsenoop } , 166 : { n : "BrtEndFilters" , f : parsenoop } , 167 : { n : "BrtFilter" , f : parsenoop } , 168 : { n : "BrtColorFilter" , f : parsenoop } , 169 : { n : "BrtIconFilter" , f : parsenoop } , 170 : { n : "BrtTop10Filter" , f : parsenoop } , 171 : { n : "BrtDynamicFilter" , f : parsenoop } , 172 : { n : "BrtBeginCustomFilters" , f : parsenoop } , 173 : { n : "BrtEndCustomFilters" , f : parsenoop } , 174 : { n : "BrtCustomFilter" , f : parsenoop } , 175 : { n : "BrtAFilterDateGroupItem" , f : parsenoop } , 176 : { n : "BrtMergeCell" , f : parse _BrtMergeCell } , 177 : { n : "BrtBeginMergeCells" , f : parsenoop } , 178 : { n : "BrtEndMergeCells" , f : parsenoop } , 179 : { n : "BrtBeginPivotCacheDef" , f : parsenoop } , 180 : { n : "BrtEndPivotCacheDef" , f : parsenoop } , 181 : {
n : "BrtPivotCacheIdVersion" , f : parsenoop } , 2136 : { n : "BrtSXDI15" , f : parsenoop } , 65535 : { n : "" , f : parsenoop } } ; var evert _RE = evert _key ( XLSBRecordEnum , "n" ) ; var XLSRecordEnum = { 3 : { n : "BIFF2NUM" , f : parse _BIFF2NUM } , 4 : { n : "BIFF2STR" , f : parse _BIFF2STR } , 6 : { n : "Formula" , f : parse _Formula } , 9 : { n : "BOF" , f : parse _BOF } , 10 : { n : "EOF" , f : parse _EOF } , 12 : { n : "CalcCount" , f : parse _CalcCount } , 13 : { n : "CalcMode" , f : parse _CalcMode } , 14 : { n : "CalcPrecision" , f : parse _CalcPrecision } , 15 : { n : "CalcRefMode" , f : parse _CalcRefMode } , 16 : { n : "CalcDelta" , f : parse _CalcDelta } , 17 : { n : "CalcIter" , f : parse _CalcIter } , 18 : { n : "Protect" , f : parse _Protect } , 19 : { n : "Password" , f : parse _Password } , 20 : { n : "Header" , f : parse _Header } , 21 : { n : "Footer" , f : parse _Footer } , 23 : { n : "ExternSheet" , f : parse _ExternSheet } , 24 : { n : "Lbl" , f : parse _Lbl } , 25 : { n : "WinProtect" , f : parse _WinProtect } , 26 : { n : "VerticalPageBreaks" , f : parse _VerticalPageBreaks } , 27 : { n : "HorizontalPageBreaks" , f : parse _HorizontalPageBreaks } , 28 : { n : "Note" , f : parse _Note } , 29 : { n : "Selection" , f : parse _Selection } , 34 : { n : "Date1904" , f : parse _Date1904 } , 35 : { n : "ExternName" , f : parse _ExternName } , 38 : { n : "LeftMargin" , f : parse _LeftMargin } , 39 : { n : "RightMargin" , f : parse _RightMargin } , 40 : { n : "TopMargin" , f : parse _TopMargin } , 41 : { n : "BottomMargin" , f : parse _BottomMargin } , 42 : { n : "PrintRowCol" , f : parse _PrintRowCol } , 43 : { n : "PrintGrid" , f : parse _PrintGrid } , 47 : { n : "FilePass" , f : parse _FilePass } , 49 : { n : "Font" , f : parse _Font } , 51 : { n : "PrintSize" , f : parse _PrintSize } , 60 : { n : "Continue" , f : parse _Continue } , 61 : { n : "Window1" , f : parse _Window1 } , 64 : { n : "Backup" , f : parse _Backup } , 65 : { n : "Pane" , f : parse _Pane } , 66 : { n : "CodePage" , f : parse _CodePage } , 77 : { n : "Pls" , f : parse _Pls } , 80 : { n : "DCon" , f : parse _DCon } , 81 : { n : "DConRef" , f : parse _DConRef } , 82 : { n : "DConName" , f : parse _DConName } , 85 : { n : "DefColWidth" , f : parse _DefColWidth } , 89 : { n : "XCT" , f : parse _XCT } , 90 : { n : "CRN" , f : parse _CRN } , 91 : { n : "FileSharing" , f : parse _FileSharing } , 92 : { n : "WriteAccess" , f : parse _WriteAccess } , 93 : { n : "Obj" , f : parse _Obj } , 94 : { n : "Uncalced" , f : parse _Uncalced } , 95 : { n : "CalcSaveRecalc" , f : parse _CalcSaveRecalc } , 96 : { n : "Template" , f : parse _Template } , 97 : { n : "Intl" , f : parse _Intl } , 99 : { n : "ObjProtect" , f : parse _ObjProtect } , 125 : { n : "ColInfo" , f : parse _ColInfo } , 128 : { n : "Guts" , f : parse _Guts } , 129 : { n : "WsBool" , f : parse _WsBool } , 130 : { n : "GridSet" , f : parse _GridSet } , 131 : { n : "HCenter" , f : parse _HCenter } , 132 : { n : "VCenter" , f : parse _VCenter } , 133 : { n : "BoundSheet8" , f : parse _BoundSheet8 } , 134 : { n : "WriteProtect" , f : parse _WriteProtect } , 140 : { n : "Country" , f : parse _Country } , 141 : { n : "HideObj" , f : parse _HideObj } , 144 : { n : "Sort" , f : parse _Sort } , 146 : { n : "Palette" , f : parse _Palette } , 151 : { n : "Sync" , f : parse _Sync } , 152 : { n : "LPr" , f : parse _LPr } , 153 : { n : "DxGCol" , f : parse _DxGCol } , 154 : { n : "FnGroupName" , f : parse _FnGroupName } , 155 : { n : "FilterMode" , f : parse _FilterMode } , 156 : { n : "BuiltInFnGroupCount" , f : parse _BuiltInFnGroupCount } , 157 : { n : "AutoFilterInfo" , f : parse _AutoFilterInfo } , 158 : { n : "AutoFilter" , f : parse _AutoFilter } , 160 : { n : "Scl" , f : parse _Scl } , 161 : { n : "Setup" , f : parse _Setup } , 174 : { n : "ScenMan" , f : parse _ScenMan } , 175 : { n : "SCENARIO" , f : parse _SCENARIO } , 176 : { n : "SxView" , f : parse _SxView } , 177 : { n : "Sxvd" , f : parse _Sxvd } , 178 : { n : "SXVI" , f : parse _SXVI } , 180 : { n : "SxIvd" , f : parse _SxIvd } , 181 : { n : "SXLI" , f : parse _SXLI } , 182 : { n : "SXPI" , f : parse _SXPI } , 184 : { n : "DocRoute" , f : parse _DocRoute } , 185 : { n : "RecipName" , f : parse _RecipName } , 189 : { n : "MulRk" , f : parse _MulRk } , 190 : { n : "MulBlank" , f : parse _MulBlank } , 193 : { n : "Mms" , f : parse _Mms } , 197 : { n : "SXDI" , f : parse _SXDI } , 198 : { n : "SXDB" , f : parse _SXDB } , 199 : { n : "SXFDB" , f : parse _SXFDB } , 200 : { n : "SXDBB" , f : parse _SXDBB } , 201 : { n : "SXNum" , f : parse _SXNum } , 202 : { n : "SxBool" , f : parse _SxBool } , 203 : { n : "SxErr" , f : parse _SxErr } , 204 : { n : "SXInt" , f : parse _SXInt } , 205 : { n : "SXString" , f : parse _SXString } , 206 : { n : "SXDtr" , f : parse _SXDtr } , 207 : { n : "SxNil" , f : parse _SxNil } , 208 : { n : "SXTbl" , f : parse _SXTbl } , 209 : { n : "SXTBRGIITM" , f : parse _SXTBRGIITM } , 210 : { n : "SxTbpg" , f : parse _SxTbpg } , 211 : { n : "ObProj" , f : parse _ObProj } , 213 : { n : "SXStreamID" , f : parse _SXStreamID } , 215 : { n : "DBCell" , f : parse _DBCell } , 216 : { n : "SXRng" , f : parse _SXRng } , 217 : { n : "SxIsxoper" , f : parse _SxIsxoper } , 218 : { n : "BookBool" , f : parse _BookBool } , 220 : { n : "DbOrParamQry" , f : parse _DbOrParamQry } , 221 : { n : "ScenarioProtect" , f : parse _ScenarioProtect } , 222 : { n : "OleObjectSize" , f : parse _OleObjectSize } , 224 : { n : "XF" , f : parse _XF } , 225 : { n : "InterfaceHdr" , f : parse _InterfaceHdr } , 226 : { n : "InterfaceEnd" , f : p
o . push ( " <office:body>\n" ) ; o . push ( " <office:spreadsheet>\n" ) ; for ( var i = 0 ; i != wb . SheetNames . length ; ++ i ) o . push ( write _ws ( wb . Sheets [ wb . SheetNames [ i ] ] , wb , i , opts ) ) ; o . push ( " </office:spreadsheet>\n" ) ; o . push ( " </office:body>\n" ) ; if ( opts . bookType == "fods" ) o . push ( "</office:document>" ) ; else o . push ( "</office:document-content>" ) ; return o . join ( "" ) } } ( ) ; function write _csv _str ( wb , o ) { var idx = 0 ; for ( var i = 0 ; i < wb . SheetNames . length ; ++ i ) if ( wb . SheetNames [ i ] == o . sheet ) idx = i ; if ( idx == 0 && ! ! o . sheet && wb . SheetNames [ 0 ] != o . sheet ) throw new Error ( "Sheet not found: " + o . sheet ) ; return sheet _to _csv ( wb . Sheets [ wb . SheetNames [ idx ] ] , o ) } function parse _ods ( zip , opts ) { opts = opts || { } ; var ods = ! ! safegetzipfile ( zip , "objectdata" ) ; if ( ods ) var manifest = parse _manifest ( getzipdata ( zip , "META-INF/manifest.xml" ) , opts ) ; var content = getzipstr ( zip , "content.xml" ) ; if ( ! content ) throw new Error ( "Missing content.xml in " + ( ods ? "ODS" : "UOF" ) + " file" ) ; return parse _content _xml ( ods ? content : utf8read ( content ) , opts ) } function parse _fods ( data , opts ) { return parse _content _xml ( data , opts ) } function write _ods ( wb , opts ) { if ( opts . bookType == "fods" ) return write _content _xml ( wb , opts ) ; var zip = new jszip ; var f = "" ; var manifest = [ ] ; var rdf = [ ] ; f = "mimetype" ; zip . file ( f , "application/vnd.oasis.opendocument.spreadsheet" ) ; f = "content.xml" ; zip . file ( f , write _content _xml ( wb , opts ) ) ; manifest . push ( [ f , "text/xml" ] ) ; rdf . push ( [ f , "ContentFile" ] ) ; f = "manifest.rdf" ; zip . file ( f , write _rdf ( rdf , opts ) ) ; manifest . push ( [ f , "application/rdf+xml" ] ) ; f = "META-INF/manifest.xml" ; zip . file ( f , write _manifest ( manifest , opts ) ) ; return zip } function fix _opts _func ( defaults ) { return function fix _opts ( opts ) { for ( var i = 0 ; i != defaults . length ; ++ i ) { var d = defaults [ i ] ; if ( opts [ d [ 0 ] ] === undefined ) opts [ d [ 0 ] ] = d [ 1 ] ; if ( d [ 2 ] === "n" ) opts [ d [ 0 ] ] = Number ( opts [ d [ 0 ] ] ) } } } var fix _read _opts = fix _opts _func ( [ [ "cellNF" , false ] , [ "cellHTML" , true ] , [ "cellFormula" , true ] , [ "cellStyles" , false ] , [ "cellDates" , false ] , [ "sheetStubs" , false ] , [ "sheetRows" , 0 , "n" ] , [ "bookDeps" , false ] , [ "bookSheets" , false ] , [ "bookProps" , false ] , [ "bookFiles" , false ] , [ "bookVBA" , false ] , [ "password" , "" ] , [ "WTF" , false ] ] ) ; var fix _write _opts = fix _opts _func ( [ [ "cellDates" , false ] , [ "bookSST" , false ] , [ "bookType" , "xlsx" ] , [ "compression" , false ] , [ "WTF" , false ] ] ) ; function get _sheet _type ( n ) { if ( RELS . WS . indexOf ( n ) > - 1 ) return "sheet" ; if ( RELS . CS && n == RELS . CS ) return "chart" ; if ( RELS . DS && n == RELS . DS ) return "dialog" ; if ( RELS . MS && n == RELS . MS ) return "macro" ; if ( ! n || ! n . length ) return "sheet" ; return n } function safe _parse _wbrels ( wbrels , sheets ) { if ( ! wbrels ) return 0 ; try { wbrels = sheets . map ( function pwbr ( w ) { if ( ! w . id ) w . id = w . strRelID ; return [ w . name , wbrels [ "!id" ] [ w . id ] . Target , get _sheet _type ( wbrels [ "!id" ] [ w . id ] . Type ) ] } ) } catch ( e ) { return null } return ! wbrels || wbrels . length === 0 ? null : wbrels } function safe _parse _sheet ( zip , path , relsPath , sheet , sheetRels , sheets , stype , opts , wb , themes , styles ) { try { sheetRels [ sheet ] = parse _rels ( getzipstr ( zip , relsPath , true ) , path ) ; var data = getzipdata ( zip , path ) ; switch ( stype ) { case "sheet" : sheets [ sheet ] = parse _ws ( data , path , opts , sheetRels [ sheet ] , wb , themes , styles ) ; break ; case "chart" : var cs = parse _cs ( data , path , opts , sheetRels [ sheet ] , wb , themes , styles ) ; sheets [ sheet ] = cs ; if ( ! cs || ! cs [ "!chart" ] ) break ; var dfile = resolve _path ( cs [ "!chart" ] . Target , path ) ; var drelsp = get _rels _path ( dfile ) ; var draw = parse _drawing ( getzipstr ( zip , dfile , true ) , parse _rels ( getzipstr ( zip , drelsp , true ) , dfile ) ) ; var chartp = resolve _path ( draw , dfile ) ; var crelsp = get _rels _path ( chartp ) ; cs = parse _chart ( getzipstr ( zip , chartp , true ) , chartp , opts , parse _rels ( getzipstr ( zip , crelsp , true ) , chartp ) , wb , cs ) ; break ; case "macro" : sheets [ sheet ] = parse _ms ( data , path , opts , sheetRels [ sheet ] , wb , themes , styles ) ; break ; case "dialog" : sheets [ sheet ] = parse _ds ( data , path , opts , sheetRels [ sheet ] , wb , themes , styles ) ; break } } catch ( e ) { if ( opts . WTF ) throw e } } var nodirs = function nodirs ( x ) { return x . slice ( - 1 ) != "/" } ; function parse _zip ( zip , opts ) { make _ssf ( SSF ) ; opts = opts || { } ; fix _read _opts ( opts ) ; reset _cp ( ) ; if ( safegetzipfile ( zip , "META-INF/manifest.xml" ) ) return parse _ods ( zip , opts ) ; if ( safegetzipfile ( zip , "objectdata.xml" ) ) return parse _ods ( zip , opts ) ; var entries = keys ( zip . files ) . filter ( nodirs ) . sort ( ) ; var dir = parse _ct ( getzipstr ( zip , "[Content_Types].xml" ) , opts ) ; var xlsb = false ; var sheets , binname ; if ( dir . workbooks . length