@zigbang/honeyfarm-node
Version:
## Raspberry Pi HoneyFarm Node ### Setup && Run
12 lines • 8.7 kB
JavaScript
!function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){var i,r=(i="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t){(t=t||{})||(t=void 0!==t?t:{});var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);var r,o=[],u="";u=self.location.href,i&&(u=i),u=0!==u.indexOf("blob:")?u.substr(0,u.lastIndexOf("/")+1):"",r=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)};var a,s,l=t.print||console.log.bind(console),c=t.printErr||console.warn.bind(console);for(e in n)n.hasOwnProperty(e)&&(t[e]=n[e]);n=null,t.arguments&&(o=t.arguments),t.thisProgram&&t.thisProgram,t.quit&&t.quit,t.wasmBinary&&(a=t.wasmBinary),t.noExitRuntime&&t.noExitRuntime,"object"!=typeof WebAssembly&&c("no native wasm support detected");var f,d,h,p,y,m,b,g=new WebAssembly.Table({initial:1,maximum:1,element:"anyfunc"}),_=!1;function v(e){f=e,t.HEAP8=d=new Int8Array(e),t.HEAP16=p=new Int16Array(e),t.HEAP32=y=new Int32Array(e),t.HEAPU8=h=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=new Uint32Array(e),t.HEAPF32=m=new Float32Array(e),t.HEAPF64=b=new Float64Array(e)}var w=t.INITIAL_MEMORY||16777216;
/**
* @license
* Copyright 2019 The Emscripten Authors
* SPDX-License-Identifier: MIT
*/
function R(e){for(;e.length>0;){var n=e.shift();if("function"!=typeof n){var i=n.func;"number"==typeof i?void 0===n.arg?t.dynCall_v(i):t.dynCall_vi(i,n.arg):i(void 0===n.arg?null:n.arg)}else n(t)}}(s=t.wasmMemory?t.wasmMemory:new WebAssembly.Memory({initial:w/65536,maximum:32768}))&&(f=s.buffer),w=f.byteLength,v(f),y[2188]=5251792;var A=[],H=[],M=[],P=[],I=0,S=null,E=null;function O(e){throw t.onAbort&&t.onAbort(e),l(e+=""),c(e),_=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}
/**
* @license
* Copyright 2017 The Emscripten Authors
* SPDX-License-Identifier: MIT
*/function W(t){return e=t,n="data:application/octet-stream;base64,",String.prototype.startsWith?e.startsWith(n):0===e.indexOf(n);var e,n}t.preloadedImages={},t.preloadedAudios={};var x,T="TinyH264.wasm";function U(){try{if(a)return new Uint8Array(a);if(r)return r(T);throw"both async and sync fetching of the wasm failed"}catch(t){O(t)}}function D(t){try{return s.grow(t-f.byteLength+65535>>>16),v(s.buffer),1}catch(t){}}W(T)||(x=T,T=t.locateFile?t.locateFile(x,u):u+x),H.push({func:function(){L()}});var j={a:function(t,e,n){h.copyWithin(t,e,e+n)},b:function(t){t>>>=0;var e=h.length;if(t>2147483648)return!1;for(var n,i,r=1;r<=4;r*=2){var o=e*(1+.2/r);if(o=Math.min(o,t+100663296),D(Math.min(2147483648,((n=Math.max(16777216,t,o))%(i=65536)>0&&(n+=i-n%i),n))))return!0}return!1},memory:s,table:g},F=function(){var e={a:j};function n(e,n){var i=e.exports;t.asm=i,function(e){if(I--,t.monitorRunDependencies&&t.monitorRunDependencies(I),0==I&&(null!==S&&(clearInterval(S),S=null),E)){var n=E;E=null,n()}}()}function i(t){n(t.instance)}function r(t){return(a||"function"!=typeof fetch?new Promise((function(t,e){t(U())})):fetch(T,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+T+"'";return t.arrayBuffer()})).catch((function(){return U()}))).then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(t){c("failed to asynchronously prepare wasm: "+t),O(t)}))}if(I++,t.monitorRunDependencies&&t.monitorRunDependencies(I),t.instantiateWasm)try{return t.instantiateWasm(e,n)}catch(t){return c("Module.instantiateWasm callback failed with error: "+t),!1}return function(){if(a||"function"!=typeof WebAssembly.instantiateStreaming||W(T)||"function"!=typeof fetch)return r(i);fetch(T,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(i,(function(t){c("wasm streaming compile failed: "+t),c("falling back to ArrayBuffer instantiation"),r(i)}))}))}(),{}}();t.asm=F;var B,L=t.___wasm_call_ctors=function(){return(L=t.___wasm_call_ctors=t.asm.c).apply(null,arguments)};function z(e){function n(){B||(B=!0,t.calledRun=!0,_||(R(H),R(M),t.onRuntimeInitialized&&t.onRuntimeInitialized(),function(){if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;)e=t.postRun.shift(),P.unshift(e);var e;R(P)}()))}e=e||o,I>0||(function(){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)e=t.preRun.shift(),A.unshift(e);var e;R(A)}(),I>0||(t.setStatus?(t.setStatus("Running..."),setTimeout((function(){setTimeout((function(){t.setStatus("")}),1),n()}),1)):n()))}if(t._h264bsdInit=function(){return(t._h264bsdInit=t.asm.d).apply(null,arguments)},t._malloc=function(){return(t._malloc=t.asm.e).apply(null,arguments)},t._free=function(){return(t._free=t.asm.f).apply(null,arguments)},t._h264bsdDecode=function(){return(t._h264bsdDecode=t.asm.g).apply(null,arguments)},t._h264bsdShutdown=function(){return(t._h264bsdShutdown=t.asm.h).apply(null,arguments)},t._h264bsdAlloc=function(){return(t._h264bsdAlloc=t.asm.i).apply(null,arguments)},t._h264bsdFree=function(){return(t._h264bsdFree=t.asm.j).apply(null,arguments)},t.asm=F,t.getValue=function(t,e,n){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return d[t>>0];case"i16":return p[t>>1];case"i32":case"i64":return y[t>>2];case"float":return m[t>>2];case"double":return b[t>>3];default:O("invalid type for getValue: "+e)}return null},t.then=function(e){if(B)e(t);else{var n=t.onRuntimeInitialized;t.onRuntimeInitialized=function(){n&&n(),e(t)}}return t},E=function t(){B||z(),B||(E=t)},t.run=z,t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return z(),t});t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(2).init()},function(t,e,n){"use strict";n.r(e),n.d(e,"init",(function(){return l}));var i=function(){function t(t,e){this.tinyH264Module=t,this.onPictureReady=e,this.pStorage=this.tinyH264Module._h264bsdAlloc(),this.pWidth=this.tinyH264Module._malloc(4),this.pHeight=this.tinyH264Module._malloc(4),this.pPicture=this.tinyH264Module._malloc(4),this._decBuffer=this.tinyH264Module._malloc(1048576),this.tinyH264Module._h264bsdInit(this.pStorage,0)}var e=t.prototype;return e.release=function(){var t=this.pStorage;0!==t&&(this.tinyH264Module._h264bsdShutdown(t),this.tinyH264Module._h264bsdFree(t)),this.tinyH264Module._free(this.pWidth),this.tinyH264Module._free(this.pHeight),this.tinyH264Module._free(this.pPicture),this.pStorage=0,this.pWidth=0,this.pHeight=0},e.decode=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),this.tinyH264Module.HEAPU8.set(e,this._decBuffer),this.tinyH264Module._h264bsdDecode(this.pStorage,this._decBuffer,e.byteLength,this.pPicture,this.pWidth,this.pHeight)===t.PIC_RDY){var n=this.tinyH264Module.getValue(this.pWidth,"i32"),i=this.tinyH264Module.getValue(this.pHeight,"i32"),r=this.tinyH264Module.getValue(this.pPicture,"i8*"),o=new Uint8Array(this.tinyH264Module.HEAPU8.subarray(r,r+n*i*3/2));this.onPictureReady(o,n,i)}},t}();i.RDY=0,i.PIC_RDY=1,i.HDRS_RDY=2,i.ERROR=3,i.PARAM_SET_ERROR=4,i.MEMALLOC_ERROR=5;var r=i,o=n(0),u=n.n(o),a={"TinyH264.wasm":n.p+"TinyH264.wasm"},s={};function l(){var t=u()({locateFile:function(t){return a[t]}});return function(t){return new Promise((function(e){t.calledRun?e():t.onRuntimeInitialized=function(){return e()}}))}(t).then((function(){self.addEventListener("message",(function(e){var n=e.data,i=n.renderStateId;switch(n.type){case"decode":var o=s[i];o||(o=new r(t,(function(t,e,n){postMessage({type:"pictureReady",width:e,height:n,renderStateId:i,data:t.buffer},[t.buffer])})),s[i]=o),o.decode(new Uint8Array(n.data,n.offset,n.length));break;case"release":var u=s[i];u&&(u.release(),delete s[i])}})),self.postMessage({type:"decoderReady"})}))}}]);