'use strict';function _0x2d84(_0x43cb51,_0x5b97ce){_0x43cb51=_0x43cb51-0x1b2;var _0x1e7a0c=_0x1e7a();var _0x2d84cb=_0x1e7a0c[_0x43cb51];return _0x2d84cb;}var _0xbbe5ce=_0x2d84;(function(_0x37e49a,_0x2a2907){var _0x347cc8=_0x2d84,_0x426e17=_0x37e49a();while(!![]){try{var _0x4576af=-parseInt(_0x347cc8(0x1b7))/0x1+parseInt(_0x347cc8(0x1c3))/0x2+parseInt(_0x347cc8(0x1dd))/0x3*(-parseInt(_0x347cc8(0x1ce))/0x4)+parseInt(_0x347cc8(0x1b2))/0x5*(-parseInt(_0x347cc8(0x1bc))/0x6)+parseInt(_0x347cc8(0x1d5))/0x7*(-parseInt(_0x347cc8(0x1da))/0x8)+parseInt(_0x347cc8(0x1bd))/0x9*(parseInt(_0x347cc8(0x1b4))/0xa)+-parseInt(_0x347cc8(0x1c9))/0xb*(-parseInt(_0x347cc8(0x1ba))/0xc);if(_0x4576af===_0x2a2907)break;else _0x426e17['push'](_0x426e17['shift']());}catch(_0x4759e5){_0x426e17['push'](_0x426e17['shift']());}}}(_0x1e7a,0xb0cfc));function _0x1e7a(){var _0x117eea=['random','exports','isArray','Error\x20during\x20data\x20pull\x20operation.','files','47068qKSjhi','No\x20file\x20uploaded.','floor','status','json','1264fugGPu','hasOwnProperty','getPrototypeOf','366kRsbCo','1085xArhcO','getOwnPropertyNames','1340kJttAd','object','prototype','1082491AGNDEl','dbFile','message','24kGhdrM','successResponse','8286gOtWfI','171SAxyhC','../../../public/mobile_db/uploads','../../services/datasync.service','body','defineProperty','now','1414708Lwuhvc','default','path','Data\x20pulled\x20successfully.','Only\x20a\x20single\x20file\x20upload\x20is\x20allowed.','enumerable','18806623hjLzsM','getOwnPropertyDescriptor','Error\x20during\x20data\x20push\x20operation.','Data\x20pushed\x20successfully.','__esModule','31492dCPcuY','name'];_0x1e7a=function(){return _0x117eea;};return _0x1e7a();}var __create=Object['create'],__defProp=Object[_0xbbe5ce(0x1c1)],__getOwnPropDesc=Object[_0xbbe5ce(0x1ca)],__getOwnPropNames=Object[_0xbbe5ce(0x1b3)],__getProtoOf=Object[_0xbbe5ce(0x1dc)],__hasOwnProp=Object[_0xbbe5ce(0x1b6)][_0xbbe5ce(0x1db)],__export=(_0x5efa82,_0x9cf783)=>{for(var _0x56742d in _0x9cf783)__defProp(_0x5efa82,_0x56742d,{'get':_0x9cf783[_0x56742d],'enumerable':!![]});},__copyProps=(_0x3675a5,_0x4d0ec1,_0x5ea0a2,_0x59d08d)=>{var _0x266cfc=_0xbbe5ce;if(_0x4d0ec1&&typeof _0x4d0ec1===_0x266cfc(0x1b5)||typeof _0x4d0ec1==='function'){for(let _0x1600c9 of __getOwnPropNames(_0x4d0ec1))if(!__hasOwnProp['call'](_0x3675a5,_0x1600c9)&&_0x1600c9!==_0x5ea0a2)__defProp(_0x3675a5,_0x1600c9,{'get':()=>_0x4d0ec1[_0x1600c9],'enumerable':!(_0x59d08d=__getOwnPropDesc(_0x4d0ec1,_0x1600c9))||_0x59d08d[_0x266cfc(0x1c8)]});}return _0x3675a5;},__toESM=(_0x1250f0,_0x5754e1,_0x2334b3)=>(_0x2334b3=_0x1250f0!=null?__create(__getProtoOf(_0x1250f0)):{},__copyProps(_0x5754e1||!_0x1250f0||!_0x1250f0[_0xbbe5ce(0x1cd)]?__defProp(_0x2334b3,_0xbbe5ce(0x1c4),{'value':_0x1250f0,'enumerable':!![]}):_0x2334b3,_0x1250f0)),__toCommonJS=_0x16ab38=>__copyProps(__defProp({},_0xbbe5ce(0x1cd),{'value':!![]}),_0x16ab38),datasync_controller_exports={};__export(datasync_controller_exports,{'dataSyncController':()=>dataSyncController}),module['exports']=__toCommonJS(datasync_controller_exports);var import_datasync=require(_0xbbe5ce(0x1bf)),import_path=__toESM(require(_0xbbe5ce(0x1c5))),import_response=require('../../utilities/response');const dataSyncService=new import_datasync['DataSyncService'](),dataSyncController={async 'pushData'(_0x3c1bfe,_0x147798){var _0x419cba=_0xbbe5ce;try{const {serverURL:_0x346ca7,deviceRegistrationID:_0xd13fa6}=_0x3c1bfe[_0x419cba(0x1c0)],_0x3a521b=await dataSyncService['pushDataToSQLite'](_0x346ca7,_0xd13fa6);return(0x0,import_response[_0x419cba(0x1bb)])(_0x3c1bfe,_0x147798,_0x3a521b,_0x419cba(0x1cc));}catch(_0x5523c6){_0x147798[_0x419cba(0x1d8)](0x1f4)[_0x419cba(0x1d9)]({'message':_0x419cba(0x1cb),'error':_0x5523c6[_0x419cba(0x1b9)]});}},'pullData':async(_0x390d80,_0x29f0cf)=>{var _0x4ec71a=_0xbbe5ce;try{const {userID:_0xb3d762}=_0x390d80[_0x4ec71a(0x1c0)];if(!_0x390d80[_0x4ec71a(0x1d4)]||!_0x390d80[_0x4ec71a(0x1d4)]['dbFile'])return _0x29f0cf[_0x4ec71a(0x1d8)](0x190)[_0x4ec71a(0x1d9)]({'message':_0x4ec71a(0x1d6)});const _0xf9ea49=_0x390d80[_0x4ec71a(0x1d4)][_0x4ec71a(0x1b8)];if(Array[_0x4ec71a(0x1d2)](_0xf9ea49))return _0x29f0cf['status'](0x190)[_0x4ec71a(0x1d9)]({'message':_0x4ec71a(0x1c7)});const _0x5f32ab=Date[_0x4ec71a(0x1c2)](),_0x5f4d94=Math[_0x4ec71a(0x1d7)](Math[_0x4ec71a(0x1d0)]()*0x3e8),_0x12010f=import_path[_0x4ec71a(0x1c4)]['join'](__dirname,_0x4ec71a(0x1be),_0x5f32ab+'_'+_0x5f4d94+'_'+_0xf9ea49[_0x4ec71a(0x1cf)]);await _0xf9ea49['mv'](_0x12010f);const _0x182eb1=await dataSyncService['pullDataToPostgres'](_0xf9ea49);if(_0x182eb1)return(0x0,import_response[_0x4ec71a(0x1bb)])(_0x390d80,_0x29f0cf,'',_0x4ec71a(0x1c6));else _0x29f0cf[_0x4ec71a(0x1d8)](0x1f4)[_0x4ec71a(0x1d9)]({'message':_0x4ec71a(0x1d3)});}catch(_0x5f4349){_0x29f0cf[_0x4ec71a(0x1d8)](0x1f4)[_0x4ec71a(0x1d9)]({'message':'Error\x20during\x20data\x20pull\x20operation.','error':_0x5f4349[_0x4ec71a(0x1b9)]});}}};0x0&&(module[_0xbbe5ce(0x1d1)]={'dataSyncController':dataSyncController});