diff --git a/core/historiographer.js b/core/historiographer.js index d4a9a37..96f4563 100644 --- a/core/historiographer.js +++ b/core/historiographer.js @@ -1 +1 @@ -const _0x5979b5=_0x3157;(function(_0x1f54ce,_0x4cc3db){const _0x19e11b=_0x3157,_0xddf3c2=_0x1f54ce();while(!![]){try{const _0x1930ba=parseInt(_0x19e11b(0x1bd))/0x1+parseInt(_0x19e11b(0x1dd))/0x2+-parseInt(_0x19e11b(0x13a))/0x3+parseInt(_0x19e11b(0x1f9))/0x4+parseInt(_0x19e11b(0x1ca))/0x5*(parseInt(_0x19e11b(0x1a9))/0x6)+parseInt(_0x19e11b(0x179))/0x7+-parseInt(_0x19e11b(0x16c))/0x8;if(_0x1930ba===_0x4cc3db)break;else _0xddf3c2['push'](_0xddf3c2['shift']());}catch(_0x53cf7f){_0xddf3c2['push'](_0xddf3c2['shift']());}}}(_0x4596,0x584db));import{getContext,extension_settings}from'/scripts/extensions.js';import{characters}from'/script.js';import{extractBlocksByTags,applyExclusionRules}from'./utils/rag-tag-extractor.js';import{world_names,loadWorldInfo,createNewWorldInfo,createWorldInfoEntry,saveWorldInfo}from'/scripts/world-info.js';import{extensionName}from'../utils/settings.js';import{getChatIdentifier,writeToLorebookWithTavernHelper}from'./lore.js';import{ingestTextToHanlinyuan}from'./rag-processor.js';import{showSummaryModal,showHtmlModal}from'../ui/page-window.js';import{getPresetPrompts,getMixedOrder}from'../PresetSettings/index.js';import{callAI,generateRandomSeed}from'./api.js';let isExpeditionRunning=![],manualStopRequested=![];const RUNNING_LOG_COMMENT=_0x5979b5(0x1dc),PROGRESS_SEAL_REGEX=/本条勿动【前(\d+)楼总结已完成】否则后续总结无法进行。$/;async function readGoldenLedgerProgress(_0x3f510c){const _0x444a0f=_0x5979b5;if(!_0x3f510c)return 0x0;try{const _0x27b1e9=await loadWorldInfo(_0x3f510c);if(!_0x27b1e9||!_0x27b1e9[_0x444a0f(0x12c)])return 0x0;const _0x4cbd5e=Object['values'](_0x27b1e9[_0x444a0f(0x12c)])[_0x444a0f(0x19e)](_0x2cc384=>_0x2cc384[_0x444a0f(0x1c1)]===RUNNING_LOG_COMMENT&&!_0x2cc384[_0x444a0f(0x1ef)]);if(!_0x4cbd5e)return 0x0;const _0x52fe04=_0x4cbd5e[_0x444a0f(0x172)][_0x444a0f(0x166)](PROGRESS_SEAL_REGEX);return _0x52fe04?parseInt(_0x52fe04[0x1],0xa):0x0;}catch(_0x3979db){return console[_0x444a0f(0x17c)](_0x444a0f(0x1b2)+_0x3f510c+'》天机时出错:',_0x3979db),0x0;}}export async function checkAndTriggerAutoSummary(){const _0x2a636f=_0x5979b5;if(isExpeditionRunning)return;const _0x8cf107=extension_settings[extensionName];if(!_0x8cf107['historiographySmallAutoEnable'])return;const _0x360639=getContext();let _0x498bb7=null;switch(_0x8cf107[_0x2a636f(0x149)]){case _0x2a636f(0x1b5):_0x498bb7=characters[_0x360639[_0x2a636f(0x1df)]]?.[_0x2a636f(0x1d9)]?.[_0x2a636f(0x1b7)]?.[_0x2a636f(0x131)];break;case _0x2a636f(0x192):const _0x4069c4=await getChatIdentifier();_0x498bb7=_0x2a636f(0x1cb)+_0x4069c4;break;default:return;}if(!_0x498bb7)return;const _0x513c20=await readGoldenLedgerProgress(_0x498bb7),_0x303520=_0x360639[_0x2a636f(0x140)]['length'],_0x372a8f=_0x303520-_0x513c20;if(_0x372a8f>=_0x8cf107['historiographySmallTriggerThreshold']+0x2){const _0xfb7805=_0x8cf107[_0x2a636f(0x1da)],_0x5cad2b=_0x513c20+0x1,_0x18fea9=Math[_0x2a636f(0x199)](_0x513c20+_0xfb7805,_0x303520);console[_0x2a636f(0x1a3)](_0x2a636f(0x1c2)+_0x5cad2b+_0x2a636f(0x182)+_0x18fea9+'\x20楼。');const _0xacf121=_0x8cf107[_0x2a636f(0x16f)]??![];await executeManualSummary(_0x5cad2b,_0x18fea9,!_0xacf121);}}export async function getAvailableWorldbooks(){return[...world_names];}export async function getLoresForWorldbook(_0x1e7003){const _0x2fee2d=_0x5979b5;if(!_0x1e7003)return[];try{const _0x12b75c=await loadWorldInfo(_0x1e7003);if(!_0x12b75c||!_0x12b75c[_0x2fee2d(0x12c)])return[];return Object['entries'](_0x12b75c[_0x2fee2d(0x12c)])[_0x2fee2d(0x193)](([,_0x31b073])=>!_0x31b073[_0x2fee2d(0x1ef)])[_0x2fee2d(0x137)](([_0x131293,_0x3dabce])=>({'key':_0x131293,'comment':_0x3dabce[_0x2fee2d(0x1c1)]||_0x2fee2d(0x1f0)}));}catch(_0x4ccb24){return console['error'](_0x2fee2d(0x152)+_0x1e7003+'》时出错:',_0x4ccb24),[];}}export async function executeManualSummary(_0x155cea,_0x4df02e,_0x5aa30b=![]){return new Promise(async _0x2c12d3=>{const _0x99ad47=_0x3157,_0x479a2e=_0x5aa30b?_0x99ad47(0x170):_0x99ad47(0x1d1),_0x5b21fb=getContext();if(_0x5aa30b){const _0x11d621=getRawMessagesForSummary(_0x155cea,_0x4df02e);if(!_0x11d621||_0x11d621[_0x99ad47(0x18b)]===0x0)return toastr[_0x99ad47(0x12b)](_0x99ad47(0x1b1),_0x479a2e),_0x2c12d3(![]);const _0x506d0c=_0x11d621['map'](_0x35c781=>_0x99ad47(0x1c8)+_0x35c781[_0x99ad47(0x1a1)]+_0x99ad47(0x1ed)+_0x35c781[_0x99ad47(0x1a6)]+':\x20'+_0x35c781[_0x99ad47(0x172)])[_0x99ad47(0x133)]('\x0a'),_0x28802c=await getSummary(_0x506d0c,_0x479a2e);_0x28802c?showSummaryModal(_0x28802c,{'onConfirm':async _0x5f11fb=>{const _0x1af6cb=await writeSummary(_0x5f11fb,_0x155cea,_0x4df02e,_0x479a2e);_0x2c12d3(_0x1af6cb);},'onRegenerate':async _0x39c2e4=>{const _0x35bd9d=_0x99ad47;_0x39c2e4['find'](_0x35bd9d(0x1c3))['prop'](_0x35bd9d(0x1c4),!![])[_0x35bd9d(0x148)](_0x35bd9d(0x132));const _0x495cca=await getSummary(_0x506d0c,_0x479a2e);_0x495cca?_0x39c2e4[_0x35bd9d(0x19e)](_0x35bd9d(0x1c3))[_0x35bd9d(0x1c5)](_0x35bd9d(0x1c4),![])[_0x35bd9d(0x148)](_0x495cca):(_0x39c2e4[_0x35bd9d(0x19e)]('textarea')[_0x35bd9d(0x1c5)](_0x35bd9d(0x1c4),![])[_0x35bd9d(0x148)](_0x28802c),toastr[_0x35bd9d(0x17c)]('重新生成失败,已恢复原始内容。',_0x35bd9d(0x1b9)));},'onCancel':()=>{toastr['info']('本批次总结已取消。',_0x479a2e),_0x2c12d3(![]);}}):_0x2c12d3(![]);return;}const _0x495fb3=getRawMessagesForSummary(_0x155cea,_0x4df02e);if(!_0x495fb3||_0x495fb3[_0x99ad47(0x18b)]===0x0)return toastr[_0x99ad47(0x12b)](_0x99ad47(0x158),'圣谕有误'),_0x2c12d3(![]);const _0x245278=_0x32a73f=>{const _0x4afb74=_0x99ad47,_0x5a6af0=_0x32a73f[_0x4afb74(0x137)](_0x38bcf9=>_0x4afb74(0x156)+_0x38bcf9[_0x4afb74(0x1bc)]+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20【第\x20'+_0x38bcf9['floor']+_0x4afb74(0x1ed)+_0x38bcf9[_0x4afb74(0x1a6)]+_0x4afb74(0x183)+_0x38bcf9[_0x4afb74(0x1a1)]+'\x22>'+_0x38bcf9[_0x4afb74(0x172)]+_0x4afb74(0x150))[_0x4afb74(0x133)]('');return _0x4afb74(0x180)+(_0x5b21fb['name1']||'用户')+_0x4afb74(0x14e)+(_0x5b21fb[_0x4afb74(0x153)]||'角色')+_0x4afb74(0x175)+_0x5a6af0+_0x4afb74(0x12e);},_0x5c0df3=_0x245278(_0x495fb3);showHtmlModal(_0x99ad47(0x1f3),_0x5c0df3,{'okText':_0x99ad47(0x14c),'cancelText':'取消','onOpen':_0x28c22f=>{const _0x1e7fd1=_0x99ad47,_0x2179dc=_0x28c22f[_0x1e7fd1(0x19e)](_0x1e7fd1(0x174)),_0x3c5c4c=_0x28c22f['find'](_0x1e7fd1(0x1de)),_0x1d9b77=_0x28c22f['find'](_0x1e7fd1(0x1ad)),_0x51b0ef=()=>{const _0x443049=_0x1e7fd1,_0x1b3d9f=_0x2179dc['is'](_0x443049(0x1ab)),_0x33b1da=_0x3c5c4c['is'](_0x443049(0x1ab));_0x1d9b77[_0x443049(0x19e)]('.historiography-message-item')['each'](function(){const _0x4e73ec=_0x443049,_0xff8823=$(this),_0x2ef940=_0xff8823[_0x4e73ec(0x1d9)](_0x4e73ec(0x1d5));_0x2ef940==='user'&&!_0x1b3d9f||_0x2ef940===_0x4e73ec(0x1aa)&&!_0x33b1da?_0xff8823[_0x4e73ec(0x1c5)](_0x4e73ec(0x1d0),!![]):_0xff8823['prop'](_0x4e73ec(0x1d0),![]);});};_0x2179dc['on'](_0x1e7fd1(0x128),_0x51b0ef),_0x3c5c4c['on'](_0x1e7fd1(0x128),_0x51b0ef);},'onOk':async _0x36d736=>{const _0x3b85c7=_0x99ad47,_0x22a968=_0x36d736['find']('.historiography-message-item:not([hidden])\x20textarea')[_0x3b85c7(0x137)](function(){const _0x45b669=_0x3b85c7,_0x3e3503=$(this)[_0x45b669(0x1d9)](_0x45b669(0x1a1)),_0xeeebb0=$(this)[_0x45b669(0x18a)](_0x45b669(0x1a0))[_0x45b669(0x19e)]('summary')[_0x45b669(0x1e6)]()['replace'](_0x45b669(0x1c8)+_0x3e3503+_0x45b669(0x1ed),'');return _0x45b669(0x1c8)+_0x3e3503+'\x20楼】\x20'+_0xeeebb0+':\x20'+$(this)[_0x45b669(0x148)]();})[_0x3b85c7(0x13d)]()[_0x3b85c7(0x133)]('\x0a');if(!_0x22a968[_0x3b85c7(0x15f)]()){toastr[_0x3b85c7(0x17c)](_0x3b85c7(0x191),_0x3b85c7(0x155));return;}const _0x5d2ddd=_0x36d736[0x0];_0x5d2ddd&&typeof _0x5d2ddd[_0x3b85c7(0x1e1)]===_0x3b85c7(0x1cd)&&_0x5d2ddd['close']();_0x36d736['remove']();const _0x5a3096=await getSummary(_0x22a968,_0x479a2e);_0x5a3096?showSummaryModal(_0x5a3096,{'onConfirm':async _0xac0647=>{const _0x2319e6=await writeSummary(_0xac0647,_0x155cea,_0x4df02e,_0x479a2e);_0x2c12d3(_0x2319e6);},'onRegenerate':async _0x26a2f9=>{const _0x1bb76f=_0x3b85c7;_0x26a2f9['find'](_0x1bb76f(0x1c3))[_0x1bb76f(0x1c5)]('disabled',!![])[_0x1bb76f(0x148)](_0x1bb76f(0x132));const _0x20d553=await getSummary(_0x22a968,_0x479a2e);_0x20d553?_0x26a2f9[_0x1bb76f(0x19e)](_0x1bb76f(0x1c3))[_0x1bb76f(0x1c5)](_0x1bb76f(0x1c4),![])[_0x1bb76f(0x148)](_0x20d553):(_0x26a2f9['find'](_0x1bb76f(0x1c3))['prop'](_0x1bb76f(0x1c4),![])[_0x1bb76f(0x148)](_0x5a3096),toastr['error'](_0x1bb76f(0x16b),_0x1bb76f(0x1b9)));},'onCancel':()=>{const _0x393483=_0x3b85c7;toastr[_0x393483(0x1b0)](_0x393483(0x176),_0x393483(0x15a)),_0x2c12d3(![]);}}):_0x2c12d3(![]);},'onCancel':()=>{const _0x25b556=_0x99ad47;toastr['info'](_0x25b556(0x1b4),_0x479a2e),_0x2c12d3(![]);}});});}function _0x4596(){const _0x1e77c3=['请将以下多个零散的\x22详细总结记录\x22提炼并融合成一段连贯的章节历史。原文如下:\x0a\x0a','\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','模型未能返回有效的精炼内容。','loreInsertionPosition','world','正在重新生成,请稍候...','join','鸣金收兵','所选条目内容为空,无法入库。','[翰林院]\x20向量化处理失败:','map','large_summary','\x0a\x0a---\x0a\x0a【','137517BVPXQd','宏史卷重铸完毕','远征已在准备阶段遵令暂停!','get','[大史官]\x20','编年史已成功更新!','chat','\x0a','国史已是最新,远征军无需出动。','翰林院已成功接收旧“宏史卷”记忆!新增\x20','史册缺少【流水金印】,无法执行重铸。','楼的宏史卷】===\x0a\x0a','amily2_prompt_presets_v2_mixed_order','\x20条忆识:\x0a\x0a','val','lorebookTarget','conditional','停战敕令已下达!远征军将在完成当前批次的任务后休整。','确认原文并总结','】送入翰林院...','\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_0xd73d26[_0x1bd1d1(0x15f)]())['filter'](Boolean):[],_0x2cdf8f=_0x209f93['historiographyExclusionRules']||[],_0x2e0fd2=_0x4ffc7a[_0x1bd1d1(0x137)]((_0x4b35ae,_0x4111d6)=>{const _0x342435=_0x1bd1d1;let _0x42a6be=_0x4b35ae[_0x342435(0x160)];if(_0x416d4c&&_0x5cc6df[_0x342435(0x18b)]>0x0){const _0x168ba2=extractBlocksByTags(_0x42a6be,_0x5cc6df);_0x168ba2[_0x342435(0x18b)]>0x0&&(_0x42a6be=_0x168ba2[_0x342435(0x133)]('\x0a\x0a'));}_0x42a6be=applyExclusionRules(_0x42a6be,_0x2cdf8f);if(!_0x42a6be[_0x342435(0x15f)]())return null;return{'floor':_0x25e34d+_0x4111d6,'author':_0x4b35ae[_0x342435(0x17a)]?_0x47d2a0:_0x312f90,'authorType':_0x4b35ae['is_user']?_0x342435(0x1a7):_0x342435(0x1aa),'content':_0x42a6be[_0x342435(0x15f)]()};})[_0x1bd1d1(0x193)](Boolean);return _0x2e0fd2;}async function getSummary(_0x2c45a2,_0x4ace4d){const _0x251bf=_0x5979b5;toastr[_0x251bf(0x1b0)](_0x251bf(0x1d3),_0x4ace4d);const _0x1ccafe=extension_settings[extensionName],_0x41b717=getPresetPrompts(_0x251bf(0x1cc));let _0x177c1f;try{const _0x23b98c=localStorage[_0x251bf(0x129)](_0x251bf(0x146));_0x23b98c&&(_0x177c1f=JSON[_0x251bf(0x1ec)](_0x23b98c));}catch(_0xa4700e){console[_0x251bf(0x17c)](_0x251bf(0x1e2),_0xa4700e);}const _0x2125f8=getMixedOrder(_0x251bf(0x1cc))||[],_0x37b1b2=[{'role':_0x251bf(0x1d6),'content':generateRandomSeed()}];let _0x20ea6c=0x0;for(const _0x35d397 of _0x2125f8){if(_0x35d397[_0x251bf(0x181)]===_0x251bf(0x1be))_0x41b717&&_0x41b717[_0x20ea6c]&&(_0x37b1b2[_0x251bf(0x1c0)](_0x41b717[_0x20ea6c]),_0x20ea6c++);else{if(_0x35d397[_0x251bf(0x181)]==='conditional')switch(_0x35d397['id']){case'jailbreakPrompt':_0x1ccafe[_0x251bf(0x19d)]&&_0x37b1b2['push']({'role':_0x251bf(0x1d6),'content':_0x1ccafe[_0x251bf(0x19d)]});break;case'summaryPrompt':_0x1ccafe[_0x251bf(0x167)]&&_0x37b1b2[_0x251bf(0x1c0)]({'role':_0x251bf(0x1d6),'content':_0x1ccafe[_0x251bf(0x167)]});break;case'coreContent':_0x37b1b2[_0x251bf(0x1c0)]({'role':_0x251bf(0x1a7),'content':_0x251bf(0x154)+_0x2c45a2+_0x251bf(0x141)});break;}}}const _0x5ed452=await callAI(_0x37b1b2);return console[_0x251bf(0x1a3)](_0x251bf(0x1ac),_0x5ed452),_0x5ed452;}async function writeSummary(_0xa572e5,_0x56a0ed,_0x5dc945,_0x5e60f2){const _0x2bde96=_0x5979b5,_0x26cd36=extension_settings[extensionName],_0x8616a2=getContext(),_0x576d16=_0x26cd36[_0x2bde96(0x184)]??!![],_0x4f94de=_0x26cd36[_0x2bde96(0x1f2)]??![];if(!_0x576d16&&!_0x4f94de)return toastr[_0x2bde96(0x12b)](_0x2bde96(0x15c),_0x5e60f2),!![];if(_0x4f94de)try{toastr[_0x2bde96(0x1b0)](_0x2bde96(0x1ae),_0x2bde96(0x188));const _0x1e90cd=await ingestTextToHanlinyuan(_0xa572e5,'lorebook',_0x2bde96(0x127)+_0x56a0ed+'-'+_0x5dc945+'楼');if(_0x1e90cd[_0x2bde96(0x16d)])toastr['success']('翰林院已成功接收记忆碎片!',_0x2bde96(0x188));else throw new Error(_0x1e90cd[_0x2bde96(0x17c)]);}catch(_0x362c72){console[_0x2bde96(0x17c)](_0x2bde96(0x136),_0x362c72),toastr[_0x2bde96(0x17c)](_0x2bde96(0x1bb)+_0x362c72['message'],_0x2bde96(0x188));}if(_0x576d16)try{let _0x48d38f;switch(_0x26cd36[_0x2bde96(0x149)]){case _0x2bde96(0x1b5):_0x48d38f=characters[_0x8616a2[_0x2bde96(0x1df)]]?.[_0x2bde96(0x1d9)]?.[_0x2bde96(0x1b7)]?.[_0x2bde96(0x131)];if(!_0x48d38f)throw new Error('当前角色未绑定主世界书。');break;case _0x2bde96(0x192):const _0x4e2e2c=await getChatIdentifier();_0x48d38f=_0x2bde96(0x1cb)+_0x4e2e2c;break;default:throw new Error(_0x2bde96(0x1c6));}const _0x5bdd12=_0x5eedfb=>{const _0x515730=_0x2bde96,_0x3fd517='\x0a\x0a本条勿动【前'+_0x5dc945+_0x515730(0x1d8),_0x54a9c9=_0x515730(0x139)+_0x56a0ed+'楼至'+_0x5dc945+'楼详细总结记录】\x0a'+_0xa572e5;if(_0x5eedfb){const _0x441f4f=_0x5eedfb[_0x515730(0x159)](PROGRESS_SEAL_REGEX,'')[_0x515730(0x15f)]();return _0x441f4f+_0x54a9c9+_0x3fd517;}else{const _0x1dca8a=_0x515730(0x168)+_0x54a9c9;return _0x1dca8a+_0x3fd517;}};console[_0x2bde96(0x1a3)]('[大史官-调试]\x20读取到的原始设置:',{'loreActivationMode':_0x26cd36[_0x2bde96(0x1e0)],'loreInsertionPosition':_0x26cd36[_0x2bde96(0x130)],'loreDepth':_0x26cd36[_0x2bde96(0x177)],'loreKeywords':_0x26cd36[_0x2bde96(0x185)]});const _0x146b8e={'keys':_0x26cd36[_0x2bde96(0x185)][_0x2bde96(0x1a8)](',')[_0x2bde96(0x137)](_0x1f437e=>_0x1f437e[_0x2bde96(0x15f)]())[_0x2bde96(0x193)](Boolean),'isConstant':_0x26cd36['loreActivationMode']!==_0x2bde96(0x1bf),'insertion_position':_0x26cd36[_0x2bde96(0x130)],'depth':_0x26cd36['loreDepth']};console[_0x2bde96(0x1a3)](_0x2bde96(0x189),_0x146b8e);const _0x1a3d35=await writeToLorebookWithTavernHelper(_0x48d38f,RUNNING_LOG_COMMENT,_0x5bdd12,_0x146b8e);if(_0x1a3d35)return toastr['success'](_0x2bde96(0x13f),_0x5e60f2+_0x2bde96(0x19a)),!![];else throw new Error('使用\x20TavernHelper\x20写入失败,请检查控制台日志。');}catch(_0x108c2b){return console[_0x2bde96(0x17c)](_0x2bde96(0x13e)+_0x5e60f2+_0x2bde96(0x1f4),_0x108c2b),toastr[_0x2bde96(0x17c)](_0x2bde96(0x198)+_0x108c2b[_0x2bde96(0x12a)],_0x2bde96(0x1f8)),![];}return!![];}const CHAPTER_SEAL_REGEX=/【前(\d+)楼篇章编撰已完成】/;export async function executeRefinement(_0x55c437,_0x447683){const _0x10f79a=_0x5979b5;toastr[_0x10f79a(0x1b0)](_0x10f79a(0x1ce)+_0x55c437+_0x10f79a(0x1f7),_0x10f79a(0x163));try{const _0x509f00=await loadWorldInfo(_0x55c437),_0x32c80f=_0x509f00?.[_0x10f79a(0x12c)][_0x447683];if(!_0x32c80f){toastr[_0x10f79a(0x17c)](_0x10f79a(0x1a2),_0x10f79a(0x155));return;}const _0x77acf9=_0x32c80f[_0x10f79a(0x172)],_0x5c24b6=extension_settings[extensionName],_0x2c57de=_0x77acf9['match'](PROGRESS_SEAL_REGEX);if(!_0x2c57de){toastr[_0x10f79a(0x17c)](_0x10f79a(0x144),'结构异常');return;}const _0x3f24d4=_0x2c57de[0x0],_0x105758=parseInt(_0x2c57de[0x1],0xa),_0x41df46=_0x77acf9[_0x10f79a(0x166)](CHAPTER_SEAL_REGEX);let _0x53b66b='',_0x6dcc94='',_0x391359=0x0;if(_0x41df46){const _0x5c6125=_0x41df46[0x0];_0x391359=parseInt(_0x41df46[0x1],0xa);const _0x275117=_0x77acf9[_0x10f79a(0x1a8)](_0x5c6125);_0x53b66b=_0x275117[0x0][_0x10f79a(0x15f)](),_0x6dcc94=_0x275117[0x1][_0x10f79a(0x159)](PROGRESS_SEAL_REGEX,'')['trim']();}else _0x6dcc94=_0x77acf9[_0x10f79a(0x159)](PROGRESS_SEAL_REGEX,'')[_0x10f79a(0x15f)]();if(!_0x6dcc94[_0x10f79a(0x15f)]()){toastr[_0x10f79a(0x12b)]('史册条目中没有新的内容可供重铸。',_0x10f79a(0x1ba));return;}const _0x4ce713=getPresetPrompts(_0x10f79a(0x138));let _0x3e3b23;try{const _0x5248a3=localStorage[_0x10f79a(0x129)](_0x10f79a(0x146));_0x5248a3&&(_0x3e3b23=JSON[_0x10f79a(0x1ec)](_0x5248a3));}catch(_0x9bf0e1){console['error'](_0x10f79a(0x1e2),_0x9bf0e1);}const _0x2502f9=getMixedOrder(_0x10f79a(0x138))||[],_0xe65848=[{'role':_0x10f79a(0x1d6),'content':generateRandomSeed()}];let _0x3089a1=0x0;for(const _0xdcc943 of _0x2502f9){if(_0xdcc943[_0x10f79a(0x181)]==='prompt')_0x4ce713&&_0x4ce713[_0x3089a1]&&(_0xe65848[_0x10f79a(0x1c0)](_0x4ce713[_0x3089a1]),_0x3089a1++);else{if(_0xdcc943[_0x10f79a(0x181)]===_0x10f79a(0x14a))switch(_0xdcc943['id']){case'jailbreakPrompt':_0x5c24b6[_0x10f79a(0x1d2)]&&_0xe65848[_0x10f79a(0x1c0)]({'role':_0x10f79a(0x1d6),'content':_0x5c24b6[_0x10f79a(0x1d2)]});break;case'summaryPrompt':_0x5c24b6[_0x10f79a(0x1c9)]&&_0xe65848[_0x10f79a(0x1c0)]({'role':_0x10f79a(0x1d6),'content':_0x5c24b6[_0x10f79a(0x1c9)]});break;case _0x10f79a(0x1f1):_0xe65848['push']({'role':_0x10f79a(0x1a7),'content':_0x10f79a(0x12d)+_0x6dcc94});break;}}}const _0x3d91a3=async()=>{const _0x590b67=_0x10f79a;return toastr[_0x590b67(0x1b0)](_0x590b67(0x17f),_0x590b67(0x163)),await callAI(_0xe65848);},_0x3022b8=await _0x3d91a3();if(!_0x3022b8){toastr[_0x10f79a(0x17c)](_0x10f79a(0x12f),'宏史卷重铸失败');return;}const _0x1d1026=async _0x41eeac=>{showSummaryModal(_0x41eeac,{'onConfirm':async _0x7e55b1=>{const _0x1eae20=_0x3157;let _0x3cc76b;const _0x3d23f7=_0x1eae20(0x178)+_0x105758+'楼篇章编撰已完成】',_0x19e622=document[_0x1eae20(0x1e5)](_0x1eae20(0x19c))?.[_0x1eae20(0x1ea)]??![];if(_0x19e622&&_0x41df46)try{toastr[_0x1eae20(0x1b0)](_0x1eae20(0x1b6)+_0x391359+_0x1eae20(0x19b),_0x1eae20(0x188));const _0x532b25=await ingestTextToHanlinyuan(_0x53b66b,_0x1eae20(0x15d),_0x1eae20(0x1a4)+_0x391359+'楼');if(!_0x532b25[_0x1eae20(0x16d)])throw new Error(_0x532b25[_0x1eae20(0x17c)]||_0x1eae20(0x173));toastr[_0x1eae20(0x16d)](_0x1eae20(0x143)+_0x532b25['count']+_0x1eae20(0x18e),_0x1eae20(0x188));const _0x109b37=_0x1eae20(0x1e8)+_0x391359+_0x1eae20(0x15e)+_0x391359+_0x1eae20(0x17d);_0x3cc76b=_0x109b37+_0x1eae20(0x1f5)+_0x7e55b1+_0x3d23f7+'\x0a\x0a'+_0x3f24d4;}catch(_0x236606){console[_0x1eae20(0x17c)](_0x1eae20(0x15b),_0x236606),toastr[_0x1eae20(0x17c)]('宏史卷向量化失败:\x20'+_0x236606['message']+_0x1eae20(0x194),_0x1eae20(0x188));const _0x3d1f45=_0x1eae20(0x1e7)+_0x391359+_0x1eae20(0x145);_0x3cc76b=''+_0x53b66b+_0x3d1f45+_0x7e55b1+_0x3d23f7+'\x0a\x0a'+_0x3f24d4;}else{if(_0x41df46){const _0x20b263='\x0a\x0a===【截止至第'+_0x391359+_0x1eae20(0x145);_0x3cc76b=''+_0x53b66b+_0x20b263+_0x7e55b1+_0x3d23f7+'\x0a\x0a'+_0x3f24d4;}else{const _0x4f3809=_0x1eae20(0x1c7)+_0x105758+_0x1eae20(0x151);_0x3cc76b=''+_0x4f3809+_0x7e55b1+_0x3d23f7+'\x0a\x0a'+_0x3f24d4;}}_0x32c80f[_0x1eae20(0x172)]=_0x3cc76b,await saveWorldInfo(_0x55c437,_0x509f00,!![]),toastr[_0x1eae20(0x16d)](_0x1eae20(0x164)+_0x55c437+'》!',_0x1eae20(0x13b));},'onRegenerate':async _0xe4d616=>{const _0x37ac5d=_0x3157;_0xe4d616['find'](_0x37ac5d(0x1c3))[_0x37ac5d(0x1c5)](_0x37ac5d(0x1c4),!![])[_0x37ac5d(0x148)](_0x37ac5d(0x132));const _0x186028=await _0x3d91a3();_0x186028?_0xe4d616['find'](_0x37ac5d(0x1c3))[_0x37ac5d(0x1c5)](_0x37ac5d(0x1c4),![])[_0x37ac5d(0x148)](_0x186028):(_0xe4d616[_0x37ac5d(0x19e)](_0x37ac5d(0x1c3))[_0x37ac5d(0x1c5)](_0x37ac5d(0x1c4),![])['val'](_0x41eeac),toastr[_0x37ac5d(0x17c)](_0x37ac5d(0x16b),_0x37ac5d(0x1b9)));},'onCancel':()=>{const _0x56c257=_0x3157;toastr[_0x56c257(0x1b0)](_0x56c257(0x1e4),_0x56c257(0x15a));}});};await _0x1d1026(_0x3022b8);}catch(_0x5ba1a7){console[_0x10f79a(0x17c)]('[大史官]\x20重铸任务失败:',_0x5ba1a7),toastr['error'](_0x10f79a(0x196)+_0x5ba1a7[_0x10f79a(0x12a)],_0x10f79a(0x1f8));}}function _0x3157(_0x92bde7,_0x2da7d6){const _0x459658=_0x4596();return _0x3157=function(_0x3157b7,_0xfafa2b){_0x3157b7=_0x3157b7-0x127;let _0x34b069=_0x459658[_0x3157b7];return _0x34b069;},_0x3157(_0x92bde7,_0x2da7d6);}export async function executeExpedition(){const _0x1fe9b1=_0x5979b5;if(isExpeditionRunning){toastr[_0x1fe9b1(0x1b0)](_0x1fe9b1(0x171),'圣谕悉知');return;}isExpeditionRunning=!![],manualStopRequested=![],document['dispatchEvent'](new CustomEvent(_0x1fe9b1(0x190),{'detail':{'isRunning':!![]}}));try{const _0x1b3cb8=extension_settings[extensionName],_0x233c36=getContext();let _0x321d88=null;switch(_0x1b3cb8[_0x1fe9b1(0x149)]){case _0x1fe9b1(0x1b5):_0x321d88=characters[_0x233c36[_0x1fe9b1(0x1df)]]?.['data']?.[_0x1fe9b1(0x1b7)]?.[_0x1fe9b1(0x131)];if(!_0x321d88){toastr[_0x1fe9b1(0x17c)](_0x1fe9b1(0x18c),_0x1fe9b1(0x18d)),isExpeditionRunning=![],document['dispatchEvent'](new CustomEvent(_0x1fe9b1(0x190),{'detail':{'isRunning':![],'manualStop':![]}}));return;}break;case _0x1fe9b1(0x192):const _0x33ff8d=await getChatIdentifier();_0x321d88=_0x1fe9b1(0x1cb)+_0x33ff8d;break;default:toastr['error']('未知的史册写入目标,远征军无法开拔!',_0x1fe9b1(0x18d)),isExpeditionRunning=![],document[_0x1fe9b1(0x169)](new CustomEvent('amily2-expedition-state-change',{'detail':{'isRunning':![],'manualStop':![]}}));return;}const _0x2e979b=await readGoldenLedgerProgress(_0x321d88),_0x48ab54=_0x233c36['chat']['length'],_0x3f9e83=_0x48ab54-_0x2e979b;if(_0x3f9e83<=0x0){toastr[_0x1fe9b1(0x1b0)](_0x1fe9b1(0x142),'凯旋'),isExpeditionRunning=![],document[_0x1fe9b1(0x169)](new CustomEvent('amily2-expedition-state-change',{'detail':{'isRunning':![],'manualStop':![]}}));return;}const _0x40b0f2=_0x1b3cb8['historiographySmallTriggerThreshold'],_0xad9fec=Math[_0x1fe9b1(0x157)](_0x3f9e83/_0x40b0f2);toastr[_0x1fe9b1(0x1b0)]('远征军已开拔!目标:'+_0x3f9e83+_0x1fe9b1(0x14f)+_0xad9fec+_0x1fe9b1(0x195),_0x1fe9b1(0x161));let _0x32ce09=_0x2e979b;for(let _0x4b9b0e=0x0;_0x4b9b0e<_0xad9fec;_0x4b9b0e++){if(manualStopRequested){toastr[_0x1fe9b1(0x12b)]('远征已遵从您的敕令暂停!随时可以【继续远征】。',_0x1fe9b1(0x134));break;}const _0x33205a=_0x32ce09+0x1,_0x389def=Math[_0x1fe9b1(0x199)](_0x32ce09+_0x40b0f2,_0x48ab54),_0x5c8da2=_0x1fe9b1(0x1f6)+(_0x4b9b0e+0x1)+'/'+_0xad9fec+')',_0x3bc32b=0x7d0;_0x4b9b0e>0x0&&(toastr[_0x1fe9b1(0x1b0)]('第\x20'+(_0x4b9b0e+0x1)+_0x1fe9b1(0x162)+_0x3bc32b/0x3e8+'秒后接敌)',_0x5c8da2),await new Promise(_0x2d0473=>setTimeout(_0x2d0473,_0x3bc32b)));if(manualStopRequested){toastr[_0x1fe9b1(0x12b)](_0x1fe9b1(0x13c),_0x1fe9b1(0x134));break;}const _0x4716b5=await executeManualSummary(_0x33205a,_0x389def,![]);if(_0x4716b5)_0x32ce09=_0x389def;else{toastr['warning'](_0x1fe9b1(0x17e)+(_0x4b9b0e+0x1)+'\x20批次任务失败而中止。','远征中止'),manualStopRequested=!![];break;}}!manualStopRequested&&toastr[_0x1fe9b1(0x16d)](_0x1fe9b1(0x18f),_0x1fe9b1(0x1af));}catch(_0x39d33b){console[_0x1fe9b1(0x17c)](_0x1fe9b1(0x1db),_0x39d33b),toastr['error'](_0x1fe9b1(0x1b8),_0x1fe9b1(0x1d4));}finally{isExpeditionRunning=![],document[_0x1fe9b1(0x169)](new CustomEvent(_0x1fe9b1(0x190),{'detail':{'isRunning':![],'manualStop':manualStopRequested}}));}}export function stopExpedition(){const _0x151b13=_0x5979b5;isExpeditionRunning?(manualStopRequested=!![],toastr['info'](_0x151b13(0x14b),_0x151b13(0x186))):toastr['warning'](_0x151b13(0x16e),_0x151b13(0x16a));}export async function executeCompilation(_0x23ed4b,_0xdc02d){const _0x2e8c1c=_0x5979b5;toastr[_0x2e8c1c(0x1b0)](_0x2e8c1c(0x1cf)+_0x23ed4b+_0x2e8c1c(0x1ee)+_0xdc02d+_0x2e8c1c(0x14d),_0x2e8c1c(0x1b3));try{const _0xeaddd9=await loadWorldInfo(_0x23ed4b),_0x19359c=_0xeaddd9?.['entries'][_0xdc02d];if(!_0x19359c)throw new Error(_0x2e8c1c(0x187));const _0x326e70=_0x19359c[_0x2e8c1c(0x172)];if(!_0x326e70[_0x2e8c1c(0x15f)]())throw new Error(_0x2e8c1c(0x135));const _0x4c2ddd=await ingestTextToHanlinyuan(_0x326e70,_0x2e8c1c(0x15d),_0x19359c[_0x2e8c1c(0x1c1)]||_0xdc02d);if(_0x4c2ddd['success'])return toastr[_0x2e8c1c(0x16d)](_0x2e8c1c(0x1e3)+_0x4c2ddd[_0x2e8c1c(0x1a5)]+_0x2e8c1c(0x18e),_0x2e8c1c(0x188)),{'success':!![],'content':_0x2e8c1c(0x165)+_0x4c2ddd['count']+_0x2e8c1c(0x147)+_0x326e70};else throw new Error(_0x4c2ddd[_0x2e8c1c(0x17c)]||_0x2e8c1c(0x1e9));}catch(_0x5e67b3){return console[_0x2e8c1c(0x17c)](_0x2e8c1c(0x19f),_0x5e67b3),toastr[_0x2e8c1c(0x17c)](_0x2e8c1c(0x17b)+_0x5e67b3[_0x2e8c1c(0x12a)],'翰林院'),{'success':![],'error':_0x5e67b3[_0x2e8c1c(0x12a)]};}} +const _0x17f21b=_0x5497;function _0x44ce(){const _0x388ce3=['远征中止','historiographySmallTriggerThreshold','loreKeywords','historiographyLargeJailbreakPrompt','圣谕有误','historiographyExclusionRules','远征军已在营中,无需下达停战敕令。','579414VQWYkT','\x0a\x0a---\x0a\x0a','ceil','》天机时出错:','push','change','正在将此份“微言录”送往翰林院...','historiographySmallSummaryPrompt','\x20楼】\x20','map','disable','[大史官]\x20自动微言录已触发,处理\x20','\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20【第\x20','jailbreakPrompt','type','char','\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','dedicated','count','遵旨!正在为您重铸《','微言录\x20(手动)','user','】处理失败:\x20','当前角色未绑定主世界书,远征军无法开拔!','3013002nMHHaf','[大史官]\x20','写入国史馆时发生错误:\x20','.historiography-message-item','史册缺少【流水金印】,无法执行重铸。','\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','请严格根据以下\x22对话记录\x22中的内容进行总结,不要添加任何额外信息。\x0a\x0a<对话记录>\x0a','split','log','远征完毕','\x20楼。','warning','values','info','宏史卷重铸失败','请将以下多个零散的\x22详细总结记录\x22提炼并融合成一段连贯的章节历史。原文如下:\x0a\x0a','historiographySmallJailbreakPrompt','historiographyWriteToLorebook','】内容为空。','\x0a\x0a【前','prop',',将执行标准保存。','val','条目【','批量入库失败:\x20','735780OSlRpX','重铸史册时发生严重错误:\x20','圣谕不明','historiographyAutoSummaryInteractive','find','2870235wTlJOS','disabled','world','\x20批次战役准备中...\x20(','characterId','[大史官-调试]\x20读取到的原始设置:','\x20-\x20国史馆','match','请至少选择一条消息进行总结!','join','lorebook','楼详细总结记录】\x0a','远征已遵从您的敕令暂停!随时可以【继续远征】。','当前角色未绑定主世界书。','》时出错:','prompt','楼总结已完成】否则后续总结无法进行。','[大史官]\x20加载混合顺序失败:','模型召唤失败','hidden','微言录\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','选定的楼层范围内无有效对话或内容被规则排除。','远征军已在途中,无需重复下令。','确认原文并总结','name2','模型未能返回有效的精炼内容。','操作已取消','name1','远征开始','slice','replace','\x20批次任务失败而中止。','lorebookTarget','\x20个条目进行批量编纂...','4626783qiNPAJ','data','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','small_summary','textarea','正在召唤模型进行内容精炼...','summaryPrompt','楼的宏史卷】===\x0a\x0a','重新生成失败,已恢复原始内容。',':checked','\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\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'+_0x5cbb7e[_0x1fe511(0xd7)]+_0x1fe511(0x78))[_0x1fe511(0x14b)]('');return _0x1fe511(0xf9)+(_0x328e3d[_0x1fe511(0x7f)]||'用户')+_0x1fe511(0xff)+(_0x328e3d['name2']||'角色')+_0x1fe511(0x129)+_0x3c3029+_0x1fe511(0x11c);},_0x4cb65d=_0x1e6a52(_0x563ff1);showHtmlModal(_0x2cd50e(0xe1),_0x4cb65d,{'okText':_0x2cd50e(0x7b),'cancelText':'取消','onOpen':_0xa53028=>{const _0x51700a=_0x2cd50e,_0x545ab8=_0xa53028['find'](_0x51700a(0xd8)),_0x3d77c9=_0xa53028[_0x51700a(0x141)](_0x51700a(0x97)),_0x10877b=_0xa53028[_0x51700a(0x141)](_0x51700a(0xb0)),_0x5971ed=()=>{const _0x257c30=_0x51700a,_0x463517=_0x545ab8['is'](_0x257c30(0xf8)),_0x3c6e24=_0x3d77c9['is'](_0x257c30(0xf8));_0x10877b[_0x257c30(0x141)](_0x257c30(0x127))[_0x257c30(0x9a)](function(){const _0x140ae4=_0x257c30,_0x328163=$(this),_0x5a1685=_0x328163['data']('author-type');_0x5a1685==='user'&&!_0x463517||_0x5a1685==='char'&&!_0x3c6e24?_0x328163[_0x140ae4(0x138)](_0x140ae4(0x76),!![]):_0x328163['prop']('hidden',![]);});};_0x545ab8['on'](_0x51700a(0x110),_0x5971ed),_0x3d77c9['on'](_0x51700a(0x110),_0x5971ed);},'onOk':async _0x13144b=>{const _0x4b1869=_0x2cd50e,_0x1f23b6=_0x13144b['find']('.historiography-message-item:not([hidden])\x20textarea')[_0x4b1869(0x114)](function(){const _0x1cdf39=_0x4b1869,_0x1135cc=$(this)[_0x1cdf39(0x87)]('floor'),_0x194f25=$(this)['closest']('.historiography-message-item')[_0x1cdf39(0x141)]('summary')['text']()[_0x1cdf39(0x82)](_0x1cdf39(0xc6)+_0x1135cc+_0x1cdf39(0x113),'');return _0x1cdf39(0xc6)+_0x1135cc+_0x1cdf39(0x113)+_0x194f25+':\x20'+$(this)[_0x1cdf39(0x13a)]();})[_0x4b1869(0xb2)]()[_0x4b1869(0x14b)]('\x0a');if(!_0x1f23b6[_0x4b1869(0xdb)]()){toastr[_0x4b1869(0xe4)](_0x4b1869(0x14a),_0x4b1869(0x108));return;}const _0x3bc3fa=_0x13144b[0x0];_0x3bc3fa&&typeof _0x3bc3fa['close']===_0x4b1869(0x8b)&&_0x3bc3fa[_0x4b1869(0xfc)]();_0x13144b[_0x4b1869(0x95)]();const _0x43b487=await getSummary(_0x1f23b6,_0x3c6a6c);_0x43b487?showSummaryModal(_0x43b487,{'onConfirm':async _0x1a91f0=>{const _0x25ad84=await writeSummary(_0x1a91f0,_0x2e9b37,_0x251bcb,_0x3c6a6c);_0x22d588(_0x25ad84);},'onRegenerate':async _0xe35aef=>{const _0x45a025=_0x4b1869;_0xe35aef['find'](_0x45a025(0xf3))[_0x45a025(0x138)](_0x45a025(0x143),!![])[_0x45a025(0x13a)](_0x45a025(0x94));const _0x26fb2c=await getSummary(_0x1f23b6,_0x3c6a6c);_0x26fb2c?_0xe35aef['find'](_0x45a025(0xf3))[_0x45a025(0x138)](_0x45a025(0x143),![])[_0x45a025(0x13a)](_0x26fb2c):(_0xe35aef[_0x45a025(0x141)]('textarea')[_0x45a025(0x138)](_0x45a025(0x143),![])['val'](_0x43b487),toastr[_0x45a025(0xe4)](_0x45a025(0xf7),'模型召唤失败'));},'onCancel':()=>{const _0x2088a6=_0x4b1869;toastr[_0x2088a6(0x131)]('本批次总结已取消。',_0x2088a6(0x7e)),_0x22d588(![]);}}):_0x22d588(![]);},'onCancel':()=>{const _0x396783=_0x2cd50e;toastr[_0x396783(0x131)](_0x396783(0xa3),_0x3c6a6c),_0x22d588(![]);}});});}function getRawMessagesForSummary(_0x356346,_0x419acf){const _0x43ea6b=_0x17f21b,_0x3e8999=getContext(),_0x33b793=_0x3e8999[_0x43ea6b(0x9f)],_0x5a44f5=extension_settings[extensionName],_0xbb5a66=_0x33b793[_0x43ea6b(0x81)](_0x356346-0x1,_0x419acf);if(_0xbb5a66[_0x43ea6b(0xec)]===0x0)return null;const _0x139497=_0x3e8999[_0x43ea6b(0x7f)]||'用户',_0x3a9dc5=_0x3e8999[_0x43ea6b(0x7c)]||'角色',_0x5a7114=_0x5a44f5['historiographyTagExtractionEnabled']??![],_0x34dc6c=_0x5a7114?(_0x5a44f5[_0x43ea6b(0xac)]||'')['split'](',')['map'](_0x4367f6=>_0x4367f6[_0x43ea6b(0xdb)]())['filter'](Boolean):[],_0x427044=_0x5a44f5[_0x43ea6b(0x109)]||[],_0x35210f=_0xbb5a66[_0x43ea6b(0x114)]((_0x15fc19,_0x3f3c15)=>{const _0x20873a=_0x43ea6b;let _0x2fb2e6=_0x15fc19[_0x20873a(0xd3)];if(_0x5a7114&&_0x34dc6c['length']>0x0){const _0x54adeb=extractBlocksByTags(_0x2fb2e6,_0x34dc6c);_0x54adeb['length']>0x0&&(_0x2fb2e6=_0x54adeb[_0x20873a(0x14b)]('\x0a\x0a'));}_0x2fb2e6=applyExclusionRules(_0x2fb2e6,_0x427044);if(!_0x2fb2e6[_0x20873a(0xdb)]())return null;return{'floor':_0x356346+_0x3f3c15,'author':_0x15fc19[_0x20873a(0xfb)]?_0x139497:_0x3a9dc5,'authorType':_0x15fc19[_0x20873a(0xfb)]?_0x20873a(0x121):_0x20873a(0x11a),'content':_0x2fb2e6['trim']()};})['filter'](Boolean);return _0x35210f;}async function getSummary(_0xb2a0d6,_0x4a497e){const _0x4764fa=_0x17f21b;toastr[_0x4764fa(0x131)](_0x4764fa(0xc0),_0x4a497e);const _0x166983=extension_settings[extensionName],_0x4ff214=getPresetPrompts(_0x4764fa(0xf2));let _0x557c5a;try{const _0x1386e9=localStorage[_0x4764fa(0xdf)](_0x4764fa(0xd0));_0x1386e9&&(_0x557c5a=JSON[_0x4764fa(0xef)](_0x1386e9));}catch(_0x333830){console['error'](_0x4764fa(0x74),_0x333830);}const _0x31fdfe=getMixedOrder(_0x4764fa(0xf2))||[],_0x4aa6da=[{'role':'system','content':generateRandomSeed()}];let _0x344ca2=0x0;for(const _0x12c97c of _0x31fdfe){if(_0x12c97c['type']===_0x4764fa(0x72))_0x4ff214&&_0x4ff214[_0x344ca2]&&(_0x4aa6da[_0x4764fa(0x10f)](_0x4ff214[_0x344ca2]),_0x344ca2++);else{if(_0x12c97c[_0x4764fa(0x119)]===_0x4764fa(0xbd))switch(_0x12c97c['id']){case _0x4764fa(0x118):_0x166983[_0x4764fa(0x134)]&&_0x4aa6da[_0x4764fa(0x10f)]({'role':'system','content':_0x166983[_0x4764fa(0x134)]});break;case _0x4764fa(0xf5):_0x166983[_0x4764fa(0x112)]&&_0x4aa6da[_0x4764fa(0x10f)]({'role':_0x4764fa(0xbf),'content':_0x166983[_0x4764fa(0x112)]});break;case _0x4764fa(0xcc):_0x4aa6da['push']({'role':_0x4764fa(0x121),'content':_0x4764fa(0x12a)+_0xb2a0d6+_0x4764fa(0xf1)});break;}}}const _0x3bfe54=await callAI(_0x4aa6da);return console[_0x4764fa(0x12c)](_0x4764fa(0x102),_0x3bfe54),_0x3bfe54;}async function writeSummary(_0x3c19af,_0x32b9d0,_0x553963,_0x6382b5){const _0xdaf6c6=_0x17f21b,_0x2fbe14=extension_settings[extensionName],_0x150ace=getContext(),_0x518b89=_0x2fbe14[_0xdaf6c6(0x135)]??!![],_0x12c175=_0x2fbe14['historiographyIngestToRag']??![];if(!_0x518b89&&!_0x12c175)return toastr[_0xdaf6c6(0x12f)](_0xdaf6c6(0xca),_0x6382b5),!![];if(_0x12c175)try{let _0x17a293;switch(_0x2fbe14['lorebookTarget']){case'character_main':_0x17a293=characters[_0x150ace['characterId']]?.['data']?.['extensions']?.[_0xdaf6c6(0x144)];if(!_0x17a293)throw new Error(_0xdaf6c6(0xa4));break;case'dedicated':const _0x3a9c2a=await getChatIdentifier();_0x17a293=_0xdaf6c6(0xa6)+_0x3a9c2a;break;default:throw new Error('未知的史册写入指令,无法为翰林院确定目标。');}toastr[_0xdaf6c6(0x131)](_0xdaf6c6(0x111),_0xdaf6c6(0xd2));const _0xa4820={'bookName':_0x17a293,'entryName':'微言录总结:\x20'+_0x32b9d0+'-'+_0x553963+'楼'},_0x499b58=await ingestTextToHanlinyuan(_0x3c19af,_0xdaf6c6(0x14c),_0xa4820);if(_0x499b58[_0xdaf6c6(0xb8)])toastr[_0xdaf6c6(0xb8)](_0xdaf6c6(0xc3),_0xdaf6c6(0xd2));else throw new Error(_0x499b58['error']);}catch(_0x5d9760){console[_0xdaf6c6(0xe4)]('[翰林院]\x20向量化处理失败:',_0x5d9760),toastr[_0xdaf6c6(0xe4)](_0xdaf6c6(0xa5)+_0x5d9760['message'],_0xdaf6c6(0xd2));}if(_0x518b89)try{let _0x58854d;switch(_0x2fbe14[_0xdaf6c6(0x84)]){case _0xdaf6c6(0xaf):_0x58854d=characters[_0x150ace[_0xdaf6c6(0x146)]]?.['data']?.[_0xdaf6c6(0xbe)]?.['world'];if(!_0x58854d)throw new Error(_0xdaf6c6(0x70));break;case _0xdaf6c6(0x11d):const _0x526167=await getChatIdentifier();_0x58854d=_0xdaf6c6(0xa6)+_0x526167;break;default:throw new Error(_0xdaf6c6(0xe7));}const _0x42de19=_0x385c6a=>{const _0x20495b=_0xdaf6c6,_0x4f0ee7=_0x20495b(0x96)+_0x553963+_0x20495b(0x73),_0xa2e5c=_0x20495b(0xde)+_0x32b9d0+'楼至'+_0x553963+_0x20495b(0x14d)+_0x3c19af;if(_0x385c6a){const _0x591e17=_0x385c6a[_0x20495b(0x82)](PROGRESS_SEAL_REGEX,'')[_0x20495b(0xdb)]();return _0x591e17+_0xa2e5c+_0x4f0ee7;}else{const _0x10b0b8='以下是依照顺序已发生剧情'+_0xa2e5c;return _0x10b0b8+_0x4f0ee7;}};console['log'](_0xdaf6c6(0x147),{'loreActivationMode':_0x2fbe14[_0xdaf6c6(0xd6)],'loreInsertionPosition':_0x2fbe14[_0xdaf6c6(0xdc)],'loreDepth':_0x2fbe14['loreDepth'],'loreKeywords':_0x2fbe14['loreKeywords']});const _0x46a7d4={'keys':_0x2fbe14[_0xdaf6c6(0x106)][_0xdaf6c6(0x12b)](',')[_0xdaf6c6(0x114)](_0x503c3b=>_0x503c3b['trim']())[_0xdaf6c6(0xa2)](Boolean),'isConstant':_0x2fbe14[_0xdaf6c6(0xd6)]!==_0xdaf6c6(0xc5),'insertion_position':_0x2fbe14['loreInsertionPosition'],'depth':_0x2fbe14[_0xdaf6c6(0xab)]};console[_0xdaf6c6(0x12c)]('[大史官-调试]\x20构建并传递的选项:',_0x46a7d4);const _0x21c93d=await writeToLorebookWithTavernHelper(_0x58854d,RUNNING_LOG_COMMENT,_0x42de19,_0x46a7d4);if(_0x21c93d)return toastr['success'](_0xdaf6c6(0xa0),_0x6382b5+_0xdaf6c6(0x148)),!![];else throw new Error(_0xdaf6c6(0xa7));}catch(_0x1b70a3){return console['error'](_0xdaf6c6(0x125)+_0x6382b5+_0xdaf6c6(0x9e),_0x1b70a3),toastr['error'](_0xdaf6c6(0x126)+_0x1b70a3[_0xdaf6c6(0xb9)],_0xdaf6c6(0xe6)),![];}return!![];}const CHAPTER_SEAL_REGEX=/【前(\d+)楼篇章编撰已完成】/;export async function executeRefinement(_0x388d14,_0x22d27d){const _0x3395f4=_0x17f21b;toastr[_0x3395f4(0x131)](_0x3395f4(0x11f)+_0x388d14+_0x3395f4(0x91),_0x3395f4(0xc1));try{const _0x3f0ce3=await loadWorldInfo(_0x388d14),_0x270f66=_0x3f0ce3?.[_0x3395f4(0x103)][_0x22d27d];if(!_0x270f66){toastr['error'](_0x3395f4(0x8f),_0x3395f4(0x108));return;}const _0x5617ae=_0x270f66[_0x3395f4(0xd7)],_0x820d45=extension_settings[extensionName],_0x14a4ed=_0x5617ae[_0x3395f4(0x149)](PROGRESS_SEAL_REGEX);if(!_0x14a4ed){toastr[_0x3395f4(0xe4)](_0x3395f4(0x128),_0x3395f4(0xfa));return;}const _0xe62522=_0x14a4ed[0x0],_0x3c2380=parseInt(_0x14a4ed[0x1],0xa),_0xc0e403=_0x5617ae[_0x3395f4(0x149)](CHAPTER_SEAL_REGEX);let _0x188f3b='',_0x42a260='',_0x351ec5=0x0;if(_0xc0e403){const _0x2ee460=_0xc0e403[0x0];_0x351ec5=parseInt(_0xc0e403[0x1],0xa);const _0x376be9=_0x5617ae['split'](_0x2ee460);_0x188f3b=_0x376be9[0x0][_0x3395f4(0xdb)](),_0x42a260=_0x376be9[0x1][_0x3395f4(0x82)](PROGRESS_SEAL_REGEX,'')[_0x3395f4(0xdb)]();}else _0x42a260=_0x5617ae[_0x3395f4(0x82)](PROGRESS_SEAL_REGEX,'')[_0x3395f4(0xdb)]();if(!_0x42a260[_0x3395f4(0xdb)]()){toastr[_0x3395f4(0x12f)](_0x3395f4(0xcf),_0x3395f4(0x92));return;}const _0x1af5f8=getPresetPrompts(_0x3395f4(0xc2));let _0x2c3ab0;try{const _0xcd2c26=localStorage[_0x3395f4(0xdf)](_0x3395f4(0xd0));_0xcd2c26&&(_0x2c3ab0=JSON[_0x3395f4(0xef)](_0xcd2c26));}catch(_0x1135b8){console[_0x3395f4(0xe4)](_0x3395f4(0x74),_0x1135b8);}const _0x4e0fc0=getMixedOrder('large_summary')||[],_0x4e8082=[{'role':_0x3395f4(0xbf),'content':generateRandomSeed()}];let _0x18c831=0x0;for(const _0x49bd8d of _0x4e0fc0){if(_0x49bd8d['type']===_0x3395f4(0x72))_0x1af5f8&&_0x1af5f8[_0x18c831]&&(_0x4e8082[_0x3395f4(0x10f)](_0x1af5f8[_0x18c831]),_0x18c831++);else{if(_0x49bd8d[_0x3395f4(0x119)]===_0x3395f4(0xbd))switch(_0x49bd8d['id']){case _0x3395f4(0x118):_0x820d45[_0x3395f4(0x107)]&&_0x4e8082['push']({'role':_0x3395f4(0xbf),'content':_0x820d45[_0x3395f4(0x107)]});break;case _0x3395f4(0xf5):_0x820d45[_0x3395f4(0xa9)]&&_0x4e8082[_0x3395f4(0x10f)]({'role':_0x3395f4(0xbf),'content':_0x820d45[_0x3395f4(0xa9)]});break;case _0x3395f4(0xcc):_0x4e8082[_0x3395f4(0x10f)]({'role':'user','content':_0x3395f4(0x133)+_0x42a260});break;}}}const _0x51b2f8=async()=>{const _0x5d04a7=_0x3395f4;return toastr['info'](_0x5d04a7(0xf4),_0x5d04a7(0xc1)),await callAI(_0x4e8082);},_0x5b472d=await _0x51b2f8();if(!_0x5b472d){toastr[_0x3395f4(0xe4)](_0x3395f4(0x7d),_0x3395f4(0x132));return;}const _0x237ee1=async _0x4dcc0f=>{showSummaryModal(_0x4dcc0f,{'onConfirm':async _0x3c71dd=>{const _0x25b5c8=_0x5497;let _0x5ac52a;const _0x5e4ed8=_0x25b5c8(0x137)+_0x3c2380+_0x25b5c8(0xad),_0x5962f7=document['getElementById']('amily2_vectorize_summary_content')?.[_0x25b5c8(0xeb)]??![];if(_0x5962f7&&_0xc0e403)try{toastr[_0x25b5c8(0x131)]('正在将前\x20'+_0x351ec5+'\x20楼的“宏史卷”内容送往翰林院...','翰林院');const _0x58e2f7={'bookName':_0x388d14,'entryName':_0x25b5c8(0xb6)+_0x351ec5+'楼'},_0x54ac96=await ingestTextToHanlinyuan(_0x188f3b,_0x25b5c8(0x14c),_0x58e2f7);if(!_0x54ac96['success'])throw new Error(_0x54ac96[_0x25b5c8(0xe4)]||'未知错误');toastr['success']('翰林院已成功接收旧“宏史卷”记忆!新增\x20'+_0x54ac96[_0x25b5c8(0x11e)]+_0x25b5c8(0x11b),_0x25b5c8(0xd2));const _0x4b2202='AI你好,以上内容为rag向量化后注入的相关剧情,以下内容是已发生的剧情回顾。\x0a\x0a(前'+_0x351ec5+_0x25b5c8(0xf0)+_0x351ec5+_0x25b5c8(0xd9);_0x5ac52a=_0x4b2202+_0x25b5c8(0x10c)+_0x3c71dd+_0x5e4ed8+'\x0a\x0a'+_0xe62522;}catch(_0x18c2c6){console[_0x25b5c8(0xe4)](_0x25b5c8(0xc4),_0x18c2c6),toastr[_0x25b5c8(0xe4)](_0x25b5c8(0xb4)+_0x18c2c6['message']+_0x25b5c8(0x139),_0x25b5c8(0xd2));const _0x51df30=_0x25b5c8(0xea)+_0x351ec5+_0x25b5c8(0xf6);_0x5ac52a=''+_0x188f3b+_0x51df30+_0x3c71dd+_0x5e4ed8+'\x0a\x0a'+_0xe62522;}else{if(_0xc0e403){const _0x4d337d=_0x25b5c8(0xea)+_0x351ec5+'楼的宏史卷】===\x0a\x0a';_0x5ac52a=''+_0x188f3b+_0x4d337d+_0x3c71dd+_0x5e4ed8+'\x0a\x0a'+_0xe62522;}else{const _0x11b0be=_0x25b5c8(0x89)+_0x3c2380+_0x25b5c8(0xe0);_0x5ac52a=''+_0x11b0be+_0x3c71dd+_0x5e4ed8+'\x0a\x0a'+_0xe62522;}}_0x270f66['content']=_0x5ac52a,await saveWorldInfo(_0x388d14,_0x3f0ce3,!![]),toastr[_0x25b5c8(0xb8)](_0x25b5c8(0xc9)+_0x388d14+'》!','宏史卷重铸完毕');},'onRegenerate':async _0x247ee5=>{const _0x2a972e=_0x5497;_0x247ee5[_0x2a972e(0x141)](_0x2a972e(0xf3))['prop'](_0x2a972e(0x143),!![])['val'](_0x2a972e(0x94));const _0x2c3b59=await _0x51b2f8();_0x2c3b59?_0x247ee5[_0x2a972e(0x141)](_0x2a972e(0xf3))[_0x2a972e(0x138)](_0x2a972e(0x143),![])['val'](_0x2c3b59):(_0x247ee5[_0x2a972e(0x141)](_0x2a972e(0xf3))[_0x2a972e(0x138)](_0x2a972e(0x143),![])['val'](_0x4dcc0f),toastr[_0x2a972e(0xe4)]('重新生成失败,已恢复原始内容。',_0x2a972e(0x75)));},'onCancel':()=>{const _0x4f28cf=_0x5497;toastr[_0x4f28cf(0x131)](_0x4f28cf(0xb5),_0x4f28cf(0x7e));}});};await _0x237ee1(_0x5b472d);}catch(_0x4297cf){console[_0x3395f4(0xe4)]('[大史官]\x20重铸任务失败:',_0x4297cf),toastr[_0x3395f4(0xe4)](_0x3395f4(0x13e)+_0x4297cf[_0x3395f4(0xb9)],_0x3395f4(0xe6));}}export async function executeExpedition(){const _0x22c2c6=_0x17f21b;if(isExpeditionRunning){toastr['info'](_0x22c2c6(0x7a),_0x22c2c6(0xe5));return;}isExpeditionRunning=!![],manualStopRequested=![],document[_0x22c2c6(0xb1)](new CustomEvent(_0x22c2c6(0xa8),{'detail':{'isRunning':!![]}}));try{const _0x5eca56=extension_settings[extensionName],_0x5d4255=getContext();let _0x4652d5=null;switch(_0x5eca56[_0x22c2c6(0x84)]){case _0x22c2c6(0xaf):_0x4652d5=characters[_0x5d4255[_0x22c2c6(0x146)]]?.[_0x22c2c6(0x87)]?.[_0x22c2c6(0xbe)]?.[_0x22c2c6(0x144)];if(!_0x4652d5){toastr['error'](_0x22c2c6(0x123),_0x22c2c6(0x13f)),isExpeditionRunning=![],document['dispatchEvent'](new CustomEvent('amily2-expedition-state-change',{'detail':{'isRunning':![],'manualStop':![]}}));return;}break;case _0x22c2c6(0x11d):const _0xd31577=await getChatIdentifier();_0x4652d5=_0x22c2c6(0xa6)+_0xd31577;break;default:toastr[_0x22c2c6(0xe4)](_0x22c2c6(0xe9),_0x22c2c6(0x13f)),isExpeditionRunning=![],document[_0x22c2c6(0xb1)](new CustomEvent(_0x22c2c6(0xa8),{'detail':{'isRunning':![],'manualStop':![]}}));return;}const _0xa8cf4a=await readGoldenLedgerProgress(_0x4652d5),_0x53f673=_0x5d4255['chat'][_0x22c2c6(0xec)],_0x4938e3=_0x53f673-_0xa8cf4a;if(_0x4938e3<=0x0){toastr[_0x22c2c6(0x131)](_0x22c2c6(0xaa),'凯旋'),isExpeditionRunning=![],document[_0x22c2c6(0xb1)](new CustomEvent('amily2-expedition-state-change',{'detail':{'isRunning':![],'manualStop':![]}}));return;}const _0x2741f2=_0x5eca56[_0x22c2c6(0x105)],_0x216893=Math[_0x22c2c6(0x10d)](_0x4938e3/_0x2741f2);toastr[_0x22c2c6(0x131)](_0x22c2c6(0x8c)+_0x4938e3+'\x20层历史,分\x20'+_0x216893+_0x22c2c6(0x9c),_0x22c2c6(0x80));let _0x49dac1=_0xa8cf4a;for(let _0x12935d=0x0;_0x12935d<_0x216893;_0x12935d++){if(manualStopRequested){toastr[_0x22c2c6(0x12f)](_0x22c2c6(0x14e),'鸣金收兵');break;}const _0x4ebe22=_0x49dac1+0x1,_0x530da1=Math['min'](_0x49dac1+_0x2741f2,_0x53f673),_0x439e3e=_0x22c2c6(0x99)+(_0x12935d+0x1)+'/'+_0x216893+')',_0x18cdfb=0x7d0;_0x12935d>0x0&&(toastr['info']('第\x20'+(_0x12935d+0x1)+_0x22c2c6(0x145)+_0x18cdfb/0x3e8+_0x22c2c6(0xbb),_0x439e3e),await new Promise(_0x52fd92=>setTimeout(_0x52fd92,_0x18cdfb)));if(manualStopRequested){toastr[_0x22c2c6(0x12f)](_0x22c2c6(0x101),_0x22c2c6(0xa1));break;}const _0x3530d3=await executeManualSummary(_0x4ebe22,_0x530da1,![]);if(_0x3530d3)_0x49dac1=_0x530da1;else{toastr[_0x22c2c6(0x12f)]('远征因第\x20'+(_0x12935d+0x1)+_0x22c2c6(0x83),_0x22c2c6(0x104)),manualStopRequested=!![];break;}}!manualStopRequested&&toastr[_0x22c2c6(0xb8)]('凯旋!远征大捷!所有未载之史均已化为帝国永恒的记忆!',_0x22c2c6(0x12d));}catch(_0x12e994){console['error'](_0x22c2c6(0xe8),_0x12e994),toastr[_0x22c2c6(0xe4)]('远征途中遭遇重大挫折,任务中止!您可以随时【继续远征】。','远征失败');}finally{isExpeditionRunning=![],document[_0x22c2c6(0xb1)](new CustomEvent(_0x22c2c6(0xa8),{'detail':{'isRunning':![],'manualStop':manualStopRequested}}));}}export function stopExpedition(){const _0x19d478=_0x17f21b;isExpeditionRunning?(manualStopRequested=!![],toastr[_0x19d478(0x131)](_0x19d478(0xae),_0x19d478(0xce))):toastr['warning'](_0x19d478(0x10a),_0x19d478(0xe5));}export async function executeCompilation(_0x260242,_0x2f1a7e){const _0x35a1e6=_0x17f21b;if(!Array[_0x35a1e6(0xfe)](_0x2f1a7e)||_0x2f1a7e['length']===0x0)return toastr[_0x35a1e6(0x12f)]('未选择任何条目进行编纂。',_0x35a1e6(0x13f)),{'success':![],'error':_0x35a1e6(0x93)};toastr[_0x35a1e6(0x131)](_0x35a1e6(0xe2)+_0x260242+_0x35a1e6(0x100)+_0x2f1a7e[_0x35a1e6(0xec)]+_0x35a1e6(0x85),_0x35a1e6(0xd5));let _0x38e949=0x0,_0x1e48fa=0x0,_0x293c41=[];try{const _0x82628f=await loadWorldInfo(_0x260242);if(!_0x82628f||!_0x82628f[_0x35a1e6(0x103)])throw new Error('无法加载书库《'+_0x260242+_0x35a1e6(0xb7));for(const _0x468b3f of _0x2f1a7e){const _0x5b1537=_0x82628f[_0x35a1e6(0x103)][_0x468b3f];if(!_0x5b1537){_0x293c41[_0x35a1e6(0x10f)](_0x35a1e6(0x13b)+_0x468b3f+_0x35a1e6(0xc8));continue;}const _0x157edf=_0x5b1537['content'];if(!_0x157edf[_0x35a1e6(0xdb)]()){_0x293c41[_0x35a1e6(0x10f)](_0x35a1e6(0x13b)+(_0x5b1537[_0x35a1e6(0xcd)]||_0x468b3f)+_0x35a1e6(0x136));continue;}const _0x3c02a6={'bookName':_0x260242,'entryName':_0x5b1537['comment']||_0x468b3f};try{const _0x42bee5=await ingestTextToHanlinyuan(_0x157edf,'lorebook',_0x3c02a6);_0x42bee5[_0x35a1e6(0xb8)]?(_0x38e949++,_0x1e48fa+=_0x42bee5['count']):_0x293c41[_0x35a1e6(0x10f)]('条目【'+(_0x5b1537[_0x35a1e6(0xcd)]||_0x468b3f)+_0x35a1e6(0x122)+_0x42bee5[_0x35a1e6(0xe4)]);}catch(_0x1528ba){_0x293c41[_0x35a1e6(0x10f)](_0x35a1e6(0x13b)+(_0x5b1537[_0x35a1e6(0xcd)]||_0x468b3f)+'】处理时发生严重错误:\x20'+_0x1528ba[_0x35a1e6(0xb9)]);}}let _0x2b59f0=_0x35a1e6(0xe3)+_0x38e949+_0x35a1e6(0x90)+_0x2f1a7e['length']+'\x20个条目,共新增\x20'+_0x1e48fa+'\x20条忆识。';return _0x293c41['length']>0x0?(_0x2b59f0+=_0x35a1e6(0xb3)+_0x293c41[_0x35a1e6(0x14b)]('\x0a-\x20'),toastr[_0x35a1e6(0x12f)](_0x35a1e6(0x98),_0x35a1e6(0xd2)),console[_0x35a1e6(0xba)](_0x35a1e6(0xcb),_0x293c41)):toastr['success'](_0x35a1e6(0xfd)+_0x1e48fa+'\x20条忆识。',_0x35a1e6(0xd2)),{'success':_0x293c41[_0x35a1e6(0xec)]===0x0,'content':_0x2b59f0,'totalSuccess':_0x38e949,'totalVectors':_0x1e48fa,'errors':_0x293c41};}catch(_0x2220cf){return console[_0x35a1e6(0xe4)]('[翰林院]\x20批量条目入库失败:',_0x2220cf),toastr['error'](_0x35a1e6(0x13c)+_0x2220cf[_0x35a1e6(0xb9)],_0x35a1e6(0xd2)),{'success':![],'error':_0x2220cf[_0x35a1e6(0xb9)]};}}