@e-techsolutions/e-baas-sdk 1.1.8 → 1.1.9
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 +1 -1
- package/dist/index.esm.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(stringArrayFunction,comparisonValue){const stringArray=stringArrayFunction();function _0x1ce845(_0x2de47c,_0x3b7bc8){return _0x4da2(_0x3b7bc8- -0x183,_0x2de47c);}while(!![]){try{const _0x5214f1=parseInt(_0x1ce845(0x155,0x16e))/0x1+-parseInt(_0x1ce845(0xd,0x84))/0x2*(-parseInt(_0x1ce845(0x74,0x71))/0x3)+-parseInt(_0x1ce845(0xaa,0xa6))/0x4+parseInt(_0x1ce845(0x148,0x13c))/0x5+parseInt(_0x1ce845(0xaf,0xed))/0x6+-parseInt(_0x1ce845(0x47,0x97))/0x7+-parseInt(_0x1ce845(0x15c,0x13d))/0x8;if(_0x5214f1===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x3c5f31){stringArray['push'](stringArray['shift']());}}}(_0x39f8,0x1c638));var axios=require(_0x347d1c(-0x104,-0x161));class EBaaSError extends Error{constructor(_0x10f038,status=0x0,_0x2bdc15){super(_0x10f038),this[_0xc1c899(0x3a5,0x3d3)]=_0xc1c899(0x382,0x3f7),this['status']=status;function _0xc1c899(_0x2c6972,_0x1adc51){return _0x4da2(_0x2c6972-0xbc,_0x1adc51);}this['details']=_0x2bdc15,Error[_0xc1c899(0x395,0x39a)]&&Error[_0xc1c899(0x395,0x3b9)](this,EBaaSError);}[_0x347d1c(-0x44,-0xa8)](){function _0x579ec6(_0x472a60,_0x422bd3){return _0x4da2(_0x422bd3-0x255,_0x472a60);}return{'name':this[_0x579ec6(0x52e,0x53e)],'message':this['message'],'status':this['status'],'details':this['details'],'stack':this['stack']};}[_0x347d1c(-0xfb,-0x110)](){function _0x5b692f(_0x7455a9,_0x55739f){return _0x4da2(_0x55739f- -0x2c5,_0x7455a9);}return this['name']+':\x20'+this[_0x5b692f(0x4a,-0x9)]+'\x20(Status:\x20'+this[_0x5b692f(-0x14a,-0xc1)]+')';}}class HttpClient{constructor(config){this['baseURL']=config['url'],this[_0x560215(0x138,0x196)]=config[_0x560215(0x1fc,0x196)],this[_0x560215(0x22c,0x25a)]=axios[_0x560215(0x1eb,0x223)]({'baseURL':this['baseURL'],'timeout':config['timeout']||0x2710,'headers':{'Content-Type':'application/json','apikey':this[_0x560215(0x18d,0x196)],...config['headers']}});function _0x560215(_0x47a710,_0x5a2472){return _0x4da2(_0x5a2472- -0x56,_0x47a710);}this[_0x560215(0x20d,0x1f9)]();}['setupInterceptors'](){function _0x4d8a55(_0x3a4b66,_0x34f415){return _0x4da2(_0x34f415- -0x313,_0x3a4b66);}this['client']['interceptors'][_0x4d8a55(0x36,-0x30)][_0x4d8a55(-0xf0,-0xdd)](config=>{return config;},_0x32cfaf=>{function _0x5443fb(_0x2a4600,_0xc89296){return _0x4da2(_0x2a4600- -0x9,_0xc89296);}return Promise['reject'](new EBaaSError(_0x5443fb(0x234,0x249),0x0,_0x32cfaf));}),this['client'][_0x4d8a55(0x5,-0x49)]['response']['use'](response=>{return response;},_0x55abfb=>{const status=_0x55abfb[_0x4f0201(0x486,0x502)]?.['status']||0x0,_0x32fd56=_0x55abfb['response']?.['data']?.['message']||_0x55abfb['message']||'Unknown\x20error';function _0x4f0201(_0x3b4118,_0x129ea7){return _0x4da2(_0x3b4118-0x215,_0x129ea7);}const _0x2c2b64=_0x55abfb['response']?.[_0x4f0201(0x444,0x4ac)]||_0x55abfb;return Promise[_0x4f0201(0x427,0x48a)](new EBaaSError(_0x32fd56,status,_0x2c2b64));});}async['get'](_0x273d4c,config){function _0x751f87(_0x52571f,_0x289f50){return _0x4da2(_0x52571f- -0x4d,_0x289f50);}try{const response=await this['client'][_0x751f87(0x2a1,0x2d6)](_0x273d4c,config);return{'data':response[_0x751f87(0x1e2,0x193)],'status':response['status'],'statusText':response[_0x751f87(0x1d6,0x1d2)],'headers':response['headers']};}catch(_0x1d5089){throw this[_0x751f87(0x1b8,0x1a3)](_0x1d5089);}}async[_0x347d1c(-0x77,-0xac)](_0x302d7d,data,config){function _0x129c50(_0x5c206f,_0xa69451){return _0x4da2(_0xa69451- -0x37a,_0x5c206f);}try{const response=await this[_0x129c50(-0x124,-0xca)]['post'](_0x302d7d,data,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response[_0x129c50(-0x135,-0x180)]};}catch(_0x4a4919){throw this['handleError'](_0x4a4919);}}async['put'](_0x298578,data,config){function _0xdf1677(_0x104f03,_0x694750){return _0x4da2(_0x694750- -0x243,_0x104f03);}try{const response=await this[_0xdf1677(-0xe,0x6d)]['put'](_0x298578,data,config);return{'data':response[_0xdf1677(0x2b,-0x14)],'status':response[_0xdf1677(0x4d,-0x3f)],'statusText':response[_0xdf1677(0x4e,-0x20)],'headers':response[_0xdf1677(-0xb9,-0x49)]};}catch(_0x4f9adc){throw this['handleError'](_0x4f9adc);}}async[_0x347d1c(-0x1af,-0x172)](_0x1a0b0b,data,config){function _0x4192b8(_0x59235c,_0x568144){return _0x4da2(_0x59235c-0x19f,_0x568144);}try{const response=await this['client']['patch'](_0x1a0b0b,data,config);return{'data':response[_0x4192b8(0x3ce,0x435)],'status':response[_0x4192b8(0x3a3,0x3f4)],'statusText':response[_0x4192b8(0x3c2,0x434)],'headers':response[_0x4192b8(0x399,0x3c7)]};}catch(_0x2d78e7){throw this[_0x4192b8(0x3a4,0x345)](_0x2d78e7);}}async[_0x347d1c(-0x121,-0xcc)](_0x14fdd8,config){function _0x47cf99(_0x273e67,_0x440629){return _0x4da2(_0x273e67- -0x248,_0x440629);}try{const response=await this['client'][_0x47cf99(0x66,0xde)](_0x14fdd8,config);return{'data':response[_0x47cf99(-0x19,-0xa3)],'status':response['status'],'statusText':response[_0x47cf99(-0x25,-0x7)],'headers':response['headers']};}catch(_0x4490e3){throw this['handleError'](_0x4490e3);}}[_0x347d1c(-0x1aa,-0x182)](_0x3b4cf2){function _0x523906(_0x175ea1,_0x57822e){return _0x4da2(_0x175ea1-0x387,_0x57822e);}this[_0x523906(0x637,0x6b3)]['defaults'][_0x523906(0x581,0x5da)][_0x523906(0x584,0x60e)]['Authorization']='Bearer\x20'+_0x3b4cf2;}[_0x347d1c(-0x17c,-0x140)](){function _0x2025f7(_0x58dbbb,_0x181825){return _0x4da2(_0x181825-0x57,_0x58dbbb);}delete this['client'][_0x2025f7(0x309,0x2bb)]['headers']['common']['Authorization'],this['client']['defaults'][_0x2025f7(0x252,0x251)]['common']['Authorization']=_0x2025f7(0x23f,0x256)+this[_0x2025f7(0x283,0x243)];}[_0x347d1c(-0x11a,-0x175)](_0x36d121){if(_0x36d121 instanceof EBaaSError)return _0x36d121;function _0x48f40d(_0x4cf509,_0x5ccfcd){return _0x4da2(_0x5ccfcd-0x13f,_0x4cf509);}return new EBaaSError(_0x36d121[_0x48f40d(0x386,0x3fb)]||_0x48f40d(0x37c,0x34c),_0x36d121[_0x48f40d(0x312,0x343)]||0x0,_0x36d121);}}class AuthClient{constructor(_0x13f2d5,_0x17e455){this['currentSession']=null;function _0x506a69(_0x497108,_0x1f7f46){return _0x4da2(_0x1f7f46-0x199,_0x497108);}this[_0x506a69(0x46b,0x439)]=_0x13f2d5,this['workspaceId']=_0x17e455,this['loadSession']();}async['signUp'](data){function _0x21b0fe(_0x2c860f,_0x1b8195){return _0x4da2(_0x1b8195-0x108,_0x2c860f);}try{const response=await this['httpClient']['post']('/auth/v1/signup',data);return response[_0x21b0fe(0x309,0x337)][_0x21b0fe(0x412,0x3a7)]&&this['setSessionInternal'](response[_0x21b0fe(0x2c7,0x337)]['session']),response[_0x21b0fe(0x37a,0x337)];}catch(_0x5161f0){throw this[_0x21b0fe(0x429,0x3f3)](_0x5161f0);}}async['signIn'](data){function _0x549db0(_0x188d7d,_0x15aeb0){return _0x4da2(_0x188d7d-0x24c,_0x15aeb0);}try{const headers={};this['workspaceId']&&(headers['X-Workspace-ID']=this['workspaceId']);const response=await this[_0x549db0(0x4ec,0x4c4)]['post']('/auth/v1/sdk/signin',data,{'headers':headers});return response['data'][_0x549db0(0x4eb,0x4f7)]&&this[_0x549db0(0x487,0x480)](response['data'][_0x549db0(0x4eb,0x49a)]),response[_0x549db0(0x47b,0x3fd)];}catch(_0x27a86b){throw this['handleAuthError'](_0x27a86b);}}async['signOut'](){function _0xa0e8e4(_0x397c0e,_0xe9eb4a){return _0x4da2(_0xe9eb4a- -0x19a,_0x397c0e);}try{await this['httpClient'][_0xa0e8e4(0x178,0x134)]('/auth/v1/signout'),this[_0xa0e8e4(0xaf,0x59)]();}catch(_0x5e4a23){this[_0xa0e8e4(-0x16,0x59)]();throw this['handleAuthError'](_0x5e4a23);}}async['getUser'](){if(!this[_0x1801ef(0x2f1,0x2c0)]?.[_0x1801ef(0x2c7,0x2cc)])return null;function _0x1801ef(_0x436155,_0x2196bf){return _0x4da2(_0x2196bf-0x66,_0x436155);}try{const response=await this[_0x1801ef(0x33b,0x306)][_0x1801ef(0x2ef,0x354)]('/auth/v1/user');return response['data'][_0x1801ef(0x26d,0x28a)];}catch(_0x2f86dc){if(_0x2f86dc instanceof EBaaSError&&_0x2f86dc['status']===0x191)return this['clearSession'](),null;throw this['handleAuthError'](_0x2f86dc);}}async['refreshSession'](){if(!this[_0x2f060c(0x483,0x3fe)]?.[_0x2f060c(0x462,0x41f)])return null;function _0x2f060c(_0x24059a,_0x40cc52){return _0x4da2(_0x40cc52-0x1a4,_0x24059a);}try{const response=await this[_0x2f060c(0x488,0x444)][_0x2f060c(0x40c,0x472)]('/auth/v1/refresh',{'refresh_token':this[_0x2f060c(0x3fc,0x3fe)]['refresh_token']});if(response[_0x2f060c(0x44d,0x3d3)]['session'])return this['setSession'](response['data']['session']),response['data']['session'];return null;}catch(_0x3d8f79){this['clearSession']();throw this['handleAuthError'](_0x3d8f79);}}async[_0x347d1c(-0x1e2,-0x164)](_0x41fafa){try{await this['httpClient']['post']('/auth/v1/reset-password',{'email':_0x41fafa});}catch(_0x56046d){throw this['handleAuthError'](_0x56046d);}}async['updateUser'](data){function _0x2c3f79(_0x581cf0,_0x3683f8){return _0x4da2(_0x3683f8-0x30,_0x581cf0);}try{const response=await this[_0x2c3f79(0x2a3,0x2d0)]['put']('/auth/v1/user',data);return response['data']['user'];}catch(_0x281f9a){throw this['handleAuthError'](_0x281f9a);}}[_0x347d1c(-0x18d,-0x12a)](){function _0x4d4900(_0x39a42d,_0xcef37f){return _0x4da2(_0x39a42d- -0x221,_0xcef37f);}return this[_0x4d4900(0x39,-0x6)];}[_0x347d1c(-0xe2,-0x11d)](_0x29b8ef){function _0x19cefb(_0x1bb1aa,_0x193b45){return _0x4da2(_0x193b45-0x323,_0x1bb1aa);}this['currentSession']=_0x29b8ef,this[_0x19cefb(0x5cf,0x5c3)][_0x19cefb(0x57e,0x51b)](_0x29b8ef[_0x19cefb(0x501,0x589)]),typeof localStorage!==_0x19cefb(0x605,0x5f9)&&localStorage[_0x19cefb(0x53f,0x5b0)](_0x19cefb(0x589,0x554),JSON[_0x19cefb(0x554,0x5c1)](_0x29b8ef));}['onAuthStateChange'](_0x3aea52){return()=>{};}[_0x347d1c(-0x39,-0x95)](_0x144442){function _0x19b76c(_0x32a6fe,_0x137d99){return _0x4da2(_0x137d99- -0xe,_0x32a6fe);}this[_0x19b76c(0x258,0x29b)]=_0x144442;}[_0x347d1c(-0x16c,-0x13f)](_0x45251c){function _0x3bee88(_0x4df9b4,_0x4e2f7f){return _0x4da2(_0x4e2f7f-0x2a6,_0x4df9b4);}this['currentSession']=_0x45251c,this['httpClient'][_0x3bee88(0x4fb,0x49e)](_0x45251c[_0x3bee88(0x528,0x50c)]),typeof localStorage!==_0x3bee88(0x58f,0x57c)&&localStorage['setItem'](_0x3bee88(0x543,0x4d7),JSON['stringify'](_0x45251c));}[_0x347d1c(-0x1eb,-0x187)](){this['currentSession']=null;function _0x4e8854(_0x20f2b0,_0x3db7ae){return _0x4da2(_0x3db7ae- -0x2d9,_0x20f2b0);}this[_0x4e8854(-0x29,-0x39)]['removeAuthToken'](),typeof localStorage!==_0x4e8854(-0x57,-0x3)&&localStorage['removeItem'](_0x4e8854(-0xd4,-0xa8));}[_0x347d1c(-0x117,-0x171)](){function _0x1a73d4(_0xb882c8,_0x321617){return _0x4da2(_0xb882c8-0x22c,_0x321617);}if(typeof localStorage!==_0x1a73d4(0x502,0x543)){const _0x1d4207=localStorage[_0x1a73d4(0x43f,0x457)]('ebaas.auth.session');if(_0x1d4207)try{const _0x3d7219=JSON['parse'](_0x1d4207);this[_0x1a73d4(0x467,0x448)](_0x3d7219);}catch(_0x2f307f){this[_0x1a73d4(0x41f,0x3de)]();}}}[_0x347d1c(-0xcc,-0x8f)](_0x6baf90){function _0x20958b(_0x2d9f8a,_0x1e9151){return _0x4da2(_0x1e9151- -0x381,_0x2d9f8a);}if(_0x6baf90 instanceof EBaaSError)return _0x6baf90;return new EBaaSError(_0x6baf90[_0x20958b(-0xa0,-0xc5)]||'Authentication\x20failed',_0x6baf90['status']||0x0,_0x6baf90);}}class QueryBuilder{constructor(_0x5e64eb,_0x1c718c,_0x5c56de,_0x2c6d12){this['httpClient']=_0x5e64eb,this[_0x4eba93(0x2b0,0x2a5)]=_0x1c718c,this[_0x4eba93(0x262,0x251)]=_0x5c56de,this[_0x4eba93(0x28c,0x208)]=_0x2c6d12;function _0x4eba93(_0x1356dc,_0x1271b9){return _0x4da2(_0x1356dc- -0x1d,_0x1271b9);}this['query']={'filters':[]};}[_0x347d1c(-0xc2,-0xe8)](_0x48584a='*',_0x307ac9){return this['query']['select']=_0x48584a,this;}['insert'](data,_0x4b8db6){return this['executeQuery']('POST','/sdk/v1/'+this['table']+'?operation=insert',{'data':data,'options':_0x4b8db6});}[_0x347d1c(-0x111,-0x18f)](data,_0x538343){function _0x57571d(_0x5adeca,_0x227996){return _0x4da2(_0x227996- -0x346,_0x5adeca);}return this[_0x57571d(-0x9d,-0x71)][_0x57571d(-0x12f,-0xe7)]=data,this[_0x57571d(-0xdc,-0x71)][_0x57571d(-0x185,-0x158)]=_0x538343,this;}[_0x347d1c(-0xfc,-0xde)](data,_0x2455a0){function _0x19a1b3(_0x313c14,_0x142b20){return _0x4da2(_0x142b20- -0xd9,_0x313c14);}return this['executeQuery']('POST','/sdk/v1/'+this[_0x19a1b3(0x20f,0x1f4)]+'?operation=upsert',{'data':data,'options':{..._0x2455a0,'upsert':!![]}});}[_0x347d1c(-0xe9,-0xcc)](_0x2d8268){this[_0x13a751(0x27f,0x207)][_0x13a751(0x194,0x1e6)]=_0x2d8268,this['query']['isDelete']=!![];function _0x13a751(_0x54276b,_0x4b0d9d){return _0x4da2(_0x4b0d9d- -0xce,_0x54276b);}return this;}['eq'](_0x369da7,_0x10430e){this[_0x472bd2(0x587,0x5ab)][_0x472bd2(0x529,0x52a)][_0x472bd2(0x4fd,0x567)]({'column':_0x369da7,'operator':'eq','value':_0x10430e});function _0x472bd2(_0x54ad73,_0x38cbc1){return _0x4da2(_0x38cbc1-0x2d6,_0x54ad73);}return this;}[_0x347d1c(-0xd6,-0x8a)](_0x436bc2,_0x90c880){this['query'][_0x22c2f4(-0xb0,-0x131)]['push']({'column':_0x436bc2,'operator':'neq','value':_0x90c880});function _0x22c2f4(_0x4b32c8,_0x36553c){return _0x4da2(_0x36553c- -0x385,_0x4b32c8);}return this;}['gt'](_0x33fcb5,_0x100d35){function _0x135b32(_0x11bd1d,_0x6e0baf){return _0x4da2(_0x6e0baf-0x1d9,_0x11bd1d);}return this['query']['filters'][_0x135b32(0x475,0x46a)]({'column':_0x33fcb5,'operator':'gt','value':_0x100d35}),this;}['gte'](_0x13e68e,_0x4d76a5){this['query'][_0x3590ce(0x162,0x1de)][_0x3590ce(0x281,0x21b)]({'column':_0x13e68e,'operator':_0x3590ce(0x1c9,0x1c9),'value':_0x4d76a5});function _0x3590ce(_0x4c94e5,_0x4c7ac4){return _0x4da2(_0x4c7ac4- -0x76,_0x4c94e5);}return this;}['lt'](_0x128adc,_0x125bf6){this[_0x17281f(0x551,0x50b)][_0x17281f(0x4d0,0x541)]['push']({'column':_0x128adc,'operator':'lt','value':_0x125bf6});function _0x17281f(_0x1195c8,_0x4372b1){return _0x4da2(_0x1195c8-0x27c,_0x4372b1);}return this;}[_0x347d1c(-0x98,-0xe3)](_0x377eaa,_0x162a29){function _0x29c5f8(_0x413741,_0x2b52cc){return _0x4da2(_0x2b52cc-0x2fb,_0x413741);}return this[_0x29c5f8(0x552,0x5d0)]['filters']['push']({'column':_0x377eaa,'operator':'lte','value':_0x162a29}),this;}['like'](_0x2f1905,_0x4e320e){this['query'][_0x509996(-0x56,-0x71)][_0x509996(-0x19,-0x83)]({'column':_0x2f1905,'operator':_0x509996(-0x64,0x1b),'value':_0x4e320e});function _0x509996(_0xc0b8c3,_0x52f239){return _0x4da2(_0xc0b8c3- -0x2aa,_0x52f239);}return this;}[_0x347d1c(-0x178,-0x13c)](_0x45d735,_0x1b6cbf){return this['query']['filters']['push']({'column':_0x45d735,'operator':'ilike','value':_0x1b6cbf}),this;}['is'](_0x58b65f,_0x256537){this[_0x124f13(0x76,0x53)]['filters']['push']({'column':_0x58b65f,'operator':'is','value':_0x256537});function _0x124f13(_0x3600bb,_0x580011){return _0x4da2(_0x3600bb- -0x25f,_0x580011);}return this;}['in'](_0x153d99,_0x394efe){this['query'][_0x1dfd88(0x3c,0x76)]['push']({'column':_0x153d99,'operator':'in','value':_0x394efe});function _0x1dfd88(_0x12091e,_0x358d6e){return _0x4da2(_0x12091e- -0x218,_0x358d6e);}return this;}[_0x347d1c(-0xf9,-0x87)](_0x105275,_0xbedd54){this[_0x56a46a(0x19c,0x174)][_0x56a46a(0x11a,0xf3)]['push']({'column':_0x105275,'operator':'contains','value':_0xbedd54});function _0x56a46a(_0x24e5e3,_0x290930){return _0x4da2(_0x290930- -0x161,_0x24e5e3);}return this;}['match'](_0x4baaed){function _0x48b66d(_0x3747a0,_0x485ed7){return _0x4da2(_0x485ed7-0x74,_0x3747a0);}return Object[_0x48b66d(0x2cc,0x2db)](_0x4baaed)['forEach'](([_0x3fbb88,_0x268bab])=>{this['eq'](_0x3fbb88,_0x268bab);}),this;}['order'](_0x3a5f58,_0x12ba10){function _0xffbc3c(_0x2b1e5f,_0x512cb7){return _0x4da2(_0x512cb7-0x19b,_0x2b1e5f);}return!this[_0xffbc3c(0x4a0,0x470)]['order']&&(this[_0xffbc3c(0x455,0x470)]['order']=[]),this['query']['order']['push']({'column':_0x3a5f58,'ascending':_0x12ba10?.[_0xffbc3c(0x3f3,0x38a)]!==![]}),this;}['limit'](count){function _0x2ec6c0(_0x227bf3,_0x6a8a01){return _0x4da2(_0x6a8a01- -0x1cf,_0x227bf3);}return this[_0x2ec6c0(0x8c,0x106)]['limit']=count,this;}[_0x347d1c(-0x1cb,-0x17c)](from,_0x438054){return this['query']['range']={'from':from,'to':_0x438054},this;}async[_0x347d1c(-0xe2,-0xfc)](){function _0x42e57f(_0x1b8049,_0x2207fb){return _0x4da2(_0x1b8049-0x303,_0x2207fb);}if(this['query'][_0x42e57f(0x562,0x53b)])return this['executeQuery']('PATCH','/sdk/v1/'+this[_0x42e57f(0x5d0,0x5c5)],{'data':this['query']['updateData'],'options':this[_0x42e57f(0x5d8,0x638)][_0x42e57f(0x4f1,0x479)],'filters':this['query']['filters']});else return this['query'][_0x42e57f(0x548,0x4ef)]?this['executeQuery']('DELETE','/sdk/v1/'+this['table']+_0x42e57f(0x556,0x51c),{'options':this['query']['deleteOptions'],'filters':this[_0x42e57f(0x5d8,0x64a)]['filters']}):this[_0x42e57f(0x57a,0x541)]('GET','/sdk/v1/'+this[_0x42e57f(0x5d0,0x5dc)]+'?operation=select',{'select':this['query'][_0x42e57f(0x595,0x5e8)],'filters':this['query'][_0x42e57f(0x557,0x529)],'order':this['query'][_0x42e57f(0x55f,0x5cd)],'limit':this[_0x42e57f(0x5d8,0x602)]['limit'],'range':this['query'][_0x42e57f(0x501,0x566)]});}async['single'](){this['limit'](0x1);function _0x4dfaf5(_0x482014,_0x48a72d){return _0x4da2(_0x482014-0x3e,_0x48a72d);}const result=await this[_0x4dfaf5(0x2bc,0x274)]();return{'data':result['data']?.[0x0]||null,'error':result['error']};}async['executeQuery'](_0x48f0e3,_0x4b71b0,_0xee62e2){function _0x19f7cb(_0x34c6c4,_0x257492){return _0x4da2(_0x257492- -0x210,_0x34c6c4);}try{let response;const headers={};this[_0x19f7cb(0x116,0x99)]&&(headers['x-workspace-id']=this[_0x19f7cb(0xa6,0x99)]);if(_0x48f0e3==='GET'){const _0x5d9b4e=_0x4b71b0[_0x19f7cb(-0x2,0x64)]('?'),_0x403577=_0x5d9b4e[0x0],existingParams=new URLSearchParams(_0x5d9b4e[0x1]||'');if(_0xee62e2[_0x19f7cb(0x55,0x82)])existingParams['append']('select',_0xee62e2[_0x19f7cb(0x33,0x82)]);_0xee62e2['filters']?.[_0x19f7cb(0xc5,0x74)]&&_0xee62e2['filters']['forEach'](filter=>{function _0x424189(_0x469a48,_0x3a58a7){return _0x4da2(_0x469a48-0x40,_0x3a58a7);}existingParams['append'](filter[_0x424189(0x301,0x362)],filter[_0x424189(0x24e,0x23d)]+'.'+filter[_0x424189(0x24a,0x2cd)]);});if(_0xee62e2['order']?.[_0x19f7cb(0xe7,0x74)]){const orderStr=_0xee62e2['order']['map'](_0x445c1e=>''+_0x445c1e[_0x19f7cb(0xed,0xb1)]+(_0x445c1e['ascending']?'.asc':_0x19f7cb(0xb1,0x4b)))['join'](',');existingParams['append']('order',orderStr);}if(_0xee62e2[_0x19f7cb(0x134,0xcf)])existingParams[_0x19f7cb(0x19,0x9b)](_0x19f7cb(0xc3,0xcf),_0xee62e2[_0x19f7cb(0x13b,0xcf)]['toString']());_0xee62e2['range']&&(existingParams[_0x19f7cb(0xbb,0x9b)]('offset',_0xee62e2['range'][_0x19f7cb(0xd3,0xef)]['toString']()),existingParams[_0x19f7cb(0x1d,0x9b)]('limit',(_0xee62e2[_0x19f7cb(-0xe,-0x12)]['to']-_0xee62e2['range']['from']+0x1)[_0x19f7cb(0x99,0x5a)]())),response=await this[_0x19f7cb(0xc0,0x90)][_0x19f7cb(0xcf,0xde)](_0x403577+'?'+existingParams[_0x19f7cb(0xd3,0x5a)](),{'headers':headers});}else{if(_0x48f0e3==='DELETE'){const _0x3023eb=_0x4b71b0[_0x19f7cb(0xd3,0x64)]('?'),_0x50b941=_0x3023eb[0x0],existingParams=new URLSearchParams(_0x3023eb[0x1]||'');!existingParams[_0x19f7cb(0xb1,0xd8)]('operation')&&existingParams[_0x19f7cb(0xe0,0x9b)]('operation','delete');_0xee62e2['filters']?.[_0x19f7cb(-0x16,0x74)]&&_0xee62e2['filters'][_0x19f7cb(0x53,0x10)](filter=>{function _0x5b11a1(_0x4c974a,_0x4ae7c8){return _0x4da2(_0x4c974a- -0x47,_0x4ae7c8);}existingParams['append'](filter[_0x5b11a1(0x27a,0x2db)],filter[_0x5b11a1(0x1c7,0x1e0)]+'.'+filter['value']);});const deleteUrl=_0x50b941+'?'+existingParams[_0x19f7cb(0x62,0x5a)]();console['log']('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console[_0x19f7cb(0x92,0x6a)]('\uD83D\uDD27 DELETE headers:',headers),console[_0x19f7cb(0x77,0x6a)]('\uD83D\uDD27 DELETE filtros originais:',_0xee62e2[_0x19f7cb(0x87,0x44)]),response=await this['httpClient'][_0x19f7cb(0x11a,0x9e)](deleteUrl,{'headers':headers});}else{if(_0x48f0e3==='PATCH'){const _0x131e9f=_0x4b71b0['split']('?'),_0x10f53c=_0x131e9f[0x0],existingParams=new URLSearchParams(_0x131e9f[0x1]||'');!existingParams['has'](_0x19f7cb(0xde,0x83))&&existingParams['append'](_0x19f7cb(0x42,0x83),'update');_0xee62e2['filters']?.['length']&&_0xee62e2['filters']['forEach'](filter=>{function _0xe5713a(_0x3697b4,_0x313cc8){return _0x4da2(_0x313cc8-0x3c7,_0x3697b4);}existingParams['append'](filter['column'],filter[_0xe5713a(0x591,0x5d5)]+'.'+filter['value']);});_0xee62e2['options']?.[_0x19f7cb(0xf9,0x9d)]&&(headers[_0x19f7cb(-0x2e,0x39)]=_0xee62e2[_0x19f7cb(0x34,0xb8)]['prefer']);const updateUrl=_0x10f53c+'?'+existingParams['toString']();response=await this[_0x19f7cb(0x2b,0x90)]['patch'](updateUrl,_0xee62e2[_0x19f7cb(-0x2f,0x1f)],{'headers':headers});}else{let _0x5c0183=_0xee62e2[_0x19f7cb(0x9a,0x1f)];!headers['Prefer']&&(headers['Prefer']='return=representation'),_0xee62e2[_0x19f7cb(0x42,0xb8)]?.['upsert']&&(headers['Prefer']='resolution=merge-duplicates,return=representation'),_0xee62e2['dataArray']&&(_0x5c0183=_0xee62e2[_0x19f7cb(0xc4,0xa1)]),response=await this['httpClient'][_0x19f7cb(0x12e,0xbe)](_0x4b71b0,_0x5c0183,{'headers':headers});}}}return{'data':response['data'],'error':null,'count':response[_0x19f7cb(-0x2f,-0x16)]?.['x-total-count']?parseInt(response[_0x19f7cb(-0x88,-0x16)]['x-total-count']):undefined};}catch(_0x252d04){return{'data':null,'error':_0x252d04 instanceof EBaaSError?_0x252d04:new EBaaSError(_0x252d04 instanceof Error?_0x252d04['message']:_0x19f7cb(0x7c,0x77),0x0,_0x252d04)};}}}function _0x347d1c(_0x3ae3e3,_0x175749){return _0x4da2(_0x175749- -0x37a,_0x3ae3e3);}class CustomDatabaseManager{constructor(_0x19e708,_0x227194){this[_0xa8ed0a(0x3a4,0x363)]=_0x19e708;function _0xa8ed0a(_0x2a095c,_0x50f902){return _0x4da2(_0x50f902-0xc3,_0x2a095c);}this[_0xa8ed0a(0x340,0x36c)]=_0x227194;}async[_0x347d1c(-0xc6,-0x14c)](){if(!this[_0x229fb8(0x2a0,0x240)])return{'hasCustomDatabase':![]};function _0x229fb8(_0x5edbd0,_0x333b6a){return _0x4da2(_0x333b6a- -0x69,_0x5edbd0);}try{const response=await this[_0x229fb8(0x252,0x237)][_0x229fb8(0x220,0x285)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response['status']===0xc8&&response[_0x229fb8(0x1fd,0x1c6)]?.[_0x229fb8(0x16c,0x1db)]){const config=response['data'][_0x229fb8(0x246,0x1db)],_0xbf5c1e={'host':config[_0x229fb8(0x25a,0x28f)],'port':config['postgresPort'],'database':config['postgresDatabase'],'username':config[_0x229fb8(0x1fc,0x1ee)],'password':'','schema':config[_0x229fb8(0x254,0x1d3)],'sslEnabled':config['sslEnabled']};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0xbf5c1e},this['detectedConfig'];}}catch(_0x6e1bd7){if(_0x6e1bd7?.['status']===0x194)return this[_0x229fb8(0x104,0x184)]={'hasCustomDatabase':![]},this[_0x229fb8(0x1e4,0x184)];console['warn']('Failed to detect custom database configuration:',_0x6e1bd7);}return this['detectedConfig']={'hasCustomDatabase':![]},this[_0x229fb8(0x210,0x184)];}async[_0x347d1c(-0x1cc,-0x14e)](_0x57f679){function _0x5f1d5b(_0x4f769b,_0x22b3d6){return _0x4da2(_0x4f769b-0x197,_0x22b3d6);}try{const response=await this[_0x5f1d5b(0x437,0x3c7)]['post']('/admin/v1/workspace/custom-database/test-connection',_0x57f679,{'headers':this[_0x5f1d5b(0x440,0x4bd)]?{'X-Workspace-ID':this[_0x5f1d5b(0x440,0x3e0)]}:{}});return response['data'];}catch(_0x4aaacf){return{'success':![],'message':_0x4aaacf?.[_0x5f1d5b(0x453,0x3fc)]||_0x5f1d5b(0x3fc,0x3e9)};}}async['configureCustomDatabase'](_0x278f1d){if(!this[_0x481770(-0xda,-0xc6)])throw new Error('Workspace ID is required to configure custom database');const response=await this[_0x481770(-0xaa,-0xcf)][_0x481770(-0x7f,-0xa1)]('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x278f1d},{'headers':{'X-Workspace-ID':this[_0x481770(-0xea,-0xc6)]}}),config=response[_0x481770(-0x1ab,-0x140)]['config'];function _0x481770(_0x260f43,_0xa5c1bf){return _0x4da2(_0xa5c1bf- -0x36f,_0x260f43);}return this[_0x481770(-0x1d1,-0x182)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x278f1d},config;}async['removeCustomDatabase'](){function _0x11fda6(_0x2efae5,_0x5554d4){return _0x4da2(_0x5554d4-0x15d,_0x2efae5);}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[_0x11fda6(0x3c1,0x406)]}}),this[_0x11fda6(0x366,0x34a)]={'hasCustomDatabase':![]};}['getDetectedConfig'](){return this['detectedConfig'];}['hasCustomDatabase'](){function _0xd1e9c5(_0x3bace3,_0xc16160){return _0x4da2(_0xc16160- -0x7a,_0x3bace3);}return this[_0xd1e9c5(0x1f3,0x173)]?.[_0xd1e9c5(0x299,0x275)]??![];}[_0x347d1c(-0xf3,-0x8e)](){function _0x4df45b(_0x13d91e,_0x2b4c0f){return _0x4da2(_0x13d91e-0x22c,_0x2b4c0f);}return this[_0x4df45b(0x419,0x3b4)]?.['credentials'];}['setWorkspaceId'](_0x4c375e){this['workspaceId']=_0x4c375e,this['detectedConfig']=undefined;}['getWorkspaceId'](){function _0x525561(_0x3e99d0,_0x49ea06){return _0x4da2(_0x49ea06- -0x21b,_0x3e99d0);}return this[_0x525561(0xe5,0x8e)];}[_0x347d1c(-0xa2,-0xd6)](){function _0x39397b(_0x29e140,_0x2fdde7){return _0x4da2(_0x2fdde7-0x8,_0x29e140);}return{'workspaceId':this['workspaceId'],'hasConfig':this[_0x39397b(0x365,0x2f7)](),'configDetails':this[_0x39397b(0x27b,0x1f5)]?.[_0x39397b(0x2b6,0x24f)]?{'host':this[_0x39397b(0x1a0,0x1f5)]['credentials'][_0x39397b(0x1d9,0x266)],'port':this[_0x39397b(0x1ec,0x1f5)][_0x39397b(0x2d2,0x24f)][_0x39397b(0x1fa,0x238)],'database':this['detectedConfig'][_0x39397b(0x294,0x24f)][_0x39397b(0x273,0x1f8)],'schema':this[_0x39397b(0x250,0x1f5)]['credentials'][_0x39397b(0x2cd,0x287)]||_0x39397b(0x336,0x2cf),'sslEnabled':this['detectedConfig']['credentials'][_0x39397b(0x334,0x2e5)]||![]}:undefined};}}class DatabaseClient{constructor(_0x4f2eaa,_0x10cad0){function _0x4829c1(_0x4e1ba5,_0x4d54ef){return _0x4da2(_0x4e1ba5-0xe8,_0x4d54ef);}this[_0x4829c1(0x388,0x3bb)]=_0x4f2eaa,this['customDatabaseManager']=new CustomDatabaseManager(_0x4f2eaa,_0x10cad0);}['from'](_0x342e46){return new QueryBuilder(this['httpClient'],_0x342e46,this['currentSchema'],this['customDatabaseManager']['getWorkspaceId']());}['rpc'](_0x97b450,_0x34b1bb){function _0x219980(_0x1747c5,_0x3ac50e){return _0x4da2(_0x1747c5- -0x352,_0x3ac50e);}return this[_0x219980(-0xb2,-0x13a)][_0x219980(-0x84,-0xbd)](_0x219980(-0x150,-0x1af)+_0x97b450,_0x34b1bb);}[_0x347d1c(-0x186,-0xfb)](_0x3847a9){const _0x26a4ad=new DatabaseClient(this['httpClient'],this[_0x1890d6(0x420,0x493)]['getWorkspaceId']());_0x26a4ad[_0x1890d6(0x436,0x400)]=_0x3847a9;function _0x1890d6(_0x4b7aaa,_0x228a88){return _0x4da2(_0x228a88-0x1f0,_0x4b7aaa);}return _0x26a4ad['customDatabaseManager']=this[_0x1890d6(0x413,0x493)],_0x26a4ad;}async[_0x347d1c(-0x12f,-0x14c)](){function _0x330222(_0x4fbc11,_0x2f8075){return _0x4da2(_0x4fbc11- -0x1c,_0x2f8075);}return this[_0x330222(0x287,0x2c7)][_0x330222(0x212,0x22f)]();}async['testCustomConnection'](_0x3e5d5e){function _0x54f228(_0x4f7a06,_0x1bcae9){return _0x4da2(_0x4f7a06- -0x280,_0x1bcae9);}return this[_0x54f228(0x23,0xab)][_0x54f228(-0x54,-0x62)](_0x3e5d5e);}async[_0x347d1c(-0x12b,-0xd5)](_0x5c0ee4){function _0x4e8387(_0x5dae32,_0x360263){return _0x4da2(_0x5dae32- -0x225,_0x360263);}return this['customDatabaseManager'][_0x4e8387(0x80,-0x6)](_0x5c0ee4);}async[_0x347d1c(-0x5d,-0xbf)](){function _0x4a39f9(_0x43eb86,_0x25a4c3){return _0x4da2(_0x25a4c3-0x2c1,_0x43eb86);}return this[_0x4a39f9(0x594,0x564)][_0x4a39f9(0x514,0x57c)]();}['isUsingCustomDatabase'](){function _0x3a5306(_0x1b847e,_0x809808){return _0x4da2(_0x809808-0x3dd,_0x1b847e);}return this[_0x3a5306(0x6f8,0x680)]['hasCustomDatabase']();}[_0x347d1c(-0x58,-0x85)](){function _0x11787f(_0x50be0f,_0x3e1fc0){return _0x4da2(_0x50be0f- -0x2fc,_0x3e1fc0);}return this['customDatabaseManager'][_0x11787f(-0x58,0x23)]();}[_0x347d1c(-0xb1,-0x95)](_0x30ec78){function _0x20edfc(_0x35a8f9,_0x4d468f){return _0x4da2(_0x4d468f-0x21a,_0x35a8f9);}this[_0x20edfc(0x46c,0x4bd)]['setWorkspaceId'](_0x30ec78);}async[_0x347d1c(-0x67,-0x9a)](){function _0x9d945f(_0x1ed1ca,_0x1a962e){return _0x4da2(_0x1ed1ca-0x172,_0x1a962e);}try{await this[_0x9d945f(0x415,0x400)]['detectCustomDatabase']();}catch(_0xe81fbc){console['warn']('Failed to initialize custom database detection:',_0xe81fbc);}}}class StorageBucket{constructor(_0x30c6b0,bucketId){this[_0x3920f(0x117,0xcc)]=_0x30c6b0;function _0x3920f(_0x5bf068,_0x118525){return _0x4da2(_0x5bf068- -0x189,_0x118525);}this['bucketId']=bucketId;}async['upload'](_0x3c7aef,_0x5a2c59,_0x59c9c4){function _0x23e24d(_0x4db8ec,_0x15a634){return _0x4da2(_0x4db8ec-0x3e2,_0x15a634);}try{const _0x383ee4=new FormData();if(_0x5a2c59 instanceof File)_0x383ee4['append'](_0x23e24d(0x63a,0x6b1),_0x5a2c59);else{if(_0x5a2c59 instanceof Blob)_0x383ee4[_0x23e24d(0x68d,0x6c9)](_0x23e24d(0x63a,0x5e2),_0x5a2c59,_0x3c7aef);else{if(_0x5a2c59 instanceof ArrayBuffer)_0x383ee4[_0x23e24d(0x68d,0x6d5)]('file',new Blob([_0x5a2c59]),_0x3c7aef);else typeof _0x5a2c59===_0x23e24d(0x67c,0x62f)&&_0x383ee4['append'](_0x23e24d(0x63a,0x5bb),new Blob([_0x5a2c59],{'type':'text/plain'}),_0x3c7aef);}}_0x383ee4['append']('path',_0x3c7aef);_0x59c9c4?.[_0x23e24d(0x66d,0x68a)]&&_0x383ee4[_0x23e24d(0x68d,0x695)]('cacheControl',_0x59c9c4['cacheControl']);_0x59c9c4?.[_0x23e24d(0x6d6,0x681)]&&_0x383ee4[_0x23e24d(0x68d,0x6f8)]('contentType',_0x59c9c4[_0x23e24d(0x6d6,0x66f)]);_0x59c9c4?.['metadata']&&_0x383ee4['append']('metadata',JSON['stringify'](_0x59c9c4[_0x23e24d(0x64d,0x6d4)]));const _0x178c40='/storage/buckets/'+this['bucketId']+'/files'+(_0x59c9c4?.[_0x23e24d(0x67e,0x6be)]?_0x23e24d(0x6be,0x739):''),response=await this[_0x23e24d(0x682,0x6c1)][_0x23e24d(0x6b0,0x66c)](_0x178c40,_0x383ee4,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x23e24d(0x611,0x602)],'error':null};}catch(_0x5277e6){return{'data':null,'error':_0x5277e6 instanceof EBaaSError?_0x5277e6:new EBaaSError(_0x5277e6 instanceof Error?_0x5277e6[_0x23e24d(0x69e,0x6a9)]:_0x23e24d(0x5cb,0x5ba),0x0,_0x5277e6)};}}async['download'](_0x3dbca7,_0x150d4d){function _0x237258(_0x23f6e6,_0x5dfd6e){return _0x4da2(_0x23f6e6-0xf1,_0x5dfd6e);}try{const _0x52b88f=new URLSearchParams();_0x150d4d?.['transform']&&Object[_0x237258(0x358,0x2d0)](_0x150d4d['transform'])['forEach'](([_0x5946e5,_0x30e110])=>{_0x30e110!==undefined&&_0x52b88f['append'](_0x5946e5,String(_0x30e110));});const _0x424575=_0x237258(0x3f1,0x475)+this[_0x237258(0x2ea,0x31c)]+_0x237258(0x318,0x2b4)+_0x3dbca7+(_0x52b88f['toString']()?'?'+_0x52b88f['toString']():''),response=await this[_0x237258(0x391,0x37a)][_0x237258(0x3df,0x40e)](_0x424575,{'responseType':_0x237258(0x3b6,0x38a)});return{'data':response['data'],'error':null};}catch(_0x23e4aa){return{'data':null,'error':_0x23e4aa instanceof EBaaSError?_0x23e4aa:new EBaaSError(_0x23e4aa instanceof Error?_0x23e4aa['message']:'Failed\x20to\x20download\x20file',0x0,_0x23e4aa)};}}async['list'](_0x3876b3,_0x3642b8){function _0x3c214e(_0x53313f,_0x16e6cf){return _0x4da2(_0x53313f-0x18a,_0x16e6cf);}try{const _0x3f7bf6=new URLSearchParams();_0x3876b3&&_0x3f7bf6['append'](_0x3c214e(0x410,0x410),_0x3876b3);_0x3642b8?.['limit']&&_0x3f7bf6[_0x3c214e(0x435,0x3e5)](_0x3c214e(0x469,0x4d2),String(_0x3642b8[_0x3c214e(0x469,0x426)]));_0x3642b8?.[_0x3c214e(0x412,0x472)]&&_0x3f7bf6['append'](_0x3c214e(0x412,0x411),String(_0x3642b8[_0x3c214e(0x412,0x39e)]));_0x3642b8?.['sortBy']&&_0x3f7bf6['append'](_0x3c214e(0x40a,0x389),JSON[_0x3c214e(0x428,0x476)](_0x3642b8[_0x3c214e(0x40a,0x451)]));_0x3642b8?.[_0x3c214e(0x3dc,0x432)]&&_0x3f7bf6['append'](_0x3c214e(0x3dc,0x425),_0x3642b8['search']);const _0x3e2cb1='/storage/buckets/'+this['bucketId']+'/files'+(_0x3f7bf6['toString']()?'?'+_0x3f7bf6['toString']():''),response=await this['httpClient'][_0x3c214e(0x478,0x41a)](_0x3e2cb1);return{'data':response['data'],'error':null};}catch(_0x243704){return{'data':null,'error':_0x243704 instanceof EBaaSError?_0x243704:new EBaaSError(_0x243704 instanceof Error?_0x243704['message']:_0x3c214e(0x40b,0x46c),0x0,_0x243704)};}}async[_0x347d1c(-0x143,-0xce)](_0x1750bd){function _0x3d4f8e(_0xeb80be,_0x4c78b4){return _0x4da2(_0x4c78b4-0x202,_0xeb80be);}try{const response=await this[_0x3d4f8e(0x431,0x4a2)][_0x3d4f8e(0x4d0,0x4b0)](_0x3d4f8e(0x47d,0x502)+this['bucketId']+'/files',{'data':{'paths':_0x1750bd}});return{'data':response[_0x3d4f8e(0x461,0x431)],'error':null};}catch(_0x1340e6){return{'data':null,'error':_0x1340e6 instanceof EBaaSError?_0x1340e6:new EBaaSError(_0x1340e6 instanceof Error?_0x1340e6['message']:_0x3d4f8e(0x50c,0x4ce),0x0,_0x1340e6)};}}async[_0x347d1c(-0x74,-0xa0)](fromPath,_0x1ef510){function _0x2cb497(_0x284bd0,_0x1b8bde){return _0x4da2(_0x1b8bde- -0xe0,_0x284bd0);}try{const response=await this[_0x2cb497(0x1f6,0x1c0)]['post'](_0x2cb497(0x2a0,0x220)+this[_0x2cb497(0x12f,0x119)]+'/files/move',{'sourceKey':fromPath,'destinationKey':_0x1ef510});return{'data':response[_0x2cb497(0x1d0,0x14f)],'error':null};}catch(_0x21ec94){return{'data':null,'error':_0x21ec94 instanceof EBaaSError?_0x21ec94:new EBaaSError(_0x21ec94 instanceof Error?_0x21ec94[_0x2cb497(0x1c8,0x1dc)]:'Failed\x20to\x20move\x20file',0x0,_0x21ec94)};}}async[_0x347d1c(-0x125,-0x125)](fromPath,_0x2d8146){function _0x16317a(_0x305a2a,_0x3124fb){return _0x4da2(_0x3124fb- -0x14,_0x305a2a);}try{const response=await this['httpClient'][_0x16317a(0x232,0x2ba)](_0x16317a(0x348,0x2ec)+this['bucketId']+_0x16317a(0x276,0x214),{'sourceKey':fromPath,'destinationKey':_0x2d8146});return{'data':response[_0x16317a(0x243,0x21b)],'error':null};}catch(_0x210295){return{'data':null,'error':_0x210295 instanceof EBaaSError?_0x210295:new EBaaSError(_0x210295 instanceof Error?_0x210295[_0x16317a(0x256,0x2a8)]:_0x16317a(0x1e8,0x217),0x0,_0x210295)};}}async[_0x347d1c(-0xe0,-0x105)](_0xe5b35f,_0xcf9192,_0x2e08b9){function _0x14993e(_0x3ba9f2,_0x269f1a){return _0x4da2(_0x269f1a-0x3c4,_0x3ba9f2);}try{const response=await this[_0x14993e(0x6ab,0x664)]['post']('/storage/buckets/'+this[_0x14993e(0x59c,0x5bd)]+_0x14993e(0x58a,0x5eb)+_0xe5b35f+'/sign',{'expiresIn':_0xcf9192,..._0x2e08b9});return{'data':response[_0x14993e(0x595,0x5f3)],'error':null};}catch(_0x480d4f){return{'data':null,'error':_0x480d4f instanceof EBaaSError?_0x480d4f:new EBaaSError(_0x480d4f instanceof Error?_0x480d4f['message']:'Failed\x20to\x20create\x20signed\x20URL',0x0,_0x480d4f)};}}['getPublicUrl'](_0x513007,_0x5b9104){const _0x4ceeb5=new URLSearchParams();_0x5b9104?.['transform']&&Object[_0x5e5528(0x2c,0x37)](_0x5b9104[_0x5e5528(-0x46,-0x84)])[_0x5e5528(-0x1b,-0x9f)](([_0x18f8eb,_0x18d3f7])=>{function _0x351f55(_0xb6c7ec,_0x379647){return _0x4da2(_0xb6c7ec- -0x34b,_0x379647);}_0x18d3f7!==undefined&&_0x4ceeb5[_0x351f55(-0xa0,-0xba)](_0x18f8eb,String(_0x18d3f7));});function _0x5e5528(_0x20cbea,_0x1173e9){return _0x4da2(_0x20cbea- -0x23b,_0x1173e9);}const _0x5d281e=this['httpClient']['baseURL']||'',_0x37aeb2=_0x5d281e+'/storage/buckets/'+this['bucketId']+'/files/'+_0x513007+(_0x4ceeb5['toString']()?'?'+_0x4ceeb5[_0x5e5528(0x2f,0x5b)]():'');return{'data':{'publicUrl':_0x37aeb2}};}async['getFileInfo'](_0x22a04c){function _0x5e8977(_0x49654e,_0x106c5d){return _0x4da2(_0x106c5d- -0x2b0,_0x49654e);}try{const response=await this[_0x5e8977(-0x2e,-0x10)]['get'](_0x5e8977(0x0,0x50)+this[_0x5e8977(-0xbf,-0xb7)]+'/files/'+_0x22a04c+_0x5e8977(0x34,0x4b));return{'data':response['data'],'error':null};}catch(_0x365878){return{'data':null,'error':_0x365878 instanceof EBaaSError?_0x365878:new EBaaSError(_0x365878 instanceof Error?_0x365878[_0x5e8977(0x2f,0xc)]:_0x5e8977(-0x86,-0xc9),0x0,_0x365878)};}}async['updateFileMetadata'](_0x345b92,metadata){function _0x54d78a(_0x1cf65c,_0x3799dd){return _0x4da2(_0x3799dd-0x34b,_0x1cf65c);}try{const response=await this[_0x54d78a(0x583,0x5eb)]['put']('/storage/buckets/'+this[_0x54d78a(0x569,0x544)]+'/files/'+_0x345b92+_0x54d78a(0x4f3,0x570),{'metadata':metadata});return{'data':response[_0x54d78a(0x5e7,0x57a)],'error':null};}catch(_0x2e335a){return{'data':null,'error':_0x2e335a instanceof EBaaSError?_0x2e335a:new EBaaSError(_0x2e335a instanceof Error?_0x2e335a[_0x54d78a(0x5a5,0x607)]:_0x54d78a(0x5ed,0x5b8),0x0,_0x2e335a)};}}}class StorageClient{constructor(_0x3c500b){this['httpClient']=_0x3c500b;}['from'](bucketId){return new StorageBucket(this['httpClient'],bucketId);}async['createBucket'](_0x3eca50,_0x5ab952){function _0x4e8ed2(_0x15c36b,_0x132cb6){return _0x4da2(_0x132cb6-0x3b4,_0x15c36b);}try{const response=await this[_0x4e8ed2(0x6ba,0x654)]['post']('/storage/buckets',{'id':_0x3eca50,..._0x5ab952});return{'data':response['data'],'error':null};}catch(_0x5c210d){return{'data':null,'error':_0x5c210d instanceof EBaaSError?_0x5c210d:new EBaaSError(_0x5c210d instanceof Error?_0x5c210d['message']:_0x4e8ed2(0x6ba,0x66b),0x0,_0x5c210d)};}}async[_0x347d1c(-0xf0,-0x162)](_0x104ad6){function _0x32dc4d(_0x3565fa,_0x3b88c7){return _0x4da2(_0x3565fa-0x1e6,_0x3b88c7);}try{const response=await this['httpClient']['get']('/storage/buckets/'+_0x104ad6);return{'data':response[_0x32dc4d(0x415,0x41f)],'error':null};}catch(_0x23ada5){return{'data':null,'error':_0x23ada5 instanceof EBaaSError?_0x23ada5:new EBaaSError(_0x23ada5 instanceof Error?_0x23ada5[_0x32dc4d(0x4a2,0x482)]:'Failed\x20to\x20get\x20bucket',0x0,_0x23ada5)};}}async['listBuckets'](){function _0x577e78(_0x27c953,_0x535660){return _0x4da2(_0x535660- -0x1fb,_0x27c953);}try{const response=await this[_0x577e78(0x25,0xa5)]['get']('/storage/buckets');return{'data':response[_0x577e78(0x44,0x34)],'error':null};}catch(_0x43a8f8){return{'data':null,'error':_0x43a8f8 instanceof EBaaSError?_0x43a8f8:new EBaaSError(_0x43a8f8 instanceof Error?_0x43a8f8['message']:_0x577e78(0x104,0xb4),0x0,_0x43a8f8)};}}async[_0x347d1c(-0x139,-0x163)](_0x50b3c7,_0x1fc616){function _0x5c4a2b(_0x1b3add,_0x1f212a){return _0x4da2(_0x1b3add- -0x2cf,_0x1f212a);}try{const response=await this[_0x5c4a2b(-0x2f,0x32)][_0x5c4a2b(-0x52,-0x97)]('/storage/buckets/'+_0x50b3c7,_0x1fc616);return{'data':response['data'],'error':null};}catch(_0x314a2f){return{'data':null,'error':_0x314a2f instanceof EBaaSError?_0x314a2f:new EBaaSError(_0x314a2f instanceof Error?_0x314a2f['message']:_0x5c4a2b(-0xe5,-0xcd),0x0,_0x314a2f)};}}async[_0x347d1c(-0x17e,-0x119)](_0x34a8fa){function _0x22f3bb(_0x2a79c7,_0x3ccc85){return _0x4da2(_0x2a79c7-0x122,_0x3ccc85);}try{const response=await this['httpClient'][_0x22f3bb(0x3d0,0x382)]('/storage/buckets/'+_0x34a8fa);return{'data':response[_0x22f3bb(0x351,0x3c1)],'error':null};}catch(_0x5124ee){return{'data':null,'error':_0x5124ee instanceof EBaaSError?_0x5124ee:new EBaaSError(_0x5124ee instanceof Error?_0x5124ee[_0x22f3bb(0x3de,0x35c)]:_0x22f3bb(0x394,0x314),0x0,_0x5124ee)};}}async['getUsage'](){function _0x2c53c4(_0x3d3b6b,_0x376e7e){return _0x4da2(_0x3d3b6b- -0x24b,_0x376e7e);}try{const response=await this['httpClient'][_0x2c53c4(0xa3,0xda)](_0x2c53c4(-0x12,-0x7f));return{'data':response['data'],'error':null};}catch(_0x61632f){return{'data':null,'error':_0x61632f instanceof EBaaSError?_0x61632f:new EBaaSError(_0x61632f instanceof Error?_0x61632f['message']:'Failed\x20to\x20get\x20storage\x20usage',0x0,_0x61632f)};}}}class EventManager{constructor(){function _0x343b20(_0x16a19e,_0x5e39f7){return _0x4da2(_0x5e39f7- -0x1ac,_0x16a19e);}this[_0x343b20(0x87,0x106)]=new Map(),this['maxListeners']=0xa;}['on'](_0x11ec96,_0x3ead64){function _0x4a27ed(_0x42df3b,_0x15fda9){return _0x4da2(_0x42df3b- -0x25d,_0x15fda9);}!this['events'][_0x4a27ed(0x8b,0x92)](_0x11ec96)&&this[_0x4a27ed(0x55,0x1d)][_0x4a27ed(-0x4e,-0x6a)](_0x11ec96,new Set()),this['events'][_0x4a27ed(0x91,0x52)](_0x11ec96)[_0x4a27ed(0x60,0x18)](_0x3ead64);}['off'](_0x2fd905,_0x43c3ad){if(!this['events']['has'](_0x2fd905))return;function _0x2525a0(_0x3da363,_0x41db0a){return _0x4da2(_0x41db0a- -0x4e,_0x3da363);}const _0x4e1090=this['events']['get'](_0x2fd905);_0x43c3ad?_0x4e1090[_0x2525a0(0x252,0x260)](_0x43c3ad):_0x4e1090['clear'](),_0x4e1090['size']===0x0&&this[_0x2525a0(0x1ec,0x264)]['delete'](_0x2fd905);}[_0x347d1c(-0x16d,-0x137)](_0x20b255,..._0x51e88c){function _0x235c3e(_0x31f278,_0x1c06d2){return _0x4da2(_0x31f278- -0x174,_0x1c06d2);}if(!this['events']['has'](_0x20b255))return![];const _0x4afb03=this['events']['get'](_0x20b255);for(const _0x30434a of _0x4afb03){try{_0x30434a(..._0x51e88c);}catch(_0x31f305){console[_0x235c3e(0xd6,0xb2)]('Error\x20in\x20event\x20listener\x20for\x20\x22'+_0x20b255+'\x22:',_0x31f305);}}return _0x4afb03['size']>0x0;}['removeAllListeners'](_0x3a4684){function _0x716a1b(_0x1133d2,_0x10f994){return _0x4da2(_0x1133d2-0xf2,_0x10f994);}_0x3a4684?this['events'][_0x716a1b(0x3a0,0x394)](_0x3a4684):this['events']['clear']();}[_0x347d1c(-0x1df,-0x179)](_0x2dc678){function _0x13ad6a(_0x559d9c,_0x378077){return _0x4da2(_0x378077- -0x1d3,_0x559d9c);}return this[_0x13ad6a(0x6f,0xdf)][_0x13ad6a(0xf4,0x11b)](_0x2dc678)?.[_0x13ad6a(-0x17,0x1e)]??0x0;}[_0x347d1c(-0xec,-0x147)](){function _0xff7a51(_0x596d6a,_0x176b8f){return _0x4da2(_0x176b8f-0x3bb,_0x596d6a);}return Array[_0xff7a51(0x6ee,0x6ba)](this[_0xff7a51(0x640,0x66d)]['keys']());}[_0x347d1c(-0xb4,-0xe1)](_0x58a6f1){return Array['from'](this['events']['get'](_0x58a6f1)??[]);}[_0x347d1c(-0x17b,-0x16f)](_0x3382d5,_0x3883d9){this['on'](_0x3382d5,_0x3883d9);}[_0x347d1c(-0xb1,-0x118)](_0x52726f,_0x47f14d){this['off'](_0x52726f,_0x47f14d);}[_0x347d1c(-0x175,-0x111)](_0xd9df66,_0x21ef8d){const _0x3a8c2e=(..._0x1d26e0)=>{this[_0xd70c23(-0x118,-0x16b)](_0xd9df66,_0x3a8c2e);function _0xd70c23(_0x2e4fc8,_0x35c908){return _0x4da2(_0x2e4fc8- -0x3db,_0x35c908);}_0x21ef8d(..._0x1d26e0);};this['on'](_0xd9df66,_0x3a8c2e);}[_0x347d1c(-0x99,-0xe6)](_0x3a3f3a,_0x3ee463){this['on'](_0x3a3f3a,_0x3ee463);}['prependOnceListener'](_0x1172b0,_0x66a718){const _0x209977=(..._0xb7a67c)=>{function _0x163700(_0x5b0411,_0x3cb016){return _0x4da2(_0x3cb016-0x259,_0x5b0411);}this[_0x163700(0x543,0x51c)](_0x1172b0,_0x209977),_0x66a718(..._0xb7a67c);};this['on'](_0x1172b0,_0x209977);}['setMaxListeners'](_0x9c4aeb){function _0x250c19(_0x55d53b,_0x25545b){return _0x4da2(_0x25545b- -0x3d8,_0x55d53b);}return this[_0x250c19(-0x1c1,-0x14f)]=_0x9c4aeb,this;}[_0x347d1c(-0x121,-0xc7)](){return this['maxListeners'];}[_0x347d1c(-0x131,-0xa6)](_0x4c2c48){function _0x354972(_0x495b2a,_0x343118){return _0x4da2(_0x343118- -0x2a5,_0x495b2a);}return this[_0x354972(-0x7f,-0xc)](_0x4c2c48);}}class RealtimeChannel extends EventManager{constructor(_0x575625,_0x54995d){super(),this[_0x1458ea(0x44b,0x3d0)]=![],this['state']='closed',this['subscriptions']=new Map();function _0x1458ea(_0x13872d,_0x38e25){return _0x4da2(_0x13872d-0x259,_0x38e25);}this[_0x1458ea(0x478,0x441)]=_0x575625,this[_0x1458ea(0x483,0x475)]=_0x54995d;}['subscribe'](_0x9e8e5d){!this['joinedOnce']&&(this[_0x5b5dde(-0xb0,-0x119)]=!![],this['_join']());_0x9e8e5d&&this['on'](_0x5b5dde(-0xcd,-0x107),_0x9e8e5d);function _0x5b5dde(_0x2fe749,_0x2aa1dc){return _0x4da2(_0x2aa1dc- -0x30b,_0x2fe749);}return this;}[_0x347d1c(-0xed,-0x98)](filter,_0x17b603){const _0x359dea='postgres_changes:'+JSON['stringify'](filter);function _0x2279e7(_0x1ee0c4,_0x18cfd2){return _0x4da2(_0x18cfd2-0x161,_0x1ee0c4);}this['on'](_0x359dea,_0x17b603);const _0x1f764e={'unsubscribe':()=>{this['off'](_0x359dea,_0x17b603),this['subscriptions']['delete'](_0x359dea);}};return this['subscriptions'][_0x2279e7(0x337,0x370)](_0x359dea,_0x1f764e),this['socket']?.['connected']&&this[_0x2279e7(0x3a9,0x3d9)]==='joined'&&this[_0x2279e7(0x3dc,0x38b)][_0x2279e7(0x3f4,0x3a4)]('subscribe_postgres_changes',{'topic':this['topic'],'filter':filter,'ref':this['makeRef']()}),_0x1f764e;}[_0x347d1c(-0x13f,-0xd8)](filter,_0x4f5efe){const _0x21e4b3='broadcast:'+JSON[_0x14bbc3(0x24,0xa3)](filter);this['on'](_0x21e4b3,_0x4f5efe);function _0x14bbc3(_0x34551e,_0x5d8cfc){return _0x4da2(_0x34551e- -0x27a,_0x5d8cfc);}const _0x1d5c22={'unsubscribe':()=>{this[_0x16b29f(0x4ed,0x4ba)](_0x21e4b3,_0x4f5efe);function _0x16b29f(_0xca1db5,_0xfc5d18){return _0x4da2(_0xfc5d18-0x1f7,_0xca1db5);}this['subscriptions']['delete'](_0x21e4b3);}};return this['subscriptions'][_0x14bbc3(-0x6b,-0xb4)](_0x21e4b3,_0x1d5c22),_0x1d5c22;}['onPresence'](filter,_0x2b337d){const _0x713e2a=_0x531c78(-0x136,-0xe3)+JSON['stringify'](filter);this['on'](_0x713e2a,_0x2b337d);const _0x1e20e2={'unsubscribe':()=>{function _0x1756b6(_0x38db53,_0xea82fb){return _0x4da2(_0xea82fb- -0x1c,_0x38db53);}this[_0x1756b6(0x21b,0x2a7)](_0x713e2a,_0x2b337d),this[_0x1756b6(0x347,0x2de)]['delete'](_0x713e2a);}};this[_0x531c78(-0x9,0x3)]['set'](_0x713e2a,_0x1e20e2);function _0x531c78(_0x2a4c6d,_0x22b2e7){return _0x4da2(_0x22b2e7- -0x2f7,_0x2a4c6d);}return _0x1e20e2;}[_0x347d1c(-0x9c,-0xd2)](_0x5a0151){return new Promise(_0x3aa59e=>{function _0x4e0d0c(_0x22d898,_0x245439){return _0x4da2(_0x22d898- -0x6c,_0x245439);}this[_0x4e0d0c(0x1be,0x229)]?.[_0x4e0d0c(0x1f7,0x1bc)]&&this['state']==='joined'?(this[_0x4e0d0c(0x1be,0x1bb)]['emit'](_0x4e0d0c(0x1b5,0x148),{'topic':this['topic'],'event':_0x5a0151['event'],'payload':_0x5a0151,'ref':this[_0x4e0d0c(0x25f,0x2a6)]()}),_0x3aa59e('ok')):_0x3aa59e('error');});}['track'](_0x48234d){return new Promise(_0x46898e=>{function _0x3bf963(_0x469698,_0x2e42f0){return _0x4da2(_0x2e42f0-0x391,_0x469698);}this[_0x3bf963(0x5cc,0x5bb)]?.['connected']&&this[_0x3bf963(0x61a,0x609)]===_0x3bf963(0x5cb,0x5f1)?(this[_0x3bf963(0x61d,0x5bb)]['emit']('presence',{'topic':this[_0x3bf963(0x57f,0x5b0)],'event':_0x3bf963(0x5dd,0x5dc),'payload':_0x48234d,'ref':this[_0x3bf963(0x64d,0x65c)]()}),_0x46898e('ok')):_0x46898e('error');});}[_0x347d1c(-0x14e,-0x17e)](){return new Promise(_0x2d49d3=>{function _0x200d06(_0x2782f0,_0x926f0f){return _0x4da2(_0x2782f0- -0x2d6,_0x926f0f);}this['socket']?.[_0x200d06(-0x73,-0xf5)]&&this[_0x200d06(-0x5e,-0x24)]==='joined'?(this['socket'][_0x200d06(-0x93,-0xb6)](_0x200d06(-0x9e,-0xcc),{'topic':this[_0x200d06(-0xb7,-0x6d)],'event':_0x200d06(-0xda,-0x132),'ref':this['makeRef']()}),_0x2d49d3('ok')):_0x2d49d3(_0x200d06(-0x8c,-0x2c));});}['unsubscribe'](){return new Promise(_0x254ade=>{this['state']='leaving',this[_0x46fc3f(0x639,0x602)]['forEach'](_0xbaaad7=>{function _0x2dde19(_0x23bd7f,_0x4fd070){return _0x4da2(_0x23bd7f- -0x1c7,_0x4fd070);}_0xbaaad7[_0x2dde19(0xc8,0x147)]();}),this['subscriptions']['clear']();this['socket']?.[_0x46fc3f(0x5a2,0x517)]&&this[_0x46fc3f(0x569,0x520)]['emit']('leave',{'topic':this[_0x46fc3f(0x55e,0x596)],'ref':this[_0x46fc3f(0x60a,0x64c)]()});function _0x46fc3f(_0x2abf83,_0x497a64){return _0x4da2(_0x2abf83-0x33f,_0x497a64);}this[_0x46fc3f(0x5b7,0x587)]='closed',this['removeAllListeners'](),_0x254ade('ok');});}[_0x347d1c(-0x116,-0x146)](){function _0x35963b(_0x51e7a6,_0x36c2ac){return _0x4da2(_0x36c2ac- -0x1a,_0x51e7a6);}if(this['state']==='leaving')return;this[_0x35963b(0x208,0x25e)]='joining',this['socket']?.['connected']&&(this[_0x35963b(0x1db,0x210)]['emit'](_0x35963b(0x201,0x254),{'topic':this[_0x35963b(0x280,0x205)],'ref':this[_0x35963b(0x319,0x2b1)]()}),setTimeout(()=>{function _0x4d003f(_0x51412f,_0xc14288){return _0x4da2(_0xc14288- -0x1c2,_0x51412f);}this[_0x4d003f(0x75,0xb6)]===_0x4d003f(0x1ba,0x134)&&(this['state']=_0x4d003f(0x10d,0x9e),this['emit']('status',_0x4d003f(0xb5,0x34)));},0x64));}['_rejoin'](){function _0x4a6628(_0x54b427,_0x1903b9){return _0x4da2(_0x1903b9-0xe8,_0x54b427);}this[_0x4a6628(0x33c,0x2da)]&&(this[_0x4a6628(0x2e0,0x31c)](),this['subscriptions'][_0x4a6628(0x35b,0x308)]((_0x44e776,_0x51880a)=>{function _0xb5bb0f(_0x1b5313,_0x59ea5a){return _0x4da2(_0x1b5313- -0x24a,_0x59ea5a);}if(_0x51880a['startsWith'](_0xb5bb0f(0x46,0x64))){const filter=JSON[_0xb5bb0f(0x86,0xef)](_0x51880a[_0xb5bb0f(0x22,0x2f)]('postgres_changes:',''));this[_0xb5bb0f(-0x20,0x61)]?.[_0xb5bb0f(-0x7,-0x24)](_0xb5bb0f(-0x2c,-0x12),{'topic':this[_0xb5bb0f(-0x2b,-0x9b)],'filter':filter,'ref':this[_0xb5bb0f(0x81,0x2)]()});}}));}[_0x347d1c(-0xc7,-0x12c)](_0x337068,_0x586b0f){if(_0x337068==='postgres_changes'){const _0x4b9f25=_0x347775(0x4c5,0x43a)+JSON[_0x347775(0x3bd,0x448)](_0x586b0f[_0x347775(0x422,0x3ad)]||{});this[_0x347775(0x382,0x3ed)](_0x4b9f25,_0x586b0f);}else{if(_0x337068===_0x347775(0x354,0x3cb)){const _0x36c21e=_0x347775(0x497,0x434)+JSON[_0x347775(0x417,0x448)]({'event':_0x586b0f[_0x347775(0x524,0x4a3)]});this[_0x347775(0x398,0x3ed)](_0x36c21e,_0x586b0f);}else{if(_0x337068===_0x347775(0x37d,0x3e2)){const _0x483fea=_0x347775(0x3a4,0x3be)+JSON[_0x347775(0x4b6,0x448)]({'event':_0x586b0f[_0x347775(0x41c,0x4a3)]});this['emit'](_0x483fea,_0x586b0f);}}}function _0x347775(_0x22daac,_0x44b85a){return _0x4da2(_0x44b85a-0x1aa,_0x22daac);}this['emit'](_0x337068,_0x586b0f);}[_0x347d1c(-0x190,-0x183)](_0x8acd49){function _0x4e1f07(_0x23c861,_0x51e2cc){return _0x4da2(_0x23c861-0x52,_0x51e2cc);}this[_0x4e1f07(0x2ca,0x2b1)]=_0x8acd49;let status;switch(_0x8acd49){case _0x4e1f07(0x2b2,0x330):status=_0x4e1f07(0x248,0x1e9);break;case'errored':status='CHANNEL_ERROR';break;case _0x4e1f07(0x310,0x29e):status=_0x4e1f07(0x2ce,0x2d7);break;default:return;}this[_0x4e1f07(0x295,0x259)]('status',status);}[_0x347d1c(-0xd5,-0xaf)](){function _0x485b99(_0x3eede2,_0x2934d0){return _0x4da2(_0x2934d0- -0x234,_0x3eede2);}return Math[_0x485b99(0xed,0x76)]()['toString'](0x24)['substring'](0x2,0xf);}['getState'](){return this['state'];}}function getEnvironment(){if(typeof navigator!==_0x1fb6ad(0x357,0x371)&&navigator['product']==='ReactNative')return _0x1fb6ad(0x381,0x342);function _0x1fb6ad(_0x303173,_0x1f28e0){return _0x4da2(_0x1f28e0-0x9b,_0x303173);}if(typeof window!==_0x1fb6ad(0x327,0x371)&&typeof document!==_0x1fb6ad(0x363,0x371))return _0x1fb6ad(0x2bd,0x2bd);if(typeof global!==_0x1fb6ad(0x346,0x371)&&typeof process!==_0x1fb6ad(0x30f,0x371)&&process['versions']?.['node'])return _0x1fb6ad(0x32b,0x399);return _0x1fb6ad(0x329,0x2bd);}function isSocketIOAvailable(){function _0x34966a(_0x80e11f,_0x119c12){return _0x4da2(_0x119c12-0x3ce,_0x80e11f);}try{const _0x24312f=getEnvironment();switch(_0x24312f){case _0x34966a(0x6c3,0x6cc):return typeof require!=='undefined'&&require[_0x34966a(0x643,0x600)]&&!!require['resolve'](_0x34966a(0x628,0x69f));case'browser':if(typeof globalThis!==_0x34966a(0x704,0x6a4)&&'io'in globalThis)return!![];return typeof require!=='undefined'&&require['resolve']&&!!require[_0x34966a(0x5b6,0x600)]('socket.io-client');case _0x34966a(0x621,0x675):try{return typeof require!==_0x34966a(0x6de,0x6a4)&&!!require('socket.io-client');}catch{return![];}default:return![];}}catch{return![];}}function getSocketIO(){function _0x17a348(_0x3b5efa,_0x79e293){return _0x4da2(_0x3b5efa- -0x3a7,_0x79e293);}try{if(typeof require!==_0x17a348(-0xd1,-0xfb))return require('socket.io-client');if(typeof globalThis!=='undefined'&&'io'in globalThis)return{'io':globalThis['io']};throw new Error('socket.io-client\x20not\x20available');}catch(_0x1435db){throw new Error('Socket.io-client\x20não\x20está\x20disponível\x20neste\x20ambiente.\x20Para\x20usar\x20funcionalidades\x20de\x20realtime,\x20instale:\x20npm\x20install\x20socket.io-client');}}class WebSocketAdapter{constructor(){this['socket']=null;}async['connect'](_0x20c47c,_0x5cae0e){if(!isSocketIOAvailable())throw new Error('Socket.io-client não está disponível. Para usar funcionalidades de realtime, instale: npm install socket.io-client');const {io:_0x542725}=getSocketIO();return new Promise((_0x7632ed,_0x16986b)=>{function _0x87cae2(_0xa2528c,_0x5ee4b7){return _0x4da2(_0x5ee4b7-0x12b,_0xa2528c);}this['socket']=_0x542725(_0x20c47c,_0x5cae0e),this[_0x87cae2(0x3c6,0x355)]['on']('connect',()=>_0x7632ed()),this[_0x87cae2(0x2d7,0x355)]['on'](_0x87cae2(0x31b,0x36b),_0x543c1c=>_0x16986b(_0x543c1c));});}[_0x347d1c(-0xd7,-0x107)](){function _0x216f8a(_0x22fbc8,_0x4d6032){return _0x4da2(_0x22fbc8- -0x1e9,_0x4d6032);}this['socket']&&(this[_0x216f8a(0x41,0x25)][_0x216f8a(0x8a,0xa3)](),this[_0x216f8a(0x41,0x65)]=null);}[_0x347d1c(-0x127,-0x137)](_0x456a6c,data){function _0x203ff7(_0x3be8ad,_0x177440){return _0x4da2(_0x177440- -0x3ab,_0x3be8ad);}this[_0x203ff7(-0x10d,-0x181)]?.[_0x203ff7(-0x1ef,-0x168)](_0x456a6c,data);}['on'](_0xcb918d,_0x4f6061){this['socket']?.['on'](_0xcb918d,_0x4f6061);}['off'](_0x555322,_0x4e144f){function _0x3de8bb(_0x2c3773,_0xef32ab){return _0x4da2(_0xef32ab- -0x35a,_0x2c3773);}_0x4e144f?this['socket']?.[_0x3de8bb(-0xea,-0x97)](_0x555322,_0x4e144f):this[_0x3de8bb(-0xd2,-0x130)]?.[_0x3de8bb(-0x81,-0x97)](_0x555322);}get['connected'](){function _0x348cfb(_0xa9a690,_0x3ec9b3){return _0x4da2(_0xa9a690-0x27f,_0x3ec9b3);}return this[_0x348cfb(0x4a9,0x429)]?.[_0x348cfb(0x4e2,0x4e5)]??![];}}function _0x4da2(_0x18b879,_0x51ab99){const _0x39f818=_0x39f8();return _0x4da2=function(_0x4da231,_0x1895a4){_0x4da231=_0x4da231-0x1e7;let _0x29ef03=_0x39f818[_0x4da231];if(_0x4da2['LbuxWQ']===undefined){var _0x5e845d=function(_0x10f038){const _0x2bdc15='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x32cfaf='',_0x55abfb='';for(let _0x32fd56=0x0,_0x2c2b64,_0x273d4c,_0x1d5089=0x0;_0x273d4c=_0x10f038['charAt'](_0x1d5089++);~_0x273d4c&&(_0x2c2b64=_0x32fd56%0x4?_0x2c2b64*0x40+_0x273d4c:_0x273d4c,_0x32fd56++%0x4)?_0x32cfaf+=String['fromCharCode'](0xff&_0x2c2b64>>(-0x2*_0x32fd56&0x6)):0x0){_0x273d4c=_0x2bdc15['indexOf'](_0x273d4c);}for(let _0x302d7d=0x0,_0x4a4919=_0x32cfaf['length'];_0x302d7d<_0x4a4919;_0x302d7d++){_0x55abfb+='%'+('00'+_0x32cfaf['charCodeAt'](_0x302d7d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x55abfb);};_0x4da2['zRGOqg']=_0x5e845d,_0x18b879=arguments,_0x4da2['LbuxWQ']=!![];}const _0x54efb9=_0x39f818[0x0],_0x142c16=_0x4da231+_0x54efb9,_0x3b3f6e=_0x18b879[_0x142c16];return!_0x3b3f6e?(_0x29ef03=_0x4da2['zRGOqg'](_0x29ef03),_0x18b879[_0x142c16]=_0x29ef03):_0x29ef03=_0x3b3f6e,_0x29ef03;},_0x4da2(_0x18b879,_0x51ab99);}class ReactNativeSocketAdapter{constructor(){function _0x1be7fd(_0x4c6f11,_0x48ba82){return _0x4da2(_0x4c6f11-0x3c0,_0x48ba82);}this[_0x1be7fd(0x5ea,0x5d4)]=null;}async[_0x347d1c(-0x195,-0x124)](_0x3406ce,_0x57fae4){if(!isSocketIOAvailable())throw new Error(_0x2c9850(-0x108,-0x123));const {io:_0x379c9c}=getSocketIO();function _0x2c9850(_0x20486f,_0x41f064){return _0x4da2(_0x41f064- -0x3c0,_0x20486f);}return new Promise((_0x13721e,_0x43e2d8)=>{this[_0x20adf7(-0x9e,-0x35)]=_0x379c9c(_0x3406ce,{..._0x57fae4,'transports':[_0x20adf7(-0x77,-0x98)],'upgrade':![],'autoConnect':!![]});function _0x20adf7(_0x4e0b65,_0x105bfd){return _0x4da2(_0x4e0b65- -0x2c8,_0x105bfd);}this[_0x20adf7(-0x9e,-0x6c)]['on']('connect',()=>_0x13721e()),this['socket']['on'](_0x20adf7(-0x88,-0x4b),_0x33c344=>_0x43e2d8(_0x33c344));});}[_0x347d1c(-0xda,-0x107)](){function _0x499b11(_0xb9633d,_0x302b47){return _0x4da2(_0x302b47- -0x36,_0xb9633d);}this[_0x499b11(0x205,0x1f4)]&&(this['socket'][_0x499b11(0x21f,0x23d)](),this['socket']=null);}['emit'](_0x7783d6,data){function _0x41fba4(_0x308e6c,_0x162707){return _0x4da2(_0x308e6c-0x197,_0x162707);}this['socket']?.[_0x41fba4(0x3da,0x351)](_0x7783d6,data);}['on'](_0xba8034,_0x85495f){function _0x2ac438(_0x1c21c8,_0x1d3bf8){return _0x4da2(_0x1c21c8- -0x94,_0x1d3bf8);}this[_0x2ac438(0x196,0x124)]?.['on'](_0xba8034,_0x85495f);}['off'](_0x43a0ae,_0x4f46a7){function _0x2cc0ce(_0x48ce67,_0x116c6a){return _0x4da2(_0x116c6a- -0x254,_0x48ce67);}_0x4f46a7?this[_0x2cc0ce(0x2b,-0x2a)]?.['off'](_0x43a0ae,_0x4f46a7):this['socket']?.[_0x2cc0ce(0xc5,0x6f)](_0x43a0ae);}get['connected'](){return this['socket']?.['connected']??![];}}function createSocketAdapter(){function _0x369bf2(_0x48d30e,_0x539748){return _0x4da2(_0x48d30e- -0xb2,_0x539748);}const _0x54b72d=getEnvironment();switch(_0x54b72d){case _0x369bf2(0x1f5,0x185):return new ReactNativeSocketAdapter();case'browser':case _0x369bf2(0x24c,0x275):default:return new WebSocketAdapter();}}class RealtimeClient{constructor(_0x5a7264,_0xbfe535,_0x2ff27e={}){this[_0xeb5974(0x456,0x3d1)]=null,this['channels']=new Map(),this['connectionState']=_0xeb5974(0x459,0x401),this[_0xeb5974(0x4a2,0x4df)]=0x0,this['maxReconnectAttempts']=0x5,this[_0xeb5974(0x441,0x3f6)]=_0x5a7264,this['apiKey']=_0xbfe535;function _0xeb5974(_0x308f3c,_0x43cd2b){return _0x4da2(_0x308f3c-0x22c,_0x43cd2b);}this['options']={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x2ff27e},this['socketAdapter']=createSocketAdapter();}['connect'](){return new Promise(async(_0x53dc0e,_0x12499f)=>{if(this['socketAdapter'][_0x21ff56(0x2cc,0x2e8)]){_0x53dc0e();return;}function _0x21ff56(_0x563dfc,_0x2b9cfe){return _0x4da2(_0x2b9cfe-0x85,_0x563dfc);}this['connectionState']=_0x21ff56(0x31f,0x2f4);try{await this[_0x21ff56(0x2e2,0x307)]['connect'](this['url'],{'auth':{'apikey':this[_0x21ff56(0x1ee,0x271)]},'transports':['websocket'],'reconnection':!![],'reconnectionDelay':this['options'][_0x21ff56(0x27f,0x2a0)],'reconnectionAttempts':this['options'][_0x21ff56(0x372,0x33e)],...this[_0x21ff56(0x2d1,0x34d)]['socketOptions']}),this['socket']=this['socketAdapter'][_0x21ff56(0x2e0,0x2af)],this['socketAdapter']['on']('connect',()=>{this[_0x1f4be5(0x92,0xe)]=_0x1f4be5(0x41,-0x44),this[_0x1f4be5(0x3d,-0x31)]=0x0,this['setupHeartbeat']();function _0x1f4be5(_0x52eba9,_0x13956f){return _0x4da2(_0x13956f- -0x2a7,_0x52eba9);}_0x53dc0e();}),this[_0x21ff56(0x292,0x307)]['on']('disconnect',()=>{this[_0x59d019(0x1cb,0x1a6)]=_0x59d019(0x17a,0x11e);function _0x59d019(_0x2c6018,_0x4af7db){return _0x4da2(_0x4af7db- -0x10f,_0x2c6018);}this['channels']['forEach'](channel=>{function _0x30eec6(_0x350fbc,_0x16d9bf){return _0x4da2(_0x16d9bf- -0x23f,_0x350fbc);}channel[_0x30eec6(-0x6f,-0x48)](_0x30eec6(-0x9,0x7f));});}),this[_0x21ff56(0x36a,0x307)]['on'](_0x21ff56(0x288,0x2c5),_0x4a9abc=>{this['connectionState']='error';function _0x511b23(_0x11c0f8,_0x446d91){return _0x4da2(_0x11c0f8-0x8f,_0x446d91);}this[_0x511b23(0x305,0x2f6)]++,this['reconnectAttempts']>=this['maxReconnectAttempts']&&_0x12499f(new Error(_0x511b23(0x2f7,0x36d)+this[_0x511b23(0x348,0x2d4)]+_0x511b23(0x349,0x3bc)+_0x4a9abc[_0x511b23(0x34b,0x3b5)]));}),this['socketAdapter']['on']('reconnect',()=>{function _0x4db117(_0xd183dc,_0x57d48e){return _0x4da2(_0xd183dc-0x3dc,_0x57d48e);}this['connectionState']=_0x4db117(0x63f,0x5d0),this[_0x4db117(0x652,0x6c4)]=0x0,this[_0x4db117(0x6c9,0x6f4)]['forEach'](channel=>{function _0x351ff8(_0x498dbb,_0x3674e7){return _0x4da2(_0x498dbb- -0x3b8,_0x3674e7);}channel[_0x351ff8(-0xce,-0x80)]();});}),this['socketAdapter']['on']('postgres_changes',_0x58188a=>{function _0x503f55(_0x152d04,_0x7c7180){return _0x4da2(_0x152d04- -0x169,_0x7c7180);}const channel=this['channels'][_0x503f55(0x185,0x154)](_0x58188a['topic']);channel&&channel[_0x503f55(0xe5,0xa7)](_0x503f55(0x166,0x17f),_0x58188a);}),this['socketAdapter']['on']('broadcast',_0x4aa59f=>{function _0x1bb306(_0x50e082,_0x45206d){return _0x4da2(_0x45206d- -0x393,_0x50e082);}const channel=this[_0x1bb306(-0x123,-0xa6)]['get'](_0x4aa59f[_0x1bb306(-0x13b,-0x174)]);channel&&channel['_trigger'](_0x1bb306(-0x10a,-0x172),_0x4aa59f);}),this['socketAdapter']['on']('presence',_0x3a66bc=>{const channel=this['channels'][_0x2f09ca(-0x60,-0x15)](_0x3a66bc['topic']);function _0x2f09ca(_0x13769d,_0x246a00){return _0x4da2(_0x246a00- -0x303,_0x13769d);}channel&&channel['_trigger']('presence',_0x3a66bc);});}catch(_0x5d2771){this['connectionState']=_0x21ff56(0x26e,0x2cf),_0x12499f(_0x5d2771);}});}[_0x347d1c(-0x175,-0x107)](){this[_0x100fd1(0x506,0x4f1)]&&(this[_0x100fd1(0x506,0x506)]['disconnect'](),this['socket']=null);this[_0x100fd1(0x539,0x50f)]=_0x100fd1(0x4b1,0x499);function _0x100fd1(_0x2af3f8,_0x199687){return _0x4da2(_0x2af3f8-0x284,_0x199687);}this['channels'][_0x100fd1(0x55c,0x52d)]();}['channel'](_0x347533){if(this[_0x451559(-0x85,-0xf0)][_0x451559(-0xf6,-0xf5)](_0x347533))return this['channels'][_0x451559(-0xe1,-0xef)](_0x347533);const channel=new RealtimeChannel(_0x347533,this[_0x451559(-0x1fc,-0x1b3)]);this[_0x451559(-0x64,-0xf0)][_0x451559(-0x241,-0x1ce)](_0x347533,channel);this['connectionState']==='connected'&&channel[_0x451559(-0x156,-0x1a9)]();function _0x451559(_0x44f189,_0x406cdf){return _0x4da2(_0x406cdf- -0x3dd,_0x44f189);}return channel;}[_0x347d1c(-0xa5,-0xd4)](channel){function _0x3d4a46(_0x47d235,_0x11e586){return _0x4da2(_0x11e586- -0x17e,_0x47d235);}const _0x19a667=channel[_0x3d4a46(0x1e,0xa1)];this['channels'][_0x3d4a46(0x1f5,0x16a)](_0x19a667)&&(this['channels']['delete'](_0x19a667),channel['unsubscribe']());}['removeAllChannels'](){this['channels'][_0x302335(0x1f9,0x221)](channel=>{function _0xa283ab(_0x1db6b6,_0x3967c1){return _0x4da2(_0x3967c1- -0x3cc,_0x1db6b6);}channel[_0xa283ab(-0x188,-0x13d)]();});function _0x302335(_0x5dff10,_0x184466){return _0x4da2(_0x5dff10- -0x27,_0x184466);}this['channels']['clear']();}[_0x347d1c(-0x4b,-0x94)](){function _0x462ecc(_0x34cb2a,_0x20cbb5){return _0x4da2(_0x20cbb5-0x78,_0x34cb2a);}return Array[_0x462ecc(0x313,0x377)](this[_0x462ecc(0x354,0x365)][_0x462ecc(0x3b4,0x341)]());}[_0x347d1c(-0x107,-0xe4)](){function _0x3a8db9(_0x163b3f,_0x4615de){return _0x4da2(_0x4615de- -0x98,_0x163b3f);}return this[_0x3a8db9(0x25e,0x21d)]===_0x3a8db9(0x212,0x1cb)&&this[_0x3a8db9(0x199,0x1ea)][_0x3a8db9(0x155,0x1cb)];}['getConnectionState'](){function _0x37b7f6(_0x3b636f,_0x2e1666){return _0x4da2(_0x3b636f- -0x21a,_0x2e1666);}return this[_0x37b7f6(0x9b,0xcc)];}[_0x347d1c(-0x162,-0xec)](_0x1845fd){function _0x2531f0(_0x29d424,_0x1542f2){return _0x4da2(_0x29d424-0x5b,_0x1542f2);}const _0x3c2af1=()=>_0x1845fd(this[_0x2531f0(0x310,0x377)]);return this[_0x2531f0(0x2dd,0x34f)]&&(this[_0x2531f0(0x2dd,0x33b)]['on']('connect',()=>{this['connectionState']=_0x54c348(0x4f0,0x49f);function _0x54c348(_0x582797,_0x24ee71){return _0x4da2(_0x582797-0x28d,_0x24ee71);}_0x3c2af1();}),this[_0x2531f0(0x2dd,0x28c)]['on']('disconnect',()=>{this['connectionState']='disconnected',_0x3c2af1();}),this['socketAdapter']['on']('connect_error',()=>{function _0x32c184(_0x4178bb,_0x202be2){return _0x4da2(_0x202be2-0x152,_0x4178bb);}this['connectionState']=_0x32c184(0x3e9,0x39c),_0x3c2af1();})),()=>{function _0x4ce9e6(_0xf8f7c0,_0x18fa0b){return _0x4da2(_0x18fa0b-0x312,_0xf8f7c0);}this['socketAdapter']&&(this[_0x4ce9e6(0x612,0x594)]['off']('connect',_0x3c2af1),this['socketAdapter'][_0x4ce9e6(0x565,0x5d5)]('disconnect',_0x3c2af1),this['socketAdapter']['off'](_0x4ce9e6(0x4f0,0x552),_0x3c2af1));};}['setupHeartbeat'](){if(!this['options']['heartbeatInterval']||!this[_0x3a8855(0x445,0x3bd)])return;function _0x3a8855(_0x43aea1,_0xfc161e){return _0x4da2(_0xfc161e-0x13b,_0x43aea1);}const interval=setInterval(()=>{function _0x39cfd0(_0x3cbac0,_0xa611e2){return _0x4da2(_0x3cbac0- -0x1fd,_0xa611e2);}this[_0x39cfd0(0x85,0xa7)]?.[_0x39cfd0(0x66,0x73)]?this['socketAdapter']['emit'](_0x39cfd0(0xff,0x13e),{'timestamp':Date['now']()}):clearInterval(interval);},this[_0x3a8855(0x387,0x403)][_0x3a8855(0x406,0x41f)]);}['_getSocket'](){function _0xeb588b(_0x2e9c5a,_0x4a98df){return _0x4da2(_0x4a98df- -0x65,_0x2e9c5a);}return this[_0xeb588b(0x245,0x1c5)];}}class FunctionsClient{constructor(_0x53d1df){function _0x1bda14(_0x2ccc52,_0x4edf16){return _0x4da2(_0x2ccc52- -0x2,_0x4edf16);}this[_0x1bda14(0x29e,0x261)]=_0x53d1df;}async['invoke'](_0x15f978,_0x2043da){function _0x242407(_0x2f55d9,_0x1a38be){return _0x4da2(_0x1a38be-0x22b,_0x2f55d9);}try{const _0x4d3938=_0x2043da?.['method']||'POST',headers={'Content-Type':'application/json',..._0x2043da?.['headers']};let response;const _0x48f0a9='/functions/v1/'+_0x15f978;switch(_0x4d3938[_0x242407(0x4fa,0x528)]()){case'GET':response=await this[_0x242407(0x4ac,0x4cb)]['get'](_0x48f0a9,{'headers':headers,'params':_0x2043da?.[_0x242407(0x447,0x46d)]});break;case'POST':response=await this['httpClient']['post'](_0x48f0a9,_0x2043da?.['body'],{'headers':headers});break;case'PUT':response=await this[_0x242407(0x54f,0x4cb)][_0x242407(0x523,0x4a8)](_0x48f0a9,_0x2043da?.[_0x242407(0x3ec,0x46d)],{'headers':headers});break;case'PATCH':response=await this[_0x242407(0x4ad,0x4cb)]['patch'](_0x48f0a9,_0x2043da?.['body'],{'headers':headers});break;case'DELETE':response=await this[_0x242407(0x448,0x4cb)][_0x242407(0x4f2,0x4d9)](_0x48f0a9,{'headers':headers,'data':_0x2043da?.[_0x242407(0x4dd,0x46d)]});break;default:throw new EBaaSError(_0x242407(0x456,0x448)+_0x4d3938,0x190);}return{'data':response['data'],'error':null};}catch(_0x53beec){return{'data':null,'error':_0x53beec instanceof EBaaSError?_0x53beec:new EBaaSError(_0x53beec instanceof Error?_0x53beec[_0x242407(0x4b7,0x4e7)]:'Function\x20invocation\x20failed',0x0,_0x53beec)};}}async[_0x347d1c(-0xa6,-0x93)](){function _0x5cf1b3(_0x46f25c,_0x111b5b){return _0x4da2(_0x111b5b- -0x11d,_0x46f25c);}try{const response=await this['httpClient'][_0x5cf1b3(0x156,0x1d1)](_0x5cf1b3(0x85,0xff));return{'data':response[_0x5cf1b3(0x184,0x112)],'error':null};}catch(_0x4eab01){return{'data':null,'error':_0x4eab01 instanceof EBaaSError?_0x4eab01:new EBaaSError(_0x4eab01 instanceof Error?_0x4eab01['message']:'Failed\x20to\x20list\x20functions',0x0,_0x4eab01)};}}async['get'](_0x3b4edd){function _0x129e92(_0x2ebca0,_0x435290){return _0x4da2(_0x2ebca0-0x54,_0x435290);}try{const response=await this['httpClient']['get']('/functions/v1/'+_0x3b4edd+'/info');return{'data':response['data'],'error':null};}catch(_0x19737a){return{'data':null,'error':_0x19737a instanceof EBaaSError?_0x19737a:new EBaaSError(_0x19737a instanceof Error?_0x19737a[_0x129e92(0x310,0x320)]:'Failed\x20to\x20get\x20function',0x0,_0x19737a)};}}async['deploy'](_0xf1b82f,_0xb9e01f){function _0x106736(_0xd7988a,_0x456db2){return _0x4da2(_0x456db2-0x57,_0xd7988a);}try{const _0x4b2ad1=new FormData();if(_0xb9e01f['code']instanceof File)_0x4b2ad1['append']('code',_0xb9e01f[_0x106736(0x2fd,0x29f)]);else typeof _0xb9e01f['code']===_0x106736(0x375,0x2f1)&&_0x4b2ad1['append']('code',new Blob([_0xb9e01f['code']],{'type':_0x106736(0x305,0x2da)}),'index.ts');_0xb9e01f[_0x106736(0x3bd,0x335)]&&_0x4b2ad1['append'](_0x106736(0x315,0x335),_0xb9e01f['entrypoint']);_0xb9e01f['env']&&_0x4b2ad1[_0x106736(0x35c,0x302)](_0x106736(0x260,0x2b0),JSON[_0x106736(0x33d,0x2f5)](_0xb9e01f['env']));_0xb9e01f['importMap']&&_0x4b2ad1['append']('importMap',JSON['stringify'](_0xb9e01f['importMap']));_0xb9e01f[_0x106736(0x267,0x28c)]!==undefined&&_0x4b2ad1[_0x106736(0x29e,0x302)](_0x106736(0x248,0x28c),String(_0xb9e01f[_0x106736(0x317,0x28c)]));const response=await this[_0x106736(0x29c,0x2f7)][_0x106736(0x369,0x325)](_0x106736(0x257,0x2a3)+_0xf1b82f+_0x106736(0x374,0x338),_0x4b2ad1,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response['data'],'error':null};}catch(_0x222651){return{'data':null,'error':_0x222651 instanceof EBaaSError?_0x222651:new EBaaSError(_0x222651 instanceof Error?_0x222651['message']:'Failed\x20to\x20deploy\x20function',0x0,_0x222651)};}}async[_0x347d1c(-0x14e,-0xcc)](_0x48cd8a){function _0x332a17(_0x35cda3,_0x4aabc6){return _0x4da2(_0x35cda3- -0x299,_0x4aabc6);}try{const response=await this[_0x332a17(0x7,-0x1d)]['delete'](_0x332a17(-0x4d,-0xc)+_0x48cd8a);return{'data':response['data'],'error':null};}catch(_0x16522b){return{'data':null,'error':_0x16522b instanceof EBaaSError?_0x16522b:new EBaaSError(_0x16522b instanceof Error?_0x16522b['message']:_0x332a17(-0x1,-0x70),0x0,_0x16522b)};}}async[_0x347d1c(-0x63,-0xc2)](_0x1d3ccc,_0x46de65){function _0x11d3bf(_0x4f0ce7,_0x7c56bc){return _0x4da2(_0x4f0ce7- -0x232,_0x7c56bc);}try{const response=await this[_0x11d3bf(0x6e,0xef)][_0x11d3bf(0x4b,0x3f)](_0x11d3bf(0x1a,0x7)+_0x1d3ccc+'/env',{'env':_0x46de65});return{'data':response[_0x11d3bf(-0x3,0x7a)],'error':null};}catch(_0x20c526){return{'data':null,'error':_0x20c526 instanceof EBaaSError?_0x20c526:new EBaaSError(_0x20c526 instanceof Error?_0x20c526[_0x11d3bf(0x8a,0x103)]:_0x11d3bf(0x84,0x2),0x0,_0x20c526)};}}async[_0x347d1c(-0x1bc,-0x17a)](_0x48324f,_0x2f8c86){function _0x1b1745(_0x29ea76,_0x2aef1b){return _0x4da2(_0x2aef1b- -0x1c2,_0x29ea76);}try{const _0x2fa889=new URLSearchParams();_0x2f8c86?.[_0x1b1745(0x142,0x11d)]&&_0x2fa889[_0x1b1745(0x69,0xe9)]('limit',String(_0x2f8c86[_0x1b1745(0x15c,0x11d)]));_0x2f8c86?.[_0x1b1745(0x151,0xc6)]&&_0x2fa889['append']('offset',String(_0x2f8c86[_0x1b1745(0x130,0xc6)]));_0x2f8c86?.[_0x1b1745(0xa1,0x4f)]&&_0x2fa889[_0x1b1745(0x13b,0xe9)](_0x1b1745(0x72,0x4f),_0x2f8c86['level']);const _0x319fac=_0x1b1745(0xdc,0x8a)+_0x48324f+_0x1b1745(0x156,0x115)+(_0x2fa889[_0x1b1745(0x11d,0xa8)]()?'?'+_0x2fa889[_0x1b1745(0x80,0xa8)]():''),response=await this['httpClient'][_0x1b1745(0xba,0x12c)](_0x319fac);return{'data':response['data'],'error':null};}catch(_0x4caa67){return{'data':null,'error':_0x4caa67 instanceof EBaaSError?_0x4caa67:new EBaaSError(_0x4caa67 instanceof Error?_0x4caa67[_0x1b1745(0x118,0xfa)]:'Failed\x20to\x20get\x20function\x20logs',0x0,_0x4caa67)};}}async['getMetrics'](_0x37b59b,_0x450c46){function _0x4b23ed(_0x1f56fc,_0x57916d){return _0x4da2(_0x57916d- -0xde,_0x1f56fc);}try{const _0xe6ffe3=new URLSearchParams();_0x450c46?.['period']&&_0xe6ffe3['append']('period',_0x450c46['period']);const _0x298c9b=_0x4b23ed(0x132,0x16e)+_0x37b59b+'/metrics'+(_0xe6ffe3['toString']()?'?'+_0xe6ffe3['toString']():''),response=await this['httpClient']['get'](_0x298c9b);return{'data':response['data'],'error':null};}catch(_0x5d64b3){return{'data':null,'error':_0x5d64b3 instanceof EBaaSError?_0x5d64b3:new EBaaSError(_0x5d64b3 instanceof Error?_0x5d64b3['message']:_0x4b23ed(0x288,0x1fd),0x0,_0x5d64b3)};}}}class EBaaSClient{constructor(_0x56c27a,_0x3c785d,_0x744a62){this[_0x55885c(0x7c,0x4d)]=_0x744a62,this['httpClient']=new HttpClient({'url':_0x56c27a,'apiKey':_0x3c785d,'timeout':0x7530,'headers':_0x744a62?.[_0x55885c(-0xb,0x50)]?.['headers']}),this[_0x55885c(0xa6,0x21)]=new AuthClient(this['httpClient'],_0x744a62?.[_0x55885c(-0x5c,-0x44)]?.[_0x55885c(0x5d,0x90)]),this['database']=new DatabaseClient(this['httpClient'],_0x744a62?.['database']?.['workspaceId']),this[_0x55885c(-0x15,-0x10)]=new StorageClient(this['httpClient']),this[_0x55885c(-0x64,-0xa6)]=new RealtimeClient(_0x56c27a,_0x3c785d,_0x744a62?.['realtime']);function _0x55885c(_0x3d64e2,_0x304f4d){return _0x4da2(_0x3d64e2- -0x24c,_0x304f4d);}this[_0x55885c(0x4f,0x4b)]=new FunctionsClient(this[_0x55885c(0x54,0x76)]),this['initializeCustomDatabase']();}[_0x347d1c(-0xc9,-0x7b)](_0x4d3d14){function _0x26f5bc(_0x25227a,_0x607d7a){return _0x4da2(_0x25227a- -0x3a1,_0x607d7a);}return this['database'][_0x26f5bc(-0xa2,-0xad)](_0x4d3d14);}[_0x347d1c(-0x10e,-0xd9)](_0x3a1cd7,_0x7b4d05){function _0x3e23bd(_0x17caf3,_0x2aecff){return _0x4da2(_0x2aecff- -0x199,_0x17caf3);}return this[_0x3e23bd(0xa5,0x57)]['rpc'](_0x3a1cd7,_0x7b4d05);}[_0x347d1c(-0xb8,-0xee)](_0x59e019){function _0x53bfca(_0x5b878d,_0xfbb1e6){return _0x4da2(_0xfbb1e6- -0x171,_0x5b878d);}return this[_0x53bfca(0x70,0xc6)]['from'](_0x59e019);}['channel'](_0x3f091e){function _0x3d122a(_0x4780a8,_0x27397f){return _0x4da2(_0x4780a8- -0x3e1,_0x27397f);}return this['realtime'][_0x3d122a(-0x15c,-0x188)](_0x3f091e);}[_0x347d1c(-0x9f,-0xa7)](_0x32c9b1,_0x102842){return this['functions']['invoke'](_0x32c9b1,_0x102842);}async['initializeCustomDatabase'](){function _0x464cb4(_0x3533da,_0x1068dc){return _0x4da2(_0x3533da- -0x2a8,_0x1068dc);}if(this['options']?.['database']?.[_0x464cb4(0x1c,0x8f)])try{await this['database'][_0x464cb4(0x38,0xb8)]();}catch(_0x1b9d9c){console[_0x464cb4(-0x13,-0x77)]('Failed to initialize custom database detection:',_0x1b9d9c);}}async[_0x347d1c(-0x26,-0x95)](_0x5da533){this['auth'][_0x40f72e(0x131,0xa6)](_0x5da533),this[_0x40f72e(0x3c,0x38)][_0x40f72e(0x131,0x16b)](_0x5da533);function _0x40f72e(_0x4a7e1e,_0xe473e4){return _0x4da2(_0x4a7e1e- -0x1b4,_0xe473e4);}this['options']?.[_0x40f72e(0x3c,0x43)]?.['autoDetectCustomDatabase']&&await this[_0x40f72e(0x3c,0xa)][_0x40f72e(0x12c,0x109)]();}async['configureCustomDatabase'](_0x10b461){function _0x41a493(_0x5f1bb2,_0x3985dd){return _0x4da2(_0x5f1bb2- -0x2b0,_0x3985dd);}await this[_0x41a493(-0xc0,-0x7c)]['configureCustomDatabase'](_0x10b461);}['getCustomDatabaseStatus'](){function _0xf9eae5(_0x46ebe6,_0x114287){return _0x4da2(_0x46ebe6- -0x2b6,_0x114287);}return this[_0xf9eae5(-0xc6,-0x7c)]['getCustomDatabaseStatus']();}}function _0x39f8(){const _0x54a09d=['C3rVCMfNzq','ChjLC2vUy2u','l3n0B3jHz2uVDxnHz2u','CMvTB3zLqxv0AfrVA2vU','C2v0u2vZC2LVBKLUDgvYBMfS','Cg9ZDgDYzxnty2HLBwe','uMvXDwvZDcbMywLSzwq','AwXPA2u','z3rL','y29UBMvJDf9LCNjVCG','z2XVyMfS','yM9KEq','zw1PDa','y29UzMLN','AxnezwXLDgu','BgLRzq','y3jLzgvUDgLHBhm','y29Kzq','uhjLzMvY','zxjYB3i','DhjHy2S','l2z1BMn0Aw9UCY92ms8','shr0CenSAwvUDa','x3rYAwDNzxi','C2v0DxbjBNrLCMnLChrVCNm','z2v0u2vZC2LVBG','D2vIC29JA2v0','C2vHCMnO','p29WzxjHDgLVBJ1KzwXLDgu','zMLSDgvYCW','y29WEq','y29UBMvJDa','Cg9ZDgDYzxnvC2vYBMfTzq','zMLSzq','zw52','y3vYCMvUDfnLC3nPB24','lMrLC2m','B3jKzxi','C2v0u2vZC2LVBG','Ag9ZDa','DxbKyxrLrgf0yq','AM9PBMvK','zgvSzxrLqNvJA2v0','CMvTB3zLtgLZDgvUzxi','y29UBMvJDgvK','zgvMyxvSDhm','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','ywnJzxnZx3rVA2vU','zw50CMLLCW','rMfPBgvKihrVignVBM5Ly3qGywz0zxiG','B25Jzq','Dg9tDhjPBMC','Bwv0ywrHDge','CMvWBgfJzq','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','AM9PBG','y29UBMvJDgLUzW','mtaXmde1ngP0u05hCW','CMvZCg9UC2u','rMfPBgvKihrVigrLBgv0zsbIDwnRzxq','zgLZy29UBMvJDa','C3bSAxq','y3jLyxrLu2LNBMvKvxjS','CMvJB25Uzwn0qxr0zw1WDhm','zxHLy3v0zvf1zxj5','C3rHDgu','y3jLyxrL','Bg9N','CMvMCMvZAf90B2TLBG','q0Xpu0ve','Chv0','zxHLy3v0zq','C2nOzw1H','C29YDej5','rMfPBgvKihrVigXPC3qGzMLSzxm','C29JA2v0qwrHChrLCG','Dgv4Dc9WBgfPBG','BgvUz3rO','y2HHBM5LBa','ChjLzML4','rgf0ywjHC2uGB3bLCMf0Aw9UigzHAwXLza','B2zMC2v0','Bwf4tgLZDgvUzxjZ','yNjVywrJyxn0oG','y2fJAgvdB250CM9S','yNvJA2v0','C2v0sxrLBq','B25dB25Uzwn0Aw9Uu3rHDgvdAgfUz2u','Dw5ZDwjZy3jPyMu','Cg9ZDgDYzxnFy2HHBMDLCZO','ChvZAa','C2vSzwn0','B3bLCMf0Aw9U','ChjLCgvUzeXPC3rLBMvY','D2fYBG','AxndB25Uzwn0zwq','BhrL','rMfPBgvKihrVigrLBgv0zsbMDw5JDgLVBG','BgLZDgvUzxjZ','C3rYAw5N','zNvUy3rPB25Z','DxbZzxj0','u29JA2v0lMLVlwnSAwvUDcbUW6nVigvZDmoHigrPC3bVBSoTDMvSlIbqyxjHifjLywn0ie5HDgL2zsWGAw5ZDgfSztOGBNbTigLUC3rHBgWGC29JA2v0lMLVlwnSAwvUDa','C3rYAw5NAwz5','C2vZC2LVBG','Ahr0CenSAwvUDa','CNbJ','B25cCM9HzgnHC3q','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','z2v0u3rHDhvZ','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','CMvTB3zLq2HHBM5LBa','CMvHy3qTBMf0AxzL','C2vUza','D29YA3nWywnLswq','CMfUzg9T','yxbWzw5K','CMvTB3zL','ChjLzMvY','zgvSzxrL','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','y2XPzw50','zgf0yufYCMf5','zxzLBNrZ','z2v0twf4tgLZDgvUzxjZ','zgvSzxrLt3b0Aw9UCW','y29UBMvJDgLVBLn0yxrL','rMfPBgvKihrVihvWzgf0zsbMDw5JDgLVBIbLBNzPCM9UBwvUDa','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','DxbKyxrLrw52','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','igf0DgvTChrZoIa','CMvTB3zLq3vZDg9Trgf0ywjHC2u','BwvZC2fNzq','ywrK','y2XVC2vK','mJqWmti1yKv5BLDz','mtK2nduXmMDhrg1RCW','y29SDw1U','rujHyvndBgLLBNq','B2zM','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','yMXVyG','rujHyvnfCNjVCG','ChvIBgLJ','B3b0Aw9UCW','DMfSDwvZ','Aw50zxjJzxb0B3jZ','BwfRzvjLzG','rMfPBgvKihrVihjLBw92zsbMAwXLCW','DgfIBgu','Cg9ZDa','Cg9ZDgDYzxnFy2HHBMDLCW','CgfYC2u','C29JA2v0lMLVlwnSAwvUDa','Dg9ku09o','Aw52B2TL','CMf3tgLZDgvUzxjZ','CxvLCNK','Dw5KzwzPBMvK','l2XVz3m','y2XLyxi','y2fWDhvYzvn0ywnRvhjHy2u','Bw92zq','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbTzxrYAwnZ','p3vWC2vYDd10CNvL','C3nSrw5HyMXLza','zw50CNLWB2LUDa','BgLTAxq','Aw5PDgLHBgL6zq','l2rLCgXVEq','B25qB3n0z3jLC0nOyw5Nzxm','CMvXDwvZDa','AgvHCNrIzwf0sw50zxj2ywW','C2v0v29YA3nWywnLswq','z2v0q2HHBM5LBhm','BgLZDa','AgfZ','BMfTzq','x3jLAM9PBG','AgfUzgXLqxv0AevYCM9Y','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','y2HHBM5LBhm','z2v0','AgfZq3vZDg9Trgf0ywjHC2u','BMvX','mtG2nJm1sKDWAhvP','yxv0Aa','y29UDgfPBNm','y29UDgvUDfr5Cgu','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','AM9PBMLUzW','u3rVCMfNzunSAwvUDa','Cg9ZDgDYzxniB3n0','zxzLBNq','C3vIC2nYAxb0Aw9UCW','l2LUzM8','AgvHCNrIzwf0','Dg9vChbLCKnHC2u','BM9Kzq','zNjVBq','l3n0B3jHz2uVyNvJA2v0CY8','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','CMvHBhrPBwu','rMfPBgvKihrVihvWBg9HzcbMAwXL','rMfPBgvKihrVihvWzgf0zsbIDwnRzxq','DxbKyxrL','yxbPs2v5','zgv0zwn0zwrdB25MAwC','DxbKyxrLt3b0Aw9UCW','yxnJzw5KAw5N','zgf0ywjHC2u','C2L6zq','AM9PBMvKt25Jzq','y2XLyxjtzxnZAw9U','mZe3ndC1Bvboq2DX','DhjHBNnMB3jT','u1vcu0nssujfra','x3nLDfn0yxrL','C2v0qxv0AfrVA2vU','yNvJA2v0swq','AgvHzgvYCW','ms4XlJG','Dw50CMfJAW','y29TBw9U','CMfUz2u','qMvHCMvYia','z2v0tg9NCW','BgLZDgvUzxjdB3vUDa','l3jWyY8','zMLSDgvY','C3rHDhvZ','AgfUzgXLrxjYB3i','qxv0AenSAwvUDa','mKjwENzjsa','Cgf0y2G','Bg9HzfnLC3nPB24','DMfSDwu','ywrKtgLZDgvUzxi','rNvUy3rPB25Zq2XPzw50','sfruucbYzxf1zxn0igzHAwXLza','B3bLCMf0B3i','C2v0','y3vYCMvUDfnJAgvTyq','Bgv2zwW','CMvQzwn0','z2v0sxrLBq','ChjLC2vUy2u6','DxjS','CMvZzxrqyxnZD29Yza','DxbKyxrLqNvJA2v0','z2v0qNvJA2v0','yxHPB3m','ndK2mtq2CwLWDMPA','CMvJB25Uzwn0sw50zxj2ywW','l2z1BMn0Aw9UCY92mq','vw5ZDxbWB3j0zwqGsfruucbTzxrOB2q6ia','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','Dg9WAwm','zM9YrwfJAa','yNjVywrJyxn0','yNjVD3nLCG','C3rHDhvZvgv4Da','DxnLCG','l21LDgfKyxrH','uMvHBhrPBwvdBgLLBNq','l2zPBgvZlW','l2zPBgvZl2nVChK','mZa0ndG4whfSCwTg','C29JA2v0','rMfPBgvKihrVignVChKGzMLSzq','DgvZDenVBM5Ly3rPB24','zgLZy29UBMvJDgvK','zgv0zwn0q3vZDg9Trgf0ywjHC2u','zgf0yq','Cg9YDa','zwjHyxmUyxv0Ac5ZzxnZAw9U','CMvZB2X2zq','zxzLBNroyw1LCW','x2PVAw4','DMvYAwz5','DxnL'];_0x39f8=function(){return _0x54a09d;};return _0x39f8();}function createClient(_0x4a35f7,_0x264c79,_0x2d3309){return new EBaaSClient(_0x4a35f7,_0x264c79,_0x2d3309);}const version=_0x347d1c(-0x1d8,-0x17f);exports[_0x347d1c(-0x18d,-0x174)]=AuthClient,exports['CustomDatabaseManager']=CustomDatabaseManager,exports['DatabaseClient']=DatabaseClient,exports[_0x347d1c(-0x8c,-0xb8)]=EBaaSClient,exports[_0x347d1c(-0x9b,-0xb4)]=EBaaSError,exports[_0x347d1c(-0x1e0,-0x16e)]=FunctionsClient,exports[_0x347d1c(-0x13c,-0x12d)]=HttpClient,exports['QueryBuilder']=QueryBuilder,exports['RealtimeChannel']=RealtimeChannel,exports[_0x347d1c(-0x129,-0x154)]=RealtimeClient,exports['StorageBucket']=StorageBucket,exports[_0x347d1c(-0x81,-0x83)]=StorageClient,exports['createClient']=createClient,exports['version']=version;
|
|
1
|
+
'use strict';(function(stringArrayFunction,comparisonValue){function _0xdaaff6(_0x25c8b3,_0x279c24){return _0x1cc1(_0x25c8b3- -0x18b,_0x279c24);}const stringArray=stringArrayFunction();while(!![]){try{const _0x44f560=parseInt(_0xdaaff6(-0x34,-0xaa))/0x1+parseInt(_0xdaaff6(-0x4c,-0xbf))/0x2*(-parseInt(_0xdaaff6(0x62,0xd1))/0x3)+-parseInt(_0xdaaff6(0xa3,0xe9))/0x4+parseInt(_0xdaaff6(0xb3,0x95))/0x5*(parseInt(_0xdaaff6(0x6,0x26))/0x6)+-parseInt(_0xdaaff6(0xb,-0x55))/0x7*(parseInt(_0xdaaff6(0x72,0xa1))/0x8)+parseInt(_0xdaaff6(0x61,0xd3))/0x9+-parseInt(_0xdaaff6(0x2e,0x52))/0xa*(-parseInt(_0xdaaff6(0x2a,-0x2b))/0xb);if(_0x44f560===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x89e0b){stringArray['push'](stringArray['shift']());}}}(_0x5014,0xd0420));var axios=require('axios');class EBaaSError extends Error{constructor(_0x1f1e26,status=0x0,_0x57daed){super(_0x1f1e26),this[_0x2c3f67(0x10a,0x146)]='EBaaSError';function _0x2c3f67(_0x5bd21d,_0x4e4db5){return _0x1cc1(_0x5bd21d- -0x34,_0x4e4db5);}this['status']=status,this['details']=_0x57daed,Error[_0x2c3f67(0x12a,0x18f)]&&Error[_0x2c3f67(0x12a,0x197)](this,EBaaSError);}['toJSON'](){function _0x36455f(_0x190aab,_0x1c635e){return _0x1cc1(_0x1c635e-0x8e,_0x190aab);}return{'name':this[_0x36455f(0x148,0x1cc)],'message':this[_0x36455f(0x224,0x1c5)],'status':this[_0x36455f(0x1d2,0x201)],'details':this[_0x36455f(0x16d,0x1c7)],'stack':this['stack']};}[_0x2d9ed0(0x36c,0x382)](){function _0x13846c(_0x48f1d6,_0x5f1277){return _0x1cc1(_0x48f1d6- -0x354,_0x5f1277);}return this['name']+':\x20'+this[_0x13846c(-0x21d,-0x1c4)]+_0x13846c(-0x1ae,-0x147)+this[_0x13846c(-0x1e1,-0x1d0)]+')';}}class HttpClient{constructor(config){this['baseURL']=config['url'];function _0x5f0db6(_0x265f75,_0x4a9d96){return _0x1cc1(_0x4a9d96- -0x22c,_0x265f75);}this[_0x5f0db6(0x1e,-0x52)]=config[_0x5f0db6(-0x5a,-0x52)],this['client']=axios[_0x5f0db6(-0xce,-0xac)]({'baseURL':this[_0x5f0db6(0x34,-0x39)],'timeout':config['timeout']||0x2710,'headers':{'Content-Type':'application/json','apikey':this[_0x5f0db6(0x1,-0x52)],...config[_0x5f0db6(0x6a,-0xc)]}}),this['setupInterceptors']();}['setupInterceptors'](){function _0x671af6(_0x1739d6,_0x2528b0){return _0x1cc1(_0x1739d6-0x10d,_0x2528b0);}this[_0x671af6(0x2f7,0x2f4)][_0x671af6(0x331,0x2fb)]['request']['use'](config=>{return config;},_0x1a928c=>{function _0x3e9fe9(_0x5a6b3d,_0x3a3569){return _0x1cc1(_0x3a3569- -0x2ea,_0x5a6b3d);}return Promise[_0x3e9fe9(-0xbc,-0xe8)](new EBaaSError('Request\x20failed',0x0,_0x1a928c));}),this[_0x671af6(0x2f7,0x301)][_0x671af6(0x331,0x2b6)][_0x671af6(0x318,0x290)][_0x671af6(0x2cc,0x277)](response=>{return response;},_0x401160=>{const status=_0x401160[_0x1556b1(-0xd6,-0x140)]?.[_0x1556b1(-0x16e,-0x1dc)]||0x0,_0x1e82aa=_0x401160[_0x1556b1(-0xd6,-0xed)]?.['data']?.[_0x1556b1(-0x1aa,-0x194)]||_0x401160[_0x1556b1(-0x1aa,-0x14a)]||_0x1556b1(-0x191,-0x1b5),_0x18823a=_0x401160[_0x1556b1(-0xd6,-0x109)]?.['data']||_0x401160;function _0x1556b1(_0xebbe49,_0x3b9b19){return _0x1cc1(_0xebbe49- -0x2e1,_0x3b9b19);}return Promise[_0x1556b1(-0xdf,-0x138)](new EBaaSError(_0x1e82aa,status,_0x18823a));});}async[_0x2d9ed0(0x3e9,0x37b)](_0xb0f5cb,config){function _0x5186b4(_0x23e571,_0x458f93){return _0x1cc1(_0x23e571-0x2d3,_0x458f93);}try{const response=await this[_0x5186b4(0x4bd,0x43e)]['get'](_0xb0f5cb,config);return{'data':response['data'],'status':response[_0x5186b4(0x446,0x47e)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x27c418){throw this['handleError'](_0x27c418);}}async[_0x2d9ed0(0x3b1,0x39a)](_0x67ef13,data,config){function _0x4918dc(_0x5262d5,_0x399f26){return _0x1cc1(_0x399f26-0x239,_0x5262d5);}try{const response=await this[_0x4918dc(0x44c,0x423)][_0x4918dc(0x3f3,0x3d9)](_0x67ef13,data,config);return{'data':response[_0x4918dc(0x481,0x440)],'status':response[_0x4918dc(0x369,0x3ac)],'statusText':response[_0x4918dc(0x346,0x380)],'headers':response[_0x4918dc(0x46b,0x459)]};}catch(_0x4707ea){throw this['handleError'](_0x4707ea);}}async['put'](_0x158647,data,config){function _0x5fb055(_0x4c78f0,_0x1919ee){return _0x1cc1(_0x1919ee-0x30c,_0x4c78f0);}try{const response=await this['client']['put'](_0x158647,data,config);return{'data':response[_0x5fb055(0x4bc,0x513)],'status':response[_0x5fb055(0x4e9,0x47f)],'statusText':response[_0x5fb055(0x3ef,0x453)],'headers':response['headers']};}catch(_0x2aed93){throw this[_0x5fb055(0x580,0x508)](_0x2aed93);}}async['patch'](_0x45cd15,data,config){function _0x37e221(_0xbcf1fb,_0x711878){return _0x1cc1(_0x711878- -0x2f,_0xbcf1fb);}try{const response=await this['client']['patch'](_0x45cd15,data,config);return{'data':response[_0x37e221(0x1ab,0x1d8)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x34c81b){throw this['handleError'](_0x34c81b);}}async['delete'](_0x3f1a92,config){function _0x447ab1(_0x39dc53,_0x5a4d66){return _0x1cc1(_0x5a4d66- -0x2bd,_0x39dc53);}try{const response=await this['client']['delete'](_0x3f1a92,config);return{'data':response[_0x447ab1(-0xed,-0xb6)],'status':response[_0x447ab1(-0xf3,-0x14a)],'statusText':response['statusText'],'headers':response[_0x447ab1(-0x1c,-0x9d)]};}catch(_0x27395a){throw this[_0x447ab1(-0x144,-0xc1)](_0x27395a);}}['setAuthToken'](_0x3bcb5c){this['client']['defaults']['headers']['common']['Authorization']='Bearer\x20'+_0x3bcb5c;}['removeAuthToken'](){delete this[_0x2dd987(0x5f6,0x5a9)]['defaults']['headers'][_0x2dd987(0x569,0x5f1)]['Authorization'];function _0x2dd987(_0x384e86,_0x523afc){return _0x1cc1(_0x523afc-0x3bf,_0x384e86);}this[_0x2dd987(0x52e,0x5a9)]['defaults']['headers'][_0x2dd987(0x5e2,0x5f1)]['Authorization']=_0x2dd987(0x61a,0x59d)+this['apiKey'];}[_0x2d9ed0(0x40d,0x417)](_0x5f5484){function _0x31b7bf(_0x53859e,_0x1ffa7e){return _0x1cc1(_0x1ffa7e- -0x32,_0x53859e);}if(_0x5f5484 instanceof EBaaSError)return _0x5f5484;return new EBaaSError(_0x5f5484[_0x31b7bf(0xc4,0x105)]||'HTTP\x20request\x20failed',_0x5f5484['status']||0x0,_0x5f5484);}}class AuthClient{constructor(_0x2a5e2d,_0x4f536c){this[_0x2c0741(0x40,0x7c)]=null,this['httpClient']=_0x2a5e2d;function _0x2c0741(_0x20b923,_0x1a4df2){return _0x1cc1(_0x20b923- -0x115,_0x1a4df2);}this['workspaceId']=_0x4f536c,this['loadSession']();}async['signUp'](data){function _0x4ffcf2(_0x396021,_0x3abe3e){return _0x1cc1(_0x396021-0x1f5,_0x3abe3e);}try{const response=await this['httpClient'][_0x4ffcf2(0x395,0x31b)]('/auth/v1/signup',data);return response['data'][_0x4ffcf2(0x380,0x3f9)]&&this['setSessionInternal'](response[_0x4ffcf2(0x3fc,0x47f)]['session']),response[_0x4ffcf2(0x3fc,0x3cb)];}catch(_0x23f628){throw this[_0x4ffcf2(0x349,0x334)](_0x23f628);}}async[_0x2d9ed0(0x416,0x476)](data){function _0x28fa23(_0xafa13a,_0x44f812){return _0x1cc1(_0x44f812- -0x3a8,_0xafa13a);}try{const headers={};this['workspaceId']&&(headers['X-Workspace-ID']=this['workspaceId']);const response=await this['httpClient']['post']('/auth/v1/sdk/signin',data,{'headers':headers});return response[_0x28fa23(-0x17e,-0x1a1)][_0x28fa23(-0x247,-0x21d)]&&this[_0x28fa23(-0x28b,-0x242)](response['data'][_0x28fa23(-0x285,-0x21d)]),response['data'];}catch(_0x44811b){throw this['handleAuthError'](_0x44811b);}}async[_0x2d9ed0(0x42d,0x3f6)](){function _0x43be53(_0x1c815a,_0xb3153b){return _0x1cc1(_0x1c815a-0x2c8,_0xb3153b);}try{await this['httpClient']['post']('/auth/v1/signout'),this[_0x43be53(0x4fd,0x500)]();}catch(_0x1eab0f){this[_0x43be53(0x4fd,0x4a4)]();throw this[_0x43be53(0x41c,0x432)](_0x1eab0f);}}async[_0x2d9ed0(0x36b,0x344)](){if(!this[_0x2c5b14(0x2a3,0x2d3)]?.[_0x2c5b14(0x2ff,0x37d)])return null;function _0x2c5b14(_0x557bba,_0x22f3ce){return _0x1cc1(_0x557bba-0x14e,_0x22f3ce);}try{const response=await this[_0x2c5b14(0x2f1,0x372)][_0x2c5b14(0x326,0x304)](_0x2c5b14(0x335,0x3af));return response['data'][_0x2c5b14(0x2be,0x2b1)];}catch(_0x1ecb09){if(_0x1ecb09 instanceof EBaaSError&&_0x1ecb09[_0x2c5b14(0x2c1,0x330)]===0x191)return this[_0x2c5b14(0x383,0x408)](),null;throw this['handleAuthError'](_0x1ecb09);}}async[_0x2d9ed0(0x390,0x310)](){function _0x5c62a8(_0x19ec1c,_0x5d055a){return _0x1cc1(_0x5d055a-0x7,_0x19ec1c);}if(!this['currentSession']?.['refresh_token'])return null;try{const response=await this['httpClient']['post']('/auth/v1/refresh',{'refresh_token':this['currentSession']['refresh_token']});if(response['data'][_0x5c62a8(0x16c,0x192)])return this['setSession'](response['data'][_0x5c62a8(0x1f7,0x192)]),response[_0x5c62a8(0x1e0,0x20e)]['session'];return null;}catch(_0x1b6ccf){this[_0x5c62a8(0x233,0x23c)]();throw this['handleAuthError'](_0x1b6ccf);}}async[_0x2d9ed0(0x3f5,0x45d)](_0x2e8607){function _0x491f07(_0x34de8b,_0x394240){return _0x1cc1(_0x34de8b- -0x50,_0x394240);}try{await this['httpClient']['post']('/auth/v1/reset-password',{'email':_0x2e8607});}catch(_0x255428){throw this[_0x491f07(0x104,0x16f)](_0x255428);}}async['updateUser'](data){function _0x48bdab(_0x1e08c3,_0x321fe8){return _0x1cc1(_0x1e08c3-0x6c,_0x321fe8);}try{const response=await this['httpClient'][_0x48bdab(0x28a,0x2a0)]('/auth/v1/user',data);return response[_0x48bdab(0x273,0x2dd)][_0x48bdab(0x1dc,0x1d1)];}catch(_0x26f253){throw this[_0x48bdab(0x1c0,0x1cb)](_0x26f253);}}[_0x2d9ed0(0x35d,0x3e1)](){function _0x1727bd(_0x4266c2,_0x219175){return _0x1cc1(_0x219175-0x77,_0x4266c2);}return this[_0x1727bd(0x1d3,0x1cc)];}[_0x2d9ed0(0x41d,0x3ee)](_0x5046fb){this['currentSession']=_0x5046fb;function _0x4e45df(_0x7d7906,_0x4af624){return _0x1cc1(_0x7d7906-0x32,_0x4af624);}this[_0x4e45df(0x1d5,0x1a2)]['setAuthToken'](_0x5046fb[_0x4e45df(0x1e3,0x17d)]),typeof localStorage!==_0x4e45df(0x1b4,0x217)&&localStorage[_0x4e45df(0x21a,0x231)](_0x4e45df(0x1e8,0x163),JSON['stringify'](_0x5046fb));}['onAuthStateChange'](_0x177cce){return()=>{};}[_0x2d9ed0(0x419,0x453)](_0x42dd60){this['workspaceId']=_0x42dd60;}['setSessionInternal'](_0x2c634e){function _0x2b82aa(_0x134eb2,_0xf593fc){return _0x1cc1(_0xf593fc-0x7d,_0x134eb2);}this['currentSession']=_0x2c634e,this[_0x2b82aa(0x268,0x220)]['setAuthToken'](_0x2c634e['access_token']),typeof localStorage!==_0x2b82aa(0x1a7,0x1ff)&&localStorage['setItem']('ebaas.auth.session',JSON[_0x2b82aa(0x1ed,0x1be)](_0x2c634e));}[_0x2d9ed0(0x446,0x494)](){function _0x4a30eb(_0x3bc185,_0x4364e9){return _0x1cc1(_0x4364e9-0x3c6,_0x3bc185);}this['currentSession']=null,this['httpClient']['removeAuthToken'](),typeof localStorage!==_0x4a30eb(0x59c,0x548)&&localStorage['removeItem'](_0x4a30eb(0x558,0x57c));}['loadSession'](){function _0x4d688a(_0x5084ae,_0x2ee56b){return _0x1cc1(_0x5084ae- -0x3b9,_0x2ee56b);}if(typeof localStorage!==_0x4d688a(-0x237,-0x24f)){const _0x487909=localStorage['getItem'](_0x4d688a(-0x203,-0x225));if(_0x487909)try{const _0x1d058d=JSON['parse'](_0x487909);this['setSessionInternal'](_0x1d058d);}catch(_0x398a2c){this[_0x4d688a(-0x184,-0x160)]();}}}[_0x2d9ed0(0x365,0x33b)](_0x39d41a){if(_0x39d41a instanceof EBaaSError)return _0x39d41a;function _0x588f55(_0x548a5b,_0x2720c0){return _0x1cc1(_0x548a5b-0x236,_0x2720c0);}return new EBaaSError(_0x39d41a['message']||_0x588f55(0x413,0x46e),_0x39d41a['status']||0x0,_0x39d41a);}}class QueryBuilder{constructor(_0x557821,_0xfb5267,_0x5531b5,_0x5330d5){this[_0x34c433(-0x16b,-0x17e)]=_0x557821;function _0x34c433(_0x15a5bd,_0x3ff152){return _0x1cc1(_0x3ff152- -0x321,_0x15a5bd);}this[_0x34c433(-0x111,-0x178)]=_0xfb5267,this['schema']=_0x5531b5,this['workspaceId']=_0x5330d5,this['query']={'filters':[]};}['select'](_0xe39d8e='*',_0x5d6296){function _0x29cf52(_0x2810c1,_0x27d54d){return _0x1cc1(_0x2810c1-0x3e2,_0x27d54d);}return this[_0x29cf52(0x5e0,0x596)]['select']=_0xe39d8e,this;}[_0x2d9ed0(0x3c1,0x33f)](data,_0x3ddf8a){function _0x46b168(_0x4b0c96,_0x1bbe13){return _0x1cc1(_0x1bbe13-0x10d,_0x4b0c96);}return this['executeQuery']('POST',_0x46b168(0x28a,0x2c8)+this['table']+'?operation=insert',{'data':data,'options':_0x3ddf8a});}[_0x2d9ed0(0x3cb,0x37b)](data,_0x47e7f4){function _0x2ec773(_0x2a3a2c,_0x1c6e03){return _0x1cc1(_0x2a3a2c- -0x2c,_0x1c6e03);}return this['query'][_0x2ec773(0x16b,0xfd)]=data,this['query'][_0x2ec773(0x12c,0x115)]=_0x47e7f4,this;}['upsert'](data,_0x1bc05c){return this['executeQuery']('POST','/sdk/v1/'+this['table']+'?operation=upsert',{'data':data,'options':{..._0x1bc05c,'upsert':!![]}});}['delete'](_0x258a4f){this['query']['deleteOptions']=_0x258a4f;function _0x31581e(_0x22a440,_0x957d45){return _0x1cc1(_0x957d45-0x71,_0x22a440);}return this[_0x31581e(0x21a,0x26f)]['isDelete']=!![],this;}['eq'](_0x4b2289,_0x16f199){function _0x38e2af(_0x425082,_0x1ab011){return _0x1cc1(_0x1ab011-0x1f6,_0x425082);}return this[_0x38e2af(0x3bd,0x3f4)][_0x38e2af(0x2f1,0x340)]['push']({'column':_0x4b2289,'operator':'eq','value':_0x16f199}),this;}[_0x2d9ed0(0x38e,0x408)](_0x305547,_0x321aaa){function _0x552fa9(_0x3a35c7,_0x12a9f4){return _0x1cc1(_0x3a35c7-0x2e,_0x12a9f4);}return this[_0x552fa9(0x22c,0x1a8)]['filters'][_0x552fa9(0x170,0x183)]({'column':_0x305547,'operator':_0x552fa9(0x1ab,0x1bc),'value':_0x321aaa}),this;}['gt'](_0xdc734d,_0x20c06d){this[_0x22ccf2(-0x14,-0x85)]['filters']['push']({'column':_0xdc734d,'operator':'gt','value':_0x20c06d});function _0x22ccf2(_0x10ba40,_0x392fba){return _0x1cc1(_0x10ba40- -0x212,_0x392fba);}return this;}[_0x2d9ed0(0x373,0x3b1)](_0x4d00ac,_0x3a4205){function _0x21e348(_0x4129d4,_0x3e4764){return _0x1cc1(_0x4129d4- -0x263,_0x3e4764);}return this['query'][_0x21e348(-0x119,-0x159)]['push']({'column':_0x4d00ac,'operator':_0x21e348(-0x101,-0xa8),'value':_0x3a4205}),this;}['lt'](_0x45c6c1,_0x78cb3b){return this['query']['filters']['push']({'column':_0x45c6c1,'operator':'lt','value':_0x78cb3b}),this;}[_0x2d9ed0(0x39d,0x389)](_0x5a71da,_0x46ffcb){function _0x1f1943(_0x1701dc,_0x5b7001){return _0x1cc1(_0x5b7001-0xeb,_0x1701dc);}return this['query']['filters']['push']({'column':_0x5a71da,'operator':_0x1f1943(0x231,0x277),'value':_0x46ffcb}),this;}[_0x2d9ed0(0x414,0x3e9)](_0x39826a,_0x29cbd6){return this['query']['filters']['push']({'column':_0x39826a,'operator':'like','value':_0x29cbd6}),this;}[_0x2d9ed0(0x436,0x3ca)](_0x3bc5e4,_0x14ff70){function _0x4c06dc(_0x1214aa,_0x3a0770){return _0x1cc1(_0x1214aa-0x3bf,_0x3a0770);}return this[_0x4c06dc(0x5bd,0x616)][_0x4c06dc(0x509,0x49f)][_0x4c06dc(0x501,0x568)]({'column':_0x3bc5e4,'operator':_0x4c06dc(0x5e4,0x56a),'value':_0x14ff70}),this;}['is'](_0x35b156,_0x21ff9e){function _0x3914e0(_0xb745d4,_0x15df31){return _0x1cc1(_0x15df31- -0x13b,_0xb745d4);}return this[_0x3914e0(0x66,0xc3)]['filters']['push']({'column':_0x35b156,'operator':'is','value':_0x21ff9e}),this;}['in'](_0x2707f8,_0x5e5263){function _0xaad54e(_0x1b6e57,_0x18b8c1){return _0x1cc1(_0x18b8c1-0xdc,_0x1b6e57);}return this[_0xaad54e(0x2a8,0x2da)]['filters'][_0xaad54e(0x216,0x21e)]({'column':_0x2707f8,'operator':'in','value':_0x5e5263}),this;}['contains'](_0x527673,_0x41ec5f){function _0x199097(_0x493b15,_0x399712){return _0x1cc1(_0x399712-0xf0,_0x493b15);}return this[_0x199097(0x27d,0x2ee)]['filters'][_0x199097(0x1c5,0x232)]({'column':_0x527673,'operator':'contains','value':_0x41ec5f}),this;}[_0x2d9ed0(0x432,0x422)](_0x56a2e3){Object['entries'](_0x56a2e3)[_0x5bf32b(0x1fd,0x273)](([_0x12af96,_0x455042])=>{this['eq'](_0x12af96,_0x455042);});function _0x5bf32b(_0x23d8f0,_0x4b2f25){return _0x1cc1(_0x4b2f25-0x10f,_0x23d8f0);}return this;}[_0x2d9ed0(0x41f,0x428)](_0x53b542,_0x10ce8d){function _0x4f610a(_0x2025b7,_0x53239d){return _0x1cc1(_0x2025b7- -0x4c,_0x53239d);}return!this['query'][_0x4f610a(0x1c2,0x1fe)]&&(this[_0x4f610a(0x1b2,0x21d)][_0x4f610a(0x1c2,0x1cf)]=[]),this[_0x4f610a(0x1b2,0x19f)]['order']['push']({'column':_0x53b542,'ascending':_0x10ce8d?.[_0x4f610a(0x186,0x16a)]!==![]}),this;}[_0x2d9ed0(0x349,0x3c9)](count){return this['query']['limit']=count,this;}['range'](from,_0x3766ec){function _0x2dea41(_0x1dfdcd,_0x1211e7){return _0x1cc1(_0x1dfdcd-0x1ad,_0x1211e7);}return this['query'][_0x2dea41(0x3d6,0x3d0)]={'from':from,'to':_0x3766ec},this;}async[_0x2d9ed0(0x39a,0x39e)](){function _0xf4767c(_0x1fff8b,_0x35aa86){return _0x1cc1(_0x35aa86- -0x1ef,_0x1fff8b);}if(this['query']['updateData'])return this[_0xf4767c(0x5d,-0x6)]('PATCH',_0xf4767c(0x3c,-0x34)+this['table'],{'data':this['query']['updateData'],'options':this['query']['updateOptions'],'filters':this[_0xf4767c(-0x63,0xf)][_0xf4767c(-0x99,-0xa5)]});else return this[_0xf4767c(-0xd,0xf)]['isDelete']?this[_0xf4767c(-0x5a,-0x6)]('DELETE',_0xf4767c(0x4c,-0x34)+this[_0xf4767c(-0x37,-0x46)]+'?operation=delete',{'options':this[_0xf4767c(-0x11,0xf)][_0xf4767c(-0xb8,-0x32)],'filters':this['query'][_0xf4767c(-0x8d,-0xa5)]}):this[_0xf4767c(0x7b,-0x6)]('GET',_0xf4767c(-0x13,-0x34)+this['table']+'?operation=select',{'select':this[_0xf4767c(0x3e,0xf)]['select'],'filters':this['query']['filters'],'order':this['query'][_0xf4767c(0x58,0x1f)],'limit':this['query']['limit'],'range':this['query'][_0xf4767c(0x21,0x3a)]});}async['single'](){this[_0x589e13(-0x83,-0x5e)](0x1);function _0x589e13(_0x5ed4f8,_0x13d447){return _0x1cc1(_0x5ed4f8- -0x1bb,_0x13d447);}const result=await this[_0x589e13(-0x32,-0xf)]();return{'data':result[_0x589e13(0x4c,0x97)]?.[0x0]||null,'error':result[_0x589e13(-0x2b,-0x17)]};}async[_0x2d9ed0(0x3fa,0x47c)](_0x4b6732,_0x48a9fe,_0x18ba05){function _0x1c0892(_0x3dd93f,_0x5cde45){return _0x1cc1(_0x5cde45-0x236,_0x3dd93f);}try{let response;const headers={};this[_0x1c0892(0x3cd,0x3e2)]&&(headers['x-workspace-id']=this['workspaceId']);if(_0x4b6732==='GET'){const _0x5578c0=_0x48a9fe['split']('?'),_0x5119ff=_0x5578c0[0x0],existingParams=new URLSearchParams(_0x5578c0[0x1]||'');if(_0x18ba05[_0x1c0892(0x398,0x37f)])existingParams[_0x1c0892(0x3d2,0x42b)](_0x1c0892(0x3ce,0x37f),_0x18ba05['select']);_0x18ba05['filters']?.['length']&&_0x18ba05['filters']['forEach'](filter=>{function _0x1762f8(_0x3bb321,_0x5d4d01){return _0x1cc1(_0x5d4d01- -0x34c,_0x3bb321);}existingParams[_0x1762f8(-0x13e,-0x157)](filter[_0x1762f8(-0x1c3,-0x184)],filter['operator']+'.'+filter['value']);});if(_0x18ba05['order']?.['length']){const orderStr=_0x18ba05[_0x1c0892(0x497,0x444)]['map'](_0x35946c=>''+_0x35946c['column']+(_0x35946c[_0x1c0892(0x3f1,0x408)]?'.asc':_0x1c0892(0x39e,0x405)))[_0x1c0892(0x417,0x38f)](',');existingParams[_0x1c0892(0x3e6,0x42b)]('order',orderStr);}if(_0x18ba05[_0x1c0892(0x309,0x36e)])existingParams['append'](_0x1c0892(0x325,0x36e),_0x18ba05['limit']['toString']());_0x18ba05[_0x1c0892(0x4e0,0x45f)]&&(existingParams['append']('offset',_0x18ba05['range'][_0x1c0892(0x435,0x450)]['toString']()),existingParams['append'](_0x1c0892(0x31b,0x36e),(_0x18ba05['range']['to']-_0x18ba05[_0x1c0892(0x439,0x45f)][_0x1c0892(0x3ce,0x450)]+0x1)[_0x1c0892(0x3a1,0x391)]())),response=await this['httpClient'][_0x1c0892(0x394,0x40e)](_0x5119ff+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x4b6732==='DELETE'){const _0x1c24cd=_0x48a9fe['split']('?'),_0x4c6e91=_0x1c24cd[0x0],existingParams=new URLSearchParams(_0x1c24cd[0x1]||'');!existingParams[_0x1c0892(0x3a0,0x3a8)](_0x1c0892(0x44e,0x40c))&&existingParams['append']('operation',_0x1c0892(0x387,0x400));_0x18ba05['filters']?.['length']&&_0x18ba05[_0x1c0892(0x388,0x380)]['forEach'](filter=>{function _0x25d054(_0x3a8d8b,_0x37c200){return _0x1cc1(_0x3a8d8b- -0x3a9,_0x37c200);}existingParams[_0x25d054(-0x1b4,-0x150)](filter[_0x25d054(-0x1e1,-0x256)],filter[_0x25d054(-0x25a,-0x229)]+'.'+filter[_0x25d054(-0x1eb,-0x202)]);});const deleteUrl=_0x4c6e91+'?'+existingParams[_0x1c0892(0x321,0x391)]();console[_0x1c0892(0x4b2,0x455)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console['log']('\uD83D\uDD27 DELETE headers:',headers),console[_0x1c0892(0x3eb,0x455)]('\uD83D\uDD27 DELETE filtros originais:',_0x18ba05[_0x1c0892(0x3c4,0x380)]),response=await this['httpClient']['delete'](deleteUrl,{'headers':headers});}else{if(_0x4b6732==='PATCH'){const _0x568901=_0x48a9fe[_0x1c0892(0x493,0x41b)]('?'),_0x4f6429=_0x568901[0x0],existingParams=new URLSearchParams(_0x568901[0x1]||'');!existingParams['has']('operation')&&existingParams[_0x1c0892(0x461,0x42b)]('operation','update');_0x18ba05['filters']?.[_0x1c0892(0x4be,0x470)]&&_0x18ba05[_0x1c0892(0x30d,0x380)][_0x1c0892(0x31d,0x39a)](filter=>{function _0x5daf2(_0x45e6fd,_0x35ed0b){return _0x1cc1(_0x45e6fd- -0x19c,_0x35ed0b);}existingParams['append'](filter[_0x5daf2(0x2c,-0x4d)],filter[_0x5daf2(-0x4d,-0xaf)]+'.'+filter['value']);});_0x18ba05[_0x1c0892(0x3bf,0x41c)]?.[_0x1c0892(0x427,0x44c)]&&(headers['Prefer']=_0x18ba05['options']['prefer']);const updateUrl=_0x4f6429+'?'+existingParams[_0x1c0892(0x343,0x391)]();response=await this['httpClient']['patch'](updateUrl,_0x18ba05[_0x1c0892(0x498,0x43d)],{'headers':headers});}else{let _0x429e45=_0x18ba05[_0x1c0892(0x484,0x43d)];!headers['Prefer']&&(headers[_0x1c0892(0x350,0x3cb)]='return=representation'),_0x18ba05[_0x1c0892(0x414,0x41c)]?.[_0x1c0892(0x3b7,0x3c0)]&&(headers[_0x1c0892(0x42e,0x3cb)]=_0x1c0892(0x43a,0x44f)),_0x18ba05['dataArray']&&(_0x429e45=_0x18ba05['dataArray']),response=await this[_0x1c0892(0x447,0x3d9)]['post'](_0x48a9fe,_0x429e45,{'headers':headers});}}}return{'data':response[_0x1c0892(0x462,0x43d)],'error':null,'count':response[_0x1c0892(0x42b,0x456)]?.[_0x1c0892(0x459,0x3f7)]?parseInt(response[_0x1c0892(0x483,0x456)][_0x1c0892(0x3f8,0x3f7)]):undefined};}catch(_0x1a2cfb){return{'data':null,'error':_0x1a2cfb instanceof EBaaSError?_0x1a2cfb:new EBaaSError(_0x1a2cfb instanceof Error?_0x1a2cfb['message']:_0x1c0892(0x418,0x448),0x0,_0x1a2cfb)};}}}class CustomDatabaseManager{constructor(_0x4ebea5,_0x3c1dbd){this['httpClient']=_0x4ebea5,this['workspaceId']=_0x3c1dbd;}async[_0x2d9ed0(0x38a,0x346)](){function _0x378e1e(_0x3cd74e,_0x1358ab){return _0x1cc1(_0x3cd74e- -0x242,_0x1358ab);}if(!this[_0x378e1e(-0x96,-0x15)])return{'hasCustomDatabase':![]};try{const response=await this['httpClient'][_0x378e1e(-0x6a,0x11)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response[_0x378e1e(-0xcf,-0xa8)]===0xc8&&response['data']?.[_0x378e1e(-0xc8,-0x11d)]){const config=response[_0x378e1e(-0x3b,-0xc0)]['config'],_0x2be8c9={'host':config['postgresHost'],'port':config['postgresPort'],'database':config[_0x378e1e(-0xf5,-0x10f)],'username':config['postgresUsername'],'password':'','schema':config['postgresSchema'],'sslEnabled':config['sslEnabled']};return this[_0x378e1e(-0xb4,-0xb8)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x2be8c9},this['detectedConfig'];}}catch(_0x2cfd03){if(_0x2cfd03?.['status']===0x194)return this['detectedConfig']={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x2cfd03);}return this['detectedConfig']={'hasCustomDatabase':![]},this[_0x378e1e(-0xb4,-0xeb)];}async[_0x2d9ed0(0x3d5,0x36d)](_0x42baff){function _0x4f9ad7(_0xfeb35,_0x13dc80){return _0x1cc1(_0xfeb35-0x128,_0x13dc80);}try{const response=await this['httpClient'][_0x4f9ad7(0x2c8,0x283)]('/admin/v1/workspace/custom-database/test-connection',_0x42baff,{'headers':this[_0x4f9ad7(0x2d4,0x2c5)]?{'X-Workspace-ID':this[_0x4f9ad7(0x2d4,0x2f2)]}:{}});return response[_0x4f9ad7(0x32f,0x3b3)];}catch(_0x3c6348){return{'success':![],'message':_0x3c6348?.['message']||_0x4f9ad7(0x360,0x370)};}}async[_0x2d9ed0(0x385,0x32b)](_0x2a385e){if(!this[_0x4393f0(0xdf,0x13e)])throw new Error('Workspace ID is required to configure custom database');const response=await this[_0x4393f0(0x1b1,0x135)][_0x4393f0(0x134,0x132)]('/admin/v1/workspace/custom-database',{'workspaceId':this[_0x4393f0(0x128,0x13e)],..._0x2a385e},{'headers':{'X-Workspace-ID':this['workspaceId']}}),config=response['data']['config'];function _0x4393f0(_0x5acd09,_0x254582){return _0x1cc1(_0x254582- -0x6e,_0x5acd09);}return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x2a385e},config;}async['removeCustomDatabase'](){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['detectedConfig']={'hasCustomDatabase':![]};}[_0x2d9ed0(0x3b8,0x3f4)](){return this['detectedConfig'];}[_0x2d9ed0(0x392,0x37a)](){return this['detectedConfig']?.['hasCustomDatabase']??![];}[_0x2d9ed0(0x420,0x449)](){function _0x473745(_0x348e84,_0x5a5767){return _0x1cc1(_0x5a5767- -0x1f2,_0x348e84);}return this['detectedConfig']?.[_0x473745(0xa,0x18)];}['setWorkspaceId'](_0xda1eb){function _0x122587(_0x1aa1aa,_0x213c16){return _0x1cc1(_0x213c16-0x1bd,_0x1aa1aa);}this['workspaceId']=_0xda1eb,this[_0x122587(0x2de,0x34b)]=undefined;}[_0x2d9ed0(0x3b9,0x335)](){function _0x62e7e3(_0x401528,_0x453b78){return _0x1cc1(_0x453b78-0xb4,_0x401528);}return this[_0x62e7e3(0x2a8,0x260)];}[_0x2d9ed0(0x38d,0x335)](){function _0x20fffa(_0x427792,_0x175990){return _0x1cc1(_0x427792- -0x25,_0x175990);}return{'workspaceId':this['workspaceId'],'hasConfig':this[_0x20fffa(0x15c,0x149)](),'configDetails':this[_0x20fffa(0x169,0x127)]?.['credentials']?{'host':this['detectedConfig'][_0x20fffa(0x1e5,0x232)][_0x20fffa(0x117,0xed)],'port':this['detectedConfig']['credentials'][_0x20fffa(0x12d,0x1a3)],'database':this['detectedConfig'][_0x20fffa(0x1e5,0x1a9)][_0x20fffa(0x1a7,0x13c)],'schema':this['detectedConfig']['credentials'][_0x20fffa(0x1a4,0x175)]||'public','sslEnabled':this['detectedConfig'][_0x20fffa(0x1e5,0x1dd)][_0x20fffa(0x20e,0x232)]||![]}:undefined};}}class DatabaseClient{constructor(_0x83f18f,_0x1103bd){this['httpClient']=_0x83f18f,this['customDatabaseManager']=new CustomDatabaseManager(_0x83f18f,_0x1103bd);}[_0x2d9ed0(0x42b,0x424)](_0x3dd9e0){function _0x54e761(_0x4aa470,_0xa0942d){return _0x1cc1(_0x4aa470-0x293,_0xa0942d);}return new QueryBuilder(this[_0x54e761(0x436,0x4b7)],_0x3dd9e0,this['currentSchema'],this[_0x54e761(0x494,0x4ff)][_0x54e761(0x43b,0x479)]());}['rpc'](_0x2fa189,_0x28e7d3){function _0x2cbdb5(_0x448463,_0x11081f){return _0x1cc1(_0x448463-0x356,_0x11081f);}return this[_0x2cbdb5(0x4f9,0x4e7)][_0x2cbdb5(0x4f6,0x4cf)]('/rpc/'+_0x2fa189,_0x28e7d3);}[_0x2d9ed0(0x3da,0x43b)](_0x38e738){function _0x176f48(_0x42d677,_0x2ff6f5){return _0x1cc1(_0x2ff6f5- -0xf2,_0x42d677);}const _0x314f80=new DatabaseClient(this[_0x176f48(0x48,0xb1)],this['customDatabaseManager'][_0x176f48(0xf5,0xb6)]());return _0x314f80[_0x176f48(0x44,0x7a)]=_0x38e738,_0x314f80['customDatabaseManager']=this['customDatabaseManager'],_0x314f80;}async['detectCustomDatabase'](){function _0xb4a1d7(_0x2bf064,_0x578e90){return _0x1cc1(_0x578e90-0x275,_0x2bf064);}return this[_0xb4a1d7(0x44a,0x476)][_0xb4a1d7(0x44b,0x3ee)]();}async[_0x2d9ed0(0x346,0x2da)](_0x52d75b){return this['customDatabaseManager']['testConnection'](_0x52d75b);}async[_0x2d9ed0(0x385,0x332)](_0x2d2d24){function _0x477438(_0x47bcac,_0x59ebf1){return _0x1cc1(_0x47bcac-0x105,_0x59ebf1);}return this[_0x477438(0x306,0x282)]['configureCustomDatabase'](_0x2d2d24);}async['removeCustomDatabase'](){function _0x34548c(_0x491872,_0x4c5cb7){return _0x1cc1(_0x491872- -0x3ad,_0x4c5cb7);}return this[_0x34548c(-0x1ac,-0x187)]['removeCustomDatabase']();}['isUsingCustomDatabase'](){function _0x1f125c(_0x189792,_0x5a4055){return _0x1cc1(_0x189792-0x318,_0x5a4055);}return this['customDatabaseManager'][_0x1f125c(0x499,0x4db)]();}['getCustomDatabaseStatus'](){return this['customDatabaseManager']['getStatus']();}[_0x2d9ed0(0x419,0x496)](_0x31205b){this['customDatabaseManager']['setWorkspaceId'](_0x31205b);}async[_0x2d9ed0(0x434,0x4a1)](){function _0x1b3238(_0x908072,_0xb1935c){return _0x1cc1(_0x908072-0x42,_0xb1935c);}try{await this[_0x1b3238(0x243,0x22c)]['detectCustomDatabase']();}catch(_0x5ec993){console[_0x1b3238(0x25d,0x295)]('Failed to initialize custom database detection:',_0x5ec993);}}}class StorageBucket{constructor(_0x4629a6,bucketId){this['httpClient']=_0x4629a6;function _0x48b0a2(_0x4c7ffb,_0x33b3a2){return _0x1cc1(_0x33b3a2-0xc6,_0x4c7ffb);}this[_0x48b0a2(0x289,0x203)]=bucketId;}async['upload'](_0x4e6008,_0x17686e,_0x3dc09a){function _0x3a77d5(_0x2aa567,_0x3561b8){return _0x1cc1(_0x3561b8- -0x1e3,_0x2aa567);}try{const _0x21959e=new FormData();if(_0x17686e instanceof File)_0x21959e['append']('file',_0x17686e);else{if(_0x17686e instanceof Blob)_0x21959e[_0x3a77d5(0x5a,0x12)](_0x3a77d5(-0xe3,-0x5f),_0x17686e,_0x4e6008);else{if(_0x17686e instanceof ArrayBuffer)_0x21959e['append']('file',new Blob([_0x17686e]),_0x4e6008);else typeof _0x17686e==='string'&&_0x21959e[_0x3a77d5(-0x43,0x12)]('file',new Blob([_0x17686e],{'type':_0x3a77d5(0xc6,0x4c)}),_0x4e6008);}}_0x21959e[_0x3a77d5(0x26,0x12)]('path',_0x4e6008);_0x3dc09a?.['cacheControl']&&_0x21959e['append']('cacheControl',_0x3dc09a[_0x3a77d5(-0xa4,-0x30)]);_0x3dc09a?.[_0x3a77d5(-0x9,0x59)]&&_0x21959e[_0x3a77d5(-0x35,0x12)](_0x3a77d5(-0x4,0x59),_0x3dc09a['contentType']);_0x3dc09a?.['metadata']&&_0x21959e[_0x3a77d5(-0xe,0x12)](_0x3a77d5(-0x1a,-0x7b),JSON['stringify'](_0x3dc09a[_0x3a77d5(-0x19,-0x7b)]));const _0x55fd25=_0x3a77d5(0xc9,0x56)+this['bucketId']+'/files'+(_0x3dc09a?.['upsert']?'?upsert=true':''),response=await this[_0x3a77d5(-0xc2,-0x40)]['post'](_0x55fd25,_0x21959e,{'headers':{'Content-Type':_0x3a77d5(-0x20,-0x23)}});return{'data':response['data'],'error':null};}catch(_0x758307){return{'data':null,'error':_0x758307 instanceof EBaaSError?_0x758307:new EBaaSError(_0x758307 instanceof Error?_0x758307['message']:'Failed\x20to\x20upload\x20file',0x0,_0x758307)};}}async[_0x2d9ed0(0x43d,0x435)](_0x5ec4bc,_0x17ff35){function _0x369f1e(_0x561f00,_0x42eeec){return _0x1cc1(_0x42eeec-0x2fa,_0x561f00);}try{const _0x181e05=new URLSearchParams();_0x17ff35?.[_0x369f1e(0x474,0x481)]&&Object[_0x369f1e(0x453,0x497)](_0x17ff35['transform'])[_0x369f1e(0x41c,0x45e)](([_0x13384d,_0x2c6fad])=>{function _0x51c9c3(_0x1839ae,_0x678587){return _0x1cc1(_0x678587- -0x3c3,_0x1839ae);}_0x2c6fad!==undefined&&_0x181e05[_0x51c9c3(-0x1a1,-0x1ce)](_0x13384d,String(_0x2c6fad));});const _0x5df430=_0x369f1e(0x519,0x533)+this[_0x369f1e(0x440,0x437)]+_0x369f1e(0x482,0x4ca)+_0x5ec4bc+(_0x181e05[_0x369f1e(0x42b,0x455)]()?'?'+_0x181e05[_0x369f1e(0x477,0x455)]():''),response=await this['httpClient']['get'](_0x5df430,{'responseType':'blob'});return{'data':response['data'],'error':null};}catch(_0x1ed4e0){return{'data':null,'error':_0x1ed4e0 instanceof EBaaSError?_0x1ed4e0:new EBaaSError(_0x1ed4e0 instanceof Error?_0x1ed4e0['message']:'Failed\x20to\x20download\x20file',0x0,_0x1ed4e0)};}}async['list'](_0x14618d,_0x2adb55){function _0x4bb1b3(_0x3f0685,_0x2fc584){return _0x1cc1(_0x2fc584-0xb3,_0x3f0685);}try{const _0x2d7327=new URLSearchParams();_0x14618d&&_0x2d7327['append'](_0x4bb1b3(0x1b4,0x239),_0x14618d);_0x2adb55?.['limit']&&_0x2d7327[_0x4bb1b3(0x29f,0x2a8)]('limit',String(_0x2adb55[_0x4bb1b3(0x23e,0x1eb)]));_0x2adb55?.[_0x4bb1b3(0x21e,0x258)]&&_0x2d7327[_0x4bb1b3(0x2a1,0x2a8)]('offset',String(_0x2adb55[_0x4bb1b3(0x24a,0x258)]));_0x2adb55?.[_0x4bb1b3(0x278,0x238)]&&_0x2d7327[_0x4bb1b3(0x32c,0x2a8)](_0x4bb1b3(0x1b2,0x238),JSON['stringify'](_0x2adb55[_0x4bb1b3(0x2b0,0x238)]));_0x2adb55?.['search']&&_0x2d7327[_0x4bb1b3(0x29e,0x2a8)]('search',_0x2adb55[_0x4bb1b3(0x26e,0x27a)]);const _0x1bd955=_0x4bb1b3(0x327,0x2ec)+this[_0x4bb1b3(0x199,0x1f0)]+'/files'+(_0x2d7327[_0x4bb1b3(0x23b,0x20e)]()?'?'+_0x2d7327['toString']():''),response=await this[_0x4bb1b3(0x229,0x256)][_0x4bb1b3(0x259,0x28b)](_0x1bd955);return{'data':response['data'],'error':null};}catch(_0x15f9cf){return{'data':null,'error':_0x15f9cf instanceof EBaaSError?_0x15f9cf:new EBaaSError(_0x15f9cf instanceof Error?_0x15f9cf[_0x4bb1b3(0x1df,0x1ea)]:'Failed\x20to\x20list\x20files',0x0,_0x15f9cf)};}}async['remove'](_0xb2201a){function _0x25c3d5(_0x5cc73c,_0x54f1aa){return _0x1cc1(_0x54f1aa-0x340,_0x5cc73c);}try{const response=await this['httpClient']['delete']('/storage/buckets/'+this[_0x25c3d5(0x462,0x47d)]+_0x25c3d5(0x55c,0x520),{'data':{'paths':_0xb2201a}});return{'data':response['data'],'error':null};}catch(_0x4698a1){return{'data':null,'error':_0x4698a1 instanceof EBaaSError?_0x4698a1:new EBaaSError(_0x4698a1 instanceof Error?_0x4698a1['message']:'Failed\x20to\x20remove\x20files',0x0,_0x4698a1)};}}async['move'](fromPath,_0x19cdfc){function _0x44dcd7(_0xde467,_0x460989){return _0x1cc1(_0x460989- -0x1fd,_0xde467);}try{const response=await this[_0x44dcd7(-0x47,-0x5a)][_0x44dcd7(0x1b,-0x5d)](_0x44dcd7(0x64,0x3c)+this['bucketId']+_0x44dcd7(-0x11b,-0x94),{'sourceKey':fromPath,'destinationKey':_0x19cdfc});return{'data':response['data'],'error':null};}catch(_0x3f83af){return{'data':null,'error':_0x3f83af instanceof EBaaSError?_0x3f83af:new EBaaSError(_0x3f83af instanceof Error?_0x3f83af[_0x44dcd7(-0x66,-0xc6)]:_0x44dcd7(-0xe4,-0x8c),0x0,_0x3f83af)};}}async['copy'](fromPath,_0x1f5ebe){function _0x1640c8(_0x218cca,_0x5d53c6){return _0x1cc1(_0x5d53c6-0x1dd,_0x218cca);}try{const response=await this['httpClient']['post']('/storage/buckets/'+this[_0x1640c8(0x2cb,0x31a)]+_0x1640c8(0x37c,0x395),{'sourceKey':fromPath,'destinationKey':_0x1f5ebe});return{'data':response[_0x1640c8(0x45e,0x3e4)],'error':null};}catch(_0x4c9093){return{'data':null,'error':_0x4c9093 instanceof EBaaSError?_0x4c9093:new EBaaSError(_0x4c9093 instanceof Error?_0x4c9093[_0x1640c8(0x383,0x314)]:'Failed\x20to\x20copy\x20file',0x0,_0x4c9093)};}}async[_0x2d9ed0(0x3e4,0x398)](_0x3eb838,_0x32a2ac,_0x4b8930){function _0x2dcfab(_0x43f931,_0x2f2d9b){return _0x1cc1(_0x2f2d9b-0x2ca,_0x43f931);}try{const response=await this['httpClient']['post']('/storage/buckets/'+this['bucketId']+_0x2dcfab(0x425,0x49a)+_0x3eb838+_0x2dcfab(0x42d,0x41d),{'expiresIn':_0x32a2ac,..._0x4b8930});return{'data':response[_0x2dcfab(0x529,0x4d1)],'error':null};}catch(_0x58d24c){return{'data':null,'error':_0x58d24c instanceof EBaaSError?_0x58d24c:new EBaaSError(_0x58d24c instanceof Error?_0x58d24c[_0x2dcfab(0x3d2,0x401)]:'Failed\x20to\x20create\x20signed\x20URL',0x0,_0x58d24c)};}}[_0x2d9ed0(0x359,0x354)](_0x56c1c1,_0x35e71d){const _0x5562e2=new URLSearchParams();function _0xfc79cf(_0x3d93c3,_0x5cb1d6){return _0x1cc1(_0x3d93c3- -0x30c,_0x5cb1d6);}_0x35e71d?.['transform']&&Object['entries'](_0x35e71d['transform'])[_0xfc79cf(-0x1a8,-0x140)](([_0xdc9650,_0x2e6ea4])=>{function _0x1358ff(_0x565c5d,_0x29881a){return _0x1cc1(_0x565c5d-0x111,_0x29881a);}_0x2e6ea4!==undefined&&_0x5562e2[_0x1358ff(0x306,0x298)](_0xdc9650,String(_0x2e6ea4));});const _0xc4026d=this[_0xfc79cf(-0x169,-0x12b)]['baseURL']||'',_0x28a624=_0xc4026d+_0xfc79cf(-0xd3,-0x60)+this['bucketId']+'/files/'+_0x56c1c1+(_0x5562e2['toString']()?'?'+_0x5562e2['toString']():'');return{'data':{'publicUrl':_0x28a624}};}async['getFileInfo'](_0x4cdf2f){function _0x2a199b(_0x38e755,_0x486253){return _0x1cc1(_0x486253- -0x1fe,_0x38e755);}try{const response=await this['httpClient'][_0x2a199b(0xd,-0x26)](_0x2a199b(0x2d,0x3b)+this['bucketId']+'/files/'+_0x4cdf2f+'/info');return{'data':response[_0x2a199b(0x80,0x9)],'error':null};}catch(_0x3a6ab9){return{'data':null,'error':_0x3a6ab9 instanceof EBaaSError?_0x3a6ab9:new EBaaSError(_0x3a6ab9 instanceof Error?_0x3a6ab9['message']:'Failed\x20to\x20get\x20file\x20info',0x0,_0x3a6ab9)};}}async[_0x2d9ed0(0x367,0x311)](_0xb15f88,metadata){function _0x229dfa(_0x14b1c3,_0x2d1c8c){return _0x1cc1(_0x2d1c8c-0x37a,_0x14b1c3);}try{const response=await this[_0x229dfa(0x4a7,0x51d)]['put'](_0x229dfa(0x547,0x5b3)+this['bucketId']+'/files/'+_0xb15f88+'/metadata',{'metadata':metadata});return{'data':response['data'],'error':null};}catch(_0x12825e){return{'data':null,'error':_0x12825e instanceof EBaaSError?_0x12825e:new EBaaSError(_0x12825e instanceof Error?_0x12825e[_0x229dfa(0x502,0x4b1)]:_0x229dfa(0x5fb,0x583),0x0,_0x12825e)};}}}class StorageClient{constructor(_0xed8117){function _0x10c05c(_0x16f829,_0xa2bdde){return _0x1cc1(_0x16f829- -0x1d,_0xa2bdde);}this[_0x10c05c(0x186,0x177)]=_0xed8117;}[_0x2d9ed0(0x42b,0x3ff)](bucketId){return new StorageBucket(this['httpClient'],bucketId);}async['createBucket'](_0x49e764,_0x5e5188){function _0x5ead8b(_0x3f5995,_0x4359cf){return _0x1cc1(_0x3f5995- -0x1d3,_0x4359cf);}try{const response=await this[_0x5ead8b(-0x30,-0x9c)]['post']('/storage/buckets',{'id':_0x49e764,..._0x5e5188});return{'data':response[_0x5ead8b(0x34,-0x3f)],'error':null};}catch(_0x3a8cb2){return{'data':null,'error':_0x3a8cb2 instanceof EBaaSError?_0x3a8cb2:new EBaaSError(_0x3a8cb2 instanceof Error?_0x3a8cb2['message']:'Failed\x20to\x20create\x20bucket',0x0,_0x3a8cb2)};}}async[_0x2d9ed0(0x342,0x30d)](_0x483b86){function _0x8c09ed(_0x1f55b9,_0x4ac1df){return _0x1cc1(_0x4ac1df- -0x3a,_0x1f55b9);}try{const response=await this['httpClient']['get']('/storage/buckets/'+_0x483b86);return{'data':response[_0x8c09ed(0x1f0,0x1cd)],'error':null};}catch(_0x570b69){return{'data':null,'error':_0x570b69 instanceof EBaaSError?_0x570b69:new EBaaSError(_0x570b69 instanceof Error?_0x570b69['message']:'Failed\x20to\x20get\x20bucket',0x0,_0x570b69)};}}async['listBuckets'](){function _0x7efb1(_0x1e27a2,_0x1b1f20){return _0x1cc1(_0x1e27a2- -0x26e,_0x1b1f20);}try{const response=await this['httpClient']['get'](_0x7efb1(-0x93,-0x20));return{'data':response['data'],'error':null};}catch(_0x430c35){return{'data':null,'error':_0x430c35 instanceof EBaaSError?_0x430c35:new EBaaSError(_0x430c35 instanceof Error?_0x430c35[_0x7efb1(-0x137,-0x1a1)]:'Failed\x20to\x20list\x20buckets',0x0,_0x430c35)};}}async['updateBucket'](_0x2eebe5,_0x5b9353){function _0x369b95(_0x1a3efd,_0xdb4305){return _0x1cc1(_0xdb4305-0x12,_0x1a3efd);}try{const response=await this['httpClient'][_0x369b95(0x228,0x230)]('/storage/buckets/'+_0x2eebe5,_0x5b9353);return{'data':response['data'],'error':null};}catch(_0x328203){return{'data':null,'error':_0x328203 instanceof EBaaSError?_0x328203:new EBaaSError(_0x328203 instanceof Error?_0x328203['message']:'Failed\x20to\x20update\x20bucket',0x0,_0x328203)};}}async['deleteBucket'](_0x31ab27){function _0x4b084f(_0x5c1b96,_0x178dab){return _0x1cc1(_0x5c1b96- -0x132,_0x178dab);}try{const response=await this['httpClient'][_0x4b084f(0x98,0xeb)]('/storage/buckets/'+_0x31ab27);return{'data':response[_0x4b084f(0xd5,0x56)],'error':null};}catch(_0x8716ed){return{'data':null,'error':_0x8716ed instanceof EBaaSError?_0x8716ed:new EBaaSError(_0x8716ed instanceof Error?_0x8716ed[_0x4b084f(0x5,0x67)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x8716ed)};}}async[_0x2d9ed0(0x428,0x490)](){function _0x30e510(_0x3c4e1c,_0xb78e72){return _0x1cc1(_0xb78e72-0x2c7,_0x3c4e1c);}try{const response=await this['httpClient'][_0x30e510(0x4bc,0x49f)](_0x30e510(0x46a,0x468));return{'data':response[_0x30e510(0x457,0x4ce)],'error':null};}catch(_0x4f96c5){return{'data':null,'error':_0x4f96c5 instanceof EBaaSError?_0x4f96c5:new EBaaSError(_0x4f96c5 instanceof Error?_0x4f96c5[_0x30e510(0x444,0x3fe)]:'Failed\x20to\x20get\x20storage\x20usage',0x0,_0x4f96c5)};}}}class EventManager{constructor(){this['events']=new Map(),this['maxListeners']=0xa;}['on'](_0x51374f,_0x4d8ccb){function _0x42724c(_0x22a8f7,_0x2702f0){return _0x1cc1(_0x22a8f7- -0x373,_0x2702f0);}!this[_0x42724c(-0x1c4,-0x207)]['has'](_0x51374f)&&this[_0x42724c(-0x1c4,-0x223)]['set'](_0x51374f,new Set()),this['events']['get'](_0x51374f)['add'](_0x4d8ccb);}[_0x2d9ed0(0x389,0x339)](_0x2e98a4,_0x6e7117){if(!this[_0x2730b4(0x515,0x529)]['has'](_0x2e98a4))return;const _0xe9d992=this['events']['get'](_0x2e98a4);_0x6e7117?_0xe9d992[_0x2730b4(0x5aa,0x544)](_0x6e7117):_0xe9d992['clear']();function _0x2730b4(_0x3bdf28,_0x3dc010){return _0x1cc1(_0x3dc010-0x37a,_0x3bdf28);}_0xe9d992[_0x2730b4(0x507,0x53d)]===0x0&&this['events'][_0x2730b4(0x50f,0x544)](_0x2e98a4);}[_0x2d9ed0(0x3bb,0x420)](_0x43e751,..._0x530c23){if(!this[_0x2a61e7(-0x55,0x29)][_0x2a61e7(-0x22,-0x14)](_0x43e751))return![];function _0x2a61e7(_0x2b75e8,_0xe85d38){return _0x1cc1(_0xe85d38- -0x186,_0x2b75e8);}const _0x48edfe=this['events']['get'](_0x43e751);for(const _0xe1dfe1 of _0x48edfe){try{_0xe1dfe1(..._0x530c23);}catch(_0x141f27){console['error']('Error\x20in\x20event\x20listener\x20for\x20\x22'+_0x43e751+'\x22:',_0x141f27);}}return _0x48edfe[_0x2a61e7(-0x16,0x3d)]>0x0;}['removeAllListeners'](_0x5bf537){_0x5bf537?this['events']['delete'](_0x5bf537):this['events']['clear']();}[_0x2d9ed0(0x372,0x34d)](_0x563465){function _0x58a86d(_0x1a0412,_0x51b6e2){return _0x1cc1(_0x51b6e2- -0x17a,_0x1a0412);}return this[_0x58a86d(0x35,0x35)]['get'](_0x563465)?.['size']??0x0;}[_0x2d9ed0(0x386,0x3e9)](){function _0x45f1cb(_0x876823,_0x176aa2){return _0x1cc1(_0x176aa2-0xe5,_0x876823);}return Array['from'](this[_0x45f1cb(0x304,0x294)][_0x45f1cb(0x388,0x30b)]());}['listeners'](_0x5a957c){function _0x44fd7e(_0x24ca84,_0x4e9872){return _0x1cc1(_0x4e9872-0x1a6,_0x24ca84);}return Array['from'](this['events'][_0x44fd7e(0x3d4,0x37e)](_0x5a957c)??[]);}[_0x2d9ed0(0x3af,0x434)](_0x3b38dd,_0x2b14d2){this['on'](_0x3b38dd,_0x2b14d2);}['removeListener'](_0x341db7,_0x163f67){this['off'](_0x341db7,_0x163f67);}[_0x2d9ed0(0x433,0x41e)](_0x520e79,_0x43314a){const _0x4d404b=(..._0x463c57)=>{function _0x1cf8eb(_0x207b64,_0x228e73){return _0x1cc1(_0x228e73-0x331,_0x207b64);}this[_0x1cf8eb(0x4cc,0x4a9)](_0x520e79,_0x4d404b),_0x43314a(..._0x463c57);};this['on'](_0x520e79,_0x4d404b);}[_0x2d9ed0(0x345,0x2ce)](_0x23c2ab,_0x3cd260){this['on'](_0x23c2ab,_0x3cd260);}[_0x2d9ed0(0x448,0x4b2)](_0x11ecb3,_0x1972b1){const _0x2633fc=(..._0x44d09e)=>{this['off'](_0x11ecb3,_0x2633fc),_0x1972b1(..._0x44d09e);};this['on'](_0x11ecb3,_0x2633fc);}[_0x2d9ed0(0x38c,0x3f9)](_0x172a56){this[_0x4a811a(-0x1cd,-0x1b3)]=_0x172a56;function _0x4a811a(_0x4988aa,_0x105ee1){return _0x1cc1(_0x4988aa- -0x334,_0x105ee1);}return this;}[_0x2d9ed0(0x3a9,0x37c)](){function _0x523095(_0x5b5323,_0x20775c){return _0x1cc1(_0x20775c- -0x310,_0x5b5323);}return this[_0x523095(-0x125,-0x1a9)];}[_0x2d9ed0(0x405,0x3d6)](_0x23bc62){return this['listeners'](_0x23bc62);}}class RealtimeChannel extends EventManager{constructor(_0x143bdf,_0x114886){super(),this['joinedOnce']=![];function _0x3c4a7e(_0x1a24db,_0x4542e1){return _0x1cc1(_0x4542e1-0x322,_0x1a24db);}this['state']='closed',this['subscriptions']=new Map(),this[_0x3c4a7e(0x51e,0x51a)]=_0x143bdf,this[_0x3c4a7e(0x4f0,0x4ed)]=_0x114886;}['subscribe'](_0x283e00){function _0x28e821(_0x5bcaf7,_0x88018d){return _0x1cc1(_0x88018d- -0x6f,_0x5bcaf7);}return!this['joinedOnce']&&(this[_0x28e821(0x1e6,0x1a9)]=!![],this['_join']()),_0x283e00&&this['on'](_0x28e821(0x81,0x104),_0x283e00),this;}[_0x2d9ed0(0x417,0x498)](filter,_0x57f3f2){const _0x52ae6e=_0x393d02(-0x179,-0x110)+JSON['stringify'](filter);this['on'](_0x52ae6e,_0x57f3f2);const _0x9e757c={'unsubscribe':()=>{function _0x316df5(_0x626566,_0x591a23){return _0x1cc1(_0x626566-0x3d3,_0x591a23);}this['off'](_0x52ae6e,_0x57f3f2),this[_0x316df5(0x50d,0x582)][_0x316df5(0x59d,0x563)](_0x52ae6e);}};this['subscriptions'][_0x393d02(-0x11d,-0x99)](_0x52ae6e,_0x9e757c);this['socket']?.['connected']&&this[_0x393d02(-0x17,-0x91)]===_0x393d02(-0xcb,-0x114)&&this[_0x393d02(-0x7d,-0xa5)]['emit'](_0x393d02(-0x86,-0x97),{'topic':this[_0x393d02(-0x8b,-0x78)],'filter':filter,'ref':this['makeRef']()});function _0x393d02(_0x5cac1e,_0x5632e9){return _0x1cc1(_0x5632e9- -0x270,_0x5cac1e);}return _0x9e757c;}['onBroadcast'](filter,_0x308cfa){const _0x116083='broadcast:'+JSON[_0x423b85(0xe2,0xe0)](filter);this['on'](_0x116083,_0x308cfa);const _0x2d1204={'unsubscribe':()=>{this[_0x423bf6(-0x45,0x2)](_0x116083,_0x308cfa);function _0x423bf6(_0x5add93,_0x4dc743){return _0x1cc1(_0x4dc743- -0x176,_0x5add93);}this['subscriptions'][_0x423bf6(0x49,0x54)](_0x116083);}};this[_0x423b85(0xb7,0xd9)]['set'](_0x116083,_0x2d1204);function _0x423b85(_0x5d7cf3,_0x5598b4){return _0x1cc1(_0x5598b4- -0x61,_0x5d7cf3);}return _0x2d1204;}[_0x2d9ed0(0x41e,0x47e)](filter,_0xe8ae){const _0x2b8f8f=_0x559261(0x487,0x43c)+JSON['stringify'](filter);this['on'](_0x2b8f8f,_0xe8ae);const _0x4ac224={'unsubscribe':()=>{this[_0x1dc28f(0x3a8,0x33d)](_0x2b8f8f,_0xe8ae);function _0x1dc28f(_0x7b5bb5,_0x3730d5){return _0x1cc1(_0x3730d5-0x1c5,_0x7b5bb5);}this[_0x1dc28f(0x35b,0x2ff)][_0x1dc28f(0x37b,0x38f)](_0x2b8f8f);}};function _0x559261(_0x2bcb70,_0x2cf06c){return _0x1cc1(_0x2cf06c-0x260,_0x2bcb70);}return this[_0x559261(0x390,0x39a)][_0x559261(0x3f0,0x437)](_0x2b8f8f,_0x4ac224),_0x4ac224;}['send'](_0x466f98){return new Promise(_0x26117b=>{function _0x4de238(_0x56d9a9,_0x9c254a){return _0x1cc1(_0x9c254a-0x179,_0x56d9a9);}this['socket']?.['connected']&&this[_0x4de238(0x374,0x358)]==='joined'?(this[_0x4de238(0x398,0x344)][_0x4de238(0x305,0x323)]('broadcast',{'topic':this[_0x4de238(0x2fc,0x371)],'event':_0x466f98[_0x4de238(0x340,0x3b6)],'payload':_0x466f98,'ref':this[_0x4de238(0x327,0x367)]()}),_0x26117b('ok')):_0x26117b(_0x4de238(0x2b8,0x309));});}['track'](_0x19c7b8){return new Promise(_0xeade3d=>{function _0x41c99e(_0x35744a,_0x1de3fd){return _0x1cc1(_0x1de3fd- -0xc2,_0x35744a);}this[_0x41c99e(0x138,0x109)]?.[_0x41c99e(0x8c,0x6e)]&&this['state']===_0x41c99e(0x59,0x9a)?(this['socket']['emit']('presence',{'topic':this[_0x41c99e(0x109,0x136)],'event':_0x41c99e(0xbc,0xcd),'payload':_0x19c7b8,'ref':this['makeRef']()}),_0xeade3d('ok')):_0xeade3d('error');});}['untrack'](){return new Promise(_0x50d1b0=>{function _0x59b3a1(_0x7fa5a6,_0x3c8ca6){return _0x1cc1(_0x3c8ca6-0x254,_0x7fa5a6);}this['socket']?.['connected']&&this[_0x59b3a1(0x3c4,0x433)]==='joined'?(this[_0x59b3a1(0x451,0x41f)][_0x59b3a1(0x416,0x3fe)]('presence',{'topic':this[_0x59b3a1(0x3cd,0x44c)],'event':'untrack','ref':this['makeRef']()}),_0x50d1b0('ok')):_0x50d1b0(_0x59b3a1(0x462,0x3e4));});}['unsubscribe'](){return new Promise(_0x2d4bd8=>{this['state']=_0x1c4de8(-0x6b,-0xeb),this[_0x1c4de8(-0xde,-0x88)][_0x1c4de8(-0xb4,-0x8f)](_0x38c384=>{_0x38c384['unsubscribe']();}),this['subscriptions'][_0x1c4de8(-0xe2,-0x74)]();function _0x1c4de8(_0x114b24,_0xc6f351){return _0x1cc1(_0x114b24- -0x218,_0xc6f351);}this[_0x1c4de8(-0x4d,-0x47)]?.['connected']&&this[_0x1c4de8(-0x4d,-0x7c)]['emit'](_0x1c4de8(-0x9a,-0x6a),{'topic':this[_0x1c4de8(-0x20,-0x2d)],'ref':this['makeRef']()}),this['state']=_0x1c4de8(0x15,0x7e),this['removeAllListeners'](),_0x2d4bd8('ok');});}['_join'](){if(this[_0x101455(-0x16,-0x46)]==='leaving')return;function _0x101455(_0x25aacd,_0x394db5){return _0x1cc1(_0x25aacd- -0x1f5,_0x394db5);}this['state']=_0x101455(-0x6d,-0x36),this[_0x101455(-0x2a,0x59)]?.[_0x101455(-0xc5,-0x82)]&&(this[_0x101455(-0x2a,0x37)][_0x101455(-0x4b,-0x4b)]('join',{'topic':this[_0x101455(0x3,-0x7e)],'ref':this[_0x101455(-0x7,-0x57)]()}),setTimeout(()=>{function _0x1a9e9a(_0x3f1739,_0x5bc083){return _0x1cc1(_0x3f1739- -0x18c,_0x5bc083);}this['state']==='joining'&&(this['state']='joined',this[_0x1a9e9a(0x1e,-0x4f)](_0x1a9e9a(-0x19,0x5c),_0x1a9e9a(-0x5a,-0x4f)));},0x64));}['_rejoin'](){function _0x1ff155(_0x21b37f,_0x3f75c8){return _0x1cc1(_0x21b37f-0x278,_0x3f75c8);}this['joinedOnce']&&(this['_join'](),this['subscriptions'][_0x1ff155(0x3dc,0x3a0)]((_0x2d96a2,_0x39b6d5)=>{function _0xd84eb7(_0x3897bc,_0x421a18){return _0x1cc1(_0x421a18- -0x352,_0x3897bc);}if(_0x39b6d5['startsWith'](_0xd84eb7(-0x1e8,-0x1f2))){const filter=JSON[_0xd84eb7(-0x24c,-0x1db)](_0x39b6d5[_0xd84eb7(-0x1f6,-0x18d)]('postgres_changes:',''));this[_0xd84eb7(-0x1b9,-0x187)]?.[_0xd84eb7(-0x18a,-0x1a8)]('subscribe_postgres_changes',{'topic':this['topic'],'filter':filter,'ref':this['makeRef']()});}}));}[_0x2d9ed0(0x3ab,0x342)](_0x50357e,_0x39e1aa){function _0x243fdf(_0x455a54,_0x7c4639){return _0x1cc1(_0x7c4639- -0x55,_0x455a54);}if(_0x50357e==='postgres_changes'){const _0x2ed6bb=_0x243fdf(0xc0,0x10b)+JSON['stringify'](_0x39e1aa['filter']||{});this[_0x243fdf(0x1c1,0x155)](_0x2ed6bb,_0x39e1aa);}else{if(_0x50357e===_0x243fdf(0x13d,0xee)){const _0x5264b3='broadcast:'+JSON['stringify']({'event':_0x39e1aa['event']});this[_0x243fdf(0x10d,0x155)](_0x5264b3,_0x39e1aa);}else{if(_0x50357e==='presence'){const _0x2786b8=_0x243fdf(0x1f1,0x187)+JSON['stringify']({'event':_0x39e1aa[_0x243fdf(0x230,0x1e8)]});this['emit'](_0x2786b8,_0x39e1aa);}}}this['emit'](_0x50357e,_0x39e1aa);}[_0x2d9ed0(0x447,0x426)](_0xc08a70){this['state']=_0xc08a70;let status;switch(_0xc08a70){case _0x4108b2(0x2bf,0x2b1):status='SUBSCRIBED';break;case _0x4108b2(0x2d6,0x2f1):status=_0x4108b2(0x340,0x380);break;case _0x4108b2(0x3df,0x382):status='CLOSED';break;default:return;}function _0x4108b2(_0x4090f6,_0x947458){return _0x1cc1(_0x947458-0x155,_0x4090f6);}this['emit']('status',status);}[_0x2d9ed0(0x3ff,0x3e5)](){return Math['random']()['toString'](0x24)['substring'](0x2,0xf);}['getState'](){return this['state'];}}function getEnvironment(){function _0x10a2b6(_0x452a7b,_0x1dadf4){return _0x1cc1(_0x452a7b-0x233,_0x1dadf4);}if(typeof navigator!==_0x10a2b6(0x3b5,0x337)&&navigator['product']===_0x10a2b6(0x378,0x388))return'react-native';if(typeof window!=='undefined'&&typeof document!=='undefined')return'browser';if(typeof global!=='undefined'&&typeof process!==_0x10a2b6(0x3b5,0x42a)&&process[_0x10a2b6(0x424,0x433)]?.['node'])return _0x10a2b6(0x414,0x49a);return _0x10a2b6(0x3a0,0x3c9);}function isSocketIOAvailable(){function _0x3408ad(_0x1e9417,_0x7d9d45){return _0x1cc1(_0x7d9d45-0x362,_0x1e9417);}try{const _0x13f0a1=getEnvironment();switch(_0x13f0a1){case _0x3408ad(0x501,0x543):return typeof require!==_0x3408ad(0x4a2,0x4e4)&&require['resolve']&&!!require[_0x3408ad(0x5a9,0x562)](_0x3408ad(0x58f,0x55c));case'browser':if(typeof globalThis!=='undefined'&&'io'in globalThis)return!![];return typeof require!==_0x3408ad(0x4f4,0x4e4)&&require['resolve']&&!!require[_0x3408ad(0x4e7,0x562)]('socket.io-client');case _0x3408ad(0x5d4,0x59d):try{return typeof require!==_0x3408ad(0x4bc,0x4e4)&&!!require('socket.io-client');}catch{return![];}default:return![];}}catch{return![];}}function getSocketIO(){function _0x430eb2(_0x3b2c2e,_0x136890){return _0x1cc1(_0x136890-0xe6,_0x3b2c2e);}try{if(typeof require!=='undefined')return require('socket.io-client');if(typeof globalThis!==_0x430eb2(0x222,0x268)&&'io'in globalThis)return{'io':globalThis['io']};throw new Error(_0x430eb2(0x2b4,0x2d5));}catch(_0x33cd91){throw new Error('Socket.io-client\x20não\x20está\x20disponível\x20neste\x20ambiente.\x20Para\x20usar\x20funcionalidades\x20de\x20realtime,\x20instale:\x20npm\x20install\x20socket.io-client');}}class WebSocketAdapter{constructor(){function _0x140209(_0x3026b6,_0x496488){return _0x1cc1(_0x496488-0x314,_0x3026b6);}this[_0x140209(0x47d,0x4df)]=null;}async[_0x2d9ed0(0x438,0x49b)](_0x451c1f,_0x1b095e){if(!isSocketIOAvailable())throw new Error('Socket.io-client não está disponível. Para usar funcionalidades de realtime, instale: npm install socket.io-client');const {io:_0x15110f}=getSocketIO();return new Promise((_0x22f9ad,_0x1b5edc)=>{this['socket']=_0x15110f(_0x451c1f,_0x1b095e),this['socket']['on']('connect',()=>_0x22f9ad()),this['socket']['on']('connect_error',_0x34c2b2=>_0x1b5edc(_0x34c2b2));});}['disconnect'](){function _0x29fa39(_0x389cdb,_0x42151e){return _0x1cc1(_0x389cdb-0x3c8,_0x42151e);}this[_0x29fa39(0x593,0x60e)]&&(this['socket'][_0x29fa39(0x536,0x520)](),this[_0x29fa39(0x593,0x5d8)]=null);}[_0x2d9ed0(0x3bb,0x37d)](_0x6ececb,data){function _0x3eaad3(_0x23529c,_0x3634f6){return _0x1cc1(_0x23529c-0x1a6,_0x3634f6);}this[_0x3eaad3(0x371,0x325)]?.[_0x3eaad3(0x350,0x2d9)](_0x6ececb,data);}['on'](_0x5d41dd,_0x4777cf){this['socket']?.['on'](_0x5d41dd,_0x4777cf);}['off'](_0x528e20,_0x263932){function _0x1caa65(_0x2bb537,_0x194ae8){return _0x1cc1(_0x194ae8-0xed,_0x2bb537);}_0x263932?this[_0x1caa65(0x291,0x2b8)]?.['off'](_0x528e20,_0x263932):this['socket']?.['off'](_0x528e20);}get[_0x2d9ed0(0x341,0x2d5)](){function _0x5f7694(_0x497602,_0x1b1214){return _0x1cc1(_0x497602-0x10b,_0x1b1214);}return this[_0x5f7694(0x2d6,0x333)]?.['connected']??![];}}function _0x5014(){const _0x5d774e=['yNjVD3nLCG','zgLZy29UBMvJDa','x2DLDfnVy2TLDa','DxnLCG','rMfPBgvKihrVig1VDMuGzMLSzq','AgfZ','C3rHDhvZ','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','zxzLBNroyw1LCW','C3rVCMfNzq','CgfYC2u','B2zM','zgv0zwn0q3vZDg9Trgf0ywjHC2u','y29UzMLN','C2v0twf4tgLZDgvUzxjZ','z2v0u3rHDhvZ','BMvX','BgvHDMu','CMvMCMvZAfnLC3nPB24','y3jLyxrL','AgfZq3vZDg9Trgf0ywjHC2u','Dw5KzwzPBMvK','ms4XlJG','zMLSzq','C29YDej5','ChjLzML4','DhjHBNnMB3jT','AM9PBMLUzW','zxHLy3v0zq','DxbZzxj0','C2vZC2LVBG','BhrL','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbSB2DZ','zgv0zwn0zwrdB25MAwC','DhjHy2S','zxjYB3i','nZe1mZK4sg9NCwLb','rgf0ywjHC2vdBgLLBNq','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','y29UBMvJDf9LCNjVCG','uhjLzMvY','ndC3mtLKtK1uqLi','DxbKyxrLrgf0yq','z2v0twf4tgLZDgvUzxjZ','yxv0Aa','x3rYAwDNzxi','uMvHBhrPBwvdBgLLBNq','zxjYB3jLza','zw50CMLLCW','ywrKtgLZDgvUzxi','Cg9ZDgDYzxnFy2HHBMDLCW','Cg9ZDa','l3n0B3jHz2uVDxnHz2u','zw50CNLWB2LUDa','Ahr0CenSAwvUDa','yM9KEq','B2zMC2v0','icHtDgf0Dxm6ia','z2v0rgv0zwn0zwrdB25MAwC','z2v0v29YA3nWywnLswq','DgfIBgu','zw1PDa','igf0DgvTChrZoIa','D29YA3nWywnLswq','BgvHDMLUzW','q3vZDg9Trgf0ywjHC2vnyw5Hz2vY','zxzLBNrZ','Aw5Zzxj0','ywnJzxnZx3rVA2vU','l2vUDG','y2fJAgvdB250CM9S','DxbKyxrLrw52','mtuYndKYodLJDKDosvi','zwjHyxmUyxv0Ac5ZzxnZAw9U','B25dB25Uzwn0Aw9Uu3rHDgvdAgfUz2u','l2zPBgvZl2nVChK','mtbuuM52zgy','DxbKyxrL','l3nKAY92ms8','u3rVCMfNzuj1y2TLDa','zgvSzxrLt3b0Aw9UCW','DMfSDwu','DxnL','BxvSDgLWyxj0l2zVCM0Tzgf0yq','Ec10B3rHBc1JB3vUDa','uMvHBhrPBwvdAgfUBMvS','C2L6zq','DgvZDenVBM5Ly3rPB24','CMvWBgfJzq','y2HHBM5LBhm','C2vHCMnO','y29SDw1U','C2nOzw1H','zgvSzxrL','C29JA2v0','zgf0ywjHC2u','AgvHCNrIzwf0','z2v0twv0CMLJCW','lMrLC2m','l2zPBgvZlW','C2v0DxbizwfYDgjLyxq','yxnJzw5KAw5N','y3jLyxrLu2LNBMvKvxjS','C3rYAw5N','DMvYAwz5','B3bLCMf0Aw9U','C2v0','z2v0','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','yxbPs2v5','l3n0B3jHz2uVyNvJA2v0CW','ChjLC2vUy2u6','qxv0AgvUDgLJyxrPB24GzMfPBgvK','qMvHCMvYia','C3rHDgu','l2zPBgvZ','BM9Kzq','CMvTB3zLqwXSq2HHBM5LBhm','zgLZy29UBMvJDgvK','CMvZzxrqyxnZD29Yza','C3bSAxq','B3b0Aw9UCW','l2f1DgGVDJeVDxnLCG','C2v0sxrLBq','zxHLy3v0zvf1zxj5','y2XPzw50','rNvUy3rPB25Zq2XPzw50','odyWndu0mfzoANHfuG','mJrcz2v1v1i','BwfRzvjLzG','C29JA2v0lMLVlwnSAwvUDcbUB3qGyxzHAwXHyMXL','C29JA2v0qwrHChrLCG','DMvYC2LVBNm','AgvHCNrIzwf0sw50zxj2ywW','yMfZzvvsta','CMf3tgLZDgvUzxjZ','yxbWzw5K','CMvJB25Uzwn0qxr0zw1WDhm','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','Dg9WAwm','CNbJ','C29JA2v0lMLVlwnSAwvUDa','Dw5ZDwjZy3jPyMu','AgfUzgXLrxjYB3i','mJa4vefnAKHc','CxvLCNK','rNvUy3rPB24GAw52B2nHDgLVBIbMywLSzwq','CMvZB2X2zq','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','CMvQzwn0','BgLRzq','l2z1BMn0Aw9UCY92mq','C2LNBKLU','B25qB3n0z3jLC0nOyw5Nzxm','zgf0yq','C2v0v29YA3nWywnLswq','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','y3jLzgvUDgLHBhm','CMvZCg9UC2u','C2v0u2vZC2LVBG','B25qCMvZzw5Jzq','B3jKzxi','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','D2vIC29JA2v0','rMfPBgvKihrVihvWzgf0zsbMDw5JDgLVBIbLBNzPCM9UBwvUDa','rgf0ywjHC2uGB3bLCMf0Aw9UigzHAwXLza','y29Kzq','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbTzxrYAwnZ','DxjS','ChjLzMvY','z2v0vxnHz2u','AM9PBMvKt25Jzq','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','zNjVBq','D2fYBG','C2LNBK91Da','Aw52B2TL','Chv0','Bg9N','AgvHzgvYCW','Bwf0y2G','B25Jzq','Aw5PDgLHBgL6zq','Aw50zxjJzxb0B3jZ','AwXPA2u','A2v5CW','y29UBMvJDa','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','CMfUz2u','u3rVCMfNzunSAwvUDa','q0HbtK5ftf9fuLjpuG','zg93BMXVywq','y2XVC2vK','ntuXnZe3nMPzEujTCW','Dgv4Dc9WBgfPBG','zw52','rMfPBgvKihrVigrLBgv0zsbMDw5JDgLVBG','y29TBw9U','C3nSrw5HyMXLza','x2PVAw4','y2XLyxjtzxnZAw9U','x3nLDfn0yxrL','ChjLCgvUze9Uy2vmAxn0zw5LCG','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','l3n0B3jHz2uVyNvJA2v0CY8','BgvUz3rO','CMvHy3qTBMf0AxzL','y29UDgvUDfr5Cgu','zxzLBNq','nuPesvr1zW','rujHyvnfCNjVCG','y29UBMvJDgvK','z2v0qNvJA2v0','u1vcu0nssujfra','l2XVz3m','ChjLCgvUzeXPC3rLBMvY','DgvZDen1C3rVBunVBM5Ly3rPB24','y2XLyxi','BwvZC2fNzq','BgLTAxq','zgv0ywLSCW','C3vIC2nYAxb0Aw9UCW','Aw1WB3j0twfW','Ag9ZDa','yNvJA2v0swq','BMfTzq','nda0odzQCgnzrfC','y2HHBM5LBa','C3rYAw5NAwz5','ChvZAa','yNjVywrJyxn0','y29UBMvJDgLVBLn0yxrL','uMvHy3royxrPDMu','shr0CenSAwvUDa','C3rHDhvZvgv4Da','z2v0uhvIBgLJvxjS','C2vSzwn0','zMLSDgvYCW','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','z2v0u2vZC2LVBG','Cg9ZDgDYzxneyxrHyMfZzq','l2z1BMn0Aw9UCY92ms8','B3bLCMf0B3i','vw5RBM93BIbLCNjVCG','CgvYAw9K','Cg9YDa','l3nPz24','AgfUzgXLqxv0AevYCM9Y','y3vYCMvUDfnLC3nPB24','DxbKyxrLrMLSzu1LDgfKyxrH','mta5oteYqM9pvwnh','DxbKyxrLt3b0Aw9UCW','AM9PBG','z2v0vxnLCG','Dg9tDhjPBMC','AM9PBMvK','Bwv0Ag9K','y2fWDhvYzvn0ywnRvhjHy2u','CMvHBhrPBwu','Cg9ZDgDYzxnFy2HHBMDLCZO','BgLZDgvUzxjdB3vUDa','z3rL','Bgv2zwW','zM9YrwfJAa','Dg9vChbLCKnHC2u','C2v0u2vZC2LVBKLUDgvYBMfS','Bwf4tgLZDgvUzxjZ','Bwv0ywrHDge','l2zPBgvZl21VDMu','ChjLC2vUy2u','BM93','y3vYCMvUDfnJAgvTyq'];_0x5014=function(){return _0x5d774e;};return _0x5014();}class ReactNativeSocketAdapter{constructor(){function _0x33b5eb(_0x50e257,_0x3026f4){return _0x1cc1(_0x50e257- -0x149,_0x3026f4);}this[_0x33b5eb(0x82,0xa9)]=null;}async[_0x2d9ed0(0x438,0x46c)](_0xd774f3,_0x366fc8){if(!isSocketIOAvailable())throw new Error('Socket.io-client\x20não\x20está\x20disponível.\x20Para\x20React\x20Native,\x20instale:\x20npm\x20install\x20socket.io-client');const {io:_0x50b167}=getSocketIO();return new Promise((_0x101a3d,_0xbbfccc)=>{this[_0x4cbd02(0x1e4,0x1e5)]=_0x50b167(_0xd774f3,{..._0x366fc8,'transports':[_0x4cbd02(0x28a,0x22a)],'upgrade':![],'autoConnect':!![]});function _0x4cbd02(_0x217ebf,_0x2adfa6){return _0x1cc1(_0x2adfa6-0x1a,_0x217ebf);}this['socket']['on'](_0x4cbd02(0x1e8,0x241),()=>_0x101a3d()),this['socket']['on']('connect_error',_0x10af4b=>_0xbbfccc(_0x10af4b));});}['disconnect'](){function _0x450e68(_0x2c8d19,_0x54008e){return _0x1cc1(_0x54008e-0x36a,_0x2c8d19);}this[_0x450e68(0x587,0x535)]&&(this['socket']['disconnect'](),this[_0x450e68(0x4eb,0x535)]=null);}[_0x2d9ed0(0x3bb,0x3c0)](_0x5365e1,data){function _0x82b17e(_0x21cf14,_0x14b65a){return _0x1cc1(_0x14b65a-0x247,_0x21cf14);}this['socket']?.[_0x82b17e(0x441,0x3f1)](_0x5365e1,data);}['on'](_0x43516c,_0x2506b8){function _0x5bb51c(_0x24f681,_0x2a743e){return _0x1cc1(_0x2a743e-0x369,_0x24f681);}this[_0x5bb51c(0x586,0x534)]?.['on'](_0x43516c,_0x2506b8);}['off'](_0x177a5b,_0x31fc59){function _0x5a7a3c(_0x52074a,_0x46c255){return _0x1cc1(_0x52074a-0x35f,_0x46c255);}_0x31fc59?this[_0x5a7a3c(0x52a,0x4cb)]?.[_0x5a7a3c(0x4d7,0x527)](_0x177a5b,_0x31fc59):this['socket']?.[_0x5a7a3c(0x4d7,0x4a4)](_0x177a5b);}get[_0x2d9ed0(0x341,0x37b)](){return this['socket']?.['connected']??![];}}function createSocketAdapter(){const _0x2c26e7=getEnvironment();function _0x4a4d7e(_0x10792e,_0x4b6d25){return _0x1cc1(_0x4b6d25- -0x31d,_0x10792e);}switch(_0x2c26e7){case _0x4a4d7e(-0xc9,-0xe2):return new ReactNativeSocketAdapter();case'browser':case _0x4a4d7e(-0xde,-0x13c):default:return new WebSocketAdapter();}}class RealtimeClient{constructor(_0x53313f,_0xd3510c,_0x1a5669={}){this[_0x1b3f8d(0x2e,0x2d)]=null;function _0x1b3f8d(_0x3fdb32,_0x32f6b8){return _0x1cc1(_0x3fdb32- -0x19d,_0x32f6b8);}this['channels']=new Map(),this[_0x1b3f8d(-0x59,-0x6d)]=_0x1b3f8d(0x46,0x28),this[_0x1b3f8d(0x59,-0x20)]=0x0,this[_0x1b3f8d(0x5a,0xca)]=0x5,this[_0x1b3f8d(0x78,0x2)]=_0x53313f,this['apiKey']=_0xd3510c,this['options']={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x1a5669},this[_0x1b3f8d(0x53,0x71)]=createSocketAdapter();}['connect'](){return new Promise(async(_0x34cc6b,_0x20e2a2)=>{if(this[_0x20562d(-0xb8,-0xfc)][_0x20562d(-0x178,-0x11b)]){_0x34cc6b();return;}this['connectionState']='connecting';function _0x20562d(_0x511232,_0x10cbcf){return _0x1cc1(_0x511232- -0x2a8,_0x10cbcf);}try{await this[_0x20562d(-0xb8,-0x38)][_0x20562d(-0x81,-0x8e)](this['url'],{'auth':{'apikey':this['apiKey']},'transports':[_0x20562d(-0x98,-0x5e)],'reconnection':!![],'reconnectionDelay':this[_0x20562d(-0xc2,-0x125)]['reconnectInterval'],'reconnectionAttempts':this['options']['maxReconnectAttempts'],...this[_0x20562d(-0xc2,-0x7f)]['socketOptions']}),this['socket']=this[_0x20562d(-0xb8,-0x10e)]['socket'],this[_0x20562d(-0xb8,-0xe8)]['on'](_0x20562d(-0x81,-0x85),()=>{this[_0x1d8f1d(-0x14f,-0xe9)]=_0x1d8f1d(-0x177,-0xfd);function _0x1d8f1d(_0x581037,_0x3bef6f){return _0x1cc1(_0x3bef6f- -0x22d,_0x581037);}this[_0x1d8f1d(-0x4a,-0x37)]=0x0,this[_0x1d8f1d(0x7,-0x5c)](),_0x34cc6b();}),this['socketAdapter']['on'](_0x20562d(-0x13a,-0x180),()=>{this['connectionState']=_0x2ba231(-0xfc,-0x169);function _0x2ba231(_0x44fa68,_0x2fc121){return _0x1cc1(_0x2fc121- -0x34c,_0x44fa68);}this['channels']['forEach'](channel=>{channel['_setState']('closed');});}),this['socketAdapter']['on']('connect_error',_0x17ed77=>{function _0x24529a(_0x3c9ec2,_0x3a61e1){return _0x1cc1(_0x3c9ec2- -0x391,_0x3a61e1);}this[_0x24529a(-0x24d,-0x2c1)]=_0x24529a(-0x201,-0x1ad),this['reconnectAttempts']++,this[_0x24529a(-0x19b,-0x1d6)]>=this['maxReconnectAttempts']&&_0x20e2a2(new Error('Failed\x20to\x20connect\x20after\x20'+this['maxReconnectAttempts']+_0x24529a(-0x1e6,-0x21b)+_0x17ed77['message']));}),this['socketAdapter']['on']('reconnect',()=>{function _0x3ef6f9(_0x5afc22,_0x23531c){return _0x1cc1(_0x23531c-0x29e,_0x5afc22);}this[_0x3ef6f9(0x3d1,0x3e2)]='connected',this[_0x3ef6f9(0x513,0x494)]=0x0,this[_0x3ef6f9(0x4c7,0x464)]['forEach'](channel=>{channel['_rejoin']();});}),this[_0x20562d(-0xb8,-0xd6)]['on']('postgres_changes',_0x503624=>{function _0x3b9f9f(_0x90dc89,_0x41446c){return _0x1cc1(_0x41446c- -0x37b,_0x90dc89);}const channel=this['channels']['get'](_0x503624['topic']);channel&&channel[_0x3b9f9f(-0x176,-0x1e1)](_0x3b9f9f(-0x1be,-0x1dc),_0x503624);}),this[_0x20562d(-0xb8,-0xce)]['on'](_0x20562d(-0x165,-0x1e5),_0xed52a1=>{const channel=this['channels']['get'](_0xed52a1['topic']);channel&&channel['_trigger']('broadcast',_0xed52a1);}),this['socketAdapter']['on']('presence',_0x4d4a3d=>{function _0x50dc26(_0x2a03ab,_0x427619){return _0x1cc1(_0x427619- -0x3a8,_0x2a03ab);}const channel=this[_0x50dc26(-0x205,-0x1e2)][_0x50dc26(-0x159,-0x1d0)](_0x4d4a3d[_0x50dc26(-0x13b,-0x1b0)]);channel&&channel['_trigger'](_0x50dc26(-0x1fd,-0x23e),_0x4d4a3d);});}catch(_0x118dfe){this[_0x20562d(-0x164,-0x150)]=_0x20562d(-0x118,-0xaa),_0x20e2a2(_0x118dfe);}});}['disconnect'](){this['socketAdapter']&&(this['socketAdapter'][_0x33ead9(0x187,0x10c)](),this['socket']=null);this['connectionState']=_0x33ead9(0x128,0x181);function _0x33ead9(_0x8084d5,_0x2ac5de){return _0x1cc1(_0x2ac5de- -0x62,_0x8084d5);}this['channels']['clear']();}[_0x2d9ed0(0x351,0x33c)](_0x202f90){function _0x1e6766(_0x4b43df,_0x1c0a70){return _0x1cc1(_0x1c0a70- -0x186,_0x4b43df);}if(this['channels'][_0x1e6766(-0x18,-0x14)](_0x202f90))return this['channels'][_0x1e6766(0x3c,0x52)](_0x202f90);const channel=new RealtimeChannel(_0x202f90,this[_0x1e6766(-0x30,0x45)]);return this['channels']['set'](_0x202f90,channel),this[_0x1e6766(0x7,-0x42)]==='connected'&&channel[_0x1e6766(0xe6,0xae)](),channel;}['removeChannel'](channel){function _0x20f278(_0x1b74ec,_0x1655a8){return _0x1cc1(_0x1655a8-0x93,_0x1b74ec);}const _0x580344=channel['topic'];this[_0x20f278(0x293,0x259)]['has'](_0x580344)&&(this[_0x20f278(0x296,0x259)][_0x20f278(0x220,0x25d)](_0x580344),channel[_0x20f278(0x2a7,0x28e)]());}[_0x2d9ed0(0x3f3,0x41c)](){this['channels']['forEach'](channel=>{channel['unsubscribe']();}),this['channels']['clear']();}['getChannels'](){function _0x59ce0f(_0x2151c0,_0x3dc898){return _0x1cc1(_0x3dc898- -0x122,_0x2151c0);}return Array[_0x59ce0f(0x156,0xf8)](this[_0x59ce0f(0x39,0xa4)]['values']());}['isConnected'](){function _0x4b2b69(_0xe906bf,_0x309929){return _0x1cc1(_0x309929- -0x1b8,_0xe906bf);}return this['connectionState']==='connected'&&this['socketAdapter'][_0x4b2b69(-0x38,-0x88)];}['getConnectionState'](){return this['connectionState'];}[_0x2d9ed0(0x3c8,0x3e1)](_0x44a2b8){function _0x17996e(_0x5a55a9,_0x2a5fad){return _0x1cc1(_0x5a55a9-0x28e,_0x2a5fad);}const _0x4e1731=()=>_0x44a2b8(this[_0x17996e(0x3d2,0x413)]);return this['socketAdapter']&&(this['socketAdapter']['on']('connect',()=>{this['connectionState']='connected',_0x4e1731();}),this['socketAdapter']['on'](_0x17996e(0x3fc,0x3e1),()=>{this[_0xde80da(-0x1a8,-0x169)]=_0xde80da(-0x112,-0xca);function _0xde80da(_0x3c4f1b,_0x199b27){return _0x1cc1(_0x199b27- -0x2ad,_0x3c4f1b);}_0x4e1731();}),this[_0x17996e(0x47e,0x416)]['on'](_0x17996e(0x422,0x439),()=>{this['connectionState']=_0x4a26b1(0x47a,0x479);function _0x4a26b1(_0xa1af37,_0xb77a4a){return _0x1cc1(_0xb77a4a-0x2e9,_0xa1af37);}_0x4e1731();})),()=>{function _0x18f671(_0x9f1dfe,_0x2901f3){return _0x1cc1(_0x9f1dfe- -0x9d,_0x2901f3);}this[_0x18f671(0x153,0x103)]&&(this['socketAdapter'][_0x18f671(0xdb,0x7f)]('connect',_0x4e1731),this[_0x18f671(0x153,0x1bb)]['off'](_0x18f671(0xd1,0xec),_0x4e1731),this[_0x18f671(0x153,0x10c)][_0x18f671(0xdb,0xfe)](_0x18f671(0xf7,0x14c),_0x4e1731));};}['setupHeartbeat'](){if(!this['options'][_0x3e4173(0x162,0x1da)]||!this[_0x3e4173(0x160,0x12a)])return;function _0x3e4173(_0x49e150,_0xe3c7ed){return _0x1cc1(_0x49e150- -0x90,_0xe3c7ed);}const interval=setInterval(()=>{function _0x176c9f(_0x5331b3,_0x245ed5){return _0x1cc1(_0x5331b3-0x9c,_0x245ed5);}this[_0x176c9f(0x28c,0x20f)]?.['connected']?this['socketAdapter'][_0x176c9f(0x246,0x1c2)](_0x176c9f(0x269,0x291),{'timestamp':Date[_0x176c9f(0x207,0x284)]()}):clearInterval(interval);},this[_0x3e4173(0x156,0xf2)]['heartbeatInterval']);}[_0x2d9ed0(0x380,0x2fe)](){function _0x575208(_0x4e1de4,_0x45dc34){return _0x1cc1(_0x45dc34-0x97,_0x4e1de4);}return this[_0x575208(0x278,0x262)];}}class FunctionsClient{constructor(_0x509fcf){function _0x3480fe(_0x324a39,_0x3b246e){return _0x1cc1(_0x3b246e- -0x1ca,_0x324a39);}this[_0x3480fe(0x51,-0x27)]=_0x509fcf;}async['invoke'](_0x356afc,_0x557892){function _0x369aee(_0x11ea09,_0x41bef0){return _0x1cc1(_0x41bef0- -0x67,_0x11ea09);}try{const _0x1a7a39=_0x557892?.[_0x369aee(0x12b,0xf6)]||'POST',headers={'Content-Type':'application/json',..._0x557892?.['headers']};let response;const _0x27e368='/functions/v1/'+_0x356afc;switch(_0x1a7a39[_0x369aee(0x119,0xfe)]()){case'GET':response=await this['httpClient'][_0x369aee(0x1d7,0x171)](_0x27e368,{'headers':headers,'params':_0x557892?.['body']});break;case'POST':response=await this['httpClient']['post'](_0x27e368,_0x557892?.['body'],{'headers':headers});break;case'PUT':response=await this['httpClient']['put'](_0x27e368,_0x557892?.['body'],{'headers':headers});break;case'PATCH':response=await this[_0x369aee(0x139,0x13c)]['patch'](_0x27e368,_0x557892?.[_0x369aee(0x1b5,0x13d)],{'headers':headers});break;case'DELETE':response=await this['httpClient'][_0x369aee(0x10e,0x163)](_0x27e368,{'headers':headers,'data':_0x557892?.['body']});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x1a7a39,0x190);}return{'data':response['data'],'error':null};}catch(_0x165119){return{'data':null,'error':_0x165119 instanceof EBaaSError?_0x165119:new EBaaSError(_0x165119 instanceof Error?_0x165119[_0x369aee(0xce,0xd0)]:_0x369aee(0x1bd,0x198),0x0,_0x165119)};}}async['list'](){function _0x379ceb(_0x4f1555,_0x478185){return _0x1cc1(_0x478185-0x22e,_0x4f1555);}try{const response=await this[_0x379ceb(0x3fc,0x3d1)][_0x379ceb(0x3a4,0x406)](_0x379ceb(0x433,0x432));return{'data':response[_0x379ceb(0x3fa,0x435)],'error':null};}catch(_0x4afca4){return{'data':null,'error':_0x4afca4 instanceof EBaaSError?_0x4afca4:new EBaaSError(_0x4afca4 instanceof Error?_0x4afca4[_0x379ceb(0x336,0x365)]:'Failed\x20to\x20list\x20functions',0x0,_0x4afca4)};}}async['get'](_0x46b45a){function _0x56570b(_0x500f67,_0x4e0636){return _0x1cc1(_0x500f67-0x1be,_0x4e0636);}try{const response=await this['httpClient']['get']('/functions/v1/'+_0x46b45a+'/info');return{'data':response[_0x56570b(0x3c5,0x3c7)],'error':null};}catch(_0x14736d){return{'data':null,'error':_0x14736d instanceof EBaaSError?_0x14736d:new EBaaSError(_0x14736d instanceof Error?_0x14736d[_0x56570b(0x2f5,0x279)]:'Failed\x20to\x20get\x20function',0x0,_0x14736d)};}}async['deploy'](_0x45b3b3,_0xe3238c){function _0x465662(_0x7727df,_0x2440d4){return _0x1cc1(_0x2440d4-0x3b1,_0x7727df);}try{const _0x580644=new FormData();if(_0xe3238c['code']instanceof File)_0x580644['append'](_0x465662(0x542,0x5c4),_0xe3238c['code']);else typeof _0xe3238c['code']===_0x465662(0x586,0x585)&&_0x580644[_0x465662(0x5ac,0x5a6)](_0x465662(0x61c,0x5c4),new Blob([_0xe3238c[_0x465662(0x5bf,0x5c4)]],{'type':_0x465662(0x57c,0x5e0)}),'index.ts');_0xe3238c['entrypoint']&&_0x580644[_0x465662(0x58c,0x5a6)]('entrypoint',_0xe3238c[_0x465662(0x58b,0x553)]);_0xe3238c[_0x465662(0x5d5,0x5e1)]&&_0x580644[_0x465662(0x5ad,0x5a6)]('env',JSON['stringify'](_0xe3238c[_0x465662(0x656,0x5e1)]));_0xe3238c['importMap']&&_0x580644['append'](_0x465662(0x527,0x4ec),JSON['stringify'](_0xe3238c['importMap']));_0xe3238c[_0x465662(0x558,0x586)]!==undefined&&_0x580644[_0x465662(0x541,0x5a6)](_0x465662(0x5a1,0x586),String(_0xe3238c['verify']));const response=await this['httpClient']['post'](_0x465662(0x4f6,0x4ff)+_0x45b3b3+'/deploy',_0x580644,{'headers':{'Content-Type':_0x465662(0x5b7,0x571)}});return{'data':response['data'],'error':null};}catch(_0x291ee2){return{'data':null,'error':_0x291ee2 instanceof EBaaSError?_0x291ee2:new EBaaSError(_0x291ee2 instanceof Error?_0x291ee2['message']:_0x465662(0x47d,0x4fc),0x0,_0x291ee2)};}}async['delete'](_0x35c956){function _0x4f9d77(_0x4e696a,_0x32c484){return _0x1cc1(_0x4e696a- -0x7,_0x32c484);}try{const response=await this['httpClient'][_0x4f9d77(0x1c3,0x248)](_0x4f9d77(0x147,0x1ca)+_0x35c956);return{'data':response[_0x4f9d77(0x200,0x26e)],'error':null};}catch(_0x437552){return{'data':null,'error':_0x437552 instanceof EBaaSError?_0x437552:new EBaaSError(_0x437552 instanceof Error?_0x437552[_0x4f9d77(0x130,0x186)]:_0x4f9d77(0x22a,0x1ba),0x0,_0x437552)};}}async[_0x2d9ed0(0x3c5,0x3c0)](_0x3599c9,_0x65417f){function _0x258db9(_0x1692db,_0x2b35d1){return _0x1cc1(_0x1692db- -0x2fd,_0x2b35d1);}try{const response=await this['httpClient'][_0x258db9(-0xdf,-0xa1)]('/functions/v1/'+_0x3599c9+_0x258db9(-0x14b,-0x10a),{'env':_0x65417f});return{'data':response[_0x258db9(-0xf6,-0xb7)],'error':null};}catch(_0x18f944){return{'data':null,'error':_0x18f944 instanceof EBaaSError?_0x18f944:new EBaaSError(_0x18f944 instanceof Error?_0x18f944[_0x258db9(-0x1c6,-0x149)]:_0x258db9(-0xec,-0x14e),0x0,_0x18f944)};}}async['getLogs'](_0x854431,_0x93bbef){function _0x39c207(_0xe5afee,_0x523f67){return _0x1cc1(_0x523f67-0x27b,_0xe5afee);}try{const _0x4b8b47=new URLSearchParams();_0x93bbef?.['limit']&&_0x4b8b47['append'](_0x39c207(0x3a6,0x3b3),String(_0x93bbef[_0x39c207(0x32e,0x3b3)]));_0x93bbef?.[_0x39c207(0x3f7,0x420)]&&_0x4b8b47['append'](_0x39c207(0x463,0x420),String(_0x93bbef[_0x39c207(0x411,0x420)]));_0x93bbef?.['level']&&_0x4b8b47[_0x39c207(0x433,0x470)]('level',_0x93bbef[_0x39c207(0x407,0x3de)]);const _0x438d8a=_0x39c207(0x421,0x3c9)+_0x854431+_0x39c207(0x3c9,0x3ae)+(_0x4b8b47[_0x39c207(0x428,0x3d6)]()?'?'+_0x4b8b47[_0x39c207(0x3c2,0x3d6)]():''),response=await this[_0x39c207(0x42e,0x41e)]['get'](_0x438d8a);return{'data':response['data'],'error':null};}catch(_0x4ed004){return{'data':null,'error':_0x4ed004 instanceof EBaaSError?_0x4ed004:new EBaaSError(_0x4ed004 instanceof Error?_0x4ed004[_0x39c207(0x3d2,0x3b2)]:_0x39c207(0x40d,0x408),0x0,_0x4ed004)};}}async[_0x2d9ed0(0x3df,0x41a)](_0x1c9f18,_0x179902){function _0x2cb924(_0x54d59e,_0x161dd5){return _0x1cc1(_0x161dd5-0x203,_0x54d59e);}try{const _0x109018=new URLSearchParams();_0x179902?.[_0x2cb924(0x3b5,0x354)]&&_0x109018[_0x2cb924(0x382,0x3f8)](_0x2cb924(0x3bb,0x354),_0x179902['period']);const _0x51bda8='/functions/v1/'+_0x1c9f18+'/metrics'+(_0x109018['toString']()?'?'+_0x109018[_0x2cb924(0x38b,0x35e)]():''),response=await this[_0x2cb924(0x350,0x3a6)][_0x2cb924(0x3dd,0x3db)](_0x51bda8);return{'data':response['data'],'error':null};}catch(_0x4afcad){return{'data':null,'error':_0x4afcad instanceof EBaaSError?_0x4afcad:new EBaaSError(_0x4afcad instanceof Error?_0x4afcad['message']:_0x2cb924(0x48b,0x417),0x0,_0x4afcad)};}}}class EBaaSClient{constructor(_0x2b5299,_0x48f6d9,_0x3637b1){this['options']=_0x3637b1;function _0x391538(_0x129cde,_0x3b52b8){return _0x1cc1(_0x129cde-0x3d2,_0x3b52b8);}this[_0x391538(0x575,0x5b5)]=new HttpClient({'url':_0x2b5299,'apiKey':_0x48f6d9,'timeout':0x7530,'headers':_0x3637b1?.['global']?.[_0x391538(0x5f2,0x627)]}),this[_0x391538(0x56b,0x5ce)]=new AuthClient(this['httpClient'],_0x3637b1?.[_0x391538(0x59e,0x533)]?.[_0x391538(0x57e,0x573)]),this[_0x391538(0x59e,0x5bc)]=new DatabaseClient(this['httpClient'],_0x3637b1?.['database']?.[_0x391538(0x57e,0x56b)]),this['storage']=new StorageClient(this['httpClient']),this['realtime']=new RealtimeClient(_0x2b5299,_0x48f6d9,_0x3637b1?.[_0x391538(0x531,0x4f6)]),this['functions']=new FunctionsClient(this['httpClient']),this[_0x391538(0x565,0x4f0)]();}[_0x2d9ed0(0x42b,0x3c8)](_0x184dcd){function _0x210000(_0x4c47c6,_0x355d1a){return _0x1cc1(_0x4c47c6- -0xcc,_0x355d1a);}return this[_0x210000(0x100,0xc6)][_0x210000(0x14e,0x168)](_0x184dcd);}[_0x2d9ed0(0x40a,0x418)](_0x11825a,_0x459990){function _0x57fa52(_0x4b9659,_0x33f3f0){return _0x1cc1(_0x33f3f0-0x376,_0x4b9659);}return this[_0x57fa52(0x563,0x542)][_0x57fa52(0x4f4,0x56f)](_0x11825a,_0x459990);}['bucket'](_0x5f8b3d){function _0x140f9b(_0xf1b979,_0x52779a){return _0x1cc1(_0x52779a-0x1b0,_0xf1b979);}return this[_0x140f9b(0x31d,0x326)]['from'](_0x5f8b3d);}[_0x2d9ed0(0x351,0x326)](_0x56a609){function _0x479af5(_0x100688,_0x5633c4){return _0x1cc1(_0x100688- -0x2a4,_0x5633c4);}return this[_0x479af5(-0x145,-0x103)][_0x479af5(-0x164,-0xf7)](_0x56a609);}[_0x2d9ed0(0x42e,0x3d7)](_0x2d75b4,_0x300464){return this['functions']['invoke'](_0x2d75b4,_0x300464);}async[_0x2d9ed0(0x3a4,0x391)](){function _0x5c31c3(_0x24c2cb,_0x5ca1e4){return _0x1cc1(_0x24c2cb-0x1bb,_0x5ca1e4);}if(this['options']?.[_0x5c31c3(0x387,0x3a3)]?.['autoDetectCustomDatabase'])try{await this['database']['initialize']();}catch(_0x5b3265){console[_0x5c31c3(0x3d6,0x3f6)]('Failed to initialize custom database detection:',_0x5b3265);}}async[_0x2d9ed0(0x419,0x3b8)](_0x570b71){this[_0x26f2ce(-0x133,-0x1a5)]['setWorkspaceId'](_0x570b71);function _0x26f2ce(_0x47959e,_0xa14cce){return _0x1cc1(_0x47959e- -0x2cc,_0xa14cce);}this['database'][_0x26f2ce(-0xc4,-0xe6)](_0x570b71),this['options']?.['database']?.['autoDetectCustomDatabase']&&await this['database']['initialize']();}async['configureCustomDatabase'](_0x14c63f){await this['database']['configureCustomDatabase'](_0x14c63f);}['getCustomDatabaseStatus'](){function _0x22f9b7(_0x25222c,_0x306cbd){return _0x1cc1(_0x25222c-0x178,_0x306cbd);}return this['database'][_0x22f9b7(0x3a0,0x390)]();}}function createClient(_0x3dc09d,_0x3cfa50,_0x153eb2){return new EBaaSClient(_0x3dc09d,_0x3cfa50,_0x153eb2);}const version=_0x2d9ed0(0x394,0x388);function _0x1cc1(_0x579a85,_0x44b311){const _0x501481=_0x5014();return _0x1cc1=function(_0x1cc137,_0x43300d){_0x1cc137=_0x1cc137-0x130;let _0x348c9f=_0x501481[_0x1cc137];if(_0x1cc1['gQEMuN']===undefined){var _0x215787=function(_0x1f1e26){const _0x57daed='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1a928c='',_0x401160='';for(let _0x1e82aa=0x0,_0x18823a,_0xb0f5cb,_0x27c418=0x0;_0xb0f5cb=_0x1f1e26['charAt'](_0x27c418++);~_0xb0f5cb&&(_0x18823a=_0x1e82aa%0x4?_0x18823a*0x40+_0xb0f5cb:_0xb0f5cb,_0x1e82aa++%0x4)?_0x1a928c+=String['fromCharCode'](0xff&_0x18823a>>(-0x2*_0x1e82aa&0x6)):0x0){_0xb0f5cb=_0x57daed['indexOf'](_0xb0f5cb);}for(let _0x67ef13=0x0,_0x4707ea=_0x1a928c['length'];_0x67ef13<_0x4707ea;_0x67ef13++){_0x401160+='%'+('00'+_0x1a928c['charCodeAt'](_0x67ef13)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x401160);};_0x1cc1['oPmtIK']=_0x215787,_0x579a85=arguments,_0x1cc1['gQEMuN']=!![];}const _0x3aa26e=_0x501481[0x0],_0x4cbb01=_0x1cc137+_0x3aa26e,_0x527f8b=_0x579a85[_0x4cbb01];return!_0x527f8b?(_0x348c9f=_0x1cc1['oPmtIK'](_0x348c9f),_0x579a85[_0x4cbb01]=_0x348c9f):_0x348c9f=_0x527f8b,_0x348c9f;},_0x1cc1(_0x579a85,_0x44b311);}exports['AuthClient']=AuthClient;function _0x2d9ed0(_0x43bf20,_0x4f09d2){return _0x1cc1(_0x43bf20-0x211,_0x4f09d2);}exports[_0x2d9ed0(0x3bf,0x445)]=CustomDatabaseManager,exports[_0x2d9ed0(0x3a3,0x421)]=DatabaseClient,exports['EBaaSClient']=EBaaSClient,exports[_0x2d9ed0(0x450,0x3ff)]=EBaaSError,exports[_0x2d9ed0(0x3fc,0x3b7)]=FunctionsClient,exports[_0x2d9ed0(0x357,0x3c7)]=HttpClient,exports['QueryBuilder']=QueryBuilder,exports[_0x2d9ed0(0x3d3,0x3dc)]=RealtimeChannel,exports[_0x2d9ed0(0x3ac,0x335)]=RealtimeClient,exports[_0x2d9ed0(0x3cd,0x3e1)]=StorageBucket,exports[_0x2d9ed0(0x43b,0x3c2)]=StorageClient,exports['createClient']=createClient,exports['version']=version;
|
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(stringArrayFunction,comparisonValue){function _0x16218b(_0x45ba2f,_0x130808){return _0x1e97(_0x45ba2f-0x55,_0x130808);}const stringArray=stringArrayFunction();while(!![]){try{const _0x19ce91=-parseInt(_0x16218b(0x1d8,0x246))/0x1+-parseInt(_0x16218b(0x159,0x19a))/0x2+-parseInt(_0x16218b(0x20f,0x1e7))/0x3*(-parseInt(_0x16218b(0x148,0x10f))/0x4)+-parseInt(_0x16218b(0x143,0xfb))/0x5*(parseInt(_0x16218b(0x18b,0x19f))/0x6)+-parseInt(_0x16218b(0x152,0x1c5))/0x7*(parseInt(_0x16218b(0x1ec,0x21f))/0x8)+-parseInt(_0x16218b(0x1d4,0x1b2))/0x9*(parseInt(_0x16218b(0x22b,0x1fe))/0xa)+-parseInt(_0x16218b(0x1a3,0x1f8))/0xb*(-parseInt(_0x16218b(0x165,0x113))/0xc);if(_0x19ce91===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x3e0ab5){stringArray['push'](stringArray['shift']());}}}(_0x5df5,0xc901c));import axios from'axios';class EBaaSError extends Error{constructor(_0x10db32,status=0x0,_0x1fb62e){super(_0x10db32),this[_0x5c9a48(0x31c,0x2b7)]=_0x5c9a48(0x24c,0x2af),this['status']=status,this['details']=_0x1fb62e;function _0x5c9a48(_0x1889d9,_0x551a7b){return _0x1e97(_0x551a7b-0xce,_0x1889d9);}Error[_0x5c9a48(0x2fc,0x298)]&&Error[_0x5c9a48(0x22b,0x298)](this,EBaaSError);}[_0x4bcf27(-0x2c7,-0x303)](){function _0xf71b9b(_0x3adda8,_0x825c76){return _0x1e97(_0x825c76-0x315,_0x3adda8);}return{'name':this[_0xf71b9b(0x567,0x4fe)],'message':this['message'],'status':this['status'],'details':this[_0xf71b9b(0x49c,0x4d5)],'stack':this[_0xf71b9b(0x4ef,0x4ab)]};}['toString'](){function _0x212a39(_0x31adeb,_0x3144db){return _0x1e97(_0x3144db- -0x193,_0x31adeb);}return this['name']+':\x20'+this[_0x212a39(0xab,0x52)]+'\x20(Status:\x20'+this['status']+')';}}class HttpClient{constructor(config){this[_0x53c16a(0x18e,0x162)]=config[_0x53c16a(0x147,0xc6)];function _0x53c16a(_0x4f695c,_0x5bb283){return _0x1e97(_0x4f695c-0x3a,_0x5bb283);}this[_0x53c16a(0x156,0x14b)]=config['apiKey'],this[_0x53c16a(0x13c,0xd7)]=axios['create']({'baseURL':this[_0x53c16a(0x18e,0x183)],'timeout':config[_0x53c16a(0x20b,0x183)]||0x2710,'headers':{'Content-Type':'application/json','apikey':this[_0x53c16a(0x156,0x159)],...config[_0x53c16a(0x217,0x1c9)]}}),this[_0x53c16a(0x166,0x12b)]();}[_0x4bcf27(-0x2b8,-0x270)](){this['client']['interceptors']['request'][_0x30a29f(-0x276,-0x205)](config=>{return config;},_0x481f57=>{return Promise['reject'](new EBaaSError('Request\x20failed',0x0,_0x481f57));});function _0x30a29f(_0x4c1fc6,_0x11eae8){return _0x1e97(_0x11eae8- -0x3dc,_0x4c1fc6);}this['client'][_0x30a29f(-0x299,-0x2c6)]['response'][_0x30a29f(-0x198,-0x205)](response=>{return response;},_0xe911a0=>{const status=_0xe911a0['response']?.['status']||0x0;function _0xd47aff(_0x4035c6,_0xe0ed56){return _0x1e97(_0x4035c6- -0x64,_0xe0ed56);}const _0x26cd03=_0xe911a0[_0xd47aff(0xc0,0xb9)]?.['data']?.['message']||_0xe911a0['message']||'Unknown\x20error',_0x12d93d=_0xe911a0[_0xd47aff(0xc0,0xe2)]?.[_0xd47aff(0x120,0xe7)]||_0xe911a0;return Promise[_0xd47aff(0xbc,0xbd)](new EBaaSError(_0x26cd03,status,_0x12d93d));});}async[_0x4bcf27(-0x204,-0x231)](_0x12c9e4,config){try{const response=await this['client']['get'](_0x12c9e4,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x52f10c){throw this['handleError'](_0x52f10c);}}async[_0x4bcf27(-0x2cc,-0x309)](_0x4655aa,data,config){function _0x950f45(_0x18aad5,_0x5da8c9){return _0x1e97(_0x18aad5- -0x394,_0x5da8c9);}try{const response=await this[_0x950f45(-0x292,-0x2c9)]['post'](_0x4655aa,data,config);return{'data':response[_0x950f45(-0x210,-0x292)],'status':response[_0x950f45(-0x1ce,-0x225)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x5c1c4e){throw this[_0x950f45(-0x1cc,-0x21c)](_0x5c1c4e);}}async['put'](_0x549dc2,data,config){function _0x1e1697(_0x358898,_0x29bd43){return _0x1e97(_0x358898- -0x2ec,_0x29bd43);}try{const response=await this[_0x1e1697(-0x1ea,-0x23f)]['put'](_0x549dc2,data,config);return{'data':response[_0x1e1697(-0x168,-0x1c3)],'status':response[_0x1e1697(-0x126,-0xb6)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x514775){throw this['handleError'](_0x514775);}}async['patch'](_0x59856b,data,config){function _0xdeb0da(_0x6f0673,_0x26419f){return _0x1e97(_0x26419f- -0x22,_0x6f0673);}try{const response=await this['client']['patch'](_0x59856b,data,config);return{'data':response[_0xdeb0da(0x1bf,0x162)],'status':response[_0xdeb0da(0x1e1,0x1a4)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x5a602e){throw this[_0xdeb0da(0x1c9,0x1a6)](_0x5a602e);}}async['delete'](_0x361c1a,config){function _0x309c24(_0x3db93b,_0x4dd548){return _0x1e97(_0x3db93b-0x38d,_0x4dd548);}try{const response=await this[_0x309c24(0x48f,0x446)][_0x309c24(0x475,0x471)](_0x361c1a,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x2731fc){throw this['handleError'](_0x2731fc);}}['setAuthToken'](_0x27ebe5){function _0x2d7cec(_0x4aeac0,_0x42fcc0){return _0x1e97(_0x4aeac0- -0xa5,_0x42fcc0);}this[_0x2d7cec(0x5d,-0x9)][_0x2d7cec(0x4c,0x3a)][_0x2d7cec(0x138,0x111)]['common']['Authorization']='Bearer\x20'+_0x27ebe5;}[_0x4bcf27(-0x2de,-0x331)](){function _0x4f15a8(_0x2874fe,_0x2135c0){return _0x1e97(_0x2135c0- -0x2b3,_0x2874fe);}delete this[_0x4f15a8(-0x1b9,-0x1b1)][_0x4f15a8(-0x142,-0x1c2)]['headers']['common']['Authorization'],this[_0x4f15a8(-0x234,-0x1b1)][_0x4f15a8(-0x1ff,-0x1c2)][_0x4f15a8(-0x108,-0xd6)][_0x4f15a8(-0x103,-0x124)]['Authorization']='Bearer\x20'+this[_0x4f15a8(-0x176,-0x197)];}[_0x4bcf27(-0x21c,-0x283)](_0xffe721){if(_0xffe721 instanceof EBaaSError)return _0xffe721;return new EBaaSError(_0xffe721['message']||'HTTP\x20request\x20failed',_0xffe721['status']||0x0,_0xffe721);}}class AuthClient{constructor(_0x2a936e,_0x5c1a17){this['currentSession']=null;function _0x168d17(_0x3ed356,_0x42d16f){return _0x1e97(_0x3ed356- -0x1df,_0x42d16f);}this['httpClient']=_0x2a936e,this[_0x168d17(-0xe8,-0x155)]=_0x5c1a17,this['loadSession']();}async['signUp'](data){function _0x3cd40e(_0x47c513,_0x575a1d){return _0x1e97(_0x47c513-0x2a9,_0x575a1d);}try{const response=await this[_0x3cd40e(0x443,0x404)][_0x3cd40e(0x3c1,0x3de)]('/auth/v1/signup',data);return response[_0x3cd40e(0x42d,0x3c2)]['session']&&this[_0x3cd40e(0x49b,0x4d5)](response['data']['session']),response[_0x3cd40e(0x42d,0x3ca)];}catch(_0x1c1009){throw this[_0x3cd40e(0x46d,0x400)](_0x1c1009);}}async['signIn'](data){function _0x253c16(_0x33384f,_0x11d0ef){return _0x1e97(_0x33384f-0xa5,_0x11d0ef);}try{const headers={};this[_0x253c16(0x19c,0x195)]&&(headers['X-Workspace-ID']=this['workspaceId']);const response=await this[_0x253c16(0x23f,0x233)][_0x253c16(0x1bd,0x1ba)](_0x253c16(0x232,0x1f7),data,{'headers':headers});return response[_0x253c16(0x229,0x1a2)]['session']&&this[_0x253c16(0x297,0x21d)](response['data'][_0x253c16(0x247,0x2c5)]),response[_0x253c16(0x229,0x27e)];}catch(_0x1ce18f){throw this['handleAuthError'](_0x1ce18f);}}async[_0x4bcf27(-0x216,-0x29b)](){function _0x5118f7(_0x464c54,_0x212176){return _0x1e97(_0x212176- -0x2be,_0x464c54);}try{await this[_0x5118f7(-0xee,-0x124)][_0x5118f7(-0x1c5,-0x1a6)](_0x5118f7(-0xb0,-0x129)),this[_0x5118f7(-0x140,-0x161)]();}catch(_0x5ea821){this[_0x5118f7(-0x1a8,-0x161)]();throw this['handleAuthError'](_0x5ea821);}}async[_0x4bcf27(-0x2a4,-0x296)](){if(!this[_0x4769ec(0x4df,0x479)]?.['access_token'])return null;function _0x4769ec(_0x478132,_0x8b2421){return _0x1e97(_0x478132-0x395,_0x8b2421);}try{const response=await this['httpClient'][_0x4769ec(0x575,0x5de)]('/auth/v1/user');return response[_0x4769ec(0x519,0x4fe)][_0x4769ec(0x551,0x5b4)];}catch(_0x3d88f0){if(_0x3d88f0 instanceof EBaaSError&&_0x3d88f0['status']===0x191)return this[_0x4769ec(0x4f2,0x528)](),null;throw this[_0x4769ec(0x559,0x59e)](_0x3d88f0);}}async['refreshSession'](){if(!this[_0x5a9271(0x1a4,0x192)]?.[_0x5a9271(0x16e,0x1eb)])return null;function _0x5a9271(_0x3bd48c,_0x268986){return _0x1e97(_0x268986-0x48,_0x3bd48c);}try{const response=await this['httpClient'][_0x5a9271(0x193,0x160)](_0x5a9271(0xec,0x170),{'refresh_token':this[_0x5a9271(0x16a,0x192)]['refresh_token']});if(response[_0x5a9271(0x242,0x1cc)]['session'])return this['setSession'](response['data']['session']),response[_0x5a9271(0x181,0x1cc)][_0x5a9271(0x193,0x1ea)];return null;}catch(_0x4eae95){this[_0x5a9271(0x127,0x1a5)]();throw this['handleAuthError'](_0x4eae95);}}async['resetPassword'](_0x44e0b3){function _0x34e16e(_0x249663,_0x11ddc1){return _0x1e97(_0x249663- -0x37,_0x11ddc1);}try{await this['httpClient'][_0x34e16e(0xe1,0x5c)](_0x34e16e(0x111,0xf9),{'email':_0x44e0b3});}catch(_0x436524){throw this['handleAuthError'](_0x436524);}}async[_0x4bcf27(-0x23c,-0x28b)](data){function _0x5dc104(_0x257b2d,_0x46202c){return _0x1e97(_0x257b2d-0x3d5,_0x46202c);}try{const response=await this[_0x5dc104(0x56f,0x58f)][_0x5dc104(0x571,0x56f)]('/auth/v1/user',data);return response[_0x5dc104(0x559,0x581)]['user'];}catch(_0x3f3574){throw this['handleAuthError'](_0x3f3574);}}[_0x4bcf27(-0x263,-0x287)](){return this['currentSession'];}[_0x4bcf27(-0x294,-0x283)](_0x2415a6){function _0xed3616(_0x50b75e,_0x3768fd){return _0x1e97(_0x3768fd- -0x3a1,_0x50b75e);}this[_0xed3616(-0x1cf,-0x257)]=_0x2415a6,this['httpClient'][_0xed3616(-0x197,-0x1f8)](_0x2415a6['access_token']),typeof localStorage!==_0xed3616(-0x22c,-0x280)&&localStorage['setItem']('ebaas.auth.session',JSON[_0xed3616(-0x2f8,-0x2a1)](_0x2415a6));}['onAuthStateChange'](_0x3a3fc0){return()=>{};}['setWorkspaceId'](_0x4fdbda){function _0x113caf(_0x2c97a7,_0x10af1f){return _0x1e97(_0x2c97a7- -0x130,_0x10af1f);}this[_0x113caf(-0x39,-0xa2)]=_0x4fdbda;}[_0x4bcf27(-0x1f2,-0x204)](_0x5282a8){this['currentSession']=_0x5282a8,this[_0x2fc37c(-0x232,-0x217)]['setAuthToken'](_0x5282a8['access_token']);function _0x2fc37c(_0x1d1dc5,_0x1bd58c){return _0x1e97(_0x1d1dc5- -0x3cc,_0x1bd58c);}typeof localStorage!=='undefined'&&localStorage[_0x2fc37c(-0x1dc,-0x1c9)]('ebaas.auth.session',JSON[_0x2fc37c(-0x2cc,-0x28c)](_0x5282a8));}['clearSession'](){this['currentSession']=null,this[_0x3f1c7c(0xa2,0xec)]['removeAuthToken']();function _0x3f1c7c(_0x300fbe,_0x12ac7a){return _0x1e97(_0x12ac7a- -0xae,_0x300fbe);}typeof localStorage!==_0x3f1c7c(0x7b,0x73)&&localStorage['removeItem'](_0x3f1c7c(0x108,0x13e));}[_0x4bcf27(-0x239,-0x262)](){function _0x3348c9(_0x2f5529,_0x1369a6){return _0x1e97(_0x1369a6-0x240,_0x2f5529);}if(typeof localStorage!==_0x3348c9(0x2f3,0x361)){const _0x21ba48=localStorage['getItem'](_0x3348c9(0x48a,0x42c));if(_0x21ba48)try{const _0x22d407=JSON[_0x3348c9(0x378,0x3de)](_0x21ba48);this[_0x3348c9(0x497,0x432)](_0x22d407);}catch(_0x401a89){this[_0x3348c9(0x3d5,0x39d)]();}}}[_0x4bcf27(-0x220,-0x1f1)](_0x5b9352){function _0x20ca90(_0x217f29,_0x3ae3fe){return _0x1e97(_0x3ae3fe-0x20c,_0x217f29);}if(_0x5b9352 instanceof EBaaSError)return _0x5b9352;return new EBaaSError(_0x5b9352[_0x20ca90(0x373,0x3f1)]||'Authentication\x20failed',_0x5b9352[_0x20ca90(0x443,0x3d2)]||0x0,_0x5b9352);}}class QueryBuilder{constructor(_0x8f7549,_0x3d2b86,_0x2133de,_0x4f5ba8){this['httpClient']=_0x8f7549,this[_0x2f86c2(-0xde,-0x126)]=_0x3d2b86;function _0x2f86c2(_0x219cfd,_0x20c296){return _0x1e97(_0x20c296- -0x268,_0x219cfd);}this[_0x2f86c2(-0x36,-0x82)]=_0x2133de,this[_0x2f86c2(-0x1b8,-0x171)]=_0x4f5ba8,this['query']={'filters':[]};}['select'](_0x11cf37='*',_0x271c09){return this['query']['select']=_0x11cf37,this;}['insert'](data,_0x589764){function _0x346e3c(_0x16ad0a,_0x1019d1){return _0x1e97(_0x16ad0a- -0x294,_0x1019d1);}return this[_0x346e3c(-0x12d,-0xc1)]('POST','/sdk/v1/'+this['table']+'?operation=insert',{'data':data,'options':_0x589764});}[_0x4bcf27(-0x249,-0x223)](data,_0x22ee6a){function _0x40b352(_0x5dde20,_0x5e9b62){return _0x1e97(_0x5dde20-0x34c,_0x5e9b62);}return this['query']['updateData']=data,this['query'][_0x40b352(0x4b2,0x44c)]=_0x22ee6a,this;}['upsert'](data,_0xa7cc36){function _0x50566(_0x550eb8,_0x3f1370){return _0x1e97(_0x3f1370-0x1c0,_0x550eb8);}return this[_0x50566(0x39e,0x327)]('POST','/sdk/v1/'+this['table']+_0x50566(0x336,0x36d),{'data':data,'options':{..._0xa7cc36,'upsert':!![]}});}['delete'](_0x3649e3){this[_0x5ef4da(-0x244,-0x2ad)]['deleteOptions']=_0x3649e3,this['query'][_0x5ef4da(-0x25f,-0x2a7)]=!![];function _0x5ef4da(_0x4845ec,_0x6b6d97){return _0x1e97(_0x4845ec- -0x3bf,_0x6b6d97);}return this;}['eq'](_0x27bd89,_0x57ae0e){function _0x15c234(_0x54e5d6,_0x558f10){return _0x1e97(_0x54e5d6- -0x172,_0x558f10);}return this[_0x15c234(0x9,-0x18)][_0x15c234(0x2e,-0x40)][_0x15c234(-0x7,-0x8c)]({'column':_0x27bd89,'operator':'eq','value':_0x57ae0e}),this;}[_0x4bcf27(-0x1f5,-0x23c)](_0x21574b,_0x5bb5b4){function _0xa6988e(_0x516056,_0x3f5cfe){return _0x1e97(_0x516056- -0xac,_0x3f5cfe);}return this[_0xa6988e(0xcf,0x9d)][_0xa6988e(0xf4,0xb9)][_0xa6988e(0xbf,0x121)]({'column':_0x21574b,'operator':_0xa6988e(0x143,0x16f),'value':_0x5bb5b4}),this;}['gt'](_0x28aa64,_0x1a9e25){function _0x1af12f(_0x29e10a,_0x36b417){return _0x1e97(_0x36b417- -0x2d1,_0x29e10a);}return this[_0x1af12f(-0x1ab,-0x156)]['filters'][_0x1af12f(-0x1c4,-0x166)]({'column':_0x28aa64,'operator':'gt','value':_0x1a9e25}),this;}['gte'](_0x28236b,_0x1eedc6){this['query'][_0x556326(0x38,0x25)][_0x556326(0x3,-0x56)]({'column':_0x28236b,'operator':_0x556326(0x24,0x3d),'value':_0x1eedc6});function _0x556326(_0x215545,_0x1e1823){return _0x1e97(_0x215545- -0x168,_0x1e1823);}return this;}['lt'](_0x15c51a,_0xdb3d71){this[_0x491a6c(-0x110,-0x14f)][_0x491a6c(-0xb1,-0x12a)][_0x491a6c(-0x13c,-0x15f)]({'column':_0x15c51a,'operator':'lt','value':_0xdb3d71});function _0x491a6c(_0x5a7d58,_0x4c8aaf){return _0x1e97(_0x4c8aaf- -0x2ca,_0x5a7d58);}return this;}['lte'](_0x12e586,_0x480c85){this[_0x3f733d(0x26f,0x1f6)][_0x3f733d(0x1f2,0x21b)][_0x3f733d(0x19d,0x1e6)]({'column':_0x12e586,'operator':'lte','value':_0x480c85});function _0x3f733d(_0x5c4c7a,_0x334096){return _0x1e97(_0x334096-0x7b,_0x5c4c7a);}return this;}['like'](_0x2e3238,_0x4e217a){this[_0x142000(0x13,0x42)]['filters']['push']({'column':_0x2e3238,'operator':_0x142000(-0x6f,-0x8a),'value':_0x4e217a});function _0x142000(_0x4f7186,_0x46c458){return _0x1e97(_0x4f7186- -0x168,_0x46c458);}return this;}['ilike'](_0x56abd1,_0xa85a7b){function _0x5995cd(_0x266346,_0x4d30e4){return _0x1e97(_0x4d30e4-0x1bb,_0x266346);}return this[_0x5995cd(0x376,0x336)][_0x5995cd(0x32e,0x35b)]['push']({'column':_0x56abd1,'operator':_0x5995cd(0x326,0x36c),'value':_0xa85a7b}),this;}['is'](_0x3b7594,_0x191bd8){function _0x125b24(_0x2b2db6,_0x2aeecb){return _0x1e97(_0x2aeecb- -0x257,_0x2b2db6);}return this['query'][_0x125b24(-0x3f,-0xb7)]['push']({'column':_0x3b7594,'operator':'is','value':_0x191bd8}),this;}['in'](_0x27992e,_0x19a6f2){function _0x11d7b8(_0x387d22,_0x794f27){return _0x1e97(_0x794f27- -0x1c8,_0x387d22);}return this[_0x11d7b8(-0xcc,-0x4d)][_0x11d7b8(0x2a,-0x28)]['push']({'column':_0x27992e,'operator':'in','value':_0x19a6f2}),this;}[_0x4bcf27(-0x1fc,-0x21b)](_0x22bc5d,_0x31640f){this['query'][_0x2b81c0(0x5b4,0x55b)][_0x2b81c0(0x538,0x526)]({'column':_0x22bc5d,'operator':_0x2b81c0(0x5ec,0x5a3),'value':_0x31640f});function _0x2b81c0(_0x46502b,_0x506819){return _0x1e97(_0x506819-0x3bb,_0x46502b);}return this;}['match'](_0x57d472){Object[_0x12e779(0x12,0x8f)](_0x57d472)[_0x12e779(0x1e,0x80)](([_0x3389c7,_0x10d68e])=>{this['eq'](_0x3389c7,_0x10d68e);});function _0x12e779(_0x5d3699,_0x49d787){return _0x1e97(_0x49d787- -0xb2,_0x5d3699);}return this;}['order'](_0x2b58f0,_0x4ad617){!this[_0x3d4019(0x1cf,0x153)]['order']&&(this[_0x3d4019(0x103,0x153)]['order']=[]);function _0x3d4019(_0x33b0be,_0x472706){return _0x1e97(_0x472706- -0x28,_0x33b0be);}return this[_0x3d4019(0x149,0x153)]['order']['push']({'column':_0x2b58f0,'ascending':_0x4ad617?.[_0x3d4019(0x187,0x15f)]!==![]}),this;}['limit'](count){return this['query']['limit']=count,this;}['range'](from,_0x42be16){function _0x4b9151(_0x39cce4,_0x5a1d75){return _0x1e97(_0x39cce4-0x212,_0x5a1d75);}return this[_0x4b9151(0x38d,0x3e8)]['range']={'from':from,'to':_0x42be16},this;}async[_0x4bcf27(-0x25c,-0x296)](){function _0x5b3280(_0xf0aab9,_0x1b2b73){return _0x1e97(_0x1b2b73-0x175,_0xf0aab9);}if(this[_0x5b3280(0x2e8,0x2f0)]['updateData'])return this['executeQuery']('PATCH','/sdk/v1/'+this[_0x5b3280(0x2a6,0x2b7)],{'data':this[_0x5b3280(0x28f,0x2f0)]['updateData'],'options':this['query']['updateOptions'],'filters':this[_0x5b3280(0x369,0x2f0)]['filters']});else return this['query'][_0x5b3280(0x33e,0x2d5)]?this['executeQuery']('DELETE',_0x5b3280(0x2ee,0x28f)+this[_0x5b3280(0x300,0x2b7)]+'?operation=delete',{'options':this[_0x5b3280(0x344,0x2f0)]['deleteOptions'],'filters':this['query'][_0x5b3280(0x29d,0x315)]}):this[_0x5b3280(0x361,0x2dc)]('GET','/sdk/v1/'+this['table']+_0x5b3280(0x290,0x2d1),{'select':this[_0x5b3280(0x2f8,0x2f0)][_0x5b3280(0x308,0x2b8)],'filters':this[_0x5b3280(0x34e,0x2f0)][_0x5b3280(0x2e4,0x315)],'order':this[_0x5b3280(0x343,0x2f0)][_0x5b3280(0x2b0,0x2a2)],'limit':this['query']['limit'],'range':this[_0x5b3280(0x304,0x2f0)]['range']});}async['single'](){this[_0x4dfae1(0x1f5,0x233)](0x1);function _0x4dfae1(_0x4d6fdb,_0x4a6a97){return _0x1e97(_0x4d6fdb-0x19,_0x4a6a97);}const result=await this['execute']();return{'data':result['data']?.[0x0]||null,'error':result[_0x4dfae1(0x17e,0x13f)]};}async['executeQuery'](_0x58c34e,_0x52f568,_0x10c3f8){function _0x2324c4(_0x2c36e4,_0x2afab2){return _0x1e97(_0x2afab2-0x9b,_0x2c36e4);}try{let response;const headers={};this[_0x2324c4(0x119,0x192)]&&(headers['x-workspace-id']=this['workspaceId']);if(_0x58c34e==='GET'){const _0xfc35e8=_0x52f568['split']('?'),_0x3dcd39=_0xfc35e8[0x0],existingParams=new URLSearchParams(_0xfc35e8[0x1]||'');if(_0x10c3f8[_0x2324c4(0x24a,0x1de)])existingParams['append']('select',_0x10c3f8['select']);_0x10c3f8['filters']?.['length']&&_0x10c3f8['filters']['forEach'](filter=>{function _0x2fda8f(_0x4e048d,_0x5469b1){return _0x1e97(_0x5469b1- -0x35c,_0x4e048d);}existingParams['append'](filter[_0x2fda8f(-0x1ba,-0x197)],filter['operator']+'.'+filter['value']);});if(_0x10c3f8[_0x2324c4(0x24f,0x1c8)]?.['length']){const orderStr=_0x10c3f8[_0x2324c4(0x21e,0x1c8)][_0x2324c4(0x142,0x18a)](_0x1dd550=>''+_0x1dd550['column']+(_0x1dd550[_0x2324c4(0x1c1,0x222)]?_0x2324c4(0x2e9,0x264):_0x2324c4(0x1b2,0x1f2)))['join'](',');existingParams['append']('order',orderStr);}if(_0x10c3f8['limit'])existingParams['append'](_0x2324c4(0x2a2,0x277),_0x10c3f8['limit']['toString']());_0x10c3f8['range']&&(existingParams['append']('offset',_0x10c3f8['range'][_0x2324c4(0x297,0x240)][_0x2324c4(0x210,0x1c4)]()),existingParams[_0x2324c4(0x307,0x286)]('limit',(_0x10c3f8[_0x2324c4(0x1a8,0x1e2)]['to']-_0x10c3f8['range'][_0x2324c4(0x246,0x240)]+0x1)[_0x2324c4(0x22c,0x1c4)]())),response=await this[_0x2324c4(0x2b8,0x235)]['get'](_0x3dcd39+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x58c34e==='DELETE'){const _0x1f4c0a=_0x52f568['split']('?'),_0xc11854=_0x1f4c0a[0x0],existingParams=new URLSearchParams(_0x1f4c0a[0x1]||'');!existingParams[_0x2324c4(0x185,0x187)](_0x2324c4(0x20d,0x275))&&existingParams['append']('operation',_0x2324c4(0x1dd,0x183));_0x10c3f8[_0x2324c4(0x26d,0x23b)]?.[_0x2324c4(0x1ed,0x1a4)]&&_0x10c3f8['filters']['forEach'](filter=>{function _0x225b01(_0x1b4f42,_0x50948d){return _0x1e97(_0x1b4f42-0xf9,_0x50948d);}existingParams[_0x225b01(0x2e4,0x2b1)](filter[_0x225b01(0x2be,0x268)],filter[_0x225b01(0x2ba,0x2ac)]+'.'+filter['value']);});const deleteUrl=_0xc11854+'?'+existingParams[_0x2324c4(0x218,0x1c4)]();console[_0x2324c4(0x27c,0x262)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console[_0x2324c4(0x214,0x262)]('\uD83D\uDD27 DELETE headers:',headers),console['log']('\uD83D\uDD27 DELETE filtros originais:',_0x10c3f8['filters']),response=await this['httpClient'][_0x2324c4(0x17d,0x183)](deleteUrl,{'headers':headers});}else{if(_0x58c34e==='PATCH'){const _0x209908=_0x52f568['split']('?'),_0x37c3ad=_0x209908[0x0],existingParams=new URLSearchParams(_0x209908[0x1]||'');!existingParams[_0x2324c4(0x174,0x187)]('operation')&&existingParams[_0x2324c4(0x2b4,0x286)]('operation',_0x2324c4(0x250,0x236));_0x10c3f8['filters']?.['length']&&_0x10c3f8['filters'][_0x2324c4(0x23f,0x1cd)](filter=>{function _0x146568(_0xe92ef4,_0x4e12ed){return _0x1e97(_0x4e12ed-0x2aa,_0xe92ef4);}existingParams[_0x146568(0x509,0x495)](filter['column'],filter[_0x146568(0x4ef,0x46b)]+'.'+filter['value']);});_0x10c3f8['options']?.['prefer']&&(headers['Prefer']=_0x10c3f8[_0x2324c4(0x2b2,0x24f)][_0x2324c4(0x1f7,0x203)]);const updateUrl=_0x37c3ad+'?'+existingParams['toString']();response=await this['httpClient'][_0x2324c4(0x1cb,0x1ed)](updateUrl,_0x10c3f8['data'],{'headers':headers});}else{let _0x53f510=_0x10c3f8['data'];!headers[_0x2324c4(0x225,0x1b0)]&&(headers['Prefer']='return=representation'),_0x10c3f8[_0x2324c4(0x288,0x24f)]?.['upsert']&&(headers[_0x2324c4(0x222,0x1b0)]=_0x2324c4(0x171,0x1e6)),_0x10c3f8['dataArray']&&(_0x53f510=_0x10c3f8[_0x2324c4(0x2c1,0x26f)]),response=await this[_0x2324c4(0x25b,0x235)]['post'](_0x52f568,_0x53f510,{'headers':headers});}}}return{'data':response['data'],'error':null,'count':response[_0x2324c4(0x2a8,0x278)]?.['x-total-count']?parseInt(response[_0x2324c4(0x24b,0x278)][_0x2324c4(0x208,0x221)]):undefined};}catch(_0x5c312c){return{'data':null,'error':_0x5c312c instanceof EBaaSError?_0x5c312c:new EBaaSError(_0x5c312c instanceof Error?_0x5c312c['message']:'Database\x20operation\x20failed',0x0,_0x5c312c)};}}}class CustomDatabaseManager{constructor(_0x2f32fd,_0x4cf8f0){this[_0x3f81c5(0x2d,0x96)]=_0x2f32fd;function _0x3f81c5(_0x30df03,_0x57d5c3){return _0x1e97(_0x57d5c3- -0x104,_0x30df03);}this[_0x3f81c5(-0x2e,-0xd)]=_0x4cf8f0;}async['detectCustomDatabase'](){if(!this[_0x13d976(-0x173,-0x131)])return{'hasCustomDatabase':![]};try{const response=await this['httpClient'][_0x13d976(-0x8a,-0x111)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response[_0x13d976(-0xa4,-0xf4)]===0xc8&&response[_0x13d976(-0xe6,-0x126)]?.[_0x13d976(-0x167,-0x1b1)]){const config=response[_0x13d976(-0xe6,-0xb7)]['config'],_0x3dcb2b={'host':config[_0x13d976(-0x157,-0x15e)],'port':config[_0x13d976(-0x124,-0x128)],'database':config[_0x13d976(-0xf7,-0x11f)],'username':config['postgresUsername'],'password':'','schema':config[_0x13d976(-0xb3,-0x43)],'sslEnabled':config[_0x13d976(-0x91,-0x96)]};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x3dcb2b},this['detectedConfig'];}}catch(_0x38820c){if(_0x38820c?.[_0x13d976(-0xa4,-0x7c)]===0x194)return this['detectedConfig']={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x38820c);}this[_0x13d976(-0xb8,-0x13d)]={'hasCustomDatabase':![]};function _0x13d976(_0x1a635d,_0x21e183){return _0x1e97(_0x1a635d- -0x26a,_0x21e183);}return this['detectedConfig'];}async['testConnection'](_0x5afb99){function _0x56c45d(_0x2db072,_0xd25011){return _0x1e97(_0xd25011-0x3b9,_0x2db072);}try{const response=await this[_0x56c45d(0x5ad,0x553)]['post']('/admin/v1/workspace/custom-database/test-connection',_0x5afb99,{'headers':this['workspaceId']?{'X-Workspace-ID':this[_0x56c45d(0x449,0x4b0)]}:{}});return response[_0x56c45d(0x52d,0x53d)];}catch(_0xd4ad51){return{'success':![],'message':_0xd4ad51?.['message']||_0x56c45d(0x5d4,0x58b)};}}async['configureCustomDatabase'](_0x134a49){if(!this[_0x229870(0x389,0x338)])throw new Error('Workspace ID is required to configure custom database');const response=await this['httpClient'][_0x229870(0x3aa,0x3ad)]('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x134a49},{'headers':{'X-Workspace-ID':this[_0x229870(0x389,0x35f)]}}),config=response['data']['config'];function _0x229870(_0x157e37,_0x12a750){return _0x1e97(_0x157e37-0x292,_0x12a750);}return this[_0x229870(0x444,0x3f7)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x134a49},config;}async[_0x4bcf27(-0x2e5,-0x2c5)](){function _0x4b1fc1(_0x190779,_0x536579){return _0x1e97(_0x190779-0x81,_0x536579);}if(!this[_0x4b1fc1(0x178,0x1a0)])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[_0x4b1fc1(0x178,0x10c)]}}),this['detectedConfig']={'hasCustomDatabase':![]};}[_0x4bcf27(-0x2c2,-0x33e)](){return this['detectedConfig'];}[_0x4bcf27(-0x278,-0x203)](){function _0x51e11(_0x26be23,_0x941d61){return _0x1e97(_0x26be23- -0x190,_0x941d61);}return this[_0x51e11(0x22,-0x24)]?.['hasCustomDatabase']??![];}[_0x4bcf27(-0x22c,-0x1c1)](){function _0x44e15(_0x549620,_0x1a8c26){return _0x1e97(_0x549620- -0x37e,_0x1a8c26);}return this['detectedConfig']?.[_0x44e15(-0x1f4,-0x19e)];}[_0x4bcf27(-0x20c,-0x183)](_0xdef9b){this['workspaceId']=_0xdef9b;function _0xc06c89(_0x5f0a9e,_0x5c7573){return _0x1e97(_0x5c7573-0x8,_0x5f0a9e);}this[_0xc06c89(0x203,0x1ba)]=undefined;}[_0x4bcf27(-0x2ac,-0x25e)](){return this['workspaceId'];}[_0x4bcf27(-0x2fd,-0x2b3)](){function _0x115f63(_0x55beef,_0x47cd34){return _0x1e97(_0x47cd34- -0x35e,_0x55beef);}return{'workspaceId':this[_0x115f63(-0x2e1,-0x267)],'hasConfig':this['hasCustomDatabase'](),'configDetails':this[_0x115f63(-0x1de,-0x1ac)]?.['credentials']?{'host':this[_0x115f63(-0x181,-0x1ac)][_0x115f63(-0x243,-0x1d4)][_0x115f63(-0x1f5,-0x230)],'port':this['detectedConfig'][_0x115f63(-0x1f3,-0x1d4)][_0x115f63(-0x16f,-0x1e8)],'database':this['detectedConfig'][_0x115f63(-0x198,-0x1d4)][_0x115f63(-0x241,-0x224)],'schema':this[_0x115f63(-0x156,-0x1ac)][_0x115f63(-0x1fa,-0x1d4)]['schema']||_0x115f63(-0x18e,-0x1de),'sslEnabled':this['detectedConfig'][_0x115f63(-0x1a8,-0x1d4)][_0x115f63(-0x175,-0x185)]||![]}:undefined};}}class DatabaseClient{constructor(_0x17e20a,_0x25af0b){this['httpClient']=_0x17e20a,this['customDatabaseManager']=new CustomDatabaseManager(_0x17e20a,_0x25af0b);}['from'](_0x25b317){function _0x78ae68(_0x60069b,_0x3d1d82){return _0x1e97(_0x3d1d82- -0x1be,_0x60069b);}return new QueryBuilder(this['httpClient'],_0x25b317,this[_0x78ae68(-0x9c,-0x89)],this['customDatabaseManager'][_0x78ae68(-0x38,-0x86)]());}[_0x4bcf27(-0x277,-0x259)](_0x352a38,_0x114a7a){function _0x28cad8(_0x581532,_0x4dfb2a){return _0x1e97(_0x581532- -0x2a,_0x4dfb2a);}return this[_0x28cad8(0x170,0xf8)][_0x28cad8(0xee,0x16a)]('/rpc/'+_0x352a38,_0x114a7a);}['schema'](_0x544784){const _0x20d405=new DatabaseClient(this['httpClient'],this['customDatabaseManager']['getWorkspaceId']());_0x20d405[_0x406a6e(0x376,0x334)]=_0x544784;function _0x406a6e(_0x1e443c,_0x36bb69){return _0x1e97(_0x36bb69-0x1ff,_0x1e443c);}return _0x20d405['customDatabaseManager']=this[_0x406a6e(0x3e2,0x3f3)],_0x20d405;}async['detectCustomDatabase'](){return this['customDatabaseManager']['detectCustomDatabase']();}async['testCustomConnection'](_0x47e350){function _0x369a8b(_0x468f80,_0x1e7302){return _0x1e97(_0x468f80- -0x327,_0x1e7302);}return this[_0x369a8b(-0x133,-0xf6)][_0x369a8b(-0x1ec,-0x1d0)](_0x47e350);}async[_0x4bcf27(-0x252,-0x20e)](_0x29c3bb){function _0x736b39(_0xf304a6,_0x120497){return _0x1e97(_0x120497-0x288,_0xf304a6);}return this[_0x736b39(0x414,0x47c)][_0x736b39(0x39d,0x41a)](_0x29c3bb);}async['removeCustomDatabase'](){function _0x5dfafc(_0x4620b0,_0x370bde){return _0x1e97(_0x4620b0- -0x137,_0x370bde);}return this['customDatabaseManager'][_0x5dfafc(-0x38,-0xa6)]();}[_0x4bcf27(-0x2df,-0x30c)](){function _0x419227(_0x31379c,_0x6581eb){return _0x1e97(_0x6581eb-0xb3,_0x31379c);}return this[_0x419227(0x24b,0x2a7)][_0x419227(0x27c,0x21f)]();}['getCustomDatabaseStatus'](){function _0x353d72(_0x50c55a,_0x960305){return _0x1e97(_0x960305- -0x117,_0x50c55a);}return this[_0x353d72(0xb6,0xdd)]['getStatus']();}[_0x4bcf27(-0x20c,-0x18c)](_0x413635){function _0x52ade4(_0x3d363a,_0x1279d8){return _0x1e97(_0x3d363a-0x16e,_0x1279d8);}this[_0x52ade4(0x362,0x344)]['setWorkspaceId'](_0x413635);}async['initialize'](){function _0xfd5419(_0x1a3158,_0x5b5f99){return _0x1e97(_0x1a3158- -0x347,_0x5b5f99);}try{await this[_0xfd5419(-0x153,-0x16b)]['detectCustomDatabase']();}catch(_0x55cd05){console[_0xfd5419(-0x177,-0x15a)]('Failed to initialize custom database detection:',_0x55cd05);}}}class StorageBucket{constructor(_0x330dcf,bucketId){this[_0x22148a(-0xae,-0xc4)]=_0x330dcf;function _0x22148a(_0x53f90b,_0x5a38bb){return _0x1e97(_0x53f90b- -0x248,_0x5a38bb);}this['bucketId']=bucketId;}async[_0x4bcf27(-0x1f6,-0x248)](_0x523823,_0xd3d5d4,_0x1e4e0a){function _0x2e5353(_0x4516a5,_0x5d8009){return _0x1e97(_0x4516a5- -0x1e4,_0x5d8009);}try{const _0x342624=new FormData();if(_0xd3d5d4 instanceof File)_0x342624['append']('file',_0xd3d5d4);else{if(_0xd3d5d4 instanceof Blob)_0x342624[_0x2e5353(0x7,0x26)](_0x2e5353(-0xad,-0x4a),_0xd3d5d4,_0x523823);else{if(_0xd3d5d4 instanceof ArrayBuffer)_0x342624[_0x2e5353(0x7,0x1e)]('file',new Blob([_0xd3d5d4]),_0x523823);else typeof _0xd3d5d4==='string'&&_0x342624['append'](_0x2e5353(-0xad,-0x31),new Blob([_0xd3d5d4],{'type':'text/plain'}),_0x523823);}}_0x342624[_0x2e5353(0x7,0x4a)]('path',_0x523823);_0x1e4e0a?.['cacheControl']&&_0x342624[_0x2e5353(0x7,-0x3a)](_0x2e5353(-0xe6,-0x14a),_0x1e4e0a['cacheControl']);_0x1e4e0a?.[_0x2e5353(-0x9f,-0x112)]&&_0x342624[_0x2e5353(0x7,-0x70)](_0x2e5353(-0x9f,-0x8b),_0x1e4e0a[_0x2e5353(-0x9f,-0x1f)]);_0x1e4e0a?.['metadata']&&_0x342624['append']('metadata',JSON['stringify'](_0x1e4e0a[_0x2e5353(-0x40,-0x1)]));const _0x36820e='/storage/buckets/'+this[_0x2e5353(-0xc9,-0xc8)]+'/files'+(_0x1e4e0a?.[_0x2e5353(0x6,-0x3b)]?'?upsert=true':''),response=await this['httpClient'][_0x2e5353(-0xcc,-0x83)](_0x36820e,_0x342624,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x2e5353(-0x60,-0x6)],'error':null};}catch(_0x38ef23){return{'data':null,'error':_0x38ef23 instanceof EBaaSError?_0x38ef23:new EBaaSError(_0x38ef23 instanceof Error?_0x38ef23['message']:'Failed\x20to\x20upload\x20file',0x0,_0x38ef23)};}}async['download'](_0x33a4cd,_0x2fde01){function _0x2f4974(_0x5d3c6e,_0x2d77c4){return _0x1e97(_0x2d77c4- -0x1a6,_0x5d3c6e);}try{const _0xbc512d=new URLSearchParams();_0x2fde01?.['transform']&&Object['entries'](_0x2fde01[_0x2f4974(-0x9e,-0x34)])['forEach'](([_0x401660,_0x3ba7a8])=>{_0x3ba7a8!==undefined&&_0xbc512d['append'](_0x401660,String(_0x3ba7a8));});const _0xacf894='/storage/buckets/'+this[_0x2f4974(-0xb,-0x8b)]+'/files/'+_0x33a4cd+(_0xbc512d['toString']()?'?'+_0xbc512d['toString']():''),response=await this['httpClient']['get'](_0xacf894,{'responseType':'blob'});return{'data':response[_0x2f4974(0x1e,-0x22)],'error':null};}catch(_0x406b14){return{'data':null,'error':_0x406b14 instanceof EBaaSError?_0x406b14:new EBaaSError(_0x406b14 instanceof Error?_0x406b14[_0x2f4974(0x52,0x3f)]:'Failed\x20to\x20download\x20file',0x0,_0x406b14)};}}async[_0x4bcf27(-0x281,-0x2b2)](_0xb8e78a,_0x4d0e91){function _0x296c84(_0x477465,_0x323364){return _0x1e97(_0x477465- -0x35a,_0x323364);}try{const _0x437983=new URLSearchParams();_0xb8e78a&&_0x437983['append'](_0x296c84(-0x22a,-0x234),_0xb8e78a);_0x4d0e91?.['limit']&&_0x437983[_0x296c84(-0x16f,-0x176)](_0x296c84(-0x17e,-0x1d6),String(_0x4d0e91[_0x296c84(-0x17e,-0x1f5)]));_0x4d0e91?.['offset']&&_0x437983[_0x296c84(-0x16f,-0x174)](_0x296c84(-0x20b,-0x289),String(_0x4d0e91['offset']));_0x4d0e91?.[_0x296c84(-0x270,-0x256)]&&_0x437983['append']('sortBy',JSON[_0x296c84(-0x25a,-0x287)](_0x4d0e91['sortBy']));_0x4d0e91?.['search']&&_0x437983['append'](_0x296c84(-0x17f,-0x1d7),_0x4d0e91['search']);const _0x4a0a4f='/storage/buckets/'+this['bucketId']+'/files'+(_0x437983['toString']()?'?'+_0x437983['toString']():''),response=await this['httpClient']['get'](_0x4a0a4f);return{'data':response[_0x296c84(-0x1d6,-0x249)],'error':null};}catch(_0x464cb1){return{'data':null,'error':_0x464cb1 instanceof EBaaSError?_0x464cb1:new EBaaSError(_0x464cb1 instanceof Error?_0x464cb1['message']:_0x296c84(-0x1ea,-0x25a),0x0,_0x464cb1)};}}async['remove'](_0x354792){function _0x7cc89b(_0x52a249,_0xfccdde){return _0x1e97(_0x52a249- -0x30f,_0xfccdde);}try{const response=await this[_0x7cc89b(-0x175,-0xf6)]['delete']('/storage/buckets/'+this[_0x7cc89b(-0x1f4,-0x1e7)]+'/files',{'data':{'paths':_0x354792}});return{'data':response[_0x7cc89b(-0x18b,-0x125)],'error':null};}catch(_0x212b58){return{'data':null,'error':_0x212b58 instanceof EBaaSError?_0x212b58:new EBaaSError(_0x212b58 instanceof Error?_0x212b58[_0x7cc89b(-0x12a,-0x196)]:'Failed\x20to\x20remove\x20files',0x0,_0x212b58)};}}async[_0x4bcf27(-0x1fd,-0x278)](fromPath,_0x16f21d){function _0x1edd8d(_0x8a2b2c,_0x43557f){return _0x1e97(_0x43557f- -0x1b,_0x8a2b2c);}try{const response=await this['httpClient']['post']('/storage/buckets/'+this['bucketId']+_0x1edd8d(0x210,0x1a4),{'sourceKey':fromPath,'destinationKey':_0x16f21d});return{'data':response['data'],'error':null};}catch(_0x5e2101){return{'data':null,'error':_0x5e2101 instanceof EBaaSError?_0x5e2101:new EBaaSError(_0x5e2101 instanceof Error?_0x5e2101['message']:'Failed\x20to\x20move\x20file',0x0,_0x5e2101)};}}async[_0x4bcf27(-0x2a0,-0x261)](fromPath,_0x19c955){function _0x4dd2c6(_0x152434,_0x23afbb){return _0x1e97(_0x152434-0x318,_0x23afbb);}try{const response=await this['httpClient']['post'](_0x4dd2c6(0x48f,0x462)+this[_0x4dd2c6(0x433,0x47e)]+_0x4dd2c6(0x410,0x3ad),{'sourceKey':fromPath,'destinationKey':_0x19c955});return{'data':response[_0x4dd2c6(0x49c,0x500)],'error':null};}catch(_0x4f5bdb){return{'data':null,'error':_0x4f5bdb instanceof EBaaSError?_0x4f5bdb:new EBaaSError(_0x4f5bdb instanceof Error?_0x4f5bdb[_0x4dd2c6(0x4fd,0x504)]:'Failed\x20to\x20copy\x20file',0x0,_0x4f5bdb)};}}async['createSignedUrl'](_0x17dad9,_0xd25562,_0x1d440c){function _0x34c661(_0x5ab250,_0x20862e){return _0x1e97(_0x20862e- -0x3e4,_0x5ab250);}try{const response=await this['httpClient'][_0x34c661(-0x308,-0x2cc)]('/storage/buckets/'+this[_0x34c661(-0x27f,-0x2c9)]+'/files/'+_0x17dad9+'/sign',{'expiresIn':_0xd25562,..._0x1d440c});return{'data':response['data'],'error':null};}catch(_0x203cc3){return{'data':null,'error':_0x203cc3 instanceof EBaaSError?_0x203cc3:new EBaaSError(_0x203cc3 instanceof Error?_0x203cc3[_0x34c661(-0x1b2,-0x1ff)]:_0x34c661(-0x253,-0x28a),0x0,_0x203cc3)};}}[_0x4bcf27(-0x2d5,-0x293)](_0x28adb0,_0x3d696e){const _0x44d7d2=new URLSearchParams();function _0x1f7074(_0x32207e,_0x3417ea){return _0x1e97(_0x3417ea- -0x3de,_0x32207e);}_0x3d696e?.[_0x1f7074(-0x28c,-0x26c)]&&Object[_0x1f7074(-0x236,-0x29d)](_0x3d696e[_0x1f7074(-0x29c,-0x26c)])['forEach'](([_0x271e49,_0x9c9382])=>{function _0x33afe0(_0x16351a,_0x50dc98){return _0x1e97(_0x16351a- -0x309,_0x50dc98);}_0x9c9382!==undefined&&_0x44d7d2[_0x33afe0(-0x11e,-0xf1)](_0x271e49,String(_0x9c9382));});const _0x11218a=this[_0x1f7074(-0x216,-0x244)]['baseURL']||'',_0x5a66a6=_0x11218a+'/storage/buckets/'+this['bucketId']+'/files/'+_0x28adb0+(_0x44d7d2['toString']()?'?'+_0x44d7d2['toString']():'');return{'data':{'publicUrl':_0x5a66a6}};}async[_0x4bcf27(-0x2ab,-0x2a2)](_0x2bb478){function _0x21f384(_0x15e52f,_0x574386){return _0x1e97(_0x15e52f- -0x29b,_0x574386);}try{const response=await this[_0x21f384(-0x101,-0xce)]['get']('/storage/buckets/'+this['bucketId']+_0x21f384(-0x12d,-0xd6)+_0x2bb478+_0x21f384(-0x1ab,-0x123));return{'data':response['data'],'error':null};}catch(_0x4946aa){return{'data':null,'error':_0x4946aa instanceof EBaaSError?_0x4946aa:new EBaaSError(_0x4946aa instanceof Error?_0x4946aa['message']:_0x21f384(-0xf5,-0x17d),0x0,_0x4946aa)};}}async['updateFileMetadata'](_0x3a4540,metadata){function _0x469047(_0x2316c5,_0x369d1d){return _0x1e97(_0x369d1d- -0x3db,_0x2316c5);}try{const response=await this['httpClient']['put'](_0x469047(-0x25b,-0x264)+this['bucketId']+'/files/'+_0x3a4540+'/metadata',{'metadata':metadata});return{'data':response['data'],'error':null};}catch(_0x142d0f){return{'data':null,'error':_0x142d0f instanceof EBaaSError?_0x142d0f:new EBaaSError(_0x142d0f instanceof Error?_0x142d0f[_0x469047(-0x19b,-0x1f6)]:_0x469047(-0x2bc,-0x2c7),0x0,_0x142d0f)};}}}class StorageClient{constructor(_0x70bc8){function _0x34ecf5(_0x513893,_0x5813cb){return _0x1e97(_0x513893-0x3b4,_0x5813cb);}this[_0x34ecf5(0x54e,0x58a)]=_0x70bc8;}[_0x4bcf27(-0x23f,-0x284)](bucketId){function _0x444113(_0x797eef,_0x1c7e5e){return _0x1e97(_0x1c7e5e- -0x24f,_0x797eef);}return new StorageBucket(this[_0x444113(-0x123,-0xb5)],bucketId);}async['createBucket'](_0x1f7f90,_0xa57d4a){function _0x44d64a(_0x411cdc,_0x3f9b84){return _0x1e97(_0x3f9b84-0x3b5,_0x411cdc);}try{const response=await this[_0x44d64a(0x571,0x54f)][_0x44d64a(0x4ae,0x4cd)]('/storage/buckets',{'id':_0x1f7f90,..._0xa57d4a});return{'data':response['data'],'error':null};}catch(_0x41e3b7){return{'data':null,'error':_0x41e3b7 instanceof EBaaSError?_0x41e3b7:new EBaaSError(_0x41e3b7 instanceof Error?_0x41e3b7['message']:'Failed\x20to\x20create\x20bucket',0x0,_0x41e3b7)};}}async[_0x4bcf27(-0x22b,-0x24c)](_0x3e187b){function _0x3f1f5e(_0x4dd790,_0x5f5840){return _0x1e97(_0x5f5840-0x2f1,_0x4dd790);}try{const response=await this[_0x3f1f5e(0x480,0x48b)]['get'](_0x3f1f5e(0x46b,0x468)+_0x3e187b);return{'data':response[_0x3f1f5e(0x49a,0x475)],'error':null};}catch(_0x2652d4){return{'data':null,'error':_0x2652d4 instanceof EBaaSError?_0x2652d4:new EBaaSError(_0x2652d4 instanceof Error?_0x2652d4[_0x3f1f5e(0x508,0x4d6)]:_0x3f1f5e(0x3e5,0x3e7),0x0,_0x2652d4)};}}async['listBuckets'](){function _0x1f089e(_0x497e73,_0x378fbd){return _0x1e97(_0x497e73-0x33f,_0x378fbd);}try{const response=await this['httpClient'][_0x1f089e(0x51f,0x555)]('/storage/buckets');return{'data':response[_0x1f089e(0x4c3,0x512)],'error':null};}catch(_0x497f8c){return{'data':null,'error':_0x497f8c instanceof EBaaSError?_0x497f8c:new EBaaSError(_0x497f8c instanceof Error?_0x497f8c[_0x1f089e(0x524,0x4c8)]:_0x1f089e(0x530,0x56f),0x0,_0x497f8c)};}}async['updateBucket'](_0x4c2855,_0xa9d043){function _0xb2df81(_0x575e96,_0x21010a){return _0x1e97(_0x21010a-0x206,_0x575e96);}try{const response=await this['httpClient'][_0xb2df81(0x418,0x3a2)]('/storage/buckets/'+_0x4c2855,_0xa9d043);return{'data':response[_0xb2df81(0x3c2,0x38a)],'error':null};}catch(_0x7026c3){return{'data':null,'error':_0x7026c3 instanceof EBaaSError?_0x7026c3:new EBaaSError(_0x7026c3 instanceof Error?_0x7026c3[_0xb2df81(0x46a,0x3eb)]:'Failed\x20to\x20update\x20bucket',0x0,_0x7026c3)};}}async['deleteBucket'](_0x532e34){function _0xc55dae(_0x124c0b,_0x13be33){return _0x1e97(_0x124c0b-0x336,_0x13be33);}try{const response=await this[_0xc55dae(0x4d0,0x517)]['delete'](_0xc55dae(0x4ad,0x446)+_0x532e34);return{'data':response['data'],'error':null};}catch(_0x3deb7e){return{'data':null,'error':_0x3deb7e instanceof EBaaSError?_0x3deb7e:new EBaaSError(_0x3deb7e instanceof Error?_0x3deb7e[_0xc55dae(0x51b,0x4ee)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x3deb7e)};}}async['getUsage'](){function _0x5e5742(_0x3eeaf3,_0x1c9107){return _0x1e97(_0x3eeaf3-0x204,_0x1c9107);}try{const response=await this['httpClient']['get']('/storage/usage');return{'data':response[_0x5e5742(0x388,0x3ac)],'error':null};}catch(_0x1f2905){return{'data':null,'error':_0x1f2905 instanceof EBaaSError?_0x1f2905:new EBaaSError(_0x1f2905 instanceof Error?_0x1f2905[_0x5e5742(0x3e9,0x460)]:'Failed\x20to\x20get\x20storage\x20usage',0x0,_0x1f2905)};}}}function _0x5df5(){const _0x43cb85=['BM9Kzq','zxjYB3i','DxbKyxrLt3b0Aw9UCW','zxHLy3v0zvf1zxj5','ChjLzMvY','yM9KEq','AM9PBMvK','ChvZAa','AgfZq3vZDg9Trgf0ywjHC2u','CNbJ','l2zPBgvZlW','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','rMfPBgvKihrVigXPC3qGzMLSzxm','C2vUza','DhjHBNnMB3jT','Cg9ZDgDYzxneyxrHyMfZzq','z2v0twv0CMLJCW','CMfUzg9T','Cg9YDa','l3n0B3jHz2uVyNvJA2v0CY8','Cg9ZDgDYzxnFy2HHBMDLCW','B25qB3n0z3jLC0nOyw5Nzxm','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','CxvLCNK','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','x3jLAM9PBG','CMvTB3zLq2HHBM5LBa','mZa0mta1nwfLDgTiCa','ChvIBgLJ','z2v0u2vZC2LVBG','zxjYB3jLza','ndu3mti1sM10wvjv','zgf0yq','C3vIC2nYAxb0Aw9UCW','Ec10B3rHBc1JB3vUDa','yxnJzw5KAw5N','zxHLy3v0zq','ms4XlJG','y3jLzgvUDgLHBhm','Dw5ZDwjZy3jPyMu','z3rL','l2f1DgGVDJeVC2rRl3nPz25PBG','C3rHDgu','y29TBw9U','y29UBMvJDgLUzW','Cg9ZDgDYzxnFy2HHBMDLCZO','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','CMvHBhrPBwu','y2HHBM5LBa','l2f1DgGVDJeVC2LNBM91Da','C3rHy2S','mta3mLPSA2LKvq','y29UBMvJDf9LCNjVCG','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','Ahr0CenSAwvUDa','DxbKyxrL','Chv0','CMvJB25Uzwn0','CgfYC2u','z2XVyMfS','zMLSDgvYCW','Bgv2zwW','C2vZC2LVBG','CMvMCMvZAf90B2TLBG','Bwv0ywrHDge','zNjVBq','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','zxzLBNrZ','DxbKyxrLvxnLCG','C2v0qxv0AfrVA2vU','x2PVAw4','Bg9HzfnLC3nPB24','CgvYAw9K','p29WzxjHDgLVBJ11ChnLCNq','Aw1WB3j0twfW','AxndB25Uzwn0zwq','AM9PBG','AwXPA2u','zgv0zwn0zwrdB25MAwC','z2v0twf4tgLZDgvUzxjZ','B3b0Aw9UCW','y29Kzq','DMfSDwvZ','Cg9ZDgDYzxnty2HLBwe','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','z2v0qNvJA2v0','mtqWnZntzhHezvi','CMvHy3qTBMf0AxzL','DxnLCG','DMvYAwz5','Aw5PDgLHBgL6zq','l2zPBgvZl21VDMu','zgv0ywLSCW','B3bLCMf0B3i','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','zw1PDa','AgfUzgXLqxv0AevYCM9Y','y29SDw1U','C3rHDhvZ','Bg9N','AgfUzgXLrxjYB3i','lMfZyW','y2fWDhvYzvn0ywnRvhjHy2u','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbTzxrYAwnZ','C2v0','igf0DgvTChrZoIa','C2LNBK91Da','rNvUy3rPB24GAw52B2nHDgLVBIbMywLSzwq','D2fYBG','DgLTzw91Da','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','u29JA2v0lMLVlwnSAwvUDcbUW6nVigvZDmoHigrPC3bVBSoTDMvSlIbqyxjHifjLywn0ie5HDgL2zsWGAw5ZDgfSztOGBNbTigLUC3rHBgWGC29JA2v0lMLVlwnSAwvUDa','zgf0yufYCMf5','B2zM','mJbXsvD5wwm','DxnL','C2v0v29YA3nWywnLswq','C3nSrw5HyMXLza','B3bLCMf0Aw9U','C2vHCMnO','BgLTAxq','AgvHzgvYCW','l21LDhjPy3m','z2v0tg9NCW','z2v0','rujHyvnfCNjVCG','y2XVC2vK','CMvWBgfJzq','C2L6zq','BwvZC2fNzq','C2nOzw1H','Bw92zq','y29UDgfPBNm','BMfTzq','DxbZzxj0','yxbWzw5K','zwjHyxmUyxv0Ac5ZzxnZAw9U','BgvHDMLUzW','DxbSB2fK','BMvX','C2v0sxrLBq','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','C2v0u2vZC2LVBKLUDgvYBMfS','BgvHDMu','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','BgLZDgvUzxjZ','zgLZy29UBMvJDa','DhjHy2S','z2v0u3rHDhvZ','zgvSzxrL','BwfRzvjLzG','C29YDej5','AM9PBMvKt25Jzq','AgfZ','Dw50CMfJAW','mZK1otvVDe11y3O','BwfW','l2LUzM8','zgvMyxvSDhm','yNjVywrJyxn0','mte3mMfXsu5Tta','Aw5KzxGUDhm','vw5ZDxbWB3j0zwqGsfruucbTzxrOB2q6ia','rMfPBgvKihrVigDLDcbIDwnRzxq','D29YA3nWywnLswq','l2zPBgvZl2nVChK','BgLRzq','B25dB25Uzwn0Aw9Uu3rHDgvdAgfUz2u','yNvJA2v0','C3rYAw5N','ntyYoen5q1jAzW','y2fJAgvdB250CM9S','CMvTB3zLq3vZDg9Trgf0ywjHC2u','C3rYAw5NAwz5','C29JA2v0lMLVlwnSAwvUDcbUB3qGyxzHAwXHyMXL','y2XPzw50','y29UzMLN','mJaZnZm1mg5vD0HmDW','AxnvC2LUz0n1C3rVBurHDgfIyxnL','CMvTB3zLqxv0AfrVA2vU','zgvWBg95','AM9PBMLUzW','BgvUz3rO','y29UBMvJDa','u29JA2v0lMLVlwnSAwvUDcbUW6nVigvZDmoHigrPC3bVBSoTDMvSig5LC3rLigfTyMLLBNrLlIbqyxjHihvZyxiGzNvUy2LVBMfSAwrHzgvZigrLihjLywX0Aw1LlcbPBNn0ywXLoIbUCg0GAw5ZDgfSBcbZB2nRzxqUAw8Ty2XPzw50','CMvZB2X2zq','DxjS','Aw52B2TL','z2v0uhvIBgLJvxjS','mJrht3jzu2K','z2v0q2HHBM5LBhm','DMvYC2LVBNm','Cg9ZDgDYzxniB3n0','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','uhjLzMvY','Aw50zxjJzxb0B3jZ','Dgv4Dc9WBgfPBG','Cg9ZDa','BxvSDgLWyxj0l2zVCM0Tzgf0yq','l3nKAY92ms8','yNvJA2v0swq','yxbPs2v5','Dg9ku09o','y29UBMvJDgvK','AgvHCNrIzwf0sw50zxj2ywW','CMvQzwn0','Dw5KzwzPBMvK','z2v0rgv0zwn0zwrdB25MAwC','Dg9WAwm','CMvZCg9UC2u','zw50CNLWB2LUDa','zgLZy29UBMvJDgvK','DxbKyxrLrw52','l2f1DgGVDJeVCMvMCMvZAa','Dg9tDhjPBMC','Bwf4tgLZDgvUzxjZ','l2XVz3m','C2v0DxbjBNrLCMnLChrVCNm','B3jKzxi','Ag9ZDa','y2HHBM5LBhm','ChjLzML4','C3rHCNrZv2L0Aa','zM9YrwfJAa','B25Jzq','l2z1BMn0Aw9UCY92ms8','y3vYCMvUDfnJAgvTyq','mta4nNLfzwHuBW','zMLSzq','z2v0v29YA3nWywnLswq','z2v0rMLSzuLUzM8','zgf0ywjHC2u','DgvZDenVBM5Ly3rPB24','C29JA2v0lMLVlwnSAwvUDa','yNjVywrJyxn0oG','zw52','y2XLyxi','z2v0vxnLCG','zw50CMLLCW','DgfIBgu','C2vSzwn0','y29WEq','y29UDgvUDfr5Cgu','Cg9ZDgDYzxnqB3j0','CMfUz2u','l2f1DgGVDJeVCMvZzxqTCgfZC3DVCMq','y29UBMvJDgLVBLn0yxrL','y3vYCMvUDfnLC3nPB24','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','C29JA2v0qwrHChrLCG','mtCYnZGZotnlzNbQv3u','B2zMC2v0','C2v0u2vZC2LVBG','ChjLC2vUy2u6','Cgf0y2G','ChjLCgvUzeXPC3rLBMvY','yMfZzvvsta','CMf3tgLZDgvUzxjZ','C29JA2v0','lMrLC2m','x3nLDfn0yxrL','ChjLC2vUy2u','rMfPBgvKihrVignYzwf0zsbZAwDUzwqGvvjm','zxzLBNq','p29WzxjHDgLVBJ1ZzwXLy3q','y2XLyxjtzxnZAw9U','C29JA2v0t3b0Aw9UCW','ChjLCgvUze9Uy2vmAxn0zw5LCG','AxnezwXLDgu','x3rYAwDNzxi','u1vcu0nssujfra','BgLZDa'];_0x5df5=function(){return _0x43cb85;};return _0x5df5();}function _0x1e97(_0x1256b1,_0x3bacd6){const _0x5df500=_0x5df5();return _0x1e97=function(_0x1e9716,_0x4589a7){_0x1e9716=_0x1e9716-0xe5;let _0x177aed=_0x5df500[_0x1e9716];if(_0x1e97['JRHTFw']===undefined){var _0x693b3f=function(_0x10db32){const _0x1fb62e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x481f57='',_0xe911a0='';for(let _0x26cd03=0x0,_0x12d93d,_0x12c9e4,_0x52f10c=0x0;_0x12c9e4=_0x10db32['charAt'](_0x52f10c++);~_0x12c9e4&&(_0x12d93d=_0x26cd03%0x4?_0x12d93d*0x40+_0x12c9e4:_0x12c9e4,_0x26cd03++%0x4)?_0x481f57+=String['fromCharCode'](0xff&_0x12d93d>>(-0x2*_0x26cd03&0x6)):0x0){_0x12c9e4=_0x1fb62e['indexOf'](_0x12c9e4);}for(let _0x4655aa=0x0,_0x5c1c4e=_0x481f57['length'];_0x4655aa<_0x5c1c4e;_0x4655aa++){_0xe911a0+='%'+('00'+_0x481f57['charCodeAt'](_0x4655aa)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xe911a0);};_0x1e97['edwsyl']=_0x693b3f,_0x1256b1=arguments,_0x1e97['JRHTFw']=!![];}const _0x12bbe6=_0x5df500[0x0],_0x258443=_0x1e9716+_0x12bbe6,_0x507cff=_0x1256b1[_0x258443];return!_0x507cff?(_0x177aed=_0x1e97['edwsyl'](_0x177aed),_0x1256b1[_0x258443]=_0x177aed):_0x177aed=_0x507cff,_0x177aed;},_0x1e97(_0x1256b1,_0x3bacd6);}class EventManager{constructor(){function _0x27ba21(_0x21af30,_0x10b2a2){return _0x1e97(_0x10b2a2- -0x2a2,_0x21af30);}this['events']=new Map(),this[_0x27ba21(-0x1e0,-0x178)]=0xa;}['on'](_0x2614f8,_0x49f56f){!this[_0xe8db23(-0x87,-0xb3)][_0xe8db23(-0x10d,-0x16e)](_0x2614f8)&&this['events'][_0xe8db23(-0x110,-0x8e)](_0x2614f8,new Set());function _0xe8db23(_0x5478d6,_0x1a16db){return _0x1e97(_0x1a16db- -0x25a,_0x5478d6);}this[_0xe8db23(-0x48,-0xb3)][_0xe8db23(-0x60,-0x7a)](_0x2614f8)['add'](_0x49f56f);}[_0x4bcf27(-0x20f,-0x258)](_0x3302a0,_0x3fcdd9){if(!this[_0x641eba(0x2e6,0x28d)][_0x641eba(0x1d7,0x1d2)](_0x3302a0))return;function _0x641eba(_0xd142be,_0x546948){return _0x1e97(_0x546948-0xe6,_0xd142be);}const _0x79106f=this['events']['get'](_0x3302a0);_0x3fcdd9?_0x79106f[_0x641eba(0x181,0x1ce)](_0x3fcdd9):_0x79106f[_0x641eba(0x294,0x225)](),_0x79106f[_0x641eba(0x26a,0x2ca)]===0x0&&this[_0x641eba(0x252,0x28d)][_0x641eba(0x1ac,0x1ce)](_0x3302a0);}['emit'](_0x4c007c,..._0x5bc328){if(!this[_0x5c7383(0x23f,0x2c3)][_0x5c7383(0x18b,0x208)](_0x4c007c))return![];function _0x5c7383(_0x2c051a,_0x45ecd4){return _0x1e97(_0x45ecd4-0x11c,_0x2c051a);}const _0x22e2a8=this['events'][_0x5c7383(0x2d5,0x2fc)](_0x4c007c);for(const _0x533c1b of _0x22e2a8){try{_0x533c1b(..._0x5bc328);}catch(_0x2601c8){console[_0x5c7383(0x22c,0x281)]('Error\x20in\x20event\x20listener\x20for\x20\x22'+_0x4c007c+'\x22:',_0x2601c8);}}return _0x22e2a8['size']>0x0;}['removeAllListeners'](_0x8d5bb3){_0x8d5bb3?this['events']['delete'](_0x8d5bb3):this['events']['clear']();}['listenerCount'](_0x186569){function _0x489464(_0xe6de31,_0x1389b1){return _0x1e97(_0xe6de31- -0x393,_0x1389b1);}return this[_0x489464(-0x1ec,-0x164)]['get'](_0x186569)?.['size']??0x0;}['eventNames'](){function _0x4dfbdb(_0x252b29,_0x34a3cb){return _0x1e97(_0x252b29- -0x21,_0x34a3cb);}return Array['from'](this[_0x4dfbdb(0x186,0x1a6)]['keys']());}[_0x4bcf27(-0x1ef,-0x249)](_0x18f594){function _0x20060a(_0x55c6b8,_0x53d536){return _0x1e97(_0x53d536-0x2af,_0x55c6b8);}return Array['from'](this['events'][_0x20060a(0x406,0x48f)](_0x18f594)??[]);}['addListener'](_0xa10ef2,_0x173863){this['on'](_0xa10ef2,_0x173863);}['removeListener'](_0x59bd16,_0x4fddf8){function _0x1f7f72(_0x5ce929,_0x18ee55){return _0x1e97(_0x18ee55-0x124,_0x5ce929);}this[_0x1f7f72(0x296,0x2f9)](_0x59bd16,_0x4fddf8);}[_0x4bcf27(-0x2b1,-0x321)](_0x5ca79b,_0x10176d){const _0xb39156=(..._0x298c12)=>{this['off'](_0x5ca79b,_0xb39156),_0x10176d(..._0x298c12);};this['on'](_0x5ca79b,_0xb39156);}[_0x4bcf27(-0x291,-0x283)](_0x11344a,_0x2c68a0){this['on'](_0x11344a,_0x2c68a0);}[_0x4bcf27(-0x285,-0x291)](_0x18d7ac,_0x360d16){const _0x2fc9cd=(..._0xbe3615)=>{this[_0x56995f(-0x72,-0xb3)](_0x18d7ac,_0x2fc9cd);function _0x56995f(_0x598a6e,_0x4d4a94){return _0x1e97(_0x4d4a94- -0x288,_0x598a6e);}_0x360d16(..._0xbe3615);};this['on'](_0x18d7ac,_0x2fc9cd);}['setMaxListeners'](_0x4d87e0){return this['maxListeners']=_0x4d87e0,this;}[_0x4bcf27(-0x231,-0x285)](){return this['maxListeners'];}[_0x4bcf27(-0x28f,-0x305)](_0x43f66a){function _0x3799bc(_0x5d690e,_0x3e5e97){return _0x1e97(_0x5d690e-0x173,_0x3e5e97);}return this[_0x3799bc(0x368,0x348)](_0x43f66a);}}class RealtimeChannel extends EventManager{constructor(_0x7adbd2,_0x5b14c9){super(),this['joinedOnce']=![],this['state']=_0x35fc1f(-0xcc,-0xab),this[_0x35fc1f(-0x129,-0x113)]=new Map(),this[_0x35fc1f(-0x18b,-0x1e3)]=_0x7adbd2;function _0x35fc1f(_0x2f1049,_0x123a31){return _0x1e97(_0x2f1049- -0x2ae,_0x123a31);}this['socket']=_0x5b14c9;}['subscribe'](_0x2d1d78){!this[_0x8ed3b6(-0x231,-0x253)]&&(this[_0x8ed3b6(-0x231,-0x296)]=!![],this['_join']());_0x2d1d78&&this['on']('status',_0x2d1d78);function _0x8ed3b6(_0x8dbf7c,_0x5662cc){return _0x1e97(_0x8dbf7c- -0x31c,_0x5662cc);}return this;}[_0x4bcf27(-0x26b,-0x249)](filter,_0x2f09d0){const _0x40dd05=_0x155c6b(0x2e3,0x296)+JSON[_0x155c6b(0x252,0x1e7)](filter);this['on'](_0x40dd05,_0x2f09d0);const _0x553830={'unsubscribe':()=>{function _0x5a01cc(_0x1ffa14,_0x34d8de){return _0x1e97(_0x34d8de- -0x1b0,_0x1ffa14);}this[_0x5a01cc(0x9f,0x25)](_0x40dd05,_0x2f09d0),this[_0x5a01cc(0x26,-0x2b)]['delete'](_0x40dd05);}};function _0x155c6b(_0x27287b,_0xa57598){return _0x1e97(_0x27287b-0x152,_0xa57598);}return this[_0x155c6b(0x2d7,0x339)][_0x155c6b(0x31e,0x36c)](_0x40dd05,_0x553830),this[_0x155c6b(0x2a8,0x28b)]?.[_0x155c6b(0x270,0x2c5)]&&this['state']===_0x155c6b(0x2bc,0x317)&&this['socket'][_0x155c6b(0x315,0x330)]('subscribe_postgres_changes',{'topic':this[_0x155c6b(0x275,0x29b)],'filter':filter,'ref':this['makeRef']()}),_0x553830;}['onBroadcast'](filter,_0x44a58d){const _0x2e7e1a=_0x5b5215(-0x135,-0xcd)+JSON[_0x5b5215(-0x14b,-0x10a)](filter);function _0x5b5215(_0x1c1541,_0x50a384){return _0x1e97(_0x50a384- -0x20a,_0x1c1541);}this['on'](_0x2e7e1a,_0x44a58d);const _0x33b839={'unsubscribe':()=>{this['off'](_0x2e7e1a,_0x44a58d);function _0x3fcf54(_0x802571,_0x453896){return _0x1e97(_0x453896- -0x224,_0x802571);}this['subscriptions'][_0x3fcf54(-0x14d,-0x13c)](_0x2e7e1a);}};return this['subscriptions'][_0x5b5215(-0x5e,-0x3e)](_0x2e7e1a,_0x33b839),_0x33b839;}['onPresence'](filter,_0x100f51){const _0xa6fdf3=_0xf0ae25(0x239,0x24f)+JSON[_0xf0ae25(0x1b6,0x1fe)](filter);this['on'](_0xa6fdf3,_0x100f51);const _0x15c269={'unsubscribe':()=>{this[_0x49396d(0x28b,0x27d)](_0xa6fdf3,_0x100f51);function _0x49396d(_0x382524,_0x3432fb){return _0x1e97(_0x3432fb-0xa8,_0x382524);}this['subscriptions'][_0x49396d(0x1a4,0x190)](_0xa6fdf3);}};this['subscriptions']['set'](_0xa6fdf3,_0x15c269);function _0xf0ae25(_0x312be0,_0x48aeb5){return _0x1e97(_0x48aeb5-0xfe,_0x312be0);}return _0x15c269;}[_0x4bcf27(-0x273,-0x29a)](_0x4c37ba){return new Promise(_0x53992f=>{function _0x1de3e1(_0x19b39e,_0x41cadc){return _0x1e97(_0x41cadc-0x101,_0x19b39e);}this[_0x1de3e1(0x25f,0x257)]?.[_0x1de3e1(0x25b,0x21f)]&&this['state']==='joined'?(this[_0x1de3e1(0x2c4,0x257)][_0x1de3e1(0x336,0x2c4)]('broadcast',{'topic':this[_0x1de3e1(0x2a1,0x224)],'event':_0x4c37ba[_0x1de3e1(0x243,0x25c)],'payload':_0x4c37ba,'ref':this['makeRef']()}),_0x53992f('ok')):_0x53992f('error');});}[_0x4bcf27(-0x2fe,-0x284)](_0x5750d2){return new Promise(_0x3d4669=>{function _0x31f720(_0x1ab698,_0x310ac0){return _0x1e97(_0x310ac0- -0x2b4,_0x1ab698);}this[_0x31f720(-0x11f,-0x15e)]?.[_0x31f720(-0x198,-0x196)]&&this[_0x31f720(-0x18e,-0x126)]==='joined'?(this[_0x31f720(-0x1da,-0x15e)][_0x31f720(-0xb0,-0xf1)]('presence',{'topic':this['topic'],'event':'track','payload':_0x5750d2,'ref':this['makeRef']()}),_0x3d4669('ok')):_0x3d4669('error');});}[_0x4bcf27(-0x2f7,-0x334)](){return new Promise(_0x5a3f49=>{function _0x1fac05(_0x5b5958,_0x386849){return _0x1e97(_0x386849-0x139,_0x5b5958);}this[_0x1fac05(0x2b8,0x28f)]?.['connected']&&this['state']===_0x1fac05(0x311,0x2a3)?(this[_0x1fac05(0x2a9,0x28f)][_0x1fac05(0x2c4,0x2fc)](_0x1fac05(0x2ca,0x292),{'topic':this['topic'],'event':_0x1fac05(0x290,0x226),'ref':this[_0x1fac05(0x292,0x222)]()}),_0x5a3f49('ok')):_0x5a3f49('error');});}[_0x4bcf27(-0x259,-0x26e)](){return new Promise(_0x3f9676=>{this[_0x4bc7dd(-0x1ca,-0x19c)]='leaving',this['subscriptions']['forEach'](_0x12ee5c=>{function _0x345cf6(_0x2dcd2e,_0x171e9a){return _0x1e97(_0x171e9a- -0x234,_0x2dcd2e);}_0x12ee5c[_0x345cf6(-0xd7,-0xa9)]();}),this[_0x4bc7dd(-0x219,-0x1a5)]['clear']();this['socket']?.[_0x4bc7dd(-0x227,-0x20c)]&&this['socket'][_0x4bc7dd(-0x155,-0x167)](_0x4bc7dd(-0x1b1,-0x137),{'topic':this['topic'],'ref':this['makeRef']()});this[_0x4bc7dd(-0x1d6,-0x19c)]=_0x4bc7dd(-0x195,-0x148);function _0x4bc7dd(_0x30023f,_0x30f2b6){return _0x1e97(_0x30f2b6- -0x32a,_0x30023f);}this['removeAllListeners'](),_0x3f9676('ok');});}[_0x4bcf27(-0x23a,-0x2a9)](){function _0x28c461(_0xbd634f,_0x292e28){return _0x1e97(_0xbd634f-0x42,_0x292e28);}if(this['state']===_0x28c461(0x22f,0x200))return;this['state']='joining',this[_0x28c461(0x198,0x18f)]?.[_0x28c461(0x160,0x149)]&&(this['socket']['emit'](_0x28c461(0x1f2,0x1dd),{'topic':this['topic'],'ref':this['makeRef']()}),setTimeout(()=>{function _0x49332e(_0x5e8a2a,_0x55a25c){return _0x1e97(_0x5e8a2a-0x324,_0x55a25c);}this['state']===_0x49332e(0x42c,0x3e1)&&(this['state']='joined',this['emit'](_0x49332e(0x4ea,0x480),_0x49332e(0x486,0x45a)));},0x64));}[_0x4bcf27(-0x267,-0x2ca)](){function _0x55d38e(_0x282c6e,_0x508d9c){return _0x1e97(_0x508d9c- -0x1b9,_0x282c6e);}this['joinedOnce']&&(this[_0x55d38e(-0x47,-0xf)](),this['subscriptions']['forEach']((_0x3f93bf,_0x1a901e)=>{function _0x3252bf(_0x4b5e4b,_0x3b4069){return _0x1e97(_0x3b4069- -0x16f,_0x4b5e4b);}if(_0x1a901e[_0x3252bf(-0x85,-0x3e)]('postgres_changes:')){const filter=JSON[_0x3252bf(0xe,0x2f)](_0x1a901e[_0x3252bf(0x13,0x74)](_0x3252bf(-0x47,0x22),''));this[_0x3252bf(0x52,-0x19)]?.['emit'](_0x3252bf(-0x9,0x53),{'topic':this['topic'],'filter':filter,'ref':this[_0x3252bf(-0xd,-0x86)]()});}}));}['_trigger'](_0x31b1bd,_0x4f43ee){if(_0x31b1bd===_0x54f34c(-0x1e5,-0x26a)){const _0x3ccf5f=_0x54f34c(-0x1ed,-0x251)+JSON[_0x54f34c(-0x268,-0x2e2)](_0x4f43ee['filter']||{});this['emit'](_0x3ccf5f,_0x4f43ee);}else{if(_0x31b1bd==='broadcast'){const _0x25dd41='broadcast:'+JSON['stringify']({'event':_0x4f43ee[_0x54f34c(-0x264,-0x287)]});this[_0x54f34c(-0x1fc,-0x21f)](_0x25dd41,_0x4f43ee);}else{if(_0x31b1bd==='presence'){const _0xead4f3=_0x54f34c(-0x294,-0x291)+JSON[_0x54f34c(-0x342,-0x2e2)]({'event':_0x4f43ee['event']});this[_0x54f34c(-0x20f,-0x21f)](_0xead4f3,_0x4f43ee);}}}function _0x54f34c(_0x565d9d,_0x229b29){return _0x1e97(_0x229b29- -0x3e2,_0x565d9d);}this[_0x54f34c(-0x197,-0x21f)](_0x31b1bd,_0x4f43ee);}[_0x4bcf27(-0x28c,-0x312)](_0x196b5b){this['state']=_0x196b5b;let status;function _0x20c606(_0x56480d,_0x3b5c05){return _0x1e97(_0x56480d-0x332,_0x3b5c05);}switch(_0x196b5b){case _0x20c606(0x49c,0x420):status='SUBSCRIBED';break;case _0x20c606(0x4b4,0x4df):status='CHANNEL_ERROR';break;case _0x20c606(0x514,0x4a1):status='CLOSED';break;default:return;}this[_0x20c606(0x4f5,0x4e2)]('status',status);}[_0x4bcf27(-0x2fb,-0x298)](){function _0x1dd50c(_0x738616,_0x33c612){return _0x1e97(_0x33c612- -0xd2,_0x738616);}return Math[_0x1dd50c(0x2c,0xa3)]()['toString'](0x24)['substring'](0x2,0xf);}['getState'](){function _0x408744(_0x22c408,_0x3dde82){return _0x1e97(_0x3dde82-0x352,_0x22c408);}return this[_0x408744(0x45e,0x4e0)];}}function getEnvironment(){if(typeof navigator!==_0x251394(0x45f,0x4bf)&&navigator['product']==='ReactNative')return _0x251394(0x527,0x559);if(typeof window!=='undefined'&&typeof document!==_0x251394(0x48e,0x4bf))return'browser';function _0x251394(_0x353a1b,_0x44a729){return _0x1e97(_0x44a729-0x39e,_0x353a1b);}if(typeof global!==_0x251394(0x451,0x4bf)&&typeof process!==_0x251394(0x44c,0x4bf)&&process[_0x251394(0x49c,0x4b0)]?.[_0x251394(0x499,0x502)])return'node';return'browser';}function isSocketIOAvailable(){function _0x40aaeb(_0x16d91c,_0x1878ae){return _0x1e97(_0x1878ae-0x1c5,_0x16d91c);}try{const _0x9d98a2=getEnvironment();switch(_0x9d98a2){case _0x40aaeb(0x32b,0x329):return typeof require!=='undefined'&&require[_0x40aaeb(0x2ae,0x2d1)]&&!!require[_0x40aaeb(0x350,0x2d1)]('socket.io-client');case'browser':if(typeof globalThis!==_0x40aaeb(0x369,0x2e6)&&'io'in globalThis)return!![];return typeof require!=='undefined'&&require[_0x40aaeb(0x2c6,0x2d1)]&&!!require[_0x40aaeb(0x272,0x2d1)]('socket.io-client');case'react-native':try{return typeof require!==_0x40aaeb(0x29b,0x2e6)&&!!require('socket.io-client');}catch{return![];}default:return![];}}catch{return![];}}function getSocketIO(){function _0x11f852(_0x998979,_0x200792){return _0x1e97(_0x200792- -0xb9,_0x998979);}try{if(typeof require!==_0x11f852(0xc2,0x68))return require(_0x11f852(0x1c,0x83));if(typeof globalThis!==_0x11f852(0x62,0x68)&&'io'in globalThis)return{'io':globalThis['io']};throw new Error(_0x11f852(0x62,0x48));}catch(_0x3eaef7){throw new Error(_0x11f852(0xae,0x52));}}class WebSocketAdapter{constructor(){function _0x35a3a2(_0x5c1353,_0x2e45cf){return _0x1e97(_0x5c1353-0x21a,_0x2e45cf);}this[_0x35a3a2(0x370,0x3b9)]=null;}async['connect'](_0x453c16,_0x2da356){if(!isSocketIOAvailable())throw new Error('Socket.io-client não está disponível. Para usar funcionalidades de realtime, instale: npm install socket.io-client');const {io:_0x54dafb}=getSocketIO();return new Promise((_0x1b5cb3,_0x54002c)=>{function _0x3b8def(_0x46c47b,_0xa71522){return _0x1e97(_0xa71522-0x2b4,_0x46c47b);}this[_0x3b8def(0x402,0x40a)]=_0x54dafb(_0x453c16,_0x2da356),this[_0x3b8def(0x3a3,0x40a)]['on'](_0x3b8def(0x38a,0x3be),()=>_0x1b5cb3()),this['socket']['on']('connect_error',_0x36087a=>_0x54002c(_0x36087a));});}[_0x4bcf27(-0x2ff,-0x2d9)](){function _0x1c199e(_0x168844,_0x59db92){return _0x1e97(_0x59db92-0xdf,_0x168844);}this[_0x1c199e(0x20e,0x235)]&&(this['socket'][_0x1c199e(0x223,0x1c4)](),this[_0x1c199e(0x1c7,0x235)]=null);}['emit'](_0x50c5aa,data){function _0xfdea43(_0x286e8e,_0x318306){return _0x1e97(_0x318306-0x1dd,_0x286e8e);}this[_0xfdea43(0x304,0x333)]?.['emit'](_0x50c5aa,data);}['on'](_0x13c960,_0x162e78){function _0x40a67e(_0x297492,_0x5ad559){return _0x1e97(_0x5ad559-0x2c0,_0x297492);}this[_0x40a67e(0x450,0x416)]?.['on'](_0x13c960,_0x162e78);}['off'](_0x366110,_0x2d7800){_0x2d7800?this['socket']?.['off'](_0x366110,_0x2d7800):this['socket']?.['off'](_0x366110);}get['connected'](){function _0x3d0f2a(_0x2bdc92,_0x2e439a){return _0x1e97(_0x2bdc92- -0xe0,_0x2e439a);}return this['socket']?.[_0x3d0f2a(0x3e,-0x22)]??![];}}class ReactNativeSocketAdapter{constructor(){this['socket']=null;}async['connect'](_0x59b96a,_0x2d30b5){if(!isSocketIOAvailable())throw new Error(_0x5415c7(0x50f,0x4e2));const {io:_0x104237}=getSocketIO();function _0x5415c7(_0x3eea18,_0x573c79){return _0x1e97(_0x573c79-0x30f,_0x3eea18);}return new Promise((_0x2ed51e,_0x40d733)=>{function _0x8dc0d3(_0x5edc95,_0x71b1d9){return _0x1e97(_0x5edc95- -0x3a1,_0x71b1d9);}this['socket']=_0x104237(_0x59b96a,{..._0x2d30b5,'transports':['websocket'],'upgrade':![],'autoConnect':!![]}),this[_0x8dc0d3(-0x24b,-0x223)]['on']('connect',()=>_0x2ed51e()),this['socket']['on']('connect_error',_0x3ea8a2=>_0x40d733(_0x3ea8a2));});}[_0x4bcf27(-0x2ff,-0x28d)](){function _0x265004(_0xce23bf,_0x252a9c){return _0x1e97(_0x252a9c- -0x150,_0xce23bf);}this['socket']&&(this[_0x265004(-0x4e,0x6)][_0x265004(-0x43,-0x6b)](),this['socket']=null);}['emit'](_0x4dbc7e,data){this['socket']?.['emit'](_0x4dbc7e,data);}['on'](_0x48a0b7,_0x3fef56){function _0x45201c(_0x5c62fe,_0x5cee4f){return _0x1e97(_0x5c62fe- -0xaf,_0x5cee4f);}this[_0x45201c(0xa7,0xf1)]?.['on'](_0x48a0b7,_0x3fef56);}['off'](_0x2622df,_0x1af53f){function _0x37ffd9(_0x3f54b6,_0x131cd4){return _0x1e97(_0x3f54b6- -0x266,_0x131cd4);}_0x1af53f?this[_0x37ffd9(-0x110,-0xfa)]?.['off'](_0x2622df,_0x1af53f):this[_0x37ffd9(-0x110,-0x18a)]?.[_0x37ffd9(-0x91,-0x7a)](_0x2622df);}get['connected'](){return this['socket']?.['connected']??![];}}function createSocketAdapter(){const _0x320cf8=getEnvironment();function _0x5e107f(_0x5a6117,_0x11a6b2){return _0x1e97(_0x11a6b2-0x6c,_0x5a6117);}switch(_0x320cf8){case _0x5e107f(0x203,0x227):return new ReactNativeSocketAdapter();case'browser':case'node':default:return new WebSocketAdapter();}}function _0x4bcf27(_0x5e739a,_0x16ad07){return _0x1e97(_0x5e739a- -0x3e4,_0x16ad07);}class RealtimeClient{constructor(_0x1177ae,_0x505d3c,_0x23736b={}){function _0x50b847(_0x47d2d3,_0x3c29f1){return _0x1e97(_0x47d2d3- -0xc5,_0x3c29f1);}this['socket']=null,this['channels']=new Map(),this['connectionState']='disconnected',this['reconnectAttempts']=0x0,this[_0x50b847(0xaa,0xb2)]=0x5,this[_0x50b847(0x48,0xa8)]=_0x1177ae,this[_0x50b847(0x57,0x16)]=_0x505d3c,this['options']={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x23736b},this['socketAdapter']=createSocketAdapter();}[_0x4bcf27(-0x2da,-0x2a6)](){return new Promise(async(_0x4dfe2e,_0xa056b4)=>{function _0x49688d(_0x5521cd,_0x4419f4){return _0x1e97(_0x4419f4- -0x239,_0x5521cd);}if(this[_0x49688d(-0xec,-0xec)]['connected']){_0x4dfe2e();return;}this['connectionState']=_0x49688d(-0x8e,-0xa9);try{await this[_0x49688d(-0x130,-0xec)][_0x49688d(-0x124,-0x12f)](this['url'],{'auth':{'apikey':this['apiKey']},'transports':['websocket'],'reconnection':!![],'reconnectionDelay':this['options']['reconnectInterval'],'reconnectionAttempts':this[_0x49688d(-0x3d,-0x85)][_0x49688d(-0xdf,-0xca)],...this[_0x49688d(-0x1d,-0x85)][_0x49688d(-0x8f,-0xdb)]}),this[_0x49688d(-0x11b,-0xe3)]=this['socketAdapter']['socket'],this['socketAdapter']['on'](_0x49688d(-0x11a,-0x12f),()=>{this[_0x10c92c(0x14d,0x1a7)]='connected';function _0x10c92c(_0x262b9a,_0x1ab548){return _0x1e97(_0x262b9a-0x4,_0x1ab548);}this['reconnectAttempts']=0x0,this['setupHeartbeat'](),_0x4dfe2e();}),this[_0x49688d(-0x165,-0xec)]['on']('disconnect',()=>{function _0x228f39(_0x29aa03,_0x208ef2){return _0x1e97(_0x208ef2- -0x2c9,_0x29aa03);}this[_0x228f39(-0x1ed,-0x180)]='disconnected',this['channels'][_0x228f39(-0x21e,-0x197)](channel=>{function _0x49cc59(_0x4f4be2,_0x1a6a2a){return _0x1e97(_0x1a6a2a- -0x2ac,_0x4f4be2);}channel[_0x49cc59(-0x125,-0x154)](_0x49cc59(-0x6d,-0xca));});}),this['socketAdapter']['on'](_0x49688d(-0x10d,-0xa1),_0x21bbe9=>{function _0x245b16(_0x3f78ef,_0x2c6d42){return _0x1e97(_0x2c6d42- -0xa2,_0x3f78ef);}this['connectionState']=_0x245b16(0xc1,0xc3),this['reconnectAttempts']++,this['reconnectAttempts']>=this[_0x245b16(0x96,0xcd)]&&_0xa056b4(new Error('Failed\x20to\x20connect\x20after\x20'+this[_0x245b16(0x73,0xcd)]+_0x245b16(0xfb,0x12b)+_0x21bbe9['message']));}),this[_0x49688d(-0x12a,-0xec)]['on'](_0x49688d(-0x68,-0x9c),()=>{function _0x76a6c6(_0x3bf758,_0x39e807){return _0x1e97(_0x39e807-0x253,_0x3bf758);}this[_0x76a6c6(0x326,0x39c)]=_0x76a6c6(0x31b,0x371),this['reconnectAttempts']=0x0,this[_0x76a6c6(0x33f,0x382)]['forEach'](channel=>{channel['_rejoin']();});}),this[_0x49688d(-0x11f,-0xec)]['on'](_0x49688d(-0x7f,-0xc1),_0x4556e4=>{function _0x2a10ff(_0x1bc25f,_0x2bea9a){return _0x1e97(_0x2bea9a-0x38a,_0x1bc25f);}const channel=this[_0x2a10ff(0x4fd,0x4b9)]['get'](_0x4556e4['topic']);channel&&channel[_0x2a10ff(0x532,0x4eb)]('postgres_changes',_0x4556e4);}),this['socketAdapter']['on'](_0x49688d(-0xe8,-0x147),_0x181d8e=>{const channel=this['channels'][_0x4390fc(-0x4f,-0x6)](_0x181d8e['topic']);function _0x4390fc(_0x5150d8,_0x1ec7ba){return _0x1e97(_0x1ec7ba- -0x1e6,_0x5150d8);}channel&&channel[_0x4390fc(-0x51,-0x85)](_0x4390fc(-0x128,-0xf4),_0x181d8e);}),this[_0x49688d(-0xfb,-0xec)]['on']('presence',_0x48b76f=>{const channel=this[_0xaea61f(0x34f,0x375)]['get'](_0x48b76f[_0xaea61f(0x332,0x369)]);function _0xaea61f(_0x3e1133,_0x5b7acd){return _0x1e97(_0x5b7acd-0x246,_0x3e1133);}channel&&channel[_0xaea61f(0x3ed,0x3a7)](_0xaea61f(0x390,0x39f),_0x48b76f);});}catch(_0x37f248){this[_0x49688d(-0xc8,-0xf0)]='error',_0xa056b4(_0x37f248);}});}[_0x4bcf27(-0x2ff,-0x320)](){this[_0x40bf7c(0x4fe,0x505)]&&(this[_0x40bf7c(0x4fe,0x4dd)][_0x40bf7c(0x496,0x4bf)](),this[_0x40bf7c(0x507,0x53d)]=null);this[_0x40bf7c(0x4fa,0x484)]=_0x40bf7c(0x4d7,0x513);function _0x40bf7c(_0x25d7b7,_0x489632){return _0x1e97(_0x25d7b7-0x3b1,_0x489632);}this[_0x40bf7c(0x4e0,0x52c)][_0x40bf7c(0x4f0,0x4f4)]();}['channel'](_0x46cf52){function _0x111c0b(_0x1acf63,_0x5120a0){return _0x1e97(_0x1acf63-0x22,_0x5120a0);}if(this['channels'][_0x111c0b(0x10e,0x153)](_0x46cf52))return this[_0x111c0b(0x151,0xd4)][_0x111c0b(0x202,0x218)](_0x46cf52);const channel=new RealtimeChannel(_0x46cf52,this[_0x111c0b(0x178,0x188)]);return this[_0x111c0b(0x151,0x131)][_0x111c0b(0x1ee,0x1fd)](_0x46cf52,channel),this[_0x111c0b(0x16b,0x169)]==='connected'&&channel['_join'](),channel;}[_0x4bcf27(-0x266,-0x2d4)](channel){const _0x32c2bd=channel[_0x1e379d(0x20d,0x1a5)];function _0x1e379d(_0xfc8e9c,_0x3f3ed4){return _0x1e97(_0xfc8e9c-0xea,_0x3f3ed4);}this['channels']['has'](_0x32c2bd)&&(this['channels'][_0x1e379d(0x1d2,0x1d6)](_0x32c2bd),channel['unsubscribe']());}['removeAllChannels'](){function _0x2b245c(_0x3c2706,_0xa47e9e){return _0x1e97(_0x3c2706-0x169,_0xa47e9e);}this[_0x2b245c(0x298,0x2d8)][_0x2b245c(0x29b,0x25f)](channel=>{channel['unsubscribe']();}),this[_0x2b245c(0x298,0x310)][_0x2b245c(0x2a8,0x26e)]();}[_0x4bcf27(-0x2d3,-0x2e1)](){function _0x46a4b4(_0x12c92f,_0x5d7293){return _0x1e97(_0x12c92f- -0x1d1,_0x5d7293);}return Array['from'](this['channels'][_0x46a4b4(-0x1b,0x24)]());}[_0x4bcf27(-0x235,-0x29b)](){function _0x50ff71(_0x57429a,_0x418d58){return _0x1e97(_0x57429a- -0x276,_0x418d58);}return this[_0x50ff71(-0x12d,-0x19d)]===_0x50ff71(-0x158,-0x15d)&&this['socketAdapter']['connected'];}['getConnectionState'](){return this['connectionState'];}[_0x4bcf27(-0x2ea,-0x2cc)](_0x500c0f){const _0x5754b6=()=>_0x500c0f(this[_0x4c2833(-0xb2,-0x91)]);this[_0x4c2833(-0xab,-0x8d)]&&(this['socketAdapter']['on'](_0x4c2833(-0x131,-0xd0),()=>{this['connectionState']='connected',_0x5754b6();}),this[_0x4c2833(-0x5b,-0x8d)]['on']('disconnect',()=>{function _0x439a99(_0x2f16a9,_0x2a9029){return _0x1e97(_0x2f16a9-0xfc,_0x2a9029);}this[_0x439a99(0x245,0x1f8)]=_0x439a99(0x222,0x231),_0x5754b6();}),this['socketAdapter']['on'](_0x4c2833(-0x76,-0x42),()=>{this['connectionState']='error',_0x5754b6();}));function _0x4c2833(_0x1e1aa3,_0x5ba13f){return _0x1e97(_0x5ba13f- -0x1da,_0x1e1aa3);}return()=>{function _0x4dc363(_0x413017,_0x265c64){return _0x1e97(_0x265c64-0x191,_0x413017);}this[_0x4dc363(0x271,0x2de)]&&(this['socketAdapter']['off']('connect',_0x5754b6),this['socketAdapter'][_0x4dc363(0x2f6,0x366)]('disconnect',_0x5754b6),this[_0x4dc363(0x2b0,0x2de)][_0x4dc363(0x2e0,0x366)](_0x4dc363(0x2b6,0x329),_0x5754b6));};}['setupHeartbeat'](){if(!this['options']['heartbeatInterval']||!this[_0x2f53f4(-0x1e1,-0x1e2)])return;function _0x2f53f4(_0x179aa9,_0x42e189){return _0x1e97(_0x179aa9- -0x32e,_0x42e189);}const interval=setInterval(()=>{function _0x3a2257(_0x3323a8,_0x3d7f6d){return _0x1e97(_0x3323a8- -0x34b,_0x3d7f6d);}this[_0x3a2257(-0x1fe,-0x223)]?.[_0x3a2257(-0x22d,-0x286)]?this[_0x3a2257(-0x1fe,-0x1ac)]['emit']('heartbeat',{'timestamp':Date['now']()}):clearInterval(interval);},this[_0x2f53f4(-0x17a,-0x196)][_0x2f53f4(-0x20f,-0x1c4)]);}['_getSocket'](){return this['socket'];}}class FunctionsClient{constructor(_0x1a3fe0){this['httpClient']=_0x1a3fe0;}async[_0x4bcf27(-0x2d6,-0x296)](_0x41d7ea,_0x3b7b41){function _0x260812(_0x3147c9,_0x4269f5){return _0x1e97(_0x4269f5- -0x34b,_0x3147c9);}try{const _0x1aa9b4=_0x3b7b41?.['method']||'POST',headers={'Content-Type':'application/json',..._0x3b7b41?.[_0x260812(-0x188,-0x16e)]};let response;const _0x3d025e=_0x260812(-0x1d1,-0x217)+_0x41d7ea;switch(_0x1aa9b4['toUpperCase']()){case'GET':response=await this['httpClient'][_0x260812(-0x1d7,-0x16b)](_0x3d025e,{'headers':headers,'params':_0x3b7b41?.[_0x260812(-0x1ba,-0x1e2)]});break;case'POST':response=await this['httpClient'][_0x260812(-0x2b7,-0x233)](_0x3d025e,_0x3b7b41?.['body'],{'headers':headers});break;case'PUT':response=await this[_0x260812(-0x236,-0x1b1)]['put'](_0x3d025e,_0x3b7b41?.[_0x260812(-0x1ee,-0x1e2)],{'headers':headers});break;case'PATCH':response=await this['httpClient']['patch'](_0x3d025e,_0x3b7b41?.[_0x260812(-0x1e1,-0x1e2)],{'headers':headers});break;case'DELETE':response=await this[_0x260812(-0x139,-0x1b1)]['delete'](_0x3d025e,{'headers':headers,'data':_0x3b7b41?.[_0x260812(-0x22b,-0x1e2)]});break;default:throw new EBaaSError(_0x260812(-0x22a,-0x256)+_0x1aa9b4,0x190);}return{'data':response['data'],'error':null};}catch(_0x38080e){return{'data':null,'error':_0x38080e instanceof EBaaSError?_0x38080e:new EBaaSError(_0x38080e instanceof Error?_0x38080e[_0x260812(-0x186,-0x166)]:_0x260812(-0x122,-0x17c),0x0,_0x38080e)};}}async[_0x4bcf27(-0x281,-0x2e0)](){function _0x19cdad(_0x50787d,_0x56deab){return _0x1e97(_0x50787d-0x1e6,_0x56deab);}try{const response=await this['httpClient'][_0x19cdad(0x3c6,0x418)]('/functions/v1');return{'data':response['data'],'error':null};}catch(_0x4423d6){return{'data':null,'error':_0x4423d6 instanceof EBaaSError?_0x4423d6:new EBaaSError(_0x4423d6 instanceof Error?_0x4423d6['message']:'Failed\x20to\x20list\x20functions',0x0,_0x4423d6)};}}async[_0x4bcf27(-0x204,-0x1ba)](_0x29c1ca){function _0x3f3b2b(_0x13d185,_0x50d1b3){return _0x1e97(_0x50d1b3-0x32b,_0x13d185);}try{const response=await this['httpClient']['get'](_0x3f3b2b(0x461,0x45f)+_0x29c1ca+'/info');return{'data':response[_0x3f3b2b(0x499,0x4af)],'error':null};}catch(_0x1c0c2e){return{'data':null,'error':_0x1c0c2e instanceof EBaaSError?_0x1c0c2e:new EBaaSError(_0x1c0c2e instanceof Error?_0x1c0c2e[_0x3f3b2b(0x4bc,0x510)]:'Failed\x20to\x20get\x20function',0x0,_0x1c0c2e)};}}async[_0x4bcf27(-0x2dd,-0x2c7)](_0x3d0aa8,_0x55de8c){function _0x548966(_0x5e0e91,_0x263a71){return _0x1e97(_0x5e0e91- -0x1c7,_0x263a71);}try{const _0x3cc28b=new FormData();if(_0x55de8c[_0x548966(-0x12,0x1b)]instanceof File)_0x3cc28b[_0x548966(0x24,-0x58)]('code',_0x55de8c['code']);else typeof _0x55de8c['code']===_0x548966(-0xcb,-0x135)&&_0x3cc28b['append']('code',new Blob([_0x55de8c[_0x548966(-0x12,-0x76)]],{'type':_0x548966(-0xb0,-0x10f)}),_0x548966(-0xd3,-0x14a));_0x55de8c['entrypoint']&&_0x3cc28b['append']('entrypoint',_0x55de8c[_0x548966(-0xa2,-0x44)]);_0x55de8c[_0x548966(-0x89,-0xda)]&&_0x3cc28b[_0x548966(0x24,-0x10)](_0x548966(-0x89,-0x7a),JSON[_0x548966(-0xc7,-0x7f)](_0x55de8c[_0x548966(-0x89,-0xd2)]));_0x55de8c['importMap']&&_0x3cc28b[_0x548966(0x24,-0xe)](_0x548966(-0x19,-0x7),JSON['stringify'](_0x55de8c['importMap']));_0x55de8c['verify']!==undefined&&_0x3cc28b['append'](_0x548966(-0xa,-0x40),String(_0x55de8c[_0x548966(-0xa,-0x42)]));const response=await this[_0x548966(-0x2d,-0x2)][_0x548966(-0xaf,-0x41)](_0x548966(-0x93,-0x18)+_0x3d0aa8+'/deploy',_0x3cc28b,{'headers':{'Content-Type':_0x548966(-0xae,-0x112)}});return{'data':response['data'],'error':null};}catch(_0x4357c5){return{'data':null,'error':_0x4357c5 instanceof EBaaSError?_0x4357c5:new EBaaSError(_0x4357c5 instanceof Error?_0x4357c5[_0x548966(0x1e,0xc)]:_0x548966(-0x2e,-0x6d),0x0,_0x4357c5)};}}async['delete'](_0x59f17d){function _0x2666e8(_0x1615d4,_0x35a2c2){return _0x1e97(_0x1615d4- -0x375,_0x35a2c2);}try{const response=await this['httpClient']['delete'](_0x2666e8(-0x241,-0x1c3)+_0x59f17d);return{'data':response['data'],'error':null};}catch(_0x605054){return{'data':null,'error':_0x605054 instanceof EBaaSError?_0x605054:new EBaaSError(_0x605054 instanceof Error?_0x605054[_0x2666e8(-0x190,-0x179)]:'Failed\x20to\x20delete\x20function',0x0,_0x605054)};}}async[_0x4bcf27(-0x2bd,-0x305)](_0x4b2f68,_0x3603b2){function _0x515df8(_0x2ade83,_0x56f5ab){return _0x1e97(_0x2ade83-0x79,_0x56f5ab);}try{const response=await this['httpClient']['put']('/functions/v1/'+_0x4b2f68+'/env',{'env':_0x3603b2});return{'data':response['data'],'error':null};}catch(_0x37b46b){return{'data':null,'error':_0x37b46b instanceof EBaaSError?_0x37b46b:new EBaaSError(_0x37b46b instanceof Error?_0x37b46b[_0x515df8(0x25e,0x246)]:'Failed\x20to\x20update\x20function\x20environment',0x0,_0x37b46b)};}}async[_0x4bcf27(-0x205,-0x1da)](_0x2f0062,_0x5b9887){function _0x53ca71(_0x5bf744,_0x2f9527){return _0x1e97(_0x2f9527-0x1e7,_0x5bf744);}try{const _0x41ad26=new URLSearchParams();_0x5b9887?.[_0x53ca71(0x3ff,0x3c3)]&&_0x41ad26[_0x53ca71(0x44d,0x3d2)](_0x53ca71(0x367,0x3c3),String(_0x5b9887['limit']));_0x5b9887?.['offset']&&_0x41ad26[_0x53ca71(0x43b,0x3d2)]('offset',String(_0x5b9887['offset']));_0x5b9887?.[_0x53ca71(0x336,0x388)]&&_0x41ad26[_0x53ca71(0x3a5,0x3d2)](_0x53ca71(0x311,0x388),_0x5b9887['level']);const _0x3be71e=_0x53ca71(0x33d,0x31b)+_0x2f0062+_0x53ca71(0x295,0x312)+(_0x41ad26[_0x53ca71(0x2ee,0x310)]()?'?'+_0x41ad26['toString']():''),response=await this['httpClient'][_0x53ca71(0x379,0x3c7)](_0x3be71e);return{'data':response[_0x53ca71(0x334,0x36b)],'error':null};}catch(_0x27ecbd){return{'data':null,'error':_0x27ecbd instanceof EBaaSError?_0x27ecbd:new EBaaSError(_0x27ecbd instanceof Error?_0x27ecbd[_0x53ca71(0x3cd,0x3cc)]:'Failed\x20to\x20get\x20function\x20logs',0x0,_0x27ecbd)};}}async[_0x4bcf27(-0x270,-0x2f8)](_0x361a41,_0x1a98ed){function _0x6d862b(_0x32223f,_0x296724){return _0x1e97(_0x296724-0x257,_0x32223f);}try{const _0xab63c2=new URLSearchParams();_0x1a98ed?.[_0x6d862b(0x3bb,0x403)]&&_0xab63c2[_0x6d862b(0x4c6,0x442)](_0x6d862b(0x3af,0x403),_0x1a98ed['period']);const _0x5c1589='/functions/v1/'+_0x361a41+_0x6d862b(0x433,0x435)+(_0xab63c2['toString']()?'?'+_0xab63c2['toString']():''),response=await this[_0x6d862b(0x433,0x3f1)][_0x6d862b(0x464,0x437)](_0x5c1589);return{'data':response['data'],'error':null};}catch(_0xbe1c19){return{'data':null,'error':_0xbe1c19 instanceof EBaaSError?_0xbe1c19:new EBaaSError(_0xbe1c19 instanceof Error?_0xbe1c19[_0x6d862b(0x457,0x43c)]:_0x6d862b(0x3e8,0x422),0x0,_0xbe1c19)};}}}class EBaaSClient{constructor(_0x2c9d13,_0x1b728e,_0x5e4755){this['options']=_0x5e4755,this['httpClient']=new HttpClient({'url':_0x2c9d13,'apiKey':_0x1b728e,'timeout':0x7530,'headers':_0x5e4755?.[_0x41d58e(-0xa4,-0x101)]?.['headers']}),this['auth']=new AuthClient(this['httpClient'],_0x5e4755?.[_0x41d58e(-0x186,-0x166)]?.['workspaceId']),this[_0x41d58e(-0x18a,-0x166)]=new DatabaseClient(this['httpClient'],_0x5e4755?.[_0x41d58e(-0x14f,-0x166)]?.['workspaceId']),this['storage']=new StorageClient(this[_0x41d58e(-0xd8,-0x106)]),this[_0x41d58e(-0x194,-0x10d)]=new RealtimeClient(_0x2c9d13,_0x1b728e,_0x5e4755?.['realtime']);function _0x41d58e(_0x1dd942,_0x4efd82){return _0x1e97(_0x4efd82- -0x2a0,_0x1dd942);}this['functions']=new FunctionsClient(this['httpClient']),this['initializeCustomDatabase']();}['from'](_0x47fad3){function _0x203179(_0x3e0184,_0x6e4203){return _0x1e97(_0x3e0184- -0x3c8,_0x6e4203);}return this[_0x203179(-0x28e,-0x282)][_0x203179(-0x223,-0x253)](_0x47fad3);}['rpc'](_0x59f355,_0x427811){function _0x5e143a(_0x2857d4,_0x224037){return _0x1e97(_0x2857d4- -0xdd,_0x224037);}return this[_0x5e143a(0x5d,0x6b)]['rpc'](_0x59f355,_0x427811);}[_0x4bcf27(-0x2e9,-0x27d)](_0x40058b){return this['storage']['from'](_0x40058b);}[_0x4bcf27(-0x250,-0x288)](_0x1d732d){function _0x253b4c(_0x18a257,_0xb57052){return _0x1e97(_0x18a257- -0x283,_0xb57052);}return this[_0x253b4c(-0xf0,-0xc6)]['channel'](_0x1d732d);}[_0x4bcf27(-0x2d6,-0x2f0)](_0x30f53f,_0x1ff8b7){return this['functions']['invoke'](_0x30f53f,_0x1ff8b7);}async[_0x4bcf27(-0x268,-0x2cb)](){function _0x290446(_0x55bef4,_0x421602){return _0x1e97(_0x421602- -0x1ad,_0x55bef4);}if(this[_0x290446(-0x5f,0x7)]?.['database']?.['autoDetectCustomDatabase'])try{await this[_0x290446(-0xd0,-0x73)][_0x290446(-0x2e,0x11)]();}catch(_0x14ac16){console['warn']('Failed to initialize custom database detection:',_0x14ac16);}}async[_0x4bcf27(-0x20c,-0x1c0)](_0x31264e){this['auth'][_0x1e0cf7(0x301,0x331)](_0x31264e),this[_0x1e0cf7(0x292,0x293)][_0x1e0cf7(0x36c,0x331)](_0x31264e);function _0x1e0cf7(_0x285002,_0x10a9d9){return _0x1e97(_0x10a9d9-0x159,_0x285002);}this[_0x1e0cf7(0x303,0x30d)]?.[_0x1e0cf7(0x22c,0x293)]?.[_0x1e0cf7(0x30e,0x2d3)]&&await this[_0x1e0cf7(0x2cb,0x293)][_0x1e0cf7(0x2a5,0x317)]();}async['configureCustomDatabase'](_0x2ce36b){function _0x1b3575(_0x59cfcf,_0x2afe29){return _0x1e97(_0x2afe29- -0x157,_0x59cfcf);}await this['database'][_0x1b3575(0x2c,0x3b)](_0x2ce36b);}['getCustomDatabaseStatus'](){function _0x4c154a(_0x459e82,_0x166ea5){return _0x1e97(_0x459e82-0x12,_0x166ea5);}return this[_0x4c154a(0x14c,0x13f)][_0x4c154a(0x15e,0x1ad)]();}}function createClient(_0x1aa2a1,_0x124d77,_0x37c6af){return new EBaaSClient(_0x1aa2a1,_0x124d77,_0x37c6af);}const version=_0x4bcf27(-0x25b,-0x21d);export{AuthClient,CustomDatabaseManager,DatabaseClient,EBaaSClient,EBaaSError,FunctionsClient,HttpClient,QueryBuilder,RealtimeChannel,RealtimeClient,StorageBucket,StorageClient,createClient,version};
|
|
1
|
+
(function(stringArrayFunction,comparisonValue){const stringArray=stringArrayFunction();function _0x510194(_0x3a8e5d,_0x55d84a){return _0x30c5(_0x3a8e5d-0x1d5,_0x55d84a);}while(!![]){try{const _0x59c24e=parseInt(_0x510194(0x3d8,0x352))/0x1+parseInt(_0x510194(0x387,0x3b1))/0x2*(-parseInt(_0x510194(0x3eb,0x3f7))/0x3)+-parseInt(_0x510194(0x37f,0x3ed))/0x4+-parseInt(_0x510194(0x397,0x384))/0x5*(parseInt(_0x510194(0x3e0,0x372))/0x6)+parseInt(_0x510194(0x3b2,0x3ce))/0x7*(parseInt(_0x510194(0x3fc,0x469))/0x8)+parseInt(_0x510194(0x3d7,0x3b9))/0x9+-parseInt(_0x510194(0x3c5,0x423))/0xa;if(_0x59c24e===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x464f08){stringArray['push'](stringArray['shift']());}}}(_0x5035,0xe93cb));function _0x30c5(_0x2d85c0,_0x3e6822){const _0x50359b=_0x5035();return _0x30c5=function(_0x30c563,_0x89ef48){_0x30c563=_0x30c563-0x15d;let _0x51eb1a=_0x50359b[_0x30c563];if(_0x30c5['gDoLDn']===undefined){var _0x523de9=function(_0x26b5d7){const _0x33cf35='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x48483f='',_0x45e808='';for(let _0xc6a3d8=0x0,_0x949364,_0xa96bf5,_0x11ecee=0x0;_0xa96bf5=_0x26b5d7['charAt'](_0x11ecee++);~_0xa96bf5&&(_0x949364=_0xc6a3d8%0x4?_0x949364*0x40+_0xa96bf5:_0xa96bf5,_0xc6a3d8++%0x4)?_0x48483f+=String['fromCharCode'](0xff&_0x949364>>(-0x2*_0xc6a3d8&0x6)):0x0){_0xa96bf5=_0x33cf35['indexOf'](_0xa96bf5);}for(let _0xd12b69=0x0,_0x46c884=_0x48483f['length'];_0xd12b69<_0x46c884;_0xd12b69++){_0x45e808+='%'+('00'+_0x48483f['charCodeAt'](_0xd12b69)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x45e808);};_0x30c5['mirDYz']=_0x523de9,_0x2d85c0=arguments,_0x30c5['gDoLDn']=!![];}const _0xa95629=_0x50359b[0x0],_0x308bf5=_0x30c563+_0xa95629,_0x24661b=_0x2d85c0[_0x308bf5];return!_0x24661b?(_0x51eb1a=_0x30c5['mirDYz'](_0x51eb1a),_0x2d85c0[_0x308bf5]=_0x51eb1a):_0x51eb1a=_0x24661b,_0x51eb1a;},_0x30c5(_0x2d85c0,_0x3e6822);}import axios from'axios';class EBaaSError extends Error{constructor(_0x26b5d7,status=0x0,_0x33cf35){super(_0x26b5d7),this[_0x1c73fe(-0x180,-0x1dc)]='EBaaSError',this[_0x1c73fe(-0x13b,-0xb4)]=status;function _0x1c73fe(_0x3b1156,_0x4a6a55){return _0x30c5(_0x3b1156- -0x350,_0x4a6a55);}this[_0x1c73fe(-0x199,-0x1e0)]=_0x33cf35,Error[_0x1c73fe(-0x1db,-0x219)]&&Error['captureStackTrace'](this,EBaaSError);}['toJSON'](){function _0x728abd(_0x6a54c5,_0x19a594){return _0x30c5(_0x19a594- -0x20,_0x6a54c5);}return{'name':this['name'],'message':this[_0x728abd(0x1aa,0x1ea)],'status':this['status'],'details':this['details'],'stack':this[_0x728abd(0x1eb,0x231)]};}['toString'](){return this['name']+':\x20'+this['message']+'\x20(Status:\x20'+this['status']+')';}}class HttpClient{constructor(config){this[_0x17643a(0x410,0x489)]=config[_0x17643a(0x39e,0x352)];function _0x17643a(_0x476798,_0x468fc3){return _0x30c5(_0x476798-0x216,_0x468fc3);}this[_0x17643a(0x44f,0x4c3)]=config['apiKey'],this['client']=axios[_0x17643a(0x386,0x314)]({'baseURL':this['baseURL'],'timeout':config[_0x17643a(0x3ba,0x42a)]||0x2710,'headers':{'Content-Type':'application/json','apikey':this[_0x17643a(0x44f,0x3f7)],...config[_0x17643a(0x403,0x46e)]}}),this['setupInterceptors']();}['setupInterceptors'](){function _0x1fe32c(_0x3cd200,_0x5bf09d){return _0x30c5(_0x3cd200-0x33a,_0x5bf09d);}this[_0x1fe32c(0x4bc,0x542)]['interceptors'][_0x1fe32c(0x588,0x5ce)]['use'](config=>{return config;},_0x48483f=>{function _0x4b2879(_0x419a30,_0x5e8f4d){return _0x30c5(_0x5e8f4d-0x5,_0x419a30);}return Promise[_0x4b2879(0x212,0x1a4)](new EBaaSError('Request\x20failed',0x0,_0x48483f));}),this[_0x1fe32c(0x4bc,0x521)]['interceptors']['response'][_0x1fe32c(0x4e3,0x4a7)](response=>{return response;},_0x45e808=>{const status=_0x45e808[_0xde271f(0x105,0x179)]?.['status']||0x0;function _0xde271f(_0x2dcffb,_0x4e315d){return _0x30c5(_0x4e315d- -0xf2,_0x2dcffb);}const _0xc6a3d8=_0x45e808['response']?.[_0xde271f(0x42,0xbe)]?.['message']||_0x45e808[_0xde271f(0x15b,0x118)]||_0xde271f(0x10f,0xd9),_0x949364=_0x45e808['response']?.[_0xde271f(0xb3,0xbe)]||_0x45e808;return Promise['reject'](new EBaaSError(_0xc6a3d8,status,_0x949364));});}async['get'](_0xa96bf5,config){function _0x2c347e(_0x9a492d,_0x1350e5){return _0x30c5(_0x9a492d- -0x1fb,_0x1350e5);}try{const response=await this['client']['get'](_0xa96bf5,config);return{'data':response['data'],'status':response['status'],'statusText':response[_0x2c347e(0x1c,0x51)],'headers':response[_0x2c347e(-0xe,0x30)]};}catch(_0x11ecee){throw this['handleError'](_0x11ecee);}}async['post'](_0xd12b69,data,config){function _0x171bf8(_0x2067b2,_0xe25ea5){return _0x30c5(_0x2067b2- -0x220,_0xe25ea5);}try{const response=await this['client']['post'](_0xd12b69,data,config);return{'data':response['data'],'status':response['status'],'statusText':response[_0x171bf8(-0x9,-0x16)],'headers':response['headers']};}catch(_0x46c884){throw this[_0x171bf8(-0x38,-0xf)](_0x46c884);}}async[_0x684fad(0x4db,0x465)](_0x1588e3,data,config){try{const response=await this['client']['put'](_0x1588e3,data,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x4f79b5){throw this['handleError'](_0x4f79b5);}}async[_0x684fad(0x4c4,0x4a7)](_0x26826a,data,config){function _0x128f14(_0xbe2855,_0x1bffeb){return _0x30c5(_0xbe2855-0x110,_0x1bffeb);}try{const response=await this['client']['patch'](_0x26826a,data,config);return{'data':response['data'],'status':response[_0x128f14(0x325,0x343)],'statusText':response[_0x128f14(0x327,0x2ba)],'headers':response[_0x128f14(0x2fd,0x2b6)]};}catch(_0x1a1592){throw this[_0x128f14(0x2f8,0x29b)](_0x1a1592);}}async['delete'](_0x57ab20,config){function _0x21b9bb(_0x1c3cbf,_0x2c2251){return _0x30c5(_0x2c2251-0xc1,_0x1c3cbf);}try{const response=await this['client']['delete'](_0x57ab20,config);return{'data':response['data'],'status':response[_0x21b9bb(0x26f,0x2d6)],'statusText':response[_0x21b9bb(0x31c,0x2d8)],'headers':response['headers']};}catch(_0x5de01e){throw this[_0x21b9bb(0x32a,0x2a9)](_0x5de01e);}}[_0x684fad(0x4e7,0x47c)](_0x3b930b){function _0x2246cb(_0x3a4c80,_0x3b70ee){return _0x30c5(_0x3b70ee- -0xf0,_0x3a4c80);}this[_0x2246cb(0x44,0x92)][_0x2246cb(0x110,0xe6)][_0x2246cb(0xa5,0xfd)]['common']['Authorization']=_0x2246cb(0x1da,0x16f)+_0x3b930b;}['removeAuthToken'](){delete this[_0x5ade67(-0x6,-0x35)]['defaults']['headers']['common']['Authorization'];function _0x5ade67(_0x425698,_0x303d87){return _0x30c5(_0x425698- -0x188,_0x303d87);}this[_0x5ade67(-0x6,-0x23)]['defaults']['headers'][_0x5ade67(0x6a,-0x1e)]['Authorization']='Bearer\x20'+this['apiKey'];}['handleError'](_0x42dbe8){function _0x4dfb0f(_0x1d76b3,_0x5b3e2f){return _0x30c5(_0x1d76b3- -0x36d,_0x5b3e2f);}if(_0x42dbe8 instanceof EBaaSError)return _0x42dbe8;return new EBaaSError(_0x42dbe8[_0x4dfb0f(-0x163,-0x123)]||_0x4dfb0f(-0x15d,-0x148),_0x42dbe8[_0x4dfb0f(-0x158,-0xe4)]||0x0,_0x42dbe8);}}class AuthClient{constructor(_0x2d5ee9,_0x211ce0){this['currentSession']=null,this['httpClient']=_0x2d5ee9;function _0x2414d1(_0x25b8e0,_0x49d40a){return _0x30c5(_0x49d40a- -0x97,_0x25b8e0);}this['workspaceId']=_0x211ce0,this[_0x2414d1(0x204,0x1d3)]();}async[_0x684fad(0x546,0x500)](data){function _0x26cda3(_0x1fece1,_0x347d04){return _0x30c5(_0x1fece1-0x1c,_0x347d04);}try{const response=await this[_0x26cda3(0x1c9,0x198)]['post'](_0x26cda3(0x1d5,0x223),data);return response['data']['session']&&this['setSessionInternal'](response['data']['session']),response[_0x26cda3(0x1cc,0x22c)];}catch(_0x36979a){throw this[_0x26cda3(0x1b1,0x1f3)](_0x36979a);}}async[_0x684fad(0x563,0x5cb)](data){function _0x1d83b7(_0x3274ed,_0x47cc32){return _0x30c5(_0x47cc32- -0x170,_0x3274ed);}try{const headers={};this['workspaceId']&&(headers[_0x1d83b7(0x14c,0xf2)]=this['workspaceId']);const response=await this['httpClient']['post'](_0x1d83b7(0x61,0xc8),data,{'headers':headers});return response[_0x1d83b7(0x59,0x40)][_0x1d83b7(-0x7a,0x2)]&&this['setSessionInternal'](response['data']['session']),response['data'];}catch(_0x3d9ed8){throw this['handleAuthError'](_0x3d9ed8);}}async[_0x684fad(0x4f2,0x470)](){function _0xb568d6(_0x3b4559,_0x2924da){return _0x30c5(_0x2924da-0x108,_0x3b4559);}try{await this['httpClient']['post'](_0xb568d6(0x2bf,0x2a4)),this[_0xb568d6(0x312,0x29b)]();}catch(_0x2dfe93){this['clearSession']();throw this['handleAuthError'](_0x2dfe93);}}async['getUser'](){if(!this['currentSession']?.[_0xecf5e9(0x93,0xa7)])return null;function _0xecf5e9(_0x13cb9d,_0x3026a2){return _0x30c5(_0x3026a2- -0x14c,_0x13cb9d);}try{const response=await this['httpClient'][_0xecf5e9(0x13c,0xfc)](_0xecf5e9(0x13f,0xf6));return response['data']['user'];}catch(_0x3e7f23){if(_0x3e7f23 instanceof EBaaSError&&_0x3e7f23[_0xecf5e9(0x14f,0xc9)]===0x191)return this['clearSession'](),null;throw this['handleAuthError'](_0x3e7f23);}}async[_0x684fad(0x573,0x547)](){function _0x4997e5(_0x1c3e21,_0x1c0ad8){return _0x30c5(_0x1c0ad8-0x5a,_0x1c3e21);}if(!this[_0x4997e5(0x302,0x29b)]?.[_0x4997e5(0x2c3,0x2b0)])return null;try{const response=await this[_0x4997e5(0x1ba,0x207)]['post'](_0x4997e5(0x294,0x227),{'refresh_token':this[_0x4997e5(0x2fe,0x29b)]['refresh_token']});if(response['data'][_0x4997e5(0x1ec,0x1cc)])return this[_0x4997e5(0x205,0x24f)](response['data'][_0x4997e5(0x1c6,0x1cc)]),response['data']['session'];return null;}catch(_0x13f10){this['clearSession']();throw this['handleAuthError'](_0x13f10);}}async[_0x684fad(0x579,0x589)](_0x53620f){function _0x3c2218(_0x1353f8,_0x522047){return _0x30c5(_0x1353f8- -0x36c,_0x522047);}try{await this['httpClient']['post']('/auth/v1/reset-password',{'email':_0x53620f});}catch(_0x48e4de){throw this[_0x3c2218(-0x1d7,-0x19b)](_0x48e4de);}}async['updateUser'](data){function _0x3a2e2c(_0x35a5fe,_0x35c5ed){return _0x30c5(_0x35c5ed- -0x105,_0x35a5fe);}try{const response=await this[_0x3a2e2c(0xc9,0xa8)][_0x3a2e2c(0xf3,0xaa)]('/auth/v1/user',data);return response[_0x3a2e2c(0xc7,0xab)]['user'];}catch(_0x4d21a4){throw this['handleAuthError'](_0x4d21a4);}}['getSession'](){return this['currentSession'];}['setSession'](_0x5a18db){this['currentSession']=_0x5a18db,this['httpClient'][_0x22b02f(0x3f6,0x38a)](_0x5a18db[_0x22b02f(0x34c,0x3c2)]);function _0x22b02f(_0x1422f3,_0x1efbc7){return _0x30c5(_0x1efbc7-0x1cf,_0x1422f3);}typeof localStorage!=='undefined'&&localStorage['setItem'](_0x22b02f(0x31a,0x34d),JSON['stringify'](_0x5a18db));}['onAuthStateChange'](_0x50a9f4){return()=>{};}['setWorkspaceId'](_0x53d1cb){function _0x1ed560(_0x2ac1f5,_0x280971){return _0x30c5(_0x280971-0x102,_0x2ac1f5);}this[_0x1ed560(0x21c,0x28b)]=_0x53d1cb;}['setSessionInternal'](_0x34c598){this['currentSession']=_0x34c598,this['httpClient'][_0x2a2c14(0x12e,0x18e)](_0x34c598[_0x2a2c14(0x229,0x1c6)]);function _0x2a2c14(_0x4cc36f,_0x4098d3){return _0x30c5(_0x4098d3- -0x2d,_0x4cc36f);}typeof localStorage!==_0x2a2c14(0x1ff,0x194)&&localStorage[_0x2a2c14(0x180,0x14b)](_0x2a2c14(0x151,0x151),JSON[_0x2a2c14(0x274,0x227)](_0x34c598));}['clearSession'](){this['currentSession']=null;function _0x352933(_0x5988e7,_0x30b15d){return _0x30c5(_0x5988e7-0x176,_0x30b15d);}this['httpClient'][_0x352933(0x2d4,0x35a)](),typeof localStorage!==_0x352933(0x337,0x2b7)&&localStorage['removeItem']('ebaas.auth.session');}[_0x684fad(0x596,0x5d7)](){function _0x443fd6(_0x2f6eca,_0x26a941){return _0x30c5(_0x2f6eca-0x1ae,_0x26a941);}if(typeof localStorage!=='undefined'){const _0x4300da=localStorage[_0x443fd6(0x3dc,0x3ff)](_0x443fd6(0x32c,0x322));if(_0x4300da)try{const _0x41530d=JSON['parse'](_0x4300da);this[_0x443fd6(0x329,0x363)](_0x41530d);}catch(_0x311ef3){this['clearSession']();}}}[_0x684fad(0x4c1,0x513)](_0x1f78ad){if(_0x1f78ad instanceof EBaaSError)return _0x1f78ad;return new EBaaSError(_0x1f78ad['message']||'Authentication\x20failed',_0x1f78ad['status']||0x0,_0x1f78ad);}}class QueryBuilder{constructor(_0x144c4a,_0x167d83,_0x422ce6,_0x18a4c7){this['httpClient']=_0x144c4a,this[_0x342211(0x8e,0x7c)]=_0x167d83,this['schema']=_0x422ce6,this['workspaceId']=_0x18a4c7;function _0x342211(_0x206405,_0x24953d){return _0x30c5(_0x24953d- -0x19c,_0x206405);}this['query']={'filters':[]};}['select'](_0x124209='*',_0x431477){this[_0x3cee0a(0x48a,0x4ae)]['select']=_0x124209;function _0x3cee0a(_0x2500b0,_0x4d7f44){return _0x30c5(_0x2500b0-0x28b,_0x4d7f44);}return this;}['insert'](data,_0x137e12){function _0x21ace9(_0x4e8ac5,_0xa9d229){return _0x30c5(_0x4e8ac5-0x326,_0xa9d229);}return this[_0x21ace9(0x535,0x580)]('POST',_0x21ace9(0x48d,0x4f3)+this['table']+_0x21ace9(0x49c,0x4b8),{'data':data,'options':_0x137e12});}['update'](data,_0x2235f9){function _0x4d9591(_0x641fec,_0x597003){return _0x30c5(_0x597003- -0xb2,_0x641fec);}return this[_0x4d9591(0x162,0x14d)]['updateData']=data,this[_0x4d9591(0xf6,0x14d)]['updateOptions']=_0x2235f9,this;}['upsert'](data,_0x7fddb0){function _0x2bc767(_0x3a3967,_0x20e629){return _0x30c5(_0x20e629-0xa1,_0x3a3967);}return this['executeQuery']('POST','/sdk/v1/'+this[_0x2bc767(0x2f2,0x2b9)]+'?operation=upsert',{'data':data,'options':{..._0x7fddb0,'upsert':!![]}});}['delete'](_0x37ed3e){this[_0x31b60a(0x55d,0x56e)][_0x31b60a(0x52d,0x56e)]=_0x37ed3e,this[_0x31b60a(0x55d,0x514)]['isDelete']=!![];function _0x31b60a(_0x295b74,_0x402314){return _0x30c5(_0x295b74-0x35e,_0x402314);}return this;}['eq'](_0x36bce3,_0x30c004){this[_0x3d7396(0x107,0x13b)][_0x3d7396(0x6a,-0x1e)]['push']({'column':_0x36bce3,'operator':'eq','value':_0x30c004});function _0x3d7396(_0xf677c5,_0xba2a87){return _0x30c5(_0xf677c5- -0xf8,_0xba2a87);}return this;}['neq'](_0x5f0c80,_0x3b0883){function _0x33e323(_0x495ff0,_0x4c5b4a){return _0x30c5(_0x495ff0-0x10a,_0x4c5b4a);}return this[_0x33e323(0x309,0x304)][_0x33e323(0x26c,0x29f)]['push']({'column':_0x5f0c80,'operator':'neq','value':_0x3b0883}),this;}['gt'](_0x535dc4,_0x854ed4){this['query']['filters'][_0x18285d(0x1f2,0x1d5)]({'column':_0x535dc4,'operator':'gt','value':_0x854ed4});function _0x18285d(_0x1d2c11,_0x476886){return _0x30c5(_0x1d2c11-0xd,_0x476886);}return this;}['gte'](_0x105399,_0x3b7714){function _0x5d1598(_0x13afbc,_0x1916d0){return _0x30c5(_0x13afbc- -0xff,_0x1916d0);}return this[_0x5d1598(0x100,0xa3)]['filters']['push']({'column':_0x105399,'operator':'gte','value':_0x3b7714}),this;}['lt'](_0x21d2a6,_0x5b2815){function _0x186dae(_0x285d8e,_0x26cd06){return _0x30c5(_0x26cd06- -0x14a,_0x285d8e);}return this[_0x186dae(0x113,0xb5)][_0x186dae(-0x3,0x18)][_0x186dae(0x44,0x9b)]({'column':_0x21d2a6,'operator':'lt','value':_0x5b2815}),this;}[_0x684fad(0x50b,0x519)](_0x5c8583,_0x5c35f0){function _0x50b918(_0x5b5439,_0x3e7d66){return _0x30c5(_0x3e7d66- -0x2c6,_0x5b5439);}return this[_0x50b918(-0x6b,-0xc7)][_0x50b918(-0x132,-0x164)]['push']({'column':_0x5c8583,'operator':'lte','value':_0x5c35f0}),this;}[_0x684fad(0x560,0x516)](_0x33ee2c,_0x34399f){this[_0x59697e(0x15e,0x18d)][_0x59697e(0xc1,0x110)][_0x59697e(0x144,0x185)]({'column':_0x33ee2c,'operator':_0x59697e(0x193,0x18d),'value':_0x34399f});function _0x59697e(_0x2d3951,_0x1b635a){return _0x30c5(_0x2d3951- -0xa1,_0x1b635a);}return this;}[_0x684fad(0x505,0x49c)](_0x12d3a8,_0x20ca8c){this[_0xed491a(0x5e8,0x570)][_0xed491a(0x46d,0x4d3)]['push']({'column':_0x12d3a8,'operator':'ilike','value':_0x20ca8c});function _0xed491a(_0x7c5f5e,_0x1941e9){return _0x30c5(_0x1941e9-0x371,_0x7c5f5e);}return this;}['is'](_0x4505f8,_0x1e1ab8){function _0x21463a(_0x44dca2,_0x471e2c){return _0x30c5(_0x471e2c- -0x1c1,_0x44dca2);}return this['query'][_0x21463a(-0x40,-0x5f)]['push']({'column':_0x4505f8,'operator':'is','value':_0x1e1ab8}),this;}['in'](_0x4b5b9c,_0x42bd49){function _0x3312c3(_0x4b76e8,_0x1f0204){return _0x30c5(_0x4b76e8- -0xb3,_0x1f0204);}return this['query'][_0x3312c3(0xaf,0x12a)][_0x3312c3(0x132,0xb8)]({'column':_0x4b5b9c,'operator':'in','value':_0x42bd49}),this;}['contains'](_0x394782,_0x38aa33){function _0x2374c1(_0x9ff409,_0x3cf4c4){return _0x30c5(_0x9ff409-0xda,_0x3cf4c4);}return this[_0x2374c1(0x2d9,0x253)][_0x2374c1(0x23c,0x241)]['push']({'column':_0x394782,'operator':_0x2374c1(0x2bc,0x245),'value':_0x38aa33}),this;}[_0x684fad(0x4a9,0x42a)](_0x1d8a1e){function _0x51bb59(_0x5b2e5a,_0x5adec9){return _0x30c5(_0x5adec9- -0xc7,_0x5b2e5a);}return Object[_0x51bb59(0x108,0xf3)](_0x1d8a1e)[_0x51bb59(0x128,0x10a)](([_0x5acdf6,_0x4e9a57])=>{this['eq'](_0x5acdf6,_0x4e9a57);}),this;}[_0x684fad(0x568,0x4ea)](_0x1be3c6,_0x5afe30){function _0xfce785(_0x51b5be,_0x1d9bcf){return _0x30c5(_0x51b5be-0xb3,_0x1d9bcf);}return!this['query'][_0xfce785(0x2ef,0x357)]&&(this[_0xfce785(0x2b2,0x2cc)][_0xfce785(0x2ef,0x2b9)]=[]),this[_0xfce785(0x2b2,0x2fd)]['order'][_0xfce785(0x298,0x2fb)]({'column':_0x1be3c6,'ascending':_0x5afe30?.['ascending']!==![]}),this;}[_0x684fad(0x52d,0x5b3)](count){function _0x5a92cd(_0xe1ec22,_0x5b2c9f){return _0x30c5(_0x5b2c9f- -0xc1,_0xe1ec22);}return this[_0x5a92cd(0x1a4,0x13e)]['limit']=count,this;}[_0x684fad(0x495,0x50f)](from,_0x339d6b){this[_0x5f0023(0x562,0x58a)]['range']={'from':from,'to':_0x339d6b};function _0x5f0023(_0x450ce3,_0x5aeb36){return _0x30c5(_0x5aeb36-0x38b,_0x450ce3);}return this;}async[_0x684fad(0x507,0x4dd)](){function _0x56f846(_0x13a576,_0x4c08c5){return _0x30c5(_0x4c08c5-0x6e,_0x13a576);}if(this[_0x56f846(0x1f2,0x26d)]['updateData'])return this['executeQuery']('PATCH','/sdk/v1/'+this[_0x56f846(0x2d7,0x286)],{'data':this['query'][_0x56f846(0x19d,0x1f5)],'options':this[_0x56f846(0x2cd,0x26d)][_0x56f846(0x23c,0x1dd)],'filters':this[_0x56f846(0x24f,0x26d)][_0x56f846(0x151,0x1d0)]});else return this['query']['isDelete']?this['executeQuery']('DELETE',_0x56f846(0x1e6,0x1d5)+this[_0x56f846(0x264,0x286)]+'?operation=delete',{'options':this['query']['deleteOptions'],'filters':this['query']['filters']}):this['executeQuery']('GET',_0x56f846(0x20d,0x1d5)+this[_0x56f846(0x257,0x286)]+'?operation=select',{'select':this['query'][_0x56f846(0x2f2,0x272)],'filters':this[_0x56f846(0x1f1,0x26d)][_0x56f846(0x14a,0x1d0)],'order':this[_0x56f846(0x23c,0x26d)]['order'],'limit':this[_0x56f846(0x2d1,0x26d)][_0x56f846(0x1f8,0x26f)],'range':this[_0x56f846(0x233,0x26d)]['range']});}async['single'](){this['limit'](0x1);function _0x4447b2(_0x14c462,_0x4395a3){return _0x30c5(_0x4395a3-0x28e,_0x14c462);}const result=await this[_0x4447b2(0x415,0x469)]();return{'data':result['data']?.[0x0]||null,'error':result['error']};}async['executeQuery'](_0x4b03fe,_0xa4aff9,_0x1591a4){function _0x3f558b(_0x2a52c4,_0x3a3e44){return _0x30c5(_0x3a3e44- -0x25e,_0x2a52c4);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this['workspaceId']);if(_0x4b03fe==='GET'){const _0xff3063=_0xa4aff9['split']('?'),_0x132de1=_0xff3063[0x0],existingParams=new URLSearchParams(_0xff3063[0x1]||'');if(_0x1591a4[_0x3f558b(-0x66,-0x5a)])existingParams['append']('select',_0x1591a4['select']);_0x1591a4['filters']?.['length']&&_0x1591a4[_0x3f558b(-0xbf,-0xfc)]['forEach'](filter=>{function _0x37e697(_0x2be5a6,_0x251218){return _0x30c5(_0x2be5a6-0xdf,_0x251218);}existingParams['append'](filter['column'],filter['operator']+'.'+filter[_0x37e697(0x2ce,0x2b8)]);});if(_0x1591a4[_0x3f558b(0x3c,-0x22)]?.[_0x3f558b(-0x77,-0x4d)]){const orderStr=_0x1591a4['order']['map'](_0x264bbf=>''+_0x264bbf[_0x3f558b(-0x140,-0xe5)]+(_0x264bbf['ascending']?_0x3f558b(-0x4e,-0x56):_0x3f558b(-0x63,-0x28)))[_0x3f558b(-0xa5,-0x1e)](',');existingParams['append']('order',orderStr);}if(_0x1591a4[_0x3f558b(-0x58,-0x5d)])existingParams[_0x3f558b(-0x21,-0x9e)](_0x3f558b(0x0,-0x5d),_0x1591a4[_0x3f558b(-0xb,-0x5d)]['toString']());_0x1591a4['range']&&(existingParams['append']('offset',_0x1591a4['range']['from'][_0x3f558b(-0xd9,-0xb0)]()),existingParams[_0x3f558b(-0xe5,-0x9e)](_0x3f558b(-0xc1,-0x5d),(_0x1591a4['range']['to']-_0x1591a4[_0x3f558b(-0x7f,-0xf5)][_0x3f558b(-0x13a,-0xc4)]+0x1)[_0x3f558b(-0x10b,-0xb0)]())),response=await this[_0x3f558b(-0x76,-0xb1)][_0x3f558b(-0x5b,-0x16)](_0x132de1+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x4b03fe==='DELETE'){const _0x5ce6e2=_0xa4aff9[_0x3f558b(-0x67,-0xa9)]('?'),_0x179a9a=_0x5ce6e2[0x0],existingParams=new URLSearchParams(_0x5ce6e2[0x1]||'');!existingParams[_0x3f558b(-0xf2,-0x9a)]('operation')&&existingParams['append'](_0x3f558b(-0x6e,-0x34),'delete');_0x1591a4['filters']?.['length']&&_0x1591a4['filters'][_0x3f558b(-0x1a,-0x8d)](filter=>{function _0x451264(_0x141af2,_0x1b86f2){return _0x30c5(_0x1b86f2- -0x306,_0x141af2);}existingParams[_0x451264(-0x190,-0x146)](filter['column'],filter[_0x451264(-0x144,-0xde)]+'.'+filter[_0x451264(-0xe1,-0x117)]);});const deleteUrl=_0x179a9a+'?'+existingParams['toString']();console['log']('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console['log']('\uD83D\uDD27 DELETE headers:',headers),console[_0x3f558b(-0xf8,-0xfa)]('\uD83D\uDD27 DELETE filtros originais:',_0x1591a4['filters']),response=await this['httpClient']['delete'](deleteUrl,{'headers':headers});}else{if(_0x4b03fe==='PATCH'){const _0x75d956=_0xa4aff9['split']('?'),_0x24f4f5=_0x75d956[0x0],existingParams=new URLSearchParams(_0x75d956[0x1]||'');!existingParams[_0x3f558b(-0x1e,-0x9a)](_0x3f558b(-0x39,-0x34))&&existingParams[_0x3f558b(-0x16,-0x9e)](_0x3f558b(-0x9c,-0x34),'update');_0x1591a4[_0x3f558b(-0x11e,-0xfc)]?.['length']&&_0x1591a4['filters']['forEach'](filter=>{function _0x3b8e6c(_0x3027a7,_0x1579a7){return _0x30c5(_0x1579a7- -0x134,_0x3027a7);}existingParams[_0x3b8e6c(0xa,0x8c)](filter['column'],filter['operator']+'.'+filter['value']);});_0x1591a4['options']?.['prefer']&&(headers['Prefer']=_0x1591a4['options']['prefer']);const updateUrl=_0x24f4f5+'?'+existingParams['toString']();response=await this['httpClient'][_0x3f558b(-0x144,-0xc6)](updateUrl,_0x1591a4[_0x3f558b(-0xe0,-0xae)],{'headers':headers});}else{let _0x28a867=_0x1591a4[_0x3f558b(-0xb6,-0xae)];!headers['Prefer']&&(headers['Prefer']=_0x3f558b(-0x34,-0x2d)),_0x1591a4['options']?.['upsert']&&(headers['Prefer']='resolution=merge-duplicates,return=representation'),_0x1591a4['dataArray']&&(_0x28a867=_0x1591a4[_0x3f558b(-0x51,-0x15)]),response=await this[_0x3f558b(-0x78,-0xb1)][_0x3f558b(-0x139,-0xf3)](_0xa4aff9,_0x28a867,{'headers':headers});}}}return{'data':response['data'],'error':null,'count':response[_0x3f558b(-0x7b,-0x71)]?.[_0x3f558b(-0x61,-0x62)]?parseInt(response[_0x3f558b(-0x50,-0x71)]['x-total-count']):undefined};}catch(_0x36e816){return{'data':null,'error':_0x36e816 instanceof EBaaSError?_0x36e816:new EBaaSError(_0x36e816 instanceof Error?_0x36e816['message']:_0x3f558b(-0x19,-0x8a),0x0,_0x36e816)};}}}class CustomDatabaseManager{constructor(_0x56724d,_0x3ee3eb){this[_0x5ddab5(0x9b,0x63)]=_0x56724d;function _0x5ddab5(_0x111dcb,_0x3566e4){return _0x30c5(_0x3566e4- -0x14a,_0x111dcb);}this['workspaceId']=_0x3ee3eb;}async[_0x684fad(0x4fe,0x4bf)](){if(!this['workspaceId'])return{'hasCustomDatabase':![]};try{const response=await this['httpClient'][_0x37f313(0x555,0x521)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this[_0x37f313(0x496,0x474)]}});if(response['status']===0xc8&&response[_0x37f313(0x4bd,0x479)]?.[_0x37f313(0x499,0x471)]){const config=response[_0x37f313(0x4bd,0x448)]['config'],_0x845471={'host':config[_0x37f313(0x520,0x57f)],'port':config['postgresPort'],'database':config[_0x37f313(0x4b0,0x4ab)],'username':config['postgresUsername'],'password':'','schema':config['postgresSchema'],'sslEnabled':config['sslEnabled']};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x845471},this[_0x37f313(0x530,0x4f5)];}}catch(_0x31d94e){if(_0x31d94e?.[_0x37f313(0x522,0x4bd)]===0x194)return this[_0x37f313(0x530,0x5b1)]={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x31d94e);}this[_0x37f313(0x530,0x4df)]={'hasCustomDatabase':![]};function _0x37f313(_0x176848,_0x8a9b12){return _0x30c5(_0x176848-0x30d,_0x8a9b12);}return this[_0x37f313(0x530,0x53f)];}async['testConnection'](_0x551881){try{const response=await this['httpClient']['post']('/admin/v1/workspace/custom-database/test-connection',_0x551881,{'headers':this['workspaceId']?{'X-Workspace-ID':this['workspaceId']}:{}});return response['data'];}catch(_0x45edc4){return{'success':![],'message':_0x45edc4?.['message']||'Failed\x20to\x20test\x20connection'};}}async['configureCustomDatabase'](_0x467196){if(!this[_0x130298(0x191,0x1a7)])throw new Error('Workspace ID is required to configure custom database');const response=await this['httpClient'][_0x130298(0x173,0xf5)]('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x467196},{'headers':{'X-Workspace-ID':this['workspaceId']}}),config=response[_0x130298(0x1b8,0x14e)][_0x130298(0x194,0x1ca)];this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x467196};function _0x130298(_0x3827a4,_0x1048a8){return _0x30c5(_0x3827a4-0x8,_0x1048a8);}return config;}async[_0x684fad(0x48f,0x49d)](){if(!this['workspaceId'])throw new Error('Workspace ID is required to remove custom database');function _0x5404e5(_0xb17610,_0x4dfe68){return _0x30c5(_0x4dfe68-0xc5,_0xb17610);}await this[_0x5404e5(0x23f,0x272)]['delete']('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this['workspaceId']}}),this['detectedConfig']={'hasCustomDatabase':![]};}['getDetectedConfig'](){function _0x566aa2(_0x540e76,_0x46bf21){return _0x30c5(_0x540e76- -0x2a,_0x46bf21);}return this[_0x566aa2(0x1f9,0x1d2)];}['hasCustomDatabase'](){return this['detectedConfig']?.['hasCustomDatabase']??![];}[_0x684fad(0x4b0,0x4b4)](){return this['detectedConfig']?.['credentials'];}['setWorkspaceId'](_0x3e149d){function _0x122cae(_0x32b9f3,_0x2ff81c){return _0x30c5(_0x32b9f3- -0x15c,_0x2ff81c);}this['workspaceId']=_0x3e149d,this[_0x122cae(0xc7,0x68)]=undefined;}[_0x684fad(0x48c,0x4d8)](){function _0xbc62ee(_0x4dc3c4,_0x391bfd){return _0x30c5(_0x4dc3c4-0x348,_0x391bfd);}return this[_0xbc62ee(0x4d1,0x503)];}['getStatus'](){function _0x409864(_0x50e5e5,_0x4048cf){return _0x30c5(_0x4048cf- -0xec,_0x50e5e5);}return{'workspaceId':this['workspaceId'],'hasConfig':this[_0x409864(0x1f,0x97)](),'configDetails':this[_0x409864(0x156,0x137)]?.[_0x409864(0x1c1,0x13f)]?{'host':this[_0x409864(0xf1,0x137)]['credentials']['host'],'port':this[_0x409864(0x14d,0x137)][_0x409864(0x107,0x13f)]['port'],'database':this[_0x409864(0x13d,0x137)][_0x409864(0x17a,0x13f)][_0x409864(0x87,0xde)],'schema':this[_0x409864(0x180,0x137)]['credentials'][_0x409864(0xd2,0x87)]||_0x409864(0x37,0x80),'sslEnabled':this[_0x409864(0x1a4,0x137)][_0x409864(0x12b,0x13f)][_0x409864(0xe4,0xa6)]||![]}:undefined};}}class DatabaseClient{constructor(_0x114ac7,_0x1237da){this[_0x37a8cc(-0x1df,-0x264)]=_0x114ac7;function _0x37a8cc(_0x5315ed,_0x1e4e8d){return _0x30c5(_0x5315ed- -0x38c,_0x1e4e8d);}this[_0x37a8cc(-0x148,-0x14c)]=new CustomDatabaseManager(_0x114ac7,_0x1237da);}[_0x684fad(0x4c6,0x51b)](_0x266071){function _0x389505(_0x2d02bb,_0x1966a4){return _0x30c5(_0x2d02bb- -0x195,_0x1966a4);}return new QueryBuilder(this[_0x389505(0x18,0x80)],_0x266071,this['currentSchema'],this['customDatabaseManager'][_0x389505(-0x35,0x53)]());}['rpc'](_0x21e2a7,_0x56ea1c){function _0x1fb885(_0x220798,_0x49e816){return _0x30c5(_0x220798-0x40,_0x49e816);}return this[_0x1fb885(0x1ed,0x25b)]['post'](_0x1fb885(0x23d,0x232)+_0x21e2a7,_0x56ea1c);}[_0x684fad(0x49f,0x485)](_0xf40fd5){const _0xa64e9d=new DatabaseClient(this['httpClient'],this['customDatabaseManager']['getWorkspaceId']());function _0x180fee(_0x4ca35e,_0x195217){return _0x30c5(_0x4ca35e- -0x10,_0x195217);}return _0xa64e9d[_0x180fee(0x184,0x1b8)]=_0xf40fd5,_0xa64e9d[_0x180fee(0x234,0x1ca)]=this[_0x180fee(0x234,0x287)],_0xa64e9d;}async['detectCustomDatabase'](){return this['customDatabaseManager']['detectCustomDatabase']();}async['testCustomConnection'](_0x312c4f){function _0x138930(_0x5cb105,_0x57bbd9){return _0x30c5(_0x5cb105- -0x8,_0x57bbd9);}return this[_0x138930(0x23c,0x225)][_0x138930(0x24d,0x201)](_0x312c4f);}async[_0x684fad(0x548,0x4eb)](_0x461a3a){function _0x376118(_0xd9c829,_0x56d781){return _0x30c5(_0xd9c829- -0xb2,_0x56d781);}return this[_0x376118(0x192,0x16d)]['configureCustomDatabase'](_0x461a3a);}async['removeCustomDatabase'](){return this['customDatabaseManager']['removeCustomDatabase']();}[_0x684fad(0x594,0x603)](){function _0x5c45cf(_0x1235f8,_0x104600){return _0x30c5(_0x104600- -0x10b,_0x1235f8);}return this['customDatabaseManager'][_0x5c45cf(0xbf,0x78)]();}['getCustomDatabaseStatus'](){function _0x7a7a52(_0x41be6a,_0x13b295){return _0x30c5(_0x13b295- -0x2a6,_0x41be6a);}return this['customDatabaseManager'][_0x7a7a52(-0x163,-0xde)]();}['setWorkspaceId'](_0x4bf979){function _0x14d6c3(_0xceb578,_0x4499b1){return _0x30c5(_0xceb578-0x3e2,_0x4499b1);}this['customDatabaseManager'][_0x14d6c3(0x5c0,0x598)](_0x4bf979);}async['initialize'](){try{await this['customDatabaseManager']['detectCustomDatabase']();}catch(_0x3fa6ae){console['warn']('Failed to initialize custom database detection:',_0x3fa6ae);}}}function _0x684fad(_0x75299c,_0x4d824c){return _0x30c5(_0x75299c-0x32c,_0x4d824c);}class StorageBucket{constructor(_0x899482,bucketId){function _0x359f8a(_0x52b651,_0x32421a){return _0x30c5(_0x32421a- -0x8b,_0x52b651);}this[_0x359f8a(0xfd,0x122)]=_0x899482,this['bucketId']=bucketId;}async['upload'](_0x3c5613,_0x35de88,_0x26cadd){function _0x2c6981(_0x362d90,_0x2693ad){return _0x30c5(_0x2693ad- -0x1c3,_0x362d90);}try{const _0x4281ab=new FormData();if(_0x35de88 instanceof File)_0x4281ab['append']('file',_0x35de88);else{if(_0x35de88 instanceof Blob)_0x4281ab[_0x2c6981(-0x1f,-0x3)]('file',_0x35de88,_0x3c5613);else{if(_0x35de88 instanceof ArrayBuffer)_0x4281ab['append'](_0x2c6981(-0x56,-0x12),new Blob([_0x35de88]),_0x3c5613);else typeof _0x35de88==='string'&&_0x4281ab['append']('file',new Blob([_0x35de88],{'type':_0x2c6981(0xf7,0x80)}),_0x3c5613);}}_0x4281ab['append']('path',_0x3c5613);_0x26cadd?.['cacheControl']&&_0x4281ab[_0x2c6981(-0x63,-0x3)]('cacheControl',_0x26cadd[_0x2c6981(-0x16,0x63)]);_0x26cadd?.[_0x2c6981(-0x6f,0x6)]&&_0x4281ab['append'](_0x2c6981(0x89,0x6),_0x26cadd['contentType']);_0x26cadd?.['metadata']&&_0x4281ab['append'](_0x2c6981(0x85,0x44),JSON['stringify'](_0x26cadd['metadata']));const _0x35786c='/storage/buckets/'+this[_0x2c6981(0x8,0x2b)]+'/files'+(_0x26cadd?.['upsert']?'?upsert=true':''),response=await this[_0x2c6981(0x5e,-0x16)]['post'](_0x35786c,_0x4281ab,{'headers':{'Content-Type':_0x2c6981(0x6a,0x4f)}});return{'data':response['data'],'error':null};}catch(_0xcd4e27){return{'data':null,'error':_0xcd4e27 instanceof EBaaSError?_0xcd4e27:new EBaaSError(_0xcd4e27 instanceof Error?_0xcd4e27[_0x2c6981(0x71,0x47)]:_0x2c6981(0x54,0xa9),0x0,_0xcd4e27)};}}async[_0x684fad(0x527,0x589)](_0x21b82f,_0x30c244){function _0x3cd4e5(_0x1668b9,_0x4745cd){return _0x30c5(_0x4745cd- -0x158,_0x1668b9);}try{const _0x2da49b=new URLSearchParams();_0x30c244?.['transform']&&Object['entries'](_0x30c244[_0x3cd4e5(-0x21,0x35)])['forEach'](([_0x174aa2,_0x5392e1])=>{function _0x1b6aae(_0x571332,_0x4497c1){return _0x30c5(_0x4497c1- -0x7a,_0x571332);}_0x5392e1!==undefined&&_0x2da49b[_0x1b6aae(0xc8,0x146)](_0x174aa2,String(_0x5392e1));});const _0x5a470f='/storage/buckets/'+this['bucketId']+_0x3cd4e5(0xbb,0x65)+_0x21b82f+(_0x2da49b[_0x3cd4e5(-0x20,0x56)]()?'?'+_0x2da49b['toString']():''),response=await this[_0x3cd4e5(0xc6,0x55)]['get'](_0x5a470f,{'responseType':_0x3cd4e5(0x139,0x10f)});return{'data':response['data'],'error':null};}catch(_0x4119ad){return{'data':null,'error':_0x4119ad instanceof EBaaSError?_0x4119ad:new EBaaSError(_0x4119ad instanceof Error?_0x4119ad[_0x3cd4e5(0x93,0xb2)]:_0x3cd4e5(0xcc,0x5b),0x0,_0x4119ad)};}}async['list'](_0x381016,_0x23eac5){function _0x7ee452(_0x2f6d7f,_0x13acb3){return _0x30c5(_0x13acb3- -0x336,_0x2f6d7f);}try{const _0x1b6c14=new URLSearchParams();_0x381016&&_0x1b6c14['append'](_0x7ee452(-0x19f,-0x11d),_0x381016);_0x23eac5?.[_0x7ee452(-0x1a0,-0x135)]&&_0x1b6c14[_0x7ee452(-0x111,-0x176)]('limit',String(_0x23eac5['limit']));_0x23eac5?.['offset']&&_0x1b6c14['append'](_0x7ee452(-0xd2,-0x14a),String(_0x23eac5[_0x7ee452(-0x1ca,-0x14a)]));_0x23eac5?.[_0x7ee452(-0xfc,-0xd3)]&&_0x1b6c14['append']('sortBy',JSON[_0x7ee452(-0xc6,-0xe2)](_0x23eac5[_0x7ee452(-0xb2,-0xd3)]));_0x23eac5?.['search']&&_0x1b6c14['append']('search',_0x23eac5['search']);const _0xb630a7=_0x7ee452(-0x168,-0x12d)+this['bucketId']+_0x7ee452(-0x14e,-0x10d)+(_0x1b6c14[_0x7ee452(-0x120,-0x188)]()?'?'+_0x1b6c14[_0x7ee452(-0x1b3,-0x188)]():''),response=await this[_0x7ee452(-0x1cd,-0x189)][_0x7ee452(-0xde,-0xee)](_0xb630a7);return{'data':response['data'],'error':null};}catch(_0x3c3fa7){return{'data':null,'error':_0x3c3fa7 instanceof EBaaSError?_0x3c3fa7:new EBaaSError(_0x3c3fa7 instanceof Error?_0x3c3fa7[_0x7ee452(-0x11e,-0x12c)]:'Failed\x20to\x20list\x20files',0x0,_0x3c3fa7)};}}async['remove'](_0x18ff70){function _0xf94f4d(_0x34906a,_0x538100){return _0x30c5(_0x538100- -0x1a7,_0x34906a);}try{const response=await this[_0xf94f4d(-0x21,0x6)]['delete']('/storage/buckets/'+this[_0xf94f4d(0x49,0x47)]+'/files',{'data':{'paths':_0x18ff70}});return{'data':response['data'],'error':null};}catch(_0x499c67){return{'data':null,'error':_0x499c67 instanceof EBaaSError?_0x499c67:new EBaaSError(_0x499c67 instanceof Error?_0x499c67['message']:_0xf94f4d(0x12b,0xa4),0x0,_0x499c67)};}}async[_0x684fad(0x54c,0x5ca)](fromPath,_0x534abc){function _0x2bcb8d(_0x435062,_0x17f6dd){return _0x30c5(_0x435062- -0xf3,_0x17f6dd);}try{const response=await this[_0x2bcb8d(0xba,0x12a)][_0x2bcb8d(0x78,0xd)](_0x2bcb8d(0x116,0xb6)+this[_0x2bcb8d(0xfb,0xb5)]+'/files/move',{'sourceKey':fromPath,'destinationKey':_0x534abc});return{'data':response['data'],'error':null};}catch(_0x591885){return{'data':null,'error':_0x591885 instanceof EBaaSError?_0x591885:new EBaaSError(_0x591885 instanceof Error?_0x591885['message']:_0x2bcb8d(0x128,0x18a),0x0,_0x591885)};}}async['copy'](fromPath,_0x24a1f7){function _0x52dc6f(_0x1e37a4,_0x52bffb){return _0x30c5(_0x1e37a4-0x36e,_0x52bffb);}try{const response=await this['httpClient']['post'](_0x52dc6f(0x577,0x50e)+this['bucketId']+_0x52dc6f(0x533,0x576),{'sourceKey':fromPath,'destinationKey':_0x24a1f7});return{'data':response['data'],'error':null};}catch(_0x295224){return{'data':null,'error':_0x295224 instanceof EBaaSError?_0x295224:new EBaaSError(_0x295224 instanceof Error?_0x295224[_0x52dc6f(0x578,0x5ee)]:'Failed\x20to\x20copy\x20file',0x0,_0x295224)};}}async[_0x684fad(0x57e,0x576)](_0x362bc7,_0x23cd3f,_0x4efd1d){function _0x37b72e(_0x497572,_0x30ab10){return _0x30c5(_0x497572-0x1a9,_0x30ab10);}try{const response=await this['httpClient'][_0x37b72e(0x314,0x36f)]('/storage/buckets/'+this[_0x37b72e(0x397,0x329)]+'/files/'+_0x362bc7+_0x37b72e(0x3d5,0x377),{'expiresIn':_0x23cd3f,..._0x4efd1d});return{'data':response['data'],'error':null};}catch(_0x192908){return{'data':null,'error':_0x192908 instanceof EBaaSError?_0x192908:new EBaaSError(_0x192908 instanceof Error?_0x192908[_0x37b72e(0x3b3,0x3bc)]:_0x37b72e(0x402,0x46d),0x0,_0x192908)};}}['getPublicUrl'](_0x59e159,_0x1b9812){function _0x226c57(_0x339a0d,_0x4d4b8a){return _0x30c5(_0x339a0d- -0xc5,_0x4d4b8a);}const _0x39fc1d=new URLSearchParams();_0x1b9812?.['transform']&&Object[_0x226c57(0xf5,0x12b)](_0x1b9812['transform'])[_0x226c57(0x10c,0x155)](([_0x5e94ad,_0x1dffb8])=>{_0x1dffb8!==undefined&&_0x39fc1d['append'](_0x5e94ad,String(_0x1dffb8));});const _0x553033=this[_0x226c57(0xe8,0xa6)][_0x226c57(0x135,0x155)]||'',_0x419bc6=_0x553033+_0x226c57(0x144,0x145)+this[_0x226c57(0x129,0x1a8)]+'/files/'+_0x59e159+(_0x39fc1d[_0x226c57(0xe9,0x94)]()?'?'+_0x39fc1d[_0x226c57(0xe9,0x153)]():'');return{'data':{'publicUrl':_0x419bc6}};}async['getFileInfo'](_0x4e4391){function _0x35dac3(_0x5f1eed,_0x32c378){return _0x30c5(_0x5f1eed-0x3b4,_0x32c378);}try{const response=await this['httpClient']['get'](_0x35dac3(0x5bd,0x62c)+this[_0x35dac3(0x5a2,0x595)]+_0x35dac3(0x571,0x518)+_0x4e4391+'/info');return{'data':response[_0x35dac3(0x564,0x58a)],'error':null};}catch(_0x43bd0f){return{'data':null,'error':_0x43bd0f instanceof EBaaSError?_0x43bd0f:new EBaaSError(_0x43bd0f instanceof Error?_0x43bd0f['message']:_0x35dac3(0x55b,0x530),0x0,_0x43bd0f)};}}async[_0x684fad(0x494,0x45e)](_0x25cc4f,metadata){function _0x4f5dff(_0x575205,_0x4571a0){return _0x30c5(_0x575205- -0x25e,_0x4571a0);}try{const response=await this[_0x4f5dff(-0xb1,-0xc3)][_0x4f5dff(-0xaf,-0xab)](_0x4f5dff(-0x55,0xf)+this['bucketId']+'/files/'+_0x25cc4f+_0x4f5dff(-0xe2,-0x7e),{'metadata':metadata});return{'data':response['data'],'error':null};}catch(_0x51d2cb){return{'data':null,'error':_0x51d2cb instanceof EBaaSError?_0x51d2cb:new EBaaSError(_0x51d2cb instanceof Error?_0x51d2cb['message']:_0x4f5dff(-0x3c,-0x58),0x0,_0x51d2cb)};}}}class StorageClient{constructor(_0x139b86){function _0x316611(_0x3b1d93,_0x50fd21){return _0x30c5(_0x50fd21-0x24,_0x3b1d93);}this[_0x316611(0x1ac,0x1d1)]=_0x139b86;}[_0x684fad(0x4c6,0x52b)](bucketId){function _0x32a2b1(_0x52d6c8,_0x1e7d9f){return _0x30c5(_0x52d6c8- -0x30a,_0x1e7d9f);}return new StorageBucket(this[_0x32a2b1(-0x15d,-0x12d)],bucketId);}async[_0x684fad(0x53a,0x540)](_0x1d9f36,_0x4343f0){function _0x10d61a(_0x4b23bb,_0x269042){return _0x30c5(_0x269042- -0x1dc,_0x4b23bb);}try{const response=await this[_0x10d61a(-0xb6,-0x2f)]['post']('/storage/buckets',{'id':_0x1d9f36,..._0x4343f0});return{'data':response['data'],'error':null};}catch(_0x5555f3){return{'data':null,'error':_0x5555f3 instanceof EBaaSError?_0x5555f3:new EBaaSError(_0x5555f3 instanceof Error?_0x5555f3['message']:_0x10d61a(-0x56,-0x4b),0x0,_0x5555f3)};}}async['getBucket'](_0x4201a1){function _0x532386(_0x40d927,_0x2c83e8){return _0x30c5(_0x40d927- -0x2d2,_0x2c83e8);}try{const response=await this[_0x532386(-0x125,-0x114)][_0x532386(-0x8a,-0x77)]('/storage/buckets/'+_0x4201a1);return{'data':response['data'],'error':null};}catch(_0x242572){return{'data':null,'error':_0x242572 instanceof EBaaSError?_0x242572:new EBaaSError(_0x242572 instanceof Error?_0x242572[_0x532386(-0xc8,-0xb6)]:'Failed\x20to\x20get\x20bucket',0x0,_0x242572)};}}async[_0x684fad(0x513,0x49a)](){function _0x203bbc(_0x5787b6,_0x485aee){return _0x30c5(_0x485aee-0x23c,_0x5787b6);}try{const response=await this[_0x203bbc(0x453,0x3e9)]['get']('/storage/buckets');return{'data':response[_0x203bbc(0x3b2,0x3ec)],'error':null};}catch(_0x4e9b9d){return{'data':null,'error':_0x4e9b9d instanceof EBaaSError?_0x4e9b9d:new EBaaSError(_0x4e9b9d instanceof Error?_0x4e9b9d[_0x203bbc(0x432,0x446)]:_0x203bbc(0x49d,0x416),0x0,_0x4e9b9d)};}}async['updateBucket'](_0x1c9c0d,_0x32b4ae){function _0x1875c3(_0x5cc284,_0x4b2d65){return _0x30c5(_0x5cc284-0x1dc,_0x4b2d65);}try{const response=await this[_0x1875c3(0x389,0x3ae)]['put']('/storage/buckets/'+_0x1c9c0d,_0x32b4ae);return{'data':response['data'],'error':null};}catch(_0x567f28){return{'data':null,'error':_0x567f28 instanceof EBaaSError?_0x567f28:new EBaaSError(_0x567f28 instanceof Error?_0x567f28[_0x1875c3(0x3e6,0x3a1)]:_0x1875c3(0x3aa,0x35b),0x0,_0x567f28)};}}async['deleteBucket'](_0x5882f1){function _0x3e42f7(_0x41959c,_0x25fdd0){return _0x30c5(_0x41959c- -0x16f,_0x25fdd0);}try{const response=await this[_0x3e42f7(0x3e,0xa7)]['delete']('/storage/buckets/'+_0x5882f1);return{'data':response['data'],'error':null};}catch(_0x1ed502){return{'data':null,'error':_0x1ed502 instanceof EBaaSError?_0x1ed502:new EBaaSError(_0x1ed502 instanceof Error?_0x1ed502[_0x3e42f7(0x9b,0xb2)]:_0x3e42f7(0x45,0xaa),0x0,_0x1ed502)};}}async['getUsage'](){try{const response=await this['httpClient']['get']('/storage/usage');return{'data':response['data'],'error':null};}catch(_0xcae998){return{'data':null,'error':_0xcae998 instanceof EBaaSError?_0xcae998:new EBaaSError(_0xcae998 instanceof Error?_0xcae998['message']:'Failed\x20to\x20get\x20storage\x20usage',0x0,_0xcae998)};}}}class EventManager{constructor(){function _0x2bfe90(_0x24f6d4,_0x37108d){return _0x30c5(_0x24f6d4- -0xf3,_0x37108d);}this[_0x2bfe90(0x169,0x1f1)]=new Map(),this['maxListeners']=0xa;}['on'](_0x2e0bae,_0x2e6fbc){!this['events']['has'](_0x2e0bae)&&this[_0x1c8cce(0x578,0x567)]['set'](_0x2e0bae,new Set());function _0x1c8cce(_0x12fc4c,_0x2308d8){return _0x30c5(_0x12fc4c-0x31c,_0x2308d8);}this['events']['get'](_0x2e0bae)['add'](_0x2e6fbc);}['off'](_0x3cd215,_0x2399d3){if(!this['events']['has'](_0x3cd215))return;function _0x31d09b(_0x24908e,_0x16b70c){return _0x30c5(_0x16b70c- -0xa0,_0x24908e);}const _0x5dd375=this['events'][_0x31d09b(0x211,0x1a8)](_0x3cd215);_0x2399d3?_0x5dd375[_0x31d09b(0x1ba,0x190)](_0x2399d3):_0x5dd375['clear'](),_0x5dd375[_0x31d09b(0x128,0x195)]===0x0&&this['events'][_0x31d09b(0x12f,0x190)](_0x3cd215);}['emit'](_0x39d9e4,..._0xc27fd3){if(!this[_0x2a7115(0xba,0xcf)]['has'](_0x39d9e4))return![];function _0x2a7115(_0x1f86b9,_0x50dccb){return _0x30c5(_0x1f86b9- -0x1a2,_0x50dccb);}const _0x444772=this['events']['get'](_0x39d9e4);for(const _0xb28fcd of _0x444772){try{_0xb28fcd(..._0xc27fd3);}catch(_0x4a58b3){console['error'](_0x2a7115(0xa,0x66)+_0x39d9e4+'\x22:',_0x4a58b3);}}return _0x444772[_0x2a7115(0x93,0x4c)]>0x0;}['removeAllListeners'](_0x174de7){function _0x2b3768(_0xae50a6,_0xb9cfa0){return _0x30c5(_0xae50a6-0x38f,_0xb9cfa0);}_0x174de7?this['events'][_0x2b3768(0x5bf,0x572)](_0x174de7):this['events']['clear']();}['listenerCount'](_0x52d382){function _0x5922c1(_0x3e2528,_0x466656){return _0x30c5(_0x3e2528-0x272,_0x466656);}return this['events'][_0x5922c1(0x4ba,0x4ad)](_0x52d382)?.['size']??0x0;}['eventNames'](){function _0x186aa3(_0x177ce1,_0x429765){return _0x30c5(_0x177ce1-0x103,_0x429765);}return Array[_0x186aa3(0x29d,0x276)](this['events']['keys']());}[_0x684fad(0x512,0x498)](_0x2a53cc){function _0x229d45(_0x229b83,_0x555f8a){return _0x30c5(_0x229b83-0x9e,_0x555f8a);}return Array[_0x229d45(0x238,0x284)](this[_0x229d45(0x2fa,0x2a2)]['get'](_0x2a53cc)??[]);}['addListener'](_0x4dae67,_0x3abf53){this['on'](_0x4dae67,_0x3abf53);}['removeListener'](_0x645e99,_0x394ad7){this['off'](_0x645e99,_0x394ad7);}[_0x684fad(0x504,0x48a)](_0x17be6e,_0x14b231){const _0x93878e=(..._0x153bb5)=>{function _0x45f239(_0x3cce78,_0x47dd10){return _0x30c5(_0x3cce78- -0x1e2,_0x47dd10);}this[_0x45f239(-0x24,-0x4d)](_0x17be6e,_0x93878e),_0x14b231(..._0x153bb5);};this['on'](_0x17be6e,_0x93878e);}[_0x684fad(0x52c,0x4ab)](_0x4de672,_0x13188a){this['on'](_0x4de672,_0x13188a);}['prependOnceListener'](_0x588b2b,_0xf221fd){const _0x209be0=(..._0xaec049)=>{this['off'](_0x588b2b,_0x209be0),_0xf221fd(..._0xaec049);};this['on'](_0x588b2b,_0x209be0);}[_0x684fad(0x525,0x5ab)](_0x15640e){return this['maxListeners']=_0x15640e,this;}[_0x684fad(0x4bc,0x4c6)](){function _0x41f076(_0x40c632,_0xa6bd00){return _0x30c5(_0xa6bd00-0x38a,_0x40c632);}return this[_0x41f076(0x56a,0x509)];}['rawListeners'](_0x4675a4){function _0x4f6fb3(_0x36bdf0,_0x5712e6){return _0x30c5(_0x5712e6-0x18a,_0x36bdf0);}return this[_0x4f6fb3(0x34a,0x370)](_0x4675a4);}}class RealtimeChannel extends EventManager{constructor(_0x1952f7,_0x25e2d8){super();function _0x345c96(_0x3a018c,_0xfe0f62){return _0x30c5(_0xfe0f62-0x20b,_0x3a018c);}this[_0x345c96(0x42b,0x45a)]=![],this['state']='closed',this[_0x345c96(0x3e7,0x3ab)]=new Map(),this[_0x345c96(0x3ea,0x3ec)]=_0x1952f7,this[_0x345c96(0x407,0x399)]=_0x25e2d8;}['subscribe'](_0x30e4fd){!this[_0x1c0d6b(0x10f,0xe3)]&&(this[_0x1c0d6b(0xfd,0xe3)]=!![],this['_join']());function _0x1c0d6b(_0x22bd8c,_0x4759f0){return _0x30c5(_0x4759f0- -0x16c,_0x22bd8c);}return _0x30e4fd&&this['on']('status',_0x30e4fd),this;}[_0x684fad(0x591,0x533)](filter,_0x541f54){const _0x6769ad='postgres_changes:'+JSON['stringify'](filter);this['on'](_0x6769ad,_0x541f54);const _0x2035cb={'unsubscribe':()=>{function _0x432209(_0x38ff80,_0x114b47){return _0x30c5(_0x114b47-0xe6,_0x38ff80);}this[_0x432209(0x2d4,0x2a4)](_0x6769ad,_0x541f54),this[_0x432209(0x2b2,0x286)]['delete'](_0x6769ad);}};this[_0xd9210d(-0x23b,-0x1ff)][_0xd9210d(-0x27c,-0x26d)](_0x6769ad,_0x2035cb);function _0xd9210d(_0x4bf96c,_0x365999){return _0x30c5(_0x4bf96c- -0x3db,_0x365999);}return this['socket']?.['connected']&&this['state']===_0xd9210d(-0x26e,-0x1f6)&&this[_0xd9210d(-0x24d,-0x1f5)]['emit'](_0xd9210d(-0x244,-0x1f3),{'topic':this[_0xd9210d(-0x1fa,-0x260)],'filter':filter,'ref':this['makeRef']()}),_0x2035cb;}[_0x684fad(0x4b6,0x4cd)](filter,_0x5120c1){const _0x4b34da='broadcast:'+JSON[_0x357b46(0x46a,0x4c0)](filter);this['on'](_0x4b34da,_0x5120c1);function _0x357b46(_0x563aea,_0x3a5cd4){return _0x30c5(_0x563aea-0x216,_0x3a5cd4);}const _0x3495dd={'unsubscribe':()=>{this['off'](_0x4b34da,_0x5120c1),this['subscriptions']['delete'](_0x4b34da);}};return this[_0x357b46(0x3b6,0x3b4)]['set'](_0x4b34da,_0x3495dd),_0x3495dd;}[_0x684fad(0x599,0x5a8)](filter,_0x1e5956){const _0x522b03='presence:'+JSON['stringify'](filter);this['on'](_0x522b03,_0x1e5956);function _0x445406(_0x22ab82,_0x9b6606){return _0x30c5(_0x22ab82-0x1cf,_0x9b6606);}const _0x2b8fe6={'unsubscribe':()=>{this[_0x4a41a4(0xf7,0xad)](_0x522b03,_0x1e5956);function _0x4a41a4(_0xed1921,_0xf27306){return _0x30c5(_0xed1921- -0xc7,_0xf27306);}this[_0x4a41a4(0xd9,0x117)]['delete'](_0x522b03);}};return this['subscriptions'][_0x445406(0x32e,0x333)](_0x522b03,_0x2b8fe6),_0x2b8fe6;}['send'](_0x28be1c){return new Promise(_0x3382cf=>{function _0x8ea1a1(_0x1ad8fa,_0x4dd258){return _0x30c5(_0x4dd258- -0x2bf,_0x1ad8fa);}this['socket']?.['connected']&&this['state']===_0x8ea1a1(-0x11f,-0x152)?(this[_0x8ea1a1(-0x11b,-0x131)]['emit'](_0x8ea1a1(-0xb8,-0x139),{'topic':this['topic'],'event':_0x28be1c[_0x8ea1a1(-0x14,-0x8c)],'payload':_0x28be1c,'ref':this['makeRef']()}),_0x3382cf('ok')):_0x3382cf('error');});}[_0x684fad(0x57f,0x56f)](_0x47e8f9){return new Promise(_0x112aad=>{function _0x11b6b4(_0x506dcb,_0x277c76){return _0x30c5(_0x506dcb-0x21f,_0x277c76);}this[_0x11b6b4(0x3ad,0x3ce)]?.[_0x11b6b4(0x3f4,0x3aa)]&&this['state']===_0x11b6b4(0x38c,0x33d)?(this[_0x11b6b4(0x3ad,0x375)][_0x11b6b4(0x3fb,0x42a)]('presence',{'topic':this[_0x11b6b4(0x400,0x436)],'event':'track','payload':_0x47e8f9,'ref':this['makeRef']()}),_0x112aad('ok')):_0x112aad(_0x11b6b4(0x393,0x39a));});}['untrack'](){return new Promise(_0x59fac5=>{function _0x3b0902(_0x2dd050,_0x43527b){return _0x30c5(_0x43527b-0x84,_0x2dd050);}this['socket']?.[_0x3b0902(0x1ec,0x259)]&&this[_0x3b0902(0x1b1,0x1f5)]==='joined'?(this[_0x3b0902(0x223,0x212)]['emit'](_0x3b0902(0x1db,0x23c),{'topic':this['topic'],'event':_0x3b0902(0x2ee,0x2bf),'ref':this[_0x3b0902(0x299,0x267)]()}),_0x59fac5('ok')):_0x59fac5('error');});}['unsubscribe'](){return new Promise(_0x375bff=>{this[_0x4500c8(0x2c4,0x2a0)]='leaving',this['subscriptions'][_0x4500c8(0x2e9,0x300)](_0x4de785=>{function _0x1b28a8(_0x2dcf77,_0x47b89d){return _0x30c5(_0x2dcf77-0x240,_0x47b89d);}_0x4de785[_0x1b28a8(0x46f,0x4b0)]();}),this[_0x4500c8(0x345,0x2cf)][_0x4500c8(0x38f,0x38d)]();this['socket']?.[_0x4500c8(0x2f7,0x304)]&&this['socket'][_0x4500c8(0x35c,0x30b)](_0x4500c8(0x2a5,0x306),{'topic':this[_0x4500c8(0x304,0x310)],'ref':this[_0x4500c8(0x320,0x312)]()});this[_0x4500c8(0x2e8,0x2a0)]=_0x4500c8(0x33d,0x375),this[_0x4500c8(0x27a,0x2f2)]();function _0x4500c8(_0x49211e,_0x50cdc6){return _0x30c5(_0x50cdc6-0x12f,_0x49211e);}_0x375bff('ok');});}['_join'](){function _0x21db74(_0x5cf96c,_0x374bce){return _0x30c5(_0x5cf96c- -0x11e,_0x374bce);}if(this[_0x21db74(0x53,0x28)]==='leaving')return;this['state']=_0x21db74(0x7d,0xd4),this['socket']?.['connected']&&(this['socket'][_0x21db74(0xbe,0x4d)](_0x21db74(0x122,0x135),{'topic':this['topic'],'ref':this['makeRef']()}),setTimeout(()=>{function _0x3a67e2(_0x38820e,_0x35054c){return _0x30c5(_0x35054c- -0x246,_0x38820e);}this[_0x3a67e2(-0x13a,-0xd5)]==='joining'&&(this['state']=_0x3a67e2(-0x137,-0xd9),this[_0x3a67e2(-0xd8,-0x6a)]('status',_0x3a67e2(-0x63,-0x7f)));},0x64));}['_rejoin'](){function _0x327e80(_0x5b7cb1,_0x28d13c){return _0x30c5(_0x28d13c- -0x3c9,_0x5b7cb1);}this[_0x327e80(-0x1c9,-0x17a)]&&(this['_join'](),this[_0x327e80(-0x266,-0x229)]['forEach']((_0x3ac344,_0x22114e)=>{function _0x398e94(_0x2e1e1b,_0x231296){return _0x30c5(_0x2e1e1b- -0x7,_0x231296);}if(_0x22114e['startsWith']('postgres_changes:')){const filter=JSON[_0x398e94(0x15f,0x1df)](_0x22114e[_0x398e94(0x251,0x2a8)](_0x398e94(0x17e,0x1bb),''));this[_0x398e94(0x187,0x176)]?.['emit'](_0x398e94(0x190,0x1ee),{'topic':this[_0x398e94(0x1da,0x157)],'filter':filter,'ref':this['makeRef']()});}}));}[_0x684fad(0x4d2,0x4f3)](_0x41800f,_0x245698){function _0x1a3563(_0x4495a8,_0x3879f0){return _0x30c5(_0x3879f0-0x3a9,_0x4495a8);}if(_0x41800f==='postgres_changes'){const _0x43eb58=_0x1a3563(0x572,0x52e)+JSON[_0x1a3563(0x5b4,0x5fd)](_0x245698[_0x1a3563(0x594,0x5ca)]||{});this['emit'](_0x43eb58,_0x245698);}else{if(_0x41800f==='broadcast'){const _0x4f98d3='broadcast:'+JSON['stringify']({'event':_0x245698[_0x1a3563(0x5ff,0x5dc)]});this[_0x1a3563(0x5ca,0x585)](_0x4f98d3,_0x245698);}else{if(_0x41800f==='presence'){const _0x33dd37=_0x1a3563(0x66c,0x600)+JSON['stringify']({'event':_0x245698['event']});this['emit'](_0x33dd37,_0x245698);}}}this['emit'](_0x41800f,_0x245698);}['_setState'](_0x543fb7){function _0x3b4e4a(_0x2e1222,_0x219f16){return _0x30c5(_0x219f16- -0x33e,_0x2e1222);}this['state']=_0x543fb7;let status;switch(_0x543fb7){case'joined':status='SUBSCRIBED';break;case _0x3b4e4a(-0x159,-0xf9):status='CHANNEL_ERROR';break;case'closed':status=_0x3b4e4a(-0x12f,-0x15a);break;default:return;}this[_0x3b4e4a(-0x1e1,-0x162)](_0x3b4e4a(-0xfc,-0x129),status);}[_0x684fad(0x50f,0x49b)](){function _0xf5b85f(_0x3443e6,_0x3cea22){return _0x30c5(_0x3443e6-0x29f,_0x3cea22);}return Math['random']()[_0xf5b85f(0x44d,0x406)](0x24)[_0xf5b85f(0x508,0x501)](0x2,0xf);}[_0x684fad(0x520,0x591)](){return this['state'];}}function _0x5035(){const _0x39a6b2=['l2vUDG','l2f1DgGVDJeVCMvMCMvZAa','rMfPBgvKihrVihvWzgf0zsbIDwnRzxq','zgvSzxrLt3b0Aw9UCW','BMfTzq','zM9YrwfJAa','zgv0zwn0q3vZDg9Trgf0ywjHC2u','y2HHBM5LBa','rgf0ywjHC2uGB3bLCMf0Aw9UigzHAwXLza','y29UBMvJDgvK','zgvMyxvSDhm','BgvHDMu','B25Jzq','AwXPA2u','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','zxHLy3v0zq','zw1PDa','nJm3tM1htfDM','C2v0v29YA3nWywnLswq','BhrL','DxbKyxrLrw52','Dg9WAwm','y29UDgfPBNm','BwfRzvjLzG','q0Xpu0ve','ChvZAa','BgLZDgvUzxjZ','BgLZDej1y2TLDhm','AgfUzgXLrxjYB3i','rMfPBgvKihrVigDLDcbMDw5JDgLVBG','Bgv2zwW','yxv0Aa','B2zMC2v0','AgvHzgvYCW','yNvJA2v0swq','DMfSDwu','mty1nduXmZbpzMTbCwm','C29JA2v0lMLVlwnSAwvUDa','y29TBw9U','ywnJzxnZx3rVA2vU','z2v0u3rHDgu','C2v0u2vZC2LVBG','yNjVD3nLCG','z2XVyMfS','zw50CNLWB2LUDa','C2v0twf4tgLZDgvUzxjZ','yMfZzvvsta','zg93BMXVywq','Ec10B3rHBc1JB3vUDa','l3jWyY8','y29UBMvJDa','CxvLCNK','ChjLCgvUzeXPC3rLBMvY','BgLTAxq','ntG5mty0m2HkCe9Yva','mtmZmdK3oer0CfHpvW','C2vSzwn0','y29UBMvJDgLVBLn0yxrL','Dg9vChbLCKnHC2u','Bwv0ywrHDge','lMfZyW','l3n0B3jHz2uVyNvJA2v0CY8','BwvZC2fNzq','nNfPsKz1DW','CgvYAw9K','ChjVzhvJDa','y3jLyxrLqNvJA2v0','zxHLy3v0zvf1zxj5','sfruucbYzxf1zxn0igzHAwXLza','BgvUz3rO','BxvSDgLWyxj0l2zVCM0Tzgf0yq','Cg9ZDgDYzxniB3n0','Aw1WB3j0twfW','C3rHDhvZ','nZuXmdi2zuHgsgvM','C3rHDhvZvgv4Da','DgfIBgu','ChjLzML4','C2LNBLvW','rMfPBgvKihrVig1VDMuGzMLSzq','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','l2z1BMn0Aw9UCY92ms8','D2fYBG','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','Bw92zq','zMLSDgvY','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','zgv0zwn0zwrdB25MAwC','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbSB2DZ','rMfPBgvKihrVigrLBgv0zsbMDw5JDgLVBG','y2fJAgvdB250CM9S','mtm5ndK2vhDYtfPc','B3bLCMf0B3i','l2zPBgvZ','B3bLCMf0Aw9U','y3jLzgvUDgLHBhm','l3nPz24','C2v0DxbizwfYDgjLyxq','z2v0sxrLBq','Dw5ZDwjZy3jPyMu','zgvSzxrL','CMv0DxjUpxjLChjLC2vUDgf0Aw9U','x3nLDfn0yxrL','zxzLBNq','BgLRzq','C2L6zq','lMrLC2m','C2LNBKLU','l2f1DgGVDJeVC2rRl3nPz25PBG','yxbPs2v5','l21LDhjPy3m','Dw50CMfJAW','B3jKzxi','CMvJB25Uzwn0qxr0zw1WDhm','C29JA2v0qwrHChrLCG','DMfSDwvZ','AM9PBG','y3vYCMvUDfnLC3nPB24','l2f1DgGVDJeVDxnLCG','Dgv4Dc9WBgfPBG','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','zxjYB3jLza','y2XVC2vK','CMvMCMvZAfnLC3nPB24','z2v0','zgf0yufYCMf5','zw52','rMfPBgvKihrVihjLBw92zsbMAwXLCW','rMfPBgvKihrVihvWzgf0zsbMDw5JDgLVBIbLBNzPCM9UBwvUDa','CMvZzxrqyxnZD29Yza','CMvXDwvZDa','AM9PBMvKt25Jzq','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','C3rHy2S','y3jLyxrLu2LNBMvKvxjS','DhjHy2S','C3rYAw5NAwz5','DgvZDenVBM5Ly3rPB24','CMvMCMvZAf90B2TLBG','ChjLC2vUy2u6','CMvWBgfJzq','rMfPBgvKihrVignYzwf0zsbZAwDUzwqGvvjm','igf0DgvTChrZoIa','yNvJA2v0','zxzLBNrZ','z2v0tg9NCW','y2XLyxi','qMvHCMvYia','ms4XlJG','C3rYAw5N','wc1xB3jRC3bHy2uTsuq','C29YDej5','Aw52B2TL','B25qB3n0z3jLC0nOyw5Nzxm','D2vIC29JA2v0','yMXVyG','AxnvC2LUz0n1C3rVBurHDgfIyxnL','C3vIC3rYAw5N','Bg9HzfnLC3nPB24','CMvZCg9UC2u','rMfPBgvKihrVihvWBg9HzcbMAwXL','B25qCMvZzw5Jzq','z2v0twv0CMLJCW','CMvTB3zLqxv0AfrVA2vU','C2v0','z2v0v29YA3nWywnLswq','C3rVCMfNzq','zMLSDgvYCW','CMvTB3zLq3vZDg9Trgf0ywjHC2u','Bg9N','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','CgfYC2u','l3nKAY92ms8','DxbKyxrLrMLSzu1LDgfKyxrH','CMfUz2u','l2z1BMn0Aw9UCY92mq','Cg9ZDa','ChvIBgLJ','AM9PBMvK','BM9Kzq','DxbKyxrLt3b0Aw9UCW','y3jLyxrL','C3rHDgu','C2vZC2LVBG','C2nOzw1H','zxjYB3i','y2fWDhvYzvn0ywnRvhjHy2u','p29WzxjHDgLVBJ1PBNnLCNq','yM9KEq','C2v0sxrLBq','y29SDw1U','y29UBMvJDf9LCNjVCG','C2v0u2vZC2LVBKLUDgvYBMfS','l21LDgfKyxrH','Bwf0y2G','zwjHyxmUyxv0Ac5ZzxnZAw9U','Bwf4tgLZDgvUzxjZ','z2v0q2HHBM5LBhm','x2DLDfnVy2TLDa','y2XPzw50','AgfZq3vZDg9Trgf0ywjHC2u','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','Cg9ZDgDYzxnFy2HHBMDLCZO','yNjVywrJyxn0','DxbKyxrLrgf0yq','DxjS','D29YA3nWywnLswq','B25cCM9HzgnHC3q','zgLZy29UBMvJDa','y29UzMLN','DhjHBNnMB3jT','C29JA2v0','B3b0Aw9UCW','z2v0twf4tgLZDgvUzxjZ','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','C3nSrw5HyMXLza','y2XLyxjtzxnZAw9U','y3vYCMvUDfnJAgvTyq','AgfUzgXLqxv0AevYCM9Y','Cg9ZDgDYzxnFy2HHBMDLCW','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','Cgf0y2G','y2HHBM5LBhm','zNjVBq','AM9PBMLUzW','l2f1DgGVDJeVC2LNBM91Da','zgLZy29UBMvJDgvK','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','CMvQzwn0','C3vIC2nYAxb0Aw9UCW','DMvYAwz5','CNbJ','Cg9ZDgDYzxneyxrHyMfZzq','DgLTzw91Da','zNvUy3rPB25Z','x3rYAwDNzxi','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','AxndB25Uzwn0zwq','DxnL','mJe4mJe2uMPxEfb1','CMvHy3qTBMf0AxzL','rxjYB3iGAw4GzxzLBNqGBgLZDgvUzxiGzM9Yici','Ahr0CenSAwvUDa','Dg9tDhjPBMC','Chv0','zgf0yq','zMLSzq','ngzrzejbvW','rMfPBgvKihrVigrVD25SB2fKigzPBgu','rMfPBgvKihrVigrLBgv0zsbIDwnRzxq','C3bSAxq','CMvZB2X2zq','zgv0ywLSCW','ChjLC2vUy2u','l2f1DgGVDJeVC2LNBNvW','zw50CMLLCW','C2v0qxv0AfrVA2vU','DMvYC2LVBNm','l2zPBgvZlW','B2zM','y29Kzq','yxbWzw5K','Dw5KzwzPBMvK','mJaZnJqXmgPRENPqsG','CMvTB3zLqwXStgLZDgvUzxjZ','AgfZ','l2zPBgvZl2nVChK','C2LNBK91Da','u1vcu0nssujfra','z2v0u3rHDhvZ','y29UDgvUDfr5Cgu','zgf0ywjHC2u','vw5RBM93BIbLCNjVCG'];_0x5035=function(){return _0x39a6b2;};return _0x5035();}function getEnvironment(){if(typeof navigator!=='undefined'&&navigator[_0x5e0f19(-0x77,-0xc2)]==='ReactNative')return _0x5e0f19(-0xd9,-0x55);if(typeof window!==_0x5e0f19(-0xc3,-0x139)&&typeof document!==_0x5e0f19(-0xc3,-0x77))return _0x5e0f19(-0x8e,-0x9b);function _0x5e0f19(_0x3e0575,_0x210cff){return _0x30c5(_0x3e0575- -0x284,_0x210cff);}if(typeof global!==_0x5e0f19(-0xc3,-0x4d)&&typeof process!==_0x5e0f19(-0xc3,-0x101)&&process[_0x5e0f19(-0xc8,-0x44)]?.['node'])return _0x5e0f19(-0x116,-0xaa);return _0x5e0f19(-0x8e,-0x38);}function isSocketIOAvailable(){function _0x243993(_0x28fa42,_0x28577d){return _0x30c5(_0x28577d-0x1b6,_0x28fa42);}try{const _0x420812=getEnvironment();switch(_0x420812){case _0x243993(0x2cd,0x324):return typeof require!==_0x243993(0x366,0x377)&&require['resolve']&&!!require[_0x243993(0x2ee,0x36c)](_0x243993(0x3cf,0x3a7));case _0x243993(0x3aa,0x3ac):if(typeof globalThis!==_0x243993(0x300,0x377)&&'io'in globalThis)return!![];return typeof require!==_0x243993(0x343,0x377)&&require[_0x243993(0x2f8,0x36c)]&&!!require['resolve']('socket.io-client');case'react-native':try{return typeof require!=='undefined'&&!!require('socket.io-client');}catch{return![];}default:return![];}}catch{return![];}}function getSocketIO(){function _0x1eef33(_0x11a61f,_0x31f697){return _0x30c5(_0x11a61f- -0x295,_0x31f697);}try{if(typeof require!==_0x1eef33(-0xd4,-0xfe))return require(_0x1eef33(-0xa4,-0xf0));if(typeof globalThis!=='undefined'&&'io'in globalThis)return{'io':globalThis['io']};throw new Error('socket.io-client\x20not\x20available');}catch(_0x3f1840){throw new Error('Socket.io-client\x20não\x20está\x20disponível\x20neste\x20ambiente.\x20Para\x20usar\x20funcionalidades\x20de\x20realtime,\x20instale:\x20npm\x20install\x20socket.io-client');}}class WebSocketAdapter{constructor(){function _0x4d6290(_0x2caf29,_0x44088d){return _0x30c5(_0x44088d-0x19c,_0x2caf29);}this[_0x4d6290(0x2cf,0x32a)]=null;}async['connect'](_0x311f16,_0x41c251){if(!isSocketIOAvailable())throw new Error('Socket.io-client não está disponível. Para usar funcionalidades de realtime, instale: npm install socket.io-client');const {io:_0x2fbb6e}=getSocketIO();return new Promise((_0x4d832b,_0x4b1e54)=>{function _0x3c7237(_0x128811,_0x9b0da2){return _0x30c5(_0x9b0da2-0x306,_0x128811);}this['socket']=_0x2fbb6e(_0x311f16,_0x41c251),this[_0x3c7237(0x4e3,0x494)]['on']('connect',()=>_0x4d832b()),this['socket']['on'](_0x3c7237(0x452,0x480),_0x33ba83=>_0x4b1e54(_0x33ba83));});}[_0x684fad(0x4b7,0x44b)](){function _0x43be1a(_0x59c2e1,_0x1623f9){return _0x30c5(_0x1623f9- -0x27b,_0x59c2e1);}this[_0x43be1a(-0x11a,-0xed)]&&(this[_0x43be1a(-0x10c,-0xed)][_0x43be1a(-0x8a,-0xf0)](),this[_0x43be1a(-0x8c,-0xed)]=null);}['emit'](_0x5c2ba2,data){function _0xdedf0b(_0x4952b2,_0x14a518){return _0x30c5(_0x14a518-0x137,_0x4952b2);}this[_0xdedf0b(0x310,0x2c5)]?.['emit'](_0x5c2ba2,data);}['on'](_0x8bb0af,_0x42c832){this['socket']?.['on'](_0x8bb0af,_0x42c832);}['off'](_0x5b755d,_0x58e971){function _0x410588(_0x138463,_0x4ac6b4){return _0x30c5(_0x138463- -0x1dc,_0x4ac6b4);}_0x58e971?this[_0x410588(-0x4e,-0xb5)]?.[_0x410588(-0x1e,-0xd)](_0x5b755d,_0x58e971):this['socket']?.['off'](_0x5b755d);}get['connected'](){function _0x5705ea(_0x263f17,_0x454604){return _0x30c5(_0x263f17-0x35c,_0x454604);}return this[_0x5705ea(0x4ea,0x474)]?.[_0x5705ea(0x531,0x4f4)]??![];}}class ReactNativeSocketAdapter{constructor(){function _0x508dcd(_0x422719,_0x481417){return _0x30c5(_0x422719-0x26a,_0x481417);}this[_0x508dcd(0x3f8,0x472)]=null;}async['connect'](_0x3dd7ec,_0x5b3d15){if(!isSocketIOAvailable())throw new Error('Socket.io-client\x20não\x20está\x20disponível.\x20Para\x20React\x20Native,\x20instale:\x20npm\x20install\x20socket.io-client');const {io:_0x2583ec}=getSocketIO();return new Promise((_0x10ddab,_0x8d0b2d)=>{this[_0x11680e(0x25b,0x1dc)]=_0x2583ec(_0x3dd7ec,{..._0x5b3d15,'transports':['websocket'],'upgrade':![],'autoConnect':!![]});function _0x11680e(_0x4780f5,_0x376d26){return _0x30c5(_0x4780f5-0xcd,_0x376d26);}this[_0x11680e(0x25b,0x1d2)]['on'](_0x11680e(0x2cb,0x319),()=>_0x10ddab()),this[_0x11680e(0x25b,0x2b6)]['on']('connect_error',_0x10f902=>_0x8d0b2d(_0x10f902));});}[_0x684fad(0x4b7,0x462)](){function _0x45476(_0x4fd04e,_0x44d778){return _0x30c5(_0x44d778-0x1f,_0x4fd04e);}this[_0x45476(0x22d,0x1ad)]&&(this[_0x45476(0x164,0x1ad)][_0x45476(0x1e4,0x1aa)](),this['socket']=null);}['emit'](_0x2ae6aa,data){function _0x20b8d3(_0x46562a,_0x5dffc9){return _0x30c5(_0x46562a- -0x7d,_0x5dffc9);}this[_0x20b8d3(0x111,0x8e)]?.[_0x20b8d3(0x15f,0x1c8)](_0x2ae6aa,data);}['on'](_0x506e56,_0x39b854){this['socket']?.['on'](_0x506e56,_0x39b854);}['off'](_0x387442,_0x2d3d4d){function _0x3e103f(_0x357da4,_0x5df6be){return _0x30c5(_0x5df6be-0x31f,_0x357da4);}_0x2d3d4d?this['socket']?.[_0x3e103f(0x46b,0x4dd)](_0x387442,_0x2d3d4d):this[_0x3e103f(0x46f,0x4ad)]?.[_0x3e103f(0x4cc,0x4dd)](_0x387442);}get['connected'](){function _0x1ce830(_0x37b2fa,_0x313040){return _0x30c5(_0x37b2fa-0x23,_0x313040);}return this['socket']?.[_0x1ce830(0x1f8,0x20f)]??![];}}function createSocketAdapter(){const _0x2b8ff7=getEnvironment();function _0x2c8fc5(_0x5e8254,_0x154169){return _0x30c5(_0x5e8254- -0x279,_0x154169);}switch(_0x2b8ff7){case'react-native':return new ReactNativeSocketAdapter();case _0x2c8fc5(-0x83,-0xa0):case _0x2c8fc5(-0x10b,-0x151):default:return new WebSocketAdapter();}}class RealtimeClient{constructor(_0x170c7f,_0x2a2877,_0x11b778={}){this[_0x7c0117(0x4e8,0x55d)]=null,this['channels']=new Map(),this['connectionState']=_0x7c0117(0x4f7,0x4c0),this[_0x7c0117(0x597,0x59f)]=0x0,this[_0x7c0117(0x5aa,0x597)]=0x5;function _0x7c0117(_0xd8a976,_0xe0fdbb){return _0x30c5(_0xd8a976-0x35a,_0xe0fdbb);}this['url']=_0x170c7f,this[_0x7c0117(0x593,0x58a)]=_0x2a2877,this['options']={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x11b778},this['socketAdapter']=createSocketAdapter();}[_0x684fad(0x52a,0x4f1)](){return new Promise(async(_0x2f8db7,_0x38f07b)=>{if(this['socketAdapter']['connected']){_0x2f8db7();return;}this[_0x3cdfd6(0x219,0x194)]='connecting';function _0x3cdfd6(_0x3d32b4,_0xf3aa1e){return _0x30c5(_0x3d32b4-0x14,_0xf3aa1e);}try{await this[_0x3cdfd6(0x252,0x2d5)][_0x3cdfd6(0x212,0x261)](this[_0x3cdfd6(0x19c,0x11e)],{'auth':{'apikey':this[_0x3cdfd6(0x24d,0x257)]},'transports':[_0x3cdfd6(0x27a,0x23c)],'reconnection':!![],'reconnectionDelay':this['options']['reconnectInterval'],'reconnectionAttempts':this[_0x3cdfd6(0x1a3,0x212)][_0x3cdfd6(0x264,0x239)],...this[_0x3cdfd6(0x1a3,0x215)]['socketOptions']}),this['socket']=this[_0x3cdfd6(0x252,0x259)]['socket'],this['socketAdapter']['on']('connect',()=>{this[_0x2c7625(-0x1ca,-0x228)]='connected',this['reconnectAttempts']=0x0;function _0x2c7625(_0x9bb862,_0x23fad8){return _0x30c5(_0x9bb862- -0x3cf,_0x23fad8);}this[_0x2c7625(-0x1a2,-0x12e)](),_0x2f8db7();}),this[_0x3cdfd6(0x252,0x1ef)]['on'](_0x3cdfd6(0x19f,0x1c7),()=>{function _0x35b411(_0x5a1ccb,_0x3c5537){return _0x30c5(_0x5a1ccb-0x3e7,_0x3c5537);}this['connectionState']=_0x35b411(0x584,0x5df),this[_0x35b411(0x580,0x5e9)][_0x35b411(0x5b8,0x56d)](channel=>{function _0x5f2a55(_0x3f4003,_0x31b01c){return _0x30c5(_0x31b01c-0x32a,_0x3f4003);}channel[_0x5f2a55(0x4df,0x55c)](_0x5f2a55(0x4ec,0x570));});}),this['socketAdapter']['on'](_0x3cdfd6(0x18e,0x112),_0x330b0d=>{this[_0x5adad9(-0xfa,-0xcf)]='error',this['reconnectAttempts']++;function _0x5adad9(_0x37b43d,_0x4f0387){return _0x30c5(_0x37b43d- -0x2ff,_0x4f0387);}this[_0x5adad9(-0xc2,-0xf8)]>=this['maxReconnectAttempts']&&_0x38f07b(new Error('Failed\x20to\x20connect\x20after\x20'+this[_0x5adad9(-0xaf,-0x80)]+_0x5adad9(-0xa5,-0x98)+_0x330b0d[_0x5adad9(-0xf5,-0xef)]));}),this[_0x3cdfd6(0x252,0x2d0)]['on']('reconnect',()=>{this[_0x2a748a(-0xb9,-0x96)]=_0x2a748a(-0xe9,-0x7f),this['reconnectAttempts']=0x0;function _0x2a748a(_0x2730f0,_0x54d9bd){return _0x30c5(_0x2730f0- -0x2be,_0x54d9bd);}this['channels'][_0x2a748a(-0xed,-0xeb)](channel=>{channel['_rejoin']();});}),this['socketAdapter']['on']('postgres_changes',_0x3f29a1=>{const channel=this[_0x5480fe(0xbc,0x8f)][_0x5480fe(0x16b,0x192)](_0x3f29a1['topic']);function _0x5480fe(_0x273ce8,_0x19b1da){return _0x30c5(_0x273ce8- -0xdd,_0x19b1da);}channel&&channel['_trigger'](_0x5480fe(0xb9,0x70),_0x3f29a1);}),this[_0x3cdfd6(0x252,0x29b)]['on'](_0x3cdfd6(0x19a,0x210),_0x1769ad=>{function _0x2593ba(_0x2c4af6,_0x29e9a0){return _0x30c5(_0x29e9a0- -0x15b,_0x2c4af6);}const channel=this['channels'][_0x2593ba(0x75,0xed)](_0x1769ad['topic']);channel&&channel['_trigger'](_0x2593ba(0x3a,0x2b),_0x1769ad);}),this['socketAdapter']['on']('presence',_0x429456=>{function _0xbad9fe(_0x1cc30b,_0x376bc5){return _0x30c5(_0x376bc5-0x2a1,_0x1cc30b);}const channel=this[_0xbad9fe(0x3fd,0x43a)][_0xbad9fe(0x56d,0x4e9)](_0x429456['topic']);channel&&channel[_0xbad9fe(0x405,0x447)](_0xbad9fe(0x4c0,0x459),_0x429456);});}catch(_0x32b9a3){this[_0x3cdfd6(0x219,0x1e4)]=_0x3cdfd6(0x188,0x167),_0x38f07b(_0x32b9a3);}});}['disconnect'](){function _0x40e08d(_0x17d43e,_0x6b3bd1){return _0x30c5(_0x6b3bd1-0x2f4,_0x17d43e);}this['socketAdapter']&&(this['socketAdapter'][_0x40e08d(0x474,0x47f)](),this[_0x40e08d(0x433,0x482)]=null),this['connectionState']='disconnected',this['channels'][_0x40e08d(0x55c,0x552)]();}[_0x684fad(0x4ff,0x49a)](_0x1d2e0a){function _0x3e1147(_0x453f34,_0x1595fa){return _0x30c5(_0x453f34-0x81,_0x1595fa);}if(this[_0x3e1147(0x21a,0x23c)]['has'](_0x1d2e0a))return this['channels'][_0x3e1147(0x2c9,0x29c)](_0x1d2e0a);const channel=new RealtimeChannel(_0x1d2e0a,this['socket']);return this['channels']['set'](_0x1d2e0a,channel),this['connectionState']===_0x3e1147(0x256,0x22d)&&channel['_join'](),channel;}['removeChannel'](channel){function _0x553237(_0xf6c977,_0x3b8063){return _0x30c5(_0xf6c977-0x9f,_0x3b8063);}const _0x4b8fff=channel['topic'];this[_0x553237(0x238,0x1f9)]['has'](_0x4b8fff)&&(this[_0x553237(0x238,0x1da)]['delete'](_0x4b8fff),channel[_0x553237(0x2ce,0x2b1)]());}['removeAllChannels'](){function _0x4142c2(_0x43bf4f,_0x452698){return _0x30c5(_0x43bf4f-0x79,_0x452698);}this[_0x4142c2(0x212,0x1d3)]['forEach'](channel=>{channel['unsubscribe']();}),this[_0x4142c2(0x212,0x1fb)]['clear']();}[_0x684fad(0x4ac,0x47f)](){function _0x388e0c(_0x53cadf,_0x36b430){return _0x30c5(_0x36b430-0x178,_0x53cadf);}return Array[_0x388e0c(0x39b,0x312)](this[_0x388e0c(0x398,0x311)][_0x388e0c(0x41f,0x3b7)]());}[_0x684fad(0x4d4,0x54d)](){function _0x3fcc56(_0x321821,_0xfd7427){return _0x30c5(_0xfd7427- -0x3b4,_0x321821);}return this[_0x3fcc56(-0x177,-0x1af)]==='connected'&&this['socketAdapter'][_0x3fcc56(-0x188,-0x1df)];}['getConnectionState'](){return this['connectionState'];}['onConnectionStateChange'](_0x300f99){function _0x592b92(_0x2e6e58,_0xace098){return _0x30c5(_0x2e6e58- -0x217,_0xace098);}const _0x4cecd1=()=>_0x300f99(this['connectionState']);return this['socketAdapter']&&(this['socketAdapter']['on'](_0x592b92(-0x19,-0x19),()=>{this['connectionState']='connected',_0x4cecd1();}),this[_0x592b92(0x27,0x7)]['on'](_0x592b92(-0x8c,-0xdd),()=>{function _0x34f9e4(_0x130046,_0x29ebda){return _0x30c5(_0x29ebda-0x3d7,_0x130046);}this['connectionState']=_0x34f9e4(0x5fb,0x574),_0x4cecd1();}),this[_0x592b92(0x27,-0x14)]['on']('connect_error',()=>{function _0x44a9f7(_0x37e2ea,_0x32dd3c){return _0x30c5(_0x37e2ea-0x2c3,_0x32dd3c);}this[_0x44a9f7(0x4c8,0x47a)]=_0x44a9f7(0x437,0x41f),_0x4cecd1();})),()=>{function _0x25df25(_0x4df9ef,_0x418628){return _0x30c5(_0x4df9ef- -0x28b,_0x418628);}this[_0x25df25(-0x4d,-0x1e)]&&(this[_0x25df25(-0x4d,-0x93)][_0x25df25(-0xcd,-0xe1)](_0x25df25(-0x8d,-0x109),_0x4cecd1),this['socketAdapter'][_0x25df25(-0xcd,-0xae)](_0x25df25(-0x100,-0x8b),_0x4cecd1),this[_0x25df25(-0x4d,-0x96)][_0x25df25(-0xcd,-0x144)]('connect_error',_0x4cecd1));};}[_0x684fad(0x559,0x5a8)](){if(!this[_0x38863d(-0x6c,-0x3a)]['heartbeatInterval']||!this['socketAdapter'])return;function _0x38863d(_0x48c965,_0x279c6a){return _0x30c5(_0x48c965- -0x1fb,_0x279c6a);}const interval=setInterval(()=>{function _0x815bed(_0x112fbc,_0x4b2b02){return _0x30c5(_0x112fbc- -0x159,_0x4b2b02);}this[_0x815bed(0xe5,0x128)]?.[_0x815bed(0x7c,0x1)]?this['socketAdapter']['emit']('heartbeat',{'timestamp':Date['now']()}):clearInterval(interval);},this[_0x38863d(-0x6c,-0x50)]['heartbeatInterval']);}[_0x684fad(0x4ad,0x502)](){return this['socket'];}}class FunctionsClient{constructor(_0x47f5f7){this['httpClient']=_0x47f5f7;}async[_0x684fad(0x590,0x602)](_0x5d3860,_0x35aee8){function _0x18b15b(_0x31860f,_0x269330){return _0x30c5(_0x31860f- -0x233,_0x269330);}try{const _0x4fd2b6=_0x35aee8?.['method']||'POST',headers={'Content-Type':'application/json',..._0x35aee8?.[_0x18b15b(-0x46,-0x9c)]};let response;const _0x6ba6f2=_0x18b15b(-0x16,-0x60)+_0x5d3860;switch(_0x4fd2b6[_0x18b15b(-0x2d,0x54)]()){case'GET':response=await this['httpClient'][_0x18b15b(0x15,0xc)](_0x6ba6f2,{'headers':headers,'params':_0x35aee8?.[_0x18b15b(-0xbc,-0x4f)]});break;case'POST':response=await this[_0x18b15b(-0x86,-0xf)][_0x18b15b(-0xc8,-0xc4)](_0x6ba6f2,_0x35aee8?.[_0x18b15b(-0xbc,-0x68)],{'headers':headers});break;case'PUT':response=await this['httpClient']['put'](_0x6ba6f2,_0x35aee8?.['body'],{'headers':headers});break;case'PATCH':response=await this[_0x18b15b(-0x86,-0x1c)][_0x18b15b(-0x9b,-0xf9)](_0x6ba6f2,_0x35aee8?.[_0x18b15b(-0xbc,-0x8b)],{'headers':headers});break;case'DELETE':response=await this['httpClient']['delete'](_0x6ba6f2,{'headers':headers,'data':_0x35aee8?.[_0x18b15b(-0xbc,-0xbc)]});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x4fd2b6,0x190);}return{'data':response['data'],'error':null};}catch(_0x3d30ae){return{'data':null,'error':_0x3d30ae instanceof EBaaSError?_0x3d30ae:new EBaaSError(_0x3d30ae instanceof Error?_0x3d30ae[_0x18b15b(-0x29,-0x2b)]:'Function\x20invocation\x20failed',0x0,_0x3d30ae)};}}async['list'](){function _0x4fbfbe(_0x284e66,_0x472105){return _0x30c5(_0x284e66-0x83,_0x472105);}try{const response=await this['httpClient'][_0x4fbfbe(0x2cb,0x2ef)](_0x4fbfbe(0x1ed,0x1d3));return{'data':response[_0x4fbfbe(0x233,0x1c7)],'error':null};}catch(_0x39a4cb){return{'data':null,'error':_0x39a4cb instanceof EBaaSError?_0x39a4cb:new EBaaSError(_0x39a4cb instanceof Error?_0x39a4cb[_0x4fbfbe(0x28d,0x28c)]:'Failed\x20to\x20list\x20functions',0x0,_0x39a4cb)};}}async[_0x684fad(0x574,0x5f5)](_0x338b6b){function _0x2a4cfb(_0x3b1962,_0x386754){return _0x30c5(_0x3b1962- -0x3d4,_0x386754);}try{const response=await this[_0x2a4cfb(-0x227,-0x20b)]['get']('/functions/v1/'+_0x338b6b+'/info');return{'data':response[_0x2a4cfb(-0x224,-0x22d)],'error':null};}catch(_0x437cb8){return{'data':null,'error':_0x437cb8 instanceof EBaaSError?_0x437cb8:new EBaaSError(_0x437cb8 instanceof Error?_0x437cb8[_0x2a4cfb(-0x1ca,-0x1f8)]:_0x2a4cfb(-0x1eb,-0x268),0x0,_0x437cb8)};}}async['deploy'](_0x2f7acf,_0x318278){function _0xeec390(_0x5a05ed,_0x2a3102){return _0x30c5(_0x5a05ed- -0x366,_0x2a3102);}try{const _0x44a239=new FormData();if(_0x318278['code']instanceof File)_0x44a239[_0xeec390(-0x1a6,-0x13b)](_0xeec390(-0x1a7,-0x179),_0x318278[_0xeec390(-0x1a7,-0x1c3)]);else typeof _0x318278[_0xeec390(-0x1a7,-0x1f2)]===_0xeec390(-0x105,-0x123)&&_0x44a239['append'](_0xeec390(-0x1a7,-0x1a9),new Blob([_0x318278[_0xeec390(-0x1a7,-0x120)]],{'type':_0xeec390(-0x123,-0x155)}),'index.ts');_0x318278['entrypoint']&&_0x44a239['append']('entrypoint',_0x318278[_0xeec390(-0x16e,-0x109)]);_0x318278[_0xeec390(-0x11c,-0xa3)]&&_0x44a239[_0xeec390(-0x1a6,-0x1d5)](_0xeec390(-0x11c,-0x18a),JSON['stringify'](_0x318278[_0xeec390(-0x11c,-0x16d)]));_0x318278[_0xeec390(-0x152,-0x19e)]&&_0x44a239[_0xeec390(-0x1a6,-0x218)](_0xeec390(-0x152,-0x157),JSON['stringify'](_0x318278[_0xeec390(-0x152,-0xff)]));_0x318278['verify']!==undefined&&_0x44a239['append'](_0xeec390(-0x1c5,-0x24b),String(_0x318278[_0xeec390(-0x1c5,-0x1d6)]));const response=await this[_0xeec390(-0x1b9,-0x164)][_0xeec390(-0x1fb,-0x258)]('/functions/v1/'+_0x2f7acf+'/deploy',_0x44a239,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response['data'],'error':null};}catch(_0x326aaf){return{'data':null,'error':_0x326aaf instanceof EBaaSError?_0x326aaf:new EBaaSError(_0x326aaf instanceof Error?_0x326aaf['message']:'Failed\x20to\x20deploy\x20function',0x0,_0x326aaf)};}}async['delete'](_0x20b964){function _0x53c615(_0x2b6510,_0x2e19a7){return _0x30c5(_0x2b6510-0x20d,_0x2e19a7);}try{const response=await this[_0x53c615(0x3ba,0x40d)]['delete'](_0x53c615(0x42a,0x413)+_0x20b964);return{'data':response[_0x53c615(0x3bd,0x440)],'error':null};}catch(_0x269176){return{'data':null,'error':_0x269176 instanceof EBaaSError?_0x269176:new EBaaSError(_0x269176 instanceof Error?_0x269176[_0x53c615(0x417,0x3fb)]:_0x53c615(0x432,0x3ef),0x0,_0x269176)};}}async[_0x684fad(0x50c,0x560)](_0x35f981,_0x546349){function _0x17a1fb(_0x117050,_0x54cdd3){return _0x30c5(_0x117050- -0x34b,_0x54cdd3);}try{const response=await this['httpClient'][_0x17a1fb(-0x19c,-0x185)]('/functions/v1/'+_0x35f981+_0x17a1fb(-0x17f,-0x13d),{'env':_0x546349});return{'data':response[_0x17a1fb(-0x19b,-0x1f6)],'error':null};}catch(_0x2fed34){return{'data':null,'error':_0x2fed34 instanceof EBaaSError?_0x2fed34:new EBaaSError(_0x2fed34 instanceof Error?_0x2fed34[_0x17a1fb(-0x141,-0x19d)]:_0x17a1fb(-0xff,-0x86),0x0,_0x2fed34)};}}async[_0x684fad(0x589,0x524)](_0x1d314f,_0x2aca85){function _0x2f2b56(_0xe7fe4e,_0x24abd9){return _0x30c5(_0xe7fe4e-0x33,_0x24abd9);}try{const _0x276806=new URLSearchParams();_0x2aca85?.['limit']&&_0x276806[_0x2f2b56(0x1f3,0x1a1)](_0x2f2b56(0x234,0x1ff),String(_0x2aca85[_0x2f2b56(0x234,0x1f2)]));_0x2aca85?.[_0x2f2b56(0x21f,0x1ef)]&&_0x276806[_0x2f2b56(0x1f3,0x230)](_0x2f2b56(0x21f,0x244),String(_0x2aca85[_0x2f2b56(0x21f,0x246)]));_0x2aca85?.['level']&&_0x276806[_0x2f2b56(0x1f3,0x1a4)](_0x2f2b56(0x21d,0x1d8),_0x2aca85[_0x2f2b56(0x21d,0x208)]);const _0x5be271='/functions/v1/'+_0x1d314f+'/logs'+(_0x276806[_0x2f2b56(0x1e1,0x169)]()?'?'+_0x276806[_0x2f2b56(0x1e1,0x1b9)]():''),response=await this['httpClient']['get'](_0x5be271);return{'data':response[_0x2f2b56(0x1e3,0x25a)],'error':null};}catch(_0x32c0d5){return{'data':null,'error':_0x32c0d5 instanceof EBaaSError?_0x32c0d5:new EBaaSError(_0x32c0d5 instanceof Error?_0x32c0d5[_0x2f2b56(0x23d,0x1c7)]:_0x2f2b56(0x257,0x295),0x0,_0x32c0d5)};}}async[_0x684fad(0x489,0x46d)](_0x3bffad,_0x4ea1e7){function _0x1e926a(_0x4d8716,_0x1600bf){return _0x30c5(_0x1600bf- -0x98,_0x4d8716);}try{const _0x3cc3d1=new URLSearchParams();_0x4ea1e7?.['period']&&_0x3cc3d1[_0x1e926a(0xc2,0x128)](_0x1e926a(0x101,0x174),_0x4ea1e7['period']);const _0x32fce1=_0x1e926a(0x1c9,0x185)+_0x3bffad+_0x1e926a(0x20c,0x1a2)+(_0x3cc3d1[_0x1e926a(0x144,0x116)]()?'?'+_0x3cc3d1['toString']():''),response=await this[_0x1e926a(0x98,0x115)]['get'](_0x32fce1);return{'data':response['data'],'error':null};}catch(_0x312944){return{'data':null,'error':_0x312944 instanceof EBaaSError?_0x312944:new EBaaSError(_0x312944 instanceof Error?_0x312944['message']:'Failed\x20to\x20get\x20function\x20metrics',0x0,_0x312944)};}}}class EBaaSClient{constructor(_0x2881a0,_0x4831d4,_0x431906){this[_0xce304(0x22e,0x27c)]=_0x431906,this['httpClient']=new HttpClient({'url':_0x2881a0,'apiKey':_0x4831d4,'timeout':0x7530,'headers':_0x431906?.[_0xce304(0x296,0x2e0)]?.['headers']}),this['auth']=new AuthClient(this['httpClient'],_0x431906?.['database']?.['workspaceId']),this['database']=new DatabaseClient(this['httpClient'],_0x431906?.['database']?.[_0xce304(0x228,0x1f8)]),this[_0xce304(0x200,0x22b)]=new StorageClient(this[_0xce304(0x24c,0x1c8)]),this['realtime']=new RealtimeClient(_0x2881a0,_0x4831d4,_0x431906?.['realtime']),this['functions']=new FunctionsClient(this['httpClient']);function _0xce304(_0x216d32,_0x10c296){return _0x30c5(_0x216d32-0x9f,_0x10c296);}this[_0xce304(0x23d,0x1cd)]();}[_0x684fad(0x4c6,0x465)](_0x55181c){function _0x9cd8b(_0x6e6fc4,_0x676dd8){return _0x30c5(_0x6e6fc4-0x36a,_0x676dd8);}return this[_0x9cd8b(0x534,0x4f8)]['from'](_0x55181c);}[_0x684fad(0x4ce,0x46d)](_0x5765f2,_0x262114){function _0x39ff8b(_0x3f6810,_0x4a1654){return _0x30c5(_0x4a1654- -0x3e4,_0x3f6810);}return this[_0x39ff8b(-0x288,-0x21a)][_0x39ff8b(-0x2c4,-0x242)](_0x5765f2,_0x262114);}[_0x684fad(0x587,0x522)](_0x2b32ec){function _0x3c8b59(_0x4a3c47,_0x249fa6){return _0x30c5(_0x4a3c47-0x366,_0x249fa6);}return this[_0x3c8b59(0x4c7,0x527)][_0x3c8b59(0x500,0x4d1)](_0x2b32ec);}['channel'](_0x30cb27){return this['realtime']['channel'](_0x30cb27);}['invoke'](_0x35aebe,_0x3cbea4){function _0x4bece5(_0x5e938f,_0x18ab47){return _0x30c5(_0x18ab47-0x3d6,_0x5e938f);}return this[_0x4bece5(0x50a,0x57b)]['invoke'](_0x35aebe,_0x3cbea4);}async[_0x684fad(0x4ca,0x474)](){function _0x899056(_0x5f001a,_0x5cd332){return _0x30c5(_0x5cd332-0x151,_0x5f001a);}if(this['options']?.[_0x899056(0x2f1,0x31b)]?.[_0x899056(0x32f,0x370)])try{await this[_0x899056(0x2cb,0x31b)]['initialize']();}catch(_0x2aeea9){console[_0x899056(0x3a7,0x36f)]('Failed to initialize custom database detection:',_0x2aeea9);}}async['setWorkspaceId'](_0x2225cc){this[_0x6bce9d(-0x91,-0x12)][_0x6bce9d(-0x9e,-0x6a)](_0x2225cc);function _0x6bce9d(_0x74ec41,_0xf8a96f){return _0x30c5(_0x74ec41- -0x27c,_0xf8a96f);}this['database']['setWorkspaceId'](_0x2225cc),this['options']?.[_0x6bce9d(-0xb2,-0xce)]?.['autoDetectCustomDatabase']&&await this['database']['initialize']();}async['configureCustomDatabase'](_0x1210ee){function _0x3b0d99(_0x3e6850,_0xa0e44d){return _0x30c5(_0x3e6850- -0x2f2,_0xa0e44d);}await this[_0x3b0d99(-0x128,-0x102)][_0x3b0d99(-0xd6,-0xa9)](_0x1210ee);}['getCustomDatabaseStatus'](){function _0x2f2bb9(_0x1c222a,_0xdc9e8f){return _0x30c5(_0x1c222a- -0x2a,_0xdc9e8f);}return this['database'][_0x2f2bb9(0x13b,0x19c)]();}}function createClient(_0x44168b,_0x268a9a,_0x14d7ed){return new EBaaSClient(_0x44168b,_0x268a9a,_0x14d7ed);}const version=_0x684fad(0x58c,0x560);export{AuthClient,CustomDatabaseManager,DatabaseClient,EBaaSClient,EBaaSError,FunctionsClient,HttpClient,QueryBuilder,RealtimeChannel,RealtimeClient,StorageBucket,StorageClient,createClient,version};
|