ms-vite-plugin 1.4.68 → 1.4.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addVararg=c;function s(r){r.vararg=!0,t(r.body.body)}function a(r){switch(r.type){case"FuncExpr":s(r);break;case"UnaryExpr":a(r.arg);break;case"BinaryExpr":a(r.left),a(r.right);break;case"TableExpr":for(const e of r.fields)e.kind==="index"&&a(e.key),a(e.value);break;case"IndexExpr":a(r.object),a(r.index);break;case"MemberExpr":a(r.object);break;case"CallExpr":a(r.callee);for(const e of r.args)a(e);break;case"MethodCallExpr":a(r.object);for(const e of r.args)a(e);break;case"ParenExpr":a(r.exp);break;default:break}}function t(r){for(const e of r)switch(e.type){case"DoStat":case"WhileStat":case"RepeatStat":case"ForNumStat":case"ForInStat":if(e.type==="WhileStat"&&a(e.cond),e.type==="RepeatStat"&&a(e.cond),e.type==="ForNumStat"&&(a(e.start),a(e.end),e.step&&a(e.step)),e.type==="ForInStat")for(const o of e.exps)a(o);t(e.body.body);break;case"IfStat":for(const o of e.clauses)a(o.cond),t(o.body.body);e.elseBody&&t(e.elseBody.body);break;case"FuncStat":case"LocalFuncStat":s(e.func);break;case"LocalStat":if(e.exps)for(const o of e.exps)a(o);break;case"AssignStat":for(const o of e.vars)a(o);for(const o of e.exps)a(o);break;case"CallStat":a(e.exp);break;case"ReturnStat":for(const o of e.exps)a(o);break;default:break}}function c(r){t(r.body)}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addVararg=c;function s(o){o.vararg=!0,t(o.body.body)}function a(o){switch(o.type){case"FuncExpr":s(o);break;case"UnaryExpr":a(o.arg);break;case"BinaryExpr":a(o.left),a(o.right);break;case"TableExpr":for(const e of o.fields)e.kind==="index"&&a(e.key),a(e.value);break;case"IndexExpr":a(o.object),a(o.index);break;case"MemberExpr":a(o.object);break;case"CallExpr":a(o.callee);for(const e of o.args)a(e);break;case"MethodCallExpr":a(o.object);for(const e of o.args)a(e);break;case"ParenExpr":a(o.exp);break;default:break}}function t(o){for(const e of o)switch(e.type){case"DoStat":case"WhileStat":case"RepeatStat":case"ForNumStat":case"ForInStat":if(e.type==="WhileStat"&&a(e.cond),e.type==="RepeatStat"&&a(e.cond),e.type==="ForNumStat"&&(a(e.start),a(e.end),e.step&&a(e.step)),e.type==="ForInStat")for(const r of e.exps)a(r);t(e.body.body);break;case"IfStat":for(const r of e.clauses)a(r.cond),t(r.body.body);e.elseBody&&t(e.elseBody.body);break;case"FuncStat":case"LocalFuncStat":s(e.func);break;case"LocalStat":if(e.exps)for(const r of e.exps)a(r);break;case"AssignStat":for(const r of e.vars)a(r);for(const r of e.exps)a(r);break;case"CallStat":a(e.exp);break;case"ReturnStat":for(const r of e.exps)a(r);break;default:break}}function c(o){t(o.body)}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.flattenControlFlow=C;function m(t){return{type:"NumberLiteral",raw:String(t),value:t}}function p(t){return{type:"NameExpr",name:t}}function f(t,n){return{type:"AssignStat",vars:t.map(e=>p(e)),exps:n}}function u(t,n){return f([t.stateName],[typeof n=="number"?m(n):n])}function k(t,n,e){return{type:"BinaryExpr",op:"or",left:{type:"BinaryExpr",op:"and",left:p(t),right:m(n)},right:m(e)}}function E(t,n,e){return{type:"BinaryExpr",op:t,left:n,right:e}}function S(t){const n=`__t${t.nextTemp}`;return t.nextTemp+=1,t.temps.push(n),n}function x(t){const n=t.nextState;return t.nextState+=1,t.states.set(n,[]),n}function o(t,n,e){t.states.get(n).push(e)}function F(t,n){for(const e of t)if(e.type==="LocalStat")for(const a of e.names)n.push(a.name);else if(e.type==="LocalFuncStat")n.push(e.name);else if(e.type==="ForNumStat")n.push(e.name),F(e.body.body,n);else if(e.type==="ForInStat")n.push(...e.names),F(e.body.body,n);else if(e.type==="DoStat"||e.type==="WhileStat"||e.type==="RepeatStat")F(e.body.body,n);else if(e.type==="IfStat"){for(const a of e.clauses)F(a.body.body,n);e.elseBody&&F(e.elseBody.body,n)}}function h(t,n,e,a){if(t.length===0)return n;const y=t.map(()=>x(e));for(let s=0;s<t.length;s+=1){const r=t[s];r.type==="LabelStat"&&e.userLabels.set(r.name,y[s])}for(let s=0;s<t.length;s+=1){const r=s+1<t.length?y[s+1]:n;I(e,y[s],t[s],r,a)}return y[0]}function I(t,n,e,a,y){switch(e.type){case"EmptyStat":case"LabelStat":o(t,n,u(t,a));return;case"AssignStat":case"CallStat":case"FuncStat":o(t,n,e),o(t,n,u(t,a));return;case"LocalStat":e.exps&&e.exps.length>0&&o(t,n,f(e.names.map(s=>s.name),e.exps)),o(t,n,u(t,a));return;case"LocalFuncStat":o(t,n,f([e.name],[e.func])),o(t,n,u(t,a));return;case"ReturnStat":o(t,n,e);return;case"BreakStat":o(t,n,u(t,y));return;case"GotoStat":{const s=t.userLabels.get(e.name);if(s===void 0)throw new Error(`goto \u672A\u5B9A\u4E49\u6807\u7B7E ::${e.name}::`);o(t,n,u(t,s));return}case"DoStat":o(t,n,u(t,h(e.body.body,a,t,y)));return;case"IfStat":{const s=S(t);let r=n;for(let l=0;l<e.clauses.length;l+=1){const b=l===e.clauses.length-1,d=h(e.clauses[l].body.body,a,t,y);let i=a;b?e.elseBody&&(i=h(e.elseBody.body,a,t,y)):i=x(t),o(t,r,f([s],[e.clauses[l].cond])),o(t,r,u(t,k(s,d,i))),b||(r=i)}e.clauses.length===0&&o(t,n,u(t,a));return}case"WhileStat":{const s=S(t),r=h(e.body.body,n,t,a);o(t,n,f([s],[e.cond])),o(t,n,u(t,k(s,r,a)));return}case"RepeatStat":{const s=S(t),r=x(t),l=h(e.body.body,r,t,a);o(t,n,u(t,l)),o(t,r,f([s],[e.cond])),o(t,r,u(t,k(s,a,l)));return}case"ForNumStat":{const s=e.name,r=S(t),l=S(t),b=S(t),d=x(t),i=x(t),L=x(t),g=x(t),N=h(e.body.body,g,t,a);o(t,n,f([s],[e.start])),o(t,n,f([r],[e.end])),o(t,n,f([l],[e.step??m(1)])),o(t,n,u(t,d)),o(t,d,f([b],[E(">=",p(l),m(0))])),o(t,d,u(t,k(b,i,L))),o(t,i,f([b],[E("<=",p(s),p(r))])),o(t,i,u(t,k(b,N,a))),o(t,L,f([b],[E(">=",p(s),p(r))])),o(t,L,u(t,k(b,N,a))),o(t,g,f([s],[E("+",p(s),p(l))])),o(t,g,u(t,d));return}case"ForInStat":{const s=S(t),r=S(t),l=S(t),b=S(t),d=x(t),i=[f([l],[p(e.names[0])]),...e.body.body],L=h(i,d,t,a),g=e.exps.slice();for(;g.length<3;)g.push({type:"NilLiteral"});o(t,n,f([s,r,l],g.slice(0,3))),o(t,n,u(t,d)),o(t,d,{type:"AssignStat",vars:e.names.map(N=>p(N)),exps:[{type:"CallExpr",callee:p(s),args:[p(r),p(l)]}]}),o(t,d,f([b],[E("~=",p(e.names[0]),{type:"NilLiteral"})])),o(t,d,u(t,k(b,L,a)));return}default:o(t,n,u(t,a))}}function v(t,n){const e=t.slice();let a=n>>>0||1;for(let y=e.length-1;y>0;y-=1){a=Math.imul(a,1664525)+1013904223>>>0;const s=a%(y+1),r=e[y];e[y]=e[s],e[s]=r}return e}function w(t,n){if(t.length===0)return t;const e={states:new Map,temps:[],nextState:1,nextTemp:1,stateName:"__s",userLabels:new Map},a=[];F(t,a);const y=h(t,0,e,0),s=[...new Set([...a,...e.temps,e.stateName])],r=v([...e.states.keys()],n).map(l=>({cond:E("==",p(e.stateName),m(l)),body:{type:"Block",body:e.states.get(l)}}));return[{type:"LocalStat",names:s.map(l=>({name:l}))},f([e.stateName],[m(y)]),{type:"WhileStat",cond:E("~=",p(e.stateName),m(0)),body:{type:"Block",body:[{type:"IfStat",clauses:r}]}}]}function c(t,n){switch(t.type){case"FuncExpr":B(t.body.body,n),t.body.body=w(t.body.body,n);break;case"UnaryExpr":c(t.arg,n);break;case"BinaryExpr":c(t.left,n),c(t.right,n);break;case"TableExpr":for(const e of t.fields)e.kind==="index"&&c(e.key,n),c(e.value,n);break;case"IndexExpr":c(t.object,n),c(t.index,n);break;case"MemberExpr":c(t.object,n);break;case"CallExpr":c(t.callee,n);for(const e of t.args)c(e,n);break;case"MethodCallExpr":c(t.object,n);for(const e of t.args)c(e,n);break;case"ParenExpr":c(t.exp,n);break;default:break}}function B(t,n){for(const e of t)switch(e.type){case"DoStat":case"WhileStat":case"RepeatStat":case"ForNumStat":case"ForInStat":if((e.type==="WhileStat"||e.type==="RepeatStat")&&c(e.cond,n),e.type==="ForNumStat"&&(c(e.start,n),c(e.end,n),e.step&&c(e.step,n)),e.type==="ForInStat")for(const a of e.exps)c(a,n);B(e.body.body,n);break;case"IfStat":for(const a of e.clauses)c(a.cond,n),B(a.body.body,n);e.elseBody&&B(e.elseBody.body,n);break;case"FuncStat":case"LocalFuncStat":B(e.func.body.body,n),e.func.body.body=w(e.func.body.body,n);break;case"LocalStat":if(e.exps)for(const a of e.exps)c(a,n);break;case"AssignStat":for(const a of e.vars)c(a,n);for(const a of e.exps)c(a,n);break;case"CallStat":c(e.exp,n);break;case"ReturnStat":for(const a of e.exps)c(a,n);break;default:break}}function C(t,n){B(t.body,n),t.body=w(t.body,n)}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.flattenControlFlow=C;function m(t){return{type:"NumberLiteral",raw:String(t),value:t}}function p(t){return{type:"NameExpr",name:t}}function f(t,o){return{type:"AssignStat",vars:t.map(e=>p(e)),exps:o}}function u(t,o){return f([t.stateName],[typeof o=="number"?m(o):o])}function k(t,o,e){return{type:"BinaryExpr",op:"or",left:{type:"BinaryExpr",op:"and",left:p(t),right:m(o)},right:m(e)}}function E(t,o,e){return{type:"BinaryExpr",op:t,left:o,right:e}}function S(t){const o=`__t${t.nextTemp}`;return t.nextTemp+=1,t.temps.push(o),o}function x(t){const o=t.nextState;return t.nextState+=1,t.states.set(o,[]),o}function s(t,o,e){t.states.get(o).push(e)}function F(t,o){for(const e of t)if(e.type==="LocalStat")for(const a of e.names)o.push(a.name);else if(e.type==="LocalFuncStat")o.push(e.name);else if(e.type==="ForNumStat")o.push(e.name),F(e.body.body,o);else if(e.type==="ForInStat")o.push(...e.names),F(e.body.body,o);else if(e.type==="DoStat"||e.type==="WhileStat"||e.type==="RepeatStat")F(e.body.body,o);else if(e.type==="IfStat"){for(const a of e.clauses)F(a.body.body,o);e.elseBody&&F(e.elseBody.body,o)}}function h(t,o,e,a){if(t.length===0)return o;const y=t.map(()=>x(e));for(let n=0;n<t.length;n+=1){const r=t[n];r.type==="LabelStat"&&e.userLabels.set(r.name,y[n])}for(let n=0;n<t.length;n+=1){const r=n+1<t.length?y[n+1]:o;I(e,y[n],t[n],r,a)}return y[0]}function I(t,o,e,a,y){switch(e.type){case"EmptyStat":case"LabelStat":s(t,o,u(t,a));return;case"AssignStat":case"CallStat":case"FuncStat":s(t,o,e),s(t,o,u(t,a));return;case"LocalStat":e.exps&&e.exps.length>0&&s(t,o,f(e.names.map(n=>n.name),e.exps)),s(t,o,u(t,a));return;case"LocalFuncStat":s(t,o,f([e.name],[e.func])),s(t,o,u(t,a));return;case"ReturnStat":s(t,o,e);return;case"BreakStat":s(t,o,u(t,y));return;case"GotoStat":{const n=t.userLabels.get(e.name);if(n===void 0)throw new Error(`goto \u672A\u5B9A\u4E49\u6807\u7B7E ::${e.name}::`);s(t,o,u(t,n));return}case"DoStat":s(t,o,u(t,h(e.body.body,a,t,y)));return;case"IfStat":{const n=S(t);let r=o;for(let l=0;l<e.clauses.length;l+=1){const b=l===e.clauses.length-1,d=h(e.clauses[l].body.body,a,t,y);let i=a;b?e.elseBody&&(i=h(e.elseBody.body,a,t,y)):i=x(t),s(t,r,f([n],[e.clauses[l].cond])),s(t,r,u(t,k(n,d,i))),b||(r=i)}e.clauses.length===0&&s(t,o,u(t,a));return}case"WhileStat":{const n=S(t),r=h(e.body.body,o,t,a);s(t,o,f([n],[e.cond])),s(t,o,u(t,k(n,r,a)));return}case"RepeatStat":{const n=S(t),r=x(t),l=h(e.body.body,r,t,a);s(t,o,u(t,l)),s(t,r,f([n],[e.cond])),s(t,r,u(t,k(n,a,l)));return}case"ForNumStat":{const n=e.name,r=S(t),l=S(t),b=S(t),d=x(t),i=x(t),L=x(t),g=x(t),N=h(e.body.body,g,t,a);s(t,o,f([n],[e.start])),s(t,o,f([r],[e.end])),s(t,o,f([l],[e.step??m(1)])),s(t,o,u(t,d)),s(t,d,f([b],[E(">=",p(l),m(0))])),s(t,d,u(t,k(b,i,L))),s(t,i,f([b],[E("<=",p(n),p(r))])),s(t,i,u(t,k(b,N,a))),s(t,L,f([b],[E(">=",p(n),p(r))])),s(t,L,u(t,k(b,N,a))),s(t,g,f([n],[E("+",p(n),p(l))])),s(t,g,u(t,d));return}case"ForInStat":{const n=S(t),r=S(t),l=S(t),b=S(t),d=x(t),i=[f([l],[p(e.names[0])]),...e.body.body],L=h(i,d,t,a),g=e.exps.slice();for(;g.length<3;)g.push({type:"NilLiteral"});s(t,o,f([n,r,l],g.slice(0,3))),s(t,o,u(t,d)),s(t,d,{type:"AssignStat",vars:e.names.map(N=>p(N)),exps:[{type:"CallExpr",callee:p(n),args:[p(r),p(l)]}]}),s(t,d,f([b],[E("~=",p(e.names[0]),{type:"NilLiteral"})])),s(t,d,u(t,k(b,L,a)));return}default:s(t,o,u(t,a))}}function v(t,o){const e=t.slice();let a=o>>>0||1;for(let y=e.length-1;y>0;y-=1){a=Math.imul(a,1664525)+1013904223>>>0;const n=a%(y+1),r=e[y];e[y]=e[n],e[n]=r}return e}function w(t,o){if(t.length===0)return t;const e={states:new Map,temps:[],nextState:1,nextTemp:1,stateName:"__s",userLabels:new Map},a=[];F(t,a);const y=h(t,0,e,0),n=[...new Set([...a,...e.temps,e.stateName])],r=v([...e.states.keys()],o).map(l=>({cond:E("==",p(e.stateName),m(l)),body:{type:"Block",body:e.states.get(l)}}));return[{type:"LocalStat",names:n.map(l=>({name:l}))},f([e.stateName],[m(y)]),{type:"WhileStat",cond:E("~=",p(e.stateName),m(0)),body:{type:"Block",body:[{type:"IfStat",clauses:r}]}}]}function c(t,o){switch(t.type){case"FuncExpr":B(t.body.body,o),t.body.body=w(t.body.body,o);break;case"UnaryExpr":c(t.arg,o);break;case"BinaryExpr":c(t.left,o),c(t.right,o);break;case"TableExpr":for(const e of t.fields)e.kind==="index"&&c(e.key,o),c(e.value,o);break;case"IndexExpr":c(t.object,o),c(t.index,o);break;case"MemberExpr":c(t.object,o);break;case"CallExpr":c(t.callee,o);for(const e of t.args)c(e,o);break;case"MethodCallExpr":c(t.object,o);for(const e of t.args)c(e,o);break;case"ParenExpr":c(t.exp,o);break;default:break}}function B(t,o){for(const e of t)switch(e.type){case"DoStat":case"WhileStat":case"RepeatStat":case"ForNumStat":case"ForInStat":if((e.type==="WhileStat"||e.type==="RepeatStat")&&c(e.cond,o),e.type==="ForNumStat"&&(c(e.start,o),c(e.end,o),e.step&&c(e.step,o)),e.type==="ForInStat")for(const a of e.exps)c(a,o);B(e.body.body,o);break;case"IfStat":for(const a of e.clauses)c(a.cond,o),B(a.body.body,o);e.elseBody&&B(e.elseBody.body,o);break;case"FuncStat":case"LocalFuncStat":B(e.func.body.body,o),e.func.body.body=w(e.func.body.body,o);break;case"LocalStat":if(e.exps)for(const a of e.exps)c(a,o);break;case"AssignStat":for(const a of e.vars)c(a,o);for(const a of e.exps)c(a,o);break;case"CallStat":c(e.exp,o);break;case"ReturnStat":for(const a of e.exps)c(a,o);break;default:break}}function C(t,o){B(t.body,o),t.body=w(t.body,o)}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.shortName=a,exports.renameLocals=c;const u=require("./reserved"),d=require("./scope"),l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function a(r){let e=r,t="";do t=l[e%l.length]+t,e=Math.floor(e/l.length)-1;while(e>=0);return u.luaKeywords.has(t)?`_${t}`:t}function c(r){let e=0;const t=new Set;(0,d.collectAndRename)(r,(o,s)=>{if(o.newName!==o.original)return;let n=a(e);for(e+=1;s.has(n)||t.has(n)||u.luaKeywords.has(n);)n=a(e),e+=1;o.newName=n,t.add(n),s.add(n)})}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.shortName=r,exports.renameLocals=c;const u=require("./reserved"),d=require("./scope"),l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function r(a){let e=a,t="";do t=l[e%l.length]+t,e=Math.floor(e/l.length)-1;while(e>=0);return u.luaKeywords.has(t)?`_${t}`:t}function c(a){let e=0;const t=new Set;(0,d.collectAndRename)(a,(o,s)=>{if(o.newName!==o.original)return;let n=r(e);for(e+=1;s.has(n)||t.has(n)||u.luaKeywords.has(n);)n=r(e),e+=1;o.newName=n,t.add(n),s.add(n)})}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.resolveLocal=i,exports.collectAndRename=x;function i(t,c){let r=t;for(;r;){const e=r.locals.get(c);if(e)return e;r=r.parent}}function o(t){return{parent:t,locals:new Map}}function f(t,c){const r=t.locals.get(c);if(r)return r;const e={original:c,newName:c};return t.locals.set(c,e),e}function x(t,c){const r=new Set,e={locals:new Map};d(t.body,e,r,c)}function l(t,c,r,e){d(t.body,c,r,e)}function d(t,c,r,e){for(const s of t)b(s,c,r,e)}function m(t,c,r,e){const s=o(c),a=t.params.slice();for(let u=0;u<a.length;u+=1){const p=f(s,a[u]);e(p,r),t.params[u]=p.newName}l(t.body,s,r,e)}function b(t,c,r,e){switch(t.type){case"EmptyStat":case"BreakStat":case"GotoStat":case"LabelStat":return;case"DoStat":l(t.body,o(c),r,e);return;case"WhileStat":n(t.cond,c,r,e),l(t.body,o(c),r,e);return;case"RepeatStat":{const s=o(c);l(t.body,s,r,e),n(t.cond,s,r,e);return}case"IfStat":for(const s of t.clauses)n(s.cond,c,r,e),l(s.body,o(c),r,e);t.elseBody&&l(t.elseBody,o(c),r,e);return;case"ForNumStat":{n(t.start,c,r,e),n(t.end,c,r,e),t.step&&n(t.step,c,r,e);const s=o(c),a=f(s,t.name);e(a,r),t.name=a.newName,l(t.body,s,r,e);return}case"ForInStat":{for(const a of t.exps)n(a,c,r,e);const s=o(c);for(let a=0;a<t.names.length;a+=1){const u=f(s,t.names[a]);e(u,r),t.names[a]=u.newName}l(t.body,s,r,e);return}case"FuncStat":{const s=i(c,t.name.base);s&&(t.name.base=s.newName),m(t.func,c,r,e);return}case"LocalFuncStat":{const s=f(c,t.name);e(s,r),t.name=s.newName,m(t.func,c,r,e);return}case"LocalStat":if(t.exps)for(const s of t.exps)n(s,c,r,e);for(let s=0;s<t.names.length;s+=1){const a=f(c,t.names[s].name);e(a,r),t.names[s].name=a.newName}return;case"AssignStat":for(const s of t.vars)n(s,c,r,e);for(const s of t.exps)n(s,c,r,e);return;case"CallStat":n(t.exp,c,r,e);return;case"ReturnStat":for(const s of t.exps)n(s,c,r,e);return}}function n(t,c,r,e){switch(t.type){case"NilLiteral":case"BoolLiteral":case"NumberLiteral":case"StringLiteral":case"VarargExpr":return;case"NameExpr":{const s=i(c,t.name);s&&(t.name=s.newName);return}case"UnaryExpr":n(t.arg,c,r,e);return;case"BinaryExpr":n(t.left,c,r,e),n(t.right,c,r,e);return;case"FuncExpr":m(t,c,r,e);return;case"TableExpr":for(const s of t.fields)s.kind==="index"&&n(s.key,c,r,e),n(s.value,c,r,e);return;case"IndexExpr":n(t.object,c,r,e),n(t.index,c,r,e);return;case"MemberExpr":n(t.object,c,r,e);return;case"CallExpr":n(t.callee,c,r,e);for(const s of t.args)n(s,c,r,e);return;case"MethodCallExpr":n(t.object,c,r,e);for(const s of t.args)n(s,c,r,e);return;case"ParenExpr":n(t.exp,c,r,e);return}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.resolveLocal=i,exports.collectAndRename=x;function i(t,o){let r=t;for(;r;){const e=r.locals.get(o);if(e)return e;r=r.parent}}function s(t){return{parent:t,locals:new Map}}function f(t,o){const r=t.locals.get(o);if(r)return r;const e={original:o,newName:o};return t.locals.set(o,e),e}function x(t,o){const r=new Set,e={locals:new Map};d(t.body,e,r,o)}function l(t,o,r,e){d(t.body,o,r,e)}function d(t,o,r,e){for(const c of t)b(c,o,r,e)}function m(t,o,r,e){const c=s(o),a=t.params.slice();for(let u=0;u<a.length;u+=1){const p=f(c,a[u]);e(p,r),t.params[u]=p.newName}l(t.body,c,r,e)}function b(t,o,r,e){switch(t.type){case"EmptyStat":case"BreakStat":case"GotoStat":case"LabelStat":return;case"DoStat":l(t.body,s(o),r,e);return;case"WhileStat":n(t.cond,o,r,e),l(t.body,s(o),r,e);return;case"RepeatStat":{const c=s(o);l(t.body,c,r,e),n(t.cond,c,r,e);return}case"IfStat":for(const c of t.clauses)n(c.cond,o,r,e),l(c.body,s(o),r,e);t.elseBody&&l(t.elseBody,s(o),r,e);return;case"ForNumStat":{n(t.start,o,r,e),n(t.end,o,r,e),t.step&&n(t.step,o,r,e);const c=s(o),a=f(c,t.name);e(a,r),t.name=a.newName,l(t.body,c,r,e);return}case"ForInStat":{for(const a of t.exps)n(a,o,r,e);const c=s(o);for(let a=0;a<t.names.length;a+=1){const u=f(c,t.names[a]);e(u,r),t.names[a]=u.newName}l(t.body,c,r,e);return}case"FuncStat":{const c=i(o,t.name.base);c&&(t.name.base=c.newName),m(t.func,o,r,e);return}case"LocalFuncStat":{const c=f(o,t.name);e(c,r),t.name=c.newName,m(t.func,o,r,e);return}case"LocalStat":if(t.exps)for(const c of t.exps)n(c,o,r,e);for(let c=0;c<t.names.length;c+=1){const a=f(o,t.names[c].name);e(a,r),t.names[c].name=a.newName}return;case"AssignStat":for(const c of t.vars)n(c,o,r,e);for(const c of t.exps)n(c,o,r,e);return;case"CallStat":n(t.exp,o,r,e);return;case"ReturnStat":for(const c of t.exps)n(c,o,r,e);return}}function n(t,o,r,e){switch(t.type){case"NilLiteral":case"BoolLiteral":case"NumberLiteral":case"StringLiteral":case"VarargExpr":return;case"NameExpr":{const c=i(o,t.name);c&&(t.name=c.newName);return}case"UnaryExpr":n(t.arg,o,r,e);return;case"BinaryExpr":n(t.left,o,r,e),n(t.right,o,r,e);return;case"FuncExpr":m(t,o,r,e);return;case"TableExpr":for(const c of t.fields)c.kind==="index"&&n(c.key,o,r,e),n(c.value,o,r,e);return;case"IndexExpr":n(t.object,o,r,e),n(t.index,o,r,e);return;case"MemberExpr":n(t.object,o,r,e);return;case"CallExpr":n(t.callee,o,r,e);for(const c of t.args)n(c,o,r,e);return;case"MethodCallExpr":n(t.object,o,r,e);for(const c of t.args)n(c,o,r,e);return;case"ParenExpr":n(t.exp,o,r,e);return}}
@@ -1,4 +1,4 @@
1
- "use strict";var I=exports&&exports.__createBinding||(Object.create?(function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}):(function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]})),_=exports&&exports.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),E=exports&&exports.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var a=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(a[a.length]=i);return a},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var a=t(e),i=0;i<a.length;i++)a[i]!=="default"&&I(r,e,a[i]);return _(r,e),r}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.protectScript=k,exports.createScriptProtectPlugin=F,exports.createKjstEmbedPlugin=R,exports.createScriptProtectHelpers=C;const A=E(require("acorn")),h=E(require("crypto")),w=require("magic-string"),x="KJST",T=1,v="/*KJST",D="*/",U=`-----BEGIN PUBLIC KEY-----
1
+ "use strict";var w=exports&&exports.__createBinding||(Object.create?(function(t,e,n,a){a===void 0&&(a=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,a,i)}):(function(t,e,n,a){a===void 0&&(a=n),t[a]=e[n]})),k=exports&&exports.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C=exports&&exports.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(n){var a=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(a[a.length]=i);return a},t(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var a=t(e),i=0;i<a.length;i++)a[i]!=="default"&&w(n,e,a[i]);return k(n,e),n}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.protectScript=F,exports.createScriptProtectPlugin=Y,exports.createKjstEmbedPlugin=Q,exports.createScriptProtectHelpers=_;const E=C(require("acorn")),p=C(require("crypto")),T=require("magic-string"),D=Buffer.from([126,145,60,165]),M=1,U="x",N=Buffer.from([165,60,145,126]),L=`-----BEGIN PUBLIC KEY-----
2
2
  MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArzeAhUUEi4p0AxLYIVJK
3
3
  UcXyySzlh8G4TfH/quDXiKVlYlho9v2R1cQKQgFpVuDW8SDyc2iWUTNa8D/NX9LN
4
4
  IqcgQP0lyTxuFvevfGOlPt6NDl0nYNqaToK5AvN/F7AcchU9JrNSB4BNEeFRechm
@@ -6,5 +6,4 @@ GL9m5iUY0HCbiOIcbo+rx1GQaqTYCUuZIJttuARYCq0ggoOHjBqMHUKWwdNtJVoe
6
6
  PrdRaKzL3CB2gXazQzKUVrlK2vEDEaTvSLJoCym7SkSf/XmxjfEADlcwrqTb01ar
7
7
  U8mm9/g5R9q43B8NqlTpGOcs1OpAY5DZW1DDjXhyHBfrPCt82hhmeO/yI0N8vE2m
8
8
  MwIDAQAB
9
- -----END PUBLIC KEY-----`,O=new Set(["action","$\u52A8\u4F5C","appleOcr","$\u82F9\u679COCR","cloud","$\u4E91\u63A7","config","$\u914D\u7F6E","cryptoUtils","cv","device","$\u8BBE\u5907","dotOcr","$\u70B9\u9635OCR","file","$\u6587\u4EF6","hid","$HID","hotUpdate","$\u70ED\u66F4\u65B0","http","$HTTP","image","$\u56FE\u7247","ime","$\u8F93\u5165\u6CD5","logger","$\u65E5\u5FD7","media","$\u5A92\u4F53","mysql","$MySQL\u6570\u636E\u5E93","netCard","$\u5361\u5BC6","paddleOcr","$PaddleOCR","pip","$\u60AC\u6D6E\u7A97","sharedState","$\u5171\u4EAB\u72B6\u6001","system","$\u7CFB\u7EDF","thread","$\u7EBF\u7A0B","tomatoOcr","tts","$\u6587\u5B57\u8F6C\u8BED\u97F3","ui","$\u89C6\u56FE","utils","$\u5DE5\u5177","yolo","$YOLO","yoloCls","$YOLO\u5206\u7C7B"]),M=new Set(["createNodeSelector","$\u521B\u5EFA\u8282\u70B9\u9009\u62E9\u5668","exit","$\u9000\u51FA\u811A\u672C","getAgentFastMode","$\u83B7\u53D6Agent\u5FEB\u901F\u6A21\u5F0F","getAgentTouchMode","$\u83B7\u53D6Agent\u89E6\u63A7\u6A21\u5F0F","getContext","$\u83B7\u53D6\u4E0A\u4E0B\u6587","getCpuAutoThrottle","$\u83B7\u53D6CPU\u81EA\u52A8\u9650\u6D41","getCpuThrottleDelay","$\u83B7\u53D6CPU\u9650\u6D41\u5EF6\u8FDF","importClass","$\u5BFC\u5165\u7C7B","loadDex","$\u52A0\u8F7DDex","logd","$\u6253\u5370\u8C03\u8BD5\u65E5\u5FD7","loge","$\u6253\u5370\u9519\u8BEF\u65E5\u5FD7","logi","$\u6253\u5370\u4FE1\u606F\u65E5\u5FD7","logw","$\u6253\u5370\u8B66\u544A\u65E5\u5FD7","println","$\u6253\u5370","restartScript","$\u91CD\u542F\u811A\u672C","setAgentFastMode","$\u8BBE\u7F6EAgent\u5FEB\u901F\u6A21\u5F0F","setAgentTouchMode","$\u8BBE\u7F6EAgent\u89E6\u63A7\u6A21\u5F0F","setCpuAutoThrottle","$\u8BBE\u7F6ECPU\u81EA\u52A8\u9650\u6D41","setCpuThrottleDelay","$\u8BBE\u7F6ECPU\u9650\u6D41\u5EF6\u8FDF","setExceptionCallback","$\u8BBE\u7F6E\u5F02\u5E38\u505C\u6B62\u56DE\u8C03","setStopCallback","$\u8BBE\u7F6E\u505C\u6B62\u56DE\u8C03","sleep","$\u5EF6\u65F6","takeMeToFront","$APP\u5207\u5165\u524D\u53F0","time","$\u83B7\u53D6\u5F53\u524D\u65F6\u95F4\u6233"]);function m(t){for(;;){const e=`_0x${h.randomBytes(3).toString("hex")}`;if(!t.has(e))return t.add(e),e}}function y(t,e){const r=t.indexOf(e);return r>=0?r:(t.push(e),t.length-1)}function S(t,e){for(let r=e.length-1;r>=0;r-=1)if(e[r].has(t))return!0;return!1}function p(t,e){if(!(!t||typeof t!="object")){if(t.type==="Identifier"){e.add(t.name);return}if(t.type==="AssignmentPattern"){p(t.left,e);return}if(t.type==="RestElement"){p(t.argument,e);return}if(t.type==="ArrayPattern"){for(const r of t.elements||[])p(r,e);return}if(t.type==="ObjectPattern")for(const r of t.properties||[])r.type==="RestElement"?p(r.argument,e):p(r.value,e)}}function N(t){try{return A.parse(t,{allowHashBang:!0,ecmaVersion:"latest",sourceType:"script"})}catch{return A.parse(t,{allowHashBang:!0,ecmaVersion:"latest",sourceType:"module"})}}function P(t,e,r,a){if(!t||typeof t!="object"||typeof t.type!="string")return;let i=0;if(t.type==="FunctionDeclaration"||t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression"){const c=new Set;t.id&&t.id.type==="Identifier"&&c.add(t.id.name);for(const s of t.params||[])p(s,c);r.push(c),i+=1}if(t.type==="CatchClause"&&t.param){const c=new Set;p(t.param,c),r.push(c),i+=1}if(t.type==="VariableDeclaration"){const c=r[r.length-1];for(const s of t.declarations||[])p(s.id,c)}a(t,e,r);for(const c of Object.keys(t)){if(c==="parent"||c==="start"||c==="end"||c==="loc"||c==="range"||c==="raw")continue;const s=t[c];if(Array.isArray(s))for(const u of s)P(u,t,r,a);else s&&typeof s=="object"&&P(s,t,r,a)}for(;i>0;)r.pop(),i-=1}function K(t,e){return!(!e||t.value!=="use strict"||e.type!=="ExpressionStatement")}function B(t){if(!(!t||t.type!=="MemberExpression")){if(t.computed)return t.property?.type==="Literal"&&typeof t.property.value=="string"?t.property.value:void 0;if(t.property?.type==="Identifier")return t.property.name}}function L(t){const e=Buffer.from(JSON.stringify(t),"utf8"),r=h.randomBytes(32),a=h.randomBytes(16),i=h.createCipheriv("aes-256-cbc",r,a),c=Buffer.concat([i.update(e),i.final()]),s=h.publicEncrypt({key:U,padding:h.constants.RSA_PKCS1_PADDING},r),u=Buffer.alloc(7);u.write(x,0,4,"ascii"),u.writeUInt8(T,4),u.writeUInt16BE(s.length,5);const n=Buffer.alloc(4);return n.writeUInt32BE(c.length,0),Buffer.concat([u,s,a,n,c])}function k(t){const e=C();return b(t,e[0],e[1],e[2])}function F(t){const e=new Set(t),r=t[0],a=t[1],i=t[2];if(!r||!a||!i||e.size!==3)throw new Error("script protect helper names \u65E0\u6548");return{name:"kuaijs-script-protect",apply:"build",renderChunk:{order:"pre",handler(c,s){const u=b(c,r,a,i);return this.emitFile({type:"asset",fileName:s.fileName.replace(/\.js$/i,".kjst"),source:u.table}),{code:u.code,map:null}}}}}function R(){return{name:"kuaijs-kjst-embed",apply:"build",enforce:"post",generateBundle(t,e){for(const[r,a]of Object.entries(e)){if(a.type!=="asset"||!/\.kjst$/i.test(r))continue;const i=r.replace(/\.kjst$/i,".js"),c=e[i];if(!c||c.type!=="chunk")continue;const s=a.source,u=typeof s=="string"?Buffer.from(s,"binary"):Buffer.from(s);c.code=`${c.code}
10
- ${v}${u.toString("base64")}${D}`,delete e[r]}}}}function C(){const t=new Set;return[m(t),m(t),m(t)]}function b(t,e,r,a){const i=[""],c=[],s=N(t);P(s,null,[new Set],(n,l,d)=>{if(n.type==="CallExpression"){const o=n.callee;if(o?.type==="Identifier"){if(M.has(o.name)&&!S(o.name,d)){const f=y(i,o.name);c.push({start:o.start,end:o.end,text:`${r}(0,${f})`})}return}if(o?.type==="MemberExpression"&&o.object?.type==="Identifier"){const f=o.object.name,$=B(o);if($&&O.has(f)&&!S(f,d)){const g=y(i,f),j=y(i,$);c.push({start:o.start,end:o.end,text:`${r}(${g},${j})`})}}return}if(n.type==="MemberExpression"){if(l?.type==="CallExpression"&&l.callee===n||l?.type==="AssignmentExpression"&&l.left===n||n.object?.type!=="Identifier")return;const o=n.object.name,f=B(n);if(f&&O.has(o)&&!S(o,d)){const $=y(i,o),g=y(i,f);c.push({start:n.start,end:n.end,text:`${a}(${$},${g})`})}return}if(n.type==="Literal"&&typeof n.value=="string"){if(K(n,l)||l?.type==="Property"&&l.key===n)return;const o=y(i,n.value);c.push({start:n.start,end:n.end,text:`${e}(${o})`});return}if(n.type==="Property"&&!n.method&&!n.computed&&n.key?.type==="Identifier"&&n.key.name!=="__proto__"){const o=y(i,n.key.name),f=`[${e}(${o})]`;n.shorthand?c.push({start:n.start,end:n.end,text:`${f}:${n.key.name}`}):c.push({start:n.key.start,end:n.key.end,text:f})}}),c.sort((n,l)=>l.start-n.start);const u=new w(t);for(const n of c)n.start===n.end?u.appendLeft(n.start,n.text):u.overwrite(n.start,n.end,n.text);return{code:u.toString(),table:L({s:e,n:r,p:a,v:i}),reservedNames:[e,r,a]}}
9
+ -----END PUBLIC KEY-----`,S=new Set(["action","$\u52A8\u4F5C","appleOcr","$\u82F9\u679COCR","cloud","$\u4E91\u63A7","config","$\u914D\u7F6E","cryptoUtils","cv","device","$\u8BBE\u5907","dotOcr","$\u70B9\u9635OCR","file","$\u6587\u4EF6","hid","$HID","hidKey","$HID\u6309\u952E","hotUpdate","$\u70ED\u66F4\u65B0","http","$HTTP","image","$\u56FE\u7247","ime","$\u8F93\u5165\u6CD5","logger","$\u65E5\u5FD7","media","$\u5A92\u4F53","mysql","$MySQL\u6570\u636E\u5E93","netCard","$\u5361\u5BC6","paddleOcr","$PaddleOCR","pip","$\u60AC\u6D6E\u7A97","sharedState","$\u5171\u4EAB\u72B6\u6001","system","$\u7CFB\u7EDF","thread","$\u7EBF\u7A0B","tomatoOcr","tts","$\u6587\u5B57\u8F6C\u8BED\u97F3","ui","$\u89C6\u56FE","utils","$\u5DE5\u5177","yolo","$YOLO","yoloCls","$YOLO\u5206\u7C7B"]),I=new Set(["createNodeSelector","$\u521B\u5EFA\u8282\u70B9\u9009\u62E9\u5668","exit","$\u9000\u51FA\u811A\u672C","getAgentFastMode","$\u83B7\u53D6Agent\u5FEB\u901F\u6A21\u5F0F","getAgentTouchMode","$\u83B7\u53D6Agent\u89E6\u63A7\u6A21\u5F0F","getContext","$\u83B7\u53D6\u4E0A\u4E0B\u6587","getCpuAutoThrottle","$\u83B7\u53D6CPU\u81EA\u52A8\u9650\u6D41","getCpuThrottleDelay","$\u83B7\u53D6CPU\u9650\u6D41\u5EF6\u8FDF","importClass","$\u5BFC\u5165\u7C7B","loadDex","$\u52A0\u8F7DDex","logd","$\u6253\u5370\u8C03\u8BD5\u65E5\u5FD7","loge","$\u6253\u5370\u9519\u8BEF\u65E5\u5FD7","logi","$\u6253\u5370\u4FE1\u606F\u65E5\u5FD7","logw","$\u6253\u5370\u8B66\u544A\u65E5\u5FD7","println","$\u6253\u5370","restartScript","$\u91CD\u542F\u811A\u672C","setAgentFastMode","$\u8BBE\u7F6EAgent\u5FEB\u901F\u6A21\u5F0F","setAgentTouchMode","$\u8BBE\u7F6EAgent\u89E6\u63A7\u6A21\u5F0F","setCpuAutoThrottle","$\u8BBE\u7F6ECPU\u81EA\u52A8\u9650\u6D41","setCpuThrottleDelay","$\u8BBE\u7F6ECPU\u9650\u6D41\u5EF6\u8FDF","setExceptionCallback","$\u8BBE\u7F6E\u5F02\u5E38\u505C\u6B62\u56DE\u8C03","setStopCallback","$\u8BBE\u7F6E\u505C\u6B62\u56DE\u8C03","sleep","$\u5EF6\u65F6","takeMeToFront","$APP\u5207\u5165\u524D\u53F0","time","$\u83B7\u53D6\u5F53\u524D\u65F6\u95F4\u6233"]);function b(t){for(;;){const e=`_0x${p.randomBytes(3).toString("hex")}`;if(!t.has(e))return t.add(e),e}}function g(t,e){const n=t.indexOf(e);return n>=0?n:(t.push(e),t.length-1)}function A(t,e){for(let n=e.length-1;n>=0;n-=1)if(e[n].has(t))return!0;return!1}function h(t,e){if(!(!t||typeof t!="object")){if(t.type==="Identifier"){e.add(t.name);return}if(t.type==="AssignmentPattern"){h(t.left,e);return}if(t.type==="RestElement"){h(t.argument,e);return}if(t.type==="ArrayPattern"){for(const n of t.elements||[])h(n,e);return}if(t.type==="ObjectPattern")for(const n of t.properties||[])n.type==="RestElement"?h(n.argument,e):h(n.value,e)}}function K(t){try{return E.parse(t,{allowHashBang:!0,ecmaVersion:"latest",sourceType:"script"})}catch{return E.parse(t,{allowHashBang:!0,ecmaVersion:"latest",sourceType:"module"})}}function O(t,e,n,a){if(!t||typeof t!="object"||typeof t.type!="string")return;let i=0;if(t.type==="FunctionDeclaration"||t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression"){const o=new Set;t.id&&t.id.type==="Identifier"&&o.add(t.id.name);for(const u of t.params||[])h(u,o);n.push(o),i+=1}if(t.type==="CatchClause"&&t.param){const o=new Set;h(t.param,o),n.push(o),i+=1}if(t.type==="VariableDeclaration"){const o=n[n.length-1];for(const u of t.declarations||[])h(u.id,o)}a(t,e,n);for(const o of Object.keys(t)){if(o==="parent"||o==="start"||o==="end"||o==="loc"||o==="range"||o==="raw")continue;const u=t[o];if(Array.isArray(u))for(const s of u)O(s,t,n,a);else u&&typeof u=="object"&&O(u,t,n,a)}for(;i>0;)n.pop(),i-=1}function H(t,e){return!(!e||t.value!=="use strict"||e.type!=="ExpressionStatement")}function j(t){if(!(!t||t.type!=="MemberExpression")){if(t.computed)return t.property?.type==="Literal"&&typeof t.property.value=="string"?t.property.value:void 0;if(t.property?.type==="Identifier")return t.property.name}}function d(t,e){return t^e}function x(t){for(let e=t.length-1;e>0;e-=1){const n=p.randomInt(e+1),a=t[e];t[e]=t[n],t[n]=a}}function R(t){const e=[...S,...I].filter(c=>!t.includes(c));x(e);const n=Math.min(e.length,6+p.randomInt(7)),a=2+p.randomInt(4),i=[];for(let c=0;c<t.length;c+=1)i.push({intern:c,value:t[c]});for(let c=0;c<n;c+=1)i.push({intern:null,value:e[c]});for(let c=0;c<a;c+=1)i.push({intern:null,value:""});x(i);const o=i.map(c=>c.value),u=new Array(t.length).fill(-1),s=[];for(let c=0;c<i.length;c+=1){const y=i[c];y.intern!==null&&(u[y.intern]=c),y.value===""&&s.push(c)}return{values:o,slotOf:u,globalSlots:s}}function q(t){return t.length===0?0:t[p.randomInt(t.length)]}function G(t){const e=Buffer.from(JSON.stringify(t),"utf8"),n=p.randomBytes(32),a=p.randomBytes(16),i=p.createCipheriv("aes-256-cbc",n,a),o=Buffer.concat([i.update(e),i.final()]),u=p.publicEncrypt({key:L,padding:p.constants.RSA_PKCS1_PADDING},n),s=Buffer.alloc(7);D.copy(s,0),s.writeUInt8(M,4),s.writeUInt16BE(u.length,5);const c=Buffer.alloc(4);return c.writeUInt32BE(o.length,0),Buffer.concat([s,u,a,c,o])}function F(t){const e=_();return v(t,e[0],e[1],e[2])}function Y(t){const e=new Set(t),n=t[0],a=t[1],i=t[2];if(!n||!a||!i||e.size!==3)throw new Error("script protect helper names \u65E0\u6548");return{name:"kuaijs-script-protect",apply:"build",renderChunk:{order:"pre",handler(o,u){const s=v(o,n,a,i);return this.emitFile({type:"asset",fileName:u.fileName.replace(/\.js$/i,".kjst"),source:s.table}),{code:s.code,map:null}}}}}function Q(){return{name:"kuaijs-kjst-embed",apply:"build",enforce:"post",generateBundle(t,e){for(const[n,a]of Object.entries(e)){if(a.type!=="asset"||!/\.kjst$/i.test(n))continue;const i=n.replace(/\.kjst$/i,".js"),o=e[i];if(!o||o.type!=="chunk")continue;const u=a.source,s=typeof u=="string"?Buffer.from(u,"binary"):Buffer.from(u),c=Buffer.from(o.code,"utf8"),y=Buffer.alloc(4);y.writeUInt32BE(s.length,0);const B=Buffer.concat([c,s,y,N]);delete e[n],delete e[i],this.emitFile({type:"asset",fileName:i,source:B})}}}}function _(){const t=new Set;return[b(t),b(t),b(t)]}function v(t,e,n,a){const i=[""],o=[],u=K(t);let s=p.randomBytes(2).readUInt16BE(0);s===0&&(s=1),O(u,null,[new Set],(r,l,$)=>{if(r.type==="CallExpression"){const f=r.callee;if(f?.type==="Identifier"){I.has(f.name)&&!A(f.name,$)&&o.push({start:f.start,end:f.end,kind:"nGlobal",a:g(i,f.name)});return}if(f?.type==="MemberExpression"&&f.object?.type==="Identifier"){const m=f.object.name,P=j(f);P&&S.has(m)&&!A(m,$)&&o.push({start:f.start,end:f.end,kind:"nMember",a:g(i,m),b:g(i,P)})}return}if(r.type==="MemberExpression"){if(l?.type==="CallExpression"&&l.callee===r||l?.type==="AssignmentExpression"&&l.left===r||r.object?.type!=="Identifier")return;const f=r.object.name,m=j(r);m&&S.has(f)&&!A(f,$)&&o.push({start:r.start,end:r.end,kind:"p",a:g(i,f),b:g(i,m)});return}if(r.type==="Literal"&&typeof r.value=="string"){if(H(r,l)||l?.type==="Property"&&l.key===r)return;o.push({start:r.start,end:r.end,kind:"s",a:g(i,r.value)});return}r.type==="Property"&&!r.method&&!r.computed&&r.key?.type==="Identifier"&&r.key.name!=="__proto__"&&o.push({start:r.shorthand?r.start:r.key.start,end:r.shorthand?r.end:r.key.end,kind:r.shorthand?"keyShort":"key",a:g(i,r.key.name),ident:r.key.name})});const c=R(i),y=o.map(r=>{const l=c.slotOf[r.a],$=r.b===void 0?0:c.slotOf[r.b];return r.kind==="nGlobal"?{start:r.start,end:r.end,text:`${n}(${d(q(c.globalSlots),s)},${d(l,s)})`}:r.kind==="nMember"?{start:r.start,end:r.end,text:`${n}(${d(l,s)},${d($,s)})`}:r.kind==="p"?{start:r.start,end:r.end,text:`${a}(${d(l,s)},${d($,s)})`}:r.kind==="keyShort"?{start:r.start,end:r.end,text:`[${e}(${d(l,s)})]:${r.ident??""}`}:{start:r.start,end:r.end,text:r.kind==="key"?`[${e}(${d(l,s)})]`:`${e}(${d(l,s)})`}});y.sort((r,l)=>l.start-r.start);const B=new T(t);for(const r of y)r.start===r.end?B.appendLeft(r.start,r.text):B.overwrite(r.start,r.end,r.text);return{code:B.toString(),table:G({s:e,n,p:a,v:c.values,[U]:s}),reservedNames:[e,n,a]}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-vite-plugin",
3
- "version": "1.4.68",
3
+ "version": "1.4.70",
4
4
  "type": "commonjs",
5
5
  "license": "MIT",
6
6
  "publishConfig": {