@liascript/exporter
Version:
A generic exporter for LiaScript
1 lines • 2.07 kB
JavaScript
!function(e,t,n,o,r){var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i="function"==typeof s[o]&&s[o],u=i.cache||{},a="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(t,n){if(!u[t]){if(!e[t]){var r="function"==typeof s[o]&&s[o];if(!n&&r)return r(t,!0);if(i)return i(t,!0);if(a&&"string"==typeof t)return a(t);var f=new Error("Cannot find module '"+t+"'");throw f.code="MODULE_NOT_FOUND",f}d.resolve=function(n){var o=e[t][1][n];return null!=o?o:n},d.cache={};var l=u[t]=new c.Module(t);e[t][0].call(l.exports,d,l,l.exports,this)}return u[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:c(t)}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.exports={}},c.modules=e,c.cache=u,c.parent=i,c.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(c,"root",{get:function(){return s[o]}}),s[o]=c;for(var f=0;f<t.length;f++)c(t[f]);if(n){var l=c(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd&&define((function(){return l}))}}({"1H1Vb":[function(require,module,exports){function liaExecCode(event){setTimeout((()=>{const send={lia:execute_response(event,"exec"),output:execute_response(event,"async"),wait:()=>{execute_response(event)("LIA: wait")},stop:()=>{execute_response(event)("LIA: stop")},clear:()=>{execute_response(event)("LIA: clear")},html:e=>{execute_response(event)("HTML: "+e)},liascript:e=>{execute_response(event)("LIASCRIPT: "+e)}};try{const result=eval(event.message.param.code);send.lia(void 0===result?"LIA: stop":result)}catch(e){console.warn("exec => ",e.message),send.lia(e.message,!1,[])}}),event.message.param.delay)}function execute_response(e,t){return(n,o=!0,r=[])=>{"string"!=typeof n&&(n=JSON.stringify(n)),t&&(e.message.cmd=t),e.message.param={ok:o,result:n,details:r},postMessage(e)}}onmessage=e=>{liaExecCode(e.data)}},{}]},["1H1Vb"],"1H1Vb","parcelRequire55a5");