2016-12-31 08:20:45 +00:00
/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
2017-03-05 00:56:31 +00:00
! function ( e ) { if ( "object" == typeof exports && "undefined" != typeof module ) module . exports = e ( ) ; else if ( "function" == typeof define && define . amd ) { JSZip = e ( ) ; define ( [ ] , e ) } else { var f ; "undefined" != typeof window ? f = window : "undefined" != typeof global ? f = global : "undefined" != typeof self && ( f = self ) , f . JSZip = e ( ) } } ( function ( ) { var define , module , exports ; return function e ( t , n , r ) { function s ( o , u ) { if ( ! n [ o ] ) { if ( ! t [ o ] ) { var a = typeof require == "function" && require ; if ( ! u && a ) return a ( o , ! 0 ) ; if ( i ) return i ( o , ! 0 ) ; throw new Error ( "Cannot find module '" + o + "'" ) } var f = n [ o ] = { exports : { } } ; t [ o ] [ 0 ] . call ( f . exports , function ( e ) { var n = t [ o ] [ 1 ] [ e ] ; return s ( n ? n : e ) } , f , f . exports , e , t , n , r ) } return n [ o ] . exports } var i = typeof require == "function" && require ; for ( var o = 0 ; o < r . length ; o ++ ) s ( r [ o ] ) ; return s } ( { 1 : [ function ( _dereq _ , module , exports ) { "use strict" ; var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" ; exports . encode = function ( input , utf8 ) { var output = "" ; var chr1 , chr2 , chr3 , enc1 , enc2 , enc3 , enc4 ; var i = 0 ; while ( i < input . length ) { chr1 = input . charCodeAt ( i ++ ) ; chr2 = input . charCodeAt ( i ++ ) ; chr3 = input . charCodeAt ( i ++ ) ; enc1 = chr1 >> 2 ; enc2 = ( chr1 & 3 ) << 4 | chr2 >> 4 ; enc3 = ( chr2 & 15 ) << 2 | chr3 >> 6 ; enc4 = chr3 & 63 ; if ( isNaN ( chr2 ) ) { enc3 = enc4 = 64 } else if ( isNaN ( chr3 ) ) { enc4 = 64 } output = output + _keyStr . charAt ( enc1 ) + _keyStr . charAt ( enc2 ) + _keyStr . charAt ( enc3 ) + _keyStr . charAt ( enc4 ) } return output } ; exports . decode = function ( input , utf8 ) { var output = "" ; var chr1 , chr2 , chr3 ; var enc1 , enc2 , enc3 , enc4 ; var i = 0 ; input = input . replace ( /[^A-Za-z0-9\+\/\=]/g , "" ) ; while ( i < input . length ) { enc1 = _keyStr . indexOf ( input . charAt ( i ++ ) ) ; enc2 = _keyStr . indexOf ( input . charAt ( i ++ ) ) ; enc3 = _keyStr . indexOf ( input . charAt ( i ++ ) ) ; enc4 = _keyStr . indexOf ( input . charAt ( i ++ ) ) ; chr1 = enc1 << 2 | enc2 >> 4 ; chr2 = ( enc2 & 15 ) << 4 | enc3 >> 2 ; chr3 = ( enc3 & 3 ) << 6 | enc4 ; output = output + String . fromCharCode ( chr1 ) ; if ( enc3 != 64 ) { output = output + String . fromCharCode ( chr2 ) } if ( enc4 != 64 ) { output = output + String . fromCharCode ( chr3 ) } } return output } } , { } ] , 2 : [ function ( _dereq _ , module , exports ) { "use strict" ; function CompressedObject ( ) { this . compressedSize = 0 ; this . uncompressedSize = 0 ; this . crc32 = 0 ; this . compressionMethod = null ; this . compressedContent = null } CompressedObject . prototype = { getContent : function ( ) { return null } , getCompressedContent : function ( ) { return null } } ; module . exports = CompressedObject } , { } ] , 3 : [ function ( _dereq _ , module , exports ) { "use strict" ; exports . STORE = { magic : "\0\0" , compress : function ( content ) { return content } , uncompress : function ( content ) { return content } , compressInputType : null , uncompressInputType : null } ; exports . DEFLATE = _dereq _ ( "./flate" ) } , { "./flate" : 8 } ] , 4 : [ function ( _dereq _ , module , exports ) { "use strict" ; var utils = _dereq _ ( "./utils" ) ; var table = [ 0 , 1996959894 , 3993919788 , 2567524794 , 124634137 , 1886057615 , 3915621685 , 2657392035 , 249268274 , 2044508324 , 3772115230 , 2547177864 , 162941995 , 2125561021 , 3887607047 , 2428444049 , 498536548 , 1789927666 , 4089016648 , 2227061214 , 450548861 , 1843258603 , 4107580753 , 2211677639 , 325883990 , 1684777152 , 4251122042 , 2321926636 , 335633487 , 1661365465 , 4195302755 , 2366115317 , 997073096 , 1281953886 , 3579855332 , 2724688242 , 1006888145 , 1258607687 , 3524101629 , 2768942443 , 901097722 , 1119000684 , 3686517206 , 2898065728 , 853044451 , 1172266101 , 3705015759 , 2882616665 , 651767980 , 1373503546 , 3369554304 , 3218104598 , 565507253 , 1454621731 , 3485111705 , 3099436303 , 671266974 , 1594198024 , 3322730930 , 2970347812 , 795835527 , 1483230225 , 3244367275 , 3060149565 , 1994146192 , 31158534 , 2563907772 , 4023717930 , 1907459465 , 112637215 , 2680153253 , 3904427059 , 2013776290 , 251722036 , 2517215374 , 3775830040 , 2137656763 , 141376813 , 2439277719 , 3865271297 , 1802195444 , 476864866 , 2238001368 , 4066508878 , 1812370925 , 453092731 , 2181625025 , 4111451223 , 1706088902 , 314042704 , 2344532202 , 4240017532 , 1658658271 , 366619977 , 2362670323 , 4224994405 , 1303535960 , 984961486 , 2747007092 , 3569037538 , 1256170817 , 1037604311 , 2765210733 , 3554079995 , 1131014506 , 879679996 , 2909243462 , 3663771856 , 1141124467 , 855842277 , 2852801631 , 3708648649 , 1342533948 , 654459306 , 3188396048 , 3373015174 , 1466479909 , 544179635 , 3110523913 , 3462522015 , 1591671054 , 702138776 , 2966460450 , 3352799412 , 1504918807 , 783551873 , 3082640443 , 3233442989 , 3988292384 , 2596254646 , 62317068 , 1957810842 , 3939845945 , 2647816111 , 81470997 , 1943803523 , 3814918930 , 2489596804 , 225274430 , 2053790376 , 3826175755 , 2466906013 , 1
} return res } ; exports . findCompression = function ( compressionMethod ) { for ( var method in compressions ) { if ( ! compressions . hasOwnProperty ( method ) ) { continue } if ( compressions [ method ] . magic === compressionMethod ) { return compressions [ method ] } } return null } ; exports . isRegExp = function ( object ) { return Object . prototype . toString . call ( object ) === "[object RegExp]" } } , { "./compressions" : 3 , "./nodeBuffer" : 11 , "./support" : 17 } ] , 22 : [ function ( _dereq _ , module , exports ) { "use strict" ; var StringReader = _dereq _ ( "./stringReader" ) ; var NodeBufferReader = _dereq _ ( "./nodeBufferReader" ) ; var Uint8ArrayReader = _dereq _ ( "./uint8ArrayReader" ) ; var utils = _dereq _ ( "./utils" ) ; var sig = _dereq _ ( "./signature" ) ; var ZipEntry = _dereq _ ( "./zipEntry" ) ; var support = _dereq _ ( "./support" ) ; var jszipProto = _dereq _ ( "./object" ) ; function ZipEntries ( data , loadOptions ) { this . files = [ ] ; this . loadOptions = loadOptions ; if ( data ) { this . load ( data ) } } ZipEntries . prototype = { checkSignature : function ( expectedSignature ) { var signature = this . reader . readString ( 4 ) ; if ( signature !== expectedSignature ) { throw new Error ( "Corrupted zip or bug : unexpected signature " + "(" + utils . pretty ( signature ) + ", expected " + utils . pretty ( expectedSignature ) + ")" ) } } , readBlockEndOfCentral : function ( ) { this . diskNumber = this . reader . readInt ( 2 ) ; this . diskWithCentralDirStart = this . reader . readInt ( 2 ) ; this . centralDirRecordsOnThisDisk = this . reader . readInt ( 2 ) ; this . centralDirRecords = this . reader . readInt ( 2 ) ; this . centralDirSize = this . reader . readInt ( 4 ) ; this . centralDirOffset = this . reader . readInt ( 4 ) ; this . zipCommentLength = this . reader . readInt ( 2 ) ; this . zipComment = this . reader . readString ( this . zipCommentLength ) ; this . zipComment = jszipProto . utf8decode ( this . zipComment ) } , readBlockZip64EndOfCentral : function ( ) { this . zip64EndOfCentralSize = this . reader . readInt ( 8 ) ; this . versionMadeBy = this . reader . readString ( 2 ) ; this . versionNeeded = this . reader . readInt ( 2 ) ; this . diskNumber = this . reader . readInt ( 4 ) ; this . diskWithCentralDirStart = this . reader . readInt ( 4 ) ; this . centralDirRecordsOnThisDisk = this . reader . readInt ( 8 ) ; this . centralDirRecords = this . reader . readInt ( 8 ) ; this . centralDirSize = this . reader . readInt ( 8 ) ; this . centralDirOffset = this . reader . readInt ( 8 ) ; this . zip64ExtensibleData = { } ; var extraDataSize = this . zip64EndOfCentralSize - 44 , index = 0 , extraFieldId , extraFieldLength , extraFieldValue ; while ( index < extraDataSize ) { extraFieldId = this . reader . readInt ( 2 ) ; extraFieldLength = this . reader . readInt ( 4 ) ; extraFieldValue = this . reader . readString ( extraFieldLength ) ; this . zip64ExtensibleData [ extraFieldId ] = { id : extraFieldId , length : extraFieldLength , value : extraFieldValue } } } , readBlockZip64EndOfCentralLocator : function ( ) { this . diskWithZip64CentralDirStart = this . reader . readInt ( 4 ) ; this . relativeOffsetEndOfZip64CentralDir = this . reader . readInt ( 8 ) ; this . disksCount = this . reader . readInt ( 4 ) ; if ( this . disksCount > 1 ) { throw new Error ( "Multi-volumes zip are not supported" ) } } , readLocalFiles : function ( ) { var i , file ; for ( i = 0 ; i < this . files . length ; i ++ ) { file = this . files [ i ] ; this . reader . setIndex ( file . localHeaderOffset ) ; this . checkSignature ( sig . LOCAL _FILE _HEADER ) ; file . readLocalPart ( this . reader ) ; file . handleUTF8 ( ) } } , readCentralDir : function ( ) { var file ; this . reader . setIndex ( this . centralDirOffset ) ; while ( this . reader . readString ( 4 ) === sig . CENTRAL _FILE _HEADER ) { file = new ZipEntry ( { zip64 : this . zip64 } , this . loadOptions ) ; file . readCentralPart ( this . reader ) ; this . files . push ( file ) } } , readEndOfCentral : function ( ) { var offset = this . reader . lastIndexOfSignature ( sig . CENTRAL _DIRECTORY _END ) ; if ( offset === - 1 ) { throw new Error ( "Corrupted zip : can't find end of central directory" ) } this . reader . setIndex ( offset ) ; this . checkSignature ( sig . CENTRAL _DIRECTORY _END ) ; this . readBlockEndOfCentral ( ) ; if ( this . diskNumber === utils . MAX _VALUE _16BITS || this . diskWithCentralDirStart === utils . MAX _VALUE _16BITS || this . centralDirRecordsOnThisDisk === utils . MAX _VALUE _16BITS || this . centralDirRecords === utils . MAX _VALUE _16BITS || this . centralDirSize === utils . MAX _VALUE _32BITS || this . centralDirOffset === utils . MAX _VALUE _32BITS ) { this . zip64 = true ; offset = this . reader . lastIndexOfSignature ( sig . ZIP64 _CENTRAL _DIRECTORY _LOCATOR ) ; if ( offset === - 1 ) { throw new Error ( "Corrupted zip : can't find the ZIP64 end of central directory locator" ) } this . reader . setIndex ( offset ) ; this . checkSignature ( sig . ZIP64 _CENTRAL _D
2016-12-31 08:20:45 +00:00
var bflush ; for ( ; ; ) { if ( s . lookahead === 0 ) { fill _window ( s ) ; if ( s . lookahead === 0 ) { if ( flush === Z _NO _FLUSH ) { return BS _NEED _MORE } break } } s . match _length = 0 ; bflush = trees . _tr _tally ( s , 0 , s . window [ s . strstart ] ) ; s . lookahead -- ; s . strstart ++ ; if ( bflush ) { flush _block _only ( s , false ) ; if ( s . strm . avail _out === 0 ) { return BS _NEED _MORE } } } s . insert = 0 ; if ( flush === Z _FINISH ) { flush _block _only ( s , true ) ; if ( s . strm . avail _out === 0 ) { return BS _FINISH _STARTED } return BS _FINISH _DONE } if ( s . last _lit ) { flush _block _only ( s , false ) ; if ( s . strm . avail _out === 0 ) { return BS _NEED _MORE } } return BS _BLOCK _DONE } var Config = function ( good _length , max _lazy , nice _length , max _chain , func ) { this . good _length = good _length ; this . max _lazy = max _lazy ; this . nice _length = nice _length ; this . max _chain = max _chain ; this . func = func } ; var configuration _table ; configuration _table = [ new Config ( 0 , 0 , 0 , 0 , deflate _stored ) , new Config ( 4 , 4 , 8 , 4 , deflate _fast ) , new Config ( 4 , 5 , 16 , 8 , deflate _fast ) , new Config ( 4 , 6 , 32 , 32 , deflate _fast ) , new Config ( 4 , 4 , 16 , 16 , deflate _slow ) , new Config ( 8 , 16 , 32 , 32 , deflate _slow ) , new Config ( 8 , 16 , 128 , 128 , deflate _slow ) , new Config ( 8 , 32 , 128 , 256 , deflate _slow ) , new Config ( 32 , 128 , 258 , 1024 , deflate _slow ) , new Config ( 32 , 258 , 258 , 4096 , deflate _slow ) ] ; function lm _init ( s ) { s . window _size = 2 * s . w _size ; zero ( s . head ) ; s . max _lazy _match = configuration _table [ s . level ] . max _lazy ; s . good _match = configuration _table [ s . level ] . good _length ; s . nice _match = configuration _table [ s . level ] . nice _length ; s . max _chain _length = configuration _table [ s . level ] . max _chain ; s . strstart = 0 ; s . block _start = 0 ; s . lookahead = 0 ; s . insert = 0 ; s . match _length = s . prev _length = MIN _MATCH - 1 ; s . match _available = 0 ; s . ins _h = 0 } function DeflateState ( ) { this . strm = null ; this . status = 0 ; this . pending _buf = null ; this . pending _buf _size = 0 ; this . pending _out = 0 ; this . pending = 0 ; this . wrap = 0 ; this . gzhead = null ; this . gzindex = 0 ; this . method = Z _DEFLATED ; this . last _flush = - 1 ; this . w _size = 0 ; this . w _bits = 0 ; this . w _mask = 0 ; this . window = null ; this . window _size = 0 ; this . prev = null ; this . head = null ; this . ins _h = 0 ; this . hash _size = 0 ; this . hash _bits = 0 ; this . hash _mask = 0 ; this . hash _shift = 0 ; this . block _start = 0 ; this . match _length = 0 ; this . prev _match = 0 ; this . match _available = 0 ; this . strstart = 0 ; this . match _start = 0 ; this . lookahead = 0 ; this . prev _length = 0 ; this . max _chain _length = 0 ; this . max _lazy _match = 0 ; this . level = 0 ; this . strategy = 0 ; this . good _match = 0 ; this . nice _match = 0 ; this . dyn _ltree = new utils . Buf16 ( HEAP _SIZE * 2 ) ; this . dyn _dtree = new utils . Buf16 ( ( 2 * D _CODES + 1 ) * 2 ) ; this . bl _tree = new utils . Buf16 ( ( 2 * BL _CODES + 1 ) * 2 ) ; zero ( this . dyn _ltree ) ; zero ( this . dyn _dtree ) ; zero ( this . bl _tree ) ; this . l _desc = null ; this . d _desc = null ; this . bl _desc = null ; this . bl _count = new utils . Buf16 ( MAX _BITS + 1 ) ; this . heap = new utils . Buf16 ( 2 * L _CODES + 1 ) ; zero ( this . heap ) ; this . heap _len = 0 ; this . heap _max = 0 ; this . depth = new utils . Buf16 ( 2 * L _CODES + 1 ) ; zero ( this . depth ) ; this . l _buf = 0 ; this . lit _bufsize = 0 ; this . last _lit = 0 ; this . d _buf = 0 ; this . opt _len = 0 ; this . static _len = 0 ; this . matches = 0 ; this . insert = 0 ; this . bi _buf = 0 ; this . bi _valid = 0 } function deflateResetKeep ( strm ) { var s ; if ( ! strm || ! strm . state ) { return err ( strm , Z _STREAM _ERROR ) } strm . total _in = strm . total _out = 0 ; strm . data _type = Z _UNKNOWN ; s = strm . state ; s . pending = 0 ; s . pending _out = 0 ; if ( s . wrap < 0 ) { s . wrap = - s . wrap } s . status = s . wrap ? INIT _STATE : BUSY _STATE ; strm . adler = s . wrap === 2 ? 0 : 1 ; s . last _flush = Z _NO _FLUSH ; trees . _tr _init ( s ) ; return Z _OK } function deflateReset ( strm ) { var ret = deflateResetKeep ( strm ) ; if ( ret === Z _OK ) { lm _init ( strm . state ) } return ret } function deflateSetHeader ( strm , head ) { if ( ! strm || ! strm . state ) { return Z _STREAM _ERROR } if ( strm . state . wrap !== 2 ) { return Z _STREAM _ERROR } strm . state . gzhead = head ; return Z _OK } function deflateInit2 ( strm , level , method , windowBits , memLevel , strategy ) { if ( ! strm ) { return Z _STREAM _ERROR } var wrap = 1 ; if ( level === Z _DEFAULT _COMPRESSION ) { level = 6 } if ( windowBits < 0 ) { wrap = 0 ; windowBits = - windowBits } else if ( windowBits > 15 ) { wrap = 2 ; windowBits -= 16 } if ( memLevel < 1 || memLevel > MAX _MEM _LEVEL || method !== Z _DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z _FIXED ) { return err ( strm , Z _STREAM _ERROR ) } if ( windowBits === 8 ) { windowBits = 9 } var s = new DeflateState ; strm . state = s ; s . strm = strm ; s . wrap = wrap ; s . gzhead = null ; s . w _bits = windowBits ; s . w _size = 1 << s . w _bits ; s . w _mask = s . w _size - 1 ; s . hash _bits = memLevel + 7 ; s . hash _size = 1 << s . hash _bits ; s . hash _mask = s . hash _size - 1 ; s . hash _shift = ~ ~ ( ( s . hash _b
2017-03-16 01:17:24 +00:00
exports . inflateInfo = "pako inflate (from Nodeca project)" } , { "../utils/common" : 27 , "./adler32" : 29 , "./crc32" : 31 , "./inffast" : 34 , "./inftrees" : 36 } ] , 36 : [ function ( _dereq _ , module , exports ) { "use strict" ; var utils = _dereq _ ( "../utils/common" ) ; var MAXBITS = 15 ; var ENOUGH _LENS = 852 ; var ENOUGH _DISTS = 592 ; var CODES = 0 ; var LENS = 1 ; var DISTS = 2 ; var lbase = [ 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 13 , 15 , 17 , 19 , 23 , 27 , 31 , 35 , 43 , 51 , 59 , 67 , 83 , 99 , 115 , 131 , 163 , 195 , 227 , 258 , 0 , 0 ] ; var lext = [ 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 17 , 17 , 17 , 17 , 18 , 18 , 18 , 18 , 19 , 19 , 19 , 19 , 20 , 20 , 20 , 20 , 21 , 21 , 21 , 21 , 16 , 72 , 78 ] ; var dbase = [ 1 , 2 , 3 , 4 , 5 , 7 , 9 , 13 , 17 , 25 , 33 , 49 , 65 , 97 , 129 , 193 , 257 , 385 , 513 , 769 , 1025 , 1537 , 2049 , 3073 , 4097 , 6145 , 8193 , 12289 , 16385 , 24577 , 0 , 0 ] ; var dext = [ 16 , 16 , 16 , 16 , 17 , 17 , 18 , 18 , 19 , 19 , 20 , 20 , 21 , 21 , 22 , 22 , 23 , 23 , 24 , 24 , 25 , 25 , 26 , 26 , 27 , 27 , 28 , 28 , 29 , 29 , 64 , 64 ] ; module . exports = function inflate _table ( type , lens , lens _index , codes , table , table _index , work , opts ) { var bits = opts . bits ; var len = 0 ; var sym = 0 ; var min = 0 , max = 0 ; var root = 0 ; var curr = 0 ; var drop = 0 ; var left = 0 ; var used = 0 ; var huff = 0 ; var incr ; var fill ; var low ; var mask ; var next ; var base = null ; var base _index = 0 ; var end ; var count = new utils . Buf16 ( MAXBITS + 1 ) ; var offs = new utils . Buf16 ( MAXBITS + 1 ) ; var extra = null ; var extra _index = 0 ; var here _bits , here _op , here _val ; for ( len = 0 ; len <= MAXBITS ; len ++ ) { count [ len ] = 0 } for ( sym = 0 ; sym < codes ; sym ++ ) { count [ lens [ lens _index + sym ] ] ++ } root = bits ; for ( max = MAXBITS ; max >= 1 ; max -- ) { if ( count [ max ] !== 0 ) { break } } if ( root > max ) { root = max } if ( max === 0 ) { table [ table _index ++ ] = 1 << 24 | 64 << 16 | 0 ; table [ table _index ++ ] = 1 << 24 | 64 << 16 | 0 ; opts . bits = 1 ; return 0 } for ( min = 1 ; min < max ; min ++ ) { if ( count [ min ] !== 0 ) { break } } if ( root < min ) { root = min } left = 1 ; for ( len = 1 ; len <= MAXBITS ; len ++ ) { left <<= 1 ; left -= count [ len ] ; if ( left < 0 ) { return - 1 } } if ( left > 0 && ( type === CODES || max !== 1 ) ) { return - 1 } offs [ 1 ] = 0 ; for ( len = 1 ; len < MAXBITS ; len ++ ) { offs [ len + 1 ] = offs [ len ] + count [ len ] } for ( sym = 0 ; sym < codes ; sym ++ ) { if ( lens [ lens _index + sym ] !== 0 ) { work [ offs [ lens [ lens _index + sym ] ] ++ ] = sym } } if ( type === CODES ) { base = extra = work ; end = 19 } else if ( type === LENS ) { base = lbase ; base _index -= 257 ; extra = lext ; extra _index -= 257 ; end = 256 } else { base = dbase ; extra = dext ; end = - 1 } huff = 0 ; sym = 0 ; len = min ; next = table _index ; curr = root ; drop = 0 ; low = - 1 ; used = 1 << root ; mask = used - 1 ; if ( type === LENS && used > ENOUGH _LENS || type === DISTS && used > ENOUGH _DISTS ) { return 1 } var i = 0 ; for ( ; ; ) { i ++ ; here _bits = len - drop ; if ( work [ sym ] < end ) { here _op = 0 ; here _val = work [ sym ] } else if ( work [ sym ] > end ) { here _op = extra [ extra _index + work [ sym ] ] ; here _val = base [ base _index + work [ sym ] ] } else { here _op = 32 + 64 ; here _val = 0 } incr = 1 << len - drop ; fill = 1 << curr ; min = fill ; do { fill -= incr ; table [ next + ( huff >> drop ) + fill ] = here _bits << 24 | here _op << 16 | here _val | 0 } while ( fill !== 0 ) ; incr = 1 << len - 1 ; while ( huff & incr ) { incr >>= 1 } if ( incr !== 0 ) { huff &= incr - 1 ; huff += incr } else { huff = 0 } sym ++ ; if ( -- count [ len ] === 0 ) { if ( len === max ) { break } len = lens [ lens _index + work [ sym ] ] } if ( len > root && ( huff & mask ) !== low ) { if ( drop === 0 ) { drop = root } next += min ; curr = len - drop ; left = 1 << curr ; while ( curr + drop < max ) { left -= count [ curr + drop ] ; if ( left <= 0 ) { break } curr ++ ; left <<= 1 } used += 1 << curr ; if ( type === LENS && used > ENOUGH _LENS || type === DISTS && used > ENOUGH _DISTS ) { return 1 } low = huff & mask ; table [ low ] = root << 24 | curr << 16 | next - table _index | 0 } } if ( huff !== 0 ) { table [ next + huff ] = len - drop << 24 | 64 << 16 | 0 } opts . bits = root ; return 0 } } , { "../utils/common" : 27 } ] , 37 : [ function ( _dereq _ , module , exports ) { "use strict" ; module . exports = { 2 : "need dictionary" , 1 : "stream end" , 0 : "" , "-1" : "file error" , "-2" : "stream error" , "-3" : "data error" , "-4" : "insufficient memory" , "-5" : "buffer error" , "-6" : "incompatible version" } } , { } ] , 38 : [ function ( _dereq _ , module , exports ) { "use strict" ; var utils = _dereq _ ( "../utils/common" ) ; var Z _FIXED = 4 ; var Z _BINARY = 0 ; var Z _TEXT = 1 ; var Z _UNKNOWN = 2 ; function zero ( buf ) { var len = buf . length ; while ( -- len >= 0 ) { buf [ len ] = 0 } } var STORED _BLOCK = 0 ; var STATIC _TREES = 1 ; var DYN _TREES = 2 ; var MIN _MATCH = 3 ; var MAX _MATCH = 258 ; var LENGTH _CODES = 29 ; var LITERALS = 256 ; var L _CODES = LITERALS + 1 + LENGTH _CODES ; var D _CODES = 30 ; var BL _CODES = 19 ; var HEAP _SIZE = 2 * L _CODES + 1 ; var MAX _BITS = 15 ; var Buf _size = 16 ; var MAX _BL _BITS = 7 ; var END _BLOCK = 256 ; var REP _3 _6 = 16 ; var REPZ _3 _10 = 17 ; var REPZ _11 _138 = 18 ; var extra _lbits = [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 2 , 2 , 2 , 2 , 3 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 0 ] ; var extra _dbits = [ 0 , 0 , 0 , 0 , 1 , 1 , 2 , 2 , 3 , 3 , 4 , 4 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , 12 , 13 , 13 ] ; var extra _blbits = [ 0 , 0 , 0
} ) ; return fmt . indexOf ( "0." ) !== - 1 ? o : o . replace ( /^0\./ , "." ) } fmt = fmt . replace ( /^#+([0.])/ , "$1" ) ; if ( r = fmt . match ( /^(0*)\.(#*)$/ ) ) { return sign + ( "" + aval ) . replace ( /\.(\d*[1-9])0*$/ , ".$1" ) . replace ( /^(-?\d*)$/ , "$1." ) . replace ( /^0\./ , r [ 1 ] . length ? "0." : "." ) } if ( r = fmt . match ( /^#,##0(\.?)$/ ) ) return sign + commaify ( "" + aval ) ; if ( r = fmt . match ( /^#,##0\.([#0]*0)$/ ) ) { return val < 0 ? "-" + write _num _int ( type , fmt , - val ) : commaify ( "" + val ) + "." + fill ( "0" , r [ 1 ] . length ) } if ( r = fmt . match ( /^#,#*,#0/ ) ) return write _num _int ( type , fmt . replace ( /^#,#*,/ , "" ) , val ) ; if ( r = fmt . match ( /^([0#]+)(\\?-([0#]+))+$/ ) ) { o = _strrev ( write _num _int ( type , fmt . replace ( /[\\-]/g , "" ) , val ) ) ; ri = 0 ; return _strrev ( _strrev ( fmt . replace ( /\\/g , "" ) ) . replace ( /[0#]/g , function ( x ) { return ri < o . length ? o [ ri ++ ] : x === "0" ? "0" : "" } ) ) } if ( fmt . match ( phone ) ) { o = write _num _int ( type , "##########" , val ) ; return "(" + o . substr ( 0 , 3 ) + ") " + o . substr ( 3 , 3 ) + "-" + o . substr ( 6 ) } var oa = "" ; if ( r = fmt . match ( /^([#0?]+)( ?)\/( ?)([#0?]+)/ ) ) { ri = Math . min ( r [ 4 ] . length , 7 ) ; ff = frac ( aval , Math . pow ( 10 , ri ) - 1 , false ) ; o = "" + sign ; oa = write _num ( "n" , r [ 1 ] , ff [ 1 ] ) ; if ( oa [ oa . length - 1 ] == " " ) oa = oa . substr ( 0 , oa . length - 1 ) + "0" ; o += oa + r [ 2 ] + "/" + r [ 3 ] ; oa = rpad _ ( ff [ 2 ] , ri ) ; if ( oa . length < r [ 4 ] . length ) oa = hashq ( r [ 4 ] . substr ( r [ 4 ] . length - oa . length ) ) + oa ; o += oa ; return o } if ( r = fmt . match ( /^# ([#0?]+)( ?)\/( ?)([#0?]+)/ ) ) { ri = Math . min ( Math . max ( r [ 1 ] . length , r [ 4 ] . length ) , 7 ) ; ff = frac ( aval , Math . pow ( 10 , ri ) - 1 , true ) ; return sign + ( ff [ 0 ] || ( ff [ 1 ] ? "" : "0" ) ) + " " + ( ff [ 1 ] ? pad _ ( ff [ 1 ] , ri ) + r [ 2 ] + "/" + r [ 3 ] + rpad _ ( ff [ 2 ] , ri ) : fill ( " " , 2 * ri + 1 + r [ 2 ] . length + r [ 3 ] . length ) ) } if ( r = fmt . match ( /^[#0?]+$/ ) ) { o = "" + val ; if ( fmt . length <= o . length ) return o ; return hashq ( fmt . substr ( 0 , fmt . length - o . length ) ) + o } if ( r = fmt . match ( /^([#0]+)\.([#0]+)$/ ) ) { o = "" + val . toFixed ( Math . min ( r [ 2 ] . length , 10 ) ) . replace ( /([^0])0+$/ , "$1" ) ; ri = o . indexOf ( "." ) ; var lres = fmt . indexOf ( "." ) - ri , rres = fmt . length - o . length - lres ; return hashq ( fmt . substr ( 0 , lres ) + o + fmt . substr ( fmt . length - rres ) ) } if ( r = fmt . match ( /^00,000\.([#0]*0)$/ ) ) { return val < 0 ? "-" + write _num _int ( type , fmt , - val ) : commaify ( "" + val ) . replace ( /^\d,\d{3}$/ , "0$&" ) . replace ( /^\d*$/ , function ( $$ ) { return "00," + ( $$ . length < 3 ? pad0 ( 0 , 3 - $$ . length ) : "" ) + $$ } ) + "." + pad0 ( 0 , r [ 1 ] . length ) } switch ( fmt ) { case "#,###" : var x = commaify ( "" + aval ) ; return x !== "0" ? sign + x : "" ; default : } throw new Error ( "unsupported format |" + fmt + "|" ) } return function write _num ( type , fmt , val ) { return ( val | 0 ) === val ? write _num _int ( type , fmt , val ) : write _num _flt ( type , fmt , val ) } } ( ) ; function split _fmt ( fmt ) { var out = [ ] ; var in _str = false , cc ; for ( var i = 0 , j = 0 ; i < fmt . length ; ++ i ) switch ( cc = fmt . charCodeAt ( i ) ) { case 34 : in _str = ! in _str ; break ; case 95 : case 42 : case 92 : ++ i ; break ; case 59 : out [ out . length ] = fmt . substr ( j , i - j ) ; j = i + 1 } out [ out . length ] = fmt . substr ( j ) ; if ( in _str === true ) throw new Error ( "Format |" + fmt + "| unterminated string " ) ; return out } SSF . _split = split _fmt ; var abstime = /\[[HhMmSs]*\]/ ; function eval _fmt ( fmt , v , opts , flen ) { var out = [ ] , o = "" , i = 0 , c = "" , lst = "t" , q , dt , j , cc ; var hr = "H" ; while ( i < fmt . length ) { switch ( c = fmt . charAt ( i ) ) { case "G" : if ( ! isgeneral ( fmt , i ) ) throw new Error ( "unrecognized character " + c + " in " + fmt ) ; out [ out . length ] = { t : "G" , v : "General" } ; i += 7 ; break ; case '"' : for ( o = "" ; ( cc = fmt . charCodeAt ( ++ i ) ) !== 34 && i < fmt . length ; ) o += String . fromCharCode ( cc ) ; out [ out . length ] = { t : "t" , v : o } ; ++ i ; break ; case "\\" : var w = fmt [ ++ i ] , t = w === "(" || w === ")" ? w : "t" ; out [ out . length ] = { t : t , v : w } ; ++ i ; break ; case "_" : out [ out . length ] = { t : "t" , v : " " } ; i += 2 ; break ; case "@" : out [ out . length ] = { t : "T" , v : v } ; ++ i ; break ; case "B" : case "b" : if ( fmt [ i + 1 ] === "1" || fmt [ i + 1 ] === "2" ) { if ( dt == null ) { dt = parse _date _code ( v , opts , fmt [ i + 1 ] === "2" ) ; if ( dt == null ) return "" } out [ out . length ] = { t : "X" , v : fmt . substr ( i , 2 ) } ; lst = c ; i += 2 ; break } case "M" : case "D" : case "Y" : case "H" : case "S" : case "E" : c = c . toLowerCase ( ) ; case "m" : case "d" : case "y" : case "h" : case "s" : case "e" : case "g" : if ( v < 0 ) return "" ; if ( dt == null ) { dt = parse _date _code ( v , opts ) ; if ( dt == null ) return "" } o = c ; while ( ++ i < fmt . length && fmt [ i ] . toLowerCase ( ) === c ) o += c ; if ( c === "m" && lst . toLowerCase ( ) === "h" ) c = "M" ; if ( c === "h" ) c = hr ; out [ out . length ] = { t : c , v : o } ; lst = c ; break ; case "A" : q = { t : c , v : "A" } ; if ( dt == null ) dt = parse _date _code ( v , opts ) ; if ( fmt . substr ( i , 3 ) === "A/P" ) { if ( dt != null ) q . v = dt . H >= 12 ? "P" : "A" ; q . t = "T" ; hr = "h" ; i += 3 } else if ( fmt . substr ( i , 5 ) === "AM/PM" ) { if ( dt != null ) q . v = dt . H >= 12 ? "PM" : "AM" ; q . t = "T" ; i += 5 ; hr = "h" } else { q . t = "t" ; ++ i } if ( dt == null && q . t === " T
o += String . fromCharCode ( _ _readUInt16LE ( this , loc ) ) ; loc += 2 } size *= 2 ; break ; case "utf8" : o = _ _utf8 ( this , this . l , this . l + size ) ; break ; case "utf16le" : size *= 2 ; o = _ _utf16le ( this , this . l , this . l + size ) ; break ; case "wstr" : if ( typeof cptable !== "undefined" ) o = cptable . utils . decode ( current _codepage , this . slice ( this . l , this . l + 2 * size ) ) ; else return ReadShift . call ( this , size , "dbcs" ) ; size = 2 * size ; break ; case "lpstr" : o = _ _lpstr ( this , this . l ) ; size = 5 + o . length ; break ; case "lpwstr" : o = _ _lpwstr ( this , this . l ) ; size = 5 + o . length ; if ( o [ o . length - 1 ] == "\0" ) size += 2 ; break ; case "cstr" : size = 0 ; o = "" ; while ( ( w = _ _readUInt8 ( this , this . l + size ++ ) ) !== 0 ) oo . push ( _getchar ( w ) ) ; o = oo . join ( "" ) ; break ; case "wstr" : size = 0 ; o = "" ; while ( ( w = _ _readUInt16LE ( this , this . l + size ) ) !== 0 ) { oo . push ( _getchar ( w ) ) ; size += 2 } size += 2 ; o = oo . join ( "" ) ; break ; case "dbcs-cont" : o = "" ; loc = this . l ; for ( i = 0 ; i != size ; ++ i ) { if ( this . lens && this . lens . indexOf ( loc ) !== - 1 ) { w = _ _readUInt8 ( this , loc ) ; this . l = loc + 1 ; vv = ReadShift . call ( this , size - i , w ? "dbcs-cont" : "sbcs-cont" ) ; return oo . join ( "" ) + vv } oo . push ( _getchar ( _ _readUInt16LE ( this , loc ) ) ) ; loc += 2 } o = oo . join ( "" ) ; size *= 2 ; break ; case "sbcs-cont" : o = "" ; loc = this . l ; for ( i = 0 ; i != size ; ++ i ) { if ( this . lens && this . lens . indexOf ( loc ) !== - 1 ) { w = _ _readUInt8 ( this , loc ) ; this . l = loc + 1 ; vv = ReadShift . call ( this , size - i , w ? "dbcs-cont" : "sbcs-cont" ) ; return oo . join ( "" ) + vv } oo . push ( _getchar ( _ _readUInt8 ( this , loc ) ) ) ; loc += 1 } o = oo . join ( "" ) ; break ; default : switch ( size ) { case 1 : oI = _ _readUInt8 ( this , this . l ) ; this . l ++ ; return oI ; case 2 : oI = ( t === "i" ? _ _readInt16LE : _ _readUInt16LE ) ( this , this . l ) ; this . l += 2 ; return oI ; case 4 : if ( t === "i" || ( this [ this . l + 3 ] & 128 ) === 0 ) { oI = _ _readInt32LE ( this , this . l ) ; this . l += 4 ; return oI } else { oR = _ _readUInt32LE ( this , this . l ) ; this . l += 4 } return oR ; case 8 : if ( t === "f" ) { oR = _ _double ( this , this . l ) ; this . l += 8 ; return oR } case 16 : o = _ _hexlify ( this , this . l , size ) ; break } } this . l += size ; return o } var _ _writeUInt16LE = function ( b , val , idx ) { b [ idx ] = val & 255 ; b [ idx + 1 ] = val >>> 8 & 255 } ; var _ _writeUInt32LE = function ( b , val , idx ) { b [ idx ] = val & 255 ; b [ idx + 1 ] = val >>> 8 & 255 ; b [ idx + 2 ] = val >>> 16 & 255 ; b [ idx + 3 ] = val >>> 24 & 255 } ; var _ _writeInt32LE = function ( b , val , idx ) { b [ idx ] = val & 255 ; b [ idx + 1 ] = val >> 8 & 255 ; b [ idx + 2 ] = val >> 16 & 255 ; b [ idx + 3 ] = val >> 24 & 255 } ; function WriteShift ( t , val , f ) { var size = 0 , i = 0 ; if ( f === "dbcs" ) { for ( i = 0 ; i != val . length ; ++ i ) _ _writeUInt16LE ( this , val . charCodeAt ( i ) , this . l + 2 * i ) ; size = 2 * val . length } else if ( f === "sbcs" ) { for ( i = 0 ; i != val . length ; ++ i ) this [ this . l + i ] = val . charCodeAt ( i ) & 255 ; size = val . length } else switch ( t ) { case 1 : size = 1 ; this [ this . l ] = val & 255 ; break ; case 2 : size = 2 ; this [ this . l ] = val & 255 ; val >>>= 8 ; this [ this . l + 1 ] = val & 255 ; break ; case 3 : size = 3 ; this [ this . l ] = val & 255 ; val >>>= 8 ; this [ this . l + 1 ] = val & 255 ; val >>>= 8 ; this [ this . l + 2 ] = val & 255 ; break ; case 4 : size = 4 ; _ _writeUInt32LE ( this , val , this . l ) ; break ; case 8 : size = 8 ; if ( f === "f" ) { write _double _le ( this , val , this . l ) ; break } case 16 : break ; case - 4 : size = 4 ; _ _writeInt32LE ( this , val , this . l ) ; break } this . l += size ; return this } function CheckField ( hexstr , fld ) { var m = _ _hexlify ( this , this . l , hexstr . length >> 1 ) ; if ( m !== hexstr ) throw fld + "Expected " + hexstr + " saw " + m ; this . l += hexstr . length >> 1 } function prep _blob ( blob , pos ) { blob . l = pos ; blob . read _shift = ReadShift ; blob . chk = CheckField ; blob . write _shift = WriteShift } function parsenoop ( blob , length ) { blob . l += length } function writenoop ( blob , length ) { blob . l += length } function new _buf ( sz ) { var o = new _raw _buf ( sz ) ; prep _blob ( o , 0 ) ; return o } function recordhopper ( data , cb , opts ) { if ( ! data ) return ; var tmpbyte , cntbyte , length ; prep _blob ( data , data . l || 0 ) ; while ( data . l < data . length ) { var RT = data . read _shift ( 1 ) ; if ( RT & 128 ) RT = ( RT & 127 ) + ( ( data . read _shift ( 1 ) & 127 ) << 7 ) ; var R = XLSBRecordEnum [ RT ] || XLSBRecordEnum [ 65535 ] ; tmpbyte = data . read _shift ( 1 ) ; length = tmpbyte & 127 ; for ( cntbyte = 1 ; cntbyte < 4 && tmpbyte & 128 ; ++ cntbyte ) length += ( ( tmpbyte = data . read _shift ( 1 ) ) & 127 ) << 7 * cntbyte ; var d = R . f ( data , length , opts ) ; if ( cb ( d , R , RT ) ) return } } function buf _array ( ) { var bufs = [ ] , blksz = 2048 ; var newblk = function ba _newblk ( sz ) { var o = new _buf ( sz ) ; prep _blob ( o , 0 ) ; return o } ; var curbuf = newblk ( blksz ) ; var endbuf = function ba _endbuf ( ) { if ( ! curbuf ) return ; if ( curbuf . length > curbuf . l ) curbuf = curbuf . slice ( 0 , curbuf . l ) ; if ( curbuf . length > 0 ) bufs . push ( curbuf ) ; curbuf = null } ; var next = function ba _next ( sz ) { if ( curbuf && sz < curbuf . length - curbuf . l ) return curbuf ; endbuf ( ) ; return curbuf = newblk ( Math . max ( sz + 1 , blksz ) ) } ;
function parse _FILETIME ( blob ) { var dwLowDateTime = blob . read _shift ( 4 ) , dwHighDateTime = blob . read _shift ( 4 ) ; return new Date ( ( dwHighDateTime / 1e7 * Math . pow ( 2 , 32 ) + dwLowDateTime / 1e7 - 11644473600 ) * 1e3 ) . toISOString ( ) . replace ( /\.000/ , "" ) } function parse _lpstr ( blob , type , pad ) { var str = blob . read _shift ( 0 , "lpstr" ) ; if ( pad ) blob . l += 4 - ( str . length + 1 & 3 ) & 3 ; return str } function parse _lpwstr ( blob , type , pad ) { var str = blob . read _shift ( 0 , "lpwstr" ) ; if ( pad ) blob . l += 4 - ( str . length + 1 & 3 ) & 3 ; return str } function parse _VtStringBase ( blob , stringType , pad ) { if ( stringType === 31 ) return parse _lpwstr ( blob ) ; return parse _lpstr ( blob , stringType , pad ) } function parse _VtString ( blob , t , pad ) { return parse _VtStringBase ( blob , t , pad === false ? 0 : 4 ) } function parse _VtUnalignedString ( blob , t ) { if ( ! t ) throw new Error ( "dafuq?" ) ; return parse _VtStringBase ( blob , t , 0 ) } function parse _VtVecUnalignedLpstrValue ( blob ) { var length = blob . read _shift ( 4 ) ; var ret = [ ] ; for ( var i = 0 ; i != length ; ++ i ) ret [ i ] = blob . read _shift ( 0 , "lpstr" ) ; return ret } function parse _VtVecUnalignedLpstr ( blob ) { return parse _VtVecUnalignedLpstrValue ( blob ) } function parse _VtHeadingPair ( blob ) { var headingString = parse _TypedPropertyValue ( blob , VT _USTR ) ; var headerParts = parse _TypedPropertyValue ( blob , VT _I4 ) ; return [ headingString , headerParts ] } function parse _VtVecHeadingPairValue ( blob ) { var cElements = blob . read _shift ( 4 ) ; var out = [ ] ; for ( var i = 0 ; i != cElements / 2 ; ++ i ) out . push ( parse _VtHeadingPair ( blob ) ) ; return out } function parse _VtVecHeadingPair ( blob ) { return parse _VtVecHeadingPairValue ( blob ) } function parse _dictionary ( blob , CodePage ) { var cnt = blob . read _shift ( 4 ) ; var dict = { } ; for ( var j = 0 ; j != cnt ; ++ j ) { var pid = blob . read _shift ( 4 ) ; var len = blob . read _shift ( 4 ) ; dict [ pid ] = blob . read _shift ( len , CodePage === 1200 ? "utf16le" : "utf8" ) . replace ( chr0 , "" ) . replace ( chr1 , "!" ) } if ( blob . l & 3 ) blob . l = blob . l >> 2 + 1 << 2 ; return dict } function parse _BLOB ( blob ) { var size = blob . read _shift ( 4 ) ; var bytes = blob . slice ( blob . l , blob . l + size ) ; if ( ( size & 3 ) > 0 ) blob . l += 4 - ( size & 3 ) & 3 ; return bytes } function parse _ClipboardData ( blob ) { var o = { } ; o . Size = blob . read _shift ( 4 ) ; blob . l += o . Size ; return o } function parse _VtVector ( blob , cb ) { } function parse _TypedPropertyValue ( blob , type , _opts ) { var t = blob . read _shift ( 2 ) , ret , opts = _opts || { } ; blob . l += 2 ; if ( type !== VT _VARIANT ) if ( t !== type && VT _CUSTOM . indexOf ( type ) === - 1 ) throw new Error ( "Expected type " + type + " saw " + t ) ; switch ( type === VT _VARIANT ? t : type ) { case 2 : ret = blob . read _shift ( 2 , "i" ) ; if ( ! opts . raw ) blob . l += 2 ; return ret ; case 3 : ret = blob . read _shift ( 4 , "i" ) ; return ret ; case 11 : return blob . read _shift ( 4 ) !== 0 ; case 19 : ret = blob . read _shift ( 4 ) ; return ret ; case 30 : return parse _lpstr ( blob , t , 4 ) . replace ( chr0 , "" ) ; case 31 : return parse _lpwstr ( blob ) ; case 64 : return parse _FILETIME ( blob ) ; case 65 : return parse _BLOB ( blob ) ; case 71 : return parse _ClipboardData ( blob ) ; case 80 : return parse _VtString ( blob , t , ! opts . raw && 4 ) . replace ( chr0 , "" ) ; case 81 : return parse _VtUnalignedString ( blob , t , 4 ) . replace ( chr0 , "" ) ; case 4108 : return parse _VtVecHeadingPair ( blob ) ; case 4126 : return parse _VtVecUnalignedLpstr ( blob ) ; default : throw new Error ( "TypedPropertyValue unrecognized type " + type + " " + t ) } } function parse _PropertySet ( blob , PIDSI ) { var start _addr = blob . l ; var size = blob . read _shift ( 4 ) ; var NumProps = blob . read _shift ( 4 ) ; var Props = [ ] , i = 0 ; var CodePage = 0 ; var Dictionary = - 1 , DictObj = { } ; for ( i = 0 ; i != NumProps ; ++ i ) { var PropID = blob . read _shift ( 4 ) ; var Offset = blob . read _shift ( 4 ) ; Props [ i ] = [ PropID , Offset + start _addr ] } var PropH = { } ; for ( i = 0 ; i != NumProps ; ++ i ) { if ( blob . l !== Props [ i ] [ 1 ] ) { var fail = true ; if ( i > 0 && PIDSI ) switch ( PIDSI [ Props [ i - 1 ] [ 0 ] ] . t ) { case 2 : if ( blob . l + 2 === Props [ i ] [ 1 ] ) { blob . l += 2 ; fail = false } break ; case 80 : if ( blob . l <= Props [ i ] [ 1 ] ) { blob . l = Props [ i ] [ 1 ] ; fail = false } break ; case 4108 : if ( blob . l <= Props [ i ] [ 1 ] ) { blob . l = Props [ i ] [ 1 ] ; fail = false } break } if ( ! PIDSI && blob . l <= Props [ i ] [ 1 ] ) { fail = false ; blob . l = Props [ i ] [ 1 ] } if ( fail ) throw new Error ( "Read Error: Expected address " + Props [ i ] [ 1 ] + " at " + blob . l + " :" + i ) } if ( PIDSI ) { var piddsi = PIDSI [ Props [ i ] [ 0 ] ] ; PropH [ piddsi . n ] = parse _TypedPropertyValue ( blob , piddsi . t , { raw : true } ) ; if ( piddsi . p === "version" ) PropH [ piddsi . n ] = String ( PropH [ piddsi . n ] >> 16 ) + "." + String ( PropH [ piddsi . n ] & 65535 ) ; if ( piddsi . n == "CodePage" ) switch ( PropH [ piddsi . n ] ) { case 0 : PropH [ piddsi . n ] = 1252 ; case 1e4 : case 1252 : case 874 : case 1250 : case 1251 : case 1253 : c
var parse _ShtProps = parsenoop ; var parse _SerToCrt = parsenoop ; var parse _AxesUsed = parsenoop ; var parse _SBaseRef = parsenoop ; var parse _SerParent = parsenoop ; var parse _SerAuxTrend = parsenoop ; var parse _IFmtRecord = parsenoop ; var parse _Pos = parsenoop ; var parse _AlRuns = parsenoop ; var parse _BRAI = parsenoop ; var parse _SerAuxErrBar = parsenoop ; var parse _SerFmt = parsenoop ; var parse _Chart3DBarShape = parsenoop ; var parse _Fbi = parsenoop ; var parse _BopPop = parsenoop ; var parse _AxcExt = parsenoop ; var parse _Dat = parsenoop ; var parse _PlotGrowth = parsenoop ; var parse _SIIndex = parsenoop ; var parse _GelFrame = parsenoop ; var parse _BopPopCustom = parsenoop ; var parse _Fbi2 = parsenoop ; function parse _BIFF5String ( blob ) { var len = blob . read _shift ( 1 ) ; return blob . read _shift ( len , "sbcs-cont" ) } function parse _BIFF2STR ( blob , length , opts ) { var cell = parse _XLSCell ( blob , 6 ) ; ++ blob . l ; var str = parse _XLUnicodeString2 ( blob , length - 7 , opts ) ; cell . t = "str" ; cell . val = str ; return cell } function parse _BIFF2NUM ( blob , length , opts ) { var cell = parse _XLSCell ( blob , 6 ) ; ++ blob . l ; var num = parse _Xnum ( blob , 8 ) ; cell . t = "n" ; cell . val = num ; return cell } function parse _BIFF2INT ( blob , length ) { var cell = parse _XLSCell ( blob , 6 ) ; ++ blob . l ; var num = blob . read _shift ( 2 ) ; cell . t = "n" ; cell . val = num ; return cell } function parse _BIFF2STRING ( blob , length ) { var cch = blob . read _shift ( 1 ) ; if ( cch === 0 ) { blob . l ++ ; return "" } return blob . read _shift ( cch , "sbcs-cont" ) } function parse _BIFF2FONTXTRA ( blob , length ) { blob . l += 6 ; blob . l += 2 ; blob . l += 1 ; blob . l += 3 ; blob . l += 1 ; blob . l += length - 9 } function parse _RString ( blob , length , opts ) { var end = blob . l + length ; var cell = parse _XLSCell ( blob , 6 ) ; var cch = blob . read _shift ( 2 ) ; var str = parse _XLUnicodeStringNoCch ( blob , cch , opts ) ; blob . l = end ; cell . t = "str" ; cell . val = str ; return cell } var CS2CP = { 0 : 1252 , 1 : 65001 , 2 : 65001 , 77 : 1e4 , 128 : 932 , 129 : 949 , 130 : 1361 , 134 : 936 , 136 : 950 , 161 : 1253 , 162 : 1254 , 163 : 1258 , 177 : 1255 , 178 : 1256 , 186 : 1257 , 204 : 1251 , 222 : 874 , 238 : 1250 , 255 : 1252 , 69 : 6969 } ; var parse _rs = function parse _rs _factory ( ) { var tregex = matchtag ( "t" ) , rpregex = matchtag ( "rPr" ) , rregex = /<(?:\w+:)?r>/g , rend = /<\/(?:\w+:)?r>/ , nlregex = /\r\n/g ; var parse _rpr = function parse _rpr ( rpr , intro , outro ) { var font = { } , cp = 65001 ; var m = rpr . match ( tagregex ) , i = 0 ; if ( m ) for ( ; i != m . length ; ++ i ) { var y = parsexmltag ( m [ i ] ) ; switch ( y [ 0 ] ) { case "<condense" : break ; case "<extend" : break ; case "<shadow" : case "<shadow>" : case "<shadow/>" : break ; case "<charset" : if ( y . val == "1" ) break ; cp = CS2CP [ parseInt ( y . val , 10 ) ] ; break ; case "<outline" : case "<outline>" : case "<outline/>" : break ; case "<rFont" : font . name = y . val ; break ; case "<sz" : font . sz = y . val ; break ; case "<strike" : if ( ! y . val ) break ; case "<strike>" : case "<strike/>" : font . strike = 1 ; break ; case "</strike>" : break ; case "<u" : if ( y . val == "0" ) break ; case "<u>" : case "<u/>" : font . u = 1 ; break ; case "</u>" : break ; case "<b" : if ( y . val == "0" ) break ; case "<b>" : case "<b/>" : font . b = 1 ; break ; case "</b>" : break ; case "<i" : if ( y . val == "0" ) break ; case "<i>" : case "<i/>" : font . i = 1 ; break ; case "</i>" : break ; case "<color" : if ( y . rgb ) font . color = y . rgb . substr ( 2 , 6 ) ; break ; case "<family" : font . family = y . val ; break ; case "<vertAlign" : break ; case "<scheme" : break ; default : if ( y [ 0 ] . charCodeAt ( 1 ) !== 47 ) throw "Unrecognized rich format " + y [ 0 ] } } var style = [ ] ; if ( font . b ) style . push ( "font-weight: bold;" ) ; if ( font . i ) style . push ( "font-style: italic;" ) ; intro . push ( '<span style="' + style . join ( "" ) + '">' ) ; outro . push ( "</span>" ) ; return cp } ; function parse _r ( r ) { var terms = [ [ ] , "" , [ ] ] ; var t = r . match ( tregex ) , cp = 65001 ; if ( ! isval ( t ) ) return "" ; terms [ 1 ] = t [ 1 ] ; var rpr = r . match ( rpregex ) ; if ( isval ( rpr ) ) cp = parse _rpr ( rpr [ 1 ] , terms [ 0 ] , terms [ 2 ] ) ; return terms [ 0 ] . join ( "" ) + terms [ 1 ] . replace ( nlregex , "<br/>" ) + terms [ 2 ] . join ( "" ) } return function parse _rs ( rs ) { return rs . replace ( rregex , "" ) . split ( rend ) . map ( parse _r ) . join ( "" ) } } ( ) ; var sitregex = /<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g , sirregex = /<(?:\w+:)?r>/ ; var sirphregex = /<(?:\w+:)?rPh.*?>(.*?)<\/(?:\w+:)?rPh>/g ; function parse _si ( x , opts ) { var html = opts ? opts . cellHTML : true ; var z = { } ; if ( ! x ) return null ; var y ; if ( x . match ( /^\s*<(?:\w+:)?t[^>]*>/ ) ) { z . t = utf8read ( unescapexml ( x . substr ( x . indexOf ( ">" ) + 1 ) . split ( /<\/(?:\w+:)?t>/ ) [ 0 ] ) ) ; z . r = utf8read ( x ) ; if ( html ) z . h = z . t } else if ( y = x . match ( sirregex ) ) { z . r = utf8read ( x ) ; z . t = utf8read ( unescapexml ( ( x . replace ( sirphregex , "" ) . match ( sitregex ) || [ ] ) . join ( "" ) . replace ( tagregex , "" ) ) ) ; if ( html ) z . h = parse _rs ( z . r ) } return z } var
o [ o . length ] = "</a:gsLst>" ; o [ o . length ] = '<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>' ; o [ o . length ] = "</a:gradFill>" ; o [ o . length ] = "</a:bgFillStyleLst>" ; o [ o . length ] = "</a:fmtScheme>" ; o [ o . length ] = "</a:themeElements>" ; o [ o . length ] = "<a:objectDefaults>" ; o [ o . length ] = "<a:spDef>" ; o [ o . length ] = '<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>' ; o [ o . length ] = "</a:spDef>" ; o [ o . length ] = "<a:lnDef>" ; o [ o . length ] = '<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>' ; o [ o . length ] = "</a:lnDef>" ; o [ o . length ] = "</a:objectDefaults>" ; o [ o . length ] = "<a:extraClrSchemeLst/>" ; o [ o . length ] = "</a:theme>" ; return o . join ( "" ) } function parse _Theme ( blob , length ) { var dwThemeVersion = blob . read _shift ( 4 ) ; if ( dwThemeVersion === 124226 ) return ; blob . l += length - 4 } function parse _ColorTheme ( blob , length ) { return blob . read _shift ( 4 ) } function parse _FullColorExt ( blob , length ) { var o = { } ; o . xclrType = blob . read _shift ( 2 ) ; o . nTintShade = blob . read _shift ( 2 ) ; switch ( o . xclrType ) { case 0 : blob . l += 4 ; break ; case 1 : o . xclrValue = parse _IcvXF ( blob , 4 ) ; break ; case 2 : o . xclrValue = parse _LongRGBA ( blob , 4 ) ; break ; case 3 : o . xclrValue = parse _ColorTheme ( blob , 4 ) ; break ; case 4 : blob . l += 4 ; break } blob . l += 8 ; return o } function parse _IcvXF ( blob , length ) { return parsenoop ( blob , length ) } function parse _XFExtGradient ( blob , length ) { return parsenoop ( blob , length ) } 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 _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
292 : "WORKBOOK.ACTIVATE" , 293 : "ASSIGN.TO.TOOL" , 295 : "COPY.TOOL" , 296 : "RESET.TOOL" , 297 : "CONSTRAIN.NUMERIC" , 298 : "PASTE.TOOL" , 302 : "WORKBOOK.NEW" , 305 : "SCENARIO.CELLS" , 306 : "SCENARIO.DELETE" , 307 : "SCENARIO.ADD" , 308 : "SCENARIO.EDIT" , 309 : "SCENARIO.SHOW" , 310 : "SCENARIO.SHOW.NEXT" , 311 : "SCENARIO.SUMMARY" , 312 : "PIVOT.TABLE.WIZARD" , 313 : "PIVOT.FIELD.PROPERTIES" , 314 : "PIVOT.FIELD" , 315 : "PIVOT.ITEM" , 316 : "PIVOT.ADD.FIELDS" , 318 : "OPTIONS.CALCULATION" , 319 : "OPTIONS.EDIT" , 320 : "OPTIONS.VIEW" , 321 : "ADDIN.MANAGER" , 322 : "MENU.EDITOR" , 323 : "ATTACH.TOOLBARS" , 324 : "VBAActivate" , 325 : "OPTIONS.CHART" , 328 : "VBA.INSERT.FILE" , 330 : "VBA.PROCEDURE.DEFINITION" , 336 : "ROUTING.SLIP" , 338 : "ROUTE.DOCUMENT" , 339 : "MAIL.LOGON" , 342 : "INSERT.PICTURE" , 343 : "EDIT.TOOL" , 344 : "GALLERY.DOUGHNUT" , 350 : "CHART.TREND" , 352 : "PIVOT.ITEM.PROPERTIES" , 354 : "WORKBOOK.INSERT" , 355 : "OPTIONS.TRANSITION" , 356 : "OPTIONS.GENERAL" , 370 : "FILTER.ADVANCED" , 373 : "MAIL.ADD.MAILER" , 374 : "MAIL.DELETE.MAILER" , 375 : "MAIL.REPLY" , 376 : "MAIL.REPLY.ALL" , 377 : "MAIL.FORWARD" , 378 : "MAIL.NEXT.LETTER" , 379 : "DATA.LABEL" , 380 : "INSERT.TITLE" , 381 : "FONT.PROPERTIES" , 382 : "MACRO.OPTIONS" , 383 : "WORKBOOK.HIDE" , 384 : "WORKBOOK.UNHIDE" , 385 : "WORKBOOK.DELETE" , 386 : "WORKBOOK.NAME" , 388 : "GALLERY.CUSTOM" , 390 : "ADD.CHART.AUTOFORMAT" , 391 : "DELETE.CHART.AUTOFORMAT" , 392 : "CHART.ADD.DATA" , 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"
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 "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 "BrtColInfo" : 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 ; case "BrtBeginSortCond" : break ; case "BrtEndSortCond" : break ; case "BrtEndSortState" : break ; case "BrtBeginConditionalFormatting" : break ; case "BrtEndConditionalFormatting" : break ; case "BrtBeginCFRule" : break ; case "BrtEndCFRule" : break ; case "BrtBeginDVals" : break ; case "BrtDVal" : break ; case "BrtEndDVals" : break ; case "BrtRangeProtection" : break ; case "BrtBeginDCon" : break ; case "BrtEndDCon" : break ; case "BrtBeginDRefs" : break ; case "BrtDRef" : break ; case "BrtEndDRefs" : break ; case "BrtBeginActiveXControls" : break ; case "BrtActiveX" : break ; case "BrtEndActiveXControls" : break ; case "BrtBeginAFilter" : break ; case "BrtEndAFilter" : break ; case "BrtBeginFilterColumn" : break ; case "BrtBeginFilters" : break ; case "BrtFilter" : break ; case "BrtEndFilters" : break ; case "BrtEndFilterColumn" : break ; case "BrtDynamicFilter" : break ; case "BrtTop10Filter" : break ; case "BrtBeginCustomFilters" : break ; case "BrtCustomFilter" : break ; case "BrtEndCustomFilters" : break ; case "BrtBeginSmartTags" : break ; case "BrtBeginCellSmartTags" : break ; case "BrtBeginCellSmartTag" : break ; case "BrtCellSmartTagProperty" : break ; case "BrtEndCellSmartTag" : break ; case "BrtEndCellSmartTags" : break ; case "BrtEndSmartTags" : break ; case "BrtBeginCellWatches" : break ; case "BrtCellWatch" : break ; case "BrtEndCellWatches" : break ; case "BrtTable" : break ; case "BrtBeginCellIgnoreECs" : break ; case "BrtCellIgnoreEC" : break ; case "BrtEndCellIgnoreECs" : break ; default : if ( ! pass || opts . WTF ) throw new Error ( "Unexpected record " + Record . n ) } } , opts ) ; delete opts . supbooks ; delete opts [ "!row" ] ; if ( ! s [ "!ref" ] && ( refguess . s . r < 2e6 || ref && ( ref . e . r > 0 || ref . e . c > 0 || ref . s . r > 0 || ref . s . c > 0 ) ) ) s [ "!ref" ] = encode _range ( ref || refguess ) ; if ( opts . sheetRows && s [ "!ref" ] ) { var tmpref = safe _decode _range ( s [ "!ref" ] ) ; if ( opts . sheetRows < + tmpref . e . r ) { tmpref . e . r = opts . sheetRows - 1 ; if ( tmpref . e . r > refguess . e . r ) tmpref . e . r = refguess . e . r ; if ( tmpref . e . r < tmpref . s . r ) tmpref . s . r = tmpref . e . r ; if ( tmpref . e . c > refguess . e . c ) tmpref . e . c = refguess . e . c ; if ( tmpref . e . c < tmpref . s . c ) tmpref . s . c = tmpref . e . c ; s [ "!fullref" ] = s [ "!ref" ] ; s [ "!ref" ] = encode _range ( tmpref ) } } if ( mergecells . length > 0 ) s [ "!merges" ] = mergecells ; return s } function write _ws _bi
case "ThousandSeparator" : break ; case "TrailingMinusNumbers" : break ; case "FormatSettings" : break ; case "FieldType" : break ; case "Delimiters" : break ; case "Tab" : break ; case "Comma" : break ; case "AutoFormatName" : break ; case "VersionLastEdit" : break ; case "VersionLastRefresh" : break ; default : seen = false } break ; case "Sorting" : case "ConditionalFormatting" : case "DataValidation" : switch ( Rn [ 3 ] ) { case "Range" : break ; case "Type" : break ; case "Min" : break ; case "Max" : break ; case "Sort" : break ; case "Descending" : break ; case "Order" : break ; case "CaseSensitive" : break ; case "Value" : break ; case "ErrorStyle" : break ; case "ErrorMessage" : break ; case "ErrorTitle" : break ; case "CellRangeList" : break ; case "InputMessage" : break ; case "InputTitle" : break ; case "ComboHide" : break ; case "InputHide" : break ; case "Condition" : break ; case "Qualifier" : break ; case "UseBlank" : break ; case "Value1" : break ; case "Value2" : break ; case "Format" : break ; default : seen = false } break ; case "MapInfo" : case "Schema" : case "data" : switch ( Rn [ 3 ] ) { case "Map" : break ; case "Entry" : break ; case "Range" : break ; case "XPath" : break ; case "Field" : break ; case "XSDType" : break ; case "FilterOn" : break ; case "Aggregate" : break ; case "ElementType" : break ; case "AttributeType" : break ; case "schema" : case "element" : case "complexType" : case "datatype" : case "all" : case "attribute" : case "extends" : break ; case "row" : break ; default : seen = false } break ; case "SmartTags" : break ; default : seen = false ; break } if ( seen ) break ; if ( ! state [ state . length - 1 ] [ 1 ] ) throw "Unrecognized tag: " + Rn [ 3 ] + "|" + state . join ( "|" ) ; if ( state [ state . length - 1 ] [ 0 ] === "CustomDocumentProperties" ) { if ( Rn [ 0 ] . slice ( - 2 ) === "/>" ) break ; else if ( Rn [ 1 ] === "/" ) xlml _set _custprop ( Custprops , Rn , cp , str . slice ( pidx , Rn . index ) ) ; else { cp = Rn ; pidx = Rn . index + Rn [ 0 ] . length } break } if ( opts . WTF ) throw "Unrecognized tag: " + Rn [ 3 ] + "|" + state . join ( "|" ) } var out = { } ; if ( ! opts . bookSheets && ! opts . bookProps ) out . Sheets = sheets ; out . SheetNames = sheetnames ; out . SSF = SSF . get _table ( ) ; out . Props = Props ; out . Custprops = Custprops ; return out } function parse _xlml ( data , opts ) { fix _read _opts ( opts = opts || { } ) ; switch ( opts . type || "base64" ) { case "base64" : return parse _xlml _xml ( Base64 . decode ( data ) , opts ) ; case "binary" : case "buffer" : case "file" : return parse _xlml _xml ( data , opts ) ; case "array" : return parse _xlml _xml ( data . map ( _chr ) . join ( "" ) , opts ) } } function write _props _xlml ( wb , opts ) { var o = [ ] ; if ( wb . Props ) o . push ( xlml _write _docprops ( wb . Props ) ) ; if ( wb . Custprops ) o . push ( xlml _write _custprops ( wb . Props , wb . Custprops ) ) ; return o . join ( "" ) } function write _wb _xlml ( wb , opts ) { return "" } function write _sty _xlml ( wb , opts ) { return "" } function write _ws _xlml _cell ( cell , ref , ws , opts , idx , wb , addr ) { if ( ! cell || cell . v === undefined ) return "<Cell></Cell>" ; var attr = { } ; if ( cell . f ) attr [ "ss:Formula" ] = "=" + escapexml ( a1 _to _rc ( cell . f , addr ) ) ; if ( ws [ "!merges" ] ) { var marr = ws [ "!merges" ] ; for ( var mi = 0 ; mi != marr . length ; ++ mi ) { if ( marr [ mi ] . s . c != addr . c || marr [ mi ] . s . r != addr . r ) continue ; if ( marr [ mi ] . e . c > marr [ mi ] . s . c ) attr [ "ss:MergeAcross" ] = marr [ mi ] . e . c - marr [ mi ] . s . c ; if ( marr [ mi ] . e . r > marr [ mi ] . s . r ) attr [ "ss:MergeDown" ] = marr [ mi ] . e . r - marr [ mi ] . s . r } } var t = "" , p = "" ; switch ( cell . t ) { case "z" : return "" ; case "n" : t = "Number" ; p = String ( cell . v ) ; break ; case "b" : t = "Boolean" ; p = cell . v ? "1" : "0" ; break ; case "e" : t = "Error" ; p = BErr [ cell . v ] ; break ; case "d" : t = "DateTime" ; p = new Date ( cell . v ) . toISOString ( ) ; break ; case "s" : t = "String" ; p = escapexml ( cell . v || "" ) ; break } var m = '<Data ss:Type="' + t + '">' + p + "</Data>" ; return writextag ( "Cell" , m , attr ) } function write _ws _xlml _table ( ws , opts , idx , wb ) { if ( ! ws [ "!ref" ] ) return "" ; var range = safe _decode _range ( ws [ "!ref" ] ) ; var marr = ws [ "!merges" ] || [ ] , mi = 0 ; var o = [ ] ; for ( var R = range . s . r ; R <= range . e . r ; ++ R ) { var row = [ '<Row ss:Index="' + ( R + 1 ) + '">' ] ; for ( var C = range . s . c ; C <= range . e . c ; ++ C ) { var skip = false ; for ( mi = 0 ; mi != marr . length ; ++ mi ) { if ( marr [ mi ] . s . c > C ) continue ; if ( marr [ mi ] . s . r > R ) continue ; if ( marr [ mi ] . e . c < C ) continue ; if ( marr [ mi ] . e . r < R ) continue ; if ( marr [ mi ] . s . c != C || marr [ mi ] . s . r != R ) skip = true ; break } if ( skip ) continue ; var addr = { r : R , c : C } ; var ref = encode _cell ( addr ) , cell = ws [ ref ] ; row . push ( write _ws _xlml _cell ( ws [ ref ] , ref , ws , opts , idx , wb , addr ) ) } row . push ( "</Row>" ) ; if ( row . length > 2 ) o . push ( row . join ( "" ) ) } return o . join ( "" ) } function write _ws _xlml ( idx , opts , wb ) { var o = [ ] ; var s = wb . SheetNames [ idx ] ; var ws = wb . Sheets [ s ] ; var t = ws ? write _ws _xlml _table ( ws , opts , idx , wb ) : "" ; if ( t . length > 0 ) o . push ( "<Table>" + t + "</Table>" ) ; return
} , 346 : { n : "BrtEndListCols" , f : parsenoop } , 347 : { n : "BrtBeginListCol" , f : parsenoop } , 348 : { n : "BrtEndListCol" , f : parsenoop } , 349 : { n : "BrtBeginListXmlCPr" , f : parsenoop } , 350 : { n : "BrtEndListXmlCPr" , f : parsenoop } , 351 : { n : "BrtListCCFmla" , f : parsenoop } , 352 : { n : "BrtListTrFmla" , f : parsenoop } , 353 : { n : "BrtBeginExternals" , f : parsenoop } , 354 : { n : "BrtEndExternals" , f : parsenoop } , 355 : { n : "BrtSupBookSrc" , f : parsenoop } , 357 : { n : "BrtSupSelf" , f : parsenoop } , 358 : { n : "BrtSupSame" , f : parsenoop } , 359 : { n : "BrtSupTabs" , f : parsenoop } , 360 : { n : "BrtBeginSupBook" , f : parsenoop } , 361 : { n : "BrtPlaceholderName" , f : parsenoop } , 362 : { n : "BrtExternSheet" , f : parsenoop } , 363 : { n : "BrtExternTableStart" , f : parsenoop } , 364 : { n : "BrtExternTableEnd" , f : parsenoop } , 366 : { n : "BrtExternRowHdr" , f : parsenoop } , 367 : { n : "BrtExternCellBlank" , f : parsenoop } , 368 : { n : "BrtExternCellReal" , f : parsenoop } , 369 : { n : "BrtExternCellBool" , f : parsenoop } , 370 : { n : "BrtExternCellError" , f : parsenoop } , 371 : { n : "BrtExternCellString" , f : parsenoop } , 372 : { n : "BrtBeginEsmdx" , f : parsenoop } , 373 : { n : "BrtEndEsmdx" , f : parsenoop } , 374 : { n : "BrtBeginMdxSet" , f : parsenoop } , 375 : { n : "BrtEndMdxSet" , f : parsenoop } , 376 : { n : "BrtBeginMdxMbrProp" , f : parsenoop } , 377 : { n : "BrtEndMdxMbrProp" , f : parsenoop } , 378 : { n : "BrtBeginMdxKPI" , f : parsenoop } , 379 : { n : "BrtEndMdxKPI" , f : parsenoop } , 380 : { n : "BrtBeginEsstr" , f : parsenoop } , 381 : { n : "BrtEndEsstr" , f : parsenoop } , 382 : { n : "BrtBeginPRFItem" , f : parsenoop } , 383 : { n : "BrtEndPRFItem" , f : parsenoop } , 384 : { n : "BrtBeginPivotCacheIDs" , f : parsenoop } , 385 : { n : "BrtEndPivotCacheIDs" , f : parsenoop } , 386 : { n : "BrtBeginPivotCacheID" , f : parsenoop } , 387 : { n : "BrtEndPivotCacheID" , f : parsenoop } , 388 : { n : "BrtBeginISXVIs" , f : parsenoop } , 389 : { n : "BrtEndISXVIs" , f : parsenoop } , 390 : { n : "BrtBeginColInfos" , f : parsenoop } , 391 : { n : "BrtEndColInfos" , f : parsenoop } , 392 : { n : "BrtBeginRwBrk" , f : parsenoop } , 393 : { n : "BrtEndRwBrk" , f : parsenoop } , 394 : { n : "BrtBeginColBrk" , f : parsenoop } , 395 : { n : "BrtEndColBrk" , f : parsenoop } , 396 : { n : "BrtBrk" , f : parsenoop } , 397 : { n : "BrtUserBookView" , f : parsenoop } , 398 : { n : "BrtInfo" , f : parsenoop } , 399 : { n : "BrtCUsr" , f : parsenoop } , 400 : { n : "BrtUsr" , f : parsenoop } , 401 : { n : "BrtBeginUsers" , f : parsenoop } , 403 : { n : "BrtEOF" , f : parsenoop } , 404 : { n : "BrtUCR" , f : parsenoop } , 405 : { n : "BrtRRInsDel" , f : parsenoop } , 406 : { n : "BrtRREndInsDel" , f : parsenoop } , 407 : { n : "BrtRRMove" , f : parsenoop } , 408 : { n : "BrtRREndMove" , f : parsenoop } , 409 : { n : "BrtRRChgCell" , f : parsenoop } , 410 : { n : "BrtRREndChgCell" , f : parsenoop } , 411 : { n : "BrtRRHeader" , f : parsenoop } , 412 : { n : "BrtRRUserView" , f : parsenoop } , 413 : { n : "BrtRRRenSheet" , f : parsenoop } , 414 : { n : "BrtRRInsertSh" , f : parsenoop } , 415 : { n : "BrtRRDefName" , f : parsenoop } , 416 : { n : "BrtRRNote" , f : parsenoop } , 417 : { n : "BrtRRConflict" , f : parsenoop } , 418 : { n : "BrtRRTQSIF" , f : parsenoop } , 419 : { n : "BrtRRFormat" , f : parsenoop } , 420 : { n : "BrtRREndFormat" , f : parsenoop } , 421 : { n : "BrtRRAutoFmt" , f : parsenoop } , 422 : { n : "BrtBeginUserShViews" , f : parsenoop } , 423 : { n : "BrtBeginUserShView" , f : parsenoop } , 424 : { n : "BrtEndUserShView" , f : parsenoop } , 425 : { n : "BrtEndUserShViews" , f : parsenoop } , 426 : { n : "BrtArrFmla" , f : parse _BrtArrFmla } , 427 : { n : "BrtShrFmla" , f : parse _BrtShrFmla } , 428 : { n : "BrtTable" , f : parsenoop } , 429 : { n : "BrtBeginExtConnections" , f : parsenoop } , 430 : { n : "BrtEndExtConnections" , f : parsenoop } , 431 : { n : "BrtBeginPCDCalcMems" , f : parsenoop } , 432 : { n : "BrtEndPCDCalcMems" , f : parsenoop } , 433 : { n : "BrtBeginPCDCalcMem" , f : parsenoop } , 434 : { n : "BrtEndPCDCalcMem" , f : parsenoop } , 435 : { n : "BrtBeginPCDHGLevels" , f : parsenoop } , 436 : { n : "BrtEndPCDHGLevels" , f : parsenoop } , 437 : { n : "BrtBeginPCDHGLevel" , f : parsenoop } , 438 : { n : "BrtEndPCDHGLevel" , f : parsenoop } , 439 : { n : "BrtBeginPCDHGLGroups" , f : parsenoop } , 440 : { n : "BrtEndPCDHGLGroups" , f : parsenoop } , 441 : { n : "BrtBeginPCDHGLGroup" , f : parsenoop } , 442 : { n : "BrtEndPCDHGLGroup" , f : parsenoop } , 443 : { n : "BrtBeginPCDHGLGMembers" , f : parsenoop } , 444 : { n : "BrtEndPCDHGLGMembers" , f : parsenoop } , 445 : { n : "BrtBeginPCDHGLGMember" , f : parsenoop } , 446 : { n : "BrtEndPCDHGLGMember" , f : parsenoop } , 447 : { n : "BrtBeginQSI" , f : parsenoop } , 448 : { n : "BrtEndQSI" , f : parsenoop } , 449 : { n : "BrtBeginQSIR" , f : parsenoop } , 450 : { n : "BrtEndQSIR" , f : parsenoop } , 451 : { n : "BrtBeginDeletedNames" , f : parsenoop } , 452 : { n : "BrtEndDeletedNames" , f : parsenoop } , 453 : { n : "BrtBeginDeletedName" , f : parsenoop } , 454 : { n : "BrtEndDeletedName" , f : parsenoop } , 455 : { n : "BrtBeginQSIFs" , f : parsenoop } , 456 : { n : "BrtEndQSIFs" , f : parsenoop } , 457 : { n : "BrtBeginQSIF" , f : parsenoop } , 458 :
n : "CrtMlFrt" , f : parse _CrtMlFrt } , 2207 : { n : "CrtMlFrtContinue" , f : parse _CrtMlFrtContinue } , 2211 : { n : "ForceFullCalculation" , f : parse _ForceFullCalculation } , 2212 : { n : "ShapePropsStream" , f : parse _ShapePropsStream } , 2213 : { n : "TextPropsStream" , f : parse _TextPropsStream } , 2214 : { n : "RichTextStream" , f : parse _RichTextStream } , 2215 : { n : "CrtLayout12A" , f : parse _CrtLayout12A } , 4097 : { n : "Units" , f : parse _Units } , 4098 : { n : "Chart" , f : parse _Chart } , 4099 : { n : "Series" , f : parse _Series } , 4102 : { n : "DataFormat" , f : parse _DataFormat } , 4103 : { n : "LineFormat" , f : parse _LineFormat } , 4105 : { n : "MarkerFormat" , f : parse _MarkerFormat } , 4106 : { n : "AreaFormat" , f : parse _AreaFormat } , 4107 : { n : "PieFormat" , f : parse _PieFormat } , 4108 : { n : "AttachedLabel" , f : parse _AttachedLabel } , 4109 : { n : "SeriesText" , f : parse _SeriesText } , 4116 : { n : "ChartFormat" , f : parse _ChartFormat } , 4117 : { n : "Legend" , f : parse _Legend } , 4118 : { n : "SeriesList" , f : parse _SeriesList } , 4119 : { n : "Bar" , f : parse _Bar } , 4120 : { n : "Line" , f : parse _Line } , 4121 : { n : "Pie" , f : parse _Pie } , 4122 : { n : "Area" , f : parse _Area } , 4123 : { n : "Scatter" , f : parse _Scatter } , 4124 : { n : "CrtLine" , f : parse _CrtLine } , 4125 : { n : "Axis" , f : parse _Axis } , 4126 : { n : "Tick" , f : parse _Tick } , 4127 : { n : "ValueRange" , f : parse _ValueRange } , 4128 : { n : "CatSerRange" , f : parse _CatSerRange } , 4129 : { n : "AxisLine" , f : parse _AxisLine } , 4130 : { n : "CrtLink" , f : parse _CrtLink } , 4132 : { n : "DefaultText" , f : parse _DefaultText } , 4133 : { n : "Text" , f : parse _Text } , 4134 : { n : "FontX" , f : parse _FontX } , 4135 : { n : "ObjectLink" , f : parse _ObjectLink } , 4146 : { n : "Frame" , f : parse _Frame } , 4147 : { n : "Begin" , f : parse _Begin } , 4148 : { n : "End" , f : parse _End } , 4149 : { n : "PlotArea" , f : parse _PlotArea } , 4154 : { n : "Chart3d" , f : parse _Chart3d } , 4156 : { n : "PicF" , f : parse _PicF } , 4157 : { n : "DropBar" , f : parse _DropBar } , 4158 : { n : "Radar" , f : parse _Radar } , 4159 : { n : "Surf" , f : parse _Surf } , 4160 : { n : "RadarArea" , f : parse _RadarArea } , 4161 : { n : "AxisParent" , f : parse _AxisParent } , 4163 : { n : "LegendException" , f : parse _LegendException } , 4164 : { n : "ShtProps" , f : parse _ShtProps } , 4165 : { n : "SerToCrt" , f : parse _SerToCrt } , 4166 : { n : "AxesUsed" , f : parse _AxesUsed } , 4168 : { n : "SBaseRef" , f : parse _SBaseRef } , 4170 : { n : "SerParent" , f : parse _SerParent } , 4171 : { n : "SerAuxTrend" , f : parse _SerAuxTrend } , 4174 : { n : "IFmtRecord" , f : parse _IFmtRecord } , 4175 : { n : "Pos" , f : parse _Pos } , 4176 : { n : "AlRuns" , f : parse _AlRuns } , 4177 : { n : "BRAI" , f : parse _BRAI } , 4187 : { n : "SerAuxErrBar" , f : parse _SerAuxErrBar } , 4188 : { n : "ClrtClient" , f : parse _ClrtClient } , 4189 : { n : "SerFmt" , f : parse _SerFmt } , 4191 : { n : "Chart3DBarShape" , f : parse _Chart3DBarShape } , 4192 : { n : "Fbi" , f : parse _Fbi } , 4193 : { n : "BopPop" , f : parse _BopPop } , 4194 : { n : "AxcExt" , f : parse _AxcExt } , 4195 : { n : "Dat" , f : parse _Dat } , 4196 : { n : "PlotGrowth" , f : parse _PlotGrowth } , 4197 : { n : "SIIndex" , f : parse _SIIndex } , 4198 : { n : "GelFrame" , f : parse _GelFrame } , 4199 : { n : "BopPopCustom" , f : parse _BopPopCustom } , 4200 : { n : "Fbi2" , f : parse _Fbi2 } , 0 : { n : "Dimensions" , f : parse _Dimensions } , 2 : { n : "BIFF2INT" , f : parse _BIFF2INT } , 5 : { n : "BoolErr" , f : parse _BoolErr } , 7 : { n : "String" , f : parse _BIFF2STRING } , 8 : { n : "BIFF2ROW" , f : parsenoop } , 11 : { n : "Index" , f : parse _Index } , 30 : { n : "BIFF2FORMAT" , f : parse _BIFF2Format } , 31 : { n : "BIFF2FMTCNT" , f : parsenoop } , 22 : { n : "ExternCount" , f : parsenoop } , 33 : { n : "Array" , f : parse _Array } , 37 : { n : "DefaultRowHeight" , f : parse _DefaultRowHeight } , 50 : { n : "BIFF2FONTXTRA" , f : parse _BIFF2FONTXTRA } , 62 : { n : "BIFF2WINDOW2" , f : parsenoop } , 69 : { n : "BIFF2FONTCLR" , f : parsenoop } , 86 : { n : "BIFF4FMTCNT" , f : parsenoop } , 126 : { n : "RK" , f : parsenoop } , 127 : { n : "ImData" , f : parsenoop } , 135 : { n : "Addin" , f : parsenoop } , 136 : { n : "Edg" , f : parsenoop } , 137 : { n : "Pub" , f : parsenoop } , 145 : { n : "Sub" , f : parsenoop } , 148 : { n : "LHRecord" , f : parsenoop } , 149 : { n : "LHNGraph" , f : parsenoop } , 150 : { n : "Sound" , f : parsenoop } , 169 : { n : "CoordList" , f : parsenoop } , 171 : { n : "GCW" , f : parsenoop } , 188 : { n : "ShrFmla" , f : parsenoop } , 194 : { n : "AddMenu" , f : parsenoop } , 195 : { n : "DelMenu" , f : parsenoop } , 214 : { n : "RString" , f : parse _RString } , 223 : { n : "UDDesc" , f : parsenoop } , 234 : { n : "TabIdConf" , f : parsenoop } , 354 : { n : "XL5Modify" , f : parsenoop } , 421 : { n : "FileSharing2" , f : parsenoop } , 521 : { n : "BOF" , f : parse _BOF } , 536 : { n : "Lbl" , f : parse _Lbl } , 547 : { n : "ExternName" , f : parse _ExternName } , 561 : { n : "Font" , f : parsenoop } , 1033 : { n : "BOF" , f : parse _BOF } , 2157 : { n : "FeatInfo" , f : parsenoop } , 2163 : { n : "FeatInfo11" , f : parsenoop } , 2177 : { n : "SXAddl12" , f : parsenoop } , 2240 : { n : "AutoWebPub" , f : parsenoop } , 2241 : { n : "ListObj" , f : parsenoop } , 2242 : { n : "ListField" , f : parsenoop } , 2243 : { n : "ListDV" , f : p
var o = opts || { } ; o . type = "file" ; o . file = filename ; if ( ! o . bookType ) switch ( o . file . slice ( - 5 ) . toLowerCase ( ) ) { case ".xlsx" : o . bookType = "xlsx" ; break ; case ".xlsm" : o . bookType = "xlsm" ; break ; case ".xlsb" : o . bookType = "xlsb" ; break ; case ".fods" : o . bookType = "fods" ; break ; case ".xlml" : o . bookType = "xlml" ; break ; default : switch ( o . file . slice ( - 4 ) . toLowerCase ( ) ) { case ".xls" : o . bookType = "biff2" ; break ; case ".xml" : o . bookType = "xml" ; break ; case ".ods" : o . bookType = "ods" ; break ; case ".csv" : o . bookType = "csv" ; break } } return writeSync ( wb , o ) } function decode _row ( rowstr ) { return parseInt ( unfix _row ( rowstr ) , 10 ) - 1 } function encode _row ( row ) { return "" + ( row + 1 ) } function fix _row ( cstr ) { return cstr . replace ( /([A-Z]|^)(\d+)$/ , "$1$$$2" ) } function unfix _row ( cstr ) { return cstr . replace ( /\$(\d+)$/ , "$1" ) } function decode _col ( colstr ) { var c = unfix _col ( colstr ) , d = 0 , i = 0 ; for ( ; i !== c . length ; ++ i ) d = 26 * d + c . charCodeAt ( i ) - 64 ; return d - 1 } function encode _col ( col ) { var s = "" ; for ( ++ col ; col ; col = Math . floor ( ( col - 1 ) / 26 ) ) s = String . fromCharCode ( ( col - 1 ) % 26 + 65 ) + s ; return s } function fix _col ( cstr ) { return cstr . replace ( /^([A-Z])/ , "$$$1" ) } function unfix _col ( cstr ) { return cstr . replace ( /^\$([A-Z])/ , "$1" ) } function split _cell ( cstr ) { return cstr . replace ( /(\$?[A-Z]*)(\$?\d*)/ , "$1,$2" ) . split ( "," ) } function decode _cell ( cstr ) { var splt = split _cell ( cstr ) ; return { c : decode _col ( splt [ 0 ] ) , r : decode _row ( splt [ 1 ] ) } } function encode _cell ( cell ) { return encode _col ( cell . c ) + encode _row ( cell . r ) } function fix _cell ( cstr ) { return fix _col ( fix _row ( cstr ) ) } function unfix _cell ( cstr ) { return unfix _col ( unfix _row ( cstr ) ) } function decode _range ( range ) { var x = range . split ( ":" ) . map ( decode _cell ) ; return { s : x [ 0 ] , e : x [ x . length - 1 ] } } function encode _range ( cs , ce ) { if ( typeof ce === "undefined" || typeof ce === "number" ) { return encode _range ( cs . s , cs . e ) } if ( typeof cs !== "string" ) cs = encode _cell ( cs ) ; if ( typeof ce !== "string" ) ce = encode _cell ( ce ) ; return cs == ce ? cs : cs + ":" + ce } function safe _decode _range ( range ) { var o = { s : { c : 0 , r : 0 } , e : { c : 0 , r : 0 } } ; var idx = 0 , i = 0 , cc = 0 ; var len = range . length ; for ( idx = 0 ; i < len ; ++ i ) { if ( ( cc = range . charCodeAt ( i ) - 64 ) < 1 || cc > 26 ) break ; idx = 26 * idx + cc } o . s . c = -- idx ; for ( idx = 0 ; i < len ; ++ i ) { if ( ( cc = range . charCodeAt ( i ) - 48 ) < 0 || cc > 9 ) break ; idx = 10 * idx + cc } o . s . r = -- idx ; if ( i === len || range . charCodeAt ( ++ i ) === 58 ) { o . e . c = o . s . c ; o . e . r = o . s . r ; return o } for ( idx = 0 ; i != len ; ++ i ) { if ( ( cc = range . charCodeAt ( i ) - 64 ) < 1 || cc > 26 ) break ; idx = 26 * idx + cc } o . e . c = -- idx ; for ( idx = 0 ; i != len ; ++ i ) { if ( ( cc = range . charCodeAt ( i ) - 48 ) < 0 || cc > 9 ) break ; idx = 10 * idx + cc } o . e . r = -- idx ; return o } function safe _format _cell ( cell , v ) { if ( cell . z !== undefined ) try { return cell . w = SSF . format ( cell . z , v ) } catch ( e ) { } if ( ! cell . XF ) return v ; try { return cell . w = SSF . format ( cell . XF . ifmt || 0 , v ) } catch ( e ) { return "" + v } } function format _cell ( cell , v ) { if ( cell == null || cell . t == null || cell . t == "z" ) return "" ; if ( cell . w !== undefined ) return cell . w ; if ( v === undefined ) return safe _format _cell ( cell , cell . v ) ; return safe _format _cell ( cell , v ) } function sheet _to _json ( sheet , opts ) { var val , row , range , header = 0 , offset = 1 , r , hdr = [ ] , isempty , R , C , v , vv ; var o = opts != null ? opts : { } ; var raw = o . raw ; if ( sheet == null || sheet [ "!ref" ] == null ) return [ ] ; range = o . range !== undefined ? o . range : sheet [ "!ref" ] ; if ( o . header === 1 ) header = 1 ; else if ( o . header === "A" ) header = 2 ; else if ( Array . isArray ( o . header ) ) header = 3 ; switch ( typeof range ) { case "string" : r = safe _decode _range ( range ) ; break ; case "number" : r = safe _decode _range ( sheet [ "!ref" ] ) ; r . s . r = range ; break ; default : r = range } if ( header > 0 ) offset = 0 ; var rr = encode _row ( r . s . r ) ; var cols = new Array ( r . e . c - r . s . c + 1 ) ; var out = new Array ( r . e . r - r . s . r - offset + 1 ) ; var outi = 0 ; for ( C = r . s . c ; C <= r . e . c ; ++ C ) { cols [ C ] = encode _col ( C ) ; val = sheet [ cols [ C ] + rr ] ; switch ( header ) { case 1 : hdr [ C ] = C ; break ; case 2 : hdr [ C ] = cols [ C ] ; break ; case 3 : hdr [ C ] = o . header [ C - r . s . c ] ; break ; default : if ( val === undefined ) continue ; vv = v = format _cell ( val ) ; var counter = 0 ; for ( var CC = 0 ; CC < hdr . length ; ++ CC ) if ( hdr [ CC ] == vv ) vv = v + "_" + ++ counter ; hdr [ C ] = vv } } for ( R = r . s . r + offset ; R <= r . e . r ; ++ R ) { rr = encode _row ( R ) ; isempty = true ; if ( header === 1 ) row = [ ] ; else { row = { } ; if ( Object . defineProperty ) Object . defineProperty ( row , "__rowNum__" , { value : R , enumerable : false } ) ; else row . _ _rowNum _ _ = R } for ( C = r . s . c ; C <= r . e . c ; ++ C ) { val = sheet [ cols [ C ] + rr ] ; if ( val === undefined || val . t === undefined ) continue ; v = val . v ; switch ( val . t ) { case "z" : continue ; case "e" : continue ; case "s" : break ; case "b" : case "n" : break ; default : thr