PageSourceSearch

https://sharechess.github.io/assets/WebM.13faa943.js

js sharechess.github.io collected 2026-10-03 09:56:15 UTC 11,509 bytes, 1 lines download raw bytes

1var H={exports:{}};(function(M){(function(){function f(t,i){let e={};return[t,i].forEach(function(n){for(let u in n)Object.prototype.hasOwnProperty.call(n,u)&&(e[u]=n[u])}),e}function a(t){if(typeof t!="string"||!t.match(/^data:image\/webp;base64,/i))throw new Error("Failed to decode WebP Base64 URL");return window.atob(t.substring(23))}function o(t,i){let e=typeof t=="string"&&/^data:image\/webp/.test(t)?t:t.toDataURL("image/webp",i);return a(e)}function c(t){let i=t.charCodeAt(0),e=t.charCodeAt(1),n=t.charCodeAt(2),u=t.charCodeAt(3);return(i|e<<8|n<<16|u<<24)>>>0}function y(t){let i=t.indexOf("VP8",12);if(i===-1)throw new Error("Bad image format, does this browser support WebP?");let e=!1;for(;i<t.length-8;){let n,u;switch(u=t.substring(i,i+4),i+=4,n=c(t.substring(i,i+4)),i+=4,u){case"VP8 ":return{frame:t.substring(i,i+n),hasAlpha:e};case"ALPH":e=!0;break}i+=n,(n&1)!==0&&i++}throw new Error("Failed to find VP8 keyframe in WebP image, is this image mistakenly encoded in the Lossless WebP format?")}const E=-1,A=-2;function T(t){this.value=t}function L(t){this.value=t}function m(t,i,e){if(Array.isArray(e))for(let n=0;n<e.length;n++)m(t,i,e[n]);else if(typeof e=="string")t.writeString(e);else if(e instanceof Uint8Array)t.writeBytes(e);else if(e.id)if(e.offset=t.pos+i,t.writeUnsignedIntBE(e.id),Array.isArray(e.data)){let n,u,p;e.size===E?t.writeByte(255):e.size===A?(n=t.pos,t.writeBytes([15,255,255,255,255])):(n=t.pos,t.writeBytes([0,0,0,0])),u=t.pos,e.dataOffset=u+i,m(t,i,e.data),e.size!==E&&e.size!==A&&(p=t.pos,e.size=p-u,t.seek(n),t.writeEBMLVarIntWidth(e.size,4),t.seek(p))}else if(typeof e.data=="string")t.writeEBMLVarInt(e.data.length),e.dataOffset=t.pos+i,t.writeString(e.data);else if(typeof e.data=="number")e.size||(e.size=t.measureUnsignedInt(e.data)),t.writeEBMLVarInt(e.size),e.dataOffset=t.pos+i,t.writeUnsignedIntBE(e.data,e.size);else if(e.data instanceof L)t.writeEBMLVarInt(8),e.dataOffset=t.pos+i,t.writeDoubleBE(e.data.value);else if(e.data instanceof T)t.writeEBMLVarInt(4),e.dataOffset=t.pos+i,t.writeFloatBE(e.data.value);else if(e.data instanceof Uint8Array)t.writeEBMLVarInt(e.data.byteLength),e.dataOffset=t.pos+i,t.writeBytes(e.data);else throw new Error("Bad EBML datatype "+typeof e.data);else throw new Error("Bad EBML datatype "+typeof e.data)}let l=function(t,i){return function(e){let n=5e3,u=1,p=!1,C=0,W=0,g=null,F=null,U=null,x=[],V=0,N=0,j={quality:.95,transparent:!1,alphaQuality:void 0,fileWriter:null,fd:null,frameDuration:null,frameRate:null},P={Cues:{id:new Uint8Array([28,83,187,107]),positionEBML:null},SegmentInfo:{id:new Uint8Array([21,73,169,102]),positionEBML:null},Tracks:{id:new Uint8Array([22,84,174,107]),positionEBML:null}},I,v={id:17545,data:new L(0)},k,S=[],h=new i(e.fileWriter||e.fd);function z(r){return r-I.dataOffset}function Q(r){(g===null||g.width!==r.width||g.height!==r.height)&&(g=document.createElement("canvas"),g.width=r.width,g.height=r.height,F=g.getContext("2d"),U=F.createImageData(g.width,g.height));let s=r.getContext("2d"),w=s.getImageData(0,0,r.width,r.height).data,d=U.data,B=0,D=r.width*r.height*4;for(let b=3;b<D;b+=4){let O=w[b];d[B++]=O,d[B++]=O,d[B++]=O,d[B++]=255}return F.putImageData(U,0,0),g}function G(){let r={id:21420,size:5,data:0},s={id:290298740,data:[]};for(let w in P){let d=P[w];d.positionEBML=Object.create(r),s.data.push({id:19899,data:[{id:21419,data:d.id},d.positionEBML]})}return s}function R(){k=G();let r={id:440786851,data:[{id:17030,data:1},{id:17143,data:1},{id:17138,data:4},{id:17139,data:8},{id:17026,data:"webm"},{id:17031,data:2},{id:17029,data:2}]},s={id:357149030,data:[{id:2807729,data:1e6},{id:19840,data:"webm-writer-js"},{id:22337,data:"webm-writer-js"},v]},w=[{id:176,data:C},{id:186,data:W}];e.transparent&&w.push({id:21440,data:1});let d={id:374648427,data:[{id:174,data:[{id:215,data:u},{id:29637,data:u},{id:156,data:0},{id:2274716,data:"und"},{id:134,data:"V_VP8"},{id:2459272,data:"VP8"},{id:131,data:1},{id:224,data:w}]}]};I={id:408125543,size:A,data:[k,s,d]};let B=new t(256);m(B,h.pos,[r,I]),h.write(B.getAsDataArray()),P.SegmentInfo.positionEBML.data=z(s.offset),P.Tracks.positionEBML.data=z(d.offset),p=!0}function Z(r){let s,w,d=new t(4);if(!(r.trackNumber>0&&r.trackNumber<127))throw new Error("TrackNumber must be > 0 and < 127");return d.writeEBMLVarInt(r.trackNumber),d.writeU16BE(r.timecode),d.writeByte(0),s={id:161,data:[d.getAsDataArray(),r.frame]},w={id:30113,data:[{id:166,data:[{id:238,data:1},{id:165,data:r.alpha}]}]},{id:160,data:[s,w]}}function X(r){let s=new t(4);if(!(r.trackNumber>0&&r.trackNumber<127))throw new Error("TrackNumber must be > 0 and < 127");return s.writeEBMLVarInt(r.trackNumber),s.writeU16BE(r.timecode),s.writeByte(1<<7),{id:163,data:[s.getAsDataArray(),r.frame]}}function Y(r){return r.alpha?Z(r):X(r)}function $(r){return{id:524531317,data:[{id:231,data:Math.round(r.timecode)}]}}function J(r,s,w){S.push({id:187,data:[{id:179,data:s},{id:183,data:[{id:247,data:r},{id:241,data:z(w)}]}]})}function tt(){let r={id:475249515,data:S},s=new t(16+S.length*32);m(s,h.pos,r),h.write(s.getAsDataArray()),P.Cues.positionEBML.data=z(r.offset)}function _(){if(x.length===0)return;let r=0;for(let d=0;d<x.length;
1d++)r+=x[d].frame.length+(x[d].alpha?x[d].alpha.length:0);let s=new t(r+x.length*64),w=$({timecode:Math.round(V)});for(let d=0;d<x.length;d++)w.data.push(Y(x[d]));m(s,h.pos,w),h.write(s.getAsDataArray()),J(u,Math.round(V),w.offset),x=[],V+=N,N=0}function et(){if(!e.frameDuration)if(e.frameRate)e.frameDuration=1e3/e.frameRate;else throw new Error("Missing required frameDuration or frameRate setting");e.quality=Math.max(Math.min(e.quality,.99999),0),e.alphaQuality===void 0?e.alphaQuality=e.quality:e.alphaQuality=Math.max(Math.min(e.alphaQuality,.99999),0)}function at(r){r.trackNumber=u,r.timecode=Math.round(N),x.push(r),N+=r.duration,N>=n&&_()}function rt(){let r=new t(k.size),s=h.pos;m(r,k.dataOffset,k.data),h.seek(k.dataOffset),h.write(r.getAsDataArray()),h.seek(s)}function it(){let r=new t(8),s=h.pos;r.writeDoubleBE(V),h.seek(v.dataOffset),h.write(r.getAsDataArray()),h.seek(s)}function nt(){let r=new t(10),s=h.pos;r.writeUnsignedIntBE(I.id),r.writeEBMLVarIntWidth(h.pos-I.dataOffset,5),h.seek(I.offset),h.write(r.getAsDataArray()),h.seek(s)}this.addFrame=function(r,s,w){p||(C=r.width||0,W=r.height||0,R());let d=y(o(r,e.quality)),B,D=null;w?B=w:typeof s=="number"?B=s:B=e.frameDuration,e.transparent&&(s instanceof HTMLCanvasElement||typeof s=="string"?D=s:d.hasAlpha&&(D=Q(r))),at({frame:d.frame,duration:B,alpha:D?y(o(D,e.alphaQuality)).frame:null})},this.complete=function(){return p||R(),_(),tt(),rt(),it(),nt(),h.complete("video/webm")},this.getWrittenSize=function(){return h.length},e=f(j,e||{}),et()}};M.exports=l})()})(H);var q={exports:{}};(function(M){(function(){let f=function(a){this.data=new Uint8Array(a),this.pos=0};f.prototype.seek=function(a){this.pos=a},f.prototype.writeBytes=function(a){for(let o=0;o<a.length;o++)this.data[this.pos++]=a[o]},f.prototype.writeByte=function(a){this.data[this.pos++]=a},f.prototype.writeU8=f.prototype.writeByte,f.prototype.writeU16BE=function(a){this.data[this.pos++]=a>>8,this.data[this.pos++]=a},f.prototype.writeDoubleBE=function(a){let o=new Uint8Array(new Float64Array([a]).buffer);for(let c=o.length-1;c>=0;c--)this.writeByte(o[c])},f.prototype.writeFloatBE=function(a){let o=new Uint8Array(new Float32Array([a]).buffer);for(let c=o.length-1;c>=0;c--)this.writeByte(o[c])},f.prototype.writeString=function(a){for(let o=0;o<a.length;o++)this.data[this.pos++]=a.charCodeAt(o)},f.prototype.writeEBMLVarIntWidth=function(a,o){switch(o){case 1:this.writeU8(1<<7|a);break;case 2:this.writeU8(1<<6|a>>8),this.writeU8(a);break;case 3:this.writeU8(1<<5|a>>16),this.writeU8(a>>8),this.writeU8(a);break;case 4:this.writeU8(1<<4|a>>24),this.writeU8(a>>16),this.writeU8(a>>8),this.writeU8(a);break;case 5:this.writeU8(1<<3|a/4294967296&7),this.writeU8(a>>24),this.writeU8(a>>16),this.writeU8(a>>8),this.writeU8(a);break;default:throw new Error("Bad EBML VINT size "+o)}},f.prototype.measureEBMLVarInt=function(a){if(a<(1<<7)-1)return 1;if(a<(1<<14)-1)return 2;if(a<(1<<21)-1)return 3;if(a<(1<<28)-1)return 4;if(a<34359738367)return 5;throw new Error("EBML VINT size not supported "+a)},f.prototype.writeEBMLVarInt=function(a){this.writeEBMLVarIntWidth(a,this.measureEBMLVarInt(a))},f.prototype.writeUnsignedIntBE=function(a,o){switch(o===void 0&&(o=this.measureUnsignedInt(a)),o){case 5:this.writeU8(Math.floor(a/4294967296));case 4:this.writeU8(a>>24);case 3:this.writeU8(a>>16);case 2:this.writeU8(a>>8);case 1:this.writeU8(a);break;default:throw new Error("Bad UINT size "+o)}},f.prototype.measureUnsignedInt=function(a){return a<1<<8?1:a<1<<16?2:a<1<<24?3:a<4294967296?4:5},f.prototype.getAsDataArray=function(){if(this.pos<this.data.byteLength)return this.data.subarray(0,this.pos);if(this.pos==this.data.byteLength)return this.data;throw new Error("ArrayBufferDataStream's pos lies beyond end of buffer")},M.exports=f})()})(q);var K={exports:{}};(function(M){(function(){let f=function(a){return function(o){let c=[],y=Promise.resolve(),E=null,A=null;o&&o.constructor.name==="FileWriter"?E=o:a&&o&&(A=o),this.pos=0,this.length=0;function T(l){return new Promise(function(t,i){let e=new FileReader;e.addEventListener("loadend",function(){t(e.result)}),e.readAsArrayBuffer(l)})}function L(l){return new Promise(function(t,i){l instanceof Uint8Array?t(l):l instanceof ArrayBuffer||ArrayBuffer.isView(l)?t(new Uint8Array(l)):l instanceof Blob?t(T(l).then(function(e){return new Uint8Array(e)})):t(T(new Blob([l])).then(function(e){return new Uint8Array(e)}))})}function m(l){let t=l.byteLength||l.length||l.size;if(!Number.isInteger(t))throw new Error("Failed to determine size of element");return t}this.seek=function(l){if(l<0)throw new Error("Offset may not be negative");if(isNaN(l))throw new Error("Offset may not be NaN");if(l>this.length)throw new Error("Seeking beyond the end of file is not allowed");this.pos=l},this.write=function(l){let t={offset:this.pos,data:l,length:m(l)},i=t.offset>=this.length;this.pos+=t.length,this.length=Math.max(this.length,this.pos),y=y.then(function(){if(A)return new Promise(function(e,n){L(t.data).then(function(u){let p=0,C=Buffer.from(u.buffer),W=function(g,F,U){p+=F,p>=U.length?e():a.write(A,U,p,U.length-p,t.offset+p,W)};a.write(A,C,0,C.length,t.offset,W)})});if(E)return new Promise(function(e,n){E.onwriteend=e,E.seek(t.offset),E.write(new Blob([t.data]))});if(!i)for(let e=0;e<c.length;e++){let n=c[e];if(!(t.offset+t.length<=n.offset||t.offset>=n.offset+n.length)){if(t.offset<n.offset||t.offset+t.length>n.offset+n.length)throw new Error("Overwrite crosses blob boundaries");if(t.offset==n.offset&&t.length==n.length){n.data=t.data;return}else return L(n.data).then(function(u){return n.data=u,L(t.data)}).then(function(u){t.data=u,n.data.set(t.data,t.offset-n.offset)})}}c.push(t)})},this.complete=function(l){return A||E?y=y.then(function(){return null}):y=y.then(function(){let t=[];for(let i=0;i<c.length;i++)t.push(c[i].data);return new Blob(t,{type:l})}),y}}};M.exports=f})()})(K);
1var st=H.exports(q.exports,K.exports(null));class ot{constructor(f=1e3){this.frameTime=f,this.video=new st({quality:.8,fileWriter:null,fd:null,frameDuration:1e3,transparent:!1})}video;add(f,a){const o=f.canvas;this.video.addFrame(o,a*this.frameTime)}async render(){const f=await this.video.complete(),a=Date.now();return new File([f],`board_${a}.webm`,{type:"video/webm",lastModified:a})}}export{ot as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.