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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';(function(stringArrayFunction,comparisonValue){const stringArray=stringArrayFunction();function _0x2942c2(_0x3aeb63,_0x54a1f2){return _0xbff2(_0x3aeb63-0x121,_0x54a1f2);}while(!![]){try{const _0x3860ec=parseInt(_0x2942c2(0x2b7,0x2f9))/0x1+parseInt(_0x2942c2(0x252,0x263))/0x2+parseInt(_0x2942c2(0x2a8,0x2e7))/0x3*(parseInt(_0x2942c2(0x242,0x2bb))/0x4)+parseInt(_0x2942c2(0x2d3,0x2f8))/0x5+parseInt(_0x2942c2(0x28b,0x2ae))/0x6+parseInt(_0x2942c2(0x2d9,0x28c))/0x7+-parseInt(_0x2942c2(0x2a6,0x2db))/0x8;if(_0x3860ec===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x184e04){stringArray['push'](stringArray['shift']());}}}(_0x16f6,0xd0679));var axios=require(_0x37f67d(0x11c,0x181)),socket_ioClient=require(_0x37f67d(0x154,0x134)),EventEmitter=require('eventemitter3');class EBaaSError extends Error{constructor(_0x19c4c1,status=0x0,_0x12df5b){function _0x1444bb(_0x108753,_0x1dbc57){return _0xbff2(_0x108753-0x11,_0x1dbc57);}super(_0x19c4c1),this['name']='EBaaSError',this[_0x1444bb(0x175,0x131)]=status,this[_0x1444bb(0x13e,0x163)]=_0x12df5b,Error[_0x1444bb(0x150,0x1bd)]&&Error['captureStackTrace'](this,EBaaSError);}[_0x37f67d(0x1c4,0x1e3)](){function _0x44fa99(_0x2e6738,_0x1a5d6b){return _0xbff2(_0x2e6738-0x260,_0x1a5d6b);}return{'name':this['name'],'message':this[_0x44fa99(0x37f,0x327)],'status':this['status'],'details':this[_0x44fa99(0x38d,0x40b)],'stack':this[_0x44fa99(0x38f,0x3f7)]};}[_0x37f67d(0x1be,0x1f5)](){function _0x242e13(_0x43cede,_0x49fc82){return _0xbff2(_0x49fc82-0x353,_0x43cede);}return this[_0x242e13(0x443,0x45d)]+':\x20'+this['message']+_0x242e13(0x577,0x501)+this[_0x242e13(0x4ce,0x4b7)]+')';}}class HttpClient{constructor(config){function _0x2b416f(_0x54f3b4,_0x1b77aa){return _0xbff2(_0x1b77aa-0x122,_0x54f3b4);}this['baseURL']=config[_0x2b416f(0x192,0x20e)],this[_0x2b416f(0x1fa,0x217)]=config['apiKey'],this[_0x2b416f(0x277,0x297)]=axios[_0x2b416f(0x23c,0x2a6)]({'baseURL':this['baseURL'],'timeout':config[_0x2b416f(0x245,0x265)]||0x2710,'headers':{'Content-Type':'application/json','apikey':this['apiKey'],...config['headers']}}),this['setupInterceptors']();}[_0x37f67d(0x1ce,0x1e6)](){this[_0x175b26(0x414,0x3fd)]['interceptors'][_0x175b26(0x39c,0x38f)][_0x175b26(0x466,0x426)](config=>{return config;},_0x471e30=>{return Promise['reject'](new EBaaSError('Request\x20failed',0x0,_0x471e30));});function _0x175b26(_0x218a8d,_0x2446de){return _0xbff2(_0x2446de-0x288,_0x218a8d);}this['client']['interceptors'][_0x175b26(0x3a3,0x33a)][_0x175b26(0x444,0x426)](response=>{return response;},_0x12620c=>{function _0x982961(_0x525ce3,_0x5364b5){return _0xbff2(_0x5364b5-0x119,_0x525ce3);}const status=_0x12620c['response']?.[_0x982961(0x2fe,0x27d)]||0x0,_0x4a5990=_0x12620c[_0x982961(0x204,0x1cb)]?.[_0x982961(0x2d3,0x2c8)]?.[_0x982961(0x1f0,0x238)]||_0x12620c['message']||_0x982961(0x2be,0x293),_0x58731a=_0x12620c['response']?.[_0x982961(0x268,0x2c8)]||_0x12620c;return Promise[_0x982961(0x2f8,0x2a8)](new EBaaSError(_0x4a5990,status,_0x58731a));});}async[_0x37f67d(0x128,0x11a)](_0x30aec9,config){function _0xb99c11(_0x927e38,_0x598026){return _0xbff2(_0x598026- -0x1de,_0x927e38);}try{const response=await this['client']['get'](_0x30aec9,config);return{'data':response[_0xb99c11(-0x1b,-0x2f)],'status':response['status'],'statusText':response[_0xb99c11(-0x132,-0x12d)],'headers':response[_0xb99c11(-0x8e,-0x27)]};}catch(_0x45e219){throw this[_0xb99c11(-0x8f,-0xc6)](_0x45e219);}}async['post'](_0x2f4cbb,data,config){function _0x1d832a(_0x559f66,_0x4eadaf){return _0xbff2(_0x559f66- -0x267,_0x4eadaf);}try{const response=await this['client']['post'](_0x2f4cbb,data,config);return{'data':response['data'],'status':response['status'],'statusText':response[_0x1d832a(-0x1b6,-0x1a0)],'headers':response['headers']};}catch(_0x199dd7){throw this['handleError'](_0x199dd7);}}async['put'](_0x10f565,data,config){function _0x46732a(_0x1e3e80,_0x5455b3){return _0xbff2(_0x1e3e80-0x36d,_0x5455b3);}try{const response=await this[_0x46732a(0x4e2,0x4b3)]['put'](_0x10f565,data,config);return{'data':response[_0x46732a(0x51c,0x4e8)],'status':response['status'],'statusText':response[_0x46732a(0x41e,0x3ff)],'headers':response[_0x46732a(0x524,0x50a)]};}catch(_0x38aff5){throw this['handleError'](_0x38aff5);}}async[_0x37f67d(0x181,0x19c)](_0x1962c9,data,config){function _0x4640f4(_0x1e3ce5,_0xbba00d){return _0xbff2(_0x1e3ce5- -0x275,_0xbba00d);}try{const response=await this[_0x4640f4(-0x100,-0xa8)][_0x4640f4(-0x131,-0x158)](_0x1962c9,data,config);return{'data':response['data'],'status':response['status'],'statusText':response[_0x4640f4(-0x1c4,-0x159)],'headers':response[_0x4640f4(-0xbe,-0x53)]};}catch(_0x21f4a5){throw this[_0x4640f4(-0x15d,-0x1cd)](_0x21f4a5);}}async['delete'](_0x34ce64,config){function _0x37534d(_0x43249f,_0x51dd18){return _0xbff2(_0x43249f-0xfe,_0x51dd18);}try{const response=await this['client']['delete'](_0x34ce64,config);return{'data':response['data'],'status':response[_0x37534d(0x262,0x205)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x26b479){throw this['handleError'](_0x26b479);}}[_0x37f67d(0x1e1,0x1d6)](_0x108646){function _0x41e060(_0x32056c,_0x24d30f){return _0xbff2(_0x24d30f-0x1e9,_0x32056c);}this[_0x41e060(0x38f,0x35e)]['defaults']['headers'][_0x41e060(0x2d7,0x334)]['Authorization']='Bearer\x20'+_0x108646;}['removeAuthToken'](){delete this[_0x2b5141(-0xff,-0xef)]['defaults'][_0x2b5141(-0x58,-0xad)][_0x2b5141(-0x117,-0x119)]['Authorization'];function _0x2b5141(_0x4ddadd,_0x348925){return _0xbff2(_0x348925- -0x264,_0x4ddadd);}this['client']['defaults'][_0x2b5141(-0xfa,-0xad)]['common']['Authorization']=_0x2b5141(-0x1ad,-0x186)+this[_0x2b5141(-0x135,-0x16f)];}['handleError'](_0x258e12){function _0x248747(_0x377fff,_0x153f29){return _0xbff2(_0x153f29-0x296,_0x377fff);}if(_0x258e12 instanceof EBaaSError)return _0x258e12;return new EBaaSError(_0x258e12[_0x248747(0x366,0x3b5)]||'HTTP\x20request\x20failed',_0x258e12['status']||0x0,_0x258e12);}}class AuthClient{constructor(_0x994dab){this['currentSession']=null,this[_0x593ff9(-0x142,-0x128)]=_0x994dab;function _0x593ff9(_0x806c64,_0x4fba2e){return _0xbff2(_0x806c64- -0x251,_0x4fba2e);}this['loadSession']();}async['signUp'](data){function _0x401038(_0x43f52c,_0x4ccbef){return _0xbff2(_0x4ccbef-0x38c,_0x43f52c);}try{const response=await this[_0x401038(0x478,0x49b)]['post']('/auth/v1/signup',data);return response[_0x401038(0x4ca,0x53b)]['session']&&this[_0x401038(0x51b,0x4bf)](response[_0x401038(0x594,0x53b)]['session']),response['data'];}catch(_0x41efbc){throw this['handleAuthError'](_0x41efbc);}}async[_0x37f67d(0x1b4,0x1bb)](data){function _0x48af5a(_0x17b872,_0x577df6){return _0xbff2(_0x577df6- -0x2ae,_0x17b872);}try{const response=await this[_0x48af5a(-0x1bb,-0x19f)][_0x48af5a(-0x1d1,-0x1a3)]('/auth/v1/sdk/signin',data);return response[_0x48af5a(-0x88,-0xff)]['session']&&this['setSessionInternal'](response[_0x48af5a(-0x14f,-0xff)]['session']),response[_0x48af5a(-0xc3,-0xff)];}catch(_0x213658){throw this['handleAuthError'](_0x213658);}}async['signOut'](){function _0x11eed0(_0x299775,_0x4f2177){return _0xbff2(_0x299775- -0x176,_0x4f2177);}try{await this['httpClient'][_0x11eed0(-0x6b,-0xed)]('/auth/v1/signout'),this['clearSession']();}catch(_0x463da3){this[_0x11eed0(-0x5b,-0xdd)]();throw this[_0x11eed0(-0x56,-0xa6)](_0x463da3);}}async['getUser'](){function _0x55456c(_0x27bed7,_0xcbfd8){return _0xbff2(_0x27bed7- -0x30c,_0xcbfd8);}if(!this['currentSession']?.['access_token'])return null;try{const response=await this['httpClient']['get'](_0x55456c(-0x1a3,-0x170));return response['data'][_0x55456c(-0x166,-0x116)];}catch(_0x1a4733){if(_0x1a4733 instanceof EBaaSError&&_0x1a4733[_0x55456c(-0x1a8,-0x172)]===0x191)return this['clearSession'](),null;throw this[_0x55456c(-0x1ec,-0x20d)](_0x1a4733);}}async[_0x37f67d(0x1c9,0x17d)](){function _0x3f65b0(_0x168009,_0x5cf596){return _0xbff2(_0x168009- -0x20b,_0x5cf596);}if(!this[_0x3f65b0(-0x55,0x2b)]?.[_0x3f65b0(-0x10e,-0x134)])return null;try{const response=await this['httpClient']['post']('/auth/v1/refresh',{'refresh_token':this[_0x3f65b0(-0x55,-0x85)][_0x3f65b0(-0x10e,-0x115)]});if(response['data'][_0x3f65b0(-0x14d,-0x1a6)])return this[_0x3f65b0(-0xe3,-0xb8)](response[_0x3f65b0(-0x5c,-0x7d)]['session']),response[_0x3f65b0(-0x5c,-0x98)]['session'];return null;}catch(_0x402a9a){this[_0x3f65b0(-0xf0,-0x151)]();throw this[_0x3f65b0(-0xeb,-0xfe)](_0x402a9a);}}async[_0x37f67d(0x13e,0x183)](_0x2d8d04){function _0x46594d(_0x1a72f6,_0x316f87){return _0xbff2(_0x1a72f6-0x17e,_0x316f87);}try{await this['httpClient'][_0x46594d(0x289,0x20c)](_0x46594d(0x2a8,0x2bd),{'email':_0x2d8d04});}catch(_0x50b587){throw this[_0x46594d(0x29e,0x2ca)](_0x50b587);}}async['updateUser'](data){function _0x1ecd24(_0x437d75,_0x5956d5){return _0xbff2(_0x5956d5-0x1cd,_0x437d75);}try{const response=await this['httpClient']['put']('/auth/v1/user',data);return response['data'][_0x1ecd24(0x3a2,0x373)];}catch(_0x138a2b){throw this[_0x1ecd24(0x2dc,0x2ed)](_0x138a2b);}}[_0x37f67d(0x175,0x14a)](){function _0x49f014(_0x2acf4d,_0xa00c3c){return _0xbff2(_0x2acf4d- -0x45,_0xa00c3c);}return this[_0x49f014(0x171,0x181)];}['setSession'](_0x2bdb5f){function _0x2417fc(_0x375e0b,_0x10d56f){return _0xbff2(_0x10d56f- -0x30d,_0x375e0b);}this['currentSession']=_0x2bdb5f,this[_0x2417fc(-0x24c,-0x1fe)]['setAuthToken'](_0x2bdb5f[_0x2417fc(-0x116,-0x158)]),typeof localStorage!=='undefined'&&localStorage[_0x2417fc(-0x1ca,-0x16a)]('ebaas.auth.session',JSON[_0x2417fc(-0x1aa,-0x173)](_0x2bdb5f));}['onAuthStateChange'](_0x2d83e3){return()=>{};}['setSessionInternal'](_0x8e700b){this[_0x5c1aae(0x184,0x1aa)]=_0x8e700b;function _0x5c1aae(_0x4672b8,_0x31446c){return _0xbff2(_0x4672b8- -0x32,_0x31446c);}this['httpClient']['setAuthToken'](_0x8e700b['access_token']),typeof localStorage!==_0x5c1aae(0x134,0x1a6)&&localStorage[_0x5c1aae(0x171,0x119)](_0x5c1aae(0x92,0x9f),JSON[_0x5c1aae(0x168,0x1e3)](_0x8e700b));}['clearSession'](){this[_0x229dc3(0x442,0x48a)]=null;function _0x229dc3(_0x26816a,_0x46766c){return _0xbff2(_0x26816a-0x28c,_0x46766c);}this['httpClient'][_0x229dc3(0x3ec,0x413)](),typeof localStorage!=='undefined'&&localStorage['removeItem']('ebaas.auth.session');}['loadSession'](){function _0x274a1a(_0x39e71f,_0x1759c7){return _0xbff2(_0x1759c7- -0x308,_0x39e71f);}if(typeof localStorage!=='undefined'){const _0xe2d40d=localStorage[_0x274a1a(-0x281,-0x243)]('ebaas.auth.session');if(_0xe2d40d)try{const _0x4da7db=JSON[_0x274a1a(-0x1d8,-0x1f4)](_0xe2d40d);this['setSessionInternal'](_0x4da7db);}catch(_0x182be2){this['clearSession']();}}}[_0x37f67d(0x1cc,0x178)](_0x160803){if(_0x160803 instanceof EBaaSError)return _0x160803;function _0x59a8c8(_0x3efeb6,_0x324ccb){return _0xbff2(_0x3efeb6-0xd2,_0x324ccb);}return new EBaaSError(_0x160803['message']||'Authentication\x20failed',_0x160803[_0x59a8c8(0x236,0x1eb)]||0x0,_0x160803);}}class QueryBuilder{constructor(_0x6007ba,_0x82274e,_0x38c808,_0x3e2438){this['httpClient']=_0x6007ba,this['table']=_0x82274e,this['schema']=_0x38c808,this['workspaceId']=_0x3e2438,this['query']={'filters':[]};}['select'](_0x3668b4='*',_0x2682c4){function _0x4ac328(_0xa99dbd,_0x16a1e4){return _0xbff2(_0xa99dbd- -0x2f4,_0x16a1e4);}return this['query'][_0x4ac328(-0x1d6,-0x1d4)]=_0x3668b4,this;}['insert'](data,_0x294f1b){function _0x2c455b(_0x18372d,_0x36ac53){return _0xbff2(_0x36ac53-0x353,_0x18372d);}return this['executeQuery']('POST',_0x2c455b(0x500,0x4a9)+this[_0x2c455b(0x4e6,0x466)]+'?operation=insert',{'data':data,'options':_0x294f1b});}['update'](data,_0x47e097){function _0x3a5593(_0x6dd8be,_0x570bd2){return _0xbff2(_0x570bd2- -0x107,_0x6dd8be);}return this[_0x3a5593(0x32,0x66)]['updateData']=data,this['query'][_0x3a5593(-0x97,-0x13)]=_0x47e097,this;}[_0x37f67d(0xed,0x123)](data,_0x564c65){function _0x3415e8(_0x1dd87d,_0xf57730){return _0xbff2(_0xf57730- -0x25e,_0x1dd87d);}return this[_0x3415e8(-0xab,-0xff)]('POST',_0x3415e8(-0x140,-0x108)+this['table']+_0x3415e8(-0x16f,-0x1ab),{'data':data,'options':{..._0x564c65,'upsert':!![]}});}['delete'](_0x115aaf){this['query']['deleteOptions']=_0x115aaf,this[_0x3ed49b(0x4e3,0x494)]['isDelete']=!![];function _0x3ed49b(_0x38ffb5,_0x5e9d8f){return _0xbff2(_0x5e9d8f-0x327,_0x38ffb5);}return this;}['eq'](_0x29e007,_0x544c8f){function _0x244d93(_0x66dc42,_0x4cb01a){return _0xbff2(_0x66dc42-0x22,_0x4cb01a);}return this['query'][_0x244d93(0x19b,0x13d)]['push']({'column':_0x29e007,'operator':'eq','value':_0x544c8f}),this;}['neq'](_0x3aacd9,_0x2a31ff){function _0x3e56e0(_0x1ffbc0,_0xc3851e){return _0xbff2(_0x1ffbc0- -0x14,_0xc3851e);}return this['query'][_0x3e56e0(0x165,0x1bf)]['push']({'column':_0x3aacd9,'operator':'neq','value':_0x2a31ff}),this;}['gt'](_0x179322,_0x219182){function _0x42bd90(_0x54f573,_0x35259c){return _0xbff2(_0x54f573-0x3d3,_0x35259c);}return this[_0x42bd90(0x540,0x585)]['filters'][_0x42bd90(0x49d,0x43f)]({'column':_0x179322,'operator':'gt','value':_0x219182}),this;}['gte'](_0x5a34a4,_0x10c1d4){function _0x55b186(_0x57a33e,_0xfa6321){return _0xbff2(_0xfa6321- -0x16,_0x57a33e);}return this[_0x55b186(0x115,0x157)][_0x55b186(0x11b,0x163)][_0x55b186(0x56,0xb4)]({'column':_0x5a34a4,'operator':_0x55b186(0x191,0x18e),'value':_0x10c1d4}),this;}['lt'](_0x34c933,_0x189e3a){function _0x498693(_0x26163f,_0x3a0a6d){return _0xbff2(_0x3a0a6d- -0x283,_0x26163f);}return this[_0x498693(-0x169,-0x116)][_0x498693(-0x127,-0x10a)][_0x498693(-0x1fc,-0x1b9)]({'column':_0x34c933,'operator':'lt','value':_0x189e3a}),this;}['lte'](_0x4a4b03,_0x5dffc9){this[_0x7cfe14(-0x215,-0x1ce)]['filters'][_0x7cfe14(-0x2b8,-0x329)]({'column':_0x4a4b03,'operator':_0x7cfe14(-0x1d9,-0x1de),'value':_0x5dffc9});function _0x7cfe14(_0x51215c,_0x2991ef){return _0xbff2(_0x51215c- -0x382,_0x2991ef);}return this;}[_0x37f67d(0x1d9,0x209)](_0x41940c,_0x406689){this['query']['filters'][_0x8fe5f0(0x437,0x3e1)]({'column':_0x41940c,'operator':'like','value':_0x406689});function _0x8fe5f0(_0x3c7000,_0x424da6){return _0xbff2(_0x3c7000-0x36d,_0x424da6);}return this;}['ilike'](_0x5aa202,_0x553f16){this[_0x559fc2(0x2c1,0x26c)]['filters'][_0x559fc2(0x21e,0x1a1)]({'column':_0x5aa202,'operator':'ilike','value':_0x553f16});function _0x559fc2(_0x1c1495,_0x553b41){return _0xbff2(_0x1c1495-0x154,_0x553b41);}return this;}['is'](_0x1c25cb,_0xa44040){return this['query']['filters']['push']({'column':_0x1c25cb,'operator':'is','value':_0xa44040}),this;}['in'](_0x32f024,_0x226814){this['query']['filters'][_0x2affea(0x49,0x54)]({'column':_0x32f024,'operator':'in','value':_0x226814});function _0x2affea(_0x1ef18e,_0x21e516){return _0xbff2(_0x21e516- -0x76,_0x1ef18e);}return this;}['contains'](_0x4fdca9,_0x30ab50){function _0x70cc94(_0x3d387f,_0x528557){return _0xbff2(_0x528557-0x146,_0x3d387f);}return this[_0x70cc94(0x2c2,0x2b3)][_0x70cc94(0x2ef,0x2bf)][_0x70cc94(0x1cb,0x210)]({'column':_0x4fdca9,'operator':_0x70cc94(0x22c,0x209),'value':_0x30ab50}),this;}['match'](_0x41540b){function _0x46bdc0(_0x35e679,_0x56dfd1){return _0xbff2(_0x35e679- -0x211,_0x56dfd1);}return Object[_0x46bdc0(-0x8f,-0x93)](_0x41540b)['forEach'](([_0x277f61,_0x27d7e3])=>{this['eq'](_0x277f61,_0x27d7e3);}),this;}[_0x37f67d(0x226,0x1b1)](_0xb8126e,_0x34a8f4){!this[_0x1b33c0(0x282,0x295)]['order']&&(this['query'][_0x1b33c0(0x26e,0x2b8)]=[]);this[_0x1b33c0(0x282,0x1fe)][_0x1b33c0(0x26e,0x25f)]['push']({'column':_0xb8126e,'ascending':_0x34a8f4?.['ascending']!==![]});function _0x1b33c0(_0x537b3c,_0x3908e2){return _0xbff2(_0x537b3c-0x115,_0x3908e2);}return this;}['limit'](count){function _0x435164(_0x4aae59,_0x4484f8){return _0xbff2(_0x4484f8- -0x2c,_0x4aae59);}return this['query'][_0x435164(0x1a7,0x12c)]=count,this;}['range'](from,_0x33d191){this['query'][_0x4d06a1(0x306,0x321)]={'from':from,'to':_0x33d191};function _0x4d06a1(_0x3888e1,_0x4dd0f2){return _0xbff2(_0x4dd0f2-0x1a6,_0x3888e1);}return this;}async[_0x37f67d(0x12a,0x166)](){function _0x82a691(_0x218ba0,_0x234788){return _0xbff2(_0x218ba0- -0x1d6,_0x234788);}if(this[_0x82a691(-0x69,-0xd3)][_0x82a691(-0x71,-0x52)])return this['executeQuery']('PATCH','/sdk/v1/'+this['table'],{'data':this['query'][_0x82a691(-0x71,-0x17)],'options':this[_0x82a691(-0x69,-0x1e)]['updateOptions'],'filters':this[_0x82a691(-0x69,-0x4c)][_0x82a691(-0x5d,-0x51)]});else return this['query'][_0x82a691(-0xc6,-0x12a)]?this[_0x82a691(-0x77,-0x15)]('DELETE','/sdk/v1/'+this[_0x82a691(-0xc3,-0xe9)]+'?operation=delete',{'options':this[_0x82a691(-0x69,-0x53)][_0x82a691(-0x68,-0xf)],'filters':this[_0x82a691(-0x69,-0x7)]['filters']}):this[_0x82a691(-0x77,-0x59)]('GET','/sdk/v1/'+this[_0x82a691(-0xc3,-0x68)]+'?operation=select',{'select':this['query'][_0x82a691(-0xb8,-0x42)],'filters':this[_0x82a691(-0x69,-0x51)][_0x82a691(-0x5d,-0xd6)],'order':this['query']['order'],'limit':this['query'][_0x82a691(-0x7e,-0x21)],'range':this[_0x82a691(-0x69,-0x5)][_0x82a691(-0x5b,-0x54)]});}async[_0x37f67d(0x215,0x19f)](){this[_0x5b67cd(0x50c,0x517)](0x1);const result=await this['execute']();function _0x5b67cd(_0x36bd83,_0x3c57de){return _0xbff2(_0x36bd83-0x3b4,_0x3c57de);}return{'data':result['data']?.[0x0]||null,'error':result['error']};}async[_0x37f67d(0x1d8,0x1b7)](_0x547a94,_0x4a2040,_0x4cb809){function _0x1bda07(_0x390118,_0x2c8429){return _0xbff2(_0x390118-0x1c9,_0x2c8429);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this['workspaceId']);if(_0x547a94==='GET'){const _0x25e9c4=_0x4a2040[_0x1bda07(0x2cf,0x296)]('?'),_0x17c7b4=_0x25e9c4[0x0],existingParams=new URLSearchParams(_0x25e9c4[0x1]||'');if(_0x4cb809[_0x1bda07(0x2e7,0x32c)])existingParams['append'](_0x1bda07(0x2e7,0x2ec),_0x4cb809['select']);_0x4cb809['filters']?.['length']&&_0x4cb809['filters']['forEach'](filter=>{function _0x227d25(_0x48e2fc,_0x552c1b){return _0xbff2(_0x48e2fc- -0x35e,_0x552c1b);}existingParams[_0x227d25(-0x27e,-0x210)](filter['column'],filter[_0x227d25(-0x1c9,-0x20e)]+'.'+filter[_0x227d25(-0x278,-0x232)]);});if(_0x4cb809['order']?.[_0x1bda07(0x300,0x347)]){const orderStr=_0x4cb809['order']['map'](_0x54a65a=>''+_0x54a65a['column']+(_0x54a65a[_0x1bda07(0x2b0,0x258)]?_0x1bda07(0x370,0x337):_0x1bda07(0x304,0x2ba)))[_0x1bda07(0x374,0x353)](',');existingParams['append'](_0x1bda07(0x322,0x2f5),orderStr);}if(_0x4cb809['limit'])existingParams[_0x1bda07(0x2a9,0x2c6)](_0x1bda07(0x321,0x2df),_0x4cb809[_0x1bda07(0x321,0x2b8)][_0x1bda07(0x366,0x35b)]());_0x4cb809['range']&&(existingParams['append'](_0x1bda07(0x325,0x2de),_0x4cb809[_0x1bda07(0x344,0x2db)][_0x1bda07(0x318,0x303)]['toString']()),existingParams[_0x1bda07(0x2a9,0x244)]('limit',(_0x4cb809[_0x1bda07(0x344,0x318)]['to']-_0x4cb809[_0x1bda07(0x344,0x358)]['from']+0x1)['toString']())),response=await this['httpClient'][_0x1bda07(0x28b,0x264)](_0x17c7b4+'?'+existingParams[_0x1bda07(0x366,0x3b0)](),{'headers':headers});}else{if(_0x547a94==='DELETE'){const _0x1d83c1=_0x4a2040[_0x1bda07(0x2cf,0x261)]('?'),_0x312209=_0x1d83c1[0x0],existingParams=new URLSearchParams(_0x1d83c1[0x1]||'');!existingParams[_0x1bda07(0x2ba,0x2fc)](_0x1bda07(0x341,0x357))&&existingParams[_0x1bda07(0x2a9,0x291)](_0x1bda07(0x341,0x349),_0x1bda07(0x33b,0x38e));_0x4cb809['filters']?.[_0x1bda07(0x300,0x309)]&&_0x4cb809['filters']['forEach'](filter=>{function _0x2e7a90(_0x44e8d3,_0x45c9b4){return _0xbff2(_0x44e8d3- -0x231,_0x45c9b4);}existingParams['append'](filter[_0x2e7a90(-0x16b,-0x15c)],filter[_0x2e7a90(-0x9c,-0x1c)]+'.'+filter['value']);});const deleteUrl=_0x312209+'?'+existingParams['toString']();console[_0x1bda07(0x326,0x389)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console['log']('\uD83D\uDD27 DELETE headers:',headers),console[_0x1bda07(0x326,0x36a)]('\uD83D\uDD27 DELETE filtros originais:',_0x4cb809[_0x1bda07(0x342,0x2da)]),response=await this['httpClient']['delete'](deleteUrl,{'headers':headers});}else{if(_0x547a94==='PATCH'){const _0x1be0a9=_0x4a2040['split']('?'),_0x18385e=_0x1be0a9[0x0],existingParams=new URLSearchParams(_0x1be0a9[0x1]||'');!existingParams[_0x1bda07(0x2ba,0x2fb)](_0x1bda07(0x341,0x3b4))&&existingParams[_0x1bda07(0x2a9,0x313)](_0x1bda07(0x341,0x2f9),_0x1bda07(0x2ef,0x35b));_0x4cb809[_0x1bda07(0x342,0x309)]?.[_0x1bda07(0x300,0x2df)]&&_0x4cb809['filters']['forEach'](filter=>{function _0xea7cb6(_0x37c4ea,_0xf802f2){return _0xbff2(_0x37c4ea-0x1c3,_0xf802f2);}existingParams[_0xea7cb6(0x2a3,0x321)](filter['column'],filter[_0xea7cb6(0x358,0x30b)]+'.'+filter[_0xea7cb6(0x2a9,0x2b1)]);});_0x4cb809[_0x1bda07(0x33d,0x384)]?.['prefer']&&(headers[_0x1bda07(0x303,0x30f)]=_0x4cb809[_0x1bda07(0x33d,0x318)][_0x1bda07(0x30e,0x2c0)]);const updateUrl=_0x18385e+'?'+existingParams['toString']();response=await this['httpClient'][_0x1bda07(0x30d,0x306)](updateUrl,_0x4cb809['data'],{'headers':headers});}else{let _0x319fd7=_0x4cb809['data'];!headers['Prefer']&&(headers['Prefer']=_0x1bda07(0x2e0,0x2d4)),_0x4cb809[_0x1bda07(0x33d,0x2c7)]?.[_0x1bda07(0x294,0x2c9)]&&(headers[_0x1bda07(0x303,0x31c)]='resolution=merge-duplicates,return=representation'),_0x4cb809[_0x1bda07(0x282,0x2f0)]&&(_0x319fd7=_0x4cb809['dataArray']),response=await this['httpClient']['post'](_0x4a2040,_0x319fd7,{'headers':headers});}}}return{'data':response[_0x1bda07(0x378,0x32c)],'error':null,'count':response['headers']?.['x-total-count']?parseInt(response['headers'][_0x1bda07(0x34c,0x2ec)]):undefined};}catch(_0x33fbc6){return{'data':null,'error':_0x33fbc6 instanceof EBaaSError?_0x33fbc6:new EBaaSError(_0x33fbc6 instanceof Error?_0x33fbc6[_0x1bda07(0x2e8,0x2df)]:'Database\x20operation\x20failed',0x0,_0x33fbc6)};}}}function _0xbff2(_0x2036f5,_0x11b70b){const _0x16f62a=_0x16f6();return _0xbff2=function(_0xbff264,_0x54ab35){_0xbff264=_0xbff264-0xb1;let _0x266e5f=_0x16f62a[_0xbff264];if(_0xbff2['AmnCVb']===undefined){var _0x25620a=function(_0x19c4c1){const _0x12df5b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x471e30='',_0x12620c='';for(let _0x4a5990=0x0,_0x58731a,_0x30aec9,_0x45e219=0x0;_0x30aec9=_0x19c4c1['charAt'](_0x45e219++);~_0x30aec9&&(_0x58731a=_0x4a5990%0x4?_0x58731a*0x40+_0x30aec9:_0x30aec9,_0x4a5990++%0x4)?_0x471e30+=String['fromCharCode'](0xff&_0x58731a>>(-0x2*_0x4a5990&0x6)):0x0){_0x30aec9=_0x12df5b['indexOf'](_0x30aec9);}for(let _0x2f4cbb=0x0,_0x199dd7=_0x471e30['length'];_0x2f4cbb<_0x199dd7;_0x2f4cbb++){_0x12620c+='%'+('00'+_0x471e30['charCodeAt'](_0x2f4cbb)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x12620c);};_0xbff2['UdgHcl']=_0x25620a,_0x2036f5=arguments,_0xbff2['AmnCVb']=!![];}const _0x3d0f86=_0x16f62a[0x0],_0x40037f=_0xbff264+_0x3d0f86,_0x1da4cf=_0x2036f5[_0x40037f];return!_0x1da4cf?(_0x266e5f=_0xbff2['UdgHcl'](_0x266e5f),_0x2036f5[_0x40037f]=_0x266e5f):_0x266e5f=_0x1da4cf,_0x266e5f;},_0xbff2(_0x2036f5,_0x11b70b);}class CustomDatabaseManager{constructor(_0x1e1778,_0xa906cc){this[_0x4cdee1(0xc1,0x55)]=_0x1e1778;function _0x4cdee1(_0x30eaad,_0x27e59a){return _0xbff2(_0x27e59a- -0xba,_0x30eaad);}this['workspaceId']=_0xa906cc;}async[_0x37f67d(0x192,0x1aa)](){if(!this[_0x5bb717(0x391,0x39b)])return{'hasCustomDatabase':![]};function _0x5bb717(_0x24decc,_0x169e4e){return _0xbff2(_0x169e4e-0x2cc,_0x24decc);}try{const response=await this[_0x5bb717(0x38f,0x3db)][_0x5bb717(0x342,0x38e)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this[_0x5bb717(0x337,0x39b)]}});if(response[_0x5bb717(0x3ef,0x430)]===0xc8&&response['data']?.['config']){const config=response[_0x5bb717(0x409,0x47b)][_0x5bb717(0x4a8,0x454)],_0x1c99a4={'host':config['postgresHost'],'port':config[_0x5bb717(0x3d8,0x40d)],'database':config[_0x5bb717(0x42e,0x402)],'username':config[_0x5bb717(0x3fc,0x384)],'password':'','schema':config['postgresSchema'],'sslEnabled':config['sslEnabled']};return this[_0x5bb717(0x37f,0x3bc)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x1c99a4},this['detectedConfig'];}}catch(_0xf1ee55){if(_0xf1ee55?.[_0x5bb717(0x47e,0x430)]===0x194)return this['detectedConfig']={'hasCustomDatabase':![]},this[_0x5bb717(0x362,0x3bc)];console['warn']('Failed to detect custom database configuration:',_0xf1ee55);}return this[_0x5bb717(0x3c7,0x3bc)]={'hasCustomDatabase':![]},this['detectedConfig'];}async['testConnection'](_0x4d2233){function _0x22e869(_0x5595ee,_0x1830d3){return _0xbff2(_0x5595ee-0x39e,_0x1830d3);}try{const response=await this[_0x22e869(0x4ad,0x489)]['post']('/admin/v1/workspace/custom-database/test-connection',_0x4d2233,{'headers':this[_0x22e869(0x46d,0x3ed)]?{'X-Workspace-ID':this[_0x22e869(0x46d,0x472)]}:{}});return response['data'];}catch(_0x5d37f9){return{'success':![],'message':_0x5d37f9?.[_0x22e869(0x4bd,0x522)]||_0x22e869(0x48c,0x440)};}}async['configureCustomDatabase'](_0x2e83d7){if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');function _0x5b67b5(_0x4812ef,_0x43dcaa){return _0xbff2(_0x43dcaa- -0x2ac,_0x4812ef);}const response=await this['httpClient'][_0x5b67b5(-0x1a5,-0x1a1)]('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x2e83d7},{'headers':{'X-Workspace-ID':this['workspaceId']}}),config=response[_0x5b67b5(-0x167,-0xfd)][_0x5b67b5(-0xbe,-0x124)];return this[_0x5b67b5(-0x153,-0x1bc)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x2e83d7},config;}async['removeCustomDatabase'](){function _0x409daa(_0x3fc29d,_0x29be5d){return _0xbff2(_0x29be5d- -0x4e,_0x3fc29d);}if(!this['workspaceId'])throw new Error('Workspace ID is required to remove custom database');await this[_0x409daa(0x12e,0xc1)][_0x409daa(0xfb,0x124)]('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this['workspaceId']}}),this['detectedConfig']={'hasCustomDatabase':![]};}['getDetectedConfig'](){function _0x926e87(_0x396b7d,_0xd2040a){return _0xbff2(_0x396b7d- -0x93,_0xd2040a);}return this[_0x926e87(0x5d,0x48)];}['hasCustomDatabase'](){function _0x2d1ded(_0x23f448,_0x528186){return _0xbff2(_0x23f448- -0x1db,_0x528186);}return this[_0x2d1ded(-0xeb,-0x88)]?.['hasCustomDatabase']??![];}[_0x37f67d(0x208,0x1a4)](){function _0x425b34(_0x170488,_0x5aeae1){return _0xbff2(_0x5aeae1-0x6a,_0x170488);}return this[_0x425b34(0x186,0x15a)]?.[_0x425b34(0x10d,0x16e)];}['setWorkspaceId'](_0x23c4c0){this['workspaceId']=_0x23c4c0,this['detectedConfig']=undefined;}[_0x37f67d(0x155,0x195)](){return this['workspaceId'];}[_0x37f67d(0x150,0x133)](){function _0xa50ae0(_0x3f5a4b,_0x1d886f){return _0xbff2(_0x3f5a4b-0x1d0,_0x1d886f);}return{'workspaceId':this['workspaceId'],'hasConfig':this['hasCustomDatabase'](),'configDetails':this['detectedConfig']?.[_0xa50ae0(0x2d4,0x2c2)]?{'host':this[_0xa50ae0(0x2c0,0x2c4)]['credentials'][_0xa50ae0(0x2b3,0x279)],'port':this['detectedConfig']['credentials'][_0xa50ae0(0x2b2,0x2c8)],'database':this['detectedConfig']['credentials'][_0xa50ae0(0x2e1,0x341)],'schema':this['detectedConfig'][_0xa50ae0(0x2d4,0x290)][_0xa50ae0(0x2a1,0x26c)]||_0xa50ae0(0x347,0x2df),'sslEnabled':this['detectedConfig']['credentials']['sslEnabled']||![]}:undefined};}}class DatabaseClient{constructor(_0x37906e,_0x141e29){function _0x358096(_0x51bc07,_0x201c3b){return _0xbff2(_0x51bc07-0xaf,_0x201c3b);}this['httpClient']=_0x37906e,this[_0x358096(0x24f,0x254)]=new CustomDatabaseManager(_0x37906e,_0x141e29);}['from'](_0x11cf3){function _0x5c5fbe(_0xa469ee,_0x25e609){return _0xbff2(_0x25e609- -0x1c2,_0xa469ee);}return new QueryBuilder(this['httpClient'],_0x11cf3,this[_0x5c5fbe(-0xa3,-0x36)],this['customDatabaseManager'][_0x5c5fbe(-0x86,-0x85)]());}['rpc'](_0x1c7daa,_0x1ab0f8){function _0x1aa852(_0x4db565,_0x47e2b4){return _0xbff2(_0x47e2b4-0x2d4,_0x4db565);}return this['httpClient']['post'](_0x1aa852(0x3fc,0x390)+_0x1c7daa,_0x1ab0f8);}[_0x37f67d(0x14d,0x129)](_0xe3adfc){const _0x1026f0=new DatabaseClient(this['httpClient'],this['customDatabaseManager']['getWorkspaceId']());return _0x1026f0['currentSchema']=_0xe3adfc,_0x1026f0['customDatabaseManager']=this['customDatabaseManager'],_0x1026f0;}async['detectCustomDatabase'](){return this['customDatabaseManager']['detectCustomDatabase']();}async['testCustomConnection'](_0x44d84f){function _0x1e204d(_0x566173,_0x21b66e){return _0xbff2(_0x566173- -0x2bb,_0x21b66e);}return this['customDatabaseManager'][_0x1e204d(-0x111,-0xb2)](_0x44d84f);}async[_0x37f67d(0x1d8,0x205)](_0x2f61d1){function _0x1e3b4e(_0x225d24,_0x4ee9e3){return _0xbff2(_0x4ee9e3- -0x1aa,_0x225d24);}return this[_0x1e3b4e(-0x6a,-0xa)][_0x1e3b4e(-0x5,0x3)](_0x2f61d1);}async['removeCustomDatabase'](){function _0x4ff9b3(_0x1b1085,_0x94ac6b){return _0xbff2(_0x94ac6b- -0x325,_0x1b1085);}return this[_0x4ff9b3(-0x14d,-0x185)]['removeCustomDatabase']();}[_0x37f67d(0x23f,0x1c3)](){function _0x3b740d(_0x4acee1,_0x469212){return _0xbff2(_0x4acee1-0x23,_0x469212);}return this[_0x3b740d(0x1c3,0x1ad)]['hasCustomDatabase']();}[_0x37f67d(0x170,0x12a)](){function _0x7aef4c(_0x5da5dd,_0xbd1270){return _0xbff2(_0x5da5dd- -0x2e7,_0xbd1270);}return this[_0x7aef4c(-0x147,-0xc4)][_0x7aef4c(-0x20c,-0x1a4)]();}['setWorkspaceId'](_0x29ee12){this['customDatabaseManager']['setWorkspaceId'](_0x29ee12);}async[_0x37f67d(0x1f9,0x1f7)](){function _0x29a50e(_0xe146c8,_0x34d701){return _0xbff2(_0x34d701- -0xf2,_0xe146c8);}try{await this['customDatabaseManager'][_0x29a50e(-0x1a,0x60)]();}catch(_0x3d352b){console['warn']('Failed to initialize custom database detection:',_0x3d352b);}}}function _0x37f67d(_0x324dae,_0x243cf1){return _0xbff2(_0x243cf1-0x58,_0x324dae);}class StorageBucket{constructor(_0x14428f,bucketId){this[_0x560ae5(0x347,0x362)]=_0x14428f;function _0x560ae5(_0x3b4745,_0x40ef91){return _0xbff2(_0x40ef91-0x253,_0x3b4745);}this[_0x560ae5(0x45e,0x403)]=bucketId;}async['upload'](_0x8b4ca2,_0x52d4a8,_0x4e7661){function _0x4c52b6(_0x3a42a3,_0x2c3405){return _0xbff2(_0x2c3405- -0x259,_0x3a42a3);}try{const _0x364393=new FormData();if(_0x52d4a8 instanceof File)_0x364393['append'](_0x4c52b6(-0x1a9,-0x161),_0x52d4a8);else{if(_0x52d4a8 instanceof Blob)_0x364393[_0x4c52b6(-0x158,-0x179)](_0x4c52b6(-0x13e,-0x161),_0x52d4a8,_0x8b4ca2);else{if(_0x52d4a8 instanceof ArrayBuffer)_0x364393[_0x4c52b6(-0x149,-0x179)]('file',new Blob([_0x52d4a8]),_0x8b4ca2);else typeof _0x52d4a8===_0x4c52b6(-0x112,-0xbd)&&_0x364393[_0x4c52b6(-0x1dc,-0x179)]('file',new Blob([_0x52d4a8],{'type':_0x4c52b6(-0x1da,-0x19e)}),_0x8b4ca2);}}_0x364393['append']('path',_0x8b4ca2);_0x4e7661?.[_0x4c52b6(-0xe7,-0x160)]&&_0x364393['append']('cacheControl',_0x4e7661['cacheControl']);_0x4e7661?.['contentType']&&_0x364393[_0x4c52b6(-0x192,-0x179)](_0x4c52b6(-0xf1,-0xad),_0x4e7661['contentType']);_0x4e7661?.[_0x4c52b6(-0x1ed,-0x184)]&&_0x364393['append']('metadata',JSON['stringify'](_0x4e7661['metadata']));const _0x494891='/storage/buckets/'+this[_0x4c52b6(-0x43,-0xa9)]+'/files'+(_0x4e7661?.[_0x4c52b6(-0x124,-0x18e)]?'?upsert=true':''),response=await this['httpClient']['post'](_0x494891,_0x364393,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x4c52b6(-0x28,-0xaa)],'error':null};}catch(_0x3a98eb){return{'data':null,'error':_0x3a98eb instanceof EBaaSError?_0x3a98eb:new EBaaSError(_0x3a98eb instanceof Error?_0x3a98eb[_0x4c52b6(-0xe9,-0x13a)]:_0x4c52b6(-0x124,-0x117),0x0,_0x3a98eb)};}}async[_0x37f67d(0x19a,0x1d8)](_0x36d146,_0x41b3e5){function _0x3deb50(_0x1ce834,_0x57a1c1){return _0xbff2(_0x1ce834-0x3a1,_0x57a1c1);}try{const _0x48e258=new URLSearchParams();_0x41b3e5?.[_0x3deb50(0x4fb,0x4cb)]&&Object['entries'](_0x41b3e5[_0x3deb50(0x4fb,0x4ae)])[_0x3deb50(0x479,0x427)](([_0x3878fc,_0x1d7f9b])=>{_0x1d7f9b!==undefined&&_0x48e258['append'](_0x3878fc,String(_0x1d7f9b));});const _0x14ff41='/storage/buckets/'+this[_0x3deb50(0x551,0x574)]+_0x3deb50(0x53a,0x4cc)+_0x36d146+(_0x48e258['toString']()?'?'+_0x48e258[_0x3deb50(0x53e,0x584)]():''),response=await this[_0x3deb50(0x4b0,0x494)][_0x3deb50(0x463,0x44b)](_0x14ff41,{'responseType':_0x3deb50(0x4b6,0x493)});return{'data':response['data'],'error':null};}catch(_0x57e54f){return{'data':null,'error':_0x57e54f instanceof EBaaSError?_0x57e54f:new EBaaSError(_0x57e54f instanceof Error?_0x57e54f['message']:'Failed\x20to\x20download\x20file',0x0,_0x57e54f)};}}async[_0x37f67d(0x1cb,0x154)](_0x23e447,_0x4290f2){function _0x3a26e3(_0x583a3d,_0x3e40b2){return _0xbff2(_0x3e40b2- -0x1ff,_0x583a3d);}try{const _0x1aa995=new URLSearchParams();_0x23e447&&_0x1aa995[_0x3a26e3(-0x196,-0x11f)](_0x3a26e3(-0x153,-0xf3),_0x23e447);_0x4290f2?.[_0x3a26e3(-0x82,-0xa7)]&&_0x1aa995['append'](_0x3a26e3(-0x72,-0xa7),String(_0x4290f2[_0x3a26e3(-0x124,-0xa7)]));_0x4290f2?.['offset']&&_0x1aa995[_0x3a26e3(-0x140,-0x11f)]('offset',String(_0x4290f2['offset']));_0x4290f2?.['sortBy']&&_0x1aa995['append']('sortBy',JSON[_0x3a26e3(-0x87,-0x65)](_0x4290f2['sortBy']));_0x4290f2?.[_0x3a26e3(-0xed,-0xcf)]&&_0x1aa995['append'](_0x3a26e3(-0x148,-0xcf),_0x4290f2[_0x3a26e3(-0xf3,-0xcf)]);const _0x1f5383=_0x3a26e3(-0x1f,-0x97)+this['bucketId']+'/files'+(_0x1aa995['toString']()?'?'+_0x1aa995['toString']():''),response=await this['httpClient']['get'](_0x1f5383);return{'data':response['data'],'error':null};}catch(_0xcbb3b){return{'data':null,'error':_0xcbb3b instanceof EBaaSError?_0xcbb3b:new EBaaSError(_0xcbb3b instanceof Error?_0xcbb3b['message']:'Failed\x20to\x20list\x20files',0x0,_0xcbb3b)};}}async['remove'](_0x394d9f){function _0x44af4a(_0x540740,_0x20aa6d){return _0xbff2(_0x540740- -0x5e,_0x20aa6d);}try{const response=await this[_0x44af4a(0xb1,0xd5)]['delete']('/storage/buckets/'+this[_0x44af4a(0x152,0x1ae)]+_0x44af4a(0x112,0x10c),{'data':{'paths':_0x394d9f}});return{'data':response['data'],'error':null};}catch(_0x9a5fce){return{'data':null,'error':_0x9a5fce instanceof EBaaSError?_0x9a5fce:new EBaaSError(_0x9a5fce instanceof Error?_0x9a5fce[_0x44af4a(0xc1,0x9f)]:_0x44af4a(0x87,0x3c),0x0,_0x9a5fce)};}}async[_0x37f67d(0x195,0x139)](fromPath,_0xa809a9){function _0x44c3af(_0x3d424c,_0x19b513){return _0xbff2(_0x3d424c-0x13d,_0x19b513);}try{const response=await this[_0x44c3af(0x24c,0x293)]['post'](_0x44c3af(0x2a5,0x2e8)+this['bucketId']+_0x44c3af(0x2d0,0x258),{'sourceKey':fromPath,'destinationKey':_0xa809a9});return{'data':response['data'],'error':null};}catch(_0xc623fa){return{'data':null,'error':_0xc623fa instanceof EBaaSError?_0xc623fa:new EBaaSError(_0xc623fa instanceof Error?_0xc623fa['message']:'Failed\x20to\x20move\x20file',0x0,_0xc623fa)};}}async[_0x37f67d(0x221,0x1a6)](fromPath,_0x3d9086){function _0x40366c(_0x3cfcda,_0x44988a){return _0xbff2(_0x3cfcda- -0x2c1,_0x44988a);}try{const response=await this['httpClient'][_0x40366c(-0x1b6,-0x1ae)](_0x40366c(-0x159,-0x198)+this['bucketId']+_0x40366c(-0x181,-0x119),{'sourceKey':fromPath,'destinationKey':_0x3d9086});return{'data':response['data'],'error':null};}catch(_0x43b65b){return{'data':null,'error':_0x43b65b instanceof EBaaSError?_0x43b65b:new EBaaSError(_0x43b65b instanceof Error?_0x43b65b['message']:'Failed\x20to\x20copy\x20file',0x0,_0x43b65b)};}}async[_0x37f67d(0x109,0x15a)](_0x349218,_0x3a0e02,_0x48e58e){function _0x2eeebb(_0x446791,_0x3b2863){return _0xbff2(_0x446791- -0x11e,_0x3b2863);}try{const response=await this['httpClient']['post'](_0x2eeebb(0x4a,0xbe)+this[_0x2eeebb(0x92,0x10e)]+'/files/'+_0x349218+'/sign',{'expiresIn':_0x3a0e02,..._0x48e58e});return{'data':response[_0x2eeebb(0x91,0x1e)],'error':null};}catch(_0x2d3dca){return{'data':null,'error':_0x2d3dca instanceof EBaaSError?_0x2d3dca:new EBaaSError(_0x2d3dca instanceof Error?_0x2d3dca[_0x2eeebb(0x1,0x58)]:_0x2eeebb(-0x4a,-0x9e),0x0,_0x2d3dca)};}}[_0x37f67d(0x195,0x15b)](_0x3dc87c,_0x9dfd85){const _0x13400d=new URLSearchParams();_0x9dfd85?.['transform']&&Object[_0x5393b8(-0x1d6,-0x16d)](_0x9dfd85['transform'])[_0x5393b8(-0x280,-0x2e9)](([_0x2efaee,_0x2cc3d6])=>{_0x2cc3d6!==undefined&&_0x13400d['append'](_0x2efaee,String(_0x2cc3d6));});const _0x5b9475=this['httpClient'][_0x5393b8(-0x274,-0x2f0)]||'',_0x58b793=_0x5b9475+_0x5393b8(-0x1f0,-0x22a)+this['bucketId']+_0x5393b8(-0x1bf,-0x142)+_0x3dc87c+(_0x13400d[_0x5393b8(-0x1bb,-0x20a)]()?'?'+_0x13400d[_0x5393b8(-0x1bb,-0x1f8)]():'');function _0x5393b8(_0x14be89,_0x4ff34a){return _0xbff2(_0x14be89- -0x358,_0x4ff34a);}return{'data':{'publicUrl':_0x58b793}};}async['getFileInfo'](_0x5cc1a7){function _0x467ea2(_0x178b70,_0x24c356){return _0xbff2(_0x24c356-0xb7,_0x178b70);}try{const response=await this[_0x467ea2(0x243,0x1c6)]['get'](_0x467ea2(0x27f,0x21f)+this[_0x467ea2(0x2e0,0x267)]+_0x467ea2(0x223,0x250)+_0x5cc1a7+_0x467ea2(0x1bd,0x1da));return{'data':response['data'],'error':null};}catch(_0x6de241){return{'data':null,'error':_0x6de241 instanceof EBaaSError?_0x6de241:new EBaaSError(_0x6de241 instanceof Error?_0x6de241['message']:_0x467ea2(0x1c1,0x16d),0x0,_0x6de241)};}}async[_0x37f67d(0x9e,0x120)](_0xfcb446,metadata){function _0x10377a(_0x2475ef,_0x200084){return _0xbff2(_0x200084- -0x3ce,_0x2475ef);}try{const response=await this[_0x10377a(-0x25c,-0x2bf)][_0x10377a(-0x35e,-0x301)]('/storage/buckets/'+this['bucketId']+'/files/'+_0xfcb446+'/metadata',{'metadata':metadata});return{'data':response['data'],'error':null};}catch(_0x406869){return{'data':null,'error':_0x406869 instanceof EBaaSError?_0x406869:new EBaaSError(_0x406869 instanceof Error?_0x406869[_0x10377a(-0x2b5,-0x2af)]:'Failed\x20to\x20update\x20file\x20metadata',0x0,_0x406869)};}}}class StorageClient{constructor(_0x1862a2){function _0x275859(_0x4ceb1a,_0x338202){return _0xbff2(_0x338202- -0x2c8,_0x4ceb1a);}this[_0x275859(-0x1fe,-0x1b9)]=_0x1862a2;}[_0x37f67d(0x1ce,0x1a7)](bucketId){return new StorageBucket(this['httpClient'],bucketId);}async['createBucket'](_0x17df3c,_0x1b4b19){function _0x565828(_0x2001d7,_0x309daa){return _0xbff2(_0x309daa- -0x2b2,_0x2001d7);}try{const response=await this[_0x565828(-0x1c0,-0x1a3)]['post']('/storage/buckets',{'id':_0x17df3c,..._0x1b4b19});return{'data':response[_0x565828(-0x153,-0x103)],'error':null};}catch(_0x1ac125){return{'data':null,'error':_0x1ac125 instanceof EBaaSError?_0x1ac125:new EBaaSError(_0x1ac125 instanceof Error?_0x1ac125['message']:_0x565828(-0x23b,-0x1fe),0x0,_0x1ac125)};}}async[_0x37f67d(0x197,0x1a8)](_0x356371){function _0x2528b1(_0x29fc9a,_0x59fd35){return _0xbff2(_0x59fd35-0x33,_0x29fc9a);}try{const response=await this['httpClient']['get'](_0x2528b1(0x176,0x19b)+_0x356371);return{'data':response['data'],'error':null};}catch(_0x3990d9){return{'data':null,'error':_0x3990d9 instanceof EBaaSError?_0x3990d9:new EBaaSError(_0x3990d9 instanceof Error?_0x3990d9['message']:'Failed\x20to\x20get\x20bucket',0x0,_0x3990d9)};}}async[_0x37f67d(0x201,0x1a0)](){function _0x545330(_0x3ffbb2,_0x13071e){return _0xbff2(_0x13071e- -0xbd,_0x3ffbb2);}try{const response=await this['httpClient'][_0x545330(0x84,0x5)]('/storage/buckets');return{'data':response['data'],'error':null};}catch(_0x49bf35){return{'data':null,'error':_0x49bf35 instanceof EBaaSError?_0x49bf35:new EBaaSError(_0x49bf35 instanceof Error?_0x49bf35['message']:'Failed\x20to\x20list\x20buckets',0x0,_0x49bf35)};}}async[_0x37f67d(0x198,0x157)](_0xf85fb8,_0xb7aac5){function _0x1a3118(_0x31b711,_0x5a9834){return _0xbff2(_0x5a9834- -0x342,_0x31b711);}try{const response=await this['httpClient'][_0x1a3118(-0x22c,-0x275)]('/storage/buckets/'+_0xf85fb8,_0xb7aac5);return{'data':response[_0x1a3118(-0x164,-0x193)],'error':null};}catch(_0x521f1e){return{'data':null,'error':_0x521f1e instanceof EBaaSError?_0x521f1e:new EBaaSError(_0x521f1e instanceof Error?_0x521f1e['message']:'Failed\x20to\x20update\x20bucket',0x0,_0x521f1e)};}}async[_0x37f67d(0x168,0x1e8)](_0x51aada){function _0x176085(_0x5768cd,_0x48dc05){return _0xbff2(_0x5768cd-0x19b,_0x48dc05);}try{const response=await this[_0x176085(0x2aa,0x305)]['delete'](_0x176085(0x303,0x2c6)+_0x51aada);return{'data':response['data'],'error':null};}catch(_0x3b4b88){return{'data':null,'error':_0x3b4b88 instanceof EBaaSError?_0x3b4b88:new EBaaSError(_0x3b4b88 instanceof Error?_0x3b4b88[_0x176085(0x2ba,0x2c5)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x3b4b88)};}}async['getUsage'](){function _0xccd952(_0x53706c,_0x4b2dc5){return _0xbff2(_0x4b2dc5- -0x3d8,_0x53706c);}try{const response=await this['httpClient'][_0xccd952(-0x324,-0x316)]('/storage/usage');return{'data':response['data'],'error':null};}catch(_0x56c565){return{'data':null,'error':_0x56c565 instanceof EBaaSError?_0x56c565:new EBaaSError(_0x56c565 instanceof Error?_0x56c565['message']:'Failed\x20to\x20get\x20storage\x20usage',0x0,_0x56c565)};}}}class RealtimeChannel extends EventEmitter{constructor(_0x408f00,_0x38805f){super(),this[_0x33bfc3(0x227,0x1ca)]=![],this['state']=_0x33bfc3(0x1fb,0x202),this['subscriptions']=new Map();function _0x33bfc3(_0x2bf859,_0x1e0c7a){return _0xbff2(_0x2bf859-0x13e,_0x1e0c7a);}this[_0x33bfc3(0x22b,0x28e)]=_0x408f00,this['socket']=_0x38805f;}['subscribe'](_0x436003){!this[_0x38cbb0(-0x215,-0x1d4)]&&(this[_0x38cbb0(-0x215,-0x275)]=!![],this['_join']());_0x436003&&this['on'](_0x38cbb0(-0x19a,-0x122),_0x436003);function _0x38cbb0(_0x1d3400,_0x49fb9e){return _0xbff2(_0x1d3400- -0x2fe,_0x49fb9e);}return this;}['onPostgresChanges'](filter,_0x360a0d){const _0x2ec9fc=_0x5c7540(0x2c7,0x2bd)+JSON[_0x5c7540(0x332,0x31f)](filter);super['on'](_0x2ec9fc,_0x360a0d);function _0x5c7540(_0x37767e,_0x2270f9){return _0xbff2(_0x2270f9-0x185,_0x37767e);}const _0x131405={'unsubscribe':()=>{function _0x58550b(_0x41c015,_0x2912a1){return _0xbff2(_0x41c015- -0x1f0,_0x2912a1);}super['off'](_0x2ec9fc,_0x360a0d),this[_0x58550b(-0x99,-0xbc)][_0x58550b(-0x7e,-0xdb)](_0x2ec9fc);}};return this[_0x5c7540(0x2a9,0x2dc)][_0x5c7540(0x300,0x30e)](_0x2ec9fc,_0x131405),this[_0x5c7540(0x256,0x253)]?.['connected']&&this[_0x5c7540(0x2ed,0x2c3)]===_0x5c7540(0x2a9,0x25c)&&this[_0x5c7540(0x22f,0x253)][_0x5c7540(0x339,0x31c)](_0x5c7540(0x3a5,0x339),{'topic':this[_0x5c7540(0x1f7,0x272)],'filter':filter,'ref':this[_0x5c7540(0x306,0x297)]()}),_0x131405;}[_0x37f67d(0x190,0x1d5)](filter,_0x3a7380){const _0x371fe=_0x27ba8f(-0x40,0x35)+JSON[_0x27ba8f(0xae,0x9d)](filter);super['on'](_0x371fe,_0x3a7380);function _0x27ba8f(_0x45cc17,_0x2b45fa){return _0xbff2(_0x2b45fa- -0xfd,_0x45cc17);}const _0x26de17={'unsubscribe':()=>{super[_0x5430e0(0x2f0,0x289)](_0x371fe,_0x3a7380);function _0x5430e0(_0x547271,_0x47d1ca){return _0xbff2(_0x547271-0x1a3,_0x47d1ca);}this[_0x5430e0(0x2fa,0x2ba)][_0x5430e0(0x315,0x301)](_0x371fe);}};return this[_0x27ba8f(0x1c,0x5a)][_0x27ba8f(0x5e,0x8c)](_0x371fe,_0x26de17),_0x26de17;}[_0x37f67d(0x18a,0x1c4)](filter,_0x3d15cd){function _0x167587(_0x805c42,_0x3018ac){return _0xbff2(_0x3018ac-0x2cc,_0x805c42);}const _0x492139='presence:'+JSON[_0x167587(0x491,0x466)](filter);super['on'](_0x492139,_0x3d15cd);const _0x4b0440={'unsubscribe':()=>{function _0x4c07db(_0x5814c8,_0x2df561){return _0xbff2(_0x5814c8- -0x305,_0x2df561);}super['off'](_0x492139,_0x3d15cd),this[_0x4c07db(-0x1ae,-0x135)]['delete'](_0x492139);}};return this['subscriptions']['set'](_0x492139,_0x4b0440),_0x4b0440;}['send'](_0x3f1bdf){return new Promise(_0xad8a5b=>{function _0x4a634e(_0x124fc2,_0x486067){return _0xbff2(_0x124fc2- -0x224,_0x486067);}this[_0x4a634e(-0x156,-0x1be)]?.[_0x4a634e(-0x16d,-0x1a8)]&&this[_0x4a634e(-0xe6,-0x13f)]==='joined'?(this[_0x4a634e(-0x156,-0x168)][_0x4a634e(-0x8d,-0xac)]('broadcast',{'topic':this['topic'],'event':_0x3f1bdf[_0x4a634e(-0x164,-0x182)],'payload':_0x3f1bdf,'ref':this['makeRef']()}),_0xad8a5b('ok')):_0xad8a5b(_0x4a634e(-0x16a,-0xfc));});}[_0x37f67d(0xf2,0x174)](_0x47cf4d){return new Promise(_0x4391a0=>{function _0xcf8dfa(_0x4ca462,_0x4ebfc4){return _0xbff2(_0x4ebfc4-0x122,_0x4ca462);}this[_0xcf8dfa(0x212,0x1f0)]?.['connected']&&this['state']===_0xcf8dfa(0x24f,0x1f9)?(this[_0xcf8dfa(0x1aa,0x1f0)][_0xcf8dfa(0x2eb,0x2b9)]('presence',{'topic':this['topic'],'event':_0xcf8dfa(0x1dd,0x23e),'payload':_0x47cf4d,'ref':this[_0xcf8dfa(0x1cd,0x234)]()}),_0x4391a0('ok')):_0x4391a0('error');});}[_0x37f67d(0x1a7,0x1a1)](){return new Promise(_0x3f06b0=>{function _0x5d43ec(_0x1111c7,_0x2cfa07){return _0xbff2(_0x1111c7-0x19d,_0x2cfa07);}this[_0x5d43ec(0x26b,0x20f)]?.[_0x5d43ec(0x254,0x243)]&&this['state']==='joined'?(this['socket']['emit'](_0x5d43ec(0x29e,0x237),{'topic':this['topic'],'event':_0x5d43ec(0x2e6,0x2fb),'ref':this[_0x5d43ec(0x2af,0x2c8)]()}),_0x3f06b0('ok')):_0x3f06b0('error');});}['unsubscribe'](){return new Promise(_0x504161=>{this['state']=_0x22e0b3(-0x188,-0x124);function _0x22e0b3(_0xe551bf,_0x4501f0){return _0xbff2(_0x4501f0- -0x246,_0xe551bf);}this['subscriptions']['forEach'](_0x10377c=>{function _0x4ae425(_0x1d8dba,_0x3a66f3){return _0xbff2(_0x3a66f3-0x207,_0x1d8dba);}_0x10377c[_0x4ae425(0x2cf,0x343)]();}),this['subscriptions'][_0x22e0b3(-0x178,-0x10d)](),this['socket']?.['connected']&&this['socket']['emit']('leave',{'topic':this['topic'],'ref':this[_0x22e0b3(-0x1b7,-0x134)]()}),this['state']='closed',this[_0x22e0b3(-0x1c4,-0x173)](),_0x504161('ok');});}['_join'](){if(this[_0x1ddc75(-0x19f,-0x1b3)]==='leaving')return;this['state']=_0x1ddc75(-0x239,-0x1c5);function _0x1ddc75(_0x14cc9f,_0x32fe74){return _0xbff2(_0x32fe74- -0x2f1,_0x14cc9f);}this[_0x1ddc75(-0x1c7,-0x223)]?.['connected']&&(this[_0x1ddc75(-0x251,-0x223)]['emit'](_0x1ddc75(-0x172,-0x146),{'topic':this['topic'],'ref':this['makeRef']()}),setTimeout(()=>{function _0x6d344d(_0x25c4dd,_0x575353){return _0xbff2(_0x25c4dd-0x1d,_0x575353);}this[_0x6d344d(0x15b,0x1aa)]===_0x6d344d(0x149,0x16e)&&(this[_0x6d344d(0x15b,0x1a8)]=_0x6d344d(0xf4,0x16e),this['emit'](_0x6d344d(0x181,0x18a),_0x6d344d(0xde,0x141)));},0x64));}[_0x37f67d(0x195,0x1c9)](){function _0x112248(_0x2f1edd,_0xcfa662){return _0xbff2(_0x2f1edd-0x1c8,_0xcfa662);}this['joinedOnce']&&(this['_join'](),this['subscriptions'][_0x112248(0x2a0,0x277)]((_0x27eac9,_0x41a374)=>{function _0x5a73d1(_0x4e98c2,_0x42f88e){return _0xbff2(_0x42f88e- -0x2f6,_0x4e98c2);}if(_0x41a374['startsWith']('postgres_changes:')){const filter=JSON['parse'](_0x41a374['replace'](_0x5a73d1(-0x198,-0x1be),''));this['socket']?.['emit'](_0x5a73d1(-0xc5,-0x142),{'topic':this['topic'],'filter':filter,'ref':this['makeRef']()});}}));}['_trigger'](_0x31e703,_0x5263e0){if(_0x31e703==='postgres_changes'){const _0x55cf0b='postgres_changes:'+JSON[_0x430856(-0x2a5,-0x226)](_0x5263e0['filter']||{});this[_0x430856(-0x1e6,-0x229)](_0x55cf0b,_0x5263e0);}else{if(_0x31e703==='broadcast'){const _0x2e41e2=_0x430856(-0x298,-0x28e)+JSON[_0x430856(-0x1fd,-0x226)]({'event':_0x5263e0['event']});this[_0x430856(-0x1fb,-0x229)](_0x2e41e2,_0x5263e0);}else{if(_0x31e703===_0x430856(-0x2cb,-0x2bf)){const _0x4b5f56=_0x430856(-0x2a7,-0x27a)+JSON[_0x430856(-0x218,-0x226)]({'event':_0x5263e0['event']});this[_0x430856(-0x200,-0x229)](_0x4b5f56,_0x5263e0);}}}function _0x430856(_0x4aa5a7,_0x49249b){return _0xbff2(_0x49249b- -0x3c0,_0x4aa5a7);}this[_0x430856(-0x202,-0x229)](_0x31e703,_0x5263e0);}[_0x37f67d(0x166,0x1ab)](_0xc40fbd){this[_0x5c37e7(0x416,0x446)]=_0xc40fbd;function _0x5c37e7(_0x20e5b7,_0x3c741a){return _0xbff2(_0x3c741a-0x308,_0x20e5b7);}let status;switch(_0xc40fbd){case'joined':status=_0x5c37e7(0x39b,0x3c9);break;case _0x5c37e7(0x410,0x459):status='CHANNEL_ERROR';break;case'closed':status=_0x5c37e7(0x3c2,0x3e1);break;default:return;}this[_0x5c37e7(0x4d5,0x49f)]('status',status);}[_0x37f67d(0xfd,0x16a)](){function _0x4c93a1(_0x205ca4,_0x4bc6d5){return _0xbff2(_0x205ca4- -0x2b,_0x4bc6d5);}return Math[_0x4c93a1(0xda,0x56)]()['toString'](0x24)['substring'](0x2,0xf);}['getState'](){function _0x3be264(_0xf437cf,_0x1b5c70){return _0xbff2(_0x1b5c70-0x187,_0xf437cf);}return this[_0x3be264(0x2c0,0x2c5)];}}class RealtimeClient{constructor(_0xdbdb63,_0x254ef9,_0x40f970={}){this[_0x420361(-0x1f,0x62)]=null,this['channels']=new Map(),this['connectionState']=_0x420361(0xae,0x83),this['reconnectAttempts']=0x0,this[_0x420361(0x13,-0x24)]=0x5,this[_0x420361(-0x1,0x65)]=_0xdbdb63;function _0x420361(_0x2343fe,_0x5daae2){return _0xbff2(_0x2343fe- -0xed,_0x5daae2);}this[_0x420361(0x8,-0x17)]=_0x254ef9,this['options']={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x40f970};}['connect'](){return new Promise((_0x8fc71c,_0x293260)=>{if(this['socket']?.[_0x36c3d0(-0x15f,-0x1df)]){_0x8fc71c();return;}this['connectionState']=_0x36c3d0(-0x137,-0xfa),this['socket']=socket_ioClient['io'](this['url'],{'auth':{'apikey':this[_0x36c3d0(-0x121,-0xa0)]},'transports':[_0x36c3d0(-0xaf,-0xf8)],'reconnection':!![],'reconnectionDelay':this['options']['reconnectInterval'],'reconnectionAttempts':this['options']['maxReconnectAttempts'],...this['options']['socketOptions']}),this['socket']['on']('connect',()=>{this[_0x7941d8(0x307,0x34d)]='connected',this[_0x7941d8(0x338,0x350)]=0x0;function _0x7941d8(_0x449b38,_0x837ba1){return _0xbff2(_0x837ba1-0x284,_0x449b38);}this[_0x7941d8(0x40d,0x38d)](),_0x8fc71c();}),this[_0x36c3d0(-0x148,-0x161)]['on'](_0x36c3d0(-0x12b,-0x164),_0x2415b1=>{this['connectionState']=_0x5463ef(0x48,-0x2b);function _0x5463ef(_0x105694,_0x297575){return _0xbff2(_0x297575- -0x1c6,_0x105694);}this['channels'][_0x5463ef(-0x84,-0xee)](channel=>{function _0x4cbb90(_0x70b677,_0x17e4d8){return _0xbff2(_0x17e4d8- -0x12f,_0x70b677);}channel['_setState'](_0x4cbb90(-0x65,-0x72));});});function _0x36c3d0(_0x593f28,_0x30968f){return _0xbff2(_0x593f28- -0x216,_0x30968f);}this[_0x36c3d0(-0x148,-0x171)]['on']('connect_error',_0x58c75a=>{this[_0x15077e(-0x34c,-0x2f5)]='error',this[_0x15077e(-0x34a,-0x2f2)]++;function _0x15077e(_0x262bcb,_0x299f33){return _0xbff2(_0x299f33- -0x3be,_0x262bcb);}this['reconnectAttempts']>=this['maxReconnectAttempts']&&_0x293260(new Error(_0x15077e(-0x2a5,-0x2c8)+this[_0x15077e(-0x247,-0x2be)]+'\x20attempts:\x20'+_0x58c75a['message']));}),this['socket']['on'](_0x36c3d0(-0xf9,-0xdc),()=>{function _0x160661(_0x45320a,_0x1ecba4){return _0xbff2(_0x1ecba4-0x331,_0x45320a);}this[_0x160661(0x45b,0x3fa)]=_0x160661(0x38a,0x3e8),this['reconnectAttempts']=0x0,this['channels']['forEach'](channel=>{channel['_rejoin']();});}),this['socket']['on']('postgres_changes',_0x4e8323=>{function _0x1a5a42(_0x662858,_0xf843c){return _0xbff2(_0x662858-0x247,_0xf843c);}const channel=this[_0x1a5a42(0x3c8,0x39e)][_0x1a5a42(0x309,0x37c)](_0x4e8323[_0x1a5a42(0x334,0x2ba)]);channel&&channel[_0x1a5a42(0x3d9,0x417)](_0x1a5a42(0x30e,0x2b8),_0x4e8323);}),this[_0x36c3d0(-0x148,-0x137)]['on'](_0x36c3d0(-0x118,-0xc8),_0x1e4666=>{const channel=this[_0x5cc8dc(0x525,0x4a2)]['get'](_0x1e4666['topic']);function _0x5cc8dc(_0x1427ed,_0x7d68d7){return _0xbff2(_0x7d68d7-0x321,_0x1427ed);}channel&&channel['_trigger'](_0x5cc8dc(0x46d,0x41f),_0x1e4666);}),this[_0x36c3d0(-0x148,-0xd0)]['on']('presence',_0x535de6=>{function _0x2ab016(_0x2dd7f6,_0x1c0f8e){return _0xbff2(_0x2dd7f6- -0x1db,_0x1c0f8e);}const channel=this[_0x2ab016(-0x5a,-0x4f)]['get'](_0x535de6['topic']);channel&&channel[_0x2ab016(-0x49,-0xaf)](_0x2ab016(-0xda,-0xcc),_0x535de6);});});}['disconnect'](){this['socket']&&(this['socket'][_0xb31d00(-0x178,-0x1eb)](),this[_0xb31d00(-0x195,-0x1ec)]=null);function _0xb31d00(_0x540c87,_0x1f1e60){return _0xbff2(_0x540c87- -0x263,_0x1f1e60);}this[_0xb31d00(-0x19a,-0x1d7)]=_0xb31d00(-0xc8,-0xfd),this[_0xb31d00(-0xe2,-0x12c)]['clear']();}[_0x37f67d(0x1d7,0x1d7)](_0x5e57e7){if(this[_0x164aef(0x3bf,0x43e)][_0x164aef(0x378,0x3ae)](_0x5e57e7))return this[_0x164aef(0x478,0x43e)]['get'](_0x5e57e7);function _0x164aef(_0x1789ed,_0x1c142c){return _0xbff2(_0x1c142c-0x2bd,_0x1789ed);}const channel=new RealtimeChannel(_0x5e57e7,this['socket']);return this['channels']['set'](_0x5e57e7,channel),this['connectionState']===_0x164aef(0x35e,0x374)&&channel[_0x164aef(0x46a,0x455)](),channel;}['removeChannel'](channel){function _0x49f18e(_0x36ae78,_0xa3531c){return _0xbff2(_0x36ae78- -0x44,_0xa3531c);}const _0x2a9741=channel['topic'];this[_0x49f18e(0x13d,0x14f)]['has'](_0x2a9741)&&(this[_0x49f18e(0x13d,0x1a3)][_0x49f18e(0x12e,0x195)](_0x2a9741),channel['unsubscribe']());}['removeAllChannels'](){function _0x1e6616(_0x424866,_0x2375a2){return _0xbff2(_0x424866- -0x337,_0x2375a2);}this['channels']['forEach'](channel=>{channel['unsubscribe']();}),this['channels'][_0x1e6616(-0x1fe,-0x1eb)]();}[_0x37f67d(0x200,0x186)](){function _0x22ab4c(_0x92af77,_0x4a1d88){return _0xbff2(_0x92af77- -0x367,_0x4a1d88);}return Array[_0x22ab4c(-0x218,-0x19a)](this[_0x22ab4c(-0x1e6,-0x17d)]['values']());}['isConnected'](){function _0xc34663(_0x43c66d,_0x3f1bb8){return _0xbff2(_0x3f1bb8-0x3ab,_0x43c66d);}return this['connectionState']===_0xc34663(0x4e6,0x462)&&!!this[_0xc34663(0x4d9,0x479)]?.[_0xc34663(0x3fb,0x462)];}['getConnectionState'](){return this['connectionState'];}['onConnectionStateChange'](_0x3a74c8){const _0x410d0a=()=>_0x3a74c8(this['connectionState']);function _0x2af2d6(_0x7090bd,_0x3f50f2){return _0xbff2(_0x7090bd-0x365,_0x3f50f2);}return this[_0x2af2d6(0x433,0x418)]&&(this[_0x2af2d6(0x433,0x43c)]['on']('connect',()=>{this['connectionState']='connected',_0x410d0a();}),this[_0x2af2d6(0x433,0x448)]['on'](_0x2af2d6(0x450,0x4c9),()=>{function _0xbd913(_0x32c490,_0x4e49c3){return _0xbff2(_0x32c490-0x334,_0x4e49c3);}this[_0xbd913(0x3fd,0x403)]=_0xbd913(0x4cf,0x4b2),_0x410d0a();}),this[_0x2af2d6(0x433,0x45d)]['on']('connect_error',()=>{function _0x6334d6(_0x26e476,_0x2528eb){return _0xbff2(_0x26e476-0x165,_0x2528eb);}this[_0x6334d6(0x22e,0x1d0)]='error',_0x410d0a();})),()=>{function _0x24395e(_0x1d40de,_0x274d78){return _0xbff2(_0x274d78-0x3b9,_0x1d40de);}this[_0x24395e(0x4ed,0x487)]&&(this[_0x24395e(0x442,0x487)]['off']('connect',_0x410d0a),this[_0x24395e(0x495,0x487)]['off'](_0x24395e(0x47d,0x4a4),_0x410d0a),this['socket'][_0x24395e(0x4a9,0x506)](_0x24395e(0x4f2,0x51a),_0x410d0a));};}['setupHeartbeat'](){if(!this['options']['heartbeatInterval']||!this[_0x58d59c(0x228,0x1a4)])return;function _0x58d59c(_0x5cc101,_0x11cde8){return _0xbff2(_0x5cc101-0x15a,_0x11cde8);}const interval=setInterval(()=>{function _0x4a24ee(_0x13effa,_0x7874a4){return _0xbff2(_0x7874a4-0x113,_0x13effa);}this['socket']?.['connected']?this['socket']['emit'](_0x4a24ee(0x1ff,0x1fb),{'timestamp':Date['now']()}):clearInterval(interval);},this[_0x58d59c(0x2ce,0x273)][_0x58d59c(0x2ee,0x372)]);}[_0x37f67d(0x1f0,0x200)](){function _0x7ebf29(_0x5b37f3,_0x5d9fb2){return _0xbff2(_0x5d9fb2- -0xbb,_0x5b37f3);}return this[_0x7ebf29(0x57,0x13)];}}class FunctionsClient{constructor(_0x4ae942){this['httpClient']=_0x4ae942;}async['invoke'](_0x1b46f0,_0x30d4f3){function _0x6d4372(_0x153a49,_0x1d87bf){return _0xbff2(_0x153a49- -0x2aa,_0x1d87bf);}try{const _0x10a928=_0x30d4f3?.['method']||'POST',headers={'Content-Type':'application/json',..._0x30d4f3?.[_0x6d4372(-0xf3,-0x161)]};let response;const _0x5574fa='/functions/v1/'+_0x1b46f0;switch(_0x10a928['toUpperCase']()){case'GET':response=await this['httpClient'][_0x6d4372(-0x1e8,-0x1ec)](_0x5574fa,{'headers':headers,'params':_0x30d4f3?.['body']});break;case'POST':response=await this[_0x6d4372(-0x19b,-0x1ef)][_0x6d4372(-0x19f,-0x1db)](_0x5574fa,_0x30d4f3?.['body'],{'headers':headers});break;case'PUT':response=await this['httpClient'][_0x6d4372(-0x1dd,-0x1ed)](_0x5574fa,_0x30d4f3?.['body'],{'headers':headers});break;case'PATCH':response=await this[_0x6d4372(-0x19b,-0x186)]['patch'](_0x5574fa,_0x30d4f3?.[_0x6d4372(-0x119,-0xd4)],{'headers':headers});break;case'DELETE':response=await this[_0x6d4372(-0x19b,-0x1d2)]['delete'](_0x5574fa,{'headers':headers,'data':_0x30d4f3?.[_0x6d4372(-0x119,-0xda)]});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x10a928,0x190);}return{'data':response[_0x6d4372(-0xfb,-0x130)],'error':null};}catch(_0x491275){return{'data':null,'error':_0x491275 instanceof EBaaSError?_0x491275:new EBaaSError(_0x491275 instanceof Error?_0x491275[_0x6d4372(-0x18b,-0x1b7)]:_0x6d4372(-0x12e,-0x136),0x0,_0x491275)};}}async[_0x37f67d(0x15b,0x154)](){function _0xc13b9b(_0x735441,_0x28293d){return _0xbff2(_0x735441-0x26e,_0x28293d);}try{const response=await this['httpClient']['get'](_0xc13b9b(0x35d,0x38c));return{'data':response['data'],'error':null};}catch(_0x4e39c0){return{'data':null,'error':_0x4e39c0 instanceof EBaaSError?_0x4e39c0:new EBaaSError(_0x4e39c0 instanceof Error?_0x4e39c0[_0xc13b9b(0x38d,0x392)]:_0xc13b9b(0x3d0,0x382),0x0,_0x4e39c0)};}}async['get'](_0xcfe3b4){function _0x1f23f9(_0x4ef88c,_0x3188d3){return _0xbff2(_0x3188d3- -0x2af,_0x4ef88c);}try{const response=await this[_0x1f23f9(-0x1d0,-0x1a0)][_0x1f23f9(-0x185,-0x1ed)]('/functions/v1/'+_0xcfe3b4+_0x1f23f9(-0x1c0,-0x18c));return{'data':response[_0x1f23f9(-0xea,-0x100)],'error':null};}catch(_0x1666c9){return{'data':null,'error':_0x1666c9 instanceof EBaaSError?_0x1666c9:new EBaaSError(_0x1666c9 instanceof Error?_0x1666c9[_0x1f23f9(-0x205,-0x190)]:_0x1f23f9(-0x146,-0x122),0x0,_0x1666c9)};}}async[_0x37f67d(0x1eb,0x20b)](_0x3cb300,_0x43992e){function _0x4ee45d(_0x34039b,_0x54627c){return _0xbff2(_0x54627c- -0x2c6,_0x34039b);}try{const _0x161bfa=new FormData();if(_0x43992e['code']instanceof File)_0x161bfa[_0x4ee45d(-0x1b0,-0x1e6)]('code',_0x43992e['code']);else typeof _0x43992e[_0x4ee45d(-0x17e,-0x153)]===_0x4ee45d(-0xe0,-0x12a)&&_0x161bfa[_0x4ee45d(-0x24c,-0x1e6)](_0x4ee45d(-0xd0,-0x153),new Blob([_0x43992e[_0x4ee45d(-0x1b3,-0x153)]],{'type':_0x4ee45d(-0x23c,-0x20b)}),_0x4ee45d(-0x140,-0x1b0));_0x43992e[_0x4ee45d(-0x132,-0x124)]&&_0x161bfa[_0x4ee45d(-0x238,-0x1e6)](_0x4ee45d(-0xf6,-0x124),_0x43992e[_0x4ee45d(-0xe8,-0x124)]);_0x43992e[_0x4ee45d(-0x16e,-0x1dc)]&&_0x161bfa['append'](_0x4ee45d(-0x1e4,-0x1dc),JSON[_0x4ee45d(-0x126,-0x12c)](_0x43992e['env']));_0x43992e[_0x4ee45d(-0x1a5,-0x1e9)]&&_0x161bfa[_0x4ee45d(-0x192,-0x1e6)](_0x4ee45d(-0x23c,-0x1e9),JSON[_0x4ee45d(-0x153,-0x12c)](_0x43992e[_0x4ee45d(-0x262,-0x1e9)]));_0x43992e[_0x4ee45d(-0x17f,-0x125)]!==undefined&&_0x161bfa[_0x4ee45d(-0x215,-0x1e6)](_0x4ee45d(-0xd8,-0x125),String(_0x43992e['verify']));const response=await this[_0x4ee45d(-0x212,-0x1b7)]['post']('/functions/v1/'+_0x3cb300+_0x4ee45d(-0x11d,-0x16b),_0x161bfa,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x4ee45d(-0x14d,-0x117)],'error':null};}catch(_0x36d92d){return{'data':null,'error':_0x36d92d instanceof EBaaSError?_0x36d92d:new EBaaSError(_0x36d92d instanceof Error?_0x36d92d[_0x4ee45d(-0x1c3,-0x1a7)]:_0x4ee45d(-0x1b2,-0x1f0),0x0,_0x36d92d)};}}async[_0x37f67d(0x174,0x1ca)](_0x1edea7){function _0x5ad226(_0x59d7a9,_0x5d2bc8){return _0xbff2(_0x5d2bc8- -0x390,_0x59d7a9);}try{const response=await this['httpClient'][_0x5ad226(-0x211,-0x21e)](_0x5ad226(-0x2b6,-0x232)+_0x1edea7);return{'data':response['data'],'error':null};}catch(_0x196f6b){return{'data':null,'error':_0x196f6b instanceof EBaaSError?_0x196f6b:new EBaaSError(_0x196f6b instanceof Error?_0x196f6b['message']:'Failed\x20to\x20delete\x20function',0x0,_0x196f6b)};}}async[_0x37f67d(0x118,0x10d)](_0x2c8e71,_0x145747){function _0x2106e1(_0x181aee,_0x53d568){return _0xbff2(_0x181aee-0x24a,_0x53d568);}try{const response=await this['httpClient']['put'](_0x2106e1(0x3a8,0x403)+_0x2c8e71+_0x2106e1(0x364,0x35a),{'env':_0x145747});return{'data':response['data'],'error':null};}catch(_0x2924fe){return{'data':null,'error':_0x2924fe instanceof EBaaSError?_0x2924fe:new EBaaSError(_0x2924fe instanceof Error?_0x2924fe[_0x2106e1(0x369,0x3c9)]:_0x2106e1(0x363,0x374),0x0,_0x2924fe)};}}async[_0x37f67d(0x129,0x165)](_0x44a904,_0x293f85){function _0x48d8a3(_0x36c08a,_0x32248b){return _0xbff2(_0x36c08a-0x320,_0x32248b);}try{const _0x4e7474=new URLSearchParams();_0x293f85?.[_0x48d8a3(0x478,0x45b)]&&_0x4e7474['append'](_0x48d8a3(0x478,0x445),String(_0x293f85[_0x48d8a3(0x478,0x49c)]));_0x293f85?.['offset']&&_0x4e7474['append']('offset',String(_0x293f85['offset']));_0x293f85?.['level']&&_0x4e7474[_0x48d8a3(0x400,0x37c)](_0x48d8a3(0x3fa,0x45d),_0x293f85['level']);const _0x4e1be5='/functions/v1/'+_0x44a904+'/logs'+(_0x4e7474[_0x48d8a3(0x4bd,0x4d6)]()?'?'+_0x4e7474['toString']():''),response=await this[_0x48d8a3(0x42f,0x451)][_0x48d8a3(0x3e2,0x3b5)](_0x4e1be5);return{'data':response[_0x48d8a3(0x4cf,0x4ec)],'error':null};}catch(_0x374811){return{'data':null,'error':_0x374811 instanceof EBaaSError?_0x374811:new EBaaSError(_0x374811 instanceof Error?_0x374811['message']:_0x48d8a3(0x447,0x4a9),0x0,_0x374811)};}}async[_0x37f67d(0x172,0x18c)](_0x25d268,_0x5e186a){function _0xdf17f4(_0x1e2f68,_0x59aacd){return _0xbff2(_0x59aacd-0x117,_0x1e2f68);}try{const _0x1a1e1f=new URLSearchParams();_0x5e186a?.['period']&&_0x1a1e1f['append']('period',_0x5e186a['period']);const _0x3bfbce='/functions/v1/'+_0x25d268+_0xdf17f4(0x223,0x29d)+(_0x1a1e1f['toString']()?'?'+_0x1a1e1f[_0xdf17f4(0x264,0x2b4)]():''),response=await this['httpClient']['get'](_0x3bfbce);return{'data':response['data'],'error':null};}catch(_0x2163f0){return{'data':null,'error':_0x2163f0 instanceof EBaaSError?_0x2163f0:new EBaaSError(_0x2163f0 instanceof Error?_0x2163f0[_0xdf17f4(0x1c9,0x236)]:_0xdf17f4(0x27e,0x212),0x0,_0x2163f0)};}}}function _0x16f6(){const _0x255bcf=['zxjYB3i','Dgv4Dc9WBgfPBG','l3jWyY8','y2XVC2vK','C2vZC2LVBG','CMvHBhrPBwu','zxzLBNq','u1vcu0nssujfra','z2v0','y29UDgfPBNm','zwjHyxmUyxv0Ac5ZzxnZAw9U','z2v0sxrLBq','y29SDw1U','Cg9ZDgDYzxnFy2HHBMDLCW','DxbKyxrLrMLSzu1LDgfKyxrH','y29UBMvJDgLVBLn0yxrL','ChvZAa','DxbZzxj0','CMvJB25Uzwn0qxr0zw1WDhm','Chv0','C29JA2v0','D29YA3nWywnLswq','yxv0Aa','C2nOzw1H','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','CMvTB3zLqwXStgLZDgvUzxjZ','rMfPBgvKihrVignYzwf0zsbZAwDUzwqGvvjm','Bwv0ywrHDge','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','AM9PBMvK','zM9YrwfJAa','q0Xpu0ve','Bgv2zwW','z2v0u3rHDhvZ','C29JA2v0lMLVlwnSAwvUDa','Aw1WB3j0twfW','qMvHCMvYia','y29UBMvJDgLUzW','yxbWzw5K','Bw92zq','Cg9YDa','Ag9ZDa','yMfZzvvsta','rMfPBgvKihrVihjLBw92zsbMAwXLCW','DMfSDwu','yxnJzw5KAw5N','AgvHCNrIzwf0','AM9PBMvKt25Jzq','zw52','zgLZy29UBMvJDa','DxjS','Dg9WAwm','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','l2z1BMn0Aw9UCY92mq','zgv0zwn0zwrdB25MAwC','AgfZ','z2v0u2vZC2LVBG','D2fYBG','DxbKyxrLt3b0Aw9UCW','yxbPs2v5','rMfPBgvKihrVignVBM5Ly3qGywz0zxiG','u3rVCMfNzuj1y2TLDa','zMLSzq','y2fJAgvdB250CM9S','qxv0AenSAwvUDa','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbTzxrYAwnZ','BgLZDa','CMvMCMvZAf90B2TLBG','yNjVywrJyxn0','DxbKyxrLqNvJA2v0','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','ChjLC2vUy2u','y3jLyxrLu2LNBMvKvxjS','z2v0uhvIBgLJvxjS','y3jLzgvUDgLHBhm','CMfUzg9T','C3bSAxq','CMvXDwvZDa','C2v0v29YA3nWywnLswq','C2v0DxbizwfYDgjLyxq','BMfTzq','Cg9ZDa','ChjLzML4','z2v0tg9NCW','zxHLy3v0zq','Ahr0CenSAwvUDa','AxnezwXLDgu','zgf0ywjHC2u','BwfRzvjLzG','DgfIBgu','CgfYC2u','yMXVyG','Aw5KzxGUDhm','CMv0DxjUpxjLChjLC2vUDgf0Aw9U','AgfUzgXLrxjYB3i','rMfPBgvKihrVihvWzgf0zsbMDw5JDgLVBIbLBNzPCM9UBwvUDa','l2vUDG','y2XLyxjtzxnZAw9U','DhjHy2S','CMvJB25Uzwn0','C2vSzwn0','BwvZC2fNzq','AgfUzgXLqxv0AevYCM9Y','mtzMqvbVwg4','BgvHDMLUzW','l2LUzM8','u3rVCMfNzunSAwvUDa','CMvMCMvZAfnLC3nPB24','DxbKyxrL','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbSB2DZ','C2v0u2vZC2LVBG','yxHPB3m','l2f1DgGVDJeVCMvZzxqTCgfZC3DVCMq','CMvZzxrqyxnZD29Yza','AM9PBMLUzW','zgv0ywLSCW','z2v0q2HHBM5LBhm','C3rHy2S','C2vHCMnO','ntKXmda2wu1dq1DY','yNjVywrJyxn0oG','C2v0u2vZC2LVBKLUDgvYBMfS','z2v0twv0CMLJCW','CNbJ','Cg9ZDgDYzxneyxrHyMfZzq','BgvUz3rO','Cg9ZDgDYzxnFy2HHBMDLCZO','y2XLyxi','uhjLzMvY','lMrLC2m','Dw5ZDwjZy3jPyMu','z2v0v29YA3nWywnLswq','C3rHDgu','y2fWDhvYzvn0ywnRvhjHy2u','l2zPBgvZl2nVChK','Cg9ZDgDYzxnqB3j0','rMfPBgvKihrVihvWBg9HzcbMAwXL','DgLTzw91Da','Cgf0y2G','ChjLzMvY','ChjLC2vUy2u6','C2LUz2XL','BgLZDej1y2TLDhm','Dw50CMfJAW','rNvUy3rPB25Zq2XPzw50','y29TBw9U','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','B2zM','y29WEq','zNjVBq','z2v0qNvJA2v0','zxjYB3jLza','zgv0zwn0q3vZDg9Trgf0ywjHC2u','x3nLDfn0yxrL','zNvUy3rPB25Z','rujHyvndBgLLBNq','l3nKAY92ms8','C3vIC2nYAxb0Aw9UCW','BgLTAxq','B3jKzxi','DhjHBNnMB3jT','l2rLCgXVEq','B2zMC2v0','Bg9N','l2z1BMn0Aw9UCY92ms8','zxHLy3v0zvf1zxj5','CMvTB3zLqxv0AfrVA2vU','y29UBMvJDf9LCNjVCG','rMfPBgvKihrVigXPC3qGzNvUy3rPB25Z','C2LNBKLU','C3rHDhvZ','DxbKyxrLrgf0yq','Dw5KzwzPBMvK','D2vIC29JA2v0','l3n0B3jHz2uVyNvJA2v0CY8','l2f1DgGVDJeVDxnLCG','mtm5mZm2mMvHEwLLtW','AxnvC2LUz0n1C3rVBurHDgfIyxnL','B25qCMvZzw5Jzq','CxvLCNK','zgvSzxrLt3b0Aw9UCW','shr0CenSAwvUDa','l2zPBgvZ','x3jLAM9PBG','zgvSzxrL','y29Kzq','B3b0Aw9UCW','y2XPzw50','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','ChvIBgLJ','B3bLCMf0Aw9U','zMLSDgvYCW','vw5RBM93BIbLCNjVCG','CMfUz2u','rNvUy3rPB24GAw52B2nHDgLVBIbMywLSzwq','B25cCM9HzgnHC3q','C2v0qxv0AfrVA2vU','y2HHBM5LBa','zg93BMXVywq','y2HHBM5LBhm','zw50CMLLCW','Ec10B3rHBc1JB3vUDa','y3jLyxrL','mtKYntmZntjxy0r3qwC','l21LDhjPy3m','mtGWug1gyvvp','y29UzMLN','C2v0','Aw52B2TL','Dg9ku09o','y3vYCMvUDfnJAgvTyq','rMfPBgvKihrVigDLDcbMDw5JDgLVBG','C2v0DxbjBNrLCMnLChrVCNm','CMvQzwn0','zgvSzxrLqNvJA2v0','yM9KEq','x3rYAwDNzxi','l2zPBgvZl21VDMu','AgvHCNrIzwf0sw50zxj2ywW','B3bLCMf0B3i','nJG3mJy2B2T0r1Do','zw1PDa','x2PVAw4','l2zPBgvZlW','C3rYAw5NAwz5','zgLZy29UBMvJDgvK','C3rYAw5N','Dg9tDhjPBMC','DxnL','Aw5PDgLHBgL6zq','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','DMvYAwz5','zw50CNLWB2LUDa','C2v0sxrLBq','z3rL','rujHyvnfCNjVCG','DxnLCG','lMfZyW','x2DLDfnVy2TLDa','BhrL','DgvZDenVBM5Ly3rPB24','AM9PBG','y29UDgvUDfr5Cgu','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','icHtDgf0Dxm6ia','zgf0yq','yNvJA2v0swq','BgLRzq','mJe5ota0me1Lr2viqq','zgvWBg95','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','ywnJzxnZx3rVA2vU','y3vYCMvUDfnLC3nPB24','AgvHzgvYCW','mteYmZy3ntb3uvj3CLy','C3rHDhvZvgv4Da','CMvZCg9UC2u','p29WzxjHDgLVBJ11ChnLCNq','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','DxbKyxrLrw52','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','y29UBMvJDgvK','Cg9ZDgDYzxnvC2vYBMfTzq','zgf0yufYCMf5'];_0x16f6=function(){return _0x255bcf;};return _0x16f6();}class EBaaSClient{constructor(_0x3748a9,_0xe1f4ba,_0x33b525){function _0x10081a(_0x2890f9,_0x4ec617){return _0xbff2(_0x2890f9- -0x26b,_0x4ec617);}this['options']=_0x33b525,this['httpClient']=new HttpClient({'url':_0x3748a9,'apiKey':_0xe1f4ba,'timeout':0x7530,'headers':_0x33b525?.['global']?.[_0x10081a(-0xb4,-0xc3)]}),this[_0x10081a(-0x19b,-0x11d)]=new AuthClient(this['httpClient']),this['database']=new DatabaseClient(this[_0x10081a(-0x15c,-0x111)],_0x33b525?.[_0x10081a(-0x15a,-0x125)]?.['workspaceId']),this['storage']=new StorageClient(this[_0x10081a(-0x15c,-0x1b4)]),this[_0x10081a(-0x1ac,-0x161)]=new RealtimeClient(_0x3748a9,_0xe1f4ba,_0x33b525?.['realtime']),this['functions']=new FunctionsClient(this['httpClient']),this['initializeCustomDatabase']();}[_0x37f67d(0x143,0x1a7)](_0x53fc56){return this['database']['from'](_0x53fc56);}['rpc'](_0x595144,_0x1fc2aa){function _0x5aa518(_0x31d63c,_0x77c019){return _0xbff2(_0x77c019- -0x26b,_0x31d63c);}return this[_0x5aa518(-0x121,-0x15a)][_0x5aa518(-0x17d,-0x136)](_0x595144,_0x1fc2aa);}['bucket'](_0xad140){return this['storage']['from'](_0xad140);}['channel'](_0x2fdc69){return this['realtime']['channel'](_0x2fdc69);}['invoke'](_0x5581a9,_0x1d4ff7){function _0xb4312c(_0xdbbe1c,_0x4c591b){return _0xbff2(_0xdbbe1c- -0x293,_0x4c591b);}return this[_0xb4312c(-0x13f,-0x1b1)][_0xb4312c(-0x109,-0x96)](_0x5581a9,_0x1d4ff7);}async[_0x37f67d(0x191,0x1ce)](){function _0x5dc8a7(_0x3a9798,_0x4ee669){return _0xbff2(_0x4ee669- -0x36e,_0x3a9798);}if(this['options']?.['database']?.['autoDetectCustomDatabase'])try{await this['database']['initialize']();}catch(_0x4e92e1){console[_0x5dc8a7(-0x2ba,-0x27b)]('Failed to initialize custom database detection:',_0x4e92e1);}}async[_0x37f67d(0x167,0x160)](_0x1e2c89){this['database']['setWorkspaceId'](_0x1e2c89);function _0x289cc0(_0x57561f,_0x471cc9){return _0xbff2(_0x57561f- -0x107,_0x471cc9);}this['options']?.[_0x289cc0(0xa,-0x31)]?.['autoDetectCustomDatabase']&&await this['database']['initialize']();}async['configureCustomDatabase'](_0x3fc495){function _0x51e9bf(_0x282b9f,_0xc99d00){return _0xbff2(_0x282b9f-0x2cc,_0xc99d00);}await this[_0x51e9bf(0x3dd,0x375)][_0x51e9bf(0x479,0x4be)](_0x3fc495);}['getCustomDatabaseStatus'](){return this['database']['getCustomDatabaseStatus']();}}function createClient(_0x1521b9,_0x1e5416,_0x2845b5){return new EBaaSClient(_0x1521b9,_0x1e5416,_0x2845b5);}const version='1.0.0';exports[_0x37f67d(0xd6,0x152)]=AuthClient,exports['CustomDatabaseManager']=CustomDatabaseManager,exports['DatabaseClient']=DatabaseClient,exports[_0x37f67d(0x198,0x1ad)]=EBaaSClient,exports[_0x37f67d(0x256,0x1fd)]=EBaaSError,exports[_0x37f67d(0x1e2,0x1a2)]=FunctionsClient,exports[_0x37f67d(0x23b,0x1c7)]=HttpClient,exports['QueryBuilder']=QueryBuilder,exports['RealtimeChannel']=RealtimeChannel,exports['RealtimeClient']=RealtimeClient,exports[_0x37f67d(0x19a,0x14f)]=StorageBucket,exports[_0x37f67d(0x10c,0x17c)]=StorageClient,exports['createClient']=createClient,exports['version']=version;
1
+ 'use strict';function _0x1cdf(){const _0x1bb639=['BgvHDMu','CMvJB25Uzwn0','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','z2v0twv0CMLJCW','y2XVC2vK','C2vSzwn0','zgLZy29UBMvJDa','y29UDgvUDfr5Cgu','Dw5KzwzPBMvK','C2v0sxrLBq','y29UDgfPBNm','B3b0Aw9UCW','DxnLCG','z2v0u3rHDgu','z3rL','zMLSDgvYCW','C3rHDhvZ','AgfZq3vZDg9Trgf0ywjHC2u','zgvMyxvSDhm','y2fJAgvdB250CM9S','ntaYodm5mgrYA0ztwa','CMvTB3zLqwXSq2HHBM5LBhm','DxbKyxrLrgf0yq','DgvZDen1C3rVBunVBM5Ly3rPB24','p3vWC2vYDd10CNvL','BwvZC2fNzq','p29WzxjHDgLVBJ11ChnLCNq','yNjVywrJyxn0','zwjHyxmUyxv0Ac5ZzxnZAw9U','zgf0ywjHC2u','y29UBMvJDf9LCNjVCG','y2fWDhvYzvn0ywnRvhjHy2u','y29Kzq','l3n0B3jHz2uVyNvJA2v0CY8','ms4WlJa','CMvTB3zL','CNbJ','Aw50zxjJzxb0B3jZ','mtrTtur2ENu','C2v0u2vZC2LVBKLUDgvYBMfS','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','zw50CNLWB2LUDa','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','lMfZyW','CMfUzg9T','CMvJB25Uzwn0qxr0zw1WDhm','ChjLC2vUy2u6','DxnL','Cg9ZDgDYzxnFy2HHBMDLCW','rMfPBgvKihrVig1VDMuGzMLSzq','BgvHDMLUzW','C2vUza','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbSB2DZ','C3vIC2nYAxb0Aw9UCW','C2nOzw1H','y29UBMvJDa','B3bLCMf0Aw9U','CgfYC2u','CMvWBgfJzq','DxjS','Aw5KzxGUDhm','C2vHCMnO','Cg9ZDgDYzxnty2HLBwe','ChjLC2vUy2u','l2f1DgGVDJeVC2LNBNvW','y2HHBM5LBa','Cg9ZDgDYzxnvC2vYBMfTzq','vw5RBM93BIbLCNjVCG','C2v0qxv0AfrVA2vU','y3jLzgvUDgLHBhm','z2v0qNvJA2v0','lMrLC2m','BwfRzvjLzG','zgf0yq','AgfUzgXLrxjYB3i','AM9PBMvKt25Jzq','yNjVywrJyxn0oG','zw50CMLLCW','l3n0B3jHz2uVyNvJA2v0CW','yxv0Aa','yM9KEq','l2zPBgvZlW','z2v0vxnHz2u','BgLTAxq','C2vZC2LVBG','zxHLy3v0zvf1zxj5','l2zPBgvZl2nVChK','Dw50CMfJAW','BgLZDej1y2TLDhm','D2fYBG','AM9PBG','yNvJA2v0swq','B3bLCMf0B3i','rNvUy3rPB25Zq2XPzw50','DxbSB2fK','DhjHBNnMB3jT','AgfUzgXLqxv0AevYCM9Y','CMvJB25Uzwn0sw50zxj2ywW','Ahr0CenSAwvUDa','C2v0v29YA3nWywnLswq','CMvMCMvZAfnLC3nPB24','mtj0rw5hvMu','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','y3vYCMvUDfnJAgvTyq','D2vIC29JA2v0','y29SDw1U','y29UBMvJDgLUzW','yxbPs2v5','zgvSzxrLt3b0Aw9UCW','mtH6A1fhtK8','C2v0DxbjBNrLCMnLChrVCNm','B2zM','x3jLAM9PBG','zMLSDgvY','C29JA2v0','Aw1WB3j0twfW','C2v0DxbizwfYDgjLyxq','icHtDgf0Dxm6ia','Bwv0Ag9K','qxv0AenSAwvUDa','q0HbtK5ftf9fuLjpuG','BMvX','p29WzxjHDgLVBJ1KzwXLDgu','rgf0ywjHC2vdBgLLBNq','CMvZzxrqyxnZD29Yza','uMvHBhrPBwvdBgLLBNq','z2v0','y2HHBM5LBhm','C2v0','z2v0q2HHBM5LBhm','y2XLyxi','yxbWzw5K','y29UzMLN','mtmWmZm4nLffweHitq','Cgf0y2G','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','rMfPBgvKihrVigDLDcbZDg9YywDLihvZywDL','B3jKzxi','Dg9WAwm','Bwv0ywrHDge','rMfPBgvKihrVigDLDcbMDw5JDgLVBG','l2LUzM8','D29YA3nWywnLswq','z2v0vxnLCG','Cg9ZDgDYzxnFy2HHBMDLCZO','Dgv4Dc9WBgfPBG','y3jLyxrLq2XPzw50','Cg9ZDgDYzxnqB3j0','BgvUz3rO','B2zMC2v0','CMfUz2u','y3jLyxrLu2LNBMvKvxjS','C3nSrw5HyMXLza','ywnJzxnZx3rVA2vU','zxjYB3jLza','zgv0zwn0zwrdB25MAwC','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','ChvIBgLJ','mty5ode2mfPWrKfeBW','y2XLyxjtzxnZAw9U','AxnezwXLDgu','CMvQzwn0','l2rLCgXVEq','zxzLBNq','CMv0DxjUpxjLChjLC2vUDgf0Aw9U','ChvZAa','DMfSDwu','sfruucbYzxf1zxn0igzHAwXLza','y29UBMvJDgvK','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','CMvHBhrPBwu','yxnJzw5KAw5N','rMfPBgvKihrVigXPC3qGzMLSzxm','zMLSzq','zgvSzxrLqNvJA2v0','zw52','yNvJA2v0','DxbKyxrL','uhjLzMvY','rMfPBgvKihrVignVChKGzMLSzq','p29WzxjHDgLVBJ1PBNnLCNq','Cg9ZDgDYzxniB3n0','CMvZCg9UC2u','C3rHDgu','x3rYAwDNzxi','l2zPBgvZ','DxbZzxj0','Bw92zq','y3vYCMvUDfnLC3nPB24','rMfPBgvKihrVigrLBgv0zsbMDw5JDgLVBG','AM9PBMvK','Cgf0Aa','AM9PBMLUzW','l3nKAY92ms8','DgLTzw91Da','CgvYAw9K','zM9YrwfJAa','l3jWyY8','uMvXDwvZDcbMywLSzwq','l2z1BMn0Aw9UCY92ms8','CMvTB3zLq3vZDg9Trgf0ywjHC2u','AgvHCNrIzwf0sw50zxj2ywW','Dg9tDhjPBMC','C3rHDhvZvgv4Da','y29UBMvJDgLVBLn0yxrL','z2v0tg9NCW','zgLZy29UBMvJDgvK','zgvSzxrL','zxHLy3v0zq','Dg9vChbLCKnHC2u','BgLRzq','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','DgfIBgu','Chv0','DhjHy2S','B25qCMvZzw5Jzq','l2f1DgGVDJeVDxnLCG','BxvSDgLWyxj0l2zVCM0Tzgf0yq','DgvZDenVBM5Ly3rPB24','Aw5PDgLHBgL6zq','mZi2mJmWwxrdvgXK','Cg9ZDa','BMfTzq','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','ChjLzMvY','C29JA2v0lMLVlwnSAwvUDa','uxvLCNLcDwLSzgvY','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbTzxrYAwnZ','AxndB25Uzwn0zwq','ndK2ntyXtNHcq3jP','x3nLDfn0yxrL','DMvYAwz5','C29YDej5','CxvLCNK','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','rujHyvnfCNjVCG','yMfZzvvsta','zgvWBg95','AxnvC2LUz0n1C3rVBurHDgfIyxnL','y3jLyxrLqNvJA2v0','Bg9N','rMfPBgvKihrVigDLDcbIDwnRzxq','mtm5nZaXuKTlC0rQ','BgLZDa','C3rYAw5NAwz5','zxjYB3i','DMvYC2LVBG','zxzLBNrLBwL0DgvYmW','x2PVAw4','DxbKyxrLt3b0Aw9UCW','AgvHzgvYCW','AgfZ','y2XPzw50','Ec10B3rHBc1JB3vUDa','nJCXmdeWs0HODKrv','zgv0zwn0q3vZDg9Trgf0ywjHC2u','qxv0AgvUDgLJyxrPB24GzMfPBgvK','C2LNBK91Da','Ag9ZDa','Bgv2zwW','Dw5ZDwjZy3jPyMu','zNjVBq','y29TBw9U','qMvHCMvYia','rujHyvndBgLLBNq','zw1PDa','l2f1DgGVDJeVCMvZzxqTCgfZC3DVCMq'];_0x1cdf=function(){return _0x1bb639;};return _0x1cdf();}(function(stringArrayFunction,comparisonValue){const stringArray=stringArrayFunction();function _0x4f66ae(_0x256fd2,_0x48318e){return _0x1e74(_0x256fd2- -0x26a,_0x48318e);}while(!![]){try{const _0x13d1e8=-parseInt(_0x4f66ae(-0x56,-0x3a))/0x1+-parseInt(_0x4f66ae(-0x5f,-0x41))/0x2+-parseInt(_0x4f66ae(-0x49,0x7))/0x3*(-parseInt(_0x4f66ae(0x36,0xaf))/0x4)+parseInt(_0x4f66ae(-0x1c,-0x11))/0x5+parseInt(_0x4f66ae(0x56,-0x1f))/0x6*(parseInt(_0x4f66ae(-0xa,-0x1d))/0x7)+-parseInt(_0x4f66ae(0x70,0x63))/0x8+parseInt(_0x4f66ae(0x3e,0x74))/0x9*(-parseInt(_0x4f66ae(-0x3d,-0x9a))/0xa);if(_0x13d1e8===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x9266a2){stringArray['push'](stringArray['shift']());}}}(_0x1cdf,0x8c0fd));var axios=require('axios'),socket_ioClient=require(_0x380dd0(-0xae,-0x8d)),EventEmitter=require(_0x380dd0(-0x98,-0x92));class EBaaSError extends Error{constructor(_0x2654f9,status=0x0,_0x50eccd){super(_0x2654f9),this[_0x118d84(0x324,0x318)]='EBaaSError',this['status']=status;function _0x118d84(_0x4a8c72,_0x4ca605){return _0x1e74(_0x4ca605-0x10b,_0x4a8c72);}this['details']=_0x50eccd,Error[_0x118d84(0x393,0x364)]&&Error['captureStackTrace'](this,EBaaSError);}['toJSON'](){function _0x1dfb17(_0x32cc28,_0x4775a2){return _0x1e74(_0x4775a2- -0x1c5,_0x32cc28);}return{'name':this['name'],'message':this[_0x1dfb17(0xb0,0x8e)],'status':this['status'],'details':this['details'],'stack':this['stack']};}[_0x380dd0(-0xc5,-0xf1)](){function _0x48c619(_0x38e0cd,_0x37b0e1){return _0x1e74(_0x38e0cd-0x268,_0x37b0e1);}return this[_0x48c619(0x475,0x4c0)]+':\x20'+this['message']+_0x48c619(0x518,0x4bb)+this[_0x48c619(0x4b2,0x4a3)]+')';}}class HttpClient{constructor(config){this[_0x39fb10(0x418,0x3e5)]=config[_0x39fb10(0x473,0x494)],this[_0x39fb10(0x4a3,0x4a8)]=config['apiKey'];function _0x39fb10(_0x216756,_0x25afa8){return _0x1e74(_0x216756-0x1fd,_0x25afa8);}this[_0x39fb10(0x428,0x3e9)]=axios['create']({'baseURL':this['baseURL'],'timeout':config[_0x39fb10(0x3ee,0x3b8)]||0x2710,'headers':{'Content-Type':'application/json','apikey':this[_0x39fb10(0x4a3,0x43e)],...config[_0x39fb10(0x426,0x405)]}}),this[_0x39fb10(0x4a6,0x461)]();}[_0x380dd0(-0x15,0x69)](){this['client']['interceptors']['request'][_0x98f2bb(0x568,0x5ee)](config=>{return config;},_0x4b2024=>{function _0x5f0ba0(_0x2c32ec,_0x482e81){return _0x1e74(_0x2c32ec- -0x10a,_0x482e81);}return Promise['reject'](new EBaaSError(_0x5f0ba0(0xeb,0x155),0x0,_0x4b2024));});function _0x98f2bb(_0x3ee6d5,_0x26fed2){return _0x1e74(_0x3ee6d5-0x2ff,_0x26fed2);}this[_0x98f2bb(0x52a,0x4d7)][_0x98f2bb(0x55e,0x577)][_0x98f2bb(0x4e4,0x515)]['use'](response=>{return response;},_0x11a356=>{const status=_0x11a356[_0x4c438a(0x327,0x39b)]?.['status']||0x0;function _0x4c438a(_0x1a1cc8,_0x2c169b){return _0x1e74(_0x1a1cc8-0x142,_0x2c169b);}const _0xca3659=_0x11a356[_0x4c438a(0x327,0x38b)]?.['data']?.['message']||_0x11a356[_0x4c438a(0x395,0x3b8)]||_0x4c438a(0x3c0,0x3a8),_0x1fa99a=_0x11a356['response']?.['data']||_0x11a356;return Promise[_0x4c438a(0x41f,0x3a4)](new EBaaSError(_0xca3659,status,_0x1fa99a));});}async['get'](_0xc51147,config){function _0x5e07fa(_0x569e32,_0x3fa582){return _0x1e74(_0x3fa582-0x3e5,_0x569e32);}try{const response=await this[_0x5e07fa(0x681,0x610)][_0x5e07fa(0x6c5,0x69e)](_0xc51147,config);return{'data':response[_0x5e07fa(0x667,0x669)],'status':response[_0x5e07fa(0x61e,0x62f)],'statusText':response[_0x5e07fa(0x605,0x5df)],'headers':response['headers']};}catch(_0x401c05){throw this[_0x5e07fa(0x656,0x66a)](_0x401c05);}}async[_0x380dd0(-0xb2,-0x2d)](_0x97c3ba,data,config){function _0x30b989(_0x33e5cf,_0x45a35e){return _0x1e74(_0x45a35e-0x8f,_0x33e5cf);}try{const response=await this[_0x30b989(0x2db,0x2ba)]['post'](_0x97c3ba,data,config);return{'data':response[_0x30b989(0x32a,0x313)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x470896){throw this['handleError'](_0x470896);}}async['put'](_0x4ea524,data,config){function _0x37c625(_0x359196,_0x2bd2e3){return _0x1e74(_0x359196- -0x6f,_0x2bd2e3);}try{const response=await this[_0x37c625(0x1bc,0x1d7)]['put'](_0x4ea524,data,config);return{'data':response['data'],'status':response[_0x37c625(0x1db,0x172)],'statusText':response['statusText'],'headers':response[_0x37c625(0x1ba,0x180)]};}catch(_0x5b07c0){throw this['handleError'](_0x5b07c0);}}async['patch'](_0x420656,data,config){function _0x43c2cd(_0x31396a,_0x5afc88){return _0x1e74(_0x31396a-0x379,_0x5afc88);}try{const response=await this[_0x43c2cd(0x5a4,0x58f)]['patch'](_0x420656,data,config);return{'data':response['data'],'status':response[_0x43c2cd(0x5c3,0x552)],'statusText':response[_0x43c2cd(0x573,0x510)],'headers':response[_0x43c2cd(0x5a2,0x56b)]};}catch(_0x328d8e){throw this['handleError'](_0x328d8e);}}async[_0x380dd0(-0xc0,-0x147)](_0x5babd8,config){function _0x3bf06c(_0x1738c2,_0x3c741a){return _0x1e74(_0x1738c2-0x2e7,_0x3c741a);}try{const response=await this[_0x3bf06c(0x512,0x57f)]['delete'](_0x5babd8,config);return{'data':response['data'],'status':response[_0x3bf06c(0x531,0x589)],'statusText':response['statusText'],'headers':response[_0x3bf06c(0x510,0x549)]};}catch(_0x4de257){throw this['handleError'](_0x4de257);}}[_0x380dd0(-0x3f,0x38)](_0x2a17b4){function _0x133313(_0x3d92ca,_0x4262d8){return _0x1e74(_0x4262d8- -0x127,_0x3d92ca);}this['client'][_0x133313(0xc8,0x125)]['headers']['common']['Authorization']='Bearer\x20'+_0x2a17b4;}['removeAuthToken'](){function _0x55bdb8(_0xb7a370,_0xc92f29){return _0x1e74(_0xb7a370-0x233,_0xc92f29);}delete this['client'][_0x55bdb8(0x47f,0x451)]['headers'][_0x55bdb8(0x468,0x48d)]['Authorization'],this[_0x55bdb8(0x45e,0x481)][_0x55bdb8(0x47f,0x452)][_0x55bdb8(0x45c,0x462)]['common']['Authorization']=_0x55bdb8(0x469,0x458)+this[_0x55bdb8(0x4d9,0x515)];}['handleError'](_0x38f411){if(_0x38f411 instanceof EBaaSError)return _0x38f411;function _0x5e34e0(_0x7a1b29,_0xc014cb){return _0x1e74(_0x7a1b29- -0x345,_0xc014cb);}return new EBaaSError(_0x38f411['message']||_0x5e34e0(-0x62,-0x18),_0x38f411['status']||0x0,_0x38f411);}}class AuthClient{constructor(_0x2f1247,_0x1edd15){function _0x2ed0f0(_0x1b3aba,_0xb2513a){return _0x1e74(_0x1b3aba-0xdf,_0xb2513a);}this['currentSession']=null,this['httpClient']=_0x2f1247,this[_0x2ed0f0(0x3a9,0x37a)]=_0x1edd15,this['loadSession']();}async['signUp'](data){function _0x408713(_0x1ad798,_0x108ba1){return _0x1e74(_0x1ad798-0x1ef,_0x108ba1);}try{const response=await this[_0x408713(0x48c,0x40b)]['post'](_0x408713(0x46a,0x430),data);return response['data'][_0x408713(0x47e,0x46c)]&&this['setSessionInternal'](response[_0x408713(0x473,0x4e9)]['session']),response['data'];}catch(_0xc93c76){throw this['handleAuthError'](_0xc93c76);}}async['signIn'](data){function _0x5c9c62(_0x30297a,_0x15318){return _0x1e74(_0x15318-0x20b,_0x30297a);}try{const headers={};this['workspaceId']&&(headers['X-Workspace-ID']=this[_0x5c9c62(0x4c7,0x4d5)]);const response=await this[_0x5c9c62(0x516,0x4a8)][_0x5c9c62(0x400,0x417)]('/auth/v1/sdk/signin',data,{'headers':headers});return response[_0x5c9c62(0x4fd,0x48f)][_0x5c9c62(0x4f4,0x49a)]&&this['setSessionInternal'](response[_0x5c9c62(0x4cb,0x48f)][_0x5c9c62(0x508,0x49a)]),response['data'];}catch(_0x276771){throw this[_0x5c9c62(0x442,0x4a6)](_0x276771);}}async[_0x380dd0(-0x8e,-0x102)](){function _0x203d38(_0x47cef5,_0x4df059){return _0x1e74(_0x47cef5-0x2ba,_0x4df059);}try{await this['httpClient']['post']('/auth/v1/signout'),this[_0x203d38(0x595,0x55d)]();}catch(_0x199ca4){this[_0x203d38(0x595,0x5c3)]();throw this['handleAuthError'](_0x199ca4);}}async[_0x380dd0(0xd,-0x4f)](){function _0x563615(_0x47c697,_0x450224){return _0x1e74(_0x450224-0x121,_0x47c697);}if(!this['currentSession']?.['access_token'])return null;try{const response=await this['httpClient']['get'](_0x563615(0x335,0x328));return response['data'][_0x563615(0x2ff,0x367)];}catch(_0x3b8950){if(_0x3b8950 instanceof EBaaSError&&_0x3b8950['status']===0x191)return this['clearSession'](),null;throw this['handleAuthError'](_0x3b8950);}}async[_0x380dd0(-0x1f,-0x70)](){if(!this['currentSession']?.['refresh_token'])return null;function _0x2f4c4a(_0x28fbc9,_0x3e680a){return _0x1e74(_0x3e680a- -0x12b,_0x28fbc9);}try{const response=await this['httpClient']['post']('/auth/v1/refresh',{'refresh_token':this['currentSession']['refresh_token']});if(response[_0x2f4c4a(0x169,0x159)][_0x2f4c4a(0x161,0x164)])return this['setSession'](response[_0x2f4c4a(0x124,0x159)]['session']),response['data']['session'];return null;}catch(_0x128b30){this[_0x2f4c4a(0x1cf,0x1b0)]();throw this[_0x2f4c4a(0x192,0x170)](_0x128b30);}}async[_0x380dd0(-0x7,0x5)](_0x3967c2){function _0x4fffc0(_0x4ffdf9,_0xa51097){return _0x1e74(_0xa51097- -0x249,_0x4ffdf9);}try{await this[_0x4fffc0(0x9e,0x54)][_0x4fffc0(-0x4,-0x3d)](_0x4fffc0(0x25,-0x10),{'email':_0x3967c2});}catch(_0x4e67b7){throw this[_0x4fffc0(0xb0,0x52)](_0x4e67b7);}}async['updateUser'](data){function _0x4cbdd2(_0x2ed304,_0x243248){return _0x1e74(_0x2ed304-0x1fa,_0x243248);}try{const response=await this['httpClient'][_0x4cbdd2(0x3fe,0x468)]('/auth/v1/user',data);return response['data'][_0x4cbdd2(0x440,0x454)];}catch(_0x349ac9){throw this['handleAuthError'](_0x349ac9);}}['getSession'](){function _0x57573d(_0x57ed9d,_0x3be994){return _0x1e74(_0x57ed9d- -0xa1,_0x3be994);}return this[_0x57573d(0x14a,0x1c0)];}['setSession'](_0x4691ed){this['currentSession']=_0x4691ed,this['httpClient']['setAuthToken'](_0x4691ed[_0x4f703b(0x595,0x546)]);function _0x4f703b(_0x18a235,_0xc0f8ca){return _0x1e74(_0xc0f8ca-0x271,_0x18a235);}typeof localStorage!=='undefined'&&localStorage[_0x4f703b(0x485,0x4b4)](_0x4f703b(0x476,0x4c7),JSON[_0x4f703b(0x50c,0x494)](_0x4691ed));}['onAuthStateChange'](_0x171069){return()=>{};}['setWorkspaceId'](_0x30a24a){this['workspaceId']=_0x30a24a;}[_0x380dd0(-0x5d,-0xd4)](_0x599414){this[_0xeb45f5(0x357,0x2df)]=_0x599414,this[_0xeb45f5(0x409,0x465)]['setAuthToken'](_0x599414[_0xeb45f5(0x441,0x4ba)]);function _0xeb45f5(_0x3b973b,_0x45445b){return _0x1e74(_0x3b973b-0x16c,_0x45445b);}typeof localStorage!=='undefined'&&localStorage['setItem']('ebaas.auth.session',JSON[_0xeb45f5(0x38f,0x3cd)](_0x599414));}['clearSession'](){this['currentSession']=null;function _0x528c0e(_0x5c3082,_0x1be6ba){return _0x1e74(_0x1be6ba- -0x17,_0x5c3082);}this[_0x528c0e(0x21e,0x286)]['removeAuthToken'](),typeof localStorage!==_0x528c0e(0x211,0x22b)&&localStorage['removeItem'](_0x528c0e(0x25c,0x23f));}['loadSession'](){function _0x3854e0(_0x1d5c22,_0x1e6770){return _0x1e74(_0x1d5c22- -0x2ef,_0x1e6770);}if(typeof localStorage!==_0x3854e0(-0xad,-0xf0)){const _0x997318=localStorage['getItem'](_0x3854e0(-0x99,-0xd7));if(_0x997318)try{const _0x46bc4b=JSON['parse'](_0x997318);this['setSessionInternal'](_0x46bc4b);}catch(_0x4d73be){this[_0x3854e0(-0x14,-0x3e)]();}}}['handleAuthError'](_0xce5895){function _0x57e02e(_0x29058b,_0x1e0eae){return _0x1e74(_0x29058b- -0x249,_0x1e0eae);}if(_0xce5895 instanceof EBaaSError)return _0xce5895;return new EBaaSError(_0xce5895[_0x57e02e(0xa,0x4f)]||_0x57e02e(-0x1a,0x31),_0xce5895['status']||0x0,_0xce5895);}}class QueryBuilder{constructor(_0x379803,_0x3794dc,_0x5412a9,_0x2e4023){this[_0x20fbfb(0x3e0,0x411)]=_0x379803,this['table']=_0x3794dc,this['schema']=_0x5412a9;function _0x20fbfb(_0x178790,_0x5478b2){return _0x1e74(_0x178790-0x143,_0x5478b2);}this[_0x20fbfb(0x40d,0x3fd)]=_0x2e4023,this['query']={'filters':[]};}[_0x380dd0(-0x7f,-0x19)](_0x5f09e6='*',_0x144ea2){this[_0x255bd1(0xe3,0x5c)]['select']=_0x5f09e6;function _0x255bd1(_0x5c6675,_0x330d7c){return _0x1e74(_0x5c6675- -0x135,_0x330d7c);}return this;}['insert'](data,_0x46baa2){function _0x4cecd7(_0x46699e,_0x4c717b){return _0x1e74(_0x46699e- -0x12d,_0x4c717b);}return this[_0x4cecd7(0x163,0x1e5)]('POST',_0x4cecd7(0xc3,0x138)+this['table']+_0x4cecd7(0xb6,0x70),{'data':data,'options':_0x46baa2});}[_0x380dd0(-0xde,-0x6f)](data,_0x1cd1d1){this['query']['updateData']=data,this[_0x2c3245(0x3a2,0x363)][_0x2c3245(0x3c2,0x373)]=_0x1cd1d1;function _0x2c3245(_0x5b40d3,_0x8fa0ec){return _0x1e74(_0x8fa0ec-0x14b,_0x5b40d3);}return this;}[_0x380dd0(-0xd5,-0x80)](data,_0x98894b){function _0x21cf30(_0x483b93,_0x1cf16e){return _0x1e74(_0x1cf16e-0xf,_0x483b93);}return this[_0x21cf30(0x30d,0x29f)]('POST','/sdk/v1/'+this[_0x21cf30(0x23f,0x212)]+_0x21cf30(0x25e,0x263),{'data':data,'options':{..._0x98894b,'upsert':!![]}});}[_0x380dd0(-0xc0,-0x98)](_0x35ddef){this[_0x2cc66d(-0x57,-0x99)][_0x2cc66d(0x38,0x69)]=_0x35ddef,this['query'][_0x2cc66d(0x6d,0xde)]=!![];function _0x2cc66d(_0x102d23,_0x5969fb){return _0x1e74(_0x102d23- -0x26f,_0x5969fb);}return this;}['eq'](_0x3a1fce,_0x9295a7){function _0x32b9be(_0x3b5f53,_0x55d887){return _0x1e74(_0x3b5f53- -0xa2,_0x55d887);}return this['query'][_0x32b9be(0x1a7,0x1fc)]['push']({'column':_0x3a1fce,'operator':'eq','value':_0x9295a7}),this;}[_0x380dd0(-0xa,-0x69)](_0x4b0c3a,_0x4caf6c){function _0x3c6738(_0x43a98e,_0xd6ebaf){return _0x1e74(_0x43a98e- -0x367,_0xd6ebaf);}return this['query'][_0x3c6738(-0x11e,-0x136)][_0x3c6738(-0x86,-0x51)]({'column':_0x4b0c3a,'operator':_0x3c6738(-0xb3,-0x66),'value':_0x4caf6c}),this;}['gt'](_0x3b6af3,_0xf26bf8){this[_0x402258(0x3a1,0x421)]['filters']['push']({'column':_0x3b6af3,'operator':'gt','value':_0xf26bf8});function _0x402258(_0x472f90,_0x445069){return _0x1e74(_0x472f90-0x189,_0x445069);}return this;}['gte'](_0x3f2026,_0x4a5d2e){function _0x3e9d60(_0x354a67,_0x369593){return _0x1e74(_0x369593-0x2fe,_0x354a67);}return this[_0x3e9d60(0x4cc,0x516)]['filters'][_0x3e9d60(0x58e,0x5df)]({'column':_0x3f2026,'operator':_0x3e9d60(0x4c9,0x546),'value':_0x4a5d2e}),this;}['lt'](_0x5187f4,_0x2ee65e){function _0x350826(_0x1474ad,_0x24c87d){return _0x1e74(_0x1474ad-0x66,_0x24c87d);}return this[_0x350826(0x27e,0x227)][_0x350826(0x2af,0x247)][_0x350826(0x347,0x3b2)]({'column':_0x5187f4,'operator':'lt','value':_0x2ee65e}),this;}['lte'](_0x509314,_0x499ec6){function _0x5b1ca5(_0xb4cbce,_0x28fd07){return _0x1e74(_0xb4cbce- -0x49,_0x28fd07);}return this[_0x5b1ca5(0x1cf,0x1b5)]['filters'][_0x5b1ca5(0x298,0x24d)]({'column':_0x509314,'operator':'lte','value':_0x499ec6}),this;}[_0x380dd0(-0xbd,-0x13c)](_0x3f3baa,_0x32a124){return this['query']['filters']['push']({'column':_0x3f3baa,'operator':'like','value':_0x32a124}),this;}['ilike'](_0x2dc59d,_0x4d2aea){return this['query']['filters']['push']({'column':_0x2dc59d,'operator':'ilike','value':_0x4d2aea}),this;}['is'](_0x44c1a7,_0x543f62){function _0x3a8875(_0x6ea6a2,_0x189d07){return _0x1e74(_0x189d07-0x18a,_0x6ea6a2);}return this['query'][_0x3a8875(0x44f,0x3d3)][_0x3a8875(0x476,0x46b)]({'column':_0x44c1a7,'operator':'is','value':_0x543f62}),this;}['in'](_0x1d5c8a,_0x5b769f){function _0xfb10b4(_0x4ccb7f,_0xcd3d99){return _0x1e74(_0x4ccb7f-0x346,_0xcd3d99);}return this[_0xfb10b4(0x55e,0x511)]['filters']['push']({'column':_0x1d5c8a,'operator':'in','value':_0x5b769f}),this;}[_0x380dd0(-0x7a,-0x6a)](_0x1cdefe,_0x1e7c84){return this['query']['filters']['push']({'column':_0x1cdefe,'operator':'contains','value':_0x1e7c84}),this;}['match'](_0x24b0fc){return Object['entries'](_0x24b0fc)['forEach'](([_0x5e168e,_0x522e19])=>{this['eq'](_0x5e168e,_0x522e19);}),this;}[_0x380dd0(0x7,-0x4e)](_0x15d554,_0x319dad){!this['query']['order']&&(this['query'][_0xd7fbfa(0x2f1,0x326)]=[]);this['query']['order'][_0xd7fbfa(0x30d,0x303)]({'column':_0x15d554,'ascending':_0x319dad?.[_0xd7fbfa(0x206,0x184)]!==![]});function _0xd7fbfa(_0x3939ef,_0x1b004d){return _0x1e74(_0x3939ef-0x2c,_0x1b004d);}return this;}['limit'](count){function _0x33fba7(_0x383625,_0x3fe7fe){return _0x1e74(_0x383625-0x4e,_0x3fe7fe);}return this[_0x33fba7(0x266,0x20c)]['limit']=count,this;}[_0x380dd0(0x14,0x6d)](from,_0x259932){function _0x159327(_0x1ae9b9,_0x28f6fa){return _0x1e74(_0x1ae9b9-0x34c,_0x28f6fa);}return this['query'][_0x159327(0x61e,0x5b6)]={'from':from,'to':_0x259932},this;}async['execute'](){function _0x19b917(_0x497354,_0x46e759){return _0x1e74(_0x497354- -0x1be,_0x46e759);}if(this['query'][_0x19b917(0x92,0xe)])return this['executeQuery']('PATCH',_0x19b917(0x32,0xd)+this['table'],{'data':this['query'][_0x19b917(0x92,0x38)],'options':this[_0x19b917(0x5a,0x13)]['updateOptions'],'filters':this['query']['filters']});else return this[_0x19b917(0x5a,-0x26)]['isDelete']?this['executeQuery']('DELETE','/sdk/v1/'+this['table']+_0x19b917(0xf7,0x15d),{'options':this['query'][_0x19b917(0xe9,0xb4)],'filters':this[_0x19b917(0x5a,-0x22)][_0x19b917(0x8b,0x101)]}):this[_0x19b917(0xd2,0xbf)]('GET',_0x19b917(0x32,0x35)+this[_0x19b917(0x45,0xcb)]+'?operation=select',{'select':this['query']['select'],'filters':this[_0x19b917(0x5a,-0x17)]['filters'],'order':this[_0x19b917(0x5a,0x1d)][_0x19b917(0x107,0x11e)],'limit':this[_0x19b917(0x5a,0x69)]['limit'],'range':this['query'][_0x19b917(0x114,0x12b)]});}async['single'](){this['limit'](0x1);const result=await this[_0x2cfc93(0x2a6,0x26e)]();function _0x2cfc93(_0x55912a,_0xbb020d){return _0x1e74(_0x55912a-0xa7,_0xbb020d);}return{'data':result[_0x2cfc93(0x32b,0x39b)]?.[0x0]||null,'error':result[_0x2cfc93(0x2cb,0x32e)]};}async[_0x380dd0(-0x2e,-0x8b)](_0x374792,_0x2f3e6a,_0x26ad04){function _0x4d8075(_0x5f4661,_0x1086ad){return _0x1e74(_0x5f4661-0x353,_0x1086ad);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this['workspaceId']);if(_0x374792==='GET'){const _0x9dfa56=_0x2f3e6a['split']('?'),_0x649cc9=_0x9dfa56[0x0],existingParams=new URLSearchParams(_0x9dfa56[0x1]||'');if(_0x26ad04['select'])existingParams['append']('select',_0x26ad04[_0x4d8075(0x592,0x53e)]);_0x26ad04['filters']?.[_0x4d8075(0x623,0x64c)]&&_0x26ad04['filters'][_0x4d8075(0x546,0x524)](filter=>{function _0x1a4b62(_0xdf0a21,_0x7d8e35){return _0x1e74(_0x7d8e35- -0x9f,_0xdf0a21);}existingParams[_0x1a4b62(0x25d,0x21f)](filter['column'],filter[_0x1a4b62(0x1ba,0x1f8)]+'.'+filter[_0x1a4b62(0x242,0x243)]);});if(_0x26ad04['order']?.[_0x4d8075(0x623,0x660)]){const orderStr=_0x26ad04['order']['map'](_0x4b6ea1=>''+_0x4b6ea1['column']+(_0x4b6ea1['ascending']?_0x4d8075(0x5b8,0x571):_0x4d8075(0x5d5,0x5e2)))[_0x4d8075(0x5e8,0x5a1)](',');existingParams['append']('order',orderStr);}if(_0x26ad04['limit'])existingParams[_0x4d8075(0x611,0x5d4)](_0x4d8075(0x5e1,0x58d),_0x26ad04['limit'][_0x4d8075(0x54c,0x58a)]());_0x26ad04['range']&&(existingParams['append']('offset',_0x26ad04['range']['from'][_0x4d8075(0x54c,0x5a9)]()),existingParams[_0x4d8075(0x611,0x651)]('limit',(_0x26ad04['range']['to']-_0x26ad04['range'][_0x4d8075(0x587,0x560)]+0x1)[_0x4d8075(0x54c,0x54a)]())),response=await this['httpClient'][_0x4d8075(0x60c,0x672)](_0x649cc9+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x374792==='DELETE'){const _0x14a26a=_0x2f3e6a['split']('?'),_0x515a6d=_0x14a26a[0x0],existingParams=new URLSearchParams(_0x14a26a[0x1]||'');!existingParams['has']('operation')&&existingParams['append'](_0x4d8075(0x5c6,0x5f2),'delete');_0x26ad04[_0x4d8075(0x59c,0x60b)]?.['length']&&_0x26ad04['filters']['forEach'](filter=>{function _0xfbc09e(_0x360554,_0x483d58){return _0x1e74(_0x360554- -0xdb,_0x483d58);}existingParams[_0xfbc09e(0x1e3,0x259)](filter[_0xfbc09e(0x1c9,0x1ad)],filter['operator']+'.'+filter['value']);});const deleteUrl=_0x515a6d+'?'+existingParams[_0x4d8075(0x54c,0x55b)]();console[_0x4d8075(0x572,0x58b)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console[_0x4d8075(0x572,0x5d0)]('\uD83D\uDD27 DELETE headers:',headers),console[_0x4d8075(0x572,0x51e)]('\uD83D\uDD27 DELETE filtros originais:',_0x26ad04['filters']),response=await this[_0x4d8075(0x5f0,0x63f)][_0x4d8075(0x551,0x539)](deleteUrl,{'headers':headers});}else{if(_0x374792==='PATCH'){const _0x3b03d8=_0x2f3e6a['split']('?'),_0x5bf148=_0x3b03d8[0x0],existingParams=new URLSearchParams(_0x3b03d8[0x1]||'');!existingParams['has']('operation')&&existingParams[_0x4d8075(0x611,0x5a9)](_0x4d8075(0x5c6,0x5fc),'update');_0x26ad04[_0x4d8075(0x59c,0x58e)]?.[_0x4d8075(0x623,0x5bd)]&&_0x26ad04[_0x4d8075(0x59c,0x56e)][_0x4d8075(0x546,0x575)](filter=>{function _0x4f5c13(_0x2b0505,_0x1fc4c0){return _0x1e74(_0x2b0505- -0x103,_0x1fc4c0);}existingParams['append'](filter[_0x4f5c13(0x1a1,0x160)],filter['operator']+'.'+filter[_0x4f5c13(0x1df,0x1cd)]);});_0x26ad04[_0x4d8075(0x598,0x520)]?.['prefer']&&(headers['Prefer']=_0x26ad04[_0x4d8075(0x598,0x547)][_0x4d8075(0x562,0x552)]);const updateUrl=_0x5bf148+'?'+existingParams[_0x4d8075(0x54c,0x504)]();response=await this[_0x4d8075(0x5f0,0x5e5)][_0x4d8075(0x614,0x620)](updateUrl,_0x26ad04['data'],{'headers':headers});}else{let _0x5c4569=_0x26ad04['data'];!headers[_0x4d8075(0x534,0x51d)]&&(headers['Prefer']=_0x4d8075(0x633,0x676)),_0x26ad04[_0x4d8075(0x598,0x5a2)]?.[_0x4d8075(0x53c,0x5ae)]&&(headers[_0x4d8075(0x534,0x559)]=_0x4d8075(0x52b,0x4b6)),_0x26ad04['dataArray']&&(_0x5c4569=_0x26ad04['dataArray']),response=await this['httpClient'][_0x4d8075(0x55f,0x4dc)](_0x2f3e6a,_0x5c4569,{'headers':headers});}}}return{'data':response[_0x4d8075(0x5d7,0x61c)],'error':null,'count':response['headers']?.['x-total-count']?parseInt(response['headers'][_0x4d8075(0x57f,0x53a)]):undefined};}catch(_0x1e79d9){return{'data':null,'error':_0x1e79d9 instanceof EBaaSError?_0x1e79d9:new EBaaSError(_0x1e79d9 instanceof Error?_0x1e79d9[_0x4d8075(0x5a6,0x555)]:'Database\x20operation\x20failed',0x0,_0x1e79d9)};}}}class CustomDatabaseManager{constructor(_0x193e0b,_0x536553){function _0x35d0d6(_0x4cdff7,_0x491863){return _0x1e74(_0x4cdff7-0x383,_0x491863);}this[_0x35d0d6(0x620,0x64e)]=_0x193e0b,this['workspaceId']=_0x536553;}async['detectCustomDatabase'](){function _0x32d35d(_0x5796aa,_0x1eb300){return _0x1e74(_0x5796aa-0x14b,_0x1eb300);}if(!this['workspaceId'])return{'hasCustomDatabase':![]};try{const response=await this[_0x32d35d(0x3e8,0x3fe)][_0x32d35d(0x404,0x484)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response[_0x32d35d(0x395,0x3ba)]===0xc8&&response[_0x32d35d(0x3cf,0x3fe)]?.['config']){const config=response['data']['config'],_0x24a0e4={'host':config[_0x32d35d(0x32f,0x2e3)],'port':config[_0x32d35d(0x41a,0x422)],'database':config['postgresDatabase'],'username':config[_0x32d35d(0x3c8,0x3ff)],'password':'','schema':config[_0x32d35d(0x3c4,0x377)],'sslEnabled':config['sslEnabled']};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x24a0e4},this[_0x32d35d(0x422,0x3e5)];}}catch(_0x4996c9){if(_0x4996c9?.[_0x32d35d(0x395,0x406)]===0x194)return this[_0x32d35d(0x422,0x44e)]={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x4996c9);}return this[_0x32d35d(0x422,0x3ec)]={'hasCustomDatabase':![]},this[_0x32d35d(0x422,0x3f1)];}async['testConnection'](_0x2673cc){function _0x34b87b(_0x4f63cc,_0x4051c6){return _0x1e74(_0x4051c6-0x1ac,_0x4f63cc);}try{const response=await this['httpClient']['post']('/admin/v1/workspace/custom-database/test-connection',_0x2673cc,{'headers':this[_0x34b87b(0x476,0x476)]?{'X-Workspace-ID':this['workspaceId']}:{}});return response[_0x34b87b(0x487,0x430)];}catch(_0x2c1089){return{'success':![],'message':_0x2c1089?.[_0x34b87b(0x380,0x3ff)]||_0x34b87b(0x455,0x41a)};}}async[_0x380dd0(-0x5c,-0xaa)](_0x1264b4){if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');const response=await this['httpClient']['post']('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x1264b4},{'headers':{'X-Workspace-ID':this['workspaceId']}});function _0x3d9da6(_0x2e4431,_0x1aae6c){return _0x1e74(_0x2e4431-0x40,_0x1aae6c);}const config=response[_0x3d9da6(0x2c4,0x32e)][_0x3d9da6(0x2ff,0x2cd)];return this[_0x3d9da6(0x317,0x31a)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x1264b4},config;}async[_0x380dd0(-0xc7,-0xbc)](){function _0x27466e(_0x41b51d,_0x259212){return _0x1e74(_0x259212- -0x331,_0x41b51d);}if(!this['workspaceId'])throw new Error('Workspace ID is required to remove custom database');await this['httpClient']['delete']('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this['workspaceId']}}),this[_0x27466e(0x1e,-0x5a)]={'hasCustomDatabase':![]};}['getDetectedConfig'](){return this['detectedConfig'];}['hasCustomDatabase'](){function _0x25434e(_0xef13a3,_0x494c33){return _0x1e74(_0xef13a3- -0x39e,_0x494c33);}return this[_0x25434e(-0xc7,-0xfd)]?.['hasCustomDatabase']??![];}['getCustomCredentials'](){function _0x48f45b(_0x2ff8c3,_0x813406){return _0x1e74(_0x2ff8c3-0x4f,_0x813406);}return this['detectedConfig']?.[_0x48f45b(0x2cf,0x314)];}['setWorkspaceId'](_0x3e3006){function _0xb2b1a(_0x376713,_0x3750f3){return _0x1e74(_0x376713-0x0,_0x3750f3);}this[_0xb2b1a(0x2ca,0x2be)]=_0x3e3006,this[_0xb2b1a(0x2d7,0x2b9)]=undefined;}['getWorkspaceId'](){function _0xd71a44(_0x294244,_0x4e51b3){return _0x1e74(_0x294244- -0x5,_0x4e51b3);}return this[_0xd71a44(0x2c5,0x2d2)];}['getStatus'](){function _0x4afbba(_0x1e731a,_0x1195e7){return _0x1e74(_0x1e731a- -0x1ea,_0x1195e7);}return{'workspaceId':this[_0x4afbba(0xe0,0x65)],'hasConfig':this[_0x4afbba(0x61,0x60)](),'configDetails':this['detectedConfig']?.[_0x4afbba(0x96,0x102)]?{'host':this['detectedConfig'][_0x4afbba(0x96,0x41)][_0x4afbba(0x47,0x9d)],'port':this[_0x4afbba(0xed,0x8e)]['credentials']['port'],'database':this['detectedConfig'][_0x4afbba(0x96,0x23)][_0x4afbba(0x6d,0x31)],'schema':this[_0x4afbba(0xed,0xf8)][_0x4afbba(0x96,0x100)][_0x4afbba(0x87,0x83)]||_0x4afbba(0xef,0xc0),'sslEnabled':this[_0x4afbba(0xed,0x80)][_0x4afbba(0x96,0x58)][_0x4afbba(0xea,0xb7)]||![]}:undefined};}}class DatabaseClient{constructor(_0x3f2eb5,_0x49b496){this['httpClient']=_0x3f2eb5,this['customDatabaseManager']=new CustomDatabaseManager(_0x3f2eb5,_0x49b496);}[_0x380dd0(-0x8a,-0x37)](_0x33f185){function _0x2b33ee(_0x363720,_0x12c06f){return _0x1e74(_0x12c06f-0x125,_0x363720);}return new QueryBuilder(this[_0x2b33ee(0x3a4,0x3c2)],_0x33f185,this[_0x2b33ee(0x393,0x3c7)],this[_0x2b33ee(0x33c,0x333)]['getWorkspaceId']());}[_0x380dd0(-0x60,-0x5c)](_0x5abbe8,_0x344661){function _0x4d1465(_0x5a0979,_0x278928){return _0x1e74(_0x278928-0x1f0,_0x5a0979);}return this['httpClient']['post'](_0x4d1465(0x3be,0x3e4)+_0x5abbe8,_0x344661);}[_0x380dd0(-0x4d,-0x4b)](_0x379bfe){const _0x84d399=new DatabaseClient(this[_0x565ef8(0x177,0x102)],this['customDatabaseManager']['getWorkspaceId']());_0x84d399[_0x565ef8(0xd2,0x107)]=_0x379bfe,_0x84d399[_0x565ef8(0x57,0x73)]=this['customDatabaseManager'];function _0x565ef8(_0x2d1539,_0x248d6f){return _0x1e74(_0x248d6f- -0x19b,_0x2d1539);}return _0x84d399;}async['detectCustomDatabase'](){function _0x1dfcd8(_0x2df3b8,_0x10b120){return _0x1e74(_0x2df3b8- -0x249,_0x10b120);}return this[_0x1dfcd8(-0x3b,-0x49)][_0x1dfcd8(-0x1b,0x5b)]();}async[_0x380dd0(-0x6d,-0xba)](_0x4d7c4f){function _0x1d1eb0(_0x48a69d,_0x454ea9){return _0x1e74(_0x48a69d- -0x2ed,_0x454ea9);}return this[_0x1d1eb0(-0xdf,-0x110)][_0x1d1eb0(-0xe4,-0x86)](_0x4d7c4f);}async[_0x380dd0(-0x5c,-0x9b)](_0x51aed7){function _0x5bad61(_0x93c24a,_0x4dd569){return _0x1e74(_0x4dd569- -0x1ec,_0x93c24a);}return this[_0x5bad61(0x60,0x22)][_0x5bad61(0xc1,0x76)](_0x51aed7);}async[_0x380dd0(-0xc7,-0x50)](){return this['customDatabaseManager']['removeCustomDatabase']();}[_0x380dd0(-0xa1,-0x7c)](){function _0x1faf9b(_0x96d0d2,_0x76e4fa){return _0x1e74(_0x76e4fa-0x29a,_0x96d0d2);}return this[_0x1faf9b(0x4c3,0x4a8)]['hasCustomDatabase']();}[_0x380dd0(0x5,0x69)](){function _0x50ae12(_0x599435,_0x31d3d1){return _0x1e74(_0x599435-0x36c,_0x31d3d1);}return this[_0x50ae12(0x57a,0x5cc)]['getStatus']();}[_0x380dd0(-0x20,-0x2c)](_0x472451){function _0x14280b(_0x19d2e5,_0x295054){return _0x1e74(_0x19d2e5-0x234,_0x295054);}this[_0x14280b(0x442,0x473)][_0x14280b(0x4d2,0x4a5)](_0x472451);}async[_0x380dd0(-0xb4,-0x11a)](){function _0x4b104f(_0x42f64c,_0x57cebb){return _0x1e74(_0x57cebb- -0x2b6,_0x42f64c);}try{await this['customDatabaseManager']['detectCustomDatabase']();}catch(_0x48f9eb){console[_0x4b104f(-0x7f,-0x22)]('Failed to initialize custom database detection:',_0x48f9eb);}}}class StorageBucket{constructor(_0x180f47,bucketId){function _0x229303(_0x29d379,_0x21247e){return _0x1e74(_0x21247e- -0x357,_0x29d379);}this['httpClient']=_0x180f47,this[_0x229303(-0x93,-0xc1)]=bucketId;}async[_0x380dd0(-0x25,0x7)](_0x3cf555,_0x1ef64c,_0x269af9){function _0x3c6a10(_0x3526b5,_0x219d44){return _0x1e74(_0x219d44-0x158,_0x3526b5);}try{const _0x2d544a=new FormData();if(_0x1ef64c instanceof File)_0x2d544a[_0x3c6a10(0x3c2,0x416)](_0x3c6a10(0x2d7,0x334),_0x1ef64c);else{if(_0x1ef64c instanceof Blob)_0x2d544a['append'](_0x3c6a10(0x37e,0x334),_0x1ef64c,_0x3cf555);else{if(_0x1ef64c instanceof ArrayBuffer)_0x2d544a['append'](_0x3c6a10(0x399,0x334),new Blob([_0x1ef64c]),_0x3cf555);else typeof _0x1ef64c==='string'&&_0x2d544a['append']('file',new Blob([_0x1ef64c],{'type':'text/plain'}),_0x3cf555);}}_0x2d544a['append'](_0x3c6a10(0x2d1,0x346),_0x3cf555);_0x269af9?.[_0x3c6a10(0x3d8,0x3a5)]&&_0x2d544a['append']('cacheControl',_0x269af9['cacheControl']);_0x269af9?.['contentType']&&_0x2d544a[_0x3c6a10(0x3de,0x416)]('contentType',_0x269af9[_0x3c6a10(0x3e9,0x399)]);_0x269af9?.[_0x3c6a10(0x44e,0x41f)]&&_0x2d544a[_0x3c6a10(0x484,0x416)]('metadata',JSON['stringify'](_0x269af9['metadata']));const _0x12bd41=_0x3c6a10(0x40a,0x3b3)+this[_0x3c6a10(0x41b,0x3ee)]+'/files'+(_0x269af9?.['upsert']?_0x3c6a10(0x379,0x3aa):''),response=await this[_0x3c6a10(0x3da,0x3f5)][_0x3c6a10(0x350,0x364)](_0x12bd41,_0x2d544a,{'headers':{'Content-Type':_0x3c6a10(0x31f,0x360)}});return{'data':response[_0x3c6a10(0x3cc,0x3dc)],'error':null};}catch(_0x1a9214){return{'data':null,'error':_0x1a9214 instanceof EBaaSError?_0x1a9214:new EBaaSError(_0x1a9214 instanceof Error?_0x1a9214['message']:'Failed\x20to\x20upload\x20file',0x0,_0x1a9214)};}}async['download'](_0x12773b,_0x931d62){function _0x283aa4(_0x4475e0,_0x28d738){return _0x1e74(_0x28d738-0x320,_0x4475e0);}try{const _0x17133d=new URLSearchParams();_0x931d62?.['transform']&&Object[_0x283aa4(0x57f,0x5a8)](_0x931d62['transform'])['forEach'](([_0x12c9d5,_0x57ed27])=>{function _0x8449cb(_0xfada08,_0x1e28e0){return _0x1e74(_0xfada08-0x3e4,_0x1e28e0);}_0x57ed27!==undefined&&_0x17133d[_0x8449cb(0x6a2,0x69d)](_0x12c9d5,String(_0x57ed27));});const _0x4c832d='/storage/buckets/'+this[_0x283aa4(0x607,0x5b6)]+_0x283aa4(0x540,0x5ac)+_0x12773b+(_0x17133d[_0x283aa4(0x4a2,0x519)]()?'?'+_0x17133d[_0x283aa4(0x59b,0x519)]():''),response=await this['httpClient'][_0x283aa4(0x5fe,0x5d9)](_0x4c832d,{'responseType':'blob'});return{'data':response[_0x283aa4(0x5b9,0x5a4)],'error':null};}catch(_0x1c2331){return{'data':null,'error':_0x1c2331 instanceof EBaaSError?_0x1c2331:new EBaaSError(_0x1c2331 instanceof Error?_0x1c2331[_0x283aa4(0x5ee,0x573)]:'Failed\x20to\x20download\x20file',0x0,_0x1c2331)};}}async[_0x380dd0(-0x9c,-0x7c)](_0x55b0d9,_0x1caecb){function _0x2a9989(_0x20355c,_0x3ccaea){return _0x1e74(_0x3ccaea- -0x9b,_0x20355c);}try{const _0x42b467=new URLSearchParams();_0x55b0d9&&_0x42b467[_0x2a9989(0x1f7,0x223)]('prefix',_0x55b0d9);_0x1caecb?.[_0x2a9989(0x171,0x1f3)]&&_0x42b467['append'](_0x2a9989(0x18c,0x1f3),String(_0x1caecb[_0x2a9989(0x222,0x1f3)]));_0x1caecb?.['offset']&&_0x42b467['append'](_0x2a9989(0x2ae,0x236),String(_0x1caecb['offset']));_0x1caecb?.['sortBy']&&_0x42b467[_0x2a9989(0x1c7,0x223)](_0x2a9989(0x169,0x17c),JSON[_0x2a9989(0x1e2,0x188)](_0x1caecb[_0x2a9989(0x145,0x17c)]));_0x1caecb?.[_0x2a9989(0x25e,0x1dd)]&&_0x42b467['append']('search',_0x1caecb[_0x2a9989(0x1c7,0x1dd)]);const _0x5a9dcc=_0x2a9989(0x1a2,0x1c0)+this['bucketId']+_0x2a9989(0xe1,0x14d)+(_0x42b467['toString']()?'?'+_0x42b467[_0x2a9989(0x10c,0x15e)]():''),response=await this[_0x2a9989(0x1ea,0x202)]['get'](_0x5a9dcc);return{'data':response[_0x2a9989(0x22d,0x1e9)],'error':null};}catch(_0x17316b){return{'data':null,'error':_0x17316b instanceof EBaaSError?_0x17316b:new EBaaSError(_0x17316b instanceof Error?_0x17316b['message']:_0x2a9989(0x116,0x140),0x0,_0x17316b)};}}async[_0x380dd0(-0x61,-0x47)](_0x1999ff){function _0x38ed74(_0x56f3ff,_0x199b84){return _0x1e74(_0x56f3ff- -0x2cd,_0x199b84);}try{const response=await this['httpClient']['delete'](_0x38ed74(-0x72,-0xbb)+this[_0x38ed74(-0x37,-0xb7)]+_0x38ed74(-0xe5,-0x6b),{'data':{'paths':_0x1999ff}});return{'data':response[_0x38ed74(-0x49,-0x22)],'error':null};}catch(_0x2beaec){return{'data':null,'error':_0x2beaec instanceof EBaaSError?_0x2beaec:new EBaaSError(_0x2beaec instanceof Error?_0x2beaec['message']:'Failed\x20to\x20remove\x20files',0x0,_0x2beaec)};}}async[_0x380dd0(-0xd4,-0x76)](fromPath,_0x1b0294){function _0x48a39d(_0x56ebbe,_0x2f85da){return _0x1e74(_0x56ebbe- -0x1e1,_0x2f85da);}try{const response=await this[_0x48a39d(0xbc,0x138)]['post']('/storage/buckets/'+this[_0x48a39d(0xb5,0x13a)]+'/files/move',{'sourceKey':fromPath,'destinationKey':_0x1b0294});return{'data':response['data'],'error':null};}catch(_0x3cf934){return{'data':null,'error':_0x3cf934 instanceof EBaaSError?_0x3cf934:new EBaaSError(_0x3cf934 instanceof Error?_0x3cf934[_0x48a39d(0x72,0x2)]:_0x48a39d(0x8a,0x56),0x0,_0x3cf934)};}}async['copy'](fromPath,_0x17affd){function _0x16cf16(_0x2780e0,_0xc88fff){return _0x1e74(_0x2780e0- -0x21,_0xc88fff);}try{const response=await this[_0x16cf16(0x27c,0x302)][_0x16cf16(0x1eb,0x1c3)]('/storage/buckets/'+this[_0x16cf16(0x275,0x250)]+_0x16cf16(0x270,0x256),{'sourceKey':fromPath,'destinationKey':_0x17affd});return{'data':response['data'],'error':null};}catch(_0x2c84f7){return{'data':null,'error':_0x2c84f7 instanceof EBaaSError?_0x2c84f7:new EBaaSError(_0x2c84f7 instanceof Error?_0x2c84f7[_0x16cf16(0x232,0x1e4)]:_0x16cf16(0x1c1,0x1a6),0x0,_0x2c84f7)};}}async[_0x380dd0(0x15,0x82)](_0x55459a,_0x1a15be,_0x4feebc){function _0x120ba9(_0x1bab40,_0x5e7c37){return _0x1e74(_0x1bab40- -0x109,_0x5e7c37);}try{const response=await this[_0x120ba9(0x194,0x172)]['post']('/storage/buckets/'+this[_0x120ba9(0x18d,0x1d1)]+_0x120ba9(0x183,0x165)+_0x55459a+'/sign',{'expiresIn':_0x1a15be,..._0x4feebc});return{'data':response['data'],'error':null};}catch(_0x348f63){return{'data':null,'error':_0x348f63 instanceof EBaaSError?_0x348f63:new EBaaSError(_0x348f63 instanceof Error?_0x348f63['message']:'Failed\x20to\x20create\x20signed\x20URL',0x0,_0x348f63)};}}['getPublicUrl'](_0x12de6f,_0x4ad2bf){const _0x769bb1=new URLSearchParams();_0x4ad2bf?.[_0x33a1ce(0x546,0x503)]&&Object[_0x33a1ce(0x534,0x4f0)](_0x4ad2bf['transform'])[_0x33a1ce(0x49f,0x4c5)](([_0x53736b,_0x5f36e1])=>{function _0x185521(_0x2b830e,_0x655f04){return _0x1e74(_0x655f04-0x114,_0x2b830e);}_0x5f36e1!==undefined&&_0x769bb1[_0x185521(0x42f,0x3d2)](_0x53736b,String(_0x5f36e1));});const _0x3b52d4=this['httpClient'][_0x33a1ce(0x4c7,0x444)]||'',_0x4dfb1f=_0x3b52d4+_0x33a1ce(0x507,0x520)+this['bucketId']+'/files/'+_0x12de6f+(_0x769bb1[_0x33a1ce(0x4a5,0x464)]()?'?'+_0x769bb1['toString']():'');function _0x33a1ce(_0x2ef0f0,_0x1cd8a7){return _0x1e74(_0x2ef0f0-0x2ac,_0x1cd8a7);}return{'data':{'publicUrl':_0x4dfb1f}};}async['getFileInfo'](_0xcc7b47){function _0x10a4a4(_0x3e4f44,_0x4b3019){return _0x1e74(_0x3e4f44- -0x24c,_0x4b3019);}try{const response=await this['httpClient']['get']('/storage/buckets/'+this['bucketId']+_0x10a4a4(0x40,0xe)+_0xcc7b47+_0x10a4a4(0x7d,0xda));return{'data':response[_0x10a4a4(0x38,0xe)],'error':null};}catch(_0x1c3bc3){return{'data':null,'error':_0x1c3bc3 instanceof EBaaSError?_0x1c3bc3:new EBaaSError(_0x1c3bc3 instanceof Error?_0x1c3bc3[_0x10a4a4(0x7,0x28)]:_0x10a4a4(-0x10,0x3d),0x0,_0x1c3bc3)};}}async['updateFileMetadata'](_0xd99093,metadata){function _0x4fd7a7(_0x5e2db5,_0x5c6c5a){return _0x1e74(_0x5e2db5-0x6c,_0x5c6c5a);}try{const response=await this['httpClient']['put']('/storage/buckets/'+this['bucketId']+_0x4fd7a7(0x2f8,0x295)+_0xd99093+'/metadata',{'metadata':metadata});return{'data':response[_0x4fd7a7(0x2f0,0x288)],'error':null};}catch(_0x433ca2){return{'data':null,'error':_0x433ca2 instanceof EBaaSError?_0x433ca2:new EBaaSError(_0x433ca2 instanceof Error?_0x433ca2['message']:_0x4fd7a7(0x344,0x36f),0x0,_0x433ca2)};}}}class StorageClient{constructor(_0x3070b6){this['httpClient']=_0x3070b6;}['from'](bucketId){function _0x3f6f89(_0x474c56,_0x5687e9){return _0x1e74(_0x5687e9-0x38d,_0x474c56);}return new StorageBucket(this[_0x3f6f89(0x5c5,0x62a)],bucketId);}async[_0x380dd0(-0xa0,-0xb2)](_0x5df0d2,_0x1ec910){function _0x1b2d76(_0x56b352,_0x41c1f6){return _0x1e74(_0x56b352- -0x3df,_0x41c1f6);}try{const response=await this['httpClient']['post'](_0x1b2d76(-0x156,-0xe8),{'id':_0x5df0d2,..._0x1ec910});return{'data':response['data'],'error':null};}catch(_0x5109e4){return{'data':null,'error':_0x5109e4 instanceof EBaaSError?_0x5109e4:new EBaaSError(_0x5109e4 instanceof Error?_0x5109e4['message']:_0x1b2d76(-0x11d,-0x16d),0x0,_0x5109e4)};}}async[_0x380dd0(-0x3d,-0x88)](_0x3b01d4){function _0x2daa24(_0x1678e2,_0x4dc882){return _0x1e74(_0x4dc882-0x7b,_0x1678e2);}try{const response=await this['httpClient']['get'](_0x2daa24(0x300,0x2d6)+_0x3b01d4);return{'data':response['data'],'error':null};}catch(_0x17c82e){return{'data':null,'error':_0x17c82e instanceof EBaaSError?_0x17c82e:new EBaaSError(_0x17c82e instanceof Error?_0x17c82e[_0x2daa24(0x263,0x2ce)]:_0x2daa24(0x31a,0x29b),0x0,_0x17c82e)};}}async[_0x380dd0(-0x2b,-0x8e)](){function _0x2d7453(_0x28733c,_0x4f3a5c){return _0x1e74(_0x28733c- -0x2f2,_0x4f3a5c);}try{const response=await this['httpClient'][_0x2d7453(-0x39,-0x1c)](_0x2d7453(-0x69,-0x66));return{'data':response[_0x2d7453(-0x6e,-0xea)],'error':null};}catch(_0x2ceaa2){return{'data':null,'error':_0x2ceaa2 instanceof EBaaSError?_0x2ceaa2:new EBaaSError(_0x2ceaa2 instanceof Error?_0x2ceaa2['message']:_0x2d7453(-0x51,-0x3f),0x0,_0x2ceaa2)};}}async['updateBucket'](_0x456389,_0x465eca){function _0x977caa(_0x157f1f,_0x42cb9d){return _0x1e74(_0x157f1f-0x73,_0x42cb9d);}try{const response=await this[_0x977caa(0x310,0x303)][_0x977caa(0x277,0x2bc)](_0x977caa(0x2ce,0x28d)+_0x456389,_0x465eca);return{'data':response['data'],'error':null};}catch(_0x2d7f98){return{'data':null,'error':_0x2d7f98 instanceof EBaaSError?_0x2d7f98:new EBaaSError(_0x2d7f98 instanceof Error?_0x2d7f98[_0x977caa(0x2c6,0x2f4)]:'Failed\x20to\x20update\x20bucket',0x0,_0x2d7f98)};}}async[_0x380dd0(-0xe1,-0xb1)](_0x44edbb){function _0x49a667(_0x5a1dec,_0x4943d7){return _0x1e74(_0x5a1dec- -0x22c,_0x4943d7);}try{const response=await this['httpClient']['delete']('/storage/buckets/'+_0x44edbb);return{'data':response[_0x49a667(0x58,0x31)],'error':null};}catch(_0x5349d6){return{'data':null,'error':_0x5349d6 instanceof EBaaSError?_0x5349d6:new EBaaSError(_0x5349d6 instanceof Error?_0x5349d6[_0x49a667(0x27,-0x1e)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x5349d6)};}}async[_0x380dd0(-0x31,0x4d)](){function _0x47443c(_0x9e2361,_0x212467){return _0x1e74(_0x212467- -0x341,_0x9e2361);}try{const response=await this[_0x47443c(-0x38,-0xa4)][_0x47443c(-0x5b,-0x88)]('/storage/usage');return{'data':response['data'],'error':null};}catch(_0x2bf1c0){return{'data':null,'error':_0x2bf1c0 instanceof EBaaSError?_0x2bf1c0:new EBaaSError(_0x2bf1c0 instanceof Error?_0x2bf1c0['message']:_0x47443c(-0xf2,-0x7d),0x0,_0x2bf1c0)};}}}class RealtimeChannel extends EventEmitter{constructor(_0x17c49c,_0x4c9063){super(),this[_0x34b7e6(-0x50,-0x81)]=![],this['state']='closed',this[_0x34b7e6(-0x66,-0x33)]=new Map();function _0x34b7e6(_0x528147,_0x34bb04){return _0x1e74(_0x528147- -0x2d6,_0x34bb04);}this[_0x34b7e6(-0x10,-0x59)]=_0x17c49c,this[_0x34b7e6(-0x29,-0x8f)]=_0x4c9063;}['subscribe'](_0x210ffd){function _0x5efecf(_0x7ed5d2,_0x1d6bcc){return _0x1e74(_0x1d6bcc- -0xe2,_0x7ed5d2);}return!this['joinedOnce']&&(this['joinedOnce']=!![],this[_0x5efecf(0xeb,0x145)]()),_0x210ffd&&this['on']('status',_0x210ffd),this;}['onPostgresChanges'](filter,_0x348806){function _0xe4a9e4(_0xd13fdf,_0x349972){return _0x1e74(_0x349972-0x1f7,_0xd13fdf);}const _0x3f98a0=_0xe4a9e4(0x4d4,0x4c3)+JSON['stringify'](filter);super['on'](_0x3f98a0,_0x348806);const _0x4c569e={'unsubscribe':()=>{super['off'](_0x3f98a0,_0x348806);function _0x4a270c(_0x54dfd3,_0x3eb6f9){return _0x1e74(_0x3eb6f9- -0x2ce,_0x54dfd3);}this['subscriptions'][_0x4a270c(-0xdc,-0xd0)](_0x3f98a0);}};return this[_0xe4a9e4(0x439,0x467)]['set'](_0x3f98a0,_0x4c569e),this[_0xe4a9e4(0x521,0x4a4)]?.[_0xe4a9e4(0x435,0x3ce)]&&this[_0xe4a9e4(0x3ef,0x3dd)]===_0xe4a9e4(0x3f1,0x3e4)&&this[_0xe4a9e4(0x49d,0x4a4)][_0xe4a9e4(0x49f,0x42f)]('subscribe_postgres_changes',{'topic':this['topic'],'filter':filter,'ref':this['makeRef']()}),_0x4c569e;}['onBroadcast'](filter,_0x26b092){const _0x5f3fb0=_0x252ee3(0x381,0x308)+JSON['stringify'](filter);super['on'](_0x5f3fb0,_0x26b092);const _0x106d8e={'unsubscribe':()=>{super[_0x1e0bc4(-0x66,-0xa2)](_0x5f3fb0,_0x26b092);function _0x1e0bc4(_0x5c9e50,_0x249a6b){return _0x1e74(_0x5c9e50- -0x310,_0x249a6b);}this[_0x1e0bc4(-0xa0,-0x46)][_0x1e0bc4(-0x112,-0x176)](_0x5f3fb0);}};this['subscriptions']['set'](_0x5f3fb0,_0x106d8e);function _0x252ee3(_0x4c6bbe,_0x187cec){return _0x1e74(_0x187cec-0x81,_0x4c6bbe);}return _0x106d8e;}[_0x380dd0(-0xb8,-0x6d)](filter,_0x29228e){const _0x53d5f5=_0x19f246(-0x139,-0x126)+JSON['stringify'](filter);super['on'](_0x53d5f5,_0x29228e);const _0x50cfe3={'unsubscribe':()=>{super[_0x304c33(0x2e8,0x27a)](_0x53d5f5,_0x29228e);function _0x304c33(_0x567737,_0x57c69c){return _0x1e74(_0x57c69c- -0x30,_0x567737);}this[_0x304c33(0x231,0x240)][_0x304c33(0x1cc,0x1ce)](_0x53d5f5);}};function _0x19f246(_0x1c4f22,_0x27a505){return _0x1e74(_0x27a505- -0x38e,_0x1c4f22);}return this[_0x19f246(-0x172,-0x11e)]['set'](_0x53d5f5,_0x50cfe3),_0x50cfe3;}[_0x380dd0(-0x51,-0x23)](_0x4bdae8){return new Promise(_0x168abf=>{function _0x49ba36(_0x5005ac,_0x4a7cd7){return _0x1e74(_0x5005ac-0x2ee,_0x4a7cd7);}this[_0x49ba36(0x59b,0x54d)]?.[_0x49ba36(0x4c5,0x4cb)]&&this['state']==='joined'?(this['socket']['emit'](_0x49ba36(0x543,0x58b),{'topic':this['topic'],'event':_0x4bdae8[_0x49ba36(0x5cd,0x5a3)],'payload':_0x4bdae8,'ref':this['makeRef']()}),_0x168abf('ok')):_0x168abf('error');});}[_0x380dd0(-0xb9,-0x139)](_0x5d2c74){return new Promise(_0x2c1eeb=>{function _0x1081c7(_0x38f699,_0x511222){return _0x1e74(_0x38f699-0x384,_0x511222);}this[_0x1081c7(0x631,0x68d)]?.[_0x1081c7(0x55b,0x5da)]&&this['state']===_0x1081c7(0x571,0x506)?(this['socket']['emit']('presence',{'topic':this[_0x1081c7(0x64a,0x662)],'event':'track','payload':_0x5d2c74,'ref':this[_0x1081c7(0x607,0x62c)]()}),_0x2c1eeb('ok')):_0x2c1eeb(_0x1081c7(0x5a8,0x5ea));});}['untrack'](){return new Promise(_0x49d47a=>{function _0x41581e(_0x22cafb,_0x1b8545){return _0x1e74(_0x1b8545-0x242,_0x22cafb);}this['socket']?.[_0x41581e(0x3df,0x419)]&&this['state']===_0x41581e(0x48d,0x42f)?(this['socket'][_0x41581e(0x45e,0x47a)](_0x41581e(0x4b1,0x4bc),{'topic':this['topic'],'event':_0x41581e(0x547,0x4d4),'ref':this['makeRef']()}),_0x49d47a('ok')):_0x49d47a(_0x41581e(0x41d,0x466));});}[_0x380dd0(-0x8b,-0x14)](){return new Promise(_0x3661ea=>{function _0xfd222e(_0x2451eb,_0x57ecc1){return _0x1e74(_0x57ecc1-0x217,_0x2451eb);}this[_0xfd222e(0x42b,0x3fd)]='leaving',this[_0xfd222e(0x46d,0x487)][_0xfd222e(0x44b,0x40a)](_0x485c9d=>{function _0x5cb14b(_0x23bc9e,_0xb7b936){return _0x1e74(_0xb7b936- -0x37,_0x23bc9e);}_0x485c9d[_0x5cb14b(0x1c3,0x1fc)]();}),this[_0xfd222e(0x4b7,0x487)][_0xfd222e(0x4fc,0x4d4)](),this[_0xfd222e(0x536,0x4c4)]?.['connected']&&this[_0xfd222e(0x490,0x4c4)]['emit'](_0xfd222e(0x472,0x451),{'topic':this[_0xfd222e(0x498,0x4dd)],'ref':this[_0xfd222e(0x4ea,0x49a)]()}),this['state']=_0xfd222e(0x426,0x455),this['removeAllListeners'](),_0x3661ea('ok');});}['_join'](){if(this['state']===_0x1c9fcd(0x2c5,0x2d0))return;this[_0x1c9fcd(0x23f,0x2bf)]=_0x1c9fcd(0x248,0x1f5);function _0x1c9fcd(_0x34b36a,_0xb3bf91){return _0x1e74(_0x34b36a-0x59,_0xb3bf91);}this[_0x1c9fcd(0x306,0x303)]?.['connected']&&(this['socket']['emit'](_0x1c9fcd(0x2ee,0x2e3),{'topic':this['topic'],'ref':this[_0x1c9fcd(0x2dc,0x329)]()}),setTimeout(()=>{function _0x228d2b(_0x3e4bfb,_0x30c8ed){return _0x1e74(_0x3e4bfb- -0x24c,_0x30c8ed);}this['state']==='joining'&&(this[_0x228d2b(-0x66,0x1f)]='joined',this['emit'](_0x228d2b(-0x2,-0x81),'SUBSCRIBED'));},0x64));}[_0x380dd0(-0x13,-0x10)](){function _0x3bf1a2(_0x3c41e7,_0x59d6f3){return _0x1e74(_0x59d6f3- -0xba,_0x3c41e7);}this[_0x3bf1a2(0x1d1,0x1cc)]&&(this['_join'](),this[_0x3bf1a2(0x18f,0x1b6)][_0x3bf1a2(0x19e,0x139)]((_0x443d7f,_0x1bcbb9)=>{function _0x3d007b(_0x3a2db6,_0x3a4a00){return _0x1e74(_0x3a4a00- -0x24e,_0x3a2db6);}if(_0x1bcbb9['startsWith']('postgres_changes:')){const filter=JSON[_0x3d007b(-0x27,0x26)](_0x1bcbb9[_0x3d007b(0x51,0x27)](_0x3d007b(0x5a,0x7e),''));this['socket']?.[_0x3d007b(0x26,-0x16)]('subscribe_postgres_changes',{'topic':this['topic'],'filter':filter,'ref':this['makeRef']()});}}));}[_0x380dd0(-0xd7,-0x77)](_0x58f321,_0x553f28){function _0x4fb701(_0x44e2fe,_0x361a32){return _0x1e74(_0x361a32- -0x216,_0x44e2fe);}if(_0x58f321===_0x4fb701(0x45,0x54)){const _0x86c8e4='postgres_changes:'+JSON['stringify'](_0x553f28[_0x4fb701(0x57,0x96)]||{});this[_0x4fb701(0x59,0x22)](_0x86c8e4,_0x553f28);}else{if(_0x58f321===_0x4fb701(0x8f,0x3f)){const _0x3cc6be=_0x4fb701(0xbc,0x71)+JSON[_0x4fb701(-0x35,0xd)]({'event':_0x553f28[_0x4fb701(0x88,0xc9)]});this['emit'](_0x3cc6be,_0x553f28);}else{if(_0x58f321===_0x4fb701(-0x9,0x64)){const _0x290e1c='presence:'+JSON['stringify']({'event':_0x553f28[_0x4fb701(0x87,0xc9)]});this[_0x4fb701(0x64,0x22)](_0x290e1c,_0x553f28);}}}this[_0x4fb701(0x16,0x22)](_0x58f321,_0x553f28);}['_setState'](_0x81c58f){this['state']=_0x81c58f;let status;switch(_0x81c58f){case'joined':status='SUBSCRIBED';break;case _0x78a67c(0x3c6,0x3d9):status=_0x78a67c(0x379,0x3b6);break;case _0x78a67c(0x2de,0x341):status='CLOSED';break;default:return;}function _0x78a67c(_0x33888c,_0x13fa78){return _0x1e74(_0x13fa78-0x103,_0x33888c);}this['emit'](_0x78a67c(0x30d,0x34d),status);}[_0x380dd0(-0x3b,-0xc1)](){function _0x206c4d(_0x4ec48c,_0x34db45){return _0x1e74(_0x34db45-0x310,_0x4ec48c);}return Math[_0x206c4d(0x5be,0x576)]()['toString'](0x24)['substring'](0x2,0xf);}[_0x380dd0(-0x77,-0xee)](){function _0x4817ba(_0x6e049b,_0x3e78c2){return _0x1e74(_0x6e049b-0x94,_0x3e78c2);}return this[_0x4817ba(0x27a,0x2ee)];}}class RealtimeClient{constructor(_0x541e78,_0x25ab69,_0x240560={}){this[_0x1a5fb8(0x56,0xac)]=null,this['channels']=new Map(),this[_0x1a5fb8(-0x5c,-0xe2)]='disconnected',this['reconnectAttempts']=0x0,this[_0x1a5fb8(0xd,-0x44)]=0x5,this['url']=_0x541e78;function _0x1a5fb8(_0x3bbac3,_0x1746f9){return _0x1e74(_0x3bbac3- -0x257,_0x1746f9);}this[_0x1a5fb8(0x4f,0xe)]=_0x25ab69,this['options']={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x240560};}[_0x380dd0(-0x4c,-0x6a)](){return new Promise((_0x1b6be3,_0x372e6f)=>{if(this[_0x583fce(-0x44,-0xba)]?.[_0x583fce(-0x141,-0x190)]){_0x1b6be3();return;}this[_0x583fce(-0x10d,-0x16c)]=_0x583fce(-0x81,-0xc2);function _0x583fce(_0x199e1d,_0x266a62){return _0x1e74(_0x266a62- -0x367,_0x199e1d);}this['socket']=socket_ioClient['io'](this[_0x583fce(-0xc4,-0xf1)],{'auth':{'apikey':this['apiKey']},'transports':[_0x583fce(-0x6a,-0xc4)],'reconnection':!![],'reconnectionDelay':this['options'][_0x583fce(-0x79,-0xcb)],'reconnectionAttempts':this['options']['maxReconnectAttempts'],...this[_0x583fce(-0xfb,-0x122)]['socketOptions']}),this[_0x583fce(-0xff,-0xba)]['on']('connect',()=>{this[_0x5c10a9(-0x236,-0x1e4)]='connected',this['reconnectAttempts']=0x0;function _0x5c10a9(_0x5e115f,_0x38e87b){return _0x1e74(_0x38e87b- -0x3df,_0x5e115f);}this[_0x5c10a9(-0x124,-0x130)](),_0x1b6be3();}),this[_0x583fce(-0x4e,-0xba)]['on'](_0x583fce(-0x17e,-0x127),_0x216e0e=>{this[_0x476a12(0x3c6,0x3df)]='disconnected';function _0x476a12(_0x4a78f7,_0x53bb79){return _0x1e74(_0x53bb79-0x1e4,_0x4a78f7);}this['channels'][_0x476a12(0x391,0x3d7)](channel=>{function _0xd444e1(_0x49e87d,_0x11bac3){return _0x1e74(_0x11bac3-0x227,_0x49e87d);}channel[_0xd444e1(0x3c9,0x43c)]('closed');});}),this[_0x583fce(-0x133,-0xba)]['on']('connect_error',_0x17ee10=>{this[_0x6545f(-0x1ce,-0x1b6)]=_0x6545f(-0x1f4,-0x18d),this[_0x6545f(-0xdb,-0x14a)]++;function _0x6545f(_0x472dec,_0x222010){return _0x1e74(_0x222010- -0x3b1,_0x472dec);}this['reconnectAttempts']>=this[_0x6545f(-0x135,-0x14d)]&&_0x372e6f(new Error('Failed\x20to\x20connect\x20after\x20'+this['maxReconnectAttempts']+'\x20attempts:\x20'+_0x17ee10['message']));}),this[_0x583fce(-0xb4,-0xba)]['on'](_0x583fce(-0x119,-0x12c),()=>{this['connectionState']='connected',this['reconnectAttempts']=0x0,this['channels']['forEach'](channel=>{function _0x33dbc1(_0xe1a2d,_0x3b2c2c){return _0x1e74(_0xe1a2d-0x215,_0x3b2c2c);}channel[_0x33dbc1(0x4c0,0x4fa)]();});}),this[_0x583fce(-0x97,-0xba)]['on']('postgres_changes',_0x402665=>{function _0x290734(_0x22f6a0,_0x4e6adf){return _0x1e74(_0x22f6a0-0x106,_0x4e6adf);}const channel=this[_0x290734(0x3c0,0x3db)]['get'](_0x402665['topic']);channel&&channel[_0x290734(0x2ed,0x370)](_0x290734(0x370,0x3a6),_0x402665);}),this[_0x583fce(-0xf9,-0xba)]['on']('broadcast',_0x59d7d4=>{const channel=this['channels'][_0x1b0c79(-0x80,-0x66)](_0x59d7d4[_0x1b0c79(-0x73,-0xec)]);function _0x1b0c79(_0x2476b8,_0x448082){return _0x1e74(_0x2476b8- -0x339,_0x448082);}channel&&channel['_trigger']('broadcast',_0x59d7d4);}),this['socket']['on']('presence',_0x3f5b2f=>{const channel=this['channels']['get'](_0x3f5b2f['topic']);function _0x2a90a2(_0x353c53,_0x151a12){return _0x1e74(_0x151a12- -0x22a,_0x353c53);}channel&&channel[_0x2a90a2(-0xb,-0x43)](_0x2a90a2(0x77,0x50),_0x3f5b2f);});});}['disconnect'](){function _0xc9f3c7(_0x153385,_0x21d1f2){return _0x1e74(_0x153385-0x297,_0x21d1f2);}this['socket']&&(this[_0xc9f3c7(0x544,0x5b3)]['disconnect'](),this[_0xc9f3c7(0x544,0x4f3)]=null),this[_0xc9f3c7(0x492,0x4b5)]='disconnected',this[_0xc9f3c7(0x551,0x5bc)]['clear']();}['channel'](_0x171a3f){if(this['channels'][_0x2b8c53(0x375,0x2ef)](_0x171a3f))return this['channels']['get'](_0x171a3f);const channel=new RealtimeChannel(_0x171a3f,this['socket']);function _0x2b8c53(_0x2db242,_0x5385c6){return _0x1e74(_0x5385c6-0xc5,_0x2db242);}return this[_0x2b8c53(0x34e,0x37f)][_0x2b8c53(0x354,0x380)](_0x171a3f,channel),this['connectionState']===_0x2b8c53(0x31e,0x29c)&&channel['_join'](),channel;}['removeChannel'](channel){const _0x410b92=channel['topic'];function _0x918fa7(_0x5b35c2,_0x3590a7){return _0x1e74(_0x3590a7- -0x2,_0x5b35c2);}this[_0x918fa7(0x26b,0x2b8)][_0x918fa7(0x231,0x228)](_0x410b92)&&(this[_0x918fa7(0x33e,0x2b8)]['delete'](_0x410b92),channel['unsubscribe']());}[_0x380dd0(-0x6f,-0x96)](){this['channels'][_0x4e1534(0x29d,0x2cc)](channel=>{channel['unsubscribe']();});function _0x4e1534(_0x4ad8ed,_0x1dbc14){return _0x1e74(_0x1dbc14-0xd9,_0x4ad8ed);}this[_0x4e1534(0x3ad,0x393)]['clear']();}[_0x380dd0(-0x2,0x10)](){function _0x58e7a7(_0x464506,_0x4f68db){return _0x1e74(_0x4f68db- -0x39c,_0x464506);}return Array[_0x58e7a7(-0x10d,-0x168)](this[_0x58e7a7(-0xc2,-0xe2)]['values']());}[_0x380dd0(-0xab,-0x12f)](){return this['connectionState']==='connected'&&!!this['socket']?.['connected'];}['getConnectionState'](){function _0x1607cc(_0x480d4e,_0x58610b){return _0x1e74(_0x58610b-0x21f,_0x480d4e);}return this[_0x1607cc(0x429,0x41a)];}['onConnectionStateChange'](_0x5346bf){const _0x369f9f=()=>_0x5346bf(this['connectionState']);function _0x393989(_0x2548e0,_0x549fa9){return _0x1e74(_0x2548e0- -0x310,_0x549fa9);}return this[_0x393989(-0x63,-0x63)]&&(this['socket']['on'](_0x393989(-0x9e,-0xa9),()=>{this[_0x43c679(-0x148,-0x11e)]=_0x43c679(-0x16c,-0x11d);function _0x43c679(_0x21eac7,_0x57cf82){return _0x1e74(_0x21eac7- -0x343,_0x57cf82);}_0x369f9f();}),this['socket']['on']('disconnect',()=>{this[_0x4f8f32(-0x121,-0x139)]=_0x4f8f32(-0xef,-0x137);function _0x4f8f32(_0x749bb1,_0x512d8d){return _0x1e74(_0x512d8d- -0x334,_0x749bb1);}_0x369f9f();}),this['socket']['on']('connect_error',()=>{this['connectionState']=_0x2a0757(0x507,0x48e);function _0x2a0757(_0x270470,_0x1037e9){return _0x1e74(_0x1037e9-0x26a,_0x270470);}_0x369f9f();})),()=>{function _0x5ccb08(_0x124d50,_0x2cba93){return _0x1e74(_0x124d50-0x326,_0x2cba93);}this[_0x5ccb08(0x5d3,0x573)]&&(this[_0x5ccb08(0x5d3,0x5ad)]['off']('connect',_0x369f9f),this['socket'][_0x5ccb08(0x5d0,0x5a5)]('disconnect',_0x369f9f),this[_0x5ccb08(0x5d3,0x5f6)][_0x5ccb08(0x5d0,0x592)](_0x5ccb08(0x57e,0x594),_0x369f9f));};}[_0x380dd0(-0xf,-0x4f)](){function _0x2c572d(_0xe62dd2,_0x1c0fa5){return _0x1e74(_0xe62dd2-0x1f9,_0x1c0fa5);}if(!this[_0x2c572d(0x43e,0x4be)]['heartbeatInterval']||!this['socket'])return;const interval=setInterval(()=>{function _0x469673(_0x4364ae,_0x3c6270){return _0x1e74(_0x3c6270-0x1c0,_0x4364ae);}this[_0x469673(0x41a,0x46d)]?.['connected']?this['socket']['emit']('heartbeat',{'timestamp':Date['now']()}):clearInterval(interval);},this['options'][_0x2c572d(0x3f1,0x446)]);}['_getSocket'](){return this['socket'];}}function _0x1e74(_0x576199,_0x307e20){const _0x1cdf35=_0x1cdf();return _0x1e74=function(_0x1e7434,_0x377c80){_0x1e7434=_0x1e7434-0x1d7;let _0x2d00db=_0x1cdf35[_0x1e7434];if(_0x1e74['Kkwdhz']===undefined){var _0x39163f=function(_0x2654f9){const _0x50eccd='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4b2024='',_0x11a356='';for(let _0xca3659=0x0,_0x1fa99a,_0xc51147,_0x401c05=0x0;_0xc51147=_0x2654f9['charAt'](_0x401c05++);~_0xc51147&&(_0x1fa99a=_0xca3659%0x4?_0x1fa99a*0x40+_0xc51147:_0xc51147,_0xca3659++%0x4)?_0x4b2024+=String['fromCharCode'](0xff&_0x1fa99a>>(-0x2*_0xca3659&0x6)):0x0){_0xc51147=_0x50eccd['indexOf'](_0xc51147);}for(let _0x97c3ba=0x0,_0x470896=_0x4b2024['length'];_0x97c3ba<_0x470896;_0x97c3ba++){_0x11a356+='%'+('00'+_0x4b2024['charCodeAt'](_0x97c3ba)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x11a356);};_0x1e74['azvcem']=_0x39163f,_0x576199=arguments,_0x1e74['Kkwdhz']=!![];}const _0x407ffb=_0x1cdf35[0x0],_0x7a429c=_0x1e7434+_0x407ffb,_0x1c7a90=_0x576199[_0x7a429c];return!_0x1c7a90?(_0x2d00db=_0x1e74['azvcem'](_0x2d00db),_0x576199[_0x7a429c]=_0x2d00db):_0x2d00db=_0x1c7a90,_0x2d00db;},_0x1e74(_0x576199,_0x307e20);}class FunctionsClient{constructor(_0x1629c0){this['httpClient']=_0x1629c0;}async['invoke'](_0x3b4074,_0x264aa6){function _0x13f270(_0x198c2b,_0x1d0b5d){return _0x1e74(_0x1d0b5d-0x1b0,_0x198c2b);}try{const _0x2d65df=_0x264aa6?.[_0x13f270(0x490,0x461)]||'POST',headers={'Content-Type':'application/json',..._0x264aa6?.['headers']};let response;const _0x337e9e='/functions/v1/'+_0x3b4074;switch(_0x2d65df[_0x13f270(0x392,0x3b0)]()){case'GET':response=await this['httpClient']['get'](_0x337e9e,{'headers':headers,'params':_0x264aa6?.['body']});break;case'POST':response=await this['httpClient'][_0x13f270(0x39f,0x3bc)](_0x337e9e,_0x264aa6?.[_0x13f270(0x3b6,0x43b)],{'headers':headers});break;case'PUT':response=await this['httpClient']['put'](_0x337e9e,_0x264aa6?.['body'],{'headers':headers});break;case'PATCH':response=await this['httpClient']['patch'](_0x337e9e,_0x264aa6?.['body'],{'headers':headers});break;case'DELETE':response=await this[_0x13f270(0x480,0x44d)]['delete'](_0x337e9e,{'headers':headers,'data':_0x264aa6?.[_0x13f270(0x468,0x43b)]});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x2d65df,0x190);}return{'data':response[_0x13f270(0x424,0x434)],'error':null};}catch(_0x3b678a){return{'data':null,'error':_0x3b678a instanceof EBaaSError?_0x3b678a:new EBaaSError(_0x3b678a instanceof Error?_0x3b678a[_0x13f270(0x3e9,0x403)]:'Function\x20invocation\x20failed',0x0,_0x3b678a)};}}async[_0x380dd0(-0x9c,-0x103)](){function _0x25869f(_0x51bedb,_0x35a14c){return _0x1e74(_0x35a14c- -0x345,_0x51bedb);}try{const response=await this[_0x25869f(-0x3c,-0xa8)][_0x25869f(-0x38,-0x8c)]('/functions/v1');return{'data':response['data'],'error':null};}catch(_0x2810f3){return{'data':null,'error':_0x2810f3 instanceof EBaaSError?_0x2810f3:new EBaaSError(_0x2810f3 instanceof Error?_0x2810f3[_0x25869f(-0x109,-0xf2)]:'Failed\x20to\x20list\x20functions',0x0,_0x2810f3)};}}async[_0x380dd0(-0x5,-0x48)](_0xfb7c0e){function _0x925c95(_0x131bdf,_0x1bbc0d){return _0x1e74(_0x1bbc0d- -0x24a,_0x131bdf);}try{const response=await this[_0x925c95(0x4b,0x53)]['get']('/functions/v1/'+_0xfb7c0e+_0x925c95(0x76,0x7f));return{'data':response[_0x925c95(0x5a,0x3a)],'error':null};}catch(_0x410ae0){return{'data':null,'error':_0x410ae0 instanceof EBaaSError?_0x410ae0:new EBaaSError(_0x410ae0 instanceof Error?_0x410ae0[_0x925c95(-0x75,0x9)]:_0x925c95(0x45,0x7e),0x0,_0x410ae0)};}}async[_0x380dd0(-0xa2,-0x68)](_0x527668,_0x5b0c05){function _0x1d7014(_0x3fd432,_0x5a1e26){return _0x1e74(_0x3fd432-0x230,_0x5a1e26);}try{const _0x24d06d=new FormData();if(_0x5b0c05[_0x1d7014(0x48a,0x477)]instanceof File)_0x24d06d['append']('code',_0x5b0c05['code']);else typeof _0x5b0c05['code']==='string'&&_0x24d06d[_0x1d7014(0x4ee,0x559)](_0x1d7014(0x48a,0x472),new Blob([_0x5b0c05[_0x1d7014(0x48a,0x436)]],{'type':_0x1d7014(0x4fd,0x549)}),_0x1d7014(0x4a7,0x501));_0x5b0c05['entrypoint']&&_0x24d06d[_0x1d7014(0x4ee,0x55e)](_0x1d7014(0x493,0x489),_0x5b0c05[_0x1d7014(0x493,0x474)]);_0x5b0c05['env']&&_0x24d06d[_0x1d7014(0x4ee,0x471)](_0x1d7014(0x40e,0x40a),JSON['stringify'](_0x5b0c05[_0x1d7014(0x40e,0x40b)]));_0x5b0c05['importMap']&&_0x24d06d[_0x1d7014(0x4ee,0x520)](_0x1d7014(0x4de,0x4e9),JSON[_0x1d7014(0x453,0x3df)](_0x5b0c05[_0x1d7014(0x4de,0x457)]));_0x5b0c05['verify']!==undefined&&_0x24d06d['append']('verify',String(_0x5b0c05[_0x1d7014(0x446,0x45e)]));const response=await this['httpClient']['post'](_0x1d7014(0x426,0x4ab)+_0x527668+_0x1d7014(0x50e,0x48a),_0x24d06d,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x1d7014(0x4b4,0x4ec)],'error':null};}catch(_0x5c0fd5){return{'data':null,'error':_0x5c0fd5 instanceof EBaaSError?_0x5c0fd5:new EBaaSError(_0x5c0fd5 instanceof Error?_0x5c0fd5[_0x1d7014(0x483,0x4fc)]:_0x1d7014(0x449,0x473),0x0,_0x5c0fd5)};}}async[_0x380dd0(-0xc0,-0xc4)](_0x38c032){function _0x47bc32(_0x445d35,_0x39cc1d){return _0x1e74(_0x39cc1d- -0x376,_0x445d35);}try{const response=await this[_0x47bc32(-0xac,-0xd9)]['delete']('/functions/v1/'+_0x38c032);return{'data':response['data'],'error':null};}catch(_0x3382f2){return{'data':null,'error':_0x3382f2 instanceof EBaaSError?_0x3382f2:new EBaaSError(_0x3382f2 instanceof Error?_0x3382f2['message']:_0x47bc32(-0x1e9,-0x18a),0x0,_0x3382f2)};}}async['updateEnv'](_0x594b44,_0xe478){function _0x41c9b6(_0x4d9736,_0x5b1321){return _0x1e74(_0x5b1321- -0xdd,_0x4d9736);}try{const response=await this['httpClient']['put'](_0x41c9b6(0x112,0x119)+_0x594b44+'/env',{'env':_0xe478});return{'data':response['data'],'error':null};}catch(_0x57bc0f){return{'data':null,'error':_0x57bc0f instanceof EBaaSError?_0x57bc0f:new EBaaSError(_0x57bc0f instanceof Error?_0x57bc0f[_0x41c9b6(0x11e,0x176)]:'Failed\x20to\x20update\x20function\x20environment',0x0,_0x57bc0f)};}}async[_0x380dd0(-0xc2,-0x5a)](_0x5e2b56,_0x453798){function _0x175ae8(_0x2cfb6a,_0x35485a){return _0x1e74(_0x35485a-0x1b7,_0x2cfb6a);}try{const _0x3a8bb9=new URLSearchParams();_0x453798?.['limit']&&_0x3a8bb9['append'](_0x175ae8(0x43d,0x445),String(_0x453798[_0x175ae8(0x463,0x445)]));_0x453798?.['offset']&&_0x3a8bb9['append'](_0x175ae8(0x4eb,0x488),String(_0x453798['offset']));_0x453798?.[_0x175ae8(0x3a6,0x3e9)]&&_0x3a8bb9[_0x175ae8(0x495,0x475)]('level',_0x453798[_0x175ae8(0x3a3,0x3e9)]);const _0x34f27b='/functions/v1/'+_0x5e2b56+'/logs'+(_0x3a8bb9['toString']()?'?'+_0x3a8bb9['toString']():''),response=await this['httpClient']['get'](_0x34f27b);return{'data':response['data'],'error':null};}catch(_0x20e6c7){return{'data':null,'error':_0x20e6c7 instanceof EBaaSError?_0x20e6c7:new EBaaSError(_0x20e6c7 instanceof Error?_0x20e6c7['message']:_0x175ae8(0x3d5,0x426),0x0,_0x20e6c7)};}}async[_0x380dd0(-0x81,-0x95)](_0x49e32e,_0x401668){function _0x37e201(_0x49a955,_0x50b610){return _0x1e74(_0x49a955- -0x59,_0x50b610);}try{const _0x4d7f4b=new URLSearchParams();_0x401668?.[_0x37e201(0x199,0x19e)]&&_0x4d7f4b['append']('period',_0x401668[_0x37e201(0x199,0x17e)]);const _0x487202='/functions/v1/'+_0x49e32e+'/metrics'+(_0x4d7f4b[_0x37e201(0x1a0,0x222)]()?'?'+_0x4d7f4b['toString']():''),response=await this[_0x37e201(0x244,0x1ff)]['get'](_0x487202);return{'data':response[_0x37e201(0x22b,0x258)],'error':null};}catch(_0x262438){return{'data':null,'error':_0x262438 instanceof EBaaSError?_0x262438:new EBaaSError(_0x262438 instanceof Error?_0x262438[_0x37e201(0x1fa,0x1ae)]:_0x37e201(0x1b9,0x169),0x0,_0x262438)};}}}class EBaaSClient{constructor(_0x2bd860,_0x5ac3c1,_0x410d79){this[_0x2759a4(0x42c,0x444)]=_0x410d79,this['httpClient']=new HttpClient({'url':_0x2bd860,'apiKey':_0x5ac3c1,'timeout':0x7530,'headers':_0x410d79?.['global']?.[_0x2759a4(0x404,0x428)]}),this[_0x2759a4(0x42d,0x489)]=new AuthClient(this[_0x2759a4(0x45f,0x49c)],_0x410d79?.['database']?.[_0x2759a4(0x516,0x4c9)]),this[_0x2759a4(0x3f3,0x456)]=new DatabaseClient(this['httpClient'],_0x410d79?.['database']?.[_0x2759a4(0x546,0x4c9)]),this['storage']=new StorageClient(this['httpClient']);function _0x2759a4(_0x23cadf,_0x14623e){return _0x1e74(_0x14623e-0x1ff,_0x23cadf);}this[_0x2759a4(0x38f,0x3d8)]=new RealtimeClient(_0x2bd860,_0x5ac3c1,_0x410d79?.[_0x2759a4(0x3a6,0x3d8)]),this['functions']=new FunctionsClient(this[_0x2759a4(0x47c,0x49c)]),this['initializeCustomDatabase']();}['from'](_0x4d73a4){function _0xcc23b2(_0x2953f8,_0x178c45){return _0x1e74(_0x178c45-0x1b3,_0x2953f8);}return this[_0xcc23b2(0x42f,0x40a)][_0xcc23b2(0x469,0x3e7)](_0x4d73a4);}[_0x380dd0(-0x60,-0xe2)](_0x3a45d0,_0x2d5682){function _0x1728d8(_0xc8d7ff,_0x1591ab){return _0x1e74(_0x1591ab-0xc1,_0xc8d7ff);}return this['database'][_0x1728d8(0x31c,0x31f)](_0x3a45d0,_0x2d5682);}[_0x380dd0(-0xdf,-0xd1)](_0x14b74c){function _0x3e6608(_0x563f61,_0x4adb5c){return _0x1e74(_0x563f61-0xc6,_0x4adb5c);}return this['storage'][_0x3e6608(0x2fa,0x2c0)](_0x14b74c);}['channel'](_0x438c0c){function _0x523d04(_0x291967,_0x37e2e2){return _0x1e74(_0x37e2e2-0x14,_0x291967);}return this[_0x523d04(0x174,0x1ed)][_0x523d04(0x2f0,0x290)](_0x438c0c);}['invoke'](_0x32662e,_0x41c7d2){return this['functions']['invoke'](_0x32662e,_0x41c7d2);}async[_0x380dd0(-0xbc,-0x79)](){function _0x42fae6(_0x2ac057,_0x2a6242){return _0x1e74(_0x2a6242- -0x25d,_0x2ac057);}if(this[_0x42fae6(-0xa,-0x18)]?.['database']?.['autoDetectCustomDatabase'])try{await this[_0x42fae6(-0x7c,-0x6)]['initialize']();}catch(_0x35c674){console['warn']('Failed to initialize custom database detection:',_0x35c674);}}async[_0x380dd0(-0x20,0x16)](_0xc135b1){function _0x53be49(_0x716094,_0x2c8b5f){return _0x1e74(_0x716094- -0x24a,_0x2c8b5f);}this['auth']['setWorkspaceId'](_0xc135b1),this[_0x53be49(0xd,-0x45)]['setWorkspaceId'](_0xc135b1),this['options']?.['database']?.['autoDetectCustomDatabase']&&await this[_0x53be49(0xd,0x60)]['initialize']();}async[_0x380dd0(-0x5c,-0x7f)](_0x17a54f){function _0x5bcb43(_0x8cbd1f,_0x362b8d){return _0x1e74(_0x8cbd1f-0x5f,_0x362b8d);}await this[_0x5bcb43(0x2b6,0x291)]['configureCustomDatabase'](_0x17a54f);}['getCustomDatabaseStatus'](){function _0x2ffb07(_0x40cf0c,_0x2e06ea){return _0x1e74(_0x40cf0c-0x1dd,_0x2e06ea);}return this['database'][_0x2ffb07(0x4a0,0x4d7)]();}}function createClient(_0x4ad928,_0x347026,_0x554284){return new EBaaSClient(_0x4ad928,_0x347026,_0x554284);}const version=_0x380dd0(-0x62,-0x62);exports[_0x380dd0(-0xc,0x20)]=AuthClient;function _0x380dd0(_0x3b5777,_0x578716){return _0x1e74(_0x3b5777- -0x2be,_0x578716);}exports['CustomDatabaseManager']=CustomDatabaseManager,exports[_0x380dd0(-0x8,-0x2e)]=DatabaseClient,exports[_0x380dd0(-0x87,-0x87)]=EBaaSClient,exports[_0x380dd0(-0xa4,-0x96)]=EBaaSError,exports[_0x380dd0(-0x26,-0x5)]=FunctionsClient,exports['HttpClient']=HttpClient,exports[_0x380dd0(-0xad,-0xa2)]=QueryBuilder,exports['RealtimeChannel']=RealtimeChannel,exports[_0x380dd0(-0x6,-0x39)]=RealtimeClient,exports['StorageBucket']=StorageBucket,exports['StorageClient']=StorageClient,exports[_0x380dd0(0x10,-0x50)]=createClient,exports[_0x380dd0(-0x99,-0x39)]=version;