mirror of
https://github.com/Wx-2025/ST-Amily2-Chat-Optimisation.git
synced 2026-06-06 23:15:50 +00:00
2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
const _0x1b3295=_0x4bfe;(function(_0x2448d6,_0x1295af){const _0x214212=_0x4bfe,_0x117787=_0x2448d6();while(!![]){try{const _0x3cf30b=parseInt(_0x214212(0x8b))/0x1+-parseInt(_0x214212(0x91))/0x2+-parseInt(_0x214212(0xd4))/0x3*(-parseInt(_0x214212(0x94))/0x4)+-parseInt(_0x214212(0xcd))/0x5*(-parseInt(_0x214212(0xd3))/0x6)+-parseInt(_0x214212(0xc9))/0x7*(-parseInt(_0x214212(0xbe))/0x8)+-parseInt(_0x214212(0xa4))/0x9*(-parseInt(_0x214212(0x8a))/0xa)+-parseInt(_0x214212(0xc1))/0xb*(parseInt(_0x214212(0xc4))/0xc);if(_0x3cf30b===_0x1295af)break;else _0x117787['push'](_0x117787['shift']());}catch(_0x4cde97){_0x117787['push'](_0x117787['shift']());}}}(_0x33cf,0x6b89c));function _0x33cf(){const _0x4dc4af=['7lCPfUz','#amily2_drawer_icon','[Amily-重构]\x20宫殿模块已按蓝图竣工。','append','5PyYQvg','<p\x20style=\x22color:red;\x20padding:10px;\x20border:1px\x20solid\x20red;\x20border-radius:5px;\x22>紧急报告:在扩展区域建造Amily2号府邸时发生意外。</p>','closest','toggleClass','get','#extensions_settings2','2666856FMmYWl','2334117yYXOsa','#amily2_main_drawer','/assets/hanlinyuan.html','.drawer-content','[Amily2号]\x20从缓存加载模型列表\x20(','2609510mZswep','128384PSZTqI','#expiry_info','\x0a\x20\x20\x20\x20\x20\x20<div\x20id=\x22amily2_extension_frame\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22inline-drawer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22inline-drawer-toggle\x20inline-drawer-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<b><i\x20class=\x22fas\x20fa-crown\x22\x20style=\x22color:\x20#ffc107;\x22></i>\x20Amily2号\x20优化中枢</b>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22inline-drawer-icon\x20fa-solid\x20fa-circle-chevron-down\x20down\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22inline-drawer-content\x22\x20style=\x22display:\x20none;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20','classList','#amily2_drawer_content','extensions','791314sntMCy','/assets/amily2-modal.html','true','4wQbnKZ',':visible','[Amily2-兼容性]\x20检测到旧版环境\x20(无法导入\x20doNavbarIconClick),已绑定后备点击事件。','doNavbarIconClick\x20is\x20not\x20a\x20function','[Amily2-兼容性]\x20检测到新版环境,已绑定官方点击事件。','html','addClass','log','[Amily2号]\x20检测到有效授权,将执行自动UI更新。','hasClass','each','click','#sys-settings-button','<div\x20id=\x22amily2_hanlinyuan_panel\x22\x20style=\x22display:\x20none;\x22>','\x0a\x20\x20\x20\x20\x20\x20<div\x20id=\x22amily2_main_drawer\x22\x20class=\x22drawer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22drawer-toggle\x22\x20data-drawer=\x22amily2_drawer_content\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22amily2_drawer_icon\x22\x20class=\x22drawer-icon\x20fa-solid\x20fa-magic\x20fa-fw\x20closedIcon\x20interactable\x22\x20title=\x22Amily2号优化助手\x22\x20tabindex=\x220\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22amily2_drawer_content\x22\x20class=\x22drawer-content\x20closedDrawer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20','not','9GDCnCx','.drawerPinnedOpen','cached_models_amily2','.openDrawer',',\x20自动登录标志:\x20','scripts/extensions/third-party/','<p\x20style=\x22color:red;\x20padding:\x2020px;\x22>紧急报告:无法加载Amily2号府邸内饰。</p>','authorized','.openIcon','function','openIcon','openDrawer\x20closedDrawer','.inline-drawer-content','data','/script.js','closedIcon\x20openIcon','resizing','find','remove','/assets/Amily2-AdditionalFeatures.html','setItem','after','closedIcon','#extensions_settings2\x20#amily2_chat_optimiser','getItem','#amily2_main_drawer\x20.drawer-toggle','6058312MSBEyd','error','closedDrawer\x20openDrawer','198RKykZu','[Amily-建设部]\x20紧急报告:加载模块化蓝图时发生意外:','info','1022004HvxVZE','removeClass','initialized','parse','length'];_0x33cf=function(){return _0x4dc4af;};return _0x33cf();}import{getSlideToggleOptions}from'/script.js';import{slideToggle}from'/lib.js';function _0x4bfe(_0x5bf111,_0x207b50){const _0x33cfc7=_0x33cf();return _0x4bfe=function(_0x4bfe62,_0x53ca73){_0x4bfe62=_0x4bfe62-0x86;let _0x52f9c2=_0x33cfc7[_0x4bfe62];return _0x52f9c2;},_0x4bfe(_0x5bf111,_0x207b50);}import{extension_settings,renderExtensionTemplateAsync}from'/scripts/extensions.js';import{extensionName,defaultSettings}from'../utils/settings.js';import{checkAuthorization,displayExpiryInfo,pluginAuthStatus}from'../utils/auth.js';import{updateUI,setAvailableModels,populateModelDropdown,applyUpdateIndicator}from'./state.js';import{bindModalEvents}from'./bindings.js';import{fetchSupportedModels}from'../core/api.js';import{bindHistoriographyEvents}from'./historiography-bindings.js';import{bindHanlinyuanEvents}from'./hanlinyuan-bindings.js';import{showContentModal}from'./page-window.js';const extensionFolderPath=_0x1b3295(0xa9)+extensionName;async function loadSettings(){const _0x4fd061=_0x1b3295;extension_settings[extensionName]={...defaultSettings,...extension_settings[extensionName]||{}},checkAuthorization();const _0x13b98d=localStorage[_0x4fd061(0xbc)]('plugin_auto_login')===_0x4fd061(0x93);console[_0x4fd061(0x9b)]('[Amily2-调试]\x20授权状态:\x20'+pluginAuthStatus[_0x4fd061(0xab)]+_0x4fd061(0xa8)+_0x13b98d);_0x13b98d&&pluginAuthStatus[_0x4fd061(0xab)]&&console[_0x4fd061(0x9b)](_0x4fd061(0x9c));$(_0x4fd061(0x8c))[_0x4fd061(0x99)](displayExpiryInfo()),updateUI();if(pluginAuthStatus['authorized']&&extension_settings[extensionName]['apiUrl']){const _0x134001=localStorage['getItem'](_0x4fd061(0xa6));if(_0x134001){const _0x20f9ed=JSON[_0x4fd061(0xc7)](_0x134001);console['log'](_0x4fd061(0x89)+_0x20f9ed['length']+'个)'),setAvailableModels(_0x20f9ed),populateModelDropdown();}else toastr[_0x4fd061(0xc3)]('正在自动加载模型列表...','Amily2号'),setTimeout(async()=>{const _0x297d8a=_0x4fd061,_0x55c777=await fetchSupportedModels();_0x55c777[_0x297d8a(0xc8)]>0x0&&(setAvailableModels(_0x55c777),localStorage[_0x297d8a(0xb8)](_0x297d8a(0xa6),JSON['stringify'](_0x55c777)),populateModelDropdown());},0x1f4);}}async function initializePanel(_0x161695,_0x4eba2c){const _0x465614=_0x1b3295;if(_0x161695[_0x465614(0xb1)](_0x465614(0xc6)))return;try{const _0x2b94fd=await $[_0x465614(0xd1)](extensionFolderPath+_0x465614(0x92));_0x161695['html'](_0x2b94fd);const _0x42f162=_0x161695[_0x465614(0xb5)]('#amily2_chat_optimiser');if(_0x42f162[_0x465614(0xc8)]){const _0x1dd14c=await $[_0x465614(0xd1)](extensionFolderPath+_0x465614(0xb7)),_0x337ecb='<div\x20id=\x22amily2_additional_features_panel\x22\x20style=\x22display:\x20none;\x22>'+_0x1dd14c+'</div>';_0x42f162['append'](_0x337ecb);const _0x2cf0a3=await $['get'](extensionFolderPath+_0x465614(0x87)),_0x48c14e=_0x465614(0xa1)+_0x2cf0a3+'</div>';_0x42f162[_0x465614(0xcc)](_0x48c14e);}await loadSettings(),bindModalEvents(),bindHistoriographyEvents(),bindHanlinyuanEvents(),_0x161695['data'](_0x465614(0xc6),!![]),console[_0x465614(0x9b)](_0x465614(0xcb)),applyUpdateIndicator();}catch(_0x1d2f80){console[_0x465614(0xbf)](_0x465614(0xc2),_0x1d2f80);const _0x40acef=_0x4eba2c?_0x465614(0xce):_0x465614(0xaa);_0x4eba2c?_0x4eba2c['append'](_0x40acef):_0x161695[_0x465614(0x99)](_0x40acef);}}function toggleDrawerFallback(){const _0x12640c=_0x1b3295,_0x2d545b=$(_0x12640c(0xca)),_0xa5989d=$('#amily2_drawer_content');_0x2d545b[_0x12640c(0x9d)](_0x12640c(0xae))&&!_0xa5989d['is'](_0x12640c(0x95))&&_0x2d545b[_0x12640c(0xc5)](_0x12640c(0xae))[_0x12640c(0x9a)](_0x12640c(0xba)),_0x2d545b[_0x12640c(0x9d)](_0x12640c(0xba))?($(_0x12640c(0xa7))['not'](_0xa5989d)[_0x12640c(0xa3)]('.pinnedOpen')[_0x12640c(0x9a)](_0x12640c(0xb4))[_0x12640c(0x9e)]((_0x2056ba,_0x56d3a4)=>{slideToggle(_0x56d3a4,{...getSlideToggleOptions(),'onAnimationEnd':function(_0x54e0d2){const _0xe293e9=_0x4bfe;_0x54e0d2[_0xe293e9(0xcf)](_0xe293e9(0x88))['classList']['remove'](_0xe293e9(0xb4));}});}),$(_0x12640c(0xac))['not'](_0x2d545b)[_0x12640c(0xa3)](_0x12640c(0xa5))[_0x12640c(0xd0)](_0x12640c(0xb3)),$('.openDrawer')['not'](_0xa5989d)[_0x12640c(0xa3)]('.pinnedOpen')[_0x12640c(0xd0)](_0x12640c(0xc0)),_0x2d545b[_0x12640c(0xd0)]('closedIcon\x20openIcon'),_0xa5989d[_0x12640c(0xd0)](_0x12640c(0xc0)),_0xa5989d[_0x12640c(0x9a)](_0x12640c(0xb4))[_0x12640c(0x9e)]((_0x2d1a36,_0x41fe12)=>{slideToggle(_0x41fe12,{...getSlideToggleOptions(),'onAnimationEnd':function(_0xc8d8fc){const _0x4c60df=_0x4bfe;_0xc8d8fc[_0x4c60df(0xcf)]('.drawer-content')['classList'][_0x4c60df(0xb6)](_0x4c60df(0xb4));}});})):(_0x2d545b[_0x12640c(0xd0)]('openIcon\x20closedIcon'),_0xa5989d[_0x12640c(0xd0)](_0x12640c(0xaf)),_0xa5989d['addClass'](_0x12640c(0xb4))[_0x12640c(0x9e)]((_0x3ca802,_0x199325)=>{slideToggle(_0x199325,{...getSlideToggleOptions(),'onAnimationEnd':function(_0x461ccb){const _0x528092=_0x4bfe;_0x461ccb[_0x528092(0xcf)](_0x528092(0x88))[_0x528092(0x8e)]['remove'](_0x528092(0xb4));}});}));}export async function createDrawer(){const _0x5df3b3=_0x1b3295,_0x26f600=extension_settings[extensionName],_0x105213=_0x26f600['iconLocation']||'topbar';if(_0x105213==='topbar'){if($(_0x5df3b3(0x86))[_0x5df3b3(0xc8)]>0x0)return;const _0x58eebd=_0x5df3b3(0xa2);$(_0x5df3b3(0xa0))[_0x5df3b3(0xb9)](_0x58eebd);const _0x299b0f=$(_0x5df3b3(0x8f));await initializePanel(_0x299b0f);try{const {doNavbarIconClick:_0x43a000}=await import(_0x5df3b3(0xb2));if(typeof _0x43a000===_0x5df3b3(0xad))$(_0x5df3b3(0xbd))['on'](_0x5df3b3(0x9f),_0x43a000),console[_0x5df3b3(0x9b)](_0x5df3b3(0x98));else throw new Error(_0x5df3b3(0x97));}catch(_0x364532){$(_0x5df3b3(0xbd))['on']('click',toggleDrawerFallback),console[_0x5df3b3(0x9b)](_0x5df3b3(0x96));}}else{if(_0x105213===_0x5df3b3(0x90)){if($(_0x5df3b3(0xbb))[_0x5df3b3(0xc8)]>0x0)return;const _0x4ed712=_0x5df3b3(0x8d),_0x17a578=$(_0x4ed712);$(_0x5df3b3(0xd2))['append'](_0x17a578);const _0x5c041e=_0x17a578[_0x5df3b3(0xb5)](_0x5df3b3(0xb0));initializePanel(_0x5c041e,_0x17a578);}}}
|