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

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.esm.js CHANGED
@@ -1 +1 @@
1
- (function(stringArrayFunction,comparisonValue){function _0x34087f(_0x2af384,_0x518edd){return _0x4d5f(_0x2af384- -0x86,_0x518edd);}const stringArray=stringArrayFunction();while(!![]){try{const _0xd918e6=parseInt(_0x34087f(0xf7,0xab))/0x1*(parseInt(_0x34087f(0xff,0x99))/0x2)+parseInt(_0x34087f(0x5a,0x8e))/0x3+-parseInt(_0x34087f(0xfc,0x9e))/0x4+parseInt(_0x34087f(0xb2,0x107))/0x5+-parseInt(_0x34087f(0xb0,0xe0))/0x6*(-parseInt(_0x34087f(0xc2,0xf8))/0x7)+-parseInt(_0x34087f(0xed,0x111))/0x8+-parseInt(_0x34087f(0x7f,0xf6))/0x9*(parseInt(_0x34087f(0x7c,0x80))/0xa);if(_0xd918e6===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x57be6e){stringArray['push'](stringArray['shift']());}}}(_0x5714,0x2b128));import axios from'axios';import{io}from'socket.io-client';import _0x37dada from'eventemitter3';class EBaaSError extends Error{constructor(_0xde3a40,status=0x0,_0x170bb0){super(_0xde3a40),this[_0xf75ff4(0x261,0x1fa)]=_0xf75ff4(0x225,0x20c);function _0xf75ff4(_0x44dbb6,_0x95bd35){return _0x4d5f(_0x95bd35-0x157,_0x44dbb6);}this['status']=status,this[_0xf75ff4(0x273,0x2a1)]=_0x170bb0,Error[_0xf75ff4(0x1fd,0x243)]&&Error[_0xf75ff4(0x210,0x243)](this,EBaaSError);}['toJSON'](){function _0x43770e(_0x317e3a,_0x175f90){return _0x4d5f(_0x175f90- -0x248,_0x317e3a);}return{'name':this[_0x43770e(-0x200,-0x1a5)],'message':this[_0x43770e(-0x1de,-0x17e)],'status':this[_0x43770e(-0x92,-0xdf)],'details':this['details'],'stack':this[_0x43770e(-0x164,-0x176)]};}['toString'](){function _0x594607(_0x2fa6af,_0x8f9e9){return _0x4d5f(_0x2fa6af- -0x37,_0x8f9e9);}return this[_0x594607(0x6c,0x7f)]+':\x20'+this[_0x594607(0x93,0x3a)]+'\x20(Status:\x20'+this[_0x594607(0x132,0x152)]+')';}}class HttpClient{constructor(config){function _0x495cb5(_0x1c15b4,_0x58aaee){return _0x4d5f(_0x1c15b4-0x32b,_0x58aaee);}this['baseURL']=config[_0x495cb5(0x3f7,0x3d3)],this[_0x495cb5(0x46d,0x444)]=config[_0x495cb5(0x46d,0x47c)],this['client']=axios[_0x495cb5(0x43b,0x3f0)]({'baseURL':this[_0x495cb5(0x496,0x472)],'timeout':config[_0x495cb5(0x3fe,0x428)]||0x2710,'headers':{'Content-Type':'application/json','apikey':this['apiKey'],...config['headers']}}),this[_0x495cb5(0x420,0x462)]();}[_0x33e61d(-0x18f,-0x119)](){function _0x44691a(_0x3e30dc,_0x1d6373){return _0x4d5f(_0x3e30dc-0x267,_0x1d6373);}this[_0x44691a(0x3ab,0x340)][_0x44691a(0x3c8,0x40c)]['request'][_0x44691a(0x3f0,0x464)](config=>{return config;},_0x3c16db=>{function _0xc9c061(_0x6588e6,_0x5a2f80){return _0x4d5f(_0x6588e6-0x124,_0x5a2f80);}return Promise[_0xc9c061(0x24d,0x2ae)](new EBaaSError(_0xc9c061(0x228,0x1ec),0x0,_0x3c16db));}),this['client']['interceptors'][_0x44691a(0x30c,0x34e)][_0x44691a(0x3f0,0x38b)](response=>{return response;},_0x4008f0=>{function _0x436ce5(_0x506bc3,_0x11d4ce){return _0x4d5f(_0x11d4ce- -0x296,_0x506bc3);}const status=_0x4008f0[_0x436ce5(-0x267,-0x1f1)]?.['status']||0x0,_0x1dd54c=_0x4008f0[_0x436ce5(-0x1ea,-0x1f1)]?.[_0x436ce5(-0x159,-0x158)]?.['message']||_0x4008f0[_0x436ce5(-0x183,-0x1cc)]||'Unknown\x20error',_0x1df225=_0x4008f0['response']?.[_0x436ce5(-0x18c,-0x158)]||_0x4008f0;return Promise['reject'](new EBaaSError(_0x1dd54c,status,_0x1df225));});}async['get'](_0x3ee676,config){function _0x5e2a5e(_0x68bb71,_0x1a31d6){return _0x4d5f(_0x1a31d6- -0x1c3,_0x68bb71);}try{const response=await this[_0x5e2a5e(-0xba,-0x7f)]['get'](_0x3ee676,config);return{'data':response['data'],'status':response[_0x5e2a5e(-0xb2,-0x5a)],'statusText':response['statusText'],'headers':response[_0x5e2a5e(-0x77,-0xda)]};}catch(_0x3e940c){throw this['handleError'](_0x3e940c);}}async['post'](_0x55374b,data,config){function _0x12ed55(_0x4d5d46,_0xa9769){return _0x4d5f(_0xa9769-0xac,_0x4d5d46);}try{const response=await this['client']['post'](_0x55374b,data,config);return{'data':response[_0x12ed55(0x221,0x1ea)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x53b7e1){throw this[_0x12ed55(0x137,0x1a3)](_0x53b7e1);}}async[_0x33e61d(-0x195,-0x14e)](_0x594760,data,config){function _0x5cea4b(_0x4f7d86,_0x41dfde){return _0x4d5f(_0x4f7d86- -0x387,_0x41dfde);}try{const response=await this['client']['put'](_0x594760,data,config);return{'data':response[_0x5cea4b(-0x249,-0x2c3)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0xd4289f){throw this[_0x5cea4b(-0x290,-0x25e)](_0xd4289f);}}async['patch'](_0x5ed043,data,config){function _0x5bba27(_0x239a17,_0x495256){return _0x4d5f(_0x239a17-0x18f,_0x495256);}try{const response=await this['client'][_0x5bba27(0x2ff,0x2b0)](_0x5ed043,data,config);return{'data':response['data'],'status':response[_0x5bba27(0x2f8,0x2e6)],'statusText':response[_0x5bba27(0x299,0x283)],'headers':response['headers']};}catch(_0x40340d){throw this['handleError'](_0x40340d);}}async['delete'](_0x582e10,config){function _0x3d6c6c(_0x21244f,_0x1209aa){return _0x4d5f(_0x1209aa-0x1b7,_0x21244f);}try{const response=await this[_0x3d6c6c(0x32a,0x2fb)][_0x3d6c6c(0x2ab,0x309)](_0x582e10,config);return{'data':response[_0x3d6c6c(0x359,0x2f5)],'status':response['status'],'statusText':response[_0x3d6c6c(0x314,0x2c1)],'headers':response['headers']};}catch(_0x4f984d){throw this[_0x3d6c6c(0x29e,0x2ae)](_0x4f984d);}}['setAuthToken'](_0x253eff){function _0x4fe60c(_0x330c70,_0x9dfe30){return _0x4d5f(_0x330c70-0xc4,_0x9dfe30);}this[_0x4fe60c(0x208,0x26d)][_0x4fe60c(0x1cc,0x189)][_0x4fe60c(0x1ad,0x190)][_0x4fe60c(0x250,0x203)]['Authorization']=_0x4fe60c(0x1d3,0x1c9)+_0x253eff;}[_0x33e61d(-0x115,-0x161)](){function _0x187274(_0x2e8cdc,_0x2a35cb){return _0x4d5f(_0x2e8cdc-0x256,_0x2a35cb);}delete this['client'][_0x187274(0x35e,0x321)][_0x187274(0x33f,0x380)][_0x187274(0x3e2,0x373)]['Authorization'],this['client'][_0x187274(0x35e,0x374)]['headers'][_0x187274(0x3e2,0x3d2)]['Authorization']=_0x187274(0x365,0x363)+this['apiKey'];}[_0x33e61d(-0x179,-0x117)](_0xf88c9a){function _0x1f4da7(_0xb71ae0,_0x1ea03c){return _0x4d5f(_0x1ea03c- -0x210,_0xb71ae0);}if(_0xf88c9a instanceof EBaaSError)return _0xf88c9a;return new EBaaSError(_0xf88c9a['message']||'HTTP\x20request\x20failed',_0xf88c9a[_0x1f4da7(-0x7c,-0xa7)]||0x0,_0xf88c9a);}}class AuthClient{constructor(_0x284532){this[_0x1e79d4(-0x1d6,-0x178)]=null,this['httpClient']=_0x284532;function _0x1e79d4(_0x44d58f,_0x33b074){return _0x4d5f(_0x44d58f- -0x300,_0x33b074);}this[_0x1e79d4(-0x1a5,-0x1d6)]();}async['signUp'](data){function _0x2d573c(_0x388f94,_0x57df51){return _0x4d5f(_0x388f94-0x20,_0x57df51);}try{const response=await this[_0x2d573c(0x148,0x171)]['post'](_0x2d573c(0x121,0x147),data);return response[_0x2d573c(0x15e,0x13f)]['session']&&this['setSessionInternal'](response[_0x2d573c(0x15e,0x1c0)][_0x2d573c(0x11a,0xe4)]),response['data'];}catch(_0x15923e){throw this['handleAuthError'](_0x15923e);}}async['signIn'](data){function _0x16a941(_0x2e5ea8,_0x40f056){return _0x4d5f(_0x2e5ea8-0x32a,_0x40f056);}try{const response=await this[_0x16a941(0x452,0x462)][_0x16a941(0x479,0x493)]('/auth/v1/sdk/signin',data);return response['data']['session']&&this['setSessionInternal'](response[_0x16a941(0x468,0x461)]['session']),response['data'];}catch(_0x2c2ca4){throw this[_0x16a941(0x40f,0x3cc)](_0x2c2ca4);}}async[_0x33e61d(-0xee,-0xdc)](){function _0x163d15(_0x13838a,_0x14c24c){return _0x4d5f(_0x14c24c-0x2a8,_0x13838a);}try{await this['httpClient'][_0x163d15(0x3fa,0x3f7)](_0x163d15(0x3ec,0x407)),this[_0x163d15(0x310,0x357)]();}catch(_0x3ed4fc){this[_0x163d15(0x314,0x357)]();throw this['handleAuthError'](_0x3ed4fc);}}async['getUser'](){function _0x3fbafa(_0x434772,_0x44c3bb){return _0x4d5f(_0x434772-0x6a,_0x44c3bb);}if(!this[_0x3fbafa(0x194,0x179)]?.['access_token'])return null;try{const response=await this['httpClient'][_0x3fbafa(0x15b,0x17e)](_0x3fbafa(0x1af,0x153));return response['data']['user'];}catch(_0x1bc980){if(_0x1bc980 instanceof EBaaSError&&_0x1bc980[_0x3fbafa(0x1d3,0x196)]===0x191)return this[_0x3fbafa(0x119,0x122)](),null;throw this['handleAuthError'](_0x1bc980);}}async[_0x33e61d(-0xf7,-0x121)](){function _0x9073cd(_0x199080,_0x34eb40){return _0x4d5f(_0x199080- -0xac,_0x34eb40);}if(!this['currentSession']?.[_0x9073cd(0x95,0x45)])return null;try{const response=await this['httpClient']['post']('/auth/v1/refresh',{'refresh_token':this[_0x9073cd(0x7e,0x3c)][_0x9073cd(0x95,0x69)]});if(response['data'][_0x9073cd(0x4e,0x7b)])return this[_0x9073cd(0xd3,0x96)](response[_0x9073cd(0x92,0xf8)]['session']),response['data'][_0x9073cd(0x4e,0x76)];return null;}catch(_0x1af6e1){this['clearSession']();throw this[_0x9073cd(0x39,0xaf)](_0x1af6e1);}}async[_0x33e61d(-0xcc,-0x123)](_0x4e9b2e){function _0x3326dc(_0x1d26c4,_0x4d9940){return _0x4d5f(_0x1d26c4-0x282,_0x4d9940);}try{await this[_0x3326dc(0x3aa,0x39d)][_0x3326dc(0x3d1,0x37d)]('/auth/v1/reset-password',{'email':_0x4e9b2e});}catch(_0x1c559d){throw this[_0x3326dc(0x367,0x381)](_0x1c559d);}}async[_0x33e61d(-0xf4,-0xd3)](data){function _0x535d9b(_0x564383,_0x5136ed){return _0x4d5f(_0x564383- -0x225,_0x5136ed);}try{const response=await this[_0x535d9b(-0xfd,-0xbd)][_0x535d9b(-0x165,-0x16f)](_0x535d9b(-0xe0,-0x156),data);return response[_0x535d9b(-0xe7,-0x130)]['user'];}catch(_0x512bd6){throw this[_0x535d9b(-0x140,-0xc9)](_0x512bd6);}}['getSession'](){function _0x3cb291(_0x598bbb,_0x55ec9b){return _0x4d5f(_0x598bbb-0x2f1,_0x55ec9b);}return this[_0x3cb291(0x41b,0x42b)];}[_0x33e61d(-0xbe,-0x8f)](_0x57948d){function _0x396102(_0x1a5f01,_0x5ba7b1){return _0x4d5f(_0x1a5f01- -0x1d5,_0x5ba7b1);}this['currentSession']=_0x57948d,this['httpClient']['setAuthToken'](_0x57948d[_0x396102(-0x5e,-0x72)]),typeof localStorage!==_0x396102(-0xa9,-0x11a)&&localStorage['setItem']('ebaas.auth.session',JSON[_0x396102(-0xe3,-0x10a)](_0x57948d));}[_0x33e61d(-0xd7,-0x10f)](_0x349f2d){return()=>{};}['setSessionInternal'](_0xa09d17){this['currentSession']=_0xa09d17,this[_0x2dbf1a(0x1ae,0x1ea)][_0x2dbf1a(0x1a3,0x21e)](_0xa09d17[_0x2dbf1a(0x26a,0x239)]);function _0x2dbf1a(_0x446955,_0x5e72a8){return _0x4d5f(_0x5e72a8-0xc2,_0x446955);}typeof localStorage!=='undefined'&&localStorage[_0x2dbf1a(0x22f,0x240)](_0x2dbf1a(0x1a8,0x217),JSON[_0x2dbf1a(0x193,0x1b4)](_0xa09d17));}[_0x33e61d(-0xf2,-0x15f)](){this['currentSession']=null;function _0x43f10(_0x140d7b,_0x581c1f){return _0x4d5f(_0x140d7b- -0x155,_0x581c1f);}this[_0x43f10(-0x2d,0x24)][_0x43f10(-0xa8,-0x95)](),typeof localStorage!==_0x43f10(-0x29,0x23)&&localStorage[_0x43f10(-0x94,-0x4b)](_0x43f10(0x0,0x54));}[_0x33e61d(-0x9c,-0xb3)](){function _0x48f81a(_0x4d561f,_0x1d453c){return _0x4d5f(_0x4d561f- -0x4a,_0x1d453c);}if(typeof localStorage!==_0x48f81a(0xe2,0xcd)){const _0x25b55b=localStorage[_0x48f81a(0x116,0xb4)](_0x48f81a(0x10b,0x102));if(_0x25b55b)try{const _0x3e3c87=JSON[_0x48f81a(0xa0,0x28)](_0x25b55b);this[_0x48f81a(0xc7,0xfa)](_0x3e3c87);}catch(_0x51075e){this['clearSession']();}}}[_0x33e61d(-0x121,-0x129)](_0x3ed58b){if(_0x3ed58b instanceof EBaaSError)return _0x3ed58b;function _0x4b0a3c(_0x2d5c07,_0x5eaf1c){return _0x4d5f(_0x2d5c07-0x197,_0x5eaf1c);}return new EBaaSError(_0x3ed58b[_0x4b0a3c(0x261,0x275)]||_0x4b0a3c(0x29d,0x289),_0x3ed58b[_0x4b0a3c(0x300,0x344)]||0x0,_0x3ed58b);}}class QueryBuilder{constructor(_0x24bf80,_0x3b90d6,_0x496271,_0x4c69d2){this[_0x4edbfb(0x25b,0x260)]=_0x24bf80,this['table']=_0x3b90d6;function _0x4edbfb(_0x2401b9,_0x3cb814){return _0x4d5f(_0x3cb814-0x138,_0x2401b9);}this['schema']=_0x496271,this['workspaceId']=_0x4c69d2,this['query']={'filters':[]};}[_0x33e61d(-0x5b,-0x92)](_0x4b72e1='*',_0x271802){this[_0x313422(-0x286,-0x293)][_0x313422(-0x1cd,-0x214)]=_0x4b72e1;function _0x313422(_0x4697c5,_0x26559e){return _0x4d5f(_0x4697c5- -0x349,_0x26559e);}return this;}['insert'](data,_0x29492e){function _0x1880b9(_0x451d56,_0x5a6c84){return _0x4d5f(_0x5a6c84-0x77,_0x451d56);}return this['executeQuery']('POST',_0x1880b9(0xfe,0x177)+this[_0x1880b9(0x168,0x191)]+'?operation=insert',{'data':data,'options':_0x29492e});}['update'](data,_0xfab6e3){function _0x244cf2(_0x53e4a8,_0x3160a5){return _0x4d5f(_0x53e4a8- -0x184,_0x3160a5);}return this['executeQuery']('PATCH',_0x244cf2(-0x84,-0x4c)+this[_0x244cf2(-0x6a,-0xf)],{'data':data,'options':_0xfab6e3,'filters':this[_0x244cf2(-0xc1,-0x122)][_0x244cf2(-0xd8,-0xab)]});}[_0x33e61d(-0x155,-0xdb)](data,_0x5d31b4){function _0x2f8b0e(_0x37a389,_0x294df3){return _0x4d5f(_0x37a389- -0x1fb,_0x294df3);}return this['executeQuery']('POST','/sdk/v1/'+this[_0x2f8b0e(-0xe1,-0xc4)]+'?operation=upsert',{'data':data,'options':{..._0x5d31b4,'upsert':!![]}});}['delete'](_0x7c3fc2){function _0x2b991e(_0x590264,_0x5ee6c2){return _0x4d5f(_0x590264- -0x1cc,_0x5ee6c2);}return this[_0x2b991e(-0x48,-0x81)]('DELETE',_0x2b991e(-0xcc,-0xd3)+this[_0x2b991e(-0xb2,-0x75)]+_0x2b991e(-0xb7,-0xef),{'options':_0x7c3fc2,'filters':this['query'][_0x2b991e(-0x120,-0x17e)]});}['eq'](_0x5f574b,_0x1e7f57){this['query']['filters'][_0x1b79fe(0x34c,0x332)]({'column':_0x5f574b,'operator':'eq','value':_0x1e7f57});function _0x1b79fe(_0x3b45a2,_0x132972){return _0x4d5f(_0x132972-0x1ca,_0x3b45a2);}return this;}[_0x33e61d(-0x101,-0x8d)](_0x227d0f,_0x50a918){this['query']['filters']['push']({'column':_0x227d0f,'operator':_0x402edf(0x2d7,0x2fd),'value':_0x50a918});function _0x402edf(_0x28629e,_0x20260e){return _0x4d5f(_0x28629e-0x156,_0x20260e);}return this;}['gt'](_0x49884f,_0x7fd96b){function _0x3e7b5d(_0x4a08d0,_0x4c14b6){return _0x4d5f(_0x4a08d0- -0x2ef,_0x4c14b6);}return this[_0x3e7b5d(-0x22c,-0x217)][_0x3e7b5d(-0x243,-0x245)]['push']({'column':_0x49884f,'operator':'gt','value':_0x7fd96b}),this;}['gte'](_0x5913f7,_0x5b5705){function _0x5cb2e3(_0x353076,_0x9af62c){return _0x4d5f(_0x9af62c- -0x248,_0x353076);}return this[_0x5cb2e3(-0x13a,-0x185)]['filters'][_0x5cb2e3(-0x80,-0xe0)]({'column':_0x5913f7,'operator':_0x5cb2e3(-0xdb,-0x131),'value':_0x5b5705}),this;}['lt'](_0x57bd43,_0xc5a6a1){this['query'][_0x435ed7(0xa5,0xed)][_0x435ed7(0x16a,0x1a9)]({'column':_0x57bd43,'operator':'lt','value':_0xc5a6a1});function _0x435ed7(_0x4474dc,_0x165e86){return _0x4d5f(_0x165e86-0x41,_0x4474dc);}return this;}[_0x33e61d(-0x1b5,-0x13e)](_0x54eb2b,_0xdd7d0c){this['query']['filters'][_0x1c1218(0x37d,0x3b6)]({'column':_0x54eb2b,'operator':_0x1c1218(0x32e,0x31e),'value':_0xdd7d0c});function _0x1c1218(_0x50c4a3,_0x2fbfad){return _0x4d5f(_0x2fbfad-0x24e,_0x50c4a3);}return this;}[_0x33e61d(-0x17f,-0x139)](_0x4f3e87,_0x441432){function _0x139cff(_0x5e62bc,_0x1093c3){return _0x4d5f(_0x1093c3- -0x42,_0x5e62bc);}return this['query'][_0x139cff(0x50,0x6a)][_0x139cff(0x150,0x126)]({'column':_0x4f3e87,'operator':'like','value':_0x441432}),this;}[_0x33e61d(-0x156,-0x16f)](_0x452cb2,_0x35beea){return this['query']['filters']['push']({'column':_0x452cb2,'operator':'ilike','value':_0x35beea}),this;}['is'](_0x47f27e,_0x483d1d){this['query']['filters'][_0xd429dc(0x595,0x524)]({'column':_0x47f27e,'operator':'is','value':_0x483d1d});function _0xd429dc(_0x25e535,_0x598379){return _0x4d5f(_0x598379-0x3bc,_0x25e535);}return this;}['in'](_0x33354a,_0x270b7d){this[_0x127f2a(-0x2bd,-0x31b)]['filters']['push']({'column':_0x33354a,'operator':'in','value':_0x270b7d});function _0x127f2a(_0x5a75cc,_0x2828bd){return _0x4d5f(_0x5a75cc- -0x380,_0x2828bd);}return this;}[_0x33e61d(-0x18b,-0x15d)](_0x1eba7a,_0x4ab8c0){this['query']['filters'][_0x130129(0x20f,0x1a4)]({'column':_0x1eba7a,'operator':'contains','value':_0x4ab8c0});function _0x130129(_0x1ebca1,_0x276688){return _0x4d5f(_0x1ebca1-0xa7,_0x276688);}return this;}['match'](_0x966ce5){return Object['entries'](_0x966ce5)['forEach'](([_0x22d712,_0x438935])=>{this['eq'](_0x22d712,_0x438935);}),this;}[_0x33e61d(-0x194,-0x152)](_0x121259,_0x306658){function _0x509f10(_0x1f76b2,_0x5ef181){return _0x4d5f(_0x1f76b2-0x2be,_0x5ef181);}return!this[_0x509f10(0x381,0x3b7)]['order']&&(this[_0x509f10(0x381,0x3de)][_0x509f10(0x37a,0x308)]=[]),this['query'][_0x509f10(0x37a,0x359)][_0x509f10(0x426,0x407)]({'column':_0x121259,'ascending':_0x306658?.[_0x509f10(0x446,0x417)]!==![]}),this;}['limit'](count){function _0x2ecfc6(_0x4e3c35,_0x2e2c80){return _0x4d5f(_0x2e2c80- -0x3b,_0x4e3c35);}return this['query'][_0x2ecfc6(0x197,0x14c)]=count,this;}['range'](from,_0x200b02){function _0x578dd5(_0x3b235b,_0x4bd3ec){return _0x4d5f(_0x4bd3ec- -0x21e,_0x3b235b);}return this[_0x578dd5(-0x1d4,-0x15b)][_0x578dd5(-0xdf,-0xfb)]={'from':from,'to':_0x200b02},this;}async[_0x33e61d(-0x1a7,-0x140)](){function _0x57903d(_0x5c12e2,_0x24ee8a){return _0x4d5f(_0x5c12e2- -0x252,_0x24ee8a);}return this[_0x57903d(-0xce,-0x108)]('GET',_0x57903d(-0x152,-0x1ac)+this[_0x57903d(-0x138,-0xe2)]+'?operation=select',{'select':this['query']['select'],'filters':this[_0x57903d(-0x18f,-0x196)][_0x57903d(-0x1a6,-0x212)],'order':this['query']['order'],'limit':this[_0x57903d(-0x18f,-0x1a8)]['limit'],'range':this['query']['range']});}async[_0x33e61d(-0x123,-0x15c)](){this[_0x579c8d(0x257,0x209)](0x1);const result=await this[_0x579c8d(0x162,0x150)]();function _0x579c8d(_0x47e132,_0x43cc3e){return _0x4d5f(_0x43cc3e-0x82,_0x47e132);}return{'data':result['data']?.[0x0]||null,'error':result[_0x579c8d(0x14b,0x1a6)]};}async[_0x33e61d(-0x8f,-0x8a)](_0x5d283b,_0x1c08fe,_0x13c41d){function _0x73b9f8(_0x1cd32a,_0x125ea7){return _0x4d5f(_0x1cd32a- -0x233,_0x125ea7);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this[_0x73b9f8(-0x114,-0xf9)]);if(_0x5d283b==='GET'){const _0x5d228a=_0x1c08fe[_0x73b9f8(-0xd6,-0xba)]('?'),_0x4c5855=_0x5d228a[0x0],existingParams=new URLSearchParams(_0x5d228a[0x1]||'');if(_0x13c41d[_0x73b9f8(-0xb7,-0x92)])existingParams[_0x73b9f8(-0x13a,-0x19e)]('select',_0x13c41d['select']);_0x13c41d[_0x73b9f8(-0x187,-0x186)]?.['length']&&_0x13c41d['filters']['forEach'](filter=>{function _0x2e845d(_0x491f9b,_0x3aa6ea){return _0x4d5f(_0x491f9b- -0x1a8,_0x3aa6ea);}existingParams['append'](filter[_0x2e845d(-0x5d,-0xc8)],filter[_0x2e845d(-0x8d,-0x1e)]+'.'+filter[_0x2e845d(-0xeb,-0xc0)]);});if(_0x13c41d['order']?.[_0x73b9f8(-0x198,-0x16f)]){const orderStr=_0x13c41d['order']['map'](_0x2137ce=>''+_0x2137ce[_0x73b9f8(-0xe8,-0x113)]+(_0x2137ce[_0x73b9f8(-0xab,-0xa0)]?'.asc':'.desc'))[_0x73b9f8(-0x12a,-0x154)](',');existingParams['append'](_0x73b9f8(-0x177,-0x1ef),orderStr);}if(_0x13c41d[_0x73b9f8(-0xac,-0x56)])existingParams[_0x73b9f8(-0x13a,-0x126)](_0x73b9f8(-0xac,-0xa8),_0x13c41d['limit']['toString']());_0x13c41d[_0x73b9f8(-0x110,-0xa9)]&&(existingParams['append'](_0x73b9f8(-0x16d,-0x189),_0x13c41d[_0x73b9f8(-0x110,-0x11a)]['from'][_0x73b9f8(-0xcf,-0xee)]()),existingParams['append']('limit',(_0x13c41d['range']['to']-_0x13c41d['range']['from']+0x1)['toString']())),response=await this['httpClient']['get'](_0x4c5855+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x5d283b==='DELETE'){const _0x574b40=_0x1c08fe['split']('?'),_0x131e15=_0x574b40[0x0],existingParams=new URLSearchParams(_0x574b40[0x1]||'');!existingParams[_0x73b9f8(-0xe5,-0xa9)](_0x73b9f8(-0x15b,-0x119))&&existingParams[_0x73b9f8(-0x13a,-0xe8)](_0x73b9f8(-0x15b,-0x111),'delete');_0x13c41d[_0x73b9f8(-0x187,-0x119)]?.['length']&&_0x13c41d[_0x73b9f8(-0x187,-0x150)]['forEach'](filter=>{function _0x42a1b7(_0x4b3ad5,_0xbe7322){return _0x4d5f(_0xbe7322- -0x4c,_0x4b3ad5);}existingParams[_0x42a1b7(0x8f,0xad)](filter[_0x42a1b7(0x115,0xff)],filter[_0x42a1b7(0xc5,0xcf)]+'.'+filter['value']);});const deleteUrl=_0x131e15+'?'+existingParams[_0x73b9f8(-0xcf,-0x124)]();response=await this['httpClient']['delete'](deleteUrl,{'headers':headers});}else{if(_0x5d283b==='PATCH'){const _0x14f26f=_0x1c08fe['split']('?'),_0x17eafd=_0x14f26f[0x0],existingParams=new URLSearchParams(_0x14f26f[0x1]||'');!existingParams['has']('operation')&&existingParams[_0x73b9f8(-0x13a,-0xe8)](_0x73b9f8(-0x15b,-0x1a2),_0x73b9f8(-0x156,-0x15f));_0x13c41d['filters']?.[_0x73b9f8(-0x198,-0x139)]&&_0x13c41d['filters'][_0x73b9f8(-0xbf,-0xf0)](filter=>{function _0x586643(_0x18dd86,_0x5ce15b){return _0x4d5f(_0x5ce15b- -0x9e,_0x18dd86);}existingParams[_0x586643(-0xb,0x5b)](filter['column'],filter[_0x586643(0x22,0x7d)]+'.'+filter[_0x586643(0x97,0x1f)]);});_0x13c41d[_0x73b9f8(-0xc1,-0x12a)]?.['prefer']&&(headers[_0x73b9f8(-0xb3,-0x98)]=_0x13c41d['options'][_0x73b9f8(-0x11f,-0xf2)]);const updateUrl=_0x17eafd+'?'+existingParams['toString']();response=await this['httpClient']['patch'](updateUrl,_0x13c41d['data'],{'headers':headers});}else{let _0x5f3647=_0x13c41d['data'];!headers['Prefer']&&(headers[_0x73b9f8(-0xb3,-0x104)]='return=representation'),_0x13c41d['options']?.[_0x73b9f8(-0x100,-0xb8)]&&(headers['Prefer']='resolution=merge-duplicates,return=representation'),_0x13c41d[_0x73b9f8(-0x15f,-0x106)]&&(_0x5f3647=_0x13c41d[_0x73b9f8(-0x15f,-0x18a)]),response=await this['httpClient']['post'](_0x1c08fe,_0x5f3647,{'headers':headers});}}}return{'data':response['data'],'error':null,'count':response[_0x73b9f8(-0x14a,-0x12b)]?.['x-total-count']?parseInt(response[_0x73b9f8(-0x14a,-0x1bc)]['x-total-count']):undefined};}catch(_0x2020a4){return{'data':null,'error':_0x2020a4 instanceof EBaaSError?_0x2020a4:new EBaaSError(_0x2020a4 instanceof Error?_0x2020a4[_0x73b9f8(-0x169,-0x1d5)]:_0x73b9f8(-0xbb,-0x134),0x0,_0x2020a4)};}}}function _0x5714(){const _0x53e1ce=['Cg9ZDgDYzxneyxrHyMfZzq','AgvHCNrIzwf0','C2vHCMnO','DxbKyxrL','Dg9WAwm','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','odK2mta2zMrWvMLr','DgvZDen1C3rVBunVBM5Ly3rPB24','DhjHy2S','l2zPBgvZlW','y3vYCMvUDfnJAgvTyq','AgfUzgXLqxv0AevYCM9Y','C29JA2v0','BgLZDej1y2TLDhm','zw50CNLWB2LUDa','AgvHzgvYCW','CgfYC2u','CMvZzxrqyxnZD29Yza','y2fWDhvYzvn0ywnRvhjHy2u','CMvMCMvZAfnLC3nPB24','l2zPBgvZl2nVChK','Aw5KzxGUDhm','AgfZq3vZDg9Trgf0ywjHC2u','z2v0','C3rYAw5NAwz5','x3jLAM9PBG','y29UBMvJDgLVBLn0yxrL','C2v0DxbjBNrLCMnLChrVCNm','yNvJA2v0swq','AgfUzgXLrxjYB3i','C2v0','yxbWzw5K','C2vZC2LVBG','zxzLBNq','l3nPz24','l3n0B3jHz2uVDxnHz2u','Bgv2zwW','B25bDxrOu3rHDgvdAgfUz2u','l3nKAY92ms8','l2f1DgGVDJeVC2LNBNvW','mZmZntGYmhnSC2nXqq','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','uMvXDwvZDcbMywLSzwq','mtHivLr5DMm','qxv0AgvUDgLJyxrPB24GzMfPBgvK','CMvTB3zLq3vZDg9Trgf0ywjHC2u','zgvMyxvSDhm','AM9PBG','C3rHDhvZvgv4Da','ChjLC2vUy2u6','zw1PDa','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','qMvHCMvYia','y3jLyxrL','C2v0u2vZC2LVBKLUDgvYBMfS','y29WEq','y2fJAgvdB250CM9S','ChjLzMvY','p29WzxjHDgLVBJ1KzwXLDgu','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','z3rL','BwfRzvjLzG','B2zM','DgfIBgu','B3bLCMf0B3i','z2v0vxnHz2u','CMvJB25Uzwn0qxr0zw1WDhm','zMLSDgvY','D29YA3nWywnLswq','Aw52B2TL','CMvTB3zL','yxv0Aa','CMfUz2u','zxjYB3i','l2z1BMn0Aw9UCY92ms8','l2zPBgvZ','CMvJB25Uzwn0','Ahr0CenSAwvUDa','CMvQzwn0','y3vYCMvUDfnLC3nPB24','C3rVCMfNzq','Dw5KzwzPBMvK','zgv0zwn0zwrdB25MAwC','Bwv0ywrHDge','C3rYAw5N','C3vIC2nYAxb0Aw9UCW','BgLZDa','C2LNBK91Da','DxbZzxj0','DxbKyxrLqNvJA2v0','Dw50CMfJAW','nJm2A010v3Pp','DhjHBNnMB3jT','mtm2mdG5nxDsv3zTrq','yNvJA2v0','Aw1WB3j0twfW','DxbKyxrLvxnLCG','zgf0ywjHC2u','zgvSzxrLqNvJA2v0','zgf0yq','AM9PBMvKt25Jzq','DgvZDenVBM5Ly3rPB24','CMvMCMvZAf90B2TLBG','yxbPs2v5','igf0DgvTChrZoIa','y2XPzw50','l2f1DgGVDJeVDxnLCG','Dgv4Dc9WBgfPBG','C2nOzw1H','mtC1ndLLBMnyvwm','C3rHCNrZv2L0Aa','zgv0ywLSCW','y29SDw1U','z2v0qNvJA2v0','C2v0v29YA3nWywnLswq','AgfZ','Cg9ZDa','zMLSzq','yNjVywrJyxn0','zgvSzxrL','Cg9ZDgDYzxnFy2HHBMDLCZO','zNvUy3rPB25Z','zwjHyxmUyxv0Ac5ZzxnZAw9U','ms4WlJa','C29YDej5','Cg9ZDgDYzxniB3n0','DxbSB2fK','x2PVAw4','Bg9HzfnLC3nPB24','C2v0qxv0AfrVA2vU','C3bSAxq','y3jLzgvUDgLHBhm','l2f1DgGVDJeVC2LNBM91Da','z2v0sxrLBq','Aw50zxjJzxb0B3jZ','ChvIBgLJ','C3vIC3rYAw5N','Dg9tDhjPBMC','DMvYAwz5','AgvHCNrIzwf0sw50zxj2ywW','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','ChvZAa','C3rHDhvZ','y29UBMvJDgvK','yMfZzvvsta','z2v0q2HHBM5LBhm','CMvTB3zLq2HHBM5LBa','rMfPBgvKihrVihjLBw92zsbMAwXLCW','y2XVC2vK','Cgf0y2G','C3rHDgu','B3b0Aw9UCW','nJG5nZyWsNDkAM9Q','zM9YrwfJAa','z2v0twv0CMLJCW','yM9KEq','ywnJzxnZx3rVA2vU','rgf0ywjHC2uGB3bLCMf0Aw9UigzHAwXLza','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','z2v0v29YA3nWywnLswq','C2v0DxbizwfYDgjLyxq','C2vSzwn0','ntq2oePsvgLxDq','C2v0sxrLBq','C2v0u2vZC2LVBG','uhjLzMvY','BMvX','nti0mdeYB0HXseXK','CMvHBhrPBwu','zxHLy3v0zvf1zxj5','odjzrhr2tgu','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','BgLTAxq','yxnJzw5KAw5N','DxnL','yNjVywrJyxn0oG','ChjLC2vUy2u','y29TBw9U','q0Xpu0ve','y3jLyxrLqNvJA2v0','y3jLyxrLu2LNBMvKvxjS','BgvUz3rO','Dw5ZDwjZy3jPyMu','zw52','y2XLyxi','AwXPA2u','l3jWyY8','Aw5PDgLHBgL6zq','zgv0zwn0q3vZDg9Trgf0ywjHC2u','BMfTzq','rMfPBgvKihrVigXPC3qGzMLSzxm','CMvZCg9UC2u','Cg9ZDgDYzxnFy2HHBMDLCW','Ag9ZDa','zw50CMLLCW','z2v0u3rHDgu','BM93','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','zMLSDgvYCW','CMvTB3zLqxv0AfrVA2vU','CNbJ','y2XLyxjtzxnZAw9U','z2v0tg9NCW','y29UDgfPBNm','C2LUz2XL','BxvSDgLWyxj0l2zVCM0Tzgf0yq','B25qB3n0z3jLC0nOyw5Nzxm','rujHyvnfCNjVCG','x3rYAwDNzxi','C3nSrw5HyMXLza','rMfPBgvKihrVihvWzgf0zsbMDw5JDgLVBIbLBNzPCM9UBwvUDa','y29UDgvUDfr5Cgu','zgLZy29UBMvJDa','l2LUzM8','B3jKzxi','DMfSDwu','CMfUzg9T','y2HHBM5LBhm','Chv0','CMvTB3zLsxrLBq','AM9PBMvK','CxvLCNK','zg93BMXVywq','y2HHBM5LBa','B2zMC2v0','l3n0B3jHz2uVyNvJA2v0CY8','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','y29UBMvJDa','BwvZC2fNzq','zgLZy29UBMvJDgvK','DxjS','y29Kzq','zxHLy3v0zq','CgvYAw9K','BhrL','Cgf0Aa','C3rHy2S','DgLTzw91Da','zgf0yufYCMf5','BgLRzq','zNjVBq','z2v0uhvIBgLJvxjS','B3bLCMf0Aw9U','y29UBMvJDf9LCNjVCG'];_0x5714=function(){return _0x53e1ce;};return _0x5714();}class CustomDatabaseManager{constructor(_0x2a4fe8,_0x3ebf7a){function _0x175afb(_0x5f0463,_0xd3c5ed){return _0x4d5f(_0x5f0463- -0x2a2,_0xd3c5ed);}this[_0x175afb(-0x17a,-0x14d)]=_0x2a4fe8,this['workspaceId']=_0x3ebf7a;}async['detectCustomDatabase'](){if(!this['workspaceId'])return{'hasCustomDatabase':![]};try{const response=await this[_0x2efa52(0x3a9,0x362)][_0x2efa52(0x372,0x37c)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response[_0x2efa52(0x3ea,0x45d)]===0xc8&&response[_0x2efa52(0x3bf,0x392)]?.['config']){const config=response[_0x2efa52(0x3bf,0x355)]['config'],_0x15a516={'host':config[_0x2efa52(0x3d9,0x3fa)],'port':config['postgresPort'],'database':config[_0x2efa52(0x35b,0x2fd)],'username':config['postgresUsername'],'password':'','schema':config['postgresSchema'],'sslEnabled':config[_0x2efa52(0x338,0x2e8)]};return this[_0x2efa52(0x3ae,0x382)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x15a516},this[_0x2efa52(0x3ae,0x387)];}}catch(_0x1689db){if(_0x1689db?.['status']===0x194)return this[_0x2efa52(0x3ae,0x334)]={'hasCustomDatabase':![]},this[_0x2efa52(0x3ae,0x3d1)];console['warn']('Failed to detect custom database configuration:',_0x1689db);}this['detectedConfig']={'hasCustomDatabase':![]};function _0x2efa52(_0x3e2411,_0x10fa11){return _0x4d5f(_0x3e2411-0x281,_0x10fa11);}return this['detectedConfig'];}async['testConnection'](_0x67f342){function _0x51b00b(_0x4e2577,_0x891375){return _0x4d5f(_0x891375- -0x32a,_0x4e2577);}try{const response=await this[_0x51b00b(-0x1c7,-0x202)]['post']('/admin/v1/workspace/custom-database/test-connection',_0x67f342,{'headers':this[_0x51b00b(-0x1d2,-0x20b)]?{'X-Workspace-ID':this['workspaceId']}:{}});return response['data'];}catch(_0x35219c){return{'success':![],'message':_0x35219c?.[_0x51b00b(-0x1e6,-0x260)]||'Failed\x20to\x20test\x20connection'};}}async[_0x33e61d(-0x108,-0x101)](_0x7e8583){if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');const response=await this[_0x208f53(0xef,0x12b)][_0x208f53(0x116,0xf0)]('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x7e8583},{'headers':{'X-Workspace-ID':this[_0x208f53(0xe6,0xef)]}});function _0x208f53(_0x2c42ac,_0x580d62){return _0x4d5f(_0x2c42ac- -0x39,_0x580d62);}const config=response['data']['config'];return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x7e8583},config;}async['removeCustomDatabase'](){function _0x32521b(_0x4c2fc3,_0x40c05b){return _0x4d5f(_0x4c2fc3- -0x3a8,_0x40c05b);}if(!this[_0x32521b(-0x289,-0x24d)])throw new Error('Workspace ID is required to remove custom database');await this['httpClient'][_0x32521b(-0x256,-0x29d)]('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this[_0x32521b(-0x289,-0x2cd)]}}),this[_0x32521b(-0x27b,-0x2bc)]={'hasCustomDatabase':![]};}['getDetectedConfig'](){return this['detectedConfig'];}[_0x33e61d(-0x177,-0x11e)](){function _0xac3150(_0x1836c0,_0x3a0e71){return _0x4d5f(_0x3a0e71- -0x2cd,_0x1836c0);}return this['detectedConfig']?.[_0xac3150(-0x167,-0x1dd)]??![];}[_0x33e61d(-0x90,-0x10b)](){function _0x42e3a2(_0x1a373d,_0x269d06){return _0x4d5f(_0x1a373d- -0x111,_0x269d06);}return this[_0x42e3a2(0x1c,0x15)]?.['credentials'];}[_0x33e61d(-0xa3,-0xc1)](_0x1af08e){function _0x117d66(_0x414af6,_0x3f0855){return _0x4d5f(_0x414af6-0x378,_0x3f0855);}this[_0x117d66(0x497,0x4c7)]=_0x1af08e,this['detectedConfig']=undefined;}['getWorkspaceId'](){return this['workspaceId'];}['getStatus'](){function _0x4d38c1(_0x5b889e,_0x9ee29f){return _0x4d5f(_0x5b889e- -0x361,_0x9ee29f);}return{'workspaceId':this['workspaceId'],'hasConfig':this[_0x4d38c1(-0x271,-0x215)](),'configDetails':this[_0x4d38c1(-0x234,-0x1e1)]?.[_0x4d38c1(-0x203,-0x213)]?{'host':this[_0x4d38c1(-0x234,-0x241)][_0x4d38c1(-0x203,-0x278)][_0x4d38c1(-0x2ba,-0x2ef)],'port':this['detectedConfig'][_0x4d38c1(-0x203,-0x1a7)]['port'],'database':this['detectedConfig'][_0x4d38c1(-0x203,-0x278)]['database'],'schema':this['detectedConfig']['credentials'][_0x4d38c1(-0x21a,-0x1f2)]||_0x4d38c1(-0x1ff,-0x260),'sslEnabled':this[_0x4d38c1(-0x234,-0x21a)]['credentials']['sslEnabled']||![]}:undefined};}}function _0x4d5f(_0x199879,_0x190b03){const _0x571405=_0x5714();return _0x4d5f=function(_0x4d5f61,_0x4cbc55){_0x4d5f61=_0x4d5f61-0x9b;let _0x1d47a7=_0x571405[_0x4d5f61];if(_0x4d5f['yuiaUl']===undefined){var _0x2000a0=function(_0x37dada){const _0xde3a40='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x170bb0='',_0x3c16db='';for(let _0x4008f0=0x0,_0x1dd54c,_0x1df225,_0x3ee676=0x0;_0x1df225=_0x37dada['charAt'](_0x3ee676++);~_0x1df225&&(_0x1dd54c=_0x4008f0%0x4?_0x1dd54c*0x40+_0x1df225:_0x1df225,_0x4008f0++%0x4)?_0x170bb0+=String['fromCharCode'](0xff&_0x1dd54c>>(-0x2*_0x4008f0&0x6)):0x0){_0x1df225=_0xde3a40['indexOf'](_0x1df225);}for(let _0x3e940c=0x0,_0x55374b=_0x170bb0['length'];_0x3e940c<_0x55374b;_0x3e940c++){_0x3c16db+='%'+('00'+_0x170bb0['charCodeAt'](_0x3e940c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3c16db);};_0x4d5f['hSyCPD']=_0x2000a0,_0x199879=arguments,_0x4d5f['yuiaUl']=!![];}const _0x5cac62=_0x571405[0x0],_0x44d525=_0x4d5f61+_0x5cac62,_0x462bd9=_0x199879[_0x44d525];return!_0x462bd9?(_0x1d47a7=_0x4d5f['hSyCPD'](_0x1d47a7),_0x199879[_0x44d525]=_0x1d47a7):_0x1d47a7=_0x462bd9,_0x1d47a7;},_0x4d5f(_0x199879,_0x190b03);}function _0x33e61d(_0x496710,_0x1e2a50){return _0x4d5f(_0x1e2a50- -0x20e,_0x496710);}class DatabaseClient{constructor(_0x56957c,_0x35df47){this['httpClient']=_0x56957c,this['customDatabaseManager']=new CustomDatabaseManager(_0x56957c,_0x35df47);}[_0x33e61d(-0x13f,-0x138)](_0x2143a4){function _0x19b574(_0x536034,_0x38e4c5){return _0x4d5f(_0x536034- -0x2c9,_0x38e4c5);}return new QueryBuilder(this['httpClient'],_0x2143a4,this[_0x19b574(-0x1e5,-0x1b5)],this[_0x19b574(-0x21e,-0x27d)][_0x19b574(-0x14f,-0xea)]());}[_0x33e61d(-0xf0,-0x160)](_0x31d2b2,_0x25a3f4){function _0x3becb2(_0xbbf2c8,_0x154f2b){return _0x4d5f(_0xbbf2c8- -0x3e7,_0x154f2b);}return this['httpClient']['post'](_0x3becb2(-0x347,-0x31a)+_0x31d2b2,_0x25a3f4);}['schema'](_0x34afc4){const _0x592d49=new DatabaseClient(this['httpClient'],this[_0x5c00f1(0x3d4,0x3b7)]['getWorkspaceId']());function _0x5c00f1(_0x20e863,_0x115c24){return _0x4d5f(_0x20e863-0x329,_0x115c24);}return _0x592d49['currentSchema']=_0x34afc4,_0x592d49['customDatabaseManager']=this[_0x5c00f1(0x3d4,0x3e0)],_0x592d49;}async[_0x33e61d(-0x12c,-0x16c)](){function _0x4feb4a(_0x3c37d9,_0x3503d0){return _0x4d5f(_0x3503d0- -0x310,_0x3c37d9);}return this[_0x4feb4a(-0x27c,-0x265)]['detectCustomDatabase']();}async[_0x33e61d(-0x137,-0x12d)](_0xa925fb){function _0x4d0c68(_0x2c0d3a,_0x23fb82){return _0x4d5f(_0x23fb82- -0x313,_0x2c0d3a);}return this[_0x4d0c68(-0x2b2,-0x268)][_0x4d0c68(-0x1ef,-0x1d3)](_0xa925fb);}async['configureCustomDatabase'](_0x428720){function _0x46f8ae(_0x1087b7,_0x4f10ee){return _0x4d5f(_0x1087b7-0x206,_0x4f10ee);}return this[_0x46f8ae(0x2b1,0x2cd)]['configureCustomDatabase'](_0x428720);}async[_0x33e61d(-0xe5,-0x107)](){function _0xcb985d(_0x281ccd,_0x73be9e){return _0x4d5f(_0x73be9e-0x211,_0x281ccd);}return this[_0xcb985d(0x251,0x2bc)][_0xcb985d(0x30d,0x318)]();}['isUsingCustomDatabase'](){function _0x46f6d4(_0xa202a1,_0x10b6e6){return _0x4d5f(_0x10b6e6- -0x2b0,_0xa202a1);}return this['customDatabaseManager'][_0x46f6d4(-0x148,-0x1c0)]();}['getCustomDatabaseStatus'](){function _0x35b69f(_0x11a691,_0x3fa23f){return _0x4d5f(_0x3fa23f- -0xc,_0x11a691);}return this[_0x35b69f(0x60,0x9f)]['getStatus']();}[_0x33e61d(-0x7e,-0xc1)](_0x13df7a){function _0x1f0d17(_0x309ae2,_0x166861){return _0x4d5f(_0x166861- -0x250,_0x309ae2);}this['customDatabaseManager'][_0x1f0d17(-0xb1,-0x103)](_0x13df7a);}async[_0x33e61d(-0x15e,-0x16d)](){try{await this['customDatabaseManager']['detectCustomDatabase']();}catch(_0x4d7d51){console['warn']('Failed to initialize custom database detection:',_0x4d7d51);}}}class StorageBucket{constructor(_0x161814,bucketId){this['httpClient']=_0x161814,this['bucketId']=bucketId;}async[_0x33e61d(-0x92,-0xb5)](_0x3021a1,_0x1f8ac7,_0x5379a9){function _0x2feeb9(_0x2da70c,_0x348299){return _0x4d5f(_0x348299-0x3a3,_0x2da70c);}try{const _0x3af037=new FormData();if(_0x1f8ac7 instanceof File)_0x3af037['append'](_0x2feeb9(0x52d,0x4f3),_0x1f8ac7);else{if(_0x1f8ac7 instanceof Blob)_0x3af037[_0x2feeb9(0x4e1,0x49c)]('file',_0x1f8ac7,_0x3021a1);else{if(_0x1f8ac7 instanceof ArrayBuffer)_0x3af037[_0x2feeb9(0x4c8,0x49c)](_0x2feeb9(0x49b,0x4f3),new Blob([_0x1f8ac7]),_0x3021a1);else typeof _0x1f8ac7===_0x2feeb9(0x513,0x4d2)&&_0x3af037['append'](_0x2feeb9(0x519,0x4f3),new Blob([_0x1f8ac7],{'type':'text/plain'}),_0x3021a1);}}_0x3af037['append'](_0x2feeb9(0x4b1,0x474),_0x3021a1);_0x5379a9?.['cacheControl']&&_0x3af037[_0x2feeb9(0x4e9,0x49c)](_0x2feeb9(0x526,0x4b6),_0x5379a9['cacheControl']);_0x5379a9?.[_0x2feeb9(0x41b,0x45c)]&&_0x3af037[_0x2feeb9(0x4e2,0x49c)]('contentType',_0x5379a9['contentType']);_0x5379a9?.[_0x2feeb9(0x471,0x4d1)]&&_0x3af037['append']('metadata',JSON[_0x2feeb9(0x4be,0x495)](_0x5379a9['metadata']));const _0x2f92d1=_0x2feeb9(0x42b,0x46a)+this['bucketId']+_0x2feeb9(0x4cc,0x4c9)+(_0x5379a9?.['upsert']?'?upsert=true':''),response=await this[_0x2feeb9(0x500,0x4cb)][_0x2feeb9(0x514,0x4f2)](_0x2f92d1,_0x3af037,{'headers':{'Content-Type':_0x2feeb9(0x44e,0x456)}});return{'data':response[_0x2feeb9(0x46f,0x4e1)],'error':null};}catch(_0x5e81f6){return{'data':null,'error':_0x5e81f6 instanceof EBaaSError?_0x5e81f6:new EBaaSError(_0x5e81f6 instanceof Error?_0x5e81f6[_0x2feeb9(0x438,0x46d)]:'Failed\x20to\x20upload\x20file',0x0,_0x5e81f6)};}}async[_0x33e61d(-0x171,-0x14a)](_0x388ca9,_0x1670a4){function _0x3cbc7c(_0x34f63a,_0x21e3eb){return _0x4d5f(_0x21e3eb- -0x18d,_0x34f63a);}try{const _0x258c26=new URLSearchParams();_0x1670a4?.[_0x3cbc7c(-0x58,-0x56)]&&Object[_0x3cbc7c(-0x127,-0xe5)](_0x1670a4[_0x3cbc7c(-0x8,-0x56)])['forEach'](([_0x1fccdf,_0x5bee12])=>{_0x5bee12!==undefined&&_0x258c26['append'](_0x1fccdf,String(_0x5bee12));});const _0x20e4c0=_0x3cbc7c(-0xe8,-0xc6)+this['bucketId']+_0x3cbc7c(-0x6f,-0xaa)+_0x388ca9+(_0x258c26['toString']()?'?'+_0x258c26['toString']():''),response=await this[_0x3cbc7c(-0x37,-0x65)]['get'](_0x20e4c0,{'responseType':'blob'});return{'data':response[_0x3cbc7c(-0xc9,-0x4f)],'error':null};}catch(_0x503fd1){return{'data':null,'error':_0x503fd1 instanceof EBaaSError?_0x503fd1:new EBaaSError(_0x503fd1 instanceof Error?_0x503fd1[_0x3cbc7c(-0x118,-0xc3)]:'Failed\x20to\x20download\x20file',0x0,_0x503fd1)};}}async[_0x33e61d(-0xbf,-0xdd)](_0x59464b,_0x244c91){function _0x1f9bcd(_0x179711,_0x120a34){return _0x4d5f(_0x179711- -0x353,_0x120a34);}try{const _0x304616=new URLSearchParams();_0x59464b&&_0x304616['append']('prefix',_0x59464b);_0x244c91?.[_0x1f9bcd(-0x1cc,-0x23a)]&&_0x304616[_0x1f9bcd(-0x25a,-0x269)](_0x1f9bcd(-0x1cc,-0x1fd),String(_0x244c91[_0x1f9bcd(-0x1cc,-0x1bc)]));_0x244c91?.[_0x1f9bcd(-0x28d,-0x2c3)]&&_0x304616[_0x1f9bcd(-0x25a,-0x2cd)]('offset',String(_0x244c91['offset']));_0x244c91?.['sortBy']&&_0x304616[_0x1f9bcd(-0x25a,-0x22b)](_0x1f9bcd(-0x1fc,-0x209),JSON['stringify'](_0x244c91['sortBy']));_0x244c91?.[_0x1f9bcd(-0x277,-0x236)]&&_0x304616[_0x1f9bcd(-0x25a,-0x234)](_0x1f9bcd(-0x277,-0x283),_0x244c91[_0x1f9bcd(-0x277,-0x271)]);const _0x2def02='/storage/buckets/'+this['bucketId']+'/files'+(_0x304616[_0x1f9bcd(-0x1ef,-0x263)]()?'?'+_0x304616[_0x1f9bcd(-0x1ef,-0x1c0)]():''),response=await this[_0x1f9bcd(-0x22b,-0x286)]['get'](_0x2def02);return{'data':response[_0x1f9bcd(-0x215,-0x270)],'error':null};}catch(_0x3a96d0){return{'data':null,'error':_0x3a96d0 instanceof EBaaSError?_0x3a96d0:new EBaaSError(_0x3a96d0 instanceof Error?_0x3a96d0[_0x1f9bcd(-0x289,-0x2e2)]:_0x1f9bcd(-0x2af,-0x27b),0x0,_0x3a96d0)};}}async[_0x33e61d(-0xf8,-0xed)](_0x4d92ec){function _0x35fe3f(_0x3c1b81,_0x324b30){return _0x4d5f(_0x324b30-0x230,_0x3c1b81);}try{const response=await this['httpClient']['delete'](_0x35fe3f(0x33f,0x2f7)+this[_0x35fe3f(0x37d,0x326)]+'/files',{'data':{'paths':_0x4d92ec}});return{'data':response['data'],'error':null};}catch(_0x3167f7){return{'data':null,'error':_0x3167f7 instanceof EBaaSError?_0x3167f7:new EBaaSError(_0x3167f7 instanceof Error?_0x3167f7[_0x35fe3f(0x2ba,0x2fa)]:_0x35fe3f(0x33c,0x39e),0x0,_0x3167f7)};}}async['move'](fromPath,_0x219356){function _0x138571(_0x30d762,_0x5ccf2f){return _0x4d5f(_0x5ccf2f-0x39b,_0x30d762);}try{const response=await this[_0x138571(0x51b,0x4c3)]['post']('/storage/buckets/'+this[_0x138571(0x496,0x491)]+'/files/move',{'sourceKey':fromPath,'destinationKey':_0x219356});return{'data':response['data'],'error':null};}catch(_0x1e5a17){return{'data':null,'error':_0x1e5a17 instanceof EBaaSError?_0x1e5a17:new EBaaSError(_0x1e5a17 instanceof Error?_0x1e5a17['message']:'Failed\x20to\x20move\x20file',0x0,_0x1e5a17)};}}async[_0x33e61d(-0x126,-0xfc)](fromPath,_0x270cce){function _0x431040(_0x41ca94,_0x24d2a5){return _0x4d5f(_0x24d2a5- -0x2d7,_0x41ca94);}try{const response=await this['httpClient'][_0x431040(-0x14f,-0x188)]('/storage/buckets/'+this[_0x431040(-0x1e7,-0x1e1)]+_0x431040(-0x235,-0x1e9),{'sourceKey':fromPath,'destinationKey':_0x270cce});return{'data':response['data'],'error':null};}catch(_0x1aa4cd){return{'data':null,'error':_0x1aa4cd instanceof EBaaSError?_0x1aa4cd:new EBaaSError(_0x1aa4cd instanceof Error?_0x1aa4cd['message']:'Failed\x20to\x20copy\x20file',0x0,_0x1aa4cd)};}}async[_0x33e61d(-0x2a,-0x7f)](_0x167489,_0x5222d5,_0x1422bb){function _0x222413(_0x2aa98f,_0x141761){return _0x4d5f(_0x141761- -0x34f,_0x2aa98f);}try{const response=await this[_0x222413(-0x1b2,-0x227)]['post']('/storage/buckets/'+this[_0x222413(-0x20d,-0x259)]+'/files/'+_0x167489+_0x222413(-0x26c,-0x253),{'expiresIn':_0x5222d5,..._0x1422bb});return{'data':response[_0x222413(-0x1ab,-0x211)],'error':null};}catch(_0x37d77f){return{'data':null,'error':_0x37d77f instanceof EBaaSError?_0x37d77f:new EBaaSError(_0x37d77f instanceof Error?_0x37d77f['message']:'Failed\x20to\x20create\x20signed\x20URL',0x0,_0x37d77f)};}}[_0x33e61d(-0x1a0,-0x137)](_0x281cf3,_0x5caf0f){const _0x2676b4=new URLSearchParams();_0x5caf0f?.[_0x949cbf(0x403,0x3ae)]&&Object['entries'](_0x5caf0f[_0x949cbf(0x403,0x461)])[_0x949cbf(0x440,0x430)](([_0x54542f,_0x3bd79d])=>{function _0x4bc77c(_0x14f5fb,_0x2ed448){return _0x4d5f(_0x14f5fb-0x25a,_0x2ed448);}_0x3bd79d!==undefined&&_0x2676b4[_0x4bc77c(0x353,0x31f)](_0x54542f,String(_0x3bd79d));});const _0x4242ac=this[_0x949cbf(0x3f4,0x38b)]['baseURL']||'',_0x14ccd8=_0x4242ac+_0x949cbf(0x393,0x32b)+this['bucketId']+_0x949cbf(0x3af,0x3f2)+_0x281cf3+(_0x2676b4['toString']()?'?'+_0x2676b4['toString']():'');function _0x949cbf(_0x3e6b8d,_0x1dfee6){return _0x4d5f(_0x3e6b8d-0x2cc,_0x1dfee6);}return{'data':{'publicUrl':_0x14ccd8}};}async['getFileInfo'](_0x2f0a68){function _0x128b32(_0x3a512e,_0x280997){return _0x4d5f(_0x280997-0x31,_0x3a512e);}try{const response=await this[_0x128b32(0x17b,0x159)][_0x128b32(0x180,0x122)](_0x128b32(0xa0,0xf8)+this[_0x128b32(0x112,0x127)]+_0x128b32(0x10c,0x114)+_0x2f0a68+'/info');return{'data':response['data'],'error':null};}catch(_0x35337d){return{'data':null,'error':_0x35337d instanceof EBaaSError?_0x35337d:new EBaaSError(_0x35337d instanceof Error?_0x35337d[_0x128b32(0x88,0xfb)]:_0x128b32(0x10b,0x13f),0x0,_0x35337d)};}}async['updateFileMetadata'](_0x45fbd2,metadata){function _0x31e646(_0x3e578b,_0x440ff5){return _0x4d5f(_0x3e578b-0x363,_0x440ff5);}try{const response=await this['httpClient']['put']('/storage/buckets/'+this['bucketId']+_0x31e646(0x446,0x485)+_0x45fbd2+'/metadata',{'metadata':metadata});return{'data':response[_0x31e646(0x4a1,0x494)],'error':null};}catch(_0x13aaa7){return{'data':null,'error':_0x13aaa7 instanceof EBaaSError?_0x13aaa7:new EBaaSError(_0x13aaa7 instanceof Error?_0x13aaa7['message']:_0x31e646(0x42b,0x469),0x0,_0x13aaa7)};}}}class StorageClient{constructor(_0x1820aa){function _0x2b4b0e(_0x5eb2c5,_0x270256){return _0x4d5f(_0x5eb2c5-0x32f,_0x270256);}this[_0x2b4b0e(0x457,0x3de)]=_0x1820aa;}['from'](bucketId){return new StorageBucket(this['httpClient'],bucketId);}async[_0x33e61d(-0x4d,-0x80)](_0x392290,_0x6f069f){function _0x4af232(_0x24c945,_0xaae031){return _0x4d5f(_0xaae031-0x27,_0x24c945);}try{const response=await this['httpClient'][_0x4af232(0x16f,0x176)]('/storage/buckets',{'id':_0x392290,..._0x6f069f});return{'data':response[_0x4af232(0x127,0x165)],'error':null};}catch(_0x229a60){return{'data':null,'error':_0x229a60 instanceof EBaaSError?_0x229a60:new EBaaSError(_0x229a60 instanceof Error?_0x229a60['message']:'Failed\x20to\x20create\x20bucket',0x0,_0x229a60)};}}async[_0x33e61d(-0x8e,-0xc2)](_0x31fe96){function _0x16cd0f(_0x375c17,_0x5ee53b){return _0x4d5f(_0x5ee53b- -0x39a,_0x375c17);}try{const response=await this['httpClient'][_0x16cd0f(-0x25d,-0x2a9)](_0x16cd0f(-0x262,-0x2d3)+_0x31fe96);return{'data':response['data'],'error':null};}catch(_0xc5d9c6){return{'data':null,'error':_0xc5d9c6 instanceof EBaaSError?_0xc5d9c6:new EBaaSError(_0xc5d9c6 instanceof Error?_0xc5d9c6[_0x16cd0f(-0x295,-0x2d0)]:'Failed\x20to\x20get\x20bucket',0x0,_0xc5d9c6)};}}async[_0x33e61d(-0x154,-0x127)](){function _0x27bef3(_0x55b872,_0x248f9a){return _0x4d5f(_0x55b872- -0x65,_0x248f9a);}try{const response=await this['httpClient'][_0x27bef3(0x8c,0xe3)]('/storage/buckets');return{'data':response[_0x27bef3(0xd9,0xc9)],'error':null};}catch(_0x36caa0){return{'data':null,'error':_0x36caa0 instanceof EBaaSError?_0x36caa0:new EBaaSError(_0x36caa0 instanceof Error?_0x36caa0['message']:_0x27bef3(0x121,0x18f),0x0,_0x36caa0)};}}async[_0x33e61d(-0x79,-0xda)](_0xaeb1ea,_0x36d63e){function _0x3aa1c5(_0x24a57e,_0x311335){return _0x4d5f(_0x24a57e- -0xbf,_0x311335);}try{const response=await this['httpClient'][_0x3aa1c5(0x1,0x29)](_0x3aa1c5(0x8,-0x1b)+_0xaeb1ea,_0x36d63e);return{'data':response['data'],'error':null};}catch(_0x10a8d4){return{'data':null,'error':_0x10a8d4 instanceof EBaaSError?_0x10a8d4:new EBaaSError(_0x10a8d4 instanceof Error?_0x10a8d4['message']:'Failed\x20to\x20update\x20bucket',0x0,_0x10a8d4)};}}async[_0x33e61d(-0x5d,-0xd1)](_0xe02352){function _0x2472ac(_0x382f23,_0x394342){return _0x4d5f(_0x382f23- -0x3ab,_0x394342);}try{const response=await this[_0x2472ac(-0x283,-0x2b3)]['delete'](_0x2472ac(-0x2e4,-0x2be)+_0xe02352);return{'data':response[_0x2472ac(-0x26d,-0x278)],'error':null};}catch(_0x53bdbe){return{'data':null,'error':_0x53bdbe instanceof EBaaSError?_0x53bdbe:new EBaaSError(_0x53bdbe instanceof Error?_0x53bdbe[_0x2472ac(-0x2e1,-0x318)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x53bdbe)};}}async[_0x33e61d(-0x11a,-0xf2)](){function _0x336626(_0x5505f1,_0x9f6e5b){return _0x4d5f(_0x5505f1- -0x18e,_0x9f6e5b);}try{const response=await this[_0x336626(-0x66,-0xa9)]['get'](_0x336626(-0x91,-0x18));return{'data':response[_0x336626(-0x50,-0xaa)],'error':null};}catch(_0x1a4563){return{'data':null,'error':_0x1a4563 instanceof EBaaSError?_0x1a4563:new EBaaSError(_0x1a4563 instanceof Error?_0x1a4563[_0x336626(-0xc4,-0x119)]:'Failed\x20to\x20get\x20storage\x20usage',0x0,_0x1a4563)};}}}class RealtimeChannel extends _0x37dada{constructor(_0x5b35bb,_0x35af49){super();function _0x5b36c8(_0x2c716d,_0x3f616a){return _0x4d5f(_0x2c716d-0x2fd,_0x3f616a);}this[_0x5b36c8(0x43c,0x3d7)]=![],this['state']=_0x5b36c8(0x46c,0x473),this['subscriptions']=new Map(),this['topic']=_0x5b35bb,this['socket']=_0x35af49;}['subscribe'](_0x1ee481){!this[_0x25939d(0x1fe,0x1d1)]&&(this['joinedOnce']=!![],this[_0x25939d(0x219,0x205)]());_0x1ee481&&this['on'](_0x25939d(0x228,0x255),_0x1ee481);function _0x25939d(_0x4e76d7,_0x26cf97){return _0x4d5f(_0x4e76d7-0xbf,_0x26cf97);}return this;}[_0x33e61d(-0x196,-0x15a)](filter,_0x38d75e){const _0x21ceec=_0x934eb0(0x4fe,0x4d6)+JSON['stringify'](filter);function _0x934eb0(_0xe93e87,_0x4408c8){return _0x4d5f(_0x4408c8-0x383,_0xe93e87);}super['on'](_0x21ceec,_0x38d75e);const _0x4d86c5={'unsubscribe':()=>{super[_0x10f379(-0x1ad,-0x227)](_0x21ceec,_0x38d75e);function _0x10f379(_0x15c858,_0xda9065){return _0x4d5f(_0x15c858- -0x2c6,_0xda9065);}this['subscriptions']['delete'](_0x21ceec);}};return this['subscriptions'][_0x934eb0(0x434,0x47b)](_0x21ceec,_0x4d86c5),this['socket']?.[_0x934eb0(0x513,0x4ed)]&&this['state']==='joined'&&this[_0x934eb0(0x46a,0x469)][_0x934eb0(0x4ce,0x48f)]('subscribe_postgres_changes',{'topic':this[_0x934eb0(0x4d6,0x461)],'filter':filter,'ref':this[_0x934eb0(0x49c,0x49b)]()}),_0x4d86c5;}['onBroadcast'](filter,_0x4985cd){const _0x311fd7=_0x3e1766(0x22e,0x201)+JSON[_0x3e1766(0x196,0x13d)](filter);super['on'](_0x311fd7,_0x4985cd);const _0x58256e={'unsubscribe':()=>{function _0x1224ef(_0x5cc8af,_0x2e2e41){return _0x4d5f(_0x5cc8af- -0x8f,_0x2e2e41);}super['off'](_0x311fd7,_0x4985cd),this['subscriptions'][_0x1224ef(0xc3,0x8c)](_0x311fd7);}};this[_0x3e1766(0x1d4,0x1d7)]['set'](_0x311fd7,_0x58256e);function _0x3e1766(_0x52e65d,_0x10bc97){return _0x4d5f(_0x52e65d-0xa4,_0x10bc97);}return _0x58256e;}['onPresence'](filter,_0x45f4da){const _0x1c0969='presence:'+JSON['stringify'](filter);super['on'](_0x1c0969,_0x45f4da);function _0x5d2513(_0x67bfdf,_0x4fb9d5){return _0x4d5f(_0x4fb9d5- -0xb7,_0x67bfdf);}const _0x5b7da4={'unsubscribe':()=>{function _0x3e2c5d(_0x3b57c3,_0x205f9){return _0x4d5f(_0x205f9- -0x38d,_0x3b57c3);}super[_0x3e2c5d(-0x23d,-0x274)](_0x1c0969,_0x45f4da),this['subscriptions'][_0x3e2c5d(-0x1f8,-0x23b)](_0x1c0969);}};return this[_0x5d2513(0x1b,0x79)]['set'](_0x1c0969,_0x5b7da4),_0x5b7da4;}['send'](_0x2daa9d){return new Promise(_0x5bafab=>{function _0x29792a(_0x29152f,_0x3997fd){return _0x4d5f(_0x29152f-0x35d,_0x3997fd);}this[_0x29792a(0x443,0x478)]?.[_0x29792a(0x4c7,0x4b0)]&&this[_0x29792a(0x4ce,0x4de)]===_0x29792a(0x41f,0x3d0)?(this['socket']['emit'](_0x29792a(0x4ae,0x503),{'topic':this['topic'],'event':_0x2daa9d[_0x29792a(0x458,0x424)],'payload':_0x2daa9d,'ref':this[_0x29792a(0x475,0x479)]()}),_0x5bafab('ok')):_0x5bafab(_0x29792a(0x481,0x4a4));});}['track'](_0x164376){return new Promise(_0x500921=>{function _0x1d0f87(_0x28e40d,_0xe5df7e){return _0x4d5f(_0x28e40d-0x32,_0xe5df7e);}this[_0x1d0f87(0x118,0xea)]?.[_0x1d0f87(0x19c,0x1b0)]&&this[_0x1d0f87(0x1a3,0x214)]==='joined'?(this['socket']['emit']('presence',{'topic':this[_0x1d0f87(0x110,0x151)],'event':_0x1d0f87(0x114,0x157),'payload':_0x164376,'ref':this['makeRef']()}),_0x500921('ok')):_0x500921('error');});}[_0x33e61d(-0xfe,-0xd9)](){return new Promise(_0x1b6b13=>{function _0x2e29e8(_0x12f367,_0x21158b){return _0x4d5f(_0x21158b- -0x1f,_0x12f367);}this[_0x2e29e8(0xc8,0xc7)]?.[_0x2e29e8(0xdb,0x14b)]&&this['state']===_0x2e29e8(0x88,0xa3)?(this[_0x2e29e8(0x84,0xc7)]['emit'](_0x2e29e8(0x106,0x16c),{'topic':this['topic'],'event':_0x2e29e8(0x142,0x116),'ref':this[_0x2e29e8(0xf9,0xf9)]()}),_0x1b6b13('ok')):_0x1b6b13('error');});}['unsubscribe'](){return new Promise(_0x22b59b=>{this[_0x8e0620(0x155,0x147)]='leaving';function _0x8e0620(_0x19ce9d,_0x5d26f6){return _0x4d5f(_0x5d26f6- -0x2a,_0x19ce9d);}this[_0x8e0620(0x102,0x106)]['forEach'](_0x4205e2=>{_0x4205e2['unsubscribe']();}),this['subscriptions'][_0x8e0620(0xb6,0x74)](),this['socket']?.['connected']&&this['socket']['emit']('leave',{'topic':this['topic'],'ref':this[_0x8e0620(0x119,0xee)]()}),this['state']=_0x8e0620(0xdc,0x145),this['removeAllListeners'](),_0x22b59b('ok');});}[_0x33e61d(-0x58,-0xb4)](){if(this['state']==='leaving')return;this['state']='joining';function _0x3d3314(_0x29f6eb,_0x19e468){return _0x4d5f(_0x29f6eb-0x286,_0x19e468);}this[_0x3d3314(0x36c,0x393)]?.['connected']&&(this[_0x3d3314(0x36c,0x3bc)]['emit'](_0x3d3314(0x38f,0x3d2),{'topic':this['topic'],'ref':this[_0x3d3314(0x39e,0x3e6)]()}),setTimeout(()=>{function _0x2d8569(_0x2d7604,_0x1bb6c5){return _0x4d5f(_0x2d7604-0x294,_0x1bb6c5);}this[_0x2d8569(0x405,0x452)]==='joining'&&(this[_0x2d8569(0x405,0x416)]='joined',this[_0x2d8569(0x3a0,0x3d4)](_0x2d8569(0x3fd,0x3d6),'SUBSCRIBED'));},0x64));}[_0x33e61d(-0xdf,-0x11b)](){function _0x3ed85d(_0x4ba353,_0x5caa29){return _0x4d5f(_0x5caa29-0x3e,_0x4ba353);}this['joinedOnce']&&(this['_join'](),this[_0x3ed85d(0x1d5,0x16e)]['forEach']((_0x1383ee,_0x582ad8)=>{function _0xc605d6(_0x8c0b7f,_0x40e95c){return _0x4d5f(_0x8c0b7f- -0x36b,_0x40e95c);}if(_0x582ad8[_0xc605d6(-0x222,-0x1f1)](_0xc605d6(-0x218,-0x1f9))){const filter=JSON[_0xc605d6(-0x281,-0x2d6)](_0x582ad8['replace'](_0xc605d6(-0x218,-0x1d5),''));this[_0xc605d6(-0x285,-0x287)]?.[_0xc605d6(-0x25f,-0x244)](_0xc605d6(-0x1f2,-0x20a),{'topic':this[_0xc605d6(-0x28d,-0x27e)],'filter':filter,'ref':this[_0xc605d6(-0x253,-0x253)]()});}}));}[_0x33e61d(-0x172,-0x158)](_0x3ac984,_0x109c50){function _0x2dca4e(_0x291f9d,_0x53d20d){return _0x4d5f(_0x291f9d- -0x68,_0x53d20d);}if(_0x3ac984===_0x2dca4e(0x3e,-0x29)){const _0x2f4917=_0x2dca4e(0xeb,0x97)+JSON['stringify'](_0x109c50[_0x2dca4e(0xb6,0x9d)]||{});this[_0x2dca4e(0xa4,0x5e)](_0x2f4917,_0x109c50);}else{if(_0x3ac984===_0x2dca4e(0xe9,0xb7)){const _0x1c2d56=_0x2dca4e(0x122,0xf9)+JSON['stringify']({'event':_0x109c50['event']});this['emit'](_0x1c2d56,_0x109c50);}else{if(_0x3ac984==='presence'){const _0xcbc7ee=_0x2dca4e(0xa3,0xe8)+JSON[_0x2dca4e(0x8a,0x5f)]({'event':_0x109c50['event']});this['emit'](_0xcbc7ee,_0x109c50);}}}this[_0x2dca4e(0xa4,0x43)](_0x3ac984,_0x109c50);}['_setState'](_0x1dea4){this[_0x193cc6(0x4cc,0x4da)]=_0x1dea4;function _0x193cc6(_0x1aa243,_0x11c063){return _0x4d5f(_0x1aa243-0x35b,_0x11c063);}let status;switch(_0x1dea4){case _0x193cc6(0x41d,0x445):status='SUBSCRIBED';break;case'errored':status='CHANNEL_ERROR';break;case _0x193cc6(0x4ca,0x4db):status=_0x193cc6(0x4e8,0x4b4);break;default:return;}this['emit']('status',status);}[_0x33e61d(-0x119,-0xf6)](){function _0x2cf69d(_0x168ec0,_0x4d40fa){return _0x4d5f(_0x4d40fa-0x199,_0x168ec0);}return Math[_0x2cf69d(0x26f,0x257)]()['toString'](0x24)[_0x2cf69d(0x34a,0x2fc)](0x2,0xf);}[_0x33e61d(-0x1dc,-0x165)](){function _0x10fdf6(_0x5d63d5,_0x308c22){return _0x4d5f(_0x5d63d5-0x23a,_0x308c22);}return this[_0x10fdf6(0x3ab,0x351)];}}class RealtimeClient{constructor(_0x37e39f,_0x712226,_0x4285ca={}){this[_0x48b781(0x329,0x2c4)]=null,this['channels']=new Map(),this['connectionState']='disconnected',this[_0x48b781(0x360,0x32d)]=0x0,this['maxReconnectAttempts']=0x5;function _0x48b781(_0x4cb121,_0xe3e360){return _0x4d5f(_0x4cb121-0x243,_0xe3e360);}this[_0x48b781(0x30f,0x314)]=_0x37e39f,this['apiKey']=_0x712226,this[_0x48b781(0x3b5,0x350)]={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x4285ca};}[_0x33e61d(-0x1aa,-0x145)](){return new Promise((_0x154e7b,_0x501877)=>{if(this['socket']?.['connected']){_0x154e7b();return;}this[_0x559299(0x2bc,0x2d2)]='connecting',this[_0x559299(0x33b,0x2c4)]=io(this[_0x559299(0x269,0x2aa)],{'auth':{'apikey':this['apiKey']},'transports':['websocket'],'reconnection':!![],'reconnectionDelay':this['options']['reconnectInterval'],'reconnectionAttempts':this['options']['maxReconnectAttempts'],...this[_0x559299(0x3ae,0x350)]['socketOptions']}),this['socket']['on'](_0x559299(0x2ed,0x2a7),()=>{this['connectionState']=_0xf976d3(0xcb,0x115);function _0xf976d3(_0x54255c,_0x2031f9){return _0x4d5f(_0x54255c- -0x9f,_0x2031f9);}this['reconnectAttempts']=0x0,this[_0xf976d3(0xdc,0x81)](),_0x154e7b();}),this[_0x559299(0x27c,0x2c4)]['on'](_0x559299(0x2da,0x298),_0x52a170=>{this['connectionState']=_0x4fb39f(-0xc4,-0xa5);function _0x4fb39f(_0x4aec8d,_0xc6ad17){return _0x4d5f(_0x4aec8d- -0x18f,_0xc6ad17);}this['channels']['forEach'](channel=>{function _0x4b6636(_0x355ea1,_0x1796aa){return _0x4d5f(_0x355ea1- -0x47,_0x1796aa);}channel['_setState'](_0x4b6636(0x128,0xbf));});});function _0x559299(_0x1b3b09,_0x4e477b){return _0x4d5f(_0x4e477b-0x1de,_0x1b3b09);}this['socket']['on'](_0x559299(0x252,0x2b7),_0x17d1ea=>{function _0x5dea4d(_0x12721f,_0x12c03d){return _0x4d5f(_0x12721f- -0x3ae,_0x12c03d);}this[_0x5dea4d(-0x2ba,-0x242)]=_0x5dea4d(-0x28a,-0x27b),this['reconnectAttempts']++,this[_0x5dea4d(-0x291,-0x272)]>=this[_0x5dea4d(-0x247,-0x224)]&&_0x501877(new Error('Failed\x20to\x20connect\x20after\x20'+this['maxReconnectAttempts']+_0x5dea4d(-0x26b,-0x2a7)+_0x17d1ea['message']));}),this['socket']['on'](_0x559299(0x2c3,0x305),()=>{this[_0x535672(0x3e2,0x3d6)]='connected';function _0x535672(_0x25310d,_0x5036dc){return _0x4d5f(_0x25310d-0x2ee,_0x5036dc);}this[_0x535672(0x40b,0x3e1)]=0x0,this['channels'][_0x535672(0x462,0x4db)](channel=>{function _0xa48489(_0x2bb3be,_0x5d1bab){return _0x4d5f(_0x2bb3be- -0x2c3,_0x5d1bab);}channel[_0xa48489(-0x1d0,-0x165)]();});}),this[_0x559299(0x30e,0x2c4)]['on']('postgres_changes',_0x23d88d=>{function _0xd9b4a3(_0x2d08d3,_0x19189f){return _0x4d5f(_0x2d08d3-0x2f5,_0x19189f);}const channel=this[_0xd9b4a3(0x3b4,0x357)][_0xd9b4a3(0x3e6,0x3fc)](_0x23d88d['topic']);channel&&channel['_trigger'](_0xd9b4a3(0x39b,0x3c5),_0x23d88d);}),this[_0x559299(0x279,0x2c4)]['on']('broadcast',_0x5197f9=>{const channel=this[_0x527f44(0x425,0x449)]['get'](_0x5197f9['topic']);function _0x527f44(_0x2f3b81,_0x4ec529){return _0x4d5f(_0x4ec529-0x38a,_0x2f3b81);}channel&&channel['_trigger']('broadcast',_0x5197f9);}),this['socket']['on']('presence',_0x2f1929=>{const channel=this['channels']['get'](_0x2f1929['topic']);channel&&channel['_trigger']('presence',_0x2f1929);});});}['disconnect'](){function _0x28e210(_0x57d50b,_0x558c33){return _0x4d5f(_0x558c33-0x325,_0x57d50b);}this['socket']&&(this[_0x28e210(0x3bd,0x40b)]['disconnect'](),this['socket']=null),this['connectionState']=_0x28e210(0x377,0x3f0),this['channels'][_0x28e210(0x398,0x3c3)]();}[_0x33e61d(-0x154,-0x149)](_0x45283c){if(this[_0x422a9a(-0xac,-0x88)]['has'](_0x45283c))return this[_0x422a9a(-0xff,-0x88)][_0x422a9a(-0x5a,-0x56)](_0x45283c);function _0x422a9a(_0x36f83a,_0x3dd564){return _0x4d5f(_0x3dd564- -0x147,_0x36f83a);}const channel=new RealtimeChannel(_0x45283c,this[_0x422a9a(-0xdc,-0x61)]);return this['channels']['set'](_0x45283c,channel),this['connectionState']==='connected'&&channel[_0x422a9a(0x4f,0x13)](),channel;}[_0x33e61d(-0x8a,-0xa1)](channel){const _0x357f5e=channel['topic'];function _0x551206(_0x488574,_0x469ead){return _0x4d5f(_0x469ead-0x339,_0x488574);}this['channels']['has'](_0x357f5e)&&(this[_0x551206(0x46a,0x3f8)][_0x551206(0x460,0x48b)](_0x357f5e),channel[_0x551206(0x35a,0x3d5)]());}['removeAllChannels'](){this['channels']['forEach'](channel=>{channel['unsubscribe']();});function _0x1c6c7c(_0x370c6f,_0x24c4e5){return _0x4d5f(_0x370c6f- -0x1b7,_0x24c4e5);}this[_0x1c6c7c(-0xf8,-0x120)][_0x1c6c7c(-0x119,-0xe2)]();}[_0x33e61d(-0xad,-0xa2)](){function _0x2147cf(_0x1418bb,_0x172730){return _0x4d5f(_0x1418bb- -0x2e6,_0x172730);}return Array[_0x2147cf(-0x210,-0x1a0)](this['channels']['values']());}['isConnected'](){function _0x53e432(_0x42737e,_0x396d43){return _0x4d5f(_0x42737e-0x3b,_0x396d43);}return this[_0x53e432(0x12f,0x11e)]==='connected'&&!!this['socket']?.['connected'];}['getConnectionState'](){return this['connectionState'];}['onConnectionStateChange'](_0x26ab83){const _0x41bcb6=()=>_0x26ab83(this['connectionState']);this['socket']&&(this['socket']['on']('connect',()=>{this['connectionState']='connected',_0x41bcb6();}),this[_0x40064b(0x49a,0x443)]['on']('disconnect',()=>{this['connectionState']=_0x5b9eee(-0xec,-0x87);function _0x5b9eee(_0x1cb644,_0x23739e){return _0x4d5f(_0x23739e- -0x152,_0x1cb644);}_0x41bcb6();}),this['socket']['on'](_0x40064b(0x46b,0x436),()=>{function _0x3f33cb(_0x5966ca,_0x238331){return _0x4d5f(_0x5966ca- -0x35d,_0x238331);}this[_0x3f33cb(-0x269,-0x284)]=_0x3f33cb(-0x239,-0x290),_0x41bcb6();}));function _0x40064b(_0x16d784,_0x55430a){return _0x4d5f(_0x55430a-0x35d,_0x16d784);}return()=>{function _0x5e9212(_0x386a91,_0x49107b){return _0x4d5f(_0x49107b-0x13c,_0x386a91);}this['socket']&&(this['socket']['off'](_0x5e9212(0x22c,0x205),_0x41bcb6),this['socket']['off']('disconnect',_0x41bcb6),this[_0x5e9212(0x290,0x222)]['off']('connect_error',_0x41bcb6));};}['setupHeartbeat'](){function _0x7be2a5(_0x2ccfe3,_0x30764a){return _0x4d5f(_0x30764a- -0x149,_0x2ccfe3);}if(!this['options'][_0x7be2a5(0x44,0x1d)]||!this['socket'])return;const interval=setInterval(()=>{function _0x197c7b(_0x39affe,_0x59c03d){return _0x4d5f(_0x39affe- -0x1a1,_0x59c03d);}this[_0x197c7b(-0xbb,-0x93)]?.['connected']?this[_0x197c7b(-0xbb,-0x82)]['emit'](_0x197c7b(-0xc6,-0x9e),{'timestamp':Date[_0x197c7b(-0xf7,-0xdb)]()}):clearInterval(interval);},this[_0x7be2a5(0x2e,0x29)]['heartbeatInterval']);}['_getSocket'](){function _0x1ac4fc(_0x3eadcf,_0x2db392){return _0x4d5f(_0x2db392- -0x28b,_0x3eadcf);}return this[_0x1ac4fc(-0x159,-0x1a5)];}}class FunctionsClient{constructor(_0x2ea593){this['httpClient']=_0x2ea593;}async['invoke'](_0x4ef68f,_0x257c02){function _0x391252(_0xd2eb17,_0x4fbe8d){return _0x4d5f(_0xd2eb17-0xd2,_0x4fbe8d);}try{const _0x5d06fe=_0x257c02?.['method']||'POST',headers={'Content-Type':'application/json',..._0x257c02?.[_0x391252(0x1bb,0x1cb)]};let response;const _0x89a5c5=_0x391252(0x1f7,0x1a5)+_0x4ef68f;switch(_0x5d06fe['toUpperCase']()){case'GET':response=await this[_0x391252(0x1fa,0x1d3)][_0x391252(0x1c3,0x1f5)](_0x89a5c5,{'headers':headers,'params':_0x257c02?.['body']});break;case'POST':response=await this[_0x391252(0x1fa,0x188)]['post'](_0x89a5c5,_0x257c02?.[_0x391252(0x248,0x271)],{'headers':headers});break;case'PUT':response=await this[_0x391252(0x1fa,0x22c)]['put'](_0x89a5c5,_0x257c02?.['body'],{'headers':headers});break;case'PATCH':response=await this[_0x391252(0x1fa,0x1b7)][_0x391252(0x242,0x22b)](_0x89a5c5,_0x257c02?.['body'],{'headers':headers});break;case'DELETE':response=await this['httpClient']['delete'](_0x89a5c5,{'headers':headers,'data':_0x257c02?.[_0x391252(0x248,0x22d)]});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x5d06fe,0x190);}return{'data':response['data'],'error':null};}catch(_0x45153d){return{'data':null,'error':_0x45153d instanceof EBaaSError?_0x45153d:new EBaaSError(_0x45153d instanceof Error?_0x45153d['message']:'Function\x20invocation\x20failed',0x0,_0x45153d)};}}async['list'](){function _0x4f9dfb(_0x49c745,_0x42f085){return _0x4d5f(_0x42f085-0x300,_0x49c745);}try{const response=await this[_0x4f9dfb(0x43c,0x428)][_0x4f9dfb(0x424,0x3f1)]('/functions/v1');return{'data':response['data'],'error':null};}catch(_0x764ac){return{'data':null,'error':_0x764ac instanceof EBaaSError?_0x764ac:new EBaaSError(_0x764ac instanceof Error?_0x764ac['message']:'Failed\x20to\x20list\x20functions',0x0,_0x764ac)};}}async[_0x33e61d(-0x13a,-0x11d)](_0x1bea79){function _0xabbaca(_0x159de5,_0x5373bd){return _0x4d5f(_0x159de5- -0x196,_0x5373bd);}try{const response=await this['httpClient'][_0xabbaca(-0xa5,-0x5a)](_0xabbaca(-0x71,-0x2f)+_0x1bea79+_0xabbaca(-0xdb,-0x136));return{'data':response[_0xabbaca(-0x58,-0x5e)],'error':null};}catch(_0x3bc8ef){return{'data':null,'error':_0x3bc8ef instanceof EBaaSError?_0x3bc8ef:new EBaaSError(_0x3bc8ef instanceof Error?_0x3bc8ef[_0xabbaca(-0xcc,-0x12a)]:'Failed\x20to\x20get\x20function',0x0,_0x3bc8ef)};}}async['deploy'](_0x18f12e,_0x282eef){function _0x12f125(_0x37d343,_0x4927dc){return _0x4d5f(_0x4927dc-0x303,_0x37d343);}try{const _0x10bbd2=new FormData();if(_0x282eef[_0x12f125(0x3d4,0x3d0)]instanceof File)_0x10bbd2[_0x12f125(0x449,0x3fc)](_0x12f125(0x391,0x3d0),_0x282eef[_0x12f125(0x3e5,0x3d0)]);else typeof _0x282eef['code']===_0x12f125(0x486,0x432)&&_0x10bbd2['append'](_0x12f125(0x422,0x3d0),new Blob([_0x282eef[_0x12f125(0x42e,0x3d0)]],{'type':_0x12f125(0x455,0x449)}),_0x12f125(0x46c,0x3f2));_0x282eef['entrypoint']&&_0x10bbd2[_0x12f125(0x3bb,0x3fc)]('entrypoint',_0x282eef[_0x12f125(0x3c1,0x3eb)]);_0x282eef[_0x12f125(0x35e,0x3a0)]&&_0x10bbd2[_0x12f125(0x39b,0x3fc)]('env',JSON[_0x12f125(0x404,0x3f5)](_0x282eef[_0x12f125(0x418,0x3a0)]));_0x282eef['importMap']&&_0x10bbd2['append']('importMap',JSON[_0x12f125(0x3fd,0x3f5)](_0x282eef[_0x12f125(0x4b7,0x43d)]));_0x282eef[_0x12f125(0x4bd,0x468)]!==undefined&&_0x10bbd2[_0x12f125(0x433,0x3fc)]('verify',String(_0x282eef[_0x12f125(0x3f3,0x468)]));const response=await this['httpClient'][_0x12f125(0x439,0x452)]('/functions/v1/'+_0x18f12e+'/deploy',_0x10bbd2,{'headers':{'Content-Type':_0x12f125(0x37e,0x3b6)}});return{'data':response['data'],'error':null};}catch(_0x2d326d){return{'data':null,'error':_0x2d326d instanceof EBaaSError?_0x2d326d:new EBaaSError(_0x2d326d instanceof Error?_0x2d326d['message']:'Failed\x20to\x20deploy\x20function',0x0,_0x2d326d)};}}async[_0x33e61d(-0x9c,-0xbc)](_0x314d74){function _0x5cfb03(_0x4dac7a,_0x35a319){return _0x4d5f(_0x4dac7a-0x168,_0x35a319);}try{const response=await this[_0x5cfb03(0x290,0x279)]['delete'](_0x5cfb03(0x28d,0x2b9)+_0x314d74);return{'data':response[_0x5cfb03(0x2a6,0x300)],'error':null};}catch(_0x3b7d8f){return{'data':null,'error':_0x3b7d8f instanceof EBaaSError?_0x3b7d8f:new EBaaSError(_0x3b7d8f instanceof Error?_0x3b7d8f['message']:'Failed\x20to\x20delete\x20function',0x0,_0x3b7d8f)};}}async['updateEnv'](_0x516fe9,_0x1c70c3){function _0x46513f(_0x2f1807,_0xf4aa06){return _0x4d5f(_0xf4aa06-0xc7,_0x2f1807);}try{const response=await this[_0x46513f(0x23f,0x1ef)][_0x46513f(0x122,0x187)]('/functions/v1/'+_0x516fe9+'/env',{'env':_0x1c70c3});return{'data':response['data'],'error':null};}catch(_0x563d5f){return{'data':null,'error':_0x563d5f instanceof EBaaSError?_0x563d5f:new EBaaSError(_0x563d5f instanceof Error?_0x563d5f[_0x46513f(0x156,0x191)]:_0x46513f(0x132,0x17f),0x0,_0x563d5f)};}}async[_0x33e61d(-0x133,-0x15e)](_0x5d0f83,_0x5705f6){function _0x3e7436(_0x58fbcf,_0xda4c5){return _0x4d5f(_0xda4c5-0x75,_0x58fbcf);}try{const _0x434af8=new URLSearchParams();_0x5705f6?.['limit']&&_0x434af8['append']('limit',String(_0x5705f6['limit']));_0x5705f6?.['offset']&&_0x434af8[_0x3e7436(0x1e8,0x16e)](_0x3e7436(0x186,0x13b),String(_0x5705f6[_0x3e7436(0x19b,0x13b)]));_0x5705f6?.[_0x3e7436(0x19d,0x173)]&&_0x434af8['append']('level',_0x5705f6['level']);const _0x41a07e='/functions/v1/'+_0x5d0f83+'/logs'+(_0x434af8['toString']()?'?'+_0x434af8['toString']():''),response=await this[_0x3e7436(0x1ba,0x19d)]['get'](_0x41a07e);return{'data':response['data'],'error':null};}catch(_0x18a56a){return{'data':null,'error':_0x18a56a instanceof EBaaSError?_0x18a56a:new EBaaSError(_0x18a56a instanceof Error?_0x18a56a[_0x3e7436(0x178,0x13f)]:'Failed\x20to\x20get\x20function\x20logs',0x0,_0x18a56a)};}}async[_0x33e61d(-0x49,-0x99)](_0x37d079,_0x32262d){function _0x12877a(_0x54f59a,_0x5ee199){return _0x4d5f(_0x54f59a- -0x3e0,_0x5ee199);}try{const _0x34fd30=new URLSearchParams();_0x32262d?.[_0x12877a(-0x311,-0x2af)]&&_0x34fd30['append'](_0x12877a(-0x311,-0x2e4),_0x32262d['period']);const _0x3ddc22='/functions/v1/'+_0x37d079+'/metrics'+(_0x34fd30['toString']()?'?'+_0x34fd30[_0x12877a(-0x27c,-0x2d2)]():''),response=await this['httpClient'][_0x12877a(-0x2ef,-0x333)](_0x3ddc22);return{'data':response[_0x12877a(-0x2a2,-0x26f)],'error':null};}catch(_0x3cc8a4){return{'data':null,'error':_0x3cc8a4 instanceof EBaaSError?_0x3cc8a4:new EBaaSError(_0x3cc8a4 instanceof Error?_0x3cc8a4['message']:'Failed\x20to\x20get\x20function\x20metrics',0x0,_0x3cc8a4)};}}}class EBaaSClient{constructor(_0x1eb47d,_0x14af17,_0x4e8616){this['options']=_0x4e8616,this[_0x5743a0(-0x68,-0x2b)]=new HttpClient({'url':_0x1eb47d,'apiKey':_0x14af17,'timeout':0x7530,'headers':_0x4e8616?.['global']?.[_0x5743a0(-0xdb,-0x6a)]}),this[_0x5743a0(0x11,-0x31)]=new AuthClient(this[_0x5743a0(0x5,-0x2b)]),this[_0x5743a0(-0x8a,-0x17)]=new DatabaseClient(this[_0x5743a0(-0x75,-0x2b)],_0x4e8616?.['database']?.['workspaceId']),this['storage']=new StorageClient(this[_0x5743a0(-0x24,-0x2b)]),this[_0x5743a0(0x33,0x30)]=new RealtimeClient(_0x1eb47d,_0x14af17,_0x4e8616?.[_0x5743a0(0x9b,0x30)]);function _0x5743a0(_0x36a8fa,_0x25050f){return _0x4d5f(_0x25050f- -0x153,_0x36a8fa);}this['functions']=new FunctionsClient(this['httpClient']),this['initializeCustomDatabase']();}['from'](_0x99acd4){function _0xe640b7(_0xe87703,_0x33302e){return _0x4d5f(_0x33302e- -0x4a,_0xe87703);}return this[_0xe640b7(0x10e,0xf2)]['from'](_0x99acd4);}[_0x33e61d(-0x14e,-0x160)](_0x1e415e,_0x155e0f){return this['database']['rpc'](_0x1e415e,_0x155e0f);}[_0x33e61d(-0x119,-0xd5)](_0x625b3c){function _0x1ca1f5(_0x176bae,_0x4f67a7){return _0x4d5f(_0x176bae-0x185,_0x4f67a7);}return this[_0x1ca1f5(0x2b0,0x328)]['from'](_0x625b3c);}['channel'](_0x30a96a){function _0x2a8dc9(_0x2cf07e,_0x98d942){return _0x4d5f(_0x2cf07e- -0x1d3,_0x98d942);}return this[_0x2a8dc9(-0x50,-0xaf)][_0x2a8dc9(-0x10e,-0x111)](_0x30a96a);}[_0x33e61d(-0x9a,-0xee)](_0x5414b3,_0x9a16f2){function _0x2c4727(_0x2bb682,_0x445692){return _0x4d5f(_0x445692-0x159,_0x2bb682);}return this[_0x2c4727(0x264,0x2ad)][_0x2c4727(0x22c,0x279)](_0x5414b3,_0x9a16f2);}async['initializeCustomDatabase'](){function _0x51fc3d(_0x21df57,_0x57f437){return _0x4d5f(_0x57f437- -0xaf,_0x21df57);}if(this['options']?.[_0x51fc3d(0x74,0x8d)]?.['autoDetectCustomDatabase'])try{await this[_0x51fc3d(0x85,0x8d)][_0x51fc3d(-0x58,-0xe)]();}catch(_0x4dfa5b){console['warn']('Failed to initialize custom database detection:',_0x4dfa5b);}}async['setWorkspaceId'](_0x4f4a73){function _0x3dfb28(_0x463482,_0x47a966){return _0x4d5f(_0x463482-0x349,_0x47a966);}this[_0x3dfb28(0x485,0x410)][_0x3dfb28(0x496,0x49d)](_0x4f4a73),this[_0x3dfb28(0x4bb,0x4b4)]?.['database']?.[_0x3dfb28(0x428,0x408)]&&await this['database']['initialize']();}async[_0x33e61d(-0x12a,-0x101)](_0x4a7338){await this['database']['configureCustomDatabase'](_0x4a7338);}[_0x33e61d(-0xd3,-0xf8)](){function _0x41712e(_0xe02a21,_0x55fe23){return _0x4d5f(_0xe02a21-0x220,_0x55fe23);}return this[_0x41712e(0x35c,0x306)]['getCustomDatabaseStatus']();}}function createClient(_0x1248c7,_0x3f83b4,_0x247705){return new EBaaSClient(_0x1248c7,_0x3f83b4,_0x247705);}const version=_0x33e61d(-0x91,-0xb8);export{AuthClient,CustomDatabaseManager,DatabaseClient,EBaaSClient,EBaaSError,FunctionsClient,HttpClient,QueryBuilder,RealtimeChannel,RealtimeClient,StorageBucket,StorageClient,createClient,version};
1
+ (function(stringArrayFunction,comparisonValue){function _0x132b9b(_0x15ea6d,_0xe6bf5){return _0x591a(_0x15ea6d-0x1e2,_0xe6bf5);}const stringArray=stringArrayFunction();while(!![]){try{const _0x1d4ffd=-parseInt(_0x132b9b(0x360,0x37d))/0x1*(-parseInt(_0x132b9b(0x431,0x453))/0x2)+-parseInt(_0x132b9b(0x397,0x345))/0x3*(parseInt(_0x132b9b(0x361,0x375))/0x4)+parseInt(_0x132b9b(0x3e7,0x3de))/0x5+-parseInt(_0x132b9b(0x349,0x362))/0x6*(parseInt(_0x132b9b(0x3d2,0x3ca))/0x7)+-parseInt(_0x132b9b(0x377,0x375))/0x8*(-parseInt(_0x132b9b(0x38d,0x36e))/0x9)+-parseInt(_0x132b9b(0x400,0x46a))/0xa*(-parseInt(_0x132b9b(0x3f8,0x3a1))/0xb)+-parseInt(_0x132b9b(0x3b7,0x3f0))/0xc*(parseInt(_0x132b9b(0x42c,0x44b))/0xd);if(_0x1d4ffd===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x3061d1){stringArray['push'](stringArray['shift']());}}}(_0x57ef,0x1bc02));import axios from'axios';import{io}from'socket.io-client';import _0x1d3f4d from'eventemitter3';function _0x57ef(){const _0xe47385=['CMvTB3zL','l2zPBgvZlW','zxzLBNq','Bg9HzfnLC3nPB24','DxnL','y29SDw1U','C2v0DxbjBNrLCMnLChrVCNm','zgvSzxrL','x3rYAwDNzxi','x3jLAM9PBG','zM9YrwfJAa','otq0mZi1vgLeD0Hv','C2v0u2vZC2LVBKLUDgvYBMfS','zw50CNLWB2LUDa','DgfIBgu','CMfUz2u','y2HHBM5LBhm','Dw5KzwzPBMvK','zgv0zwn0zwrdB25MAwC','AwXPA2u','zgLZy29UBMvJDa','C2nOzw1H','rMfPBgvKihrVihvWzgf0zsbIDwnRzxq','B3jKzxi','Aw50zxjJzxb0B3jZ','CMvTB3zLq3vZDg9Trgf0ywjHC2u','y2XPzw50','y2fWDhvYzvn0ywnRvhjHy2u','mtCXnJmXovPOzKfcBa','Cg9ZDgDYzxnvC2vYBMfTzq','BgLTAxq','y29UBMvJDf9LCNjVCG','CMvXDwvZDa','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','B25qB3n0z3jLC0nOyw5Nzxm','yxnJzw5KAw5N','mtb0uLLcDeG','z2v0tg9NCW','B25qCMvZzw5Jzq','AgfZq3vZDg9Trgf0ywjHC2u','Bwv0ywrHDge','zw52','x2PVAw4','C3rHDgu','AxndB25Uzwn0zwq','l21LDgfKyxrH','C3rYAw5N','z2v0q29UBMvJDgLVBLn0yxrL','zxHLy3v0zvf1zxj5','p29WzxjHDgLVBJ1PBNnLCNq','l2f1DgGVDJeVDxnLCG','Dgv4Dc9WBgfPBG','yNjVywrJyxn0','l3nKAY92ms8','y29UDgfPBNm','sfruucbYzxf1zxn0igzHAwXLza','CgfYC2u','qMvHCMvYia','rMfPBgvKihrVihvWzgf0zsbMDw5JDgLVBIbLBNzPCM9UBwvUDa','zxjYB3jLza','DMfSDwvZ','DMfSDwu','C3rYAw5NAwz5','AgvHCNrIzwf0','zMLSzq','CMvMCMvZAf90B2TLBG','q0HbtK5ftf9fuLjpuG','B3bLCMf0Aw9U','AM9PBMLUzW','C2vSzwn0','AgvHCNrIzwf0sw50zxj2ywW','Bg9N','zgLZy29UBMvJDgvK','C29JA2v0','CNbJ','yxbWzw5K','l2f1DgGVDJeVC2LNBNvW','ChjLC2vUy2u','C2v0u2vZC2LVBG','C3rHDhvZ','mZL3ALzyrMC','C3rHDhvZvgv4Da','Cg9ZDa','y2XLyxi','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','odjprujfB1C','lMrLC2m','rMfPBgvKihrVigXPC3qGzMLSzxm','BMvX','DMvYAwz5','Cg9ZDgDYzxnFy2HHBMDLCW','C3vIC2nYAxb0Aw9UCW','BgvHDMLUzW','zxHLy3v0zq','DxbZzxj0','yNvJA2v0','zMLSDgvYCW','C2v0qxv0AfrVA2vU','C2vHCMnO','l3n0B3jHz2uVyNvJA2v0CW','vw5RBM93BIbLCNjVCG','y3vYCMvUDfnLC3nPB24','mZGZmta2t0rzqMrW','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','Chv0','zw1PDa','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','y29UBMvJDgvK','icHtDgf0Dxm6ia','DgvZDen1C3rVBunVBM5Ly3rPB24','AM9PBMvK','x3nLDfn0yxrL','rMfPBgvKihrVihvWBg9HzcbMAwXL','Aw1WB3j0twfW','BgLZDej1y2TLDhm','DxbKyxrLrw52','DxbKyxrLqNvJA2v0','zgf0ywjHC2u','ChvIBgLJ','zgvSzxrLt3b0Aw9UCW','DxbKyxrLrMLSzu1LDgfKyxrH','C2v0v29YA3nWywnLswq','z2v0vxnHz2u','C2v0DxbizwfYDgjLyxq','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','mJe0mgzdDeztEa','mJbwEM5UrNG','C2v0','z2v0v29YA3nWywnLswq','BMfTzq','DhjHBNnMB3jT','C3rVCMfNzq','zwjHyxmUyxv0Ac5ZzxnZAw9U','CMvTB3zLqwXStgLZDgvUzxjZ','AM9PBMvKt25Jzq','p29WzxjHDgLVBJ1ZzwXLy3q','zw50CMLLCW','CMvQzwn0','Bgv2zwW','rMfPBgvKihrVigrVD25SB2fKigzPBgu','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','BwvZC2fNzq','zg93BMXVywq','D29YA3nWywnLswq','BgvHDMu','CMvTB3zLsxrLBq','p3vWC2vYDd10CNvL','y29UBMvJDa','mtm2nZjPwKPIy3i','y29Kzq','Dg9WAwm','z2v0twv0CMLJCW','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','y29TBw9U','y3jLzgvUDgLHBhm','y2XLyxjtzxnZAw9U','ywnJzxnZx3rVA2vU','l2XVz3m','yxbPs2v5','uhjLzMvY','y2HHBM5LBa','CMvZCg9UC2u','Dg9tDhjPBMC','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','Ec10B3rHBc1JB3vUDa','rMfPBgvKihrVigrLBgv0zsbIDwnRzxq','yNvJA2v0swq','CMvTB3zLqxv0AfrVA2vU','DxbSB2fK','C3vIC2nYAwjL','mtaXn3jID292Dq','C29JA2v0t3b0Aw9UCW','y29UDgvUDfr5Cgu','y2XVC2vK','Aw5Zzxj0','BgLZDa','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','Cgf0y2G','l2z1BMn0Aw9UCY92ms8','y29UBMvJDgLVBLn0yxrL','nZK0nJDuBvHLu2u','zgvWBg95','B3bLCMf0B3i','yMfZzvvsta','BxvSDgLWyxj0l2zVCM0Tzgf0yq','DxjS','zgf0yufYCMf5','CMfUzg9T','Ahr0CenSAwvUDa','AgfUzgXLrxjYB3i','B2zMC2v0','Cg9ZDgDYzxnFy2HHBMDLCZO','CMvJB25Uzwn0qxr0zw1WDhm','y2fJAgvdB250CM9S','l3n0B3jHz2uVyNvJA2v0CY8','CMvHBhrPBwu','qxv0AgvUDgLJyxrPB24GzMfPBgvK','C2vZC2LVBG','y3vYCMvUDfnJAgvTyq','BwfW','l2vUDG','l2zPBgvZl21VDMu','DxnLCG','z2v0','ChjLzMvY','rMfPBgvKihrVignVBM5Ly3qGywz0zxiG','BwfRzvjLzG','C2LNBKLU','rMfPBgvKihrVig1VDMuGzMLSzq','BgLRzq','yM9KEq','yxv0Aa','mti2mZe1nLfNqKL5yW','CMvTB3zLq2HHBM5LBa','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','zNjVBq','C2LNBK91Da','y3jLyxrLu2LNBMvKvxjS','p29WzxjHDgLVBJ1KzwXLDgu','zxjYB3i','ChvZAa','CgvYAw9K','l2zPBgvZ','rujHyvnfCNjVCG','C2LNBLvW','DxbKyxrLrgf0yq','DhjHy2S','CxvLCNK','zgv0zwn0q3vZDg9Trgf0ywjHC2u','z2v0u3rHDhvZ','AgvHzgvYCW','Aw5PDgLHBgL6zq','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','AgfUzgXLqxv0AevYCM9Y','AxnvC2LUz0n1C3rVBurHDgfIyxnL','l2LUzM8','B3b0Aw9UCW','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','l3n0B3jHz2uVDxnHz2u','n2DZsvftCa','zgvMyxvSDhm','DxbKyxrL','zgf0yq','C3nSrw5HyMXLza','B2zM','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbTzxrYAwnZ','rMfPBgvKihrVignYzwf0zsbZAwDUzwqGvvjm','C2v0sxrLBq','y29UzMLN'];_0x57ef=function(){return _0xe47385;};return _0x57ef();}class EBaaSError extends Error{constructor(_0x4c2995,status=0x0,_0x446776){function _0x3fd3b7(_0x3b2d3c,_0x8f6eda){return _0x591a(_0x3b2d3c- -0x197,_0x8f6eda);}super(_0x4c2995),this[_0x3fd3b7(-0x15,-0x5f)]=_0x3fd3b7(0x49,0x95),this['status']=status,this['details']=_0x446776,Error['captureStackTrace']&&Error[_0x3fd3b7(0x7e,0xc0)](this,EBaaSError);}['toJSON'](){function _0x5b9765(_0x2a2826,_0x56cf09){return _0x591a(_0x56cf09- -0x13c,_0x2a2826);}return{'name':this['name'],'message':this[_0x5b9765(0xb8,0x52)],'status':this[_0x5b9765(0x140,0x10d)],'details':this['details'],'stack':this['stack']};}[_0x4a3cb3(0x69,0x9)](){function _0x1fc1a3(_0xa93395,_0x2bbee3){return _0x591a(_0x2bbee3-0x157,_0xa93395);}return this[_0x1fc1a3(0x28b,0x2d9)]+':\x20'+this['message']+_0x1fc1a3(0x25d,0x2c4)+this[_0x1fc1a3(0x380,0x3a0)]+')';}}class HttpClient{constructor(config){function _0x367148(_0x2c74dd,_0x198a38){return _0x591a(_0x2c74dd- -0x181,_0x198a38);}this['baseURL']=config['url'],this['apiKey']=config[_0x367148(0x1e,0x12)],this['client']=axios['create']({'baseURL':this['baseURL'],'timeout':config['timeout']||0x2710,'headers':{'Content-Type':'application/json','apikey':this['apiKey'],...config['headers']}}),this[_0x367148(0x7f,0x20)]();}[_0x4a3cb3(0x11,0x66)](){function _0x219468(_0x37dfab,_0x3cc30f){return _0x591a(_0x37dfab- -0x31c,_0x3cc30f);}this['client'][_0x219468(-0x10a,-0x95)][_0x219468(-0x102,-0x12c)][_0x219468(-0x11e,-0x164)](config=>{return config;},_0x59cbe7=>{function _0x3201c6(_0x105644,_0x1193dc){return _0x591a(_0x1193dc- -0x18a,_0x105644);}return Promise[_0x3201c6(-0x9,0x0)](new EBaaSError('Request\x20failed',0x0,_0x59cbe7));}),this[_0x219468(-0x108,-0x155)][_0x219468(-0x10a,-0x12b)][_0x219468(-0x17a,-0x178)][_0x219468(-0x11e,-0xe0)](response=>{return response;},_0x1d4af5=>{const status=_0x1d4af5[_0x1fa569(0x183,0x121)]?.['status']||0x0,_0x18c4c2=_0x1d4af5[_0x1fa569(0x10e,0x121)]?.[_0x1fa569(0x115,0x172)]?.[_0x1fa569(0x143,0x10d)]||_0x1d4af5[_0x1fa569(0xb0,0x10d)]||_0x1fa569(0xde,0xe4),_0x30c475=_0x1d4af5['response']?.[_0x1fa569(0x106,0x172)]||_0x1d4af5;function _0x1fa569(_0x896165,_0x28b2f3){return _0x591a(_0x28b2f3- -0x81,_0x896165);}return Promise[_0x1fa569(0xf8,0x109)](new EBaaSError(_0x18c4c2,status,_0x30c475));});}async['get'](_0x69fd3,config){function _0x19ef0f(_0x7ecf8f,_0x36a8ec){return _0x591a(_0x7ecf8f- -0x398,_0x36a8ec);}try{const response=await this[_0x19ef0f(-0x184,-0x126)][_0x19ef0f(-0x1cc,-0x1be)](_0x69fd3,config);return{'data':response[_0x19ef0f(-0x1a5,-0x1c9)],'status':response[_0x19ef0f(-0x14f,-0x131)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x15c142){throw this[_0x19ef0f(-0x1da,-0x194)](_0x15c142);}}async['post'](_0x5c1715,data,config){function _0x305465(_0x52cc67,_0x3c7f9a){return _0x591a(_0x3c7f9a-0x26d,_0x52cc67);}try{const response=await this['client']['post'](_0x5c1715,data,config);return{'data':response[_0x305465(0x4b6,0x460)],'status':response[_0x305465(0x506,0x4b6)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x1d8924){throw this['handleError'](_0x1d8924);}}async[_0x4a3cb3(-0x95,-0x31)](_0x5bfead,data,config){function _0x31cb71(_0x1056e4,_0x13a794){return _0x591a(_0x13a794- -0x384,_0x1056e4);}try{const response=await this[_0x31cb71(-0x1c3,-0x170)][_0x31cb71(-0x1a1,-0x21b)](_0x5bfead,data,config);return{'data':response[_0x31cb71(-0x170,-0x191)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x186c71){throw this[_0x31cb71(-0x18b,-0x1c6)](_0x186c71);}}async['patch'](_0x272543,data,config){function _0x5c2288(_0x53b75e,_0x2356a3){return _0x591a(_0x2356a3- -0x33a,_0x53b75e);}try{const response=await this['client']['patch'](_0x272543,data,config);return{'data':response[_0x5c2288(-0xd0,-0x147)],'status':response[_0x5c2288(-0x106,-0xf1)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x3139f0){throw this['handleError'](_0x3139f0);}}async['delete'](_0x5217b9,config){function _0x59bb82(_0x59acd4,_0x340f95){return _0x591a(_0x340f95- -0x374,_0x59acd4);}try{const response=await this['client']['delete'](_0x5217b9,config);return{'data':response[_0x59bb82(-0x1ec,-0x181)],'status':response[_0x59bb82(-0x169,-0x12b)],'statusText':response[_0x59bb82(-0xe8,-0x129)],'headers':response[_0x59bb82(-0x1d9,-0x18d)]};}catch(_0x259300){throw this['handleError'](_0x259300);}}['setAuthToken'](_0x42f64c){function _0x5d7572(_0x3b04a7,_0x538040){return _0x591a(_0x538040- -0x1d5,_0x3b04a7);}this[_0x5d7572(0x2a,0x3f)][_0x5d7572(0x60,0x1c)][_0x5d7572(-0x41,0x12)]['common']['Authorization']='Bearer\x20'+_0x42f64c;}['removeAuthToken'](){function _0x36c8de(_0x59805e,_0x29844f){return _0x591a(_0x29844f-0x1a4,_0x59805e);}delete this[_0x36c8de(0x383,0x3b8)][_0x36c8de(0x325,0x395)]['headers'][_0x36c8de(0x308,0x33e)]['Authorization'],this['client'][_0x36c8de(0x3da,0x395)]['headers'][_0x36c8de(0x2c8,0x33e)]['Authorization']=_0x36c8de(0x402,0x3d7)+this['apiKey'];}['handleError'](_0x4aa3b9){function _0x57cb53(_0x3ff4e9,_0x4ac490){return _0x591a(_0x4ac490- -0x103,_0x3ff4e9);}if(_0x4aa3b9 instanceof EBaaSError)return _0x4aa3b9;return new EBaaSError(_0x4aa3b9['message']||_0x57cb53(0x19b,0x12e),_0x4aa3b9['status']||0x0,_0x4aa3b9);}}class AuthClient{constructor(_0x5533fb,_0x330a74){this['currentSession']=null;function _0x2dcab9(_0x3b6f13,_0x539747){return _0x591a(_0x3b6f13- -0x328,_0x539747);}this['httpClient']=_0x5533fb,this['workspaceId']=_0x330a74,this[_0x2dcab9(-0x12b,-0xee)]();}async[_0x4a3cb3(-0xb,0x47)](data){function _0x20d9a6(_0x117067,_0x294c80){return _0x591a(_0x294c80- -0x15,_0x117067);}try{const response=await this['httpClient'][_0x20d9a6(0x25e,0x237)](_0x20d9a6(0x255,0x231),data);return response[_0x20d9a6(0x1fd,0x1de)][_0x20d9a6(0x15b,0x1b1)]&&this[_0x20d9a6(0x1ef,0x1f1)](response['data'][_0x20d9a6(0x1aa,0x1b1)]),response[_0x20d9a6(0x223,0x1de)];}catch(_0x23911f){throw this['handleAuthError'](_0x23911f);}}async[_0x4a3cb3(0x64,0x36)](data){function _0x193581(_0x3c991b,_0x59f2d5){return _0x591a(_0x59f2d5-0x1e2,_0x3c991b);}try{const headers={};this[_0x193581(0x34b,0x372)]&&(headers['X-Workspace-ID']=this[_0x193581(0x34b,0x372)]);const response=await this['httpClient'][_0x193581(0x44e,0x42e)]('/auth/v1/sdk/signin',data,{'headers':headers});return response[_0x193581(0x43c,0x3d5)][_0x193581(0x36c,0x3a8)]&&this['setSessionInternal'](response[_0x193581(0x37c,0x3d5)][_0x193581(0x3bd,0x3a8)]),response['data'];}catch(_0x47cdc3){throw this['handleAuthError'](_0x47cdc3);}}async[_0x4a3cb3(0x13,0x3f)](){function _0x1464e6(_0x355c20,_0x3d0dd2){return _0x591a(_0x355c20-0x93,_0x3d0dd2);}try{await this['httpClient']['post']('/auth/v1/signout'),this[_0x1464e6(0x22f,0x1d1)]();}catch(_0x1e62f6){this[_0x1464e6(0x22f,0x2a5)]();throw this['handleAuthError'](_0x1e62f6);}}async['getUser'](){function _0x1b4663(_0x59e1ef,_0x14f0a7){return _0x591a(_0x59e1ef-0x274,_0x14f0a7);}if(!this[_0x1b4663(0x3da,0x44b)]?.[_0x1b4663(0x411,0x47a)])return null;try{const response=await this[_0x1b4663(0x431,0x3d4)]['get']('/auth/v1/user');return response['data'][_0x1b4663(0x43f,0x3f4)];}catch(_0x15b815){if(_0x15b815 instanceof EBaaSError&&_0x15b815[_0x1b4663(0x4bd,0x462)]===0x191)return this[_0x1b4663(0x410,0x43a)](),null;throw this['handleAuthError'](_0x15b815);}}async['refreshSession'](){function _0x5859c2(_0x1a906c,_0x2f8534){return _0x591a(_0x1a906c- -0xe5,_0x2f8534);}if(!this['currentSession']?.['refresh_token'])return null;try{const response=await this['httpClient'][_0x5859c2(0x167,0x17b)]('/auth/v1/refresh',{'refresh_token':this[_0x5859c2(0x81,0x65)][_0x5859c2(0x156,0x10e)]});if(response['data'][_0x5859c2(0xe1,0x13e)])return this['setSession'](response['data']['session']),response[_0x5859c2(0x10e,0xfd)]['session'];return null;}catch(_0x335d37){this[_0x5859c2(0xb7,0x82)]();throw this[_0x5859c2(0x105,0x175)](_0x335d37);}}async['resetPassword'](_0x367706){function _0x21f01a(_0x4d3d1a,_0x4b9afc){return _0x591a(_0x4d3d1a- -0x31b,_0x4b9afc);}try{await this['httpClient'][_0x21f01a(-0xcf,-0x111)]('/auth/v1/reset-password',{'email':_0x367706});}catch(_0x46e076){throw this[_0x21f01a(-0x131,-0xed)](_0x46e076);}}async['updateUser'](data){function _0x1614a1(_0x2fb655,_0x46ccd7){return _0x591a(_0x2fb655-0x1f8,_0x46ccd7);}try{const response=await this[_0x1614a1(0x3b5,0x3ea)][_0x1614a1(0x361,0x3c8)](_0x1614a1(0x424,0x403),data);return response[_0x1614a1(0x3eb,0x461)]['user'];}catch(_0x21d779){throw this['handleAuthError'](_0x21d779);}}['getSession'](){return this['currentSession'];}[_0x4a3cb3(0x114,0xae)](_0x30bfa5){this[_0xded08f(0x419,0x3e3)]=_0x30bfa5,this['httpClient'][_0xded08f(0x415,0x487)](_0x30bfa5[_0xded08f(0x450,0x47c)]);function _0xded08f(_0x553a19,_0x4a10ee){return _0x591a(_0x553a19-0x2b3,_0x4a10ee);}typeof localStorage!==_0xded08f(0x4be,0x4b7)&&localStorage['setItem']('ebaas.auth.session',JSON[_0xded08f(0x4eb,0x4c6)](_0x30bfa5));}['onAuthStateChange'](_0x369cf3){return()=>{};}['setWorkspaceId'](_0x2d99be){this['workspaceId']=_0x2d99be;}[_0x4a3cb3(0xe5,0x6c)](_0x13fe2a){this['currentSession']=_0x13fe2a,this['httpClient']['setAuthToken'](_0x13fe2a[_0x4f8adc(0x42e,0x430)]);function _0x4f8adc(_0x5a9c07,_0x351f8d){return _0x591a(_0x5a9c07-0x291,_0x351f8d);}typeof localStorage!=='undefined'&&localStorage[_0x4f8adc(0x489,0x4ad)](_0x4f8adc(0x416,0x42f),JSON[_0x4f8adc(0x4c9,0x4ca)](_0x13fe2a));}[_0x4a3cb3(0x5b,0x2)](){this[_0x2d9e27(0x511,0x4bb)]=null;function _0x2d9e27(_0x1044a6,_0x431883){return _0x591a(_0x1044a6-0x3ab,_0x431883);}this['httpClient'][_0x2d9e27(0x553,0x5a8)](),typeof localStorage!=='undefined'&&localStorage[_0x2d9e27(0x53d,0x50c)](_0x2d9e27(0x530,0x53f));}[_0x4a3cb3(0x61,0x63)](){function _0x116dfd(_0x141400,_0x39fcb9){return _0x591a(_0x39fcb9-0x3b6,_0x141400);}if(typeof localStorage!==_0x116dfd(0x5c6,0x5c1)){const _0x439d2b=localStorage['getItem']('ebaas.auth.session');if(_0x439d2b)try{const _0xffabd7=JSON['parse'](_0x439d2b);this['setSessionInternal'](_0xffabd7);}catch(_0x35ba40){this[_0x116dfd(0x4ef,0x552)]();}}}['handleAuthError'](_0x3e13c7){function _0x5a842b(_0x3f2a0e,_0x4a4e53){return _0x591a(_0x4a4e53- -0x18a,_0x3f2a0e);}if(_0x3e13c7 instanceof EBaaSError)return _0x3e13c7;return new EBaaSError(_0x3e13c7['message']||_0x5a842b(0x3,0x3b),_0x3e13c7['status']||0x0,_0x3e13c7);}}class QueryBuilder{constructor(_0x32b907,_0x56a830,_0x19e477,_0x57898b){this[_0x2e7fae(0x546,0x5ad)]=_0x32b907,this['table']=_0x56a830;function _0x2e7fae(_0x44c0f5,_0x216807){return _0x591a(_0x44c0f5-0x389,_0x216807);}this[_0x2e7fae(0x598,0x551)]=_0x19e477,this['workspaceId']=_0x57898b,this['query']={'filters':[]};}[_0x4a3cb3(0x8d,0xa5)](_0x5460f6='*',_0x93246b){this['query'][_0x646066(-0xcf,-0x118)]=_0x5460f6;function _0x646066(_0x557218,_0x36713d){return _0x591a(_0x557218- -0x30e,_0x36713d);}return this;}[_0x4a3cb3(0x72,0x15)](data,_0x33b6b2){function _0x462088(_0x2b754d,_0x3afcb0){return _0x591a(_0x3afcb0-0x145,_0x2b754d);}return this[_0x462088(0x30c,0x36f)]('POST','/sdk/v1/'+this['table']+_0x462088(0x338,0x370),{'data':data,'options':_0x33b6b2});}[_0x4a3cb3(-0x15,0x58)](data,_0x47e626){this[_0x4dde63(0x12f,0x158)][_0x4dde63(0x1b0,0x156)]=data;function _0x4dde63(_0x52e937,_0x5727c7){return _0x591a(_0x5727c7- -0x8c,_0x52e937);}return this['query']['updateOptions']=_0x47e626,this;}['upsert'](data,_0x47be5c){function _0x261261(_0x56b690,_0x3065ec){return _0x591a(_0x3065ec-0x202,_0x56b690);}return this['executeQuery']('POST','/sdk/v1/'+this[_0x261261(0x410,0x40a)]+'?operation=upsert',{'data':data,'options':{..._0x47be5c,'upsert':!![]}});}[_0x4a3cb3(0x10,0x67)](_0x19b152){this[_0x3cf367(0x5ac,0x567)][_0x3cf367(0x540,0x4ce)]=_0x19b152,this['query']['isDelete']=!![];function _0x3cf367(_0x5eb211,_0x5c125b){return _0x591a(_0x5eb211-0x3c8,_0x5c125b);}return this;}['eq'](_0x4ef2f8,_0x309606){this[_0x3fc2de(0x1d6,0x160)][_0x3fc2de(0xbe,0xdd)]['push']({'column':_0x4ef2f8,'operator':'eq','value':_0x309606});function _0x3fc2de(_0x3997be,_0x505a6b){return _0x591a(_0x505a6b- -0x84,_0x3997be);}return this;}['neq'](_0x233e67,_0x3c94df){function _0x46419e(_0x5ca463,_0x522403){return _0x591a(_0x522403-0x25d,_0x5ca463);}return this[_0x46419e(0x443,0x441)]['filters']['push']({'column':_0x233e67,'operator':_0x46419e(0x4d7,0x4af),'value':_0x3c94df}),this;}['gt'](_0x949b3c,_0x2e9eaf){function _0x5affa7(_0x4575d8,_0x1c5e79){return _0x591a(_0x4575d8- -0x1e4,_0x1c5e79);}return this[_0x5affa7(0x0,-0x48)]['filters']['push']({'column':_0x949b3c,'operator':'gt','value':_0x2e9eaf}),this;}['gte'](_0x48483a,_0x135c12){return this['query']['filters']['push']({'column':_0x48483a,'operator':'gte','value':_0x135c12}),this;}['lt'](_0x12e5d8,_0x36a84c){function _0x5f3175(_0x2c676c,_0x3a1191){return _0x591a(_0x2c676c-0xb5,_0x3a1191);}return this['query'][_0x5f3175(0x216,0x285)]['push']({'column':_0x12e5d8,'operator':'lt','value':_0x36a84c}),this;}['lte'](_0x3f951d,_0x510d95){this['query']['filters'][_0x59fea4(0x261,0x24b)]({'column':_0x3f951d,'operator':'lte','value':_0x510d95});function _0x59fea4(_0x35befc,_0x1f080b){return _0x591a(_0x1f080b-0x6e,_0x35befc);}return this;}['like'](_0x19e086,_0xb53331){function _0xb3f03b(_0x44edda,_0x530e33){return _0x591a(_0x530e33-0x388,_0x44edda);}return this['query'][_0xb3f03b(0x4c2,0x4e9)]['push']({'column':_0x19e086,'operator':_0xb3f03b(0x529,0x55a),'value':_0xb53331}),this;}[_0x4a3cb3(0x9d,0x73)](_0x386a71,_0x5dfc81){function _0x50cf70(_0x319d6a,_0x3c49e9){return _0x591a(_0x3c49e9- -0x51,_0x319d6a);}return this[_0x50cf70(0x19f,0x193)]['filters'][_0x50cf70(0x17a,0x18c)]({'column':_0x386a71,'operator':_0x50cf70(0x1d1,0x1bc),'value':_0x5dfc81}),this;}['is'](_0x227d98,_0x1acb60){this[_0x412a78(0x4fc,0x52a)][_0x412a78(0x479,0x45b)]['push']({'column':_0x227d98,'operator':'is','value':_0x1acb60});function _0x412a78(_0x14bbe8,_0x574291){return _0x591a(_0x14bbe8-0x318,_0x574291);}return this;}['in'](_0x49bc3b,_0x540394){function _0x2bc76c(_0x374d6d,_0x18080f){return _0x591a(_0x18080f-0x151,_0x374d6d);}return this['query']['filters'][_0x2bc76c(0x2c1,0x32e)]({'column':_0x49bc3b,'operator':'in','value':_0x540394}),this;}['contains'](_0x5de838,_0x8997eb){function _0x1ad64f(_0x298699,_0x104c09){return _0x591a(_0x298699- -0x30a,_0x104c09);}return this['query']['filters'][_0x1ad64f(-0x12d,-0x18e)]({'column':_0x5de838,'operator':_0x1ad64f(-0xda,-0x64),'value':_0x8997eb}),this;}['match'](_0x6d5bb){function _0x293fd3(_0x5dfd1f,_0x276bce){return _0x591a(_0x276bce- -0x3e,_0x5dfd1f);}return Object[_0x293fd3(0x1af,0x14b)](_0x6d5bb)['forEach'](([_0x2d9b73,_0x2df320])=>{this['eq'](_0x2d9b73,_0x2df320);}),this;}['order'](_0x549ad1,_0x5072e0){!this['query']['order']&&(this[_0x1cb96c(0xe0,0xf8)][_0x1cb96c(0x105,0x125)]=[]);function _0x1cb96c(_0x2027c8,_0xbf019c){return _0x591a(_0xbf019c- -0xec,_0x2027c8);}return this['query'][_0x1cb96c(0x177,0x125)][_0x1cb96c(0x10d,0xf1)]({'column':_0x549ad1,'ascending':_0x5072e0?.[_0x1cb96c(0x12b,0x131)]!==![]}),this;}[_0x4a3cb3(0xaa,0x7e)](count){function _0x4f27ec(_0x11b7d4,_0x441d8e){return _0x591a(_0x11b7d4-0x1aa,_0x441d8e);}return this[_0x4f27ec(0x38e,0x34d)][_0x4f27ec(0x3c2,0x405)]=count,this;}[_0x4a3cb3(0x9a,0x6f)](from,_0x3b840b){return this['query']['range']={'from':from,'to':_0x3b840b},this;}async['execute'](){function _0x2fd9d2(_0x6006ff,_0x2cdaef){return _0x591a(_0x6006ff- -0x29b,_0x2cdaef);}if(this['query'][_0x2fd9d2(-0xb9,-0xea)])return this[_0x2fd9d2(-0x71,-0x1a)]('PATCH','/sdk/v1/'+this['table'],{'data':this[_0x2fd9d2(-0xb7,-0x117)][_0x2fd9d2(-0xb9,-0xf0)],'options':this[_0x2fd9d2(-0xb7,-0xb7)]['updateOptions'],'filters':this[_0x2fd9d2(-0xb7,-0x41)]['filters']});else return this[_0x2fd9d2(-0xb7,-0xe5)]['isDelete']?this['executeQuery']('DELETE',_0x2fd9d2(-0x6c,-0xc7)+this[_0x2fd9d2(-0x93,-0xf4)]+_0x2fd9d2(-0xc0,-0x7c),{'options':this[_0x2fd9d2(-0xb7,-0x100)]['deleteOptions'],'filters':this['query']['filters']}):this['executeQuery']('GET',_0x2fd9d2(-0x6c,-0x9d)+this['table']+_0x2fd9d2(-0x113,-0xa6),{'select':this[_0x2fd9d2(-0xb7,-0x126)]['select'],'filters':this[_0x2fd9d2(-0xb7,-0xa8)][_0x2fd9d2(-0x13a,-0x116)],'order':this[_0x2fd9d2(-0xb7,-0xd9)][_0x2fd9d2(-0x8a,-0xb3)],'limit':this[_0x2fd9d2(-0xb7,-0xce)]['limit'],'range':this['query'][_0x2fd9d2(-0x92,-0xe1)]});}async['single'](){this[_0x113fd3(-0xd4,-0x11a)](0x1);const result=await this[_0x113fd3(-0x18e,-0x11b)]();function _0x113fd3(_0x1346a8,_0x3b9101){return _0x591a(_0x1346a8- -0x2ec,_0x3b9101);}return{'data':result['data']?.[0x0]||null,'error':result['error']};}async['executeQuery'](_0x469cbe,_0x46a760,_0x7012e7){function _0x3cbafd(_0x4ba360,_0x37a1ac){return _0x591a(_0x4ba360- -0x309,_0x37a1ac);}try{let response;const headers={};this[_0x3cbafd(-0x179,-0x17d)]&&(headers['x-workspace-id']=this[_0x3cbafd(-0x179,-0x104)]);if(_0x469cbe==='GET'){const _0x38354b=_0x46a760['split']('?'),_0x3879fa=_0x38354b[0x0],existingParams=new URLSearchParams(_0x38354b[0x1]||'');if(_0x7012e7[_0x3cbafd(-0xca,-0x10b)])existingParams[_0x3cbafd(-0xc4,-0xb1)](_0x3cbafd(-0xca,-0xfd),_0x7012e7['select']);_0x7012e7[_0x3cbafd(-0x1a8,-0x1b0)]?.['length']&&_0x7012e7['filters'][_0x3cbafd(-0x105,-0xf0)](filter=>{function _0x55222f(_0x34ff86,_0x2ddc1e){return _0x591a(_0x2ddc1e- -0x235,_0x34ff86);}existingParams[_0x55222f(0x14,0x10)](filter['column'],filter['operator']+'.'+filter[_0x55222f(-0x16,0x2)]);});if(_0x7012e7['order']?.['length']){const orderStr=_0x7012e7['order'][_0x3cbafd(-0x141,-0xe6)](_0x4150aa=>''+_0x4150aa[_0x3cbafd(-0x10a,-0x13e)]+(_0x4150aa[_0x3cbafd(-0xec,-0xaf)]?'.asc':_0x3cbafd(-0xb9,-0xd6)))['join'](',');existingParams[_0x3cbafd(-0xc4,-0x96)](_0x3cbafd(-0xf8,-0xc0),orderStr);}if(_0x7012e7['limit'])existingParams[_0x3cbafd(-0xc4,-0xd4)]('limit',_0x7012e7[_0x3cbafd(-0xf1,-0x105)]['toString']());_0x7012e7['range']&&(existingParams[_0x3cbafd(-0xc4,-0xd2)](_0x3cbafd(-0x14a,-0x104),_0x7012e7['range'][_0x3cbafd(-0x131,-0x184)]['toString']()),existingParams['append'](_0x3cbafd(-0xf1,-0x16d),(_0x7012e7[_0x3cbafd(-0x100,-0x154)]['to']-_0x7012e7['range'][_0x3cbafd(-0x131,-0x111)]+0x1)['toString']())),response=await this['httpClient'][_0x3cbafd(-0x13d,-0x12d)](_0x3879fa+'?'+existingParams[_0x3cbafd(-0x166,-0xf0)](),{'headers':headers});}else{if(_0x469cbe==='DELETE'){const _0x43c464=_0x46a760['split']('?'),_0x2f6b53=_0x43c464[0x0],existingParams=new URLSearchParams(_0x43c464[0x1]||'');!existingParams['has']('operation')&&existingParams[_0x3cbafd(-0xc4,-0x12b)](_0x3cbafd(-0xcc,-0x5f),'delete');_0x7012e7[_0x3cbafd(-0x1a8,-0x1ee)]?.['length']&&_0x7012e7[_0x3cbafd(-0x1a8,-0x1ea)]['forEach'](filter=>{function _0x15d061(_0x351dba,_0x2465f6){return _0x591a(_0x2465f6- -0x151,_0x351dba);}existingParams['append'](filter['column'],filter[_0x15d061(0x33,0x66)]+'.'+filter['value']);});const deleteUrl=_0x2f6b53+'?'+existingParams[_0x3cbafd(-0x166,-0xfe)]();console[_0x3cbafd(-0xc8,-0xc6)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console['log']('\uD83D\uDD27 DELETE headers:',headers),console[_0x3cbafd(-0xc8,-0x126)]('\uD83D\uDD27 DELETE filtros originais:',_0x7012e7['filters']),response=await this[_0x3cbafd(-0x14c,-0xd6)]['delete'](deleteUrl,{'headers':headers});}else{if(_0x469cbe==='PATCH'){const _0x22108b=_0x46a760['split']('?'),_0x6e576b=_0x22108b[0x0],existingParams=new URLSearchParams(_0x22108b[0x1]||'');!existingParams['has']('operation')&&existingParams[_0x3cbafd(-0xc4,-0x82)](_0x3cbafd(-0xcc,-0x106),'update');_0x7012e7[_0x3cbafd(-0x1a8,-0x176)]?.['length']&&_0x7012e7['filters']['forEach'](filter=>{function _0x4e4a9a(_0x3aef43,_0x3f297e){return _0x591a(_0x3aef43- -0xf3,_0x3f297e);}existingParams[_0x4e4a9a(0x152,0xe3)](filter[_0x4e4a9a(0x10c,0x15d)],filter['operator']+'.'+filter['value']);});_0x7012e7['options']?.[_0x3cbafd(-0x13c,-0xe0)]&&(headers['Prefer']=_0x7012e7[_0x3cbafd(-0x11c,-0x15c)]['prefer']);const updateUrl=_0x6e576b+'?'+existingParams[_0x3cbafd(-0x166,-0x1ab)]();response=await this['httpClient'][_0x3cbafd(-0x157,-0x111)](updateUrl,_0x7012e7[_0x3cbafd(-0x116,-0xd3)],{'headers':headers});}else{let _0x4c5e95=_0x7012e7['data'];!headers['Prefer']&&(headers[_0x3cbafd(-0x169,-0x186)]='return=representation'),_0x7012e7[_0x3cbafd(-0x11c,-0xdf)]?.['upsert']&&(headers[_0x3cbafd(-0x169,-0x188)]=_0x3cbafd(-0x11b,-0xd3)),_0x7012e7['dataArray']&&(_0x4c5e95=_0x7012e7[_0x3cbafd(-0x14e,-0x13c)]),response=await this['httpClient']['post'](_0x46a760,_0x4c5e95,{'headers':headers});}}}return{'data':response[_0x3cbafd(-0x116,-0x161)],'error':null,'count':response['headers']?.[_0x3cbafd(-0x164,-0x110)]?parseInt(response[_0x3cbafd(-0x122,-0x12b)][_0x3cbafd(-0x164,-0x176)]):undefined};}catch(_0x54ddda){return{'data':null,'error':_0x54ddda instanceof EBaaSError?_0x54ddda:new EBaaSError(_0x54ddda instanceof Error?_0x54ddda[_0x3cbafd(-0x17b,-0x179)]:'Database\x20operation\x20failed',0x0,_0x54ddda)};}}}class CustomDatabaseManager{constructor(_0x3b88f8,_0x55c52a){function _0x1aab18(_0x3f082f,_0x3b55bd){return _0x591a(_0x3f082f- -0xfa,_0x3b55bd);}this[_0x1aab18(0xc3,0x70)]=_0x3b88f8,this[_0x1aab18(0x96,0x71)]=_0x55c52a;}async['detectCustomDatabase'](){function _0x16f138(_0x1e3cae,_0x392457){return _0x591a(_0x392457- -0x1a0,_0x1e3cae);}if(!this[_0x16f138(0x50,-0x10)])return{'hasCustomDatabase':![]};try{const response=await this['httpClient'][_0x16f138(-0x10,0x2c)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response[_0x16f138(0x47,0xa9)]===0xc8&&response[_0x16f138(-0x24,0x53)]?.['config']){const config=response[_0x16f138(0x37,0x53)][_0x16f138(0x4e,0x59)],_0x16c36b={'host':config['postgresHost'],'port':config['postgresPort'],'database':config['postgresDatabase'],'username':config[_0x16f138(0xdb,0x77)],'password':'','schema':config['postgresSchema'],'sslEnabled':config['sslEnabled']};return this[_0x16f138(0xbb,0x6c)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x16c36b},this[_0x16f138(0x53,0x6c)];}}catch(_0x3f4d8b){if(_0x3f4d8b?.[_0x16f138(0x5d,0xa9)]===0x194)return this['detectedConfig']={'hasCustomDatabase':![]},this[_0x16f138(0x69,0x6c)];console['warn']('Failed to detect custom database configuration:',_0x3f4d8b);}return this['detectedConfig']={'hasCustomDatabase':![]},this['detectedConfig'];}async['testConnection'](_0x59580c){function _0x4b9b9b(_0x19d18e,_0x59bddd){return _0x591a(_0x59bddd-0x2cb,_0x19d18e);}try{const response=await this[_0x4b9b9b(0x493,0x488)][_0x4b9b9b(0x53e,0x517)]('/admin/v1/workspace/custom-database/test-connection',_0x59580c,{'headers':this[_0x4b9b9b(0x44d,0x45b)]?{'X-Workspace-ID':this[_0x4b9b9b(0x4b2,0x45b)]}:{}});return response['data'];}catch(_0x5e28be){return{'success':![],'message':_0x5e28be?.[_0x4b9b9b(0x478,0x459)]||_0x4b9b9b(0x425,0x464)};}}async[_0x4a3cb3(0x5e,0x3d)](_0x3829f2){if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');const response=await this['httpClient']['post']('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x3829f2},{'headers':{'X-Workspace-ID':this[_0x3840bf(0x216,0x26f)]}}),config=response[_0x3840bf(0x290,0x2d2)][_0x3840bf(0x2f1,0x2d8)];this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x3829f2};function _0x3840bf(_0x3ba585,_0x5a8ddc){return _0x591a(_0x5a8ddc-0xdf,_0x3ba585);}return config;}async[_0x4a3cb3(0x8,0x79)](){if(!this[_0x113a22(0x24b,0x1f1)])throw new Error('Workspace ID is required to remove custom database');await this[_0x113a22(0x1fe,0x21e)]['delete']('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this['workspaceId']}});function _0x113a22(_0x147091,_0xc2905e){return _0x591a(_0xc2905e-0x61,_0x147091);}this[_0x113a22(0x2d1,0x26d)]={'hasCustomDatabase':![]};}['getDetectedConfig'](){return this['detectedConfig'];}[_0x4a3cb3(0xf3,0x87)](){return this['detectedConfig']?.['hasCustomDatabase']??![];}[_0x4a3cb3(0xd9,0x81)](){function _0x2984c6(_0x42eb33,_0x654eae){return _0x591a(_0x654eae-0x2e0,_0x42eb33);}return this['detectedConfig']?.[_0x2984c6(0x480,0x47b)];}[_0x4a3cb3(-0x86,-0x20)](_0x2bebbd){this['workspaceId']=_0x2bebbd;function _0x39cd4a(_0x5c4fe7,_0x3d0f7f){return _0x591a(_0x3d0f7f-0x1e6,_0x5c4fe7);}this[_0x39cd4a(0x45a,0x3f2)]=undefined;}['getWorkspaceId'](){function _0x4d5256(_0x425801,_0x5d8f5f){return _0x591a(_0x5d8f5f-0x368,_0x425801);}return this[_0x4d5256(0x500,0x4f8)];}[_0x4a3cb3(-0x21,0x4c)](){function _0x1d2aeb(_0x33ae87,_0x48f3d8){return _0x591a(_0x48f3d8- -0x36e,_0x33ae87);}return{'workspaceId':this[_0x1d2aeb(-0x190,-0x1de)],'hasConfig':this[_0x1d2aeb(-0x118,-0x14d)](),'configDetails':this['detectedConfig']?.['credentials']?{'host':this['detectedConfig'][_0x1d2aeb(-0x215,-0x1d3)]['host'],'port':this[_0x1d2aeb(-0x16f,-0x162)][_0x1d2aeb(-0x168,-0x1d3)]['port'],'database':this[_0x1d2aeb(-0x173,-0x162)]['credentials']['database'],'schema':this[_0x1d2aeb(-0xf5,-0x162)]['credentials']['schema']||_0x1d2aeb(-0x1c3,-0x1f7),'sslEnabled':this['detectedConfig']['credentials'][_0x1d2aeb(-0x11e,-0x17a)]||![]}:undefined};}}class DatabaseClient{constructor(_0x2c298c,_0x66b4fd){function _0x23e72c(_0x1e46c2,_0x13e8ef){return _0x591a(_0x1e46c2-0x3ae,_0x13e8ef);}this[_0x23e72c(0x56b,0x4fe)]=_0x2c298c,this[_0x23e72c(0x516,0x4af)]=new CustomDatabaseManager(_0x2c298c,_0x66b4fd);}[_0x4a3cb3(-0x20,0x3e)](_0x200d8d){function _0xb59e3(_0x2fc1f7,_0x356ad4){return _0x591a(_0x2fc1f7-0x331,_0x356ad4);}return new QueryBuilder(this[_0xb59e3(0x4ee,0x48d)],_0x200d8d,this['currentSchema'],this[_0xb59e3(0x499,0x44c)][_0xb59e3(0x4b2,0x4fe)]());}['rpc'](_0x170f06,_0x45e348){function _0x515d25(_0x43b95e,_0x567ebc){return _0x591a(_0x567ebc- -0x62,_0x43b95e);}return this[_0x515d25(0x1b9,0x15b)]['post']('/rpc/'+_0x170f06,_0x45e348);}['schema'](_0x1ac7ba){function _0x2e269f(_0x12d775,_0x10872e){return _0x591a(_0x12d775- -0x37a,_0x10872e);}const _0x5e1632=new DatabaseClient(this['httpClient'],this[_0x2e269f(-0x212,-0x1fe)]['getWorkspaceId']());return _0x5e1632[_0x2e269f(-0x1b3,-0x22f)]=_0x1ac7ba,_0x5e1632['customDatabaseManager']=this['customDatabaseManager'],_0x5e1632;}async['detectCustomDatabase'](){function _0x43821f(_0x555b80,_0x530dd2){return _0x591a(_0x555b80- -0x363,_0x530dd2);}return this[_0x43821f(-0x1fb,-0x25a)][_0x43821f(-0x17e,-0x10b)]();}async[_0x4a3cb3(0x4d,-0x2c)](_0x58349d){function _0x4fac4f(_0x32887a,_0x359ec8){return _0x591a(_0x32887a- -0x3bb,_0x359ec8);}return this[_0x4fac4f(-0x253,-0x1eb)]['testConnection'](_0x58349d);}async['configureCustomDatabase'](_0x5e5ff6){function _0xd3fca6(_0x132170,_0x3fc821){return _0x591a(_0x132170-0x1bb,_0x3fc821);}return this['customDatabaseManager'][_0xd3fca6(0x392,0x34c)](_0x5e5ff6);}async[_0x4a3cb3(0x28,0x79)](){function _0x2ae38a(_0x45ff86,_0xe62f7c){return _0x591a(_0xe62f7c-0x3dc,_0x45ff86);}return this[_0x2ae38a(0x549,0x544)]['removeCustomDatabase']();}[_0x4a3cb3(0x6e,0x51)](){function _0x48fb25(_0x3809f2,_0x416ad3){return _0x591a(_0x3809f2-0x88,_0x416ad3);}return this['customDatabaseManager'][_0x48fb25(0x2a9,0x2eb)]();}['getCustomDatabaseStatus'](){function _0x4e0d98(_0x128999,_0x4a83ed){return _0x591a(_0x4a83ed-0x45,_0x128999);}return this[_0x4e0d98(0x229,0x1ad)][_0x4e0d98(0x26c,0x22b)]();}[_0x4a3cb3(0x55,-0x20)](_0x11e40d){function _0xa883c9(_0x4e8ecd,_0x4eb4be){return _0x591a(_0x4eb4be-0x41,_0x4e8ecd);}this[_0xa883c9(0x181,0x1a9)]['setWorkspaceId'](_0x11e40d);}async['initialize'](){function _0x3ed01f(_0x2aae12,_0x46ac05){return _0x591a(_0x46ac05-0x32e,_0x2aae12);}try{await this['customDatabaseManager'][_0x3ed01f(0x4c4,0x513)]();}catch(_0x235140){console['warn']('Failed to initialize custom database detection:',_0x235140);}}}class StorageBucket{constructor(_0x5e7406,bucketId){function _0x2ce381(_0x863665,_0x48e6ad){return _0x591a(_0x48e6ad-0x288,_0x863665);}this[_0x2ce381(0x413,0x445)]=_0x5e7406,this[_0x2ce381(0x47d,0x42f)]=bucketId;}async[_0x4a3cb3(0x6c,0xf)](_0x3c33fc,_0x458cef,_0x107a64){function _0x5154b0(_0x4d9cbb,_0x57315c){return _0x591a(_0x4d9cbb-0x3dd,_0x57315c);}try{const _0xc08ad7=new FormData();if(_0x458cef instanceof File)_0xc08ad7['append'](_0x5154b0(0x617,0x5d8),_0x458cef);else{if(_0x458cef instanceof Blob)_0xc08ad7['append'](_0x5154b0(0x617,0x66b),_0x458cef,_0x3c33fc);else{if(_0x458cef instanceof ArrayBuffer)_0xc08ad7['append']('file',new Blob([_0x458cef]),_0x3c33fc);else typeof _0x458cef==='string'&&_0xc08ad7[_0x5154b0(0x622,0x631)](_0x5154b0(0x617,0x62d),new Blob([_0x458cef],{'type':'text/plain'}),_0x3c33fc);}}_0xc08ad7['append']('path',_0x3c33fc);_0x107a64?.['cacheControl']&&_0xc08ad7['append']('cacheControl',_0x107a64[_0x5154b0(0x59f,0x5ad)]);_0x107a64?.['contentType']&&_0xc08ad7['append'](_0x5154b0(0x58a,0x539),_0x107a64['contentType']);_0x107a64?.[_0x5154b0(0x5ff,0x587)]&&_0xc08ad7[_0x5154b0(0x622,0x64f)](_0x5154b0(0x5ff,0x61f),JSON['stringify'](_0x107a64[_0x5154b0(0x5ff,0x645)]));const _0x9306e8='/storage/buckets/'+this['bucketId']+'/files'+(_0x107a64?.[_0x5154b0(0x53c,0x4c1)]?_0x5154b0(0x570,0x591):''),response=await this['httpClient'][_0x5154b0(0x629,0x5d9)](_0x9306e8,_0xc08ad7,{'headers':{'Content-Type':_0x5154b0(0x596,0x5c5)}});return{'data':response[_0x5154b0(0x5d0,0x59b)],'error':null};}catch(_0x28151b){return{'data':null,'error':_0x28151b instanceof EBaaSError?_0x28151b:new EBaaSError(_0x28151b instanceof Error?_0x28151b[_0x5154b0(0x56b,0x550)]:_0x5154b0(0x54e,0x509),0x0,_0x28151b)};}}async[_0x4a3cb3(-0x78,-0xb)](_0x118d0b,_0x413e08){function _0x2b8ab0(_0x17349c,_0xecd17f){return _0x591a(_0xecd17f-0x365,_0x17349c);}try{const _0x131c61=new URLSearchParams();_0x413e08?.[_0x2b8ab0(0x51d,0x4e8)]&&Object[_0x2b8ab0(0x48a,0x4ee)](_0x413e08['transform'])[_0x2b8ab0(0x5ab,0x569)](([_0x4410cc,_0x387392])=>{_0x387392!==undefined&&_0x131c61['append'](_0x4410cc,String(_0x387392));});const _0x44c4bf=_0x2b8ab0(0x587,0x528)+this[_0x2b8ab0(0x53d,0x50c)]+_0x2b8ab0(0x591,0x560)+_0x118d0b+(_0x131c61['toString']()?'?'+_0x131c61[_0x2b8ab0(0x4a0,0x508)]():''),response=await this['httpClient']['get'](_0x44c4bf,{'responseType':'blob'});return{'data':response[_0x2b8ab0(0x4f9,0x558)],'error':null};}catch(_0x3fe725){return{'data':null,'error':_0x3fe725 instanceof EBaaSError?_0x3fe725:new EBaaSError(_0x3fe725 instanceof Error?_0x3fe725['message']:_0x2b8ab0(0x508,0x4f1),0x0,_0x3fe725)};}}async[_0x4a3cb3(0x11,0x16)](_0x53cb62,_0x20d6f2){function _0x40c947(_0x2b88e0,_0x47fb82){return _0x591a(_0x2b88e0- -0x3a2,_0x47fb82);}try{const _0x3b2309=new URLSearchParams();_0x53cb62&&_0x3b2309[_0x40c947(-0x15d,-0x125)]('prefix',_0x53cb62);_0x20d6f2?.[_0x40c947(-0x18a,-0x139)]&&_0x3b2309['append']('limit',String(_0x20d6f2[_0x40c947(-0x18a,-0x18a)]));_0x20d6f2?.[_0x40c947(-0x1e3,-0x16b)]&&_0x3b2309['append'](_0x40c947(-0x1e3,-0x1fc),String(_0x20d6f2['offset']));_0x20d6f2?.['sortBy']&&_0x3b2309[_0x40c947(-0x15d,-0x1a8)]('sortBy',JSON['stringify'](_0x20d6f2['sortBy']));_0x20d6f2?.['search']&&_0x3b2309[_0x40c947(-0x15d,-0x110)]('search',_0x20d6f2[_0x40c947(-0x23f,-0x291)]);const _0x4cc465=_0x40c947(-0x1df,-0x163)+this[_0x40c947(-0x1fb,-0x23c)]+_0x40c947(-0x1c3,-0x1c8)+(_0x3b2309['toString']()?'?'+_0x3b2309['toString']():''),response=await this[_0x40c947(-0x1e5,-0x19d)]['get'](_0x4cc465);return{'data':response['data'],'error':null};}catch(_0x3bcea5){return{'data':null,'error':_0x3bcea5 instanceof EBaaSError?_0x3bcea5:new EBaaSError(_0x3bcea5 instanceof Error?_0x3bcea5[_0x40c947(-0x214,-0x1a8)]:_0x40c947(-0x151,-0x123),0x0,_0x3bcea5)};}}async[_0x4a3cb3(0xc4,0x60)](_0x42759f){function _0x2b3079(_0x2c735e,_0x304cc1){return _0x591a(_0x2c735e-0x61,_0x304cc1);}try{const response=await this[_0x2b3079(0x21e,0x1f3)][_0x2b3079(0x262,0x2a9)](_0x2b3079(0x224,0x1fa)+this['bucketId']+_0x2b3079(0x240,0x1f6),{'data':{'paths':_0x42759f}});return{'data':response[_0x2b3079(0x254,0x20a)],'error':null};}catch(_0x1c87f6){return{'data':null,'error':_0x1c87f6 instanceof EBaaSError?_0x1c87f6:new EBaaSError(_0x1c87f6 instanceof Error?_0x1c87f6['message']:'Failed\x20to\x20remove\x20files',0x0,_0x1c87f6)};}}async['move'](fromPath,_0x167528){function _0xcaf869(_0x10eb9d,_0x210a91){return _0x591a(_0x210a91- -0x26a,_0x10eb9d);}try{const response=await this['httpClient']['post']('/storage/buckets/'+this['bucketId']+_0xcaf869(-0x87,-0xa0),{'sourceKey':fromPath,'destinationKey':_0x167528});return{'data':response['data'],'error':null};}catch(_0x2ab0d4){return{'data':null,'error':_0x2ab0d4 instanceof EBaaSError?_0x2ab0d4:new EBaaSError(_0x2ab0d4 instanceof Error?_0x2ab0d4['message']:_0xcaf869(-0xaf,-0x99),0x0,_0x2ab0d4)};}}async['copy'](fromPath,_0x143070){function _0x3523e0(_0x59531a,_0x4a560d){return _0x591a(_0x59531a- -0x2ea,_0x4a560d);}try{const response=await this[_0x3523e0(-0x12d,-0xc1)]['post']('/storage/buckets/'+this[_0x3523e0(-0x143,-0xee)]+'/files/copy',{'sourceKey':fromPath,'destinationKey':_0x143070});return{'data':response[_0x3523e0(-0xf7,-0x13a)],'error':null};}catch(_0x14ce5c){return{'data':null,'error':_0x14ce5c instanceof EBaaSError?_0x14ce5c:new EBaaSError(_0x14ce5c instanceof Error?_0x14ce5c['message']:'Failed\x20to\x20copy\x20file',0x0,_0x14ce5c)};}}async[_0x4a3cb3(0x5f,0x40)](_0x3ec697,_0x54b82d,_0x536624){function _0x2eebd8(_0x38af31,_0x3d7689){return _0x591a(_0x3d7689- -0x286,_0x38af31);}try{const response=await this[_0x2eebd8(-0x90,-0xc9)]['post'](_0x2eebd8(-0x86,-0xc3)+this[_0x2eebd8(-0xec,-0xdf)]+'/files/'+_0x3ec697+'/sign',{'expiresIn':_0x54b82d,..._0x536624});return{'data':response['data'],'error':null};}catch(_0x4212f4){return{'data':null,'error':_0x4212f4 instanceof EBaaSError?_0x4212f4:new EBaaSError(_0x4212f4 instanceof Error?_0x4212f4[_0x2eebd8(-0x101,-0xf8)]:_0x2eebd8(-0xd3,-0x8f),0x0,_0x4212f4)};}}['getPublicUrl'](_0x1fde0d,_0x42178f){const _0x241da4=new URLSearchParams();_0x42178f?.['transform']&&Object['entries'](_0x42178f[_0x749980(0x39f,0x3d2)])['forEach'](([_0x39dd06,_0x119f8b])=>{_0x119f8b!==undefined&&_0x241da4['append'](_0x39dd06,String(_0x119f8b));});const _0x35e72e=this[_0x749980(0x3a2,0x40c)][_0x749980(0x47e,0x407)]||'',_0x17c932=_0x35e72e+_0x749980(0x3d6,0x412)+this[_0x749980(0x3f2,0x3f6)]+_0x749980(0x3d1,0x44a)+_0x1fde0d+(_0x241da4[_0x749980(0x396,0x3f2)]()?'?'+_0x241da4['toString']():'');function _0x749980(_0xfeb3cb,_0x252ee0){return _0x591a(_0x252ee0-0x24f,_0xfeb3cb);}return{'data':{'publicUrl':_0x17c932}};}async['getFileInfo'](_0x10d324){function _0x177b24(_0x251394,_0x35908b){return _0x591a(_0x251394- -0x114,_0x35908b);}try{const response=await this[_0x177b24(0xa9,0x35)][_0x177b24(0xb8,0xe7)]('/storage/buckets/'+this[_0x177b24(0x93,0x4a)]+_0x177b24(0xe7,0x97)+_0x10d324+_0x177b24(0xd8,0xad));return{'data':response['data'],'error':null};}catch(_0x3c0b29){return{'data':null,'error':_0x3c0b29 instanceof EBaaSError?_0x3c0b29:new EBaaSError(_0x3c0b29 instanceof Error?_0x3c0b29[_0x177b24(0x7a,0xba)]:'Failed\x20to\x20get\x20file\x20info',0x0,_0x3c0b29)};}}async[_0x4a3cb3(-0x6d,-0x21)](_0x54377f,metadata){function _0x564297(_0x4b5fce,_0x47368){return _0x591a(_0x47368- -0x159,_0x4b5fce);}try{const response=await this['httpClient']['put']('/storage/buckets/'+this['bucketId']+_0x564297(0xea,0xa2)+_0x54377f+_0x564297(0x84,0xce),{'metadata':metadata});return{'data':response[_0x564297(0xc5,0x9a)],'error':null};}catch(_0xea96ba){return{'data':null,'error':_0xea96ba instanceof EBaaSError?_0xea96ba:new EBaaSError(_0xea96ba instanceof Error?_0xea96ba['message']:'Failed\x20to\x20update\x20file\x20metadata',0x0,_0xea96ba)};}}}function _0x591a(_0x2da522,_0x241fd7){const _0x57ef80=_0x57ef();return _0x591a=function(_0x591ad8,_0x249948){_0x591ad8=_0x591ad8-0x15d;let _0x2b1e40=_0x57ef80[_0x591ad8];if(_0x591a['PtjZqy']===undefined){var _0xb0e2e6=function(_0x1d3f4d){const _0x4c2995='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x446776='',_0x59cbe7='';for(let _0x1d4af5=0x0,_0x18c4c2,_0x30c475,_0x69fd3=0x0;_0x30c475=_0x1d3f4d['charAt'](_0x69fd3++);~_0x30c475&&(_0x18c4c2=_0x1d4af5%0x4?_0x18c4c2*0x40+_0x30c475:_0x30c475,_0x1d4af5++%0x4)?_0x446776+=String['fromCharCode'](0xff&_0x18c4c2>>(-0x2*_0x1d4af5&0x6)):0x0){_0x30c475=_0x4c2995['indexOf'](_0x30c475);}for(let _0x15c142=0x0,_0x5c1715=_0x446776['length'];_0x15c142<_0x5c1715;_0x15c142++){_0x59cbe7+='%'+('00'+_0x446776['charCodeAt'](_0x15c142)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x59cbe7);};_0x591a['aEaXrq']=_0xb0e2e6,_0x2da522=arguments,_0x591a['PtjZqy']=!![];}const _0x5047d2=_0x57ef80[0x0],_0x1677c8=_0x591ad8+_0x5047d2,_0x47dfba=_0x2da522[_0x1677c8];return!_0x47dfba?(_0x2b1e40=_0x591a['aEaXrq'](_0x2b1e40),_0x2da522[_0x1677c8]=_0x2b1e40):_0x2b1e40=_0x47dfba,_0x2b1e40;},_0x591a(_0x2da522,_0x241fd7);}class StorageClient{constructor(_0x155e9f){function _0x24c204(_0x187206,_0x1bac88){return _0x591a(_0x1bac88- -0x28e,_0x187206);}this[_0x24c204(-0xf9,-0xd1)]=_0x155e9f;}[_0x4a3cb3(0x68,0x3e)](bucketId){return new StorageBucket(this['httpClient'],bucketId);}async['createBucket'](_0x1047c,_0x74b426){function _0x321a92(_0x303190,_0x3a73de){return _0x591a(_0x303190-0x1c1,_0x3a73de);}try{const response=await this[_0x321a92(0x37e,0x347)][_0x321a92(0x40d,0x3dd)](_0x321a92(0x325,0x32b),{'id':_0x1047c,..._0x74b426});return{'data':response[_0x321a92(0x3b4,0x41a)],'error':null};}catch(_0x46b664){return{'data':null,'error':_0x46b664 instanceof EBaaSError?_0x46b664:new EBaaSError(_0x46b664 instanceof Error?_0x46b664['message']:_0x321a92(0x3aa,0x35d),0x0,_0x46b664)};}}async['getBucket'](_0x1d175d){function _0x49ace6(_0x192043,_0x2c1020){return _0x591a(_0x2c1020-0x39b,_0x192043);}try{const response=await this['httpClient'][_0x49ace6(0x5dd,0x567)]('/storage/buckets/'+_0x1d175d);return{'data':response[_0x49ace6(0x56d,0x58e)],'error':null};}catch(_0x2d1010){return{'data':null,'error':_0x2d1010 instanceof EBaaSError?_0x2d1010:new EBaaSError(_0x2d1010 instanceof Error?_0x2d1010[_0x49ace6(0x500,0x529)]:'Failed\x20to\x20get\x20bucket',0x0,_0x2d1010)};}}async[_0x4a3cb3(-0x83,-0x27)](){function _0xd1d608(_0x4b3760,_0x3084b2){return _0x591a(_0x4b3760- -0x29e,_0x3084b2);}try{const response=await this[_0xd1d608(-0xe1,-0xde)][_0xd1d608(-0xd2,-0x97)](_0xd1d608(-0x13a,-0x189));return{'data':response[_0xd1d608(-0xab,-0xef)],'error':null};}catch(_0x4b6364){return{'data':null,'error':_0x4b6364 instanceof EBaaSError?_0x4b6364:new EBaaSError(_0x4b6364 instanceof Error?_0x4b6364['message']:_0xd1d608(-0x50,-0x1a),0x0,_0x4b6364)};}}async[_0x4a3cb3(-0x9b,-0x25)](_0x1e0b61,_0x257b36){function _0x1c2503(_0x25aeb7,_0x4e3c7b){return _0x591a(_0x25aeb7- -0x105,_0x4e3c7b);}try{const response=await this['httpClient'][_0x1c2503(0x64,0x7a)](_0x1c2503(0xbe,0x106)+_0x1e0b61,_0x257b36);return{'data':response[_0x1c2503(0xee,0x13b)],'error':null};}catch(_0x2de871){return{'data':null,'error':_0x2de871 instanceof EBaaSError?_0x2de871:new EBaaSError(_0x2de871 instanceof Error?_0x2de871[_0x1c2503(0x89,0xf4)]:_0x1c2503(0x10b,0x9d),0x0,_0x2de871)};}}async['deleteBucket'](_0x1ec82f){function _0x101a06(_0x5f37b0,_0x5561dc){return _0x591a(_0x5f37b0- -0x272,_0x5561dc);}try{const response=await this[_0x101a06(-0xb5,-0x6e)][_0x101a06(-0x71,-0x51)](_0x101a06(-0xaf,-0xfc)+_0x1ec82f);return{'data':response['data'],'error':null};}catch(_0xbe31b7){return{'data':null,'error':_0xbe31b7 instanceof EBaaSError?_0xbe31b7:new EBaaSError(_0xbe31b7 instanceof Error?_0xbe31b7['message']:_0x101a06(-0xcc,-0x73),0x0,_0xbe31b7)};}}async[_0x4a3cb3(-0x31,-0x1f)](){function _0x22d09b(_0x1445e5,_0x52c6bb){return _0x591a(_0x1445e5-0x2bc,_0x52c6bb);}try{const response=await this['httpClient']['get'](_0x22d09b(0x4ab,0x443));return{'data':response[_0x22d09b(0x4af,0x4f6)],'error':null};}catch(_0x22d3b8){return{'data':null,'error':_0x22d3b8 instanceof EBaaSError?_0x22d3b8:new EBaaSError(_0x22d3b8 instanceof Error?_0x22d3b8[_0x22d09b(0x44a,0x3da)]:'Failed\x20to\x20get\x20storage\x20usage',0x0,_0x22d3b8)};}}}class RealtimeChannel extends _0x1d3f4d{constructor(_0x3d8518,_0x20fdfb){super(),this[_0x40198b(-0x140,-0x163)]=![],this['state']=_0x40198b(-0x119,-0x191),this['subscriptions']=new Map();function _0x40198b(_0x603ece,_0x26242b){return _0x591a(_0x603ece- -0x2c7,_0x26242b);}this['topic']=_0x3d8518,this['socket']=_0x20fdfb;}[_0x4a3cb3(0x62,0x10)](_0x5bf733){!this[_0x113604(-0x10e,-0x158)]&&(this['joinedOnce']=!![],this[_0x113604(-0x71,-0x79)]());_0x5bf733&&this['on']('status',_0x5bf733);function _0x113604(_0x396179,_0x2bde35){return _0x591a(_0x396179- -0x295,_0x2bde35);}return this;}[_0x4a3cb3(0xef,0x82)](filter,_0x31c88f){const _0x45fae6='postgres_changes:'+JSON[_0x21038b(-0x14d,-0xe7)](filter);super['on'](_0x45fae6,_0x31c88f);const _0x19c460={'unsubscribe':()=>{super['off'](_0x45fae6,_0x31c88f);function _0x1c855d(_0xb11632,_0xe8cf6a){return _0x591a(_0xe8cf6a- -0xf6,_0xb11632);}this['subscriptions'][_0x1c855d(0x92,0x10b)](_0x45fae6);}};this['subscriptions'][_0x21038b(-0x205,-0x263)](_0x45fae6,_0x19c460);this[_0x21038b(-0x142,-0x190)]?.[_0x21038b(-0x219,-0x1e0)]&&this['state']===_0x21038b(-0x216,-0x264)&&this[_0x21038b(-0x142,-0x17f)][_0x21038b(-0x21b,-0x1e9)](_0x21038b(-0x21a,-0x218),{'topic':this[_0x21038b(-0x1ee,-0x258)],'filter':filter,'ref':this['makeRef']()});function _0x21038b(_0xd8d5c3,_0x4c5b62){return _0x591a(_0xd8d5c3- -0x385,_0x4c5b62);}return _0x19c460;}['onBroadcast'](filter,_0x334e81){const _0x2b7c05='broadcast:'+JSON['stringify'](filter);function _0x1a2bb3(_0x3093a3,_0x4a14a5){return _0x591a(_0x4a14a5-0x396,_0x3093a3);}super['on'](_0x2b7c05,_0x334e81);const _0x4e4c16={'unsubscribe':()=>{super['off'](_0x2b7c05,_0x334e81),this['subscriptions']['delete'](_0x2b7c05);}};return this[_0x1a2bb3(0x5e1,0x5eb)][_0x1a2bb3(0x4c5,0x516)](_0x2b7c05,_0x4e4c16),_0x4e4c16;}[_0x4a3cb3(0xc,0x86)](filter,_0x47897e){function _0x204b3a(_0x11e78e,_0x4abfb1){return _0x591a(_0x11e78e- -0xf4,_0x4abfb1);}const _0x1fc085='presence:'+JSON[_0x204b3a(0x144,0x123)](filter);super['on'](_0x1fc085,_0x47897e);const _0x9796f3={'unsubscribe':()=>{super['off'](_0x1fc085,_0x47897e);function _0x9970b5(_0x37d2a5,_0x5939a4){return _0x591a(_0x5939a4- -0x1b4,_0x37d2a5);}this['subscriptions'][_0x9970b5(0x27,0x4d)](_0x1fc085);}};return this[_0x204b3a(0x161,0x1c8)]['set'](_0x1fc085,_0x9796f3),_0x9796f3;}['send'](_0x2425ab){return new Promise(_0x4d5a2b=>{function _0x81ec38(_0x1ed24a,_0x41cf55){return _0x591a(_0x1ed24a- -0x227,_0x41cf55);}this[_0x81ec38(0x1c,-0xa)]?.[_0x81ec38(-0xbb,-0xb6)]&&this[_0x81ec38(-0x2,0x6e)]==='joined'?(this['socket'][_0x81ec38(-0xbd,-0x4c)](_0x81ec38(0x7,0x3a),{'topic':this[_0x81ec38(-0x90,-0x1a)],'event':_0x2425ab[_0x81ec38(-0x2b,-0x42)],'payload':_0x2425ab,'ref':this['makeRef']()}),_0x4d5a2b('ok')):_0x4d5a2b('error');});}[_0x4a3cb3(0x13,0x49)](_0x4f414f){return new Promise(_0x1184a0=>{function _0x5a21ee(_0x1b9940,_0x3017dd){return _0x591a(_0x3017dd- -0x2a,_0x1b9940);}this['socket']?.['connected']&&this[_0x5a21ee(0x227,0x1fb)]===_0x5a21ee(0x160,0x145)?(this['socket'][_0x5a21ee(0x194,0x140)](_0x5a21ee(0x1ed,0x21d),{'topic':this['topic'],'event':'track','payload':_0x4f414f,'ref':this['makeRef']()}),_0x1184a0('ok')):_0x1184a0('error');});}['untrack'](){return new Promise(_0x52636e=>{function _0x4e8bf8(_0x2cea75,_0x295743){return _0x591a(_0x2cea75-0x285,_0x295743);}this['socket']?.['connected']&&this[_0x4e8bf8(0x4aa,0x503)]==='joined'?(this[_0x4e8bf8(0x4c8,0x4a9)][_0x4e8bf8(0x3ef,0x420)](_0x4e8bf8(0x4cc,0x4c1),{'topic':this['topic'],'event':'untrack','ref':this['makeRef']()}),_0x52636e('ok')):_0x52636e('error');});}['unsubscribe'](){return new Promise(_0x54d6ab=>{this[_0x464956(0xa9,0xe8)]=_0x464956(-0x1f,-0x9);function _0x464956(_0x55d50e,_0x4d6c11){return _0x591a(_0x55d50e- -0x17c,_0x4d6c11);}this[_0x464956(0xd9,0x74)]['forEach'](_0xc2df14=>{_0xc2df14['unsubscribe']();}),this['subscriptions'][_0x464956(0xd1,0xa3)](),this['socket']?.[_0x464956(-0x10,-0x31)]&&this[_0x464956(0xc7,0x10a)]['emit'](_0x464956(0x15,0x2c),{'topic':this['topic'],'ref':this['makeRef']()}),this['state']='closed',this[_0x464956(0xa,0x16)](),_0x54d6ab('ok');});}['_join'](){function _0x1a38dd(_0x1aecbf,_0x97070c){return _0x591a(_0x1aecbf-0x32c,_0x97070c);}if(this['state']===_0x1a38dd(0x489,0x45a))return;this[_0x1a38dd(0x551,0x531)]=_0x1a38dd(0x56a,0x585),this['socket']?.['connected']&&(this[_0x1a38dd(0x56f,0x54d)][_0x1a38dd(0x496,0x463)]('join',{'topic':this[_0x1a38dd(0x4c3,0x4bd)],'ref':this['makeRef']()}),setTimeout(()=>{function _0xe9f99f(_0x15fe40,_0x4a73b0){return _0x591a(_0x15fe40- -0x3c3,_0x4a73b0);}this[_0xe9f99f(-0x19e,-0x1f5)]==='joining'&&(this['state']='joined',this[_0xe9f99f(-0x259,-0x237)]('status','SUBSCRIBED'));},0x64));}[_0x4a3cb3(0xcc,0x69)](){function _0x1db97c(_0x4bc98f,_0x53f522){return _0x591a(_0x4bc98f-0x69,_0x53f522);}this[_0x1db97c(0x1f0,0x224)]&&(this['_join'](),this[_0x1db97c(0x2be,0x323)]['forEach']((_0x3b65ff,_0xda020b)=>{function _0x23195b(_0x2abc32,_0x593471){return _0x591a(_0x2abc32-0x209,_0x593471);}if(_0xda020b['startsWith']('postgres_changes:')){const filter=JSON[_0x23195b(0x43b,0x408)](_0xda020b['replace'](_0x23195b(0x3c9,0x365),''));this['socket']?.['emit'](_0x23195b(0x374,0x35e),{'topic':this[_0x23195b(0x3a0,0x374)],'filter':filter,'ref':this[_0x23195b(0x3d8,0x404)]()});}}));}['_trigger'](_0x50d627,_0x3f4da0){function _0x415509(_0x1fc35d,_0x11776){return _0x591a(_0x1fc35d- -0xca,_0x11776);}if(_0x50d627===_0x415509(0x18a,0x121)){const _0x1f8d39=_0x415509(0xf6,0x166)+JSON[_0x415509(0x16e,0x1dc)](_0x3f4da0['filter']||{});this['emit'](_0x1f8d39,_0x3f4da0);}else{if(_0x50d627==='broadcast'){const _0x2a5a31='broadcast:'+JSON['stringify']({'event':_0x3f4da0['event']});this['emit'](_0x2a5a31,_0x3f4da0);}else{if(_0x50d627===_0x415509(0x17d,0x180)){const _0x210a26='presence:'+JSON['stringify']({'event':_0x3f4da0['event']});this['emit'](_0x210a26,_0x3f4da0);}}}this[_0x415509(0xa0,0xa6)](_0x50d627,_0x3f4da0);}[_0x4a3cb3(-0x31,-0x2a)](_0x21f46c){function _0x529274(_0x32237a,_0x1a5c5c){return _0x591a(_0x1a5c5c- -0x3a1,_0x32237a);}this[_0x529274(-0x164,-0x17c)]=_0x21f46c;let status;switch(_0x21f46c){case'joined':status='SUBSCRIBED';break;case _0x529274(-0x130,-0x16c):status=_0x529274(-0x12e,-0x165);break;case'closed':status='CLOSED';break;default:return;}this[_0x529274(-0x2a1,-0x237)]('status',status);}[_0x4a3cb3(0x52,0x35)](){function _0x6fb033(_0x1d1eeb,_0x54d033){return _0x591a(_0x54d033-0x206,_0x1d1eeb);}return Math[_0x6fb033(0x42c,0x3c2)]()[_0x6fb033(0x37b,0x3a9)](0x24)['substring'](0x2,0xf);}['getState'](){return this['state'];}}class RealtimeClient{constructor(_0x53e6ee,_0x3476fb,_0x4857bc={}){function _0x46143f(_0x2cdd6c,_0xc62269){return _0x591a(_0xc62269- -0x68,_0x2cdd6c);}this['socket']=null,this['channels']=new Map(),this['connectionState']='disconnected',this[_0x46143f(0x176,0x159)]=0x0,this['maxReconnectAttempts']=0x5,this['url']=_0x53e6ee,this['apiKey']=_0x3476fb,this['options']={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x4857bc};}[_0x4a3cb3(-0x80,-0x6)](){return new Promise((_0x2ac9e9,_0x4127a5)=>{if(this[_0x2845be(-0x191,-0x198)]?.[_0x2845be(-0x268,-0x254)]){_0x2ac9e9();return;}this['connectionState']='connecting',this[_0x2845be(-0x191,-0x1e2)]=io(this[_0x2845be(-0x21a,-0x1dd)],{'auth':{'apikey':this['apiKey']},'transports':['websocket'],'reconnection':!![],'reconnectionDelay':this['options']['reconnectInterval'],'reconnectionAttempts':this['options'][_0x2845be(-0x223,-0x24d)],...this[_0x2845be(-0x1e7,-0x1e2)][_0x2845be(-0x228,-0x237)]}),this['socket']['on']('connect',()=>{function _0x1250da(_0x4fdf78,_0x5f17e6){return _0x591a(_0x5f17e6- -0xb3,_0x4fdf78);}this['connectionState']='connected',this[_0x1250da(0xc8,0x10e)]=0x0,this['setupHeartbeat'](),_0x2ac9e9();});function _0x2845be(_0x530821,_0x13a244){return _0x591a(_0x530821- -0x3d4,_0x13a244);}this['socket']['on']('disconnect',_0x2b76a1=>{function _0x35289a(_0x2f0dc7,_0x4fb9f8){return _0x591a(_0x2f0dc7- -0x36,_0x4fb9f8);}this[_0x35289a(0x17e,0x10d)]='disconnected',this[_0x35289a(0x1d4,0x19b)][_0x35289a(0x1ce,0x1ff)](channel=>{function _0x3fab22(_0x2d75ed,_0x51b182){return _0x591a(_0x51b182- -0x180,_0x2d75ed);}channel[_0x3fab22(-0x7a,-0x10)](_0x3fab22(-0x15,0x2e));});}),this['socket']['on'](_0x2845be(-0x1bb,-0x229),_0x9303cf=>{this[_0x109237(-0x71,-0xe7)]=_0x109237(-0x49,0x27),this[_0x109237(-0x64,-0x8e)]++;function _0x109237(_0x6f8242,_0x116ed6){return _0x591a(_0x6f8242- -0x225,_0x116ed6);}this['reconnectAttempts']>=this[_0x109237(-0x74,-0xd)]&&_0x4127a5(new Error(_0x109237(-0x57,-0xb)+this['maxReconnectAttempts']+'\x20attempts:\x20'+_0x9303cf['message']));}),this['socket']['on']('reconnect',()=>{this[_0x24d3d1(0x470,0x4cc)]=_0x24d3d1(0x450,0x484),this['reconnectAttempts']=0x0;function _0x24d3d1(_0x5cee91,_0x2559ce){return _0x591a(_0x2559ce-0x318,_0x5cee91);}this[_0x24d3d1(0x4ac,0x522)][_0x24d3d1(0x588,0x51c)](channel=>{channel['_rejoin']();});}),this[_0x2845be(-0x191,-0x206)]['on'](_0x2845be(-0x180,-0x192),_0x2bb3de=>{const channel=this[_0x517301(0x313,0x38b)]['get'](_0x2bb3de['topic']);function _0x517301(_0x48ad05,_0x45b942){return _0x591a(_0x48ad05-0x109,_0x45b942);}channel&&channel[_0x517301(0x30b,0x349)]('postgres_changes',_0x2bb3de);}),this[_0x2845be(-0x191,-0x12c)]['on'](_0x2845be(-0x1a6,-0x1e2),_0x2140bb=>{const channel=this['channels'][_0x5a14b9(0x81,0x2c)](_0x2140bb[_0x5a14b9(-0x69,-0x9)]);function _0x5a14b9(_0x1da8df,_0x1b51a9){return _0x591a(_0x1b51a9- -0x1a0,_0x1da8df);}channel&&channel['_trigger']('broadcast',_0x2140bb);}),this[_0x2845be(-0x191,-0x1b9)]['on'](_0x2845be(-0x18d,-0x185),_0x203338=>{const channel=this[_0x1401ac(-0x11c,-0x133)]['get'](_0x203338['topic']);function _0x1401ac(_0x17f154,_0x3c0788){return _0x591a(_0x3c0788- -0x33d,_0x17f154);}channel&&channel[_0x1401ac(-0x114,-0x13b)](_0x1401ac(-0x13c,-0xf6),_0x203338);});});}['disconnect'](){this[_0x12008f(0x3f6,0x428)]&&(this[_0x12008f(0x3f6,0x411)]['disconnect'](),this['socket']=null);this['connectionState']=_0x12008f(0x3f5,0x453);function _0x12008f(_0x69c35f,_0x29deac){return _0x591a(_0x69c35f-0x1b3,_0x29deac);}this['channels']['clear']();}[_0x4a3cb3(0x51,0x7)](_0x32ee42){function _0x4afe22(_0x214391,_0x3eb626){return _0x591a(_0x214391-0x2f,_0x3eb626);}if(this[_0x4afe22(0x239,0x205)]['has'](_0x32ee42))return this['channels']['get'](_0x32ee42);const channel=new RealtimeChannel(_0x32ee42,this[_0x4afe22(0x272,0x24a)]);return this[_0x4afe22(0x239,0x2a7)][_0x4afe22(0x1af,0x156)](_0x32ee42,channel),this[_0x4afe22(0x1e3,0x1cb)]===_0x4afe22(0x19b,0x1df)&&channel['_join'](),channel;}[_0x4a3cb3(0xa4,0x3c)](channel){const _0x19bd52=channel[_0x38b209(0x34e,0x351)];function _0x38b209(_0x8697a0,_0x55b81f){return _0x591a(_0x55b81f-0x1ba,_0x8697a0);}this[_0x38b209(0x428,0x3c4)]['has'](_0x19bd52)&&(this[_0x38b209(0x432,0x3c4)]['delete'](_0x19bd52),channel['unsubscribe']());}['removeAllChannels'](){function _0x1c288b(_0x1bf6b6,_0x6187f8){return _0x591a(_0x1bf6b6-0xba,_0x6187f8);}this[_0x1c288b(0x2c4,0x2c8)]['forEach'](channel=>{channel['unsubscribe']();}),this[_0x1c288b(0x2c4,0x2bb)][_0x1c288b(0x307,0x2f0)]();}['getChannels'](){function _0xa895e3(_0x2ab752,_0x299812){return _0x591a(_0x2ab752-0x167,_0x299812);}return Array[_0xa895e3(0x33f,0x2c7)](this[_0xa895e3(0x371,0x315)][_0xa895e3(0x39d,0x3a9)]());}[_0x4a3cb3(0x4d,0x8c)](){function _0x2d1b5e(_0x490ee8,_0x5bdf4f){return _0x591a(_0x5bdf4f-0x106,_0x490ee8);}return this[_0x2d1b5e(0x28f,0x2ba)]==='connected'&&!!this['socket']?.['connected'];}[_0x4a3cb3(0x87,0x8f)](){return this['connectionState'];}['onConnectionStateChange'](_0x3de661){function _0x54834f(_0x108b07,_0x4f6ec9){return _0x591a(_0x108b07- -0x351,_0x4f6ec9);}const _0x21c60e=()=>_0x3de661(this['connectionState']);return this['socket']&&(this[_0x54834f(-0x10e,-0xbd)]['on'](_0x54834f(-0x1bd,-0x1be),()=>{this['connectionState']='connected',_0x21c60e();}),this['socket']['on'](_0x54834f(-0x143,-0x11d),()=>{this['connectionState']='disconnected',_0x21c60e();}),this['socket']['on'](_0x54834f(-0x138,-0x138),()=>{this['connectionState']='error',_0x21c60e();})),()=>{function _0x1d532c(_0x1efb16,_0x17b9e3){return _0x591a(_0x17b9e3- -0x1e8,_0x1efb16);}this[_0x1d532c(0x7a,0x5b)]&&(this[_0x1d532c(0x78,0x5b)]['off']('connect',_0x21c60e),this[_0x1d532c(0x9a,0x5b)][_0x1d532c(-0x63,0xd)](_0x1d532c(-0x1,0x26),_0x21c60e),this['socket'][_0x1d532c(-0x58,0xd)]('connect_error',_0x21c60e));};}[_0x4a3cb3(-0x3e,-0x1e)](){if(!this['options'][_0x262125(-0xf0,-0x169)]||!this['socket'])return;function _0x262125(_0x1a9310,_0x317aa3){return _0x591a(_0x1a9310- -0x330,_0x317aa3);}const interval=setInterval(()=>{function _0x596f17(_0x427a2a,_0x17e0a5){return _0x591a(_0x17e0a5-0x1bc,_0x427a2a);}this['socket']?.[_0x596f17(0x315,0x328)]?this['socket']['emit'](_0x596f17(0x41e,0x3f5),{'timestamp':Date['now']()}):clearInterval(interval);},this[_0x262125(-0x143,-0x1a0)][_0x262125(-0xf0,-0xb2)]);}['_getSocket'](){return this['socket'];}}function _0x4a3cb3(_0x24ccbd,_0x41610c){return _0x591a(_0x41610c- -0x19a,_0x24ccbd);}class FunctionsClient{constructor(_0x184c4c){function _0x1c8f64(_0x1ac3fa,_0x4fe131){return _0x591a(_0x1ac3fa-0x6b,_0x4fe131);}this[_0x1c8f64(0x228,0x1fe)]=_0x184c4c;}async['invoke'](_0xdf24a1,_0x4668fd){function _0xeb4c2e(_0x556d31,_0x1c1d5e){return _0x591a(_0x1c1d5e- -0x8b,_0x556d31);}try{const _0x469da4=_0x4668fd?.['method']||'POST',headers={'Content-Type':'application/json',..._0x4668fd?.['headers']};let response;const _0x31b2f5='/functions/v1/'+_0xdf24a1;switch(_0x469da4['toUpperCase']()){case'GET':response=await this[_0xeb4c2e(0x16e,0x132)][_0xeb4c2e(0x13a,0x141)](_0x31b2f5,{'headers':headers,'params':_0x4668fd?.['body']});break;case'POST':response=await this['httpClient'][_0xeb4c2e(0x17e,0x1c1)](_0x31b2f5,_0x4668fd?.['body'],{'headers':headers});break;case'PUT':response=await this[_0xeb4c2e(0x18d,0x132)]['put'](_0x31b2f5,_0x4668fd?.[_0xeb4c2e(0x1ba,0x148)],{'headers':headers});break;case'PATCH':response=await this['httpClient'][_0xeb4c2e(0x116,0x127)](_0x31b2f5,_0x4668fd?.[_0xeb4c2e(0x131,0x148)],{'headers':headers});break;case'DELETE':response=await this['httpClient']['delete'](_0x31b2f5,{'headers':headers,'data':_0x4668fd?.['body']});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x469da4,0x190);}return{'data':response['data'],'error':null};}catch(_0x3cd829){return{'data':null,'error':_0x3cd829 instanceof EBaaSError?_0x3cd829:new EBaaSError(_0x3cd829 instanceof Error?_0x3cd829[_0xeb4c2e(0x13f,0x103)]:'Function\x20invocation\x20failed',0x0,_0x3cd829)};}}async['list'](){function _0x52fd96(_0xf0e57b,_0x273d65){return _0x591a(_0xf0e57b- -0x2bf,_0x273d65);}try{const response=await this['httpClient']['get']('/functions/v1');return{'data':response[_0x52fd96(-0xcc,-0x7e)],'error':null};}catch(_0x614b9d){return{'data':null,'error':_0x614b9d instanceof EBaaSError?_0x614b9d:new EBaaSError(_0x614b9d instanceof Error?_0x614b9d['message']:'Failed\x20to\x20list\x20functions',0x0,_0x614b9d)};}}async['get'](_0x83b10b){function _0x30e6de(_0x4efd8e,_0x5df47e){return _0x591a(_0x4efd8e- -0x21d,_0x5df47e);}try{const response=await this[_0x30e6de(-0x60,-0xaf)][_0x30e6de(-0x51,-0xba)](_0x30e6de(-0x6a,-0x1d)+_0x83b10b+'/info');return{'data':response[_0x30e6de(-0x2a,-0x7f)],'error':null};}catch(_0x49a6d2){return{'data':null,'error':_0x49a6d2 instanceof EBaaSError?_0x49a6d2:new EBaaSError(_0x49a6d2 instanceof Error?_0x49a6d2[_0x30e6de(-0x8f,-0xe8)]:'Failed\x20to\x20get\x20function',0x0,_0x49a6d2)};}}async[_0x4a3cb3(-0x3c,0x1c)](_0x29b25f,_0x3b7271){function _0x5ea596(_0x235645,_0x1f9e3f){return _0x591a(_0x235645- -0x121,_0x1f9e3f);}try{const _0x584649=new FormData();if(_0x3b7271[_0x5ea596(0x75,0x2c)]instanceof File)_0x584649[_0x5ea596(0x124,0x19d)]('code',_0x3b7271[_0x5ea596(0x75,0xc)]);else typeof _0x3b7271[_0x5ea596(0x75,0x25)]===_0x5ea596(0x107,0x129)&&_0x584649[_0x5ea596(0x124,0xec)](_0x5ea596(0x75,0x98),new Blob([_0x3b7271['code']],{'type':_0x5ea596(0x10c,0x130)}),'index.ts');_0x3b7271['entrypoint']&&_0x584649['append'](_0x5ea596(0xe6,0x6e),_0x3b7271[_0x5ea596(0xe6,0x75)]);_0x3b7271[_0x5ea596(0x102,0xea)]&&_0x584649['append'](_0x5ea596(0x102,0x135),JSON[_0x5ea596(0x117,0x121)](_0x3b7271[_0x5ea596(0x102,0x174)]));_0x3b7271[_0x5ea596(0x51,0xc8)]&&_0x584649['append']('importMap',JSON['stringify'](_0x3b7271['importMap']));_0x3b7271[_0x5ea596(0x132,0xc7)]!==undefined&&_0x584649[_0x5ea596(0x124,0x144)](_0x5ea596(0x132,0x155),String(_0x3b7271['verify']));const response=await this[_0x5ea596(0x9c,0x5b)][_0x5ea596(0x12b,0x102)]('/functions/v1/'+_0x29b25f+'/deploy',_0x584649,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response['data'],'error':null};}catch(_0x57fa68){return{'data':null,'error':_0x57fa68 instanceof EBaaSError?_0x57fa68:new EBaaSError(_0x57fa68 instanceof Error?_0x57fa68[_0x5ea596(0x6d,-0x6)]:'Failed\x20to\x20deploy\x20function',0x0,_0x57fa68)};}}async[_0x4a3cb3(0xae,0x67)](_0x196f4c){function _0x177972(_0x26a151,_0x4732fe){return _0x591a(_0x4732fe-0x1d6,_0x26a151);}try{const response=await this['httpClient']['delete']('/functions/v1/'+_0x196f4c);return{'data':response['data'],'error':null};}catch(_0x1e6d06){return{'data':null,'error':_0x1e6d06 instanceof EBaaSError?_0x1e6d06:new EBaaSError(_0x1e6d06 instanceof Error?_0x1e6d06[_0x177972(0x377,0x364)]:'Failed\x20to\x20delete\x20function',0x0,_0x1e6d06)};}}async[_0x4a3cb3(-0x21,-0x26)](_0x272057,_0x2f8384){function _0x341d9b(_0x443da1,_0x2207b1){return _0x591a(_0x2207b1- -0x110,_0x443da1);}try{const response=await this['httpClient']['put']('/functions/v1/'+_0x272057+_0x341d9b(0x90,0xb9),{'env':_0x2f8384});return{'data':response['data'],'error':null};}catch(_0x391b92){return{'data':null,'error':_0x391b92 instanceof EBaaSError?_0x391b92:new EBaaSError(_0x391b92 instanceof Error?_0x391b92['message']:_0x341d9b(0x12c,0x124),0x0,_0x391b92)};}}async[_0x4a3cb3(0x80,0x85)](_0x2ed575,_0x2663cb){function _0x1e4f9e(_0x2b22c4,_0x4dcfe8){return _0x591a(_0x4dcfe8- -0x1f9,_0x2b22c4);}try{const _0x6757db=new URLSearchParams();_0x2663cb?.[_0x1e4f9e(0x26,0x1f)]&&_0x6757db['append'](_0x1e4f9e(0x48,0x1f),String(_0x2663cb[_0x1e4f9e(-0x5b,0x1f)]));_0x2663cb?.[_0x1e4f9e(0xc,-0x3a)]&&_0x6757db[_0x1e4f9e(0x34,0x4c)](_0x1e4f9e(-0x75,-0x3a),String(_0x2663cb['offset']));_0x2663cb?.[_0x1e4f9e(-0x65,-0x6e)]&&_0x6757db[_0x1e4f9e(0x85,0x4c)](_0x1e4f9e(-0xd8,-0x6e),_0x2663cb[_0x1e4f9e(-0x3e,-0x6e)]);const _0x4e9ea7='/functions/v1/'+_0x2ed575+_0x1e4f9e(-0x89,-0x5b)+(_0x6757db[_0x1e4f9e(0x25,-0x56)]()?'?'+_0x6757db['toString']():''),response=await this['httpClient'][_0x1e4f9e(0x8,-0x2d)](_0x4e9ea7);return{'data':response[_0x1e4f9e(-0x7c,-0x6)],'error':null};}catch(_0x3f320f){return{'data':null,'error':_0x3f320f instanceof EBaaSError?_0x3f320f:new EBaaSError(_0x3f320f instanceof Error?_0x3f320f['message']:'Failed\x20to\x20get\x20function\x20logs',0x0,_0x3f320f)};}}async[_0x4a3cb3(0x7,-0x2)](_0x6e1416,_0x23eb00){function _0x4802c5(_0x346338,_0x55e37e){return _0x591a(_0x55e37e- -0x2bd,_0x346338);}try{const _0x12a716=new URLSearchParams();_0x23eb00?.['period']&&_0x12a716['append']('period',_0x23eb00[_0x4802c5(-0x117,-0xdf)]);const _0x3a91aa='/functions/v1/'+_0x6e1416+'/metrics'+(_0x12a716['toString']()?'?'+_0x12a716['toString']():''),response=await this['httpClient'][_0x4802c5(-0x8d,-0xf1)](_0x3a91aa);return{'data':response[_0x4802c5(-0x9d,-0xca)],'error':null};}catch(_0x41de00){return{'data':null,'error':_0x41de00 instanceof EBaaSError?_0x41de00:new EBaaSError(_0x41de00 instanceof Error?_0x41de00[_0x4802c5(-0x10c,-0x12f)]:_0x4802c5(-0x139,-0xc7),0x0,_0x41de00)};}}}class EBaaSClient{constructor(_0x4c2c14,_0x1323ff,_0x530412){this['options']=_0x530412,this[_0x515f9d(-0x252,-0x1e1)]=new HttpClient({'url':_0x4c2c14,'apiKey':_0x1323ff,'timeout':0x7530,'headers':_0x530412?.['global']?.[_0x515f9d(-0x199,-0x1b7)]}),this[_0x515f9d(-0x235,-0x1ca)]=new AuthClient(this[_0x515f9d(-0x185,-0x1e1)],_0x530412?.['database']?.[_0x515f9d(-0x267,-0x20e)]),this['database']=new DatabaseClient(this['httpClient'],_0x530412?.['database']?.['workspaceId']),this[_0x515f9d(-0x1c1,-0x21a)]=new StorageClient(this['httpClient']),this['realtime']=new RealtimeClient(_0x4c2c14,_0x1323ff,_0x530412?.['realtime']);function _0x515f9d(_0x4a16e6,_0x1b34cb){return _0x591a(_0x1b34cb- -0x39e,_0x4a16e6);}this['functions']=new FunctionsClient(this[_0x515f9d(-0x1f2,-0x1e1)]),this[_0x515f9d(-0x1df,-0x1fa)]();}[_0x4a3cb3(0xaa,0x3e)](_0xae7ac2){return this['database']['from'](_0xae7ac2);}[_0x4a3cb3(0xa4,0xaa)](_0x1044b7,_0x46fd6d){function _0x161b97(_0x249ab1,_0xbef0b3){return _0x591a(_0x249ab1-0x17e,_0xbef0b3);}return this[_0x161b97(0x2f4,0x304)]['rpc'](_0x1044b7,_0x46fd6d);}[_0x4a3cb3(-0x93,-0x3a)](_0x4ce810){function _0x44ccab(_0x43786b,_0x1c0cdd){return _0x591a(_0x43786b- -0x35,_0x1c0cdd);}return this['storage'][_0x44ccab(0x1a3,0x136)](_0x4ce810);}[_0x4a3cb3(-0x56,0x7)](_0x52d8a8){function _0x2c3ef8(_0x565875,_0x1907f3){return _0x591a(_0x565875-0x12b,_0x1907f3);}return this[_0x2c3ef8(0x2ef,0x333)]['channel'](_0x52d8a8);}['invoke'](_0x4bbc7d,_0x3a64df){return this['functions']['invoke'](_0x4bbc7d,_0x3a64df);}async['initializeCustomDatabase'](){function _0x45b92b(_0x2973f6,_0x493284){return _0x591a(_0x2973f6- -0x3e6,_0x493284);}if(this['options']?.[_0x45b92b(-0x270,-0x24f)]?.[_0x45b92b(-0x269,-0x262)])try{await this[_0x45b92b(-0x270,-0x20f)]['initialize']();}catch(_0x71011b){console['warn']('Failed to initialize custom database detection:',_0x71011b);}}async[_0x4a3cb3(-0x8d,-0x20)](_0x415ba2){function _0x4b3f5e(_0x266577,_0x37d5b7){return _0x591a(_0x37d5b7-0x3a5,_0x266577);}this[_0x4b3f5e(0x553,0x579)][_0x4b3f5e(0x4ce,0x51f)](_0x415ba2),this[_0x4b3f5e(0x553,0x51b)][_0x4b3f5e(0x556,0x51f)](_0x415ba2),this[_0x4b3f5e(0x522,0x592)]?.[_0x4b3f5e(0x58a,0x51b)]?.[_0x4b3f5e(0x56a,0x522)]&&await this[_0x4b3f5e(0x559,0x51b)][_0x4b3f5e(0x553,0x58d)]();}async[_0x4a3cb3(0xa4,0x3d)](_0x125abd){function _0x4ddfdc(_0xeecf67,_0x45f54d){return _0x591a(_0x45f54d- -0x3d5,_0xeecf67);}await this[_0x4ddfdc(-0x2c2,-0x25f)][_0x4ddfdc(-0x21c,-0x1fe)](_0x125abd);}['getCustomDatabaseStatus'](){function _0x2823e6(_0x560c93,_0x2d4f9f){return _0x591a(_0x2d4f9f-0x1ee,_0x560c93);}return this['database'][_0x2823e6(0x3ad,0x37b)]();}}function createClient(_0x2b326b,_0xc52fee,_0xd1772f){return new EBaaSClient(_0x2b326b,_0xc52fee,_0xd1772f);}const version='1.0.0';export{AuthClient,CustomDatabaseManager,DatabaseClient,EBaaSClient,EBaaSError,FunctionsClient,HttpClient,QueryBuilder,RealtimeChannel,RealtimeClient,StorageBucket,StorageClient,createClient,version};