diff --git a/ui/hanlinyuan-bindings.js b/ui/hanlinyuan-bindings.js
index d4ad84c..d426def 100644
--- a/ui/hanlinyuan-bindings.js
+++ b/ui/hanlinyuan-bindings.js
@@ -1 +1 @@
-const _0x23b16d=_0x2dcb;(function(_0x19b47d,_0x2ee0cc){const _0x2b77c1=_0x2dcb,_0x2c948d=_0x19b47d();while(!![]){try{const _0x17f12c=-parseInt(_0x2b77c1(0x2a9))/0x1+parseInt(_0x2b77c1(0x1f7))/0x2*(-parseInt(_0x2b77c1(0x25c))/0x3)+parseInt(_0x2b77c1(0x1c6))/0x4*(parseInt(_0x2b77c1(0x2d0))/0x5)+parseInt(_0x2b77c1(0x274))/0x6+parseInt(_0x2b77c1(0x296))/0x7+-parseInt(_0x2b77c1(0x282))/0x8*(-parseInt(_0x2b77c1(0x294))/0x9)+parseInt(_0x2b77c1(0x2e2))/0xa*(parseInt(_0x2b77c1(0x1c7))/0xb);if(_0x17f12c===_0x2ee0cc)break;else _0x2c948d['push'](_0x2c948d['shift']());}catch(_0xcb3864){_0x2c948d['push'](_0x2c948d['shift']());}}}(_0x3626,0xede98));import{getContext}from'/scripts/extensions.js';import*as _0x1eabfc from'../core/rag-processor.js';import*as _0x24d336 from'../core/historiographer.js';import*as _0x13164f from'../core/utils/context-utils.js';import*as _0x4a0363 from'../core/ingestion-manager.js';import{showContentModal,showHtmlModal}from'./page-window.js';import{extractBlocksByTags,applyExclusionRules}from'../core/utils/rag-tag-extractor.js';_0x23b16d(0x1f9);function setupGlobalEventHandlers(){const _0x2876e6=_0x23b16d;window[_0x2876e6(0x211)]=()=>saveSettingsFromUI(![]),window[_0x2876e6(0x322)]=resetSettingsToUI,window[_0x2876e6(0x1f3)]=testApi,window[_0x2876e6(0x21f)]=fetchHLYEmbeddingModels,window[_0x2876e6(0x31a)]=fetchHLYRerankModels,window['updateHLYMemoryCount']=updatePanelStatus,window[_0x2876e6(0x295)]=purgeStorage,window[_0x2876e6(0x1ce)]=startCondensation,window[_0x2876e6(0x1d3)]=previewCondensation,window[_0x2876e6(0x293)]=ingestManualText,window[_0x2876e6(0x1fa)]=log,window['showHLYStats']=showStats,window['startHLYHistoriography']=startHistoriography;}function updateAndSaveSetting(_0x4b5bf3,_0x21b726){const _0x466581=_0x23b16d,_0x3a6a86=_0x1eabfc[_0x466581(0x266)]();if(!_0x3a6a86)return;const _0x464a96=_0x4b5bf3[_0x466581(0x2e1)]('.');let _0x5efd2c=_0x3a6a86;for(let _0xbb1974=0x0;_0xbb1974<_0x464a96['length']-0x1;_0xbb1974++){_0x5efd2c=_0x5efd2c[_0x464a96[_0xbb1974]]=_0x5efd2c[_0x464a96[_0xbb1974]]||{};}_0x5efd2c[_0x464a96[_0x464a96[_0x466581(0x213)]-0x1]]=_0x21b726,_0x1eabfc[_0x466581(0x1e4)](),log(_0x466581(0x2f7)+_0x4b5bf3+_0x466581(0x312)+JSON['stringify'](_0x21b726),'success');}function bindAutoSaveEvents(){const _0x537a71=_0x23b16d,_0x2ab663=document[_0x537a71(0x2a2)](_0x537a71(0x267));if(!_0x2ab663)return;_0x2ab663[_0x537a71(0x206)]('change',_0x1e4b5b=>{const _0x3c172b=_0x537a71,_0x45c09c=_0x1e4b5b['target'],_0x54c92d=_0x45c09c[_0x3c172b(0x244)][_0x3c172b(0x1f1)];if(!_0x54c92d)return;let _0x4bcb6d;const _0x495b95=_0x45c09c['dataset'][_0x3c172b(0x270)]||_0x3c172b(0x278);if(_0x45c09c[_0x3c172b(0x270)]==='checkbox')_0x4bcb6d=_0x45c09c[_0x3c172b(0x2ee)];else{if(_0x45c09c[_0x3c172b(0x270)]===_0x3c172b(0x1d8)){if(_0x45c09c[_0x3c172b(0x2ee)]){const _0x5ded40=_0x2ab663['querySelectorAll'](_0x3c172b(0x23b)+_0x45c09c['name']+'\x22]'),_0x1491ca=Array[_0x3c172b(0x2e3)](_0x5ded40)[_0x3c172b(0x1c0)](_0x1e9bc5=>_0x1e9bc5[_0x3c172b(0x2ee)]);_0x4bcb6d=_0x1491ca[_0x3c172b(0x1cb)];}else return;}else _0x4bcb6d=_0x45c09c[_0x3c172b(0x1cb)];}switch(_0x495b95){case'integer':_0x4bcb6d=parseInt(_0x4bcb6d,0xa);break;case'float':_0x4bcb6d=parseFloat(_0x4bcb6d);break;case _0x3c172b(0x2f2):typeof _0x4bcb6d!==_0x3c172b(0x2f2)&&(_0x4bcb6d=_0x4bcb6d==='true');break;}if(_0x45c09c[_0x3c172b(0x270)]===_0x3c172b(0x1d8)&&!_0x45c09c['checked'])return;updateAndSaveSetting(_0x54c92d,_0x4bcb6d);});}export function bindHanlinyuanEvents(){const _0x17520b=_0x23b16d,_0x42960c=getContext();if(!_0x42960c){console[_0x17520b(0x221)](_0x17520b(0x2c0));return;}setupGlobalEventHandlers(),bindPanelToggleEvents(),bindInternalUIEvents(),bindTutorialEvents(),bindAutoSaveEvents(),bindSessionLockEvent();if(_0x1eabfc[_0x17520b(0x1d2)])_0x1eabfc[_0x17520b(0x1d2)]();else{console[_0x17520b(0x221)](_0x17520b(0x2c8));return;}loadSettingsToUI(),loadWorldbookList(),log(_0x17520b(0x1c5),'info');const _0x164c95=document[_0x17520b(0x2a2)]('hanlinyuan-ingest-novel-file-input'),_0x5d86bc=document[_0x17520b(0x2a2)](_0x17520b(0x319)),_0x40865a=document[_0x17520b(0x2a2)](_0x17520b(0x2cd)),_0x137e7d=document[_0x17520b(0x2a2)]('hanlinyuan-ingest-abort'),_0x3cdef4=document[_0x17520b(0x2a2)]('hanlinyuan-ingest-progress-container'),_0x5afe2c=document[_0x17520b(0x2a2)](_0x17520b(0x1b9)),_0x47fd62=document[_0x17520b(0x2a2)]('hanlinyuan-ingest-status'),_0x4d5a02=document[_0x17520b(0x2a2)]('hanlinyuan-ingest-novel-controls');let _0x23fad9=null,_0x4f0522=null;_0x164c95[_0x17520b(0x206)]('change',_0x40c9f9=>{const _0x3a7fbf=_0x17520b;_0x23fad9=_0x40c9f9['target'][_0x3a7fbf(0x2aa)][0x0],_0x23fad9?(_0x5d86bc[_0x3a7fbf(0x2f9)]=_0x23fad9[_0x3a7fbf(0x218)],_0x5d86bc[_0x3a7fbf(0x31d)]=_0x23fad9['name']):_0x5d86bc[_0x3a7fbf(0x2f9)]='未选择文件';}),_0x40865a[_0x17520b(0x206)](_0x17520b(0x1be),async()=>{const _0xf2d2ad=_0x17520b;if(!_0x23fad9){toastr[_0xf2d2ad(0x301)]('请先选择一个\x20.txt\x20文件');return;}let _0x23748b=0x0;const _0x18061f=_0x4a0363[_0xf2d2ad(0x2bd)](_0x23fad9),_0x19cbe5=_0x4a0363[_0xf2d2ad(0x2c2)](_0x18061f);if(_0x19cbe5){const _0x4b8893=(_0x19cbe5[_0xf2d2ad(0x236)]/_0x19cbe5[_0xf2d2ad(0x22f)]*0x64)[_0xf2d2ad(0x1e3)](0x1),_0x47dacf=confirm(_0xf2d2ad(0x261)+_0x4b8893+_0xf2d2ad(0x24d));_0x47dacf?(_0x23748b=_0x19cbe5[_0xf2d2ad(0x236)],toastr[_0xf2d2ad(0x263)](_0xf2d2ad(0x306)+(_0x23748b+0x1)+'\x20块继续录入。',_0xf2d2ad(0x2f5)),log(_0xf2d2ad(0x25f)+_0x18061f+_0xf2d2ad(0x235)+_0x23748b+'\x20块开始。',_0xf2d2ad(0x263))):(_0x4a0363['clearJob'](_0x18061f),toastr[_0xf2d2ad(0x263)](_0xf2d2ad(0x1bb),_0xf2d2ad(0x2f5)),log(_0xf2d2ad(0x1df)+_0x18061f+_0xf2d2ad(0x1cd),_0xf2d2ad(0x2ef)));}_0x4f0522=new AbortController();const _0xb90570=_0x4f0522[_0xf2d2ad(0x22d)];_0x4d5a02['style'][_0xf2d2ad(0x302)]=_0xf2d2ad(0x286),_0x3cdef4[_0xf2d2ad(0x2be)]['display']=_0xf2d2ad(0x2c9),_0x47fd62[_0xf2d2ad(0x2f9)]='正在读取文件...',_0x5afe2c[_0xf2d2ad(0x1cb)]=0x0;try{const _0x170884=await _0x23fad9[_0xf2d2ad(0x2e7)](),_0x3afa19=_0x20f127=>{const _0x14e3a3=_0xf2d2ad;_0x47fd62['textContent']=_0x14e3a3(0x2fc)+_0x20f127[_0x14e3a3(0x1ec)]+'\x20('+_0x20f127[_0x14e3a3(0x1b3)]+'/'+_0x20f127[_0x14e3a3(0x320)]+')',_0x5afe2c[_0x14e3a3(0x1cb)]=_0x20f127[_0x14e3a3(0x1b3)]/_0x20f127[_0x14e3a3(0x320)]*0x64;},_0x23a7fe=()=>{const _0x4f61e6=_0xf2d2ad;updatePanelStatus(),log(_0x4f61e6(0x1e2),'info');},_0x2ec720=await _0x1eabfc[_0xf2d2ad(0x300)](_0x170884,'novel',_0x23fad9[_0xf2d2ad(0x218)],_0x3afa19,_0xb90570,log,_0x23a7fe,_0x18061f,_0x23748b);if(_0x2ec720[_0xf2d2ad(0x273)])toastr[_0xf2d2ad(0x273)](_0xf2d2ad(0x1b4)+_0x2ec720[_0xf2d2ad(0x2eb)]+'\x20个知识块'),_0x47fd62['textContent']='任务完成!成功录入\x20'+_0x2ec720[_0xf2d2ad(0x2eb)]+_0xf2d2ad(0x26a),_0x5afe2c[_0xf2d2ad(0x1cb)]=0x64,updatePanelStatus();else throw new Error(_0x2ec720[_0xf2d2ad(0x221)]||_0xf2d2ad(0x29c));}catch(_0xe3a84b){_0xe3a84b[_0xf2d2ad(0x218)]===_0xf2d2ad(0x2b9)?(toastr[_0xf2d2ad(0x263)](_0xf2d2ad(0x20c)),_0x47fd62['textContent']=_0xf2d2ad(0x1fe)):(toastr[_0xf2d2ad(0x221)](_0xf2d2ad(0x207)+_0xe3a84b[_0xf2d2ad(0x1ec)]+'。进度已保存,可稍后重试。'),_0x47fd62[_0xf2d2ad(0x2f9)]=_0xf2d2ad(0x1d4)+_0xe3a84b[_0xf2d2ad(0x1ec)]);}finally{setTimeout(()=>{const _0x44a946=_0xf2d2ad;_0x4d5a02['style'][_0x44a946(0x302)]=_0x44a946(0x2b1),_0x3cdef4[_0x44a946(0x2be)][_0x44a946(0x302)]=_0x44a946(0x286),_0x164c95[_0x44a946(0x1cb)]='',_0x23fad9=null,_0x5d86bc[_0x44a946(0x2f9)]=_0x44a946(0x254);},0xbb8);}}),_0x137e7d[_0x17520b(0x206)](_0x17520b(0x1be),()=>{const _0x889e01=_0x17520b;_0x4f0522&&_0x4f0522[_0x889e01(0x216)]();});}function bindSessionLockEvent(){const _0x2fcbf4=_0x23b16d,_0x147f34=document[_0x2fcbf4(0x2a2)]('hly-session-lock-btn');if(!_0x147f34)return;_0x147f34[_0x2fcbf4(0x206)]('click',async()=>{const _0x352e00=_0x2fcbf4,_0x462bcf=await _0x1eabfc[_0x352e00(0x243)]();updateSessionLockUI(_0x462bcf);if(_0x462bcf){const _0x50e595=_0x1eabfc[_0x352e00(0x31c)]();_0x50e595&&(toastr['success']('会话已锁定到:\x20'+_0x50e595['id'],'圣旨已下'),log(_0x352e00(0x1ef)+_0x50e595['id'],_0x352e00(0x273)));}else toastr['info'](_0x352e00(0x27a),'诏曰'),log(_0x352e00(0x23e),'info');updatePanelStatus();}),updateSessionLockUI(_0x1eabfc['isSessionLocked']());}function _0x2dcb(_0x44b760,_0x46d188){const _0x3626e3=_0x3626();return _0x2dcb=function(_0x2dcb83,_0x148c27){_0x2dcb83=_0x2dcb83-0x1b3;let _0x56f272=_0x3626e3[_0x2dcb83];return _0x56f272;},_0x2dcb(_0x44b760,_0x46d188);}function updateSessionLockUI(_0x2fa974){const _0x3099f1=_0x23b16d,_0x4cc4d4=document[_0x3099f1(0x2a2)](_0x3099f1(0x30e));if(!_0x4cc4d4)return;const _0x40443a=_0x4cc4d4['querySelector']('i'),_0xb75158=_0x4cc4d4[_0x3099f1(0x2b7)](_0x3099f1(0x2f3));_0x2fa974?(_0x4cc4d4['classList']['add']('active'),_0x40443a[_0x3099f1(0x1e0)]=_0x3099f1(0x28f),_0xb75158['textContent']='解锁会话',_0x4cc4d4[_0x3099f1(0x31d)]='点击以解锁,让翰林院跟随当前角色'):(_0x4cc4d4['classList'][_0x3099f1(0x289)](_0x3099f1(0x316)),_0x40443a[_0x3099f1(0x1e0)]='fas\x20fa-lock-open',_0xb75158[_0x3099f1(0x2f9)]=_0x3099f1(0x226),_0x4cc4d4[_0x3099f1(0x31d)]=_0x3099f1(0x2bb));}function bindPanelToggleEvents(){const _0x53f1b4=document['getElementById']('amily2_open_rag_palace');if(_0x53f1b4){}}function _0x3626(){const _0x59b91c=['hly-locked-status','\x20条有效条目),请点击“开始凝识”进入自动向量化流程。','flex','获取模型失败:\x20','[翰林院-枢纽]\x20凝识过程发生错误:','\x22\x20placeholder=\x22开始字符,\x20如\x20\x22>\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','hly-overlap-size','fa-exclamation-triangle','','disabled','\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\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\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\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20','info','\x20楼。','toLocaleTimeString','getSettings','hly-modal-container','hly-tag-input','embeddingModel','\x20个知识块。','例如\x20http://127.0.0.1:8000/v1','hly-match-threshold','change','hly-rerank-hybrid-alpha','hly-tag-extraction-toggle','type','用户请求查看宝库状态。','notify','success','5463252kUPCTC','查询宝库状态失败:\x20','data','condensation','string','','会话已解锁,将跟随当前角色。','手动录入成功,新增\x20','检测到预览后待处理的消息对象,开始精确凝识...','\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20','[翰林院-枢纽]\x20查询宝库状态失败:','comment','加载条目失败:\x20','getCollectionId','24sRDQCR','开始对《','hly-api-endpoint','template','none','凝识失败:\x20','matchThreshold','remove','上次已从第\x20','condensationHistory','【手动存档】所有设定已存档封印。','根据标签提取或内容排除条件,未找到任何有效内容。','您确定要将所有设定恢复为出厂默认值吗?','fas\x20fa-lock','closest','开始获取Rerank模型列表...','join','ingestHLYManualText','2767977fbORSG','purgeHLYStorage','4112647zVaHOU','用户尝试录入空文本。','label','tagExtractionEnabled','.hly-log-placeholder','通行令牌\x20(API\x20Key):','未知错误','log-warn','自定义路径:','apiKey','\x20个Rerank模型。','根据当前勾选条件,未找到符合的消息可供预览。','getElementById','classList','previousElementSibling','each','send-date','float','编纂任务已完成。','870772HCRNWo','files','user','hly-condensation-results','hly-custom-api-url','overlap'];_0x3626=function(){return _0x59b91c;};return _0x3626();}function bindTutorialEvents(){const _0xe790e0=_0x23b16d,_0x3a6d91=document[_0xe790e0(0x2a2)](_0xe790e0(0x2ca));_0x3a6d91&&_0x3a6d91['addEventListener'](_0xe790e0(0x1be),()=>{const _0x18f636=_0xe790e0;showContentModal('翰林院使用教程',_0x18f636(0x21c));});}function bindInternalUIEvents(){const _0x5bd952=_0x23b16d,_0x3acac7=document[_0x5bd952(0x2d1)]('.hly-nav-item');_0x3acac7['forEach'](_0x44e499=>{const _0x801a04=_0x5bd952;_0x44e499[_0x801a04(0x206)](_0x801a04(0x1be),()=>{const _0x58ecf4=_0x801a04,_0x3656b0=_0x44e499[_0x58ecf4(0x244)][_0x58ecf4(0x2ba)],_0x2769e7=_0x58ecf4(0x2ce)+_0x3656b0+_0x58ecf4(0x1e9);document[_0x58ecf4(0x2d1)](_0x58ecf4(0x228))[_0x58ecf4(0x1d5)](_0x40c54e=>{const _0x374c1d=_0x58ecf4;_0x40c54e[_0x374c1d(0x2a3)][_0x374c1d(0x259)](_0x374c1d(0x316),_0x40c54e['id']===_0x2769e7);}),_0x3acac7[_0x58ecf4(0x1d5)](_0x37616e=>_0x37616e['classList'][_0x58ecf4(0x259)](_0x58ecf4(0x316),_0x37616e===_0x44e499));});});const _0x449ed2=document['getElementById'](_0x5bd952(0x284));_0x449ed2&&_0x449ed2[_0x5bd952(0x206)](_0x5bd952(0x26d),handleApiModeChange);const _0x3d0800=document['getElementById'](_0x5bd952(0x1fc));_0x3d0800&&_0x3d0800[_0x5bd952(0x206)](_0x5bd952(0x26d),handleRerankApiModeChange);const _0x3344b7=document['querySelectorAll'](_0x5bd952(0x31f));_0x3344b7[_0x5bd952(0x1d5)](_0x44da51=>{const _0x3c8874=_0x5bd952;_0x44da51['addEventListener'](_0x3c8874(0x26d),toggleInjectionDetails);});const _0x144e7a=document[_0x5bd952(0x2a2)](_0x5bd952(0x26f)),_0x107090=document['getElementById'](_0x5bd952(0x2de));_0x144e7a&&_0x107090&&_0x144e7a[_0x5bd952(0x206)](_0x5bd952(0x26d),()=>{const _0x2f5330=_0x5bd952;_0x107090[_0x2f5330(0x2be)][_0x2f5330(0x302)]=_0x144e7a[_0x2f5330(0x2ee)]?_0x2f5330(0x2c9):_0x2f5330(0x286);});const _0x3a6bb4=document['getElementById']('hly-hist-select-library');_0x3a6bb4&&_0x3a6bb4[_0x5bd952(0x206)](_0x5bd952(0x26d),handleWorldbookSelectionChange);const _0x4e5b4f=document[_0x5bd952(0x2a2)](_0x5bd952(0x318));_0x4e5b4f&&_0x4e5b4f['addEventListener']('click',showExclusionRulesModal);}function toggleInjectionDetails(){const _0x33d07c=_0x23b16d,_0x21c130=document[_0x33d07c(0x2b7)]('input[name=\x22hly-injection-position\x22]:checked')[_0x33d07c(0x1cb)],_0x38224a=document[_0x33d07c(0x2a2)](_0x33d07c(0x2d2)),_0x50857f=document[_0x33d07c(0x2a2)](_0x33d07c(0x2d4)),_0x251962=_0x21c130==='1';_0x38224a['disabled']=!_0x251962,_0x50857f[_0x33d07c(0x2dc)]=!_0x251962;}function handleApiModeChange(){const _0x3daab5=_0x23b16d,_0x3cd01c=document[_0x3daab5(0x2a2)](_0x3daab5(0x284))[_0x3daab5(0x1cb)],_0x432196=document['getElementById'](_0x3daab5(0x24b)),_0x4a1892=document[_0x3daab5(0x2a2)](_0x3daab5(0x1f6)),_0x39634a=document[_0x3daab5(0x2a2)](_0x3daab5(0x30f)),_0x38a5d6=_0x39634a[_0x3daab5(0x2a4)];if(!_0x432196||!_0x4a1892)return;_0x432196[_0x3daab5(0x2be)][_0x3daab5(0x302)]=_0x3daab5(0x2c9),_0x4a1892[_0x3daab5(0x2be)][_0x3daab5(0x302)]=_0x3daab5(0x2c9);switch(_0x3cd01c){case _0x3daab5(0x249):_0x432196[_0x3daab5(0x2be)]['display']=_0x3daab5(0x286),_0x4a1892[_0x3daab5(0x2b7)]('label')[_0x3daab5(0x2f9)]=_0x3daab5(0x225),_0x4a1892['querySelector']('input')['placeholder']=_0x3daab5(0x30d);break;case _0x3daab5(0x231):_0x432196[_0x3daab5(0x2b7)](_0x3daab5(0x298))[_0x3daab5(0x2f9)]=_0x3daab5(0x2df),_0x432196['querySelector'](_0x3daab5(0x240))[_0x3daab5(0x311)]=_0x3daab5(0x26b),_0x4a1892[_0x3daab5(0x2be)]['display']=_0x3daab5(0x286);break;case _0x3daab5(0x234):default:_0x432196['querySelector'](_0x3daab5(0x298))[_0x3daab5(0x2f9)]=_0x3daab5(0x29e),_0x432196['querySelector'](_0x3daab5(0x240))[_0x3daab5(0x311)]=_0x3daab5(0x2bf),_0x4a1892[_0x3daab5(0x2b7)](_0x3daab5(0x298))[_0x3daab5(0x2f9)]=_0x3daab5(0x29b);break;}}function handleRerankApiModeChange(){const _0x1a84fc=_0x23b16d,_0x51a8b9=document[_0x1a84fc(0x2a2)](_0x1a84fc(0x1fc))[_0x1a84fc(0x1cb)],_0x385985=document['getElementById'](_0x1a84fc(0x241));if(!_0x385985)return;_0x51a8b9===_0x1a84fc(0x231)?_0x385985[_0x1a84fc(0x2be)][_0x1a84fc(0x302)]=_0x1a84fc(0x286):_0x385985['style'][_0x1a84fc(0x302)]=_0x1a84fc(0x2c9);}function loadSettingsToUI(){const _0x3e59bf=_0x23b16d,_0x5ed33e=_0x1eabfc[_0x3e59bf(0x266)]();if(!_0x5ed33e)return;document[_0x3e59bf(0x2a2)]('hly-retrieval-enabled')[_0x3e59bf(0x2ee)]=_0x5ed33e[_0x3e59bf(0x310)][_0x3e59bf(0x258)],document[_0x3e59bf(0x2a2)](_0x3e59bf(0x284))['value']=_0x5ed33e[_0x3e59bf(0x310)][_0x3e59bf(0x25e)],document['getElementById'](_0x3e59bf(0x2ad))['value']=_0x5ed33e[_0x3e59bf(0x310)][_0x3e59bf(0x1cf)],document['getElementById'](_0x3e59bf(0x2f6))[_0x3e59bf(0x1cb)]=_0x5ed33e['retrieval'][_0x3e59bf(0x29f)];const _0x2632ee=document[_0x3e59bf(0x2a2)](_0x3e59bf(0x30f));if(_0x2632ee['options'][_0x3e59bf(0x213)]===0x0){const _0x12ebe1=_0x5ed33e[_0x3e59bf(0x310)][_0x3e59bf(0x269)],_0x502514=new Option(_0x12ebe1,_0x12ebe1,!![],!![]);_0x2632ee[_0x3e59bf(0x24a)](_0x502514);}_0x2632ee['value']=_0x5ed33e['retrieval'][_0x3e59bf(0x269)],document[_0x3e59bf(0x2a2)](_0x3e59bf(0x1b5))['checked']=_0x5ed33e[_0x3e59bf(0x310)][_0x3e59bf(0x272)],document[_0x3e59bf(0x2a2)](_0x3e59bf(0x1ed))['value']=_0x5ed33e[_0x3e59bf(0x239)][_0x3e59bf(0x23d)],document['getElementById'](_0x3e59bf(0x2d9))[_0x3e59bf(0x1cb)]=_0x5ed33e['advanced'][_0x3e59bf(0x2ae)],document['getElementById'](_0x3e59bf(0x26c))[_0x3e59bf(0x1cb)]=_0x5ed33e[_0x3e59bf(0x239)][_0x3e59bf(0x288)],document[_0x3e59bf(0x2a2)](_0x3e59bf(0x24c))[_0x3e59bf(0x1cb)]=_0x5ed33e[_0x3e59bf(0x239)]['queryMessageCount'],document['getElementById'](_0x3e59bf(0x1d0))[_0x3e59bf(0x1cb)]=_0x5ed33e[_0x3e59bf(0x239)][_0x3e59bf(0x2c1)],document[_0x3e59bf(0x2a2)](_0x3e59bf(0x23a))[_0x3e59bf(0x1cb)]=_0x5ed33e[_0x3e59bf(0x310)][_0x3e59bf(0x1dc)],document[_0x3e59bf(0x2a2)]('hly-injection-template')['value']=_0x5ed33e['injection'][_0x3e59bf(0x285)];const _0x1cbd58=document[_0x3e59bf(0x2b7)]('input[name=\x22hly-injection-position\x22][value=\x22'+_0x5ed33e['injection']['position']+'\x22]');_0x1cbd58&&(_0x1cbd58['checked']=!![]);document['getElementById'](_0x3e59bf(0x2d2))['value']=_0x5ed33e[_0x3e59bf(0x2d5)]['depth'],document[_0x3e59bf(0x2a2)](_0x3e59bf(0x2d4))['value']=_0x5ed33e[_0x3e59bf(0x2d5)][_0x3e59bf(0x2ec)],toggleInjectionDetails(),handleApiModeChange(),handleRerankApiModeChange(),document[_0x3e59bf(0x2a2)](_0x3e59bf(0x257))[_0x3e59bf(0x2ee)]=_0x5ed33e[_0x3e59bf(0x277)][_0x3e59bf(0x258)],document[_0x3e59bf(0x2a2)]('hly-layer-start')[_0x3e59bf(0x1cb)]=_0x5ed33e['condensation']['layerStart'],document[_0x3e59bf(0x2a2)]('hly-layer-end')[_0x3e59bf(0x1cb)]=_0x5ed33e[_0x3e59bf(0x277)]['layerEnd'],document[_0x3e59bf(0x2a2)]('hly-include-user')['checked']=_0x5ed33e[_0x3e59bf(0x277)]['messageTypes'][_0x3e59bf(0x2ab)],document[_0x3e59bf(0x2a2)](_0x3e59bf(0x2f1))[_0x3e59bf(0x2ee)]=_0x5ed33e[_0x3e59bf(0x277)][_0x3e59bf(0x220)]['ai'];const _0x4d60ff=document[_0x3e59bf(0x2a2)]('hly-tag-extraction-toggle'),_0x317bb4=document[_0x3e59bf(0x2a2)]('hly-tag-input'),_0xb51f37=document[_0x3e59bf(0x2a2)]('hly-tag-input-container');_0x4d60ff['checked']=_0x5ed33e[_0x3e59bf(0x277)][_0x3e59bf(0x299)],_0x317bb4['value']=_0x5ed33e[_0x3e59bf(0x277)]['tags'],_0xb51f37[_0x3e59bf(0x2be)][_0x3e59bf(0x302)]=_0x4d60ff['checked']?_0x3e59bf(0x2c9):_0x3e59bf(0x286),document['getElementById'](_0x3e59bf(0x308))[_0x3e59bf(0x2ee)]=_0x5ed33e[_0x3e59bf(0x2cf)][_0x3e59bf(0x258)],document[_0x3e59bf(0x2a2)]('hly-rerank-api-mode')[_0x3e59bf(0x1cb)]=_0x5ed33e[_0x3e59bf(0x2cf)]['apiMode']||_0x3e59bf(0x234),document[_0x3e59bf(0x2a2)](_0x3e59bf(0x2fb))[_0x3e59bf(0x1cb)]=_0x5ed33e['rerank'][_0x3e59bf(0x2c5)],document[_0x3e59bf(0x2a2)]('hly-rerank-api-key')[_0x3e59bf(0x1cb)]=_0x5ed33e['rerank']['apiKey'];const _0xf64fa2=document[_0x3e59bf(0x2a2)](_0x3e59bf(0x242));if(_0xf64fa2['options'][_0x3e59bf(0x213)]===0x0){const _0x5c9f5f=_0x5ed33e[_0x3e59bf(0x2cf)][_0x3e59bf(0x305)];if(_0x5c9f5f){const _0x49fec3=new Option(_0x5c9f5f,_0x5c9f5f,!![],!![]);_0xf64fa2[_0x3e59bf(0x24a)](_0x49fec3);}}_0xf64fa2[_0x3e59bf(0x1cb)]=_0x5ed33e[_0x3e59bf(0x2cf)][_0x3e59bf(0x305)],document['getElementById']('hly-rerank-top-n')[_0x3e59bf(0x1cb)]=_0x5ed33e[_0x3e59bf(0x2cf)][_0x3e59bf(0x22a)],document[_0x3e59bf(0x2a2)](_0x3e59bf(0x26e))['value']=_0x5ed33e[_0x3e59bf(0x2cf)][_0x3e59bf(0x247)],document[_0x3e59bf(0x2a2)]('hly-rerank-notify')[_0x3e59bf(0x2ee)]=_0x5ed33e['rerank'][_0x3e59bf(0x272)];}function saveSettingsFromUI(_0x4e3254=!![]){const _0xbfdd7b=_0x23b16d,_0xee0d3d=document['getElementById'](_0xbfdd7b(0x267));if(!_0xee0d3d)return;const _0x5c2647=_0xee0d3d[_0xbfdd7b(0x2d1)](_0xbfdd7b(0x2c6));_0x5c2647[_0xbfdd7b(0x1d5)](_0x4d7130=>{const _0x269f88=_0xbfdd7b,_0x580a9d=_0x4d7130[_0x269f88(0x244)]['settingKey'];if(!_0x580a9d)return;let _0x47339a;const _0x13e68a=_0x4d7130[_0x269f88(0x244)][_0x269f88(0x270)]||_0x269f88(0x278);if(_0x4d7130['type']==='checkbox')_0x47339a=_0x4d7130[_0x269f88(0x2ee)];else{if(_0x4d7130['type']==='radio'){if(!_0x4d7130['checked'])return;_0x47339a=_0x4d7130[_0x269f88(0x1cb)];}else _0x47339a=_0x4d7130['value'];}switch(_0x13e68a){case _0x269f88(0x208):_0x47339a=parseInt(_0x47339a,0xa);break;case _0x269f88(0x2a7):_0x47339a=parseFloat(_0x47339a);break;case'boolean':if(typeof _0x47339a!=='boolean')_0x47339a=_0x47339a==='true';break;}const _0xeed477=_0x1eabfc['getSettings'](),_0x8ede1f=_0x580a9d[_0x269f88(0x2e1)]('.');let _0x8e840e=_0xeed477;for(let _0x48b273=0x0;_0x48b273<_0x8ede1f['length']-0x1;_0x48b273++){_0x8e840e=_0x8e840e[_0x8ede1f[_0x48b273]]=_0x8e840e[_0x8ede1f[_0x48b273]]||{};}_0x8e840e[_0x8ede1f[_0x8ede1f[_0x269f88(0x213)]-0x1]]=_0x47339a;}),_0x1eabfc[_0xbfdd7b(0x1e4)](),!_0x4e3254&&(log(_0xbfdd7b(0x28c),_0xbfdd7b(0x273)),toastr[_0xbfdd7b(0x273)](_0xbfdd7b(0x31e),_0xbfdd7b(0x2f5)));}function resetSettingsToUI(){const _0x4d99df=_0x23b16d;confirm(_0x4d99df(0x28e))&&(_0x1eabfc[_0x4d99df(0x317)](),loadSettingsToUI(),toastr['info'](_0x4d99df(0x202),'诏曰'));}async function updatePanelStatus(){const _0x4ab86d=_0x23b16d,_0x4a8dfb=_0x1eabfc[_0x4ab86d(0x2c3)](),_0x34a9a5=document[_0x4ab86d(0x2a2)](_0x4ab86d(0x25a)),_0x5ea20f=document[_0x4ab86d(0x2a2)](_0x4ab86d(0x2bc));if(_0x4a8dfb){const _0x296357=_0x1eabfc[_0x4ab86d(0x31c)]();_0x296357&&(_0x34a9a5[_0x4ab86d(0x2f9)]='会话已锁定',_0x5ea20f[_0x4ab86d(0x2f9)]=_0x296357['id'],_0x5ea20f[_0x4ab86d(0x31d)]='当前所有操作都将指向这个锁定的宝库:'+_0x296357['id'],_0x34a9a5[_0x4ab86d(0x2a3)][_0x4ab86d(0x24a)](_0x4ab86d(0x2af)),_0x5ea20f[_0x4ab86d(0x2a3)]['add'](_0x4ab86d(0x2af)));}else _0x34a9a5[_0x4ab86d(0x2f9)]=_0x13164f[_0x4ab86d(0x252)](),_0x5ea20f[_0x4ab86d(0x2f9)]=_0x13164f['getChatId']()||'无',_0x5ea20f[_0x4ab86d(0x31d)]='',_0x34a9a5[_0x4ab86d(0x2a3)][_0x4ab86d(0x289)](_0x4ab86d(0x2af)),_0x5ea20f[_0x4ab86d(0x2a3)][_0x4ab86d(0x289)](_0x4ab86d(0x2af));const _0x441cd0=document[_0x4ab86d(0x2a2)]('hly-current-vector-count');_0x441cd0[_0x4ab86d(0x2f9)]='...';try{const _0x1a15d8=await _0x1eabfc[_0x4ab86d(0x1d1)]();_0x441cd0['textContent']=_0x1a15d8;}catch(_0x2e2b1b){console[_0x4ab86d(0x221)]('[翰林院-枢纽]\x20更新忆识数量失败:',_0x2e2b1b),_0x441cd0[_0x4ab86d(0x2f9)]='N/A',_0x441cd0[_0x4ab86d(0x31d)]=_0x4ab86d(0x1bd)+_0x2e2b1b[_0x4ab86d(0x1ec)];}const _0x39f782=document[_0x4ab86d(0x2a2)](_0x4ab86d(0x2ac));if(_0x39f782&&!_0x39f782[_0x4ab86d(0x244)][_0x4ab86d(0x20a)]){const _0xb69551=_0x1eabfc[_0x4ab86d(0x266)](),_0x4af1b9=await _0x1eabfc[_0x4ab86d(0x281)]();if(_0xb69551[_0x4ab86d(0x28b)]&&_0xb69551[_0x4ab86d(0x28b)][_0x4af1b9]){const _0x40e210=_0xb69551[_0x4ab86d(0x28b)][_0x4af1b9];_0x39f782[_0x4ab86d(0x1de)]=_0x4ab86d(0x28a)+_0x40e210[_0x4ab86d(0x1b7)]+_0x4ab86d(0x1bc)+_0x40e210[_0x4ab86d(0x25d)]+_0x4ab86d(0x264);}else _0x39f782[_0x4ab86d(0x1de)]=_0x4ab86d(0x233);}}async function testApi(){const _0x23c206=_0x23b16d;toastr['info'](_0x23c206(0x2e4),'圣旨');try{await _0x1eabfc[_0x23c206(0x2e0)](),toastr['success']('神力连接通畅!','圣意');}catch(_0x3fefea){toastr[_0x23c206(0x221)]('神力连接失败:\x20'+_0x3fefea['message'],'警报');}}async function fetchHLYEmbeddingModels(){const _0x56d68d=_0x23b16d,_0x3ce8ae=document[_0x56d68d(0x2a2)](_0x56d68d(0x30f)),_0x445764=_0x3ce8ae[_0x56d68d(0x1cb)];_0x3ce8ae[_0x56d68d(0x1de)]='',_0x3ce8ae[_0x56d68d(0x2dc)]=!![];try{log('开始获取模型列表...',_0x56d68d(0x263));const _0xbae32e=await _0x1eabfc[_0x56d68d(0x200)]();_0x3ce8ae[_0x56d68d(0x1de)]='';if(_0xbae32e[_0x56d68d(0x213)]===0x0){_0x3ce8ae['innerHTML']=_0x56d68d(0x224),toastr[_0x56d68d(0x2ef)](_0x56d68d(0x24e),'翰林院启奏'),log(_0x56d68d(0x24e),_0x56d68d(0x2ef));return;}_0xbae32e[_0x56d68d(0x1d5)](_0x4c8419=>{const _0x1d3515=_0x56d68d,_0x1c0aa7=new Option(_0x4c8419,_0x4c8419);_0x3ce8ae[_0x1d3515(0x24a)](_0x1c0aa7);}),_0xbae32e[_0x56d68d(0x31b)](_0x445764)?_0x3ce8ae['value']=_0x445764:_0x3ce8ae[_0x56d68d(0x2c7)]=0x0,toastr[_0x56d68d(0x273)]('成功获取\x20'+_0xbae32e[_0x56d68d(0x213)]+_0x56d68d(0x1c3),'圣意'),log(_0x56d68d(0x23c)+_0xbae32e[_0x56d68d(0x213)]+_0x56d68d(0x1c3),_0x56d68d(0x273));}catch(_0xbbf2aa){console[_0x56d68d(0x221)](_0x56d68d(0x1e8),_0xbbf2aa),toastr[_0x56d68d(0x221)](_0x56d68d(0x2b2)+_0xbbf2aa['message'],_0x56d68d(0x1ba)),log(_0x56d68d(0x2b2)+_0xbbf2aa['message'],_0x56d68d(0x221)),_0x3ce8ae[_0x56d68d(0x1de)]=_0x56d68d(0x2db);}finally{_0x3ce8ae[_0x56d68d(0x2dc)]=![];}}async function fetchHLYRerankModels(){const _0x259a0d=_0x23b16d,_0x996d88=document[_0x259a0d(0x2a2)](_0x259a0d(0x242)),_0x47c1fc=_0x996d88['value'];_0x996d88[_0x259a0d(0x1de)]='',_0x996d88['disabled']=!![];try{log(_0x259a0d(0x291),_0x259a0d(0x263));const _0x20d723=await _0x1eabfc[_0x259a0d(0x20f)]();_0x996d88[_0x259a0d(0x1de)]='';if(_0x20d723['length']===0x0){_0x996d88[_0x259a0d(0x1de)]=_0x259a0d(0x224),toastr[_0x259a0d(0x2ef)](_0x259a0d(0x1db),_0x259a0d(0x1d9)),log(_0x259a0d(0x1db),_0x259a0d(0x2ef));return;}_0x20d723[_0x259a0d(0x1d5)](_0x39bb2e=>{const _0x364b18=_0x259a0d,_0x364f14=new Option(_0x39bb2e,_0x39bb2e);_0x996d88[_0x364b18(0x24a)](_0x364f14);}),_0x20d723[_0x259a0d(0x31b)](_0x47c1fc)?_0x996d88[_0x259a0d(0x1cb)]=_0x47c1fc:_0x996d88[_0x259a0d(0x2c7)]=0x0,toastr[_0x259a0d(0x273)](_0x259a0d(0x23c)+_0x20d723[_0x259a0d(0x213)]+_0x259a0d(0x2a0),'圣意'),log(_0x259a0d(0x23c)+_0x20d723['length']+_0x259a0d(0x2a0),'success');}catch(_0x838591){console['error'](_0x259a0d(0x1d6),_0x838591),toastr[_0x259a0d(0x221)](_0x259a0d(0x2d6)+_0x838591[_0x259a0d(0x1ec)],_0x259a0d(0x1ba)),log(_0x259a0d(0x2d6)+_0x838591['message'],_0x259a0d(0x221)),_0x996d88[_0x259a0d(0x1de)]=_0x259a0d(0x2db);}finally{_0x996d88[_0x259a0d(0x2dc)]=![];}}async function purgeStorage(){const _0x27cb98=_0x23b16d;if(confirm(_0x27cb98(0x255))){toastr[_0x27cb98(0x263)]('正在清空宝库...','圣旨');const _0x439388=await _0x1eabfc['purgeStorage']();_0x439388?toastr[_0x27cb98(0x273)]('宝库已清空。','圣意'):toastr[_0x27cb98(0x221)](_0x27cb98(0x1da),'警报'),await updatePanelStatus();}}async function startCondensation(){const _0xab240f=_0x23b16d,_0x177bde=document[_0xab240f(0x2a2)](_0xab240f(0x2ac)),_0x25f05d=_0x177bde[_0xab240f(0x244)][_0xab240f(0x1fd)],_0x14656a=document['getElementById'](_0xab240f(0x260))['value'],_0x5a79b9=document[_0xab240f(0x2a2)](_0xab240f(0x1bf))['value'],_0x5b68d7={'start':parseInt(_0x14656a),'end':parseInt(_0x5a79b9)};try{let _0x1df0b1;_0x25f05d?(log(_0xab240f(0x27c),_0xab240f(0x263)),toastr[_0xab240f(0x263)]('正在处理您确认后的文书...','圣旨'),_0x1df0b1=JSON['parse'](_0x25f05d),delete _0x177bde[_0xab240f(0x244)][_0xab240f(0x1fd)]):(log(_0xab240f(0x222),_0xab240f(0x263)),toastr[_0xab240f(0x263)]('正在准备凝识...','圣旨'),_0x1df0b1=_0x1eabfc[_0xab240f(0x209)]());if(!_0x1df0b1||_0x1df0b1[_0xab240f(0x213)]===0x0){toastr[_0xab240f(0x301)](_0xab240f(0x204),'翰林院启奏'),_0x177bde['textContent']='未找到符合条件的消息。';return;}_0x177bde[_0xab240f(0x2f9)]=_0xab240f(0x1ee)+_0x1df0b1[_0xab240f(0x213)]+_0xab240f(0x21e),toastr[_0xab240f(0x263)](_0xab240f(0x1ee)+_0x1df0b1[_0xab240f(0x213)]+'\x20条消息,开始凝识...','翰林院启奏');const _0x287538=await _0x1eabfc[_0xab240f(0x1c9)](_0x1df0b1,log,_0x5b68d7);if(_0x287538[_0xab240f(0x273)]){toastr[_0xab240f(0x273)](_0xab240f(0x246)+_0x287538['count']+_0xab240f(0x1f8),_0xab240f(0x2ed));const _0x59ecc7=_0x5b68d7[_0xab240f(0x25d)]===0x0?getContext()[_0xab240f(0x1c2)][_0xab240f(0x213)]:_0x5b68d7[_0xab240f(0x25d)];_0x177bde[_0xab240f(0x2f9)]=_0xab240f(0x1c1)+_0x5b68d7[_0xab240f(0x1b7)]+_0xab240f(0x321)+_0x59ecc7+_0xab240f(0x2fd)+_0x287538[_0xab240f(0x2eb)]+_0xab240f(0x1f8);}else throw new Error(_0x287538[_0xab240f(0x221)]||_0xab240f(0x29c));}catch(_0x4592b2){console['error'](_0xab240f(0x2b3),_0x4592b2),toastr['error'](_0xab240f(0x287)+_0x4592b2[_0xab240f(0x1ec)],_0xab240f(0x1ba)),_0x177bde[_0xab240f(0x2f9)]='凝识失败:\x20'+_0x4592b2[_0xab240f(0x1ec)];}finally{await updatePanelStatus();}}async function loadWorldbookList(){const _0x1b63f5=_0x23b16d,_0x585353=document['getElementById'](_0x1b63f5(0x237));if(!_0x585353)return;try{log(_0x1b63f5(0x314),_0x1b63f5(0x263));const _0x583322=await _0x24d336[_0x1b63f5(0x256)]();_0x585353[_0x1b63f5(0x1de)]=_0x1b63f5(0x230);if(_0x583322[_0x1b63f5(0x213)]===0x0){_0x585353[_0x1b63f5(0x1de)]=_0x1b63f5(0x313);return;}_0x583322[_0x1b63f5(0x1d5)](_0x1d37d6=>{const _0xd7990b=_0x1b63f5,_0x437367=new Option(_0x1d37d6,_0x1d37d6);_0x585353[_0xd7990b(0x24a)](_0x437367);}),log(_0x1b63f5(0x21d)+_0x583322['length']+'\x20个书库。',_0x1b63f5(0x273));}catch(_0x103fe2){console['error']('[翰林院-枢纽]\x20加载书库列表失败:',_0x103fe2),log(_0x1b63f5(0x214)+_0x103fe2['message'],_0x1b63f5(0x221)),_0x585353[_0x1b63f5(0x1de)]=_0x1b63f5(0x279);}}async function handleWorldbookSelectionChange(){const _0x56beef=_0x23b16d,_0x5539c9=document['getElementById'](_0x56beef(0x237)),_0x27ccff=document[_0x56beef(0x2a2)](_0x56beef(0x304)),_0x152119=_0x5539c9[_0x56beef(0x1cb)];_0x27ccff[_0x56beef(0x1de)]=_0x56beef(0x223),_0x27ccff[_0x56beef(0x2dc)]=!![];if(!_0x152119){_0x27ccff['innerHTML']=_0x56beef(0x2e8);return;}try{log('正在为《'+_0x152119+_0x56beef(0x1dd),_0x56beef(0x263));const _0x58a433=await _0x24d336[_0x56beef(0x250)](_0x152119);_0x27ccff['innerHTML']=_0x56beef(0x22c);if(_0x58a433[_0x56beef(0x213)]===0x0){_0x27ccff[_0x56beef(0x1de)]=_0x56beef(0x2e6);return;}_0x58a433[_0x56beef(0x1d5)](_0x38a732=>{const _0x544458=_0x56beef,_0x430c86=new Option(_0x38a732[_0x544458(0x27f)]+'\x20(Key:\x20'+_0x38a732[_0x544458(0x2f0)]+')',_0x38a732[_0x544458(0x2f0)]);_0x27ccff['add'](_0x430c86);}),log(_0x56beef(0x21d)+_0x58a433[_0x56beef(0x213)]+_0x56beef(0x2b8),_0x56beef(0x273));}catch(_0x17206b){console[_0x56beef(0x221)](_0x56beef(0x21b)+_0x152119+'》的条目失败:',_0x17206b),log(_0x56beef(0x280)+_0x17206b['message'],'error'),_0x27ccff[_0x56beef(0x1de)]='';}finally{_0x27ccff[_0x56beef(0x2dc)]=![];}}async function startHistoriography(){const _0x4a3ca5=_0x23b16d,_0x436364=document[_0x4a3ca5(0x2a2)]('hly-hist-select-library')[_0x4a3ca5(0x1cb)],_0x19de1b=document[_0x4a3ca5(0x2a2)](_0x4a3ca5(0x304))[_0x4a3ca5(0x1cb)],_0x43b2b5=document[_0x4a3ca5(0x2a2)](_0x4a3ca5(0x219));if(!_0x436364||!_0x19de1b){toastr[_0x4a3ca5(0x301)]('请先选择一个书库和要编纂的条目。',_0x4a3ca5(0x21a));return;}_0x43b2b5[_0x4a3ca5(0x2f9)]=_0x4a3ca5(0x1cc)+_0x436364+_0x4a3ca5(0x1c4)+_0x19de1b+_0x4a3ca5(0x2fa),toastr[_0x4a3ca5(0x263)]('编纂任务已开始...','圣旨'),log(_0x4a3ca5(0x283)+_0x436364+'》-'+_0x19de1b+'\x20进行编纂...',_0x4a3ca5(0x263));try{const _0x4c0f02=await _0x24d336[_0x4a3ca5(0x30b)](_0x436364,_0x19de1b);if(_0x4c0f02[_0x4a3ca5(0x273)]){const _0x52e5b9=document[_0x4a3ca5(0x2a2)](_0x4a3ca5(0x304)),_0x4455e8=_0x52e5b9[_0x4a3ca5(0x201)][_0x52e5b9['selectedIndex']]['text'],_0xaeac50='《'+_0x436364+_0x4a3ca5(0x253)+_0x4455e8+_0x4a3ca5(0x2ea);_0x43b2b5[_0x4a3ca5(0x2f9)]=_0xaeac50,toastr[_0x4a3ca5(0x273)](_0x4a3ca5(0x2a8),'大功告成'),log('对《'+_0x436364+'》中条目\x20(Key:\x20'+_0x19de1b+')\x20的编纂任务已完成。',_0x4a3ca5(0x273));}else throw new Error(_0x4c0f02[_0x4a3ca5(0x221)]||_0x4a3ca5(0x1f5));}catch(_0xd41f5f){console[_0x4a3ca5(0x221)]('[翰林院-枢纽]\x20编纂过程发生错误:',_0xd41f5f),toastr['error'](_0x4a3ca5(0x2f4)+_0xd41f5f[_0x4a3ca5(0x1ec)],_0x4a3ca5(0x1ba)),_0x43b2b5['textContent']=_0x4a3ca5(0x2f4)+_0xd41f5f[_0x4a3ca5(0x1ec)];}}async function showStats(){const _0x1f7a1d=_0x23b16d;try{log(_0x1f7a1d(0x271),_0x1f7a1d(0x263)),toastr[_0x1f7a1d(0x263)]('正在查询宝库状态...','圣旨');const _0x4fd774=await _0x1eabfc['getVectorCount'](),_0x1654cc=await _0x1eabfc[_0x1f7a1d(0x281)](),_0x401cf5=_0x1eabfc[_0x1f7a1d(0x266)](),_0x25eddd=_0x1f7a1d(0x229)+_0x1654cc+_0x1f7a1d(0x1c8)+_0x4fd774+_0x1f7a1d(0x2c4)+_0x401cf5['retrieval'][_0x1f7a1d(0x25e)]+'\x0a所用模型:\x20'+_0x401cf5[_0x1f7a1d(0x310)]['embeddingModel']+_0x1f7a1d(0x27d);toastr[_0x1f7a1d(0x263)](_0x25eddd,'宝库状态',{'timeOut':0x3a98,'extendedTimeOut':0x1388,'tapToDismiss':!![],'closeButton':!![]}),log(_0x1f7a1d(0x307)+_0x1654cc+',\x20忆识总数='+_0x4fd774,'success');}catch(_0x32feeb){console['error'](_0x1f7a1d(0x27e),_0x32feeb),toastr[_0x1f7a1d(0x221)](_0x1f7a1d(0x275)+_0x32feeb[_0x1f7a1d(0x1ec)],_0x1f7a1d(0x1ba)),log(_0x1f7a1d(0x275)+_0x32feeb['message'],_0x1f7a1d(0x221));}}function showExclusionRulesModal(){const _0x443e0a=_0x23b16d,_0x4ee0b6=_0x1eabfc[_0x443e0a(0x266)](),_0x8fe63e=_0x4ee0b6[_0x443e0a(0x277)][_0x443e0a(0x1e5)]||[],_0xf43151=(_0x3c9efb={'start':'','end':''},_0x513c20)=>_0x443e0a(0x2b5)+_0x513c20+'\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
在这里定义需要从提取内容中排除的文本片段。例如,排除HTML注释,可以设置开始字符为\x20``。
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x3bd2cb+_0x443e0a(0x262);showHtmlModal(_0x443e0a(0x217),_0x2b19d5,{'okText':_0x443e0a(0x1e7),'onOk':_0x4f0728=>{const _0x4c7ff5=_0x443e0a,_0x58712e=[];_0x4f0728[_0x4c7ff5(0x1c0)]('.hly-exclusion-rule-row')[_0x4c7ff5(0x2a5)](function(){const _0xe9f1fe=_0x4c7ff5,_0x30e7da=$(this)[_0xe9f1fe(0x1c0)](_0xe9f1fe(0x240))['eq'](0x0)[_0xe9f1fe(0x210)]()[_0xe9f1fe(0x1f0)](),_0x2d2c23=$(this)[_0xe9f1fe(0x1c0)](_0xe9f1fe(0x240))['eq'](0x1)[_0xe9f1fe(0x210)]()[_0xe9f1fe(0x1f0)]();_0x30e7da&&_0x2d2c23&&_0x58712e[_0xe9f1fe(0x203)]({'start':_0x30e7da,'end':_0x2d2c23});}),updateAndSaveSetting('condensation.exclusionRules',_0x58712e),toastr[_0x4c7ff5(0x273)](_0x4c7ff5(0x2d7),_0x4c7ff5(0x2f5));}});const _0x194ad4=document[_0x443e0a(0x2a2)](_0x443e0a(0x2e9)),_0x375ba2=_0x194ad4['querySelector']('#hly-rules-list');_0x194ad4['querySelector']('#hly-add-rule-btn')['addEventListener'](_0x443e0a(0x1be),()=>{const _0x53baeb=_0x443e0a,_0xb29185=_0x375ba2['children'][_0x53baeb(0x213)],_0x1e40a1=_0xf43151({'start':'','end':''},_0xb29185);_0x375ba2[_0x53baeb(0x1ca)]('beforeend',_0x1e40a1);}),_0x375ba2[_0x443e0a(0x206)]('click',_0x32b90e=>{const _0x52e092=_0x443e0a;_0x32b90e[_0x52e092(0x25b)]['classList']['contains'](_0x52e092(0x2cb))&&_0x32b90e[_0x52e092(0x25b)][_0x52e092(0x290)](_0x52e092(0x238))[_0x52e092(0x289)]();});}function previewCondensation(){const _0xfce232=_0x23b16d,_0x3a2b3a=document[_0xfce232(0x2a2)](_0xfce232(0x2ac));try{const _0x1fc426=_0x1eabfc[_0xfce232(0x266)](),_0x20b776=_0x1fc426[_0xfce232(0x277)][_0xfce232(0x1e5)]||[],_0x4988ab={'user':document[_0xfce232(0x2a2)]('hly-include-user')['checked'],'ai':document[_0xfce232(0x2a2)]('hly-include-ai')['checked']},_0x1b638c=document[_0xfce232(0x2a2)]('hly-tag-extraction-toggle')['checked'],_0x55ab66=_0x1b638c?document[_0xfce232(0x2a2)](_0xfce232(0x268))['value'][_0xfce232(0x2e1)](',')['map'](_0x125553=>_0x125553[_0xfce232(0x1f0)]())['filter'](Boolean):[],_0x5d5cad=_0x1eabfc[_0xfce232(0x209)](_0x4988ab);if(!_0x5d5cad||_0x5d5cad[_0xfce232(0x213)]===0x0){_0x3a2b3a[_0xfce232(0x2f9)]=_0xfce232(0x2a1),toastr[_0xfce232(0x301)]('未找到符合条件的消息。','翰林院启奏');return;}const _0x5d9884=getContext()[_0xfce232(0x1c2)],_0x41e9b7=_0x5d5cad['map']((_0x4fc918,_0x589bee)=>{const _0x1adc76=_0xfce232;let _0x26c926;if(_0x4fc918['is_user'])_0x26c926=_0x4fc918[_0x1adc76(0x315)];else{if(_0x1b638c&&_0x55ab66[_0x1adc76(0x213)]>0x0){const _0x48502a=extractBlocksByTags(_0x4fc918[_0x1adc76(0x315)],_0x55ab66);_0x26c926=_0x48502a[_0x1adc76(0x292)]('\x0a\x0a');}else _0x26c926=_0x4fc918[_0x1adc76(0x315)];_0x26c926=applyExclusionRules(_0x26c926,_0x20b776);}const _0x3d10aa=_0x5d9884['findIndex'](_0x5f5dad=>_0x5f5dad===_0x4fc918),_0x32d99c=_0x3d10aa!==-0x1?_0x3d10aa+0x1:-0x1;return{'id':_0x1adc76(0x2cc)+_0x589bee,'name':_0x4fc918[_0x1adc76(0x218)],'content':_0x26c926['trim'](),'floor':_0x32d99c,'is_user':_0x4fc918[_0x1adc76(0x2b6)],'send_date':_0x4fc918[_0x1adc76(0x248)]};})['filter'](_0xf13c53=>_0xf13c53[_0xfce232(0x2fe)]);if(_0x41e9b7['length']===0x0){_0x3a2b3a['textContent']=_0xfce232(0x28d),toastr[_0xfce232(0x301)]('根据标签提取或内容排除条件,未找到任何有效内容。','翰林院启奏');return;}const _0x1a26c1=_0x41e9b7[_0xfce232(0x22b)]((_0x3d7a21,_0x423c98)=>_0xfce232(0x1f2)+_0x3d7a21['id']+_0xfce232(0x215)+_0x3d7a21[_0xfce232(0x20e)]+'\x20楼:\x20['+_0x3d7a21['name']+_0xfce232(0x1eb)+_0x3d7a21[_0xfce232(0x20e)]+_0xfce232(0x1fb)+_0x3d7a21[_0xfce232(0x2b6)]+'\x22\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20data-send-date=\x22'+_0x3d7a21[_0xfce232(0x248)]+'\x22>'+_0x3d7a21[_0xfce232(0x2fe)]+_0xfce232(0x2dd)+_0x3d7a21['id']+_0xfce232(0x1ea))['join']('');showHtmlModal(_0xfce232(0x22e),_0xfce232(0x232)+_0x1a26c1+'
',{'okText':'确认并更新预览','onOk':_0x44bb03=>{const _0x3d77ee=_0xfce232,_0x5928e4=[];_0x44bb03[_0x3d77ee(0x1c0)]('.hly-preview-item-v2')[_0x3d77ee(0x2a5)](function(){const _0x1b4e00=_0x3d77ee,_0x3714a7=$(this)[_0x1b4e00(0x1c0)](_0x1b4e00(0x24f)),_0x2d3575=_0x3714a7[_0x1b4e00(0x210)]();_0x2d3575[_0x1b4e00(0x1f0)]()&&_0x5928e4[_0x1b4e00(0x203)]({'mes':_0x2d3575,'is_user':_0x3714a7['data']('is-user'),'send_date':_0x3714a7['data'](_0x1b4e00(0x2a6)),'floor':_0x3714a7[_0x1b4e00(0x276)]('floor')});}),_0x3a2b3a[_0x3d77ee(0x244)][_0x3d77ee(0x1fd)]=JSON[_0x3d77ee(0x245)](_0x5928e4);const _0x2e0dab=document[_0x3d77ee(0x2a2)]('hly-layer-start')[_0x3d77ee(0x1cb)],_0x460453=document[_0x3d77ee(0x2a2)](_0x3d77ee(0x1bf))[_0x3d77ee(0x1cb)];_0x3a2b3a['textContent']='已选择\x20'+_0x2e0dab+_0x3d77ee(0x20b)+_0x460453+_0x3d77ee(0x2d3)+_0x5928e4[_0x3d77ee(0x213)]+_0x3d77ee(0x2b0),toastr[_0x3d77ee(0x273)](_0x3d77ee(0x1e1),_0x3d77ee(0x2f5));}}),$('.hly-preview-delete-btn-v2')['on']('click',function(_0x3715aa){const _0x2e74bb=_0xfce232;_0x3715aa[_0x2e74bb(0x2e5)]();const _0x42ae55=$(this)[_0x2e74bb(0x276)](_0x2e74bb(0x25b));$('#'+_0x42ae55)[_0x2e74bb(0x289)]();});}catch(_0x389539){console[_0xfce232(0x221)](_0xfce232(0x20d),_0x389539),_0x3a2b3a['textContent']='预览失败:\x20'+_0x389539[_0xfce232(0x1ec)],toastr['error']('预览失败:\x20'+_0x389539[_0xfce232(0x1ec)],_0xfce232(0x1ba));}}function log(_0x4e1c04,_0x2465a7=_0x23b16d(0x263)){const _0x3cc89c=_0x23b16d,_0xf73ffa=document[_0x3cc89c(0x2a2)](_0x3cc89c(0x30c));if(!_0xf73ffa)return;const _0x49440a=document['createElement']('p'),_0x41bb07=new Date()[_0x3cc89c(0x265)]();let _0x2015d3=_0x3cc89c(0x212),_0xadbfa0=_0x3cc89c(0x2f8);switch(_0x2465a7){case _0x3cc89c(0x273):_0x2015d3=_0x3cc89c(0x1f4),_0xadbfa0='log-success';break;case _0x3cc89c(0x221):_0x2015d3=_0x3cc89c(0x227),_0xadbfa0='log-error';break;case _0x3cc89c(0x2ef):_0x2015d3=_0x3cc89c(0x2da),_0xadbfa0=_0x3cc89c(0x29d);break;}_0x49440a['className']=_0x3cc89c(0x205)+_0xadbfa0,_0x49440a[_0x3cc89c(0x1de)]=_0x3cc89c(0x1b6)+_0x2015d3+_0x3cc89c(0x30a)+_0x41bb07+']\x20'+_0x4e1c04;const _0x225ddb=_0xf73ffa[_0x3cc89c(0x2b7)](_0x3cc89c(0x29a));_0x225ddb&&_0x225ddb[_0x3cc89c(0x289)](),_0xf73ffa[_0x3cc89c(0x303)](_0x49440a),_0xf73ffa[_0x3cc89c(0x2ff)]=_0xf73ffa[_0x3cc89c(0x1b8)];}async function ingestManualText(){const _0xa66715=_0x23b16d,_0x24ca1f=document['getElementById'](_0xa66715(0x309)),_0x4b3d47=_0x24ca1f[_0xa66715(0x1cb)][_0xa66715(0x1f0)]();if(!_0x4b3d47){toastr[_0xa66715(0x301)]('录入内容不能为空。',_0xa66715(0x1d9)),log(_0xa66715(0x297),_0xa66715(0x2ef));return;}log(_0xa66715(0x23f)+_0x4b3d47[_0xa66715(0x213)],'info'),toastr[_0xa66715(0x263)]('正在处理您提交的文书...','圣旨');try{const _0x2b9bf8=await _0x1eabfc[_0xa66715(0x300)](_0x4b3d47,'manual','手动录入');if(_0x2b9bf8[_0xa66715(0x273)])toastr[_0xa66715(0x273)](_0xa66715(0x1ff)+_0x2b9bf8['count']+_0xa66715(0x1f8),_0xa66715(0x2ed)),log(_0xa66715(0x27b)+_0x2b9bf8[_0xa66715(0x2eb)]+_0xa66715(0x1f8),'success'),_0x24ca1f[_0xa66715(0x1cb)]='';else throw new Error(_0x2b9bf8[_0xa66715(0x221)]||_0xa66715(0x29c));}catch(_0x162036){console[_0xa66715(0x221)](_0xa66715(0x251),_0x162036),toastr[_0xa66715(0x221)](_0xa66715(0x1e6)+_0x162036[_0xa66715(0x1ec)],'严重错误'),log(_0xa66715(0x1d7)+_0x162036[_0xa66715(0x1ec)],_0xa66715(0x221));}finally{await updatePanelStatus();}}
+const _0x58cad7=_0x15ab;(function(_0x222ad3,_0x3467b5){const _0x25b015=_0x15ab,_0x15b172=_0x222ad3();while(!![]){try{const _0x54ed71=-parseInt(_0x25b015(0x25a))/0x1*(parseInt(_0x25b015(0x257))/0x2)+-parseInt(_0x25b015(0x2f0))/0x3*(-parseInt(_0x25b015(0x2af))/0x4)+parseInt(_0x25b015(0x24e))/0x5*(-parseInt(_0x25b015(0x2df))/0x6)+parseInt(_0x25b015(0x193))/0x7+-parseInt(_0x25b015(0x260))/0x8+parseInt(_0x25b015(0x2f8))/0x9+parseInt(_0x25b015(0x235))/0xa;if(_0x54ed71===_0x3467b5)break;else _0x15b172['push'](_0x15b172['shift']());}catch(_0x8b779b){_0x15b172['push'](_0x15b172['shift']());}}}(_0x266d,0x33dc6));import{getContext}from'/scripts/extensions.js';import*as _0x3c94ac from'../core/rag-processor.js';import*as _0xc72edd from'../core/historiographer.js';import*as _0x204fb4 from'../core/utils/context-utils.js';import*as _0x545a1d from'../core/ingestion-manager.js';import{showContentModal,showHtmlModal}from'./page-window.js';import{extractBlocksByTags,applyExclusionRules}from'../core/utils/rag-tag-extractor.js';_0x58cad7(0x1a2);function setupGlobalEventHandlers(){const _0x552448=_0x58cad7;window['saveHLYSettings']=()=>saveSettingsFromUI(![]),window[_0x552448(0x215)]=resetSettingsToUI,window[_0x552448(0x1f0)]=testApi,window[_0x552448(0x1d4)]=fetchHLYEmbeddingModels,window[_0x552448(0x24d)]=fetchHLYRerankModels,window[_0x552448(0x24c)]=updatePanelStatus,window[_0x552448(0x199)]=purgeStorage,window[_0x552448(0x270)]=startCondensation,window[_0x552448(0x286)]=previewCondensation,window[_0x552448(0x194)]=ingestManualText,window[_0x552448(0x191)]=log,window['showHLYStats']=showStats,window[_0x552448(0x23b)]=startHistoriography;}function updateAndSaveSetting(_0x4204f2,_0xf1970){const _0x3eeff5=_0x58cad7,_0x16833a=_0x3c94ac[_0x3eeff5(0x263)]();if(!_0x16833a)return;const _0x522c56=_0x4204f2[_0x3eeff5(0x230)]('.');let _0x3a5db7=_0x16833a;for(let _0x2cd56a=0x0;_0x2cd56a<_0x522c56[_0x3eeff5(0x1f8)]-0x1;_0x2cd56a++){_0x3a5db7=_0x3a5db7[_0x522c56[_0x2cd56a]]=_0x3a5db7[_0x522c56[_0x2cd56a]]||{};}_0x3a5db7[_0x522c56[_0x522c56[_0x3eeff5(0x1f8)]-0x1]]=_0xf1970,_0x3c94ac[_0x3eeff5(0x290)](),log(_0x3eeff5(0x2e5)+_0x4204f2+'\x27\x20已更新为:\x20'+JSON[_0x3eeff5(0x258)](_0xf1970),'success');}function bindAutoSaveEvents(){const _0x3b35f5=_0x58cad7,_0x516bc0=document['getElementById'](_0x3b35f5(0x2c5));if(!_0x516bc0)return;_0x516bc0['addEventListener'](_0x3b35f5(0x2e2),_0x15f551=>{const _0x328503=_0x3b35f5,_0x18a576=_0x15f551[_0x328503(0x23d)],_0x549673=_0x18a576['dataset'][_0x328503(0x29a)];if(!_0x549673)return;let _0x258ba3;const _0x4a4d6a=_0x18a576[_0x328503(0x2b4)][_0x328503(0x2d8)]||'string';if(_0x18a576[_0x328503(0x2d8)]===_0x328503(0x1f2))_0x258ba3=_0x18a576[_0x328503(0x1df)];else{if(_0x18a576[_0x328503(0x2d8)]===_0x328503(0x29d)){if(_0x18a576['checked']){const _0x1fd55e=_0x516bc0[_0x328503(0x220)](_0x328503(0x27f)+_0x18a576['name']+'\x22]'),_0x29c39c=Array['from'](_0x1fd55e)[_0x328503(0x1c3)](_0x92815d=>_0x92815d['checked']);_0x258ba3=_0x29c39c['value'];}else return;}else _0x258ba3=_0x18a576[_0x328503(0x241)];}switch(_0x4a4d6a){case _0x328503(0x1b9):_0x258ba3=parseInt(_0x258ba3,0xa);break;case _0x328503(0x1b7):_0x258ba3=parseFloat(_0x258ba3);break;case _0x328503(0x2c9):typeof _0x258ba3!==_0x328503(0x2c9)&&(_0x258ba3=_0x258ba3===_0x328503(0x269));break;}if(_0x18a576['type']===_0x328503(0x29d)&&!_0x18a576['checked'])return;updateAndSaveSetting(_0x549673,_0x258ba3);});}export function bindHanlinyuanEvents(){const _0xf6e142=_0x58cad7,_0x4bc408=getContext();if(!_0x4bc408){console[_0xf6e142(0x2d2)]('[翰林院-枢纽]\x20未能获取SillyTavern上下文,绑定失败。');return;}setupGlobalEventHandlers(),bindPanelToggleEvents(),bindInternalUIEvents(),bindTutorialEvents(),bindAutoSaveEvents(),bindSessionLockEvent();if(_0x3c94ac[_0xf6e142(0x29f)])_0x3c94ac[_0xf6e142(0x29f)]();else{console[_0xf6e142(0x2d2)]('[翰林院-枢纽]\x20核心法典未能提供初始化圣旨!');return;}loadSettingsToUI(),loadWorldbookList(),log(_0xf6e142(0x1bb),_0xf6e142(0x2a9));const _0x339a10=document['getElementById'](_0xf6e142(0x25e)),_0x1bf497=document[_0xf6e142(0x216)](_0xf6e142(0x2b1)),_0x30ce5f=document[_0xf6e142(0x216)](_0xf6e142(0x2d0)),_0x47d59b=document[_0xf6e142(0x216)](_0xf6e142(0x210)),_0x5fe143=document['getElementById'](_0xf6e142(0x26d)),_0x31e309=document[_0xf6e142(0x216)]('hanlinyuan-ingest-progress-bar'),_0x161ff7=document[_0xf6e142(0x216)](_0xf6e142(0x213)),_0x3c8818=document['getElementById']('hanlinyuan-ingest-novel-controls');let _0x3be820=null,_0x4b82e3=null;_0x339a10[_0xf6e142(0x29e)]('change',_0x43dbb9=>{const _0x430c82=_0xf6e142;_0x3be820=_0x43dbb9['target']['files'][0x0],_0x3be820?(_0x1bf497[_0x430c82(0x298)]=_0x3be820[_0x430c82(0x29b)],_0x1bf497[_0x430c82(0x231)]=_0x3be820[_0x430c82(0x29b)]):_0x1bf497['textContent']=_0x430c82(0x1ad);}),_0x30ce5f[_0xf6e142(0x29e)](_0xf6e142(0x19e),async()=>{const _0x1db5a1=_0xf6e142;if(!_0x3be820){toastr[_0x1db5a1(0x22e)](_0x1db5a1(0x2da));return;}let _0x301ab4=0x0;const _0x3151a0=_0x545a1d['generateJobId'](_0x3be820),_0x2965a6=_0x545a1d[_0x1db5a1(0x2e6)](_0x3151a0);if(_0x2965a6){const _0x38b33f=(_0x2965a6['processedChunks']/_0x2965a6['totalChunks']*0x64)[_0x1db5a1(0x203)](0x1),_0x2d216f=confirm('启禀大人,发现此书上次录入已完成\x20'+_0x38b33f+'%。是否从上次中断之处继续?');_0x2d216f?(_0x301ab4=_0x2965a6['processedChunks'],toastr[_0x1db5a1(0x2a9)](_0x1db5a1(0x218)+(_0x301ab4+0x1)+_0x1db5a1(0x2ad),_0x1db5a1(0x26e)),log(_0x1db5a1(0x297)+_0x3151a0+_0x1db5a1(0x1dd)+_0x301ab4+_0x1db5a1(0x1b6),_0x1db5a1(0x2a9))):(_0x545a1d[_0x1db5a1(0x27a)](_0x3151a0),toastr[_0x1db5a1(0x2a9)]('遵命,将从头开始录入此书。',_0x1db5a1(0x26e)),log(_0x1db5a1(0x22f)+_0x3151a0+_0x1db5a1(0x185),'warn'));}_0x4b82e3=new AbortController();const _0x22729d=_0x4b82e3['signal'];_0x3c8818[_0x1db5a1(0x18b)][_0x1db5a1(0x1b2)]=_0x1db5a1(0x1a5),_0x5fe143['style'][_0x1db5a1(0x1b2)]=_0x1db5a1(0x267),_0x161ff7['textContent']='正在读取文件...',_0x31e309[_0x1db5a1(0x241)]=0x0;try{const _0xcfbec4=await _0x3be820[_0x1db5a1(0x274)](),_0x2acc17=_0x568b53=>{const _0x2ff35e=_0x1db5a1;_0x161ff7[_0x2ff35e(0x298)]=_0x2ff35e(0x1e8)+_0x568b53[_0x2ff35e(0x2bc)]+'\x20('+_0x568b53[_0x2ff35e(0x2ca)]+'/'+_0x568b53[_0x2ff35e(0x2de)]+')',_0x31e309[_0x2ff35e(0x241)]=_0x568b53[_0x2ff35e(0x2ca)]/_0x568b53[_0x2ff35e(0x2de)]*0x64;},_0x49e40d=()=>{const _0x315e8c=_0x1db5a1;updatePanelStatus(),log('[实时刷新]\x20批次完成,忆识总数已更新。',_0x315e8c(0x2a9));},_0x481fd0=await _0x3c94ac[_0x1db5a1(0x237)](_0xcfbec4,'novel',_0x3be820[_0x1db5a1(0x29b)],_0x2acc17,_0x22729d,log,_0x49e40d,_0x3151a0,_0x301ab4);if(_0x481fd0['success'])toastr[_0x1db5a1(0x233)](_0x1db5a1(0x1e2)+_0x481fd0[_0x1db5a1(0x296)]+_0x1db5a1(0x2dd)),_0x161ff7[_0x1db5a1(0x298)]=_0x1db5a1(0x227)+_0x481fd0[_0x1db5a1(0x296)]+'\x20个知识块。',_0x31e309[_0x1db5a1(0x241)]=0x64,updatePanelStatus();else throw new Error(_0x481fd0['error']||_0x1db5a1(0x2b2));}catch(_0xaba630){_0xaba630[_0x1db5a1(0x29b)]==='AbortError'?(toastr[_0x1db5a1(0x2a9)](_0x1db5a1(0x2ab)),_0x161ff7['textContent']=_0x1db5a1(0x1e6)):(toastr['error'](_0x1db5a1(0x2a8)+_0xaba630[_0x1db5a1(0x2bc)]+_0x1db5a1(0x190)),_0x161ff7['textContent']='错误:\x20'+_0xaba630[_0x1db5a1(0x2bc)]);}finally{setTimeout(()=>{const _0x348553=_0x1db5a1;_0x3c8818[_0x348553(0x18b)]['display']=_0x348553(0x1a7),_0x5fe143[_0x348553(0x18b)][_0x348553(0x1b2)]='none',_0x339a10[_0x348553(0x241)]='',_0x3be820=null,_0x1bf497['textContent']=_0x348553(0x1ad);},0xbb8);}}),_0x47d59b[_0xf6e142(0x29e)](_0xf6e142(0x19e),()=>{const _0x258e50=_0xf6e142;_0x4b82e3&&_0x4b82e3[_0x258e50(0x214)]();});}function bindSessionLockEvent(){const _0x214123=_0x58cad7,_0x5dd9d9=document[_0x214123(0x216)]('hly-session-lock-btn');if(!_0x5dd9d9)return;_0x5dd9d9['addEventListener'](_0x214123(0x19e),async()=>{const _0x2b6933=_0x214123,_0x390f21=await _0x3c94ac[_0x2b6933(0x22a)]();updateSessionLockUI(_0x390f21);if(_0x390f21){const _0xa5f994=_0x3c94ac[_0x2b6933(0x22d)]();_0xa5f994&&(toastr['success'](_0x2b6933(0x1f7)+_0xa5f994['id'],_0x2b6933(0x18d)),log(_0x2b6933(0x25c)+_0xa5f994['id'],_0x2b6933(0x233)));}else toastr[_0x2b6933(0x2a9)](_0x2b6933(0x2f7),'诏曰'),log(_0x2b6933(0x254),_0x2b6933(0x2a9));updatePanelStatus();}),updateSessionLockUI(_0x3c94ac['isSessionLocked']());}function updateSessionLockUI(_0x346082){const _0x2ab0c7=_0x58cad7,_0x5dc8c9=document[_0x2ab0c7(0x216)](_0x2ab0c7(0x1a0));if(!_0x5dc8c9)return;const _0x1a76a3=_0x5dc8c9[_0x2ab0c7(0x21c)]('i'),_0x3312e0=_0x5dc8c9[_0x2ab0c7(0x21c)](_0x2ab0c7(0x2e9));_0x346082?(_0x5dc8c9[_0x2ab0c7(0x2eb)]['add'](_0x2ab0c7(0x1a9)),_0x1a76a3[_0x2ab0c7(0x299)]='fas\x20fa-lock',_0x3312e0[_0x2ab0c7(0x298)]=_0x2ab0c7(0x196),_0x5dc8c9[_0x2ab0c7(0x231)]=_0x2ab0c7(0x184)):(_0x5dc8c9['classList'][_0x2ab0c7(0x192)](_0x2ab0c7(0x1a9)),_0x1a76a3['className']=_0x2ab0c7(0x1fa),_0x3312e0['textContent']=_0x2ab0c7(0x18c),_0x5dc8c9['title']=_0x2ab0c7(0x252));}function bindPanelToggleEvents(){const _0xd3a8d5=_0x58cad7,_0x448178=document['getElementById'](_0xd3a8d5(0x1e3));if(_0x448178){}}function bindTutorialEvents(){const _0x5563e4=_0x58cad7,_0x1502b4=document['getElementById'](_0x5563e4(0x268));_0x1502b4&&_0x1502b4[_0x5563e4(0x29e)](_0x5563e4(0x19e),()=>{const _0x39ffac=_0x5563e4;showContentModal(_0x39ffac(0x189),_0x39ffac(0x1d5));});}function _0x266d(){const _0x33d708=['hanlinyuan-ingest-status','abort','resetHLYSettings','getElementById','可在此预览凝识结果。','预览失败:\x20','messageTypes','任务完成!成功录入\x20','fa-check-circle','》中的条目【','toggleSessionLock','chunkSize','retrieval','getLockedSessionInfo','warning','[断点续传]\x20用户选择放弃旧任务\x20','split','title','send-date','success','hly-injection-role','1402310PDkMLZ','hly-api-endpoint','ingestTextToHanlinyuan','custom','hly-rerank-url','\x0a\x20\x20\x20\x20\x20\x20\x20\x20正在获取...','value','编纂任务已完成。','','.hly-nav-item','》中条目\x20(Key:\x20','用户尝试录入空文本。','\x0a所用模型:\x20','hly-layer-start','编纂失败:\x20','.hly-exclusion-rule-row','\x20个Rerank模型。','updateHLYMemoryCount','fetchHLYRerankModels','202385EFlYfR','hly-chunk-size','\x22\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20data-send-date=\x22','\x20(Key:\x20','点击以锁定,让翰林院固定操作当前角色的宝库','appendChild','会话已解锁。',')\x20的编纂任务已完成。','-tab','174jQrGuP','stringify','[翰林院-枢纽]\x20编纂过程发生错误:','3517AdWxul','\x20进行编纂...','会话已锁定到宝库:\x20','condensation','hanlinyuan-ingest-novel-file-input','hly-rerank-model','1681280fRMOZc','\x22\x20placeholder=\x22结束字符,\x20如\x20-->\x22>\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','hly-include-user','getSettings','getChatId','layerStart','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','input[name=\x22hly-injection-position\x22]:checked','previewHLYCondensation','》的条目失败:','\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