// ==UserScript== // @name 火箭按钮 // @match *://* // @include * // @grant GM_getValue // @grant GM_setValue // @grant GM_xmlhttpRequest // @grant GM_addValueChangeListener // @grant GM_removeValueChangeListener // @grant unsafeWindow // @run-at document-end // @license All Rights Reserved // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAACxUlEQVR4nO3dMW8SYRzH8duKg5Nuhdo3UNib+hoUlqeNielm1LVLt7obEyOkATqQmG6Y6FSXGh3VOBjQNlUDDQ+yOPEGzjwrPFdLwD6/g+8n+U+Xu3ue+6YJhaZEEQDgf7tX+5o1tVbXN+5Y6PUtHLN/srpZb8e+ccdCr2/hGIJoMQTRYgiixRAkjK1qe8PUWo2xqbebiUHq7abvHHet0PtJPVNrbyc9+EnHXSv0flLPEESLIYgWQxAthiBaDEG0GIJoMQTRYgiixRBEiyFIGFvV05vuTcGxOWjtzCzIQWvHdw9379D7l+Pe/Nuc0YOf/Cen1Qi9fzkEEUMQMQQRQxAxBEl5kAcvv8ftHz3vuGMEueIgjw9P4t/9vnceHRJkagQRQxAxBBFDkJQE2X11Gr/+2Bmboy/dxCDumO+c3eYpQaYN8uzoLPHBTzruWgS5JIKIIYgYgoghSIpeZb351Bmbt/94leU7x12LIJfE7yFiCCKGIGIIIoYgc/CJ4befPe/wieEM8Jm6GIKIIYgYgoghiBiCBLJUrHzIFMu/Ruf2k3fDUEHcvX1rcmuN5l2mVO5kSpV4dNb3joPEcOPu7VuTW2s07wgihiBiCCKGIAFcv/viRqZYrnqnVB6mKMgwaR9uj1FaLN3ZX/VvMHk0g1QSx+0xSguCiCGIGIKIIYgYgoghiBiCiCGIGIKIIYiYa8XnWd8ncBfN+t7xmam1zke/T+p++fOfh0/fx7MYdy3Pd1adu3tPul63x2gR2Vxh264U4plMrsD/XJyWJYgWSxAtliBaLEG0WIJosQTRYgmixRJEiyWIFksQLZYgWixBtFiCaLEE0WIJosUSRIsliJZ+Lr/RW8k3RsfmCs0LHnzTd467Vuj9zK3BrcJqUhB3LPT6Fs6AIFoGBNEyIIiWAUG09JbXsr1cvuud5bXF/CM2AIiu1F+d56Qeo24SAwAAAABJRU5ErkJggg== // @version 0.8.0 // @description // @author flowsaro.com // @namespace https://docs.scriptcat.org/ // @noframes // @require https://unpkg.com/vue@3/dist/vue.global.prod.js // @require data:application/javascript,unsafeWindow.Vue%3DVue%3B // ==/UserScript== /* ==UserConfig== general: githubAccel: title: 开启 GitHub 加速链接功能 description: 关闭后,GitHub 页面将不显示镜像加速下载按钮 type: checkbox default: true backTop: title: 开启返回顶部按钮 description: 关闭后,所有页面(包括 GitHub)都不显示返回顶部按钮 type: checkbox default: true alwaysShow: title: 总是显示返回顶部按钮 description: 开启后按钮不随滚动自动隐藏,始终显示在页面上 type: checkbox default: false noBtnBg: title: 不显示按钮背景 description: 开启后按钮背景/边框/阴影透明,仅保留图标与点击区域 type: checkbox default: false iconScale: title: 图标大小倍率(1x = 26px,最大 2x) description: 允许小数(截断 1 位),范围 0.6 ~ 2;面板内可用 2x / 重置快捷按钮 type: number default: 1 customIcon: title: 自定义按钮图标(base64) description: 填写 data:image/...;base64,... 或纯 base64 字符串,留空使用脚本默认图标 type: textarea default: '' disabledSites: title: 不显示返回顶部按钮的站点 description: 每行填写一个域名,例如 baidu.com type: textarea default: '' ==/UserConfig== */ unsafeWindow.Vue = Vue; (()=>{"use strict";const e=Vue,t=(0,e.defineComponent)({inheritAttrs:!1,__name:"Button",props:{size:{default:46},dragging:{type:Boolean,default:!1},transparent:{type:Boolean,default:!1},variant:{default:"glass"},round:{type:Boolean,default:!1}},setup(t){const n=t,r=(0,e.useAttrs)(),o=(0,e.ref)(!1),a=(0,e.computed)(()=>{const{style:e,...t}=r;return t}),i=(0,e.computed)(()=>{const e=r.style;return e?{...e}:void 0}),s=(0,e.computed)(()=>({width:n.size+"px",height:n.size+"px",borderRadius:n.round?"50%":Math.round(.3*n.size)+"px"}));return(t,r)=>((0,e.openBlock)(),(0,e.createElementBlock)("button",(0,e.mergeProps)(a.value,{class:["flex items-center justify-center p-0 box-border select-none cursor-grab touch-none",n.transparent?"bg-transparent border border-transparent shadow-none":"border border-border bg-btn shadow-btn hover:bg-btn-hover hover:shadow-btn-hover"],style:[s.value,i.value],onMouseenter:r[0]||(r[0]=e=>o.value=!0),onMouseleave:r[1]||(r[1]=e=>o.value=!1)}),[(0,e.renderSlot)(t.$slots,"default")],16))}}),n=(0,e.defineComponent)({inheritAttrs:!1,__name:"Panel",props:{radius:{default:14},padding:{default:"14px 16px"},variant:{default:"glass"}},setup(t){const n=t,r=(0,e.useAttrs)(),o=(0,e.computed)(()=>{const{style:e,...t}=r;return t}),a=(0,e.computed)(()=>{const e=r.style;return e?{...e}:void 0}),i=(0,e.computed)(()=>({borderRadius:n.radius+"px",padding:n.padding}));return(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)("div",(0,e.mergeProps)(o.value,{class:"box-border bg-panel border border-border rounded-xl shadow-panel text-primary backdrop-blur-[10px] backdrop-saturate-150",style:[i.value,a.value]}),[(0,e.renderSlot)(t.$slots,"default")],16))}}),r={class:"flex items-center gap-1 p-1 mb-3 rounded-xl bg-subtle-btn"},o=["onClick"],a={class:"text-xs"},i=(0,e.defineComponent)({__name:"Tabs",props:{items:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const i=t,s=n,l=(0,e.ref)(""),c=(0,e.computed)(()=>i.modelValue||l.value||i.items[0]?.key||"");return(n,d)=>((0,e.openBlock)(),(0,e.createElementBlock)("div",null,[(0,e.createElementVNode)("div",r,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.items,t=>((0,e.openBlock)(),(0,e.createElementBlock)("button",{key:t.key,type:"button",class:(0,e.normalizeClass)(["flex-1 px-3 py-1.5 text-xs rounded-lg cursor-pointer whitespace-nowrap transition-colors",t.key===c.value?"bg-panel text-primary shadow-sm border border-border font-medium":"text-secondary hover:bg-white/10 hover:text-primary border border-transparent"]),onClick:e=>{return n=t.key,void(void 0!==i.modelValue?s("update:modelValue",n):l.value=n);var n}},(0,e.toDisplayString)(t.label),11,o))),128))]),(0,e.createElementVNode)("div",a,[(0,e.renderSlot)(n.$slots,c.value)])]))}}),s=(0,e.defineComponent)({__name:"CopyButton",props:{label:{default:"复制"}},emits:["copy"],setup(t,{emit:n}){const r=n,o=(0,e.ref)(!1);let a=null;function i(){r("copy"),o.value=!0,a&&clearTimeout(a),a=setTimeout(()=>{o.value=!1},1500)}return(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)("button",{type:"button",class:(0,e.normalizeClass)(["shrink-0 text-xs px-2.5 py-0.5 rounded-md cursor-pointer transition-colors duration-200",o.value?"bg-save-btn text-white border border-save-border":"bg-subtle-btn text-primary border border-border"]),onClick:i},(0,e.toDisplayString)(o.value?"✓ 已复制":t.label),3))}}),l={class:"flex items-center gap-1.5 mb-1"},c=["src"],d={class:"flex items-center gap-1 ml-auto shrink-0"},u=["title","onClick"],p={class:"flex-1 min-w-0 text-sm leading-[1.5] break-words whitespace-pre-wrap"},m=(0,e.defineComponent)({__name:"ToastHost",props:{toasts:{}},emits:["close","copy","clear-all"],setup(t,{emit:n}){const r=t,o=n,a=(0,e.computed)(()=>r.toasts.slice(0,3)),i=(0,e.ref)(new Set);(0,e.watch)(a,(e,t)=>{const n=new Set(t.map(e=>e.id)),r=new Set(m),o=e.filter(e=>r.has(e.id)&&!n.has(e.id));o.length&&(i.value=new Set([...i.value,...o.map(e=>e.id)]),setTimeout(()=>{i.value=new Set([...i.value].filter(e=>!o.some(t=>t.id===e)))},400))});let m=[];(0,e.watch)(()=>r.toasts,e=>{m=e.map(e=>e.id)},{immediate:!0});let h=0;const g=(0,e.ref)(0);function b(e){return a.value[0]?.id===e.id&&Date.now(){if(e.length&&e[0].id!==t[0]?.id){const e=Date.now();g.value=e-h>=1e3?e+800:0,h=e}});const v={info:"var(--color-accent)",success:"var(--color-success)",warning:"var(--color-warning)",error:"var(--color-danger)"};function x(e){return{info:"提示",success:"成功",warning:"警告",error:"错误"}[e]||"提示"}const y=(0,e.computed)(()=>({position:"relative",width:"300px",height:k.value+"px",transition:"height .2s ease"})),w=(0,e.ref)(null),k=(0,e.ref)(0);function E(){const e=w.value?.offsetHeight||0;k.value=e+5*Math.max(0,a.value.length-1)}function C(e,t){const n=0===t;return{position:n?"relative":"absolute",left:n?"auto":"0",right:n?"auto":"0",top:n?"auto":"0",marginTop:n?"0":5*t+"px",zIndex:a.value.length-t}}const V={scrollbarWidth:"thin",scrollbarColor:"rgba(255,255,255,0.2) transparent"},S=(0,e.ref)();(0,e.onMounted)(()=>{const e=S.value?.$el?.getRootNode();if(!e||e===document)return;const t=document.createElement("style");t.textContent="@keyframes sc-toast-in{0%{opacity:0;transform:translateX(52px) scale(0.9)}60%{opacity:1;transform:translateX(-6px) scale(1.02)}100%{opacity:1;transform:translateX(0) scale(1)}}@keyframes sc-toast-out{from{opacity:1}to{opacity:0;transform:translateX(-14px)}}.toast-enter-active{animation:sc-toast-in .32s cubic-bezier(0.22,1,0.36,1)}.toast-leave-active{animation:sc-toast-out .22s ease;position:absolute!important}.no-enter.toast-enter-active{animation:none!important}.toast-body::-webkit-scrollbar{width:6px}.toast-body::-webkit-scrollbar-track{background:transparent}.toast-body::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.15);border-radius:3px}",e.appendChild(t),E();const n=new ResizeObserver(()=>E());w.value&&n.observe(w.value)});let N=null;return(0,e.watch)(()=>r.toasts,(e,t)=>{N&&clearTimeout(N),e.length((0,e.openBlock)(),(0,e.createBlock)(e.TransitionGroup,{ref_key:"hostRef",ref:S,tag:"div",class:"toast-host relative w-[300px]",name:"toast",style:(0,e.normalizeStyle)(y.value)},{default:(0,e.withCtx)(()=>[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(a.value,(r,m)=>{return(0,e.openBlock)(),(0,e.createElementBlock)("div",{key:r.id,ref_for:!0,ref:e=>function(e,t){0===t&&(w.value=e||null)}(e,m),class:(0,e.normalizeClass)(["w-[300px] min-h-[46px] box-border p-2 rounded-[10px] bg-panel border border-border backdrop-blur-[10px] backdrop-saturate-150 shadow-panel text-[13px] leading-[1.5] text-primary flex flex-col transition-[margin-top] duration-200",{"no-enter":i.value.has(r.id)}]),style:(0,e.normalizeStyle)(C(0,m))},[(0,e.createCommentVNode)(" 标题左 / 操作按钮组右(两端对齐) "),(0,e.createElementVNode)("div",l,[r.icon?((0,e.openBlock)(),(0,e.createElementBlock)("img",{key:0,src:r.icon,class:"w-4 h-4 object-contain rounded shrink-0",alt:""},null,8,c)):(0,e.createCommentVNode)("v-if",!0),(0,e.createElementVNode)("span",{class:"font-semibold text-xs shrink-0",style:(0,e.normalizeStyle)((h=r.type,{color:v[h]||v.info}))},(0,e.toDisplayString)(r.title||x(r.type)),5),(0,e.createElementVNode)("div",d,[0===m&&a.value.length>1?((0,e.openBlock)(),(0,e.createElementBlock)("button",{key:0,type:"button",class:"text-[10px] px-1.5 py-0.5 rounded-md border border-border text-secondary cursor-pointer transition-colors hover:text-primary hover:bg-white/15",title:"清空全部通知",onClick:f}," 清空("+(0,e.toDisplayString)(t.toasts.length)+"条) ",1)):(0,e.createCommentVNode)("v-if",!0),(0,e.createElementVNode)("button",{type:"button",class:"w-5 h-5 flex items-center justify-center rounded-md border-none bg-transparent text-sm cursor-pointer text-secondary leading-none transition-colors hover:text-primary hover:bg-white/15",title:a.value.length>1?"关闭这条":"关闭",onClick:e=>function(e){b(e)||o("close",e.id)}(r)}," × ",8,u)])]),(0,e.createElementVNode)("div",{class:"toast-body flex items-start gap-2 max-h-[160px] overflow-y-auto overflow-x-hidden",style:V},[(0,e.createElementVNode)("div",p,(0,e.toDisplayString)(r.text),1),r.copyable?((0,e.openBlock)(),(0,e.createBlock)(s,{key:0,onCopy:e=>n.$emit("copy",r)},null,8,["onCopy"])):(0,e.createCommentVNode)("v-if",!0)])],6);var h}),128))]),_:1},8,["style"]))}});class h{constructor(e,t,n){this.bus=e,this.load=t,this.save=n,this.records=new Map,this.reload()}reload(){this.records.clear();for(const e of this.load())this.records.set(e.manifest.id,e)}list(){return[...this.records.values()]}get(e){return this.records.get(e)}install(e){if(!String(e||"").trim())return{ok:!1,error:"插件内容为空"};if(!/\/\/\s*==Plugin==/.test(e))return{ok:!1,error:"缺少 ==Plugin== 头"};const t=function(e){const t=e.match(/\/\/\s*==Plugin==\s*([\s\S]*?)\/\/\s*==\/Plugin==/);if(!t)return null;const n=t[1],r=e=>{const t=n.match(new RegExp(`//\\s*@${e}\\s+(.+)`));return t?t[1].trim():void 0},o=r("id"),a=r("name");if(!o||!a)return null;const i="feature"===r("type")?"feature":"shortcut",s=(r("permissions")||r("permission")||"").split(",").map(e=>e.trim()).filter(e=>["selection","clipboard","storage","ui","menu","network","dom","broadcast"].includes(e));return{id:o,name:a,version:r("version")||"0.0.1",type:i,icon:r("icon"),permissions:s,description:r("description"),builtin:"true"===r("builtin")}}(e);if(!t)return{ok:!1,error:"插件头格式错误(@id、@name 为必填字段)"};const n={manifest:t,code:e,installedAt:Date.now()};return this.records.set(t.id,n),this.persist(),this.bus.emit("plugin-installed",n),{ok:!0,record:n}}installBuiltin(e,t,n){const r={manifest:e,code:t,installedAt:Date.now()};return n&&(r.init=n),this.records.set(e.id,r),this.bus.emit("plugin-installed",r),r}uninstall(e){const t=this.records.delete(e);return t&&(this.persist(),this.bus.emit("plugin-uninstalled",e)),t}persist(){this.save(this.list())}}class g{constructor(){this.handlers=new Map}on(e,t){return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),()=>this.off(e,t)}off(e,t){this.handlers.get(e)?.delete(t)}emit(e,t){this.handlers.get(e)?.forEach(n=>{try{n(t)}catch(t){console.warn(`[plugin-core] event "${e}" handler error:`,t)}})}clear(){this.handlers.clear()}}class b{constructor(e){this.mode="soft",this.error=null,this.handlers=new Set,this.fn=null,this.code=e}run(e){try{const t=this.code.trim(),n=t.endsWith(";")?t.slice(0,-1).trim():t;this.fn=new Function("ctx","emit",`return (${n});`);const r=e=>this.dispatch(e);if(!this.fn)return;const o=this.fn(e,r);"function"==typeof o&&o(e,r)}catch(e){this.error=e instanceof Error?e.message:String(e),console.warn("[plugin-core] 插件主体执行失败:",e)}}send(e){this.dispatch(e)}onMessage(e){return this.handlers.add(e),()=>this.handlers.delete(e)}activate(){this.send({type:"activate"})}deactivate(){this.send({type:"deactivate"})}dispose(){this.send({type:"dispose"}),this.handlers.clear(),this.fn=null,this.code=""}dispatch(e){this.handlers.forEach(t=>{try{t(e)}catch(e){console.warn("[plugin-core] 插件消息处理错误:",e)}})}}class f{constructor(e,t,n){this.settings=[],this.initError=null,this.executor=null,this.onActivate=null,this.onDeactivate=null,this.disposeCbs=[],this.eventCbs=new Map,this.selectionCbs=[],this.manifest={...e.manifest},this.caps=t,this.uiHooks=n,this.mode="soft";const r=this.createCtx();if(e.init)try{e.init(r)}catch(e){this.initError=e instanceof Error?e.message:String(e),console.warn(`[plugin-core] 插件 ${this.manifest.id} 主体执行失败:`,e)}else{const t=new b(e.code);this.executor=t,t.run(r),t.error&&(this.initError=t.error)}}createCtx(){const e=this.manifest,t=t=>e.permissions.includes(t);return{manifest:{...e},getSelectedText:t("selection")?()=>this.caps.getSelectedText():void 0,readClipboard:t("clipboard")?()=>this.caps.readClipboard():void 0,copyText:t("clipboard")?e=>this.caps.copyText(e):void 0,getValue:t("storage")?(e,t)=>this.caps.getValue(e,t):void 0,setValue:t("storage")?(e,t)=>this.caps.setValue(e,t):void 0,openPanel:t("ui")?e=>this.caps.openPanel(e):void 0,closePanel:t("ui")?()=>this.caps.closePanel():void 0,openMenu:t("menu")?()=>this.caps.openMenu():void 0,closeMenu:t("menu")?()=>this.caps.closeMenu():void 0,toast:(e,n)=>{const r=n?.title?this.manifest.name+" "+n.title:this.manifest.name,o={...n,title:r,icon:this.manifest.icon};return o.broadcast&&!t("broadcast")&&delete o.broadcast,this.caps.toast(e,o)},dismissToast:e=>this.caps.dismissToast(e),httpRequest:t("network")?(e,t)=>this.caps.httpRequest(e,t):void 0,ui:{render:(t,n)=>{try{this.uiHooks.render(t,n)}catch(t){console.warn(`[plugin-core] 插件 ${e.id} UI 渲染失败:`,t)}},close:()=>this.uiHooks.close()},onActivate:e=>{this.onActivate=e},onDeactivate:e=>{this.onDeactivate=e},onEvent:(e,t)=>{this.eventCbs.set(e,t)},onSelectionChange:e=>{this.selectionCbs.push(e)},onDispose:e=>{this.disposeCbs.push(e)},declareSettings:e=>{this.settings=Array.isArray(e)?e:[]}}}activate(...e){if(this.onActivate)try{this.onActivate(...e)}catch(e){console.warn(`[plugin-core] 插件 ${this.manifest.id} activate 失败:`,e)}}deactivate(){if(this.onDeactivate)try{this.onDeactivate()}catch(e){console.warn(`[plugin-core] 插件 ${this.manifest.id} deactivate 失败:`,e)}}emitEvent(e,t){const n=this.eventCbs.get(e);if(n)try{n(t)}catch(t){console.warn(`[plugin-core] 插件 ${this.manifest.id} 事件 ${e} 处理失败:`,t)}}emitSelectionChange(e){this.selectionCbs.forEach(t=>{try{t(e)}catch(e){console.warn(`[plugin-core] 插件 ${this.manifest.id} selection 回调失败:`,e)}})}dispose(){this.disposeCbs.forEach(e=>{try{e()}catch(e){console.warn(`[plugin-core] 插件 ${this.manifest.id} dispose 回调失败:`,e)}}),this.disposeCbs=[],this.eventCbs.clear(),this.selectionCbs=[],this.executor?.dispose()}}const v="plugins",x="menuBindings",y="disabledPlugins",w="toastBroadcast";class k{constructor(e,t=[]){this.runtimes=new Map,this.bindings=[],this.disabledIds=[],this.listeners=new Map,this.errors=[],this.MAX_PLUGIN_ERRORS=3,this.storageUnwatchers=[],this.broadcastHandled=new Set,this.broadcastSeq=0,this.broadcastUnwatch=null,this.legacyCbs=new Map,this.deps=e,this.registry=new h(new g,()=>this.loadRecords(),e=>this.saveRecords(e)),this.bindings=this.loadBindings(),this.disabledIds=this.loadDisabled();for(const e of t){const t=this.registry.get(e.manifest.id);t&&!t.manifest.builtin&&this.registry.uninstall(e.manifest.id),this.registry.installBuiltin({...e.manifest,builtin:!0},e.code||"",e.init)}this.startStorageSync(),this.startToastBroadcast()}on(e,t){let n=this.listeners.get(e);return n||(n=new Set,this.listeners.set(e,n)),n.add(t),()=>{n?.delete(t)}}emit(e,...t){const n=this.listeners.get(e);if(n)for(const r of n)try{r(...t)}catch(t){console.warn(`[plugin] 事件 "${e}" 订阅者抛错:`,t)}}notifyChanged(){this.emit("changed")}get storage(){return this.deps.storage}loadRecords(){const e=this.storage.get(v,[]);return Array.isArray(e)?e:[]}saveRecords(e){try{this.storage.set(v,e)}catch(e){this.deps.log?.("保存插件记录失败:",e)}}loadBindings(){const e=this.storage.get(x,[]);return Array.isArray(e)?e.map(String):[]}loadDisabled(){const e=this.storage.get(y,[]);return Array.isArray(e)?e.map(String):[]}saveDisabled(){this.storage.set(y,this.disabledIds)}saveBindings(){this.storage.set(x,this.bindings)}startStorageSync(){for(const e of[v,x,y])try{const t=this.storage.watch(e,()=>{this.syncFromStorage(e)});this.storageUnwatchers.push(t)}catch{}}syncFromStorage(e){if(e===v)this.registry.reload(),this.preheatFeatures();else if(e===x)this.bindings=this.loadBindings();else if(e===y){this.disabledIds=this.loadDisabled();for(const[e,t]of this.runtimes)this.isEnabled(e)||(t.dispose(),this.runtimes.delete(e))}this.notifyChanged()}disposeStorageSync(){for(const e of this.storageUnwatchers)try{e()}catch{}this.storageUnwatchers=[]}startToastBroadcast(){try{this.broadcastUnwatch=this.storage.watch(w,e=>{try{const t=JSON.parse(String(e));if(!t||"number"!=typeof t.id||this.broadcastHandled.has(t.id))return;this.broadcastHandled.add(t.id),this.emit("toast",t.text,t.opts)}catch{}})}catch{}}install(e){const t=this.registry.install(e);if(t.ok&&t.record){const e=t.record.manifest.id,n=this.runtimes.get(e);return n&&(n.dispose(),this.runtimes.delete(e)),this.errors=this.errors.filter(t=>t.id!==e),this.notifyChanged(),{ok:!0,id:e,type:t.record.manifest.type}}return{ok:!1,error:t.error}}uninstall(e){const t=this.registry.get(e);if(t?.manifest.builtin)return!1;this.runtimes.get(e)?.dispose(),this.runtimes.delete(e);try{this.storage.set("plugin:"+e+".settings","")}catch{}const n=this.registry.uninstall(e);this.emit("pluginUninstalled",e);let r=!1;for(let t=0;t'+t+"")}(n.manifest.name):""}getBindingName(e){const t=this.bindings[e];return t?this.registry.get(t)?.manifest.name||t:""}activateSlot(e){const t=this.bindings[e];t&&this.activate(t)}activate(e){this.isEnabled(e)&&this.getRuntime(e)?.activate()}collectError(e,t){const n=this.errors.find(n=>n.id===e&&n.message===t);n?n.count++:(this.errors.push({id:e,message:t,count:1}),this.errors.length>this.MAX_PLUGIN_ERRORS&&this.errors.shift())}getPluginErrors(){return this.errors.map(e=>({id:e.id,name:this.registry.get(e.id)?.manifest.name||e.id,message:e.message,count:e.count}))}clearPluginError(e){this.errors=this.errors.filter(t=>t.id!==e)}getSettings(e){const t=this.getRuntime(e);return t?.settings||[]}getPluginSetting(e,t){const n=this.storage.get("plugin:"+e+".settings",{});return t in n?n[t]:void 0}setPluginSetting(e,t,n){const r=this.storage.get("plugin:"+e+".settings",{});r[t]=n,this.storage.set("plugin:"+e+".settings",r)}preheatFeatures(){this.registry.list().forEach(e=>{"feature"===e.manifest.type&&this.isEnabled(e.manifest.id)&&this.getRuntime(e.manifest.id)})}isEnabled(e){return!this.disabledIds.includes(e)}setEnabled(e,t){t?this.disabledIds=this.disabledIds.filter(t=>t!==e):this.disabledIds.includes(e)||(this.disabledIds.push(e),this.runtimes.get(e)?.dispose(),this.runtimes.delete(e)),this.saveDisabled(),this.notifyChanged()}getRuntime(e){const t=this.runtimes.get(e);if(t)return t;const n=this.registry.get(e);if(!n)return;const r=new f(n,this.createCaps(e),this.createUiHooks(e));return this.runtimes.set(e,r),r.initError&&this.collectError(e,r.initError),r}handleSelectionChange(e){this.registry.list().forEach(t=>{"feature"===t.manifest.type&&t.manifest.permissions.includes("selection")&&this.isEnabled(t.manifest.id)&&this.getRuntime(t.manifest.id)?.emitSelectionChange(e)})}createCaps(e){const{storage:t,http:n,clipboard:r,getSelectedText:o}=this.deps;return{getSelectedText:async()=>o?.()??"",readClipboard:async()=>{if(!r)return"";try{return await r.read()}catch{return""}},copyText:async e=>{if(r)try{await r.write(e)}catch{}},getValue:(n,r)=>{const o=t.get("plugin:"+e+".settings",{});return n in o?o[n]:r},setValue:(n,r)=>{const o=t.get("plugin:"+e+".settings",{});o[n]=r,t.set("plugin:"+e+".settings",o)},openPanel:async t=>(this.emit("panelRender",{kind:"panel",spec:{type:"panel",title:t.title,body:t.body??[]},pluginId:e}),{ok:!0}),closePanel:async()=>{this.emit("panelRender",{kind:"close",spec:null,pluginId:e})},openMenu:()=>this.emit("menuRequest"),closeMenu:()=>{},toast:(e,n)=>{if(n?.broadcast){const r=++this.broadcastSeq;try{const{broadcast:o,...a}=n;t.set(w,{id:r,text:e,opts:a})}catch{}}const r=this.listeners.get("toast");if(!r||0===r.size)return 0;let o=0,a=!0;for(const t of r)try{a?(o=t(e,n)??0,a=!1):t(e,n)}catch{}return o},dismissToast:e=>this.emit("dismissToast",e),httpRequest:(e,t)=>n?n.request(e,t):Promise.resolve({ok:!1,status:0,text:""})}}createUiHooks(e){return{render:(t,n)=>{this.emit("panelRender",{kind:t,spec:n,pluginId:e})},close:()=>{this.emit("panelRender",{kind:"close",spec:null,pluginId:e})}}}disposeAll(){if(this.runtimes.forEach(e=>e.dispose()),this.runtimes.clear(),this.disposeStorageSync(),this.broadcastUnwatch){try{this.broadcastUnwatch()}catch{}this.broadcastUnwatch=null}}registerLegacy(e,t){this.legacyCbs.get(e)&&this.offLegacy(e),this.legacyCbs.set(e,t),this.on(e,t)}offLegacy(e){const t=this.legacyCbs.get(e);if(!t)return;const n=this.listeners.get(e);n?.delete(t),this.legacyCbs.delete(e)}onPanelRender(e){this.registerLegacy("panelRender",e)}onMenuRequest(e){this.registerLegacy("menuRequest",e)}onPluginUninstalled(e){this.registerLegacy("pluginUninstalled",e)}onToast(e){this.registerLegacy("toast",e)}onDismissToast(e){this.registerLegacy("dismissToast",e)}onChanged(e){this.on("changed",e)}}function E(e){const t={fontSize:"13px",lineHeight:"1.5"};return"bold"===e?.weight&&(t.fontWeight="600"),"sm"===e?.size&&(t.fontSize="12px"),"lg"===e?.size&&(t.fontSize="15px"),"secondary"===e?.color&&(t.color="var(--color-secondary)"),"accent"===e?.color&&(t.color="var(--color-accent)"),"danger"===e?.color&&(t.color="var(--color-danger)"),t}const C="w-full box-border px-2 py-1 text-xs border border-border rounded-md bg-input text-primary font-[inherit] select-text";function V(r,o){switch(r.type){case"panel":return(0,e.h)(n,{variant:"glass",style:{width:"100%",padding:"12px"}},()=>(r.body||[]).map(e=>V(e,o)));case"text":return(0,e.h)("span",{style:E(r.style)},r.content);case"button":return(0,e.h)(t,{variant:"glass",size:30,style:{marginTop:"4px"},onClick:()=>o(r.event||"")},()=>r.label);case"list":return(0,e.h)("div",{class:"flex flex-col gap-1"},(r.items||[]).map(e=>V(e,o)));case"divider":return(0,e.h)("hr",{class:"border-0 border-t border-border my-2"});case"badge":return(0,e.h)("span",{class:"inline-block px-2 py-0.5 text-[11px] rounded-[10px] bg-subtle-btn text-secondary"},r.text);case"image":return(0,e.h)("img",{src:r.src,class:"max-w-full rounded-md block"});case"link":return(0,e.h)("a",{href:r.href,target:"_blank",rel:"noopener noreferrer",class:"text-accent no-underline"},r.label);case"icon":return(0,e.h)("span",{class:"text-base"},r.name);case"input":return(0,e.h)("input",{value:r.value||"",placeholder:r.placeholder||"",onInput:e=>o(r.event||"",e.target.value),class:C});case"textarea":return(0,e.h)("textarea",{value:r.value||"",onInput:e=>o(r.event||"",e.target.value),class:`${C} min-h-12 resize-y`});case"checkbox":return(0,e.h)("label",{class:"flex items-center gap-1.5 text-[13px]"},[(0,e.h)("input",{type:"checkbox",checked:!!r.checked,onChange:e=>o(r.event||"",e.target.checked)}),(0,e.h)("span",r.label)]);case"select":return(0,e.h)("select",{onChange:e=>o(r.event||"",e.target.value),class:C},(r.options||[]).map(t=>(0,e.h)("option",{value:t.value},t.label)));case"tabs":return(0,e.h)("div",{},[(0,e.h)("div",{class:"flex flex-wrap gap-1 mb-1.5"},(r.tabs||[]).map((t,n)=>(0,e.h)("button",{onClick:()=>o("tab",n),class:"px-2.5 py-0.5 text-xs rounded-md border border-border bg-subtle-btn text-primary cursor-pointer"},()=>t.label))),...r.tabs&&r.tabs[0]?r.tabs[0].body.map(e=>V(e,o)):[]]);case"component":return(0,e.h)("div",{class:"text-danger text-xs"},`组件 ${r.name} 未支持`);default:return(0,e.h)("span",{},"")}}const S=[{name:"gh-proxy.com",url:"https://gh-proxy.com"},{name:"gh-proxy.org",url:"https://gh-proxy.org"},{name:"ghproxy.com",url:"https://mirror.ghproxy.com"}];const N=12e4,B={一:1,二:2,三:3,四:4,五:5,六:6,日:0,天:0},M={秒:1e3,秒钟:1e3,s:1e3,sec:1e3,分:6e4,分钟:6e4,m:6e4,min:6e4,小时:36e5,h:36e5};function z(e,t){return e>=0&&e<=23&&t>=0&&t<=59}function T(e){return(e<10?"0":"")+e}const _="data:image/svg+xml;utf8,"+encodeURIComponent(''),L=[{manifest:{id:"com.flowsaro.github-accel",name:"GitHub 下载加速",version:"1.0.0",type:"feature",permissions:["dom","storage"],icon:"data:image/svg+xml;utf8,"+encodeURIComponent('GH'),description:"GitHub Release/仓库下载链接添加镜像加速按钮(注入型插件,仅 GitHub 站点;镜像列表可在设置面板配置)",builtin:!0},init:function(e){const t=e;if(t.declareSettings([{key:"mirrors",label:"镜像列表(每行一个,格式:名称 URL;留空使用默认)",type:"textarea",placeholder:"gh-proxy.com https://gh-proxy.com\ngh-proxy.org https://gh-proxy.org\nghproxy.com https://mirror.ghproxy.com"}]),!/(^|\.)github\.com$/.test(location.hostname))return;if(!document.body)return;let n=S,r=S[0];function o(){const e=function(e){const t=[];for(const n of String(e||"").split("\n")){const e=n.trim();if(!e)continue;const r=e.split(/\s+/),o=r[r.length-1];if(!/^https?:\/\//.test(o))continue;let a=r.length>1?r.slice(0,-1).join(" "):o;try{1===r.length&&(a=new URL(o).hostname.replace(/^www\./,""))}catch{}t.push({name:a,url:o})}return t}(String(t.getValue("mirrors","")||""));n=e.length?e:S,n.some(e=>e.url===r.url)||(r=n[0])}function a(e,t){return e.url.replace(/\/+$/,"")+"/"+t}function i(){document.querySelectorAll(".gh-mirror-menu.open").forEach(e=>e.classList.remove("open"))}function s(e){e.querySelectorAll("li").forEach(e=>{const t=e.getAttribute("data-mirror-url")===r.url;e.classList.toggle("selected",t),e.textContent=(t?"✓ ":"")+e.getAttribute("data-mirror-name")})}function l(e){if(e.getAttribute("data-mirror-split"))return;e.setAttribute("data-mirror-split","1");const t=document.createElement("span");t.className="gh-mirror-split";const o=document.createElement("a");o.className="split-main",o.setAttribute("data-original-href",e.href),o.href=a(r,e.href),o.textContent="下载",o.title="通过 "+r.name+" 下载",o.target="_blank",o.rel="noopener noreferrer",o.setAttribute("data-mirror-split","1");const l=document.createElement("button");l.type="button",l.className="split-arrow",l.textContent="▾",l.title="选择镜像下载",l.setAttribute("aria-label","选择镜像下载");const c=document.createElement("ul");c.className="gh-mirror-menu",n.forEach(t=>{const n=document.createElement("li");n.setAttribute("data-mirror-url",t.url),n.setAttribute("data-mirror-name",t.name),n.addEventListener("click",n=>{n.stopPropagation(),window.open(a(t,e.href),"_blank"),r=t,document.querySelectorAll(".gh-mirror-split .split-main").forEach(e=>{const t=e,n=t.getAttribute("data-original-href");n&&(t.href=a(r,n),t.title="通过 "+r.name+" 下载")}),s(c),c.classList.remove("open")}),c.appendChild(n)}),s(c),l.addEventListener("click",e=>{e.stopPropagation();const t=c.classList.contains("open");i(),t||c.classList.add("open")}),t.appendChild(o),t.appendChild(l),t.appendChild(c),e.parentNode.insertBefore(t,e.nextSibling);const d=e.parentElement;e.href.includes("archive/refs/heads")&&d&&"LI"===d.tagName&&d.classList.add("gh-mirror-li")}o();let c=null,d=null;function u(){c&&clearTimeout(c),c=setTimeout(()=>{d&&d.disconnect(),document.querySelectorAll("a[href*='releases/download']:not([data-mirror-split]), a[href*='archive/refs/heads']:not([data-mirror-split])").forEach(l),d&&document.body&&d.observe(document.body,{childList:!0,subtree:!0})},250)}!function(){const e=document.createElement("style");e.textContent='.gh-mirror-split{position:relative;display:inline-flex;align-items:stretch;margin-left:8px;vertical-align:middle;flex-shrink:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif}.gh-mirror-split a,.gh-mirror-split button{font-size:12px;line-height:20px;padding:3px 12px;border:1px solid var(--color-border-default,#d0d7de);background-color:var(--color-btn-bg,#f6f8fa);color:var(--color-fg-default,#24292f);cursor:pointer;text-decoration:none !important;white-space:nowrap;box-shadow:var(--color-btn-shadow,0 1px 0 rgba(27,31,36,0.04));box-sizing:border-box}.gh-mirror-split a:hover,.gh-mirror-split a:active,.gh-mirror-split a:focus,.gh-mirror-split button:hover{text-decoration:none !important;background-color:var(--color-btn-hover-bg,#f3f4f6);border-color:var(--color-btn-hover-border,#d0d7de)}.gh-mirror-split .split-main{border-radius:6px 0 0 6px;border-right:none}.gh-mirror-split .split-arrow{border-radius:0 6px 6px 0;padding-left:8px;padding-right:8px}.gh-mirror-menu{position:absolute;right:0;top:calc(100% + 4px);min-width:160px;margin:0;padding:4px 0;list-style:none;background-color:var(--color-canvas-overlay,#fff);border:1px solid var(--color-border-default,#d0d7de);border-radius:6px;box-shadow:var(--color-shadow-large,0 8px 24px rgba(140,149,159,0.2));z-index:999999;display:none}.gh-mirror-menu.open{display:block}.gh-mirror-menu li{padding:4px 12px;font-size:12px;cursor:pointer;color:var(--color-fg-default,#24292f);white-space:nowrap}.gh-mirror-menu li:hover{background-color:var(--color-accent-subtle,#ddf4ff);color:var(--color-accent-fg,#0969da)}.gh-mirror-menu li.selected{color:var(--color-accent-fg,#0969da);font-weight:600}li.gh-mirror-li{display:flex !important;align-items:center}',document.head.appendChild(e)}(),d=new MutationObserver(u),d.observe(document.body,{childList:!0,subtree:!0}),u(),document.addEventListener("click",i);let p=null;try{"function"==typeof GM_addValueChangeListener&&(p=GM_addValueChangeListener("sc:plugin:com.flowsaro.github-accel.settings",()=>{o(),document.querySelectorAll(".gh-mirror-split").forEach(e=>e.remove()),u()}))}catch{}t.onDispose(()=>{if(d&&d.disconnect(),c&&clearTimeout(c),document.removeEventListener("click",i),null!=p&&"function"==typeof GM_removeValueChangeListener)try{GM_removeValueChangeListener(p)}catch{}})}},{manifest:{id:"com.flowsaro.translate",name:"快捷翻译",version:"0.2.0",type:"shortcut",permissions:["selection","network","storage"],icon:_,description:"选中文本后点此翻译(中英互译,MyMemory 免费接口,支持配置 API Key)",builtin:!0},init:function(e){const t=e;t.declareSettings([{key:"apiKey",label:"MyMemory API Key(可选,提升每日配额)",type:"text",placeholder:"留空使用匿名接口"}]),t.onActivate(async()=>{const e=(await t.getSelectedText()||"").trim();if(!e)return void t.toast("未选中内容",{type:"warning"});const n=t.toast("翻译中…",{type:"info",timeout:0});try{const r=/[\u4e00-\u9fa5]/.test(e)?"zh-CN|en":"en|zh-CN";let o="https://api.mymemory.translated.net/get?q="+encodeURIComponent(e)+"&langpair="+r;const a=t.getValue("apiKey","");a&&(o+="&de="+encodeURIComponent(a));const i=await t.httpRequest(o);if(!i.ok)return t.dismissToast(n),void t.toast("翻译失败("+i.status+")",{type:"error"});const s=JSON.parse(i.text),l=s&&s.responseData&&s.responseData.translatedText;if(!l)return t.dismissToast(n),void t.toast("未获取到翻译结果",{type:"warning"});t.dismissToast(n),t.toast(l,{type:"success",copyable:!0,timeout:0})}catch(e){t.dismissToast(n),t.toast("翻译失败,请检查网络",{type:"error"})}})}},{manifest:{id:"com.flowsaro.reminder",name:"提醒助手",version:"1.5.0",type:"feature",permissions:["storage","broadcast"],icon:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext y='0.9em' font-size='90'%3E%E2%8F%B0%3C/text%3E%3C/svg%3E",description:"按固定时间弹提醒:支持每 N 秒/分钟/小时循环、每天 HH:MM、每周X HH:MM、一次性 YYYY-MM-DD HH:MM;提醒内容由「|」后的文本自定义,所有打开的标签页同步弹出",builtin:!0},init:function(e){const t=e;t.declareSettings([{key:"reminders",label:"提醒列表(每行一条:规则|通知内容,支持安排多个计划分行输入)",type:"textarea",placeholder:"每 45 分钟|⏰ 到点啦:起来喝水\n09:30|📅 到点啦:晨会\n每周一,周五 18:00|💼 到点啦:写周报\n2026-09-20 15:00|✅ 该交材料了",default:""},{key:"intervalToast",label:"周期提醒(每 N 秒/分钟/小时):通知自动关闭秒数(0 = 不自动关闭)",type:"text",placeholder:"8",default:String(8)},{key:"schedToast",label:"定点提醒(每日/每周/一次性):通知自动关闭秒数(0 = 不自动关闭)",type:"text",placeholder:"0",default:"0"}]);let n=null,r=null,o=[];const a={},i={};let s=[];function l(){const e=String(t.getValue("reminders","")||"").replace(/\\n/g,"\n");if(e===r)return;r=e;const n=[],a=[];if(function(e){return String(e||"").replace(/\\n/g,"\n").split(/\n+/).map(e=>e.trim()).filter(Boolean)}(e).forEach(e=>{const t=function(e){const t=e.indexOf("|");if(t<0)return{line:e,error:"缺少「|」分隔符"};const n=e.slice(0,t).trim(),r=e.slice(t+1).trim();if(!n)return{line:e,error:"「|」左边的时间规则是空的"};if(!r)return{line:e,error:"「|」右边的提醒内容是空的"};let o;if(o=n.match(/^(\d{4})-(\d{1,2})-(\d{1,2})[ T](\d{1,2}):(\d{2})$/),o)return z(+o[4],+o[5])?{type:"once",key:"once|"+n+"|"+r,content:r,y:+o[1],mo:+o[2]-1,d:+o[3],h:+o[4],mi:+o[5]}:{line:e,error:"时间超出范围(小时 0-23,分钟 0-59)"};if(o=n.match(/^每天\s*(\d{1,2}):(\d{2})$/)||n.match(/^(\d{1,2}):(\d{2})$/),o)return z(+o[1],+o[2])?{type:"daily",key:"daily|"+n+"|"+r,content:r,h:+o[1],mi:+o[2]}:{line:e,error:"时间超出范围(小时 0-23,分钟 0-59)"};if(o=n.match(/^(?:每)?周(周?[一二三四五六日天](?:[,,、]周?[一二三四五六日天])*)\s+(\d{1,2}):(\d{2})$/),o){if(!z(+o[2],+o[3]))return{line:e,error:"时间超出范围(小时 0-23,分钟 0-59)"};const t=o[1].split(/[,,、]/).map(e=>B[e.replace(/^周/,"").trim()]).filter(e=>void 0!==e);return t.length?{type:"weekly",key:"weekly|"+n+"|"+r,content:r,days:t,h:+o[2],mi:+o[3]}:{line:e,error:"没看懂星期写法「"+o[1]+"」(示例:每周一,周五 18:00)"}}if(o=n.match(/^每\s*(\d+)\s*(秒|秒钟|分钟|小时|分)?$/)||n.match(/^(\d+)\s*(秒|秒钟|分钟|小时|分|s|sec|m|min|h)$/i),o){const t=String(o[2]||"分钟").toLowerCase(),a=(M[t]||0)*+o[1];return a?a<5e3?{line:e,error:"间隔太短(最短 5 秒)"}:{type:"interval",key:"interval|"+n+"|"+r,content:r,ms:a}:{line:e,error:"不认识的时间单位「"+(o[2]||"")+"」"}}return o=n.match(/^(\d{1,2}):(\d{1,2})$/),o?{line:e,error:"时间超出范围(小时 0-23,分钟 0-59)"}:/^每|^周|^\d/.test(n)?{line:e,error:"时间规则里混入了别的文字「"+n+"」,提醒内容请写在「|」右边"}:{line:e,error:"规则写法未识别"}}(e);"error"in t?a.push(t):n.push(t)}),o=n,a.length){const e=a.slice(0,2).map(e=>"「"+e.line+"」").join(""),n=a.length>2?" 等 "+a.length+" 条":"";t.toast("有 "+a.length+" 条提醒规则没被识别,已忽略:"+e+n+"。格式:规则|内容。规则支持:每 N 秒/分钟/小时、HH:MM、每周X HH:MM、YYYY-MM-DD HH:MM",{type:"warning",timeout:0}),a.forEach(e=>{console.warn("[提醒助手] 无法识别的规则行:「"+e.line+"」原因:"+e.error)})}}function c(e,n){const r=parseInt(String(t.getValue(e,n)),10);return isNaN(r)||r<0?n:r}function d(e){const n="interval"===e.type?c("intervalToast",8):c("schedToast",0);t.toast(e.content,{type:"warning",timeout:1e3*n,broadcast:!0})}function u(){if(l(),!o.length)return;const e=new Date,n=e.getTime();o.forEach(r=>{if("interval"===r.type){const e=a[r.key];return void(void 0===e?a[r.key]=n+r.ms:n>=e&&(a[r.key]=n+r.ms,d(r)))}if("once"===r.type){const e=new Date(r.y,r.mo,r.d,r.h,r.mi,0).getTime();return void(n>=e&&n-e<=N&&-1===s.indexOf(r.key)&&(s.push(r.key),s.length>200&&(s=s.slice(-200)),t.setValue("done",s),d(r)))}if(!("daily"===r.type||-1!==r.days.indexOf(e.getDay())))return;const o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),r.h,r.mi,0).getTime();if(nN)return;const l=(c=e).getFullYear()+"-"+T(c.getMonth()+1)+"-"+T(c.getDate());var c;i[r.key]!==l&&(i[r.key]=l,d(r))})}const p=t.getValue("done",[]);s=Array.isArray(p)?p:[],l(),u(),n=setInterval(u,5e3);let m=null;try{"function"==typeof GM_addValueChangeListener&&(m=GM_addValueChangeListener("sc:plugin:com.flowsaro.reminder.settings",()=>{r=null,u()}))}catch{}t.onDispose(()=>{if(n&&(clearInterval(n),n=null),null!=m&&"function"==typeof GM_removeValueChangeListener){try{GM_removeValueChangeListener(m)}catch{}m=null}o=[],Object.keys(a).forEach(e=>delete a[e]),Object.keys(i).forEach(e=>delete i[e])})}}],A="sc:",R={get(e,t){try{if("function"!=typeof GM_getValue)return t;const n=GM_getValue(A+e,"");return n?JSON.parse(String(n)):t}catch{return t}},set(e,t){try{if("function"!=typeof GM_setValue)return;GM_setValue(A+e,JSON.stringify(t))}catch{}},watch(e,t){if("function"!=typeof GM_addValueChangeListener)return()=>{};try{const n=GM_addValueChangeListener(A+e,(e,n,r)=>{t(r)});return()=>{if("function"==typeof GM_removeValueChangeListener)try{GM_removeValueChangeListener(n)}catch{}}}catch{return()=>{}}}},D="function"==typeof GM_xmlhttpRequest?{request:(e,t)=>new Promise(n=>{try{GM_xmlhttpRequest({method:t?.method||"GET",url:e,headers:t?.headers,data:t?.data,timeout:t?.timeout||1e4,onload:e=>n({ok:e.status>=200&&e.status<300,status:e.status,text:e.responseText||""}),onerror:()=>n({ok:!1,status:0,text:""}),ontimeout:()=>n({ok:!1,status:0,text:""})})}catch{n({ok:!1,status:0,text:""})}})}:void 0;let G=null;function I(){return G||(G=function(e,t=[]){return new k(e,t)}({storage:R,http:D,clipboard:{read:async()=>{try{return await(navigator.clipboard?.readText())||""}catch{return""}},write:async e=>{try{await(navigator.clipboard?.writeText(e))}catch{}}},getSelectedText:()=>window.getSelection()?.toString()||"",log:(...e)=>console.log("[plugin]",...e)},L)),G}function U(){return GM_info.script.icon}function H(e){const t=(e||"").trim();if(!t)return U();const n=t.match(/data:([^;,]+);base64,\s*([A-Za-z0-9+/=]+)/i);if(n)return`data:${n[1]};base64,${n[2]}`;const r=t.replace(/\s+/g,"");return/^[A-Za-z0-9+/=]+$/.test(r)?`data:${o=r,o.startsWith("R0lGOD")?"image/gif":o.startsWith("UklGR")?"image/webp":"image/png"};base64,${r}`:t.startsWith("data:")?t:"data:image/png;base64,"+r;var o}function F(t,n,r){const o=r?r(GM_getValue(t,n)):GM_getValue(t,n),a=(0,e.ref)(o);try{const o=GM_addValueChangeListener(t,(e,t,o)=>{a.value=r?r(o):o??n});(0,e.onScopeDispose)(()=>{try{GM_removeValueChangeListener(o)}catch{}})}catch{}return a}function $(e){return t=>null==t?e:Boolean(t)}function P(e){return t=>null==t?e:String(t)}function j(){return e=>{const t=parseFloat(String(e??1));if(isNaN(t))return 1;const n=Math.floor(10*t)/10;return Math.min(4,Math.max(.6,n))}}function q(){return e=>Math.min(8,Math.max(2,parseInt(String(e??4),10)||4))}function Y(){return e=>H(String(e||""))}function O(){return e=>Array.isArray(e)?e.join("\n"):null==e?"":String(e)}const W={class:"flex items-center gap-2 mb-3 pb-3 border-b border-border"},X=["src","alt"],J={class:"text-sm font-semibold"},K={class:"sc-scroll flex-1 min-h-0 overflow-y-auto p-[2px_10px_8px_4px] -mr-1.5"},Z={key:0,class:"mb-2.5"},Q={class:"flex-1 break-words"},ee={key:0},te=["onClick"],ne={class:"flex items-center gap-2 mb-2 text-[13px] cursor-pointer rounded-lg px-2 -mx-2 py-1.5 transition-colors hover:bg-white/10"},re={class:"flex items-center gap-2 mb-2 text-[13px] cursor-pointer rounded-lg px-2 -mx-2 py-1.5 transition-colors hover:bg-white/10"},oe={class:"border border-border rounded-xl p-3 mb-3 min-w-0 bg-subtle-btn"},ae={class:"flex items-center gap-1.5 mb-4"},ie={class:"flex items-center gap-2 mb-2 text-[13px] cursor-pointer rounded-lg px-2 -mx-2 py-1.5 transition-colors hover:bg-white/10"},se={class:"flex items-center gap-1.5 mb-2.5 text-[13px] cursor-pointer"},le={class:"flex items-start gap-1.5"},ce={key:0,class:"mt-3.5"},de=["src","title","onClick"],ue=["onClick"],pe={key:1,class:"mt-1.5 text-[11px] text-danger"},me={class:"border border-border rounded-xl p-3 mb-3 min-w-0 bg-subtle-btn"},he={class:"border border-border rounded-xl p-3 mb-3 min-w-0 bg-subtle-btn"},ge={class:"flex items-center gap-2 mb-2 text-[13px] cursor-pointer rounded-lg px-2 -mx-2 py-1.5 transition-colors hover:bg-white/10"},be={class:"flex items-center gap-2 mb-2 text-[13px] cursor-pointer rounded-lg px-2 -mx-2 py-1.5 transition-colors hover:bg-white/10"},fe={class:"border border-border rounded-xl p-3 mb-3 min-w-0 bg-subtle-btn"},ve={class:"flex-[0_0_44px]"},xe=["onUpdate:modelValue"],ye=["value"],we={class:"flex justify-between gap-1.5 mb-2"},ke={key:1,class:"mb-2"},Ee=["onClick"],Ce={class:"flex-[0_0_14px] text-secondary text-[10px]"},Ve=["src"],Se={key:1,class:"w-4 h-4 shrink-0 flex items-center justify-center rounded-md bg-subtle-btn text-[10px] text-secondary font-medium"},Ne={class:"text-secondary"},Be={key:0,class:"ml-1 text-[10px] px-1 py-[1px] rounded-lg bg-accent/20 text-accent"},Me={key:0,class:"py-1 pl-[30px] text-secondary"},ze={key:0,class:"text-warning"},Te={key:0},_e={key:1,class:"mt-1 text-danger text-[11px]"},Le={class:"mt-1 flex items-center gap-2"},Ae={class:"flex items-center gap-1 cursor-pointer"},Re=["checked","onChange"],De=["onClick"],Ge={key:1,class:"text-[11px] opacity-60"},Ie={class:"mb-0.5"},Ue=["type","value","placeholder","onChange"],He=["value","placeholder","onChange"],Fe=["value","onChange"],$e=["value"],Pe={key:3,class:"flex items-center gap-1"},je=["checked","onChange"],qe={key:2,class:"text-secondary text-xs mb-2"},Ye={class:"flex justify-end gap-2 pt-2.5 mt-2.5 border-t border-border"},Oe=(0,e.defineComponent)({__name:"Settings",props:{anchor:{},btnSize:{},initialTab:{}},emits:["close","icon-change","rotate-change","scale-change","saved"],setup(t,{emit:r}){const o=t,a=r,s=U(),l=(0,e.ref)(GM_info.script.name),c=(0,e.ref)(GM_info.script.icon),d=(0,e.ref)(null),u=(0,e.ref)(0),p=F("general.githubAccel",!0,$(!0)),m=F("general.backTop",!0,$(!0)),h=F("general.alwaysShow",!1,$(!1)),g=F("general.noBtnBg",!1,$(!1)),b=F("general.iconScale","1",e=>String(e??1)),f=F("general.menuSlots","4",e=>String(e??4)),v=F("general.quickMenu",!1,$(!1)),x=F("general.btnAnim","none",P("none")),y=F("general.btnRotate",0,e=>{const t=parseFloat(String(e??0));return isNaN(t)?0:Math.min(360,Math.max(0,Math.round(t)))});(0,e.watch)(y,e=>a("rotate-change",e)),(0,e.watch)(b,e=>{const t=parseFloat(String(e));a("scale-change",isNaN(t)?1:t)});const w=(0,e.ref)(""),k=F("general.customIcon","",P("")),E=(0,e.ref)("");const C=F("general.iconList",[],function(e){try{let t=[];if(Array.isArray(e))t=e.map(String).filter(Boolean);else{const n=null==e?"":String(e),r=n?JSON.parse(n):[];Array.isArray(r)&&(t=r.filter(e=>"string"==typeof e&&e.trim()))}return t.includes(s)||t.push(s),t.length>12&&(t=t.slice(0,11).concat(s)),t}catch{return[s]}}),V=(0,e.ref)(C.value.includes(k.value)?k.value:null),S=(0,e.ref)(!1),N=(0,e.ref)(!1),B=(0,e.ref)(null);function M(e){return function(e){const t=e.match(/base64,([A-Za-z0-9+/=]+)/),n=t?t[1]:e,r=n.endsWith("==")?2:n.endsWith("=")?1:0;return Math.floor(3*n.length/4)-r}(e)>51200?(E.value="图片超过 50KB,无法添加",!1):!C.value.includes(e)&&C.value.length>=12?(E.value="图标列表最多 12 个",!1):(E.value="",e===s||(C.value.includes(e)?C.value=[e,...C.value.filter(t=>t!==e)]:C.value.unshift(e),GM_setValue("general.iconList",JSON.stringify(C.value))),!0)}function z(){const e=w.value.trim();if(!e)return;const t=H(e);M(t)&&(V.value=t,w.value="",a("icon-change",t))}(0,e.watch)(k,e=>{e&&C.value.includes(e)&&(V.value=e)});const T=(0,e.ref)(null);function _(){T.value?.click()}function L(e){const t=e.target,n=t.files?.[0];if(t.value="",!n)return;if(n.size>51200)return void(E.value="图片不能超过 50KB");const r=new FileReader;r.onload=()=>{const e=String(r.result||"");if(!e)return;const t=H(e);M(t),V.value=t,a("icon-change",t)},r.readAsDataURL(n)}function A(){const e=B.value;e&&(N.value=e.scrollHeight>e.clientHeight+2)}const R=F("general.disabledSites","",O()),D=(0,e.computed)(()=>{const e=o.btnSize??46,t=o.anchor.x+e+20,n=Math.max(0,window.innerHeight-u.value-12);return{right:t+"px",bottom:Math.min(o.anchor.y,n)+"px"}});function G(){const e=location.hostname,t=R.value.split("\n").map(e=>e.trim()).filter(Boolean);t.includes(e)||t.push(e),R.value=t.join("\n")}const j=(0,e.ref)("general"),q=[{key:"general",label:"常规"},{key:"menu",label:"快捷菜单"},{key:"plugin",label:"插件管理"}],Y=I(),Oe=(0,e.ref)([]),We=(0,e.ref)([]),Xe=(0,e.ref)(""),Je=(0,e.ref)(!1),Ke=(0,e.ref)(""),Ze=(0,e.ref)(null),Qe=(0,e.ref)(null),et=(0,e.ref)(new Set),tt=(0,e.computed)(()=>Math.min(8,Math.max(2,parseInt(f.value,10)||4)));function nt(){Oe.value=Y.list();const e=tt.value,t=Y.getBindings();We.value=[];for(let n=0;n{Ke.value=String(r.result||""),Xe.value=""},r.readAsText(n)}const at=(0,e.computed)(()=>Y.getPluginErrors());function it(e){return Y.getSettings(e)}function st(e,t){const n=Y.getPluginSetting(e,t.key);return void 0!==n?n:t.default??""}function lt(e,t,n){Y.setPluginSetting(e,t,n)}function ct(){const e=Ke.value.trim();if(!e)return;const t=Y.install(e);Je.value=t.ok,Xe.value=t.ok?"shortcut"===t.type?`安装成功:${t.id}(快捷功能,请到「快捷菜单」标签绑定槽位后使用)`:`安装成功:${t.id}`:`安装失败:${t.error||"未知错误"}`,t.ok&&(Ke.value=""),nt()}function dt(e){return et.value.has(e)}function ut(e){const t=new Set(We.value.filter((t,n)=>n!==e&&t));return Oe.value.filter(e=>"shortcut"===e.manifest.type&&!t.has(e.manifest.id))}function pt(){const e=w.value.trim();let t="";e?t=H(e):V.value?t=V.value:C.value.length&&(t=C.value[0]),GM_setValue("general.githubAccel",p.value),GM_setValue("general.backTop",m.value),GM_setValue("general.alwaysShow",h.value),GM_setValue("general.noBtnBg",g.value),GM_setValue("general.iconScale",function(e){const t=parseFloat(e);if(isNaN(t))return 1;const n=Math.floor(10*t)/10;return Math.min(4,Math.max(.6,n))}(b.value)),GM_setValue("general.menuSlots",Math.min(8,Math.max(2,parseInt(f.value,10)||4))),GM_setValue("general.quickMenu",v.value),GM_setValue("general.btnAnim",x.value),GM_setValue("general.btnRotate",y.value),GM_setValue("general.customIcon",t),GM_setValue("general.iconList",JSON.stringify(C.value)),GM_setValue("general.disabledSites",R.value);const n=tt.value;for(let e=0;eY.uninstall(e)),et.value=new Set,a("saved",t),a("close")}function mt(e){const t=d.value?.$el;t&&(e.composedPath().includes(t)||a("close"))}let ht=null;return(0,e.onMounted)(()=>{u.value=d.value?.$el.offsetHeight??0,function(){const e=d.value?.$el?.getRootNode();e&&!ht&&(ht=document.createElement("style"),ht.textContent=".sc-scroll::-webkit-scrollbar { width: 6px; }.sc-scroll::-webkit-scrollbar-track { background: transparent; }.sc-scroll::-webkit-scrollbar-thumb { background: var(--color-secondary); border-radius: 3px; }.sc-scroll::-webkit-scrollbar-thumb:hover { background: var(--color-primary); opacity: .5; }",e.appendChild(ht))}(),nt(),o.initialTab&&(j.value=o.initialTab),(0,e.nextTick)(A),setTimeout(()=>{document.addEventListener("mousedown",mt)},0)}),(0,e.watch)(C,()=>{(0,e.nextTick)(A)}),(0,e.watch)(j,t=>{"icon"===t&&(0,e.nextTick)(A)}),(0,e.onUnmounted)(()=>{if(document.removeEventListener("mousedown",mt),ht){try{ht.remove()}catch{}ht=null}}),(t,r)=>((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(n),{ref_key:"panelRef",ref:d,class:"fixed w-[300px] max-w-[80vw] h-[520px] flex flex-col box-border z-[2147483647]",style:(0,e.normalizeStyle)(D.value)},{default:(0,e.withCtx)(()=>[(0,e.createElementVNode)("div",W,[c.value?((0,e.openBlock)(),(0,e.createElementBlock)("img",{key:0,src:c.value,class:"w-5 h-5 shrink-0 object-contain",alt:l.value},null,8,X)):(0,e.createCommentVNode)("v-if",!0),(0,e.createElementVNode)("strong",J,(0,e.toDisplayString)(l.value+"设置"),1),(0,e.createElementVNode)("button",{type:"button",class:"ml-auto w-6 h-6 flex items-center justify-center rounded-md text-secondary text-lg leading-none transition-colors hover:text-primary hover:bg-white/15",title:"关闭",onClick:r[0]||(r[0]=e=>t.$emit("close"))}," × ")]),(0,e.createCommentVNode)(" 可滚动内容区 "),(0,e.createElementVNode)("div",K,[(0,e.createVNode)((0,e.unref)(i),{modelValue:j.value,"onUpdate:modelValue":r[18]||(r[18]=e=>j.value=e),items:q},{general:(0,e.withCtx)(()=>[(0,e.createCommentVNode)(" 插件加载错误通知(如 CSP 拦截) "),at.value.length?((0,e.openBlock)(),(0,e.createElementBlock)("div",Z,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(at.value,t=>((0,e.openBlock)(),(0,e.createElementBlock)("div",{key:t.id,class:"flex items-start gap-2 p-2 px-2.5 mb-1.5 text-xs leading-[1.5] rounded-lg bg-warning/15 border border-warning/40 text-warning"},[(0,e.createElementVNode)("span",Q,[(0,e.createElementVNode)("b",null,(0,e.toDisplayString)(t.name),1),(0,e.createTextVNode)(" 加载失败:"+(0,e.toDisplayString)(t.message),1),t.count>1?((0,e.openBlock)(),(0,e.createElementBlock)("span",ee,"(×"+(0,e.toDisplayString)(t.count)+")",1)):(0,e.createCommentVNode)("v-if",!0)]),(0,e.createElementVNode)("button",{type:"button",class:"shrink-0 border-none bg-transparent text-sm cursor-pointer text-inherit leading-none",onClick:e=>{return n=t.id,void Y.clearPluginError(n);var n}}," × ",8,te)]))),128))])):(0,e.createCommentVNode)("v-if",!0),(0,e.createCommentVNode)(" 主按钮设置 "),(0,e.createElementVNode)("label",ne,[(0,e.withDirectives)((0,e.createElementVNode)("input",{"onUpdate:modelValue":r[1]||(r[1]=t=>(0,e.isRef)(h)?h.value=t:null),type:"checkbox",class:"accent-accent"},null,512),[[e.vModelCheckbox,(0,e.unref)(h)]]),r[20]||(r[20]=(0,e.createTextVNode)(" 关闭智能隐藏 ",-1))]),(0,e.createElementVNode)("label",re,[(0,e.withDirectives)((0,e.createElementVNode)("input",{"onUpdate:modelValue":r[2]||(r[2]=t=>(0,e.isRef)(g)?g.value=t:null),type:"checkbox",class:"accent-accent"},null,512),[[e.vModelCheckbox,(0,e.unref)(g)]]),r[21]||(r[21]=(0,e.createTextVNode)(" 只显示图标 ",-1))]),(0,e.createElementVNode)("fieldset",oe,[r[27]||(r[27]=(0,e.createElementVNode)("legend",{class:"text-[11px] px-2 py-0.5 rounded-full bg-accent/15 text-accent font-medium"}," 图标设置 ",-1)),(0,e.createElementVNode)("div",ae,[(0,e.withDirectives)((0,e.createElementVNode)("input",{"onUpdate:modelValue":r[3]||(r[3]=t=>(0,e.isRef)(b)?b.value=t:null),type:"number",min:"0.6",max:"4",step:"0.1",title:"图标倍率(1x = 26px,最大 4x)",class:"flex-[0_0_52px] w-[52px] p-[5px_6px] text-xs leading-[1.5] border border-border rounded-lg bg-input text-primary transition-shadow focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50"},null,512),[[e.vModelText,(0,e.unref)(b)]]),r[22]||(r[22]=(0,e.createElementVNode)("span",{class:"text-secondary whitespace-nowrap"},"倍",-1)),(0,e.createElementVNode)("button",{type:"button",class:"flex-1 text-xs px-2.5 py-1 border border-border rounded-lg bg-subtle-btn text-primary cursor-pointer transition-colors hover:bg-white/15 active:scale-[0.97]",title:"设为 2x",onClick:r[4]||(r[4]=e=>b.value="2")}," 2倍 "),(0,e.createElementVNode)("button",{type:"button",class:"flex-1 text-xs px-2.5 py-1 border border-border rounded-lg bg-subtle-btn text-primary cursor-pointer transition-colors hover:bg-white/15 active:scale-[0.97]",title:"重置为默认大小",onClick:r[5]||(r[5]=e=>b.value="1")}," 默认 ")]),(0,e.createCommentVNode)(" 按钮图标动画 "),(0,e.createElementVNode)("label",ie,[r[24]||(r[24]=(0,e.createElementVNode)("span",{class:"shrink-0"},"按钮动画",-1)),(0,e.withDirectives)((0,e.createElementVNode)("select",{"onUpdate:modelValue":r[6]||(r[6]=t=>(0,e.isRef)(x)?x.value=t:null),class:"flex-1 px-1.5 py-1 text-xs border border-border rounded-lg bg-input text-primary select-text transition-shadow focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50",title:"图标动画(GIF 动图不受影响;系统开启减少动态效果时自动禁用)"},[...r[23]||(r[23]=[(0,e.createElementVNode)("option",{value:"none"},"无",-1),(0,e.createElementVNode)("option",{value:"breathe"},"呼吸",-1),(0,e.createElementVNode)("option",{value:"spin"},"旋转",-1),(0,e.createElementVNode)("option",{value:"pulse"},"脉冲",-1)])],512),[[e.vModelSelect,(0,e.unref)(x)]])]),(0,e.createCommentVNode)(" 按钮旋转角度:固定刻度 + 可输入 "),(0,e.createElementVNode)("label",se,[r[25]||(r[25]=(0,e.createElementVNode)("span",{class:"shrink-0"},"旋转",-1)),(0,e.withDirectives)((0,e.createElementVNode)("input",{"onUpdate:modelValue":r[7]||(r[7]=t=>(0,e.isRef)(y)?y.value=t:null),type:"number",min:"0",max:"360",step:"15",class:"w-16 px-1.5 py-1 text-xs border border-border rounded-lg bg-input text-primary transition-shadow focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50",title:"主按钮旋转角度(0-360°)"},null,512),[[e.vModelText,(0,e.unref)(y),void 0,{number:!0}]]),r[26]||(r[26]=(0,e.createElementVNode)("span",{class:"text-secondary text-xs"},"°",-1)),(0,e.createElementVNode)("button",{type:"button",class:"text-[11px] px-1.5 py-0.5 border border-border rounded-lg bg-subtle-btn text-primary cursor-pointer transition-colors hover:bg-white/15 active:scale-[0.97]",onClick:r[8]||(r[8]=e=>y.value=0)}," 0 "),(0,e.createElementVNode)("button",{type:"button",class:"text-[11px] px-1.5 py-0.5 border border-border rounded-lg bg-subtle-btn text-primary cursor-pointer transition-colors hover:bg-white/15 active:scale-[0.97]",onClick:r[9]||(r[9]=e=>y.value=90)}," 90 "),(0,e.createElementVNode)("button",{type:"button",class:"text-[11px] px-1.5 py-0.5 border border-border rounded-lg bg-subtle-btn text-primary cursor-pointer transition-colors hover:bg-white/15 active:scale-[0.97]",onClick:r[10]||(r[10]=e=>y.value=180)}," 180 "),(0,e.createElementVNode)("button",{type:"button",class:"text-[11px] px-1.5 py-0.5 border border-border rounded-lg bg-subtle-btn text-primary cursor-pointer transition-colors hover:bg-white/15 active:scale-[0.97]",onClick:r[11]||(r[11]=e=>y.value=270)}," 270 ")]),(0,e.createElementVNode)("div",le,[(0,e.withDirectives)((0,e.createElementVNode)("textarea",{"onUpdate:modelValue":r[12]||(r[12]=e=>w.value=e),rows:"5",placeholder:"data:image/png;base64,...",class:"flex-1 h-16 min-h-0 max-h-24 w-full box-border px-2 py-1.5 text-xs leading-[1.5] border border-border rounded-md resize-y font-[inherit] bg-input text-primary select-text"},null,512),[[e.vModelText,w.value]]),(0,e.createElementVNode)("div",{class:"flex flex-col gap-1.5 shrink-0"},[(0,e.createElementVNode)("button",{type:"button",class:"w-8 h-8 shrink-0 text-base leading-none border border-border rounded-lg bg-subtle-btn text-primary cursor-pointer transition-colors hover:bg-white/15 active:scale-[0.97]",title:"添加到图标列表",onClick:z}," + "),(0,e.createElementVNode)("button",{type:"button",class:"w-8 h-8 shrink-0 text-sm leading-none border border-border rounded-lg bg-subtle-btn text-primary cursor-pointer transition-colors hover:bg-white/15 active:scale-[0.97]",title:"上传图片并转 base64",onClick:_}," 🖼 ")]),(0,e.createElementVNode)("input",{ref_key:"fileInputRef",ref:T,type:"file",accept:"image/*",style:{display:"none"},onChange:L},null,544)]),(0,e.unref)(C).length?((0,e.openBlock)(),(0,e.createElementBlock)("div",ce,[(0,e.createElementVNode)("div",{ref_key:"listRef",ref:B,class:"flex flex-wrap gap-1 p-1",style:(0,e.normalizeStyle)({maxHeight:S.value?"none":"36px",overflow:"hidden"})},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)((0,e.unref)(C),t=>((0,e.openBlock)(),(0,e.createElementBlock)("div",{key:t,class:"relative"},[(0,e.createElementVNode)("img",{src:t,class:(0,e.normalizeClass)(["w-8 h-8 p-1 object-contain rounded-lg bg-input cursor-pointer block border transition-transform hover:scale-110",t===V.value?"border-save-border":"border-border"]),title:t.slice(0,60),onClick:e=>function(e){V.value=e,a("icon-change",e)}(t)},null,10,de),t!==(0,e.unref)(s)?((0,e.openBlock)(),(0,e.createElementBlock)("button",{key:0,type:"button",class:"absolute -top-1 -right-1 w-[13px] h-[13px] leading-none text-[10px] p-0 border-none rounded-full bg-black/60 text-white cursor-pointer flex items-center justify-center",title:"从列表移除",onClick:(0,e.withModifiers)(e=>function(e){e!==s&&(E.value="",C.value=C.value.filter(t=>t!==e),V.value===e&&(V.value=C.value[0],a("icon-change",V.value)))}(t),["stop"])}," × ",8,ue)):(0,e.createCommentVNode)("v-if",!0)]))),128))],4),S.value||N.value?((0,e.openBlock)(),(0,e.createElementBlock)("button",{key:0,type:"button",class:"mt-1.5 text-[11px] px-2 py-0.5 border border-border rounded-md bg-subtle-btn text-secondary cursor-pointer",onClick:r[13]||(r[13]=e=>S.value=!S.value)},(0,e.toDisplayString)(S.value?"收起":"展开全部("+(0,e.unref)(C).length+")"),1)):(0,e.createCommentVNode)("v-if",!0)])):(0,e.createCommentVNode)("v-if",!0),E.value?((0,e.openBlock)(),(0,e.createElementBlock)("div",pe,(0,e.toDisplayString)(E.value),1)):(0,e.createCommentVNode)("v-if",!0)]),(0,e.createElementVNode)("fieldset",me,[r[28]||(r[28]=(0,e.createElementVNode)("legend",{class:"text-[11px] px-2 py-0.5 rounded-full bg-accent/15 text-accent font-medium"}," 在以下站点禁用 ",-1)),(0,e.createCommentVNode)(" 站点(禁用返回按钮) "),(0,e.createElementVNode)("div",{class:"flex justify-between items-baseline p-0 pb-[5px]"},[(0,e.createElementVNode)("button",{type:"button",class:"!mt-0 !pt-0 text-xs px-2.5 pb-[3px] border border-border rounded-lg bg-subtle-btn text-primary cursor-pointer transition-colors hover:bg-white/15 active:scale-[0.97]",onClick:G}," 添加当前网站 ")]),(0,e.withDirectives)((0,e.createElementVNode)("textarea",{"onUpdate:modelValue":r[14]||(r[14]=t=>(0,e.isRef)(R)?R.value=t:null),rows:"3",placeholder:"例如:baidu.com",class:"w-full box-border px-2 py-1.5 text-xs leading-[1.5] border border-border rounded-lg resize-y font-[inherit] bg-input text-primary select-text transition-shadow focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50"},null,512),[[e.vModelText,(0,e.unref)(R)]])])]),menu:(0,e.withCtx)(()=>[(0,e.createElementVNode)("fieldset",he,[r[31]||(r[31]=(0,e.createElementVNode)("legend",{class:"text-[11px] px-2 py-0.5 rounded-full bg-accent/15 text-accent font-medium"}," 快捷菜单设置 ",-1)),(0,e.createElementVNode)("label",ge,[(0,e.withDirectives)((0,e.createElementVNode)("input",{"onUpdate:modelValue":r[15]||(r[15]=t=>(0,e.isRef)(v)?v.value=t:null),type:"checkbox",class:"accent-accent"},null,512),[[e.vModelCheckbox,(0,e.unref)(v)]]),r[29]||(r[29]=(0,e.createTextVNode)(" 启用快捷功能 ",-1))]),(0,e.createElementVNode)("label",be,[(0,e.withDirectives)((0,e.createElementVNode)("input",{"onUpdate:modelValue":r[16]||(r[16]=t=>(0,e.isRef)(f)?f.value=t:null),type:"number",min:"2",max:"8",step:"1",class:"w-12 px-1.5 py-1 text-xs border border-border rounded-md bg-input text-primary"},null,512),[[e.vModelText,(0,e.unref)(f)]]),r[30]||(r[30]=(0,e.createTextVNode)(" 设置快捷菜单数量 ",-1))])]),(0,e.createElementVNode)("fieldset",fe,[r[33]||(r[33]=(0,e.createElementVNode)("legend",{class:"text-[11px] px-2 py-0.5 rounded-full bg-accent/15 text-accent font-medium"}," 快捷菜单槽位绑定(保存后生效) ",-1)),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(tt.value,t=>((0,e.openBlock)(),(0,e.createElementBlock)("div",{key:t,class:"flex items-center gap-1.5 mb-1 text-xs"},[(0,e.createElementVNode)("span",ve,"槽位 "+(0,e.toDisplayString)(t),1),(0,e.withDirectives)((0,e.createElementVNode)("select",{"onUpdate:modelValue":e=>We.value[t-1]=e,class:"flex-1 px-1.5 py-1 text-xs border border-border rounded-lg bg-input text-primary select-text transition-shadow focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50"},[r[32]||(r[32]=(0,e.createElementVNode)("option",{value:""},"(空)",-1)),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(ut(t-1),t=>((0,e.openBlock)(),(0,e.createElementBlock)("option",{key:t.manifest.id,value:t.manifest.id},(0,e.toDisplayString)(t.manifest.name),9,ye))),128))],8,xe),[[e.vModelSelect,We.value[t-1]]])]))),128))])]),plugin:(0,e.withCtx)(()=>[(0,e.createElementVNode)("div",we,[(0,e.createElementVNode)("button",{type:"button",class:"mt-1.5 text-xs px-2.5 py-[3px] border border-border rounded-lg bg-subtle-btn text-primary cursor-pointer transition-colors hover:bg-white/15 active:scale-[0.97]",onClick:rt}," 从文件导入 "),(0,e.createElementVNode)("input",{ref_key:"pluginFileInputRef",ref:Ze,type:"file",accept:".js,.txt",style:{display:"none"},onChange:ot},null,544),(0,e.createElementVNode)("button",{type:"button",class:"mt-1.5 text-xs px-2.5 py-[3px] border border-border rounded-lg bg-subtle-btn text-primary cursor-pointer transition-colors hover:bg-white/15 active:scale-[0.97]",onClick:ct}," 立即安装 ")]),(0,e.withDirectives)((0,e.createElementVNode)("textarea",{"onUpdate:modelValue":r[17]||(r[17]=e=>Ke.value=e),rows:"4",placeholder:"粘贴插件代码(含 ==Plugin== 头),或点击上方导入文件后点「立即安装」...",class:"w-full box-border px-2 py-1.5 text-xs leading-[1.5] border border-border rounded-lg resize-y font-[inherit] bg-input text-primary select-text transition-shadow focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50"},null,512),[[e.vModelText,Ke.value]]),Xe.value?((0,e.openBlock)(),(0,e.createElementBlock)("span",{key:0,class:"block mt-1 text-[11px]",style:(0,e.normalizeStyle)({color:Je.value?"var(--color-save-border)":"var(--color-danger)"})},(0,e.toDisplayString)(Xe.value),5)):(0,e.createCommentVNode)("v-if",!0),Oe.value.length?((0,e.openBlock)(),(0,e.createElementBlock)("div",ke,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(Oe.value,t=>{return(0,e.openBlock)(),(0,e.createElementBlock)("div",{key:t.manifest.id,class:"mb-0.5 text-xs"},[(0,e.createElementVNode)("div",{class:"flex items-center gap-1.5 cursor-pointer py-1 rounded-lg px-1 -mx-1 transition-colors hover:bg-white/10",onClick:e=>{return n=t.manifest.id,void(Qe.value=Qe.value===n?null:n);var n}},[(0,e.createElementVNode)("span",Ce,(0,e.toDisplayString)(Qe.value===t.manifest.id?"▾":"▸"),1),t.manifest.icon?((0,e.openBlock)(),(0,e.createElementBlock)("img",{key:0,src:t.manifest.icon,class:"w-4 h-4 object-contain"},null,8,Ve)):((0,e.openBlock)(),(0,e.createElementBlock)("span",Se,(0,e.toDisplayString)((t.manifest.name||"?").charAt(0)),1)),(0,e.createElementVNode)("span",{class:"flex-1",style:(0,e.normalizeStyle)({textDecoration:dt(t.manifest.id)?"line-through":"none",opacity:dt(t.manifest.id)?.5:1})},[(0,e.createTextVNode)((0,e.toDisplayString)(t.manifest.name)+" ",1),(0,e.createElementVNode)("span",Ne,"v"+(0,e.toDisplayString)(t.manifest.version),1),t.manifest.builtin?((0,e.openBlock)(),(0,e.createElementBlock)("span",Be,"内置")):(0,e.createCommentVNode)("v-if",!0)],4)],8,Ee),Qe.value===t.manifest.id?((0,e.openBlock)(),(0,e.createElementBlock)("div",Me,[(0,e.createElementVNode)("div",null,[r[34]||(r[34]=(0,e.createTextVNode)(" 类型:",-1)),(0,e.createElementVNode)("b",null,(0,e.toDisplayString)((o=t.manifest.type,"feature"===o?"后台运行":"shortcut"===o?"快捷功能":o)),1),t.manifest.permissions&&t.manifest.permissions.length?((0,e.openBlock)(),(0,e.createElementBlock)("span",ze," · 权限:"+(0,e.toDisplayString)((t.manifest.permissions||[]).join(", ")),1)):(0,e.createCommentVNode)("v-if",!0)]),t.manifest.description?((0,e.openBlock)(),(0,e.createElementBlock)("div",Te,(0,e.toDisplayString)(t.manifest.description),1)):(0,e.createCommentVNode)("v-if",!0),dt(t.manifest.id)?((0,e.openBlock)(),(0,e.createElementBlock)("div",_e," ⚠ 卸载将清空该插件的所有数据(设置等) ")):(0,e.createCommentVNode)("v-if",!0),(0,e.createElementVNode)("div",Le,[(0,e.createElementVNode)("label",Ae,[(0,e.createElementVNode)("input",{type:"checkbox",checked:(n=t.manifest.id,Y.isEnabled(n)),onChange:e=>function(e){Y.setEnabled(e,!Y.isEnabled(e))}(t.manifest.id)},null,40,Re),r[35]||(r[35]=(0,e.createTextVNode)(" 启用 ",-1))]),t.manifest.builtin?((0,e.openBlock)(),(0,e.createElementBlock)("span",Ge,"内置")):((0,e.openBlock)(),(0,e.createElementBlock)("button",{key:0,type:"button",class:"mt-1.5 text-xs px-2.5 py-[3px] border border-border rounded-md bg-subtle-btn cursor-pointer",style:(0,e.normalizeStyle)({color:dt(t.manifest.id)?"var(--color-danger)":"var(--color-primary)"}),onClick:(0,e.withModifiers)(e=>function(e){const t=new Set(et.value);t.has(e)?t.delete(e):t.add(e),et.value=t}(t.manifest.id),["stop"])},(0,e.toDisplayString)(dt(t.manifest.id)?"取消卸载":"卸载"),13,De))]),(0,e.createCommentVNode)(" 插件设置表单 "),it(t.manifest.id).length?((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,{key:2},(0,e.renderList)(it(t.manifest.id),n=>((0,e.openBlock)(),(0,e.createElementBlock)("div",{key:n.key,class:"mt-1.5"},[(0,e.createElementVNode)("div",Ie,(0,e.toDisplayString)(n.label),1),"text"===n.type||"password"===n.type?((0,e.openBlock)(),(0,e.createElementBlock)("input",{key:0,type:n.type,value:st(t.manifest.id,n),placeholder:n.placeholder||"",class:"w-full box-border px-2 py-1.5 text-xs leading-[1.5] border border-border rounded-lg resize-y font-[inherit] bg-input text-primary select-text transition-shadow focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50",onChange:e=>lt(t.manifest.id,n.key,e.target.value)},null,40,Ue)):"textarea"===n.type?((0,e.openBlock)(),(0,e.createElementBlock)("textarea",{key:1,value:String(st(t.manifest.id,n)??""),placeholder:n.placeholder||"",rows:"4",class:"w-full box-border px-2 py-1.5 text-xs leading-[1.5] border border-border rounded-lg resize-y font-[inherit] bg-input text-primary select-text transition-shadow focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50",onChange:e=>lt(t.manifest.id,n.key,e.target.value)},null,40,He)):"select"===n.type?((0,e.openBlock)(),(0,e.createElementBlock)("select",{key:2,value:st(t.manifest.id,n),class:"flex-1 px-1.5 py-1 text-xs border border-border rounded-lg bg-input text-primary select-text transition-shadow focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50",onChange:e=>lt(t.manifest.id,n.key,e.target.value)},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(n.options||[],t=>((0,e.openBlock)(),(0,e.createElementBlock)("option",{key:t.value,value:t.value},(0,e.toDisplayString)(t.label),9,$e))),128))],40,Fe)):"checkbox"===n.type?((0,e.openBlock)(),(0,e.createElementBlock)("label",Pe,[(0,e.createElementVNode)("input",{type:"checkbox",checked:!!st(t.manifest.id,n),onChange:e=>lt(t.manifest.id,n.key,e.target.checked)},null,40,je),r[36]||(r[36]=(0,e.createTextVNode)(" 启用 ",-1))])):(0,e.createCommentVNode)("v-if",!0)]))),128)):(0,e.createCommentVNode)("v-if",!0)])):(0,e.createCommentVNode)("v-if",!0)]);var n,o}),128))])):((0,e.openBlock)(),(0,e.createElementBlock)("div",qe,"暂无插件,点击上方导入"))]),_:1},8,["modelValue"])]),(0,e.createCommentVNode)(" 底部固定操作栏 "),(0,e.createElementVNode)("div",Ye,[(0,e.createElementVNode)("button",{type:"button",class:"text-xs px-3 py-1.5 border border-border rounded-lg text-secondary cursor-pointer transition-colors hover:bg-white/10 hover:text-primary",onClick:r[19]||(r[19]=e=>t.$emit("close"))}," 取消 "),(0,e.createElementVNode)("button",{type:"button",class:"text-xs px-4 py-1.5 border border-save-border rounded-lg bg-save-btn text-white font-medium cursor-pointer shadow-sm transition hover:opacity-90 active:scale-[0.97]",onClick:pt}," 保存 ")])]),_:1},8,["style"]))}}),We=["title","onClick"],Xe={key:0,class:"text-xl font-bold leading-none pointer-events-none"},Je=["src"],Ke=(0,e.defineComponent)({__name:"QuickMenu",props:{bindings:{},slotCount:{},btnSize:{},anchorY:{}},emits:["close","slot","empty"],setup(t,{emit:n}){const r=t,o=n,a=(0,e.computed)(()=>r.bindings.filter(Boolean).length),i=(0,e.computed)(()=>{const e=[];let t=0;for(let n=0;n42*i.value.length-6+16),l=(0,e.computed)(()=>r.anchorY({top:l.value?"auto":r.btnSize+4+"px",bottom:l.value?r.btnSize+4+"px":"auto"}));return(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,null,[(0,e.createCommentVNode)(" 竖条快捷菜单:容器内 absolute 定位,内部 flex 纵向排列(浏览器自动对齐) "),(0,e.createElementVNode)("div",{style:(0,e.normalizeStyle)(c.value),class:"absolute left-1/2 -translate-x-1/2 flex flex-col items-center gap-1.5 p-1.5 rounded-full bg-panel border border-border backdrop-blur-[10px] backdrop-saturate-150 shadow-panel z-[2147483647]"},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(i.value,(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)("div",{key:n,class:(0,e.normalizeClass)(["w-9 h-9 flex items-center justify-center rounded-[10px] cursor-pointer select-none",t.isAdd?"text-menu-plus":"text-primary"]),title:t.isAdd?"点击绑定快捷功能":"",onClick:e=>function(e){o("close"),e{const e=o.req.spec;return e&&"panel"===e.type&&e.title||"插件"}),s=(0,e.computed)(()=>{const e=o.req.spec;return e&&"panel"===e.type&&e.body||[]}),l=(0,e.computed)(()=>{const e=o.btnSize??46,t=o.anchor?.x??20,n=o.anchor?.y??20;return{position:"fixed",right:t+"px",bottom:window.innerHeight-(n+e)>260?n+e+8+"px":"20px",width:"300px",maxWidth:"80vw",zIndex:2147483647,boxSizing:"border-box"}}),c=(e,t)=>{e&&a("plugin-event",o.req.pluginId,e,t)};function d(e,t){return V(e,c)}return(r,o)=>t.req&&t.req.spec?((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(n),{key:0,variant:"glass",style:(0,e.normalizeStyle)(l.value)},{default:(0,e.withCtx)(()=>[(0,e.createElementVNode)("div",Ze,[(0,e.createElementVNode)("strong",Qe,(0,e.toDisplayString)(i.value),1),(0,e.createElementVNode)("button",{type:"button",class:"ml-auto border-none bg-transparent text-base cursor-pointer text-secondary leading-none",onClick:o[0]||(o[0]=e=>r.$emit("close"))}," × ")]),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(s.value,(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)("div",{key:n,class:"mb-1.5"},[((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(d(t))))]))),128))]),_:1},8,["style"])):(0,e.createCommentVNode)("v-if",!0)}}),tt={style:{userSelect:"none",WebkitUserSelect:"none"}},nt=["src"],rt="rocket-btn-pos",ot=(0,e.defineComponent)({__name:"BackToTop",emits:["config-saved"],setup(n,{emit:r}){const o=(0,e.ref)(!1),a=(0,e.ref)(!1),i=(0,e.ref)(!1),s=(0,e.ref)(!1),l=(0,e.ref)(GM_info.script.name),c=F("general.alwaysShow",!1,$(!1)),d=F("general.noBtnBg",!1,$(!1)),u=F("general.customIcon","",Y()),p=(0,e.ref)(u.value);(0,e.watch)(u,e=>{p.value=e});const h=F("general.iconScale",1,j()),g=(0,e.ref)(h.value);function b(e){g.value=Math.min(4,Math.max(.6,e||1))}(0,e.watch)(h,e=>{g.value=e});const f=F("general.menuSlots",4,q()),v=F("general.githubAccel",!0,$(!0)),x=F("general.btnAnim","none",P("none")),y=F("general.btnRotate",0,e=>{const t=parseFloat(String(e??0));return isNaN(t)?0:Math.min(360,Math.max(0,Math.round(t)))}),w=(0,e.ref)(y.value);function k(e){w.value=e}(0,e.watch)(y,e=>{w.value=e});const E=(0,e.ref)(0),C=(0,e.computed)(()=>{E.value;const e=[];for(let t=0;t26*g.value),N=(0,e.computed)(()=>"none"===x.value?"":`sc-anim-${x.value}`),B=(0,e.computed)(()=>({width:S.value+"px",height:S.value+"px",objectFit:"cover",pointerEvents:"none"})),M=r;function z(e){p.value=H(e)}function T(e){c.value=$(!1)(GM_getValue("general.alwaysShow",!1)),d.value=$(!1)(GM_getValue("general.noBtnBg",!1)),h.value=j()(GM_getValue("general.iconScale",1)),g.value=h.value,he.value=$(!1)(GM_getValue("general.quickMenu",!1)),f.value=q()(GM_getValue("general.menuSlots",4)),u.value=Y()(GM_getValue("general.customIcon","")),p.value=H(e),y.value=(()=>{const e=parseFloat(String(GM_getValue("general.btnRotate",0)));return isNaN(e)?0:Math.min(360,Math.max(0,Math.round(e)))})(),w.value=y.value,Re(),oe(),E.value++,M("config-saved")}let _=null,L=document.documentElement,A=0;const R=[],D=function(){try{const e=GM_getValue(rt,"");return e?JSON.parse(String(e)):null}catch{return null}}(),G=(0,e.reactive)({x:D?.x??20,y:D?.y??20,fromRight:!D,fromBottom:!D});let U=0,O=0,W=!1;function X(){try{GM_setValue(rt,JSON.stringify({x:G.x,y:G.y}))}catch{}}function J(e){0===e.button&&(W=!1,U=e.clientX,O=e.clientY,i.value=!1,clearTimeout(_),_=setTimeout(()=>{W||(i.value=!0,ge.value=!1,be.value="general",a.value=!0)},600),document.addEventListener("mousemove",Z),document.addEventListener("mouseup",te))}function K(e){if(1!==e.touches.length)return;const t=e.touches[0];W=!1,U=t.clientX,O=t.clientY,i.value=!1,clearTimeout(_),_=setTimeout(()=>{W||(i.value=!0,ge.value=!1,be.value="general",a.value=!0)},600),document.addEventListener("touchmove",Q,{passive:!1}),document.addEventListener("touchend",ne)}function Z(e){ee(e.clientX,e.clientY)}function Q(e){1===e.touches.length&&(e.preventDefault(),ee(e.touches[0].clientX,e.touches[0].clientY))}function ee(e,t){const n=e-U,r=t-O;if((Math.abs(n)>3||Math.abs(r)>3)&&(W||(W=!0,a.value&&(a.value=!1),Le())),!W)return;s.value=!0;const o=window.innerHeight,i=o-t-23;G.y=Math.max(0,Math.min(o-46,i)),G.fromBottom=!0}function te(){document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",te),s.value=!1,W&&X()}function ne(){document.removeEventListener("touchmove",Q),document.removeEventListener("touchend",ne),s.value=!1,W&&X()}const re=I();function oe(){re.setEnabled("com.flowsaro.github-accel",v.value)}oe(),(0,e.watch)(v,oe),re.preheatFeatures();const ae=(0,e.ref)(null);re.onPanelRender(e=>{"close"===e.kind?ae.value=null:"panel"===e.kind&&(ae.value={kind:e.kind,spec:e.spec,pluginId:e.pluginId})}),re.onMenuRequest(()=>ye()),re.onChanged(()=>E.value++);const{toasts:ie,push:se,close:le,clearAll:ce}=function(t={}){const n=t.max??30,r=t.minTimeout??1e3,o=(0,e.ref)([]);let a=0;const i=new Map;function s(e){const t=i.get(e);void 0!==t&&(clearTimeout(t),i.delete(e))}function l(e){s(e),o.value=o.value.filter(t=>t.id!==e)}return{toasts:o,push:function(e,t){const c=t?.timeout??2500,d=0===c?0:Math.max(r,c),u={id:++a,text:e,title:t?.title,type:t?.type||"info",timeout:d,copyable:!!t?.copyable,icon:t?.icon};if(t?.reverse?o.value.push(u):o.value.unshift(u),o.value.length>n){const e=t?.reverse?o.value.shift():o.value.pop();e&&s(e.id)}return d>0&&i.set(u.id,setTimeout(()=>l(u.id),d)),u.id},close:l,clearAll:function(){i.forEach(e=>clearTimeout(e)),i.clear(),o.value=[]}}}();function de(e){try{navigator.clipboard.writeText(e.text)}catch{}}function ue(e){re.activateSlot(e)}function pe(e){be.value="menu",a.value=!0}function me(e,t,n){re.getRuntime(e)?.emitEvent(t,n)}re.onToast((e,t)=>se(e,t)),re.onDismissToast(e=>le(e)),re.onPluginUninstalled(e=>{ae.value?.pluginId===e&&(ae.value=null)});const he=F("general.quickMenu",!1,$(!1)),ge=(0,e.ref)(!1),be=(0,e.ref)("general");let fe=null;const ve=(0,e.computed)(()=>({position:"fixed",right:G.x+"px",bottom:G.y+"px",width:"46px",height:"46px",zIndex:2147483647})),xe=(0,e.computed)(()=>{const e=window.innerHeight,t=e-G.y-23,n=e-G.y,r=t<200;return{position:"fixed",right:G.x+V+8+"px",top:r?n+8+"px":t-23+"px",zIndex:2147483647}});function ye(e=!1){he.value&&(!ge.value||e?(a.value=!1,ge.value=!0):ge.value=!1)}const we=window.matchMedia("(hover: hover)").matches;let ke=null;function Ee(){we&&!s.value&&he.value&&(clearTimeout(ke),ke=setTimeout(()=>{a.value||ye(!0)},200))}function Ce(){we&&(clearTimeout(ke),ke=setTimeout(()=>{ge.value=!1},500))}function Ve(){clearTimeout(ke)}function Se(){Ce()}function Ne(){W||(i.value?i.value=!1:fe?(clearTimeout(fe),fe=null,ye()):fe=setTimeout(()=>{fe=null,function(){const e=document.scrollingElement;L===document.documentElement||L===e||L===document.body?window.scrollTo({top:0,behavior:"smooth"}):(L.scrollTo({top:0,behavior:"smooth"}),window.scrollY>0&&window.scrollTo({top:0,behavior:"smooth"}))}()},250))}function Be(e){try{return e.scrollHeight>e.clientHeight}catch{return!1}}function Me(){if(document.scrollingElement&&Be(document.scrollingElement))return document.scrollingElement;let e=null,t=0;const n=r=>{try{const n=getComputedStyle(r);("auto"===n.overflowY||"scroll"===n.overflowY)&&Be(r)&&r.scrollHeight>t&&(e=r,t=r.scrollHeight)}catch{}for(const e of Array.from(r.children))n(e)};if(n(document.body),e)return e;const r=[document.body,...Array.from(document.body.children)];for(const e of r)if(e&&e.scrollTop>0)return e;return document.documentElement}function ze(){const e=document.scrollingElement,t=window.scrollY||(e?e.scrollTop:0)||document.body.scrollTop||0;if(L===document.documentElement||L===e||L===document.body)return t;const n=L.scrollTop||0;return Math.max(t,n)}function Te(){const e=ze();e>A?o.value=!1:e200),A=e}function _e(e){const t=e.target;t===document||t===document.documentElement||t===document.body||!function(){const e=document.scrollingElement;return!!e&&e.scrollHeight>e.clientHeight}()&&(Be(t)||t.scrollTop>0)&&t!==L&&(L.removeEventListener("scroll",_e),L=t,L.addEventListener("scroll",_e,{passive:!0}),A=ze()),Te()}function Le(){_&&clearTimeout(_)}const Ae=(0,e.reactive)({position:"absolute",left:"0",top:"0",width:"100%",height:"100%",zIndex:1,opacity:"0",visibility:"hidden",transform:"translateY(8px)",transition:"opacity .25s ease, visibility .25s ease, transform .25s ease",background:d.value?"transparent":"var(--color-btn)",backdropFilter:d.value?"none":"blur(10px) saturate(150%)",WebkitBackdropFilter:d.value?"none":"blur(10px) saturate(150%)"});function Re(){Ae.background=d.value?"transparent":"var(--color-btn)",Ae.backdropFilter=d.value?"none":"blur(10px) saturate(150%)",Ae.WebkitBackdropFilter=d.value?"none":"blur(10px) saturate(150%)"}function De(){ze()<=200&&(o.value=!1),p.value=u.value,w.value=y.value,g.value=h.value,a.value=!1}function Ge(){re.handleSelectionChange(window.getSelection()?.toString()||"")}return(0,e.watch)(d,Re),(0,e.onMounted)(()=>{L=Me(),L.addEventListener("scroll",_e,{passive:!0}),document.addEventListener("scroll",_e,{passive:!0,capture:!0}),window.addEventListener("resize",Te,{passive:!0}),document.addEventListener("selectionchange",Ge),Te(),setTimeout(()=>{const e=Me();e!==L&&(L.removeEventListener("scroll",_e),L=e,L.addEventListener("scroll",_e,{passive:!0}),A=ze(),Te())},2e3)}),(0,e.onUnmounted)(()=>{L.removeEventListener("scroll",_e),document.removeEventListener("scroll",_e,{capture:!0}),window.removeEventListener("resize",Te),document.removeEventListener("selectionchange",Ge),function(){for(const[e,t,n]of R)e.removeEventListener(t,n);R.length=0}(),re.disposeAll()}),(0,e.watch)([o,a,s,c,ge],function(){c.value||o.value||a.value||s.value||ge.value?(Ae.opacity="1",Ae.visibility="visible",Ae.transform="none"):(Ae.opacity="0",Ae.visibility="hidden",Ae.transform="translateY(8px)")},{immediate:!0}),(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,null,[(0,e.createCommentVNode)(" user-select: none 防止选中脚本自身 UI 触发 selectionchange(套娃);编辑输入框单独恢复 "),(0,e.createElementVNode)("div",tt,[(0,e.createCommentVNode)(" 快捷菜单全屏遮罩:点击外部关闭 "),ge.value?((0,e.openBlock)(),(0,e.createElementBlock)("div",{key:0,style:{position:"fixed",inset:"0",zIndex:2147483646},onMousedown:r[0]||(r[0]=e=>ge.value=!1),onTouchstart:r[1]||(r[1]=e=>ge.value=!1)},null,32)):(0,e.createCommentVNode)("v-if",!0),(0,e.createCommentVNode)(" 锚点容器:按钮 + 快捷菜单同容器(hover 容器,鼠标在按钮或菜单上都不消失) "),(0,e.createElementVNode)("div",{style:(0,e.normalizeStyle)(ve.value),onMouseenter:Ee,onMouseleave:r[4]||(r[4]=e=>Ce())},[(0,e.createVNode)((0,e.unref)(t),{dragging:s.value,transparent:(0,e.unref)(d),size:(0,e.unref)(V),round:"",style:(0,e.normalizeStyle)(Ae),title:l.value+"(长按设置)",onMouseleave:r[2]||(r[2]=e=>Le()),onClick:Ne,onMousedown:J,onTouchstart:K,onMouseup:Le,onTouchend:Le,onTouchcancel:Le},{default:(0,e.withCtx)(()=>[(0,e.createCommentVNode)(" 旋转应用到外层 wrapper(不动画冲突);动画类作用在 img 上 "),(0,e.createElementVNode)("div",{class:"flex items-center justify-center w-full h-full overflow-hidden rounded-full",style:(0,e.normalizeStyle)({transform:"rotate("+w.value+"deg)"})},[(0,e.createElementVNode)("img",{src:p.value,class:(0,e.normalizeClass)(N.value),style:(0,e.normalizeStyle)(B.value)},null,14,nt)],4)]),_:1},8,["dragging","transparent","size","style","title"]),ge.value?((0,e.openBlock)(),(0,e.createBlock)(Ke,{key:0,bindings:C.value,"slot-count":(0,e.unref)(f),"btn-size":(0,e.unref)(V),"anchor-y":G.y,onClose:r[3]||(r[3]=e=>ge.value=!1),onSlot:ue,onEmpty:pe,onMouseenter:Ve,onMouseleave:Se},null,8,["bindings","slot-count","btn-size","anchor-y"])):(0,e.createCommentVNode)("v-if",!0)],36),(0,e.createCommentVNode)(" Toast 独立定位(按钮上方,空间不足放下方) "),(0,e.createVNode)((0,e.unref)(m),{toasts:(0,e.unref)(ie),style:(0,e.normalizeStyle)(xe.value),onClose:(0,e.unref)(le),onCopy:de,onClearAll:(0,e.unref)(ce)},null,8,["toasts","style","onClose","onClearAll"]),a.value?((0,e.openBlock)(),(0,e.createBlock)(Oe,{key:1,anchor:{x:G.x,y:G.y},"btn-size":(0,e.unref)(V),"initial-tab":be.value,onClose:De,onIconChange:z,onRotateChange:k,onScaleChange:b,onSaved:T},null,8,["anchor","btn-size","initial-tab"])):(0,e.createCommentVNode)("v-if",!0),ae.value?((0,e.openBlock)(),(0,e.createBlock)(et,{key:2,req:ae.value,anchor:{x:G.x,y:G.y},"btn-size":(0,e.unref)(V),onClose:r[5]||(r[5]=e=>ae.value=null),onPluginEvent:me},null,8,["req","anchor","btn-size"])):(0,e.createCommentVNode)("v-if",!0)])],2112))}}),at=(0,e.defineComponent)({__name:"App",setup(t){let n=!1;function r(){if(n)return;const t=function(){const t=(0,e.getCurrentInstance)()?.vnode?.el;if(!t)return null;const n=t.getRootNode();return n instanceof ShadowRoot&&n.host instanceof HTMLElement?n.host:null}(),r=t?.shadowRoot;if(!r)return;const o=document.createElement("style");o.dataset.scTheme="1",o.textContent='/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer base {\n *, ::after, ::before, ::backdrop, ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html, :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-family: var(--default-font-family, -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, \'Helvetica Neue\', \'Noto Sans\', Arial, sans-serif, \'Apple Color Emoji\', \'Segoe UI Emoji\', \'Segoe UI Symbol\', \'Noto Color Emoji\');\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1, h2, h3, h4, h5, h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b, strong {\n font-weight: bolder;\n }\n code, kbd, samp, pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \'Liberation Mono\', \'Courier New\', monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub, sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring:where(:not(iframe)) {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol, ul, menu {\n list-style: none;\n }\n img, svg, video, canvas, audio, iframe, embed, object {\n display: block;\n vertical-align: middle;\n }\n img, video {\n max-width: 100%;\n height: auto;\n }\n button, input, select, optgroup, textarea, ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n ::-webkit-calendar-picker-indicator {\n line-height: 1;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button, input:where([type=\'button\'], [type=\'reset\'], [type=\'submit\']), ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=\'until-found\'])) {\n display: none !important;\n }\n}\n@layer theme {\n :root, :host {\n --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial,\n sans-serif;\n --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \'Liberation Mono\', \'Courier New\',\n monospace;\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\n --text-xs: 0.75rem;\n --text-xs--line-height: calc(1 / 0.75);\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-base: 1rem;\n --text-base--line-height: calc(1.5 / 1);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --text-xl: 1.25rem;\n --text-xl--line-height: calc(1.75 / 1.25);\n --font-weight-medium: 500;\n --font-weight-semibold: 600;\n --font-weight-bold: 700;\n --radius-md: 0.375rem;\n --radius-lg: 0.5rem;\n --radius-xl: 0.75rem;\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n --default-font-family: var(--font-sans);\n --default-mono-font-family: var(--font-mono);\n --spacing-0\\.5: 0.125rem;\n --spacing-1\\.5: 0.375rem;\n --spacing-2\\.5: 0.625rem;\n --spacing-3\\.5: 0.875rem;\n --color-panel: rgba(255, 255, 255, 0.8);\n --color-border: rgba(0, 0, 0, 0.08);\n --color-primary: #24292f;\n --color-secondary: #57606a;\n --color-input: rgba(255, 255, 255, 0.6);\n --color-subtle-btn: rgba(0, 0, 0, 0.05);\n --color-save-btn: rgba(31, 136, 61, 0.9);\n --color-save-border: #1f883d;\n --color-btn: rgba(255, 255, 255, 0.8);\n --color-btn-hover: rgba(255, 255, 255, 0.88);\n --color-menu-plus: #111418;\n --color-accent: #2f81f7;\n --color-success: #3fb950;\n --color-warning: #d29922;\n --color-danger: #f85149;\n }\n}\n@layer utilities {\n .pointer-events-none {\n pointer-events: none;\n }\n .visible {\n visibility: visible;\n }\n .absolute {\n position: absolute;\n }\n .fixed {\n position: fixed;\n }\n .relative {\n position: relative;\n }\n .-top-1 {\n top: calc(var(--spacing) * -1);\n }\n .-right-1 {\n right: calc(var(--spacing) * -1);\n }\n .left-1\\/2 {\n left: calc(1 / 2 * 100%);\n }\n .z-\\[2147483647\\] {\n z-index: 2147483647;\n }\n .-mx-1 {\n margin-inline: calc(var(--spacing) * -1);\n }\n .-mx-2 {\n margin-inline: calc(var(--spacing) * -2);\n }\n .my-2 {\n margin-block: calc(var(--spacing) * 2);\n }\n .\\!mt-0 {\n margin-top: 0px !important;\n }\n .mt-1 {\n margin-top: var(--spacing);\n }\n .mt-1\\.5 {\n margin-top: var(--spacing-1\\.5);\n }\n .mt-2\\.5 {\n margin-top: var(--spacing-2\\.5);\n }\n .mt-3\\.5 {\n margin-top: var(--spacing-3\\.5);\n }\n .-mr-1\\.5 {\n margin-right: calc(var(--spacing-1\\.5) * -1);\n }\n .mb-0\\.5 {\n margin-bottom: var(--spacing-0\\.5);\n }\n .mb-1 {\n margin-bottom: var(--spacing);\n }\n .mb-1\\.5 {\n margin-bottom: var(--spacing-1\\.5);\n }\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2);\n }\n .mb-2\\.5 {\n margin-bottom: var(--spacing-2\\.5);\n }\n .mb-3 {\n margin-bottom: calc(var(--spacing) * 3);\n }\n .mb-4 {\n margin-bottom: calc(var(--spacing) * 4);\n }\n .ml-1 {\n margin-left: var(--spacing);\n }\n .ml-auto {\n margin-left: auto;\n }\n .box-border {\n box-sizing: border-box;\n }\n .block {\n display: block;\n }\n .flex {\n display: flex;\n }\n .hidden {\n display: none;\n }\n .inline-block {\n display: inline-block;\n }\n .h-4 {\n height: calc(var(--spacing) * 4);\n }\n .h-5 {\n height: calc(var(--spacing) * 5);\n }\n .h-6 {\n height: calc(var(--spacing) * 6);\n }\n .h-8 {\n height: calc(var(--spacing) * 8);\n }\n .h-9 {\n height: calc(var(--spacing) * 9);\n }\n .h-16 {\n height: calc(var(--spacing) * 16);\n }\n .h-\\[13px\\] {\n height: 13px;\n }\n .h-\\[520px\\] {\n height: 520px;\n }\n .h-full {\n height: 100%;\n }\n .max-h-24 {\n max-height: calc(var(--spacing) * 24);\n }\n .max-h-\\[160px\\] {\n max-height: 160px;\n }\n .min-h-0 {\n min-height: 0px;\n }\n .min-h-12 {\n min-height: calc(var(--spacing) * 12);\n }\n .min-h-\\[46px\\] {\n min-height: 46px;\n }\n .w-4 {\n width: calc(var(--spacing) * 4);\n }\n .w-5 {\n width: calc(var(--spacing) * 5);\n }\n .w-6 {\n width: calc(var(--spacing) * 6);\n }\n .w-8 {\n width: calc(var(--spacing) * 8);\n }\n .w-9 {\n width: calc(var(--spacing) * 9);\n }\n .w-12 {\n width: calc(var(--spacing) * 12);\n }\n .w-16 {\n width: calc(var(--spacing) * 16);\n }\n .w-\\[13px\\] {\n width: 13px;\n }\n .w-\\[52px\\] {\n width: 52px;\n }\n .w-\\[300px\\] {\n width: 300px;\n }\n .w-full {\n width: 100%;\n }\n .max-w-\\[80vw\\] {\n max-width: 80vw;\n }\n .max-w-full {\n max-width: 100%;\n }\n .min-w-0 {\n min-width: 0px;\n }\n .flex-1 {\n flex: 1;\n }\n .flex-\\[0_0_14px\\] {\n flex: 0 0 14px;\n }\n .flex-\\[0_0_44px\\] {\n flex: 0 0 44px;\n }\n .flex-\\[0_0_52px\\] {\n flex: 0 0 52px;\n }\n .shrink-0 {\n flex-shrink: 0;\n }\n .-translate-x-1\\/2 {\n --tw-translate-x: calc(calc(1 / 2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .transform {\n transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);\n }\n .cursor-grab {\n cursor: grab;\n }\n .cursor-pointer {\n cursor: pointer;\n }\n .touch-none {\n touch-action: none;\n }\n .resize {\n resize: both;\n }\n .resize-y {\n resize: vertical;\n }\n .flex-col {\n flex-direction: column;\n }\n .flex-wrap {\n flex-wrap: wrap;\n }\n .items-baseline {\n align-items: baseline;\n }\n .items-center {\n align-items: center;\n }\n .items-start {\n align-items: flex-start;\n }\n .justify-between {\n justify-content: space-between;\n }\n .justify-center {\n justify-content: center;\n }\n .justify-end {\n justify-content: flex-end;\n }\n .gap-1 {\n gap: var(--spacing);\n }\n .gap-1\\.5 {\n gap: var(--spacing-1\\.5);\n }\n .gap-2 {\n gap: calc(var(--spacing) * 2);\n }\n .overflow-hidden {\n overflow: hidden;\n }\n .overflow-x-hidden {\n overflow-x: hidden;\n }\n .overflow-y-auto {\n overflow-y: auto;\n }\n .rounded {\n border-radius: 0.25rem;\n }\n .rounded-\\[10px\\] {\n border-radius: 10px;\n }\n .rounded-full {\n border-radius: calc(infinity * 1px);\n }\n .rounded-lg {\n border-radius: var(--radius-lg);\n }\n .rounded-md {\n border-radius: var(--radius-md);\n }\n .rounded-xl {\n border-radius: var(--radius-xl);\n }\n .border {\n border-style: var(--tw-border-style);\n border-width: 1px;\n }\n .border-0 {\n border-style: var(--tw-border-style);\n border-width: 0px;\n }\n .border-t {\n border-top-style: var(--tw-border-style);\n border-top-width: 1px;\n }\n .border-b {\n border-bottom-style: var(--tw-border-style);\n border-bottom-width: 1px;\n }\n .border-none {\n --tw-border-style: none;\n border-style: none;\n }\n .border-border {\n border-color: var(--color-border);\n }\n .border-save-border {\n border-color: var(--color-save-border);\n }\n .border-transparent {\n border-color: transparent;\n }\n .border-warning\\/40 {\n border-color: color-mix(in srgb, #d29922 40%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n border-color: color-mix(in oklab, var(--color-warning) 40%, transparent);\n }\n }\n .bg-accent\\/15 {\n background-color: color-mix(in srgb, #2f81f7 15%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-accent) 15%, transparent);\n }\n }\n .bg-accent\\/20 {\n background-color: color-mix(in srgb, #2f81f7 20%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-accent) 20%, transparent);\n }\n }\n .bg-black\\/60 {\n background-color: color-mix(in srgb, #000 60%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 60%, transparent);\n }\n }\n .bg-btn {\n background-color: var(--color-btn);\n }\n .bg-input {\n background-color: var(--color-input);\n }\n .bg-panel {\n background-color: var(--color-panel);\n }\n .bg-save-btn {\n background-color: var(--color-save-btn);\n }\n .bg-subtle-btn {\n background-color: var(--color-subtle-btn);\n }\n .bg-transparent {\n background-color: transparent;\n }\n .bg-warning\\/15 {\n background-color: color-mix(in srgb, #d29922 15%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-warning) 15%, transparent);\n }\n }\n .object-contain {\n object-fit: contain;\n }\n .p-0 {\n padding: 0px;\n }\n .p-1 {\n padding: var(--spacing);\n }\n .p-1\\.5 {\n padding: var(--spacing-1\\.5);\n }\n .p-2 {\n padding: calc(var(--spacing) * 2);\n }\n .p-3 {\n padding: calc(var(--spacing) * 3);\n }\n .p-\\[2px_10px_8px_4px\\] {\n padding: 2px 10px 8px 4px;\n }\n .p-\\[5px_6px\\] {\n padding: 5px 6px;\n }\n .px-1 {\n padding-inline: var(--spacing);\n }\n .px-1\\.5 {\n padding-inline: var(--spacing-1\\.5);\n }\n .px-2 {\n padding-inline: calc(var(--spacing) * 2);\n }\n .px-2\\.5 {\n padding-inline: var(--spacing-2\\.5);\n }\n .px-3 {\n padding-inline: calc(var(--spacing) * 3);\n }\n .px-4 {\n padding-inline: calc(var(--spacing) * 4);\n }\n .py-0\\.5 {\n padding-block: var(--spacing-0\\.5);\n }\n .py-1 {\n padding-block: var(--spacing);\n }\n .py-1\\.5 {\n padding-block: var(--spacing-1\\.5);\n }\n .py-\\[1px\\] {\n padding-block: 1px;\n }\n .py-\\[3px\\] {\n padding-block: 3px;\n }\n .\\!pt-0 {\n padding-top: 0px !important;\n }\n .pt-2\\.5 {\n padding-top: var(--spacing-2\\.5);\n }\n .pb-3 {\n padding-bottom: calc(var(--spacing) * 3);\n }\n .pb-\\[3px\\] {\n padding-bottom: 3px;\n }\n .pb-\\[5px\\] {\n padding-bottom: 5px;\n }\n .pl-\\[30px\\] {\n padding-left: 30px;\n }\n .font-\\[inherit\\] {\n font-family: inherit;\n }\n .text-base {\n font-size: var(--text-base);\n line-height: var(--tw-leading, var(--text-base--line-height));\n }\n .text-lg {\n font-size: var(--text-lg);\n line-height: var(--tw-leading, var(--text-lg--line-height));\n }\n .text-sm {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n .text-xl {\n font-size: var(--text-xl);\n line-height: var(--tw-leading, var(--text-xl--line-height));\n }\n .text-xs {\n font-size: var(--text-xs);\n line-height: var(--tw-leading, var(--text-xs--line-height));\n }\n .text-\\[10px\\] {\n font-size: 10px;\n }\n .text-\\[11px\\] {\n font-size: 11px;\n }\n .text-\\[13px\\] {\n font-size: 13px;\n }\n .leading-\\[1\\.5\\] {\n --tw-leading: 1.5;\n line-height: 1.5;\n }\n .leading-none {\n --tw-leading: 1;\n line-height: 1;\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold);\n font-weight: var(--font-weight-bold);\n }\n .font-medium {\n --tw-font-weight: var(--font-weight-medium);\n font-weight: var(--font-weight-medium);\n }\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold);\n font-weight: var(--font-weight-semibold);\n }\n .break-words {\n overflow-wrap: break-word;\n }\n .whitespace-nowrap {\n white-space: nowrap;\n }\n .whitespace-pre-wrap {\n white-space: pre-wrap;\n }\n .text-accent {\n color: var(--color-accent);\n }\n .text-danger {\n color: var(--color-danger);\n }\n .text-inherit {\n color: inherit;\n }\n .text-menu-plus {\n color: var(--color-menu-plus);\n }\n .text-primary {\n color: var(--color-primary);\n }\n .text-secondary {\n color: var(--color-secondary);\n }\n .text-warning {\n color: var(--color-warning);\n }\n .text-white {\n color: var(--color-white);\n }\n .line-through {\n text-decoration-line: line-through;\n }\n .no-underline {\n text-decoration-line: none;\n }\n .accent-accent {\n accent-color: var(--color-accent);\n }\n .opacity-60 {\n opacity: 60%;\n }\n .shadow {\n --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .shadow-btn {\n --tw-shadow: 0 4px 24px var(--tw-shadow-color, rgba(0, 0, 0, 0.12)), inset 0 0.5px 0 var(--tw-shadow-color, rgba(255, 255, 255, 0.6));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .shadow-none {\n --tw-shadow: 0 0 #0000;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .shadow-panel {\n --tw-shadow: 0 4px 24px var(--tw-shadow-color, rgba(0, 0, 0, 0.12)), inset 0 0.5px 0 var(--tw-shadow-color, rgba(255, 255, 255, 0.6));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .shadow-sm {\n --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .backdrop-blur-\\[10px\\] {\n --tw-backdrop-blur: blur(10px);\n -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n }\n .backdrop-saturate-150 {\n --tw-backdrop-saturate: saturate(150%);\n -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n }\n .backdrop-filter {\n -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n }\n .transition {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-\\[margin-top\\] {\n transition-property: margin-top;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-colors {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-shadow {\n transition-property: box-shadow;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-transform {\n transition-property: transform, translate, scale, rotate;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .duration-200 {\n --tw-duration: 200ms;\n transition-duration: 200ms;\n }\n .select-none {\n -webkit-user-select: none;\n user-select: none;\n }\n .select-text {\n -webkit-user-select: text;\n user-select: text;\n }\n @media (hover: hover) {\n .hover\\:scale-110:hover {\n --tw-scale-x: 110%;\n --tw-scale-y: 110%;\n --tw-scale-z: 110%;\n scale: var(--tw-scale-x) var(--tw-scale-y);\n }\n .hover\\:bg-btn-hover:hover {\n background-color: var(--color-btn-hover);\n }\n .hover\\:bg-white\\/10:hover {\n background-color: color-mix(in srgb, #fff 10%, transparent);\n }\n @supports (color: color-mix(in lab, red, red)) {\n .hover\\:bg-white\\/10:hover {\n background-color: color-mix(in oklab, var(--color-white) 10%, transparent);\n }\n }\n .hover\\:bg-white\\/15:hover {\n background-color: color-mix(in srgb, #fff 15%, transparent);\n }\n @supports (color: color-mix(in lab, red, red)) {\n .hover\\:bg-white\\/15:hover {\n background-color: color-mix(in oklab, var(--color-white) 15%, transparent);\n }\n }\n .hover\\:text-primary:hover {\n color: var(--color-primary);\n }\n .hover\\:opacity-90:hover {\n opacity: 90%;\n }\n .hover\\:shadow-btn-hover:hover {\n --tw-shadow: 0 6px 28px var(--tw-shadow-color, rgba(0, 0, 0, 0.16)), inset 0 0.5px 0 var(--tw-shadow-color, rgba(255, 255, 255, 0.8));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n }\n .focus\\:border-accent\\/50:focus {\n border-color: color-mix(in srgb, #2f81f7 50%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n border-color: color-mix(in oklab, var(--color-accent) 50%, transparent);\n }\n }\n .focus\\:ring-2:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .focus\\:ring-accent\\/30:focus {\n --tw-ring-color: color-mix(in srgb, #2f81f7 30%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--color-accent) 30%, transparent);\n }\n }\n .focus\\:outline-none:focus {\n --tw-outline-style: none;\n outline-style: none;\n }\n .active\\:scale-\\[0\\.97\\]:active {\n scale: 0.97;\n }\n}\n:host {\n font-family: var(--font-sans);\n}\n@layer base {\n button,\n input,\n select,\n textarea {\n font: inherit;\n color: inherit;\n margin: 0;\n }\n button {\n appearance: none;\n -webkit-appearance: none;\n background: none;\n padding: 0;\n }\n button:not(:disabled) {\n cursor: pointer;\n }\n}\n@media (prefers-color-scheme: dark) {\n :host {\n --color-panel: rgba(30, 30, 30, 0.8);\n --color-border: rgba(255, 255, 255, 0.15);\n --color-primary: #f0f6fc;\n --color-secondary: #8b949e;\n --color-input: rgba(13, 17, 23, 0.6);\n --color-subtle-btn: rgba(255, 255, 255, 0.12);\n --color-save-btn: rgba(35, 134, 54, 0.9);\n --color-save-border: #238636;\n --color-btn: rgba(30, 30, 30, 0.8);\n --color-btn-hover: rgba(45, 45, 45, 0.88);\n --color-menu-plus: #ffffff;\n --shadow-panel: 0 4px 24px rgba(0, 0, 0, 0.4), inset 0 0.5px 0 rgba(255, 255, 255, 0.06);\n --shadow-btn: 0 4px 24px rgba(0, 0, 0, 0.4), inset 0 0.5px 0 rgba(255, 255, 255, 0.06);\n --shadow-btn-hover: 0 6px 28px rgba(0, 0, 0, 0.5), inset 0 0.5px 0 rgba(255, 255, 255, 0.08);\n }\n}\n@keyframes sc-breathe {\n 0%,\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.65;\n transform: scale(0.9);\n }\n}\n@keyframes sc-spin {\n to {\n transform: rotate(360deg);\n }\n}\n@keyframes sc-pulse {\n 0%,\n 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.15);\n }\n}\n.sc-anim-breathe {\n animation: sc-breathe 2.6s ease-in-out infinite;\n}\n.sc-anim-spin {\n animation: sc-spin 5s linear infinite;\n}\n.sc-anim-pulse {\n animation: sc-pulse 1.8s ease-in-out infinite;\n}\n@media (prefers-reduced-motion: reduce) {\n .sc-anim-breathe,\n .sc-anim-spin,\n .sc-anim-pulse {\n animation: none;\n }\n}\n@property --tw-translate-x {\n syntax: "*";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-y {\n syntax: "*";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-z {\n syntax: "*";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-rotate-x {\n syntax: "*";\n inherits: false;\n}\n@property --tw-rotate-y {\n syntax: "*";\n inherits: false;\n}\n@property --tw-rotate-z {\n syntax: "*";\n inherits: false;\n}\n@property --tw-skew-x {\n syntax: "*";\n inherits: false;\n}\n@property --tw-skew-y {\n syntax: "*";\n inherits: false;\n}\n@property --tw-border-style {\n syntax: "*";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-leading {\n syntax: "*";\n inherits: false;\n}\n@property --tw-font-weight {\n syntax: "*";\n inherits: false;\n}\n@property --tw-shadow {\n syntax: "*";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-shadow-color {\n syntax: "*";\n inherits: false;\n}\n@property --tw-shadow-alpha {\n syntax: "";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-inset-shadow {\n syntax: "*";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-shadow-color {\n syntax: "*";\n inherits: false;\n}\n@property --tw-inset-shadow-alpha {\n syntax: "";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-ring-color {\n syntax: "*";\n inherits: false;\n}\n@property --tw-ring-shadow {\n syntax: "*";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-ring-color {\n syntax: "*";\n inherits: false;\n}\n@property --tw-inset-ring-shadow {\n syntax: "*";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-ring-inset {\n syntax: "*";\n inherits: false;\n}\n@property --tw-ring-offset-width {\n syntax: "";\n inherits: false;\n initial-value: 0px;\n}\n@property --tw-ring-offset-color {\n syntax: "*";\n inherits: false;\n initial-value: #fff;\n}\n@property --tw-ring-offset-shadow {\n syntax: "*";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-backdrop-blur {\n syntax: "*";\n inherits: false;\n}\n@property --tw-backdrop-brightness {\n syntax: "*";\n inherits: false;\n}\n@property --tw-backdrop-contrast {\n syntax: "*";\n inherits: false;\n}\n@property --tw-backdrop-grayscale {\n syntax: "*";\n inherits: false;\n}\n@property --tw-backdrop-hue-rotate {\n syntax: "*";\n inherits: false;\n}\n@property --tw-backdrop-invert {\n syntax: "*";\n inherits: false;\n}\n@property --tw-backdrop-opacity {\n syntax: "*";\n inherits: false;\n}\n@property --tw-backdrop-saturate {\n syntax: "*";\n inherits: false;\n}\n@property --tw-backdrop-sepia {\n syntax: "*";\n inherits: false;\n}\n@property --tw-duration {\n syntax: "*";\n inherits: false;\n}\n@property --tw-scale-x {\n syntax: "*";\n inherits: false;\n initial-value: 1;\n}\n@property --tw-scale-y {\n syntax: "*";\n inherits: false;\n initial-value: 1;\n}\n@property --tw-scale-z {\n syntax: "*";\n inherits: false;\n initial-value: 1;\n}\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *, ::before, ::after, ::backdrop {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-rotate-x: initial;\n --tw-rotate-y: initial;\n --tw-rotate-z: initial;\n --tw-skew-x: initial;\n --tw-skew-y: initial;\n --tw-border-style: solid;\n --tw-leading: initial;\n --tw-font-weight: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-backdrop-blur: initial;\n --tw-backdrop-brightness: initial;\n --tw-backdrop-contrast: initial;\n --tw-backdrop-grayscale: initial;\n --tw-backdrop-hue-rotate: initial;\n --tw-backdrop-invert: initial;\n --tw-backdrop-opacity: initial;\n --tw-backdrop-saturate: initial;\n --tw-backdrop-sepia: initial;\n --tw-duration: initial;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-scale-z: 1;\n }\n }\n}\n',r.appendChild(o),n=!0}(0,e.onMounted)(()=>{r()});const o=F("general.backTop",!0,$(!0)),a=F("general.disabledSites","",O()),i=(0,e.computed)(()=>a.value.split("\n").map(e=>e.trim()).filter(Boolean)),s=location.hostname.toLowerCase(),l=(0,e.computed)(()=>i.value.some(e=>{const t=e.toLowerCase().replace(/^https?:\/\//,"");return t&&(s===t||s.endsWith("."+t))}));return(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,null,[(0,e.createCommentVNode)(" GitHub 加速已插件化(内置 com.flowsaro.github-accel,由 BackToTop 管理开关) "),(0,e.unref)(o)&&!l.value?((0,e.openBlock)(),(0,e.createBlock)(ot,{key:0})):(0,e.createCommentVNode)("v-if",!0)],2112))}}),it=at,st="app-QGNvbS5mbG93c2Fyby9yb2NrZXRfYnRu";let lt=document.getElementById(st);if(lt||(lt=document.createElement("div"),lt.id=st,lt.style.cssText="all: initial; position: fixed; z-index: 2147483647; pointer-events: none;",document.body?document.body.appendChild(lt):document.addEventListener("DOMContentLoaded",()=>document.body.appendChild(lt))),!lt.__shadowMount){const e=lt.attachShadow({mode:"open"}),t=document.createElement("div");t.style.cssText="pointer-events: auto;",e.appendChild(t),lt.__shadowMount=t}(0,e.createApp)(it).mount(lt.__shadowMount)})();