2016-12-31 08:20:45 +00:00
/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
2017-06-10 01:47:42 +00:00
var XLSX = { } ; ( function make _xlsx ( XLSX ) { XLSX . version = "0.10.5" ; var current _codepage = 1200 ; if ( typeof module !== "undefined" && typeof require !== "undefined" ) { if ( typeof cptable === "undefined" ) global . cptable = require ( "./dist/cpexcel.js" ) } function reset _cp ( ) { set _cp ( 1200 ) } var set _cp = function ( cp ) { current _codepage = cp } ; function char _codes ( data ) { var o = [ ] ; for ( var i = 0 , len = data . length ; i < len ; ++ i ) o [ i ] = data . charCodeAt ( i ) ; return o } var debom = function ( data ) { var c1 = data . charCodeAt ( 0 ) , c2 = data . charCodeAt ( 1 ) ; if ( c1 == 255 && c2 == 254 ) return data . substr ( 2 ) ; if ( c1 == 254 && c2 == 255 ) return data . substr ( 2 ) ; if ( c1 == 65279 ) return data . substr ( 1 ) ; return data } ; var _getchar = function _gc1 ( x ) { return String . fromCharCode ( x ) } ; if ( typeof cptable !== "undefined" ) { set _cp = function ( cp ) { current _codepage = cp } ; debom = function ( data ) { if ( data . charCodeAt ( 0 ) === 255 && data . charCodeAt ( 1 ) === 254 ) { return cptable . utils . decode ( 1200 , char _codes ( data . substr ( 2 ) ) ) } return data } ; _getchar = function _gc2 ( x ) { if ( current _codepage === 1200 ) return String . fromCharCode ( x ) ; return cptable . utils . decode ( current _codepage , [ x & 255 , x >> 8 ] ) [ 0 ] } } var DENSE = null ; var DIF _XL = true ; var Base64 = function make _b64 ( ) { var map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" ; return { encode : function ( input ) { var o = "" ; var c1 , c2 , c3 , e1 , e2 , e3 , e4 ; for ( var i = 0 ; i < input . length ; ) { c1 = input . charCodeAt ( i ++ ) ; c2 = input . charCodeAt ( i ++ ) ; c3 = input . charCodeAt ( i ++ ) ; e1 = c1 >> 2 ; e2 = ( c1 & 3 ) << 4 | c2 >> 4 ; e3 = ( c2 & 15 ) << 2 | c3 >> 6 ; e4 = c3 & 63 ; if ( isNaN ( c2 ) ) { e3 = e4 = 64 } else if ( isNaN ( c3 ) ) { e4 = 64 } o += map . charAt ( e1 ) + map . charAt ( e2 ) + map . charAt ( e3 ) + map . charAt ( e4 ) } return o } , decode : function b64 _decode ( input ) { var o = "" ; var c1 , c2 , c3 ; var e1 , e2 , e3 , e4 ; input = input . replace ( /[^A-Za-z0-9\+\/\=]/g , "" ) ; for ( var i = 0 ; i < input . length ; ) { e1 = map . indexOf ( input . charAt ( i ++ ) ) ; e2 = map . indexOf ( input . charAt ( i ++ ) ) ; e3 = map . indexOf ( input . charAt ( i ++ ) ) ; e4 = map . indexOf ( input . charAt ( i ++ ) ) ; c1 = e1 << 2 | e2 >> 4 ; c2 = ( e2 & 15 ) << 4 | e3 >> 2 ; c3 = ( e3 & 3 ) << 6 | e4 ; o += String . fromCharCode ( c1 ) ; if ( e3 != 64 ) { o += String . fromCharCode ( c2 ) } if ( e4 != 64 ) { o += String . fromCharCode ( c3 ) } } return o } } } ( ) ; var has _buf = typeof Buffer !== "undefined" && typeof process !== "undefined" && typeof process . versions !== "undefined" && process . versions . node ; function new _raw _buf ( len ) { return new ( has _buf ? Buffer : Array ) ( len ) } function s2a ( s ) { if ( has _buf ) return new Buffer ( s , "binary" ) ; return s . split ( "" ) . map ( function ( x ) { return x . charCodeAt ( 0 ) & 255 } ) } var bconcat = function ( bufs ) { return [ ] . concat . apply ( [ ] , bufs ) } ; var chr0 = /\u0000/g , chr1 = /[\u0001-\u0006]/ ; var SSF = { } ; var make _ssf = function make _ssf ( SSF ) { SSF . version = "0.9.4" ; function _strrev ( x ) { var o = "" , i = x . length - 1 ; while ( i >= 0 ) o += x . charAt ( i -- ) ; return o } function fill ( c , l ) { var o = "" ; while ( o . length < l ) o += c ; return o } function pad0 ( v , d ) { var t = "" + v ; return t . length >= d ? t : fill ( "0" , d - t . length ) + t } function pad _ ( v , d ) { var t = "" + v ; return t . length >= d ? t : fill ( " " , d - t . length ) + t } function rpad _ ( v , d ) { var t = "" + v ; return t . length >= d ? t : t + fill ( " " , d - t . length ) } function pad0r1 ( v , d ) { var t = "" + Math . round ( v ) ; return t . length >= d ? t : fill ( "0" , d - t . length ) + t } function pad0r2 ( v , d ) { var t = "" + v ; return t . length >= d ? t : fill ( "0" , d - t . length ) + t } var p2 _32 = Math . pow ( 2 , 32 ) ; function pad0r ( v , d ) { if ( v > p2 _32 || v < - p2 _32 ) return pad0r1 ( v , d ) ; var i = Math . round ( v ) ; return pad0r2 ( i , d ) } function isgeneral ( s , i ) { i = i || 0 ; return s . length >= 7 + i && ( s . charCodeAt ( i ) | 32 ) === 103 && ( s . charCodeAt ( i + 1 ) | 32 ) === 101 && ( s . charCodeAt ( i + 2 ) | 32 ) === 110 && ( s . charCodeAt ( i + 3 ) | 32 ) === 101 && ( s . charCodeAt ( i + 4 ) | 32 ) === 114 && ( s . charCodeAt ( i + 5 ) | 32 ) === 97 && ( s . charCodeAt ( i + 6 ) | 32 ) === 108 } var opts _fmt = [ [ "date1904" , 0 ] , [ "output" , "" ] , [ "WTF" , false ] ] ; function fixopts ( o ) { for ( var y = 0 ; y != opts _fmt . length ; ++ y ) if ( o [ opts _fmt [ y ] [ 0 ] ] === undefined ) o [ opts _fmt [ y ] [ 0 ] ] = opts _fmt [ y ] [ 1 ] } SSF . opts = opts _fmt ; var days = [ [ "Sun" , "Sunday" ] , [ "Mon" , "Monday" ] , [ "Tue" , "Tuesday" ] , [ "Wed" , "Wednesday" ] , [ "Thu" , "Thursday" ] , [ "Fri" , "Friday" ] , [ "Sat" , "Saturday" ] ] ; var months = [ [ "J" , "Jan" , "January" ] , [ "F" , "Feb" , "February" ] , [ "M" , "Mar" , "March" ] , [ "A" , "Apr" , "April" ] , [ "M" , "May" , "May" ] , [ "J" , "Jun" , "June" ] , [ "J" , "Jul" , "July" ] , [ "A" , "Aug" , "August" ] , [ "S" , "Sep" , "September" ] , [ "O" , "Oct" , "October" ] , [ "N" , "Nov" , "November" ] , [ "D" , "Dec" , "December" ] ] ; function init _table ( t ) { t [ 0 ] = "General" ; t [ 1 ] = "0" ; t [ 2 ] = "0.00" ; t [ 3 ] = "#,##0" ; t [ 4 ] = "#,##0.00" ; t [ 9 ] = "0%" ; t [ 10 ] = "0.00%" ; t [ 11 ] = " 0
nmfs = blob . read _shift ( 4 , "i" ) ; difat _start = blob . read _shift ( 4 , "i" ) ; ndfs = blob . read _shift ( 4 , "i" ) ; for ( var q , j = 0 ; j < 109 ; ++ j ) { q = blob . read _shift ( 4 , "i" ) ; if ( q < 0 ) break ; fat _addrs [ j ] = q } var sectors = sectorify ( file , ssz ) ; sleuth _fat ( difat _start , ndfs , sectors , ssz , fat _addrs ) ; var sector _list = make _sector _list ( sectors , dir _start , fat _addrs , ssz ) ; sector _list [ dir _start ] . name = "!Directory" ; if ( nmfs > 0 && minifat _start !== ENDOFCHAIN ) sector _list [ minifat _start ] . name = "!MiniFAT" ; sector _list [ fat _addrs [ 0 ] ] . name = "!FAT" ; sector _list . fat _addrs = fat _addrs ; sector _list . ssz = ssz ; var files = { } , Paths = [ ] , FileIndex = [ ] , FullPaths = [ ] , FullPathDir = { } ; read _directory ( dir _start , sector _list , sectors , Paths , nmfs , files , FileIndex ) ; build _full _paths ( FileIndex , FullPathDir , FullPaths , Paths ) ; var root _name = Paths . shift ( ) ; Paths . root = root _name ; var find _path = make _find _path ( FullPaths , Paths , FileIndex , files , root _name ) ; return { raw : { header : header , sectors : sectors } , FileIndex : FileIndex , FullPaths : FullPaths , FullPathDir : FullPathDir , find : find _path } } function check _get _mver ( blob ) { blob . chk ( HEADER _SIGNATURE , "Header Signature: " ) ; blob . chk ( HEADER _CLSID , "CLSID: " ) ; var mver = blob . read _shift ( 2 , "u" ) ; return [ blob . read _shift ( 2 , "u" ) , mver ] } function check _shifts ( blob , mver ) { var shift = 9 ; blob . l += 2 ; switch ( shift = blob . read _shift ( 2 ) ) { case 9 : if ( mver != 3 ) throw new Error ( "Sector Shift: Expected 9 saw " + shift ) ; break ; case 12 : if ( mver != 4 ) throw new Error ( "Sector Shift: Expected 12 saw " + shift ) ; break ; default : throw new Error ( "Sector Shift: Expected 9 or 12 saw " + shift ) ; } blob . chk ( "0600" , "Mini Sector Shift: " ) ; blob . chk ( "000000000000" , "Reserved: " ) } function sectorify ( file , ssz ) { var nsectors = Math . ceil ( file . length / ssz ) - 1 ; var sectors = new Array ( nsectors ) ; for ( var i = 1 ; i < nsectors ; ++ i ) sectors [ i - 1 ] = file . slice ( i * ssz , ( i + 1 ) * ssz ) ; sectors [ nsectors - 1 ] = file . slice ( nsectors * ssz ) ; return sectors } function build _full _paths ( FI , FPD , FP , Paths ) { var i = 0 , L = 0 , R = 0 , C = 0 , j = 0 , pl = Paths . length ; var dad = new Array ( pl ) , q = new Array ( pl ) ; for ( ; i < pl ; ++ i ) { dad [ i ] = q [ i ] = i ; FP [ i ] = Paths [ i ] } for ( ; j < q . length ; ++ j ) { i = q [ j ] ; L = FI [ i ] . L ; R = FI [ i ] . R ; C = FI [ i ] . C ; if ( dad [ i ] === i ) { if ( L !== - 1 && dad [ L ] !== L ) dad [ i ] = dad [ L ] ; if ( R !== - 1 && dad [ R ] !== R ) dad [ i ] = dad [ R ] } if ( C !== - 1 ) dad [ C ] = i ; if ( L !== - 1 ) { dad [ L ] = dad [ i ] ; q . push ( L ) } if ( R !== - 1 ) { dad [ R ] = dad [ i ] ; q . push ( R ) } } for ( i = 1 ; i !== pl ; ++ i ) if ( dad [ i ] === i ) { if ( R !== - 1 && dad [ R ] !== R ) dad [ i ] = dad [ R ] ; else if ( L !== - 1 && dad [ L ] !== L ) dad [ i ] = dad [ L ] } for ( i = 1 ; i < pl ; ++ i ) { if ( FI [ i ] . type === 0 ) continue ; j = dad [ i ] ; if ( j === 0 ) FP [ i ] = FP [ 0 ] + "/" + FP [ i ] ; else while ( j !== 0 ) { FP [ i ] = FP [ j ] + "/" + FP [ i ] ; j = dad [ j ] } dad [ i ] = 0 } FP [ 0 ] += "/" ; for ( i = 1 ; i < pl ; ++ i ) { if ( FI [ i ] . type !== 2 ) FP [ i ] += "/" ; FPD [ FP [ i ] ] = FI [ i ] } } function make _find _path ( FullPaths , Paths , FileIndex , files , root _name ) { var UCFullPaths = new Array ( FullPaths . length ) ; var UCPaths = new Array ( Paths . length ) , i ; for ( i = 0 ; i < FullPaths . length ; ++ i ) UCFullPaths [ i ] = FullPaths [ i ] . toUpperCase ( ) . replace ( chr0 , "" ) . replace ( chr1 , "!" ) ; for ( i = 0 ; i < Paths . length ; ++ i ) UCPaths [ i ] = Paths [ i ] . toUpperCase ( ) . replace ( chr0 , "" ) . replace ( chr1 , "!" ) ; return function find _path ( path ) { var k ; if ( path . charCodeAt ( 0 ) === 47 ) { k = true ; path = root _name + path } else k = path . indexOf ( "/" ) !== - 1 ; var UCPath = path . toUpperCase ( ) . replace ( chr0 , "" ) . replace ( chr1 , "!" ) ; var w = k === true ? UCFullPaths . indexOf ( UCPath ) : UCPaths . indexOf ( UCPath ) ; if ( w === - 1 ) return null ; return k === true ? FileIndex [ w ] : files [ Paths [ w ] ] } } function sleuth _fat ( idx , cnt , sectors , ssz , fat _addrs ) { var q ; if ( idx === ENDOFCHAIN ) { if ( cnt !== 0 ) throw new Error ( "DIFAT chain shorter than expected" ) } else if ( idx !== - 1 ) { var sector = sectors [ idx ] , m = ( ssz >>> 2 ) - 1 ; if ( ! sector ) return ; for ( var i = 0 ; i < m ; ++ i ) { if ( ( q = _ _readInt32LE ( sector , i * 4 ) ) === ENDOFCHAIN ) break ; fat _addrs . push ( q ) } sleuth _fat ( _ _readInt32LE ( sector , ssz - 4 ) , cnt - 1 , sectors , ssz , fat _addrs ) } } function get _sector _list ( sectors , start , fat _addrs , ssz , chkd ) { var sl = sectors . length ; var buf , buf _chain ; if ( ! chkd ) chkd = new Array ( sl ) ; var modulus = ssz - 1 , j , jj ; buf = [ ] ; buf _chain = [ ] ; for ( j = start ; j >= 0 ; ) { chkd [ j ] = true ; buf [ buf . length ] = j ; buf _chain . push ( sectors [ j ] ) ; var addr = fat _addrs [ Math . floor ( j * 4 / ssz ) ] ; jj = j * 4 & modulus ; if ( ssz < 4 + jj ) throw new Error ( "FAT boundary crossed: " + j + " 4 " + ssz ) ; if ( ! sectors [ addr ] ) break ; j = _ _readInt32LE ( sectors [ addr ] , jj ) } return { nodes : buf , data : _ _toBuffer ( [ buf _chain ] ) } } function make _sector _list ( sectors , dir _start , fat _addrs , ssz ) { var sl = sec
var q = cell . t == "d" && v instanceof Date ; if ( cell . z != null ) try { return cell . w = SSF . format ( cell . z , q ? datenum ( v ) : v ) } catch ( e ) { } try { return cell . w = SSF . format ( ( cell . XF || { } ) . ifmt || ( q ? 14 : 0 ) , q ? datenum ( v ) : v ) } catch ( e ) { return "" + v } } function format _cell ( cell , v , o ) { if ( cell == null || cell . t == null || cell . t == "z" ) return "" ; if ( cell . w !== undefined ) return cell . w ; if ( cell . t == "d" && ! cell . z && o && o . dateNF ) cell . z = o . dateNF ; if ( v == undefined ) return safe _format _cell ( cell , cell . v , o ) ; return safe _format _cell ( cell , v , o ) } function sheet _to _workbook ( sheet , opts ) { var n = opts && opts . sheet ? opts . sheet : "Sheet1" ; var sheets = { } ; sheets [ n ] = sheet ; return { SheetNames : [ n ] , Sheets : sheets } } function aoa _to _sheet ( data , opts ) { var o = opts || { } ; if ( DENSE != null && o . dense == null ) o . dense = DENSE ; var ws = o . dense ? [ ] : { } ; var range = { s : { c : 1e7 , r : 1e7 } , e : { c : 0 , r : 0 } } ; for ( var R = 0 ; R != data . length ; ++ R ) { for ( var C = 0 ; C != data [ R ] . length ; ++ C ) { if ( typeof data [ R ] [ C ] === "undefined" ) continue ; var cell = { v : data [ R ] [ C ] } ; if ( Array . isArray ( cell . v ) ) { cell . f = data [ R ] [ C ] [ 1 ] ; cell . v = cell . v [ 0 ] } if ( range . s . r > R ) range . s . r = R ; if ( range . s . c > C ) range . s . c = C ; if ( range . e . r < R ) range . e . r = R ; if ( range . e . c < C ) range . e . c = C ; if ( cell . v === null ) { if ( cell . f ) cell . t = "n" ; else if ( ! o . cellStubs ) continue ; else cell . t = "z" } else if ( typeof cell . v === "number" ) cell . t = "n" ; else if ( typeof cell . v === "boolean" ) cell . t = "b" ; else if ( cell . v instanceof Date ) { cell . z = o . dateNF || SSF . _table [ 14 ] ; if ( o . cellDates ) { cell . t = "d" ; cell . w = SSF . format ( cell . z , datenum ( cell . v ) ) } else { cell . t = "n" ; cell . v = datenum ( cell . v ) ; cell . w = SSF . format ( cell . z , cell . v ) } } else cell . t = "s" ; if ( o . dense ) { if ( ! ws [ R ] ) ws [ R ] = [ ] ; ws [ R ] [ C ] = cell } else { var cell _ref = encode _cell ( { c : C , r : R } ) ; ws [ cell _ref ] = cell } } } if ( range . s . c < 1e7 ) ws [ "!ref" ] = encode _range ( range ) ; return ws } function write _UInt32LE ( x , o ) { if ( ! o ) o = new _buf ( 4 ) ; o . write _shift ( 4 , x ) ; return o } function parse _XLWideString ( data ) { var cchCharacters = data . read _shift ( 4 ) ; return cchCharacters === 0 ? "" : data . read _shift ( cchCharacters , "dbcs" ) } function write _XLWideString ( data , o ) { var _null = false ; if ( o == null ) { _null = true ; o = new _buf ( 4 + 2 * data . length ) } o . write _shift ( 4 , data . length ) ; if ( data . length > 0 ) o . write _shift ( 0 , data , "dbcs" ) ; return _null ? o . slice ( 0 , o . l ) : o } function parse _StrRun ( data , length ) { return { ich : data . read _shift ( 2 ) , ifnt : data . read _shift ( 2 ) } } function write _StrRun ( run , o ) { if ( ! o ) o = new _buf ( 4 ) ; o . write _shift ( 2 , run . ich || 0 ) ; o . write _shift ( 2 , run . ifnt || 0 ) ; return o } function parse _RichStr ( data , length ) { var start = data . l ; var flags = data . read _shift ( 1 ) ; var str = parse _XLWideString ( data ) ; var rgsStrRun = [ ] ; var z = { t : str , h : str } ; if ( ( flags & 1 ) !== 0 ) { var dwSizeStrRun = data . read _shift ( 4 ) ; for ( var i = 0 ; i != dwSizeStrRun ; ++ i ) rgsStrRun . push ( parse _StrRun ( data ) ) ; z . r = rgsStrRun } else z . r = [ { ich : 0 , ifnt : 0 } ] ; data . l = start + length ; return z } function write _RichStr ( str , o ) { var _null = false ; if ( o == null ) { _null = true ; o = new _buf ( 15 + 4 * str . t . length ) } o . write _shift ( 1 , 0 ) ; write _XLWideString ( str . t , o ) ; return _null ? o . slice ( 0 , o . l ) : o } var parse _BrtCommentText = parse _RichStr ; function write _BrtCommentText ( str , o ) { var _null = false ; if ( o == null ) { _null = true ; o = new _buf ( 23 + 4 * str . t . length ) } o . write _shift ( 1 , 1 ) ; write _XLWideString ( str . t , o ) ; o . write _shift ( 4 , 1 ) ; write _StrRun ( { ich : 0 , ifnt : 0 } , o ) ; return _null ? o . slice ( 0 , o . l ) : o } function parse _XLSBCell ( data ) { var col = data . read _shift ( 4 ) ; var iStyleRef = data . read _shift ( 2 ) ; iStyleRef += data . read _shift ( 1 ) << 16 ; var fPhShow = data . read _shift ( 1 ) ; return { c : col , iStyleRef : iStyleRef } } function write _XLSBCell ( cell , o ) { if ( o == null ) o = new _buf ( 8 ) ; o . write _shift ( - 4 , cell . c ) ; o . write _shift ( 3 , cell . iStyleRef || cell . s ) ; o . write _shift ( 1 , 0 ) ; return o } var parse _XLSBCodeName = parse _XLWideString ; var write _XLSBCodeName = write _XLWideString ; function parse _XLNullableWideString ( data ) { var cchCharacters = data . read _shift ( 4 ) ; return cchCharacters === 0 || cchCharacters === 4294967295 ? "" : data . read _shift ( cchCharacters , "dbcs" ) } function write _XLNullableWideString ( data , o ) { var _null = false ; if ( o == null ) { _null = true ; o = new _buf ( 127 ) } o . write _shift ( 4 , data . length > 0 ? data . length : 4294967295 ) ; if ( data . length > 0 ) o . write _shift ( 0 , data , "dbcs" ) ; return _null ? o . slice ( 0 , o . l ) : o } var parse _XLNameWideString = parse _XLWideString ; var write _XLNameWideString = write _XLWideString ; var parse _RelID = parse _XLNullableWideString ; var write _RelID = write _XLNullableWideString ; function parse _RkNumber ( data ) { var b = data . sli
if ( ! t ) throw new Error ( "dafuq?" ) ; return parse _VtStringBase ( blob , t , 0 ) } function parse _VtVecUnalignedLpstrValue ( blob ) { var length = blob . read _shift ( 4 ) ; var ret = [ ] ; for ( var i = 0 ; i != length ; ++ i ) ret [ i ] = blob . read _shift ( 0 , "lpstr" ) ; return ret } function parse _VtVecUnalignedLpstr ( blob ) { return parse _VtVecUnalignedLpstrValue ( blob ) } function parse _VtHeadingPair ( blob ) { var headingString = parse _TypedPropertyValue ( blob , VT _USTR ) ; var headerParts = parse _TypedPropertyValue ( blob , VT _I4 ) ; return [ headingString , headerParts ] } function parse _VtVecHeadingPairValue ( blob ) { var cElements = blob . read _shift ( 4 ) ; var out = [ ] ; for ( var i = 0 ; i != cElements / 2 ; ++ i ) out . push ( parse _VtHeadingPair ( blob ) ) ; return out } function parse _VtVecHeadingPair ( blob ) { return parse _VtVecHeadingPairValue ( blob ) } function parse _dictionary ( blob , CodePage ) { var cnt = blob . read _shift ( 4 ) ; var dict = { } ; for ( var j = 0 ; j != cnt ; ++ j ) { var pid = blob . read _shift ( 4 ) ; var len = blob . read _shift ( 4 ) ; dict [ pid ] = blob . read _shift ( len , CodePage === 1200 ? "utf16le" : "utf8" ) . replace ( chr0 , "" ) . replace ( chr1 , "!" ) } if ( blob . l & 3 ) blob . l = blob . l >> 2 + 1 << 2 ; return dict } function parse _BLOB ( blob ) { var size = blob . read _shift ( 4 ) ; var bytes = blob . slice ( blob . l , blob . l + size ) ; if ( ( size & 3 ) > 0 ) blob . l += 4 - ( size & 3 ) & 3 ; return bytes } function parse _ClipboardData ( blob ) { var o = { } ; o . Size = blob . read _shift ( 4 ) ; blob . l += o . Size ; return o } function parse _VtVector ( blob , cb ) { } function parse _TypedPropertyValue ( blob , type , _opts ) { var t = blob . read _shift ( 2 ) , ret , opts = _opts || { } ; blob . l += 2 ; if ( type !== VT _VARIANT ) if ( t !== type && VT _CUSTOM . indexOf ( type ) === - 1 ) throw new Error ( "Expected type " + type + " saw " + t ) ; switch ( type === VT _VARIANT ? t : type ) { case 2 : ret = blob . read _shift ( 2 , "i" ) ; if ( ! opts . raw ) blob . l += 2 ; return ret ; case 3 : ret = blob . read _shift ( 4 , "i" ) ; return ret ; case 11 : return blob . read _shift ( 4 ) !== 0 ; case 19 : ret = blob . read _shift ( 4 ) ; return ret ; case 30 : return parse _lpstr ( blob , t , 4 ) . replace ( chr0 , "" ) ; case 31 : return parse _lpwstr ( blob ) ; case 64 : return parse _FILETIME ( blob ) ; case 65 : return parse _BLOB ( blob ) ; case 71 : return parse _ClipboardData ( blob ) ; case 80 : return parse _VtString ( blob , t , ! opts . raw && 4 ) . replace ( chr0 , "" ) ; case 81 : return parse _VtUnalignedString ( blob , t , 4 ) . replace ( chr0 , "" ) ; case 4108 : return parse _VtVecHeadingPair ( blob ) ; case 4126 : return parse _VtVecUnalignedLpstr ( blob ) ; default : throw new Error ( "TypedPropertyValue unrecognized type " + type + " " + t ) ; } } function parse _PropertySet ( blob , PIDSI ) { var start _addr = blob . l ; var size = blob . read _shift ( 4 ) ; var NumProps = blob . read _shift ( 4 ) ; var Props = [ ] , i = 0 ; var CodePage = 0 ; var Dictionary = - 1 , DictObj = { } ; for ( i = 0 ; i != NumProps ; ++ i ) { var PropID = blob . read _shift ( 4 ) ; var Offset = blob . read _shift ( 4 ) ; Props [ i ] = [ PropID , Offset + start _addr ] } var PropH = { } ; for ( i = 0 ; i != NumProps ; ++ i ) { if ( blob . l !== Props [ i ] [ 1 ] ) { var fail = true ; if ( i > 0 && PIDSI ) switch ( PIDSI [ Props [ i - 1 ] [ 0 ] ] . t ) { case 2 : if ( blob . l + 2 === Props [ i ] [ 1 ] ) { blob . l += 2 ; fail = false } break ; case 80 : if ( blob . l <= Props [ i ] [ 1 ] ) { blob . l = Props [ i ] [ 1 ] ; fail = false } break ; case 4108 : if ( blob . l <= Props [ i ] [ 1 ] ) { blob . l = Props [ i ] [ 1 ] ; fail = false } break ; } if ( ! PIDSI && blob . l <= Props [ i ] [ 1 ] ) { fail = false ; blob . l = Props [ i ] [ 1 ] } if ( fail ) throw new Error ( "Read Error: Expected address " + Props [ i ] [ 1 ] + " at " + blob . l + " :" + i ) } if ( PIDSI ) { var piddsi = PIDSI [ Props [ i ] [ 0 ] ] ; PropH [ piddsi . n ] = parse _TypedPropertyValue ( blob , piddsi . t , { raw : true } ) ; if ( piddsi . p === "version" ) PropH [ piddsi . n ] = String ( PropH [ piddsi . n ] >> 16 ) + "." + String ( PropH [ piddsi . n ] & 65535 ) ; if ( piddsi . n == "CodePage" ) switch ( PropH [ piddsi . n ] ) { case 0 : PropH [ piddsi . n ] = 1252 ; case 874 : ; case 932 : ; case 936 : ; case 949 : ; case 950 : ; case 1250 : ; case 1251 : ; case 1253 : ; case 1254 : ; case 1255 : ; case 1256 : ; case 1257 : ; case 1258 : ; case 1e4 : ; case 1200 : ; case 1201 : ; case 1252 : ; case 65e3 : ; case - 536 : ; case 65001 : ; case - 535 : set _cp ( CodePage = PropH [ piddsi . n ] ) ; break ; default : throw new Error ( "Unsupported CodePage: " + PropH [ piddsi . n ] ) ; } } else { if ( Props [ i ] [ 0 ] === 1 ) { CodePage = PropH . CodePage = parse _TypedPropertyValue ( blob , VT _I2 ) ; set _cp ( CodePage ) ; if ( Dictionary !== - 1 ) { var oldpos = blob . l ; blob . l = Props [ Dictionary ] [ 1 ] ; DictObj = parse _dictionary ( blob , CodePage ) ; blob . l = oldpos } } else if ( Props [ i ] [ 0 ] === 0 ) { if ( CodePage === 0 ) { Dictionary = i ; blob . l = Props [ i + 1 ] [ 1 ] ; continue } DictObj = parse _dictionary ( blob , CodePage ) } else { var name = DictObj [ Props [ i ] [ 0 ] ] ; var val ; switch ( blob [ blob . l ] ) { case 65 : blob . l += 4 ; val = parse _BLOB ( bl
var parse _DXF = parsenoop ; var parse _TableStyles = parsenoop ; var parse _TableStyle = parsenoop ; var parse _TableStyleElement = parsenoop ; var parse _NamePublish = parsenoop ; var parse _SortData = parsenoop ; var parse _GUIDTypeLib = parsenoop ; var parse _FnGrp12 = parsenoop ; var parse _NameFnGrp12 = parsenoop ; var parse _HeaderFooter = parsenoop ; var parse _CrtLayout12 = parsenoop ; var parse _CrtMlFrt = parsenoop ; var parse _CrtMlFrtContinue = parsenoop ; var parse _ShapePropsStream = parsenoop ; var parse _TextPropsStream = parsenoop ; var parse _RichTextStream = parsenoop ; var parse _CrtLayout12A = parsenoop ; var parse _Units = parsenoop ; var parse _Chart = parsenoop ; var parse _Series = parsenoop ; var parse _DataFormat = parsenoop ; var parse _LineFormat = parsenoop ; var parse _MarkerFormat = parsenoop ; var parse _AreaFormat = parsenoop ; var parse _PieFormat = parsenoop ; var parse _AttachedLabel = parsenoop ; var parse _SeriesText = parsenoop ; var parse _ChartFormat = parsenoop ; var parse _Legend = parsenoop ; var parse _SeriesList = parsenoop ; var parse _Bar = parsenoop ; var parse _Line = parsenoop ; var parse _Pie = parsenoop ; var parse _Area = parsenoop ; var parse _Scatter = parsenoop ; var parse _CrtLine = parsenoop ; var parse _Axis = parsenoop ; var parse _Tick = parsenoop ; var parse _ValueRange = parsenoop ; var parse _CatSerRange = parsenoop ; var parse _AxisLine = parsenoop ; var parse _CrtLink = parsenoop ; var parse _DefaultText = parsenoop ; var parse _Text = parsenoop ; var parse _ObjectLink = parsenoop ; var parse _Frame = parsenoop ; var parse _Begin = parsenoop ; var parse _End = parsenoop ; var parse _PlotArea = parsenoop ; var parse _Chart3d = parsenoop ; var parse _PicF = parsenoop ; var parse _DropBar = parsenoop ; var parse _Radar = parsenoop ; var parse _Surf = parsenoop ; var parse _RadarArea = parsenoop ; var parse _AxisParent = parsenoop ; var parse _LegendException = parsenoop ; var parse _SerToCrt = parsenoop ; var parse _AxesUsed = parsenoop ; var parse _SBaseRef = parsenoop ; var parse _SerParent = parsenoop ; var parse _SerAuxTrend = parsenoop ; var parse _IFmtRecord = parsenoop ; var parse _Pos = parsenoop ; var parse _AlRuns = parsenoop ; var parse _BRAI = parsenoop ; var parse _SerAuxErrBar = parsenoop ; var parse _SerFmt = parsenoop ; var parse _Chart3DBarShape = parsenoop ; var parse _Fbi = parsenoop ; var parse _BopPop = parsenoop ; var parse _AxcExt = parsenoop ; var parse _Dat = parsenoop ; var parse _PlotGrowth = parsenoop ; var parse _SIIndex = parsenoop ; var parse _GelFrame = parsenoop ; var parse _BopPopCustom = parsenoop ; var parse _Fbi2 = parsenoop ; function parse _ImData ( blob , length , opts ) { var tgt = blob . l + length ; var cf = blob . read _shift ( 2 ) ; var env = blob . read _shift ( 2 ) ; var lcb = blob . read _shift ( 4 ) ; var o = { fmt : cf , env : env , len : lcb , data : blob . slice ( blob . l , blob . l + lcb ) } ; blob . l += lcb ; return o } function parse _BIFF5String ( blob ) { var len = blob . read _shift ( 1 ) ; return blob . read _shift ( len , "sbcs-cont" ) } function parse _BIFF2STR ( blob , length , opts ) { var cell = parse _XLSCell ( blob , 6 ) ; ++ blob . l ; var str = parse _XLUnicodeString2 ( blob , length - 7 , opts ) ; cell . t = "str" ; cell . val = str ; return cell } function parse _BIFF2NUM ( blob , length , opts ) { var cell = parse _XLSCell ( blob , 6 ) ; ++ blob . l ; var num = parse _Xnum ( blob , 8 ) ; cell . t = "n" ; cell . val = num ; return cell } function parse _BIFF2INT ( blob , length ) { var cell = parse _XLSCell ( blob , 6 ) ; ++ blob . l ; var num = blob . read _shift ( 2 ) ; cell . t = "n" ; cell . val = num ; return cell } function parse _BIFF2STRING ( blob , length ) { var cch = blob . read _shift ( 1 ) ; if ( cch === 0 ) { blob . l ++ ; return "" } return blob . read _shift ( cch , "sbcs-cont" ) } function parse _BIFF2FONTXTRA ( blob , length ) { blob . l += 6 ; blob . l += 2 ; blob . l += 1 ; blob . l += 3 ; blob . l += 1 ; blob . l += length - 13 } function parse _RString ( blob , length , opts ) { var end = blob . l + length ; var cell = parse _XLSCell ( blob , 6 ) ; var cch = blob . read _shift ( 2 ) ; var str = parse _XLUnicodeStringNoCch ( blob , cch , opts ) ; blob . l = end ; cell . t = "str" ; cell . val = str ; return cell } var DBF = function ( ) { var dbf _codepage _map = { 1 : 437 , 2 : 850 , 3 : 1252 , 4 : 1e4 , 100 : 852 , 101 : 866 , 102 : 865 , 103 : 861 , 104 : 895 , 105 : 620 , 106 : 737 , 107 : 857 , 120 : 950 , 121 : 949 , 122 : 936 , 123 : 932 , 124 : 874 , 125 : 1255 , 126 : 1256 , 150 : 10007 , 151 : 10029 , 152 : 10006 , 200 : 1250 , 201 : 1251 , 202 : 1254 , 203 : 1253 , 0 : 20127 , 8 : 865 , 9 : 437 , 10 : 850 , 11 : 437 , 13 : 437 , 14 : 850 , 15 : 437 , 16 : 850 , 17 : 437 , 18 : 850 , 19 : 932 , 20 : 850 , 21 : 437 , 22 : 850 , 23 : 865 , 24 : 437 , 25 : 437 , 26 : 850 , 27 : 437 , 28 : 863 , 29 : 850 , 31 : 852 , 34 : 852 , 35 : 852 , 36 : 860 , 37 : 850 , 38 : 866 , 55 : 850 , 64 : 852 , 77 : 936 , 78 : 949 , 79 : 950 , 80 : 874 , 87 : 1252 , 88 : 1252 , 89 : 1252 , 255 : 16969 } ; function dbf _to _aoa ( buf , opts ) { v
while ( cnt -- > 0 ) o . push ( blob . read _shift ( 0 , "lpp4" ) ) ; return o } function parse _TransformInfoHeader ( blob , length ) { var o = { } ; var len = blob . read _shift ( 4 ) ; var tgt = blob . l + len - 4 ; blob . l += 4 ; o . id = blob . read _shift ( 0 , "lpp4" ) ; o . name = blob . read _shift ( 0 , "lpp4" ) ; o . R = parse _CRYPTOVersion ( blob , 4 ) ; o . U = parse _CRYPTOVersion ( blob , 4 ) ; o . W = parse _CRYPTOVersion ( blob , 4 ) ; return o } function parse _Primary ( blob , length ) { var hdr = parse _TransformInfoHeader ( blob ) ; hdr . ename = blob . read _shift ( 0 , "8lpp4" ) ; hdr . blksz = blob . read _shift ( 4 ) ; hdr . cmode = blob . read _shift ( 4 ) ; if ( blob . read _shift ( 4 ) != 4 ) throw new Error ( "Bad !Primary record" ) ; return hdr } function parse _EncryptionHeader ( blob , length ) { var tgt = blob . l + length ; var o = { } ; o . Flags = blob . read _shift ( 4 ) & 63 ; blob . l += 4 ; o . AlgID = blob . read _shift ( 4 ) ; var valid = false ; switch ( o . AlgID ) { case 26126 : ; case 26127 : ; case 26128 : valid = o . Flags == 36 ; break ; case 26625 : valid = o . Flags == 4 ; break ; case 0 : valid = o . Flags == 16 || o . Flags == 4 || o . Flags == 36 ; break ; default : throw "Unrecognized encryption algorithm: " + o . AlgID ; } if ( ! valid ) throw new Error ( "Encryption Flags/AlgID mismatch" ) ; o . AlgIDHash = blob . read _shift ( 4 ) ; o . KeySize = blob . read _shift ( 4 ) ; o . ProviderType = blob . read _shift ( 4 ) ; blob . l += 8 ; o . CSPName = blob . read _shift ( tgt - blob . l >> 1 , "utf16le" ) . slice ( 0 , - 1 ) ; blob . l = tgt ; return o } function parse _EncryptionVerifier ( blob , length ) { var o = { } ; blob . l += 4 ; o . Salt = blob . slice ( blob . l , blob . l + 16 ) ; blob . l += 16 ; o . Verifier = blob . slice ( blob . l , blob . l + 16 ) ; blob . l += 16 ; var sz = blob . read _shift ( 4 ) ; o . VerifierHash = blob . slice ( blob . l , blob . l + sz ) ; blob . l += sz ; return o } function parse _EncryptionInfo ( blob , length ) { var vers = parse _CRYPTOVersion ( blob ) ; switch ( vers . Minor ) { case 2 : return parse _EncInfoStd ( blob , vers ) ; case 3 : return parse _EncInfoExt ( blob , vers ) ; case 4 : return parse _EncInfoAgl ( blob , vers ) ; } throw new Error ( "ECMA-376 Encryped file unrecognized Version: " + vers . Minor ) } function parse _EncInfoStd ( blob , vers ) { var flags = blob . read _shift ( 4 ) ; if ( ( flags & 63 ) != 36 ) throw new Error ( "EncryptionInfo mismatch" ) ; var sz = blob . read _shift ( 4 ) ; var tgt = blob . l + sz ; var hdr = parse _EncryptionHeader ( blob , sz ) ; var verifier = parse _EncryptionVerifier ( blob , blob . length - blob . l ) ; return { t : "Std" , h : hdr , v : verifier } } function parse _EncInfoExt ( blob , vers ) { throw new Error ( "File is password-protected: ECMA-376 Extensible" ) } function parse _EncInfoAgl ( blob , vers ) { throw new Error ( "File is password-protected: ECMA-376 Agile" ) } function parse _RC4CryptoHeader ( blob , length ) { var o = { } ; var vers = o . EncryptionVersionInfo = parse _CRYPTOVersion ( blob , 4 ) ; length -= 4 ; if ( vers . Minor != 2 ) throw "unrecognized minor version code: " + vers . Minor ; if ( vers . Major > 4 || vers . Major < 2 ) throw "unrecognized major version code: " + vers . Major ; o . Flags = blob . read _shift ( 4 ) ; length -= 4 ; var sz = blob . read _shift ( 4 ) ; length -= 4 ; o . EncryptionHeader = parse _EncryptionHeader ( blob , sz ) ; length -= sz ; o . EncryptionVerifier = parse _EncryptionVerifier ( blob , length ) ; return o } function parse _RC4Header ( blob , length ) { var o = { } ; var vers = o . EncryptionVersionInfo = parse _CRYPTOVersion ( blob , 4 ) ; length -= 4 ; if ( vers . Major != 1 || vers . Minor != 1 ) throw "unrecognized version code " + vers . Major + " : " + vers . Minor ; o . Salt = blob . read _shift ( 16 ) ; o . EncryptedVerifier = blob . read _shift ( 16 ) ; o . EncryptedVerifierHash = blob . read _shift ( 16 ) ; return o } function crypto _CreatePasswordVerifier _Method1 ( Password ) { var Verifier = 0 , PasswordArray ; var PasswordDecoded = _JS2ANSI ( Password ) ; var len = PasswordDecoded . length + 1 , i , PasswordByte ; var Intermediate1 , Intermediate2 , Intermediate3 ; PasswordArray = new _raw _buf ( len ) ; PasswordArray [ 0 ] = PasswordDecoded . length ; for ( i = 1 ; i != len ; ++ i ) PasswordArray [ i ] = PasswordDecoded [ i - 1 ] ; for ( i = len - 1 ; i >= 0 ; -- i ) { PasswordByte = PasswordArray [ i ] ; Intermediate1 = ( Verifier & 16384 ) === 0 ? 0 : 1 ; Intermediate2 = Verifier << 1 & 32767 ; Intermediate3 = Intermediate1 | Intermediate2 ; Verifier = Intermediate3 ^ PasswordByte } return Verifier ^ 52811 } var crypto _CreateXorArray _Method1 = function ( ) { var PadArray = [ 187 , 255 , 255 , 186 , 255 , 255 , 185 , 128 , 0 , 190 , 15 , 0 , 191 , 15 , 0 ] ; var InitialCode = [ 57840 , 7439 , 52380 , 33984 , 4364 , 3600 , 61902 , 12606 , 6258 , 57657 , 54287 , 34041 , 10252 , 43370 , 20163 ] ; var XorMatrix = [ 44796 , 19929 , 39858 , 10053 , 20106 , 40212 , 10761 , 31585 , 63170 , 64933 , 60267 , 50935 , 40399 , 11199 , 17763 , 35526 , 1453 , 2906 , 5812 , 11624 , 23248 , 885 , 1770 , 3540 , 7080 , 14160 , 28320 , 56640 , 55369 , 41139 , 20807 , 41614 , 21821 , 43642 , 1762
o [ o . length ] = '<a:font script="Khmr" typeface="DaunPenh"/>' ; o [ o . length ] = '<a:font script="Knda" typeface="Tunga"/>' ; o [ o . length ] = '<a:font script="Guru" typeface="Raavi"/>' ; o [ o . length ] = '<a:font script="Cans" typeface="Euphemia"/>' ; o [ o . length ] = '<a:font script="Cher" typeface="Plantagenet Cherokee"/>' ; o [ o . length ] = '<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>' ; o [ o . length ] = '<a:font script="Tibt" typeface="Microsoft Himalaya"/>' ; o [ o . length ] = '<a:font script="Thaa" typeface="MV Boli"/>' ; o [ o . length ] = '<a:font script="Deva" typeface="Mangal"/>' ; o [ o . length ] = '<a:font script="Telu" typeface="Gautami"/>' ; o [ o . length ] = '<a:font script="Taml" typeface="Latha"/>' ; o [ o . length ] = '<a:font script="Syrc" typeface="Estrangelo Edessa"/>' ; o [ o . length ] = '<a:font script="Orya" typeface="Kalinga"/>' ; o [ o . length ] = '<a:font script="Mlym" typeface="Kartika"/>' ; o [ o . length ] = '<a:font script="Laoo" typeface="DokChampa"/>' ; o [ o . length ] = '<a:font script="Sinh" typeface="Iskoola Pota"/>' ; o [ o . length ] = '<a:font script="Mong" typeface="Mongolian Baiti"/>' ; o [ o . length ] = '<a:font script="Viet" typeface="Arial"/>' ; o [ o . length ] = '<a:font script="Uigh" typeface="Microsoft Uighur"/>' ; o [ o . length ] = '<a:font script="Geor" typeface="Sylfaen"/>' ; o [ o . length ] = "</a:minorFont>" ; o [ o . length ] = "</a:fontScheme>" ; o [ o . length ] = '<a:fmtScheme name="Office">' ; o [ o . length ] = "<a:fillStyleLst>" ; 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="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>' ; o [ o . length ] = '<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>' ; o [ o . length ] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>' ; 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 : s p 3
if ( ! formula [ 0 ] || ! formula [ 0 ] [ 0 ] ) return "" ; var last _sp = - 1 , sp = "" ; for ( var ff = 0 , fflen = formula [ 0 ] . length ; ff < fflen ; ++ ff ) { var f = formula [ 0 ] [ ff ] ; switch ( f [ 0 ] ) { case "PtgUminus" : stack . push ( "-" + stack . pop ( ) ) ; break ; case "PtgUplus" : stack . push ( "+" + stack . pop ( ) ) ; break ; case "PtgPercent" : stack . push ( stack . pop ( ) + "%" ) ; break ; case "PtgAdd" : ; case "PtgConcat" : ; case "PtgDiv" : ; case "PtgEq" : ; case "PtgGe" : ; case "PtgGt" : ; case "PtgLe" : ; case "PtgLt" : ; case "PtgMul" : ; case "PtgNe" : ; case "PtgPower" : ; case "PtgSub" : e1 = stack . pop ( ) ; e2 = stack . pop ( ) ; if ( last _sp >= 0 ) { switch ( formula [ 0 ] [ last _sp ] [ 1 ] [ 0 ] ) { case 0 : sp = fill ( " " , formula [ 0 ] [ last _sp ] [ 1 ] [ 1 ] ) ; break ; case 1 : sp = fill ( "\r" , formula [ 0 ] [ last _sp ] [ 1 ] [ 1 ] ) ; break ; default : sp = "" ; if ( opts . WTF ) throw new Error ( "Unexpected PtgAttrSpaceType " + formula [ 0 ] [ last _sp ] [ 1 ] [ 0 ] ) ; } e2 = e2 + sp ; last _sp = - 1 } stack . push ( e2 + PtgBinOp [ f [ 0 ] ] + e1 ) ; break ; case "PtgIsect" : e1 = stack . pop ( ) ; e2 = stack . pop ( ) ; stack . push ( e2 + " " + e1 ) ; break ; case "PtgUnion" : e1 = stack . pop ( ) ; e2 = stack . pop ( ) ; stack . push ( e2 + "," + e1 ) ; break ; case "PtgRange" : e1 = stack . pop ( ) ; e2 = stack . pop ( ) ; stack . push ( e2 + ":" + e1 ) ; break ; case "PtgAttrChoose" : break ; case "PtgAttrGoto" : break ; case "PtgAttrIf" : break ; case "PtgAttrIfError" : break ; case "PtgRef" : type = f [ 1 ] [ 0 ] ; c = shift _cell _xls ( f [ 1 ] [ 1 ] , _range , opts ) ; stack . push ( encode _cell _xls ( c ) ) ; break ; case "PtgRefN" : type = f [ 1 ] [ 0 ] ; c = cell ? shift _cell _xls ( f [ 1 ] [ 1 ] , cell , opts ) : f [ 1 ] [ 1 ] ; stack . push ( encode _cell _xls ( c ) ) ; break ; case "PtgRef3d" : type = f [ 1 ] [ 0 ] ; ixti = f [ 1 ] [ 1 ] ; c = shift _cell _xls ( f [ 1 ] [ 2 ] , _range , opts ) ; sname = supbooks . SheetNames [ ixti ] ; var w = sname ; stack . push ( sname + "!" + encode _cell _xls ( c ) ) ; break ; case "PtgFunc" : ; case "PtgFuncVar" : var argc = f [ 1 ] [ 0 ] , func = f [ 1 ] [ 1 ] ; if ( ! argc ) argc = 0 ; var args = argc == 0 ? [ ] : stack . slice ( - argc ) ; stack . length -= argc ; if ( func === "User" ) func = args . shift ( ) ; stack . push ( func + "(" + args . join ( "," ) + ")" ) ; break ; case "PtgBool" : stack . push ( f [ 1 ] ? "TRUE" : "FALSE" ) ; break ; case "PtgInt" : stack . push ( f [ 1 ] ) ; 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
var seencol = false ; for ( var coli = 0 ; coli != cols . length ; ++ coli ) { var coll = parsexmltag ( cols [ coli ] , true ) ; if ( coll . hidden ) coll . hidden = parsexmlbool ( coll . hidden ) ; var colm = parseInt ( coll . min , 10 ) - 1 , colM = parseInt ( coll . max , 10 ) - 1 ; delete coll . min ; delete coll . max ; coll . width = + coll . width ; if ( ! seencol && coll . width ) { seencol = true ; find _mdw _colw ( coll . width ) } process _col ( coll ) ; while ( colm <= colM ) columns [ colm ++ ] = dup ( coll ) } } function write _ws _xml _cols ( ws , cols ) { var o = [ "<cols>" ] , col , width ; for ( var i = 0 ; i != cols . length ; ++ i ) { if ( ! ( col = cols [ i ] ) ) continue ; o [ o . length ] = writextag ( "col" , null , col _obj _w ( i , col ) ) } o [ o . length ] = "</cols>" ; return o . join ( "" ) } function parse _ws _xml _autofilter ( data ) { var o = { ref : ( data . match ( /ref="([^"]*)"/ ) || [ ] ) [ 1 ] } ; return o } function write _ws _xml _autofilter ( data ) { return writextag ( "autoFilter" , null , { ref : data . ref } ) } function write _ws _xml _sheetviews ( ws , opts , idx , wb ) { return writextag ( "sheetViews" , writextag ( "sheetView" , null , { workbookViewId : "0" } ) , { } ) } function write _ws _xml _cell ( cell , ref , ws , opts , idx , wb ) { if ( cell . v === undefined && cell . f === undefined || cell . t === "z" ) return "" ; var vv = "" ; var oldt = cell . t , oldv = cell . v ; switch ( cell . t ) { case "b" : vv = cell . v ? "1" : "0" ; break ; case "n" : vv = "" + cell . v ; break ; case "e" : vv = BErr [ cell . v ] ; break ; case "d" : if ( opts . cellDates ) vv = parseDate ( cell . v , - 1 ) . toISOString ( ) ; else { cell . t = "n" ; vv = "" + ( cell . v = datenum ( parseDate ( cell . v ) ) ) } if ( typeof cell . z === "undefined" ) cell . z = SSF . _table [ 14 ] ; break ; default : vv = cell . v ; break ; } var v = writetag ( "v" , escapexml ( vv ) ) , o = { r : ref } ; var os = get _cell _style ( opts . cellXfs , cell , opts ) ; if ( os !== 0 ) o . s = os ; switch ( cell . t ) { case "n" : break ; case "d" : o . t = "d" ; break ; case "b" : o . t = "b" ; break ; case "e" : o . t = "e" ; break ; default : if ( cell . v == null ) { delete cell . t ; break } if ( opts . bookSST ) { v = writetag ( "v" , "" + get _sst _id ( opts . Strings , cell . v ) ) ; o . t = "s" ; break } o . t = "str" ; break ; } if ( cell . t != oldt ) { cell . t = oldt ; cell . v = oldv } if ( cell . f ) { var ff = cell . F && cell . F . substr ( 0 , ref . length ) == ref ? { t : "array" , ref : cell . F } : null ; v = writextag ( "f" , escapexml ( cell . f ) , ff ) + ( cell . v != null ? v : "" ) } if ( cell . l ) ws [ "!links" ] . push ( [ ref , cell . l ] ) ; if ( cell . c ) ws [ "!comments" ] . push ( [ ref , cell . c ] ) ; return writextag ( "c" , v , o ) } var parse _ws _xml _data = function parse _ws _xml _data _factory ( ) { var cellregex = /<(?:\w+:)?c[ >]/ , rowregex = /<\/(?:\w+:)?row>/ ; var rregex = /r=["']([^"']*)["']/ , isregex = /<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/ ; 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 ) ; var rows = [ ] , rowobj = { } , rowrite = false ; 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 = tag . r != null ? 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 ; if ( opts && opts . cellStyles ) { rowobj = { } ; rowrite = false ; if ( tag . ht ) { rowrite = true ; rowobj . hpt = parseFloat ( tag . ht ) ; rowobj . hpx = pt2px ( rowobj . hpt ) } if ( tag . hidden == "1" ) { rowrite = true ; rowobj . hidden = true } if ( rowrite ) rows [ tagr - 1 ] = rowobj } 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 ( c
delete y [ 0 ] ; wb . WBView . push ( y ) ; break ; case "</workbookView>" : break ; case "<sheets>" : ; case "</sheets>" : break ; case "<sheet" : switch ( y . state ) { case "hidden" : y . Hidden = 1 ; break ; case "veryHidden" : y . Hidden = 2 ; break ; default : y . Hidden = 0 ; } delete y . state ; y . name = unescapexml ( utf8read ( y . name ) ) ; delete y [ 0 ] ; wb . Sheets . push ( y ) ; break ; case "</sheet>" : break ; case "<functionGroups" : ; case "<functionGroups/>" : break ; case "<functionGroup" : break ; case "<externalReferences" : ; case "</externalReferences>" : ; case "<externalReferences>" : break ; case "<externalReference" : break ; case "<definedNames/>" : break ; case "<definedNames>" : ; case "<definedNames" : pass = true ; break ; case "</definedNames>" : pass = false ; break ; case "<definedName" : { dname = { } ; dname . Name = y . name ; if ( y . comment ) dname . Comment = y . comment ; if ( y . localSheetId ) dname . Sheet = + y . localSheetId ; dnstart = idx + x . length } break ; case "</definedName>" : { dname . Ref = data . slice ( dnstart , idx ) ; wb . Names . push ( dname ) } break ; case "<definedName/>" : break ; case "<calcPr" : delete y [ 0 ] ; wb . CalcPr = y ; break ; case "<calcPr/>" : delete y [ 0 ] ; wb . CalcPr = y ; break ; case "</calcPr>" : break ; case "<oleSize" : break ; case "<customWorkbookViews>" : ; case "</customWorkbookViews>" : ; case "<customWorkbookViews" : break ; case "<customWorkbookView" : ; case "</customWorkbookView>" : break ; case "<pivotCaches>" : ; case "</pivotCaches>" : ; case "<pivotCaches" : break ; case "<pivotCache" : break ; case "<smartTagPr" : ; case "<smartTagPr/>" : break ; case "<smartTagTypes" : ; case "<smartTagTypes>" : ; case "</smartTagTypes>" : break ; case "<smartTagType" : break ; case "<webPublishing" : ; case "<webPublishing/>" : break ; case "<fileRecoveryPr" : ; case "<fileRecoveryPr/>" : break ; case "<webPublishObjects>" : ; case "<webPublishObjects" : ; case "</webPublishObjects>" : break ; case "<webPublishObject" : break ; case "<extLst>" : ; case "</extLst>" : ; case "<extLst/>" : break ; case "<ext" : pass = true ; break ; case "</ext>" : pass = false ; break ; case "<ArchID" : break ; case "<AlternateContent" : pass = true ; break ; case "</AlternateContent>" : pass = false ; break ; default : if ( ! pass && opts . WTF ) throw new Error ( "unrecognized " + y [ 0 ] + " in workbook" ) ; } return x } ) ; if ( XMLNS . main . indexOf ( wb . xmlns ) === - 1 ) throw new Error ( "Unknown Namespace: " + wb . xmlns ) ; parse _wb _defaults ( wb ) ; return wb } var WB _XML _ROOT = writextag ( "workbook" , null , { xmlns : XMLNS . main [ 0 ] , "xmlns:r" : XMLNS . r } ) ; function write _wb _xml ( wb , opts ) { var o = [ XML _HEADER ] ; o [ o . length ] = WB _XML _ROOT ; var write _names = wb . Workbook && ( wb . Workbook . Names || [ ] ) . length > 0 ; var workbookPr = { codeName : "ThisWorkbook" } ; if ( wb . Workbook && wb . Workbook . WBProps ) { if ( wb . Workbook . WBProps . codeName ) workbookPr . codeName = wb . Workbook . WBProps . codeName ; WBPropsDef . forEach ( function ( x ) { if ( wb . Workbook . WBProps [ x [ 0 ] ] == null ) return ; if ( wb . Workbook . WBProps [ x [ 0 ] ] == x [ 1 ] ) return ; workbookPr [ x [ 0 ] ] = wb . Workbook . WBProps [ x [ 0 ] ] } ) } o [ o . length ] = writextag ( "workbookPr" , null , workbookPr ) ; o [ o . length ] = "<sheets>" ; var sheets = wb . Workbook && wb . Workbook . Sheets || [ ] ; for ( var i = 0 ; i != wb . SheetNames . length ; ++ i ) { var sht = { name : escapexml ( wb . SheetNames [ i ] . substr ( 0 , 31 ) ) } ; sht . sheetId = "" + ( i + 1 ) ; sht [ "r:id" ] = "rId" + ( i + 1 ) ; if ( sheets [ i ] ) switch ( sheets [ i ] . Hidden ) { case 1 : sht . state = "hidden" ; break ; case 2 : sht . state = "veryHidden" ; break ; } o [ o . length ] = writextag ( "sheet" , null , sht ) } o [ o . length ] = "</sheets>" ; if ( write _names ) { o [ o . length ] = "<definedNames>" ; if ( wb . Workbook && wb . Workbook . Names ) wb . Workbook . Names . forEach ( function ( n ) { var d = { name : n . Name } ; if ( n . Comment ) d . comment = n . Comment ; if ( n . Sheet != null ) d . localSheetId = "" + n . Sheet ; if ( ! n . Ref ) return ; o [ o . length ] = writextag ( "definedName" , String ( n . Ref ) , d ) } ) ; o [ o . length ] = "</definedNames>" } if ( o . length > 2 ) { o [ o . length ] = "</workbook>" ; o [ 1 ] = o [ 1 ] . replace ( "/>" , ">" ) } return o . join ( "" ) } function parse _BrtBundleSh ( data , length ) { var z = { } ; z . Hidden = data . read _shift ( 4 ) ; z . iTabID = data . read _shift ( 4 ) ; z . strRelID = parse _RelID ( data , length - 8 ) ; z . name = parse _XLWideString ( data ) ; return z } function write _BrtBundleSh ( data , o ) { if ( ! o ) o = new _buf ( 127 ) ; o . write _shift ( 4 , data . Hidden ) ; o . write _shift ( 4 , data . iTabID ) ; write _RelID ( data . strRelID , o ) ; write _XLWideString ( data . name . substr ( 0 , 31 ) , o ) ; return o . length > o . l ? o . slice ( 0 , o . l ) : o } function parse _BrtWbProp ( data , length ) { var o = { } ; var flags = data . read _shift ( 4 ) ; o . defaultThemeVersion = data . read _shift ( 4 ) ; var strName = length > 8 ? parse _XLWideString ( data ) : "" ; if ( strName . length > 0 ) o . codeName = strName ; o . autoCompressPictures =
for ( var i = 0 ; i < idx ; ++ i ) if ( wb . Workbook . Sheets [ i ] && ! wb . Workbook . Sheets [ i ] . Hidden ) break ; if ( i == idx ) o . push ( "<Selected/>" ) } } if ( ws [ "!protect" ] ) { o . push ( writetag ( "ProtectContents" , "True" ) ) ; if ( ws [ "!protect" ] . objects ) o . push ( writetag ( "ProtectObjects" , "True" ) ) ; if ( ws [ "!protect" ] . scenarios ) o . push ( writetag ( "ProtectScenarios" , "True" ) ) ; if ( ws [ "!protect" ] . selectLockedCells != null && ! ws [ "!protect" ] . selectLockedCells ) o . push ( writetag ( "EnableSelection" , "NoSelection" ) ) ; else if ( ws [ "!protect" ] . selectUnlockedCells != null && ! ws [ "!protect" ] . selectUnlockedCells ) o . push ( writetag ( "EnableSelection" , "UnlockedCells" ) ) ; [ [ "formatColumns" , "AllowFormatCells" ] , [ "formatRows" , "AllowSizeCols" ] , [ "formatCells" , "AllowSizeRows" ] , [ "insertColumns" , "AllowInsertCols" ] , [ "insertRows" , "AllowInsertRows" ] , [ "insertHyperlinks" , "AllowInsertHyperlinks" ] , [ "deleteColumns" , "AllowDeleteCols" ] , [ "deleteRows" , "AllowDeleteRows" ] , [ "sort" , "AllowSort" ] , [ "autoFilter" , "AllowFilter" ] , [ "pivotTables" , "AllowUsePivotTables" ] ] . forEach ( function ( x ) { if ( ws [ "!protect" ] [ x [ 0 ] ] ) o . push ( "<" + x [ 1 ] + "/>" ) } ) } if ( o . length == 0 ) return "" ; return writextag ( "WorksheetOptions" , o . join ( "" ) , { xmlns : XLMLNS . x } ) } function write _ws _xlml _comment ( comments ) { return comments . map ( function ( c ) { var t = xlml _unfixstr ( c . t || "" ) ; var d = writextag ( "ss:Data" , t , { xmlns : "http://www.w3.org/TR/REC-html40" } ) ; return writextag ( "Comment" , d , { "ss:Author" : c . a } ) } ) . join ( "" ) } function write _ws _xlml _cell ( cell , ref , ws , opts , idx , wb , addr ) { if ( ! cell || cell . v == undefined && cell . f == undefined ) return "<Cell></Cell>" ; var attr = { } ; if ( cell . f ) attr [ "ss:Formula" ] = "=" + escapexml ( a1 _to _rc ( cell . f , addr ) ) ; if ( cell . F && cell . F . substr ( 0 , ref . length ) == ref ) { var end = decode _cell ( cell . F . substr ( ref . length + 1 ) ) ; attr [ "ss:ArrayRange" ] = "RC:R" + ( end . r == addr . r ? "" : "[" + ( end . r - addr . r ) + "]" ) + "C" + ( end . c == addr . c ? "" : "[" + ( end . c - addr . c ) + "]" ) } if ( cell . l && cell . l . Target ) { attr [ "ss:HRef" ] = escapexml ( cell . l . Target ) ; if ( cell . l . Tooltip ) attr [ "x:HRefScreenTip" ] = escapexml ( cell . l . Tooltip ) } if ( ws [ "!merges" ] ) { var marr = ws [ "!merges" ] ; for ( var mi = 0 ; mi != marr . length ; ++ mi ) { if ( marr [ mi ] . s . c != addr . c || marr [ mi ] . s . r != addr . r ) continue ; if ( marr [ mi ] . e . c > marr [ mi ] . s . c ) attr [ "ss:MergeAcross" ] = marr [ mi ] . e . c - marr [ mi ] . s . c ; if ( marr [ mi ] . e . r > marr [ mi ] . s . r ) attr [ "ss:MergeDown" ] = marr [ mi ] . e . r - marr [ mi ] . s . r } } var t = "" , p = "" ; switch ( cell . t ) { case "z" : return "" ; case "n" : t = "Number" ; p = String ( cell . v ) ; break ; case "b" : t = "Boolean" ; p = cell . v ? "1" : "0" ; break ; case "e" : t = "Error" ; p = BErr [ cell . v ] ; break ; case "d" : t = "DateTime" ; p = new Date ( cell . v ) . toISOString ( ) ; break ; case "s" : t = "String" ; p = escapexml ( cell . v || "" ) ; break ; } var _v = cell . v != null ? p : "" ; if ( opts && opts . type == "binary" && typeof cptable !== "undefined" && cell . t == "s" ) { _v = cptable . utils . encode ( 65001 , _v ) ; var _ _v = "" ; for ( var _ _i = 0 ; _ _i < _v . length ; ++ _ _i ) _ _v += String . fromCharCode ( _v [ _ _i ] ) ; _v = _ _v } var m = '<Data ss:Type="' + t + '">' + _v + "</Data>" ; if ( ( cell . c || [ ] ) . length > 0 ) m += write _ws _xlml _comment ( cell . c ) ; return writextag ( "Cell" , m , attr ) } function write _ws _xlml _row ( R , row ) { var o = '<Row ss:Index="' + ( R + 1 ) + '"' ; if ( row ) { if ( row . hpt && ! row . hpx ) row . hpx = pt2px ( row . hpt ) ; if ( row . hpx ) o += ' ss:AutoFitHeight="0" ss:Height="' + row . hpx + '"' ; if ( row . hidden ) o += ' ss:Hidden="1"' } return o + ">" } function write _ws _xlml _table ( ws , opts , idx , wb ) { if ( ! ws [ "!ref" ] ) return "" ; var range = safe _decode _range ( ws [ "!ref" ] ) ; var marr = ws [ "!merges" ] || [ ] , mi = 0 ; var o = [ ] ; if ( ws [ "!cols" ] ) ws [ "!cols" ] . forEach ( function ( n , i ) { process _col ( n ) ; var w = ! ! n . width ; var p = col _obj _w ( i , n ) ; var k = { "ss:Index" : i + 1 } ; if ( w ) k [ "ss:Width" ] = width2px ( p . width ) ; if ( n . hidden ) k [ "ss:Hidden" ] = "1" ; o . push ( writextag ( "Column" , null , k ) ) } ) ; var dense = Array . isArray ( ws ) ; for ( var R = range . s . r ; R <= range . e . r ; ++ R ) { var row = [ write _ws _xlml _row ( R , ( ws [ "!rows" ] || [ ] ) [ R ] ) ] ; for ( var C = range . s . c ; C <= range . e . c ; ++ C ) { var skip = false ; for ( mi = 0 ; mi != marr . length ; ++ mi ) { if ( marr [ mi ] . s . c > C ) continue ; if ( marr [ mi ] . s . r > R ) continue ; if ( marr [ mi ] . e . c < C ) continue ; if ( marr [ mi ] . e . r < R ) continue ; if ( marr [ mi ] . s . c != C || marr [ mi ] . s . r != R ) skip = true ; break } if ( skip ) continue ; var addr = { r : R , c : C } ; var ref = encode _cell ( addr ) , cell = dense ? ( ws [ R ] || [ ] ) [ C ] : ws [ ref ] ; row . push ( write _ws _xlml _cell ( cell , ref , ws , opts , idx , wb , addr ) ) } row . push ( "</Row>" ) ; if ( row . length > 2 ) o . push ( row . join ( "" ) ) } return o . join ( "" ) } function write _ws _xlml ( idx , opts , wb ) { var o = [ ] ; var s = wb . SheetNames [ idx ] ; var ws = wb . S
f : parsenoop } , 227 : { n : "BrtBeginPCDSDTupleCache" , f : parsenoop } , 228 : { n : "BrtEndPCDSDTupleCache" , f : parsenoop } , 229 : { n : "BrtBeginPCDSDTCEntries" , f : parsenoop } , 230 : { n : "BrtEndPCDSDTCEntries" , f : parsenoop } , 231 : { n : "BrtBeginPCDSDTCEMembers" , f : parsenoop } , 232 : { n : "BrtEndPCDSDTCEMembers" , f : parsenoop } , 233 : { n : "BrtBeginPCDSDTCEMember" , f : parsenoop } , 234 : { n : "BrtEndPCDSDTCEMember" , f : parsenoop } , 235 : { n : "BrtBeginPCDSDTCQueries" , f : parsenoop } , 236 : { n : "BrtEndPCDSDTCQueries" , f : parsenoop } , 237 : { n : "BrtBeginPCDSDTCQuery" , f : parsenoop } , 238 : { n : "BrtEndPCDSDTCQuery" , f : parsenoop } , 239 : { n : "BrtBeginPCDSDTCSets" , f : parsenoop } , 240 : { n : "BrtEndPCDSDTCSets" , f : parsenoop } , 241 : { n : "BrtBeginPCDSDTCSet" , f : parsenoop } , 242 : { n : "BrtEndPCDSDTCSet" , f : parsenoop } , 243 : { n : "BrtBeginPCDCalcItems" , f : parsenoop } , 244 : { n : "BrtEndPCDCalcItems" , f : parsenoop } , 245 : { n : "BrtBeginPCDCalcItem" , f : parsenoop } , 246 : { n : "BrtEndPCDCalcItem" , f : parsenoop } , 247 : { n : "BrtBeginPRule" , f : parsenoop } , 248 : { n : "BrtEndPRule" , f : parsenoop } , 249 : { n : "BrtBeginPRFilters" , f : parsenoop } , 250 : { n : "BrtEndPRFilters" , f : parsenoop } , 251 : { n : "BrtBeginPRFilter" , f : parsenoop } , 252 : { n : "BrtEndPRFilter" , f : parsenoop } , 253 : { n : "BrtBeginPNames" , f : parsenoop } , 254 : { n : "BrtEndPNames" , f : parsenoop } , 255 : { n : "BrtBeginPName" , f : parsenoop } , 256 : { n : "BrtEndPName" , f : parsenoop } , 257 : { n : "BrtBeginPNPairs" , f : parsenoop } , 258 : { n : "BrtEndPNPairs" , f : parsenoop } , 259 : { n : "BrtBeginPNPair" , f : parsenoop } , 260 : { n : "BrtEndPNPair" , f : parsenoop } , 261 : { n : "BrtBeginECWebProps" , f : parsenoop } , 262 : { n : "BrtEndECWebProps" , f : parsenoop } , 263 : { n : "BrtBeginEcWpTables" , f : parsenoop } , 264 : { n : "BrtEndECWPTables" , f : parsenoop } , 265 : { n : "BrtBeginECParams" , f : parsenoop } , 266 : { n : "BrtEndECParams" , f : parsenoop } , 267 : { n : "BrtBeginECParam" , f : parsenoop } , 268 : { n : "BrtEndECParam" , f : parsenoop } , 269 : { n : "BrtBeginPCDKPIs" , f : parsenoop } , 270 : { n : "BrtEndPCDKPIs" , f : parsenoop } , 271 : { n : "BrtBeginPCDKPI" , f : parsenoop } , 272 : { n : "BrtEndPCDKPI" , f : parsenoop } , 273 : { n : "BrtBeginDims" , f : parsenoop } , 274 : { n : "BrtEndDims" , f : parsenoop } , 275 : { n : "BrtBeginDim" , f : parsenoop } , 276 : { n : "BrtEndDim" , f : parsenoop } , 277 : { n : "BrtIndexPartEnd" , f : parsenoop } , 278 : { n : "BrtBeginStyleSheet" , f : parsenoop } , 279 : { n : "BrtEndStyleSheet" , f : parsenoop } , 280 : { n : "BrtBeginSXView" , f : parsenoop } , 281 : { n : "BrtEndSXVI" , f : parsenoop } , 282 : { n : "BrtBeginSXVI" , f : parsenoop } , 283 : { n : "BrtBeginSXVIs" , f : parsenoop } , 284 : { n : "BrtEndSXVIs" , f : parsenoop } , 285 : { n : "BrtBeginSXVD" , f : parsenoop } , 286 : { n : "BrtEndSXVD" , f : parsenoop } , 287 : { n : "BrtBeginSXVDs" , f : parsenoop } , 288 : { n : "BrtEndSXVDs" , f : parsenoop } , 289 : { n : "BrtBeginSXPI" , f : parsenoop } , 290 : { n : "BrtEndSXPI" , f : parsenoop } , 291 : { n : "BrtBeginSXPIs" , f : parsenoop } , 292 : { n : "BrtEndSXPIs" , f : parsenoop } , 293 : { n : "BrtBeginSXDI" , f : parsenoop } , 294 : { n : "BrtEndSXDI" , f : parsenoop } , 295 : { n : "BrtBeginSXDIs" , f : parsenoop } , 296 : { n : "BrtEndSXDIs" , f : parsenoop } , 297 : { n : "BrtBeginSXLI" , f : parsenoop } , 298 : { n : "BrtEndSXLI" , f : parsenoop } , 299 : { n : "BrtBeginSXLIRws" , f : parsenoop } , 300 : { n : "BrtEndSXLIRws" , f : parsenoop } , 301 : { n : "BrtBeginSXLICols" , f : parsenoop } , 302 : { n : "BrtEndSXLICols" , f : parsenoop } , 303 : { n : "BrtBeginSXFormat" , f : parsenoop } , 304 : { n : "BrtEndSXFormat" , f : parsenoop } , 305 : { n : "BrtBeginSXFormats" , f : parsenoop } , 306 : { n : "BrtEndSxFormats" , f : parsenoop } , 307 : { n : "BrtBeginSxSelect" , f : parsenoop } , 308 : { n : "BrtEndSxSelect" , f : parsenoop } , 309 : { n : "BrtBeginISXVDRws" , f : parsenoop } , 310 : { n : "BrtEndISXVDRws" , f : parsenoop } , 311 : { n : "BrtBeginISXVDCols" , f : parsenoop } , 312 : { n : "BrtEndISXVDCols" , f : parsenoop } , 313 : { n : "BrtEndSXLocation" , f : parsenoop } , 314 : { n : "BrtBeginSXLocation" , f : parsenoop } , 315 : { n : "BrtEndSXView" , f : parsenoop } , 316 : { n : "BrtBeginSXTHs" , f : parsenoop } , 317 : { n : "BrtEndSXTHs" , f : parsenoop } , 318 : { n : "BrtBeginSXTH" , f : parsenoop } , 319 : { n : "BrtEndSXTH" , f : parsenoop } , 320 : { n : "BrtBeginISXTHRws" , f : parsenoop } , 321 : { n : "BrtEndISXTHRws" , f : parsenoop } , 322 : { n : "BrtBeginISXTHCols" , f : parsenoop } , 323 : { n : "BrtEndISXTHCols" , f : parsenoop } , 324 : { n : "BrtBeginSXTDMPS" , f : parsenoop } , 325 : { n : "BrtEndSXTDMPs" , f : parsenoop } , 326 : { n : "BrtBeginSXTDMP" , f : parsenoop } , 327 : { n : "BrtEndSXTDMP" , f : parsenoop } , 328 : { n : "BrtBeginSXTHItems" , f : parsenoop } , 329 : { n : "BrtEndSXTHItems" , f : parsenoop } , 330 : { n : "BrtBeginSXTHItem" , f : parsenoop } , 331 : { n : "BrtEndSXTHItem" , f : parsenoop } , 332 : { n : "BrtBeginMetadata" , f : parsenoop } , 333 : { n : "BrtEndMetadata" , f : parsenoop } , 334 : { n : "BrtBeginEsmdtinfo" , f : par
} , 425 : { n : "UserBView" , f : parse _UserBView } , 426 : { n : "UserSViewBegin" , f : parse _UserSViewBegin } , 427 : { n : "UserSViewEnd" , f : parse _UserSViewEnd } , 428 : { n : "RRDUserView" , f : parse _RRDUserView } , 429 : { n : "Qsi" , f : parse _Qsi } , 430 : { n : "SupBook" , f : parse _SupBook } , 431 : { n : "Prot4Rev" , f : parse _Prot4Rev } , 432 : { n : "CondFmt" , f : parse _CondFmt } , 433 : { n : "CF" , f : parse _CF } , 434 : { n : "DVal" , f : parse _DVal } , 437 : { n : "DConBin" , f : parse _DConBin } , 438 : { n : "TxO" , f : parse _TxO } , 439 : { n : "RefreshAll" , f : parse _RefreshAll } , 440 : { n : "HLink" , f : parse _HLink } , 441 : { n : "Lel" , f : parse _Lel } , 442 : { n : "CodeName" , f : parse _XLSCodeName } , 443 : { n : "SXFDBType" , f : parse _SXFDBType } , 444 : { n : "Prot4RevPass" , f : parse _Prot4RevPass } , 445 : { n : "ObNoMacros" , f : parse _ObNoMacros } , 446 : { n : "Dv" , f : parse _Dv } , 448 : { n : "Excel9File" , f : parse _Excel9File } , 449 : { n : "RecalcId" , f : parse _RecalcId , r : 2 } , 450 : { n : "EntExU2" , f : parse _EntExU2 } , 512 : { n : "Dimensions" , f : parse _Dimensions } , 513 : { n : "Blank" , f : parse _Blank } , 515 : { n : "Number" , f : parse _Number } , 516 : { n : "Label" , f : parse _Label } , 517 : { n : "BoolErr" , f : parse _BoolErr } , 518 : { n : "Formula" , f : parse _Formula } , 519 : { n : "String" , f : parse _String } , 520 : { n : "Row" , f : parse _Row } , 523 : { n : "Index" , f : parse _Index } , 545 : { n : "Array" , f : parse _Array } , 549 : { n : "DefaultRowHeight" , f : parse _DefaultRowHeight } , 566 : { n : "Table" , f : parse _Table } , 574 : { n : "Window2" , f : parse _Window2 } , 638 : { n : "RK" , f : parse _RK } , 659 : { n : "Style" , f : parse _Style } , 1030 : { n : "Formula" , f : parse _Formula } , 1048 : { n : "BigName" , f : parse _BigName } , 1054 : { n : "Format" , f : parse _Format } , 1084 : { n : "ContinueBigName" , f : parse _ContinueBigName } , 1212 : { n : "ShrFmla" , f : parse _ShrFmla } , 2048 : { n : "HLinkTooltip" , f : parse _HLinkTooltip } , 2049 : { n : "WebPub" , f : parse _WebPub } , 2050 : { n : "QsiSXTag" , f : parse _QsiSXTag } , 2051 : { n : "DBQueryExt" , f : parse _DBQueryExt } , 2052 : { n : "ExtString" , f : parse _ExtString } , 2053 : { n : "TxtQry" , f : parse _TxtQry } , 2054 : { n : "Qsir" , f : parse _Qsir } , 2055 : { n : "Qsif" , f : parse _Qsif } , 2056 : { n : "RRDTQSIF" , f : parse _RRDTQSIF } , 2057 : { n : "BOF" , f : parse _BOF } , 2058 : { n : "OleDbConn" , f : parse _OleDbConn } , 2059 : { n : "WOpt" , f : parse _WOpt } , 2060 : { n : "SXViewEx" , f : parse _SXViewEx } , 2061 : { n : "SXTH" , f : parse _SXTH } , 2062 : { n : "SXPIEx" , f : parse _SXPIEx } , 2063 : { n : "SXVDTEx" , f : parse _SXVDTEx } , 2064 : { n : "SXViewEx9" , f : parse _SXViewEx9 } , 2066 : { n : "ContinueFrt" , f : parse _ContinueFrt } , 2067 : { n : "RealTimeData" , f : parse _RealTimeData } , 2128 : { n : "ChartFrtInfo" , f : parse _ChartFrtInfo } , 2129 : { n : "FrtWrapper" , f : parse _FrtWrapper } , 2130 : { n : "StartBlock" , f : parse _StartBlock } , 2131 : { n : "EndBlock" , f : parse _EndBlock } , 2132 : { n : "StartObject" , f : parse _StartObject } , 2133 : { n : "EndObject" , f : parse _EndObject } , 2134 : { n : "CatLab" , f : parse _CatLab } , 2135 : { n : "YMult" , f : parse _YMult } , 2136 : { n : "SXViewLink" , f : parse _SXViewLink } , 2137 : { n : "PivotChartBits" , f : parse _PivotChartBits } , 2138 : { n : "FrtFontList" , f : parse _FrtFontList } , 2146 : { n : "SheetExt" , f : parse _SheetExt } , 2147 : { n : "BookExt" , f : parse _BookExt , r : 12 } , 2148 : { n : "SXAddl" , f : parse _SXAddl } , 2149 : { n : "CrErr" , f : parse _CrErr } , 2150 : { n : "HFPicture" , f : parse _HFPicture } , 2151 : { n : "FeatHdr" , f : parse _FeatHdr } , 2152 : { n : "Feat" , f : parse _Feat } , 2154 : { n : "DataLabExt" , f : parse _DataLabExt } , 2155 : { n : "DataLabExtContents" , f : parse _DataLabExtContents } , 2156 : { n : "CellWatch" , f : parse _CellWatch } , 2161 : { n : "FeatHdr11" , f : parse _FeatHdr11 } , 2162 : { n : "Feature11" , f : parse _Feature11 } , 2164 : { n : "DropDownObjIds" , f : parse _DropDownObjIds } , 2165 : { n : "ContinueFrt11" , f : parse _ContinueFrt11 } , 2166 : { n : "DConn" , f : parse _DConn } , 2167 : { n : "List12" , f : parse _List12 } , 2168 : { n : "Feature12" , f : parse _Feature12 } , 2169 : { n : "CondFmt12" , f : parse _CondFmt12 } , 2170 : { n : "CF12" , f : parse _CF12 } , 2171 : { n : "CFEx" , f : parse _CFEx } , 2172 : { n : "XFCRC" , f : parse _XFCRC , r : 12 } , 2173 : { n : "XFExt" , f : parse _XFExt , r : 12 } , 2174 : { n : "AutoFilter12" , f : parse _AutoFilter12 } , 2175 : { n : "ContinueFrt12" , f : parse _ContinueFrt12 } , 2180 : { n : "MDTInfo" , f : parse _MDTInfo } , 2181 : { n : "MDXStr" , f : parse _MDXStr } , 2182 : { n : "MDXTuple" , f : parse _MDXTuple } , 2183 : { n : "MDXSet" , f : parse _MDXSet } , 2184 : { n : "MDXProp" , f : parse _MDXProp } , 2185 : { n : "MDXKPI" , f : parse _MDXKPI } , 2186 : { n : "MDB" , f : parse _MDB } , 2187 : { n : "PLV" , f : parse _PLV } , 2188 : { n : "Compat12" , f : parse _Compat12 , r : 12 } , 2189 : { n : "DXF" , f : parse _DXF } , 2190 : { n : "TableStyles" , f : parse _TableStyles , r : 12 } , 2191 : { n : "TableStyle" , f : parse _TableStyle } , 2192 : { n : "TableStyleElement" , f : parse _TableStyleElement } , 2194 : { n : "StyleExt" , f : parse _StyleExt } , 2195 : { n : "NamePublish" , f : parse _NamePublish } , 2196 : { n : " Name
return o . join ( "" ) } } ( ) ; function write _ods ( wb , opts ) { if ( opts . bookType == "fods" ) return write _content _ods ( wb , opts ) ; var zip = new jszip ; var f = "" ; var manifest = [ ] ; var rdf = [ ] ; f = "mimetype" ; zip . file ( f , "application/vnd.oasis.opendocument.spreadsheet" ) ; f = "content.xml" ; zip . file ( f , write _content _ods ( wb , opts ) ) ; manifest . push ( [ f , "text/xml" ] ) ; rdf . push ( [ f , "ContentFile" ] ) ; f = "styles.xml" ; zip . file ( f , write _styles _ods ( wb , opts ) ) ; manifest . push ( [ f , "text/xml" ] ) ; rdf . push ( [ f , "StylesFile" ] ) ; f = "manifest.rdf" ; zip . file ( f , write _rdf ( rdf , opts ) ) ; manifest . push ( [ f , "application/rdf+xml" ] ) ; f = "meta.xml" ; zip . file ( f , write _meta _ods ( wb , opts ) ) ; manifest . push ( [ f , "text/xml" ] ) ; rdf . push ( [ f , "MetadataFile" ] ) ; f = "META-INF/manifest.xml" ; zip . file ( f , write _manifest ( manifest , opts ) ) ; return zip } function write _obj _str ( factory ) { return function write _str ( wb , o ) { var idx = 0 ; for ( var i = 0 ; i < wb . SheetNames . length ; ++ i ) if ( wb . SheetNames [ i ] == o . sheet ) idx = i ; if ( idx == 0 && ! ! o . sheet && wb . SheetNames [ 0 ] != o . sheet ) throw new Error ( "Sheet not found: " + o . sheet ) ; return factory . from _sheet ( wb . Sheets [ wb . SheetNames [ idx ] ] , o , wb ) } } var write _htm _str = write _obj _str ( HTML _ ) ; var write _csv _str = write _obj _str ( { from _sheet : sheet _to _csv } ) ; var write _slk _str = write _obj _str ( SYLK ) ; var write _dif _str = write _obj _str ( DIF ) ; var write _prn _str = write _obj _str ( PRN ) ; var write _txt _str = write _obj _str ( { from _sheet : sheet _to _txt } ) ; function fix _opts _func ( defaults ) { return function fix _opts ( opts ) { for ( var i = 0 ; i != defaults . length ; ++ i ) { var d = defaults [ i ] ; if ( opts [ d [ 0 ] ] === undefined ) opts [ d [ 0 ] ] = d [ 1 ] ; if ( d [ 2 ] === "n" ) opts [ d [ 0 ] ] = Number ( opts [ d [ 0 ] ] ) } } } var fix _read _opts = fix _opts _func ( [ [ "cellNF" , false ] , [ "cellHTML" , true ] , [ "cellFormula" , true ] , [ "cellStyles" , false ] , [ "cellText" , true ] , [ "cellDates" , false ] , [ "sheetStubs" , false ] , [ "sheetRows" , 0 , "n" ] , [ "bookDeps" , false ] , [ "bookSheets" , false ] , [ "bookProps" , false ] , [ "bookFiles" , false ] , [ "bookVBA" , false ] , [ "password" , "" ] , [ "WTF" , false ] ] ) ; var fix _write _opts = fix _opts _func ( [ [ "cellDates" , false ] , [ "bookSST" , false ] , [ "bookType" , "xlsx" ] , [ "compression" , false ] , [ "WTF" , false ] ] ) ; function get _sheet _type ( n ) { if ( RELS . WS . indexOf ( n ) > - 1 ) return "sheet" ; if ( RELS . CS && n == RELS . CS ) return "chart" ; if ( RELS . DS && n == RELS . DS ) return "dialog" ; if ( RELS . MS && n == RELS . MS ) return "macro" ; if ( ! n || ! n . length ) return "sheet" ; return n } function safe _parse _wbrels ( wbrels , sheets ) { if ( ! wbrels ) return 0 ; try { wbrels = sheets . map ( function pwbr ( w ) { if ( ! w . id ) w . id = w . strRelID ; return [ w . name , wbrels [ "!id" ] [ w . id ] . Target , get _sheet _type ( wbrels [ "!id" ] [ w . id ] . Type ) ] } ) } catch ( e ) { return null } return ! wbrels || wbrels . length === 0 ? null : wbrels } function safe _parse _sheet ( zip , path , relsPath , sheet , sheetRels , sheets , stype , opts , wb , themes , styles ) { try { sheetRels [ sheet ] = parse _rels ( getzipstr ( zip , relsPath , true ) , path ) ; var data = getzipdata ( zip , path ) ; switch ( stype ) { case "sheet" : sheets [ sheet ] = parse _ws ( data , path , opts , sheetRels [ sheet ] , wb , themes , styles ) ; break ; case "chart" : var cs = parse _cs ( data , path , opts , sheetRels [ sheet ] , wb , themes , styles ) ; sheets [ sheet ] = cs ; if ( ! cs || ! cs [ "!chart" ] ) break ; var dfile = resolve _path ( cs [ "!chart" ] . Target , path ) ; var drelsp = get _rels _path ( dfile ) ; var draw = parse _drawing ( getzipstr ( zip , dfile , true ) , parse _rels ( getzipstr ( zip , drelsp , true ) , dfile ) ) ; var chartp = resolve _path ( draw , dfile ) ; var crelsp = get _rels _path ( chartp ) ; cs = parse _chart ( getzipstr ( zip , chartp , true ) , chartp , opts , parse _rels ( getzipstr ( zip , crelsp , true ) , chartp ) , wb , cs ) ; break ; case "macro" : sheets [ sheet ] = parse _ms ( data , path , opts , sheetRels [ sheet ] , wb , themes , styles ) ; break ; case "dialog" : sheets [ sheet ] = parse _ds ( data , path , opts , sheetRels [ sheet ] , wb , themes , styles ) ; break ; } } catch ( e ) { if ( opts . WTF ) throw e } } var nodirs = function nodirs ( x ) { return x . slice ( - 1 ) != "/" } ; function parse _zip ( zip , opts ) { make _ssf ( SSF ) ; opts = opts || { } ; fix _read _opts ( opts ) ; reset _cp ( ) ; if ( safegetzipfile ( zip , "META-INF/manifest.xml" ) ) return parse _ods ( zip , opts ) ; if ( safegetzipfile ( zip , "objectdata.xml" ) ) return parse _ods ( zip , opts ) ; var entries = keys ( zip . files ) . filter ( nodirs ) . sort ( ) ; var dir = parse _ct ( getzipstr ( zip , "[Content_Types].xml" ) , opts ) ; var xlsb = false ; var sheets , binname ; if ( dir . workbooks . length === 0 ) { binname = "xl/workbook.xml" ; if ( getzipdata ( zip , binname , true ) ) dir . workbooks . push ( binname ) } if ( dir . workbooks . length === 0 ) { binname = "xl/workbook.bin" ; if ( ! getzipfile ( zip , binname , true ) ) throw new