Built motion from commit f3d513ea8.|1.0.25
[motion.git] / server / config / agi / lib / scripts / index.js
index 8acc484..1d70fa5 100644 (file)
@@ -1 +1 @@
-var _0xf7a5=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x66\x73","\x70\x61\x74\x68","\x68\x74\x74\x70","\x68\x74\x74\x70\x73","\x70\x61\x72\x73\x65","\x75\x72\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x72\x61\x6E\x64\x6F\x6D\x73\x74\x72\x69\x6E\x67","\x73\x6F\x78","\x67\x6F\x6F\x67\x6C\x65\x2D\x74\x74\x73\x2D\x61\x70\x69","\x75\x74\x69\x6C","\x71\x75\x65\x72\x79\x73\x74\x72\x69\x6E\x67","\x6D\x6F\x6D\x65\x6E\x74","\x61\x77\x73\x2D\x73\x64\x6B","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x61\x70\x69\x2E\x69\x73\x70\x65\x65\x63\x68\x2E\x6F\x72\x67\x2F\x61\x70\x69\x2F\x72\x65\x73\x74","\x70\x72\x6F\x74\x6F\x63\x6F\x6C","\x68\x74\x74\x70\x73\x3A","\x68\x6F\x73\x74","\x57\x48\x41\x54\x5F\x45\x56\x45\x52","\x65\x6E\x64","\x65\x72\x72\x6F\x72","\x6F\x6E","\x73\x74\x61\x74\x75\x73\x43\x6F\x64\x65","\x72\x65\x71\x75\x65\x73\x74\x20\x74\x6F\x20","\x20\x66\x61\x69\x6C\x65\x64\x2C\x20\x73\x74\x61\x74\x75\x73\x20\x63\x6F\x64\x65\x20\x3D\x20","\x20\x28","\x73\x74\x61\x74\x75\x73\x4D\x65\x73\x73\x61\x67\x65","\x29","\x63\x72\x65\x61\x74\x65\x57\x72\x69\x74\x65\x53\x74\x72\x65\x61\x6D","\x66\x69\x6E\x69\x73\x68","\x63\x6C\x6F\x73\x65","\x75\x6E\x6C\x69\x6E\x6B","\x70\x69\x70\x65","\x67\x65\x74","","\x64\x61\x74\x61","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x68\x6F\x73\x74\x6E\x61\x6D\x65","\x70\x6F\x72\x74","\x50\x4F\x53\x54","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x6A\x73\x6F\x6E","\x75\x74\x66\x38","\x73\x65\x74\x45\x6E\x63\x6F\x64\x69\x6E\x67","\x72\x65\x71\x75\x65\x73\x74","\x77\x72\x69\x74\x65","\x77\x61\x76","\x74\x72\x61\x6E\x73\x63\x6F\x64\x65","\x73\x74\x61\x72\x74","\x41\x75\x64\x69\x6F\x53\x74\x72\x65\x61\x6D","\x77\x72\x69\x74\x65\x46\x69\x6C\x65","\x49\x6E\x76\x61\x6C\x69\x64\x20\x64\x61\x74\x61\x20\x72\x65\x73\x70\x6F\x6E\x73\x65\x20\x66\x72\x6F\x6D\x20\x61\x77\x73\x20\x50\x6F\x6C\x6C\x79\x21","\x4E\x6F\x20\x64\x61\x74\x61\x20\x72\x65\x73\x70\x6F\x6E\x73\x65\x20\x66\x72\x6F\x6D\x20\x61\x77\x73\x20\x50\x6F\x6C\x6C\x79\x21","\x73\x79\x6E\x74\x68\x65\x73\x69\x7A\x65\x53\x70\x65\x65\x63\x68","\x72\x65\x61\x64\x46\x69\x6C\x65\x53\x79\x6E\x63","\x62\x61\x73\x65\x36\x34","\x67\x6F\x6F\x67\x6C\x65\x54\x54\x53","\x2E","\x73\x70\x6C\x69\x74","\x74\x68\x65\x6E","\x74\x6D\x70","\x67\x65\x6E\x65\x72\x61\x74\x65","\x2E\x77\x61\x76","\x72\x65\x73\x6F\x6C\x76\x65","\x2E\x6D\x70\x33","\x65\x6E","\x69\x73\x70\x65\x65\x63\x68\x54\x54\x53","\x25\x73\x3F\x61\x70\x69\x6B\x65\x79\x3D\x25\x73\x26\x61\x63\x74\x69\x6F\x6E\x3D\x63\x6F\x6E\x76\x65\x72\x74\x26\x74\x65\x78\x74\x3D\x25\x73\x26\x76\x6F\x69\x63\x65\x3D\x25\x73\x26\x73\x70\x65\x65\x64\x3D\x25\x73\x26\x66\x6F\x72\x6D\x61\x74\x3D\x6D\x70\x33","\x66\x6F\x72\x6D\x61\x74","\x61\x77\x73\x50\x6F\x6C\x6C\x79","\x6D\x70\x33","\x69\x73\x70\x65\x65\x63\x68\x41\x53\x52","\x25\x73\x3F\x61\x70\x69\x6B\x65\x79\x3D\x25\x73\x26\x61\x63\x74\x69\x6F\x6E\x3D\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x26\x6C\x6F\x63\x61\x6C\x65\x3D\x25\x73\x26\x63\x6F\x6E\x74\x65\x6E\x74\x2D\x74\x79\x70\x65\x3D\x61\x75\x64\x69\x6F\x2F\x78\x2D\x77\x61\x76\x26\x61\x75\x64\x69\x6F\x3D\x25\x73\x26\x25\x73","\x6D\x6F\x64\x65\x6C\x3D\x25\x73","\x66\x72\x65\x65\x66\x6F\x72\x6D\x3D\x33","\x74\x69\x67\x65\x72\x44\x69\x61\x6C\x43\x61\x6C\x6C\x62\x61\x63\x6B","\x68\x74\x74\x70\x3A\x2F\x2F\x6C\x6F\x63\x61\x6C\x68\x6F\x73\x74\x2F\x61\x70\x69\x2F\x72\x65\x73\x74\x2F\x63\x6F\x6E\x74\x61\x63\x74\x2F\x69\x6E\x73\x65\x72\x74","\x2C","\x74\x72\x69\x6D","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x6D\x69\x6E\x75\x74\x65\x73","\x61\x64\x64","\x73\x74\x61\x74\x75\x73","\x64\x69\x72\x4E\x61\x6D\x65"];_0xf7a5[0];var fs=require(_0xf7a5[1]);var path=require(_0xf7a5[2]);var http=require(_0xf7a5[3]);var https=require(_0xf7a5[4]);var urlParse=require(_0xf7a5[6])[_0xf7a5[5]];var BPromise=require(_0xf7a5[7]);var rs=require(_0xf7a5[8]);var sox=require(_0xf7a5[9]);var tts=require(_0xf7a5[10]);var util=require(_0xf7a5[11]);var querystring=require(_0xf7a5[12]);var moment=require(_0xf7a5[13]);var AWS=require(_0xf7a5[14]);var ISPEECH_API=_0xf7a5[15];function downloadFile(_0xebaax10,_0xebaax11){return  new BPromise(function(_0xebaax12,_0xebaax13){var _0xebaax14=urlParse(_0xebaax10);var _0xebaax15=_0xebaax14[_0xf7a5[16]]=== _0xf7a5[17]?https:http;var _0xebaax16={host:_0xebaax14[_0xf7a5[18]],path:_0xebaax14[_0xf7a5[2]],headers:{"\x75\x73\x65\x72\x2D\x61\x67\x65\x6E\x74":_0xf7a5[19]}};_0xebaax15[_0xf7a5[34]](_0xebaax16,function(_0xebaax18){if(_0xebaax18[_0xf7a5[23]]!== 200){_0xebaax13( new Error(_0xf7a5[24]+ _0xebaax10+ _0xf7a5[25]+ _0xebaax18[_0xf7a5[23]]+ _0xf7a5[26]+ _0xebaax18[_0xf7a5[27]]+ _0xf7a5[28]));return};var _0xebaax19=fs[_0xf7a5[29]](_0xebaax11);_0xebaax19[_0xf7a5[22]](_0xf7a5[30],function(){_0xebaax19[_0xf7a5[31]](_0xebaax12)});_0xebaax19[_0xf7a5[22]](_0xf7a5[21],function(_0xebaax17){fs[_0xf7a5[32]](_0xebaax11);_0xebaax13(_0xebaax17)});_0xebaax18[_0xf7a5[33]](_0xebaax19)})[_0xf7a5[22]](_0xf7a5[21],function(_0xebaax17){_0xebaax13(_0xebaax17)})[_0xf7a5[20]]()})}function uploadFile(_0xebaax10){return  new BPromise(function(_0xebaax12,_0xebaax13){var _0xebaax14=urlParse(_0xebaax10);var _0xebaax15=_0xebaax14[_0xf7a5[16]]=== _0xf7a5[17]?https:http;var _0xebaax16={host:_0xebaax14[_0xf7a5[18]],path:_0xebaax14[_0xf7a5[2]],headers:{"\x75\x73\x65\x72\x2D\x61\x67\x65\x6E\x74":_0xf7a5[19]}};_0xebaax15[_0xf7a5[34]](_0xebaax16,function(_0xebaax18){if(_0xebaax18[_0xf7a5[23]]!== 200){_0xebaax13( new Error(_0xf7a5[24]+ _0xebaax10+ _0xf7a5[25]+ _0xebaax18[_0xf7a5[23]]+ _0xf7a5[26]+ _0xebaax18[_0xf7a5[27]]+ _0xf7a5[28]));return};var _0xebaax1b=_0xf7a5[35];_0xebaax18[_0xf7a5[22]](_0xf7a5[36],function(_0xebaax1c){_0xebaax1b+= _0xebaax1c});_0xebaax18[_0xf7a5[22]](_0xf7a5[20],function(){_0xebaax12(_0xebaax1b)})})[_0xf7a5[22]](_0xf7a5[21],function(_0xebaax17){_0xebaax13(_0xebaax17)})[_0xf7a5[20]]()})}function tigerDialAPI(_0xebaax10,_0xebaax1e){return  new BPromise(function(_0xebaax12,_0xebaax13){var _0xebaax1f=JSON[_0xf7a5[37]](_0xebaax1e);var _0xebaax14=urlParse(_0xebaax10);var _0xebaax15=_0xebaax14[_0xf7a5[16]]=== _0xf7a5[17]?https:http;var _0xebaax16={hostname:_0xebaax14[_0xf7a5[38]],path:_0xebaax14[_0xf7a5[2]],port:_0xebaax14[_0xf7a5[39]],method:_0xf7a5[40],headers:{"\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x54\x79\x70\x65":_0xf7a5[41]}};var _0xebaax20=_0xebaax15[_0xf7a5[44]](_0xebaax16,function(_0xebaax18){if(_0xebaax18[_0xf7a5[23]]!== 200){_0xebaax13( new Error(_0xf7a5[24]+ _0xebaax10+ _0xf7a5[25]+ _0xebaax18[_0xf7a5[23]]+ _0xf7a5[26]+ _0xebaax18[_0xf7a5[27]]+ _0xf7a5[28]));return};_0xebaax18[_0xf7a5[43]](_0xf7a5[42]);var _0xebaax1b=_0xf7a5[35];_0xebaax18[_0xf7a5[22]](_0xf7a5[36],function(_0xebaax1c){_0xebaax1b+= _0xebaax1c});_0xebaax18[_0xf7a5[22]](_0xf7a5[20],function(){_0xebaax12(_0xebaax1b)})});_0xebaax20[_0xf7a5[22]](_0xf7a5[21],function(_0xebaax17){_0xebaax13(_0xebaax17)});_0xebaax20[_0xf7a5[45]](_0xebaax1f);_0xebaax20[_0xf7a5[20]]()})}function convertFile(_0xebaax19,_0xebaax11){return  new BPromise(function(_0xebaax12,_0xebaax13){var _0xebaax22=sox[_0xf7a5[47]](_0xebaax19,_0xebaax11,{sampleRate:8000,format:_0xf7a5[46],channelCount:1,bitRate:192* 1024,compressionQuality:5});_0xebaax22[_0xf7a5[22]](_0xf7a5[21],function(_0xebaax17){_0xebaax13(_0xebaax17)});_0xebaax22[_0xf7a5[22]](_0xf7a5[20],function(){_0xebaax12()});_0xebaax22[_0xf7a5[48]]()})}function pollyResult(_0xebaax24,_0xebaax25,_0xebaax26){return  new BPromise(function(_0xebaax12,_0xebaax13){_0xebaax24[_0xf7a5[53]](_0xebaax25,function(_0xebaax17,_0xebaax27){if(_0xebaax17){_0xebaax13(_0xebaax17)}else {if(_0xebaax27){if(_0xebaax27[_0xf7a5[49]] instanceof  Buffer){fs[_0xf7a5[50]](_0xebaax26,_0xebaax27.AudioStream,function(_0xebaax17){if(_0xebaax17){_0xebaax13(_0xebaax17)}else {_0xebaax12()}})}else {_0xebaax13( new Error(_0xf7a5[51]))}}else {_0xebaax13( new Error(_0xf7a5[52]))}}})})}function base64Encode(_0xebaax19){var _0xebaax29=fs[_0xf7a5[54]](_0xebaax19);return  new Buffer(_0xebaax29).toString(_0xf7a5[55])}exports[_0xf7a5[56]]= function(_0xebaax2a,_0xebaax2b){var _0xebaax26;var _0xebaax2c;return tts(_0xebaax2a,_0xebaax2b|| _0xf7a5[65],1)[_0xf7a5[59]](function(_0xebaax10){_0xebaax26= path[_0xf7a5[63]](__dirname,_0xf7a5[60],rs[_0xf7a5[61]](4)+ _0xf7a5[64]);return downloadFile(_0xebaax10,_0xebaax26)})[_0xf7a5[59]](function(){_0xebaax2c= path[_0xf7a5[63]](__dirname,_0xf7a5[60],rs[_0xf7a5[61]](4)+ _0xf7a5[62]);return convertFile(_0xebaax26,_0xebaax2c)})[_0xf7a5[59]](function(){fs[_0xf7a5[32]](_0xebaax26);return _0xebaax2c[_0xf7a5[58]](_0xf7a5[57])[0]})};exports[_0xf7a5[66]]= function(_0xebaax2d,_0xebaax2a,_0xebaax2b,_0xebaax2e){var _0xebaax10=util[_0xf7a5[68]](_0xf7a5[67],ISPEECH_API,_0xebaax2d,encodeURIComponent(_0xebaax2a),_0xebaax2b,_0xebaax2e);var _0xebaax26=path[_0xf7a5[63]](__dirname,_0xf7a5[60],rs[_0xf7a5[61]](4)+ _0xf7a5[64]);var _0xebaax2c;return downloadFile(_0xebaax10,_0xebaax26)[_0xf7a5[59]](function(){_0xebaax2c= path[_0xf7a5[63]](__dirname,_0xf7a5[60],rs[_0xf7a5[61]](4)+ _0xf7a5[62]);return convertFile(_0xebaax26,_0xebaax2c)})[_0xf7a5[59]](function(){fs[_0xf7a5[32]](_0xebaax26);return _0xebaax2c[_0xf7a5[58]](_0xf7a5[57])[0]})};exports[_0xf7a5[69]]= function(_0xebaax2f,_0xebaax30,_0xebaax31,_0xebaax32,_0xebaax2a){var _0xebaax33= new AWS.Polly({accessKeyId:_0xebaax2f,secretAccessKey:_0xebaax30,region:_0xebaax31});var _0xebaax25={"\x54\x65\x78\x74":_0xebaax2a,OutputFormat:_0xf7a5[70],VoiceId:_0xebaax32};var _0xebaax26=path[_0xf7a5[63]](__dirname,_0xf7a5[60],rs[_0xf7a5[61]](4)+ _0xf7a5[64]);var _0xebaax2c;return pollyResult(_0xebaax33,_0xebaax25,_0xebaax26)[_0xf7a5[59]](function(){_0xebaax2c= path[_0xf7a5[63]](__dirname,_0xf7a5[60],rs[_0xf7a5[61]](4)+ _0xf7a5[62]);return convertFile(_0xebaax26,_0xebaax2c)})[_0xf7a5[59]](function(){fs[_0xf7a5[32]](_0xebaax26);return _0xebaax2c[_0xf7a5[58]](_0xf7a5[57])[0]})};exports[_0xf7a5[71]]= function(_0xebaax26,_0xebaax2d,_0xebaax2b,_0xebaax34){var _0xebaax10=util[_0xf7a5[68]](_0xf7a5[72],ISPEECH_API,_0xebaax2d,_0xebaax2b,base64Encode(_0xebaax26),_0xebaax34?util[_0xf7a5[68]](_0xf7a5[73],encodeURIComponent(_0xebaax34)):_0xf7a5[74]);return uploadFile(_0xebaax10)[_0xf7a5[59]](function(_0xebaax18){return querystring[_0xf7a5[5]](_0xebaax18)})};exports[_0xf7a5[75]]= function(_0xebaax35,_0xebaax36,_0xebaax37,_0xebaax38,_0xebaax39){var _0xebaax10=_0xf7a5[76];var _0xebaax1e={id_list:parseInt(_0xebaax35),name:_0xebaax36|| _0xf7a5[35],phones:_0xebaax37[_0xf7a5[78]]()[_0xf7a5[58]](_0xf7a5[77]),description:_0xebaax38|| _0xf7a5[35],planningtime:moment()[_0xf7a5[81]](_0xebaax39|| 5,_0xf7a5[80])[_0xf7a5[68]](_0xf7a5[79])};return tigerDialAPI(_0xebaax10,_0xebaax1e)[_0xf7a5[59]](function(_0xebaax18){var _0xebaax3a=JSON[_0xf7a5[5]](_0xebaax18);if(_0xebaax3a[_0xf7a5[82]]> 0){return true};return false})};exports[_0xf7a5[83]]= function(){return __dirname}
\ No newline at end of file
+var _0x8bff=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x66\x73","\x70\x61\x74\x68","\x68\x74\x74\x70","\x68\x74\x74\x70\x73","\x70\x61\x72\x73\x65","\x75\x72\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x72\x61\x6E\x64\x6F\x6D\x73\x74\x72\x69\x6E\x67","\x73\x6F\x78","\x67\x6F\x6F\x67\x6C\x65\x2D\x74\x74\x73\x2D\x61\x70\x69","\x75\x74\x69\x6C","\x71\x75\x65\x72\x79\x73\x74\x72\x69\x6E\x67","\x6D\x6F\x6D\x65\x6E\x74","\x61\x77\x73\x2D\x73\x64\x6B","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x61\x70\x69\x2E\x69\x73\x70\x65\x65\x63\x68\x2E\x6F\x72\x67\x2F\x61\x70\x69\x2F\x72\x65\x73\x74","\x70\x72\x6F\x74\x6F\x63\x6F\x6C","\x68\x74\x74\x70\x73\x3A","\x68\x6F\x73\x74","\x57\x48\x41\x54\x5F\x45\x56\x45\x52","\x65\x6E\x64","\x65\x72\x72\x6F\x72","\x6F\x6E","\x73\x74\x61\x74\x75\x73\x43\x6F\x64\x65","\x72\x65\x71\x75\x65\x73\x74\x20\x74\x6F\x20","\x20\x66\x61\x69\x6C\x65\x64\x2C\x20\x73\x74\x61\x74\x75\x73\x20\x63\x6F\x64\x65\x20\x3D\x20","\x20\x28","\x73\x74\x61\x74\x75\x73\x4D\x65\x73\x73\x61\x67\x65","\x29","\x63\x72\x65\x61\x74\x65\x57\x72\x69\x74\x65\x53\x74\x72\x65\x61\x6D","\x66\x69\x6E\x69\x73\x68","\x63\x6C\x6F\x73\x65","\x75\x6E\x6C\x69\x6E\x6B","\x70\x69\x70\x65","\x67\x65\x74","","\x64\x61\x74\x61","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x68\x6F\x73\x74\x6E\x61\x6D\x65","\x70\x6F\x72\x74","\x50\x4F\x53\x54","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x6A\x73\x6F\x6E","\x75\x74\x66\x38","\x73\x65\x74\x45\x6E\x63\x6F\x64\x69\x6E\x67","\x72\x65\x71\x75\x65\x73\x74","\x77\x72\x69\x74\x65","\x77\x61\x76","\x74\x72\x61\x6E\x73\x63\x6F\x64\x65","\x73\x74\x61\x72\x74","\x41\x75\x64\x69\x6F\x53\x74\x72\x65\x61\x6D","\x77\x72\x69\x74\x65\x46\x69\x6C\x65","\x49\x6E\x76\x61\x6C\x69\x64\x20\x64\x61\x74\x61\x20\x72\x65\x73\x70\x6F\x6E\x73\x65\x20\x66\x72\x6F\x6D\x20\x61\x77\x73\x20\x50\x6F\x6C\x6C\x79\x21","\x4E\x6F\x20\x64\x61\x74\x61\x20\x72\x65\x73\x70\x6F\x6E\x73\x65\x20\x66\x72\x6F\x6D\x20\x61\x77\x73\x20\x50\x6F\x6C\x6C\x79\x21","\x73\x79\x6E\x74\x68\x65\x73\x69\x7A\x65\x53\x70\x65\x65\x63\x68","\x72\x65\x61\x64\x46\x69\x6C\x65\x53\x79\x6E\x63","\x62\x61\x73\x65\x36\x34","\x67\x6F\x6F\x67\x6C\x65\x54\x54\x53","\x2E","\x73\x70\x6C\x69\x74","\x74\x68\x65\x6E","\x74\x6D\x70","\x67\x65\x6E\x65\x72\x61\x74\x65","\x2E\x77\x61\x76","\x72\x65\x73\x6F\x6C\x76\x65","\x2E\x6D\x70\x33","\x65\x6E","\x69\x73\x70\x65\x65\x63\x68\x54\x54\x53","\x25\x73\x3F\x61\x70\x69\x6B\x65\x79\x3D\x25\x73\x26\x61\x63\x74\x69\x6F\x6E\x3D\x63\x6F\x6E\x76\x65\x72\x74\x26\x74\x65\x78\x74\x3D\x25\x73\x26\x76\x6F\x69\x63\x65\x3D\x25\x73\x26\x73\x70\x65\x65\x64\x3D\x25\x73\x26\x66\x6F\x72\x6D\x61\x74\x3D\x6D\x70\x33","\x66\x6F\x72\x6D\x61\x74","\x61\x77\x73\x50\x6F\x6C\x6C\x79","\x6D\x70\x33","\x69\x73\x70\x65\x65\x63\x68\x41\x53\x52","\x25\x73\x3F\x61\x70\x69\x6B\x65\x79\x3D\x25\x73\x26\x61\x63\x74\x69\x6F\x6E\x3D\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x26\x6C\x6F\x63\x61\x6C\x65\x3D\x25\x73\x26\x63\x6F\x6E\x74\x65\x6E\x74\x2D\x74\x79\x70\x65\x3D\x61\x75\x64\x69\x6F\x2F\x78\x2D\x77\x61\x76\x26\x61\x75\x64\x69\x6F\x3D\x25\x73\x26\x25\x73","\x6D\x6F\x64\x65\x6C\x3D\x25\x73","\x66\x72\x65\x65\x66\x6F\x72\x6D\x3D\x33","\x74\x69\x67\x65\x72\x44\x69\x61\x6C\x43\x61\x6C\x6C\x62\x61\x63\x6B","\x68\x74\x74\x70\x3A\x2F\x2F\x6C\x6F\x63\x61\x6C\x68\x6F\x73\x74\x2F\x61\x70\x69\x2F\x72\x65\x73\x74\x2F\x63\x6F\x6E\x74\x61\x63\x74\x2F\x69\x6E\x73\x65\x72\x74","\x2C","\x74\x72\x69\x6D","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x6D\x69\x6E\x75\x74\x65\x73","\x61\x64\x64","\x73\x74\x61\x74\x75\x73","\x64\x69\x72\x4E\x61\x6D\x65"];_0x8bff[0];var fs=require(_0x8bff[1]);var path=require(_0x8bff[2]);var http=require(_0x8bff[3]);var https=require(_0x8bff[4]);var urlParse=require(_0x8bff[6])[_0x8bff[5]];var BPromise=require(_0x8bff[7]);var rs=require(_0x8bff[8]);var sox=require(_0x8bff[9]);var tts=require(_0x8bff[10]);var util=require(_0x8bff[11]);var querystring=require(_0x8bff[12]);var moment=require(_0x8bff[13]);var AWS=require(_0x8bff[14]);var ISPEECH_API=_0x8bff[15];function downloadFile(_0x8842x10,_0x8842x11){return  new BPromise(function(_0x8842x12,_0x8842x13){var _0x8842x14=urlParse(_0x8842x10);var _0x8842x15=_0x8842x14[_0x8bff[16]]=== _0x8bff[17]?https:http;var _0x8842x16={host:_0x8842x14[_0x8bff[18]],path:_0x8842x14[_0x8bff[2]],headers:{"\x75\x73\x65\x72\x2D\x61\x67\x65\x6E\x74":_0x8bff[19]}};_0x8842x15[_0x8bff[34]](_0x8842x16,function(_0x8842x18){if(_0x8842x18[_0x8bff[23]]!== 200){_0x8842x13( new Error(_0x8bff[24]+ _0x8842x10+ _0x8bff[25]+ _0x8842x18[_0x8bff[23]]+ _0x8bff[26]+ _0x8842x18[_0x8bff[27]]+ _0x8bff[28]));return};var _0x8842x19=fs[_0x8bff[29]](_0x8842x11);_0x8842x19[_0x8bff[22]](_0x8bff[30],function(){_0x8842x19[_0x8bff[31]](_0x8842x12)});_0x8842x19[_0x8bff[22]](_0x8bff[21],function(_0x8842x17){fs[_0x8bff[32]](_0x8842x11);_0x8842x13(_0x8842x17)});_0x8842x18[_0x8bff[33]](_0x8842x19)})[_0x8bff[22]](_0x8bff[21],function(_0x8842x17){_0x8842x13(_0x8842x17)})[_0x8bff[20]]()})}function uploadFile(_0x8842x10){return  new BPromise(function(_0x8842x12,_0x8842x13){var _0x8842x14=urlParse(_0x8842x10);var _0x8842x15=_0x8842x14[_0x8bff[16]]=== _0x8bff[17]?https:http;var _0x8842x16={host:_0x8842x14[_0x8bff[18]],path:_0x8842x14[_0x8bff[2]],headers:{"\x75\x73\x65\x72\x2D\x61\x67\x65\x6E\x74":_0x8bff[19]}};_0x8842x15[_0x8bff[34]](_0x8842x16,function(_0x8842x18){if(_0x8842x18[_0x8bff[23]]!== 200){_0x8842x13( new Error(_0x8bff[24]+ _0x8842x10+ _0x8bff[25]+ _0x8842x18[_0x8bff[23]]+ _0x8bff[26]+ _0x8842x18[_0x8bff[27]]+ _0x8bff[28]));return};var _0x8842x1b=_0x8bff[35];_0x8842x18[_0x8bff[22]](_0x8bff[36],function(_0x8842x1c){_0x8842x1b+= _0x8842x1c});_0x8842x18[_0x8bff[22]](_0x8bff[20],function(){_0x8842x12(_0x8842x1b)})})[_0x8bff[22]](_0x8bff[21],function(_0x8842x17){_0x8842x13(_0x8842x17)})[_0x8bff[20]]()})}function tigerDialAPI(_0x8842x10,_0x8842x1e){return  new BPromise(function(_0x8842x12,_0x8842x13){var _0x8842x1f=JSON[_0x8bff[37]](_0x8842x1e);var _0x8842x14=urlParse(_0x8842x10);var _0x8842x15=_0x8842x14[_0x8bff[16]]=== _0x8bff[17]?https:http;var _0x8842x16={hostname:_0x8842x14[_0x8bff[38]],path:_0x8842x14[_0x8bff[2]],port:_0x8842x14[_0x8bff[39]],method:_0x8bff[40],headers:{"\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x54\x79\x70\x65":_0x8bff[41]}};var _0x8842x20=_0x8842x15[_0x8bff[44]](_0x8842x16,function(_0x8842x18){if(_0x8842x18[_0x8bff[23]]!== 200){_0x8842x13( new Error(_0x8bff[24]+ _0x8842x10+ _0x8bff[25]+ _0x8842x18[_0x8bff[23]]+ _0x8bff[26]+ _0x8842x18[_0x8bff[27]]+ _0x8bff[28]));return};_0x8842x18[_0x8bff[43]](_0x8bff[42]);var _0x8842x1b=_0x8bff[35];_0x8842x18[_0x8bff[22]](_0x8bff[36],function(_0x8842x1c){_0x8842x1b+= _0x8842x1c});_0x8842x18[_0x8bff[22]](_0x8bff[20],function(){_0x8842x12(_0x8842x1b)})});_0x8842x20[_0x8bff[22]](_0x8bff[21],function(_0x8842x17){_0x8842x13(_0x8842x17)});_0x8842x20[_0x8bff[45]](_0x8842x1f);_0x8842x20[_0x8bff[20]]()})}function convertFile(_0x8842x19,_0x8842x11){return  new BPromise(function(_0x8842x12,_0x8842x13){var _0x8842x22=sox[_0x8bff[47]](_0x8842x19,_0x8842x11,{sampleRate:8000,format:_0x8bff[46],channelCount:1,bitRate:192* 1024,compressionQuality:5});_0x8842x22[_0x8bff[22]](_0x8bff[21],function(_0x8842x17){_0x8842x13(_0x8842x17)});_0x8842x22[_0x8bff[22]](_0x8bff[20],function(){_0x8842x12()});_0x8842x22[_0x8bff[48]]()})}function pollyResult(_0x8842x24,_0x8842x25,_0x8842x26){return  new BPromise(function(_0x8842x12,_0x8842x13){_0x8842x24[_0x8bff[53]](_0x8842x25,function(_0x8842x17,_0x8842x27){if(_0x8842x17){_0x8842x13(_0x8842x17)}else {if(_0x8842x27){if(_0x8842x27[_0x8bff[49]] instanceof  Buffer){fs[_0x8bff[50]](_0x8842x26,_0x8842x27.AudioStream,function(_0x8842x17){if(_0x8842x17){_0x8842x13(_0x8842x17)}else {_0x8842x12()}})}else {_0x8842x13( new Error(_0x8bff[51]))}}else {_0x8842x13( new Error(_0x8bff[52]))}}})})}function base64Encode(_0x8842x19){var _0x8842x29=fs[_0x8bff[54]](_0x8842x19);return  new Buffer(_0x8842x29).toString(_0x8bff[55])}exports[_0x8bff[56]]= function(_0x8842x2a,_0x8842x2b){var _0x8842x26;var _0x8842x2c;return tts(_0x8842x2a,_0x8842x2b|| _0x8bff[65],1)[_0x8bff[59]](function(_0x8842x10){_0x8842x26= path[_0x8bff[63]](__dirname,_0x8bff[60],rs[_0x8bff[61]](4)+ _0x8bff[64]);return downloadFile(_0x8842x10,_0x8842x26)})[_0x8bff[59]](function(){_0x8842x2c= path[_0x8bff[63]](__dirname,_0x8bff[60],rs[_0x8bff[61]](4)+ _0x8bff[62]);return convertFile(_0x8842x26,_0x8842x2c)})[_0x8bff[59]](function(){fs[_0x8bff[32]](_0x8842x26);return _0x8842x2c[_0x8bff[58]](_0x8bff[57])[0]})};exports[_0x8bff[66]]= function(_0x8842x2d,_0x8842x2a,_0x8842x2b,_0x8842x2e){var _0x8842x10=util[_0x8bff[68]](_0x8bff[67],ISPEECH_API,_0x8842x2d,encodeURIComponent(_0x8842x2a),_0x8842x2b,_0x8842x2e);var _0x8842x26=path[_0x8bff[63]](__dirname,_0x8bff[60],rs[_0x8bff[61]](4)+ _0x8bff[64]);var _0x8842x2c;return downloadFile(_0x8842x10,_0x8842x26)[_0x8bff[59]](function(){_0x8842x2c= path[_0x8bff[63]](__dirname,_0x8bff[60],rs[_0x8bff[61]](4)+ _0x8bff[62]);return convertFile(_0x8842x26,_0x8842x2c)})[_0x8bff[59]](function(){fs[_0x8bff[32]](_0x8842x26);return _0x8842x2c[_0x8bff[58]](_0x8bff[57])[0]})};exports[_0x8bff[69]]= function(_0x8842x2f,_0x8842x30,_0x8842x31,_0x8842x32,_0x8842x2a){var _0x8842x33= new AWS.Polly({accessKeyId:_0x8842x2f,secretAccessKey:_0x8842x30,region:_0x8842x31});var _0x8842x25={"\x54\x65\x78\x74":_0x8842x2a,OutputFormat:_0x8bff[70],VoiceId:_0x8842x32};var _0x8842x26=path[_0x8bff[63]](__dirname,_0x8bff[60],rs[_0x8bff[61]](4)+ _0x8bff[64]);var _0x8842x2c;return pollyResult(_0x8842x33,_0x8842x25,_0x8842x26)[_0x8bff[59]](function(){_0x8842x2c= path[_0x8bff[63]](__dirname,_0x8bff[60],rs[_0x8bff[61]](4)+ _0x8bff[62]);return convertFile(_0x8842x26,_0x8842x2c)})[_0x8bff[59]](function(){fs[_0x8bff[32]](_0x8842x26);return _0x8842x2c[_0x8bff[58]](_0x8bff[57])[0]})};exports[_0x8bff[71]]= function(_0x8842x26,_0x8842x2d,_0x8842x2b,_0x8842x34){var _0x8842x10=util[_0x8bff[68]](_0x8bff[72],ISPEECH_API,_0x8842x2d,_0x8842x2b,base64Encode(_0x8842x26),_0x8842x34?util[_0x8bff[68]](_0x8bff[73],encodeURIComponent(_0x8842x34)):_0x8bff[74]);return uploadFile(_0x8842x10)[_0x8bff[59]](function(_0x8842x18){return querystring[_0x8bff[5]](_0x8842x18)})};exports[_0x8bff[75]]= function(_0x8842x35,_0x8842x36,_0x8842x37,_0x8842x38,_0x8842x39){var _0x8842x10=_0x8bff[76];var _0x8842x1e={id_list:parseInt(_0x8842x35),name:_0x8842x36|| _0x8bff[35],phones:_0x8842x37[_0x8bff[78]]()[_0x8bff[58]](_0x8bff[77]),description:_0x8842x38|| _0x8bff[35],planningtime:moment()[_0x8bff[81]](_0x8842x39|| 5,_0x8bff[80])[_0x8bff[68]](_0x8bff[79])};return tigerDialAPI(_0x8842x10,_0x8842x1e)[_0x8bff[59]](function(_0x8842x18){var _0x8842x3a=JSON[_0x8bff[5]](_0x8842x18);if(_0x8842x3a[_0x8bff[82]]> 0){return true};return false})};exports[_0x8bff[83]]= function(){return __dirname}
\ No newline at end of file