2016-12-31 08:11:36 +00:00
/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
2017-03-28 22:07:46 +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 $ && $ . 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 , 2
} 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
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-04-21 22:03:40 +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
2017-04-16 07:35:56 +00:00
} if ( r = fmt . match ( frac1 ) ) return write _num _f2 ( r , aval , sign ) ; if ( fmt . match ( /^#+0+$/ ) ) return sign + pad0 ( aval , fmt . length - fmt . indexOf ( "0" ) ) ; if ( r = fmt . match ( dec1 ) ) { o = ( "" + val ) . replace ( /^([^\.]+)$/ , "$1." + r [ 1 ] ) . replace ( /\.$/ , "." + r [ 1 ] ) ; o = o . replace ( /\.(\d*)$/ , function ( $$ , $1 ) { return "." + $1 + fill ( "0" , r [ 1 ] . length - $1 . length ) } ) ; 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 . charAt ( 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 . charAt ( 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 fmt _is _date ( fmt ) { var i = 0 , cc = 0 , c = "" , o = "" ; while ( i < fmt . length ) { switch ( c = fmt . charAt ( i ) ) { case "G" : if ( isgeneral ( fmt , i ) ) i += 6 ; i ++ ; break ; case '"' : for ( ; ( cc = fmt . charCodeAt ( ++ i ) ) !== 34 && i < fmt . length ; ) ++ i ; ++ i ; break ; case "\\" : i += 2 ; break ; case "_" : i += 2 ; break ; case "@" : ++ i ; break ; case "B" : case "b" : if ( fmt . charAt ( i + 1 ) === "1" || fmt . charAt ( i + 1 ) === "2" ) return true ; case "M" : case "D" : case "Y" : case "H" : case "S" : case "E" : case "m" : case "d" : case "y" : case "h" : case "s" : case "e" : case "g" : return true ; case "A" : if ( fmt . substr ( i , 3 ) === "A/P" ) return true ; if ( fmt . substr ( i , 5 ) === "AM/PM" ) return true ; ++ i ; break ; case "[" : o = c ; while ( fmt . charAt ( i ++ ) !== "]" && i < fmt . length ) o += fmt . charAt ( i ) ; if ( o . match ( abstime ) ) return true ; break ; case "." : case "0" : case "#" : while ( i < fmt . length && ( "0#?.,E+-%" . indexOf ( c = fmt . charAt ( ++ i ) ) > - 1 || c == "\\" && fmt . charAt ( i + 1 ) == "-" && "0#" . indexOf ( fmt . charAt ( i + 2 ) ) > - 1 ) ) ; break ; case "?" : while ( fmt . charAt ( ++ i ) === c ) ; break ; case "*" : ++ i ; if ( fmt . charAt ( i ) == " " || fmt . charAt ( i ) == "*" ) ++ i ; break ; case "(" : case ")" : ++ i ; break ; case "1" : case "2" : case "3" : case "4" : case "5" : case "6" : case "7" : case "8" : case "9" : while ( i < fmt . length && "0123456789" . in
2017-04-21 22:03:40 +00:00
_ _utf16le = _ _ _utf16le = function utf16le _ ( b , s , e ) { var ss = [ ] ; for ( var i = s ; i < e ; i += 2 ) ss . push ( String . fromCharCode ( _ _readUInt16LE ( b , i ) ) ) ; return ss . join ( "" ) } ; var _ _hexlify , _ _ _hexlify ; _ _hexlify = _ _ _hexlify = function hexlify _ ( b , s , l ) { return b . slice ( s , s + l ) . map ( function ( x ) { return ( x < 16 ? "0" : "" ) + x . toString ( 16 ) } ) . join ( "" ) } ; var _ _utf8 , _ _ _utf8 ; _ _utf8 = _ _ _utf8 = function ( b , s , e ) { var ss = [ ] ; for ( var i = s ; i < e ; i ++ ) ss . push ( String . fromCharCode ( _ _readUInt8 ( b , i ) ) ) ; return ss . join ( "" ) } ; var _ _lpstr , _ _ _lpstr ; _ _lpstr = _ _ _lpstr = function lpstr _ ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? _ _utf8 ( b , i + 4 , i + 4 + len - 1 ) : "" } ; var _ _lpwstr , _ _ _lpwstr ; _ _lpwstr = _ _ _lpwstr = function lpwstr _ ( b , i ) { var len = 2 * _ _readUInt32LE ( b , i ) ; return len > 0 ? _ _utf8 ( b , i + 4 , i + 4 + len - 1 ) : "" } ; var _ _lpp4 , _ _ _lpp4 ; _ _lpp4 = _ _ _lpp4 = function lpp4 _ ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? _ _utf16le ( b , i + 4 , i + 4 + len ) : "" } ; var _ _8lpp4 , _ _ _8lpp4 ; _ _8lpp4 = _ _ _8lpp4 = function lpp4 _8 ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? _ _utf8 ( b , i + 4 , i + 4 + len ) : "" } ; var _ _double , _ _ _double ; _ _double = _ _ _double = function ( b , idx ) { return read _double _le ( b , idx ) } ; var is _buf = function is _buf _a ( a ) { return Array . isArray ( a ) } ; if ( has _buf ) { _ _utf16le = function utf16le _b ( b , s , e ) { if ( ! Buffer . isBuffer ( b ) ) return _ _ _utf16le ( b , s , e ) ; return b . toString ( "utf16le" , s , e ) } ; _ _hexlify = function ( b , s , l ) { return Buffer . isBuffer ( b ) ? b . toString ( "hex" , s , s + l ) : _ _ _hexlify ( b , s , l ) } ; _ _lpstr = function lpstr _b ( b , i ) { if ( ! Buffer . isBuffer ( b ) ) return _ _ _lpstr ( b , i ) ; var len = b . readUInt32LE ( i ) ; return len > 0 ? b . toString ( "utf8" , i + 4 , i + 4 + len - 1 ) : "" } ; _ _lpwstr = function lpwstr _b ( b , i ) { if ( ! Buffer . isBuffer ( b ) ) return _ _ _lpwstr ( b , i ) ; var len = 2 * b . readUInt32LE ( i ) ; return b . toString ( "utf16le" , i + 4 , i + 4 + len - 1 ) } ; _ _lpp4 = function lpp4 _b ( b , i ) { if ( ! Buffer . isBuffer ( b ) ) return _ _ _lpp4 ( b , i ) ; var len = b . readUInt32LE ( i ) ; return b . toString ( "utf16le" , i + 4 , i + 4 + len ) } ; _ _8lpp4 = function lpp4 _8b ( b , i ) { if ( ! Buffer . isBuffer ( b ) ) return _ _ _8lpp4 ( b , i ) ; var len = b . readUInt32LE ( i ) ; return b . toString ( "utf8" , i + 4 , i + 4 + len ) } ; _ _utf8 = function utf8 _b ( b , s , e ) { return b . toString ( "utf8" , s , e ) } ; _ _toBuffer = function ( bufs ) { return bufs [ 0 ] . length > 0 && Buffer . isBuffer ( bufs [ 0 ] [ 0 ] ) ? Buffer . concat ( bufs [ 0 ] ) : _ _ _toBuffer ( bufs ) } ; bconcat = function ( bufs ) { return Buffer . isBuffer ( bufs [ 0 ] ) ? Buffer . concat ( bufs ) : [ ] . concat . apply ( [ ] , bufs ) } ; _ _double = function double _ ( b , i ) { if ( Buffer . isBuffer ( b ) ) return b . readDoubleLE ( i ) ; return _ _ _double ( b , i ) } ; is _buf = function is _buf _b ( a ) { return Buffer . isBuffer ( a ) || Array . isArray ( a ) } } if ( typeof cptable !== "undefined" ) { _ _utf16le = function ( b , s , e ) { return cptable . utils . decode ( 1200 , b . slice ( s , e ) ) } ; _ _utf8 = function ( b , s , e ) { return cptable . utils . decode ( 65001 , b . slice ( s , e ) ) } ; _ _lpstr = function ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? cptable . utils . decode ( current _codepage , b . slice ( i + 4 , i + 4 + len - 1 ) ) : "" } ; _ _lpwstr = function ( b , i ) { var len = 2 * _ _readUInt32LE ( b , i ) ; return len > 0 ? cptable . utils . decode ( 1200 , b . slice ( i + 4 , i + 4 + len - 1 ) ) : "" } ; _ _lpp4 = function ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? cptable . utils . decode ( 1200 , b . slice ( i + 4 , i + 4 + len ) ) : "" } ; _ _8lpp4 = function ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? cptable . utils . decode ( 65001 , b . slice ( i + 4 , i + 4 + len ) ) : "" } } var _ _readUInt8 = function ( b , idx ) { return b [ idx ] } ; var _ _readUInt16LE = function ( b , idx ) { return b [ idx + 1 ] * ( 1 << 8 ) + b [ idx ] } ; var _ _readInt16LE = function ( b , idx ) { var u = b [ idx + 1 ] * ( 1 << 8 ) + b [ idx ] ; return u < 32768 ? u : ( 65535 - u + 1 ) * - 1 } ; var _ _readUInt32LE = function ( b , idx ) { return b [ idx + 3 ] * ( 1 << 24 ) + ( b [ idx + 2 ] << 16 ) + ( b [ idx + 1 ] << 8 ) + b [ idx ] } ; var _ _readInt32LE = function ( b , idx ) { return b [ idx + 3 ] << 24 | b [ idx + 2 ] << 16 | b [ idx + 1 ] << 8 | b [ idx ] } ; var _ _ _unhexlify = function ( s ) { return s . match ( /../g ) . map ( function ( x ) { return parseInt ( x , 16 ) } ) } ; var _ _unhexlify = typeof Buffer !== "undefined" ? function ( s ) { return Buffer . isBuffer ( s ) ? new Buffer ( s , "hex" ) : _ _ _unhexlify ( s ) } : _ _ _unhexlify ; function ReadShift ( size , t ) { var o = "" , oI , oR , oo = [ ] , w , vv , i , loc ; switch ( t ) { case "dbcs" : loc = this . l ; if ( has _buf && Buffer . isBuffer ( this ) ) o = this . slice ( this . l , this . l + 2 * size ) . toString ( "utf16le" ) ; else for ( i = 0 ; i != size ; ++ i ) { 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 . dec
o . push ( ' <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/>\n' ) ; for ( var i = 0 ; i < manifest . length ; ++ i ) o . push ( ' <manifest:file-entry manifest:full-path="' + manifest [ i ] [ 0 ] + '" manifest:media-type="' + manifest [ i ] [ 1 ] + '"/>\n' ) ; o . push ( "</manifest:manifest>" ) ; return o . join ( "" ) } function write _rdf _type ( file , res , tag ) { return [ ' <rdf:Description rdf:about="' + file + '">\n' , ' <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/' + ( tag || "odf" ) + "#" + res + '"/>\n' , " </rdf:Description>\n" ] . join ( "" ) } function write _rdf _has ( base , file ) { return [ ' <rdf:Description rdf:about="' + base + '">\n' , ' <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="' + file + '"/>\n' , " </rdf:Description>\n" ] . join ( "" ) } function write _rdf ( rdf , opts ) { var o = [ XML _HEADER ] ; o . push ( '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n' ) ; for ( var i = 0 ; i != rdf . length ; ++ i ) { o . push ( write _rdf _type ( rdf [ i ] [ 0 ] , rdf [ i ] [ 1 ] ) ) ; o . push ( write _rdf _has ( "" , rdf [ i ] [ 0 ] ) ) } o . push ( write _rdf _type ( "" , "Document" , "pkg" ) ) ; o . push ( "</rdf:RDF>" ) ; return o . join ( "" ) } var CORE _PROPS = [ [ "cp:category" , "Category" ] , [ "cp:contentStatus" , "ContentStatus" ] , [ "cp:keywords" , "Keywords" ] , [ "cp:lastModifiedBy" , "LastAuthor" ] , [ "cp:lastPrinted" , "LastPrinted" ] , [ "cp:revision" , "RevNumber" ] , [ "cp:version" , "Version" ] , [ "dc:creator" , "Author" ] , [ "dc:description" , "Comments" ] , [ "dc:identifier" , "Identifier" ] , [ "dc:language" , "Language" ] , [ "dc:subject" , "Subject" ] , [ "dc:title" , "Title" ] , [ "dcterms:created" , "CreatedDate" , "date" ] , [ "dcterms:modified" , "ModifiedDate" , "date" ] ] ; XMLNS . CORE _PROPS = "http://schemas.openxmlformats.org/package/2006/metadata/core-properties" ; RELS . CORE _PROPS = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" ; var CORE _PROPS _REGEX = function ( ) { var r = new Array ( CORE _PROPS . length ) ; for ( var i = 0 ; i < CORE _PROPS . length ; ++ i ) { var f = CORE _PROPS [ i ] ; var g = "(?:" + f [ 0 ] . substr ( 0 , f [ 0 ] . indexOf ( ":" ) ) + ":)" + f [ 0 ] . substr ( f [ 0 ] . indexOf ( ":" ) + 1 ) ; r [ i ] = new RegExp ( "<" + g + "[^>]*>(.*)</" + g + ">" ) } return r } ( ) ; function parse _core _props ( data ) { var p = { } ; for ( var i = 0 ; i < CORE _PROPS . length ; ++ i ) { var f = CORE _PROPS [ i ] , cur = data . match ( CORE _PROPS _REGEX [ i ] ) ; if ( cur != null && cur . length > 0 ) p [ f [ 1 ] ] = cur [ 1 ] ; if ( f [ 2 ] === "date" && p [ f [ 1 ] ] ) p [ f [ 1 ] ] = parseDate ( p [ f [ 1 ] ] ) } return p } var CORE _PROPS _XML _ROOT = writextag ( "cp:coreProperties" , null , { "xmlns:cp" : XMLNS . CORE _PROPS , "xmlns:dc" : XMLNS . dc , "xmlns:dcterms" : XMLNS . dcterms , "xmlns:dcmitype" : XMLNS . dcmitype , "xmlns:xsi" : XMLNS . xsi } ) ; function cp _doit ( f , g , h , o , p ) { if ( p [ f ] != null || g == null || g === "" ) return ; p [ f ] = g ; o [ o . length ] = h ? writextag ( f , g , h ) : writetag ( f , g ) } function write _core _props ( cp , _opts ) { var opts = _opts || { } ; var o = [ XML _HEADER , CORE _PROPS _XML _ROOT ] , p = { } ; if ( ! cp && ! opts . Props ) return o . join ( "" ) ; if ( cp ) { if ( cp . CreatedDate != null ) cp _doit ( "dcterms:created" , typeof cp . CreatedDate === "string" ? cp . CreatedDate : write _w3cdtf ( cp . CreatedDate , opts . WTF ) , { "xsi:type" : "dcterms:W3CDTF" } , o , p ) ; if ( cp . ModifiedDate != null ) cp _doit ( "dcterms:modified" , typeof cp . ModifiedDate === "string" ? cp . ModifiedDate : write _w3cdtf ( cp . ModifiedDate , opts . WTF ) , { "xsi:type" : "dcterms:W3CDTF" } , o , p ) } for ( var i = 0 ; i != CORE _PROPS . length ; ++ i ) { var f = CORE _PROPS [ i ] ; var v = opts . Props && opts . Props [ f [ 1 ] ] != null ? opts . Props [ f [ 1 ] ] : cp ? cp [ f [ 1 ] ] : null ; if ( v === true ) v = "1" ; else if ( v === false ) v = "0" ; else if ( typeof v == "number" ) v = String ( v ) ; if ( v != null ) cp _doit ( f [ 0 ] , v , null , o , p ) } if ( o . length > 2 ) { o [ o . length ] = "</cp:coreProperties>" ; o [ 1 ] = o [ 1 ] . replace ( "/>" , ">" ) } return o . join ( "" ) } var EXT _PROPS = [ [ "Application" , "Application" , "string" ] , [ "AppVersion" , "AppVersion" , "string" ] , [ "Company" , "Company" , "string" ] , [ "DocSecurity" , "DocSecurity" , "string" ] , [ "Manager" , "Manager" , "string" ] , [ "HyperlinksChanged" , "HyperlinksChanged" , "bool" ] , [ "SharedDoc" , "SharedDoc" , "bool" ] , [ "LinksUpToDate" , "LinksUpToDate" , "bool" ] , [ "ScaleCrop" , "ScaleCrop" , "bool" ] , [ "HeadingPairs" , "HeadingPairs" , "raw" ] , [ "TitlesOfParts" , "TitlesOfParts" , "raw" ] ] ; XMLNS . EXT _PROPS = "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" ; RELS . EXT _PROPS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" ; function parse _ext _p
var s = blob . l ; var texts = "" ; try { blob . l += 4 ; var ot = ( opts . lastobj || { cmo : [ 0 , 0 ] } ) . cmo [ 1 ] ; var controlInfo ; if ( [ 0 , 5 , 7 , 11 , 12 , 14 ] . indexOf ( ot ) == - 1 ) blob . l += 6 ; else controlInfo = parse _ControlInfo ( blob , 6 , opts ) ; var cchText = blob . read _shift ( 2 ) ; var cbRuns = blob . read _shift ( 2 ) ; var ifntEmpty = parse _FontIndex ( blob , 2 ) ; var len = blob . read _shift ( 2 ) ; blob . l += len ; for ( var i = 1 ; i < blob . lens . length - 1 ; ++ i ) { if ( blob . l - s != blob . lens [ i ] ) throw new Error ( "TxO: bad continue record" ) ; var hdr = blob [ blob . l ] ; var t = parse _XLUnicodeStringNoCch ( blob , blob . lens [ i + 1 ] - blob . lens [ i ] - 1 ) ; texts += t ; if ( texts . length >= ( hdr ? cchText : 2 * cchText ) ) break } if ( texts . length !== cchText && texts . length !== cchText * 2 ) { throw new Error ( "cchText: " + cchText + " != " + texts . length ) } blob . l = s + length ; return { t : texts } } catch ( e ) { blob . l = s + length ; return { t : texts } } } var parse _HLink = function ( blob , length ) { var ref = parse _Ref8U ( blob , 8 ) ; blob . l += 16 ; var hlink = parse _Hyperlink ( blob , length - 24 ) ; return [ ref , hlink ] } ; var parse _HLinkTooltip = function ( blob , length ) { var end = blob . l + length ; blob . read _shift ( 2 ) ; var ref = parse _Ref8U ( blob , 8 ) ; var wzTooltip = blob . read _shift ( ( length - 10 ) / 2 , "dbcs-cont" ) ; wzTooltip = wzTooltip . replace ( chr0 , "" ) ; return [ ref , wzTooltip ] } ; function parse _Country ( blob , length ) { var o = [ ] , d ; d = blob . read _shift ( 2 ) ; o [ 0 ] = CountryEnum [ d ] || d ; d = blob . read _shift ( 2 ) ; o [ 1 ] = CountryEnum [ d ] || d ; return o } function parse _ClrtClient ( blob , length ) { var ccv = blob . read _shift ( 2 ) ; var o = [ ] ; while ( ccv -- > 0 ) o . push ( parse _LongRGB ( blob , 8 ) ) ; return o } function parse _Palette ( blob , length ) { var ccv = blob . read _shift ( 2 ) ; var o = [ ] ; while ( ccv -- > 0 ) o . push ( parse _LongRGB ( blob , 8 ) ) ; return o } function parse _XFCRC ( blob , length ) { blob . l += 2 ; var o = { cxfs : 0 , crc : 0 } ; o . cxfs = blob . read _shift ( 2 ) ; o . crc = blob . read _shift ( 4 ) ; return o } function parse _ColInfo ( blob , length , opts ) { if ( ! opts . cellStyles ) return parsenoop ( blob , length ) ; var w = opts && opts . biff >= 12 ? 4 : 2 ; var colFirst = blob . read _shift ( w ) ; var colLast = blob . read _shift ( w ) ; var coldx = blob . read _shift ( w ) ; var ixfe = blob . read _shift ( w ) ; var flags = blob . read _shift ( 2 ) ; if ( w == 2 ) blob . l += 2 ; return { s : colFirst , e : colLast , w : coldx , ixfe : ixfe , flags : flags } } function parse _Setup ( blob , length , opts ) { var o = { } ; blob . l += 16 ; o . header = parse _Xnum ( blob , 8 ) ; o . footer = parse _Xnum ( blob , 8 ) ; blob . l += 2 ; return o } function parse _ShtProps ( blob , length , opts ) { var def = { area : false } ; if ( opts . biff != 5 ) { blob . l += length ; return def } var d = blob . read _shift ( 1 ) ; blob . l += 3 ; if ( d & 16 ) def . area = true ; return def } var parse _Style = parsenoop ; var parse _StyleExt = parsenoop ; var parse _Window2 = parsenoop ; var parse _Backup = parsebool ; var parse _Blank = parse _XLSCell ; var parse _BottomMargin = parse _Xnum ; var parse _BuiltInFnGroupCount = parseuint16 ; var parse _CalcCount = parseuint16 ; var parse _CalcDelta = parse _Xnum ; var parse _CalcIter = parsebool ; var parse _CalcMode = parseuint16 ; var parse _CalcPrecision = parsebool ; var parse _CalcRefMode = parsenoop2 ; var parse _CalcSaveRecalc = parsebool ; var parse _CodePage = parseuint16 ; var parse _Compat12 = parsebool ; var parse _Date1904 = parsebool ; var parse _DefColWidth = parseuint16 ; var parse _DSF = parsenoop2 ; var parse _EntExU2 = parsenoop2 ; var parse _EOF = parsenoop2 ; var parse _Excel9File = parsenoop2 ; var parse _FeatHdr = parsenoop2 ; var parse _FontX = parseuint16 ; var parse _Footer = parse _XLHeaderFooter ; var parse _GridSet = parseuint16 ; var parse _HCenter = parsebool ; var parse _Header = parse _XLHeaderFooter ; var parse _HideObj = parse _HideObjEnum ; var parse _InterfaceEnd = parsenoop2 ; var parse _LeftMargin = parse _Xnum ; var parse _Mms = parsenoop2 ; var parse _ObjProtect = parsebool ; var parse _Password = parseuint16 ; var parse _PrintGrid = parsebool ; var parse _PrintRowCol = parsebool ; var parse _PrintSize = parseuint16 ; var parse _Prot4Rev = parsebool ; var parse _Prot4RevPass = parseuint16 ; var parse _Protect = parsebool ; var parse _RefreshAll = parsebool ; var parse _RightMargin = parse _Xnum ; var parse _RRTabId = parseuint16a ; var parse _ScenarioProtect = parsebool ; var parse _Scl = parseuint16a ; var parse _String = parse _XLUnicodeString ; var parse _SxBool = parsebool ; var parse _TopMargin = parse _Xnum ; var parse _UsesELFs = parsebool ; var parse _VCenter = parsebool ; var parse _WinProtect = parsebool ; var parse _WriteProtect = parsenoop ; var parse _VerticalPageBreaks = parsenoop ; var parse _HorizontalPageBreaks = parsenoop ; var parse _Selection = parsenoop ; var parse _Continue = parsenoop ; var parse _Pane = parsenoo
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" : align = y . val ; break ; case "<scheme" : break ; default : if ( y [ 0 ] . charCodeAt ( 1 ) !== 47 ) throw "Unrecognized rich format " + y [ 0 ] } } var style = [ ] ; if ( font . u ) style . push ( "text-decoration: underline;" ) ; if ( font . uval ) style . push ( "text-underline-style:" + font . uval + ";" ) ; if ( font . sz ) style . push ( "font-size:" + font . sz + ";" ) ; if ( font . outline ) style . push ( "text-effect: outline;" ) ; if ( font . shadow ) style . push ( "text-shadow: auto;" ) ; intro . push ( '<span style="' + style . join ( "" ) + '">' ) ; if ( font . b ) { intro . push ( "<b>" ) ; outro . push ( "</b>" ) } if ( font . i ) { intro . push ( "<i>" ) ; outro . push ( "</i>" ) } if ( font . strike ) { intro . push ( "<s>" ) ; outro . push ( "</s>" ) } if ( align == "superscript" ) align = "sup" ; else if ( align == "subscript" ) align = "sub" ; if ( align != "" ) { intro . push ( "<" + align + ">" ) ; outro . push ( "</" + align + ">" ) } 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 = escapehtml ( 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 sstr0 = /<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/ ; var sstr1 = /<(?:\w+:)?(?:si|sstItem)>/g ; var sstr2 = /<\/(?:\w+:)?(?:si|sstItem)>/ ; function parse _sst _xml ( data , opts ) { var s = [ ] , ss = "" ; if ( ! data ) return s ; var sst = data . match ( sstr0 ) ; if ( isval ( sst ) ) { ss = sst [ 2 ] . replace ( sstr1 , "" ) . split ( sstr2 ) ; for ( var i = 0 ; i != ss . length ; ++ i ) { var o = parse _si ( ss [ i ] . trim ( ) , opts ) ; if ( o != null ) s [ s . length ] = o } sst = parsexmltag ( sst [ 1 ] ) ; s . Count = sst . count ; s . Unique = sst . uniqueCount } return s } RELS . SST = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" ; var straywsregex = /^\s|\s$|[\t\n\r]/ ; function write _sst _xml ( sst , opts ) { if ( ! opts . bookSST ) return "" ; var o = [ XML _HEADER ] ; o [ o . length ] = writextag ( "sst" , null , { xmlns : XMLNS . main [ 0 ] , count : sst . Count , uniqueCount : sst . Unique } ) ; for ( var i = 0 ; i != sst . length ; ++ i ) { if ( sst [ i ] == null ) continue ; var s = sst [ i ] ; var sitag = "<si>" ; if ( s . r ) sitag += s . r ; else { sitag += "<t" ; if ( ! s . t ) s . t = "" ; if ( s . t . match ( straywsregex ) ) sitag += ' xml:space="preserve"' ; sitag += ">" + escapexml ( s . t ) + "</t>" } sitag += "</si>" ; o [ o . length ] = sitag } if ( o . length > 2 ) { o [ o . length ] = "</sst>" ; o [ 1 ] = o [ 1 ] . replace ( "/>" , ">" ) } return o . join ( "" ) } function parse _BrtBeginSst ( data , length ) { return [ data . read _shift ( 4 ) , data . read _shift ( 4 ) ] } function parse _sst _bin ( data , opts ) { var s = [ ] ; var pass = false ; recordhopper ( data , function hopper _sst ( val , R _n , RT ) { switch ( RT ) { case 159 : s . Count = val [ 0 ] ; s . Unique = val [ 1 ] ; break ; case 19 : s . push ( val ) ; break ; case 160 : return true ; case 35 : pass = true ; break ; case 36 : pass = false ; break ; default : if ( R _n . indexOf ( "Begin" ) > 0 ) { } else if ( R _n . indexOf ( "End" ) > 0 ) { } if ( ! pass || opts . WTF ) throw new Error ( "Unexpected record " + RT + " " + R _n ) } } ) ; return s } function write _BrtBeginSst ( sst , o ) { if ( ! o ) o = new _buf ( 8 ) ; o . write _shift ( 4 , sst . Count ) ; o . write _shift ( 4 , sst . Unique ) ; return o } var write _BrtSSTItem = write _RichStr ; function write _sst _bin ( sst , opts ) { var ba = buf _array ( ) ; write _record ( ba , "BrtBeginSst" , write _BrtBeginSst ( sst ) ) ; for ( var i = 0 ; i < sst . length ; ++ i ) write _record ( ba , "BrtSSTItem" , write _BrtSSTItem ( sst [ i ] ) ) ; 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 _CRY
o [ o . length ] = "</a:gsLst>" ; o [ o . length ] = '<a:lin ang="16200000" scaled="1"/>' ; o [ o . length ] = "</a:gradFill>" ; o [ o . length ] = '<a:gradFill rotWithShape="1">' ; o [ o . length ] = "<a:gsLst>" ; o [ o . length ] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>' ; o [ o . length ] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>' ; o [ o . length ] = "</a:gsLst>" ; o [ o . length ] = '<a:lin ang="16200000" scaled="0"/>' ; o [ o . length ] = "</a:gradFill>" ; o [ o . length ] = "</a:fillStyleLst>" ; o [ o . length ] = "<a:lnStyleLst>" ; o [ o . length ] = '<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>' ; o [ o . length ] = '<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>' ; o [ o . length ] = '<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>' ; o [ o . length ] = "</a:lnStyleLst>" ; o [ o . length ] = "<a:effectStyleLst>" ; o [ o . length ] = "<a:effectStyle>" ; o [ o . length ] = "<a:effectLst>" ; o [ o . length ] = '<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>' ; o [ o . length ] = "</a:effectLst>" ; o [ o . length ] = "</a:effectStyle>" ; o [ o . length ] = "<a:effectStyle>" ; o [ o . length ] = "<a:effectLst>" ; o [ o . length ] = '<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>' ; o [ o . length ] = "</a:effectLst>" ; o [ o . length ] = "</a:effectStyle>" ; o [ o . length ] = "<a:effectStyle>" ; o [ o . length ] = "<a:effectLst>" ; o [ o . length ] = '<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>' ; o [ o . length ] = "</a:effectLst>" ; o [ o . length ] = '<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>' ; o [ o . length ] = '<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>' ; o [ o . length ] = "</a:effectStyle>" ; o [ o . length ] = "</a:effectStyleLst>" ; o [ o . length ] = "<a:bgFillStyleLst>" ; o [ o . length ] = '<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>' ; o [ o . length ] = '<a:gradFill rotWithShape="1">' ; o [ o . length ] = "<a:gsLst>" ; o [ o . length ] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>' ; o [ o . length ] = '<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>' ; o [ o . length ] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>' ; o [ o . length ] = "</a:gsLst>" ; o [ o . length ] = '<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>' ; o [ o . length ] = "</a:gradFill>" ; o [ o . length ] = '<a:gradFill rotWithShape="1">' ; o [ o . length ] = "<a:gsLst>" ; o [ o . length ] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>' ; o [ o . length ] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>' ; 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 : schem
break ; case "PtgNum" : stack . push ( String ( f [ 1 ] ) ) ; break ; case "PtgStr" : stack . push ( '"' + f [ 1 ] + '"' ) ; break ; case "PtgErr" : stack . push ( f [ 1 ] ) ; break ; case "PtgAreaN" : type = f [ 1 ] [ 0 ] ; r = shift _range _xls ( f [ 1 ] [ 1 ] , _range , opts ) ; stack . push ( encode _range _xls ( r , opts ) ) ; break ; case "PtgArea" : type = f [ 1 ] [ 0 ] ; r = shift _range _xls ( f [ 1 ] [ 1 ] , _range , opts ) ; stack . push ( encode _range _xls ( r , opts ) ) ; break ; case "PtgArea3d" : type = f [ 1 ] [ 0 ] ; ixti = f [ 1 ] [ 1 ] ; r = f [ 1 ] [ 2 ] ; sname = supbooks && supbooks [ 1 ] ? supbooks [ 1 ] [ ixti + 1 ] : "**MISSING**" ; stack . push ( sname + "!" + encode _range ( r ) ) ; break ; case "PtgAttrSum" : stack . push ( "SUM(" + stack . pop ( ) + ")" ) ; break ; case "PtgAttrSemi" : break ; case "PtgName" : nameidx = f [ 1 ] [ 2 ] ; var lbl = ( supbooks . names || [ ] ) [ nameidx - 1 ] || ( supbooks [ 0 ] || [ ] ) [ nameidx ] ; var name = lbl ? lbl . Name : "**MISSING**" + String ( nameidx ) ; if ( name in XLSXFutureFunctions ) name = XLSXFutureFunctions [ name ] ; stack . push ( name ) ; break ; case "PtgNameX" : var bookidx = f [ 1 ] [ 1 ] ; nameidx = f [ 1 ] [ 2 ] ; var externbook ; if ( opts . biff <= 5 ) { if ( bookidx < 0 ) bookidx = - bookidx ; if ( supbooks [ bookidx ] ) externbook = supbooks [ bookidx ] [ nameidx ] } else { var pnxname = supbooks . SheetNames [ bookidx ] ; var o = "" ; if ( ( ( supbooks [ bookidx ] || [ ] ) [ 0 ] || [ ] ) [ 0 ] == 14849 ) { } else if ( ( ( supbooks [ bookidx ] || [ ] ) [ 0 ] || [ ] ) [ 0 ] == 1025 ) { if ( supbooks [ bookidx ] [ nameidx ] && supbooks [ bookidx ] [ nameidx ] . itab > 0 ) { o = supbooks . SheetNames [ supbooks [ bookidx ] [ nameidx ] . itab - 1 ] + "!" } } else o = supbooks . SheetNames [ nameidx - 1 ] + "!" ; if ( supbooks [ bookidx ] && supbooks [ bookidx ] [ nameidx ] ) o += supbooks [ bookidx ] [ nameidx ] . Name ; else if ( supbooks [ 0 ] && supbooks [ 0 ] [ nameidx ] ) o += supbooks [ 0 ] [ nameidx ] . Name ; else o += "??NAMEX??" ; stack . push ( o ) ; break } if ( ! externbook ) externbook = { Name : "??NAMEX??" } ; stack . push ( externbook . Name ) ; break ; case "PtgParen" : var lp = "(" , rp = ")" ; if ( last _sp >= 0 ) { sp = "" ; switch ( formula [ 0 ] [ last _sp ] [ 1 ] [ 0 ] ) { case 2 : lp = fill ( " " , formula [ 0 ] [ last _sp ] [ 1 ] [ 1 ] ) + lp ; break ; case 3 : lp = fill ( "\r" , formula [ 0 ] [ last _sp ] [ 1 ] [ 1 ] ) + lp ; break ; case 4 : rp = fill ( " " , formula [ 0 ] [ last _sp ] [ 1 ] [ 1 ] ) + rp ; break ; case 5 : rp = fill ( "\r" , formula [ 0 ] [ last _sp ] [ 1 ] [ 1 ] ) + rp ; break ; default : if ( opts . WTF ) throw new Error ( "Unexpected PtgAttrSpaceType " + formula [ 0 ] [ last _sp ] [ 1 ] [ 0 ] ) } last _sp = - 1 } stack . push ( lp + stack . pop ( ) + rp ) ; break ; case "PtgRefErr" : stack . push ( "#REF!" ) ; break ; case "PtgRefErr3d" : stack . push ( "#REF!" ) ; break ; case "PtgExp" : c = { c : f [ 1 ] [ 1 ] , r : f [ 1 ] [ 0 ] } ; var q = { c : cell . c , r : cell . r } ; if ( supbooks . sharedf [ encode _cell ( c ) ] ) { var parsedf = supbooks . sharedf [ encode _cell ( c ) ] ; stack . push ( stringify _formula ( parsedf , _range , q , supbooks , opts ) ) } else { var fnd = false ; for ( e1 = 0 ; e1 != supbooks . arrayf . length ; ++ e1 ) { e2 = supbooks . arrayf [ e1 ] ; if ( c . c < e2 [ 0 ] . s . c || c . c > e2 [ 0 ] . e . c ) continue ; if ( c . r < e2 [ 0 ] . s . r || c . r > e2 [ 0 ] . e . r ) continue ; stack . push ( stringify _formula ( e2 [ 1 ] , _range , q , supbooks , opts ) ) ; fnd = true ; break } if ( ! fnd ) stack . push ( f [ 1 ] ) } break ; case "PtgArray" : stack . push ( "{" + stringify _array ( f [ 1 ] ) + "}" ) ; break ; case "PtgMemArea" : break ; case "PtgAttrSpace" : case "PtgAttrSpaceSemi" : last _sp = ff ; break ; case "PtgTbl" : break ; case "PtgMemErr" : break ; case "PtgMissArg" : stack . push ( "" ) ; break ; case "PtgAreaErr" : stack . push ( "#REF!" ) ; break ; case "PtgAreaErr3d" : stack . push ( "#REF!" ) ; break ; case "PtgMemFunc" : break ; default : throw new Error ( "Unrecognized Formula Token: " + String ( f ) ) } var PtgNonDisp = [ "PtgAttrSpace" , "PtgAttrSpaceSemi" , "PtgAttrGoto" ] ; if ( last _sp >= 0 && PtgNonDisp . indexOf ( formula [ 0 ] [ ff ] [ 0 ] ) == - 1 ) { f = formula [ 0 ] [ last _sp ] ; var _left = true ; switch ( f [ 1 ] [ 0 ] ) { case 4 : _left = false ; case 0 : sp = fill ( " " , f [ 1 ] [ 1 ] ) ; break ; case 5 : _left = false ; case 1 : sp = fill ( "\r" , f [ 1 ] [ 1 ] ) ; break ; default : sp = "" ; if ( opts . WTF ) throw new Error ( "Unexpected PtgAttrSpaceType " + f [ 1 ] [ 0 ] ) } stack . push ( ( _left ? sp : "" ) + stack . pop ( ) + ( _left ? "" : sp ) ) ; last _sp = - 1 } } if ( stack . length > 1 && opts . WTF ) throw new Error ( "bad formula stack" ) ; return stack [ 0 ] } function parse _XLSBParsedFormula ( data , length , opts ) { var end = data . l + length ; var cce = data . read _shift ( 4 ) ; var rgce = parse _Rgce ( data , cce , opts ) ; var cb = data . read _shift ( 4 ) ; var rgcb = cb > 0 ? parse _RgbExtra ( data , cb , rgce , opts ) : null ; return [ rgce , rgcb ] } var parse _XLSBArrayParsedFormula = parse _XLSBParsedFormula ; var parse _XLSBCellParsedFormula = parse _XLSBParsedFormula ; var parse _XLSBNameParsedFormula = parse _XLSBParsedFormula ; var parse _XLSBSharedParsedFormula = parse _XLSBParsedFormula ; var PtgDataType = { 1 : "REFERENCE" , 2 : "VALUE" , 3 : "ARRAY" } ; var Cetab = { 0 : "BEEP" , 1 : "OPEN" , 2 : "OPEN.LINKS" , 3 : "CLOSE.ALL" , 4 : " SA
var refregex = /ref=["']([^"']*)["']/ ; var match _v = matchtag ( "v" ) , match _f = matchtag ( "f" ) ; return function parse _ws _xml _data ( sdata , s , opts , guess , themes , styles ) { var ri = 0 , x = "" , cells = [ ] , cref = [ ] , idx = 0 , i = 0 , cc = 0 , d = "" , p ; var tag , tagr = 0 , tagc = 0 ; var sstr , ftag ; var fmtid = 0 , fillid = 0 , do _format = Array . isArray ( styles . CellXf ) , cf ; var arrayf = [ ] ; var sharedf = [ ] ; var dense = Array . isArray ( s ) ; for ( var marr = sdata . split ( rowregex ) , mt = 0 , marrlen = marr . length ; mt != marrlen ; ++ mt ) { x = marr [ mt ] . trim ( ) ; var xlen = x . length ; if ( xlen === 0 ) continue ; for ( ri = 0 ; ri < xlen ; ++ ri ) if ( x . charCodeAt ( ri ) === 62 ) break ; ++ ri ; tag = parsexmltag ( x . substr ( 0 , ri ) , true ) ; tagr = typeof tag . r !== "undefined" ? parseInt ( tag . r , 10 ) : tagr + 1 ; tagc = - 1 ; if ( opts . sheetRows && opts . sheetRows < tagr ) continue ; if ( guess . s . r > tagr - 1 ) guess . s . r = tagr - 1 ; if ( guess . e . r < tagr - 1 ) guess . e . r = tagr - 1 ; cells = x . substr ( ri ) . split ( cellregex ) ; for ( ri = 0 ; ri != cells . length ; ++ ri ) { x = cells [ ri ] . trim ( ) ; if ( x . length === 0 ) continue ; cref = x . match ( rregex ) ; idx = ri ; i = 0 ; cc = 0 ; x = "<c " + ( x . substr ( 0 , 1 ) == "<" ? ">" : "" ) + x ; if ( cref != null && cref . length === 2 ) { idx = 0 ; d = cref [ 1 ] ; for ( i = 0 ; i != d . length ; ++ i ) { if ( ( cc = d . charCodeAt ( i ) - 64 ) < 1 || cc > 26 ) break ; idx = 26 * idx + cc } -- idx ; tagc = idx } else ++ tagc ; for ( i = 0 ; i != x . length ; ++ i ) if ( x . charCodeAt ( i ) === 62 ) break ; ++ i ; tag = parsexmltag ( x . substr ( 0 , i ) , true ) ; if ( ! tag . r ) tag . r = encode _cell ( { r : tagr - 1 , c : tagc } ) ; d = x . substr ( i ) ; p = { t : "" } ; if ( ( cref = d . match ( match _v ) ) != null && cref [ 1 ] !== "" ) p . v = unescapexml ( cref [ 1 ] ) ; if ( opts . cellFormula ) { if ( ( cref = d . match ( match _f ) ) != null && cref [ 1 ] !== "" ) { p . f = unescapexml ( utf8read ( cref [ 1 ] ) ) . replace ( /_xlfn\./ , "" ) ; if ( cref [ 0 ] . indexOf ( 't="array"' ) > - 1 ) { p . F = ( d . match ( refregex ) || [ ] ) [ 1 ] ; if ( p . F . indexOf ( ":" ) > - 1 ) arrayf . push ( [ safe _decode _range ( p . F ) , p . F ] ) } else if ( cref [ 0 ] . indexOf ( 't="shared"' ) > - 1 ) { ftag = parsexmltag ( cref [ 0 ] ) ; sharedf [ parseInt ( ftag . si , 10 ) ] = [ ftag , unescapexml ( utf8read ( cref [ 1 ] ) ) ] } } else if ( cref = d . match ( /<f[^>]*\/>/ ) ) { ftag = parsexmltag ( cref [ 0 ] ) ; if ( sharedf [ ftag . si ] ) p . f = shift _formula _xlsx ( sharedf [ ftag . si ] [ 1 ] , sharedf [ ftag . si ] [ 0 ] . ref , tag . r ) } var _tag = decode _cell ( tag . r ) ; for ( i = 0 ; i < arrayf . length ; ++ i ) if ( _tag . r >= arrayf [ i ] [ 0 ] . s . r && _tag . r <= arrayf [ i ] [ 0 ] . e . r ) if ( _tag . c >= arrayf [ i ] [ 0 ] . s . c && _tag . c <= arrayf [ i ] [ 0 ] . e . c ) p . F = arrayf [ i ] [ 1 ] } if ( tag . t === undefined && p . v === undefined ) { if ( ! opts . sheetStubs ) continue ; p . t = "z" } else p . t = tag . t || "n" ; if ( guess . s . c > idx ) guess . s . c = idx ; if ( guess . e . c < idx ) guess . e . c = idx ; switch ( p . t ) { case "n" : p . v = parseFloat ( p . v ) ; break ; case "s" : sstr = strs [ parseInt ( p . v , 10 ) ] ; if ( typeof p . v == "undefined" ) { if ( ! opts . sheetStubs ) continue ; p . t = "z" } p . v = sstr . t ; p . r = sstr . r ; if ( opts . cellHTML ) p . h = sstr . h ; break ; case "str" : p . t = "s" ; p . v = p . v != null ? utf8read ( p . v ) : "" ; if ( opts . cellHTML ) p . h = escapehtml ( p . v ) ; break ; case "inlineStr" : cref = d . match ( isregex ) ; p . t = "s" ; if ( cref != null && ( sstr = parse _si ( cref [ 1 ] ) ) ) p . v = sstr . t ; else p . v = "" ; break ; case "b" : p . v = parsexmlbool ( p . v ) ; break ; case "d" : if ( ! opts . cellDates ) { p . v = datenum ( parseDate ( p . v ) ) ; p . t = "n" } break ; case "e" : if ( opts && opts . cellText === false ) p . w = p . v ; p . v = RBErr [ p . v ] ; break } fmtid = fillid = 0 ; if ( do _format && tag . s !== undefined ) { cf = styles . CellXf [ tag . s ] ; if ( cf != null ) { if ( cf . numFmtId != null ) fmtid = cf . numFmtId ; if ( opts . cellStyles && cf . fillId != null ) fillid = cf . fillId } } safe _format ( p , fmtid , fillid , opts , themes , styles ) ; if ( opts . cellDates && do _format && p . t == "n" && SSF . is _date ( SSF . _table [ fmtid ] ) ) { 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 ) ) } } if ( dense ) { var _r = decode _cell ( tag . r ) ; if ( ! s [ _r . r ] ) s [ _r . r ] = [ ] ; s [ _r . r ] [ _r . c ] = p } else s [ tag . r ] = p } } } } ( ) ; function write _ws _xml _data ( ws , opts , idx , wb , rels ) { var o = [ ] , r = [ ] , range = safe _decode _range ( ws [ "!ref" ] ) , cell , ref , rr = "" , cols = [ ] , R = 0 , C = 0 , rows = ws [ "!rows" ] ; var dense = Array . isArray ( ws ) ; for ( C = range . s . c ; C <= range . e . c ; ++ C ) cols [ C ] = encode _col ( C ) ; for ( R = range . s . r ; R <= range . e . r ; ++ R ) { r = [ ] ; rr = encode _row ( R ) ; for ( C = range . s . c ; C <= range . e . c ; ++ C ) { ref = cols [ C ] + rr ; var _cell = dense ? ( ws [ R ] || [ ] ) [ C ] : ws [ ref ] ; if ( _cell === undefined ) continue ; if ( ( cell = write _ws _xml _cell ( _cell , ref , ws , opts , idx , wb ) ) != null ) r . push ( cell ) } if ( r . length > 0 ) { var params = { r : rr } ; if ( rows && rows [ R ] ) { var row = rows [ R ] ; if ( row . hidden ) params . hidden = 1 ; var height = - 1 ; if ( row . hpx ) height = px2pt ( row . hpx ) ; else if ( row . hpt ) height = row . hpt ; if ( height > - 1 ) { params . ht = height ; params . customHeight = 1 } } o [ o . length ] = writextag ( "row" , r . join ( "" ) , params ) } } return o .
switch ( RT ) { case 156 : supbooks . SheetNames . push ( val . name ) ; wb . Sheets . push ( val ) ; break ; case 39 : val . Ref = stringify _formula ( val . Ptg , null , null , supbooks , opts ) ; delete val . Ptg ; Names . push ( val ) ; break ; case 1036 : break ; case 2071 : case 534 : case 677 : case 158 : case 157 : case 610 : case 2050 : case 362 : case 155 : case 548 : case 676 : case 128 : case 665 : case 2128 : case 2125 : case 549 : case 2053 : case 361 : case 596 : case 667 : case 355 : case 358 : case 357 : case 2076 : case 2075 : case 2082 : case 397 : case 154 : case 153 : case 1117 : case 553 : case 2091 : break ; case 35 : pass = true ; break ; case 36 : pass = false ; break ; case 37 : break ; case 38 : break ; case 16 : break ; default : if ( ( R _n || "" ) . indexOf ( "Begin" ) > 0 ) { } else if ( ( R _n || "" ) . indexOf ( "End" ) > 0 ) { } else if ( ! pass || opts . WTF ) throw new Error ( "Unexpected record " + RT + " " + R _n ) } } , opts ) ; parse _wb _defaults ( wb ) ; wb . Names = Names ; return wb } function write _BUNDLESHS ( ba , wb , opts ) { write _record ( ba , "BrtBeginBundleShs" ) ; for ( var idx = 0 ; idx != wb . SheetNames . length ; ++ idx ) { var viz = wb . Workbook && wb . Workbook . Sheets && wb . Workbook . Sheets [ idx ] && wb . Workbook . Sheets [ idx ] . Hidden || 0 ; var d = { Hidden : viz , iTabID : idx + 1 , strRelID : "rId" + ( idx + 1 ) , name : wb . SheetNames [ idx ] } ; write _record ( ba , "BrtBundleSh" , write _BrtBundleSh ( d ) ) } write _record ( ba , "BrtEndBundleShs" ) } function write _BrtFileVersion ( data , o ) { if ( ! o ) o = new _buf ( 127 ) ; for ( var i = 0 ; i != 4 ; ++ i ) o . write _shift ( 4 , 0 ) ; write _XLWideString ( "SheetJS" , o ) ; write _XLWideString ( XLSX . version , o ) ; write _XLWideString ( XLSX . version , o ) ; write _XLWideString ( "7262" , o ) ; o . length = o . l ; return o . length > o . l ? o . slice ( 0 , o . l ) : o } function write _BrtBookView ( idx , o ) { if ( ! o ) o = new _buf ( 29 ) ; o . write _shift ( - 4 , 0 ) ; o . write _shift ( - 4 , 460 ) ; o . write _shift ( 4 , 28800 ) ; o . write _shift ( 4 , 17600 ) ; o . write _shift ( 4 , 500 ) ; o . write _shift ( 4 , idx ) ; o . write _shift ( 4 , idx ) ; var flags = 120 ; o . write _shift ( 1 , flags ) ; return o . length > o . l ? o . slice ( 0 , o . l ) : o } function write _BOOKVIEWS ( ba , wb , opts ) { if ( ! wb . Workbook || ! wb . Workbook . Sheets ) return ; var sheets = wb . Workbook . Sheets ; var i = 0 , vistab = - 1 , hidden = - 1 ; for ( ; i < sheets . length ; ++ i ) { if ( ! sheets [ i ] || ! sheets [ i ] . Hidden && vistab == - 1 ) vistab = i ; else if ( sheets [ i ] . Hidden == 1 && hidden == - 1 ) hidden = i } if ( hidden > vistab ) return ; write _record ( ba , "BrtBeginBookViews" ) ; write _record ( ba , "BrtBookView" , write _BrtBookView ( vistab ) ) ; write _record ( ba , "BrtEndBookViews" ) } function write _BrtCalcProp ( data , o ) { if ( ! o ) o = new _buf ( 26 ) ; o . write _shift ( 4 , 0 ) ; o . write _shift ( 4 , 1 ) ; o . write _shift ( 4 , 0 ) ; write _Xnum ( 0 , o ) ; o . write _shift ( - 4 , 1023 ) ; o . write _shift ( 1 , 51 ) ; o . write _shift ( 1 , 0 ) ; return o } function write _BrtFileRecover ( data , o ) { if ( ! o ) o = new _buf ( 1 ) ; o . write _shift ( 1 , 0 ) ; return o } function write _wb _bin ( wb , opts ) { var ba = buf _array ( ) ; write _record ( ba , "BrtBeginBook" ) ; write _record ( ba , "BrtFileVersion" , write _BrtFileVersion ( ) ) ; write _record ( ba , "BrtWbProp" , write _BrtWbProp ( ) ) ; write _BOOKVIEWS ( ba , wb , opts ) ; write _BUNDLESHS ( ba , wb , opts ) ; write _record ( ba , "BrtEndBook" ) ; return ba . end ( ) } function parse _wb ( data , name , opts ) { if ( name . slice ( - 4 ) === ".bin" ) return parse _wb _bin ( data , opts ) ; return parse _wb _xml ( data , opts ) } function parse _ws ( data , name , opts , rels , wb , themes , styles ) { if ( name . slice ( - 4 ) === ".bin" ) return parse _ws _bin ( data , opts , rels , wb , themes , styles ) ; return parse _ws _xml ( data , opts , rels , wb , themes , styles ) } function parse _cs ( data , name , opts , rels , wb , themes , styles ) { if ( name . slice ( - 4 ) === ".bin" ) return parse _cs _bin ( data , opts , rels , wb , themes , styles ) ; return parse _cs _xml ( data , opts , rels , wb , themes , styles ) } function parse _ms ( data , name , opts , rels , wb , themes , styles ) { if ( name . slice ( - 4 ) === ".bin" ) return parse _ms _bin ( data , opts , rels , wb , themes , styles ) ; return parse _ms _xml ( data , opts , rels , wb , themes , styles ) } function parse _ds ( data , name , opts , rels , wb , themes , styles ) { if ( name . slice ( - 4 ) === ".bin" ) return parse _ds _bin ( data , opts , rels , wb , themes , styles ) ; return parse _ds _xml ( data , opts , rels , wb , themes , styles ) } function parse _sty ( data , name , themes , opts ) { if ( name . slice ( - 4 ) === ".bin" ) return parse _sty _bin ( data , themes , opts ) ; return parse _sty _xml ( data , themes , opts ) } function parse _theme ( data , name , opts ) { return parse _theme _xml ( data , opts ) } function parse _sst ( data , name , opts ) { if ( name . slice ( - 4 ) === ".bin" ) return parse _sst _bin ( data , opts ) ; return parse _sst _xml ( data , opts ) } function parse _cmnt ( data , name , opts ) { if ( name . slice ( - 4 ) === ".bin" ) return parse _comments _bin ( data , opts ) ; return parse _comments _xml ( data
if ( cell . c < range . s . c ) range . s . c = cell . c } if ( range . e ) { if ( cell . r + 1 > range . e . r ) range . e . r = cell . r + 1 ; if ( cell . c + 1 > range . e . c ) range . e . c = cell . c + 1 } if ( options . cellFormula && line . f ) { for ( var afi = 0 ; afi < array _formulae . length ; ++ afi ) { if ( array _formulae [ afi ] [ 0 ] . s . c > cell . c ) continue ; if ( array _formulae [ afi ] [ 0 ] . s . r > cell . r ) continue ; if ( array _formulae [ afi ] [ 0 ] . e . c < cell . c ) continue ; if ( array _formulae [ afi ] [ 0 ] . e . r < cell . r ) continue ; line . F = encode _range ( array _formulae [ afi ] [ 0 ] ) ; if ( array _formulae [ afi ] [ 0 ] . s . c != cell . c ) delete line . f ; if ( array _formulae [ afi ] [ 0 ] . s . r != cell . r ) delete line . f ; if ( line . f ) line . f = "" + stringify _formula ( array _formulae [ afi ] [ 1 ] , range , cell , supbooks , opts ) ; break } } if ( options . sheetRows && lastcell . r >= options . sheetRows ) cell _valid = false ; else { if ( options . dense ) { if ( ! out [ cell . r ] ) out [ cell . r ] = [ ] ; out [ cell . r ] [ cell . c ] = line } else out [ last _cell ] = line } } ; var opts = { enc : false , sbcch : 0 , snames : [ ] , sharedf : shared _formulae , arrayf : array _formulae , rrtabid : [ ] , lastuser : "" , biff : 8 , codepage : 0 , winlocked : 0 , cellStyles : ! ! options && ! ! options . cellStyles , WTF : ! ! options && ! ! options . wtf } ; if ( options . password ) opts . password = options . password ; var mergecells = [ ] ; var objects = [ ] ; var colinfo = [ ] , rowinfo = [ ] ; var defwidth = 0 , defheight = 0 ; var seencol = false ; var supbooks = [ ] ; supbooks . SheetNames = opts . snames ; supbooks . sharedf = opts . sharedf ; supbooks . arrayf = opts . arrayf ; supbooks . names = [ ] ; supbooks . XTI = [ ] ; var last _Rn = "" ; var file _depth = 0 ; var BIFF2Fmt = 0 ; var FilterDatabases = [ ] ; var last _lbl ; opts . codepage = 1200 ; set _cp ( 1200 ) ; while ( blob . l < blob . length - 1 ) { var s = blob . l ; var RecordType = blob . read _shift ( 2 ) ; if ( RecordType === 0 && last _Rn === "EOF" ) break ; var length = blob . l === blob . length ? 0 : blob . read _shift ( 2 ) , y ; var R = XLSRecordEnum [ RecordType ] ; if ( R && R . f ) { if ( options . bookSheets ) { if ( last _Rn === "BoundSheet8" && R . n !== "BoundSheet8" ) break } last _Rn = R . n ; if ( R . r === 2 || R . r == 12 ) { var rt = blob . read _shift ( 2 ) ; length -= 2 ; if ( ! opts . enc && rt !== RecordType ) throw "rt mismatch" ; if ( R . r == 12 ) { blob . l += 10 ; length -= 10 } } var val ; if ( R . n === "EOF" ) val = R . f ( blob , length , opts ) ; else val = slurp ( R , blob , length , opts ) ; var Rn = R . n ; switch ( Rn ) { case "Date1904" : wb . opts . Date1904 = val ; break ; case "WriteProtect" : wb . opts . WriteProtect = true ; break ; case "FilePass" : if ( ! opts . enc ) blob . l = 0 ; opts . enc = val ; if ( opts . WTF ) console . error ( val ) ; if ( ! options . password ) throw new Error ( "File is password-protected" ) ; if ( val . Type !== 0 ) throw new Error ( "Encryption scheme unsupported" ) ; if ( ! val . valid ) throw new Error ( "Password is incorrect" ) ; break ; case "WriteAccess" : opts . lastuser = val ; break ; case "FileSharing" : break ; case "CodePage" : if ( val === 21010 ) val = 1200 ; else if ( val === 32769 ) val = 1252 ; opts . codepage = val ; set _cp ( val ) ; break ; case "RRTabId" : opts . rrtabid = val ; break ; case "WinProtect" : opts . winlocked = val ; break ; case "Template" : break ; case "RefreshAll" : wb . opts . RefreshAll = val ; break ; case "BookBool" : break ; case "UsesELFs" : break ; case "MTRSettings" : break ; case "CalcCount" : wb . opts . CalcCount = val ; break ; case "CalcDelta" : wb . opts . CalcDelta = val ; break ; case "CalcIter" : wb . opts . CalcIter = val ; break ; case "CalcMode" : wb . opts . CalcMode = val ; break ; case "CalcPrecision" : wb . opts . CalcPrecision = val ; break ; case "CalcSaveRecalc" : wb . opts . CalcSaveRecalc = val ; break ; case "CalcRefMode" : opts . CalcRefMode = val ; break ; case "Uncalced" : break ; case "ForceFullCalculation" : wb . opts . FullCalc = val ; break ; case "WsBool" : break ; case "XF" : XFs . push ( val ) ; break ; case "ExtSST" : break ; case "BookExt" : break ; case "RichTextStream" : break ; case "BkHim" : break ; case "SupBook" : supbooks . push ( [ val ] ) ; supbooks [ supbooks . length - 1 ] . XTI = [ ] ; break ; case "ExternName" : supbooks [ supbooks . length - 1 ] . push ( val ) ; break ; case "Index" : break ; case "Lbl" : last _lbl = { Name : val . Name , Ref : stringify _formula ( val . rgce , range , null , supbooks , opts ) } ; if ( val . itab > 0 ) last _lbl . Sheet = val . itab - 1 ; supbooks . names . push ( last _lbl ) ; if ( ! supbooks [ 0 ] ) supbooks [ 0 ] = [ ] ; supbooks [ supbooks . length - 1 ] . push ( val ) ; if ( val . Name == "\r" && val . itab > 0 ) if ( val . rgce && val . rgce [ 0 ] && val . rgce [ 0 ] [ 0 ] && val . rgce [ 0 ] [ 0 ] [ 0 ] == "PtgArea3d" ) FilterDatabases [ val . itab - 1 ] = { ref : encode _range ( val . rgce [ 0 ] [ 0 ] [ 1 ] [ 2 ] ) } ; break ; case "ExternSheet" : if ( supbooks . length == 0 ) { supbooks [ 0 ] = [ ] ; supbooks [ 0 ] . XTI = [ ] } supbooks [ supbooks . length - 1 ] . XTI = supbooks [ supbooks . length - 1 ] . XTI . concat ( val ) ; supbooks . XTI = supbooks . XTI . concat ( val ) ; break ; case "NameCmt" : if ( opts . biff < 8 ) break ; last _lbl . Comment = val [ 1 ] ; break ; case " Protec
461 : { n : "BrtBeginConditionalFormatting" , f : parsenoop } , 462 : { n : "BrtEndConditionalFormatting" , f : parsenoop } , 463 : { n : "BrtBeginCFRule" , f : parsenoop } , 464 : { n : "BrtEndCFRule" , f : parsenoop } , 465 : { n : "BrtBeginIconSet" , f : parsenoop } , 466 : { n : "BrtEndIconSet" , f : parsenoop } , 467 : { n : "BrtBeginDatabar" , f : parsenoop } , 468 : { n : "BrtEndDatabar" , f : parsenoop } , 469 : { n : "BrtBeginColorScale" , f : parsenoop } , 470 : { n : "BrtEndColorScale" , f : parsenoop } , 471 : { n : "BrtCFVO" , f : parsenoop } , 472 : { n : "BrtExternValueMeta" , f : parsenoop } , 473 : { n : "BrtBeginColorPalette" , f : parsenoop } , 474 : { n : "BrtEndColorPalette" , f : parsenoop } , 475 : { n : "BrtIndexedColor" , f : parsenoop } , 476 : { n : "BrtMargins" , f : parse _BrtMargins } , 477 : { n : "BrtPrintOptions" , f : parsenoop } , 478 : { n : "BrtPageSetup" , f : parsenoop } , 479 : { n : "BrtBeginHeaderFooter" , f : parsenoop } , 480 : { n : "BrtEndHeaderFooter" , f : parsenoop } , 481 : { n : "BrtBeginSXCrtFormat" , f : parsenoop } , 482 : { n : "BrtEndSXCrtFormat" , f : parsenoop } , 483 : { n : "BrtBeginSXCrtFormats" , f : parsenoop } , 484 : { n : "BrtEndSXCrtFormats" , f : parsenoop } , 485 : { n : "BrtWsFmtInfo" , f : parsenoop } , 486 : { n : "BrtBeginMgs" , f : parsenoop } , 487 : { n : "BrtEndMGs" , f : parsenoop } , 488 : { n : "BrtBeginMGMaps" , f : parsenoop } , 489 : { n : "BrtEndMGMaps" , f : parsenoop } , 490 : { n : "BrtBeginMG" , f : parsenoop } , 491 : { n : "BrtEndMG" , f : parsenoop } , 492 : { n : "BrtBeginMap" , f : parsenoop } , 493 : { n : "BrtEndMap" , f : parsenoop } , 494 : { n : "BrtHLink" , f : parse _BrtHLink } , 495 : { n : "BrtBeginDCon" , f : parsenoop } , 496 : { n : "BrtEndDCon" , f : parsenoop } , 497 : { n : "BrtBeginDRefs" , f : parsenoop } , 498 : { n : "BrtEndDRefs" , f : parsenoop } , 499 : { n : "BrtDRef" , f : parsenoop } , 500 : { n : "BrtBeginScenMan" , f : parsenoop } , 501 : { n : "BrtEndScenMan" , f : parsenoop } , 502 : { n : "BrtBeginSct" , f : parsenoop } , 503 : { n : "BrtEndSct" , f : parsenoop } , 504 : { n : "BrtSlc" , f : parsenoop } , 505 : { n : "BrtBeginDXFs" , f : parsenoop } , 506 : { n : "BrtEndDXFs" , f : parsenoop } , 507 : { n : "BrtDXF" , f : parsenoop } , 508 : { n : "BrtBeginTableStyles" , f : parsenoop } , 509 : { n : "BrtEndTableStyles" , f : parsenoop } , 510 : { n : "BrtBeginTableStyle" , f : parsenoop } , 511 : { n : "BrtEndTableStyle" , f : parsenoop } , 512 : { n : "BrtTableStyleElement" , f : parsenoop } , 513 : { n : "BrtTableStyleClient" , f : parsenoop } , 514 : { n : "BrtBeginVolDeps" , f : parsenoop } , 515 : { n : "BrtEndVolDeps" , f : parsenoop } , 516 : { n : "BrtBeginVolType" , f : parsenoop } , 517 : { n : "BrtEndVolType" , f : parsenoop } , 518 : { n : "BrtBeginVolMain" , f : parsenoop } , 519 : { n : "BrtEndVolMain" , f : parsenoop } , 520 : { n : "BrtBeginVolTopic" , f : parsenoop } , 521 : { n : "BrtEndVolTopic" , f : parsenoop } , 522 : { n : "BrtVolSubtopic" , f : parsenoop } , 523 : { n : "BrtVolRef" , f : parsenoop } , 524 : { n : "BrtVolNum" , f : parsenoop } , 525 : { n : "BrtVolErr" , f : parsenoop } , 526 : { n : "BrtVolStr" , f : parsenoop } , 527 : { n : "BrtVolBool" , f : parsenoop } , 528 : { n : "BrtBeginCalcChain$" , f : parsenoop } , 529 : { n : "BrtEndCalcChain$" , f : parsenoop } , 530 : { n : "BrtBeginSortState" , f : parsenoop } , 531 : { n : "BrtEndSortState" , f : parsenoop } , 532 : { n : "BrtBeginSortCond" , f : parsenoop } , 533 : { n : "BrtEndSortCond" , f : parsenoop } , 534 : { n : "BrtBookProtection" , f : parsenoop } , 535 : { n : "BrtSheetProtection" , f : parsenoop } , 536 : { n : "BrtRangeProtection" , f : parsenoop } , 537 : { n : "BrtPhoneticInfo" , f : parsenoop } , 538 : { n : "BrtBeginECTxtWiz" , f : parsenoop } , 539 : { n : "BrtEndECTxtWiz" , f : parsenoop } , 540 : { n : "BrtBeginECTWFldInfoLst" , f : parsenoop } , 541 : { n : "BrtEndECTWFldInfoLst" , f : parsenoop } , 542 : { n : "BrtBeginECTwFldInfo" , f : parsenoop } , 548 : { n : "BrtFileSharing" , f : parsenoop } , 549 : { n : "BrtOleSize" , f : parsenoop } , 550 : { n : "BrtDrawing" , f : parse _RelID } , 551 : { n : "BrtLegacyDrawing" , f : parsenoop } , 552 : { n : "BrtLegacyDrawingHF" , f : parsenoop } , 553 : { n : "BrtWebOpt" , f : parsenoop } , 554 : { n : "BrtBeginWebPubItems" , f : parsenoop } , 555 : { n : "BrtEndWebPubItems" , f : parsenoop } , 556 : { n : "BrtBeginWebPubItem" , f : parsenoop } , 557 : { n : "BrtEndWebPubItem" , f : parsenoop } , 558 : { n : "BrtBeginSXCondFmt" , f : parsenoop } , 559 : { n : "BrtEndSXCondFmt" , f : parsenoop } , 560 : { n : "BrtBeginSXCondFmts" , f : parsenoop } , 561 : { n : "BrtEndSXCondFmts" , f : parsenoop } , 562 : { n : "BrtBkHim" , f : parsenoop } , 564 : { n : "BrtColor" , f : parsenoop } , 565 : { n : "BrtBeginIndexedColors" , f : parsenoop } , 566 : { n : "BrtEndIndexedColors" , f : parsenoop } , 569 : { n : "BrtBeginMRUColors" , f : parsenoop } , 570 : { n : "BrtEndMRUColors" , f : parsenoop } , 572 : { n : "BrtMRUColor" , f : parsenoop } , 573 : { n : "BrtBeginDVals" , f : parsenoop } , 574 : { n : "BrtEndDVals" , f : parsenoop } , 577 : { n : "BrtSupNameStart" , f : parsenoop } , 578 : { n : "BrtSupNameValueStart" , f : parsenoop } , 579 : { n : "BrtSupNameValueEnd" , f : parsenoop } , 580 : { n : "BrtSupNameNum" , f : parseno
} , 2247 : { n : "FMSQry" , f : parsenoop } , 2248 : { n : "PLV" , f : parsenoop } , 2249 : { n : "LnExt" , f : parsenoop } , 2250 : { n : "MkrExt" , f : parsenoop } , 2251 : { n : "CrtCoopt" , f : parsenoop } , 67 : { n : "BIFF2XF" , f : parsenoop } , 579 : { n : "BIFF3XF" , f : parsenoop } , 1091 : { n : "BIFF4XF" , f : parsenoop } , 29282 : { } } ; function write _biff _rec ( ba , t , payload , length ) { var len = length || ( payload || [ ] ) . length ; var o = ba . next ( 4 + len ) ; o . write _shift ( 2 , t ) ; o . write _shift ( 2 , len ) ; if ( len > 0 && is _buf ( payload ) ) ba . push ( payload ) } function write _BOF ( wb , o ) { if ( o . bookType != "biff2" ) throw "unsupported BIFF version" ; var out = new _buf ( 4 ) ; out . write _shift ( 2 , 2 ) ; out . write _shift ( 2 , 16 ) ; return out } function write _BIFF2Cell ( out , r , c ) { if ( ! out ) out = new _buf ( 7 ) ; out . write _shift ( 2 , r ) ; out . write _shift ( 2 , c ) ; out . write _shift ( 1 , 0 ) ; out . write _shift ( 1 , 0 ) ; out . write _shift ( 1 , 0 ) ; return out } function write _BIFF2INT ( r , c , val ) { var out = new _buf ( 9 ) ; write _BIFF2Cell ( out , r , c ) ; out . write _shift ( 2 , val ) ; return out } function write _BIFF2NUMBER ( r , c , val ) { var out = new _buf ( 15 ) ; write _BIFF2Cell ( out , r , c ) ; out . write _shift ( 8 , val , "f" ) ; return out } function write _BIFF2BERR ( r , c , val , t ) { var out = new _buf ( 9 ) ; write _BIFF2Cell ( out , r , c ) ; if ( t == "e" ) { out . write _shift ( 1 , val ) ; out . write _shift ( 1 , 1 ) } else { out . write _shift ( 1 , val ? 1 : 0 ) ; out . write _shift ( 1 , 0 ) } return out } function write _BIFF2LABEL ( r , c , val ) { var out = new _buf ( 8 + 2 * val . length ) ; write _BIFF2Cell ( out , r , c ) ; out . write _shift ( 1 , val . length ) ; out . write _shift ( val . length , val , "sbcs" ) ; return out . l < out . length ? out . slice ( 0 , out . l ) : out } function write _ws _biff _cell ( ba , cell , R , C , opts ) { if ( cell . v != null ) switch ( cell . t ) { case "d" : case "n" : var v = cell . t == "d" ? datenum ( cell . v ) : cell . v ; if ( v == ( v | 0 ) && v >= 0 && v < 65536 ) write _biff _rec ( ba , 2 , write _BIFF2INT ( R , C , v ) ) ; else write _biff _rec ( ba , 3 , write _BIFF2NUMBER ( R , C , v ) ) ; return ; case "b" : case "e" : write _biff _rec ( ba , 5 , write _BIFF2BERR ( R , C , cell . v , cell . t ) ) ; return ; case "s" : case "str" : write _biff _rec ( ba , 4 , write _BIFF2LABEL ( R , C , cell . v ) ) ; return } write _biff _rec ( ba , 1 , write _BIFF2Cell ( null , R , C ) ) } function write _biff _ws ( ba , ws , idx , opts , wb ) { var dense = Array . isArray ( ws ) ; var range = safe _decode _range ( ws [ "!ref" ] || "A1" ) , ref , rr = "" , cols = [ ] ; for ( var R = range . s . r ; R <= range . e . r ; ++ R ) { rr = encode _row ( R ) ; for ( var C = range . s . c ; C <= range . e . c ; ++ C ) { if ( R === range . s . r ) cols [ C ] = encode _col ( C ) ; ref = cols [ C ] + rr ; var cell = dense ? ws [ R ] [ C ] : ws [ ref ] ; if ( ! cell ) continue ; write _ws _biff _cell ( ba , cell , R , C , opts ) } } } function write _biff _buf ( wb , opts ) { var o = opts || { } ; if ( DENSE != null && o . dense == null ) o . dense = DENSE ; var ba = buf _array ( ) ; 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 ) ; write _biff _rec ( ba , 9 , write _BOF ( wb , o ) ) ; write _biff _ws ( ba , wb . Sheets [ wb . SheetNames [ idx ] ] , idx , o , wb ) ; write _biff _rec ( ba , 10 ) ; return ba . end ( ) } var HTML _ = function ( ) { function html _to _sheet ( str , _opts ) { var opts = _opts || { } ; if ( DENSE != null && opts . dense == null ) opts . dense = DENSE ; var ws = opts . dense ? [ ] : { } ; var i = str . indexOf ( "<table" ) , j = str . indexOf ( "</table" ) ; if ( i == - 1 || j == - 1 ) throw new Error ( "Invalid HTML: missing <table> / </table> pair" ) ; var rows = str . slice ( i , j ) . split ( /(:?<tr[^>]*>)/ ) ; var R = - 1 , C = 0 , RS = 0 , CS = 0 ; var range = { s : { r : 1e7 , c : 1e7 } , e : { r : 0 , c : 0 } } ; var merges = [ ] , midx = 0 ; for ( i = 0 ; i < rows . length ; ++ i ) { var row = rows [ i ] . trim ( ) ; if ( row . substr ( 0 , 3 ) == "<tr" ) { ++ R ; C = 0 ; continue } if ( row . substr ( 0 , 3 ) != "<td" ) continue ; var cells = row . split ( "</td>" ) ; for ( j = 0 ; j < cells . length ; ++ j ) { var cell = cells [ j ] . trim ( ) ; if ( cell . substr ( 0 , 3 ) != "<td" ) continue ; var m = cell , cc = 0 ; while ( m . charAt ( 0 ) == "<" && ( cc = m . indexOf ( ">" ) ) > - 1 ) m = m . slice ( cc + 1 ) ; while ( m . indexOf ( ">" ) > - 1 ) m = m . slice ( 0 , m . lastIndexOf ( "<" ) ) ; var tag = parsexmltag ( cell . slice ( 0 , cell . indexOf ( ">" ) ) ) ; CS = tag . colspan ? + tag . colspan : 1 ; if ( ( RS = + tag . rowspan ) > 0 || CS > 1 ) merges . push ( { s : { r : R , c : C } , e : { r : R + ( RS || 1 ) - 1 , c : C + CS - 1 } } ) ; if ( ! m . length ) { C += CS ; continue } m = unescapexml ( m ) . replace ( /[\r\n]/g , "" ) ; if ( range . s . r > R ) range . s . r = R ; if ( range . e . r < R ) range . e . r = R ; if ( range . s . c > C ) range . s . c = C ; if ( range . e . c < C ) range . e . c = C ; if ( opts . dense ) { if ( ! ws [ R ] ) ws [ R ] = [ ] ; if ( Number ( m ) == Number ( m ) ) ws [ R ] [ C ] = { t : "n" , v : + m } ; else ws [ R ] [ C ] = { t : "s" , v : m } } else { var coord = encode _cell ( { r : R , c : C } ) ; if ( Number ( m ) == Number ( m ) ) ws [ coord ] = { t : "n" , v : + m } ; else ws [ coord ] = { t : "s" , v : m } } C += CS } } ws [ "!ref" ] = encode _range ( range ) ; return ws } function html _to _book ( str , opts ) { return s
f = "xl/styles." + wbext ; zip . file ( f , write _sty ( wb , f , opts ) ) ; ct . styles . push ( f ) ; add _rels ( opts . wbrels , - 1 , "styles." + wbext , RELS . STY ) ; if ( wb . vbaraw && vbafmt ) { f = "xl/vbaProject.bin" ; zip . file ( f , wb . vbaraw ) ; ct . vba . push ( f ) ; add _rels ( opts . wbrels , - 1 , "vbaProject.bin" , RELS . VBA ) } zip . file ( "[Content_Types].xml" , write _ct ( ct , opts ) ) ; zip . file ( "_rels/.rels" , write _rels ( opts . rels ) ) ; zip . file ( "xl/_rels/workbook." + wbext + ".rels" , write _rels ( opts . wbrels ) ) ; return zip } function firstbyte ( f , o ) { var x = "" ; switch ( ( o || { } ) . type || "base64" ) { case "buffer" : return [ f [ 0 ] , f [ 1 ] , f [ 2 ] , f [ 3 ] ] ; case "base64" : x = Base64 . decode ( f . substr ( 0 , 24 ) ) ; break ; case "binary" : x = f ; break ; case "array" : return [ f [ 0 ] , f [ 1 ] , f [ 2 ] , f [ 3 ] ] ; default : throw new Error ( "Unrecognized type " + ( o ? o . type : "undefined" ) ) } return [ x . charCodeAt ( 0 ) , x . charCodeAt ( 1 ) , x . charCodeAt ( 2 ) , x . charCodeAt ( 3 ) ] } function read _cfb ( cfb , opts ) { if ( cfb . find ( "EncryptedPackage" ) ) return parse _xlsxcfb ( cfb , opts ) ; return parse _xlscfb ( cfb , opts ) } function read _zip ( data , opts ) { var zip , d = data ; var o = opts || { } ; if ( ! o . type ) o . type = has _buf && Buffer . isBuffer ( data ) ? "buffer" : "base64" ; switch ( o . type ) { case "base64" : zip = new jszip ( d , { base64 : true } ) ; break ; case "binary" : case "array" : zip = new jszip ( d , { base64 : false } ) ; break ; case "buffer" : zip = new jszip ( d ) ; break ; default : throw new Error ( "Unrecognized type " + o . type ) } return parse _zip ( zip , o ) } function read _utf16 ( data , o ) { var d = data ; if ( o . type == "base64" ) d = Base64 . decode ( d ) ; d = cptable . utils . decode ( 1200 , d . slice ( 2 ) ) ; o . type = "binary" ; if ( d . charCodeAt ( 0 ) == 60 ) return parse _xlml ( d , o ) ; return PRN . to _workbook ( d , o ) } function readSync ( data , opts ) { var zip , d = data , n = [ 0 ] ; var o = opts || { } ; if ( ! o . type ) o . type = has _buf && Buffer . isBuffer ( data ) ? "buffer" : "base64" ; if ( o . type == "file" ) { o . type = "buffer" ; d = _fs . readFileSync ( data ) } switch ( ( n = firstbyte ( d , o ) ) [ 0 ] ) { case 208 : return read _cfb ( CFB . read ( d , o ) , o ) ; case 9 : return parse _xlscfb ( s2a ( o . type === "base64" ? Base64 . decode ( d ) : d ) , o ) ; case 60 : return parse _xlml ( d , o ) ; case 73 : if ( n [ 1 ] == 68 ) return SYLK . to _workbook ( d , o ) ; break ; case 84 : if ( n [ 1 ] == 65 && n [ 2 ] == 66 && n [ 3 ] == 76 ) return DIF . to _workbook ( d , o ) ; break ; case 80 : if ( n [ 1 ] == 75 && n [ 2 ] < 32 && n [ 3 ] < 32 ) return read _zip ( d , o ) ; break ; case 239 : return parse _xlml ( d , o ) ; case 255 : if ( n [ 1 ] == 254 ) { return read _utf16 ( d , o ) } break ; case 0 : if ( n [ 1 ] == 0 && n [ 2 ] >= 2 && n [ 3 ] == 0 ) return WK _ . to _workbook ( d , o ) ; break ; case 3 : case 131 : case 139 : return DBF . to _workbook ( d , o ) } if ( n [ 2 ] <= 12 && n [ 3 ] <= 31 ) return DBF . to _workbook ( d , o ) ; if ( 32 > n [ 0 ] || n [ 0 ] > 127 ) throw new Error ( "Unsupported file " + n . join ( "|" ) ) ; return PRN . to _workbook ( d , o ) } function readFileSync ( filename , opts ) { var o = opts || { } ; o . type = "file" ; return readSync ( filename , o ) } function write _zip _type ( wb , opts ) { var o = opts || { } ; var z = write _zip ( wb , o ) ; var oopts = { } ; if ( o . compression ) oopts . compression = "DEFLATE" ; switch ( o . type ) { case "base64" : oopts . type = "base64" ; break ; case "binary" : oopts . type = "string" ; break ; case "buffer" : case "file" : oopts . type = "nodebuffer" ; break ; default : throw new Error ( "Unrecognized type " + o . type ) } if ( o . type === "file" ) return _fs . writeFileSync ( o . file , z . generate ( oopts ) ) ; return z . generate ( oopts ) } function write _bstr _type ( out , opts ) { switch ( opts . type ) { case "base64" : return Base64 . encode ( out ) ; case "binary" : return out ; case "file" : return _fs . writeFileSync ( opts . file , out , "binary" ) ; case "buffer" : { if ( has _buf ) return new Buffer ( out , "utf8" ) ; else return out . split ( "" ) . map ( function ( c ) { return c . charCodeAt ( 0 ) } ) } } throw new Error ( "Unrecognized type " + opts . type ) } function write _string _type ( out , opts ) { switch ( opts . type ) { case "base64" : return Base64 . encode ( out ) ; case "binary" : return out ; case "file" : return _fs . writeFileSync ( opts . file , out , "utf8" ) ; case "buffer" : { if ( has _buf ) return new Buffer ( out , "utf8" ) ; else return out . split ( "" ) . map ( function ( c ) { return c . charCodeAt ( 0 ) } ) } } throw new Error ( "Unrecognized type " + opts . type ) } function write _binary _type ( out , opts ) { switch ( opts . type ) { case "base64" : case "binary" : var bstr = "" ; for ( var i = 0 ; i < out . length ; ++ i ) bstr += String . fromCharCode ( out [ i ] ) ; return opts . type == "base64" ? Base64 . encode ( bstr ) : bstr ; case "file" : return _fs . writeFileSync ( opts . file , out ) ; case "buffer" : return out ; default : throw new Error ( "Unrecognized type " + opts . type ) } } function writeSync ( wb , opts ) { check _wb ( wb ) ; var o = opts || { } ; switch ( o . bookType || "xlsb" ) { case "xml" : case "xlml" : return write _string _type ( write _xlml ( wb