fa-toolkit
Version:
a devtool for fast app
1 lines • 12.2 kB
JavaScript
"use strict";var _0x57ee1d=_0x13b0;function _typeof(t){var n=_0x13b0;return(_typeof=n(352)==typeof Symbol&&n(369)==typeof Symbol[n(460)]?function(t){return typeof t}:function(t){var e=n;return t&&"function"==typeof Symbol&&t[e(452)]===Symbol&&t!==Symbol.prototype?e(369):typeof t})(t)}function _regeneratorRuntime(){var f=_0x13b0;_regeneratorRuntime=function(){return c};var c={},t=Object[f(459)],s=t[f(417)],l=Object[f(426)]||function(t,e,n){t[e]=n[f(446)]},e=f(352)==typeof Symbol?Symbol:{},i=e[f(460)]||f(387),n=e[f(405)]||"@@asyncIterator",r=e[f(359)]||"@@toStringTag";function o(t,e,n){return Object[f(426)](t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{o({},"")}catch(t){o=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i,a,c,u,s,o=f,e=e&&e.prototype instanceof v?e:v,e=Object.create(e[o(459)]),r=new j(r||[]);return l(e,o(401),{value:(i=t,a=n,c=r,s=(u=f)(379),function(t,e){var n=u;if("executing"===s)throw new Error(n(367));if(n(361)===s){if(n(412)===t)throw e;return O()}for(c.method=t,c[n(354)]=e;;){var r=c[n(450)];if(r){var o=function t(e,n){var r=f,o=n[r(374)],i=e[r(460)][o];if(void 0===i)return n[r(450)]=null,"throw"===o&&e[r(460)][r(376)]&&(n.method=r(376),n[r(354)]=void 0,t(e,n),r(412)===n[r(374)])||r(376)!==o&&(n[r(374)]=r(412),n[r(354)]=new TypeError("The iterator does not provide a '"+o+"' method")),h;i=p(i,e[r(460)],n.arg);if(r(412)===i.type)return n.method=r(412),n[r(354)]=i[r(354)],n[r(450)]=null,h;var i=i[r(354)];return i?i.done?(n[e[r(458)]]=i[r(446)],n[r(382)]=e[r(398)],r(376)!==n[r(374)]&&(n.method=r(382),n[r(354)]=void 0),n.delegate=null,h):i:(n[r(374)]=r(412),n.arg=new TypeError(r(444)),n.delegate=null,h)}(r,c);if(o){if(o===h)continue;return o}}if("next"===c[n(374)])c[n(348)]=c._sent=c[n(354)];else if(n(412)===c[n(374)]){if("suspendedStart"===s)throw s=n(361),c.arg;c[n(457)](c[n(354)])}else n(376)===c[n(374)]&&c[n(448)](n(376),c[n(354)]);s="executing";o=p(i,a,c);if("normal"===o[n(438)]){if(s=c.done?n(361):n(400),o.arg===h)continue;return{value:o[n(354)],done:c.done}}n(412)===o[n(438)]&&(s="completed",c[n(374)]="throw",c[n(354)]=o[n(354)])}})}),e}function p(t,e,n){var r=f;try{return{type:r(362),arg:t[r(432)](e,n)}}catch(t){return{type:r(412),arg:t}}}c[f(419)]=u;var h={};function v(){}function a(){}function d(){}var b={};o(b,i,function(){return this});e=Object[f(386)],e=e&&e(e(w([])));e&&e!==t&&s.call(e,i)&&(b=e);var _=d[f(459)]=v[f(459)]=Object[f(368)](b);function y(t){var e=f;[e(382),e(412),e(376)][e(434)](function(e){o(t,e,function(t){return this[_0x13b0(401)](e,t)})})}function g(c,u){var e;l(this,"_invoke",{value:function(n,r){function t(){return new u(function(t,e){!function e(t,n,r,o){var i=_0x13b0,t=p(c[t],c,n);if(i(412)!==t[i(438)]){var a=t[i(354)],n=a[i(446)];return n&&i(389)==_typeof(n)&&s[i(432)](n,"__await")?u.resolve(n[i(365)])[i(347)](function(t){e(i(382),t,r,o)},function(t){e(i(412),t,r,o)}):u[i(395)](n)[i(347)](function(t){a[i(446)]=t,r(a)},function(t){return e("throw",t,r,o)})}o(t[i(354)])}(n,r,t,e)})}return e=e?e[_0x13b0(347)](t,t):t()}})}function m(t){var e=f,n={tryLoc:t[0]};1 in t&&(n[e(402)]=t[1]),2 in t&&(n.finallyLoc=t[2],n[e(435)]=t[3]),this[e(356)][e(364)](n)}function x(t){var e=f,n=t[e(378)]||{};n[e(438)]=e(362),delete n[e(354)],t.completion=n}function j(t){var e=f;this[e(356)]=[{tryLoc:e(403)}],t[e(434)](m,this),this[e(371)](!0)}function w(n){var r=f;if(n){var t=n[i];if(t)return t[r(432)](n);if(r(352)==typeof n[r(382)])return n;if(!isNaN(n[r(355)])){var o=-1,t=function t(){for(var e=r;++o<n[e(355)];)if(s.call(n,o))return t[e(446)]=n[o],t[e(456)]=!1,t;return t[e(446)]=void 0,t[e(456)]=!0,t};return t[r(382)]=t}}return{next:O}}function O(){return{value:void 0,done:!0}}return a[f(459)]=d,l(_,"constructor",{value:d,configurable:!0}),l(d,f(452),{value:a,configurable:!0}),a[f(393)]=o(d,r,f(385)),c[f(383)]=function(t){var e=f,t="function"==typeof t&&t[e(452)];return!!t&&(t===a||"GeneratorFunction"===(t.displayName||t[e(396)]))},c[f(350)]=function(t){var e=f;return Object[e(363)]?Object.setPrototypeOf(t,d):(t[e(397)]=d,o(t,r,e(385))),t[e(459)]=Object[e(368)](_),t},c.awrap=function(t){return{__await:t}},y(g[f(459)]),o(g[f(459)],n,function(){return this}),c.AsyncIterator=g,c.async=function(t,e,n,r,o){var i=f;void 0===o&&(o=Promise);var a=new g(u(t,e,n,r),o);return c[i(383)](e)?a:a[i(382)]()[i(347)](function(t){var e=i;return t.done?t[e(446)]:a[e(382)]()})},y(_),o(_,r,f(351)),o(_,i,function(){return this}),o(_,"toString",function(){return f(380)}),c.keys=function(t){var e,r=f,o=Object(t),i=[];for(e in o)i.push(e);return i[r(399)](),function t(){for(var e=r;i[e(355)];){var n=i[e(404)]();if(n in o)return t.value=n,t[e(456)]=!1,t}return t[e(456)]=!0,t}},c.values=w,j[f(459)]={constructor:j,reset:function(t){var e=f;if(this[e(441)]=0,this[e(382)]=0,this.sent=this[e(442)]=void 0,this[e(456)]=!1,this[e(450)]=null,this[e(374)]=e(382),this[e(354)]=void 0,this[e(356)][e(434)](x),!t)for(var n in this)"t"===n.charAt(0)&&s[e(432)](this,n)&&!isNaN(+n[e(410)](1))&&(this[n]=void 0)},stop:function(){var t=f;this[t(456)]=!0;var e=this[t(356)][0][t(378)];if(t(412)===e[t(438)])throw e[t(354)];return this[t(427)]},dispatchException:function(r){var o=f;if(this[o(456)])throw r;var i=this;function t(t,e){var n=o;return a[n(438)]="throw",a[n(354)]=r,i[n(382)]=t,e&&(i[n(374)]=n(382),i[n(354)]=void 0),!!e}for(var e=this[o(356)][o(355)]-1;0<=e;--e){var n=this[o(356)][e],a=n[o(378)];if("root"===n[o(414)])return t("end");if(n[o(414)]<=this[o(441)]){var c=s[o(432)](n,o(402)),u=s.call(n,o(373));if(c&&u){if(this[o(441)]<n[o(402)])return t(n[o(402)],!0);if(this[o(441)]<n[o(373)])return t(n.finallyLoc)}else if(c){if(this[o(441)]<n[o(402)])return t(n[o(402)],!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this[o(441)]<n[o(373)])return t(n[o(373)])}}}},abrupt:function(t,e){for(var n=f,r=this[n(356)].length-1;0<=r;--r){var o=this[n(356)][r];if(o[n(414)]<=this.prev&&s.call(o,n(373))&&this[n(441)]<o[n(373)]){var i=o;break}}var a=(i=i&&(n(445)===t||"continue"===t)&&i.tryLoc<=e&&e<=i[n(373)]?null:i)?i[n(378)]:{};return a[n(438)]=t,a[n(354)]=e,i?(this[n(374)]=n(382),this[n(382)]=i[n(373)],h):this[n(436)](a)},complete:function(t,e){var n=f;if(n(412)===t[n(438)])throw t[n(354)];return n(445)===t[n(438)]||n(451)===t[n(438)]?this[n(382)]=t[n(354)]:n(376)===t[n(438)]?(this[n(427)]=this.arg=t.arg,this.method=n(376),this[n(382)]=n(372)):"normal"===t[n(438)]&&e&&(this[n(382)]=e),h},finish:function(t){for(var e=f,n=this[e(356)][e(355)]-1;0<=n;--n){var r=this[e(356)][n];if(r[e(373)]===t)return this[e(436)](r[e(378)],r.afterLoc),x(r),h}},catch:function(t){for(var e=f,n=this[e(356)].length-1;0<=n;--n){var r=this.tryEntries[n];if(r[e(414)]===t){var o,i=r.completion;return e(412)===i[e(438)]&&(o=i[e(354)],x(r)),o}}throw new Error(e(428))},delegateYield:function(t,e,n){var r=f;return this[r(450)]={iterator:w(t),resultName:e,nextLoc:n},"next"===this[r(374)]&&(this.arg=void 0),h}},c}function asyncGeneratorStep(t,e,n,r,o,i,a){var c=_0x13b0;try{var u=t[i](a),s=u[c(446)]}catch(t){return void n(t)}u[c(456)]?e(s):Promise[c(395)](s)[c(347)](r,o)}function _asyncToGenerator(u){return function(){var t=this,c=arguments;return new Promise(function(e,n){var r=_0x13b0,o=u[r(390)](t,c);function i(t){asyncGeneratorStep(o,e,n,i,a,r(382),t)}function a(t){asyncGeneratorStep(o,e,n,i,a,r(412),t)}i(void 0)})}}!function(){for(var t=_0x13b0,e=_0x5756();;)try{if(484239==+parseInt(t(407))+parseInt(t(429))/2*(parseInt(t(430))/3)+-parseInt(t(421))/4*(-parseInt(t(391))/5)+parseInt(t(420))/6*(parseInt(t(455))/7)+-parseInt(t(392))/8+-parseInt(t(423))/9*(parseInt(t(357))/10)+parseInt(t(360))/11*(-parseInt(t(439))/12))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();var fs=require("fs"),path=require(_0x57ee1d(416)),util=require(_0x57ee1d(424)),exec=util[_0x57ee1d(422)](require("child_process")[_0x57ee1d(394)]),HARMONY_APP_WRAP=_0x57ee1d(370),HARMONY_PAGE_WRAP=_0x57ee1d(381),isModule=!1;function jsToAbc(t,e,n){return _jsToAbc[_0x57ee1d(390)](this,arguments)}function _jsToAbc(){var t=_0x57ee1d;return(_jsToAbc=_asyncToGenerator(_regeneratorRuntime()[t(350)](function t(n,r,o){var i,a;return _regeneratorRuntime().wrap(function(t){for(var e=_0x13b0;;)switch(t.prev=t[e(382)]){case 0:return t[e(441)]=0,i=getCmd(r,o),t[e(382)]=4,exec(i);case 4:if(a=t[e(348)],a=a[e(453)],(void 0===a?"":a).includes(e(406)))return isModule=!0,t[e(382)]=11,jsToAbc(n,r,o);t[e(382)]=11;break;case 11:t[e(382)]=17;break;case 13:t[e(441)]=13,t.t0=t[e(454)](0),a=e(413)[e(411)](o,"\n"),Object[e(459)][e(377)][e(432)](n)===e(353)?n[e(364)]({message:a}):n[e(418)].push({message:a});case 17:case e(372):return t[e(461)]()}},t,null,[[0,13]])})))[t(390)](this,arguments)}function _0x13b0(t,e){var n=_0x5756();return(_0x13b0=function(t,e){return n[t-=347]})(t,e)}function getCmd(t,e){var n=_0x57ee1d;return n(431)[n(411)](t,'" ').concat(isModule?"-m ":"")[n(411)](e)}function jsBundleWrapper(t,e,n){var r=_0x57ee1d,o=fs[r(437)](t,r(408)),i=t[r(409)](/\bapp\.js$/),e=path[r(349)](e,t)[r(462)](path[r(375)]).join("/"),o=concatCode(i?[HARMONY_APP_WRAP,o,r(384),r(447)[r(411)](n,"/")[r(411)](e,r(449))]:[HARMONY_PAGE_WRAP,o,"\n}\n\n",r(447)[r(411)](n,"/")[r(411)](e,r(415))]);fs.writeFileSync(t,o)}function concatCode(t){return t[_0x57ee1d(433)](function(t,e){return t+=e},"")}function getArkToolList(t){var e=_0x57ee1d;return{win:path[e(440)](t,e(425),e(388),e(443)),mac:path.join(t,e(366),e(388),e(443)),linux:path[e(440)](t,"build","src",e(443))}}function _0x5756(){var t=["185778KViqdm","util","build-win","defineProperty","rval","illegal catch attempt","429362kFUqDI","9bvbNgV",'node --expose-gc "',"call","reduce","forEach","afterLoc","complete","readFileSync","type","12OgjFzr","join","prev","_sent","index.js","iterator result is not an object","break","value","globalThis.bundleMap['/","abrupt","'] = appCodeObj;","delegate","continue","constructor","stderr","catch","610274ncAnau","done","dispatchException","resultName","prototype","iterator","stop","split","then","sent","relative","mark","Generator","function","[object Array]","arg","length","tryEntries","240fiYXMq","exports","toStringTag","12862223gKlriE","completed","normal","setPrototypeOf","push","__await","build-mac","Generator is already running","create","symbol","export function appCodeObj(globalObjects) {\n const {\n $app_bootstrap$,\n $app_define$,\n $app_evaluate$,\n $app_require$,\n BroadcastChannel,\n clearInterval,\n clearTimeout,\n I18n,\n service,\n setInterval,\n setTimeout,\n global,\n console,\n escape,\n unescape,\n Function\n } = globalObjects;\n\n let { TextDecoder } = globalObjects;\n const globalThis = global;\n\n","reset","end","finallyLoc","method","sep","return","toString","completion","suspendedStart","[object Generator]","export function templateObj(globalObjects) {\n const {\n $app_bootstrap$,\n $app_define_wrap$,\n $app_define$,\n $app_evaluate$,\n $app_require$,\n bootstrap,\n BroadcastChannel,\n define,\n history,\n I18n,\n Image,\n register,\n render,\n require,\n service,\n global,\n console,\n setTimeout,\n setInterval,\n clearTimeout,\n clearInterval,\n escape,\n unescape,\n Function\n } = globalObjects;\n\n let { TextDecoder } = globalObjects;\n const globalThis = global;\n\n","next","isGeneratorFunction","\n}\n\n","GeneratorFunction","getPrototypeOf","@@iterator","src","object","apply","5055ytewnR","4961520XuIdYB","displayName","exec","resolve","name","__proto__","nextLoc","reverse","suspendedYield","_invoke","catchLoc","root","pop","asyncIterator","'--module'","967390qCpvaY","utf-8","match","slice","concat","throw","ERROR: An error occurred while converting the file.\n @ ","tryLoc","'] = templateObj;","path","hasOwnProperty","errors","wrap","54mrdwOU","1476tBVQpI","promisify"];return(_0x5756=function(){return t})()}module[_0x57ee1d(358)]={jsToAbc:jsToAbc,jsBundleWrapper:jsBundleWrapper,getArkToolList:getArkToolList};