@e-techsolutions/e-baas-sdk 1.1.3 → 1.1.5

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/index.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';function _0x1cdf(){const _0x1bb639=['BgvHDMu','CMvJB25Uzwn0','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','z2v0twv0CMLJCW','y2XVC2vK','C2vSzwn0','zgLZy29UBMvJDa','y29UDgvUDfr5Cgu','Dw5KzwzPBMvK','C2v0sxrLBq','y29UDgfPBNm','B3b0Aw9UCW','DxnLCG','z2v0u3rHDgu','z3rL','zMLSDgvYCW','C3rHDhvZ','AgfZq3vZDg9Trgf0ywjHC2u','zgvMyxvSDhm','y2fJAgvdB250CM9S','ntaYodm5mgrYA0ztwa','CMvTB3zLqwXSq2HHBM5LBhm','DxbKyxrLrgf0yq','DgvZDen1C3rVBunVBM5Ly3rPB24','p3vWC2vYDd10CNvL','BwvZC2fNzq','p29WzxjHDgLVBJ11ChnLCNq','yNjVywrJyxn0','zwjHyxmUyxv0Ac5ZzxnZAw9U','zgf0ywjHC2u','y29UBMvJDf9LCNjVCG','y2fWDhvYzvn0ywnRvhjHy2u','y29Kzq','l3n0B3jHz2uVyNvJA2v0CY8','ms4WlJa','CMvTB3zL','CNbJ','Aw50zxjJzxb0B3jZ','mtrTtur2ENu','C2v0u2vZC2LVBKLUDgvYBMfS','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','zw50CNLWB2LUDa','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','lMfZyW','CMfUzg9T','CMvJB25Uzwn0qxr0zw1WDhm','ChjLC2vUy2u6','DxnL','Cg9ZDgDYzxnFy2HHBMDLCW','rMfPBgvKihrVig1VDMuGzMLSzq','BgvHDMLUzW','C2vUza','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbSB2DZ','C3vIC2nYAxb0Aw9UCW','C2nOzw1H','y29UBMvJDa','B3bLCMf0Aw9U','CgfYC2u','CMvWBgfJzq','DxjS','Aw5KzxGUDhm','C2vHCMnO','Cg9ZDgDYzxnty2HLBwe','ChjLC2vUy2u','l2f1DgGVDJeVC2LNBNvW','y2HHBM5LBa','Cg9ZDgDYzxnvC2vYBMfTzq','vw5RBM93BIbLCNjVCG','C2v0qxv0AfrVA2vU','y3jLzgvUDgLHBhm','z2v0qNvJA2v0','lMrLC2m','BwfRzvjLzG','zgf0yq','AgfUzgXLrxjYB3i','AM9PBMvKt25Jzq','yNjVywrJyxn0oG','zw50CMLLCW','l3n0B3jHz2uVyNvJA2v0CW','yxv0Aa','yM9KEq','l2zPBgvZlW','z2v0vxnHz2u','BgLTAxq','C2vZC2LVBG','zxHLy3v0zvf1zxj5','l2zPBgvZl2nVChK','Dw50CMfJAW','BgLZDej1y2TLDhm','D2fYBG','AM9PBG','yNvJA2v0swq','B3bLCMf0B3i','rNvUy3rPB25Zq2XPzw50','DxbSB2fK','DhjHBNnMB3jT','AgfUzgXLqxv0AevYCM9Y','CMvJB25Uzwn0sw50zxj2ywW','Ahr0CenSAwvUDa','C2v0v29YA3nWywnLswq','CMvMCMvZAfnLC3nPB24','mtj0rw5hvMu','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','y3vYCMvUDfnJAgvTyq','D2vIC29JA2v0','y29SDw1U','y29UBMvJDgLUzW','yxbPs2v5','zgvSzxrLt3b0Aw9UCW','mtH6A1fhtK8','C2v0DxbjBNrLCMnLChrVCNm','B2zM','x3jLAM9PBG','zMLSDgvY','C29JA2v0','Aw1WB3j0twfW','C2v0DxbizwfYDgjLyxq','icHtDgf0Dxm6ia','Bwv0Ag9K','qxv0AenSAwvUDa','q0HbtK5ftf9fuLjpuG','BMvX','p29WzxjHDgLVBJ1KzwXLDgu','rgf0ywjHC2vdBgLLBNq','CMvZzxrqyxnZD29Yza','uMvHBhrPBwvdBgLLBNq','z2v0','y2HHBM5LBhm','C2v0','z2v0q2HHBM5LBhm','y2XLyxi','yxbWzw5K','y29UzMLN','mtmWmZm4nLffweHitq','Cgf0y2G','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','rMfPBgvKihrVigDLDcbZDg9YywDLihvZywDL','B3jKzxi','Dg9WAwm','Bwv0ywrHDge','rMfPBgvKihrVigDLDcbMDw5JDgLVBG','l2LUzM8','D29YA3nWywnLswq','z2v0vxnLCG','Cg9ZDgDYzxnFy2HHBMDLCZO','Dgv4Dc9WBgfPBG','y3jLyxrLq2XPzw50','Cg9ZDgDYzxnqB3j0','BgvUz3rO','B2zMC2v0','CMfUz2u','y3jLyxrLu2LNBMvKvxjS','C3nSrw5HyMXLza','ywnJzxnZx3rVA2vU','zxjYB3jLza','zgv0zwn0zwrdB25MAwC','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','ChvIBgLJ','mty5ode2mfPWrKfeBW','y2XLyxjtzxnZAw9U','AxnezwXLDgu','CMvQzwn0','l2rLCgXVEq','zxzLBNq','CMv0DxjUpxjLChjLC2vUDgf0Aw9U','ChvZAa','DMfSDwu','sfruucbYzxf1zxn0igzHAwXLza','y29UBMvJDgvK','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','CMvHBhrPBwu','yxnJzw5KAw5N','rMfPBgvKihrVigXPC3qGzMLSzxm','zMLSzq','zgvSzxrLqNvJA2v0','zw52','yNvJA2v0','DxbKyxrL','uhjLzMvY','rMfPBgvKihrVignVChKGzMLSzq','p29WzxjHDgLVBJ1PBNnLCNq','Cg9ZDgDYzxniB3n0','CMvZCg9UC2u','C3rHDgu','x3rYAwDNzxi','l2zPBgvZ','DxbZzxj0','Bw92zq','y3vYCMvUDfnLC3nPB24','rMfPBgvKihrVigrLBgv0zsbMDw5JDgLVBG','AM9PBMvK','Cgf0Aa','AM9PBMLUzW','l3nKAY92ms8','DgLTzw91Da','CgvYAw9K','zM9YrwfJAa','l3jWyY8','uMvXDwvZDcbMywLSzwq','l2z1BMn0Aw9UCY92ms8','CMvTB3zLq3vZDg9Trgf0ywjHC2u','AgvHCNrIzwf0sw50zxj2ywW','Dg9tDhjPBMC','C3rHDhvZvgv4Da','y29UBMvJDgLVBLn0yxrL','z2v0tg9NCW','zgLZy29UBMvJDgvK','zgvSzxrL','zxHLy3v0zq','Dg9vChbLCKnHC2u','BgLRzq','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','DgfIBgu','Chv0','DhjHy2S','B25qCMvZzw5Jzq','l2f1DgGVDJeVDxnLCG','BxvSDgLWyxj0l2zVCM0Tzgf0yq','DgvZDenVBM5Ly3rPB24','Aw5PDgLHBgL6zq','mZi2mJmWwxrdvgXK','Cg9ZDa','BMfTzq','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','ChjLzMvY','C29JA2v0lMLVlwnSAwvUDa','uxvLCNLcDwLSzgvY','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbTzxrYAwnZ','AxndB25Uzwn0zwq','ndK2ntyXtNHcq3jP','x3nLDfn0yxrL','DMvYAwz5','C29YDej5','CxvLCNK','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','rujHyvnfCNjVCG','yMfZzvvsta','zgvWBg95','AxnvC2LUz0n1C3rVBurHDgfIyxnL','y3jLyxrLqNvJA2v0','Bg9N','rMfPBgvKihrVigDLDcbIDwnRzxq','mtm5nZaXuKTlC0rQ','BgLZDa','C3rYAw5NAwz5','zxjYB3i','DMvYC2LVBG','zxzLBNrLBwL0DgvYmW','x2PVAw4','DxbKyxrLt3b0Aw9UCW','AgvHzgvYCW','AgfZ','y2XPzw50','Ec10B3rHBc1JB3vUDa','nJCXmdeWs0HODKrv','zgv0zwn0q3vZDg9Trgf0ywjHC2u','qxv0AgvUDgLJyxrPB24GzMfPBgvK','C2LNBK91Da','Ag9ZDa','Bgv2zwW','Dw5ZDwjZy3jPyMu','zNjVBq','y29TBw9U','qMvHCMvYia','rujHyvndBgLLBNq','zw1PDa','l2f1DgGVDJeVCMvZzxqTCgfZC3DVCMq'];_0x1cdf=function(){return _0x1bb639;};return _0x1cdf();}(function(stringArrayFunction,comparisonValue){const stringArray=stringArrayFunction();function _0x4f66ae(_0x256fd2,_0x48318e){return _0x1e74(_0x256fd2- -0x26a,_0x48318e);}while(!![]){try{const _0x13d1e8=-parseInt(_0x4f66ae(-0x56,-0x3a))/0x1+-parseInt(_0x4f66ae(-0x5f,-0x41))/0x2+-parseInt(_0x4f66ae(-0x49,0x7))/0x3*(-parseInt(_0x4f66ae(0x36,0xaf))/0x4)+parseInt(_0x4f66ae(-0x1c,-0x11))/0x5+parseInt(_0x4f66ae(0x56,-0x1f))/0x6*(parseInt(_0x4f66ae(-0xa,-0x1d))/0x7)+-parseInt(_0x4f66ae(0x70,0x63))/0x8+parseInt(_0x4f66ae(0x3e,0x74))/0x9*(-parseInt(_0x4f66ae(-0x3d,-0x9a))/0xa);if(_0x13d1e8===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x9266a2){stringArray['push'](stringArray['shift']());}}}(_0x1cdf,0x8c0fd));var axios=require('axios'),socket_ioClient=require(_0x380dd0(-0xae,-0x8d)),EventEmitter=require(_0x380dd0(-0x98,-0x92));class EBaaSError extends Error{constructor(_0x2654f9,status=0x0,_0x50eccd){super(_0x2654f9),this[_0x118d84(0x324,0x318)]='EBaaSError',this['status']=status;function _0x118d84(_0x4a8c72,_0x4ca605){return _0x1e74(_0x4ca605-0x10b,_0x4a8c72);}this['details']=_0x50eccd,Error[_0x118d84(0x393,0x364)]&&Error['captureStackTrace'](this,EBaaSError);}['toJSON'](){function _0x1dfb17(_0x32cc28,_0x4775a2){return _0x1e74(_0x4775a2- -0x1c5,_0x32cc28);}return{'name':this['name'],'message':this[_0x1dfb17(0xb0,0x8e)],'status':this['status'],'details':this['details'],'stack':this['stack']};}[_0x380dd0(-0xc5,-0xf1)](){function _0x48c619(_0x38e0cd,_0x37b0e1){return _0x1e74(_0x38e0cd-0x268,_0x37b0e1);}return this[_0x48c619(0x475,0x4c0)]+':\x20'+this['message']+_0x48c619(0x518,0x4bb)+this[_0x48c619(0x4b2,0x4a3)]+')';}}class HttpClient{constructor(config){this[_0x39fb10(0x418,0x3e5)]=config[_0x39fb10(0x473,0x494)],this[_0x39fb10(0x4a3,0x4a8)]=config['apiKey'];function _0x39fb10(_0x216756,_0x25afa8){return _0x1e74(_0x216756-0x1fd,_0x25afa8);}this[_0x39fb10(0x428,0x3e9)]=axios['create']({'baseURL':this['baseURL'],'timeout':config[_0x39fb10(0x3ee,0x3b8)]||0x2710,'headers':{'Content-Type':'application/json','apikey':this[_0x39fb10(0x4a3,0x43e)],...config[_0x39fb10(0x426,0x405)]}}),this[_0x39fb10(0x4a6,0x461)]();}[_0x380dd0(-0x15,0x69)](){this['client']['interceptors']['request'][_0x98f2bb(0x568,0x5ee)](config=>{return config;},_0x4b2024=>{function _0x5f0ba0(_0x2c32ec,_0x482e81){return _0x1e74(_0x2c32ec- -0x10a,_0x482e81);}return Promise['reject'](new EBaaSError(_0x5f0ba0(0xeb,0x155),0x0,_0x4b2024));});function _0x98f2bb(_0x3ee6d5,_0x26fed2){return _0x1e74(_0x3ee6d5-0x2ff,_0x26fed2);}this[_0x98f2bb(0x52a,0x4d7)][_0x98f2bb(0x55e,0x577)][_0x98f2bb(0x4e4,0x515)]['use'](response=>{return response;},_0x11a356=>{const status=_0x11a356[_0x4c438a(0x327,0x39b)]?.['status']||0x0;function _0x4c438a(_0x1a1cc8,_0x2c169b){return _0x1e74(_0x1a1cc8-0x142,_0x2c169b);}const _0xca3659=_0x11a356[_0x4c438a(0x327,0x38b)]?.['data']?.['message']||_0x11a356[_0x4c438a(0x395,0x3b8)]||_0x4c438a(0x3c0,0x3a8),_0x1fa99a=_0x11a356['response']?.['data']||_0x11a356;return Promise[_0x4c438a(0x41f,0x3a4)](new EBaaSError(_0xca3659,status,_0x1fa99a));});}async['get'](_0xc51147,config){function _0x5e07fa(_0x569e32,_0x3fa582){return _0x1e74(_0x3fa582-0x3e5,_0x569e32);}try{const response=await this[_0x5e07fa(0x681,0x610)][_0x5e07fa(0x6c5,0x69e)](_0xc51147,config);return{'data':response[_0x5e07fa(0x667,0x669)],'status':response[_0x5e07fa(0x61e,0x62f)],'statusText':response[_0x5e07fa(0x605,0x5df)],'headers':response['headers']};}catch(_0x401c05){throw this[_0x5e07fa(0x656,0x66a)](_0x401c05);}}async[_0x380dd0(-0xb2,-0x2d)](_0x97c3ba,data,config){function _0x30b989(_0x33e5cf,_0x45a35e){return _0x1e74(_0x45a35e-0x8f,_0x33e5cf);}try{const response=await this[_0x30b989(0x2db,0x2ba)]['post'](_0x97c3ba,data,config);return{'data':response[_0x30b989(0x32a,0x313)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x470896){throw this['handleError'](_0x470896);}}async['put'](_0x4ea524,data,config){function _0x37c625(_0x359196,_0x2bd2e3){return _0x1e74(_0x359196- -0x6f,_0x2bd2e3);}try{const response=await this[_0x37c625(0x1bc,0x1d7)]['put'](_0x4ea524,data,config);return{'data':response['data'],'status':response[_0x37c625(0x1db,0x172)],'statusText':response['statusText'],'headers':response[_0x37c625(0x1ba,0x180)]};}catch(_0x5b07c0){throw this['handleError'](_0x5b07c0);}}async['patch'](_0x420656,data,config){function _0x43c2cd(_0x31396a,_0x5afc88){return _0x1e74(_0x31396a-0x379,_0x5afc88);}try{const response=await this[_0x43c2cd(0x5a4,0x58f)]['patch'](_0x420656,data,config);return{'data':response['data'],'status':response[_0x43c2cd(0x5c3,0x552)],'statusText':response[_0x43c2cd(0x573,0x510)],'headers':response[_0x43c2cd(0x5a2,0x56b)]};}catch(_0x328d8e){throw this['handleError'](_0x328d8e);}}async[_0x380dd0(-0xc0,-0x147)](_0x5babd8,config){function _0x3bf06c(_0x1738c2,_0x3c741a){return _0x1e74(_0x1738c2-0x2e7,_0x3c741a);}try{const response=await this[_0x3bf06c(0x512,0x57f)]['delete'](_0x5babd8,config);return{'data':response['data'],'status':response[_0x3bf06c(0x531,0x589)],'statusText':response['statusText'],'headers':response[_0x3bf06c(0x510,0x549)]};}catch(_0x4de257){throw this['handleError'](_0x4de257);}}[_0x380dd0(-0x3f,0x38)](_0x2a17b4){function _0x133313(_0x3d92ca,_0x4262d8){return _0x1e74(_0x4262d8- -0x127,_0x3d92ca);}this['client'][_0x133313(0xc8,0x125)]['headers']['common']['Authorization']='Bearer\x20'+_0x2a17b4;}['removeAuthToken'](){function _0x55bdb8(_0xb7a370,_0xc92f29){return _0x1e74(_0xb7a370-0x233,_0xc92f29);}delete this['client'][_0x55bdb8(0x47f,0x451)]['headers'][_0x55bdb8(0x468,0x48d)]['Authorization'],this[_0x55bdb8(0x45e,0x481)][_0x55bdb8(0x47f,0x452)][_0x55bdb8(0x45c,0x462)]['common']['Authorization']=_0x55bdb8(0x469,0x458)+this[_0x55bdb8(0x4d9,0x515)];}['handleError'](_0x38f411){if(_0x38f411 instanceof EBaaSError)return _0x38f411;function _0x5e34e0(_0x7a1b29,_0xc014cb){return _0x1e74(_0x7a1b29- -0x345,_0xc014cb);}return new EBaaSError(_0x38f411['message']||_0x5e34e0(-0x62,-0x18),_0x38f411['status']||0x0,_0x38f411);}}class AuthClient{constructor(_0x2f1247,_0x1edd15){function _0x2ed0f0(_0x1b3aba,_0xb2513a){return _0x1e74(_0x1b3aba-0xdf,_0xb2513a);}this['currentSession']=null,this['httpClient']=_0x2f1247,this[_0x2ed0f0(0x3a9,0x37a)]=_0x1edd15,this['loadSession']();}async['signUp'](data){function _0x408713(_0x1ad798,_0x108ba1){return _0x1e74(_0x1ad798-0x1ef,_0x108ba1);}try{const response=await this[_0x408713(0x48c,0x40b)]['post'](_0x408713(0x46a,0x430),data);return response['data'][_0x408713(0x47e,0x46c)]&&this['setSessionInternal'](response[_0x408713(0x473,0x4e9)]['session']),response['data'];}catch(_0xc93c76){throw this['handleAuthError'](_0xc93c76);}}async['signIn'](data){function _0x5c9c62(_0x30297a,_0x15318){return _0x1e74(_0x15318-0x20b,_0x30297a);}try{const headers={};this['workspaceId']&&(headers['X-Workspace-ID']=this[_0x5c9c62(0x4c7,0x4d5)]);const response=await this[_0x5c9c62(0x516,0x4a8)][_0x5c9c62(0x400,0x417)]('/auth/v1/sdk/signin',data,{'headers':headers});return response[_0x5c9c62(0x4fd,0x48f)][_0x5c9c62(0x4f4,0x49a)]&&this['setSessionInternal'](response[_0x5c9c62(0x4cb,0x48f)][_0x5c9c62(0x508,0x49a)]),response['data'];}catch(_0x276771){throw this[_0x5c9c62(0x442,0x4a6)](_0x276771);}}async[_0x380dd0(-0x8e,-0x102)](){function _0x203d38(_0x47cef5,_0x4df059){return _0x1e74(_0x47cef5-0x2ba,_0x4df059);}try{await this['httpClient']['post']('/auth/v1/signout'),this[_0x203d38(0x595,0x55d)]();}catch(_0x199ca4){this[_0x203d38(0x595,0x5c3)]();throw this['handleAuthError'](_0x199ca4);}}async[_0x380dd0(0xd,-0x4f)](){function _0x563615(_0x47c697,_0x450224){return _0x1e74(_0x450224-0x121,_0x47c697);}if(!this['currentSession']?.['access_token'])return null;try{const response=await this['httpClient']['get'](_0x563615(0x335,0x328));return response['data'][_0x563615(0x2ff,0x367)];}catch(_0x3b8950){if(_0x3b8950 instanceof EBaaSError&&_0x3b8950['status']===0x191)return this['clearSession'](),null;throw this['handleAuthError'](_0x3b8950);}}async[_0x380dd0(-0x1f,-0x70)](){if(!this['currentSession']?.['refresh_token'])return null;function _0x2f4c4a(_0x28fbc9,_0x3e680a){return _0x1e74(_0x3e680a- -0x12b,_0x28fbc9);}try{const response=await this['httpClient']['post']('/auth/v1/refresh',{'refresh_token':this['currentSession']['refresh_token']});if(response[_0x2f4c4a(0x169,0x159)][_0x2f4c4a(0x161,0x164)])return this['setSession'](response[_0x2f4c4a(0x124,0x159)]['session']),response['data']['session'];return null;}catch(_0x128b30){this[_0x2f4c4a(0x1cf,0x1b0)]();throw this[_0x2f4c4a(0x192,0x170)](_0x128b30);}}async[_0x380dd0(-0x7,0x5)](_0x3967c2){function _0x4fffc0(_0x4ffdf9,_0xa51097){return _0x1e74(_0xa51097- -0x249,_0x4ffdf9);}try{await this[_0x4fffc0(0x9e,0x54)][_0x4fffc0(-0x4,-0x3d)](_0x4fffc0(0x25,-0x10),{'email':_0x3967c2});}catch(_0x4e67b7){throw this[_0x4fffc0(0xb0,0x52)](_0x4e67b7);}}async['updateUser'](data){function _0x4cbdd2(_0x2ed304,_0x243248){return _0x1e74(_0x2ed304-0x1fa,_0x243248);}try{const response=await this['httpClient'][_0x4cbdd2(0x3fe,0x468)]('/auth/v1/user',data);return response['data'][_0x4cbdd2(0x440,0x454)];}catch(_0x349ac9){throw this['handleAuthError'](_0x349ac9);}}['getSession'](){function _0x57573d(_0x57ed9d,_0x3be994){return _0x1e74(_0x57ed9d- -0xa1,_0x3be994);}return this[_0x57573d(0x14a,0x1c0)];}['setSession'](_0x4691ed){this['currentSession']=_0x4691ed,this['httpClient']['setAuthToken'](_0x4691ed[_0x4f703b(0x595,0x546)]);function _0x4f703b(_0x18a235,_0xc0f8ca){return _0x1e74(_0xc0f8ca-0x271,_0x18a235);}typeof localStorage!=='undefined'&&localStorage[_0x4f703b(0x485,0x4b4)](_0x4f703b(0x476,0x4c7),JSON[_0x4f703b(0x50c,0x494)](_0x4691ed));}['onAuthStateChange'](_0x171069){return()=>{};}['setWorkspaceId'](_0x30a24a){this['workspaceId']=_0x30a24a;}[_0x380dd0(-0x5d,-0xd4)](_0x599414){this[_0xeb45f5(0x357,0x2df)]=_0x599414,this[_0xeb45f5(0x409,0x465)]['setAuthToken'](_0x599414[_0xeb45f5(0x441,0x4ba)]);function _0xeb45f5(_0x3b973b,_0x45445b){return _0x1e74(_0x3b973b-0x16c,_0x45445b);}typeof localStorage!=='undefined'&&localStorage['setItem']('ebaas.auth.session',JSON[_0xeb45f5(0x38f,0x3cd)](_0x599414));}['clearSession'](){this['currentSession']=null;function _0x528c0e(_0x5c3082,_0x1be6ba){return _0x1e74(_0x1be6ba- -0x17,_0x5c3082);}this[_0x528c0e(0x21e,0x286)]['removeAuthToken'](),typeof localStorage!==_0x528c0e(0x211,0x22b)&&localStorage['removeItem'](_0x528c0e(0x25c,0x23f));}['loadSession'](){function _0x3854e0(_0x1d5c22,_0x1e6770){return _0x1e74(_0x1d5c22- -0x2ef,_0x1e6770);}if(typeof localStorage!==_0x3854e0(-0xad,-0xf0)){const _0x997318=localStorage['getItem'](_0x3854e0(-0x99,-0xd7));if(_0x997318)try{const _0x46bc4b=JSON['parse'](_0x997318);this['setSessionInternal'](_0x46bc4b);}catch(_0x4d73be){this[_0x3854e0(-0x14,-0x3e)]();}}}['handleAuthError'](_0xce5895){function _0x57e02e(_0x29058b,_0x1e0eae){return _0x1e74(_0x29058b- -0x249,_0x1e0eae);}if(_0xce5895 instanceof EBaaSError)return _0xce5895;return new EBaaSError(_0xce5895[_0x57e02e(0xa,0x4f)]||_0x57e02e(-0x1a,0x31),_0xce5895['status']||0x0,_0xce5895);}}class QueryBuilder{constructor(_0x379803,_0x3794dc,_0x5412a9,_0x2e4023){this[_0x20fbfb(0x3e0,0x411)]=_0x379803,this['table']=_0x3794dc,this['schema']=_0x5412a9;function _0x20fbfb(_0x178790,_0x5478b2){return _0x1e74(_0x178790-0x143,_0x5478b2);}this[_0x20fbfb(0x40d,0x3fd)]=_0x2e4023,this['query']={'filters':[]};}[_0x380dd0(-0x7f,-0x19)](_0x5f09e6='*',_0x144ea2){this[_0x255bd1(0xe3,0x5c)]['select']=_0x5f09e6;function _0x255bd1(_0x5c6675,_0x330d7c){return _0x1e74(_0x5c6675- -0x135,_0x330d7c);}return this;}['insert'](data,_0x46baa2){function _0x4cecd7(_0x46699e,_0x4c717b){return _0x1e74(_0x46699e- -0x12d,_0x4c717b);}return this[_0x4cecd7(0x163,0x1e5)]('POST',_0x4cecd7(0xc3,0x138)+this['table']+_0x4cecd7(0xb6,0x70),{'data':data,'options':_0x46baa2});}[_0x380dd0(-0xde,-0x6f)](data,_0x1cd1d1){this['query']['updateData']=data,this[_0x2c3245(0x3a2,0x363)][_0x2c3245(0x3c2,0x373)]=_0x1cd1d1;function _0x2c3245(_0x5b40d3,_0x8fa0ec){return _0x1e74(_0x8fa0ec-0x14b,_0x5b40d3);}return this;}[_0x380dd0(-0xd5,-0x80)](data,_0x98894b){function _0x21cf30(_0x483b93,_0x1cf16e){return _0x1e74(_0x1cf16e-0xf,_0x483b93);}return this[_0x21cf30(0x30d,0x29f)]('POST','/sdk/v1/'+this[_0x21cf30(0x23f,0x212)]+_0x21cf30(0x25e,0x263),{'data':data,'options':{..._0x98894b,'upsert':!![]}});}[_0x380dd0(-0xc0,-0x98)](_0x35ddef){this[_0x2cc66d(-0x57,-0x99)][_0x2cc66d(0x38,0x69)]=_0x35ddef,this['query'][_0x2cc66d(0x6d,0xde)]=!![];function _0x2cc66d(_0x102d23,_0x5969fb){return _0x1e74(_0x102d23- -0x26f,_0x5969fb);}return this;}['eq'](_0x3a1fce,_0x9295a7){function _0x32b9be(_0x3b5f53,_0x55d887){return _0x1e74(_0x3b5f53- -0xa2,_0x55d887);}return this['query'][_0x32b9be(0x1a7,0x1fc)]['push']({'column':_0x3a1fce,'operator':'eq','value':_0x9295a7}),this;}[_0x380dd0(-0xa,-0x69)](_0x4b0c3a,_0x4caf6c){function _0x3c6738(_0x43a98e,_0xd6ebaf){return _0x1e74(_0x43a98e- -0x367,_0xd6ebaf);}return this['query'][_0x3c6738(-0x11e,-0x136)][_0x3c6738(-0x86,-0x51)]({'column':_0x4b0c3a,'operator':_0x3c6738(-0xb3,-0x66),'value':_0x4caf6c}),this;}['gt'](_0x3b6af3,_0xf26bf8){this[_0x402258(0x3a1,0x421)]['filters']['push']({'column':_0x3b6af3,'operator':'gt','value':_0xf26bf8});function _0x402258(_0x472f90,_0x445069){return _0x1e74(_0x472f90-0x189,_0x445069);}return this;}['gte'](_0x3f2026,_0x4a5d2e){function _0x3e9d60(_0x354a67,_0x369593){return _0x1e74(_0x369593-0x2fe,_0x354a67);}return this[_0x3e9d60(0x4cc,0x516)]['filters'][_0x3e9d60(0x58e,0x5df)]({'column':_0x3f2026,'operator':_0x3e9d60(0x4c9,0x546),'value':_0x4a5d2e}),this;}['lt'](_0x5187f4,_0x2ee65e){function _0x350826(_0x1474ad,_0x24c87d){return _0x1e74(_0x1474ad-0x66,_0x24c87d);}return this[_0x350826(0x27e,0x227)][_0x350826(0x2af,0x247)][_0x350826(0x347,0x3b2)]({'column':_0x5187f4,'operator':'lt','value':_0x2ee65e}),this;}['lte'](_0x509314,_0x499ec6){function _0x5b1ca5(_0xb4cbce,_0x28fd07){return _0x1e74(_0xb4cbce- -0x49,_0x28fd07);}return this[_0x5b1ca5(0x1cf,0x1b5)]['filters'][_0x5b1ca5(0x298,0x24d)]({'column':_0x509314,'operator':'lte','value':_0x499ec6}),this;}[_0x380dd0(-0xbd,-0x13c)](_0x3f3baa,_0x32a124){return this['query']['filters']['push']({'column':_0x3f3baa,'operator':'like','value':_0x32a124}),this;}['ilike'](_0x2dc59d,_0x4d2aea){return this['query']['filters']['push']({'column':_0x2dc59d,'operator':'ilike','value':_0x4d2aea}),this;}['is'](_0x44c1a7,_0x543f62){function _0x3a8875(_0x6ea6a2,_0x189d07){return _0x1e74(_0x189d07-0x18a,_0x6ea6a2);}return this['query'][_0x3a8875(0x44f,0x3d3)][_0x3a8875(0x476,0x46b)]({'column':_0x44c1a7,'operator':'is','value':_0x543f62}),this;}['in'](_0x1d5c8a,_0x5b769f){function _0xfb10b4(_0x4ccb7f,_0xcd3d99){return _0x1e74(_0x4ccb7f-0x346,_0xcd3d99);}return this[_0xfb10b4(0x55e,0x511)]['filters']['push']({'column':_0x1d5c8a,'operator':'in','value':_0x5b769f}),this;}[_0x380dd0(-0x7a,-0x6a)](_0x1cdefe,_0x1e7c84){return this['query']['filters']['push']({'column':_0x1cdefe,'operator':'contains','value':_0x1e7c84}),this;}['match'](_0x24b0fc){return Object['entries'](_0x24b0fc)['forEach'](([_0x5e168e,_0x522e19])=>{this['eq'](_0x5e168e,_0x522e19);}),this;}[_0x380dd0(0x7,-0x4e)](_0x15d554,_0x319dad){!this['query']['order']&&(this['query'][_0xd7fbfa(0x2f1,0x326)]=[]);this['query']['order'][_0xd7fbfa(0x30d,0x303)]({'column':_0x15d554,'ascending':_0x319dad?.[_0xd7fbfa(0x206,0x184)]!==![]});function _0xd7fbfa(_0x3939ef,_0x1b004d){return _0x1e74(_0x3939ef-0x2c,_0x1b004d);}return this;}['limit'](count){function _0x33fba7(_0x383625,_0x3fe7fe){return _0x1e74(_0x383625-0x4e,_0x3fe7fe);}return this[_0x33fba7(0x266,0x20c)]['limit']=count,this;}[_0x380dd0(0x14,0x6d)](from,_0x259932){function _0x159327(_0x1ae9b9,_0x28f6fa){return _0x1e74(_0x1ae9b9-0x34c,_0x28f6fa);}return this['query'][_0x159327(0x61e,0x5b6)]={'from':from,'to':_0x259932},this;}async['execute'](){function _0x19b917(_0x497354,_0x46e759){return _0x1e74(_0x497354- -0x1be,_0x46e759);}if(this['query'][_0x19b917(0x92,0xe)])return this['executeQuery']('PATCH',_0x19b917(0x32,0xd)+this['table'],{'data':this['query'][_0x19b917(0x92,0x38)],'options':this[_0x19b917(0x5a,0x13)]['updateOptions'],'filters':this['query']['filters']});else return this[_0x19b917(0x5a,-0x26)]['isDelete']?this['executeQuery']('DELETE','/sdk/v1/'+this['table']+_0x19b917(0xf7,0x15d),{'options':this['query'][_0x19b917(0xe9,0xb4)],'filters':this[_0x19b917(0x5a,-0x22)][_0x19b917(0x8b,0x101)]}):this[_0x19b917(0xd2,0xbf)]('GET',_0x19b917(0x32,0x35)+this[_0x19b917(0x45,0xcb)]+'?operation=select',{'select':this['query']['select'],'filters':this[_0x19b917(0x5a,-0x17)]['filters'],'order':this[_0x19b917(0x5a,0x1d)][_0x19b917(0x107,0x11e)],'limit':this[_0x19b917(0x5a,0x69)]['limit'],'range':this['query'][_0x19b917(0x114,0x12b)]});}async['single'](){this['limit'](0x1);const result=await this[_0x2cfc93(0x2a6,0x26e)]();function _0x2cfc93(_0x55912a,_0xbb020d){return _0x1e74(_0x55912a-0xa7,_0xbb020d);}return{'data':result[_0x2cfc93(0x32b,0x39b)]?.[0x0]||null,'error':result[_0x2cfc93(0x2cb,0x32e)]};}async[_0x380dd0(-0x2e,-0x8b)](_0x374792,_0x2f3e6a,_0x26ad04){function _0x4d8075(_0x5f4661,_0x1086ad){return _0x1e74(_0x5f4661-0x353,_0x1086ad);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this['workspaceId']);if(_0x374792==='GET'){const _0x9dfa56=_0x2f3e6a['split']('?'),_0x649cc9=_0x9dfa56[0x0],existingParams=new URLSearchParams(_0x9dfa56[0x1]||'');if(_0x26ad04['select'])existingParams['append']('select',_0x26ad04[_0x4d8075(0x592,0x53e)]);_0x26ad04['filters']?.[_0x4d8075(0x623,0x64c)]&&_0x26ad04['filters'][_0x4d8075(0x546,0x524)](filter=>{function _0x1a4b62(_0xdf0a21,_0x7d8e35){return _0x1e74(_0x7d8e35- -0x9f,_0xdf0a21);}existingParams[_0x1a4b62(0x25d,0x21f)](filter['column'],filter[_0x1a4b62(0x1ba,0x1f8)]+'.'+filter[_0x1a4b62(0x242,0x243)]);});if(_0x26ad04['order']?.[_0x4d8075(0x623,0x660)]){const orderStr=_0x26ad04['order']['map'](_0x4b6ea1=>''+_0x4b6ea1['column']+(_0x4b6ea1['ascending']?_0x4d8075(0x5b8,0x571):_0x4d8075(0x5d5,0x5e2)))[_0x4d8075(0x5e8,0x5a1)](',');existingParams['append']('order',orderStr);}if(_0x26ad04['limit'])existingParams[_0x4d8075(0x611,0x5d4)](_0x4d8075(0x5e1,0x58d),_0x26ad04['limit'][_0x4d8075(0x54c,0x58a)]());_0x26ad04['range']&&(existingParams['append']('offset',_0x26ad04['range']['from'][_0x4d8075(0x54c,0x5a9)]()),existingParams[_0x4d8075(0x611,0x651)]('limit',(_0x26ad04['range']['to']-_0x26ad04['range'][_0x4d8075(0x587,0x560)]+0x1)[_0x4d8075(0x54c,0x54a)]())),response=await this['httpClient'][_0x4d8075(0x60c,0x672)](_0x649cc9+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x374792==='DELETE'){const _0x14a26a=_0x2f3e6a['split']('?'),_0x515a6d=_0x14a26a[0x0],existingParams=new URLSearchParams(_0x14a26a[0x1]||'');!existingParams['has']('operation')&&existingParams['append'](_0x4d8075(0x5c6,0x5f2),'delete');_0x26ad04[_0x4d8075(0x59c,0x60b)]?.['length']&&_0x26ad04['filters']['forEach'](filter=>{function _0xfbc09e(_0x360554,_0x483d58){return _0x1e74(_0x360554- -0xdb,_0x483d58);}existingParams[_0xfbc09e(0x1e3,0x259)](filter[_0xfbc09e(0x1c9,0x1ad)],filter['operator']+'.'+filter['value']);});const deleteUrl=_0x515a6d+'?'+existingParams[_0x4d8075(0x54c,0x55b)]();console[_0x4d8075(0x572,0x58b)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console[_0x4d8075(0x572,0x5d0)]('\uD83D\uDD27 DELETE headers:',headers),console[_0x4d8075(0x572,0x51e)]('\uD83D\uDD27 DELETE filtros originais:',_0x26ad04['filters']),response=await this[_0x4d8075(0x5f0,0x63f)][_0x4d8075(0x551,0x539)](deleteUrl,{'headers':headers});}else{if(_0x374792==='PATCH'){const _0x3b03d8=_0x2f3e6a['split']('?'),_0x5bf148=_0x3b03d8[0x0],existingParams=new URLSearchParams(_0x3b03d8[0x1]||'');!existingParams['has']('operation')&&existingParams[_0x4d8075(0x611,0x5a9)](_0x4d8075(0x5c6,0x5fc),'update');_0x26ad04[_0x4d8075(0x59c,0x58e)]?.[_0x4d8075(0x623,0x5bd)]&&_0x26ad04[_0x4d8075(0x59c,0x56e)][_0x4d8075(0x546,0x575)](filter=>{function _0x4f5c13(_0x2b0505,_0x1fc4c0){return _0x1e74(_0x2b0505- -0x103,_0x1fc4c0);}existingParams['append'](filter[_0x4f5c13(0x1a1,0x160)],filter['operator']+'.'+filter[_0x4f5c13(0x1df,0x1cd)]);});_0x26ad04[_0x4d8075(0x598,0x520)]?.['prefer']&&(headers['Prefer']=_0x26ad04[_0x4d8075(0x598,0x547)][_0x4d8075(0x562,0x552)]);const updateUrl=_0x5bf148+'?'+existingParams[_0x4d8075(0x54c,0x504)]();response=await this[_0x4d8075(0x5f0,0x5e5)][_0x4d8075(0x614,0x620)](updateUrl,_0x26ad04['data'],{'headers':headers});}else{let _0x5c4569=_0x26ad04['data'];!headers[_0x4d8075(0x534,0x51d)]&&(headers['Prefer']=_0x4d8075(0x633,0x676)),_0x26ad04[_0x4d8075(0x598,0x5a2)]?.[_0x4d8075(0x53c,0x5ae)]&&(headers[_0x4d8075(0x534,0x559)]=_0x4d8075(0x52b,0x4b6)),_0x26ad04['dataArray']&&(_0x5c4569=_0x26ad04['dataArray']),response=await this['httpClient'][_0x4d8075(0x55f,0x4dc)](_0x2f3e6a,_0x5c4569,{'headers':headers});}}}return{'data':response[_0x4d8075(0x5d7,0x61c)],'error':null,'count':response['headers']?.['x-total-count']?parseInt(response['headers'][_0x4d8075(0x57f,0x53a)]):undefined};}catch(_0x1e79d9){return{'data':null,'error':_0x1e79d9 instanceof EBaaSError?_0x1e79d9:new EBaaSError(_0x1e79d9 instanceof Error?_0x1e79d9[_0x4d8075(0x5a6,0x555)]:'Database\x20operation\x20failed',0x0,_0x1e79d9)};}}}class CustomDatabaseManager{constructor(_0x193e0b,_0x536553){function _0x35d0d6(_0x4cdff7,_0x491863){return _0x1e74(_0x4cdff7-0x383,_0x491863);}this[_0x35d0d6(0x620,0x64e)]=_0x193e0b,this['workspaceId']=_0x536553;}async['detectCustomDatabase'](){function _0x32d35d(_0x5796aa,_0x1eb300){return _0x1e74(_0x5796aa-0x14b,_0x1eb300);}if(!this['workspaceId'])return{'hasCustomDatabase':![]};try{const response=await this[_0x32d35d(0x3e8,0x3fe)][_0x32d35d(0x404,0x484)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response[_0x32d35d(0x395,0x3ba)]===0xc8&&response[_0x32d35d(0x3cf,0x3fe)]?.['config']){const config=response['data']['config'],_0x24a0e4={'host':config[_0x32d35d(0x32f,0x2e3)],'port':config[_0x32d35d(0x41a,0x422)],'database':config['postgresDatabase'],'username':config[_0x32d35d(0x3c8,0x3ff)],'password':'','schema':config[_0x32d35d(0x3c4,0x377)],'sslEnabled':config['sslEnabled']};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x24a0e4},this[_0x32d35d(0x422,0x3e5)];}}catch(_0x4996c9){if(_0x4996c9?.[_0x32d35d(0x395,0x406)]===0x194)return this[_0x32d35d(0x422,0x44e)]={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x4996c9);}return this[_0x32d35d(0x422,0x3ec)]={'hasCustomDatabase':![]},this[_0x32d35d(0x422,0x3f1)];}async['testConnection'](_0x2673cc){function _0x34b87b(_0x4f63cc,_0x4051c6){return _0x1e74(_0x4051c6-0x1ac,_0x4f63cc);}try{const response=await this['httpClient']['post']('/admin/v1/workspace/custom-database/test-connection',_0x2673cc,{'headers':this[_0x34b87b(0x476,0x476)]?{'X-Workspace-ID':this['workspaceId']}:{}});return response[_0x34b87b(0x487,0x430)];}catch(_0x2c1089){return{'success':![],'message':_0x2c1089?.[_0x34b87b(0x380,0x3ff)]||_0x34b87b(0x455,0x41a)};}}async[_0x380dd0(-0x5c,-0xaa)](_0x1264b4){if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');const response=await this['httpClient']['post']('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x1264b4},{'headers':{'X-Workspace-ID':this['workspaceId']}});function _0x3d9da6(_0x2e4431,_0x1aae6c){return _0x1e74(_0x2e4431-0x40,_0x1aae6c);}const config=response[_0x3d9da6(0x2c4,0x32e)][_0x3d9da6(0x2ff,0x2cd)];return this[_0x3d9da6(0x317,0x31a)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x1264b4},config;}async[_0x380dd0(-0xc7,-0xbc)](){function _0x27466e(_0x41b51d,_0x259212){return _0x1e74(_0x259212- -0x331,_0x41b51d);}if(!this['workspaceId'])throw new Error('Workspace ID is required to remove custom database');await this['httpClient']['delete']('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this['workspaceId']}}),this[_0x27466e(0x1e,-0x5a)]={'hasCustomDatabase':![]};}['getDetectedConfig'](){return this['detectedConfig'];}['hasCustomDatabase'](){function _0x25434e(_0xef13a3,_0x494c33){return _0x1e74(_0xef13a3- -0x39e,_0x494c33);}return this[_0x25434e(-0xc7,-0xfd)]?.['hasCustomDatabase']??![];}['getCustomCredentials'](){function _0x48f45b(_0x2ff8c3,_0x813406){return _0x1e74(_0x2ff8c3-0x4f,_0x813406);}return this['detectedConfig']?.[_0x48f45b(0x2cf,0x314)];}['setWorkspaceId'](_0x3e3006){function _0xb2b1a(_0x376713,_0x3750f3){return _0x1e74(_0x376713-0x0,_0x3750f3);}this[_0xb2b1a(0x2ca,0x2be)]=_0x3e3006,this[_0xb2b1a(0x2d7,0x2b9)]=undefined;}['getWorkspaceId'](){function _0xd71a44(_0x294244,_0x4e51b3){return _0x1e74(_0x294244- -0x5,_0x4e51b3);}return this[_0xd71a44(0x2c5,0x2d2)];}['getStatus'](){function _0x4afbba(_0x1e731a,_0x1195e7){return _0x1e74(_0x1e731a- -0x1ea,_0x1195e7);}return{'workspaceId':this[_0x4afbba(0xe0,0x65)],'hasConfig':this[_0x4afbba(0x61,0x60)](),'configDetails':this['detectedConfig']?.[_0x4afbba(0x96,0x102)]?{'host':this['detectedConfig'][_0x4afbba(0x96,0x41)][_0x4afbba(0x47,0x9d)],'port':this[_0x4afbba(0xed,0x8e)]['credentials']['port'],'database':this['detectedConfig'][_0x4afbba(0x96,0x23)][_0x4afbba(0x6d,0x31)],'schema':this[_0x4afbba(0xed,0xf8)][_0x4afbba(0x96,0x100)][_0x4afbba(0x87,0x83)]||_0x4afbba(0xef,0xc0),'sslEnabled':this[_0x4afbba(0xed,0x80)][_0x4afbba(0x96,0x58)][_0x4afbba(0xea,0xb7)]||![]}:undefined};}}class DatabaseClient{constructor(_0x3f2eb5,_0x49b496){this['httpClient']=_0x3f2eb5,this['customDatabaseManager']=new CustomDatabaseManager(_0x3f2eb5,_0x49b496);}[_0x380dd0(-0x8a,-0x37)](_0x33f185){function _0x2b33ee(_0x363720,_0x12c06f){return _0x1e74(_0x12c06f-0x125,_0x363720);}return new QueryBuilder(this[_0x2b33ee(0x3a4,0x3c2)],_0x33f185,this[_0x2b33ee(0x393,0x3c7)],this[_0x2b33ee(0x33c,0x333)]['getWorkspaceId']());}[_0x380dd0(-0x60,-0x5c)](_0x5abbe8,_0x344661){function _0x4d1465(_0x5a0979,_0x278928){return _0x1e74(_0x278928-0x1f0,_0x5a0979);}return this['httpClient']['post'](_0x4d1465(0x3be,0x3e4)+_0x5abbe8,_0x344661);}[_0x380dd0(-0x4d,-0x4b)](_0x379bfe){const _0x84d399=new DatabaseClient(this[_0x565ef8(0x177,0x102)],this['customDatabaseManager']['getWorkspaceId']());_0x84d399[_0x565ef8(0xd2,0x107)]=_0x379bfe,_0x84d399[_0x565ef8(0x57,0x73)]=this['customDatabaseManager'];function _0x565ef8(_0x2d1539,_0x248d6f){return _0x1e74(_0x248d6f- -0x19b,_0x2d1539);}return _0x84d399;}async['detectCustomDatabase'](){function _0x1dfcd8(_0x2df3b8,_0x10b120){return _0x1e74(_0x2df3b8- -0x249,_0x10b120);}return this[_0x1dfcd8(-0x3b,-0x49)][_0x1dfcd8(-0x1b,0x5b)]();}async[_0x380dd0(-0x6d,-0xba)](_0x4d7c4f){function _0x1d1eb0(_0x48a69d,_0x454ea9){return _0x1e74(_0x48a69d- -0x2ed,_0x454ea9);}return this[_0x1d1eb0(-0xdf,-0x110)][_0x1d1eb0(-0xe4,-0x86)](_0x4d7c4f);}async[_0x380dd0(-0x5c,-0x9b)](_0x51aed7){function _0x5bad61(_0x93c24a,_0x4dd569){return _0x1e74(_0x4dd569- -0x1ec,_0x93c24a);}return this[_0x5bad61(0x60,0x22)][_0x5bad61(0xc1,0x76)](_0x51aed7);}async[_0x380dd0(-0xc7,-0x50)](){return this['customDatabaseManager']['removeCustomDatabase']();}[_0x380dd0(-0xa1,-0x7c)](){function _0x1faf9b(_0x96d0d2,_0x76e4fa){return _0x1e74(_0x76e4fa-0x29a,_0x96d0d2);}return this[_0x1faf9b(0x4c3,0x4a8)]['hasCustomDatabase']();}[_0x380dd0(0x5,0x69)](){function _0x50ae12(_0x599435,_0x31d3d1){return _0x1e74(_0x599435-0x36c,_0x31d3d1);}return this[_0x50ae12(0x57a,0x5cc)]['getStatus']();}[_0x380dd0(-0x20,-0x2c)](_0x472451){function _0x14280b(_0x19d2e5,_0x295054){return _0x1e74(_0x19d2e5-0x234,_0x295054);}this[_0x14280b(0x442,0x473)][_0x14280b(0x4d2,0x4a5)](_0x472451);}async[_0x380dd0(-0xb4,-0x11a)](){function _0x4b104f(_0x42f64c,_0x57cebb){return _0x1e74(_0x57cebb- -0x2b6,_0x42f64c);}try{await this['customDatabaseManager']['detectCustomDatabase']();}catch(_0x48f9eb){console[_0x4b104f(-0x7f,-0x22)]('Failed to initialize custom database detection:',_0x48f9eb);}}}class StorageBucket{constructor(_0x180f47,bucketId){function _0x229303(_0x29d379,_0x21247e){return _0x1e74(_0x21247e- -0x357,_0x29d379);}this['httpClient']=_0x180f47,this[_0x229303(-0x93,-0xc1)]=bucketId;}async[_0x380dd0(-0x25,0x7)](_0x3cf555,_0x1ef64c,_0x269af9){function _0x3c6a10(_0x3526b5,_0x219d44){return _0x1e74(_0x219d44-0x158,_0x3526b5);}try{const _0x2d544a=new FormData();if(_0x1ef64c instanceof File)_0x2d544a[_0x3c6a10(0x3c2,0x416)](_0x3c6a10(0x2d7,0x334),_0x1ef64c);else{if(_0x1ef64c instanceof Blob)_0x2d544a['append'](_0x3c6a10(0x37e,0x334),_0x1ef64c,_0x3cf555);else{if(_0x1ef64c instanceof ArrayBuffer)_0x2d544a['append'](_0x3c6a10(0x399,0x334),new Blob([_0x1ef64c]),_0x3cf555);else typeof _0x1ef64c==='string'&&_0x2d544a['append']('file',new Blob([_0x1ef64c],{'type':'text/plain'}),_0x3cf555);}}_0x2d544a['append'](_0x3c6a10(0x2d1,0x346),_0x3cf555);_0x269af9?.[_0x3c6a10(0x3d8,0x3a5)]&&_0x2d544a['append']('cacheControl',_0x269af9['cacheControl']);_0x269af9?.['contentType']&&_0x2d544a[_0x3c6a10(0x3de,0x416)]('contentType',_0x269af9[_0x3c6a10(0x3e9,0x399)]);_0x269af9?.[_0x3c6a10(0x44e,0x41f)]&&_0x2d544a[_0x3c6a10(0x484,0x416)]('metadata',JSON['stringify'](_0x269af9['metadata']));const _0x12bd41=_0x3c6a10(0x40a,0x3b3)+this[_0x3c6a10(0x41b,0x3ee)]+'/files'+(_0x269af9?.['upsert']?_0x3c6a10(0x379,0x3aa):''),response=await this[_0x3c6a10(0x3da,0x3f5)][_0x3c6a10(0x350,0x364)](_0x12bd41,_0x2d544a,{'headers':{'Content-Type':_0x3c6a10(0x31f,0x360)}});return{'data':response[_0x3c6a10(0x3cc,0x3dc)],'error':null};}catch(_0x1a9214){return{'data':null,'error':_0x1a9214 instanceof EBaaSError?_0x1a9214:new EBaaSError(_0x1a9214 instanceof Error?_0x1a9214['message']:'Failed\x20to\x20upload\x20file',0x0,_0x1a9214)};}}async['download'](_0x12773b,_0x931d62){function _0x283aa4(_0x4475e0,_0x28d738){return _0x1e74(_0x28d738-0x320,_0x4475e0);}try{const _0x17133d=new URLSearchParams();_0x931d62?.['transform']&&Object[_0x283aa4(0x57f,0x5a8)](_0x931d62['transform'])['forEach'](([_0x12c9d5,_0x57ed27])=>{function _0x8449cb(_0xfada08,_0x1e28e0){return _0x1e74(_0xfada08-0x3e4,_0x1e28e0);}_0x57ed27!==undefined&&_0x17133d[_0x8449cb(0x6a2,0x69d)](_0x12c9d5,String(_0x57ed27));});const _0x4c832d='/storage/buckets/'+this[_0x283aa4(0x607,0x5b6)]+_0x283aa4(0x540,0x5ac)+_0x12773b+(_0x17133d[_0x283aa4(0x4a2,0x519)]()?'?'+_0x17133d[_0x283aa4(0x59b,0x519)]():''),response=await this['httpClient'][_0x283aa4(0x5fe,0x5d9)](_0x4c832d,{'responseType':'blob'});return{'data':response[_0x283aa4(0x5b9,0x5a4)],'error':null};}catch(_0x1c2331){return{'data':null,'error':_0x1c2331 instanceof EBaaSError?_0x1c2331:new EBaaSError(_0x1c2331 instanceof Error?_0x1c2331[_0x283aa4(0x5ee,0x573)]:'Failed\x20to\x20download\x20file',0x0,_0x1c2331)};}}async[_0x380dd0(-0x9c,-0x7c)](_0x55b0d9,_0x1caecb){function _0x2a9989(_0x20355c,_0x3ccaea){return _0x1e74(_0x3ccaea- -0x9b,_0x20355c);}try{const _0x42b467=new URLSearchParams();_0x55b0d9&&_0x42b467[_0x2a9989(0x1f7,0x223)]('prefix',_0x55b0d9);_0x1caecb?.[_0x2a9989(0x171,0x1f3)]&&_0x42b467['append'](_0x2a9989(0x18c,0x1f3),String(_0x1caecb[_0x2a9989(0x222,0x1f3)]));_0x1caecb?.['offset']&&_0x42b467['append'](_0x2a9989(0x2ae,0x236),String(_0x1caecb['offset']));_0x1caecb?.['sortBy']&&_0x42b467[_0x2a9989(0x1c7,0x223)](_0x2a9989(0x169,0x17c),JSON[_0x2a9989(0x1e2,0x188)](_0x1caecb[_0x2a9989(0x145,0x17c)]));_0x1caecb?.[_0x2a9989(0x25e,0x1dd)]&&_0x42b467['append']('search',_0x1caecb[_0x2a9989(0x1c7,0x1dd)]);const _0x5a9dcc=_0x2a9989(0x1a2,0x1c0)+this['bucketId']+_0x2a9989(0xe1,0x14d)+(_0x42b467['toString']()?'?'+_0x42b467[_0x2a9989(0x10c,0x15e)]():''),response=await this[_0x2a9989(0x1ea,0x202)]['get'](_0x5a9dcc);return{'data':response[_0x2a9989(0x22d,0x1e9)],'error':null};}catch(_0x17316b){return{'data':null,'error':_0x17316b instanceof EBaaSError?_0x17316b:new EBaaSError(_0x17316b instanceof Error?_0x17316b['message']:_0x2a9989(0x116,0x140),0x0,_0x17316b)};}}async[_0x380dd0(-0x61,-0x47)](_0x1999ff){function _0x38ed74(_0x56f3ff,_0x199b84){return _0x1e74(_0x56f3ff- -0x2cd,_0x199b84);}try{const response=await this['httpClient']['delete'](_0x38ed74(-0x72,-0xbb)+this[_0x38ed74(-0x37,-0xb7)]+_0x38ed74(-0xe5,-0x6b),{'data':{'paths':_0x1999ff}});return{'data':response[_0x38ed74(-0x49,-0x22)],'error':null};}catch(_0x2beaec){return{'data':null,'error':_0x2beaec instanceof EBaaSError?_0x2beaec:new EBaaSError(_0x2beaec instanceof Error?_0x2beaec['message']:'Failed\x20to\x20remove\x20files',0x0,_0x2beaec)};}}async[_0x380dd0(-0xd4,-0x76)](fromPath,_0x1b0294){function _0x48a39d(_0x56ebbe,_0x2f85da){return _0x1e74(_0x56ebbe- -0x1e1,_0x2f85da);}try{const response=await this[_0x48a39d(0xbc,0x138)]['post']('/storage/buckets/'+this[_0x48a39d(0xb5,0x13a)]+'/files/move',{'sourceKey':fromPath,'destinationKey':_0x1b0294});return{'data':response['data'],'error':null};}catch(_0x3cf934){return{'data':null,'error':_0x3cf934 instanceof EBaaSError?_0x3cf934:new EBaaSError(_0x3cf934 instanceof Error?_0x3cf934[_0x48a39d(0x72,0x2)]:_0x48a39d(0x8a,0x56),0x0,_0x3cf934)};}}async['copy'](fromPath,_0x17affd){function _0x16cf16(_0x2780e0,_0xc88fff){return _0x1e74(_0x2780e0- -0x21,_0xc88fff);}try{const response=await this[_0x16cf16(0x27c,0x302)][_0x16cf16(0x1eb,0x1c3)]('/storage/buckets/'+this[_0x16cf16(0x275,0x250)]+_0x16cf16(0x270,0x256),{'sourceKey':fromPath,'destinationKey':_0x17affd});return{'data':response['data'],'error':null};}catch(_0x2c84f7){return{'data':null,'error':_0x2c84f7 instanceof EBaaSError?_0x2c84f7:new EBaaSError(_0x2c84f7 instanceof Error?_0x2c84f7[_0x16cf16(0x232,0x1e4)]:_0x16cf16(0x1c1,0x1a6),0x0,_0x2c84f7)};}}async[_0x380dd0(0x15,0x82)](_0x55459a,_0x1a15be,_0x4feebc){function _0x120ba9(_0x1bab40,_0x5e7c37){return _0x1e74(_0x1bab40- -0x109,_0x5e7c37);}try{const response=await this[_0x120ba9(0x194,0x172)]['post']('/storage/buckets/'+this[_0x120ba9(0x18d,0x1d1)]+_0x120ba9(0x183,0x165)+_0x55459a+'/sign',{'expiresIn':_0x1a15be,..._0x4feebc});return{'data':response['data'],'error':null};}catch(_0x348f63){return{'data':null,'error':_0x348f63 instanceof EBaaSError?_0x348f63:new EBaaSError(_0x348f63 instanceof Error?_0x348f63['message']:'Failed\x20to\x20create\x20signed\x20URL',0x0,_0x348f63)};}}['getPublicUrl'](_0x12de6f,_0x4ad2bf){const _0x769bb1=new URLSearchParams();_0x4ad2bf?.[_0x33a1ce(0x546,0x503)]&&Object[_0x33a1ce(0x534,0x4f0)](_0x4ad2bf['transform'])[_0x33a1ce(0x49f,0x4c5)](([_0x53736b,_0x5f36e1])=>{function _0x185521(_0x2b830e,_0x655f04){return _0x1e74(_0x655f04-0x114,_0x2b830e);}_0x5f36e1!==undefined&&_0x769bb1[_0x185521(0x42f,0x3d2)](_0x53736b,String(_0x5f36e1));});const _0x3b52d4=this['httpClient'][_0x33a1ce(0x4c7,0x444)]||'',_0x4dfb1f=_0x3b52d4+_0x33a1ce(0x507,0x520)+this['bucketId']+'/files/'+_0x12de6f+(_0x769bb1[_0x33a1ce(0x4a5,0x464)]()?'?'+_0x769bb1['toString']():'');function _0x33a1ce(_0x2ef0f0,_0x1cd8a7){return _0x1e74(_0x2ef0f0-0x2ac,_0x1cd8a7);}return{'data':{'publicUrl':_0x4dfb1f}};}async['getFileInfo'](_0xcc7b47){function _0x10a4a4(_0x3e4f44,_0x4b3019){return _0x1e74(_0x3e4f44- -0x24c,_0x4b3019);}try{const response=await this['httpClient']['get']('/storage/buckets/'+this['bucketId']+_0x10a4a4(0x40,0xe)+_0xcc7b47+_0x10a4a4(0x7d,0xda));return{'data':response[_0x10a4a4(0x38,0xe)],'error':null};}catch(_0x1c3bc3){return{'data':null,'error':_0x1c3bc3 instanceof EBaaSError?_0x1c3bc3:new EBaaSError(_0x1c3bc3 instanceof Error?_0x1c3bc3[_0x10a4a4(0x7,0x28)]:_0x10a4a4(-0x10,0x3d),0x0,_0x1c3bc3)};}}async['updateFileMetadata'](_0xd99093,metadata){function _0x4fd7a7(_0x5e2db5,_0x5c6c5a){return _0x1e74(_0x5e2db5-0x6c,_0x5c6c5a);}try{const response=await this['httpClient']['put']('/storage/buckets/'+this['bucketId']+_0x4fd7a7(0x2f8,0x295)+_0xd99093+'/metadata',{'metadata':metadata});return{'data':response[_0x4fd7a7(0x2f0,0x288)],'error':null};}catch(_0x433ca2){return{'data':null,'error':_0x433ca2 instanceof EBaaSError?_0x433ca2:new EBaaSError(_0x433ca2 instanceof Error?_0x433ca2['message']:_0x4fd7a7(0x344,0x36f),0x0,_0x433ca2)};}}}class StorageClient{constructor(_0x3070b6){this['httpClient']=_0x3070b6;}['from'](bucketId){function _0x3f6f89(_0x474c56,_0x5687e9){return _0x1e74(_0x5687e9-0x38d,_0x474c56);}return new StorageBucket(this[_0x3f6f89(0x5c5,0x62a)],bucketId);}async[_0x380dd0(-0xa0,-0xb2)](_0x5df0d2,_0x1ec910){function _0x1b2d76(_0x56b352,_0x41c1f6){return _0x1e74(_0x56b352- -0x3df,_0x41c1f6);}try{const response=await this['httpClient']['post'](_0x1b2d76(-0x156,-0xe8),{'id':_0x5df0d2,..._0x1ec910});return{'data':response['data'],'error':null};}catch(_0x5109e4){return{'data':null,'error':_0x5109e4 instanceof EBaaSError?_0x5109e4:new EBaaSError(_0x5109e4 instanceof Error?_0x5109e4['message']:_0x1b2d76(-0x11d,-0x16d),0x0,_0x5109e4)};}}async[_0x380dd0(-0x3d,-0x88)](_0x3b01d4){function _0x2daa24(_0x1678e2,_0x4dc882){return _0x1e74(_0x4dc882-0x7b,_0x1678e2);}try{const response=await this['httpClient']['get'](_0x2daa24(0x300,0x2d6)+_0x3b01d4);return{'data':response['data'],'error':null};}catch(_0x17c82e){return{'data':null,'error':_0x17c82e instanceof EBaaSError?_0x17c82e:new EBaaSError(_0x17c82e instanceof Error?_0x17c82e[_0x2daa24(0x263,0x2ce)]:_0x2daa24(0x31a,0x29b),0x0,_0x17c82e)};}}async[_0x380dd0(-0x2b,-0x8e)](){function _0x2d7453(_0x28733c,_0x4f3a5c){return _0x1e74(_0x28733c- -0x2f2,_0x4f3a5c);}try{const response=await this['httpClient'][_0x2d7453(-0x39,-0x1c)](_0x2d7453(-0x69,-0x66));return{'data':response[_0x2d7453(-0x6e,-0xea)],'error':null};}catch(_0x2ceaa2){return{'data':null,'error':_0x2ceaa2 instanceof EBaaSError?_0x2ceaa2:new EBaaSError(_0x2ceaa2 instanceof Error?_0x2ceaa2['message']:_0x2d7453(-0x51,-0x3f),0x0,_0x2ceaa2)};}}async['updateBucket'](_0x456389,_0x465eca){function _0x977caa(_0x157f1f,_0x42cb9d){return _0x1e74(_0x157f1f-0x73,_0x42cb9d);}try{const response=await this[_0x977caa(0x310,0x303)][_0x977caa(0x277,0x2bc)](_0x977caa(0x2ce,0x28d)+_0x456389,_0x465eca);return{'data':response['data'],'error':null};}catch(_0x2d7f98){return{'data':null,'error':_0x2d7f98 instanceof EBaaSError?_0x2d7f98:new EBaaSError(_0x2d7f98 instanceof Error?_0x2d7f98[_0x977caa(0x2c6,0x2f4)]:'Failed\x20to\x20update\x20bucket',0x0,_0x2d7f98)};}}async[_0x380dd0(-0xe1,-0xb1)](_0x44edbb){function _0x49a667(_0x5a1dec,_0x4943d7){return _0x1e74(_0x5a1dec- -0x22c,_0x4943d7);}try{const response=await this['httpClient']['delete']('/storage/buckets/'+_0x44edbb);return{'data':response[_0x49a667(0x58,0x31)],'error':null};}catch(_0x5349d6){return{'data':null,'error':_0x5349d6 instanceof EBaaSError?_0x5349d6:new EBaaSError(_0x5349d6 instanceof Error?_0x5349d6[_0x49a667(0x27,-0x1e)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x5349d6)};}}async[_0x380dd0(-0x31,0x4d)](){function _0x47443c(_0x9e2361,_0x212467){return _0x1e74(_0x212467- -0x341,_0x9e2361);}try{const response=await this[_0x47443c(-0x38,-0xa4)][_0x47443c(-0x5b,-0x88)]('/storage/usage');return{'data':response['data'],'error':null};}catch(_0x2bf1c0){return{'data':null,'error':_0x2bf1c0 instanceof EBaaSError?_0x2bf1c0:new EBaaSError(_0x2bf1c0 instanceof Error?_0x2bf1c0['message']:_0x47443c(-0xf2,-0x7d),0x0,_0x2bf1c0)};}}}class RealtimeChannel extends EventEmitter{constructor(_0x17c49c,_0x4c9063){super(),this[_0x34b7e6(-0x50,-0x81)]=![],this['state']='closed',this[_0x34b7e6(-0x66,-0x33)]=new Map();function _0x34b7e6(_0x528147,_0x34bb04){return _0x1e74(_0x528147- -0x2d6,_0x34bb04);}this[_0x34b7e6(-0x10,-0x59)]=_0x17c49c,this[_0x34b7e6(-0x29,-0x8f)]=_0x4c9063;}['subscribe'](_0x210ffd){function _0x5efecf(_0x7ed5d2,_0x1d6bcc){return _0x1e74(_0x1d6bcc- -0xe2,_0x7ed5d2);}return!this['joinedOnce']&&(this['joinedOnce']=!![],this[_0x5efecf(0xeb,0x145)]()),_0x210ffd&&this['on']('status',_0x210ffd),this;}['onPostgresChanges'](filter,_0x348806){function _0xe4a9e4(_0xd13fdf,_0x349972){return _0x1e74(_0x349972-0x1f7,_0xd13fdf);}const _0x3f98a0=_0xe4a9e4(0x4d4,0x4c3)+JSON['stringify'](filter);super['on'](_0x3f98a0,_0x348806);const _0x4c569e={'unsubscribe':()=>{super['off'](_0x3f98a0,_0x348806);function _0x4a270c(_0x54dfd3,_0x3eb6f9){return _0x1e74(_0x3eb6f9- -0x2ce,_0x54dfd3);}this['subscriptions'][_0x4a270c(-0xdc,-0xd0)](_0x3f98a0);}};return this[_0xe4a9e4(0x439,0x467)]['set'](_0x3f98a0,_0x4c569e),this[_0xe4a9e4(0x521,0x4a4)]?.[_0xe4a9e4(0x435,0x3ce)]&&this[_0xe4a9e4(0x3ef,0x3dd)]===_0xe4a9e4(0x3f1,0x3e4)&&this[_0xe4a9e4(0x49d,0x4a4)][_0xe4a9e4(0x49f,0x42f)]('subscribe_postgres_changes',{'topic':this['topic'],'filter':filter,'ref':this['makeRef']()}),_0x4c569e;}['onBroadcast'](filter,_0x26b092){const _0x5f3fb0=_0x252ee3(0x381,0x308)+JSON['stringify'](filter);super['on'](_0x5f3fb0,_0x26b092);const _0x106d8e={'unsubscribe':()=>{super[_0x1e0bc4(-0x66,-0xa2)](_0x5f3fb0,_0x26b092);function _0x1e0bc4(_0x5c9e50,_0x249a6b){return _0x1e74(_0x5c9e50- -0x310,_0x249a6b);}this[_0x1e0bc4(-0xa0,-0x46)][_0x1e0bc4(-0x112,-0x176)](_0x5f3fb0);}};this['subscriptions']['set'](_0x5f3fb0,_0x106d8e);function _0x252ee3(_0x4c6bbe,_0x187cec){return _0x1e74(_0x187cec-0x81,_0x4c6bbe);}return _0x106d8e;}[_0x380dd0(-0xb8,-0x6d)](filter,_0x29228e){const _0x53d5f5=_0x19f246(-0x139,-0x126)+JSON['stringify'](filter);super['on'](_0x53d5f5,_0x29228e);const _0x50cfe3={'unsubscribe':()=>{super[_0x304c33(0x2e8,0x27a)](_0x53d5f5,_0x29228e);function _0x304c33(_0x567737,_0x57c69c){return _0x1e74(_0x57c69c- -0x30,_0x567737);}this[_0x304c33(0x231,0x240)][_0x304c33(0x1cc,0x1ce)](_0x53d5f5);}};function _0x19f246(_0x1c4f22,_0x27a505){return _0x1e74(_0x27a505- -0x38e,_0x1c4f22);}return this[_0x19f246(-0x172,-0x11e)]['set'](_0x53d5f5,_0x50cfe3),_0x50cfe3;}[_0x380dd0(-0x51,-0x23)](_0x4bdae8){return new Promise(_0x168abf=>{function _0x49ba36(_0x5005ac,_0x4a7cd7){return _0x1e74(_0x5005ac-0x2ee,_0x4a7cd7);}this[_0x49ba36(0x59b,0x54d)]?.[_0x49ba36(0x4c5,0x4cb)]&&this['state']==='joined'?(this['socket']['emit'](_0x49ba36(0x543,0x58b),{'topic':this['topic'],'event':_0x4bdae8[_0x49ba36(0x5cd,0x5a3)],'payload':_0x4bdae8,'ref':this['makeRef']()}),_0x168abf('ok')):_0x168abf('error');});}[_0x380dd0(-0xb9,-0x139)](_0x5d2c74){return new Promise(_0x2c1eeb=>{function _0x1081c7(_0x38f699,_0x511222){return _0x1e74(_0x38f699-0x384,_0x511222);}this[_0x1081c7(0x631,0x68d)]?.[_0x1081c7(0x55b,0x5da)]&&this['state']===_0x1081c7(0x571,0x506)?(this['socket']['emit']('presence',{'topic':this[_0x1081c7(0x64a,0x662)],'event':'track','payload':_0x5d2c74,'ref':this[_0x1081c7(0x607,0x62c)]()}),_0x2c1eeb('ok')):_0x2c1eeb(_0x1081c7(0x5a8,0x5ea));});}['untrack'](){return new Promise(_0x49d47a=>{function _0x41581e(_0x22cafb,_0x1b8545){return _0x1e74(_0x1b8545-0x242,_0x22cafb);}this['socket']?.[_0x41581e(0x3df,0x419)]&&this['state']===_0x41581e(0x48d,0x42f)?(this['socket'][_0x41581e(0x45e,0x47a)](_0x41581e(0x4b1,0x4bc),{'topic':this['topic'],'event':_0x41581e(0x547,0x4d4),'ref':this['makeRef']()}),_0x49d47a('ok')):_0x49d47a(_0x41581e(0x41d,0x466));});}[_0x380dd0(-0x8b,-0x14)](){return new Promise(_0x3661ea=>{function _0xfd222e(_0x2451eb,_0x57ecc1){return _0x1e74(_0x57ecc1-0x217,_0x2451eb);}this[_0xfd222e(0x42b,0x3fd)]='leaving',this[_0xfd222e(0x46d,0x487)][_0xfd222e(0x44b,0x40a)](_0x485c9d=>{function _0x5cb14b(_0x23bc9e,_0xb7b936){return _0x1e74(_0xb7b936- -0x37,_0x23bc9e);}_0x485c9d[_0x5cb14b(0x1c3,0x1fc)]();}),this[_0xfd222e(0x4b7,0x487)][_0xfd222e(0x4fc,0x4d4)](),this[_0xfd222e(0x536,0x4c4)]?.['connected']&&this[_0xfd222e(0x490,0x4c4)]['emit'](_0xfd222e(0x472,0x451),{'topic':this[_0xfd222e(0x498,0x4dd)],'ref':this[_0xfd222e(0x4ea,0x49a)]()}),this['state']=_0xfd222e(0x426,0x455),this['removeAllListeners'](),_0x3661ea('ok');});}['_join'](){if(this['state']===_0x1c9fcd(0x2c5,0x2d0))return;this[_0x1c9fcd(0x23f,0x2bf)]=_0x1c9fcd(0x248,0x1f5);function _0x1c9fcd(_0x34b36a,_0xb3bf91){return _0x1e74(_0x34b36a-0x59,_0xb3bf91);}this[_0x1c9fcd(0x306,0x303)]?.['connected']&&(this['socket']['emit'](_0x1c9fcd(0x2ee,0x2e3),{'topic':this['topic'],'ref':this[_0x1c9fcd(0x2dc,0x329)]()}),setTimeout(()=>{function _0x228d2b(_0x3e4bfb,_0x30c8ed){return _0x1e74(_0x3e4bfb- -0x24c,_0x30c8ed);}this['state']==='joining'&&(this[_0x228d2b(-0x66,0x1f)]='joined',this['emit'](_0x228d2b(-0x2,-0x81),'SUBSCRIBED'));},0x64));}[_0x380dd0(-0x13,-0x10)](){function _0x3bf1a2(_0x3c41e7,_0x59d6f3){return _0x1e74(_0x59d6f3- -0xba,_0x3c41e7);}this[_0x3bf1a2(0x1d1,0x1cc)]&&(this['_join'](),this[_0x3bf1a2(0x18f,0x1b6)][_0x3bf1a2(0x19e,0x139)]((_0x443d7f,_0x1bcbb9)=>{function _0x3d007b(_0x3a2db6,_0x3a4a00){return _0x1e74(_0x3a4a00- -0x24e,_0x3a2db6);}if(_0x1bcbb9['startsWith']('postgres_changes:')){const filter=JSON[_0x3d007b(-0x27,0x26)](_0x1bcbb9[_0x3d007b(0x51,0x27)](_0x3d007b(0x5a,0x7e),''));this['socket']?.[_0x3d007b(0x26,-0x16)]('subscribe_postgres_changes',{'topic':this['topic'],'filter':filter,'ref':this['makeRef']()});}}));}[_0x380dd0(-0xd7,-0x77)](_0x58f321,_0x553f28){function _0x4fb701(_0x44e2fe,_0x361a32){return _0x1e74(_0x361a32- -0x216,_0x44e2fe);}if(_0x58f321===_0x4fb701(0x45,0x54)){const _0x86c8e4='postgres_changes:'+JSON['stringify'](_0x553f28[_0x4fb701(0x57,0x96)]||{});this[_0x4fb701(0x59,0x22)](_0x86c8e4,_0x553f28);}else{if(_0x58f321===_0x4fb701(0x8f,0x3f)){const _0x3cc6be=_0x4fb701(0xbc,0x71)+JSON[_0x4fb701(-0x35,0xd)]({'event':_0x553f28[_0x4fb701(0x88,0xc9)]});this['emit'](_0x3cc6be,_0x553f28);}else{if(_0x58f321===_0x4fb701(-0x9,0x64)){const _0x290e1c='presence:'+JSON['stringify']({'event':_0x553f28[_0x4fb701(0x87,0xc9)]});this[_0x4fb701(0x64,0x22)](_0x290e1c,_0x553f28);}}}this[_0x4fb701(0x16,0x22)](_0x58f321,_0x553f28);}['_setState'](_0x81c58f){this['state']=_0x81c58f;let status;switch(_0x81c58f){case'joined':status='SUBSCRIBED';break;case _0x78a67c(0x3c6,0x3d9):status=_0x78a67c(0x379,0x3b6);break;case _0x78a67c(0x2de,0x341):status='CLOSED';break;default:return;}function _0x78a67c(_0x33888c,_0x13fa78){return _0x1e74(_0x13fa78-0x103,_0x33888c);}this['emit'](_0x78a67c(0x30d,0x34d),status);}[_0x380dd0(-0x3b,-0xc1)](){function _0x206c4d(_0x4ec48c,_0x34db45){return _0x1e74(_0x34db45-0x310,_0x4ec48c);}return Math[_0x206c4d(0x5be,0x576)]()['toString'](0x24)['substring'](0x2,0xf);}[_0x380dd0(-0x77,-0xee)](){function _0x4817ba(_0x6e049b,_0x3e78c2){return _0x1e74(_0x6e049b-0x94,_0x3e78c2);}return this[_0x4817ba(0x27a,0x2ee)];}}class RealtimeClient{constructor(_0x541e78,_0x25ab69,_0x240560={}){this[_0x1a5fb8(0x56,0xac)]=null,this['channels']=new Map(),this[_0x1a5fb8(-0x5c,-0xe2)]='disconnected',this['reconnectAttempts']=0x0,this[_0x1a5fb8(0xd,-0x44)]=0x5,this['url']=_0x541e78;function _0x1a5fb8(_0x3bbac3,_0x1746f9){return _0x1e74(_0x3bbac3- -0x257,_0x1746f9);}this[_0x1a5fb8(0x4f,0xe)]=_0x25ab69,this['options']={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x240560};}[_0x380dd0(-0x4c,-0x6a)](){return new Promise((_0x1b6be3,_0x372e6f)=>{if(this[_0x583fce(-0x44,-0xba)]?.[_0x583fce(-0x141,-0x190)]){_0x1b6be3();return;}this[_0x583fce(-0x10d,-0x16c)]=_0x583fce(-0x81,-0xc2);function _0x583fce(_0x199e1d,_0x266a62){return _0x1e74(_0x266a62- -0x367,_0x199e1d);}this['socket']=socket_ioClient['io'](this[_0x583fce(-0xc4,-0xf1)],{'auth':{'apikey':this['apiKey']},'transports':[_0x583fce(-0x6a,-0xc4)],'reconnection':!![],'reconnectionDelay':this['options'][_0x583fce(-0x79,-0xcb)],'reconnectionAttempts':this['options']['maxReconnectAttempts'],...this[_0x583fce(-0xfb,-0x122)]['socketOptions']}),this[_0x583fce(-0xff,-0xba)]['on']('connect',()=>{this[_0x5c10a9(-0x236,-0x1e4)]='connected',this['reconnectAttempts']=0x0;function _0x5c10a9(_0x5e115f,_0x38e87b){return _0x1e74(_0x38e87b- -0x3df,_0x5e115f);}this[_0x5c10a9(-0x124,-0x130)](),_0x1b6be3();}),this[_0x583fce(-0x4e,-0xba)]['on'](_0x583fce(-0x17e,-0x127),_0x216e0e=>{this[_0x476a12(0x3c6,0x3df)]='disconnected';function _0x476a12(_0x4a78f7,_0x53bb79){return _0x1e74(_0x53bb79-0x1e4,_0x4a78f7);}this['channels'][_0x476a12(0x391,0x3d7)](channel=>{function _0xd444e1(_0x49e87d,_0x11bac3){return _0x1e74(_0x11bac3-0x227,_0x49e87d);}channel[_0xd444e1(0x3c9,0x43c)]('closed');});}),this[_0x583fce(-0x133,-0xba)]['on']('connect_error',_0x17ee10=>{this[_0x6545f(-0x1ce,-0x1b6)]=_0x6545f(-0x1f4,-0x18d),this[_0x6545f(-0xdb,-0x14a)]++;function _0x6545f(_0x472dec,_0x222010){return _0x1e74(_0x222010- -0x3b1,_0x472dec);}this['reconnectAttempts']>=this[_0x6545f(-0x135,-0x14d)]&&_0x372e6f(new Error('Failed\x20to\x20connect\x20after\x20'+this['maxReconnectAttempts']+'\x20attempts:\x20'+_0x17ee10['message']));}),this[_0x583fce(-0xb4,-0xba)]['on'](_0x583fce(-0x119,-0x12c),()=>{this['connectionState']='connected',this['reconnectAttempts']=0x0,this['channels']['forEach'](channel=>{function _0x33dbc1(_0xe1a2d,_0x3b2c2c){return _0x1e74(_0xe1a2d-0x215,_0x3b2c2c);}channel[_0x33dbc1(0x4c0,0x4fa)]();});}),this[_0x583fce(-0x97,-0xba)]['on']('postgres_changes',_0x402665=>{function _0x290734(_0x22f6a0,_0x4e6adf){return _0x1e74(_0x22f6a0-0x106,_0x4e6adf);}const channel=this[_0x290734(0x3c0,0x3db)]['get'](_0x402665['topic']);channel&&channel[_0x290734(0x2ed,0x370)](_0x290734(0x370,0x3a6),_0x402665);}),this[_0x583fce(-0xf9,-0xba)]['on']('broadcast',_0x59d7d4=>{const channel=this['channels'][_0x1b0c79(-0x80,-0x66)](_0x59d7d4[_0x1b0c79(-0x73,-0xec)]);function _0x1b0c79(_0x2476b8,_0x448082){return _0x1e74(_0x2476b8- -0x339,_0x448082);}channel&&channel['_trigger']('broadcast',_0x59d7d4);}),this['socket']['on']('presence',_0x3f5b2f=>{const channel=this['channels']['get'](_0x3f5b2f['topic']);function _0x2a90a2(_0x353c53,_0x151a12){return _0x1e74(_0x151a12- -0x22a,_0x353c53);}channel&&channel[_0x2a90a2(-0xb,-0x43)](_0x2a90a2(0x77,0x50),_0x3f5b2f);});});}['disconnect'](){function _0xc9f3c7(_0x153385,_0x21d1f2){return _0x1e74(_0x153385-0x297,_0x21d1f2);}this['socket']&&(this[_0xc9f3c7(0x544,0x5b3)]['disconnect'](),this[_0xc9f3c7(0x544,0x4f3)]=null),this[_0xc9f3c7(0x492,0x4b5)]='disconnected',this[_0xc9f3c7(0x551,0x5bc)]['clear']();}['channel'](_0x171a3f){if(this['channels'][_0x2b8c53(0x375,0x2ef)](_0x171a3f))return this['channels']['get'](_0x171a3f);const channel=new RealtimeChannel(_0x171a3f,this['socket']);function _0x2b8c53(_0x2db242,_0x5385c6){return _0x1e74(_0x5385c6-0xc5,_0x2db242);}return this[_0x2b8c53(0x34e,0x37f)][_0x2b8c53(0x354,0x380)](_0x171a3f,channel),this['connectionState']===_0x2b8c53(0x31e,0x29c)&&channel['_join'](),channel;}['removeChannel'](channel){const _0x410b92=channel['topic'];function _0x918fa7(_0x5b35c2,_0x3590a7){return _0x1e74(_0x3590a7- -0x2,_0x5b35c2);}this[_0x918fa7(0x26b,0x2b8)][_0x918fa7(0x231,0x228)](_0x410b92)&&(this[_0x918fa7(0x33e,0x2b8)]['delete'](_0x410b92),channel['unsubscribe']());}[_0x380dd0(-0x6f,-0x96)](){this['channels'][_0x4e1534(0x29d,0x2cc)](channel=>{channel['unsubscribe']();});function _0x4e1534(_0x4ad8ed,_0x1dbc14){return _0x1e74(_0x1dbc14-0xd9,_0x4ad8ed);}this[_0x4e1534(0x3ad,0x393)]['clear']();}[_0x380dd0(-0x2,0x10)](){function _0x58e7a7(_0x464506,_0x4f68db){return _0x1e74(_0x4f68db- -0x39c,_0x464506);}return Array[_0x58e7a7(-0x10d,-0x168)](this[_0x58e7a7(-0xc2,-0xe2)]['values']());}[_0x380dd0(-0xab,-0x12f)](){return this['connectionState']==='connected'&&!!this['socket']?.['connected'];}['getConnectionState'](){function _0x1607cc(_0x480d4e,_0x58610b){return _0x1e74(_0x58610b-0x21f,_0x480d4e);}return this[_0x1607cc(0x429,0x41a)];}['onConnectionStateChange'](_0x5346bf){const _0x369f9f=()=>_0x5346bf(this['connectionState']);function _0x393989(_0x2548e0,_0x549fa9){return _0x1e74(_0x2548e0- -0x310,_0x549fa9);}return this[_0x393989(-0x63,-0x63)]&&(this['socket']['on'](_0x393989(-0x9e,-0xa9),()=>{this[_0x43c679(-0x148,-0x11e)]=_0x43c679(-0x16c,-0x11d);function _0x43c679(_0x21eac7,_0x57cf82){return _0x1e74(_0x21eac7- -0x343,_0x57cf82);}_0x369f9f();}),this['socket']['on']('disconnect',()=>{this[_0x4f8f32(-0x121,-0x139)]=_0x4f8f32(-0xef,-0x137);function _0x4f8f32(_0x749bb1,_0x512d8d){return _0x1e74(_0x512d8d- -0x334,_0x749bb1);}_0x369f9f();}),this['socket']['on']('connect_error',()=>{this['connectionState']=_0x2a0757(0x507,0x48e);function _0x2a0757(_0x270470,_0x1037e9){return _0x1e74(_0x1037e9-0x26a,_0x270470);}_0x369f9f();})),()=>{function _0x5ccb08(_0x124d50,_0x2cba93){return _0x1e74(_0x124d50-0x326,_0x2cba93);}this[_0x5ccb08(0x5d3,0x573)]&&(this[_0x5ccb08(0x5d3,0x5ad)]['off']('connect',_0x369f9f),this['socket'][_0x5ccb08(0x5d0,0x5a5)]('disconnect',_0x369f9f),this[_0x5ccb08(0x5d3,0x5f6)][_0x5ccb08(0x5d0,0x592)](_0x5ccb08(0x57e,0x594),_0x369f9f));};}[_0x380dd0(-0xf,-0x4f)](){function _0x2c572d(_0xe62dd2,_0x1c0fa5){return _0x1e74(_0xe62dd2-0x1f9,_0x1c0fa5);}if(!this[_0x2c572d(0x43e,0x4be)]['heartbeatInterval']||!this['socket'])return;const interval=setInterval(()=>{function _0x469673(_0x4364ae,_0x3c6270){return _0x1e74(_0x3c6270-0x1c0,_0x4364ae);}this[_0x469673(0x41a,0x46d)]?.['connected']?this['socket']['emit']('heartbeat',{'timestamp':Date['now']()}):clearInterval(interval);},this['options'][_0x2c572d(0x3f1,0x446)]);}['_getSocket'](){return this['socket'];}}function _0x1e74(_0x576199,_0x307e20){const _0x1cdf35=_0x1cdf();return _0x1e74=function(_0x1e7434,_0x377c80){_0x1e7434=_0x1e7434-0x1d7;let _0x2d00db=_0x1cdf35[_0x1e7434];if(_0x1e74['Kkwdhz']===undefined){var _0x39163f=function(_0x2654f9){const _0x50eccd='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4b2024='',_0x11a356='';for(let _0xca3659=0x0,_0x1fa99a,_0xc51147,_0x401c05=0x0;_0xc51147=_0x2654f9['charAt'](_0x401c05++);~_0xc51147&&(_0x1fa99a=_0xca3659%0x4?_0x1fa99a*0x40+_0xc51147:_0xc51147,_0xca3659++%0x4)?_0x4b2024+=String['fromCharCode'](0xff&_0x1fa99a>>(-0x2*_0xca3659&0x6)):0x0){_0xc51147=_0x50eccd['indexOf'](_0xc51147);}for(let _0x97c3ba=0x0,_0x470896=_0x4b2024['length'];_0x97c3ba<_0x470896;_0x97c3ba++){_0x11a356+='%'+('00'+_0x4b2024['charCodeAt'](_0x97c3ba)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x11a356);};_0x1e74['azvcem']=_0x39163f,_0x576199=arguments,_0x1e74['Kkwdhz']=!![];}const _0x407ffb=_0x1cdf35[0x0],_0x7a429c=_0x1e7434+_0x407ffb,_0x1c7a90=_0x576199[_0x7a429c];return!_0x1c7a90?(_0x2d00db=_0x1e74['azvcem'](_0x2d00db),_0x576199[_0x7a429c]=_0x2d00db):_0x2d00db=_0x1c7a90,_0x2d00db;},_0x1e74(_0x576199,_0x307e20);}class FunctionsClient{constructor(_0x1629c0){this['httpClient']=_0x1629c0;}async['invoke'](_0x3b4074,_0x264aa6){function _0x13f270(_0x198c2b,_0x1d0b5d){return _0x1e74(_0x1d0b5d-0x1b0,_0x198c2b);}try{const _0x2d65df=_0x264aa6?.[_0x13f270(0x490,0x461)]||'POST',headers={'Content-Type':'application/json',..._0x264aa6?.['headers']};let response;const _0x337e9e='/functions/v1/'+_0x3b4074;switch(_0x2d65df[_0x13f270(0x392,0x3b0)]()){case'GET':response=await this['httpClient']['get'](_0x337e9e,{'headers':headers,'params':_0x264aa6?.['body']});break;case'POST':response=await this['httpClient'][_0x13f270(0x39f,0x3bc)](_0x337e9e,_0x264aa6?.[_0x13f270(0x3b6,0x43b)],{'headers':headers});break;case'PUT':response=await this['httpClient']['put'](_0x337e9e,_0x264aa6?.['body'],{'headers':headers});break;case'PATCH':response=await this['httpClient']['patch'](_0x337e9e,_0x264aa6?.['body'],{'headers':headers});break;case'DELETE':response=await this[_0x13f270(0x480,0x44d)]['delete'](_0x337e9e,{'headers':headers,'data':_0x264aa6?.[_0x13f270(0x468,0x43b)]});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x2d65df,0x190);}return{'data':response[_0x13f270(0x424,0x434)],'error':null};}catch(_0x3b678a){return{'data':null,'error':_0x3b678a instanceof EBaaSError?_0x3b678a:new EBaaSError(_0x3b678a instanceof Error?_0x3b678a[_0x13f270(0x3e9,0x403)]:'Function\x20invocation\x20failed',0x0,_0x3b678a)};}}async[_0x380dd0(-0x9c,-0x103)](){function _0x25869f(_0x51bedb,_0x35a14c){return _0x1e74(_0x35a14c- -0x345,_0x51bedb);}try{const response=await this[_0x25869f(-0x3c,-0xa8)][_0x25869f(-0x38,-0x8c)]('/functions/v1');return{'data':response['data'],'error':null};}catch(_0x2810f3){return{'data':null,'error':_0x2810f3 instanceof EBaaSError?_0x2810f3:new EBaaSError(_0x2810f3 instanceof Error?_0x2810f3[_0x25869f(-0x109,-0xf2)]:'Failed\x20to\x20list\x20functions',0x0,_0x2810f3)};}}async[_0x380dd0(-0x5,-0x48)](_0xfb7c0e){function _0x925c95(_0x131bdf,_0x1bbc0d){return _0x1e74(_0x1bbc0d- -0x24a,_0x131bdf);}try{const response=await this[_0x925c95(0x4b,0x53)]['get']('/functions/v1/'+_0xfb7c0e+_0x925c95(0x76,0x7f));return{'data':response[_0x925c95(0x5a,0x3a)],'error':null};}catch(_0x410ae0){return{'data':null,'error':_0x410ae0 instanceof EBaaSError?_0x410ae0:new EBaaSError(_0x410ae0 instanceof Error?_0x410ae0[_0x925c95(-0x75,0x9)]:_0x925c95(0x45,0x7e),0x0,_0x410ae0)};}}async[_0x380dd0(-0xa2,-0x68)](_0x527668,_0x5b0c05){function _0x1d7014(_0x3fd432,_0x5a1e26){return _0x1e74(_0x3fd432-0x230,_0x5a1e26);}try{const _0x24d06d=new FormData();if(_0x5b0c05[_0x1d7014(0x48a,0x477)]instanceof File)_0x24d06d['append']('code',_0x5b0c05['code']);else typeof _0x5b0c05['code']==='string'&&_0x24d06d[_0x1d7014(0x4ee,0x559)](_0x1d7014(0x48a,0x472),new Blob([_0x5b0c05[_0x1d7014(0x48a,0x436)]],{'type':_0x1d7014(0x4fd,0x549)}),_0x1d7014(0x4a7,0x501));_0x5b0c05['entrypoint']&&_0x24d06d[_0x1d7014(0x4ee,0x55e)](_0x1d7014(0x493,0x489),_0x5b0c05[_0x1d7014(0x493,0x474)]);_0x5b0c05['env']&&_0x24d06d[_0x1d7014(0x4ee,0x471)](_0x1d7014(0x40e,0x40a),JSON['stringify'](_0x5b0c05[_0x1d7014(0x40e,0x40b)]));_0x5b0c05['importMap']&&_0x24d06d[_0x1d7014(0x4ee,0x520)](_0x1d7014(0x4de,0x4e9),JSON[_0x1d7014(0x453,0x3df)](_0x5b0c05[_0x1d7014(0x4de,0x457)]));_0x5b0c05['verify']!==undefined&&_0x24d06d['append']('verify',String(_0x5b0c05[_0x1d7014(0x446,0x45e)]));const response=await this['httpClient']['post'](_0x1d7014(0x426,0x4ab)+_0x527668+_0x1d7014(0x50e,0x48a),_0x24d06d,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x1d7014(0x4b4,0x4ec)],'error':null};}catch(_0x5c0fd5){return{'data':null,'error':_0x5c0fd5 instanceof EBaaSError?_0x5c0fd5:new EBaaSError(_0x5c0fd5 instanceof Error?_0x5c0fd5[_0x1d7014(0x483,0x4fc)]:_0x1d7014(0x449,0x473),0x0,_0x5c0fd5)};}}async[_0x380dd0(-0xc0,-0xc4)](_0x38c032){function _0x47bc32(_0x445d35,_0x39cc1d){return _0x1e74(_0x39cc1d- -0x376,_0x445d35);}try{const response=await this[_0x47bc32(-0xac,-0xd9)]['delete']('/functions/v1/'+_0x38c032);return{'data':response['data'],'error':null};}catch(_0x3382f2){return{'data':null,'error':_0x3382f2 instanceof EBaaSError?_0x3382f2:new EBaaSError(_0x3382f2 instanceof Error?_0x3382f2['message']:_0x47bc32(-0x1e9,-0x18a),0x0,_0x3382f2)};}}async['updateEnv'](_0x594b44,_0xe478){function _0x41c9b6(_0x4d9736,_0x5b1321){return _0x1e74(_0x5b1321- -0xdd,_0x4d9736);}try{const response=await this['httpClient']['put'](_0x41c9b6(0x112,0x119)+_0x594b44+'/env',{'env':_0xe478});return{'data':response['data'],'error':null};}catch(_0x57bc0f){return{'data':null,'error':_0x57bc0f instanceof EBaaSError?_0x57bc0f:new EBaaSError(_0x57bc0f instanceof Error?_0x57bc0f[_0x41c9b6(0x11e,0x176)]:'Failed\x20to\x20update\x20function\x20environment',0x0,_0x57bc0f)};}}async[_0x380dd0(-0xc2,-0x5a)](_0x5e2b56,_0x453798){function _0x175ae8(_0x2cfb6a,_0x35485a){return _0x1e74(_0x35485a-0x1b7,_0x2cfb6a);}try{const _0x3a8bb9=new URLSearchParams();_0x453798?.['limit']&&_0x3a8bb9['append'](_0x175ae8(0x43d,0x445),String(_0x453798[_0x175ae8(0x463,0x445)]));_0x453798?.['offset']&&_0x3a8bb9['append'](_0x175ae8(0x4eb,0x488),String(_0x453798['offset']));_0x453798?.[_0x175ae8(0x3a6,0x3e9)]&&_0x3a8bb9[_0x175ae8(0x495,0x475)]('level',_0x453798[_0x175ae8(0x3a3,0x3e9)]);const _0x34f27b='/functions/v1/'+_0x5e2b56+'/logs'+(_0x3a8bb9['toString']()?'?'+_0x3a8bb9['toString']():''),response=await this['httpClient']['get'](_0x34f27b);return{'data':response['data'],'error':null};}catch(_0x20e6c7){return{'data':null,'error':_0x20e6c7 instanceof EBaaSError?_0x20e6c7:new EBaaSError(_0x20e6c7 instanceof Error?_0x20e6c7['message']:_0x175ae8(0x3d5,0x426),0x0,_0x20e6c7)};}}async[_0x380dd0(-0x81,-0x95)](_0x49e32e,_0x401668){function _0x37e201(_0x49a955,_0x50b610){return _0x1e74(_0x49a955- -0x59,_0x50b610);}try{const _0x4d7f4b=new URLSearchParams();_0x401668?.[_0x37e201(0x199,0x19e)]&&_0x4d7f4b['append']('period',_0x401668[_0x37e201(0x199,0x17e)]);const _0x487202='/functions/v1/'+_0x49e32e+'/metrics'+(_0x4d7f4b[_0x37e201(0x1a0,0x222)]()?'?'+_0x4d7f4b['toString']():''),response=await this[_0x37e201(0x244,0x1ff)]['get'](_0x487202);return{'data':response[_0x37e201(0x22b,0x258)],'error':null};}catch(_0x262438){return{'data':null,'error':_0x262438 instanceof EBaaSError?_0x262438:new EBaaSError(_0x262438 instanceof Error?_0x262438[_0x37e201(0x1fa,0x1ae)]:_0x37e201(0x1b9,0x169),0x0,_0x262438)};}}}class EBaaSClient{constructor(_0x2bd860,_0x5ac3c1,_0x410d79){this[_0x2759a4(0x42c,0x444)]=_0x410d79,this['httpClient']=new HttpClient({'url':_0x2bd860,'apiKey':_0x5ac3c1,'timeout':0x7530,'headers':_0x410d79?.['global']?.[_0x2759a4(0x404,0x428)]}),this[_0x2759a4(0x42d,0x489)]=new AuthClient(this[_0x2759a4(0x45f,0x49c)],_0x410d79?.['database']?.[_0x2759a4(0x516,0x4c9)]),this[_0x2759a4(0x3f3,0x456)]=new DatabaseClient(this['httpClient'],_0x410d79?.['database']?.[_0x2759a4(0x546,0x4c9)]),this['storage']=new StorageClient(this['httpClient']);function _0x2759a4(_0x23cadf,_0x14623e){return _0x1e74(_0x14623e-0x1ff,_0x23cadf);}this[_0x2759a4(0x38f,0x3d8)]=new RealtimeClient(_0x2bd860,_0x5ac3c1,_0x410d79?.[_0x2759a4(0x3a6,0x3d8)]),this['functions']=new FunctionsClient(this[_0x2759a4(0x47c,0x49c)]),this['initializeCustomDatabase']();}['from'](_0x4d73a4){function _0xcc23b2(_0x2953f8,_0x178c45){return _0x1e74(_0x178c45-0x1b3,_0x2953f8);}return this[_0xcc23b2(0x42f,0x40a)][_0xcc23b2(0x469,0x3e7)](_0x4d73a4);}[_0x380dd0(-0x60,-0xe2)](_0x3a45d0,_0x2d5682){function _0x1728d8(_0xc8d7ff,_0x1591ab){return _0x1e74(_0x1591ab-0xc1,_0xc8d7ff);}return this['database'][_0x1728d8(0x31c,0x31f)](_0x3a45d0,_0x2d5682);}[_0x380dd0(-0xdf,-0xd1)](_0x14b74c){function _0x3e6608(_0x563f61,_0x4adb5c){return _0x1e74(_0x563f61-0xc6,_0x4adb5c);}return this['storage'][_0x3e6608(0x2fa,0x2c0)](_0x14b74c);}['channel'](_0x438c0c){function _0x523d04(_0x291967,_0x37e2e2){return _0x1e74(_0x37e2e2-0x14,_0x291967);}return this[_0x523d04(0x174,0x1ed)][_0x523d04(0x2f0,0x290)](_0x438c0c);}['invoke'](_0x32662e,_0x41c7d2){return this['functions']['invoke'](_0x32662e,_0x41c7d2);}async[_0x380dd0(-0xbc,-0x79)](){function _0x42fae6(_0x2ac057,_0x2a6242){return _0x1e74(_0x2a6242- -0x25d,_0x2ac057);}if(this[_0x42fae6(-0xa,-0x18)]?.['database']?.['autoDetectCustomDatabase'])try{await this[_0x42fae6(-0x7c,-0x6)]['initialize']();}catch(_0x35c674){console['warn']('Failed to initialize custom database detection:',_0x35c674);}}async[_0x380dd0(-0x20,0x16)](_0xc135b1){function _0x53be49(_0x716094,_0x2c8b5f){return _0x1e74(_0x716094- -0x24a,_0x2c8b5f);}this['auth']['setWorkspaceId'](_0xc135b1),this[_0x53be49(0xd,-0x45)]['setWorkspaceId'](_0xc135b1),this['options']?.['database']?.['autoDetectCustomDatabase']&&await this[_0x53be49(0xd,0x60)]['initialize']();}async[_0x380dd0(-0x5c,-0x7f)](_0x17a54f){function _0x5bcb43(_0x8cbd1f,_0x362b8d){return _0x1e74(_0x8cbd1f-0x5f,_0x362b8d);}await this[_0x5bcb43(0x2b6,0x291)]['configureCustomDatabase'](_0x17a54f);}['getCustomDatabaseStatus'](){function _0x2ffb07(_0x40cf0c,_0x2e06ea){return _0x1e74(_0x40cf0c-0x1dd,_0x2e06ea);}return this['database'][_0x2ffb07(0x4a0,0x4d7)]();}}function createClient(_0x4ad928,_0x347026,_0x554284){return new EBaaSClient(_0x4ad928,_0x347026,_0x554284);}const version=_0x380dd0(-0x62,-0x62);exports[_0x380dd0(-0xc,0x20)]=AuthClient;function _0x380dd0(_0x3b5777,_0x578716){return _0x1e74(_0x3b5777- -0x2be,_0x578716);}exports['CustomDatabaseManager']=CustomDatabaseManager,exports[_0x380dd0(-0x8,-0x2e)]=DatabaseClient,exports[_0x380dd0(-0x87,-0x87)]=EBaaSClient,exports[_0x380dd0(-0xa4,-0x96)]=EBaaSError,exports[_0x380dd0(-0x26,-0x5)]=FunctionsClient,exports['HttpClient']=HttpClient,exports[_0x380dd0(-0xad,-0xa2)]=QueryBuilder,exports['RealtimeChannel']=RealtimeChannel,exports[_0x380dd0(-0x6,-0x39)]=RealtimeClient,exports['StorageBucket']=StorageBucket,exports['StorageClient']=StorageClient,exports[_0x380dd0(0x10,-0x50)]=createClient,exports[_0x380dd0(-0x99,-0x39)]=version;
1
+ 'use strict';(function(stringArrayFunction,comparisonValue){function _0x49b429(_0xba44bf,_0x14291f){return _0x40a5(_0x14291f-0xa,_0xba44bf);}const stringArray=stringArrayFunction();while(!![]){try{const _0x4c6688=parseInt(_0x49b429(0x1d6,0x196))/0x1+-parseInt(_0x49b429(0x10d,0x121))/0x2+-parseInt(_0x49b429(0x142,0x1b3))/0x3*(-parseInt(_0x49b429(0x148,0x133))/0x4)+-parseInt(_0x49b429(0xe6,0x12e))/0x5*(-parseInt(_0x49b429(0x59,0xb5))/0x6)+-parseInt(_0x49b429(0x18f,0x186))/0x7*(-parseInt(_0x49b429(0x14b,0xf3))/0x8)+parseInt(_0x49b429(0x8b,0x10a))/0x9+-parseInt(_0x49b429(0x12a,0x12d))/0xa;if(_0x4c6688===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x3430ed){stringArray['push'](stringArray['shift']());}}}(_0x134e,0xb4466));function _0x134e(){const _0x3e893e=['C2v0qxv0AfrVA2vU','Cg9ZDgDYzxnFy2HHBMDLCW','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','zgf0ywjHC2u','Aw1WB3j0twfW','DxbSB2fK','DxbKyxrLrgf0yq','l2f1DgGVDJeVDxnLCG','l2z1BMn0Aw9UCY92mq','zgf0yufYCMf5','y3vYCMvUDfnJAgvTyq','y2XPzw50','CgvYAw9K','Cg9YDa','zg93BMXVywq','zMLSzq','B25dB25Uzwn0Aw9Uu3rHDgvdAgfUz2u','Dg9WAwm','AxnezwXLDgu','zxjYB3i','rMfPBgvKihrVigXPC3qGzNvUy3rPB25Z','Cg9ZDgDYzxnvC2vYBMfTzq','C3rHDhvZvgv4Da','rMfPBgvKihrVigrLBgv0zsbMDw5JDgLVBG','y29UBMvJDa','C3bSAxq','B25bDxrOu3rHDgvdAgfUz2u','ChjLzMvY','ChjLC2vUy2u6','l2f1DgGVDJeVCMvMCMvZAa','p29WzxjHDgLVBJ1ZzwXLy3q','l3n0B3jHz2uVyNvJA2v0CY8','l21LDgfKyxrH','zw1PDa','y2HHBM5LBhm','AM9PBMLUzW','Bg9HzfnLC3nPB24','DgvZDenVBM5Ly3rPB24','ChjLC2vUy2u','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','lMfZyW','l2XVz3m','uMvHBhrPBwvdBgLLBNq','y2XLyxi','mtC4mZjKvNrdC1K','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','y2fWDhvYzvn0ywnRvhjHy2u','rujHyvnfCNjVCG','C2v0u2vZC2LVBKLUDgvYBMfS','l2zPBgvZl21VDMu','y3jLyxrLqNvJA2v0','BxvSDgLWyxj0l2zVCM0Tzgf0yq','CMvHBhrPBwu','y2fJAgvdB250CM9S','q3vZDg9Trgf0ywjHC2vnyw5Hz2vY','x2PVAw4','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','BhrL','AxndB25Uzwn0zwq','C2LNBK91Da','zNvUy3rPB25Z','AgfUzgXLrxjYB3i','l3n0B3jHz2uVyNvJA2v0CW','C3vIC3rYAw5N','C2v0DxbizwfYDgjLyxq','yMfZzvvsta','BgLTAxq','mtiYnJGXnZbcug9Vzvu','Cgf0Aa','CMvZCg9UC2u','CMvTB3zLqwXStgLZDgvUzxjZ','z2v0u3rHDhvZ','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','y29TBw9U','y3vYCMvUDfnLC3nPB24','CNbJ','CMvXDwvZDa','y29UBMvJDgvK','C29YDej5','vw5RBM93BIbLCNjVCG','DxjS','C2v0','y29SDw1U','Bg9N','qxv0AgvUDgLJyxrPB24GzMfPBgvK','zNjVBq','CxvLCNK','y3jLzgvUDgLHBhm','yNjVywrJyxn0','Bwv0Ag9K','mJq1mdGWnevut0Pzyq','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','AwXPA2u','l2zPBgvZ','zxHLy3v0zq','BwfW','DhjHBNnMB3jT','AgfZq3vZDg9Trgf0ywjHC2u','Cg9ZDa','DxbZzxj0','C2nOzw1H','zgf0yq','mty1otm4mZbxvxHvruG','mtq1rgrRy29z','l2zPBgvZlW','yM9KEq','B2zM','CMvTB3zLq2HHBM5LBa','nezfrxDxtW','ywnJzxnZx3rVA2vU','l2LUzM8','DxnL','zM9YrwfJAa','C2LNBLvW','x3jLAM9PBG','BgLZDa','C3rVCMfNzq','yNvJA2v0swq','C2vSzwn0','rujHyvndBgLLBNq','zgLZy29UBMvJDgvK','zgLZy29UBMvJDa','y29UBMvJDgLVBLn0yxrL','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','DgfIBgu','y29UzMLN','Aw5KzxGUDhm','AM9PBMvKt25Jzq','yxbPs2v5','y2XLyxjtzxnZAw9U','C2vHCMnO','CMfUz2u','DMvYAwz5','z2XVyMfS','y2XVC2vK','yxbWzw5K','Cg9ZDgDYzxneyxrHyMfZzq','yxnJzw5KAw5N','icHtDgf0Dxm6ia','qxv0AenSAwvUDa','x3rYAwDNzxi','zgvSzxrLt3b0Aw9UCW','l2rLCgXVEq','D29YA3nWywnLswq','l3n0B3jHz2uVDxnHz2u','rMfPBgvKihrVigDLDcbZDg9YywDLihvZywDL','AM9PBMvK','CMvWBgfJzq','C3rYAw5N','BwfRzvjLzG','zgvSzxrL','Aw52B2TL','C2v0v29YA3nWywnLswq','zxjYB3jLza','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','z2v0v29YA3nWywnLswq','y29Kzq','l2zPBgvZl2nVChK','Chv0','BMfTzq','B3bLCMf0B3i','D2vIC29JA2v0','l2z1BMn0Aw9UCY92ms8','Ahr0CenSAwvUDa','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','C2vZC2LVBG','DxbKyxrLt3b0Aw9UCW','CMvTB3zL','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','z2v0','B3jKzxi','AM9PBG','C29JA2v0','Bwv0ywrHDge','z2v0q2HHBM5LBhm','C2v0sxrLBq','z3rL','Ec10B3rHBc1JB3vUDa','BgvUz3rO','C2v0u2vZC2LVBG','rMfPBgvKihrVig1VDMuGzMLSzq','BwvZC2fNzq','z2v0tg9NCW','ChvZAa','CgfYC2u','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','zgv0zwn0zwrdB25MAwC','zxzLBNrLBwL0DgvYmW','BgLRzq','yxv0Aa','y29UDgvUDfr5Cgu','mJeZnxD2B25Zzq','AgvHzgvYCW','Dw5ZDwjZy3jPyMu','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','rNvUy3rPB25Zq2XPzw50','B3b0Aw9UCW','C3rHDgu','uMvHBhrPBwvdAgfUBMvS','u1vcu0nssujfra','C3rHCNrZv2L0Aa','CMvMCMvZAf90B2TLBG','rMfPBgvKihrVignVBM5Ly3qGywz0zxiG','CMvTB3zLqwXSq2HHBM5LBhm','CMvTB3zLq3vZDg9Trgf0ywjHC2u','C2LUz2XL','Cgf0y2G','odaYmZq3BM9ZteDt','AgfZ','B3bLCMf0Aw9U','C3vIC2nYAxb0Aw9UCW','p3vWC2vYDd10CNvL','zw52','DxnLCG','uhjLzMvY','u3rVCMfNzunSAwvUDa','BgvHDMLUzW','CMvJB25Uzwn0qxr0zw1WDhm','B25qB3n0z3jLC0nOyw5Nzxm','zgv0zwn0q3vZDg9Trgf0ywjHC2u','y2HHBM5LBa','DMvYC2LVBG','Aw50zxjJzxb0B3jZ','DhjHy2S','C2v0DxbjBNrLCMnLChrVCNm','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','CMvTB3zLqxv0AfrVA2vU','C29JA2v0lMLVlwnSAwvUDa','y29UBMvJDf9LCNjVCG','AgfUzgXLqxv0AevYCM9Y','C3nSrw5HyMXLza','z2v0rMLSzuLUzM8','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','zw50CMLLCW','B2zMC2v0','Cg9ZDgDYzxnty2HLBwe','mtmYnZGWme1sB1zrAa','q0HbtK5ftf9fuLjpuG','C3rHDhvZ','Dg9tDhjPBMC','DMfSDwu','nJKZnJzMAMftzhK','rgf0ywjHC2uGB3bLCMf0Aw9UigzHAwXLza','Dw50CMfJAW','C3rYAw5NAwz5','zxHLy3v0zvf1zxj5','l3nKAY92ms8','zMLSDgvYCW','rMfPBgvKihrVigrVD25SB2fKigzPBgu','CMvQzwn0','z2v0vxnHz2u','yNjVywrJyxn0oG','y29WEq','BMvX','CMfUzg9T','Aw5PDgLHBgL6zq','D2fYBG','Dg9ku09o','Dgv4Dc9WBgfPBG'];_0x134e=function(){return _0x3e893e;};return _0x134e();}var axios=require('axios'),socket_ioClient=require(_0x25280e(-0x8a,-0xb9)),EventEmitter=require(_0x25280e(-0xe5,-0xe1));class EBaaSError extends Error{constructor(_0x5a238b,status=0x0,_0x43802a){super(_0x5a238b);function _0x40a0ad(_0x42b88e,_0x5997e5){return _0x40a5(_0x5997e5- -0xe0,_0x42b88e);}this[_0x40a0ad(0x98,0x7c)]='EBaaSError',this[_0x40a0ad(0x15,-0x38)]=status,this['details']=_0x43802a,Error[_0x40a0ad(-0x11,0xb)]&&Error['captureStackTrace'](this,EBaaSError);}[_0x25280e(-0x1f7,-0x19e)](){function _0x26689e(_0x401014,_0x1f9035){return _0x40a5(_0x401014-0xe1,_0x1f9035);}return{'name':this[_0x26689e(0x23d,0x23f)],'message':this['message'],'status':this['status'],'details':this['details'],'stack':this['stack']};}['toString'](){function _0x13e5c5(_0x2f4a13,_0x46f373){return _0x40a5(_0x2f4a13- -0xc9,_0x46f373);}return this['name']+':\x20'+this['message']+_0x13e5c5(0x7e,0xc6)+this['status']+')';}}class HttpClient{constructor(config){this['baseURL']=config[_0x4a2e2e(0x496,0x4f6)],this[_0x4a2e2e(0x4c6,0x517)]=config['apiKey'];function _0x4a2e2e(_0x30f6e3,_0x9730e4){return _0x40a5(_0x30f6e3-0x389,_0x9730e4);}this[_0x4a2e2e(0x451,0x413)]=axios['create']({'baseURL':this['baseURL'],'timeout':config['timeout']||0x2710,'headers':{'Content-Type':'application/json','apikey':this[_0x4a2e2e(0x4c6,0x4a8)],...config[_0x4a2e2e(0x506,0x56b)]}}),this[_0x4a2e2e(0x526,0x4d5)]();}[_0x25280e(-0x105,-0xbc)](){function _0x17493a(_0x142600,_0x2957f9){return _0x40a5(_0x142600- -0x19d,_0x2957f9);}this['client'][_0x17493a(-0x2,0x72)][_0x17493a(-0x94,-0xea)][_0x17493a(-0x71,-0x56)](config=>{return config;},_0x95923=>{function _0x439600(_0x4e7f87,_0x2db9cc){return _0x40a5(_0x2db9cc-0x0,_0x4e7f87);}return Promise[_0x439600(0x10c,0xb3)](new EBaaSError('Request\x20failed',0x0,_0x95923));}),this['client'][_0x17493a(-0x2,-0x13)][_0x17493a(-0x9b,-0xcd)][_0x17493a(-0x71,-0x37)](response=>{return response;},_0x418f8f=>{const status=_0x418f8f[_0x2117bb(0xa6,0x109)]?.[_0x2117bb(0xf7,0xaf)]||0x0;function _0x2117bb(_0x2c1183,_0x24296a){return _0x40a5(_0x24296a-0x7,_0x2c1183);}const _0x1e63dd=_0x418f8f[_0x2117bb(0x131,0x109)]?.[_0x2117bb(0x165,0x129)]?.[_0x2117bb(0x199,0x179)]||_0x418f8f[_0x2117bb(0x1a3,0x179)]||_0x2117bb(0x129,0x113),_0x2aa733=_0x418f8f[_0x2117bb(0x8c,0x109)]?.[_0x2117bb(0x182,0x129)]||_0x418f8f;return Promise[_0x2117bb(0x4b,0xba)](new EBaaSError(_0x1e63dd,status,_0x2aa733));});}async['get'](_0x2ae5c2,config){function _0x5b0d6c(_0x21cf22,_0x20babe){return _0x40a5(_0x21cf22- -0x42,_0x20babe);}try{const response=await this['client'][_0x5b0d6c(0x124,0x1a2)](_0x2ae5c2,config);return{'data':response['data'],'status':response[_0x5b0d6c(0x66,0x36)],'statusText':response['statusText'],'headers':response[_0x5b0d6c(0x13b,0x1b1)]};}catch(_0xaadbd7){throw this[_0x5b0d6c(0xb8,0xf8)](_0xaadbd7);}}async['post'](_0x47bc9e,data,config){function _0x22b149(_0x14e8c1,_0x5c9780){return _0x40a5(_0x14e8c1- -0x36a,_0x5c9780);}try{const response=await this['client'][_0x22b149(-0x24b,-0x1fe)](_0x47bc9e,data,config);return{'data':response[_0x22b149(-0x248,-0x203)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x27877c){throw this['handleError'](_0x27877c);}}async['put'](_0x2bdeb0,data,config){function _0x51a1ba(_0x1bbc01,_0x5774af){return _0x40a5(_0x5774af-0xa6,_0x1bbc01);}try{const response=await this[_0x51a1ba(0x15b,0x16e)]['put'](_0x2bdeb0,data,config);return{'data':response['data'],'status':response['status'],'statusText':response[_0x51a1ba(0x1a8,0x179)],'headers':response[_0x51a1ba(0x265,0x223)]};}catch(_0x150b8c){throw this['handleError'](_0x150b8c);}}async['patch'](_0x5ea9d4,data,config){function _0x3e3a04(_0x4c6318,_0x2fa27d){return _0x40a5(_0x4c6318- -0x2eb,_0x2fa27d);}try{const response=await this[_0x3e3a04(-0x223,-0x261)][_0x3e3a04(-0x160,-0xe2)](_0x5ea9d4,data,config);return{'data':response[_0x3e3a04(-0x1c9,-0x15d)],'status':response[_0x3e3a04(-0x243,-0x277)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x11e350){throw this[_0x3e3a04(-0x1f1,-0x209)](_0x11e350);}}async[_0x25280e(-0xc4,-0x106)](_0x401237,config){function _0x3347a5(_0xf359db,_0x19a53e){return _0x40a5(_0xf359db- -0xc1,_0x19a53e);}try{const response=await this['client']['delete'](_0x401237,config);return{'data':response['data'],'status':response[_0x3347a5(-0x19,0x2)],'statusText':response[_0x3347a5(0x12,0x7)],'headers':response['headers']};}catch(_0x14aba5){throw this[_0x3347a5(0x39,-0x30)](_0x14aba5);}}['setAuthToken'](_0x28e5e2){function _0x3fcf57(_0x4b9829,_0x5d9c9d){return _0x40a5(_0x4b9829-0x357,_0x5d9c9d);}this[_0x3fcf57(0x41f,0x3d5)]['defaults'][_0x3fcf57(0x4d4,0x52a)]['common']['Authorization']='Bearer\x20'+_0x28e5e2;}[_0x25280e(-0x12e,-0xba)](){function _0x478b3f(_0x2dae92,_0x176ba8){return _0x40a5(_0x176ba8-0x310,_0x2dae92);}delete this[_0x478b3f(0x37b,0x3d8)]['defaults']['headers'][_0x478b3f(0x480,0x416)]['Authorization'],this[_0x478b3f(0x413,0x3d8)]['defaults'][_0x478b3f(0x436,0x48d)]['common']['Authorization']='Bearer\x20'+this['apiKey'];}[_0x25280e(-0x17a,-0x15f)](_0x3d15e6){if(_0x3d15e6 instanceof EBaaSError)return _0x3d15e6;return new EBaaSError(_0x3d15e6['message']||'HTTP\x20request\x20failed',_0x3d15e6['status']||0x0,_0x3d15e6);}}class AuthClient{constructor(_0x223356,_0xc9320){this[_0x1e5390(0x387,0x336)]=null,this['httpClient']=_0x223356;function _0x1e5390(_0x7b22e2,_0x3da5cc){return _0x40a5(_0x3da5cc-0x22f,_0x7b22e2);}this[_0x1e5390(0x3f4,0x37b)]=_0xc9320,this['loadSession']();}async[_0x25280e(-0x14b,-0x12b)](data){function _0x3948aa(_0x4e04f5,_0x3f6481){return _0x40a5(_0x3f6481- -0x149,_0x4e04f5);}try{const response=await this[_0x3948aa(-0x31,0x17)][_0x3948aa(-0x48,-0x2a)]('/auth/v1/signup',data);return response['data']['session']&&this['setSessionInternal'](response[_0x3948aa(-0x3,-0x27)][_0x3948aa(0x8,0x19)]),response[_0x3948aa(-0x49,-0x27)];}catch(_0x327bae){throw this[_0x3948aa(0x8d,0x59)](_0x327bae);}}async['signIn'](data){function _0x5be6d4(_0x2a043c,_0x3722f2){return _0x40a5(_0x3722f2-0x37c,_0x2a043c);}try{const headers={};this[_0x5be6d4(0x513,0x4c8)]&&(headers['X-Workspace-ID']=this['workspaceId']);const response=await this[_0x5be6d4(0x536,0x4dc)]['post']('/auth/v1/sdk/signin',data,{'headers':headers});return response[_0x5be6d4(0x4f5,0x49e)][_0x5be6d4(0x508,0x4de)]&&this[_0x5be6d4(0x3ec,0x469)](response['data']['session']),response[_0x5be6d4(0x50e,0x49e)];}catch(_0x58ee43){throw this[_0x5be6d4(0x57b,0x51e)](_0x58ee43);}}async[_0x25280e(-0x1b8,-0x161)](){function _0x43c2dc(_0x477b45,_0x80c341){return _0x40a5(_0x80c341-0x37e,_0x477b45);}try{await this[_0x43c2dc(0x4bc,0x4de)]['post']('/auth/v1/signout'),this['clearSession']();}catch(_0x399e08){this[_0x43c2dc(0x497,0x4bc)]();throw this['handleAuthError'](_0x399e08);}}async['getUser'](){if(!this['currentSession']?.['access_token'])return null;function _0x15e1bc(_0x150a6e,_0x4f3264){return _0x40a5(_0x4f3264- -0xeb,_0x150a6e);}try{const response=await this[_0x15e1bc(0xa,0x75)]['get'](_0x15e1bc(0x29,-0x27));return response['data']['user'];}catch(_0x3d36f6){if(_0x3d36f6 instanceof EBaaSError&&_0x3d36f6['status']===0x191)return this[_0x15e1bc(0x50,0x53)](),null;throw this['handleAuthError'](_0x3d36f6);}}async['refreshSession'](){if(!this[_0x4d2e84(-0xe4,-0xc1)]?.[_0x4d2e84(-0x65,-0x28)])return null;function _0x4d2e84(_0x513b8b,_0x150a3a){return _0x40a5(_0x513b8b- -0x1eb,_0x150a3a);}try{const response=await this[_0x4d2e84(-0x8b,-0xdc)]['post'](_0x4d2e84(-0x111,-0x123),{'refresh_token':this[_0x4d2e84(-0xe4,-0x12c)][_0x4d2e84(-0x65,0x6)]});if(response['data']['session'])return this[_0x4d2e84(-0x7b,-0x7c)](response['data']['session']),response[_0x4d2e84(-0xc9,-0x4d)][_0x4d2e84(-0x89,-0x7c)];return null;}catch(_0x2885f5){this['clearSession']();throw this['handleAuthError'](_0x2885f5);}}async['resetPassword'](_0x419f75){function _0x26b43b(_0x2f04a4,_0x376287){return _0x40a5(_0x376287-0x18e,_0x2f04a4);}try{await this[_0x26b43b(0x2c0,0x2ee)][_0x26b43b(0x310,0x2ad)]('/auth/v1/reset-password',{'email':_0x419f75});}catch(_0x5cccc3){throw this[_0x26b43b(0x2bc,0x330)](_0x5cccc3);}}async['updateUser'](data){function _0x41f774(_0x3338b8,_0x1d1b0a){return _0x40a5(_0x3338b8- -0x208,_0x1d1b0a);}try{const response=await this[_0x41f774(-0xa8,-0x50)][_0x41f774(-0xad,-0xd9)]('/auth/v1/user',data);return response[_0x41f774(-0xe6,-0x14a)][_0x41f774(-0x76,-0xdc)];}catch(_0x14bbe6){throw this[_0x41f774(-0x66,-0x6d)](_0x14bbe6);}}['getSession'](){function _0x15accd(_0x5aa027,_0x54a1ab){return _0x40a5(_0x54a1ab- -0x264,_0x5aa027);}return this[_0x15accd(-0x1ab,-0x15d)];}[_0x25280e(-0xa3,-0xe9)](_0x2abe77){function _0x126b8e(_0x169b1b,_0x5766bb){return _0x40a5(_0x5766bb-0xc7,_0x169b1b);}this['currentSession']=_0x2abe77,this['httpClient']['setAuthToken'](_0x2abe77[_0x126b8e(0x1eb,0x1f1)]),typeof localStorage!=='undefined'&&localStorage[_0x126b8e(0x27d,0x233)]('ebaas.auth.session',JSON['stringify'](_0x2abe77));}[_0x25280e(-0x157,-0x182)](_0x2ab750){return()=>{};}[_0x25280e(-0xf5,-0x104)](_0x3d3573){function _0x32bc74(_0x1f5943,_0x1b8d6c){return _0x40a5(_0x1b8d6c- -0x2b3,_0x1f5943);}this[_0x32bc74(-0x1e4,-0x167)]=_0x3d3573;}['setSessionInternal'](_0x5136d2){function _0x269e16(_0x3a9341,_0x3398ba){return _0x40a5(_0x3398ba- -0x3a4,_0x3a9341);}this['currentSession']=_0x5136d2,this['httpClient'][_0x269e16(-0x277,-0x2e7)](_0x5136d2['access_token']),typeof localStorage!=='undefined'&&localStorage['setItem']('ebaas.auth.session',JSON['stringify'](_0x5136d2));}[_0x25280e(-0xe0,-0x11b)](){this[_0x4f63c4(-0x14f,-0xfb)]=null;function _0x4f63c4(_0x57de62,_0x18e223){return _0x40a5(_0x57de62- -0x256,_0x18e223);}this[_0x4f63c4(-0xf6,-0x140)]['removeAuthToken'](),typeof localStorage!=='undefined'&&localStorage['removeItem']('ebaas.auth.session');}[_0x25280e(-0x11d,-0x178)](){function _0x5a6feb(_0xa089fc,_0x5345d3){return _0x40a5(_0xa089fc- -0xe9,_0x5345d3);}if(typeof localStorage!=='undefined'){const _0x2603aa=localStorage['getItem']('ebaas.auth.session');if(_0x2603aa)try{const _0x105e86=JSON['parse'](_0x2603aa);this[_0x5a6feb(0x4,-0x53)](_0x105e86);}catch(_0x1423b6){this[_0x5a6feb(0x55,0x2)]();}}}['handleAuthError'](_0x49ad99){function _0x65d6f1(_0x539eec,_0x3468dd){return _0x40a5(_0x539eec- -0x321,_0x3468dd);}if(_0x49ad99 instanceof EBaaSError)return _0x49ad99;return new EBaaSError(_0x49ad99['message']||_0x65d6f1(-0x210,-0x1ff),_0x49ad99['status']||0x0,_0x49ad99);}}class QueryBuilder{constructor(_0x16ca72,_0x2fbf93,_0x5430d0,_0x38fa49){this[_0x49c47f(0x492,0x469)]=_0x16ca72,this['table']=_0x2fbf93,this[_0x49c47f(0x453,0x4a9)]=_0x5430d0,this['workspaceId']=_0x38fa49;function _0x49c47f(_0x32d4ab,_0x154c29){return _0x40a5(_0x32d4ab-0x332,_0x154c29);}this['query']={'filters':[]};}['select'](_0x215a0a='*',_0x300302){return this['query']['select']=_0x215a0a,this;}['insert'](data,_0x1dcd2c){return this['executeQuery']('POST','/sdk/v1/'+this['table']+'?operation=insert',{'data':data,'options':_0x1dcd2c});}['update'](data,_0x58d304){this[_0x299994(-0xa1,-0x11d)]['updateData']=data,this[_0x299994(-0xa1,-0xe8)][_0x299994(-0x51,-0xb7)]=_0x58d304;function _0x299994(_0x3e25c8,_0xa34d4b){return _0x40a5(_0x3e25c8- -0x1b4,_0xa34d4b);}return this;}[_0x25280e(-0x134,-0x139)](data,_0x1100e8){function _0x3e3e56(_0x25eac3,_0x5e2d6b){return _0x40a5(_0x5e2d6b- -0x1b5,_0x25eac3);}return this['executeQuery']('POST',_0x3e3e56(-0x171,-0x105)+this['table']+'?operation=upsert',{'data':data,'options':{..._0x1100e8,'upsert':!![]}});}[_0x25280e(-0xdf,-0x106)](_0x2558f5){this['query']['deleteOptions']=_0x2558f5;function _0x185ccf(_0x2fe08e,_0x4c4042){return _0x40a5(_0x2fe08e-0xe1,_0x4c4042);}return this[_0x185ccf(0x1f4,0x1ef)][_0x185ccf(0x1b0,0x20e)]=!![],this;}['eq'](_0x2c4655,_0x35c5ef){this[_0x3672e4(0x257,0x1ef)][_0x3672e4(0x142,0x18d)]['push']({'column':_0x2c4655,'operator':'eq','value':_0x35c5ef});function _0x3672e4(_0x598fd8,_0x3559cc){return _0x40a5(_0x3559cc-0xdc,_0x598fd8);}return this;}['neq'](_0xa7686c,_0x5e0f35){function _0x5467f8(_0x2149d5,_0x1a4c31){return _0x40a5(_0x2149d5-0x2a1,_0x1a4c31);}return this['query'][_0x5467f8(0x352,0x303)]['push']({'column':_0xa7686c,'operator':_0x5467f8(0x358,0x38d),'value':_0x5e0f35}),this;}['gt'](_0x533bf2,_0x40119d){this[_0x33d55e(0x2e1,0x316)]['filters'][_0x33d55e(0x342,0x38c)]({'column':_0x533bf2,'operator':'gt','value':_0x40119d});function _0x33d55e(_0xfea0fc,_0x3313d1){return _0x40a5(_0xfea0fc-0x1ce,_0x3313d1);}return this;}['gte'](_0x4d2b04,_0x3248d8){this['query']['filters'][_0x3b7126(0x417,0x3b7)]({'column':_0x4d2b04,'operator':_0x3b7126(0x410,0x402),'value':_0x3248d8});function _0x3b7126(_0x1134bc,_0x5db648){return _0x40a5(_0x1134bc-0x2a3,_0x5db648);}return this;}['lt'](_0x1154d1,_0xed8296){function _0xff88ec(_0x1995c7,_0x5a0cb0){return _0x40a5(_0x1995c7-0x2a7,_0x5a0cb0);}return this['query'][_0xff88ec(0x358,0x387)]['push']({'column':_0x1154d1,'operator':'lt','value':_0xed8296}),this;}[_0x25280e(-0xff,-0x163)](_0x371c04,_0x4d9602){function _0x5320ae(_0x567bb8,_0x1936ba){return _0x40a5(_0x1936ba- -0x7,_0x567bb8);}return this['query'][_0x5320ae(0x86,0xaa)][_0x5320ae(0x12a,0x16d)]({'column':_0x371c04,'operator':_0x5320ae(0x87,0xef),'value':_0x4d9602}),this;}['like'](_0x5ee8fa,_0x3045a4){function _0x11f301(_0x4f3ad6,_0xcd585f){return _0x40a5(_0xcd585f-0x158,_0x4f3ad6);}return this[_0x11f301(0x24b,0x26b)]['filters'][_0x11f301(0x283,0x2cc)]({'column':_0x5ee8fa,'operator':_0x11f301(0x331,0x2d1),'value':_0x3045a4}),this;}[_0x25280e(-0xcd,-0x140)](_0x4deb1f,_0x4ff5c1){function _0x40c13b(_0x44ce14,_0x5435fb){return _0x40a5(_0x44ce14- -0x13e,_0x5435fb);}return this[_0x40c13b(-0x2b,-0x23)]['filters'][_0x40c13b(0x36,0x80)]({'column':_0x4deb1f,'operator':_0x40c13b(-0x25,-0x2b),'value':_0x4ff5c1}),this;}['is'](_0x4e6df1,_0x59818b){this[_0x480146(0x15b,0x11a)]['filters']['push']({'column':_0x4e6df1,'operator':'is','value':_0x59818b});function _0x480146(_0x233c66,_0x95399f){return _0x40a5(_0x95399f-0x7,_0x233c66);}return this;}['in'](_0x2dd142,_0x3e02fb){function _0x200de8(_0x28a759,_0x249bb6){return _0x40a5(_0x249bb6-0xa9,_0x28a759);}return this[_0x200de8(0x1ed,0x1bc)][_0x200de8(0x1a0,0x15a)]['push']({'column':_0x2dd142,'operator':'in','value':_0x3e02fb}),this;}['contains'](_0x2f0e1c,_0x56a487){function _0x23fccd(_0x19a513,_0x4bc5f1){return _0x40a5(_0x4bc5f1- -0x2e5,_0x19a513);}return this[_0x23fccd(-0x181,-0x1d2)]['filters']['push']({'column':_0x2f0e1c,'operator':'contains','value':_0x56a487}),this;}['match'](_0xbcddf5){Object['entries'](_0xbcddf5)[_0x4a8cbf(0x21d,0x1a5)](([_0x4b1998,_0x479680])=>{this['eq'](_0x4b1998,_0x479680);});function _0x4a8cbf(_0xd42e9,_0x4342e7){return _0x40a5(_0x4342e7-0x78,_0xd42e9);}return this;}['order'](_0x34ccb5,_0x231746){!this[_0x502442(-0x158,-0x128)][_0x502442(-0x104,-0xcc)]&&(this['query'][_0x502442(-0x104,-0xf7)]=[]);this['query']['order']['push']({'column':_0x34ccb5,'ascending':_0x231746?.[_0x502442(-0x125,-0x185)]!==![]});function _0x502442(_0x45efb5,_0x349baa){return _0x40a5(_0x45efb5- -0x26b,_0x349baa);}return this;}['limit'](count){return this['query']['limit']=count,this;}[_0x25280e(-0xe7,-0x119)](from,_0xf14f4){this[_0x1af883(0x437,0x3fb)]['range']={'from':from,'to':_0xf14f4};function _0x1af883(_0x4f9ac9,_0x393c68){return _0x40a5(_0x393c68-0x2e8,_0x4f9ac9);}return this;}async[_0x25280e(-0x109,-0x13e)](){function _0x162e5e(_0x31179f,_0x22b733){return _0x40a5(_0x22b733- -0x3cc,_0x31179f);}if(this['query'][_0x162e5e(-0x289,-0x309)])return this['executeQuery']('PATCH',_0x162e5e(-0x2d0,-0x31c)+this[_0x162e5e(-0x264,-0x293)],{'data':this[_0x162e5e(-0x28f,-0x2b9)]['updateData'],'options':this[_0x162e5e(-0x2cd,-0x2b9)]['updateOptions'],'filters':this['query'][_0x162e5e(-0x373,-0x31b)]});else return this['query'][_0x162e5e(-0x29d,-0x2fd)]?this[_0x162e5e(-0x2a9,-0x31d)]('DELETE',_0x162e5e(-0x29f,-0x31c)+this[_0x162e5e(-0x2d7,-0x293)]+'?operation=delete',{'options':this['query'][_0x162e5e(-0x250,-0x282)],'filters':this['query']['filters']}):this['executeQuery']('GET','/sdk/v1/'+this[_0x162e5e(-0x23a,-0x293)]+_0x162e5e(-0x2b2,-0x2f1),{'select':this[_0x162e5e(-0x2e7,-0x2b9)][_0x162e5e(-0x254,-0x299)],'filters':this['query']['filters'],'order':this[_0x162e5e(-0x2db,-0x2b9)]['order'],'limit':this['query']['limit'],'range':this[_0x162e5e(-0x2b5,-0x2b9)][_0x162e5e(-0x2bf,-0x28c)]});}async[_0x25280e(-0x124,-0xcf)](){this[_0x3e702a(0x499,0x4fe)](0x1);function _0x3e702a(_0x2820e5,_0x3373fc){return _0x40a5(_0x2820e5-0x39a,_0x3373fc);}const result=await this[_0x3e702a(0x4b5,0x4de)]();return{'data':result[_0x3e702a(0x4bc,0x4bf)]?.[0x0]||null,'error':result['error']};}async[_0x25280e(-0x137,-0x1aa)](_0x432a58,_0x3d9ae2,_0x292a73){function _0x3f0beb(_0x4475fd,_0x35fa04){return _0x40a5(_0x4475fd-0x3e4,_0x35fa04);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this['workspaceId']);if(_0x432a58==='GET'){const _0x2e9f7b=_0x3d9ae2['split']('?'),_0x251a01=_0x2e9f7b[0x0],existingParams=new URLSearchParams(_0x2e9f7b[0x1]||'');if(_0x292a73[_0x3f0beb(0x517,0x54c)])existingParams[_0x3f0beb(0x528,0x4c1)]('select',_0x292a73['select']);_0x292a73['filters']?.['length']&&_0x292a73[_0x3f0beb(0x495,0x4ca)]['forEach'](filter=>{function _0x55d1cb(_0x54cff4,_0x56a3e3){return _0x40a5(_0x54cff4-0x3c9,_0x56a3e3);}existingParams[_0x55d1cb(0x50d,0x4af)](filter['column'],filter[_0x55d1cb(0x526,0x4d1)]+'.'+filter['value']);});if(_0x292a73['order']?.[_0x3f0beb(0x553,0x502)]){const orderStr=_0x292a73[_0x3f0beb(0x54b,0x563)][_0x3f0beb(0x500,0x52f)](_0x32481f=>''+_0x32481f['column']+(_0x32481f['ascending']?_0x3f0beb(0x4c9,0x4c2):'.desc'))['join'](',');existingParams['append']('order',orderStr);}if(_0x292a73['limit'])existingParams[_0x3f0beb(0x528,0x589)]('limit',_0x292a73[_0x3f0beb(0x4e3,0x483)]['toString']());_0x292a73[_0x3f0beb(0x524,0x4f5)]&&(existingParams['append'](_0x3f0beb(0x58b,0x524),_0x292a73['range']['from']['toString']()),existingParams[_0x3f0beb(0x528,0x599)]('limit',(_0x292a73['range']['to']-_0x292a73[_0x3f0beb(0x524,0x587)][_0x3f0beb(0x4f6,0x4de)]+0x1)[_0x3f0beb(0x48d,0x4cf)]())),response=await this['httpClient']['get'](_0x251a01+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x432a58==='DELETE'){const _0x87ea93=_0x3d9ae2[_0x3f0beb(0x4ba,0x51f)]('?'),_0xc67464=_0x87ea93[0x0],existingParams=new URLSearchParams(_0x87ea93[0x1]||'');!existingParams['has'](_0x3f0beb(0x572,0x4fd))&&existingParams[_0x3f0beb(0x528,0x581)]('operation','delete');_0x292a73['filters']?.['length']&&_0x292a73[_0x3f0beb(0x495,0x4b6)]['forEach'](filter=>{function _0x4b7dcd(_0x5dad64,_0x525428){return _0x40a5(_0x5dad64- -0x1a0,_0x525428);}existingParams[_0x4b7dcd(-0x5c,0x21)](filter[_0x4b7dcd(-0x91,-0x7f)],filter[_0x4b7dcd(-0x43,0xe)]+'.'+filter['value']);});const deleteUrl=_0xc67464+'?'+existingParams['toString']();console[_0x3f0beb(0x4f4,0x4d6)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console[_0x3f0beb(0x4f4,0x4fc)]('\uD83D\uDD27 DELETE headers:',headers),console[_0x3f0beb(0x4f4,0x514)]('\uD83D\uDD27 DELETE filtros originais:',_0x292a73['filters']),response=await this['httpClient']['delete'](deleteUrl,{'headers':headers});}else{if(_0x432a58==='PATCH'){const _0x1d04ec=_0x3d9ae2[_0x3f0beb(0x4ba,0x4ea)]('?'),_0xd7979a=_0x1d04ec[0x0],existingParams=new URLSearchParams(_0x1d04ec[0x1]||'');!existingParams[_0x3f0beb(0x571,0x565)]('operation')&&existingParams[_0x3f0beb(0x528,0x4ea)]('operation','update');_0x292a73[_0x3f0beb(0x495,0x460)]?.['length']&&_0x292a73['filters']['forEach'](filter=>{function _0x93e997(_0x229dc6,_0x30639f){return _0x40a5(_0x229dc6- -0x38a,_0x30639f);}existingParams[_0x93e997(-0x246,-0x1fa)](filter[_0x93e997(-0x27b,-0x217)],filter['operator']+'.'+filter[_0x93e997(-0x2e0,-0x275)]);});_0x292a73['options']?.[_0x3f0beb(0x4bc,0x473)]&&(headers['Prefer']=_0x292a73['options'][_0x3f0beb(0x4bc,0x479)]);const updateUrl=_0xd7979a+'?'+existingParams[_0x3f0beb(0x48d,0x434)]();response=await this[_0x3f0beb(0x544,0x580)][_0x3f0beb(0x56f,0x53f)](updateUrl,_0x292a73[_0x3f0beb(0x506,0x4cc)],{'headers':headers});}else{let _0x29a1b8=_0x292a73['data'];!headers[_0x3f0beb(0x577,0x591)]&&(headers[_0x3f0beb(0x577,0x564)]='return=representation'),_0x292a73['options']?.[_0x3f0beb(0x504,0x52b)]&&(headers[_0x3f0beb(0x577,0x555)]=_0x3f0beb(0x4a3,0x43f)),_0x292a73[_0x3f0beb(0x4aa,0x4ca)]&&(_0x29a1b8=_0x292a73[_0x3f0beb(0x4aa,0x46f)]),response=await this[_0x3f0beb(0x544,0x50a)][_0x3f0beb(0x503,0x483)](_0x3d9ae2,_0x29a1b8,{'headers':headers});}}}return{'data':response[_0x3f0beb(0x506,0x4a1)],'error':null,'count':response[_0x3f0beb(0x561,0x5ab)]?.[_0x3f0beb(0x552,0x52d)]?parseInt(response[_0x3f0beb(0x561,0x543)]['x-total-count']):undefined};}catch(_0x1618ef){return{'data':null,'error':_0x1618ef instanceof EBaaSError?_0x1618ef:new EBaaSError(_0x1618ef instanceof Error?_0x1618ef['message']:_0x3f0beb(0x490,0x472),0x0,_0x1618ef)};}}}class CustomDatabaseManager{constructor(_0x2d7e2f,_0x2f8f43){this['httpClient']=_0x2d7e2f,this['workspaceId']=_0x2f8f43;}async['detectCustomDatabase'](){if(!this[_0x520909(-0x12,-0x69)])return{'hasCustomDatabase':![]};function _0x520909(_0x1c26d3,_0x4ba08c){return _0x40a5(_0x1c26d3- -0x15e,_0x4ba08c);}try{const response=await this['httpClient']['get']('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this[_0x520909(-0x12,0x6d)]}});if(response['status']===0xc8&&response[_0x520909(-0x3c,-0x72)]?.['config']){const config=response['data']['config'],_0x10c63e={'host':config['postgresHost'],'port':config['postgresPort'],'database':config[_0x520909(-0x19,-0x47)],'username':config[_0x520909(-0x8c,-0x87)],'password':'','schema':config[_0x520909(0x4a,0xb2)],'sslEnabled':config[_0x520909(0x45,0x3d)]};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x10c63e},this['detectedConfig'];}}catch(_0x2a555a){if(_0x2a555a?.['status']===0x194)return this['detectedConfig']={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x2a555a);}return this[_0x520909(0x19,0x3a)]={'hasCustomDatabase':![]},this['detectedConfig'];}async[_0x25280e(-0x133,-0x177)](_0x45239e){function _0x2e98a8(_0x3ebec7,_0x8d6ea5){return _0x40a5(_0x8d6ea5-0xf,_0x3ebec7);}try{const response=await this[_0x2e98a8(0x168,0x16f)][_0x2e98a8(0xeb,0x12e)]('/admin/v1/workspace/custom-database/test-connection',_0x45239e,{'headers':this[_0x2e98a8(0x14e,0x15b)]?{'X-Workspace-ID':this['workspaceId']}:{}});return response['data'];}catch(_0x140f67){return{'success':![],'message':_0x140f67?.['message']||_0x2e98a8(0x115,0x104)};}}async['configureCustomDatabase'](_0x29cc21){if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');const response=await this['httpClient'][_0x1fd23e(0x209,0x1bf)]('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x29cc21},{'headers':{'X-Workspace-ID':this['workspaceId']}}),config=response[_0x1fd23e(0x23c,0x1c2)][_0x1fd23e(0x1db,0x1da)];this[_0x1fd23e(0x1bc,0x217)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x29cc21};function _0x1fd23e(_0xec9997,_0x437e5f){return _0x40a5(_0x437e5f-0xa0,_0xec9997);}return config;}async['removeCustomDatabase'](){function _0x47e035(_0x17322a,_0x38fac9){return _0x40a5(_0x38fac9-0x341,_0x17322a);}if(!this[_0x47e035(0x420,0x48d)])throw new Error('Workspace ID is required to remove custom database');await this[_0x47e035(0x42a,0x4a1)][_0x47e035(0x4cc,0x494)]('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this['workspaceId']}}),this[_0x47e035(0x4d5,0x4b8)]={'hasCustomDatabase':![]};}['getDetectedConfig'](){function _0x25a37e(_0x83eecf,_0x281250){return _0x40a5(_0x281250-0x3cf,_0x83eecf);}return this[_0x25a37e(0x4f3,0x546)];}[_0x25280e(-0x15d,-0x13b)](){function _0x296c6c(_0x104ec6,_0x5ddf22){return _0x40a5(_0x104ec6-0x258,_0x5ddf22);}return this[_0x296c6c(0x3cf,0x3b3)]?.['hasCustomDatabase']??![];}['getCustomCredentials'](){return this['detectedConfig']?.['credentials'];}['setWorkspaceId'](_0x4c549b){this[_0x3d83dd(-0x2f3,-0x28a)]=_0x4c549b;function _0x3d83dd(_0x5d4d16,_0x516abe){return _0x40a5(_0x516abe- -0x3d6,_0x5d4d16);}this['detectedConfig']=undefined;}[_0x25280e(-0xad,-0x101)](){return this['workspaceId'];}['getStatus'](){function _0x5e3f7c(_0xe696e3,_0x1ad6a1){return _0x40a5(_0xe696e3-0x1c5,_0x1ad6a1);}return{'workspaceId':this[_0x5e3f7c(0x311,0x2b2)],'hasConfig':this[_0x5e3f7c(0x2e3,0x2e8)](),'configDetails':this['detectedConfig']?.[_0x5e3f7c(0x2d9,0x2b0)]?{'host':this[_0x5e3f7c(0x33c,0x354)]['credentials']['host'],'port':this[_0x5e3f7c(0x33c,0x32d)][_0x5e3f7c(0x2d9,0x287)][_0x5e3f7c(0x28f,0x257)],'database':this['detectedConfig']['credentials']['database'],'schema':this['detectedConfig']['credentials']['schema']||'public','sslEnabled':this[_0x5e3f7c(0x33c,0x3a0)]['credentials']['sslEnabled']||![]}:undefined};}}class DatabaseClient{constructor(_0x165e1a,_0x2e8aff){this['httpClient']=_0x165e1a,this['customDatabaseManager']=new CustomDatabaseManager(_0x165e1a,_0x2e8aff);}['from'](_0x44c680){function _0x4d1a98(_0x27e12f,_0x240bc7){return _0x40a5(_0x240bc7-0x36,_0x27e12f);}return new QueryBuilder(this[_0x4d1a98(0x1e8,0x196)],_0x44c680,this[_0x4d1a98(0xce,0xfd)],this['customDatabaseManager'][_0x4d1a98(0x17e,0x18e)]());}['rpc'](_0x360815,_0x475b15){function _0x4751e9(_0x1ed588,_0x2b5999){return _0x40a5(_0x1ed588- -0x114,_0x2b5999);}return this['httpClient'][_0x4751e9(0xb,0x76)]('/rpc/'+_0x360815,_0x475b15);}['schema'](_0x2b8130){const _0xf0a791=new DatabaseClient(this['httpClient'],this[_0x500513(0x33d,0x38e)][_0x500513(0x45d,0x402)]());_0xf0a791[_0x500513(0x320,0x371)]=_0x2b8130;function _0x500513(_0x157032,_0x647599){return _0x40a5(_0x647599-0x2aa,_0x157032);}return _0xf0a791['customDatabaseManager']=this[_0x500513(0x375,0x38e)],_0xf0a791;}async[_0x25280e(-0x50,-0xc1)](){function _0x74744e(_0x1f4db4,_0x2da3a9){return _0x40a5(_0x2da3a9- -0x2d9,_0x1f4db4);}return this['customDatabaseManager'][_0x74744e(-0x105,-0x141)]();}async['testCustomConnection'](_0x5d891){function _0x57c197(_0x1d9cbb,_0x1d33c4){return _0x40a5(_0x1d33c4- -0x32,_0x1d9cbb);}return this[_0x57c197(0x39,0xb2)][_0x57c197(0x81,0xb0)](_0x5d891);}async[_0x25280e(-0x158,-0x16f)](_0x198bf1){return this['customDatabaseManager']['configureCustomDatabase'](_0x198bf1);}async[_0x25280e(-0x137,-0xd0)](){function _0x19e4fd(_0xbbe755,_0x24c6de){return _0x40a5(_0xbbe755-0xa1,_0x24c6de);}return this[_0x19e4fd(0x185,0x1b7)]['removeCustomDatabase']();}['isUsingCustomDatabase'](){function _0x33e922(_0x5c3a8f,_0x55648a){return _0x40a5(_0x5c3a8f- -0x264,_0x55648a);}return this[_0x33e922(-0x180,-0x184)]['hasCustomDatabase']();}[_0x25280e(-0x135,-0x121)](){function _0x140970(_0xcc5c41,_0x501250){return _0x40a5(_0x501250- -0x2f0,_0xcc5c41);}return this[_0x140970(-0x247,-0x20c)][_0x140970(-0x1ac,-0x1ec)]();}['setWorkspaceId'](_0x2f847d){function _0x2da216(_0x4785c2,_0x30653f){return _0x40a5(_0x30653f- -0x1db,_0x4785c2);}this[_0x2da216(-0xa9,-0xf7)]['setWorkspaceId'](_0x2f847d);}async[_0x25280e(-0x1c8,-0x1a0)](){function _0x1b93d2(_0x55e202,_0x590704){return _0x40a5(_0x55e202- -0x86,_0x590704);}try{await this[_0x1b93d2(0x5e,0xa3)][_0x1b93d2(0x112,0xf8)]();}catch(_0x496faf){console[_0x1b93d2(0x34,-0x5)]('Failed to initialize custom database detection:',_0x496faf);}}}class StorageBucket{constructor(_0x17d7f4,bucketId){this[_0x5f353d(0x4fd,0x4a9)]=_0x17d7f4;function _0x5f353d(_0x48f389,_0x828852){return _0x40a5(_0x48f389-0x39d,_0x828852);}this[_0x5f353d(0x4cf,0x525)]=bucketId;}async[_0x25280e(-0x197,-0x197)](_0x5779d8,_0x34803a,_0x31b376){function _0x24e33f(_0x261c0f,_0x3c3873){return _0x40a5(_0x261c0f-0x44,_0x3c3873);}try{const _0x352bf4=new FormData();if(_0x34803a instanceof File)_0x352bf4[_0x24e33f(0x188,0x189)]('file',_0x34803a);else{if(_0x34803a instanceof Blob)_0x352bf4['append'](_0x24e33f(0x110,0x12e),_0x34803a,_0x5779d8);else{if(_0x34803a instanceof ArrayBuffer)_0x352bf4['append']('file',new Blob([_0x34803a]),_0x5779d8);else typeof _0x34803a==='string'&&_0x352bf4[_0x24e33f(0x188,0x10a)](_0x24e33f(0x110,0x14c),new Blob([_0x34803a],{'type':_0x24e33f(0x100,0xe3)}),_0x5779d8);}}_0x352bf4[_0x24e33f(0x188,0x10e)](_0x24e33f(0x145,0x17b),_0x5779d8);_0x31b376?.['cacheControl']&&_0x352bf4['append']('cacheControl',_0x31b376[_0x24e33f(0x136,0x156)]);_0x31b376?.[_0x24e33f(0x1bf,0x20f)]&&_0x352bf4['append'](_0x24e33f(0x1bf,0x16a),_0x31b376[_0x24e33f(0x1bf,0x169)]);_0x31b376?.[_0x24e33f(0x1ae,0x153)]&&_0x352bf4[_0x24e33f(0x188,0x153)]('metadata',JSON['stringify'](_0x31b376[_0x24e33f(0x1ae,0x16c)]));const _0x3c733f='/storage/buckets/'+this['bucketId']+_0x24e33f(0x15e,0x115)+(_0x31b376?.[_0x24e33f(0x164,0x104)]?_0x24e33f(0x1d4,0x1b2):''),response=await this[_0x24e33f(0x1a4,0x21c)][_0x24e33f(0x163,0x12c)](_0x3c733f,_0x352bf4,{'headers':{'Content-Type':_0x24e33f(0x134,0xdd)}});return{'data':response[_0x24e33f(0x166,0x12f)],'error':null};}catch(_0x4f2cd6){return{'data':null,'error':_0x4f2cd6 instanceof EBaaSError?_0x4f2cd6:new EBaaSError(_0x4f2cd6 instanceof Error?_0x4f2cd6['message']:'Failed\x20to\x20upload\x20file',0x0,_0x4f2cd6)};}}async[_0x25280e(-0x1da,-0x18e)](_0x557f7a,_0x239e60){function _0x340e2a(_0x137ea8,_0x33e4da){return _0x40a5(_0x33e4da-0x91,_0x137ea8);}try{const _0x2e7a39=new URLSearchParams();_0x239e60?.[_0x340e2a(0x1ab,0x1ae)]&&Object[_0x340e2a(0x1f0,0x237)](_0x239e60[_0x340e2a(0x1c7,0x1ae)])[_0x340e2a(0x20a,0x1be)](([_0x49be8e,_0x44b6ae])=>{function _0x3ccb6e(_0x4206c7,_0x2581e6){return _0x40a5(_0x4206c7- -0x3d4,_0x2581e6);}_0x44b6ae!==undefined&&_0x2e7a39[_0x3ccb6e(-0x290,-0x296)](_0x49be8e,String(_0x44b6ae));});const _0x18fcbf=_0x340e2a(0x1b8,0x16d)+this['bucketId']+'/files/'+_0x557f7a+(_0x2e7a39[_0x340e2a(0x169,0x13a)]()?'?'+_0x2e7a39['toString']():''),response=await this[_0x340e2a(0x18c,0x1f1)][_0x340e2a(0x24e,0x1f7)](_0x18fcbf,{'responseType':'blob'});return{'data':response['data'],'error':null};}catch(_0x4d5999){return{'data':null,'error':_0x4d5999 instanceof EBaaSError?_0x4d5999:new EBaaSError(_0x4d5999 instanceof Error?_0x4d5999['message']:_0x340e2a(0x112,0x143),0x0,_0x4d5999)};}}async[_0x25280e(-0xcd,-0x129)](_0x3c3064,_0x54c49c){function _0x350caf(_0x587ac5,_0x3ed483){return _0x40a5(_0x587ac5-0x3af,_0x3ed483);}try{const _0x279487=new URLSearchParams();_0x3c3064&&_0x279487[_0x350caf(0x4f3,0x4c4)]('prefix',_0x3c3064);_0x54c49c?.['limit']&&_0x279487[_0x350caf(0x4f3,0x51f)]('limit',String(_0x54c49c[_0x350caf(0x4ae,0x4a1)]));_0x54c49c?.[_0x350caf(0x556,0x5d2)]&&_0x279487[_0x350caf(0x4f3,0x51b)]('offset',String(_0x54c49c[_0x350caf(0x556,0x55f)]));_0x54c49c?.['sortBy']&&_0x279487[_0x350caf(0x4f3,0x493)](_0x350caf(0x4ba,0x4b9),JSON['stringify'](_0x54c49c[_0x350caf(0x4ba,0x51e)]));_0x54c49c?.['search']&&_0x279487[_0x350caf(0x4f3,0x4f2)]('search',_0x54c49c[_0x350caf(0x4ee,0x52d)]);const _0x429b43=_0x350caf(0x48b,0x4cd)+this['bucketId']+_0x350caf(0x4c9,0x525)+(_0x279487[_0x350caf(0x458,0x48d)]()?'?'+_0x279487[_0x350caf(0x458,0x48d)]():''),response=await this[_0x350caf(0x50f,0x4c9)][_0x350caf(0x515,0x543)](_0x429b43);return{'data':response[_0x350caf(0x4d1,0x49b)],'error':null};}catch(_0x3da096){return{'data':null,'error':_0x3da096 instanceof EBaaSError?_0x3da096:new EBaaSError(_0x3da096 instanceof Error?_0x3da096[_0x350caf(0x521,0x520)]:'Failed\x20to\x20list\x20files',0x0,_0x3da096)};}}async[_0x25280e(-0x12d,-0xf5)](_0x5583fb){function _0x2e0e92(_0x3e0531,_0x178a74){return _0x40a5(_0x178a74-0x3be,_0x3e0531);}try{const response=await this['httpClient']['delete']('/storage/buckets/'+this['bucketId']+'/files',{'data':{'paths':_0x5583fb}});return{'data':response[_0x2e0e92(0x561,0x4e0)],'error':null};}catch(_0x390b52){return{'data':null,'error':_0x390b52 instanceof EBaaSError?_0x390b52:new EBaaSError(_0x390b52 instanceof Error?_0x390b52['message']:'Failed\x20to\x20remove\x20files',0x0,_0x390b52)};}}async['move'](fromPath,_0x2770ff){function _0x396462(_0x3078f2,_0x20fa6c){return _0x40a5(_0x20fa6c- -0x273,_0x3078f2);}try{const response=await this[_0x396462(-0x13a,-0x113)][_0x396462(-0x1cf,-0x154)](_0x396462(-0x1e8,-0x197)+this[_0x396462(-0xc3,-0x141)]+_0x396462(-0x15d,-0x185),{'sourceKey':fromPath,'destinationKey':_0x2770ff});return{'data':response['data'],'error':null};}catch(_0x17e722){return{'data':null,'error':_0x17e722 instanceof EBaaSError?_0x17e722:new EBaaSError(_0x17e722 instanceof Error?_0x17e722[_0x396462(-0x96,-0x101)]:_0x396462(-0x166,-0x102),0x0,_0x17e722)};}}async[_0x25280e(-0x12d,-0x1a3)](fromPath,_0x4df646){function _0x16445e(_0x43b9fc,_0x47c580){return _0x40a5(_0x47c580- -0x152,_0x43b9fc);}try{const response=await this['httpClient'][_0x16445e(-0x3c,-0x33)]('/storage/buckets/'+this['bucketId']+_0x16445e(-0x45,0x8),{'sourceKey':fromPath,'destinationKey':_0x4df646});return{'data':response[_0x16445e(0x3,-0x30)],'error':null};}catch(_0xb30df1){return{'data':null,'error':_0xb30df1 instanceof EBaaSError?_0xb30df1:new EBaaSError(_0xb30df1 instanceof Error?_0xb30df1[_0x16445e(0x2d,0x20)]:'Failed\x20to\x20copy\x20file',0x0,_0xb30df1)};}}async['createSignedUrl'](_0x36793e,_0x33d229,_0x56e67){function _0x3f1051(_0x5b5da6,_0xfa220a){return _0x40a5(_0xfa220a-0xbf,_0x5b5da6);}try{const response=await this[_0x3f1051(0x1e4,0x21f)][_0x3f1051(0x237,0x1de)]('/storage/buckets/'+this['bucketId']+'/files/'+_0x36793e+'/sign',{'expiresIn':_0x33d229,..._0x56e67});return{'data':response['data'],'error':null};}catch(_0x25410d){return{'data':null,'error':_0x25410d instanceof EBaaSError?_0x25410d:new EBaaSError(_0x25410d instanceof Error?_0x25410d[_0x3f1051(0x201,0x231)]:'Failed\x20to\x20create\x20signed\x20URL',0x0,_0x25410d)};}}['getPublicUrl'](_0x259861,_0x3ace61){const _0x45dc86=new URLSearchParams();function _0x33bce4(_0x11d1b4,_0x208533){return _0x40a5(_0x11d1b4-0x25b,_0x208533);}_0x3ace61?.[_0x33bce4(0x378,0x3a6)]&&Object['entries'](_0x3ace61[_0x33bce4(0x378,0x3a5)])['forEach'](([_0x3b8c24,_0x1ef929])=>{_0x1ef929!==undefined&&_0x45dc86['append'](_0x3b8c24,String(_0x1ef929));});const _0x4e59ff=this['httpClient'][_0x33bce4(0x359,0x3ce)]||'',_0x954433=_0x4e59ff+_0x33bce4(0x337,0x362)+this[_0x33bce4(0x38d,0x39e)]+'/files/'+_0x259861+(_0x45dc86['toString']()?'?'+_0x45dc86[_0x33bce4(0x304,0x290)]():'');return{'data':{'publicUrl':_0x954433}};}async[_0x25280e(-0xa9,-0xb5)](_0x5e1fcb){function _0x41d6ee(_0x19237e,_0xdbfac8){return _0x40a5(_0x19237e-0x24f,_0xdbfac8);}try{const response=await this[_0x41d6ee(0x3af,0x41c)]['get'](_0x41d6ee(0x32b,0x2c5)+this['bucketId']+'/files/'+_0x5e1fcb+_0x41d6ee(0x37a,0x344));return{'data':response[_0x41d6ee(0x371,0x34b)],'error':null};}catch(_0x1cb0fb){return{'data':null,'error':_0x1cb0fb instanceof EBaaSError?_0x1cb0fb:new EBaaSError(_0x1cb0fb instanceof Error?_0x1cb0fb['message']:_0x41d6ee(0x3b4,0x41b),0x0,_0x1cb0fb)};}}async['updateFileMetadata'](_0x3a8fe4,metadata){function _0x468ac1(_0x59d57f,_0x4ab25f){return _0x40a5(_0x4ab25f- -0x1bb,_0x59d57f);}try{const response=await this['httpClient'][_0x468ac1(-0xb9,-0x60)]('/storage/buckets/'+this[_0x468ac1(-0xb4,-0x89)]+_0x468ac1(-0x20,-0x96)+_0x3a8fe4+_0x468ac1(-0xed,-0xde),{'metadata':metadata});return{'data':response[_0x468ac1(-0x58,-0x99)],'error':null};}catch(_0x75921d){return{'data':null,'error':_0x75921d instanceof EBaaSError?_0x75921d:new EBaaSError(_0x75921d instanceof Error?_0x75921d[_0x468ac1(-0x74,-0x49)]:_0x468ac1(-0xba,-0x45),0x0,_0x75921d)};}}}class StorageClient{constructor(_0x23fb1a){function _0x5b4155(_0x34686d,_0x573d62){return _0x40a5(_0x573d62- -0x167,_0x34686d);}this[_0x5b4155(-0x3d,-0x7)]=_0x23fb1a;}[_0x25280e(-0x132,-0x147)](bucketId){function _0x24a52f(_0x357539,_0x34c0cc){return _0x40a5(_0x357539- -0x1e9,_0x34c0cc);}return new StorageBucket(this[_0x24a52f(-0x89,-0xfa)],bucketId);}async[_0x25280e(-0x164,-0x16a)](_0x9b4dba,_0x1d3117){function _0x56b6eb(_0x5d72f7,_0x542386){return _0x40a5(_0x542386-0x1fe,_0x5d72f7);}try{const response=await this['httpClient']['post']('/storage/buckets',{'id':_0x9b4dba,..._0x1d3117});return{'data':response[_0x56b6eb(0x373,0x320)],'error':null};}catch(_0x2bc7f3){return{'data':null,'error':_0x2bc7f3 instanceof EBaaSError?_0x2bc7f3:new EBaaSError(_0x2bc7f3 instanceof Error?_0x2bc7f3['message']:_0x56b6eb(0x3ab,0x39c),0x0,_0x2bc7f3)};}}async['getBucket'](_0x4425a7){function _0x106312(_0x174939,_0xd96b7){return _0x40a5(_0xd96b7- -0x6a,_0x174939);}try{const response=await this['httpClient'][_0x106312(0x99,0xfc)]('/storage/buckets/'+_0x4425a7);return{'data':response['data'],'error':null};}catch(_0x57f70b){return{'data':null,'error':_0x57f70b instanceof EBaaSError?_0x57f70b:new EBaaSError(_0x57f70b instanceof Error?_0x57f70b['message']:'Failed\x20to\x20get\x20bucket',0x0,_0x57f70b)};}}async['listBuckets'](){function _0x11ac4b(_0x417125,_0x3b9155){return _0x40a5(_0x417125-0x0,_0x3b9155);}try{const response=await this['httpClient']['get'](_0x11ac4b(0xfb,0xc4));return{'data':response[_0x11ac4b(0x122,0xaa)],'error':null};}catch(_0x170448){return{'data':null,'error':_0x170448 instanceof EBaaSError?_0x170448:new EBaaSError(_0x170448 instanceof Error?_0x170448['message']:_0x11ac4b(0x161,0x1a8),0x0,_0x170448)};}}async['updateBucket'](_0xfdc7cf,_0x54bfb4){function _0x1241ff(_0x1d54cc,_0x468b95){return _0x40a5(_0x1d54cc- -0x266,_0x468b95);}try{const response=await this['httpClient']['put']('/storage/buckets/'+_0xfdc7cf,_0x54bfb4);return{'data':response[_0x1241ff(-0x144,-0x121)],'error':null};}catch(_0x2d81d6){return{'data':null,'error':_0x2d81d6 instanceof EBaaSError?_0x2d81d6:new EBaaSError(_0x2d81d6 instanceof Error?_0x2d81d6[_0x1241ff(-0xf4,-0x158)]:'Failed\x20to\x20update\x20bucket',0x0,_0x2d81d6)};}}async['deleteBucket'](_0x4e91af){function _0x33bed6(_0x48fb8e,_0x43ab23){return _0x40a5(_0x48fb8e- -0x186,_0x43ab23);}try{const response=await this[_0x33bed6(-0x26,-0x8b)][_0x33bed6(-0x33,-0x4a)](_0x33bed6(-0xaa,-0x11f)+_0x4e91af);return{'data':response['data'],'error':null};}catch(_0x2f52b1){return{'data':null,'error':_0x2f52b1 instanceof EBaaSError?_0x2f52b1:new EBaaSError(_0x2f52b1 instanceof Error?_0x2f52b1[_0x33bed6(-0x14,-0x5d)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x2f52b1)};}}async[_0x25280e(-0x178,-0x1a5)](){function _0x4d9907(_0x31f7d7,_0x11f97e){return _0x40a5(_0x11f97e-0x2a3,_0x31f7d7);}try{const response=await this['httpClient'][_0x4d9907(0x440,0x409)](_0x4d9907(0x424,0x3f0));return{'data':response['data'],'error':null};}catch(_0x32c73){return{'data':null,'error':_0x32c73 instanceof EBaaSError?_0x32c73:new EBaaSError(_0x32c73 instanceof Error?_0x32c73[_0x4d9907(0x415,0x415)]:_0x4d9907(0x437,0x3f1),0x0,_0x32c73)};}}}class RealtimeChannel extends EventEmitter{constructor(_0x5ba622,_0x4f4c56){super();function _0x23f0a1(_0x4a3383,_0x51ae9d){return _0x40a5(_0x4a3383-0x1b7,_0x51ae9d);}this[_0x23f0a1(0x2f3,0x288)]=![],this['state']=_0x23f0a1(0x2fa,0x29f),this['subscriptions']=new Map(),this[_0x23f0a1(0x285,0x227)]=_0x5ba622,this[_0x23f0a1(0x320,0x2fc)]=_0x4f4c56;}['subscribe'](_0x178472){function _0x212884(_0x56478b,_0xc47780){return _0x40a5(_0x56478b-0x3cf,_0xc47780);}return!this[_0x212884(0x50b,0x543)]&&(this['joinedOnce']=!![],this[_0x212884(0x4c3,0x4eb)]()),_0x178472&&this['on'](_0x212884(0x477,0x453),_0x178472),this;}[_0x25280e(-0x10e,-0xc2)](filter,_0x21460b){const _0x226490='postgres_changes:'+JSON[_0x312031(-0x17d,-0x172)](filter);super['on'](_0x226490,_0x21460b);const _0x5544c9={'unsubscribe':()=>{function _0x5d517f(_0x556e2f,_0x3bfbcf){return _0x40a5(_0x3bfbcf-0x364,_0x556e2f);}super[_0x5d517f(0x47e,0x48b)](_0x226490,_0x21460b),this[_0x5d517f(0x4e3,0x4f3)][_0x5d517f(0x4fc,0x4b7)](_0x226490);}};this[_0x312031(-0x70,-0x91)]['set'](_0x226490,_0x5544c9);this['socket']?.['connected']&&this['state']==='joined'&&this['socket']['emit'](_0x312031(-0xb1,-0x11b),{'topic':this[_0x312031(-0x154,-0x152)],'filter':filter,'ref':this[_0x312031(-0xfe,-0xce)]()});function _0x312031(_0x4319df,_0x4ec8b2){return _0x40a5(_0x4ec8b2- -0x220,_0x4319df);}return _0x5544c9;}['onBroadcast'](filter,_0xffe3b0){const _0x11f619=_0x47631e(-0x15d,-0x18a)+JSON[_0x47631e(-0x161,-0x191)](filter);super['on'](_0x11f619,_0xffe3b0);function _0x47631e(_0x4adaf3,_0xb235fe){return _0x40a5(_0xb235fe- -0x23f,_0x4adaf3);}const _0x2f4874={'unsubscribe':()=>{function _0x5ae1ea(_0x25a66e,_0xd3d91a){return _0x40a5(_0xd3d91a- -0x209,_0x25a66e);}super['off'](_0x11f619,_0xffe3b0),this[_0x5ae1ea(-0x29,-0x7a)]['delete'](_0x11f619);}};return this[_0x47631e(-0x45,-0xb0)][_0x47631e(-0x15a,-0x131)](_0x11f619,_0x2f4874),_0x2f4874;}['onPresence'](filter,_0x2820a4){const _0x3cc348=_0x474dd0(-0x21e,-0x242)+JSON[_0x474dd0(-0x278,-0x26d)](filter);super['on'](_0x3cc348,_0x2820a4);function _0x474dd0(_0x1557cb,_0x218072){return _0x40a5(_0x218072- -0x31b,_0x1557cb);}const _0x30b2fe={'unsubscribe':()=>{super['off'](_0x3cc348,_0x2820a4);function _0x4bd89f(_0x1414a0,_0x25a40c){return _0x40a5(_0x25a40c-0x39,_0x1414a0);}this[_0x4bd89f(0x204,0x1c8)]['delete'](_0x3cc348);}};return this['subscriptions']['set'](_0x3cc348,_0x30b2fe),_0x30b2fe;}['send'](_0x24de9e){return new Promise(_0x2861b8=>{function _0x32f68a(_0x276573,_0x520e9b){return _0x40a5(_0x520e9b- -0x360,_0x276573);}this['socket']?.[_0x32f68a(-0x28f,-0x256)]&&this['state']==='joined'?(this['socket'][_0x32f68a(-0x2ce,-0x282)]('broadcast',{'topic':this['topic'],'event':_0x24de9e['event'],'payload':_0x24de9e,'ref':this['makeRef']()}),_0x2861b8('ok')):_0x2861b8(_0x32f68a(-0x235,-0x290));});}[_0x25280e(-0xde,-0xbd)](_0x9e2ba2){return new Promise(_0x11529f=>{function _0x5eb4e1(_0x14891a,_0x3ca538){return _0x40a5(_0x3ca538- -0x222,_0x14891a);}this[_0x5eb4e1(-0xf2,-0xb9)]?.[_0x5eb4e1(-0xd2,-0x118)]&&this[_0x5eb4e1(-0x87,-0xa0)]===_0x5eb4e1(-0xe3,-0xd3)?(this['socket'][_0x5eb4e1(-0x1b6,-0x144)]('presence',{'topic':this[_0x5eb4e1(-0x10e,-0x154)],'event':'track','payload':_0x9e2ba2,'ref':this[_0x5eb4e1(-0xdc,-0xd0)]()}),_0x11529f('ok')):_0x11529f(_0x5eb4e1(-0x147,-0x152));});}[_0x25280e(-0x1fd,-0x1ac)](){return new Promise(_0x2695f2=>{function _0x351894(_0x4e8357,_0x5863a3){return _0x40a5(_0x4e8357-0x216,_0x5863a3);}this['socket']?.['connected']&&this[_0x351894(0x398,0x36d)]===_0x351894(0x365,0x3c7)?(this[_0x351894(0x37f,0x3fe)]['emit']('presence',{'topic':this[_0x351894(0x2e4,0x349)],'event':_0x351894(0x2c3,0x314),'ref':this['makeRef']()}),_0x2695f2('ok')):_0x2695f2('error');});}['unsubscribe'](){return new Promise(_0x58371e=>{this['state']=_0x31b551(-0x1ca,-0x1a6),this[_0x31b551(-0x13c,-0x1ac)]['forEach'](_0x221f5e=>{function _0x4ffd7c(_0x29536f,_0x2ec9ca){return _0x40a5(_0x29536f- -0x1,_0x2ec9ca);}_0x221f5e[_0x4ffd7c(0x17d,0x199)]();}),this[_0x31b551(-0x1b4,-0x1ac)]['clear']();this['socket']?.['connected']&&this['socket'][_0x31b551(-0x23f,-0x25d)]('leave',{'topic':this['topic'],'ref':this[_0x31b551(-0x1b2,-0x1e9)]()});this['state']='closed';function _0x31b551(_0x32ab04,_0x417267){return _0x40a5(_0x417267- -0x33b,_0x32ab04);}this[_0x31b551(-0x2ba,-0x238)](),_0x58371e('ok');});}['_join'](){function _0x196f2c(_0x5bc4cd,_0x19122b){return _0x40a5(_0x19122b-0xed,_0x5bc4cd);}if(this[_0x196f2c(0x2c0,0x26f)]===_0x196f2c(0x219,0x282))return;this['state']=_0x196f2c(0x1c7,0x1cd),this['socket']?.[_0x196f2c(0x18a,0x1f7)]&&(this[_0x196f2c(0x2bc,0x256)][_0x196f2c(0x15e,0x1cb)](_0x196f2c(0x218,0x255),{'topic':this[_0x196f2c(0x19b,0x1bb)],'ref':this['makeRef']()}),setTimeout(()=>{function _0x308301(_0x107f95,_0x5045b4){return _0x40a5(_0x107f95-0x3a,_0x5045b4);}this[_0x308301(0x1bc,0x20f)]===_0x308301(0x11a,0x12f)&&(this[_0x308301(0x1bc,0x234)]=_0x308301(0x189,0x1a0),this[_0x308301(0x118,0x194)]('status',_0x308301(0x1be,0x1e5)));},0x64));}['_rejoin'](){function _0x5edc0c(_0x1d01b6,_0x317543){return _0x40a5(_0x317543-0x1f,_0x1d01b6);}this[_0x5edc0c(0x1be,0x15b)]&&(this['_join'](),this[_0x5edc0c(0x13b,0x1ae)][_0x5edc0c(0x121,0x14c)]((_0x2e24bd,_0x2ea89c)=>{function _0x35ce89(_0x52b071,_0x4b16a5){return _0x40a5(_0x52b071-0x1fe,_0x4b16a5);}if(_0x2ea89c[_0x35ce89(0x383,0x3ec)]('postgres_changes:')){const filter=JSON[_0x35ce89(0x373,0x345)](_0x2ea89c[_0x35ce89(0x34e,0x2ed)]('postgres_changes:',''));this['socket']?.['emit'](_0x35ce89(0x303,0x2f5),{'topic':this[_0x35ce89(0x2cc,0x31d)],'filter':filter,'ref':this['makeRef']()});}}));}[_0x25280e(-0x126,-0x110)](_0x53faf0,_0xfe1a3c){function _0x4dbd05(_0x196be3,_0xc5d58c){return _0x40a5(_0x196be3-0x18c,_0xc5d58c);}if(_0x53faf0===_0x4dbd05(0x24a,0x26c)){const _0x351e71='postgres_changes:'+JSON['stringify'](_0xfe1a3c['filter']||{});this[_0x4dbd05(0x26a,0x29e)](_0x351e71,_0xfe1a3c);}else{if(_0x53faf0==='broadcast'){const _0x466085='broadcast:'+JSON[_0x4dbd05(0x23a,0x24c)]({'event':_0xfe1a3c['event']});this['emit'](_0x466085,_0xfe1a3c);}else{if(_0x53faf0===_0x4dbd05(0x26f,0x1f6)){const _0x3ff208=_0x4dbd05(0x265,0x209)+JSON[_0x4dbd05(0x23a,0x205)]({'event':_0xfe1a3c['event']});this['emit'](_0x3ff208,_0xfe1a3c);}}}this['emit'](_0x53faf0,_0xfe1a3c);}['_setState'](_0x350a5c){this['state']=_0x350a5c;let status;function _0x3f9e4d(_0x167409,_0x4f6172){return _0x40a5(_0x4f6172- -0x22,_0x167409);}switch(_0x350a5c){case _0x3f9e4d(0x148,0x12d):status=_0x3f9e4d(0x127,0x162);break;case _0x3f9e4d(0xd0,0x134):status=_0x3f9e4d(0xe6,0x85);break;case'closed':status='CLOSED';break;default:return;}this[_0x3f9e4d(0x6e,0xbc)]('status',status);}[_0x25280e(-0xe8,-0x107)](){function _0x1f47e2(_0x53c651,_0x3a8e3d){return _0x40a5(_0x3a8e3d-0xe6,_0x53c651);}return Math[_0x1f47e2(0x1ae,0x19e)]()['toString'](0x24)[_0x1f47e2(0x1ce,0x1e2)](0x2,0xf);}['getState'](){return this['state'];}}class RealtimeClient{constructor(_0x23ced0,_0x19d75f,_0x7df34d={}){this['socket']=null,this['channels']=new Map(),this[_0x26c8d1(0x521,0x4a5)]=_0x26c8d1(0x47e,0x4a3),this['reconnectAttempts']=0x0,this[_0x26c8d1(0x475,0x4ed)]=0x5,this['url']=_0x23ced0,this['apiKey']=_0x19d75f;function _0x26c8d1(_0x2cbbe2,_0x53c93d){return _0x40a5(_0x53c93d-0x36e,_0x2cbbe2);}this[_0x26c8d1(0x477,0x4ef)]={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x7df34d};}['connect'](){return new Promise((_0x4149ee,_0xfd2a91)=>{if(this[_0x43f697(-0x1d6,-0x215)]?.[_0x43f697(-0x23d,-0x274)]){_0x4149ee();return;}this['connectionState']='connecting',this['socket']=socket_ioClient['io'](this[_0x43f697(-0x251,-0x271)],{'auth':{'apikey':this['apiKey']},'transports':[_0x43f697(-0x21a,-0x220)],'reconnection':!![],'reconnectionDelay':this['options']['reconnectInterval'],'reconnectionAttempts':this['options'][_0x43f697(-0x258,-0x1ff)],...this['options']['socketOptions']}),this['socket']['on'](_0x43f697(-0x317,-0x2a9),()=>{this[_0x18ed10(0xe9,0x74)]='connected',this['reconnectAttempts']=0x0,this['setupHeartbeat']();function _0x18ed10(_0x432885,_0x20c8ef){return _0x40a5(_0x20c8ef- -0xc3,_0x432885);}_0x4149ee();}),this['socket']['on']('disconnect',_0x3b4ec5=>{this[_0x116fcd(-0x143,-0x157)]='disconnected';function _0x116fcd(_0x21a705,_0x25f81e){return _0x40a5(_0x21a705- -0x27a,_0x25f81e);}this[_0x116fcd(-0x19b,-0x133)][_0x116fcd(-0x14d,-0xf2)](channel=>{function _0x5e1e1d(_0x309ce8,_0xbe2389){return _0x40a5(_0xbe2389-0x264,_0x309ce8);}channel['_setState'](_0x5e1e1d(0x3f8,0x3a7));});}),this[_0x43f697(-0x1cb,-0x215)]['on'](_0x43f697(-0x1b1,-0x1dd),_0x424a40=>{this['connectionState']='error';function _0xd68d7(_0x27ff16,_0x562e38){return _0x40a5(_0x27ff16- -0x398,_0x562e38);}this[_0xd68d7(-0x202,-0x1c9)]++,this[_0xd68d7(-0x202,-0x26e)]>=this['maxReconnectAttempts']&&_0xfd2a91(new Error(_0xd68d7(-0x211,-0x1eb)+this['maxReconnectAttempts']+'\x20attempts:\x20'+_0x424a40[_0xd68d7(-0x226,-0x229)]));}),this['socket']['on']('reconnect',()=>{this['connectionState']='connected',this['reconnectAttempts']=0x0,this['channels']['forEach'](channel=>{function _0x5c04d1(_0x571a14,_0x44b532){return _0x40a5(_0x571a14-0x30f,_0x44b532);}channel[_0x5c04d1(0x43e,0x479)]();});});function _0x43f697(_0x44084b,_0x431fb5){return _0x40a5(_0x431fb5- -0x37e,_0x44084b);}this['socket']['on']('postgres_changes',_0x43b9c8=>{function _0x411553(_0x5ea402,_0x1c7f87){return _0x40a5(_0x5ea402- -0x22e,_0x1c7f87);}const channel=this['channels'][_0x411553(-0xc8,-0x144)](_0x43b9c8[_0x411553(-0x160,-0x105)]);channel&&channel[_0x411553(-0xe5,-0x126)](_0x411553(-0x170,-0x133),_0x43b9c8);}),this['socket']['on']('broadcast',_0x11898f=>{const channel=this[_0x3cecf4(0x7b,0x1f)][_0x3cecf4(0x102,0xf2)](_0x11898f['topic']);function _0x3cecf4(_0x5ed0d3,_0x40bd3b){return _0x40a5(_0x5ed0d3- -0x64,_0x40bd3b);}channel&&channel['_trigger'](_0x3cecf4(0xb1,0x90),_0x11898f);}),this[_0x43f697(-0x1e5,-0x215)]['on']('presence',_0x44ca9b=>{function _0x595e19(_0x2138b4,_0x40d0c0){return _0x40a5(_0x2138b4-0x3ce,_0x40d0c0);}const channel=this[_0x595e19(0x4ad,0x4a5)]['get'](_0x44ca9b['topic']);channel&&channel['_trigger']('presence',_0x44ca9b);});});}[_0x25280e(-0x114,-0x123)](){function _0xce28ac(_0x4c21de,_0x1f568e){return _0x40a5(_0x4c21de-0x31f,_0x1f568e);}this['socket']&&(this['socket'][_0xce28ac(0x455,0x40c)](),this['socket']=null),this[_0xce28ac(0x456,0x3fb)]='disconnected',this[_0xce28ac(0x3fe,0x3ea)][_0xce28ac(0x407,0x423)]();}[_0x25280e(-0xde,-0xc0)](_0x6dc9a6){if(this[_0x135e5b(0xca,0xad)]['has'](_0x6dc9a6))return this[_0x135e5b(0xc1,0xad)][_0x135e5b(0xb6,0x134)](_0x6dc9a6);function _0x135e5b(_0x3b4b10,_0x135b50){return _0x40a5(_0x135b50- -0x32,_0x3b4b10);}const channel=new RealtimeChannel(_0x6dc9a6,this[_0x135e5b(0x154,0x137)]);return this[_0x135e5b(0x84,0xad)]['set'](_0x6dc9a6,channel),this[_0x135e5b(0x121,0x105)]===_0x135e5b(0xf6,0xd8)&&channel[_0x135e5b(0x8e,0xc2)](),channel;}[_0x25280e(-0x10b,-0x131)](channel){function _0x10df4c(_0x14df99,_0x248ee5){return _0x40a5(_0x248ee5-0x2aa,_0x14df99);}const _0x5db5aa=channel['topic'];this['channels']['has'](_0x5db5aa)&&(this[_0x10df4c(0x3d3,0x389)]['delete'](_0x5db5aa),channel['unsubscribe']());}[_0x25280e(-0xf8,-0xd1)](){function _0x2cfbcb(_0x2dd043,_0x20a9c8){return _0x40a5(_0x2dd043-0xbe,_0x20a9c8);}this['channels']['forEach'](channel=>{function _0x109db8(_0x5ea167,_0x376303){return _0x40a5(_0x5ea167- -0x15d,_0x376303);}channel[_0x109db8(0x21,0x5f)]();}),this['channels'][_0x2cfbcb(0x1a6,0x157)]();}[_0x25280e(-0x97,-0xee)](){function _0x86be1c(_0x5ec2b3,_0x3e8f2c){return _0x40a5(_0x3e8f2c-0x5b,_0x5ec2b3);}return Array[_0x86be1c(0x16e,0x16d)](this[_0x86be1c(0x11a,0x13a)]['values']());}[_0x25280e(-0x11f,-0x162)](){function _0x42aa69(_0x5149be,_0x255250){return _0x40a5(_0x5149be-0xc3,_0x255250);}return this[_0x42aa69(0x1fa,0x27b)]===_0x42aa69(0x1cd,0x205)&&!!this[_0x42aa69(0x22c,0x25d)]?.['connected'];}['getConnectionState'](){function _0x285994(_0x12524e,_0x5cecda){return _0x40a5(_0x5cecda- -0x268,_0x12524e);}return this[_0x285994(-0x18b,-0x131)];}[_0x25280e(-0x140,-0x18c)](_0xdcf36d){const _0x29c3e1=()=>_0xdcf36d(this['connectionState']);function _0x1b6c19(_0x248505,_0x1bb7d3){return _0x40a5(_0x1bb7d3- -0xde,_0x248505);}return this[_0x1b6c19(0x3f,0x8b)]&&(this['socket']['on']('connect',()=>{function _0x41452b(_0x46376d,_0x349768){return _0x40a5(_0x349768- -0x248,_0x46376d);}this[_0x41452b(-0x14d,-0x111)]='connected',_0x29c3e1();}),this['socket']['on']('disconnect',()=>{this[_0x35abb2(0x280,0x200)]='disconnected';function _0x35abb2(_0x51f35d,_0x31887f){return _0x40a5(_0x51f35d-0x149,_0x31887f);}_0x29c3e1();}),this[_0x1b6c19(0x1a,0x8b)]['on']('connect_error',()=>{this['connectionState']=_0xed66e9(0x2ad,0x2ad);function _0xed66e9(_0xc02f8a,_0x3338f7){return _0x40a5(_0x3338f7-0x1dd,_0xc02f8a);}_0x29c3e1();})),()=>{function _0x46a3e6(_0x105b60,_0x152d96){return _0x40a5(_0x105b60-0x38b,_0x152d96);}this[_0x46a3e6(0x4f4,0x542)]&&(this[_0x46a3e6(0x4f4,0x55f)]['off'](_0x46a3e6(0x460,0x40e),_0x29c3e1),this['socket'][_0x46a3e6(0x4b2,0x49c)]('disconnect',_0x29c3e1),this['socket']['off'](_0x46a3e6(0x52c,0x549),_0x29c3e1));};}[_0x25280e(-0x14e,-0x15c)](){function _0x1ee7a5(_0x12eabd,_0x1f2f7b){return _0x40a5(_0x1f2f7b- -0x2ef,_0x12eabd);}if(!this[_0x1ee7a5(-0x1b9,-0x16e)]['heartbeatInterval']||!this[_0x1ee7a5(-0x140,-0x186)])return;const interval=setInterval(()=>{function _0x2002bd(_0x15beac,_0x5e2dcb){return _0x40a5(_0x5e2dcb- -0x35,_0x15beac);}this['socket']?.[_0x2002bd(0xea,0xd5)]?this['socket']['emit']('heartbeat',{'timestamp':Date['now']()}):clearInterval(interval);},this[_0x1ee7a5(-0x155,-0x16e)]['heartbeatInterval']);}['_getSocket'](){function _0x3e49f9(_0x51effd,_0x3aa528){return _0x40a5(_0x51effd- -0x235,_0x3aa528);}return this[_0x3e49f9(-0xcc,-0xd2)];}}class FunctionsClient{constructor(_0x30c6db){this['httpClient']=_0x30c6db;}async['invoke'](_0x15fcee,_0x498208){function _0x4a1d52(_0x45ad9a,_0x16a4e3){return _0x40a5(_0x45ad9a-0x377,_0x16a4e3);}try{const _0x470357=_0x498208?.[_0x4a1d52(0x48d,0x480)]||'POST',headers={'Content-Type':'application/json',..._0x498208?.[_0x4a1d52(0x4f4,0x4df)]};let response;const _0x59b373=_0x4a1d52(0x4d6,0x484)+_0x15fcee;switch(_0x470357['toUpperCase']()){case'GET':response=await this[_0x4a1d52(0x4d7,0x553)]['get'](_0x59b373,{'headers':headers,'params':_0x498208?.[_0x4a1d52(0x49d,0x4e8)]});break;case'POST':response=await this[_0x4a1d52(0x4d7,0x4c5)]['post'](_0x59b373,_0x498208?.[_0x4a1d52(0x49d,0x456)],{'headers':headers});break;case'PUT':response=await this[_0x4a1d52(0x4d7,0x499)][_0x4a1d52(0x4d2,0x54d)](_0x59b373,_0x498208?.[_0x4a1d52(0x49d,0x4ae)],{'headers':headers});break;case'PATCH':response=await this['httpClient'][_0x4a1d52(0x502,0x500)](_0x59b373,_0x498208?.['body'],{'headers':headers});break;case'DELETE':response=await this['httpClient']['delete'](_0x59b373,{'headers':headers,'data':_0x498208?.[_0x4a1d52(0x49d,0x434)]});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x470357,0x190);}return{'data':response['data'],'error':null};}catch(_0x30cbb9){return{'data':null,'error':_0x30cbb9 instanceof EBaaSError?_0x30cbb9:new EBaaSError(_0x30cbb9 instanceof Error?_0x30cbb9[_0x4a1d52(0x4e9,0x4fc)]:'Function\x20invocation\x20failed',0x0,_0x30cbb9)};}}async['list'](){function _0x5ee527(_0x15fd60,_0x15a139){return _0x40a5(_0x15fd60-0x19c,_0x15a139);}try{const response=await this[_0x5ee527(0x2fc,0x28f)][_0x5ee527(0x302,0x2e7)](_0x5ee527(0x261,0x26b));return{'data':response[_0x5ee527(0x2be,0x2fc)],'error':null};}catch(_0xe19948){return{'data':null,'error':_0xe19948 instanceof EBaaSError?_0xe19948:new EBaaSError(_0xe19948 instanceof Error?_0xe19948[_0x5ee527(0x30e,0x362)]:_0x5ee527(0x26d,0x25c),0x0,_0xe19948)};}}async['get'](_0xdb95b9){function _0x5cf205(_0x46d5ef,_0x480888){return _0x40a5(_0x46d5ef- -0xef,_0x480888);}try{const response=await this['httpClient'][_0x5cf205(0x77,0x9)]('/functions/v1/'+_0xdb95b9+'/info');return{'data':response[_0x5cf205(0x33,-0x39)],'error':null};}catch(_0x473bfe){return{'data':null,'error':_0x473bfe instanceof EBaaSError?_0x473bfe:new EBaaSError(_0x473bfe instanceof Error?_0x473bfe['message']:'Failed\x20to\x20get\x20function',0x0,_0x473bfe)};}}async['deploy'](_0x589afd,_0x439b94){function _0x1dfbf8(_0x367aab,_0x43bf82){return _0x40a5(_0x367aab- -0x3ab,_0x43bf82);}try{const _0x148fcb=new FormData();if(_0x439b94['code']instanceof File)_0x148fcb[_0x1dfbf8(-0x267,-0x207)]('code',_0x439b94[_0x1dfbf8(-0x252,-0x1f8)]);else typeof _0x439b94['code']===_0x1dfbf8(-0x25a,-0x27b)&&_0x148fcb['append']('code',new Blob([_0x439b94['code']],{'type':'text/plain'}),_0x1dfbf8(-0x270,-0x28e));_0x439b94['entrypoint']&&_0x148fcb[_0x1dfbf8(-0x267,-0x2c0)]('entrypoint',_0x439b94['entrypoint']);_0x439b94[_0x1dfbf8(-0x21a,-0x26d)]&&_0x148fcb[_0x1dfbf8(-0x267,-0x24c)](_0x1dfbf8(-0x21a,-0x27b),JSON['stringify'](_0x439b94['env']));_0x439b94['importMap']&&_0x148fcb['append']('importMap',JSON['stringify'](_0x439b94[_0x1dfbf8(-0x2ea,-0x322)]));_0x439b94[_0x1dfbf8(-0x26a,-0x248)]!==undefined&&_0x148fcb['append'](_0x1dfbf8(-0x26a,-0x238),String(_0x439b94[_0x1dfbf8(-0x26a,-0x243)]));const response=await this[_0x1dfbf8(-0x24b,-0x25c)][_0x1dfbf8(-0x28c,-0x277)]('/functions/v1/'+_0x589afd+_0x1dfbf8(-0x260,-0x25e),_0x148fcb,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x1dfbf8(-0x289,-0x27a)],'error':null};}catch(_0x1ab27b){return{'data':null,'error':_0x1ab27b instanceof EBaaSError?_0x1ab27b:new EBaaSError(_0x1ab27b instanceof Error?_0x1ab27b[_0x1dfbf8(-0x239,-0x2aa)]:_0x1dfbf8(-0x254,-0x1ea),0x0,_0x1ab27b)};}}async['delete'](_0x5f02f0){function _0x5b90c4(_0xd48691,_0x4d3297){return _0x40a5(_0x4d3297-0x35f,_0xd48691);}try{const response=await this['httpClient']['delete'](_0x5b90c4(0x458,0x4be)+_0x5f02f0);return{'data':response[_0x5b90c4(0x412,0x481)],'error':null};}catch(_0x2c46bc){return{'data':null,'error':_0x2c46bc instanceof EBaaSError?_0x2c46bc:new EBaaSError(_0x2c46bc instanceof Error?_0x2c46bc[_0x5b90c4(0x4bf,0x4d1)]:_0x5b90c4(0x4ac,0x433),0x0,_0x2c46bc)};}}async['updateEnv'](_0x137a2e,_0xc21ccb){function _0x4579fe(_0x5e2a30,_0x55d670){return _0x40a5(_0x5e2a30- -0x250,_0x55d670);}try{const response=await this[_0x4579fe(-0xf0,-0x6f)][_0x4579fe(-0xf5,-0x109)](_0x4579fe(-0xf1,-0x9b)+_0x137a2e+'/env',{'env':_0xc21ccb});return{'data':response['data'],'error':null};}catch(_0x2a156a){return{'data':null,'error':_0x2a156a instanceof EBaaSError?_0x2a156a:new EBaaSError(_0x2a156a instanceof Error?_0x2a156a[_0x4579fe(-0xde,-0x132)]:'Failed\x20to\x20update\x20function\x20environment',0x0,_0x2a156a)};}}async[_0x25280e(-0xc7,-0xe6)](_0x38c166,_0x37d918){function _0x395525(_0x4bb1db,_0x52e95b){return _0x40a5(_0x4bb1db-0x2bc,_0x52e95b);}try{const _0x2e27fc=new URLSearchParams();_0x37d918?.['limit']&&_0x2e27fc[_0x395525(0x400,0x442)](_0x395525(0x3bb,0x349),String(_0x37d918[_0x395525(0x3bb,0x3fe)]));_0x37d918?.['offset']&&_0x2e27fc[_0x395525(0x400,0x457)](_0x395525(0x463,0x4d3),String(_0x37d918['offset']));_0x37d918?.['level']&&_0x2e27fc['append']('level',_0x37d918['level']);const _0x11f057='/functions/v1/'+_0x38c166+_0x395525(0x3a2,0x34d)+(_0x2e27fc['toString']()?'?'+_0x2e27fc['toString']():''),response=await this[_0x395525(0x41c,0x474)][_0x395525(0x422,0x3da)](_0x11f057);return{'data':response[_0x395525(0x3de,0x3be)],'error':null};}catch(_0x1d5fe8){return{'data':null,'error':_0x1d5fe8 instanceof EBaaSError?_0x1d5fe8:new EBaaSError(_0x1d5fe8 instanceof Error?_0x1d5fe8['message']:'Failed\x20to\x20get\x20function\x20logs',0x0,_0x1d5fe8)};}}async['getMetrics'](_0x13eef6,_0x5cb22d){function _0x12084b(_0x2c7a08,_0x3de1d8){return _0x40a5(_0x3de1d8-0x38e,_0x2c7a08);}try{const _0x4f76c7=new URLSearchParams();_0x5cb22d?.[_0x12084b(0x433,0x457)]&&_0x4f76c7[_0x12084b(0x4e1,0x4d2)]('period',_0x5cb22d['period']);const _0x5a5c56='/functions/v1/'+_0x13eef6+'/metrics'+(_0x4f76c7[_0x12084b(0x464,0x437)]()?'?'+_0x4f76c7[_0x12084b(0x414,0x437)]():''),response=await this['httpClient']['get'](_0x5a5c56);return{'data':response[_0x12084b(0x4d8,0x4b0)],'error':null};}catch(_0x52de34){return{'data':null,'error':_0x52de34 instanceof EBaaSError?_0x52de34:new EBaaSError(_0x52de34 instanceof Error?_0x52de34[_0x12084b(0x4bd,0x500)]:'Failed\x20to\x20get\x20function\x20metrics',0x0,_0x52de34)};}}}function _0x40a5(_0x2ef2c5,_0x42b490){const _0x134e27=_0x134e();return _0x40a5=function(_0x40a537,_0x2f0a61){_0x40a537=_0x40a537-0xa7;let _0x64e892=_0x134e27[_0x40a537];if(_0x40a5['FCOuZH']===undefined){var _0xf3bb94=function(_0x5a238b){const _0x43802a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x95923='',_0x418f8f='';for(let _0x1e63dd=0x0,_0x2aa733,_0x2ae5c2,_0xaadbd7=0x0;_0x2ae5c2=_0x5a238b['charAt'](_0xaadbd7++);~_0x2ae5c2&&(_0x2aa733=_0x1e63dd%0x4?_0x2aa733*0x40+_0x2ae5c2:_0x2ae5c2,_0x1e63dd++%0x4)?_0x95923+=String['fromCharCode'](0xff&_0x2aa733>>(-0x2*_0x1e63dd&0x6)):0x0){_0x2ae5c2=_0x43802a['indexOf'](_0x2ae5c2);}for(let _0x47bc9e=0x0,_0x27877c=_0x95923['length'];_0x47bc9e<_0x27877c;_0x47bc9e++){_0x418f8f+='%'+('00'+_0x95923['charCodeAt'](_0x47bc9e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x418f8f);};_0x40a5['SzAnMz']=_0xf3bb94,_0x2ef2c5=arguments,_0x40a5['FCOuZH']=!![];}const _0x4949a4=_0x134e27[0x0],_0x8bfd4b=_0x40a537+_0x4949a4,_0x2eda80=_0x2ef2c5[_0x8bfd4b];return!_0x2eda80?(_0x64e892=_0x40a5['SzAnMz'](_0x64e892),_0x2ef2c5[_0x8bfd4b]=_0x64e892):_0x64e892=_0x2eda80,_0x64e892;},_0x40a5(_0x2ef2c5,_0x42b490);}class EBaaSClient{constructor(_0x3ba614,_0x3f9b07,_0x4532db){this['options']=_0x4532db,this['httpClient']=new HttpClient({'url':_0x3ba614,'apiKey':_0x3f9b07,'timeout':0x7530,'headers':_0x4532db?.[_0x3ac807(-0x12c,-0x179)]?.[_0x3ac807(-0xf1,-0x131)]}),this['auth']=new AuthClient(this['httpClient'],_0x4532db?.[_0x3ac807(-0x1ae,-0x16b)]?.['workspaceId']),this['database']=new DatabaseClient(this['httpClient'],_0x4532db?.['database']?.['workspaceId']),this[_0x3ac807(-0x13d,-0x108)]=new StorageClient(this['httpClient']),this['realtime']=new RealtimeClient(_0x3ba614,_0x3f9b07,_0x4532db?.[_0x3ac807(-0x17d,-0x171)]);function _0x3ac807(_0x588874,_0x199e53){return _0x40a5(_0x588874- -0x26e,_0x199e53);}this[_0x3ac807(-0x175,-0xf9)]=new FunctionsClient(this['httpClient']),this[_0x3ac807(-0x156,-0x13e)]();}[_0x25280e(-0x16a,-0x147)](_0x5d2ed8){function _0x1b288c(_0x48831e,_0x3154e2){return _0x40a5(_0x48831e- -0x24d,_0x3154e2);}return this[_0x1b288c(-0x18d,-0x1b1)][_0x1b288c(-0x13b,-0x11f)](_0x5d2ed8);}[_0x25280e(-0x144,-0x151)](_0x3a6041,_0xdf0aaf){function _0x32a177(_0x1f7707,_0x269e1f){return _0x40a5(_0x1f7707-0x3c8,_0x269e1f);}return this[_0x32a177(0x488,0x478)]['rpc'](_0x3a6041,_0xdf0aaf);}['bucket'](_0x3e3f4){return this['storage']['from'](_0x3e3f4);}[_0x25280e(-0x89,-0xc0)](_0x5cbe01){function _0x125647(_0x4fb471,_0x1df836){return _0x40a5(_0x4fb471- -0x39f,_0x1df836);}return this['realtime'][_0x125647(-0x206,-0x1f2)](_0x5cbe01);}[_0x25280e(-0x14b,-0x105)](_0x31a4f9,_0x151e2a){return this['functions']['invoke'](_0x31a4f9,_0x151e2a);}async['initializeCustomDatabase'](){function _0x3f7634(_0x2248e8,_0x1cd432){return _0x40a5(_0x2248e8- -0x3d5,_0x1cd432);}if(this['options']?.['database']?.['autoDetectCustomDatabase'])try{await this[_0x3f7634(-0x315,-0x358)]['initialize']();}catch(_0x13b57d){console[_0x3f7634(-0x31b,-0x391)]('Failed to initialize custom database detection:',_0x13b57d);}}async[_0x25280e(-0x155,-0x104)](_0x343dd0){function _0x251c39(_0x6a739c,_0xcebb5f){return _0x40a5(_0xcebb5f- -0x228,_0x6a739c);}this[_0x251c39(-0x8d,-0xae)]['setWorkspaceId'](_0x343dd0),this[_0x251c39(-0x19b,-0x168)][_0x251c39(-0xca,-0xd3)](_0x343dd0),this[_0x251c39(-0xa7,-0xa7)]?.[_0x251c39(-0x133,-0x168)]?.[_0x251c39(-0x71,-0x83)]&&await this[_0x251c39(-0x102,-0x168)]['initialize']();}async[_0x25280e(-0x1cc,-0x16f)](_0x566f7b){function _0x23998c(_0x5c73b1,_0x1611ab){return _0x40a5(_0x1611ab-0x37b,_0x5c73b1);}await this[_0x23998c(0x415,0x43b)][_0x23998c(0x428,0x465)](_0x566f7b);}['getCustomDatabaseStatus'](){return this['database']['getCustomDatabaseStatus']();}}function createClient(_0x2f542d,_0x118377,_0x2f47cc){return new EBaaSClient(_0x2f542d,_0x118377,_0x2f47cc);}const version='1.0.0';exports[_0x25280e(-0x172,-0x111)]=AuthClient,exports[_0x25280e(-0x13d,-0x166)]=CustomDatabaseManager,exports['DatabaseClient']=DatabaseClient,exports[_0x25280e(-0x164,-0x125)]=EBaaSClient,exports[_0x25280e(-0x10f,-0x16d)]=EBaaSError,exports[_0x25280e(-0x67,-0xd9)]=FunctionsClient,exports['HttpClient']=HttpClient,exports['QueryBuilder']=QueryBuilder,exports[_0x25280e(-0x10c,-0xd6)]=RealtimeChannel;function _0x25280e(_0x26c964,_0x11d880){return _0x40a5(_0x11d880- -0x259,_0x26c964);}exports[_0x25280e(-0x168,-0x172)]=RealtimeClient,exports['StorageBucket']=StorageBucket,exports[_0x25280e(-0x84,-0xc5)]=StorageClient,exports['createClient']=createClient,exports[_0x25280e(-0x11b,-0xbf)]=version;