js-wmf/dist/wmf.node.js

2 lines
17 KiB
JavaScript
Raw Normal View History

2020-03-01 04:55:36 +00:00
/*! wmf.js (C) 2020-present SheetJS LLC -- https://sheetjs.com */
module.exports=function(r){var i={};function a(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,a),e.l=!0,e.exports}return a.m=r,a.c=i,a.d=function(t,e,r){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)a.d(r,i,function(t){return e[t]}.bind(null,i));return r},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=2)}([function(t,s,e){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r,c=!("undefined"==typeof Buffer||"undefined"==typeof process||void 0===process.versions||!process.versions.node);if(s.has_buf=c,s.Buffer_from=r,"undefined"!=typeof Buffer){var i=!Buffer.from;if(!i)try{Buffer.from("foo","utf8")}catch(t){i=!0}s.Buffer_from=r=i?function(t,e){return e?new Buffer(t,e):new Buffer(t)}:Buffer.from.bind(Buffer),Buffer.alloc||(Buffer.alloc=function(t){return new Buffer(t)}),Buffer.allocUnsafe||(Buffer.allocUnsafe=function(t){return new Buffer(t)})}s.new_raw_buf=function(t){return c?Buffer.alloc(t):new Array(t)},s.new_unsafe_buf=function(t){return c?Buffer.allocUnsafe(t):new Array(t)},s._chr=function(t){return String.fromCharCode(t)},s.chr0=/\u0000/g,s.chr1=/[\u0001-\u0006]/g;var u,a,l=function(t,e){return t[e]},d=function(t,e){return 256*t[e+1]+t[e]},_=function(t,e){var r=256*t[e+1]+t[e];return r<32768?r:-1*(65535-r+1)},p=function(t,e){return t[e+3]*(1<<24)+(t[e+2]<<16)+(t[e+1]<<8)+t[e]},E=function(t,e){return t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]},g=function(t,e){return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]},b=function(t,e,r){for(var i=[],a=e;a<r;a+=2)i.push(String.fromCharCode(d(t,a)));return i.join("").replace(s.chr0,"")},n=s.__utf16le=b,v=function(t,e,r){for(var i=[],a=e;a<e+r;++a)i.push(("0"+t[a].toString(16)).slice(-2));return i.join("")},f=v,T=function(t,e,r){for(var i=[],a=e;a<r;a++)i.push(String.fromCharCode(l(t,a)));return i.join("")},h=T,S=function(t,e){var r=p(t,e);return 0<r?T(t,e+4,e+4+r-1):""},o=S,M=function(t,e){var r=p(t,e);return 0<r?T(t,e+4,e+4+r-1):""},C=M,w=function(t,e){var r=2*p(t,e);return 0<r?T(t,e+4,e+4+r-1):""},A=w;u=a=function(t,e){var r=p(t,e);return 0<r?b(t,e+4,e+4+r):""};function y(t,e){var r=p(t,e);return 0<r?T(t,e+4,e+4+r):""}function B(t,e){return function(t,e){for(var r=1-2*(t[e+7]>>>7),i=((127&t[e+7])<<4)+(t[e+6]>>>4&15),a=15&t[e+6],s=5;0<=s;--s)a=256*a+t[e+s];return 2047==i?0==a?1/0*r:NaN:(0==i?i=-1022:(i-=1023,a+=Math.pow(2,52)),r*Math.pow(2,i-52)*a)}(t,e)}var m=y,k=B;function O(t,e){var r,i,a,s,n,f="",h=0,o=[];switch(e){case"dbcs":if(n=this.l,c&&Buffer.isBuffer(this))f=this.slice(this.l,this.l+2*t).toString("utf16le");else for(s=0;s<t;++s)f+=String.fromCharCode(d(this,n)),n+=2;t*=2;break;case"utf8":f=T(this,this.l,this.l+t);break;case"utf16le":t*=2,f=b(this,this.l,this.l+t);break;case"wstr":return O.call(this,t,"dbcs");case"lpstr-ansi":f=S(this,this.l),t=4+p(this,this.l);break;case"lpstr-cp":f=M(this,this.l),t=4+p(this,this.l);break;case"lpwstr":f=w(this,this.l),t=4+2*p(this,this.l);break;case"lpp4":t=4+p(this,this.l),f=u(this,this.l),2&t&&(t+=2);break;case"8lpp4":t=4+p(this,this.l),f=m(this,this.l),3&t&&(t+=4-(3&t));break;case"cstr":for(t=0,f="";0!==(i=l(this,this.l+t++));)o.push(String.fromCharCode(i));f=o.join("");break;case"_wstr":for(t=0,f="";0!==(i=d(this,this.l+t));)o.push(String.fromCharCode(i)),t+=2;t+=2,f=o.join("");break;case"dbcs-cont":for(f="",n=this.l,s=0;s<t;++s){if(this.lens&&-1!==this.lens.indexOf(n))return i=l(this,n),this.l=n+1,a=O.call(this,t-s,i?"dbcs-cont":"sbcs-cont"),o.join("")+a;o.push(String.fromCharCode(d(this,n))),n+=2}f=o.join(""),t*=2