/**
 * Minified by jsDelivr using Terser v5.19.2.
 * Original file: /npm/hotspot-test@0.0.5/hotspot-control.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
var config=require("./config/config.json"),cmd=require("node-cmd"),fs=require("fs");function HotSpotControl(){}HotSpotControl.prototype.createHotSpot=function(t){hs.writeConfig(),cmd.get("netsh wlan set hostednetwork mode=allow ssid="+config.ssid+" key="+config.key,(function(o){console.log("createHotSpot: ",o),t&&t(o)}))},HotSpotControl.prototype.startHotSpot=function(t){cmd.get("netsh wlan start hostednetwork",(function(o){console.log("startHotSpot: ",o),t&&t(o)}))},HotSpotControl.prototype.stopHotSpot=function(t){cmd.get("netsh wlan stop hostednetwork",(function(o){console.log("stopHotSpot: ",o),t&&t(o)}))},HotSpotControl.prototype.showHotSpot=function(t){cmd.get("netsh wlan show hostednetwork",(function(o){console.log("showHotSpot: ",o),hs.netshParser(o,(function(o){t&&t(o)}))}))},HotSpotControl.prototype.enableInternetConnectionShare=function(t){cmd.get("netsh wlan show hostednetwork",(function(o){console.log("Enable Internet Connection Share: ",o),t&&t(o)}))},HotSpotControl.prototype.netshParser=function(t,o){var n,e=t.split("\r\n"),r=new Object;r.Authenticated=[];for(var s=0;s<e.length;s++){var i;if(e[s].split(":").length>1)(i=e[s].replace(/[\s\"]+/g,"")).match(/Authenticated/g)?(i=i.replace(/Authenticated/g,""),r.Authenticated.push(i)):r[(i=i.replace(/:/i,"$").split("$"))[0]]=i[1]}n=JSON.stringify(r,null,"\t"),hs.writeStatus(n),o&&o(n)},HotSpotControl.prototype.writeStatus=function(t){fs.writeFile("../config/status.json",t,(function(t){if(t)throw t}))},HotSpotControl.prototype.getHostName=function(t){cmd.get("hostname",(function(o){t&&t(o)}))},HotSpotControl.prototype.writeConfig=function(){fs.readFile("../config/config.json",(function(t,o){var n;t?console.error(t):(n=JSON.parse(o),hs.getHostName((function(t){t=t.replace(/\r\n/,""),n.ssid=t,fs.writeFile("../config/config.json",JSON.stringify(n,null,"\t"),(function(t){if(t)throw t}))})))}))},HotSpotControl.prototype.showStatus=function(t){fs.readFile("../config/status.json",(function(o,n){o?console.log(o):t&&t(JSON.stringify(JSON.parse(n),null,"\t"))}))};var hs=new HotSpotControl;hs.writeConfig(),exports.HotSpotControl=HotSpotControl;
//# sourceMappingURL=/sm/a4f0e850eacaa0842263c5eaa904061c40e309f4270c1655167fea400b48aa90.map