','编辑内容排除规则','\x0a--------------------\x0aAPI端点:\x20','hly-hist-select-entry','未能获取到任何模型。','placeholder','depth_role','宝库已清空。','toFixed','is-user','model','queryMessageCount','通行令牌\x20(API\x20Key):','收到手动录入请求,文本长度:\x20','[翰林院-枢纽]\x20手动录入过程发生错误:','获取模型失败:\x20','notify','\x20个书库。','is_user','
','finalText','hanlinyuan-ingest-abort','testApiConnection','[翰林院-枢纽]\x20获取模型列表失败:'];_0x266d=function(){return _0x33d708;};return _0x266d();}function bindInternalUIEvents(){const _0x5577cd=_0x58cad7,_0x3e5a21=document[_0x5577cd(0x220)](_0x5577cd(0x244));_0x3e5a21[_0x5577cd(0x29c)](_0x41dfc9=>{const _0x2b673e=_0x5577cd;_0x41dfc9['addEventListener'](_0x2b673e(0x19e),()=>{const _0x2aa05a=_0x2b673e,_0x5a050e=_0x41dfc9[_0x2aa05a(0x2b4)][_0x2aa05a(0x1ae)],_0x52884c=_0x2aa05a(0x2d4)+_0x5a050e+_0x2aa05a(0x256);document['querySelectorAll'](_0x2aa05a(0x279))[_0x2aa05a(0x29c)](_0x3d0814=>{const _0x4f9712=_0x2aa05a;_0x3d0814[_0x4f9712(0x2eb)][_0x4f9712(0x28a)](_0x4f9712(0x1a9),_0x3d0814['id']===_0x52884c);}),_0x3e5a21[_0x2aa05a(0x29c)](_0x46c435=>_0x46c435[_0x2aa05a(0x2eb)][_0x2aa05a(0x28a)](_0x2aa05a(0x1a9),_0x46c435===_0x41dfc9));});});const _0x33877e=document[_0x5577cd(0x216)](_0x5577cd(0x236));_0x33877e&&_0x33877e[_0x5577cd(0x29e)](_0x5577cd(0x2e2),handleApiModeChange);const _0x27919d=document[_0x5577cd(0x220)](_0x5577cd(0x1a6));_0x27919d['forEach'](_0x2a0b7e=>{const _0x55ae0b=_0x5577cd;_0x2a0b7e[_0x55ae0b(0x29e)]('change',toggleInjectionDetails);});const _0xaac09=document['getElementById'](_0x5577cd(0x2f4)),_0x2c36e9=document[_0x5577cd(0x216)](_0x5577cd(0x2bd));_0xaac09&&_0x2c36e9&&_0xaac09['addEventListener'](_0x5577cd(0x2e2),()=>{const _0x34c551=_0x5577cd;_0x2c36e9[_0x34c551(0x18b)][_0x34c551(0x1b2)]=_0xaac09['checked']?'block':_0x34c551(0x1a5);});const _0x8fb700=document[_0x5577cd(0x216)](_0x5577cd(0x1eb));_0x8fb700&&_0x8fb700[_0x5577cd(0x29e)]('change',handleWorldbookSelectionChange);const _0x5eff93=document[_0x5577cd(0x216)](_0x5577cd(0x27b));_0x5eff93&&_0x5eff93[_0x5577cd(0x29e)](_0x5577cd(0x19e),showExclusionRulesModal);}function toggleInjectionDetails(){const _0x4c864e=_0x58cad7,_0x56b317=document[_0x4c864e(0x21c)](_0x4c864e(0x285))['value'],_0x3cb05b=document[_0x4c864e(0x216)](_0x4c864e(0x2bb)),_0x20c0cd=document[_0x4c864e(0x216)](_0x4c864e(0x234)),_0xb38109=_0x56b317==='1';_0x3cb05b[_0x4c864e(0x1d2)]=!_0xb38109,_0x20c0cd[_0x4c864e(0x1d2)]=!_0xb38109;}function handleApiModeChange(){const _0x37104b=_0x58cad7,_0x4708d8=document[_0x37104b(0x216)](_0x37104b(0x236))[_0x37104b(0x241)],_0x3ebb7e=document[_0x37104b(0x216)](_0x37104b(0x1be)),_0x158150=document[_0x37104b(0x216)](_0x37104b(0x282)),_0x326818=document[_0x37104b(0x216)]('hly-embedding-model'),_0xe1b2f7=_0x326818[_0x37104b(0x276)];if(!_0x3ebb7e||!_0x158150)return;_0x3ebb7e['style']['display']=_0x37104b(0x267),_0x158150['style'][_0x37104b(0x1b2)]=_0x37104b(0x267);switch(_0x4708d8){case'google_direct':_0x3ebb7e['style'][_0x37104b(0x1b2)]=_0x37104b(0x1a5),_0x158150[_0x37104b(0x21c)]('label')[_0x37104b(0x298)]=_0x37104b(0x1c8),_0x158150[_0x37104b(0x21c)](_0x37104b(0x187))['placeholder']=_0x37104b(0x2c3);break;case _0x37104b(0x2b7):_0x3ebb7e[_0x37104b(0x21c)](_0x37104b(0x18a))['textContent']=_0x37104b(0x2e1),_0x3ebb7e[_0x37104b(0x21c)](_0x37104b(0x187))[_0x37104b(0x200)]=_0x37104b(0x19c),_0x158150[_0x37104b(0x18b)][_0x37104b(0x1b2)]=_0x37104b(0x1a5);break;case _0x37104b(0x238):default:_0x3ebb7e[_0x37104b(0x21c)](_0x37104b(0x18a))[_0x37104b(0x298)]='自定义路径:',_0x3ebb7e[_0x37104b(0x21c)]('input')[_0x37104b(0x200)]=_0x37104b(0x1ba),_0x158150[_0x37104b(0x21c)](_0x37104b(0x18a))['textContent']=_0x37104b(0x207);break;}}function loadSettingsToUI(){const _0xbb2cc6=_0x58cad7,_0x3b2f59=_0x3c94ac['getSettings']();if(!_0x3b2f59)return;document[_0xbb2cc6(0x216)]('hly-retrieval-enabled')[_0xbb2cc6(0x1df)]=_0x3b2f59[_0xbb2cc6(0x22c)]['enabled'],document[_0xbb2cc6(0x216)](_0xbb2cc6(0x236))[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x22c)]['apiEndpoint'],document[_0xbb2cc6(0x216)]('hly-custom-api-url')[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x22c)][_0xbb2cc6(0x295)],document[_0xbb2cc6(0x216)](_0xbb2cc6(0x2db))[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x22c)][_0xbb2cc6(0x28f)];const _0x8f846d=document[_0xbb2cc6(0x216)](_0xbb2cc6(0x26f));if(_0x8f846d['options'][_0xbb2cc6(0x1f8)]===0x0){const _0x1eed69=_0x3b2f59['retrieval'][_0xbb2cc6(0x23e)],_0x305ab7=new Option(_0x1eed69,_0x1eed69,!![],!![]);_0x8f846d[_0xbb2cc6(0x222)](_0x305ab7);}_0x8f846d[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x22c)]['embeddingModel'],document[_0xbb2cc6(0x216)](_0xbb2cc6(0x2c7))[_0xbb2cc6(0x1df)]=_0x3b2f59[_0xbb2cc6(0x22c)]['notify'],document['getElementById'](_0xbb2cc6(0x24f))[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x197)][_0xbb2cc6(0x22b)],document[_0xbb2cc6(0x216)]('hly-overlap-size')[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x197)][_0xbb2cc6(0x23f)],document['getElementById'](_0xbb2cc6(0x2b9))[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x197)][_0xbb2cc6(0x2a3)],document[_0xbb2cc6(0x216)]('hly-query-message-count')[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x197)][_0xbb2cc6(0x206)],document['getElementById']('hly-max-results')[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x197)]['maxResults'],document['getElementById']('hly-batch-size')[_0xbb2cc6(0x241)]=_0x3b2f59['retrieval'][_0xbb2cc6(0x1cf)],document[_0xbb2cc6(0x216)](_0xbb2cc6(0x2b3))[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x195)]['template'];const _0x3ab4ef=document['querySelector'](_0xbb2cc6(0x2b6)+_0x3b2f59[_0xbb2cc6(0x195)][_0xbb2cc6(0x2d3)]+'\x22]');_0x3ab4ef&&(_0x3ab4ef[_0xbb2cc6(0x1df)]=!![]);document['getElementById']('hly-injection-depth')[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x195)][_0xbb2cc6(0x1ee)],document[_0xbb2cc6(0x216)]('hly-injection-role')[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x195)][_0xbb2cc6(0x201)],toggleInjectionDetails(),handleApiModeChange(),document['getElementById'](_0xbb2cc6(0x1b1))[_0xbb2cc6(0x1df)]=_0x3b2f59['condensation'][_0xbb2cc6(0x26c)],document[_0xbb2cc6(0x216)](_0xbb2cc6(0x248))[_0xbb2cc6(0x241)]=_0x3b2f59['condensation'][_0xbb2cc6(0x265)],document[_0xbb2cc6(0x216)](_0xbb2cc6(0x1cc))[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x25d)][_0xbb2cc6(0x1e4)],document[_0xbb2cc6(0x216)](_0xbb2cc6(0x262))[_0xbb2cc6(0x1df)]=_0x3b2f59[_0xbb2cc6(0x25d)][_0xbb2cc6(0x226)][_0xbb2cc6(0x19d)],document[_0xbb2cc6(0x216)](_0xbb2cc6(0x19b))[_0xbb2cc6(0x1df)]=_0x3b2f59[_0xbb2cc6(0x25d)][_0xbb2cc6(0x226)]['ai'];const _0x3a0332=document[_0xbb2cc6(0x216)](_0xbb2cc6(0x2f4)),_0x5496ed=document[_0xbb2cc6(0x216)]('hly-tag-input'),_0x4fc449=document[_0xbb2cc6(0x216)](_0xbb2cc6(0x2bd));_0x3a0332[_0xbb2cc6(0x1df)]=_0x3b2f59[_0xbb2cc6(0x25d)][_0xbb2cc6(0x28d)],_0x5496ed[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x25d)]['tags'],_0x4fc449[_0xbb2cc6(0x18b)]['display']=_0x3a0332['checked']?_0xbb2cc6(0x267):_0xbb2cc6(0x1a5),document[_0xbb2cc6(0x216)](_0xbb2cc6(0x1e5))['checked']=_0x3b2f59[_0xbb2cc6(0x1f1)][_0xbb2cc6(0x26c)],document['getElementById'](_0xbb2cc6(0x239))[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x1f1)][_0xbb2cc6(0x1d1)],document[_0xbb2cc6(0x216)](_0xbb2cc6(0x1a3))[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x1f1)]['apiKey'];const _0x412f43=document[_0xbb2cc6(0x216)](_0xbb2cc6(0x25f));if(_0x412f43[_0xbb2cc6(0x2e4)][_0xbb2cc6(0x1f8)]===0x0){const _0x1ea67a=_0x3b2f59[_0xbb2cc6(0x1f1)][_0xbb2cc6(0x205)];if(_0x1ea67a){const _0x47de37=new Option(_0x1ea67a,_0x1ea67a,!![],!![]);_0x412f43['add'](_0x47de37);}}_0x412f43[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x1f1)]['model'],document['getElementById'](_0xbb2cc6(0x219))[_0xbb2cc6(0x241)]=_0x3b2f59[_0xbb2cc6(0x1f1)][_0xbb2cc6(0x293)],document[_0xbb2cc6(0x216)](_0xbb2cc6(0x2cf))['value']=_0x3b2f59[_0xbb2cc6(0x1f1)]['hybrid_alpha'],document[_0xbb2cc6(0x216)](_0xbb2cc6(0x1ec))[_0xbb2cc6(0x1df)]=_0x3b2f59[_0xbb2cc6(0x1f1)][_0xbb2cc6(0x20b)];}function saveSettingsFromUI(_0x1a3f5d=!![]){const _0x30acba=_0x58cad7,_0x435837=document[_0x30acba(0x216)](_0x30acba(0x2c5));if(!_0x435837)return;const _0x494e82=_0x435837[_0x30acba(0x220)](_0x30acba(0x289));_0x494e82['forEach'](_0x2a0146=>{const _0xffc66e=_0x30acba,_0xcb934d=_0x2a0146[_0xffc66e(0x2b4)]['settingKey'];if(!_0xcb934d)return;let _0x571d9b;const _0x39f783=_0x2a0146[_0xffc66e(0x2b4)][_0xffc66e(0x2d8)]||'string';if(_0x2a0146[_0xffc66e(0x2d8)]==='checkbox')_0x571d9b=_0x2a0146[_0xffc66e(0x1df)];else{if(_0x2a0146[_0xffc66e(0x2d8)]===_0xffc66e(0x29d)){if(!_0x2a0146[_0xffc66e(0x1df)])return;_0x571d9b=_0x2a0146['value'];}else _0x571d9b=_0x2a0146[_0xffc66e(0x241)];}switch(_0x39f783){case _0xffc66e(0x1b9):_0x571d9b=parseInt(_0x571d9b,0xa);break;case _0xffc66e(0x1b7):_0x571d9b=parseFloat(_0x571d9b);break;case _0xffc66e(0x2c9):if(typeof _0x571d9b!==_0xffc66e(0x2c9))_0x571d9b=_0x571d9b===_0xffc66e(0x269);break;}const _0xe33c9b=_0x3c94ac[_0xffc66e(0x263)](),_0x52fb65=_0xcb934d['split']('.');let _0x228427=_0xe33c9b;for(let _0x69db1c=0x0;_0x69db1c<_0x52fb65[_0xffc66e(0x1f8)]-0x1;_0x69db1c++){_0x228427=_0x228427[_0x52fb65[_0x69db1c]]=_0x228427[_0x52fb65[_0x69db1c]]||{};}_0x228427[_0x52fb65[_0x52fb65['length']-0x1]]=_0x571d9b;}),_0x3c94ac[_0x30acba(0x290)](),!_0x1a3f5d&&(log(_0x30acba(0x1cb),_0x30acba(0x233)),toastr[_0x30acba(0x233)]('翰林院设定已存档封印。',_0x30acba(0x26e)));}function resetSettingsToUI(){const _0x3c07af=_0x58cad7;confirm(_0x3c07af(0x221))&&(_0x3c94ac['resetSettings'](),loadSettingsToUI(),toastr[_0x3c07af(0x2a9)](_0x3c07af(0x2bf),'诏曰'));}async function updatePanelStatus(){const _0x1830cb=_0x58cad7,_0x3c315d=_0x3c94ac[_0x1830cb(0x2ea)](),_0x419d2c=document[_0x1830cb(0x216)]('hly-current-character-name'),_0x48f741=document[_0x1830cb(0x216)](_0x1830cb(0x27e));if(_0x3c315d){const _0x45f5b7=_0x3c94ac[_0x1830cb(0x22d)]();_0x45f5b7&&(_0x419d2c['textContent']=_0x1830cb(0x277),_0x48f741[_0x1830cb(0x298)]=_0x45f5b7['id'],_0x48f741[_0x1830cb(0x231)]=_0x1830cb(0x1b4)+_0x45f5b7['id'],_0x419d2c[_0x1830cb(0x2eb)]['add'](_0x1830cb(0x27d)),_0x48f741[_0x1830cb(0x2eb)][_0x1830cb(0x222)](_0x1830cb(0x27d)));}else _0x419d2c['textContent']=_0x204fb4['getCharacterName'](),_0x48f741[_0x1830cb(0x298)]=_0x204fb4[_0x1830cb(0x264)]()||'无',_0x48f741[_0x1830cb(0x231)]='',_0x419d2c[_0x1830cb(0x2eb)][_0x1830cb(0x192)](_0x1830cb(0x27d)),_0x48f741[_0x1830cb(0x2eb)]['remove'](_0x1830cb(0x27d));const _0x201083=document[_0x1830cb(0x216)](_0x1830cb(0x2ba));_0x201083[_0x1830cb(0x298)]=_0x1830cb(0x1c1);try{const _0x42bddb=await _0x3c94ac[_0x1830cb(0x21d)]();_0x201083['textContent']=_0x42bddb;}catch(_0x4ed56e){console[_0x1830cb(0x2d2)](_0x1830cb(0x272),_0x4ed56e),_0x201083['textContent']=_0x1830cb(0x2b0),_0x201083[_0x1830cb(0x231)]=_0x1830cb(0x1d3)+_0x4ed56e[_0x1830cb(0x2bc)];}const _0x19d7f2=document[_0x1830cb(0x216)](_0x1830cb(0x2c8));if(_0x19d7f2&&!_0x19d7f2[_0x1830cb(0x2b4)][_0x1830cb(0x20f)]){const _0x584b8c=_0x3c94ac[_0x1830cb(0x263)](),_0x341c8d=await _0x3c94ac[_0x1830cb(0x2a4)]();if(_0x584b8c[_0x1830cb(0x280)]&&_0x584b8c[_0x1830cb(0x280)][_0x341c8d]){const _0x30ae40=_0x584b8c[_0x1830cb(0x280)][_0x341c8d];_0x19d7f2[_0x1830cb(0x2c1)]=_0x1830cb(0x28e)+_0x30ae40['start']+_0x1830cb(0x2e0)+_0x30ae40[_0x1830cb(0x2e3)]+_0x1830cb(0x1bf);}else _0x19d7f2[_0x1830cb(0x2c1)]=_0x1830cb(0x224);}}async function testApi(){const _0x94c461=_0x58cad7;toastr[_0x94c461(0x2a9)](_0x94c461(0x1ce),'圣旨');try{await _0x3c94ac[_0x94c461(0x211)](),toastr[_0x94c461(0x233)](_0x94c461(0x2c6),'圣意');}catch(_0x410c02){toastr[_0x94c461(0x2d2)]('神力连接失败:\x20'+_0x410c02['message'],'警报');}}function _0x15ab(_0x4a9572,_0x484b26){const _0x266df8=_0x266d();return _0x15ab=function(_0x15ab4d,_0x4d9b33){_0x15ab4d=_0x15ab4d-0x182;let _0x28b947=_0x266df8[_0x15ab4d];return _0x28b947;},_0x15ab(_0x4a9572,_0x484b26);}async function fetchHLYEmbeddingModels(){const _0xa6e736=_0x58cad7,_0x38c6d0=document[_0xa6e736(0x216)](_0xa6e736(0x26f)),_0x29074f=_0x38c6d0[_0xa6e736(0x241)];_0x38c6d0[_0xa6e736(0x2c1)]=_0xa6e736(0x240),_0x38c6d0[_0xa6e736(0x1d2)]=!![];try{log(_0xa6e736(0x2a0),'info');const _0x4bb05c=await _0x3c94ac[_0xa6e736(0x1ca)]();_0x38c6d0['innerHTML']='';if(_0x4bb05c['length']===0x0){_0x38c6d0[_0xa6e736(0x2c1)]=_0xa6e736(0x2d9),toastr['warn'](_0xa6e736(0x1ff),'翰林院启奏'),log(_0xa6e736(0x1ff),_0xa6e736(0x1c5));return;}_0x4bb05c[_0xa6e736(0x29c)](_0x2a7d87=>{const _0x3d825b=new Option(_0x2a7d87,_0x2a7d87);_0x38c6d0['add'](_0x3d825b);}),_0x4bb05c[_0xa6e736(0x1d0)](_0x29074f)?_0x38c6d0[_0xa6e736(0x241)]=_0x29074f:_0x38c6d0['selectedIndex']=0x0,toastr['success'](_0xa6e736(0x1db)+_0x4bb05c['length']+'\x20个模型。','圣意'),log(_0xa6e736(0x1db)+_0x4bb05c[_0xa6e736(0x1f8)]+_0xa6e736(0x1cd),_0xa6e736(0x233));}catch(_0x5370ef){console['error'](_0xa6e736(0x212),_0x5370ef),toastr[_0xa6e736(0x2d2)](_0xa6e736(0x20a)+_0x5370ef['message'],_0xa6e736(0x1f9)),log(_0xa6e736(0x20a)+_0x5370ef['message'],_0xa6e736(0x2d2)),_0x38c6d0['innerHTML']=_0xa6e736(0x2f3);}finally{_0x38c6d0['disabled']=![];}}async function fetchHLYRerankModels(){const _0x5903bc=_0x58cad7,_0x37e4e0=document[_0x5903bc(0x216)](_0x5903bc(0x25f)),_0x358a97=_0x37e4e0[_0x5903bc(0x241)];_0x37e4e0[_0x5903bc(0x2c1)]='
',_0x37e4e0[_0x5903bc(0x1d2)]=!![];try{log('开始获取Rerank模型列表...','info');const _0x49e092=await _0x3c94ac['fetchRerankModels']();_0x37e4e0['innerHTML']='';if(_0x49e092[_0x5903bc(0x1f8)]===0x0){_0x37e4e0[_0x5903bc(0x2c1)]=_0x5903bc(0x2d9),toastr[_0x5903bc(0x1c5)]('未能获取到任何Rerank模型。',_0x5903bc(0x27c)),log(_0x5903bc(0x1bc),'warn');return;}_0x49e092[_0x5903bc(0x29c)](_0x123b99=>{const _0x466492=_0x5903bc,_0x52c679=new Option(_0x123b99,_0x123b99);_0x37e4e0[_0x466492(0x222)](_0x52c679);}),_0x49e092[_0x5903bc(0x1d0)](_0x358a97)?_0x37e4e0[_0x5903bc(0x241)]=_0x358a97:_0x37e4e0[_0x5903bc(0x2c4)]=0x0,toastr['success'](_0x5903bc(0x1db)+_0x49e092[_0x5903bc(0x1f8)]+_0x5903bc(0x24b),'圣意'),log('成功获取\x20'+_0x49e092['length']+_0x5903bc(0x24b),_0x5903bc(0x233));}catch(_0x563e15){console[_0x5903bc(0x2d2)]('[翰林院-枢纽]\x20获取Rerank模型列表失败:',_0x563e15),toastr[_0x5903bc(0x2d2)](_0x5903bc(0x1a4)+_0x563e15[_0x5903bc(0x2bc)],_0x5903bc(0x1f9)),log(_0x5903bc(0x1a4)+_0x563e15[_0x5903bc(0x2bc)],'error'),_0x37e4e0[_0x5903bc(0x2c1)]='
';}finally{_0x37e4e0['disabled']=![];}}async function purgeStorage(){const _0x793767=_0x58cad7;if(confirm(_0x793767(0x275))){toastr[_0x793767(0x2a9)](_0x793767(0x1c7),'圣旨');const _0xd13f89=await _0x3c94ac[_0x793767(0x1e7)]();_0xd13f89?toastr[_0x793767(0x233)](_0x793767(0x202),'圣意'):toastr[_0x793767(0x2d2)]('清空宝库失败。','警报'),await updatePanelStatus();}}async function startCondensation(){const _0x57092c=_0x58cad7,_0x4d442c=document['getElementById'](_0x57092c(0x2c8)),_0x38149e=_0x4d442c[_0x57092c(0x2b4)]['finalMessages'],_0x53dc9d=document[_0x57092c(0x216)](_0x57092c(0x248))[_0x57092c(0x241)],_0x1c78bf=document[_0x57092c(0x216)](_0x57092c(0x1cc))['value'],_0x16aa93={'start':parseInt(_0x53dc9d),'end':parseInt(_0x1c78bf)};try{let _0x475196;_0x38149e?(log('检测到预览后待处理的消息对象,开始精确凝识...','info'),toastr[_0x57092c(0x2a9)]('正在处理您确认后的文书...','圣旨'),_0x475196=JSON['parse'](_0x38149e),delete _0x4d442c[_0x57092c(0x2b4)][_0x57092c(0x2ef)]):(log('未检测到预览文本,按标准流程采集消息...','info'),toastr['info'](_0x57092c(0x21f),'圣旨'),_0x475196=_0x3c94ac[_0x57092c(0x2aa)]());if(!_0x475196||_0x475196['length']===0x0){toastr['warning']('未找到符合条件的消息可供凝识。',_0x57092c(0x27c)),_0x4d442c[_0x57092c(0x298)]=_0x57092c(0x1f6);return;}_0x4d442c[_0x57092c(0x298)]=_0x57092c(0x292)+_0x475196[_0x57092c(0x1f8)]+'\x20条消息,开始凝识...',toastr[_0x57092c(0x2a9)](_0x57092c(0x292)+_0x475196[_0x57092c(0x1f8)]+'\x20条消息,开始凝识...','翰林院启奏');const _0x315703=await _0x3c94ac[_0x57092c(0x1e1)](_0x475196,log,_0x16aa93);if(_0x315703[_0x57092c(0x233)]){toastr[_0x57092c(0x233)](_0x57092c(0x1c0)+_0x315703[_0x57092c(0x296)]+_0x57092c(0x1de),'大功告成');const _0x10bbbe=_0x16aa93[_0x57092c(0x2e3)]===0x0?getContext()[_0x57092c(0x1f5)][_0x57092c(0x1f8)]:_0x16aa93['end'];_0x4d442c[_0x57092c(0x298)]='聊天记录从第\x20'+_0x16aa93[_0x57092c(0x1f3)]+'\x20楼到第\x20'+_0x10bbbe+_0x57092c(0x28b)+_0x315703[_0x57092c(0x296)]+_0x57092c(0x1de);}else throw new Error(_0x315703[_0x57092c(0x2d2)]||_0x57092c(0x2b2));}catch(_0x2c3822){console[_0x57092c(0x2d2)]('[翰林院-枢纽]\x20凝识过程发生错误:',_0x2c3822),toastr[_0x57092c(0x2d2)](_0x57092c(0x1e0)+_0x2c3822[_0x57092c(0x2bc)],_0x57092c(0x1f9)),_0x4d442c[_0x57092c(0x298)]=_0x57092c(0x1e0)+_0x2c3822['message'];}finally{await updatePanelStatus();}}async function loadWorldbookList(){const _0xee7fcb=_0x58cad7,_0x519d4b=document['getElementById'](_0xee7fcb(0x1eb));if(!_0x519d4b)return;try{log(_0xee7fcb(0x1d7),'info');const _0x2d8415=await _0xc72edd[_0xee7fcb(0x18f)]();_0x519d4b['innerHTML']=_0xee7fcb(0x2ec);if(_0x2d8415[_0xee7fcb(0x1f8)]===0x0){_0x519d4b['innerHTML']=_0xee7fcb(0x243);return;}_0x2d8415[_0xee7fcb(0x29c)](_0x7d4996=>{const _0x3738dc=_0xee7fcb,_0xe2467a=new Option(_0x7d4996,_0x7d4996);_0x519d4b[_0x3738dc(0x222)](_0xe2467a);}),log('成功加载\x20'+_0x2d8415[_0xee7fcb(0x1f8)]+_0xee7fcb(0x20c),'success');}catch(_0x304895){console[_0xee7fcb(0x2d2)](_0xee7fcb(0x278),_0x304895),log('加载书库列表失败:\x20'+_0x304895['message'],'error'),_0x519d4b['innerHTML']='
';}}async function handleWorldbookSelectionChange(){const _0xc7e911=_0x58cad7,_0x4ef7fc=document[_0xc7e911(0x216)](_0xc7e911(0x1eb)),_0x53e782=document[_0xc7e911(0x216)](_0xc7e911(0x1fe)),_0x59063b=_0x4ef7fc[_0xc7e911(0x241)];_0x53e782['innerHTML']=_0xc7e911(0x20e),_0x53e782[_0xc7e911(0x1d2)]=!![];if(!_0x59063b){_0x53e782[_0xc7e911(0x2c1)]='
';return;}try{log('正在为《'+_0x59063b+_0xc7e911(0x2ed),_0xc7e911(0x2a9));const _0x24a7af=await _0xc72edd[_0xc7e911(0x19f)](_0x59063b);_0x53e782[_0xc7e911(0x2c1)]='
';if(_0x24a7af[_0xc7e911(0x1f8)]===0x0){_0x53e782[_0xc7e911(0x2c1)]='
';return;}_0x24a7af[_0xc7e911(0x29c)](_0x439c0c=>{const _0x2b4492=_0xc7e911,_0x372fc1=new Option(_0x439c0c[_0x2b4492(0x2b8)]+_0x2b4492(0x251)+_0x439c0c[_0x2b4492(0x223)]+')',_0x439c0c[_0x2b4492(0x223)]);_0x53e782['add'](_0x372fc1);}),log(_0xc7e911(0x198)+_0x24a7af[_0xc7e911(0x1f8)]+'\x20个条目。',_0xc7e911(0x233));}catch(_0x15f490){console['error']('[翰林院-枢纽]\x20加载《'+_0x59063b+_0xc7e911(0x287),_0x15f490),log(_0xc7e911(0x2e8)+_0x15f490[_0xc7e911(0x2bc)],_0xc7e911(0x2d2)),_0x53e782[_0xc7e911(0x2c1)]=_0xc7e911(0x1ef);}finally{_0x53e782[_0xc7e911(0x1d2)]=![];}}async function startHistoriography(){const _0x299aaf=_0x58cad7,_0xaa7592=document[_0x299aaf(0x216)](_0x299aaf(0x1eb))[_0x299aaf(0x241)],_0x16c394=document[_0x299aaf(0x216)]('hly-hist-select-entry')[_0x299aaf(0x241)],_0x3e917f=document[_0x299aaf(0x216)](_0x299aaf(0x1ab));if(!_0xaa7592||!_0x16c394){toastr['warning'](_0x299aaf(0x2f6),_0x299aaf(0x186));return;}_0x3e917f[_0x299aaf(0x298)]='准备对《'+_0xaa7592+_0x299aaf(0x2a2)+_0x16c394+_0x299aaf(0x2ac),toastr[_0x299aaf(0x2a9)]('编纂任务已开始...','圣旨'),log(_0x299aaf(0x1d8)+_0xaa7592+'》-'+_0x16c394+_0x299aaf(0x25b),'info');try{const _0x376d18=await _0xc72edd[_0x299aaf(0x1aa)](_0xaa7592,_0x16c394);if(_0x376d18[_0x299aaf(0x233)]){const _0x42d7bd=document[_0x299aaf(0x216)]('hly-hist-select-entry'),_0x2d5533=_0x42d7bd[_0x299aaf(0x2e4)][_0x42d7bd[_0x299aaf(0x2c4)]][_0x299aaf(0x274)],_0x1ecc45='《'+_0xaa7592+_0x299aaf(0x229)+_0x2d5533+_0x299aaf(0x1da);_0x3e917f['textContent']=_0x1ecc45,toastr[_0x299aaf(0x233)](_0x299aaf(0x242),_0x299aaf(0x1ed)),log('对《'+_0xaa7592+_0x299aaf(0x245)+_0x16c394+_0x299aaf(0x255),_0x299aaf(0x233));}else throw new Error(_0x376d18[_0x299aaf(0x2d2)]||'未知的编纂错误');}catch(_0x230890){console[_0x299aaf(0x2d2)](_0x299aaf(0x259),_0x230890),toastr['error']('编纂失败:\x20'+_0x230890['message'],_0x299aaf(0x1f9)),_0x3e917f['textContent']=_0x299aaf(0x249)+_0x230890[_0x299aaf(0x2bc)];}}async function showStats(){const _0xc6c13d=_0x58cad7;try{log(_0xc6c13d(0x2cb),'info'),toastr[_0xc6c13d(0x2a9)](_0xc6c13d(0x2ae),'圣旨');const _0x5c5917=await _0x3c94ac[_0xc6c13d(0x21d)](),_0x34663c=await _0x3c94ac['getCollectionId'](),_0x42c03d=_0x3c94ac[_0xc6c13d(0x263)](),_0x5ccddd='\x0a
\x0a翰林院宝库状态\x0a--------------------\x0a集合ID:\x20'+_0x34663c+_0xc6c13d(0x28c)+_0x5c5917+_0xc6c13d(0x1fd)+_0x42c03d[_0xc6c13d(0x22c)]['apiEndpoint']+_0xc6c13d(0x247)+_0x42c03d['retrieval'][_0xc6c13d(0x23e)]+_0xc6c13d(0x1a8);toastr[_0xc6c13d(0x2a9)](_0x5ccddd,_0xc6c13d(0x281),{'timeOut':0x3a98,'extendedTimeOut':0x1388,'tapToDismiss':!![],'closeButton':!![]}),log(_0xc6c13d(0x2d6)+_0x34663c+_0xc6c13d(0x2be)+_0x5c5917,'success');}catch(_0x152676){console[_0xc6c13d(0x2d2)](_0xc6c13d(0x21e),_0x152676),toastr[_0xc6c13d(0x2d2)]('查询宝库状态失败:\x20'+_0x152676[_0xc6c13d(0x2bc)],_0xc6c13d(0x1f9)),log(_0xc6c13d(0x26a)+_0x152676[_0xc6c13d(0x2bc)],_0xc6c13d(0x2d2));}}function showExclusionRulesModal(){const _0x3086c1=_0x58cad7,_0x3a24bd=_0x3c94ac[_0x3086c1(0x263)](),_0xd64dbe=_0x3a24bd['condensation'][_0x3086c1(0x1af)]||[],_0x5a37cc=(_0x2866e1={'start':'','end':''},_0x3e5807)=>_0x3086c1(0x23a)+_0x3e5807+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20 \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20';showHtmlModal(_0x3086c1(0x1fc),_0x4c8372,{'okText':_0x3086c1(0x2e7),'onOk':_0x51e8cf=>{const _0x3b2ee3=_0x3086c1,_0x1f7da4=[];_0x51e8cf[_0x3b2ee3(0x1c3)](_0x3b2ee3(0x24a))[_0x3b2ee3(0x2cd)](function(){const _0x93c317=_0x3b2ee3,_0x2b3655=$(this)[_0x93c317(0x1c3)](_0x93c317(0x187))['eq'](0x0)[_0x93c317(0x2f1)]()[_0x93c317(0x2d7)](),_0xd5ecc1=$(this)['find']('input')['eq'](0x1)['val']()[_0x93c317(0x2d7)]();_0x2b3655&&_0xd5ecc1&&_0x1f7da4[_0x93c317(0x2a1)]({'start':_0x2b3655,'end':_0xd5ecc1});}),updateAndSaveSetting(_0x3b2ee3(0x283),_0x1f7da4),toastr[_0x3b2ee3(0x233)]('内容排除规则已保存。',_0x3b2ee3(0x26e));}});const _0x554f38=document[_0x3086c1(0x216)]('hly-exclusion-rules-container'),_0x558787=_0x554f38[_0x3086c1(0x21c)](_0x3086c1(0x2a6));_0x554f38[_0x3086c1(0x21c)](_0x3086c1(0x183))[_0x3086c1(0x29e)](_0x3086c1(0x19e),()=>{const _0x5dbb1f=_0x3086c1,_0x4ebad5=_0x558787['children'][_0x5dbb1f(0x1f8)],_0xa6b78b=_0x5a37cc({'start':'','end':''},_0x4ebad5);_0x558787[_0x5dbb1f(0x2d1)](_0x5dbb1f(0x1d9),_0xa6b78b);}),_0x558787[_0x3086c1(0x29e)](_0x3086c1(0x19e),_0x4b84fc=>{const _0xe773b0=_0x3086c1;_0x4b84fc[_0xe773b0(0x23d)][_0xe773b0(0x2eb)]['contains'](_0xe773b0(0x1e9))&&_0x4b84fc[_0xe773b0(0x23d)]['closest'](_0xe773b0(0x24a))[_0xe773b0(0x192)]();});}function previewCondensation(){const _0x252f5d=_0x58cad7,_0x32943e=document[_0x252f5d(0x216)](_0x252f5d(0x2c8));try{const _0x1b285d=_0x3c94ac['getSettings'](),_0x1c413a=_0x1b285d[_0x252f5d(0x25d)][_0x252f5d(0x1af)]||[],_0x574519={'user':document[_0x252f5d(0x216)](_0x252f5d(0x262))[_0x252f5d(0x1df)],'ai':document[_0x252f5d(0x216)]('hly-include-ai')['checked']},_0x48e3e3=document[_0x252f5d(0x216)](_0x252f5d(0x2f4))[_0x252f5d(0x1df)],_0x509732=_0x48e3e3?document[_0x252f5d(0x216)]('hly-tag-input')[_0x252f5d(0x241)]['split'](',')[_0x252f5d(0x1c2)](_0x292d2a=>_0x292d2a['trim']())['filter'](Boolean):[],_0x30fd9f=_0x3c94ac['getMessagesForCondensation'](_0x574519);if(!_0x30fd9f||_0x30fd9f[_0x252f5d(0x1f8)]===0x0){_0x32943e[_0x252f5d(0x298)]=_0x252f5d(0x2c0),toastr[_0x252f5d(0x22e)](_0x252f5d(0x1f6),_0x252f5d(0x27c));return;}const _0x26d137=getContext()[_0x252f5d(0x1f5)],_0x946631=_0x30fd9f[_0x252f5d(0x1c2)]((_0xaaa10e,_0xe36def)=>{const _0x20f780=_0x252f5d;let _0x392eee;if(_0xaaa10e[_0x20f780(0x20d)])_0x392eee=_0xaaa10e[_0x20f780(0x2d5)];else{if(_0x48e3e3&&_0x509732[_0x20f780(0x1f8)]>0x0){const _0x53983d=extractBlocksByTags(_0xaaa10e['mes'],_0x509732);_0x392eee=_0x53983d[_0x20f780(0x21b)]('\x0a\x0a');}else _0x392eee=_0xaaa10e[_0x20f780(0x2d5)];_0x392eee=applyExclusionRules(_0x392eee,_0x1c413a);}const _0x11d131=_0x26d137['findIndex'](_0x215705=>_0x215705===_0xaaa10e),_0x27a56f=_0x11d131!==-0x1?_0x11d131+0x1:-0x1;return{'id':_0x20f780(0x2f5)+_0xe36def,'name':_0xaaa10e['name'],'content':_0x392eee[_0x20f780(0x2d7)](),'floor':_0x27a56f,'is_user':_0xaaa10e[_0x20f780(0x20d)],'send_date':_0xaaa10e['send_date']};})[_0x252f5d(0x294)](_0x2f5c40=>_0x2f5c40['content']);if(_0x946631['length']===0x0){_0x32943e[_0x252f5d(0x298)]='根据标签提取或内容排除条件,未找到任何有效内容。',toastr['warning'](_0x252f5d(0x2a5),_0x252f5d(0x27c));return;}const _0x501735=_0x946631[_0x252f5d(0x1c2)]((_0x5caed3,_0x3cb78f)=>_0x252f5d(0x266)+_0x5caed3['id']+_0x252f5d(0x2a7)+_0x5caed3[_0x252f5d(0x1bd)]+'\x20楼:\x20['+_0x5caed3['name']+']\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20