@e-techsolutions/e-baas-sdk 1.1.0 → 1.1.2

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){const stringArray=stringArrayFunction();function _0x3b9f25(_0x57425d,_0x294889){return _0x15c7(_0x294889- -0x1c7,_0x57425d);}while(!![]){try{const _0x1eabc7=-parseInt(_0x3b9f25(-0x97,-0x68))/0x1*(-parseInt(_0x3b9f25(-0xda,-0x9d))/0x2)+parseInt(_0x3b9f25(-0xa4,-0x120))/0x3*(-parseInt(_0x3b9f25(-0x90,-0x8a))/0x4)+-parseInt(_0x3b9f25(-0x93,-0xf4))/0x5*(parseInt(_0x3b9f25(-0xaf,-0x118))/0x6)+-parseInt(_0x3b9f25(-0xcf,-0xd4))/0x7+parseInt(_0x3b9f25(-0xd5,-0xa1))/0x8*(parseInt(_0x3b9f25(-0x109,-0x8d))/0x9)+-parseInt(_0x3b9f25(-0xb9,-0xe0))/0xa+-parseInt(_0x3b9f25(-0xf3,-0x92))/0xb*(-parseInt(_0x3b9f25(-0xb3,-0xe4))/0xc);if(_0x1eabc7===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x3329a8){stringArray['push'](stringArray['shift']());}}}(_0x4e83,0x6a09d));import axios from'axios';import{io}from'socket.io-client';import _0x2302e2 from'eventemitter3';class EBaaSError extends Error{constructor(_0x496580,status=0x0,_0x281dd9){function _0x33fa(_0x2266cd,_0x19d21e){return _0x15c7(_0x2266cd-0x282,_0x19d21e);}super(_0x496580),this['name']='EBaaSError',this[_0x33fa(0x327,0x2c6)]=status,this['details']=_0x281dd9,Error['captureStackTrace']&&Error[_0x33fa(0x39b,0x330)](this,EBaaSError);}['toJSON'](){function _0x4e9361(_0x3d79b9,_0x314776){return _0x15c7(_0x314776-0x238,_0x3d79b9);}return{'name':this['name'],'message':this['message'],'status':this['status'],'details':this[_0x4e9361(0x2ea,0x330)],'stack':this[_0x4e9361(0x35a,0x3c2)]};}['toString'](){function _0x4fcd7a(_0x3a6efe,_0x2adc1a){return _0x15c7(_0x2adc1a-0x100,_0x3a6efe);}return this['name']+':\x20'+this['message']+_0x4fcd7a(0x244,0x279)+this[_0x4fcd7a(0x1a7,0x1a5)]+')';}}class HttpClient{constructor(config){this['baseURL']=config['url'];function _0x431816(_0x5bb57c,_0x224f58){return _0x15c7(_0x5bb57c- -0x24a,_0x224f58);}this[_0x431816(-0x129,-0xee)]=config['apiKey'],this[_0x431816(-0xe5,-0xd1)]=axios[_0x431816(-0x17e,-0x126)]({'baseURL':this['baseURL'],'timeout':config['timeout']||0x2710,'headers':{'Content-Type':'application/json','apikey':this['apiKey'],...config['headers']}}),this[_0x431816(-0x12d,-0x193)]();}[_0x3e19e9(-0x183,-0x1a3)](){this['client'][_0x4753fd(-0x28e,-0x2cd)][_0x4753fd(-0x281,-0x269)][_0x4753fd(-0x2b8,-0x27f)](config=>{return config;},_0x139d2c=>{function _0x5dccc8(_0x77492f,_0x49a239){return _0x15c7(_0x49a239- -0x3cc,_0x77492f);}return Promise[_0x5dccc8(-0x22d,-0x278)](new EBaaSError('Request\x20failed',0x0,_0x139d2c));});function _0x4753fd(_0x2a4ef3,_0x369751){return _0x15c7(_0x369751- -0x3b2,_0x2a4ef3);}this['client'][_0x4753fd(-0x31e,-0x2cd)][_0x4753fd(-0x24a,-0x2b6)]['use'](response=>{return response;},_0xc04936=>{const status=_0xc04936[_0x177df8(0x317,0x393)]?.[_0x177df8(0x349,0x33c)]||0x0,_0x3b7ed5=_0xc04936['response']?.[_0x177df8(0x444,0x3c8)]?.['message']||_0xc04936['message']||'Unknown\x20error',_0x471f27=_0xc04936['response']?.['data']||_0xc04936;function _0x177df8(_0x28c5e3,_0x48450b){return _0x15c7(_0x48450b-0x297,_0x28c5e3);}return Promise['reject'](new EBaaSError(_0x3b7ed5,status,_0x471f27));});}async[_0x3e19e9(-0x201,-0x1e2)](_0x1bd50f,config){function _0x3441bb(_0x161a2a,_0x1013df){return _0x15c7(_0x1013df- -0xc2,_0x161a2a);}try{const response=await this[_0x3441bb(0x4b,0xa3)][_0x3441bb(0x38,-0x23)](_0x1bd50f,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x4df62f){throw this['handleError'](_0x4df62f);}}async[_0x3e19e9(-0x1c7,-0x1f9)](_0x13e0e6,data,config){function _0x34142b(_0x1526e2,_0x38bd89){return _0x15c7(_0x1526e2- -0x145,_0x38bd89);}try{const response=await this[_0x34142b(0x20,0x36)]['post'](_0x13e0e6,data,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x1d5eab){throw this['handleError'](_0x1d5eab);}}async[_0x3e19e9(-0x16a,-0x1c2)](_0x4f2e6a,data,config){function _0x227933(_0x5da9a4,_0x506bb3){return _0x15c7(_0x506bb3-0x1c0,_0x5da9a4);}try{const response=await this['client'][_0x227933(0x372,0x2f6)](_0x4f2e6a,data,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x2ebd4f){throw this['handleError'](_0x2ebd4f);}}async['patch'](_0x2e294a,data,config){function _0x570da7(_0x35757a,_0x446fc8){return _0x15c7(_0x35757a-0x1cd,_0x446fc8);}try{const response=await this['client']['patch'](_0x2e294a,data,config);return{'data':response['data'],'status':response['status'],'statusText':response[_0x570da7(0x2f1,0x331)],'headers':response[_0x570da7(0x305,0x2b2)]};}catch(_0x392a33){throw this[_0x570da7(0x356,0x350)](_0x392a33);}}async['delete'](_0x2c7b09,config){function _0x98a14f(_0x51195b,_0x24a2b5){return _0x15c7(_0x24a2b5-0x60,_0x51195b);}try{const response=await this[_0x98a14f(0x1ad,0x1c5)]['delete'](_0x2c7b09,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x526fcf){throw this[_0x98a14f(0x1b6,0x1e9)](_0x526fcf);}}[_0x3e19e9(-0x130,-0x171)](_0x3a2045){function _0x290f25(_0x18a3d8,_0x4fc80c){return _0x15c7(_0x4fc80c-0x39,_0x18a3d8);}this['client'][_0x290f25(0xbd,0xeb)][_0x290f25(0x17d,0x171)]['common']['Authorization']=_0x290f25(0x12e,0x179)+_0x3a2045;}['removeAuthToken'](){delete this['client']['defaults']['headers'][_0x5207ef(0x488,0x44f)]['Authorization'];function _0x5207ef(_0x1f18d4,_0x2e9301){return _0x15c7(_0x2e9301-0x35b,_0x1f18d4);}this['client'][_0x5207ef(0x3c0,0x40d)]['headers']['common']['Authorization']=_0x5207ef(0x4ce,0x49b)+this[_0x5207ef(0x432,0x47c)];}[_0x3e19e9(-0x117,-0xae)](_0x18f2a3){if(_0x18f2a3 instanceof EBaaSError)return _0x18f2a3;function _0x4b7a65(_0x2b4cdd,_0x34baed){return _0x15c7(_0x34baed-0x6d,_0x2b4cdd);}return new EBaaSError(_0x18f2a3[_0x4b7a65(0x156,0x183)]||_0x4b7a65(0x14a,0x15b),_0x18f2a3[_0x4b7a65(0x13b,0x112)]||0x0,_0x18f2a3);}}class AuthClient{constructor(_0x4580e9){this['currentSession']=null;function _0x125f2a(_0x51a980,_0x5eb108){return _0x15c7(_0x51a980- -0x24,_0x5eb108);}this[_0x125f2a(0xd9,0xb2)]=_0x4580e9,this['loadSession']();}async[_0x3e19e9(-0x149,-0x194)](data){function _0x566d62(_0x420d48,_0x28a87d){return _0x15c7(_0x28a87d- -0x15f,_0x420d48);}try{const response=await this[_0x566d62(-0x4,-0x62)]['post'](_0x566d62(0x4a,-0x19),data);return response['data']['session']&&this[_0x566d62(-0x1,-0x12)](response['data'][_0x566d62(-0xb9,-0x40)]),response['data'];}catch(_0x3bb3a2){throw this[_0x566d62(-0x17,0x17)](_0x3bb3a2);}}async['signIn'](data){function _0x2d811b(_0x5208a2,_0x1ec63a){return _0x15c7(_0x5208a2- -0x139,_0x1ec63a);}try{const response=await this['httpClient']['post']('/auth/v1/sdk/signin',data);return response['data'][_0x2d811b(-0x1a,0x4)]&&this[_0x2d811b(0x14,0x0)](response['data']['session']),response[_0x2d811b(-0x8,-0x58)];}catch(_0x4df79b){throw this[_0x2d811b(0x3d,-0x26)](_0x4df79b);}}async[_0x3e19e9(-0x139,-0x16b)](){function _0x31603a(_0x343c0a,_0xec041f){return _0x15c7(_0xec041f- -0x15d,_0x343c0a);}try{await this['httpClient'][_0x31603a(-0x8a,-0x84)](_0x31603a(-0xda,-0x68)),this['clearSession']();}catch(_0x16c2ba){this['clearSession']();throw this['handleAuthError'](_0x16c2ba);}}async['getUser'](){function _0x45a53c(_0x3ca950,_0x5972c9){return _0x15c7(_0x5972c9- -0x109,_0x3ca950);}if(!this[_0x45a53c(-0x3c,0xa)]?.[_0x45a53c(0x24,0x53)])return null;try{const response=await this['httpClient'][_0x45a53c(-0x92,-0x6a)](_0x45a53c(0xc,-0x21));return response[_0x45a53c(-0x49,0x28)]['user'];}catch(_0x15673e){if(_0x15673e instanceof EBaaSError&&_0x15673e['status']===0x191)return this['clearSession'](),null;throw this[_0x45a53c(0x53,0x6d)](_0x15673e);}}async[_0x3e19e9(-0x1be,-0x1a7)](){if(!this['currentSession']?.['refresh_token'])return null;function _0x366239(_0x3e0bd7,_0xd93996){return _0x15c7(_0xd93996- -0xd,_0x3e0bd7);}try{const response=await this['httpClient']['post']('/auth/v1/refresh',{'refresh_token':this['currentSession'][_0x366239(0x78,0xb5)]});if(response[_0x366239(0x122,0x124)][_0x366239(0x162,0x112)])return this['setSession'](response['data'][_0x366239(0xd4,0x112)]),response['data']['session'];return null;}catch(_0x164c6e){this['clearSession']();throw this[_0x366239(0x154,0x169)](_0x164c6e);}}async[_0x3e19e9(-0x175,-0x1e2)](_0x4169b7){function _0x2946a(_0x18a0eb,_0x443a18){return _0x15c7(_0x443a18-0x210,_0x18a0eb);}try{await this[_0x2946a(0x2e4,0x30d)][_0x2946a(0x2c5,0x2e9)]('/auth/v1/reset-password',{'email':_0x4169b7});}catch(_0x143698){throw this[_0x2946a(0x3da,0x386)](_0x143698);}}async[_0x3e19e9(-0x162,-0x1c5)](data){function _0x3ef5d9(_0x1c9080,_0x27547b){return _0x15c7(_0x27547b- -0x1e1,_0x1c9080);}try{const response=await this[_0x3ef5d9(-0x159,-0xe4)]['put']('/auth/v1/user',data);return response[_0x3ef5d9(-0x113,-0xb0)][_0x3ef5d9(-0x10f,-0xe1)];}catch(_0x2694ad){throw this['handleAuthError'](_0x2694ad);}}[_0x3e19e9(-0x1e8,-0x1ed)](){function _0x2e3f59(_0xe12d52,_0xa7e752){return _0x15c7(_0xe12d52-0x3c5,_0xa7e752);}return this[_0x2e3f59(0x4d8,0x4fd)];}['setSession'](_0x230e17){this[_0x5b2dc0(-0x9c,-0xcd)]=_0x230e17,this['httpClient']['setAuthToken'](_0x230e17[_0x5b2dc0(-0x8b,-0x84)]);function _0x5b2dc0(_0x120728,_0x3f911d){return _0x15c7(_0x3f911d- -0x1e0,_0x120728);}typeof localStorage!=='undefined'&&localStorage['setItem'](_0x5b2dc0(-0x122,-0x130),JSON[_0x5b2dc0(-0x85,-0x7a)](_0x230e17));}['onAuthStateChange'](_0x1d90ac){return()=>{};}['setSessionInternal'](_0x41c0d0){this['currentSession']=_0x41c0d0,this[_0x2621bd(-0x118,-0x143)][_0x2621bd(-0x108,-0xd0)](_0x41c0d0['access_token']);function _0x2621bd(_0x474f7b,_0x213643){return _0x15c7(_0x213643- -0x240,_0x474f7b);}typeof localStorage!==_0x2621bd(-0x1c3,-0x1a9)&&localStorage['setItem'](_0x2621bd(-0x14c,-0x190),JSON[_0x2621bd(-0xea,-0xda)](_0x41c0d0));}[_0x3e19e9(-0x120,-0x13a)](){this['currentSession']=null,this['httpClient']['removeAuthToken']();function _0x17b6d6(_0x5d08b1,_0x56c393){return _0x15c7(_0x5d08b1-0x241,_0x56c393);}typeof localStorage!=='undefined'&&localStorage[_0x17b6d6(0x396,0x31b)]('ebaas.auth.session');}['loadSession'](){function _0x5a12f5(_0x56475e,_0x5b38d2){return _0x15c7(_0x56475e- -0x146,_0x5b38d2);}if(typeof localStorage!==_0x5a12f5(-0xaf,-0xfe)){const _0x1e05c4=localStorage['getItem'](_0x5a12f5(-0x96,-0x2e));if(_0x1e05c4)try{const _0x4d9093=JSON['parse'](_0x1e05c4);this[_0x5a12f5(0x7,0x44)](_0x4d9093);}catch(_0x21cade){this[_0x5a12f5(0x3a,0xa7)]();}}}[_0x3e19e9(-0x12a,-0xf5)](_0x2b2f14){if(_0x2b2f14 instanceof EBaaSError)return _0x2b2f14;function _0x2f8526(_0x25ee1b,_0xe909c3){return _0x15c7(_0xe909c3-0x6a,_0x25ee1b);}return new EBaaSError(_0x2b2f14[_0x2f8526(0x132,0x180)]||_0x2f8526(0x1c5,0x14b),_0x2b2f14[_0x2f8526(0x175,0x10f)]||0x0,_0x2b2f14);}}class QueryBuilder{constructor(_0x5c9930,_0xc560c,_0x59b3ac,_0x83238e){this[_0x43362b(-0x3,-0x74)]=_0x5c9930,this[_0x43362b(-0x70,-0x8)]=_0xc560c,this[_0x43362b(0xd,-0x21)]=_0x59b3ac,this[_0x43362b(-0x115,-0xa8)]=_0x83238e;function _0x43362b(_0x3c0442,_0x5cd078){return _0x15c7(_0x5cd078- -0x171,_0x3c0442);}this['query']={'filters':[]};}['select'](_0x1ef0b6='*',_0x384e21){function _0x3c3a98(_0x541e90,_0x490c66){return _0x15c7(_0x490c66- -0x216,_0x541e90);}return this[_0x3c3a98(-0x3f,-0xaa)]['select']=_0x1ef0b6,this;}[_0x3e19e9(-0x1a1,-0x1cf)](data,_0x5e7569){function _0x4b273a(_0x1e5909,_0xf67efa){return _0x15c7(_0x1e5909-0x279,_0xf67efa);}return this['executeQuery']('POST',_0x4b273a(0x3d6,0x3bd)+this['table']+_0x4b273a(0x3f6,0x3a3),{'data':data,'options':_0x5e7569});}['update'](data,_0x186e89){function _0x1bde03(_0x2e7a15,_0x2087a5){return _0x15c7(_0x2e7a15-0x86,_0x2087a5);}return this['executeQuery']('PATCH',_0x1bde03(0x1e3,0x1f1)+this['table'],{'data':data,'options':_0x186e89,'filters':this['query'][_0x1bde03(0x13c,0x142)]});}['upsert'](data,_0x2c437e){function _0x2950f0(_0x6292a5,_0x26c35c){return _0x15c7(_0x26c35c-0x65,_0x6292a5);}return this[_0x2950f0(0x14b,0x118)]('POST','/sdk/v1/'+this[_0x2950f0(0x212,0x1ce)]+_0x2950f0(0x163,0x1a0),{'data':data,'options':{..._0x2c437e,'upsert':!![]}});}[_0x3e19e9(-0x121,-0x170)](_0x5f3cfc){function _0x35c95a(_0x294637,_0x9a1611){return _0x15c7(_0x9a1611-0x314,_0x294637);}return this['executeQuery']('DELETE','/sdk/v1/'+this['table'],{'options':_0x5f3cfc,'filters':this['query'][_0x35c95a(0x36d,0x3ca)]});}['eq'](_0x3e24df,_0x455a56){function _0x940fc4(_0x24cd93,_0x299006){return _0x15c7(_0x299006- -0x287,_0x24cd93);}return this[_0x940fc4(-0xca,-0x11b)]['filters']['push']({'column':_0x3e24df,'operator':'eq','value':_0x455a56}),this;}[_0x3e19e9(-0x1c1,-0x157)](_0x4cb1f9,_0x5df960){this['query']['filters']['push']({'column':_0x4cb1f9,'operator':_0x1b8b2d(0x44d,0x469),'value':_0x5df960});function _0x1b8b2d(_0x209f72,_0x369dfa){return _0x15c7(_0x209f72-0x36e,_0x369dfa);}return this;}['gt'](_0x10f117,_0x2a9cb5){this[_0x56961c(-0x17,0x8)][_0x56961c(-0x65,-0xae)]['push']({'column':_0x10f117,'operator':'gt','value':_0x2a9cb5});function _0x56961c(_0x32a7b1,_0x32e236){return _0x15c7(_0x32e236- -0x164,_0x32a7b1);}return this;}['gte'](_0x285cf5,_0xdb9b85){this[_0x5f07c7(0xf1,0x143)][_0x5f07c7(0x53,0x8d)][_0x5f07c7(0xfa,0x144)]({'column':_0x285cf5,'operator':'gte','value':_0xdb9b85});function _0x5f07c7(_0x32e63a,_0x512eaa){return _0x15c7(_0x512eaa- -0x29,_0x32e63a);}return this;}['lt'](_0x2b9660,_0x594003){function _0x13090a(_0x397ef4,_0x4ebd84){return _0x15c7(_0x397ef4- -0x29f,_0x4ebd84);}return this['query'][_0x13090a(-0x1e9,-0x22c)]['push']({'column':_0x2b9660,'operator':'lt','value':_0x594003}),this;}[_0x3e19e9(-0x140,-0x1b2)](_0x2a0e52,_0x54da8d){function _0x1edb2a(_0x56eca4,_0x2838fe){return _0x15c7(_0x56eca4-0xd,_0x2838fe);}return this['query'][_0x1edb2a(0xc3,0xcf)][_0x1edb2a(0x17a,0x18f)]({'column':_0x2a0e52,'operator':'lte','value':_0x54da8d}),this;}['like'](_0x16d249,_0x4ac887){this['query'][_0x1a4c3c(-0x1ce,-0x1f0)][_0x1a4c3c(-0x117,-0x10b)]({'column':_0x16d249,'operator':_0x1a4c3c(-0x120,-0x16a),'value':_0x4ac887});function _0x1a4c3c(_0x3a9c2c,_0x529b89){return _0x15c7(_0x3a9c2c- -0x284,_0x529b89);}return this;}['ilike'](_0x55485c,_0x3d014a){this[_0x5f486c(0x30f,0x2e1)][_0x5f486c(0x1b5,0x22b)]['push']({'column':_0x55485c,'operator':'ilike','value':_0x3d014a});function _0x5f486c(_0x24a6d5,_0x5d2648){return _0x15c7(_0x5d2648-0x175,_0x24a6d5);}return this;}['is'](_0x4d8e8d,_0x42007d){this[_0x2555e5(-0x6c,-0xa8)][_0x2555e5(-0x1d1,-0x15e)]['push']({'column':_0x4d8e8d,'operator':'is','value':_0x42007d});function _0x2555e5(_0x54979a,_0x3243b0){return _0x15c7(_0x3243b0- -0x214,_0x54979a);}return this;}['in'](_0x4dd835,_0x106bcc){function _0x254584(_0x18f14d,_0x4a2e8d){return _0x15c7(_0x4a2e8d-0x31f,_0x18f14d);}return this[_0x254584(0x4d5,0x48b)]['filters'][_0x254584(0x4db,0x48c)]({'column':_0x4dd835,'operator':'in','value':_0x106bcc}),this;}['contains'](_0x5014ab,_0xe1ef72){function _0x605e20(_0x3e7578,_0x17ab05){return _0x15c7(_0x3e7578-0xfd,_0x17ab05);}return this[_0x605e20(0x269,0x218)][_0x605e20(0x1b3,0x138)][_0x605e20(0x26a,0x252)]({'column':_0x5014ab,'operator':'contains','value':_0xe1ef72}),this;}['match'](_0x4be560){function _0x4fcd04(_0x524134,_0x4b80d6){return _0x15c7(_0x4b80d6-0x1c7,_0x524134);}return Object[_0x4fcd04(0x262,0x261)](_0x4be560)[_0x4fcd04(0x2a3,0x2d4)](([_0x3f9a4e,_0x2c1cdf])=>{this['eq'](_0x3f9a4e,_0x2c1cdf);}),this;}['order'](_0x34df2f,_0x121757){!this[_0x52f6ab(-0xe0,-0x155)][_0x52f6ab(-0x1a2,-0x1c7)]&&(this[_0x52f6ab(-0x120,-0x155)][_0x52f6ab(-0x157,-0x1c7)]=[]);this['query'][_0x52f6ab(-0x1b7,-0x1c7)]['push']({'column':_0x34df2f,'ascending':_0x121757?.[_0x52f6ab(-0x22b,-0x1d5)]!==![]});function _0x52f6ab(_0x5f3bc7,_0x5d38c7){return _0x15c7(_0x5d38c7- -0x2c1,_0x5f3bc7);}return this;}['limit'](count){function _0x43d582(_0x3693d2,_0xb4cc1e){return _0x15c7(_0xb4cc1e- -0x2a,_0x3693d2);}return this['query'][_0x43d582(0x135,0x105)]=count,this;}[_0x3e19e9(-0x1f7,-0x249)](from,_0x34a639){function _0xc5b26d(_0x287ffd,_0x56090c){return _0x15c7(_0x56090c- -0x29d,_0x287ffd);}return this[_0xc5b26d(-0xc8,-0x131)]['range']={'from':from,'to':_0x34a639},this;}async[_0x3e19e9(-0x19f,-0x1bc)](){function _0x3446b7(_0x45c1d1,_0x1a723a){return _0x15c7(_0x45c1d1-0xfd,_0x1a723a);}return this[_0x3446b7(0x1b0,0x201)]('GET',_0x3446b7(0x25a,0x2c5)+this['table']+_0x3446b7(0x245,0x226),{'select':this[_0x3446b7(0x269,0x23b)]['select'],'filters':this['query'][_0x3446b7(0x1b3,0x22e)],'order':this[_0x3446b7(0x269,0x1f4)]['order'],'limit':this['query'][_0x3446b7(0x22c,0x243)],'range':this[_0x3446b7(0x269,0x24e)]['range']});}async[_0x3e19e9(-0x1a2,-0x132)](){this['limit'](0x1);function _0xdd71eb(_0x2ad2ec,_0x2dff0a){return _0x15c7(_0x2dff0a-0x2c6,_0x2ad2ec);}const result=await this['execute']();return{'data':result[_0xdd71eb(0x404,0x3f7)]?.[0x0]||null,'error':result['error']};}async[_0x3e19e9(-0x1ed,-0x1a2)](_0x5c29ef,_0x4656d7,_0x17875f){function _0x332adc(_0x310fd6,_0x20456b){return _0x15c7(_0x20456b-0x2fb,_0x310fd6);}try{let response;const headers={};this[_0x332adc(0x35f,0x3c4)]&&(headers['x-workspace-id']=this[_0x332adc(0x376,0x3c4)]);if(_0x5c29ef==='GET'){const _0x45c772=_0x4656d7['split']('?'),_0x32fa15=_0x45c772[0x0],existingParams=new URLSearchParams(_0x45c772[0x1]||'');if(_0x17875f['select'])existingParams[_0x332adc(0x364,0x3ba)](_0x332adc(0x3dc,0x396),_0x17875f[_0x332adc(0x368,0x396)]);_0x17875f['filters']?.[_0x332adc(0x3c3,0x3fd)]&&_0x17875f['filters']['forEach'](filter=>{function _0x35ff63(_0x1f5529,_0x131f70){return _0x15c7(_0x1f5529-0x135,_0x131f70);}existingParams['append'](filter[_0x35ff63(0x20d,0x196)],filter['operator']+'.'+filter['value']);});if(_0x17875f['order']?.[_0x332adc(0x429,0x3fd)]){const orderStr=_0x17875f[_0x332adc(0x3c6,0x3f5)][_0x332adc(0x430,0x47f)](_0x3df9b4=>''+_0x3df9b4[_0x332adc(0x437,0x3d3)]+(_0x3df9b4[_0x332adc(0x43a,0x3e7)]?_0x332adc(0x376,0x39b):'.desc'))['join'](',');existingParams[_0x332adc(0x3f7,0x3ba)]('order',orderStr);}if(_0x17875f[_0x332adc(0x3c5,0x42a)])existingParams['append'](_0x332adc(0x40d,0x42a),_0x17875f[_0x332adc(0x401,0x42a)][_0x332adc(0x3b4,0x3cb)]());_0x17875f[_0x332adc(0x3dc,0x3a4)]&&(existingParams['append'](_0x332adc(0x39d,0x3bc),_0x17875f[_0x332adc(0x3df,0x3a4)][_0x332adc(0x42f,0x404)][_0x332adc(0x425,0x3cb)]()),existingParams[_0x332adc(0x3cf,0x3ba)]('limit',(_0x17875f['range']['to']-_0x17875f['range']['from']+0x1)['toString']())),response=await this['httpClient'][_0x332adc(0x39c,0x39a)](_0x32fa15+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x5c29ef==='DELETE'){const _0x5c2c01=_0x4656d7['split']('?'),_0x358626=_0x5c2c01[0x0],existingParams=new URLSearchParams(_0x5c2c01[0x1]||'');!existingParams['has']('operation')&&existingParams[_0x332adc(0x40f,0x3ba)]('operation',_0x332adc(0x496,0x47a));_0x17875f['filters']?.['length']&&_0x17875f[_0x332adc(0x3a6,0x3b1)][_0x332adc(0x3c7,0x408)](filter=>{function _0x4a4026(_0x399c65,_0x3dcb47){return _0x15c7(_0x3dcb47- -0x222,_0x399c65);}existingParams['append'](filter[_0x4a4026(-0x1c6,-0x14a)],filter[_0x4a4026(-0x124,-0x171)]+'.'+filter[_0x4a4026(-0x111,-0xd4)]);});const deleteUrl=_0x358626+'?'+existingParams[_0x332adc(0x3ea,0x3cb)]();response=await this['httpClient'][_0x332adc(0x4a7,0x47a)](deleteUrl,{'headers':headers});}else{if(_0x5c29ef==='PATCH'){const _0x1e9bef=_0x4656d7['split']('?'),_0x2bb1ca=_0x1e9bef[0x0],existingParams=new URLSearchParams(_0x1e9bef[0x1]||'');!existingParams[_0x332adc(0x3f1,0x406)]('operation')&&existingParams['append']('operation','update');_0x17875f[_0x332adc(0x3cb,0x3b1)]?.[_0x332adc(0x463,0x3fd)]&&_0x17875f[_0x332adc(0x351,0x3b1)][_0x332adc(0x3bb,0x408)](filter=>{function _0x9c1b44(_0x53e73c,_0x2bdabb){return _0x15c7(_0x53e73c-0x3ba,_0x2bdabb);}existingParams['append'](filter[_0x9c1b44(0x492,0x4c3)],filter['operator']+'.'+filter['value']);});_0x17875f['options']?.['prefer']&&(headers['Prefer']=_0x17875f['options'][_0x332adc(0x3f2,0x442)]);const updateUrl=_0x2bb1ca+'?'+existingParams[_0x332adc(0x438,0x3cb)]();response=await this['httpClient']['patch'](updateUrl,_0x17875f[_0x332adc(0x3f3,0x42c)],{'headers':headers});}else{let _0x1d328f=_0x17875f['data'];!headers['Prefer']&&(headers[_0x332adc(0x3f4,0x3ed)]='return=representation'),_0x17875f['options']?.['upsert']&&(headers[_0x332adc(0x3f5,0x3ed)]='resolution=merge-duplicates,return=representation'),_0x17875f[_0x332adc(0x468,0x424)]&&(_0x1d328f=_0x17875f[_0x332adc(0x411,0x424)]),response=await this[_0x332adc(0x38a,0x3f8)][_0x332adc(0x3de,0x3d4)](_0x4656d7,_0x1d328f,{'headers':headers});}}}return{'data':response[_0x332adc(0x3e0,0x42c)],'error':null,'count':response[_0x332adc(0x473,0x433)]?.['x-total-count']?parseInt(response['headers'][_0x332adc(0x458,0x42b)]):undefined};}catch(_0x181dc0){return{'data':null,'error':_0x181dc0 instanceof EBaaSError?_0x181dc0:new EBaaSError(_0x181dc0 instanceof Error?_0x181dc0[_0x332adc(0x405,0x411)]:'Database\x20operation\x20failed',0x0,_0x181dc0)};}}}class CustomDatabaseManager{constructor(_0x4906e2,_0x1530db){this['httpClient']=_0x4906e2;function _0x329df1(_0x4807cb,_0x321b80){return _0x15c7(_0x321b80- -0x2a5,_0x4807cb);}this[_0x329df1(-0x18d,-0x1dc)]=_0x1530db;}async['detectCustomDatabase'](){function _0x3866c5(_0x3aff7c,_0x4d46fc){return _0x15c7(_0x3aff7c- -0x247,_0x4d46fc);}if(!this[_0x3866c5(-0x17e,-0x1c4)])return{'hasCustomDatabase':![]};try{const response=await this['httpClient']['get']('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response[_0x3866c5(-0x1a2,-0x1df)]===0xc8&&response['data']?.['config']){const config=response[_0x3866c5(-0x116,-0x121)]['config'],_0x26ebb1={'host':config['postgresHost'],'port':config['postgresPort'],'database':config['postgresDatabase'],'username':config[_0x3866c5(-0x127,-0x13b)],'password':'','schema':config['postgresSchema'],'sslEnabled':config['sslEnabled']};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x26ebb1},this[_0x3866c5(-0x157,-0x1a9)];}}catch(_0x4d3b19){if(_0x4d3b19?.['status']===0x194)return this[_0x3866c5(-0x157,-0x1d1)]={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x4d3b19);}return this['detectedConfig']={'hasCustomDatabase':![]},this[_0x3866c5(-0x157,-0x1cd)];}async['testConnection'](_0x57dc66){function _0x433fcd(_0x3cae40,_0x142181){return _0x15c7(_0x3cae40- -0x274,_0x142181);}try{const response=await this[_0x433fcd(-0x177,-0x15d)][_0x433fcd(-0x19b,-0x128)]('/admin/v1/workspace/custom-database/test-connection',_0x57dc66,{'headers':this['workspaceId']?{'X-Workspace-ID':this[_0x433fcd(-0x1ab,-0x149)]}:{}});return response[_0x433fcd(-0x143,-0x1af)];}catch(_0x115739){return{'success':![],'message':_0x115739?.['message']||_0x433fcd(-0x165,-0x185)};}}async[_0x3e19e9(-0x151,-0x134)](_0x5d831f){function _0x2fadb2(_0x1acc1b,_0x3a98c9){return _0x15c7(_0x1acc1b- -0x394,_0x3a98c9);}if(!this[_0x2fadb2(-0x2cb,-0x271)])throw new Error('Workspace ID is required to configure custom database');const response=await this[_0x2fadb2(-0x297,-0x25b)][_0x2fadb2(-0x2bb,-0x278)]('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x5d831f},{'headers':{'X-Workspace-ID':this['workspaceId']}}),config=response[_0x2fadb2(-0x263,-0x1ee)]['config'];return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x5d831f},config;}async[_0x3e19e9(-0x167,-0x165)](){if(!this['workspaceId'])throw new Error('Workspace ID is required to remove custom database');await this['httpClient']['delete']('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this['workspaceId']}}),this['detectedConfig']={'hasCustomDatabase':![]};}['getDetectedConfig'](){return this['detectedConfig'];}[_0x3e19e9(-0x136,-0x12e)](){function _0x32e863(_0x50ba63,_0x180e67){return _0x15c7(_0x50ba63- -0x1cc,_0x180e67);}return this[_0x32e863(-0xdc,-0x123)]?.[_0x32e863(-0x62,-0xcf)]??![];}['getCustomCredentials'](){function _0x33411f(_0x440550,_0x1c30e5){return _0x15c7(_0x440550-0x1f4,_0x1c30e5);}return this[_0x33411f(0x2e4,0x2ee)]?.[_0x33411f(0x29f,0x26a)];}[_0x3e19e9(-0x17b,-0x1ed)](_0x21f0e4){function _0x58b583(_0x24a3a2,_0x5e6e90){return _0x15c7(_0x5e6e90- -0x317,_0x24a3a2);}this[_0x58b583(-0x25e,-0x24e)]=_0x21f0e4,this['detectedConfig']=undefined;}[_0x3e19e9(-0x15f,-0x153)](){return this['workspaceId'];}['getStatus'](){function _0x25814d(_0x1abe8e,_0x2dc063){return _0x15c7(_0x1abe8e-0x70,_0x2dc063);}return{'workspaceId':this['workspaceId'],'hasConfig':this[_0x25814d(0x1da,0x174)](),'configDetails':this['detectedConfig']?.[_0x25814d(0x11b,0x16c)]?{'host':this['detectedConfig'][_0x25814d(0x11b,0x131)][_0x25814d(0x1ec,0x264)],'port':this[_0x25814d(0x160,0x1a8)][_0x25814d(0x11b,0xed)][_0x25814d(0x176,0x1e7)],'database':this['detectedConfig']['credentials'][_0x25814d(0x1e3,0x251)],'schema':this['detectedConfig'][_0x25814d(0x11b,0xd6)][_0x25814d(0x1c0,0x202)]||_0x25814d(0x147,0x178),'sslEnabled':this[_0x25814d(0x160,0x109)]['credentials']['sslEnabled']||![]}:undefined};}}class DatabaseClient{constructor(_0x1ac672,_0x23f2fd){this['httpClient']=_0x1ac672,this['customDatabaseManager']=new CustomDatabaseManager(_0x1ac672,_0x23f2fd);}['from'](_0x1c0c55){function _0x1ceb44(_0x1077d4,_0xd31fe3){return _0x15c7(_0xd31fe3-0x378,_0x1077d4);}return new QueryBuilder(this[_0x1ceb44(0x49d,0x475)],_0x1c0c55,this['currentSchema'],this[_0x1ceb44(0x435,0x44c)]['getWorkspaceId']());}[_0x3e19e9(-0x202,-0x1e2)](_0x2c74d2,_0x17a666){function _0x1989ef(_0x3da2da,_0x1a0e04){return _0x15c7(_0x3da2da-0x38d,_0x1a0e04);}return this[_0x1989ef(0x48a,0x41c)][_0x1989ef(0x466,0x43e)](_0x1989ef(0x4d8,0x48c)+_0x2c74d2,_0x17a666);}[_0x3e19e9(-0x150,-0x168)](_0x2a8f31){const _0x429273=new DatabaseClient(this[_0x125b80(-0x1ef,-0x242)],this['customDatabaseManager'][_0x125b80(-0x20e,-0x1fe)]());_0x429273[_0x125b80(-0x2c2,-0x246)]=_0x2a8f31,_0x429273['customDatabaseManager']=this['customDatabaseManager'];function _0x125b80(_0x2dcb11,_0x1bff62){return _0x15c7(_0x1bff62- -0x33f,_0x2dcb11);}return _0x429273;}async[_0x3e19e9(-0x186,-0x17f)](){function _0xdcfc5(_0x4da204,_0x5484b7){return _0x15c7(_0x4da204- -0x193,_0x5484b7);}return this[_0xdcfc5(-0xbf,-0x4e)][_0xdcfc5(-0x79,-0x8d)]();}async[_0x3e19e9(-0x1ca,-0x1f2)](_0x4b6fc6){function _0x3e3be0(_0x17eb01,_0x1ab71c){return _0x15c7(_0x1ab71c- -0x35b,_0x17eb01);}return this[_0x3e3be0(-0x242,-0x287)]['testConnection'](_0x4b6fc6);}async['configureCustomDatabase'](_0x29cfe6){function _0x37e1af(_0x1e935e,_0x304539){return _0x15c7(_0x1e935e- -0x101,_0x304539);}return this[_0x37e1af(-0x2d,-0x95)][_0x37e1af(0x4e,0xab)](_0x29cfe6);}async['removeCustomDatabase'](){function _0x3bea51(_0x11d3c6,_0x370723){return _0x15c7(_0x11d3c6- -0x3cb,_0x370723);}return this[_0x3bea51(-0x2f7,-0x320)]['removeCustomDatabase']();}[_0x3e19e9(-0x19c,-0x219)](){function _0x4c612c(_0x3a93ed,_0x257630){return _0x15c7(_0x3a93ed-0x19c,_0x257630);}return this['customDatabaseManager'][_0x4c612c(0x306,0x352)]();}['getCustomDatabaseStatus'](){function _0xc56ecb(_0x429ef0,_0x4955c2){return _0x15c7(_0x4955c2- -0x1e4,_0x429ef0);}return this['customDatabaseManager'][_0xc56ecb(-0x106,-0x8e)]();}[_0x3e19e9(-0x17b,-0x166)](_0x2ef1db){function _0x11b6eb(_0x312e3f,_0x2ee70f){return _0x15c7(_0x312e3f-0xb9,_0x2ee70f);}this[_0x11b6eb(0x18d,0x18b)][_0x11b6eb(0x1de,0x19e)](_0x2ef1db);}async[_0x3e19e9(-0x1d6,-0x169)](){function _0x331a03(_0x2793ac,_0x319e1d){return _0x15c7(_0x2793ac-0x1,_0x319e1d);}try{await this[_0x331a03(0xd5,0xad)]['detectCustomDatabase']();}catch(_0x57d9c2){console['warn']('Failed to initialize custom database detection:',_0x57d9c2);}}}class StorageBucket{constructor(_0x2dcb57,bucketId){function _0x5b2177(_0x4ff515,_0xe51ee7){return _0x15c7(_0xe51ee7- -0xf8,_0x4ff515);}this[_0x5b2177(0x15,0x5)]=_0x2dcb57,this['bucketId']=bucketId;}async['upload'](_0x3ad021,_0x2d2e8a,_0x5bef9a){function _0x5f0379(_0x1420d3,_0x5c511b){return _0x15c7(_0x1420d3-0x289,_0x5c511b);}try{const _0xe4daca=new FormData();if(_0x2d2e8a instanceof File)_0xe4daca[_0x5f0379(0x348,0x3bb)](_0x5f0379(0x418,0x3ad),_0x2d2e8a);else{if(_0x2d2e8a instanceof Blob)_0xe4daca[_0x5f0379(0x348,0x391)]('file',_0x2d2e8a,_0x3ad021);else{if(_0x2d2e8a instanceof ArrayBuffer)_0xe4daca[_0x5f0379(0x348,0x333)](_0x5f0379(0x418,0x3f9),new Blob([_0x2d2e8a]),_0x3ad021);else typeof _0x2d2e8a===_0x5f0379(0x3cb,0x409)&&_0xe4daca[_0x5f0379(0x348,0x2f3)](_0x5f0379(0x418,0x3d0),new Blob([_0x2d2e8a],{'type':_0x5f0379(0x3fd,0x3e9)}),_0x3ad021);}}_0xe4daca[_0x5f0379(0x348,0x2dc)](_0x5f0379(0x333,0x37f),_0x3ad021);_0x5bef9a?.[_0x5f0379(0x365,0x2ee)]&&_0xe4daca['append']('cacheControl',_0x5bef9a[_0x5f0379(0x365,0x393)]);_0x5bef9a?.[_0x5f0379(0x32d,0x2d0)]&&_0xe4daca['append'](_0x5f0379(0x32d,0x2d6),_0x5bef9a[_0x5f0379(0x32d,0x2d1)]);_0x5bef9a?.[_0x5f0379(0x38e,0x324)]&&_0xe4daca[_0x5f0379(0x348,0x3aa)]('metadata',JSON['stringify'](_0x5bef9a[_0x5f0379(0x38e,0x367)]));const _0x23b3de=_0x5f0379(0x3c5,0x437)+this['bucketId']+_0x5f0379(0x372,0x3e5)+(_0x5bef9a?.[_0x5f0379(0x3e7,0x442)]?_0x5f0379(0x34d,0x2e0):''),response=await this['httpClient'][_0x5f0379(0x362,0x3d9)](_0x23b3de,_0xe4daca,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response['data'],'error':null};}catch(_0x16b94d){return{'data':null,'error':_0x16b94d instanceof EBaaSError?_0x16b94d:new EBaaSError(_0x16b94d instanceof Error?_0x16b94d[_0x5f0379(0x39f,0x3e9)]:'Failed\x20to\x20upload\x20file',0x0,_0x16b94d)};}}async[_0x3e19e9(-0x184,-0x1ba)](_0x15fbbd,_0x41acb5){function _0x283f95(_0x6c13ed,_0x7237e7){return _0x15c7(_0x7237e7- -0x2ca,_0x6c13ed);}try{const _0x51d6ee=new URLSearchParams();_0x41acb5?.[_0x283f95(-0x24f,-0x227)]&&Object['entries'](_0x41acb5[_0x283f95(-0x21f,-0x227)])[_0x283f95(-0x1a3,-0x1bd)](([_0x10ceb4,_0xcb2834])=>{_0xcb2834!==undefined&&_0x51d6ee['append'](_0x10ceb4,String(_0xcb2834));});const _0xc8fb1a=_0x283f95(-0x1b3,-0x18e)+this['bucketId']+'/files/'+_0x15fbbd+(_0x51d6ee[_0x283f95(-0x220,-0x1fa)]()?'?'+_0x51d6ee[_0x283f95(-0x22b,-0x1fa)]():''),response=await this['httpClient']['get'](_0xc8fb1a,{'responseType':_0x283f95(-0x1f3,-0x1cf)});return{'data':response['data'],'error':null};}catch(_0x35c934){return{'data':null,'error':_0x35c934 instanceof EBaaSError?_0x35c934:new EBaaSError(_0x35c934 instanceof Error?_0x35c934['message']:'Failed\x20to\x20download\x20file',0x0,_0x35c934)};}}async[_0x3e19e9(-0x179,-0x1a0)](_0x4f3b10,_0x20451f){function _0x1010e1(_0x377a5d,_0x1c2a8f){return _0x15c7(_0x1c2a8f- -0xa9,_0x377a5d);}try{const _0x2a8fb9=new URLSearchParams();_0x4f3b10&&_0x2a8fb9[_0x1010e1(0x46,0x16)]('prefix',_0x4f3b10);_0x20451f?.[_0x1010e1(0x83,0x86)]&&_0x2a8fb9[_0x1010e1(0x75,0x16)]('limit',String(_0x20451f[_0x1010e1(0x35,0x86)]));_0x20451f?.['offset']&&_0x2a8fb9['append'](_0x1010e1(0x90,0x18),String(_0x20451f['offset']));_0x20451f?.['sortBy']&&_0x2a8fb9[_0x1010e1(0x67,0x16)](_0x1010e1(0x117,0xe3),JSON['stringify'](_0x20451f[_0x1010e1(0x101,0xe3)]));_0x20451f?.[_0x1010e1(0xb1,0xc2)]&&_0x2a8fb9['append']('search',_0x20451f[_0x1010e1(0x5a,0xc2)]);const _0x2d274d=_0x1010e1(0x63,0x93)+this['bucketId']+'/files'+(_0x2a8fb9['toString']()?'?'+_0x2a8fb9['toString']():''),response=await this[_0x1010e1(0x86,0x54)]['get'](_0x2d274d);return{'data':response['data'],'error':null};}catch(_0xbb7ec3){return{'data':null,'error':_0xbb7ec3 instanceof EBaaSError?_0xbb7ec3:new EBaaSError(_0xbb7ec3 instanceof Error?_0xbb7ec3['message']:_0x1010e1(0x112,0xda),0x0,_0xbb7ec3)};}}async['remove'](_0x4059b2){function _0x4ea075(_0x52103a,_0xce235a){return _0x15c7(_0x52103a- -0x133,_0xce235a);}try{const response=await this[_0x4ea075(-0x36,-0x1f)]['delete'](_0x4ea075(0x9,0x7f)+this[_0x4ea075(0x42,0x37)]+_0x4ea075(-0x4a,-0x6b),{'data':{'paths':_0x4059b2}});return{'data':response['data'],'error':null};}catch(_0x5d6f42){return{'data':null,'error':_0x5d6f42 instanceof EBaaSError?_0x5d6f42:new EBaaSError(_0x5d6f42 instanceof Error?_0x5d6f42['message']:_0x4ea075(0x26,0x1e),0x0,_0x5d6f42)};}}async['move'](fromPath,_0x6b01a1){function _0x247bc6(_0x1ccd7b,_0x2aa4d4){return _0x15c7(_0x1ccd7b- -0x7d,_0x2aa4d4);}try{const response=await this[_0x247bc6(0x80,0x93)]['post'](_0x247bc6(0xbf,0x4f)+this['bucketId']+_0x247bc6(0x2f,0x55),{'sourceKey':fromPath,'destinationKey':_0x6b01a1});return{'data':response[_0x247bc6(0xb4,0x8e)],'error':null};}catch(_0x1de846){return{'data':null,'error':_0x1de846 instanceof EBaaSError?_0x1de846:new EBaaSError(_0x1de846 instanceof Error?_0x1de846['message']:'Failed\x20to\x20move\x20file',0x0,_0x1de846)};}}async['copy'](fromPath,_0x43ca07){function _0x2e8d17(_0x3f972f,_0x4860b6){return _0x15c7(_0x4860b6-0x28f,_0x3f972f);}try{const response=await this['httpClient'][_0x2e8d17(0x2f1,0x368)]('/storage/buckets/'+this['bucketId']+_0x2e8d17(0x309,0x34b),{'sourceKey':fromPath,'destinationKey':_0x43ca07});return{'data':response[_0x2e8d17(0x35e,0x3c0)],'error':null};}catch(_0x26a676){return{'data':null,'error':_0x26a676 instanceof EBaaSError?_0x26a676:new EBaaSError(_0x26a676 instanceof Error?_0x26a676[_0x2e8d17(0x3c0,0x3a5)]:_0x2e8d17(0x403,0x3f1),0x0,_0x26a676)};}}async[_0x3e19e9(-0x15b,-0x194)](_0x1088ae,_0x14ca2c,_0x1c0b98){function _0x145820(_0x2ee7c1,_0x3cf617){return _0x15c7(_0x3cf617- -0x170,_0x2ee7c1);}try{const response=await this[_0x145820(-0x15,-0x73)]['post'](_0x145820(-0x41,-0x34)+this[_0x145820(-0x75,0x5)]+'/files/'+_0x1088ae+_0x145820(-0xe6,-0x6d),{'expiresIn':_0x14ca2c,..._0x1c0b98});return{'data':response['data'],'error':null};}catch(_0x9b85f0){return{'data':null,'error':_0x9b85f0 instanceof EBaaSError?_0x9b85f0:new EBaaSError(_0x9b85f0 instanceof Error?_0x9b85f0['message']:_0x145820(0x4c,-0x16),0x0,_0x9b85f0)};}}['getPublicUrl'](_0x34fbb0,_0x389445){const _0x4aa17b=new URLSearchParams();function _0x27893d(_0x1a2977,_0x4351ed){return _0x15c7(_0x4351ed- -0x23d,_0x1a2977);}_0x389445?.[_0x27893d(-0x189,-0x19a)]&&Object['entries'](_0x389445['transform'])['forEach'](([_0xe2517b,_0x3e39d0])=>{_0x3e39d0!==undefined&&_0x4aa17b['append'](_0xe2517b,String(_0x3e39d0));});const _0x4ba326=this[_0x27893d(-0x130,-0x140)][_0x27893d(-0xf6,-0x115)]||'',_0x148514=_0x4ba326+_0x27893d(-0x16b,-0x101)+this[_0x27893d(-0x4f,-0xc8)]+_0x27893d(-0x134,-0x150)+_0x34fbb0+(_0x4aa17b[_0x27893d(-0x14f,-0x16d)]()?'?'+_0x4aa17b['toString']():'');return{'data':{'publicUrl':_0x148514}};}async['getFileInfo'](_0x5d4d85){function _0x251799(_0x1a21e4,_0x1aa62d){return _0x15c7(_0x1a21e4-0x97,_0x1aa62d);}try{const response=await this[_0x251799(0x194,0x1b7)]['get'](_0x251799(0x1d3,0x170)+this[_0x251799(0x20c,0x25b)]+_0x251799(0x184,0x128)+_0x5d4d85+_0x251799(0x145,0xda));return{'data':response['data'],'error':null};}catch(_0x245741){return{'data':null,'error':_0x245741 instanceof EBaaSError?_0x245741:new EBaaSError(_0x245741 instanceof Error?_0x245741['message']:_0x251799(0x188,0x147),0x0,_0x245741)};}}async[_0x3e19e9(-0x156,-0x111)](_0x532665,metadata){function _0xa08bef(_0x5397b4,_0x3d77c0){return _0x15c7(_0x5397b4-0x25f,_0x3d77c0);}try{const response=await this[_0xa08bef(0x35c,0x335)][_0xa08bef(0x395,0x32e)]('/storage/buckets/'+this['bucketId']+_0xa08bef(0x34c,0x398)+_0x532665+_0xa08bef(0x38d,0x33d),{'metadata':metadata});return{'data':response[_0xa08bef(0x390,0x3e2)],'error':null};}catch(_0x30096f){return{'data':null,'error':_0x30096f instanceof EBaaSError?_0x30096f:new EBaaSError(_0x30096f instanceof Error?_0x30096f['message']:'Failed\x20to\x20update\x20file\x20metadata',0x0,_0x30096f)};}}}class StorageClient{constructor(_0xfc10a){function _0x4e49cf(_0x33a35c,_0x22f488){return _0x15c7(_0x33a35c-0x4f,_0x22f488);}this[_0x4e49cf(0x14c,0xd4)]=_0xfc10a;}[_0x3e19e9(-0x197,-0x1da)](bucketId){return new StorageBucket(this['httpClient'],bucketId);}async[_0x3e19e9(-0x1e0,-0x1d9)](_0x245121,_0x110d30){function _0x42966e(_0x4ad340,_0x251e8d){return _0x15c7(_0x4ad340- -0x393,_0x251e8d);}try{const response=await this['httpClient']['post']('/storage/buckets',{'id':_0x245121,..._0x110d30});return{'data':response['data'],'error':null};}catch(_0x408d5f){return{'data':null,'error':_0x408d5f instanceof EBaaSError?_0x408d5f:new EBaaSError(_0x408d5f instanceof Error?_0x408d5f['message']:_0x42966e(-0x23b,-0x1d5),0x0,_0x408d5f)};}}async['getBucket'](_0x486598){function _0x5c6c87(_0x5b4075,_0x1f304b){return _0x15c7(_0x5b4075-0x347,_0x1f304b);}try{const response=await this[_0x5c6c87(0x444,0x41d)][_0x5c6c87(0x3e6,0x432)](_0x5c6c87(0x483,0x4a3)+_0x486598);return{'data':response['data'],'error':null};}catch(_0x19126d){return{'data':null,'error':_0x19126d instanceof EBaaSError?_0x19126d:new EBaaSError(_0x19126d instanceof Error?_0x19126d['message']:'Failed\x20to\x20get\x20bucket',0x0,_0x19126d)};}}async[_0x3e19e9(-0x1d8,-0x1f8)](){function _0x5d7679(_0x22c2b8,_0x1b71ef){return _0x15c7(_0x1b71ef-0xd,_0x22c2b8);}try{const response=await this['httpClient']['get'](_0x5d7679(0xdc,0x125));return{'data':response[_0x5d7679(0x13a,0x13e)],'error':null};}catch(_0x470011){return{'data':null,'error':_0x470011 instanceof EBaaSError?_0x470011:new EBaaSError(_0x470011 instanceof Error?_0x470011['message']:_0x5d7679(0x16a,0x19b),0x0,_0x470011)};}}async[_0x3e19e9(-0x1ff,-0x24a)](_0x8e82b3,_0x1a9da4){function _0xbcaef8(_0x4dd015,_0x5a0b16){return _0x15c7(_0x5a0b16- -0x3b9,_0x4dd015);}try{const response=await this[_0xbcaef8(-0x28b,-0x2bc)]['put']('/storage/buckets/'+_0x8e82b3,_0x1a9da4);return{'data':response['data'],'error':null};}catch(_0x1d9f80){return{'data':null,'error':_0x1d9f80 instanceof EBaaSError?_0x1d9f80:new EBaaSError(_0x1d9f80 instanceof Error?_0x1d9f80[_0xbcaef8(-0x2f9,-0x2a3)]:_0xbcaef8(-0x1f0,-0x231),0x0,_0x1d9f80)};}}async['deleteBucket'](_0x3d0641){function _0x1694d1(_0x1f2207,_0x174cf2){return _0x15c7(_0x1f2207- -0x320,_0x174cf2);}try{const response=await this['httpClient']['delete']('/storage/buckets/'+_0x3d0641);return{'data':response[_0x1694d1(-0x1ef,-0x1c4)],'error':null};}catch(_0x57c7dc){return{'data':null,'error':_0x57c7dc instanceof EBaaSError?_0x57c7dc:new EBaaSError(_0x57c7dc instanceof Error?_0x57c7dc['message']:'Failed\x20to\x20delete\x20bucket',0x0,_0x57c7dc)};}}async['getUsage'](){function _0x2e14b4(_0x53df41,_0x52ff03){return _0x15c7(_0x53df41- -0xf6,_0x52ff03);}try{const response=await this['httpClient']['get'](_0x2e14b4(-0x19,-0x10));return{'data':response['data'],'error':null};}catch(_0x282725){return{'data':null,'error':_0x282725 instanceof EBaaSError?_0x282725:new EBaaSError(_0x282725 instanceof Error?_0x282725['message']:_0x2e14b4(0x72,0x32),0x0,_0x282725)};}}}class RealtimeChannel extends _0x2302e2{constructor(_0xf1905b,_0x120273){function _0x2c1a9f(_0x57e21b,_0x980db0){return _0x15c7(_0x57e21b- -0x38a,_0x980db0);}super(),this[_0x2c1a9f(-0x246,-0x2a3)]=![],this[_0x2c1a9f(-0x27c,-0x220)]='closed',this[_0x2c1a9f(-0x209,-0x232)]=new Map(),this[_0x2c1a9f(-0x218,-0x1f5)]=_0xf1905b,this[_0x2c1a9f(-0x29b,-0x24f)]=_0x120273;}['subscribe'](_0x1aaffc){function _0xe7b8dc(_0x5d1075,_0x1155fe){return _0x15c7(_0x1155fe-0x2e,_0x5d1075);}return!this[_0xe7b8dc(0x1c8,0x172)]&&(this[_0xe7b8dc(0x167,0x172)]=!![],this[_0xe7b8dc(0x18d,0x140)]()),_0x1aaffc&&this['on'](_0xe7b8dc(0x77,0xd3),_0x1aaffc),this;}[_0x3e19e9(-0x115,-0x175)](filter,_0x25f07c){const _0x2580d3=_0x37ef25(0x2fa,0x2a9)+JSON['stringify'](filter);super['on'](_0x2580d3,_0x25f07c);const _0x1017b7={'unsubscribe':()=>{function _0x24cf25(_0x15ade9,_0x1e762c){return _0x15c7(_0x1e762c-0x164,_0x15ade9);}super['off'](_0x2580d3,_0x25f07c),this[_0x24cf25(0x2be,0x2e5)]['delete'](_0x2580d3);}};this[_0x37ef25(0x3a4,0x355)]['set'](_0x2580d3,_0x1017b7);function _0x37ef25(_0x188403,_0x2a3ab0){return _0x15c7(_0x2a3ab0-0x1d4,_0x188403);}return this['socket']?.[_0x37ef25(0x2b0,0x313)]&&this[_0x37ef25(0x34e,0x2e2)]==='joined'&&this[_0x37ef25(0x2e1,0x2c3)]['emit'](_0x37ef25(0x20f,0x27c),{'topic':this[_0x37ef25(0x2e5,0x346)],'filter':filter,'ref':this['makeRef']()}),_0x1017b7;}['onBroadcast'](filter,_0x4a97cc){const _0x242c69='broadcast:'+JSON['stringify'](filter);function _0x3aa07c(_0x5d54f6,_0x5ec33a){return _0x15c7(_0x5d54f6- -0x1ce,_0x5ec33a);}super['on'](_0x242c69,_0x4a97cc);const _0x10a77d={'unsubscribe':()=>{super['off'](_0x242c69,_0x4a97cc),this['subscriptions']['delete'](_0x242c69);}};return this[_0x3aa07c(-0x4d,-0xb4)][_0x3aa07c(-0x82,-0x3b)](_0x242c69,_0x10a77d),_0x10a77d;}[_0x3e19e9(-0x14e,-0x190)](filter,_0x144e57){const _0x378b19=_0x52361f(0x35a,0x389)+JSON[_0x52361f(0x348,0x3ab)](filter);super['on'](_0x378b19,_0x144e57);const _0x4ede0a={'unsubscribe':()=>{super[_0x36cbcd(-0x34e,-0x2e8)](_0x378b19,_0x144e57);function _0x36cbcd(_0x8b8835,_0x8355af){return _0x15c7(_0x8355af- -0x3c8,_0x8b8835);}this[_0x36cbcd(-0x1eb,-0x247)][_0x36cbcd(-0x2b6,-0x249)](_0x378b19);}};function _0x52361f(_0x5121cb,_0x476e81){return _0x15c7(_0x5121cb-0x1e2,_0x476e81);}return this[_0x52361f(0x363,0x3cf)]['set'](_0x378b19,_0x4ede0a),_0x4ede0a;}[_0x3e19e9(-0x169,-0x17e)](_0x6d9ab4){return new Promise(_0x2a678f=>{function _0x3fc8d7(_0x438839,_0x127843){return _0x15c7(_0x438839- -0x3ad,_0x127843);}this['socket']?.['connected']&&this['state']===_0x3fc8d7(-0x296,-0x258)?(this[_0x3fc8d7(-0x2be,-0x289)][_0x3fc8d7(-0x2c2,-0x29f)](_0x3fc8d7(-0x307,-0x294),{'topic':this[_0x3fc8d7(-0x23b,-0x27d)],'event':_0x6d9ab4[_0x3fc8d7(-0x310,-0x338)],'payload':_0x6d9ab4,'ref':this[_0x3fc8d7(-0x25a,-0x26a)]()}),_0x2a678f('ok')):_0x2a678f(_0x3fc8d7(-0x2f2,-0x2bb));});}[_0x3e19e9(-0x204,-0x1f3)](_0xd4f2e){return new Promise(_0x3e59ae=>{function _0x5e3abc(_0x461147,_0x1558d0){return _0x15c7(_0x1558d0-0x110,_0x461147);}this[_0x5e3abc(0x216,0x1ff)]?.[_0x5e3abc(0x252,0x24f)]&&this[_0x5e3abc(0x1cb,0x21e)]===_0x5e3abc(0x206,0x227)?(this[_0x5e3abc(0x21f,0x1ff)]['emit'](_0x5e3abc(0x255,0x1f4),{'topic':this['topic'],'event':'track','payload':_0xd4f2e,'ref':this['makeRef']()}),_0x3e59ae('ok')):_0x3e59ae('error');});}['untrack'](){return new Promise(_0x3df764=>{function _0xfd6c61(_0x25f688,_0xf8b641){return _0x15c7(_0xf8b641-0x3c0,_0x25f688);}this['socket']?.['connected']&&this[_0xfd6c61(0x4e4,0x4ce)]==='joined'?(this[_0xfd6c61(0x51e,0x4af)][_0xfd6c61(0x471,0x4ab)](_0xfd6c61(0x470,0x4a4),{'topic':this['topic'],'event':'untrack','ref':this['makeRef']()}),_0x3df764('ok')):_0x3df764('error');});}[_0x3e19e9(-0x113,-0x18d)](){return new Promise(_0xf461be=>{this['state']='leaving',this['subscriptions'][_0x40ea24(0x224,0x264)](_0x551cb7=>{function _0x339682(_0x282719,_0x444a04){return _0x15c7(_0x444a04-0x247,_0x282719);}_0x551cb7[_0x339682(0x3fa,0x3d4)]();}),this[_0x40ea24(0x30b,0x2d8)][_0x40ea24(0x19d,0x215)]();function _0x40ea24(_0x139861,_0x17aa42){return _0x15c7(_0x17aa42-0x157,_0x139861);}this[_0x40ea24(0x1dd,0x246)]?.[_0x40ea24(0x2df,0x296)]&&this['socket']['emit'](_0x40ea24(0x233,0x235),{'topic':this['topic'],'ref':this[_0x40ea24(0x2b2,0x2aa)]()}),this[_0x40ea24(0x2b0,0x265)]='closed',this['removeAllListeners'](),_0xf461be('ok');});}[_0x3e19e9(-0x18e,-0x17c)](){function _0x434990(_0x216d50,_0x3a8d69){return _0x15c7(_0x3a8d69- -0x287,_0x216d50);}if(this[_0x434990(-0x16f,-0x179)]==='leaving')return;this['state']=_0x434990(-0x252,-0x1e5),this[_0x434990(-0x182,-0x198)]?.['connected']&&(this[_0x434990(-0x17e,-0x198)]['emit']('join',{'topic':this[_0x434990(-0x9b,-0x115)],'ref':this[_0x434990(-0x106,-0x134)]()}),setTimeout(()=>{function _0x36d1a6(_0x3c4c6e,_0x5e97d2){return _0x15c7(_0x5e97d2- -0x224,_0x3c4c6e);}this['state']==='joining'&&(this['state']='joined',this['emit'](_0x36d1a6(-0x103,-0x17f),'SUBSCRIBED'));},0x64));}[_0x3e19e9(-0x119,-0xe5)](){function _0x20a72a(_0x34ca8e,_0xeaf858){return _0x15c7(_0xeaf858- -0x203,_0x34ca8e);}this[_0x20a72a(-0xb8,-0xbf)]&&(this['_join'](),this['subscriptions']['forEach']((_0x551b2f,_0x12b03d)=>{function _0x2fdb71(_0x1f131f,_0x4a75ea){return _0x15c7(_0x4a75ea-0x2c0,_0x1f131f);}if(_0x12b03d[_0x2fdb71(0x3f9,0x391)](_0x2fdb71(0x38d,0x395))){const filter=JSON['parse'](_0x12b03d[_0x2fdb71(0x3f3,0x38d)](_0x2fdb71(0x33a,0x395),''));this[_0x2fdb71(0x402,0x3af)]?.[_0x2fdb71(0x3b6,0x3ab)](_0x2fdb71(0x348,0x368),{'topic':this[_0x2fdb71(0x46f,0x432)],'filter':filter,'ref':this[_0x2fdb71(0x3d6,0x413)]()});}}));}['_trigger'](_0x363ba0,_0x1353ce){if(_0x363ba0===_0x265023(0x3d4,0x43e)){const _0x2cd4a3='postgres_changes:'+JSON[_0x265023(0x408,0x3a3)](_0x1353ce[_0x265023(0x38c,0x33e)]||{});this[_0x265023(0x38d,0x3b7)](_0x2cd4a3,_0x1353ce);}else{if(_0x363ba0===_0x265023(0x348,0x2db)){const _0x342d27='broadcast:'+JSON['stringify']({'event':_0x1353ce['event']});this[_0x265023(0x38d,0x324)](_0x342d27,_0x1353ce);}else{if(_0x363ba0==='presence'){const _0x543515=_0x265023(0x41a,0x479)+JSON[_0x265023(0x408,0x42a)]({'event':_0x1353ce['event']});this[_0x265023(0x38d,0x375)](_0x543515,_0x1353ce);}}}function _0x265023(_0x11aec2,_0x20b1ed){return _0x15c7(_0x11aec2-0x2a2,_0x20b1ed);}this['emit'](_0x363ba0,_0x1353ce);}[_0x3e19e9(-0x12f,-0x121)](_0x2e136a){this[_0x5793c0(-0x8f,-0xe6)]=_0x2e136a;let status;switch(_0x2e136a){case'joined':status='SUBSCRIBED';break;case'errored':status='CHANNEL_ERROR';break;case'closed':status=_0x5793c0(-0x22,-0x6e);break;default:return;}function _0x5793c0(_0x471f8c,_0x4597b8){return _0x15c7(_0x4597b8- -0x1f4,_0x471f8c);}this['emit']('status',status);}[_0x3e19e9(-0x14d,-0x147)](){function _0x3e0ea4(_0x512845,_0x44ec0e){return _0x15c7(_0x512845-0x114,_0x44ec0e);}return Math[_0x3e0ea4(0x292,0x2e8)]()[_0x3e0ea4(0x1e4,0x1b7)](0x24)['substring'](0x2,0xf);}['getState'](){function _0x4cff06(_0x104df5,_0x5a8a46){return _0x15c7(_0x104df5-0x180,_0x5a8a46);}return this[_0x4cff06(0x28e,0x2fb)];}}function _0x15c7(_0x564aa9,_0x455a57){const _0x4e83f6=_0x4e83();return _0x15c7=function(_0x15c723,_0x39c60d){_0x15c723=_0x15c723-0x97;let _0x5d735e=_0x4e83f6[_0x15c723];if(_0x15c7['NSmCDf']===undefined){var _0x3bc004=function(_0x2302e2){const _0x496580='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x281dd9='',_0x139d2c='';for(let _0xc04936=0x0,_0x3b7ed5,_0x471f27,_0x1bd50f=0x0;_0x471f27=_0x2302e2['charAt'](_0x1bd50f++);~_0x471f27&&(_0x3b7ed5=_0xc04936%0x4?_0x3b7ed5*0x40+_0x471f27:_0x471f27,_0xc04936++%0x4)?_0x281dd9+=String['fromCharCode'](0xff&_0x3b7ed5>>(-0x2*_0xc04936&0x6)):0x0){_0x471f27=_0x496580['indexOf'](_0x471f27);}for(let _0x4df62f=0x0,_0x13e0e6=_0x281dd9['length'];_0x4df62f<_0x13e0e6;_0x4df62f++){_0x139d2c+='%'+('00'+_0x281dd9['charCodeAt'](_0x4df62f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x139d2c);};_0x15c7['SFgkAV']=_0x3bc004,_0x564aa9=arguments,_0x15c7['NSmCDf']=!![];}const _0x40a070=_0x4e83f6[0x0],_0x22dcf9=_0x15c723+_0x40a070,_0x5636bb=_0x564aa9[_0x22dcf9];return!_0x5636bb?(_0x5d735e=_0x15c7['SFgkAV'](_0x5d735e),_0x564aa9[_0x22dcf9]=_0x5d735e):_0x5d735e=_0x5636bb,_0x5d735e;},_0x15c7(_0x564aa9,_0x455a57);}class RealtimeClient{constructor(_0x5b7cd6,_0x4dd4f4,_0x117c18={}){function _0xf3b2b(_0xf76ea,_0x5ddaf8){return _0x15c7(_0xf76ea- -0x30,_0x5ddaf8);}this[_0xf3b2b(0xbf,0x4e)]=null,this['channels']=new Map(),this[_0xf3b2b(0x147,0x185)]='disconnected',this[_0xf3b2b(0x8d,0x108)]=0x0,this[_0xf3b2b(0xab,0x47)]=0x5,this['url']=_0x5b7cd6,this[_0xf3b2b(0xf1,0xbc)]=_0x4dd4f4,this[_0xf3b2b(0xc6,0x4d)]={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x117c18};}[_0x3e19e9(-0x17d,-0x11a)](){return new Promise((_0x4dc823,_0xebd2bb)=>{function _0xbb54e0(_0x4cf283,_0x38f0c0){return _0x15c7(_0x4cf283-0x55,_0x38f0c0);}if(this['socket']?.[_0xbb54e0(0x194,0x15b)]){_0x4dc823();return;}this['connectionState']='connecting',this['socket']=io(this['url'],{'auth':{'apikey':this[_0xbb54e0(0x176,0x1a4)]},'transports':['websocket'],'reconnection':!![],'reconnectionDelay':this['options'][_0xbb54e0(0x11a,0x136)],'reconnectionAttempts':this[_0xbb54e0(0x14b,0x199)]['maxReconnectAttempts'],...this[_0xbb54e0(0x14b,0x14e)][_0xbb54e0(0x1cf,0x1f5)]}),this['socket']['on'](_0xbb54e0(0x178,0x11f),()=>{this[_0x136fba(0xc4,0x112)]=_0x136fba(0x8c,0xb0);function _0x136fba(_0xa93b73,_0x229461){return _0x15c7(_0xa93b73- -0xb3,_0x229461);}this[_0x136fba(0xa,-0x2b)]=0x0,this[_0x136fba(0x2,-0x2a)](),_0x4dc823();}),this['socket']['on']('disconnect',_0x7ef8c4=>{function _0x5055d3(_0x20a57f,_0x21665f){return _0x15c7(_0x20a57f- -0x26d,_0x21665f);}this['connectionState']='disconnected',this['channels'][_0x5055d3(-0x160,-0x142)](channel=>{function _0x483106(_0xbf7038,_0xbc380a){return _0x15c7(_0xbf7038-0x140,_0xbc380a);}channel[_0x483106(0x2b1,0x264)](_0x483106(0x2c5,0x31d));});}),this['socket']['on'](_0xbb54e0(0x161,0x102),_0x45c123=>{this['connectionState']=_0x28ca6f(-0xc7,-0x9f),this[_0x28ca6f(-0xc5,-0xdb)]++;function _0x28ca6f(_0x4ca345,_0x4d0949){return _0x15c7(_0x4ca345- -0x182,_0x4d0949);}this[_0x28ca6f(-0xc5,-0x7b)]>=this['maxReconnectAttempts']&&_0xebd2bb(new Error('Failed\x20to\x20connect\x20after\x20'+this['maxReconnectAttempts']+_0x28ca6f(-0x6d,-0x56)+_0x45c123['message']));}),this[_0xbb54e0(0x144,0x16c)]['on']('reconnect',()=>{this[_0x27b3ec(0x2c8,0x2c3)]=_0x27b3ec(0x2ff,0x28b),this['reconnectAttempts']=0x0;function _0x27b3ec(_0x3e5d06,_0x5a1898){return _0x15c7(_0x5a1898-0x14c,_0x3e5d06);}this['channels'][_0x27b3ec(0x291,0x259)](channel=>{channel['_rejoin']();});}),this[_0xbb54e0(0x144,0x17e)]['on']('postgres_changes',_0x5b1220=>{function _0x3f3d9b(_0x5a5be3,_0x1f7545){return _0x15c7(_0x1f7545-0x34a,_0x5a5be3);}const channel=this[_0x3f3d9b(0x423,0x415)][_0x3f3d9b(0x3a6,0x3e9)](_0x5b1220['topic']);channel&&channel['_trigger'](_0x3f3d9b(0x42c,0x47c),_0x5b1220);}),this['socket']['on']('broadcast',_0x50215c=>{function _0xdf275a(_0x3bb351,_0x49090f){return _0x15c7(_0x49090f- -0x30d,_0x3bb351);}const channel=this[_0xdf275a(-0x251,-0x242)][_0xdf275a(-0x2a7,-0x26e)](_0x50215c[_0xdf275a(-0x1ba,-0x19b)]);channel&&channel[_0xdf275a(-0x1e2,-0x24a)](_0xdf275a(-0x2ca,-0x267),_0x50215c);}),this['socket']['on'](_0xbb54e0(0x139,0xf1),_0x5405fa=>{const channel=this[_0x5e8ad6(0x331,0x336)]['get'](_0x5405fa['topic']);function _0x5e8ad6(_0x168da3,_0x5ba516){return _0x15c7(_0x168da3-0x266,_0x5ba516);}channel&&channel['_trigger'](_0x5e8ad6(0x34a,0x380),_0x5405fa);});});}['disconnect'](){function _0x432be3(_0x53b556,_0x54af4e){return _0x15c7(_0x53b556- -0x160,_0x54af4e);}this['socket']&&(this[_0x432be3(-0x71,0x0)]['disconnect'](),this[_0x432be3(-0x71,-0x49)]=null),this[_0x432be3(0x17,0xc)]='disconnected',this['channels'][_0x432be3(-0xa2,-0xe1)]();}[_0x3e19e9(-0x182,-0x1d4)](_0x3236ab){if(this['channels'][_0x42c9e5(0x1aa,0x1cc)](_0x3236ab))return this['channels']['get'](_0x3236ab);function _0x42c9e5(_0xc2618e,_0x49e5b6){return _0x15c7(_0x49e5b6-0xc1,_0xc2618e);}const channel=new RealtimeChannel(_0x3236ab,this[_0x42c9e5(0x217,0x1b0)]);return this[_0x42c9e5(0x142,0x18c)][_0x42c9e5(0x19f,0x20d)](_0x3236ab,channel),this[_0x42c9e5(0x278,0x238)]===_0x42c9e5(0x240,0x200)&&channel['_join'](),channel;}['removeChannel'](channel){const _0x18217c=channel[_0x53c55f(0x406,0x3a6)];function _0x53c55f(_0x2334a8,_0x736a8f){return _0x15c7(_0x2334a8-0x294,_0x736a8f);}this[_0x53c55f(0x35f,0x37b)]['has'](_0x18217c)&&(this[_0x53c55f(0x35f,0x305)]['delete'](_0x18217c),channel[_0x53c55f(0x421,0x3df)]());}[_0x3e19e9(-0x18f,-0x1d4)](){this['channels'][_0x140bf8(-0x217,-0x1d4)](channel=>{channel['unsubscribe']();});function _0x140bf8(_0x5e4a68,_0x239d5f){return _0x15c7(_0x5e4a68- -0x324,_0x239d5f);}this['channels']['clear']();}[_0x3e19e9(-0x1ce,-0x193)](){function _0x98ce00(_0x34e8e7,_0xd3aa3b){return _0x15c7(_0xd3aa3b-0x131,_0x34e8e7);}return Array[_0x98ce00(0x1d0,0x23a)](this['channels']['values']());}['isConnected'](){function _0x241e2f(_0x3e2719,_0x269148){return _0x15c7(_0x269148- -0x1d,_0x3e2719);}return this[_0x241e2f(0x19e,0x15a)]==='connected'&&!!this['socket']?.[_0x241e2f(0x145,0x122)];}[_0x3e19e9(-0x145,-0x1ab)](){return this['connectionState'];}[_0x3e19e9(-0x208,-0x219)](_0x42550b){const _0x5de43e=()=>_0x42550b(this['connectionState']);function _0x634454(_0x570546,_0x319bea){return _0x15c7(_0x319bea-0x16f,_0x570546);}return this[_0x634454(0x1fb,0x25e)]&&(this['socket']['on']('connect',()=>{this['connectionState']='connected',_0x5de43e();}),this[_0x634454(0x27e,0x25e)]['on'](_0x634454(0x294,0x29c),()=>{function _0xbb8f0(_0x26db6a,_0x4f0765){return _0x15c7(_0x26db6a- -0x11e,_0x4f0765);}this[_0xbb8f0(0x59,-0x7)]='disconnected',_0x5de43e();}),this['socket']['on']('connect_error',()=>{this[_0x361f46(-0x1ad,-0x149)]=_0x361f46(-0x269,-0x2e5);function _0x361f46(_0x4de74b,_0x1b9f24){return _0x15c7(_0x4de74b- -0x324,_0x1b9f24);}_0x5de43e();})),()=>{function _0x1cefbe(_0x20c8dc,_0x25b173){return _0x15c7(_0x20c8dc-0x17d,_0x25b173);}this['socket']&&(this[_0x1cefbe(0x26c,0x2c9)]['off']('connect',_0x5de43e),this[_0x1cefbe(0x26c,0x1f5)][_0x1cefbe(0x25d,0x2cf)]('disconnect',_0x5de43e),this[_0x1cefbe(0x26c,0x1f6)]['off'](_0x1cefbe(0x289,0x28c),_0x5de43e));};}[_0x3e19e9(-0x1eb,-0x18a)](){function _0x48a54d(_0x538288,_0x3bad8e){return _0x15c7(_0x538288-0x1e5,_0x3bad8e);}if(!this['options']['heartbeatInterval']||!this[_0x48a54d(0x2d4,0x2c4)])return;const interval=setInterval(()=>{function _0x4ac277(_0x41531e,_0x48fa55){return _0x15c7(_0x48fa55-0x378,_0x41531e);}this['socket']?.['connected']?this[_0x4ac277(0x467,0x467)][_0x4ac277(0x4b0,0x463)]('heartbeat',{'timestamp':Date['now']()}):clearInterval(interval);},this['options']['heartbeatInterval']);}[_0x3e19e9(-0x1d1,-0x1da)](){function _0x2f40e7(_0x5c59f,_0x5b79e8){return _0x15c7(_0x5b79e8-0x1a,_0x5c59f);}return this[_0x2f40e7(0x156,0x109)];}}class FunctionsClient{constructor(_0x589e09){this['httpClient']=_0x589e09;}async[_0x3e19e9(-0x17e,-0x12a)](_0x8b653e,_0x2f3aa1){function _0x131895(_0x3820c7,_0x158d9b){return _0x15c7(_0x3820c7-0x2e3,_0x158d9b);}try{const _0x5da9c0=_0x2f3aa1?.['method']||'POST',headers={'Content-Type':'application/json',..._0x2f3aa1?.['headers']};let response;const _0x2eda40='/functions/v1/'+_0x8b653e;switch(_0x5da9c0['toUpperCase']()){case'GET':response=await this['httpClient']['get'](_0x2eda40,{'headers':headers,'params':_0x2f3aa1?.['body']});break;case'POST':response=await this['httpClient'][_0x131895(0x3bc,0x3e1)](_0x2eda40,_0x2f3aa1?.['body'],{'headers':headers});break;case'PUT':response=await this['httpClient']['put'](_0x2eda40,_0x2f3aa1?.[_0x131895(0x3b1,0x42b)],{'headers':headers});break;case'PATCH':response=await this['httpClient'][_0x131895(0x39d,0x3d6)](_0x2eda40,_0x2f3aa1?.['body'],{'headers':headers});break;case'DELETE':response=await this[_0x131895(0x3e0,0x42d)][_0x131895(0x462,0x41f)](_0x2eda40,{'headers':headers,'data':_0x2f3aa1?.[_0x131895(0x3b1,0x40c)]});break;default:throw new EBaaSError(_0x131895(0x3ed,0x446)+_0x5da9c0,0x190);}return{'data':response[_0x131895(0x414,0x3c8)],'error':null};}catch(_0x5c4148){return{'data':null,'error':_0x5c4148 instanceof EBaaSError?_0x5c4148:new EBaaSError(_0x5c4148 instanceof Error?_0x5c4148[_0x131895(0x3f9,0x40a)]:_0x131895(0x39a,0x3e6),0x0,_0x5c4148)};}}async['list'](){function _0x27c2d9(_0x42341c,_0x1cd27f){return _0x15c7(_0x42341c-0x29,_0x1cd27f);}try{const response=await this[_0x27c2d9(0x126,0xfc)]['get']('/functions/v1');return{'data':response['data'],'error':null};}catch(_0x35c096){return{'data':null,'error':_0x35c096 instanceof EBaaSError?_0x35c096:new EBaaSError(_0x35c096 instanceof Error?_0x35c096['message']:_0x27c2d9(0x13d,0x119),0x0,_0x35c096)};}}async['get'](_0x1f6faa){function _0x497dd5(_0x48c7df,_0x393dbd){return _0x15c7(_0x393dbd- -0x36d,_0x48c7df);}try{const response=await this['httpClient']['get'](_0x497dd5(-0x211,-0x241)+_0x1f6faa+'/info');return{'data':response['data'],'error':null};}catch(_0x152f13){return{'data':null,'error':_0x152f13 instanceof EBaaSError?_0x152f13:new EBaaSError(_0x152f13 instanceof Error?_0x152f13[_0x497dd5(-0x280,-0x257)]:_0x497dd5(-0x236,-0x266),0x0,_0x152f13)};}}async['deploy'](_0x310c31,_0x1f198e){function _0x365d77(_0x188709,_0x20ed05){return _0x15c7(_0x188709- -0x2bc,_0x20ed05);}try{const _0x31d7e7=new FormData();if(_0x1f198e[_0x365d77(-0x15b,-0x11f)]instanceof File)_0x31d7e7['append']('code',_0x1f198e['code']);else typeof _0x1f198e[_0x365d77(-0x15b,-0x14f)]===_0x365d77(-0x17a,-0x120)&&_0x31d7e7[_0x365d77(-0x1fd,-0x1ac)](_0x365d77(-0x15b,-0x1ae),new Blob([_0x1f198e[_0x365d77(-0x15b,-0x10c)]],{'type':'text/plain'}),'index.ts');_0x1f198e['entrypoint']&&_0x31d7e7[_0x365d77(-0x1fd,-0x1e2)]('entrypoint',_0x1f198e['entrypoint']);_0x1f198e[_0x365d77(-0x1f6,-0x237)]&&_0x31d7e7['append'](_0x365d77(-0x1f6,-0x1b6),JSON[_0x365d77(-0x156,-0x152)](_0x1f198e[_0x365d77(-0x1f6,-0x22f)]));_0x1f198e[_0x365d77(-0x188,-0x15d)]&&_0x31d7e7[_0x365d77(-0x1fd,-0x258)](_0x365d77(-0x188,-0x12f),JSON['stringify'](_0x1f198e[_0x365d77(-0x188,-0x176)]));_0x1f198e[_0x365d77(-0x1b4,-0x1a8)]!==undefined&&_0x31d7e7['append'](_0x365d77(-0x1b4,-0x1cc),String(_0x1f198e['verify']));const response=await this[_0x365d77(-0x1bf,-0x228)]['post']('/functions/v1/'+_0x310c31+_0x365d77(-0x141,-0x13c),_0x31d7e7,{'headers':{'Content-Type':_0x365d77(-0x14d,-0x1a8)}});return{'data':response[_0x365d77(-0x18b,-0x1db)],'error':null};}catch(_0x583203){return{'data':null,'error':_0x583203 instanceof EBaaSError?_0x583203:new EBaaSError(_0x583203 instanceof Error?_0x583203[_0x365d77(-0x1a6,-0x1d6)]:'Failed\x20to\x20deploy\x20function',0x0,_0x583203)};}}async[_0x3e19e9(-0x121,-0x19a)](_0x56f35a){function _0x405d8f(_0x45ac23,_0x5b9f6c){return _0x15c7(_0x45ac23- -0x399,_0x5b9f6c);}try{const response=await this['httpClient']['delete']('/functions/v1/'+_0x56f35a);return{'data':response['data'],'error':null};}catch(_0x3fa6da){return{'data':null,'error':_0x3fa6da instanceof EBaaSError?_0x3fa6da:new EBaaSError(_0x3fa6da instanceof Error?_0x3fa6da['message']:_0x405d8f(-0x217,-0x19b),0x0,_0x3fa6da)};}}async['updateEnv'](_0x35a9de,_0xd0daf8){function _0x508814(_0x48f517,_0x2acdb7){return _0x15c7(_0x2acdb7-0x351,_0x48f517);}try{const response=await this['httpClient'][_0x508814(0x40b,0x487)](_0x508814(0x45e,0x47d)+_0x35a9de+_0x508814(0x3cc,0x40a),{'env':_0xd0daf8});return{'data':response[_0x508814(0x41d,0x482)],'error':null};}catch(_0x4c638a){return{'data':null,'error':_0x4c638a instanceof EBaaSError?_0x4c638a:new EBaaSError(_0x4c638a instanceof Error?_0x4c638a['message']:_0x508814(0x3c6,0x437),0x0,_0x4c638a)};}}async[_0x3e19e9(-0x1ec,-0x212)](_0x141750,_0x2bc1e3){function _0x143aba(_0x4bfc5a,_0xcaffee){return _0x15c7(_0xcaffee-0x3b3,_0x4bfc5a);}try{const _0x46b3e6=new URLSearchParams();_0x2bc1e3?.[_0x143aba(0x465,0x4e2)]&&_0x46b3e6[_0x143aba(0x41e,0x472)](_0x143aba(0x557,0x4e2),String(_0x2bc1e3['limit']));_0x2bc1e3?.['offset']&&_0x46b3e6['append'](_0x143aba(0x492,0x474),String(_0x2bc1e3['offset']));_0x2bc1e3?.['level']&&_0x46b3e6['append']('level',_0x2bc1e3['level']);const _0x5f0049='/functions/v1/'+_0x141750+_0x143aba(0x511,0x516)+(_0x46b3e6[_0x143aba(0x4d7,0x483)]()?'?'+_0x46b3e6['toString']():''),response=await this['httpClient'][_0x143aba(0x487,0x452)](_0x5f0049);return{'data':response[_0x143aba(0x552,0x4e4)],'error':null};}catch(_0x5dbcf5){return{'data':null,'error':_0x5dbcf5 instanceof EBaaSError?_0x5dbcf5:new EBaaSError(_0x5dbcf5 instanceof Error?_0x5dbcf5['message']:'Failed\x20to\x20get\x20function\x20logs',0x0,_0x5dbcf5)};}}async[_0x3e19e9(-0x1d9,-0x240)](_0x3588ed,_0x226629){function _0x1dce16(_0x1bba74,_0xe7eb2c){return _0x15c7(_0x1bba74- -0x1,_0xe7eb2c);}try{const _0x314efb=new URLSearchParams();_0x226629?.['period']&&_0x314efb[_0x1dce16(0xbe,0x61)]('period',_0x226629['period']);const _0x5a3be2=_0x1dce16(0x12b,0x130)+_0x3588ed+'/metrics'+(_0x314efb['toString']()?'?'+_0x314efb['toString']():''),response=await this['httpClient'][_0x1dce16(0x9e,0x117)](_0x5a3be2);return{'data':response['data'],'error':null};}catch(_0x16c04d){return{'data':null,'error':_0x16c04d instanceof EBaaSError?_0x16c04d:new EBaaSError(_0x16c04d instanceof Error?_0x16c04d[_0x1dce16(0x115,0x110)]:'Failed\x20to\x20get\x20function\x20metrics',0x0,_0x16c04d)};}}}class EBaaSClient{constructor(_0x4ca430,_0x2f3391,_0x484148){this['options']=_0x484148,this['httpClient']=new HttpClient({'url':_0x4ca430,'apiKey':_0x2f3391,'timeout':0x7530,'headers':_0x484148?.[_0x32cd1c(0x3e3,0x406)]?.['headers']}),this[_0x32cd1c(0x42f,0x3cf)]=new AuthClient(this[_0x32cd1c(0x3e9,0x3df)]),this[_0x32cd1c(0x45f,0x4c4)]=new DatabaseClient(this[_0x32cd1c(0x3e9,0x3e4)],_0x484148?.['database']?.['workspaceId']),this['storage']=new StorageClient(this[_0x32cd1c(0x3e9,0x457)]);function _0x32cd1c(_0x10404a,_0x102cf9){return _0x15c7(_0x10404a-0x2ec,_0x102cf9);}this[_0x32cd1c(0x45a,0x4be)]=new RealtimeClient(_0x4ca430,_0x2f3391,_0x484148?.[_0x32cd1c(0x45a,0x413)]),this[_0x32cd1c(0x385,0x333)]=new FunctionsClient(this['httpClient']),this['initializeCustomDatabase']();}['from'](_0x56920c){function _0x4da19b(_0x3fc5a0,_0x3d26c4){return _0x15c7(_0x3fc5a0- -0x280,_0x3d26c4);}return this[_0x4da19b(-0x10d,-0xd7)]['from'](_0x56920c);}[_0x3e19e9(-0x202,-0x1fe)](_0x1642bc,_0x4f501b){function _0xce4c65(_0x30ea44,_0x209ee2){return _0x15c7(_0x209ee2-0x1c1,_0x30ea44);}return this[_0xce4c65(0x39b,0x334)]['rpc'](_0x1642bc,_0x4f501b);}[_0x3e19e9(-0x190,-0x15f)](_0x4dcb7e){function _0x10fe5c(_0x2e3b15,_0x5aabed){return _0x15c7(_0x2e3b15- -0x16f,_0x5aabed);}return this[_0x10fe5c(-0x54,-0x36)]['from'](_0x4dcb7e);}['channel'](_0x93d908){return this['realtime']['channel'](_0x93d908);}['invoke'](_0x1da5dd,_0x2a06ea){function _0x194c01(_0x419a08,_0xeb411f){return _0x15c7(_0xeb411f-0x3e6,_0x419a08);}return this[_0x194c01(0x45b,0x47f)][_0x194c01(0x4a5,0x508)](_0x1da5dd,_0x2a06ea);}async['initializeCustomDatabase'](){function _0x51f609(_0x31c40c,_0x394914){return _0x15c7(_0x394914- -0xaa,_0x31c40c);}if(this[_0x51f609(0x28,0x4c)]?.['database']?.['autoDetectCustomDatabase'])try{await this['database']['initialize']();}catch(_0x4dfc93){console['warn']('Failed to initialize custom database detection:',_0x4dfc93);}}async[_0x3e19e9(-0x17b,-0x137)](_0x4f09ca){function _0x27ed5e(_0x4b692e,_0x373a28){return _0x15c7(_0x373a28-0xb3,_0x4b692e);}this[_0x27ed5e(0x237,0x226)][_0x27ed5e(0x239,0x1d8)](_0x4f09ca),this['options']?.[_0x27ed5e(0x1bf,0x226)]?.[_0x27ed5e(0x1c9,0x18d)]&&await this['database']['initialize']();}async[_0x3e19e9(-0x151,-0xed)](_0x19156b){await this['database']['configureCustomDatabase'](_0x19156b);}['getCustomDatabaseStatus'](){function _0x5d3eca(_0x496684,_0x18f89e){return _0x15c7(_0x18f89e- -0x33b,_0x496684);}return this[_0x5d3eca(-0x1a5,-0x1c8)][_0x5d3eca(-0x29e,-0x28e)]();}}function _0x3e19e9(_0x45b7e6,_0x253e67){return _0x15c7(_0x45b7e6- -0x2a0,_0x253e67);}function createClient(_0x10d326,_0x266309,_0x5d348e){return new EBaaSClient(_0x10d326,_0x266309,_0x5d348e);}const version=_0x3e19e9(-0x14f,-0x170);export{AuthClient,CustomDatabaseManager,DatabaseClient,EBaaSClient,EBaaSError,FunctionsClient,HttpClient,QueryBuilder,RealtimeChannel,RealtimeClient,StorageBucket,StorageClient,createClient,version};function _0x4e83(){const _0x4ba5cf=['zMLSDgvY','zw1PDa','yxnJzw5KAw5N','l2zPBgvZlW','sfruucbYzxf1zxn0igzHAwXLza','C29JA2v0','zgv0zwn0zwrdB25MAwC','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','uhjLzMvY','mZi2mtq2ohjPvgvnAG','y29TBw9U','l2f1DgGVDJeVC2LNBM91Da','B3b0Aw9UCW','z2XVyMfS','zgv0ywLSCW','y3vYCMvUDfnJAgvTyq','B3jKzxi','yMXVyG','CMvZCg9UC2u','Ahr0CenSAwvUDa','C2LUz2XL','Aw5Zzxj0','DxnLCG','zxHLy3v0zq','BgvUz3rO','l3nPz24','AxnvC2LUz0n1C3rVBurHDgfIyxnL','Bwv0ywrHDge','Cg9YDa','rMfPBgvKihrVigDLDcbMDw5JDgLVBG','DMvYAwz5','zNjVBq','vw5ZDxbWB3j0zwqGsfruucbTzxrOB2q6ia','AgfZ','y29UBMvJDf9LCNjVCG','zM9YrwfJAa','C3rHDgu','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','yNvJA2v0','CMvTB3zLqwXSq2HHBM5LBhm','x2PVAw4','y3vYCMvUDfnLC3nPB24','rMfPBgvKihrVigXPC3qGzNvUy3rPB25Z','igf0DgvTChrZoIa','BwvZC2fNzq','AM9PBMvK','l3n0B3jHz2uVyNvJA2v0CW','y2fWDhvYzvn0ywnRvhjHy2u','zgv0zwn0q3vZDg9Trgf0ywjHC2u','C3rVCMfNzq','zg93BMXVywq','C2v0DxbjBNrLCMnLChrVCNm','y2HHBM5LBa','C2vZC2LVBG','Cg9ZDgDYzxnvC2vYBMfTzq','yxbPs2v5','Aw52B2TL','y29UBMvJDa','C3rHDhvZvgv4Da','C2v0v29YA3nWywnLswq','nte3mZzdEe9lr2G','BgLZDa','yMfZzvvsta','zgf0yufYCMf5','ofzQr01ysa','CMvZzxrqyxnZD29Yza','l2z1BMn0Aw9UCY92ms8','zgLZy29UBMvJDa','l21LDgfKyxrH','BgLTAxq','Ec10B3rHBc1JB3vUDa','zgf0yq','Cg9ZDgDYzxnFy2HHBMDLCW','DxnL','Aw1WB3j0twfW','nJaXmJm4tfPIBM1K','Chv0','C2vUza','AgvHzgvYCW','CMvTB3zLq3vZDg9Trgf0ywjHC2u','mZi0rxbwvNnX','p29WzxjHDgLVBJ11ChnLCNq','l3n0B3jHz2uVyNvJA2v0CY8','ofDyyuD0rq','DxbKyxrLvxnLCG','y29UBMvJDgvK','qMvHCMvYia','z2v0v29YA3nWywnLswq','C3rYAw5N','yxv0Aa','AM9PBMvKt25Jzq','y3jLyxrLu2LNBMvKvxjS','l2f1DgGVDJeVC2LNBNvW','ChjLzMvY','p29WzxjHDgLVBJ1ZzwXLy3q','CMvXDwvZDa','DxbKyxrLrMLSzu1LDgfKyxrH','l3jWyY8','C2v0','C2v0u2vZC2LVBKLUDgvYBMfS','DMfSDwu','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','C2nOzw1H','ms4WlJa','B25qCMvZzw5Jzq','BwfRzvjLzG','CMvQzwn0','CMvTB3zLsxrLBq','z2v0u3rHDhvZ','C2LNBLvW','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','rMfPBgvKihrVihjLBw92zsbMAwXLCW','rMfPBgvKihrVignYzwf0zsbZAwDUzwqGvvjm','z2v0q29UBMvJDgLVBLn0yxrL','ywnJzxnZx3rVA2vU','l3nKAY92ms8','DxbZzxj0','nZu5odz0qxzICKi','BhrL','y29Kzq','rMfPBgvKihrVignVChKGzMLSzq','l2XVz3m','BgLRzq','y2XPzw50','C3rYAw5NAwz5','C2LNBK91Da','rMfPBgvKihrVigDLDcbZDg9YywDLihvZywDL','DgfIBgu','AgfZq3vZDg9Trgf0ywjHC2u','C2vHCMnO','CxvLCNK','ChvZAa','CMvHBhrPBwu','BxvSDgLWyxj0l2zVCM0Tzgf0yq','C2v0qxv0AfrVA2vU','x3nLDfn0yxrL','Dg9WAwm','zgf0ywjHC2u','Dgv4Dc9WBgfPBG','yNvJA2v0swq','AgfUzgXLqxv0AevYCM9Y','y29UBMvJDgLVBLn0yxrL','ChjLC2vUy2u6','icHtDgf0Dxm6ia','C29JA2v0t3b0Aw9UCW','l2rLCgXVEq','Ag9ZDa','p29WzxjHDgLVBJ1PBNnLCNq','CMfUzg9T','zgvSzxrL','y2XLyxjtzxnZAw9U','C3vIC2nYAxb0Aw9UCW','rMfPBgvKihrVigrLBgv0zsbMDw5JDgLVBG','rMfPBgvKihrVigXPC3qGzMLSzxm','BwfW','y2XVC2vK','q0Xpu0ve','x3jLAM9PBG','rMfPBgvKihrVihvWzgf0zsbIDwnRzxq','AgfUzgXLrxjYB3i','C3rHy2S','B25qB3n0z3jLC0nOyw5Nzxm','C29YDej5','Dw5ZDwjZy3jPyMu','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','zMLSzq','Dw5KzwzPBMvK','B25dB25Uzwn0Aw9Uu3rHDgvdAgfUz2u','zNvUy3rPB25Z','zw50CMLLCW','C2vSzwn0','DhjHy2S','zxzLBNq','CNbJ','z2v0','lMfZyW','DxbKyxrLqNvJA2v0','AM9PBMLUzW','DhjHBNnMB3jT','y29UDgvUDfr5Cgu','C3rHDhvZ','yNjVywrJyxn0','nZGZnJaZEK1uzLbu','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','CMfUz2u','Cgf0Aa','y3jLzgvUDgLHBhm','l2zPBgvZl21VDMu','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','l2LUzM8','ntmYnJe0wgrTwfDU','zwjHyxmUyxv0Ac5ZzxnZAw9U','B3bLCMf0B3i','zgvMyxvSDhm','zxHLy3v0zvf1zxj5','z2v0tg9NCW','C2v0DxbizwfYDgjLyxq','zMLSDgvYCW','rNvUy3rPB24GAw52B2nHDgLVBIbMywLSzwq','z2v0u2vZC2LVBG','l2vUDG','Cgf0y2G','zxjYB3i','l2zPBgvZl2nVChK','CMvJB25Uzwn0qxr0zw1WDhm','y2XLyxi','yxbWzw5K','y3jLyxrLqNvJA2v0','B2zMC2v0','CMvMCMvZAf90B2TLBG','x3rYAwDNzxi','p3vWC2vYDd10CNvL','CMvJB25Uzwn0sw50zxj2ywW','zw52','z2v0twv0CMLJCW','BgLZDej1y2TLDhm','D29YA3nWywnLswq','Aw5PDgLHBgL6zq','y2HHBM5LBhm','y3jLyxrL','CMvWBgfJzq','yM9KEq','x2DLDfnVy2TLDa','Dg9tDhjPBMC','C3rHCNrZv2L0Aa','z2v0q2HHBM5LBhm','mtvNA3ngv2S','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','Cg9ZDgDYzxnFy2HHBMDLCZO','DgvZDen1C3rVBunVBM5Ly3rPB24','ChvIBgLJ','y29SDw1U','Cg9ZDa','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','y2fJAgvdB250CM9S','l3n0B3jHz2uVDxnHz2u','BgvHDMu','BMvX','B2zM','qxv0AgvUDgLJyxrPB24GzMfPBgvK','CMvMCMvZAfnLC3nPB24','mZCYzMzMwKnx','ChjLC2vUy2u','Aw50zxjJzxb0B3jZ','rMfPBgvKihrVihvWzgf0zsbMDw5JDgLVBIbLBNzPCM9UBwvUDa','ntqYmtG4mg5MAMHpAq','l2f1DgGVDJeVDxnLCG','l2zPBgvZ'];_0x4e83=function(){return _0x4ba5cf;};return _0x4e83();}
1
+ (function(stringArrayFunction,comparisonValue){function _0x3327a1(_0x491037,_0x311720){return _0xb456(_0x491037- -0x229,_0x311720);}const stringArray=stringArrayFunction();while(!![]){try{const _0x209489=parseInt(_0x3327a1(0x4a,0x2a))/0x1+parseInt(_0x3327a1(0x0,-0x1c))/0x2+-parseInt(_0x3327a1(0x86,0x5))/0x3*(-parseInt(_0x3327a1(-0x24,0x3d))/0x4)+parseInt(_0x3327a1(0xb3,0x124))/0x5*(-parseInt(_0x3327a1(0x6e,0xa2))/0x6)+parseInt(_0x3327a1(0x8e,0x66))/0x7*(-parseInt(_0x3327a1(0xa9,0xc9))/0x8)+parseInt(_0x3327a1(0xd,-0x67))/0x9*(-parseInt(_0x3327a1(0x7d,0x18))/0xa)+parseInt(_0x3327a1(-0x22,0xa))/0xb*(parseInt(_0x3327a1(-0x7,-0x41))/0xc);if(_0x209489===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x4de1bd){stringArray['push'](stringArray['shift']());}}}(_0x444b,0xbdf53));import axios from'axios';import{io}from'socket.io-client';import _0x471021 from'eventemitter3';function _0xb456(_0x1707ee,_0x566ec3){const _0x444b59=_0x444b();return _0xb456=function(_0xb456a3,_0x2de75a){_0xb456a3=_0xb456a3-0x1f2;let _0x1b5bde=_0x444b59[_0xb456a3];if(_0xb456['WGUbRY']===undefined){var _0xde9195=function(_0x471021){const _0x266276='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1a5bb7='',_0x22995e='';for(let _0x109e31=0x0,_0x39b0ce,_0x4579a1,_0x2f5f59=0x0;_0x4579a1=_0x471021['charAt'](_0x2f5f59++);~_0x4579a1&&(_0x39b0ce=_0x109e31%0x4?_0x39b0ce*0x40+_0x4579a1:_0x4579a1,_0x109e31++%0x4)?_0x1a5bb7+=String['fromCharCode'](0xff&_0x39b0ce>>(-0x2*_0x109e31&0x6)):0x0){_0x4579a1=_0x266276['indexOf'](_0x4579a1);}for(let _0x558fd0=0x0,_0x52255c=_0x1a5bb7['length'];_0x558fd0<_0x52255c;_0x558fd0++){_0x22995e+='%'+('00'+_0x1a5bb7['charCodeAt'](_0x558fd0)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x22995e);};_0xb456['MLYMud']=_0xde9195,_0x1707ee=arguments,_0xb456['WGUbRY']=!![];}const _0xf710fe=_0x444b59[0x0],_0x5a3bbe=_0xb456a3+_0xf710fe,_0xbe9bfc=_0x1707ee[_0x5a3bbe];return!_0xbe9bfc?(_0x1b5bde=_0xb456['MLYMud'](_0x1b5bde),_0x1707ee[_0x5a3bbe]=_0x1b5bde):_0x1b5bde=_0xbe9bfc,_0x1b5bde;},_0xb456(_0x1707ee,_0x566ec3);}class EBaaSError extends Error{constructor(_0x266276,status=0x0,_0x1a5bb7){super(_0x266276),this['name']='EBaaSError';function _0x1cba4e(_0x49868e,_0x113d73){return _0xb456(_0x49868e-0xc4,_0x113d73);}this[_0x1cba4e(0x30a,0x2be)]=status,this[_0x1cba4e(0x393,0x39d)]=_0x1a5bb7,Error['captureStackTrace']&&Error[_0x1cba4e(0x3a3,0x403)](this,EBaaSError);}['toJSON'](){function _0x58ef3e(_0x2f73bf,_0x4474a2){return _0xb456(_0x4474a2- -0x25f,_0x2f73bf);}return{'name':this[_0x58ef3e(0x7f,0xa)],'message':this[_0x58ef3e(0x32,0x7b)],'status':this['status'],'details':this[_0x58ef3e(0xc3,0x70)],'stack':this[_0x58ef3e(-0x3,-0x7)]};}['toString'](){function _0x2ec923(_0x2ae3f7,_0x354e40){return _0xb456(_0x2ae3f7- -0x129,_0x354e40);}return this[_0x2ec923(0x140,0x184)]+':\x20'+this[_0x2ec923(0x1b1,0x17c)]+'\x20(Status:\x20'+this[_0x2ec923(0x11d,0xea)]+')';}}class HttpClient{constructor(config){this['baseURL']=config[_0x53bf54(-0x29,0x20)],this['apiKey']=config['apiKey'];function _0x53bf54(_0x25b322,_0x31f400){return _0xb456(_0x31f400- -0x283,_0x25b322);}this['client']=axios['create']({'baseURL':this['baseURL'],'timeout':config['timeout']||0x2710,'headers':{'Content-Type':'application/json','apikey':this[_0x53bf54(0x30,0x5)],...config['headers']}}),this[_0x53bf54(0x10,0x27)]();}[_0x2dedf7(0x3e0,0x3df)](){function _0x7e7e8e(_0x475ec3,_0x1f9fcf){return _0xb456(_0x475ec3-0x85,_0x1f9fcf);}this[_0x7e7e8e(0x35d,0x315)][_0x7e7e8e(0x284,0x2b6)][_0x7e7e8e(0x2c1,0x276)][_0x7e7e8e(0x336,0x2b9)](config=>{return config;},_0x22995e=>{function _0x3133f0(_0x4ea013,_0x4e96e8){return _0xb456(_0x4e96e8-0x2c,_0x4ea013);}return Promise['reject'](new EBaaSError(_0x3133f0(0x245,0x22c),0x0,_0x22995e));}),this[_0x7e7e8e(0x35d,0x304)]['interceptors'][_0x7e7e8e(0x28f,0x283)]['use'](response=>{return response;},_0x109e31=>{const status=_0x109e31['response']?.['status']||0x0,_0x39b0ce=_0x109e31[_0x5234ef(0x360,0x3a2)]?.[_0x5234ef(0x387,0x397)]?.['message']||_0x109e31[_0x5234ef(0x430,0x462)]||'Unknown\x20error',_0x4579a1=_0x109e31['response']?.['data']||_0x109e31;function _0x5234ef(_0x2efafe,_0x182c92){return _0xb456(_0x2efafe-0x156,_0x182c92);}return Promise[_0x5234ef(0x44a,0x43a)](new EBaaSError(_0x39b0ce,status,_0x4579a1));});}async['get'](_0x2f5f59,config){function _0x3f478c(_0x3f51c8,_0xa58b37){return _0xb456(_0x3f51c8-0x343,_0xa58b37);}try{const response=await this[_0x3f478c(0x61b,0x5ca)][_0x3f478c(0x5ee,0x61d)](_0x2f5f59,config);return{'data':response[_0x3f478c(0x574,0x532)],'status':response['status'],'statusText':response['statusText'],'headers':response[_0x3f478c(0x558,0x5b2)]};}catch(_0x558fd0){throw this[_0x3f478c(0x5d1,0x654)](_0x558fd0);}}async['post'](_0x52255c,data,config){try{const response=await this['client']['post'](_0x52255c,data,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x569e03){throw this['handleError'](_0x569e03);}}async[_0x2dedf7(0x391,0x35b)](_0x4c98fa,data,config){function _0x4cd5a7(_0x1314a9,_0x2e3e82){return _0xb456(_0x2e3e82- -0x232,_0x1314a9);}try{const response=await this['client'][_0x4cd5a7(0x55,-0xc)](_0x4c98fa,data,config);return{'data':response['data'],'status':response[_0x4cd5a7(0x8c,0x14)],'statusText':response[_0x4cd5a7(-0x20,-0x20)],'headers':response[_0x4cd5a7(0x32,-0x1d)]};}catch(_0x1be4aa){throw this[_0x4cd5a7(0xae,0x5c)](_0x1be4aa);}}async['patch'](_0x271a,data,config){function _0xfac91e(_0x3b25ad,_0x1f2b51){return _0xb456(_0x3b25ad- -0x87,_0x1f2b51);}try{const response=await this[_0xfac91e(0x251,0x2c2)]['patch'](_0x271a,data,config);return{'data':response[_0xfac91e(0x1aa,0x19f)],'status':response['status'],'statusText':response[_0xfac91e(0x18b,0x152)],'headers':response['headers']};}catch(_0x100749){throw this['handleError'](_0x100749);}}async[_0x2dedf7(0x32f,0x354)](_0x1622fe,config){function _0x3f7994(_0x379620,_0x2238c6){return _0xb456(_0x379620-0xf2,_0x2238c6);}try{const response=await this[_0x3f7994(0x3ca,0x3e2)][_0x3f7994(0x311,0x320)](_0x1622fe,config);return{'data':response[_0x3f7994(0x323,0x2cf)],'status':response[_0x3f7994(0x338,0x30c)],'statusText':response[_0x3f7994(0x304,0x31b)],'headers':response[_0x3f7994(0x307,0x2a5)]};}catch(_0xa08fd6){throw this[_0x3f7994(0x380,0x3cb)](_0xa08fd6);}}[_0x2dedf7(0x42d,0x3bc)](_0x30dfcc){function _0x13f0da(_0x1f39fc,_0x1bdb0c){return _0xb456(_0x1bdb0c- -0x2ca,_0x1f39fc);}this[_0x13f0da(0x1d,0xe)][_0x13f0da(0x5b,0x17)]['headers'][_0x13f0da(-0x126,-0xd4)]['Authorization']='Bearer\x20'+_0x30dfcc;}['removeAuthToken'](){delete this['client']['defaults']['headers'][_0x407e56(0x122,0x190)]['Authorization'];function _0x407e56(_0x4651a0,_0x52520a){return _0xb456(_0x52520a- -0x66,_0x4651a0);}this['client'][_0x407e56(0x27e,0x27b)]['headers'][_0x407e56(0x151,0x190)]['Authorization']=_0x407e56(0x218,0x1ed)+this[_0x407e56(0x28a,0x222)];}[_0x2dedf7(0x3ee,0x3c3)](_0x2328e0){if(_0x2328e0 instanceof EBaaSError)return _0x2328e0;function _0x1dd18b(_0x4e2ca7,_0x4bd7d3){return _0xb456(_0x4bd7d3- -0x3ca,_0x4e2ca7);}return new EBaaSError(_0x2328e0[_0x1dd18b(-0xe6,-0xf0)]||'HTTP\x20request\x20failed',_0x2328e0[_0x1dd18b(-0x18d,-0x184)]||0x0,_0x2328e0);}}function _0x444b(){const _0x44df09=['l2z1BMn0Aw9UCY92ms8','C3rHDgu','CMvZzxrqyxnZD29Yza','Bg9N','q0HbtK5ftf9fuLjpuG','AgfUzgXLrxjYB3i','l2f1DgGVDJeVC2LNBM91Da','ChjLzML4','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','CMvJB25Uzwn0qxr0zw1WDhm','AgfUzgXLqxv0AevYCM9Y','DxbKyxrLrw52','Aw52B2TL','rMfPBgvKihrVigXPC3qGzMLSzxm','mtq4ofvurujVqq','C3rYAw5NAwz5','zgLZy29UBMvJDa','l3n0B3jHz2uVyNvJA2v0CW','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','DgvZDen1C3rVBunVBM5Ly3rPB24','l2zPBgvZ','Cg9ZDgDYzxnvC2vYBMfTzq','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','Aw1WB3j0twfW','y29Kzq','CNbJ','DxjS','Dgv4Dc9WBgfPBG','Ahr0CenSAwvUDa','mteZmhPoy2L1Da','q0Xpu0ve','BgvHDMu','lMfZyW','C2v0DxbjBNrLCMnLChrVCNm','z2v0','u1vcu0nssujfra','zg93BMXVywq','DMfSDwu','mJy1mJq1A3f6vLvf','z2XVyMfS','DxnL','B3jKzxi','AgvHCNrIzwf0sw50zxj2ywW','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','zxzLBNq','AM9PBMvKt25Jzq','n3z0whnQsa','Cgf0Aa','zxHLy3v0zvf1zxj5','ChvIBgLJ','y2XVC2vK','DxbKyxrLrgf0yq','AgfZq3vZDg9Trgf0ywjHC2u','z2v0q2HHBM5LBhm','CMvTB3zLqwXSq2HHBM5LBhm','AgvHCNrIzwf0','CMvMCMvZAfnLC3nPB24','y29UBMvJDf9LCNjVCG','p29WzxjHDgLVBJ11ChnLCNq','zw1PDa','x2DLDfnVy2TLDa','yxnJzw5KAw5N','z2v0tg9NCW','DMvYAwz5','rMfPBgvKihrVigrVD25SB2fKigzPBgu','zMLSDgvYCW','z2v0u3rHDhvZ','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','B3bLCMf0B3i','rMfPBgvKihrVihvWzgf0zsbMDw5JDgLVBIbLBNzPCM9UBwvUDa','zgv0ywLSCW','BwfRzvjLzG','Dg9tDhjPBMC','mZG2mZK2ohv1yxzzua','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbSB2DZ','l2LUzM8','C3vIC2nYAxb0Aw9UCW','Dw50CMfJAW','y2XPzw50','x3jLAM9PBG','BwvZC2fNzq','z2v0v29YA3nWywnLswq','mJqZntvhy2vHs3O','y2XLyxjtzxnZAw9U','AgfZ','y2fWDhvYzvn0ywnRvhjHy2u','uhjLzMvY','zgvMyxvSDhm','zgvSzxrLt3b0Aw9UCW','AM9PBMvK','CMvTB3zLq3vZDg9Trgf0ywjHC2u','C3bSAxq','BgvHDMLUzW','DxbKyxrLt3b0Aw9UCW','zMLSDgvY','y29UBMvJDa','l2f1DgGVDJeVC2rRl3nPz25PBG','z2v0twv0CMLJCW','C2v0DxbizwfYDgjLyxq','C2nOzw1H','rMfPBgvKihrVigrLBgv0zsbMDw5JDgLVBG','C29YDej5','Bg9HzfnLC3nPB24','zxHLy3v0zq','Bw92zq','CxvLCNK','CMvQzwn0','y3vYCMvUDfnJAgvTyq','yM9KEq','C2v0v29YA3nWywnLswq','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','yNjVywrJyxn0','rMfPBgvKihrVigDLDcbMDw5JDgLVBG','y29TBw9U','zgvWBg95','Dw5ZDwjZy3jPyMu','C29JA2v0t3b0Aw9UCW','D2fYBG','Dg9vChbLCKnHC2u','rMfPBgvKihrVihvWBg9HzcbMAwXL','zw50CNLWB2LUDa','CMv0DxjUpxjLChjLC2vUDgf0Aw9U','Aw50zxjJzxb0B3jZ','uMvXDwvZDcbMywLSzwq','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','y2HHBM5LBhm','AwXPA2u','Cg9ZDa','mJHrAKHbsLy','Bwv0ywrHDge','mJqYBgTtsgPU','y2fJAgvdB250CM9S','ChvZAa','CMvZCg9UC2u','zM9YrwfJAa','rMfPBgvKihrVigDLDcbZDg9YywDLihvZywDL','DgfIBgu','DgvZDenVBM5Ly3rPB24','yNvJA2v0swq','y3jLzgvUDgLHBhm','ChjLC2vUy2u','C3rHDhvZvgv4Da','BM93','DxbKyxrLqNvJA2v0','AgvHzgvYCW','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','C2vHCMnO','ywnJzxnZx3rVA2vU','z2v0qNvJA2v0','Dg9WAwm','Cgf0y2G','zgvSzxrLqNvJA2v0','y29UzMLN','Cg9ZDgDYzxneyxrHyMfZzq','zgvSzxrL','zgf0yufYCMf5','x3rYAwDNzxi','nJmYmJKYs2nKC3nc','l2rLCgXVEq','z2v0vxnHz2u','BgvUz3rO','Chv0','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','x2PVAw4','mJm1mJm1nLLxtvrVqG','CMvJB25Uzwn0','y2XLyxi','DMfSDwvZ','Dw5KzwzPBMvK','y29UBMvJDgvK','Ec10B3rHBc1JB3vUDa','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','zgf0yq','z2v0u2vZC2LVBG','C2vSzwn0','Cg9ZDgDYzxnFy2HHBMDLCW','y29UDgfPBNm','nZe4mtfLuK1pCMK','lMrLC2m','CMvJB25Uzwn0sw50zxj2ywW','D29YA3nWywnLswq','BhrL','CMvTB3zLqwXStgLZDgvUzxjZ','CMvXDwvZDa','B2zMC2v0','y3vYCMvUDfnLC3nPB24','zMLSzq','zNvUy3rPB25Z','zNjVBq','rMfPBgvKihrVihjLBw92zsbMAwXLCW','B3b0Aw9UCW','y29UBMvJDgLVBLn0yxrL','AM9PBMLUzW','C3rHDhvZ','y29SDw1U','AxndB25Uzwn0zwq','C2v0u2vZC2LVBKLUDgvYBMfS','p29WzxjHDgLVBJ1ZzwXLy3q','l3n0B3jHz2uVyNvJA2v0CY8','qxv0AgvUDgLJyxrPB24GzMfPBgvK','AxnezwXLDgu','Bgv2zwW','Ag9ZDa','B2zM','x3nLDfn0yxrL','DhjHy2S','qMvHCMvYia','C2v0sxrLBq','CgvYAw9K','BgLZDa','ChjLzMvY','C3rHy2S','C2LNBKLU','z3rL','Bwf0y2G','C29JA2v0','C2LNBLvW','zgv0zwn0zwrdB25MAwC','CMfUz2u','p29WzxjHDgLVBJ1KzwXLDgu','l2zPBgvZlW','z2v0rgv0zwn0zwrdB25MAwC','DhjHBNnMB3jT','C2vZC2LVBG','Cg9ZDgDYzxnqB3j0','BgLRzq','zxjYB3i','C3nSrw5HyMXLza','BMfTzq','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','Cg9ZDgDYzxnFy2HHBMDLCZO','y3jLyxrLqNvJA2v0','CMvTB3zLq2HHBM5LBa','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','l2zPBgvZl2nVChK','zgv0zwn0q3vZDg9Trgf0ywjHC2u','DxbZzxj0','y29UDgvUDfr5Cgu','nde2ndeZCMLyEwr1','DxbKyxrLvxnLCG','p29WzxjHDgLVBJ1PBNnLCNq','zgLZy29UBMvJDgvK','C2vUza','rMfPBgvKihrVignVChKGzMLSzq','y2HHBM5LBa','CMvHBhrPBwu','vw5ZDxbWB3j0zwqGsfruucbTzxrOB2q6ia','yxbWzw5K','CgfYC2u','DxbKyxrL','p3vWC2vYDd10CNvL','l2f1DgGVDJeVDxnLCG','rMfPBgvKihrVignYzwf0zsbZAwDUzwqGvvjm','BgLTAxq','zgf0ywjHC2u','z2v0uhvIBgLJvxjS','l3nKAY92ms8','zw52','C2v0qxv0AfrVA2vU','yxbPs2v5'];_0x444b=function(){return _0x44df09;};return _0x444b();}class AuthClient{constructor(_0xb499b2){this[_0x57e237(-0x17c,-0x1ae)]=null;function _0x57e237(_0x456936,_0x22dc65){return _0xb456(_0x456936- -0x3ba,_0x22dc65);}this['httpClient']=_0xb499b2,this['loadSession']();}async[_0x2dedf7(0x411,0x392)](data){function _0x47fec0(_0x495f95,_0x10c10b){return _0xb456(_0x10c10b- -0x253,_0x495f95);}try{const response=await this[_0x47fec0(0x97,0x52)]['post']('/auth/v1/signup',data);return response['data']['session']&&this['setSessionInternal'](response['data']['session']),response[_0x47fec0(-0xa0,-0x22)];}catch(_0x31190c){throw this[_0x47fec0(-0x37,0x40)](_0x31190c);}}async[_0x2dedf7(0x3f6,0x38e)](data){function _0x35d542(_0x22b06a,_0x348d23){return _0xb456(_0x348d23-0x2c4,_0x22b06a);}try{const response=await this[_0x35d542(0x577,0x569)]['post'](_0x35d542(0x57f,0x5ae),data);return response['data'][_0x35d542(0x4f8,0x528)]&&this[_0x35d542(0x49b,0x50d)](response['data']['session']),response['data'];}catch(_0x2a551d){throw this[_0x35d542(0x545,0x557)](_0x2a551d);}}async['signOut'](){function _0x399c6a(_0x108585,_0x5ad5eb){return _0xb456(_0x5ad5eb- -0x9d,_0x108585);}try{await this['httpClient']['post'](_0x399c6a(0x180,0x1f2)),this[_0x399c6a(0x1e0,0x240)]();}catch(_0x112c0c){this[_0x399c6a(0x298,0x240)]();throw this[_0x399c6a(0x1b3,0x1f6)](_0x112c0c);}}async['getUser'](){function _0x56d9fc(_0x121beb,_0x24f232){return _0xb456(_0x24f232- -0x2e9,_0x121beb);}if(!this['currentSession']?.['access_token'])return null;try{const response=await this['httpClient'][_0x56d9fc(-0x81,-0x3e)](_0x56d9fc(-0x95,-0x69));return response['data']['user'];}catch(_0x2fc137){if(_0x2fc137 instanceof EBaaSError&&_0x2fc137[_0x56d9fc(-0x116,-0xa3)]===0x191)return this[_0x56d9fc(0x51,-0xc)](),null;throw this['handleAuthError'](_0x2fc137);}}async[_0x2dedf7(0x397,0x3f6)](){if(!this['currentSession']?.['refresh_token'])return null;function _0x5ecc79(_0x44755d,_0x1a5973){return _0xb456(_0x44755d- -0x323,_0x1a5973);}try{const response=await this['httpClient'][_0x5ecc79(-0x11f,-0x118)]('/auth/v1/refresh',{'refresh_token':this['currentSession']['refresh_token']});if(response[_0x5ecc79(-0xf2,-0x167)]['session'])return this['setSession'](response['data'][_0x5ecc79(-0xbf,-0x11d)]),response[_0x5ecc79(-0xf2,-0xff)]['session'];return null;}catch(_0x3aecd3){this['clearSession']();throw this['handleAuthError'](_0x3aecd3);}}async[_0x2dedf7(0x3ea,0x3c0)](_0x265349){try{await this['httpClient']['post']('/auth/v1/reset-password',{'email':_0x265349});}catch(_0x299b90){throw this['handleAuthError'](_0x299b90);}}async[_0x2dedf7(0x405,0x3a9)](data){function _0x211c54(_0x29d973,_0x20d87d){return _0xb456(_0x20d87d-0x34b,_0x29d973);}try{const response=await this[_0x211c54(0x65f,0x5f0)][_0x211c54(0x507,0x571)]('/auth/v1/user',data);return response['data']['user'];}catch(_0x4a7006){throw this[_0x211c54(0x57b,0x5de)](_0x4a7006);}}[_0x2dedf7(0x390,0x367)](){function _0x27882b(_0xafe53e,_0x5a562e){return _0xb456(_0x5a562e- -0x189,_0xafe53e);}return this[_0x27882b(0xdc,0xb5)];}['setSession'](_0x104a61){this['currentSession']=_0x104a61;function _0x41f1c6(_0x481776,_0x4cd79f){return _0xb456(_0x4cd79f-0x2ab,_0x481776);}this['httpClient']['setAuthToken'](_0x104a61[_0x41f1c6(0x486,0x4c3)]),typeof localStorage!==_0x41f1c6(0x483,0x4d8)&&localStorage[_0x41f1c6(0x52b,0x4ff)]('ebaas.auth.session',JSON['stringify'](_0x104a61));}['onAuthStateChange'](_0x12d169){return()=>{};}[_0x2dedf7(0x35e,0x37e)](_0x22bec3){this['currentSession']=_0x22bec3,this[_0xac7fc8(0x292,0x25f)][_0xac7fc8(0x274,0x294)](_0x22bec3['access_token']);function _0xac7fc8(_0x3f17b0,_0x5d0605){return _0xb456(_0x3f17b0- -0x13,_0x5d0605);}typeof localStorage!=='undefined'&&localStorage[_0xac7fc8(0x241,0x220)]('ebaas.auth.session',JSON[_0xac7fc8(0x285,0x2f9)](_0x22bec3));}[_0x2dedf7(0x3b1,0x412)](){this[_0x329ecc(-0x107,-0x13a)]=null,this[_0x329ecc(-0x147,-0xd3)]['removeAuthToken']();function _0x329ecc(_0xafea27,_0x39158e){return _0xb456(_0x39158e- -0x378,_0xafea27);}typeof localStorage!=='undefined'&&localStorage['removeItem']('ebaas.auth.session');}[_0x2dedf7(0x444,0x425)](){function _0x4f1b87(_0x448bb1,_0xb46e46){return _0xb456(_0x448bb1- -0x20f,_0xb46e46);}if(typeof localStorage!==_0x4f1b87(0x1e,-0xa)){const _0x47dd29=localStorage['getItem']('ebaas.auth.session');if(_0x47dd29)try{const _0x52e405=JSON['parse'](_0x47dd29);this['setSessionInternal'](_0x52e405);}catch(_0x3f595b){this[_0x4f1b87(0xce,0xb2)]();}}}[_0x2dedf7(0x3b0,0x3c8)](_0x2750e8){function _0xd0237c(_0x403bfb,_0x1bfeb9){return _0xb456(_0x403bfb-0x20f,_0x1bfeb9);}if(_0x2750e8 instanceof EBaaSError)return _0x2750e8;return new EBaaSError(_0x2750e8['message']||_0xd0237c(0x45b,0x44b),_0x2750e8[_0xd0237c(0x455,0x441)]||0x0,_0x2750e8);}}class QueryBuilder{constructor(_0x58e77d,_0x147d27,_0x2a0f08,_0x51ffea){this['httpClient']=_0x58e77d,this['table']=_0x147d27,this['schema']=_0x2a0f08;function _0x21cdc7(_0x46c5cb,_0x11a34b){return _0xb456(_0x46c5cb-0x2c8,_0x11a34b);}this[_0x21cdc7(0x501,0x555)]=_0x51ffea,this['query']={'filters':[]};}[_0x2dedf7(0x33e,0x368)](_0x2162c3='*',_0x588f98){this['query'][_0x5774a6(-0x22,0x3)]=_0x2162c3;function _0x5774a6(_0x58a548,_0x376ebd){return _0xb456(_0x376ebd- -0x230,_0x58a548);}return this;}['insert'](data,_0x500fea){function _0x32f3a9(_0x5b4dae,_0x6973be){return _0xb456(_0x5b4dae-0x359,_0x6973be);}return this[_0x32f3a9(0x612,0x682)]('POST',_0x32f3a9(0x5de,0x566)+this['table']+_0x32f3a9(0x5ce,0x5f4),{'data':data,'options':_0x500fea});}[_0x2dedf7(0x3a4,0x3b3)](data,_0x3bd1ea){this[_0x431104(0x3ea,0x3fb)]['updateData']=data;function _0x431104(_0x1e51a8,_0x3a2363){return _0xb456(_0x1e51a8-0xf7,_0x3a2363);}return this['query'][_0x431104(0x3de,0x388)]=_0x3bd1ea,this;}[_0x2dedf7(0x402,0x3a6)](data,_0x2e5e6c){function _0x458c8c(_0x5e69db,_0x49fd13){return _0xb456(_0x5e69db-0x2f9,_0x49fd13);}return this[_0x458c8c(0x5b2,0x59d)]('POST','/sdk/v1/'+this[_0x458c8c(0x506,0x4a1)]+_0x458c8c(0x5bc,0x567),{'data':data,'options':{..._0x2e5e6c,'upsert':!![]}});}[_0x2dedf7(0x2f6,0x354)](_0x437004){function _0x19025b(_0x50108b,_0x35e5f5){return _0xb456(_0x50108b-0x305,_0x35e5f5);}return this['query'][_0x19025b(0x5e7,0x59d)]=_0x437004,this[_0x19025b(0x5f8,0x5a1)][_0x19025b(0x552,0x545)]=!![],this;}['eq'](_0x19c707,_0x53c659){this[_0x454745(0x56f,0x545)][_0x454745(0x57f,0x51c)][_0x454745(0x498,0x45b)]({'column':_0x19c707,'operator':'eq','value':_0x53c659});function _0x454745(_0x19ba8e,_0x523338){return _0xb456(_0x523338-0x252,_0x19ba8e);}return this;}['neq'](_0x1a65fb,_0x4aa29a){this[_0x433d5e(0xd4,0x5a)]['filters'][_0x433d5e(-0xa4,-0x90)]({'column':_0x1a65fb,'operator':'neq','value':_0x4aa29a});function _0x433d5e(_0x322103,_0x586d85){return _0xb456(_0x586d85- -0x299,_0x322103);}return this;}['gt'](_0x4a5ee2,_0x26efde){return this['query']['filters']['push']({'column':_0x4a5ee2,'operator':'gt','value':_0x26efde}),this;}[_0x2dedf7(0x320,0x38f)](_0xc3480c,_0x348cbb){this['query'][_0x5cbcda(0x25,-0x3c)]['push']({'column':_0xc3480c,'operator':_0x5cbcda(-0x6f,-0xac),'value':_0x348cbb});function _0x5cbcda(_0x11bce3,_0x2861d7){return _0xb456(_0x2861d7- -0x306,_0x11bce3);}return this;}['lt'](_0x459b7e,_0x7290fb){return this['query']['filters']['push']({'column':_0x459b7e,'operator':'lt','value':_0x7290fb}),this;}[_0x2dedf7(0x307,0x36f)](_0x346009,_0x2a0434){function _0x80916f(_0x2e4ac0,_0x41f615){return _0xb456(_0x41f615- -0x7c,_0x2e4ac0);}return this['query'][_0x80916f(0x25c,0x24e)][_0x80916f(0x139,0x18d)]({'column':_0x346009,'operator':_0x80916f(0x205,0x1be),'value':_0x2a0434}),this;}['like'](_0x37c50e,_0xedb85){this[_0x11f4bd(0x43c,0x3ba)][_0x11f4bd(0x413,0x3e2)][_0x11f4bd(0x352,0x3a4)]({'column':_0x37c50e,'operator':_0x11f4bd(0x3af,0x3c1),'value':_0xedb85});function _0x11f4bd(_0x220fde,_0x5e4824){return _0xb456(_0x220fde-0x149,_0x5e4824);}return this;}[_0x2dedf7(0x34e,0x338)](_0x37f5c2,_0x212f94){this[_0x413afd(0x16d,0xed)][_0x413afd(0xef,0xc4)]['push']({'column':_0x37f5c2,'operator':_0x413afd(0x22,-0x3),'value':_0x212f94});function _0x413afd(_0x3750b4,_0x2cfb30){return _0xb456(_0x2cfb30- -0x206,_0x3750b4);}return this;}['is'](_0x486914,_0x156c01){this['query'][_0x1e3a42(-0xca,-0xfc)]['push']({'column':_0x486914,'operator':'is','value':_0x156c01});function _0x1e3a42(_0x34c1ae,_0x45e617){return _0xb456(_0x34c1ae- -0x394,_0x45e617);}return this;}['in'](_0x377e9f,_0x1471b1){return this['query']['filters']['push']({'column':_0x377e9f,'operator':'in','value':_0x1471b1}),this;}['contains'](_0x4c8a71,_0xdf33c){function _0xa15dec(_0x3839c1,_0x490a0d){return _0xb456(_0x3839c1- -0x2eb,_0x490a0d);}return this[_0xa15dec(0x8,0x53)]['filters'][_0xa15dec(-0xe2,-0x67)]({'column':_0x4c8a71,'operator':_0xa15dec(-0xb6,-0x12b),'value':_0xdf33c}),this;}[_0x2dedf7(0x391,0x390)](_0x5c066b){function _0x2d6109(_0x4c1335,_0xbf678b){return _0xb456(_0x4c1335-0x327,_0xbf678b);}return Object['entries'](_0x5c066b)[_0x2d6109(0x532,0x50c)](([_0x5f4f41,_0x2c817c])=>{this['eq'](_0x5f4f41,_0x2c817c);}),this;}[_0x2dedf7(0x36d,0x3e7)](_0x2c457f,_0x363b19){function _0x14e4ba(_0x3167b8,_0x5a1792){return _0xb456(_0x5a1792- -0x1f1,_0x3167b8);}return!this[_0x14e4ba(0x87,0x102)][_0x14e4ba(0xfc,0xc1)]&&(this['query'][_0x14e4ba(0xb2,0xc1)]=[]),this[_0x14e4ba(0xbf,0x102)]['order']['push']({'column':_0x2c457f,'ascending':_0x363b19?.[_0x14e4ba(0x60,0xd5)]!==![]}),this;}['limit'](count){this['query'][_0x56cbbf(0x3c2,0x41c)]=count;function _0x56cbbf(_0x36e20d,_0x57adfd){return _0xb456(_0x36e20d-0x140,_0x57adfd);}return this;}['range'](from,_0x38967e){function _0x136e34(_0x56d216,_0x110fff){return _0xb456(_0x56d216-0xbc,_0x110fff);}return this[_0x136e34(0x3af,0x415)][_0x136e34(0x31b,0x310)]={'from':from,'to':_0x38967e},this;}async[_0x2dedf7(0x4a5,0x426)](){function _0x1f01c0(_0x57789d,_0x5a4f61){return _0xb456(_0x5a4f61-0x198,_0x57789d);}if(this['query']['updateData'])return this[_0x1f01c0(0x4be,0x451)]('PATCH','/sdk/v1/'+this[_0x1f01c0(0x33f,0x3a5)],{'data':this[_0x1f01c0(0x4a0,0x48b)][_0x1f01c0(0x3f8,0x454)],'options':this[_0x1f01c0(0x40c,0x48b)]['updateOptions'],'filters':this['query']['filters']});else return this['query']['isDelete']?this[_0x1f01c0(0x3e1,0x451)]('DELETE',_0x1f01c0(0x3c0,0x41d)+this[_0x1f01c0(0x3bf,0x3a5)]+_0x1f01c0(0x401,0x3f8),{'options':this[_0x1f01c0(0x479,0x48b)]['deleteOptions'],'filters':this[_0x1f01c0(0x436,0x48b)][_0x1f01c0(0x454,0x462)]}):this['executeQuery']('GET','/sdk/v1/'+this['table']+_0x1f01c0(0x3db,0x3e2),{'select':this[_0x1f01c0(0x422,0x48b)]['select'],'filters':this[_0x1f01c0(0x4ef,0x48b)]['filters'],'order':this[_0x1f01c0(0x48d,0x48b)][_0x1f01c0(0x422,0x44a)],'limit':this[_0x1f01c0(0x468,0x48b)][_0x1f01c0(0x43d,0x41a)],'range':this['query'][_0x1f01c0(0x411,0x3f7)]});}async['single'](){function _0x4bb36b(_0x4aa024,_0x561293){return _0xb456(_0x4aa024-0x10b,_0x561293);}this[_0x4bb36b(0x38d,0x40c)](0x1);const result=await this[_0x4bb36b(0x3fc,0x43e)]();return{'data':result[_0x4bb36b(0x33c,0x2ce)]?.[0x0]||null,'error':result['error']};}async['executeQuery'](_0x4f22de,_0x3a073f,_0x5678fd){function _0x4ed0eb(_0xe9d096,_0x4adaa2){return _0xb456(_0x4adaa2-0x2f5,_0xe9d096);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this['workspaceId']);if(_0x4f22de==='GET'){const _0x2d75e5=_0x3a073f[_0x4ed0eb(0x5d3,0x5da)]('?'),_0x151f39=_0x2d75e5[0x0],existingParams=new URLSearchParams(_0x2d75e5[0x1]||'');if(_0x5678fd[_0x4ed0eb(0x54c,0x528)])existingParams[_0x4ed0eb(0x545,0x571)]('select',_0x5678fd['select']);_0x5678fd[_0x4ed0eb(0x5f1,0x5bf)]?.['length']&&_0x5678fd[_0x4ed0eb(0x62b,0x5bf)][_0x4ed0eb(0x510,0x500)](filter=>{function _0x305060(_0x43f635,_0x310486){return _0xb456(_0x310486-0x2dd,_0x43f635);}existingParams['append'](filter[_0x305060(0x4bd,0x524)],filter[_0x305060(0x5db,0x5aa)]+'.'+filter['value']);});if(_0x5678fd[_0x4ed0eb(0x5f9,0x5a7)]?.[_0x4ed0eb(0x58b,0x51a)]){const orderStr=_0x5678fd['order']['map'](_0x39080f=>''+_0x39080f['column']+(_0x39080f[_0x4ed0eb(0x594,0x5bb)]?_0x4ed0eb(0x563,0x59e):_0x4ed0eb(0x506,0x52c)))['join'](',');existingParams['append']('order',orderStr);}if(_0x5678fd['limit'])existingParams['append'](_0x4ed0eb(0x4fa,0x577),_0x5678fd[_0x4ed0eb(0x50d,0x577)][_0x4ed0eb(0x622,0x5c6)]());_0x5678fd['range']&&(existingParams['append'](_0x4ed0eb(0x4eb,0x532),_0x5678fd[_0x4ed0eb(0x5ad,0x554)]['from'][_0x4ed0eb(0x5d6,0x5c6)]()),existingParams[_0x4ed0eb(0x5e9,0x571)]('limit',(_0x5678fd[_0x4ed0eb(0x543,0x554)]['to']-_0x5678fd['range'][_0x4ed0eb(0x593,0x536)]+0x1)['toString']())),response=await this[_0x4ed0eb(0x551,0x59a)][_0x4ed0eb(0x527,0x5a0)](_0x151f39+'?'+existingParams[_0x4ed0eb(0x5a6,0x5c6)](),{'headers':headers});}else{if(_0x4f22de==='DELETE'){const _0x161a3d=_0x3a073f[_0x4ed0eb(0x5af,0x5da)]('?'),_0x122cce=_0x161a3d[0x0],existingParams=new URLSearchParams(_0x161a3d[0x1]||'');!existingParams['has']('operation')&&existingParams['append']('operation','delete');_0x5678fd[_0x4ed0eb(0x582,0x5bf)]?.['length']&&_0x5678fd[_0x4ed0eb(0x544,0x5bf)][_0x4ed0eb(0x521,0x500)](filter=>{function _0x14e227(_0x2c029d,_0xaf5158){return _0xb456(_0x2c029d-0xdf,_0xaf5158);}existingParams[_0x14e227(0x35b,0x2f3)](filter[_0x14e227(0x326,0x31c)],filter['operator']+'.'+filter[_0x14e227(0x38d,0x3d6)]);});const deleteUrl=_0x122cce+'?'+existingParams['toString']();console[_0x4ed0eb(0x559,0x581)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console[_0x4ed0eb(0x5c6,0x581)]('\uD83D\uDD27 DELETE headers:',headers),console['log']('\uD83D\uDD27 DELETE filtros originais:',_0x5678fd[_0x4ed0eb(0x5fe,0x5bf)]),response=await this['httpClient']['delete'](deleteUrl,{'headers':headers});}else{if(_0x4f22de==='PATCH'){const _0x42c793=_0x3a073f[_0x4ed0eb(0x60c,0x5da)]('?'),_0xb71fae=_0x42c793[0x0],existingParams=new URLSearchParams(_0x42c793[0x1]||'');!existingParams['has']('operation')&&existingParams[_0x4ed0eb(0x578,0x571)]('operation',_0x4ed0eb(0x5f1,0x573));_0x5678fd['filters']?.['length']&&_0x5678fd['filters']['forEach'](filter=>{function _0x4c9edd(_0x2c421c,_0x32eed2){return _0xb456(_0x32eed2-0x1c8,_0x2c421c);}existingParams[_0x4c9edd(0x450,0x444)](filter[_0x4c9edd(0x42b,0x40f)],filter['operator']+'.'+filter[_0x4c9edd(0x481,0x476)]);});_0x5678fd['options']?.['prefer']&&(headers['Prefer']=_0x5678fd[_0x4ed0eb(0x534,0x538)][_0x4ed0eb(0x566,0x54c)]);const updateUrl=_0xb71fae+'?'+existingParams[_0x4ed0eb(0x5a3,0x5c6)]();response=await this['httpClient']['patch'](updateUrl,_0x5678fd['data'],{'headers':headers});}else{let _0x4ce7dc=_0x5678fd['data'];!headers[_0x4ed0eb(0x58f,0x5d5)]&&(headers[_0x4ed0eb(0x59c,0x5d5)]=_0x4ed0eb(0x4da,0x4f3)),_0x5678fd[_0x4ed0eb(0x59d,0x538)]?.[_0x4ed0eb(0x5a1,0x566)]&&(headers[_0x4ed0eb(0x5ec,0x5d5)]=_0x4ed0eb(0x521,0x4e8)),_0x5678fd[_0x4ed0eb(0x532,0x515)]&&(_0x4ce7dc=_0x5678fd[_0x4ed0eb(0x54f,0x515)]),response=await this[_0x4ed0eb(0x5b0,0x59a)][_0x4ed0eb(0x517,0x4f9)](_0x3a073f,_0x4ce7dc,{'headers':headers});}}}return{'data':response['data'],'error':null,'count':response['headers']?.[_0x4ed0eb(0x557,0x524)]?parseInt(response['headers']['x-total-count']):undefined};}catch(_0x2069b6){return{'data':null,'error':_0x2069b6 instanceof EBaaSError?_0x2069b6:new EBaaSError(_0x2069b6 instanceof Error?_0x2069b6['message']:'Database\x20operation\x20failed',0x0,_0x2069b6)};}}}class CustomDatabaseManager{constructor(_0x44a92c,_0x1e1977){function _0x48574c(_0x250a22,_0x339637){return _0xb456(_0x250a22- -0x2,_0x339637);}this['httpClient']=_0x44a92c,this[_0x48574c(0x237,0x256)]=_0x1e1977;}async['detectCustomDatabase'](){if(!this[_0x5af955(0x33b,0x378)])return{'hasCustomDatabase':![]};try{const response=await this[_0x5af955(0x37e,0x3e4)]['get']('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response[_0x5af955(0x315,0x385)]===0xc8&&response['data']?.[_0x5af955(0x2f6,0x35c)]){const config=response[_0x5af955(0x368,0x370)]['config'],_0x57c74c={'host':config['postgresHost'],'port':config[_0x5af955(0x32c,0x3a4)],'database':config[_0x5af955(0x303,0x35d)],'username':config[_0x5af955(0x436,0x3dd)],'password':'','schema':config['postgresSchema'],'sslEnabled':config[_0x5af955(0x36d,0x3a7)]};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x57c74c},this['detectedConfig'];}}catch(_0x198c33){if(_0x198c33?.[_0x5af955(0x3c7,0x385)]===0x194)return this[_0x5af955(0x349,0x39d)]={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x198c33);}function _0x5af955(_0x22d04c,_0x17f31f){return _0xb456(_0x17f31f-0x13f,_0x22d04c);}return this[_0x5af955(0x3b4,0x39d)]={'hasCustomDatabase':![]},this['detectedConfig'];}async['testConnection'](_0xe23cc1){function _0x2de9fc(_0x5f1d94,_0x3cb018){return _0xb456(_0x3cb018- -0xa9,_0x5f1d94);}try{const response=await this[_0x2de9fc(0x1d5,0x1fc)][_0x2de9fc(0x1b8,0x15b)]('/admin/v1/workspace/custom-database/test-connection',_0xe23cc1,{'headers':this['workspaceId']?{'X-Workspace-ID':this[_0x2de9fc(0x195,0x190)]}:{}});return response[_0x2de9fc(0x1d8,0x188)];}catch(_0x3e416e){return{'success':![],'message':_0x3e416e?.[_0x2de9fc(0x2a7,0x231)]||'Failed\x20to\x20test\x20connection'};}}async[_0x2dedf7(0x375,0x365)](_0x1bc568){function _0x152b93(_0x116925,_0x40bd32){return _0xb456(_0x116925- -0x121,_0x40bd32);}if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');const response=await this[_0x152b93(0x184,0x16a)][_0x152b93(0xe3,0xc5)]('/admin/v1/workspace/custom-database',{'workspaceId':this[_0x152b93(0x118,0x110)],..._0x1bc568},{'headers':{'X-Workspace-ID':this[_0x152b93(0x118,0xe5)]}}),config=response[_0x152b93(0x110,0x146)]['config'];return this[_0x152b93(0x13d,0x11b)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x1bc568},config;}async[_0x2dedf7(0x41c,0x419)](){if(!this[_0x4cd829(0x3e4,0x45f)])throw new Error('Workspace ID is required to remove custom database');function _0x4cd829(_0x60167a,_0x44ccf6){return _0xb456(_0x44ccf6-0x226,_0x60167a);}await this['httpClient'][_0x4cd829(0x499,0x445)]('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this[_0x4cd829(0x43c,0x45f)]}}),this['detectedConfig']={'hasCustomDatabase':![]};}[_0x2dedf7(0x3bb,0x397)](){return this['detectedConfig'];}[_0x2dedf7(0x463,0x3f2)](){function _0x16ddd2(_0x21fa6e,_0x4417e4){return _0xb456(_0x21fa6e-0x1a,_0x4417e4);}return this['detectedConfig']?.[_0x16ddd2(0x2d7,0x25a)]??![];}[_0x2dedf7(0x378,0x34b)](){function _0x43b7d7(_0x3b856e,_0x1a942d){return _0xb456(_0x3b856e- -0x2d5,_0x1a942d);}return this[_0x43b7d7(-0x77,-0x7f)]?.[_0x43b7d7(-0xc5,-0xae)];}['setWorkspaceId'](_0x14849a){this['workspaceId']=_0x14849a,this['detectedConfig']=undefined;}['getWorkspaceId'](){function _0x5c9584(_0x108c94,_0x296a6c){return _0xb456(_0x108c94-0x317,_0x296a6c);}return this[_0x5c9584(0x550,0x5a7)];}['getStatus'](){function _0x4dcab6(_0x25c79c,_0x573941){return _0xb456(_0x573941- -0xd0,_0x25c79c);}return{'workspaceId':this[_0x4dcab6(0x153,0x169)],'hasConfig':this['hasCustomDatabase'](),'configDetails':this[_0x4dcab6(0x1d4,0x18e)]?.[_0x4dcab6(0x13f,0x140)]?{'host':this['detectedConfig']['credentials'][_0x4dcab6(0x12f,0x17f)],'port':this[_0x4dcab6(0x15d,0x18e)]['credentials']['port'],'database':this['detectedConfig']['credentials'][_0x4dcab6(0x1cb,0x1b3)],'schema':this[_0x4dcab6(0x1ab,0x18e)]['credentials'][_0x4dcab6(0x1db,0x21d)]||_0x4dcab6(0x25a,0x1ea),'sslEnabled':this[_0x4dcab6(0x201,0x18e)]['credentials']['sslEnabled']||![]}:undefined};}}function _0x2dedf7(_0x4417f4,_0x53b2f2){return _0xb456(_0x53b2f2-0x135,_0x4417f4);}class DatabaseClient{constructor(_0x329973,_0x384d30){this[_0x1174a7(-0xce,-0x69)]=_0x329973;function _0x1174a7(_0x4d515a,_0x3cbe6c){return _0xb456(_0x3cbe6c- -0x30e,_0x4d515a);}this['customDatabaseManager']=new CustomDatabaseManager(_0x329973,_0x384d30);}['from'](_0x798f5){function _0x587864(_0x52546a,_0x50244c){return _0xb456(_0x50244c- -0x18c,_0x52546a);}return new QueryBuilder(this[_0x587864(0xe2,0x119)],_0x798f5,this[_0x587864(0x194,0x169)],this['customDatabaseManager'][_0x587864(0x17e,0x14f)]());}[_0x2dedf7(0x3d0,0x3d7)](_0x197e61,_0x32974e){function _0x2a719d(_0x47442e,_0x53903d){return _0xb456(_0x53903d- -0x1c7,_0x47442e);}return this['httpClient'][_0x2a719d(-0x39,0x3d)]('/rpc/'+_0x197e61,_0x32974e);}['schema'](_0x5a9600){function _0xd79e44(_0x9056df,_0x2d2b35){return _0xb456(_0x2d2b35- -0x356,_0x9056df);}const _0x48411b=new DatabaseClient(this[_0xd79e44(-0x58,-0xb1)],this['customDatabaseManager']['getWorkspaceId']());return _0x48411b['currentSchema']=_0x5a9600,_0x48411b[_0xd79e44(-0xe7,-0x155)]=this[_0xd79e44(-0x1d0,-0x155)],_0x48411b;}async['detectCustomDatabase'](){function _0x399d82(_0x393f81,_0x21ccc6){return _0xb456(_0x21ccc6- -0x111,_0x393f81);}return this['customDatabaseManager'][_0x399d82(0x157,0x15f)]();}async[_0x2dedf7(0x41f,0x3d1)](_0x1d91d1){function _0x14acda(_0x2484e,_0x1d2778){return _0xb456(_0x1d2778- -0x253,_0x2484e);}return this['customDatabaseManager'][_0x14acda(-0x32,-0x45)](_0x1d91d1);}async[_0x2dedf7(0x35b,0x365)](_0x153fa7){function _0x1f2db1(_0xae0318,_0x4107cb){return _0xb456(_0x4107cb- -0x2c,_0xae0318);}return this[_0x1f2db1(0x155,0x1d5)]['configureCustomDatabase'](_0x153fa7);}async['removeCustomDatabase'](){return this['customDatabaseManager']['removeCustomDatabase']();}['isUsingCustomDatabase'](){function _0x249f6d(_0x51053d,_0x341172){return _0xb456(_0x51053d- -0x3bc,_0x341172);}return this[_0x249f6d(-0x1bb,-0x198)]['hasCustomDatabase']();}['getCustomDatabaseStatus'](){function _0x368880(_0x1271fe,_0x5cc99f){return _0xb456(_0x1271fe-0x209,_0x5cc99f);}return this[_0x368880(0x40a,0x453)][_0x368880(0x4d4,0x486)]();}[_0x2dedf7(0x340,0x327)](_0x21566f){function _0x3569d5(_0x351ba7,_0x276f1d){return _0xb456(_0x351ba7- -0x19,_0x276f1d);}this[_0x3569d5(0x1e8,0x18d)][_0x3569d5(0x1d9,0x15c)](_0x21566f);}async['initialize'](){function _0x50ef93(_0x32cd18,_0x1a2665){return _0xb456(_0x1a2665- -0x36f,_0x32cd18);}try{await this[_0x50ef93(-0xee,-0x16e)]['detectCustomDatabase']();}catch(_0x12c8b5){console[_0x50ef93(-0x1ba,-0x175)]('Failed to initialize custom database detection:',_0x12c8b5);}}}class StorageBucket{constructor(_0x3d1255,bucketId){this['httpClient']=_0x3d1255,this['bucketId']=bucketId;}async['upload'](_0x74092a,_0xd6112e,_0x33fab8){function _0x2e356d(_0x5a6e14,_0x46f616){return _0xb456(_0x46f616- -0x19c,_0x5a6e14);}try{const _0x56b9ea=new FormData();if(_0xd6112e instanceof File)_0x56b9ea['append']('file',_0xd6112e);else{if(_0xd6112e instanceof Blob)_0x56b9ea[_0x2e356d(0x13e,0xe0)]('file',_0xd6112e,_0x74092a);else{if(_0xd6112e instanceof ArrayBuffer)_0x56b9ea[_0x2e356d(0x5d,0xe0)](_0x2e356d(0x73,0xa3),new Blob([_0xd6112e]),_0x74092a);else typeof _0xd6112e==='string'&&_0x56b9ea['append']('file',new Blob([_0xd6112e],{'type':'text/plain'}),_0x74092a);}}_0x56b9ea[_0x2e356d(0xc1,0xe0)](_0x2e356d(0xe1,0x11c),_0x74092a);_0x33fab8?.[_0x2e356d(0x1f,0x6c)]&&_0x56b9ea[_0x2e356d(0x134,0xe0)](_0x2e356d(0x42,0x6c),_0x33fab8['cacheControl']);_0x33fab8?.['contentType']&&_0x56b9ea['append'](_0x2e356d(0x5a,0xd6),_0x33fab8['contentType']);_0x33fab8?.[_0x2e356d(0x91,0x6a)]&&_0x56b9ea['append'](_0x2e356d(0xd,0x6a),JSON['stringify'](_0x33fab8[_0x2e356d(0xea,0x6a)]));const _0x485a6d=_0x2e356d(0x71,0xaf)+this[_0x2e356d(0xdb,0x73)]+_0x2e356d(0xa0,0x101)+(_0x33fab8?.['upsert']?_0x2e356d(0x12f,0xe3):''),response=await this[_0x2e356d(0x159,0x109)][_0x2e356d(0x3,0x68)](_0x485a6d,_0x56b9ea,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response['data'],'error':null};}catch(_0x4a8f1e){return{'data':null,'error':_0x4a8f1e instanceof EBaaSError?_0x4a8f1e:new EBaaSError(_0x4a8f1e instanceof Error?_0x4a8f1e['message']:_0x2e356d(0x7b,0x60),0x0,_0x4a8f1e)};}}async[_0x2dedf7(0x3c3,0x3e2)](_0x4c4ab4,_0x6239f8){function _0x5b6b68(_0x312e43,_0x4d0959){return _0xb456(_0x4d0959- -0x7e,_0x312e43);}try{const _0x4ae99b=new URLSearchParams();_0x6239f8?.['transform']&&Object['entries'](_0x6239f8[_0x5b6b68(0x209,0x1e5)])['forEach'](([_0x133bbd,_0x1d42af])=>{_0x1d42af!==undefined&&_0x4ae99b['append'](_0x133bbd,String(_0x1d42af));});const _0x5d2fce='/storage/buckets/'+this['bucketId']+'/files/'+_0x4c4ab4+(_0x4ae99b[_0x5b6b68(0x2cb,0x253)]()?'?'+_0x4ae99b['toString']():''),response=await this[_0x5b6b68(0x211,0x227)][_0x5b6b68(0x2ac,0x22d)](_0x5d2fce,{'responseType':'blob'});return{'data':response['data'],'error':null};}catch(_0xaf2ee4){return{'data':null,'error':_0xaf2ee4 instanceof EBaaSError?_0xaf2ee4:new EBaaSError(_0xaf2ee4 instanceof Error?_0xaf2ee4[_0x5b6b68(0x1fe,0x25c)]:_0x5b6b68(0x1d5,0x24b),0x0,_0xaf2ee4)};}}async[_0x2dedf7(0x320,0x38b)](_0xc81024,_0x34c91f){function _0x53b5c7(_0x458c84,_0x1472a7){return _0xb456(_0x458c84-0x58,_0x1472a7);}try{const _0x57c9c0=new URLSearchParams();_0xc81024&&_0x57c9c0[_0x53b5c7(0x2d4,0x34f)](_0x53b5c7(0x2e8,0x343),_0xc81024);_0x34c91f?.[_0x53b5c7(0x2da,0x2a2)]&&_0x57c9c0['append'](_0x53b5c7(0x2da,0x35a),String(_0x34c91f[_0x53b5c7(0x2da,0x25e)]));_0x34c91f?.[_0x53b5c7(0x295,0x273)]&&_0x57c9c0['append'](_0x53b5c7(0x295,0x28f),String(_0x34c91f['offset']));_0x34c91f?.[_0x53b5c7(0x347,0x35c)]&&_0x57c9c0[_0x53b5c7(0x2d4,0x2d1)]('sortBy',JSON['stringify'](_0x34c91f['sortBy']));_0x34c91f?.[_0x53b5c7(0x26f,0x226)]&&_0x57c9c0['append'](_0x53b5c7(0x26f,0x24e),_0x34c91f[_0x53b5c7(0x26f,0x280)]);const _0x5941f9=_0x53b5c7(0x2a3,0x2aa)+this['bucketId']+_0x53b5c7(0x2f5,0x2ff)+(_0x57c9c0['toString']()?'?'+_0x57c9c0['toString']():''),response=await this[_0x53b5c7(0x2fd,0x32e)]['get'](_0x5941f9);return{'data':response['data'],'error':null};}catch(_0x530879){return{'data':null,'error':_0x530879 instanceof EBaaSError?_0x530879:new EBaaSError(_0x530879 instanceof Error?_0x530879[_0x53b5c7(0x332,0x359)]:_0x53b5c7(0x2ee,0x2a1),0x0,_0x530879)};}}async['remove'](_0x346ca5){function _0x620759(_0x420213,_0xbe923e){return _0xb456(_0xbe923e- -0x319,_0x420213);}try{const response=await this[_0x620759(-0xdc,-0x74)][_0x620759(-0x15c,-0xfa)]('/storage/buckets/'+this[_0x620759(-0x13e,-0x10a)]+_0x620759(-0xf0,-0x7c),{'data':{'paths':_0x346ca5}});return{'data':response[_0x620759(-0x14f,-0xe8)],'error':null};}catch(_0x4a513a){return{'data':null,'error':_0x4a513a instanceof EBaaSError?_0x4a513a:new EBaaSError(_0x4a513a instanceof Error?_0x4a513a['message']:_0x620759(-0xcb,-0xd7),0x0,_0x4a513a)};}}async[_0x2dedf7(0x457,0x427)](fromPath,_0x421428){function _0x41670c(_0x2a08b5,_0x446a6e){return _0xb456(_0x2a08b5-0x2dc,_0x446a6e);}try{const response=await this['httpClient']['post'](_0x41670c(0x527,0x533)+this[_0x41670c(0x4eb,0x4e9)]+'/files/move',{'sourceKey':fromPath,'destinationKey':_0x421428});return{'data':response[_0x41670c(0x50d,0x494)],'error':null};}catch(_0x34692b){return{'data':null,'error':_0x34692b instanceof EBaaSError?_0x34692b:new EBaaSError(_0x34692b instanceof Error?_0x34692b[_0x41670c(0x5b6,0x60c)]:'Failed\x20to\x20move\x20file',0x0,_0x34692b)};}}async['copy'](fromPath,_0x1e1389){function _0x1f7d5b(_0x4c2b3c,_0x57440b){return _0xb456(_0x4c2b3c- -0x40,_0x57440b);}try{const response=await this['httpClient']['post']('/storage/buckets/'+this['bucketId']+_0x1f7d5b(0x22f,0x232),{'sourceKey':fromPath,'destinationKey':_0x1e1389});return{'data':response[_0x1f7d5b(0x1f1,0x209)],'error':null};}catch(_0x3c49bc){return{'data':null,'error':_0x3c49bc instanceof EBaaSError?_0x3c49bc:new EBaaSError(_0x3c49bc instanceof Error?_0x3c49bc[_0x1f7d5b(0x29a,0x24b)]:_0x1f7d5b(0x238,0x1c0),0x0,_0x3c49bc)};}}async['createSignedUrl'](_0x4c7f5d,_0x3ff4ce,_0x40bb8e){function _0x1d8ece(_0x4edc0d,_0x56b32b){return _0xb456(_0x4edc0d-0x3e5,_0x56b32b);}try{const response=await this[_0x1d8ece(0x68a,0x679)]['post'](_0x1d8ece(0x630,0x63c)+this['bucketId']+_0x1d8ece(0x646,0x680)+_0x4c7f5d+'/sign',{'expiresIn':_0x3ff4ce,..._0x40bb8e});return{'data':response['data'],'error':null};}catch(_0x3fe3e6){return{'data':null,'error':_0x3fe3e6 instanceof EBaaSError?_0x3fe3e6:new EBaaSError(_0x3fe3e6 instanceof Error?_0x3fe3e6[_0x1d8ece(0x6bf,0x705)]:_0x1d8ece(0x666,0x661),0x0,_0x3fe3e6)};}}[_0x2dedf7(0x34e,0x3b9)](_0x2b3871,_0x141544){const _0x7c0325=new URLSearchParams();_0x141544?.['transform']&&Object['entries'](_0x141544[_0x2a54d4(0x7e,0x96)])[_0x2a54d4(-0x16,0x3e)](([_0x1901c4,_0x15f52d])=>{function _0xb5d4b4(_0x65d81a,_0x12a9a2){return _0xb456(_0x65d81a- -0x1e4,_0x12a9a2);}_0x15f52d!==undefined&&_0x7c0325[_0xb5d4b4(0x98,0xdb)](_0x1901c4,String(_0x15f52d));});function _0x2a54d4(_0x53fb8a,_0x540e91){return _0xb456(_0x540e91- -0x1cd,_0x53fb8a);}const _0x16470c=this[_0x2a54d4(0xf6,0xd8)]['baseURL']||'',_0x8ef0f3=_0x16470c+_0x2a54d4(0xe4,0x7e)+this[_0x2a54d4(0x3d,0x42)]+_0x2a54d4(0x30,0x94)+_0x2b3871+(_0x7c0325['toString']()?'?'+_0x7c0325['toString']():'');return{'data':{'publicUrl':_0x8ef0f3}};}async['getFileInfo'](_0x521678){function _0xbaf3bf(_0x1347cc,_0x3f1401){return _0xb456(_0x3f1401- -0x33,_0x1347cc);}try{const response=await this[_0xbaf3bf(0x2ee,0x272)][_0xbaf3bf(0x26a,0x278)](_0xbaf3bf(0x1ee,0x218)+this['bucketId']+'/files/'+_0x521678+'/info');return{'data':response[_0xbaf3bf(0x1f2,0x1fe)],'error':null};}catch(_0xb68e48){return{'data':null,'error':_0xb68e48 instanceof EBaaSError?_0xb68e48:new EBaaSError(_0xb68e48 instanceof Error?_0xb68e48[_0xbaf3bf(0x24a,0x2a7)]:'Failed\x20to\x20get\x20file\x20info',0x0,_0xb68e48)};}}async['updateFileMetadata'](_0x4c0c59,metadata){function _0x3230fc(_0x31d70f,_0x2e9692){return _0xb456(_0x2e9692-0x133,_0x31d70f);}try{const response=await this[_0x3230fc(0x3a6,0x3d8)]['put'](_0x3230fc(0x35e,0x37e)+this[_0x3230fc(0x328,0x342)]+'/files/'+_0x4c0c59+'/metadata',{'metadata':metadata});return{'data':response[_0x3230fc(0x36f,0x364)],'error':null};}catch(_0x5149d4){return{'data':null,'error':_0x5149d4 instanceof EBaaSError?_0x5149d4:new EBaaSError(_0x5149d4 instanceof Error?_0x5149d4[_0x3230fc(0x484,0x40d)]:_0x3230fc(0x46d,0x406),0x0,_0x5149d4)};}}}class StorageClient{constructor(_0x44f486){function _0x2487ad(_0x26445d,_0xb89f57){return _0xb456(_0x26445d- -0x218,_0xb89f57);}this[_0x2487ad(0x8d,0x4c)]=_0x44f486;}['from'](bucketId){function _0x2b6082(_0x3f5b63,_0x250398){return _0xb456(_0x250398- -0x1c9,_0x3f5b63);}return new StorageBucket(this[_0x2b6082(0x11f,0xdc)],bucketId);}async[_0x2dedf7(0x36c,0x3a1)](_0x537c9e,_0x1c5e84){function _0x28e445(_0x3e9705,_0x558979){return _0xb456(_0x558979- -0x3c9,_0x3e9705);}try{const response=await this[_0x28e445(-0xf6,-0x124)][_0x28e445(-0x1cf,-0x1c5)]('/storage/buckets',{'id':_0x537c9e,..._0x1c5e84});return{'data':response[_0x28e445(-0x1f7,-0x198)],'error':null};}catch(_0x4c373c){return{'data':null,'error':_0x4c373c instanceof EBaaSError?_0x4c373c:new EBaaSError(_0x4c373c instanceof Error?_0x4c373c['message']:_0x28e445(-0x119,-0xfd),0x0,_0x4c373c)};}}async[_0x2dedf7(0x305,0x34e)](_0x192aa4){function _0x4b4499(_0x189606,_0x5203fd){return _0xb456(_0x5203fd- -0x366,_0x189606);}try{const response=await this['httpClient'][_0x4b4499(-0xb3,-0xbb)]('/storage/buckets/'+_0x192aa4);return{'data':response['data'],'error':null};}catch(_0x24d891){return{'data':null,'error':_0x24d891 instanceof EBaaSError?_0x24d891:new EBaaSError(_0x24d891 instanceof Error?_0x24d891['message']:'Failed\x20to\x20get\x20bucket',0x0,_0x24d891)};}}async['listBuckets'](){function _0x208600(_0x26ce22,_0x44e90b){return _0xb456(_0x44e90b- -0x161,_0x26ce22);}try{const response=await this['httpClient']['get'](_0x208600(0x196,0x139));return{'data':response[_0x208600(0x11a,0xd0)],'error':null};}catch(_0x5dcf5c){return{'data':null,'error':_0x5dcf5c instanceof EBaaSError?_0x5dcf5c:new EBaaSError(_0x5dcf5c instanceof Error?_0x5dcf5c[_0x208600(0x17a,0x179)]:_0x208600(0x181,0x109),0x0,_0x5dcf5c)};}}async[_0x2dedf7(0x39c,0x349)](_0x7858af,_0x436cf2){function _0x568f67(_0x3a57bd,_0x52af87){return _0xb456(_0x3a57bd- -0x171,_0x52af87);}try{const response=await this['httpClient'][_0x568f67(0xb5,0xe0)]('/storage/buckets/'+_0x7858af,_0x436cf2);return{'data':response['data'],'error':null};}catch(_0x42fbfa){return{'data':null,'error':_0x42fbfa instanceof EBaaSError?_0x42fbfa:new EBaaSError(_0x42fbfa instanceof Error?_0x42fbfa['message']:'Failed\x20to\x20update\x20bucket',0x0,_0x42fbfa)};}}async[_0x2dedf7(0x312,0x351)](_0x50b33d){function _0x1e2889(_0xcc6212,_0x3d0bfc){return _0xb456(_0x3d0bfc- -0x1e5,_0xcc6212);}try{const response=await this['httpClient'][_0x1e2889(-0x3a,0x3a)]('/storage/buckets/'+_0x50b33d);return{'data':response[_0x1e2889(0x5f,0x4c)],'error':null};}catch(_0x1eeff2){return{'data':null,'error':_0x1eeff2 instanceof EBaaSError?_0x1eeff2:new EBaaSError(_0x1eeff2 instanceof Error?_0x1eeff2['message']:'Failed\x20to\x20delete\x20bucket',0x0,_0x1eeff2)};}}async[_0x2dedf7(0x352,0x359)](){function _0x4b0c5a(_0x3368af,_0x5edf75){return _0xb456(_0x3368af-0x3d8,_0x5edf75);}try{const response=await this['httpClient']['get']('/storage/usage');return{'data':response[_0x4b0c5a(0x609,0x65e)],'error':null};}catch(_0x31f445){return{'data':null,'error':_0x31f445 instanceof EBaaSError?_0x31f445:new EBaaSError(_0x31f445 instanceof Error?_0x31f445['message']:_0x4b0c5a(0x5e4,0x621),0x0,_0x31f445)};}}}class RealtimeChannel extends _0x471021{constructor(_0x215f54,_0x34ac3c){super(),this[_0x452c2f(-0x4a,-0x2f)]=![],this['state']='closed',this['subscriptions']=new Map(),this['topic']=_0x215f54;function _0x452c2f(_0x36a768,_0x51efd0){return _0xb456(_0x36a768- -0x300,_0x51efd0);}this[_0x452c2f(-0xa4,-0x123)]=_0x34ac3c;}['subscribe'](_0x3c337d){!this[_0x43e697(-0x39,-0x52)]&&(this[_0x43e697(-0x39,-0x98)]=!![],this[_0x43e697(-0xc7,-0xf2)]());function _0x43e697(_0x14bfb0,_0x442f06){return _0xb456(_0x14bfb0- -0x2ef,_0x442f06);}return _0x3c337d&&this['on']('status',_0x3c337d),this;}['onPostgresChanges'](filter,_0x5d8bbd){const _0x47812d='postgres_changes:'+JSON[_0x5a6d23(0x12c,0xd7)](filter);super['on'](_0x47812d,_0x5d8bbd);const _0x19f75a={'unsubscribe':()=>{super['off'](_0x47812d,_0x5d8bbd);function _0x115d9e(_0x53ecad,_0x496e4a){return _0xb456(_0x53ecad-0x1fe,_0x496e4a);}this['subscriptions'][_0x115d9e(0x41d,0x3d1)](_0x47812d);}};this[_0x5a6d23(0x14a,0x115)]['set'](_0x47812d,_0x19f75a);function _0x5a6d23(_0x7fb2fe,_0x4d15ff){return _0xb456(_0x4d15ff- -0x1c1,_0x7fb2fe);}return this[_0x5a6d23(0xef,0x9b)]?.[_0x5a6d23(0x69,0x6d)]&&this['state']==='joined'&&this[_0x5a6d23(0xf9,0x9b)][_0x5a6d23(0x132,0x103)](_0x5a6d23(0x101,0xd0),{'topic':this['topic'],'filter':filter,'ref':this[_0x5a6d23(0xdd,0x10f)]()}),_0x19f75a;}['onBroadcast'](filter,_0x329cea){const _0x35fc6f='broadcast:'+JSON['stringify'](filter);super['on'](_0x35fc6f,_0x329cea);function _0x1b41c5(_0x2e2fed,_0xf3f950){return _0xb456(_0x2e2fed- -0x10d,_0xf3f950);}const _0x18f656={'unsubscribe':()=>{function _0x323cb8(_0x2966ca,_0x429c9c){return _0xb456(_0x429c9c-0x13e,_0x2966ca);}super[_0x323cb8(0x3f9,0x38e)](_0x35fc6f,_0x329cea),this[_0x323cb8(0x3de,0x414)][_0x323cb8(0x388,0x35d)](_0x35fc6f);}};return this[_0x1b41c5(0x1c9,0x21e)]['set'](_0x35fc6f,_0x18f656),_0x18f656;}['onPresence'](filter,_0x4f347b){const _0x366375='presence:'+JSON['stringify'](filter);function _0x3816a5(_0x103b6c,_0x4b01b6){return _0xb456(_0x4b01b6- -0x131,_0x103b6c);}super['on'](_0x366375,_0x4f347b);const _0x385159={'unsubscribe':()=>{super[_0x5d7d09(0x29c,0x2c9)](_0x366375,_0x4f347b);function _0x5d7d09(_0x1866c2,_0x1de04e){return _0xb456(_0x1866c2-0x4c,_0x1de04e);}this['subscriptions'][_0x5d7d09(0x26b,0x20b)](_0x366375);}};return this[_0x3816a5(0x21f,0x1a5)]['set'](_0x366375,_0x385159),_0x385159;}[_0x2dedf7(0x418,0x3ac)](_0x51cafa){return new Promise(_0x271f64=>{function _0x4f1737(_0x11b221,_0x47a75f){return _0xb456(_0x11b221-0x2fa,_0x47a75f);}this[_0x4f1737(0x556,0x540)]?.['connected']&&this[_0x4f1737(0x584,0x572)]==='joined'?(this[_0x4f1737(0x556,0x583)]['emit']('broadcast',{'topic':this['topic'],'event':_0x51cafa['event'],'payload':_0x51cafa,'ref':this['makeRef']()}),_0x271f64('ok')):_0x271f64('error');});}['track'](_0x5b7655){return new Promise(_0x3c0051=>{function _0x3d86b3(_0x2e6562,_0x36af4c){return _0xb456(_0x36af4c- -0x201,_0x2e6562);}this[_0x3d86b3(0x6f,0x5b)]?.[_0x3d86b3(0x89,0x2d)]&&this['state']==='joined'?(this['socket'][_0x3d86b3(0x10e,0xc3)]('presence',{'topic':this[_0x3d86b3(-0x48,0x19)],'event':_0x3d86b3(-0x25,0x51),'payload':_0x5b7655,'ref':this['makeRef']()}),_0x3c0051('ok')):_0x3c0051(_0x3d86b3(0x18,0x66));});}[_0x2dedf7(0x3a3,0x40c)](){return new Promise(_0x193045=>{function _0x575c60(_0x1c99b4,_0x378ebe){return _0xb456(_0x1c99b4- -0xcf,_0x378ebe);}this[_0x575c60(0x18d,0x133)]?.[_0x575c60(0x15f,0xf6)]&&this['state']===_0x575c60(0x214,0x200)?(this[_0x575c60(0x18d,0x200)]['emit']('presence',{'topic':this[_0x575c60(0x14b,0xfb)],'event':'untrack','ref':this[_0x575c60(0x201,0x235)]()}),_0x193045('ok')):_0x193045('error');});}['unsubscribe'](){return new Promise(_0x524cc1=>{this['state']=_0x342516(0x143,0x18c),this[_0x342516(0x12e,0x17c)][_0x342516(0x98,0xb1)](_0x36840e=>{function _0x2bf783(_0x3b640c,_0x1faeb1){return _0xb456(_0x1faeb1-0x362,_0x3b640c);}_0x36840e[_0x2bf783(0x55a,0x55a)]();}),this['subscriptions'][_0x342516(0xbd,0xd1)]();this['socket']?.[_0x342516(0x132,0xd4)]&&this[_0x342516(0xa9,0x102)][_0x342516(0x10d,0x16a)](_0x342516(0x139,0x14e),{'topic':this[_0x342516(0x7f,0xc0)],'ref':this['makeRef']()});this[_0x342516(0x1ae,0x130)]=_0x342516(0x16e,0x161),this[_0x342516(0x154,0xe1)]();function _0x342516(_0x7a4c61,_0x2a3bc3){return _0xb456(_0x2a3bc3- -0x15a,_0x7a4c61);}_0x524cc1('ok');});}['_join'](){if(this[_0x1d681b(-0xc3,-0x58)]===_0x1d681b(-0x67,-0xcf))return;function _0x1d681b(_0x551308,_0x406e96){return _0xb456(_0x551308- -0x34d,_0x406e96);}this[_0x1d681b(-0xc3,-0x120)]=_0x1d681b(-0x108,-0x187),this[_0x1d681b(-0xf1,-0xb5)]?.[_0x1d681b(-0x11f,-0xc9)]&&(this[_0x1d681b(-0xf1,-0x112)][_0x1d681b(-0x89,-0xef)]('join',{'topic':this[_0x1d681b(-0x133,-0xe2)],'ref':this['makeRef']()}),setTimeout(()=>{function _0x1a747a(_0x21024,_0x5cfaf6){return _0xb456(_0x21024- -0x31d,_0x5cfaf6);}this['state']==='joining'&&(this['state']=_0x1a747a(-0x3a,-0x2),this[_0x1a747a(-0x59,-0x65)]('status',_0x1a747a(-0x71,-0x5f)));},0x64));}['_rejoin'](){function _0x5afe5c(_0x1af571,_0x30940d){return _0xb456(_0x30940d-0x359,_0x1af571);}this['joinedOnce']&&(this[_0x5afe5c(0x50f,0x581)](),this[_0x5afe5c(0x606,0x62f)][_0x5afe5c(0x586,0x564)]((_0x1da6e0,_0x477cf7)=>{function _0x2bea92(_0x315bda,_0x3176ef){return _0xb456(_0x3176ef-0x3a0,_0x315bda);}if(_0x477cf7['startsWith']('postgres_changes:')){const filter=JSON[_0x2bea92(0x683,0x61d)](_0x477cf7['replace'](_0x2bea92(0x66d,0x60b),''));this[_0x2bea92(0x598,0x5fc)]?.[_0x2bea92(0x67f,0x664)]('subscribe_postgres_changes',{'topic':this[_0x2bea92(0x5f3,0x5ba)],'filter':filter,'ref':this[_0x2bea92(0x6d8,0x670)]()});}}));}[_0x2dedf7(0x356,0x356)](_0x5e94a7,_0x1a74cb){if(_0x5e94a7==='postgres_changes'){const _0x23a610='postgres_changes:'+JSON[_0xcd06dc(0xd0,0x63)](_0x1a74cb[_0xcd06dc(0x120,0x13e)]||{});this[_0xcd06dc(0xfc,0xcd)](_0x23a610,_0x1a74cb);}else{if(_0x5e94a7==='broadcast'){const _0x210ed0='broadcast:'+JSON['stringify']({'event':_0x1a74cb['event']});this['emit'](_0x210ed0,_0x1a74cb);}else{if(_0x5e94a7===_0xcd06dc(0x49,0x34)){const _0x338c2c='presence:'+JSON['stringify']({'event':_0x1a74cb[_0xcd06dc(0xed,0x11e)]});this['emit'](_0x338c2c,_0x1a74cb);}}}function _0xcd06dc(_0x3d3828,_0xef8725){return _0xb456(_0x3d3828- -0x1c8,_0xef8725);}this[_0xcd06dc(0xfc,0x89)](_0x5e94a7,_0x1a74cb);}[_0x2dedf7(0x3c0,0x386)](_0x42f94e){this['state']=_0x42f94e;function _0x4d8b95(_0x410845,_0x3e0fdb){return _0xb456(_0x410845- -0x210,_0x3e0fdb);}let status;switch(_0x42f94e){case'joined':status=_0x4d8b95(0x9c,0x24);break;case'errored':status=_0x4d8b95(0x7d,-0x5);break;case'closed':status=_0x4d8b95(0x97,0x53);break;default:return;}this['emit'](_0x4d8b95(0x36,-0x2b),status);}['makeRef'](){function _0x5d642e(_0x1c949c,_0x5ae196){return _0xb456(_0x1c949c-0x1d9,_0x5ae196);}return Math['random']()[_0x5d642e(0x4aa,0x493)](0x24)['substring'](0x2,0xf);}['getState'](){return this['state'];}}class RealtimeClient{constructor(_0x35867a,_0x4643ae,_0x268fd9={}){this[_0x2809be(0x254,0x2b6)]=null,this[_0x2809be(0x1fa,0x213)]=new Map(),this[_0x2809be(0x23c,0x27f)]='disconnected',this['reconnectAttempts']=0x0,this['maxReconnectAttempts']=0x5;function _0x2809be(_0x470424,_0x38e52e){return _0xb456(_0x470424- -0x8,_0x38e52e);}this[_0x2809be(0x29b,0x318)]=_0x35867a,this['apiKey']=_0x4643ae,this[_0x2809be(0x23b,0x1de)]={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x268fd9};}[_0x2dedf7(0x3da,0x41e)](){return new Promise((_0x33bbe7,_0x3a3755)=>{if(this['socket']?.['connected']){_0x33bbe7();return;}function _0x10c35f(_0x2a8499,_0x2d84bc){return _0xb456(_0x2a8499-0x2f2,_0x2d84bc);}this['connectionState']='connecting',this[_0x10c35f(0x54e,0x582)]=io(this[_0x10c35f(0x595,0x514)],{'auth':{'apikey':this[_0x10c35f(0x57a,0x501)]},'transports':['websocket'],'reconnection':!![],'reconnectionDelay':this[_0x10c35f(0x535,0x500)][_0x10c35f(0x52a,0x4ed)],'reconnectionAttempts':this[_0x10c35f(0x535,0x5b5)][_0x10c35f(0x5a6,0x5e7)],...this['options'][_0x10c35f(0x4eb,0x508)]}),this[_0x10c35f(0x54e,0x526)]['on'](_0x10c35f(0x5db,0x59a),()=>{this[_0x2f09c4(0x579,0x56c)]=_0x2f09c4(0x575,0x556),this['reconnectAttempts']=0x0,this[_0x2f09c4(0x5cb,0x614)]();function _0x2f09c4(_0x508250,_0x4114d0){return _0xb456(_0x4114d0-0x328,_0x508250);}_0x33bbe7();}),this['socket']['on']('disconnect',_0x4579f5=>{this['connectionState']='disconnected';function _0x26fbe7(_0x16c5f0,_0x32a412){return _0xb456(_0x16c5f0- -0x202,_0x32a412);}this[_0x26fbe7(0x0,-0x5c)]['forEach'](channel=>{channel['_setState']('closed');});}),this['socket']['on']('connect_error',_0x2889a5=>{this[_0x4cdc49(0x259,0x2d5)]=_0x4cdc49(0x365,0x2f8);function _0x4cdc49(_0x4242b2,_0x5abdc8){return _0xb456(_0x5abdc8-0x91,_0x4242b2);}this['reconnectAttempts']++,this[_0x4cdc49(0x36a,0x323)]>=this[_0x4cdc49(0x37d,0x345)]&&_0x3a3755(new Error('Failed\x20to\x20connect\x20after\x20'+this[_0x4cdc49(0x367,0x345)]+'\x20attempts:\x20'+_0x2889a5[_0x4cdc49(0x3d5,0x36b)]));}),this[_0x10c35f(0x54e,0x5a7)]['on'](_0x10c35f(0x51c,0x503),()=>{this['connectionState']=_0xc4554d(0x485,0x406);function _0xc4554d(_0x2ea5b6,_0x16bdc8){return _0xb456(_0x2ea5b6-0x257,_0x16bdc8);}this['reconnectAttempts']=0x0,this['channels'][_0xc4554d(0x462,0x3e7)](channel=>{function _0x18c473(_0x57fa02,_0x4767e7){return _0xb456(_0x4767e7-0x324,_0x57fa02);}channel[_0x18c473(0x59e,0x5fd)]();});}),this['socket']['on'](_0x10c35f(0x526,0x59b),_0x422b77=>{const channel=this['channels'][_0x48c22e(-0x2e,0x36)](_0x422b77[_0x48c22e(-0xbf,-0xbd)]);function _0x48c22e(_0x18e51f,_0x15ff4c){return _0xb456(_0x18e51f- -0x2d9,_0x15ff4c);}channel&&channel['_trigger']('postgres_changes',_0x422b77);}),this[_0x10c35f(0x54e,0x52a)]['on'](_0x10c35f(0x4e6,0x4b2),_0x2aed57=>{function _0x5ef7e8(_0x6a539e,_0xb70f4e){return _0xb456(_0xb70f4e- -0x37b,_0x6a539e);}const channel=this['channels'][_0x5ef7e8(-0x14a,-0xd0)](_0x2aed57['topic']);channel&&channel[_0x5ef7e8(-0x112,-0x15a)]('broadcast',_0x2aed57);}),this[_0x10c35f(0x54e,0x598)]['on']('presence',_0x515af7=>{const channel=this[_0x54de6c(0x8b,0x41)][_0x54de6c(0x134,0x169)](_0x515af7['topic']);function _0x54de6c(_0x447dd7,_0x12bffa){return _0xb456(_0x447dd7- -0x177,_0x12bffa);}channel&&channel[_0x54de6c(0xaa,0xec)](_0x54de6c(0x9a,0xb1),_0x515af7);});});}[_0x2dedf7(0x3e7,0x3ce)](){this['socket']&&(this[_0x4a0a81(0x61f,0x5c6)]['disconnect'](),this[_0x4a0a81(0x604,0x5c6)]=null);this[_0x4a0a81(0x57e,0x5ae)]=_0x4a0a81(0x614,0x5e0);function _0x4a0a81(_0x2a49ca,_0x4fd527){return _0xb456(_0x4fd527-0x36a,_0x2a49ca);}this[_0x4a0a81(0x552,0x56c)]['clear']();}['channel'](_0xcac4e7){if(this['channels'][_0x2eee50(0x495,0x45b)](_0xcac4e7))return this[_0x2eee50(0x309,0x37f)]['get'](_0xcac4e7);const channel=new RealtimeChannel(_0xcac4e7,this['socket']);this['channels']['set'](_0xcac4e7,channel);this[_0x2eee50(0x3f7,0x3c1)]===_0x2eee50(0x3f8,0x3ab)&&channel['_join']();function _0x2eee50(_0x3dc6ce,_0x3b273a){return _0xb456(_0x3b273a-0x17d,_0x3dc6ce);}return channel;}[_0x2dedf7(0x36c,0x3a2)](channel){function _0x477ab4(_0x1f761e,_0x9d578a){return _0xb456(_0x1f761e- -0x73,_0x9d578a);}const _0xdd071c=channel['topic'];this[_0x477ab4(0x18f,0x1eb)][_0x477ab4(0x26b,0x24e)](_0xdd071c)&&(this[_0x477ab4(0x18f,0x139)][_0x477ab4(0x1ac,0x142)](_0xdd071c),channel[_0x477ab4(0x185,0x14e)]());}[_0x2dedf7(0x462,0x3f4)](){this['channels'][_0x236fbf(0x4ea,0x547)](channel=>{channel['unsubscribe']();});function _0x236fbf(_0x1a2a92,_0xdc3610){return _0xb456(_0x1a2a92-0x2df,_0xdc3610);}this[_0x236fbf(0x4e1,0x48c)][_0x236fbf(0x50a,0x565)]();}[_0x2dedf7(0x3d4,0x3f3)](){function _0x984efd(_0xc553c6,_0x157d96){return _0xb456(_0x157d96- -0x266,_0xc553c6);}return Array[_0x984efd(-0x77,-0x25)](this['channels'][_0x984efd(0x47,-0x3a)]());}[_0x2dedf7(0x3d7,0x37d)](){function _0xb0abb2(_0x3affb1,_0x462593){return _0xb456(_0x462593- -0x390,_0x3affb1);}return this[_0xb0abb2(-0x14c,-0x14c)]===_0xb0abb2(-0xe3,-0x162)&&!!this['socket']?.['connected'];}['getConnectionState'](){return this['connectionState'];}['onConnectionStateChange'](_0x3eb464){function _0x1fb0c1(_0x559af5,_0x2d3a8d){return _0xb456(_0x559af5- -0x209,_0x2d3a8d);}const _0x4d12ed=()=>_0x3eb464(this[_0x1fb0c1(0x3b,0x53)]);return this['socket']&&(this['socket']['on']('connect',()=>{this['connectionState']='connected',_0x4d12ed();}),this[_0x1fb0c1(0x53,0x4b)]['on'](_0x1fb0c1(0x90,0x97),()=>{this['connectionState']=_0x4f99fd(0xfc,0xc4);function _0x4f99fd(_0x21ec23,_0x4116c6){return _0xb456(_0x4116c6- -0x1b2,_0x21ec23);}_0x4d12ed();}),this[_0x1fb0c1(0x53,0x65)]['on']('connect_error',()=>{this['connectionState']='error',_0x4d12ed();})),()=>{function _0x1b7fde(_0x4417fc,_0x20d561){return _0xb456(_0x4417fc-0x2f4,_0x20d561);}this[_0x1b7fde(0x550,0x52f)]&&(this['socket']['off']('connect',_0x4d12ed),this[_0x1b7fde(0x550,0x53b)][_0x1b7fde(0x544,0x59a)](_0x1b7fde(0x58d,0x5ba),_0x4d12ed),this[_0x1b7fde(0x550,0x4f7)][_0x1b7fde(0x544,0x57d)](_0x1b7fde(0x5b6,0x576),_0x4d12ed));};}[_0x2dedf7(0x470,0x421)](){function _0xc94fd2(_0x41eb33,_0x30bf34){return _0xb456(_0x30bf34-0x28b,_0x41eb33);}if(!this['options'][_0xc94fd2(0x5a4,0x53e)]||!this['socket'])return;const interval=setInterval(()=>{function _0x9570ed(_0xe587e9,_0x2bb2d2){return _0xb456(_0xe587e9- -0x299,_0x2bb2d2);}this[_0x9570ed(-0x3d,-0xab)]?.[_0x9570ed(-0x6b,-0xe0)]?this[_0x9570ed(-0x3d,-0xa9)]['emit'](_0x9570ed(0x27,-0x35),{'timestamp':Date[_0x9570ed(-0x86,-0xb4)]()}):clearInterval(interval);},this[_0xc94fd2(0x46c,0x4ce)][_0xc94fd2(0x562,0x53e)]);}[_0x2dedf7(0x3cd,0x3fa)](){return this['socket'];}}class FunctionsClient{constructor(_0x2d2346){function _0x5aabc6(_0x396104,_0x4c9353){return _0xb456(_0x4c9353-0x1e0,_0x396104);}this[_0x5aabc6(0x47e,0x485)]=_0x2d2346;}async[_0x2dedf7(0x40d,0x3ca)](_0x17ec06,_0x218d6a){function _0x480f47(_0x262c32,_0x38b584){return _0xb456(_0x38b584-0xd3,_0x262c32);}try{const _0x2ee2bc=_0x218d6a?.['method']||'POST',headers={'Content-Type':'application/json',..._0x218d6a?.['headers']};let response;const _0x57f069=_0x480f47(0x35d,0x35c)+_0x17ec06;switch(_0x2ee2bc[_0x480f47(0x28a,0x2ce)]()){case'GET':response=await this[_0x480f47(0x329,0x378)][_0x480f47(0x3bb,0x37e)](_0x57f069,{'headers':headers,'params':_0x218d6a?.[_0x480f47(0x382,0x3c9)]});break;case'POST':response=await this[_0x480f47(0x3d9,0x378)]['post'](_0x57f069,_0x218d6a?.[_0x480f47(0x405,0x3c9)],{'headers':headers});break;case'PUT':response=await this[_0x480f47(0x2fd,0x378)]['put'](_0x57f069,_0x218d6a?.['body'],{'headers':headers});break;case'PATCH':response=await this[_0x480f47(0x307,0x378)][_0x480f47(0x2d2,0x2ee)](_0x57f069,_0x218d6a?.['body'],{'headers':headers});break;case'DELETE':response=await this[_0x480f47(0x3eb,0x378)][_0x480f47(0x2a6,0x2f2)](_0x57f069,{'headers':headers,'data':_0x218d6a?.['body']});break;default:throw new EBaaSError(_0x480f47(0x3cc,0x34e)+_0x2ee2bc,0x190);}return{'data':response[_0x480f47(0x30a,0x304)],'error':null};}catch(_0x53bd52){return{'data':null,'error':_0x53bd52 instanceof EBaaSError?_0x53bd52:new EBaaSError(_0x53bd52 instanceof Error?_0x53bd52[_0x480f47(0x3c2,0x3ad)]:'Function\x20invocation\x20failed',0x0,_0x53bd52)};}}async['list'](){function _0x3017c1(_0x3128fb,_0x513073){return _0xb456(_0x3128fb-0x386,_0x513073);}try{const response=await this[_0x3017c1(0x62b,0x5b3)]['get']('/functions/v1');return{'data':response[_0x3017c1(0x5b7,0x570)],'error':null};}catch(_0x94d2b5){return{'data':null,'error':_0x94d2b5 instanceof EBaaSError?_0x94d2b5:new EBaaSError(_0x94d2b5 instanceof Error?_0x94d2b5[_0x3017c1(0x660,0x662)]:'Failed\x20to\x20list\x20functions',0x0,_0x94d2b5)};}}async['get'](_0x21b556){function _0x716c5d(_0x38066a,_0x34a9f2){return _0xb456(_0x38066a- -0x357,_0x34a9f2);}try{const response=await this['httpClient']['get']('/functions/v1/'+_0x21b556+_0x716c5d(-0x82,-0x24));return{'data':response[_0x716c5d(-0x126,-0xc7)],'error':null};}catch(_0x1ec317){return{'data':null,'error':_0x1ec317 instanceof EBaaSError?_0x1ec317:new EBaaSError(_0x1ec317 instanceof Error?_0x1ec317[_0x716c5d(-0x7d,-0xf3)]:_0x716c5d(-0x162,-0x125),0x0,_0x1ec317)};}}async[_0x2dedf7(0x320,0x32c)](_0x343b64,_0x2e8794){function _0x2509aa(_0x3dff2e,_0x17e3a2){return _0xb456(_0x17e3a2- -0x6d,_0x3dff2e);}try{const _0x2c3d45=new FormData();if(_0x2e8794['code']instanceof File)_0x2c3d45['append']('code',_0x2e8794['code']);else typeof _0x2e8794['code']==='string'&&_0x2c3d45['append'](_0x2509aa(0x266,0x234),new Blob([_0x2e8794[_0x2509aa(0x26a,0x234)]],{'type':_0x2509aa(0x20d,0x237)}),'index.ts');_0x2e8794[_0x2509aa(0x1f7,0x190)]&&_0x2c3d45['append'](_0x2509aa(0x1e8,0x190),_0x2e8794['entrypoint']);_0x2e8794['env']&&_0x2c3d45['append']('env',JSON[_0x2509aa(0x253,0x22b)](_0x2e8794[_0x2509aa(0x21a,0x219)]));_0x2e8794[_0x2509aa(0x1df,0x233)]&&_0x2c3d45['append'](_0x2509aa(0x21f,0x233),JSON[_0x2509aa(0x1e1,0x22b)](_0x2e8794[_0x2509aa(0x1e6,0x233)]));_0x2e8794['verify']!==undefined&&_0x2c3d45['append'](_0x2509aa(0x2d3,0x25b),String(_0x2e8794[_0x2509aa(0x1fd,0x25b)]));const response=await this['httpClient'][_0x2509aa(0x157,0x197)](_0x2509aa(0x212,0x21c)+_0x343b64+_0x2509aa(0x22d,0x1b6),_0x2c3d45,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x2509aa(0x1ea,0x1c4)],'error':null};}catch(_0x405617){return{'data':null,'error':_0x405617 instanceof EBaaSError?_0x405617:new EBaaSError(_0x405617 instanceof Error?_0x405617[_0x2509aa(0x2a1,0x26d)]:_0x2509aa(0x21c,0x232),0x0,_0x405617)};}}async[_0x2dedf7(0x334,0x354)](_0x596c13){function _0x526322(_0x3621dc,_0xd73c01){return _0xb456(_0x3621dc-0x1c1,_0xd73c01);}try{const response=await this[_0x526322(0x466,0x48f)][_0x526322(0x3e0,0x41e)]('/functions/v1/'+_0x596c13);return{'data':response[_0x526322(0x3f2,0x3e6)],'error':null};}catch(_0x32abe6){return{'data':null,'error':_0x32abe6 instanceof EBaaSError?_0x32abe6:new EBaaSError(_0x32abe6 instanceof Error?_0x32abe6[_0x526322(0x49b,0x428)]:_0x526322(0x4af,0x4ef),0x0,_0x32abe6)};}}async[_0x2dedf7(0x382,0x3c9)](_0x2e379f,_0x386c08){function _0x30ec08(_0x126057,_0x523eb1){return _0xb456(_0x126057- -0xa4,_0x523eb1);}try{const response=await this[_0x30ec08(0x201,0x1c9)][_0x30ec08(0x182,0x16d)](_0x30ec08(0x1e5,0x1c3)+_0x2e379f+'/env',{'env':_0x386c08});return{'data':response[_0x30ec08(0x18d,0x1fb)],'error':null};}catch(_0x1ff1f6){return{'data':null,'error':_0x1ff1f6 instanceof EBaaSError?_0x1ff1f6:new EBaaSError(_0x1ff1f6 instanceof Error?_0x1ff1f6['message']:_0x30ec08(0x22a,0x1ee),0x0,_0x1ff1f6)};}}async[_0x2dedf7(0x477,0x3fc)](_0x3a9774,_0x4a403d){function _0x576194(_0x19d245,_0x4e0203){return _0xb456(_0x4e0203- -0x167,_0x19d245);}try{const _0x3d2031=new URLSearchParams();_0x4a403d?.[_0x576194(0x161,0x11b)]&&_0x3d2031[_0x576194(0x107,0x115)]('limit',String(_0x4a403d['limit']));_0x4a403d?.[_0x576194(0x11b,0xd6)]&&_0x3d2031[_0x576194(0x141,0x115)]('offset',String(_0x4a403d['offset']));_0x4a403d?.['level']&&_0x3d2031[_0x576194(0x18b,0x115)](_0x576194(0x12c,0xe7),_0x4a403d['level']);const _0x4adac2='/functions/v1/'+_0x3a9774+'/logs'+(_0x3d2031['toString']()?'?'+_0x3d2031[_0x576194(0x1b7,0x16a)]():''),response=await this[_0x576194(0x129,0x13e)][_0x576194(0x118,0x144)](_0x4adac2);return{'data':response['data'],'error':null};}catch(_0x94788f){return{'data':null,'error':_0x94788f instanceof EBaaSError?_0x94788f:new EBaaSError(_0x94788f instanceof Error?_0x94788f['message']:_0x576194(0x1cb,0x16d),0x0,_0x94788f)};}}async[_0x2dedf7(0x45c,0x420)](_0xc8fdf5,_0x539f30){function _0x1b36cd(_0x4df9a9,_0x17f614){return _0xb456(_0x17f614- -0x2b,_0x4df9a9);}try{const _0x435432=new URLSearchParams();_0x539f30?.['period']&&_0x435432[_0x1b36cd(0x2b4,0x251)](_0x1b36cd(0x269,0x22a),_0x539f30['period']);const _0x2e6065='/functions/v1/'+_0xc8fdf5+'/metrics'+(_0x435432['toString']()?'?'+_0x435432['toString']():''),response=await this['httpClient'][_0x1b36cd(0x2cf,0x280)](_0x2e6065);return{'data':response['data'],'error':null};}catch(_0x16b726){return{'data':null,'error':_0x16b726 instanceof EBaaSError?_0x16b726:new EBaaSError(_0x16b726 instanceof Error?_0x16b726[_0x1b36cd(0x256,0x2af)]:'Failed\x20to\x20get\x20function\x20metrics',0x0,_0x16b726)};}}}class EBaaSClient{constructor(_0xf32d8e,_0x173ee7,_0x43c5d6){this['options']=_0x43c5d6,this[_0x403e5(-0xab,-0x6e)]=new HttpClient({'url':_0xf32d8e,'apiKey':_0x173ee7,'timeout':0x7530,'headers':_0x43c5d6?.[_0x403e5(-0xa0,-0xc4)]?.['headers']}),this['auth']=new AuthClient(this[_0x403e5(-0xab,-0x88)]);function _0x403e5(_0x55b2b1,_0x508136){return _0xb456(_0x55b2b1- -0x350,_0x508136);}this[_0x403e5(-0xcd,-0x86)]=new DatabaseClient(this['httpClient'],_0x43c5d6?.[_0x403e5(-0xcd,-0x12d)]?.[_0x403e5(-0x117,-0x167)]),this['storage']=new StorageClient(this['httpClient']),this['realtime']=new RealtimeClient(_0xf32d8e,_0x173ee7,_0x43c5d6?.[_0x403e5(-0xd6,-0xcf)]),this[_0x403e5(-0x110,-0xec)]=new FunctionsClient(this[_0x403e5(-0xab,-0x80)]),this[_0x403e5(-0x129,-0x113)]();}[_0x2dedf7(0x3ab,0x376)](_0x323939){function _0x48ca4e(_0x36f549,_0x296871){return _0xb456(_0x36f549- -0x25c,_0x296871);}return this[_0x48ca4e(0x27,0x8b)][_0x48ca4e(-0x1b,0x1b)](_0x323939);}['rpc'](_0x2228c0,_0x4ec3d7){function _0x59e70f(_0x34ce69,_0x38cd2f){return _0xb456(_0x34ce69-0x2d4,_0x38cd2f);}return this['database'][_0x59e70f(0x576,0x538)](_0x2228c0,_0x4ec3d7);}['bucket'](_0x9c6188){return this['storage']['from'](_0x9c6188);}[_0x2dedf7(0x382,0x3ae)](_0x3ed258){function _0x57b6e4(_0x283168,_0x3bcee5){return _0xb456(_0x283168-0x146,_0x3bcee5);}return this[_0x57b6e4(0x3c0,0x342)][_0x57b6e4(0x3bf,0x3ef)](_0x3ed258);}['invoke'](_0x17170b,_0x1ae540){function _0x2ff4eb(_0x1f3363,_0x200efd){return _0xb456(_0x1f3363-0xf0,_0x200efd);}return this[_0x2ff4eb(0x330,0x320)][_0x2ff4eb(0x385,0x3ba)](_0x17170b,_0x1ae540);}async['initializeCustomDatabase'](){function _0x5af8e2(_0x28c47b,_0x197dce){return _0xb456(_0x28c47b-0x1,_0x197dce);}if(this['options']?.['database']?.[_0x5af8e2(0x29c,0x240)])try{await this[_0x5af8e2(0x284,0x21f)]['initialize']();}catch(_0x54fcca){console[_0x5af8e2(0x1fb,0x1a3)]('Failed to initialize custom database detection:',_0x54fcca);}}async['setWorkspaceId'](_0x2e7ed9){this['database']['setWorkspaceId'](_0x2e7ed9);function _0x32f016(_0x5574f6,_0x2bf583){return _0xb456(_0x2bf583-0x3c5,_0x5574f6);}this[_0x32f016(0x5c1,0x608)]?.[_0x32f016(0x5e4,0x648)]?.['autoDetectCustomDatabase']&&await this[_0x32f016(0x645,0x648)]['initialize']();}async['configureCustomDatabase'](_0x2e1930){function _0x3b153(_0x3228cf,_0xe87418){return _0xb456(_0xe87418-0x256,_0x3228cf);}await this[_0x3b153(0x4a7,0x4d9)][_0x3b153(0x413,0x486)](_0x2e1930);}[_0x2dedf7(0x3c9,0x3a3)](){function _0x2ab896(_0x307a6e,_0x2f83a3){return _0xb456(_0x307a6e- -0x11d,_0x2f83a3);}return this[_0x2ab896(0x166,0x16c)][_0x2ab896(0x151,0x169)]();}}function createClient(_0xa40f87,_0x2c54be,_0x5c8b43){return new EBaaSClient(_0xa40f87,_0x2c54be,_0x5c8b43);}const version='1.0.0';export{AuthClient,CustomDatabaseManager,DatabaseClient,EBaaSClient,EBaaSError,FunctionsClient,HttpClient,QueryBuilder,RealtimeChannel,RealtimeClient,StorageBucket,StorageClient,createClient,version};