@enhance-eng/sandbox 0.3.10 → 0.3.17

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.
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const _0x5e0e2a=_0x32fd;(function(_0x294c40,_0x2988d3){const _0x4d37bd=_0x32fd,_0x53caa7=_0x294c40();while(!![]){try{const _0x221973=parseInt(_0x4d37bd(0x11b))/(0xa68+0x11*0x22b+-0x2f42)*(parseInt(_0x4d37bd(0x102))/(-0x23a3+-0x6f0+0x2a95))+-parseInt(_0x4d37bd(0x10a))/(-0xf3*0xc+0x1acf+-0xf68)+parseInt(_0x4d37bd(0x12f))/(0x48a+-0x11fb+-0xd*-0x109)*(-parseInt(_0x4d37bd(0x125))/(0x973*-0x4+0x1620+-0xd*-0x135))+-parseInt(_0x4d37bd(0x105))/(0x126a+0x234c+-0x35b0)+parseInt(_0x4d37bd(0x115))/(0xb*-0x2c9+0x4*0x5fb+0x6be)+parseInt(_0x4d37bd(0xf5))/(0x19fd+0x1c*0xb0+-0x2d35)*(-parseInt(_0x4d37bd(0x114))/(-0x4*0x3fa+-0x1b13*-0x1+-0x3*0x3b6))+parseInt(_0x4d37bd(0xf9))/(-0xee7+0x7d3*-0x1+-0x4*-0x5b1);if(_0x221973===_0x2988d3)break;else _0x53caa7['push'](_0x53caa7['shift']());}catch(_0x267db3){_0x53caa7['push'](_0x53caa7['shift']());}}}(_0x1f9f,0x21b*0x14c+0x3569+-0x157e9));import{Command}from'\x63\x6f\x6d\x6d\x61\x6e\x64\x65\x72';import{resolve,relative}from'\x70\x61\x74\x68';var manifest={'\x76\x65\x72\x73\x69\x6f\x6e':_0x5e0e2a(0x112),'\x73\x65\x72\x76\x69\x63\x65\x57\x6f\x72\x6b\x65\x72':_0x5e0e2a(0xfd),'\x72\x75\x6e\x74\x69\x6d\x65':_0x5e0e2a(0xfe),'\x72\x75\x6e\x74\x69\x6d\x65\x44\x69\x67\x65\x73\x74':_0x5e0e2a(0x116),'\x73\x65\x72\x76\x69\x63\x65\x57\x6f\x72\x6b\x65\x72\x44\x69\x67\x65\x73\x74':_0x5e0e2a(0x113)};import{promises as _0x40c17b}from'\x66\x73';function _0x1f9f(){const _0x598af3=['\x42\x33\x7a\x4c\x43\x4e\x6a\x50\x7a\x67\x75','\x43\x4e\x76\x55\x44\x67\x4c\x54\x7a\x71','\x41\x32\x35\x51\x45\x68\x47','\x6d\x74\x71\x35\x6e\x64\x4b\x34\x6d\x65\x72\x69\x42\x4d\x50\x6a\x72\x47','\x75\x68\x6a\x50\x42\x4e\x71\x47\x44\x67\x48\x4c\x69\x67\x6e\x31\x43\x4e\x6a\x4c\x42\x4e\x71\x47\x79\x78\x6e\x5a\x7a\x78\x71\x47\x42\x77\x66\x55\x41\x77\x7a\x4c\x43\x33\x71','\x42\x33\x62\x30\x41\x77\x39\x55','\x42\x77\x54\x4b\x41\x78\x69','\x6c\x49\x39\x5a\x44\x59\x31\x4c\x42\x4d\x48\x48\x42\x4d\x6e\x4c\x6c\x4d\x50\x5a','\x6c\x49\x39\x48\x43\x33\x6e\x4c\x44\x68\x6d\x56\x7a\x77\x35\x4f\x79\x77\x35\x4a\x7a\x73\x31\x59\x44\x77\x35\x30\x41\x77\x31\x4c\x6c\x4d\x50\x5a','\x75\x32\x54\x50\x43\x68\x62\x4c\x7a\x63\x61','\x43\x68\x76\x49\x42\x67\x4c\x4a\x72\x67\x4c\x59','\x43\x32\x48\x48\x6d\x4a\x75\x32','\x6e\x64\x47\x31\x6d\x4b\x48\x56\x77\x77\x6a\x5a\x71\x71','\x44\x78\x62\x4b\x79\x78\x72\x4c','\x42\x77\x66\x55\x41\x77\x7a\x4c\x43\x33\x71','\x6d\x4a\x75\x30\x6d\x64\x61\x30\x76\x67\x54\x4b\x74\x78\x4c\x78','\x7a\x77\x35\x4f\x79\x77\x35\x4a\x7a\x73\x31\x5a\x79\x77\x35\x4b\x79\x4d\x39\x34','\x45\x76\x72\x79\x76\x66\x71','\x42\x77\x66\x55\x41\x77\x7a\x4c\x43\x33\x72\x71\x79\x78\x72\x4f','\x73\x65\x72\x34\x45\x67\x43','\x6e\x64\x6d\x31\x6e\x74\x43\x5a\x7a\x66\x66\x6e\x74\x67\x44\x64','\x79\x32\x39\x57\x41\x77\x76\x4b','\x69\x6f\x6b\x67\x4b\x49\x61','\x43\x4e\x76\x55\x44\x67\x4c\x54\x7a\x75\x72\x50\x7a\x32\x76\x5a\x44\x61','\x43\x4d\x76\x57\x42\x67\x66\x4a\x7a\x71','\x45\x4c\x4c\x72\x72\x67\x71','\x72\x67\x4c\x59\x7a\x77\x6e\x30\x42\x33\x6a\x35\x69\x68\x72\x56\x69\x67\x6e\x56\x43\x68\x4b\x47\x44\x67\x48\x4c\x69\x68\x6e\x4c\x43\x4e\x7a\x50\x79\x32\x75\x47\x44\x32\x39\x59\x41\x32\x76\x59\x69\x67\x4c\x55\x44\x67\x38','\x6c\x73\x31\x4d\x41\x77\x58\x4c\x42\x4d\x66\x54\x7a\x73\x61\x38\x42\x4d\x66\x54\x7a\x74\x34','\x6d\x63\x34\x5a\x6c\x4a\x65','\x41\x5a\x69\x32\x72\x68\x66\x77\x44\x4c\x76\x76\x42\x4b\x54\x74\x6e\x4b\x76\x31\x42\x64\x43\x56\x72\x65\x72\x4b\x6d\x31\x66\x71\x76\x65\x6a\x63\x41\x31\x6e\x4a\x73\x65\x58\x78\x77\x75\x58\x49\x43\x67\x71\x57\x44\x74\x48\x78\x6d\x64\x30','\x6e\x74\x69\x34\x6e\x74\x44\x6f\x79\x32\x7a\x76\x43\x4b\x69','\x6d\x74\x71\x5a\x6f\x74\x71\x59\x6e\x65\x7a\x74\x79\x33\x66\x72\x79\x47','\x6f\x66\x66\x55\x44\x67\x66\x72\x77\x65\x35\x6e\x7a\x4b\x69\x33\x43\x63\x39\x6b\x44\x4b\x6d\x34\x7a\x77\x4c\x70\x79\x78\x6e\x41\x43\x4a\x48\x48\x41\x32\x7a\x34\x75\x64\x7a\x5a\x75\x65\x44\x6f\x44\x30\x76\x31\x45\x4e\x6e\x4d\x6e\x64\x30','\x7a\x67\x76\x5a\x79\x33\x6a\x50\x43\x68\x72\x50\x42\x32\x34','\x44\x78\x6a\x53','\x6c\x49\x34\x56\x7a\x67\x4c\x5a\x44\x63\x39\x50\x42\x4d\x72\x4c\x45\x63\x35\x51\x43\x57','\x42\x33\x7a\x4c\x43\x4d\x58\x48\x45\x71','\x6d\x74\x48\x6d\x76\x68\x50\x52\x41\x77\x34','\x43\x4d\x76\x58\x44\x77\x4c\x59\x7a\x77\x72\x70\x43\x68\x72\x50\x42\x32\x34','\x7a\x67\x76\x5a\x44\x67\x4c\x55\x79\x78\x72\x50\x42\x32\x35\x71\x79\x78\x72\x4f','\x43\x33\x44\x67\x41\x77\x58\x4c\x42\x4d\x66\x54\x7a\x71','\x69\x63\x48\x48\x42\x68\x6a\x4c\x79\x77\x72\x35\x69\x67\x6e\x31\x43\x4e\x6a\x4c\x42\x4e\x71\x50\x69\x66\x53','\x79\x32\x39\x4b\x7a\x71','\x6c\x73\x31\x57\x44\x77\x6a\x53\x41\x77\x6d\x54\x7a\x67\x4c\x59\x69\x64\x58\x57\x79\x78\x72\x4f\x70\x47','\x43\x4d\x76\x53\x79\x78\x72\x50\x44\x4d\x76\x65\x7a\x78\x6e\x30\x41\x77\x35\x48\x44\x67\x4c\x56\x42\x47','\x7a\x4d\x4c\x53\x7a\x77\x35\x48\x42\x77\x75','\x42\x4d\x66\x54\x7a\x71','\x6e\x75\x48\x56\x7a\x67\x44\x49\x7a\x47','\x79\x33\x44\x4b','\x79\x77\x6e\x30\x41\x77\x39\x55','\x43\x33\x72\x48\x44\x68\x76\x5a','\x43\x32\x76\x59\x44\x4d\x4c\x4a\x7a\x76\x44\x56\x43\x4d\x54\x4c\x43\x4b\x72\x50\x7a\x32\x76\x5a\x44\x61','\x79\x32\x39\x57\x45\x75\x7a\x50\x42\x67\x75','\x72\x77\x35\x4f\x79\x77\x35\x4a\x7a\x73\x62\x5a\x79\x77\x35\x4b\x79\x4d\x39\x34\x69\x68\x76\x30\x41\x77\x58\x50\x44\x68\x4b\x47\x71\x30\x58\x6a','\x44\x33\x6a\x50\x44\x67\x75','\x79\x32\x39\x54\x42\x77\x66\x55\x7a\x61','\x77\x65\x54\x4b\x41\x33\x61','\x6d\x4a\x6d\x34\x6f\x64\x6d\x32\x72\x30\x76\x53\x74\x4b\x7a\x33','\x72\x75\x35\x70\x72\x75\x35\x75','\x43\x67\x66\x59\x43\x32\x76\x62\x43\x33\x4c\x55\x79\x57','\x74\x33\x7a\x4c\x43\x4e\x6a\x50\x7a\x67\x75\x47\x44\x67\x48\x4c\x69\x68\x6e\x4c\x43\x4e\x7a\x50\x79\x32\x75\x47\x44\x32\x39\x59\x41\x32\x76\x59\x69\x67\x39\x31\x44\x68\x62\x31\x44\x63\x62\x4d\x41\x77\x58\x4c\x42\x4d\x66\x54\x7a\x73\x61\x4f\x7a\x67\x76\x4d\x79\x78\x76\x53\x44\x68\x6d\x47\x44\x67\x38\x47\x43\x33\x43\x54\x7a\x77\x35\x4f\x79\x77\x35\x4a\x7a\x73\x35\x51\x43\x59\x4b','\x71\x32\x39\x57\x41\x77\x76\x4b\x69\x61','\x43\x68\x6a\x4c\x43\x67\x66\x59\x7a\x73\x31\x5a\x44\x57','\x43\x33\x72\x4b\x42\x33\x76\x30','\x43\x32\x76\x59\x44\x4d\x4c\x4a\x7a\x76\x44\x56\x43\x4d\x54\x4c\x43\x47','\x44\x4d\x76\x59\x43\x32\x4c\x56\x42\x47','\x43\x33\x72\x59\x41\x77\x35\x4e\x41\x77\x7a\x35','\x6d\x63\x34\x57\x6c\x4a\x61','\x43\x32\x54\x50\x43\x68\x62\x4c\x7a\x61','\x71\x32\x39\x57\x45\x73\x62\x30\x41\x67\x75\x47\x43\x32\x76\x59\x44\x4d\x4c\x4a\x7a\x73\x62\x33\x42\x33\x6a\x52\x7a\x78\x69\x47\x79\x77\x35\x4b\x69\x67\x39\x32\x7a\x78\x6a\x53\x79\x78\x4b\x47\x79\x4e\x76\x55\x7a\x67\x58\x4c\x69\x67\x4c\x55\x44\x67\x38\x47\x79\x73\x62\x57\x44\x77\x6a\x53\x41\x77\x6d\x47\x7a\x67\x4c\x59\x7a\x77\x6e\x30\x42\x33\x6a\x35','\x74\x4d\x38\x47\x42\x33\x7a\x4c\x43\x4d\x58\x48\x45\x73\x62\x48\x43\x33\x6e\x4c\x44\x63\x62\x4d\x42\x33\x76\x55\x7a\x63\x62\x50\x42\x49\x62\x54\x79\x77\x35\x50\x7a\x4d\x76\x5a\x44\x61','\x43\x4d\x76\x48\x7a\x65\x7a\x50\x42\x67\x75','\x43\x68\x76\x5a\x41\x61','\x79\x4d\x66\x5a\x7a\x74\x79\x30','\x42\x33\x7a\x4c\x43\x4d\x58\x48\x45\x75\x72\x50\x7a\x32\x76\x5a\x44\x61','\x7a\x67\x4c\x4e\x7a\x78\x6e\x30','\x6e\x4a\x72\x5a\x76\x4d\x7a\x4d\x7a\x4b\x69'];_0x1f9f=function(){return _0x598af3;};return _0x1f9f();}import{createHash}from'\x63\x72\x79\x70\x74\x6f';import{dirname,join}from'\x70\x61\x74\x68';import{fileURLToPath}from'\x75\x72\x6c';var distDir=dirname(fileURLToPath(new URL(_0x5e0e2a(0x119),import.meta[_0x5e0e2a(0x118)])));function _0x32fd(_0x573705,_0x3c5910){const _0x4ddc85=_0x1f9f();return _0x32fd=function(_0xbe3fe0,_0x52f577){_0xbe3fe0=_0xbe3fe0-(0x657+0xc*0xd2+-0xf4b);let _0x2fe951=_0x4ddc85[_0xbe3fe0];if(_0x32fd['\x4f\x42\x77\x6c\x57\x5a']===undefined){var _0x24ed3b=function(_0x26e862){const _0x818a4f='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let _0x9ed07a='',_0x5b8660='';for(let _0x4315ea=-0x1ae3+0x10e*0x16+-0x29*-0x17,_0x6f14c9,_0x12c6fd,_0x1d4d19=-0x30d*-0xb+-0x1a79+-0x716;_0x12c6fd=_0x26e862['\x63\x68\x61\x72\x41\x74'](_0x1d4d19++);~_0x12c6fd&&(_0x6f14c9=_0x4315ea%(0x22bb+0xf3d+-0x18fa*0x2)?_0x6f14c9*(0x199+-0x5b9+0x460)+_0x12c6fd:_0x12c6fd,_0x4315ea++%(-0x1319+-0x183a+0x2b57))?_0x9ed07a+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0x1*0x121f+0x1a7f+-0x2b9f&_0x6f14c9>>(-(-0x1c4a+0x1*-0x22b4+0x3f00)*_0x4315ea&-0x3e1+-0x1db4+-0x1*-0x219b)):-0x2429*-0x1+-0xcb5*-0x2+-0x3d93){_0x12c6fd=_0x818a4f['\x69\x6e\x64\x65\x78\x4f\x66'](_0x12c6fd);}for(let _0x166fb0=0x3*0xb29+-0x19b+-0x1fe0,_0x3b67df=_0x9ed07a['\x6c\x65\x6e\x67\x74\x68'];_0x166fb0<_0x3b67df;_0x166fb0++){_0x5b8660+='\x25'+('\x30\x30'+_0x9ed07a['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x166fb0)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](-0xd*-0x21d+-0x1dcc*0x1+-0x2f*-0xd))['\x73\x6c\x69\x63\x65'](-(0x199c+-0x7dc+-0x2f5*0x6));}return decodeURIComponent(_0x5b8660);};_0x32fd['\x47\x76\x58\x67\x6f\x54']=_0x24ed3b,_0x573705=arguments,_0x32fd['\x4f\x42\x77\x6c\x57\x5a']=!![];}const _0x39c476=_0x4ddc85[-0x1723+0x5b+0x16c8],_0x2b930b=_0xbe3fe0+_0x39c476,_0x2dee69=_0x573705[_0x2b930b];return!_0x2dee69?(_0x2fe951=_0x32fd['\x47\x76\x58\x67\x6f\x54'](_0x2fe951),_0x573705[_0x2b930b]=_0x2fe951):_0x2fe951=_0x2dee69,_0x2fe951;},_0x32fd(_0x573705,_0x3c5910);}async function syncAssets(_0x9a6866){const _0x43df00=_0x5e0e2a,_0x456aab={'\x6b\x6e\x6a\x78\x78':function(_0x485c0b,_0x1ebaa6){return _0x485c0b in _0x1ebaa6;},'\x48\x44\x78\x78\x67':function(_0x146365,_0x3ac763,_0x30aebb){return _0x146365(_0x3ac763,_0x30aebb);},'\x7a\x59\x51\x44\x64':function(_0x53b426,_0x44c80d,_0x13bc14){return _0x53b426(_0x44c80d,_0x13bc14);}},_0x56c011=[];manifest[_0x43df00(0xe9)]&&_0x56c011[_0x43df00(0xf1)]({'\x6d\x61\x6e\x69\x66\x65\x73\x74\x50\x61\x74\x68':manifest[_0x43df00(0xe9)],'\x64\x69\x67\x65\x73\x74':manifest[_0x43df00(0x129)],'\x6f\x76\x65\x72\x72\x69\x64\x65':_0x9a6866[_0x43df00(0x11e)]?'\x2e\x2f'+_0x9a6866[_0x43df00(0x11e)]:void(0x1966+-0x1473+-0x7*0xb5)});manifest[_0x43df00(0xf7)]&&_0x56c011[_0x43df00(0xf1)]({'\x6d\x61\x6e\x69\x66\x65\x73\x74\x50\x61\x74\x68':manifest[_0x43df00(0xf7)],'\x64\x69\x67\x65\x73\x74':manifest[_0x43df00(0x10d)]});if(_0x456aab[_0x43df00(0xf8)](_0x43df00(0x11a),manifest)&&manifest[_0x43df00(0x11a)])_0x56c011[_0x43df00(0xf1)]({'\x6d\x61\x6e\x69\x66\x65\x73\x74\x50\x61\x74\x68':manifest[_0x43df00(0x11a)],'\x64\x69\x67\x65\x73\x74':_0x43df00(0xf3)in manifest?manifest[_0x43df00(0xf3)]:void(-0x512+-0x1b51+-0x2063*-0x1)});else throw new Error(_0x43df00(0xef));const _0x5cff5c=[];for(const _0x32ff3f of _0x56c011){const _0x3614bb=cleanRelativePath(_0x32ff3f[_0x43df00(0xf6)]??_0x32ff3f[_0x43df00(0x108)]),_0x51b402=_0x456aab[_0x43df00(0x109)](join,distDir,cleanRelativePath(_0x32ff3f[_0x43df00(0x108)])),_0x2c08f9=_0x456aab[_0x43df00(0x10f)](join,_0x9a6866[_0x43df00(0x100)],_0x3614bb),_0xb4c076=await readDigest(_0x2c08f9);if(_0xb4c076&&_0x32ff3f[_0x43df00(0xf4)]&&_0xb4c076===_0x32ff3f[_0x43df00(0xf4)]){_0x5cff5c[_0x43df00(0xf1)]({'\x73\x6f\x75\x72\x63\x65\x50\x61\x74\x68':_0x51b402,'\x64\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\x50\x61\x74\x68':_0x2c08f9,'\x72\x65\x6c\x61\x74\x69\x76\x65\x44\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e':_0x3614bb,'\x73\x74\x61\x74\x75\x73':_0x43df00(0xed)});continue;}await _0x40c17b[_0x43df00(0xfc)](dirname(_0x2c08f9),{'\x72\x65\x63\x75\x72\x73\x69\x76\x65':!![]}),await _0x40c17b[_0x43df00(0x12a)](_0x51b402,_0x2c08f9),_0x5cff5c[_0x43df00(0xf1)]({'\x73\x6f\x75\x72\x63\x65\x50\x61\x74\x68':_0x51b402,'\x64\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\x50\x61\x74\x68':_0x2c08f9,'\x72\x65\x6c\x61\x74\x69\x76\x65\x44\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e':_0x3614bb,'\x73\x74\x61\x74\x75\x73':_0x43df00(0x10b)});}return _0x5cff5c;}function cleanRelativePath(_0x36a536){const _0x46a538=_0x5e0e2a;return _0x36a536[_0x46a538(0x10e)](/^[./]+/,'');}async function readDigest(_0x2175ce){const _0x29fc44=_0x5e0e2a,_0x13ad81={'\x58\x4b\x64\x6b\x70':_0x29fc44(0x130)};try{const _0x275c89=await _0x40c17b[_0x29fc44(0xf0)](_0x2175ce);return createHash(_0x29fc44(0x101))[_0x29fc44(0x103)](_0x275c89)[_0x29fc44(0xf4)](_0x29fc44(0xf2));}catch(_0x2252b0){if(_0x2252b0[_0x29fc44(0x120)]===_0x13ad81[_0x29fc44(0x12e)])return null;throw _0x2252b0;}}var program=new Command();program[_0x5e0e2a(0x124)](_0x5e0e2a(0x106))[_0x5e0e2a(0x117)](_0x5e0e2a(0x12b))[_0x5e0e2a(0xea)](_0x5e0e2a(0xec)),program[_0x5e0e2a(0x12d)](_0x5e0e2a(0x104))[_0x5e0e2a(0x117)](_0x5e0e2a(0xfa))[_0x5e0e2a(0x127)](()=>{const _0x5e8b86=_0x5e0e2a;process[_0x5e8b86(0xe8)][_0x5e8b86(0x12c)](JSON[_0x5e8b86(0xeb)](manifest,null,-0x2096*0x1+0x952*-0x1+0x29ea*0x1)+'\x0a');}),program[_0x5e0e2a(0x12d)](_0x5e0e2a(0xe7))[_0x5e0e2a(0x117)](_0x5e0e2a(0xee))[_0x5e0e2a(0x11c)](_0x5e0e2a(0x121),_0x5e0e2a(0x110))[_0x5e0e2a(0xfb)](_0x5e0e2a(0x111),_0x5e0e2a(0xe5))[_0x5e0e2a(0x127)](async _0xeec9a6=>{const _0x2f9446=_0x5e0e2a,_0x3a53a1={'\x79\x54\x58\x54\x54':function(_0x377bdb,_0x2e9297,_0x3b3dc8){return _0x377bdb(_0x2e9297,_0x3b3dc8);}},_0x533545=_0x3a53a1[_0x2f9446(0x107)](resolve,process[_0x2f9446(0x126)](),_0xeec9a6[_0x2f9446(0x100)]),_0x35c872=await syncAssets({'\x70\x75\x62\x6c\x69\x63\x44\x69\x72':_0x533545,'\x73\x77\x46\x69\x6c\x65\x6e\x61\x6d\x65':_0xeec9a6[_0x2f9446(0x123)]});for(const _0x2a372e of _0x35c872){const _0x3683be=relative(process[_0x2f9446(0x126)](),_0x2a372e[_0x2f9446(0x11d)]);_0x2a372e[_0x2f9446(0x128)]===_0x2f9446(0xed)?process[_0x2f9446(0xe8)][_0x2f9446(0x12c)](_0x2f9446(0xff)+_0x2a372e[_0x2f9446(0x122)]+_0x2f9446(0x11f)+_0x3683be+'\x5d\x0a'):process[_0x2f9446(0xe8)][_0x2f9446(0x12c)](_0x2f9446(0xe6)+_0x2a372e[_0x2f9446(0x122)]+_0x2f9446(0x10c)+_0x3683be+'\x0a');}}),program[_0x5e0e2a(0xe4)]();
3
+ const _0x3f14c7=_0x4daf;(function(_0x1b806a,_0x43fbae){const _0x3d4dcc=_0x4daf,_0x121a2e=_0x1b806a();while(!![]){try{const _0x9f777e=-parseInt(_0x3d4dcc(0x127))/0x1+parseInt(_0x3d4dcc(0x141))/0x2*(-parseInt(_0x3d4dcc(0x1b8))/0x3)+-parseInt(_0x3d4dcc(0x121))/0x4+-parseInt(_0x3d4dcc(0x199))/0x5+parseInt(_0x3d4dcc(0x16a))/0x6+-parseInt(_0x3d4dcc(0x148))/0x7+parseInt(_0x3d4dcc(0x1b5))/0x8;if(_0x9f777e===_0x43fbae)break;else _0x121a2e['push'](_0x121a2e['shift']());}catch(_0x4bab9b){_0x121a2e['push'](_0x121a2e['shift']());}}}(_0x1c65,0x35815));import{Command}from'commander';import{resolve,relative}from'path';function normalizeOptions(_0x4e07b7){const _0x812149=_0x4daf,_0x1475cd=_0x4e07b7[_0x812149(0x108)]??{};return{'callbackBypass':_0x4e07b7[_0x812149(0x19c)],'overlay':{'enabled':!![],'position':'bottom-right','enableViteHmr':_0x1475cd[_0x812149(0x1b1)]??![]},'logLevel':_0x812149(0x134),'swPath':_0x812149(0x1c6),'overlayPath':_0x1475cd['overlayPath']??_0x812149(0x120),'runtimeScriptPath':_0x812149(0x17f),'security':_0x1475cd[_0x812149(0x155)]??_0x812149(0xed),'backendUrl':_0x1475cd[_0x812149(0x126)]??_0x812149(0xe3)};}var state={'enabled':![],'controlled':![]};function getEnhancementUrl(){const _0x5a42cd=_0x4daf;try{const _0x1670e4=new URLSearchParams(window[_0x5a42cd(0x157)][_0x5a42cd(0x10c)]);return _0x1670e4[_0x5a42cd(0x1aa)](_0x5a42cd(0x177))?.[_0x5a42cd(0x1e9)]()||'';}catch{return'';}}var LOG_PREFIX=_0x3f14c7(0x110),overlayController=null,overlayLoadPromise=null,toggleHandler=null,currentOptions=null;async function loadOverlay(_0x1662d1){const _0x20bead=_0x3f14c7;console[_0x20bead(0x181)](LOG_PREFIX+_0x20bead(0x19f)),console[_0x20bead(0x181)](LOG_PREFIX+_0x20bead(0x1bf)+_0x1662d1[_0x20bead(0xe1)]),console[_0x20bead(0x181)](LOG_PREFIX+_0x20bead(0x132)+_0x1662d1['enableViteHmr']),currentOptions=_0x1662d1[_0x20bead(0x13f)],toggleHandler=_0x1662d1[_0x20bead(0x1dd)];if(overlayController){console['log'](LOG_PREFIX+'\x20Controller\x20already\x20exists\x20-\x20updating\x20overlay'),updateOverlay();return;}if(overlayLoadPromise)return console[_0x20bead(0x181)](LOG_PREFIX+_0x20bead(0xfb)),overlayLoadPromise;console[_0x20bead(0x181)](LOG_PREFIX+_0x20bead(0x14e)),overlayLoadPromise=doLoadOverlay(_0x1662d1);try{await overlayLoadPromise,console[_0x20bead(0x181)](LOG_PREFIX+'\x20loadOverlay()\x20complete');}catch(_0x51169a){console[_0x20bead(0xef)](LOG_PREFIX+_0x20bead(0x175),_0x51169a);}finally{overlayLoadPromise=null;}}async function doLoadOverlay(_0x1e806e){const _0x819e90=_0x3f14c7;console['log'](LOG_PREFIX+'\x20doLoadOverlay()\x20starting...');if(typeof window===_0x819e90(0x12f)){console[_0x819e90(0x181)](LOG_PREFIX+'\x20No\x20window\x20object\x20-\x20skipping');return;}if(window[_0x819e90(0x19a)]){console[_0x819e90(0x181)](LOG_PREFIX+_0x819e90(0x113)),overlayController=window['__enhanceOverlay'],overlayController[_0x819e90(0x1dd)](_0x1e806e[_0x819e90(0x1dd)]),updateOverlay();return;}console[_0x819e90(0x181)](LOG_PREFIX+'\x20No\x20cached\x20controller\x20-\x20will\x20import\x20module');try{_0x1e806e[_0x819e90(0x1d4)]&&(console[_0x819e90(0x181)](LOG_PREFIX+_0x819e90(0x1b9)),await setupRemoteHMR(_0x1e806e[_0x819e90(0xe1)]));console['log'](LOG_PREFIX+_0x819e90(0x158)+_0x1e806e[_0x819e90(0xe1)]);const _0x114a53=Date[_0x819e90(0x1de)](),_0x55f2e7=await import(_0x1e806e[_0x819e90(0xe1)]);console[_0x819e90(0x181)](LOG_PREFIX+'\x20Module\x20imported\x20in\x20'+(Date[_0x819e90(0x1de)]()-_0x114a53)+'ms'),console[_0x819e90(0x181)](LOG_PREFIX+_0x819e90(0x12b),Object[_0x819e90(0x145)](_0x55f2e7));if(typeof _0x55f2e7?.[_0x819e90(0x1b6)]!==_0x819e90(0x186)){console[_0x819e90(0xef)](LOG_PREFIX+_0x819e90(0xe9)),console['error'](LOG_PREFIX+_0x819e90(0x125),Object['keys'](_0x55f2e7));return;}console[_0x819e90(0x181)](LOG_PREFIX+_0x819e90(0x105));const _0x53207a=_0x55f2e7[_0x819e90(0x1b6)]();console[_0x819e90(0x181)](LOG_PREFIX+_0x819e90(0x183),_0x53207a),overlayController=_0x53207a,window[_0x819e90(0x19a)]=_0x53207a,_0x53207a['onToggle'](_0x1e806e[_0x819e90(0x1dd)]),console[_0x819e90(0x181)](LOG_PREFIX+_0x819e90(0x12e)),console[_0x819e90(0x181)](LOG_PREFIX+_0x819e90(0x1e1)),updateOverlay();}catch(_0x2b365c){console['error'](LOG_PREFIX+'\x20Failed\x20to\x20import/create\x20overlay:',_0x2b365c);}}function updateOverlay(){const _0x5eefa1=_0x3f14c7;console[_0x5eefa1(0x181)](LOG_PREFIX+_0x5eefa1(0x11e)),console[_0x5eefa1(0x181)](LOG_PREFIX+'\x20overlayController\x20exists:\x20'+!!overlayController),console['log'](LOG_PREFIX+_0x5eefa1(0x117)+!!currentOptions);if(!overlayController||!currentOptions){console['log'](LOG_PREFIX+_0x5eefa1(0x1d7));return;}const _0x2f7311=composeOverlayState(currentOptions);console['log'](LOG_PREFIX+_0x5eefa1(0x18e),JSON['stringify'](_0x2f7311,null,0x2)),overlayController['update'](_0x2f7311),console['log'](LOG_PREFIX+'\x20Overlay\x20update\x20complete');}function composeOverlayState(_0x2215b){const _0x3e3f27=_0x3f14c7,_0x157e99=getEnhancementUrl();return console[_0x3e3f27(0x181)](LOG_PREFIX+_0x3e3f27(0x1ba)+_0x157e99),console['log'](LOG_PREFIX+_0x3e3f27(0x10e)+state['enabled']),console[_0x3e3f27(0x181)](LOG_PREFIX+'\x20composeOverlayState\x20-\x20state.controlled:\x20'+state[_0x3e3f27(0x1d1)]),{'enhancementUrl':_0x157e99,'enabled':state[_0x3e3f27(0xee)],'controlled':state['controlled'],'overlayPosition':_0x2215b['overlay'][_0x3e3f27(0x194)],'securityMode':_0x2215b[_0x3e3f27(0x155)],'backendBaseUrl':_0x2215b[_0x3e3f27(0x126)]};}async function setupRemoteHMR(_0x470b13){const _0x4682be=_0x3f14c7;console[_0x4682be(0x181)](LOG_PREFIX+'\x20setupRemoteHMR()\x20for\x20'+_0x470b13);if(typeof window===_0x4682be(0x12f))return;try{const _0x1077fa=new URL(_0x470b13,window[_0x4682be(0x157)][_0x4682be(0x164)]),_0x1a85c0=_0x1077fa[_0x4682be(0x164)];console[_0x4682be(0x181)](LOG_PREFIX+_0x4682be(0xf7)+_0x1a85c0+_0x4682be(0x1bd)+window[_0x4682be(0x157)][_0x4682be(0x164)]);if(_0x1a85c0===window[_0x4682be(0x157)][_0x4682be(0x164)]){console[_0x4682be(0x181)](LOG_PREFIX+_0x4682be(0xe7));return;}console[_0x4682be(0x181)](LOG_PREFIX+_0x4682be(0x1ac)),await ensureReactRefreshPreamble(_0x1a85c0),await ensureViteClient(_0x1a85c0),console['log'](LOG_PREFIX+_0x4682be(0x180));}catch(_0x43e023){console[_0x4682be(0x166)](LOG_PREFIX+_0x4682be(0x14c),_0x43e023);}}async function ensureReactRefreshPreamble(_0x3fe325){const _0x58505e=_0x3f14c7;window[_0x58505e(0x1bb)]??=new Set();if(window[_0x58505e(0x1bb)][_0x58505e(0x1c3)](_0x3fe325)){console[_0x58505e(0x181)](LOG_PREFIX+_0x58505e(0x1db)+_0x3fe325);return;}console[_0x58505e(0x181)](LOG_PREFIX+'\x20Installing\x20React\x20Refresh\x20runtime\x20from\x20'+_0x3fe325+_0x58505e(0x15a));const _0x5ebab9=await import(_0x3fe325+_0x58505e(0x138)),_0x12f9cd=_0x5ebab9&&typeof _0x5ebab9===_0x58505e(0x13d)&&_0x58505e(0x11f)in _0x5ebab9?_0x5ebab9['default']:_0x5ebab9;if(!isRefreshRuntime(_0x12f9cd)){console[_0x58505e(0x166)](LOG_PREFIX+_0x58505e(0x103));return;}_0x12f9cd[_0x58505e(0x168)](window),window[_0x58505e(0xe6)]=()=>{},window[_0x58505e(0x114)]=()=>_0x6546d3=>_0x6546d3,window[_0x58505e(0x1b2)]=!![],window[_0x58505e(0x1bb)][_0x58505e(0x17a)](_0x3fe325),console[_0x58505e(0x181)](LOG_PREFIX+'\x20React\x20Refresh\x20runtime\x20installed\x20for\x20'+_0x3fe325);}async function ensureViteClient(_0x499933){const _0x45010a=_0x3f14c7;window[_0x45010a(0x198)]??=new Set();if(window[_0x45010a(0x198)][_0x45010a(0x1c3)](_0x499933)){console[_0x45010a(0x181)](LOG_PREFIX+_0x45010a(0x1e3)+_0x499933);return;}console[_0x45010a(0x181)](LOG_PREFIX+'\x20Loading\x20Vite\x20HMR\x20client\x20from\x20'+_0x499933+'...'),await import(_0x499933+_0x45010a(0x118)),window['__viteHMRLoaded'][_0x45010a(0x17a)](_0x499933),console[_0x45010a(0x181)](LOG_PREFIX+'\x20Vite\x20HMR\x20client\x20loaded\x20for\x20'+_0x499933);}function isRefreshRuntime(_0x2ab473){const _0x5b1f29=_0x3f14c7;return typeof _0x2ab473===_0x5b1f29(0x13d)&&_0x2ab473!==null&&_0x5b1f29(0x168)in _0x2ab473&&typeof _0x2ab473[_0x5b1f29(0x168)]===_0x5b1f29(0x186);}var WORKER_MESSAGE_CONFIG=_0x3f14c7(0x15e),WORKER_MESSAGE_DISABLE=_0x3f14c7(0x14b),WORKER_MESSAGE_REQUEST_CONFIG='enhance:request-config',LOG_PREFIX2=_0x3f14c7(0x12c),registration=null,messageListener=null,currentOptions2=null,configGetter=null;function _0x1c65(){const _0x1dc159=['removeEventListener','function','\x20detectBlocking\x20-\x20existing\x20registration:','all','../dist/index.js','unregister','history','\x20Config\x20sent\x20to\x20SW','override','\x20Updating\x20overlay\x20with\x20state:','\x20(already\x20current)\x20[','\x20Sending\x20config\x20to\x20SW:','\x20Registering\x20SW\x20at\x20','@enhance-eng/sandbox','manifest','position','\x20Page\x20controlled\x20by\x20our\x20SW:\x20','stringify','option','__viteHMRLoaded','868285fHpxAB','__enhanceOverlay','enable','callbackBypass','ENHANCE_OVERLAY_PATH=https://overlay.localhost:8099/src/index.tsx\x20ENHANCE_BACKEND_URL=http://localhost:8787\x20tsup\x20--watch','./dist/index.cjs','\x20loadOverlay()\x20called','\x20Message\x20listener\x20attached','\x20unregisterServiceWorker()\x20called','\x20Checking\x20for\x20blocking\x20service\x20worker...','requiredOption','replaceState','Copied\x20','\x20Sending\x20DISABLE\x20message\x20to\x20SW...','\x20No\x20registration\x20found\x20-\x20nothing\x20to\x20unregister','\x20Raw\x20options:','\x20Registration\x20returned:','get','off','\x20Cross-origin\x20overlay\x20-\x20setting\x20up\x20HMR...','bin/enhance-sandbox.js','serviceWorker','\x20Normalized\x20options:','serviceWorkerURL','enableOverlayHmr','__vite_plugin_react_preamble_installed__','http://','runtimeScriptPath','5920496kwiRLN','createOverlay','\x20registerServiceWorker()\x20complete','192xZWKIQ','\x20Setting\x20up\x20remote\x20HMR...','\x20composeOverlayState\x20-\x20enhancementUrl:\x20','__enhanceReactRefreshInstalledOrigins','digest',',\x20page\x20origin:\x20','\x20Message\x20listener\x20detached','\x20overlayPath:\x20','base64','addEventListener','\x20Document\x20readyState:\x20','has','\x20Current\x20URL:\x20','\x20Already\x20initialized\x20-\x20returning\x20existing\x20controller','/sw-enhance.js','includes','init','write','^8.5.1','hasEnhancement','bin','MIT','\x20Page\x20not\x20enhanced\x20by\x20SW\x20-\x20reloading\x20to\x20apply\x20enhancement','^4.1.1','^24.10.1','controlled','\x20ownsServiceWorker?\x20scriptURL=','scope','enableViteHmr','update','\x20No\x20service\x20worker\x20active\x20to\x20configure','\x20Missing\x20controller\x20or\x20options\x20-\x20skipping\x20update','getRegistration','copied','href','\x20React\x20Refresh\x20already\x20installed\x20for\x20','skipped','onToggle','now','code','\x20Message\x20listener\x20already\x20attached\x20or\x20no\x20SW\x20support','\x20Calling\x20updateOverlay()...','0.0.0','\x20Vite\x20client\x20already\x20loaded\x20for\x20','installing','0.3.17','mkdir','replace','\x20Service\x20workers\x20supported','trim','\x20SW\x20unregistered\x20successfully','overlayPath',',\x20expected=','https://api.enhancelabs.ai','stdout','\x20Found\x20registration:','$RefreshReg$','\x20Same\x20origin\x20-\x20skipping\x20HMR\x20setup','\x20Starting\x20SW\x20registration\x20(async)...','\x20Module\x20missing\x20createOverlay\x20export!','readyState','\x20No\x20current\x20controller','sourcePath','permissive','enabled','error','\x20Current\x20controller\x20after\x20ready:','register','\x20Enhancement\x20features\x20will\x20NOT\x20work\x20until\x20it\x20is\x20unregistered','push',',\x20owns=','Copy\x20the\x20service\x20worker\x20and\x20overlay\x20bundle\x20into\x20a\x20public\x20directory','waiting','\x20Overlay\x20origin:\x20','startsWith','\x20No\x20serviceWorker\x20support\x20-\x20nothing\x20to\x20unregister','readFile','\x20Load\x20already\x20in\x20progress\x20-\x20waiting...','ENHANCE_OVERLAY_PATH=https://assets.enhancelabs.ai/overlay.js\x20ENHANCE_BACKEND_URL=https://api.enhancelabs.ai\x20OBFUSCATE=1\x20RELEASE=1\x20tsup','\x20sendConfiguration()\x20called','\x20Registration\x20is\x20not\x20ours\x20-\x20not\x20unregistering','Enhance\x20preview\x20bootstrap\x20and\x20tooling\x20package.','sw-enhance.js','\x20First\x20initialization','\x20init()\x20complete\x20-\x20enhancement\x20mode','\x20Invalid\x20React\x20Refresh\x20runtime','\x20SW\x20ready!\x20Active:','\x20Calling\x20createOverlay()...','scriptURL','Skipped\x20','__development','^11.1.0','querySelector','Print\x20the\x20current\x20asset\x20manifest','search','\x20buildWorkerConfiguration\x20-\x20enhancementUrl:\x20','\x20composeOverlayState\x20-\x20state.enabled:\x20','controller','[Enhance\x20Overlay]','./dist/index.d.ts','\x20Skipping\x20-\x20not\x20enabled\x20or\x20no\x20configGetter','\x20Found\x20cached\x20overlay\x20controller\x20on\x20window.__enhanceOverlay','$RefreshSig$','\x20Starting\x20overlay\x20load\x20(async)...','\x20Normal\x20mode\x20-\x20no\x20enhancement\x20params','\x20currentOptions\x20exists:\x20','/@vite/client','prepare-sw','pnpm\x20version\x20patch\x20--no-git-tag-version','public','--public-dir\x20<path>','state','\x20updateOverlay()\x20called','default','https://assets.enhancelabs.ai/overlay.js','1155168XDhmmT','copyFile','enhance.config.sample.json','reload','\x20Available\x20exports:','backendUrl','1192zxfVui','\x20→\x20',',\x20configGetter:\x20','toString','\x20Module\x20exports:','[Enhance\x20SW-Client]','none','\x20Overlay\x20controller\x20initialized\x20and\x20cached','undefined','\x20No\x20blocking\x20SW\x20found','\x20with\x20scope\x20\x27/\x27...','\x20enableViteHmr:\x20','\x20Current\x20controller:','info','[Enhance\x20Runtime]','\x20Sending\x20initial\x20configuration...','searchParams','/@react-refresh','[data-enhance-runtime-bootstrap]','\x20init()\x20complete\x20-\x20normal\x20mode','enhancementId','\x20BLOCKING\x20SW\x20detected:\x20','object','message','options','action','11794sdojik','version','sha256','publicDir','keys','\x20Explicit\x20disable\x20via\x20URL\x20param\x20-\x20exiting','overlay','385392Onslwg','enhance','data','enhance:disable','\x20Failed\x20to\x20prepare\x20remote\x20HMR\x20(non-fatal):','active','\x20Starting\x20fresh\x20overlay\x20load...','\x20Enhancement\x20mode\x20ENABLED','\x20URL\x20params\x20parsed:','Override\x20the\x20service\x20worker\x20output\x20filename\x20(defaults\x20to\x20sw-enhance.js)','\x20resolveWorker:','\x20init()\x20called\x20at\x20','runtimeURL','security','cwd','location','\x20Importing\x20overlay\x20module\x20from:\x20','description','...','manifestPath','\x20Failed\x20to\x20register\x20service\x20worker:','command','enhance:configure','filename','postMessage','Enhance\x20sandbox\x20utility\x20CLI','url','state:\x20','origin','some','warn','toLowerCase','injectIntoGlobalHook','\x20Waiting\x20for\x20navigator.serviceWorker.ready...','2251200qnSLLz','\x20enhancementId:\x20','sw-enhance','swFilename','ENOENT','N/A','\x20Controller\x20state:','./dist/vite/index.js','^3.22.4','\x20Unregistering\x20SW...','delete','\x20loadOverlay()\x20failed:','https://','enhancementUrl','\x20registerServiceWorker()\x20called','\x20enhancementUrl:\x20','add','explicitDisable','\x20SW\x20requested\x20config\x20-\x20sending...','relativeDestination','swPath','/assets/enhance-runtime.js','\x20HMR\x20setup\x20complete','log','\x20Page\x20was\x20not\x20controlled\x20-\x20SW\x20just\x20activated.\x20Reloading\x20to\x20enable\x20enhancement...','\x20Controller\x20created:','./dist/index.js'];_0x1c65=function(){return _0x1dc159;};return _0x1c65();}async function registerServiceWorker(_0x33cdb8){const _0x152ddf=_0x3f14c7;console[_0x152ddf(0x181)](LOG_PREFIX2+_0x152ddf(0x178)),console[_0x152ddf(0x181)](LOG_PREFIX2+'\x20swPath:\x20'+_0x33cdb8[_0x152ddf(0x17e)]);if(!(_0x152ddf(0x1ae)in navigator)){console[_0x152ddf(0x166)](LOG_PREFIX2+'\x20Service\x20workers\x20NOT\x20supported\x20in\x20this\x20browser');return;}console[_0x152ddf(0x181)](LOG_PREFIX2+_0x152ddf(0x1e8));const _0x5849d4=navigator[_0x152ddf(0x1ae)]['controller'];console[_0x152ddf(0x181)](LOG_PREFIX2+_0x152ddf(0x133),_0x5849d4?.[_0x152ddf(0x106)]??_0x152ddf(0x12d)),console['log'](LOG_PREFIX2+_0x152ddf(0x170),_0x5849d4?.[_0x152ddf(0x11d)]??_0x152ddf(0x16f));const _0x1b3e1a=!!_0x5849d4;currentOptions2=_0x33cdb8,configGetter=()=>buildWorkerConfiguration(_0x33cdb8),console[_0x152ddf(0x181)](LOG_PREFIX2+_0x152ddf(0x1a2));const _0x13a4b2=await detectBlockingServiceWorker(_0x33cdb8['swPath']);if(_0x13a4b2){console[_0x152ddf(0xef)](LOG_PREFIX2+_0x152ddf(0x13c)+_0x13a4b2),console['error'](LOG_PREFIX2+_0x152ddf(0xf2));return;}console[_0x152ddf(0x181)](LOG_PREFIX2+_0x152ddf(0x130));try{console['log'](LOG_PREFIX2+_0x152ddf(0x191)+_0x33cdb8[_0x152ddf(0x17e)]+_0x152ddf(0x131)),registration=await navigator[_0x152ddf(0x1ae)][_0x152ddf(0xf1)](_0x33cdb8[_0x152ddf(0x17e)],{'scope':'/'}),console['log'](LOG_PREFIX2+_0x152ddf(0x1a9),{'scope':registration[_0x152ddf(0x1d3)],'active':registration[_0x152ddf(0x14d)]?.[_0x152ddf(0x106)],'waiting':registration[_0x152ddf(0xf6)]?.['scriptURL'],'installing':registration[_0x152ddf(0x1e4)]?.['scriptURL']}),console['log'](LOG_PREFIX2+_0x152ddf(0x169));const _0x5e873c=await navigator[_0x152ddf(0x1ae)]['ready'];console[_0x152ddf(0x181)](LOG_PREFIX2+_0x152ddf(0x104),_0x5e873c[_0x152ddf(0x14d)]?.[_0x152ddf(0x106)]);const _0x228d93=ownsCurrentController(_0x33cdb8[_0x152ddf(0x17e)]);state[_0x152ddf(0x1d1)]=_0x228d93,console['log'](LOG_PREFIX2+_0x152ddf(0x195)+_0x228d93),console[_0x152ddf(0x181)](LOG_PREFIX2+_0x152ddf(0xf0),navigator['serviceWorker'][_0x152ddf(0x10f)]?.[_0x152ddf(0x106)]??'none');if(!_0x1b3e1a&&!navigator[_0x152ddf(0x1ae)][_0x152ddf(0x10f)]){console['log'](LOG_PREFIX2+_0x152ddf(0x182)),window[_0x152ddf(0x157)][_0x152ddf(0x124)]();return;}console[_0x152ddf(0x181)](LOG_PREFIX2+'\x20Attaching\x20message\x20listener...'),attachMessageListener(),console['log'](LOG_PREFIX2+_0x152ddf(0x136)),await sendConfiguration();if(state[_0x152ddf(0xee)]){const _0x3a334a=document[_0x152ddf(0x10a)](_0x152ddf(0x139))!==null;console[_0x152ddf(0x181)](LOG_PREFIX2+'\x20Enhancement\x20detection:\x20wasEnhanced='+_0x3a334a);if(!_0x3a334a){console['log'](LOG_PREFIX2+_0x152ddf(0x1ce)),window['location'][_0x152ddf(0x124)]();return;}}console[_0x152ddf(0x181)](LOG_PREFIX2+'\x20Updating\x20overlay...'),updateOverlay(),console['log'](LOG_PREFIX2+_0x152ddf(0x1b7));}catch(_0x536338){console[_0x152ddf(0xef)](LOG_PREFIX2+_0x152ddf(0x15c),_0x536338);}}async function sendConfiguration(){const _0x2de46e=_0x3f14c7;console[_0x2de46e(0x181)](LOG_PREFIX2+_0x2de46e(0xfd)),console[_0x2de46e(0x181)](LOG_PREFIX2+'\x20state.enabled:\x20'+state[_0x2de46e(0xee)]+_0x2de46e(0x129)+!!configGetter);if(!state[_0x2de46e(0xee)]||!configGetter){console[_0x2de46e(0x181)](LOG_PREFIX2+_0x2de46e(0x112));return;}const _0x5d5437=await resolveWorker();if(!_0x5d5437){console[_0x2de46e(0x166)](LOG_PREFIX2+_0x2de46e(0x1d6));return;}const _0x24b3c1=configGetter();console[_0x2de46e(0x181)](LOG_PREFIX2+_0x2de46e(0x190),JSON[_0x2de46e(0x196)](_0x24b3c1,null,0x2)),_0x5d5437[_0x2de46e(0x160)]({'type':WORKER_MESSAGE_CONFIG,'config':_0x24b3c1}),console[_0x2de46e(0x181)](LOG_PREFIX2+_0x2de46e(0x18c));}async function unregisterServiceWorker(_0x3bdecd){const _0x471758=_0x3f14c7;console[_0x471758(0x181)](LOG_PREFIX2+_0x471758(0x1a1));if(!(_0x471758(0x1ae)in navigator)){console[_0x471758(0x181)](LOG_PREFIX2+_0x471758(0xf9));return;}detachMessageListener();try{const _0x211b27=registration??await navigator[_0x471758(0x1ae)][_0x471758(0x1d8)]('/');if(!_0x211b27){console[_0x471758(0x181)](LOG_PREFIX2+_0x471758(0x1a7));return;}console[_0x471758(0x181)](LOG_PREFIX2+_0x471758(0xe5),{'scope':_0x211b27[_0x471758(0x1d3)],'active':_0x211b27[_0x471758(0x14d)]?.[_0x471758(0x106)],'waiting':_0x211b27[_0x471758(0xf6)]?.[_0x471758(0x106)],'installing':_0x211b27['installing']?.[_0x471758(0x106)]});const _0x54842c=[_0x211b27['active']?.[_0x471758(0x106)],_0x211b27[_0x471758(0xf6)]?.['scriptURL'],_0x211b27[_0x471758(0x1e4)]?.[_0x471758(0x106)]],_0x2fc082=_0x54842c[_0x471758(0x165)](_0x450628=>_0x450628&&ownsServiceWorker(_0x450628,_0x3bdecd));if(!_0x2fc082){console[_0x471758(0x181)](LOG_PREFIX2+_0x471758(0xfe));return;}_0x211b27[_0x471758(0x14d)]&&(console[_0x471758(0x181)](LOG_PREFIX2+_0x471758(0x1a6)),_0x211b27['active'][_0x471758(0x160)]({'type':WORKER_MESSAGE_DISABLE})),console['log'](LOG_PREFIX2+_0x471758(0x173)),await _0x211b27[_0x471758(0x18a)](),registration=null,console[_0x471758(0x181)](LOG_PREFIX2+_0x471758(0xe0));}catch(_0x3a1f2f){console['error'](LOG_PREFIX2+'\x20Failed\x20to\x20unregister\x20service\x20worker:',_0x3a1f2f);}}function attachMessageListener(){const _0x373cea=_0x3f14c7;if(!navigator['serviceWorker']||messageListener){console[_0x373cea(0x181)](LOG_PREFIX2+_0x373cea(0x1e0));return;}messageListener=_0x3eca74=>{const _0x4e8a8b=_0x373cea,_0x411bfa=_0x3eca74[_0x4e8a8b(0x14a)];console[_0x4e8a8b(0x181)](LOG_PREFIX2+'\x20Received\x20message\x20from\x20SW:',_0x411bfa);if(!_0x411bfa||typeof _0x411bfa!==_0x4e8a8b(0x13d))return;_0x411bfa['type']===WORKER_MESSAGE_REQUEST_CONFIG&&(console[_0x4e8a8b(0x181)](LOG_PREFIX2+_0x4e8a8b(0x17c)),void sendConfiguration());},navigator[_0x373cea(0x1ae)][_0x373cea(0x1c1)]('message',messageListener),console[_0x373cea(0x181)](LOG_PREFIX2+_0x373cea(0x1a0));}function _0x4daf(_0x44fe50,_0x6f4527){const _0x1c65ce=_0x1c65();return _0x4daf=function(_0x4dafea,_0x60738d){_0x4dafea=_0x4dafea-0xe0;let _0x49c41b=_0x1c65ce[_0x4dafea];return _0x49c41b;},_0x4daf(_0x44fe50,_0x6f4527);}function detachMessageListener(){const _0xd39320=_0x3f14c7;navigator[_0xd39320(0x1ae)]&&messageListener&&(navigator[_0xd39320(0x1ae)][_0xd39320(0x185)](_0xd39320(0x13e),messageListener),messageListener=null,console[_0xd39320(0x181)](LOG_PREFIX2+_0xd39320(0x1be)));}function ownsServiceWorker(_0x32c44c,_0x4e0ef9){const _0x29b8f7=_0x3f14c7,_0x1f1464=typeof window!=='undefined'?window[_0x29b8f7(0x157)][_0x29b8f7(0x164)]:'',_0x30a004=new URL(_0x4e0ef9,_0x1f1464||void 0x0)['href'],_0xd2c8a0=_0x32c44c===_0x30a004||_0x32c44c[_0x29b8f7(0x1c7)](_0x29b8f7(0x16c));return console['log'](LOG_PREFIX2+_0x29b8f7(0x1d2)+_0x32c44c+_0x29b8f7(0xe2)+_0x30a004+_0x29b8f7(0xf4)+_0xd2c8a0),_0xd2c8a0;}function ownsCurrentController(_0x3e0d18){const _0x3b3bc4=_0x3f14c7;if(typeof navigator===_0x3b3bc4(0x12f))return![];const _0x277d44=navigator['serviceWorker']?.[_0x3b3bc4(0x10f)];if(!_0x277d44)return console[_0x3b3bc4(0x181)](LOG_PREFIX2+_0x3b3bc4(0xeb)),![];return ownsServiceWorker(_0x277d44[_0x3b3bc4(0x106)],_0x3e0d18);}async function detectBlockingServiceWorker(_0x2af035){const _0x413af8=_0x3f14c7;if(!navigator[_0x413af8(0x1ae)])return null;try{const _0x454e37=await navigator[_0x413af8(0x1ae)][_0x413af8(0x1d8)]('/');console[_0x413af8(0x181)](LOG_PREFIX2+_0x413af8(0x187),_0x454e37?.[_0x413af8(0x14d)]?.[_0x413af8(0x106)]??'none');const _0x534087=_0x454e37?.[_0x413af8(0x14d)]?.['scriptURL'];if(!_0x534087)return null;if(ownsServiceWorker(_0x534087,_0x2af035))return null;return _0x534087;}catch(_0xd7b21){return console[_0x413af8(0xef)](LOG_PREFIX2+'\x20detectBlocking\x20error:',_0xd7b21),null;}}async function resolveWorker(){const _0x45f46b=_0x3f14c7,_0x4fde15=registration??await navigator['serviceWorker']?.[_0x45f46b(0x1d8)]('/'),_0x32df5d=_0x4fde15?.['active']??_0x4fde15?.[_0x45f46b(0xf6)]??_0x4fde15?.[_0x45f46b(0x1e4)]??null;return console['log'](LOG_PREFIX2+_0x45f46b(0x152),_0x32df5d?.[_0x45f46b(0x106)]??_0x45f46b(0x12d),_0x45f46b(0x163)+(_0x32df5d?.['state']??_0x45f46b(0x16f))),_0x32df5d;}function buildWorkerConfiguration(_0x31b051){const _0x2e36a1=_0x3f14c7,_0x3fb56b=getEnhancementUrl();return console[_0x2e36a1(0x181)](LOG_PREFIX2+_0x2e36a1(0x10d)+_0x3fb56b),{'enhancementUrl':_0x3fb56b,'callbackBypass':_0x31b051[_0x2e36a1(0x19c)],'overlayPath':_0x31b051[_0x2e36a1(0xe1)],'overlayEnableViteHmr':_0x31b051[_0x2e36a1(0x147)][_0x2e36a1(0x1d4)],'runtimeScriptPath':_0x31b051[_0x2e36a1(0x1b4)],'swPath':_0x31b051[_0x2e36a1(0x17e)],'securityMode':_0x31b051[_0x2e36a1(0x155)],'backendUrl':_0x31b051['backendUrl']};}var LOG_PREFIX3=_0x3f14c7(0x135),initialized=![],options=null,Enhance={'init'(_0x1eaba6){const _0x43154a=_0x3f14c7,_0x44c9ae=Date[_0x43154a(0x1de)]();console[_0x43154a(0x181)](LOG_PREFIX3+_0x43154a(0x153)+_0x44c9ae),console[_0x43154a(0x181)](LOG_PREFIX3+_0x43154a(0x1c4)+window[_0x43154a(0x157)][_0x43154a(0x1da)]),console[_0x43154a(0x181)](LOG_PREFIX3+_0x43154a(0x1c2)+document[_0x43154a(0xea)]),console[_0x43154a(0x181)](LOG_PREFIX3+_0x43154a(0x1a8),JSON[_0x43154a(0x196)](_0x1eaba6,null,0x2));if(initialized)return console[_0x43154a(0x166)](LOG_PREFIX3+_0x43154a(0x1c5)),createController();initialized=!![],console[_0x43154a(0x181)](LOG_PREFIX3+_0x43154a(0x101)),options=normalizeOptions(_0x1eaba6),console[_0x43154a(0x181)](LOG_PREFIX3+_0x43154a(0x1af),JSON[_0x43154a(0x196)](options,null,0x2));const _0x106b02=parseUrlParams();console['log'](LOG_PREFIX3+_0x43154a(0x150),JSON[_0x43154a(0x196)](_0x106b02,null,0x2));if(_0x106b02[_0x43154a(0x17b)])return cleanUrlParam(_0x43154a(0x149)),console[_0x43154a(0x181)](LOG_PREFIX3+_0x43154a(0x146)),createController();if(_0x106b02[_0x43154a(0x1cb)])return console[_0x43154a(0x181)](LOG_PREFIX3+_0x43154a(0x14f)),console[_0x43154a(0x181)](LOG_PREFIX3+_0x43154a(0x179)+_0x106b02['enhancementUrl']),console[_0x43154a(0x181)](LOG_PREFIX3+_0x43154a(0x16b)+_0x106b02[_0x43154a(0x13b)]),state[_0x43154a(0xee)]=!![],console[_0x43154a(0x181)](LOG_PREFIX3+_0x43154a(0x115)),void loadOverlay({'overlayPath':options[_0x43154a(0xe1)],'enableViteHmr':options[_0x43154a(0x147)][_0x43154a(0x1d4)],'options':options,'onToggle':handleToggle}),console[_0x43154a(0x181)](LOG_PREFIX3+_0x43154a(0xe8)),void registerServiceWorker(options),console[_0x43154a(0x181)](LOG_PREFIX3+_0x43154a(0x102)),createController();return console[_0x43154a(0x181)](LOG_PREFIX3+_0x43154a(0x116)),console['log'](LOG_PREFIX3+'\x20Unregistering\x20any\x20existing\x20SW...'),void unregisterServiceWorker(options['swPath']),console[_0x43154a(0x181)](LOG_PREFIX3+_0x43154a(0x13a)),createController();}};function createController(){return{'enable'(){const _0x81f3dd=_0x4daf;if(!options)return;state['enabled']=!![],void loadOverlay({'overlayPath':options[_0x81f3dd(0xe1)],'enableViteHmr':options[_0x81f3dd(0x147)][_0x81f3dd(0x1d4)],'options':options,'onToggle':handleToggle}),void registerServiceWorker(options),void sendConfiguration(),updateOverlay();},'disable'(){const _0x2a120f=_0x4daf;if(!options)return;state['enabled']=![],state[_0x2a120f(0x1d1)]=![],updateOverlay(),void unregisterServiceWorker(options['swPath']);},'status'(){const _0x127864=_0x4daf;return{'enabled':state['enabled'],'controlled':state[_0x127864(0x1d1)]};}};}function handleToggle(){const _0x599ebe=_0x3f14c7,_0x35468d=createController();state[_0x599ebe(0xee)]?_0x35468d['disable']():_0x35468d[_0x599ebe(0x19b)]();}function parseUrlParams(){const _0x214da4=_0x3f14c7,_0x45d513=new URL(window[_0x214da4(0x157)][_0x214da4(0x1da)]),_0x3e161d=_0x45d513[_0x214da4(0x137)][_0x214da4(0x1aa)]('enhance')?.[_0x214da4(0x167)](),_0x58342e=_0x45d513[_0x214da4(0x137)][_0x214da4(0x1aa)]('enhancementUrl'),_0x478183=_0x45d513[_0x214da4(0x137)][_0x214da4(0x1aa)]('enhancement');return{'hasEnhancement':Boolean(_0x58342e||_0x478183),'explicitDisable':_0x3e161d==='0'||_0x3e161d==='false'||_0x3e161d===_0x214da4(0x1ab),'enhancementUrl':_0x58342e,'enhancementId':_0x478183};}function cleanUrlParam(_0x6c7672){const _0x23e4e0=_0x3f14c7,_0x797729=new URL(window['location']['href']);_0x797729['searchParams'][_0x23e4e0(0x1c3)](_0x6c7672)&&(_0x797729[_0x23e4e0(0x137)][_0x23e4e0(0x174)](_0x6c7672),window[_0x23e4e0(0x18b)][_0x23e4e0(0x1a4)](null,document['title'],_0x797729[_0x23e4e0(0x12a)]()));}var package_default={'name':_0x3f14c7(0x192),'version':_0x3f14c7(0x1e5),'type':'module','description':_0x3f14c7(0xff),'license':_0x3f14c7(0x1cd),'main':_0x3f14c7(0x19e),'module':_0x3f14c7(0x184),'types':_0x3f14c7(0x111),'exports':{'.':{'types':_0x3f14c7(0x111),'import':_0x3f14c7(0x184),'require':_0x3f14c7(0x19e)},'./vite':{'types':'./dist/vite/index.d.ts','import':_0x3f14c7(0x171)}},'files':['dist',_0x3f14c7(0x1cc),_0x3f14c7(0x123)],'bin':{'enhance-sandbox':_0x3f14c7(0x1ad)},'scripts':{'typecheck':'tsc\x20--noEmit','dev':_0x3f14c7(0x19d),'dev:staging':'ENHANCE_OVERLAY_PATH=https://overlay.localhost:8099/src/index.tsx\x20ENHANCE_BACKEND_URL=https://enhance-api-dev.enhancelabs.workers.dev\x20tsup\x20--watch','build':'ENHANCE_OVERLAY_PATH=https://assets.enhancelabs.ai/overlay.js\x20ENHANCE_BACKEND_URL=https://api.enhancelabs.ai\x20tsup','build:release':_0x3f14c7(0xfc),'version':_0x3f14c7(0x11a)},'dependencies':{'commander':_0x3f14c7(0x109),'zod':_0x3f14c7(0x172)},'devDependencies':{'@types/node':_0x3f14c7(0x1d0),'javascript-obfuscator':_0x3f14c7(0x1cf),'tsup':_0x3f14c7(0x1ca),'vite':'^7.2.4'},'publishConfig':{'access':_0x3f14c7(0x11b)}},DEFAULT_SERVICE_WORKER_PATH=_0x3f14c7(0x1c6),DEFAULT_RUNTIME_PATH=_0x3f14c7(0x17f),DIST_SERVICE_WORKER_PATH=_0x3f14c7(0x100),DIST_RUNTIME_PATH='assets/enhance-runtime.js',PACKAGE_VERSION=typeof package_default[_0x3f14c7(0x142)]==='string'?package_default[_0x3f14c7(0x142)]:_0x3f14c7(0x1e2);function normalizeAssetPath(_0x33dd2c){const _0x26c8d0=_0x3f14c7;if(!_0x33dd2c)return _0x33dd2c;if(_0x33dd2c['startsWith'](_0x26c8d0(0x1b3))||_0x33dd2c[_0x26c8d0(0xf8)](_0x26c8d0(0x176)))return _0x33dd2c;const _0x49491c=_0x33dd2c['replace'](/^\.\//,'');return _0x49491c['startsWith']('/')?_0x49491c:'/'+_0x49491c;}var defaultSwPath=normalizeAssetPath(DEFAULT_SERVICE_WORKER_PATH),defaultRuntimePath=normalizeAssetPath(DEFAULT_RUNTIME_PATH),Enhance2={'init'(_0x9ff2eb){const _0x1d5120=_0x3f14c7;return Enhance[_0x1d5120(0x1c8)](_0x9ff2eb);},'serviceWorkerURL'(){return defaultSwPath;},'runtimeURL'(){return defaultRuntimePath;},'assetManifest'(){return getAssetManifest();}};function getAssetManifest(){return{'version':PACKAGE_VERSION,'serviceWorker':serviceWorkerURL(),'runtime':runtimeURL(),'serviceWorkerDigest':null,'runtimeDigest':null};}function serviceWorkerURL(){const _0x4e5c9e=_0x3f14c7;return Enhance2[_0x4e5c9e(0x1b0)]();}function runtimeURL(){const _0x317faa=_0x3f14c7;return Enhance2[_0x317faa(0x154)]();}import{promises as _0x2b1b86}from'fs';import{createHash}from'crypto';import{dirname,join}from'path';import{fileURLToPath}from'url';var distDir=dirname(fileURLToPath(new URL(_0x3f14c7(0x189),import.meta[_0x3f14c7(0x162)])));async function syncAssets(_0xaeca91){const _0x571aa0=_0x3f14c7,_0x4f1efc=[{'sourcePath':DIST_SERVICE_WORKER_PATH,'manifestPath':normalizeAssetPath(DEFAULT_SERVICE_WORKER_PATH),'override':_0xaeca91[_0x571aa0(0x16d)]?'./'+_0xaeca91[_0x571aa0(0x16d)]:void 0x0},{'sourcePath':DIST_RUNTIME_PATH,'manifestPath':normalizeAssetPath(DEFAULT_RUNTIME_PATH)}],_0x401874=[];for(const _0x51cb1d of _0x4f1efc){const _0x4d10b2=cleanRelativePath(_0x51cb1d[_0x571aa0(0x18d)]??_0x51cb1d[_0x571aa0(0x15b)]),_0x52260=join(distDir,cleanRelativePath(_0x51cb1d[_0x571aa0(0xec)])),_0x89a780=join(_0xaeca91[_0x571aa0(0x144)],_0x4d10b2),[_0x19ba18,_0x179a39]=await Promise[_0x571aa0(0x188)]([readDigest(_0x52260),readDigest(_0x89a780)]);if(_0x19ba18&&_0x179a39&&_0x19ba18===_0x179a39){_0x401874[_0x571aa0(0xf3)]({'sourcePath':_0x52260,'destinationPath':_0x89a780,'relativeDestination':_0x4d10b2,'status':_0x571aa0(0x1dc)});continue;}await _0x2b1b86[_0x571aa0(0x1e6)](dirname(_0x89a780),{'recursive':!![]}),await _0x2b1b86[_0x571aa0(0x122)](_0x52260,_0x89a780),_0x401874[_0x571aa0(0xf3)]({'sourcePath':_0x52260,'destinationPath':_0x89a780,'relativeDestination':_0x4d10b2,'status':_0x571aa0(0x1d9)});}return _0x401874;}function cleanRelativePath(_0x1e64c9){const _0x125f67=_0x3f14c7;return _0x1e64c9[_0x125f67(0x1e7)](/^[./]+/,'');}async function readDigest(_0x11820c){const _0x2a7ede=_0x3f14c7;try{const _0x4701c0=await _0x2b1b86[_0x2a7ede(0xfa)](_0x11820c);return createHash(_0x2a7ede(0x143))[_0x2a7ede(0x1d5)](_0x4701c0)[_0x2a7ede(0x1bc)](_0x2a7ede(0x1c0));}catch(_0x3b10e2){if(_0x3b10e2[_0x2a7ede(0x1df)]===_0x2a7ede(0x16e))return null;throw _0x3b10e2;}}var program=new Command();program['name']('enhance-sandbox')[_0x3f14c7(0x159)](_0x3f14c7(0x161))[_0x3f14c7(0x142)](_0x3f14c7(0x1e2)),program[_0x3f14c7(0x15d)](_0x3f14c7(0x193))['description'](_0x3f14c7(0x10b))[_0x3f14c7(0x140)](()=>{const _0x42ccc7=_0x3f14c7,_0x59709a=getAssetManifest();process[_0x42ccc7(0xe4)][_0x42ccc7(0x1c9)](JSON[_0x42ccc7(0x196)](_0x59709a,null,0x2)+'\x0a');}),program['command'](_0x3f14c7(0x119))[_0x3f14c7(0x159)](_0x3f14c7(0xf5))[_0x3f14c7(0x1a3)](_0x3f14c7(0x11c),'Directory\x20to\x20copy\x20the\x20service\x20worker\x20into')[_0x3f14c7(0x197)]('--filename\x20<name>',_0x3f14c7(0x151))[_0x3f14c7(0x140)](async _0x1253b0=>{const _0x139ba9=_0x3f14c7,_0x35c8d7=resolve(process['cwd'](),_0x1253b0[_0x139ba9(0x144)]),_0x41ab01=await syncAssets({'publicDir':_0x35c8d7,'swFilename':_0x1253b0[_0x139ba9(0x15f)]});for(const _0x52932c of _0x41ab01){const _0x386e7f=relative(process[_0x139ba9(0x156)](),_0x52932c['destinationPath']);_0x52932c['status']===_0x139ba9(0x1dc)?process['stdout'][_0x139ba9(0x1c9)](_0x139ba9(0x107)+_0x52932c[_0x139ba9(0x17d)]+_0x139ba9(0x18f)+_0x386e7f+']\x0a'):process[_0x139ba9(0xe4)][_0x139ba9(0x1c9)](_0x139ba9(0x1a5)+_0x52932c[_0x139ba9(0x17d)]+_0x139ba9(0x128)+_0x386e7f+'\x0a');}}),program['parseAsync']();
package/dist/index.d.ts CHANGED
@@ -1,105 +1,59 @@
1
- import { z } from 'zod';
2
-
3
- interface WorkerHmrConfiguration {
4
- protocols?: string[];
5
- pathHints?: string[];
6
- }
7
-
8
- declare const optionsSchema: z.ZodObject<{
9
- sandboxBaseURL: z.ZodOptional<z.ZodString>;
10
- callbackBypass: z.ZodArray<z.ZodString, "many">;
11
- assetHosts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
12
- overlay: z.ZodOptional<z.ZodObject<{
13
- enabled: z.ZodOptional<z.ZodBoolean>;
14
- position: z.ZodOptional<z.ZodEnum<["top-left", "top-right", "bottom-left", "bottom-right"]>>;
15
- enableViteHmr: z.ZodOptional<z.ZodBoolean>;
16
- }, "strip", z.ZodTypeAny, {
17
- enabled?: boolean | undefined;
18
- position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined;
19
- enableViteHmr?: boolean | undefined;
20
- }, {
21
- enabled?: boolean | undefined;
22
- position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined;
23
- enableViteHmr?: boolean | undefined;
24
- }>>;
25
- hmr: z.ZodOptional<z.ZodObject<{
26
- protocols: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
27
- pathHints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
28
- }, "strip", z.ZodTypeAny, {
29
- protocols?: string[] | undefined;
30
- pathHints?: string[] | undefined;
31
- }, {
32
- protocols?: string[] | undefined;
33
- pathHints?: string[] | undefined;
34
- }>>;
35
- logLevel: z.ZodOptional<z.ZodEnum<["silent", "info", "debug"]>>;
36
- swPath: z.ZodOptional<z.ZodString>;
37
- overlayPath: z.ZodOptional<z.ZodString>;
38
- runtimeScriptPath: z.ZodOptional<z.ZodString>;
39
- storageKeysOverride: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
40
- security: z.ZodOptional<z.ZodEnum<["permissive", "custom"]>>;
41
- }, "strip", z.ZodTypeAny, {
1
+ type RawOptions = {
42
2
  callbackBypass: string[];
43
- sandboxBaseURL?: string | undefined;
44
- assetHosts?: string[] | undefined;
45
- overlay?: {
46
- enabled?: boolean | undefined;
47
- position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined;
48
- enableViteHmr?: boolean | undefined;
49
- } | undefined;
50
- hmr?: {
51
- protocols?: string[] | undefined;
52
- pathHints?: string[] | undefined;
53
- } | undefined;
54
- logLevel?: "silent" | "info" | "debug" | undefined;
55
- swPath?: string | undefined;
56
- overlayPath?: string | undefined;
57
- runtimeScriptPath?: string | undefined;
58
- storageKeysOverride?: Record<string, string> | undefined;
59
- security?: "custom" | "permissive" | undefined;
60
- }, {
61
- callbackBypass: string[];
62
- sandboxBaseURL?: string | undefined;
63
- assetHosts?: string[] | undefined;
64
- overlay?: {
65
- enabled?: boolean | undefined;
66
- position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined;
67
- enableViteHmr?: boolean | undefined;
68
- } | undefined;
69
- hmr?: {
70
- protocols?: string[] | undefined;
71
- pathHints?: string[] | undefined;
72
- } | undefined;
73
- logLevel?: "silent" | "info" | "debug" | undefined;
74
- swPath?: string | undefined;
75
- overlayPath?: string | undefined;
76
- runtimeScriptPath?: string | undefined;
77
- storageKeysOverride?: Record<string, string> | undefined;
78
- security?: "custom" | "permissive" | undefined;
79
- }>;
80
- type RawOptions = z.input<typeof optionsSchema>;
81
- declare global {
82
- interface Window {
83
- __enhanceSandboxHmr?: WorkerHmrConfiguration | (() => WorkerHmrConfiguration | undefined);
84
- }
85
- }
3
+ __development?: {
4
+ enableOverlayHmr?: boolean;
5
+ overlayPath?: string;
6
+ security?: 'permissive' | 'custom';
7
+ backendUrl?: string;
8
+ };
9
+ };
86
10
 
87
- interface EnhanceInitOptions extends RawOptions {
11
+ type OverlayPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
12
+ type SecurityMode = 'permissive' | 'custom';
13
+ interface OverlayState {
14
+ enhancementUrl: string;
15
+ enabled: boolean;
16
+ controlled: boolean;
17
+ overlayPosition: OverlayPosition;
18
+ securityMode: SecurityMode;
19
+ backendBaseUrl?: string;
20
+ }
21
+ interface OverlayController {
22
+ update(state: OverlayState): void;
23
+ onToggle(handler: () => void): void;
24
+ destroy(): void;
25
+ open(): void;
26
+ close(): void;
27
+ isOpen(): boolean;
88
28
  }
89
29
  interface EnhanceStatus {
90
30
  enabled: boolean;
91
31
  controlled: boolean;
92
- version: string;
93
- sandboxHits: number;
94
- sandboxFallbacks: number;
95
32
  }
96
33
  interface EnhanceController {
97
- enable(token?: string): void;
34
+ enable(): void;
98
35
  disable(): void;
99
36
  status(): EnhanceStatus;
100
37
  }
38
+ declare global {
39
+ interface Window {
40
+ __enhanceOverlay?: OverlayController;
41
+ __viteHMRLoaded?: Set<string>;
42
+ __enhanceReactRefreshInstalledOrigins?: Set<string>;
43
+ __vite_plugin_react_preamble_installed__?: boolean;
44
+ $RefreshReg$?: (type: unknown, id?: string) => void;
45
+ $RefreshSig$?: () => (type: unknown) => unknown;
46
+ enhancePreview?: EnhanceController;
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Main entry point - the only public API.
52
+ */
53
+ declare const Enhance$1: {
54
+ init(rawOptions: RawOptions): EnhanceController;
55
+ };
101
56
 
102
- type EnhanceOptions = EnhanceInitOptions;
103
57
  interface EnhanceAssetManifest {
104
58
  serviceWorker: string;
105
59
  runtime: string;
@@ -108,7 +62,7 @@ interface EnhanceAssetManifest {
108
62
  runtimeDigest: string | null;
109
63
  }
110
64
  declare const Enhance: {
111
- init(options: EnhanceInitOptions): EnhanceController;
65
+ init(options: Parameters<typeof Enhance$1.init>[0]): EnhanceController;
112
66
  serviceWorkerURL(): string;
113
67
  runtimeURL(): string;
114
68
  assetManifest(): EnhanceAssetManifest;
@@ -118,4 +72,4 @@ declare function resolveServiceWorkerPath(): string;
118
72
  declare function serviceWorkerURL(): string;
119
73
  declare function runtimeURL(): string;
120
74
 
121
- export { Enhance, type EnhanceAssetManifest, type EnhanceController, type EnhanceOptions, type EnhanceStatus, getAssetManifest, resolveServiceWorkerPath, runtimeURL, serviceWorkerURL };
75
+ export { Enhance, type EnhanceAssetManifest, type EnhanceController, type RawOptions as EnhanceOptions, type EnhanceStatus, getAssetManifest, resolveServiceWorkerPath, runtimeURL, serviceWorkerURL };