UNPKG

@typecad/typecad

Version:

🤖programmatically 💥create 🛰️hardware

1 lines • 11.5 kB
(function(_0x744f97,_0x5b1ac7){const a9_0x54bd96={_0x2befe4:0x43a,_0x691001:0x483,_0xb676b3:0x48b,_0x4917eb:0x464,_0x1015a4:0x453,_0x12c399:0x447,_0x5e1930:0x466,_0x3cc433:0x45b},a9_0xb6da54={_0x276e81:0x274},_0x48ea9e=_0x744f97();function _0x5e67c2(_0x1cbec1,_0x364913){return a9_0xfc71(_0x1cbec1-a9_0xb6da54._0x276e81,_0x364913);}while(!![]){try{const _0x489f6c=-parseInt(_0x5e67c2(0x464,0x47d))/(0x2*-0x11e+-0x1*0x2fe+0x53b)+parseInt(_0x5e67c2(0x454,0x44c))/(0x1a75*-0x1+-0x15b5*0x1+0x2*0x1816)*(-parseInt(_0x5e67c2(0x452,a9_0x54bd96._0x2befe4))/(0x1c9a+-0x2*0x1218+0x799))+-parseInt(_0x5e67c2(0x477,a9_0x54bd96._0x691001))/(0x38b*-0xb+-0x21d+-0x148d*-0x2)*(parseInt(_0x5e67c2(0x476,a9_0x54bd96._0xb676b3))/(0x1*0x959+-0x1847+0xef3*0x1))+parseInt(_0x5e67c2(0x461,a9_0x54bd96._0x4917eb))/(-0x72b+-0x7*-0x2dd+0x66d*-0x2)+parseInt(_0x5e67c2(a9_0x54bd96._0x1015a4,a9_0x54bd96._0x12c399))/(-0x1bf*-0x6+-0x1535+0xa2*0x11)*(-parseInt(_0x5e67c2(0x45a,0x474))/(-0x143c+0x1*-0x19ab+0x2def))+parseInt(_0x5e67c2(a9_0x54bd96._0x5e1930,0x45d))/(0x1976+0x1c28+-0x3595)+parseInt(_0x5e67c2(a9_0x54bd96._0x3cc433,0x462))/(0x482+-0xd94+0x91c);if(_0x489f6c===_0x5b1ac7)break;else _0x48ea9e['push'](_0x48ea9e['shift']());}catch(_0x7223a){_0x48ea9e['push'](_0x48ea9e['shift']());}}}(a9_0x18a3,0x13*-0xb951+0x535*0x95+0x18675e));function a9_0xfc71(_0xc793ef,_0x1f72f){const _0x2a8de0=a9_0x18a3();return a9_0xfc71=function(_0x5166c4,_0x35a62a){_0x5166c4=_0x5166c4-(0x20c9+-0x208b+0x191);let _0x53116d=_0x2a8de0[_0x5166c4];if(a9_0xfc71['xKOOle']===undefined){var _0x106d78=function(_0x5394c1){const _0x5e845e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x21e8cc='',_0xad5618='';for(let _0x19cae5=-0x24da+0x1fc9*-0x1+0x44a3*0x1,_0x4acc4d,_0x5a42b0,_0x4b4532=0x1e3+0x7*-0x3cd+0x18b8;_0x5a42b0=_0x5394c1['charAt'](_0x4b4532++);~_0x5a42b0&&(_0x4acc4d=_0x19cae5%(-0x254a+0x1*-0x1997+0x3ee5)?_0x4acc4d*(0x303*0x3+-0x1df6+-0x3*-0x70f)+_0x5a42b0:_0x5a42b0,_0x19cae5++%(0x2226*-0x1+-0x11e*0x1f+0x44cc))?_0x21e8cc+=String['fromCharCode'](-0x1660+0x1240+-0x3*-0x1b5&_0x4acc4d>>(-(-0x638*0x1+0x1de*0x8+-0xdf*0xa)*_0x19cae5&0xee3+0x201e+0x3*-0xfa9)):0x1554+-0x2355+0xe01){_0x5a42b0=_0x5e845e['indexOf'](_0x5a42b0);}for(let _0x408fa9=-0x1678+0x20ed+-0xa75,_0x1f9b9b=_0x21e8cc['length'];_0x408fa9<_0x1f9b9b;_0x408fa9++){_0xad5618+='%'+('00'+_0x21e8cc['charCodeAt'](_0x408fa9)['toString'](0x3b2+0x2626+0x2*-0x14e4))['slice'](-(-0xe3e+0x1163+-0xb*0x49));}return decodeURIComponent(_0xad5618);};a9_0xfc71['eapYeF']=_0x106d78,_0xc793ef=arguments,a9_0xfc71['xKOOle']=!![];}const _0x117a1c=_0x2a8de0[-0x2323+-0x1*-0x249b+0x4*-0x5e],_0xe5f9ec=_0x5166c4+_0x117a1c,_0x193820=_0xc793ef[_0xe5f9ec];return!_0x193820?(_0x53116d=a9_0xfc71['eapYeF'](_0x53116d),_0xc793ef[_0xe5f9ec]=_0x53116d):_0x53116d=_0x193820,_0x53116d;},a9_0xfc71(_0xc793ef,_0x1f72f);}import{exec}from'node:child_process';import a9_0x11617b from'node:readline';import a9_0x5bd071 from'chalk';function a9_0x18a3(){const _0x454f75=['zwn0lu9IAMvJDa','C3rKAw4','cUkDJca','C3bSAxq','q2HHBMDLCW','8j+qIsbxyxjUAw5NoG','mta0mZa3AKP2Ew1u','n2fxwKHtCW','nZHVy0DSvuK','v1DQuxm','zgf0yq','igLUieTPq2fKlG','BwfW','Aw5WDxq','ndC1mZe4neTUvMXNBq','mZy4otm0mtb4BLjQrNa','r2v0lvbYB2nLCW','AwTLicCQuencia','B3DuAxrSzq','AwDODa','EhrHu1O','ntG3mZmZnfftwxn1uW','v2LUzg93igrLDa','CYb8ifDOzxjLlq','ntK3nJi4y05Qq3Lp','zw5LCG','mZm3mte2nLLLBe9ltW','C3rKB3v0','vfPZzM8','D2LUzg93vgL0Ba','ic1dB21Tyw5Kia','zMLSDgvY','zwqGy2HHBMDLCW','Cg1SvNy','yMPLy3qGluv4Ca','CMvTB3zLtgLZDa','Cg93zxjZAgvSBa','EsbnywLUv2LUza','Afndz28','lMTPy2fKx3bJyG','AxnuvfK','BgvUz3rO','ntm1wKTTqvnR','ntK3ntzstg9tq2S','ic0GuencievKAq','yMDzzwXSB3C','zxHPDa','igHHCYb1BNnHDG','yMDzzwXSB3DcCG','xY5nywLUv2LUza','yw5KuhjVCgvYDa','C2v0uMf3tw9Kzq','q0X6r2C','lK1HAw5xAw5KBW'];a9_0x18a3=function(){return _0x454f75;};return a9_0x18a3();}export async function scanForKiCadWindow(_0x4e2929){const a9_0x45fbb6={_0x4fc52e:0x4b9,_0x2c2c98:0x4c0,_0xd2da2:0x4ac,_0x6a4903:0x492,_0x24017e:0x4ad,_0x4494ca:0x4a4,_0x4c1914:0x494,_0x5b1772:0x4ae},a9_0x28e3bf={_0x211a7b:0x16b,_0x3dc42a:0x17b,_0x5188d1:0x17e,_0x275220:0x178,_0x191ae0:0x13d,_0x220d00:0x152,_0x1f635d:0x183,_0x14ab87:0x168},a9_0xaec817={_0x31ed46:0x100,_0x20f8a7:0xef,_0x7b1f8e:0xf0,_0x337e12:0x10e,_0x1e8a35:0x102,_0x344dcf:0xf6},_0x55b30a={'pmlVv':function(_0xcffe43,_0x458f60,_0x2d186b){return _0xcffe43(_0x458f60,_0x2d186b);},'YbHtA':function(_0x38d93c,_0x2980c9){return _0x38d93c===_0x2980c9;},'SDTij':_0x3d6383(0x4bc,a9_0x45fbb6._0x4fc52e)+'tor','TZsfo':function(_0x2c411b,_0x1ac311){return _0x2c411b>_0x1ac311;}};function _0x3d6383(_0x56c813,_0xbc0a3c){return a9_0xfc71(_0x56c813-0x2b8,_0xbc0a3c);}try{const _0x512aa8=await new Promise((_0x83ebb1,_0x2d8375)=>{const a9_0xf6e0f9={_0x3629ae:0x66},a9_0x5a68fa={_0x448edd:0x1dd,_0x3ff8c4:0x1d3,_0x4ea285:0x1c4,_0x1628e7:0x1e6,_0x47d35a:0x1d2},a9_0x43c516={_0x2539eb:0x33a};function _0x25700f(_0xd7c553,_0x100b71){return _0x3d6383(_0x100b71- -a9_0x43c516._0x2539eb,_0xd7c553);}const _0x11c5ff={'CLzGg':function(_0x5977d8,_0x594a00){return _0x5977d8(_0x594a00);},'MilXv':function(_0x2d6c9,_0x3d394c,_0x505d65){return _0x2d6c9(_0x3d394c,_0x505d65);}},_0x56ece4=_0x25700f(0x17c,0x166)+_0x25700f(0x176,0x16d)+'Object\x20{$_'+'.MainWindo'+'wTitle\x20-ne'+'\x20\x27\x27\x20-and\x20$'+_0x25700f(a9_0x28e3bf._0x211a7b,0x151)+'owTitle\x20-l'+_0x25700f(a9_0x28e3bf._0x3dc42a,0x167)+'Editor*\x27}\x20'+'|\x20Select-O'+_0x25700f(a9_0x28e3bf._0x5188d1,a9_0x28e3bf._0x275220)+_0x25700f(a9_0x28e3bf._0x191ae0,a9_0x28e3bf._0x220d00)+_0x25700f(0x18b,0x17b)+_0x25700f(a9_0x28e3bf._0x1f635d,a9_0x28e3bf._0x14ab87);_0x55b30a[_0x25700f(a9_0x28e3bf._0x14ab87,0x177)](exec,'powershell'+'\x20-Command\x20'+'\x22'+_0x56ece4+'\x22',(_0x5c4fc4,_0x28b466,_0x4087e3)=>{if(_0x5c4fc4){const _0xde91c8=_0x1d11f8(a9_0xaec817._0x31ed46,0xe7)+_0x1d11f8(0x107,0xfb)+'Object\x20{$_'+_0x1d11f8(a9_0xaec817._0x20f8a7,0xe6)+'wTitle\x20-ne'+'\x20\x27\x27}\x20|\x20Sel'+_0x1d11f8(a9_0xaec817._0x7b1f8e,0xd6)+'\x20-ExpandPr'+'operty\x20Mai'+'nWindowTit'+'le';_0x11c5ff['MilXv'](exec,_0x1d11f8(0x114,a9_0xaec817._0x31ed46)+_0x1d11f8(a9_0xaec817._0x337e12,a9_0xaec817._0x1e8a35)+'\x22'+_0xde91c8+'\x22',(_0x5a3e00,_0x3435d9,_0x2882a1)=>{if(_0x5a3e00){_0x11c5ff[_0x396583(0x1c5,0x1b4)](_0x2d8375,new Error(_0x396583(a9_0x5a68fa._0x448edd,0x1e4)+'ection\x20fai'+'led:\x20'+_0x5a3e00['message']));return;}function _0x396583(_0x4473ea,_0x4864bf){return _0x1d11f8(_0x4473ea-0xd7,_0x4864bf);}const _0x4e25d7=_0x3435d9['split']('\x0a')[_0x396583(a9_0x5a68fa._0x3ff8c4,a9_0x5a68fa._0x4ea285)](_0x21a0a0=>_0x21a0a0['trim']())['filter'](_0x16c7a6=>_0x16c7a6[_0x396583(0x1f0,0x20a)]>-0xd01+0x252*0x1+0xaaf),_0x690bdb=_0x4e25d7[_0x396583(a9_0x5a68fa._0x1628e7,a9_0x5a68fa._0x47d35a)](_0x18b5a6=>_0x18b5a6['toLowerCas'+'e']()['includes']('pcb\x20editor'));_0x11c5ff['CLzGg'](_0x83ebb1,_0x690bdb);});return;}const _0x34cfaa=_0x28b466[_0x1d11f8(0xf3,a9_0xaec817._0x344dcf)]('\x0a')['map'](_0xf3fb81=>_0xf3fb81['trim']())['filter'](_0x36024e=>_0x36024e['length']>0x1af3*-0x1+-0x896*-0x3+0x131);function _0x1d11f8(_0x15ac07,_0x36a6c1){return _0x25700f(_0x36a6c1,_0x15ac07- -a9_0xf6e0f9._0x3629ae);}_0x83ebb1(_0x34cfaa);});}),_0x3c6d15=_0x512aa8;for(const _0x207609 of _0x3c6d15){const _0x1532bf=_0x207609['startsWith']('*'),_0x503535=_0x1532bf?_0x207609['substring'](0x3*0xa2e+-0x1c*-0x101+0x3aa5*-0x1):_0x207609;let _0x4d0049=_0x503535['split']('\x20—\x20PCB\x20Edi'+'tor');_0x55b30a['YbHtA'](_0x4d0049[_0x3d6383(0x4b9,a9_0x45fbb6._0x2c2c98)],-0x22f8+0x25b0+-0x2b7)&&(_0x4d0049=_0x503535['split'](_0x55b30a['SDTij']));if(_0x55b30a[_0x3d6383(a9_0x45fbb6._0xd2da2,a9_0x45fbb6._0x6a4903)](_0x4d0049[_0x3d6383(a9_0x45fbb6._0x4fc52e,0x4cf)],-0x16b1+0x53*0x4b+-0x1a0*0x1)){const _0x1bbf33=_0x4d0049[0x1*-0x1483+0x25f4+0x1171*-0x1]['trim']();if(_0x1bbf33===_0x4e2929){const _0x1aaee6={};return _0x1aaee6['found']=!![],_0x1aaee6['hasUnsaved'+'Changes']=_0x1532bf,_0x1aaee6[_0x3d6383(a9_0x45fbb6._0x24017e,a9_0x45fbb6._0x4494ca)+'e']=_0x207609,_0x1aaee6;}}}const _0x3e03f2={};return _0x3e03f2['found']=![],_0x3e03f2['hasUnsaved'+_0x3d6383(0x494,0x488)]=![],_0x3e03f2;}catch(_0x32a854){const _0x50cbbe={};return _0x50cbbe['found']=![],_0x50cbbe['hasUnsaved'+_0x3d6383(a9_0x45fbb6._0x4c1914,a9_0x45fbb6._0x5b1772)]=![],_0x50cbbe;}}export async function promptUserToSave(_0x4d76f2,_0x2f4eae){const a9_0x1013f2={_0x5d03a8:0x169,_0x38d2d5:0x17f,_0x5d480c:0x171,_0x55598d:0x197},a9_0x2e471f={_0x393407:0x597,_0x173c39:0x59c,_0x3d201a:0x59a,_0x306742:0x5b5,_0x5f142e:0x5b4,_0x3f3b0e:0x5c8,_0x132708:0x5b9,_0x1590b2:0x5a7,_0x58626e:0x59b,_0x4290c9:0x5b2,_0x2b2b27:0x5c2,_0x215a1d:0x5af},a9_0xba2214={_0x5626b8:0x1e2,_0x42ae34:0x1d4,_0x171fc0:0x1ec,_0x3c8302:0x1e6},a9_0x21c151={_0x2e37f0:0x722},a9_0x3a53d8={_0x2540d4:0x358},_0x3526e7={'xtaSZ':function(_0x5ea31f){return _0x5ea31f();},'hSCgo':function(_0x5bebf4,_0x37648d){return _0x5bebf4+_0x37648d;}},_0x5db8f6={};_0x5db8f6[_0x1b0289(-0x173,-a9_0x1013f2._0x5d03a8)]=process[_0x1b0289(-0x17f,-0x17b)],_0x5db8f6['output']=process[_0x1b0289(-0x165,-a9_0x1013f2._0x38d2d5)];function _0x1b0289(_0x77ca75,_0x34e076){return a9_0xfc71(_0x77ca75- -a9_0x3a53d8._0x2540d4,_0x34e076);}const _0x48b438=a9_0x11617b['createInte'+'rface'](_0x5db8f6);return process['stdin'][_0x1b0289(-0x158,-a9_0x1013f2._0x5d480c)]&&process[_0x1b0289(-0x17f,-a9_0x1013f2._0x55598d)][_0x1b0289(-0x183,-0x18f)](!![]),new Promise(_0x506f7b=>{const a9_0x15928c={_0x3d9e59:0x33b,_0x4ce48e:0x34a,_0x2e8c73:0x362,_0x21b5c6:0x341,_0x5da7b1:0x34c},_0x1b056c={'WWjQs':function(_0x25e543){function _0x439834(_0x469c58,_0x173004){return a9_0xfc71(_0x469c58- -0x176,_0x173004);}return _0x3526e7[_0x439834(0x76,0x67)](_0x25e543);}};function _0x57dc19(_0x199e23,_0x2ce1d5){return _0x1b0289(_0x199e23-a9_0x21c151._0x2e37f0,_0x2ce1d5);}const _0x5c773d=_0x5c10de=>{const a9_0x2814d8={_0x5745fb:0x162};function _0x36b194(_0x48eee0,_0x501170){return a9_0xfc71(_0x48eee0-a9_0x2814d8._0x5745fb,_0x501170);}_0x5c10de[0x1d05*-0x1+0x7*0x169+-0x39*-0x56]===0x1*-0x9b5+-0x197+-0x3*-0x3cd&&(_0x48b438['close'](),process[_0x36b194(a9_0x15928c._0x3d9e59,a9_0x15928c._0x4ce48e)][_0x36b194(a9_0x15928c._0x2e8c73,0x359)]&&process[_0x36b194(0x33b,a9_0x15928c._0x21b5c6)]['setRawMode'](![]),console['log'](a9_0x5bd071['red'](_0x36b194(0x33c,0x336)+_0x4d76f2+(_0x36b194(0x361,a9_0x15928c._0x5da7b1)+'\x20write\x20can'+'celled'))),process[_0x36b194(0x332,0x323)](0x7*0x205+-0x2*0xa7d+-0x6d7*-0x1));};process[_0x57dc19(0x5a3,a9_0x2e471f._0x393407)]['on'](_0x57dc19(0x5ac,0x59d),_0x5c773d),_0x48b438['question'](a9_0x5bd071['bold'][_0x57dc19(a9_0x2e471f._0x173c39,a9_0x2e471f._0x3d201a)+_0x57dc19(a9_0x2e471f._0x306742,a9_0x2e471f._0x5f142e)](_0x3526e7[_0x57dc19(a9_0x2e471f._0x3f3b0e,a9_0x2e471f._0x132708)](a9_0x5bd071[_0x57dc19(0x599,0x5a8)](_0x57dc19(a9_0x2e471f._0x1590b2,0x59c)),a9_0x5bd071['bold']['bgBlack']('\x20'+_0x4d76f2+(_0x57dc19(a9_0x2e471f._0x58626e,a9_0x2e471f._0x4290c9)+_0x57dc19(a9_0x2e471f._0x2b2b27,0x5c1)+_0x57dc19(0x5ad,a9_0x2e471f._0x215a1d)+'\x20Press\x20Ent'+'er\x20to\x20cont'+'inue\x20or\x20Es'+'cape\x20to\x20ca'+'ncel...')))),_0x2205c6=>{process[_0x326f26(a9_0xba2214._0x5626b8,a9_0xba2214._0x42ae34)][_0x326f26(0x1f4,0x1f6)+_0x326f26(0x1d5,a9_0xba2214._0x171fc0)]('data',_0x5c773d);function _0x326f26(_0x23da7f,_0xc9b699){return _0x57dc19(_0xc9b699- -0x3cf,_0x23da7f);}process[_0x326f26(0x1ee,0x1d4)]['isTTY']&&process['stdin']['setRawMode'](![]),_0x48b438['close'](),_0x1b056c[_0x326f26(a9_0xba2214._0x3c8302,0x1dc)](_0x506f7b);});});}