function _0x157e(_0x157e4f,_0x19ef30){const _0x2d1b67=_0x2e93();return _0x157e=function(_0x4f9309,_0x46b7cd){_0x4f9309=_0x4f9309-(0x1*0x6e6+0x205b+-0x266c);let _0x2f31a7=_0x2d1b67[_0x4f9309];return _0x2f31a7;},_0x157e(_0x157e4f,_0x19ef30);}(function(_0x4e4884,_0x3bf85a){const _0x43d59b={_0x1f63ca:0x12f,_0x2d26ae:0x12f,_0x39d365:0x130,_0x5cb542:0x139,_0x40237a:0x130,_0x1290f2:0x73,_0x1a5826:0x7d,_0x13879c:0x71,_0x1005df:0x89,_0x14e95c:0x86,_0x5b7a84:0x13a,_0x2512c:0x13d,_0xda5ba1:0x134,_0x5454b4:0x13f,_0x4d8436:0x13e,_0x387956:0x14d,_0x16fc0b:0x143,_0x2b6c97:0x9f,_0xa8327d:0x96,_0x2146a9:0x99,_0x18eaae:0xa0,_0xcb4f46:0x12e,_0x568741:0x139,_0x4bb7bc:0x136,_0x3de653:0x8c,_0x1c4921:0x90,_0x509ecf:0x124,_0x18513a:0x128,_0x538607:0x12a,_0x176b35:0x136,_0x5c5325:0x11f,_0x524e63:0x12d,_0x4e7e78:0x126},_0x5e25cb={_0x3f5ad3:0x5b},_0x3f1890=_0x4e4884();function _0x7c991d(_0x360a97,_0x58538a,_0xd2cd31,_0x157668){return _0x157e(_0x58538a- -_0x5e25cb._0x3f5ad3,_0x360a97);}function _0x255b32(_0x4afde1,_0x301318,_0x29104f,_0x1d13aa){return _0x157e(_0x301318-0x51,_0x1d13aa);}while(!![]){try{const _0x1c6fc2=parseInt(_0x255b32(_0x43d59b._0x1f63ca,0x12e,0x13a,0x128))/(-0x333+-0x1*0x1d77+-0x1*-0x20ab)*(-parseInt(_0x255b32(_0x43d59b._0x2d26ae,_0x43d59b._0x39d365,_0x43d59b._0x5cb542,_0x43d59b._0x40237a))/(-0x13ca+0x97*0x22+0x3*-0x16))+-parseInt(_0x7c991d(_0x43d59b._0x1290f2,_0x43d59b._0x1a5826,_0x43d59b._0x13879c,0x75))/(-0x1c4b+-0x1*-0x2245+-0x5f7)*(parseInt(_0x7c991d(_0x43d59b._0x1005df,_0x43d59b._0x14e95c,0x89,0x7e))/(0x225e+0x3e3*0x1+-0x263d))+-parseInt(_0x255b32(0x13c,_0x43d59b._0x5b7a84,_0x43d59b._0x2512c,_0x43d59b._0x2d26ae))/(0x11d6+-0x1170*0x2+0x110f*0x1)*(parseInt(_0x255b32(0x12f,_0x43d59b._0xda5ba1,0x140,0x12a))/(-0xcab+-0x5f*-0x17+-0x7*-0x98))+-parseInt(_0x255b32(_0x43d59b._0x5454b4,_0x43d59b._0x4d8436,_0x43d59b._0x387956,_0x43d59b._0x16fc0b))/(0xbdc+-0x1c6f+-0x2*-0x84d)+-parseInt(_0x7c991d(_0x43d59b._0x2b6c97,_0x43d59b._0xa8327d,_0x43d59b._0x2146a9,_0x43d59b._0x18eaae))/(0x497+-0x282+-0x20d)*(-parseInt(_0x255b32(_0x43d59b._0xcb4f46,_0x43d59b._0x568741,0x131,_0x43d59b._0x4bb7bc))/(-0x16d3*-0x1+0x4a8+0xdb9*-0x2))+parseInt(_0x7c991d(0x7f,_0x43d59b._0x3de653,_0x43d59b._0x1c4921,0x90))/(-0x2233+0x28f*0x5+0x1572)*(parseInt(_0x255b32(_0x43d59b._0x509ecf,_0x43d59b._0x18513a,_0x43d59b._0x538607,_0x43d59b._0x176b35))/(-0x1977+0x123d*0x1+0x1*0x745))+parseInt(_0x255b32(_0x43d59b._0x5c5325,_0x43d59b._0x524e63,_0x43d59b._0x4e7e78,0x135))/(-0x1d5d+-0xd*0x3f+0x209c);if(_0x1c6fc2===_0x3bf85a)break;else _0x3f1890['push'](_0x3f1890['shift']());}catch(_0x343ac2){_0x3f1890['push'](_0x3f1890['shift']());}}}(_0x2e93,0xad4ed+0x17e76+0x4*0xa8fd));const _0x13e1ce=(function(){let _0x589c97=!![];return function(_0x3ea695,_0x4e500d){const _0x433dc2={_0x1864fd:0x433},_0x4d0554=_0x589c97?function(){const _0x126b86={_0x188ba2:0x35d};function _0x5d990b(_0xa48466,_0x213c0d,_0x167b91,_0x3f3cd5){return _0x157e(_0x213c0d-_0x126b86._0x188ba2,_0x3f3cd5);}if(_0x4e500d){const _0x1db692=_0x4e500d[_0x5d990b(0x426,_0x433dc2._0x1864fd,0x43a,0x430)](_0x3ea695,arguments);return _0x4e500d=null,_0x1db692;}}:function(){};return _0x589c97=![],_0x4d0554;};}()),_0x32ce87=_0x13e1ce(this,function(){const _0x25b7a2={_0x413d8d:0x415,_0x1ac185:0x41c,_0x1468c9:0x414,_0x4d35fc:0x92,_0x518a23:0x98,_0x3564b1:0x8a,_0x438d9c:0xb3,_0x4f5069:0xa7,_0x35c450:0x98,_0x157206:0xa8,_0x229a03:0x416,_0x4baf4e:0x41f,_0x26b6f8:0x3fd,_0x52f186:0x3f5,_0x30e931:0x3fb,_0x412855:0x3ff,_0x3c2986:0xa2,_0x42939b:0xa0,_0xecc7b9:0x95},_0x2c2d48={_0x246c88:0x43},_0x54c148={_0x474e4c:0x324};function _0x1beec1(_0x11ffcc,_0x200ef1,_0x36288b,_0x1a7e79){return _0x157e(_0x1a7e79-_0x54c148._0x474e4c,_0x11ffcc);}function _0x2756d5(_0x3f9138,_0x4f4dd3,_0x564639,_0x58f44c){return _0x157e(_0x4f4dd3- -_0x2c2d48._0x246c88,_0x3f9138);}return _0x32ce87[_0x1beec1(_0x25b7a2._0x413d8d,_0x25b7a2._0x1ac185,_0x25b7a2._0x1468c9,0x40e)]()[_0x2756d5(_0x25b7a2._0x4d35fc,_0x25b7a2._0x518a23,0x9e,_0x25b7a2._0x3564b1)]('(((.+)+)+)'+'+$')[_0x2756d5(_0x25b7a2._0x438d9c,_0x25b7a2._0x4f5069,_0x25b7a2._0x35c450,_0x25b7a2._0x157206)]()[_0x1beec1(0x417,_0x25b7a2._0x229a03,_0x25b7a2._0x4baf4e,_0x25b7a2._0x229a03)+'r'](_0x32ce87)[_0x1beec1(_0x25b7a2._0x26b6f8,_0x25b7a2._0x52f186,_0x25b7a2._0x30e931,_0x25b7a2._0x412855)](_0x2756d5(0xa7,_0x25b7a2._0x3c2986,_0x25b7a2._0x42939b,_0x25b7a2._0xecc7b9)+'+$');});_0x32ce87();import{getChatMessagesApiPromise}from'../../../api/core';import{first,last}from'../../lib/array';import{MESSAGE_CATEGORIES}from'../chat.constant';import{getCoreEventCategoryName}from'../message';import{PORTION_SIZE_MAX,PORTION_SIZE_MIN,EMPTY_ARRAY}from'./loader.constants';export const createCtrlCtxRef=()=>{const _0x48f563={_0x47150b:0x65,_0x5f022c:0x61,_0x3d78b0:0x4c,_0x331d33:0x51,_0x48c3a2:0x43,_0x2b415c:0x4b,_0x1932e1:0x31,_0x4c99b8:0x36},_0x2e4bc9={_0x37eda4:0xb3},_0x464455={_0x1123cd:0x2e5,_0x45c025:0x2e5,_0x1e73ff:0x2ee};let _0x25388e=0x94f*0x1+-0x295*0x7+0x8c4,_0x20445d=()=>{};return{'callCount':0x0,'queries':[],'waitStart':async()=>{if(_0x25388e)return _0x25388e;return await new Promise(_0x43024c=>{_0x20445d=_0x43024c;}),_0x25388e;},'startQuery'(){const _0x415fe0={_0x2b747b:0x205};function _0x2ed272(_0x165cfe,_0x8c6263,_0x5be80a,_0x14b172){return _0x157e(_0x5be80a-_0x415fe0._0x2b747b,_0x8c6263);}!_0x25388e&&(_0x25388e=Date[_0x2ed272(_0x464455._0x1123cd,_0x464455._0x45c025,0x2eb,_0x464455._0x1e73ff)](),_0x20445d());},'doneQuery'(_0x240577){function _0x253bf8(_0x334533,_0x20b492,_0x169ffd,_0x1dc999){return _0x157e(_0x169ffd- -_0x2e4bc9._0x37eda4,_0x20b492);}this[_0x49afcb(_0x48f563._0x47150b,0x56,0x59,_0x48f563._0x5f022c)]+=-0x1065+-0x5*0x493+-0x9*-0x45d;function _0x49afcb(_0x226d47,_0x1d93c6,_0x46a9ea,_0x1c97c4){return _0x157e(_0x226d47- -0x89,_0x1c97c4);}this[_0x49afcb(_0x48f563._0x3d78b0,_0x48f563._0x331d33,_0x48f563._0x48c3a2,_0x48f563._0x2b415c)][this[_0x253bf8(_0x48f563._0x1932e1,0x47,0x3b,_0x48f563._0x4c99b8)]]=_0x240577;}};};const updateBeforeCounter=(_0x2aec44,_0x19a5e2)=>{const _0xbe7b92={_0x4c386a:0x181,_0x23d821:0x17a,_0x12b799:0x175,_0x25e0a7:0x179,_0x1fd558:0x7d,_0x367927:0x8e,_0xa4ded6:0x7f,_0x5efca1:0x181,_0x53626b:0x17c,_0x715131:0x182,_0x3e2d27:0x17e,_0x3e0fb8:0x94,_0x2169a6:0x89,_0x403a1:0x186,_0xbc2bfb:0x19e,_0x1c47a9:0x172,_0x58b67e:0x8d,_0x3437f8:0x8f},_0x35b0b8={_0x1c07c1:0x16f};function _0x56811f(_0x38a0d7,_0x1b0446,_0x45d094,_0x444caa){return _0x157e(_0x444caa- -_0x35b0b8._0x1c07c1,_0x38a0d7);}const {length:_0x1a21f4}=_0x2aec44;function _0x204e0c(_0x3161b3,_0x276ce6,_0x5cf4e9,_0x2ced3f){return _0x157e(_0x3161b3-0xa3,_0x2ced3f);}const _0x17e38c={..._0x19a5e2};for(let _0x3d94e3=0x17cb+0xebb+0x2686*-0x1;_0x3d94e3<_0x1a21f4;_0x3d94e3+=0x5*-0x191+-0x1048+0x181e){const _0x265496=_0x2aec44[_0x3d94e3],_0xa99efe=getCoreEventCategoryName(_0x265496);if(_0xa99efe===MESSAGE_CATEGORIES[_0x204e0c(_0xbe7b92._0x4c386a,_0xbe7b92._0x23d821,_0xbe7b92._0x12b799,_0xbe7b92._0x25e0a7)+'Y'])_0x17e38c[_0x56811f(-_0xbe7b92._0x1fd558,-_0xbe7b92._0x367927,-_0xbe7b92._0x367927,-_0xbe7b92._0xa4ded6)+'ry']===MESSAGE_CATEGORIES[_0x204e0c(_0xbe7b92._0x5efca1,_0xbe7b92._0x53626b,_0xbe7b92._0x715131,_0xbe7b92._0x3e2d27)+'Y']?_0x17e38c['count']+=-0x1579+0x16*-0x3d+-0x17c*-0x12:_0x17e38c[_0x56811f(-_0xbe7b92._0x3e0fb8,-_0xbe7b92._0x2169a6,-_0xbe7b92._0x367927,-0x8f)]+=-0x25fb+0x8e*0x22+-0x3b*-0x53;else _0x17e38c[_0x204e0c(0x193,0x189,_0xbe7b92._0x403a1,_0xbe7b92._0xbc2bfb)+'ry']!==_0xa99efe&&_0x17e38c['lastCatego'+'ry']!==MESSAGE_CATEGORIES[_0x204e0c(_0xbe7b92._0x5efca1,_0xbe7b92._0x1c47a9,_0xbe7b92._0x715131,0x187)+'Y']&&(_0x17e38c[_0x56811f(-0x96,-_0xbe7b92._0x58b67e,-_0xbe7b92._0x3e0fb8,-_0xbe7b92._0x3437f8)]+=0x272*0x2+-0x4*0x1a0+-0x19d*-0x1);_0x17e38c['lastCatego'+'ry']=_0xa99efe;}return _0x17e38c;};export const loadMsgsBefore=async({roomId:_0x4cc640,topSeq:_0x5321f5,topMsgCategory:_0x28de6c,expectedCount:_0x200534,ctxRef:_0x5e9e13})=>{const _0x3b3630={_0x5052a2:0x396,_0x20bde7:0x39e,_0x557e1c:0x394,_0x4b2035:0x3a3,_0x3c2497:0x395},_0x37155d={_0x377a36:0x2b2};function _0x404605(_0x2c98a6,_0x243826,_0x141197,_0x3105c3){return _0x157e(_0x243826- -0x24a,_0x3105c3);}let _0x243744,_0x36f25f=Math['max'](_0x200534,PORTION_SIZE_MIN),_0x361ec4={'count':0x0,'lastCategory':_0x28de6c},_0x411092=_0x5321f5,_0x5e91a8;function _0x5fb5f8(_0x33f246,_0x1d134c,_0x4aac03,_0x5317a5){return _0x157e(_0x1d134c-_0x37155d._0x377a36,_0x33f246);}do{_0x5e91a8=_0x411092-(-0x1*-0x2d5+0x22*-0x7f+0xe0a);if(_0x5e91a8<-0x243f+0x3*-0x843+0x8b8*0x7)break;_0x411092=Math[_0x5fb5f8(_0x3b3630._0x5052a2,_0x3b3630._0x20bde7,_0x3b3630._0x557e1c,_0x3b3630._0x4b2035)](_0x5e91a8-(_0x36f25f-(-0xe6e+0x1e42+-0xfd3)),0x2167*0x1+-0x1*0xa7f+-0x8*0x2dd),_0x5e9e13?.['startQuery']();const _0x8fb725=await getChatMessagesApiPromise(_0x4cc640,{'reverse':!![],'gte':_0x411092,'lte':_0x5e91a8});_0x5e9e13?.['doneQuery']({'gte':_0x411092,'lte':_0x5e91a8}),_0x361ec4=updateBeforeCounter(_0x8fb725,_0x361ec4),_0x243744=_0x243744?_0x243744['concat'](_0x8fb725):_0x8fb725,_0x36f25f=Math['min'](_0x36f25f+_0x36f25f,PORTION_SIZE_MAX);}while(_0x361ec4[_0x5fb5f8(0x38c,0x392,_0x3b3630._0x3c2497,0x39f)]<_0x200534);return _0x243744;};const updateAfterCounter=(_0x546848,_0x473e8c)=>{const _0x151d91={_0x2479b2:0x5,_0x4a90b6:0x9,_0x1083c2:0x8,_0x267cf:0x14,_0x1ef9c9:0x3bb,_0x20e5a2:0x3be,_0x404f70:0x3c9,_0x3c6563:0x2,_0x478347:0xf,_0x55af73:0x7,_0xff3cc6:0x0,_0x2af1d6:0x13,_0x479b66:0x7,_0x588feb:0x1,_0x48dd35:0x18,_0x185180:0x11,_0x45c83f:0x9,_0x466e22:0x4,_0x27c971:0x3a2,_0x41c13b:0x3ae,_0x489f9a:0x3a4,_0x312d76:0x3a1},_0x52be64={_0x54285e:0x2ce},_0xfa42ca={_0x3a4113:0xe7},{length:_0x2e975b}=_0x546848;function _0x6dbad9(_0x5a1299,_0x5aeb76,_0x1ee23d,_0x143d18){return _0x157e(_0x5aeb76- -_0xfa42ca._0x3a4113,_0x1ee23d);}const _0x4c4103={..._0x473e8c};function _0x8f3c52(_0x50d9c3,_0x2b2379,_0x50a59a,_0x224192){return _0x157e(_0x2b2379-_0x52be64._0x54285e,_0x50a59a);}for(let _0x2ae84e=_0x2e975b-(-0x1b00+-0x3ab*0x7+-0x16*-0x265);_0x2ae84e>=0x20e6+0x63d*0x2+-0x2d60;_0x2ae84e-=-0x1*-0x14f9+-0x11*-0x93+-0x1*0x1ebb){const _0x1a4f9f=_0x546848[_0x2ae84e],_0x1bbe6a=getCoreEventCategoryName(_0x1a4f9f);if(_0x1bbe6a===MESSAGE_CATEGORIES[_0x6dbad9(_0x151d91._0x2479b2,-_0x151d91._0x4a90b6,-_0x151d91._0x1083c2,-_0x151d91._0x267cf)+'Y'])_0x4c4103[_0x8f3c52(_0x151d91._0x1ef9c9,_0x151d91._0x20e5a2,0x3be,_0x151d91._0x404f70)+'ry']===MESSAGE_CATEGORIES[_0x6dbad9(-0x4,-0x9,_0x151d91._0x3c6563,-_0x151d91._0x478347)+'Y']?_0x4c4103[_0x6dbad9(_0x151d91._0x1083c2,-_0x151d91._0x55af73,_0x151d91._0xff3cc6,-_0x151d91._0x2af1d6)]+=-0x1cbd+-0xb64+-0x2822*-0x1:_0x4c4103[_0x6dbad9(_0x151d91._0x55af73,-_0x151d91._0x479b66,_0x151d91._0x588feb,-_0x151d91._0x267cf)]+=0x46*-0x56+0x3*0xbbb+-0xbab;else _0x4c4103[_0x6dbad9(_0x151d91._0x48dd35,_0x151d91._0x4a90b6,-0x6,_0x151d91._0x185180)+'ry']!==_0x1bbe6a&&_0x4c4103['lastCatego'+'ry']!==MESSAGE_CATEGORIES[_0x6dbad9(-0x2,-_0x151d91._0x45c83f,0x5,_0x151d91._0x466e22)+'Y']&&(_0x4c4103[_0x8f3c52(_0x151d91._0x27c971,_0x151d91._0x41c13b,_0x151d91._0x489f9a,_0x151d91._0x312d76)]+=-0x9*0x39f+0xc13*0x1+0x67*0x33);_0x4c4103['lastCatego'+'ry']=_0x1bbe6a;}return _0x4c4103;};export const loadMsgsAfter=async({roomId:_0x3f43d2,bottomSeq:_0x382b24,bottomMsgCategory:_0x13589b,expectedCount:_0x42f8f,count:_0x46557a,ctxRef:_0x17663c})=>{const _0x120161={_0x1ed449:0x1ac,_0x16d355:0x1a1,_0x422f65:0x1ac,_0x3cb70c:0x1a9,_0x520acf:0x1a4,_0x4da4f9:0x325,_0x11bd4a:0x32b,_0x4dc87e:0x331},_0x2202e8={_0x211121:0x24b};let _0x10f478,_0x5b80d2=Math['max'](_0x42f8f,PORTION_SIZE_MIN);const _0xcd78ae=_0x46557a-(-0x42b+0x1*0x1213+-0xde7);function _0x3ab897(_0x5322c7,_0x29326e,_0x7064ed,_0xff5da4){return _0x157e(_0x7064ed-_0x2202e8._0x211121,_0x29326e);}let _0x43adad={'count':0x0,'lastCategory':_0x13589b},_0x57154d,_0x59255b=_0x382b24;do{_0x57154d=_0x59255b+(-0xfb*0x6+-0x11ec+0x1*0x17cf);if(_0x57154d>_0xcd78ae)break;_0x59255b=Math[_0x1308e3(0x1a3,_0x120161._0x1ed449,_0x120161._0x16d355,0x193)](_0x57154d+(_0x5b80d2-(0x1c0c+0x11ea+-0xb5*0x41)),_0xcd78ae),_0x17663c?.['startQuery']();const _0x12fce8=await getChatMessagesApiPromise(_0x3f43d2,{'reverse':!![],'gte':_0x57154d,'lte':_0x59255b});_0x17663c?.['doneQuery']({'lte':_0x59255b,'gte':_0x57154d}),_0x43adad=updateAfterCounter(_0x12fce8,_0x43adad),_0x10f478=_0x10f478?_0x12fce8[_0x1308e3(_0x120161._0x422f65,_0x120161._0x3cb70c,0x1a9,_0x120161._0x520acf)](_0x10f478):_0x12fce8,_0x5b80d2=Math['min'](_0x5b80d2+_0x5b80d2,PORTION_SIZE_MAX);}while(_0x43adad[_0x3ab897(_0x120161._0x4da4f9,0x327,_0x120161._0x11bd4a,_0x120161._0x4dc87e)]<_0x42f8f);function _0x1308e3(_0x163521,_0x1ec17e,_0x3e6479,_0x312545){return _0x157e(_0x3e6479-0xc7,_0x1ec17e);}return _0x10f478;};const countEvents=_0x2a7d9f=>{const _0x383fab={_0x2941a2:0x4a5,_0x250a1b:0x4b3,_0x856c13:0x4b8},{length:_0x2fa50c}=_0x2a7d9f;let _0x4f7391=-0xb1e+0x62b+0x4f3,_0x43a321=MESSAGE_CATEGORIES[_0x20685f(0x4b0,_0x383fab._0x2941a2,_0x383fab._0x250a1b,_0x383fab._0x856c13)+'Y'];function _0x20685f(_0x48359b,_0x43fec6,_0x38ffb8,_0x3217ac){return _0x157e(_0x48359b-0x3d2,_0x43fec6);}for(let _0x3dff58=0x1401+-0x133e+-0xc3;_0x3dff58<_0x2fa50c;_0x3dff58+=-0x31f*0x2+-0x32+0x671*0x1){const _0x198ae9=_0x2a7d9f[_0x3dff58],_0x5596d5=getCoreEventCategoryName(_0x198ae9);(_0x5596d5===MESSAGE_CATEGORIES['NO_CATEGOR'+'Y']||_0x43a321!==_0x5596d5)&&(_0x4f7391+=0x361*0x4+0x61+0x2*-0x6f2),_0x43a321=_0x5596d5;}return _0x4f7391;};function _0x2e93(){const _0x3202c8=['NO_CATEGOR','1494212rCrCPh','count','236AjNSEL','concat','51774yamvpZ','seq','(((.+)+)+)','now','20QiUNXJ','36hAfTIC','1090RMmkcA','toString','startQuery','max','7575134IGSdap','callCount','length','lastCatego','3652976pkDfUC','constructo','queries','apply','5497899epReva','83937FYSVzF','doneQuery','min','search','51155688zaQlBi','2PEwAmm'];_0x2e93=function(){return _0x3202c8;};return _0x2e93();}export const loadInitial=async({roomId:_0x386945,gte:_0x38e123,lte:_0x382d46,count:_0x5d528c,ctxRef:_0x4593a7})=>{const _0x5aed88={_0x3f864c:0xe4,_0x104a9e:0xf2,_0x2e978f:0xe9,_0x4f95d0:0xfa,_0xb78121:0x1db,_0x1a2372:0x1ec,_0x2a7ada:0x1cb,_0x112ede:0x1e3,_0x2594d8:0x1d4,_0x5ae6a6:0xd8,_0x26e941:0xe5,_0x407611:0xeb,_0x526fb6:0xf1,_0x346964:0xf0,_0x3717f7:0xf4,_0x48e18a:0xf4,_0x994e59:0xe3,_0x539a0a:0xe5,_0x15659d:0xe4,_0x48f864:0x1da,_0x51018e:0x1d7,_0x7156f0:0xed,_0x3fbdb7:0x1e6,_0x2f2411:0x1e0,_0x131cd4:0x1e1},_0x131e21={_0x1d606e:0x2c3},_0x18d0fa={_0x52773e:0x7};_0x4593a7?.[_0x269cdd(_0x5aed88._0x3f864c,_0x5aed88._0x104a9e,_0x5aed88._0x2e978f,_0x5aed88._0x4f95d0)]();let _0x51d9f3=await getChatMessagesApiPromise(_0x386945,{'reverse':!![],'gte':_0x38e123,'lte':_0x382d46});_0x4593a7?.[_0x1c6f36(-0x1f7,-_0x5aed88._0xb78121,-_0x5aed88._0x1a2372,-0x1ea)]({'gte':_0x38e123,'lte':_0x382d46});if(!_0x51d9f3[_0x1c6f36(-_0x5aed88._0x2a7ada,-0x1c6,-_0x5aed88._0x112ede,-_0x5aed88._0x2594d8)])return EMPTY_ARRAY;const _0x2e674b=_0x382d46-_0x38e123+(-0x1c5*0x3+-0x1c*-0xd2+-0x11a8),_0x2cba38=countEvents(_0x51d9f3);function _0x269cdd(_0x5e47ae,_0x2322ba,_0x1e041b,_0x1ba0c1){return _0x157e(_0x2322ba-_0x18d0fa._0x52773e,_0x1ba0c1);}function _0x1c6f36(_0x1bb0c7,_0x137fdc,_0xd644ec,_0x1fcbf4){return _0x157e(_0x1fcbf4- -_0x131e21._0x1d606e,_0xd644ec);}const _0x2f26a7=last(_0x51d9f3),_0x5ea965=getCoreEventCategoryName(_0x2f26a7),_0x3850bb=first(_0x51d9f3),_0x4ee386=getCoreEventCategoryName(_0x3850bb);if(_0x4ee386!==MESSAGE_CATEGORIES[_0x269cdd(_0x5aed88._0x5ae6a6,_0x5aed88._0x26e941,0xed,0xee)+'Y']||_0x2cba38<_0x2e674b){const _0x154129=await loadMsgsAfter({'roomId':_0x386945,'bottomSeq':_0x3850bb[_0x269cdd(0xe0,_0x5aed88._0x407611,_0x5aed88._0x526fb6,_0x5aed88._0x346964)],'bottomMsgCategory':_0x4ee386,'expectedCount':0x1,'count':_0x5d528c,'ctxRef':_0x4593a7});_0x51d9f3=_0x154129?_0x154129[_0x269cdd(_0x5aed88._0x3717f7,0xe9,_0x5aed88._0x48e18a,0xf2)](_0x51d9f3):_0x51d9f3;}if(_0x5ea965!==MESSAGE_CATEGORIES[_0x269cdd(_0x5aed88._0x994e59,_0x5aed88._0x539a0a,_0x5aed88._0x104a9e,_0x5aed88._0x15659d)+'Y']){const _0x4833d2=Math[_0x1c6f36(-_0x5aed88._0xb78121,-0x1ca,-_0x5aed88._0x48f864,-_0x5aed88._0x51018e)](_0x2e674b-_0x2cba38,0x231*-0x1+0x2125+-0x1ef3),_0x468192=await loadMsgsBefore({'roomId':_0x386945,'topSeq':_0x2f26a7[_0x269cdd(_0x5aed88._0x7156f0,_0x5aed88._0x407611,0xe9,_0x5aed88._0x15659d)],'topMsgCategory':_0x5ea965,'expectedCount':_0x4833d2,'ctxRef':_0x4593a7});_0x51d9f3=_0x468192?_0x51d9f3[_0x1c6f36(-_0x5aed88._0x3fbdb7,-_0x5aed88._0x2f2411,-0x1d5,-_0x5aed88._0x131cd4)](_0x468192):_0x51d9f3;}return _0x51d9f3;};