From 34f2559e443522e7e8d83634f02c1fcc242f2d94 Mon Sep 17 00:00:00 2001 From: Wx-2025 <351320169@qq.com> Date: Wed, 3 Sep 2025 22:14:07 +0800 Subject: [PATCH] Update cwb_uiManager.js --- CharacterWorldBook/src/cwb_uiManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CharacterWorldBook/src/cwb_uiManager.js b/CharacterWorldBook/src/cwb_uiManager.js index 772a2d2..33f6162 100644 --- a/CharacterWorldBook/src/cwb_uiManager.js +++ b/CharacterWorldBook/src/cwb_uiManager.js @@ -1 +1 @@ -(function(_0x3880d7,_0xeda7af){const _0x43a4b0=_0x5ecd,_0x1f6673=_0x3880d7();while(!![]){try{const _0x1dc1e0=parseInt(_0x43a4b0(0x185))/0x1*(-parseInt(_0x43a4b0(0x1d1))/0x2)+-parseInt(_0x43a4b0(0x1b1))/0x3*(-parseInt(_0x43a4b0(0x14f))/0x4)+parseInt(_0x43a4b0(0x15d))/0x5+parseInt(_0x43a4b0(0x10a))/0x6+-parseInt(_0x43a4b0(0x11d))/0x7*(-parseInt(_0x43a4b0(0x147))/0x8)+parseInt(_0x43a4b0(0x148))/0x9*(-parseInt(_0x43a4b0(0x1d2))/0xa)+parseInt(_0x43a4b0(0xfd))/0xb*(-parseInt(_0x43a4b0(0x108))/0xc);if(_0x1dc1e0===_0xeda7af)break;else _0x1f6673['push'](_0x1f6673['shift']());}catch(_0x5d4d76){_0x1f6673['push'](_0x1f6673['shift']());}}}(_0x3a85,0x456aa));import{SCRIPT_ID_PREFIX,CHAR_CARD_VIEWER_BUTTON_ID,CHAR_CARD_VIEWER_POPUP_ID,state}from'./cwb_state.js';import{logDebug,logError,showToastr,escapeHtml,parseCustomFormat,buildCustomFormat,isCwbEnabled}from'./cwb_utils.js';import{deleteLorebookEntries,getTargetWorldBook}from'./cwb_lorebookManager.js';function _0x5ecd(_0x2050c2,_0x160e49){const _0x3a85db=_0x3a85();return _0x5ecd=function(_0x5ecd99,_0x1c0c51){_0x5ecd99=_0x5ecd99-0xfc;let _0x2d2ac8=_0x3a85db[_0x5ecd99];return _0x2d2ac8;},_0x5ecd(_0x2050c2,_0x160e49);}import{manualUpdateLogic}from'./cwb_core.js';const {jQuery:$,SillyTavern,TavernHelper}=window;function createCharCardViewerPopupHtml(_0x3501c7){const _0x5d6c89=_0x5ecd,_0x471280={'narrative_essence.core_traits.name':_0x5d6c89(0x16f),'narrative_essence.key_relationships.name':_0x5d6c89(0x1b8)},_0x35e114={'name':'姓名','archetype':_0x5d6c89(0x103),'gender':'性别','age':'年龄','race':'种族','current_status':_0x5d6c89(0x1d4),'first_impression':_0x5d6c89(0x127),'key_features':_0x5d6c89(0x14e),'attire':'衣着风格','mannerisms':'习惯举止','voice':_0x5d6c89(0x1bf),'tags':_0x5d6c89(0x107),'description':_0x5d6c89(0x1b3),'motivation':'内在驱动','values':'价值观','inner_conflict':_0x5d6c89(0x13e),'interaction_style':'互动风格','skills':_0x5d6c89(0x1c0),'reputation':_0x5d6c89(0x1d6),'core_traits':_0x5d6c89(0x1be),'verbal_patterns':_0x5d6c89(0x1d8),'key_relationships':_0x5d6c89(0x136),'definition':_0x5d6c89(0x1bd),'evidence':'具体事例','style_summary':_0x5d6c89(0x1b0),'quotes':_0x5d6c89(0x1a5),'summary':'关系概述'},_0x509621=(_0x3b4e64,_0x46b2c0)=>{const _0x37a0ae=_0x5d6c89,_0x16de71=_0x46b2c0[_0x37a0ae(0x196)](/\.\d+\./g,'.');if(_0x471280[_0x16de71])return _0x471280[_0x16de71];return _0x35e114[_0x3b4e64]||_0x3b4e64[_0x37a0ae(0x196)](/_/g,'\x20');},_0x41503b=(_0x573ec7,_0x4ad1bf,_0x5b447a,_0x48f6a2=![],_0x4ae790=![])=>{const _0x1dc6e3=_0x5d6c89,_0x4919c5=escapeHtml(_0x573ec7),_0x5b5195=escapeHtml(_0x4ae790?_0x5b447a[_0x1dc6e3(0x17e)]('\x0a'):_0x5b447a||''),_0x33ff5c=_0x5b447a&&String(_0x5b447a)['length']>0x32||Array['isArray'](_0x5b447a)&&_0x5b447a[_0x1dc6e3(0x134)]>0x1,_0x1007a7=_0x4ae790?Math['max'](0x3,_0x5b447a[_0x1dc6e3(0x134)]):_0x33ff5c?0x4:0x2,_0x4076dd=_0x1dc6e3(0x173)+_0x4ad1bf+_0x1dc6e3(0x19b)+_0x4ae790+_0x1dc6e3(0x150)+_0x1007a7+'\x22>'+_0x5b5195+_0x1dc6e3(0x184);return _0x1dc6e3(0x1aa)+_0x4919c5+_0x1dc6e3(0x13d)+_0x4076dd+_0x1dc6e3(0x182);},_0x3fdb7f=(_0x4b6744,_0x26144f,_0x3302d5)=>{const _0x123921=_0x5d6c89;if(!_0x26144f||typeof _0x26144f!==_0x123921(0x1cc)||Object[_0x123921(0x179)](_0x26144f)[_0x123921(0x134)]===0x0)return'';let _0x5f49da=_0x123921(0x102)+escapeHtml(_0x4b6744)+'';for(const [_0x4f146b,_0x32a035]of Object['entries'](_0x26144f)){const _0x2cb4ec=_0x3302d5?_0x3302d5+'.'+_0x4f146b:_0x4f146b,_0x2b9d1e=_0x509621(_0x4f146b,_0x2cb4ec);if(typeof _0x32a035==='object'&&_0x32a035!==null&&!Array[_0x123921(0x157)](_0x32a035))_0x5f49da+=_0x3fdb7f(_0x2b9d1e,_0x32a035,_0x2cb4ec);else Array[_0x123921(0x157)](_0x32a035)&&_0x32a035[_0x123921(0x134)]>0x0&&typeof _0x32a035[0x0]===_0x123921(0x1cc)?(_0x5f49da+=_0x123921(0x11e)+escapeHtml(_0x2b9d1e)+_0x123921(0x161),_0x32a035[_0x123921(0x189)]((_0x5ba475,_0x3a17d3)=>{const _0x162cd8=_0x123921;_0x5f49da+='';for(const [_0x3ba534,_0x2dfe69]of Object['entries'](_0x5ba475)){const _0x48c40a=_0x2cb4ec+'.'+_0x3a17d3+'.'+_0x3ba534;_0x5f49da+=_0x41503b(_0x509621(_0x3ba534,_0x48c40a),_0x48c40a,_0x2dfe69,![],Array[_0x162cd8(0x157)](_0x2dfe69));}_0x5f49da+='';}),_0x5f49da+=_0x123921(0x18e)):_0x5f49da+=_0x41503b(_0x2b9d1e,_0x2cb4ec,_0x32a035,![],Array[_0x123921(0x157)](_0x32a035));}return _0x5f49da+=_0x123921(0x18e),_0x5f49da;};let _0x30fd82=_0x5d6c89(0x14b)+CHAR_CARD_VIEWER_POPUP_ID+'\x22\x20class=\x22cwb-cyber-popup\x22>';_0x30fd82+=_0x5d6c89(0x140);if(!_0x3501c7||_0x3501c7[_0x5d6c89(0x134)]===0x0)return _0x30fd82+='

数据链路中断...未在当前世界书协议中找到角色数据。请执行一次手动更新以初始化链接。

',_0x30fd82;return _0x30fd82+=_0x5d6c89(0x1bb),_0x30fd82+=_0x5d6c89(0x141),_0x3501c7['forEach']((_0x38016b,_0x14a948)=>{const _0x2eaeef=_0x5d6c89,_0x17becd=_0x38016b[_0x2eaeef(0x159)]?_0x2eaeef(0x15f):_0x38016b[_0x2eaeef(0x17b)]?.[_0x2eaeef(0x165)]||_0x2eaeef(0x11c)+(_0x14a948+0x1),_0x387976=_0x14a948===0x0?_0x2eaeef(0x1ac):_0x2eaeef(0x144);_0x30fd82+=_0x2eaeef(0x120)+_0x387976+_0x2eaeef(0x149)+_0x38016b[_0x2eaeef(0x158)]+_0x2eaeef(0x100)+_0x38016b[_0x2eaeef(0x158)]+'\x22>'+escapeHtml(_0x17becd)+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{const _0x4a9340=_0x5d6c89;_0x30fd82+=_0x4a9340(0x101)+(_0x2d0807===0x0?_0x4a9340(0x171):'')+_0x4a9340(0x129)+_0x3af280[_0x4a9340(0x158)]+_0x4a9340(0x119)+_0x3af280[_0x4a9340(0x158)]+'\x22>';if(_0x3af280[_0x4a9340(0x159)])_0x30fd82+=_0x4a9340(0x180)+escapeHtml(_0x3af280[_0x4a9340(0x1a9)])+_0x4a9340(0x188);else{const _0x119bab=_0x3af280[_0x4a9340(0x17b)];if(_0x119bab){const _0x40f7ba=_0x119bab[_0x4a9340(0x165)]||_0x4a9340(0x17a)+(_0x2d0807+0x1);if(_0x119bab[_0x4a9340(0x165)])_0x30fd82+=_0x3fdb7f('姓名',{'name':_0x119bab[_0x4a9340(0x165)]},'');if(_0x119bab[_0x4a9340(0x183)])_0x30fd82+=_0x3fdb7f('核心认同',_0x119bab[_0x4a9340(0x183)],_0x4a9340(0x183));if(_0x119bab[_0x4a9340(0x167)])_0x30fd82+=_0x3fdb7f(_0x4a9340(0x1d3),_0x119bab[_0x4a9340(0x167)],'physical_imprint');if(_0x119bab[_0x4a9340(0x132)])_0x30fd82+=_0x3fdb7f(_0x4a9340(0x13f),_0x119bab[_0x4a9340(0x132)],_0x4a9340(0x132));if(_0x119bab[_0x4a9340(0x198)])_0x30fd82+=_0x3fdb7f(_0x4a9340(0x177),_0x119bab[_0x4a9340(0x198)],'social_matrix');if(_0x119bab[_0x4a9340(0x122)])_0x30fd82+=_0x3fdb7f('叙事精粹',_0x119bab[_0x4a9340(0x122)],'narrative_essence');_0x30fd82+=_0x4a9340(0x1ad)+_0x3af280['uid']+_0x4a9340(0x118)+_0x3af280[_0x4a9340(0x158)]+'\x22\x20class=\x22cwb-cyber-field__input\x20cwb-insertion-position\x22\x20data-uid=\x22'+_0x3af280[_0x4a9340(0x158)]+_0x4a9340(0x1ba)+(_0x3af280[_0x4a9340(0x139)]===_0x4a9340(0x178)?_0x4a9340(0x125):'')+'>角色定义之前\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\x20\x20\x20\x20\x20\x20\x20@D\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\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\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\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\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{const _0x1785f1=_0x4f22ab;showToastr(_0x1785f1(0x15b),_0x1785f1(0x17d)),showCharCardViewerPopup();}),_0x436a38[_0x4f22ab(0x143)](_0x4f22ab(0x154))['on'](_0x4f22ab(0x1ce),async function(){const _0x580f00=_0x4f22ab,_0x4880e1=$(this);_0x4880e1['prop'](_0x580f00(0x124),!![])[_0x580f00(0x114)](_0x580f00(0x170)),await manualUpdateLogic(),showToastr(_0x580f00(0x15b),'更新完成,正在刷新查看器...'),showCharCardViewerPopup();}),_0x436a38[_0x4f22ab(0x143)](_0x4f22ab(0x126))['on'](_0x4f22ab(0x1ce),function(){const _0x4768b7=_0x4f22ab,_0x236dd7=$(this),_0x2e93d4=_0x236dd7[_0x4768b7(0x17f)](_0x4768b7(0x1da));_0x436a38[_0x4768b7(0x143)]('.cwb-cyber-tab')['removeClass'](_0x4768b7(0x171)),_0x236dd7[_0x4768b7(0x181)]('.cwb-cyber-tab')[_0x4768b7(0x1d5)](_0x4768b7(0x171)),_0x436a38['find'](_0x4768b7(0x1d7))['removeClass'](_0x4768b7(0x171)),_0x436a38[_0x4768b7(0x143)](_0x4768b7(0x163)+_0x2e93d4)['addClass'](_0x4768b7(0x171));}),_0x436a38['find'](_0x4f22ab(0x14c))['on']('click',async function(_0x54f990){const _0xefb992=_0x4f22ab;_0x54f990[_0xefb992(0x116)]();const _0x405765=$(this)[_0xefb992(0x17f)](_0xefb992(0x1da));await deleteLorebookEntries([_0x405765]);const _0x1bccb6=$(this)[_0xefb992(0x181)](_0xefb992(0xfc)),_0x1aea14=_0x436a38[_0xefb992(0x143)](_0xefb992(0x163)+_0x405765),_0x55cf6c=_0x1bccb6[_0xefb992(0x110)](_0xefb992(0x171));_0x1bccb6['remove'](),_0x1aea14[_0xefb992(0x1ae)]();if(_0x55cf6c&&_0x436a38['find'](_0xefb992(0xfc))[_0xefb992(0x134)]>0x0)_0x436a38[_0xefb992(0x143)](_0xefb992(0xfc))['first']()['find'](_0xefb992(0x126))[_0xefb992(0x1cb)](_0xefb992(0x1ce));else _0x436a38[_0xefb992(0x143)](_0xefb992(0xfc))[_0xefb992(0x134)]===0x0&&showCharCardViewerPopup();}),_0x436a38[_0x4f22ab(0x143)](_0x4f22ab(0x1a4))['on'](_0x4f22ab(0x1ce),async function(){const _0x21103f=_0x4f22ab,_0x285654=_0x436a38[_0x21103f(0x143)](_0x21103f(0x126))['map'](function(){const _0x186527=_0x21103f;return $(this)['data'](_0x186527(0x1da));})[_0x21103f(0xff)]();_0x285654['length']>0x0&&await deleteLorebookEntries(_0x285654),showCharCardViewerPopup();}),_0x436a38[_0x4f22ab(0x143)](_0x4f22ab(0x18d))['on']('click',async function(){const _0x37dafc=_0x4f22ab,_0x497ae8=$(this),_0x28fb12=_0x497ae8['data'](_0x37dafc(0x158));_0x497ae8[_0x37dafc(0x15c)](_0x37dafc(0x124),!![])[_0x37dafc(0x114)](_0x37dafc(0x137));try{const _0x302eef=await getTargetWorldBook();if(!_0x302eef)throw new Error(_0x37dafc(0x1c9));const _0x4c0808=_0x436a38[_0x37dafc(0x143)](_0x37dafc(0x163)+_0x28fb12),_0x1abc7a={},_0x2cfdcb=(_0x53171e,_0x2243e9,_0x16412e)=>{const _0x199212=_0x37dafc,_0x28f360=_0x2243e9[_0x199212(0x164)]('.');let _0xe25c45=_0x53171e;_0x28f360[_0x199212(0x189)]((_0x55e61f,_0x29b53d)=>{const _0x4f713d=_0x199212;if(_0x29b53d===_0x28f360[_0x4f713d(0x134)]-0x1)_0xe25c45[_0x55e61f]=_0x16412e===''?null:_0x16412e;else{const _0x5c678d=/^\d+$/[_0x4f713d(0x133)](_0x28f360[_0x29b53d+0x1]);!_0xe25c45[_0x55e61f]&&(_0xe25c45[_0x55e61f]=_0x5c678d?[]:{}),_0xe25c45=_0xe25c45[_0x55e61f];}});};_0x4c0808[_0x37dafc(0x143)]('.cwb-cyber-field__input')[_0x37dafc(0x18f)](function(){const _0x747a66=_0x37dafc,_0x56fbea=$(this),_0x15f086=_0x56fbea[_0x747a66(0x17f)]('path');let _0x1cad18=_0x56fbea[_0x747a66(0x13b)]();_0x56fbea[_0x747a66(0x17f)](_0x747a66(0x1c2))&&(_0x1cad18=_0x1cad18[_0x747a66(0x164)]('\x0a')['map'](_0x2d535a=>_0x2d535a[_0x747a66(0x12a)]())[_0x747a66(0x13a)](Boolean)),_0x15f086&&_0x2cfdcb(_0x1abc7a,_0x15f086,_0x1cad18);});const _0x1f7801=buildCustomFormat(_0x1abc7a),_0x363ad7=await TavernHelper[_0x37dafc(0x195)](_0x302eef),_0x20d754=_0x363ad7[_0x37dafc(0x143)](_0xb5b078=>_0xb5b078[_0x37dafc(0x158)]===_0x28fb12);if(!_0x20d754)throw new Error(_0x37dafc(0x123));const _0x54afc6=_0x4c0808[_0x37dafc(0x143)](_0x37dafc(0x1c6))[_0x37dafc(0x13b)](),_0xa6eb1b=parseInt(_0x4c0808[_0x37dafc(0x143)]('.cwb-insertion-depth')[_0x37dafc(0x13b)](),0xa),_0x126593=parseInt(_0x4c0808[_0x37dafc(0x143)](_0x37dafc(0x16d))[_0x37dafc(0x13b)](),0xa);logDebug(_0x37dafc(0x192)+_0x28fb12,{'insertionPosition':_0x54afc6,'insertionDepth':_0xa6eb1b,'insertionOrder':_0x126593});const _0xc470c6={'before_char':'before_character_definition','after_char':'after_character_definition','before_an':'before_author_note','after_an':'after_author_note','at_depth':_0x37dafc(0x191)},_0x4bef24={..._0x20d754};_0x4bef24[_0x37dafc(0x1a9)]=_0x1f7801,_0x4bef24[_0x37dafc(0x158)]=_0x28fb12;const _0x484fba=_0xc470c6[_0x54afc6];_0x4bef24['position']=_0x484fba||_0x37dafc(0x142),_0x54afc6===_0x37dafc(0x1b6)?_0x4bef24[_0x37dafc(0x16b)]=isNaN(_0xa6eb1b)?0x0:_0xa6eb1b:_0x4bef24['depth']=null,_0x4bef24[_0x37dafc(0x14d)]=isNaN(_0x126593)?0x1b59:_0x126593,logDebug(_0x37dafc(0x16a)+_0x28fb12,{'position':_0x4bef24['position'],'depth':_0x4bef24[_0x37dafc(0x16b)],'order':_0x4bef24[_0x37dafc(0x14d)],'hasDepthField':'depth'in _0x4bef24}),await TavernHelper[_0x37dafc(0x145)](_0x302eef,[_0x4bef24]),showToastr(_0x37dafc(0x1a7),_0x37dafc(0x11b));}catch(_0x754beb){logError(_0x37dafc(0x162),_0x754beb),showToastr('error',_0x37dafc(0x176)+_0x754beb['message']);}finally{_0x497ae8['prop'](_0x37dafc(0x124),![])[_0x37dafc(0x146)](_0x37dafc(0x169));}});}function closeCharCardViewerPopup(){const _0x51ca3d=_0x5ecd;$('#'+CHAR_CARD_VIEWER_POPUP_ID)[_0x51ca3d(0x1ae)]();}export async function showCharCardViewerPopup(){const _0x1bca5a=_0x5ecd;if(!isCwbEnabled())return;closeCharCardViewerPopup();try{const _0x583bc4=await getTargetWorldBook();if(!_0x583bc4){showToastr(_0x1bca5a(0x135),'当前角色未设置主世界书或自定义世界书。'),$(_0x1bca5a(0x10f))[_0x1bca5a(0x193)](createCharCardViewerPopupHtml([])),bindCharCardViewerPopupEvents($('#'+CHAR_CARD_VIEWER_POPUP_ID));return;}const _0x41ce9e=await TavernHelper[_0x1bca5a(0x195)](_0x583bc4);let _0x337070=state[_0x1bca5a(0x16e)];if(!_0x337070||_0x337070[_0x1bca5a(0x113)]('unknown_chat')){logError(_0x1bca5a(0x15e)+_0x337070+_0x1bca5a(0x130)),$(_0x1bca5a(0x10f))[_0x1bca5a(0x193)](createCharCardViewerPopupHtml([])),bindCharCardViewerPopupEvents($('#'+CHAR_CARD_VIEWER_POPUP_ID));return;}const _0x558f13=_0x337070[_0x1bca5a(0x196)](/ imported/g,'');let _0x5467f3=[],_0x3e2868;state['worldbookTarget']===_0x1bca5a(0x1b2)&&state[_0x1bca5a(0x18a)]?_0x3e2868=_0x41ce9e[_0x1bca5a(0x13a)](_0x15e527=>{const _0x904d97=_0x1bca5a;if(!_0x15e527[_0x904d97(0x166)]||!Array['isArray'](_0x15e527[_0x904d97(0x179)]))return![];if(_0x15e527[_0x904d97(0x179)][_0x904d97(0x12c)](_0x904d97(0x186))||_0x15e527[_0x904d97(0x179)]['includes'](_0x904d97(0x1ca)))return!![];if(_0x15e527[_0x904d97(0x1a9)])try{const _0x92c308=parseCustomFormat(_0x15e527['content']);return _0x92c308&&Object[_0x904d97(0x179)](_0x92c308)['length']>0x0;}catch(_0x5be7cb){return![];}return![];}):_0x3e2868=_0x41ce9e[_0x1bca5a(0x13a)](_0x4438fb=>_0x4438fb[_0x1bca5a(0x166)]&&Array[_0x1bca5a(0x157)](_0x4438fb[_0x1bca5a(0x179)])&&_0x4438fb['keys'][_0x1bca5a(0x12c)](_0x558f13));const _0x48f895=_0x3e2868['filter'](_0xa42a5c=>_0xa42a5c[_0x1bca5a(0x179)][_0x1bca5a(0x12c)]('Amily2角色总集')&&_0xa42a5c['keys'][_0x1bca5a(0x12c)](_0x1bca5a(0x1ca)));_0x48f895['forEach']((_0x4dbe76,_0x3dc66e)=>{const _0x29ac19=_0x1bca5a;_0x5467f3[_0x29ac19(0x172)]({'uid':_0x4dbe76[_0x29ac19(0x158)],'isRoster':!![],'comment':_0x4dbe76['comment'],'content':_0x4dbe76[_0x29ac19(0x1a9)],'rosterIndex':_0x3dc66e});});const _0x5194bc=_0x3e2868[_0x1bca5a(0x13a)](_0x3b6924=>!_0x3b6924[_0x1bca5a(0x179)][_0x1bca5a(0x12c)]('Amily2角色总集'))[_0x1bca5a(0x1ab)](_0x2adc62=>{const _0x2ba406=_0x1bca5a;logDebug(_0x2ba406(0x1d9)+_0x2adc62['uid'],{'position':_0x2adc62[_0x2ba406(0x1c4)],'depth':_0x2adc62['depth'],'order':_0x2adc62[_0x2ba406(0x14d)],'comment':_0x2adc62[_0x2ba406(0x14a)]});const _0x2e3c0a={0x0:'before_char',0x1:_0x2ba406(0x19d),0x2:_0x2ba406(0x19f),0x3:_0x2ba406(0x1b4),0x4:'at_depth','before_character_definition':_0x2ba406(0x178),'after_character_definition':_0x2ba406(0x19d),'before_author_note':_0x2ba406(0x19f),'after_author_note':_0x2ba406(0x1b4),'at_depth_as_system':'at_depth'},_0x11a1f6=_0x2adc62[_0x2ba406(0x1c4)],_0x4b2c5c=_0x2e3c0a[_0x11a1f6]||_0x2ba406(0x1b6),_0x4461da=_0x11a1f6===0x4||_0x11a1f6===_0x2ba406(0x191)?_0x2adc62[_0x2ba406(0x16b)]??0x0:0x0;return logDebug('[DEBUG]\x20映射结果\x20UID:'+_0x2adc62[_0x2ba406(0x158)],{'originalPosition':_0x11a1f6,'mappedPosition':_0x4b2c5c,'finalDepth':_0x4461da}),{'uid':_0x2adc62['uid'],'isRoster':![],'comment':_0x2adc62[_0x2ba406(0x14a)],'content':_0x2adc62[_0x2ba406(0x1a9)],'parsed':parseCustomFormat(_0x2adc62['content']),'insertionPosition':_0x4b2c5c,'insertionDepth':_0x4461da,'insertionOrder':_0x2adc62[_0x2ba406(0x14d)]??0x1b59};})[_0x1bca5a(0x13a)](_0x4e98a1=>_0x4e98a1[_0x1bca5a(0x17b)]&&Object['keys'](_0x4e98a1['parsed'])['length']>0x0);_0x5467f3=_0x5467f3[_0x1bca5a(0x174)](_0x5194bc);const _0x615953=createCharCardViewerPopupHtml(_0x5467f3);$('body')[_0x1bca5a(0x193)](_0x615953);const _0x10ec5f=$('#'+CHAR_CARD_VIEWER_POPUP_ID);bindCharCardViewerPopupEvents(_0x10ec5f);}catch(_0x3412e6){logError(_0x1bca5a(0x112),_0x3412e6),showToastr('error',_0x1bca5a(0x138));}}function _0x3a85(){const _0x2124a6=['','保存角色卡失败:','#cwb-char-content-','split','name','enabled','physical_imprint','css','保存修改','[DEBUG]\x20最终保存数据\x20UID:','depth','top','.cwb-insertion-order','currentChatFileIdentifier','特质名称','\x20更新中...','active','push','','正在刷新角色数据...','join','data','\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(只读)\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','closest','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','core_identity','','45XLpDdm','Amily2角色总集','left','\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','forEach','customWorldBook','','.cwb-viewer-popup-close-button','.cwb-save-button','','each','\x22>\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保存对\x20','at_depth_as_system','[DEBUG]\x20界面收集值\x20UID:','append','insertionOrder','getLorebookEntries','replace','悬浮窗按钮显示状态更新:','social_matrix','\x22\x20min=\x220\x22>\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\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\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','offset','\x22\x20data-is-array=\x22','120px','after_char','\x22\x20min=\x220\x22\x20max=\x229999\x22>\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\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\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\x20\x20\x20','\x22\x20title=\x22删除此条目\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','outerHeight','grab','#cwb-viewer-delete-all','代表性引言','toggle','success','width','content','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','map','cwb-cyber-tab\x20active','\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注入设置\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\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\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\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\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\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','stringify','特质定义','核心特质','声音特征','技能能力','insertionDepth','is-array','height','position','#cwb-viewer-refresh','.cwb-insertion-position','outerWidth','clientX','未找到目标世界书。','角色总览','trigger','object','mousedown','click','min','STORAGE_KEY_VIEWER_BUTTON_POS','5034ABjjCb','1090fDnqZy','物理印记','当前状态','addClass','他人声望','.cwb-cyber-content-pane','语言范式','[DEBUG]\x20原始条目数据\x20UID:','char-uid','.cwb-cyber-tab','130262WroinT','cursor','get','\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','身份原型','.cwb-insertion-depth-container','hide','10px','性格标签','996CYVxSq','max','2832804xAejHJ','clientY','.cwb-insertion-settings-content','viewerEnabled','>作者注释之前\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\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x22\x20title=\x22查看角色世界书\x22\x20class=\x22fa-solid\x20fa-book-open\x22>','\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\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','\x22\x20for\x20viewer.','touchmove.cwbViewer','psyche_profile','test','length','warning','关键关系','\x20保存中...','加载角色卡数据时出错。','insertionPosition','filter','val','\x22>注入顺序\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\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角色数据核心\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\x20更新\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20清除\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20×\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','','before_character_definition','find','cwb-cyber-tab','setLorebookEntries','text','16ilNtBH','19953VsGzUr','\x22\x20data-uid-wrapper=\x22','comment','0x0?closeCharCardViewerPopup():showCharCardViewerPopup();}function keepButtonInBounds(_0x5ab00d,_0x373701=![]){const _0x4c8a0b=_0x5ecd;if(!_0x5ab00d||!_0x5ab00d[_0x4c8a0b(0x134)])return;const _0x439dd9=$(window)[_0x4c8a0b(0x1a8)](),_0x5d2ded=$(window)[_0x4c8a0b(0x1c3)](),_0x2de270=_0x5ab00d[_0x4c8a0b(0x1c7)](),_0xf8b668=_0x5ab00d['outerHeight']();let _0x4713ad=_0x5ab00d['offset'](),_0x5209d1=Math['max'](0x0,Math[_0x4c8a0b(0x1cf)](_0x4713ad[_0x4c8a0b(0x16c)],_0x5d2ded-_0xf8b668)),_0x3c2e40=Math['max'](0x0,Math['min'](_0x4713ad[_0x4c8a0b(0x187)],_0x439dd9-_0x2de270));_0x5ab00d[_0x4c8a0b(0x168)]({'top':_0x5209d1+'px','left':_0x3c2e40+'px'}),_0x373701&&localStorage['setItem'](state[_0x4c8a0b(0x1d0)],JSON[_0x4c8a0b(0x1bc)]({'top':_0x5ab00d[_0x4c8a0b(0x168)](_0x4c8a0b(0x16c)),'left':_0x5ab00d['css'](_0x4c8a0b(0x187))}));}function makeButtonDraggable(_0xcc9d44){const _0x7589a1=_0x5ecd;let _0x8f4d53=![],_0x442b63=![],_0x455269={'x':0x0,'y':0x0};const _0x3b5e28=_0x2ae352=>_0x2ae352[_0x7589a1(0x12e)]&&_0x2ae352[_0x7589a1(0x12e)][_0x7589a1(0x134)]?_0x2ae352[_0x7589a1(0x12e)][0x0]:_0x2ae352,_0x535c97=function(_0x3b0ea2){const _0x987000=_0x7589a1;if(_0x3b0ea2[_0x987000(0x128)]===_0x987000(0x115))_0x3b0ea2[_0x987000(0x121)]();_0x8f4d53=!![],_0x442b63=![];const _0x12e63=_0x3b5e28(_0x3b0ea2);_0x455269['x']=_0x12e63['clientX']-_0xcc9d44[_0x987000(0x19a)]()[_0x987000(0x187)],_0x455269['y']=_0x12e63[_0x987000(0x10b)]-_0xcc9d44[_0x987000(0x19a)]()[_0x987000(0x16c)],_0xcc9d44[_0x987000(0x168)]('cursor','grabbing'),$(_0x987000(0x10f))[_0x987000(0x168)]({'user-select':_0x987000(0x153),'-webkit-user-select':_0x987000(0x153)});},_0x2a5514=function(_0x3a15d1){const _0x544985=_0x7589a1;if(!_0x8f4d53)return;_0x442b63=!![];if(_0x3a15d1[_0x544985(0x128)]===_0x544985(0x11a))_0x3a15d1[_0x544985(0x121)]();const _0x2a6593=_0x3b5e28(_0x3a15d1);let _0x120787=_0x2a6593[_0x544985(0x1c8)]-_0x455269['x'],_0x6923a5=_0x2a6593[_0x544985(0x10b)]-_0x455269['y'];_0x120787=Math[_0x544985(0x109)](0x0,Math[_0x544985(0x1cf)](_0x120787,window[_0x544985(0x151)]-_0xcc9d44[_0x544985(0x1c7)]())),_0x6923a5=Math[_0x544985(0x109)](0x0,Math[_0x544985(0x1cf)](_0x6923a5,window[_0x544985(0x152)]-_0xcc9d44[_0x544985(0x1a2)]())),_0xcc9d44[_0x544985(0x168)]({'top':_0x6923a5+'px','left':_0x120787+'px','right':'','bottom':''});},_0x15cd8d=function(_0x1fa8fb){const _0x5e574d=_0x7589a1;if(!_0x8f4d53)return;_0x8f4d53=![],_0xcc9d44['css'](_0x5e574d(0xfe),_0x5e574d(0x1a3)),$(_0x5e574d(0x10f))['css']({'user-select':_0x5e574d(0x12d),'-webkit-user-select':_0x5e574d(0x12d)});if(_0x442b63)keepButtonInBounds(_0xcc9d44,!![]);else _0x1fa8fb['type']==='touchend'&&(_0x1fa8fb[_0x5e574d(0x121)](),toggleCharCardViewerPopup());};_0xcc9d44['on'](_0x7589a1(0x1cd),_0x535c97),$(document)['on'](_0x7589a1(0x15a),_0x2a5514)['on']('mouseup.cwbViewer',_0x15cd8d),_0xcc9d44['on']('touchstart',_0x535c97),$(document)['on'](_0x7589a1(0x131),_0x2a5514)['on']('touchend.cwbViewer',_0x15cd8d),_0xcc9d44['on']('click',function(_0x192dd7){const _0x58a03d=_0x7589a1;if(_0x442b63){_0x192dd7[_0x58a03d(0x121)](),_0x192dd7[_0x58a03d(0x116)]();return;}toggleCharCardViewerPopup();});}export function initializeCharCardViewer(){const _0xa686f1=_0x5ecd;if($('#'+CHAR_CARD_VIEWER_BUTTON_ID)[_0xa686f1(0x134)]>0x0)return;const _0x48afaa=_0xa686f1(0x14b)+CHAR_CARD_VIEWER_BUTTON_ID+_0xa686f1(0x11f);$(_0xa686f1(0x10f))[_0xa686f1(0x193)](_0x48afaa);const _0x43b22b=$('#'+CHAR_CARD_VIEWER_BUTTON_ID);makeButtonDraggable(_0x43b22b);const _0x3c86bb=JSON['parse'](localStorage[_0xa686f1(0x111)](state['STORAGE_KEY_VIEWER_BUTTON_POS'])||_0xa686f1(0x117));_0x3c86bb?_0x43b22b[_0xa686f1(0x168)]({'top':_0x3c86bb['top'],'left':_0x3c86bb[_0xa686f1(0x187)]}):_0x43b22b['css']({'top':_0xa686f1(0x19c),'right':_0xa686f1(0x106),'left':_0xa686f1(0x12d)});updateViewerButtonVisibility();let _0x393290;$(window)['on'](_0xa686f1(0x160),function(){clearTimeout(_0x393290),_0x393290=setTimeout(()=>keepButtonInBounds($('#'+CHAR_CARD_VIEWER_BUTTON_ID),!![]),0x96);});}export function updateViewerButtonVisibility(){const _0x150144=_0x5ecd,_0x42c9d4=$('#'+CHAR_CARD_VIEWER_BUTTON_ID);if(_0x42c9d4[_0x150144(0x134)]===0x0)return;const _0x43ea41=isCwbEnabled()&&state[_0x150144(0x10d)];_0x42c9d4[_0x150144(0x1a6)](_0x43ea41),logDebug(_0x150144(0x197),{'masterEnabled':isCwbEnabled(),'viewerEnabled':state['viewerEnabled'],'shouldShow':_0x43ea41});} +(function(_0x3d1814,_0x28b7f1){const _0x1e077f=_0x3a48,_0xad3d44=_0x3d1814();while(!![]){try{const _0x3d76b1=-parseInt(_0x1e077f(0x1b9))/0x1+-parseInt(_0x1e077f(0x190))/0x2*(-parseInt(_0x1e077f(0x21f))/0x3)+parseInt(_0x1e077f(0x1a6))/0x4*(parseInt(_0x1e077f(0x200))/0x5)+parseInt(_0x1e077f(0x239))/0x6+-parseInt(_0x1e077f(0x20e))/0x7+parseInt(_0x1e077f(0x1aa))/0x8+-parseInt(_0x1e077f(0x24a))/0x9;if(_0x3d76b1===_0x28b7f1)break;else _0xad3d44['push'](_0xad3d44['shift']());}catch(_0x433421){_0xad3d44['push'](_0xad3d44['shift']());}}}(_0x4ef5,0xc7df1));function _0x4ef5(){const _0xb6b3c6=['加载角色卡数据时出错。','','after_an','custom','each','.cwb-insertion-position','','更新完成,正在刷新查看器...','css','4299lefXbQ','#cwb-viewer-delete-all','Amily2角色总集','人物总览','map','核心特质','.cwb-insertion-settings-content','selected','\x22\x20data-uid=\x22','change','closest','hide','error','\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注入设置\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\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\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\x20\x20\x20\x0a\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\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刷新\x0a\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\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','\x22\x20min=\x220\x22\x20max=\x229999\x22>\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\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\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\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','outerHeight','\x22>\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\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','[DEBUG]\x20原始条目数据\x20UID:','2202453tXlFBM','.cwb-cyber-tab__button','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','object','[DEBUG]\x20界面收集值\x20UID:','\x22\x20data-uid-wrapper=\x22','touches','trim','path','\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\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\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','社交矩阵','order','disabled','性格详述','438fdVwQE','特质定义','max','viewerEnabled','filter','当前状态','120px','min','.cwb-insertion-depth-container','isRoster','offset','\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\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','at_depth','active','comment','\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\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(只读)\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','concat','touchmove','content','价值观','setLorebookEntries','clientY','grabbing','length','','STORAGE_KEY_VIEWER_BUTTON_POS','resize.cwbViewer','touchmove.cwbViewer','964131WcRTvM','声音特征','\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','grab','find','char-uid','position','\x22\x20rows=\x22','join','风格总结','[DEBUG]\x20映射结果\x20UID:','\x22\x20min=\x220\x22>\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\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\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','innerWidth','他人声望','

数据链路中断...未在当前世界书协议中找到角色数据。请执行一次手动更新以初始化链接。

','当前角色未设置主世界书或自定义世界书。','prop','none','auto','removeClass','forEach','html','>角色定义之后\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\x20\x20\x20\x20\x20\x20\x20','split','10px','cwb-cyber-tab\x20active','互动风格','','touchstart','display:\x20none;','toggle','first','stopPropagation','after_char','\x22>注入顺序\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\x20\x20\x20','before_char','click','核心认同','append','before_author_note','psyche_profile','\x22\x20id=\x22cwb-char-content-','无法在世界书中找到原始条目。','getLorebookEntries','未找到目标世界书。','data','outerWidth','.cwb-cyber-tab__delete','','\x22\x20data-is-array=\x22','','注入位置\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\x20\x20\x20','insertionPosition','2894570wOySav','setItem','body','trigger','保存修改','isArray','unknown_chat','worldbookTarget'];_0x4ef5=function(){return _0xb6b3c6;};return _0x4ef5();}import{SCRIPT_ID_PREFIX,CHAR_CARD_VIEWER_BUTTON_ID,CHAR_CARD_VIEWER_POPUP_ID,state}from'./cwb_state.js';import{logDebug,logError,showToastr,escapeHtml,parseCustomFormat,buildCustomFormat,isCwbEnabled}from'./cwb_utils.js';import{deleteLorebookEntries,getTargetWorldBook}from'./cwb_lorebookManager.js';import{manualUpdateLogic}from'./cwb_core.js';const {jQuery:$,SillyTavern,TavernHelper}=window;function createCharCardViewerPopupHtml(_0x42e31d){const _0xe6020c=_0x3a48,_0x4acc26={'narrative_essence.core_traits.name':'特质名称','narrative_essence.key_relationships.name':_0xe6020c(0x1bd)},_0x1b223c={'name':'姓名','archetype':_0xe6020c(0x260),'gender':'性别','age':'年龄','race':'种族','current_status':_0xe6020c(0x195),'first_impression':_0xe6020c(0x1a0),'key_features':'显著特征','attire':'衣着风格','mannerisms':'习惯举止','voice':_0xe6020c(0x1ba),'tags':'性格标签','description':_0xe6020c(0x265),'motivation':'内在驱动','values':_0xe6020c(0x1b0),'inner_conflict':_0xe6020c(0x259),'interaction_style':_0xe6020c(0x1dd),'skills':'技能能力','reputation':_0xe6020c(0x1c9),'core_traits':_0xe6020c(0x224),'verbal_patterns':'语言范式','key_relationships':_0xe6020c(0x25f),'definition':_0xe6020c(0x191),'evidence':'具体事例','style_summary':_0xe6020c(0x1c5),'quotes':_0xe6020c(0x1e8),'summary':'关系概述'},_0x26e377=(_0x544cb7,_0xa1f90b)=>{const _0x46c94d=_0xe6020c,_0xce5776=_0xa1f90b[_0x46c94d(0x234)](/\.\d+\./g,'.');if(_0x4acc26[_0xce5776])return _0x4acc26[_0xce5776];return _0x1b223c[_0x544cb7]||_0x544cb7[_0x46c94d(0x234)](/_/g,'\x20');},_0x2fa129=(_0x4418bd,_0x2af5ca,_0x50e039,_0x15c046=![],_0x49b45f=![])=>{const _0x64b22d=_0xe6020c,_0x1586bc=escapeHtml(_0x4418bd),_0x681971=escapeHtml(_0x49b45f?_0x50e039[_0x64b22d(0x1c4)]('\x0a'):_0x50e039||''),_0xbaf34=_0x50e039&&String(_0x50e039)['length']>0x32||Array[_0x64b22d(0x213)](_0x50e039)&&_0x50e039[_0x64b22d(0x1b4)]>0x1,_0x209d4d=_0x49b45f?Math[_0x64b22d(0x192)](0x3,_0x50e039[_0x64b22d(0x1b4)]):_0xbaf34?0x4:0x2,_0x221dfd=_0x64b22d(0x23d)+_0x2af5ca+_0x64b22d(0x1fb)+_0x49b45f+_0x64b22d(0x1c3)+_0x209d4d+'\x22>'+_0x681971+_0x64b22d(0x21c);return _0x64b22d(0x248)+_0x1586bc+_0x64b22d(0x261)+_0x221dfd+_0x64b22d(0x24c);},_0x2e5e8f=(_0x3ecd3d,_0x4e9179,_0x409004)=>{const _0x182088=_0xe6020c;if(!_0x4e9179||typeof _0x4e9179!==_0x182088(0x24d)||Object['keys'](_0x4e9179)[_0x182088(0x1b4)]===0x0)return'';let _0x44d705=_0x182088(0x1fa)+escapeHtml(_0x3ecd3d)+_0x182088(0x20c);for(const [_0x5d0e40,_0x3b9e5e]of Object[_0x182088(0x1d6)](_0x4e9179)){const _0x434468=_0x409004?_0x409004+'.'+_0x5d0e40:_0x5d0e40,_0x191de8=_0x26e377(_0x5d0e40,_0x434468);if(typeof _0x3b9e5e===_0x182088(0x24d)&&_0x3b9e5e!==null&&!Array['isArray'](_0x3b9e5e))_0x44d705+=_0x2e5e8f(_0x191de8,_0x3b9e5e,_0x434468);else Array[_0x182088(0x213)](_0x3b9e5e)&&_0x3b9e5e[_0x182088(0x1b4)]>0x0&&typeof _0x3b9e5e[0x0]===_0x182088(0x24d)?(_0x44d705+=_0x182088(0x217)+escapeHtml(_0x191de8)+_0x182088(0x1de),_0x3b9e5e[_0x182088(0x1d0)]((_0x22cde0,_0x353db4)=>{const _0x5bf2bc=_0x182088;_0x44d705+='';for(const [_0x3994cb,_0x316598]of Object[_0x5bf2bc(0x1d6)](_0x22cde0)){const _0x51481d=_0x434468+'.'+_0x353db4+'.'+_0x3994cb;_0x44d705+=_0x2fa129(_0x26e377(_0x3994cb,_0x51481d),_0x51481d,_0x316598,![],Array[_0x5bf2bc(0x213)](_0x316598));}_0x44d705+=_0x5bf2bc(0x1ec);}),_0x44d705+=''):_0x44d705+=_0x2fa129(_0x191de8,_0x434468,_0x3b9e5e,![],Array[_0x182088(0x213)](_0x3b9e5e));}return _0x44d705+='',_0x44d705;};let _0x4ab4e8='{const _0x449625=_0xe6020c,_0x12dcc2=_0x197301[_0x449625(0x199)]?_0x449625(0x222):_0x197301[_0x449625(0x246)]?.[_0x449625(0x203)]||_0x449625(0x1e9)+(_0x39fecd+0x1),_0x5947a3=_0x39fecd===0x0?_0x449625(0x1dc):'cwb-cyber-tab';_0x4ab4e8+=''+escapeHtml(_0x12dcc2)+'\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';}),_0x4ab4e8+=_0xe6020c(0x1ec),_0x4ab4e8+=_0xe6020c(0x1fc),_0x42e31d[_0xe6020c(0x1d0)]((_0x41bcc2,_0x256c08)=>{const _0xc7d08=_0xe6020c;_0x4ab4e8+=_0xc7d08(0x1fd)+(_0x256c08===0x0?'active':'')+_0xc7d08(0x1f3)+_0x41bcc2[_0xc7d08(0x20b)]+_0xc7d08(0x227)+_0x41bcc2[_0xc7d08(0x20b)]+'\x22>';if(_0x41bcc2[_0xc7d08(0x199)])_0x4ab4e8+=_0xc7d08(0x1ac)+escapeHtml(_0x41bcc2[_0xc7d08(0x1af)])+_0xc7d08(0x1be);else{const _0x62a01d=_0x41bcc2[_0xc7d08(0x246)];if(_0x62a01d){const _0x25adee=_0x62a01d['name']||_0xc7d08(0x1e7)+(_0x256c08+0x1);if(_0x62a01d['name'])_0x4ab4e8+=_0x2e5e8f('姓名',{'name':_0x62a01d[_0xc7d08(0x203)]},'');if(_0x62a01d[_0xc7d08(0x1a9)])_0x4ab4e8+=_0x2e5e8f(_0xc7d08(0x1ef),_0x62a01d['core_identity'],_0xc7d08(0x1a9));if(_0x62a01d[_0xc7d08(0x25c)])_0x4ab4e8+=_0x2e5e8f(_0xc7d08(0x201),_0x62a01d[_0xc7d08(0x25c)],_0xc7d08(0x25c));if(_0x62a01d[_0xc7d08(0x1f2)])_0x4ab4e8+=_0x2e5e8f('心智侧写',_0x62a01d[_0xc7d08(0x1f2)],'psyche_profile');if(_0x62a01d['social_matrix'])_0x4ab4e8+=_0x2e5e8f(_0xc7d08(0x262),_0x62a01d['social_matrix'],_0xc7d08(0x235));if(_0x62a01d[_0xc7d08(0x202)])_0x4ab4e8+=_0x2e5e8f('叙事精粹',_0x62a01d['narrative_essence'],'narrative_essence');_0x4ab4e8+=_0xc7d08(0x22c)+_0x41bcc2['uid']+_0xc7d08(0x20a)+_0x41bcc2[_0xc7d08(0x20b)]+_0xc7d08(0x25b)+_0x41bcc2[_0xc7d08(0x20b)]+_0xc7d08(0x243)+(_0x41bcc2[_0xc7d08(0x20d)]==='before_char'?_0xc7d08(0x226):'')+'>角色定义之前\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\x20\x20\x20\x20\x20\x20\x20@D\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\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\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\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\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\x20\x20\x20\x20\x20\x20\x20\x20\x20保存对\x20'+escapeHtml(_0x25adee)+_0xc7d08(0x19b);}}_0x4ab4e8+=_0xc7d08(0x1ec);}),_0x4ab4e8+='',_0x4ab4e8;}function bindCharCardViewerPopupEvents(_0x4aa1d0){const _0x44c82c=_0x3a48;_0x4aa1d0['on'](_0x44c82c(0x228),_0x44c82c(0x21b),function(){const _0x1de4c2=_0x44c82c,_0xa47e5a=$(this),_0x1b8b97=_0xa47e5a[_0x1de4c2(0x229)](_0x1de4c2(0x225))[_0x1de4c2(0x1c0)](_0x1de4c2(0x198));_0xa47e5a[_0x1de4c2(0x1fe)]()===_0x1de4c2(0x19c)?_0x1b8b97['show']():_0x1b8b97[_0x1de4c2(0x22a)]();}),_0x4aa1d0['on'](_0x44c82c(0x1ee),_0x44c82c(0x23c),closeCharCardViewerPopup),_0x4aa1d0[_0x44c82c(0x1c0)](_0x44c82c(0x204))['on'](_0x44c82c(0x1ee),()=>{const _0x4b7506=_0x44c82c;showToastr(_0x4b7506(0x1a4),_0x4b7506(0x1a1)),showCharCardViewerPopup();}),_0x4aa1d0['find'](_0x44c82c(0x1eb))['on'](_0x44c82c(0x1ee),async function(){const _0x1a4b0a=_0x44c82c,_0x1c6f63=$(this);_0x1c6f63[_0x1a4b0a(0x1cc)](_0x1a4b0a(0x264),!![])['html'](_0x1a4b0a(0x253)),await manualUpdateLogic(),showToastr(_0x1a4b0a(0x1a4),_0x1a4b0a(0x21d)),showCharCardViewerPopup();}),_0x4aa1d0[_0x44c82c(0x1c0)](_0x44c82c(0x24b))['on'](_0x44c82c(0x1ee),function(){const _0x5f4c6f=_0x44c82c,_0x1bda1d=$(this),_0xcbacb0=_0x1bda1d[_0x5f4c6f(0x1f7)](_0x5f4c6f(0x1c1));_0x4aa1d0['find'](_0x5f4c6f(0x1ea))[_0x5f4c6f(0x1cf)](_0x5f4c6f(0x19d)),_0x1bda1d[_0x5f4c6f(0x229)](_0x5f4c6f(0x1ea))[_0x5f4c6f(0x240)](_0x5f4c6f(0x19d)),_0x4aa1d0[_0x5f4c6f(0x1c0)](_0x5f4c6f(0x23f))[_0x5f4c6f(0x1cf)](_0x5f4c6f(0x19d)),_0x4aa1d0[_0x5f4c6f(0x1c0)](_0x5f4c6f(0x256)+_0xcbacb0)[_0x5f4c6f(0x240)](_0x5f4c6f(0x19d));}),_0x4aa1d0[_0x44c82c(0x1c0)](_0x44c82c(0x1f9))['on'](_0x44c82c(0x1ee),async function(_0x5961b9){const _0x3791f1=_0x44c82c;_0x5961b9[_0x3791f1(0x1e3)]();const _0x26c5d3=$(this)[_0x3791f1(0x1f7)](_0x3791f1(0x1c1));await deleteLorebookEntries([_0x26c5d3]);const _0x26b2ef=$(this)[_0x3791f1(0x229)](_0x3791f1(0x1ea)),_0x58faee=_0x4aa1d0[_0x3791f1(0x1c0)]('#cwb-char-content-'+_0x26c5d3),_0x1e2f36=_0x26b2ef['hasClass'](_0x3791f1(0x19d));_0x26b2ef[_0x3791f1(0x25d)](),_0x58faee[_0x3791f1(0x25d)]();if(_0x1e2f36&&_0x4aa1d0[_0x3791f1(0x1c0)](_0x3791f1(0x1ea))[_0x3791f1(0x1b4)]>0x0)_0x4aa1d0[_0x3791f1(0x1c0)]('.cwb-cyber-tab')[_0x3791f1(0x1e2)]()[_0x3791f1(0x1c0)](_0x3791f1(0x24b))[_0x3791f1(0x211)](_0x3791f1(0x1ee));else _0x4aa1d0[_0x3791f1(0x1c0)]('.cwb-cyber-tab')[_0x3791f1(0x1b4)]===0x0&&showCharCardViewerPopup();}),_0x4aa1d0[_0x44c82c(0x1c0)](_0x44c82c(0x220))['on'](_0x44c82c(0x1ee),async function(){const _0x173980=_0x44c82c,_0x4c3871=_0x4aa1d0[_0x173980(0x1c0)]('.cwb-cyber-tab__button')['map'](function(){const _0x339ec7=_0x173980;return $(this)[_0x339ec7(0x1f7)](_0x339ec7(0x1c1));})['get']();_0x4c3871[_0x173980(0x1b4)]>0x0&&await deleteLorebookEntries(_0x4c3871),showCharCardViewerPopup();}),_0x4aa1d0[_0x44c82c(0x1c0)](_0x44c82c(0x23e))['on']('click',async function(){const _0x6314ad=_0x44c82c,_0x1abda3=$(this),_0x4d8f36=_0x1abda3[_0x6314ad(0x1f7)](_0x6314ad(0x20b));_0x1abda3['prop'](_0x6314ad(0x264),!![])[_0x6314ad(0x1d1)](_0x6314ad(0x1bb));try{const _0x52f79e=await getTargetWorldBook();if(!_0x52f79e)throw new Error(_0x6314ad(0x1f6));const _0x527765=_0x4aa1d0['find'](_0x6314ad(0x256)+_0x4d8f36),_0x52a7b2={},_0x4b626e=(_0x376778,_0x3902fe,_0x3e4f23)=>{const _0x4a61fb=_0x6314ad,_0xb74cc7=_0x3902fe[_0x4a61fb(0x1da)]('.');let _0x4d036d=_0x376778;_0xb74cc7[_0x4a61fb(0x1d0)]((_0x39d8c5,_0x36bf00)=>{const _0xcdb494=_0x4a61fb;if(_0x36bf00===_0xb74cc7[_0xcdb494(0x1b4)]-0x1)_0x4d036d[_0x39d8c5]=_0x3e4f23===''?null:_0x3e4f23;else{const _0x267a6c=/^\d+$/['test'](_0xb74cc7[_0x36bf00+0x1]);!_0x4d036d[_0x39d8c5]&&(_0x4d036d[_0x39d8c5]=_0x267a6c?[]:{}),_0x4d036d=_0x4d036d[_0x39d8c5];}});};_0x527765[_0x6314ad(0x1c0)]('.cwb-cyber-field__input')[_0x6314ad(0x21a)](function(){const _0x5e3f07=_0x6314ad,_0xfef23f=$(this),_0x4430ce=_0xfef23f[_0x5e3f07(0x1f7)](_0x5e3f07(0x252));let _0xf9d476=_0xfef23f[_0x5e3f07(0x1fe)]();_0xfef23f['data']('is-array')&&(_0xf9d476=_0xf9d476[_0x5e3f07(0x1da)]('\x0a')['map'](_0x150188=>_0x150188[_0x5e3f07(0x251)]())[_0x5e3f07(0x194)](Boolean)),_0x4430ce&&_0x4b626e(_0x52a7b2,_0x4430ce,_0xf9d476);});const _0x2ef4dc=buildCustomFormat(_0x52a7b2),_0x3631e1=await TavernHelper[_0x6314ad(0x1f5)](_0x52f79e),_0x5e63e7=_0x3631e1[_0x6314ad(0x1c0)](_0x20e3ff=>_0x20e3ff[_0x6314ad(0x20b)]===_0x4d8f36);if(!_0x5e63e7)throw new Error(_0x6314ad(0x1f4));const _0x492969=_0x527765[_0x6314ad(0x1c0)](_0x6314ad(0x21b))['val'](),_0x8020da=parseInt(_0x527765[_0x6314ad(0x1c0)]('.cwb-insertion-depth')['val'](),0xa),_0x3c31ec=parseInt(_0x527765['find']('.cwb-insertion-order')[_0x6314ad(0x1fe)](),0xa);logDebug(_0x6314ad(0x24e)+_0x4d8f36,{'insertionPosition':_0x492969,'insertionDepth':_0x8020da,'insertionOrder':_0x3c31ec});const _0x41d898={'before_char':_0x6314ad(0x1d4),'after_char':_0x6314ad(0x1d7),'before_an':_0x6314ad(0x1f1),'after_an':_0x6314ad(0x1d8),'at_depth':'at_depth_as_system'},_0x56536c={..._0x5e63e7};_0x56536c[_0x6314ad(0x1af)]=_0x2ef4dc,_0x56536c['uid']=_0x4d8f36;const _0x3ca3b2=_0x41d898[_0x492969];_0x56536c[_0x6314ad(0x1c2)]=_0x3ca3b2||_0x6314ad(0x1d4),_0x492969===_0x6314ad(0x19c)?_0x56536c[_0x6314ad(0x1e6)]=isNaN(_0x8020da)?0x0:_0x8020da:_0x56536c['depth']=null,_0x56536c[_0x6314ad(0x263)]=isNaN(_0x3c31ec)?0x1b59:_0x3c31ec,logDebug(_0x6314ad(0x258)+_0x4d8f36,{'position':_0x56536c['position'],'depth':_0x56536c['depth'],'order':_0x56536c[_0x6314ad(0x263)],'hasDepthField':_0x6314ad(0x1e6)in _0x56536c}),await TavernHelper[_0x6314ad(0x1b1)](_0x52f79e,[_0x56536c]),showToastr('success',_0x6314ad(0x1bc));}catch(_0xe96a9d){logError('保存角色卡失败:',_0xe96a9d),showToastr(_0x6314ad(0x22b),_0x6314ad(0x231)+_0xe96a9d[_0x6314ad(0x1ff)]);}finally{_0x1abda3['prop'](_0x6314ad(0x264),![])[_0x6314ad(0x25a)](_0x6314ad(0x212));}});}function closeCharCardViewerPopup(){const _0x1b4fe1=_0x3a48;$('#'+CHAR_CARD_VIEWER_POPUP_ID)[_0x1b4fe1(0x25d)]();}export async function showCharCardViewerPopup(){const _0x40051f=_0x3a48;if(!isCwbEnabled())return;closeCharCardViewerPopup();try{const _0x1c2440=await getTargetWorldBook();if(!_0x1c2440){showToastr('warning',_0x40051f(0x1cb)),$(_0x40051f(0x210))[_0x40051f(0x1f0)](createCharCardViewerPopupHtml([])),bindCharCardViewerPopupEvents($('#'+CHAR_CARD_VIEWER_POPUP_ID));return;}const _0x2e2ac0=await TavernHelper[_0x40051f(0x1f5)](_0x1c2440);let _0x19005c=state['currentChatFileIdentifier'];if(!_0x19005c||_0x19005c['startsWith'](_0x40051f(0x214))){logError(_0x40051f(0x1d3)+_0x19005c+_0x40051f(0x206)),$(_0x40051f(0x210))[_0x40051f(0x1f0)](createCharCardViewerPopupHtml([])),bindCharCardViewerPopupEvents($('#'+CHAR_CARD_VIEWER_POPUP_ID));return;}const _0x3c004d=_0x19005c['replace'](/ imported/g,'');let _0x2c1dc0=[],_0x56176f;state[_0x40051f(0x215)]===_0x40051f(0x219)&&state['customWorldBook']?_0x56176f=_0x2e2ac0[_0x40051f(0x194)](_0x3ec2a3=>{const _0x561690=_0x40051f;if(!_0x3ec2a3[_0x561690(0x244)]||!Array[_0x561690(0x213)](_0x3ec2a3['keys']))return![];if(_0x3ec2a3[_0x561690(0x25e)][_0x561690(0x245)]('Amily2角色总集')||_0x3ec2a3['keys'][_0x561690(0x245)]('角色总览'))return!![];if(_0x3ec2a3[_0x561690(0x1af)])try{const _0x2e1db8=parseCustomFormat(_0x3ec2a3[_0x561690(0x1af)]);return _0x2e1db8&&Object[_0x561690(0x25e)](_0x2e1db8)[_0x561690(0x1b4)]>0x0;}catch(_0x218554){return![];}return![];}):_0x56176f=_0x2e2ac0[_0x40051f(0x194)](_0xa0a59=>_0xa0a59['enabled']&&Array[_0x40051f(0x213)](_0xa0a59['keys'])&&_0xa0a59['keys'][_0x40051f(0x245)](_0x3c004d));const _0x431896=_0x56176f['filter'](_0x19b702=>_0x19b702['keys']['includes'](_0x40051f(0x221))&&_0x19b702[_0x40051f(0x25e)][_0x40051f(0x245)](_0x40051f(0x1ab)));_0x431896[_0x40051f(0x1d0)]((_0x17b77b,_0x23e01e)=>{const _0x4ff14c=_0x40051f;_0x2c1dc0[_0x4ff14c(0x1a8)]({'uid':_0x17b77b[_0x4ff14c(0x20b)],'isRoster':!![],'comment':_0x17b77b[_0x4ff14c(0x19e)],'content':_0x17b77b[_0x4ff14c(0x1af)],'rosterIndex':_0x23e01e});});const _0x4365be=_0x56176f[_0x40051f(0x194)](_0x1168df=>!_0x1168df[_0x40051f(0x25e)]['includes']('Amily2角色总集'))[_0x40051f(0x223)](_0x5b8707=>{const _0x2ea4a4=_0x40051f;logDebug(_0x2ea4a4(0x249)+_0x5b8707['uid'],{'position':_0x5b8707['position'],'depth':_0x5b8707['depth'],'order':_0x5b8707['order'],'comment':_0x5b8707['comment']});const _0x3793f7={0x0:'before_char',0x1:'after_char',0x2:_0x2ea4a4(0x1a5),0x3:'after_an',0x4:_0x2ea4a4(0x19c),'before_character_definition':_0x2ea4a4(0x1ed),'after_character_definition':'after_char','before_author_note':_0x2ea4a4(0x1a5),'after_author_note':_0x2ea4a4(0x218),'at_depth_as_system':_0x2ea4a4(0x19c)},_0x3d7cc0=_0x5b8707[_0x2ea4a4(0x1c2)],_0x2a7752=_0x3793f7[_0x3d7cc0]||_0x2ea4a4(0x19c),_0xeab6af=_0x3d7cc0===0x4||_0x3d7cc0==='at_depth_as_system'?_0x5b8707['depth']??0x0:0x0;return logDebug(_0x2ea4a4(0x1c6)+_0x5b8707[_0x2ea4a4(0x20b)],{'originalPosition':_0x3d7cc0,'mappedPosition':_0x2a7752,'finalDepth':_0xeab6af}),{'uid':_0x5b8707[_0x2ea4a4(0x20b)],'isRoster':![],'comment':_0x5b8707[_0x2ea4a4(0x19e)],'content':_0x5b8707['content'],'parsed':parseCustomFormat(_0x5b8707[_0x2ea4a4(0x1af)]),'insertionPosition':_0x2a7752,'insertionDepth':_0xeab6af,'insertionOrder':_0x5b8707[_0x2ea4a4(0x263)]??0x1b59};})[_0x40051f(0x194)](_0x31b089=>_0x31b089[_0x40051f(0x246)]&&Object[_0x40051f(0x25e)](_0x31b089['parsed'])[_0x40051f(0x1b4)]>0x0);_0x2c1dc0=_0x2c1dc0[_0x40051f(0x1ad)](_0x4365be);const _0x50b244=createCharCardViewerPopupHtml(_0x2c1dc0);$('body')[_0x40051f(0x1f0)](_0x50b244);const _0x1063b7=$('#'+CHAR_CARD_VIEWER_POPUP_ID);bindCharCardViewerPopupEvents(_0x1063b7);}catch(_0x595c02){logError(_0x40051f(0x205),_0x595c02),showToastr(_0x40051f(0x22b),_0x40051f(0x216));}}function toggleCharCardViewerPopup(){$('#'+CHAR_CARD_VIEWER_POPUP_ID)['length']>0x0?closeCharCardViewerPopup():showCharCardViewerPopup();}function keepButtonInBounds(_0x2d5640,_0x43eb86=![]){const _0x132097=_0x3a48;if(!_0x2d5640||!_0x2d5640[_0x132097(0x1b4)])return;const _0x4a7a60=$(window)['width'](),_0x52389f=$(window)[_0x132097(0x232)](),_0x34faec=_0x2d5640['outerWidth'](),_0x35a3c4=_0x2d5640[_0x132097(0x242)]();let _0x4167b1=_0x2d5640[_0x132097(0x19a)](),_0xde7025=Math[_0x132097(0x192)](0x0,Math[_0x132097(0x197)](_0x4167b1[_0x132097(0x233)],_0x52389f-_0x35a3c4)),_0x4f4cbb=Math[_0x132097(0x192)](0x0,Math['min'](_0x4167b1[_0x132097(0x236)],_0x4a7a60-_0x34faec));_0x2d5640['css']({'top':_0xde7025+'px','left':_0x4f4cbb+'px'}),_0x43eb86&&localStorage[_0x132097(0x20f)](state[_0x132097(0x1b6)],JSON[_0x132097(0x1a7)]({'top':_0x2d5640[_0x132097(0x21e)](_0x132097(0x233)),'left':_0x2d5640[_0x132097(0x21e)](_0x132097(0x236))}));}function _0x3a48(_0x3920df,_0x54b60f){const _0x4ef58f=_0x4ef5();return _0x3a48=function(_0x3a482a,_0x594288){_0x3a482a=_0x3a482a-0x190;let _0x134abc=_0x4ef58f[_0x3a482a];return _0x134abc;},_0x3a48(_0x3920df,_0x54b60f);}function makeButtonDraggable(_0x514358){const _0x1a6287=_0x3a48;let _0x306c46=![],_0x1d94a9=![],_0x1c7f42={'x':0x0,'y':0x0},_0x57ae2b={'x':0x0,'y':0x0};const _0x1792a4=0x5,_0x4fefa7=_0x2cc2b0=>_0x2cc2b0[_0x1a6287(0x250)]&&_0x2cc2b0[_0x1a6287(0x250)][_0x1a6287(0x1b4)]?_0x2cc2b0[_0x1a6287(0x250)][0x0]:_0x2cc2b0,_0x1b214f=function(_0x350a89){const _0x3d2fb7=_0x1a6287;if(_0x350a89[_0x3d2fb7(0x257)]===_0x3d2fb7(0x1df))_0x350a89[_0x3d2fb7(0x207)]();_0x306c46=!![],_0x1d94a9=![];const _0x3d809a=_0x4fefa7(_0x350a89);_0x57ae2b['x']=_0x3d809a[_0x3d2fb7(0x1a3)],_0x57ae2b['y']=_0x3d809a['clientY'],_0x1c7f42['x']=_0x3d809a[_0x3d2fb7(0x1a3)]-_0x514358['offset']()[_0x3d2fb7(0x236)],_0x1c7f42['y']=_0x3d809a[_0x3d2fb7(0x1b2)]-_0x514358[_0x3d2fb7(0x19a)]()[_0x3d2fb7(0x233)],_0x514358['css'](_0x3d2fb7(0x208),_0x3d2fb7(0x1b3)),$('body')[_0x3d2fb7(0x21e)]({'user-select':'none','-webkit-user-select':_0x3d2fb7(0x1cd)});},_0x3b167a=function(_0x2a225f){const _0x19d85b=_0x1a6287;if(!_0x306c46)return;const _0x2c44cc=_0x4fefa7(_0x2a225f),_0x2b6502=_0x2c44cc[_0x19d85b(0x1a3)]-_0x57ae2b['x'],_0x5bf0f7=_0x2c44cc[_0x19d85b(0x1b2)]-_0x57ae2b['y'];!_0x1d94a9&&Math[_0x19d85b(0x247)](_0x2b6502*_0x2b6502+_0x5bf0f7*_0x5bf0f7)>_0x1792a4&&(_0x1d94a9=!![]);if(_0x1d94a9){if(_0x2a225f[_0x19d85b(0x257)]===_0x19d85b(0x1ae))_0x2a225f[_0x19d85b(0x207)]();let _0x305bd0=_0x2c44cc['clientX']-_0x1c7f42['x'],_0x345b99=_0x2c44cc[_0x19d85b(0x1b2)]-_0x1c7f42['y'];_0x305bd0=Math[_0x19d85b(0x192)](0x0,Math[_0x19d85b(0x197)](_0x305bd0,window[_0x19d85b(0x1c8)]-_0x514358[_0x19d85b(0x1f8)]())),_0x345b99=Math['max'](0x0,Math[_0x19d85b(0x197)](_0x345b99,window['innerHeight']-_0x514358['outerHeight']())),_0x514358[_0x19d85b(0x21e)]({'top':_0x345b99+'px','left':_0x305bd0+'px','right':'','bottom':''});}},_0xdc5519=function(_0x2382e0){const _0x2a3448=_0x1a6287;if(!_0x306c46)return;_0x306c46=![],_0x514358[_0x2a3448(0x21e)](_0x2a3448(0x208),_0x2a3448(0x1bf)),$(_0x2a3448(0x210))[_0x2a3448(0x21e)]({'user-select':_0x2a3448(0x1ce),'-webkit-user-select':_0x2a3448(0x1ce)});if(_0x1d94a9)keepButtonInBounds(_0x514358,!![]);else _0x2382e0[_0x2a3448(0x257)]==='touchend'&&(_0x2382e0[_0x2a3448(0x207)](),toggleCharCardViewerPopup());};_0x514358['on']('mousedown',_0x1b214f),$(document)['on'](_0x1a6287(0x1d5),_0x3b167a)['on']('mouseup.cwbViewer',_0xdc5519),_0x514358['on']('touchstart',_0x1b214f),$(document)['on'](_0x1a6287(0x1b8),_0x3b167a)['on'](_0x1a6287(0x1a2),_0xdc5519),_0x514358['on'](_0x1a6287(0x1ee),function(_0x536258){const _0x49d8ea=_0x1a6287;if(_0x1d94a9){_0x536258[_0x49d8ea(0x207)](),_0x536258[_0x49d8ea(0x1e3)]();return;}toggleCharCardViewerPopup();});}export function initializeCharCardViewer(){const _0xe6cc31=_0x3a48;if($('#'+CHAR_CARD_VIEWER_BUTTON_ID)[_0xe6cc31(0x1b4)]>0x0)return;const _0xf74c42='keepButtonInBounds($('#'+CHAR_CARD_VIEWER_BUTTON_ID),!![]),0x96);});}export function updateViewerButtonVisibility(){const _0x38c8d0=_0x3a48,_0x4172c3=$('#'+CHAR_CARD_VIEWER_BUTTON_ID);if(_0x4172c3[_0x38c8d0(0x1b4)]===0x0)return;const _0x466750=isCwbEnabled()&&state['viewerEnabled'];_0x4172c3[_0x38c8d0(0x1e1)](_0x466750),logDebug(_0x38c8d0(0x209),{'masterEnabled':isCwbEnabled(),'viewerEnabled':state[_0x38c8d0(0x193)],'shouldShow':_0x466750});}