ai-helper-agent 2.8.11 → 2.8.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{chat-export-DIK7kXq9.js → chat-export-DZntnUPd.js} +4 -4
- package/dist/assets/content.js +88 -81
- package/dist/assets/{context-indicator-CHdsVqH3.js → context-indicator-BSGa1g7l.js} +228 -228
- package/dist/assets/options.js +8 -8
- package/dist/assets/side_panel.js +141 -141
- package/dist/assets/version-Dc9zhEVX.js +172 -0
- package/dist/assets/voice-shortcut-Dx863RGz.js +3 -0
- package/dist/manifest.json +2 -3
- package/dist/options.html +2 -2
- package/dist/side_panel.html +4 -4
- package/package.json +1 -1
- package/dist/assets/version-kRemUQxx.js +0 -174
- package/dist/assets/voice-shortcut-Dtt3nhkz.js +0 -1
package/dist/assets/content.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var
|
|
1
|
+
(()=>{var yt={DEBUG:0,INFO:1,WARN:2,ERROR:3},at=yt.DEBUG;function Ni(e){at=e}function Li(){return at}function Fi(...e){at<=yt.DEBUG&&console.debug("[AIH]",...e)}function Oi(...e){at<=yt.INFO&&console.info("[AIH]",...e)}function _i(...e){at<=yt.WARN&&console.warn("[AIH]",...e)}function Hi(...e){at<=yt.ERROR&&console.error("[AIH]",...e)}var j={debug:Fi,info:Oi,warn:_i,error:Hi,setLogLevel:Ni,getLogLevel:Li},Bi={common:{confirm:"\u786E\u8BA4",cancel:"\u53D6\u6D88",close:"\u5173\u95ED",ok:"\u786E\u5B9A",save:"\u4FDD\u5B58",delete:"\u5220\u9664",edit:"\u7F16\u8F91",retry:"\u91CD\u8BD5",loading:"\u52A0\u8F7D\u4E2D...",none:"\u65E0",add:"\u6DFB\u52A0",clear:"\u6E05\u7A7A",selectAll:"\u5168\u9009",deselectAll:"\u53D6\u6D88\u5168\u9009",refresh:"\u5237\u65B0",enabled:"\u5DF2\u542F\u7528",disabled:"\u5DF2\u505C\u7528",bytes:"\u5B57\u8282",copy:"\u590D\u5236",copySuccess:"\u5DF2\u590D\u5236",copyFailed:"\u590D\u5236\u5931\u8D25"},dialog:{operationConfirm:"\u64CD\u4F5C\u786E\u8BA4",confirmDefaultMessage:"\u6A21\u578B\u8BF7\u6C42\u6267\u884C\u654F\u611F\u64CD\u4F5C\uFF0C\u662F\u5426\u5141\u8BB8\uFF1F",confirmAction:"\u6A21\u578B\u8BF7\u6C42\u6267\u884C\u64CD\u4F5C: {name}",remainingTime:"\u5269\u4F59\u65F6\u95F4: {time}",deny:"\u62D2\u7EDD",approveOnce:"\u672C\u6B21\u653E\u884C",approveLoop:"\u5F53\u524D\u4EFB\u52A1\u653E\u884C",pendingQueue:"\uFF08\u53E6\u6709 {count} \u6761\u5F85\u786E\u8BA4\uFF09",pendingQueueClarify:"\uFF08\u53E6\u6709 {count} \u6761\u5F85\u6F84\u6E05\uFF09",otherPending:"\uFF08\u53E6\u6709 {count} \u6761\u5176\u4ED6\u8BF7\u6C42\u5728\u6392\u961F\uFF09",approveWhitelist:"\u52A0\u5165\u767D\u540D\u5355\u5E76\u653E\u884C",networkTitle:"\u5185\u7F51\u8BBF\u95EE\u786E\u8BA4",networkToolLabel:"\u5185\u7F51\u5730\u5740\u8BBF\u95EE",networkAccessRequest:"\u6A21\u578B\u8BF7\u6C42\u8BBF\u95EE\u5185\u7F51\u5730\u5740 {hostname}\uFF08{reason}\uFF09\uFF0C\u662F\u5426\u653E\u884C\uFF1F",networkWhitelistHint:"\u9009\u62E9\u300C\u52A0\u5165\u767D\u540D\u5355\u5E76\u653E\u884C\u300D\u4F1A\u5F00\u542F\u300C\u5185\u7F51\u5730\u5740\u8BBF\u95EE\u300D\u5E76\u628A\u8BE5\u4E3B\u673A\u52A0\u5165\u5141\u8BB8\u5217\u8868\uFF1B\u300C\u672C\u6B21\u653E\u884C\u300D\u53EA\u5BF9\u8FD9\u4E00\u6B21\u8BF7\u6C42\u751F\u6548\u3002",networkReasonGateClosed:"\u5F53\u524D\u672A\u5F00\u542F\u5185\u7F51\u5730\u5740\u8BBF\u95EE",networkReasonNoAllowlist:"\u5185\u7F51\u5141\u8BB8\u5217\u8868\u4E3A\u7A7A",networkReasonNotAllowlisted:"\u8BE5\u4E3B\u673A\u672A\u52A0\u5165\u5185\u7F51\u5141\u8BB8\u5217\u8868"},sensitiveTool:{manage_cookies:"\u7BA1\u7406 Cookie",manage_storage:"\u9875\u9762\u5B58\u50A8\u64CD\u4F5C",download_file:"\u4E0B\u8F7D\u6587\u4EF6",manage_tab:"\u6807\u7B7E\u9875\u7BA1\u7406",agent_file:"\u6587\u4EF6\u64CD\u4F5C",agent_exec:"\u672C\u5730\u547D\u4EE4\u6267\u884C",debug_page:"\u9875\u9762\u8C03\u8BD5\uFF08Debugger\uFF09",debuggerAttachHint:`
|
|
2
2
|
|
|
3
3
|
\u5F00\u542F\u540E\u8BE5\u6807\u7B7E\u9875\u9876\u90E8\u4F1A\u663E\u793A"\u6269\u5C55\u7A0B\u5E8F\u6B63\u5728\u8C03\u8BD5\u6B64\u6D4F\u89C8\u5668"\u63D0\u793A\u6761\uFF0C\u7ED3\u675F\u540E\u81EA\u52A8\u6D88\u5931\u3002`,unknown:"\u672A\u77E5\u64CD\u4F5C",tabInfo:`
|
|
4
4
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
## \u6267\u884C\u6B65\u9AA4
|
|
24
24
|
1. \u6B65\u9AA41
|
|
25
|
-
2. \u6B65\u9AA42`,existingResources:"\u5DF2\u6709\u8D44\u6E90\u6587\u4EF6",skillNameRequired:"\u8BF7\u8F93\u5165\u6280\u80FD\u540D\u79F0",skillMarkdownRequired:"\u8BF7\u8F93\u5165 SKILL.md \u5185\u5BB9",agentSkillSaved:'Agent \u6280\u80FD "{name}" \u4FDD\u5B58\u6210\u529F',saveFailedShort:"\u4FDD\u5B58\u5931\u8D25",saveFailed:"\u4FDD\u5B58\u5931\u8D25: {error}",viewSkillTitle:"\u67E5\u770B\u6280\u80FD: {name}",importSkillTitle:"\u5BFC\u5165\u6280\u80FD",importBtn:"\u5BFC\u5165",jsonImport:"JSON \u5BFC\u5165",newAuthoring:"\u65B0\u5EFA\u7F16\u5199",zipPackage:"Zip \u5305",urlImport:"URL \u5BFC\u5165",jsonImportDesc:"\u5BFC\u5165 JSON \u683C\u5F0F\u7684 Workflow \u6280\u80FD\uFF08\u786E\u5B9A\u6027\u81EA\u52A8\u5316\u6D41\u7A0B\uFF09",clickOrDragJson:"\u70B9\u51FB\u9009\u62E9 JSON \u6587\u4EF6\u6216\u62D6\u62FD\u5230\u6B64\u5904",jsonFileHint:"\u652F\u6301 .json \u683C\u5F0F\u7684 Workflow \u6280\u80FD\u5B9A\u4E49\u6587\u4EF6",markdownImportDesc:"\u76F4\u63A5\u7F16\u5199 SKILL.md \u5185\u5BB9\uFF0C\u521B\u5EFA Agent \u6280\u80FD\uFF08AI \u80FD\u529B\u6269\u5C55\uFF09",zipImportDesc:"\u5BFC\u5165\u5305\u542B SKILL.md \u7684 Zip \u538B\u7F29\u5305\uFF0C\u53EF\u9644\u5E26 scripts/templates/assets \u7B49\u8F85\u52A9\u8D44\u6E90",clickOrDragZip:"\u70B9\u51FB\u9009\u62E9 Zip \u6587\u4EF6\u6216\u62D6\u62FD\u5230\u6B64\u5904",zipFileHint:"Zip \u5305\u5185\u9700\u5305\u542B SKILL.md \u6587\u4EF6\uFF0C\u53EF\u9009\u7684 scripts/ templates/ assets/ \u5B50\u76EE\u5F55",urlImportDesc:"\u4ECE\u8FDC\u7A0B URL \u4E0B\u8F7D\u6280\u80FD\u7684 Zip \u5305\u5E76\u81EA\u52A8\u5BFC\u5165",downloadUrl:"\u4E0B\u8F7D\u5730\u5740",selectJsonFile:"\u8BF7\u9009\u62E9 JSON \u6587\u4EF6",workflowSkillImported:'Workflow \u6280\u80FD "{name}" \u5BFC\u5165\u6210\u529F',agentSkillCreated:'Agent \u6280\u80FD "{name}" \u521B\u5EFA\u6210\u529F',createFailedShort:"\u521B\u5EFA\u5931\u8D25",selectZipFile:"\u8BF7\u9009\u62E9 Zip \u6587\u4EF6",fileTooLarge:"\u6587\u4EF6\u8FC7\u5927\uFF0C\u6700\u5927\u652F\u6301 50MB",fileReadFailed:"\u6587\u4EF6\u8BFB\u53D6\u5931\u8D25",agentSkillImported:'Agent \u6280\u80FD "{name}" \u5BFC\u5165\u6210\u529F',urlRequired:"\u8BF7\u8F93\u5165 URL",importFailed:"\u5BFC\u5165\u5931\u8D25: {error}",searchMcpPlaceholder:"\u641C\u7D22 MCP \u670D\u52A1\u5668...",searchSkillPlaceholder:"\u641C\u7D22\u6280\u80FD...",filterAll:"\u5168\u90E8",filterEnabled:"\u5DF2\u542F\u7528",filterDisabled:"\u5DF2\u505C\u7528",noMatchResult:"\u65E0\u5339\u914D\u7ED3\u679C"},memoryPanel:{tabTitle:"\u8BB0\u5FC6",title:"\u8BB0\u5FC6\u5411\u91CF",enabled:"\u5DF2\u542F\u7528",disabled:"\u5DF2\u505C\u7528",statusTitle:"\u5411\u91CF\u7D22\u5F15\u72B6\u6001",statusLoading:"\u8BFB\u53D6\u4E2D\u2026",statusOffline:"\u4EE3\u7406\u672A\u8FDE\u63A5\uFF0C\u6682\u65F6\u8BFB\u4E0D\u5230\u5411\u91CF\u72B6\u6001",statusFail:"\u5411\u91CF\u72B6\u6001\u8BFB\u53D6\u5931\u8D25",statusOldAgent:"\u5F53\u524D\u4EE3\u7406\u7248\u672C\u6CA1\u6709\u8FD9\u4E2A\u72B6\u6001\u63A5\u53E3\uFF0C\u8BF7\u91CD\u542F\u4EE3\u7406\u540E\u518D\u770B",statusDetail:"\u8FD4\u56DE\u4FE1\u606F",statusIndexed:"\u5DF2\u7D22\u5F15 {indexed} / \u5171 {total} \u6761",statusStored:"\u5411\u91CF\u6307\u7EB9",statusCurrent:"\u5F53\u524D\u914D\u7F6E\u6307\u7EB9",statusTier:"\u751F\u6548\u6863\u4F4D",statusStale:"\u5DF2\u9648\u65E7\uFF1A\u6A21\u578B\u53D8\u66F4\u540E\u672A\u91CD\u5EFA",statusFresh:"\u4E0E\u5F53\u524D\u914D\u7F6E\u4E00\u81F4",staleHint:"\u65E7\u5411\u91CF\u4E0E\u65B0\u914D\u7F6E\u4E0D\u53EF\u6BD4\uFF0C\u8BED\u4E49\u53EC\u56DE\u4F1A\u9759\u9ED8\u9000\u5316\u3002\u8BF7\u70B9\u300C\u91CD\u5EFA\u5411\u91CF\u7D22\u5F15\u300D\uFF08\u6709\u672A\u4FDD\u5B58\u7684\u4FEE\u6539\u5148\u4FDD\u5B58\uFF09\u3002",modeLabel:"\u5D4C\u5165\u6765\u6E90",modeRemote:"\u8FDC\u7AEF\u670D\u52A1\uFF08OpenAI \u517C\u5BB9\u63A5\u53E3\uFF09",modeLocal:"\u672C\u5730\u6A21\u578B",baseUrlLabel:"\u670D\u52A1\u5730\u5740",baseUrlPlaceholder:"https://api.openai.com/v1",modelLabel:"\u6A21\u578B\u540D\u79F0",modelPlaceholder:"BAAI/bge-m3",apiKeyLabel:"API Key",apiKeyPlaceholder:"\u7559\u7A7A\u8868\u793A\u4E0D\u4FEE\u6539",apiKeyClearBtn:"\u6E05\u9664\u5DF2\u5B58 Key",apiKeyClearConfirm:"\u6E05\u9664\u540E\u8FDC\u7AEF\u8BED\u4E49\u53EC\u56DE\u968F\u5373\u505C\u7528\uFF08\u964D\u56DE\u5173\u952E\u8BCD\u6863\uFF09\uFF0C\u76F4\u5230\u91CD\u65B0\u586B\u5165\u5E76\u4FDD\u5B58\u65B0 Key\u3002\u786E\u5B9A\u6E05\u9664\uFF1F",apiKeyCleared:"\u5DF2\u6E05\u9664\u5DF2\u5B58\u7684 API Key",apiKeyClearFail:"\u6E05\u9664 Key \u5931\u8D25\uFF1A{error}",configNotLoaded:"\u914D\u7F6E\u672A\u6210\u529F\u52A0\u8F7D\uFF0C\u4E3A\u907F\u514D\u628A\u4EE3\u7406\u91CC\u7684\u8BBE\u7F6E\u8986\u76D6\u6210\u7A7A\uFF0C\u8BF7\u5237\u65B0\u9762\u677F\u540E\u91CD\u8BD5",dimsLabel:"\u5411\u91CF\u7EF4\u5EA6\uFF08\u53EF\u7559\u7A7A\uFF0C\u6D4B\u8BD5\u65F6\u81EA\u52A8\u63A2\u6D4B\uFF09",prefixLabel:"\u67E5\u8BE2\u524D\u7F00\uFF08queryPrefix\uFF0C\u53EF\u7559\u7A7A\uFF09",localNotice:"\u672C\u5730\u6863\u65E0\u9700\u6D4B\u8BD5\u8FDE\u901A\u6027\uFF1A\u4FDD\u5B58\u540E\u76F4\u63A5\u91CD\u5EFA\u5411\u91CF\u7D22\u5F15\uFF08\u9996\u6B21\u4F7F\u7528\u9700\u4E0B\u8F7D\u6A21\u578B\uFF0C\u53EF\u80FD\u6570\u5341\u5206\u949F\uFF09\u3002\u5D4C\u5165\u5728 512 token \u5904\u9759\u9ED8\u622A\u65AD\uFF0C\u8D85\u957F\u6761\u76EE\u53EA\u6709\u524D\u90E8\u8FDB\u5165\u5411\u91CF\u3002",testBtn:"\u6D4B\u8BD5\u8FDE\u901A\u6027",testRunning:"\u6D4B\u8BD5\u4E2D\u2026",testOk:"\u8FDE\u901A\u6B63\u5E38\uFF1A{model} \u8F93\u51FA {dims} \u7EF4",testFail:"\u6D4B\u8BD5\u5931\u8D25\uFF1A{error}",scopeHint:"\u672C Tab \u7684\u914D\u7F6E\u4F1A\u5728\u70B9\u51FB\u5E95\u90E8\u300C\u4FDD\u5B58\u914D\u7F6E\u300D\u65F6\u4E00\u5E76\u5199\u5165\u4EE3\u7406\uFF08\u672C\u5730 agent \u670D\u52A1\uFF09\u7684 config.json\uFF1B\u4EE3\u7406\u672A\u8FDE\u63A5\u65F6\u8DF3\u8FC7\u8BE5\u9879\uFF0C\u4EC5\u4FDD\u5B58\u6269\u5C55\u81EA\u8EAB\u8BBE\u7F6E",saveSkippedOffline:"\u4EE3\u7406\u672A\u8FDE\u63A5\uFF0C\u8BB0\u5FC6\u5411\u91CF\u914D\u7F6E\u672A\u4FDD\u5B58\uFF08\u4EC5\u4FDD\u5B58\u4E86\u6269\u5C55\u8BBE\u7F6E\uFF09",saveSuccess:"\u8BB0\u5FC6\u5411\u91CF\u914D\u7F6E\u5DF2\u4FDD\u5B58",saveFail:"\u4FDD\u5B58\u5931\u8D25\uFF1A{error}",toggleOnSaved:"\u5DF2\u542F\u7528\u8BED\u4E49\u5411\u91CF\u53EC\u56DE",toggleOffSaved:"\u5DF2\u505C\u7528\uFF0C\u53EC\u56DE\u56DE\u843D\u5173\u952E\u8BCD\u901A\u9053",toggleFail:"\u5F00\u5173\u5207\u6362\u5931\u8D25\uFF1A{error}",reindexBtn:"\u91CD\u5EFA\u5411\u91CF\u7D22\u5F15",reindexConfirm:"\u91CD\u5EFA\u4F1A\u7528\u5F53\u524D\u914D\u7F6E\u91CD\u65B0\u8BA1\u7B97\u5168\u90E8\u8BB0\u5FC6\u7684\u5411\u91CF\u3002\u672C\u5730\u6863 41 \u6761\u5B9E\u6D4B\u7EA6 23 \u5206\u949F\uFF08\u8FDC\u7AEF\u7EA6 2 \u5206\u949F\uFF09\uFF0C\u671F\u95F4\u8BF7\u52FF\u5173\u95ED\u672C\u9875\u9762\u3002\u786E\u5B9A\u7EE7\u7EED\uFF1F",reindexRunning:"\u91CD\u5EFA\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u52FF\u5173\u95ED\u9875\u9762\u2026",reindexDone:"\u91CD\u5EFA\u5B8C\u6210\uFF1A\u5DF2\u7D22\u5F15 {indexed} / {total}",reindexBatchFail:"\uFF08{count} \u6279\u5931\u8D25\uFF0C\u8BE6\u89C1 agent \u65E5\u5FD7\uFF09",reindexOverWindow:"\uFF08{count} \u6761\u8D85\u51FA {window} token \u7A97\u53E3\uFF0C\u5C3E\u90E8\u672A\u8FDB\u5411\u91CF\uFF09",reindexSkipped:"\u672A\u91CD\u5EFA\uFF1A\u5411\u91CF\u6863\u672A\u542F\u7528",reindexFail:"\u91CD\u5EFA\u5931\u8D25\uFF1A{error}",gateAgentOffTitle:"\u4EE3\u7406\u672A\u8FDE\u63A5",gateAgentOffBody:"\u8BB0\u5FC6\u5411\u91CF\u914D\u7F6E\u7531\u672C\u5730\u4EE3\u7406\u63D0\u4F9B\u3002\u8BF7\u5148\u5728\u300C\u4EE3\u7406\u300D\u6807\u7B7E\u9875\u5B8C\u6210\u4EE3\u7406\u8FDE\u63A5\uFF0C\u518D\u56DE\u5230\u8FD9\u91CC\u914D\u7F6E\u3002",gateRagTitle:"\u672C\u5730\u6A21\u578B\u4F9D\u8D56\u672A\u5C31\u7EEA",gateRagMissing:"\u672C\u5730\u6A21\u578B\u9700\u8981 RAG \u4F9D\u8D56\u3002\u8BF7\u5148\u5728\u300C\u6269\u5C55\u300D\u9762\u677F\u5B8C\u6210\u5B89\u88C5\uFF0C\u518D\u56DE\u5230\u8FD9\u91CC\u914D\u7F6E\u3002",goToAgentTab:"\u524D\u5F80\u300C\u4EE3\u7406\u300D\u6807\u7B7E\u9875",goToToolboxTab:"\u524D\u5F80\u300C\u6269\u5C55\u300D\u6807\u7B7E\u9875"},memoryEntries:{title:"\u8BB0\u5FC6\u6761\u76EE",refreshBtn:"\u5237\u65B0",exportBtn:"\u5BFC\u51FA",importBtn:"\u5BFC\u5165",exportEmpty:"\u8FD8\u6CA1\u6709\u53EF\u5BFC\u51FA\u7684\u8BB0\u5FC6\u6761\u76EE",exportDone:"\u5DF2\u5BFC\u51FA {count} \u6761\u8BB0\u5FC6\u5230 {file}",importParseFail:"\u5BFC\u5165\u5931\u8D25\uFF1A\u6587\u4EF6\u4E0D\u662F\u5408\u6CD5\u7684 JSON",importFormatFail:"\u5BFC\u5165\u5931\u8D25\uFF1A\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u8BF7\u9009\u62E9\u8BB0\u5FC6\u5BFC\u51FA\u6587\u4EF6\u6216\u6DD8\u6C70\u5F52\u6863\u6587\u4EF6",importConfirm:"\u5C06\u8FFD\u52A0\u5BFC\u5165 {add} \u6761\u8BB0\u5FC6\uFF0C\u8DF3\u8FC7 {skipped} \u6761\uFF08\u5DF2\u5B58\u5728\u6216\u683C\u5F0F\u4E0D\u7B26\uFF09\u3002\u5BFC\u5165\u4E0D\u8986\u76D6\u73B0\u6709\u8BB0\u5FC6\uFF0C\u4F46\u5BFC\u5165\u540E\u7684\u6761\u76EE\u65E0\u6CD5\u6279\u91CF\u64A4\u9500\u3002\u786E\u5B9A\u7EE7\u7EED\uFF1F",importNone:"\u6CA1\u6709\u53EF\u5BFC\u5165\u7684\u65B0\u8BB0\u5FC6\uFF08\u8DF3\u8FC7 {skipped} \u6761\uFF09",importDone:"\u5BFC\u5165\u5B8C\u6210\uFF1A\u65B0\u589E {added} \u6761\uFF0C\u8DF3\u8FC7 {skipped} \u6761",importPartialFail:"\u5BFC\u5165\u5B8C\u6210\uFF1A\u65B0\u589E {added} \u6761\uFF0C\u5931\u8D25 {failed} \u6761\uFF0C\u8DF3\u8FC7 {skipped} \u6761",searchPlaceholder:"\u641C\u7D22\u5185\u5BB9\u6216\u6807\u7B7E\u2026",filterAll:"\u5168\u90E8\u7C7B\u578B",filterFact:"\u4E8B\u5B9E",filterSummary:"\u6458\u8981",sortCreatedDesc:"\u521B\u5EFA\u65F6\u95F4\uFF08\u65B0\u2192\u65E7\uFF09",sortImportanceDesc:"\u91CD\u8981\u5EA6\uFF08\u9AD8\u2192\u4F4E\uFF09",sortValueDesc:"\u4EF7\u503C\u5206\uFF08\u9AD8\u2192\u4F4E\uFF09",sortValueAsc:"\u4EF7\u503C\u5206\uFF08\u4F4E\u2192\u9AD8\uFF09",count:"{shown} / {total} \u6761",loading:"\u8BFB\u53D6\u4E2D\u2026",empty:"\u8FD8\u6CA1\u6709\u4EFB\u4F55\u8BB0\u5FC6\u6761\u76EE",noMatch:"\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u6761\u4EF6\u7684\u6761\u76EE",offline:"\u4EE3\u7406\u672A\u8FDE\u63A5\uFF0C\u6682\u65F6\u8BFB\u4E0D\u5230\u8BB0\u5FC6\u6761\u76EE",unsupported:"\u5F53\u524D\u4EE3\u7406\u7248\u672C\u4E0D\u652F\u6301\u8BB0\u5FC6\u6761\u76EE\u7BA1\u7406\uFF0C\u8BF7\u5347\u7EA7\u5E76\u91CD\u542F\u4EE3\u7406",loadFail:"\u8BB0\u5FC6\u6761\u76EE\u8BFB\u53D6\u5931\u8D25\uFF1A{error}",importanceShort:"\u91CD\u8981\u5EA6",valueShort:"\u4EF7\u503C",createdLabel:"\u521B\u5EFA",lastAccessLabel:"\u6700\u8FD1\u8BBF\u95EE",neverAccessed:"\u4ECE\u672A",accessCount:"\u8BBF\u95EE {count} \u6B21",tagsLabel:"\u6807\u7B7E",editBtn:"\u7F16\u8F91",deleteBtn:"\u5220\u9664",editTitle:"\u7F16\u8F91\u8BB0\u5FC6\u6761\u76EE",typeLabel:"\u7C7B\u578B",contentLabel:"\u5185\u5BB9",importanceLabel:"\u91CD\u8981\u5EA6\uFF081-10\uFF09",tagsPlaceholder:"\u9017\u53F7\u5206\u9694\uFF0C\u5982\uFF1A\u73AF\u5883\u3001\u504F\u597D",saveBtn:"\u4FDD\u5B58\u4FEE\u6539",cancelBtn:"\u53D6\u6D88",contentEmpty:"\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A",saved:"\u8BB0\u5FC6\u5DF2\u66F4\u65B0",saveFail:"\u66F4\u65B0\u5931\u8D25\uFF1A{error}",deleteConfirm:"\u5220\u9664\u8FD9\u6761\u8BB0\u5FC6\uFF1F\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u5176\u5411\u91CF\u7F13\u5B58\u4F1A\u540C\u6B65\u6458\u9664\u3002",deleted:"\u8BB0\u5FC6\u5DF2\u5220\u9664",deleteFail:"\u5220\u9664\u5931\u8D25\uFF1A{error}",candidatesHint:"{count} \u6761\u4F4E\u4EF7\u503C\u8BB0\u5FC6\u5EFA\u8BAE\u6DD8\u6C70\uFF08\u4EF7\u503C\u5206\u4F4E\u4E8E 10\uFF09",compactBtn:"\u4E00\u952E\u538B\u7F29",compactConfirm:"\u5C06\u5F52\u6863 {count} \u6761\u4EF7\u503C\u5206\u4F4E\u4E8E {threshold} \u7684\u8BB0\u5FC6\uFF0C\u518D\u4ECE\u8BB0\u5FC6\u5E93\u4E2D\u79FB\u9664\uFF1B\u5F52\u6863\u6587\u4EF6\u53EF\u5728\u9700\u8981\u65F6\u7528\u4E8E\u627E\u56DE\u3002\u786E\u5B9A\u538B\u7F29\uFF1F",compactDone:"\u538B\u7F29\u5B8C\u6210\uFF1A\u5F52\u6863\u4E8B\u5B9E {facts} \u6761\u3001\u6458\u8981 {summaries} \u6761",compactArchived:"\u5DF2\u5F52\u6863 {count} \u6761\u6DD8\u6C70\u8BB0\u5FC6\u5230 {dir}\uFF0C\u9700\u8981\u65F6\u53EF\u4ECE\u8BE5\u76EE\u5F55\u627E\u56DE",compactFail:"\u538B\u7F29\u5931\u8D25\uFF1A{error}"},knowledge:{tabTitle:"\u77E5\u8BC6\u5E93",gateAgentOffTitle:"\u4EE3\u7406\u672A\u8FDE\u63A5",gateAgentOffDesc:"\u77E5\u8BC6\u5E93\u529F\u80FD\u7531\u672C\u5730\u4EE3\u7406\u63D0\u4F9B\u3002\u8BF7\u5148\u5728\u300C\u4EE3\u7406\u300D\u6807\u7B7E\u9875\u5B8C\u6210\u4EE3\u7406\u8FDE\u63A5\uFF0C\u518D\u56DE\u5230\u8FD9\u91CC\u7BA1\u7406\u77E5\u8BC6\u5E93\u3002",gateRagOffTitle:"\u77E5\u8BC6\u5E93\u529F\u80FD\u672A\u542F\u7528",gateRagOffDesc:"\u5F00\u542F\u4E0A\u65B9\u300C\u77E5\u8BC6\u5E93\u68C0\u7D22\u300D\u603B\u5F00\u5173\u540E\uFF0C\u5373\u53EF\u521B\u5EFA\u548C\u7BA1\u7406\u77E5\u8BC6\u5E93\u3002",gateRagUnavailableTitle:"\u4EE3\u7406\u7AEF\u80FD\u529B\u672A\u5C31\u7EEA",gateRagUnavailableDesc:"RAG \u4F9D\u8D56\u5C1A\u672A\u5B89\u88C5\uFF0C\u6216 Node \u7248\u672C\u4E0D\u6EE1\u8DB3\u8981\u6C42\uFF08\u9700 Node 22+\uFF09\u3002\u8BF7\u67E5\u770B\u4E0B\u65B9\u5B89\u88C5\u5F15\u5BFC\u3002",goToAgentTab:"\u524D\u5F80\u300C\u4EE3\u7406\u300D\u6807\u7B7E\u9875",goToToolboxTab:"\u524D\u5F80\u300C\u6269\u5C55\u300D\u6807\u7B7E\u9875",enableNow:"\u7ACB\u5373\u542F\u7528",title:"\u77E5\u8BC6\u5E93",createBtn:"+ \u65B0\u5EFA\u77E5\u8BC6\u5E93",searchPlaceholder:"\u641C\u7D22\u77E5\u8BC6\u5E93...",emptyTitle:"\u8FD8\u6CA1\u6709\u77E5\u8BC6\u5E93",emptyDesc:"\u70B9\u51FB\u300C\u65B0\u5EFA\u77E5\u8BC6\u5E93\u300D\u521B\u5EFA\u7B2C\u4E00\u4E2A\u77E5\u8BC6\u5E93\uFF0C\u7136\u540E\u5BFC\u5165\u6587\u6863\u5F00\u59CB\u4F7F\u7528\u3002",loadFailed:"\u52A0\u8F7D\u5931\u8D25: {error}",retry:"\u91CD\u8BD5",statsSummary:"{docs} \u6587\u6863 \xB7 {chunks} \u5206\u5757",modeLocal:"\u672C\u5730\u6A21\u578B",modeRemote:"\u8FDC\u7AEF\u670D\u52A1",actionEdit:"\u7F16\u8F91",actionIngest:"\u5BFC\u5165",actionSearch:"\u68C0\u7D22\u6D4B\u8BD5",actionDocs:"\u6587\u6863",actionExport:"\u5BFC\u51FA",exporting:"\u6B63\u5728\u5BFC\u51FA...",exportSuccess:"\u77E5\u8BC6\u5E93\u300C{name}\u300D\u5907\u4EFD\u5DF2\u5BFC\u51FA",exportFailed:"\u77E5\u8BC6\u5E93\u5BFC\u51FA\u5931\u8D25: {error}",actionDelete:"\u5220\u9664",actionEnable:"\u542F\u7528",actionDisable:"\u505C\u7528",badgeDisabled:"\u5DF2\u505C\u7528",enableSuccess:"\u77E5\u8BC6\u5E93\u300C{name}\u300D\u5DF2\u542F\u7528",disableSuccess:"\u77E5\u8BC6\u5E93\u300C{name}\u300D\u5DF2\u505C\u7528",createTitle:"\u65B0\u5EFA\u77E5\u8BC6\u5E93",nameLabel:"\u540D\u79F0",namePlaceholder:"\u4F8B\u5982\uFF1A\u4EA7\u54C1\u6587\u6863\u96C6",descLabel:"\u63CF\u8FF0\uFF08\u53EF\u9009\uFF09",descPlaceholder:"\u7B80\u8981\u8BF4\u660E\u8FD9\u4E2A\u77E5\u8BC6\u5E93\u5B58\u653E\u4EC0\u4E48\u5185\u5BB9",createConfirm:"\u521B\u5EFA",creating:"\u521B\u5EFA\u4E2D...",createSuccess:"\u77E5\u8BC6\u5E93\u300C{name}\u300D\u5DF2\u521B\u5EFA",nameRequired:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u5E93\u540D\u79F0",editTitle:"\u7F16\u8F91\u77E5\u8BC6\u5E93",editConfirm:"\u4FDD\u5B58",saving:"\u4FDD\u5B58\u4E2D...",editSuccess:"\u77E5\u8BC6\u5E93\u4FE1\u606F\u5DF2\u66F4\u65B0",vectorSectionTitle:"\u5411\u91CF\u6A21\u578B",vectorModeLocal:"\u672C\u5730\u6A21\u578B\uFF08\u5185\u7F6E BGE \u4E2D\u6587\u6A21\u578B\uFF09",vectorModeRemote:"\u8FDC\u7AEF\u670D\u52A1\uFF08OpenAI \u517C\u5BB9\u63A5\u53E3\uFF09",vectorModeLocalHint:"\u4F7F\u7528\u4EE3\u7406\u7AEF\u5185\u7F6E BGE \u4E2D\u6587\u6A21\u578B\u751F\u6210\u5411\u91CF\uFF0C\u65E0\u9700\u989D\u5916\u914D\u7F6E\uFF1B\u9996\u6B21\u5BFC\u5165\u9700\u4E0B\u8F7D\u6A21\u578B\u6587\u4EF6\u3002",vectorModeRemoteHint:"\u8C03\u7528\u8FDC\u7AEF OpenAI \u517C\u5BB9\u7684\u5411\u91CF\u670D\u52A1\uFF08\u5982\u7845\u57FA\u6D41\u52A8\u3001\u667A\u8C31\u3001OpenAI \u7B49\uFF09\u3002",vectorEndpointLabel:"\u63A5\u53E3\u5730\u5740\uFF08Base URL\uFF0C\u542B\u7248\u672C\u6BB5\uFF09",vectorEndpointPlaceholder:"\u4F8B\u5982 https://api.siliconflow.cn/v1",vectorApiKeyLabel:"API Key",vectorApiKeyPlaceholder:"\u7C98\u8D34 API Key",vectorApiKeyKeep:"\u7559\u7A7A\u5219\u6CBF\u7528\u5DF2\u4FDD\u5B58\u7684 Key",vectorModelLabel:"\u6A21\u578B\u540D\u79F0",vectorModelPlaceholder:"\u4F8B\u5982 BAAI/bge-m3",vectorDimsLabel:"\u5411\u91CF\u7EF4\u5EA6\uFF08\u53EF\u7559\u7A7A\uFF0C\u6D4B\u8BD5\u65F6\u81EA\u52A8\u63A2\u6D4B\uFF09",vectorDimsPlaceholder:"\u81EA\u52A8",vectorTestBtn:"\u6D4B\u8BD5\u8FDE\u901A\u6027",vectorTesting:"\u6D4B\u8BD5\u4E2D...",vectorTestOk:"\u8FDE\u63A5\u6210\u529F\uFF1A{model}\uFF08{dims} \u7EF4\uFF09",vectorDimsFilled:"\u5DF2\u81EA\u52A8\u586B\u5145\u7EF4\u5EA6\uFF1A{dims}",vectorTestFailed:"\u6D4B\u8BD5\u5931\u8D25: {error}",vectorEndpointRequired:"\u8BF7\u586B\u5199\u8FDC\u7AEF\u63A5\u53E3\u5730\u5740",vectorModelRequired:"\u8BF7\u586B\u5199\u6A21\u578B\u540D\u79F0",rebuildConfirmTitle:"\u53D8\u66F4\u5411\u91CF\u914D\u7F6E",rebuildConfirm:"\u5411\u91CF\u6A21\u578B\u6216\u5206\u5757\u53C2\u6570\u53D8\u66F4\u540E\u9700\u8981\u91CD\u5EFA\u7D22\u5F15\uFF08\u91CD\u65B0\u5411\u91CF\u5316\u5168\u90E8\u6587\u6863\uFF09\u3002\u91CD\u5EFA\u671F\u95F4\u4ECD\u53EF\u68C0\u7D22\u65E7\u7D22\u5F15\uFF0C\u5B8C\u6210\u540E\u81EA\u52A8\u5207\u6362\u3002\u786E\u5B9A\u7EE7\u7EED\u5417\uFF1F",rebuildStarted:"\u5DF2\u5F00\u59CB\u91CD\u5EFA\u7D22\u5F15\uFF0C\u5B8C\u6210\u540E\u5C06\u81EA\u52A8\u5237\u65B0...",progressRebuilding:"\u6B63\u5728\u91CD\u5EFA\u7D22\u5F15 {current}/{total} \u7BC7\u6587\u6863\u2026",rebuildDone:"\u7D22\u5F15\u91CD\u5EFA\u5B8C\u6210",rebuildFailed:"\u7D22\u5F15\u91CD\u5EFA\u5931\u8D25: {error}",deleteConfirmTitle:"\u5220\u9664\u77E5\u8BC6\u5E93",deleteConfirm:"\u786E\u5B9A\u5220\u9664\u300C{name}\u300D\u5417\uFF1F\u5176\u4E2D\u7684 {docs} \u4E2A\u6587\u6863\u3001{chunks} \u4E2A\u5206\u5757\u5C06\u4E00\u5E76\u5220\u9664\uFF0C\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002",deleteSuccess:"\u77E5\u8BC6\u5E93\u5DF2\u5220\u9664",ingestTitle:"\u5BFC\u5165\u6587\u6863\u5230\u300C{name}\u300D",tabFile:"\u6587\u4EF6",tabText:"\u6587\u672C",tabUrl:"URL",dropHint:"\u62D6\u62FD\u6587\u4EF6\u5230\u6B64\u5904\uFF0C\u6216\u70B9\u51FB\u9009\u62E9\uFF08\u53EF\u591A\u9009\uFF09",dropSupported:"\u652F\u6301 txt / md / pdf / docx / xlsx / html \u7B49\u683C\u5F0F\uFF0C\u5355\u6587\u4EF6 \u2264 50MB\uFF0C\u5355\u6B21\u2264 20 \u4E2A",selectedFile:"\u5DF2\u9009\u62E9\uFF1A{name}",selectedCount:"\u5DF2\u9009\u62E9 {count} \u4E2A\u6587\u4EF6\uFF08\u5355\u6B21\u6700\u591A {max} \u4E2A\uFF09",removeFile:"\u79FB\u9664",textContentLabel:"\u6587\u672C\u5185\u5BB9",textContentPlaceholder:"\u5728\u6B64\u7C98\u8D34\u8981\u5BFC\u5165\u7684\u6587\u672C\u5185\u5BB9...",textNameLabel:"\u6587\u6863\u540D\u79F0\uFF08\u53EF\u9009\uFF09",textNamePlaceholder:"\u7559\u7A7A\u5219\u81EA\u52A8\u547D\u540D",urlLabel:"\u7F51\u9875\u5730\u5740",urlPlaceholder:"https://example.com/page",chunkSettingsTitle:"\u5206\u5757\u8BBE\u7F6E",chunkSizeLabel:"\u5757\u5927\u5C0F\uFF08\u5B57\u7B26\uFF09",chunkOverlapLabel:"\u91CD\u53E0\uFF08\u5B57\u7B26\uFF09",ingestConfirm:"\u5F00\u59CB\u5BFC\u5165",ingesting:"\u6B63\u5728\u89E3\u6790\u5E76\u5411\u91CF\u5316\uFF0C\u9996\u6B21\u5BFC\u5165\u53EF\u80FD\u9700\u8981\u4E0B\u8F7D\u6A21\u578B\uFF0C\u8BF7\u7A0D\u5019...",progressParsing:"\u6B63\u5728\u89E3\u6790\u6587\u6863\u2026",progressChunking:"\u6B63\u5728\u5206\u5757\u2026",progressEmbedding:"\u6B63\u5728\u5411\u91CF\u5316 {current}/{total} \u5757\u2026",progressStoring:"\u6B63\u5728\u5199\u5165\u7D22\u5F15\u2026",ingestSuccess:"\u5BFC\u5165\u5B8C\u6210\uFF1A{name}\uFF08{chunks} \u4E2A\u5206\u5757\uFF09",ingestFailed:"\u5BFC\u5165\u5931\u8D25: {error}",fileRequired:"\u8BF7\u5148\u9009\u62E9\u6587\u4EF6",contentRequired:"\u8BF7\u8F93\u5165\u8981\u5BFC\u5165\u7684\u6587\u672C\u5185\u5BB9",urlRequired:"\u8BF7\u8F93\u5165\u7F51\u9875\u5730\u5740",fileTooLarge:"\u6587\u4EF6\u8FC7\u5927\uFF0C\u6700\u5927\u652F\u6301 50MB",fileTypeUnsupported:"\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B\uFF1A{name}",maxBatchFiles:"\u5355\u6B21\u6700\u591A\u5BFC\u5165 {max} \u4E2A\u6587\u4EF6\uFF0C\u8BF7\u5206\u6279\u5BFC\u5165",importingBatch:"\u6B63\u5728\u5BFC\u5165 {current}/{total}\uFF1A{name}",batchAllSuccess:"\u6279\u91CF\u5BFC\u5165\u5B8C\u6210\uFF1A{count} \u4E2A\u6587\u6863\uFF08\u5171 {chunks} \u4E2A\u5206\u5757\uFF09",batchPartial:"\u5BFC\u5165\u5B8C\u6210\uFF1A\u6210\u529F {success} \u4E2A\uFF0C\u5931\u8D25 {fail} \u4E2A\uFF08\u9996\u4E2A\u9519\u8BEF\uFF1A{error}\uFF09",batchAllFailed:"\u5168\u90E8\u5BFC\u5165\u5931\u8D25\uFF1A{error}",docsTitle:"\u300C{name}\u300D\u7684\u6587\u6863",docsEmpty:"\u8FD8\u6CA1\u6709\u5BFC\u5165\u4EFB\u4F55\u6587\u6863",docSearchPlaceholder:"\u641C\u7D22\u6587\u6863\u540D\u79F0\u6216\u6765\u6E90...",docSearchEmpty:"\u6CA1\u6709\u5339\u914D\u7684\u6587\u6863",docChunkCount:"{count} \u5206\u5757",docDeleteConfirmTitle:"\u5220\u9664\u6587\u6863",docDeleteConfirm:"\u786E\u5B9A\u5220\u9664\u6587\u6863\u300C{name}\u300D\u5417\uFF1F\u8BE5\u6587\u6863\u7684\u6240\u6709\u5206\u5757\u5C06\u4ECE\u77E5\u8BC6\u5E93\u4E2D\u79FB\u9664\u3002",docDeleteSuccess:"\u6587\u6863\u5DF2\u5220\u9664",docSourceFile:"\u6587\u4EF6",docSourceUrl:"\u7F51\u9875",docSourceText:"\u6587\u672C",docOriginalSize:"\u539F\u4EF6 {size}",docOriginalName:"\u539F\u4EF6\u540D {name}",docNoOriginal:"\u539F\u4EF6\u672A\u4FDD\u7559",docNoOriginalText:"\u7EAF\u6587\u672C\u5BFC\u5165\uFF0C\u65E0\u539F\u4EF6",docOriginalQuotaSkipped:"\u539F\u4EF6\u8D85\u51FA\u914D\u989D\u672A\u4FDD\u7559",docOriginalMissing:"\u8BE5\u6587\u6863\u672A\u4FDD\u7559\u539F\u4EF6\uFF0C\u53EA\u80FD\u67E5\u770B\u6587\u672C",docOriginalSkippedToast:"\u539F\u4EF6\u8D85\u51FA\u914D\u989D\u672A\u4FDD\u5B58\uFF0C\u6587\u672C\u4E0E\u5411\u91CF\u5DF2\u6B63\u5E38\u5165\u5E93",docView:"\u67E5\u770B\u539F\u6587",docViewTitle:"\u67E5\u770B\u539F\u6587",docViewCopy:"\u590D\u5236",docViewCopied:"\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F",docViewPreview:"\u9884\u89C8",docViewSource:"\u6E90\u7801",docViewTruncated:"\u6587\u672C\u8F83\u957F\uFF0C\u4EC5\u663E\u793A\u524D {limit} \u4E2A\u5B57\u7B26\uFF08\u5171 {total} \u5B57\u7B26\uFF09\uFF0C\u53EF\u4E0B\u8F7D\u5168\u6587\u3002",docViewEmpty:"\uFF08\u65E0\u6587\u672C\u5185\u5BB9\uFF09",docToc:"\u76EE\u5F55",docFullscreen:"\u5168\u5C4F",docExitFullscreen:"\u9000\u51FA\u5168\u5C4F",docCharCount:"{count} \u5B57\u7B26",docDownloadOriginal:"\u4E0B\u8F7D\u539F\u4EF6",docDownloadText:"\u4E0B\u8F7D\u6587\u672C",docDownloading:"\u4E0B\u8F7D\u4E2D...",docDownloadFailed:"\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",searchTitle:"\u68C0\u7D22\u6D4B\u8BD5",searchScope:"\u68C0\u7D22\u8303\u56F4\uFF1A\u300C{name}\u300D",searchQueryPlaceholder:"\u8F93\u5165\u67E5\u8BE2\u8BED\u53E5\uFF0C\u4F8B\u5982\uFF1A\u5982\u4F55\u5BFC\u51FA\u6570\u636E\uFF1F",searchBtn:"\u68C0\u7D22",searching:"\u68C0\u7D22\u4E2D...",searchTopKLabel:"\u8FD4\u56DE\u6761\u6570",searchThresholdLabel:"\u76F8\u4F3C\u5EA6\u9608\u503C",searchHitCount:"\u547D\u4E2D {count} \u6761",searchNoHits:"\u6CA1\u6709\u547D\u4E2D\u4EFB\u4F55\u5185\u5BB9\uFF0C\u53EF\u5C1D\u8BD5\u964D\u4F4E\u76F8\u4F3C\u5EA6\u9608\u503C\u3002",searchFallbackHint:"\u76F8\u4F3C\u5EA6\u5747\u4F4E\u4E8E\u9608\u503C\uFF0C\u4EE5\u4E0B\u4E3A\u6700\u4F73\u5339\u914D\uFF08\u4EC5\u4F9B\u53C2\u8003\uFF09\uFF1A",searchFailed:"\u68C0\u7D22\u5931\u8D25: {error}",expandFull:"\u5C55\u5F00\u5168\u6587",collapse:"\u6536\u8D77",scoreLabel:"\u76F8\u4F3C\u5EA6",opFailed:"\u64CD\u4F5C\u5931\u8D25: {error}"},contextBubble:{labelSelection:"\u9009\u4E2D\u5185\u5BB9",labelQuoted:"\u5F15\u7528",labelSkill:"\u6280\u80FD",labelMcp:"MCP",labelPage:"\u7F51\u9875",labelFile:"\u6587\u4EF6",labelKnowledge:"\u77E5\u8BC6\u5E93",clickToExpand:"\u70B9\u51FB\u5C55\u5F00",bubbleSkill:"{name} \u{1F9E9}",bubbleMcp:"{name} \u{1F50C}",bubblePage:"{title} \u{1F310}",bubbleKnowledge:"{name} \u{1F4DA} \xB7 \u547D\u4E2D {count} \u6761",bubbleKnowledgeMiss:"{name} \u{1F4DA} \xB7 \u672A\u547D\u4E2D",bubbleKnowledgeFailed:"{name} \u{1F4DA} \xB7 \u68C0\u7D22\u5931\u8D25",bubbleKnowledgeSearching:"\u6B63\u5728\u68C0\u7D22\u77E5\u8BC6\u5E93\u2026",kbHitToggle:"\u70B9\u51FB\u5C55\u5F00/\u6536\u8D77\u5168\u6587",kbHitTruncated:"\u2702 \u5DF2\u622A\u65AD \xB7 \u539F\u6587 {total} \u5B57\uFF0C\u524D {kept} \u5B57\u5DF2\u53D1\u9001",kbHitTruncatedTitle:"\u4E3A\u63A7\u5236\u4E0A\u4E0B\u6587\u4F53\u79EF\uFF0C\u5185\u5BB9\u622A\u65AD\u540E\u518D\u53D1\u9001\u7ED9\u6A21\u578B\uFF1B\u6B64\u5904\u663E\u793A\u7684\u5373\u6A21\u578B\u5B9E\u9645\u6536\u5230\u7684\u7248\u672C",kbHitTruncatedBadge:"\u2702 {count} \u6761\u5DF2\u622A\u65AD"},configDialog:{exportTitle:"\u5BFC\u51FA\u914D\u7F6E",includeSecrets:"\u5305\u542B API \u5BC6\u94A5",secretWarn:"\u26A0 \u654F\u611F\u4FE1\u606F\uFF0C\u8BF7\u786E\u4FDD\u6587\u4EF6\u5B89\u5168",exportDesc:"\u5BFC\u51FA\u6587\u4EF6\u5C06\u5305\u542B\u9664 Agent \u8FDE\u63A5\u4FE1\u606F\uFF08\u4EE3\u7406\u5730\u5740\u4E0E\u914D\u5BF9\u4EE4\u724C\uFF09\u5916\u7684\u6240\u6709\u914D\u7F6E\uFF1B\u52FE\u9009\u4E0B\u65B9\u9009\u9879\u540E\u4E00\u5E76\u5BFC\u51FA API \u5BC6\u94A5\u4E0E\u8FDE\u63A5\u4FE1\u606F\u3002",export:"\u5BFC\u51FA",importTitle:"\u5BFC\u5165\u914D\u7F6E",mergeImport:"\u5408\u5E76\u5BFC\u5165 \u2014 \u4EC5\u8986\u76D6\u6587\u4EF6\u4E2D\u5B58\u5728\u7684\u914D\u7F6E\u9879\uFF0C\u4FDD\u7559\u5176\u4ED6",replaceImport:"\u5B8C\u5168\u66FF\u6362 \u2014 \u6E05\u7A7A\u5F53\u524D\u914D\u7F6E\uFF0C\u4F7F\u7528\u6587\u4EF6\u4E2D\u7684\u914D\u7F6E",confirmImport:"\u786E\u8BA4\u5BFC\u5165",exportSuccess:"\u914D\u7F6E\u5DF2\u5BFC\u51FA",exportFailed:"\u5BFC\u51FA\u5931\u8D25: {error}",unknownTime:"\u672A\u77E5",importSummary:"\u5BFC\u51FA\u65F6\u95F4: {time}\uFF0C\u5305\u542B {count} \u9879\u914D\u7F6E",invalidFileFormat:"\u65E0\u6548\u7684\u6587\u4EF6\u683C\u5F0F",unrecognizedFormat:"\u65E0\u6CD5\u8BC6\u522B\u7684\u914D\u7F6E\u683C\u5F0F",unknownConfigKey:"\u672A\u77E5\u7684\u914D\u7F6E\u9879: {key}",importFailed:"\u5BFC\u5165\u5931\u8D25: {error}",importParseFailed:"\u5BFC\u5165\u5931\u8D25: \u65E0\u6CD5\u89E3\u6790\u6587\u4EF6\u683C\u5F0F",importedCount:"\u5DF2\u5BFC\u5165 {count} \u9879\u914D\u7F6E"},queue:{enqueueBtn:"\u52A0\u5165\u961F\u5217",enqueued:"\u5DF2\u52A0\u5165\u961F\u5217\uFF08\u7B2C {position} \u4F4D\uFF09",enqueueFailed:"\u52A0\u5165\u961F\u5217\u5931\u8D25\uFF0C\u5185\u5BB9\u5DF2\u4FDD\u7559\u5728\u8F93\u5165\u6846",queueFull:"\u961F\u5217\u5DF2\u6EE1\uFF08\u4E0A\u9650 {limit} \u6761\uFF09\uFF0C\u8BF7\u5148\u5904\u7406\u5DF2\u6392\u961F\u7684\u4EFB\u52A1",noSession:"\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5",summary:"\u6392\u961F {count} \u6761",summaryEmpty:"\u961F\u5217\u5DF2\u7A7A",summaryFailed:"{count} \u6761\u4EFB\u52A1\u5931\u8D25",summaryFailedHint:"\u4EFB\u52A1\u672A\u6210\u529F\u6267\u884C\uFF0C\u5C55\u5F00\u300C\u6700\u8FD1\u5904\u7406\u300D\u53EF\u91CD\u65B0\u5165\u961F",pausedTag:"\u5DF2\u6682\u505C",pausedHint:"\u81EA\u52A8\u63A5\u529B\u5DF2\u6682\u505C",pausedByStop:"\u4F60\u70B9\u51FB\u4E86\u505C\u6B62\uFF0C\u81EA\u52A8\u63A5\u529B\u5DF2\u6682\u505C",resumeQueue:"\u7EE7\u7EED\u961F\u5217",resumed:"\u5DF2\u7EE7\u7EED\u81EA\u52A8\u63A5\u529B",stopAndSend:"\u505C\u6B62\u5E76\u53D1\u9001",stopAndSendTitle:"\u653E\u5F03\u5F53\u524D\u8FD9\u4E00\u8F6E\uFF0C\u7ACB\u523B\u5F00\u59CB\u6267\u884C\u961F\u5217\uFF08\u53F3\u952E / \u957F\u6309\u505C\u6B62\u6309\u94AE\uFF09",stopAndSendEmpty:"\u961F\u5217\u91CC\u6CA1\u6709\u5F85\u6267\u884C\u7684\u4EFB\u52A1",stopAndSendStarted:"\u5DF2\u505C\u6B62\u5F53\u524D\u4EFB\u52A1\uFF0C\u961F\u5217\u5F00\u59CB\u6267\u884C",recentTitle:"\u6700\u8FD1\u5904\u7406",recentEmpty:"\u6682\u65E0\u5904\u7406\u8BB0\u5F55",requeue:"\u91CD\u65B0\u5165\u961F",requeued:"\u5DF2\u91CD\u65B0\u52A0\u5165\u961F\u5217",deleted:"\u5DF2\u4ECE\u961F\u5217\u5220\u9664",movedTop:"\u5DF2\u7F6E\u9876",withContext:"\u5E26\u4E0A\u4E0B\u6587",withImages:"\u5E26 {count} \u56FE",withFiles:"\u5E26 {count} \u6587\u4EF6",attachmentsVolatile:"\u56FE\u7247/\u6587\u4EF6\u8F83\u5927\uFF0C\u672A\u80FD\u6301\u4E45\u5316\u4FDD\u5B58\uFF1B\u9762\u677F\u5237\u65B0\u540E\u4F1A\u4E22\u5931\u8FD9\u4E9B\u9644\u4EF6\uFF0C\u5EFA\u8BAE\u5C3D\u5FEB\u6267\u884C\u672C\u6761",attachmentsMissing:"\u9644\u4EF6\u5DF2\u65E0\u6CD5\u6062\u590D\uFF08\u53EF\u80FD\u6765\u81EA\u5DF2\u5173\u95ED\u7684\u9762\u677F\u6216\u88AB\u91CA\u653E\uFF09\uFF0C\u672C\u6761\u5C06\u53EA\u53D1\u9001\u6587\u5B57",editBackWithAttachments:"\u5DF2\u56DE\u586B\uFF0C\u56FE\u7247/\u6587\u4EF6\u4E00\u5E76\u8FD8\u539F",requeuedNoAttachments:"\u5DF2\u91CD\u65B0\u5165\u961F\uFF08\u539F\u9644\u4EF6\u5DF2\u91CA\u653E\uFF0C\u4EC5\u6062\u590D\u6587\u5B57\uFF09",forgetRecent:"\u4ECE\u8BB0\u5F55\u4E2D\u79FB\u9664",forgotRecent:"\u5DF2\u4ECE\u300C\u6700\u8FD1\u5904\u7406\u300D\u79FB\u9664",filesStillExtracting:"\u9644\u4EF6\u6587\u4EF6\u8FD8\u5728\u89E3\u6790\u4E2D\uFF0C\u7B49\u89E3\u6790\u5B8C\u6210\u518D\u5165\u961F\uFF08\u73B0\u5728\u5165\u961F\u4F1A\u4E22\u6587\u4EF6\u5185\u5BB9\uFF09",inputHasUnsavedContext:"\u8F93\u5165\u533A\u8FD8\u6CA1\u5199\u7684\u56FE\u7247/\u6587\u4EF6/\u5F15\u7528\u4F1A\u56E0\u56DE\u586B\u88AB\u6E05\u6389\uFF1B\u8BF7\u5148\u53D1\u9001\u6216\u6E05\u7A7A\u5B83\u4EEC\u540E\u518D\u56DE\u586B",statusDispatching:"\u6267\u884C\u4E2D",statusInjecting:"\u63D2\u5165\u4E2D",statusInjected:"\u5DF2\u63D2\u5165",statusDone:"\u5DF2\u6267\u884C",statusFailed:"\u5931\u8D25",statusRecovered:"\u4E0A\u6B21\u672A\u5B8C\u6210",statusRunningHint:"\u6B63\u5728\u6267\u884C\u8FD9\u6761\u4EFB\u52A1\uFF08\u542B\u5DE5\u5177\u8C03\u7528\uFF09\uFF0C\u8DD1\u5B8C\u624D\u8F6E\u5230\u4E0B\u4E00\u6761",inject:"\u63D2\u5165\u5F53\u524D\u4EFB\u52A1\uFF08\u4E0D\u5FC5\u7B49\u5B83\u8DD1\u5B8C\uFF09",injectIdleHint:"\u5F53\u524D\u6CA1\u6709\u6B63\u5728\u6267\u884C\u7684\u4EFB\u52A1\uFF1B\u8FD9\u6761\u4F1A\u6309\u961F\u5217\u987A\u5E8F\u6267\u884C",injectAccepted:"\u5DF2\u6295\u9012\uFF0C\u5F53\u524D\u6B65\u9AA4\u7ED3\u675F\u540E\u751F\u6548",injected:"\u5DF2\u63D2\u5165\u5F53\u524D\u4EFB\u52A1",autoCarried:"\u5DF2\u81EA\u52A8\u5E26\u5165\u5F53\u524D\u4EFB\u52A1\uFF08\u7B2C {iteration} \u8F6E\uFF09",injectNoTask:"\u4EFB\u52A1\u521A\u597D\u7ED3\u675F\u4E86\uFF0C\u8FD9\u6761\u5DF2\u653E\u56DE\u961F\u5217",injectTimeout:"\u6CA1\u7B49\u5230\u63D2\u5165\u786E\u8BA4\uFF0C\u8FD9\u6761\u5DF2\u653E\u56DE\u961F\u5217",injectTimeoutAdhoc:"\u6CA1\u7B49\u5230\u63D2\u5165\u786E\u8BA4\uFF0C\u5185\u5BB9\u4ECD\u5728\u8F93\u5165\u6846",injectFailed:"\u63D2\u5165\u5931\u8D25\uFF0C\u8FD9\u6761\u5DF2\u653E\u56DE\u961F\u5217",injectNoAttachments:"\u5E26\u56FE\u7247/\u6587\u4EF6\u7684\u6761\u76EE\u4E0D\u80FD\u63D2\u5165\u8FD0\u884C\u4E2D\u7684\u4EFB\u52A1\uFF08\u53EA\u63D2\u7EAF\u6587\u672C\uFF09\uFF0C\u8BF7\u8BA9\u5B83\u6309\u961F\u5217\u987A\u5E8F\u6267\u884C",editBack:"\u56DE\u586B\u8F93\u5165\u6846",editTailHint:"\u5DF2\u53D6\u56DE\u961F\u5C3E\u4E00\u6761\uFF0C\u6539\u5B8C\u6309 Enter \u53D1\u9001",delete:"\u5220\u9664",stopNow:"\u505C\u6B62\u5F53\u524D\u4EFB\u52A1",tooManyAttempts:"\u8FD9\u6761\u5DF2\u8FDE\u7EED\u81EA\u52A8\u6267\u884C {count} \u6B21\u4ECD\u672A\u6210\u529F\uFF0C\u5DF2\u505C\u6B62\u91CD\u8BD5\u5E76\u79FB\u5165\u300C\u6700\u8FD1\u5904\u7406\u300D\uFF0C\u53EF\u624B\u52A8\u91CD\u65B0\u5165\u961F",badgeTitle:"\u8BE5\u4F1A\u8BDD\u6709 {count} \u6761\u6392\u961F\u4EFB\u52A1",sessionDropped:"\u8BE5\u4F1A\u8BDD\u8FD8\u6709 {count} \u6761\u6392\u961F\u4EFB\u52A1\uFF0C\u5DF2\u968F\u4F1A\u8BDD\u4E00\u5E76\u5220\u9664"}},Ko={common:{confirm:"Confirm",cancel:"Cancel",close:"Close",ok:"OK",save:"Save",delete:"Delete",edit:"Edit",retry:"Retry",loading:"Loading...",none:"None",add:"Add",clear:"Clear",selectAll:"Select All",deselectAll:"Deselect All",refresh:"Refresh",enabled:"Enabled",disabled:"Disabled",bytes:"bytes",copy:"Copy",copySuccess:"Copied",copyFailed:"Copy failed"},dialog:{operationConfirm:"Operation Confirmation",confirmDefaultMessage:"The model requests to execute a sensitive operation. Allow?",confirmAction:"The model requests to execute: {name}",remainingTime:"Time remaining: {time}",deny:"Deny",approveOnce:"Allow Once",approveLoop:"Allow for This Task",pendingQueue:"(+{count} queued)",pendingQueueClarify:"(+{count} awaiting clarification)",otherPending:"(+{count} other waiting)",approveWhitelist:"Add to allowlist & allow",networkTitle:"Private Network Access",networkToolLabel:"Private network access",networkAccessRequest:"The model requests access to the private address {hostname} ({reason}). Allow?",networkWhitelistHint:'"Add to allowlist & allow" turns on private network access and adds this host to the allowlist; "Allow Once" only applies to this request.',networkReasonGateClosed:"Private network access is currently off",networkReasonNoAllowlist:"The private-network allowlist is empty",networkReasonNotAllowlisted:"This host is not in the private-network allowlist"},sensitiveTool:{manage_cookies:"Manage Cookies",manage_storage:"Page Storage Operation",download_file:"Download File",manage_tab:"Tab Management",agent_file:"File Operations",agent_exec:"Local Command Execution",debug_page:"Page Debugger",debuggerAttachHint:`
|
|
25
|
+
2. \u6B65\u9AA42`,existingResources:"\u5DF2\u6709\u8D44\u6E90\u6587\u4EF6",skillNameRequired:"\u8BF7\u8F93\u5165\u6280\u80FD\u540D\u79F0",skillMarkdownRequired:"\u8BF7\u8F93\u5165 SKILL.md \u5185\u5BB9",agentSkillSaved:'Agent \u6280\u80FD "{name}" \u4FDD\u5B58\u6210\u529F',saveFailedShort:"\u4FDD\u5B58\u5931\u8D25",saveFailed:"\u4FDD\u5B58\u5931\u8D25: {error}",viewSkillTitle:"\u67E5\u770B\u6280\u80FD: {name}",importSkillTitle:"\u5BFC\u5165\u6280\u80FD",importBtn:"\u5BFC\u5165",jsonImport:"JSON \u5BFC\u5165",newAuthoring:"\u65B0\u5EFA\u7F16\u5199",zipPackage:"Zip \u5305",urlImport:"URL \u5BFC\u5165",jsonImportDesc:"\u5BFC\u5165 JSON \u683C\u5F0F\u7684 Workflow \u6280\u80FD\uFF08\u786E\u5B9A\u6027\u81EA\u52A8\u5316\u6D41\u7A0B\uFF09",clickOrDragJson:"\u70B9\u51FB\u9009\u62E9 JSON \u6587\u4EF6\u6216\u62D6\u62FD\u5230\u6B64\u5904",jsonFileHint:"\u652F\u6301 .json \u683C\u5F0F\u7684 Workflow \u6280\u80FD\u5B9A\u4E49\u6587\u4EF6",markdownImportDesc:"\u76F4\u63A5\u7F16\u5199 SKILL.md \u5185\u5BB9\uFF0C\u521B\u5EFA Agent \u6280\u80FD\uFF08AI \u80FD\u529B\u6269\u5C55\uFF09",zipImportDesc:"\u5BFC\u5165\u5305\u542B SKILL.md \u7684 Zip \u538B\u7F29\u5305\uFF0C\u53EF\u9644\u5E26 scripts/templates/assets \u7B49\u8F85\u52A9\u8D44\u6E90",clickOrDragZip:"\u70B9\u51FB\u9009\u62E9 Zip \u6587\u4EF6\u6216\u62D6\u62FD\u5230\u6B64\u5904",zipFileHint:"Zip \u5305\u5185\u9700\u5305\u542B SKILL.md \u6587\u4EF6\uFF0C\u53EF\u9009\u7684 scripts/ templates/ assets/ \u5B50\u76EE\u5F55",urlImportDesc:"\u4ECE\u8FDC\u7A0B URL \u4E0B\u8F7D\u6280\u80FD\u7684 Zip \u5305\u5E76\u81EA\u52A8\u5BFC\u5165",downloadUrl:"\u4E0B\u8F7D\u5730\u5740",selectJsonFile:"\u8BF7\u9009\u62E9 JSON \u6587\u4EF6",workflowSkillImported:'Workflow \u6280\u80FD "{name}" \u5BFC\u5165\u6210\u529F',agentSkillCreated:'Agent \u6280\u80FD "{name}" \u521B\u5EFA\u6210\u529F',createFailedShort:"\u521B\u5EFA\u5931\u8D25",selectZipFile:"\u8BF7\u9009\u62E9 Zip \u6587\u4EF6",fileTooLarge:"\u6587\u4EF6\u8FC7\u5927\uFF0C\u6700\u5927\u652F\u6301 50MB",fileReadFailed:"\u6587\u4EF6\u8BFB\u53D6\u5931\u8D25",agentSkillImported:'Agent \u6280\u80FD "{name}" \u5BFC\u5165\u6210\u529F',urlRequired:"\u8BF7\u8F93\u5165 URL",importFailed:"\u5BFC\u5165\u5931\u8D25: {error}",searchMcpPlaceholder:"\u641C\u7D22 MCP \u670D\u52A1\u5668...",searchSkillPlaceholder:"\u641C\u7D22\u6280\u80FD...",filterAll:"\u5168\u90E8",filterEnabled:"\u5DF2\u542F\u7528",filterDisabled:"\u5DF2\u505C\u7528",noMatchResult:"\u65E0\u5339\u914D\u7ED3\u679C"},memoryPanel:{tabTitle:"\u8BB0\u5FC6",title:"\u8BB0\u5FC6\u5411\u91CF",enabled:"\u5DF2\u542F\u7528",disabled:"\u5DF2\u505C\u7528",statusTitle:"\u5411\u91CF\u7D22\u5F15\u72B6\u6001",statusLoading:"\u8BFB\u53D6\u4E2D\u2026",statusOffline:"\u4EE3\u7406\u672A\u8FDE\u63A5\uFF0C\u6682\u65F6\u8BFB\u4E0D\u5230\u5411\u91CF\u72B6\u6001",statusFail:"\u5411\u91CF\u72B6\u6001\u8BFB\u53D6\u5931\u8D25",statusOldAgent:"\u5F53\u524D\u4EE3\u7406\u7248\u672C\u6CA1\u6709\u8FD9\u4E2A\u72B6\u6001\u63A5\u53E3\uFF0C\u8BF7\u91CD\u542F\u4EE3\u7406\u540E\u518D\u770B",statusDetail:"\u8FD4\u56DE\u4FE1\u606F",statusIndexed:"\u5DF2\u7D22\u5F15 {indexed} / \u5171 {total} \u6761",statusStored:"\u5411\u91CF\u6307\u7EB9",statusCurrent:"\u5F53\u524D\u914D\u7F6E\u6307\u7EB9",statusTier:"\u751F\u6548\u6863\u4F4D",statusStale:"\u5DF2\u9648\u65E7\uFF1A\u6A21\u578B\u53D8\u66F4\u540E\u672A\u91CD\u5EFA",statusFresh:"\u4E0E\u5F53\u524D\u914D\u7F6E\u4E00\u81F4",staleHint:"\u65E7\u5411\u91CF\u4E0E\u65B0\u914D\u7F6E\u4E0D\u53EF\u6BD4\uFF0C\u8BED\u4E49\u53EC\u56DE\u4F1A\u9759\u9ED8\u9000\u5316\u3002\u8BF7\u70B9\u300C\u91CD\u5EFA\u5411\u91CF\u7D22\u5F15\u300D\uFF08\u6709\u672A\u4FDD\u5B58\u7684\u4FEE\u6539\u5148\u4FDD\u5B58\uFF09\u3002",modeLabel:"\u5D4C\u5165\u6765\u6E90",modeRemote:"\u8FDC\u7AEF\u670D\u52A1\uFF08OpenAI \u517C\u5BB9\u63A5\u53E3\uFF09",modeLocal:"\u672C\u5730\u6A21\u578B",baseUrlLabel:"\u670D\u52A1\u5730\u5740",baseUrlPlaceholder:"https://api.openai.com/v1",modelLabel:"\u6A21\u578B\u540D\u79F0",modelPlaceholder:"BAAI/bge-m3",apiKeyLabel:"API Key",apiKeyPlaceholder:"\u7559\u7A7A\u8868\u793A\u4E0D\u4FEE\u6539",apiKeyClearBtn:"\u6E05\u9664\u5DF2\u5B58 Key",apiKeyClearConfirm:"\u6E05\u9664\u540E\u8FDC\u7AEF\u8BED\u4E49\u53EC\u56DE\u968F\u5373\u505C\u7528\uFF08\u964D\u56DE\u5173\u952E\u8BCD\u6863\uFF09\uFF0C\u76F4\u5230\u91CD\u65B0\u586B\u5165\u5E76\u4FDD\u5B58\u65B0 Key\u3002\u786E\u5B9A\u6E05\u9664\uFF1F",apiKeyCleared:"\u5DF2\u6E05\u9664\u5DF2\u5B58\u7684 API Key",apiKeyClearFail:"\u6E05\u9664 Key \u5931\u8D25\uFF1A{error}",configNotLoaded:"\u914D\u7F6E\u672A\u6210\u529F\u52A0\u8F7D\uFF0C\u4E3A\u907F\u514D\u628A\u4EE3\u7406\u91CC\u7684\u8BBE\u7F6E\u8986\u76D6\u6210\u7A7A\uFF0C\u8BF7\u5237\u65B0\u9762\u677F\u540E\u91CD\u8BD5",dimsLabel:"\u5411\u91CF\u7EF4\u5EA6\uFF08\u53EF\u7559\u7A7A\uFF0C\u6D4B\u8BD5\u65F6\u81EA\u52A8\u63A2\u6D4B\uFF09",prefixLabel:"\u67E5\u8BE2\u524D\u7F00\uFF08queryPrefix\uFF0C\u53EF\u7559\u7A7A\uFF09",localNotice:"\u672C\u5730\u6863\u65E0\u9700\u6D4B\u8BD5\u8FDE\u901A\u6027\uFF1A\u4FDD\u5B58\u540E\u76F4\u63A5\u91CD\u5EFA\u5411\u91CF\u7D22\u5F15\uFF08\u9996\u6B21\u4F7F\u7528\u9700\u4E0B\u8F7D\u6A21\u578B\uFF0C\u53EF\u80FD\u6570\u5341\u5206\u949F\uFF09\u3002\u5D4C\u5165\u5728 512 token \u5904\u9759\u9ED8\u622A\u65AD\uFF0C\u8D85\u957F\u6761\u76EE\u53EA\u6709\u524D\u90E8\u8FDB\u5165\u5411\u91CF\u3002",testBtn:"\u6D4B\u8BD5\u8FDE\u901A\u6027",testRunning:"\u6D4B\u8BD5\u4E2D\u2026",testOk:"\u8FDE\u901A\u6B63\u5E38\uFF1A{model} \u8F93\u51FA {dims} \u7EF4",testFail:"\u6D4B\u8BD5\u5931\u8D25\uFF1A{error}",scopeHint:"\u672C Tab \u7684\u914D\u7F6E\u4F1A\u5728\u70B9\u51FB\u5E95\u90E8\u300C\u4FDD\u5B58\u914D\u7F6E\u300D\u65F6\u4E00\u5E76\u5199\u5165\u4EE3\u7406\uFF08\u672C\u5730 agent \u670D\u52A1\uFF09\u7684 config.json\uFF1B\u4EE3\u7406\u672A\u8FDE\u63A5\u65F6\u8DF3\u8FC7\u8BE5\u9879\uFF0C\u4EC5\u4FDD\u5B58\u6269\u5C55\u81EA\u8EAB\u8BBE\u7F6E",saveSkippedOffline:"\u4EE3\u7406\u672A\u8FDE\u63A5\uFF0C\u8BB0\u5FC6\u5411\u91CF\u914D\u7F6E\u672A\u4FDD\u5B58\uFF08\u4EC5\u4FDD\u5B58\u4E86\u6269\u5C55\u8BBE\u7F6E\uFF09",saveSuccess:"\u8BB0\u5FC6\u5411\u91CF\u914D\u7F6E\u5DF2\u4FDD\u5B58",saveFail:"\u4FDD\u5B58\u5931\u8D25\uFF1A{error}",toggleOnSaved:"\u5DF2\u542F\u7528\u8BED\u4E49\u5411\u91CF\u53EC\u56DE",toggleOffSaved:"\u5DF2\u505C\u7528\uFF0C\u53EC\u56DE\u56DE\u843D\u5173\u952E\u8BCD\u901A\u9053",toggleFail:"\u5F00\u5173\u5207\u6362\u5931\u8D25\uFF1A{error}",reindexBtn:"\u91CD\u5EFA\u5411\u91CF\u7D22\u5F15",reindexConfirm:"\u91CD\u5EFA\u4F1A\u7528\u5F53\u524D\u914D\u7F6E\u91CD\u65B0\u8BA1\u7B97\u5168\u90E8\u8BB0\u5FC6\u7684\u5411\u91CF\u3002\u672C\u5730\u6863 41 \u6761\u5B9E\u6D4B\u7EA6 23 \u5206\u949F\uFF08\u8FDC\u7AEF\u7EA6 2 \u5206\u949F\uFF09\uFF0C\u671F\u95F4\u8BF7\u52FF\u5173\u95ED\u672C\u9875\u9762\u3002\u786E\u5B9A\u7EE7\u7EED\uFF1F",reindexRunning:"\u91CD\u5EFA\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u52FF\u5173\u95ED\u9875\u9762\u2026",reindexDone:"\u91CD\u5EFA\u5B8C\u6210\uFF1A\u5DF2\u7D22\u5F15 {indexed} / {total}",reindexBatchFail:"\uFF08{count} \u6279\u5931\u8D25\uFF0C\u8BE6\u89C1 agent \u65E5\u5FD7\uFF09",reindexOverWindow:"\uFF08{count} \u6761\u8D85\u51FA {window} token \u7A97\u53E3\uFF0C\u5C3E\u90E8\u672A\u8FDB\u5411\u91CF\uFF09",reindexSkipped:"\u672A\u91CD\u5EFA\uFF1A\u5411\u91CF\u6863\u672A\u542F\u7528",reindexFail:"\u91CD\u5EFA\u5931\u8D25\uFF1A{error}",gateAgentOffTitle:"\u4EE3\u7406\u672A\u8FDE\u63A5",gateAgentOffBody:"\u8BB0\u5FC6\u5411\u91CF\u914D\u7F6E\u7531\u672C\u5730\u4EE3\u7406\u63D0\u4F9B\u3002\u8BF7\u5148\u5728\u300C\u4EE3\u7406\u300D\u6807\u7B7E\u9875\u5B8C\u6210\u4EE3\u7406\u8FDE\u63A5\uFF0C\u518D\u56DE\u5230\u8FD9\u91CC\u914D\u7F6E\u3002",gateRagTitle:"\u672C\u5730\u6A21\u578B\u4F9D\u8D56\u672A\u5C31\u7EEA",gateRagMissing:"\u672C\u5730\u6A21\u578B\u9700\u8981 RAG \u4F9D\u8D56\u3002\u8BF7\u5148\u5728\u300C\u6269\u5C55\u300D\u9762\u677F\u5B8C\u6210\u5B89\u88C5\uFF0C\u518D\u56DE\u5230\u8FD9\u91CC\u914D\u7F6E\u3002",goToAgentTab:"\u524D\u5F80\u300C\u4EE3\u7406\u300D\u6807\u7B7E\u9875",goToToolboxTab:"\u524D\u5F80\u300C\u6269\u5C55\u300D\u6807\u7B7E\u9875"},memoryEntries:{title:"\u8BB0\u5FC6\u6761\u76EE",refreshBtn:"\u5237\u65B0",exportBtn:"\u5BFC\u51FA",importBtn:"\u5BFC\u5165",exportEmpty:"\u8FD8\u6CA1\u6709\u53EF\u5BFC\u51FA\u7684\u8BB0\u5FC6\u6761\u76EE",exportDone:"\u5DF2\u5BFC\u51FA {count} \u6761\u8BB0\u5FC6\u5230 {file}",importParseFail:"\u5BFC\u5165\u5931\u8D25\uFF1A\u6587\u4EF6\u4E0D\u662F\u5408\u6CD5\u7684 JSON",importFormatFail:"\u5BFC\u5165\u5931\u8D25\uFF1A\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u8BF7\u9009\u62E9\u8BB0\u5FC6\u5BFC\u51FA\u6587\u4EF6\u6216\u6DD8\u6C70\u5F52\u6863\u6587\u4EF6",importConfirm:"\u5C06\u8FFD\u52A0\u5BFC\u5165 {add} \u6761\u8BB0\u5FC6\uFF0C\u8DF3\u8FC7 {skipped} \u6761\uFF08\u5DF2\u5B58\u5728\u6216\u683C\u5F0F\u4E0D\u7B26\uFF09\u3002\u5BFC\u5165\u4E0D\u8986\u76D6\u73B0\u6709\u8BB0\u5FC6\uFF0C\u4F46\u5BFC\u5165\u540E\u7684\u6761\u76EE\u65E0\u6CD5\u6279\u91CF\u64A4\u9500\u3002\u786E\u5B9A\u7EE7\u7EED\uFF1F",importNone:"\u6CA1\u6709\u53EF\u5BFC\u5165\u7684\u65B0\u8BB0\u5FC6\uFF08\u8DF3\u8FC7 {skipped} \u6761\uFF09",importDone:"\u5BFC\u5165\u5B8C\u6210\uFF1A\u65B0\u589E {added} \u6761\uFF0C\u8DF3\u8FC7 {skipped} \u6761",importPartialFail:"\u5BFC\u5165\u5B8C\u6210\uFF1A\u65B0\u589E {added} \u6761\uFF0C\u5931\u8D25 {failed} \u6761\uFF0C\u8DF3\u8FC7 {skipped} \u6761",searchPlaceholder:"\u641C\u7D22\u5185\u5BB9\u6216\u6807\u7B7E\u2026",filterAll:"\u5168\u90E8\u7C7B\u578B",filterFact:"\u4E8B\u5B9E",filterSummary:"\u6458\u8981",sortCreatedDesc:"\u521B\u5EFA\u65F6\u95F4\uFF08\u65B0\u2192\u65E7\uFF09",sortImportanceDesc:"\u91CD\u8981\u5EA6\uFF08\u9AD8\u2192\u4F4E\uFF09",sortValueDesc:"\u4EF7\u503C\u5206\uFF08\u9AD8\u2192\u4F4E\uFF09",sortValueAsc:"\u4EF7\u503C\u5206\uFF08\u4F4E\u2192\u9AD8\uFF09",count:"{shown} / {total} \u6761",loading:"\u8BFB\u53D6\u4E2D\u2026",empty:"\u8FD8\u6CA1\u6709\u4EFB\u4F55\u8BB0\u5FC6\u6761\u76EE",noMatch:"\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u6761\u4EF6\u7684\u6761\u76EE",offline:"\u4EE3\u7406\u672A\u8FDE\u63A5\uFF0C\u6682\u65F6\u8BFB\u4E0D\u5230\u8BB0\u5FC6\u6761\u76EE",unsupported:"\u5F53\u524D\u4EE3\u7406\u7248\u672C\u4E0D\u652F\u6301\u8BB0\u5FC6\u6761\u76EE\u7BA1\u7406\uFF0C\u8BF7\u5347\u7EA7\u5E76\u91CD\u542F\u4EE3\u7406",loadFail:"\u8BB0\u5FC6\u6761\u76EE\u8BFB\u53D6\u5931\u8D25\uFF1A{error}",importanceShort:"\u91CD\u8981\u5EA6",valueShort:"\u4EF7\u503C",createdLabel:"\u521B\u5EFA",lastAccessLabel:"\u6700\u8FD1\u8BBF\u95EE",neverAccessed:"\u4ECE\u672A",accessCount:"\u8BBF\u95EE {count} \u6B21",tagsLabel:"\u6807\u7B7E",editBtn:"\u7F16\u8F91",deleteBtn:"\u5220\u9664",editTitle:"\u7F16\u8F91\u8BB0\u5FC6\u6761\u76EE",typeLabel:"\u7C7B\u578B",contentLabel:"\u5185\u5BB9",importanceLabel:"\u91CD\u8981\u5EA6\uFF081-10\uFF09",tagsPlaceholder:"\u9017\u53F7\u5206\u9694\uFF0C\u5982\uFF1A\u73AF\u5883\u3001\u504F\u597D",saveBtn:"\u4FDD\u5B58\u4FEE\u6539",cancelBtn:"\u53D6\u6D88",contentEmpty:"\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A",saved:"\u8BB0\u5FC6\u5DF2\u66F4\u65B0",saveFail:"\u66F4\u65B0\u5931\u8D25\uFF1A{error}",deleteConfirm:"\u5220\u9664\u8FD9\u6761\u8BB0\u5FC6\uFF1F\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u5176\u5411\u91CF\u7F13\u5B58\u4F1A\u540C\u6B65\u6458\u9664\u3002",deleted:"\u8BB0\u5FC6\u5DF2\u5220\u9664",deleteFail:"\u5220\u9664\u5931\u8D25\uFF1A{error}",candidatesHint:"{count} \u6761\u4F4E\u4EF7\u503C\u8BB0\u5FC6\u5EFA\u8BAE\u6DD8\u6C70\uFF08\u4EF7\u503C\u5206\u4F4E\u4E8E 10\uFF09",compactBtn:"\u4E00\u952E\u538B\u7F29",compactConfirm:"\u5C06\u5F52\u6863 {count} \u6761\u4EF7\u503C\u5206\u4F4E\u4E8E {threshold} \u7684\u8BB0\u5FC6\uFF0C\u518D\u4ECE\u8BB0\u5FC6\u5E93\u4E2D\u79FB\u9664\uFF1B\u5F52\u6863\u6587\u4EF6\u53EF\u5728\u9700\u8981\u65F6\u7528\u4E8E\u627E\u56DE\u3002\u786E\u5B9A\u538B\u7F29\uFF1F",compactDone:"\u538B\u7F29\u5B8C\u6210\uFF1A\u5F52\u6863\u4E8B\u5B9E {facts} \u6761\u3001\u6458\u8981 {summaries} \u6761",compactArchived:"\u5DF2\u5F52\u6863 {count} \u6761\u6DD8\u6C70\u8BB0\u5FC6\u5230 {dir}\uFF0C\u9700\u8981\u65F6\u53EF\u4ECE\u8BE5\u76EE\u5F55\u627E\u56DE",compactFail:"\u538B\u7F29\u5931\u8D25\uFF1A{error}"},knowledge:{tabTitle:"\u77E5\u8BC6\u5E93",gateAgentOffTitle:"\u4EE3\u7406\u672A\u8FDE\u63A5",gateAgentOffDesc:"\u77E5\u8BC6\u5E93\u529F\u80FD\u7531\u672C\u5730\u4EE3\u7406\u63D0\u4F9B\u3002\u8BF7\u5148\u5728\u300C\u4EE3\u7406\u300D\u6807\u7B7E\u9875\u5B8C\u6210\u4EE3\u7406\u8FDE\u63A5\uFF0C\u518D\u56DE\u5230\u8FD9\u91CC\u7BA1\u7406\u77E5\u8BC6\u5E93\u3002",gateRagOffTitle:"\u77E5\u8BC6\u5E93\u529F\u80FD\u672A\u542F\u7528",gateRagOffDesc:"\u5F00\u542F\u4E0A\u65B9\u300C\u77E5\u8BC6\u5E93\u68C0\u7D22\u300D\u603B\u5F00\u5173\u540E\uFF0C\u5373\u53EF\u521B\u5EFA\u548C\u7BA1\u7406\u77E5\u8BC6\u5E93\u3002",gateRagUnavailableTitle:"\u4EE3\u7406\u7AEF\u80FD\u529B\u672A\u5C31\u7EEA",gateRagUnavailableDesc:"RAG \u4F9D\u8D56\u5C1A\u672A\u5B89\u88C5\uFF0C\u6216 Node \u7248\u672C\u4E0D\u6EE1\u8DB3\u8981\u6C42\uFF08\u9700 Node 22+\uFF09\u3002\u8BF7\u67E5\u770B\u4E0B\u65B9\u5B89\u88C5\u5F15\u5BFC\u3002",goToAgentTab:"\u524D\u5F80\u300C\u4EE3\u7406\u300D\u6807\u7B7E\u9875",goToToolboxTab:"\u524D\u5F80\u300C\u6269\u5C55\u300D\u6807\u7B7E\u9875",enableNow:"\u7ACB\u5373\u542F\u7528",title:"\u77E5\u8BC6\u5E93",createBtn:"+ \u65B0\u5EFA\u77E5\u8BC6\u5E93",searchPlaceholder:"\u641C\u7D22\u77E5\u8BC6\u5E93...",emptyTitle:"\u8FD8\u6CA1\u6709\u77E5\u8BC6\u5E93",emptyDesc:"\u70B9\u51FB\u300C\u65B0\u5EFA\u77E5\u8BC6\u5E93\u300D\u521B\u5EFA\u7B2C\u4E00\u4E2A\u77E5\u8BC6\u5E93\uFF0C\u7136\u540E\u5BFC\u5165\u6587\u6863\u5F00\u59CB\u4F7F\u7528\u3002",loadFailed:"\u52A0\u8F7D\u5931\u8D25: {error}",retry:"\u91CD\u8BD5",statsSummary:"{docs} \u6587\u6863 \xB7 {chunks} \u5206\u5757",modeLocal:"\u672C\u5730\u6A21\u578B",modeRemote:"\u8FDC\u7AEF\u670D\u52A1",actionEdit:"\u7F16\u8F91",actionIngest:"\u5BFC\u5165",actionSearch:"\u68C0\u7D22\u6D4B\u8BD5",actionDocs:"\u6587\u6863",actionExport:"\u5BFC\u51FA",exporting:"\u6B63\u5728\u5BFC\u51FA...",exportSuccess:"\u77E5\u8BC6\u5E93\u300C{name}\u300D\u5907\u4EFD\u5DF2\u5BFC\u51FA",exportFailed:"\u77E5\u8BC6\u5E93\u5BFC\u51FA\u5931\u8D25: {error}",actionDelete:"\u5220\u9664",actionEnable:"\u542F\u7528",actionDisable:"\u505C\u7528",badgeDisabled:"\u5DF2\u505C\u7528",enableSuccess:"\u77E5\u8BC6\u5E93\u300C{name}\u300D\u5DF2\u542F\u7528",disableSuccess:"\u77E5\u8BC6\u5E93\u300C{name}\u300D\u5DF2\u505C\u7528",createTitle:"\u65B0\u5EFA\u77E5\u8BC6\u5E93",nameLabel:"\u540D\u79F0",namePlaceholder:"\u4F8B\u5982\uFF1A\u4EA7\u54C1\u6587\u6863\u96C6",descLabel:"\u63CF\u8FF0\uFF08\u53EF\u9009\uFF09",descPlaceholder:"\u7B80\u8981\u8BF4\u660E\u8FD9\u4E2A\u77E5\u8BC6\u5E93\u5B58\u653E\u4EC0\u4E48\u5185\u5BB9",createConfirm:"\u521B\u5EFA",creating:"\u521B\u5EFA\u4E2D...",createSuccess:"\u77E5\u8BC6\u5E93\u300C{name}\u300D\u5DF2\u521B\u5EFA",nameRequired:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u5E93\u540D\u79F0",editTitle:"\u7F16\u8F91\u77E5\u8BC6\u5E93",editConfirm:"\u4FDD\u5B58",saving:"\u4FDD\u5B58\u4E2D...",editSuccess:"\u77E5\u8BC6\u5E93\u4FE1\u606F\u5DF2\u66F4\u65B0",vectorSectionTitle:"\u5411\u91CF\u6A21\u578B",vectorModeLocal:"\u672C\u5730\u6A21\u578B\uFF08\u5185\u7F6E BGE \u4E2D\u6587\u6A21\u578B\uFF09",vectorModeRemote:"\u8FDC\u7AEF\u670D\u52A1\uFF08OpenAI \u517C\u5BB9\u63A5\u53E3\uFF09",vectorModeLocalHint:"\u4F7F\u7528\u4EE3\u7406\u7AEF\u5185\u7F6E BGE \u4E2D\u6587\u6A21\u578B\u751F\u6210\u5411\u91CF\uFF0C\u65E0\u9700\u989D\u5916\u914D\u7F6E\uFF1B\u9996\u6B21\u5BFC\u5165\u9700\u4E0B\u8F7D\u6A21\u578B\u6587\u4EF6\u3002",vectorModeRemoteHint:"\u8C03\u7528\u8FDC\u7AEF OpenAI \u517C\u5BB9\u7684\u5411\u91CF\u670D\u52A1\uFF08\u5982\u7845\u57FA\u6D41\u52A8\u3001\u667A\u8C31\u3001OpenAI \u7B49\uFF09\u3002",vectorEndpointLabel:"\u63A5\u53E3\u5730\u5740\uFF08Base URL\uFF0C\u542B\u7248\u672C\u6BB5\uFF09",vectorEndpointPlaceholder:"\u4F8B\u5982 https://api.siliconflow.cn/v1",vectorApiKeyLabel:"API Key",vectorApiKeyPlaceholder:"\u7C98\u8D34 API Key",vectorApiKeyKeep:"\u7559\u7A7A\u5219\u6CBF\u7528\u5DF2\u4FDD\u5B58\u7684 Key",vectorModelLabel:"\u6A21\u578B\u540D\u79F0",vectorModelPlaceholder:"\u4F8B\u5982 BAAI/bge-m3",vectorDimsLabel:"\u5411\u91CF\u7EF4\u5EA6\uFF08\u53EF\u7559\u7A7A\uFF0C\u6D4B\u8BD5\u65F6\u81EA\u52A8\u63A2\u6D4B\uFF09",vectorDimsPlaceholder:"\u81EA\u52A8",vectorTestBtn:"\u6D4B\u8BD5\u8FDE\u901A\u6027",vectorTesting:"\u6D4B\u8BD5\u4E2D...",vectorTestOk:"\u8FDE\u63A5\u6210\u529F\uFF1A{model}\uFF08{dims} \u7EF4\uFF09",vectorDimsFilled:"\u5DF2\u81EA\u52A8\u586B\u5145\u7EF4\u5EA6\uFF1A{dims}",vectorTestFailed:"\u6D4B\u8BD5\u5931\u8D25: {error}",vectorEndpointRequired:"\u8BF7\u586B\u5199\u8FDC\u7AEF\u63A5\u53E3\u5730\u5740",vectorModelRequired:"\u8BF7\u586B\u5199\u6A21\u578B\u540D\u79F0",rebuildConfirmTitle:"\u53D8\u66F4\u5411\u91CF\u914D\u7F6E",rebuildConfirm:"\u5411\u91CF\u6A21\u578B\u6216\u5206\u5757\u53C2\u6570\u53D8\u66F4\u540E\u9700\u8981\u91CD\u5EFA\u7D22\u5F15\uFF08\u91CD\u65B0\u5411\u91CF\u5316\u5168\u90E8\u6587\u6863\uFF09\u3002\u91CD\u5EFA\u671F\u95F4\u4ECD\u53EF\u68C0\u7D22\u65E7\u7D22\u5F15\uFF0C\u5B8C\u6210\u540E\u81EA\u52A8\u5207\u6362\u3002\u786E\u5B9A\u7EE7\u7EED\u5417\uFF1F",rebuildStarted:"\u5DF2\u5F00\u59CB\u91CD\u5EFA\u7D22\u5F15\uFF0C\u5B8C\u6210\u540E\u5C06\u81EA\u52A8\u5237\u65B0...",progressRebuilding:"\u6B63\u5728\u91CD\u5EFA\u7D22\u5F15 {current}/{total} \u7BC7\u6587\u6863\u2026",rebuildDone:"\u7D22\u5F15\u91CD\u5EFA\u5B8C\u6210",rebuildFailed:"\u7D22\u5F15\u91CD\u5EFA\u5931\u8D25: {error}",deleteConfirmTitle:"\u5220\u9664\u77E5\u8BC6\u5E93",deleteConfirm:"\u786E\u5B9A\u5220\u9664\u300C{name}\u300D\u5417\uFF1F\u5176\u4E2D\u7684 {docs} \u4E2A\u6587\u6863\u3001{chunks} \u4E2A\u5206\u5757\u5C06\u4E00\u5E76\u5220\u9664\uFF0C\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002",deleteSuccess:"\u77E5\u8BC6\u5E93\u5DF2\u5220\u9664",ingestTitle:"\u5BFC\u5165\u6587\u6863\u5230\u300C{name}\u300D",tabFile:"\u6587\u4EF6",tabText:"\u6587\u672C",tabUrl:"URL",dropHint:"\u62D6\u62FD\u6587\u4EF6\u5230\u6B64\u5904\uFF0C\u6216\u70B9\u51FB\u9009\u62E9\uFF08\u53EF\u591A\u9009\uFF09",dropSupported:"\u652F\u6301 txt / md / pdf / docx / xlsx / html \u7B49\u683C\u5F0F\uFF0C\u5355\u6587\u4EF6 \u2264 50MB\uFF0C\u5355\u6B21\u2264 20 \u4E2A",selectedFile:"\u5DF2\u9009\u62E9\uFF1A{name}",selectedCount:"\u5DF2\u9009\u62E9 {count} \u4E2A\u6587\u4EF6\uFF08\u5355\u6B21\u6700\u591A {max} \u4E2A\uFF09",removeFile:"\u79FB\u9664",textContentLabel:"\u6587\u672C\u5185\u5BB9",textContentPlaceholder:"\u5728\u6B64\u7C98\u8D34\u8981\u5BFC\u5165\u7684\u6587\u672C\u5185\u5BB9...",textNameLabel:"\u6587\u6863\u540D\u79F0\uFF08\u53EF\u9009\uFF09",textNamePlaceholder:"\u7559\u7A7A\u5219\u81EA\u52A8\u547D\u540D",urlLabel:"\u7F51\u9875\u5730\u5740",urlPlaceholder:"https://example.com/page",chunkSettingsTitle:"\u5206\u5757\u8BBE\u7F6E",chunkSizeLabel:"\u5757\u5927\u5C0F\uFF08\u5B57\u7B26\uFF09",chunkOverlapLabel:"\u91CD\u53E0\uFF08\u5B57\u7B26\uFF09",ingestConfirm:"\u5F00\u59CB\u5BFC\u5165",ingesting:"\u6B63\u5728\u89E3\u6790\u5E76\u5411\u91CF\u5316\uFF0C\u9996\u6B21\u5BFC\u5165\u53EF\u80FD\u9700\u8981\u4E0B\u8F7D\u6A21\u578B\uFF0C\u8BF7\u7A0D\u5019...",progressParsing:"\u6B63\u5728\u89E3\u6790\u6587\u6863\u2026",progressChunking:"\u6B63\u5728\u5206\u5757\u2026",progressEmbedding:"\u6B63\u5728\u5411\u91CF\u5316 {current}/{total} \u5757\u2026",progressStoring:"\u6B63\u5728\u5199\u5165\u7D22\u5F15\u2026",ingestSuccess:"\u5BFC\u5165\u5B8C\u6210\uFF1A{name}\uFF08{chunks} \u4E2A\u5206\u5757\uFF09",ingestFailed:"\u5BFC\u5165\u5931\u8D25: {error}",fileRequired:"\u8BF7\u5148\u9009\u62E9\u6587\u4EF6",contentRequired:"\u8BF7\u8F93\u5165\u8981\u5BFC\u5165\u7684\u6587\u672C\u5185\u5BB9",urlRequired:"\u8BF7\u8F93\u5165\u7F51\u9875\u5730\u5740",fileTooLarge:"\u6587\u4EF6\u8FC7\u5927\uFF0C\u6700\u5927\u652F\u6301 50MB",fileTypeUnsupported:"\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B\uFF1A{name}",maxBatchFiles:"\u5355\u6B21\u6700\u591A\u5BFC\u5165 {max} \u4E2A\u6587\u4EF6\uFF0C\u8BF7\u5206\u6279\u5BFC\u5165",importingBatch:"\u6B63\u5728\u5BFC\u5165 {current}/{total}\uFF1A{name}",batchAllSuccess:"\u6279\u91CF\u5BFC\u5165\u5B8C\u6210\uFF1A{count} \u4E2A\u6587\u6863\uFF08\u5171 {chunks} \u4E2A\u5206\u5757\uFF09",batchPartial:"\u5BFC\u5165\u5B8C\u6210\uFF1A\u6210\u529F {success} \u4E2A\uFF0C\u5931\u8D25 {fail} \u4E2A\uFF08\u9996\u4E2A\u9519\u8BEF\uFF1A{error}\uFF09",batchAllFailed:"\u5168\u90E8\u5BFC\u5165\u5931\u8D25\uFF1A{error}",docsTitle:"\u300C{name}\u300D\u7684\u6587\u6863",docsEmpty:"\u8FD8\u6CA1\u6709\u5BFC\u5165\u4EFB\u4F55\u6587\u6863",docSearchPlaceholder:"\u641C\u7D22\u6587\u6863\u540D\u79F0\u6216\u6765\u6E90...",docSearchEmpty:"\u6CA1\u6709\u5339\u914D\u7684\u6587\u6863",docChunkCount:"{count} \u5206\u5757",docDeleteConfirmTitle:"\u5220\u9664\u6587\u6863",docDeleteConfirm:"\u786E\u5B9A\u5220\u9664\u6587\u6863\u300C{name}\u300D\u5417\uFF1F\u8BE5\u6587\u6863\u7684\u6240\u6709\u5206\u5757\u5C06\u4ECE\u77E5\u8BC6\u5E93\u4E2D\u79FB\u9664\u3002",docDeleteSuccess:"\u6587\u6863\u5DF2\u5220\u9664",docSourceFile:"\u6587\u4EF6",docSourceUrl:"\u7F51\u9875",docSourceText:"\u6587\u672C",docOriginalSize:"\u539F\u4EF6 {size}",docOriginalName:"\u539F\u4EF6\u540D {name}",docNoOriginal:"\u539F\u4EF6\u672A\u4FDD\u7559",docNoOriginalText:"\u7EAF\u6587\u672C\u5BFC\u5165\uFF0C\u65E0\u539F\u4EF6",docOriginalQuotaSkipped:"\u539F\u4EF6\u8D85\u51FA\u914D\u989D\u672A\u4FDD\u7559",docOriginalMissing:"\u8BE5\u6587\u6863\u672A\u4FDD\u7559\u539F\u4EF6\uFF0C\u53EA\u80FD\u67E5\u770B\u6587\u672C",docOriginalSkippedToast:"\u539F\u4EF6\u8D85\u51FA\u914D\u989D\u672A\u4FDD\u5B58\uFF0C\u6587\u672C\u4E0E\u5411\u91CF\u5DF2\u6B63\u5E38\u5165\u5E93",docView:"\u67E5\u770B\u539F\u6587",docViewTitle:"\u67E5\u770B\u539F\u6587",docViewCopy:"\u590D\u5236",docViewCopied:"\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F",docViewPreview:"\u9884\u89C8",docViewSource:"\u6E90\u7801",docViewTruncated:"\u6587\u672C\u8F83\u957F\uFF0C\u4EC5\u663E\u793A\u524D {limit} \u4E2A\u5B57\u7B26\uFF08\u5171 {total} \u5B57\u7B26\uFF09\uFF0C\u53EF\u4E0B\u8F7D\u5168\u6587\u3002",docViewEmpty:"\uFF08\u65E0\u6587\u672C\u5185\u5BB9\uFF09",docToc:"\u76EE\u5F55",docFullscreen:"\u5168\u5C4F",docExitFullscreen:"\u9000\u51FA\u5168\u5C4F",docCharCount:"{count} \u5B57\u7B26",docDownloadOriginal:"\u4E0B\u8F7D\u539F\u4EF6",docDownloadText:"\u4E0B\u8F7D\u6587\u672C",docDownloading:"\u4E0B\u8F7D\u4E2D...",docDownloadFailed:"\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",searchTitle:"\u68C0\u7D22\u6D4B\u8BD5",searchScope:"\u68C0\u7D22\u8303\u56F4\uFF1A\u300C{name}\u300D",searchQueryPlaceholder:"\u8F93\u5165\u67E5\u8BE2\u8BED\u53E5\uFF0C\u4F8B\u5982\uFF1A\u5982\u4F55\u5BFC\u51FA\u6570\u636E\uFF1F",searchBtn:"\u68C0\u7D22",searching:"\u68C0\u7D22\u4E2D...",searchTopKLabel:"\u8FD4\u56DE\u6761\u6570",searchThresholdLabel:"\u76F8\u4F3C\u5EA6\u9608\u503C",searchHitCount:"\u547D\u4E2D {count} \u6761",searchNoHits:"\u6CA1\u6709\u547D\u4E2D\u4EFB\u4F55\u5185\u5BB9\uFF0C\u53EF\u5C1D\u8BD5\u964D\u4F4E\u76F8\u4F3C\u5EA6\u9608\u503C\u3002",searchFallbackHint:"\u76F8\u4F3C\u5EA6\u5747\u4F4E\u4E8E\u9608\u503C\uFF0C\u4EE5\u4E0B\u4E3A\u6700\u4F73\u5339\u914D\uFF08\u4EC5\u4F9B\u53C2\u8003\uFF09\uFF1A",searchFailed:"\u68C0\u7D22\u5931\u8D25: {error}",expandFull:"\u5C55\u5F00\u5168\u6587",collapse:"\u6536\u8D77",scoreLabel:"\u76F8\u4F3C\u5EA6",opFailed:"\u64CD\u4F5C\u5931\u8D25: {error}"},contextBubble:{labelSelection:"\u9009\u4E2D\u5185\u5BB9",labelQuoted:"\u5F15\u7528",labelSkill:"\u6280\u80FD",labelMcp:"MCP",labelPage:"\u7F51\u9875",labelFile:"\u6587\u4EF6",labelKnowledge:"\u77E5\u8BC6\u5E93",clickToExpand:"\u70B9\u51FB\u5C55\u5F00",bubbleSkill:"{name} \u{1F9E9}",bubbleMcp:"{name} \u{1F50C}",bubblePage:"{title} \u{1F310}",bubbleKnowledge:"{name} \u{1F4DA} \xB7 \u547D\u4E2D {count} \u6761",bubbleKnowledgeMiss:"{name} \u{1F4DA} \xB7 \u672A\u547D\u4E2D",bubbleKnowledgeFailed:"{name} \u{1F4DA} \xB7 \u68C0\u7D22\u5931\u8D25",bubbleKnowledgeSearching:"\u6B63\u5728\u68C0\u7D22\u77E5\u8BC6\u5E93\u2026",kbHitToggle:"\u70B9\u51FB\u5C55\u5F00/\u6536\u8D77\u5168\u6587",kbHitTruncated:"\u2702 \u5DF2\u622A\u65AD \xB7 \u539F\u6587 {total} \u5B57\uFF0C\u524D {kept} \u5B57\u5DF2\u53D1\u9001",kbHitTruncatedTitle:"\u4E3A\u63A7\u5236\u4E0A\u4E0B\u6587\u4F53\u79EF\uFF0C\u5185\u5BB9\u622A\u65AD\u540E\u518D\u53D1\u9001\u7ED9\u6A21\u578B\uFF1B\u6B64\u5904\u663E\u793A\u7684\u5373\u6A21\u578B\u5B9E\u9645\u6536\u5230\u7684\u7248\u672C",kbHitTruncatedBadge:"\u2702 {count} \u6761\u5DF2\u622A\u65AD"},configDialog:{exportTitle:"\u5BFC\u51FA\u914D\u7F6E",includeSecrets:"\u5305\u542B API \u5BC6\u94A5",secretWarn:"\u26A0 \u654F\u611F\u4FE1\u606F\uFF0C\u8BF7\u786E\u4FDD\u6587\u4EF6\u5B89\u5168",exportDesc:"\u5BFC\u51FA\u6587\u4EF6\u5C06\u5305\u542B\u9664 Agent \u8FDE\u63A5\u4FE1\u606F\uFF08\u4EE3\u7406\u5730\u5740\u4E0E\u914D\u5BF9\u4EE4\u724C\uFF09\u5916\u7684\u6240\u6709\u914D\u7F6E\uFF1B\u52FE\u9009\u4E0B\u65B9\u9009\u9879\u540E\u4E00\u5E76\u5BFC\u51FA API \u5BC6\u94A5\u4E0E\u8FDE\u63A5\u4FE1\u606F\u3002",export:"\u5BFC\u51FA",importTitle:"\u5BFC\u5165\u914D\u7F6E",mergeImport:"\u5408\u5E76\u5BFC\u5165 \u2014 \u4EC5\u8986\u76D6\u6587\u4EF6\u4E2D\u5B58\u5728\u7684\u914D\u7F6E\u9879\uFF0C\u4FDD\u7559\u5176\u4ED6",replaceImport:"\u5B8C\u5168\u66FF\u6362 \u2014 \u6E05\u7A7A\u5F53\u524D\u914D\u7F6E\uFF0C\u4F7F\u7528\u6587\u4EF6\u4E2D\u7684\u914D\u7F6E",confirmImport:"\u786E\u8BA4\u5BFC\u5165",exportSuccess:"\u914D\u7F6E\u5DF2\u5BFC\u51FA",exportFailed:"\u5BFC\u51FA\u5931\u8D25: {error}",unknownTime:"\u672A\u77E5",importSummary:"\u5BFC\u51FA\u65F6\u95F4: {time}\uFF0C\u5305\u542B {count} \u9879\u914D\u7F6E",invalidFileFormat:"\u65E0\u6548\u7684\u6587\u4EF6\u683C\u5F0F",unrecognizedFormat:"\u65E0\u6CD5\u8BC6\u522B\u7684\u914D\u7F6E\u683C\u5F0F",unknownConfigKey:"\u672A\u77E5\u7684\u914D\u7F6E\u9879: {key}",importFailed:"\u5BFC\u5165\u5931\u8D25: {error}",importParseFailed:"\u5BFC\u5165\u5931\u8D25: \u65E0\u6CD5\u89E3\u6790\u6587\u4EF6\u683C\u5F0F",importedCount:"\u5DF2\u5BFC\u5165 {count} \u9879\u914D\u7F6E"},queue:{enqueueBtn:"\u52A0\u5165\u961F\u5217",enqueued:"\u5DF2\u52A0\u5165\u961F\u5217\uFF08\u7B2C {position} \u4F4D\uFF09",enqueueFailed:"\u52A0\u5165\u961F\u5217\u5931\u8D25\uFF0C\u5185\u5BB9\u5DF2\u4FDD\u7559\u5728\u8F93\u5165\u6846",queueFull:"\u961F\u5217\u5DF2\u6EE1\uFF08\u4E0A\u9650 {limit} \u6761\uFF09\uFF0C\u8BF7\u5148\u5904\u7406\u5DF2\u6392\u961F\u7684\u4EFB\u52A1",noSession:"\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5",summary:"\u6392\u961F {count} \u6761",summaryEmpty:"\u961F\u5217\u5DF2\u7A7A",summaryFailed:"{count} \u6761\u4EFB\u52A1\u5931\u8D25",summaryFailedHint:"\u4EFB\u52A1\u672A\u6210\u529F\u6267\u884C\uFF0C\u5C55\u5F00\u300C\u6700\u8FD1\u5904\u7406\u300D\u53EF\u91CD\u65B0\u5165\u961F",pausedTag:"\u5DF2\u6682\u505C",pausedHint:"\u81EA\u52A8\u63A5\u529B\u5DF2\u6682\u505C",pausedByStop:"\u4F60\u70B9\u51FB\u4E86\u505C\u6B62\uFF0C\u81EA\u52A8\u63A5\u529B\u5DF2\u6682\u505C",resumeQueue:"\u7EE7\u7EED\u961F\u5217",resumed:"\u5DF2\u7EE7\u7EED\u81EA\u52A8\u63A5\u529B",stopAndSend:"\u505C\u6B62\u5E76\u53D1\u9001",stopAndSendTitle:"\u653E\u5F03\u5F53\u524D\u8FD9\u4E00\u8F6E\uFF0C\u7ACB\u523B\u5F00\u59CB\u6267\u884C\u961F\u5217\uFF08\u53F3\u952E / \u957F\u6309\u505C\u6B62\u6309\u94AE\uFF09",stopAndSendEmpty:"\u961F\u5217\u91CC\u6CA1\u6709\u5F85\u6267\u884C\u7684\u4EFB\u52A1",stopAndSendStarted:"\u5DF2\u505C\u6B62\u5F53\u524D\u4EFB\u52A1\uFF0C\u961F\u5217\u5F00\u59CB\u6267\u884C",recentTitle:"\u6700\u8FD1\u5904\u7406",recentEmpty:"\u6682\u65E0\u5904\u7406\u8BB0\u5F55",requeue:"\u91CD\u65B0\u5165\u961F",requeued:"\u5DF2\u91CD\u65B0\u52A0\u5165\u961F\u5217",deleted:"\u5DF2\u4ECE\u961F\u5217\u5220\u9664",movedTop:"\u5DF2\u7F6E\u9876",withContext:"\u5E26\u4E0A\u4E0B\u6587",withImages:"\u5E26 {count} \u56FE",withFiles:"\u5E26 {count} \u6587\u4EF6",attachmentsVolatile:"\u56FE\u7247/\u6587\u4EF6\u8F83\u5927\uFF0C\u672A\u80FD\u6301\u4E45\u5316\u4FDD\u5B58\uFF1B\u9762\u677F\u5237\u65B0\u540E\u4F1A\u4E22\u5931\u8FD9\u4E9B\u9644\u4EF6\uFF0C\u5EFA\u8BAE\u5C3D\u5FEB\u6267\u884C\u672C\u6761",attachmentsMissing:"\u9644\u4EF6\u5DF2\u65E0\u6CD5\u6062\u590D\uFF08\u53EF\u80FD\u6765\u81EA\u5DF2\u5173\u95ED\u7684\u9762\u677F\u6216\u88AB\u91CA\u653E\uFF09\uFF0C\u672C\u6761\u5C06\u53EA\u53D1\u9001\u6587\u5B57",editBackWithAttachments:"\u5DF2\u56DE\u586B\uFF0C\u56FE\u7247/\u6587\u4EF6\u4E00\u5E76\u8FD8\u539F",requeuedNoAttachments:"\u5DF2\u91CD\u65B0\u5165\u961F\uFF08\u539F\u9644\u4EF6\u5DF2\u91CA\u653E\uFF0C\u4EC5\u6062\u590D\u6587\u5B57\uFF09",forgetRecent:"\u4ECE\u8BB0\u5F55\u4E2D\u79FB\u9664",forgotRecent:"\u5DF2\u4ECE\u300C\u6700\u8FD1\u5904\u7406\u300D\u79FB\u9664",filesStillExtracting:"\u9644\u4EF6\u6587\u4EF6\u8FD8\u5728\u89E3\u6790\u4E2D\uFF0C\u7B49\u89E3\u6790\u5B8C\u6210\u518D\u5165\u961F\uFF08\u73B0\u5728\u5165\u961F\u4F1A\u4E22\u6587\u4EF6\u5185\u5BB9\uFF09",inputHasUnsavedContext:"\u8F93\u5165\u533A\u8FD8\u6CA1\u5199\u7684\u56FE\u7247/\u6587\u4EF6/\u5F15\u7528\u4F1A\u56E0\u56DE\u586B\u88AB\u6E05\u6389\uFF1B\u8BF7\u5148\u53D1\u9001\u6216\u6E05\u7A7A\u5B83\u4EEC\u540E\u518D\u56DE\u586B",statusDispatching:"\u6267\u884C\u4E2D",statusInjecting:"\u63D2\u5165\u4E2D",statusInjected:"\u5DF2\u63D2\u5165",statusDone:"\u5DF2\u6267\u884C",statusFailed:"\u5931\u8D25",statusRecovered:"\u4E0A\u6B21\u672A\u5B8C\u6210",statusRunningHint:"\u6B63\u5728\u6267\u884C\u8FD9\u6761\u4EFB\u52A1\uFF08\u542B\u5DE5\u5177\u8C03\u7528\uFF09\uFF0C\u8DD1\u5B8C\u624D\u8F6E\u5230\u4E0B\u4E00\u6761",inject:"\u63D2\u5165\u5F53\u524D\u4EFB\u52A1\uFF08\u4E0D\u5FC5\u7B49\u5B83\u8DD1\u5B8C\uFF09",injectIdleHint:"\u5F53\u524D\u6CA1\u6709\u6B63\u5728\u6267\u884C\u7684\u4EFB\u52A1\uFF1B\u8FD9\u6761\u4F1A\u6309\u961F\u5217\u987A\u5E8F\u6267\u884C",injectAccepted:"\u5DF2\u6295\u9012\uFF0C\u5F53\u524D\u6B65\u9AA4\u7ED3\u675F\u540E\u751F\u6548",injected:"\u5DF2\u63D2\u5165\u5F53\u524D\u4EFB\u52A1",autoCarried:"\u5DF2\u81EA\u52A8\u5E26\u5165\u5F53\u524D\u4EFB\u52A1\uFF08\u7B2C {iteration} \u8F6E\uFF09",injectNoTask:"\u4EFB\u52A1\u521A\u597D\u7ED3\u675F\u4E86\uFF0C\u8FD9\u6761\u5DF2\u653E\u56DE\u961F\u5217",injectTimeout:"\u6CA1\u7B49\u5230\u63D2\u5165\u786E\u8BA4\uFF0C\u8FD9\u6761\u5DF2\u653E\u56DE\u961F\u5217",injectTimeoutAdhoc:"\u6CA1\u7B49\u5230\u63D2\u5165\u786E\u8BA4\uFF0C\u5185\u5BB9\u4ECD\u5728\u8F93\u5165\u6846",injectFailed:"\u63D2\u5165\u5931\u8D25\uFF0C\u8FD9\u6761\u5DF2\u653E\u56DE\u961F\u5217",injectNoAttachments:"\u5E26\u56FE\u7247/\u6587\u4EF6\u7684\u6761\u76EE\u4E0D\u80FD\u63D2\u5165\u8FD0\u884C\u4E2D\u7684\u4EFB\u52A1\uFF08\u53EA\u63D2\u7EAF\u6587\u672C\uFF09\uFF0C\u8BF7\u8BA9\u5B83\u6309\u961F\u5217\u987A\u5E8F\u6267\u884C",editBack:"\u56DE\u586B\u8F93\u5165\u6846",editTailHint:"\u5DF2\u53D6\u56DE\u961F\u5C3E\u4E00\u6761\uFF0C\u6539\u5B8C\u6309 Enter \u53D1\u9001",delete:"\u5220\u9664",stopNow:"\u505C\u6B62\u5F53\u524D\u4EFB\u52A1",tooManyAttempts:"\u8FD9\u6761\u5DF2\u8FDE\u7EED\u81EA\u52A8\u6267\u884C {count} \u6B21\u4ECD\u672A\u6210\u529F\uFF0C\u5DF2\u505C\u6B62\u91CD\u8BD5\u5E76\u79FB\u5165\u300C\u6700\u8FD1\u5904\u7406\u300D\uFF0C\u53EF\u624B\u52A8\u91CD\u65B0\u5165\u961F",badgeTitle:"\u8BE5\u4F1A\u8BDD\u6709 {count} \u6761\u6392\u961F\u4EFB\u52A1",sessionDropped:"\u8BE5\u4F1A\u8BDD\u8FD8\u6709 {count} \u6761\u6392\u961F\u4EFB\u52A1\uFF0C\u5DF2\u968F\u4F1A\u8BDD\u4E00\u5E76\u5220\u9664"}},qi={common:{confirm:"Confirm",cancel:"Cancel",close:"Close",ok:"OK",save:"Save",delete:"Delete",edit:"Edit",retry:"Retry",loading:"Loading...",none:"None",add:"Add",clear:"Clear",selectAll:"Select All",deselectAll:"Deselect All",refresh:"Refresh",enabled:"Enabled",disabled:"Disabled",bytes:"bytes",copy:"Copy",copySuccess:"Copied",copyFailed:"Copy failed"},dialog:{operationConfirm:"Operation Confirmation",confirmDefaultMessage:"The model requests to execute a sensitive operation. Allow?",confirmAction:"The model requests to execute: {name}",remainingTime:"Time remaining: {time}",deny:"Deny",approveOnce:"Allow Once",approveLoop:"Allow for This Task",pendingQueue:"(+{count} queued)",pendingQueueClarify:"(+{count} awaiting clarification)",otherPending:"(+{count} other waiting)",approveWhitelist:"Add to allowlist & allow",networkTitle:"Private Network Access",networkToolLabel:"Private network access",networkAccessRequest:"The model requests access to the private address {hostname} ({reason}). Allow?",networkWhitelistHint:'"Add to allowlist & allow" turns on private network access and adds this host to the allowlist; "Allow Once" only applies to this request.',networkReasonGateClosed:"Private network access is currently off",networkReasonNoAllowlist:"The private-network allowlist is empty",networkReasonNotAllowlisted:"This host is not in the private-network allowlist"},sensitiveTool:{manage_cookies:"Manage Cookies",manage_storage:"Page Storage Operation",download_file:"Download File",manage_tab:"Tab Management",agent_file:"File Operations",agent_exec:"Local Command Execution",debug_page:"Page Debugger",debuggerAttachHint:`
|
|
26
26
|
|
|
27
27
|
After enabling, a yellow "extension is debugging this browser" infobar appears on the tab until the session ends.`,unknown:"Unknown Operation",tabInfo:`
|
|
28
28
|
|
|
@@ -46,48 +46,50 @@ You will need to pair again after deletion.`,deleteAgentTitle:"Delete Agent",age
|
|
|
46
46
|
|
|
47
47
|
## Execution steps
|
|
48
48
|
1. Step 1
|
|
49
|
-
2. Step 2`,existingResources:"Existing resource files",skillNameRequired:"Please enter the Skill name",skillMarkdownRequired:"Please enter the SKILL.md content",agentSkillSaved:'Agent Skill "{name}" saved successfully',saveFailedShort:"Save failed",saveFailed:"Save failed: {error}",viewSkillTitle:"View Skill: {name}",importSkillTitle:"Import Skill",importBtn:"Import",jsonImport:"JSON Import",newAuthoring:"New Authoring",zipPackage:"Zip",urlImport:"URL Import",jsonImportDesc:"Import a Workflow Skill in JSON format (deterministic automated flow)",clickOrDragJson:"Click to select a JSON file or drag it here",jsonFileHint:"Supports .json Workflow Skill definition files",markdownImportDesc:"Write SKILL.md content directly to create an Agent Skill (AI capability extension)",zipImportDesc:"Import a Zip archive containing SKILL.md, with optional scripts/templates/assets resources",clickOrDragZip:"Click to select a Zip file or drag it here",zipFileHint:"The Zip must contain a SKILL.md file; optional scripts/ templates/ assets/ subdirectories",urlImportDesc:"Download a Skill Zip from a remote URL and import automatically",downloadUrl:"Download URL",selectJsonFile:"Please select a JSON file",workflowSkillImported:'Workflow Skill "{name}" imported successfully',agentSkillCreated:'Agent Skill "{name}" created successfully',createFailedShort:"Create failed",selectZipFile:"Please select a Zip file",fileTooLarge:"File too large; max 50MB supported",fileReadFailed:"File read failed",agentSkillImported:'Agent Skill "{name}" imported successfully',urlRequired:"Please enter a URL",importFailed:"Import failed: {error}",searchMcpPlaceholder:"Search MCP servers...",searchSkillPlaceholder:"Search skills...",filterAll:"All",filterEnabled:"Enabled",filterDisabled:"Disabled",noMatchResult:"No matching results"},memoryPanel:{tabTitle:"Memory",title:"Memory Vectors",enabled:"Enabled",disabled:"Disabled",statusTitle:"Vector index status",statusLoading:"Loading\u2026",statusOffline:"Agent is not connected, vector status unavailable",statusFail:"Failed to read vector status",statusOldAgent:"This agent version has no such status endpoint \u2014 restart the agent",statusDetail:"Response",statusIndexed:"Indexed {indexed} of {total}",statusStored:"Stored vector fingerprint",statusCurrent:"Current config fingerprint",statusTier:"Active tier",statusStale:"Stale: model changed without rebuild",statusFresh:"Matches current config",staleHint:"Old vectors are incomparable with the new config, so semantic recall degrades silently. Click \u201CRebuild vector index\u201D (save unsaved edits first).",modeLabel:"Embedding source",modeRemote:"Remote service (OpenAI-compatible API)",modeLocal:"Local model",baseUrlLabel:"Endpoint",baseUrlPlaceholder:"https://api.openai.com/v1",modelLabel:"Model name",modelPlaceholder:"BAAI/bge-m3",apiKeyLabel:"API Key",apiKeyPlaceholder:"Leave blank to keep the stored key",apiKeyClearBtn:"Clear stored key",apiKeyClearConfirm:"Remote semantic recall stops (falls back to keywords) until a new key is saved. Clear the stored key?",apiKeyCleared:"Stored API key cleared",apiKeyClearFail:"Failed to clear key: {error}",configNotLoaded:"Config failed to load. Refresh the panel before saving so the agent\u2019s stored settings are not overwritten with blanks",dimsLabel:"Vector dimensions (blank is fine, detected on test)",prefixLabel:"Query prefix (optional)",localNotice:"Local mode needs no connectivity test: save, then rebuild the vector index (the first run downloads the model and may take tens of minutes). Embeddings are silently truncated at 512 tokens, so only the head of an over-long entry is indexed.",testBtn:"Test connectivity",testRunning:"Testing\u2026",testOk:"OK: {model} returns {dims} dimensions",testFail:"Test failed: {error}",scopeHint:"Clicking the bottom \u201CSave\u201D also writes this tab\u2019s config into the agent service config.json; when the agent is offline this item is skipped and only extension settings are saved",saveSkippedOffline:"Agent not connected \u2014 memory vector config was not saved (only extension settings saved)",saveSuccess:"Memory vector config saved",saveFail:"Save failed: {error}",toggleOnSaved:"Semantic vector recall enabled",toggleOffSaved:"Semantic vector recall disabled - recall falls back to keywords",toggleFail:"Failed to toggle: {error}",reindexBtn:"Rebuild vector index",reindexConfirm:"Rebuilding recomputes vectors for every memory with the current config. On local mode 41 entries measured about 23 minutes (remote about 2). Keep this page open. Continue?",reindexRunning:"Rebuilding, please keep this page open\u2026",reindexDone:"Rebuild done: indexed {indexed} of {total}",reindexBatchFail:" ({count} batches failed, see agent logs)",reindexOverWindow:" ({count} entries exceed the {window}-token window, their tails are not indexed)",reindexSkipped:"Rebuild skipped: vector tier is disabled",reindexFail:"Rebuild failed: {error}",gateAgentOffTitle:"Agent not connected",gateAgentOffBody:'Memory vector config is provided by the local agent. Connect an agent in the "Agent" tab first, then come back here.',gateRagTitle:"Local model dependency missing",gateRagMissing:'Local models require the RAG dependency. Install it in the "Extensions" panel first, then come back here.',goToAgentTab:'Go to "Agent" tab',goToToolboxTab:'Go to "Extensions" tab'},memoryEntries:{title:"Memory Entries",refreshBtn:"Refresh",exportBtn:"Export",importBtn:"Import",exportEmpty:"No memory entries to export",exportDone:"Exported {count} memories to {file}",importParseFail:"Import failed: the file is not valid JSON",importFormatFail:"Import failed: unrecognized format, please choose a memory export or archive file",importConfirm:"Append {add} memories and skip {skipped} (duplicates or invalid). Existing memories are not overwritten, but imported entries cannot be undone in bulk. Continue?",importNone:"No new memories to import ({skipped} skipped)",importDone:"Import finished: {added} added, {skipped} skipped",importPartialFail:"Import finished: {added} added, {failed} failed, {skipped} skipped",searchPlaceholder:"Search content or tags\u2026",filterAll:"All types",filterFact:"Facts",filterSummary:"Summaries",sortCreatedDesc:"Created (newest first)",sortImportanceDesc:"Importance (high \u2192 low)",sortValueDesc:"Value (high \u2192 low)",sortValueAsc:"Value (low \u2192 high)",count:"{shown} of {total}",loading:"Loading\u2026",empty:"No memories yet",noMatch:"No entries match the filter",offline:"Agent not connected - memory entries unavailable",unsupported:"This agent version does not support memory entry management - upgrade and restart the agent",loadFail:"Failed to load memory entries: {error}",importanceShort:"Imp",valueShort:"Value",createdLabel:"Created",lastAccessLabel:"Last accessed",neverAccessed:"never",accessCount:"{count} accesses",tagsLabel:"Tags",editBtn:"Edit",deleteBtn:"Delete",editTitle:"Edit memory entry",typeLabel:"Type",contentLabel:"Content",importanceLabel:"Importance (1-10)",tagsPlaceholder:"comma-separated, e.g. environment, preference",saveBtn:"Save",cancelBtn:"Cancel",contentEmpty:"Content cannot be empty",saved:"Memory updated",saveFail:"Update failed: {error}",deleteConfirm:"Delete this memory? It cannot be undone, and its vector cache entry is dropped as well.",deleted:"Memory deleted",deleteFail:"Delete failed: {error}",candidatesHint:"{count} low-value memories are suggested for removal (value below 10)",compactBtn:"Compact now",compactConfirm:"Compacting archives {count} memories with value below {threshold}, then removes them from the memory store. Archive files can be used for recovery. Continue?",compactDone:"Compact done: archived {facts} facts and {summaries} summaries",compactArchived:"Archived {count} evicted memories to {dir}; you can restore them from there when needed",compactFail:"Compact failed: {error}"},knowledge:{tabTitle:"Knowledge",gateAgentOffTitle:"Agent not connected",gateAgentOffDesc:'Knowledge base is provided by the local agent. Connect an agent in the "Agent" tab first, then come back here.',gateRagOffTitle:"Knowledge base feature is disabled",gateRagOffDesc:'Turn on the "Knowledge Retrieval" master switch above to create and manage knowledge bases.',gateRagUnavailableTitle:"Agent capability not ready",gateRagUnavailableDesc:"RAG dependencies are not installed or the Node version is unsupported (Node 22+ required). See the install guide below.",goToAgentTab:'Go to "Agent" tab',goToToolboxTab:'Go to "Extensions" tab',enableNow:"Enable Now",title:"Knowledge Bases",createBtn:"+ New Knowledge Base",searchPlaceholder:"Search knowledge bases...",emptyTitle:"No knowledge base yet",emptyDesc:'Click "New Knowledge Base" to create one, then import documents to get started.',loadFailed:"Failed to load: {error}",retry:"Retry",statsSummary:"{docs} docs \xB7 {chunks} chunks",modeLocal:"Local model",modeRemote:"Remote service",actionEdit:"Edit",actionIngest:"Import",actionSearch:"Test Search",actionDocs:"Docs",actionExport:"Export",exporting:"Exporting...",exportSuccess:'Knowledge base "{name}" backup exported',exportFailed:"Knowledge base export failed: {error}",actionDelete:"Delete",actionEnable:"Enable",actionDisable:"Disable",badgeDisabled:"Disabled",enableSuccess:'Knowledge base "{name}" enabled',disableSuccess:'Knowledge base "{name}" disabled',createTitle:"New Knowledge Base",nameLabel:"Name",namePlaceholder:"e.g. Product Docs",descLabel:"Description (optional)",descPlaceholder:"Briefly describe what this knowledge base contains",createConfirm:"Create",creating:"Creating...",createSuccess:'Knowledge base "{name}" created',nameRequired:"Please enter a name",editTitle:"Edit Knowledge Base",editConfirm:"Save",saving:"Saving...",editSuccess:"Knowledge base updated",vectorSectionTitle:"Embedding model",vectorModeLocal:"Local model (bundled BGE Chinese model)",vectorModeRemote:"Remote service (OpenAI-compatible API)",vectorModeLocalHint:"Use the agent-bundled BGE Chinese model. No extra config needed; the model file downloads on first import.",vectorModeRemoteHint:"Call a remote OpenAI-compatible embedding service (SiliconFlow, Zhipu, OpenAI, etc.).",vectorEndpointLabel:"Endpoint (Base URL with version segment)",vectorEndpointPlaceholder:"e.g. https://api.siliconflow.cn/v1",vectorApiKeyLabel:"API Key",vectorApiKeyPlaceholder:"Paste API key",vectorApiKeyKeep:"Leave empty to keep the saved key",vectorModelLabel:"Model name",vectorModelPlaceholder:"e.g. BAAI/bge-m3",vectorDimsLabel:"Dimensions (optional, auto-detected on test)",vectorDimsPlaceholder:"Auto",vectorTestBtn:"Test Connection",vectorTesting:"Testing...",vectorTestOk:"Connected: {model} ({dims} dims)",vectorDimsFilled:"Dimensions auto-filled: {dims}",vectorTestFailed:"Test failed: {error}",vectorEndpointRequired:"Remote endpoint is required",vectorModelRequired:"Model name is required",rebuildConfirmTitle:"Change Embedding Config",rebuildConfirm:"Changing the embedding model or chunk settings requires rebuilding the index (all documents will be re-embedded). The old index stays searchable during the rebuild and switches automatically when done. Continue?",rebuildStarted:"Index rebuild started, refreshing when complete...",progressRebuilding:"Rebuilding index {current}/{total} documents\u2026",rebuildDone:"Index rebuild complete",rebuildFailed:"Index rebuild failed: {error}",deleteConfirmTitle:"Delete Knowledge Base",deleteConfirm:'Delete "{name}"? Its {docs} documents and {chunks} chunks will be removed permanently.',deleteSuccess:"Knowledge base deleted",ingestTitle:'Import documents into "{name}"',tabFile:"File",tabText:"Text",tabUrl:"URL",dropHint:"Drag & drop files here, or click to choose (multiple allowed)",dropSupported:"Supports txt / md / pdf / docx / xlsx / html, up to 50MB per file, 20 files per batch",selectedFile:"Selected: {name}",selectedCount:"Selected {count} file(s) (max {max} per batch)",removeFile:"Remove",textContentLabel:"Text content",textContentPlaceholder:"Paste the text to import here...",textNameLabel:"Document name (optional)",textNamePlaceholder:"Leave empty to auto-name",urlLabel:"Web page URL",urlPlaceholder:"https://example.com/page",chunkSettingsTitle:"Chunk settings",chunkSizeLabel:"Chunk size (chars)",chunkOverlapLabel:"Overlap (chars)",ingestConfirm:"Start Import",ingesting:"Parsing and embedding. The first import may download the model, please wait...",progressParsing:"Parsing document\u2026",progressChunking:"Splitting into chunks\u2026",progressEmbedding:"Embedding chunks {current}/{total}\u2026",progressStoring:"Writing to index\u2026",ingestSuccess:"Imported: {name} ({chunks} chunks)",ingestFailed:"Import failed: {error}",fileRequired:"Please choose a file first",contentRequired:"Please enter the text content",urlRequired:"Please enter the URL",fileTooLarge:"File too large, 50MB max",fileTypeUnsupported:"Unsupported file type: {name}",maxBatchFiles:"Up to {max} files per batch; please import in smaller batches",importingBatch:"Importing {current}/{total}: {name}",batchAllSuccess:"Batch import done: {count} documents ({chunks} chunks)",batchPartial:"Import done: {success} succeeded, {fail} failed (first error: {error})",batchAllFailed:"All imports failed: {error}",docsTitle:'Documents in "{name}"',docsEmpty:"No documents imported yet",docSearchPlaceholder:"Search document name or source...",docSearchEmpty:"No matching documents",docChunkCount:"{count} chunks",docDeleteConfirmTitle:"Delete Document",docDeleteConfirm:'Delete document "{name}"? All its chunks will be removed from the knowledge base.',docDeleteSuccess:"Document deleted",docSourceFile:"File",docSourceUrl:"Web",docSourceText:"Text",docOriginalSize:"Original {size}",docOriginalName:"original file {name}",docNoOriginal:"original not kept",docNoOriginalText:"text-only import, no original file",docOriginalQuotaSkipped:"original skipped (quota exceeded)",docOriginalMissing:"No original file for this document; text view only",docOriginalSkippedToast:"Original not saved (quota exceeded); text and vectors were indexed",docView:"View",docViewTitle:"View Original Text",docViewCopy:"Copy",docViewCopied:"Copied to clipboard",docViewPreview:"Preview",docViewSource:"Source",docViewTruncated:"Text is long; showing the first {limit} of {total} characters. Download the full text instead.",docViewEmpty:"(no text content)",docToc:"Outline",docFullscreen:"Fullscreen",docExitFullscreen:"Exit Fullscreen",docCharCount:"{count} chars",docDownloadOriginal:"Download Original",docDownloadText:"Download Text",docDownloading:"Downloading...",docDownloadFailed:"Download failed, please retry",searchTitle:"Test Search",searchScope:'Scope: "{name}"',searchQueryPlaceholder:"Enter a query, e.g. How to export data?",searchBtn:"Search",searching:"Searching...",searchTopKLabel:"Top K",searchThresholdLabel:"Threshold",searchHitCount:"{count} hits",searchNoHits:"No hits. Try lowering the similarity threshold.",searchFallbackHint:"All scores are below the threshold. Best matches for reference:",searchFailed:"Search failed: {error}",expandFull:"Expand",collapse:"Collapse",scoreLabel:"Score",opFailed:"Operation failed: {error}"},contextBubble:{labelSelection:"Selection",labelQuoted:"Quote",labelSkill:"Skill",labelMcp:"MCP",labelPage:"Page",labelFile:"File",labelKnowledge:"Knowledge",clickToExpand:"Click to expand",bubbleSkill:"{name} \u{1F9E9}",bubbleMcp:"{name} \u{1F50C}",bubblePage:"{title} \u{1F310}",bubbleKnowledge:"{name} \u{1F4DA} \xB7 {count} hits",bubbleKnowledgeMiss:"{name} \u{1F4DA} \xB7 no match",bubbleKnowledgeFailed:"{name} \u{1F4DA} \xB7 retrieval failed",bubbleKnowledgeSearching:"Searching knowledge base\u2026",kbHitToggle:"Click to expand/collapse",kbHitTruncated:"\u2702 Truncated \xB7 {total} chars total, first {kept} sent",kbHitTruncatedTitle:"Truncated to fit the context window; what is shown here is exactly what the model received",kbHitTruncatedBadge:"\u2702 {count} truncated"},configDialog:{exportTitle:"Export Settings",includeSecrets:"Include API keys",secretWarn:"\u26A0 Sensitive information; keep the file safe",exportDesc:"The exported file contains all settings except Agent connection info (proxy URL and pairing token); check the option below to include API keys and connection info as well.",export:"Export",importTitle:"Import Settings",mergeImport:"Merge import \u2014 only overwrite settings present in the file; keep the rest",replaceImport:"Full replace \u2014 clear current settings and use the file content",confirmImport:"Confirm Import",exportSuccess:"Settings exported",exportFailed:"Export failed: {error}",unknownTime:"Unknown",importSummary:"Exported at: {time}, containing {count} settings",invalidFileFormat:"Invalid file format",unrecognizedFormat:"Unrecognized settings format",unknownConfigKey:"Unknown setting key: {key}",importFailed:"Import failed: {error}",importParseFailed:"Import failed: cannot parse file format",importedCount:"Imported {count} settings"},queue:{enqueueBtn:"Add to queue",enqueued:"Added to queue (position {position})",enqueueFailed:"Failed to queue, your text is kept in the input",queueFull:"Queue is full (limit {limit}), please clear some queued tasks first",noSession:"Not ready yet, please retry shortly",summary:"{count} queued",summaryEmpty:"Queue empty",summaryFailed:"{count} task(s) failed",summaryFailedHint:"Failed to run; open Recent to requeue",pausedTag:"Paused",pausedHint:"Auto relay is paused",pausedByStop:"You stopped the task, so auto relay is paused",resumeQueue:"Resume queue",resumed:"Auto relay resumed",stopAndSend:"Stop and send",stopAndSendTitle:"Drop this round and start the queue now (right-click / long-press the stop button)",stopAndSendEmpty:"Nothing is waiting in the queue",stopAndSendStarted:"Current task stopped; the queue is starting",recentTitle:"Recent",recentEmpty:"No processed items yet",requeue:"Re-queue",requeued:"Added back to the queue",deleted:"Removed from queue",movedTop:"Moved to top",withContext:"with context",withImages:"{count} image(s)",withFiles:"{count} file(s)",attachmentsVolatile:"Images/files are too large to persist; they will be lost if the panel reloads, so run this item soon",attachmentsMissing:"Attachments could not be recovered (panel closed or released); this item will send text only",editBackWithAttachments:"Restored to input, including images/files",requeuedNoAttachments:"Requeued (original attachments released, text only)",forgetRecent:"Remove from history",forgotRecent:"Removed from Recent",filesStillExtracting:"Attached files are still being parsed; wait until parsing finishes before queueing (queueing now would lose file content)",inputHasUnsavedContext:"Images/files/quotes attached without text would be cleared by this restore; send or clear them first",statusDispatching:"Running",statusInjecting:"Inserting",statusInjected:"Inserted",statusDone:"Done",statusFailed:"Failed",statusRecovered:"Interrupted",statusRunningHint:"This task is running (tool calls included); the next one starts after it finishes",inject:"Insert into the running task (no need to wait for it)",injectIdleHint:"No task is running; this item will run in queue order",injectAccepted:"Delivered \u2014 takes effect after the current step",injected:"Inserted into the running task",autoCarried:"Queued item carried into the running task (round {iteration})",injectNoTask:"The task just finished; this item is back in the queue",injectTimeout:"No insertion confirmation; this item is back in the queue",injectTimeoutAdhoc:"No insertion confirmation; your text is still in the input box",injectFailed:"Insertion failed; this item is back in the queue",injectNoAttachments:"Items with images/files cannot be inserted into a running task (text only); let them run in queue order",editBack:"Edit in input",editTailHint:"Last queued item restored to the input; press Enter to send when done",delete:"Delete",stopNow:"Stop current task",tooManyAttempts:"This item failed {count} automatic attempts in a row; retries stopped and it was moved to Recent so you can requeue it manually",badgeTitle:"This session has {count} queued task(s)",sessionDropped:"This session had {count} queued task(s); they were removed along with the session"}};function Dt(){if(typeof chrome>"u"||!chrome.i18n)return"zh";try{let e=chrome.i18n.getUILanguage();if(e&&e.startsWith("zh"))return"zh"}catch{}return"en"}var j="zh",oe={zh:Uo,en:Ko},lt=new Set;function Lt(e,t){if(!e||!t)return;let o=t.split("."),n=e;for(let a of o){if(typeof n!="object"||!n)return;n=n[a]}return typeof n=="string"?n:void 0}function Nt(e,t){return!t||typeof e!="string"?e:e.replace(/\{(\w+)\}/g,(o,n)=>t[n]!==void 0&&t[n]!==null?String(t[n]):o)}function u(e,t){let o=Lt(oe[j],e);if(o!==void 0)return Nt(o,t);if(j!=="en"){let n=Lt(oe.en,e);if(n!==void 0)return Nt(n,t)}return e}function Ht(e){return typeof e=="function"&<.add(e),()=>lt.delete(e)}function E(e,t){oe[e]||(oe[e]={}),oe[e]=Ot(oe[e],t)}function Ot(e,t){for(let o of Object.keys(t||{}))t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((!e[o]||typeof e[o]!="object")&&(e[o]={}),Ot(e[o],t[o])):e[o]=t[o];return e}var Ft=!1;async function Bt(){if(typeof chrome>"u"||!chrome.storage||!chrome.storage.local)return j;try{let e=await chrome.storage.local.get("language");if(e.language&&oe[e.language])j=e.language;else{let t=Dt();j=t,chrome.storage.local.set({language:t}).catch(()=>{})}}catch{j=Dt()}if(!Ft){Ft=!0;try{chrome.storage.onChanged.addListener((e,t)=>{if(t!=="local"||!e.language)return;let o=e.language.newValue;if(o&&oe[o]&&o!==j){j=o;for(let n of lt)try{n(o)}catch{}}})}catch{}}return j}var Q={fetchUrl:{fallback:15e3,min:1e3,max:12e4},tabLoad:{fallback:15e3,min:1e3,max:12e4},navigation:{fallback:3e4,min:1e3,max:12e4},waitElement:{fallback:1e4,min:200,max:6e4},selectOption:{fallback:5e3,min:200,max:6e4},actionWait:{fallback:2e3,min:200,max:3e4},actionMinWait:{fallback:300,min:200,max:5e3}};function Y(e,t){let{fallback:o,min:n,max:a}=t,i=Number(e);return!Number.isFinite(i)||i<=0?o:Math.min(a,Math.max(n,Math.floor(i)))}E("zh",{pageInteraction:{refHint:"ref \u7F16\u53F7\u4EC5\u672C\u6B21\u67E5\u8BE2\u6709\u6548\uFF0C\u9875\u9762\u5BFC\u822A/\u5237\u65B0\u6216\u5207\u6362 tab \u540E\u9700\u91CD\u65B0 query_elements",snapshotHeader:"\u53EF\u4EA4\u4E92\u5143\u7D20\u5FEB\u7167\uFF1A{count} \u4E2A\u5143\u7D20",snapshotTruncated:"\uFF08\u5171 {total} \u4E2A\uFF0C\u5DF2\u622A\u65AD\uFF0C\u8BF7\u7528 filterByText \u7F29\u5C0F\u8303\u56F4\uFF09",snapshotPageInfo:"\uFF08\u7B2C {page}/{totalPages} \u9875\uFF0C\u672C\u6B21\u8F93\u51FA {count} \u4E2A\uFF09",snapshotHasMore:"\u8FD8\u6709\u66F4\u591A\u5143\u7D20\uFF1A\u8C03\u7528 query_elements \u65F6\u5E26 page={next} \u67E5\u770B",snapshotPageOutOfRange:"page={page} \u8D85\u51FA\u8303\u56F4\uFF08\u5171 {totalPages} \u9875\uFF09",snapshotOverlayBlock:"[\u6253\u5F00\u5C42]",snapshotBodyBlock:"[\u9875\u9762\u4E3B\u4F53]",snapshotFooter:"\uFF08ref \u7F16\u53F7\u4EC5\u5F53\u524D\u5FEB\u7167\u6709\u6548\uFF1B\u9875\u9762\u53D8\u5316\u540E\u8BF7\u91CD\u65B0\u8C03\u7528 query_elements\uFF09",snapshotHeaderFrames:"\uFF08\u542B {n} \u4E2A iframe\uFF09",snapshotFramesLimited:"\uFF08\u90E8\u5206 iframe \u8D85\u51FA\u6570\u91CF/\u6DF1\u5EA6\u4E0A\u9650\uFF0C\u672A\u5C55\u5F00\uFF09",snapshotFrameBlock:"[frame #{index}{title}{hostSeg}]",snapshotFramePlaceholder:"iframe #{index}{title}",snapshotFrameUnreachable:"\uFF08\u5185\u5BB9\u4E0D\u53EF\u8BBF\u95EE\uFF09"}}),E("en",{pageInteraction:{refHint:"ref numbers are only valid for the current query; re-run query_elements after page navigation/refresh or tab switch",snapshotHeader:"Interactive elements snapshot: {count} element(s)",snapshotTruncated:" (of {total} total; truncated \u2014 narrow down with filterByText)",snapshotPageInfo:" (page {page}/{totalPages}, {count} shown)",snapshotHasMore:"More elements available: call query_elements with page={next}",snapshotPageOutOfRange:"page={page} is out of range (only {totalPages} page(s))",snapshotOverlayBlock:"[Open overlays]",snapshotBodyBlock:"[Page body]",snapshotFooter:"(ref numbers are valid only for this snapshot; re-run query_elements after the page changes)",snapshotHeaderFrames:" ({n} iframe(s))",snapshotFramesLimited:" (some iframes exceed count/depth limits; not expanded)",snapshotFrameBlock:"[frame #{index}{title}{hostSeg}]",snapshotFramePlaceholder:"iframe #{index}{title}",snapshotFrameUnreachable:" (content inaccessible)"}});function Go(e){if(!e)return"";if(e==="about:srcdoc")return"srcdoc";if(e==="about:blank")return"blank";try{return new URL(e).hostname||""}catch{return""}}function st(e,t){for(let o of e)o.t==="el"&&o.localRef!=null&&t.push(o),o.children&&o.children.length&&st(o.children,t)}function $o(e,t,o){if(e.status==="hidden"||e.status==="off")return!1;let n=e.title?` "${e.title}"`:"",a;return a=e.status==="ok"&&e.frameIndex!=null?u("pageInteraction.snapshotFramePlaceholder",{index:e.frameIndex,title:n}):e.status==="unreachable"&&e.frameIndex!=null?u("pageInteraction.snapshotFramePlaceholder",{index:e.frameIndex,title:n})+u("pageInteraction.snapshotFrameUnreachable"):`iframe${n}`,a=" ".repeat(e.depth||0)+a,o.budget-=a.length+1,t.push(a),!0}function ct(e,t,o){if(!e)return!1;if(e.t==="frame")return $o(e,t,o);let n=[],a=!1;for(let i of e.children||[])ct(i,n,o)&&(a=!0);if(e.t==="el"){if(e.localRef!=null&&o.selected.has(e)){if(o.budget<=0)return o.truncated=!0,a;let i=e.role||"",r=e.name||"",l=e.attrs||"",s=e.depth+i.length+(r?r.length+2:0)+(l?l.length+1:0)+12;if(o.budget-s<0)return o.truncated=!0,a;let c=`${" ".repeat(e.depth)}${i}${r?` "${r}"`:""} [ref ${e.localRef}]${l?" "+l:""}`;return o.budget-=c.length+1,o.count+=1,t.push(c,...n),!0}return a?(t.push(...n),!0):!1}if(e.t==="container"){if(a){let i=`${" ".repeat(e.depth)}${e.role}${e.name?` "${e.name}"`:""}`;return o.budget-=i.length+1,t.push(i,...n),!0}return!1}return a?(t.push(...n),!0):!1}function qt(e,t,o){let n=[];if((e.overlayTrees||[]).length){for(let a of e.overlayTrees)ct(a,n,o);n.length&&t.push(u("pageInteraction.snapshotOverlayBlock"),...n,u("pageInteraction.snapshotBodyBlock"))}for(let a of e.bodyTree||[])ct(a,t,o)}function _t(e={}){let{frames:t=[],page:o=1,maxResults:n=100,maxChars:a=6e3,countOnly:i=!1,frameCount:r=0,framesLimited:l=0}=e||{},s=Number.isInteger(o)&&o>=1?o:1,c=Math.max(1,n),d=[];for(let A of t)st(A.overlayTrees||[],d),st(A.bodyTree||[],d);let p=d.length;if(i)return{success:!0,content:"",count:p,total:p,truncated:!1,hint:""};let m=Math.ceil(p/c),h=r>0?u("pageInteraction.snapshotHeaderFrames",{n:r}):"",f=l>0?u("pageInteraction.snapshotFramesLimited"):"";if(p>0&&s>m)return{success:!0,content:[u("pageInteraction.snapshotHeader",{count:p})+h+f,u("pageInteraction.snapshotPageOutOfRange",{page:s,totalPages:m}),u("pageInteraction.snapshotFooter")].join(`
|
|
50
|
-
`),count:0,total:p,page:
|
|
51
|
-
`),count:
|
|
52
|
-
`+ye(i.shadowRoot,t,o+1,n)),i.tagName==="IFRAME"||i.tagName==="FRAME")try{let r=i.contentDocument||i.contentWindow?.document;r&&r.body&&(a+=`
|
|
53
|
-
`+
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
2. Step 2`,existingResources:"Existing resource files",skillNameRequired:"Please enter the Skill name",skillMarkdownRequired:"Please enter the SKILL.md content",agentSkillSaved:'Agent Skill "{name}" saved successfully',saveFailedShort:"Save failed",saveFailed:"Save failed: {error}",viewSkillTitle:"View Skill: {name}",importSkillTitle:"Import Skill",importBtn:"Import",jsonImport:"JSON Import",newAuthoring:"New Authoring",zipPackage:"Zip",urlImport:"URL Import",jsonImportDesc:"Import a Workflow Skill in JSON format (deterministic automated flow)",clickOrDragJson:"Click to select a JSON file or drag it here",jsonFileHint:"Supports .json Workflow Skill definition files",markdownImportDesc:"Write SKILL.md content directly to create an Agent Skill (AI capability extension)",zipImportDesc:"Import a Zip archive containing SKILL.md, with optional scripts/templates/assets resources",clickOrDragZip:"Click to select a Zip file or drag it here",zipFileHint:"The Zip must contain a SKILL.md file; optional scripts/ templates/ assets/ subdirectories",urlImportDesc:"Download a Skill Zip from a remote URL and import automatically",downloadUrl:"Download URL",selectJsonFile:"Please select a JSON file",workflowSkillImported:'Workflow Skill "{name}" imported successfully',agentSkillCreated:'Agent Skill "{name}" created successfully',createFailedShort:"Create failed",selectZipFile:"Please select a Zip file",fileTooLarge:"File too large; max 50MB supported",fileReadFailed:"File read failed",agentSkillImported:'Agent Skill "{name}" imported successfully',urlRequired:"Please enter a URL",importFailed:"Import failed: {error}",searchMcpPlaceholder:"Search MCP servers...",searchSkillPlaceholder:"Search skills...",filterAll:"All",filterEnabled:"Enabled",filterDisabled:"Disabled",noMatchResult:"No matching results"},memoryPanel:{tabTitle:"Memory",title:"Memory Vectors",enabled:"Enabled",disabled:"Disabled",statusTitle:"Vector index status",statusLoading:"Loading\u2026",statusOffline:"Agent is not connected, vector status unavailable",statusFail:"Failed to read vector status",statusOldAgent:"This agent version has no such status endpoint \u2014 restart the agent",statusDetail:"Response",statusIndexed:"Indexed {indexed} of {total}",statusStored:"Stored vector fingerprint",statusCurrent:"Current config fingerprint",statusTier:"Active tier",statusStale:"Stale: model changed without rebuild",statusFresh:"Matches current config",staleHint:"Old vectors are incomparable with the new config, so semantic recall degrades silently. Click \u201CRebuild vector index\u201D (save unsaved edits first).",modeLabel:"Embedding source",modeRemote:"Remote service (OpenAI-compatible API)",modeLocal:"Local model",baseUrlLabel:"Endpoint",baseUrlPlaceholder:"https://api.openai.com/v1",modelLabel:"Model name",modelPlaceholder:"BAAI/bge-m3",apiKeyLabel:"API Key",apiKeyPlaceholder:"Leave blank to keep the stored key",apiKeyClearBtn:"Clear stored key",apiKeyClearConfirm:"Remote semantic recall stops (falls back to keywords) until a new key is saved. Clear the stored key?",apiKeyCleared:"Stored API key cleared",apiKeyClearFail:"Failed to clear key: {error}",configNotLoaded:"Config failed to load. Refresh the panel before saving so the agent\u2019s stored settings are not overwritten with blanks",dimsLabel:"Vector dimensions (blank is fine, detected on test)",prefixLabel:"Query prefix (optional)",localNotice:"Local mode needs no connectivity test: save, then rebuild the vector index (the first run downloads the model and may take tens of minutes). Embeddings are silently truncated at 512 tokens, so only the head of an over-long entry is indexed.",testBtn:"Test connectivity",testRunning:"Testing\u2026",testOk:"OK: {model} returns {dims} dimensions",testFail:"Test failed: {error}",scopeHint:"Clicking the bottom \u201CSave\u201D also writes this tab\u2019s config into the agent service config.json; when the agent is offline this item is skipped and only extension settings are saved",saveSkippedOffline:"Agent not connected \u2014 memory vector config was not saved (only extension settings saved)",saveSuccess:"Memory vector config saved",saveFail:"Save failed: {error}",toggleOnSaved:"Semantic vector recall enabled",toggleOffSaved:"Semantic vector recall disabled - recall falls back to keywords",toggleFail:"Failed to toggle: {error}",reindexBtn:"Rebuild vector index",reindexConfirm:"Rebuilding recomputes vectors for every memory with the current config. On local mode 41 entries measured about 23 minutes (remote about 2). Keep this page open. Continue?",reindexRunning:"Rebuilding, please keep this page open\u2026",reindexDone:"Rebuild done: indexed {indexed} of {total}",reindexBatchFail:" ({count} batches failed, see agent logs)",reindexOverWindow:" ({count} entries exceed the {window}-token window, their tails are not indexed)",reindexSkipped:"Rebuild skipped: vector tier is disabled",reindexFail:"Rebuild failed: {error}",gateAgentOffTitle:"Agent not connected",gateAgentOffBody:'Memory vector config is provided by the local agent. Connect an agent in the "Agent" tab first, then come back here.',gateRagTitle:"Local model dependency missing",gateRagMissing:'Local models require the RAG dependency. Install it in the "Extensions" panel first, then come back here.',goToAgentTab:'Go to "Agent" tab',goToToolboxTab:'Go to "Extensions" tab'},memoryEntries:{title:"Memory Entries",refreshBtn:"Refresh",exportBtn:"Export",importBtn:"Import",exportEmpty:"No memory entries to export",exportDone:"Exported {count} memories to {file}",importParseFail:"Import failed: the file is not valid JSON",importFormatFail:"Import failed: unrecognized format, please choose a memory export or archive file",importConfirm:"Append {add} memories and skip {skipped} (duplicates or invalid). Existing memories are not overwritten, but imported entries cannot be undone in bulk. Continue?",importNone:"No new memories to import ({skipped} skipped)",importDone:"Import finished: {added} added, {skipped} skipped",importPartialFail:"Import finished: {added} added, {failed} failed, {skipped} skipped",searchPlaceholder:"Search content or tags\u2026",filterAll:"All types",filterFact:"Facts",filterSummary:"Summaries",sortCreatedDesc:"Created (newest first)",sortImportanceDesc:"Importance (high \u2192 low)",sortValueDesc:"Value (high \u2192 low)",sortValueAsc:"Value (low \u2192 high)",count:"{shown} of {total}",loading:"Loading\u2026",empty:"No memories yet",noMatch:"No entries match the filter",offline:"Agent not connected - memory entries unavailable",unsupported:"This agent version does not support memory entry management - upgrade and restart the agent",loadFail:"Failed to load memory entries: {error}",importanceShort:"Imp",valueShort:"Value",createdLabel:"Created",lastAccessLabel:"Last accessed",neverAccessed:"never",accessCount:"{count} accesses",tagsLabel:"Tags",editBtn:"Edit",deleteBtn:"Delete",editTitle:"Edit memory entry",typeLabel:"Type",contentLabel:"Content",importanceLabel:"Importance (1-10)",tagsPlaceholder:"comma-separated, e.g. environment, preference",saveBtn:"Save",cancelBtn:"Cancel",contentEmpty:"Content cannot be empty",saved:"Memory updated",saveFail:"Update failed: {error}",deleteConfirm:"Delete this memory? It cannot be undone, and its vector cache entry is dropped as well.",deleted:"Memory deleted",deleteFail:"Delete failed: {error}",candidatesHint:"{count} low-value memories are suggested for removal (value below 10)",compactBtn:"Compact now",compactConfirm:"Compacting archives {count} memories with value below {threshold}, then removes them from the memory store. Archive files can be used for recovery. Continue?",compactDone:"Compact done: archived {facts} facts and {summaries} summaries",compactArchived:"Archived {count} evicted memories to {dir}; you can restore them from there when needed",compactFail:"Compact failed: {error}"},knowledge:{tabTitle:"Knowledge",gateAgentOffTitle:"Agent not connected",gateAgentOffDesc:'Knowledge base is provided by the local agent. Connect an agent in the "Agent" tab first, then come back here.',gateRagOffTitle:"Knowledge base feature is disabled",gateRagOffDesc:'Turn on the "Knowledge Retrieval" master switch above to create and manage knowledge bases.',gateRagUnavailableTitle:"Agent capability not ready",gateRagUnavailableDesc:"RAG dependencies are not installed or the Node version is unsupported (Node 22+ required). See the install guide below.",goToAgentTab:'Go to "Agent" tab',goToToolboxTab:'Go to "Extensions" tab',enableNow:"Enable Now",title:"Knowledge Bases",createBtn:"+ New Knowledge Base",searchPlaceholder:"Search knowledge bases...",emptyTitle:"No knowledge base yet",emptyDesc:'Click "New Knowledge Base" to create one, then import documents to get started.',loadFailed:"Failed to load: {error}",retry:"Retry",statsSummary:"{docs} docs \xB7 {chunks} chunks",modeLocal:"Local model",modeRemote:"Remote service",actionEdit:"Edit",actionIngest:"Import",actionSearch:"Test Search",actionDocs:"Docs",actionExport:"Export",exporting:"Exporting...",exportSuccess:'Knowledge base "{name}" backup exported',exportFailed:"Knowledge base export failed: {error}",actionDelete:"Delete",actionEnable:"Enable",actionDisable:"Disable",badgeDisabled:"Disabled",enableSuccess:'Knowledge base "{name}" enabled',disableSuccess:'Knowledge base "{name}" disabled',createTitle:"New Knowledge Base",nameLabel:"Name",namePlaceholder:"e.g. Product Docs",descLabel:"Description (optional)",descPlaceholder:"Briefly describe what this knowledge base contains",createConfirm:"Create",creating:"Creating...",createSuccess:'Knowledge base "{name}" created',nameRequired:"Please enter a name",editTitle:"Edit Knowledge Base",editConfirm:"Save",saving:"Saving...",editSuccess:"Knowledge base updated",vectorSectionTitle:"Embedding model",vectorModeLocal:"Local model (bundled BGE Chinese model)",vectorModeRemote:"Remote service (OpenAI-compatible API)",vectorModeLocalHint:"Use the agent-bundled BGE Chinese model. No extra config needed; the model file downloads on first import.",vectorModeRemoteHint:"Call a remote OpenAI-compatible embedding service (SiliconFlow, Zhipu, OpenAI, etc.).",vectorEndpointLabel:"Endpoint (Base URL with version segment)",vectorEndpointPlaceholder:"e.g. https://api.siliconflow.cn/v1",vectorApiKeyLabel:"API Key",vectorApiKeyPlaceholder:"Paste API key",vectorApiKeyKeep:"Leave empty to keep the saved key",vectorModelLabel:"Model name",vectorModelPlaceholder:"e.g. BAAI/bge-m3",vectorDimsLabel:"Dimensions (optional, auto-detected on test)",vectorDimsPlaceholder:"Auto",vectorTestBtn:"Test Connection",vectorTesting:"Testing...",vectorTestOk:"Connected: {model} ({dims} dims)",vectorDimsFilled:"Dimensions auto-filled: {dims}",vectorTestFailed:"Test failed: {error}",vectorEndpointRequired:"Remote endpoint is required",vectorModelRequired:"Model name is required",rebuildConfirmTitle:"Change Embedding Config",rebuildConfirm:"Changing the embedding model or chunk settings requires rebuilding the index (all documents will be re-embedded). The old index stays searchable during the rebuild and switches automatically when done. Continue?",rebuildStarted:"Index rebuild started, refreshing when complete...",progressRebuilding:"Rebuilding index {current}/{total} documents\u2026",rebuildDone:"Index rebuild complete",rebuildFailed:"Index rebuild failed: {error}",deleteConfirmTitle:"Delete Knowledge Base",deleteConfirm:'Delete "{name}"? Its {docs} documents and {chunks} chunks will be removed permanently.',deleteSuccess:"Knowledge base deleted",ingestTitle:'Import documents into "{name}"',tabFile:"File",tabText:"Text",tabUrl:"URL",dropHint:"Drag & drop files here, or click to choose (multiple allowed)",dropSupported:"Supports txt / md / pdf / docx / xlsx / html, up to 50MB per file, 20 files per batch",selectedFile:"Selected: {name}",selectedCount:"Selected {count} file(s) (max {max} per batch)",removeFile:"Remove",textContentLabel:"Text content",textContentPlaceholder:"Paste the text to import here...",textNameLabel:"Document name (optional)",textNamePlaceholder:"Leave empty to auto-name",urlLabel:"Web page URL",urlPlaceholder:"https://example.com/page",chunkSettingsTitle:"Chunk settings",chunkSizeLabel:"Chunk size (chars)",chunkOverlapLabel:"Overlap (chars)",ingestConfirm:"Start Import",ingesting:"Parsing and embedding. The first import may download the model, please wait...",progressParsing:"Parsing document\u2026",progressChunking:"Splitting into chunks\u2026",progressEmbedding:"Embedding chunks {current}/{total}\u2026",progressStoring:"Writing to index\u2026",ingestSuccess:"Imported: {name} ({chunks} chunks)",ingestFailed:"Import failed: {error}",fileRequired:"Please choose a file first",contentRequired:"Please enter the text content",urlRequired:"Please enter the URL",fileTooLarge:"File too large, 50MB max",fileTypeUnsupported:"Unsupported file type: {name}",maxBatchFiles:"Up to {max} files per batch; please import in smaller batches",importingBatch:"Importing {current}/{total}: {name}",batchAllSuccess:"Batch import done: {count} documents ({chunks} chunks)",batchPartial:"Import done: {success} succeeded, {fail} failed (first error: {error})",batchAllFailed:"All imports failed: {error}",docsTitle:'Documents in "{name}"',docsEmpty:"No documents imported yet",docSearchPlaceholder:"Search document name or source...",docSearchEmpty:"No matching documents",docChunkCount:"{count} chunks",docDeleteConfirmTitle:"Delete Document",docDeleteConfirm:'Delete document "{name}"? All its chunks will be removed from the knowledge base.',docDeleteSuccess:"Document deleted",docSourceFile:"File",docSourceUrl:"Web",docSourceText:"Text",docOriginalSize:"Original {size}",docOriginalName:"original file {name}",docNoOriginal:"original not kept",docNoOriginalText:"text-only import, no original file",docOriginalQuotaSkipped:"original skipped (quota exceeded)",docOriginalMissing:"No original file for this document; text view only",docOriginalSkippedToast:"Original not saved (quota exceeded); text and vectors were indexed",docView:"View",docViewTitle:"View Original Text",docViewCopy:"Copy",docViewCopied:"Copied to clipboard",docViewPreview:"Preview",docViewSource:"Source",docViewTruncated:"Text is long; showing the first {limit} of {total} characters. Download the full text instead.",docViewEmpty:"(no text content)",docToc:"Outline",docFullscreen:"Fullscreen",docExitFullscreen:"Exit Fullscreen",docCharCount:"{count} chars",docDownloadOriginal:"Download Original",docDownloadText:"Download Text",docDownloading:"Downloading...",docDownloadFailed:"Download failed, please retry",searchTitle:"Test Search",searchScope:'Scope: "{name}"',searchQueryPlaceholder:"Enter a query, e.g. How to export data?",searchBtn:"Search",searching:"Searching...",searchTopKLabel:"Top K",searchThresholdLabel:"Threshold",searchHitCount:"{count} hits",searchNoHits:"No hits. Try lowering the similarity threshold.",searchFallbackHint:"All scores are below the threshold. Best matches for reference:",searchFailed:"Search failed: {error}",expandFull:"Expand",collapse:"Collapse",scoreLabel:"Score",opFailed:"Operation failed: {error}"},contextBubble:{labelSelection:"Selection",labelQuoted:"Quote",labelSkill:"Skill",labelMcp:"MCP",labelPage:"Page",labelFile:"File",labelKnowledge:"Knowledge",clickToExpand:"Click to expand",bubbleSkill:"{name} \u{1F9E9}",bubbleMcp:"{name} \u{1F50C}",bubblePage:"{title} \u{1F310}",bubbleKnowledge:"{name} \u{1F4DA} \xB7 {count} hits",bubbleKnowledgeMiss:"{name} \u{1F4DA} \xB7 no match",bubbleKnowledgeFailed:"{name} \u{1F4DA} \xB7 retrieval failed",bubbleKnowledgeSearching:"Searching knowledge base\u2026",kbHitToggle:"Click to expand/collapse",kbHitTruncated:"\u2702 Truncated \xB7 {total} chars total, first {kept} sent",kbHitTruncatedTitle:"Truncated to fit the context window; what is shown here is exactly what the model received",kbHitTruncatedBadge:"\u2702 {count} truncated"},configDialog:{exportTitle:"Export Settings",includeSecrets:"Include API keys",secretWarn:"\u26A0 Sensitive information; keep the file safe",exportDesc:"The exported file contains all settings except Agent connection info (proxy URL and pairing token); check the option below to include API keys and connection info as well.",export:"Export",importTitle:"Import Settings",mergeImport:"Merge import \u2014 only overwrite settings present in the file; keep the rest",replaceImport:"Full replace \u2014 clear current settings and use the file content",confirmImport:"Confirm Import",exportSuccess:"Settings exported",exportFailed:"Export failed: {error}",unknownTime:"Unknown",importSummary:"Exported at: {time}, containing {count} settings",invalidFileFormat:"Invalid file format",unrecognizedFormat:"Unrecognized settings format",unknownConfigKey:"Unknown setting key: {key}",importFailed:"Import failed: {error}",importParseFailed:"Import failed: cannot parse file format",importedCount:"Imported {count} settings"},queue:{enqueueBtn:"Add to queue",enqueued:"Added to queue (position {position})",enqueueFailed:"Failed to queue, your text is kept in the input",queueFull:"Queue is full (limit {limit}), please clear some queued tasks first",noSession:"Not ready yet, please retry shortly",summary:"{count} queued",summaryEmpty:"Queue empty",summaryFailed:"{count} task(s) failed",summaryFailedHint:"Failed to run; open Recent to requeue",pausedTag:"Paused",pausedHint:"Auto relay is paused",pausedByStop:"You stopped the task, so auto relay is paused",resumeQueue:"Resume queue",resumed:"Auto relay resumed",stopAndSend:"Stop and send",stopAndSendTitle:"Drop this round and start the queue now (right-click / long-press the stop button)",stopAndSendEmpty:"Nothing is waiting in the queue",stopAndSendStarted:"Current task stopped; the queue is starting",recentTitle:"Recent",recentEmpty:"No processed items yet",requeue:"Re-queue",requeued:"Added back to the queue",deleted:"Removed from queue",movedTop:"Moved to top",withContext:"with context",withImages:"{count} image(s)",withFiles:"{count} file(s)",attachmentsVolatile:"Images/files are too large to persist; they will be lost if the panel reloads, so run this item soon",attachmentsMissing:"Attachments could not be recovered (panel closed or released); this item will send text only",editBackWithAttachments:"Restored to input, including images/files",requeuedNoAttachments:"Requeued (original attachments released, text only)",forgetRecent:"Remove from history",forgotRecent:"Removed from Recent",filesStillExtracting:"Attached files are still being parsed; wait until parsing finishes before queueing (queueing now would lose file content)",inputHasUnsavedContext:"Images/files/quotes attached without text would be cleared by this restore; send or clear them first",statusDispatching:"Running",statusInjecting:"Inserting",statusInjected:"Inserted",statusDone:"Done",statusFailed:"Failed",statusRecovered:"Interrupted",statusRunningHint:"This task is running (tool calls included); the next one starts after it finishes",inject:"Insert into the running task (no need to wait for it)",injectIdleHint:"No task is running; this item will run in queue order",injectAccepted:"Delivered \u2014 takes effect after the current step",injected:"Inserted into the running task",autoCarried:"Queued item carried into the running task (round {iteration})",injectNoTask:"The task just finished; this item is back in the queue",injectTimeout:"No insertion confirmation; this item is back in the queue",injectTimeoutAdhoc:"No insertion confirmation; your text is still in the input box",injectFailed:"Insertion failed; this item is back in the queue",injectNoAttachments:"Items with images/files cannot be inserted into a running task (text only); let them run in queue order",editBack:"Edit in input",editTailHint:"Last queued item restored to the input; press Enter to send when done",delete:"Delete",stopNow:"Stop current task",tooManyAttempts:"This item failed {count} automatic attempts in a row; retries stopped and it was moved to Recent so you can requeue it manually",badgeTitle:"This session has {count} queued task(s)",sessionDropped:"This session had {count} queued task(s); they were removed along with the session"}};function Un(){if(typeof chrome>"u"||!chrome.i18n)return"zh";try{let e=chrome.i18n.getUILanguage();if(e&&e.startsWith("zh"))return"zh"}catch{}return"en"}var Ce="zh",_e={zh:Bi,en:qi},Oo=new Set;function zn(e,t){if(!e||!t)return;let o=t.split("."),n=e;for(let i of o){if(typeof n!="object"||!n)return;n=n[i]}return typeof n=="string"?n:void 0}function Kn(e,t){return!t||typeof e!="string"?e:e.replace(/\{(\w+)\}/g,(o,n)=>t[n]!==void 0&&t[n]!==null?String(t[n]):o)}function m(e,t){let o=zn(_e[Ce],e);if(o!==void 0)return Kn(o,t);if(Ce!=="en"){let n=zn(_e.en,e);if(n!==void 0)return Kn(n,t)}return e}function Wn(e){return typeof e=="function"&&Oo.add(e),()=>Oo.delete(e)}function G(e,t){_e[e]||(_e[e]={}),_e[e]=jn(_e[e],t)}function jn(e,t){for(let o of Object.keys(t||{}))t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((!e[o]||typeof e[o]!="object")&&(e[o]={}),jn(e[o],t[o])):e[o]=t[o];return e}var Gn=!1;async function $n(){if(typeof chrome>"u"||!chrome.storage||!chrome.storage.local)return Ce;try{let e=await chrome.storage.local.get("language");if(e.language&&_e[e.language])Ce=e.language;else{let t=Un();Ce=t,chrome.storage.local.set({language:t}).catch(()=>{})}}catch{Ce=Un()}if(!Gn){Gn=!0;try{chrome.storage.onChanged.addListener((e,t)=>{if(t!=="local"||!e.language)return;let o=e.language.newValue;if(o&&_e[o]&&o!==Ce){Ce=o;for(let n of Oo)try{n(o)}catch{}}})}catch{}}return Ce}var Ee={fetchUrl:{fallback:15e3,min:1e3,max:12e4},tabLoad:{fallback:15e3,min:1e3,max:12e4},navigation:{fallback:3e4,min:1e3,max:12e4},waitElement:{fallback:1e4,min:200,max:6e4},selectOption:{fallback:5e3,min:200,max:6e4},actionWait:{fallback:2e3,min:200,max:3e4},actionMinWait:{fallback:300,min:200,max:5e3}};function Re(e,t){let{fallback:o,min:n,max:i}=t,a=Number(e);return!Number.isFinite(a)||a<=0?o:Math.min(i,Math.max(n,Math.floor(a)))}G("zh",{pageInteraction:{refHint:"ref \u7F16\u53F7\u4EC5\u672C\u6B21\u67E5\u8BE2\u6709\u6548\uFF0C\u9875\u9762\u5BFC\u822A/\u5237\u65B0\u6216\u5207\u6362 tab \u540E\u9700\u91CD\u65B0 query_elements",snapshotHeader:"\u53EF\u4EA4\u4E92\u5143\u7D20\u5FEB\u7167\uFF1A{count} \u4E2A\u5143\u7D20",snapshotTruncated:"\uFF08\u5171 {total} \u4E2A\uFF0C\u5DF2\u622A\u65AD\uFF0C\u8BF7\u7528 filterByText \u7F29\u5C0F\u8303\u56F4\uFF09",snapshotPageInfo:"\uFF08\u7B2C {page}/{totalPages} \u9875\uFF0C\u672C\u6B21\u8F93\u51FA {count} \u4E2A\uFF09",snapshotHasMore:"\u8FD8\u6709\u66F4\u591A\u5143\u7D20\uFF1A\u8C03\u7528 query_elements \u65F6\u5E26 page={next} \u67E5\u770B",snapshotPageOutOfRange:"page={page} \u8D85\u51FA\u8303\u56F4\uFF08\u5171 {totalPages} \u9875\uFF09",snapshotOverlayBlock:"[\u6253\u5F00\u5C42]",snapshotBodyBlock:"[\u9875\u9762\u4E3B\u4F53]",snapshotFooter:"\uFF08ref \u7F16\u53F7\u4EC5\u5F53\u524D\u5FEB\u7167\u6709\u6548\uFF1B\u9875\u9762\u53D8\u5316\u540E\u8BF7\u91CD\u65B0\u8C03\u7528 query_elements\uFF09",snapshotHeaderFrames:"\uFF08\u542B {n} \u4E2A iframe\uFF09",snapshotFramesLimited:"\uFF08\u90E8\u5206 iframe \u8D85\u51FA\u6570\u91CF/\u6DF1\u5EA6\u4E0A\u9650\uFF0C\u672A\u5C55\u5F00\uFF09",snapshotFrameBlock:"[frame #{index}{title}{hostSeg}]",snapshotFramePlaceholder:"iframe #{index}{title}",snapshotFrameUnreachable:"\uFF08\u5185\u5BB9\u4E0D\u53EF\u8BBF\u95EE\uFF09"}}),G("en",{pageInteraction:{refHint:"ref numbers are only valid for the current query; re-run query_elements after page navigation/refresh or tab switch",snapshotHeader:"Interactive elements snapshot: {count} element(s)",snapshotTruncated:" (of {total} total; truncated \u2014 narrow down with filterByText)",snapshotPageInfo:" (page {page}/{totalPages}, {count} shown)",snapshotHasMore:"More elements available: call query_elements with page={next}",snapshotPageOutOfRange:"page={page} is out of range (only {totalPages} page(s))",snapshotOverlayBlock:"[Open overlays]",snapshotBodyBlock:"[Page body]",snapshotFooter:"(ref numbers are valid only for this snapshot; re-run query_elements after the page changes)",snapshotHeaderFrames:" ({n} iframe(s))",snapshotFramesLimited:" (some iframes exceed count/depth limits; not expanded)",snapshotFrameBlock:"[frame #{index}{title}{hostSeg}]",snapshotFramePlaceholder:"iframe #{index}{title}",snapshotFrameUnreachable:" (content inaccessible)"}});function Ui(e){if(!e)return"";if(e==="about:srcdoc")return"srcdoc";if(e==="about:blank")return"blank";try{return new URL(e).hostname||""}catch{return""}}function _o(e,t){for(let o of e)o.t==="el"&&o.localRef!=null&&t.push(o),o.children&&o.children.length&&_o(o.children,t)}function zi(e,t,o){if(e.status==="hidden"||e.status==="off")return!1;let n=e.title?` "${e.title}"`:"",i;return i=e.status==="ok"&&e.frameIndex!=null?m("pageInteraction.snapshotFramePlaceholder",{index:e.frameIndex,title:n}):e.status==="unreachable"&&e.frameIndex!=null?m("pageInteraction.snapshotFramePlaceholder",{index:e.frameIndex,title:n})+m("pageInteraction.snapshotFrameUnreachable"):`iframe${n}`,i=" ".repeat(e.depth||0)+i,o.budget-=i.length+1,t.push(i),!0}function Ho(e,t,o){if(!e)return!1;if(e.t==="frame")return zi(e,t,o);let n=[],i=!1;for(let a of e.children||[])Ho(a,n,o)&&(i=!0);if(e.t==="el"){if(e.localRef!=null&&o.selected.has(e)){if(o.budget<=0)return o.truncated=!0,i;let a=e.role||"",r=e.name||"",s=e.attrs||"",c=e.depth+a.length+(r?r.length+2:0)+(s?s.length+1:0)+12;if(o.budget-c<0)return o.truncated=!0,i;let d=`${" ".repeat(e.depth)}${a}${r?` "${r}"`:""} [ref ${e.localRef}]${s?" "+s:""}`;return o.budget-=d.length+1,o.count+=1,t.push(d,...n),!0}return i?(t.push(...n),!0):!1}if(e.t==="container"){if(i){let a=`${" ".repeat(e.depth)}${e.role}${e.name?` "${e.name}"`:""}`;return o.budget-=a.length+1,t.push(a,...n),!0}return!1}return i?(t.push(...n),!0):!1}function Vn(e,t,o){let n=[];if((e.overlayTrees||[]).length){for(let i of e.overlayTrees)Ho(i,n,o);n.length&&t.push(m("pageInteraction.snapshotOverlayBlock"),...n,m("pageInteraction.snapshotBodyBlock"))}for(let i of e.bodyTree||[])Ho(i,t,o)}function Yn(e={}){let{frames:t=[],page:o=1,maxResults:n=100,maxChars:i=6e3,countOnly:a=!1,frameCount:r=0,framesLimited:s=0}=e||{},c=Number.isInteger(o)&&o>=1?o:1,d=Math.max(1,n),u=[];for(let L of t)_o(L.overlayTrees||[],u),_o(L.bodyTree||[],u);let p=u.length;if(a)return{success:!0,content:"",count:p,total:p,truncated:!1,hint:""};let h=Math.ceil(p/d),b=r>0?m("pageInteraction.snapshotHeaderFrames",{n:r}):"",x=s>0?m("pageInteraction.snapshotFramesLimited"):"";if(p>0&&c>h)return{success:!0,content:[m("pageInteraction.snapshotHeader",{count:p})+b+x,m("pageInteraction.snapshotPageOutOfRange",{page:c,totalPages:h}),m("pageInteraction.snapshotFooter")].join(`
|
|
50
|
+
`),count:0,total:p,page:c,totalPages:h,hasMore:!1,truncated:!1,hint:""};let w=(c-1)*d,k=new Set(u.slice(w,w+d)),S=c<h,D={selected:k,budget:i,truncated:!1,count:0},R=[],H=t.find(L=>L.isTop)||t[0];H&&Vn(H,R,D);for(let L of t.filter(oe=>oe!==H)){let oe=[];if(Vn(L,oe,D),!oe.length)continue;let ue=" ".repeat(Math.max(0,(L.depth||1)-1)*2),Ae=L.frameInfo&&L.frameInfo.title?` "${L.frameInfo.title}"`:"",ne=Ui(L.frameInfo&&L.frameInfo.url);R.push(ue+m("pageInteraction.snapshotFrameBlock",{index:L.frameIndex,title:Ae,hostSeg:ne?" \xB7 "+ne:""}),...oe.map(ht=>ue+" "+ht))}let B=h>1,Q=m("pageInteraction.snapshotHeader",{count:B?p:D.count})+b+x+(B?m("pageInteraction.snapshotPageInfo",{page:c,totalPages:h,count:D.count}):"")+(D.truncated?m("pageInteraction.snapshotTruncated",{total:p}):"");return R.unshift(Q),S&&R.push(m("pageInteraction.snapshotHasMore",{next:c+1})),R.push(m("pageInteraction.snapshotFooter")),{success:!0,content:R.join(`
|
|
51
|
+
`),count:D.count,total:p,page:c,totalPages:h,hasMore:S,truncated:D.truncated,hint:S?m("pageInteraction.snapshotHasMore",{next:c+1}):m("pageInteraction.refHint")}}function Qn(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function Ki(e){if(Array.isArray(e))return e}function Gi(e,t){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var n,i,a,r,s=[],c=!0,d=!1;try{if(a=(o=o.call(e)).next,t!==0)for(;!(c=(n=a.call(o)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(u){d=!0,i=u}finally{try{if(!c&&o.return!=null&&(r=o.return(),Object(r)!==r))return}finally{if(d)throw i}}return s}}function Wi(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
52
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ji(e,t){return Ki(e)||Gi(e,t)||$i(e,t)||Wi()}function $i(e,t){if(e){if(typeof e=="string")return Qn(e,t);var o={}.toString.call(e).slice(8,-1);return o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set"?Array.from(e):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Qn(e,t):void 0}}var ua=Object.entries,Xn=Object.setPrototypeOf,Vi=Object.isFrozen,Yi=Object.getPrototypeOf,Qi=Object.getOwnPropertyDescriptor,X=Object.freeze,Z=Object.seal,lt=Object.create,pa=typeof Reflect<"u"&&Reflect,ma=pa.apply,ha=pa.construct;X||=function(e){return e},Z||=function(e){return e},ma||=function(e,t){var o=[...arguments].slice(2);return e.apply(t,o)},ha||=function(e){return new e(...[...arguments].slice(1))};var it=W(Array.prototype.forEach),Xi=W(Array.prototype.lastIndexOf),Zn=W(Array.prototype.pop),rt=W(Array.prototype.push),Zi=W(Array.prototype.splice),Be=Array.isArray,xt=W(String.prototype.toLowerCase),Bo=W(String.prototype.toString),Jn=W(String.prototype.match),wt=W(String.prototype.replace),ea=W(String.prototype.indexOf),Ji=W(String.prototype.trim),er=W(Number.prototype.toString),tr=W(Boolean.prototype.toString),ta=typeof BigInt>"u"?null:W(BigInt.prototype.toString),oa=typeof Symbol>"u"?null:W(Symbol.prototype.toString),V=W(Object.prototype.hasOwnProperty),vt=W(Object.prototype.toString),$=W(RegExp.prototype.test),Ve=or(TypeError);function W(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var o=[...arguments].slice(1);return ma(e,t,o)}}function or(e){return function(){return ha(e,[...arguments])}}function I(e,t){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xt;if(Xn&&Xn(e,null),!Be(t))return e;let n=t.length;for(;n--;){let i=t[n];if(typeof i=="string"){let a=o(i);a!==i&&(Vi(t)||(t[n]=a),i=a)}e[i]=!0}return e}function nr(e){for(let t=0;t<e.length;t++)V(e,t)||(e[t]=null);return e}function ae(e){let t=lt(null);for(let n of ua(e)){var o=ji(n,2);let i=o[0],a=o[1];V(e,i)&&(Be(a)?t[i]=nr(a):a&&typeof a=="object"&&a.constructor===Object?t[i]=ae(a):t[i]=a)}return t}function ar(e){switch(typeof e){case"string":return e;case"number":return er(e);case"boolean":return tr(e);case"bigint":return ta?ta(e):"0";case"symbol":return oa?oa(e):"Symbol()";case"undefined":return vt(e);case"function":case"object":{if(e===null)return vt(e);let t=e,o=ke(t,"toString");if(typeof o=="function"){let n=o(t);return typeof n=="string"?n:vt(n)}return vt(e)}default:return vt(e)}}function ke(e,t){for(;e!==null;){let n=Qi(e,t);if(n){if(n.get)return W(n.get);if(typeof n.value=="function")return W(n.value)}e=Yi(e)}function o(){return null}return o}function ir(e){try{return $(e,""),!0}catch{return!1}}var na=X("a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")),qo=X("svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")),Uo=X(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),rr=X(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),zo=X("math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")),lr=X(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),aa=X(["#text"]),ia=X("accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")),Ko=X("accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")),ra=X("accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")),Wt=X(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),sr=Z(/{{[\w\W]*|^[\w\W]*}}/g),cr=Z(/<%[\w\W]*|^[\w\W]*%>/g),dr=Z(/\${[\w\W]*/g),ur=Z(/^data-[\-\w.\u00B7-\uFFFF]+$/),pr=Z(/^aria-[\-\w]+$/),la=Z(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),mr=Z(/^(?:\w+script|data):/i),hr=Z(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gr=Z(/^html$/i),fr=Z(/^[a-z][.\w]*(-[.\w]+)+$/i),sa=Z(/<[/\w!]/g),ca=Z(/<[/\w]/g),br=Z(/<\/no(script|embed|frames)/i),yr=Z(/\/>/i),me={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},wr=function(){return typeof window>"u"?null:window},vr=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let o=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(o=t.getAttribute(n));let i="dompurify"+(o?"#"+o:"");try{return e.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},da=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},He=function(e,t,o,n){return V(e,t)&&Be(e[t])?I(n.base?ae(n.base):{},e[t],n.transform):o};function ga(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wr(),t=l=>ga(l);if(t.version="3.4.12",t.removed=[],!e||!e.document||e.document.nodeType!==me.document||!e.Element)return t.isSupported=!1,t;let o=e.document,n=o,i=n.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,r=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let d=e.DOMParser,u=e.trustedTypes,p=s.prototype,h=ke(p,"cloneNode"),b=ke(p,"remove"),x=ke(p,"nextSibling"),w=ke(p,"childNodes"),k=ke(p,"parentNode"),S=ke(p,"shadowRoot"),D=ke(p,"attributes"),R=r&&r.prototype?ke(r.prototype,"nodeType"):null,H=r&&r.prototype?ke(r.prototype,"nodeName"):null;if(typeof a=="function"){let l=o.createElement("template");l.content&&l.content.ownerDocument&&(o=l.content.ownerDocument)}let B,Q="",L,oe=!1,ue=0,Ae=function(){if(ue>0)throw Ve('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ne=function(l){Ae(),ue++;try{return B.createHTML(l)}finally{ue--}},ht=function(l){Ae(),ue++;try{return B.createScriptURL(l)}finally{ue--}},fo=function(){return oe||=(L=vr(u,i),!0),L},Ot=o,bo=Ot.implementation,gn=Ot.createNodeIterator,si=Ot.createDocumentFragment,ci=Ot.getElementsByTagName,di=n.importNode,q=da();t.isSupported=typeof ua=="function"&&typeof k=="function"&&bo&&bo.createHTMLDocument!==void 0;let ui=sr,pi=cr,mi=dr,hi=ur,gi=pr,fi=mr,fn=hr,bi=fr,bn=la,U=null,yn=I({},[...na,...qo,...Uo,...zo,...aa]),z=null,wn=I({},[...ia,...Ko,...ra,...Wt]),K=Object.seal(lt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),gt=null,vn=null,Ne=Object.seal(lt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),xn=!0,yo=!0,kn=!1,Tn=!0,Le=!1,Fe=!0,We=!1,wo=!1,vo=null,xo=null,ko=!1,Je=!1,_t=!1,Ht=!1,Sn=!0,An=!1,Cn="user-content-",To=!0,So=!1,et={},we=null,Ao=I({},"annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")),En=null,Rn=I({},["audio","video","img","source","image","track"]),Co=null,In=I({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Bt="http://www.w3.org/1998/Math/MathML",qt="http://www.w3.org/2000/svg",ve="http://www.w3.org/1999/xhtml",tt=ve,Eo=!1,Ro=null,yi=I({},[Bt,qt,ve],Bo),Mn=X(["mi","mo","mn","ms","mtext"]),Io=I({},Mn),Pn=X(["annotation-xml"]),Mo=I({},Pn),wi=I({},["title","style","font","a","script"]),ft=null,vi=["application/xhtml+xml","text/html"],O=null,ot=null,xi=o.createElement("form"),Dn=function(l){return l instanceof RegExp||l instanceof Function},Po=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ot&&ot===l)return;(!l||typeof l!="object")&&(l={}),l=ae(l),ft=vi.indexOf(l.PARSER_MEDIA_TYPE)===-1?"text/html":l.PARSER_MEDIA_TYPE,O=ft==="application/xhtml+xml"?Bo:xt,U=He(l,"ALLOWED_TAGS",yn,{transform:O}),z=He(l,"ALLOWED_ATTR",wn,{transform:O}),Ro=He(l,"ALLOWED_NAMESPACES",yi,{transform:Bo}),Co=He(l,"ADD_URI_SAFE_ATTR",In,{transform:O,base:In}),En=He(l,"ADD_DATA_URI_TAGS",Rn,{transform:O,base:Rn}),we=He(l,"FORBID_CONTENTS",Ao,{transform:O}),gt=He(l,"FORBID_TAGS",ae({}),{transform:O}),vn=He(l,"FORBID_ATTR",ae({}),{transform:O}),et=V(l,"USE_PROFILES")?l.USE_PROFILES&&typeof l.USE_PROFILES=="object"?ae(l.USE_PROFILES):l.USE_PROFILES:!1,xn=l.ALLOW_ARIA_ATTR!==!1,yo=l.ALLOW_DATA_ATTR!==!1,kn=l.ALLOW_UNKNOWN_PROTOCOLS||!1,Tn=l.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Le=l.SAFE_FOR_TEMPLATES||!1,Fe=l.SAFE_FOR_XML!==!1,We=l.WHOLE_DOCUMENT||!1,Je=l.RETURN_DOM||!1,_t=l.RETURN_DOM_FRAGMENT||!1,Ht=l.RETURN_TRUSTED_TYPE||!1,ko=l.FORCE_BODY||!1,Sn=l.SANITIZE_DOM!==!1,An=l.SANITIZE_NAMED_PROPS||!1,To=l.KEEP_CONTENT!==!1,So=l.IN_PLACE||!1,bn=ir(l.ALLOWED_URI_REGEXP)?l.ALLOWED_URI_REGEXP:la,tt=typeof l.NAMESPACE=="string"?l.NAMESPACE:ve,Io=V(l,"MATHML_TEXT_INTEGRATION_POINTS")&&l.MATHML_TEXT_INTEGRATION_POINTS&&typeof l.MATHML_TEXT_INTEGRATION_POINTS=="object"?ae(l.MATHML_TEXT_INTEGRATION_POINTS):I({},Mn),Mo=V(l,"HTML_INTEGRATION_POINTS")&&l.HTML_INTEGRATION_POINTS&&typeof l.HTML_INTEGRATION_POINTS=="object"?ae(l.HTML_INTEGRATION_POINTS):I({},Pn);let g=V(l,"CUSTOM_ELEMENT_HANDLING")&&l.CUSTOM_ELEMENT_HANDLING&&typeof l.CUSTOM_ELEMENT_HANDLING=="object"?ae(l.CUSTOM_ELEMENT_HANDLING):lt(null);if(K=lt(null),V(g,"tagNameCheck")&&Dn(g.tagNameCheck)&&(K.tagNameCheck=g.tagNameCheck),V(g,"attributeNameCheck")&&Dn(g.attributeNameCheck)&&(K.attributeNameCheck=g.attributeNameCheck),V(g,"allowCustomizedBuiltInElements")&&typeof g.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=g.allowCustomizedBuiltInElements),Z(K),Le&&(yo=!1),_t&&(Je=!0),et&&(U=I({},aa),z=lt(null),et.html===!0&&(I(U,na),I(z,ia)),et.svg===!0&&(I(U,qo),I(z,Ko),I(z,Wt)),et.svgFilters===!0&&(I(U,Uo),I(z,Ko),I(z,Wt)),et.mathMl===!0&&(I(U,zo),I(z,ra),I(z,Wt))),Ne.tagCheck=null,Ne.attributeCheck=null,V(l,"ADD_TAGS")&&(typeof l.ADD_TAGS=="function"?Ne.tagCheck=l.ADD_TAGS:Be(l.ADD_TAGS)&&(U===yn&&(U=ae(U)),I(U,l.ADD_TAGS,O))),V(l,"ADD_ATTR")&&(typeof l.ADD_ATTR=="function"?Ne.attributeCheck=l.ADD_ATTR:Be(l.ADD_ATTR)&&(z===wn&&(z=ae(z)),I(z,l.ADD_ATTR,O))),V(l,"ADD_URI_SAFE_ATTR")&&Be(l.ADD_URI_SAFE_ATTR)&&I(Co,l.ADD_URI_SAFE_ATTR,O),V(l,"FORBID_CONTENTS")&&Be(l.FORBID_CONTENTS)&&(we===Ao&&(we=ae(we)),I(we,l.FORBID_CONTENTS,O)),V(l,"ADD_FORBID_CONTENTS")&&Be(l.ADD_FORBID_CONTENTS)&&(we===Ao&&(we=ae(we)),I(we,l.ADD_FORBID_CONTENTS,O)),To&&(U["#text"]=!0),We&&I(U,["html","head","body"]),U.table&&(I(U,["tbody"]),delete gt.tbody),l.TRUSTED_TYPES_POLICY){if(typeof l.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ve('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof l.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ve('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let f=B;B=l.TRUSTED_TYPES_POLICY;try{Q=ne("")}catch(y){throw B=f,y}}else l.TRUSTED_TYPES_POLICY===null?(B=void 0,Q=""):(B===void 0&&(B=fo()),B&&typeof Q=="string"&&(Q=ne("")));X&&X(l),ot=l},Nn=I({},[...qo,...Uo,...rr]),Ln=I({},[...zo,...lr]),ki=function(l,g,f){return g.namespaceURI===ve?l==="svg":g.namespaceURI===Bt?l==="svg"&&(f==="annotation-xml"||Io[f]):!!Nn[l]},Ti=function(l,g,f){return g.namespaceURI===ve?l==="math":g.namespaceURI===qt?l==="math"&&Mo[f]:!!Ln[l]},Si=function(l,g,f){return g.namespaceURI===qt&&!Mo[f]||g.namespaceURI===Bt&&!Io[f]?!1:!Ln[l]&&(wi[l]||!Nn[l])},Ai=function(l){let g=k(l);(!g||!g.tagName)&&(g={namespaceURI:tt,tagName:"template"});let f=xt(l.tagName),y=xt(g.tagName);return Ro[l.namespaceURI]?l.namespaceURI===qt?ki(f,g,y):l.namespaceURI===Bt?Ti(f,g,y):l.namespaceURI===ve?Si(f,g,y):!!(ft==="application/xhtml+xml"&&Ro[l.namespaceURI]):!1},je=function(l){rt(t.removed,{element:l});try{k(l).removeChild(l)}catch{if(b(l),!k(l))throw Ve("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ut=function(l){Do(l);let g=w(l);if(g){let y=[];it(g,A=>{rt(y,A)}),it(y,A=>{try{b(A)}catch{}})}let f=D(l);if(f)for(let y=f.length-1;y>=0;--y){let A=f[y],C=A&&A.name;if(typeof C=="string")try{l.removeAttribute(C)}catch{}}},$e=function(l,g){try{rt(t.removed,{attribute:g.getAttributeNode(l),from:g})}catch{rt(t.removed,{attribute:null,from:g})}if(g.removeAttribute(l),l==="is")if(Je||_t)try{je(g)}catch{}else try{g.setAttribute(l,"")}catch{}},Ci=function(l){let g=D(l);if(g)for(let f=g.length-1;f>=0;--f){let y=g[f],A=y&&y.name;if(!(typeof A!="string"||z[O(A)]))try{l.removeAttribute(A)}catch{}}},Do=function(l){let g=[l];for(;g.length>0;){let f=g.pop();(R?R(f):f.nodeType)===me.element&&Ci(f);let y=w(f);if(y)for(let A=y.length-1;A>=0;--A)g.push(y[A])}},Ei=function(l){if(!Fe)return;let g=[l];for(;g.length>0;){let f=g.pop(),y=R?R(f):f.nodeType;if(y===me.processingInstruction||y===me.comment&&$(ca,f.data)){try{b(f)}catch{}continue}if(y===me.element){let C=f,P=O(H?H(f):f.nodeName);try{C.hasAttribute&&C.hasAttribute("patchsrc")&&C.removeAttribute("patchsrc"),C.hasAttribute&&C.hasAttribute("for")&&P!=="label"&&P!=="output"&&C.removeAttribute("for")}catch{}}let A=w(f);if(A)for(let C=A.length-1;C>=0;--C)g.push(A[C])}},Fn=function(l){let g=null,f=null;if(ko)l="<remove></remove>"+l;else{let C=Jn(l,/^[\r\n\t ]+/);f=C&&C[0]}ft==="application/xhtml+xml"&&tt===ve&&(l='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+l+"</body></html>");let y=B?ne(l):l;if(tt===ve)try{g=new d().parseFromString(y,ft)}catch{}if(!g||!g.documentElement){g=bo.createDocument(tt,"template",null);try{g.documentElement.innerHTML=Eo?Q:y}catch{}}let A=g.body||g.documentElement;return l&&f&&A.insertBefore(o.createTextNode(f),A.childNodes[0]||null),tt===ve?ci.call(g,We?"html":"body")[0]:We?g.documentElement:A},On=function(l){return gn.call(l.ownerDocument||l,l,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},zt=function(l){return l=wt(l,ui," "),l=wt(l,pi," "),l=wt(l,mi," "),l},No=function(l){l.normalize();let g=gn.call(l.ownerDocument||l,l,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),f=g.nextNode();for(;f;)f.data=zt(f.data),f=g.nextNode();let y=l.querySelectorAll?.call(l,"template");y&&it(y,A=>{nt(A.content)&&No(A.content)})},Kt=function(l){let g=H?H(l):null;return typeof g!="string"||O(g)!=="form"?!1:typeof l.nodeName!="string"||typeof l.textContent!="string"||typeof l.removeChild!="function"||l.attributes!==D(l)||typeof l.removeAttribute!="function"||typeof l.setAttribute!="function"||typeof l.namespaceURI!="string"||typeof l.insertBefore!="function"||typeof l.hasChildNodes!="function"||l.nodeType!==R(l)||l.childNodes!==w(l)},nt=function(l){if(!R||typeof l!="object"||!l)return!1;try{return R(l)===me.documentFragment}catch{return!1}},bt=function(l){if(!R||typeof l!="object"||!l)return!1;try{return typeof R(l)=="number"}catch{return!1}};function xe(l,g,f){l.length!==0&&it(l,y=>{y.call(t,g,f,ot)})}let Ri=function(l,g){return!!(Fe&&l.hasChildNodes()&&!bt(l.firstElementChild)&&$(sa,l.textContent)&&$(sa,l.innerHTML)||Fe&&l.namespaceURI===ve&&g==="style"&&bt(l.firstElementChild)||l.nodeType===me.processingInstruction||Fe&&l.nodeType===me.comment&&$(ca,l.data))},Ii=function(l,g){if(!gt[g]&&Bn(g)&&(K.tagNameCheck instanceof RegExp&&$(K.tagNameCheck,g)||K.tagNameCheck instanceof Function&&K.tagNameCheck(g)))return!1;if(To&&!we[g]){let f=k(l),y=w(l);if(y&&f){let A=y.length;for(let C=A-1;C>=0;--C){let P=So?y[C]:h(y[C],!0);f.insertBefore(P,x(l))}}}return je(l),!0},_n=function(l,g){if(xe(q.beforeSanitizeElements,l,null),l!==g&&k(l)===null)return!0;if(Kt(l))return je(l),!0;let f=O(H?H(l):l.nodeName);if(xe(q.uponSanitizeElement,l,{tagName:f,allowedTags:U}),l!==g&&k(l)===null)return!0;if(Ri(l,f))return je(l),!0;if(gt[f]||!(Ne.tagCheck instanceof Function&&Ne.tagCheck(f))&&!U[f]){let y=Ii(l,f);return y===!1&&xe(q.afterSanitizeElements,l,null),y}if((R?R(l):l.nodeType)===me.element&&!Ai(l)||(f==="noscript"||f==="noembed"||f==="noframes")&&$(br,l.innerHTML))return je(l),!0;if(Le&&l.nodeType===me.text){let y=zt(l.textContent);l.textContent!==y&&(rt(t.removed,{element:l.cloneNode()}),l.textContent=y)}return xe(q.afterSanitizeElements,l,null),!1},Hn=function(l,g,f){if(vn[g]||Fe&&g==="patchsrc"||Fe&&g==="for"&&l!=="label"&&l!=="output"||Sn&&(g==="id"||g==="name")&&(f in o||f in xi))return!1;let y=z[g]||Ne.attributeCheck instanceof Function&&Ne.attributeCheck(g,l);if(!(yo&&$(hi,g))&&!(xn&&$(gi,g))){if(y){if(!Co[g]&&!$(bn,wt(f,fn,""))&&!((g==="src"||g==="xlink:href"||g==="href")&&l!=="script"&&ea(f,"data:")===0&&En[l])&&!(kn&&!$(fi,wt(f,fn,"")))&&f)return!1}else if(!(Bn(l)&&(K.tagNameCheck instanceof RegExp&&$(K.tagNameCheck,l)||K.tagNameCheck instanceof Function&&K.tagNameCheck(l))&&(K.attributeNameCheck instanceof RegExp&&$(K.attributeNameCheck,g)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(g,l))||g==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&$(K.tagNameCheck,f)||K.tagNameCheck instanceof Function&&K.tagNameCheck(f))))return!1}return!0},Mi=I({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Bn=function(l){return!Mi[xt(l)]&&$(bi,l)},Pi=function(l,g,f,y){if(B&&typeof u=="object"&&typeof u.getAttributeType=="function"&&!f)switch(u.getAttributeType(l,g)){case"TrustedHTML":return ne(y);case"TrustedScriptURL":return ht(y)}return y},Di=function(l,g,f,y){try{f?l.setAttributeNS(f,g,y):l.setAttribute(g,y),Kt(l)?je(l):Zn(t.removed)}catch{$e(g,l)}},qn=function(l){xe(q.beforeSanitizeAttributes,l,null);let g=l.attributes;if(!g||Kt(l))return;let f={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0},y=g.length,A=O(l.nodeName);for(;y--;){let C=g[y],P=C.name,Oe=C.namespaceURI,Fo=C.value,pe=O(P),be=Fo,_=P==="value"?be:Ji(be);if(f.attrName=pe,f.attrValue=_,f.keepAttr=!0,f.forceKeepAttr=void 0,xe(q.uponSanitizeAttribute,l,f),_=f.attrValue,An&&(pe==="id"||pe==="name")&&ea(_,Cn)!==0&&($e(P,l),_=Cn+_),Fe&&$(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,_)){$e(P,l);continue}if(pe==="attributename"&&Jn(_,"href")){$e(P,l);continue}if(!f.forceKeepAttr){if(!f.keepAttr){$e(P,l);continue}if(!Tn&&$(yr,_)){$e(P,l);continue}if(Le&&(_=zt(_)),!Hn(A,pe,_)){$e(P,l);continue}_=Pi(A,pe,Oe,_),_!==be&&Di(l,P,Oe,_)}}xe(q.afterSanitizeAttributes,l,null)},Gt=function(l){let g=null,f=On(l);for(xe(q.beforeSanitizeShadowDOM,l,null);g=f.nextNode();)if(xe(q.uponSanitizeShadowNode,g,null),_n(g,l),qn(g),nt(g.content)&&Gt(g.content),(R?R(g):g.nodeType)===me.element){let y=S(g);nt(y)&&(Lo(y),Gt(y))}xe(q.afterSanitizeShadowDOM,l,null)},Lo=function(l){let g=[{node:l,shadow:null}];for(;g.length>0;){let f=g.pop();if(f.shadow){Gt(f.shadow);continue}let y=f.node,A=(R?R(y):y.nodeType)===me.element,C=w(y);if(C)for(let P=C.length-1;P>=0;--P)g.push({node:C[P],shadow:null});if(A){let P=H?H(y):null;if(typeof P=="string"&&O(P)==="template"){let Oe=y.content;nt(Oe)&&g.push({node:Oe,shadow:null})}}if(A){let P=S(y);nt(P)&&g.push({node:null,shadow:P},{node:P,shadow:null})}}};return t.sanitize=function(l){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=null,y=null,A=null,C=null;if(Eo=!l,Eo&&(l="<!-->"),typeof l!="string"&&!bt(l)&&(l=ar(l),typeof l!="string"))throw Ve("dirty is not a string, aborting");if(!t.isSupported)return l;wo?(U=vo,z=xo):Po(g),(q.uponSanitizeElement.length>0||q.uponSanitizeAttribute.length>0)&&(U=ae(U)),q.uponSanitizeAttribute.length>0&&(z=ae(z)),t.removed=[];let P=So&&typeof l!="string"&&bt(l);if(P){Ei(l);let be=H?H(l):l.nodeName;if(typeof be=="string"){let _=O(be);if(!U[_]||gt[_])throw Ut(l),Ve("root node is forbidden and cannot be sanitized in-place")}if(Kt(l))throw Ut(l),Ve("root node is clobbered and cannot be sanitized in-place");try{Lo(l)}catch(_){throw Ut(l),_}}else if(bt(l))f=Fn("<!---->"),y=f.ownerDocument.importNode(l,!0),y.nodeType===me.element&&y.nodeName==="BODY"||y.nodeName==="HTML"?f=y:f.appendChild(y),Lo(y);else{if(!Je&&!Le&&!We&&l.indexOf("<")===-1)return B&&Ht?ne(l):l;if(f=Fn(l),!f)return Je?null:Ht?Q:""}f&&ko&&je(f.firstChild);let Oe=P?l:f,Fo=On(Oe);try{for(;A=Fo.nextNode();)_n(A,Oe),qn(A),nt(A.content)&&Gt(A.content)}catch(be){throw P&&(Ut(l),it(t.removed,_=>{_.element&&Do(_.element)})),be}if(P)return it(t.removed,be=>{be.element&&Do(be.element)}),Le&&No(l),l;if(Je){if(Le&&No(f),_t)for(C=si.call(f.ownerDocument);f.firstChild;)C.appendChild(f.firstChild);else C=f;return(z.shadowroot||z.shadowrootmode)&&(C=di.call(n,C,!0)),C}let pe=We?f.outerHTML:f.innerHTML;return We&&U["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&$(gr,f.ownerDocument.doctype.name)&&(pe="<!DOCTYPE "+f.ownerDocument.doctype.name+`>
|
|
53
|
+
`+pe),Le&&(pe=zt(pe)),B&&Ht?ne(pe):pe},t.setConfig=function(){Po(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),wo=!0,vo=U,xo=z},t.clearConfig=function(){ot=null,wo=!1,vo=null,xo=null,B=L,Q=""},t.isValidAttribute=function(l,g,f){return ot||Po({}),Hn(O(l),O(g),f)},t.addHook=function(l,g){typeof g=="function"&&V(q,l)&&rt(q[l],g)},t.removeHook=function(l,g){if(V(q,l)){if(g!==void 0){let f=Xi(q[l],g);return f===-1?void 0:Zi(q[l],f,1)[0]}return Zn(q[l])}},t.removeHooks=function(l){V(q,l)&&(q[l]=[])},t.removeAllHooks=function(){q=da()},t}var jt=ga(),Go="voiceShortcutConfig",kt=Object.freeze({rightAlt:!1,rightCtrl:!1});Object.freeze(["rightAlt","rightCtrl"]);function $t(e){let t=e&&typeof e=="object"?e:{};return{rightAlt:t.rightAlt===!0,rightCtrl:t.rightCtrl===!0}}function xr(e,t){if(!e||e.isComposing)return null;let o=$t(t);return o.rightAlt&&e.code==="AltRight"&&e.altKey&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"rightAlt":o.rightCtrl&&e.code==="ControlRight"&&e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.metaKey?"rightCtrl":null}var kr=Object.freeze({rightAlt:"AltRight",rightCtrl:"ControlRight"});function fa(e){let t=typeof e=="function"?e:()=>kt,o=null;return{onKeyDown(n){if(!n)return null;if(o)return n.code!==o.code&&(o=null),null;let i=xr(n,t());return i?(o={key:i,code:kr[i]},"cancel"):null},onKeyUp(n){if(!o||!n||n.code!==o.code)return null;let{key:i}=o;return o=null,n.isComposing||!$t(t())[i]?null:"trigger"},reset(){o=null}}}function Tr(){try{return globalThis.chrome?.storage?.local||null}catch{return null}}async function Wo(){let e=Tr();if(!e?.get)return{...kt};try{return $t((await e.get(Go))?.[Go])}catch{return{...kt}}}function ba(e){let t=(o,n)=>{if(n&&n!=="local")return;let i=o?.[Go];if(i)try{e($t(i.newValue))}catch{}};try{globalThis.chrome?.storage?.onChanged?.addListener?.(t)}catch{return()=>{}}return()=>{try{globalThis.chrome?.storage?.onChanged?.removeListener?.(t)}catch{}}}function te(e,t=document,o=5,n=0){if(n>o)return null;try{if(t.querySelectorAll)for(let a of t.querySelectorAll("*")){if(a.shadowRoot){let r=te(e,a.shadowRoot,o,n+1);if(r)return r}if(a.tagName==="IFRAME"||a.tagName==="FRAME")try{let r=a.contentDocument||a.contentWindow?.document;if(r){let s=te(e,r,o,n+1);if(s)return s}}catch{}}let i=t.querySelector?.(e);if(i)return i}catch{}return null}function Xe(e,t=document,o=5,n=0,i=new Set){if(n>o)return[];try{t.querySelectorAll&&(t.querySelectorAll(e).forEach(a=>{i.add(a)}),t.querySelectorAll("*").forEach(a=>{if(a.shadowRoot&&Xe(e,a.shadowRoot,o,n+1,i),a.tagName==="IFRAME"||a.tagName==="FRAME")try{let r=a.contentDocument||a.contentWindow?.document;r&&Xe(e,r,o,n+1,i)}catch{}}))}catch{}return Array.from(i)}function Pe(e=document,t=5,o=0){if(o>t)return{text:"",range:null};try{let n=e.getSelection?.();if(n&&!n.isCollapsed&&n.rangeCount>0){let i=n.toString().trim();if(i)return{text:i,range:n.getRangeAt(0),depth:o,source:"shadow"}}if(e.querySelectorAll){for(let i of e.querySelectorAll("*"))if(i.shadowRoot){let a=Pe(i.shadowRoot,t,o+1);if(a.text)return a}}}catch{}return{text:"",range:null}}function ct(e=document,t=5,o=0,n=new Set){if(o>t||n.has(e))return"";n.add(e);let i="";try{e.body?i+=e.body.innerText||"":e instanceof ShadowRoot&&(i+=e.textContent||""),e.querySelectorAll&&e.querySelectorAll("*").forEach(a=>{if(a.shadowRoot&&(i+=`
|
|
54
|
+
`+ct(a.shadowRoot,t,o+1,n)),a.tagName==="IFRAME"||a.tagName==="FRAME")try{let r=a.contentDocument||a.contentWindow?.document;r&&r.body&&(i+=`
|
|
55
|
+
`+ct(r,t,o+1,n))}catch{}})}catch{}return i.trim().replace(/\n{3,}/g,`
|
|
56
|
+
|
|
57
|
+
`)}function eo(e=document,t=5,o=0,n=new Set){if(o>t||n.has(e))return"";n.add(e);let i="";try{e.documentElement?i=e.documentElement.outerHTML:e instanceof ShadowRoot&&(i=e.innerHTML||"");let a=[];e.querySelectorAll&&e.querySelectorAll("*").forEach(r=>{if(r.shadowRoot){let s=eo(r.shadowRoot,t,o+1,n);s&&a.push(`<!-- shadow-root of ${r.tagName} -->
|
|
58
|
+
${s}`)}if(r.tagName==="IFRAME"||r.tagName==="FRAME")try{let s=r.contentDocument||r.contentWindow?.document;if(s&&s.documentElement){let c=eo(s,t,o+1,n);c&&a.push(`<!-- iframe content -->
|
|
59
|
+
${c}`)}}catch{}}),a.length>0&&(i+=`
|
|
58
60
|
<!-- Shadow DOM and iframe content -->
|
|
59
|
-
`+
|
|
60
|
-
`))}catch{}return a}function we(e){if(!e)return{x:window.innerWidth/2,y:window.innerHeight/2};let t;try{t=e.getBoundingClientRect()}catch{t={left:0,top:0,width:0,height:0}}if(!t||t.width===0&&t.height===0){let a=e.commonAncestorContainer;if(a){let i=a.nodeType===Node.TEXT_NODE?a.parentElement:a;i&&i.getBoundingClientRect&&(t=i.getBoundingClientRect())}}let o=t.left+t.width/2,n=t.top;if(window.top!==window){let a=e.startContainer.ownerDocument;for(;a&&a!==window.top.document;){let i=a.defaultView?.frameElement;if(!i)break;let r=i.getBoundingClientRect();o+=r.left,n+=r.top,a=i.ownerDocument}}return{x:o,y:n}}function lo(e,t=document,o=5,n=0,a=new Set){if(n>o||a.has(t))return a;try{let i=()=>e();t.addEventListener?.("selectionchange",i),a.add({root:t,listener:i}),t.querySelectorAll&&t.querySelectorAll("*").forEach(r=>{r.shadowRoot&&lo(e,r.shadowRoot,o,n+1,a)})}catch{}return a}function so(e){for(let{root:t,listener:o}of e)try{t.removeEventListener?.("selectionchange",o)}catch{}e.clear()}function Le(e){if(e.id)return`#${e.id}`;let t=[],o=e;for(;o&&o!==document.body&&o!==document.documentElement;){let n=o.tagName.toLowerCase();if(o.id){n=`#${o.id}`,t.unshift(n);break}if(o.className&&typeof o.className=="string"){let i=o.className.trim().split(/\s+/).filter(r=>r);i.length>0&&(n+="."+i[0])}let a=o.parentElement;if(a){let i=Array.from(a.children).filter(r=>r.tagName===o.tagName);if(i.length>1){let r=i.indexOf(o)+1;n+=`:nth-child(${r})`}}t.unshift(n),o=a}return t.join(" > ")}function Ae(e){if(e.id)return`#${e.id}`;let t=e.tagName.toLowerCase();if(e.className){let o=e.className.split(" ").filter(n=>n).slice(0,2);o.length&&(t+="."+o.join("."))}return t}function Gt(e,t,o=20){if(!e||!t)return 0;let n=t.global?t:new RegExp(t.source,t.flags+"g"),a=[],i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),r=0,l;for(;(l=i.nextNode())&&r<o;){let c=l.parentNode;if(!c||c.nodeType!==1)continue;let d=c.tagName;if(d==="SCRIPT"||d==="STYLE"||d==="TITLE"||d==="TEXTAREA")continue;let p=l.nodeValue;if(!p)continue;let m=[],h;for(n.lastIndex=0;(h=n.exec(p))!==null&&r+m.length<o;){if(h[0].length===0){n.lastIndex++;continue}m.push({start:h.index,end:h.index+h[0].length}),h.index===n.lastIndex&&n.lastIndex++}m.length>0&&(a.push({node:l,spans:m}),r+=m.length)}let s=0;for(let{node:c,spans:d}of a)for(let p=d.length-1;p>=0;p--){let{start:m,end:h}=d[p];try{let f=document.createRange();f.setStart(c,m),f.setEnd(c,h);let y=document.createElement("span");y.className="ai-helper-search-highlight",f.surroundContents(y),s++}catch{}}return s}function bt(){document.querySelectorAll(".ai-helper-highlight, .ai-helper-search-highlight").forEach(t=>{let o=t.parentNode;if(o&&o.insertBefore&&o.removeChild){for(;t.firstChild;)o.insertBefore(t.firstChild,t);o.removeChild(t),typeof o.normalize=="function"&&o.normalize()}});let e=document.getElementById("ai-helper-highlight-style");e&&e.remove()}function ae(){let e=document.body,t=document.querySelectorAll('button, input, a[href], dialog, [role="dialog"], [role="alert"]').length;return`${location.href}|${e?e.childElementCount:0}|${t}`}async function ie(e,t=300,o=2e3){let n=Date.now();await new Promise(d=>setTimeout(d,Math.min(t,o)));let a=e.split("|")[0],i=location.href!==a,r=!1,l=e,s=0;for(;Date.now()-n<o;){let d=ae();if(d===l?s++:(r=!0,s=0,l=d),s>=2)break;await new Promise(p=>setTimeout(p,100))}i=location.href!==a;let c={changed:i||r,urlChanged:i,domChanged:r,waitedMs:Date.now()-n};return i&&(c.newUrl=location.href),c}function co(e){return e.isContentEditable||e.getAttribute("contenteditable")==="true"}function ze(e,t){let o=e.tagName==="TEXTAREA"?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(o,"value");n&&n.set?n.set.call(e,t):e.value=t}function Ve(e,t){try{return e.focus(),document.execCommand("insertText",!1,t)||(e.textContent=t),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})),!0}catch{try{return e.textContent=t,e.dispatchEvent(new Event("input",{bubbles:!0})),!0}catch{return!1}}}E("zh",{pageExtract:{startedDownloadingImages:"\u5DF2\u5F00\u59CB\u4E0B\u8F7D {count} \u5F20\u56FE\u7247",targetElementNotFound:"\u672A\u627E\u5230\u76EE\u6807\u5143\u7D20",elementNotFound:"\u672A\u627E\u5230\u5339\u914D\u9009\u62E9\u5668\u7684\u5143\u7D20: {selector}",searchKeywordRequired:"\u9700\u8981\u63D0\u4F9B\u641C\u7D22\u5173\u952E\u8BCD",contentTruncated:"\u5185\u5BB9\u5DF2\u622A\u65AD"}}),E("en",{pageExtract:{startedDownloadingImages:"Started downloading {count} images",targetElementNotFound:"Target element not found",elementNotFound:"No element found matching selector: {selector}",searchKeywordRequired:"Search keyword is required",contentTruncated:"Content truncated"}});function jo(){try{let e=a=>{let i=document.querySelector(`meta[name="${a}"]`)||document.querySelector(`meta[property="${a}"]`)||document.querySelector(`meta[property="og:${a}"]`);return i?i.content:null},t=a=>{let i=document.querySelectorAll(`meta[name="${a}"], meta[property="${a}"], meta[property="og:${a}"]`);return Array.from(i).map(r=>r.content).filter(Boolean)},o=[];document.querySelectorAll('script[type="application/ld+json"]').forEach(a=>{try{let i=JSON.parse(a.textContent);Array.isArray(i)?o.push(...i):i&&i["@graph"]&&Array.isArray(i["@graph"])?o.push(...i["@graph"]):i&&o.push(i)}catch{}});let n=[];return document.querySelectorAll("[itemscope]").forEach(a=>{let i=a.getAttribute("itemtype")||"";if(!i)return;let r={};a.querySelectorAll("[itemprop]").forEach(l=>{if(l.closest("[itemscope]")!==a)return;let s=l.getAttribute("itemprop")||"";if(!s)return;let c=l.getAttribute("content")||l.getAttribute("href")||l.getAttribute("src")||l.textContent?.trim();c&&(r[s]?r[s]=Array.isArray(r[s])?[...r[s],c]:[r[s],c]:r[s]=c)}),n.push({itemType:i,properties:r})}),{success:!0,data:{title:document.title,description:e("description"),keywords:e("keywords"),author:e("author"),ogTitle:e("og:title"),ogDescription:e("og:description"),ogImage:e("og:image"),ogUrl:e("og:url"),ogType:e("og:type"),ogSiteName:e("og:site_name"),ogLocale:e("og:locale"),articlePublishedTime:e("article:published_time"),articleModifiedTime:e("article:modified_time"),articleAuthor:e("article:author"),twitterCard:e("twitter:card"),twitterTitle:e("twitter:title"),twitterDescription:e("twitter:description"),twitterImage:e("twitter:image"),twitterSite:e("twitter:site"),twitterCreator:e("twitter:creator"),canonicalUrl:document.querySelector('link[rel="canonical"]')?.href,links:t("citation_author"),jsonLd:o.length>0?o:void 0,microdata:n.length>0?n:void 0}}}catch(e){return{success:!1,error:e.message}}}function Qo(e="all",t=!1){try{let o=window.location.hostname,n=[];return document.querySelectorAll("a[href]").forEach(a=>{try{let i=a.href;if(!i||i.startsWith("javascript:")||i.startsWith("#"))return;let r=new URL(i),l=r.hostname!==o;if(e==="internal"&&l||e==="external"&&!l)return;n.push({href:i,text:a.textContent.trim(),title:a.title,domain:r.hostname,isExternal:l,target:a.target})}catch{}}),t&&document.querySelectorAll("img[src]").forEach(a=>{try{let i=a.src;if(!i)return;let r=new URL(i),l=r.hostname!==o;if(e==="internal"&&l||e==="external"&&!l)return;n.push({href:i,text:a.alt||"",title:a.title,domain:r.hostname,isExternal:l,type:"image"})}catch{}}),{success:!0,total:n.length,links:n}}catch(o){return{success:!1,error:o.message}}}function Yo(e=null){try{let t=(e?[document.querySelector(e)].filter(Boolean):Array.from(document.querySelectorAll("form"))).map((o,n)=>{let a=[],i=o.id||`form-${n}`;return o.querySelectorAll("input").forEach(r=>{a.push({tag:"input",name:r.name,id:r.id,type:r.type,placeholder:r.placeholder,required:r.required,selector:Ae(r)})}),o.querySelectorAll("textarea").forEach(r=>{a.push({tag:"textarea",name:r.name,id:r.id,placeholder:r.placeholder,required:r.required,selector:Ae(r)})}),o.querySelectorAll("select").forEach(r=>{let l=Array.from(r.options).map(s=>({value:s.value,text:s.textContent.trim()}));a.push({tag:"select",name:r.name,id:r.id,required:r.required,options:l,selector:Ae(r)})}),{formId:i,action:o.action,method:o.method,fields:a}});return{success:!0,total:t.length,forms:t}}catch(t){return{success:!1,error:t.message}}}function Xo(e={}){try{let{minWidth:t=0,minHeight:o=0,includeBackgroundImages:n=!1,download:a=!1,maxResults:i=100}=e,r=[],l=new Set;return document.querySelectorAll("img[src]").forEach(s=>{try{let c=s.src;if(!c||l.has(c))return;let d=s.naturalWidth||s.width||0,p=s.naturalHeight||s.height||0;d>=t&&p>=o&&(l.add(c),r.push({src:c,alt:s.alt||"",title:s.title||"",width:d,height:p,selector:Ae(s)}))}catch{}}),n&&document.querySelectorAll("*").forEach(s=>{try{let c=window.getComputedStyle(s).backgroundImage;if(!c||c==="none"||c.startsWith("gradient"))return;let d=c.match(/url\(['"]?([^'")]+)['"]?\)/);if(d&&d[1]){let p=d[1];l.has(p)||(l.add(p),r.push({src:p,alt:"",title:"",width:0,height:0,type:"background",selector:Ae(s)}))}}catch{}}),a&&r.length>0&&r.slice(0,Math.min(i,10)).forEach((s,c)=>{setTimeout(()=>{let d=document.createElement("a");d.href=s.src,d.download=`image_${c+1}.png`,document.body.appendChild(d),d.click(),document.body.removeChild(d)},c*500)}),{success:!0,total:r.length,images:r.slice(0,i),message:a?u("pageExtract.startedDownloadingImages",{count:Math.min(r.length,10)}):""}}catch(t){return{success:!1,error:t.message}}}function Zo(e="iframe",t=!1,o=1e4){try{let n=document.querySelectorAll(e),a=[],i=(r,l=1,s="")=>{try{let c=Le(r),d=s?`${s} > iframe`:c,p=r.src||"about:blank",m=!1,h="",f="",y=0;try{let w=r.contentDocument||r.contentWindow?.document;w&&(m=!0,h=w.title||"",f=ye(w).substring(0,o),y=We(w).length,t&&l<2&&w.querySelectorAll("iframe").forEach(v=>{i(v,l+1,d)}))}catch{m=!1}a.push({selector:d,url:p,accessible:m,title:h,textContent:f,htmlLength:y})}catch{}};return n.forEach(r=>i(r)),{success:!0,iframes:a,total:a.length,accessible:a.filter(r=>r.accessible).length}}catch(n){return{success:!1,error:n.message}}}function Jo(e={}){try{let{query:t,pattern:o,mode:n="plain",caseSensitive:a=!1,contextLength:i=50,maxResults:r=20,highlight:l=!1}=e,s=t||o;if(!s)return{success:!1,error:u("pageExtract.searchKeywordRequired")};if(n==="plain"){let f=window.find(s,a,!1,!0,!1,!0,!1),y=0,w=[];try{let v=window.getSelection(),C=v&&v.rangeCount>0?v.getRangeAt(0):null,I=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null,!1),$=a?"g":"gi",se=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ee=new RegExp(se,$),A=document.body.innerText,_=0;for(;I.nextNode();){let ce=I.currentNode.textContent.match(ee);if(ce)for(let ge of ce){if(w.length>=r)break;let te=A.indexOf(ge,_),rt=Math.max(0,te-i),No=Math.min(A.length,te+ge.length+i);w.push({match:ge,position:te,context:A.substring(rt,No),lineNumber:A.substring(0,te).split(`
|
|
61
|
-
`).length}),
|
|
61
|
+
`+a.join(`
|
|
62
|
+
`))}catch{}return i}function dt(e){if(!e)return{x:window.innerWidth/2,y:window.innerHeight/2};let t;try{t=e.getBoundingClientRect()}catch{t={left:0,top:0,width:0,height:0}}if(!t||t.width===0&&t.height===0){let i=e.commonAncestorContainer;if(i){let a=i.nodeType===Node.TEXT_NODE?i.parentElement:i;a&&a.getBoundingClientRect&&(t=a.getBoundingClientRect())}}let o=t.left+t.width/2,n=t.top;if(window.top!==window){let i=e.startContainer.ownerDocument;for(;i&&i!==window.top.document;){let a=i.defaultView?.frameElement;if(!a)break;let r=a.getBoundingClientRect();o+=r.left,n+=r.top,i=a.ownerDocument}}return{x:o,y:n}}function Oa(e,t=document,o=5,n=0,i=new Set){if(n>o||i.has(t))return i;try{let a=()=>e();t.addEventListener?.("selectionchange",a),i.add({root:t,listener:a}),t.querySelectorAll&&t.querySelectorAll("*").forEach(r=>{r.shadowRoot&&Oa(e,r.shadowRoot,o,n+1,i)})}catch{}return i}function _a(e){for(let{root:t,listener:o}of e)try{t.removeEventListener?.("selectionchange",o)}catch{}e.clear()}function Pt(e){if(e.id)return`#${e.id}`;let t=[],o=e;for(;o&&o!==document.body&&o!==document.documentElement;){let n=o.tagName.toLowerCase();if(o.id){n=`#${o.id}`,t.unshift(n);break}if(o.className&&typeof o.className=="string"){let a=o.className.trim().split(/\s+/).filter(r=>r);a.length>0&&(n+="."+a[0])}let i=o.parentElement;if(i){let a=Array.from(i.children).filter(r=>r.tagName===o.tagName);if(a.length>1){let r=a.indexOf(o)+1;n+=`:nth-child(${r})`}}t.unshift(n),o=i}return t.join(" > ")}function St(e){if(e.id)return`#${e.id}`;let t=e.tagName.toLowerCase();if(e.className){let o=e.className.split(" ").filter(n=>n).slice(0,2);o.length&&(t+="."+o.join("."))}return t}function ya(e,t,o=20){if(!e||!t)return 0;let n=t.global?t:new RegExp(t.source,t.flags+"g"),i=[],a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),r=0,s;for(;(s=a.nextNode())&&r<o;){let d=s.parentNode;if(!d||d.nodeType!==1)continue;let u=d.tagName;if(u==="SCRIPT"||u==="STYLE"||u==="TITLE"||u==="TEXTAREA")continue;let p=s.nodeValue;if(!p)continue;let h=[],b;for(n.lastIndex=0;(b=n.exec(p))!==null&&r+h.length<o;){if(b[0].length===0){n.lastIndex++;continue}h.push({start:b.index,end:b.index+b[0].length}),b.index===n.lastIndex&&n.lastIndex++}h.length>0&&(i.push({node:s,spans:h}),r+=h.length)}let c=0;for(let{node:d,spans:u}of i)for(let p=u.length-1;p>=0;p--){let{start:h,end:b}=u[p];try{let x=document.createRange();x.setStart(d,h),x.setEnd(d,b);let w=document.createElement("span");w.className="ai-helper-search-highlight",x.surroundContents(w),c++}catch{}}return c}function Xo(){document.querySelectorAll(".ai-helper-highlight, .ai-helper-search-highlight").forEach(t=>{let o=t.parentNode;if(o&&o.insertBefore&&o.removeChild){for(;t.firstChild;)o.insertBefore(t.firstChild,t);o.removeChild(t),typeof o.normalize=="function"&&o.normalize()}});let e=document.getElementById("ai-helper-highlight-style");e&&e.remove()}function Ue(){let e=document.body,t=document.querySelectorAll('button, input, a[href], dialog, [role="dialog"], [role="alert"]').length;return`${location.href}|${e?e.childElementCount:0}|${t}`}async function ze(e,t=300,o=2e3){let n=Date.now();await new Promise(u=>setTimeout(u,Math.min(t,o)));let i=e.split("|")[0],a=location.href!==i,r=!1,s=e,c=0;for(;Date.now()-n<o;){let u=Ue();if(u===s?c++:(r=!0,c=0,s=u),c>=2)break;await new Promise(p=>setTimeout(p,100))}a=location.href!==i;let d={changed:a||r,urlChanged:a,domChanged:r,waitedMs:Date.now()-n};return a&&(d.newUrl=location.href),d}function Ha(e){return e.isContentEditable||e.getAttribute("contenteditable")==="true"}function to(e,t){let o=e.tagName==="TEXTAREA"?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(o,"value");n&&n.set?n.set.call(e,t):e.value=t}function oo(e,t){try{return e.focus(),document.execCommand("insertText",!1,t)||(e.textContent=t),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})),!0}catch{try{return e.textContent=t,e.dispatchEvent(new Event("input",{bubbles:!0})),!0}catch{return!1}}}G("zh",{pageExtract:{startedDownloadingImages:"\u5DF2\u5F00\u59CB\u4E0B\u8F7D {count} \u5F20\u56FE\u7247",targetElementNotFound:"\u672A\u627E\u5230\u76EE\u6807\u5143\u7D20",elementNotFound:"\u672A\u627E\u5230\u5339\u914D\u9009\u62E9\u5668\u7684\u5143\u7D20: {selector}",searchKeywordRequired:"\u9700\u8981\u63D0\u4F9B\u641C\u7D22\u5173\u952E\u8BCD",contentTruncated:"\u5185\u5BB9\u5DF2\u622A\u65AD"}}),G("en",{pageExtract:{startedDownloadingImages:"Started downloading {count} images",targetElementNotFound:"Target element not found",elementNotFound:"No element found matching selector: {selector}",searchKeywordRequired:"Search keyword is required",contentTruncated:"Content truncated"}});function Sr(){try{let e=i=>{let a=document.querySelector(`meta[name="${i}"]`)||document.querySelector(`meta[property="${i}"]`)||document.querySelector(`meta[property="og:${i}"]`);return a?a.content:null},t=i=>{let a=document.querySelectorAll(`meta[name="${i}"], meta[property="${i}"], meta[property="og:${i}"]`);return Array.from(a).map(r=>r.content).filter(Boolean)},o=[];document.querySelectorAll('script[type="application/ld+json"]').forEach(i=>{try{let a=JSON.parse(i.textContent);Array.isArray(a)?o.push(...a):a&&a["@graph"]&&Array.isArray(a["@graph"])?o.push(...a["@graph"]):a&&o.push(a)}catch{}});let n=[];return document.querySelectorAll("[itemscope]").forEach(i=>{let a=i.getAttribute("itemtype")||"";if(!a)return;let r={};i.querySelectorAll("[itemprop]").forEach(s=>{if(s.closest("[itemscope]")!==i)return;let c=s.getAttribute("itemprop")||"";if(!c)return;let d=s.getAttribute("content")||s.getAttribute("href")||s.getAttribute("src")||s.textContent?.trim();d&&(r[c]?r[c]=Array.isArray(r[c])?[...r[c],d]:[r[c],d]:r[c]=d)}),n.push({itemType:a,properties:r})}),{success:!0,data:{title:document.title,description:e("description"),keywords:e("keywords"),author:e("author"),ogTitle:e("og:title"),ogDescription:e("og:description"),ogImage:e("og:image"),ogUrl:e("og:url"),ogType:e("og:type"),ogSiteName:e("og:site_name"),ogLocale:e("og:locale"),articlePublishedTime:e("article:published_time"),articleModifiedTime:e("article:modified_time"),articleAuthor:e("article:author"),twitterCard:e("twitter:card"),twitterTitle:e("twitter:title"),twitterDescription:e("twitter:description"),twitterImage:e("twitter:image"),twitterSite:e("twitter:site"),twitterCreator:e("twitter:creator"),canonicalUrl:document.querySelector('link[rel="canonical"]')?.href,links:t("citation_author"),jsonLd:o.length>0?o:void 0,microdata:n.length>0?n:void 0}}}catch(e){return{success:!1,error:e.message}}}function Ar(e="all",t=!1){try{let o=window.location.hostname,n=[];return document.querySelectorAll("a[href]").forEach(i=>{try{let a=i.href;if(!a||a.startsWith("javascript:")||a.startsWith("#"))return;let r=new URL(a),s=r.hostname!==o;if(e==="internal"&&s||e==="external"&&!s)return;n.push({href:a,text:i.textContent.trim(),title:i.title,domain:r.hostname,isExternal:s,target:i.target})}catch{}}),t&&document.querySelectorAll("img[src]").forEach(i=>{try{let a=i.src;if(!a)return;let r=new URL(a),s=r.hostname!==o;if(e==="internal"&&s||e==="external"&&!s)return;n.push({href:a,text:i.alt||"",title:i.title,domain:r.hostname,isExternal:s,type:"image"})}catch{}}),{success:!0,total:n.length,links:n}}catch(o){return{success:!1,error:o.message}}}function Cr(e=null){try{let t=(e?[document.querySelector(e)].filter(Boolean):Array.from(document.querySelectorAll("form"))).map((o,n)=>{let i=[],a=o.id||`form-${n}`;return o.querySelectorAll("input").forEach(r=>{i.push({tag:"input",name:r.name,id:r.id,type:r.type,placeholder:r.placeholder,required:r.required,selector:St(r)})}),o.querySelectorAll("textarea").forEach(r=>{i.push({tag:"textarea",name:r.name,id:r.id,placeholder:r.placeholder,required:r.required,selector:St(r)})}),o.querySelectorAll("select").forEach(r=>{let s=Array.from(r.options).map(c=>({value:c.value,text:c.textContent.trim()}));i.push({tag:"select",name:r.name,id:r.id,required:r.required,options:s,selector:St(r)})}),{formId:a,action:o.action,method:o.method,fields:i}});return{success:!0,total:t.length,forms:t}}catch(t){return{success:!1,error:t.message}}}function Er(e={}){try{let{minWidth:t=0,minHeight:o=0,includeBackgroundImages:n=!1,download:i=!1,maxResults:a=100}=e,r=[],s=new Set;return document.querySelectorAll("img[src]").forEach(c=>{try{let d=c.src;if(!d||s.has(d))return;let u=c.naturalWidth||c.width||0,p=c.naturalHeight||c.height||0;u>=t&&p>=o&&(s.add(d),r.push({src:d,alt:c.alt||"",title:c.title||"",width:u,height:p,selector:St(c)}))}catch{}}),n&&document.querySelectorAll("*").forEach(c=>{try{let d=window.getComputedStyle(c).backgroundImage;if(!d||d==="none"||d.startsWith("gradient"))return;let u=d.match(/url\(['"]?([^'")]+)['"]?\)/);if(u&&u[1]){let p=u[1];s.has(p)||(s.add(p),r.push({src:p,alt:"",title:"",width:0,height:0,type:"background",selector:St(c)}))}}catch{}}),i&&r.length>0&&r.slice(0,Math.min(a,10)).forEach((c,d)=>{setTimeout(()=>{let u=document.createElement("a");u.href=c.src,u.download=`image_${d+1}.png`,document.body.appendChild(u),u.click(),document.body.removeChild(u)},d*500)}),{success:!0,total:r.length,images:r.slice(0,a),message:i?m("pageExtract.startedDownloadingImages",{count:Math.min(r.length,10)}):""}}catch(t){return{success:!1,error:t.message}}}function Rr(e="iframe",t=!1,o=1e4){try{let n=document.querySelectorAll(e),i=[],a=(r,s=1,c="")=>{try{let d=Pt(r),u=c?`${c} > iframe`:d,p=r.src||"about:blank",h=!1,b="",x="",w=0;try{let k=r.contentDocument||r.contentWindow?.document;k&&(h=!0,b=k.title||"",x=ct(k).substring(0,o),w=eo(k).length,t&&s<2&&k.querySelectorAll("iframe").forEach(S=>{a(S,s+1,u)}))}catch{h=!1}i.push({selector:u,url:p,accessible:h,title:b,textContent:x,htmlLength:w})}catch{}};return n.forEach(r=>a(r)),{success:!0,iframes:i,total:i.length,accessible:i.filter(r=>r.accessible).length}}catch(n){return{success:!1,error:n.message}}}function Ir(e={}){try{let{query:t,pattern:o,mode:n="plain",caseSensitive:i=!1,contextLength:a=50,maxResults:r=20,highlight:s=!1}=e,c=t||o;if(!c)return{success:!1,error:m("pageExtract.searchKeywordRequired")};if(n==="plain"){let x=window.find(c,i,!1,!0,!1,!0,!1),w=0,k=[];try{let S=window.getSelection(),D=S&&S.rangeCount>0?S.getRangeAt(0):null,R=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null,!1),H=i?"g":"gi",B=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Q=new RegExp(B,H),L=document.body.innerText,oe=0;for(;R.nextNode();){let ue=R.currentNode.textContent.match(Q);if(ue)for(let Ae of ue){if(k.length>=r)break;let ne=L.indexOf(Ae,oe),ht=Math.max(0,ne-a),fo=Math.min(L.length,ne+Ae.length+a);k.push({match:Ae,position:ne,context:L.substring(ht,fo),lineNumber:L.substring(0,ne).split(`
|
|
63
|
+
`).length}),w++,oe=ne+Ae.length}if(k.length>=r)break}D&&(S.removeAllRanges(),S.addRange(D))}catch{w=+!!x}if(s&&w>0){Xo();let S=document.createElement("style");S.id="ai-helper-highlight-style",S.textContent=`
|
|
62
64
|
.ai-helper-search-highlight {
|
|
63
65
|
background-color: #ffff00;
|
|
64
66
|
color: #000;
|
|
65
67
|
padding: 1px 2px;
|
|
66
68
|
border-radius: 2px;
|
|
67
69
|
}
|
|
68
|
-
`,document.head.appendChild(
|
|
69
|
-
`).length}),
|
|
70
|
+
`,document.head.appendChild(S);let D=i?"g":"gi",R=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");ya(document.body,new RegExp(R,D),r)}return{success:!0,query:c,mode:"plain",found:x,total:w,matches:k,highlighted:s}}let d=i?"g":"gi",u=new RegExp(c,d),p=document.body.innerText,h=[],b;for(;(b=u.exec(p))!==null&&h.length<r;){let x=Math.max(0,b.index-a),w=Math.min(p.length,b.index+b[0].length+a);h.push({match:b[0],position:b.index,context:p.substring(x,w),lineNumber:p.substring(0,b.index).split(`
|
|
71
|
+
`).length}),b[0].length===0&&u.lastIndex++}if(s&&h.length>0){Xo();let x=document.createElement("style");x.id="ai-helper-highlight-style",x.textContent=`
|
|
70
72
|
.ai-helper-search-highlight {
|
|
71
73
|
background-color: #ffff00;
|
|
72
74
|
color: #000;
|
|
73
75
|
padding: 1px 2px;
|
|
74
76
|
border-radius: 2px;
|
|
75
77
|
}
|
|
76
|
-
`,document.head.appendChild(f),Gt(document.body,new RegExp(s,c),r)}return{success:!0,pattern:s,mode:"regex",total:m.length,matches:m,highlighted:l}}catch(t){return{success:!1,error:t.message}}}E("zh",{pageInteraction:{invalidRefSuggest:"\u65E0\u6548\u6216\u5DF2\u8FC7\u671F\u7684\u5143\u7D20\u5F15\u7528 ref={ref}\u3002",invalidRefSuggestions:"\u6700\u8FD1\u5FEB\u7167\u4E2D\u7684\u6709\u6548\u5F15\u7528\uFF1A{list}\u3002",invalidRefTail:"\u5982\u9875\u9762\u5DF2\u53D8\u5316\uFF0C\u8BF7\u91CD\u65B0\u8C03\u7528 query_elements \u83B7\u53D6\u6700\u65B0\u5FEB\u7167",elementNotVisibleError:"\u5143\u7D20 ref={ref}\uFF08{tag}\uFF09\u5F53\u524D\u4E0D\u53EF\u89C1\uFF0C\u53EF\u80FD\u88AB\u9690\u85CF\u6216\u6298\u53E0",navChangeHint:"\uFF08\u68C0\u6D4B\u5230\u5BFC\u822A\u53D8\u5316\uFF0C\u5DF2\u7B49\u5F85 {ms}ms\uFF09",domChangeHint:"\uFF08\u68C0\u6D4B\u5230DOM\u53D8\u5316\uFF0C\u5DF2\u7B49\u5F85 {ms}ms\uFF09",hoveredByRef:"\u5DF2\u60AC\u505C\u5143\u7D20 ref={ref}\uFF08{tag}\uFF09{hint}",clickedByRef:"\u5DF2\u70B9\u51FB\u5143\u7D20 ref={ref}\uFF08{tag}\uFF09{hint}",typedByRef:"\u5DF2\u5411\u5143\u7D20 ref={ref}\uFF08{tag}\uFF09\u8F93\u5165\u6587\u672C{hint}",typeNotSupported:"\u5143\u7D20 {tag} \u4E0D\u652F\u6301\u6587\u672C\u8F93\u5165\uFF08checkbox/radio \u8BF7\u7528 fill_form \u6216 click\uFF09",valueRequired:"action=type \u65F6 value \u4E0D\u80FD\u4E3A\u7A7A",typeFailed:"\u6587\u672C\u8F93\u5165\u5931\u8D25",textRequired:"text \u4E0D\u80FD\u4E3A\u7A7A",scrolledToText:'\u5DF2\u6EDA\u52A8\u5230\u5305\u542B"{text}"\u7684\u5143\u7D20',scrollTextNotFound:'\u6EDA\u52A8 {count} \u6B21\u672A\u627E\u5230\u5305\u542B"{text}"\u7684\u6587\u672C'}}),E("en",{pageInteraction:{invalidRefSuggest:"Invalid or stale element ref={ref}. ",invalidRefSuggestions:"Nearest valid refs from the latest snapshot: {list}. ",invalidRefTail:"If the page has changed, re-run query_elements",elementNotVisibleError:"Element ref={ref} ({tag}) is not visible; it may be hidden or collapsed",navChangeHint:" (navigation change detected, waited {ms}ms)",domChangeHint:" (DOM change detected, waited {ms}ms)",hoveredByRef:"Hovered element ref={ref} ({tag}){hint}",clickedByRef:"Clicked element ref={ref} ({tag}){hint}",typedByRef:"Typed text into element ref={ref} ({tag}){hint}",typeNotSupported:"Element {tag} does not support text input (use fill_form or click for checkbox/radio)",valueRequired:"value is required when action=type",typeFailed:"Text input failed",textRequired:"text cannot be empty",scrolledToText:'Scrolled to element containing "{text}"',scrollTextNotFound:'Scrolled {count} times but did not find text containing "{text}"'}});var $t=0,yt=new WeakMap,Ne=new Map;function uo(e,t,o){let n=yt.get(e);return n??($t+=1,n=$t,yt.set(e,n)),Ne.set(n,{element:e,selector:null,tag:e.tagName,role:t,name:o}),n}function Wt(e){if(e.selector==null)try{e.selector=Le(e.element)}catch{e.selector=""}return e.selector}function Et(e){let t=parseInt(e,10);if(!t||!Ne.has(t))return{error:zt(t),suggestions:wt(t)};let o=Ne.get(t);if(o.element&&o.element.isConnected)return Wt(o),{entry:o,element:o.element};let n=Wt(o),a=n?L(n):null;return a?(o.element=a,{entry:o,element:a}):{error:zt(t),suggestions:wt(t)}}function wt(e){return[...Ne.entries()].sort((t,o)=>Math.abs(t[0]-e)-Math.abs(o[0]-e)).slice(0,3).map(([t,o])=>({ref:t,role:o.role||o.tag&&o.tag.toLowerCase()||"?",name:o.name||""}))}function zt(e){let t=u("pageInteraction.invalidRefSuggest",{ref:e}),o=wt(e);if(o.length){let n=o.map(a=>`ref ${a.ref} (${a.role}${a.name?` "${a.name}"`:""})`).join(", ");t+=u("pageInteraction.invalidRefSuggestions",{list:n})}return t+=u("pageInteraction.invalidRefTail"),t}function en(e){return Et(e).element||null}var tn=new Set(["button","link","checkbox","radio","switch","tab","menuitem","menuitemcheckbox","menuitemradio","option","combobox","listbox","searchbox","slider","spinbutton","textbox","treeitem"]),on=new Set(["dialog","form","navigation","main","banner","contentinfo","table","row","heading"]);function po(e){let t=e.getAttribute("role"),o=t?t.trim().split(/\s+/)[0]:"";if(o)return o;let n=e.tagName;if(n==="BUTTON")return"button";if(n==="A")return e.hasAttribute("href")?"link":"";if(n==="SELECT")return e.multiple||e.size>1?"listbox":"combobox";if(n==="TEXTAREA")return"textbox";if(n==="SUMMARY")return"button";if(/^H[1-6]$/.test(n))return"heading";if(n==="NAV")return"navigation";if(n==="MAIN")return"main";if(n==="DIALOG")return"dialog";if(n==="FORM")return"form";if(n==="TABLE")return"table";if(n==="TR")return"row";if(n==="INPUT"){let a=(e.type||"text").toLowerCase();return a==="hidden"?"":a==="checkbox"?"checkbox":a==="radio"?"radio":a==="submit"||a==="button"||a==="reset"?"button":a==="search"?"searchbox":a==="range"?"slider":a==="number"?"spinbutton":"textbox"}return""}function mo(e){if(e.hasAttribute("hidden")||e.hasAttribute("inert")||e.getAttribute("aria-hidden")==="true"||e.style&&e.style.display==="none")return!0;let t=typeof getComputedStyle=="function"?getComputedStyle(e):null;return!!t&&t.display==="none"}function Vt(e){if(typeof e.checkVisibility=="function")return!e.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});let t=typeof getComputedStyle=="function"?getComputedStyle(e):null;return t?t.display==="none"||t.visibility==="hidden":!1}function nn(){let e=new Set;try{for(let t of document.querySelectorAll('[aria-expanded="true"][aria-controls]'))e.add(t.getAttribute("aria-controls"))}catch{}return e}function an(e,t,o){if(e.tagName==="DIALOG"&&e.hasAttribute("open"))return!0;if(e.hasAttribute("popover"))try{if(e.matches(":popover-open"))return!0}catch{}if(e.tagName==="SELECT"||e.tagName==="INPUT"||e.tagName==="TEXTAREA")return!1;let n=document.activeElement;return!!((t==="dialog"||t==="alertdialog")&&(e.getAttribute("aria-modal")==="true"||n&&e.contains(n))||(t==="menu"||t==="listbox")&&n&&e.contains(n)||e.id&&o.has(e.id))}function ho(e,t){if(tn.has(t)||e.tagName==="A"&&e.hasAttribute("href"))return!0;if(e.hasAttribute("contenteditable")){let n=e.getAttribute("contenteditable");if(n===""||n==="true"||n==="plaintext-only")return!0}let o=e.getAttribute("tabindex");return!!(o!==null&&parseInt(o,10)>=0||e.hasAttribute("onclick"))}function go(e){let t=[];return e.shadowRoot&&t.push(...e.shadowRoot.children),t.push(...e.children),t}function vt(e,t){let o=(d,p=80)=>{if(!d)return"";let m=String(d).replace(/\s+/g," ").trim();return m.length>p?m.slice(0,p-1)+"\u2026":m},n=d=>o(d?d.textContent:"");if(e.tagName==="SELECT"){let d=e.options&&e.options[e.selectedIndex];if(d&&d.text)return o(d.text)}let a=e.getAttribute("aria-labelledby");if(a){let d=a.split(/\s+/).map(p=>document.getElementById(p)).filter(Boolean).map(p=>n(p)).filter(Boolean).join(" ");if(d)return d}let i=e.getAttribute("aria-label");if(i)return o(i);if(e.id)try{let d=document.querySelector(`label[for="${CSS.escape(e.id)}"]`);if(d){let p=n(d);if(p)return p}}catch{}let r=e.closest&&e.closest("label");if(r){let d=n(r);if(d)return d}if(e.getAttribute("placeholder"))return o(e.getAttribute("placeholder"));if(e.getAttribute("title"))return o(e.getAttribute("title"));if(e.getAttribute("alt"))return o(e.getAttribute("alt"));if(e.tagName==="INPUT"){let d=(e.type||"").toLowerCase();if((d==="submit"||d==="button"||d==="reset")&&e.value)return o(e.value)}let l="";for(let d of e.childNodes)d.nodeType===3&&(l+=d.textContent);l.trim()||(l=e.textContent||"");let s=o(l);if(s)return s;let c=e.previousElementSibling;for(;c&&!(c.textContent||"").trim();)c=c.previousElementSibling;if(c&&!c.querySelector("button, a[href], input, select, textarea")){let d=n(c);if(d)return d}return""}function rn(e,t){let o=[],n=(i,r)=>i&&i.length>r?i.slice(0,r-1)+"\u2026":i;if(t==="link"&&e.getAttribute("href")&&o.push(`href="${n(e.getAttribute("href"),150)}"`),e.tagName==="INPUT"){let i=(e.type||"text").toLowerCase();i!=="text"&&i!=="checkbox"&&i!=="radio"&&o.push(`type="${i}"`)}let a=e.getAttribute("placeholder");return a&&o.push(`placeholder="${n(a,60)}"`),(e.tagName==="INPUT"||e.tagName==="TEXTAREA")&&e.value&&o.push(`value="${n(e.value,60)}"`),e.tagName==="INPUT"&&(e.type==="checkbox"||e.type==="radio")&&e.checked&&o.push('checked="true"'),e.tagName==="OPTION"&&e.selected&&o.push('selected="true"'),o.join(" ")}var ln=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`;function sn(){return window.innerWidth>0&&window.innerHeight>0}function cn(e,t,o){if(!o||!o.length)return!0;let n=e.tagName.toLowerCase(),a=e.tagName==="INPUT"?(e.type||"").toLowerCase():"";return o.some(i=>i===n||i===a||i===t)}function dn(e,t,o){return o?`${t} ${e.textContent||""} ${e.value||""}`.toLowerCase().includes(String(o).toLowerCase()):!0}function un(e={}){let{filterByText:t="",elementTypes:o=null,page:n=1,maxResults:a=100,maxChars:i=6e3,countOnly:r=!1}=e;try{let l=fo({filterByText:t,elementTypes:o,frames:"none"});return l.success?_t({frames:[{frameIndex:0,depth:0,isTop:!0,frameInfo:l.frameInfo,overlayTrees:l.overlayTrees,bodyTree:l.bodyTree}],page:n,maxResults:a,maxChars:i,countOnly:r}):l}catch(l){return console.error("[PageInteraction] queryInteractiveElements failed:",l),{success:!1,error:l.message}}}function pn(e,t,o){let n=e.getAttribute("title")||"",a="";try{a=e.src||""}catch{}a||=e.getAttribute("src")||"";let i=null;try{let l=e.contentWindow&&e.contentWindow.location.href;typeof l=="string"&&(i=l)}catch{}let r=o.iframeOrder.has(e)?o.iframeOrder.get(e):-1;return{t:"frame",title:n,srcUrl:a,sameOriginHref:i,orderInParent:r,depth:t}}function xt(e,t,o,n){if(mo(e)||n.skipRoots&&n.skipRoots.has(e))return!1;let a=po(e),i=ho(e,a),r=!i&&on.has(a)?a:null,l=t+(i||r?1:0);if(n.frames==="auto"&&e.tagName==="IFRAME")return o.push(pn(e,t,n)),!0;let s=[],c=!1;for(let d of go(e))xt(d,l,s,n)&&(c=!0);if(i&&n.matchedSet.has(e)){let d=a||e.tagName.toLowerCase(),p=vt(e,d);return o.push({t:"el",localRef:yt.get(e)??uo(e,d,p),role:d,name:p,attrs:rn(e,d),depth:t,children:s}),!0}if(r&&c){let d=r==="dialog"||r==="heading"?vt(e,a):"";return o.push({t:"container",role:r,name:d,depth:t,children:s}),!0}return c?(o.push(...s),!0):!1}function fo(e={}){let{filterByText:t="",elementTypes:o=null,frames:n="none"}=e;try{Ne.clear();let a=nn(),i=[],r=[];bo(document.body,{matched:r,filterByText:t,elementTypes:o,overlayRoots:i,expandedTargets:a});for(let p of r)uo(p.el,p.role,p.name);let l=new Map;try{document.querySelectorAll("iframe").forEach((p,m)=>l.set(p,m))}catch{}let s={matchedSet:new Set(r.map(p=>p.el)),frames:n,iframeOrder:l,skipRoots:null},c=[];for(let p of i){let m=[];xt(p,0,m,s),c.push(...m)}s.skipRoots=new Set(i);let d=[];return xt(document.body,0,d,s),{success:!0,frameInfo:{url:location.href,title:document.title||"",width:window.innerWidth,height:window.innerHeight,loadId:ln},overlayTrees:c,bodyTree:d}}catch(a){return console.error("[PageInteraction] collectSnapshotOps failed:",a),{success:!1,error:a.message}}}function bo(e,{matched:t,filterByText:o,elementTypes:n,overlayRoots:a,expandedTargets:i,inOverlay:r=!1}){if(mo(e))return;let l=po(e),s=r;if(!s&&!Vt(e)&&an(e,l,i)&&(a.push(e),s=!0),ho(e,l)&&!Vt(e)&&cn(e,l,n)){let c=l||e.tagName.toLowerCase(),d=vt(e,c);dn(e,d,o)&&t.push({el:e,role:c,name:d,inOverlay:s})}for(let c of go(e))bo(c,{matched:t,filterByText:o,elementTypes:n,overlayRoots:a,expandedTargets:i,inOverlay:s})}function mn(e={}){let{scrollPixels:t=800,maxScrolls:o=20,pauseMs:n=500,selector:a}=e;return new Promise(async i=>{try{let r=a?document.querySelector(a):null,l=()=>{let f=r||document.body,y=document.createTreeWalker(f,NodeFilter.SHOW_TEXT),w="",v;for(;v=y.nextNode();){let C=v.parentElement;if(!C)continue;let I=C.getBoundingClientRect();if(I.bottom>-100&&I.top<window.innerHeight+100){let $=v.textContent.trim();$&&(w+=$+`
|
|
77
|
-
`)}}return
|
|
78
|
-
`;let
|
|
79
|
-
`),
|
|
80
|
-
`),contentLength:
|
|
81
|
-
`).length,scrolls:p,startScrollY:
|
|
82
|
-
`),o.data.text=t.toString()}else o.data.text=t.toString();return o}catch(t){return{success:!1,error:t.message}}}function
|
|
83
|
-
${`| ${
|
|
84
|
-
${
|
|
85
|
-
`)}`}:{success:!0,content:JSON.stringify({data:
|
|
78
|
+
`,document.head.appendChild(x),ya(document.body,new RegExp(c,d),r)}return{success:!0,pattern:c,mode:"regex",total:h.length,matches:h,highlighted:s}}catch(t){return{success:!1,error:t.message}}}G("zh",{pageInteraction:{invalidRefSuggest:"\u65E0\u6548\u6216\u5DF2\u8FC7\u671F\u7684\u5143\u7D20\u5F15\u7528 ref={ref}\u3002",invalidRefSuggestions:"\u6700\u8FD1\u5FEB\u7167\u4E2D\u7684\u6709\u6548\u5F15\u7528\uFF1A{list}\u3002",invalidRefTail:"\u5982\u9875\u9762\u5DF2\u53D8\u5316\uFF0C\u8BF7\u91CD\u65B0\u8C03\u7528 query_elements \u83B7\u53D6\u6700\u65B0\u5FEB\u7167",elementNotVisibleError:"\u5143\u7D20 ref={ref}\uFF08{tag}\uFF09\u5F53\u524D\u4E0D\u53EF\u89C1\uFF0C\u53EF\u80FD\u88AB\u9690\u85CF\u6216\u6298\u53E0",navChangeHint:"\uFF08\u68C0\u6D4B\u5230\u5BFC\u822A\u53D8\u5316\uFF0C\u5DF2\u7B49\u5F85 {ms}ms\uFF09",domChangeHint:"\uFF08\u68C0\u6D4B\u5230DOM\u53D8\u5316\uFF0C\u5DF2\u7B49\u5F85 {ms}ms\uFF09",hoveredByRef:"\u5DF2\u60AC\u505C\u5143\u7D20 ref={ref}\uFF08{tag}\uFF09{hint}",clickedByRef:"\u5DF2\u70B9\u51FB\u5143\u7D20 ref={ref}\uFF08{tag}\uFF09{hint}",typedByRef:"\u5DF2\u5411\u5143\u7D20 ref={ref}\uFF08{tag}\uFF09\u8F93\u5165\u6587\u672C{hint}",typeNotSupported:"\u5143\u7D20 {tag} \u4E0D\u652F\u6301\u6587\u672C\u8F93\u5165\uFF08checkbox/radio \u8BF7\u7528 fill_form \u6216 click\uFF09",valueRequired:"action=type \u65F6 value \u4E0D\u80FD\u4E3A\u7A7A",typeFailed:"\u6587\u672C\u8F93\u5165\u5931\u8D25",textRequired:"text \u4E0D\u80FD\u4E3A\u7A7A",scrolledToText:'\u5DF2\u6EDA\u52A8\u5230\u5305\u542B"{text}"\u7684\u5143\u7D20',scrollTextNotFound:'\u6EDA\u52A8 {count} \u6B21\u672A\u627E\u5230\u5305\u542B"{text}"\u7684\u6587\u672C'}}),G("en",{pageInteraction:{invalidRefSuggest:"Invalid or stale element ref={ref}. ",invalidRefSuggestions:"Nearest valid refs from the latest snapshot: {list}. ",invalidRefTail:"If the page has changed, re-run query_elements",elementNotVisibleError:"Element ref={ref} ({tag}) is not visible; it may be hidden or collapsed",navChangeHint:" (navigation change detected, waited {ms}ms)",domChangeHint:" (DOM change detected, waited {ms}ms)",hoveredByRef:"Hovered element ref={ref} ({tag}){hint}",clickedByRef:"Clicked element ref={ref} ({tag}){hint}",typedByRef:"Typed text into element ref={ref} ({tag}){hint}",typeNotSupported:"Element {tag} does not support text input (use fill_form or click for checkbox/radio)",valueRequired:"value is required when action=type",typeFailed:"Text input failed",textRequired:"text cannot be empty",scrolledToText:'Scrolled to element containing "{text}"',scrollTextNotFound:'Scrolled {count} times but did not find text containing "{text}"'}});var wa=0,Zo=new WeakMap,Dt=new Map;function Ba(e,t,o){let n=Zo.get(e);return n??(wa+=1,n=wa,Zo.set(e,n)),Dt.set(n,{element:e,selector:null,tag:e.tagName,role:t,name:o}),n}function va(e){if(e.selector==null)try{e.selector=Pt(e.element)}catch{e.selector=""}return e.selector}function cn(e){let t=parseInt(e,10);if(!t||!Dt.has(t))return{error:xa(t),suggestions:Jo(t)};let o=Dt.get(t);if(o.element&&o.element.isConnected)return va(o),{entry:o,element:o.element};let n=va(o),i=n?te(n):null;return i?(o.element=i,{entry:o,element:i}):{error:xa(t),suggestions:Jo(t)}}function Jo(e){return[...Dt.entries()].sort((t,o)=>Math.abs(t[0]-e)-Math.abs(o[0]-e)).slice(0,3).map(([t,o])=>({ref:t,role:o.role||o.tag&&o.tag.toLowerCase()||"?",name:o.name||""}))}function xa(e){let t=m("pageInteraction.invalidRefSuggest",{ref:e}),o=Jo(e);if(o.length){let n=o.map(i=>`ref ${i.ref} (${i.role}${i.name?` "${i.name}"`:""})`).join(", ");t+=m("pageInteraction.invalidRefSuggestions",{list:n})}return t+=m("pageInteraction.invalidRefTail"),t}function Mr(e){return cn(e).element||null}var Pr=new Set(["button","link","checkbox","radio","switch","tab","menuitem","menuitemcheckbox","menuitemradio","option","combobox","listbox","searchbox","slider","spinbutton","textbox","treeitem"]),Dr=new Set(["dialog","form","navigation","main","banner","contentinfo","table","row","heading"]);function qa(e){let t=e.getAttribute("role"),o=t?t.trim().split(/\s+/)[0]:"";if(o)return o;let n=e.tagName;if(n==="BUTTON")return"button";if(n==="A")return e.hasAttribute("href")?"link":"";if(n==="SELECT")return e.multiple||e.size>1?"listbox":"combobox";if(n==="TEXTAREA")return"textbox";if(n==="SUMMARY")return"button";if(/^H[1-6]$/.test(n))return"heading";if(n==="NAV")return"navigation";if(n==="MAIN")return"main";if(n==="DIALOG")return"dialog";if(n==="FORM")return"form";if(n==="TABLE")return"table";if(n==="TR")return"row";if(n==="INPUT"){let i=(e.type||"text").toLowerCase();return i==="hidden"?"":i==="checkbox"?"checkbox":i==="radio"?"radio":i==="submit"||i==="button"||i==="reset"?"button":i==="search"?"searchbox":i==="range"?"slider":i==="number"?"spinbutton":"textbox"}return""}function Ua(e){if(e.hasAttribute("hidden")||e.hasAttribute("inert")||e.getAttribute("aria-hidden")==="true"||e.style&&e.style.display==="none")return!0;let t=typeof getComputedStyle=="function"?getComputedStyle(e):null;return!!t&&t.display==="none"}function ka(e){if(typeof e.checkVisibility=="function")return!e.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});let t=typeof getComputedStyle=="function"?getComputedStyle(e):null;return t?t.display==="none"||t.visibility==="hidden":!1}function Nr(){let e=new Set;try{for(let t of document.querySelectorAll('[aria-expanded="true"][aria-controls]'))e.add(t.getAttribute("aria-controls"))}catch{}return e}function Lr(e,t,o){if(e.tagName==="DIALOG"&&e.hasAttribute("open"))return!0;if(e.hasAttribute("popover"))try{if(e.matches(":popover-open"))return!0}catch{}if(e.tagName==="SELECT"||e.tagName==="INPUT"||e.tagName==="TEXTAREA")return!1;let n=document.activeElement;return!!((t==="dialog"||t==="alertdialog")&&(e.getAttribute("aria-modal")==="true"||n&&e.contains(n))||(t==="menu"||t==="listbox")&&n&&e.contains(n)||e.id&&o.has(e.id))}function za(e,t){if(Pr.has(t)||e.tagName==="A"&&e.hasAttribute("href"))return!0;if(e.hasAttribute("contenteditable")){let n=e.getAttribute("contenteditable");if(n===""||n==="true"||n==="plaintext-only")return!0}let o=e.getAttribute("tabindex");return!!(o!==null&&parseInt(o,10)>=0||e.hasAttribute("onclick"))}function Ka(e){let t=[];return e.shadowRoot&&t.push(...e.shadowRoot.children),t.push(...e.children),t}function en(e,t){let o=(u,p=80)=>{if(!u)return"";let h=String(u).replace(/\s+/g," ").trim();return h.length>p?h.slice(0,p-1)+"\u2026":h},n=u=>o(u?u.textContent:"");if(e.tagName==="SELECT"){let u=e.options&&e.options[e.selectedIndex];if(u&&u.text)return o(u.text)}let i=e.getAttribute("aria-labelledby");if(i){let u=i.split(/\s+/).map(p=>document.getElementById(p)).filter(Boolean).map(p=>n(p)).filter(Boolean).join(" ");if(u)return u}let a=e.getAttribute("aria-label");if(a)return o(a);if(e.id)try{let u=document.querySelector(`label[for="${CSS.escape(e.id)}"]`);if(u){let p=n(u);if(p)return p}}catch{}let r=e.closest&&e.closest("label");if(r){let u=n(r);if(u)return u}if(e.getAttribute("placeholder"))return o(e.getAttribute("placeholder"));if(e.getAttribute("title"))return o(e.getAttribute("title"));if(e.getAttribute("alt"))return o(e.getAttribute("alt"));if(e.tagName==="INPUT"){let u=(e.type||"").toLowerCase();if((u==="submit"||u==="button"||u==="reset")&&e.value)return o(e.value)}let s="";for(let u of e.childNodes)u.nodeType===3&&(s+=u.textContent);s.trim()||(s=e.textContent||"");let c=o(s);if(c)return c;let d=e.previousElementSibling;for(;d&&!(d.textContent||"").trim();)d=d.previousElementSibling;if(d&&!d.querySelector("button, a[href], input, select, textarea")){let u=n(d);if(u)return u}return""}function Fr(e,t){let o=[],n=(a,r)=>a&&a.length>r?a.slice(0,r-1)+"\u2026":a;if(t==="link"&&e.getAttribute("href")&&o.push(`href="${n(e.getAttribute("href"),150)}"`),e.tagName==="INPUT"){let a=(e.type||"text").toLowerCase();a!=="text"&&a!=="checkbox"&&a!=="radio"&&o.push(`type="${a}"`)}let i=e.getAttribute("placeholder");return i&&o.push(`placeholder="${n(i,60)}"`),(e.tagName==="INPUT"||e.tagName==="TEXTAREA")&&e.value&&o.push(`value="${n(e.value,60)}"`),e.tagName==="INPUT"&&(e.type==="checkbox"||e.type==="radio")&&e.checked&&o.push('checked="true"'),e.tagName==="OPTION"&&e.selected&&o.push('selected="true"'),o.join(" ")}var Or=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`;function _r(){return window.innerWidth>0&&window.innerHeight>0}function Hr(e,t,o){if(!o||!o.length)return!0;let n=e.tagName.toLowerCase(),i=e.tagName==="INPUT"?(e.type||"").toLowerCase():"";return o.some(a=>a===n||a===i||a===t)}function Br(e,t,o){return o?`${t} ${e.textContent||""} ${e.value||""}`.toLowerCase().includes(String(o).toLowerCase()):!0}function qr(e={}){let{filterByText:t="",elementTypes:o=null,page:n=1,maxResults:i=100,maxChars:a=6e3,countOnly:r=!1}=e;try{let s=Ga({filterByText:t,elementTypes:o,frames:"none"});return s.success?Yn({frames:[{frameIndex:0,depth:0,isTop:!0,frameInfo:s.frameInfo,overlayTrees:s.overlayTrees,bodyTree:s.bodyTree}],page:n,maxResults:i,maxChars:a,countOnly:r}):s}catch(s){return console.error("[PageInteraction] queryInteractiveElements failed:",s),{success:!1,error:s.message}}}function Ur(e,t,o){let n=e.getAttribute("title")||"",i="";try{i=e.src||""}catch{}i||=e.getAttribute("src")||"";let a=null;try{let s=e.contentWindow&&e.contentWindow.location.href;typeof s=="string"&&(a=s)}catch{}let r=o.iframeOrder.has(e)?o.iframeOrder.get(e):-1;return{t:"frame",title:n,srcUrl:i,sameOriginHref:a,orderInParent:r,depth:t}}function tn(e,t,o,n){if(Ua(e)||n.skipRoots&&n.skipRoots.has(e))return!1;let i=qa(e),a=za(e,i),r=!a&&Dr.has(i)?i:null,s=t+(a||r?1:0);if(n.frames==="auto"&&e.tagName==="IFRAME")return o.push(Ur(e,t,n)),!0;let c=[],d=!1;for(let u of Ka(e))tn(u,s,c,n)&&(d=!0);if(a&&n.matchedSet.has(e)){let u=i||e.tagName.toLowerCase(),p=en(e,u);return o.push({t:"el",localRef:Zo.get(e)??Ba(e,u,p),role:u,name:p,attrs:Fr(e,u),depth:t,children:c}),!0}if(r&&d){let u=r==="dialog"||r==="heading"?en(e,i):"";return o.push({t:"container",role:r,name:u,depth:t,children:c}),!0}return d?(o.push(...c),!0):!1}function Ga(e={}){let{filterByText:t="",elementTypes:o=null,frames:n="none"}=e;try{Dt.clear();let i=Nr(),a=[],r=[];Wa(document.body,{matched:r,filterByText:t,elementTypes:o,overlayRoots:a,expandedTargets:i});for(let p of r)Ba(p.el,p.role,p.name);let s=new Map;try{document.querySelectorAll("iframe").forEach((p,h)=>s.set(p,h))}catch{}let c={matchedSet:new Set(r.map(p=>p.el)),frames:n,iframeOrder:s,skipRoots:null},d=[];for(let p of a){let h=[];tn(p,0,h,c),d.push(...h)}c.skipRoots=new Set(a);let u=[];return tn(document.body,0,u,c),{success:!0,frameInfo:{url:location.href,title:document.title||"",width:window.innerWidth,height:window.innerHeight,loadId:Or},overlayTrees:d,bodyTree:u}}catch(i){return console.error("[PageInteraction] collectSnapshotOps failed:",i),{success:!1,error:i.message}}}function Wa(e,{matched:t,filterByText:o,elementTypes:n,overlayRoots:i,expandedTargets:a,inOverlay:r=!1}){if(Ua(e))return;let s=qa(e),c=r;if(!c&&!ka(e)&&Lr(e,s,a)&&(i.push(e),c=!0),za(e,s)&&!ka(e)&&Hr(e,s,n)){let d=s||e.tagName.toLowerCase(),u=en(e,d);Br(e,u,o)&&t.push({el:e,role:d,name:u,inOverlay:c})}for(let d of Ka(e))Wa(d,{matched:t,filterByText:o,elementTypes:n,overlayRoots:i,expandedTargets:a,inOverlay:c})}function zr(e={}){let{scrollPixels:t=800,maxScrolls:o=20,pauseMs:n=500,selector:i}=e;return new Promise(async a=>{try{let r=i?document.querySelector(i):null,s=()=>{let x=r||document.body,w=document.createTreeWalker(x,NodeFilter.SHOW_TEXT),k="",S;for(;S=w.nextNode();){let D=S.parentElement;if(!D)continue;let R=D.getBoundingClientRect();if(R.bottom>-100&&R.top<window.innerHeight+100){let H=S.textContent.trim();H&&(k+=H+`
|
|
79
|
+
`)}}return k},c=r||document.scrollingElement||document.documentElement,d="",u=window.scrollY,p=0;for(let x=0;x<o;x++){let w=s();d+=w+`
|
|
80
|
+
`;let k=window.scrollY;if(c.scrollBy({top:t,behavior:"auto"}),p++,await new Promise(S=>setTimeout(S,n)),Math.abs(window.scrollY-k)<5&&(await new Promise(S=>setTimeout(S,n)),Math.abs(window.scrollY-k)<5))break}r&&c.scrollTo({top:u,behavior:"auto"});let h=d.split(`
|
|
81
|
+
`),b=[];for(let x of h){let w=x.trim();w&&w!==b[b.length-1]&&b.push(w)}a({success:!0,content:b.join(`
|
|
82
|
+
`),contentLength:b.join(`
|
|
83
|
+
`).length,scrolls:p,startScrollY:u,endScrollY:window.scrollY})}catch(r){a({success:!1,error:r.message})}})}async function Kr(e,t="click",o={}){let{waitTime:n=300,timeout:i=2e3}=o,a=Re(n,Ee.actionMinWait),r=Re(i,Ee.actionWait),s=parseInt(e,10),c=cn(s);if(c.error)return{success:!1,error:c.error,...c.suggestions&&c.suggestions.length?{suggestions:c.suggestions}:{}};let{entry:d,element:u}=c,p=window.getComputedStyle(u);if(p.display==="none"||p.visibility==="hidden")return{success:!1,error:m("pageInteraction.elementNotVisibleError",{ref:e,tag:d.tag})};if(t==="type"){let w=Ue(),k=Gr(u,o.value,o);if(!k.success)return{success:!1,error:k.error};let S=await ze(w,a,r),D=S.changed?m(S.urlChanged?"pageInteraction.navChangeHint":"pageInteraction.domChangeHint",{ms:S.waitedMs}):"";return{success:!0,message:m("pageInteraction.typedByRef",{ref:s,tag:d.tag,hint:D}),...S}}if(t==="hover"){let w=Ue();u.dispatchEvent(new MouseEvent("mouseover",{bubbles:!0,cancelable:!0,view:window})),u.dispatchEvent(new MouseEvent("mouseenter",{bubbles:!0,cancelable:!0,view:window}));let k=await ze(w,a,r),S=k.changed?m(k.urlChanged?"pageInteraction.navChangeHint":"pageInteraction.domChangeHint",{ms:k.waitedMs}):"";return{success:!0,message:m("pageInteraction.hoveredByRef",{ref:e,tag:d.tag,hint:S}),...k}}let h=Ue();u.click();let b=await ze(h,a,r),x=b.changed?m(b.urlChanged?"pageInteraction.navChangeHint":"pageInteraction.domChangeHint",{ms:b.waitedMs}):"";return{success:!0,message:m("pageInteraction.clickedByRef",{ref:e,tag:d.tag,hint:x}),...b}}function Gr(e,t,{clear:o=!1,submit:n=!1}={}){if(t==null||t==="")return{success:!1,error:m("pageInteraction.valueRequired")};let i=e.tagName,a=Ha(e);if(i==="INPUT"){let r=(e.type||"text").toLowerCase();if(["checkbox","radio","file","submit","button","reset","image"].includes(r))return{success:!1,error:m("pageInteraction.typeNotSupported",{tag:`<input type="${r}">`})}}else if(i!=="TEXTAREA"&&!a)return{success:!1,error:m("pageInteraction.typeNotSupported",{tag:`<${i.toLowerCase()}>`})};try{e.focus()}catch{}if(a&&i!=="INPUT"&&i!=="TEXTAREA"){if(o&&oo(e,""),!oo(e,t))return{success:!1,error:m("pageInteraction.typeFailed")}}else o&&(to(e,""),e.dispatchEvent(new Event("input",{bubbles:!0}))),to(e,t),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}));if(n){let r={key:"Enter",code:"Enter",keyCode:13,which:13,bubbles:!0,cancelable:!0};e.dispatchEvent(new KeyboardEvent("keydown",r)),e.dispatchEvent(new KeyboardEvent("keypress",r)),e.dispatchEvent(new KeyboardEvent("keyup",r))}return{success:!0}}async function Wr(e,t={}){let{maxScrolls:o=20,pauseMs:n=500}=t;if(!e)return{success:!1,error:m("pageInteraction.textRequired")};let i=e.toLowerCase(),a=()=>{let s=Xe("h1, h2, h3, h4, h5, h6, p, span, a, button, li, td, th, label, div");for(let c of s){let d=Array.from(c.childNodes).filter(u=>u.nodeType===Node.TEXT_NODE).map(u=>u.textContent).join("").trim();if(d&&d.toLowerCase().includes(i))return c}return null},r=a();if(r)return r.scrollIntoView({behavior:"smooth",block:"center"}),await new Promise(s=>setTimeout(s,300)),{success:!0,message:m("pageInteraction.scrolledToText",{text:e}),selector:Pt(r),scrolls:0};for(let s=0;s<o;s++){let c=window.scrollY;if(window.scrollBy({top:Math.floor(window.innerHeight*.8),behavior:"auto"}),await new Promise(d=>setTimeout(d,n)),r=a(),r)return r.scrollIntoView({behavior:"smooth",block:"center"}),await new Promise(d=>setTimeout(d,300)),{success:!0,message:m("pageInteraction.scrolledToText",{text:e}),selector:Pt(r),scrolls:s+1};if(Math.abs(window.scrollY-c)<5&&(await new Promise(d=>setTimeout(d,n)),Math.abs(window.scrollY-c)<5))break}return{success:!1,error:m("pageInteraction.scrollTextNotFound",{count:o,text:e}),scrolls:o}}G("zh",{pageTools:{noSelection:"\u5F53\u524D\u6CA1\u6709\u9009\u4E2D\u7684\u5185\u5BB9",tableNotFound:"\u672A\u627E\u5230\u5339\u914D\u9009\u62E9\u5668\u7684\u8868\u683C: {selector}",emptyTable:"\u8868\u683C\u4E3A\u7A7A",copiedToClipboard:"\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F",copiedToClipboardFallback:"\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F\uFF08\u964D\u7EA7\u65B9\u6848\uFF09",elementNotFound:"\u672A\u627E\u5230\u5143\u7D20: {selector}",navChangeHint:"\uFF08\u68C0\u6D4B\u5230\u5BFC\u822A\u53D8\u5316\uFF0C\u5DF2\u7B49\u5F85 {ms}ms\uFF09",domChangeHint:"\uFF08\u68C0\u6D4B\u5230DOM\u53D8\u5316\uFF0C\u5DF2\u7B49\u5F85 {ms}ms\uFF09",hoverTriggered:"\u5DF2\u5728\u5143\u7D20\u4E0A\u89E6\u53D1\u60AC\u505C\u6548\u679C: {selector}{hint}",noHighlightText:"\u672A\u63D0\u4F9B\u8981\u9AD8\u4EAE\u7684\u6587\u672C",highlightedCount:"\u5DF2\u9AD8\u4EAE {count} \u5904\u6587\u672C"}}),G("en",{pageTools:{noSelection:"No content selected",tableNotFound:"No table found matching selector: {selector}",emptyTable:"Table is empty",copiedToClipboard:"Copied to clipboard",copiedToClipboardFallback:"Copied to clipboard (fallback method)",elementNotFound:"Element not found: {selector}",navChangeHint:" (navigation change detected, waited {ms}ms)",domChangeHint:" (DOM change detected, waited {ms}ms)",hoverTriggered:"Hover triggered on element: {selector}{hint}",noHighlightText:"No text provided to highlight",highlightedCount:"Highlighted {count} occurrences"}});function jr(e={}){let{maxLength:t=5e4,includeHeadings:o=!0,includeLinks:n=!0}=e,i=ct(),a={title:document.title||"",url:window.location.href,content:i.substring(0,t),wordCount:i.split(/\s+/).length};return o&&(a.headings=Array.from(Xe("h1, h2, h3, h4, h5, h6")).map(r=>({level:r.tagName,text:r.textContent.trim()})).filter(r=>r.text.length>0).slice(0,30)),n&&(a.links=Array.from(Xe("a")).map(r=>({text:r.textContent.trim(),href:r.href})).filter(r=>r.text.length>0).slice(0,50)),{success:!0,data:a}}function $r(e={}){let{includeStyles:t=!1,maxLength:o=5e4}=e,n=eo();return t||(n=n.replace(/\s*style="[^"]*"/gi,"")),{success:!0,content:JSON.stringify({title:document.title,url:window.location.href,html:n.substring(0,o),fullLength:n.length})}}function Vr(e="text"){try{let t=window.getSelection();if(!t||t.isCollapsed||t.rangeCount===0)return{success:!1,error:m("pageTools.noSelection")};let o={success:!0,data:{selectedCount:t.rangeCount,text:""}};if(e==="html"){let n=[];for(let i=0;i<t.rangeCount;i++){let a=t.getRangeAt(i).cloneContents(),r=document.createElement("div");r.appendChild(a),n.push(r.innerHTML)}o.data.html=n.join(`
|
|
84
|
+
`),o.data.text=t.toString()}else o.data.text=t.toString();return o}catch(t){return{success:!1,error:t.message}}}function Yr(e="table",t=!0,o="json"){try{let n=te(e);if(!n)return{success:!1,error:m("pageTools.tableNotFound",{selector:e})};let i=Array.from(n.querySelectorAll("tr")),a=[];return i.forEach((r,s)=>{let c=Array.from(r.querySelectorAll("td, th")).map(d=>d.textContent.trim());(t||s>0)&&a.push(c)}),o==="markdown"?a.length===0?{success:!0,content:m("pageTools.emptyTable")}:{success:!0,content:`${`| ${a[0].join(" | ")} |`}
|
|
85
|
+
${`| ${a[0].map(()=>"---").join(" | ")} |`}
|
|
86
|
+
${a.slice(1).map(r=>`| ${r.join(" | ")} |`).join(`
|
|
87
|
+
`)}`}:{success:!0,content:JSON.stringify({data:a,rowCount:a.length,columnCount:a[0]?.length||0}),data:a}}catch(n){return{success:!1,error:n.message}}}async function Qr(e){try{return await navigator.clipboard.writeText(e),{success:!0,message:m("pageTools.copiedToClipboard")}}catch{try{let t=document.createElement("textarea");return t.value=e,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),{success:!0,message:m("pageTools.copiedToClipboardFallback")}}catch(t){return{success:!1,error:t.message}}}}async function Xr(){try{return{success:!0,content:await navigator.clipboard.readText()}}catch(e){return{success:!1,error:e.message}}}async function Zr(e){try{let t=te(e);if(!t)return{success:!1,error:m("pageTools.elementNotFound",{selector:e})};let o=Ue();t.dispatchEvent(new MouseEvent("mouseover",{bubbles:!0,cancelable:!0,view:window})),t.dispatchEvent(new MouseEvent("mouseenter",{bubbles:!0,cancelable:!0,view:window}));let n=await ze(o,300,2e3);return{success:!0,message:m("pageTools.hoverTriggered",{selector:e,hint:n.changed?n.urlChanged?m("pageTools.navChangeHint",{ms:n.waitedMs}):m("pageTools.domChangeHint",{ms:n.waitedMs}):""}),...n}}catch(t){return{success:!1,error:t.message}}}function Jr(e,t="yellow"){try{if(!e)return{success:!1,error:m("pageTools.noHighlightText")};Xo();let o=document.createElement("style");o.id="ai-helper-highlight-style",o.textContent=`
|
|
86
88
|
.ai-helper-highlight {
|
|
87
89
|
background-color: ${t} !important;
|
|
88
90
|
padding: 2px 0;
|
|
89
91
|
}
|
|
90
|
-
`,document.head.appendChild(o);let n=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null,!1),a=[],i;for(;i=n.nextNode();)i.nodeValue.toLowerCase().includes(e.toLowerCase())&&a.push(i);let r=[];return a.forEach(l=>{let s=l.parentNode;if(!s||!s.replaceChild||!s.insertBefore)return;let c=l.nodeValue,d=c.toLowerCase(),p=c.toLowerCase(),m=d.indexOf(p);if(m!==-1){let h=document.createElement("span");h.className="ai-helper-highlight",h.textContent=c.substring(m,m+c.length);let f=document.createTextNode(c.substring(0,m)),y=document.createTextNode(c.substring(m+c.length));s.replaceChild(y,l),s.insertBefore(h,y),s.insertBefore(f,h),r.push(h)}}),r.length>0&&r[0].scrollIntoView({behavior:"smooth",block:"center"}),{success:!0,message:u("pageTools.highlightedCount",{count:r.length}),count:r.length}}catch(o){return{success:!1,error:o.message}}}E("zh",{interactionTools:{selectorRequired:"\u9009\u62E9\u5668\u4E0D\u80FD\u4E3A\u7A7A",elementNotFoundBySelector:"\u672A\u627E\u5230\u5339\u914D\u9009\u62E9\u5668\u7684\u5143\u7D20: {selector}",navChangeHint:"\uFF08\u68C0\u6D4B\u5230\u5BFC\u822A\u53D8\u5316\uFF0C\u5DF2\u7B49\u5F85 {ms}ms\uFF09",domChangeHint:"\uFF08\u68C0\u6D4B\u5230DOM\u53D8\u5316\uFF0C\u5DF2\u7B49\u5F85 {ms}ms\uFF09",clickedElement:"\u5DF2\u70B9\u51FB\u5143\u7D20: {selector}{hint}",elementNotFound:"\u672A\u627E\u5230\u5143\u7D20",optionNotFound:"\u672A\u627E\u5230\u5339\u914D\u7684\u9009\u9879",radioButtonNotFound:"\u672A\u627E\u5230\u5339\u914D\u7684\u5355\u9009\u6309\u94AE",formFillComplete:"\u8868\u5355\u586B\u5145\u5B8C\u6210\uFF0C\u6210\u529F {success}/{total} \u4E2A\u5B57\u6BB5",elementNotFoundShort:"\u672A\u627E\u5230\u5143\u7D20: {selector}",invalidScrollTarget:"\u65E0\u6548\u7684\u6EDA\u52A8\u76EE\u6807\u6216\u7F3A\u5C11\u9009\u62E9\u5668",scrollComplete:"\u6EDA\u52A8\u5B8C\u6210",elementAppeared:"\u5143\u7D20 {selector} \u5DF2\u51FA\u73B0",elementDisappeared:"\u5143\u7D20 {selector} \u5DF2\u6D88\u5931",elementVisible:"\u5143\u7D20 {selector} \u5DF2\u53EF\u89C1",elementHidden:"\u5143\u7D20 {selector} \u5DF2\u9690\u85CF",waitTimeout:"\u7B49\u5F85\u8D85\u65F6\uFF08{timeout}ms\uFF09\uFF0C\u5143\u7D20 {selector} \u672A\u8FBE\u5230 {state} \u72B6\u6001",noFocusedElement:"\u6CA1\u6709\u805A\u7126\u7684\u5143\u7D20",keyboardInputSuccess:"\u952E\u76D8\u8F93\u5165\u6210\u529F{hint}",fileUploadNotFound:"\u672A\u627E\u5230\u6587\u4EF6\u4E0A\u4F20\u63A7\u4EF6: {selector}",notFileUploadControl:"\u9009\u62E9\u7684\u5143\u7D20\u4E0D\u662F\u6587\u4EF6\u4E0A\u4F20\u63A7\u4EF6",fileUploaded:"\u5DF2\u4E0A\u4F20\u6587\u4EF6: {fileName}",textRequired:"text \u4E0D\u80FD\u4E3A\u7A7A",hoveredByText:'\u5DF2\u60AC\u505C\u6587\u672C"{text}"\u5BF9\u5E94\u7684{tag}\u5143\u7D20{hint}',clickedByText:'\u5DF2\u70B9\u51FB\u6587\u672C"{text}"\u5BF9\u5E94\u7684{tag}\u5143\u7D20{hint}',textNotFound:'\u9875\u9762\u4E2D\u4E0D\u5B58\u5728\u6587\u672C"{text}"\uFF0C\u53EF\u80FD\u9700\u8981\u5148\u64CD\u4F5C\uFF08\u5982\u6253\u5F00\u4E0B\u62C9\u9762\u677F\uFF09\u6216\u6587\u672C\u6709\u8BEF',textFoundButHidden:'\u627E\u5230\u6587\u672C"{text}"\u4F46\u5143\u7D20\u4E0D\u53EF\u89C1\uFF0C\u53EF\u80FD\u9700\u8981\u5148\u6253\u5F00\u4E0B\u62C9\u9762\u677F/\u6EDA\u52A8\u5230\u53EF\u89C1\u533A\u57DF',textNotClickable:'\u627E\u5230\u6587\u672C"{text}"\u4F46\u4E0D\u5728\u53EF\u70B9\u51FB\u5143\u7D20\u4E2D\uFF0C\u8BF7\u7528 query_elements \u67E5\u770B\u5B9E\u9645\u7ED3\u6784\u6216\u7528 selector \u5B9A\u4F4D',textFoundButNotMatched:'\u627E\u5230\u6587\u672C"{text}"\u5728\u53EF\u70B9\u51FB\u5143\u7D20\u4E2D\u4F46\u672A\u5339\u914D\uFF0C\u53EF\u80FD\u6587\u672C\u88AB\u5206\u5272\u6216\u5927\u5C0F\u5199\u4E0D\u4E00\u81F4',tagConstraint:"\uFF08\u9650\u5B9A\u6807\u7B7E: {tag}\uFF09",triggerNotFound:"\u672A\u627E\u5230\u89E6\u53D1\u5668: {selector}",selectedOption:"\u5DF2\u9009\u62E9: {label}",selectOptionNotFound:'\u5728 <select> \u4E2D\u672A\u627E\u5230\u5339\u914D\u7684\u9009\u9879: "{option}"',optionContainerNotFound:"\u672A\u627E\u5230\u9009\u9879\u5BB9\u5668: {selector}",optionMatchTimeout:'\u5728 {timeout}ms \u5185\u672A\u627E\u5230\u5339\u914D\u9009\u9879: "{option}"',setRequiresKeyValue:"set\u64CD\u4F5C\u9700\u8981\u63D0\u4F9Bkey\u548Cvalue",keySet:"\u5DF2\u8BBE\u7F6E {key}",removeRequiresKey:"remove\u64CD\u4F5C\u9700\u8981\u63D0\u4F9Bkey",keyRemoved:"\u5DF2\u5220\u9664 {key}",storageCleared:"\u5DF2\u6E05\u7A7A\u5B58\u50A8",unknownAction:"\u672A\u77E5\u64CD\u4F5C: {action}"}}),E("en",{interactionTools:{selectorRequired:"Selector cannot be empty",elementNotFoundBySelector:"No element found matching selector: {selector}",navChangeHint:" (navigation change detected, waited {ms}ms)",domChangeHint:" (DOM change detected, waited {ms}ms)",clickedElement:"Clicked element: {selector}{hint}",elementNotFound:"Element not found",optionNotFound:"No matching option found",radioButtonNotFound:"No matching radio button found",formFillComplete:"Form fill complete: {success}/{total} fields succeeded",elementNotFoundShort:"Element not found: {selector}",invalidScrollTarget:"Invalid scroll target or missing selector",scrollComplete:"Scroll complete",elementAppeared:"Element {selector} appeared",elementDisappeared:"Element {selector} disappeared",elementVisible:"Element {selector} is visible",elementHidden:"Element {selector} is hidden",waitTimeout:"Timed out ({timeout}ms); element {selector} did not reach {state} state",noFocusedElement:"No focused element",keyboardInputSuccess:"Keyboard input successful{hint}",fileUploadNotFound:"File upload control not found: {selector}",notFileUploadControl:"The selected element is not a file upload control",fileUploaded:"File uploaded: {fileName}",textRequired:"text cannot be empty",hoveredByText:'Hovered over the {tag} element matching "{text}"{hint}',clickedByText:'Clicked the {tag} element matching "{text}"{hint}',textNotFound:'Text "{text}" does not exist on the page; you may need to perform an action first (e.g. open a dropdown) or the text may be incorrect',textFoundButHidden:'Found text "{text}" but the element is not visible; you may need to open a dropdown panel or scroll to make it visible',textNotClickable:'Found text "{text}" but it is not in a clickable element; use query_elements to inspect the structure or use a selector to locate it',textFoundButNotMatched:'Found text "{text}" in a clickable element but it did not match; the text may be split or have different casing',tagConstraint:" (tag constraint: {tag})",triggerNotFound:"Trigger not found: {selector}",selectedOption:"Selected: {label}",selectOptionNotFound:'No matching option found in <select>: "{option}"',optionContainerNotFound:"Option container not found: {selector}",optionMatchTimeout:'No matching option found within {timeout}ms: "{option}"',setRequiresKeyValue:"Set operation requires both key and value",keySet:"Set {key}",removeRequiresKey:"Remove operation requires a key",keyRemoved:"Removed {key}",storageCleared:"Storage cleared",unknownAction:"Unknown action: {action}"}});async function Cn(e,t=300,o=2e3){let n=Y(t,Q.actionMinWait),a=Y(o,Q.actionWait);try{if(!e)return{success:!1,error:u("interactionTools.selectorRequired")};let i=e.trim();for(let[c,d]of[[/^"([\s\S]*)"$/,"$1"],[/^'([\s\S]*)'$/,"$1"],[/^`([\s\S]*)`$/,"$1"],[/^"([\s\S]*)"$/,"$1"],[/^'([\s\S]*)'$/,"$1"],[/^「([\s\S]*)」$/,"$1"]])i=i.replace(c,d);let r=L(i);if(!r)return{success:!1,error:u("interactionTools.elementNotFoundBySelector",{selector:e})};let l=ae();r.click();let s=await ie(l,n,a);return{success:!0,message:u("interactionTools.clickedElement",{selector:e,hint:s.changed?u(s.urlChanged?"interactionTools.navChangeHint":"interactionTools.domChangeHint",{ms:s.waitedMs}):""}),...s}}catch(i){return{success:!1,error:i.message}}}function An(e,t=500){try{let o=[];e.forEach(a=>{let{selector:i,ref:r,value:l,fieldType:s="text"}=a,c=i||`ref=${r}`,d=null;if(r==null?i&&(d=L(i)):d=en(r),!d){o.push({selector:c,success:!1,error:u("interactionTools.elementNotFound")});return}try{if(s==="text"){if(co(d)){let p=Ve(d,l);o.push({selector:c,success:p,value:l});return}ze(d,l),d.dispatchEvent(new Event("input",{bubbles:!0})),d.dispatchEvent(new Event("change",{bubbles:!0}))}else if(s==="contenteditable"){let p=Ve(d,l);o.push({selector:c,success:p,value:l});return}else if(s==="select"){let p=d.querySelector(`option[value="${l}"]`)||Array.from(d.options).find(m=>m.textContent===l);if(p)d.value=p.value,d.dispatchEvent(new Event("change",{bubbles:!0}));else{o.push({selector:c,success:!1,error:u("interactionTools.optionNotFound")});return}}else if(s==="checkbox")d.checked=l==="true"||l===!0,d.dispatchEvent(new Event("change",{bubbles:!0}));else if(s==="radio"){let p=i?L(`${i}[value="${l}"]`):null;if(!p&&!i&&d.tagName==="INPUT"&&d.type==="radio")if(d.value===String(l))p=d;else{let m=d.getAttribute("name");if(m){let h=d.getRootNode();p=Array.from(h.querySelectorAll('input[type="radio"]')).find(f=>f.name===m&&f.value===String(l))||null}}if(p)p.checked=!0,p.dispatchEvent(new Event("change",{bubbles:!0}));else{o.push({selector:c,success:!1,error:u("interactionTools.radioButtonNotFound")});return}}o.push({selector:c,success:!0,value:l})}catch(p){o.push({selector:c,success:!1,error:p.message})}});let n=o.filter(a=>a.success).length;return{success:!0,message:u("interactionTools.formFillComplete",{success:n,total:e.length}),details:o}}catch(o){return{success:!1,error:o.message}}}function En(e){try{let{target:t="selector",selector:o,x:n=0,y:a=0,behavior:i="smooth",align:r="center"}=e,l=!1;if(t==="top")l=(window.scrollY||0)<=0&&(document.documentElement.scrollTop||0)<=0,window.scrollTo({top:0,left:0,behavior:i});else if(t==="bottom"){let c=document.scrollingElement||document.documentElement;l=(window.scrollY||0)+(window.innerHeight||0)>=c.scrollHeight-1,window.scrollTo({top:document.body.scrollHeight,left:0,behavior:i})}else if(t==="coordinates")l=Math.abs((window.scrollY||0)-a)<1&&Math.abs((window.scrollX||0)-n)<1,window.scrollTo({top:a,left:n,behavior:i});else if(t==="selector"&&o){let c=L(o);if(!c)return{success:!1,error:u("interactionTools.elementNotFoundShort",{selector:o})};c.scrollIntoView({behavior:i,block:r})}else return{success:!1,error:u("interactionTools.invalidScrollTarget")};let s={success:!0,message:u("interactionTools.scrollComplete")};return l&&(s.moved=!1),s}catch(t){return{success:!1,error:t.message}}}function jt(e){if(!e)return!1;if(e.offsetParent===null&&e.tagName!=="BODY"){let i=window.getComputedStyle(e);if(i.display==="none"||i.visibility==="hidden"||i.position!=="fixed")return!1}let t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden"||parseFloat(t.opacity)<=0)return!1;let o=e.getBoundingClientRect();if(o.width<=0||o.height<=0)return!1;let n=window.innerHeight||document.documentElement.clientHeight,a=window.innerWidth||document.documentElement.clientWidth;return o.top<n&&o.bottom>0&&o.left<a&&o.right>0}function In(e,t="appeared",o=1e4){let n=Y(o,Q.waitElement);return new Promise((a,i)=>{let r=Date.now(),l=()=>{let s=L(e);if(t==="appeared"&&s){a({success:!0,message:u("interactionTools.elementAppeared",{selector:e}),element:e});return}if(t==="disappeared"&&!s){a({success:!0,message:u("interactionTools.elementDisappeared",{selector:e})});return}if(t==="visible"&&s&&jt(s)){a({success:!0,message:u("interactionTools.elementVisible",{selector:e}),element:e});return}if(t==="hidden"&&(!s||!jt(s))){a({success:!0,message:u("interactionTools.elementHidden",{selector:e})});return}if(Date.now()-r>n){a({success:!1,error:u("interactionTools.waitTimeout",{timeout:n,selector:e,state:t})});return}setTimeout(l,100)};l()})}var Qt={enter:{code:"Enter",keyCode:13},escape:{code:"Escape",keyCode:27},esc:{code:"Escape",keyCode:27},tab:{code:"Tab",keyCode:9},backspace:{code:"Backspace",keyCode:8},delete:{code:"Delete",keyCode:46},arrowup:{code:"ArrowUp",keyCode:38},arrowdown:{code:"ArrowDown",keyCode:40},arrowleft:{code:"ArrowLeft",keyCode:37},arrowright:{code:"ArrowRight",keyCode:39},home:{code:"Home",keyCode:36},end:{code:"End",keyCode:35},pageup:{code:"PageUp",keyCode:33},pagedown:{code:"PageDown",keyCode:34},space:{code:"Space",keyCode:32}};function Rn(e){let t=e.toLowerCase();if(Qt[t])return Qt[t];if(e.length===1&&/[a-zA-Z]/.test(e))return{code:`Key${e.toUpperCase()}`,keyCode:e.toUpperCase().charCodeAt(0)};if(e.length===1&&/[0-9]/.test(e))return{code:`Digit${e}`,keyCode:e.charCodeAt(0)};let o=e.match(/^F([1-9]|1[0-2])$/i);if(o){let n=parseInt(o[1],10);return{code:`F${n}`,keyCode:111+n}}return{code:e,keyCode:e.toUpperCase().charCodeAt(0)}}async function Pn({key:e,text:t,ctrlKey:o=!1,shiftKey:n=!1,altKey:a=!1}){try{let i=document.activeElement;if(!i)return{success:!1,error:u("interactionTools.noFocusedElement")};let r=ae();if(t){let s=i.tagName==="INPUT"||i.tagName==="TEXTAREA",c=i.isContentEditable;if(s||c){if(i.focus(),c)try{document.execCommand("selectAll",!1,null),document.execCommand("insertText",!1,t)}catch{i.textContent+=t}else ze(i,i.value+t);try{i.dispatchEvent(new InputEvent("input",{bubbles:!0,cancelable:!0,inputType:"insertText",data:t}))}catch{i.dispatchEvent(new Event("input",{bubbles:!0}))}i.dispatchEvent(new Event("change",{bubbles:!0}))}}if(e){let s=Rn(e),c={key:e,code:s.code,keyCode:s.keyCode,which:s.keyCode,bubbles:!0,cancelable:!0,ctrlKey:o,shiftKey:n,altKey:a};document.activeElement.dispatchEvent(new KeyboardEvent("keydown",c)),document.activeElement.dispatchEvent(new KeyboardEvent("keypress",c)),document.activeElement.dispatchEvent(new KeyboardEvent("keyup",c))}let l=await ie(r,300,2e3);return{success:!0,message:u("interactionTools.keyboardInputSuccess",{hint:l.changed?u(l.urlChanged?"interactionTools.navChangeHint":"interactionTools.domChangeHint",{ms:l.waitedMs}):""}),...l}}catch(i){return{success:!1,error:i.message}}}function Mn(e,t,o,n="application/octet-stream"){try{let a=L(e);if(!a)return{success:!1,error:u("interactionTools.fileUploadNotFound",{selector:e})};if(a.type!=="file")return{success:!1,error:u("interactionTools.notFileUploadControl")};let i;try{let s=atob(o),c=new Uint8Array(s.length);for(let d=0;d<s.length;d++)c[d]=s.charCodeAt(d);i=new Blob([c],{type:n})}catch{i=new Blob([o],{type:n})}let r=new File([i],t,{type:n}),l=new DataTransfer;return l.items.add(r),a.files=l.files,a.dispatchEvent(new Event("change",{bubbles:!0})),{success:!0,message:u("interactionTools.fileUploaded",{fileName:t})}}catch(a){return{success:!1,error:a.message}}}async function Dn(e,t={}){let{tag:o,action:n="click",waitTime:a=300,timeout:i=2e3}=t,r=Y(a,Q.actionMinWait),l=Y(i,Q.actionWait);if(!e)return{success:!1,error:u("interactionTools.textRequired")};let s=o?[o]:["button",'[role="button"]','input[type="submit"]','input[type="button"]',"a[href]",'[role="menuitem"]','[role="menuitemradio"]','[role="menuitemcheckbox"]','[role="option"]','[role="tab"]',"[onclick]","summary","li"],c=e.toLowerCase();for(let f of s){let y=[];try{y=pe(f)}catch{continue}for(let w of y){let v=(w.textContent||w.value||"").trim();if(!v)continue;let C=v.toLowerCase();if(v===e||C===c||C.includes(c)){let I=window.getComputedStyle(w);if(I.display==="none"||I.visibility==="hidden"||parseFloat(I.opacity)<=0)continue;let $=Le(w),se=ae();if(n==="hover"){w.dispatchEvent(new MouseEvent("mouseover",{bubbles:!0,cancelable:!0,view:window})),w.dispatchEvent(new MouseEvent("mouseenter",{bubbles:!0,cancelable:!0,view:window}));let _=await ie(se,r,l),ce=_.changed?u(_.urlChanged?"interactionTools.navChangeHint":"interactionTools.domChangeHint",{ms:_.waitedMs}):"";return{success:!0,message:u("interactionTools.hoveredByText",{text:e,tag:w.tagName.toLowerCase(),hint:ce}),selector:$,matchedText:v.substring(0,100),..._}}w.click();let ee=await ie(se,r,l),A=ee.changed?u(ee.urlChanged?"interactionTools.navChangeHint":"interactionTools.domChangeHint",{ms:ee.waitedMs}):"";return{success:!0,message:u("interactionTools.clickedByText",{text:e,tag:w.tagName.toLowerCase(),hint:A}),selector:$,matchedText:v.substring(0,100),...ee}}}}let d=!1,p=!1,m=!1;try{let f=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null);for(;f.nextNode();)if((f.currentNode.textContent||"").toLowerCase().includes(c)){d=!0;let y=f.currentNode.parentElement;if(y){let w=window.getComputedStyle(y);(w.display==="none"||w.visibility==="hidden"||parseFloat(w.opacity)<=0)&&(p=!0),y.closest('button, [role="button"], [role="option"], [role="tab"], li, a[href], [onclick], summary, [tabindex]')||(m=!0)}break}}catch{}let h;return h=u(d?p?"interactionTools.textFoundButHidden":m?"interactionTools.textNotClickable":"interactionTools.textFoundButNotMatched":"interactionTools.textNotFound",{text:e}),{success:!1,error:h+(o?u("interactionTools.tagConstraint",{tag:o}):"")}}function Ln(e,t,o=null,n=5e3){let a=Y(n,Q.selectOption);return new Promise(async i=>{try{let r=L(e);if(!r){i({success:!1,error:u("interactionTools.triggerNotFound",{selector:e})});return}if(r.tagName==="SELECT"){let d=r.options;for(let p=0;p<d.length;p++){let m=d[p],h=(m.textContent||m.label||"").trim();if(h===t||h.includes(t)){r.value=m.value,r.dispatchEvent(new Event("change",{bubbles:!0})),r.dispatchEvent(new Event("input",{bubbles:!0})),i({success:!0,message:u("interactionTools.selectedOption",{label:h}),triggerTag:"SELECT"});return}}i({success:!1,error:u("interactionTools.selectOptionNotFound",{option:t}),availableOptions:Array.from(d).map(p=>p.textContent?.trim()).filter(Boolean)});return}r.click(),await new Promise(d=>setTimeout(d,300));let l=Date.now(),s=o?L(o):document;if(!s){i({success:!1,error:u("interactionTools.optionContainerNotFound",{selector:o})});return}let c=null;for(;Date.now()-l<a;){let d=pe('li, [role="option"], [role="menuitem"], .option, .dropdown-item, .select-item, [data-value], div',s);for(let p of d){let m=(p.textContent||"").trim();if(!(m.length<2)&&(m===t||m.includes(t)||m.replace(/\s+/g,"")===t.replace(/\s+/g,""))){c=p;break}}if(c)break;await new Promise(p=>setTimeout(p,100))}if(!c){i({success:!1,error:u("interactionTools.optionMatchTimeout",{timeout:a,option:t})});return}c.click(),i({success:!0,message:u("interactionTools.selectedOption",{label:c.textContent?.trim()}),triggerTag:r.tagName})}catch(r){i({success:!1,error:r.message})}})}function Nn({action:e,storage:t,key:o,value:n}){try{let a=t==="session"?sessionStorage:localStorage;switch(e){case"get":if(!o){let r={};for(let l=0;l<a.length;l++){let s=a.key(l);r[s]=a.getItem(s)}return{success:!0,content:JSON.stringify(r),data:r}}let i=a.getItem(o);return{success:!0,content:JSON.stringify({key:o,value:i}),value:i};case"set":return!o||n===void 0?{success:!1,error:u("interactionTools.setRequiresKeyValue")}:(a.setItem(o,n),{success:!0,message:u("interactionTools.keySet",{key:o})});case"remove":return o?(a.removeItem(o),{success:!0,message:u("interactionTools.keyRemoved",{key:o})}):{success:!1,error:u("interactionTools.removeRequiresKey")};case"clear":return a.clear(),{success:!0,message:u("interactionTools.storageCleared")};default:return{success:!1,error:u("interactionTools.unknownAction",{action:e})}}}catch(a){return{success:!1,error:a.message}}}E("zh",{advancedTools:{close:"\u5173\u95ED",qrcodeLibNotLoaded:"QRCode \u5E93\u672A\u52A0\u8F7D\uFF0C\u5DF2\u4F7F\u7528 SVG \u964D\u7EA7\u65B9\u6848\u751F\u6210",qrcodeLibAndFallbackUnavailable:"\u4E8C\u7EF4\u7801\u5E93\u672A\u52A0\u8F7D\u4E14\u964D\u7EA7\u65B9\u6848\u4E0D\u53EF\u7528",targetElementNotFound:"\u672A\u627E\u5230\u76EE\u6807\u5143\u7D20",screenshotFailed:"\u622A\u56FE\u5931\u8D25",cssParamRequired:"css \u53C2\u6570\u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32",unsupportedInjectMode:"\u4E0D\u652F\u6301\u7684 injectMode: {mode}\uFF0C\u652F\u6301 'style' \u6216 'inline'"}}),E("en",{advancedTools:{close:"Close",qrcodeLibNotLoaded:"QRCode library not loaded, used SVG fallback",qrcodeLibAndFallbackUnavailable:"QRCode library not loaded and fallback unavailable",targetElementNotFound:"Target element not found",screenshotFailed:"Screenshot failed",cssParamRequired:"css parameter must be a non-empty string",unsupportedInjectMode:"Unsupported injectMode: {mode}; supported: 'style' or 'inline'"}});function Fn(e,t){try{let o=document.createElement("canvas");o.width=t,o.height=t;let n=o.getContext("2d");n.fillStyle="#FFFFFF",n.fillRect(0,0,t,t);let a=[];for(let p=0;p<e.length;p++)a.push(e.charCodeAt(p));let i=Math.max(2,Math.floor(t/41)),r=Math.floor(t/i),l=Math.floor((t-r*i)/2);n.fillStyle="#000000";let s=(p,m)=>{let h=7*i;n.fillRect(p,m,h,h),n.fillStyle="#FFFFFF",n.fillRect(p+i,m+i,h-2*i,h-2*i),n.fillStyle="#000000",n.fillRect(p+2*i,m+2*i,h-4*i,h-4*i),n.fillStyle="#000000"};s(l,l),s(l+(r-7)*i,l),s(l,l+(r-7)*i);let c=0;for(let p=0;p<e.length;p++)c=(c<<5)-c+e.charCodeAt(p),c|=0;let d=p=>{let m=p+1831565813;return m=Math.imul(m^m>>>15,m|1),m^=m+Math.imul(m^m>>>7,m|61),((m^m>>>14)>>>0)/4294967296};for(let p=0;p<r;p++)for(let m=0;m<r;m++){let h=p<8&&m<8,f=p<8&&m>=r-8,y=p>=r-8&&m<8;h||f||y||d(c+p*r+m)>.5&&n.fillRect(l+m*i,l+p*i,i,i)}return o.toDataURL("image/png")}catch{return null}}function Hn(e="",t=200,o="M",n=!0){return new Promise(a=>{try{let i=e||window.location.href,r=document.createElement("div");r.id="ai-helper-qrcode",r.style.cssText=`
|
|
92
|
+
`,document.head.appendChild(o);let n=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null,!1),i=[],a;for(;a=n.nextNode();)a.nodeValue.toLowerCase().includes(e.toLowerCase())&&i.push(a);let r=[];return i.forEach(s=>{let c=s.parentNode;if(!c||!c.replaceChild||!c.insertBefore)return;let d=s.nodeValue,u=d.toLowerCase(),p=d.toLowerCase(),h=u.indexOf(p);if(h!==-1){let b=document.createElement("span");b.className="ai-helper-highlight",b.textContent=d.substring(h,h+d.length);let x=document.createTextNode(d.substring(0,h)),w=document.createTextNode(d.substring(h+d.length));c.replaceChild(w,s),c.insertBefore(b,w),c.insertBefore(x,b),r.push(b)}}),r.length>0&&r[0].scrollIntoView({behavior:"smooth",block:"center"}),{success:!0,message:m("pageTools.highlightedCount",{count:r.length}),count:r.length}}catch(o){return{success:!1,error:o.message}}}G("zh",{interactionTools:{selectorRequired:"\u9009\u62E9\u5668\u4E0D\u80FD\u4E3A\u7A7A",elementNotFoundBySelector:"\u672A\u627E\u5230\u5339\u914D\u9009\u62E9\u5668\u7684\u5143\u7D20: {selector}",navChangeHint:"\uFF08\u68C0\u6D4B\u5230\u5BFC\u822A\u53D8\u5316\uFF0C\u5DF2\u7B49\u5F85 {ms}ms\uFF09",domChangeHint:"\uFF08\u68C0\u6D4B\u5230DOM\u53D8\u5316\uFF0C\u5DF2\u7B49\u5F85 {ms}ms\uFF09",clickedElement:"\u5DF2\u70B9\u51FB\u5143\u7D20: {selector}{hint}",elementNotFound:"\u672A\u627E\u5230\u5143\u7D20",optionNotFound:"\u672A\u627E\u5230\u5339\u914D\u7684\u9009\u9879",radioButtonNotFound:"\u672A\u627E\u5230\u5339\u914D\u7684\u5355\u9009\u6309\u94AE",formFillComplete:"\u8868\u5355\u586B\u5145\u5B8C\u6210\uFF0C\u6210\u529F {success}/{total} \u4E2A\u5B57\u6BB5",elementNotFoundShort:"\u672A\u627E\u5230\u5143\u7D20: {selector}",invalidScrollTarget:"\u65E0\u6548\u7684\u6EDA\u52A8\u76EE\u6807\u6216\u7F3A\u5C11\u9009\u62E9\u5668",scrollComplete:"\u6EDA\u52A8\u5B8C\u6210",elementAppeared:"\u5143\u7D20 {selector} \u5DF2\u51FA\u73B0",elementDisappeared:"\u5143\u7D20 {selector} \u5DF2\u6D88\u5931",elementVisible:"\u5143\u7D20 {selector} \u5DF2\u53EF\u89C1",elementHidden:"\u5143\u7D20 {selector} \u5DF2\u9690\u85CF",waitTimeout:"\u7B49\u5F85\u8D85\u65F6\uFF08{timeout}ms\uFF09\uFF0C\u5143\u7D20 {selector} \u672A\u8FBE\u5230 {state} \u72B6\u6001",noFocusedElement:"\u6CA1\u6709\u805A\u7126\u7684\u5143\u7D20",keyboardInputSuccess:"\u952E\u76D8\u8F93\u5165\u6210\u529F{hint}",fileUploadNotFound:"\u672A\u627E\u5230\u6587\u4EF6\u4E0A\u4F20\u63A7\u4EF6: {selector}",notFileUploadControl:"\u9009\u62E9\u7684\u5143\u7D20\u4E0D\u662F\u6587\u4EF6\u4E0A\u4F20\u63A7\u4EF6",fileUploaded:"\u5DF2\u4E0A\u4F20\u6587\u4EF6: {fileName}",textRequired:"text \u4E0D\u80FD\u4E3A\u7A7A",hoveredByText:'\u5DF2\u60AC\u505C\u6587\u672C"{text}"\u5BF9\u5E94\u7684{tag}\u5143\u7D20{hint}',clickedByText:'\u5DF2\u70B9\u51FB\u6587\u672C"{text}"\u5BF9\u5E94\u7684{tag}\u5143\u7D20{hint}',textNotFound:'\u9875\u9762\u4E2D\u4E0D\u5B58\u5728\u6587\u672C"{text}"\uFF0C\u53EF\u80FD\u9700\u8981\u5148\u64CD\u4F5C\uFF08\u5982\u6253\u5F00\u4E0B\u62C9\u9762\u677F\uFF09\u6216\u6587\u672C\u6709\u8BEF',textFoundButHidden:'\u627E\u5230\u6587\u672C"{text}"\u4F46\u5143\u7D20\u4E0D\u53EF\u89C1\uFF0C\u53EF\u80FD\u9700\u8981\u5148\u6253\u5F00\u4E0B\u62C9\u9762\u677F/\u6EDA\u52A8\u5230\u53EF\u89C1\u533A\u57DF',textNotClickable:'\u627E\u5230\u6587\u672C"{text}"\u4F46\u4E0D\u5728\u53EF\u70B9\u51FB\u5143\u7D20\u4E2D\uFF0C\u8BF7\u7528 query_elements \u67E5\u770B\u5B9E\u9645\u7ED3\u6784\u6216\u7528 selector \u5B9A\u4F4D',textFoundButNotMatched:'\u627E\u5230\u6587\u672C"{text}"\u5728\u53EF\u70B9\u51FB\u5143\u7D20\u4E2D\u4F46\u672A\u5339\u914D\uFF0C\u53EF\u80FD\u6587\u672C\u88AB\u5206\u5272\u6216\u5927\u5C0F\u5199\u4E0D\u4E00\u81F4',tagConstraint:"\uFF08\u9650\u5B9A\u6807\u7B7E: {tag}\uFF09",triggerNotFound:"\u672A\u627E\u5230\u89E6\u53D1\u5668: {selector}",selectedOption:"\u5DF2\u9009\u62E9: {label}",selectOptionNotFound:'\u5728 <select> \u4E2D\u672A\u627E\u5230\u5339\u914D\u7684\u9009\u9879: "{option}"',optionContainerNotFound:"\u672A\u627E\u5230\u9009\u9879\u5BB9\u5668: {selector}",optionMatchTimeout:'\u5728 {timeout}ms \u5185\u672A\u627E\u5230\u5339\u914D\u9009\u9879: "{option}"',setRequiresKeyValue:"set\u64CD\u4F5C\u9700\u8981\u63D0\u4F9Bkey\u548Cvalue",keySet:"\u5DF2\u8BBE\u7F6E {key}",removeRequiresKey:"remove\u64CD\u4F5C\u9700\u8981\u63D0\u4F9Bkey",keyRemoved:"\u5DF2\u5220\u9664 {key}",storageCleared:"\u5DF2\u6E05\u7A7A\u5B58\u50A8",unknownAction:"\u672A\u77E5\u64CD\u4F5C: {action}"}}),G("en",{interactionTools:{selectorRequired:"Selector cannot be empty",elementNotFoundBySelector:"No element found matching selector: {selector}",navChangeHint:" (navigation change detected, waited {ms}ms)",domChangeHint:" (DOM change detected, waited {ms}ms)",clickedElement:"Clicked element: {selector}{hint}",elementNotFound:"Element not found",optionNotFound:"No matching option found",radioButtonNotFound:"No matching radio button found",formFillComplete:"Form fill complete: {success}/{total} fields succeeded",elementNotFoundShort:"Element not found: {selector}",invalidScrollTarget:"Invalid scroll target or missing selector",scrollComplete:"Scroll complete",elementAppeared:"Element {selector} appeared",elementDisappeared:"Element {selector} disappeared",elementVisible:"Element {selector} is visible",elementHidden:"Element {selector} is hidden",waitTimeout:"Timed out ({timeout}ms); element {selector} did not reach {state} state",noFocusedElement:"No focused element",keyboardInputSuccess:"Keyboard input successful{hint}",fileUploadNotFound:"File upload control not found: {selector}",notFileUploadControl:"The selected element is not a file upload control",fileUploaded:"File uploaded: {fileName}",textRequired:"text cannot be empty",hoveredByText:'Hovered over the {tag} element matching "{text}"{hint}',clickedByText:'Clicked the {tag} element matching "{text}"{hint}',textNotFound:'Text "{text}" does not exist on the page; you may need to perform an action first (e.g. open a dropdown) or the text may be incorrect',textFoundButHidden:'Found text "{text}" but the element is not visible; you may need to open a dropdown panel or scroll to make it visible',textNotClickable:'Found text "{text}" but it is not in a clickable element; use query_elements to inspect the structure or use a selector to locate it',textFoundButNotMatched:'Found text "{text}" in a clickable element but it did not match; the text may be split or have different casing',tagConstraint:" (tag constraint: {tag})",triggerNotFound:"Trigger not found: {selector}",selectedOption:"Selected: {label}",selectOptionNotFound:'No matching option found in <select>: "{option}"',optionContainerNotFound:"Option container not found: {selector}",optionMatchTimeout:'No matching option found within {timeout}ms: "{option}"',setRequiresKeyValue:"Set operation requires both key and value",keySet:"Set {key}",removeRequiresKey:"Remove operation requires a key",keyRemoved:"Removed {key}",storageCleared:"Storage cleared",unknownAction:"Unknown action: {action}"}});async function el(e,t=300,o=2e3){let n=Re(t,Ee.actionMinWait),i=Re(o,Ee.actionWait);try{if(!e)return{success:!1,error:m("interactionTools.selectorRequired")};let a=e.trim();for(let[d,u]of[[/^"([\s\S]*)"$/,"$1"],[/^'([\s\S]*)'$/,"$1"],[/^`([\s\S]*)`$/,"$1"],[/^"([\s\S]*)"$/,"$1"],[/^'([\s\S]*)'$/,"$1"],[/^「([\s\S]*)」$/,"$1"]])a=a.replace(d,u);let r=te(a);if(!r)return{success:!1,error:m("interactionTools.elementNotFoundBySelector",{selector:e})};let s=Ue();r.click();let c=await ze(s,n,i);return{success:!0,message:m("interactionTools.clickedElement",{selector:e,hint:c.changed?m(c.urlChanged?"interactionTools.navChangeHint":"interactionTools.domChangeHint",{ms:c.waitedMs}):""}),...c}}catch(a){return{success:!1,error:a.message}}}function tl(e,t=500){try{let o=[];e.forEach(i=>{let{selector:a,ref:r,value:s,fieldType:c="text"}=i,d=a||`ref=${r}`,u=null;if(r==null?a&&(u=te(a)):u=Mr(r),!u){o.push({selector:d,success:!1,error:m("interactionTools.elementNotFound")});return}try{if(c==="text"){if(Ha(u)){let p=oo(u,s);o.push({selector:d,success:p,value:s});return}to(u,s),u.dispatchEvent(new Event("input",{bubbles:!0})),u.dispatchEvent(new Event("change",{bubbles:!0}))}else if(c==="contenteditable"){let p=oo(u,s);o.push({selector:d,success:p,value:s});return}else if(c==="select"){let p=u.querySelector(`option[value="${s}"]`)||Array.from(u.options).find(h=>h.textContent===s);if(p)u.value=p.value,u.dispatchEvent(new Event("change",{bubbles:!0}));else{o.push({selector:d,success:!1,error:m("interactionTools.optionNotFound")});return}}else if(c==="checkbox")u.checked=s==="true"||s===!0,u.dispatchEvent(new Event("change",{bubbles:!0}));else if(c==="radio"){let p=a?te(`${a}[value="${s}"]`):null;if(!p&&!a&&u.tagName==="INPUT"&&u.type==="radio")if(u.value===String(s))p=u;else{let h=u.getAttribute("name");if(h){let b=u.getRootNode();p=Array.from(b.querySelectorAll('input[type="radio"]')).find(x=>x.name===h&&x.value===String(s))||null}}if(p)p.checked=!0,p.dispatchEvent(new Event("change",{bubbles:!0}));else{o.push({selector:d,success:!1,error:m("interactionTools.radioButtonNotFound")});return}}o.push({selector:d,success:!0,value:s})}catch(p){o.push({selector:d,success:!1,error:p.message})}});let n=o.filter(i=>i.success).length;return{success:!0,message:m("interactionTools.formFillComplete",{success:n,total:e.length}),details:o}}catch(o){return{success:!1,error:o.message}}}function ol(e){try{let{target:t="selector",selector:o,x:n=0,y:i=0,behavior:a="smooth",align:r="center"}=e,s=!1;if(t==="top")s=(window.scrollY||0)<=0&&(document.documentElement.scrollTop||0)<=0,window.scrollTo({top:0,left:0,behavior:a});else if(t==="bottom"){let d=document.scrollingElement||document.documentElement;s=(window.scrollY||0)+(window.innerHeight||0)>=d.scrollHeight-1,window.scrollTo({top:document.body.scrollHeight,left:0,behavior:a})}else if(t==="coordinates")s=Math.abs((window.scrollY||0)-i)<1&&Math.abs((window.scrollX||0)-n)<1,window.scrollTo({top:i,left:n,behavior:a});else if(t==="selector"&&o){let d=te(o);if(!d)return{success:!1,error:m("interactionTools.elementNotFoundShort",{selector:o})};d.scrollIntoView({behavior:a,block:r})}else return{success:!1,error:m("interactionTools.invalidScrollTarget")};let c={success:!0,message:m("interactionTools.scrollComplete")};return s&&(c.moved=!1),c}catch(t){return{success:!1,error:t.message}}}function Ta(e){if(!e)return!1;if(e.offsetParent===null&&e.tagName!=="BODY"){let a=window.getComputedStyle(e);if(a.display==="none"||a.visibility==="hidden"||a.position!=="fixed")return!1}let t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden"||parseFloat(t.opacity)<=0)return!1;let o=e.getBoundingClientRect();if(o.width<=0||o.height<=0)return!1;let n=window.innerHeight||document.documentElement.clientHeight,i=window.innerWidth||document.documentElement.clientWidth;return o.top<n&&o.bottom>0&&o.left<i&&o.right>0}function nl(e,t="appeared",o=1e4){let n=Re(o,Ee.waitElement);return new Promise((i,a)=>{let r=Date.now(),s=()=>{let c=te(e);if(t==="appeared"&&c){i({success:!0,message:m("interactionTools.elementAppeared",{selector:e}),element:e});return}if(t==="disappeared"&&!c){i({success:!0,message:m("interactionTools.elementDisappeared",{selector:e})});return}if(t==="visible"&&c&&Ta(c)){i({success:!0,message:m("interactionTools.elementVisible",{selector:e}),element:e});return}if(t==="hidden"&&(!c||!Ta(c))){i({success:!0,message:m("interactionTools.elementHidden",{selector:e})});return}if(Date.now()-r>n){i({success:!1,error:m("interactionTools.waitTimeout",{timeout:n,selector:e,state:t})});return}setTimeout(s,100)};s()})}var Sa={enter:{code:"Enter",keyCode:13},escape:{code:"Escape",keyCode:27},esc:{code:"Escape",keyCode:27},tab:{code:"Tab",keyCode:9},backspace:{code:"Backspace",keyCode:8},delete:{code:"Delete",keyCode:46},arrowup:{code:"ArrowUp",keyCode:38},arrowdown:{code:"ArrowDown",keyCode:40},arrowleft:{code:"ArrowLeft",keyCode:37},arrowright:{code:"ArrowRight",keyCode:39},home:{code:"Home",keyCode:36},end:{code:"End",keyCode:35},pageup:{code:"PageUp",keyCode:33},pagedown:{code:"PageDown",keyCode:34},space:{code:"Space",keyCode:32}};function al(e){let t=e.toLowerCase();if(Sa[t])return Sa[t];if(e.length===1&&/[a-zA-Z]/.test(e))return{code:`Key${e.toUpperCase()}`,keyCode:e.toUpperCase().charCodeAt(0)};if(e.length===1&&/[0-9]/.test(e))return{code:`Digit${e}`,keyCode:e.charCodeAt(0)};let o=e.match(/^F([1-9]|1[0-2])$/i);if(o){let n=parseInt(o[1],10);return{code:`F${n}`,keyCode:111+n}}return{code:e,keyCode:e.toUpperCase().charCodeAt(0)}}async function il({key:e,text:t,ctrlKey:o=!1,shiftKey:n=!1,altKey:i=!1}){try{let a=document.activeElement;if(!a)return{success:!1,error:m("interactionTools.noFocusedElement")};let r=Ue();if(t){let c=a.tagName==="INPUT"||a.tagName==="TEXTAREA",d=a.isContentEditable;if(c||d){if(a.focus(),d)try{document.execCommand("selectAll",!1,null),document.execCommand("insertText",!1,t)}catch{a.textContent+=t}else to(a,a.value+t);try{a.dispatchEvent(new InputEvent("input",{bubbles:!0,cancelable:!0,inputType:"insertText",data:t}))}catch{a.dispatchEvent(new Event("input",{bubbles:!0}))}a.dispatchEvent(new Event("change",{bubbles:!0}))}}if(e){let c=al(e),d={key:e,code:c.code,keyCode:c.keyCode,which:c.keyCode,bubbles:!0,cancelable:!0,ctrlKey:o,shiftKey:n,altKey:i};document.activeElement.dispatchEvent(new KeyboardEvent("keydown",d)),document.activeElement.dispatchEvent(new KeyboardEvent("keypress",d)),document.activeElement.dispatchEvent(new KeyboardEvent("keyup",d))}let s=await ze(r,300,2e3);return{success:!0,message:m("interactionTools.keyboardInputSuccess",{hint:s.changed?m(s.urlChanged?"interactionTools.navChangeHint":"interactionTools.domChangeHint",{ms:s.waitedMs}):""}),...s}}catch(a){return{success:!1,error:a.message}}}function rl(e,t,o,n="application/octet-stream"){try{let i=te(e);if(!i)return{success:!1,error:m("interactionTools.fileUploadNotFound",{selector:e})};if(i.type!=="file")return{success:!1,error:m("interactionTools.notFileUploadControl")};let a;try{let c=atob(o),d=new Uint8Array(c.length);for(let u=0;u<c.length;u++)d[u]=c.charCodeAt(u);a=new Blob([d],{type:n})}catch{a=new Blob([o],{type:n})}let r=new File([a],t,{type:n}),s=new DataTransfer;return s.items.add(r),i.files=s.files,i.dispatchEvent(new Event("change",{bubbles:!0})),{success:!0,message:m("interactionTools.fileUploaded",{fileName:t})}}catch(i){return{success:!1,error:i.message}}}async function ll(e,t={}){let{tag:o,action:n="click",waitTime:i=300,timeout:a=2e3}=t,r=Re(i,Ee.actionMinWait),s=Re(a,Ee.actionWait);if(!e)return{success:!1,error:m("interactionTools.textRequired")};let c=o?[o]:["button",'[role="button"]','input[type="submit"]','input[type="button"]',"a[href]",'[role="menuitem"]','[role="menuitemradio"]','[role="menuitemcheckbox"]','[role="option"]','[role="tab"]',"[onclick]","summary","li"],d=e.toLowerCase();for(let x of c){let w=[];try{w=Xe(x)}catch{continue}for(let k of w){let S=(k.textContent||k.value||"").trim();if(!S)continue;let D=S.toLowerCase();if(S===e||D===d||D.includes(d)){let R=window.getComputedStyle(k);if(R.display==="none"||R.visibility==="hidden"||parseFloat(R.opacity)<=0)continue;let H=Pt(k),B=Ue();if(n==="hover"){k.dispatchEvent(new MouseEvent("mouseover",{bubbles:!0,cancelable:!0,view:window})),k.dispatchEvent(new MouseEvent("mouseenter",{bubbles:!0,cancelable:!0,view:window}));let oe=await ze(B,r,s),ue=oe.changed?m(oe.urlChanged?"interactionTools.navChangeHint":"interactionTools.domChangeHint",{ms:oe.waitedMs}):"";return{success:!0,message:m("interactionTools.hoveredByText",{text:e,tag:k.tagName.toLowerCase(),hint:ue}),selector:H,matchedText:S.substring(0,100),...oe}}k.click();let Q=await ze(B,r,s),L=Q.changed?m(Q.urlChanged?"interactionTools.navChangeHint":"interactionTools.domChangeHint",{ms:Q.waitedMs}):"";return{success:!0,message:m("interactionTools.clickedByText",{text:e,tag:k.tagName.toLowerCase(),hint:L}),selector:H,matchedText:S.substring(0,100),...Q}}}}let u=!1,p=!1,h=!1;try{let x=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null);for(;x.nextNode();)if((x.currentNode.textContent||"").toLowerCase().includes(d)){u=!0;let w=x.currentNode.parentElement;if(w){let k=window.getComputedStyle(w);(k.display==="none"||k.visibility==="hidden"||parseFloat(k.opacity)<=0)&&(p=!0),w.closest('button, [role="button"], [role="option"], [role="tab"], li, a[href], [onclick], summary, [tabindex]')||(h=!0)}break}}catch{}let b;return b=m(u?p?"interactionTools.textFoundButHidden":h?"interactionTools.textNotClickable":"interactionTools.textFoundButNotMatched":"interactionTools.textNotFound",{text:e}),{success:!1,error:b+(o?m("interactionTools.tagConstraint",{tag:o}):"")}}function sl(e,t,o=null,n=5e3){let i=Re(n,Ee.selectOption);return new Promise(async a=>{try{let r=te(e);if(!r){a({success:!1,error:m("interactionTools.triggerNotFound",{selector:e})});return}if(r.tagName==="SELECT"){let u=r.options;for(let p=0;p<u.length;p++){let h=u[p],b=(h.textContent||h.label||"").trim();if(b===t||b.includes(t)){r.value=h.value,r.dispatchEvent(new Event("change",{bubbles:!0})),r.dispatchEvent(new Event("input",{bubbles:!0})),a({success:!0,message:m("interactionTools.selectedOption",{label:b}),triggerTag:"SELECT"});return}}a({success:!1,error:m("interactionTools.selectOptionNotFound",{option:t}),availableOptions:Array.from(u).map(p=>p.textContent?.trim()).filter(Boolean)});return}r.click(),await new Promise(u=>setTimeout(u,300));let s=Date.now(),c=o?te(o):document;if(!c){a({success:!1,error:m("interactionTools.optionContainerNotFound",{selector:o})});return}let d=null;for(;Date.now()-s<i;){let u=Xe('li, [role="option"], [role="menuitem"], .option, .dropdown-item, .select-item, [data-value], div',c);for(let p of u){let h=(p.textContent||"").trim();if(!(h.length<2)&&(h===t||h.includes(t)||h.replace(/\s+/g,"")===t.replace(/\s+/g,""))){d=p;break}}if(d)break;await new Promise(p=>setTimeout(p,100))}if(!d){a({success:!1,error:m("interactionTools.optionMatchTimeout",{timeout:i,option:t})});return}d.click(),a({success:!0,message:m("interactionTools.selectedOption",{label:d.textContent?.trim()}),triggerTag:r.tagName})}catch(r){a({success:!1,error:r.message})}})}function cl({action:e,storage:t,key:o,value:n}){try{let i=t==="session"?sessionStorage:localStorage;switch(e){case"get":if(!o){let r={};for(let s=0;s<i.length;s++){let c=i.key(s);r[c]=i.getItem(c)}return{success:!0,content:JSON.stringify(r),data:r}}let a=i.getItem(o);return{success:!0,content:JSON.stringify({key:o,value:a}),value:a};case"set":return!o||n===void 0?{success:!1,error:m("interactionTools.setRequiresKeyValue")}:(i.setItem(o,n),{success:!0,message:m("interactionTools.keySet",{key:o})});case"remove":return o?(i.removeItem(o),{success:!0,message:m("interactionTools.keyRemoved",{key:o})}):{success:!1,error:m("interactionTools.removeRequiresKey")};case"clear":return i.clear(),{success:!0,message:m("interactionTools.storageCleared")};default:return{success:!1,error:m("interactionTools.unknownAction",{action:e})}}}catch(i){return{success:!1,error:i.message}}}G("zh",{advancedTools:{close:"\u5173\u95ED",qrcodeLibNotLoaded:"QRCode \u5E93\u672A\u52A0\u8F7D\uFF0C\u5DF2\u4F7F\u7528 SVG \u964D\u7EA7\u65B9\u6848\u751F\u6210",qrcodeLibAndFallbackUnavailable:"\u4E8C\u7EF4\u7801\u5E93\u672A\u52A0\u8F7D\u4E14\u964D\u7EA7\u65B9\u6848\u4E0D\u53EF\u7528",targetElementNotFound:"\u672A\u627E\u5230\u76EE\u6807\u5143\u7D20",screenshotFailed:"\u622A\u56FE\u5931\u8D25",cssParamRequired:"css \u53C2\u6570\u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32",unsupportedInjectMode:"\u4E0D\u652F\u6301\u7684 injectMode: {mode}\uFF0C\u652F\u6301 'style' \u6216 'inline'"}}),G("en",{advancedTools:{close:"Close",qrcodeLibNotLoaded:"QRCode library not loaded, used SVG fallback",qrcodeLibAndFallbackUnavailable:"QRCode library not loaded and fallback unavailable",targetElementNotFound:"Target element not found",screenshotFailed:"Screenshot failed",cssParamRequired:"css parameter must be a non-empty string",unsupportedInjectMode:"Unsupported injectMode: {mode}; supported: 'style' or 'inline'"}});function dl(e,t){try{let o=document.createElement("canvas");o.width=t,o.height=t;let n=o.getContext("2d");n.fillStyle="#FFFFFF",n.fillRect(0,0,t,t);let i=[];for(let p=0;p<e.length;p++)i.push(e.charCodeAt(p));let a=Math.max(2,Math.floor(t/41)),r=Math.floor(t/a),s=Math.floor((t-r*a)/2);n.fillStyle="#000000";let c=(p,h)=>{let b=7*a;n.fillRect(p,h,b,b),n.fillStyle="#FFFFFF",n.fillRect(p+a,h+a,b-2*a,b-2*a),n.fillStyle="#000000",n.fillRect(p+2*a,h+2*a,b-4*a,b-4*a),n.fillStyle="#000000"};c(s,s),c(s+(r-7)*a,s),c(s,s+(r-7)*a);let d=0;for(let p=0;p<e.length;p++)d=(d<<5)-d+e.charCodeAt(p),d|=0;let u=p=>{let h=p+1831565813;return h=Math.imul(h^h>>>15,h|1),h^=h+Math.imul(h^h>>>7,h|61),((h^h>>>14)>>>0)/4294967296};for(let p=0;p<r;p++)for(let h=0;h<r;h++){let b=p<8&&h<8,x=p<8&&h>=r-8,w=p>=r-8&&h<8;b||x||w||u(d+p*r+h)>.5&&n.fillRect(s+h*a,s+p*a,a,a)}return o.toDataURL("image/png")}catch{return null}}function ul(e="",t=200,o="M",n=!0){return new Promise(i=>{try{let a=e||window.location.href,r=document.createElement("div");r.id="ai-helper-qrcode",r.style.cssText=`
|
|
91
93
|
position: fixed;
|
|
92
94
|
top: 50%;
|
|
93
95
|
left: 50%;
|
|
@@ -98,7 +100,7 @@ ${i.slice(1).map(r=>`| ${r.join(" | ")} |`).join(`
|
|
|
98
100
|
border-radius: 12px;
|
|
99
101
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
|
|
100
102
|
text-align: center;
|
|
101
|
-
`;let
|
|
103
|
+
`;let s=document.createElement("canvas");s.width=t,s.height=t,r.appendChild(s);let c=document.createElement("p");c.textContent=a.length>50?a.substring(0,50)+"...":a,c.style.cssText="margin-top: 12px; font-size: 12px; color: #666; word-break: break-all; max-width: 200px;",r.appendChild(c);let d=document.createElement("button");if(d.textContent=m("advancedTools.close"),d.style.cssText=`
|
|
102
104
|
margin-top: 12px;
|
|
103
105
|
padding: 6px 20px;
|
|
104
106
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
@@ -106,7 +108,7 @@ ${i.slice(1).map(r=>`| ${r.join(" | ")} |`).join(`
|
|
|
106
108
|
border: none;
|
|
107
109
|
border-radius: 20px;
|
|
108
110
|
cursor: pointer;
|
|
109
|
-
`,
|
|
111
|
+
`,d.onclick=()=>{document.body.removeChild(r)},r.appendChild(d),typeof QRCode>"u"){let u=dl(a,t);if(u){let p=document.createElement("img");p.src=u,p.width=t,p.height=t,s.replaceWith(p),n&&document.body.appendChild(r),i({success:!0,content:a,size:t,dataUrl:u,shown:n,fallback:!0,warning:m("advancedTools.qrcodeLibNotLoaded")})}else i({success:!1,error:m("advancedTools.qrcodeLibAndFallbackUnavailable")});return}QRCode.toCanvas(s,a,{width:t,margin:2,color:{dark:"#000000",light:"#ffffff"},errorCorrectionLevel:o.toLowerCase()},u=>{u?i({success:!1,error:u.message}):(n&&document.body.appendChild(r),i({success:!0,content:a,size:t,dataUrl:s.toDataURL("image/png"),shown:n}))})}catch(a){i({success:!1,error:a.message})}})}function pl(e){return typeof e=="string"?e.replace(/@import\b[^;{}]*;?/gi,"").replace(/url\s*\([^;{}]*\)/gi,"").replace(/expression\s*\([^;{}]*\)/gi,"").replace(/-moz-element\s*\([^;{}]*\)/gi,"").replace(/element\s*\([^;{}]*\)/gi,"").replace(/-moz-binding\b[^;}]*;?/gi,"").replace(/\bbehavior\b[^;}]*;?/gi,""):""}function ml(e,t=null,o="style"){try{if(!e||typeof e!="string")return{success:!1,error:m("advancedTools.cssParamRequired")};if(e=pl(e),o!=="style"&&o!=="inline")return{success:!1,error:m("advancedTools.unsupportedInjectMode",{mode:o})};if(o==="style")if(t){let n=document.querySelectorAll(t),i=`ai-helper-scoped-style-${Date.now()}`,a="",r=e.split("}");for(let c of r){let d=c.trim();if(!d)continue;let u=d.indexOf("{");if(u===-1)continue;let p=d.substring(0,u).trim(),h=d.substring(u+1).trim();a+=`#${i} ${p} { ${h} } `}n.forEach(c=>{c.setAttribute("id",i)});let s=document.createElement("style");return s.setAttribute("data-ai-helper","scoped"),s.textContent=a,document.head.appendChild(s),{success:!0,injectMode:"style",scoped:!0,selector:t,hitCount:n.length}}else{let n=document.createElement("style");return n.setAttribute("data-ai-helper","global"),n.textContent=e,document.head.appendChild(n),{success:!0,injectMode:"style",scoped:!1,hitCount:0}}if(o==="inline"){let n=t?document.querySelectorAll(t):document.querySelectorAll("*"),i=0,a={};return e.split(";").forEach(r=>{let s=r.indexOf(":");if(s===-1)return;let c=r.substring(0,s).trim(),d=r.substring(s+1).trim();c&&d&&(a[c]=d)}),n.forEach(r=>{if(r.nodeType===1){for(let[s,c]of Object.entries(a))try{r.style.setProperty(s,c)}catch{}i++}}),{success:!0,injectMode:"inline",selector:t||"*",hitCount:i}}}catch(n){return{success:!1,error:n.message}}}function jo(e,t){try{return e.querySelector(t),!0}catch{return!1}}function hl(e,t,o){let n=e.target==null?"":String(e.target);switch(e.check){case"element_exists":return n?jo(t,n)?{available:!0,pass:!!te(n,t)}:{available:!1,reason:"invalid_selector"}:{available:!1,reason:"empty_target"};case"element_absent":return n?jo(t,n)?{available:!0,pass:!te(n,t)}:{available:!1,reason:"invalid_selector"}:{available:!1,reason:"empty_target"};case"text_contains":{let i=e.expected==null?e.target==null?"":String(e.target):String(e.expected);return i?{available:!0,pass:(ct(t)||t.body&&t.body.textContent||"").includes(i)}:{available:!1,reason:"missing_expected"}}case"url_matches":{let i=n||(e.expected==null?"":String(e.expected)),a=o&&o.href?String(o.href):"";return i?a?{available:!0,pass:a.includes(i)}:{available:!1,reason:"no_href"}:{available:!1,reason:"empty_target"}}case"attribute_equals":{let i=e.expected==null?"":String(e.expected),a=i.indexOf("=");if(!n)return{available:!1,reason:"empty_target"};if(a<=0)return{available:!1,reason:"missing_expected"};if(!jo(t,n))return{available:!1,reason:"invalid_selector"};let r=te(n,t);return{available:!0,pass:!!r&&r.getAttribute(i.slice(0,a))===i.slice(a+1)}}default:return{available:!1,reason:"unknown_check"}}}function gl(e,t,o){let n=Array.isArray(e)?e:[],i=t||(typeof document<"u"?document:null),a=o||(typeof window<"u"?window.location:null);return i?n.map(r=>{let s;try{s=hl(r,i,a)}catch{s={available:!1,reason:"eval_error"}}return{id:r.id,check:r.check,pass:s.available?!!s.pass:!1,available:!!s.available,...s.available||!s.reason?{}:{reason:s.reason}}}):n.map(r=>({id:r.id,check:r.check,pass:!1,available:!1,reason:"no_dom"}))}var fl="#aih-selection-toolbar, .aih-overflow-dropdown, #aih-selection-result, .aih-token-popup",bl={light:{"bg-elevated":"#ffffff","tb-panel":"rgba(255,255,255,0.96)","tb-fill":"#f5f6f7","tb-hover":"#f0f0f0","tb-active":"#e4e4e4","tb-border":"#e8e8e8","tb-table-border":"#e0e0e0","tb-divider":"#f0f0f0","tb-text":"#2b3038","tb-text-2":"#5a6675","tb-text-3":"#98a1ad","tb-text-muted":"#bbbbbb","tb-accent":"#3b82f6","tb-accent-hover":"#2563eb","tb-accent-soft":"#eff6ff","tb-on-accent":"#ffffff","tb-brand":"#667eea","tb-warning":"#f59e0b","tb-warning-ink":"#b45309","tb-danger":"#e53e3e"},dark:{"bg-elevated":"#262a33","tb-panel":"rgba(28,31,38,0.94)","tb-fill":"#2a2f3a","tb-hover":"#343b48","tb-active":"#414a5a","tb-border":"#363d4a","tb-table-border":"#3f4756","tb-divider":"#2f3542","tb-text":"#e7eaf0","tb-text-2":"#b7becb","tb-text-3":"#79808e","tb-text-muted":"#565d6b","tb-accent":"#6aa1fb","tb-accent-hover":"#4a8bf0","tb-accent-soft":"#1f2c46","tb-on-accent":"#ffffff","tb-brand":"#8da2f2","tb-warning":"#fbbf24","tb-warning-ink":"#d9a441","tb-danger":"#fc8181"}};function yl(e){let t=bl[e==="dark"?"dark":"light"];return`${fl}{${Object.keys(t).map(o=>`--${o}:${t[o]};`).join("")}}`}var wl=`
|
|
110
112
|
|
|
111
113
|
/* \u56FE\u6807\u5448\u73B0\u81EA\u6301\uFF1A\u5DE5\u5177\u680F/\u7ED3\u679C\u9762\u677F\u6240\u6709 svg \u56FE\u6807\u90FD\u5E26 .aih-ic\uFF08\u5B9E\u5FC3\u56FE\u6807\u518D\u5E26 .aih-ic-solid\uFF09\u3002
|
|
112
114
|
\u6D6E\u5C42\u6302\u5728\u5BBF\u4E3B\u9875\u9762 DOM \u4E0A\uFF0C\u5BBF\u4E3B\u82E5\u5B9A\u4E49 svg { fill: ... } \u4E4B\u7C7B\u7684\u89C4\u5219\uFF0CCSS \u58F0\u660E\u4F18\u5148\u7EA7\u9AD8\u4E8E
|
|
@@ -610,6 +612,11 @@ ${i.slice(1).map(r=>`| ${r.join(" | ")} |`).join(`
|
|
|
610
612
|
margin: 0;
|
|
611
613
|
inset: auto;
|
|
612
614
|
overflow: visible;
|
|
615
|
+
/* openFloat \u4F20\u5165 flex \u505A top-layer \u663E\u793A\uFF0C\u9700\u663E\u5F0F\u7EB5\u5411\u5806\u53E0 header/body\uFF0C
|
|
616
|
+
\u5426\u5219 flex \u9ED8\u8BA4\u6A2A\u5411\u6392\u5217\u4F1A\u8BA9\u6807\u9898\u4E0E\u660E\u7EC6\u5DE6\u53F3\u5E76\u6392 */
|
|
617
|
+
flex-direction: column;
|
|
618
|
+
/* popover UA \u9ED8\u8BA4 border: solid \u4F1A\u9732\u51FA\u9ED1\u6846\uFF0C\u4FA7\u8FB9\u680F\u7248\u672C\u65E0\u8FB9\u6846\uFF0C\u6B64\u5904\u5BF9\u9F50 */
|
|
619
|
+
border: none;
|
|
613
620
|
background: var(--bg-elevated);
|
|
614
621
|
border-radius: 12px;
|
|
615
622
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
@@ -792,8 +799,8 @@ ${i.slice(1).map(r=>`| ${r.join(" | ")} |`).join(`
|
|
|
792
799
|
color: var(--tb-accent-hover);
|
|
793
800
|
}
|
|
794
801
|
|
|
795
|
-
`;function
|
|
796
|
-
|
|
802
|
+
`;function on(e){return yl(e)+`
|
|
803
|
+
`+wl}function ja(){if(document.getElementById("aih-selection-toolbar-styles"))return;let e=document.createElement("style");e.id="aih-selection-toolbar-styles",e.textContent=on("light"),document.head.appendChild(e)}function vl(e){let t=document.getElementById("aih-selection-toolbar-styles"),o=e==="dark"?"dark":"light";if(t){if(t.dataset.themeApplied===o)return;t.dataset.themeApplied=o,t.textContent=on(o);return}ja();let n=document.getElementById("aih-selection-toolbar-styles");n&&(n.dataset.themeApplied=o,n.textContent=on(o))}G("zh",{optionsConst:{aiSearch:"AI\u641C\u7D22",explain:"\u89E3\u91CA",translate:"\u7FFB\u8BD1",summary:"\u603B\u7ED3",copy:"\u590D\u5236"}}),G("en",{optionsConst:{aiSearch:"AI Search",explain:"Explain",translate:"Translate",summary:"Summarize",copy:"Copy"}});var xl={"ai-search":"optionsConst.aiSearch",explain:"optionsConst.explain",translate:"optionsConst.translate",summary:"optionsConst.summary",copy:"optionsConst.copy"};function Ft(e){let t=xl[e];return t?m(t):void 0}G("zh",{selToolbar:{settings:"\u8BBE\u7F6E",settingsTitle:"\u6253\u5F00\u914D\u7F6E\u9875\u9762",disableTemporarily:"\u672C\u6B21\u4E34\u65F6\u7981\u7528",disableTemporarilyTitle:"\u6682\u65F6\u9690\u85CF\u76F4\u5230\u9875\u9762\u5237\u65B0",disableOnSite:"\u5728\u6B64\u7F51\u7AD9\u7981\u7528",disableOnSiteTitle:"\u5728\u6B64\u7F51\u7AD9\u7981\u7528\u5DE5\u5177\u680F",dragToMove:"\u62D6\u62FD\u79FB\u52A8",moreTools:"\u66F4\u591A\u5DE5\u5177",contextAware:"\u7ED3\u5408\u7F51\u9875\u4E0A\u4E0B\u6587",contextAwareTitle:"\u56DE\u7B54\u65F6\u53C2\u8003\u9009\u4E2D\u5185\u5BB9\u6240\u5728\u6BB5\u843D\u53CA\u9875\u9762\u4FE1\u606F",copySelectedTitle:"\u590D\u5236\u9009\u4E2D\u5185\u5BB9",askPlaceholder:"\u95EE\u95EE...",sendTitle:"\u53D1\u9001",aiAnswer:"AI \u56DE\u7B54",lockWindow:"\u9501\u5B9A\u7A97\u53E3",unlockWindow:"\u89E3\u9664\u9501\u5B9A",close:"\u5173\u95ED",copyAll:"\u590D\u5236",copyRichTitle:"\u590D\u5236 Markdown \u6587\u672C\uFF08Ctrl/\u2318 + \u5355\u51FB\u590D\u5236\u5BCC\u6587\u672C\uFF09",regenerate:"\u91CD\u65B0\u751F\u6210",suggestedFollowups:"\u{1F4A1} \u63A8\u8350\u8FFD\u95EE",followupPlaceholder:"\u7EE7\u7EED\u63D0\u95EE...",sendToSidebar:"\u53D1\u9001\u5230\u4FA7\u8FB9\u680F",aiThinking:"AI \u6B63\u5728\u601D\u8003...",requestFailed:"\u8BF7\u6C42\u5931\u8D25: {msg}",copyFailed:"\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u624B\u52A8\u590D\u5236",copied:"\u5DF2\u590D\u5236",copiedMarkdown:"\u5DF2\u590D\u5236 Markdown",copiedRich:"\u5DF2\u590D\u5236\u5BCC\u6587\u672C",tokenUsageTitle:"Token \u6D88\u8017\uFF1A\u8F93\u5165 {input} / \u8F93\u51FA {output}\uFF0C\u70B9\u51FB\u67E5\u770B\u660E\u7EC6",tokenPopupTitle:"Token \u6D88\u8017\u660E\u7EC6",tokenPopupTotal:"\u603B\u8BA1",tokenPopupInput:"\u8F93\u5165",tokenPopupOutput:"\u8F93\u51FA",noResponse:"\u65E0\u54CD\u5E94",sysPromptAisearch:"\u4F60\u6B63\u5728\u5904\u7406\u7528\u6237\u5728\u7F51\u9875\u4E0A\u9009\u4E2D\u7684\u5185\u5BB9\u3002\u4F7F\u7528ReAct Agent\u6A21\u5F0F\uFF0C\u901A\u8FC7\u591A\u8F6E\u601D\u8003\u3001\u641C\u7D22\u548C\u63A8\u7406\u6765\u56DE\u7B54\u9009\u4E2D\u7684\u95EE\u9898\u3002",sysPromptExplain:"\u4F60\u6B63\u5728\u5904\u7406\u7528\u6237\u5728\u7F51\u9875\u4E0A\u9009\u4E2D\u7684\u5185\u5BB9\u3002\u75281-3\u53E5\u7B80\u6D01\u89E3\u91CA\u9009\u4E2D\u5185\u5BB9\uFF0C\u5FC5\u8981\u65F6\u8865\u5145\u4E00\u4E2A\u7B80\u77ED\u793A\u4F8B\u3002\u4E0D\u8981\u5C55\u5F00\u957F\u7BC7\u8BBA\u8FF0\u3002",sysPromptTranslate:"\u4F60\u6B63\u5728\u5904\u7406\u7528\u6237\u5728\u7F51\u9875\u4E0A\u9009\u4E2D\u7684\u5185\u5BB9\u3002\u81EA\u52A8\u68C0\u6D4B\u8BED\u8A00\uFF1A\u4E2D\u6587\u2192\u82F1\u6587\uFF0C\u82F1\u6587\u2192\u4E2D\u6587\uFF0C\u5176\u4ED6\u8BED\u8A00\u2192\u540C\u65F6\u7ED9\u51FA\u4E2D\u82F1\u6587\u3002\u53EA\u8F93\u51FA\u7FFB\u8BD1\u7ED3\u679C\uFF0C\u4E0D\u6DFB\u52A0\u989D\u5916\u8BF4\u660E\u3002",sysPromptSummary:"\u4F60\u6B63\u5728\u5904\u7406\u7528\u6237\u5728\u7F51\u9875\u4E0A\u9009\u4E2D\u7684\u5185\u5BB9\u3002\u75283-5\u4E2A\u8981\u70B9\u603B\u7ED3\u9009\u4E2D\u5185\u5BB9\uFF0C\u6BCF\u6761\u8981\u70B9\u4E00\u53E5\u8BDD\uFF0C\u63D0\u70BC\u6838\u5FC3\u4FE1\u606F\u5373\u53EF\u3002",sysPromptCopy:"\u5C06\u9009\u4E2D\u5185\u5BB9\u590D\u5236\u5230\u526A\u8D34\u677F\u3002",userMsgAisearch:`\u641C\u7D22\u5E76\u5206\u6790\u4EE5\u4E0B\u5185\u5BB9\uFF1A
|
|
797
804
|
|
|
798
805
|
{text}`,userMsgExplain:`\u75281-3\u53E5\u8BDD\u7B80\u6D01\u89E3\u91CA\u4EE5\u4E0B\u5185\u5BB9\uFF0C\u4E0D\u9700\u8981\u5C55\u5F00\u8BF4\u660E\u3002
|
|
799
806
|
|
|
@@ -815,7 +822,7 @@ ${i.slice(1).map(r=>`| ${r.join(" | ")} |`).join(`
|
|
|
815
822
|
---SUGGESTIONS---
|
|
816
823
|
\u95EE\u98981
|
|
817
824
|
\u95EE\u98982
|
|
818
|
-
\u95EE\u98983`}}),
|
|
825
|
+
\u95EE\u98983`}}),G("en",{selToolbar:{settings:"Settings",settingsTitle:"Open settings page",disableTemporarily:"Disable temporarily",disableTemporarilyTitle:"Temporarily hide until page refresh",disableOnSite:"Disable on this site",disableOnSiteTitle:"Disable toolbar on this website",dragToMove:"Drag to move",moreTools:"More tools",contextAware:"Include page context",contextAwareTitle:"Use the surrounding paragraph and page info when answering",copySelectedTitle:"Copy selected content",askPlaceholder:"Ask...",sendTitle:"Send",aiAnswer:"AI Answer",lockWindow:"Lock panel",unlockWindow:"Unlock panel",close:"Close",copyAll:"Copy",copyRichTitle:"Copy Markdown text (Ctrl/\u2318+Click to copy rich text)",regenerate:"Regenerate",suggestedFollowups:"\u{1F4A1} Suggested follow-ups",followupPlaceholder:"Ask a follow-up...",sendToSidebar:"Send to sidebar",aiThinking:"AI is thinking...",requestFailed:"Request failed: {msg}",copyFailed:"Copy failed, please copy manually",copied:"Copied",copiedMarkdown:"Markdown copied",copiedRich:"Rich text copied",tokenUsageTitle:"Token usage: {input} input / {output} output, click for details",tokenPopupTitle:"Token Usage Details",tokenPopupTotal:"Total",tokenPopupInput:"Input",tokenPopupOutput:"Output",noResponse:"No response",sysPromptAisearch:"You are processing content selected by the user on a web page. Use ReAct Agent mode to answer selected questions through multiple rounds of thinking, searching, and reasoning.",sysPromptExplain:"You are processing content selected by the user on a web page. Explain the selected content in 1-3 concise sentences, supplementing with a brief example if necessary. Do not expand into lengthy discussions.",sysPromptTranslate:"You are processing content selected by the user on a web page. Auto-detect language: Chinese\u2192English, English\u2192Chinese, other languages\u2192provide both Chinese and English. Output only the translation result, no additional explanations.",sysPromptSummary:"You are processing content selected by the user on a web page. Summarize the selected content in 3-5 bullet points, one sentence per point, distilling the core information.",sysPromptCopy:"Copy the selected content to the clipboard.",userMsgAisearch:`Search and analyze the following content:
|
|
819
826
|
|
|
820
827
|
{text}`,userMsgExplain:`Explain the following content in 1-3 concise sentences without expanding.
|
|
821
828
|
|
|
@@ -837,86 +844,86 @@ After answering, please provide 3 follow-up questions on a new line in the follo
|
|
|
837
844
|
---SUGGESTIONS---
|
|
838
845
|
Question 1
|
|
839
846
|
Question 2
|
|
840
|
-
Question 3`}});var T={search:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>',explain:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18h6"/><path d="M10 22h4"/><path d="M12 2a7 7 0 0 0-7 7c0 2.4 1.2 4.5 3 5.7V17h8v-2.3c1.8-1.2 3-3.3 3-5.7a7 7 0 0 0-7-7Z"/></svg>',translate:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M2 12h20"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>',summary:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"/><path d="M14 2v6h6"/><path d="M8 13h2"/><path d="M8 17h2"/><path d="M14 13h2"/><path d="M14 17h2"/></svg>',copy:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',close:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>',sparkle:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"/></svg>',lock:'<svg class="aih-ic" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>',unlock:'<svg class="aih-ic" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 9.9-1"/></svg>',copyLarge:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',grip:'<svg class="aih-ic aih-ic-solid" width="12" height="12" viewBox="0 0 24 24" fill="currentColor" stroke="none"><circle cx="8" cy="6" r="1.5"/><circle cx="16" cy="6" r="1.5"/><circle cx="8" cy="12" r="1.5"/><circle cx="16" cy="12" r="1.5"/><circle cx="8" cy="18" r="1.5"/><circle cx="16" cy="18" r="1.5"/></svg>',send:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>',more:'<svg class="aih-ic aih-ic-solid" width="15" height="15" viewBox="0 0 24 24" fill="currentColor" stroke="none"><circle cx="12" cy="5" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="12" cy="19" r="2"/></svg>',gear:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>',refresh:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>',block:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"/></svg>',eyeOff:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19M14.12 14.12a3 3 0 1 1-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg>',check:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>'},b=null,g=null,B=!1,N=!1,_e="",Ce=null,Ee="",F=!1,V=!1,z="",Ie="",Ue="",Tt="",x="",ue=!0,ve=[],wo=!1,Re=!1,vo=0,re=!1;function Yt(){re=!1}var Vn=!1;function jn(){Vn||=(document.addEventListener("mouseup",Yt,!0),window.addEventListener("blur",Yt),!0)}var de={x:0,y:0},W=null,U=null,Xt=5,It=!1,D=!1,K=null,S="",k=null,ne="",Ke=!1,je=0,xo=null,Qe=!1,St=new Set,Ye=null,Xe=null,Ze=0,P=window.top===window;if(!P)try{window.parent===window.top&&window.top.document.querySelector("frameset")&&(P=!0)}catch{}R.debug("[SelectionToolbar] moduleload isTopFrame:",P,"top===window:",window.top===window,"hasBody:",!!document.body,"parent===top:",window.parent===window.top);var M=null,le=!1;function Qn(){let e=document.getElementById("aih-overlay-host");return e||(e=document.createElement("div"),e.id="aih-overlay-host",e.setAttribute("data-aih",""),e.setAttribute("contenteditable","false"),e.style.display="contents",(document.documentElement||document.body).appendChild(e)),e}function G(e){Qn().appendChild(e)}function tt(e){e.setAttribute("data-aih",""),e.setAttribute("contenteditable","false")}function ke(e,t){if(e){try{e.showPopover()}catch{}e.style.display=t}}function X(e){if(e){try{e.hidePopover()}catch{}e.style.display="none"}}function Pe(e){return!!e&&e.style.display!==""&&e.style.display!=="none"}var Fe=new Map;function Yn(){return Pe(b)||Pe(k)||Pe(g)||Qe}function Xn(){Fe.forEach((e,t)=>{e===null?t.style.removeProperty("display"):t.style.display=e}),Fe.clear()}function ot(e){if(!e||typeof e.getBoundingClientRect!="function"||!document.elementFromPoint)return;let t=e.getBoundingClientRect();if(!(t.width>0)||!(t.height>0))return;let o=[t.left+t.width*.25,t.left+t.width/2,t.left+t.width*.75],n=[t.top+t.height/2,t.bottom-2];for(let a of o)for(let i of n){let r=document.elementFromPoint(a,i);!r||r.closest("[data-aih]")||Fe.has(r)||(Fe.set(r,r.style.display),r.style.display="none")}}function Z(){Fe.size&&!Yn()&&Xn()}var O=null;function ko(e,t){let o=t?e.querySelector(t):e;o&&(o.style.cursor="grab",o.addEventListener("mousedown",n=>{if(n.target.closest('[role="button"]')||n.button!==0)return;n.preventDefault(),n.stopPropagation();let a=e.getBoundingClientRect();O={el:e,startX:n.clientX,startY:n.clientY,startLeft:a.left,startTop:a.top,pointerId:n.pointerId||0},o.style.cursor="grabbing",e.style.transition="none"}))}document.addEventListener("mousemove",e=>{if(!O)return;let t=e.clientX-O.startX,o=e.clientY-O.startY,n=O.startLeft+t,a=O.startTop+o,i=window.innerWidth,r=window.innerHeight,l=O.el.getBoundingClientRect();n=Math.max(0,Math.min(n,i-l.width)),a=Math.max(0,Math.min(a,r-l.height)),O.el.style.left=n+"px",O.el.style.top=a+"px"}),document.addEventListener("mouseup",()=>{if(!O)return;O.el.style.transition="";let e=O.el.querySelector(".aih-result-header")||O.el;e.style.cursor="grab",O=null});function q(){try{return typeof chrome!="object"||!chrome||typeof chrome.runtime!="object"||!chrome.runtime?!1:!!chrome.runtime.id}catch{return!1}}var qe=[{id:"ai-search",name:u("optionsConst.aiSearch"),systemPrompt:u("selToolbar.sysPromptAisearch"),builtin:!0,order:0},{id:"explain",name:u("optionsConst.explain"),systemPrompt:u("selToolbar.sysPromptExplain"),builtin:!0,order:1},{id:"translate",name:u("optionsConst.translate"),systemPrompt:u("selToolbar.sysPromptTranslate"),builtin:!0,order:2},{id:"summary",name:u("optionsConst.summary"),systemPrompt:u("selToolbar.sysPromptSummary"),builtin:!0,order:3},{id:"copy",name:u("optionsConst.copy"),systemPrompt:u("selToolbar.sysPromptCopy"),builtin:!0,order:99}];function Zt(e){return e.map(t=>{let o=Oe(t.id);return o?{...t,name:o}:t})}function To(){return new Promise(e=>{if(!q()){U=Zt([...qe]),e(U);return}if(U){e(U);return}try{chrome.storage.local.get(["toolbarTools","toolbarIconOnly"],t=>{let o=t.toolbarTools&&t.toolbarTools.length>0?t.toolbarTools:qe,n=new Map(qe.map(a=>[a.id,a]));U=o.map(a=>{if(a.builtin&&n.has(a.id)){let i=Oe(a.id);return{...a,systemPrompt:n.get(a.id).systemPrompt,name:i||a.name}}return a}),It=t.toolbarIconOnly||!1,e(U)})}catch{U=Zt([...qe]),e(U)}})}function Jt(){U=null,It=!1,To()}function So(e){return{"ai-search":T.search,explain:T.explain,translate:T.translate,summary:T.summary,copy:T.copy}[e]||T.sparkle}function Zn(){k||(k=document.createElement("div"),k.id="aih-overflow-dropdown",k.className="aih-overflow-dropdown",k.setAttribute("popover","manual"),tt(k),k.style.display="none",G(k),document.addEventListener("click",e=>{k&&Pe(k)&&!k.contains(e.target)&&!e.target.closest(".aih-tb-btn-overflow")&&(X(k),Z())}))}function Jn(e){k||Zn();let t=e.map(o=>{let n=So(o.id),a=o.builtin&&Oe(o.id)||o.name;return`<div class="aih-dropdown-item" role="button" tabindex="0" data-action="${o.id}">
|
|
847
|
+
Question 3`}});var N={search:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>',explain:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18h6"/><path d="M10 22h4"/><path d="M12 2a7 7 0 0 0-7 7c0 2.4 1.2 4.5 3 5.7V17h8v-2.3c1.8-1.2 3-3.3 3-5.7a7 7 0 0 0-7-7Z"/></svg>',translate:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M2 12h20"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>',summary:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"/><path d="M14 2v6h6"/><path d="M8 13h2"/><path d="M8 17h2"/><path d="M14 13h2"/><path d="M14 17h2"/></svg>',copy:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',close:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>',sparkle:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"/></svg>',lock:'<svg class="aih-ic" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>',unlock:'<svg class="aih-ic" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 9.9-1"/></svg>',copyLarge:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',grip:'<svg class="aih-ic aih-ic-solid" width="12" height="12" viewBox="0 0 24 24" fill="currentColor" stroke="none"><circle cx="8" cy="6" r="1.5"/><circle cx="16" cy="6" r="1.5"/><circle cx="8" cy="12" r="1.5"/><circle cx="16" cy="12" r="1.5"/><circle cx="8" cy="18" r="1.5"/><circle cx="16" cy="18" r="1.5"/></svg>',send:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>',more:'<svg class="aih-ic aih-ic-solid" width="15" height="15" viewBox="0 0 24 24" fill="currentColor" stroke="none"><circle cx="12" cy="5" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="12" cy="19" r="2"/></svg>',gear:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>',refresh:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>',block:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"/></svg>',eyeOff:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19M14.12 14.12a3 3 0 1 1-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg>',check:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>'},T=null,v=null,ce=!1,ie=!1,Yt="",Tt=null,At="",re=!1,Se=!1,Te="",Ct="",Qt="",nn="",E="",Qe=!0,ut=[],$a=!1,Et=!1,Va=0,Ke=!1;function Aa(){Ke=!1}var kl=!1;function Tl(){kl||=(document.addEventListener("mouseup",Aa,!0),window.addEventListener("blur",Aa),!0)}var Ye={x:0,y:0},ye=null,he=null,Ca=5,dn=!1,ee=!1,ge=null,F="",M=null,qe="",Xt=!1,no=0,Ya=null,ao=!1,an=new Set,io=null,ro=null,lo=0,Y=window.top===window;if(!Y)try{window.parent===window.top&&window.top.document.querySelector("frameset")&&(Y=!0)}catch{}j.debug("[SelectionToolbar] moduleload isTopFrame:",Y,"top===window:",window.top===window,"hasBody:",!!document.body,"parent===top:",window.parent===window.top);var J=null,Ge=!1;function Sl(){let e=document.getElementById("aih-overlay-host");return e||(e=document.createElement("div"),e.id="aih-overlay-host",e.setAttribute("data-aih",""),e.setAttribute("contenteditable","false"),e.style.display="contents",(document.documentElement||document.body).appendChild(e)),e}function fe(e){Sl().appendChild(e)}function uo(e){e.setAttribute("data-aih",""),e.setAttribute("contenteditable","false")}function mt(e,t){if(e){try{e.showPopover()}catch{}e.style.display=t}}function Ie(e){if(e){try{e.hidePopover()}catch{}e.style.display="none"}}function Rt(e){return!!e&&e.style.display!==""&&e.style.display!=="none"}var Nt=new Map;function Al(){return Rt(T)||Rt(M)||Rt(v)||ao}function Cl(){Nt.forEach((e,t)=>{e===null?t.style.removeProperty("display"):t.style.display=e}),Nt.clear()}function po(e){if(!e||typeof e.getBoundingClientRect!="function"||!document.elementFromPoint)return;let t=e.getBoundingClientRect();if(!(t.width>0)||!(t.height>0))return;let o=[t.left+t.width*.25,t.left+t.width/2,t.left+t.width*.75],n=[t.top+t.height/2,t.bottom-2];for(let i of o)for(let a of n){let r=document.elementFromPoint(i,a);!r||r.closest("[data-aih]")||Nt.has(r)||(Nt.set(r,r.style.display),r.style.display="none")}}function Me(){Nt.size&&!Al()&&Cl()}var se=null;function Qa(e,t){let o=t?e.querySelector(t):e;o&&(o.style.cursor="grab",o.addEventListener("mousedown",n=>{if(n.target.closest('[role="button"]')||n.button!==0)return;n.preventDefault(),n.stopPropagation();let i=e.getBoundingClientRect();se={el:e,startX:n.clientX,startY:n.clientY,startLeft:i.left,startTop:i.top,pointerId:n.pointerId||0},o.style.cursor="grabbing",e.style.transition="none"}))}document.addEventListener("mousemove",e=>{if(!se)return;let t=e.clientX-se.startX,o=e.clientY-se.startY,n=se.startLeft+t,i=se.startTop+o,a=window.innerWidth,r=window.innerHeight,s=se.el.getBoundingClientRect();n=Math.max(0,Math.min(n,a-s.width)),i=Math.max(0,Math.min(i,r-s.height)),se.el.style.left=n+"px",se.el.style.top=i+"px"}),document.addEventListener("mouseup",()=>{if(!se)return;se.el.style.transition="";let e=se.el.querySelector(".aih-result-header")||se.el;e.style.cursor="grab",se=null});function de(){try{return typeof chrome!="object"||!chrome||typeof chrome.runtime!="object"||!chrome.runtime?!1:!!chrome.runtime.id}catch{return!1}}var Vt=[{id:"ai-search",name:m("optionsConst.aiSearch"),systemPrompt:m("selToolbar.sysPromptAisearch"),builtin:!0,order:0},{id:"explain",name:m("optionsConst.explain"),systemPrompt:m("selToolbar.sysPromptExplain"),builtin:!0,order:1},{id:"translate",name:m("optionsConst.translate"),systemPrompt:m("selToolbar.sysPromptTranslate"),builtin:!0,order:2},{id:"summary",name:m("optionsConst.summary"),systemPrompt:m("selToolbar.sysPromptSummary"),builtin:!0,order:3},{id:"copy",name:m("optionsConst.copy"),systemPrompt:m("selToolbar.sysPromptCopy"),builtin:!0,order:99}];function Ea(e){return e.map(t=>{let o=Ft(t.id);return o?{...t,name:o}:t})}function Xa(){return new Promise(e=>{if(!de()){he=Ea([...Vt]),e(he);return}if(he){e(he);return}try{chrome.storage.local.get(["toolbarTools","toolbarIconOnly"],t=>{let o=t.toolbarTools&&t.toolbarTools.length>0?t.toolbarTools:Vt,n=new Map(Vt.map(i=>[i.id,i]));he=o.map(i=>{if(i.builtin&&n.has(i.id)){let a=Ft(i.id);return{...i,systemPrompt:n.get(i.id).systemPrompt,name:a||i.name}}return i}),dn=t.toolbarIconOnly||!1,e(he)})}catch{he=Ea([...Vt]),e(he)}})}function Ra(){he=null,dn=!1,Xa()}function Za(e){return{"ai-search":N.search,explain:N.explain,translate:N.translate,summary:N.summary,copy:N.copy}[e]||N.sparkle}function El(){M||(M=document.createElement("div"),M.id="aih-overflow-dropdown",M.className="aih-overflow-dropdown",M.setAttribute("popover","manual"),uo(M),M.style.display="none",fe(M),document.addEventListener("click",e=>{M&&Rt(M)&&!M.contains(e.target)&&!e.target.closest(".aih-tb-btn-overflow")&&(Ie(M),Me())}))}function Rl(e){M||El();let t=e.map(o=>{let n=Za(o.id),i=o.builtin&&Ft(o.id)||o.name,a=De(String(i??""));return`<div class="aih-dropdown-item" role="button" tabindex="0" data-action="${De(String(o.id??""))}">
|
|
841
848
|
<span class="aih-tb-icon">${n}</span>${a}
|
|
842
|
-
</div>`}).join("");t+='<div class="aih-dropdown-divider"></div>',t+=`<div class="aih-dropdown-item aih-dropdown-settings" role="button" tabindex="0" title="${
|
|
843
|
-
<span class="aih-tb-icon">${
|
|
844
|
-
</div>`,t+=`<div class="aih-dropdown-item aih-dropdown-context" role="button" tabindex="0" title="${
|
|
845
|
-
<span class="aih-tb-icon aih-context-check">${
|
|
846
|
-
</div>`,t+=`<div class="aih-dropdown-item aih-dropdown-hide" role="button" tabindex="0" title="${
|
|
847
|
-
<span class="aih-tb-icon">${
|
|
848
|
-
</div>`,t+=`<div class="aih-dropdown-item aih-dropdown-block" role="button" tabindex="0" title="${
|
|
849
|
-
<span class="aih-tb-icon">${
|
|
850
|
-
</div>`,
|
|
851
|
-
<span class="aih-tb-icon">${
|
|
852
|
-
</div>`),n.forEach(
|
|
853
|
-
<span class="aih-tb-icon">${
|
|
854
|
-
</div>`}),
|
|
855
|
-
<span class="aih-tb-icon">${
|
|
856
|
-
</div>`,
|
|
857
|
-
<span class="aih-tb-icon">${
|
|
858
|
-
</div>`,
|
|
859
|
-
<input type="text" class="aih-tb-ask-input" placeholder="${
|
|
860
|
-
<div class="aih-tb-btn aih-tb-ask-send" role="button" tabindex="0" title="${
|
|
861
|
-
<span class="aih-tb-icon">${
|
|
849
|
+
</div>`}).join("");t+='<div class="aih-dropdown-divider"></div>',t+=`<div class="aih-dropdown-item aih-dropdown-settings" role="button" tabindex="0" title="${m("selToolbar.settingsTitle")}">
|
|
850
|
+
<span class="aih-tb-icon">${N.gear}</span>${m("selToolbar.settings")}
|
|
851
|
+
</div>`,t+=`<div class="aih-dropdown-item aih-dropdown-context" role="button" tabindex="0" title="${m("selToolbar.contextAwareTitle")}" aria-pressed="${ee?"true":"false"}">
|
|
852
|
+
<span class="aih-tb-icon aih-context-check">${ee?N.check:""}</span>${m("selToolbar.contextAware")}
|
|
853
|
+
</div>`,t+=`<div class="aih-dropdown-item aih-dropdown-hide" role="button" tabindex="0" title="${m("selToolbar.disableTemporarilyTitle")}">
|
|
854
|
+
<span class="aih-tb-icon">${N.eyeOff}</span>${m("selToolbar.disableTemporarily")}
|
|
855
|
+
</div>`,t+=`<div class="aih-dropdown-item aih-dropdown-block" role="button" tabindex="0" title="${m("selToolbar.disableOnSiteTitle")}">
|
|
856
|
+
<span class="aih-tb-icon">${N.block}</span>${m("selToolbar.disableOnSite")}
|
|
857
|
+
</div>`,M.innerHTML=t,M._clickHandler=o=>{if(o.target.closest(".aih-dropdown-settings")){o.stopPropagation(),Ie(M),Me();try{chrome.runtime.sendMessage({type:"OPEN_OPTIONS_PAGE",hash:"toolbar"}).catch(()=>{})}catch{}return}if(o.target.closest(".aih-dropdown-block")){o.stopPropagation(),o.preventDefault(),Ie(M),Me(),Ql();return}if(o.target.closest(".aih-dropdown-hide")){o.stopPropagation(),o.preventDefault(),Ie(M),Me(),$a=!0,le(),Ze(),E="",ge=null,F="";return}if(o.target.closest(".aih-dropdown-context")){o.stopPropagation(),o.preventDefault(),Ml();return}let n=o.target.closest("[data-action]");n&&(o.stopPropagation(),Ie(M),Me(),ai(n.dataset.action,E))},M.addEventListener("click",M._clickHandler),M.addEventListener("keydown",o=>{if(o.key==="Enter"||o.key===" "){let n=o.target.closest('[role="button"]');n&&(o.preventDefault(),n.click())}}),M.addEventListener("mousedown",()=>{Ke=!0})}function un(){if(!M)return;let e=M.querySelector(".aih-dropdown-context");if(!e)return;e.setAttribute("aria-pressed",ee?"true":"false");let t=e.querySelector(".aih-context-check");t&&(t.innerHTML=ee?N.check:"")}function Il(){let e={type:"IFRAME_CONTEXT_REFRESH",enabled:!0};try{for(let t=0;t<window.frames.length;t++)window.frames[t].postMessage(e,"*")}catch{}}function Ml(){ee=!ee,ee?Ge&&Il():F="";try{chrome.storage.local.set({selectionToolbarIncludeContext:ee}).catch(()=>{})}catch{}un()}async function Ja(){if(T)return;await Xa();let e=[...he].sort((h,b)=>h.order-b.order),t=e.find(h=>h.id==="ai-search"),o=e.filter(h=>h.id!=="ai-search"&&h.id!=="copy"),n=o.slice(0,Ca-1),i=o.slice(Ca-1);T=document.createElement("div"),T.id="aih-selection-toolbar",T.setAttribute("popover","manual"),uo(T);let a='<span class="aih-tb-buttons">';a+=`<span class="aih-tb-grip" title="${m("selToolbar.dragToMove")}">${N.grip}</span>`;let r=dn;t&&(a+=`<div class="aih-tb-btn primary" role="button" tabindex="0" data-action="ai-search" title="${m("optionsConst.aiSearch")}">
|
|
858
|
+
<span class="aih-tb-icon">${N.search}</span>${r?"":m("optionsConst.aiSearch")}
|
|
859
|
+
</div>`),n.forEach(h=>{let b=Za(h.id),x=h.builtin&&Ft(h.id)||h.name,w=De(String(x??"")),k=De(String(h.id??""));a+=`<div class="aih-tb-btn" role="button" tabindex="0" data-action="${k}" title="${w}">
|
|
860
|
+
<span class="aih-tb-icon">${b}</span>${r?"":w}
|
|
861
|
+
</div>`}),a+=`<div class="aih-tb-btn aih-tb-btn-overflow" role="button" tabindex="0" title="${m("selToolbar.moreTools")}">
|
|
862
|
+
<span class="aih-tb-icon">${N.more}</span>
|
|
863
|
+
</div>`,Rl(i),a+=`<div class="aih-tb-btn" role="button" tabindex="0" data-action="copy" title="${m("selToolbar.copySelectedTitle")}">
|
|
864
|
+
<span class="aih-tb-icon">${N.copy}</span>${r?"":m("optionsConst.copy")}
|
|
865
|
+
</div>`,a+="</span>",a+=`<span class="aih-tb-ask-wrap">
|
|
866
|
+
<input type="text" class="aih-tb-ask-input" placeholder="${m("selToolbar.askPlaceholder")}" />
|
|
867
|
+
<div class="aih-tb-btn aih-tb-ask-send" role="button" tabindex="0" title="${m("selToolbar.sendTitle")}">
|
|
868
|
+
<span class="aih-tb-icon">${N.send}</span>
|
|
862
869
|
</div>
|
|
863
|
-
</span>`,
|
|
870
|
+
</span>`,T.innerHTML=a,T.addEventListener("click",h=>{if(h.target.closest(".aih-tb-btn-overflow")){h.stopPropagation();let w=h.target.closest(".aih-tb-btn-overflow").getBoundingClientRect();M&&(Rt(M)?(Ie(M),Me()):(mt(M,"block"),M.style.top=w.bottom+4+"px",M.style.left=w.right-160+"px",requestAnimationFrame(()=>po(M))));return}let b=h.target.closest("[data-action]");if(!b)return;h.stopPropagation();let x=b.dataset.action;ai(x,E)}),T.addEventListener("keydown",h=>{if(h.key==="Enter"||h.key===" "){let b=h.target.closest('[role="button"]');b&&!b.classList.contains("aih-tb-ask-send")&&(h.preventDefault(),b.click())}}),T.addEventListener("mousedown",()=>{Ke=!0}),Tl(),fe(T);let s=T.querySelector(".aih-tb-ask-input"),c=T.querySelector(".aih-tb-ask-send");T.querySelector(".aih-tb-buttons");let d=()=>{let h=s.value.trim();if(h){let b=Yt;p(),s.value="",Nl(h,b),le()}},u=()=>{if(ie)return;ie=!0,Yt=E||"";let h=window.getSelection();h.rangeCount>0&&(Tt=h.getRangeAt(0).cloneRange());let b=T.getBoundingClientRect().right;At=T.style.left,T.classList.add("aih-ask-mode"),T.style.width="360px";let x=Math.max(8,b-360);T.style.left=x+"px",requestAnimationFrame(()=>{if(Tt){let w=window.getSelection();w.removeAllRanges(),w.addRange(Tt)}requestAnimationFrame(()=>{s.focus()})})},p=()=>{ie&&(ie=!1,Yt="",Tt=null,T.classList.remove("aih-ask-mode"),T.style.width="",At&&=(T.style.left=At,""))};s.addEventListener("focus",()=>{ie||u()}),s.addEventListener("mousedown",h=>{ie||(h.preventDefault(),u())}),s.addEventListener("blur",()=>{setTimeout(()=>{ie&&!T.contains(document.activeElement)&&(p(),le())},150)}),s.addEventListener("keydown",h=>{h.key==="Escape"?(h.preventDefault(),h.stopPropagation(),p(),s.blur()):h.key==="Enter"&&(h.preventDefault(),h.stopPropagation(),d())}),c.addEventListener("mousedown",h=>{h.preventDefault(),h.stopPropagation(),d()}),Qa(T,".aih-tb-grip")}function ei(){if(v)return;v=document.createElement("div"),v.id="aih-selection-result",v.setAttribute("popover","manual"),uo(v),v.innerHTML=`
|
|
864
871
|
<div class="aih-result-header">
|
|
865
|
-
<span>${
|
|
872
|
+
<span>${N.sparkle} ${m("selToolbar.aiAnswer")}</span>
|
|
866
873
|
<div class="aih-result-header-actions">
|
|
867
|
-
<div class="aih-result-lock" role="button" tabindex="0" title="${
|
|
868
|
-
<div class="aih-result-close" role="button" tabindex="0" title="${
|
|
874
|
+
<div class="aih-result-lock" role="button" tabindex="0" title="${m("selToolbar.lockWindow")}">${N.unlock}</div>
|
|
875
|
+
<div class="aih-result-close" role="button" tabindex="0" title="${m("selToolbar.close")}">${N.close}</div>
|
|
869
876
|
</div>
|
|
870
877
|
</div>
|
|
871
878
|
<div class="aih-result-scroll">
|
|
872
879
|
<div class="aih-result-body"></div>
|
|
873
880
|
<div class="aih-result-footer">
|
|
874
|
-
<div class="aih-result-footer-btn" role="button" tabindex="0" data-action="copy-result" title="${
|
|
875
|
-
<span class="aih-tb-icon">${
|
|
881
|
+
<div class="aih-result-footer-btn" role="button" tabindex="0" data-action="copy-result" title="${m("selToolbar.copyRichTitle")}">
|
|
882
|
+
<span class="aih-tb-icon">${N.copyLarge}</span>${m("selToolbar.copyAll")}
|
|
876
883
|
</div>
|
|
877
|
-
<div class="aih-result-footer-btn" role="button" tabindex="0" data-action="regenerate-result" title="${
|
|
878
|
-
<span class="aih-tb-icon">${
|
|
884
|
+
<div class="aih-result-footer-btn" role="button" tabindex="0" data-action="regenerate-result" title="${m("selToolbar.regenerate")}">
|
|
885
|
+
<span class="aih-tb-icon">${N.refresh}</span>${m("selToolbar.regenerate")}
|
|
879
886
|
</div>
|
|
880
887
|
<div class="aih-result-token" style="display:none;"></div>
|
|
881
888
|
</div>
|
|
882
889
|
<div class="aih-result-suggestions" style="display:none;">
|
|
883
|
-
<div class="aih-suggestions-label">${
|
|
890
|
+
<div class="aih-suggestions-label">${m("selToolbar.suggestedFollowups")}</div>
|
|
884
891
|
<div class="aih-suggestions-list"></div>
|
|
885
892
|
</div>
|
|
886
893
|
</div>
|
|
887
894
|
<div class="aih-result-followup">
|
|
888
895
|
<span class="aih-followup-wrap">
|
|
889
|
-
<input type="text" class="aih-followup-input" placeholder="${
|
|
890
|
-
<div class="aih-followup-send" role="button" tabindex="0" title="${
|
|
896
|
+
<input type="text" class="aih-followup-input" placeholder="${m("selToolbar.followupPlaceholder")}" />
|
|
897
|
+
<div class="aih-followup-send" role="button" tabindex="0" title="${m("selToolbar.sendToSidebar")}">${N.send}</div>
|
|
891
898
|
</span>
|
|
892
899
|
</div>
|
|
893
|
-
`,
|
|
900
|
+
`,v.querySelector(".aih-result-close").addEventListener("click",t=>{t.stopPropagation(),Ze()}),v.querySelector(".aih-result-lock").addEventListener("click",t=>{t.stopPropagation(),Dl()}),v.querySelector(".aih-result-footer").addEventListener("click",t=>{t.stopPropagation();let o=t.target.closest(".aih-result-token");if(o){Hl(o);return}let n=t.target.closest("[data-action]")?.dataset?.action;if(n==="regenerate-result"){if(!Qt||!Ct)return;sn(Qt,Ct,nn,Qt==="ai-search"?null:ln(Ct))}else n==="copy-result"&&(t.ctrlKey||t.metaKey?Vl():$l())});let e=v.querySelector(".aih-followup-input");v.querySelector(".aih-followup-send").addEventListener("click",t=>{t.stopPropagation();let o=e.value.trim();o&&($o(o),e.value="")}),e.addEventListener("keydown",t=>{if(t.key==="Enter"){t.preventDefault();let o=e.value.trim();o&&($o(o),e.value="")}}),v.querySelector(".aih-suggestions-list").addEventListener("click",t=>{let o=t.target.closest(".aih-suggestion-chip");if(!o)return;t.stopPropagation();let n=o.dataset.question;n&&$o(n)}),v.addEventListener("keydown",t=>{if(t.key==="Enter"||t.key===" "){let o=t.target.closest('[role="button"]');o&&(t.preventDefault(),o.click())}}),fe(v),Qa(v,".aih-result-header")}function Ia(e,t,o,n=[]){if(!v)return;let i=re&&v.style.display!=="none",a=v.querySelector(".aih-result-body"),r=v.querySelector(".aih-result-scroll"),s=!r||r.scrollTop+r.clientHeight>=r.scrollHeight-24;a.replaceChildren(jt.sanitize(o,{...pn,RETURN_DOM_FRAGMENT:!0})),s&&r&&(r.scrollTop=r.scrollHeight);let c=v.querySelector(".aih-result-suggestions"),d=v.querySelector(".aih-suggestions-list");if(n.length>0&&c&&d?(d.innerHTML=n.map(h=>`<div class="aih-suggestion-chip" role="button" tabindex="0" data-question="${De(h)}">${De(h)}</div>`).join(""),c.style.display="block"):c&&(c.style.display="none"),i)return;fe(v);let u=window.innerWidth,p=window.innerHeight;mt(v,"flex"),v.style.left="-9999px",v.style.top="-9999px",requestAnimationFrame(()=>{let h=v.getBoundingClientRect(),b=h.width||420,x=Math.min(h.height||200,520),w=e-b/2;w<8&&(w=8),w+b>u-8&&(w=u-b-8);let k=t-x-8;k<8&&(k=t+8),v.style.left=w+"px",v.style.top=k+"px",v.style.maxHeight=Math.min(520,p-k-16)+"px",re=!0,fe(v)})}function Pl(e,t){if(!v)return;Ye={x:e,y:t},Se=!1,mo();let o=v.querySelector(".aih-result-suggestions");o&&(o.style.display="none");let n=v.querySelector(".aih-followup-input");n&&(n.value=""),It(null),st(),fe(v),mt(v,"flex");let i=v.querySelector(".aih-result-body");i.innerHTML=`<div class="aih-result-loading"><div class="aih-spinner"></div>${m("selToolbar.aiThinking")}</div>`,oi(v,e,t),re=!0,le()}function ti(e,t,o){if(!v)return;Se=!1,Te="",It(null),mo(),fe(v),mt(v,"flex");let n=v.querySelector(".aih-result-body");n.innerHTML=`<div class="aih-result-error">${m("selToolbar.requestFailed",{msg:De(o)})}</div>`,oi(v,e,t),re=!0}function oi(e,t,o){let n=window.innerWidth,i=window.innerHeight;e.style.left="-9999px",e.style.top="-9999px",requestAnimationFrame(()=>{let a=e.getBoundingClientRect(),r=a.width||420,s=Math.min(a.height||200,520),c=t-r/2;c<8&&(c=8),c+r>n-8&&(c=n-r-8);let d=o-s-8;d<8&&(d=o+8),e.style.left=c+"px",e.style.top=d+"px",e.style.maxHeight=Math.min(520,i-d-16)+"px",fe(e),po(e)})}function Ze(){v&&(Ie(v),Me(),re=!1,Se=!1,Te="",st(),mo())}function Dl(){Se=!Se,mo()}function mo(){if(!v)return;let e=v.querySelector(".aih-result-lock");e&&(Se?(e.innerHTML=N.lock,e.classList.add("locked"),e.title=m("selToolbar.unlockWindow")):(e.innerHTML=N.unlock,e.classList.remove("locked"),e.title=m("selToolbar.lockWindow")))}function $o(e){if(!e||!de())return;let t=E||Ct||"";try{chrome.runtime.sendMessage({type:"DIRECT_SEND",text:e,selectedText:t}).catch(o=>{j.error("[SelectionToolbar] sendfollow-up tosidebar failed:",o)})}catch{}}function Nl(e,t){if(!(!e||!de()))try{chrome.runtime.sendMessage({type:"DIRECT_SEND",text:e,selectedText:t||""}).catch(o=>{j.error("[SelectionToolbar] send to sidesidebar failed:",o)})}catch{}}function De(e){let t=document.createElement("div");return t.textContent=e,t.innerHTML}var pn={FORBID_TAGS:["script","style","iframe","object","embed","form","link","meta","base"],FORBID_ATTR:["onerror","onload","onclick","onmouseover","onfocus","onblur","onchange","oninput","onkeydown","onkeyup","onkeypress"],ADD_ATTR:["target"]};function rn(e){let t=typeof marked<"u"?marked.parse(e):De(e).replace(/\n/g,"<br>");return jt.sanitize(t,pn)}function Ll(e){let t=typeof marked<"u"?marked.parse(e):De(e).replace(/\n/g,"<br>");return jt.sanitize(t,{...pn,RETURN_DOM_FRAGMENT:!0})}function Fl(){if(Xt)return;Xt=!0;let e=no;requestAnimationFrame(()=>{Xt=!1,e===no&&Ol()})}function Ol(){if(!v||!re||!qe)return;let e=v.querySelector(".aih-result-body");if(!e)return;let t=qe,o=t.indexOf("---SUGGESTIONS---");o!==-1&&(t=t.substring(0,o));let n=v.querySelector(".aih-result-scroll"),i=!n||n.scrollTop+n.clientHeight>=n.scrollHeight-24,a=document.createElement("div");a.className="aih-result-content-stream",a.appendChild(_l(t)),e.replaceChildren(a),i&&n&&(n.scrollTop=n.scrollHeight)}function _l(e){return Ll(typeof marked>"u"?e:(e.match(/```/g)||[]).length%2==1?e+"\n```":e)}function Vo(e){return!e||e<=0?"0":e<1e3?String(e):e<1e4?Math.round(e/100)/10+"K":e<1e6?Math.round(e/1e3)+"K":Math.round(e/1e5)/10+"M"}function It(e){if(!v)return;Ya=e||null;let t=v.querySelector(".aih-result-token");if(!t)return;let o=e&&(e.total_tokens||(e.prompt_tokens||0)+(e.completion_tokens||0));if(!o){t.style.display="none",t.textContent="",t.removeAttribute("title");return}t.innerHTML=`<span class="aih-token-dot">\u2B24</span>${Vo(o)} tokens`,t.title=m("selToolbar.tokenUsageTitle",{input:Vo(e.prompt_tokens||0),output:Vo(e.completion_tokens||0)}),t.style.display="inline-flex"}function Yo(e){return!e&&e!==0?"0":Number(e).toLocaleString("en-US")}function st(){let e=document.querySelector(".aih-token-popup");e&&(Ie(e),e.remove()),ao=!1,Me()}function Hl(e){let t=Ya;if(!t)return;let o=t.total_tokens||(t.prompt_tokens||0)+(t.completion_tokens||0);if(!o)return;if(ao){st();return}st();let n=t.prompt_tokens||0,i=t.completion_tokens||0,a=Math.round(n/o*100),r=Math.round(i/o*100),s=document.createElement("div");s.className="aih-token-popup",s.setAttribute("popover","manual"),uo(s),s.innerHTML=`
|
|
894
901
|
<div class="aih-token-popup-header">
|
|
895
|
-
<span class="aih-token-popup-title">${
|
|
902
|
+
<span class="aih-token-popup-title">${m("selToolbar.tokenPopupTitle")}</span>
|
|
896
903
|
<button class="aih-token-popup-close" type="button" aria-label="close">\xD7</button>
|
|
897
904
|
</div>
|
|
898
905
|
<div class="aih-token-popup-body">
|
|
899
906
|
<div class="aih-token-popup-row aih-token-popup-total">
|
|
900
|
-
<span class="aih-token-popup-label">${
|
|
901
|
-
<span class="aih-token-popup-value">${
|
|
907
|
+
<span class="aih-token-popup-label">${m("selToolbar.tokenPopupTotal")}</span>
|
|
908
|
+
<span class="aih-token-popup-value">${Yo(o)}</span>
|
|
902
909
|
</div>
|
|
903
910
|
<div class="aih-token-popup-divider"></div>
|
|
904
911
|
<div class="aih-token-popup-row">
|
|
905
|
-
<span class="aih-token-popup-label">${
|
|
912
|
+
<span class="aih-token-popup-label">${m("selToolbar.tokenPopupInput")}</span>
|
|
906
913
|
<div class="aih-token-popup-right">
|
|
907
|
-
<span class="aih-token-popup-value">${
|
|
908
|
-
<span class="aih-token-popup-percent">${
|
|
914
|
+
<span class="aih-token-popup-value">${Yo(n)}</span>
|
|
915
|
+
<span class="aih-token-popup-percent">${a}%</span>
|
|
909
916
|
</div>
|
|
910
917
|
</div>
|
|
911
918
|
<div class="aih-token-popup-row">
|
|
912
|
-
<span class="aih-token-popup-label">${
|
|
919
|
+
<span class="aih-token-popup-label">${m("selToolbar.tokenPopupOutput")}</span>
|
|
913
920
|
<div class="aih-token-popup-right">
|
|
914
|
-
<span class="aih-token-popup-value">${
|
|
921
|
+
<span class="aih-token-popup-value">${Yo(i)}</span>
|
|
915
922
|
<span class="aih-token-popup-percent">${r}%</span>
|
|
916
923
|
</div>
|
|
917
924
|
</div>
|
|
918
925
|
</div>
|
|
919
|
-
`,
|
|
926
|
+
`,fe(s),mt(s,"flex"),ao=!0;let c=e.getBoundingClientRect(),d=s.getBoundingClientRect(),u=c.top-d.height-8>0?c.top-d.height-8:c.bottom+8,p=c.left+c.width/2-d.width/2;p=Math.max(8,Math.min(p,window.innerWidth-d.width-8)),u+d.height>window.innerHeight-8&&(u=window.innerHeight-d.height-8),s.style.top=u+"px",s.style.left=p+"px",po(s),s.querySelector(".aih-token-popup-close").addEventListener("click",b=>{b.stopPropagation(),st()});let h=b=>{!s.contains(b.target)&&!e.contains(b.target)&&(st(),document.removeEventListener("click",h,!0))};setTimeout(()=>{document.addEventListener("click",h,!0)},0)}function Lt(e,t){if(!T||!E||re)return;fe(T);let o=window.innerWidth,n=window.innerHeight;mt(T,"flex"),Va=Date.now(),requestAnimationFrame(()=>{let i=T.getBoundingClientRect(),a=i.width||300,r=i.height||40,s=e-a/2;s<8&&(s=8),s+a>o-8&&(s=o-a-8);let c=t-r-10;c<8&&(c=t+10),c<8&&(c=8),c+r>n-8&&(c=n-r-8),T.style.left=s+"px",T.style.top=c+"px",po(T),ce||=(T.classList.add("aih-show"),!0)})}function le(){!T||!ce||(Ke=!1,ie&&(ie=!1,Yt="",Tt=null,T.classList.remove("aih-ask-mode"),T.style.width="",At&&=(T.style.left=At,"")),T.classList.remove("aih-show"),Ie(T),Me(),ce=!1)}function Bl(){if(!T)return{x:0,y:0};let e=T.getBoundingClientRect();return{x:e.left+e.width/2,y:e.top}}function ql(e){let t=e.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top}}function mn(){if(!de()||!Qe)return;if(!Y){let a=Pe();if(j.debug("[SelectionToolbar] iframe onSelectionChange text:",a.text?.substring(0,30),"currentSelectedText:",!!E,"pendingIframeSelection:",!!J),a.text&&a.text.length>=2){let r=dt(a.range);J={text:a.text,x:r.x,y:r.y,range:a.range?a.range.cloneRange():null},j.debug("[SelectionToolbar] iframe pendingIframeSelection set")}else if(E&&!Ke){E="",F="",J=null;try{chrome.runtime.sendMessage({type:"IFRAME_SELECTION_CLEAR"}).catch(()=>{})}catch{}}return}if(ut.length>0&&ut.includes(window.location.hostname)||$a)return;let e=window.getSelection(),t=e?e.toString().trim():"",o=null;if(t&&t.length>=2&&e.rangeCount>0)o=e.getRangeAt(0);else{let a=Pe();a.text&&a.text.length>=2&&(t=a.text,o=a.range)}if(!t||t.length<2){!ie&&!Ke&&le(),Ke||(E="",ge=null,F="",Ge=!1,ye=null);return}let n=5e3,i=t.length>n?t.substring(0,n)+"...":t;if(o){let a=o.commonAncestorContainer,r=a.nodeType===Node.TEXT_NODE?a.parentElement.closest("[contenteditable], input, textarea"):a.closest&&a.closest("[contenteditable], input, textarea");if(r instanceof HTMLElement&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA")){le(),E="",ge=null,F="",Ge=!1,ye=null;return}}E=i,ge=o?o.cloneRange():null,F="",Ge=!1,ye=!0}function Ul(e){if(!(T&&T.contains(e.target))&&!(v&&v.contains(e.target))&&!(e.target.closest&&e.target.closest(".aih-token-popup"))){if(Et){Et=!1;return}re&&!Se&&Ze(),ce&&!ie&&le();try{chrome.runtime.sendMessage({type:"IFRAME_CLICK_DISMISS"}).catch(()=>{})}catch{}}}function zl(e){if(j.debug("[SelectionToolbar] onMouseUp isTopFrame:",Y,"pendingSelection:",ye,"pendingIframeSelection:",!!J,"currentSelectedText:",!!E,"isToolbarVisible:",ce,"toolbarEl:",!!T),(e.detail||1)>=3&&(Et=!0),!Y){if(J){Et=!0,J.text,E=J.text,ge=null,F=ee?so(J.range,J.text):"";try{window.parent.postMessage({type:"IFRAME_SELECTION",text:J.text,x:J.x,y:J.y,context:F||void 0},"*")}catch{}try{chrome.runtime.sendMessage({type:"IFRAME_SELECTION",text:J.text,x:J.x,y:J.y,context:F||void 0}).catch(()=>{})}catch{}J=null}else(e.detail||1)>=3&&setTimeout(()=>{let t=Pe();if(!t.text||t.text.length<2)return;let o=dt(t.range);t.text,E=t.text,ge=null,F=ee?so(t.range,t.text):"";try{window.parent.postMessage({type:"IFRAME_SELECTION",text:t.text,x:o.x,y:o.y,context:F||void 0},"*")}catch{}try{chrome.runtime.sendMessage({type:"IFRAME_SELECTION",text:t.text,x:o.x,y:o.y,context:F||void 0}).catch(()=>{})}catch{}},60);return}ce||re||(ye&&E?(Et=!0,Ma()):(e.detail||1)>=3&&setTimeout(()=>{ie||(mn(),ye&&E&&Ma())},60))}function Ma(){if(!ye||!E||ce)return;let e=window.innerWidth/2,t=window.innerHeight/2,o=window.getSelection();if(o&&o.rangeCount>0){let n=o.getRangeAt(0).getBoundingClientRect();(n.width>0||n.height>0)&&(e=n.left+n.width/2,t=n.top)}if(e===window.innerWidth/2&&t===window.innerHeight/2){let n=Pe();if(n.text&&n.text.length>=2){let i=dt(n.range);e=i.x,t=i.y}}try{chrome.runtime.sendMessage({type:"IFRAME_CLICK_DISMISS"}).catch(()=>{})}catch{}Lt(e,t),ye=null}function Kl(){if(ie)return;if(!Y&&E){let o=Pe();if(o.text){let n=dt(o.range);try{window.parent.postMessage({type:"IFRAME_SELECTION",text:o.text,x:n.x,y:n.y,context:F||void 0},"*")}catch{}try{chrome.runtime.sendMessage({type:"IFRAME_SELECTION",text:o.text,x:n.x,y:n.y,context:F||void 0}).catch(()=>{})}catch{}}return}if(!ce)return;let e=window.getSelection();if(e&&e.rangeCount>0&&E){let o=e.getRangeAt(0).getBoundingClientRect();if(o.width>0||o.height>0){Lt(o.left+o.width/2,o.top);return}}let t=Pe();if(t.text&&t.text.length>=2&&E){let o=dt(t.range);Lt(o.x,o.y);return}le()}function Gl(){ie||ce&&le()}var Zt=3e3;function Jt(e){return String(e||"").replace(/\s+/g," ").trim()}function Wl(e){if(!e)return null;if(e.parentElement)return e.parentElement;try{return e.getRootNode?.()?.host||null}catch{return null}}function ni(e,t){if(!e||!t)return-1;try{let o=document.createRange();return o.selectNodeContents(e),o.setEnd(t.startContainer,t.startOffset),Jt(o.toString()).length}catch{return-1}}function Pa(e,t,o,n=null,i=-1){if(!e)return"";if(e.length<=Zt)return e;let a=-1;if(t&&i>=0){let c=e.indexOf(t,Math.max(0,i-200));c>=0&&c<=i+200&&(a=c)}if(a<0&&t&&(a=e.indexOf(t)),a<0&&n&&(a=ni(n,o)),a<0)return"";let r=Math.max(300,Math.floor((Zt-(t?.length||0))/2)),s=Math.max(0,a-r);return e.slice(s,s+Zt)}function so(e,t){if(!e)return"";let o=Jt(t);if(!o)return"";let n=null;try{let s=e.commonAncestorContainer;n=s?.nodeType===Node.TEXT_NODE?s.parentElement:s?.nodeType===Node.ELEMENT_NODE?s:null}catch{}let i="",a="",r=n;for(let s=0;r&&r!==document.body&&s<5;s++){let c="";try{c=Jt(r.innerText||r.textContent)}catch{}if(c&&c.includes(o))if(c.length<=Zt){if(c.length>=o.length+60)return c;i||=c}else a||=c;r=Wl(r)}if(a){let s=Pa(a,o,e,n);if(s)return s}if(i)return i;try{let s=Jt(ct());return s?Pa(s,o,e,null,ni(document.body,e)):""}catch{return""}}function ln(e){if(!ee)return null;let t=F;return!t&&ge&&(t=so(ge,e)),t?{title:document.title||"",url:window.location.href,text:t}:null}function ai(e,t){if(!t)return;if(Ct=t,e==="copy"){jl(t),le();return}if(Qt=e,nn="",["ai-search","explain","translate","summary"].includes(e)){sn(e,t,void 0,e==="ai-search"?null:ln(t));return}let o=he.find(n=>n.id===e);o&&(nn=o.systemPrompt||"",sn(e,t,o.systemPrompt,ln(t)))}function jl(e){ii(e).then(()=>{ho()}).catch(t=>{j.error("[SelectionToolbar] copy failed:",t),Mt()})}function $l(){let e=Te;e&&ii(e).then(()=>{ho(m("selToolbar.copiedMarkdown"))}).catch(t=>{j.error("[SelectionToolbar] copyresult failed:",t),Mt()})}function Vl(){let e=Te;if(!e)return;let t=Yl(rn(e));if(navigator.clipboard&&typeof ClipboardItem<"u")try{let o=new ClipboardItem({"text/html":new Blob([t],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})});navigator.clipboard.write([o]).then(()=>{ho(m("selToolbar.copiedRich"))}).catch(n=>{j.error("[SelectionToolbar] richcopy failed:",n),Da()});return}catch(o){j.error("[SelectionToolbar] richcopy failed:",o)}Da()}function Yl(e){return`<!DOCTYPE html><html><head>
|
|
920
927
|
<style>
|
|
921
928
|
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 14px; line-height: 1.6; color: #24292f; }
|
|
922
929
|
h1 { font-size: 24px; font-weight: bold; margin: 16px 0 8px; }
|
|
@@ -956,7 +963,7 @@ Question 3`}});var T={search:'<svg class="aih-ic" width="15" height="15" viewBox
|
|
|
956
963
|
a { color: #007bff; text-decoration: underline; }
|
|
957
964
|
img { max-width: 100%; }
|
|
958
965
|
</style>
|
|
959
|
-
</head><body>${e}</body></html>`}function
|
|
966
|
+
</head><body>${e}</body></html>`}function Da(){let e=v&&v.querySelector(".aih-result-body");if(!e){Mt();return}let t=window.getSelection(),o=[];for(let i=0;i<t.rangeCount;i++)o.push(t.getRangeAt(i).cloneRange());let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n);try{document.execCommand("copy")?ho(m("selToolbar.copiedRich")):Mt()}catch(i){j.error("[SelectionToolbar] fallback richcopy failed:",i),Mt()}finally{t.removeAllRanges(),o.forEach(i=>t.addRange(i))}}async function ii(e){if(!navigator.clipboard)return Na(e);try{await navigator.clipboard.writeText(e)}catch(t){if(t.name==="NotAllowedError"||t.name==="SecurityError")return Na(e);throw t}}function Na(e){return new Promise((t,o)=>{let n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.left="-9999px",n.style.opacity="0",fe(n);try{n.select(),n.setSelectionRange(0,e.length),document.execCommand("copy")?t():o(Error("execCommand copy failed"))}catch(i){o(i)}finally{n.remove()}})}function Mt(){let e=document.getElementById("aih-copy-toast");e&&e.remove();let t=document.createElement("div");t.id="aih-copy-toast",t.setAttribute("data-aih",""),t.textContent=m("selToolbar.copyFailed"),t.style.cssText=`
|
|
960
967
|
position: fixed;
|
|
961
968
|
top: 50%;
|
|
962
969
|
left: 50%;
|
|
@@ -970,7 +977,7 @@ Question 3`}});var T={search:'<svg class="aih-ic" width="15" height="15" viewBox
|
|
|
970
977
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
971
978
|
pointer-events: none;
|
|
972
979
|
animation: aih-toast-in 0.2s ease-out, aih-toast-out 0.2s 1.5s ease-in forwards;
|
|
973
|
-
`,
|
|
980
|
+
`,fe(t),t.style.zIndex="2147483647",setTimeout(()=>t.remove(),1800)}function ho(e){let t=document.getElementById("aih-copy-toast");t&&t.remove();let o=document.createElement("div");if(o.id="aih-copy-toast",o.setAttribute("data-aih",""),o.setAttribute("contenteditable","false"),o.textContent=e||m("selToolbar.copied"),o.style.cssText=`
|
|
974
981
|
position: fixed;
|
|
975
982
|
top: 50%;
|
|
976
983
|
left: 50%;
|
|
@@ -987,11 +994,11 @@ Question 3`}});var T={search:'<svg class="aih-ic" width="15" height="15" viewBox
|
|
|
987
994
|
`,!document.getElementById("aih-toast-anim")){let n=document.createElement("style");n.id="aih-toast-anim",n.textContent=`
|
|
988
995
|
@keyframes aih-toast-in { from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
|
|
989
996
|
@keyframes aih-toast-out { from { opacity: 1; } to { opacity: 0; } }
|
|
990
|
-
`,document.head.appendChild(n)}
|
|
997
|
+
`,document.head.appendChild(n)}fe(o),o.style.zIndex="2147483647",setTimeout(()=>o.remove(),1300)}function sn(e,t,o,n=null){if(!de()){j.warn("[SelectionToolbar] extensiontextexpired,pleaserefreshpage");return}let i={"ai-search":m("selToolbar.userMsgAisearch",{text:t}),explain:m("selToolbar.userMsgExplain",{text:t}),translate:m("selToolbar.userMsgTranslate",{text:t}),summary:m("selToolbar.userMsgSummary",{text:t})},a=o?`\u8BF7\u5904\u7406\u4EE5\u4E0B\u5185\u5BB9\uFF1A
|
|
991
998
|
|
|
992
|
-
${t}`:
|
|
993
|
-
`).map(
|
|
994
|
-
`).map(
|
|
999
|
+
${t}`:i[e]||t;if(e==="ai-search"){le(),window.getSelection().removeAllRanges();try{chrome.runtime.sendMessage({type:"SELECTION_TOOLBAR_ACTION",action:e,text:t,prompt:a}).catch(d=>{j.error("[SelectionToolbar] sendmessage failed:",d)})}catch{}return}ei();let r={"ai-search":m("optionsConst.aiSearch"),explain:m("optionsConst.explain"),translate:m("optionsConst.translate"),summary:m("optionsConst.summary")}[e];if(!r&&he){let d=he.find(u=>u.id===e);r=d?d.builtin&&Ft(d.id)||d.name:m("selToolbar.aiAnswer")}let s=v.querySelector(".aih-result-header span");if(s){s.replaceChildren();let d=document.createElement("span");d.className="aih-result-title-icon",d.innerHTML=N.sparkle,s.appendChild(d),s.appendChild(document.createTextNode(` ${r||m("selToolbar.aiAnswer")}`))}let c=re&&v?ql(v):Bl();Pl(c.x,c.y);try{chrome.runtime.sendMessage({type:"SELECTION_TOOLBAR_ACTION",action:e,text:t,prompt:a,systemPrompt:o||"",pageContext:n||void 0}).catch(d=>{j.error("[SelectionToolbar] sendmessage failed:",d),ti(c.x,c.y,d.message)})}catch{}}de()&&chrome.runtime.onMessage.addListener((e,t,o)=>{if(de()){if(e.type==="IFRAME_SELECTION"){if(!Y)return;j.debug("[SelectionToolbar] recei to IFRAME_SELECTION text:",e.text?.substring(0,30),"isToolbarVisible:",ce,"isResultVisible:",re),E=e.text,ge=null,F=typeof e.context=="string"?e.context:"";let n=e.x,i=e.y;if(window.top!==window&&window.frameElement)try{let a=window.frameElement.getBoundingClientRect();n=e.x-a.left,i=e.y-a.top}catch{}if(ce&&T&&E){requestAnimationFrame(()=>{let a=window.innerWidth,r=T.offsetWidth||300,s=T.offsetHeight||40,c=n-r/2;c<8&&(c=8),c+r>a-8&&(c=a-r-8);let d=i-s-8;d<8&&(d=i+8),T.style.left=c+"px",T.style.top=d+"px"});return}ye={x:n,y:i},E&&E.length>=2&&Lt(n,i);return}if(e.type==="IFRAME_SELECTION_CLEAR"){if(!Y||Ke)return;ce&&!ie&&(le(),E="",F="",Ge=!1);return}if(e.type==="IFRAME_CLICK_DISMISS"){ce&&T&&Date.now()-Va>300&&(le(),E="",ge=null,F="",Ge=!1),re&&!Se&&Ze();return}if(Y){if(e.type==="SELECTION_TOOLBAR_STREAM_START"){qe="",Xt=!1,no++;return}if(e.type==="SELECTION_TOOLBAR_STREAM_CHUNK"){qe+=e.delta||"",Fl();return}if(e.type==="SELECTION_TOOLBAR_STREAM_DONE"){no++,e.finalContent&&(qe=e.finalContent);let n=qe||m("selToolbar.noResponse");Te=qe;let i=n,a=[],r=n.indexOf("---SUGGESTIONS---");r!==-1&&(i=n.substring(0,r).trim(),Te=i,a=n.substring(r+17).split(`
|
|
1000
|
+
`).map(c=>c.replace(/^[\d]+[\.\、\s]+/,"").trim()).filter(c=>c.length>0).slice(0,3));let s=rn(i);Ia(Ye.x,Ye.y,s,a),It(e.usage),qe="";return}if(e.type==="SELECTION_TOOLBAR_RESULT")if(e.error)Te="",It(null),ti(Ye.x,Ye.y,e.error);else{let n=e.content||m("selToolbar.noResponse"),i=n;Te=n;let a=[],r=n.indexOf("---SUGGESTIONS---");r!==-1&&(i=n.substring(0,r).trim(),Te=i,a=n.substring(r+17).split(`
|
|
1001
|
+
`).map(c=>c.replace(/^[\d]+[\.\、\s]+/,"").trim()).filter(c=>c.length>0).slice(0,3));let s=rn(i);Ia(Ye.x,Ye.y,s,a),It(e.usage)}}}});function Ql(){if(!de())return;let e=window.location.hostname;try{chrome.storage.local.get(["blockedDomains"],t=>{try{let o=t.blockedDomains||[];o.includes(e)||(o.push(e),chrome.storage.local.set({blockedDomains:o},()=>{ut=o,le(),Ze(),E=""}))}catch{}})}catch{}}function Xl(){if(!de())return;let e=++lo;chrome.storage.local.get(["enableSelectionToolbar","blockedDomains","selectionToolbarIncludeContext"],t=>{e===lo&&(Qe=t.enableSelectionToolbar===void 0?!0:!!t.enableSelectionToolbar,ut=t.blockedDomains||[],ee=!!t.selectionToolbarIncludeContext,un(),j.debug("[SelectionToolbar] toggle state:",Qe?"enabled":"disabled","blocked domains:",ut.length),Qe?ri():li())})}function La(){_a(an),an=Oa(mn)}function ri(){if(!Y||!de()||io)return;La();let e=new MutationObserver(()=>{ro||=setTimeout(()=>{ro=null,Qe&&La()},300)});try{e.observe(document.body||document.documentElement,{childList:!0,subtree:!0})}catch{return}io=e}function li(){ro&&=(clearTimeout(ro),null),io&&=(io.disconnect(),null),_a(an)}var go=!0,pt="light";function Zl(){return go?pt==="system"?typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":pt==="dark"?"dark":"light":"light"}function hn(){vl(Zl())}function Jl(){de()&&chrome.storage.local.get(["appTheme","selectionToolbarFollowTheme"],e=>{pt=["light","dark","system"].includes(e.appTheme)?e.appTheme:"light",go=e.selectionToolbarFollowTheme===void 0?!0:!!e.selectionToolbarFollowTheme,hn()})}de()&&chrome.storage.onChanged.addListener((e,t)=>{de()&&(t==="local"&&e.enableSelectionToolbar&&(lo++,Qe=!!e.enableSelectionToolbar.newValue,Qe?ri():(li(),le(),Ze(),E="")),t==="local"&&e.blockedDomains&&(lo++,ut=e.blockedDomains.newValue||[]),t==="local"&&e.selectionToolbarIncludeContext&&(ee=!!e.selectionToolbarIncludeContext.newValue,ee||(F=""),un()),t==="local"&&e.toolbarTools&&Ra(),t==="local"&&(e.appTheme||e.selectionToolbarFollowTheme)&&(e.appTheme&&(pt=["light","dark","system"].includes(e.appTheme.newValue)?e.appTheme.newValue:pt),e.selectionToolbarFollowTheme&&(go=!!e.selectionToolbarFollowTheme.newValue),hn()))}),Wn(()=>{Ra(),Y&&(T&&=(T.remove(),null),Ja(),v&&(v.remove(),v=null,re=!1,Se=!1,Te=""))});function es(){if(ja(),Y&&(Ja(),ei()),Xl(),Jl(),typeof matchMedia<"u"){let e=matchMedia("(prefers-color-scheme: dark)"),t=()=>{go&&pt==="system"&&hn()};e.addEventListener?e.addEventListener("change",t):e.addListener&&e.addListener(t)}document.addEventListener("selectionchange",mn),document.addEventListener("click",Ul,!0),document.addEventListener("mouseup",zl,!0),window.addEventListener("scroll",Kl,!0),window.addEventListener("resize",Gl),window.addEventListener("message",e=>{if(e.data?.type==="IFRAME_CONTEXT_REFRESH"){if(Y||e.source!==window.parent)return;let t=typeof e.data.enabled=="boolean"?e.data.enabled:ee;ee=t;try{for(let i=0;i<window.frames.length;i++)window.frames[i].postMessage({type:"IFRAME_CONTEXT_REFRESH",enabled:t},"*")}catch{}let o=Pe();if(!o.text||o.text.length<2)return;E=o.text,ge=o.range?o.range.cloneRange():null,F=t?so(o.range,o.text):"";let n=dt(o.range);try{window.parent.postMessage({type:"IFRAME_SELECTION",text:o.text,x:n.x,y:n.y,context:F||void 0},"*")}catch{}try{chrome.runtime.sendMessage({type:"IFRAME_SELECTION",text:o.text,x:n.x,y:n.y,context:F||void 0}).catch(()=>{})}catch{}return}if(e.data?.type==="IFRAME_SELECTION"&&Y){if(re){E="",ge=null,F="",Ge=!1,ye=null;return}E=e.data.text,ge=null,F=typeof e.data.context=="string"?e.data.context:"",Ge=!0;let t=e.data.x,o=e.data.y;if(window.top!==window&&window.frameElement)try{let n=window.frameElement.getBoundingClientRect();t=e.data.x-n.left,o=e.data.y-n.top}catch{}if(ce&&T&&E){requestAnimationFrame(()=>{let n=window.innerWidth,i=T.offsetWidth||300,a=T.offsetHeight||40,r=t-i/2;r<8&&(r=8),r+i>n-8&&(r=n-i-8);let s=o-a-8;s<8&&(s=o+8),T.style.left=r+"px",T.style.top=s+"px"});return}ye={x:t,y:o},E&&E.length>=2&&Lt(t,o);return}e.data?.type==="IFRAME_CLICK_DISMISS"&&Y&&re&&!Se&&Ze()}),j.debug("[SelectionToolbar] initialization complete",Y?"(toplayerframe)":"(subframe)")}G("zh",{contentIndex:{invalidRef:"\u65E0\u6548\u7684\u5143\u7D20\u7F16\u53F7 ref={ref}\uFF0C\u8BF7\u5148\u8C03\u7528 query_elements",regionSelectHint:"\u62D6\u62FD\u9009\u62E9\u622A\u56FE\u533A\u57DF\uFF0C\u6309 Esc \u53D6\u6D88"}}),G("en",{contentIndex:{invalidRef:"Invalid element ref={ref}; please call query_elements first",regionSelectHint:"Drag to select the screenshot area; press Esc to cancel"}});var ts=$n();console.log("[ContentScript] content script loaded URL:",window.location.href,"isTopFrame:",window.top===window,"hasBody:",!!document.body),document.addEventListener("keydown",e=>{if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.key==="A"){e.preventDefault();try{chrome.action.click()}catch{}}if(e.altKey&&!e.shiftKey&&e.code==="KeyS"&&!e.ctrlKey&&!e.metaKey){e.preventDefault();try{chrome.runtime.sendMessage({type:"CAPTURE_TAB_FROM_PAGE"})}catch{}}if(e.altKey&&e.shiftKey&&e.code==="KeyS"&&!e.ctrlKey&&!e.metaKey){e.preventDefault();try{chrome.runtime.sendMessage({type:"CAPTURE_REGION_FROM_PAGE"})}catch{}}if(e.altKey&&!e.shiftKey&&e.code==="KeyV"&&!e.ctrlKey&&!e.metaKey){if(e.isComposing||e.repeat)return;e.preventDefault();try{chrome.runtime.sendMessage({type:"VOICE_TOGGLE_FROM_PAGE"})}catch{}}});var co={...kt};Wo().then(e=>{co=e}).catch(()=>{}),ba(e=>{co=e});var Qo=fa(()=>co);window.addEventListener("keydown",e=>{Qo.onKeyDown(e)==="cancel"&&e.preventDefault()},!0),window.addEventListener("keyup",e=>{if(Qo.onKeyUp(e)==="trigger"){e.preventDefault();try{chrome.runtime.sendMessage({type:"VOICE_TOGGLE_FROM_PAGE"})}catch{}}},!0),window.addEventListener("blur",()=>{Qo.reset()});var Fa=()=>{Wo().then(e=>{co=e}).catch(()=>{})};window.addEventListener("focus",Fa),document.addEventListener("visibilitychange",()=>{document.hidden||Fa()});var os={GET_PAGE_TEXT:e=>jr(e),GET_FULL_HTML:e=>$r(e),QUERY_ELEMENTS:e=>qr(e),SNAPSHOT_COLLECT:e=>window.top!==window&&!_r()?{success:!0,visible:!1}:Ga({filterByText:e.filterByText,elementTypes:e.elementTypes,frames:e.frames==="none"?"none":"auto"}),GET_SELECTED_CONTENT:e=>Vr(e.format),INTERACT_ELEMENT:e=>e.ref==null?e.text?ll(e.text,{tag:e.tag,action:e.action,waitTime:e.waitTime,timeout:e.timeout}):e.action==="hover"?Zr(e.selector):el(e.selector,e.waitTime,e.timeout):Kr(e.ref,e.action,{waitTime:e.waitTime,timeout:e.timeout,value:e.value,clear:e.clear,submit:e.submit}),FILL_FORM:e=>tl(e.fields,e.waitTime),SCROLL_TO:e=>e.target==="text"&&e.text?Wr(e.text,{maxScrolls:e.maxScrolls,pauseMs:e.pauseMs}):ol(e),KEYBOARD_INPUT:e=>il(e),FILE_UPLOAD:e=>rl(e.selector,e.fileName,e.fileContent,e.fileType),EXTRACT_TABLE:e=>Yr(e.selector,e.includeHeaders,e.format),EXTRACT_METADATA:()=>Sr(),EXTRACT_LINKS:e=>Ar(e.filterType,e.includeImages),EXTRACT_FORMS:e=>Cr(e.formSelector),EXTRACT_IMAGES:e=>Er(e),SEARCH_IN_PAGE:e=>Ir(e),IFRAME_CONTENT:e=>Rr(e.selector,e.includeNested,e.maxLength),SCROLL_COLLECT:e=>zr(e),MANAGE_STORAGE:e=>cl(e),INJECT_CSS:e=>e.injectMode==="highlight"?Jr(e.text,e.color):ml(e.css,e.targetSelector,e.injectMode),EVALUATE_DONE_CRITERIA:e=>gl(e.criteria),COPY_TO_CLIPBOARD:e=>Qr(e.text),PASTE_FROM_CLIPBOARD:()=>Xr(),WAIT_ELEMENT:e=>nl(e.selector,e.state,e.timeout),SELECT_DROPDOWN:e=>{let t=e.triggerSelector;if(e.ref!=null&&!t){let o=cn(e.ref);if(!o.element)return{success:!1,error:m("contentIndex.invalidRef",{ref:e.ref}),...o.suggestions&&o.suggestions.length?{suggestions:o.suggestions}:{}};t=o.entry.selector}return sl(t,e.optionText,e.optionSelector,e.timeout)},QRCODE:e=>ul(e.content,e.size,e.errorCorrection,e.showImage),START_REGION_SELECTION:()=>is(),GET_PAGE_METRICS:()=>({width:Math.max(document.documentElement.scrollWidth,document.body.scrollWidth||0,window.innerWidth),height:Math.max(document.documentElement.scrollHeight,document.body.scrollHeight||0,window.innerHeight)})},ns=new Set(["COPY_TO_CLIPBOARD","PASTE_FROM_CLIPBOARD","WAIT_ELEMENT","SELECT_DROPDOWN","QRCODE","START_REGION_SELECTION","INTERACT_ELEMENT","SCROLL_TO","KEYBOARD_INPUT"]),as=new Set(["GET_PAGE_TEXT","GET_FULL_HTML","EXTRACT_METADATA","EXTRACT_TABLE","IFRAME_CONTENT","QUERY_ELEMENTS","EVALUATE_DONE_CRITERIA","INTERACT_ELEMENT","SCROLL_TO"]);de()&&chrome.runtime.onMessage.addListener((e,t,o)=>{if(as.has(e.type)&&window.top!==window&&!e._frameRouted)return;if(e.action==="getSelectedText"){let a=window.getSelection()?.toString()?.trim()||"";if(a&&document.hasFocus())return o({text:a}),!0;let r=Pe();return r.text&&r.text.trim()&&document.hasFocus()&&o({text:r.text.trim()}),!0}let n=os[e.type];if(!n)return;let i=n(e);if(ns.has(e.type)||i instanceof Promise)return Promise.resolve(i).then(o),!0;o(i)}),window.addEventListener("error",e=>{e.message&&e.message.includes("Extension context invalidated")&&e.preventDefault()}),window.addEventListener("unhandledrejection",e=>{(e.reason?.message||String(e.reason)).includes("Extension context invalidated")&&e.preventDefault()}),ts.then(()=>{es()});function is(){return new Promise(e=>{let t=document.createElement("div");t.id="__region_select_overlay__",t.style.cssText=`
|
|
995
1002
|
position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
|
|
996
1003
|
z-index: 2147483647; cursor: crosshair;
|
|
997
1004
|
background: rgba(0, 0, 0, 0.15);
|
|
@@ -1006,4 +1013,4 @@ ${t}`:a[e]||t;if(e==="ai-search"){H(),window.getSelection().removeAllRanges();tr
|
|
|
1006
1013
|
padding: 8px 20px; border-radius: 20px;
|
|
1007
1014
|
background: rgba(0, 0, 0, 0.75); color: #fff;
|
|
1008
1015
|
font-size: 14px; font-family: sans-serif;
|
|
1009
|
-
`,n.textContent=
|
|
1016
|
+
`,n.textContent=m("contentIndex.regionSelectHint");let i=0,a=0,r=!1;function s(p){return{x:p.clientX,y:p.clientY}}function c(p,h,b,x){let w=Math.min(p,b),k=Math.min(h,x),S=Math.abs(b-p),D=Math.abs(x-h);o.style.left=w+"px",o.style.top=k+"px",o.style.width=S+"px",o.style.height=D+"px",o.style.display="block"}function d(){t.remove(),o.remove(),n.remove(),document.removeEventListener("keydown",u,!0)}function u(p){p.key==="Escape"&&(p.preventDefault(),p.stopPropagation(),d(),e(null))}t.addEventListener("mousedown",p=>{if(p.button!==0)return;p.preventDefault(),p.stopPropagation();let{x:h,y:b}=s(p);i=h,a=b,r=!0,document.body.appendChild(o),document.body.appendChild(n)}),t.addEventListener("mousemove",p=>{if(!r)return;p.preventDefault();let{x:h,y:b}=s(p);c(i,a,h,b)}),t.addEventListener("mouseup",p=>{if(!r)return;p.preventDefault(),p.stopPropagation(),r=!1;let{x:h,y:b}=s(p),x={x:Math.min(i,h),y:Math.min(a,b),width:Math.abs(h-i),height:Math.abs(b-a)};if(d(),x.width<10||x.height<10){e(null);return}requestAnimationFrame(()=>e(x))}),document.addEventListener("keydown",u,!0),document.body.appendChild(t)})}})();
|