From 2d934908ef04c16e5bafd6876c6603f9826efffd Mon Sep 17 00:00:00 2001
From: Wx-2025 <351320169@qq.com>
Date: Sun, 7 Dec 2025 03:30:02 +0800
Subject: [PATCH] Update hanlinyuan-bindings.js
---
ui/hanlinyuan-bindings.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/hanlinyuan-bindings.js b/ui/hanlinyuan-bindings.js
index 5be9b6f..e7301f9 100644
--- a/ui/hanlinyuan-bindings.js
+++ b/ui/hanlinyuan-bindings.js
@@ -1 +1 @@
-const _0x15063a=_0x1493;(function(_0x34aeee,_0x57ca71){const _0xd13f55=_0x1493,_0x5679d6=_0x34aeee();while(!![]){try{const _0x1bcd02=-parseInt(_0xd13f55(0x179))/0x1*(parseInt(_0xd13f55(0x1e5))/0x2)+-parseInt(_0xd13f55(0x27c))/0x3+parseInt(_0xd13f55(0x320))/0x4*(parseInt(_0xd13f55(0x23b))/0x5)+parseInt(_0xd13f55(0x28d))/0x6+parseInt(_0xd13f55(0x2a0))/0x7*(parseInt(_0xd13f55(0x325))/0x8)+parseInt(_0xd13f55(0x307))/0x9+-parseInt(_0xd13f55(0x276))/0xa;if(_0x1bcd02===_0x57ca71)break;else _0x5679d6['push'](_0x5679d6['shift']());}catch(_0x4b1d3d){_0x5679d6['push'](_0x5679d6['shift']());}}}(_0x4662,0x4d9d8));import{getContext}from'/scripts/extensions.js';import*as _0x4b5037 from'../core/rag-processor.js';import*as _0x337832 from'../core/historiographer.js';import*as _0x535b3f from'../core/utils/context-utils.js';import*as _0x405f63 from'../core/ingestion-manager.js';import{showContentModal,showHtmlModal}from'./page-window.js';import{extractBlocksByTags,applyExclusionRules}from'../core/utils/rag-tag-extractor.js';import{filterWorldbooks,filterWorldbookEntries,highlightSearchMatch,debounce}from'../core/rag-processor.js';_0x15063a(0x235);function setupGlobalEventHandlers(){const _0x6c22d1=_0x15063a;window[_0x6c22d1(0x196)]=()=>saveSettingsFromUI(![]),window[_0x6c22d1(0x1dd)]=resetSettingsToUI,window[_0x6c22d1(0x25d)]=testApi,window['fetchHLYEmbeddingModels']=fetchHLYEmbeddingModels,window['fetchHLYRerankModels']=fetchHLYRerankModels,window['updateHLYMemoryCount']=updatePanelStatus,window[_0x6c22d1(0x1ea)]=purgeStorage,window[_0x6c22d1(0x20c)]=startCondensation,window[_0x6c22d1(0x2f8)]=previewCondensation,window[_0x6c22d1(0x30e)]=ingestManualText,window[_0x6c22d1(0x18e)]=log,window[_0x6c22d1(0x223)]=showStats,window['startHLYHistoriography']=startHistoriography;}function updateAndSaveSetting(_0x1b4d0d,_0x6b43af){const _0x32e269=_0x15063a,_0x57337f=_0x4b5037['getSettings']();if(!_0x57337f)return;const _0x169b53=_0x1b4d0d['split']('.');let _0x1fc950=_0x57337f;for(let _0x323e66=0x0;_0x323e66<_0x169b53[_0x32e269(0x30f)]-0x1;_0x323e66++){_0x1fc950=_0x1fc950[_0x169b53[_0x323e66]]=_0x1fc950[_0x169b53[_0x323e66]]||{};}_0x1fc950[_0x169b53[_0x169b53[_0x32e269(0x30f)]-0x1]]=_0x6b43af,_0x4b5037[_0x32e269(0x347)](),log('[自动保存]\x20设置项\x20\x27'+_0x1b4d0d+_0x32e269(0x168)+JSON[_0x32e269(0x187)](_0x6b43af),_0x32e269(0x336));}function bindAutoSaveEvents(){const _0x2dceed=_0x15063a,_0x41bfbe=document[_0x2dceed(0x220)](_0x2dceed(0x1cf));if(!_0x41bfbe)return;_0x41bfbe['addEventListener'](_0x2dceed(0x1c5),_0xd4f9f0=>{const _0x121712=_0x2dceed,_0x4d06bd=_0xd4f9f0[_0x121712(0x2a7)],_0x5878ad=_0x4d06bd[_0x121712(0x193)][_0x121712(0x360)];if(!_0x5878ad)return;let _0x5374ad;const _0x33a129=_0x4d06bd[_0x121712(0x193)][_0x121712(0x2f3)]||'string';if(_0x4d06bd[_0x121712(0x2f3)]===_0x121712(0x353))_0x5374ad=_0x4d06bd[_0x121712(0x2d8)];else{if(_0x4d06bd[_0x121712(0x2f3)]===_0x121712(0x2b9)){if(_0x4d06bd['checked']){const _0x9e2027=_0x41bfbe[_0x121712(0x1f3)](_0x121712(0x2c9)+_0x4d06bd[_0x121712(0x265)]+'\x22]'),_0x5c3e78=Array[_0x121712(0x173)](_0x9e2027)[_0x121712(0x210)](_0x214dff=>_0x214dff[_0x121712(0x2d8)]);_0x5374ad=_0x5c3e78[_0x121712(0x314)];}else return;}else _0x5374ad=_0x4d06bd['value'];}switch(_0x33a129){case _0x121712(0x190):_0x5374ad=parseInt(_0x5374ad,0xa);break;case _0x121712(0x340):_0x5374ad=parseFloat(_0x5374ad);break;case _0x121712(0x1f4):typeof _0x5374ad!==_0x121712(0x1f4)&&(_0x5374ad=_0x5374ad===_0x121712(0x275));break;}if(_0x4d06bd[_0x121712(0x2f3)]===_0x121712(0x2b9)&&!_0x4d06bd['checked'])return;updateAndSaveSetting(_0x5878ad,_0x5374ad),_0x5878ad==='retrieval.independentChatMemoryEnabled'&&updatePanelStatus();});}export function bindHanlinyuanEvents(){const _0x513356=_0x15063a,_0x49ddcc=getContext();if(!_0x49ddcc){console[_0x513356(0x2f5)](_0x513356(0x2e9));return;}setupGlobalEventHandlers(),bindPanelToggleEvents(),bindInternalUIEvents(),bindTutorialEvents(),bindAutoSaveEvents(),bindSessionLockEvent(),initializeUnifiedInjectionEditor();if(_0x4b5037[_0x513356(0x2c0)])_0x4b5037['initialize']();else{console[_0x513356(0x2f5)]('[翰林院-枢纽]\x20核心法典未能提供初始化圣旨!');return;}loadSettingsToUI(),loadWorldbookList(),log(_0x513356(0x35a),'info');const _0x4dce75=document[_0x513356(0x220)](_0x513356(0x1b7)),_0x3111b5=document[_0x513356(0x220)](_0x513356(0x1cd)),_0x131295=document[_0x513356(0x220)](_0x513356(0x2e2)),_0x37f902=document[_0x513356(0x220)](_0x513356(0x2b6)),_0x204cbe=document[_0x513356(0x220)](_0x513356(0x234)),_0x17069e=document[_0x513356(0x220)]('hanlinyuan-ingest-progress-bar'),_0xcbbbbe=document['getElementById'](_0x513356(0x37b)),_0x20c66e=document[_0x513356(0x220)](_0x513356(0x212));let _0x30c9ae=null,_0x58fa0e=null;_0x4dce75['addEventListener'](_0x513356(0x1c5),_0x3ecb7f=>{const _0x190dab=_0x513356;_0x30c9ae=_0x3ecb7f['target'][_0x190dab(0x1bd)][0x0],_0x30c9ae?(_0x3111b5['textContent']=_0x30c9ae[_0x190dab(0x265)],_0x3111b5['title']=_0x30c9ae['name']):_0x3111b5[_0x190dab(0x17b)]=_0x190dab(0x2cf);}),_0x131295['addEventListener']('click',async()=>{const _0x540cec=_0x513356;if(!_0x30c9ae){toastr[_0x540cec(0x181)](_0x540cec(0x24d));return;}let _0x52461f=0x0;const _0x17d79a=_0x405f63['generateJobId'](_0x30c9ae),_0x42b33f=_0x405f63[_0x540cec(0x249)](_0x17d79a);if(_0x42b33f){const _0x2dfce5=(_0x42b33f['processedChunks']/_0x42b33f[_0x540cec(0x1d9)]*0x64)[_0x540cec(0x22e)](0x1),_0x559a2e=confirm(_0x540cec(0x31e)+_0x2dfce5+'%。是否从上次中断之处继续?');_0x559a2e?(_0x52461f=_0x42b33f[_0x540cec(0x24c)],toastr[_0x540cec(0x1d7)](_0x540cec(0x2ef)+(_0x52461f+0x1)+_0x540cec(0x35d),'圣旨已达'),log('[断点续传]\x20用户选择继续任务\x20'+_0x17d79a+_0x540cec(0x301)+_0x52461f+_0x540cec(0x2dc),_0x540cec(0x1d7))):(_0x405f63[_0x540cec(0x1a7)](_0x17d79a),toastr[_0x540cec(0x1d7)](_0x540cec(0x17f),_0x540cec(0x369)),log('[断点续传]\x20用户选择放弃旧任务\x20'+_0x17d79a+_0x540cec(0x18a),_0x540cec(0x195)));}_0x58fa0e=new AbortController();const _0x5ce50b=_0x58fa0e[_0x540cec(0x244)];_0x20c66e[_0x540cec(0x2f6)][_0x540cec(0x208)]='none',_0x204cbe[_0x540cec(0x2f6)][_0x540cec(0x208)]=_0x540cec(0x2b5),_0xcbbbbe[_0x540cec(0x17b)]=_0x540cec(0x32c),_0x17069e['value']=0x0;try{const _0x552cdb=await _0x30c9ae[_0x540cec(0x293)](),_0x989ca8=_0x6501=>{const _0x1b3530=_0x540cec;_0xcbbbbe[_0x1b3530(0x17b)]=_0x1b3530(0x32a)+_0x6501[_0x1b3530(0x2fd)]+'\x20('+_0x6501[_0x1b3530(0x248)]+'/'+_0x6501[_0x1b3530(0x1fc)]+')',_0x17069e[_0x1b3530(0x314)]=_0x6501[_0x1b3530(0x248)]/_0x6501['total']*0x64;},_0x54d4f0=()=>{const _0x149147=_0x540cec;updatePanelStatus(),log('[实时刷新]\x20批次完成,忆识总数已更新。',_0x149147(0x1d7));},_0x6d1b44=await _0x4b5037[_0x540cec(0x344)](_0x552cdb,_0x540cec(0x21e),{'sourceName':_0x30c9ae[_0x540cec(0x265)]},_0x989ca8,_0x5ce50b,log,_0x54d4f0,_0x17d79a,_0x52461f);if(_0x6d1b44[_0x540cec(0x336)])toastr['success'](_0x540cec(0x27f)+_0x6d1b44[_0x540cec(0x310)]+'\x20个知识块'),_0xcbbbbe[_0x540cec(0x17b)]=_0x540cec(0x183)+_0x6d1b44[_0x540cec(0x310)]+_0x540cec(0x171),_0x17069e[_0x540cec(0x314)]=0x64,updatePanelStatus();else throw new Error(_0x6d1b44[_0x540cec(0x2f5)]||_0x540cec(0x297));}catch(_0x60a7ad){_0x60a7ad['name']==='AbortError'?(toastr['info']('任务已由用户中止。进度已保存,可随时继续。'),_0xcbbbbe[_0x540cec(0x17b)]=_0x540cec(0x1fb)):(toastr['error']('录入失败:\x20'+_0x60a7ad[_0x540cec(0x2fd)]+_0x540cec(0x206)),_0xcbbbbe[_0x540cec(0x17b)]='错误:\x20'+_0x60a7ad[_0x540cec(0x2fd)]);}finally{setTimeout(()=>{const _0x132dc5=_0x540cec;_0x20c66e['style'][_0x132dc5(0x208)]=_0x132dc5(0x26f),_0x204cbe['style'][_0x132dc5(0x208)]=_0x132dc5(0x222),_0x4dce75[_0x132dc5(0x314)]='',_0x30c9ae=null,_0x3111b5[_0x132dc5(0x17b)]=_0x132dc5(0x2cf);},0xbb8);}}),_0x37f902['addEventListener'](_0x513356(0x1c6),()=>{const _0x1037da=_0x513356;_0x58fa0e&&_0x58fa0e[_0x1037da(0x20d)]();});}function bindSessionLockEvent(){const _0x38511b=_0x15063a,_0x1cb385=document[_0x38511b(0x220)]('hly-session-lock-btn');if(!_0x1cb385)return;_0x1cb385[_0x38511b(0x23f)]('click',async()=>{const _0x99a514=_0x38511b,_0x4f7f05=await _0x4b5037[_0x99a514(0x1d8)]();updateSessionLockUI(_0x4f7f05);if(_0x4f7f05){const _0x1f77b6=_0x4b5037['getLockedSessionInfo']();_0x1f77b6&&(toastr['success'](_0x99a514(0x292)+_0x1f77b6['id'],_0x99a514(0x26d)),log(_0x99a514(0x1b9)+_0x1f77b6['id'],'success'));}else toastr['info'](_0x99a514(0x1f1),'诏曰'),log('会话已解锁。',_0x99a514(0x1d7));updatePanelStatus();}),updateSessionLockUI(_0x4b5037[_0x38511b(0x2d7)]());}function updateSessionLockUI(_0x57406e){const _0x2e044a=_0x15063a,_0x2c65ee=document[_0x2e044a(0x220)](_0x2e044a(0x263));if(!_0x2c65ee)return;const _0x8248eb=_0x2c65ee[_0x2e044a(0x267)]('i'),_0x1715b5=_0x2c65ee[_0x2e044a(0x267)](_0x2e044a(0x191));_0x57406e?(_0x2c65ee[_0x2e044a(0x29e)][_0x2e044a(0x1ca)](_0x2e044a(0x229)),_0x8248eb[_0x2e044a(0x366)]='fas\x20fa-lock',_0x1715b5[_0x2e044a(0x17b)]=_0x2e044a(0x2be),_0x2c65ee['title']=_0x2e044a(0x2b8)):(_0x2c65ee[_0x2e044a(0x29e)][_0x2e044a(0x371)]('active'),_0x8248eb[_0x2e044a(0x366)]=_0x2e044a(0x277),_0x1715b5[_0x2e044a(0x17b)]=_0x2e044a(0x2cc),_0x2c65ee['title']=_0x2e044a(0x377));}function bindPanelToggleEvents(){const _0x498667=_0x15063a,_0x1cd151=document['getElementById'](_0x498667(0x1e4));if(_0x1cd151){}}function bindTutorialEvents(){const _0x4fb183=_0x15063a,_0x3bbf24=document[_0x4fb183(0x220)](_0x4fb183(0x271));_0x3bbf24&&_0x3bbf24['addEventListener']('click',()=>{const _0x398ab1=_0x4fb183;showContentModal(_0x398ab1(0x28e),'scripts/extensions/third-party/ST-Amily2-Chat-Optimisation/HanLin.md');});}function bindInternalUIEvents(){const _0x5e6894=_0x15063a,_0x14e4a3=document[_0x5e6894(0x1f3)](_0x5e6894(0x170));_0x14e4a3[_0x5e6894(0x19b)](_0x570d60=>{const _0x1da4d6=_0x5e6894;_0x570d60[_0x1da4d6(0x23f)](_0x1da4d6(0x1c6),()=>{const _0x18f995=_0x1da4d6,_0x1efcb3=_0x570d60[_0x18f995(0x193)][_0x18f995(0x16b)],_0xff5b4b=_0x18f995(0x355)+_0x1efcb3+'-tab';document['querySelectorAll'](_0x18f995(0x376))[_0x18f995(0x19b)](_0x55ac83=>{const _0x5da533=_0x18f995;_0x55ac83['classList']['toggle'](_0x5da533(0x229),_0x55ac83['id']===_0xff5b4b);}),_0x14e4a3[_0x18f995(0x19b)](_0xbb3f45=>_0xbb3f45['classList'][_0x18f995(0x207)](_0x18f995(0x229),_0xbb3f45===_0x570d60));});});const _0x5b2642=document[_0x5e6894(0x220)](_0x5e6894(0x339));_0x5b2642&&_0x5b2642[_0x5e6894(0x23f)](_0x5e6894(0x1c5),handleApiModeChange);const _0x3c631f=document[_0x5e6894(0x220)](_0x5e6894(0x2e5)),_0x29ed01=document['getElementById'](_0x5e6894(0x22f));_0x3c631f&&_0x29ed01&&_0x3c631f['addEventListener'](_0x5e6894(0x1c5),()=>{const _0x4da4ed=_0x5e6894;_0x29ed01[_0x4da4ed(0x2f6)][_0x4da4ed(0x208)]=_0x3c631f[_0x4da4ed(0x2d8)]?_0x4da4ed(0x2b5):_0x4da4ed(0x222);});const _0x21dcd3=document[_0x5e6894(0x220)]('hly-hist-select-library');_0x21dcd3&&_0x21dcd3['addEventListener'](_0x5e6894(0x1c5),handleWorldbookSelectionChange);const _0x5f357f=document[_0x5e6894(0x220)](_0x5e6894(0x266));_0x5f357f&&_0x5f357f[_0x5e6894(0x23f)]('click',()=>showRulesModal('condensation'));const _0x78e230=document[_0x5e6894(0x220)]('hly-query-preprocessing-rules-btn');_0x78e230&&_0x78e230[_0x5e6894(0x23f)](_0x5e6894(0x1c6),()=>showRulesModal(_0x5e6894(0x2d4)));const _0x520da4=document[_0x5e6894(0x220)]('hly-hist-entry-multiselect-btn'),_0x5032f3=document['getElementById']('hly-hist-entry-multiselect-options');_0x520da4&&_0x5032f3&&(_0x520da4['addEventListener'](_0x5e6894(0x1c6),_0xb24f2c=>{const _0xfbaafd=_0x5e6894;_0xb24f2c[_0xfbaafd(0x316)]();const _0x265df2=_0x5032f3[_0xfbaafd(0x2f6)][_0xfbaafd(0x208)]===_0xfbaafd(0x2b5);_0x5032f3[_0xfbaafd(0x2f6)][_0xfbaafd(0x208)]=_0x265df2?_0xfbaafd(0x222):'block';}),_0x5032f3[_0x5e6894(0x23f)](_0x5e6894(0x1c5),_0xaf842d=>{const _0x6a1fdd=_0x5e6894,_0x2c7851=_0xaf842d['target'];if(_0x2c7851['type']!==_0x6a1fdd(0x353))return;const _0x2541b3=_0x5032f3[_0x6a1fdd(0x1f3)]('.hly-hist-entry-checkbox'),_0x4accaf=document[_0x6a1fdd(0x220)](_0x6a1fdd(0x237));if(_0x2c7851['id']===_0x6a1fdd(0x237))_0x2541b3[_0x6a1fdd(0x19b)](_0x2dbd15=>_0x2dbd15['checked']=_0x2c7851[_0x6a1fdd(0x2d8)]);else{const _0x5578f6=Array['from'](_0x2541b3)[_0x6a1fdd(0x29b)](_0x10dffa=>_0x10dffa[_0x6a1fdd(0x2d8)]);_0x4accaf['checked']=_0x5578f6;}const _0xa74060=_0x5032f3[_0x6a1fdd(0x1f3)](_0x6a1fdd(0x28b))[_0x6a1fdd(0x30f)],_0x4fa187=_0x2541b3['length'];_0x520da4[_0x6a1fdd(0x267)]('span')['textContent']='已选择\x20'+_0xa74060+_0x6a1fdd(0x16e)+_0x4fa187+_0x6a1fdd(0x36c);}),document[_0x5e6894(0x23f)]('click',_0xf7f376=>{const _0x52de9e=_0x5e6894;!_0x520da4[_0x52de9e(0x312)](_0xf7f376['target'])&&!_0x5032f3[_0x52de9e(0x312)](_0xf7f376['target'])&&(_0x5032f3[_0x52de9e(0x2f6)]['display']=_0x52de9e(0x222));}));const _0x5b7e35=document[_0x5e6894(0x220)](_0x5e6894(0x250));_0x5b7e35&&_0x5b7e35[_0x5e6894(0x23f)](_0x5e6894(0x1c6),deleteAllLocalKnowledgeBases);const _0x10fb46=document[_0x5e6894(0x220)](_0x5e6894(0x2c8));_0x10fb46&&_0x10fb46['addEventListener'](_0x5e6894(0x1c6),()=>moveAllKnowledgeBases(_0x5e6894(0x17a)));const _0x119b1a=document[_0x5e6894(0x220)](_0x5e6894(0x270));_0x119b1a&&_0x119b1a[_0x5e6894(0x23f)]('click',()=>moveAllKnowledgeBases(_0x5e6894(0x2ff)));const _0x297877=['hly-kb-list-local','hly-kb-list-global'];_0x297877[_0x5e6894(0x19b)](_0x4ca3f5=>{const _0x1584f6=_0x5e6894,_0x21d63b=document[_0x1584f6(0x220)](_0x4ca3f5);_0x21d63b&&(_0x21d63b[_0x1584f6(0x23f)]('click',handleKbAction),_0x21d63b['addEventListener']('change',handleKbAction));}),document['getElementById'](_0x5e6894(0x34b))[_0x5e6894(0x23f)](_0x5e6894(0x1c5),_0x432233=>handleSelectAll(_0x432233,_0x5e6894(0x285))),document[_0x5e6894(0x220)](_0x5e6894(0x330))[_0x5e6894(0x23f)](_0x5e6894(0x1c5),_0x1b54e7=>handleSelectAll(_0x1b54e7,'local')),document[_0x5e6894(0x220)](_0x5e6894(0x321))[_0x5e6894(0x23f)](_0x5e6894(0x1c6),_0x402faf=>handleBulkAction(_0x402faf,_0x5e6894(0x285))),document['getElementById'](_0x5e6894(0x33f))[_0x5e6894(0x23f)]('click',_0x45270a=>handleBulkAction(_0x45270a,_0x5e6894(0x251)));}function initializeUnifiedInjectionEditor(){const _0xebe17d=_0x15063a,_0x1233f0=document[_0xebe17d(0x220)]('hly-injection-source-selector'),_0x3ec990=document[_0xebe17d(0x220)]('hly-unified-template-editor'),_0xac1592=document[_0xebe17d(0x220)](_0xebe17d(0x2ee)),_0x5cacca=document[_0xebe17d(0x1f3)]('input[name=\x22hly-unified-injection-position\x22]'),_0x27e5ce=document[_0xebe17d(0x220)](_0xebe17d(0x1ef)),_0x2286e0=document[_0xebe17d(0x220)](_0xebe17d(0x2a5));if(!_0x1233f0)return;const _0x26fd34={'novel':'{{novel_text}}','chat':_0xebe17d(0x203),'lorebook':_0xebe17d(0x1b1),'manual':_0xebe17d(0x2ce)};function _0x3f2b38(){const _0x17c3aa=_0xebe17d,_0x36de2b=_0x1233f0[_0x17c3aa(0x314)],_0x460ea5=_0x4b5037[_0x17c3aa(0x2d1)](),_0x527f6d=_0x460ea5[_0x17c3aa(0x1aa)+_0x36de2b]||{};_0x3ec990[_0x17c3aa(0x314)]=_0x527f6d[_0x17c3aa(0x338)]||'',_0xac1592['textContent']='以\x20'+(_0x26fd34[_0x36de2b]||_0x17c3aa(0x2c4))+_0x17c3aa(0x1ba);const _0x4397bb=_0x527f6d[_0x17c3aa(0x202)]!==undefined?String(_0x527f6d[_0x17c3aa(0x202)]):'2';_0x5cacca[_0x17c3aa(0x19b)](_0x28a5d1=>_0x28a5d1['checked']=_0x28a5d1[_0x17c3aa(0x314)]===_0x4397bb),_0x27e5ce[_0x17c3aa(0x314)]=_0x527f6d['depth']||0x0,_0x2286e0[_0x17c3aa(0x314)]=_0x527f6d[_0x17c3aa(0x37f)]!==undefined?String(_0x527f6d[_0x17c3aa(0x37f)]):'0';const _0x22bac3=_0x4397bb==='1';_0x27e5ce[_0x17c3aa(0x2a6)]=!_0x22bac3,_0x2286e0['disabled']=!_0x22bac3;}function _0x2a9ed8(){const _0xe7fcbc=_0xebe17d,_0x2e8e18=_0x1233f0['value'];updateAndSaveSetting(_0xe7fcbc(0x1aa)+_0x2e8e18+_0xe7fcbc(0x31c),_0x3ec990[_0xe7fcbc(0x314)]);const _0x197749=document[_0xe7fcbc(0x267)](_0xe7fcbc(0x317));_0x197749&&updateAndSaveSetting(_0xe7fcbc(0x1aa)+_0x2e8e18+_0xe7fcbc(0x2e8),parseInt(_0x197749[_0xe7fcbc(0x314)],0xa)),updateAndSaveSetting(_0xe7fcbc(0x1aa)+_0x2e8e18+'.depth',parseInt(_0x27e5ce[_0xe7fcbc(0x314)],0xa)),updateAndSaveSetting(_0xe7fcbc(0x1aa)+_0x2e8e18+'.depth_role',parseInt(_0x2286e0[_0xe7fcbc(0x314)],0xa));}_0x1233f0[_0xebe17d(0x23f)](_0xebe17d(0x1c5),_0x3f2b38);const _0x14bbde=debounce(_0x2a9ed8,0x12c);_0x3ec990[_0xebe17d(0x23f)]('input',_0x14bbde),_0x27e5ce[_0xebe17d(0x23f)](_0xebe17d(0x1c5),_0x2a9ed8),_0x2286e0[_0xebe17d(0x23f)](_0xebe17d(0x1c5),_0x2a9ed8),_0x5cacca['forEach'](_0x4d9d55=>_0x4d9d55[_0xebe17d(0x23f)]('change',()=>{const _0xd2d4ae=_0xebe17d;_0x2a9ed8();const _0x52d02f=_0x4d9d55['value']==='1'&&_0x4d9d55[_0xd2d4ae(0x2d8)];_0x27e5ce[_0xd2d4ae(0x2a6)]=!_0x52d02f,_0x2286e0[_0xd2d4ae(0x2a6)]=!_0x52d02f;})),_0x3f2b38();}function _0x4662(){const _0xb530e7=['\x20个知识库的启用状态吗?','position','{{chat_text}}','hly-kb-select-all-','\x20操作失败:\x20','。进度已保存,可稍后重试。','toggle','display','移动失败:\x20','local_proxy','log-error','startHLYCondensation','abort','翰林院设定已重置为初始状态。','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\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\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','content','2645868JyaeVy','\x20个模型。','hly-kb-select-all-local','无法获取总数:\x20','custom','[翰林院-枢纽]\x20获取模型列表失败:','{{lorebook_text}}','\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','hly-kb-list-item','local_proxy','text','files','文书已成功录入宝库,新增\x20','fetchHLYRerankModels','boolean','testApiConnection','成功获取\x20','fetchRerankModels','.template','\x20移动到\x20','正在处理您提交的文书...','','请输入知识库的新名称:','hly-query-preprocessing-enabled','当前角色没有任何局部知识库可供删除。','hly-kb-bulk-actions-global','\x22\x20的配置项。','block','messageTypes','tagExtractionEnabled','hly-include-user','initialize','change','option','您确定要永久删除知识库【','comment','hanlinyuan-ingest-status','name','\x20个知识库删除失败。','[翰林院-枢纽]\x20已成功连接各部,政令畅通。','\x20个Rerank模型。','end','已选择\x200\x20/\x20','hly-layer-start','maxResults','请至少选择一个知识库进行操作。','.hly-kb-group-content','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\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\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\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\x20\x20\x20\x20{updateWorldbookOptions(_0x5682f7,_0x26c944,_0x16c9df);},0x12c);_0x27ab30[_0x6e76e5(0x2e4)]('input',_0x10e086=>{const _0x7ff228=_0x6e76e5;_0x10dcec(_0x10e086[_0x7ff228(0xfe)][_0x7ff228(0x2de)]);});}log(_0x6e76e5(0x11a)+_0x16c9df[_0x6e76e5(0x1dc)]+'\x20个书库。',_0x6e76e5(0x28d));}catch(_0x285f16){console[_0x6e76e5(0x216)](_0x6e76e5(0x144),_0x285f16),log(_0x6e76e5(0x17d)+_0x285f16[_0x6e76e5(0x180)],_0x6e76e5(0x216)),_0x5682f7&&(_0x5682f7[_0x6e76e5(0x14e)]=_0x6e76e5(0x18b));}}function updateWorldbookOptions(_0x48b7c7,_0x2dc066,_0x594e9e){const _0x236239=_0x362e0d,_0x466faf=filterWorldbooks(_0x2dc066,_0x594e9e),_0x5c0ab7=_0x48b7c7[_0x236239(0x2de)];_0x48b7c7[_0x236239(0x14e)]='';if(_0x466faf['length']===0x0){_0x48b7c7[_0x236239(0x14e)]=_0x2dc066[_0x236239(0x1f3)]()?_0x236239(0x265):'';return;}_0x466faf[_0x236239(0x270)](_0x25f787=>{const _0x5358b9=_0x236239,_0x4ad1bc=document[_0x5358b9(0x1de)](_0x5358b9(0xec));_0x4ad1bc[_0x5358b9(0x2de)]=_0x25f787,_0x4ad1bc[_0x5358b9(0x1c5)]=_0x25f787,_0x48b7c7[_0x5358b9(0x27f)](_0x4ad1bc);}),_0x5c0ab7&&_0x466faf['includes'](_0x5c0ab7)&&(_0x48b7c7['value']=_0x5c0ab7);}async function handleWorldbookSelectionChange(){const _0x3278ad=_0x362e0d,_0x2a8ba3=document[_0x3278ad(0x2b9)](_0x3278ad(0x1a2)),_0x1dfd45=document[_0x3278ad(0x2b9)](_0x3278ad(0x275)),_0x280d62=document[_0x3278ad(0x2b9)]('hly-hist-entry-multiselect-options'),_0x1255af=document[_0x3278ad(0x2b9)](_0x3278ad(0x170)),_0x44fe7a=_0x2a8ba3[_0x3278ad(0x2de)];_0x1dfd45[_0x3278ad(0x19c)]=!![],_0x1dfd45[_0x3278ad(0x14c)](_0x3278ad(0x2b0))['textContent']=_0x3278ad(0x181),_0x280d62[_0x3278ad(0x14e)]='',_0x280d62['style'][_0x3278ad(0x192)]=_0x3278ad(0x274);_0x1255af&&(_0x1255af['value']='');if(!_0x44fe7a){_0x1dfd45[_0x3278ad(0x14c)](_0x3278ad(0x2b0))[_0x3278ad(0x1c5)]=_0x3278ad(0x222);return;}try{log(_0x3278ad(0x23b)+_0x44fe7a+_0x3278ad(0x286),_0x3278ad(0x1f6));const _0x1ebd99=await _0x12d602['getLoresForWorldbook'](_0x44fe7a);if(_0x1ebd99[_0x3278ad(0x1dc)]===0x0){_0x1dfd45[_0x3278ad(0x14c)](_0x3278ad(0x2b0))[_0x3278ad(0x1c5)]=_0x3278ad(0x13f);return;}window['allEntries']=_0x1ebd99,updateEntryOptions('',_0x1ebd99);if(_0x1255af){_0x1255af['removeEventListener'](_0x3278ad(0x228),_0x1255af[_0x3278ad(0x16e)]);const _0x3259d3=debounce(_0x3298e7=>{updateEntryOptions(_0x3298e7,_0x1ebd99);},0x12c);_0x1255af[_0x3278ad(0x16e)]=_0x4cdc4b=>{const _0x10448f=_0x3278ad;_0x3259d3(_0x4cdc4b[_0x10448f(0xfe)][_0x10448f(0x2de)]);},_0x1255af[_0x3278ad(0x2e4)](_0x3278ad(0x228),_0x1255af[_0x3278ad(0x16e)]);}log('成功加载\x20'+_0x1ebd99[_0x3278ad(0x1dc)]+_0x3278ad(0x1ba),'success');}catch(_0x36fb8f){console[_0x3278ad(0x216)](_0x3278ad(0x1d0)+_0x44fe7a+_0x3278ad(0x21a),_0x36fb8f),log(_0x3278ad(0xfc)+_0x36fb8f[_0x3278ad(0x180)],_0x3278ad(0x216)),_0x1dfd45[_0x3278ad(0x14c)]('span')['textContent']='加载失败';}finally{_0x1dfd45['disabled']=![];}}function updateEntryOptions(_0x5ee079,_0x3b6fda){const _0x23230c=_0x362e0d,_0x11a974=document[_0x23230c(0x2b9)](_0x23230c(0x146)),_0x420d24=document['getElementById'](_0x23230c(0x275)),_0x3a5c22=filterWorldbookEntries(_0x5ee079,_0x3b6fda);_0x11a974[_0x23230c(0x14e)]='';const _0x4efa95=_0x23230c(0x254);_0x11a974['insertAdjacentHTML']('beforeend',_0x4efa95);if(_0x3a5c22[_0x23230c(0x1dc)]===0x0){const _0xfb1422=_0x23230c(0x162);_0x11a974[_0x23230c(0x164)](_0x23230c(0x26f),_0xfb1422),_0x420d24[_0x23230c(0x14c)](_0x23230c(0x2b0))[_0x23230c(0x1c5)]=_0x23230c(0x1ec);return;}_0x3a5c22[_0x23230c(0x270)](_0x4b6db9=>{const _0x38c2f7=_0x23230c,_0x3fe3a5=_0x5ee079?highlightSearchMatch(_0x4b6db9[_0x38c2f7(0xee)],_0x5ee079):_0x4b6db9[_0x38c2f7(0xee)],_0x44022f=_0x38c2f7(0x27e)+_0x4b6db9[_0x38c2f7(0xee)]+'\x20(Key:\x20'+_0x4b6db9[_0x38c2f7(0x2a1)]+')\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20_0x2bcf25['value']);if(!_0x412d6e||_0x36ad3e[_0x117246(0x1dc)]===0x0){toastr[_0x117246(0x1c2)](_0x117246(0x2d6),_0x117246(0x2ca));return;}_0x5c1eef[_0x117246(0x1c5)]=_0x117246(0x1b8)+_0x412d6e+_0x117246(0x20d)+_0x36ad3e['length']+'\x20个条目进行批量编纂...',toastr['info']('批量编纂任务已开始...','圣旨'),log(_0x117246(0x29e)+_0x412d6e+'》中的\x20'+_0x36ad3e[_0x117246(0x1dc)]+'\x20个条目进行编纂...','info');try{const _0x52714e=await _0x12d602[_0x117246(0x152)](_0x412d6e,_0x36ad3e);_0x5c1eef[_0x117246(0x1c5)]=_0x52714e['content'],_0x52714e[_0x117246(0x28d)]?toastr[_0x117246(0x28d)]('批量编纂任务已完成。',_0x117246(0x264)):toastr[_0x117246(0x1c2)](_0x117246(0x126),'圣谕'),log('对《'+_0x412d6e+_0x117246(0x209)+_0x52714e['totalSuccess']+_0x117246(0x147)+_0x52714e[_0x117246(0x109)],_0x117246(0x28d));}catch(_0x5b079d){console[_0x117246(0x216)](_0x117246(0x237),_0x5b079d),toastr['error']('编纂失败:\x20'+_0x5b079d['message'],'严重错误'),_0x5c1eef[_0x117246(0x1c5)]='编纂失败:\x20'+_0x5b079d['message'];}finally{await updatePanelStatus();}}async function showStats(){const _0x67e8b5=_0x362e0d;try{log(_0x67e8b5(0x2da),'info'),toastr[_0x67e8b5(0x1f6)](_0x67e8b5(0x1ea),'圣旨');const _0x5a5b6d=await _0xad1447['getVectorCount'](),_0x2d83ea=await _0xad1447['getCollectionId'](),_0x2d7814=_0xad1447['getSettings'](),_0x38e5b3=_0x67e8b5(0x1e2)+_0x2d83ea+'\x0a忆识总数:\x20'+_0x5a5b6d+'\x0a--------------------\x0aAPI端点:\x20'+_0x2d7814[_0x67e8b5(0x18c)][_0x67e8b5(0x151)]+_0x67e8b5(0x16a)+_0x2d7814[_0x67e8b5(0x18c)][_0x67e8b5(0x262)]+_0x67e8b5(0x1d4);toastr[_0x67e8b5(0x1f6)](_0x38e5b3,_0x67e8b5(0x11b),{'timeOut':0x3a98,'extendedTimeOut':0x1388,'tapToDismiss':!![],'closeButton':!![]}),log(_0x67e8b5(0x1c3)+_0x2d83ea+',\x20忆识总数='+_0x5a5b6d,_0x67e8b5(0x28d));}catch(_0x4be2bc){console[_0x67e8b5(0x216)](_0x67e8b5(0x21d),_0x4be2bc),toastr[_0x67e8b5(0x216)]('查询宝库状态失败:\x20'+_0x4be2bc[_0x67e8b5(0x180)],'严重错误'),log(_0x67e8b5(0x22e)+_0x4be2bc['message'],_0x67e8b5(0x216));}}function showRulesModal(_0x2a47c5){const _0x1a3c3a=_0x362e0d,_0x371e5c=_0xad1447[_0x1a3c3a(0x1aa)](),_0x21c8e5=_0x371e5c[_0x2a47c5];if(!_0x21c8e5){console['error'](_0x1a3c3a(0x1d1)+_0x2a47c5+_0x1a3c3a(0xe5));return;}const _0x10051f=_0x2a47c5===_0x1a3c3a(0x2cc)?'编辑凝识内容排除规则':_0x1a3c3a(0x2e5),_0x32cc28=_0x21c8e5['exclusionRules']||[],_0x5b3d80=(_0x577973={'start':'','end':''},_0x550313)=>_0x1a3c3a(0x29c)+_0x550313+_0x1a3c3a(0x291)+(_0x577973[_0x1a3c3a(0x123)]||'')['replace'](/"/g,'\x22')+'\x22\x20placeholder=\x22开始字符串,\x20如\x20